Squashed 'yocto-poky/' content from commit ea562de

git-subtree-dir: yocto-poky
git-subtree-split: ea562de57590c966cd5a75fda8defecd397e6436
diff --git a/meta/COPYING.GPLv2 b/meta/COPYING.GPLv2
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/meta/COPYING.GPLv2
@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/meta/COPYING.MIT b/meta/COPYING.MIT
new file mode 100644
index 0000000..fb950dc
--- /dev/null
+++ b/meta/COPYING.MIT
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy 
+of this software and associated documentation files (the "Software"), to deal 
+in the Software without restriction, including without limitation the rights 
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+copies of the Software, and to permit persons to whom the Software is 
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in 
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
+THE SOFTWARE.
diff --git a/meta/classes/allarch.bbclass b/meta/classes/allarch.bbclass
new file mode 100644
index 0000000..2fea7c0
--- /dev/null
+++ b/meta/classes/allarch.bbclass
@@ -0,0 +1,43 @@
+#
+# This class is used for architecture independent recipes/data files (usally scripts)
+#
+
+# Expand STAGING_DIR_HOST since for cross-canadian/native/nativesdk, this will
+# point elsewhere after these changes.
+STAGING_DIR_HOST := "${STAGING_DIR_HOST}"
+
+PACKAGE_ARCH = "all"
+
+python () {
+    # Allow this class to be included but overridden - only set
+    # the values if we're still "all" package arch.
+    if d.getVar("PACKAGE_ARCH", True) == "all":
+        # No need for virtual/libc or a cross compiler
+        d.setVar("INHIBIT_DEFAULT_DEPS","1")
+
+        # Set these to a common set of values, we shouldn't be using them other that for WORKDIR directory
+        # naming anyway
+        d.setVar("TARGET_ARCH", "allarch")
+        d.setVar("TARGET_OS", "linux")
+        d.setVar("TARGET_CC_ARCH", "none")
+        d.setVar("TARGET_LD_ARCH", "none")
+        d.setVar("TARGET_AS_ARCH", "none")
+        d.setVar("TARGET_FPU", "")
+        d.setVar("TARGET_PREFIX", "")
+        d.setVar("PACKAGE_EXTRA_ARCHS", "")
+        d.setVar("SDK_ARCH", "none")
+        d.setVar("SDK_CC_ARCH", "none")
+
+        # Avoid this being unnecessarily different due to nuances of
+        # the target machine that aren't important for "all" arch
+        # packages.
+        d.setVar("LDFLAGS", "")
+
+        # No need to do shared library processing or debug symbol handling
+        d.setVar("EXCLUDE_FROM_SHLIBS", "1")
+        d.setVar("INHIBIT_PACKAGE_DEBUG_SPLIT", "1")
+        d.setVar("INHIBIT_PACKAGE_STRIP", "1")
+    elif bb.data.inherits_class('packagegroup', d) and not bb.data.inherits_class('nativesdk', d):
+        bb.error("Please ensure recipe %s sets PACKAGE_ARCH before inherit packagegroup" % d.getVar("FILE", True))
+}
+
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
new file mode 100644
index 0000000..089d707
--- /dev/null
+++ b/meta/classes/archiver.bbclass
@@ -0,0 +1,385 @@
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# This bbclass is used for creating archive for:
+# 1) original (or unpacked) source: ARCHIVER_MODE[src] = "original"
+# 2) patched source: ARCHIVER_MODE[src] = "patched" (default)
+# 3) configured source: ARCHIVER_MODE[src] = "configured"
+# 4) The patches between do_unpack and do_patch:
+#    ARCHIVER_MODE[diff] = "1"
+#    And you can set the one that you'd like to exclude from the diff:
+#    ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
+# 5) The environment data, similar to 'bitbake -e recipe':
+#    ARCHIVER_MODE[dumpdata] = "1"
+# 6) The recipe (.bb and .inc): ARCHIVER_MODE[recipe] = "1"
+# 7) Whether output the .src.rpm package:
+#    ARCHIVER_MODE[srpm] = "1"
+# 8) Filter the license, the recipe whose license in
+#    COPYLEFT_LICENSE_INCLUDE will be included, and in
+#    COPYLEFT_LICENSE_EXCLUDE will be excluded.
+#    COPYLEFT_LICENSE_INCLUDE = 'GPL* LGPL*'
+#    COPYLEFT_LICENSE_EXCLUDE = 'CLOSED Proprietary'
+# 9) The recipe type that will be archived:
+#    COPYLEFT_RECIPE_TYPES = 'target'
+#
+
+# Don't filter the license by default
+COPYLEFT_LICENSE_INCLUDE ?= ''
+COPYLEFT_LICENSE_EXCLUDE ?= ''
+# Create archive for all the recipe types
+COPYLEFT_RECIPE_TYPES ?= 'target native nativesdk cross crosssdk cross-canadian'
+inherit copyleft_filter
+
+ARCHIVER_MODE[srpm] ?= "0"
+ARCHIVER_MODE[src] ?= "patched"
+ARCHIVER_MODE[diff] ?= "0"
+ARCHIVER_MODE[diff-exclude] ?= ".pc autom4te.cache patches"
+ARCHIVER_MODE[dumpdata] ?= "0"
+ARCHIVER_MODE[recipe] ?= "0"
+
+DEPLOY_DIR_SRC ?= "${DEPLOY_DIR}/sources"
+ARCHIVER_TOPDIR ?= "${WORKDIR}/deploy-sources"
+ARCHIVER_OUTDIR = "${ARCHIVER_TOPDIR}/${TARGET_SYS}/${PF}/"
+ARCHIVER_WORKDIR = "${WORKDIR}/archiver-work/"
+
+do_dumpdata[dirs] = "${ARCHIVER_OUTDIR}"
+do_ar_recipe[dirs] = "${ARCHIVER_OUTDIR}"
+do_ar_original[dirs] = "${ARCHIVER_OUTDIR} ${ARCHIVER_WORKDIR}"
+do_deploy_archives[dirs] = "${WORKDIR}"
+do_deploy_all_archives[dirs] = "${WORKDIR}"
+
+# This is a convenience for the shell script to use it
+
+
+python () {
+    pn = d.getVar('PN', True)
+
+    included, reason = copyleft_should_include(d)
+    if not included:
+        bb.debug(1, 'archiver: %s is excluded: %s' % (pn, reason))
+        return
+    else:
+        bb.debug(1, 'archiver: %s is included: %s' % (pn, reason))
+
+    ar_src = d.getVarFlag('ARCHIVER_MODE', 'src', True)
+    ar_dumpdata = d.getVarFlag('ARCHIVER_MODE', 'dumpdata', True)
+    ar_recipe = d.getVarFlag('ARCHIVER_MODE', 'recipe', True)
+
+    if ar_src == "original":
+        d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_original' % pn)
+    elif ar_src == "patched":
+        d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_patched' % pn)
+    elif ar_src == "configured":
+        # We can't use "addtask do_ar_configured after do_configure" since it
+        # will cause the deptask of do_populate_sysroot to run not matter what
+        # archives we need, so we add the depends here.
+        d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_configure' % pn)
+        d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_configured' % pn)
+    elif ar_src:
+        bb.fatal("Invalid ARCHIVER_MODE[src]: %s" % ar_src)
+
+    if ar_dumpdata == "1":
+        d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_dumpdata' % pn)
+
+    if ar_recipe == "1":
+        d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_ar_recipe' % pn)
+
+    # Output the srpm package
+    ar_srpm = d.getVarFlag('ARCHIVER_MODE', 'srpm', True)
+    if ar_srpm == "1":
+        if d.getVar('PACKAGES', True) != '' and d.getVar('IMAGE_PKGTYPE', True) == 'rpm':
+            d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_package_write_rpm' % pn)
+            if ar_dumpdata == "1":
+                d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_dumpdata' % pn)
+            if ar_recipe == "1":
+                d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_recipe' % pn)
+            if ar_src == "original":
+                d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_original' % pn)
+            elif ar_src == "patched":
+                d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_patched' % pn)
+            elif ar_src == "configured":
+                d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_configured' % pn)
+
+    # The gcc staff uses shared source
+    flag = d.getVarFlag("do_unpack", "stamp-base", True)
+    if flag:
+        if ar_src in [ 'original', 'patched' ]:
+            ar_outdir = os.path.join(d.getVar('ARCHIVER_TOPDIR', True), 'work-shared')
+            d.setVar('ARCHIVER_OUTDIR', ar_outdir)
+        d.setVarFlag('do_ar_original', 'stamp-base', flag)
+        d.setVarFlag('do_ar_patched', 'stamp-base', flag)
+        d.setVarFlag('do_unpack_and_patch', 'stamp-base', flag)
+        d.setVarFlag('do_ar_original', 'vardepsexclude', 'PN PF ARCHIVER_OUTDIR WORKDIR')
+        d.setVarFlag('do_unpack_and_patch', 'vardepsexclude', 'PN PF ARCHIVER_OUTDIR WORKDIR')
+        d.setVarFlag('do_ar_patched', 'vardepsexclude', 'PN PF ARCHIVER_OUTDIR WORKDIR')
+        d.setVarFlag('create_diff_gz', 'vardepsexclude', 'PF')
+        d.setVarFlag('create_tarball', 'vardepsexclude', 'PF')
+
+        flag_clean = d.getVarFlag('do_unpack', 'stamp-base-clean', True)
+        if flag_clean:
+            d.setVarFlag('do_ar_original', 'stamp-base-clean', flag_clean)
+            d.setVarFlag('do_ar_patched', 'stamp-base-clean', flag_clean)
+            d.setVarFlag('do_unpack_and_patch', 'stamp-base-clean', flag_clean)
+}
+
+# Take all the sources for a recipe and puts them in WORKDIR/archiver-work/.
+# Files in SRC_URI are copied directly, anything that's a directory
+# (e.g. git repositories) is "unpacked" and then put into a tarball.
+python do_ar_original() {
+
+    import shutil, tarfile, tempfile
+
+    if d.getVarFlag('ARCHIVER_MODE', 'src', True) != "original":
+        return
+
+    ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+    bb.note('Archiving the original source...')
+    fetch = bb.fetch2.Fetch([], d)
+    for url in fetch.urls:
+        local = fetch.localpath(url).rstrip("/");
+        if os.path.isfile(local):
+            shutil.copy(local, ar_outdir)
+        elif os.path.isdir(local):
+            basename = os.path.basename(local)
+
+            tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR', True))
+            fetch.unpack(tmpdir, (url,))
+
+            os.chdir(tmpdir)
+            # We eliminate any AUTOINC+ in the revision.
+            try:
+                src_rev = bb.fetch2.get_srcrev(d).replace('AUTOINC+','')
+            except:
+                src_rev = 'NOREV'
+            tarname = os.path.join(ar_outdir, basename + '.' + src_rev + '.tar.gz')
+            tar = tarfile.open(tarname, 'w:gz')
+            tar.add('.')
+            tar.close()
+
+    # Emit patch series files for 'original'
+    bb.note('Writing patch series files...')
+    for patch in src_patches(d):
+        _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
+        patchdir = parm.get('patchdir')
+        if patchdir:
+            series = os.path.join(ar_outdir, 'series.subdir.%s' % patchdir.replace('/', '_'))
+        else:
+            series = os.path.join(ar_outdir, 'series')
+
+        with open(series, 'a') as s:
+            s.write('%s -p%s\n' % (os.path.basename(local), parm['striplevel']))
+}
+
+python do_ar_patched() {
+
+    if d.getVarFlag('ARCHIVER_MODE', 'src', True) != 'patched':
+        return
+
+    # Get the ARCHIVER_OUTDIR before we reset the WORKDIR
+    ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+    bb.note('Archiving the patched source...')
+    d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR', True))
+    # The gcc staff uses shared source
+    flag = d.getVarFlag('do_unpack', 'stamp-base', True)
+    if flag:
+        create_tarball(d, d.getVar('S', True), 'patched', ar_outdir, 'gcc')
+    else:
+        create_tarball(d, d.getVar('S', True), 'patched', ar_outdir)
+}
+
+python do_ar_configured() {
+    import shutil
+
+    ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+    if d.getVarFlag('ARCHIVER_MODE', 'src', True) == 'configured':
+        bb.note('Archiving the configured source...')
+        # The libtool-native's do_configure will remove the
+        # ${STAGING_DATADIR}/aclocal/libtool.m4, so we can't re-run the
+        # do_configure, we archive the already configured ${S} to
+        # instead of.
+        if d.getVar('PN', True) != 'libtool-native':
+            # Change the WORKDIR to make do_configure run in another dir.
+            d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR', True))
+            if bb.data.inherits_class('kernel-yocto', d):
+                bb.build.exec_func('do_kernel_configme', d)
+            if bb.data.inherits_class('cmake', d):
+                bb.build.exec_func('do_generate_toolchain_file', d)
+            prefuncs = d.getVarFlag('do_configure', 'prefuncs', True)
+            for func in (prefuncs or '').split():
+                if func != "sysroot_cleansstate":
+                    bb.build.exec_func(func, d)
+            bb.build.exec_func('do_configure', d)
+            postfuncs = d.getVarFlag('do_configure', 'postfuncs', True)
+            for func in (postfuncs or '').split():
+                if func != "do_qa_configure":
+                    bb.build.exec_func(func, d)
+        srcdir = d.getVar('S', True)
+        builddir = d.getVar('B', True)
+        if srcdir != builddir:
+            if os.path.exists(builddir):
+                oe.path.copytree(builddir, os.path.join(srcdir, \
+                    'build.%s.ar_configured' % d.getVar('PF', True)))
+        create_tarball(d, srcdir, 'configured', ar_outdir)
+}
+
+def create_tarball(d, srcdir, suffix, ar_outdir, pf=None):
+    """
+    create the tarball from srcdir
+    """
+    import tarfile
+
+    bb.utils.mkdirhier(ar_outdir)
+    if pf:
+        tarname = os.path.join(ar_outdir, '%s-%s.tar.gz' % (pf, suffix))
+    else:
+        tarname = os.path.join(ar_outdir, '%s-%s.tar.gz' % \
+            (d.getVar('PF', True), suffix))
+
+    srcdir = srcdir.rstrip('/')
+    dirname = os.path.dirname(srcdir)
+    basename = os.path.basename(srcdir)
+    os.chdir(dirname)
+    bb.note('Creating %s' % tarname)
+    tar = tarfile.open(tarname, 'w:gz')
+    tar.add(basename)
+    tar.close()
+
+# creating .diff.gz between source.orig and source
+def create_diff_gz(d, src_orig, src, ar_outdir):
+
+    import subprocess
+
+    if not os.path.isdir(src) or not os.path.isdir(src_orig):
+        return
+
+    # The diff --exclude can't exclude the file with path, so we copy
+    # the patched source, and remove the files that we'd like to
+    # exclude.
+    src_patched = src + '.patched'
+    oe.path.copyhardlinktree(src, src_patched)
+    for i in d.getVarFlag('ARCHIVER_MODE', 'diff-exclude', True).split():
+        bb.utils.remove(os.path.join(src_orig, i), recurse=True)
+        bb.utils.remove(os.path.join(src_patched, i), recurse=True)
+
+    dirname = os.path.dirname(src)
+    basename = os.path.basename(src)
+    os.chdir(dirname)
+    out_file = os.path.join(ar_outdir, '%s-diff.gz' % d.getVar('PF', True))
+    diff_cmd = 'diff -Naur %s.orig %s.patched | gzip -c > %s' % (basename, basename, out_file)
+    subprocess.call(diff_cmd, shell=True)
+    bb.utils.remove(src_patched, recurse=True)
+
+# Run do_unpack and do_patch
+python do_unpack_and_patch() {
+    if d.getVarFlag('ARCHIVER_MODE', 'src', True) not in \
+            [ 'patched', 'configured'] and \
+            d.getVarFlag('ARCHIVER_MODE', 'diff', True) != '1':
+        return
+
+    ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+
+    # Change the WORKDIR to make do_unpack do_patch run in another dir.
+    d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR', True))
+
+    # The changed 'WORKDIR' also casued 'B' changed, create dir 'B' for the
+    # possibly requiring of the following tasks (such as some recipes's
+    # do_patch required 'B' existed).
+    bb.utils.mkdirhier(d.getVar('B', True))
+
+    # The kernel source is ready after do_validate_branches
+    if bb.data.inherits_class('kernel-yocto', d):
+        bb.build.exec_func('do_unpack', d)
+        bb.build.exec_func('do_kernel_checkout', d)
+        bb.build.exec_func('do_validate_branches', d)
+    else:
+        bb.build.exec_func('do_unpack', d)
+
+    # Save the original source for creating the patches
+    if d.getVarFlag('ARCHIVER_MODE', 'diff', True) == '1':
+        src = d.getVar('S', True).rstrip('/')
+        src_orig = '%s.orig' % src
+        oe.path.copytree(src, src_orig)
+    bb.build.exec_func('do_patch', d)
+    # Create the patches
+    if d.getVarFlag('ARCHIVER_MODE', 'diff', True) == '1':
+        bb.note('Creating diff gz...')
+        create_diff_gz(d, src_orig, src, ar_outdir)
+        bb.utils.remove(src_orig, recurse=True)
+}
+
+python do_ar_recipe () {
+    """
+    archive the recipe, including .bb and .inc.
+    """
+    import re
+    import shutil
+
+    require_re = re.compile( r"require\s+(.+)" )
+    include_re = re.compile( r"include\s+(.+)" )
+    bbfile = d.getVar('FILE', True)
+    outdir = os.path.join(d.getVar('WORKDIR', True), \
+            '%s-recipe' % d.getVar('PF', True))
+    bb.utils.mkdirhier(outdir)
+    shutil.copy(bbfile, outdir)
+
+    dirname = os.path.dirname(bbfile)
+    bbpath = '%s:%s' % (dirname, d.getVar('BBPATH', True))
+    f = open(bbfile, 'r')
+    for line in f.readlines():
+        incfile = None
+        if require_re.match(line):
+            incfile = require_re.match(line).group(1)
+        elif include_re.match(line):
+            incfile = include_re.match(line).group(1)
+        if incfile:
+            incfile = bb.data.expand(incfile, d)
+            incfile = bb.utils.which(bbpath, incfile)
+            if incfile:
+                shutil.copy(incfile, outdir)
+
+    create_tarball(d, outdir, 'recipe', d.getVar('ARCHIVER_OUTDIR', True))
+    bb.utils.remove(outdir, recurse=True)
+}
+
+python do_dumpdata () {
+    """
+    dump environment data to ${PF}-showdata.dump
+    """
+
+    dumpfile = os.path.join(d.getVar('ARCHIVER_OUTDIR', True), \
+        '%s-showdata.dump' % d.getVar('PF', True))
+    bb.note('Dumping metadata into %s' % dumpfile)
+    f = open(dumpfile, 'w')
+    # emit variables and shell functions
+    bb.data.emit_env(f, d, True)
+    # emit the metadata which isn't valid shell
+    for e in d.keys():
+        if bb.data.getVarFlag(e, 'python', d):
+            f.write("\npython %s () {\n%s}\n" % (e, bb.data.getVar(e, d, True)))
+    f.close()
+}
+
+SSTATETASKS += "do_deploy_archives"
+do_deploy_archives () {
+    echo "Deploying source archive files ..."
+}
+python do_deploy_archives_setscene () {
+    sstate_setscene(d)
+}
+do_deploy_archives[sstate-inputdirs] = "${ARCHIVER_TOPDIR}"
+do_deploy_archives[sstate-outputdirs] = "${DEPLOY_DIR_SRC}"
+
+addtask do_ar_original after do_unpack
+addtask do_unpack_and_patch after do_patch
+addtask do_ar_patched after do_unpack_and_patch
+addtask do_ar_configured after do_unpack_and_patch
+addtask do_dumpdata
+addtask do_ar_recipe
+addtask do_deploy_archives before do_build
+
+addtask do_deploy_all_archives after do_deploy_archives
+do_deploy_all_archives[recrdeptask] = "do_deploy_archives"
+do_deploy_all_archives[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_deploy_all_archives() {
+        :
+}
diff --git a/meta/classes/autotools-brokensep.bbclass b/meta/classes/autotools-brokensep.bbclass
new file mode 100644
index 0000000..71cf97a
--- /dev/null
+++ b/meta/classes/autotools-brokensep.bbclass
@@ -0,0 +1,5 @@
+# Autotools class for recipes where separate build dir doesn't work
+# Ideally we should fix software so it does work. Standard autotools supports
+# this.
+inherit autotools
+B = "${S}"
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
new file mode 100644
index 0000000..9ccd7d2
--- /dev/null
+++ b/meta/classes/autotools.bbclass
@@ -0,0 +1,312 @@
+def autotools_dep_prepend(d):
+    if d.getVar('INHIBIT_AUTOTOOLS_DEPS', True):
+        return ''
+
+    pn = d.getVar('PN', True)
+    deps = ''
+
+    if pn in ['autoconf-native', 'automake-native', 'help2man-native']:
+        return deps
+    deps += 'autoconf-native automake-native '
+
+    if not pn in ['libtool', 'libtool-native'] and not pn.endswith("libtool-cross"):
+        deps += 'libtool-native '
+        if not bb.data.inherits_class('native', d) \
+                        and not bb.data.inherits_class('nativesdk', d) \
+                        and not bb.data.inherits_class('cross', d) \
+                        and not d.getVar('INHIBIT_DEFAULT_DEPS', True):
+            deps += 'libtool-cross '
+
+    return deps + 'gnu-config-native '
+
+EXTRA_OEMAKE = ""
+
+DEPENDS_prepend = "${@autotools_dep_prepend(d)} "
+
+inherit siteinfo
+
+# Space separated list of shell scripts with variables defined to supply test
+# results for autoconf tests we cannot run at build time.
+export CONFIG_SITE = "${@siteinfo_get_files(d, False)}"
+
+acpaths = "default"
+EXTRA_AUTORECONF = "--exclude=autopoint"
+
+export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir}"
+
+# When building tools for use at build-time it's recommended for the build
+# system to use these variables when cross-compiling.
+# (http://sources.redhat.com/autobook/autobook/autobook_270.html)
+export CPP_FOR_BUILD = "${BUILD_CPP}"
+export CPPFLAGS_FOR_BUILD = "${BUILD_CPPFLAGS}"
+
+export CC_FOR_BUILD = "${BUILD_CC}"
+export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
+
+export CXX_FOR_BUILD = "${BUILD_CXX}"
+export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
+
+export LD_FOR_BUILD = "${BUILD_LD}"
+export LDFLAGS_FOR_BUILD = "${BUILD_LDFLAGS}"
+
+def append_libtool_sysroot(d):
+    # Only supply libtool sysroot option for non-native packages
+    if not bb.data.inherits_class('native', d):
+        return '--with-libtool-sysroot=${STAGING_DIR_HOST}'
+    return ""
+
+CONFIGUREOPTS = " --build=${BUILD_SYS} \
+		  --host=${HOST_SYS} \
+		  --target=${TARGET_SYS} \
+		  --prefix=${prefix} \
+		  --exec_prefix=${exec_prefix} \
+		  --bindir=${bindir} \
+		  --sbindir=${sbindir} \
+		  --libexecdir=${libexecdir} \
+		  --datadir=${datadir} \
+		  --sysconfdir=${sysconfdir} \
+		  --sharedstatedir=${sharedstatedir} \
+		  --localstatedir=${localstatedir} \
+		  --libdir=${libdir} \
+		  --includedir=${includedir} \
+		  --oldincludedir=${oldincludedir} \
+		  --infodir=${infodir} \
+		  --mandir=${mandir} \
+		  --disable-silent-rules \
+		  ${CONFIGUREOPT_DEPTRACK} \
+		  ${@append_libtool_sysroot(d)}"
+CONFIGUREOPT_DEPTRACK ?= "--disable-dependency-tracking"
+
+
+oe_runconf () {
+	cfgscript="${S}/configure"
+	if [ -x "$cfgscript" ] ; then
+		bbnote "Running $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} $@"
+		set +e
+		${CACHED_CONFIGUREVARS} $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"
+		if [ "$?" != "0" ]; then
+			echo "Configure failed. The contents of all config.log files follows to aid debugging"
+			find ${S} -ignore_readdir_race -name config.log -print -exec cat {} \;
+			die "oe_runconf failed"
+		fi
+		set -e
+	else
+		bbfatal "no configure script found at $cfgscript"
+	fi
+}
+
+AUTOTOOLS_AUXDIR ?= "${S}"
+
+CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
+
+autotools_preconfigure() {
+	if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
+		if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" ]; then
+			if [ "${S}" != "${B}" ]; then
+				echo "Previously configured separate build directory detected, cleaning ${B}"
+				rm -rf ${B}
+				mkdir ${B}
+			else
+				# At least remove the .la files since automake won't automatically
+				# regenerate them even if CFLAGS/LDFLAGS are different
+				cd ${S}
+				if [ "${CLEANBROKEN}" != "1" -a \( -e Makefile -o -e makefile -o -e GNUmakefile \) ]; then
+					echo "Running \"${MAKE} clean\" in ${S}"
+					${MAKE} clean
+				fi
+				find ${S} -ignore_readdir_race -name \*.la -delete
+			fi
+		fi
+	fi
+}
+
+autotools_postconfigure(){
+	if [ -n "${CONFIGURESTAMPFILE}" ]; then
+		echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+	fi
+}
+
+EXTRACONFFUNCS ??= ""
+
+do_configure[prefuncs] += "autotools_preconfigure autotools_copy_aclocals ${EXTRACONFFUNCS}"
+do_configure[postfuncs] += "autotools_postconfigure"
+
+ACLOCALDIR = "${B}/aclocal-copy"
+
+python autotools_copy_aclocals () {
+    s = d.getVar("S", True)
+    if not os.path.exists(s + "/configure.in") and not os.path.exists(s + "/configure.ac"):
+        if not d.getVar("AUTOTOOLS_COPYACLOCAL", False):
+            return
+
+    taskdepdata = d.getVar("BB_TASKDEPDATA", False)
+    #bb.warn(str(taskdepdata))
+    pn = d.getVar("PN", True)
+    aclocaldir = d.getVar("ACLOCALDIR", True)
+    oe.path.remove(aclocaldir)
+    bb.utils.mkdirhier(aclocaldir)
+    start = None
+    configuredeps = []
+
+    for dep in taskdepdata:
+        data = taskdepdata[dep]
+        if data[1] == "do_configure" and data[0] == pn:
+            start = dep
+            break
+    if start is None:
+        bb.fatal("Couldn't find ourself in BB_TASKDEPDATA?")
+
+    # We need to find configure tasks which are either from <target> -> <target>
+    # or <native> -> <native> but not <target> -> <native> unless they're direct
+    # dependencies. This mirrors what would get restored from sstate.
+    done = [dep]
+    next = [dep]
+    while next:
+        new = []
+        for dep in next:
+            data = taskdepdata[dep]
+            for datadep in data[3]:
+                if datadep in done:
+                    continue
+                done.append(datadep)
+                if (not data[0].endswith("-native")) and taskdepdata[datadep][0].endswith("-native") and dep != start:
+                    continue
+                new.append(datadep)
+                if taskdepdata[datadep][1] == "do_configure":
+                    configuredeps.append(taskdepdata[datadep][0])
+        next = new
+
+    #configuredeps2 = []
+    #for dep in taskdepdata:
+    #    data = taskdepdata[dep]
+    #    if data[1] == "do_configure" and data[0] != pn:
+    #        configuredeps2.append(data[0])
+    #configuredeps.sort()
+    #configuredeps2.sort()
+    #bb.warn(str(configuredeps))
+    #bb.warn(str(configuredeps2))
+
+    cp = []
+    siteconf = []    
+    for c in configuredeps:
+        if c.endswith("-native"):
+            manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${BUILD_ARCH}-%s.populate_sysroot" % c)
+        elif c.startswith("nativesdk-"):
+            manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${SDK_ARCH}_${SDK_OS}-%s.populate_sysroot" % c)
+        elif "-cross-" in c or "-crosssdk" in c:
+            continue
+        else:
+            manifest = d.expand("${SSTATE_MANIFESTS}/manifest-${MACHINE}-%s.populate_sysroot" % c)
+        try:
+            f = open(manifest, "r")
+            for l in f:
+                if "/aclocal/" in l and l.strip().endswith(".m4"):
+                    cp.append(l.strip())
+                elif "config_site.d/" in l:
+                    cp.append(l.strip())
+        except:
+            bb.warn("%s not found" % manifest)
+
+    for c in cp:
+        t = os.path.join(aclocaldir, os.path.basename(c))
+        if not os.path.exists(t):
+            os.symlink(c, t)
+            
+    d.setVar("CONFIG_SITE", siteinfo_get_files(d, False))
+}
+autotools_copy_aclocals[vardepsexclude] += "MACHINE SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA"
+
+autotools_do_configure() {
+	# WARNING: gross hack follows:
+	# An autotools built package generally needs these scripts, however only
+	# automake or libtoolize actually install the current versions of them.
+	# This is a problem in builds that do not use libtool or automake, in the case
+	# where we -need- the latest version of these scripts.  e.g. running a build
+	# for a package whose autotools are old, on an x86_64 machine, which the old
+	# config.sub does not support.  Work around this by installing them manually
+	# regardless.
+	( for ac in `find ${S} -ignore_readdir_race -name configure.in -o -name configure.ac`; do
+		rm -f `dirname $ac`/configure
+		done )
+	if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
+		olddir=`pwd`
+		cd ${S}
+		ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/"
+		if [ x"${acpaths}" = xdefault ]; then
+			acpaths=
+			for i in `find ${S} -ignore_readdir_race -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
+				grep -v 'acinclude.m4' | grep -v 'aclocal-copy' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
+				acpaths="$acpaths -I $i"
+			done
+		else
+			acpaths="${acpaths}"
+		fi
+		AUTOV=`automake --version | sed -e '1{s/.* //;s/\.[0-9]\+$//};q'`
+		automake --version
+		echo "AUTOV is $AUTOV"
+		if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then
+			ACLOCAL="$ACLOCAL --automake-acdir=${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV"
+		fi
+		# autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
+		# like it was auto-generated.  Work around this by blowing it away
+		# by hand, unless the package specifically asked not to run aclocal.
+		if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
+			rm -f aclocal.m4
+		fi
+		if [ -e configure.in ]; then
+			CONFIGURE_AC=configure.in
+		else
+			CONFIGURE_AC=configure.ac
+		fi
+		if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
+			if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
+				: do nothing -- we still have an old unmodified configure.ac
+	    		else
+				bbnote Executing glib-gettextize --force --copy
+				echo "no" | glib-gettextize --force --copy
+			fi
+		else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
+			# We'd call gettextize here if it wasn't so broken...
+				cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
+				if [ -d ${S}/po/ ]; then
+					cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
+					if [ ! -e ${S}/po/remove-potcdate.sin ]; then
+						cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sin ${S}/po/
+					fi
+				fi
+				for i in gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4; do
+					for j in `find ${S} -ignore_readdir_race -name $i | grep -v aclocal-copy`; do
+						rm $j
+					done
+				done
+			fi
+		fi
+		mkdir -p m4
+		if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
+			bbnote Executing intltoolize --copy --force --automake
+			intltoolize --copy --force --automake
+		fi
+		bbnote Executing ACLOCAL=\"$ACLOCAL\" autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
+		ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed."
+		cd $olddir
+	fi
+	if [ -e ${S}/configure ]; then
+		oe_runconf
+	else
+		bbnote "nothing to configure"
+	fi
+}
+
+autotools_do_install() {
+	oe_runmake 'DESTDIR=${D}' install
+	# Info dir listing isn't interesting at this point so remove it if it exists.
+	if [ -e "${D}${infodir}/dir" ]; then
+		rm -f ${D}${infodir}/dir
+	fi
+}
+
+inherit siteconfig
+
+EXPORT_FUNCTIONS do_configure do_install
+
+B = "${WORKDIR}/build"
diff --git a/meta/classes/autotools_stage.bbclass b/meta/classes/autotools_stage.bbclass
new file mode 100644
index 0000000..b3c41e4
--- /dev/null
+++ b/meta/classes/autotools_stage.bbclass
@@ -0,0 +1,2 @@
+inherit autotools
+
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
new file mode 100644
index 0000000..f078001
--- /dev/null
+++ b/meta/classes/base.bbclass
@@ -0,0 +1,629 @@
+BB_DEFAULT_TASK ?= "build"
+CLASSOVERRIDE ?= "class-target"
+
+inherit patch
+inherit staging
+
+inherit mirrors
+inherit utils
+inherit utility-tasks
+inherit metadata_scm
+inherit logging
+
+OE_IMPORTS += "os sys time oe.path oe.utils oe.data oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath"
+OE_IMPORTS[type] = "list"
+
+def oe_import(d):
+    import sys
+
+    bbpath = d.getVar("BBPATH", True).split(":")
+    sys.path[0:0] = [os.path.join(dir, "lib") for dir in bbpath]
+
+    def inject(name, value):
+        """Make a python object accessible from the metadata"""
+        if hasattr(bb.utils, "_context"):
+            bb.utils._context[name] = value
+        else:
+            __builtins__[name] = value
+
+    import oe.data
+    for toimport in oe.data.typed_value("OE_IMPORTS", d):
+        imported = __import__(toimport)
+        inject(toimport.split(".", 1)[0], imported)
+
+    return ""
+
+# We need the oe module name space early (before INHERITs get added)
+OE_IMPORTED := "${@oe_import(d)}"
+
+def lsb_distro_identifier(d):
+    adjust = d.getVar('LSB_DISTRO_ADJUST', True)
+    adjust_func = None
+    if adjust:
+        try:
+            adjust_func = globals()[adjust]
+        except KeyError:
+            pass
+    return oe.lsb.distro_identifier(adjust_func)
+
+die() {
+	bbfatal_log "$*"
+}
+
+oe_runmake_call() {
+	bbnote ${MAKE} ${EXTRA_OEMAKE} "$@"
+	${MAKE} ${EXTRA_OEMAKE} "$@"
+}
+
+oe_runmake() {
+	oe_runmake_call "$@" || die "oe_runmake failed"
+}
+
+
+def base_dep_prepend(d):
+    #
+    # Ideally this will check a flag so we will operate properly in
+    # the case where host == build == target, for now we don't work in
+    # that case though.
+    #
+
+    deps = ""
+    # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command.  Whether or  not
+    # we need that built is the responsibility of the patch function / class, not
+    # the application.
+    if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
+        if (d.getVar('HOST_SYS', True) != d.getVar('BUILD_SYS', True)):
+            deps += " virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc "
+    return deps
+
+BASEDEPENDS = "${@base_dep_prepend(d)}"
+
+DEPENDS_prepend="${BASEDEPENDS} "
+
+FILESPATH = "${@base_set_filespath(["${FILE_DIRNAME}/${BP}", "${FILE_DIRNAME}/${BPN}", "${FILE_DIRNAME}/files"], d)}"
+# THISDIR only works properly with imediate expansion as it has to run
+# in the context of the location its used (:=)
+THISDIR = "${@os.path.dirname(d.getVar('FILE', True))}"
+
+def extra_path_elements(d):
+    path = ""
+    elements = (d.getVar('EXTRANATIVEPATH', True) or "").split()
+    for e in elements:
+        path = path + "${STAGING_BINDIR_NATIVE}/" + e + ":"
+    return path
+
+PATH_prepend = "${@extra_path_elements(d)}"
+
+def get_lic_checksum_file_list(d):
+    filelist = []
+    lic_files = d.getVar("LIC_FILES_CHKSUM", True) or ''
+    tmpdir = d.getVar("TMPDIR", True)
+
+    urls = lic_files.split()
+    for url in urls:
+        # We only care about items that are absolute paths since
+        # any others should be covered by SRC_URI.
+        try:
+            path = bb.fetch.decodeurl(url)[2]
+            if path[0] == '/':
+                if path.startswith(tmpdir):
+                    continue
+                filelist.append(path + ":" + str(os.path.exists(path)))
+        except bb.fetch.MalformedUrl:
+            raise bb.build.FuncFailed(d.getVar('PN', True) + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
+    return " ".join(filelist)
+
+addtask fetch
+do_fetch[dirs] = "${DL_DIR}"
+do_fetch[file-checksums] = "${@bb.fetch.get_checksum_file_list(d)}"
+do_fetch[file-checksums] += " ${@get_lic_checksum_file_list(d)}"
+do_fetch[vardeps] += "SRCREV"
+python base_do_fetch() {
+
+    src_uri = (d.getVar('SRC_URI', True) or "").split()
+    if len(src_uri) == 0:
+        return
+
+    try:
+        fetcher = bb.fetch2.Fetch(src_uri, d)
+        fetcher.download()
+    except bb.fetch2.BBFetchException as e:
+        raise bb.build.FuncFailed(e)
+}
+
+addtask unpack after do_fetch
+do_unpack[dirs] = "${WORKDIR}"
+python base_do_unpack() {
+    src_uri = (d.getVar('SRC_URI', True) or "").split()
+    if len(src_uri) == 0:
+        return
+
+    rootdir = d.getVar('WORKDIR', True)
+
+    # Ensure that we cleanup ${S}/patches
+    # TODO: Investigate if we can remove
+    # the entire ${S} in this case.
+    s_dir = d.getVar('S', True)
+    p_dir = os.path.join(s_dir, 'patches')
+    bb.utils.remove(p_dir, True)
+
+    try:
+        fetcher = bb.fetch2.Fetch(src_uri, d)
+        fetcher.unpack(rootdir)
+    except bb.fetch2.BBFetchException as e:
+        raise bb.build.FuncFailed(e)
+}
+
+def pkgarch_mapping(d):
+    # Compatibility mappings of TUNE_PKGARCH (opt in)
+    if d.getVar("PKGARCHCOMPAT_ARMV7A", True):
+        if d.getVar("TUNE_PKGARCH", True) == "armv7a-vfp-neon":
+            d.setVar("TUNE_PKGARCH", "armv7a")
+
+def get_layers_branch_rev(d):
+    layers = (d.getVar("BBLAYERS", True) or "").split()
+    layers_branch_rev = ["%-17s = \"%s:%s\"" % (os.path.basename(i), \
+        base_get_metadata_git_branch(i, None).strip(), \
+        base_get_metadata_git_revision(i, None)) \
+            for i in layers]
+    i = len(layers_branch_rev)-1
+    p1 = layers_branch_rev[i].find("=")
+    s1 = layers_branch_rev[i][p1:]
+    while i > 0:
+        p2 = layers_branch_rev[i-1].find("=")
+        s2= layers_branch_rev[i-1][p2:]
+        if s1 == s2:
+            layers_branch_rev[i-1] = layers_branch_rev[i-1][0:p2]
+            i -= 1
+        else:
+            i -= 1
+            p1 = layers_branch_rev[i].find("=")
+            s1= layers_branch_rev[i][p1:]
+    return layers_branch_rev
+
+
+BUILDCFG_FUNCS ??= "buildcfg_vars get_layers_branch_rev buildcfg_neededvars"
+BUILDCFG_FUNCS[type] = "list"
+
+def buildcfg_vars(d):
+    statusvars = oe.data.typed_value('BUILDCFG_VARS', d)
+    for var in statusvars:
+        value = d.getVar(var, True)
+        if value is not None:
+            yield '%-17s = "%s"' % (var, value)
+
+def buildcfg_neededvars(d):
+    needed_vars = oe.data.typed_value("BUILDCFG_NEEDEDVARS", d)
+    pesteruser = []
+    for v in needed_vars:
+        val = d.getVar(v, True)
+        if not val or val == 'INVALID':
+            pesteruser.append(v)
+
+    if pesteruser:
+        bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser))
+
+addhandler base_eventhandler
+base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise bb.runqueue.sceneQueueComplete"
+python base_eventhandler() {
+    import bb.runqueue
+
+    if isinstance(e, bb.event.ConfigParsed):
+        if not e.data.getVar("NATIVELSBSTRING", False):
+            e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data))
+        e.data.setVar('BB_VERSION', bb.__version__)
+        pkgarch_mapping(e.data)
+        oe.utils.features_backfill("DISTRO_FEATURES", e.data)
+        oe.utils.features_backfill("MACHINE_FEATURES", e.data)
+
+    if isinstance(e, bb.event.BuildStarted):
+        localdata = bb.data.createCopy(e.data)
+        bb.data.update_data(localdata)
+        statuslines = []
+        for func in oe.data.typed_value('BUILDCFG_FUNCS', localdata):
+            g = globals()
+            if func not in g:
+                bb.warn("Build configuration function '%s' does not exist" % func)
+            else:
+                flines = g[func](localdata)
+                if flines:
+                    statuslines.extend(flines)
+
+        statusheader = e.data.getVar('BUILDCFG_HEADER', True)
+        bb.plain('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
+
+    # This code is to silence warnings where the SDK variables overwrite the 
+    # target ones and we'd see dulpicate key names overwriting each other
+    # for various PREFERRED_PROVIDERS
+    if isinstance(e, bb.event.RecipePreFinalise):
+        if e.data.getVar("TARGET_PREFIX", True) == e.data.getVar("SDK_PREFIX", True):
+            e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils")
+            e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial")
+            e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc")
+            e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++")
+            e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs")
+
+    if isinstance(e, bb.runqueue.sceneQueueComplete):
+        completions = e.data.expand("${STAGING_DIR}/sstatecompletions")
+        if os.path.exists(completions):
+            cmds = set()
+            with open(completions, "r") as f:
+                cmds = set(f)
+            e.data.setVar("completion_function", "\n".join(cmds))
+            e.data.setVarFlag("completion_function", "func", "1")
+            bb.debug(1, "Executing SceneQueue Completion commands: %s" % "\n".join(cmds))
+            bb.build.exec_func("completion_function", e.data)
+            os.remove(completions)
+}
+
+CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
+CLEANBROKEN = "0"
+
+addtask configure after do_patch
+do_configure[dirs] = "${B}"
+do_configure[deptask] = "do_populate_sysroot"
+base_do_configure() {
+	if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
+		if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" ]; then
+			cd ${B}
+			if [ "${CLEANBROKEN}" != "1" -a \( -e Makefile -o -e makefile -o -e GNUmakefile \) ]; then
+				oe_runmake clean
+			fi
+			find ${B} -ignore_readdir_race -name \*.la -delete
+		fi
+	fi
+	if [ -n "${CONFIGURESTAMPFILE}" ]; then
+		echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+	fi
+}
+
+addtask compile after do_configure
+do_compile[dirs] = "${B}"
+base_do_compile() {
+	if [ -e Makefile -o -e makefile -o -e GNUmakefile ]; then
+		oe_runmake || die "make failed"
+	else
+		bbnote "nothing to compile"
+	fi
+}
+
+addtask install after do_compile
+do_install[dirs] = "${D} ${B}"
+# Remove and re-create ${D} so that is it guaranteed to be empty
+do_install[cleandirs] = "${D}"
+
+base_do_install() {
+	:
+}
+
+base_do_package() {
+	:
+}
+
+addtask build after do_populate_sysroot
+do_build[noexec] = "1"
+do_build[recrdeptask] += "do_deploy"
+do_build () {
+	:
+}
+
+def set_packagetriplet(d):
+    archs = []
+    tos = []
+    tvs = []
+
+    archs.append(d.getVar("PACKAGE_ARCHS", True).split())
+    tos.append(d.getVar("TARGET_OS", True))
+    tvs.append(d.getVar("TARGET_VENDOR", True))
+
+    def settriplet(d, varname, archs, tos, tvs):
+        triplets = []
+        for i in range(len(archs)):
+            for arch in archs[i]:
+                triplets.append(arch + tvs[i] + "-" + tos[i])
+        triplets.reverse()
+        d.setVar(varname, " ".join(triplets))
+
+    settriplet(d, "PKGTRIPLETS", archs, tos, tvs)
+
+    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+    for item in variants.split():
+        localdata = bb.data.createCopy(d)
+        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+        localdata.setVar("OVERRIDES", overrides)
+        bb.data.update_data(localdata)
+
+        archs.append(localdata.getVar("PACKAGE_ARCHS", True).split())
+        tos.append(localdata.getVar("TARGET_OS", True))
+        tvs.append(localdata.getVar("TARGET_VENDOR", True))
+
+    settriplet(d, "PKGMLTRIPLETS", archs, tos, tvs)
+
+python () {
+    import string, re
+
+    # Handle PACKAGECONFIG
+    #
+    # These take the form:
+    #
+    # PACKAGECONFIG ??= "<default options>"
+    # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends"
+    pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
+    if pkgconfigflags:
+        pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
+        pn = d.getVar("PN", True)
+
+        mlprefix = d.getVar("MLPREFIX", True)
+
+        def expandFilter(appends, extension, prefix):
+            appends = bb.utils.explode_deps(d.expand(" ".join(appends)))
+            newappends = []
+            for a in appends:
+                if a.endswith("-native") or ("-cross-" in a):
+                    newappends.append(a)
+                elif a.startswith("virtual/"):
+                    subs = a.split("/", 1)[1]
+                    newappends.append("virtual/" + prefix + subs + extension)
+                else:
+                    if a.startswith(prefix):
+                        newappends.append(a + extension)
+                    else:
+                        newappends.append(prefix + a + extension)
+            return newappends
+
+        def appendVar(varname, appends):
+            if not appends:
+                return
+            if varname.find("DEPENDS") != -1:
+                if pn.startswith("nativesdk-"):
+                    appends = expandFilter(appends, "", "nativesdk-")
+                if pn.endswith("-native"):
+                    appends = expandFilter(appends, "-native", "")
+                if mlprefix:
+                    appends = expandFilter(appends, "", mlprefix)
+            varname = d.expand(varname)
+            d.appendVar(varname, " " + " ".join(appends))
+
+        extradeps = []
+        extrardeps = []
+        extraconf = []
+        for flag, flagval in sorted(pkgconfigflags.items()):
+            items = flagval.split(",")
+            num = len(items)
+            if num > 4:
+                bb.error("Only enable,disable,depend,rdepend can be specified!")
+
+            if flag in pkgconfig:
+                if num >= 3 and items[2]:
+                    extradeps.append(items[2])
+                if num >= 4 and items[3]:
+                    extrardeps.append(items[3])
+                if num >= 1 and items[0]:
+                    extraconf.append(items[0])
+            elif num >= 2 and items[1]:
+                    extraconf.append(items[1])
+        appendVar('DEPENDS', extradeps)
+        appendVar('RDEPENDS_${PN}', extrardeps)
+        if bb.data.inherits_class('cmake', d):
+            appendVar('EXTRA_OECMAKE', extraconf)
+        else:
+            appendVar('EXTRA_OECONF', extraconf)
+
+    pn = d.getVar('PN', True)
+    license = d.getVar('LICENSE', True)
+    if license == "INVALID":
+        bb.fatal('This recipe does not have the LICENSE field set (%s)' % pn)
+
+    if bb.data.inherits_class('license', d):
+        check_license_format(d)
+        unmatched_license_flag = check_license_flags(d)
+        if unmatched_license_flag:
+            bb.debug(1, "Skipping %s because it has a restricted license not"
+                 " whitelisted in LICENSE_FLAGS_WHITELIST" % pn)
+            raise bb.parse.SkipPackage("because it has a restricted license not"
+                 " whitelisted in LICENSE_FLAGS_WHITELIST")
+
+    # If we're building a target package we need to use fakeroot (pseudo)
+    # in order to capture permissions, owners, groups and special files
+    if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+        d.setVarFlag('do_unpack', 'umask', '022')
+        d.setVarFlag('do_configure', 'umask', '022')
+        d.setVarFlag('do_compile', 'umask', '022')
+        d.appendVarFlag('do_install', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+        d.setVarFlag('do_install', 'fakeroot', 1)
+        d.setVarFlag('do_install', 'umask', '022')
+        d.appendVarFlag('do_package', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+        d.setVarFlag('do_package', 'fakeroot', 1)
+        d.setVarFlag('do_package', 'umask', '022')
+        d.setVarFlag('do_package_setscene', 'fakeroot', 1)
+        d.appendVarFlag('do_package_setscene', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+        d.setVarFlag('do_devshell', 'fakeroot', 1)
+        d.appendVarFlag('do_devshell', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+    source_mirror_fetch = d.getVar('SOURCE_MIRROR_FETCH', 0)
+    if not source_mirror_fetch:
+        need_host = d.getVar('COMPATIBLE_HOST', True)
+        if need_host:
+            import re
+            this_host = d.getVar('HOST_SYS', True)
+            if not re.match(need_host, this_host):
+                raise bb.parse.SkipPackage("incompatible with host %s (not in COMPATIBLE_HOST)" % this_host)
+
+        need_machine = d.getVar('COMPATIBLE_MACHINE', True)
+        if need_machine:
+            import re
+            compat_machines = (d.getVar('MACHINEOVERRIDES', True) or "").split(":")
+            for m in compat_machines:
+                if re.match(need_machine, m):
+                    break
+            else:
+                raise bb.parse.SkipPackage("incompatible with machine %s (not in COMPATIBLE_MACHINE)" % d.getVar('MACHINE', True))
+
+
+        bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE', True) or "").split()
+
+        check_license = False if pn.startswith("nativesdk-") else True
+        for t in ["-native", "-cross-${TARGET_ARCH}", "-cross-initial-${TARGET_ARCH}",
+              "-crosssdk-${SDK_ARCH}", "-crosssdk-initial-${SDK_ARCH}",
+              "-cross-canadian-${TRANSLATED_TARGET_ARCH}"]:
+            if pn.endswith(d.expand(t)):
+                check_license = False
+        if pn.startswith("gcc-source-"):
+            check_license = False
+
+        if check_license and bad_licenses:
+            bad_licenses = expand_wildcard_licenses(d, bad_licenses)
+
+            whitelist = []
+            incompatwl = []
+            htincompatwl = []
+            for lic in bad_licenses:
+                spdx_license = return_spdx(d, lic)
+                for w in ["HOSTTOOLS_WHITELIST_", "LGPLv2_WHITELIST_", "WHITELIST_"]:
+                    whitelist.extend((d.getVar(w + lic, True) or "").split())
+                    if spdx_license:
+                        whitelist.extend((d.getVar(w + spdx_license, True) or "").split())
+                    '''
+                    We need to track what we are whitelisting and why. If pn is 
+                    incompatible and is not HOSTTOOLS_WHITELIST_ we need to be 
+                    able to note that the image that is created may infact 
+                    contain incompatible licenses despite INCOMPATIBLE_LICENSE 
+                    being set.
+                    '''
+                    if "HOSTTOOLS" in w:
+                        htincompatwl.extend((d.getVar(w + lic, True) or "").split())
+                        if spdx_license:
+                            htincompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
+                    else:
+                        incompatwl.extend((d.getVar(w + lic, True) or "").split())
+                        if spdx_license:
+                            incompatwl.extend((d.getVar(w + spdx_license, True) or "").split())
+
+            if not pn in whitelist:
+                recipe_license = d.getVar('LICENSE', True)
+                pkgs = d.getVar('PACKAGES', True).split()
+                skipped_pkgs = []
+                unskipped_pkgs = []
+                for pkg in pkgs:
+                    if incompatible_license(d, bad_licenses, pkg):
+                        skipped_pkgs.append(pkg)
+                    else:
+                        unskipped_pkgs.append(pkg)
+                all_skipped = skipped_pkgs and not unskipped_pkgs
+                if unskipped_pkgs:
+                    for pkg in skipped_pkgs:
+                        bb.debug(1, "SKIPPING the package " + pkg + " at do_rootfs because it's " + recipe_license)
+                        d.setVar('LICENSE_EXCLUSION-' + pkg, 1)
+                    for pkg in unskipped_pkgs:
+                        bb.debug(1, "INCLUDING the package " + pkg)
+                elif all_skipped or incompatible_license(d, bad_licenses):
+                    bb.debug(1, "SKIPPING recipe %s because it's %s" % (pn, recipe_license))
+                    raise bb.parse.SkipPackage("incompatible with license %s" % recipe_license)
+            elif pn in whitelist:
+                if pn in incompatwl:
+                    bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted")
+                elif pn in htincompatwl:
+                    bb.note("INCLUDING " + pn + " as buildable despite INCOMPATIBLE_LICENSE because it has been whitelisted for HOSTTOOLS")
+
+    srcuri = d.getVar('SRC_URI', True)
+    # Svn packages should DEPEND on subversion-native
+    if "svn://" in srcuri:
+        d.appendVarFlag('do_fetch', 'depends', ' subversion-native:do_populate_sysroot')
+
+    # Git packages should DEPEND on git-native
+    if "git://" in srcuri:
+        d.appendVarFlag('do_fetch', 'depends', ' git-native:do_populate_sysroot')
+
+    # Mercurial packages should DEPEND on mercurial-native
+    elif "hg://" in srcuri:
+        d.appendVarFlag('do_fetch', 'depends', ' mercurial-native:do_populate_sysroot')
+
+    # OSC packages should DEPEND on osc-native
+    elif "osc://" in srcuri:
+        d.appendVarFlag('do_fetch', 'depends', ' osc-native:do_populate_sysroot')
+
+    # *.lz4 should depends on lz4-native for unpacking
+    # Not endswith because of "*.patch.lz4;patch=1". Need bb.fetch.decodeurl in future
+    if '.lz4' in srcuri:
+        d.appendVarFlag('do_unpack', 'depends', ' lz4-native:do_populate_sysroot')
+
+    # *.xz should depends on xz-native for unpacking
+    # Not endswith because of "*.patch.xz;patch=1". Need bb.fetch.decodeurl in future
+    if '.xz' in srcuri:
+        d.appendVarFlag('do_unpack', 'depends', ' xz-native:do_populate_sysroot')
+
+    # unzip-native should already be staged before unpacking ZIP recipes
+    if ".zip" in srcuri:
+        d.appendVarFlag('do_unpack', 'depends', ' unzip-native:do_populate_sysroot')
+
+    # file is needed by rpm2cpio.sh
+    if ".src.rpm" in srcuri:
+        d.appendVarFlag('do_unpack', 'depends', ' file-native:do_populate_sysroot')
+
+    set_packagetriplet(d)
+
+    # 'multimachine' handling
+    mach_arch = d.getVar('MACHINE_ARCH', True)
+    pkg_arch = d.getVar('PACKAGE_ARCH', True)
+
+    if (pkg_arch == mach_arch):
+        # Already machine specific - nothing further to do
+        return
+
+    #
+    # We always try to scan SRC_URI for urls with machine overrides
+    # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
+    #
+    override = d.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH', True)
+    if override != '0':
+        paths = []
+        fpaths = (d.getVar('FILESPATH', True) or '').split(':')
+        machine = d.getVar('MACHINE', True)
+        for p in fpaths:
+            if os.path.basename(p) == machine and os.path.isdir(p):
+                paths.append(p)
+
+        if len(paths) != 0:
+            for s in srcuri.split():
+                if not s.startswith("file://"):
+                    continue
+                fetcher = bb.fetch2.Fetch([s], d)
+                local = fetcher.localpath(s)
+                for mp in paths:
+                    if local.startswith(mp):
+                        #bb.note("overriding PACKAGE_ARCH from %s to %s for %s" % (pkg_arch, mach_arch, pn))
+                        d.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}")
+                        return
+
+    packages = d.getVar('PACKAGES', True).split()
+    for pkg in packages:
+        pkgarch = d.getVar("PACKAGE_ARCH_%s" % pkg, True)
+
+        # We could look for != PACKAGE_ARCH here but how to choose
+        # if multiple differences are present?
+        # Look through PACKAGE_ARCHS for the priority order?
+        if pkgarch and pkgarch == mach_arch:
+            d.setVar('PACKAGE_ARCH', "${MACHINE_ARCH}")
+            bb.warn("Recipe %s is marked as only being architecture specific but seems to have machine specific packages?! The recipe may as well mark itself as machine specific directly." % d.getVar("PN", True))
+}
+
+addtask cleansstate after do_clean
+python do_cleansstate() {
+        sstate_clean_cachefiles(d)
+}
+
+addtask cleanall after do_cleansstate
+python do_cleanall() {
+    src_uri = (d.getVar('SRC_URI', True) or "").split()
+    if len(src_uri) == 0:
+        return
+
+    try:
+        fetcher = bb.fetch2.Fetch(src_uri, d)
+        fetcher.clean()
+    except bb.fetch2.BBFetchException, e:
+        raise bb.build.FuncFailed(e)
+}
+do_cleanall[nostamp] = "1"
+
+
+EXPORT_FUNCTIONS do_fetch do_unpack do_configure do_compile do_install do_package
diff --git a/meta/classes/bin_package.bbclass b/meta/classes/bin_package.bbclass
new file mode 100644
index 0000000..a52b75b
--- /dev/null
+++ b/meta/classes/bin_package.bbclass
@@ -0,0 +1,36 @@
+#
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Common variable and task for the binary package recipe.
+# Basic principle:
+# * The files have been unpacked to ${S} by base.bbclass
+# * Skip do_configure and do_compile
+# * Use do_install to install the files to ${D}
+#
+# Note:
+# The "subdir" parameter in the SRC_URI is useful when the input package
+# is rpm, ipk, deb and so on, for example:
+#
+# SRC_URI = "http://foo.com/foo-1.0-r1.i586.rpm;subdir=foo-1.0"
+#
+# Then the files would be unpacked to ${WORKDIR}/foo-1.0, otherwise
+# they would be in ${WORKDIR}.
+#
+
+# Skip the unwanted steps
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+# Install the files to ${D}
+bin_package_do_install () {
+    # Do it carefully
+    [ -d "${S}" ] || exit 1
+    cd ${S} || exit 1
+    tar --no-same-owner --exclude='./patches' --exclude='./.pc' -cpf - . \
+        | tar --no-same-owner -xpf - -C ${D}
+}
+
+FILES_${PN} = "/"
+
+EXPORT_FUNCTIONS do_install
diff --git a/meta/classes/binconfig-disabled.bbclass b/meta/classes/binconfig-disabled.bbclass
new file mode 100644
index 0000000..602a669
--- /dev/null
+++ b/meta/classes/binconfig-disabled.bbclass
@@ -0,0 +1,29 @@
+#
+# Class to disable binconfig files instead of installing them
+#
+
+# The list of scripts which should be disabled.
+BINCONFIG ?= ""
+
+FILES_${PN}-dev += "${bindir}/*-config"
+
+do_install_append () {
+	for x in ${BINCONFIG}; do
+		# Make the disabled script emit invalid parameters for those configure
+		# scripts which call it without checking the return code.
+		echo "#!/bin/sh" > ${D}$x
+		echo "echo 'ERROR: $x should not be used, use an alternative such as pkg-config' >&2" >> ${D}$x
+		echo "echo '--should-not-have-used-$x'" >> ${D}$x
+		echo "exit 1" >> ${D}$x
+	done
+}
+
+SYSROOT_PREPROCESS_FUNCS += "binconfig_disabled_sysroot_preprocess"
+
+binconfig_disabled_sysroot_preprocess () {
+	for x in ${BINCONFIG}; do
+		configname=`basename $x`
+		install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
+		install ${D}$x ${SYSROOT_DESTDIR}${bindir_crossscripts}
+	done
+}
diff --git a/meta/classes/binconfig.bbclass b/meta/classes/binconfig.bbclass
new file mode 100644
index 0000000..cbc4173
--- /dev/null
+++ b/meta/classes/binconfig.bbclass
@@ -0,0 +1,63 @@
+FILES_${PN}-dev += "${bindir}/*-config"
+ 
+# The namespaces can clash here hence the two step replace
+def get_binconfig_mangle(d):
+    s = "-e ''"
+    if not bb.data.inherits_class('native', d):
+        optional_quote = r"\(\"\?\)"
+        s += " -e 's:=%s${base_libdir}:=\\1OEBASELIBDIR:;'" % optional_quote
+        s += " -e 's:=%s${libdir}:=\\1OELIBDIR:;'" % optional_quote
+        s += " -e 's:=%s${includedir}:=\\1OEINCDIR:;'" % optional_quote
+        s += " -e 's:=%s${datadir}:=\\1OEDATADIR:'" % optional_quote
+        s += " -e 's:=%s${prefix}/:=\\1OEPREFIX/:'" % optional_quote
+        s += " -e 's:=%s${exec_prefix}/:=\\1OEEXECPREFIX/:'" % optional_quote
+        s += " -e 's:-L${libdir}:-LOELIBDIR:;'"
+        s += " -e 's:-I${includedir}:-IOEINCDIR:;'"
+        s += " -e 's:OEBASELIBDIR:${STAGING_BASELIBDIR}:;'"
+        s += " -e 's:OELIBDIR:${STAGING_LIBDIR}:;'"
+        s += " -e 's:OEINCDIR:${STAGING_INCDIR}:;'"
+        s += " -e 's:OEDATADIR:${STAGING_DATADIR}:'"
+        s += " -e 's:OEPREFIX:${STAGING_DIR_HOST}${prefix}:'"
+        s += " -e 's:OEEXECPREFIX:${STAGING_DIR_HOST}${exec_prefix}:'"
+        s += " -e 's:-I${WORKDIR}:-I${STAGING_INCDIR}:'"
+        s += " -e 's:-L${WORKDIR}:-L${STAGING_LIBDIR}:'"
+        if bb.data.getVar("OE_BINCONFIG_EXTRA_MANGLE", d):
+            s += bb.data.getVar("OE_BINCONFIG_EXTRA_MANGLE", d)
+
+    return s
+
+BINCONFIG_GLOB ?= "*-config"
+
+PACKAGE_PREPROCESS_FUNCS += "binconfig_package_preprocess"
+
+binconfig_package_preprocess () {
+	for config in `find ${PKGD} -name '${BINCONFIG_GLOB}'`; do
+		sed -i \
+		    -e 's:${STAGING_BASELIBDIR}:${base_libdir}:g;' \
+		    -e 's:${STAGING_LIBDIR}:${libdir}:g;' \
+		    -e 's:${STAGING_INCDIR}:${includedir}:g;' \
+		    -e 's:${STAGING_DATADIR}:${datadir}:' \
+		    -e 's:${STAGING_DIR_HOST}${prefix}:${prefix}:' \
+                    $config
+	done
+	for lafile in `find ${PKGD} -name "*.la"` ; do
+		sed -i \
+		    -e 's:${STAGING_BASELIBDIR}:${base_libdir}:g;' \
+		    -e 's:${STAGING_LIBDIR}:${libdir}:g;' \
+		    -e 's:${STAGING_INCDIR}:${includedir}:g;' \
+		    -e 's:${STAGING_DATADIR}:${datadir}:' \
+		    -e 's:${STAGING_DIR_HOST}${prefix}:${prefix}:' \
+		    $lafile
+	done	    
+}
+
+SYSROOT_PREPROCESS_FUNCS += "binconfig_sysroot_preprocess"
+
+binconfig_sysroot_preprocess () {
+	for config in `find ${S} -name '${BINCONFIG_GLOB}'` `find ${B} -name '${BINCONFIG_GLOB}'`; do
+		configname=`basename $config`
+		install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}
+		sed ${@get_binconfig_mangle(d)} $config > ${SYSROOT_DESTDIR}${bindir_crossscripts}/$configname
+		chmod u+x ${SYSROOT_DESTDIR}${bindir_crossscripts}/$configname
+	done
+}
diff --git a/meta/classes/blacklist.bbclass b/meta/classes/blacklist.bbclass
new file mode 100644
index 0000000..a0141a8
--- /dev/null
+++ b/meta/classes/blacklist.bbclass
@@ -0,0 +1,45 @@
+# anonymous support class from originally from angstrom
+# 
+# To use the blacklist, a distribution should include this
+# class in the INHERIT_DISTRO
+#
+# No longer use ANGSTROM_BLACKLIST, instead use a table of
+# recipes in PNBLACKLIST
+#
+# Features:
+#
+# * To add a package to the blacklist, set:
+#   PNBLACKLIST[pn] = "message"
+#
+
+# Cope with PNBLACKLIST flags for multilib case
+addhandler blacklist_multilib_eventhandler
+blacklist_multilib_eventhandler[eventmask] = "bb.event.ConfigParsed"
+python blacklist_multilib_eventhandler() {
+    multilibs = e.data.getVar('MULTILIBS', True)
+    if not multilibs:
+        return
+
+    # this block has been copied from base.bbclass so keep it in sync
+    prefixes = []
+    for ext in multilibs.split():
+        eext = ext.split(':')
+        if len(eext) > 1 and eext[0] == 'multilib':
+            prefixes.append(eext[1])
+
+    blacklists = e.data.getVarFlags('PNBLACKLIST') or {}
+    for pkg, reason in blacklists.items():
+        if pkg.endswith(("-native", "-crosssdk")) or pkg.startswith(("nativesdk-", "virtual/nativesdk-")) or 'cross-canadian' in pkg:
+            continue
+        for p in prefixes:
+            newpkg = p + "-" + pkg
+            if not e.data.getVarFlag('PNBLACKLIST', newpkg, True):
+                e.data.setVarFlag('PNBLACKLIST', newpkg, reason)
+}
+
+python () {
+    blacklist = d.getVarFlag('PNBLACKLIST', d.getVar('PN', True), True)
+
+    if blacklist:
+        raise bb.parse.SkipPackage("Recipe is blacklisted: %s" % (blacklist))
+}
diff --git a/meta/classes/bluetooth.bbclass b/meta/classes/bluetooth.bbclass
new file mode 100644
index 0000000..f88b4ae
--- /dev/null
+++ b/meta/classes/bluetooth.bbclass
@@ -0,0 +1,14 @@
+# Avoid code duplication in bluetooth-dependent recipes.
+
+# Define a variable that expands to the recipe (package) providing core
+# bluetooth support on the platform:
+# "" if bluetooth is not in DISTRO_FEATURES
+# else "bluez5" if bluez5 is in DISTRO_FEATURES
+# else "bluez4"
+
+# Use this with:
+#  inherit bluetooth
+#  PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)}
+#  PACKAGECONFIG[bluez4] = "--enable-bluez4,--disable-bluez4,bluez4"
+
+BLUEZ ?= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', bb.utils.contains('DISTRO_FEATURES', 'bluez5', 'bluez5', 'bluez4', d), '', d)}"
diff --git a/meta/classes/boot-directdisk.bbclass b/meta/classes/boot-directdisk.bbclass
new file mode 100644
index 0000000..600e21a
--- /dev/null
+++ b/meta/classes/boot-directdisk.bbclass
@@ -0,0 +1,194 @@
+# boot-directdisk.bbclass
+# (loosly based off bootimg.bbclass Copyright (C) 2004, Advanced Micro Devices, Inc.)
+#
+# Create an image which can be placed directly onto a harddisk using dd and then
+# booted.
+#
+# This uses syslinux. extlinux would have been nice but required the ext2/3 
+# partition to be mounted. grub requires to run itself as part of the install 
+# process.
+#
+# The end result is a 512 boot sector populated with an MBR and partition table
+# followed by an msdos fat16 partition containing syslinux and a linux kernel
+# completed by the ext2/3 rootfs.
+#
+# We have to push the msdos parition table size > 16MB so fat 16 is used as parted
+# won't touch fat12 partitions.
+
+# External variables needed
+
+# ${ROOTFS} - the rootfs image to incorporate
+
+do_bootdirectdisk[depends] += "dosfstools-native:do_populate_sysroot \
+                               virtual/kernel:do_deploy \
+                               syslinux:do_populate_sysroot \
+                               syslinux-native:do_populate_sysroot \
+                               parted-native:do_populate_sysroot \
+                               mtools-native:do_populate_sysroot "
+
+PACKAGES = " "
+EXCLUDE_FROM_WORLD = "1"
+
+BOOTDD_VOLUME_ID   ?= "boot"
+BOOTDD_EXTRA_SPACE ?= "16384"
+
+EFI = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "1", "0", d)}"
+EFI_PROVIDER ?= "grub-efi"
+EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}"
+
+# Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not
+# contain "efi". This way legacy is supported by default if neither is
+# specified, maintaining the original behavior.
+def pcbios(d):
+    pcbios = bb.utils.contains("MACHINE_FEATURES", "pcbios", "1", "0", d)
+    if pcbios == "0":
+        pcbios = bb.utils.contains("MACHINE_FEATURES", "efi", "0", "1", d)
+    return pcbios
+
+def pcbios_class(d):
+    if d.getVar("PCBIOS", True) == "1":
+        return "syslinux"
+    return ""
+
+PCBIOS = "${@pcbios(d)}"
+PCBIOS_CLASS = "${@pcbios_class(d)}"
+
+inherit ${PCBIOS_CLASS}
+inherit ${EFI_CLASS}
+
+# Get the build_syslinux_cfg() function from the syslinux class
+
+AUTO_SYSLINUXCFG = "1"
+DISK_SIGNATURE ?= "${DISK_SIGNATURE_GENERATED}"
+SYSLINUX_ROOT ?= "root=/dev/sda2"
+SYSLINUX_TIMEOUT ?= "10"
+
+IS_VM = '${@bb.utils.contains_any("IMAGE_FSTYPES", ["vmdk", "vdi", "qcow2"], "true", "false", d)}'
+
+boot_direct_populate() {
+	dest=$1
+	install -d $dest
+
+	# Install bzImage, initrd, and rootfs.img in DEST for all loaders to use.
+	if [ -e ${DEPLOY_DIR_IMAGE}/bzImage ]; then
+		install -m 0644 ${DEPLOY_DIR_IMAGE}/bzImage $dest/vmlinuz
+	fi
+
+	# initrd is made of concatenation of multiple filesystem images
+	if [ -n "${INITRD}" ]; then
+		rm -f $dest/initrd
+		for fs in ${INITRD}
+		do
+			if [ -s "${fs}" ]; then
+				cat ${fs} >> $dest/initrd
+			else
+				bbfatal "${fs} is invalid. initrd image creation failed."
+			fi
+		done
+		chmod 0644 $dest/initrd
+	fi
+}
+
+build_boot_dd() {
+	HDDDIR="${S}/hdd/boot"
+	HDDIMG="${S}/hdd.image"
+	IMAGE=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect
+
+	boot_direct_populate $HDDDIR
+
+	if [ "${PCBIOS}" = "1" ]; then
+		syslinux_hddimg_populate $HDDDIR
+	fi
+	if [ "${EFI}" = "1" ]; then
+		efi_hddimg_populate $HDDDIR
+	fi
+
+	if [ "${IS_VM}" = "true" ]; then
+		if [ "x${AUTO_SYSLINUXMENU}" = "x1" ] ; then
+			install -m 0644 ${STAGING_DIR}/${MACHINE}/usr/share/syslinux/vesamenu.c32 $HDDDIR/${SYSLINUXDIR}/
+			if [ "x${SYSLINUX_SPLASH}" != "x" ] ; then
+				install -m 0644 ${SYSLINUX_SPLASH} $HDDDIR/${SYSLINUXDIR}/splash.lss
+			fi
+		fi
+	fi
+
+	BLOCKS=`du -bks $HDDDIR | cut -f 1`
+	BLOCKS=`expr $BLOCKS + ${BOOTDD_EXTRA_SPACE}`
+
+	# Ensure total sectors is an integral number of sectors per
+	# track or mcopy will complain. Sectors are 512 bytes, and we
+	# generate images with 32 sectors per track. This calculation is
+	# done in blocks, thus the mod by 16 instead of 32.
+	BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
+
+	mkdosfs -n ${BOOTDD_VOLUME_ID} -S 512 -C $HDDIMG $BLOCKS 
+	mcopy -i $HDDIMG -s $HDDDIR/* ::/
+
+	if [ "${PCBIOS}" = "1" ]; then
+		syslinux_hdddirect_install $HDDIMG
+	fi	
+	chmod 644 $HDDIMG
+
+	ROOTFSBLOCKS=`du -Lbks ${ROOTFS} | cut -f 1`
+	TOTALSIZE=`expr $BLOCKS + $ROOTFSBLOCKS`
+	END1=`expr $BLOCKS \* 1024`
+	END2=`expr $END1 + 512`
+	END3=`expr \( $ROOTFSBLOCKS \* 1024 \) + $END1`
+
+	echo $ROOTFSBLOCKS $TOTALSIZE $END1 $END2 $END3
+	rm -rf $IMAGE
+	dd if=/dev/zero of=$IMAGE bs=1024 seek=$TOTALSIZE count=1
+
+	parted $IMAGE mklabel msdos
+	parted $IMAGE mkpart primary fat16 0 ${END1}B
+	parted $IMAGE unit B mkpart primary ext2 ${END2}B ${END3}B
+	parted $IMAGE set 1 boot on 
+
+	parted $IMAGE print
+
+	awk "BEGIN { printf \"$(echo ${DISK_SIGNATURE} | fold -w 2 | tac | paste -sd '' | sed 's/\(..\)/\\x&/g')\" }" | \
+		dd of=$IMAGE bs=1 seek=440 conv=notrunc
+
+	OFFSET=`expr $END2 / 512`
+	if [ "${PCBIOS}" = "1" ]; then
+		dd if=${STAGING_DATADIR}/syslinux/mbr.bin of=$IMAGE conv=notrunc
+	fi
+
+	dd if=$HDDIMG of=$IMAGE conv=notrunc seek=1 bs=512
+	dd if=${ROOTFS} of=$IMAGE conv=notrunc seek=$OFFSET bs=512
+
+	cd ${DEPLOY_DIR_IMAGE}
+	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
+	ln -s ${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hdddirect
+} 
+
+python do_bootdirectdisk() {
+    validate_disk_signature(d)
+    if d.getVar("PCBIOS", True) == "1":
+        bb.build.exec_func('build_syslinux_cfg', d)
+    if d.getVar("EFI", True) == "1":
+        bb.build.exec_func('build_efi_cfg', d)
+    bb.build.exec_func('build_boot_dd', d)
+}
+
+def generate_disk_signature():
+    import uuid
+
+    signature = str(uuid.uuid4())[:8]
+
+    if signature != '00000000':
+        return signature
+    else:
+        return 'ffffffff'
+
+def validate_disk_signature(d):
+    import re
+
+    disk_signature = d.getVar("DISK_SIGNATURE", True)
+
+    if not re.match(r'^[0-9a-fA-F]{8}$', disk_signature):
+        bb.fatal("DISK_SIGNATURE '%s' must be an 8 digit hex string" % disk_signature)
+
+DISK_SIGNATURE_GENERATED := "${@generate_disk_signature()}"
+
+addtask bootdirectdisk before do_build
diff --git a/meta/classes/bootimg.bbclass b/meta/classes/bootimg.bbclass
new file mode 100644
index 0000000..ec9d0b7
--- /dev/null
+++ b/meta/classes/bootimg.bbclass
@@ -0,0 +1,303 @@
+# Copyright (C) 2004, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+# Creates a bootable image using syslinux, your kernel and an optional
+# initrd
+
+#
+# End result is two things:
+#
+# 1. A .hddimg file which is an msdos filesystem containing syslinux, a kernel,
+# an initrd and a rootfs image. These can be written to harddisks directly and
+# also booted on USB flash disks (write them there with dd).
+#
+# 2. A CD .iso image
+
+# Boot process is that the initrd will boot and process which label was selected
+# in syslinux. Actions based on the label are then performed (e.g. installing to
+# an hdd)
+
+# External variables (also used by syslinux.bbclass)
+# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
+# ${COMPRESSISO} - Transparent compress ISO, reduce size ~40% if set to 1
+# ${NOISO}  - skip building the ISO image if set to 1
+# ${NOHDD}  - skip building the HDD image if set to 1
+# ${HDDIMG_ID} - FAT image volume-id
+# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
+
+do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \
+                        mtools-native:do_populate_sysroot \
+                        cdrtools-native:do_populate_sysroot \
+                        virtual/kernel:do_deploy \
+                        ${@oe.utils.ifelse(d.getVar('COMPRESSISO', False),'zisofs-tools-native:do_populate_sysroot','')}"
+
+PACKAGES = " "
+EXCLUDE_FROM_WORLD = "1"
+
+HDDDIR = "${S}/hddimg"
+ISODIR = "${S}/iso"
+EFIIMGDIR = "${S}/efi_img"
+COMPACT_ISODIR = "${S}/iso.z"
+COMPRESSISO ?= "0"
+
+BOOTIMG_VOLUME_ID   ?= "boot"
+BOOTIMG_EXTRA_SPACE ?= "512"
+
+EFI = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "1", "0", d)}"
+EFI_PROVIDER ?= "grub-efi"
+EFI_CLASS = "${@bb.utils.contains("MACHINE_FEATURES", "efi", "${EFI_PROVIDER}", "", d)}"
+
+KERNEL_IMAGETYPE ??= "bzImage"
+
+# Include legacy boot if MACHINE_FEATURES includes "pcbios" or if it does not
+# contain "efi". This way legacy is supported by default if neither is
+# specified, maintaining the original behavior.
+def pcbios(d):
+    pcbios = bb.utils.contains("MACHINE_FEATURES", "pcbios", "1", "0", d)
+    if pcbios == "0":
+        pcbios = bb.utils.contains("MACHINE_FEATURES", "efi", "0", "1", d)
+    return pcbios
+
+PCBIOS = "${@pcbios(d)}"
+
+# The syslinux is required for the isohybrid command and boot catalog
+inherit syslinux
+inherit ${EFI_CLASS}
+
+populate() {
+	DEST=$1
+	install -d ${DEST}
+
+	# Install kernel, initrd, and rootfs.img in DEST for all loaders to use.
+	install -m 0644 ${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE} ${DEST}/vmlinuz
+	
+	# initrd is made of concatenation of multiple filesystem images
+	if [ -n "${INITRD}" ]; then
+		rm -f ${DEST}/initrd
+		for fs in ${INITRD}
+		do
+			if [ -s "${fs}" ]; then
+				cat ${fs} >> ${DEST}/initrd
+			else
+				bbfatal "${fs} is invalid. initrd image creation failed."
+			fi
+		done
+		chmod 0644 ${DEST}/initrd
+	fi
+
+	if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+		install -m 0644 ${ROOTFS} ${DEST}/rootfs.img
+	fi
+
+}
+
+build_iso() {
+	# Only create an ISO if we have an INITRD and NOISO was not set
+	if [ -z "${INITRD}" ] || [ "${NOISO}" = "1" ]; then
+		bbnote "ISO image will not be created."
+		return
+	fi
+	# ${INITRD} is a list of multiple filesystem images
+	for fs in ${INITRD}
+	do
+		if [ ! -s "${fs}" ]; then
+			bbnote "ISO image will not be created. ${fs} is invalid."
+			return
+		fi
+	done
+
+
+	populate ${ISODIR}
+
+	if [ "${PCBIOS}" = "1" ]; then
+		syslinux_iso_populate ${ISODIR}
+	fi
+	if [ "${EFI}" = "1" ]; then
+		efi_iso_populate ${ISODIR}
+		build_fat_img ${EFIIMGDIR} ${ISODIR}/efi.img
+	fi
+
+	# EFI only
+	if [ "${PCBIOS}" != "1" ] && [ "${EFI}" = "1" ] ; then
+		# Work around bug in isohybrid where it requires isolinux.bin
+		# In the boot catalog, even though it is not used
+		mkdir -p ${ISODIR}/${ISOLINUXDIR}
+		install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin ${ISODIR}${ISOLINUXDIR}
+	fi
+
+	if [ "${COMPRESSISO}" = "1" ] ; then
+		# create compact directory, compress iso
+		mkdir -p ${COMPACT_ISODIR}
+		mkzftree -z 9 -p 4 -F ${ISODIR}/rootfs.img ${COMPACT_ISODIR}/rootfs.img
+
+		# move compact iso to iso, then remove compact directory
+		mv ${COMPACT_ISODIR}/rootfs.img ${ISODIR}/rootfs.img
+		rm -Rf ${COMPACT_ISODIR}
+		mkisofs_compress_opts="-R -z -D -l"
+	else
+		mkisofs_compress_opts="-r"
+	fi
+
+	# Check the size of ${ISODIR}/rootfs.img, use mkisofs -iso-level 3
+	# when it exceeds 3.8GB, the specification is 4G - 1 bytes, we need
+	# leave a few space for other files.
+	mkisofs_iso_level=""
+
+        if [ -n "${ROOTFS}" ] && [ -s "${ROOTFS}" ]; then
+		rootfs_img_size=`stat -c '%s' ${ISODIR}/rootfs.img`
+		# 4080218931 = 3.8 * 1024 * 1024 * 1024
+		if [ $rootfs_img_size -gt 4080218931 ]; then
+			bbnote "${ISODIR}/rootfs.img execeeds 3.8GB, using '-iso-level 3' for mkisofs"
+			mkisofs_iso_level="-iso-level 3"
+		fi
+	fi
+
+	if [ "${PCBIOS}" = "1" ] && [ "${EFI}" != "1" ] ; then
+		# PCBIOS only media
+		mkisofs -V ${BOOTIMG_VOLUME_ID} \
+		        -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
+			-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
+			$mkisofs_compress_opts \
+			${MKISOFS_OPTIONS} $mkisofs_iso_level ${ISODIR}
+	else
+		# EFI only OR EFI+PCBIOS
+		mkisofs -A ${BOOTIMG_VOLUME_ID} -V ${BOOTIMG_VOLUME_ID} \
+		        -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso \
+			-b ${ISO_BOOTIMG} -c ${ISO_BOOTCAT} \
+			$mkisofs_compress_opts ${MKISOFS_OPTIONS} $mkisofs_iso_level \
+			-eltorito-alt-boot -eltorito-platform efi \
+			-b efi.img -no-emul-boot \
+			${ISODIR}
+		isohybrid_args="-u"
+	fi
+
+	isohybrid $isohybrid_args ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.iso
+
+	cd ${DEPLOY_DIR_IMAGE}
+	rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
+	ln -s ${IMAGE_NAME}.iso ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.iso
+}
+
+build_fat_img() {
+	FATSOURCEDIR=$1
+	FATIMG=$2
+
+	# Calculate the size required for the final image including the
+	# data and filesystem overhead.
+	# Sectors: 512 bytes
+	#  Blocks: 1024 bytes
+
+	# Determine the sector count just for the data
+	SECTORS=$(expr $(du --apparent-size -ks ${FATSOURCEDIR} | cut -f 1) \* 2)
+
+	# Account for the filesystem overhead. This includes directory
+	# entries in the clusters as well as the FAT itself.
+	# Assumptions:
+	#   FAT32 (12 or 16 may be selected by mkdosfs, but the extra
+	#   padding will be minimal on those smaller images and not
+	#   worth the logic here to caclulate the smaller FAT sizes)
+	#   < 16 entries per directory
+	#   8.3 filenames only
+
+	# 32 bytes per dir entry
+	DIR_BYTES=$(expr $(find ${FATSOURCEDIR} | tail -n +2 | wc -l) \* 32)
+	# 32 bytes for every end-of-directory dir entry
+	DIR_BYTES=$(expr $DIR_BYTES + $(expr $(find ${FATSOURCEDIR} -type d | tail -n +2 | wc -l) \* 32))
+	# 4 bytes per FAT entry per sector of data
+	FAT_BYTES=$(expr $SECTORS \* 4)
+	# 4 bytes per FAT entry per end-of-cluster list
+	FAT_BYTES=$(expr $FAT_BYTES + $(expr $(find ${FATSOURCEDIR} -type d | tail -n +2 | wc -l) \* 4))
+
+	# Use a ceiling function to determine FS overhead in sectors
+	DIR_SECTORS=$(expr $(expr $DIR_BYTES + 511) / 512)
+	# There are two FATs on the image
+	FAT_SECTORS=$(expr $(expr $(expr $FAT_BYTES + 511) / 512) \* 2)
+	SECTORS=$(expr $SECTORS + $(expr $DIR_SECTORS + $FAT_SECTORS))
+
+	# Determine the final size in blocks accounting for some padding
+	BLOCKS=$(expr $(expr $SECTORS / 2) + ${BOOTIMG_EXTRA_SPACE})
+
+	# Ensure total sectors is an integral number of sectors per
+	# track or mcopy will complain. Sectors are 512 bytes, and we
+	# generate images with 32 sectors per track. This calculation is
+	# done in blocks, thus the mod by 16 instead of 32.
+	BLOCKS=$(expr $BLOCKS + $(expr 16 - $(expr $BLOCKS % 16)))
+
+	# mkdosfs will sometimes use FAT16 when it is not appropriate,
+	# resulting in a boot failure from SYSLINUX. Use FAT32 for
+	# images larger than 512MB, otherwise let mkdosfs decide.
+	if [ $(expr $BLOCKS / 1024) -gt 512 ]; then
+		FATSIZE="-F 32"
+	fi
+
+	# mkdosfs will fail if ${FATIMG} exists. Since we are creating an
+	# new image, it is safe to delete any previous image.
+	if [ -e ${FATIMG} ]; then
+		rm ${FATIMG}
+	fi
+
+	if [ -z "${HDDIMG_ID}" ]; then
+		mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${FATIMG} \
+			${BLOCKS}
+	else
+		mkdosfs ${FATSIZE} -n ${BOOTIMG_VOLUME_ID} -S 512 -C ${FATIMG} \
+		${BLOCKS} -i ${HDDIMG_ID}
+	fi
+
+	# Copy FATSOURCEDIR recursively into the image file directly
+	mcopy -i ${FATIMG} -s ${FATSOURCEDIR}/* ::/
+}
+
+build_hddimg() {
+	# Create an HDD image
+	if [ "${NOHDD}" != "1" ] ; then
+		populate ${HDDDIR}
+
+		if [ "${PCBIOS}" = "1" ]; then
+			syslinux_hddimg_populate ${HDDDIR}
+		fi
+		if [ "${EFI}" = "1" ]; then
+			efi_hddimg_populate ${HDDDIR}
+		fi
+
+		# Check the size of ${HDDDIR}/rootfs.img, error out if it
+		# exceeds 4GB, it is the single file's max size of FAT fs.
+		if [ -f ${HDDDIR}/rootfs.img ]; then
+			rootfs_img_size=`stat -c '%s' ${HDDDIR}/rootfs.img`
+			max_size=`expr 4 \* 1024 \* 1024 \* 1024`
+			if [ $rootfs_img_size -gt $max_size ]; then
+				bberror "${HDDDIR}/rootfs.img execeeds 4GB,"
+				bberror "this doesn't work on FAT filesystem, you can try either of:"
+				bberror "1) Reduce the size of rootfs.img"
+				bbfatal "2) Use iso, vmdk or vdi to instead of hddimg\n"
+			fi
+		fi
+
+		build_fat_img ${HDDDIR} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+
+		if [ "${PCBIOS}" = "1" ]; then
+			syslinux_hddimg_install
+		fi
+
+		chmod 644 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+
+		cd ${DEPLOY_DIR_IMAGE}
+		rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
+		ln -s ${IMAGE_NAME}.hddimg ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.hddimg
+	fi
+}
+
+python do_bootimg() {
+    if d.getVar("PCBIOS", True) == "1":
+        bb.build.exec_func('build_syslinux_cfg', d)
+    if d.getVar("EFI", True) == "1":
+        bb.build.exec_func('build_efi_cfg', d)
+    bb.build.exec_func('build_hddimg', d)
+    bb.build.exec_func('build_iso', d)
+}
+
+IMAGE_TYPEDEP_iso = "ext4"
+IMAGE_TYPEDEP_hddimg = "ext4"
+IMAGE_TYPES_MASKED += "iso hddimg"
+
+addtask bootimg before do_build
diff --git a/meta/classes/bugzilla.bbclass b/meta/classes/bugzilla.bbclass
new file mode 100644
index 0000000..3fc8956
--- /dev/null
+++ b/meta/classes/bugzilla.bbclass
@@ -0,0 +1,187 @@
+#
+# Small event handler to automatically open URLs and file
+# bug reports at a bugzilla of your choiche
+# it uses XML-RPC interface, so you must have it enabled
+#
+# Before using you must define BUGZILLA_USER, BUGZILLA_PASS credentials,
+# BUGZILLA_XMLRPC - uri of xmlrpc.cgi,
+# BUGZILLA_PRODUCT, BUGZILLA_COMPONENT - a place in BTS for build bugs
+# BUGZILLA_VERSION - version against which to report new bugs
+#
+
+def bugzilla_find_bug_report(debug_file, server, args, bugname):
+    args['summary'] = bugname
+    bugs = server.Bug.search(args)
+    if len(bugs['bugs']) == 0:
+        print >> debug_file, "Bugs not found"
+        return (False,None)
+    else: # silently pick the first result
+        print >> debug_file, "Result of bug search is "
+        print >> debug_file, bugs
+        status = bugs['bugs'][0]['status']
+        id = bugs['bugs'][0]['id']
+        return (not status in ["CLOSED", "RESOLVED", "VERIFIED"],id)
+
+def bugzilla_file_bug(debug_file, server, args, name, text, version):
+    args['summary'] = name
+    args['comment'] = text
+    args['version'] = version
+    args['op_sys'] = 'Linux'
+    args['platform'] = 'Other'
+    args['severity'] = 'normal'
+    args['priority'] = 'Normal'
+    try:
+        return server.Bug.create(args)['id']
+    except Exception, e:
+        print >> debug_file, repr(e)
+        return None
+
+def bugzilla_reopen_bug(debug_file, server, args, bug_number):
+    args['ids'] = [bug_number]
+    args['status'] = "CONFIRMED"
+    try:
+        server.Bug.update(args)
+        return True
+    except Exception, e:
+        print >> debug_file, repr(e)
+        return False
+
+def bugzilla_create_attachment(debug_file, server, args, bug_number, text, file_name, log, logdescription):
+    args['ids'] = [bug_number]
+    args['file_name'] = file_name
+    args['summary'] = logdescription
+    args['content_type'] = "text/plain"
+    args['data'] = log
+    args['comment'] = text
+    try:
+        server.Bug.add_attachment(args)
+        return True
+    except Exception, e:
+        print >> debug_file, repr(e)
+        return False
+
+def bugzilla_add_comment(debug_file, server, args, bug_number, text):
+    args['id'] = bug_number
+    args['comment'] = text
+    try:
+        server.Bug.add_comment(args)
+        return True
+    except Exception, e:
+        print >> debug_file, repr(e)
+        return False
+
+addhandler bugzilla_eventhandler
+bugzilla_eventhandler[eventmask] = "bb.event.MsgNote bb.build.TaskFailed"
+python bugzilla_eventhandler() {
+    import glob
+    import xmlrpclib, httplib
+
+    class ProxiedTransport(xmlrpclib.Transport):
+        def __init__(self, proxy, use_datetime = 0):
+            xmlrpclib.Transport.__init__(self, use_datetime)
+            self.proxy = proxy
+            self.user = None
+            self.password = None
+
+        def set_user(self, user):
+            self.user = user
+
+        def set_password(self, password):
+            self.password = password
+
+        def make_connection(self, host):
+            self.realhost = host
+            return httplib.HTTP(self.proxy)
+
+        def send_request(self, connection, handler, request_body):
+            connection.putrequest("POST", 'http://%s%s' % (self.realhost, handler))
+            if self.user != None:
+                if self.password != None:
+                    auth = "%s:%s" % (self.user, self.password)
+                else:
+                    auth = self.user
+                connection.putheader("Proxy-authorization", "Basic " + base64.encodestring(auth))
+
+    event = e
+    data = e.data
+    name = bb.event.getName(event)
+    if name == "MsgNote":
+        # avoid recursion
+        return
+
+    if name == "TaskFailed":
+        xmlrpc  = data.getVar("BUGZILLA_XMLRPC", True)
+        user    = data.getVar("BUGZILLA_USER", True)
+        passw   = data.getVar("BUGZILLA_PASS", True)
+        product = data.getVar("BUGZILLA_PRODUCT", True)
+        compon  = data.getVar("BUGZILLA_COMPONENT", True)
+        version = data.getVar("BUGZILLA_VERSION", True)
+
+        proxy   = data.getVar('http_proxy', True )
+        if (proxy):
+            import urllib2
+            s, u, p, hostport = urllib2._parse_proxy(proxy)
+            transport = ProxiedTransport(hostport)
+        else:
+            transport = None
+
+        server = xmlrpclib.ServerProxy(xmlrpc, transport=transport, verbose=0)
+        args = {
+            'Bugzilla_login': user,
+            'Bugzilla_password': passw,
+            'product': product,
+            'component': compon}
+
+        # evil hack to figure out what is going on
+        debug_file = open(os.path.join(data.getVar("TMPDIR", True),"..","bugzilla-log"),"a")
+
+        file = None
+        bugname = "%(package)s-%(pv)s-autobuild" % { "package" : data.getVar("PN", True),
+                                                           "pv"      : data.getVar("PV", True),
+                                                           }
+        log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T', True), event.task))
+        text     = "The %s step in %s failed at %s for machine %s" % (e.task, data.getVar("PN", True), data.getVar('DATETIME', True), data.getVar( 'MACHINE', True ) )
+        if len(log_file) != 0:
+            print >> debug_file, "Adding log file %s" % log_file[0]
+            file = open(log_file[0], 'r')
+            log = file.read()
+            file.close();
+        else:
+            print >> debug_file, "No log file found for the glob"
+            log = None
+
+        (bug_open, bug_number) = bugzilla_find_bug_report(debug_file, server, args.copy(), bugname)
+        print >> debug_file, "Bug is open: %s and bug number: %s" % (bug_open, bug_number)
+
+        # The bug is present and still open, attach an error log
+        if not bug_number:
+            bug_number = bugzilla_file_bug(debug_file, server, args.copy(), bugname, text, version)
+            if not bug_number:
+                print >> debug_file, "Couldn't acquire a new bug_numer, filing a bugreport failed"
+            else:
+                print >> debug_file, "The new bug_number: '%s'" % bug_number
+        elif not bug_open:
+            if not bugzilla_reopen_bug(debug_file, server, args.copy(), bug_number):
+                print >> debug_file, "Failed to reopen the bug #%s" % bug_number
+            else:
+                print >> debug_file, "Reopened the bug #%s" % bug_number
+
+        if bug_number and log:
+            print >> debug_file, "The bug is known as '%s'" % bug_number
+            desc = "Build log for machine %s" % (data.getVar('MACHINE', True))
+            if not bugzilla_create_attachment(debug_file, server, args.copy(), bug_number, text, log_file[0], log, desc):
+                 print >> debug_file, "Failed to attach the build log for bug #%s" % bug_number
+            else:
+                 print >> debug_file, "Created an attachment for '%s' '%s' '%s'" % (product, compon, bug_number)
+        else:
+            print >> debug_file, "Not trying to create an attachment for bug #%s" % bug_number
+            if not bugzilla_add_comment(debug_file, server, args.copy(), bug_number, text, ):
+                 print >> debug_file, "Failed to create a comment the build log for bug #%s" % bug_number
+            else:
+                 print >> debug_file, "Created an attachment for '%s' '%s' '%s'" % (product, compon, bug_number)
+
+        # store bug number for oestats-client
+        if bug_number:
+            data.setVar('OESTATS_BUG_NUMBER', bug_number)
+}
+
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
new file mode 100644
index 0000000..4db0441
--- /dev/null
+++ b/meta/classes/buildhistory.bbclass
@@ -0,0 +1,765 @@
+#
+# Records history of build output in order to detect regressions
+#
+# Based in part on testlab.bbclass and packagehistory.bbclass
+#
+# Copyright (C) 2011-2014 Intel Corporation
+# Copyright (C) 2007-2011 Koen Kooi <koen@openembedded.org>
+#
+
+BUILDHISTORY_FEATURES ?= "image package sdk"
+BUILDHISTORY_DIR ?= "${TOPDIR}/buildhistory"
+BUILDHISTORY_DIR_IMAGE = "${BUILDHISTORY_DIR}/images/${MACHINE_ARCH}/${TCLIBC}/${IMAGE_BASENAME}"
+BUILDHISTORY_DIR_PACKAGE = "${BUILDHISTORY_DIR}/packages/${MULTIMACH_TARGET_SYS}/${PN}"
+BUILDHISTORY_DIR_SDK = "${BUILDHISTORY_DIR}/sdk/${SDK_NAME}/${IMAGE_BASENAME}"
+BUILDHISTORY_IMAGE_FILES ?= "/etc/passwd /etc/group"
+BUILDHISTORY_COMMIT ?= "0"
+BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>"
+BUILDHISTORY_PUSH_REPO ?= ""
+
+SSTATEPOSTINSTFUNCS_append = " buildhistory_emit_pkghistory"
+# We want to avoid influence the signatures of sstate tasks - first the function itself:
+sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory"
+# then the value added to SSTATEPOSTINSTFUNCS:
+SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory"
+
+#
+# Write out metadata about this package for comparision when writing future packages
+#
+python buildhistory_emit_pkghistory() {
+    if not d.getVar('BB_CURRENTTASK', True) in ['packagedata', 'packagedata_setscene']:
+        return 0
+
+    if not "package" in (d.getVar('BUILDHISTORY_FEATURES', True) or "").split():
+        return 0
+
+    import re
+    import json
+    import errno
+
+    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+
+    class RecipeInfo:
+        def __init__(self, name):
+            self.name = name
+            self.pe = "0"
+            self.pv = "0"
+            self.pr = "r0"
+            self.depends = ""
+            self.packages = ""
+            self.srcrev = ""
+
+
+    class PackageInfo:
+        def __init__(self, name):
+            self.name = name
+            self.pe = "0"
+            self.pv = "0"
+            self.pr = "r0"
+            # pkg/pkge/pkgv/pkgr should be empty because we want to be able to default them
+            self.pkg = ""
+            self.pkge = ""
+            self.pkgv = ""
+            self.pkgr = ""
+            self.size = 0
+            self.depends = ""
+            self.rprovides = ""
+            self.rdepends = ""
+            self.rrecommends = ""
+            self.rsuggests = ""
+            self.rreplaces = ""
+            self.rconflicts = ""
+            self.files = ""
+            self.filelist = ""
+            # Variables that need to be written to their own separate file
+            self.filevars = dict.fromkeys(['pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm'])
+
+    # Should check PACKAGES here to see if anything removed
+
+    def readPackageInfo(pkg, histfile):
+        pkginfo = PackageInfo(pkg)
+        with open(histfile, "r") as f:
+            for line in f:
+                lns = line.split('=')
+                name = lns[0].strip()
+                value = lns[1].strip(" \t\r\n").strip('"')
+                if name == "PE":
+                    pkginfo.pe = value
+                elif name == "PV":
+                    pkginfo.pv = value
+                elif name == "PR":
+                    pkginfo.pr = value
+                elif name == "PKG":
+                    pkginfo.pkg = value
+                elif name == "PKGE":
+                    pkginfo.pkge = value
+                elif name == "PKGV":
+                    pkginfo.pkgv = value
+                elif name == "PKGR":
+                    pkginfo.pkgr = value
+                elif name == "RPROVIDES":
+                    pkginfo.rprovides = value
+                elif name == "RDEPENDS":
+                    pkginfo.rdepends = value
+                elif name == "RRECOMMENDS":
+                    pkginfo.rrecommends = value
+                elif name == "RSUGGESTS":
+                    pkginfo.rsuggests = value
+                elif name == "RREPLACES":
+                    pkginfo.rreplaces = value
+                elif name == "RCONFLICTS":
+                    pkginfo.rconflicts = value
+                elif name == "PKGSIZE":
+                    pkginfo.size = long(value)
+                elif name == "FILES":
+                    pkginfo.files = value
+                elif name == "FILELIST":
+                    pkginfo.filelist = value
+        # Apply defaults
+        if not pkginfo.pkg:
+            pkginfo.pkg = pkginfo.name
+        if not pkginfo.pkge:
+            pkginfo.pkge = pkginfo.pe
+        if not pkginfo.pkgv:
+            pkginfo.pkgv = pkginfo.pv
+        if not pkginfo.pkgr:
+            pkginfo.pkgr = pkginfo.pr
+        return pkginfo
+
+    def getlastpkgversion(pkg):
+        try:
+            histfile = os.path.join(pkghistdir, pkg, "latest")
+            return readPackageInfo(pkg, histfile)
+        except EnvironmentError:
+            return None
+
+    def sortpkglist(string):
+        pkgiter = re.finditer(r'[a-zA-Z0-9.+-]+( \([><=]+ [^ )]+\))?', string, 0)
+        pkglist = [p.group(0) for p in pkgiter]
+        pkglist.sort()
+        return ' '.join(pkglist)
+
+    def sortlist(string):
+        items = string.split(' ')
+        items.sort()
+        return ' '.join(items)
+
+    pn = d.getVar('PN', True)
+    pe = d.getVar('PE', True) or "0"
+    pv = d.getVar('PV', True)
+    pr = d.getVar('PR', True)
+
+    pkgdata_dir = d.getVar('PKGDATA_DIR', True)
+    packages = ""
+    try:
+        with open(os.path.join(pkgdata_dir, pn)) as f:
+            for line in f.readlines():
+                if line.startswith('PACKAGES: '):
+                    packages = oe.utils.squashspaces(line.split(': ', 1)[1])
+                    break
+    except IOError as e:
+        if e.errno == errno.ENOENT:
+            # Probably a -cross recipe, just ignore
+            return 0
+        else:
+            raise
+
+    packagelist = packages.split()
+    if not os.path.exists(pkghistdir):
+        bb.utils.mkdirhier(pkghistdir)
+    else:
+        # Remove files for packages that no longer exist
+        for item in os.listdir(pkghistdir):
+            if item != "latest" and item != "latest_srcrev":
+                if item not in packagelist:
+                    itempath = os.path.join(pkghistdir, item)
+                    if os.path.isdir(itempath):
+                        for subfile in os.listdir(itempath):
+                            os.unlink(os.path.join(itempath, subfile))
+                        os.rmdir(itempath)
+                    else:
+                        os.unlink(itempath)
+
+    rcpinfo = RecipeInfo(pn)
+    rcpinfo.pe = pe
+    rcpinfo.pv = pv
+    rcpinfo.pr = pr
+    rcpinfo.depends = sortlist(oe.utils.squashspaces(d.getVar('DEPENDS', True) or ""))
+    rcpinfo.packages = packages
+    write_recipehistory(rcpinfo, d)
+
+    pkgdest = d.getVar('PKGDEST', True)
+    for pkg in packagelist:
+        pkgdata = {}
+        with open(os.path.join(pkgdata_dir, 'runtime', pkg)) as f:
+            for line in f.readlines():
+                item = line.rstrip('\n').split(': ', 1)
+                key = item[0]
+                if key.endswith('_' + pkg):
+                    key = key[:-len(pkg)-1]
+                pkgdata[key] = item[1].decode('utf-8').decode('string_escape')
+
+        pkge = pkgdata.get('PKGE', '0')
+        pkgv = pkgdata['PKGV']
+        pkgr = pkgdata['PKGR']
+        #
+        # Find out what the last version was
+        # Make sure the version did not decrease
+        #
+        lastversion = getlastpkgversion(pkg)
+        if lastversion:
+            last_pkge = lastversion.pkge
+            last_pkgv = lastversion.pkgv
+            last_pkgr = lastversion.pkgr
+            r = bb.utils.vercmp((pkge, pkgv, pkgr), (last_pkge, last_pkgv, last_pkgr))
+            if r < 0:
+                msg = "Package version for package %s went backwards which would break package feeds from (%s:%s-%s to %s:%s-%s)" % (pkg, last_pkge, last_pkgv, last_pkgr, pkge, pkgv, pkgr)
+                package_qa_handle_error("version-going-backwards", msg, d)
+
+        pkginfo = PackageInfo(pkg)
+        # Apparently the version can be different on a per-package basis (see Python)
+        pkginfo.pe = pkgdata.get('PE', '0')
+        pkginfo.pv = pkgdata['PV']
+        pkginfo.pr = pkgdata['PR']
+        pkginfo.pkg = pkgdata['PKG']
+        pkginfo.pkge = pkge
+        pkginfo.pkgv = pkgv
+        pkginfo.pkgr = pkgr
+        pkginfo.rprovides = sortpkglist(oe.utils.squashspaces(pkgdata.get('RPROVIDES', "")))
+        pkginfo.rdepends = sortpkglist(oe.utils.squashspaces(pkgdata.get('RDEPENDS', "")))
+        pkginfo.rrecommends = sortpkglist(oe.utils.squashspaces(pkgdata.get('RRECOMMENDS', "")))
+        pkginfo.rsuggests = sortpkglist(oe.utils.squashspaces(pkgdata.get('RSUGGESTS', "")))
+        pkginfo.rreplaces = sortpkglist(oe.utils.squashspaces(pkgdata.get('RREPLACES', "")))
+        pkginfo.rconflicts = sortpkglist(oe.utils.squashspaces(pkgdata.get('RCONFLICTS', "")))
+        pkginfo.files = oe.utils.squashspaces(pkgdata.get('FILES', ""))
+        for filevar in pkginfo.filevars:
+            pkginfo.filevars[filevar] = pkgdata.get(filevar, "")
+
+        # Gather information about packaged files
+        val = pkgdata.get('FILES_INFO', '')
+        dictval = json.loads(val)
+        filelist = dictval.keys()
+        filelist.sort()
+        pkginfo.filelist = " ".join(filelist)
+
+        pkginfo.size = int(pkgdata['PKGSIZE'])
+
+        write_pkghistory(pkginfo, d)
+
+    # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
+    bb.build.exec_func("buildhistory_list_pkg_files", d)
+}
+
+
+def write_recipehistory(rcpinfo, d):
+    import codecs
+
+    bb.debug(2, "Writing recipe history")
+
+    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+
+    infofile = os.path.join(pkghistdir, "latest")
+    with codecs.open(infofile, "w", encoding='utf8') as f:
+        if rcpinfo.pe != "0":
+            f.write(u"PE = %s\n" %  rcpinfo.pe)
+        f.write(u"PV = %s\n" %  rcpinfo.pv)
+        f.write(u"PR = %s\n" %  rcpinfo.pr)
+        f.write(u"DEPENDS = %s\n" %  rcpinfo.depends)
+        f.write(u"PACKAGES = %s\n" %  rcpinfo.packages)
+
+
+def write_pkghistory(pkginfo, d):
+    import codecs
+
+    bb.debug(2, "Writing package history for package %s" % pkginfo.name)
+
+    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+
+    pkgpath = os.path.join(pkghistdir, pkginfo.name)
+    if not os.path.exists(pkgpath):
+        bb.utils.mkdirhier(pkgpath)
+
+    infofile = os.path.join(pkgpath, "latest")
+    with codecs.open(infofile, "w", encoding='utf8') as f:
+        if pkginfo.pe != "0":
+            f.write(u"PE = %s\n" %  pkginfo.pe)
+        f.write(u"PV = %s\n" %  pkginfo.pv)
+        f.write(u"PR = %s\n" %  pkginfo.pr)
+
+        pkgvars = {}
+        pkgvars['PKG'] = pkginfo.pkg if pkginfo.pkg != pkginfo.name else ''
+        pkgvars['PKGE'] = pkginfo.pkge if pkginfo.pkge != pkginfo.pe else ''
+        pkgvars['PKGV'] = pkginfo.pkgv if pkginfo.pkgv != pkginfo.pv else ''
+        pkgvars['PKGR'] = pkginfo.pkgr if pkginfo.pkgr != pkginfo.pr else ''
+        for pkgvar in pkgvars:
+            val = pkgvars[pkgvar]
+            if val:
+                f.write(u"%s = %s\n" % (pkgvar, val))
+
+        f.write(u"RPROVIDES = %s\n" %  pkginfo.rprovides)
+        f.write(u"RDEPENDS = %s\n" %  pkginfo.rdepends)
+        f.write(u"RRECOMMENDS = %s\n" %  pkginfo.rrecommends)
+        if pkginfo.rsuggests:
+            f.write(u"RSUGGESTS = %s\n" %  pkginfo.rsuggests)
+        if pkginfo.rreplaces:
+            f.write(u"RREPLACES = %s\n" %  pkginfo.rreplaces)
+        if pkginfo.rconflicts:
+            f.write(u"RCONFLICTS = %s\n" %  pkginfo.rconflicts)
+        f.write(u"PKGSIZE = %d\n" %  pkginfo.size)
+        f.write(u"FILES = %s\n" %  pkginfo.files)
+        f.write(u"FILELIST = %s\n" %  pkginfo.filelist)
+
+    for filevar in pkginfo.filevars:
+        filevarpath = os.path.join(pkgpath, "latest.%s" % filevar)
+        val = pkginfo.filevars[filevar]
+        if val:
+            with codecs.open(filevarpath, "w", encoding='utf8') as f:
+                f.write(val)
+        else:
+            if os.path.exists(filevarpath):
+                os.unlink(filevarpath)
+
+#
+# rootfs_type can be: image, sdk_target, sdk_host
+#
+def buildhistory_list_installed(d, rootfs_type="image"):
+    from oe.rootfs import image_list_installed_packages
+    from oe.sdk import sdk_list_installed_packages
+
+    process_list = [('file', 'bh_installed_pkgs.txt'),\
+                    ('deps', 'bh_installed_pkgs_deps.txt')]
+
+    for output_type, output_file in process_list:
+        output_file_full = os.path.join(d.getVar('WORKDIR', True), output_file)
+
+        with open(output_file_full, 'w') as output:
+            if rootfs_type == "image":
+                output.write(image_list_installed_packages(d, output_type))
+            else:
+                output.write(sdk_list_installed_packages(d, rootfs_type == "sdk_target", output_type))
+
+python buildhistory_list_installed_image() {
+    buildhistory_list_installed(d)
+}
+
+python buildhistory_list_installed_sdk_target() {
+    buildhistory_list_installed(d, "sdk_target")
+}
+
+python buildhistory_list_installed_sdk_host() {
+    buildhistory_list_installed(d, "sdk_host")
+}
+
+buildhistory_get_installed() {
+	mkdir -p $1
+
+	# Get list of installed packages
+	pkgcache="$1/installed-packages.tmp"
+	cat ${WORKDIR}/bh_installed_pkgs.txt | sort > $pkgcache && rm ${WORKDIR}/bh_installed_pkgs.txt
+
+	cat $pkgcache | awk '{ print $1 }' > $1/installed-package-names.txt
+	if [ -s $pkgcache ] ; then
+		cat $pkgcache | awk '{ print $2 }' | xargs -n1 basename > $1/installed-packages.txt
+	else
+		printf "" > $1/installed-packages.txt
+	fi
+
+	# Produce dependency graph
+	# First, quote each name to handle characters that cause issues for dot
+	sed 's:\([^| ]*\):"\1":g' ${WORKDIR}/bh_installed_pkgs_deps.txt > $1/depends.tmp && \
+		rm ${WORKDIR}/bh_installed_pkgs_deps.txt
+	# Change delimiter from pipe to -> and set style for recommend lines
+	sed -i -e 's:|: -> :' -e 's:"\[REC\]":[style=dotted]:' -e 's:$:;:' $1/depends.tmp
+	# Add header, sorted and de-duped contents and footer and then delete the temp file
+	printf "digraph depends {\n    node [shape=plaintext]\n" > $1/depends.dot
+	cat $1/depends.tmp | sort | uniq >> $1/depends.dot
+	echo "}" >>  $1/depends.dot
+	rm $1/depends.tmp
+
+	# Produce installed package sizes list
+	printf "" > $1/installed-package-sizes.tmp
+	cat $pkgcache | while read pkg pkgfile pkgarch
+	do
+		size=`oe-pkgdata-util -p ${PKGDATA_DIR} read-value "PKGSIZE" ${pkg}_${pkgarch}`
+		if [ "$size" != "" ] ; then
+			echo "$size $pkg" >> $1/installed-package-sizes.tmp
+		fi
+	done
+	cat $1/installed-package-sizes.tmp | sort -n -r | awk '{print $1 "\tKiB " $2}' > $1/installed-package-sizes.txt
+	rm $1/installed-package-sizes.tmp
+
+	# We're now done with the cache, delete it
+	rm $pkgcache
+
+	if [ "$2" != "sdk" ] ; then
+		# Produce some cut-down graphs (for readability)
+		grep -v kernel_image $1/depends.dot | grep -v kernel-2 | grep -v kernel-3 > $1/depends-nokernel.dot
+		grep -v libc6 $1/depends-nokernel.dot | grep -v libgcc > $1/depends-nokernel-nolibc.dot
+		grep -v update- $1/depends-nokernel-nolibc.dot > $1/depends-nokernel-nolibc-noupdate.dot
+		grep -v kernel-module $1/depends-nokernel-nolibc-noupdate.dot > $1/depends-nokernel-nolibc-noupdate-nomodules.dot
+	fi
+
+	# add complementary package information
+	if [ -e ${WORKDIR}/complementary_pkgs.txt ]; then
+		cp ${WORKDIR}/complementary_pkgs.txt $1
+	fi
+}
+
+buildhistory_get_image_installed() {
+	# Anything requiring the use of the packaging system should be done in here
+	# in case the packaging files are going to be removed for this image
+
+	if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then
+		return
+	fi
+
+	buildhistory_get_installed ${BUILDHISTORY_DIR_IMAGE}
+}
+
+buildhistory_get_sdk_installed() {
+	# Anything requiring the use of the packaging system should be done in here
+	# in case the packaging files are going to be removed for this SDK
+
+	if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'sdk', '1', '0', d)}" = "0" ] ; then
+		return
+	fi
+
+	buildhistory_get_installed ${BUILDHISTORY_DIR_SDK}/$1 sdk
+}
+
+buildhistory_get_sdk_installed_host() {
+	buildhistory_get_sdk_installed host
+}
+
+buildhistory_get_sdk_installed_target() {
+	buildhistory_get_sdk_installed target
+}
+
+buildhistory_list_files() {
+	# List the files in the specified directory, but exclude date/time etc.
+	# This awk script is somewhat messy, but handles where the size is not printed for device files under pseudo
+	if [ "$3" = "fakeroot" ] ; then
+		( cd $1 && ${FAKEROOTENV} ${FAKEROOTCMD} find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
+	else
+		( cd $1 && find . ! -path . -printf "%M %-10u %-10g %10s %p -> %l\n" | sort -k5 | sed 's/ * -> $//' > $2 )
+	fi
+}
+
+buildhistory_list_pkg_files() {
+	# Create individual files-in-package for each recipe's package
+	for pkgdir in $(find ${PKGDEST}/* -maxdepth 0 -type d); do
+		pkgname=$(basename $pkgdir)
+		outfolder="${BUILDHISTORY_DIR_PACKAGE}/$pkgname"
+		outfile="$outfolder/files-in-package.txt"
+		# Make sure the output folder exists so we can create the file
+		if [ ! -d $outfolder ] ; then
+			bbdebug 2 "Folder $outfolder does not exist, file $outfile not created"
+			continue
+		fi
+		buildhistory_list_files $pkgdir $outfile fakeroot
+	done
+}
+
+buildhistory_get_imageinfo() {
+	if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'image', '1', '0', d)}" = "0" ] ; then
+		return
+	fi
+
+	buildhistory_list_files ${IMAGE_ROOTFS} ${BUILDHISTORY_DIR_IMAGE}/files-in-image.txt
+
+	# Collect files requested in BUILDHISTORY_IMAGE_FILES
+	rm -rf ${BUILDHISTORY_DIR_IMAGE}/image-files
+	for f in ${BUILDHISTORY_IMAGE_FILES}; do
+		if [ -f ${IMAGE_ROOTFS}/$f ] ; then
+			mkdir -p ${BUILDHISTORY_DIR_IMAGE}/image-files/`dirname $f`
+			cp ${IMAGE_ROOTFS}/$f ${BUILDHISTORY_DIR_IMAGE}/image-files/$f
+		fi
+	done
+
+	# Record some machine-readable meta-information about the image
+	printf ""  > ${BUILDHISTORY_DIR_IMAGE}/image-info.txt
+	cat >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt <<END
+${@buildhistory_get_imagevars(d)}
+END
+	imagesize=`du -ks ${IMAGE_ROOTFS} | awk '{ print $1 }'`
+	echo "IMAGESIZE = $imagesize" >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt
+
+	# Add some configuration information
+	echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION}" > ${BUILDHISTORY_DIR_IMAGE}/build-id.txt
+
+	cat >> ${BUILDHISTORY_DIR_IMAGE}/build-id.txt <<END
+${@buildhistory_get_build_id(d)}
+END
+}
+
+buildhistory_get_sdkinfo() {
+	if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'sdk', '1', '0', d)}" = "0" ] ; then
+		return
+	fi
+
+	buildhistory_list_files ${SDK_OUTPUT} ${BUILDHISTORY_DIR_SDK}/files-in-sdk.txt
+
+	# Record some machine-readable meta-information about the SDK
+	printf ""  > ${BUILDHISTORY_DIR_SDK}/sdk-info.txt
+	cat >> ${BUILDHISTORY_DIR_SDK}/sdk-info.txt <<END
+${@buildhistory_get_sdkvars(d)}
+END
+	sdksize=`du -ks ${SDK_OUTPUT} | awk '{ print $1 }'`
+	echo "SDKSIZE = $sdksize" >> ${BUILDHISTORY_DIR_SDK}/sdk-info.txt
+}
+
+# By using ROOTFS_POSTUNINSTALL_COMMAND we get in after uninstallation of
+# unneeded packages but before the removal of packaging files
+ROOTFS_POSTUNINSTALL_COMMAND += " buildhistory_list_installed_image ;\
+                                buildhistory_get_image_installed ; "
+
+IMAGE_POSTPROCESS_COMMAND += " buildhistory_get_imageinfo ; "
+
+# We want these to be the last run so that we get called after complementary package installation
+POPULATE_SDK_POST_TARGET_COMMAND_append = " buildhistory_list_installed_sdk_target ;\
+                                            buildhistory_get_sdk_installed_target ; "
+POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host ;\
+                                          buildhistory_get_sdk_installed_host ; "
+
+SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; "
+
+def buildhistory_get_build_id(d):
+    if d.getVar('BB_WORKERCONTEXT', True) != '1':
+        return ""
+    localdata = bb.data.createCopy(d)
+    bb.data.update_data(localdata)
+    statuslines = []
+    for func in oe.data.typed_value('BUILDCFG_FUNCS', localdata):
+        g = globals()
+        if func not in g:
+            bb.warn("Build configuration function '%s' does not exist" % func)
+        else:
+            flines = g[func](localdata)
+            if flines:
+                statuslines.extend(flines)
+
+    statusheader = d.getVar('BUILDCFG_HEADER', True)
+    return('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
+
+def buildhistory_get_metadata_revs(d):
+    # We want an easily machine-readable format here, so get_layers_branch_rev isn't quite what we want
+    layers = (d.getVar("BBLAYERS", True) or "").split()
+    medadata_revs = ["%-17s = %s:%s" % (os.path.basename(i), \
+        base_get_metadata_git_branch(i, None).strip(), \
+        base_get_metadata_git_revision(i, None)) \
+            for i in layers]
+    return '\n'.join(medadata_revs)
+
+def outputvars(vars, listvars, d):
+    vars = vars.split()
+    listvars = listvars.split()
+    ret = ""
+    for var in vars:
+        value = d.getVar(var, True) or ""
+        if var in listvars:
+            # Squash out spaces
+            value = oe.utils.squashspaces(value)
+        ret += "%s = %s\n" % (var, value)
+    return ret.rstrip('\n')
+
+def buildhistory_get_imagevars(d):
+    if d.getVar('BB_WORKERCONTEXT', True) != '1':
+        return ""
+    imagevars = "DISTRO DISTRO_VERSION USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE ROOTFS_POSTPROCESS_COMMAND IMAGE_POSTPROCESS_COMMAND"
+    listvars = "USER_CLASSES IMAGE_CLASSES IMAGE_FEATURES IMAGE_LINGUAS IMAGE_INSTALL BAD_RECOMMENDATIONS PACKAGE_EXCLUDE"
+    return outputvars(imagevars, listvars, d)
+
+def buildhistory_get_sdkvars(d):
+    if d.getVar('BB_WORKERCONTEXT', True) != '1':
+        return ""
+    sdkvars = "DISTRO DISTRO_VERSION SDK_NAME SDK_VERSION SDKMACHINE SDKIMAGE_FEATURES BAD_RECOMMENDATIONS NO_RECOMMENDATIONS PACKAGE_EXCLUDE"
+    listvars = "SDKIMAGE_FEATURES BAD_RECOMMENDATIONS PACKAGE_EXCLUDE"
+    return outputvars(sdkvars, listvars, d)
+
+
+def buildhistory_get_cmdline(d):
+    if sys.argv[0].endswith('bin/bitbake'):
+        bincmd = 'bitbake'
+    else:
+        bincmd = sys.argv[0]
+    return '%s %s' % (bincmd, ' '.join(sys.argv[1:]))
+
+
+buildhistory_single_commit() {
+	if [ "$3" = "" ] ; then
+		commitopts="${BUILDHISTORY_DIR}/ --allow-empty"
+		item="No changes"
+	else
+		commitopts="$3 metadata-revs"
+		item="$3"
+	fi
+	if [ "${BUILDHISTORY_BUILD_FAILURES}" = "0" ] ; then
+		result="succeeded"
+	else
+		result="failed"
+	fi
+	case ${BUILDHISTORY_BUILD_INTERRUPTED} in
+		1)
+			result="$result (interrupted)"
+			;;
+		2)
+			result="$result (force interrupted)"
+			;;
+	esac
+	commitmsgfile=`mktemp`
+	cat > $commitmsgfile << END
+$item: Build ${BUILDNAME} of ${DISTRO} ${DISTRO_VERSION} for machine ${MACHINE} on $2
+
+cmd: $1
+
+result: $result
+
+metadata revisions:
+END
+	cat ${BUILDHISTORY_DIR}/metadata-revs >> $commitmsgfile
+	git commit $commitopts -F $commitmsgfile --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
+	rm $commitmsgfile
+}
+
+buildhistory_commit() {
+	if [ ! -d ${BUILDHISTORY_DIR} ] ; then
+		# Code above that creates this dir never executed, so there can't be anything to commit
+		return
+	fi
+
+	# Create a machine-readable list of metadata revisions for each layer
+	cat > ${BUILDHISTORY_DIR}/metadata-revs <<END
+${@buildhistory_get_metadata_revs(d)}
+END
+
+	( cd ${BUILDHISTORY_DIR}/
+		# Initialise the repo if necessary
+		if [ ! -d .git ] ; then
+			git init -q
+		else
+			git tag -f build-minus-3 build-minus-2 > /dev/null 2>&1 || true
+			git tag -f build-minus-2 build-minus-1 > /dev/null 2>&1 || true
+			git tag -f build-minus-1 > /dev/null 2>&1 || true
+		fi
+		# If the user hasn't set up their name/email, set some defaults
+		# just for this repo (otherwise the commit will fail with older
+		# versions of git)
+		if ! git config user.email > /dev/null ; then
+			git config --local user.email "buildhistory@${DISTRO}"
+		fi
+		if ! git config user.name > /dev/null ; then
+			git config --local user.name "buildhistory"
+		fi
+		# Check if there are new/changed files to commit (other than metadata-revs)
+		repostatus=`git status --porcelain | grep -v " metadata-revs$"`
+		HOSTNAME=`hostname 2>/dev/null || echo unknown`
+		CMDLINE="${@buildhistory_get_cmdline(d)}"
+		if [ "$repostatus" != "" ] ; then
+			git add -A .
+			# porcelain output looks like "?? packages/foo/bar"
+			# Ensure we commit metadata-revs with the first commit
+			for entry in `echo "$repostatus" | awk '{print $2}' | awk -F/ '{print $1}' | sort | uniq` ; do
+				buildhistory_single_commit "$CMDLINE" "$HOSTNAME" "$entry"
+			done
+			git gc --auto --quiet
+		else
+			buildhistory_single_commit "$CMDLINE" "$HOSTNAME"
+		fi
+		if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
+			git push -q ${BUILDHISTORY_PUSH_REPO}
+		fi) || true
+}
+
+python buildhistory_eventhandler() {
+    if e.data.getVar('BUILDHISTORY_FEATURES', True).strip():
+        if e.data.getVar("BUILDHISTORY_COMMIT", True) == "1":
+            bb.note("Writing buildhistory")
+            localdata = bb.data.createCopy(e.data)
+            localdata.setVar('BUILDHISTORY_BUILD_FAILURES', str(e._failures))
+            interrupted = getattr(e, '_interrupted', 0)
+            localdata.setVar('BUILDHISTORY_BUILD_INTERRUPTED', str(interrupted))
+            bb.build.exec_func("buildhistory_commit", localdata)
+}
+
+addhandler buildhistory_eventhandler
+buildhistory_eventhandler[eventmask] = "bb.event.BuildCompleted"
+
+
+# FIXME this ought to be moved into the fetcher
+def _get_srcrev_values(d):
+    """
+    Return the version strings for the current recipe
+    """
+
+    scms = []
+    fetcher = bb.fetch.Fetch(d.getVar('SRC_URI', True).split(), d)
+    urldata = fetcher.ud
+    for u in urldata:
+        if urldata[u].method.supports_srcrev():
+            scms.append(u)
+
+    autoinc_templ = 'AUTOINC+'
+    dict_srcrevs = {}
+    dict_tag_srcrevs = {}
+    for scm in scms:
+        ud = urldata[scm]
+        for name in ud.names:
+            try:
+                rev = ud.method.sortable_revision(ud, d, name)
+            except TypeError:
+                # support old bitbake versions
+                rev = ud.method.sortable_revision(scm, ud, d, name)
+            # Clean this up when we next bump bitbake version
+            if type(rev) != str:
+                autoinc, rev = rev
+            elif rev.startswith(autoinc_templ):
+                rev = rev[len(autoinc_templ):]
+            dict_srcrevs[name] = rev
+            if 'tag' in ud.parm:
+                tag = ud.parm['tag'];
+                key = name+'_'+tag
+                dict_tag_srcrevs[key] = rev
+    return (dict_srcrevs, dict_tag_srcrevs)
+
+do_fetch[postfuncs] += "write_srcrev"
+do_fetch[vardepsexclude] += "write_srcrev"
+python write_srcrev() {
+    pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE', True)
+    srcrevfile = os.path.join(pkghistdir, 'latest_srcrev')
+
+    srcrevs, tag_srcrevs = _get_srcrev_values(d)
+    if srcrevs:
+        if not os.path.exists(pkghistdir):
+            bb.utils.mkdirhier(pkghistdir)
+        old_tag_srcrevs = {}
+        if os.path.exists(srcrevfile):
+            with open(srcrevfile) as f:
+                for line in f:
+                    if line.startswith('# tag_'):
+                        key, value = line.split("=", 1)
+                        key = key.replace('# tag_', '').strip()
+                        value = value.replace('"', '').strip()
+                        old_tag_srcrevs[key] = value
+        with open(srcrevfile, 'w') as f:
+            orig_srcrev = d.getVar('SRCREV', False) or 'INVALID'
+            if orig_srcrev != 'INVALID':
+                f.write('# SRCREV = "%s"\n' % orig_srcrev)
+            if len(srcrevs) > 1:
+                for name, srcrev in srcrevs.items():
+                    orig_srcrev = d.getVar('SRCREV_%s' % name, False)
+                    if orig_srcrev:
+                        f.write('# SRCREV_%s = "%s"\n' % (name, orig_srcrev))
+                    f.write('SRCREV_%s = "%s"\n' % (name, srcrev))
+            else:
+                f.write('SRCREV = "%s"\n' % srcrevs.itervalues().next())
+            if len(tag_srcrevs) > 0:
+                for name, srcrev in tag_srcrevs.items():
+                    f.write('# tag_%s = "%s"\n' % (name, srcrev))
+                    if name in old_tag_srcrevs and old_tag_srcrevs[name] != srcrev:
+                        pkg = d.getVar('PN', True)
+                        bb.warn("Revision for tag %s in package %s was changed since last build (from %s to %s)" % (name, pkg, old_tag_srcrevs[name], srcrev))
+
+    else:
+        if os.path.exists(srcrevfile):
+            os.remove(srcrevfile)
+}
diff --git a/meta/classes/buildstats-summary.bbclass b/meta/classes/buildstats-summary.bbclass
new file mode 100644
index 0000000..05ead9f
--- /dev/null
+++ b/meta/classes/buildstats-summary.bbclass
@@ -0,0 +1,37 @@
+# Summarize sstate usage at the end of the build
+python buildstats_summary () {
+    import collections
+    import os.path
+
+    bn = get_bn(e)
+    bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn)
+    if not os.path.exists(bsdir):
+        return
+
+    sstatetasks = (e.data.getVar('SSTATETASKS', True) or '').split()
+    built = collections.defaultdict(lambda: [set(), set()])
+    for pf in os.listdir(bsdir):
+        taskdir = os.path.join(bsdir, pf)
+        if not os.path.isdir(taskdir):
+            continue
+
+        tasks = os.listdir(taskdir)
+        for t in sstatetasks:
+            no_sstate, sstate = built[t]
+            if t in tasks:
+                no_sstate.add(pf)
+            elif t + '_setscene' in tasks:
+                sstate.add(pf)
+
+    header_printed = False
+    for t in sstatetasks:
+        no_sstate, sstate = built[t]
+        if no_sstate | sstate:
+            if not header_printed:
+                header_printed = True
+                bb.note("Build completion summary:")
+
+            bb.note("  {0}: {1}% sstate reuse ({2} setscene, {3} scratch)".format(t, 100*len(sstate)/(len(sstate)+len(no_sstate)), len(sstate), len(no_sstate)))
+}
+addhandler buildstats_summary
+buildstats_summary[eventmask] = "bb.event.BuildCompleted"
diff --git a/meta/classes/buildstats.bbclass b/meta/classes/buildstats.bbclass
new file mode 100644
index 0000000..22ec571
--- /dev/null
+++ b/meta/classes/buildstats.bbclass
@@ -0,0 +1,270 @@
+BUILDSTATS_BASE = "${TMPDIR}/buildstats/"
+BUILDSTATS_BNFILE = "${BUILDSTATS_BASE}/.buildname"
+BUILDSTATS_DEVFILE = "${BUILDSTATS_BASE}/.device"
+
+################################################################################
+# Build statistics gathering.
+#
+# The CPU and Time gathering/tracking functions and bbevent inspiration
+# were written by Christopher Larson and can be seen here:
+# http://kergoth.pastey.net/142813
+#
+################################################################################
+
+def get_process_cputime(pid):
+    with open("/proc/%d/stat" % pid, "r") as f:
+        fields = f.readline().rstrip().split()
+    # 13: utime, 14: stime, 15: cutime, 16: cstime
+    return sum(int(field) for field in fields[13:16])
+
+def get_cputime():
+    with open("/proc/stat", "r") as f:
+        fields = f.readline().rstrip().split()[1:]
+    return sum(int(field) for field in fields)
+
+def set_bn(e):
+    bn = e.getPkgs()[0] + "-" + e.data.getVar('MACHINE', True)
+    try:
+        os.remove(e.data.getVar('BUILDSTATS_BNFILE', True))
+    except:
+        pass
+    with open(e.data.getVar('BUILDSTATS_BNFILE', True), "w") as f:
+        f.write(os.path.join(bn, e.data.getVar('BUILDNAME', True)))
+
+def get_bn(e):
+    with open(e.data.getVar('BUILDSTATS_BNFILE', True)) as f:
+        bn = f.readline()
+    return bn
+
+def set_device(e):
+    tmpdir = e.data.getVar('TMPDIR', True)
+    devfile = e.data.getVar('BUILDSTATS_DEVFILE', True)
+    try:
+        os.remove(devfile)
+    except:
+        pass
+    ############################################################################
+    # We look for the volume TMPDIR lives on. To do all disks would make little
+    # sense and not give us any particularly useful data. In theory we could do
+    # something like stick DL_DIR on a different partition and this would
+    # throw stats gathering off. The same goes with SSTATE_DIR. However, let's
+    # get the basics in here and work on the cornercases later.
+    # A note. /proc/diskstats does not contain info on encryptfs, tmpfs, etc.
+    # If we end up hitting one of these fs, we'll just skip diskstats collection.
+    ############################################################################
+    device = os.stat(tmpdir)
+    majordev = os.major(long(device.st_dev))
+    minordev = os.minor(long(device.st_dev))
+    ############################################################################
+    # Bug 1700:
+    # Because tmpfs/encryptfs/ramfs etc inserts no entry in /proc/diskstats
+    # we set rdev to NoLogicalDevice and search for it later. If we find NLD
+    # we do not collect diskstats as the method to collect meaningful statistics
+    # for these fs types requires a bit more research.
+    ############################################################################
+    rdev = "NoLogicalDevice"
+    try:
+        with open("/proc/diskstats", "r") as f:
+            for line in f:
+                if majordev == int(line.split()[0]) and minordev == int(line.split()[1]):
+                    rdev = line.split()[2]
+    except:
+        pass
+    with open(devfile, "w") as f:
+        f.write(rdev)
+
+def get_device(e):
+    with open(e.data.getVar('BUILDSTATS_DEVFILE', True)) as f:
+        device = f.readline()
+    return device
+
+def get_diskstats(dev):
+    import itertools
+    ############################################################################
+    # For info on what these are, see kernel doc file iostats.txt
+    ############################################################################
+    DSTAT_KEYS = ['ReadsComp', 'ReadsMerged', 'SectRead', 'TimeReads', 'WritesComp', 'SectWrite', 'TimeWrite', 'IOinProgress', 'TimeIO', 'WTimeIO']
+    try:
+        with open("/proc/diskstats", "r") as f:
+            for x in f:
+                if dev in x:
+                    diskstats_val = x.rstrip().split()[4:]
+    except IOError as e:
+        return
+    diskstats = dict(itertools.izip(DSTAT_KEYS, diskstats_val))
+    return diskstats
+
+def set_diskdata(var, dev, data):
+    data.setVar(var, get_diskstats(dev))
+
+def get_diskdata(var, dev, data):
+    olddiskdata = data.getVar(var, False)
+    diskdata = {}
+    if olddiskdata is None:
+        return
+    newdiskdata = get_diskstats(dev)
+    for key in olddiskdata.iterkeys():
+        diskdata["Start"+key] = str(int(olddiskdata[key]))
+        diskdata["End"+key] = str(int(newdiskdata[key]))
+    return diskdata
+
+def set_timedata(var, data, server_time=None):
+    import time
+    if server_time:
+        time = server_time
+    else:
+        time = time.time()
+    cputime = get_cputime()
+    proctime = get_process_cputime(os.getpid())
+    data.setVar(var, (time, cputime, proctime))
+
+def get_timedata(var, data, server_time=None):
+    import time
+    timedata = data.getVar(var, False)
+    if timedata is None:
+        return
+    oldtime, oldcpu, oldproc = timedata
+    procdiff = get_process_cputime(os.getpid()) - oldproc
+    cpudiff = get_cputime() - oldcpu
+    if server_time:
+        end_time = server_time
+    else:
+        end_time = time.time()
+    timediff = end_time - oldtime
+    if cpudiff > 0:
+        cpuperc = float(procdiff) * 100 / cpudiff
+    else:
+        cpuperc = None
+    return timediff, cpuperc
+
+def write_task_data(status, logfile, dev, e):
+    bn = get_bn(e)
+    bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn)
+    with open(os.path.join(logfile), "a") as f:
+        timedata = get_timedata("__timedata_task", e.data, e.time)
+        if timedata:
+            elapsedtime, cpu = timedata
+            f.write(bb.data.expand("${PF}: %s: Elapsed time: %0.2f seconds \n" %
+                                    (e.task, elapsedtime), e.data))
+            if cpu:
+                f.write("CPU usage: %0.1f%% \n" % cpu)
+        ############################################################################
+        # Here we gather up disk data. In an effort to avoid lying with stats
+        # I do a bare minimum of analysis of collected data.
+        # The simple fact is, doing disk io collection on a per process basis
+        # without effecting build time would be difficult.
+        # For the best information, running things with BB_TOTAL_THREADS = "1"
+        # would return accurate per task results.
+        ############################################################################
+        if dev != "NoLogicalDevice":
+            diskdata = get_diskdata("__diskdata_task", dev, e.data)
+            if diskdata:
+                for key in sorted(diskdata.iterkeys()):
+                    f.write(key + ": " + diskdata[key] + "\n")
+        if status is "passed":
+            f.write("Status: PASSED \n")
+        else:
+            f.write("Status: FAILED \n")
+        f.write("Ended: %0.2f \n" % e.time)
+
+python run_buildstats () {
+    import bb.build
+    import bb.event
+    import bb.data
+    import time, subprocess, platform
+
+    if isinstance(e, bb.event.BuildStarted):
+        ########################################################################
+        # at first pass make the buildstats heriarchy and then
+        # set the buildname
+        ########################################################################
+        bb.utils.mkdirhier(e.data.getVar('BUILDSTATS_BASE', True))
+        set_bn(e)
+        bn = get_bn(e)
+        set_device(e)
+        device = get_device(e)
+
+        bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn)
+        bb.utils.mkdirhier(bsdir)
+        if device != "NoLogicalDevice":
+            set_diskdata("__diskdata_build", device, e.data)
+        set_timedata("__timedata_build", e.data)
+        build_time = os.path.join(bsdir, "build_stats")
+        # write start of build into build_time
+        with open(build_time, "a") as f:
+            host_info = platform.uname()
+            f.write("Host Info: ")
+            for x in host_info:
+                if x:
+                    f.write(x + " ")
+            f.write("\n")
+            f.write("Build Started: %0.2f \n" % time.time())
+
+    elif isinstance(e, bb.event.BuildCompleted):
+        bn = get_bn(e)
+        device = get_device(e)
+        bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn)
+        build_time = os.path.join(bsdir, "build_stats")
+        with open(build_time, "a") as f:
+            ########################################################################
+            # Write build statistics for the build
+            ########################################################################
+            timedata = get_timedata("__timedata_build", e.data)
+            if timedata:
+                time, cpu = timedata
+                # write end of build and cpu used into build_time
+                f.write("Elapsed time: %0.2f seconds \n" % (time))
+                if cpu:
+                    f.write("CPU usage: %0.1f%% \n" % cpu)
+            if device != "NoLogicalDevice":
+                diskio = get_diskdata("__diskdata_build", device, e.data)
+                if diskio:
+                    for key in sorted(diskio.iterkeys()):
+                        f.write(key + ": " + diskio[key] + "\n")
+
+    if isinstance(e, bb.build.TaskStarted):
+        bn = get_bn(e)
+        device = get_device(e)
+        bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn)
+        taskdir = os.path.join(bsdir, e.data.getVar('PF', True))
+        if device != "NoLogicalDevice":
+            set_diskdata("__diskdata_task", device, e.data)
+        set_timedata("__timedata_task", e.data, e.time)
+        bb.utils.mkdirhier(taskdir)
+        # write into the task event file the name and start time
+        with open(os.path.join(taskdir, e.task), "a") as f:
+            f.write("Event: %s \n" % bb.event.getName(e))
+            f.write("Started: %0.2f \n" % e.time)
+
+    elif isinstance(e, bb.build.TaskSucceeded):
+        bn = get_bn(e)
+        device = get_device(e)
+        bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn)
+        taskdir = os.path.join(bsdir, e.data.getVar('PF', True))
+        write_task_data("passed", os.path.join(taskdir, e.task), device, e)
+        if e.task == "do_rootfs":
+            bs = os.path.join(bsdir, "build_stats")
+            with open(bs, "a") as f:
+                rootfs = e.data.getVar('IMAGE_ROOTFS', True)
+                rootfs_size = subprocess.Popen(["du", "-sh", rootfs], stdout=subprocess.PIPE).stdout.read()
+                f.write("Uncompressed Rootfs size: %s" % rootfs_size)
+
+    elif isinstance(e, bb.build.TaskFailed):
+        bn = get_bn(e)
+        device = get_device(e)
+        bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn)
+        taskdir = os.path.join(bsdir, e.data.getVar('PF', True))
+        write_task_data("failed", os.path.join(taskdir, e.task), device, e)
+        ########################################################################
+        # Lets make things easier and tell people where the build failed in
+        # build_status. We do this here because BuildCompleted triggers no
+        # matter what the status of the build actually is
+        ########################################################################
+        build_status = os.path.join(bsdir, "build_stats")
+        with open(build_status, "a") as f:
+            f.write(e.data.expand("Failed at: ${PF} at task: %s \n" % e.task))
+}
+
+addhandler run_buildstats
+run_buildstats[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted bb.build.TaskStarted bb.build.TaskSucceeded bb.build.TaskFailed"
+
diff --git a/meta/classes/ccache.bbclass b/meta/classes/ccache.bbclass
new file mode 100644
index 0000000..2cdce46
--- /dev/null
+++ b/meta/classes/ccache.bbclass
@@ -0,0 +1,8 @@
+CCACHE = "${@bb.utils.which(d.getVar('PATH', True), 'ccache') and 'ccache '}"
+export CCACHE_DIR ?= "${TMPDIR}/ccache/${MULTIMACH_HOST_SYS}/${PN}"
+CCACHE_DISABLE[unexport] = "1"
+
+do_configure[dirs] =+ "${CCACHE_DIR}"
+do_kernel_configme[dirs] =+ "${CCACHE_DIR}"
+
+do_clean[cleandirs] += "${CCACHE_DIR}"
diff --git a/meta/classes/chrpath.bbclass b/meta/classes/chrpath.bbclass
new file mode 100644
index 0000000..e9160af
--- /dev/null
+++ b/meta/classes/chrpath.bbclass
@@ -0,0 +1,117 @@
+CHRPATH_BIN ?= "chrpath"
+PREPROCESS_RELOCATE_DIRS ?= ""
+
+def process_file_linux(cmd, fpath, rootdir, baseprefix, tmpdir, d):
+    import subprocess as sub
+
+    p = sub.Popen([cmd, '-l', fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+    err, out = p.communicate()
+    # If returned succesfully, process stderr for results
+    if p.returncode != 0:
+        return
+
+    # Handle RUNPATH as well as RPATH
+    err = err.replace("RUNPATH=","RPATH=")
+    # Throw away everything other than the rpath list
+    curr_rpath = err.partition("RPATH=")[2]
+    #bb.note("Current rpath for %s is %s" % (fpath, curr_rpath.strip()))
+    rpaths = curr_rpath.split(":")
+    new_rpaths = []
+    modified = False
+    for rpath in rpaths:
+        # If rpath is already dynamic copy it to new_rpath and continue
+        if rpath.find("$ORIGIN") != -1:
+            new_rpaths.append(rpath.strip())
+            continue
+        rpath =  os.path.normpath(rpath)
+        if baseprefix not in rpath and tmpdir not in rpath:
+            new_rpaths.append(rpath.strip())
+            continue
+        new_rpaths.append("$ORIGIN/" + os.path.relpath(rpath.strip(), os.path.dirname(fpath.replace(rootdir, "/"))))
+        modified = True
+
+    # if we have modified some rpaths call chrpath to update the binary
+    if modified:
+        args = ":".join(new_rpaths)
+        #bb.note("Setting rpath for %s to %s" %(fpath, args))
+        p = sub.Popen([cmd, '-r', args, fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+        out, err = p.communicate()
+        if p.returncode != 0:
+            bb.error("%s: chrpath command failed with exit code %d:\n%s%s" % (d.getVar('PN', True), p.returncode, out, err))
+            raise bb.build.FuncFailed
+
+def process_file_darwin(cmd, fpath, rootdir, baseprefix, tmpdir, d):
+    import subprocess as sub
+
+    p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+    err, out = p.communicate()
+    # If returned succesfully, process stderr for results
+    if p.returncode != 0:
+        return
+    for l in err.split("\n"):
+        if "(compatibility" not in l:
+            continue
+        rpath = l.partition("(compatibility")[0].strip()
+        if baseprefix not in rpath:
+            continue
+
+        newpath = "@loader_path/" + os.path.relpath(rpath, os.path.dirname(fpath.replace(rootdir, "/")))
+        p = sub.Popen([d.expand("${HOST_PREFIX}install_name_tool"), '-change', rpath, newpath, fpath],stdout=sub.PIPE,stderr=sub.PIPE)
+        err, out = p.communicate()
+
+def process_dir (rootdir, directory, d):
+    import stat
+
+    rootdir = os.path.normpath(rootdir)
+    cmd = d.expand('${CHRPATH_BIN}')
+    tmpdir = os.path.normpath(d.getVar('TMPDIR', False))
+    baseprefix = os.path.normpath(d.expand('${base_prefix}'))
+    hostos = d.getVar("HOST_OS", True)
+
+    #bb.debug("Checking %s for binaries to process" % directory)
+    if not os.path.exists(directory):
+        return
+
+    if "linux" in hostos:
+        process_file = process_file_linux
+    elif "darwin" in hostos:
+        process_file = process_file_darwin
+    else:
+        # Relocations not supported
+        return
+
+    dirs = os.listdir(directory)
+    for file in dirs:
+        fpath = directory + "/" + file
+        fpath = os.path.normpath(fpath)
+        if os.path.islink(fpath):
+            # Skip symlinks
+            continue
+
+        if os.path.isdir(fpath):
+            process_dir(rootdir, fpath, d)
+        else:
+            #bb.note("Testing %s for relocatability" % fpath)
+
+            # We need read and write permissions for chrpath, if we don't have
+            # them then set them temporarily. Take a copy of the files
+            # permissions so that we can restore them afterwards.
+            perms = os.stat(fpath)[stat.ST_MODE]
+            if os.access(fpath, os.W_OK|os.R_OK):
+                perms = None
+            else:
+                # Temporarily make the file writeable so we can chrpath it
+                os.chmod(fpath, perms|stat.S_IRWXU)
+            process_file(cmd, fpath, rootdir, baseprefix, tmpdir, d)
+                
+            if perms:
+                os.chmod(fpath, perms)
+
+def rpath_replace (path, d):
+    bindirs = d.expand("${bindir} ${sbindir} ${base_sbindir} ${base_bindir} ${libdir} ${base_libdir} ${libexecdir} ${PREPROCESS_RELOCATE_DIRS}").split()
+
+    for bindir in bindirs:
+        #bb.note ("Processing directory " + bindir)
+        directory = path + "/" + bindir
+        process_dir (path, directory, d)
+
diff --git a/meta/classes/clutter.bbclass b/meta/classes/clutter.bbclass
new file mode 100644
index 0000000..167407d
--- /dev/null
+++ b/meta/classes/clutter.bbclass
@@ -0,0 +1,22 @@
+
+def get_minor_dir(v):
+    import re
+    m = re.match("^([0-9]+)\.([0-9]+)", v)
+    return "%s.%s" % (m.group(1), m.group(2))
+
+def get_real_name(n):
+    import re
+    m = re.match("^([a-z]+(-[a-z]+)?)(-[0-9]+\.[0-9]+)?", n)
+    return "%s" % (m.group(1))
+
+VERMINOR = "${@get_minor_dir("${PV}")}"
+REALNAME = "${@get_real_name("${BPN}")}"
+
+CLUTTER_SRC_FTP = "${GNOME_MIRROR}/${REALNAME}/${VERMINOR}/${REALNAME}-${PV}.tar.xz;name=archive"
+
+CLUTTER_SRC_GIT = "git://git.gnome.org/${REALNAME}"
+
+SRC_URI = "${CLUTTER_SRC_FTP}"
+S = "${WORKDIR}/${REALNAME}-${PV}"
+
+inherit autotools pkgconfig gtk-doc gettext
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
new file mode 100644
index 0000000..ae3cc02
--- /dev/null
+++ b/meta/classes/cmake.bbclass
@@ -0,0 +1,138 @@
+# Path to the CMake file to process.
+OECMAKE_SOURCEPATH ?= "${S}"
+
+DEPENDS_prepend = "cmake-native "
+B = "${WORKDIR}/build"
+
+# We need to unset CCACHE otherwise cmake gets too confused
+CCACHE = ""
+
+# We want the staging and installing functions from autotools
+inherit autotools
+
+# C/C++ Compiler (without cpu arch/tune arguments)
+OECMAKE_C_COMPILER ?= "`echo ${CC} | sed 's/^\([^ ]*\).*/\1/'`"
+OECMAKE_CXX_COMPILER ?= "`echo ${CXX} | sed 's/^\([^ ]*\).*/\1/'`"
+OECMAKE_AR ?= "${AR}"
+
+# Compiler flags
+OECMAKE_C_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CFLAGS}"
+OECMAKE_CXX_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CXXFLAGS}"
+OECMAKE_C_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} ${CFLAGS} -DNDEBUG"
+OECMAKE_CXX_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} ${CXXFLAGS} -DNDEBUG"
+OECMAKE_C_LINK_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CPPFLAGS} ${LDFLAGS}"
+OECMAKE_CXX_LINK_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CXXFLAGS} ${LDFLAGS}"
+
+OECMAKE_RPATH ?= ""
+OECMAKE_PERLNATIVE_DIR ??= ""
+OECMAKE_EXTRA_ROOT_PATH ?= ""
+
+OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM = "ONLY"
+OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM_class-native = "BOTH"
+
+# CMake expects target architectures in the format of uname(2),
+# which do not always match TARGET_ARCH, so all the necessary
+# conversions should happen here.
+def map_target_arch_to_uname_arch(target_arch):
+    if target_arch == "powerpc":
+        return "ppc"
+    if target_arch == "powerpc64":
+        return "ppc64"
+    return target_arch
+
+cmake_do_generate_toolchain_file() {
+	cat > ${WORKDIR}/toolchain.cmake <<EOF
+# CMake system name must be something like "Linux".
+# This is important for cross-compiling.
+set( CMAKE_SYSTEM_NAME `echo ${TARGET_OS} | sed -e 's/^./\u&/' -e 's/^\(Linux\).*/\1/'` )
+set( CMAKE_SYSTEM_PROCESSOR ${@map_target_arch_to_uname_arch(d.getVar('TARGET_ARCH', True))} )
+set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} )
+set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} )
+set( CMAKE_ASM_COMPILER ${OECMAKE_C_COMPILER} )
+set( CMAKE_AR ${OECMAKE_AR} CACHE FILEPATH "Archiver" )
+set( CMAKE_C_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "CFLAGS" )
+set( CMAKE_CXX_FLAGS "${OECMAKE_CXX_FLAGS}" CACHE STRING "CXXFLAGS" )
+set( CMAKE_ASM_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "ASM FLAGS" )
+set( CMAKE_C_FLAGS_RELEASE "${OECMAKE_C_FLAGS_RELEASE}" CACHE STRING "CFLAGS for release" )
+set( CMAKE_CXX_FLAGS_RELEASE "${OECMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "CXXFLAGS for release" )
+set( CMAKE_ASM_FLAGS_RELEASE "${OECMAKE_C_FLAGS_RELEASE}" CACHE STRING "ASM FLAGS for release" )
+set( CMAKE_C_LINK_FLAGS "${OECMAKE_C_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
+set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
+
+# only search in the paths provided so cmake doesnt pick
+# up libraries and tools from the native build machine
+set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
+set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} )
+set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+
+# Use qt.conf settings
+set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf )
+
+# We need to set the rpath to the correct directory as cmake does not provide any
+# directory as rpath by default
+set( CMAKE_INSTALL_RPATH ${OECMAKE_RPATH} )
+
+# Use native cmake modules
+list(APPEND CMAKE_MODULE_PATH "${STAGING_DATADIR}/cmake/Modules/")
+
+# add for non /usr/lib libdir, e.g. /usr/lib64
+set( CMAKE_LIBRARY_PATH ${libdir} ${base_libdir})
+
+EOF
+}
+
+addtask generate_toolchain_file after do_patch before do_configure
+
+cmake_do_configure() {
+	if [ "${OECMAKE_BUILDPATH}" ]; then
+		bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH.  The default behaviour is now out-of-tree builds with B=WORKDIR/build."
+	fi
+
+	if [ "${S}" != "${B}" ]; then
+		rm -rf ${B}
+		mkdir -p ${B}
+		cd ${B}
+	else
+		find ${B} -name CMakeFiles -or -name Makefile -or -name cmake_install.cmake -or -name CMakeCache.txt -delete
+	fi
+
+	# Just like autotools cmake can use a site file to cache result that need generated binaries to run
+	if [ -e ${WORKDIR}/site-file.cmake ] ; then
+		OECMAKE_SITEFILE=" -C ${WORKDIR}/site-file.cmake"
+	else
+		OECMAKE_SITEFILE=""
+	fi
+
+	cmake \
+	  ${OECMAKE_SITEFILE} \
+	  ${OECMAKE_SOURCEPATH} \
+	  -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
+	  -DCMAKE_INSTALL_BINDIR:PATH=${bindir} \
+	  -DCMAKE_INSTALL_SBINDIR:PATH=${sbindir} \
+	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${libexecdir} \
+	  -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
+	  -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${sharedstatedir} \
+	  -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
+	  -DCMAKE_INSTALL_LIBDIR:PATH=${libdir} \
+	  -DCMAKE_INSTALL_INCLUDEDIR:PATH=${includedir} \
+	  -DCMAKE_INSTALL_DATAROOTDIR:PATH=${datadir} \
+	  -DCMAKE_INSTALL_SO_NO_EXE=0 \
+	  -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
+	  -DCMAKE_VERBOSE_MAKEFILE=1 \
+	  ${EXTRA_OECMAKE} \
+	  -Wno-dev
+}
+
+cmake_do_compile()  {
+	cd ${B}
+	base_do_compile
+}
+
+cmake_do_install() {
+	cd ${B}
+	autotools_do_install
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file
diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass
new file mode 100644
index 0000000..95cf584
--- /dev/null
+++ b/meta/classes/cml1.bbclass
@@ -0,0 +1,75 @@
+cml1_do_configure() {
+	set -e
+	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+	oe_runmake oldconfig
+}
+
+EXPORT_FUNCTIONS do_configure
+addtask configure after do_unpack do_patch before do_compile
+
+inherit terminal
+
+OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO CROSS_CURSES_LIB CROSS_CURSES_INC"
+HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}"
+HOSTLDFLAGS = "${BUILD_LDFLAGS}"
+CROSS_CURSES_LIB = "-lncurses -ltinfo"
+CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"'
+TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo"
+
+KCONFIG_CONFIG_COMMAND ??= "menuconfig"
+python do_menuconfig() {
+    import shutil
+
+    try:
+        mtime = os.path.getmtime(".config")
+        shutil.copy(".config", ".config.orig")
+    except OSError:
+        mtime = 0
+
+    oe_terminal("${SHELL} -c \"make ${KCONFIG_CONFIG_COMMAND}; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"", '${PN} Configuration', d)
+
+    # FIXME this check can be removed when the minimum bitbake version has been bumped
+    if hasattr(bb.build, 'write_taint'):
+        try:
+            newmtime = os.path.getmtime(".config")
+        except OSError:
+            newmtime = 0
+
+        if newmtime > mtime:
+            bb.note("Configuration changed, recompile will be forced")
+            bb.build.write_taint('do_compile', d)
+}
+do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
+do_menuconfig[nostamp] = "1"
+addtask menuconfig after do_configure
+
+python do_diffconfig() {
+    import shutil
+    import subprocess
+
+    workdir = d.getVar('WORKDIR', True)
+    fragment = workdir + '/fragment.cfg'
+    configorig = '.config.orig'
+    config = '.config'
+
+    try:
+        md5newconfig = bb.utils.md5_file(configorig)
+        md5config = bb.utils.md5_file(config)
+        isdiff = md5newconfig != md5config
+    except IOError as e:
+        bb.fatal("No config files found. Did you do menuconfig ?\n%s" % e)
+
+    if isdiff:
+        statement = 'diff --unchanged-line-format= --old-line-format= --new-line-format="%L" ' + configorig + ' ' + config + '>' + fragment
+        subprocess.call(statement, shell=True)
+
+        shutil.copy(configorig, config)
+
+        bb.plain("Config fragment has been dumped into:\n %s" % fragment)
+    else:
+        if os.path.exists(fragment):
+            os.unlink(fragment)
+}
+
+do_diffconfig[nostamp] = "1"
+addtask diffconfig
diff --git a/meta/classes/compress_doc.bbclass b/meta/classes/compress_doc.bbclass
new file mode 100644
index 0000000..9b58d82
--- /dev/null
+++ b/meta/classes/compress_doc.bbclass
@@ -0,0 +1,260 @@
+# Compress man pages in ${mandir} and info pages in ${infodir}
+#
+# 1. The doc will be compressed to gz format by default.
+#
+# 2. It will automatically correct the compressed doc which is not
+# in ${DOC_COMPRESS} but in ${DOC_COMPRESS_LIST} to the format
+# of ${DOC_COMPRESS} policy
+#
+# 3. It is easy to add a new type compression by editing
+# local.conf, such as:
+# DOC_COMPRESS_LIST_append = ' abc'
+# DOC_COMPRESS = 'abc'
+# DOC_COMPRESS_CMD[abc] = 'abc compress cmd ***'
+# DOC_DECOMPRESS_CMD[abc] = 'abc decompress cmd ***'
+
+# All supported compression policy
+DOC_COMPRESS_LIST ?= "gz xz bz2"
+
+# Compression policy, must be one of ${DOC_COMPRESS_LIST}
+DOC_COMPRESS ?= "gz"
+
+# Compression shell command
+DOC_COMPRESS_CMD[gz] ?= 'gzip -v -9 -n'
+DOC_COMPRESS_CMD[bz2] ?= "bzip2 -v -9"
+DOC_COMPRESS_CMD[xz] ?= "xz -v"
+
+# Decompression shell command
+DOC_DECOMPRESS_CMD[gz] ?= 'gunzip -v'
+DOC_DECOMPRESS_CMD[bz2] ?= "bunzip2 -v"
+DOC_DECOMPRESS_CMD[xz] ?= "unxz -v"
+
+PACKAGE_PREPROCESS_FUNCS += "package_do_compress_doc compress_doc_updatealternatives"
+python package_do_compress_doc() {
+    compress_mode = d.getVar('DOC_COMPRESS', True)
+    compress_list = (d.getVar('DOC_COMPRESS_LIST', True) or '').split()
+    if compress_mode not in compress_list:
+        bb.fatal('Compression policy %s not supported (not listed in %s)\n' % (compress_mode, compress_list))
+
+    dvar = d.getVar('PKGD', True)
+    compress_cmds = {}
+    decompress_cmds = {}
+    for mode in compress_list:
+        compress_cmds[mode] = d.getVarFlag('DOC_COMPRESS_CMD', mode)
+        decompress_cmds[mode] = d.getVarFlag('DOC_DECOMPRESS_CMD', mode)
+
+    mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir", True))
+    if os.path.exists(mandir):
+        # Decompress doc files which format is not compress_mode
+        decompress_doc(mandir, compress_mode, decompress_cmds)
+        compress_doc(mandir, compress_mode, compress_cmds)
+
+    infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir", True))
+    if os.path.exists(infodir):
+        # Decompress doc files which format is not compress_mode
+        decompress_doc(infodir, compress_mode, decompress_cmds)
+        compress_doc(infodir, compress_mode, compress_cmds)
+}
+
+def _get_compress_format(file, compress_format_list):
+    for compress_format in compress_format_list:
+        compress_suffix = '.' + compress_format
+        if file.endswith(compress_suffix):
+            return compress_format
+
+    return ''
+
+# Collect hardlinks to dict, each element in dict lists hardlinks
+# which points to the same doc file.
+# {hardlink10: [hardlink11, hardlink12],,,}
+# The hardlink10, hardlink11 and hardlink12 are the same file.
+def _collect_hardlink(hardlink_dict, file):
+    for hardlink in hardlink_dict:
+        # Add to the existed hardlink
+        if os.path.samefile(hardlink, file):
+            hardlink_dict[hardlink].append(file)
+            return hardlink_dict
+
+    hardlink_dict[file] = []
+    return hardlink_dict
+
+def _process_hardlink(hardlink_dict, compress_mode, shell_cmds, decompress=False):
+    for target in hardlink_dict:
+        if decompress:
+            compress_format = _get_compress_format(target, shell_cmds.keys())
+            cmd = "%s -f %s" % (shell_cmds[compress_format], target)
+            bb.note('decompress hardlink %s' % target)
+        else:
+            cmd = "%s -f %s" % (shell_cmds[compress_mode], target)
+            bb.note('compress hardlink %s' % target)
+        (retval, output) = oe.utils.getstatusoutput(cmd)
+        if retval:
+            bb.warn("de/compress file failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+            return
+
+        for hardlink_dup in hardlink_dict[target]:
+            if decompress:
+                # Remove compress suffix
+                compress_suffix = '.' + compress_format
+                new_hardlink = hardlink_dup[:-len(compress_suffix)]
+                new_target = target[:-len(compress_suffix)]
+            else:
+                # Append compress suffix
+                compress_suffix = '.' + compress_mode
+                new_hardlink = hardlink_dup + compress_suffix
+                new_target = target + compress_suffix
+
+            bb.note('hardlink %s-->%s' % (new_hardlink, new_target))
+            if not os.path.exists(new_hardlink):
+                os.link(new_target, new_hardlink)
+            if os.path.exists(hardlink_dup):
+                os.unlink(hardlink_dup)
+
+def _process_symlink(file, compress_format, decompress=False):
+    compress_suffix = '.' + compress_format
+    if decompress:
+        # Remove compress suffix
+        new_linkname = file[:-len(compress_suffix)]
+        new_source = os.readlink(file)[:-len(compress_suffix)]
+    else:
+        # Append compress suffix
+        new_linkname = file + compress_suffix
+        new_source = os.readlink(file) + compress_suffix
+
+    bb.note('symlink %s-->%s' % (new_linkname, new_source))
+    if not os.path.exists(new_linkname):
+        os.symlink(new_source, new_linkname)
+
+    os.unlink(file)
+
+def _is_info(file):
+    flags = '.info .info-'.split()
+    for flag in flags:
+        if flag in os.path.basename(file):
+            return True
+
+    return False
+
+def _is_man(file):
+    import re
+
+    # It refers MANSECT-var in man(1.6g)'s man.config
+    # ".1:.1p:.8:.2:.3:.3p:.4:.5:.6:.7:.9:.0p:.tcl:.n:.l:.p:.o"
+    # Not start with '.', and contain the above colon-seperate element
+    p = re.compile(r'[^\.]+\.([1-9lnop]|0p|tcl)')
+    if p.search(file):
+        return True
+
+    return False
+
+def _is_compress_doc(file, compress_format_list):
+    compress_format = _get_compress_format(file, compress_format_list)
+    compress_suffix = '.' + compress_format
+    if file.endswith(compress_suffix):
+        # Remove the compress suffix
+        uncompress_file = file[:-len(compress_suffix)]
+        if _is_info(uncompress_file) or _is_man(uncompress_file):
+            return True, compress_format
+
+    return False, ''
+
+def compress_doc(topdir, compress_mode, compress_cmds):
+    hardlink_dict = {}
+    for root, dirs, files in os.walk(topdir):
+        for f in files:
+            file = os.path.join(root, f)
+            if os.path.isdir(file):
+                continue
+
+            if _is_info(file) or _is_man(file):
+                # Symlink
+                if os.path.islink(file):
+                    _process_symlink(file, compress_mode)
+                # Hardlink
+                elif os.lstat(file).st_nlink > 1:
+                    _collect_hardlink(hardlink_dict, file)
+                # Normal file
+                elif os.path.isfile(file):
+                    cmd = "%s %s" % (compress_cmds[compress_mode], file)
+                    (retval, output) = oe.utils.getstatusoutput(cmd)
+                    if retval:
+                        bb.warn("compress failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+                        continue
+                    bb.note('compress file %s' % file)
+
+    _process_hardlink(hardlink_dict, compress_mode, compress_cmds)
+
+# Decompress doc files which format is not compress_mode
+def decompress_doc(topdir, compress_mode, decompress_cmds):
+    hardlink_dict = {}
+    decompress = True
+    for root, dirs, files in os.walk(topdir):
+        for f in files:
+            file = os.path.join(root, f)
+            if os.path.isdir(file):
+                continue
+
+            res, compress_format = _is_compress_doc(file, decompress_cmds.keys())
+            # Decompress files which format is not compress_mode
+            if res and compress_mode!=compress_format:
+                # Symlink
+                if os.path.islink(file):
+                    _process_symlink(file, compress_format, decompress)
+                # Hardlink
+                elif os.lstat(file).st_nlink > 1:
+                    _collect_hardlink(hardlink_dict, file)
+                # Normal file
+                elif os.path.isfile(file):
+                    cmd = "%s %s" % (decompress_cmds[compress_format], file)
+                    (retval, output) = oe.utils.getstatusoutput(cmd)
+                    if retval:
+                        bb.warn("decompress failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+                        continue
+                    bb.note('decompress file %s' % file)
+
+    _process_hardlink(hardlink_dict, compress_mode, decompress_cmds, decompress)
+
+python compress_doc_updatealternatives () {
+    if not bb.data.inherits_class('update-alternatives', d):
+        return
+
+    mandir = d.getVar("mandir", True)
+    infodir = d.getVar("infodir", True)
+    compress_mode = d.getVar('DOC_COMPRESS', True)
+    for pkg in (d.getVar('PACKAGES', True) or "").split():
+        old_names = (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split()
+        new_names = []
+        for old_name in old_names:
+            old_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', old_name, True)
+            old_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name, True) or \
+                d.getVarFlag('ALTERNATIVE_TARGET', old_name, True) or \
+                d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or \
+                d.getVar('ALTERNATIVE_TARGET', True) or \
+                old_link
+            # Sometimes old_target is specified as relative to the link name.
+            old_target   = os.path.join(os.path.dirname(old_link), old_target)
+
+            # The updatealternatives used for compress doc
+            if mandir in old_target or infodir in old_target:
+                new_name = old_name + '.' + compress_mode
+                new_link = old_link + '.' + compress_mode
+                new_target = old_target + '.' + compress_mode
+                d.delVarFlag('ALTERNATIVE_LINK_NAME', old_name)
+                d.setVarFlag('ALTERNATIVE_LINK_NAME', new_name, new_link)
+                if d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name, True):
+                    d.delVarFlag('ALTERNATIVE_TARGET_%s' % pkg, old_name)
+                    d.setVarFlag('ALTERNATIVE_TARGET_%s' % pkg, new_name, new_target)
+                elif d.getVarFlag('ALTERNATIVE_TARGET', old_name, True):
+                    d.delVarFlag('ALTERNATIVE_TARGET', old_name)
+                    d.setVarFlag('ALTERNATIVE_TARGET', new_name, new_target)
+                elif d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True):
+                    d.setVar('ALTERNATIVE_TARGET_%s' % pkg, new_target)
+                elif d.getVar('ALTERNATIVE_TARGET', old_name, True):
+                    d.setVar('ALTERNATIVE_TARGET', new_target)
+
+                new_names.append(new_name)
+
+        if new_names:
+            d.setVar('ALTERNATIVE_%s' % pkg, ' '.join(new_names))
+}
+
diff --git a/meta/classes/copyleft_compliance.bbclass b/meta/classes/copyleft_compliance.bbclass
new file mode 100644
index 0000000..907c183
--- /dev/null
+++ b/meta/classes/copyleft_compliance.bbclass
@@ -0,0 +1,64 @@
+# Deploy sources for recipes for compliance with copyleft-style licenses
+# Defaults to using symlinks, as it's a quick operation, and one can easily
+# follow the links when making use of the files (e.g. tar with the -h arg).
+#
+# vi:sts=4:sw=4:et
+
+inherit copyleft_filter
+
+COPYLEFT_SOURCES_DIR ?= '${DEPLOY_DIR}/copyleft_sources'
+
+python do_prepare_copyleft_sources () {
+    """Populate a tree of the recipe sources and emit patch series files"""
+    import os.path
+    import shutil
+
+    p = d.getVar('P', True)
+    included, reason = copyleft_should_include(d)
+    if not included:
+        bb.debug(1, 'copyleft: %s is excluded: %s' % (p, reason))
+        return
+    else:
+        bb.debug(1, 'copyleft: %s is included: %s' % (p, reason))
+
+    sources_dir = d.getVar('COPYLEFT_SOURCES_DIR', True)
+    dl_dir = d.getVar('DL_DIR', True)
+    src_uri = d.getVar('SRC_URI', True).split()
+    fetch = bb.fetch2.Fetch(src_uri, d)
+    ud = fetch.ud
+
+    pf = d.getVar('PF', True)
+    dest = os.path.join(sources_dir, pf)
+    shutil.rmtree(dest, ignore_errors=True)
+    bb.utils.mkdirhier(dest)
+
+    for u in ud.values():
+        local = os.path.normpath(fetch.localpath(u.url))
+        if local.endswith('.bb'):
+            continue
+        elif local.endswith('/'):
+            local = local[:-1]
+
+        if u.mirrortarball:
+            tarball_path = os.path.join(dl_dir, u.mirrortarball)
+            if os.path.exists(tarball_path):
+                local = tarball_path
+
+        oe.path.symlink(local, os.path.join(dest, os.path.basename(local)), force=True)
+
+    patches = src_patches(d)
+    for patch in patches:
+        _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
+        patchdir = parm.get('patchdir')
+        if patchdir:
+            series = os.path.join(dest, 'series.subdir.%s' % patchdir.replace('/', '_'))
+        else:
+            series = os.path.join(dest, 'series')
+
+        with open(series, 'a') as s:
+            s.write('%s -p%s\n' % (os.path.basename(local), parm['striplevel']))
+}
+
+addtask prepare_copyleft_sources after do_fetch before do_build
+do_prepare_copyleft_sources[dirs] = "${WORKDIR}"
+do_build[recrdeptask] += 'do_prepare_copyleft_sources'
diff --git a/meta/classes/copyleft_filter.bbclass b/meta/classes/copyleft_filter.bbclass
new file mode 100644
index 0000000..46be7f7
--- /dev/null
+++ b/meta/classes/copyleft_filter.bbclass
@@ -0,0 +1,79 @@
+# Filter the license, the copyleft_should_include returns True for the
+# COPYLEFT_LICENSE_INCLUDE recipe, and False for the
+# COPYLEFT_LICENSE_EXCLUDE.
+#
+# By default, includes all GPL and LGPL, and excludes CLOSED and Proprietary.
+#
+# vi:sts=4:sw=4:et
+
+COPYLEFT_LICENSE_INCLUDE ?= 'GPL* LGPL*'
+COPYLEFT_LICENSE_INCLUDE[type] = 'list'
+COPYLEFT_LICENSE_INCLUDE[doc] = 'Space separated list of globs which include licenses'
+
+COPYLEFT_LICENSE_EXCLUDE ?= 'CLOSED Proprietary'
+COPYLEFT_LICENSE_EXCLUDE[type] = 'list'
+COPYLEFT_LICENSE_EXCLUDE[doc] = 'Space separated list of globs which exclude licenses'
+
+COPYLEFT_RECIPE_TYPE ?= '${@copyleft_recipe_type(d)}'
+COPYLEFT_RECIPE_TYPE[doc] = 'The "type" of the current recipe (e.g. target, native, cross)'
+
+COPYLEFT_RECIPE_TYPES ?= 'target'
+COPYLEFT_RECIPE_TYPES[type] = 'list'
+COPYLEFT_RECIPE_TYPES[doc] = 'Space separated list of recipe types to include'
+
+COPYLEFT_AVAILABLE_RECIPE_TYPES = 'target native nativesdk cross crosssdk cross-canadian'
+COPYLEFT_AVAILABLE_RECIPE_TYPES[type] = 'list'
+COPYLEFT_AVAILABLE_RECIPE_TYPES[doc] = 'Space separated list of available recipe types'
+
+COPYLEFT_PN_INCLUDE ?= ''
+COPYLEFT_PN_INCLUDE[type] = 'list'
+COPYLEFT_PN_INCLUDE[doc] = 'Space separated list of recipe names to include'
+
+COPYLEFT_PN_EXCLUDE ?= ''
+COPYLEFT_PN_EXCLUDE[type] = 'list'
+COPYLEFT_PN_EXCLUDE[doc] = 'Space separated list of recipe names to exclude'
+
+def copyleft_recipe_type(d):
+    for recipe_type in oe.data.typed_value('COPYLEFT_AVAILABLE_RECIPE_TYPES', d):
+        if oe.utils.inherits(d, recipe_type):
+            return recipe_type
+    return 'target'
+
+def copyleft_should_include(d):
+    """
+    Determine if this recipe's sources should be deployed for compliance
+    """
+    import ast
+    import oe.license
+    from fnmatch import fnmatchcase as fnmatch
+
+    included, motive = False, 'recipe did not match anything'
+
+    recipe_type = d.getVar('COPYLEFT_RECIPE_TYPE', True)
+    if recipe_type not in oe.data.typed_value('COPYLEFT_RECIPE_TYPES', d):
+        include, motive = False, 'recipe type "%s" is excluded' % recipe_type
+
+    include = oe.data.typed_value('COPYLEFT_LICENSE_INCLUDE', d)
+    exclude = oe.data.typed_value('COPYLEFT_LICENSE_EXCLUDE', d)
+
+    try:
+        is_included, reason = oe.license.is_included(d.getVar('LICENSE', True), include, exclude)
+    except oe.license.LicenseError as exc:
+        bb.fatal('%s: %s' % (d.getVar('PF', True), exc))
+    else:
+        if is_included:
+            if reason:
+                included, motive = True, 'recipe has included licenses: %s' % ', '.join(reason)
+            else:
+                included, motive = False, 'recipe does not include a copyleft license'
+        else:
+            included, motive = False, 'recipe has excluded licenses: %s' % ', '.join(reason)
+
+    if any(fnmatch(d.getVar('PN', True), name) \
+            for name in oe.data.typed_value('COPYLEFT_PN_INCLUDE', d)):
+        included, motive =  True, 'recipe included by name'
+    if any(fnmatch(d.getVar('PN', True), name) \
+            for name in oe.data.typed_value('COPYLEFT_PN_EXCLUDE', d)):
+        included, motive = False, 'recipe excluded by name'
+
+    return included, motive
diff --git a/meta/classes/core-image.bbclass b/meta/classes/core-image.bbclass
new file mode 100644
index 0000000..8e340d9
--- /dev/null
+++ b/meta/classes/core-image.bbclass
@@ -0,0 +1,73 @@
+# Common code for generating core reference images
+#
+# Copyright (C) 2007-2011 Linux Foundation
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+# IMAGE_FEATURES control content of the core reference images
+# 
+# By default we install packagegroup-core-boot and packagegroup-base-extended packages;
+# this gives us working (console only) rootfs.
+#
+# Available IMAGE_FEATURES:
+#
+# - x11                 - X server
+# - x11-base            - X server with minimal environment
+# - x11-sato            - OpenedHand Sato environment
+# - tools-debug         - debugging tools
+# - eclipse-debug       - Eclipse remote debugging support
+# - tools-profile       - profiling tools
+# - tools-testapps      - tools usable to make some device tests
+# - tools-sdk           - SDK (C/C++ compiler, autotools, etc.)
+# - nfs-server          - NFS server
+# - nfs-client          - NFS client
+# - ssh-server-dropbear - SSH server (dropbear)
+# - ssh-server-openssh  - SSH server (openssh)
+# - qt4-pkgs            - Qt4/X11 and demo applications
+# - hwcodecs            - Install hardware acceleration codecs
+# - package-management  - installs package management tools and preserves the package manager database
+# - debug-tweaks        - makes an image suitable for development, e.g. allowing passwordless root logins
+# - dev-pkgs            - development packages (headers, etc.) for all installed packages in the rootfs
+# - dbg-pkgs            - debug symbol packages for all installed packages in the rootfs
+# - doc-pkgs            - documentation packages for all installed packages in the rootfs
+# - ptest-pkgs          - ptest packages for all ptest-enabled recipes
+# - read-only-rootfs    - tweaks an image to support read-only rootfs
+#
+FEATURE_PACKAGES_x11 = "packagegroup-core-x11"
+FEATURE_PACKAGES_x11-base = "packagegroup-core-x11-base"
+FEATURE_PACKAGES_x11-sato = "packagegroup-core-x11-sato"
+FEATURE_PACKAGES_tools-debug = "packagegroup-core-tools-debug"
+FEATURE_PACKAGES_eclipse-debug = "packagegroup-core-eclipse-debug"
+FEATURE_PACKAGES_tools-profile = "packagegroup-core-tools-profile"
+FEATURE_PACKAGES_tools-testapps = "packagegroup-core-tools-testapps"
+FEATURE_PACKAGES_tools-sdk = "packagegroup-core-sdk packagegroup-core-standalone-sdk-target"
+FEATURE_PACKAGES_nfs-server = "packagegroup-core-nfs-server"
+FEATURE_PACKAGES_nfs-client = "packagegroup-core-nfs-client"
+FEATURE_PACKAGES_ssh-server-dropbear = "packagegroup-core-ssh-dropbear"
+FEATURE_PACKAGES_ssh-server-openssh = "packagegroup-core-ssh-openssh"
+FEATURE_PACKAGES_qt4-pkgs = "packagegroup-core-qt-demoapps"
+FEATURE_PACKAGES_hwcodecs = "${MACHINE_HWCODECS}"
+
+
+# IMAGE_FEATURES_REPLACES_foo = 'bar1 bar2'
+# Including image feature foo would replace the image features bar1 and bar2
+IMAGE_FEATURES_REPLACES_ssh-server-openssh = "ssh-server-dropbear"
+
+# IMAGE_FEATURES_CONFLICTS_foo = 'bar1 bar2'
+# An error exception would be raised if both image features foo and bar1(or bar2) are included
+
+MACHINE_HWCODECS ??= ""
+
+CORE_IMAGE_BASE_INSTALL = '\
+    packagegroup-core-boot \
+    packagegroup-base-extended \
+    \
+    ${CORE_IMAGE_EXTRA_INSTALL} \
+    '
+
+CORE_IMAGE_EXTRA_INSTALL ?= ""
+
+IMAGE_INSTALL ?= "${CORE_IMAGE_BASE_INSTALL}"
+
+inherit image
diff --git a/meta/classes/cpan-base.bbclass b/meta/classes/cpan-base.bbclass
new file mode 100644
index 0000000..d9817ba
--- /dev/null
+++ b/meta/classes/cpan-base.bbclass
@@ -0,0 +1,55 @@
+#
+# cpan-base providers various perl related information needed for building
+# cpan modules
+#
+FILES_${PN} += "${libdir}/perl ${datadir}/perl"
+
+DEPENDS  += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
+RDEPENDS_${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
+
+PERL_OWN_DIR = "${@["", "/perl-native"][(bb.data.inherits_class('native', d))]}"
+
+# Determine the staged version of perl from the perl configuration file
+# Assign vardepvalue, because otherwise signature is changed before and after
+# perl is built (from None to real version in config.sh).
+get_perl_version[vardepvalue] = "${PERL_OWN_DIR}"
+def get_perl_version(d):
+    import re
+    cfg = d.expand('${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh')
+    try:
+        f = open(cfg, 'r')
+    except IOError:
+        return None
+    l = f.readlines();
+    f.close();
+    r = re.compile("^version='(\d*\.\d*\.\d*)'")
+    for s in l:
+        m = r.match(s)
+        if m:
+            return m.group(1)
+    return None
+
+# Determine where the library directories are
+def perl_get_libdirs(d):
+    libdir = d.getVar('libdir', True)
+    if is_target(d) == "no":
+        libdir += '/perl-native'
+    libdir += '/perl'
+    return libdir
+
+def is_target(d):
+    if not bb.data.inherits_class('native', d):
+        return "yes"
+    return "no"
+
+PERLLIBDIRS := "${@perl_get_libdirs(d)}"
+PERLVERSION := "${@get_perl_version(d)}"
+PERLVERSION[vardepvalue] = ""
+
+FILES_${PN}-dbg += "${PERLLIBDIRS}/auto/*/.debug \
+                    ${PERLLIBDIRS}/auto/*/*/.debug \
+                    ${PERLLIBDIRS}/auto/*/*/*/.debug \
+                    ${PERLLIBDIRS}/vendor_perl/${PERLVERSION}/auto/*/.debug \
+                    ${PERLLIBDIRS}/vendor_perl/${PERLVERSION}/auto/*/*/.debug \
+                    ${PERLLIBDIRS}/vendor_perl/${PERLVERSION}/auto/*/*/*/.debug \
+                    "
diff --git a/meta/classes/cpan.bbclass b/meta/classes/cpan.bbclass
new file mode 100644
index 0000000..e2bbd2f
--- /dev/null
+++ b/meta/classes/cpan.bbclass
@@ -0,0 +1,55 @@
+#
+# This is for perl modules that use the old Makefile.PL build system
+#
+inherit cpan-base perlnative
+
+EXTRA_CPANFLAGS ?= ""
+EXTRA_PERLFLAGS ?= ""
+
+# Env var which tells perl if it should use host (no) or target (yes) settings
+export PERLCONFIGTARGET = "${@is_target(d)}"
+
+# Env var which tells perl where the perl include files are
+export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE"
+export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${@get_perl_version(d)}/"
+
+cpan_do_configure () {
+	export PERL5LIB="${PERL_ARCHLIB}"
+	yes '' | perl ${EXTRA_PERLFLAGS} Makefile.PL ${EXTRA_CPANFLAGS}
+
+	# Makefile.PLs can exit with success without generating a
+	# Makefile, e.g. in cases of missing configure time
+	# dependencies. This is considered a best practice by
+	# cpantesters.org. See:
+	#  * http://wiki.cpantesters.org/wiki/CPANAuthorNotes
+	#  * http://www.nntp.perl.org/group/perl.qa/2008/08/msg11236.html
+	[ -e Makefile ] || bbfatal "No Makefile was generated by Makefile.PL"
+
+	if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
+		. ${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/config.sh
+		# Use find since there can be a Makefile generated for each Makefile.PL
+		for f in `find -name Makefile.PL`; do
+			f2=`echo $f | sed -e 's/.PL//'`
+			test -f $f2 || continue
+			sed -i -e "s:\(PERL_ARCHLIB = \).*:\1${PERL_ARCHLIB}:" \
+				-e 's/perl.real/perl/' \
+				-e "s|^\(CCFLAGS =.*\)|\1 ${CFLAGS}|" \
+				$f2
+		done
+	fi
+}
+
+cpan_do_compile () {
+	oe_runmake PASTHRU_INC="${CFLAGS}" LD="${CCLD}"
+}
+
+cpan_do_install () {
+	oe_runmake DESTDIR="${D}" install_vendor
+	for PERLSCRIPT in `grep -rIEl '#! *${bindir}/perl-native.*/perl' ${D}`; do
+		sed -i -e 's|${bindir}/perl-native.*/perl|/usr/bin/env nativeperl|' $PERLSCRIPT
+	done
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
diff --git a/meta/classes/cpan_build.bbclass b/meta/classes/cpan_build.bbclass
new file mode 100644
index 0000000..4f648a6
--- /dev/null
+++ b/meta/classes/cpan_build.bbclass
@@ -0,0 +1,37 @@
+#
+# This is for perl modules that use the new Build.PL build system
+#
+inherit cpan-base perlnative
+
+EXTRA_CPAN_BUILD_FLAGS ?= ""
+
+# Env var which tells perl if it should use host (no) or target (yes) settings
+export PERLCONFIGTARGET = "${@is_target(d)}"
+export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export LD = "${CCLD}"
+
+cpan_build_do_configure () {
+	if [ "${@is_target(d)}" = "yes" ]; then
+		# build for target
+		. ${STAGING_LIBDIR}/perl/config.sh
+	fi
+
+	perl Build.PL --installdirs vendor \
+				--destdir ${D} \
+				--install_path arch="${libdir}/perl" \
+				--install_path script=${bindir} \
+				--install_path bin=${bindir} \
+				--install_path bindoc=${mandir}/man1 \
+				--install_path libdoc=${mandir}/man3 \
+                                ${EXTRA_CPAN_BUILD_FLAGS}
+}
+
+cpan_build_do_compile () {
+        perl Build
+}
+
+cpan_build_do_install () {
+	perl Build install
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
diff --git a/meta/classes/cross-canadian.bbclass b/meta/classes/cross-canadian.bbclass
new file mode 100644
index 0000000..d30a168
--- /dev/null
+++ b/meta/classes/cross-canadian.bbclass
@@ -0,0 +1,185 @@
+#
+# NOTE - When using this class the user is responsible for ensuring that
+# TRANSLATED_TARGET_ARCH is added into PN. This ensures that if the TARGET_ARCH
+# is changed, another nativesdk xxx-canadian-cross can be installed
+#
+
+
+# SDK packages are built either explicitly by the user,
+# or indirectly via dependency.  No need to be in 'world'.
+EXCLUDE_FROM_WORLD = "1"
+CLASSOVERRIDE = "class-cross-canadian"
+STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}:${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+#
+# Update BASE_PACKAGE_ARCH and PACKAGE_ARCHS
+#
+PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
+CANADIANEXTRAOS = "linux-uclibc linux-musl"
+CANADIANEXTRAVENDOR = ""
+MODIFYTOS ??= "1"
+python () {
+    archs = d.getVar('PACKAGE_ARCHS', True).split()
+    sdkarchs = []
+    for arch in archs:
+        sdkarchs.append(arch + '-${SDKPKGSUFFIX}')
+    d.setVar('PACKAGE_ARCHS', " ".join(sdkarchs))
+
+    # Allow the following code segment to be disabled, e.g. meta-environment
+    if d.getVar("MODIFYTOS", True) != "1":
+        return
+
+    if d.getVar("TCLIBC", True) == "baremetal":
+        return
+
+    tos = d.getVar("TARGET_OS", True)
+    whitelist = []
+    for variant in ["", "spe", "x32", "eabi", "n32"]:
+        for libc in ["", "uclibc", "musl"]:
+            entry = "linux"
+            if variant and libc:
+                entry = entry + "-" + libc + variant
+            elif variant:
+                entry = entry + "-gnu" + variant
+            elif libc:
+                entry = entry + "-" + libc
+            whitelist.append(entry)
+    if tos not in whitelist:
+        bb.fatal("Building cross-candian for an unknown TARGET_SYS (%s), please update cross-canadian.bbclass" % d.getVar("TARGET_SYS", True))
+
+    for n in ["PROVIDES", "DEPENDS"]:
+        d.setVar(n, d.getVar(n, True))
+    d.setVar("STAGING_BINDIR_TOOLCHAIN", d.getVar("STAGING_BINDIR_TOOLCHAIN", True))
+    for prefix in ["AR", "AS", "DLLTOOL", "CC", "CXX", "GCC", "LD", "LIPO", "NM", "OBJDUMP", "RANLIB", "STRIP", "WINDRES"]:
+        n = prefix + "_FOR_TARGET"
+        d.setVar(n, d.getVar(n, True))
+    # This is a bit ugly. We need to zero LIBC/ABI extension which will change TARGET_OS
+    # however we need the old value in some variables. We expand those here first.
+    tarch = d.getVar("TARGET_ARCH", True)
+    if tarch == "x86_64":
+        d.setVar("LIBCEXTENSION", "")
+        d.setVar("ABIEXTENSION", "")
+        d.appendVar("CANADIANEXTRAOS", " linux-gnux32 linux-uclibcx32 linux-muslx32")
+    elif tarch == "powerpc":
+        # PowerPC can build "linux" and "linux-gnuspe"
+        d.setVar("LIBCEXTENSION", "")
+        d.setVar("ABIEXTENSION", "")
+        d.appendVar("CANADIANEXTRAOS", " linux-gnuspe linux-uclibcspe linux-muslspe")
+    elif tarch == "mips64":
+        d.appendVar("CANADIANEXTRAOS", " linux-gnun32 linux-uclibcn32 linux-musln32")
+    if tarch == "arm":
+        d.setVar("TARGET_OS", "linux-gnueabi")
+    else:
+        d.setVar("TARGET_OS", "linux")
+
+    # Also need to handle multilib target vendors
+    vendors = d.getVar("CANADIANEXTRAVENDOR", True)
+    if not vendors:
+        vendors = all_multilib_tune_values(d, 'TARGET_VENDOR')
+    origvendor = d.getVar("TARGET_VENDOR_MULTILIB_ORIGINAL", True)
+    if origvendor:
+        d.setVar("TARGET_VENDOR", origvendor)
+        if origvendor not in vendors.split():
+            vendors = origvendor + " " + vendors
+    d.setVar("CANADIANEXTRAVENDOR", vendors)
+}
+MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
+
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR}/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}"
+
+PATH_append = ":${TMPDIR}/sysroots/${HOST_ARCH}/${bindir_cross}"
+PKGHIST_DIR = "${TMPDIR}/pkghistory/${HOST_ARCH}-${SDKPKGSUFFIX}${HOST_VENDOR}-${HOST_OS}/"
+
+HOST_ARCH = "${SDK_ARCH}"
+HOST_VENDOR = "${SDK_VENDOR}"
+HOST_OS = "${SDK_OS}"
+HOST_PREFIX = "${SDK_PREFIX}"
+HOST_CC_ARCH = "${SDK_CC_ARCH}"
+HOST_LD_ARCH = "${SDK_LD_ARCH}"
+HOST_AS_ARCH = "${SDK_AS_ARCH}"
+
+#assign DPKG_ARCH
+DPKG_ARCH = "${SDK_ARCH}"
+
+CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+CFLAGS = "${BUILDSDK_CFLAGS}"
+CXXFLAGS = "${BUILDSDK_CFLAGS}"
+LDFLAGS = "${BUILDSDK_LDFLAGS} \
+           -Wl,-rpath-link,${STAGING_LIBDIR}/.. \
+           -Wl,-rpath,${libdir}/.. "
+
+DEPENDS_GETTEXT = "gettext-native nativesdk-gettext"
+
+#
+# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
+# binaries
+#
+DEPENDS_append = " chrpath-replacement-native"
+EXTRANATIVEPATH += "chrpath-native"
+
+# Path mangling needed by the cross packaging
+# Note that we use := here to ensure that libdir and includedir are
+# target paths.
+target_base_prefix := "${base_prefix}"
+target_prefix := "${prefix}"
+target_exec_prefix := "${exec_prefix}"
+target_base_libdir = "${target_base_prefix}/${baselib}"
+target_libdir = "${target_exec_prefix}/${baselib}"
+target_includedir := "${includedir}"
+
+# Change to place files in SDKPATH
+base_prefix = "${SDKPATHNATIVE}"
+prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+bindir = "${exec_prefix}/bin/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+sbindir = "${bindir}"
+base_bindir = "${bindir}"
+base_sbindir = "${bindir}"
+libdir = "${exec_prefix}/lib/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+libexecdir = "${exec_prefix}/libexec/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+FILES_${PN} = "${prefix}"
+FILES_${PN}-dbg += "${prefix}/.debug \
+                    ${prefix}/bin/.debug \
+                   "
+
+export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${layout_libdir}/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
+
+do_populate_sysroot[stamp-extra-info] = ""
+do_packagedata[stamp-extra-info] = ""
+
+USE_NLS = "${SDKUSE_NLS}"
+
+# We have to us TARGET_ARCH but we care about the absolute value
+# and not any particular tune that is enabled.
+TARGET_ARCH[vardepsexclude] = "TUNE_ARCH"
+
+# If MLPREFIX is set by multilib code, shlibs
+# points to the wrong place so force it
+SHLIBSDIRS = "${PKGDATA_DIR}/nativesdk-shlibs2"
+SHLIBSWORKDIR = "${PKGDATA_DIR}/nativesdk-shlibs2"
+
+cross_canadian_bindirlinks () {
+	for i in linux ${CANADIANEXTRAOS}
+	do
+		for v in ${CANADIANEXTRAVENDOR}
+		do
+			d=${D}${bindir}/../${TARGET_ARCH}$v-$i
+			if [ -d $d ];
+			then
+			    continue
+			fi
+			install -d $d
+			for j in `ls ${D}${bindir}`
+			do
+				p=${TARGET_ARCH}$v-$i-`echo $j | sed -e s,${TARGET_PREFIX},,`
+				ln -s ../${TARGET_SYS}/$j $d/$p
+			done
+		done
+       done
+}
diff --git a/meta/classes/cross.bbclass b/meta/classes/cross.bbclass
new file mode 100644
index 0000000..3eab5b9
--- /dev/null
+++ b/meta/classes/cross.bbclass
@@ -0,0 +1,77 @@
+inherit relocatable
+
+# Cross packages are built indirectly via dependency,
+# no need for them to be a direct target of 'world'
+EXCLUDE_FROM_WORLD = "1"
+
+CLASSOVERRIDE = "class-cross"
+PACKAGES = ""
+PACKAGES_DYNAMIC = ""
+PACKAGES_DYNAMIC_class-native = ""
+
+HOST_ARCH = "${BUILD_ARCH}"
+HOST_VENDOR = "${BUILD_VENDOR}"
+HOST_OS = "${BUILD_OS}"
+HOST_PREFIX = "${BUILD_PREFIX}"
+HOST_CC_ARCH = "${BUILD_CC_ARCH}"
+HOST_LD_ARCH = "${BUILD_LD_ARCH}"
+HOST_AS_ARCH = "${BUILD_AS_ARCH}"
+
+STAGING_DIR_HOST = "${STAGING_DIR}/${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
+
+PACKAGE_ARCH = "${BUILD_ARCH}"
+
+MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
+
+export PKG_CONFIG_DIR = "${exec_prefix}/lib/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR = ""
+
+CPPFLAGS = "${BUILD_CPPFLAGS}"
+CFLAGS = "${BUILD_CFLAGS}"
+CXXFLAGS = "${BUILD_CFLAGS}"
+LDFLAGS = "${BUILD_LDFLAGS}"
+LDFLAGS_build-darwin = "-L${STAGING_LIBDIR_NATIVE}"
+
+TOOLCHAIN_OPTIONS = ""
+
+DEPENDS_GETTEXT = "gettext-native"
+
+# Path mangling needed by the cross packaging
+# Note that we use := here to ensure that libdir and includedir are
+# target paths.
+target_base_prefix := "${base_prefix}"
+target_prefix := "${prefix}"
+target_exec_prefix := "${exec_prefix}"
+target_base_libdir = "${target_base_prefix}/${baselib}"
+target_libdir = "${target_exec_prefix}/${baselib}"
+target_includedir := "${includedir}"
+
+# Overrides for paths
+CROSS_TARGET_SYS_DIR = "${TARGET_SYS}"
+prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
+base_prefix = "${STAGING_DIR_NATIVE}"
+exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
+bindir = "${exec_prefix}/bin/${CROSS_TARGET_SYS_DIR}"
+sbindir = "${bindir}"
+base_bindir = "${bindir}"
+base_sbindir = "${bindir}"
+libdir = "${exec_prefix}/lib/${CROSS_TARGET_SYS_DIR}"
+libexecdir = "${exec_prefix}/libexec/${CROSS_TARGET_SYS_DIR}"
+
+do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}/"
+do_populate_sysroot[stamp-extra-info] = ""
+do_packagedata[stamp-extra-info] = ""
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install
+}
+
+USE_NLS = "no"
+
+deltask package
+deltask packagedata
+deltask package_qa
+deltask package_write_ipk
+deltask package_write_deb
+deltask package_write_rpm
+deltask package_write
diff --git a/meta/classes/crosssdk.bbclass b/meta/classes/crosssdk.bbclass
new file mode 100644
index 0000000..87d5cf5
--- /dev/null
+++ b/meta/classes/crosssdk.bbclass
@@ -0,0 +1,36 @@
+inherit cross
+
+CLASSOVERRIDE = "class-crosssdk"
+MACHINEOVERRIDES = ""
+PACKAGE_ARCH = "${SDK_ARCH}"
+python () {
+	# set TUNE_PKGARCH to SDK_ARCH
+	d.setVar('TUNE_PKGARCH', d.getVar('SDK_ARCH', True))
+}
+
+STAGING_DIR_TARGET = "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}"
+STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+TARGET_ARCH = "${SDK_ARCH}"
+TARGET_VENDOR = "${SDK_VENDOR}"
+TARGET_OS = "${SDK_OS}"
+TARGET_PREFIX = "${SDK_PREFIX}"
+TARGET_CC_ARCH = "${SDK_CC_ARCH}"
+TARGET_LD_ARCH = "${SDK_LD_ARCH}"
+TARGET_AS_ARCH = "${SDK_AS_ARCH}"
+TARGET_FPU = ""
+
+target_libdir = "${SDKPATHNATIVE}${libdir_nativesdk}"
+target_includedir = "${SDKPATHNATIVE}${includedir_nativesdk}"
+target_base_libdir = "${SDKPATHNATIVE}${base_libdir_nativesdk}"
+target_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+target_exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+baselib = "lib"
+
+do_populate_sysroot[stamp-extra-info] = ""
+do_packagedata[stamp-extra-info] = ""
+
+# Need to force this to ensure consitency accross architectures
+EXTRA_OECONF_GCC_FLOAT = ""
+
+USE_NLS = "no"
diff --git a/meta/classes/debian.bbclass b/meta/classes/debian.bbclass
new file mode 100644
index 0000000..1b6979a
--- /dev/null
+++ b/meta/classes/debian.bbclass
@@ -0,0 +1,141 @@
+# Debian package renaming only occurs when a package is built
+# We therefore have to make sure we build all runtime packages
+# before building the current package to make the packages runtime
+# depends are correct
+#
+# Custom library package names can be defined setting
+# DEBIANNAME_ + pkgname to the desired name.
+#
+# Better expressed as ensure all RDEPENDS package before we package
+# This means we can't have circular RDEPENDS/RRECOMMENDS
+
+AUTO_LIBNAME_PKGS = "${PACKAGES}"
+
+inherit package
+
+DEBIANRDEP = "do_packagedata"
+do_package_write_ipk[rdeptask] = "${DEBIANRDEP}"
+do_package_write_deb[rdeptask] = "${DEBIANRDEP}"
+do_package_write_tar[rdeptask] = "${DEBIANRDEP}"
+do_package_write_rpm[rdeptask] = "${DEBIANRDEP}"
+
+python () {
+    if not d.getVar("PACKAGES", True):
+        d.setVar("DEBIANRDEP", "")
+}
+
+python debian_package_name_hook () {
+    import glob, copy, stat, errno, re
+
+    pkgdest = d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES', True)
+    bin_re = re.compile(".*/s?" + os.path.basename(d.getVar("bindir", True)) + "$")
+    lib_re = re.compile(".*/" + os.path.basename(d.getVar("libdir", True)) + "$")
+    so_re = re.compile("lib.*\.so")
+
+    def socrunch(s):
+        s = s.lower().replace('_', '-')
+        m = re.match("^(.*)(.)\.so\.(.*)$", s)
+        if m is None:
+            return None
+        if m.group(2) in '0123456789':
+            bin = '%s%s-%s' % (m.group(1), m.group(2), m.group(3))
+        else:
+            bin = m.group(1) + m.group(2) + m.group(3)
+        dev = m.group(1) + m.group(2)
+        return (bin, dev)
+
+    def isexec(path):
+        try:
+            s = os.stat(path)
+        except (os.error, AttributeError):
+            return 0
+        return (s[stat.ST_MODE] & stat.S_IEXEC)
+
+    def add_rprovides(pkg, d):
+        newpkg = d.getVar('PKG_' + pkg, False)
+        if newpkg and newpkg != pkg:
+            provs = (d.getVar('RPROVIDES_' + pkg, True) or "").split()
+            if pkg not in provs:
+                d.appendVar('RPROVIDES_' + pkg, " " + pkg + " (=" + d.getVar("PKGV", True) + ")")
+
+    def auto_libname(packages, orig_pkg):
+        sonames = []
+        has_bins = 0
+        has_libs = 0
+        for file in pkgfiles[orig_pkg]:
+            root = os.path.dirname(file)
+            if bin_re.match(root):
+                has_bins = 1
+            if lib_re.match(root):
+                has_libs = 1
+                if so_re.match(os.path.basename(file)):
+                    cmd = (d.getVar('TARGET_PREFIX', True) or "") + "objdump -p " + file + " 2>/dev/null"
+                    fd = os.popen(cmd)
+                    lines = fd.readlines()
+                    fd.close()
+                    for l in lines:
+                        m = re.match("\s+SONAME\s+([^\s]*)", l)
+                        if m and not m.group(1) in sonames:
+                            sonames.append(m.group(1))
+
+        bb.debug(1, 'LIBNAMES: pkg %s libs %d bins %d sonames %s' % (orig_pkg, has_libs, has_bins, sonames))
+        soname = None
+        if len(sonames) == 1:
+            soname = sonames[0]
+        elif len(sonames) > 1:
+            lead = d.getVar('LEAD_SONAME', True)
+            if lead:
+                r = re.compile(lead)
+                filtered = []
+                for s in sonames:
+                    if r.match(s):
+                        filtered.append(s)
+                if len(filtered) == 1:
+                    soname = filtered[0]
+                elif len(filtered) > 1:
+                    bb.note("Multiple matches (%s) for LEAD_SONAME '%s'" % (", ".join(filtered), lead))
+                else:
+                    bb.note("Multiple libraries (%s) found, but LEAD_SONAME '%s' doesn't match any of them" % (", ".join(sonames), lead))
+            else:
+                bb.note("Multiple libraries (%s) found and LEAD_SONAME not defined" % ", ".join(sonames))
+
+        if has_libs and not has_bins and soname:
+            soname_result = socrunch(soname)
+            if soname_result:
+                (pkgname, devname) = soname_result
+                for pkg in packages.split():
+                    if (d.getVar('PKG_' + pkg, False) or d.getVar('DEBIAN_NOAUTONAME_' + pkg, False)):
+                        add_rprovides(pkg, d)
+                        continue
+                    debian_pn = d.getVar('DEBIANNAME_' + pkg, False)
+                    if debian_pn:
+                        newpkg = debian_pn
+                    elif pkg == orig_pkg:
+                        newpkg = pkgname
+                    else:
+                        newpkg = pkg.replace(orig_pkg, devname, 1)
+                    mlpre=d.getVar('MLPREFIX', True)
+                    if mlpre:
+                        if not newpkg.find(mlpre) == 0:
+                            newpkg = mlpre + newpkg
+                    if newpkg != pkg:
+                        d.setVar('PKG_' + pkg, newpkg)
+                        add_rprovides(pkg, d)
+        else:
+            add_rprovides(orig_pkg, d)
+
+    # reversed sort is needed when some package is substring of another
+    # ie in ncurses we get without reverse sort: 
+    # DEBUG: LIBNAMES: pkgname libtic5 devname libtic pkg ncurses-libtic orig_pkg ncurses-libtic debian_pn None newpkg libtic5
+    # and later
+    # DEBUG: LIBNAMES: pkgname libtic5 devname libtic pkg ncurses-libticw orig_pkg ncurses-libtic debian_pn None newpkg libticw
+    # so we need to handle ncurses-libticw->libticw5 before ncurses-libtic->libtic5
+    for pkg in sorted((d.getVar('AUTO_LIBNAME_PKGS', True) or "").split(), reverse=True):
+        auto_libname(packages, pkg)
+}
+
+EXPORT_FUNCTIONS package_name_hook
+
+DEBIAN_NAMES = "1"
+
diff --git a/meta/classes/deploy.bbclass b/meta/classes/deploy.bbclass
new file mode 100644
index 0000000..78f5e4a
--- /dev/null
+++ b/meta/classes/deploy.bbclass
@@ -0,0 +1,10 @@
+DEPLOYDIR = "${WORKDIR}/deploy-${PN}"
+SSTATETASKS += "do_deploy"
+do_deploy[sstate-inputdirs] = "${DEPLOYDIR}"
+do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
+
+python do_deploy_setscene () {
+    sstate_setscene(d)
+}
+addtask do_deploy_setscene
+do_deploy[dirs] = "${DEPLOYDIR} ${B}"
diff --git a/meta/classes/devshell.bbclass b/meta/classes/devshell.bbclass
new file mode 100644
index 0000000..4451436
--- /dev/null
+++ b/meta/classes/devshell.bbclass
@@ -0,0 +1,156 @@
+inherit terminal
+
+DEVSHELL = "${SHELL}"
+
+python do_devshell () {
+    if d.getVarFlag("do_devshell", "manualfakeroot"):
+       d.prependVar("DEVSHELL", "pseudo ")
+       fakeenv = d.getVar("FAKEROOTENV", True).split()
+       for f in fakeenv:
+            k = f.split("=")
+            d.setVar(k[0], k[1])           
+            d.appendVar("OE_TERMINAL_EXPORTS", " " + k[0])
+       d.delVarFlag("do_devshell", "fakeroot")
+
+    oe_terminal(d.getVar('DEVSHELL', True), 'OpenEmbedded Developer Shell', d)
+}
+
+addtask devshell after do_patch
+
+# The directory that the terminal starts in
+DEVSHELL_STARTDIR ?= "${S}"
+do_devshell[dirs] = "${DEVSHELL_STARTDIR}"
+do_devshell[nostamp] = "1"
+
+# devshell and fakeroot/pseudo need careful handling since only the final
+# command should run under fakeroot emulation, any X connection should
+# be done as the normal user. We therfore carefully construct the envionment
+# manually
+python () {
+    if d.getVarFlag("do_devshell", "fakeroot"):
+       # We need to signal our code that we want fakeroot however we
+       # can't manipulate the environment and variables here yet (see YOCTO #4795)
+       d.setVarFlag("do_devshell", "manualfakeroot", "1")
+       d.delVarFlag("do_devshell", "fakeroot")
+} 
+
+def devpyshell(d):
+
+    import code
+    import select
+    import signal
+    import termios
+
+    m, s = os.openpty()
+    sname = os.ttyname(s)
+
+    def noechoicanon(fd):
+        old = termios.tcgetattr(fd)
+        old[3] = old[3] &~ termios.ECHO &~ termios.ICANON
+        # &~ termios.ISIG
+        termios.tcsetattr(fd, termios.TCSADRAIN, old)
+    
+    # No echo or buffering over the pty
+    noechoicanon(s)
+
+    pid = os.fork()
+    if pid:
+        os.close(m)
+        oe_terminal("oepydevshell-internal.py %s %d" % (sname, pid), 'OpenEmbedded Developer PyShell', d)
+        os._exit(0)
+    else:
+        os.close(s)
+
+        os.dup2(m, sys.stdin.fileno())
+        os.dup2(m, sys.stdout.fileno())
+        os.dup2(m, sys.stderr.fileno())
+
+        sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
+        sys.stdin = os.fdopen(sys.stdin.fileno(), 'r', 0)
+
+        bb.utils.nonblockingfd(sys.stdout)
+        bb.utils.nonblockingfd(sys.stderr)
+        bb.utils.nonblockingfd(sys.stdin)
+
+        _context = {
+            "os": os,
+            "bb": bb,
+            "time": time,
+            "d": d,
+        }
+
+        ps1 = "pydevshell> "
+        ps2 = "... "
+        buf = []
+        more = False
+
+        i = code.InteractiveInterpreter(locals=_context)
+        print("OE PyShell (PN = %s)\n" % d.getVar("PN", True))
+
+        def prompt(more):
+            if more:
+                prompt = ps2
+            else:
+                prompt = ps1
+            sys.stdout.write(prompt)
+
+        # Restore Ctrl+C since bitbake masks this
+        def signal_handler(signal, frame):
+            raise KeyboardInterrupt
+        signal.signal(signal.SIGINT, signal_handler)
+
+        child = None
+
+        prompt(more)
+        while True:
+            try:
+                try:
+                    (r, _, _) = select.select([sys.stdin], [], [], 1)
+                    if not r:
+                        continue
+                    line = sys.stdin.readline().strip()
+                    if not line:
+                        prompt(more)
+                        continue
+                except EOFError as e:
+                    sys.stdout.write("\n")
+                except (OSError, IOError) as e:
+                    if e.errno == 11:
+                        continue
+                    if e.errno == 5:
+                        return
+                    raise
+                else:
+                    if not child:
+                        child = int(line)
+                        continue
+                    buf.append(line)
+                    source = "\n".join(buf)
+                    more = i.runsource(source, "<pyshell>")
+                    if not more:
+                        buf = []
+                    prompt(more)
+            except KeyboardInterrupt:
+                i.write("\nKeyboardInterrupt\n")
+                buf = []
+                more = False
+                prompt(more)
+            except SystemExit:
+                # Easiest way to ensure everything exits
+                os.kill(child, signal.SIGTERM)
+                break
+
+python do_devpyshell() {
+    import signal
+
+    try:
+        devpyshell(d)
+    except SystemExit:
+        # Stop the SIGTERM above causing an error exit code    
+        return
+    finally:
+        return
+}
+addtask devpyshell after do_patch
+
+do_devpyshell[nostamp] = "1"
diff --git a/meta/classes/distro_features_check.bbclass b/meta/classes/distro_features_check.bbclass
new file mode 100644
index 0000000..7e91dbc
--- /dev/null
+++ b/meta/classes/distro_features_check.bbclass
@@ -0,0 +1,37 @@
+# Allow checking of required and conflicting DISTRO_FEATURES
+#
+# ANY_OF_DISTRO_FEATURES:   ensure at least one item on this list is included
+#                           in DISTRO_FEATURES.
+# REQUIRED_DISTRO_FEATURES: ensure every item on this list is included
+#                           in DISTRO_FEATURES.
+# CONFLICT_DISTRO_FEATURES: ensure no item in this list is included in
+#                           DISTRO_FEATURES.
+#
+# Copyright 2013 (C) O.S. Systems Software LTDA.
+
+python () {
+    # Assume at least one var is set.
+    distro_features = (d.getVar('DISTRO_FEATURES', True) or "").split()
+
+    any_of_distro_features = d.getVar('ANY_OF_DISTRO_FEATURES', True)
+    if any_of_distro_features:
+        any_of_distro_features = any_of_distro_features.split()
+        if set.isdisjoint(set(any_of_distro_features),set(distro_features)):
+            raise bb.parse.SkipPackage("one of '%s' needs to be in DISTRO_FEATURES" % any_of_distro_features)
+
+    required_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES', True)
+    if required_distro_features:
+        required_distro_features = required_distro_features.split()
+        for f in required_distro_features:
+            if f in distro_features:
+                continue
+            else:
+                raise bb.parse.SkipPackage("missing required distro feature '%s' (not in DISTRO_FEATURES)" % f)
+
+    conflict_distro_features = d.getVar('CONFLICT_DISTRO_FEATURES', True)
+    if conflict_distro_features:
+        conflict_distro_features = conflict_distro_features.split()
+        for f in conflict_distro_features:
+            if f in distro_features:
+                raise bb.parse.SkipPackage("conflicting distro feature '%s' (in DISTRO_FEATURES)" % f)
+}
diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass
new file mode 100644
index 0000000..4168e43
--- /dev/null
+++ b/meta/classes/distrodata.bbclass
@@ -0,0 +1,474 @@
+include conf/distro/include/package_regex.inc
+include conf/distro/include/upstream_tracking.inc
+include conf/distro/include/distro_alias.inc
+include conf/distro/include/maintainers.inc
+
+addhandler distro_eventhandler
+distro_eventhandler[eventmask] = "bb.event.BuildStarted"
+python distro_eventhandler() {
+    import oe.distro_check as dc
+    import csv
+    logfile = dc.create_log_file(e.data, "distrodata.csv")
+
+    lf = bb.utils.lockfile("%s.lock" % logfile)
+    with open(logfile, "a") as f:
+        writer = csv.writer(f)
+        writer.writerow(['Package', 'Description', 'Owner', 'License', 
+            'VerMatch', 'Version', 'Upstream', 'Reason', 'Recipe Status',
+            'Distro 1', 'Distro 2', 'Distro 3'])
+        f.close()
+    bb.utils.unlockfile(lf)
+
+    return
+}
+
+addtask distrodata_np
+do_distrodata_np[nostamp] = "1"
+python do_distrodata_np() {
+        localdata = bb.data.createCopy(d)
+        pn = d.getVar("PN", True)
+        bb.note("Package Name: %s" % pn)
+
+        import oe.distro_check as dist_check
+        tmpdir = d.getVar('TMPDIR', True)
+        distro_check_dir = os.path.join(tmpdir, "distro_check")
+        datetime = localdata.getVar('DATETIME', True)
+        dist_check.update_distro_data(distro_check_dir, datetime)
+
+        if pn.find("-native") != -1:
+            pnstripped = pn.split("-native")
+            bb.note("Native Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        if pn.find("-cross") != -1:
+            pnstripped = pn.split("-cross")
+            bb.note("cross Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        if pn.find("-crosssdk") != -1:
+            pnstripped = pn.split("-crosssdk")
+            bb.note("cross Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        if pn.startswith("nativesdk-"):
+            pnstripped = pn.replace("nativesdk-", "")
+            bb.note("NativeSDK Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+
+        if pn.find("-initial") != -1:
+            pnstripped = pn.split("-initial")
+            bb.note("initial Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        """generate package information from .bb file"""
+        pname = localdata.getVar('PN', True)
+        pcurver = localdata.getVar('PV', True)
+        pdesc = localdata.getVar('DESCRIPTION', True)
+        if pdesc is not None:
+                pdesc = pdesc.replace(',','')
+                pdesc = pdesc.replace('\n','')
+
+        pgrp = localdata.getVar('SECTION', True)
+        plicense = localdata.getVar('LICENSE', True).replace(',','_')
+
+        rstatus = localdata.getVar('RECIPE_COLOR', True)
+        if rstatus is not None:
+                rstatus = rstatus.replace(',','')
+
+        pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION', True)
+        if pcurver == pupver:
+                vermatch="1"
+        else:
+                vermatch="0"
+        noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON', True)
+        if noupdate_reason is None:
+                noupdate="0"
+        else:
+                noupdate="1"
+                noupdate_reason = noupdate_reason.replace(',','')
+
+        maintainer = localdata.getVar('RECIPE_MAINTAINER', True)
+        rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE', True)
+        result = dist_check.compare_in_distro_packages_list(distro_check_dir, localdata)
+
+        bb.note("DISTRO: %s,%s,%s,%s,%s,%s,%s,%s,%s\n" % \
+                  (pname, pdesc, maintainer, plicense, vermatch, pcurver, pupver, noupdate_reason, rstatus))
+        line = pn
+        for i in result:
+            line = line + "," + i
+        bb.note("%s\n" % line)
+}
+
+addtask distrodata
+do_distrodata[nostamp] = "1"
+python do_distrodata() {
+        import csv
+        logpath = d.getVar('LOG_DIR', True)
+        bb.utils.mkdirhier(logpath)
+        logfile = os.path.join(logpath, "distrodata.csv")
+
+        import oe.distro_check as dist_check
+        localdata = bb.data.createCopy(d)
+        tmpdir = d.getVar('TMPDIR', True)
+        distro_check_dir = os.path.join(tmpdir, "distro_check")
+        datetime = localdata.getVar('DATETIME', True)
+        dist_check.update_distro_data(distro_check_dir, datetime)
+
+        pn = d.getVar("PN", True)
+        bb.note("Package Name: %s" % pn)
+
+        if pn.find("-native") != -1:
+            pnstripped = pn.split("-native")
+            bb.note("Native Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        if pn.startswith("nativesdk-"):
+            pnstripped = pn.replace("nativesdk-", "")
+            bb.note("NativeSDK Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        if pn.find("-cross") != -1:
+            pnstripped = pn.split("-cross")
+            bb.note("cross Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        if pn.find("-crosssdk") != -1:
+            pnstripped = pn.split("-crosssdk")
+            bb.note("cross Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        if pn.find("-initial") != -1:
+            pnstripped = pn.split("-initial")
+            bb.note("initial Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        """generate package information from .bb file"""
+        pname = localdata.getVar('PN', True)
+        pcurver = localdata.getVar('PV', True)
+        pdesc = localdata.getVar('DESCRIPTION', True)
+        if pdesc is not None:
+                pdesc = pdesc.replace(',','')
+                pdesc = pdesc.replace('\n','')
+
+        pgrp = localdata.getVar('SECTION', True)
+        plicense = localdata.getVar('LICENSE', True).replace(',','_')
+
+        rstatus = localdata.getVar('RECIPE_COLOR', True)
+        if rstatus is not None:
+                rstatus = rstatus.replace(',','')
+
+        pupver = localdata.getVar('RECIPE_UPSTREAM_VERSION', True)
+        if pcurver == pupver:
+                vermatch="1"
+        else:
+                vermatch="0"
+
+        noupdate_reason = localdata.getVar('RECIPE_NO_UPDATE_REASON', True)
+        if noupdate_reason is None:
+                noupdate="0"
+        else:
+                noupdate="1"
+                noupdate_reason = noupdate_reason.replace(',','')
+
+        maintainer = localdata.getVar('RECIPE_MAINTAINER', True)
+        rlrd = localdata.getVar('RECIPE_UPSTREAM_DATE', True)
+        # do the comparison
+        result = dist_check.compare_in_distro_packages_list(distro_check_dir, localdata)
+
+        lf = bb.utils.lockfile("%s.lock" % logfile)
+        with open(logfile, "a") as f:
+            row = [pname, pdesc, maintainer, plicense, vermatch, pcurver, pupver, noupdate_reason, rstatus]
+            row.extend(result)
+
+            writer = csv.writer(f)
+            writer.writerow(row)
+            f.close()
+        bb.utils.unlockfile(lf)
+}
+
+addtask distrodataall after do_distrodata
+do_distrodataall[recrdeptask] = "do_distrodataall do_distrodata"
+do_distrodataall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_distrodataall[nostamp] = "1"
+do_distrodataall() {
+        :
+}
+
+addhandler checkpkg_eventhandler
+checkpkg_eventhandler[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted"
+python checkpkg_eventhandler() {
+    import csv
+
+    def parse_csv_file(filename):
+        package_dict = {}
+
+        with open(filename, "r") as f:
+            reader = csv.reader(f, delimiter='\t')
+            for row in reader:
+                pn = row[0]
+
+                if reader.line_num == 1:
+                    header = row
+                    continue
+
+                if not pn in package_dict.keys():
+                    package_dict[pn] = row
+            f.close()
+
+        with open(filename, "w") as f:
+            writer = csv.writer(f, delimiter='\t')
+            writer.writerow(header)
+            for pn in package_dict.keys():
+                writer.writerow(package_dict[pn])
+            f.close()
+
+        del package_dict
+
+    if bb.event.getName(e) == "BuildStarted":
+        import oe.distro_check as dc
+        logfile = dc.create_log_file(e.data, "checkpkg.csv")
+
+        lf = bb.utils.lockfile("%s.lock" % logfile)
+        with open(logfile, "a") as f:
+            writer = csv.writer(f, delimiter='\t')
+            headers = ['Package', 'Version', 'Upver', 'License', 'Section',
+                'Home', 'Release', 'Depends', 'BugTracker', 'PE', 'Description',
+                'Status', 'Tracking', 'URI', 'MAINTAINER', 'NoUpReason']
+            writer.writerow(headers)
+            f.close()
+        bb.utils.unlockfile(lf)
+    elif bb.event.getName(e) == "BuildCompleted":
+        import os
+        filename = "tmp/log/checkpkg.csv"
+        if os.path.isfile(filename):
+            lf = bb.utils.lockfile("%s.lock"%filename)
+            parse_csv_file(filename)
+            bb.utils.unlockfile(lf)
+    return
+}
+
+addtask checkpkg
+do_checkpkg[nostamp] = "1"
+python do_checkpkg() {
+        localdata = bb.data.createCopy(d)
+        import csv
+        import re
+        import tempfile
+        import subprocess
+        import oe.recipeutils
+        from bb.utils import vercmp_string
+        from bb.fetch2 import FetchError, NoMethodError, decodeurl
+
+        """first check whether a uri is provided"""
+        src_uri = d.getVar('SRC_URI', True)
+        if not src_uri:
+                return
+        uri_type, _, _, _, _, _ = decodeurl(src_uri)
+
+        """initialize log files."""
+        logpath = d.getVar('LOG_DIR', True)
+        bb.utils.mkdirhier(logpath)
+        logfile = os.path.join(logpath, "checkpkg.csv")
+
+        """generate package information from .bb file"""
+        pname = d.getVar('PN', True)
+
+        if pname.find("-native") != -1:
+            if d.getVar('BBCLASSEXTEND', True):
+                    return
+            pnstripped = pname.split("-native")
+            bb.note("Native Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        if pname.startswith("nativesdk-"):
+            if d.getVar('BBCLASSEXTEND', True):
+                    return
+            pnstripped = pname.replace("nativesdk-", "")
+            bb.note("NativeSDK Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        if pname.find("-cross") != -1:
+            pnstripped = pname.split("-cross")
+            bb.note("cross Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        if pname.find("-initial") != -1:
+            pnstripped = pname.split("-initial")
+            bb.note("initial Split: %s" % pnstripped)
+            localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+            bb.data.update_data(localdata)
+
+        pdesc = localdata.getVar('DESCRIPTION', True)
+        pgrp = localdata.getVar('SECTION', True)
+        pversion = localdata.getVar('PV', True)
+        plicense = localdata.getVar('LICENSE', True)
+        psection = localdata.getVar('SECTION', True)
+        phome = localdata.getVar('HOMEPAGE', True)
+        prelease = localdata.getVar('PR', True)
+        pdepends = localdata.getVar('DEPENDS', True)
+        pbugtracker = localdata.getVar('BUGTRACKER', True)
+        ppe = localdata.getVar('PE', True)
+        psrcuri = localdata.getVar('SRC_URI', True)
+        maintainer = localdata.getVar('RECIPE_MAINTAINER', True)
+
+        """ Get upstream version version """
+        pupver = ""
+        pstatus = ""
+
+        try:
+            uv = oe.recipeutils.get_recipe_upstream_version(localdata)
+
+            pupver = uv['version']
+        except Exception as e:
+            if e is FetchError:
+                pstatus = "ErrAccess"
+            elif e is NoMethodError:
+                pstatus = "ErrUnsupportedProto"
+            else:
+                pstatus = "ErrUnknown"
+
+        """Set upstream version status"""
+        if not pupver:
+            pupver = "N/A"
+        else:
+            pv, _, _ = oe.recipeutils.get_recipe_pv_without_srcpv(pversion, uri_type)
+            upv, _, _ = oe.recipeutils.get_recipe_pv_without_srcpv(pupver, uri_type)
+
+            cmp = vercmp_string(pv, upv)
+            if cmp == -1:
+                pstatus = "UPDATE"
+            elif cmp == 0:
+                pstatus = "MATCH"
+
+        psrcuri = psrcuri.split()[0]
+        pdepends = "".join(pdepends.split("\t"))
+        pdesc = "".join(pdesc.split("\t"))
+        no_upgr_reason = d.getVar('RECIPE_NO_UPDATE_REASON', True)
+        lf = bb.utils.lockfile("%s.lock" % logfile)
+        with open(logfile, "a") as f:
+            writer = csv.writer(f, delimiter='\t')
+            writer.writerow([pname, pversion, pupver, plicense, psection, phome, 
+                prelease, pdepends, pbugtracker, ppe, pdesc, pstatus, pupver,
+                psrcuri, maintainer, no_upgr_reason])
+            f.close()
+        bb.utils.unlockfile(lf)
+}
+
+addtask checkpkgall after do_checkpkg
+do_checkpkgall[recrdeptask] = "do_checkpkgall do_checkpkg"
+do_checkpkgall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_checkpkgall[nostamp] = "1"
+do_checkpkgall() {
+        :
+}
+
+addhandler distro_check_eventhandler
+distro_check_eventhandler[eventmask] = "bb.event.BuildStarted"
+python distro_check_eventhandler() {
+    """initialize log files."""
+    import oe.distro_check as dc
+    result_file = dc.create_log_file(e.data, "distrocheck.csv")
+    return
+}
+
+addtask distro_check
+do_distro_check[nostamp] = "1"
+python do_distro_check() {
+    """checks if the package is present in other public Linux distros"""
+    import oe.distro_check as dc
+    import shutil
+    if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk',d):
+        return
+
+    localdata = bb.data.createCopy(d)
+    bb.data.update_data(localdata)
+    tmpdir = d.getVar('TMPDIR', True)
+    distro_check_dir = os.path.join(tmpdir, "distro_check")
+    logpath = d.getVar('LOG_DIR', True)
+    bb.utils.mkdirhier(logpath)
+    result_file = os.path.join(logpath, "distrocheck.csv")
+    datetime = localdata.getVar('DATETIME', True)
+    dc.update_distro_data(distro_check_dir, datetime)
+
+    # do the comparison
+    result = dc.compare_in_distro_packages_list(distro_check_dir, d)
+
+    # save the results
+    dc.save_distro_check_result(result, datetime, result_file, d)
+}
+
+addtask distro_checkall after do_distro_check
+do_distro_checkall[recrdeptask] = "do_distro_checkall do_distro_check"
+do_distro_checkall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_distro_checkall[nostamp] = "1"
+do_distro_checkall() {
+        :
+}
+#
+#Check Missing License Text.
+#Use this task to generate the missing license text data for pkg-report system,
+#then we can search those recipes which license text isn't exsit in common-licenses directory
+#
+addhandler checklicense_eventhandler
+checklicense_eventhandler[eventmask] = "bb.event.BuildStarted"
+python checklicense_eventhandler() {
+    """initialize log files."""
+    import csv
+    import oe.distro_check as dc
+    logfile = dc.create_log_file(e.data, "missinglicense.csv")
+    lf = bb.utils.lockfile("%s.lock" % logfile)
+    with open(logfile, "a") as f:
+        writer = csv.writer(f, delimiter='\t')
+        writer.writerow(['Package', 'License', 'MissingLicense'])
+        f.close()
+    bb.utils.unlockfile(lf)
+    return
+}
+
+addtask checklicense
+do_checklicense[nostamp] = "1"
+python do_checklicense() {
+    import csv
+    import shutil
+    logpath = d.getVar('LOG_DIR', True)
+    bb.utils.mkdirhier(logpath)
+    pn = d.getVar('PN', True)
+    logfile = os.path.join(logpath, "missinglicense.csv")
+    generic_directory = d.getVar('COMMON_LICENSE_DIR', True)
+    license_types = d.getVar('LICENSE', True)
+    for license_type in ((license_types.replace('+', '').replace('|', '&')
+                          .replace('(', '').replace(')', '').replace(';', '')
+                          .replace(',', '').replace(" ", "").split("&"))):
+        if not os.path.isfile(os.path.join(generic_directory, license_type)):
+            lf = bb.utils.lockfile("%s.lock" % logfile)
+            with open(logfile, "a") as f:
+                writer = csv.writer(f, delimiter='\t')
+                writer.writerow([pn, license_types, license_type])
+                f.close()
+            bb.utils.unlockfile(lf)
+    return
+}
+
+addtask checklicenseall after do_checklicense
+do_checklicenseall[recrdeptask] = "do_checklicenseall do_checklicense"
+do_checklicenseall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_checklicenseall[nostamp] = "1"
+do_checklicenseall() {
+        :
+}
+
+
diff --git a/meta/classes/distutils-base.bbclass b/meta/classes/distutils-base.bbclass
new file mode 100644
index 0000000..aa18e8b
--- /dev/null
+++ b/meta/classes/distutils-base.bbclass
@@ -0,0 +1,4 @@
+DEPENDS  += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES', True) == '')]}"
+RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
+
+inherit distutils-common-base pythonnative
diff --git a/meta/classes/distutils-common-base.bbclass b/meta/classes/distutils-common-base.bbclass
new file mode 100644
index 0000000..427275b
--- /dev/null
+++ b/meta/classes/distutils-common-base.bbclass
@@ -0,0 +1,24 @@
+inherit python-dir
+
+EXTRA_OEMAKE = ""
+
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+PACKAGES = "${PN}-staticdev ${PN}-dev ${PN}-dbg ${PN}-doc ${PN}"
+
+FILES_${PN} += "${libdir}/* ${libdir}/${PYTHON_DIR}/*"
+
+FILES_${PN}-staticdev += "\
+  ${PYTHON_SITEPACKAGES_DIR}/*.a \
+"
+FILES_${PN}-dev += "\
+  ${datadir}/pkgconfig \
+  ${libdir}/pkgconfig \
+  ${PYTHON_SITEPACKAGES_DIR}/*.la \
+"
+FILES_${PN}-dbg += "\
+  ${PYTHON_SITEPACKAGES_DIR}/.debug \
+  ${PYTHON_SITEPACKAGES_DIR}/*/.debug \
+  ${PYTHON_SITEPACKAGES_DIR}/*/*/.debug \
+"
diff --git a/meta/classes/distutils-native-base.bbclass b/meta/classes/distutils-native-base.bbclass
new file mode 100644
index 0000000..509cb95
--- /dev/null
+++ b/meta/classes/distutils-native-base.bbclass
@@ -0,0 +1,3 @@
+inherit distutils-common-base
+
+DEPENDS  += "${@["${PYTHON_PN}-native", ""][(d.getVar('PACKAGES', True) == '')]}"
diff --git a/meta/classes/distutils-tools.bbclass b/meta/classes/distutils-tools.bbclass
new file mode 100644
index 0000000..f43450e
--- /dev/null
+++ b/meta/classes/distutils-tools.bbclass
@@ -0,0 +1,77 @@
+DISTUTILS_BUILD_ARGS ?= ""
+DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
+DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
+    --install-data=${STAGING_DATADIR}"
+DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
+    --install-data=${D}/${datadir}"
+
+distutils_do_compile() {
+         STAGING_INCDIR=${STAGING_INCDIR} \
+         STAGING_LIBDIR=${STAGING_LIBDIR} \
+         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+         ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \
+         bbfatal "${PYTHON_PN} setup.py build_ext execution failed."
+}
+
+distutils_stage_headers() {
+        install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+        BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
+        bbfatal "${PYTHON_PN} setup.py install_headers execution failed."
+}
+
+distutils_stage_all() {
+        STAGING_INCDIR=${STAGING_INCDIR} \
+        STAGING_LIBDIR=${STAGING_LIBDIR} \
+        install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+        PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \
+        BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
+        bbfatal "${PYTHON_PN} setup.py install (stage) execution failed."
+}
+
+distutils_do_install() {
+        echo "Beginning ${PN} Install ..."
+        install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+        echo "Step 2 of ${PN} Install ..."
+        STAGING_INCDIR=${STAGING_INCDIR} \
+        STAGING_LIBDIR=${STAGING_LIBDIR} \
+        PYTHONPATH=${D}/${PYTHON_SITEPACKAGES_DIR} \
+        BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        bbfatal "${PYTHON_PN} setup.py install execution failed."
+
+        echo "Step 3 of ${PN} Install ..."
+        # support filenames with *spaces*
+        find ${D} -name "*.py" -print0 | while read -d $'\0' i ; do \
+            sed -i -e s:${D}::g $i
+        done
+
+        echo "Step 4 of ${PN} Install ..."
+        if test -e ${D}${bindir} ; then	
+            for i in ${D}${bindir}/* ; do \
+                sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+            done
+        fi
+
+        echo "Step 4 of ${PN} Install ..."
+        if test -e ${D}${sbindir}; then
+            for i in ${D}${sbindir}/* ; do \
+                sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+            done
+        fi
+
+        echo "Step 5 of ${PN} Install ..."
+        rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth
+        
+        #
+        # FIXME: Bandaid against wrong datadir computation
+        #
+        if test -e ${D}${datadir}/share; then
+            mv -f ${D}${datadir}/share/* ${D}${datadir}/
+        fi
+}
+
+#EXPORT_FUNCTIONS do_compile do_install
+
+export LDSHARED="${CCLD} -shared"
diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
new file mode 100644
index 0000000..cd06713
--- /dev/null
+++ b/meta/classes/distutils.bbclass
@@ -0,0 +1,86 @@
+inherit distutils-base
+
+DISTUTILS_BUILD_ARGS ?= ""
+DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
+DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
+    --install-data=${STAGING_DATADIR}"
+DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
+    --install-data=${D}/${datadir}"
+
+distutils_do_compile() {
+         STAGING_INCDIR=${STAGING_INCDIR} \
+         STAGING_LIBDIR=${STAGING_LIBDIR} \
+         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+         ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py build ${DISTUTILS_BUILD_ARGS} || \
+         bbfatal "${PYTHON_PN} setup.py build execution failed."
+}
+
+distutils_stage_headers() {
+        install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+        BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
+        bbfatal "${PYTHON_PN} setup.py install_headers execution failed."
+}
+
+distutils_stage_all() {
+        STAGING_INCDIR=${STAGING_INCDIR} \
+        STAGING_LIBDIR=${STAGING_LIBDIR} \
+        install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+        PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \
+        BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
+        bbfatal "${PYTHON_PN} setup.py install (stage) execution failed."
+}
+
+distutils_do_install() {
+        install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+        STAGING_INCDIR=${STAGING_INCDIR} \
+        STAGING_LIBDIR=${STAGING_LIBDIR} \
+        PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
+        BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        bbfatal "${PYTHON_PN} setup.py install execution failed."
+
+        # support filenames with *spaces*
+        # only modify file if it contains path  and recompile it
+        find ${D} -name "*.py" -exec grep -q ${D} {} \; -exec sed -i -e s:${D}::g {} \; -exec ${STAGING_BINDIR_NATIVE}/python-native/python -mcompileall {} \;
+
+        if test -e ${D}${bindir} ; then	
+            for i in ${D}${bindir}/* ; do \
+                if [ ${PN} != "${BPN}-native" ]; then
+                	sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i
+		fi
+                sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+            done
+        fi
+
+        if test -e ${D}${sbindir}; then
+            for i in ${D}${sbindir}/* ; do \
+                if [ ${PN} != "${BPN}-native" ]; then
+                	sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/env\ python:g $i
+		fi
+                sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+            done
+        fi
+
+        rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth
+        rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/site.py*
+        
+        #
+        # FIXME: Bandaid against wrong datadir computation
+        #
+        if test -e ${D}${datadir}/share; then
+            mv -f ${D}${datadir}/share/* ${D}${datadir}/
+            rmdir ${D}${datadir}/share
+        fi
+
+	# Fix backport modules
+	if test -e ${STAGING_LIBDIR}/${PYTHON_DIR}/site-packages/backports/__init__.py && test -e ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py; then
+	   rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.py;
+	   rm ${D}${PYTHON_SITEPACKAGES_DIR}/backports/__init__.pyc;
+	fi
+}
+
+EXPORT_FUNCTIONS do_compile do_install
+
+export LDSHARED="${CCLD} -shared"
diff --git a/meta/classes/distutils3-base.bbclass b/meta/classes/distutils3-base.bbclass
new file mode 100644
index 0000000..af3aa00
--- /dev/null
+++ b/meta/classes/distutils3-base.bbclass
@@ -0,0 +1,8 @@
+DEPENDS  += "${@["${PYTHON_PN}-native ${PYTHON_PN}", ""][(d.getVar('PACKAGES', True) == '')]}"
+RDEPENDS_${PN} += "${@['', '${PYTHON_PN}-core']['${CLASSOVERRIDE}' == 'class-target']}"
+
+PYTHON_BASEVERSION = "3.4"
+PYTHON_ABI = "m"
+
+inherit distutils-common-base python3native
+
diff --git a/meta/classes/distutils3-native-base.bbclass b/meta/classes/distutils3-native-base.bbclass
new file mode 100644
index 0000000..1117101
--- /dev/null
+++ b/meta/classes/distutils3-native-base.bbclass
@@ -0,0 +1,4 @@
+PYTHON_BASEVERSION = "3.4"
+PYTHON_ABI = "m"
+
+inherit distutils-native-base
diff --git a/meta/classes/distutils3.bbclass b/meta/classes/distutils3.bbclass
new file mode 100644
index 0000000..e909ef4
--- /dev/null
+++ b/meta/classes/distutils3.bbclass
@@ -0,0 +1,96 @@
+inherit distutils3-base
+
+DISTUTILS_BUILD_ARGS ?= ""
+DISTUTILS_BUILD_EXT_ARGS ?= ""
+DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
+DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
+    --install-data=${STAGING_DATADIR}"
+DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
+    --install-data=${D}/${datadir}"
+
+distutils3_do_compile() {
+        if [ ${BUILD_SYS} != ${HOST_SYS} ]; then
+                SYS=${MACHINE}
+        else
+                SYS=${HOST_SYS}
+        fi
+        STAGING_INCDIR=${STAGING_INCDIR} \
+        STAGING_LIBDIR=${STAGING_LIBDIR} \
+        BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py \
+        build ${DISTUTILS_BUILD_ARGS} || \
+        bbfatal "${PYTHON_PN} setup.py build_ext execution failed."
+}
+
+distutils3_stage_headers() {
+        install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+        if [ ${BUILD_SYS} != ${HOST_SYS} ]; then
+                SYS=${MACHINE}
+        else
+                SYS=${HOST_SYS}
+        fi
+        BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
+        bbfatal "${PYTHON_PN} setup.py install_headers execution failed."
+}
+
+distutils3_stage_all() {
+        if [ ${BUILD_SYS} != ${HOST_SYS} ]; then
+                SYS=${MACHINE}
+        else
+                SYS=${HOST_SYS}
+        fi
+        STAGING_INCDIR=${STAGING_INCDIR} \
+        STAGING_LIBDIR=${STAGING_LIBDIR} \
+        install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
+        PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \
+        BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
+        bbfatal "${PYTHON_PN} setup.py install (stage) execution failed."
+}
+
+distutils3_do_install() {
+        install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+        if [ ${BUILD_SYS} != ${HOST_SYS} ]; then
+                SYS=${MACHINE}
+        else
+                SYS=${HOST_SYS}
+        fi
+        STAGING_INCDIR=${STAGING_INCDIR} \
+        STAGING_LIBDIR=${STAGING_LIBDIR} \
+        PYTHONPATH=${D}${PYTHON_SITEPACKAGES_DIR} \
+        BUILD_SYS=${BUILD_SYS} HOST_SYS=${SYS} \
+        ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py install --install-lib=${D}/${PYTHON_SITEPACKAGES_DIR} ${DISTUTILS_INSTALL_ARGS} || \
+        bbfatal "${PYTHON_PN} setup.py install execution failed."
+
+        # support filenames with *spaces*
+        find ${D} -name "*.py" -exec grep -q ${D} {} \; -exec sed -i -e s:${D}::g {} \;
+
+        if test -e ${D}${bindir} ; then	
+            for i in ${D}${bindir}/* ; do \
+                sed -i -e s:${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}:${bindir}/env\ ${PYTHON_PN}:g $i
+                sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+            done
+        fi
+
+        if test -e ${D}${sbindir}; then
+            for i in ${D}${sbindir}/* ; do \
+                sed -i -e s:${STAGING_BINDIR_NATIVE}/python-${PYTHON_PN}/${PYTHON_PN}:${bindir}/env\ ${PYTHON_PN}:g $i
+                sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
+            done
+        fi
+
+        rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/easy-install.pth
+        
+        #
+        # FIXME: Bandaid against wrong datadir computation
+        #
+        if test -e ${D}${datadir}/share; then
+            mv -f ${D}${datadir}/share/* ${D}${datadir}/
+            rmdir ${D}${datadir}/share
+        fi
+}
+
+EXPORT_FUNCTIONS do_compile do_install
+
+export LDSHARED="${CCLD} -shared"
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
new file mode 100644
index 0000000..0fa5817
--- /dev/null
+++ b/meta/classes/externalsrc.bbclass
@@ -0,0 +1,92 @@
+# Copyright (C) 2012 Linux Foundation
+# Author: Richard Purdie
+# Some code and influence taken from srctree.bbclass:
+# Copyright (C) 2009 Chris Larson <clarson@kergoth.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+#
+# externalsrc.bbclass enables use of an existing source tree, usually external to 
+# the build system to build a piece of software rather than the usual fetch/unpack/patch
+# process.
+#
+# To use, add externalsrc to the global inherit and set EXTERNALSRC to point at the
+# directory you want to use containing the sources e.g. from local.conf for a recipe
+# called "myrecipe" you would do:
+#
+# INHERIT += "externalsrc"
+# EXTERNALSRC_pn-myrecipe = "/path/to/my/source/tree"
+#
+# In order to make this class work for both target and native versions (or with
+# multilibs/cross or other BBCLASSEXTEND variants), B is set to point to a separate
+# directory under the work directory (split source and build directories). This is
+# the default, but the build directory can be set to the source directory if
+# circumstances dictate by setting EXTERNALSRC_BUILD to the same value, e.g.:
+#
+# EXTERNALSRC_BUILD_pn-myrecipe = "/path/to/my/source/tree"
+#
+
+SRCTREECOVEREDTASKS ?= "do_patch do_unpack do_fetch"
+
+python () {
+    externalsrc = d.getVar('EXTERNALSRC', True)
+    if externalsrc:
+        d.setVar('S', externalsrc)
+        externalsrcbuild = d.getVar('EXTERNALSRC_BUILD', True)
+        if externalsrcbuild:
+            d.setVar('B', externalsrcbuild)
+        else:
+            d.setVar('B', '${WORKDIR}/${BPN}-${PV}/')
+
+        local_srcuri = []
+        fetch = bb.fetch2.Fetch((d.getVar('SRC_URI', True) or '').split(), d)
+        for url in fetch.urls:
+            url_data = fetch.ud[url]
+            parm = url_data.parm
+            if (url_data.type == 'file' or
+                    'type' in parm and parm['type'] == 'kmeta'):
+                local_srcuri.append(url)
+
+        d.setVar('SRC_URI', ' '.join(local_srcuri))
+
+        if '{SRCPV}' in d.getVar('PV', False):
+            # Dummy value because the default function can't be called with blank SRC_URI
+            d.setVar('SRCPV', '999')
+
+        tasks = filter(lambda k: d.getVarFlag(k, "task"), d.keys())
+
+        for task in tasks:
+            if task.endswith("_setscene"):
+                # sstate is never going to work for external source trees, disable it
+                bb.build.deltask(task, d)
+            else:
+                # Since configure will likely touch ${S}, ensure only we lock so one task has access at a time
+                d.appendVarFlag(task, "lockfiles", " ${S}/singletask.lock")
+
+            # We do not want our source to be wiped out, ever (kernel.bbclass does this for do_clean)
+            cleandirs = (d.getVarFlag(task, 'cleandirs', False) or '').split()
+            setvalue = False
+            for cleandir in cleandirs[:]:
+                if d.expand(cleandir) == externalsrc:
+                    cleandirs.remove(cleandir)
+                    setvalue = True
+            if setvalue:
+                d.setVarFlag(task, 'cleandirs', ' '.join(cleandirs))
+
+        fetch_tasks = ['do_fetch', 'do_unpack']
+        # If we deltask do_patch, there's no dependency to ensure do_unpack gets run, so add one
+        d.appendVarFlag('do_configure', 'deps', ['do_unpack'])
+
+        for task in d.getVar("SRCTREECOVEREDTASKS", True).split():
+            if local_srcuri and task in fetch_tasks:
+                continue
+            bb.build.deltask(task, d)
+
+        d.prependVarFlag('do_compile', 'prefuncs', "externalsrc_compile_prefunc ")
+
+        # Ensure compilation happens every time
+        d.setVarFlag('do_compile', 'nostamp', '1')
+}
+
+python externalsrc_compile_prefunc() {
+    # Make it obvious that this is happening, since forgetting about it could lead to much confusion
+    bb.warn('Compiling %s from external source %s' % (d.getVar('PN', True), d.getVar('EXTERNALSRC', True)))
+}
diff --git a/meta/classes/extrausers.bbclass b/meta/classes/extrausers.bbclass
new file mode 100644
index 0000000..faf57b1
--- /dev/null
+++ b/meta/classes/extrausers.bbclass
@@ -0,0 +1,65 @@
+# This bbclass is mainly used for image level user/group configuration.
+# Inherit this class if you want to make EXTRA_USERS_PARAMS effective.
+
+# Below is an example showing how to use this functionality.
+# INHERIT += "extrausers"
+# EXTRA_USERS_PARAMS = "\
+# useradd -p '' tester; \
+# groupadd developers; \
+# userdel nobody; \
+# groupdel -g video; \
+# groupmod -g 1020 developers; \
+# usermod -s /bin/sh tester; \
+# "
+
+
+inherit useradd_base
+
+IMAGE_INSTALL_append = " ${@['', 'base-passwd shadow'][bool(d.getVar('EXTRA_USERS_PARAMS', True))]}"
+
+# Image level user / group settings
+ROOTFS_POSTPROCESS_COMMAND_append = " set_user_group;"
+
+# Image level user / group settings
+set_user_group () {
+	user_group_settings="${EXTRA_USERS_PARAMS}"
+	export PSEUDO="${FAKEROOTENV} ${STAGING_DIR_NATIVE}${bindir}/pseudo"
+	setting=`echo $user_group_settings | cut -d ';' -f1`
+	remaining=`echo $user_group_settings | cut -d ';' -f2-`
+	while test "x$setting" != "x"; do
+		cmd=`echo $setting | cut -d ' ' -f1`
+		opts=`echo $setting | cut -d ' ' -f2-`
+		# Different from useradd.bbclass, there's no file locking issue here, as
+		# this setting is actually a serial process. So we only retry once.
+		case $cmd in
+			useradd)
+				perform_useradd "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts" 1
+				;;
+			groupadd)
+				perform_groupadd "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts" 1
+				;;
+			userdel)
+				perform_userdel "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts" 1
+				;;
+			groupdel)
+				perform_groupdel "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts" 1
+				;;
+			usermod)
+				perform_usermod "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts" 1
+				;;
+			groupmod)
+				perform_groupmod "${IMAGE_ROOTFS}" "-R ${IMAGE_ROOTFS} $opts" 1
+				;;
+			*)
+				bbfatal "Invalid command in EXTRA_USERS_PARAMS: $cmd"
+				;;
+		esac
+		# Avoid infinite loop if the last parameter doesn't end with ';'
+		if [ "$setting" = "$remaining" ]; then
+			break
+		fi
+		# iterate to the next setting
+		setting=`echo $remaining | cut -d ';' -f1`
+		remaining=`echo $remaining | cut -d ';' -f2-`
+	done
+}
diff --git a/meta/classes/fontcache.bbclass b/meta/classes/fontcache.bbclass
new file mode 100644
index 0000000..d122387
--- /dev/null
+++ b/meta/classes/fontcache.bbclass
@@ -0,0 +1,45 @@
+#
+# This class will generate the proper postinst/postrm scriptlets for font
+# packages.
+#
+
+DEPENDS += "qemu-native"
+inherit qemu
+
+FONT_PACKAGES ??= "${PN}"
+FONT_EXTRA_RDEPENDS ?= "fontconfig-utils"
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
+fontcache_common() {
+if [ "x$D" != "x" ] ; then
+	$INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} mlprefix=${MLPREFIX} bindir=${bindir} \
+		libdir=${libdir} base_libdir=${base_libdir} fontconfigcachedir=${FONTCONFIG_CACHE_DIR}
+else
+	fc-cache
+fi
+}
+
+python () {
+    font_pkgs = d.getVar('FONT_PACKAGES', True).split()
+    deps = d.getVar("FONT_EXTRA_RDEPENDS", True)
+
+    for pkg in font_pkgs:
+        if deps: d.appendVar('RDEPENDS_' + pkg, ' '+deps)
+}
+
+python add_fontcache_postinsts() {
+    for pkg in d.getVar('FONT_PACKAGES', True).split():
+        bb.note("adding fonts postinst and postrm scripts to %s" % pkg)
+        postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
+        if not postinst:
+            postinst = '#!/bin/sh\n'
+        postinst += d.getVar('fontcache_common', True)
+        d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+        postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
+        if not postrm:
+            postrm = '#!/bin/sh\n'
+        postrm += d.getVar('fontcache_common', True)
+        d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
+PACKAGEFUNCS =+ "add_fontcache_postinsts"
diff --git a/meta/classes/fs-uuid.bbclass b/meta/classes/fs-uuid.bbclass
new file mode 100644
index 0000000..bd2613c
--- /dev/null
+++ b/meta/classes/fs-uuid.bbclass
@@ -0,0 +1,24 @@
+# Extract UUID from ${ROOTFS}, which must have been built
+# by the time that this function gets called. Only works
+# on ext file systems and depends on tune2fs.
+def get_rootfs_uuid(d):
+    import subprocess
+    rootfs = d.getVar('ROOTFS', True)
+    output = subprocess.check_output(['tune2fs', '-l', rootfs])
+    for line in output.split('\n'):
+        if line.startswith('Filesystem UUID:'):
+            uuid = line.split()[-1]
+            bb.note('UUID of %s: %s' % (rootfs, uuid))
+            return uuid
+    bb.fatal('Could not determine filesystem UUID of %s' % rootfs)
+
+# Replace the special <<uuid-of-rootfs>> inside a string (like the
+# root= APPEND string in a syslinux.cfg or gummiboot entry) with the
+# actual UUID of the rootfs. Does nothing if the special string
+# is not used.
+def replace_rootfs_uuid(d, string):
+    UUID_PLACEHOLDER = '<<uuid-of-rootfs>>'
+    if UUID_PLACEHOLDER in string:
+        uuid = get_rootfs_uuid(d)
+        string = string.replace(UUID_PLACEHOLDER, uuid)
+    return string
diff --git a/meta/classes/gconf.bbclass b/meta/classes/gconf.bbclass
new file mode 100644
index 0000000..d7afa72
--- /dev/null
+++ b/meta/classes/gconf.bbclass
@@ -0,0 +1,70 @@
+DEPENDS += "gconf gconf-native"
+
+# These are for when gconftool is used natively and the prefix isn't necessarily
+# the sysroot.  TODO: replicate the postinst logic for -native packages going
+# into sysroot as they won't be running their own install-time schema
+# registration (disabled below) nor the postinst script (as they don't happen).
+export GCONF_SCHEMA_INSTALL_SOURCE = "xml:merged:${STAGING_DIR_NATIVE}${sysconfdir}/gconf/gconf.xml.defaults"
+export GCONF_BACKEND_DIR = "${STAGING_LIBDIR_NATIVE}/GConf/2"
+
+# Disable install-time schema registration as we're a packaging system so this
+# happens in the postinst script, not at install time.  Set both the configure
+# script option and the traditional envionment variable just to make sure.
+EXTRA_OECONF += "--disable-schemas-install"
+export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL = "1"
+
+gconf_postinst() {
+if [ "x$D" != "x" ]; then
+	export GCONF_CONFIG_SOURCE="xml::$D${sysconfdir}/gconf/gconf.xml.defaults"
+else
+	export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source`
+fi
+
+SCHEMA_LOCATION=$D/etc/gconf/schemas
+for SCHEMA in ${SCHEMA_FILES}; do
+	if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
+		HOME=$D/root gconftool-2 \
+			--makefile-install-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null
+	fi
+done
+}
+
+gconf_prerm() {
+SCHEMA_LOCATION=/etc/gconf/schemas
+for SCHEMA in ${SCHEMA_FILES}; do
+	if [ -e $SCHEMA_LOCATION/$SCHEMA ]; then
+		HOME=/root GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` \
+			gconftool-2 \
+			--makefile-uninstall-rule $SCHEMA_LOCATION/$SCHEMA > /dev/null
+	fi
+done
+}
+
+python populate_packages_append () {
+    import re
+    packages = d.getVar('PACKAGES', True).split()
+    pkgdest =  d.getVar('PKGDEST', True)
+    
+    for pkg in packages:
+        schema_dir = '%s/%s/etc/gconf/schemas' % (pkgdest, pkg)
+        schemas = []
+        schema_re = re.compile(".*\.schemas$")
+        if os.path.exists(schema_dir):
+            for f in os.listdir(schema_dir):
+                if schema_re.match(f):
+                    schemas.append(f)
+        if schemas != []:
+            bb.note("adding gconf postinst and prerm scripts to %s" % pkg)
+            d.setVar('SCHEMA_FILES', " ".join(schemas))
+            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            if not postinst:
+                postinst = '#!/bin/sh\n'
+            postinst += d.getVar('gconf_postinst', True)
+            d.setVar('pkg_postinst_%s' % pkg, postinst)
+            prerm = d.getVar('pkg_prerm_%s' % pkg, True)
+            if not prerm:
+                prerm = '#!/bin/sh\n'
+            prerm += d.getVar('gconf_prerm', True)
+            d.setVar('pkg_prerm_%s' % pkg, prerm)
+            d.appendVar("RDEPENDS_%s" % pkg, ' ' + d.getVar('MLPREFIX', False) + 'gconf')
+}
diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
new file mode 100644
index 0000000..03b89b2
--- /dev/null
+++ b/meta/classes/gettext.bbclass
@@ -0,0 +1,19 @@
+def gettext_dependencies(d):
+    if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'):
+        return ""
+    if d.getVar('USE_NLS', True) == 'no':
+        return "gettext-minimal-native"
+    return d.getVar('DEPENDS_GETTEXT', False)
+
+def gettext_oeconf(d):
+    if d.getVar('USE_NLS', True) == 'no':
+        return '--disable-nls'
+    # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set
+    if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'):
+        return '--disable-nls'
+    return "--enable-nls"
+
+DEPENDS_GETTEXT ??= "virtual/gettext gettext-native"
+
+BASEDEPENDS =+ "${@gettext_dependencies(d)}"
+EXTRA_OECONF_append = " ${@gettext_oeconf(d)}"
diff --git a/meta/classes/gnome.bbclass b/meta/classes/gnome.bbclass
new file mode 100644
index 0000000..c6202bb
--- /dev/null
+++ b/meta/classes/gnome.bbclass
@@ -0,0 +1 @@
+inherit gnomebase gtk-icon-cache gconf mime
diff --git a/meta/classes/gnomebase.bbclass b/meta/classes/gnomebase.bbclass
new file mode 100644
index 0000000..d22ba5a
--- /dev/null
+++ b/meta/classes/gnomebase.bbclass
@@ -0,0 +1,33 @@
+def gnome_verdir(v):
+    return oe.utils.trim_version(v, 2)
+
+GNOME_COMPRESS_TYPE ?= "xz"
+SECTION ?= "x11/gnome"
+GNOMEBN ?= "${BPN}"
+SRC_URI = "${GNOME_MIRROR}/${GNOMEBN}/${@gnome_verdir("${PV}")}/${GNOMEBN}-${PV}.tar.${GNOME_COMPRESS_TYPE};name=archive"
+
+DEPENDS += "gnome-common-native"
+
+FILES_${PN} += "${datadir}/application-registry  \
+                ${datadir}/mime-info \
+                ${datadir}/mime/packages \
+                ${datadir}/mime/application \
+                ${datadir}/gnome-2.0 \
+                ${datadir}/polkit* \
+                ${datadir}/GConf \
+                ${datadir}/glib-2.0/schemas \
+"
+
+FILES_${PN}-doc += "${datadir}/devhelp"
+
+inherit autotools pkgconfig
+
+do_install_append() {
+	rm -rf ${D}${localstatedir}/lib/scrollkeeper/*
+	rm -rf ${D}${localstatedir}/scrollkeeper/*
+	rm -f ${D}${datadir}/applications/*.cache
+}
+
+EXTRA_OECONF += "--disable-introspection"
+
+UNKNOWN_CONFIGURE_WHITELIST += "--disable-introspection"
diff --git a/meta/classes/grub-efi.bbclass b/meta/classes/grub-efi.bbclass
new file mode 100644
index 0000000..4ddc2bb
--- /dev/null
+++ b/meta/classes/grub-efi.bbclass
@@ -0,0 +1,145 @@
+# grub-efi.bbclass
+# Copyright (c) 2011, Intel Corporation.
+# All rights reserved.
+#
+# Released under the MIT license (see packages/COPYING)
+
+# Provide grub-efi specific functions for building bootable images.
+
+# External variables
+# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
+# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
+# ${GRUB_GFXSERIAL} - set this to 1 to have graphics and serial in the boot menu
+# ${LABELS} - a list of targets for the automatic config
+# ${APPEND} - an override list of append strings for each label
+# ${GRUB_OPTS} - additional options to add to the config, ';' delimited # (optional)
+# ${GRUB_TIMEOUT} - timeout before executing the deault label (optional)
+
+do_bootimg[depends] += "${MLPREFIX}grub-efi:do_deploy"
+do_bootdirectdisk[depends] += "${MLPREFIX}grub-efi:do_deploy"
+
+GRUB_SERIAL ?= "console=ttyS0,115200"
+GRUBCFG = "${S}/grub.cfg"
+GRUB_TIMEOUT ?= "10"
+#FIXME: build this from the machine config
+GRUB_OPTS ?= "serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1"
+
+EFIDIR = "/EFI/BOOT"
+
+# Need UUID utility code.
+inherit fs-uuid
+
+efi_populate() {
+	# DEST must be the root of the image so that EFIDIR is not
+	# nested under a top level directory.
+	DEST=$1
+
+	install -d ${DEST}${EFIDIR}
+
+	GRUB_IMAGE="bootia32.efi"
+	if [ "${TARGET_ARCH}" = "x86_64" ]; then
+		GRUB_IMAGE="bootx64.efi"
+	fi
+	install -m 0644 ${DEPLOY_DIR_IMAGE}/${GRUB_IMAGE} ${DEST}${EFIDIR}
+
+	install -m 0644 ${GRUBCFG} ${DEST}${EFIDIR}/grub.cfg
+}
+
+efi_iso_populate() {
+	iso_dir=$1
+	efi_populate $iso_dir
+	# Build a EFI directory to create efi.img
+	mkdir -p ${EFIIMGDIR}/${EFIDIR}
+	cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
+	cp $iso_dir/vmlinuz ${EFIIMGDIR}
+	echo "${GRUB_IMAGE}" > ${EFIIMGDIR}/startup.nsh
+	if [ -f "$iso_dir/initrd" ] ; then
+		cp $iso_dir/initrd ${EFIIMGDIR}
+	fi
+}
+
+efi_hddimg_populate() {
+	efi_populate $1
+}
+
+python build_efi_cfg() {
+    import sys
+
+    workdir = d.getVar('WORKDIR', True)
+    if not workdir:
+        bb.error("WORKDIR not defined, unable to package")
+        return
+
+    gfxserial = d.getVar('GRUB_GFXSERIAL', True) or ""
+
+    labels = d.getVar('LABELS', True)
+    if not labels:
+        bb.debug(1, "LABELS not defined, nothing to do")
+        return
+
+    if labels == []:
+        bb.debug(1, "No labels, nothing to do")
+        return
+
+    cfile = d.getVar('GRUBCFG', True)
+    if not cfile:
+        raise bb.build.FuncFailed('Unable to read GRUBCFG')
+
+    try:
+         cfgfile = file(cfile, 'w')
+    except OSError:
+        raise bb.build.funcFailed('Unable to open %s' % (cfile))
+
+    cfgfile.write('# Automatically created by OE\n')
+
+    opts = d.getVar('GRUB_OPTS', True)
+    if opts:
+        for opt in opts.split(';'):
+            cfgfile.write('%s\n' % opt)
+
+    cfgfile.write('default=%s\n' % (labels.split()[0]))
+
+    timeout = d.getVar('GRUB_TIMEOUT', True)
+    if timeout:
+        cfgfile.write('timeout=%s\n' % timeout)
+    else:
+        cfgfile.write('timeout=50\n')
+
+    if gfxserial == "1":
+        btypes = [ [ " graphics console", "" ],
+            [ " serial console", d.getVar('GRUB_SERIAL', True) or "" ] ]
+    else:
+        btypes = [ [ "", "" ] ]
+
+    for label in labels.split():
+        localdata = d.createCopy()
+
+        overrides = localdata.getVar('OVERRIDES', True)
+        if not overrides:
+            raise bb.build.FuncFailed('OVERRIDES not defined')
+
+        for btype in btypes:
+            localdata.setVar('OVERRIDES', label + ':' + overrides)
+            bb.data.update_data(localdata)
+
+            cfgfile.write('\nmenuentry \'%s%s\'{\n' % (label, btype[0]))
+            lb = label
+            if label == "install":
+                lb = "install-efi"
+            cfgfile.write('linux /vmlinuz LABEL=%s' % (lb))
+
+            append = localdata.getVar('APPEND', True)
+            initrd = localdata.getVar('INITRD', True)
+
+            if append:
+                append = replace_rootfs_uuid(d, append)
+                cfgfile.write('%s' % (append))
+            cfgfile.write(' %s' % btype[1])
+            cfgfile.write('\n')
+
+            if initrd:
+                cfgfile.write('initrd /initrd')
+            cfgfile.write('\n}\n')
+
+    cfgfile.close()
+}
diff --git a/meta/classes/gsettings.bbclass b/meta/classes/gsettings.bbclass
new file mode 100644
index 0000000..dec5abc
--- /dev/null
+++ b/meta/classes/gsettings.bbclass
@@ -0,0 +1,37 @@
+# A bbclass to handle installed GSettings (glib) schemas, updated the compiled
+# form on package install and remove.
+#
+# The compiled schemas are platform-agnostic, so we can depend on
+# glib-2.0-native for the native tool and run the postinst script when the
+# rootfs builds to save a little time on first boot.
+
+# TODO use a trigger so that this runs once per package operation run
+
+DEPENDS += "glib-2.0-native"
+
+RDEPENDS_${PN} += "glib-2.0-utils"
+
+FILES_${PN} += "${datadir}/glib-2.0/schemas"
+
+gsettings_postinstrm () {
+	glib-compile-schemas $D${datadir}/glib-2.0/schemas
+}
+
+python populate_packages_append () {
+    pkg = d.getVar('PN', True)
+    bb.note("adding gsettings postinst scripts to %s" % pkg)
+
+    postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
+    if not postinst:
+        postinst = '#!/bin/sh\n'
+    postinst += d.getVar('gsettings_postinstrm', True)
+    d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+    bb.note("adding gsettings postrm scripts to %s" % pkg)
+
+    postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
+    if not postrm:
+        postrm = '#!/bin/sh\n'
+    postrm += d.getVar('gsettings_postinstrm', True)
+    d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
diff --git a/meta/classes/gtk-doc.bbclass b/meta/classes/gtk-doc.bbclass
new file mode 100644
index 0000000..e32f98d
--- /dev/null
+++ b/meta/classes/gtk-doc.bbclass
@@ -0,0 +1,25 @@
+# Helper class to pull in the right gtk-doc dependencies and disable
+# gtk-doc.
+#
+# Long-term it would be great if this class could be toggled between
+# gtk-doc-stub-native and the real gtk-doc-native, which would enable
+# re-generation of documentation.  For now, we'll make do with this which
+# packages up any existing documentation (so from tarball builds).
+
+# The documentation directory, where the infrastructure will be copied.
+# gtkdocize has a default of "." so to handle out-of-tree builds set this to $S.
+GTKDOC_DOCDIR ?= "${S}"
+
+DEPENDS_append = " gtk-doc-stub-native"
+
+EXTRA_OECONF_append = "\
+  --disable-gtk-doc \
+  --disable-gtk-doc-html \
+  --disable-gtk-doc-pdf \
+"
+
+do_configure_prepend () {
+	( cd ${S}; gtkdocize --docdir ${GTKDOC_DOCDIR} )
+}
+
+inherit pkgconfig
diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass
new file mode 100644
index 0000000..12358e3
--- /dev/null
+++ b/meta/classes/gtk-icon-cache.bbclass
@@ -0,0 +1,62 @@
+FILES_${PN} += "${datadir}/icons/hicolor"
+
+DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk-icon-utils-native"
+
+gtk_icon_cache_postinst() {
+if [ "x$D" != "x" ]; then
+	$INTERCEPT_DIR/postinst_intercept update_icon_cache ${PKG} mlprefix=${MLPREFIX} libdir=${libdir} \
+		base_libdir=${base_libdir}
+else
+
+	# Update the pixbuf loaders in case they haven't been registered yet
+	GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders gdk-pixbuf-query-loaders --update-cache
+
+	for icondir in /usr/share/icons/* ; do
+		if [ -d $icondir ] ; then
+			gtk-update-icon-cache -fqt  $icondir
+		fi
+	done
+fi
+}
+
+gtk_icon_cache_postrm() {
+if [ "x$D" != "x" ]; then
+	$INTERCEPT_DIR/postinst_intercept update_icon_cache ${PKG} mlprefix=${MLPREFIX} libdir=${libdir} \
+		base_libdir=${base_libdir}
+else
+	for icondir in /usr/share/icons/* ; do
+		if [ -d $icondir ] ; then
+			gtk-update-icon-cache -qt  $icondir
+		fi
+	done
+fi
+}
+
+python populate_packages_append () {
+    packages = d.getVar('PACKAGES', True).split()
+    pkgdest =  d.getVar('PKGDEST', True)
+    
+    for pkg in packages:
+        icon_dir = '%s/%s/%s/icons' % (pkgdest, pkg, d.getVar('datadir', True))
+        if not os.path.exists(icon_dir):
+            continue
+
+        bb.note("adding hicolor-icon-theme dependency to %s" % pkg)
+        rdepends = ' ' + d.getVar('MLPREFIX', False) + "hicolor-icon-theme"
+        d.appendVar('RDEPENDS_%s' % pkg, rdepends)
+    
+        bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg)
+        
+        postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+        if not postinst:
+            postinst = '#!/bin/sh\n'
+        postinst += d.getVar('gtk_icon_cache_postinst', True)
+        d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+        postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+        if not postrm:
+            postrm = '#!/bin/sh\n'
+        postrm += d.getVar('gtk_icon_cache_postrm', True)
+        d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
diff --git a/meta/classes/gtk-immodules-cache.bbclass b/meta/classes/gtk-immodules-cache.bbclass
new file mode 100644
index 0000000..0a6316d
--- /dev/null
+++ b/meta/classes/gtk-immodules-cache.bbclass
@@ -0,0 +1,83 @@
+# This class will update the inputmethod module cache for virtual keyboards
+#
+# Usage: Set GTKIMMODULES_PACKAGES to the packages that needs to update the inputmethod modules
+
+DEPENDS =+ "qemu-native"
+
+inherit qemu
+
+GTKIMMODULES_PACKAGES ?= "${PN}"
+
+gtk_immodule_cache_postinst() {
+if [ "x$D" != "x" ]; then
+    for maj_ver in 2 3; do
+        if [ -x $D${bindir}/gtk-query-immodules-$maj_ver.0 ]; then
+            IMFILES=$(ls $D${libdir}/gtk-$maj_ver.0/*/immodules/*.so)
+            ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-$maj_ver.0')} \
+                $IMFILES > $D/etc/gtk-$maj_ver.0/gtk.immodules 2>/dev/null &&
+                sed -i -e "s:$D::" $D/etc/gtk-$maj_ver.0/gtk.immodules
+
+            [ $? -ne 0 ] && exit 1
+        fi
+    done
+
+    exit 0
+fi
+if [ ! -z `which gtk-query-immodules-2.0` ]; then
+    gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
+fi
+if [ ! -z `which gtk-query-immodules-3.0` ]; then
+    gtk-query-immodules-3.0 > /etc/gtk-3.0/gtk.immodules
+fi
+}
+
+gtk_immodule_cache_postrm() {
+if [ "x$D" != "x" ]; then
+    for maj_ver in 2 3; do
+        if [ -x $D${bindir}/gtk-query-immodules-$maj_ver.0 ]; then
+            IMFILES=$(ls $D${libdir}/gtk-$maj_ver.0/*/immodules/*.so)
+            ${@qemu_run_binary(d, '$D', '${bindir}/gtk-query-immodules-$maj_ver.0')} \
+                $IMFILES > $D/etc/gtk-$maj_ver.0/gtk.immodules 2>/dev/null &&
+                sed -i -e "s:$D::" $D/etc/gtk-$maj_ver.0/gtk.immodules
+
+            [ $? -ne 0 ] && exit 1
+        fi
+    done
+
+    exit 0
+fi
+if [ ! -z `which gtk-query-immodules-2.0` ]; then
+    gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules
+fi
+if [ ! -z `which gtk-query-immodules-3.0` ]; then
+    gtk-query-immodules-3.0 > /etc/gtk-3.0/gtk.immodules
+fi
+}
+
+python populate_packages_append () {
+    gtkimmodules_pkgs = d.getVar('GTKIMMODULES_PACKAGES', True).split()
+
+    for pkg in gtkimmodules_pkgs:
+            bb.note("adding gtk-immodule-cache postinst and postrm scripts to %s" % pkg)
+
+            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            if not postinst:
+                postinst = '#!/bin/sh\n'
+            postinst += d.getVar('gtk_immodule_cache_postinst', True)
+            d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+            postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+            if not postrm:
+                postrm = '#!/bin/sh\n'
+            postrm += d.getVar('gtk_immodule_cache_postrm', True)
+            d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
+python __anonymous() {
+    if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+        gtkimmodules_check = d.getVar('GTKIMMODULES_PACKAGES', False)
+        if not gtkimmodules_check:
+            bb_filename = d.getVar('FILE', False)
+            raise bb.build.FuncFailed("ERROR: %s inherits gtk-immodules-cache but doesn't set GTKIMMODULES_PACKAGES" % bb_filename)
+}
+
diff --git a/meta/classes/gummiboot.bbclass b/meta/classes/gummiboot.bbclass
new file mode 100644
index 0000000..3d9c08b
--- /dev/null
+++ b/meta/classes/gummiboot.bbclass
@@ -0,0 +1,118 @@
+# Copyright (C) 2014 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# gummiboot.bbclass - equivalent of grub-efi.bbclass
+# Set EFI_PROVIDER = "gummiboot" to use gummiboot on your live images instead of grub-efi
+# (images built by bootimage.bbclass or boot-directdisk.bbclass)
+
+do_bootimg[depends] += "${MLPREFIX}gummiboot:do_deploy"
+do_bootdirectdisk[depends] += "${MLPREFIX}gummiboot:do_deploy"
+
+EFIDIR = "/EFI/BOOT"
+
+GUMMIBOOT_CFG ?= "${S}/loader.conf"
+GUMMIBOOT_ENTRIES ?= ""
+GUMMIBOOT_TIMEOUT ?= "10"
+
+# Need UUID utility code.
+inherit fs-uuid
+
+efi_populate() {
+        DEST=$1
+
+        EFI_IMAGE="gummibootia32.efi"
+        DEST_EFI_IMAGE="bootia32.efi"
+        if [ "${TARGET_ARCH}" = "x86_64" ]; then
+            EFI_IMAGE="gummibootx64.efi"
+            DEST_EFI_IMAGE="bootx64.efi"
+        fi
+
+        install -d ${DEST}${EFIDIR}
+        # gummiboot requires these paths for configuration files
+        # they are not customizable so no point in new vars
+        install -d ${DEST}/loader
+        install -d ${DEST}/loader/entries
+        install -m 0644 ${DEPLOY_DIR_IMAGE}/${EFI_IMAGE} ${DEST}${EFIDIR}/${DEST_EFI_IMAGE}
+        install -m 0644 ${GUMMIBOOT_CFG} ${DEST}/loader/loader.conf
+        for i in ${GUMMIBOOT_ENTRIES}; do
+            install -m 0644 ${i} ${DEST}/loader/entries
+        done
+}
+
+efi_iso_populate() {
+        iso_dir=$1
+        efi_populate $iso_dir
+        mkdir -p ${EFIIMGDIR}/${EFIDIR}
+        cp $iso_dir/${EFIDIR}/* ${EFIIMGDIR}${EFIDIR}
+        cp $iso_dir/vmlinuz ${EFIIMGDIR}
+        echo "${DEST_EFI_IMAGE}" > ${EFIIMGDIR}/startup.nsh
+        if [ -f "$iso_dir/initrd" ] ; then
+            cp $iso_dir/initrd ${EFIIMGDIR}
+        fi
+}
+
+efi_hddimg_populate() {
+        efi_populate $1
+}
+
+python build_efi_cfg() {
+    s = d.getVar("S", True)
+    labels = d.getVar('LABELS', True)
+    if not labels:
+        bb.debug(1, "LABELS not defined, nothing to do")
+        return
+
+    if labels == []:
+        bb.debug(1, "No labels, nothing to do")
+        return
+
+    cfile = d.getVar('GUMMIBOOT_CFG', True)
+    try:
+         cfgfile = open(cfile, 'w')
+    except OSError:
+        raise bb.build.funcFailed('Unable to open %s' % (cfile))
+
+    cfgfile.write('# Automatically created by OE\n')
+    cfgfile.write('default %s\n' % (labels.split()[0]))
+    timeout = d.getVar('GUMMIBOOT_TIMEOUT', True)
+    if timeout:
+        cfgfile.write('timeout %s\n' % timeout)
+    else:
+        cfgfile.write('timeout 10\n')
+    cfgfile.close()
+
+    for label in labels.split():
+        localdata = d.createCopy()
+
+        overrides = localdata.getVar('OVERRIDES', True)
+        if not overrides:
+            raise bb.build.FuncFailed('OVERRIDES not defined')
+
+        entryfile = "%s/%s.conf" % (s, label)
+        d.appendVar("GUMMIBOOT_ENTRIES", " " + entryfile)
+        try:
+            entrycfg = open(entryfile, "w")
+        except OSError:
+            raise bb.build.funcFailed('Unable to open %s' % (entryfile))
+        localdata.setVar('OVERRIDES', label + ':' + overrides)
+        bb.data.update_data(localdata)
+
+        entrycfg.write('title %s\n' % label)
+        entrycfg.write('linux /vmlinuz\n')
+
+        append = localdata.getVar('APPEND', True)
+        initrd = localdata.getVar('INITRD', True)
+
+        if initrd:
+            entrycfg.write('initrd /initrd\n')
+        lb = label
+        if label == "install":
+            lb = "install-efi"
+        entrycfg.write('options LABEL=%s ' % lb)
+        if append:
+            append = replace_rootfs_uuid(d, append)
+            entrycfg.write('%s' % append)
+        entrycfg.write('\n')
+        entrycfg.close()
+}
diff --git a/meta/classes/gzipnative.bbclass b/meta/classes/gzipnative.bbclass
new file mode 100644
index 0000000..326cbbb
--- /dev/null
+++ b/meta/classes/gzipnative.bbclass
@@ -0,0 +1,5 @@
+EXTRANATIVEPATH += "pigz-native gzip-native"
+DEPENDS += "gzip-native"
+
+# tar may get run by do_unpack or do_populate_lic which could call gzip
+do_unpack[depends] += "gzip-native:do_populate_sysroot"
diff --git a/meta/classes/icecc.bbclass b/meta/classes/icecc.bbclass
new file mode 100644
index 0000000..61b8bb1
--- /dev/null
+++ b/meta/classes/icecc.bbclass
@@ -0,0 +1,333 @@
+# IceCream distributed compiling support
+#
+# Stages directories with symlinks from gcc/g++ to icecc, for both
+# native and cross compilers. Depending on each configure or compile,
+# the directories are added at the head of the PATH list and ICECC_CXX
+# and ICEC_CC are set.
+#
+# For the cross compiler, creates a tar.gz of our toolchain and sets
+# ICECC_VERSION accordingly.
+#
+# The class now handles all 3 different compile 'stages' (i.e native ,cross-kernel and target) creating the
+# necessary environment tar.gz file to be used by the remote machines.
+# It also supports meta-toolchain generation
+#
+# If ICECC_PATH is not set in local.conf then the class will try to locate it using 'bb.utils.which'
+# but nothing is sure ;)
+#
+# If ICECC_ENV_EXEC is set in local.conf, then it should point to the icecc-create-env script provided by the user
+# or the default one provided by icecc-create-env.bb will be used
+# (NOTE that this is a modified version of the script need it and *not the one that comes with icecc*
+#
+# User can specify if specific packages or packages belonging to class should not use icecc to distribute
+# compile jobs to remote machines, but handled locally, by defining ICECC_USER_CLASS_BL and ICECC_USER_PACKAGE_BL
+# with the appropriate values in local.conf. In addition the user can force to enable icecc for packages
+# which set an empty PARALLEL_MAKE variable by defining ICECC_USER_PACKAGE_WL.
+#
+#########################################################################################
+#Error checking is kept to minimum so double check any parameters you pass to the class
+###########################################################################################
+
+BB_HASHBASE_WHITELIST += "ICECC_PARALLEL_MAKE ICECC_DISABLED ICECC_USER_PACKAGE_BL ICECC_USER_CLASS_BL ICECC_USER_PACKAGE_WL ICECC_PATH ICECC_ENV_EXEC"
+
+ICECC_ENV_EXEC ?= "${STAGING_BINDIR_NATIVE}/icecc-create-env"
+
+def icecc_dep_prepend(d):
+    # INHIBIT_DEFAULT_DEPS doesn't apply to the patch command.  Whether or  not
+    # we need that built is the responsibility of the patch function / class, not
+    # the application.
+    if not d.getVar('INHIBIT_DEFAULT_DEPS', False):
+        return "icecc-create-env-native"
+    return ""
+
+DEPENDS_prepend += "${@icecc_dep_prepend(d)} "
+
+def get_cross_kernel_cc(bb,d):
+    kernel_cc = d.getVar('KERNEL_CC', False)
+
+    # evaluate the expression by the shell if necessary
+    if '`' in kernel_cc or '$(' in kernel_cc:
+        kernel_cc = os.popen("echo %s" % kernel_cc).read()[:-1]
+
+    kernel_cc = d.expand(kernel_cc)
+    kernel_cc = kernel_cc.replace('ccache', '').strip()
+    kernel_cc = kernel_cc.split(' ')[0]
+    kernel_cc = kernel_cc.strip()
+    return kernel_cc
+
+def get_icecc(d):
+    return d.getVar('ICECC_PATH', False) or bb.utils.which(os.getenv("PATH"), "icecc")
+
+def create_path(compilers, bb, d):
+    """
+    Create Symlinks for the icecc in the staging directory
+    """
+    staging = os.path.join(d.expand('${STAGING_BINDIR}'), "ice")
+    if icc_is_kernel(bb, d):
+        staging += "-kernel"
+
+    #check if the icecc path is set by the user
+    icecc = get_icecc(d)
+
+    # Create the dir if necessary
+    try:
+        os.stat(staging)
+    except:
+        try:
+            os.makedirs(staging)
+        except:
+            pass
+
+    for compiler in compilers:
+        gcc_path = os.path.join(staging, compiler)
+        try:
+            os.stat(gcc_path)
+        except:
+            try:
+                os.symlink(icecc, gcc_path)
+            except:
+                pass
+
+    return staging
+
+def use_icc(bb,d):
+    if d.getVar('ICECC_DISABLED', False) == "1":
+        # don't even try it, when explicitly disabled
+        return "no"
+
+    # allarch recipes don't use compiler
+    if icc_is_allarch(bb, d):
+        return "no"
+
+    pn = d.getVar('PN', True)
+
+    system_class_blacklist = []
+    user_class_blacklist = (d.getVar('ICECC_USER_CLASS_BL', False) or "none").split()
+    package_class_blacklist = system_class_blacklist + user_class_blacklist
+
+    for black in package_class_blacklist:
+        if bb.data.inherits_class(black, d):
+            bb.debug(1, "%s: class %s found in blacklist, disable icecc" % (pn, black))
+            return "no"
+
+    # "system" recipe blacklist contains a list of packages that can not distribute compile tasks
+    # for one reason or the other
+    # this is the old list (which doesn't seem to be valid anymore, because I was able to build
+    # all these with icecc enabled)
+    # system_package_blacklist = [ "uclibc", "glibc", "gcc", "bind", "u-boot", "dhcp-forwarder", "enchant", "connman", "orbit2" ]
+    # when adding new entry, please document why (how it failed) so that we can re-evaluate it later
+    # e.g. when there is new version
+    # building libgcc-initial with icecc fails with CPP sanity check error if host sysroot contains cross gcc built for another target tune/variant
+    system_package_blacklist = ["libgcc-initial"]
+    user_package_blacklist = (d.getVar('ICECC_USER_PACKAGE_BL', False) or "").split()
+    user_package_whitelist = (d.getVar('ICECC_USER_PACKAGE_WL', False) or "").split()
+    package_blacklist = system_package_blacklist + user_package_blacklist
+
+    if pn in package_blacklist:
+        bb.debug(1, "%s: found in blacklist, disable icecc" % pn)
+        return "no"
+
+    if pn in user_package_whitelist:
+        bb.debug(1, "%s: found in whitelist, enable icecc" % pn)
+        return "yes"
+
+    if d.getVar('PARALLEL_MAKE', False) == "":
+        bb.debug(1, "%s: has empty PARALLEL_MAKE, disable icecc" % pn)
+        return "no"
+
+    return "yes"
+
+def icc_is_allarch(bb, d):
+    return d.getVar("PACKAGE_ARCH", False) == "all"
+
+def icc_is_kernel(bb, d):
+    return \
+        bb.data.inherits_class("kernel", d);
+
+def icc_is_native(bb, d):
+    return \
+        bb.data.inherits_class("cross", d) or \
+        bb.data.inherits_class("native", d);
+
+# Don't pollute allarch signatures with TARGET_FPU
+icc_version[vardepsexclude] += "TARGET_FPU"
+def icc_version(bb, d):
+    if use_icc(bb, d) == "no":
+        return ""
+
+    parallel = d.getVar('ICECC_PARALLEL_MAKE', False) or ""
+    if not d.getVar('PARALLEL_MAKE', False) == "" and parallel:
+        d.setVar("PARALLEL_MAKE", parallel)
+
+    if icc_is_native(bb, d):
+        archive_name = "local-host-env"
+    elif d.expand('${HOST_PREFIX}') == "":
+        bb.fatal(d.expand("${PN}"), " NULL prefix")
+    else:
+        prefix = d.expand('${HOST_PREFIX}' )
+        distro = d.expand('${DISTRO}')
+        target_sys = d.expand('${TARGET_SYS}')
+        float = d.getVar('TARGET_FPU', False) or "hard"
+        archive_name = prefix + distro + "-"        + target_sys + "-" + float
+        if icc_is_kernel(bb, d):
+            archive_name += "-kernel"
+
+    import socket
+    ice_dir = d.expand('${STAGING_DIR_NATIVE}${prefix_native}')
+    tar_file = os.path.join(ice_dir, 'ice', archive_name + "-@VERSION@-" + socket.gethostname() + '.tar.gz')
+
+    return tar_file
+
+def icc_path(bb,d):
+    if use_icc(bb, d) == "no":
+        # don't create unnecessary directories when icecc is disabled
+        return
+
+    if icc_is_kernel(bb, d):
+        return create_path( [get_cross_kernel_cc(bb,d), ], bb, d)
+
+    else:
+        prefix = d.expand('${HOST_PREFIX}')
+        return create_path( [prefix+"gcc", prefix+"g++"], bb, d)
+
+def icc_get_external_tool(bb, d, tool):
+    external_toolchain_bindir = d.expand('${EXTERNAL_TOOLCHAIN}${bindir_cross}')
+    target_prefix = d.expand('${TARGET_PREFIX}')
+    return os.path.join(external_toolchain_bindir, '%s%s' % (target_prefix, tool))
+
+# Don't pollute native signatures with target TUNE_PKGARCH through STAGING_BINDIR_TOOLCHAIN
+icc_get_tool[vardepsexclude] += "STAGING_BINDIR_TOOLCHAIN"
+def icc_get_tool(bb, d, tool):
+    if icc_is_native(bb, d):
+        return bb.utils.which(os.getenv("PATH"), tool)
+    elif icc_is_kernel(bb, d):
+        return bb.utils.which(os.getenv("PATH"), get_cross_kernel_cc(bb, d))
+    else:
+        ice_dir = d.expand('${STAGING_BINDIR_TOOLCHAIN}')
+        target_sys = d.expand('${TARGET_SYS}')
+        tool_bin = os.path.join(ice_dir, "%s-%s" % (target_sys, tool))
+        if os.path.isfile(tool_bin):
+            return tool_bin
+        else:
+            external_tool_bin = icc_get_external_tool(bb, d, tool)
+            if os.path.isfile(external_tool_bin):
+                return external_tool_bin
+            else:
+                return ""
+
+def icc_get_and_check_tool(bb, d, tool):
+    # Check that g++ or gcc is not a symbolic link to icecc binary in
+    # PATH or icecc-create-env script will silently create an invalid
+    # compiler environment package.
+    t = icc_get_tool(bb, d, tool)
+    if t and os.popen("readlink -f %s" % t).read()[:-1] == get_icecc(d):
+        bb.error("%s is a symlink to %s in PATH and this prevents icecc from working" % (t, get_icecc(d)))
+        return ""
+    else:
+        return t
+
+wait_for_file() {
+    local TIME_ELAPSED=0
+    local FILE_TO_TEST=$1
+    local TIMEOUT=$2
+    until [ -f "$FILE_TO_TEST" ]
+    do
+        TIME_ELAPSED=`expr $TIME_ELAPSED + 1`
+        if [ $TIME_ELAPSED -gt $TIMEOUT ]
+        then
+            return 1
+        fi
+        sleep 1
+    done
+}
+
+def set_icecc_env():
+    # dummy python version of set_icecc_env
+    return
+
+set_icecc_env() {
+    if [ "${@use_icc(bb, d)}" = "no" ]
+    then
+        return
+    fi
+    ICECC_VERSION="${@icc_version(bb, d)}"
+    if [ "x${ICECC_VERSION}" = "x" ]
+    then
+        bbwarn "Cannot use icecc: could not get ICECC_VERSION"
+        return
+    fi
+
+    ICE_PATH="${@icc_path(bb, d)}"
+    if [ "x${ICE_PATH}" = "x" ]
+    then
+        bbwarn "Cannot use icecc: could not get ICE_PATH"
+        return
+    fi
+
+    ICECC_CC="${@icc_get_and_check_tool(bb, d, "gcc")}"
+    ICECC_CXX="${@icc_get_and_check_tool(bb, d, "g++")}"
+    # cannot use icc_get_and_check_tool here because it assumes as without target_sys prefix
+    ICECC_WHICH_AS="${@bb.utils.which(os.getenv('PATH'), 'as')}"
+    if [ ! -x "${ICECC_CC}" -o ! -x "${ICECC_CXX}" ]
+    then
+        bbwarn "Cannot use icecc: could not get ICECC_CC or ICECC_CXX"
+        return
+    fi
+
+    ICE_VERSION=`$ICECC_CC -dumpversion`
+    ICECC_VERSION=`echo ${ICECC_VERSION} | sed -e "s/@VERSION@/$ICE_VERSION/g"`
+    if [ ! -x "${ICECC_ENV_EXEC}" ]
+    then
+        bbwarn "Cannot use icecc: invalid ICECC_ENV_EXEC"
+        return
+    fi
+
+    ICECC_AS="`${ICECC_CC} -print-prog-name=as`"
+    # for target recipes should return something like:
+    # /OE/tmp-eglibc/sysroots/x86_64-linux/usr/libexec/arm920tt-oe-linux-gnueabi/gcc/arm-oe-linux-gnueabi/4.8.2/as
+    # and just "as" for native, if it returns "as" in current directory (for whatever reason) use "as" from PATH
+    if [ "`dirname "${ICECC_AS}"`" = "." ]
+    then
+        ICECC_AS="${ICECC_WHICH_AS}"
+    fi
+
+    if [ ! -f "${ICECC_VERSION}.done" ]
+    then
+        mkdir -p "`dirname "${ICECC_VERSION}"`"
+
+        # the ICECC_VERSION generation step must be locked by a mutex
+        # in order to prevent race conditions
+        if flock -n "${ICECC_VERSION}.lock" \
+            ${ICECC_ENV_EXEC} "${ICECC_CC}" "${ICECC_CXX}" "${ICECC_AS}" "${ICECC_VERSION}"
+        then
+            touch "${ICECC_VERSION}.done"
+        elif [ ! wait_for_file "${ICECC_VERSION}.done" 30 ]
+        then
+            # locking failed so wait for ${ICECC_VERSION}.done to appear
+            bbwarn "Timeout waiting for ${ICECC_VERSION}.done"
+            return
+        fi
+    fi
+
+    export ICECC_VERSION ICECC_CC ICECC_CXX
+    export PATH="$ICE_PATH:$PATH"
+    export CCACHE_PATH="$PATH"
+
+    bbnote "Using icecc"
+}
+
+do_configure_prepend() {
+    set_icecc_env
+}
+
+do_compile_prepend() {
+    set_icecc_env
+}
+
+do_compile_kernelmodules_prepend() {
+    set_icecc_env
+}
+
+do_install_prepend() {
+    set_icecc_env
+}
diff --git a/meta/classes/image-buildinfo.bbclass b/meta/classes/image-buildinfo.bbclass
new file mode 100644
index 0000000..aa17cc8
--- /dev/null
+++ b/meta/classes/image-buildinfo.bbclass
@@ -0,0 +1,69 @@
+#
+# Writes build information to target filesystem on /etc/build
+#
+# Copyright (C) 2014 Intel Corporation
+# Author: Alejandro Enedino Hernandez Samaniego <alejandro.hernandez@intel.com>
+#
+# Licensed under the MIT license, see COPYING.MIT for details
+#
+# Usage: add INHERIT += "image-buildinfo" to your conf file
+#
+
+# Desired variables to display 
+IMAGE_BUILDINFO_VARS ?= "DISTRO DISTRO_VERSION"
+
+# From buildhistory.bbclass
+def image_buildinfo_outputvars(vars, listvars, d): 
+    vars = vars.split()
+    listvars = listvars.split()
+    ret = ""
+    for var in vars:
+        value = d.getVar(var, True) or ""
+        if (d.getVarFlag(var, 'type') == "list"):
+            value = oe.utils.squashspaces(value)
+        ret += "%s = %s\n" % (var, value)
+    return ret.rstrip('\n')
+
+# Gets git branch's status (clean or dirty)
+def get_layer_git_status(path):
+    f = os.popen("cd %s; git diff --stat 2>&1 | tail -n 1" % path)
+    data = f.read()
+    if f.close() is None:
+        if len(data) != 0:
+            return "-- modified"
+    return ""
+
+# Returns layer revisions along with their respective status
+def get_layer_revs(d):
+    layers = (d.getVar("BBLAYERS", True) or "").split()
+    medadata_revs = ["%-17s = %s:%s %s" % (os.path.basename(i), \
+        base_get_metadata_git_branch(i, None).strip(), \
+        base_get_metadata_git_revision(i, None), \
+        get_layer_git_status(i)) \
+            for i in layers]
+    return '\n'.join(medadata_revs)
+
+def buildinfo_target(d):
+        # Get context
+        if d.getVar('BB_WORKERCONTEXT', True) != '1':
+                return ""
+        # Single and list variables to be read
+        vars = (d.getVar("IMAGE_BUILDINFO_VARS", True) or "")
+        listvars = (d.getVar("IMAGE_BUILDINFO_LVARS", True) or "")
+        return image_buildinfo_outputvars(vars, listvars, d)
+
+# Write build information to target filesystem
+buildinfo () {
+cat > ${IMAGE_ROOTFS}${sysconfdir}/build << END
+-----------------------
+Build Configuration:  |
+-----------------------
+${@buildinfo_target(d)}
+-----------------------
+Layer Revisions:      |   
+-----------------------
+${@get_layer_revs(d)}
+END
+}
+
+IMAGE_PREPROCESS_COMMAND += "buildinfo;"
diff --git a/meta/classes/image-live.bbclass b/meta/classes/image-live.bbclass
new file mode 100644
index 0000000..fa7a131
--- /dev/null
+++ b/meta/classes/image-live.bbclass
@@ -0,0 +1,18 @@
+
+AUTO_SYSLINUXCFG = "1"
+INITRD_IMAGE ?= "core-image-minimal-initramfs"
+INITRD ?= "${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.gz"
+SYSLINUX_ROOT = "root=/dev/ram0"
+SYSLINUX_TIMEOUT ?= "50"
+SYSLINUX_LABELS ?= "boot install"
+LABELS_append = " ${SYSLINUX_LABELS} "
+
+ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.ext4"
+
+do_bootimg[depends] += "${INITRD_IMAGE}:do_rootfs"
+do_bootimg[depends] += "${PN}:do_rootfs"
+
+inherit bootimg
+
+IMAGE_TYPEDEP_live = "ext4"
+IMAGE_TYPES_MASKED += "live"
diff --git a/meta/classes/image-mklibs.bbclass b/meta/classes/image-mklibs.bbclass
new file mode 100644
index 0000000..c455a8e
--- /dev/null
+++ b/meta/classes/image-mklibs.bbclass
@@ -0,0 +1,71 @@
+do_rootfs[depends] += "mklibs-native:do_populate_sysroot"
+
+IMAGE_PREPROCESS_COMMAND += "mklibs_optimize_image; "
+
+mklibs_optimize_image_doit() {
+	rm -rf ${WORKDIR}/mklibs
+	mkdir -p ${WORKDIR}/mklibs/dest
+	cd ${IMAGE_ROOTFS}
+	du -bs > ${WORKDIR}/mklibs/du.before.mklibs.txt
+	for i in `find .`; do file $i; done \
+		| grep ELF \
+		| grep "LSB *executable" \
+		| grep "dynamically linked" \
+		| sed "s/:.*//" \
+		| sed "s+^\./++" \
+		> ${WORKDIR}/mklibs/executables.list
+
+	case ${TARGET_ARCH} in
+		powerpc | mips | mipsel | microblaze )
+			dynamic_loader="${base_libdir}/ld.so.1"
+			;;
+		powerpc64)
+			dynamic_loader="${base_libdir}/ld64.so.1"
+			;;
+		x86_64)
+			dynamic_loader="${base_libdir}/ld-linux-x86-64.so.2"
+			;;
+		i586 )
+			dynamic_loader="${base_libdir}/ld-linux.so.2"
+			;;
+		arm )
+			dynamic_loader="${base_libdir}/ld-linux.so.3"
+			;;
+		* )
+			dynamic_loader="/unknown_dynamic_linker"
+			;;
+	esac
+
+	mklibs -v \
+		--ldlib ${dynamic_loader} \
+		--libdir ${baselib} \
+		--sysroot ${PKG_CONFIG_SYSROOT_DIR} \
+		--gcc-options "--sysroot=${PKG_CONFIG_SYSROOT_DIR}" \
+		--root ${IMAGE_ROOTFS} \
+		--target `echo ${TARGET_PREFIX} | sed 's/-$//' ` \
+		-d ${WORKDIR}/mklibs/dest \
+		`cat ${WORKDIR}/mklibs/executables.list`
+
+	cd ${WORKDIR}/mklibs/dest
+	for i in *
+	do
+		cp $i `find ${IMAGE_ROOTFS} -name $i`
+	done
+
+	cd ${IMAGE_ROOTFS}
+	du -bs > ${WORKDIR}/mklibs/du.after.mklibs.txt
+
+	echo rootfs size before mklibs optimization: `cat ${WORKDIR}/mklibs/du.before.mklibs.txt`
+	echo rootfs size after mklibs optimization: `cat ${WORKDIR}/mklibs/du.after.mklibs.txt`
+}
+
+mklibs_optimize_image() {
+	for img in ${MKLIBS_OPTIMIZED_IMAGES}
+	do
+		if [ "${img}" = "${PN}" ] || [ "${img}" = "all" ]
+		then
+			mklibs_optimize_image_doit
+			break
+		fi
+	done
+}
diff --git a/meta/classes/image-prelink.bbclass b/meta/classes/image-prelink.bbclass
new file mode 100644
index 0000000..d4bb3ae
--- /dev/null
+++ b/meta/classes/image-prelink.bbclass
@@ -0,0 +1,33 @@
+do_rootfs[depends] += "prelink-native:do_populate_sysroot"
+
+IMAGE_PREPROCESS_COMMAND += "prelink_image; "
+
+prelink_image () {
+#	export PSEUDO_DEBUG=4
+#	/bin/env | /bin/grep PSEUDO
+#	echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
+#	echo "LD_PRELOAD=$LD_PRELOAD"
+
+	pre_prelink_size=`du -ks ${IMAGE_ROOTFS} | awk '{size = $1 ; print size }'`
+	echo "Size before prelinking $pre_prelink_size."
+
+	# We need a prelink conf on the filesystem, add one if it's missing
+	if [ ! -e ${IMAGE_ROOTFS}${sysconfdir}/prelink.conf ]; then
+		cp ${STAGING_DIR_NATIVE}${sysconfdir_native}/prelink.conf \
+			${IMAGE_ROOTFS}${sysconfdir}/prelink.conf
+		dummy_prelink_conf=true;
+	else
+		dummy_prelink_conf=false;
+	fi
+
+	# prelink!
+	${STAGING_DIR_NATIVE}${sbindir_native}/prelink --root ${IMAGE_ROOTFS} -amR -N -c ${sysconfdir}/prelink.conf
+
+	# Remove the prelink.conf if we had to add it.
+	if [ "$dummy_prelink_conf" = "true" ]; then
+		rm -f ${IMAGE_ROOTFS}${sysconfdir}/prelink.conf
+	fi
+
+	pre_prelink_size=`du -ks ${IMAGE_ROOTFS} | awk '{size = $1 ; print size }'`
+	echo "Size after prelinking $pre_prelink_size."
+}
diff --git a/meta/classes/image-swab.bbclass b/meta/classes/image-swab.bbclass
new file mode 100644
index 0000000..8931856
--- /dev/null
+++ b/meta/classes/image-swab.bbclass
@@ -0,0 +1,94 @@
+HOST_DATA ?= "${TMPDIR}/host-contamination-data/"
+SWABBER_REPORT ?= "${LOG_DIR}/swabber/"
+SWABBER_LOGS ?= "${LOG_DIR}/contamination-logs"
+TRACE_LOGDIR ?= "${SWABBER_LOGS}/${PACKAGE_ARCH}"
+TRACE_LOGFILE = "${TRACE_LOGDIR}/${PN}-${PV}"
+
+SWAB_ORIG_TASK := "${BB_DEFAULT_TASK}"
+BB_DEFAULT_TASK = "generate_swabber_report"
+
+# Several recipes don't build with parallel make when run under strace
+# Ideally these should be fixed but as a temporary measure disable parallel
+# builds for troublesome recipes
+PARALLEL_MAKE_pn-openssl = ""
+PARALLEL_MAKE_pn-glibc = ""
+PARALLEL_MAKE_pn-glib-2.0 = ""
+PARALLEL_MAKE_pn-libxml2 = ""
+PARALLEL_MAKE_pn-readline = ""
+PARALLEL_MAKE_pn-util-linux = ""
+PARALLEL_MAKE_pn-binutils = ""
+PARALLEL_MAKE_pn-bison = ""
+PARALLEL_MAKE_pn-cmake = ""
+PARALLEL_MAKE_pn-elfutils = ""
+PARALLEL_MAKE_pn-gcc = ""
+PARALLEL_MAKE_pn-gcc-runtime = ""
+PARALLEL_MAKE_pn-m4 = ""
+PARALLEL_MAKE_pn-opkg = ""
+PARALLEL_MAKE_pn-pkgconfig = ""
+PARALLEL_MAKE_pn-prelink = ""
+PARALLEL_MAKE_pn-rpm = ""
+PARALLEL_MAKE_pn-tcl = ""
+PARALLEL_MAKE_pn-beecrypt = ""
+PARALLEL_MAKE_pn-curl = ""
+PARALLEL_MAKE_pn-gmp = ""
+PARALLEL_MAKE_pn-libmpc = ""
+PARALLEL_MAKE_pn-libxslt = ""
+PARALLEL_MAKE_pn-lzo = ""
+PARALLEL_MAKE_pn-popt = ""
+PARALLEL_MAKE_pn-linux-wrs = ""
+PARALLEL_MAKE_pn-libgcrypt = ""
+PARALLEL_MAKE_pn-gpgme = ""
+PARALLEL_MAKE_pn-udev = ""
+PARALLEL_MAKE_pn-gnutls = ""
+
+python() {
+    # NOTE: It might be useful to detect host infection on native and cross
+    # packages but as it turns out to be pretty hard to do this for all native
+    # and cross packages which aren't swabber-native or one of its dependencies
+    # I have ignored them for now...
+    if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('nativesdk', d) and not bb.data.inherits_class('cross', d):
+        deps = (d.getVarFlag('do_setscene', 'depends') or "").split()
+        deps.append('strace-native:do_populate_sysroot')
+        d.setVarFlag('do_setscene', 'depends', " ".join(deps))
+        logdir = d.expand("${TRACE_LOGDIR}")
+        bb.utils.mkdirhier(logdir)
+    else:
+        d.setVar('STRACEFUNC', '')
+}
+
+STRACEPID = "${@os.getpid()}"
+STRACEFUNC = "imageswab_attachstrace"
+
+do_configure[prefuncs] += "${STRACEFUNC}"
+do_compile[prefuncs] += "${STRACEFUNC}"
+
+imageswab_attachstrace () {
+	STRACE=`which strace`
+
+	if [ -x "$STRACE" ]; then
+		swabber-strace-attach "$STRACE -f -o ${TRACE_LOGFILE}-${BB_CURRENTTASK}.log -e trace=open,execve -p ${STRACEPID}" "${TRACE_LOGFILE}-traceattach-${BB_CURRENTTASK}.log"
+	fi
+}
+
+do_generate_swabber_report () {
+
+	update_distro ${HOST_DATA}
+
+	# Swabber can't create the directory for us
+	mkdir -p ${SWABBER_REPORT}
+
+	REPORTSTAMP=${SWAB_ORIG_TASK}-`date +%2m%2d%2H%2M%Y`
+
+	if [ `which ccache` ] ; then
+		CCACHE_DIR=`( ccache -s | grep "cache directory" | grep -o '[^ ]*$' 2> /dev/null )`
+ 	fi
+
+	if [ "$(ls -A ${HOST_DATA})" ]; then
+		echo "Generating swabber report"
+		swabber -d ${HOST_DATA} -l ${SWABBER_LOGS} -o ${SWABBER_REPORT}/report-${REPORTSTAMP}.txt -r ${SWABBER_REPORT}/extra_report-${REPORTSTAMP}.txt -c all -p ${TOPDIR} -f ${OEROOT}/meta/conf/swabber ${TOPDIR} ${OEROOT} ${CCACHE_DIR}
+	else
+		echo "No host data, cannot generate swabber report."
+	fi
+}
+addtask generate_swabber_report after do_${SWAB_ORIG_TASK}
+do_generate_swabber_report[depends] = "swabber-native:do_populate_sysroot"
diff --git a/meta/classes/image-vm.bbclass b/meta/classes/image-vm.bbclass
new file mode 100644
index 0000000..0632667
--- /dev/null
+++ b/meta/classes/image-vm.bbclass
@@ -0,0 +1,49 @@
+
+SYSLINUX_PROMPT ?= "0"
+SYSLINUX_LABELS = "boot"
+LABELS_append = " ${SYSLINUX_LABELS} "
+
+# Using an initramfs is optional. Enable it by setting INITRD_IMAGE.
+INITRD_IMAGE ?= ""
+INITRD ?= "${@'${DEPLOY_DIR_IMAGE}/${INITRD_IMAGE}-${MACHINE}.cpio.gz' if '${INITRD_IMAGE}' else ''}"
+do_bootdirectdisk[depends] += "${@'${INITRD_IMAGE}:do_rootfs' if '${INITRD_IMAGE}' else ''}"
+
+# need to define the dependency and the ROOTFS for directdisk
+do_bootdirectdisk[depends] += "${PN}:do_rootfs"
+ROOTFS ?= "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.ext4"
+
+# creating VM images relies on having a hddimg so ensure we inherit it here.
+inherit boot-directdisk
+
+IMAGE_TYPEDEP_vmdk = "ext4"
+IMAGE_TYPEDEP_vdi = "ext4"
+IMAGE_TYPEDEP_qcow2 = "ext4"
+IMAGE_TYPES_MASKED += "vmdk vdi qcow2"
+
+create_vmdk_image () {
+    qemu-img convert -O vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk
+    ln -sf ${IMAGE_NAME}.vmdk ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.vmdk
+}
+
+create_vdi_image () {
+    qemu-img convert -O vdi ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vdi
+    ln -sf ${IMAGE_NAME}.vdi ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.vdi
+}
+
+create_qcow2_image () {
+    qemu-img convert -O qcow2 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hdddirect ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.qcow2
+    ln -sf ${IMAGE_NAME}.qcow2 ${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.qcow2
+}
+
+python do_vmimg() {
+    if 'vmdk' in d.getVar('IMAGE_FSTYPES', True):
+        bb.build.exec_func('create_vmdk_image', d)
+    if 'vdi' in d.getVar('IMAGE_FSTYPES', True):
+        bb.build.exec_func('create_vdi_image', d)
+    if 'qcow2' in d.getVar('IMAGE_FSTYPES', True):
+        bb.build.exec_func('create_qcow2_image', d)
+}
+
+addtask vmimg after do_bootdirectdisk before do_build
+do_vmimg[depends] += "qemu-native:do_populate_sysroot"
+
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
new file mode 100644
index 0000000..fc7d64d
--- /dev/null
+++ b/meta/classes/image.bbclass
@@ -0,0 +1,504 @@
+inherit rootfs_${IMAGE_PKGTYPE}
+
+inherit populate_sdk_ext
+
+TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
+TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}"
+POPULATE_SDK_POST_TARGET_COMMAND += "rootfs_sysroot_relativelinks; "
+
+inherit gzipnative
+
+LICENSE = "MIT"
+PACKAGES = ""
+DEPENDS += "${MLPREFIX}qemuwrapper-cross ${MLPREFIX}depmodwrapper-cross"
+RDEPENDS += "${PACKAGE_INSTALL} ${LINGUAS_INSTALL}"
+RRECOMMENDS += "${PACKAGE_INSTALL_ATTEMPTONLY}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+TESTIMAGECLASS = "${@base_conditional('TEST_IMAGE', '1', 'testimage-auto', '', d)}"
+inherit ${TESTIMAGECLASS}
+
+# IMAGE_FEATURES may contain any available package group
+IMAGE_FEATURES ?= ""
+IMAGE_FEATURES[type] = "list"
+IMAGE_FEATURES[validitems] += "debug-tweaks read-only-rootfs empty-root-password allow-empty-password post-install-logging"
+
+# Generate companion debugfs?
+IMAGE_GEN_DEBUGFS ?= "0"
+
+# rootfs bootstrap install
+ROOTFS_BOOTSTRAP_INSTALL = "${@bb.utils.contains("IMAGE_FEATURES", "package-management", "", "${ROOTFS_PKGMANAGE_BOOTSTRAP}",d)}"
+
+# packages to install from features
+FEATURE_INSTALL = "${@' '.join(oe.packagegroup.required_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
+FEATURE_INSTALL[vardepvalue] = "${FEATURE_INSTALL}"
+FEATURE_INSTALL_OPTIONAL = "${@' '.join(oe.packagegroup.optional_packages(oe.data.typed_value('IMAGE_FEATURES', d), d))}"
+FEATURE_INSTALL_OPTIONAL[vardepvalue] = "${FEATURE_INSTALL_OPTIONAL}"
+
+# Define some very basic feature package groups
+FEATURE_PACKAGES_package-management = "${ROOTFS_PKGMANAGE}"
+SPLASH ?= "psplash"
+FEATURE_PACKAGES_splash = "${SPLASH}"
+
+IMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("IMAGE_FEATURES", d)}'
+
+def check_image_features(d):
+    valid_features = (d.getVarFlag('IMAGE_FEATURES', 'validitems', True) or "").split()
+    valid_features += d.getVarFlags('COMPLEMENTARY_GLOB').keys()
+    for var in d:
+       if var.startswith("PACKAGE_GROUP_"):
+           bb.warn("PACKAGE_GROUP is deprecated, please use FEATURE_PACKAGES instead")
+           valid_features.append(var[14:])
+       elif var.startswith("FEATURE_PACKAGES_"):
+           valid_features.append(var[17:])
+    valid_features.sort()
+
+    features = set(oe.data.typed_value('IMAGE_FEATURES', d))
+    for feature in features:
+        if feature not in valid_features:
+            if bb.utils.contains('EXTRA_IMAGE_FEATURES', feature, True, False, d):
+                raise bb.parse.SkipRecipe("'%s' in IMAGE_FEATURES (added via EXTRA_IMAGE_FEATURES) is not a valid image feature. Valid features: %s" % (feature, ' '.join(valid_features)))
+            else:
+                raise bb.parse.SkipRecipe("'%s' in IMAGE_FEATURES is not a valid image feature. Valid features: %s" % (feature, ' '.join(valid_features)))
+
+IMAGE_INSTALL ?= ""
+IMAGE_INSTALL[type] = "list"
+export PACKAGE_INSTALL ?= "${IMAGE_INSTALL} ${ROOTFS_BOOTSTRAP_INSTALL} ${FEATURE_INSTALL}"
+PACKAGE_INSTALL_ATTEMPTONLY ?= "${FEATURE_INSTALL_OPTIONAL}"
+
+# Images are generally built explicitly, do not need to be part of world.
+EXCLUDE_FROM_WORLD = "1"
+
+USE_DEVFS ?= "1"
+USE_DEPMOD ?= "1"
+
+PID = "${@os.getpid()}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+LDCONFIGDEPEND ?= "ldconfig-native:do_populate_sysroot"
+LDCONFIGDEPEND_libc-uclibc = ""
+LDCONFIGDEPEND_libc-musl = ""
+
+# This is needed to have depmod data in PKGDATA_DIR,
+# but if you're building small initramfs image
+# e.g. to include it in your kernel, you probably
+# don't want this dependency, which is causing dependency loop
+KERNELDEPMODDEPEND ?= "virtual/kernel:do_packagedata"
+
+do_rootfs[depends] += " \
+    makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ${LDCONFIGDEPEND} \
+    virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot \
+    ${KERNELDEPMODDEPEND} \
+"
+do_rootfs[recrdeptask] += "do_packagedata"
+
+def command_variables(d):
+    return ['ROOTFS_POSTPROCESS_COMMAND','ROOTFS_PREPROCESS_COMMAND','ROOTFS_POSTINSTALL_COMMAND','OPKG_PREPROCESS_COMMANDS','OPKG_POSTPROCESS_COMMANDS','IMAGE_POSTPROCESS_COMMAND',
+            'IMAGE_PREPROCESS_COMMAND','ROOTFS_POSTPROCESS_COMMAND','POPULATE_SDK_POST_HOST_COMMAND','POPULATE_SDK_POST_TARGET_COMMAND','SDK_POSTPROCESS_COMMAND','RPM_PREPROCESS_COMMANDS',         
+            'RPM_POSTPROCESS_COMMANDS']
+
+python () {
+    variables = command_variables(d)
+    for var in variables:
+        if d.getVar(var, False):
+            d.setVarFlag(var, 'func', '1')
+}
+
+def rootfs_variables(d):
+    from oe.rootfs import variable_depends
+    variables = ['IMAGE_DEVICE_TABLES','BUILD_IMAGES_FROM_FEEDS','IMAGE_TYPEDEP_','IMAGE_TYPES_MASKED','IMAGE_ROOTFS_ALIGNMENT','IMAGE_OVERHEAD_FACTOR','IMAGE_ROOTFS_SIZE','IMAGE_ROOTFS_EXTRA_SPACE',
+                 'IMAGE_ROOTFS_MAXSIZE','IMAGE_NAME','IMAGE_LINK_NAME','IMAGE_MANIFEST','DEPLOY_DIR_IMAGE','RM_OLD_IMAGE','IMAGE_FSTYPES','IMAGE_INSTALL_COMPLEMENTARY','IMAGE_LINGUAS','SDK_OS',
+                 'SDK_OUTPUT','SDKPATHNATIVE','SDKTARGETSYSROOT','SDK_DIR','SDK_VENDOR','SDKIMAGE_INSTALL_COMPLEMENTARY','SDK_PACKAGE_ARCHS','SDK_OUTPUT','SDKTARGETSYSROOT','MULTILIBRE_ALLOW_REP',
+                 'MULTILIB_TEMP_ROOTFS','MULTILIB_VARIANTS','MULTILIBS','ALL_MULTILIB_PACKAGE_ARCHS','MULTILIB_GLOBAL_VARIANTS','BAD_RECOMMENDATIONS','NO_RECOMMENDATIONS','PACKAGE_ARCHS',
+                 'PACKAGE_CLASSES','TARGET_VENDOR','TARGET_VENDOR','TARGET_ARCH','TARGET_OS','OVERRIDES','BBEXTENDVARIANT','FEED_DEPLOYDIR_BASE_URI','INTERCEPT_DIR','USE_DEVFS',
+                 'COMPRESSIONTYPES', 'IMAGE_GEN_DEBUGFS']
+    variables.extend(command_variables(d))
+    variables.extend(variable_depends(d))
+    return " ".join(variables)
+
+do_rootfs[vardeps] += "${@rootfs_variables(d)}"
+
+do_build[depends] += "virtual/kernel:do_deploy"
+
+def build_live(d):
+    if bb.utils.contains("IMAGE_FSTYPES", "live", "live", "0", d) == "0": # live is not set but hob might set iso or hddimg
+        d.setVar('NOISO', bb.utils.contains('IMAGE_FSTYPES', "iso", "0", "1", d))
+        d.setVar('NOHDD', bb.utils.contains('IMAGE_FSTYPES', "hddimg", "0", "1", d))
+        if d.getVar('NOISO', True) == "0" or d.getVar('NOHDD', True) == "0":
+            return "image-live"
+        return ""
+    return "image-live"
+
+IMAGE_TYPE_live = "${@build_live(d)}"
+inherit ${IMAGE_TYPE_live}
+
+IMAGE_TYPE_vm = '${@bb.utils.contains_any("IMAGE_FSTYPES", ["vmdk", "vdi", "qcow2"], "image-vm", "", d)}'
+inherit ${IMAGE_TYPE_vm}
+
+python () {
+    deps = " " + imagetypes_getdepends(d)
+    d.appendVarFlag('do_rootfs', 'depends', deps)
+
+    deps = ""
+    for dep in (d.getVar('EXTRA_IMAGEDEPENDS', True) or "").split():
+        deps += " %s:do_populate_sysroot" % dep
+    d.appendVarFlag('do_build', 'depends', deps)
+
+    #process IMAGE_FEATURES, we must do this before runtime_mapping_rename
+    #Check for replaces image features
+    features = set(oe.data.typed_value('IMAGE_FEATURES', d))
+    remain_features = features.copy()
+    for feature in features:
+        replaces = set((d.getVar("IMAGE_FEATURES_REPLACES_%s" % feature, True) or "").split())
+        remain_features -= replaces
+
+    #Check for conflict image features
+    for feature in remain_features:
+        conflicts = set((d.getVar("IMAGE_FEATURES_CONFLICTS_%s" % feature, True) or "").split())
+        temp = conflicts & remain_features
+        if temp:
+            bb.fatal("%s contains conflicting IMAGE_FEATURES %s %s" % (d.getVar('PN', True), feature, ' '.join(list(temp))))
+
+    d.setVar('IMAGE_FEATURES', ' '.join(list(remain_features)))
+
+    check_image_features(d)
+    initramfs_image = d.getVar('INITRAMFS_IMAGE', True) or ""
+    if initramfs_image != "":
+        d.appendVarFlag('do_build', 'depends', " %s:do_bundle_initramfs" %  d.getVar('PN', True))
+        d.appendVarFlag('do_bundle_initramfs', 'depends', " %s:do_rootfs" % initramfs_image)
+}
+
+IMAGE_CLASSES += "image_types"
+inherit ${IMAGE_CLASSES}
+
+IMAGE_POSTPROCESS_COMMAND ?= ""
+
+# Zap the root password if debug-tweaks feature is not enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'empty-root-password' ], "", "zap_empty_root_password ; ",d)}'
+
+# Allow dropbear/openssh to accept logins from accounts with an empty password string if debug-tweaks is enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'allow-empty-password' ], "ssh_allow_empty_password; ", "",d)}'
+
+# Enable postinst logging if debug-tweaks is enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains_any("IMAGE_FEATURES", [ 'debug-tweaks', 'post-install-logging' ], "postinst_enable_logging; ", "",d)}'
+
+# Create /etc/timestamp during image construction to give a reasonably sane default time setting
+ROOTFS_POSTPROCESS_COMMAND += "rootfs_update_timestamp ; "
+
+# Tweak the mount options for rootfs in /etc/fstab if read-only-rootfs is enabled
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs", "read_only_rootfs_hook; ", "",d)}'
+
+# Write manifest
+IMAGE_MANIFEST = "${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.manifest"
+ROOTFS_POSTUNINSTALL_COMMAND =+ "write_image_manifest ; "
+# Set default postinst log file
+POSTINST_LOGFILE ?= "${localstatedir}/log/postinstall.log"
+# Set default target for systemd images
+SYSTEMD_DEFAULT_TARGET ?= '${@bb.utils.contains("IMAGE_FEATURES", "x11-base", "graphical.target", "multi-user.target", d)}'
+ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd", "set_systemd_default_target; ", "", d)}'
+
+ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;'
+
+# some default locales
+IMAGE_LINGUAS ?= "de-de fr-fr en-gb"
+
+LINGUAS_INSTALL ?= "${@" ".join(map(lambda s: "locale-base-%s" % s, d.getVar('IMAGE_LINGUAS', True).split()))}"
+
+# Prefer image, but use the fallback files for lookups if the image ones
+# aren't yet available.
+PSEUDO_PASSWD = "${IMAGE_ROOTFS}:${STAGING_DIR_NATIVE}"
+
+do_rootfs[dirs] = "${TOPDIR}"
+do_rootfs[lockfiles] += "${IMAGE_ROOTFS}.lock"
+do_rootfs[cleandirs] += "${S}"
+
+# Must call real_do_rootfs() from inside here, rather than as a separate
+# task, so that we have a single fakeroot context for the whole process.
+do_rootfs[umask] = "022"
+
+# A hook function to support read-only-rootfs IMAGE_FEATURES
+read_only_rootfs_hook () {
+	# Tweak the mount option and fs_passno for rootfs in fstab
+	sed -i -e '/^[#[:space:]]*\/dev\/root/{s/defaults/ro/;s/\([[:space:]]*[[:digit:]]\)\([[:space:]]*\)[[:digit:]]$/\1\20/}' ${IMAGE_ROOTFS}/etc/fstab
+
+	if ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "true", "false", d)}; then
+		# Change the value of ROOTFS_READ_ONLY in /etc/default/rcS to yes
+		if [ -e ${IMAGE_ROOTFS}/etc/default/rcS ]; then
+			sed -i 's/ROOTFS_READ_ONLY=no/ROOTFS_READ_ONLY=yes/' ${IMAGE_ROOTFS}/etc/default/rcS
+		fi
+		# Run populate-volatile.sh at rootfs time to set up basic files
+		# and directories to support read-only rootfs.
+		if [ -x ${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh ]; then
+			${IMAGE_ROOTFS}/etc/init.d/populate-volatile.sh
+		fi
+		# If we're using openssh and the /etc/ssh directory has no pre-generated keys,
+		# we should configure openssh to use the configuration file /etc/ssh/sshd_config_readonly
+		# and the keys under /var/run/ssh.
+		if [ -d ${IMAGE_ROOTFS}/etc/ssh ]; then
+			if [ -e ${IMAGE_ROOTFS}/etc/ssh/ssh_host_rsa_key ]; then
+				echo "SYSCONFDIR=/etc/ssh" >> ${IMAGE_ROOTFS}/etc/default/ssh
+				echo "SSHD_OPTS=" >> ${IMAGE_ROOTFS}/etc/default/ssh
+			else
+				echo "SYSCONFDIR=/var/run/ssh" >> ${IMAGE_ROOTFS}/etc/default/ssh
+				echo "SSHD_OPTS='-f /etc/ssh/sshd_config_readonly'" >> ${IMAGE_ROOTFS}/etc/default/ssh
+			fi
+		fi
+	fi
+
+	if ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "true", "false", d)}; then
+	    # Update user database files so that services don't fail for a read-only systemd system
+	    for conffile in ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd.conf ${IMAGE_ROOTFS}/usr/lib/sysusers.d/systemd-remote.conf; do
+		[ -e $conffile ] || continue
+		grep -v "^#" $conffile | sed -e '/^$/d' | while read type name id comment; do
+		    if [ "$type" = "u" ]; then
+			useradd_params=""
+			[ "$id" != "-" ] && useradd_params="$useradd_params --uid $id"
+			[ "$comment" != "-" ] && useradd_params="$useradd_params --comment $comment"
+			useradd_params="$useradd_params --system $name"
+			eval useradd --root ${IMAGE_ROOTFS} $useradd_params || true
+		    elif [ "$type" = "g" ]; then
+			groupadd_params=""
+			[ "$id" != "-" ] && groupadd_params="$groupadd_params --gid $id"
+			groupadd_params="$groupadd_params --system $name"
+			eval groupadd --root ${IMAGE_ROOTFS} $groupadd_params || true
+		    fi
+		done
+	    done
+	fi
+}
+
+PACKAGE_EXCLUDE ??= ""
+PACKAGE_EXCLUDE[type] = "list"
+
+python rootfs_process_ignore() {
+    excl_pkgs = d.getVar("PACKAGE_EXCLUDE", True).split()
+    inst_pkgs = d.getVar("PACKAGE_INSTALL", True).split()
+    inst_attempt_pkgs = d.getVar("PACKAGE_INSTALL_ATTEMPTONLY", True).split()
+
+    d.setVar('PACKAGE_INSTALL_ORIG', ' '.join(inst_pkgs))
+    d.setVar('PACKAGE_INSTALL_ATTEMPTONLY', ' '.join(inst_attempt_pkgs))
+
+    for pkg in excl_pkgs:
+        if pkg in inst_pkgs:
+            bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL (%s).  It will be removed from the list." % (pkg, d.getVar('PN', True), inst_pkgs))
+            inst_pkgs.remove(pkg)
+
+        if pkg in inst_attempt_pkgs:
+            bb.warn("Package %s, set to be excluded, is in %s PACKAGE_INSTALL_ATTEMPTONLY (%s).  It will be removed from the list." % (pkg, d.getVar('PN', True), inst_pkgs))
+            inst_attempt_pkgs.remove(pkg)
+
+    d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs))
+    d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", ' '.join(inst_attempt_pkgs))
+}
+do_rootfs[prefuncs] += "rootfs_process_ignore"
+
+# We have to delay the runtime_mapping_rename until just before rootfs runs
+# otherwise, the multilib renaming could step in and squash any fixups that
+# may have occurred.
+python rootfs_runtime_mapping() {
+    pn = d.getVar('PN', True)
+    runtime_mapping_rename("PACKAGE_INSTALL", pn, d)
+    runtime_mapping_rename("PACKAGE_INSTALL_ATTEMPTONLY", pn, d)
+    runtime_mapping_rename("BAD_RECOMMENDATIONS", pn, d)
+}
+do_rootfs[prefuncs] += "rootfs_runtime_mapping"
+
+fakeroot python do_rootfs () {
+    from oe.rootfs import create_rootfs
+    from oe.image import create_image
+    from oe.manifest import create_manifest
+
+    # generate the initial manifest
+    create_manifest(d)
+
+    # generate rootfs
+    create_rootfs(d)
+
+    # generate final images
+    create_image(d)
+}
+
+insert_feed_uris () {
+	
+	echo "Building feeds for [${DISTRO}].."
+
+	for line in ${FEED_URIS}
+	do
+		# strip leading and trailing spaces/tabs, then split into name and uri
+		line_clean="`echo "$line"|sed 's/^[ \t]*//;s/[ \t]*$//'`"
+		feed_name="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\1/p'`"
+		feed_uri="`echo "$line_clean" | sed -n 's/\(.*\)##\(.*\)/\2/p'`"
+		
+		echo "Added $feed_name feed with URL $feed_uri"
+		
+		# insert new feed-sources
+		echo "src/gz $feed_name $feed_uri" >> ${IMAGE_ROOTFS}/etc/opkg/${feed_name}-feed.conf
+	done
+}
+
+MULTILIBRE_ALLOW_REP =. "${base_bindir}|${base_sbindir}|${bindir}|${sbindir}|${libexecdir}|${sysconfdir}|${nonarch_base_libdir}/udev|/lib/modules/[^/]*/modules.*|"
+MULTILIB_CHECK_FILE = "${WORKDIR}/multilib_check.py"
+MULTILIB_TEMP_ROOTFS = "${WORKDIR}/multilib"
+
+# This function is intended to disallow empty root password if 'debug-tweaks' is not in IMAGE_FEATURES.
+zap_empty_root_password () {
+	if [ -e ${IMAGE_ROOTFS}/etc/shadow ]; then
+		sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/shadow
+        fi
+	if [ -e ${IMAGE_ROOTFS}/etc/passwd ]; then
+		sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/passwd
+	fi
+} 
+
+# allow dropbear/openssh to accept root logins and logins from accounts with an empty password string
+ssh_allow_empty_password () {
+	if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then
+		sed -i 's/^[#[:space:]]*PermitRootLogin.*/PermitRootLogin yes/' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config
+		sed -i 's/^[#[:space:]]*PermitEmptyPasswords.*/PermitEmptyPasswords yes/' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config
+	fi
+
+	if [ -e ${IMAGE_ROOTFS}${sbindir}/dropbear ] ; then
+		if grep -q DROPBEAR_EXTRA_ARGS ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear 2>/dev/null ; then
+			if ! grep -q "DROPBEAR_EXTRA_ARGS=.*-B" ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear ; then
+				sed -i 's/^DROPBEAR_EXTRA_ARGS="*\([^"]*\)"*/DROPBEAR_EXTRA_ARGS="\1 -B"/' ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear
+			fi
+		else
+			printf '\nDROPBEAR_EXTRA_ARGS="-B"\n' >> ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear
+		fi
+	fi
+
+	if [ -d ${IMAGE_ROOTFS}${sysconfdir}/pam.d ] ; then
+		sed -i 's/nullok_secure/nullok/' ${IMAGE_ROOTFS}${sysconfdir}/pam.d/*
+	fi
+}
+
+# Disable DNS lookups, the SSH_DISABLE_DNS_LOOKUP can be overridden to allow
+# distros to choose not to take this change
+SSH_DISABLE_DNS_LOOKUP ?= " ssh_disable_dns_lookup ; "
+ROOTFS_POSTPROCESS_COMMAND_append_qemuall = "${SSH_DISABLE_DNS_LOOKUP}"
+ssh_disable_dns_lookup () {
+	if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then
+		sed -i -e 's:#UseDNS yes:UseDNS no:' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config
+	fi
+}
+
+# Enable postinst logging if debug-tweaks is enabled
+postinst_enable_logging () {
+	mkdir -p ${IMAGE_ROOTFS}${sysconfdir}/default
+	echo "POSTINST_LOGGING=1" >> ${IMAGE_ROOTFS}${sysconfdir}/default/postinst
+	echo "LOGFILE=${POSTINST_LOGFILE}" >> ${IMAGE_ROOTFS}${sysconfdir}/default/postinst
+}
+
+# Modify systemd default target
+set_systemd_default_target () {
+	if [ -d ${IMAGE_ROOTFS}${sysconfdir}/systemd/system -a -e ${IMAGE_ROOTFS}${systemd_unitdir}/system/${SYSTEMD_DEFAULT_TARGET} ]; then
+		ln -sf ${systemd_unitdir}/system/${SYSTEMD_DEFAULT_TARGET} ${IMAGE_ROOTFS}${sysconfdir}/systemd/system/default.target
+	fi
+}
+
+# If /var/volatile is not empty, we have seen problems where programs such as the
+# journal make assumptions based on the contents of /var/volatile. The journal
+# would then write to /var/volatile before it was mounted, thus hiding the
+# items previously written.
+#
+# This change is to attempt to fix those types of issues in a way that doesn't
+# affect users that may not be using /var/volatile.
+empty_var_volatile () {
+	if [ -e ${IMAGE_ROOTFS}/etc/fstab ]; then
+		match=`awk '$1 !~ "#" && $2 ~ /\/var\/volatile/{print $2}' ${IMAGE_ROOTFS}/etc/fstab 2> /dev/null`
+		if [ -n "$match" ]; then
+			find ${IMAGE_ROOTFS}/var/volatile -mindepth 1 -delete
+		fi
+	fi
+}
+
+# Turn any symbolic /sbin/init link into a file
+remove_init_link () {
+	if [ -h ${IMAGE_ROOTFS}/sbin/init ]; then
+		LINKFILE=${IMAGE_ROOTFS}`readlink ${IMAGE_ROOTFS}/sbin/init`
+		rm ${IMAGE_ROOTFS}/sbin/init
+		cp $LINKFILE ${IMAGE_ROOTFS}/sbin/init
+	fi
+}
+
+make_zimage_symlink_relative () {
+	if [ -L ${IMAGE_ROOTFS}/boot/zImage ]; then
+		(cd ${IMAGE_ROOTFS}/boot/ && for i in `ls zImage-* | sort`; do ln -sf $i zImage; done)
+	fi
+}
+
+python write_image_manifest () {
+    from oe.rootfs import image_list_installed_packages
+    with open(d.getVar('IMAGE_MANIFEST', True), 'w+') as image_manifest:
+        image_manifest.write(image_list_installed_packages(d, 'ver'))
+        image_manifest.write("\n")
+}
+
+# Can be use to create /etc/timestamp during image construction to give a reasonably 
+# sane default time setting
+rootfs_update_timestamp () {
+	date -u +%4Y%2m%2d%2H%2M%2S >${IMAGE_ROOTFS}/etc/timestamp
+}
+
+# Prevent X from being started
+rootfs_no_x_startup () {
+	if [ -f ${IMAGE_ROOTFS}/etc/init.d/xserver-nodm ]; then
+		chmod a-x ${IMAGE_ROOTFS}/etc/init.d/xserver-nodm
+	fi
+}
+
+rootfs_trim_schemas () {
+	for schema in ${IMAGE_ROOTFS}/etc/gconf/schemas/*.schemas
+	do
+		# Need this in case no files exist
+		if [ -e $schema ]; then
+			oe-trim-schemas $schema > $schema.new
+			mv $schema.new $schema
+		fi
+	done
+}
+
+rootfs_check_host_user_contaminated () {
+	contaminated="${WORKDIR}/host-user-contaminated.txt"
+	HOST_USER_UID="$(PSEUDO_UNLOAD=1 id -u)"
+	HOST_USER_GID="$(PSEUDO_UNLOAD=1 id -g)"
+
+	find "${IMAGE_ROOTFS}" -wholename "${IMAGE_ROOTFS}/home" -prune \
+	    -user "$HOST_USER_UID" -o -group "$HOST_USER_GID" >"$contaminated"
+
+	if [ -s "$contaminated" ]; then
+		echo "WARNING: Paths in the rootfs are owned by the same user or group as the user running bitbake. See the logfile for the specific paths."
+		cat "$contaminated" | sed "s,^,  ,"
+	fi
+}
+
+# Make any absolute links in a sysroot relative
+rootfs_sysroot_relativelinks () {
+	sysroot-relativelinks.py ${SDK_OUTPUT}/${SDKTARGETSYSROOT}
+}
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_install[noexec] = "1"
+do_populate_sysroot[noexec] = "1"
+do_package[noexec] = "1"
+do_package_qa[noexec] = "1"
+do_packagedata[noexec] = "1"
+do_package_write_ipk[noexec] = "1"
+do_package_write_deb[noexec] = "1"
+do_package_write_rpm[noexec] = "1"
+
+addtask rootfs before do_build
+# Allow the kernel to be repacked with the initramfs and boot image file as a single file
+do_bundle_initramfs[depends] += "virtual/kernel:do_bundle_initramfs"
+do_bundle_initramfs[nostamp] = "1"
+do_bundle_initramfs[noexec] = "1"
+do_bundle_initramfs () {
+	:
+}
+addtask bundle_initramfs after do_rootfs
diff --git a/meta/classes/image_types.bbclass b/meta/classes/image_types.bbclass
new file mode 100644
index 0000000..306403e
--- /dev/null
+++ b/meta/classes/image_types.bbclass
@@ -0,0 +1,260 @@
+
+# The default aligment of the size of the rootfs is set to 1KiB. In case
+# you're using the SD card emulation of a QEMU system simulator you may
+# set this value to 2048 (2MiB alignment).
+IMAGE_ROOTFS_ALIGNMENT ?= "1"
+
+def imagetypes_getdepends(d):
+    def adddep(depstr, deps):
+        for i in (depstr or "").split():
+            if i not in deps:
+                deps.append(i)
+
+    deps = []
+    ctypes = d.getVar('COMPRESSIONTYPES', True).split()
+    for type in (d.getVar('IMAGE_FSTYPES', True) or "").split():
+        if type in ["vmdk", "vdi", "qcow2", "live", "iso", "hddimg"]:
+            type = "ext4"
+        basetype = type
+        for ctype in ctypes:
+            if type.endswith("." + ctype):
+                basetype = type[:-len("." + ctype)]
+                adddep(d.getVar("COMPRESS_DEPENDS_%s" % ctype, True), deps)
+                break
+        for typedepends in (d.getVar("IMAGE_TYPEDEP_%s" % basetype, True) or "").split():
+            adddep(d.getVar('IMAGE_DEPENDS_%s' % typedepends, True) , deps)
+        adddep(d.getVar('IMAGE_DEPENDS_%s' % basetype, True) , deps)
+
+    depstr = ""
+    for dep in deps:
+        depstr += " " + dep + ":do_populate_sysroot"
+    return depstr
+
+
+XZ_COMPRESSION_LEVEL ?= "-e -6"
+XZ_INTEGRITY_CHECK ?= "crc32"
+XZ_THREADS ?= "-T 0"
+
+JFFS2_SUM_EXTRA_ARGS ?= ""
+IMAGE_CMD_jffs2 = "mkfs.jffs2 --root=${IMAGE_ROOTFS} --faketime --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.jffs2 ${EXTRA_IMAGECMD}"
+
+IMAGE_CMD_cramfs = "mkfs.cramfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cramfs ${EXTRA_IMAGECMD}"
+
+oe_mkext234fs () {
+	fstype=$1
+	extra_imagecmd=""
+
+	if [ $# -gt 1 ]; then
+		shift
+		extra_imagecmd=$@
+	fi
+
+	# If generating an empty image the size of the sparse block should be large
+	# enough to allocate an ext4 filesystem using 4096 bytes per inode, this is
+	# about 60K, so dd needs a minimum count of 60, with bs=1024 (bytes per IO)
+	eval local COUNT=\"0\"
+	eval local MIN_COUNT=\"60\"
+	if [ $ROOTFS_SIZE -lt $MIN_COUNT ]; then
+		eval COUNT=\"$MIN_COUNT\"
+	fi
+	# Create a sparse image block
+	dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype seek=$ROOTFS_SIZE count=$COUNT bs=1024
+	mkfs.$fstype -F $extra_imagecmd ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.$fstype -d ${IMAGE_ROOTFS}
+}
+
+IMAGE_CMD_ext2 = "oe_mkext234fs ext2 ${EXTRA_IMAGECMD}"
+IMAGE_CMD_ext3 = "oe_mkext234fs ext3 ${EXTRA_IMAGECMD}"
+IMAGE_CMD_ext4 = "oe_mkext234fs ext4 ${EXTRA_IMAGECMD}"
+
+MIN_BTRFS_SIZE ?= "16384"
+IMAGE_CMD_btrfs () {
+	if [ ${ROOTFS_SIZE} -gt ${MIN_BTRFS_SIZE} ]; then
+		dd if=/dev/zero of=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs count=${ROOTFS_SIZE} bs=1024
+		mkfs.btrfs ${EXTRA_IMAGECMD} -r ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.btrfs
+	else
+		bbfatal "Rootfs is too small for BTRFS (Rootfs Actual Size: ${ROOTFS_SIZE}, BTRFS Minimum Size: ${MIN_BTRFS_SIZE})"
+	fi
+}
+
+IMAGE_CMD_squashfs = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs ${EXTRA_IMAGECMD} -noappend"
+IMAGE_CMD_squashfs-xz = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs-xz ${EXTRA_IMAGECMD} -noappend -comp xz"
+IMAGE_CMD_squashfs-lzo = "mksquashfs ${IMAGE_ROOTFS} ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.squashfs-lzo ${EXTRA_IMAGECMD} -noappend -comp lzo"
+
+# By default, tar from the host is used, which can be quite old. If
+# you need special parameters (like --xattrs) which are only supported
+# by GNU tar upstream >= 1.27, then override that default:
+# IMAGE_CMD_TAR = "tar --xattrs --xattrs-include=*"
+# IMAGE_DEPENDS_tar_append = " tar-replacement-native"
+# EXTRANATIVEPATH += "tar-native"
+#
+# The GNU documentation does not specify whether --xattrs-include is necessary.
+# In practice, it turned out to be not needed when creating archives and
+# required when extracting, but it seems prudent to use it in both cases.
+IMAGE_CMD_TAR ?= "tar"
+IMAGE_CMD_tar = "${IMAGE_CMD_TAR} -cvf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.tar -C ${IMAGE_ROOTFS} ."
+
+do_rootfs[cleandirs] += "${WORKDIR}/cpio_append"
+IMAGE_CMD_cpio () {
+	(cd ${IMAGE_ROOTFS} && find . | cpio -o -H newc >${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)
+	if [ ! -L ${IMAGE_ROOTFS}/init -a ! -e ${IMAGE_ROOTFS}/init ]; then
+		if [ -L ${IMAGE_ROOTFS}/sbin/init -o -e ${IMAGE_ROOTFS}/sbin/init ]; then
+			ln -sf /sbin/init ${WORKDIR}/cpio_append/init
+		else
+			touch ${WORKDIR}/cpio_append/init
+		fi
+		(cd  ${WORKDIR}/cpio_append && echo ./init | cpio -oA -H newc -F ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio)
+	fi
+}
+
+ELF_KERNEL ?= "${STAGING_DIR_HOST}/usr/src/kernel/${KERNEL_IMAGETYPE}"
+ELF_APPEND ?= "ramdisk_size=32768 root=/dev/ram0 rw console="
+
+IMAGE_CMD_elf () {
+	test -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.elf && rm -f ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.elf
+	mkelfImage --kernel=${ELF_KERNEL} --initrd=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.cpio.gz --output=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.elf --append='${ELF_APPEND}' ${EXTRA_IMAGECMD}
+}
+IMAGE_TYPEDEP_elf = "cpio.gz"
+
+UBI_VOLNAME ?= "${MACHINE}-rootfs"
+
+multiubi_mkfs() {
+	local mkubifs_args="$1"
+	local ubinize_args="$2"
+	if [ -z "$3" ]; then
+		local vname=""
+	else
+		local vname="_$3"
+	fi
+
+	echo \[ubifs\] > ubinize${vname}.cfg
+	echo mode=ubi >> ubinize${vname}.cfg
+	echo image=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${vname}.rootfs.ubifs >> ubinize${vname}.cfg
+	echo vol_id=0 >> ubinize${vname}.cfg
+	echo vol_type=dynamic >> ubinize${vname}.cfg
+	echo vol_name=${UBI_VOLNAME} >> ubinize${vname}.cfg
+	echo vol_flags=autoresize >> ubinize${vname}.cfg
+	mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${vname}.rootfs.ubifs ${mkubifs_args}
+	ubinize -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}${vname}.rootfs.ubi ${ubinize_args} ubinize${vname}.cfg
+
+	# Cleanup cfg file
+	mv ubinize${vname}.cfg ${DEPLOY_DIR_IMAGE}/
+
+	# Create own symlink
+	cd ${DEPLOY_DIR_IMAGE}
+	if [ -e ${IMAGE_NAME}${vname}.rootfs.ubifs ]; then
+		ln -sf ${IMAGE_NAME}${vname}.rootfs.ubifs \
+		${IMAGE_LINK_NAME}${vname}.ubifs
+	fi
+	if [ -e ${IMAGE_NAME}${vname}.rootfs.ubi ]; then
+		ln -sf ${IMAGE_NAME}${vname}.rootfs.ubi \
+		${IMAGE_LINK_NAME}${vname}.ubi
+	fi
+	cd -
+}
+
+IMAGE_CMD_multiubi () {
+	# Split MKUBIFS_ARGS_<name> and UBINIZE_ARGS_<name>
+	for name in ${MULTIUBI_BUILD}; do
+		eval local mkubifs_args=\"\$MKUBIFS_ARGS_${name}\"
+		eval local ubinize_args=\"\$UBINIZE_ARGS_${name}\"
+
+		multiubi_mkfs "${mkubifs_args}" "${ubinize_args}" "${name}"
+	done
+}
+
+IMAGE_CMD_ubi () {
+	multiubi_mkfs "${MKUBIFS_ARGS}" "${UBINIZE_ARGS}"
+}
+
+IMAGE_CMD_ubifs = "mkfs.ubifs -r ${IMAGE_ROOTFS} -o ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ubifs ${MKUBIFS_ARGS}"
+
+IMAGE_CMD_wic () {
+	out=${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}
+	wks=${FILE_DIRNAME}/${IMAGE_BASENAME}.${MACHINE}.wks
+	[ -e $wks ] || wks=${FILE_DIRNAME}/${IMAGE_BASENAME}.wks
+	[ -e $wks ] || bbfatal "Kiskstart file $wks doesn't exist"
+	BUILDDIR=${TOPDIR} wic create $wks --vars ${STAGING_DIR_TARGET}/imgdata/ -e ${IMAGE_BASENAME} -o $out/
+	mv $out/build/${IMAGE_BASENAME}*.direct $out.rootfs.wic
+	rm -rf $out/
+}
+
+EXTRA_IMAGECMD = ""
+
+inherit siteinfo
+JFFS2_ENDIANNESS ?= "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '-l', '-b', d)}"
+JFFS2_ERASEBLOCK ?= "0x40000"
+EXTRA_IMAGECMD_jffs2 ?= "--pad ${JFFS2_ENDIANNESS} --eraseblock=${JFFS2_ERASEBLOCK} --no-cleanmarkers"
+
+# Change these if you want default mkfs behavior (i.e. create minimal inode number)
+EXTRA_IMAGECMD_ext2 ?= "-i 4096"
+EXTRA_IMAGECMD_ext3 ?= "-i 4096"
+EXTRA_IMAGECMD_ext4 ?= "-i 4096"
+EXTRA_IMAGECMD_btrfs ?= ""
+EXTRA_IMAGECMD_elf ?= ""
+
+IMAGE_DEPENDS = ""
+IMAGE_DEPENDS_jffs2 = "mtd-utils-native"
+IMAGE_DEPENDS_cramfs = "util-linux-native"
+IMAGE_DEPENDS_ext2 = "e2fsprogs-native"
+IMAGE_DEPENDS_ext3 = "e2fsprogs-native"
+IMAGE_DEPENDS_ext4 = "e2fsprogs-native"
+IMAGE_DEPENDS_btrfs = "btrfs-tools-native"
+IMAGE_DEPENDS_squashfs = "squashfs-tools-native"
+IMAGE_DEPENDS_squashfs-xz = "squashfs-tools-native"
+IMAGE_DEPENDS_squashfs-lzo = "squashfs-tools-native"
+IMAGE_DEPENDS_elf = "virtual/kernel mkelfimage-native"
+IMAGE_DEPENDS_ubi = "mtd-utils-native"
+IMAGE_DEPENDS_ubifs = "mtd-utils-native"
+IMAGE_DEPENDS_multiubi = "mtd-utils-native"
+IMAGE_DEPENDS_wic = "parted-native"
+
+# This variable is available to request which values are suitable for IMAGE_FSTYPES
+IMAGE_TYPES = " \
+    jffs2 jffs2.sum \
+    cramfs \
+    ext2 ext2.gz ext2.bz2 ext2.lzma \
+    ext3 ext3.gz \
+    ext4 ext4.gz \
+    btrfs \
+    iso \
+    hddimg \
+    squashfs squashfs-xz squashfs-lzo \
+    ubi ubifs multiubi \
+    tar tar.gz tar.bz2 tar.xz tar.lz4 \
+    cpio cpio.gz cpio.xz cpio.lzma cpio.lz4 \
+    vmdk \
+    vdi \
+    qcow2 \
+    elf \
+    wic wic.gz wic.bz2 wic.lzma \
+"
+
+COMPRESSIONTYPES = "gz bz2 lzma xz lz4 sum"
+COMPRESS_CMD_lzma = "lzma -k -f -7 ${IMAGE_NAME}.rootfs.${type}"
+COMPRESS_CMD_gz = "gzip -f -9 -c ${IMAGE_NAME}.rootfs.${type} > ${IMAGE_NAME}.rootfs.${type}.gz"
+COMPRESS_CMD_bz2 = "pbzip2 -f -k ${IMAGE_NAME}.rootfs.${type}"
+COMPRESS_CMD_xz = "xz -f -k -c ${XZ_COMPRESSION_LEVEL} ${XZ_THREADS} --check=${XZ_INTEGRITY_CHECK} ${IMAGE_NAME}.rootfs.${type} > ${IMAGE_NAME}.rootfs.${type}.xz"
+COMPRESS_CMD_lz4 = "lz4c -9 -c ${IMAGE_NAME}.rootfs.${type} > ${IMAGE_NAME}.rootfs.${type}.lz4"
+COMPRESS_CMD_sum = "sumtool -i ${IMAGE_NAME}.rootfs.${type} -o ${IMAGE_NAME}.rootfs.${type}.sum ${JFFS2_SUM_EXTRA_ARGS}"
+COMPRESS_DEPENDS_lzma = "xz-native"
+COMPRESS_DEPENDS_gz = ""
+COMPRESS_DEPENDS_bz2 = "pbzip2-native"
+COMPRESS_DEPENDS_xz = "xz-native"
+COMPRESS_DEPENDS_lz4 = "lz4-native"
+COMPRESS_DEPENDS_sum = "mtd-utils-native"
+
+RUNNABLE_IMAGE_TYPES ?= "ext2 ext3 ext4"
+RUNNABLE_MACHINE_PATTERNS ?= "qemu"
+
+DEPLOYABLE_IMAGE_TYPES ?= "hddimg iso" 
+
+# Use IMAGE_EXTENSION_xxx to map image type 'xxx' with real image file extension name(s) for Hob
+IMAGE_EXTENSION_live = "hddimg iso"
+
+# The IMAGE_TYPES_MASKED variable will be used to mask out from the IMAGE_FSTYPES,
+# images that will not be built at do_rootfs time: vmdk, vdi, qcow2, hddimg, iso, etc.
+IMAGE_TYPES_MASKED ?= ""
+
+# The WICVARS variable is used to define list of bitbake variables used in wic code
+# variables from this list is written to <image>.env file
+WICVARS ?= "BBLAYERS DEPLOY_DIR_IMAGE HDDDIR IMAGE_BASENAME IMAGE_BOOT_FILES IMAGE_LINK_NAME IMAGE_ROOTFS INITRAMFS_FSTYPES INITRD ISODIR MACHINE_ARCH ROOTFS_SIZE STAGING_DATADIR STAGING_DIR_NATIVE STAGING_LIBDIR TARGET_SYS"
diff --git a/meta/classes/image_types_uboot.bbclass b/meta/classes/image_types_uboot.bbclass
new file mode 100644
index 0000000..081bca2
--- /dev/null
+++ b/meta/classes/image_types_uboot.bbclass
@@ -0,0 +1,26 @@
+inherit image_types kernel-arch
+
+oe_mkimage () {
+    mkimage -A ${UBOOT_ARCH} -O linux -T ramdisk -C $2 -n ${IMAGE_NAME} \
+        -d ${DEPLOY_DIR_IMAGE}/$1 ${DEPLOY_DIR_IMAGE}/$1.u-boot
+    if [ x$3 = x"clean" ]; then
+        rm $1
+    fi
+}
+
+COMPRESSIONTYPES += "gz.u-boot bz2.u-boot lzma.u-boot u-boot"
+
+COMPRESS_DEPENDS_u-boot = "u-boot-mkimage-native"
+COMPRESS_CMD_u-boot      = "oe_mkimage ${IMAGE_NAME}.rootfs.${type} none"
+
+COMPRESS_DEPENDS_gz.u-boot = "u-boot-mkimage-native"
+COMPRESS_CMD_gz.u-boot      = "${COMPRESS_CMD_gz}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.gz gzip clean"
+
+COMPRESS_DEPENDS_bz2.u-boot = "u-boot-mkimage-native"
+COMPRESS_CMD_bz2.u-boot      = "${COMPRESS_CMD_bz2}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.bz2 bzip2 clean"
+
+COMPRESS_DEPENDS_lzma.u-boot = "u-boot-mkimage-native"
+COMPRESS_CMD_lzma.u-boot      = "${COMPRESS_CMD_lzma}; oe_mkimage ${IMAGE_NAME}.rootfs.${type}.lzma lzma clean"
+
+IMAGE_TYPES += "ext2.u-boot ext2.gz.u-boot ext2.bz2.u-boot ext2.lzma.u-boot ext3.gz.u-boot ext4.gz.u-boot"
+
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
new file mode 100644
index 0000000..5c8629a
--- /dev/null
+++ b/meta/classes/insane.bbclass
@@ -0,0 +1,1280 @@
+# BB Class inspired by ebuild.sh
+#
+# This class will test files after installation for certain
+# security issues and other kind of issues.
+#
+# Checks we do:
+#  -Check the ownership and permissions
+#  -Check the RUNTIME path for the $TMPDIR
+#  -Check if .la files wrongly point to workdir
+#  -Check if .pc files wrongly point to workdir
+#  -Check if packages contains .debug directories or .so files
+#   where they should be in -dev or -dbg
+#  -Check if config.log contains traces to broken autoconf tests
+#  -Check invalid characters (non-utf8) on some package metadata
+#  -Ensure that binaries in base_[bindir|sbindir|libdir] do not link
+#   into exec_prefix
+#  -Check that scripts in base_[bindir|sbindir|libdir] do not reference
+#   files under exec_prefix
+
+
+# unsafe-references-in-binaries requires prelink-rtld from
+# prelink-native, but we don't want this DEPENDS for -native builds
+QADEPENDS = "prelink-native"
+QADEPENDS_class-native = ""
+QADEPENDS_class-nativesdk = ""
+QA_SANE = "True"
+
+# Elect whether a given type of error is a warning or error, they may
+# have been set by other files.
+WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
+            textrel already-stripped incompatible-license files-invalid \
+            installed-vs-shipped compile-host-path install-host-path \
+            pn-overrides infodir build-deps file-rdeps \
+            unknown-configure-option symlink-to-sysroot multilib \
+            invalid-pkgconfig host-user-contaminated \
+            "
+ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
+            perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
+            split-strip packages-list pkgv-undefined var-undefined \
+            version-going-backwards expanded-d invalid-chars \
+            "
+FAKEROOT_QA = "host-user-contaminated"
+FAKEROOT_QA[doc] = "QA tests which need to run under fakeroot. If any \
+enabled tests are listed here, the do_package_qa task will run under fakeroot."
+
+ALL_QA = "${WARN_QA} ${ERROR_QA}"
+
+UNKNOWN_CONFIGURE_WHITELIST ?= "--enable-nls --disable-nls --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot"
+
+#
+# dictionary for elf headers
+#
+# feel free to add and correct.
+#
+#           TARGET_OS  TARGET_ARCH   MACHINE, OSABI, ABIVERSION, Little Endian, 32bit?
+def package_qa_get_machine_dict():
+    return {
+            "darwin9" : { 
+                        "arm" :       (40,     0,    0,          True,          32),
+                      },
+            "eabi" : {
+                        "arm" :       (40,     0,    0,          True,          32),
+                      },
+            "elf" : {
+                        "i586" :      (3,      0,    0,          True,          32),
+                        "x86_64":     (62,     0,    0,          True,          64),
+                        "epiphany":   (4643,   0,    0,          True,          32),
+                      },
+            "linux" : { 
+                        "aarch64" :   (183,    0,    0,          True,          64),
+                        "aarch64_be" :(183,    0,    0,          False,         64),
+                        "arm" :       (40,    97,    0,          True,          32),
+                        "armeb":      (40,    97,    0,          False,         32),
+                        "powerpc":    (20,     0,    0,          False,         32),
+                        "powerpc64":  (21,     0,    0,          False,         64),
+                        "i386":       ( 3,     0,    0,          True,          32),
+                        "i486":       ( 3,     0,    0,          True,          32),
+                        "i586":       ( 3,     0,    0,          True,          32),
+                        "i686":       ( 3,     0,    0,          True,          32),
+                        "x86_64":     (62,     0,    0,          True,          64),
+                        "ia64":       (50,     0,    0,          True,          64),
+                        "alpha":      (36902,  0,    0,          True,          64),
+                        "hppa":       (15,     3,    0,          False,         32),
+                        "m68k":       ( 4,     0,    0,          False,         32),
+                        "mips":       ( 8,     0,    0,          False,         32),
+                        "mipsel":     ( 8,     0,    0,          True,          32),
+                        "mips64":     ( 8,     0,    0,          False,         64),
+                        "mips64el":   ( 8,     0,    0,          True,          64),
+                        "s390":       (22,     0,    0,          False,         32),
+                        "sh4":        (42,     0,    0,          True,          32),
+                        "sparc":      ( 2,     0,    0,          False,         32),
+                        "microblaze":  (189,   0,    0,          False,         32),
+                        "microblazeeb":(189,   0,    0,          False,         32),
+                        "microblazeel":(189,   0,    0,          True,          32),
+                      },
+            "linux-uclibc" : { 
+                        "arm" :       (  40,    97,    0,          True,          32),
+                        "armeb":      (  40,    97,    0,          False,         32),
+                        "powerpc":    (  20,     0,    0,          False,         32),
+                        "i386":       (   3,     0,    0,          True,          32),
+                        "i486":       (   3,     0,    0,          True,          32),
+                        "i586":       (   3,     0,    0,          True,          32),
+                        "i686":       (   3,     0,    0,          True,          32),
+                        "x86_64":     (  62,     0,    0,          True,          64),
+                        "mips":       (   8,     0,    0,          False,         32),
+                        "mipsel":     (   8,     0,    0,          True,          32),
+                        "mips64":     (   8,     0,    0,          False,         64),
+                        "mips64el":   (   8,     0,    0,          True,          64),
+                        "avr32":      (6317,     0,    0,          False,         32),
+                        "sh4":        (42,       0,    0,          True,          32),
+
+                      },
+            "linux-musl" : { 
+                        "aarch64" :   (183,    0,    0,            True,          64),
+                        "aarch64_be" :(183,    0,    0,            False,         64),
+                        "arm" :       (  40,    97,    0,          True,          32),
+                        "armeb":      (  40,    97,    0,          False,         32),
+                        "powerpc":    (  20,     0,    0,          False,         32),
+                        "i386":       (   3,     0,    0,          True,          32),
+                        "i486":       (   3,     0,    0,          True,          32),
+                        "i586":       (   3,     0,    0,          True,          32),
+                        "i686":       (   3,     0,    0,          True,          32),
+                        "x86_64":     (  62,     0,    0,          True,          64),
+                        "mips":       (   8,     0,    0,          False,         32),
+                        "mipsel":     (   8,     0,    0,          True,          32),
+                        "mips64":     (   8,     0,    0,          False,         64),
+                        "mips64el":   (   8,     0,    0,          True,          64),
+                      },
+            "uclinux-uclibc" : {
+                        "bfin":       ( 106,     0,    0,          True,         32),
+                      }, 
+            "linux-gnueabi" : {
+                        "arm" :       (40,     0,    0,          True,          32),
+                        "armeb" :     (40,     0,    0,          False,         32),
+                      },
+            "linux-musleabi" : {
+                        "arm" :       (40,     0,    0,          True,          32),
+                        "armeb" :     (40,     0,    0,          False,         32),
+                      },
+            "linux-uclibceabi" : {
+                        "arm" :       (40,     0,    0,          True,          32),
+                        "armeb" :     (40,     0,    0,          False,         32),
+                      },
+            "linux-gnuspe" : {
+                        "powerpc":    (20,     0,    0,          False,         32),
+                      },
+            "linux-muslspe" : {
+                        "powerpc":    (20,     0,    0,          False,         32),
+                      },
+            "linux-uclibcspe" : {
+                        "powerpc":    (20,     0,    0,          False,         32),
+                      },
+            "linux-gnu" :       {
+                        "powerpc":    (20,     0,    0,          False,         32),
+                        "sh4":        (42,     0,    0,          True,          32),
+                      },
+            "linux-gnux32" :       {
+                        "x86_64":     (62,     0,    0,          True,          32),
+                      },
+            "linux-gnun32" :       {
+                        "mips64":       ( 8,     0,    0,          False,         32),
+                        "mips64el":     ( 8,     0,    0,          True,          32),
+                      },
+        }
+
+
+def package_qa_clean_path(path,d):
+    """ Remove the common prefix from the path. In this case it is the TMPDIR"""
+    return path.replace(d.getVar('TMPDIR',True),"")
+
+def package_qa_write_error(type, error, d):
+    logfile = d.getVar('QA_LOGFILE', True)
+    if logfile:
+        p = d.getVar('P', True)
+        f = file( logfile, "a+")
+        print >> f, "%s: %s [%s]" % (p, error, type)
+        f.close()
+
+def package_qa_handle_error(error_class, error_msg, d):
+    package_qa_write_error(error_class, error_msg, d)
+    if error_class in (d.getVar("ERROR_QA", True) or "").split():
+        bb.error("QA Issue: %s [%s]" % (error_msg, error_class))
+        d.setVar("QA_SANE", False)
+        return False
+    elif error_class in (d.getVar("WARN_QA", True) or "").split():
+        bb.warn("QA Issue: %s [%s]" % (error_msg, error_class))
+    else:
+        bb.note("QA Issue: %s [%s]" % (error_msg, error_class))
+    return True
+
+QAPATHTEST[libexec] = "package_qa_check_libexec"
+def package_qa_check_libexec(path,name, d, elf, messages):
+
+    # Skip the case where the default is explicitly /usr/libexec
+    libexec = d.getVar('libexecdir', True)
+    if libexec == "/usr/libexec":
+        return True
+
+    if 'libexec' in path.split(os.path.sep):
+        messages["libexec"] = "%s: %s is using libexec please relocate to %s" % (name, package_qa_clean_path(path, d), libexec)
+        return False
+
+    return True
+
+QAPATHTEST[rpaths] = "package_qa_check_rpath"
+def package_qa_check_rpath(file,name, d, elf, messages):
+    """
+    Check for dangerous RPATHs
+    """
+    if not elf:
+        return
+
+    if os.path.islink(file):
+        return
+
+    bad_dirs = [d.getVar('BASE_WORKDIR', True), d.getVar('STAGING_DIR_TARGET', True)]
+
+    phdrs = elf.run_objdump("-p", d)
+
+    import re
+    rpath_re = re.compile("\s+RPATH\s+(.*)")
+    for line in phdrs.split("\n"):
+        m = rpath_re.match(line)
+        if m:
+            rpath = m.group(1)
+            for dir in bad_dirs:
+                if dir in rpath:
+                    messages["rpaths"] = "package %s contains bad RPATH %s in file %s" % (name, rpath, file)
+
+QAPATHTEST[useless-rpaths] = "package_qa_check_useless_rpaths"
+def package_qa_check_useless_rpaths(file, name, d, elf, messages):
+    """
+    Check for RPATHs that are useless but not dangerous
+    """
+    def rpath_eq(a, b):
+        return os.path.normpath(a) == os.path.normpath(b)
+
+    if not elf:
+        return
+
+    if os.path.islink(file):
+        return
+
+    libdir = d.getVar("libdir", True)
+    base_libdir = d.getVar("base_libdir", True)
+
+    phdrs = elf.run_objdump("-p", d)
+
+    import re
+    rpath_re = re.compile("\s+RPATH\s+(.*)")
+    for line in phdrs.split("\n"):
+        m = rpath_re.match(line)
+        if m:
+            rpath = m.group(1)
+            if rpath_eq(rpath, libdir) or rpath_eq(rpath, base_libdir):
+                # The dynamic linker searches both these places anyway.  There is no point in
+                # looking there again.
+                messages["useless-rpaths"] = "%s: %s contains probably-redundant RPATH %s" % (name, package_qa_clean_path(file, d), rpath)
+
+QAPATHTEST[dev-so] = "package_qa_check_dev"
+def package_qa_check_dev(path, name, d, elf, messages):
+    """
+    Check for ".so" library symlinks in non-dev packages
+    """
+
+    if not name.endswith("-dev") and not name.endswith("-dbg") and not name.endswith("-ptest") and not name.startswith("nativesdk-") and path.endswith(".so") and os.path.islink(path):
+        messages["dev-so"] = "non -dev/-dbg/nativesdk- package contains symlink .so: %s path '%s'" % \
+                 (name, package_qa_clean_path(path,d))
+
+QAPATHTEST[staticdev] = "package_qa_check_staticdev"
+def package_qa_check_staticdev(path, name, d, elf, messages):
+    """
+    Check for ".a" library in non-staticdev packages
+    There are a number of exceptions to this rule, -pic packages can contain
+    static libraries, the _nonshared.a belong with their -dev packages and
+    libgcc.a, libgcov.a will be skipped in their packages
+    """
+
+    if not name.endswith("-pic") and not name.endswith("-staticdev") and not name.endswith("-ptest") and path.endswith(".a") and not path.endswith("_nonshared.a"):
+        messages["staticdev"] = "non -staticdev package contains static .a library: %s path '%s'" % \
+                 (name, package_qa_clean_path(path,d))
+
+def package_qa_check_libdir(d):
+    """
+    Check for wrong library installation paths. For instance, catch
+    recipes installing /lib/bar.so when ${base_libdir}="lib32" or
+    installing in /usr/lib64 when ${libdir}="/usr/lib"
+    """
+    import re
+
+    pkgdest = d.getVar('PKGDEST', True)
+    base_libdir = d.getVar("base_libdir",True) + os.sep
+    libdir = d.getVar("libdir", True) + os.sep
+    exec_prefix = d.getVar("exec_prefix", True) + os.sep
+
+    messages = []
+
+    lib_re = re.compile("^/lib.+\.so(\..+)?$")
+    exec_re = re.compile("^%s.*/lib.+\.so(\..+)?$" % exec_prefix)
+
+    for root, dirs, files in os.walk(pkgdest):
+        if root == pkgdest:
+            # Skip subdirectories for any packages with libdir in INSANE_SKIP
+            skippackages = []
+            for package in dirs:
+                if 'libdir' in (d.getVar('INSANE_SKIP_' + package, True) or "").split():
+                    bb.note("Package %s skipping libdir QA test" % (package))
+                    skippackages.append(package)
+            for package in skippackages:
+                dirs.remove(package)
+        for file in files:
+            full_path = os.path.join(root, file)
+            rel_path = os.path.relpath(full_path, pkgdest)
+            if os.sep in rel_path:
+                package, rel_path = rel_path.split(os.sep, 1)
+                rel_path = os.sep + rel_path
+                if lib_re.match(rel_path):
+                    if base_libdir not in rel_path:
+                        messages.append("%s: found library in wrong location: %s" % (package, rel_path))
+                if exec_re.match(rel_path):
+                    if libdir not in rel_path:
+                        messages.append("%s: found library in wrong location: %s" % (package, rel_path))
+
+    if messages:
+        package_qa_handle_error("libdir", "\n".join(messages), d)
+
+QAPATHTEST[debug-files] = "package_qa_check_dbg"
+def package_qa_check_dbg(path, name, d, elf, messages):
+    """
+    Check for ".debug" files or directories outside of the dbg package
+    """
+
+    if not "-dbg" in name and not "-ptest" in name:
+        if '.debug' in path.split(os.path.sep):
+            messages["debug-files"] = "non debug package contains .debug directory: %s path %s" % \
+                     (name, package_qa_clean_path(path,d))
+
+QAPATHTEST[perms] = "package_qa_check_perm"
+def package_qa_check_perm(path,name,d, elf, messages):
+    """
+    Check the permission of files
+    """
+    return
+
+QAPATHTEST[unsafe-references-in-binaries] = "package_qa_check_unsafe_references_in_binaries"
+def package_qa_check_unsafe_references_in_binaries(path, name, d, elf, messages):
+    """
+    Ensure binaries in base_[bindir|sbindir|libdir] do not link to files under exec_prefix
+    """
+    if unsafe_references_skippable(path, name, d):
+        return
+
+    if elf:
+        import subprocess as sub
+        pn = d.getVar('PN', True)
+
+        exec_prefix = d.getVar('exec_prefix', True)
+        sysroot_path = d.getVar('STAGING_DIR_TARGET', True)
+        sysroot_path_usr = sysroot_path + exec_prefix
+
+        try:
+            ldd_output = bb.process.Popen(["prelink-rtld", "--root", sysroot_path, path], stdout=sub.PIPE).stdout.read()
+        except bb.process.CmdError:
+            error_msg = pn + ": prelink-rtld aborted when processing %s" % path
+            package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
+            return False
+
+        if sysroot_path_usr in ldd_output:
+            ldd_output = ldd_output.replace(sysroot_path, "")
+
+            pkgdest = d.getVar('PKGDEST', True)
+            packages = d.getVar('PACKAGES', True)
+
+            for package in packages.split():
+                short_path = path.replace('%s/%s' % (pkgdest, package), "", 1)
+                if (short_path != path):
+                    break
+
+            base_err = pn + ": %s, installed in the base_prefix, requires a shared library under exec_prefix (%s)" % (short_path, exec_prefix)
+            for line in ldd_output.split('\n'):
+                if exec_prefix in line:
+                    error_msg = "%s: %s" % (base_err, line.strip())
+                    package_qa_handle_error("unsafe-references-in-binaries", error_msg, d)
+
+            return False
+
+QAPATHTEST[unsafe-references-in-scripts] = "package_qa_check_unsafe_references_in_scripts"
+def package_qa_check_unsafe_references_in_scripts(path, name, d, elf, messages):
+    """
+    Warn if scripts in base_[bindir|sbindir|libdir] reference files under exec_prefix
+    """
+    if unsafe_references_skippable(path, name, d):
+        return
+
+    if not elf:
+        import stat
+        import subprocess
+        pn = d.getVar('PN', True)
+
+        # Ensure we're checking an executable script
+        statinfo = os.stat(path)
+        if bool(statinfo.st_mode & stat.S_IXUSR):
+            # grep shell scripts for possible references to /exec_prefix/
+            exec_prefix = d.getVar('exec_prefix', True)
+            statement = "grep -e '%s/' %s > /dev/null" % (exec_prefix, path)
+            if subprocess.call(statement, shell=True) == 0:
+                error_msg = pn + ": Found a reference to %s/ in %s" % (exec_prefix, path)
+                package_qa_handle_error("unsafe-references-in-scripts", error_msg, d)
+                error_msg = "Shell scripts in base_bindir and base_sbindir should not reference anything in exec_prefix"
+                package_qa_handle_error("unsafe-references-in-scripts", error_msg, d)
+
+def unsafe_references_skippable(path, name, d):
+    if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d):
+        return True
+
+    if "-dbg" in name or "-dev" in name:
+        return True
+
+    # Other package names to skip:
+    if name.startswith("kernel-module-"):
+        return True
+
+    # Skip symlinks
+    if os.path.islink(path):
+        return True
+
+    # Skip unusual rootfs layouts which make these tests irrelevant
+    exec_prefix = d.getVar('exec_prefix', True)
+    if exec_prefix == "":
+        return True
+
+    pkgdest = d.getVar('PKGDEST', True)
+    pkgdest = pkgdest + "/" + name
+    pkgdest = os.path.abspath(pkgdest)
+    base_bindir = pkgdest + d.getVar('base_bindir', True)
+    base_sbindir = pkgdest + d.getVar('base_sbindir', True)
+    base_libdir = pkgdest + d.getVar('base_libdir', True)
+    bindir = pkgdest + d.getVar('bindir', True)
+    sbindir = pkgdest + d.getVar('sbindir', True)
+    libdir = pkgdest + d.getVar('libdir', True)
+
+    if base_bindir == bindir and base_sbindir == sbindir and base_libdir == libdir:
+        return True
+
+    # Skip files not in base_[bindir|sbindir|libdir]
+    path = os.path.abspath(path)
+    if not (base_bindir in path or base_sbindir in path or base_libdir in path):
+        return True
+
+    return False
+
+QAPATHTEST[arch] = "package_qa_check_arch"
+def package_qa_check_arch(path,name,d, elf, messages):
+    """
+    Check if archs are compatible
+    """
+    if not elf:
+        return
+
+    target_os   = d.getVar('TARGET_OS', True)
+    target_arch = d.getVar('TARGET_ARCH', True)
+    provides = d.getVar('PROVIDES', True)
+    bpn = d.getVar('BPN', True)
+
+    if target_arch == "allarch":
+        pn = d.getVar('PN', True)
+        messages["arch"] = pn + ": Recipe inherits the allarch class, but has packaged architecture-specific binaries"
+        return
+
+    # FIXME: Cross package confuse this check, so just skip them
+    for s in ['cross', 'nativesdk', 'cross-canadian']:
+        if bb.data.inherits_class(s, d):
+            return
+
+    # avoid following links to /usr/bin (e.g. on udev builds)
+    # we will check the files pointed to anyway...
+    if os.path.islink(path):
+        return
+
+    #if this will throw an exception, then fix the dict above
+    (machine, osabi, abiversion, littleendian, bits) \
+        = package_qa_get_machine_dict()[target_os][target_arch]
+
+    # Check the architecture and endiannes of the binary
+    if not ((machine == elf.machine()) or \
+        ((("virtual/kernel" in provides) or bb.data.inherits_class("module", d) ) and (target_os == "linux-gnux32" or target_os == "linux-gnun32"))):
+        messages["arch"] = "Architecture did not match (%d to %d) on %s" % \
+                 (machine, elf.machine(), package_qa_clean_path(path,d))
+    elif not ((bits == elf.abiSize()) or  \
+        ((("virtual/kernel" in provides) or bb.data.inherits_class("module", d) ) and (target_os == "linux-gnux32" or target_os == "linux-gnun32"))):
+        messages["arch"] = "Bit size did not match (%d to %d) %s on %s" % \
+                 (bits, elf.abiSize(), bpn, package_qa_clean_path(path,d))
+    elif not littleendian == elf.isLittleEndian():
+        messages["arch"] = "Endiannes did not match (%d to %d) on %s" % \
+                 (littleendian, elf.isLittleEndian(), package_qa_clean_path(path,d))
+
+QAPATHTEST[desktop] = "package_qa_check_desktop"
+def package_qa_check_desktop(path, name, d, elf, messages):
+    """
+    Run all desktop files through desktop-file-validate.
+    """
+    if path.endswith(".desktop"):
+        desktop_file_validate = os.path.join(d.getVar('STAGING_BINDIR_NATIVE',True),'desktop-file-validate')
+        output = os.popen("%s %s" % (desktop_file_validate, path))
+        # This only produces output on errors
+        for l in output:
+            messages["desktop"] = "Desktop file issue: " + l.strip()
+
+QAPATHTEST[textrel] = "package_qa_textrel"
+def package_qa_textrel(path, name, d, elf, messages):
+    """
+    Check if the binary contains relocations in .text
+    """
+
+    if not elf:
+        return
+
+    if os.path.islink(path):
+        return
+
+    phdrs = elf.run_objdump("-p", d)
+    sane = True
+
+    import re
+    textrel_re = re.compile("\s+TEXTREL\s+")
+    for line in phdrs.split("\n"):
+        if textrel_re.match(line):
+            sane = False
+
+    if not sane:
+        messages["textrel"] = "ELF binary '%s' has relocations in .text" % path
+
+QAPATHTEST[ldflags] = "package_qa_hash_style"
+def package_qa_hash_style(path, name, d, elf, messages):
+    """
+    Check if the binary has the right hash style...
+    """
+
+    if not elf:
+        return
+
+    if os.path.islink(path):
+        return
+
+    gnu_hash = "--hash-style=gnu" in d.getVar('LDFLAGS', True)
+    if not gnu_hash:
+        gnu_hash = "--hash-style=both" in d.getVar('LDFLAGS', True)
+    if not gnu_hash:
+        return
+
+    sane = False
+    has_syms = False
+
+    phdrs = elf.run_objdump("-p", d)
+
+    # If this binary has symbols, we expect it to have GNU_HASH too.
+    for line in phdrs.split("\n"):
+        if "SYMTAB" in line:
+            has_syms = True
+        if "GNU_HASH" in line:
+            sane = True
+        if "[mips32]" in line or "[mips64]" in line:
+            sane = True
+
+    if has_syms and not sane:
+        messages["ldflags"] = "No GNU_HASH in the elf binary: '%s'" % path
+
+
+QAPATHTEST[buildpaths] = "package_qa_check_buildpaths"
+def package_qa_check_buildpaths(path, name, d, elf, messages):
+    """
+    Check for build paths inside target files and error if not found in the whitelist
+    """
+    # Ignore .debug files, not interesting
+    if path.find(".debug") != -1:
+        return
+
+    # Ignore symlinks
+    if os.path.islink(path):
+        return
+
+    tmpdir = d.getVar('TMPDIR', True)
+    with open(path) as f:
+        file_content = f.read()
+        if tmpdir in file_content:
+            messages["buildpaths"] = "File %s in package contained reference to tmpdir" % package_qa_clean_path(path,d)
+
+
+QAPATHTEST[xorg-driver-abi] = "package_qa_check_xorg_driver_abi"
+def package_qa_check_xorg_driver_abi(path, name, d, elf, messages):
+    """
+    Check that all packages containing Xorg drivers have ABI dependencies
+    """
+
+    # Skip dev, dbg or nativesdk packages
+    if name.endswith("-dev") or name.endswith("-dbg") or name.startswith("nativesdk-"):
+        return
+
+    driverdir = d.expand("${libdir}/xorg/modules/drivers/")
+    if driverdir in path and path.endswith(".so"):
+        mlprefix = d.getVar('MLPREFIX', True) or ''
+        for rdep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + name, True) or ""):
+            if rdep.startswith("%sxorg-abi-" % mlprefix):
+                return
+        messages["xorg-driver-abi"] = "Package %s contains Xorg driver (%s) but no xorg-abi- dependencies" % (name, os.path.basename(path))
+
+QAPATHTEST[infodir] = "package_qa_check_infodir"
+def package_qa_check_infodir(path, name, d, elf, messages):
+    """
+    Check that /usr/share/info/dir isn't shipped in a particular package
+    """
+    infodir = d.expand("${infodir}/dir")
+
+    if infodir in path:
+        messages["infodir"] = "The /usr/share/info/dir file is not meant to be shipped in a particular package."
+
+QAPATHTEST[symlink-to-sysroot] = "package_qa_check_symlink_to_sysroot"
+def package_qa_check_symlink_to_sysroot(path, name, d, elf, messages):
+    """
+    Check that the package doesn't contain any absolute symlinks to the sysroot.
+    """
+    if os.path.islink(path):
+        target = os.readlink(path)
+        if os.path.isabs(target):
+            tmpdir = d.getVar('TMPDIR', True)
+            if target.startswith(tmpdir):
+                trimmed = path.replace(os.path.join (d.getVar("PKGDEST", True), name), "")
+                messages["symlink-to-sysroot"] = "Symlink %s in %s points to TMPDIR" % (trimmed, name)
+def package_qa_check_license(workdir, d):
+    """
+    Check for changes in the license files 
+    """
+    import tempfile
+    sane = True
+
+    lic_files = d.getVar('LIC_FILES_CHKSUM', True)
+    lic = d.getVar('LICENSE', True)
+    pn = d.getVar('PN', True)
+
+    if lic == "CLOSED":
+        return True
+
+    if not lic_files:
+        bb.error(pn + ": Recipe file does not have license file information (LIC_FILES_CHKSUM)")
+        return False
+
+    srcdir = d.getVar('S', True)
+
+    for url in lic_files.split():
+        try:
+            (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
+        except bb.fetch.MalformedUrl:
+            raise bb.build.FuncFailed( pn + ": LIC_FILES_CHKSUM contains an invalid URL: " + url)
+        srclicfile = os.path.join(srcdir, path)
+        if not os.path.isfile(srclicfile):
+            raise bb.build.FuncFailed( pn + ": LIC_FILES_CHKSUM points to an invalid file: " + srclicfile)
+
+        recipemd5 = parm.get('md5', '')
+        beginline, endline = 0, 0
+        if 'beginline' in parm:
+            beginline = int(parm['beginline'])
+        if 'endline' in parm:
+            endline = int(parm['endline'])
+
+        if (not beginline) and (not endline):
+            md5chksum = bb.utils.md5_file(srclicfile)
+        else:
+            fi = open(srclicfile, 'rb')
+            fo = tempfile.NamedTemporaryFile(mode='wb', prefix='poky.', suffix='.tmp', delete=False)
+            tmplicfile = fo.name;
+            lineno = 0
+            linesout = 0
+            for line in fi:
+                lineno += 1
+                if (lineno >= beginline): 
+                    if ((lineno <= endline) or not endline):
+                        fo.write(line)
+                        linesout += 1
+                    else:
+                        break
+            fo.flush()
+            fo.close()
+            fi.close()
+            md5chksum = bb.utils.md5_file(tmplicfile)
+            os.unlink(tmplicfile)
+
+        if recipemd5 == md5chksum:
+            bb.note (pn + ": md5 checksum matched for ", url)
+        else:
+            if recipemd5:
+                bb.error(pn + ": md5 data is not matching for ", url)
+                bb.error(pn + ": The new md5 checksum is ", md5chksum)
+                if beginline:
+                    if endline:
+                        srcfiledesc = "%s (lines %d through to %d)" % (srclicfile, beginline, endline)
+                    else:
+                        srcfiledesc = "%s (beginning on line %d)" % (srclicfile, beginline)
+                elif endline:
+                    srcfiledesc = "%s (ending on line %d)" % (srclicfile, endline)
+                else:
+                    srcfiledesc = srclicfile
+                bb.error(pn + ": Check if the license information has changed in %s to verify that the LICENSE value \"%s\" remains valid" % (srcfiledesc, lic))
+            else:
+                bb.error(pn + ": md5 checksum is not specified for ", url)
+                bb.error(pn + ": The md5 checksum is ", md5chksum)
+            sane = False
+
+    return sane
+
+def package_qa_check_staged(path,d):
+    """
+    Check staged la and pc files for sanity
+      -e.g. installed being false
+
+        As this is run after every stage we should be able
+        to find the one responsible for the errors easily even
+        if we look at every .pc and .la file
+    """
+
+    sane = True
+    tmpdir = d.getVar('TMPDIR', True)
+    workdir = os.path.join(tmpdir, "work")
+
+    installed = "installed=yes"
+    if bb.data.inherits_class("native", d) or bb.data.inherits_class("cross", d):
+        pkgconfigcheck = workdir
+    else:
+        pkgconfigcheck = tmpdir
+
+    # find all .la and .pc files
+    # read the content
+    # and check for stuff that looks wrong
+    for root, dirs, files in os.walk(path):
+        for file in files:
+            path = os.path.join(root,file)
+            if file.endswith(".la"):
+                with open(path) as f:
+                    file_content = f.read()
+                    if workdir in file_content:
+                        error_msg = "%s failed sanity test (workdir) in path %s" % (file,root)
+                        sane = package_qa_handle_error("la", error_msg, d)
+            elif file.endswith(".pc"):
+                with open(path) as f:
+                    file_content = f.read()
+                    if pkgconfigcheck in file_content:
+                        error_msg = "%s failed sanity test (tmpdir) in path %s" % (file,root)
+                        sane = package_qa_handle_error("pkgconfig", error_msg, d)
+
+    return sane
+
+# Walk over all files in a directory and call func
+def package_qa_walk(path, warnfuncs, errorfuncs, skip, package, d):
+    import oe.qa
+
+    #if this will throw an exception, then fix the dict above
+    target_os   = d.getVar('TARGET_OS', True)
+    target_arch = d.getVar('TARGET_ARCH', True)
+
+    warnings = {}
+    errors = {}
+    for path in pkgfiles[package]:
+            elf = oe.qa.ELFFile(path)
+            try:
+                elf.open()
+            except:
+                elf = None
+            for func in warnfuncs:
+                func(path, package, d, elf, warnings)
+            for func in errorfuncs:
+                func(path, package, d, elf, errors)
+
+    for w in warnings:
+        package_qa_handle_error(w, warnings[w], d)
+    for e in errors:
+        package_qa_handle_error(e, errors[e], d)
+
+    return len(errors) == 0
+
+def package_qa_check_rdepends(pkg, pkgdest, skip, taskdeps, packages, d):
+    # Don't do this check for kernel/module recipes, there aren't too many debug/development
+    # packages and you can get false positives e.g. on kernel-module-lirc-dev
+    if bb.data.inherits_class("kernel", d) or bb.data.inherits_class("module-base", d):
+        return True
+
+    sane = True
+    if not "-dbg" in pkg and not "packagegroup-" in pkg and not "-image" in pkg:
+        localdata = bb.data.createCopy(d)
+        localdata.setVar('OVERRIDES', pkg)
+        bb.data.update_data(localdata)
+
+        # Now check the RDEPENDS
+        rdepends = bb.utils.explode_deps(localdata.getVar('RDEPENDS', True) or "")
+
+        # Now do the sanity check!!!
+        if "build-deps" not in skip:
+            for rdepend in rdepends:
+                if "-dbg" in rdepend and "debug-deps" not in skip:
+                    error_msg = "%s rdepends on %s" % (pkg,rdepend)
+                    sane = package_qa_handle_error("debug-deps", error_msg, d)
+                if (not "-dev" in pkg and not "-staticdev" in pkg) and rdepend.endswith("-dev") and "dev-deps" not in skip:
+                    error_msg = "%s rdepends on %s" % (pkg, rdepend)
+                    sane = package_qa_handle_error("dev-deps", error_msg, d)
+                if rdepend not in packages:
+                    rdep_data = oe.packagedata.read_subpkgdata(rdepend, d)
+                    if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps:
+                        continue
+                    if not rdep_data or not 'PN' in rdep_data:
+                        pkgdata_dir = d.getVar("PKGDATA_DIR", True)
+                        try:
+                            possibles = os.listdir("%s/runtime-rprovides/%s/" % (pkgdata_dir, rdepend))
+                        except OSError:
+                            possibles = []
+                        for p in possibles:
+                            rdep_data = oe.packagedata.read_subpkgdata(p, d)
+                            if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps:
+                                break
+                    if rdep_data and 'PN' in rdep_data and rdep_data['PN'] in taskdeps:
+                        continue
+                    error_msg = "%s rdepends on %s, but it isn't a build dependency?" % (pkg, rdepend)
+                    sane = package_qa_handle_error("build-deps", error_msg, d)
+
+        if "file-rdeps" not in skip:
+            ignored_file_rdeps = set(['/bin/sh', '/usr/bin/env', 'rtld(GNU_HASH)'])
+            if bb.data.inherits_class('nativesdk', d):
+                ignored_file_rdeps |= set(['/bin/bash', '/usr/bin/perl'])
+            # For Saving the FILERDEPENDS
+            filerdepends = {}
+            rdep_data = oe.packagedata.read_subpkgdata(pkg, d)
+            for key in rdep_data:
+                if key.startswith("FILERDEPENDS_"):
+                    for subkey in rdep_data[key].split():
+                        if subkey not in ignored_file_rdeps:
+                            # We already know it starts with FILERDEPENDS_
+                            filerdepends[subkey] = key[13:]
+
+            if filerdepends:
+                next = rdepends
+                done = rdepends[:]
+                # Find all the rdepends on the dependency chain
+                while next:
+                    new = []
+                    for rdep in next:
+                        rdep_data = oe.packagedata.read_subpkgdata(rdep, d)
+                        sub_rdeps = rdep_data.get("RDEPENDS_" + rdep)
+                        if not sub_rdeps:
+                            continue
+                        for sub_rdep in sub_rdeps.split():
+                            if sub_rdep in done:
+                                continue
+                            if not sub_rdep.startswith('(') and \
+                                    oe.packagedata.has_subpkgdata(sub_rdep, d):
+                                # It's a new rdep
+                                done.append(sub_rdep)
+                                new.append(sub_rdep)
+                    next = new
+
+                # Add the rprovides of itself
+                if pkg not in done:
+                    done.insert(0, pkg)
+
+                # The python is not a package, but python-core provides it, so
+                # skip checking /usr/bin/python if python is in the rdeps, in
+                # case there is a RDEPENDS_pkg = "python" in the recipe.
+                for py in [ d.getVar('MLPREFIX', True) + "python", "python" ]:
+                    if py in done:
+                        filerdepends.pop("/usr/bin/python",None)
+                        done.remove(py)
+                for rdep in done:
+                    # For Saving the FILERPROVIDES, RPROVIDES and FILES_INFO
+                    rdep_data = oe.packagedata.read_subpkgdata(rdep, d)
+                    for key in rdep_data:
+                        if key.startswith("FILERPROVIDES_") or key.startswith("RPROVIDES_"):
+                            for subkey in rdep_data[key].split():
+                                filerdepends.pop(subkey,None)
+                        # Add the files list to the rprovides
+                        if key == "FILES_INFO":
+                            # Use eval() to make it as a dict
+                            for subkey in eval(rdep_data[key]):
+                                filerdepends.pop(subkey,None)
+                    if not filerdepends:
+                        # Break if all the file rdepends are met
+                        break
+            if filerdepends:
+                for key in filerdepends:
+                    error_msg = "%s contained in package %s requires %s, but no providers found in its RDEPENDS" % \
+                            (filerdepends[key],pkg, key)
+                sane = package_qa_handle_error("file-rdeps", error_msg, d)
+
+    return sane
+
+def package_qa_check_deps(pkg, pkgdest, skip, d):
+    sane = True
+
+    localdata = bb.data.createCopy(d)
+    localdata.setVar('OVERRIDES', pkg)
+    bb.data.update_data(localdata)
+
+    def check_valid_deps(var):
+        sane = True
+        try:
+            rvar = bb.utils.explode_dep_versions2(localdata.getVar(var, True) or "")
+        except ValueError as e:
+            bb.fatal("%s_%s: %s" % (var, pkg, e))
+        for dep in rvar:
+            for v in rvar[dep]:
+                if v and not v.startswith(('< ', '= ', '> ', '<= ', '>=')):
+                    error_msg = "%s_%s is invalid: %s (%s)   only comparisons <, =, >, <=, and >= are allowed" % (var, pkg, dep, v)
+                    sane = package_qa_handle_error("dep-cmp", error_msg, d)
+        return sane
+
+    sane = True
+    if not check_valid_deps('RDEPENDS'):
+        sane = False
+    if not check_valid_deps('RRECOMMENDS'):
+        sane = False
+    if not check_valid_deps('RSUGGESTS'):
+        sane = False
+    if not check_valid_deps('RPROVIDES'):
+        sane = False
+    if not check_valid_deps('RREPLACES'):
+        sane = False
+    if not check_valid_deps('RCONFLICTS'):
+        sane = False
+
+    return sane
+
+QAPATHTEST[expanded-d] = "package_qa_check_expanded_d"
+def package_qa_check_expanded_d(path,name,d,elf,messages):
+    """
+    Check for the expanded D (${D}) value in pkg_* and FILES
+    variables, warn the user to use it correctly.
+    """
+
+    sane = True
+    expanded_d = d.getVar('D',True)
+
+    # Get packages for current recipe and iterate
+    packages = d.getVar('PACKAGES', True).split(" ")
+    for pak in packages:
+    # Go through all variables and check if expanded D is found, warn the user accordingly
+        for var in 'FILES','pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm':
+            bbvar = d.getVar(var + "_" + pak, False)
+            if bbvar:
+                # Bitbake expands ${D} within bbvar during the previous step, so we check for its expanded value
+                if expanded_d in bbvar:
+                    if var == 'FILES':
+                        messages["expanded-d"] = "FILES in %s recipe should not contain the ${D} variable as it references the local build directory not the target filesystem, best solution is to remove the ${D} reference" % pak
+                        sane = False
+                    else:
+                        messages["expanded-d"] = "%s in %s recipe contains ${D}, it should be replaced by $D instead" % (var, pak)
+                        sane = False
+    return sane
+
+def package_qa_check_encoding(keys, encode, d):
+    def check_encoding(key,enc):
+        sane = True
+        value = d.getVar(key, True)
+        if value:
+            try:
+                s = unicode(value, enc)
+            except UnicodeDecodeError as e:
+                error_msg = "%s has non %s characters" % (key,enc)
+                sane = False
+                package_qa_handle_error("invalid-chars", error_msg, d)
+        return sane
+
+    for key in keys:
+        sane = check_encoding(key, encode)
+        if not sane:
+            break
+
+HOST_USER_UID := "${@os.getuid()}"
+HOST_USER_GID := "${@os.getgid()}"
+
+QAPATHTEST[host-user-contaminated] = "package_qa_check_host_user"
+def package_qa_check_host_user(path, name, d, elf, messages):
+    """Check for paths outside of /home which are owned by the user running bitbake."""
+
+    if not os.path.lexists(path):
+        return
+
+    dest = d.getVar('PKGDEST', True)
+    home = os.path.join(dest, 'home')
+    if path == home or path.startswith(home + os.sep):
+        return
+
+    try:
+        stat = os.lstat(path)
+    except OSError as exc:
+        import errno
+        if exc.errno != errno.ENOENT:
+            raise
+    else:
+        check_uid = int(d.getVar('HOST_USER_UID', True))
+        if stat.st_uid == check_uid:
+            messages["host-user-contaminated"] = "%s is owned by uid %d, which is the same as the user running bitbake. This may be due to host contamination" % (path, check_uid)
+            return False
+
+        check_gid = int(d.getVar('HOST_USER_GID', True))
+        if stat.st_gid == check_gid:
+            messages["host-user-contaminated"] = "%s is owned by gid %d, which is the same as the user running bitbake. This may be due to host contamination" % (path, check_gid)
+            return False
+    return True
+
+# The PACKAGE FUNC to scan each package
+python do_package_qa () {
+    import subprocess
+    import oe.packagedata
+
+    bb.note("DO PACKAGE QA")
+
+    bb.build.exec_func("read_subpackage_metadata", d)
+
+    # Check non UTF-8 characters on recipe's metadata
+    package_qa_check_encoding(['DESCRIPTION', 'SUMMARY', 'LICENSE', 'SECTION'], 'utf-8', d)
+
+    logdir = d.getVar('T', True)
+    pkg = d.getVar('PN', True)
+
+    # Check the compile log for host contamination
+    compilelog = os.path.join(logdir,"log.do_compile")
+
+    if os.path.exists(compilelog):
+        statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % compilelog
+        if subprocess.call(statement, shell=True) == 0:
+            msg = "%s: The compile log indicates that host include and/or library paths were used.\n \
+        Please check the log '%s' for more information." % (pkg, compilelog)
+            package_qa_handle_error("compile-host-path", msg, d)
+
+    # Check the install log for host contamination
+    installlog = os.path.join(logdir,"log.do_install")
+
+    if os.path.exists(installlog):
+        statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % installlog
+        if subprocess.call(statement, shell=True) == 0:
+            msg = "%s: The install log indicates that host include and/or library paths were used.\n \
+        Please check the log '%s' for more information." % (pkg, installlog)
+            package_qa_handle_error("install-host-path", msg, d)
+
+    # Scan the packages...
+    pkgdest = d.getVar('PKGDEST', True)
+    packages = set((d.getVar('PACKAGES', True) or '').split())
+
+    cpath = oe.cachedpath.CachedPath()
+    global pkgfiles
+    pkgfiles = {}
+    for pkg in packages:
+        pkgfiles[pkg] = []
+        for walkroot, dirs, files in cpath.walk(pkgdest + "/" + pkg):
+            for file in files:
+                pkgfiles[pkg].append(walkroot + os.sep + file)
+
+    # no packages should be scanned
+    if not packages:
+        return
+
+    testmatrix = d.getVarFlags("QAPATHTEST")
+    import re
+    # The package name matches the [a-z0-9.+-]+ regular expression
+    pkgname_pattern = re.compile("^[a-z0-9.+-]+$")
+
+    taskdepdata = d.getVar("BB_TASKDEPDATA", False)
+    taskdeps = set()
+    for dep in taskdepdata:
+        taskdeps.add(taskdepdata[dep][0])
+
+    g = globals()
+    walk_sane = True
+    rdepends_sane = True
+    deps_sane = True
+    for package in packages:
+        skip = (d.getVar('INSANE_SKIP_' + package, True) or "").split()
+        if skip:
+            bb.note("Package %s skipping QA tests: %s" % (package, str(skip)))
+        warnchecks = []
+        for w in (d.getVar("WARN_QA", True) or "").split():
+            if w in skip:
+               continue
+            if w in testmatrix and testmatrix[w] in g:
+                warnchecks.append(g[testmatrix[w]])
+        errorchecks = []
+        for e in (d.getVar("ERROR_QA", True) or "").split():
+            if e in skip:
+               continue
+            if e in testmatrix and testmatrix[e] in g:
+                errorchecks.append(g[testmatrix[e]])
+
+        bb.note("Checking Package: %s" % package)
+        # Check package name
+        if not pkgname_pattern.match(package):
+            package_qa_handle_error("pkgname",
+                    "%s doesn't match the [a-z0-9.+-]+ regex\n" % package, d)
+
+        path = "%s/%s" % (pkgdest, package)
+        if not package_qa_walk(path, warnchecks, errorchecks, skip, package, d):
+            walk_sane  = False
+        if not package_qa_check_rdepends(package, pkgdest, skip, taskdeps, packages, d):
+            rdepends_sane = False
+        if not package_qa_check_deps(package, pkgdest, skip, d):
+            deps_sane = False
+
+
+    if 'libdir' in d.getVar("ALL_QA", True).split():
+        package_qa_check_libdir(d)
+
+    qa_sane = d.getVar("QA_SANE", True)
+    if not walk_sane or not rdepends_sane or not deps_sane or not qa_sane:
+        bb.fatal("QA run found fatal errors. Please consider fixing them.")
+    bb.note("DONE with PACKAGE QA")
+}
+
+do_package_qa[rdeptask] = "do_packagedata"
+addtask do_package_qa after do_packagedata do_package before do_build
+
+SSTATETASKS += "do_package_qa"
+do_package_qa[sstate-inputdirs] = ""
+do_package_qa[sstate-outputdirs] = ""
+python do_package_qa_setscene () {
+    sstate_setscene(d)
+}
+addtask do_package_qa_setscene
+
+python do_qa_staging() {
+    bb.note("QA checking staging")
+
+    if not package_qa_check_staged(d.expand('${SYSROOT_DESTDIR}${STAGING_LIBDIR}'), d):
+        bb.fatal("QA staging was broken by the package built above")
+}
+
+python do_qa_configure() {
+    import subprocess
+
+    ###########################################################################
+    # Check config.log for cross compile issues
+    ###########################################################################
+
+    configs = []
+    workdir = d.getVar('WORKDIR', True)
+    bb.note("Checking autotools environment for common misconfiguration")
+    for root, dirs, files in os.walk(workdir):
+        statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % \
+                    os.path.join(root,"config.log")
+        if "config.log" in files:
+            if subprocess.call(statement, shell=True) == 0:
+                bb.fatal("""This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
+Rerun configure task after fixing this. The path was '%s'""" % root)
+
+        if "configure.ac" in files:
+            configs.append(os.path.join(root,"configure.ac"))
+        if "configure.in" in files:
+            configs.append(os.path.join(root, "configure.in"))
+
+    ###########################################################################
+    # Check gettext configuration and dependencies are correct
+    ###########################################################################
+
+    cnf = d.getVar('EXTRA_OECONF', True) or ""
+    if "gettext" not in d.getVar('P', True) and "gcc-runtime" not in d.getVar('P', True) and "--disable-nls" not in cnf:
+        ml = d.getVar("MLPREFIX", True) or ""
+        if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk', d):
+            gt = "gettext-native"
+        elif bb.data.inherits_class('cross-canadian', d):
+            gt = "nativesdk-gettext"
+        else:
+            gt = "virtual/" + ml + "gettext"
+        deps = bb.utils.explode_deps(d.getVar('DEPENDS', True) or "")
+        if gt not in deps:
+            for config in configs:
+                gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config
+                if subprocess.call(gnu, shell=True) == 0:
+                    bb.fatal("""%s required but not in DEPENDS for file %s.
+Missing inherit gettext?""" % (gt, config))
+
+    ###########################################################################
+    # Check license variables
+    ###########################################################################
+
+    if not package_qa_check_license(workdir, d):
+        bb.fatal("Licensing Error: LIC_FILES_CHKSUM does not match, please fix")
+
+    ###########################################################################
+    # Check unrecognised configure options (with a white list)
+    ###########################################################################
+    if bb.data.inherits_class("autotools", d):
+        bb.note("Checking configure output for unrecognised options")
+        try:
+            flag = "WARNING: unrecognized options:"
+            log = os.path.join(d.getVar('B', True), 'config.log')
+            output = subprocess.check_output(['grep', '-F', flag, log]).replace(', ', ' ')
+            options = set()
+            for line in output.splitlines():
+                options |= set(line.partition(flag)[2].split())
+            whitelist = set(d.getVar("UNKNOWN_CONFIGURE_WHITELIST", True).split())
+            options -= whitelist
+            if options:
+                pn = d.getVar('PN', True)
+                error_msg = pn + ": configure was passed unrecognised options: " + " ".join(options)
+                package_qa_handle_error("unknown-configure-option", error_msg, d)
+        except subprocess.CalledProcessError:
+            pass
+
+    # Check invalid PACKAGECONFIG
+    pkgconfig = (d.getVar("PACKAGECONFIG", True) or "").split()
+    if pkgconfig:
+        pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
+        for pconfig in pkgconfig:
+            if pconfig not in pkgconfigflags:
+                pn = d.getVar('PN', True)
+                error_msg = "%s: invalid PACKAGECONFIG: %s" % (pn, pconfig)
+                package_qa_handle_error("invalid-pkgconfig", error_msg, d)
+}
+
+python do_qa_unpack() {
+    bb.note("Checking has ${S} been created")
+
+    s_dir = d.getVar('S', True)
+    if not os.path.exists(s_dir):
+        bb.warn('%s: the directory %s (%s) pointed to by the S variable doesn\'t exist - please set S within the recipe to point to where the source has been unpacked to' % (d.getVar('PN', True), d.getVar('S', False), s_dir))
+}
+
+# The Staging Func, to check all staging
+#addtask qa_staging after do_populate_sysroot before do_build
+do_populate_sysroot[postfuncs] += "do_qa_staging "
+
+# Check broken config.log files, for packages requiring Gettext which don't
+# have it in DEPENDS and for correct LIC_FILES_CHKSUM
+#addtask qa_configure after do_configure before do_compile
+do_configure[postfuncs] += "do_qa_configure "
+
+# Check does S exist.
+do_unpack[postfuncs] += "do_qa_unpack"
+
+python () {
+    tests = d.getVar('ALL_QA', True).split()
+    if "desktop" in tests:
+        d.appendVar("PACKAGE_DEPENDS", " desktop-file-utils-native")
+
+    ###########################################################################
+    # Check various variables
+    ###########################################################################
+
+    # Checking ${FILESEXTRAPATHS}
+    extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "")
+    if '__default' not in extrapaths.split(":"):
+        msg = "FILESEXTRAPATHS-variable, must always use _prepend (or _append)\n"
+        msg += "type of assignment, and don't forget the colon.\n"
+        msg += "Please assign it with the format of:\n"
+        msg += "  FILESEXTRAPATHS_append := \":${THISDIR}/Your_Files_Path\" or\n"
+        msg += "  FILESEXTRAPATHS_prepend := \"${THISDIR}/Your_Files_Path:\"\n"
+        msg += "in your bbappend file\n\n"
+        msg += "Your incorrect assignment is:\n"
+        msg += "%s\n" % extrapaths
+        bb.warn(msg)
+
+    if d.getVar('do_stage', True) is not None:
+        bb.fatal("Legacy staging found for %s as it has a do_stage function. This will need conversion to a do_install or often simply removal to work with OE-core" % d.getVar("FILE", True))
+
+    overrides = d.getVar('OVERRIDES', True).split(':')
+    pn = d.getVar('PN', True)
+    if pn in overrides:
+        msg = 'Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE", True), pn)
+        package_qa_handle_error("pn-overrides", msg, d)
+
+    issues = []
+    if (d.getVar('PACKAGES', True) or "").split():
+        for dep in (d.getVar('QADEPENDS', True) or "").split():
+            d.appendVarFlag('do_package_qa', 'depends', " %s:do_populate_sysroot" % dep)
+        for var in 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RCONFLICTS', 'RPROVIDES', 'RREPLACES', 'FILES', 'pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm', 'ALLOW_EMPTY':
+            if d.getVar(var, False):
+                issues.append(var)
+
+        fakeroot_tests = d.getVar('FAKEROOT_QA', True).split()
+        if set(tests) & set(fakeroot_tests):
+            d.setVarFlag('do_package_qa', 'fakeroot', '1')
+            d.appendVarFlag('do_package_qa', 'depends', ' virtual/fakeroot-native:do_populate_sysroot')
+    else:
+        d.setVarFlag('do_package_qa', 'rdeptask', '')
+    for i in issues:
+        package_qa_handle_error("pkgvarcheck", "%s: Variable %s is set as not being package specific, please fix this." % (d.getVar("FILE", True), i), d)
+}
diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass
new file mode 100644
index 0000000..211b72b
--- /dev/null
+++ b/meta/classes/kernel-arch.bbclass
@@ -0,0 +1,59 @@
+#
+# set the ARCH environment variable for kernel compilation (including
+# modules). return value must match one of the architecture directories
+# in the kernel source "arch" directory
+#
+
+valid_archs = "alpha cris ia64 \
+               i386 x86 \
+               m68knommu m68k ppc powerpc powerpc64 ppc64  \
+               sparc sparc64 \
+               arm aarch64 \
+               m32r mips \
+               sh sh64 um h8300   \
+               parisc s390  v850 \
+               avr32 blackfin \
+               microblaze"
+
+def map_kernel_arch(a, d):
+    import re
+
+    valid_archs = d.getVar('valid_archs', True).split()
+
+    if   re.match('(i.86|athlon|x86.64)$', a):  return 'x86'
+    elif re.match('armeb$', a):                 return 'arm'
+    elif re.match('aarch64$', a):               return 'arm64'
+    elif re.match('aarch64_be$', a):            return 'arm64'
+    elif re.match('mips(el|64|64el)$', a):      return 'mips'
+    elif re.match('p(pc|owerpc)(|64)', a):      return 'powerpc'
+    elif re.match('sh(3|4)$', a):               return 'sh'
+    elif re.match('bfin', a):                   return 'blackfin'
+    elif re.match('microblazee[bl]', a):        return 'microblaze'
+    elif a in valid_archs:                      return a
+    else:
+        bb.error("cannot map '%s' to a linux kernel architecture" % a)
+
+export ARCH = "${@map_kernel_arch(d.getVar('TARGET_ARCH', True), d)}"
+
+def map_uboot_arch(a, d):
+    import re
+
+    if   re.match('p(pc|owerpc)(|64)', a): return 'ppc'
+    elif re.match('i.86$', a): return 'x86'
+    return a
+
+export UBOOT_ARCH = "${@map_uboot_arch(d.getVar('ARCH', True), d)}"
+
+# Set TARGET_??_KERNEL_ARCH in the machine .conf to set architecture
+# specific options necessary for building the kernel and modules.
+TARGET_CC_KERNEL_ARCH ?= ""
+HOST_CC_KERNEL_ARCH ?= "${TARGET_CC_KERNEL_ARCH}"
+TARGET_LD_KERNEL_ARCH ?= ""
+HOST_LD_KERNEL_ARCH ?= "${TARGET_LD_KERNEL_ARCH}"
+TARGET_AR_KERNEL_ARCH ?= ""
+HOST_AR_KERNEL_ARCH ?= "${TARGET_AR_KERNEL_ARCH}"
+
+KERNEL_CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_KERNEL_ARCH} -fuse-ld=bfd"
+KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
+KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
+
diff --git a/meta/classes/kernel-fitimage.bbclass b/meta/classes/kernel-fitimage.bbclass
new file mode 100644
index 0000000..2a56a54
--- /dev/null
+++ b/meta/classes/kernel-fitimage.bbclass
@@ -0,0 +1,234 @@
+inherit kernel-uboot
+
+python __anonymous () {
+    kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
+    if kerneltype == 'fitImage':
+        depends = d.getVar("DEPENDS", True)
+        depends = "%s u-boot-mkimage-native dtc-native" % depends
+        d.setVar("DEPENDS", depends)
+
+	# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
+	# to kernel.bbclass . We have to override it, since we pack zImage
+	# (at least for now) into the fitImage .
+        d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", "zImage")
+
+        image = d.getVar('INITRAMFS_IMAGE', True)
+        if image:
+            d.appendVarFlag('do_assemble_fitimage', 'depends', ' ${INITRAMFS_IMAGE}:do_rootfs')
+}
+
+#
+# Emit the fitImage ITS header
+#
+fitimage_emit_fit_header() {
+	cat << EOF >> fit-image.its
+/dts-v1/;
+
+/ {
+        description = "U-Boot fitImage for ${DISTRO_NAME}/${PV}/${MACHINE}";
+        #address-cells = <1>;
+EOF
+}
+
+#
+# Emit the fitImage section bits
+#
+# $1 ... Section bit type: imagestart - image section start
+#                          confstart  - configuration section start
+#                          sectend    - section end
+#                          fitend     - fitimage end
+#
+fitimage_emit_section_maint() {
+	case $1 in
+	imagestart)
+		cat << EOF >> fit-image.its
+
+        images {
+EOF
+	;;
+	confstart)
+		cat << EOF >> fit-image.its
+
+        configurations {
+EOF
+	;;
+	sectend)
+		cat << EOF >> fit-image.its
+	};
+EOF
+	;;
+	fitend)
+		cat << EOF >> fit-image.its
+};
+EOF
+	;;
+	esac
+}
+
+#
+# Emit the fitImage ITS kernel section
+#
+# $1 ... Image counter
+# $2 ... Path to kernel image
+# $3 ... Compression type
+fitimage_emit_section_kernel() {
+
+	kernel_csum="sha1"
+
+	ENTRYPOINT=${UBOOT_ENTRYPOINT}
+	if test -n "${UBOOT_ENTRYSYMBOL}"; then
+		ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
+			awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
+	fi
+
+	cat << EOF >> fit-image.its
+                kernel@${1} {
+                        description = "Linux kernel";
+                        data = /incbin/("${2}");
+                        type = "kernel";
+                        arch = "${UBOOT_ARCH}";
+                        os = "linux";
+                        compression = "${3}";
+                        load = <${UBOOT_LOADADDRESS}>;
+                        entry = <${ENTRYPOINT}>;
+                        hash@1 {
+                                algo = "${kernel_csum}";
+                        };
+                };
+EOF
+}
+
+#
+# Emit the fitImage ITS DTB section
+#
+# $1 ... Image counter
+# $2 ... Path to DTB image
+fitimage_emit_section_dtb() {
+
+	dtb_csum="sha1"
+
+	cat << EOF >> fit-image.its
+                fdt@${1} {
+                        description = "Flattened Device Tree blob";
+                        data = /incbin/("${2}");
+                        type = "flat_dt";
+                        arch = "${UBOOT_ARCH}";
+                        compression = "none";
+                        hash@1 {
+                                algo = "${dtb_csum}";
+                        };
+                };
+EOF
+}
+
+#
+# Emit the fitImage ITS configuration section
+#
+# $1 ... Linux kernel ID
+# $2 ... DTB image ID
+fitimage_emit_section_config() {
+
+	conf_csum="sha1"
+
+	# Test if we have any DTBs at all
+	if [ -z "${2}" ] ; then
+		conf_desc="Boot Linux kernel"
+		fdt_line=""
+	else
+		conf_desc="Boot Linux kernel with FDT blob"
+		fdt_line="fdt = \"fdt@${2}\";"
+	fi
+	kernel_line="kernel = \"kernel@${1}\";"
+
+	cat << EOF >> fit-image.its
+                default = "conf@1";
+                conf@1 {
+                        description = "${conf_desc}";
+			${kernel_line}
+			${fdt_line}
+                        hash@1 {
+                                algo = "${conf_csum}";
+                        };
+                };
+EOF
+}
+
+do_assemble_fitimage() {
+	if test "x${KERNEL_IMAGETYPE}" = "xfitImage" ; then
+		kernelcount=1
+		dtbcount=""
+		rm -f fit-image.its
+
+		fitimage_emit_fit_header
+
+		#
+		# Step 1: Prepare a kernel image section.
+		#
+		fitimage_emit_section_maint imagestart
+
+		uboot_prep_kimage
+		fitimage_emit_section_kernel "${kernelcount}" linux.bin "${linux_comp}"
+
+		#
+		# Step 2: Prepare a DTB image section
+		#
+		if test -n "${KERNEL_DEVICETREE}"; then
+			dtbcount=1
+			for DTB in ${KERNEL_DEVICETREE}; do
+				if echo ${DTB} | grep -q '/dts/'; then
+					bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+					DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+				fi
+				DTB_PATH="arch/${ARCH}/boot/dts/${DTB}"
+				if [ ! -e "${DTB_PATH}" ]; then
+					DTB_PATH="arch/${ARCH}/boot/${DTB}"
+				fi
+
+				fitimage_emit_section_dtb ${dtbcount} ${DTB_PATH}
+				dtbcount=`expr ${dtbcount} + 1`
+			done
+		fi
+
+		fitimage_emit_section_maint sectend
+
+		# Force the first Kernel and DTB in the default config
+		kernelcount=1
+		dtbcount=1
+
+		#
+		# Step 3: Prepare a configurations section
+		#
+		fitimage_emit_section_maint confstart
+
+		fitimage_emit_section_config ${kernelcount} ${dtbcount}
+
+		fitimage_emit_section_maint sectend
+
+		fitimage_emit_section_maint fitend
+
+		#
+		# Step 4: Assemble the image
+		#
+		uboot-mkimage -f fit-image.its arch/${ARCH}/boot/fitImage
+	fi
+}
+
+addtask assemble_fitimage before do_install after do_compile
+
+kernel_do_deploy_append() {
+	# Update deploy directory
+	if test "x${KERNEL_IMAGETYPE}" = "xfitImage" ; then
+		cd ${B}
+		echo "Copying fit-image.its source file..."
+		its_base_name="${KERNEL_IMAGETYPE}-its-${PV}-${PR}-${MACHINE}-${DATETIME}"
+		its_symlink_name=${KERNEL_IMAGETYPE}-its-${MACHINE}
+		install -m 0644 fit-image.its ${DEPLOYDIR}/${its_base_name}.its
+		linux_bin_base_name="${KERNEL_IMAGETYPE}-linux.bin-${PV}-${PR}-${MACHINE}-${DATETIME}"
+		linux_bin_symlink_name=${KERNEL_IMAGETYPE}-linux.bin-${MACHINE}
+		install -m 0644 linux.bin ${DEPLOYDIR}/${linux_bin_base_name}.bin
+
+		cd ${DEPLOYDIR}
+		ln -sf ${its_base_name}.its ${its_symlink_name}.its
+		ln -sf ${linux_bin_base_name}.bin ${linux_bin_symlink_name}.bin
+	fi
+}
diff --git a/meta/classes/kernel-grub.bbclass b/meta/classes/kernel-grub.bbclass
new file mode 100644
index 0000000..a63f482
--- /dev/null
+++ b/meta/classes/kernel-grub.bbclass
@@ -0,0 +1,91 @@
+#
+# While installing a rpm to update kernel on a deployed target, it will update
+# the boot area and the boot menu with the kernel as the priority but allow
+# you to fall back to the original kernel as well.
+#
+# - In kernel-image's preinstall scriptlet, it backs up original kernel to avoid
+#   probable confliction with the new one.
+#
+# - In kernel-image's postinstall scriptlet, it modifies grub's config file to
+#   updates the new kernel as the boot priority.
+#
+
+pkg_preinst_kernel-image_append () {
+	# Parsing confliction
+	[ -f "$D/boot/grub/menu.list" ] && grubcfg="$D/boot/grub/menu.list"
+	[ -f "$D/boot/grub/grub.cfg" ] && grubcfg="$D/boot/grub/grub.cfg"
+	if [ -n "$grubcfg" ]; then
+		# Dereference symlink to avoid confliction with new kernel name.
+		if grep -q "/${KERNEL_IMAGETYPE} \+root=" $grubcfg; then
+			if [ -L "$D/boot/${KERNEL_IMAGETYPE}" ]; then
+				kimage=`realpath $D/boot/${KERNEL_IMAGETYPE} 2>/dev/null`
+				if [ -f "$D$kimage" ]; then
+					sed -i "s:${KERNEL_IMAGETYPE} \+root=:${kimage##*/} root=:" $grubcfg
+				fi
+			fi
+		fi
+
+		# Rename old kernel if it conflicts with new kernel name.
+		if grep -q "/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} \+root=" $grubcfg; then
+			if [ -f "$D/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}" ]; then
+				timestamp=`date +%s`
+				kimage="$D/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}-$timestamp-back"
+				sed -i "s:${KERNEL_IMAGETYPE}-${KERNEL_VERSION} \+root=:${kimage##*/} root=:" $grubcfg
+				mv "$D/boot/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}" "$kimage"
+			fi
+		fi
+	fi
+}
+
+pkg_postinst_kernel-image_prepend () {
+	get_new_grub_cfg() {
+		grubcfg="$1"
+		old_image="$2"
+		title="Update ${KERNEL_IMAGETYPE}-${KERNEL_VERSION}-${PV}"
+		if [ "${grubcfg##*/}" = "grub.cfg" ]; then
+			rootfs=`grep " *linux \+[^ ]\+ \+root=" $grubcfg -m 1 | \
+				 sed "s#${old_image}#${old_image%/*}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}#"`
+
+			echo "menuentry \"$title\" {"
+			echo "    set root=(hd0,1)"
+			echo "$rootfs"
+			echo "}"
+		elif [ "${grubcfg##*/}" = "menu.list" ]; then
+			rootfs=`grep "kernel \+[^ ]\+ \+root=" $grubcfg -m 1 | \
+				 sed "s#${old_image}#${old_image%/*}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}#"`
+
+			echo "default 0"
+			echo "timeout 30"
+			echo "title $title"
+			echo "root  (hd0,0)"
+			echo "$rootfs"
+		fi
+	}
+
+	get_old_grub_cfg() {
+		grubcfg="$1"
+		if [ "${grubcfg##*/}" = "grub.cfg" ]; then
+			cat "$grubcfg"
+		elif [ "${grubcfg##*/}" = "menu.list" ]; then
+			sed -e '/^default/d' -e '/^timeout/d' "$grubcfg"
+		fi
+	}
+
+	if [ -f "$D/boot/grub/grub.cfg" ]; then
+		grubcfg="$D/boot/grub/grub.cfg"
+		old_image=`grep ' *linux \+[^ ]\+ \+root=' -m 1 "$grubcfg" | awk '{print $2}'`
+	elif [ -f "$D/boot/grub/menu.list" ]; then
+		grubcfg="$D/boot/grub/menu.list"
+		old_image=`grep '^kernel \+[^ ]\+ \+root=' -m 1 "$grubcfg" | awk '{print $2}'`
+	fi
+
+	# Don't update grubcfg at first install while old bzImage doesn't exist.
+	if [ -f "$D/boot/${old_image##*/}" ]; then
+		grubcfgtmp="$grubcfg.tmp"
+		get_new_grub_cfg "$grubcfg" "$old_image"  > $grubcfgtmp
+		get_old_grub_cfg "$grubcfg" >> $grubcfgtmp
+		mv $grubcfgtmp $grubcfg
+		echo "Caution! Update kernel may affect kernel-module!"
+	fi
+}
+
diff --git a/meta/classes/kernel-module-split.bbclass b/meta/classes/kernel-module-split.bbclass
new file mode 100644
index 0000000..e1a70e6
--- /dev/null
+++ b/meta/classes/kernel-module-split.bbclass
@@ -0,0 +1,203 @@
+pkg_postinst_modules () {
+if [ -z "$D" ]; then
+	depmod -a ${KERNEL_VERSION}
+else
+	# image.bbclass will call depmodwrapper after everything is installed,
+	# no need to do it here as well
+	:
+fi
+}
+
+pkg_postrm_modules () {
+if [ -z "$D" ]; then
+	depmod -a ${KERNEL_VERSION}
+else
+	depmodwrapper -a -b $D ${KERNEL_VERSION}
+fi
+}
+
+autoload_postinst_fragment() {
+if [ x"$D" = "x" ]; then
+	modprobe %s || true
+fi
+}
+
+do_install_append() {
+	install -d ${D}${sysconfdir}/modules-load.d/ ${D}${sysconfdir}/modprobe.d/
+}
+
+PACKAGESPLITFUNCS_prepend = "split_kernel_module_packages "
+
+KERNEL_MODULES_META_PACKAGE ?= "kernel-modules"
+
+python split_kernel_module_packages () {
+    import re
+
+    modinfoexp = re.compile("([^=]+)=(.*)")
+    kerverrexp = re.compile('^(.*-hh.*)[\.\+].*$')
+    depmodpat0 = re.compile("^(.*\.k?o):..*$")
+    depmodpat1 = re.compile("^(.*\.k?o):\s*(.*\.k?o)\s*$")
+    depmodpat2 = re.compile("^(.*\.k?o):\s*(.*\.k?o)\s*\\\$")
+    depmodpat3 = re.compile("^\t(.*\.k?o)\s*\\\$")
+    depmodpat4 = re.compile("^\t(.*\.k?o)\s*$")
+
+    def extract_modinfo(file):
+        import tempfile, subprocess
+        tempfile.tempdir = d.getVar("WORKDIR", True)
+        tf = tempfile.mkstemp()
+        tmpfile = tf[1]
+        cmd = "%sobjcopy -j .modinfo -O binary %s %s" % (d.getVar("HOST_PREFIX", True) or "", file, tmpfile)
+        subprocess.call(cmd, shell=True)
+        f = open(tmpfile)
+        l = f.read().split("\000")
+        f.close()
+        os.close(tf[0])
+        os.unlink(tmpfile)
+        vals = {}
+        for i in l:
+            m = modinfoexp.match(i)
+            if not m:
+                continue
+            vals[m.group(1)] = m.group(2)
+        return vals
+
+    def parse_depmod():
+
+        dvar = d.getVar('PKGD', True)
+
+        kernelver = d.getVar('KERNEL_VERSION', True)
+        kernelver_stripped = kernelver
+        m = kerverrexp.match(kernelver)
+        if m:
+            kernelver_stripped = m.group(1)
+        staging_kernel_dir = d.getVar("STAGING_KERNEL_BUILDDIR", True)
+        system_map_file = "%s/boot/System.map-%s" % (dvar, kernelver)
+        if not os.path.exists(system_map_file):
+            system_map_file = "%s/System.map-%s" % (staging_kernel_dir, kernelver)
+            if not os.path.exists(system_map_file):
+                bb.fatal("System.map-%s does not exist in '%s/boot' nor STAGING_KERNEL_BUILDDIR '%s'" % (kernelver, dvar, staging_kernel_dir))
+
+        cmd = "depmod -n -a -b %s -F %s %s" % (dvar, system_map_file, kernelver_stripped)
+        f = os.popen(cmd, 'r')
+
+        deps = {}
+        line = f.readline()
+        while line:
+            if not depmodpat0.match(line):
+                line = f.readline()
+                continue
+            m1 = depmodpat1.match(line)
+            if m1:
+                deps[m1.group(1)] = m1.group(2).split()
+            else:
+                m2 = depmodpat2.match(line)
+                if m2:
+                    deps[m2.group(1)] = m2.group(2).split()
+                    line = f.readline()
+                    m3 = depmodpat3.match(line)
+                    while m3:
+                        deps[m2.group(1)].extend(m3.group(1).split())
+                        line = f.readline()
+                        m3 = depmodpat3.match(line)
+                    m4 = depmodpat4.match(line)
+                    deps[m2.group(1)].extend(m4.group(1).split())
+            line = f.readline()
+        f.close()
+        return deps
+
+    def get_dependencies(file, pattern, format):
+        # file no longer includes PKGD
+        file = file.replace(d.getVar('PKGD', True) or '', '', 1)
+        # instead is prefixed with /lib/modules/${KERNEL_VERSION}
+        file = file.replace("/lib/modules/%s/" % d.getVar('KERNEL_VERSION', True) or '', '', 1)
+
+        if file in module_deps:
+            dependencies = []
+            for i in module_deps[file]:
+                m = re.match(pattern, os.path.basename(i))
+                if not m:
+                    continue
+                on = legitimize_package_name(m.group(1))
+                dependency_pkg = format % on
+                dependencies.append(dependency_pkg)
+            return dependencies
+        return []
+
+    def frob_metadata(file, pkg, pattern, format, basename):
+        vals = extract_modinfo(file)
+
+        dvar = d.getVar('PKGD', True)
+
+        # If autoloading is requested, output /etc/modules-load.d/<name>.conf and append
+        # appropriate modprobe commands to the postinst
+        autoloadlist = (d.getVar("KERNEL_MODULE_AUTOLOAD", True) or "").split()
+        autoload = d.getVar('module_autoload_%s' % basename, True)
+        if autoload and autoload == basename:
+            bb.warn("module_autoload_%s was replaced by KERNEL_MODULE_AUTOLOAD for cases where basename == module name, please drop it" % basename)
+        if autoload and basename not in autoloadlist:
+            bb.warn("module_autoload_%s is defined but '%s' isn't included in KERNEL_MODULE_AUTOLOAD, please add it there" % (basename, basename))
+        if basename in autoloadlist:
+            name = '%s/etc/modules-load.d/%s.conf' % (dvar, basename)
+            f = open(name, 'w')
+            if autoload:
+                for m in autoload.split():
+                    f.write('%s\n' % m)
+            else:
+                f.write('%s\n' % basename)
+            f.close()
+            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            if not postinst:
+                bb.fatal("pkg_postinst_%s not defined" % pkg)
+            postinst += d.getVar('autoload_postinst_fragment', True) % (autoload or basename)
+            d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+        # Write out any modconf fragment
+        modconflist = (d.getVar("KERNEL_MODULE_PROBECONF", True) or "").split()
+        modconf = d.getVar('module_conf_%s' % basename, True)
+        if modconf and basename in modconflist:
+            name = '%s/etc/modprobe.d/%s.conf' % (dvar, basename)
+            f = open(name, 'w')
+            f.write("%s\n" % modconf)
+            f.close()
+        elif modconf:
+            bb.error("Please ensure module %s is listed in KERNEL_MODULE_PROBECONF since module_conf_%s is set" % (basename, basename))
+
+        files = d.getVar('FILES_%s' % pkg, True)
+        files = "%s /etc/modules-load.d/%s.conf /etc/modprobe.d/%s.conf" % (files, basename, basename)
+        d.setVar('FILES_%s' % pkg, files)
+
+        if "description" in vals:
+            old_desc = d.getVar('DESCRIPTION_' + pkg, True) or ""
+            d.setVar('DESCRIPTION_' + pkg, old_desc + "; " + vals["description"])
+
+        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or "")
+        for dep in get_dependencies(file, pattern, format):
+            if not dep in rdepends:
+                rdepends[dep] = []
+        d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False))
+
+        # Avoid automatic -dev recommendations for modules ending with -dev.
+        d.setVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs', 1)
+
+    module_deps = parse_depmod()
+    module_regex = '^(.*)\.k?o$'
+    module_pattern = 'kernel-module-%s'
+
+    postinst = d.getVar('pkg_postinst_modules', True)
+    postrm = d.getVar('pkg_postrm_modules', True)
+
+    modules = do_split_packages(d, root='/lib/modules', file_regex=module_regex, output_pattern=module_pattern, description='%s kernel module', postinst=postinst, postrm=postrm, recursive=True, hook=frob_metadata, extra_depends='kernel-%s' % (d.getVar("KERNEL_VERSION", True)))
+    if modules:
+        metapkg = d.getVar('KERNEL_MODULES_META_PACKAGE', True)
+        d.appendVar('RDEPENDS_' + metapkg, ' '+' '.join(modules))
+
+    # If modules-load.d and modprobe.d are empty at this point, remove them to
+    # avoid warnings. removedirs only raises an OSError if an empty
+    # directory cannot be removed.
+    dvar = d.getVar('PKGD', True)
+    for dir in ["%s/etc/modprobe.d" % (dvar), "%s/etc/modules-load.d" % (dvar), "%s/etc" % (dvar)]:
+        if len(os.listdir(dir)) == 0:
+            os.rmdir(dir)
+}
+
+do_package[vardeps] += '${@" ".join(map(lambda s: "module_conf_" + s, (d.getVar("KERNEL_MODULE_PROBECONF", True) or "").split()))}'
diff --git a/meta/classes/kernel-uboot.bbclass b/meta/classes/kernel-uboot.bbclass
new file mode 100644
index 0000000..345e7f5
--- /dev/null
+++ b/meta/classes/kernel-uboot.bbclass
@@ -0,0 +1,20 @@
+uboot_prep_kimage() {
+	if test -e arch/${ARCH}/boot/compressed/vmlinux ; then
+		vmlinux_path="arch/${ARCH}/boot/compressed/vmlinux"
+		linux_suffix=""
+		linux_comp="none"
+	else
+		vmlinux_path="vmlinux"
+		linux_suffix=".gz"
+		linux_comp="gzip"
+	fi
+
+	${OBJCOPY} -O binary -R .note -R .comment -S "${vmlinux_path}" linux.bin
+
+	if [ "${linux_comp}" != "none" ] ; then
+		gzip -9 linux.bin
+		mv -f "linux.bin${linux_suffix}" linux.bin
+	fi
+
+	echo "${linux_comp}"
+}
diff --git a/meta/classes/kernel-uimage.bbclass b/meta/classes/kernel-uimage.bbclass
new file mode 100644
index 0000000..f73965b
--- /dev/null
+++ b/meta/classes/kernel-uimage.bbclass
@@ -0,0 +1,36 @@
+inherit kernel-uboot
+
+python __anonymous () {
+    kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
+    if kerneltype == 'uImage':
+        depends = d.getVar("DEPENDS", True)
+        depends = "%s u-boot-mkimage-native" % depends
+        d.setVar("DEPENDS", depends)
+
+	# Override KERNEL_IMAGETYPE_FOR_MAKE variable, which is internal
+	# to kernel.bbclass . We override the variable here, since we need
+	# to build uImage using the kernel build system if and only if
+	# KEEPUIMAGE == yes. Otherwise, we pack compressed vmlinux into
+	# the uImage .
+	if d.getVar("KEEPUIMAGE", True) != 'yes':
+            d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", "zImage")
+}
+
+do_uboot_mkimage() {
+	if test "x${KERNEL_IMAGETYPE}" = "xuImage" ; then
+		if test "x${KEEPUIMAGE}" != "xyes" ; then
+			uboot_prep_kimage
+
+			ENTRYPOINT=${UBOOT_ENTRYPOINT}
+			if test -n "${UBOOT_ENTRYSYMBOL}"; then
+				ENTRYPOINT=`${HOST_PREFIX}nm ${S}/vmlinux | \
+					awk '$3=="${UBOOT_ENTRYSYMBOL}" {print $1}'`
+			fi
+
+			uboot-mkimage -A ${UBOOT_ARCH} -O linux -T kernel -C "${linux_comp}" -a ${UBOOT_LOADADDRESS} -e $ENTRYPOINT -n "${DISTRO_NAME}/${PV}/${MACHINE}" -d linux.bin arch/${ARCH}/boot/uImage
+			rm -f linux.bin
+		fi
+	fi
+}
+
+addtask uboot_mkimage before do_install after do_compile
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
new file mode 100644
index 0000000..325f94c
--- /dev/null
+++ b/meta/classes/kernel-yocto.bbclass
@@ -0,0 +1,368 @@
+# remove tasks that modify the source tree in case externalsrc is inherited
+SRCTREECOVEREDTASKS += "do_kernel_link_vmlinux do_kernel_configme do_validate_branches do_kernel_configcheck do_kernel_checkout do_shared_workdir do_fetch do_unpack do_patch"
+
+# returns local (absolute) path names for all valid patches in the
+# src_uri
+def find_patches(d):
+    patches = src_patches(d)
+    patch_list=[]
+    for p in patches:
+        _, _, local, _, _, _ = bb.fetch.decodeurl(p)
+        patch_list.append(local)
+
+    return patch_list
+
+# returns all the elements from the src uri that are .scc files
+def find_sccs(d):
+    sources=src_patches(d, True)
+    sources_list=[]
+    for s in sources:
+        base, ext = os.path.splitext(os.path.basename(s))
+        if ext and ext in [".scc", ".cfg"]:
+            sources_list.append(s)
+        elif base and base in 'defconfig':
+            sources_list.append(s)
+
+    return sources_list
+
+# check the SRC_URI for "kmeta" type'd git repositories. Return the name of
+# the repository as it will be found in WORKDIR
+def find_kernel_feature_dirs(d):
+    feature_dirs=[]
+    fetch = bb.fetch2.Fetch([], d)
+    for url in fetch.urls:
+        urldata = fetch.ud[url]
+        parm = urldata.parm
+        type=""
+        if "type" in parm:
+            type = parm["type"]
+        if "destsuffix" in parm:
+            destdir = parm["destsuffix"]
+            if type == "kmeta":
+                feature_dirs.append(destdir)
+	    
+    return feature_dirs
+
+# find the master/machine source branch. In the same way that the fetcher proceses
+# git repositories in the SRC_URI we take the first repo found, first branch.
+def get_machine_branch(d, default):
+    fetch = bb.fetch2.Fetch([], d)
+    for url in fetch.urls:
+        urldata = fetch.ud[url]
+        parm = urldata.parm
+        if "branch" in parm:
+            branches = urldata.parm.get("branch").split(',')
+            return branches[0]
+	    
+    return default
+
+do_kernel_metadata() {
+	set +e
+	cd ${S}
+	export KMETA=${KMETA}
+
+	# if kernel tools are available in-tree, they are preferred
+	# and are placed on the path before any external tools. Unless
+	# the external tools flag is set, in that case we do nothing.
+	if [ -f "${S}/scripts/util/configme" ]; then
+		if [ -z "${EXTERNAL_KERNEL_TOOLS}" ]; then
+			PATH=${S}/scripts/util:${PATH}
+		fi
+	fi
+
+	machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
+	machine_srcrev="${SRCREV_machine}"
+	if [ -z "${machine_srcrev}" ]; then
+		# fallback to SRCREV if a non machine_meta tree is being built
+		machine_srcrev="${SRCREV}"
+	fi
+
+	# In a similar manner to the kernel itself:
+	#
+	#   defconfig: $(obj)/conf
+	#   ifeq ($(KBUILD_DEFCONFIG),)
+	#	$< --defconfig $(Kconfig)
+	#   else
+	#	@echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
+	#	$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
+	#   endif
+	#
+	# If a defconfig is specified via the KBUILD_DEFCONFIG variable, we copy it
+	# from the source tree, into a common location and normalized "defconfig" name,
+	# where the rest of the process will include and incoroporate it into the build
+	#
+	# If the fetcher has already placed a defconfig in WORKDIR (from the SRC_URI),
+	# we don't overwrite it, but instead warn the user that SRC_URI defconfigs take
+	# precendence.
+	#
+	if [ -n "${KBUILD_DEFCONFIG}" ]; then
+		if [ -f "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}" ]; then
+			if [ -f "${WORKDIR}/defconfig" ]; then
+				# If the two defconfig's are different, warn that we didn't overwrite the
+				# one already placed in WORKDIR by the fetcher.
+				cmp "${WORKDIR}/defconfig" "${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG}"
+				if [ $? -ne 0 ]; then
+					bbwarn "defconfig detected in WORKDIR. ${KBUILD_DEFCONFIG} skipped"
+				fi
+			else
+				cp -f ${S}/arch/${ARCH}/configs/${KBUILD_DEFCONFIG} ${WORKDIR}/defconfig
+				sccs="${WORKDIR}/defconfig"
+			fi
+		else
+			bbfatal "A KBUILD_DECONFIG '${KBUILD_DEFCONFIG}' was specified, but not present in the source tree"
+		fi
+	fi
+
+	sccs="$sccs ${@" ".join(find_sccs(d))}"
+	patches="${@" ".join(find_patches(d))}"
+	feat_dirs="${@" ".join(find_kernel_feature_dirs(d))}"
+
+	# add any explicitly referenced features onto the end of the feature
+	# list that is passed to the kernel build scripts.
+	if [ -n "${KERNEL_FEATURES}" ]; then
+		for feat in ${KERNEL_FEATURES}; do
+			addon_features="$addon_features --feature $feat"
+		done
+	fi
+
+	# check for feature directories/repos/branches that were part of the
+	# SRC_URI. If they were supplied, we convert them into include directives
+	# for the update part of the process
+	if [ -n "${feat_dirs}" ]; then
+	    for f in ${feat_dirs}; do
+		if [ -d "${WORKDIR}/$f/meta" ]; then
+		    includes="$includes -I${WORKDIR}/$f/meta"
+		elif [ -d "${WORKDIR}/$f" ]; then
+		    includes="$includes -I${WORKDIR}/$f"
+		fi
+	    done
+	fi
+
+	# updates or generates the target description
+	updateme ${updateme_flags} -DKDESC=${KMACHINE}:${LINUX_KERNEL_TYPE} \
+                         ${includes} ${addon_features} ${ARCH} ${KMACHINE} ${sccs} ${patches}
+	if [ $? -ne 0 ]; then
+		bbfatal_log "Could not update ${machine_branch}"
+	fi
+}
+
+do_patch() {
+	cd ${S}
+
+	# executes and modifies the source tree as required
+	patchme ${KMACHINE}
+	if [ $? -ne 0 ]; then
+		bberror "Could not apply patches for ${KMACHINE}."
+		bbfatal_log "Patch failures can be resolved in the linux source directory ${S})"
+	fi
+
+	# check to see if the specified SRCREV is reachable from the final branch.
+	# if it wasn't something wrong has happened, and we should error.
+	machine_srcrev="${SRCREV_machine}"
+	if [ -z "${machine_srcrev}" ]; then
+		# fallback to SRCREV if a non machine_meta tree is being built
+		machine_srcrev="${SRCREV}"
+		# if SRCREV cannot be reached something is wrong.
+		if [ -z "${machine_srcrev}" ]; then
+			bbfatal "Neither SRCREV_machine or SRCREV was specified!"
+		fi
+	fi
+
+	if [ "${machine_srcrev}" != "AUTOINC" ]; then
+		if ! [ "$(git rev-parse --verify ${machine_srcrev}~0)" = "$(git merge-base ${machine_srcrev} HEAD)" ]; then
+			bberror "SRCREV ${machine_srcrev} was specified, but is not reachable"
+			bbfatal "Check the BSP description for incorrect branch selection, or other errors."
+		fi
+	fi
+}
+
+do_kernel_checkout() {
+	set +e
+
+	source_dir=`echo ${S} | sed 's%/$%%'`
+	source_workdir="${WORKDIR}/git"
+	if [ -d "${WORKDIR}/git/" ]; then
+		# case: git repository (bare or non-bare)
+		# if S is WORKDIR/git, then we shouldn't be moving or deleting the tree.
+		if [ "${source_dir}" != "${source_workdir}" ]; then
+			rm -rf ${S}
+			mv ${WORKDIR}/git ${S}
+		fi
+		cd ${S}
+	else
+		# case: we have no git repository at all. 
+		# To support low bandwidth options for building the kernel, we'll just 
+		# convert the tree to a git repo and let the rest of the process work unchanged
+		
+		# if ${S} hasn't been set to the proper subdirectory a default of "linux" is 
+		# used, but we can't initialize that empty directory. So check it and throw a
+		# clear error
+
+	        cd ${S}
+		if [ ! -f "Makefile" ]; then
+			bberror "S is not set to the linux source directory. Check "
+			bbfatal "the recipe and set S to the proper extracted subdirectory"
+		fi
+		rm -f .gitignore
+		git init
+		git add .
+		git commit -q -m "baseline commit: creating repo for ${PN}-${PV}"
+		git clean -d -f
+	fi
+
+	# convert any remote branches to local tracking ones
+	for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
+		b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;
+		git show-ref --quiet --verify -- "refs/heads/$b"
+		if [ $? -ne 0 ]; then
+			git branch $b $i > /dev/null
+		fi
+	done
+
+	# Create a working tree copy of the kernel by checking out a branch
+	machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
+
+	# checkout and clobber any unimportant files
+	git checkout -f ${machine_branch}
+}
+do_kernel_checkout[dirs] = "${S}"
+
+addtask kernel_checkout before do_kernel_metadata after do_unpack
+addtask kernel_metadata after do_validate_branches do_unpack before do_patch
+do_kernel_metadata[depends] = "kern-tools-native:do_populate_sysroot"
+
+do_kernel_configme[dirs] += "${S} ${B}"
+do_kernel_configme() {
+	bbnote "kernel configme"
+	export KMETA=${KMETA}
+
+	if [ -n "${KCONFIG_MODE}" ]; then
+		configmeflags=${KCONFIG_MODE}
+	else
+		# If a defconfig was passed, use =n as the baseline, which is achieved
+		# via --allnoconfig
+		if [ -f ${WORKDIR}/defconfig ]; then
+			configmeflags="--allnoconfig"
+		fi
+	fi
+
+	cd ${S}
+	PATH=${PATH}:${S}/scripts/util
+	configme ${configmeflags} --reconfig --output ${B} ${LINUX_KERNEL_TYPE} ${KMACHINE}
+	if [ $? -ne 0 ]; then
+		bbfatal_log "Could not configure ${KMACHINE}-${LINUX_KERNEL_TYPE}"
+	fi
+	
+	echo "# Global settings from linux recipe" >> ${B}/.config
+	echo "CONFIG_LOCALVERSION="\"${LINUX_VERSION_EXTENSION}\" >> ${B}/.config
+}
+
+addtask kernel_configme before do_configure after do_patch
+
+python do_kernel_configcheck() {
+    import re, string, sys
+
+    # if KMETA isn't set globally by a recipe using this routine, we need to
+    # set the default to 'meta'. Otherwise, kconf_check is not passed a valid
+    # meta-series for processing
+    kmeta = d.getVar( "KMETA", True ) or "meta"
+    if not os.path.exists(kmeta):
+        kmeta = "." + kmeta
+
+    pathprefix = "export PATH=%s:%s; " % (d.getVar('PATH', True), "${S}/scripts/util/")
+    cmd = d.expand("cd ${S}; kconf_check -config %s/meta-series ${S} ${B}" % kmeta)
+    ret, result = oe.utils.getstatusoutput("%s%s" % (pathprefix, cmd))
+
+    config_check_visibility = int(d.getVar( "KCONF_AUDIT_LEVEL", True ) or 0)
+    bsp_check_visibility = int(d.getVar( "KCONF_BSP_AUDIT_LEVEL", True ) or 0)
+
+    # if config check visibility is non-zero, report dropped configuration values
+    mismatch_file = "${S}/" + kmeta + "/" + "mismatch.cfg"
+    if os.path.exists(mismatch_file):
+        if config_check_visibility:
+            with open (mismatch_file, "r") as myfile:
+                results = myfile.read()
+                bb.warn( "[kernel config]: specified values did not make it into the kernel's final configuration:\n\n%s" % results)
+
+    # if config check visibility is level 2 or higher, report non-hardware options
+    nonhw_file = "${S}/" + kmeta + "/" + "nonhw_report.cfg"
+    if os.path.exists(nonhw_file):
+        if config_check_visibility > 1:
+            with open (nonhw_file, "r") as myfile:
+                results = myfile.read()
+                bb.warn( "[kernel config]: BSP specified non-hw configuration:\n\n%s" % results)
+
+    bsp_desc = "${S}/" + kmeta + "/" + "top_tgt"
+    if os.path.exists(bsp_desc) and bsp_check_visibility > 1:
+        with open (bsp_desc, "r") as myfile:
+            bsp_tgt = myfile.read()
+            m = re.match("^(.*)scratch.obj(.*)$", bsp_tgt)
+            if not m is None:
+                bb.warn( "[kernel]: An auto generated BSP description was used, this normally indicates a misconfiguration.\n" +
+                         "Check that your machine (%s) has an associated kernel description." % "${MACHINE}" )
+}
+
+# Ensure that the branches (BSP and meta) are on the locations specified by
+# their SRCREV values. If they are NOT on the right commits, the branches
+# are corrected to the proper commit.
+do_validate_branches() {
+	set +e
+	cd ${S}
+
+	machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
+	machine_srcrev="${SRCREV_machine}"
+
+	# if SRCREV is AUTOREV it shows up as AUTOINC there's nothing to
+	# check and we can exit early
+	if [ "${machine_srcrev}" = "AUTOINC" ]; then
+		bbnote "SRCREV validation is not required for AUTOREV"
+	elif [ "${machine_srcrev}" = "" ]; then
+		if [ "${SRCREV}" != "AUTOINC" ] && [ "${SRCREV}" != "INVALID" ]; then
+		       # SRCREV_machine_<MACHINE> was not set. This means that a custom recipe
+		       # that doesn't use the SRCREV_FORMAT "machine_meta" is being built. In
+		       # this case, we need to reset to the give SRCREV before heading to patching
+		       bbnote "custom recipe is being built, forcing SRCREV to ${SRCREV}"
+		       force_srcrev="${SRCREV}"
+		fi
+	else
+		git cat-file -t ${machine_srcrev} > /dev/null
+		if [ $? -ne 0 ]; then
+			bberror "${machine_srcrev} is not a valid commit ID."
+			bbfatal_log "The kernel source tree may be out of sync"
+		fi
+		force_srcrev=${machine_srcrev}
+	fi
+
+	git checkout -q -f ${machine_branch}
+	if [ -n "${force_srcrev}" ]; then
+		# see if the branch we are about to patch has been properly reset to the defined
+		# SRCREV .. if not, we reset it.
+		branch_head=`git rev-parse HEAD`
+		if [ "${force_srcrev}" != "${branch_head}" ]; then
+			current_branch=`git rev-parse --abbrev-ref HEAD`
+			git branch "$current_branch-orig"
+			git reset --hard ${force_srcrev}
+		fi
+	fi
+}
+
+# Many scripts want to look in arch/$arch/boot for the bootable
+# image. This poses a problem for vmlinux based booting. This 
+# task arranges to have vmlinux appear in the normalized directory
+# location.
+do_kernel_link_vmlinux() {
+	if [ ! -d "${B}/arch/${ARCH}/boot" ]; then
+		mkdir ${B}/arch/${ARCH}/boot
+	fi
+	cd ${B}/arch/${ARCH}/boot
+	ln -sf ../../../vmlinux
+}
+
+OE_TERMINAL_EXPORTS += "KBUILD_OUTPUT"
+KBUILD_OUTPUT = "${B}"
+
+python () {
+    # If diffconfig is available, ensure it runs after kernel_configme
+    if 'do_diffconfig' in d:
+        bb.build.addtask('do_diffconfig', None, 'do_kernel_configme', d)
+}
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
new file mode 100644
index 0000000..dfbdfd2
--- /dev/null
+++ b/meta/classes/kernel.bbclass
@@ -0,0 +1,490 @@
+inherit linux-kernel-base kernel-module-split
+
+PROVIDES += "virtual/kernel"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native"
+
+S = "${STAGING_KERNEL_DIR}"
+B = "${WORKDIR}/build"
+KBUILD_OUTPUT = "${B}"
+OE_TERMINAL_EXPORTS += "KBUILD_OUTPUT"
+
+# we include gcc above, we dont need virtual/libc
+INHIBIT_DEFAULT_DEPS = "1"
+
+KERNEL_IMAGETYPE ?= "zImage"
+INITRAMFS_IMAGE ?= ""
+INITRAMFS_TASK ?= ""
+INITRAMFS_IMAGE_BUNDLE ?= ""
+
+python __anonymous () {
+    import re
+
+    kerneltype = d.getVar('KERNEL_IMAGETYPE', True)
+
+    d.setVar("KERNEL_IMAGETYPE_FOR_MAKE", re.sub(r'\.gz$', '', kerneltype))
+
+    image = d.getVar('INITRAMFS_IMAGE', True)
+    if image:
+        d.appendVarFlag('do_bundle_initramfs', 'depends', ' ${INITRAMFS_IMAGE}:do_rootfs')
+
+    # NOTE: setting INITRAMFS_TASK is for backward compatibility
+    #       The preferred method is to set INITRAMFS_IMAGE, because
+    #       this INITRAMFS_TASK has circular dependency problems
+    #       if the initramfs requires kernel modules
+    image_task = d.getVar('INITRAMFS_TASK', True)
+    if image_task:
+        d.appendVarFlag('do_configure', 'depends', ' ${INITRAMFS_TASK}')
+}
+
+# Here we pull in all various kernel image types which we support.
+#
+# In case you're wondering why kernel.bbclass inherits the other image
+# types instead of the other way around, the reason for that is to
+# maintain compatibility with various currently existing meta-layers.
+# By pulling in the various kernel image types here, we retain the
+# original behavior of kernel.bbclass, so no meta-layers should get
+# broken.
+#
+# KERNEL_CLASSES by default pulls in kernel-uimage.bbclass, since this
+# used to be the default behavior when only uImage was supported. This
+# variable can be appended by users who implement support for new kernel
+# image types.
+
+KERNEL_CLASSES ?= " kernel-uimage "
+inherit ${KERNEL_CLASSES}
+
+# Old style kernels may set ${S} = ${WORKDIR}/git for example
+# We need to move these over to STAGING_KERNEL_DIR. We can't just
+# create the symlink in advance as the git fetcher can't cope with
+# the symlink.
+do_unpack[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
+do_clean[cleandirs] += " ${S} ${STAGING_KERNEL_DIR} ${B} ${STAGING_KERNEL_BUILDDIR}"
+base_do_unpack_append () {
+    s = d.getVar("S", True)
+    if s[-1] == '/':
+        # drop trailing slash, so that os.symlink(kernsrc, s) doesn't use s as directory name and fail
+        s=s[:-1]
+    kernsrc = d.getVar("STAGING_KERNEL_DIR", True)
+    if s != kernsrc:
+        bb.utils.mkdirhier(kernsrc)
+        bb.utils.remove(kernsrc, recurse=True)
+        if d.getVar("EXTERNALSRC", True):
+            # With EXTERNALSRC S will not be wiped so we can symlink to it
+            os.symlink(s, kernsrc)
+        else:
+            import shutil
+            shutil.move(s, kernsrc)
+            os.symlink(kernsrc, s)
+}
+
+inherit kernel-arch deploy
+
+PACKAGES_DYNAMIC += "^kernel-module-.*"
+PACKAGES_DYNAMIC += "^kernel-image-.*"
+PACKAGES_DYNAMIC += "^kernel-firmware-.*"
+
+export OS = "${TARGET_OS}"
+export CROSS_COMPILE = "${TARGET_PREFIX}"
+
+KERNEL_PRIORITY ?= "${@int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[0]) * 10000 + \
+                       int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[1]) * 100 + \
+                       int(d.getVar('PV',1).split('-')[0].split('+')[0].split('.')[-1])}"
+
+KERNEL_RELEASE ?= "${KERNEL_VERSION}"
+
+# Where built kernel lies in the kernel tree
+KERNEL_OUTPUT ?= "arch/${ARCH}/boot/${KERNEL_IMAGETYPE}"
+KERNEL_IMAGEDEST = "boot"
+
+#
+# configuration
+#
+export CMDLINE_CONSOLE = "console=${@d.getVar("KERNEL_CONSOLE",1) or "ttyS0"}"
+
+KERNEL_VERSION = "${@get_kernelversion_headers('${B}')}"
+
+KERNEL_LOCALVERSION ?= ""
+
+# kernels are generally machine specific
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# U-Boot support
+UBOOT_ENTRYPOINT ?= "20008000"
+UBOOT_LOADADDRESS ?= "${UBOOT_ENTRYPOINT}"
+
+# Some Linux kernel configurations need additional parameters on the command line
+KERNEL_EXTRA_ARGS ?= ""
+
+# For the kernel, we don't want the '-e MAKEFLAGS=' in EXTRA_OEMAKE.
+# We don't want to override kernel Makefile variables from the environment
+EXTRA_OEMAKE = ""
+
+KERNEL_ALT_IMAGETYPE ??= ""
+
+# Define where the kernel headers are installed on the target as well as where
+# they are staged.
+KERNEL_SRC_PATH = "/usr/src/kernel"
+
+copy_initramfs() {
+	echo "Copying initramfs into ./usr ..."
+	# In case the directory is not created yet from the first pass compile:
+	mkdir -p ${B}/usr
+	# Find and use the first initramfs image archive type we find
+	rm -f ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio
+	for img in cpio.gz cpio.lz4 cpio.lzo cpio.lzma cpio.xz; do
+		if [ -e "${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img" ]; then
+			cp ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.$img ${B}/usr/.
+			case $img in
+			*gz)
+				echo "gzip decompressing image"
+				gunzip -f ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+				break
+				;;
+			*lz4)
+				echo "lz4 decompressing image"
+				lz4 -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+				break
+				;;
+			*lzo)
+				echo "lzo decompressing image"
+				lzop -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+				break
+				;;
+			*lzma)
+				echo "lzma decompressing image"
+				lzma -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+				break
+				;;
+			*xz)
+				echo "xz decompressing image"
+				xz -df ${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.$img
+				break
+				;;
+			esac
+		fi
+	done
+	echo "Finished copy of initramfs into ./usr"
+}
+
+INITRAMFS_BASE_NAME = "${KERNEL_IMAGETYPE}-initramfs-${PV}-${PR}-${MACHINE}-${DATETIME}"
+INITRAMFS_BASE_NAME[vardepsexclude] = "DATETIME"
+do_bundle_initramfs () {
+	if [ ! -z "${INITRAMFS_IMAGE}" -a x"${INITRAMFS_IMAGE_BUNDLE}" = x1 ]; then
+		echo "Creating a kernel image with a bundled initramfs..."
+		copy_initramfs
+		if [ -e ${KERNEL_OUTPUT} ] ; then
+			mv -f ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}.bak
+		fi
+		use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio
+		kernel_do_compile
+		mv -f ${KERNEL_OUTPUT} ${KERNEL_OUTPUT}.initramfs
+		mv -f ${KERNEL_OUTPUT}.bak ${KERNEL_OUTPUT}
+		# Update install area
+		echo "There is kernel image bundled with initramfs: ${B}/${KERNEL_OUTPUT}.initramfs"
+		install -m 0644 ${B}/${KERNEL_OUTPUT}.initramfs ${D}/boot/${KERNEL_IMAGETYPE}-initramfs-${MACHINE}.bin
+		echo "${B}/${KERNEL_OUTPUT}.initramfs"
+	fi
+}
+
+python do_devshell_prepend () {
+    os.environ["LDFLAGS"] = ''
+}
+
+addtask bundle_initramfs after do_install before do_deploy
+
+kernel_do_compile() {
+	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
+	# The $use_alternate_initrd is only set from
+	# do_bundle_initramfs() This variable is specifically for the
+	# case where we are making a second pass at the kernel
+	# compilation and we want to force the kernel build to use a
+	# different initramfs image.  The way to do that in the kernel
+	# is to specify:
+	# make ...args... CONFIG_INITRAMFS_SOURCE=some_other_initramfs.cpio
+	if [ "$use_alternate_initrd" = "" ] && [ "${INITRAMFS_TASK}" != "" ] ; then
+		# The old style way of copying an prebuilt image and building it
+		# is turned on via INTIRAMFS_TASK != ""
+		copy_initramfs
+		use_alternate_initrd=CONFIG_INITRAMFS_SOURCE=${B}/usr/${INITRAMFS_IMAGE}-${MACHINE}.cpio
+	fi
+	oe_runmake ${KERNEL_IMAGETYPE_FOR_MAKE} ${KERNEL_ALT_IMAGETYPE} CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS} $use_alternate_initrd
+	if test "${KERNEL_IMAGETYPE_FOR_MAKE}.gz" = "${KERNEL_IMAGETYPE}"; then
+		gzip -9c < "${KERNEL_IMAGETYPE_FOR_MAKE}" > "${KERNEL_OUTPUT}"
+	fi
+}
+
+do_compile_kernelmodules() {
+	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
+	if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then
+		oe_runmake -C ${B} ${PARALLEL_MAKE} modules CC="${KERNEL_CC}" LD="${KERNEL_LD}" ${KERNEL_EXTRA_ARGS}
+	else
+		bbnote "no modules to compile"
+	fi
+}
+addtask compile_kernelmodules after do_compile before do_strip
+
+kernel_do_install() {
+	#
+	# First install the modules
+	#
+	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS MACHINE
+	if (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
+		oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" modules_install
+		rm "${D}/lib/modules/${KERNEL_VERSION}/build"
+		rm "${D}/lib/modules/${KERNEL_VERSION}/source"
+		# If the kernel/ directory is empty remove it to prevent QA issues
+		rmdir --ignore-fail-on-non-empty "${D}/lib/modules/${KERNEL_VERSION}/kernel"
+	else
+		bbnote "no modules to install"
+	fi
+
+	#
+	# Install various kernel output (zImage, map file, config, module support files)
+	#
+	install -d ${D}/${KERNEL_IMAGEDEST}
+	install -d ${D}/boot
+	install -m 0644 ${KERNEL_OUTPUT} ${D}/${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION}
+	install -m 0644 System.map ${D}/boot/System.map-${KERNEL_VERSION}
+	install -m 0644 .config ${D}/boot/config-${KERNEL_VERSION}
+	install -m 0644 vmlinux ${D}/boot/vmlinux-${KERNEL_VERSION}
+	[ -e Module.symvers ] && install -m 0644 Module.symvers ${D}/boot/Module.symvers-${KERNEL_VERSION}
+	install -d ${D}${sysconfdir}/modules-load.d
+	install -d ${D}${sysconfdir}/modprobe.d
+}
+do_install[prefuncs] += "package_get_auto_pr"
+
+addtask shared_workdir after do_compile before do_compile_kernelmodules
+addtask shared_workdir_setscene
+
+do_shared_workdir_setscene () {
+	exit 1
+}
+
+emit_depmod_pkgdata() {
+	# Stash data for depmod
+	install -d ${PKGDESTWORK}/kernel-depmod/
+	echo "${KERNEL_VERSION}" > ${PKGDESTWORK}/kernel-depmod/kernel-abiversion
+	cp ${B}/System.map ${PKGDESTWORK}/kernel-depmod/System.map-${KERNEL_VERSION}
+}
+
+PACKAGEFUNCS += "emit_depmod_pkgdata"
+
+do_shared_workdir () {
+	cd ${B}
+
+	kerneldir=${STAGING_KERNEL_BUILDDIR}
+	install -d $kerneldir
+
+	#
+	# Store the kernel version in sysroots for module-base.bbclass
+	#
+
+	echo "${KERNEL_VERSION}" > $kerneldir/kernel-abiversion
+
+	# Copy files required for module builds
+	cp System.map $kerneldir/System.map-${KERNEL_VERSION}
+	cp Module.symvers $kerneldir/
+	cp .config $kerneldir/
+	mkdir -p $kerneldir/include/config
+	cp include/config/kernel.release $kerneldir/include/config/kernel.release
+
+	# We can also copy over all the generated files and avoid special cases
+	# like version.h, but we've opted to keep this small until file creep starts
+	# to happen
+	if [ -e include/linux/version.h ]; then
+		mkdir -p $kerneldir/include/linux
+		cp include/linux/version.h $kerneldir/include/linux/version.h
+	fi
+
+	# As of Linux kernel version 3.0.1, the clean target removes
+	# arch/powerpc/lib/crtsavres.o which is present in
+	# KBUILD_LDFLAGS_MODULE, making it required to build external modules.
+	if [ ${ARCH} = "powerpc" ]; then
+		mkdir -p $kerneldir/arch/powerpc/lib/
+		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
+	fi
+
+	if [ -d include/generated ]; then
+		mkdir -p $kerneldir/include/generated/
+		cp -fR include/generated/* $kerneldir/include/generated/
+	fi
+
+	if [ -d arch/${ARCH}/include/generated ]; then
+		mkdir -p $kerneldir/arch/${ARCH}/include/generated/
+		cp -fR arch/${ARCH}/include/generated/* $kerneldir/arch/${ARCH}/include/generated/
+	fi
+}
+
+# We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
+sysroot_stage_all () {
+	:
+}
+
+KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} oldnoconfig || yes '' | oe_runmake -C ${S} O=${B} oldconfig"
+
+kernel_do_configure() {
+	# fixes extra + in /lib/modules/2.6.37+
+	# $ scripts/setlocalversion . => +
+	# $ make kernelversion => 2.6.37
+	# $ make kernelrelease => 2.6.37+
+	touch ${B}/.scmversion ${S}/.scmversion
+
+	if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then
+		mv "${S}/.config" "${B}/.config"
+	fi
+
+	# Copy defconfig to .config if .config does not exist. This allows
+	# recipes to manage the .config themselves in do_configure_prepend().
+	if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
+		cp "${WORKDIR}/defconfig" "${B}/.config"
+	fi
+	eval ${KERNEL_CONFIG_COMMAND}
+}
+
+do_savedefconfig() {
+	oe_runmake -C ${B} savedefconfig
+}
+do_savedefconfig[nostamp] = "1"
+addtask savedefconfig after do_configure
+
+inherit cml1
+
+EXPORT_FUNCTIONS do_compile do_install do_configure
+
+# kernel-base becomes kernel-${KERNEL_VERSION}
+# kernel-image becomes kernel-image-${KERNEL_VERISON}
+PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-modules"
+FILES_${PN} = ""
+FILES_kernel-base = "/lib/modules/${KERNEL_VERSION}/modules.order /lib/modules/${KERNEL_VERSION}/modules.builtin"
+FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
+FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH} /lib/modules/${KERNEL_VERSION}/build"
+FILES_kernel-vmlinux = "/boot/vmlinux*"
+FILES_kernel-modules = ""
+RDEPENDS_kernel = "kernel-base"
+# Allow machines to override this dependency if kernel image files are 
+# not wanted in images as standard
+RDEPENDS_kernel-base ?= "kernel-image"
+PKG_kernel-image = "kernel-image-${@legitimize_package_name('${KERNEL_VERSION}')}"
+RDEPENDS_kernel-image += "${@base_conditional('KERNEL_IMAGETYPE', 'vmlinux', 'kernel-vmlinux', '', d)}"
+PKG_kernel-base = "kernel-${@legitimize_package_name('${KERNEL_VERSION}')}"
+RPROVIDES_kernel-base += "kernel-${KERNEL_VERSION}"
+ALLOW_EMPTY_kernel = "1"
+ALLOW_EMPTY_kernel-base = "1"
+ALLOW_EMPTY_kernel-image = "1"
+ALLOW_EMPTY_kernel-modules = "1"
+DESCRIPTION_kernel-modules = "Kernel modules meta package"
+
+pkg_postinst_kernel-base () {
+	if [ ! -e "$D/lib/modules/${KERNEL_VERSION}" ]; then
+		mkdir -p $D/lib/modules/${KERNEL_VERSION}
+	fi
+	if [ -n "$D" ]; then
+		depmodwrapper -a -b $D ${KERNEL_VERSION}
+	else
+		depmod -a ${KERNEL_VERSION}
+	fi
+}
+
+pkg_postinst_kernel-image () {
+	update-alternatives --install /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE} /${KERNEL_IMAGEDEST}/${KERNEL_IMAGETYPE}-${KERNEL_VERSION} ${KERNEL_PRIORITY} || true
+}
+
+pkg_postrm_kernel-image () {
+	update-alternatives --remove ${KERNEL_IMAGETYPE} ${KERNEL_IMAGETYPE}-${KERNEL_VERSION} || true
+}
+
+PACKAGESPLITFUNCS_prepend = "split_kernel_packages "
+
+python split_kernel_packages () {
+    do_split_packages(d, root='/lib/firmware', file_regex='^(.*)\.(bin|fw|cis|dsp)$', output_pattern='kernel-firmware-%s', description='Firmware for %s', recursive=True, extra_depends='')
+}
+
+do_strip() {
+	if [ -n "${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}" ]; then
+		if [ "${KERNEL_IMAGETYPE}" != "vmlinux" ]; then
+			bbwarn "image type will not be stripped (not supported): ${KERNEL_IMAGETYPE}"
+			return
+		fi
+
+		cd ${B}
+		headers=`"$CROSS_COMPILE"readelf -S ${KERNEL_OUTPUT} | \
+			  grep "^ \{1,\}\[[0-9 ]\{1,\}\] [^ ]" | \
+			  sed "s/^ \{1,\}\[[0-9 ]\{1,\}\] //" | \
+			  gawk '{print $1}'`
+
+		for str in ${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}; do {
+			if [ "$headers" != *"$str"* ]; then
+				bbwarn "Section not found: $str";
+			fi
+
+			"$CROSS_COMPILE"strip -s -R $str ${KERNEL_OUTPUT}
+		}; done
+
+		bbnote "KERNEL_IMAGE_STRIP_EXTRA_SECTIONS is set, stripping sections:" \
+			"${KERNEL_IMAGE_STRIP_EXTRA_SECTIONS}"
+	fi;
+}
+do_strip[dirs] = "${B}"
+
+addtask do_strip before do_sizecheck after do_kernel_link_vmlinux
+
+# Support checking the kernel size since some kernels need to reside in partitions
+# with a fixed length or there is a limit in transferring the kernel to memory
+do_sizecheck() {
+	if [ ! -z "${KERNEL_IMAGE_MAXSIZE}" ]; then
+		invalid=`echo ${KERNEL_IMAGE_MAXSIZE} | sed 's/[0-9]//g'`
+		if [ -n "$invalid" ]; then
+			die "Invalid KERNEL_IMAGE_MAXSIZE: ${KERNEL_IMAGE_MAXSIZE}, should be an integerx (The unit is Kbytes)"
+		fi
+		size=`du -ks ${B}/${KERNEL_OUTPUT} | awk '{ print $1}'`
+		if [ $size -ge ${KERNEL_IMAGE_MAXSIZE} ]; then
+			die "This kernel (size=$size(K) > ${KERNEL_IMAGE_MAXSIZE}(K)) is too big for your device. Please reduce the size of the kernel by making more of it modular."
+		fi
+	fi
+}
+do_sizecheck[dirs] = "${B}"
+
+addtask sizecheck before do_install after do_strip
+
+KERNEL_IMAGE_BASE_NAME ?= "${KERNEL_IMAGETYPE}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+# Don't include the DATETIME variable in the sstate package signatures
+KERNEL_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+KERNEL_IMAGE_SYMLINK_NAME ?= "${KERNEL_IMAGETYPE}-${MACHINE}"
+MODULE_IMAGE_BASE_NAME ?= "modules-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
+MODULE_IMAGE_BASE_NAME[vardepsexclude] = "DATETIME"
+MODULE_TARBALL_BASE_NAME ?= "${MODULE_IMAGE_BASE_NAME}.tgz"
+# Don't include the DATETIME variable in the sstate package signatures
+MODULE_TARBALL_SYMLINK_NAME ?= "modules-${MACHINE}.tgz"
+MODULE_TARBALL_DEPLOY ?= "1"
+
+kernel_do_deploy() {
+	install -m 0644 ${KERNEL_OUTPUT} ${DEPLOYDIR}/${KERNEL_IMAGE_BASE_NAME}.bin
+	if [ ${MODULE_TARBALL_DEPLOY} = "1" ] && (grep -q -i -e '^CONFIG_MODULES=y$' .config); then
+		mkdir -p ${D}/lib
+		tar -cvzf ${DEPLOYDIR}/${MODULE_TARBALL_BASE_NAME} -C ${D} lib
+		ln -sf ${MODULE_TARBALL_BASE_NAME} ${DEPLOYDIR}/${MODULE_TARBALL_SYMLINK_NAME}
+	fi
+
+	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGE_SYMLINK_NAME}.bin
+	ln -sf ${KERNEL_IMAGE_BASE_NAME}.bin ${DEPLOYDIR}/${KERNEL_IMAGETYPE}
+
+	cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOYDIR}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt
+
+	cd ${B}
+	# Update deploy directory
+	if [ -e "${KERNEL_OUTPUT}.initramfs" ]; then
+		echo "Copying deploy kernel-initramfs image and setting up links..."
+		initramfs_base_name=${INITRAMFS_BASE_NAME}
+		initramfs_symlink_name=${KERNEL_IMAGETYPE}-initramfs-${MACHINE}
+		install -m 0644 ${KERNEL_OUTPUT}.initramfs ${DEPLOYDIR}/${initramfs_base_name}.bin
+		cd ${DEPLOYDIR}
+		ln -sf ${initramfs_base_name}.bin ${initramfs_symlink_name}.bin
+	fi
+}
+do_deploy[dirs] = "${DEPLOYDIR} ${B}"
+do_deploy[prefuncs] += "package_get_auto_pr"
+
+addtask deploy after do_populate_sysroot
+
+EXPORT_FUNCTIONS do_deploy
+
diff --git a/meta/classes/kernelsrc.bbclass b/meta/classes/kernelsrc.bbclass
new file mode 100644
index 0000000..9efd46a
--- /dev/null
+++ b/meta/classes/kernelsrc.bbclass
@@ -0,0 +1,10 @@
+S = "${STAGING_KERNEL_DIR}"
+do_fetch[noexec] = "1"
+do_unpack[depends] += "virtual/kernel:do_patch"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_package[depends] += "virtual/kernel:do_populate_sysroot"
+KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}"
+
+inherit linux-kernel-base
+
diff --git a/meta/classes/lib_package.bbclass b/meta/classes/lib_package.bbclass
new file mode 100644
index 0000000..8849f59
--- /dev/null
+++ b/meta/classes/lib_package.bbclass
@@ -0,0 +1,7 @@
+#
+# ${PN}-bin is defined in bitbake.conf
+#
+# We need to allow the other packages to be greedy with what they
+# want out of /usr/bin and /usr/sbin before ${PN}-bin gets greedy.
+# 
+PACKAGE_BEFORE_PN = "${PN}-bin"
diff --git a/meta/classes/libc-common.bbclass b/meta/classes/libc-common.bbclass
new file mode 100644
index 0000000..bbc8016
--- /dev/null
+++ b/meta/classes/libc-common.bbclass
@@ -0,0 +1,43 @@
+do_install() {
+	oe_runmake install_root=${D} install
+	for r in ${rpcsvc}; do
+		h=`echo $r|sed -e's,\.x$,.h,'`
+		install -m 0644 ${S}/sunrpc/rpcsvc/$h ${D}/${includedir}/rpcsvc/
+	done
+	install -d ${D}/${sysconfdir}/ 
+	install -m 0644 ${WORKDIR}/etc/ld.so.conf ${D}/${sysconfdir}/
+	install -d ${D}${localedir}
+	make -f ${WORKDIR}/generate-supported.mk IN="${S}/localedata/SUPPORTED" OUT="${WORKDIR}/SUPPORTED"
+	# get rid of some broken files...
+	for i in ${GLIBC_BROKEN_LOCALES}; do
+		grep -v $i ${WORKDIR}/SUPPORTED > ${WORKDIR}/SUPPORTED.tmp
+		mv ${WORKDIR}/SUPPORTED.tmp ${WORKDIR}/SUPPORTED
+	done
+	rm -f ${D}${sysconfdir}/rpc
+	rm -rf ${D}${datadir}/zoneinfo
+	rm -rf ${D}${libexecdir}/getconf
+}
+
+def get_libc_fpu_setting(bb, d):
+    if d.getVar('TARGET_FPU', True) in [ 'soft', 'ppc-efd' ]:
+        return "--without-fp"
+    return ""
+
+python populate_packages_prepend () {
+    if d.getVar('DEBIAN_NAMES', True):
+        pkgs = d.getVar('PACKAGES', True).split()
+        bpn = d.getVar('BPN', True)
+        prefix = d.getVar('MLPREFIX', True) or ""
+        # Set the base package...
+        d.setVar('PKG_' + prefix + bpn, prefix + 'libc6')
+        libcprefix = prefix + bpn + '-'
+        for p in pkgs:
+            # And all the subpackages.
+            if p.startswith(libcprefix):
+                renamed = p.replace(bpn, 'libc6', 1)
+                d.setVar('PKG_' + p, renamed)
+        # For backward compatibility with old -dbg package
+        d.appendVar('RPROVIDES_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg')
+        d.appendVar('RCONFLICTS_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg')
+        d.appendVar('RREPLACES_' + libcprefix + 'dbg', ' ' + prefix + 'libc-dbg')
+}
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass
new file mode 100644
index 0000000..47be691
--- /dev/null
+++ b/meta/classes/libc-package.bbclass
@@ -0,0 +1,388 @@
+#
+# This class knows how to package up [e]glibc. Its shared since prebuild binary toolchains
+# may need packaging and its pointless to duplicate this code.
+#
+# Caller should set GLIBC_INTERNAL_USE_BINARY_LOCALE to one of:
+#  "compile" - Use QEMU to generate the binary locale files
+#  "precompiled" - The binary locale files are pregenerated and already present
+#  "ondevice" - The device will build the locale files upon first boot through the postinst
+
+GLIBC_INTERNAL_USE_BINARY_LOCALE ?= "ondevice"
+
+python __anonymous () {
+    enabled = d.getVar("ENABLE_BINARY_LOCALE_GENERATION", True)
+
+    pn = d.getVar("PN", True)
+    if pn.endswith("-initial"):
+        enabled = False
+
+    if enabled and int(enabled):
+        import re
+
+        target_arch = d.getVar("TARGET_ARCH", True)
+        binary_arches = d.getVar("BINARY_LOCALE_ARCHES", True) or ""
+        use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", True) or ""
+
+        for regexp in binary_arches.split(" "):
+            r = re.compile(regexp)
+
+            if r.match(target_arch):
+                depends = d.getVar("DEPENDS", True)
+                if use_cross_localedef == "1" :
+                    depends = "%s cross-localedef-native" % depends
+                else:
+                    depends = "%s qemu-native" % depends
+                d.setVar("DEPENDS", depends)
+                d.setVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", "compile")
+                break
+
+    # try to fix disable charsets/locales/locale-code compile fail
+    if bb.utils.contains('DISTRO_FEATURES', 'libc-charsets', True, False, d) and \
+            bb.utils.contains('DISTRO_FEATURES', 'libc-locales', True, False, d) and \
+            bb.utils.contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d):
+        d.setVar('PACKAGE_NO_GCONV', '0')
+    else:
+        d.setVar('PACKAGE_NO_GCONV', '1')
+}
+
+OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}"
+
+do_configure_prepend() {
+        if [ -e ${S}/elf/ldd.bash.in ]; then
+                sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
+        fi
+}
+
+
+
+# indentation removed on purpose
+locale_base_postinst() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+	exit 1
+fi
+
+rm -rf ${TMP_LOCALE}
+mkdir -p ${TMP_LOCALE}
+if [ -f ${localedir}/locale-archive ]; then
+        cp ${localedir}/locale-archive ${TMP_LOCALE}/
+fi
+localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s
+mkdir -p ${localedir}/
+mv ${TMP_LOCALE}/locale-archive ${localedir}/
+rm -rf ${TMP_LOCALE}
+}
+
+# indentation removed on purpose
+locale_base_postrm() {
+#!/bin/sh
+
+rm -rf ${TMP_LOCALE}
+mkdir -p ${TMP_LOCALE}
+if [ -f ${localedir}/locale-archive ]; then
+	cp ${localedir}/locale-archive ${TMP_LOCALE}/
+fi
+localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s
+mv ${TMP_LOCALE}/locale-archive ${localedir}/
+rm -rf ${TMP_LOCALE}
+}
+
+
+TMP_LOCALE="/tmp/locale${localedir}"
+LOCALETREESRC ?= "${PKGD}"
+
+do_prep_locale_tree() {
+	treedir=${WORKDIR}/locale-tree
+	rm -rf $treedir
+	mkdir -p $treedir/${base_bindir} $treedir/${base_libdir} $treedir/${datadir} $treedir/${localedir}
+	tar -cf - -C ${LOCALETREESRC}${datadir} -p i18n | tar -xf - -C $treedir/${datadir}
+	# unzip to avoid parsing errors
+	for i in $treedir/${datadir}/i18n/charmaps/*gz; do 
+		gunzip $i
+	done
+	tar -cf - -C ${LOCALETREESRC}${base_libdir} -p . | tar -xf - -C $treedir/${base_libdir}
+	if [ -f ${STAGING_DIR_NATIVE}${prefix_native}/lib/libgcc_s.* ]; then
+		tar -cf - -C ${STAGING_DIR_NATIVE}/${prefix_native}/${base_libdir} -p libgcc_s.* | tar -xf - -C $treedir/${base_libdir}
+	fi
+	install -m 0755 ${LOCALETREESRC}${bindir}/localedef $treedir/${base_bindir}
+}
+
+do_collect_bins_from_locale_tree() {
+	treedir=${WORKDIR}/locale-tree
+
+	parent=$(dirname ${localedir})
+	mkdir -p ${PKGD}/$parent
+	tar -cf - -C $treedir/$parent -p $(basename ${localedir}) | tar -xf - -C ${PKGD}$parent
+}
+
+inherit qemu
+
+python package_do_split_gconvs () {
+    import re
+    if (d.getVar('PACKAGE_NO_GCONV', True) == '1'):
+        bb.note("package requested not splitting gconvs")
+        return
+
+    if not d.getVar('PACKAGES', True):
+        return
+
+    mlprefix = d.getVar("MLPREFIX", True) or ""
+
+    bpn = d.getVar('BPN', True)
+    libdir = d.getVar('libdir', True)
+    if not libdir:
+        bb.error("libdir not defined")
+        return
+    datadir = d.getVar('datadir', True)
+    if not datadir:
+        bb.error("datadir not defined")
+        return
+
+    gconv_libdir = base_path_join(libdir, "gconv")
+    charmap_dir = base_path_join(datadir, "i18n", "charmaps")
+    locales_dir = base_path_join(datadir, "i18n", "locales")
+    binary_locales_dir = d.getVar('localedir', True)
+
+    def calc_gconv_deps(fn, pkg, file_regex, output_pattern, group):
+        deps = []
+        f = open(fn, "rb")
+        c_re = re.compile('^copy "(.*)"')
+        i_re = re.compile('^include "(\w+)".*')
+        for l in f.readlines():
+            m = c_re.match(l) or i_re.match(l)
+            if m:
+                dp = legitimize_package_name('%s%s-gconv-%s' % (mlprefix, bpn, m.group(1)))
+                if not dp in deps:
+                    deps.append(dp)
+        f.close()
+        if deps != []:
+            d.setVar('RDEPENDS_%s' % pkg, " ".join(deps))
+        if bpn != 'glibc':
+            d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
+
+    do_split_packages(d, gconv_libdir, file_regex='^(.*)\.so$', output_pattern=bpn+'-gconv-%s', \
+        description='gconv module for character set %s', hook=calc_gconv_deps, \
+        extra_depends=bpn+'-gconv')
+
+    def calc_charmap_deps(fn, pkg, file_regex, output_pattern, group):
+        deps = []
+        f = open(fn, "rb")
+        c_re = re.compile('^copy "(.*)"')
+        i_re = re.compile('^include "(\w+)".*')
+        for l in f.readlines():
+            m = c_re.match(l) or i_re.match(l)
+            if m:
+                dp = legitimize_package_name('%s%s-charmap-%s' % (mlprefix, bpn, m.group(1)))
+                if not dp in deps:
+                    deps.append(dp)
+        f.close()
+        if deps != []:
+            d.setVar('RDEPENDS_%s' % pkg, " ".join(deps))
+        if bpn != 'glibc':
+            d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
+
+    do_split_packages(d, charmap_dir, file_regex='^(.*)\.gz$', output_pattern=bpn+'-charmap-%s', \
+        description='character map for %s encoding', hook=calc_charmap_deps, extra_depends='')
+
+    def calc_locale_deps(fn, pkg, file_regex, output_pattern, group):
+        deps = []
+        f = open(fn, "rb")
+        c_re = re.compile('^copy "(.*)"')
+        i_re = re.compile('^include "(\w+)".*')
+        for l in f.readlines():
+            m = c_re.match(l) or i_re.match(l)
+            if m:
+                dp = legitimize_package_name(mlprefix+bpn+'-localedata-%s' % m.group(1))
+                if not dp in deps:
+                    deps.append(dp)
+        f.close()
+        if deps != []:
+            d.setVar('RDEPENDS_%s' % pkg, " ".join(deps))
+        if bpn != 'glibc':
+            d.setVar('RPROVIDES_%s' % pkg, pkg.replace(bpn, 'glibc'))
+
+    do_split_packages(d, locales_dir, file_regex='(.*)', output_pattern=bpn+'-localedata-%s', \
+        description='locale definition for %s', hook=calc_locale_deps, extra_depends='')
+    d.setVar('PACKAGES', d.getVar('PACKAGES', False) + ' ' + d.getVar('MLPREFIX', False) + bpn + '-gconv')
+
+    use_bin = d.getVar("GLIBC_INTERNAL_USE_BINARY_LOCALE", True)
+
+    dot_re = re.compile("(.*)\.(.*)")
+
+    # Read in supported locales and associated encodings
+    supported = {}
+    with open(base_path_join(d.getVar('WORKDIR', True), "SUPPORTED")) as f:
+        for line in f.readlines():
+            try:
+                locale, charset = line.rstrip().split()
+            except ValueError:
+                continue
+            supported[locale] = charset
+
+    # GLIBC_GENERATE_LOCALES var specifies which locales to be generated. empty or "all" means all locales
+    to_generate = d.getVar('GLIBC_GENERATE_LOCALES', True)
+    if not to_generate or to_generate == 'all':
+        to_generate = supported.keys()
+    else:
+        to_generate = to_generate.split()
+        for locale in to_generate:
+            if locale not in supported:
+                if '.' in locale:
+                    charset = locale.split('.')[1]
+                else:
+                    charset = 'UTF-8'
+                    bb.warn("Unsupported locale '%s', assuming encoding '%s'" % (locale, charset))
+                supported[locale] = charset
+
+    def output_locale_source(name, pkgname, locale, encoding):
+        d.setVar('RDEPENDS_%s' % pkgname, 'localedef %s-localedata-%s %s-charmap-%s' % \
+        (mlprefix+bpn, legitimize_package_name(locale), mlprefix+bpn, legitimize_package_name(encoding)))
+        d.setVar('pkg_postinst_%s' % pkgname, d.getVar('locale_base_postinst', True) \
+        % (locale, encoding, locale))
+        d.setVar('pkg_postrm_%s' % pkgname, d.getVar('locale_base_postrm', True) % \
+        (locale, encoding, locale))
+
+    def output_locale_binary_rdepends(name, pkgname, locale, encoding):
+        m = re.match("(.*)\.(.*)", name)
+        if m:
+            libc_name = "%s.%s" % (m.group(1), m.group(2).lower())
+        else:
+            libc_name = name
+        d.setVar('RDEPENDS_%s' % pkgname, legitimize_package_name('%s-binary-localedata-%s' \
+            % (mlprefix+bpn, libc_name)))
+
+    commands = {}
+
+    def output_locale_binary(name, pkgname, locale, encoding):
+        treedir = base_path_join(d.getVar("WORKDIR", True), "locale-tree")
+        ldlibdir = base_path_join(treedir, d.getVar("base_libdir", True))
+        path = d.getVar("PATH", True)
+        i18npath = base_path_join(treedir, datadir, "i18n")
+        gconvpath = base_path_join(treedir, "iconvdata")
+        outputpath = base_path_join(treedir, binary_locales_dir)
+
+        use_cross_localedef = d.getVar("LOCALE_GENERATION_WITH_CROSS-LOCALEDEF", True) or "0"
+        if use_cross_localedef == "1":
+            target_arch = d.getVar('TARGET_ARCH', True)
+            locale_arch_options = { \
+                "arm":     " --uint32-align=4 --little-endian ", \
+                "armeb":   " --uint32-align=4 --big-endian ",    \
+                "aarch64": " --uint32-align=4 --little-endian ",    \
+                "aarch64_be": " --uint32-align=4 --big-endian ",    \
+                "sh4":     " --uint32-align=4 --big-endian ",    \
+                "powerpc": " --uint32-align=4 --big-endian ",    \
+                "powerpc64": " --uint32-align=4 --big-endian ",  \
+                "mips":    " --uint32-align=4 --big-endian ",    \
+                "mips64":  " --uint32-align=4 --big-endian ",    \
+                "mipsel":  " --uint32-align=4 --little-endian ", \
+                "mips64el":" --uint32-align=4 --little-endian ", \
+                "i586":    " --uint32-align=4 --little-endian ", \
+                "i686":    " --uint32-align=4 --little-endian ", \
+                "x86_64":  " --uint32-align=4 --little-endian "  }
+
+            if target_arch in locale_arch_options:
+                localedef_opts = locale_arch_options[target_arch]
+            else:
+                bb.error("locale_arch_options not found for target_arch=" + target_arch)
+                raise bb.build.FuncFailed("unknown arch:" + target_arch + " for locale_arch_options")
+
+            localedef_opts += " --force --old-style --no-archive --prefix=%s \
+                --inputfile=%s/%s/i18n/locales/%s --charmap=%s %s/%s" \
+                % (treedir, treedir, datadir, locale, encoding, outputpath, name)
+
+            cmd = "PATH=\"%s\" I18NPATH=\"%s\" GCONV_PATH=\"%s\" cross-localedef %s" % \
+                (path, i18npath, gconvpath, localedef_opts)
+        else: # earlier slower qemu way 
+            qemu = qemu_target_binary(d) 
+            localedef_opts = "--force --old-style --no-archive --prefix=%s \
+                --inputfile=%s/i18n/locales/%s --charmap=%s %s" \
+                % (treedir, datadir, locale, encoding, name)
+
+            qemu_options = d.getVar('QEMU_OPTIONS', True)
+
+            cmd = "PSEUDO_RELOADED=YES PATH=\"%s\" I18NPATH=\"%s\" %s -L %s \
+                -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % \
+                (path, i18npath, qemu, treedir, ldlibdir, qemu_options, treedir, localedef_opts)
+
+        commands["%s/%s" % (outputpath, name)] = cmd
+
+        bb.note("generating locale %s (%s)" % (locale, encoding))
+
+    def output_locale(name, locale, encoding):
+        pkgname = d.getVar('MLPREFIX', False) + 'locale-base-' + legitimize_package_name(name)
+        d.setVar('ALLOW_EMPTY_%s' % pkgname, '1')
+        d.setVar('PACKAGES', '%s %s' % (pkgname, d.getVar('PACKAGES', True)))
+        rprovides = ' %svirtual-locale-%s' % (mlprefix, legitimize_package_name(name))
+        m = re.match("(.*)_(.*)", name)
+        if m:
+            rprovides += ' %svirtual-locale-%s' % (mlprefix, m.group(1))
+        d.setVar('RPROVIDES_%s' % pkgname, rprovides)
+
+        if use_bin == "compile":
+            output_locale_binary_rdepends(name, pkgname, locale, encoding)
+            output_locale_binary(name, pkgname, locale, encoding)
+        elif use_bin == "precompiled":
+            output_locale_binary_rdepends(name, pkgname, locale, encoding)
+        else:
+            output_locale_source(name, pkgname, locale, encoding)
+
+    if use_bin == "compile":
+        bb.note("preparing tree for binary locale generation")
+        bb.build.exec_func("do_prep_locale_tree", d)
+
+    utf8_only = int(d.getVar('LOCALE_UTF8_ONLY', True) or 0)
+    encodings = {}
+    for locale in to_generate:
+        charset = supported[locale]
+        if utf8_only and charset != 'UTF-8':
+            continue
+
+        m = dot_re.match(locale)
+        if m:
+            base = m.group(1)
+        else:
+            base = locale
+
+        # Precompiled locales are kept as is, obeying SUPPORTED, while
+        # others are adjusted, ensuring that the non-suffixed locales
+        # are utf-8, while the suffixed are not.
+        if use_bin == "precompiled":
+            output_locale(locale, base, charset)
+        else:
+            if charset == 'UTF-8':
+                output_locale(base, base, charset)
+            else:
+                output_locale('%s.%s' % (base, charset), base, charset)
+
+    if use_bin == "compile":
+        makefile = base_path_join(d.getVar("WORKDIR", True), "locale-tree", "Makefile")
+        m = open(makefile, "w")
+        m.write("all: %s\n\n" % " ".join(commands.keys()))
+        for cmd in commands:
+            m.write(cmd + ":\n")
+            m.write("\t" + commands[cmd] + "\n\n")
+        m.close()
+        d.setVar("EXTRA_OEMAKE", "-C %s ${PARALLEL_MAKE}" % (os.path.dirname(makefile)))
+        bb.note("Executing binary locale generation makefile")
+        bb.build.exec_func("oe_runmake", d)
+        bb.note("collecting binary locales from locale tree")
+        bb.build.exec_func("do_collect_bins_from_locale_tree", d)
+        do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
+            output_pattern=bpn+'-binary-localedata-%s', \
+            description='binary locale definition for %s', extra_depends='', allow_dirs=True)
+    elif use_bin == "precompiled":
+        do_split_packages(d, binary_locales_dir, file_regex='(.*)', \
+            output_pattern=bpn+'-binary-localedata-%s', \
+            description='binary locale definition for %s', extra_depends='', allow_dirs=True)
+    else:
+        bb.note("generation of binary locales disabled. this may break i18n!")
+
+}
+
+# We want to do this indirection so that we can safely 'return'
+# from the called function even though we're prepending
+python populate_packages_prepend () {
+    bb.build.exec_func('package_do_split_gconvs', d)
+}
+
diff --git a/meta/classes/license.bbclass b/meta/classes/license.bbclass
new file mode 100644
index 0000000..c616a20
--- /dev/null
+++ b/meta/classes/license.bbclass
@@ -0,0 +1,483 @@
+# Populates LICENSE_DIRECTORY as set in distro config with the license files as set by
+# LIC_FILES_CHKSUM.
+# TODO:
+# - There is a real issue revolving around license naming standards.
+
+LICENSE_DIRECTORY ??= "${DEPLOY_DIR}/licenses"
+LICSSTATEDIR = "${WORKDIR}/license-destdir/"
+
+# Create extra package with license texts and add it to RRECOMMENDS_${PN}
+LICENSE_CREATE_PACKAGE[type] = "boolean"
+LICENSE_CREATE_PACKAGE ??= "0"
+LICENSE_PACKAGE_SUFFIX ??= "-lic"
+LICENSE_FILES_DIRECTORY ??= "${datadir}/licenses/"
+
+addtask populate_lic after do_patch before do_build
+do_populate_lic[dirs] = "${LICSSTATEDIR}/${PN}"
+do_populate_lic[cleandirs] = "${LICSSTATEDIR}"
+
+python write_package_manifest() {
+    # Get list of installed packages
+    license_image_dir = d.expand('${LICENSE_DIRECTORY}/${IMAGE_NAME}')
+    bb.utils.mkdirhier(license_image_dir)
+    from oe.rootfs import image_list_installed_packages
+    open(os.path.join(license_image_dir, 'package.manifest'),
+        'w+').write(image_list_installed_packages(d))
+}
+
+python license_create_manifest() {
+    import re
+    import oe.packagedata
+    from oe.rootfs import image_list_installed_packages
+
+    bad_licenses = (d.getVar("INCOMPATIBLE_LICENSE", True) or "").split()
+    bad_licenses = map(lambda l: canonical_license(d, l), bad_licenses)
+    bad_licenses = expand_wildcard_licenses(d, bad_licenses)
+
+    build_images_from_feeds = d.getVar('BUILD_IMAGES_FROM_FEEDS', True)
+    if build_images_from_feeds == "1":
+        return 0
+
+    pkg_dic = {}
+    for pkg in image_list_installed_packages(d).splitlines():
+        pkg_info = os.path.join(d.getVar('PKGDATA_DIR', True),
+                                'runtime-reverse', pkg)
+        pkg_name = os.path.basename(os.readlink(pkg_info))
+
+        pkg_dic[pkg_name] = oe.packagedata.read_pkgdatafile(pkg_info)
+        if not "LICENSE" in pkg_dic[pkg_name].keys():
+            pkg_lic_name = "LICENSE_" + pkg_name
+            pkg_dic[pkg_name]["LICENSE"] = pkg_dic[pkg_name][pkg_lic_name]
+
+    license_manifest = os.path.join(d.getVar('LICENSE_DIRECTORY', True),
+                        d.getVar('IMAGE_NAME', True), 'license.manifest')
+    with open(license_manifest, "w") as license_file:
+        for pkg in sorted(pkg_dic):
+            if bad_licenses:
+                try:
+                    (pkg_dic[pkg]["LICENSE"], pkg_dic[pkg]["LICENSES"]) = \
+                        oe.license.manifest_licenses(pkg_dic[pkg]["LICENSE"],
+                        bad_licenses, canonical_license, d)
+                except oe.license.LicenseError as exc:
+                    bb.fatal('%s: %s' % (d.getVar('P', True), exc))
+            else:
+                pkg_dic[pkg]["LICENSES"] = re.sub('[|&()*]', '', pkg_dic[pkg]["LICENSE"])
+                pkg_dic[pkg]["LICENSES"] = re.sub('  *', ' ', pkg_dic[pkg]["LICENSES"])
+                pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split()
+
+            license_file.write("PACKAGE NAME: %s\n" % pkg)
+            license_file.write("PACKAGE VERSION: %s\n" % pkg_dic[pkg]["PV"])
+            license_file.write("RECIPE NAME: %s\n" % pkg_dic[pkg]["PN"])
+            license_file.write("LICENSE: %s\n\n" % pkg_dic[pkg]["LICENSE"])
+
+            # If the package doesn't contain any file, that is, its size is 0, the license
+            # isn't relevant as far as the final image is concerned. So doing license check
+            # doesn't make much sense, skip it.
+            if pkg_dic[pkg]["PKGSIZE_%s" % pkg] == "0":
+                continue
+
+            for lic in pkg_dic[pkg]["LICENSES"]:
+                lic_file = os.path.join(d.getVar('LICENSE_DIRECTORY', True),
+                                        pkg_dic[pkg]["PN"], "generic_%s" % 
+                                        re.sub('\+', '', lic))
+                # add explicity avoid of CLOSED license because isn't generic
+                if lic == "CLOSED":
+                   continue
+
+                if not os.path.exists(lic_file):
+                   bb.warn("The license listed %s was not in the "\ 
+                            "licenses collected for recipe %s" 
+                            % (lic, pkg_dic[pkg]["PN"]))
+
+    # Two options here:
+    # - Just copy the manifest
+    # - Copy the manifest and the license directories
+    # With both options set we see a .5 M increase in core-image-minimal
+    copy_lic_manifest = d.getVar('COPY_LIC_MANIFEST', True)
+    copy_lic_dirs = d.getVar('COPY_LIC_DIRS', True)
+    if copy_lic_manifest == "1":
+        rootfs_license_dir = os.path.join(d.getVar('IMAGE_ROOTFS', 'True'), 
+                                'usr', 'share', 'common-licenses')
+        os.makedirs(rootfs_license_dir)
+        rootfs_license_manifest = os.path.join(rootfs_license_dir,
+                                                'license.manifest')
+        os.link(license_manifest, rootfs_license_manifest)
+
+        if copy_lic_dirs == "1":
+            for pkg in sorted(pkg_dic):
+                pkg_rootfs_license_dir = os.path.join(rootfs_license_dir, pkg)
+                os.makedirs(pkg_rootfs_license_dir)
+                pkg_license_dir = os.path.join(d.getVar('LICENSE_DIRECTORY', True),
+                                            pkg_dic[pkg]["PN"]) 
+                licenses = os.listdir(pkg_license_dir)
+                for lic in licenses:
+                    rootfs_license = os.path.join(rootfs_license_dir, lic)
+                    pkg_license = os.path.join(pkg_license_dir, lic)
+                    pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic)
+
+                    if re.match("^generic_.*$", lic):
+                        generic_lic = re.search("^generic_(.*)$", lic).group(1)
+                        if oe.license.license_ok(canonical_license(d,
+                            generic_lic), bad_licenses) == False:
+                            continue
+
+                        if not os.path.exists(rootfs_license):
+                            os.link(pkg_license, rootfs_license)
+
+                        os.symlink(os.path.join('..', lic), pkg_rootfs_license)
+                    else:
+                        if oe.license.license_ok(canonical_license(d,
+                            lic), bad_licenses) == False:
+                            continue
+
+                        os.link(pkg_license, pkg_rootfs_license)
+}
+
+python do_populate_lic() {
+    """
+    Populate LICENSE_DIRECTORY with licenses.
+    """
+    lic_files_paths = find_license_files(d)
+
+    # The base directory we wrangle licenses to
+    destdir = os.path.join(d.getVar('LICSSTATEDIR', True), d.getVar('PN', True))
+    copy_license_files(lic_files_paths, destdir)
+}
+
+# it would be better to copy them in do_install_append, but find_license_filesa is python
+python perform_packagecopy_prepend () {
+    enabled = oe.data.typed_value('LICENSE_CREATE_PACKAGE', d)
+    if d.getVar('CLASSOVERRIDE', True) == 'class-target' and enabled:
+        lic_files_paths = find_license_files(d)
+
+        # LICENSE_FILES_DIRECTORY starts with '/' so os.path.join cannot be used to join D and LICENSE_FILES_DIRECTORY
+        destdir = d.getVar('D', True) + os.path.join(d.getVar('LICENSE_FILES_DIRECTORY', True), d.getVar('PN', True))
+        copy_license_files(lic_files_paths, destdir)
+        add_package_and_files(d)
+}
+
+def add_package_and_files(d):
+    packages = d.getVar('PACKAGES', True)
+    files = d.getVar('LICENSE_FILES_DIRECTORY', True)
+    pn = d.getVar('PN', True)
+    pn_lic = "%s%s" % (pn, d.getVar('LICENSE_PACKAGE_SUFFIX', False))
+    if pn_lic in packages:
+        bb.warn("%s package already existed in %s." % (pn_lic, pn))
+    else:
+        # first in PACKAGES to be sure that nothing else gets LICENSE_FILES_DIRECTORY
+        d.setVar('PACKAGES', "%s %s" % (pn_lic, packages))
+        d.setVar('FILES_' + pn_lic, files)
+        rrecommends_pn = d.getVar('RRECOMMENDS_' + pn, True)
+        if rrecommends_pn:
+            d.setVar('RRECOMMENDS_' + pn, "%s %s" % (pn_lic, rrecommends_pn))
+        else:
+            d.setVar('RRECOMMENDS_' + pn, "%s" % (pn_lic))
+
+def copy_license_files(lic_files_paths, destdir):
+    import shutil
+
+    bb.utils.mkdirhier(destdir)
+    for (basename, path) in lic_files_paths:
+        try:
+            src = path
+            dst = os.path.join(destdir, basename)
+            if os.path.exists(dst):
+                os.remove(dst)
+            if os.access(src, os.W_OK) and (os.stat(src).st_dev == os.stat(destdir).st_dev):
+                os.link(src, dst)
+            else:
+                shutil.copyfile(src, dst)
+        except Exception as e:
+            bb.warn("Could not copy license file %s to %s: %s" % (src, dst, e))
+
+def find_license_files(d):
+    """
+    Creates list of files used in LIC_FILES_CHKSUM and generic LICENSE files.
+    """
+    import shutil
+    import oe.license
+
+    pn = d.getVar('PN', True)
+    for package in d.getVar('PACKAGES', True):
+        if d.getVar('LICENSE_' + package, True):
+            license_types = license_types + ' & ' + \
+                            d.getVar('LICENSE_' + package, True)
+
+    #If we get here with no license types, then that means we have a recipe 
+    #level license. If so, we grab only those.
+    try:
+        license_types
+    except NameError:        
+        # All the license types at the recipe level
+        license_types = d.getVar('LICENSE', True)
+ 
+    # All the license files for the package
+    lic_files = d.getVar('LIC_FILES_CHKSUM', True)
+    pn = d.getVar('PN', True)
+    # The license files are located in S/LIC_FILE_CHECKSUM.
+    srcdir = d.getVar('S', True)
+    # Directory we store the generic licenses as set in the distro configuration
+    generic_directory = d.getVar('COMMON_LICENSE_DIR', True)
+    # List of basename, path tuples
+    lic_files_paths = []
+    license_source_dirs = []
+    license_source_dirs.append(generic_directory)
+    try:
+        additional_lic_dirs = d.getVar('LICENSE_PATH', True).split()
+        for lic_dir in additional_lic_dirs:
+            license_source_dirs.append(lic_dir)
+    except:
+        pass
+
+    class FindVisitor(oe.license.LicenseVisitor):
+        def visit_Str(self, node):
+            #
+            # Until I figure out what to do with
+            # the two modifiers I support (or greater = +
+            # and "with exceptions" being *
+            # we'll just strip out the modifier and put
+            # the base license.
+            find_license(node.s.replace("+", "").replace("*", ""))
+            self.generic_visit(node)
+
+    def find_license(license_type):
+        try:
+            bb.utils.mkdirhier(gen_lic_dest)
+        except:
+            pass
+        spdx_generic = None
+        license_source = None
+        # If the generic does not exist we need to check to see if there is an SPDX mapping to it,
+        # unless NO_GENERIC_LICENSE is set.
+
+        for lic_dir in license_source_dirs:
+            if not os.path.isfile(os.path.join(lic_dir, license_type)):
+                if d.getVarFlag('SPDXLICENSEMAP', license_type) != None:
+                    # Great, there is an SPDXLICENSEMAP. We can copy!
+                    bb.debug(1, "We need to use a SPDXLICENSEMAP for %s" % (license_type))
+                    spdx_generic = d.getVarFlag('SPDXLICENSEMAP', license_type)
+                    license_source = lic_dir
+                    break
+            elif os.path.isfile(os.path.join(lic_dir, license_type)):
+                spdx_generic = license_type
+                license_source = lic_dir
+                break
+
+        if spdx_generic and license_source:
+            # we really should copy to generic_ + spdx_generic, however, that ends up messing the manifest
+            # audit up. This should be fixed in emit_pkgdata (or, we actually got and fix all the recipes)
+
+            lic_files_paths.append(("generic_" + license_type, os.path.join(license_source, spdx_generic)))
+
+            # The user may attempt to use NO_GENERIC_LICENSE for a generic license which doesn't make sense
+            # and should not be allowed, warn the user in this case.
+            if d.getVarFlag('NO_GENERIC_LICENSE', license_type):
+                bb.warn("%s: %s is a generic license, please don't use NO_GENERIC_LICENSE for it." % (pn, license_type))
+
+        elif d.getVarFlag('NO_GENERIC_LICENSE', license_type):
+            # if NO_GENERIC_LICENSE is set, we copy the license files from the fetched source
+            # of the package rather than the license_source_dirs.
+            for (basename, path) in lic_files_paths:
+                if d.getVarFlag('NO_GENERIC_LICENSE', license_type) == basename:
+                    lic_files_paths.append(("generic_" + license_type, path))
+                    break
+        else:
+            # Add explicity avoid of CLOSED license because this isn't generic
+            if license_type != 'CLOSED':
+                # And here is where we warn people that their licenses are lousy
+                bb.warn("%s: No generic license file exists for: %s in any provider" % (pn, license_type))
+            pass
+
+    if not generic_directory:
+        raise bb.build.FuncFailed("COMMON_LICENSE_DIR is unset. Please set this in your distro config")
+
+    if not lic_files:
+        # No recipe should have an invalid license file. This is checked else
+        # where, but let's be pedantic
+        bb.note(pn + ": Recipe file does not have license file information.")
+        return lic_files_paths
+
+    for url in lic_files.split():
+        try:
+            (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(url)
+        except bb.fetch.MalformedUrl:
+            raise bb.build.FuncFailed("%s: LIC_FILES_CHKSUM contains an invalid URL:  %s" % (d.getVar('PF', True), url))
+        # We want the license filename and path
+        srclicfile = os.path.join(srcdir, path)
+        lic_files_paths.append((os.path.basename(path), srclicfile))
+
+    v = FindVisitor()
+    try:
+        v.visit_string(license_types)
+    except oe.license.InvalidLicense as exc:
+        bb.fatal('%s: %s' % (d.getVar('PF', True), exc))
+    except SyntaxError:
+        bb.warn("%s: Failed to parse it's LICENSE field." % (d.getVar('PF', True)))
+
+    return lic_files_paths
+
+def return_spdx(d, license):
+    """
+    This function returns the spdx mapping of a license if it exists.
+     """
+    return d.getVarFlag('SPDXLICENSEMAP', license, True)
+
+def canonical_license(d, license):
+    """
+    Return the canonical (SPDX) form of the license if available (so GPLv3
+    becomes GPL-3.0), for the license named 'X+', return canonical form of
+    'X' if availabel and the tailing '+' (so GPLv3+ becomes GPL-3.0+), 
+    or the passed license if there is no canonical form.
+    """
+    lic = d.getVarFlag('SPDXLICENSEMAP', license, True) or ""
+    if not lic and license.endswith('+'):
+        lic = d.getVarFlag('SPDXLICENSEMAP', license.rstrip('+'), True)
+        if lic:
+            lic += '+'
+    return lic or license
+
+def expand_wildcard_licenses(d, wildcard_licenses):
+    """
+    Return actual spdx format license names if wildcard used. We expand
+    wildcards from SPDXLICENSEMAP flags and SRC_DISTRIBUTE_LICENSES values.
+    """
+    import fnmatch
+    licenses = []
+    spdxmapkeys = d.getVarFlags('SPDXLICENSEMAP').keys()
+    for wld_lic in wildcard_licenses:
+        spdxflags = fnmatch.filter(spdxmapkeys, wld_lic)
+        licenses += [d.getVarFlag('SPDXLICENSEMAP', flag) for flag in spdxflags]
+
+    spdx_lics = (d.getVar('SRC_DISTRIBUTE_LICENSES', False) or '').split()
+    for wld_lic in wildcard_licenses:
+        licenses += fnmatch.filter(spdx_lics, wld_lic)
+
+    licenses = list(set(licenses))
+    return licenses
+
+def incompatible_license_contains(license, truevalue, falsevalue, d):
+    license = canonical_license(d, license)
+    bad_licenses = (d.getVar('INCOMPATIBLE_LICENSE', True) or "").split()
+    bad_licenses = expand_wildcard_licenses(d, bad_licenses)
+    return truevalue if license in bad_licenses else falsevalue
+
+def incompatible_license(d, dont_want_licenses, package=None):
+    """
+    This function checks if a recipe has only incompatible licenses. It also
+    take into consideration 'or' operand.  dont_want_licenses should be passed
+    as canonical (SPDX) names.
+    """
+    import oe.license
+    license = d.getVar("LICENSE_%s" % package, True) if package else None
+    if not license:
+        license = d.getVar('LICENSE', True)
+
+    # Handles an "or" or two license sets provided by
+    # flattened_licenses(), pick one that works if possible.
+    def choose_lic_set(a, b):
+        return a if all(oe.license.license_ok(canonical_license(d, lic), 
+                            dont_want_licenses) for lic in a) else b
+
+    try:
+        licenses = oe.license.flattened_licenses(license, choose_lic_set)
+    except oe.license.LicenseError as exc:
+        bb.fatal('%s: %s' % (d.getVar('P', True), exc))
+    return any(not oe.license.license_ok(canonical_license(d, l), \
+		dont_want_licenses) for l in licenses)
+
+def check_license_flags(d):
+    """
+    This function checks if a recipe has any LICENSE_FLAGS that
+    aren't whitelisted.
+
+    If it does, it returns the first LICENSE_FLAGS item missing from the
+    whitelist, or all of the LICENSE_FLAGS if there is no whitelist.
+
+    If everything is is properly whitelisted, it returns None.
+    """
+
+    def license_flag_matches(flag, whitelist, pn):
+        """
+        Return True if flag matches something in whitelist, None if not.
+
+        Before we test a flag against the whitelist, we append _${PN}
+        to it.  We then try to match that string against the
+        whitelist.  This covers the normal case, where we expect
+        LICENSE_FLAGS to be a simple string like 'commercial', which
+        the user typically matches exactly in the whitelist by
+        explicitly appending the package name e.g 'commercial_foo'.
+        If we fail the match however, we then split the flag across
+        '_' and append each fragment and test until we either match or
+        run out of fragments.
+        """
+        flag_pn = ("%s_%s" % (flag, pn))
+        for candidate in whitelist:
+            if flag_pn == candidate:
+                    return True
+
+        flag_cur = ""
+        flagments = flag_pn.split("_")
+        flagments.pop() # we've already tested the full string
+        for flagment in flagments:
+            if flag_cur:
+                flag_cur += "_"
+            flag_cur += flagment
+            for candidate in whitelist:
+                if flag_cur == candidate:
+                    return True
+        return False
+
+    def all_license_flags_match(license_flags, whitelist):
+        """ Return first unmatched flag, None if all flags match """
+        pn = d.getVar('PN', True)
+        split_whitelist = whitelist.split()
+        for flag in license_flags.split():
+            if not license_flag_matches(flag, split_whitelist, pn):
+                return flag
+        return None
+
+    license_flags = d.getVar('LICENSE_FLAGS', True)
+    if license_flags:
+        whitelist = d.getVar('LICENSE_FLAGS_WHITELIST', True)
+        if not whitelist:
+            return license_flags
+        unmatched_flag = all_license_flags_match(license_flags, whitelist)
+        if unmatched_flag:
+            return unmatched_flag
+    return None
+
+def check_license_format(d):
+    """
+    This function checks if LICENSE is well defined,
+        Validate operators in LICENSES.
+        No spaces are allowed between LICENSES.
+    """
+    pn = d.getVar('PN', True)
+    licenses = d.getVar('LICENSE', True)
+    from oe.license import license_operator, license_operator_chars, license_pattern
+
+    elements = filter(lambda x: x.strip(), license_operator.split(licenses))
+    for pos, element in enumerate(elements):
+        if license_pattern.match(element):
+            if pos > 0 and license_pattern.match(elements[pos - 1]):
+                bb.warn('%s: LICENSE value "%s" has an invalid format - license names ' \
+                        'must be separated by the following characters to indicate ' \
+                        'the license selection: %s' %
+                        (pn, licenses, license_operator_chars))
+        elif not license_operator.match(element):
+            bb.warn('%s: LICENSE value "%s" has an invalid separator "%s" that is not ' \
+                    'in the valid list of separators (%s)' %
+                    (pn, licenses, element, license_operator_chars))
+
+SSTATETASKS += "do_populate_lic"
+do_populate_lic[sstate-inputdirs] = "${LICSSTATEDIR}"
+do_populate_lic[sstate-outputdirs] = "${LICENSE_DIRECTORY}/"
+
+ROOTFS_POSTPROCESS_COMMAND_prepend = "write_package_manifest; license_create_manifest; "
+
+do_populate_lic_setscene[dirs] = "${LICSSTATEDIR}/${PN}"
+do_populate_lic_setscene[cleandirs] = "${LICSSTATEDIR}"
+python do_populate_lic_setscene () {
+    sstate_setscene(d)
+}
+addtask do_populate_lic_setscene
diff --git a/meta/classes/linux-kernel-base.bbclass b/meta/classes/linux-kernel-base.bbclass
new file mode 100644
index 0000000..89ce716
--- /dev/null
+++ b/meta/classes/linux-kernel-base.bbclass
@@ -0,0 +1,41 @@
+# parse kernel ABI version out of <linux/version.h>
+def get_kernelversion_headers(p):
+    import re
+
+    fn = p + '/include/linux/utsrelease.h'
+    if not os.path.isfile(fn):
+        # after 2.6.33-rc1
+        fn = p + '/include/generated/utsrelease.h'
+    if not os.path.isfile(fn):
+        fn = p + '/include/linux/version.h'
+
+    try:
+        f = open(fn, 'r')
+    except IOError:
+        return None
+
+    l = f.readlines()
+    f.close()
+    r = re.compile("#define UTS_RELEASE \"(.*)\"")
+    for s in l:
+        m = r.match(s)
+        if m:
+            return m.group(1)
+    return None
+
+
+def get_kernelversion_file(p):
+    fn = p + '/kernel-abiversion'
+
+    try:
+        with open(fn, 'r') as f:
+            return f.readlines()[0].strip()
+    except IOError:
+        return None
+
+def linux_module_packages(s, d):
+	suffix = ""
+	return " ".join(map(lambda s: "kernel-module-%s%s" % (s.lower().replace('_', '-').replace('@', '+'), suffix), s.split()))
+
+# that's all
+
diff --git a/meta/classes/logging.bbclass b/meta/classes/logging.bbclass
new file mode 100644
index 0000000..06c7c31
--- /dev/null
+++ b/meta/classes/logging.bbclass
@@ -0,0 +1,101 @@
+# The following logging mechanisms are to be used in bash functions of recipes.
+# They are intended to map one to one in intention and output format with the
+# python recipe logging functions of a similar naming convention: bb.plain(),
+# bb.note(), etc.
+
+LOGFIFO = "${T}/fifo.${@os.getpid()}"
+
+# Print the output exactly as it is passed in. Typically used for output of
+# tasks that should be seen on the console. Use sparingly.
+# Output: logs console
+bbplain() {
+	if [ -p ${LOGFIFO} ] ; then
+		printf "%b\0" "bbplain $*" > ${LOGFIFO}
+	else
+		echo "$*"
+	fi
+}
+
+# Notify the user of a noteworthy condition. 
+# Output: logs
+bbnote() {
+	if [ -p ${LOGFIFO} ] ; then
+		printf "%b\0" "bbnote $*" > ${LOGFIFO}
+	else
+		echo "NOTE: $*"
+	fi
+}
+
+# Print a warning to the log. Warnings are non-fatal, and do not
+# indicate a build failure.
+# Output: logs console
+bbwarn() {
+	if [ -p ${LOGFIFO} ] ; then
+		printf "%b\0" "bbwarn $*" > ${LOGFIFO}
+	else
+		echo "WARNING: $*"
+	fi
+}
+
+# Print an error to the log. Errors are non-fatal in that the build can
+# continue, but they do indicate a build failure.
+# Output: logs console
+bberror() {
+	if [ -p ${LOGFIFO} ] ; then
+		printf "%b\0" "bberror $*" > ${LOGFIFO}
+	else
+		echo "ERROR: $*"
+	fi
+}
+
+# Print a fatal error to the log. Fatal errors indicate build failure
+# and halt the build, exiting with an error code.
+# Output: logs console
+bbfatal() {
+	if [ -p ${LOGFIFO} ] ; then
+		printf "%b\0" "bbfatal $*" > ${LOGFIFO}
+	else
+		echo "ERROR: $*"
+	fi
+	exit 1
+}
+
+# Like bbfatal, except prevents the suppression of the error log by
+# bitbake's UI.
+# Output: logs console
+bbfatal_log() {
+	if [ -p ${LOGFIFO} ] ; then
+		printf "%b\0" "bbfatal_log $*" > ${LOGFIFO}
+	else
+		echo "ERROR: $*"
+	fi
+	exit 1
+}
+
+# Print debug messages. These are appropriate for progress checkpoint
+# messages to the logs. Depending on the debug log level, they may also
+# go to the console.
+# Output: logs console
+# Usage: bbdebug 1 "first level debug message"
+#        bbdebug 2 "second level debug message"
+bbdebug() {
+	USAGE='Usage: bbdebug [123] "message"'
+	if [ $# -lt 2 ]; then
+		bbfatal "$USAGE"
+	fi
+	
+	# Strip off the debug level and ensure it is an integer
+	DBGLVL=$1; shift
+	NONDIGITS=$(echo "$DBGLVL" | tr -d [:digit:])
+	if [ "$NONDIGITS" ]; then
+		bbfatal "$USAGE"
+	fi
+
+	# All debug output is printed to the logs
+	if [ -p ${LOGFIFO} ] ; then
+		printf "%b\0" "bbdebug $DBGLVL $*" > ${LOGFIFO}
+	else
+		echo "DEBUG: $*"
+	fi
+}
+
diff --git a/meta/classes/meta.bbclass b/meta/classes/meta.bbclass
new file mode 100644
index 0000000..5e68902
--- /dev/null
+++ b/meta/classes/meta.bbclass
@@ -0,0 +1,4 @@
+
+PACKAGES = ""
+
+do_build[recrdeptask] = "do_build"
diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass
new file mode 100644
index 0000000..237e618
--- /dev/null
+++ b/meta/classes/metadata_scm.bbclass
@@ -0,0 +1,82 @@
+METADATA_BRANCH ?= "${@base_detect_branch(d)}"
+METADATA_REVISION ?= "${@base_detect_revision(d)}"
+
+def base_detect_revision(d):
+    path = base_get_scmbasepath(d)
+
+    scms = [base_get_metadata_git_revision, \
+            base_get_metadata_svn_revision]
+
+    for scm in scms:
+        rev = scm(path, d)
+        if rev != "<unknown>":
+            return rev
+
+    return "<unknown>"
+
+def base_detect_branch(d):
+    path = base_get_scmbasepath(d)
+
+    scms = [base_get_metadata_git_branch]
+
+    for scm in scms:
+        rev = scm(path, d)
+        if rev != "<unknown>":
+            return rev.strip()
+
+    return "<unknown>"
+
+def base_get_scmbasepath(d):
+    return d.getVar( 'COREBASE', True)
+
+def base_get_metadata_monotone_branch(path, d):
+    monotone_branch = "<unknown>"
+    try:
+        with open("%s/_MTN/options" % path) as f:
+            monotone_branch = f.read().strip()
+            if monotone_branch.startswith( "database" ):
+                monotone_branch_words = monotone_branch.split()
+                monotone_branch = monotone_branch_words[ monotone_branch_words.index( "branch" )+1][1:-1]
+    except:
+        pass
+    return monotone_branch
+
+def base_get_metadata_monotone_revision(path, d):
+    monotone_revision = "<unknown>"
+    try:
+        with open("%s/_MTN/revision" % path) as f:
+            monotone_revision = f.read().strip()
+            if monotone_revision.startswith( "format_version" ):
+                monotone_revision_words = monotone_revision.split()
+                monotone_revision = monotone_revision_words[ monotone_revision_words.index( "old_revision" )+1][1:-1]
+    except IOError:
+        pass
+    return monotone_revision
+
+def base_get_metadata_svn_revision(path, d):
+    # This only works with older subversion. For newer versions 
+    # this function will need to be fixed by someone interested
+    revision = "<unknown>"
+    try:
+        with open("%s/.svn/entries" % path) as f:
+            revision = f.readlines()[3].strip()
+    except (IOError, IndexError):
+        pass
+    return revision
+
+def base_get_metadata_git_branch(path, d):
+    branch = os.popen('cd %s; git branch 2>&1 | grep "^* " | tr -d "* "' % path).read()
+
+    if len(branch) != 0:
+        return branch
+    return "<unknown>"
+
+def base_get_metadata_git_revision(path, d):
+    f = os.popen("cd %s; git log -n 1 --pretty=oneline -- 2>&1" % path)
+    data = f.read()
+    if f.close() is None:        
+        rev = data.split(" ")[0]
+        if len(rev) != 0:
+            return rev
+    return "<unknown>"
+
diff --git a/meta/classes/migrate_localcount.bbclass b/meta/classes/migrate_localcount.bbclass
new file mode 100644
index 0000000..aa0df8b
--- /dev/null
+++ b/meta/classes/migrate_localcount.bbclass
@@ -0,0 +1,46 @@
+PRSERV_DUMPDIR ??= "${LOG_DIR}/db"
+LOCALCOUNT_DUMPFILE ??= "${PRSERV_DUMPDIR}/prserv-localcount-exports.inc"
+
+python migrate_localcount_handler () {
+    import bb.event
+    if not e.data:
+        return
+
+    pv = e.data.getVar('PV', True)
+    if not 'AUTOINC' in pv:
+        return
+
+    localcounts = bb.persist_data.persist('BB_URI_LOCALCOUNT', e.data)
+    pn = e.data.getVar('PN', True)
+    revs = localcounts.get_by_pattern('%%-%s_rev' % pn)
+    counts = localcounts.get_by_pattern('%%-%s_count' % pn)
+    if not revs or not counts:
+        return
+
+    if len(revs) != len(counts):
+        bb.warn("The number of revs and localcounts don't match in %s" % pn)
+        return
+
+    version = e.data.getVar('PRAUTOINX', True)
+    srcrev = bb.fetch2.get_srcrev(e.data)
+    base_ver = 'AUTOINC-%s' % version[:version.find(srcrev)]
+    pkgarch = e.data.getVar('PACKAGE_ARCH', True)
+    value = max(int(count) for count in counts)
+
+    if len(revs) == 1:
+        if srcrev != ('AUTOINC+%s' % revs[0]):
+            value += 1
+    else:
+        value += 1
+
+    bb.utils.mkdirhier(e.data.getVar('PRSERV_DUMPDIR', True))
+    df = e.data.getVar('LOCALCOUNT_DUMPFILE', True)
+    flock = bb.utils.lockfile("%s.lock" % df)
+    with open(df, 'a') as fd:
+        fd.write('PRAUTO$%s$%s$%s = "%s"\n' %
+                (base_ver, pkgarch, srcrev, str(value)))
+    bb.utils.unlockfile(flock)
+}
+
+addhandler migrate_localcount_handler
+migrate_localcount_handler[eventmask] = "bb.event.RecipeParsed"
diff --git a/meta/classes/mime.bbclass b/meta/classes/mime.bbclass
new file mode 100644
index 0000000..721c73f
--- /dev/null
+++ b/meta/classes/mime.bbclass
@@ -0,0 +1,56 @@
+DEPENDS += "shared-mime-info-native shared-mime-info"
+
+mime_postinst() {
+if [ "$1" = configure ]; then
+	UPDATEMIMEDB=`which update-mime-database`
+	if [ -x "$UPDATEMIMEDB" ] ; then
+		echo "Updating MIME database... this may take a while."
+		$UPDATEMIMEDB $D${datadir}/mime
+	else
+		echo "Missing update-mime-database, update of mime database failed!"
+		exit 1
+	fi
+fi
+}
+
+mime_postrm() {
+if [ "$1" = remove ] || [ "$1" = upgrade ]; then
+	UPDATEMIMEDB=`which update-mime-database`
+	if [ -x "$UPDATEMIMEDB" ] ; then
+		echo "Updating MIME database... this may take a while."
+		$UPDATEMIMEDB $D${datadir}/mime
+	else
+		echo "Missing update-mime-database, update of mime database failed!"
+		exit 1
+	fi
+fi
+}
+
+python populate_packages_append () {
+    import re
+    packages = d.getVar('PACKAGES', True).split()
+    pkgdest =  d.getVar('PKGDEST', True)
+
+    for pkg in packages:
+        mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg)
+        mimes = []
+        mime_re = re.compile(".*\.xml$")
+        if os.path.exists(mime_dir):
+            for f in os.listdir(mime_dir):
+                if mime_re.match(f):
+                    mimes.append(f)
+        if mimes:
+            bb.note("adding mime postinst and postrm scripts to %s" % pkg)
+            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            if not postinst:
+                postinst = '#!/bin/sh\n'
+            postinst += d.getVar('mime_postinst', True)
+            d.setVar('pkg_postinst_%s' % pkg, postinst)
+            postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+            if not postrm:
+                postrm = '#!/bin/sh\n'
+            postrm += d.getVar('mime_postrm', True)
+            d.setVar('pkg_postrm_%s' % pkg, postrm)
+            bb.note("adding shared-mime-info-data dependency to %s" % pkg)
+            d.appendVar('RDEPENDS_' + pkg, " shared-mime-info-data")
+}
diff --git a/meta/classes/mirrors.bbclass b/meta/classes/mirrors.bbclass
new file mode 100644
index 0000000..b96c071
--- /dev/null
+++ b/meta/classes/mirrors.bbclass
@@ -0,0 +1,67 @@
+MIRRORS += "\
+${DEBIAN_MIRROR}	http://snapshot.debian.org/archive/debian-archive/20120328T092752Z/debian/pool \n \
+${DEBIAN_MIRROR}	http://snapshot.debian.org/archive/debian-archive/20110127T084257Z/debian/pool \n \
+${DEBIAN_MIRROR}	http://snapshot.debian.org/archive/debian-archive/20090802T004153Z/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.de.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.au.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.cl.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.hr.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.fi.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.hk.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.hu.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.ie.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.it.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.jp.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.no.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.pl.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.ro.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.si.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.es.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.se.debian.org/debian/pool \n \
+${DEBIAN_MIRROR}	ftp://ftp.tr.debian.org/debian/pool \n \
+${GNU_MIRROR}	ftp://mirrors.kernel.org/gnu \n \
+${KERNELORG_MIRROR}	http://www.kernel.org/pub \n \
+ftp://ftp.gnupg.org/gcrypt/     ftp://ftp.franken.de/pub/crypt/mirror/ftp.gnupg.org/gcrypt/ \n \
+ftp://ftp.gnupg.org/gcrypt/     ftp://ftp.surfnet.nl/pub/security/gnupg/ \n \
+ftp://ftp.gnupg.org/gcrypt/     http://gulus.USherbrooke.ca/pub/appl/GnuPG/ \n \
+ftp://dante.ctan.org/tex-archive ftp://ftp.fu-berlin.de/tex/CTAN \n \
+ftp://dante.ctan.org/tex-archive http://sunsite.sut.ac.jp/pub/archives/ctan/ \n \
+ftp://dante.ctan.org/tex-archive http://ctan.unsw.edu.au/ \n \
+ftp://ftp.gnutls.org/gcrypt/gnutls ftp://ftp.gnupg.org/gcrypt/gnutls/ \n \
+http://ftp.info-zip.org/pub/infozip/src/ http://mirror.switch.ch/ftp/mirror/infozip/src/ \n \
+http://ftp.info-zip.org/pub/infozip/src/ ftp://sunsite.icm.edu.pl/pub/unix/archiving/info-zip/src/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.tau.ac.il/pub/unix/admin/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.cert.dfn.de/pub/tools/admin/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.kaizo.org/pub/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.tu-darmstadt.de/pub/sysadmin/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://ftp.tux.org/pub/sites/vic.cc.purdue.edu/tools/unix/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://gd.tuwien.ac.at/utils/admin-tools/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://sunsite.ualberta.ca/pub/Mirror/lsof/ \n \
+ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/  ftp://the.wiretapped.net/pub/security/host-security/lsof/ \n \
+http://www.apache.org/dist  http://archive.apache.org/dist \n \
+http://downloads.sourceforge.net/watchdog/ http://fossies.org/linux/misc/ \n \
+${SAVANNAH_GNU_MIRROR} http://download-mirror.savannah.gnu.org/releases \n \
+${SAVANNAH_NONGNU_MIRROR} http://download-mirror.savannah.nongnu.org/releases \n \
+cvs://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
+svn://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
+git://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
+hg://.*/.*      http://downloads.yoctoproject.org/mirror/sources/ \n \
+bzr://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
+p4://.*/.*      http://downloads.yoctoproject.org/mirror/sources/ \n \
+osc://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
+https?$://.*/.* http://downloads.yoctoproject.org/mirror/sources/ \n \
+ftp://.*/.*     http://downloads.yoctoproject.org/mirror/sources/ \n \
+cvs://.*/.*     http://sources.openembedded.org/ \n \
+svn://.*/.*     http://sources.openembedded.org/ \n \
+git://.*/.*     http://sources.openembedded.org/ \n \
+hg://.*/.*      http://sources.openembedded.org/ \n \
+bzr://.*/.*     http://sources.openembedded.org/ \n \
+p4://.*/.*      http://sources.openembedded.org/ \n \
+osc://.*/.*     http://sources.openembedded.org/ \n \
+https?$://.*/.* http://sources.openembedded.org/ \n \
+ftp://.*/.*     http://sources.openembedded.org/ \n \
+${CPAN_MIRROR}  http://cpan.metacpan.org/ \n \
+${CPAN_MIRROR}  http://search.cpan.org/CPAN/ \n \
+"
diff --git a/meta/classes/module-base.bbclass b/meta/classes/module-base.bbclass
new file mode 100644
index 0000000..8be26c4
--- /dev/null
+++ b/meta/classes/module-base.bbclass
@@ -0,0 +1,27 @@
+inherit kernel-arch
+
+# This is instead of DEPENDS = "virtual/kernel"
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+export OS = "${TARGET_OS}"
+export CROSS_COMPILE = "${TARGET_PREFIX}"
+
+# This points to the build artefacts from the main kernel build
+# such as .config and System.map
+# Confusingly it is not the module build output (which is ${B}) but
+# we didn't pick the name.
+export KBUILD_OUTPUT = "${STAGING_KERNEL_BUILDDIR}"
+
+export KERNEL_VERSION = "${@base_read_file('${STAGING_KERNEL_BUILDDIR}/kernel-abiversion')}"
+KERNEL_OBJECT_SUFFIX = ".ko"
+
+# kernel modules are generally machine specific
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# Function to ensure the kernel scripts are created. Expected to
+# be called before do_compile. See module.bbclass for an exmaple.
+do_make_scripts() {
+	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS 
+	make CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
+	           -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts
+}
diff --git a/meta/classes/module.bbclass b/meta/classes/module.bbclass
new file mode 100644
index 0000000..0952c0c
--- /dev/null
+++ b/meta/classes/module.bbclass
@@ -0,0 +1,32 @@
+inherit module-base kernel-module-split
+
+addtask make_scripts after do_patch before do_compile
+do_make_scripts[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
+do_make_scripts[depends] += "virtual/kernel:do_shared_workdir"
+
+EXTRA_OEMAKE += "KERNEL_SRC=${STAGING_KERNEL_DIR}"
+
+module_do_compile() {
+	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+	oe_runmake KERNEL_PATH=${STAGING_KERNEL_DIR}   \
+		   KERNEL_VERSION=${KERNEL_VERSION}    \
+		   CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+		   AR="${KERNEL_AR}" \
+	           O=${STAGING_KERNEL_BUILDDIR} \
+		   ${MAKE_TARGETS}
+}
+
+module_do_install() {
+	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+	oe_runmake DEPMOD=echo INSTALL_MOD_PATH="${D}" \
+	           CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+	           O=${STAGING_KERNEL_BUILDDIR} \
+	           modules_install
+}
+
+EXPORT_FUNCTIONS do_compile do_install
+
+# add all splitted modules to PN RDEPENDS, PN can be empty now
+KERNEL_MODULES_META_PACKAGE = "${PN}"
+FILES_${PN} = ""
+ALLOW_EMPTY_${PN} = "1"
diff --git a/meta/classes/multilib.bbclass b/meta/classes/multilib.bbclass
new file mode 100644
index 0000000..8f61d8d
--- /dev/null
+++ b/meta/classes/multilib.bbclass
@@ -0,0 +1,151 @@
+python multilib_virtclass_handler () {
+    cls = e.data.getVar("BBEXTENDCURR", True)
+    variant = e.data.getVar("BBEXTENDVARIANT", True)
+    if cls != "multilib" or not variant:
+        return
+
+    e.data.setVar('STAGING_KERNEL_DIR', e.data.getVar('STAGING_KERNEL_DIR', True))
+
+    # There should only be one kernel in multilib configs
+    # We also skip multilib setup for module packages.
+    provides = (e.data.getVar("PROVIDES", True) or "").split()
+    if "virtual/kernel" in provides or bb.data.inherits_class('module-base', e.data):
+        raise bb.parse.SkipPackage("We shouldn't have multilib variants for the kernel")
+
+    save_var_name=e.data.getVar("MULTILIB_SAVE_VARNAME", True) or ""
+    for name in save_var_name.split():
+        val=e.data.getVar(name, True)
+        if val:
+            e.data.setVar(name + "_MULTILIB_ORIGINAL", val)
+
+    overrides = e.data.getVar("OVERRIDES", False)
+    pn = e.data.getVar("PN", False)
+    overrides = overrides.replace("pn-${PN}", "pn-${PN}:pn-" + pn)
+    e.data.setVar("OVERRIDES", overrides)
+
+    if bb.data.inherits_class('image', e.data):
+        e.data.setVar("MLPREFIX", variant + "-")
+        e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
+        target_vendor = e.data.getVar("TARGET_VENDOR_" + "virtclass-multilib-" + variant, False)
+        if target_vendor:
+            e.data.setVar("TARGET_VENDOR", target_vendor)
+        return
+
+    if bb.data.inherits_class('cross-canadian', e.data):
+        e.data.setVar("MLPREFIX", variant + "-")
+        override = ":virtclass-multilib-" + variant
+        e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
+        bb.data.update_data(e.data)
+        return
+
+    if bb.data.inherits_class('native', e.data):
+        raise bb.parse.SkipPackage("We can't extend native recipes")
+
+    if bb.data.inherits_class('nativesdk', e.data) or bb.data.inherits_class('crosssdk', e.data):
+        raise bb.parse.SkipPackage("We can't extend nativesdk recipes")
+
+    if bb.data.inherits_class('allarch', e.data) and not bb.data.inherits_class('packagegroup', e.data):
+        raise bb.parse.SkipPackage("Don't extend allarch recipes which are not packagegroups")
+
+
+    # Expand this since this won't work correctly once we set a multilib into place
+    e.data.setVar("ALL_MULTILIB_PACKAGE_ARCHS", e.data.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True))
+ 
+    override = ":virtclass-multilib-" + variant
+
+    e.data.setVar("MLPREFIX", variant + "-")
+    e.data.setVar("PN", variant + "-" + e.data.getVar("PN", False))
+    e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + override)
+
+    # Expand the WHITELISTs with multilib prefix
+    for whitelist in ["HOSTTOOLS_WHITELIST_GPL-3.0", "WHITELIST_GPL-3.0", "LGPLv2_WHITELIST_GPL-3.0"]:
+        pkgs = e.data.getVar(whitelist, True)
+        for pkg in pkgs.split():
+            pkgs += " " + variant + "-" + pkg
+        e.data.setVar(whitelist, pkgs)
+
+    # DEFAULTTUNE can change TARGET_ARCH override so expand this now before update_data
+    newtune = e.data.getVar("DEFAULTTUNE_" + "virtclass-multilib-" + variant, False)
+    if newtune:
+        e.data.setVar("DEFAULTTUNE", newtune)
+        e.data.setVar('DEFAULTTUNE_ML_%s' % variant, newtune)
+}
+
+addhandler multilib_virtclass_handler
+multilib_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
+
+STAGINGCC_prepend = "${BBEXTENDVARIANT}-"
+
+python __anonymous () {
+    variant = d.getVar("BBEXTENDVARIANT", True)
+
+    import oe.classextend
+
+    clsextend = oe.classextend.ClassExtender(variant, d)
+
+    if bb.data.inherits_class('image', d):
+        clsextend.map_depends_variable("PACKAGE_INSTALL")
+        clsextend.map_depends_variable("LINGUAS_INSTALL")
+        clsextend.map_depends_variable("RDEPENDS")
+        pinstall = d.getVar("LINGUAS_INSTALL", True) + " " + d.getVar("PACKAGE_INSTALL", True)
+        d.setVar("PACKAGE_INSTALL", pinstall)
+        d.setVar("LINGUAS_INSTALL", "")
+        # FIXME, we need to map this to something, not delete it!
+        d.setVar("PACKAGE_INSTALL_ATTEMPTONLY", "")
+
+    if bb.data.inherits_class('populate_sdk_base', d):
+        clsextend.map_depends_variable("TOOLCHAIN_TARGET_TASK")
+        clsextend.map_depends_variable("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY")
+
+    if bb.data.inherits_class('image', d):
+        return
+
+    clsextend.map_depends_variable("DEPENDS")
+    clsextend.map_variable("PROVIDES")
+
+    if bb.data.inherits_class('cross-canadian', d):
+        return
+
+    clsextend.rename_packages()
+    clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
+
+    clsextend.map_packagevars()
+    clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
+    clsextend.map_variable("PACKAGE_INSTALL")
+    clsextend.map_variable("INITSCRIPT_PACKAGES")
+    clsextend.map_variable("USERADD_PACKAGES")
+    clsextend.map_variable("SYSTEMD_PACKAGES")
+}
+
+PACKAGEFUNCS_append = " do_package_qa_multilib"
+
+python do_package_qa_multilib() {
+
+    def check_mlprefix(pkg, var, mlprefix):
+        values = bb.utils.explode_deps(d.getVar('%s_%s' % (var, pkg), True) or d.getVar(var, True) or "")
+        candidates = []
+        for i in values:
+            if i.startswith('virtual/'):
+                i = i[len('virtual/'):]
+            if (not i.startswith('kernel-module')) and (not i.startswith(mlprefix)) and \
+                (not 'cross-canadian' in i) and (not i.startswith("nativesdk-")) and \
+                (not i.startswith("rtld")) and (not i.startswith('kernel-vmlinux')):
+                candidates.append(i)
+        if len(candidates) > 0:
+            msg = "%s package %s - suspicious values '%s' in %s" \
+                   % (d.getVar('PN', True), pkg, ' '.join(candidates), var)
+            package_qa_handle_error("multilib", msg, d)
+
+    ml = d.getVar('MLPREFIX', True)
+    if not ml:
+        return
+
+    packages = d.getVar('PACKAGES', True)
+    for pkg in packages.split():
+        check_mlprefix(pkg, 'RDEPENDS', ml)
+        check_mlprefix(pkg, 'RPROVIDES', ml)
+        check_mlprefix(pkg, 'RRECOMMENDS', ml)
+        check_mlprefix(pkg, 'RSUGGESTS', ml)
+        check_mlprefix(pkg, 'RREPLACES', ml)
+        check_mlprefix(pkg, 'RCONFLICTS', ml)
+}
diff --git a/meta/classes/multilib_global.bbclass b/meta/classes/multilib_global.bbclass
new file mode 100644
index 0000000..612cfb6
--- /dev/null
+++ b/meta/classes/multilib_global.bbclass
@@ -0,0 +1,162 @@
+def preferred_ml_updates(d):
+    # If any PREFERRED_PROVIDER or PREFERRED_VERSION are set,
+    # we need to mirror these variables in the multilib case;
+    multilibs = d.getVar('MULTILIBS', True) or ""
+    if not multilibs:
+        return
+
+    prefixes = []
+    for ext in multilibs.split():
+        eext = ext.split(':')
+        if len(eext) > 1 and eext[0] == 'multilib':
+            prefixes.append(eext[1])
+
+    versions = []
+    providers = []
+    for v in d.keys():
+        if v.startswith("PREFERRED_VERSION_"):
+            versions.append(v)
+        if v.startswith("PREFERRED_PROVIDER_"):
+            providers.append(v)
+
+    for v in versions:
+        val = d.getVar(v, False)
+        pkg = v.replace("PREFERRED_VERSION_", "")
+        if pkg.endswith("-native") or "-crosssdk-" in pkg or pkg.startswith(("nativesdk-", "virtual/nativesdk-")):
+            continue
+        if '-cross-' in pkg and '${' in pkg:
+            for p in prefixes:
+                localdata = bb.data.createCopy(d)
+                override = ":virtclass-multilib-" + p
+                localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
+                bb.data.update_data(localdata)
+                if "-canadian-" in pkg:
+                    newname = localdata.expand(v)
+                else:
+                    newname = localdata.expand(v).replace("PREFERRED_VERSION_", "PREFERRED_VERSION_" + p + '-')
+                if newname != v:
+                    newval = localdata.expand(val)
+                    d.setVar(newname, newval)
+            # Avoid future variable key expansion
+            vexp = d.expand(v)
+            if v != vexp and d.getVar(v, False):
+                d.renameVar(v, vexp)
+            continue
+        for p in prefixes:
+            newname = "PREFERRED_VERSION_" + p + "-" + pkg
+            if not d.getVar(newname, False):
+                d.setVar(newname, val)
+
+    for prov in providers:
+        val = d.getVar(prov, False)
+        pkg = prov.replace("PREFERRED_PROVIDER_", "")
+        if pkg.endswith("-native") or "-crosssdk-" in pkg or pkg.startswith(("nativesdk-", "virtual/nativesdk-")):
+            continue
+        if 'cross-canadian' in pkg:
+            for p in prefixes:
+                localdata = bb.data.createCopy(d)
+                override = ":virtclass-multilib-" + p
+                localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
+                bb.data.update_data(localdata)
+                newname = localdata.expand(prov)
+                if newname != prov:
+                    newval = localdata.expand(val)
+                    d.setVar(newname, newval)
+            # Avoid future variable key expansion
+            provexp = d.expand(prov)
+            if prov != provexp and d.getVar(prov, False):
+                d.renameVar(prov, provexp)
+            continue
+        virt = ""
+        if pkg.startswith("virtual/"):
+            pkg = pkg.replace("virtual/", "")
+            virt = "virtual/"
+        for p in prefixes:
+            if pkg != "kernel":
+                newval = p + "-" + val
+
+            # implement variable keys
+            localdata = bb.data.createCopy(d)
+            override = ":virtclass-multilib-" + p
+            localdata.setVar("OVERRIDES", localdata.getVar("OVERRIDES", False) + override)
+            bb.data.update_data(localdata)
+            newname = localdata.expand(prov)
+            if newname != prov and not d.getVar(newname, False):
+                d.setVar(newname, localdata.expand(newval))
+
+            # implement alternative multilib name
+            newname = localdata.expand("PREFERRED_PROVIDER_" + virt + p + "-" + pkg)
+            if not d.getVar(newname, False):
+                d.setVar(newname, localdata.expand(newval))
+        # Avoid future variable key expansion
+        provexp = d.expand(prov)
+        if prov != provexp and d.getVar(prov, False):
+            d.renameVar(prov, provexp)
+
+
+    mp = (d.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
+    extramp = []
+    for p in mp:
+        if p.endswith("-native") or "-crosssdk-" in p or p.startswith(("nativesdk-", "virtual/nativesdk-")) or 'cross-canadian' in p:
+            continue
+        virt = ""
+        if p.startswith("virtual/"):
+            p = p.replace("virtual/", "")
+            virt = "virtual/"
+        for pref in prefixes:
+            extramp.append(virt + pref + "-" + p)
+    d.setVar("MULTI_PROVIDER_WHITELIST", " ".join(mp + extramp))
+
+python multilib_virtclass_handler_vendor () {
+    if isinstance(e, bb.event.ConfigParsed):
+        for v in e.data.getVar("MULTILIB_VARIANTS", True).split():
+            if e.data.getVar("TARGET_VENDOR_virtclass-multilib-" + v, False) is None:
+                e.data.setVar("TARGET_VENDOR_virtclass-multilib-" + v, e.data.getVar("TARGET_VENDOR", False) + "ml" + v)
+        preferred_ml_updates(e.data)
+}
+addhandler multilib_virtclass_handler_vendor
+multilib_virtclass_handler_vendor[eventmask] = "bb.event.ConfigParsed"
+
+python multilib_virtclass_handler_global () {
+    if not e.data:
+        return
+
+    variant = e.data.getVar("BBEXTENDVARIANT", True)
+
+    if isinstance(e, bb.event.RecipeParsed) and not variant:
+        if bb.data.inherits_class('kernel', e.data) or \
+            bb.data.inherits_class('module-base', e.data) or \
+            (bb.data.inherits_class('allarch', e.data) and\
+             not bb.data.inherits_class('packagegroup', e.data)):
+            variants = (e.data.getVar("MULTILIB_VARIANTS", True) or "").split()
+
+            import oe.classextend
+            clsextends = []
+            for variant in variants:
+                clsextends.append(oe.classextend.ClassExtender(variant, e.data))
+
+            # Process PROVIDES
+            origprovs = provs = e.data.getVar("PROVIDES", True) or ""
+            for clsextend in clsextends:
+                provs = provs + " " + clsextend.map_variable("PROVIDES", setvar=False)
+            e.data.setVar("PROVIDES", provs)
+
+            # Process RPROVIDES
+            origrprovs = rprovs = e.data.getVar("RPROVIDES", True) or ""
+            for clsextend in clsextends:
+                rprovs = rprovs + " " + clsextend.map_variable("RPROVIDES", setvar=False)
+            if rprovs.strip():
+                e.data.setVar("RPROVIDES", rprovs)
+
+	    # Process RPROVIDES_${PN}...
+            for pkg in (e.data.getVar("PACKAGES", True) or "").split():
+                origrprovs = rprovs = e.data.getVar("RPROVIDES_%s" % pkg, True) or ""
+                for clsextend in clsextends:
+                    rprovs = rprovs + " " + clsextend.map_variable("RPROVIDES_%s" % pkg, setvar=False)
+                    rprovs = rprovs + " " + clsextend.extname + "-" + pkg
+                e.data.setVar("RPROVIDES_%s" % pkg, rprovs)
+}
+
+addhandler multilib_virtclass_handler_global
+multilib_virtclass_handler_global[eventmask] = "bb.event.RecipePreFinalise bb.event.RecipeParsed"
+
diff --git a/meta/classes/multilib_header.bbclass b/meta/classes/multilib_header.bbclass
new file mode 100644
index 0000000..5ee0a2d
--- /dev/null
+++ b/meta/classes/multilib_header.bbclass
@@ -0,0 +1,54 @@
+inherit siteinfo
+
+# If applicable on the architecture, this routine will rename the header and
+# add a unique identifier to the name for the ABI/bitsize that is being used.
+# A wrapper will be generated for the architecture that knows how to call
+# all of the ABI variants for that given architecture.
+#
+oe_multilib_header() {
+
+	case ${HOST_OS} in
+	*-musl*)
+		return
+		;;
+	*)
+	esac
+        # We use
+        # For ARM: We don't support multilib builds.
+        # For MIPS: "n32" is a special case, which needs to be
+        # distinct from both 64-bit and 32-bit.
+        case ${TARGET_ARCH} in
+        arm*)   return
+                ;;
+        mips*)  case "${MIPSPKGSFX_ABI}" in
+                "-n32")
+                       ident=n32   
+                       ;;
+                *)     
+                       ident=${SITEINFO_BITS}
+                       ;;
+                esac
+                ;;
+        *)      ident=${SITEINFO_BITS}
+        esac
+	if echo ${TARGET_ARCH} | grep -q arm; then
+	    return
+	fi
+	for each_header in "$@" ; do
+	   if [ ! -f "${D}/${includedir}/$each_header" ]; then
+	      bberror "oe_multilib_header: Unable to find header $each_header."
+	      continue
+	   fi
+	   stem=$(echo $each_header | sed 's#\.h$##')
+	   # if mips64/n32 set ident to n32
+	   mv ${D}/${includedir}/$each_header ${D}/${includedir}/${stem}-${ident}.h
+
+	   sed -e "s#ENTER_HEADER_FILENAME_HERE#${stem}#g" ${COREBASE}/scripts/multilib_header_wrapper.h > ${D}/${includedir}/$each_header
+	done
+}
+
+# Dependencies on arch variables like MIPSPKGSFX_ABI can be problematic.
+# We don't need multilib headers for native builds so brute force things.
+oe_multilib_header_class-native () {
+	return
+}
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass
new file mode 100644
index 0000000..bcbcd61
--- /dev/null
+++ b/meta/classes/native.bbclass
@@ -0,0 +1,183 @@
+# We want native packages to be relocatable
+inherit relocatable
+
+# Native packages are built indirectly via dependency,
+# no need for them to be a direct target of 'world'
+EXCLUDE_FROM_WORLD = "1"
+
+PACKAGES = ""
+PACKAGES_class-native = ""
+PACKAGES_DYNAMIC = ""
+PACKAGES_DYNAMIC_class-native = ""
+PACKAGE_ARCH = "${BUILD_ARCH}"
+
+# used by cmake class
+OECMAKE_RPATH = "${libdir}"
+OECMAKE_RPATH_class-native = "${libdir}"
+
+# When this class has packaging enabled, setting 
+# RPROVIDES becomes unnecessary.
+RPROVIDES = "${PN}"
+
+TARGET_ARCH = "${BUILD_ARCH}"
+TARGET_OS = "${BUILD_OS}"
+TARGET_VENDOR = "${BUILD_VENDOR}"
+TARGET_PREFIX = "${BUILD_PREFIX}"
+TARGET_CC_ARCH = "${BUILD_CC_ARCH}"
+TARGET_LD_ARCH = "${BUILD_LD_ARCH}"
+TARGET_AS_ARCH = "${BUILD_AS_ARCH}"
+TARGET_CPPFLAGS = "${BUILD_CPPFLAGS}"
+TARGET_CFLAGS = "${BUILD_CFLAGS}"
+TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}"
+TARGET_LDFLAGS = "${BUILD_LDFLAGS}"
+TARGET_FPU = ""
+
+HOST_ARCH = "${BUILD_ARCH}"
+HOST_OS = "${BUILD_OS}"
+HOST_VENDOR = "${BUILD_VENDOR}"
+HOST_PREFIX = "${BUILD_PREFIX}"
+HOST_CC_ARCH = "${BUILD_CC_ARCH}"
+HOST_LD_ARCH = "${BUILD_LD_ARCH}"
+HOST_AS_ARCH = "${BUILD_AS_ARCH}"
+
+CPPFLAGS = "${BUILD_CPPFLAGS}"
+CFLAGS = "${BUILD_CFLAGS}"
+CXXFLAGS = "${BUILD_CFLAGS}"
+LDFLAGS = "${BUILD_LDFLAGS}"
+LDFLAGS_build-darwin = "-L${STAGING_LIBDIR_NATIVE} "
+
+STAGING_BINDIR = "${STAGING_BINDIR_NATIVE}"
+STAGING_BINDIR_CROSS = "${STAGING_BINDIR_NATIVE}"
+
+# native pkg doesn't need the TOOLCHAIN_OPTIONS.
+TOOLCHAIN_OPTIONS = ""
+
+DEPENDS_GETTEXT = "gettext-native"
+
+# Don't build ptest natively
+PTEST_ENABLED = "0"
+
+# Don't use site files for native builds
+export CONFIG_SITE = "${COREBASE}/meta/site/native"
+
+# set the compiler as well. It could have been set to something else
+export CC = "${BUILD_CC}"
+export CXX = "${BUILD_CXX}"
+export FC = "${BUILD_FC}"
+export CPP = "${BUILD_CPP}"
+export LD = "${BUILD_LD}"
+export CCLD = "${BUILD_CCLD}"
+export AR = "${BUILD_AR}"
+export AS = "${BUILD_AS}"
+export RANLIB = "${BUILD_RANLIB}"
+export STRIP = "${BUILD_STRIP}"
+export NM = "${BUILD_NM}"
+
+# Path prefixes
+base_prefix = "${STAGING_DIR_NATIVE}"
+prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
+exec_prefix = "${STAGING_DIR_NATIVE}${prefix_native}"
+
+bindir = "${STAGING_BINDIR_NATIVE}"
+sbindir = "${STAGING_SBINDIR_NATIVE}"
+libdir = "${STAGING_LIBDIR_NATIVE}"
+includedir = "${STAGING_INCDIR_NATIVE}"
+sysconfdir = "${STAGING_ETCDIR_NATIVE}"
+datadir = "${STAGING_DATADIR_NATIVE}"
+
+baselib = "lib"
+
+# Libtool's default paths are correct for the native machine
+lt_cv_sys_lib_dlsearch_path_spec[unexport] = "1"
+
+NATIVE_PACKAGE_PATH_SUFFIX ?= ""
+bindir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
+libdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
+libexecdir .= "${NATIVE_PACKAGE_PATH_SUFFIX}"
+
+do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_NATIVE}/"
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_NATIVE}/"
+
+# Since we actually install these into situ there is no staging prefix
+STAGING_DIR_HOST = ""
+STAGING_DIR_TARGET = ""
+PKG_CONFIG_DIR = "${libdir}/pkgconfig"
+
+EXTRA_NATIVE_PKGCONFIG_PATH ?= ""
+PKG_CONFIG_PATH .= "${EXTRA_NATIVE_PKGCONFIG_PATH}"
+PKG_CONFIG_SYSROOT_DIR = ""
+
+# we dont want libc-uclibc or libc-glibc to kick in for native recipes
+LIBCOVERRIDE = ""
+CLASSOVERRIDE = "class-native"
+MACHINEOVERRIDES = ""
+
+PATH_prepend = "${COREBASE}/scripts/native-intercept:"
+
+python native_virtclass_handler () {
+    classextend = e.data.getVar('BBCLASSEXTEND', True) or ""
+    if "native" not in classextend:
+        return
+
+    pn = e.data.getVar("PN", True)
+    if not pn.endswith("-native"):
+        return
+
+    def map_dependencies(varname, d, suffix = ""):
+        if suffix:
+            varname = varname + "_" + suffix
+        deps = d.getVar(varname, True)
+        if not deps:
+            return
+        deps = bb.utils.explode_deps(deps)
+        newdeps = []
+        for dep in deps:
+            if dep == pn:
+                continue
+            elif "-cross-" in dep:
+                newdeps.append(dep.replace("-cross", "-native"))
+            elif not dep.endswith("-native"):
+                newdeps.append(dep + "-native")
+            else:
+                newdeps.append(dep)
+        d.setVar(varname, " ".join(newdeps))
+
+    e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-native")
+
+    map_dependencies("DEPENDS", e.data)
+    for pkg in [e.data.getVar("PN", True), "", "${PN}"]:
+        map_dependencies("RDEPENDS", e.data, pkg)
+        map_dependencies("RRECOMMENDS", e.data, pkg)
+        map_dependencies("RSUGGESTS", e.data, pkg)
+        map_dependencies("RPROVIDES", e.data, pkg)
+        map_dependencies("RREPLACES", e.data, pkg)
+
+    provides = e.data.getVar("PROVIDES", True)
+    nprovides = []
+    for prov in provides.split():
+        if prov.find(pn) != -1:
+            nprovides.append(prov)
+        elif not prov.endswith("-native"):
+            nprovides.append(prov.replace(prov, prov + "-native"))
+        else:
+            nprovides.append(prov)
+    e.data.setVar("PROVIDES", ' '.join(nprovides))
+
+
+}
+
+addhandler native_virtclass_handler
+native_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
+
+deltask package
+deltask packagedata
+deltask package_qa
+deltask package_write_ipk
+deltask package_write_deb
+deltask package_write_rpm
+deltask package_write
+
+do_packagedata[stamp-extra-info] = ""
+do_populate_sysroot[stamp-extra-info] = ""
+
+USE_NLS = "no"
diff --git a/meta/classes/nativesdk.bbclass b/meta/classes/nativesdk.bbclass
new file mode 100644
index 0000000..f74da62
--- /dev/null
+++ b/meta/classes/nativesdk.bbclass
@@ -0,0 +1,97 @@
+# SDK packages are built either explicitly by the user,
+# or indirectly via dependency.  No need to be in 'world'.
+EXCLUDE_FROM_WORLD = "1"
+
+STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${SDK_ARCH}${SDK_VENDOR}-${SDK_OS}"
+
+# libc for the SDK can be different to that of the target
+NATIVESDKLIBC ?= "libc-glibc"
+LIBCOVERRIDE = ":${NATIVESDKLIBC}"
+CLASSOVERRIDE = "class-nativesdk"
+MACHINEOVERRIDES = ""
+
+#
+# Update PACKAGE_ARCH and PACKAGE_ARCHS
+#
+PACKAGE_ARCH = "${SDK_ARCH}-${SDKPKGSUFFIX}"
+PACKAGE_ARCHS = "${SDK_PACKAGE_ARCHS}"
+
+#
+# We need chrpath >= 0.14 to ensure we can deal with 32 and 64 bit
+# binaries
+#
+DEPENDS_append = " chrpath-replacement-native"
+EXTRANATIVEPATH += "chrpath-native"
+
+STAGING_DIR_HOST = "${STAGING_DIR}/${MULTIMACH_HOST_SYS}"
+STAGING_DIR_TARGET = "${STAGING_DIR}/${MULTIMACH_TARGET_SYS}"
+PKGDATA_DIR = "${STAGING_DIR_HOST}/pkgdata"
+
+HOST_ARCH = "${SDK_ARCH}"
+HOST_VENDOR = "${SDK_VENDOR}"
+HOST_OS = "${SDK_OS}"
+HOST_PREFIX = "${SDK_PREFIX}"
+HOST_CC_ARCH = "${SDK_CC_ARCH}"
+HOST_LD_ARCH = "${SDK_LD_ARCH}"
+HOST_AS_ARCH = "${SDK_AS_ARCH}"
+#HOST_SYS = "${HOST_ARCH}${TARGET_VENDOR}-${HOST_OS}"
+
+TARGET_ARCH = "${SDK_ARCH}"
+TARGET_VENDOR = "${SDK_VENDOR}"
+TARGET_OS = "${SDK_OS}"
+TARGET_PREFIX = "${SDK_PREFIX}"
+TARGET_CC_ARCH = "${SDK_CC_ARCH}"
+TARGET_LD_ARCH = "${SDK_LD_ARCH}"
+TARGET_AS_ARCH = "${SDK_AS_ARCH}"
+TARGET_FPU = ""
+EXTRA_OECONF_GCC_FLOAT = ""
+
+CPPFLAGS = "${BUILDSDK_CPPFLAGS}"
+CFLAGS = "${BUILDSDK_CFLAGS}"
+CXXFLAGS = "${BUILDSDK_CFLAGS}"
+LDFLAGS = "${BUILDSDK_LDFLAGS}"
+
+# Change to place files in SDKPATH
+base_prefix = "${SDKPATHNATIVE}"
+prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+exec_prefix = "${SDKPATHNATIVE}${prefix_nativesdk}"
+baselib = "lib"
+sbindir = "${bindir}"
+
+export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
+export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
+
+python nativesdk_virtclass_handler () {
+    pn = e.data.getVar("PN", True)
+    if not (pn.endswith("-nativesdk") or pn.startswith("nativesdk-")):
+        return
+
+    e.data.setVar("MLPREFIX", "nativesdk-")
+    e.data.setVar("PN", "nativesdk-" + e.data.getVar("PN", True).replace("-nativesdk", "").replace("nativesdk-", ""))
+    e.data.setVar("OVERRIDES", e.data.getVar("OVERRIDES", False) + ":virtclass-nativesdk")
+}
+
+python () {
+    pn = d.getVar("PN", True)
+    if not pn.startswith("nativesdk-"):
+        return
+
+    import oe.classextend
+
+    clsextend = oe.classextend.NativesdkClassExtender("nativesdk", d)
+    clsextend.rename_packages()
+    clsextend.rename_package_variables((d.getVar("PACKAGEVARS", True) or "").split())
+
+    clsextend.map_depends_variable("DEPENDS")
+    clsextend.map_packagevars()
+    clsextend.map_variable("PROVIDES")
+    clsextend.map_regexp_variable("PACKAGES_DYNAMIC")
+}
+
+addhandler nativesdk_virtclass_handler
+nativesdk_virtclass_handler[eventmask] = "bb.event.RecipePreFinalise"
+
+do_populate_sysroot[stamp-extra-info] = ""
+do_packagedata[stamp-extra-info] = ""
+
+USE_NLS = "${SDKUSE_NLS}"
diff --git a/meta/classes/oelint.bbclass b/meta/classes/oelint.bbclass
new file mode 100644
index 0000000..1b051ca
--- /dev/null
+++ b/meta/classes/oelint.bbclass
@@ -0,0 +1,84 @@
+addtask lint before do_build
+do_lint[nostamp] = "1"
+python do_lint() {
+    pkgname = d.getVar("PN", True)
+
+    ##############################
+    # Test that DESCRIPTION exists
+    #
+    description = d.getVar("DESCRIPTION", False)
+    if description[1:10] == '{SUMMARY}':
+        bb.warn("%s: DESCRIPTION is not set" % pkgname)
+
+
+    ##############################
+    # Test that HOMEPAGE exists
+    #
+    homepage = d.getVar("HOMEPAGE", False)
+    if homepage == '':
+        bb.warn("%s: HOMEPAGE is not set" % pkgname)
+    elif not homepage.startswith("http://") and not homepage.startswith("https://"):
+        bb.warn("%s: HOMEPAGE doesn't start with http:// or https://" % pkgname)
+
+
+    ##############################
+    # Test for valid SECTION
+    #
+    section = d.getVar("SECTION", False)
+    if section == '':
+        bb.warn("%s: SECTION is not set" % pkgname)
+    elif not section.islower():
+        bb.warn("%s: SECTION should only use lower case" % pkgname)
+
+
+    ##############################
+    # Check that all patches have Signed-off-by and Upstream-Status
+    #
+    srcuri = d.getVar("SRC_URI", False).split()
+    fpaths = (d.getVar('FILESPATH', True) or '').split(':')
+
+    def findPatch(patchname):
+        for dir in fpaths:
+            patchpath = dir + patchname
+            if os.path.exists(patchpath):
+                 return patchpath
+
+    def findKey(path, key):
+        ret = True
+        f = file('%s' % path, mode = 'r')
+        line = f.readline()
+        while line:
+            if line.find(key) != -1:
+                ret = False
+            line = f.readline()
+        f.close()
+        return ret
+
+    def checkPN(pkgname, varname, str):
+        if str.find("{PN}") != -1:
+            bb.warn("%s: should use BPN instead of PN in %s" % (pkgname, varname))
+        if str.find("{P}") != -1:
+            bb.warn("%s: should use BP instead of P in %s" % (pkgname, varname))
+
+    length = len("file://")
+    for item in srcuri:
+        if item.startswith("file://"):
+            item = item[length:]
+            if item.endswith(".patch") or item.endswith(".diff"):
+                path = findPatch(item)
+                if findKey(path, "Signed-off-by"):
+                    bb.warn("%s: %s doesn't have Signed-off-by" % (pkgname, item))
+                if findKey(path, "Upstream-Status"):
+                    bb.warn("%s: %s doesn't have Upstream-Status" % (pkgname, item))
+
+
+    ##############################
+    # Check for ${PN} or ${P} usage in SRC_URI or S
+    # Should use ${BPN} or ${BP} instead to avoid breaking multilib
+    #
+    for s in srcuri:
+        if not s.startswith("file://"):
+            checkPN(pkgname, 'SRC_URI', s)
+
+    checkPN(pkgname, 'S', d.getVar('S', False))
+}
diff --git a/meta/classes/own-mirrors.bbclass b/meta/classes/own-mirrors.bbclass
new file mode 100644
index 0000000..e235227
--- /dev/null
+++ b/meta/classes/own-mirrors.bbclass
@@ -0,0 +1,12 @@
+PREMIRRORS() {
+cvs://.*/.*     ${SOURCE_MIRROR_URL}
+svn://.*/.*     ${SOURCE_MIRROR_URL}
+git://.*/.*     ${SOURCE_MIRROR_URL}
+gitsm://.*/.*   ${SOURCE_MIRROR_URL}
+hg://.*/.*      ${SOURCE_MIRROR_URL}
+bzr://.*/.*     ${SOURCE_MIRROR_URL}
+p4://.*/.*      ${SOURCE_MIRROR_URL}
+osc://.*/.*     ${SOURCE_MIRROR_URL}
+https?$://.*/.* ${SOURCE_MIRROR_URL}
+ftp://.*/.*     ${SOURCE_MIRROR_URL}
+}
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
new file mode 100644
index 0000000..cd92beb
--- /dev/null
+++ b/meta/classes/package.bbclass
@@ -0,0 +1,2086 @@
+#
+# Packaging process
+#
+# Executive summary: This class iterates over the functions listed in PACKAGEFUNCS
+# Taking D and splitting it up into the packages listed in PACKAGES, placing the
+# resulting output in PKGDEST.
+#
+# There are the following default steps but PACKAGEFUNCS can be extended:
+#
+# a) package_get_auto_pr - get PRAUTO from remote PR service
+#
+# b) perform_packagecopy - Copy D into PKGD
+#
+# c) package_do_split_locales - Split out the locale files, updates FILES and PACKAGES
+#
+# d) split_and_strip_files - split the files into runtime and debug and strip them.
+#    Debug files include debug info split, and associated sources that end up in -dbg packages
+#
+# e) fixup_perms - Fix up permissions in the package before we split it.
+#
+# f) populate_packages - Split the files in PKGD into separate packages in PKGDEST/<pkgname>
+#    Also triggers the binary stripping code to put files in -dbg packages.
+#
+# g) package_do_filedeps - Collect perfile run-time dependency metadata
+#    The data is stores in FILER{PROVIDES,DEPENDS}_file_pkg variables with
+#    a list of affected files in FILER{PROVIDES,DEPENDS}FLIST_pkg
+#
+# h) package_do_shlibs - Look at the shared libraries generated and autotmatically add any
+#    depenedencies found. Also stores the package name so anyone else using this library
+#    knows which package to depend on.
+#
+# i) package_do_pkgconfig - Keep track of which packages need and provide which .pc files
+#
+# j) read_shlibdeps - Reads the stored shlibs information into the metadata
+#
+# k) package_depchains - Adds automatic dependencies to -dbg and -dev packages
+#
+# l) emit_pkgdata - saves the packaging data into PKGDATA_DIR for use in later
+#    packaging steps
+
+inherit packagedata
+inherit prserv
+inherit chrpath
+
+# Need the package_qa_handle_error() in insane.bbclass
+inherit insane
+
+PKGD    = "${WORKDIR}/package"
+PKGDEST = "${WORKDIR}/packages-split"
+
+LOCALE_SECTION ?= ''
+
+ALL_MULTILIB_PACKAGE_ARCHS = "${@all_multilib_tune_values(d, 'PACKAGE_ARCHS')}"
+
+# rpm is used for the per-file dependency identification
+PACKAGE_DEPENDS += "rpm-native"
+
+def legitimize_package_name(s):
+    """
+    Make sure package names are legitimate strings
+    """
+    import re
+
+    def fixutf(m):
+        cp = m.group(1)
+        if cp:
+            return ('\u%s' % cp).decode('unicode_escape').encode('utf-8')
+
+    # Handle unicode codepoints encoded as <U0123>, as in glibc locale files.
+    s = re.sub('<U([0-9A-Fa-f]{1,4})>', fixutf, s)
+
+    # Remaining package name validity fixes
+    return s.lower().replace('_', '-').replace('@', '+').replace(',', '+').replace('/', '-')
+
+def do_split_packages(d, root, file_regex, output_pattern, description, postinst=None, recursive=False, hook=None, extra_depends=None, aux_files_pattern=None, postrm=None, allow_dirs=False, prepend=False, match_path=False, aux_files_pattern_verbatim=None, allow_links=False, summary=None):
+    """
+    Used in .bb files to split up dynamically generated subpackages of a
+    given package, usually plugins or modules.
+
+    Arguments:
+    root           -- the path in which to search
+    file_regex     -- regular expression to match searched files. Use
+                      parentheses () to mark the part of this expression
+                      that should be used to derive the module name (to be
+                      substituted where %s is used in other function
+                      arguments as noted below)
+    output_pattern -- pattern to use for the package names. Must include %s.
+    description    -- description to set for each package. Must include %s.
+    postinst       -- postinstall script to use for all packages (as a
+                      string)
+    recursive      -- True to perform a recursive search - default False
+    hook           -- a hook function to be called for every match. The
+                      function will be called with the following arguments
+                      (in the order listed):
+                        f: full path to the file/directory match
+                        pkg: the package name
+                        file_regex: as above
+                        output_pattern: as above
+                        modulename: the module name derived using file_regex
+    extra_depends  -- extra runtime dependencies (RDEPENDS) to be set for
+                      all packages. The default value of None causes a
+                      dependency on the main package (${PN}) - if you do
+                      not want this, pass '' for this parameter.
+    aux_files_pattern -- extra item(s) to be added to FILES for each
+                      package. Can be a single string item or a list of
+                      strings for multiple items.  Must include %s.
+    postrm         -- postrm script to use for all packages (as a string)
+    allow_dirs     -- True allow directories to be matched - default False
+    prepend        -- if True, prepend created packages to PACKAGES instead
+                      of the default False which appends them
+    match_path     -- match file_regex on the whole relative path to the
+                      root rather than just the file name
+    aux_files_pattern_verbatim -- extra item(s) to be added to FILES for
+                      each package, using the actual derived module name
+                      rather than converting it to something legal for a
+                      package name. Can be a single string item or a list
+                      of strings for multiple items. Must include %s.
+    allow_links    -- True to allow symlinks to be matched - default False
+    summary        -- Summary to set for each package. Must include %s;
+                      defaults to description if not set.
+
+    """
+
+    dvar = d.getVar('PKGD', True)
+
+    # If the root directory doesn't exist, don't error out later but silently do
+    # no splitting.
+    if not os.path.exists(dvar + root):
+        return []
+
+    ml = d.getVar("MLPREFIX", True)
+    if ml:
+        if not output_pattern.startswith(ml):
+            output_pattern = ml + output_pattern
+
+        newdeps = []
+        for dep in (extra_depends or "").split():
+            if dep.startswith(ml):
+                newdeps.append(dep)
+            else:
+                newdeps.append(ml + dep)
+        if newdeps:
+            extra_depends = " ".join(newdeps)
+
+
+    packages = d.getVar('PACKAGES', True).split()
+    split_packages = []
+
+    if postinst:
+        postinst = '#!/bin/sh\n' + postinst + '\n'
+    if postrm:
+        postrm = '#!/bin/sh\n' + postrm + '\n'
+    if not recursive:
+        objs = os.listdir(dvar + root)
+    else:
+        objs = []
+        for walkroot, dirs, files in os.walk(dvar + root):
+            for file in files:
+                relpath = os.path.join(walkroot, file).replace(dvar + root + '/', '', 1)
+                if relpath:
+                    objs.append(relpath)
+
+    if extra_depends == None:
+        extra_depends = d.getVar("PN", True)
+
+    if not summary:
+        summary = description
+
+    for o in sorted(objs):
+        import re, stat
+        if match_path:
+            m = re.match(file_regex, o)
+        else:
+            m = re.match(file_regex, os.path.basename(o))
+
+        if not m:
+            continue
+        f = os.path.join(dvar + root, o)
+        mode = os.lstat(f).st_mode
+        if not (stat.S_ISREG(mode) or (allow_links and stat.S_ISLNK(mode)) or (allow_dirs and stat.S_ISDIR(mode))):
+            continue
+        on = legitimize_package_name(m.group(1))
+        pkg = output_pattern % on
+        split_packages.append(pkg)
+        if not pkg in packages:
+            if prepend:
+                packages = [pkg] + packages
+            else:
+                packages.append(pkg)
+        oldfiles = d.getVar('FILES_' + pkg, True)
+        newfile = os.path.join(root, o)
+        # These names will be passed through glob() so if the filename actually
+        # contains * or ? (rare, but possible) we need to handle that specially
+        newfile = newfile.replace('*', '[*]')
+        newfile = newfile.replace('?', '[?]')
+        if not oldfiles:
+            the_files = [newfile]
+            if aux_files_pattern:
+                if type(aux_files_pattern) is list:
+                    for fp in aux_files_pattern:
+                        the_files.append(fp % on)
+                else:
+                    the_files.append(aux_files_pattern % on)
+            if aux_files_pattern_verbatim:
+                if type(aux_files_pattern_verbatim) is list:
+                    for fp in aux_files_pattern_verbatim:
+                        the_files.append(fp % m.group(1))
+                else:
+                    the_files.append(aux_files_pattern_verbatim % m.group(1))
+            d.setVar('FILES_' + pkg, " ".join(the_files))
+        else:
+            d.setVar('FILES_' + pkg, oldfiles + " " + newfile)
+        if extra_depends != '':
+            d.appendVar('RDEPENDS_' + pkg, ' ' + extra_depends)
+        if not d.getVar('DESCRIPTION_' + pkg, True):
+            d.setVar('DESCRIPTION_' + pkg, description % on)
+        if not d.getVar('SUMMARY_' + pkg, True):
+            d.setVar('SUMMARY_' + pkg, summary % on)
+        if postinst:
+            d.setVar('pkg_postinst_' + pkg, postinst)
+        if postrm:
+            d.setVar('pkg_postrm_' + pkg, postrm)
+        if callable(hook):
+            hook(f, pkg, file_regex, output_pattern, m.group(1))
+
+    d.setVar('PACKAGES', ' '.join(packages))
+    return split_packages
+
+PACKAGE_DEPENDS += "file-native"
+
+python () {
+    if d.getVar('PACKAGES', True) != '':
+        deps = ""
+        for dep in (d.getVar('PACKAGE_DEPENDS', True) or "").split():
+            deps += " %s:do_populate_sysroot" % dep
+        d.appendVarFlag('do_package', 'depends', deps)
+
+        # shlibs requires any DEPENDS to have already packaged for the *.list files
+        d.appendVarFlag('do_package', 'deptask', " do_packagedata")
+}
+
+# Get a list of files from file vars by searching files under current working directory
+# The list contains symlinks, directories and normal files.
+def files_from_filevars(filevars):
+    import os,glob
+    cpath = oe.cachedpath.CachedPath()
+    files = []
+    for f in filevars:
+        if os.path.isabs(f):
+            f = '.' + f
+        if not f.startswith("./"):
+            f = './' + f
+        globbed = glob.glob(f)
+        if globbed:
+            if [ f ] != globbed:
+                files += globbed
+                continue
+        files.append(f)
+
+    for f in files:
+        if not cpath.islink(f):
+            if cpath.isdir(f):
+                newfiles = [ os.path.join(f,x) for x in os.listdir(f) ]
+                if newfiles:
+                    files += newfiles
+
+    return files
+
+# Called in package_<rpm,ipk,deb>.bbclass to get the correct list of configuration files
+def get_conffiles(pkg, d):
+    pkgdest = d.getVar('PKGDEST', True)
+    root = os.path.join(pkgdest, pkg)
+    cwd = os.getcwd()
+    os.chdir(root)
+
+    conffiles = d.getVar('CONFFILES_%s' % pkg, True);
+    if conffiles == None:
+        conffiles = d.getVar('CONFFILES', True)
+    if conffiles == None:
+        conffiles = ""
+    conffiles = conffiles.split()
+    conf_orig_list = files_from_filevars(conffiles)
+
+    # Remove links and directories from conf_orig_list to get conf_list which only contains normal files
+    conf_list = []
+    for f in conf_orig_list:
+        if os.path.isdir(f):
+            continue
+        if os.path.islink(f):
+            continue
+        if not os.path.exists(f):
+            continue
+        conf_list.append(f)
+
+    # Remove the leading './'
+    for i in range(0, len(conf_list)):
+        conf_list[i] = conf_list[i][1:]
+
+    os.chdir(cwd)
+    return conf_list
+
+def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d):
+    # Function to split a single file into two components, one is the stripped
+    # target system binary, the other contains any debugging information. The
+    # two files are linked to reference each other.
+    #
+    # sourcefile is also generated containing a list of debugsources
+
+    import stat
+
+    dvar = d.getVar('PKGD', True)
+    objcopy = d.getVar("OBJCOPY", True)
+    debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
+    workdir = d.getVar("WORKDIR", True)
+    workparentdir = d.getVar("DEBUGSRC_OVERRIDE_PATH", True) or os.path.dirname(os.path.dirname(workdir))
+
+    # We ignore kernel modules, we don't generate debug info files.
+    if file.find("/lib/modules/") != -1 and file.endswith(".ko"):
+        return 1
+
+    newmode = None
+    if not os.access(file, os.W_OK) or os.access(file, os.R_OK):
+        origmode = os.stat(file)[stat.ST_MODE]
+        newmode = origmode | stat.S_IWRITE | stat.S_IREAD
+        os.chmod(file, newmode)
+
+    # We need to extract the debug src information here...
+    if debugsrcdir:
+        cmd = "'%s' -b '%s' -d '%s' -i -l '%s' '%s'" % (debugedit, workparentdir, debugsrcdir, sourcefile, file)
+        (retval, output) = oe.utils.getstatusoutput(cmd)
+        if retval:
+            bb.fatal("debugedit failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+
+    bb.utils.mkdirhier(os.path.dirname(debugfile))
+
+    cmd = "'%s' --only-keep-debug '%s' '%s'" % (objcopy, file, debugfile)
+    (retval, output) = oe.utils.getstatusoutput(cmd)
+    if retval:
+        bb.fatal("objcopy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+
+    # Set the debuglink to have the view of the file path on the target
+    cmd = "'%s' --add-gnu-debuglink='%s' '%s'" % (objcopy, debugfile, file)
+    (retval, output) = oe.utils.getstatusoutput(cmd)
+    if retval:
+        bb.fatal("objcopy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+
+    if newmode:
+        os.chmod(file, origmode)
+
+    return 0
+
+def copydebugsources(debugsrcdir, d):
+    # The debug src information written out to sourcefile is further procecessed
+    # and copied to the destination here.
+
+    import stat
+
+    sourcefile = d.expand("${WORKDIR}/debugsources.list")
+    if debugsrcdir and os.path.isfile(sourcefile):
+        dvar = d.getVar('PKGD', True)
+        strip = d.getVar("STRIP", True)
+        objcopy = d.getVar("OBJCOPY", True)
+        debugedit = d.expand("${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit")
+        workdir = d.getVar("WORKDIR", True)
+        workparentdir = os.path.dirname(os.path.dirname(workdir))
+        workbasedir = os.path.basename(os.path.dirname(workdir)) + "/" + os.path.basename(workdir)
+
+        nosuchdir = []
+        basepath = dvar
+        for p in debugsrcdir.split("/"):
+            basepath = basepath + "/" + p
+            if not cpath.exists(basepath):
+                nosuchdir.append(basepath)
+        bb.utils.mkdirhier(basepath)
+        cpath.updatecache(basepath)
+
+        processdebugsrc =  "LC_ALL=C ; sort -z -u '%s' | egrep -v -z '(<internal>|<built-in>)$' | "
+        # We need to ignore files that are not actually ours
+        # we do this by only paying attention to items from this package
+        processdebugsrc += "fgrep -zw '%s' | "
+        processdebugsrc += "(cd '%s' ; cpio -pd0mlL --no-preserve-owner '%s%s' 2>/dev/null)"
+
+        cmd = processdebugsrc % (sourcefile, workbasedir, workparentdir, dvar, debugsrcdir)
+        (retval, output) = oe.utils.getstatusoutput(cmd)
+        # Can "fail" if internal headers/transient sources are attempted
+        #if retval:
+        #    bb.fatal("debug source copy failed with exit code %s (cmd was %s)" % (retval, cmd))
+
+        # cpio seems to have a bug with -lL together and symbolic links are just copied, not dereferenced.
+        # Work around this by manually finding and copying any symbolic links that made it through.
+        cmd = "find %s%s -type l -print0 -delete | sed s#%s%s/##g | (cd '%s' ; cpio -pd0mL --no-preserve-owner '%s%s' 2>/dev/null)" % (dvar, debugsrcdir, dvar, debugsrcdir, workparentdir, dvar, debugsrcdir)
+        (retval, output) = oe.utils.getstatusoutput(cmd)
+        if retval:
+            bb.fatal("debugsrc symlink fixup failed with exit code %s (cmd was %s)" % (retval, cmd))
+
+        # The copy by cpio may have resulted in some empty directories!  Remove these
+        cmd = "find %s%s -empty -type d -delete" % (dvar, debugsrcdir)
+        (retval, output) = oe.utils.getstatusoutput(cmd)
+        if retval:
+            bb.fatal("empty directory removal failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+
+        # Also remove debugsrcdir if its empty
+        for p in nosuchdir[::-1]:
+            if os.path.exists(p) and not os.listdir(p):
+                os.rmdir(p)
+
+#
+# Package data handling routines
+#
+
+def get_package_mapping (pkg, basepkg, d):
+    import oe.packagedata
+
+    data = oe.packagedata.read_subpkgdata(pkg, d)
+    key = "PKG_%s" % pkg
+
+    if key in data:
+        # Have to avoid undoing the write_extra_pkgs(global_variants...)
+        if bb.data.inherits_class('allarch', d) and data[key] == basepkg:
+            return pkg
+        return data[key]
+
+    return pkg
+
+def get_package_additional_metadata (pkg_type, d):
+    base_key = "PACKAGE_ADD_METADATA"
+    for key in ("%s_%s" % (base_key, pkg_type.upper()), base_key):
+        if d.getVar(key, False) is None:
+            continue
+        d.setVarFlag(key, "type", "list")
+        if d.getVarFlag(key, "separator") is None:
+            d.setVarFlag(key, "separator", "\\n")
+        metadata_fields = [field.strip() for field in oe.data.typed_value(key, d)]
+        return "\n".join(metadata_fields).strip()
+
+def runtime_mapping_rename (varname, pkg, d):
+    #bb.note("%s before: %s" % (varname, d.getVar(varname, True)))
+
+    if bb.data.inherits_class('packagegroup', d):
+        return
+
+    new_depends = {}
+    deps = bb.utils.explode_dep_versions2(d.getVar(varname, True) or "")
+    for depend in deps:
+        new_depend = get_package_mapping(depend, pkg, d)
+        new_depends[new_depend] = deps[depend]
+
+    d.setVar(varname, bb.utils.join_deps(new_depends, commasep=False))
+
+    #bb.note("%s after: %s" % (varname, d.getVar(varname, True)))
+
+#
+# Package functions suitable for inclusion in PACKAGEFUNCS
+#
+
+python package_get_auto_pr() {
+    import oe.prservice
+    import re
+
+    # Support per recipe PRSERV_HOST
+    pn = d.getVar('PN', True)
+    host = d.getVar("PRSERV_HOST_" + pn, True)
+    if not (host is None):
+        d.setVar("PRSERV_HOST", host)
+
+    pkgv = d.getVar("PKGV", True)
+
+    # PR Server not active, handle AUTOINC
+    if not d.getVar('PRSERV_HOST', True):
+        if 'AUTOINC' in pkgv:
+            d.setVar("PKGV", pkgv.replace("AUTOINC", "0"))
+        return
+
+    auto_pr = None
+    pv = d.getVar("PV", True)
+    version = d.getVar("PRAUTOINX", True)
+    pkgarch = d.getVar("PACKAGE_ARCH", True)
+    checksum = d.getVar("BB_TASKHASH", True)
+
+    if d.getVar('PRSERV_LOCKDOWN', True):
+        auto_pr = d.getVar('PRAUTO_' + version + '_' + pkgarch, True) or d.getVar('PRAUTO_' + version, True) or None
+        if auto_pr is None:
+            bb.fatal("Can NOT get PRAUTO from lockdown exported file")
+        d.setVar('PRAUTO',str(auto_pr))
+        return
+
+    try:
+        conn = d.getVar("__PRSERV_CONN", True)
+        if conn is None:
+            conn = oe.prservice.prserv_make_conn(d)
+        if conn is not None:
+            if "AUTOINC" in pkgv:
+                srcpv = bb.fetch2.get_srcrev(d)
+                base_ver = "AUTOINC-%s" % version[:version.find(srcpv)]
+                value = conn.getPR(base_ver, pkgarch, srcpv)
+                d.setVar("PKGV", pkgv.replace("AUTOINC", str(value)))
+
+            auto_pr = conn.getPR(version, pkgarch, checksum)
+    except Exception as e:
+        bb.fatal("Can NOT get PRAUTO, exception %s" %  str(e))
+    if auto_pr is None:
+        bb.fatal("Can NOT get PRAUTO from remote PR service")
+    d.setVar('PRAUTO',str(auto_pr))
+}
+
+LOCALEBASEPN ??= "${PN}"
+
+python package_do_split_locales() {
+    if (d.getVar('PACKAGE_NO_LOCALE', True) == '1'):
+        bb.debug(1, "package requested not splitting locales")
+        return
+
+    packages = (d.getVar('PACKAGES', True) or "").split()
+
+    datadir = d.getVar('datadir', True)
+    if not datadir:
+        bb.note("datadir not defined")
+        return
+
+    dvar = d.getVar('PKGD', True)
+    pn = d.getVar('LOCALEBASEPN', True)
+
+    if pn + '-locale' in packages:
+        packages.remove(pn + '-locale')
+
+    localedir = os.path.join(dvar + datadir, 'locale')
+
+    if not cpath.isdir(localedir):
+        bb.debug(1, "No locale files in this package")
+        return
+
+    locales = os.listdir(localedir)
+
+    summary = d.getVar('SUMMARY', True) or pn
+    description = d.getVar('DESCRIPTION', True) or ""
+    locale_section = d.getVar('LOCALE_SECTION', True)
+    mlprefix = d.getVar('MLPREFIX', True) or ""
+    for l in sorted(locales):
+        ln = legitimize_package_name(l)
+        pkg = pn + '-locale-' + ln
+        packages.append(pkg)
+        d.setVar('FILES_' + pkg, os.path.join(datadir, 'locale', l))
+        d.setVar('RRECOMMENDS_' + pkg, '%svirtual-locale-%s' % (mlprefix, ln))
+        d.setVar('RPROVIDES_' + pkg, '%s-locale %s%s-translation' % (pn, mlprefix, ln))
+        d.setVar('SUMMARY_' + pkg, '%s - %s translations' % (summary, l))
+        d.setVar('DESCRIPTION_' + pkg, '%s  This package contains language translation files for the %s locale.' % (description, l))
+        if locale_section:
+            d.setVar('SECTION_' + pkg, locale_section)
+
+    d.setVar('PACKAGES', ' '.join(packages))
+
+    # Disabled by RP 18/06/07
+    # Wildcards aren't supported in debian
+    # They break with ipkg since glibc-locale* will mean that
+    # glibc-localedata-translit* won't install as a dependency
+    # for some other package which breaks meta-toolchain
+    # Probably breaks since virtual-locale- isn't provided anywhere
+    #rdep = (d.getVar('RDEPENDS_%s' % pn, True) or "").split()
+    #rdep.append('%s-locale*' % pn)
+    #d.setVar('RDEPENDS_%s' % pn, ' '.join(rdep))
+}
+
+python perform_packagecopy () {
+    dest = d.getVar('D', True)
+    dvar = d.getVar('PKGD', True)
+
+    # Start by package population by taking a copy of the installed
+    # files to operate on
+    # Preserve sparse files and hard links
+    cmd = 'tar -cf - -C %s -p . | tar -xf - -C %s' % (dest, dvar)
+    (retval, output) = oe.utils.getstatusoutput(cmd)
+    if retval:
+        bb.fatal("file copy failed with exit code %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
+
+    # replace RPATHs for the nativesdk binaries, to make them relocatable
+    if bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('cross-canadian', d):
+        rpath_replace (dvar, d)
+}
+perform_packagecopy[cleandirs] = "${PKGD}"
+perform_packagecopy[dirs] = "${PKGD}"
+
+# We generate a master list of directories to process, we start by
+# seeding this list with reasonable defaults, then load from
+# the fs-perms.txt files
+python fixup_perms () {
+    import pwd, grp
+
+    # init using a string with the same format as a line as documented in
+    # the fs-perms.txt file
+    # <path> <mode> <uid> <gid> <walk> <fmode> <fuid> <fgid>
+    # <path> link <link target>
+    #
+    # __str__ can be used to print out an entry in the input format
+    #
+    # if fs_perms_entry.path is None:
+    #    an error occured
+    # if fs_perms_entry.link, you can retrieve:
+    #    fs_perms_entry.path = path
+    #    fs_perms_entry.link = target of link
+    # if not fs_perms_entry.link, you can retrieve:
+    #    fs_perms_entry.path = path
+    #    fs_perms_entry.mode = expected dir mode or None
+    #    fs_perms_entry.uid = expected uid or -1
+    #    fs_perms_entry.gid = expected gid or -1
+    #    fs_perms_entry.walk = 'true' or something else
+    #    fs_perms_entry.fmode = expected file mode or None
+    #    fs_perms_entry.fuid = expected file uid or -1
+    #    fs_perms_entry_fgid = expected file gid or -1
+    class fs_perms_entry():
+        def __init__(self, line):
+            lsplit = line.split()
+            if len(lsplit) == 3 and lsplit[1].lower() == "link":
+                self._setlink(lsplit[0], lsplit[2])
+            elif len(lsplit) == 8:
+                self._setdir(lsplit[0], lsplit[1], lsplit[2], lsplit[3], lsplit[4], lsplit[5], lsplit[6], lsplit[7])
+            else:
+                msg = "Fixup Perms: invalid config line %s" % line
+                package_qa_handle_error("perm-config", msg, d)
+                self.path = None
+                self.link = None
+
+        def _setdir(self, path, mode, uid, gid, walk, fmode, fuid, fgid):
+            self.path = os.path.normpath(path)
+            self.link = None
+            self.mode = self._procmode(mode)
+            self.uid  = self._procuid(uid)
+            self.gid  = self._procgid(gid)
+            self.walk = walk.lower()
+            self.fmode = self._procmode(fmode)
+            self.fuid = self._procuid(fuid)
+            self.fgid = self._procgid(fgid)
+
+        def _setlink(self, path, link):
+            self.path = os.path.normpath(path)
+            self.link = link
+
+        def _procmode(self, mode):
+            if not mode or (mode and mode == "-"):
+                return None
+            else:
+                return int(mode,8)
+
+        # Note uid/gid -1 has special significance in os.lchown
+        def _procuid(self, uid):
+            if uid is None or uid == "-":
+                return -1
+            elif uid.isdigit():
+                return int(uid)
+            else:
+                return pwd.getpwnam(uid).pw_uid
+
+        def _procgid(self, gid):
+            if gid is None or gid == "-":
+                return -1
+            elif gid.isdigit():
+                return int(gid)
+            else:
+                return grp.getgrnam(gid).gr_gid
+
+        # Use for debugging the entries
+        def __str__(self):
+            if self.link:
+                return "%s link %s" % (self.path, self.link)
+            else:
+                mode = "-"
+                if self.mode:
+                    mode = "0%o" % self.mode
+                fmode = "-"
+                if self.fmode:
+                    fmode = "0%o" % self.fmode
+                uid = self._mapugid(self.uid)
+                gid = self._mapugid(self.gid)
+                fuid = self._mapugid(self.fuid)
+                fgid = self._mapugid(self.fgid)
+                return "%s %s %s %s %s %s %s %s" % (self.path, mode, uid, gid, self.walk, fmode, fuid, fgid)
+
+        def _mapugid(self, id):
+            if id is None or id == -1:
+                return "-"
+            else:
+                return "%d" % id
+
+    # Fix the permission, owner and group of path
+    def fix_perms(path, mode, uid, gid, dir):
+        if mode and not os.path.islink(path):
+            #bb.note("Fixup Perms: chmod 0%o %s" % (mode, dir))
+            os.chmod(path, mode)
+        # -1 is a special value that means don't change the uid/gid
+        # if they are BOTH -1, don't bother to lchown
+        if not (uid == -1 and gid == -1):
+            #bb.note("Fixup Perms: lchown %d:%d %s" % (uid, gid, dir))
+            os.lchown(path, uid, gid)
+
+    # Return a list of configuration files based on either the default
+    # files/fs-perms.txt or the contents of FILESYSTEM_PERMS_TABLES
+    # paths are resolved via BBPATH
+    def get_fs_perms_list(d):
+        str = ""
+        bbpath = d.getVar('BBPATH', True)
+        fs_perms_tables = d.getVar('FILESYSTEM_PERMS_TABLES', True)
+        if not fs_perms_tables:
+            fs_perms_tables = 'files/fs-perms.txt'
+        for conf_file in fs_perms_tables.split():
+            str += " %s" % bb.utils.which(bbpath, conf_file)
+        return str
+
+
+
+    dvar = d.getVar('PKGD', True)
+
+    fs_perms_table = {}
+
+    # By default all of the standard directories specified in
+    # bitbake.conf will get 0755 root:root.
+    target_path_vars = [    'base_prefix',
+                'prefix',
+                'exec_prefix',
+                'base_bindir',
+                'base_sbindir',
+                'base_libdir',
+                'datadir',
+                'sysconfdir',
+                'servicedir',
+                'sharedstatedir',
+                'localstatedir',
+                'infodir',
+                'mandir',
+                'docdir',
+                'bindir',
+                'sbindir',
+                'libexecdir',
+                'libdir',
+                'includedir',
+                'oldincludedir' ]
+
+    for path in target_path_vars:
+        dir = d.getVar(path, True) or ""
+        if dir == "":
+            continue
+        fs_perms_table[dir] = fs_perms_entry(bb.data.expand("%s 0755 root root false - - -" % (dir), d))
+
+    # Now we actually load from the configuration files
+    for conf in get_fs_perms_list(d).split():
+        if os.path.exists(conf):
+            f = open(conf)
+            for line in f:
+                if line.startswith('#'):
+                    continue
+                lsplit = line.split()
+                if len(lsplit) == 0:
+                    continue
+                if len(lsplit) != 8 and not (len(lsplit) == 3 and lsplit[1].lower() == "link"):
+                    msg = "Fixup perms: %s invalid line: %s" % (conf, line)
+                    package_qa_handle_error("perm-line", msg, d)
+                    continue
+                entry = fs_perms_entry(d.expand(line))
+                if entry and entry.path:
+                    fs_perms_table[entry.path] = entry
+            f.close()
+
+    # Debug -- list out in-memory table
+    #for dir in fs_perms_table:
+    #    bb.note("Fixup Perms: %s: %s" % (dir, str(fs_perms_table[dir])))
+
+    # We process links first, so we can go back and fixup directory ownership
+    # for any newly created directories
+    for dir in fs_perms_table:
+        if not fs_perms_table[dir].link:
+            continue
+
+        origin = dvar + dir
+        if not (cpath.exists(origin) and cpath.isdir(origin) and not cpath.islink(origin)):
+            continue
+
+        link = fs_perms_table[dir].link
+        if link[0] == "/":
+            target = dvar + link
+            ptarget = link
+        else:
+            target = os.path.join(os.path.dirname(origin), link)
+            ptarget = os.path.join(os.path.dirname(dir), link)
+        if os.path.exists(target):
+            msg = "Fixup Perms: Unable to correct directory link, target already exists: %s -> %s" % (dir, ptarget)
+            package_qa_handle_error("perm-link", msg, d)
+            continue
+
+        # Create path to move directory to, move it, and then setup the symlink
+        bb.utils.mkdirhier(os.path.dirname(target))
+        #bb.note("Fixup Perms: Rename %s -> %s" % (dir, ptarget))
+        os.rename(origin, target)
+        #bb.note("Fixup Perms: Link %s -> %s" % (dir, link))
+        os.symlink(link, origin)
+
+    for dir in fs_perms_table:
+        if fs_perms_table[dir].link:
+            continue
+
+        origin = dvar + dir
+        if not (cpath.exists(origin) and cpath.isdir(origin)):
+            continue
+
+        fix_perms(origin, fs_perms_table[dir].mode, fs_perms_table[dir].uid, fs_perms_table[dir].gid, dir)
+
+        if fs_perms_table[dir].walk == 'true':
+            for root, dirs, files in os.walk(origin):
+                for dr in dirs:
+                    each_dir = os.path.join(root, dr)
+                    fix_perms(each_dir, fs_perms_table[dir].mode, fs_perms_table[dir].uid, fs_perms_table[dir].gid, dir)
+                for f in files:
+                    each_file = os.path.join(root, f)
+                    fix_perms(each_file, fs_perms_table[dir].fmode, fs_perms_table[dir].fuid, fs_perms_table[dir].fgid, dir)
+}
+
+python split_and_strip_files () {
+    import stat, errno
+
+    dvar = d.getVar('PKGD', True)
+    pn = d.getVar('PN', True)
+
+    # We default to '.debug' style
+    if d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == 'debug-file-directory':
+        # Single debug-file-directory style debug info
+        debugappend = ".debug"
+        debugdir = ""
+        debuglibdir = "/usr/lib/debug"
+        debugsrcdir = "/usr/src/debug"
+    elif d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == 'debug-without-src':
+        # Original OE-core, a.k.a. ".debug", style debug info, but without sources in /usr/src/debug
+        debugappend = ""
+        debugdir = "/.debug"
+        debuglibdir = ""
+        debugsrcdir = ""
+    else:
+        # Original OE-core, a.k.a. ".debug", style debug info
+        debugappend = ""
+        debugdir = "/.debug"
+        debuglibdir = ""
+        debugsrcdir = "/usr/src/debug"
+
+    sourcefile = d.expand("${WORKDIR}/debugsources.list")
+    bb.utils.remove(sourcefile)
+
+    os.chdir(dvar)
+
+    # Return type (bits):
+    # 0 - not elf
+    # 1 - ELF
+    # 2 - stripped
+    # 4 - executable
+    # 8 - shared library
+    # 16 - kernel module
+    def isELF(path):
+        type = 0
+        ret, result = oe.utils.getstatusoutput("file \"%s\"" % path.replace("\"", "\\\""))
+
+        if ret:
+            msg = "split_and_strip_files: 'file %s' failed" % path
+            package_qa_handle_error("split-strip", msg, d)
+            return type
+
+        # Not stripped
+        if "ELF" in result:
+            type |= 1
+            if "not stripped" not in result:
+                type |= 2
+            if "executable" in result:
+                type |= 4
+            if "shared" in result:
+                type |= 8
+        return type
+
+
+    #
+    # First lets figure out all of the files we may have to process ... do this only once!
+    #
+    elffiles = {}
+    symlinks = {}
+    kernmods = []
+    inodes = {}
+    libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir", True))
+    baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir", True))
+    if (d.getVar('INHIBIT_PACKAGE_STRIP', True) != '1'):
+        for root, dirs, files in cpath.walk(dvar):
+            for f in files:
+                file = os.path.join(root, f)
+                if file.endswith(".ko") and file.find("/lib/modules/") != -1:
+                    kernmods.append(file)
+                    continue
+
+                # Skip debug files
+                if debugappend and file.endswith(debugappend):
+                    continue
+                if debugdir and debugdir in os.path.dirname(file[len(dvar):]):
+                    continue
+
+                try:
+                    ltarget = cpath.realpath(file, dvar, False)
+                    s = cpath.lstat(ltarget)
+                except OSError as e:
+                    (err, strerror) = e.args
+                    if err != errno.ENOENT:
+                        raise
+                    # Skip broken symlinks
+                    continue
+                if not s:
+                    continue
+                # Check its an excutable
+                if (s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) or (s[stat.ST_MODE] & stat.S_IXOTH) \
+                        or ((file.startswith(libdir) or file.startswith(baselibdir)) and ".so" in f):
+                    # If it's a symlink, and points to an ELF file, we capture the readlink target
+                    if cpath.islink(file):
+                        target = os.readlink(file)
+                        if isELF(ltarget):
+                            #bb.note("Sym: %s (%d)" % (ltarget, isELF(ltarget)))
+                            symlinks[file] = target
+                        continue
+
+                    # It's a file (or hardlink), not a link
+                    # ...but is it ELF, and is it already stripped?
+                    elf_file = isELF(file)
+                    if elf_file & 1:
+                        if elf_file & 2:
+                            if 'already-stripped' in (d.getVar('INSANE_SKIP_' + pn, True) or "").split():
+                                bb.note("Skipping file %s from %s for already-stripped QA test" % (file[len(dvar):], pn))
+                            else:
+                                msg = "File '%s' from %s was already stripped, this will prevent future debugging!" % (file[len(dvar):], pn)
+                                package_qa_handle_error("already-stripped", msg, d)
+                            continue
+
+                        # At this point we have an unstripped elf file. We need to:
+                        #  a) Make sure any file we strip is not hardlinked to anything else outside this tree
+                        #  b) Only strip any hardlinked file once (no races)
+                        #  c) Track any hardlinks between files so that we can reconstruct matching debug file hardlinks
+
+                        # Use a reference of device ID and inode number to indentify files
+                        file_reference = "%d_%d" % (s.st_dev, s.st_ino)
+                        if file_reference in inodes:
+                            os.unlink(file)
+                            os.link(inodes[file_reference][0], file)
+                            inodes[file_reference].append(file)
+                        else:
+                            inodes[file_reference] = [file]
+                            # break hardlink
+                            bb.utils.copyfile(file, file)
+                            elffiles[file] = elf_file
+                        # Modified the file so clear the cache
+                        cpath.updatecache(file)
+
+    #
+    # First lets process debug splitting
+    #
+    if (d.getVar('INHIBIT_PACKAGE_DEBUG_SPLIT', True) != '1'):
+        for file in elffiles:
+            src = file[len(dvar):]
+            dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
+            fpath = dvar + dest
+
+            # Split the file...
+            bb.utils.mkdirhier(os.path.dirname(fpath))
+            #bb.note("Split %s -> %s" % (file, fpath))
+            # Only store off the hard link reference if we successfully split!
+            splitdebuginfo(file, fpath, debugsrcdir, sourcefile, d)
+
+        # Hardlink our debug symbols to the other hardlink copies
+        for ref in inodes:
+            if len(inodes[ref]) == 1:
+                continue
+            for file in inodes[ref][1:]:
+                src = file[len(dvar):]
+                dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
+                fpath = dvar + dest
+                target = inodes[ref][0][len(dvar):]
+                ftarget = dvar + debuglibdir + os.path.dirname(target) + debugdir + "/" + os.path.basename(target) + debugappend
+                bb.utils.mkdirhier(os.path.dirname(fpath))
+                #bb.note("Link %s -> %s" % (fpath, ftarget))
+                os.link(ftarget, fpath)
+
+        # Create symlinks for all cases we were able to split symbols
+        for file in symlinks:
+            src = file[len(dvar):]
+            dest = debuglibdir + os.path.dirname(src) + debugdir + "/" + os.path.basename(src) + debugappend
+            fpath = dvar + dest
+            # Skip it if the target doesn't exist
+            try:
+                s = os.stat(fpath)
+            except OSError as e:
+                (err, strerror) = e.args
+                if err != errno.ENOENT:
+                    raise
+                continue
+
+            ltarget = symlinks[file]
+            lpath = os.path.dirname(ltarget)
+            lbase = os.path.basename(ltarget)
+            ftarget = ""
+            if lpath and lpath != ".":
+                ftarget += lpath + debugdir + "/"
+            ftarget += lbase + debugappend
+            if lpath.startswith(".."):
+                ftarget = os.path.join("..", ftarget)
+            bb.utils.mkdirhier(os.path.dirname(fpath))
+            #bb.note("Symlink %s -> %s" % (fpath, ftarget))
+            os.symlink(ftarget, fpath)
+
+        # Process the debugsrcdir if requested...
+        # This copies and places the referenced sources for later debugging...
+        copydebugsources(debugsrcdir, d)
+    #
+    # End of debug splitting
+    #
+
+    #
+    # Now lets go back over things and strip them
+    #
+    if (d.getVar('INHIBIT_PACKAGE_STRIP', True) != '1'):
+        strip = d.getVar("STRIP", True)
+        sfiles = []
+        for file in elffiles:
+            elf_file = int(elffiles[file])
+            #bb.note("Strip %s" % file)
+            sfiles.append((file, elf_file, strip))
+        for f in kernmods:
+            sfiles.append((f, 16, strip))
+
+        oe.utils.multiprocess_exec(sfiles, oe.package.runstrip)
+
+    #
+    # End of strip
+    #
+}
+
+python populate_packages () {
+    import glob, re
+
+    workdir = d.getVar('WORKDIR', True)
+    outdir = d.getVar('DEPLOY_DIR', True)
+    dvar = d.getVar('PKGD', True)
+    packages = d.getVar('PACKAGES', True)
+    pn = d.getVar('PN', True)
+
+    bb.utils.mkdirhier(outdir)
+    os.chdir(dvar)
+
+    # Sanity check PACKAGES for duplicates
+    # Sanity should be moved to sanity.bbclass once we have the infrastucture
+    package_list = []
+
+    for pkg in packages.split():
+        if pkg in package_list:
+            msg = "%s is listed in PACKAGES multiple times, this leads to packaging errors." % pkg
+            package_qa_handle_error("packages-list", msg, d)
+        else:
+            package_list.append(pkg)
+    d.setVar('PACKAGES', ' '.join(package_list))
+    pkgdest = d.getVar('PKGDEST', True)
+
+    seen = []
+
+    # os.mkdir masks the permissions with umask so we have to unset it first
+    oldumask = os.umask(0)
+
+    for pkg in package_list:
+        root = os.path.join(pkgdest, pkg)
+        bb.utils.mkdirhier(root)
+
+        filesvar = d.getVar('FILES_%s' % pkg, True) or ""
+        if "//" in filesvar:
+            msg = "FILES variable for package %s contains '//' which is invalid. Attempting to fix this but you should correct the metadata.\n" % pkg
+            package_qa_handle_error("files-invalid", msg, d)
+            filesvar.replace("//", "/")
+
+        origfiles = filesvar.split()
+        files = files_from_filevars(origfiles)
+
+        for file in files:
+            if (not cpath.islink(file)) and (not cpath.exists(file)):
+                continue
+            if file in seen:
+                continue
+            seen.append(file)
+
+            def mkdir(src, dest, p):
+                src = os.path.join(src, p)
+                dest = os.path.join(dest, p)
+                fstat = cpath.stat(src)
+                os.mkdir(dest, fstat.st_mode)
+                os.chown(dest, fstat.st_uid, fstat.st_gid)
+                if p not in seen:
+                    seen.append(p)
+                cpath.updatecache(dest)
+
+            def mkdir_recurse(src, dest, paths):
+                if cpath.exists(dest + '/' + paths):
+                    return
+                while paths.startswith("./"):
+                    paths = paths[2:]
+                p = "."
+                for c in paths.split("/"):
+                    p = os.path.join(p, c)
+                    if not cpath.exists(os.path.join(dest, p)):
+                        mkdir(src, dest, p)
+
+            if cpath.isdir(file) and not cpath.islink(file):
+                mkdir_recurse(dvar, root, file)
+                continue
+
+            mkdir_recurse(dvar, root, os.path.dirname(file))
+            fpath = os.path.join(root,file)
+            if not cpath.islink(file):
+                os.link(file, fpath)
+                fstat = cpath.stat(file)
+                os.chmod(fpath, fstat.st_mode)
+                os.chown(fpath, fstat.st_uid, fstat.st_gid)
+                continue
+            ret = bb.utils.copyfile(file, fpath)
+            if ret is False or ret == 0:
+                raise bb.build.FuncFailed("File population failed")
+
+    os.umask(oldumask)
+    os.chdir(workdir)
+
+    # Handle LICENSE_EXCLUSION
+    package_list = []
+    for pkg in packages.split():
+        if d.getVar('LICENSE_EXCLUSION-' + pkg, True):
+            msg = "%s has an incompatible license. Excluding from packaging." % pkg
+            package_qa_handle_error("incompatible-license", msg, d)
+        else:
+            package_list.append(pkg)
+    d.setVar('PACKAGES', ' '.join(package_list))
+
+    unshipped = []
+    for root, dirs, files in cpath.walk(dvar):
+        dir = root[len(dvar):]
+        if not dir:
+            dir = os.sep
+        for f in (files + dirs):
+            path = os.path.join(dir, f)
+            if ('.' + path) not in seen:
+                unshipped.append(path)
+
+    if unshipped != []:
+        msg = pn + ": Files/directories were installed but not shipped in any package:"
+        if "installed-vs-shipped" in (d.getVar('INSANE_SKIP_' + pn, True) or "").split():
+            bb.note("Package %s skipping QA tests: installed-vs-shipped" % pn)
+        else:
+            for f in unshipped:
+                msg = msg + "\n  " + f
+            msg = msg + "\nPlease set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install."
+            package_qa_handle_error("installed-vs-shipped", msg, d)
+}
+populate_packages[dirs] = "${D}"
+
+python package_fixsymlinks () {
+    import errno
+    pkgdest = d.getVar('PKGDEST', True)
+    packages = d.getVar("PACKAGES", False).split()
+
+    dangling_links = {}
+    pkg_files = {}
+    for pkg in packages:
+        dangling_links[pkg] = []
+        pkg_files[pkg] = []
+        inst_root = os.path.join(pkgdest, pkg)
+        for path in pkgfiles[pkg]:
+                rpath = path[len(inst_root):]
+                pkg_files[pkg].append(rpath)
+                rtarget = cpath.realpath(path, inst_root, True, assume_dir = True)
+                if not cpath.lexists(rtarget):
+                    dangling_links[pkg].append(os.path.normpath(rtarget[len(inst_root):]))
+
+    newrdepends = {}
+    for pkg in dangling_links:
+        for l in dangling_links[pkg]:
+            found = False
+            bb.debug(1, "%s contains dangling link %s" % (pkg, l))
+            for p in packages:
+                if l in pkg_files[p]:
+                        found = True
+                        bb.debug(1, "target found in %s" % p)
+                        if p == pkg:
+                            break
+                        if pkg not in newrdepends:
+                            newrdepends[pkg] = []
+                        newrdepends[pkg].append(p)
+                        break
+            if found == False:
+                bb.note("%s contains dangling symlink to %s" % (pkg, l))
+
+    for pkg in newrdepends:
+        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or "")
+        for p in newrdepends[pkg]:
+            if p not in rdepends:
+                rdepends[p] = []
+        d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False))
+}
+
+
+python package_package_name_hook() {
+    """
+    A package_name_hook function can be used to rewrite the package names by
+    changing PKG.  For an example, see debian.bbclass.
+    """
+    pass
+}
+
+EXPORT_FUNCTIONS package_name_hook
+
+
+PKGDESTWORK = "${WORKDIR}/pkgdata"
+
+python emit_pkgdata() {
+    from glob import glob
+    import json
+
+    def write_if_exists(f, pkg, var):
+        def encode(str):
+            import codecs
+            c = codecs.getencoder("string_escape")
+            return c(str)[0]
+
+        val = d.getVar('%s_%s' % (var, pkg), True)
+        if val:
+            f.write('%s_%s: %s\n' % (var, pkg, encode(val)))
+            return val
+        val = d.getVar('%s' % (var), True)
+        if val:
+            f.write('%s: %s\n' % (var, encode(val)))
+        return val
+
+    def write_extra_pkgs(variants, pn, packages, pkgdatadir):
+        for variant in variants:
+            with open("%s/%s-%s" % (pkgdatadir, variant, pn), 'w') as fd:
+                fd.write("PACKAGES: %s\n" % ' '.join(
+                            map(lambda pkg: '%s-%s' % (variant, pkg), packages.split())))
+
+    def write_extra_runtime_pkgs(variants, packages, pkgdatadir):
+        for variant in variants:
+            for pkg in packages.split():
+                ml_pkg = "%s-%s" % (variant, pkg)
+                subdata_file = "%s/runtime/%s" % (pkgdatadir, ml_pkg)
+                with open(subdata_file, 'w') as fd:
+                    fd.write("PKG_%s: %s" % (ml_pkg, pkg))
+
+    packages = d.getVar('PACKAGES', True)
+    pkgdest = d.getVar('PKGDEST', True)
+    pkgdatadir = d.getVar('PKGDESTWORK', True)
+
+    # Take shared lock since we're only reading, not writing
+    lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"), True)
+
+    data_file = pkgdatadir + d.expand("/${PN}" )
+    f = open(data_file, 'w')
+    f.write("PACKAGES: %s\n" % packages)
+    f.close()
+
+    pn = d.getVar('PN', True)
+    global_variants = (d.getVar('MULTILIB_GLOBAL_VARIANTS', True) or "").split()
+    variants = (d.getVar('MULTILIB_VARIANTS', True) or "").split()
+
+    if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
+        write_extra_pkgs(variants, pn, packages, pkgdatadir)
+
+    if (bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d)):
+        write_extra_pkgs(global_variants, pn, packages, pkgdatadir)
+
+    workdir = d.getVar('WORKDIR', True)
+
+    for pkg in packages.split():
+        pkgval = d.getVar('PKG_%s' % pkg, True)
+        if pkgval is None:
+            pkgval = pkg
+            d.setVar('PKG_%s' % pkg, pkg)
+
+        pkgdestpkg = os.path.join(pkgdest, pkg)
+        files = {}
+        total_size = 0
+        for f in pkgfiles[pkg]:
+            relpth = os.path.relpath(f, pkgdestpkg)
+            fstat = os.lstat(f)
+            total_size += fstat.st_size
+            files[os.sep + relpth] = fstat.st_size
+        d.setVar('FILES_INFO', json.dumps(files))
+
+        subdata_file = pkgdatadir + "/runtime/%s" % pkg
+        sf = open(subdata_file, 'w')
+        write_if_exists(sf, pkg, 'PN')
+        write_if_exists(sf, pkg, 'PE')
+        write_if_exists(sf, pkg, 'PV')
+        write_if_exists(sf, pkg, 'PR')
+        write_if_exists(sf, pkg, 'PKGE')
+        write_if_exists(sf, pkg, 'PKGV')
+        write_if_exists(sf, pkg, 'PKGR')
+        write_if_exists(sf, pkg, 'LICENSE')
+        write_if_exists(sf, pkg, 'DESCRIPTION')
+        write_if_exists(sf, pkg, 'SUMMARY')
+        write_if_exists(sf, pkg, 'RDEPENDS')
+        rprov = write_if_exists(sf, pkg, 'RPROVIDES')
+        write_if_exists(sf, pkg, 'RRECOMMENDS')
+        write_if_exists(sf, pkg, 'RSUGGESTS')
+        write_if_exists(sf, pkg, 'RREPLACES')
+        write_if_exists(sf, pkg, 'RCONFLICTS')
+        write_if_exists(sf, pkg, 'SECTION')
+        write_if_exists(sf, pkg, 'PKG')
+        write_if_exists(sf, pkg, 'ALLOW_EMPTY')
+        write_if_exists(sf, pkg, 'FILES')
+        write_if_exists(sf, pkg, 'pkg_postinst')
+        write_if_exists(sf, pkg, 'pkg_postrm')
+        write_if_exists(sf, pkg, 'pkg_preinst')
+        write_if_exists(sf, pkg, 'pkg_prerm')
+        write_if_exists(sf, pkg, 'FILERPROVIDESFLIST')
+        write_if_exists(sf, pkg, 'FILES_INFO')
+        for dfile in (d.getVar('FILERPROVIDESFLIST_' + pkg, True) or "").split():
+            write_if_exists(sf, pkg, 'FILERPROVIDES_' + dfile)
+
+        write_if_exists(sf, pkg, 'FILERDEPENDSFLIST')
+        for dfile in (d.getVar('FILERDEPENDSFLIST_' + pkg, True) or "").split():
+            write_if_exists(sf, pkg, 'FILERDEPENDS_' + dfile)
+
+        sf.write('%s_%s: %d\n' % ('PKGSIZE', pkg, total_size))
+        sf.close()
+
+        # Symlinks needed for rprovides lookup
+        if rprov:
+            for p in rprov.strip().split():
+                subdata_sym = pkgdatadir + "/runtime-rprovides/%s/%s" % (p, pkg)
+                bb.utils.mkdirhier(os.path.dirname(subdata_sym))
+                oe.path.symlink("../../runtime/%s" % pkg, subdata_sym, True)
+
+        allow_empty = d.getVar('ALLOW_EMPTY_%s' % pkg, True)
+        if not allow_empty:
+            allow_empty = d.getVar('ALLOW_EMPTY', True)
+        root = "%s/%s" % (pkgdest, pkg)
+        os.chdir(root)
+        g = glob('*')
+        if g or allow_empty == "1":
+            # Symlinks needed for reverse lookups (from the final package name)
+            subdata_sym = pkgdatadir + "/runtime-reverse/%s" % pkgval
+            oe.path.symlink("../runtime/%s" % pkg, subdata_sym, True)
+
+            packagedfile = pkgdatadir + '/runtime/%s.packaged' % pkg
+            open(packagedfile, 'w').close()
+
+    if bb.data.inherits_class('kernel', d) or bb.data.inherits_class('module-base', d):
+        write_extra_runtime_pkgs(variants, packages, pkgdatadir)
+
+    if bb.data.inherits_class('allarch', d) and not bb.data.inherits_class('packagegroup', d):
+        write_extra_runtime_pkgs(global_variants, packages, pkgdatadir)
+
+    bb.utils.unlockfile(lf)
+}
+emit_pkgdata[dirs] = "${PKGDESTWORK}/runtime ${PKGDESTWORK}/runtime-reverse ${PKGDESTWORK}/runtime-rprovides"
+
+ldconfig_postinst_fragment() {
+if [ x"$D" = "x" ]; then
+	if [ -x /sbin/ldconfig ]; then /sbin/ldconfig ; fi
+fi
+}
+
+RPMDEPS = "${STAGING_LIBDIR_NATIVE}/rpm/bin/rpmdeps-oecore --macros ${STAGING_LIBDIR_NATIVE}/rpm/macros --define '_rpmfc_magic_path ${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc' --rpmpopt ${STAGING_LIBDIR_NATIVE}/rpm/rpmpopt"
+
+# Collect perfile run-time dependency metadata
+# Output:
+#  FILERPROVIDESFLIST_pkg - list of all files w/ deps
+#  FILERPROVIDES_filepath_pkg - per file dep
+#
+#  FILERDEPENDSFLIST_pkg - list of all files w/ deps
+#  FILERDEPENDS_filepath_pkg - per file dep
+
+python package_do_filedeps() {
+    if d.getVar('SKIP_FILEDEPS', True) == '1':
+        return
+
+    pkgdest = d.getVar('PKGDEST', True)
+    packages = d.getVar('PACKAGES', True)
+    rpmdeps = d.getVar('RPMDEPS', True)
+
+    def chunks(files, n):
+        return [files[i:i+n] for i in range(0, len(files), n)]
+
+    pkglist = []
+    for pkg in packages.split():
+        if d.getVar('SKIP_FILEDEPS_' + pkg, True) == '1':
+            continue
+        if pkg.endswith('-dbg') or pkg.endswith('-doc') or pkg.find('-locale-') != -1 or pkg.find('-localedata-') != -1 or pkg.find('-gconv-') != -1 or pkg.find('-charmap-') != -1 or pkg.startswith('kernel-module-'):
+            continue
+        for files in chunks(pkgfiles[pkg], 100):
+            pkglist.append((pkg, files, rpmdeps, pkgdest))
+
+    processed = oe.utils.multiprocess_exec( pkglist, oe.package.filedeprunner)
+
+    provides_files = {}
+    requires_files = {}
+
+    for result in processed:
+        (pkg, provides, requires) = result
+
+        if pkg not in provides_files:
+            provides_files[pkg] = []
+        if pkg not in requires_files:
+            requires_files[pkg] = []
+
+        for file in provides:
+            provides_files[pkg].append(file)
+            key = "FILERPROVIDES_" + file + "_" + pkg
+            d.setVar(key, " ".join(provides[file]))
+
+        for file in requires:
+            requires_files[pkg].append(file)
+            key = "FILERDEPENDS_" + file + "_" + pkg
+            d.setVar(key, " ".join(requires[file]))
+
+    for pkg in requires_files:
+        d.setVar("FILERDEPENDSFLIST_" + pkg, " ".join(requires_files[pkg]))
+    for pkg in provides_files:
+        d.setVar("FILERPROVIDESFLIST_" + pkg, " ".join(provides_files[pkg]))
+}
+
+SHLIBSDIRS = "${PKGDATA_DIR}/${MLPREFIX}shlibs2"
+SHLIBSWORKDIR = "${PKGDESTWORK}/${MLPREFIX}shlibs2"
+
+python package_do_shlibs() {
+    import re, pipes
+    import subprocess as sub
+
+    exclude_shlibs = d.getVar('EXCLUDE_FROM_SHLIBS', 0)
+    if exclude_shlibs:
+        bb.note("not generating shlibs")
+        return
+
+    lib_re = re.compile("^.*\.so")
+    libdir_re = re.compile(".*/%s$" % d.getVar('baselib', True))
+
+    packages = d.getVar('PACKAGES', True)
+    targetos = d.getVar('TARGET_OS', True)
+
+    workdir = d.getVar('WORKDIR', True)
+
+    ver = d.getVar('PKGV', True)
+    if not ver:
+        msg = "PKGV not defined"
+        package_qa_handle_error("pkgv-undefined", msg, d)
+        return
+
+    pkgdest = d.getVar('PKGDEST', True)
+
+    shlibswork_dir = d.getVar('SHLIBSWORKDIR', True)
+
+    # Take shared lock since we're only reading, not writing
+    lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"))
+
+    def linux_so(file, needed, sonames, renames, pkgver):
+        needs_ldconfig = False
+        ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
+        cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(file) + " 2>/dev/null"
+        fd = os.popen(cmd)
+        lines = fd.readlines()
+        fd.close()
+        rpath = []
+        for l in lines:
+            m = re.match("\s+RPATH\s+([^\s]*)", l)
+            if m:
+                rpaths = m.group(1).replace("$ORIGIN", ldir).split(":")
+                rpath = map(os.path.normpath, rpaths)
+        for l in lines:
+            m = re.match("\s+NEEDED\s+([^\s]*)", l)
+            if m:
+                dep = m.group(1)
+                if dep not in needed[pkg]:
+                    needed[pkg].append((dep, file, rpath))
+            m = re.match("\s+SONAME\s+([^\s]*)", l)
+            if m:
+                this_soname = m.group(1)
+                prov = (this_soname, ldir, pkgver)
+                if not prov in sonames:
+                    # if library is private (only used by package) then do not build shlib for it
+                    if not private_libs or this_soname not in private_libs:
+                        sonames.append(prov)
+                if libdir_re.match(os.path.dirname(file)):
+                    needs_ldconfig = True
+                if snap_symlinks and (os.path.basename(file) != this_soname):
+                    renames.append((file, os.path.join(os.path.dirname(file), this_soname)))
+        return needs_ldconfig
+
+    def darwin_so(file, needed, sonames, renames, pkgver):
+        if not os.path.exists(file):
+            return
+        ldir = os.path.dirname(file).replace(pkgdest + "/" + pkg, '')
+
+        def get_combinations(base):
+            #
+            # Given a base library name, find all combinations of this split by "." and "-"
+            #
+            combos = []
+            options = base.split(".")
+            for i in range(1, len(options) + 1):
+                combos.append(".".join(options[0:i]))
+            options = base.split("-")
+            for i in range(1, len(options) + 1):
+                combos.append("-".join(options[0:i]))
+            return combos
+
+        if (file.endswith('.dylib') or file.endswith('.so')) and not pkg.endswith('-dev') and not pkg.endswith('-dbg'):
+            # Drop suffix
+            name = os.path.basename(file).rsplit(".",1)[0]
+            # Find all combinations
+            combos = get_combinations(name)
+            for combo in combos:
+                if not combo in sonames:
+                    prov = (combo, ldir, pkgver)
+                    sonames.append(prov)
+        if file.endswith('.dylib') or file.endswith('.so'):
+            rpath = []
+            p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-l', file],stdout=sub.PIPE,stderr=sub.PIPE)
+            err, out = p.communicate()
+            # If returned succesfully, process stderr for results
+            if p.returncode == 0:
+                for l in err.split("\n"):
+                    l = l.strip()
+                    if l.startswith('path '):
+                        rpath.append(l.split()[1])
+
+        p = sub.Popen([d.expand("${HOST_PREFIX}otool"), '-L', file],stdout=sub.PIPE,stderr=sub.PIPE)
+        err, out = p.communicate()
+        # If returned succesfully, process stderr for results
+        if p.returncode == 0:
+            for l in err.split("\n"):
+                l = l.strip()
+                if not l or l.endswith(":"):
+                    continue
+                if "is not an object file" in l:
+                    continue
+                name = os.path.basename(l.split()[0]).rsplit(".", 1)[0]
+                if name and name not in needed[pkg]:
+                     needed[pkg].append((name, file, []))
+
+    if d.getVar('PACKAGE_SNAP_LIB_SYMLINKS', True) == "1":
+        snap_symlinks = True
+    else:
+        snap_symlinks = False
+
+    if (d.getVar('USE_LDCONFIG', True) or "1") == "1":
+        use_ldconfig = True
+    else:
+        use_ldconfig = False
+
+    needed = {}
+    shlib_provider = oe.package.read_shlib_providers(d)
+
+    for pkg in packages.split():
+        private_libs = d.getVar('PRIVATE_LIBS_' + pkg, True) or d.getVar('PRIVATE_LIBS', True) or ""
+        private_libs = private_libs.split()
+        needs_ldconfig = False
+        bb.debug(2, "calculating shlib provides for %s" % pkg)
+
+        pkgver = d.getVar('PKGV_' + pkg, True)
+        if not pkgver:
+            pkgver = d.getVar('PV_' + pkg, True)
+        if not pkgver:
+            pkgver = ver
+
+        needed[pkg] = []
+        sonames = list()
+        renames = list()
+        for file in pkgfiles[pkg]:
+                soname = None
+                if cpath.islink(file):
+                    continue
+                if targetos == "darwin" or targetos == "darwin8":
+                    darwin_so(file, needed, sonames, renames, pkgver)
+                elif os.access(file, os.X_OK) or lib_re.match(file):
+                    ldconfig = linux_so(file, needed, sonames, renames, pkgver)
+                    needs_ldconfig = needs_ldconfig or ldconfig
+        for (old, new) in renames:
+            bb.note("Renaming %s to %s" % (old, new))
+            os.rename(old, new)
+            pkgfiles[pkg].remove(old)
+	    
+        shlibs_file = os.path.join(shlibswork_dir, pkg + ".list")
+        if len(sonames):
+            fd = open(shlibs_file, 'w')
+            for s in sonames:
+                if s[0] in shlib_provider and s[1] in shlib_provider[s[0]]:
+                    (old_pkg, old_pkgver) = shlib_provider[s[0]][s[1]]
+                    if old_pkg != pkg:
+                        bb.warn('%s-%s was registered as shlib provider for %s, changing it to %s-%s because it was built later' % (old_pkg, old_pkgver, s[0], pkg, pkgver))
+                bb.debug(1, 'registering %s-%s as shlib provider for %s' % (pkg, pkgver, s[0]))
+                fd.write(s[0] + ':' + s[1] + ':' + s[2] + '\n')
+                if s[0] not in shlib_provider:
+                    shlib_provider[s[0]] = {}
+                shlib_provider[s[0]][s[1]] = (pkg, pkgver)
+            fd.close()
+        if needs_ldconfig and use_ldconfig:
+            bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
+            postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+            if not postinst:
+                postinst = '#!/bin/sh\n'
+            postinst += d.getVar('ldconfig_postinst_fragment', True)
+            d.setVar('pkg_postinst_%s' % pkg, postinst)
+        bb.debug(1, 'LIBNAMES: pkg %s sonames %s' % (pkg, sonames))
+
+    bb.utils.unlockfile(lf)
+
+    assumed_libs = d.getVar('ASSUME_SHLIBS', True)
+    if assumed_libs:
+        libdir = d.getVar("libdir", True)
+        for e in assumed_libs.split():
+            l, dep_pkg = e.split(":")
+            lib_ver = None
+            dep_pkg = dep_pkg.rsplit("_", 1)
+            if len(dep_pkg) == 2:
+                lib_ver = dep_pkg[1]
+            dep_pkg = dep_pkg[0]
+            if l not in shlib_provider:
+                shlib_provider[l] = {}
+            shlib_provider[l][libdir] = (dep_pkg, lib_ver)
+
+    libsearchpath = [d.getVar('libdir', True), d.getVar('base_libdir', True)]
+
+    for pkg in packages.split():
+        bb.debug(2, "calculating shlib requirements for %s" % pkg)
+
+        deps = list()
+        for n in needed[pkg]:
+            # if n is in private libraries, don't try to search provider for it
+            # this could cause problem in case some abc.bb provides private
+            # /opt/abc/lib/libfoo.so.1 and contains /usr/bin/abc depending on system library libfoo.so.1
+            # but skipping it is still better alternative than providing own
+            # version and then adding runtime dependency for the same system library
+            if private_libs and n[0] in private_libs:
+                bb.debug(2, '%s: Dependency %s covered by PRIVATE_LIBS' % (pkg, n[0]))
+                continue
+            if n[0] in shlib_provider.keys():
+                shlib_provider_path = list()
+                for k in shlib_provider[n[0]].keys():
+                    shlib_provider_path.append(k)
+                match = None
+                for p in n[2] + shlib_provider_path + libsearchpath:
+                    if p in shlib_provider[n[0]]:
+                        match = p
+                        break
+                if match:
+                    (dep_pkg, ver_needed) = shlib_provider[n[0]][match]
+
+                    bb.debug(2, '%s: Dependency %s requires package %s (used by files: %s)' % (pkg, n[0], dep_pkg, n[1]))
+
+                    if dep_pkg == pkg:
+                        continue
+
+                    if ver_needed:
+                        dep = "%s (>= %s)" % (dep_pkg, ver_needed)
+                    else:
+                        dep = dep_pkg
+                    if not dep in deps:
+                        deps.append(dep)
+                    continue
+            bb.note("Couldn't find shared library provider for %s, used by files: %s" % (n[0], n[1]))
+
+        deps_file = os.path.join(pkgdest, pkg + ".shlibdeps")
+        if os.path.exists(deps_file):
+            os.remove(deps_file)
+        if len(deps):
+            fd = open(deps_file, 'w')
+            for dep in deps:
+                fd.write(dep + '\n')
+            fd.close()
+}
+
+python package_do_pkgconfig () {
+    import re
+
+    packages = d.getVar('PACKAGES', True)
+    workdir = d.getVar('WORKDIR', True)
+    pkgdest = d.getVar('PKGDEST', True)
+
+    shlibs_dirs = d.getVar('SHLIBSDIRS', True).split()
+    shlibswork_dir = d.getVar('SHLIBSWORKDIR', True)
+
+    pc_re = re.compile('(.*)\.pc$')
+    var_re = re.compile('(.*)=(.*)')
+    field_re = re.compile('(.*): (.*)')
+
+    pkgconfig_provided = {}
+    pkgconfig_needed = {}
+    for pkg in packages.split():
+        pkgconfig_provided[pkg] = []
+        pkgconfig_needed[pkg] = []
+        for file in pkgfiles[pkg]:
+                m = pc_re.match(file)
+                if m:
+                    pd = bb.data.init()
+                    name = m.group(1)
+                    pkgconfig_provided[pkg].append(name)
+                    if not os.access(file, os.R_OK):
+                        continue
+                    f = open(file, 'r')
+                    lines = f.readlines()
+                    f.close()
+                    for l in lines:
+                        m = var_re.match(l)
+                        if m:
+                            name = m.group(1)
+                            val = m.group(2)
+                            pd.setVar(name, pd.expand(val))
+                            continue
+                        m = field_re.match(l)
+                        if m:
+                            hdr = m.group(1)
+                            exp = bb.data.expand(m.group(2), pd)
+                            if hdr == 'Requires':
+                                pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
+
+    # Take shared lock since we're only reading, not writing
+    lf = bb.utils.lockfile(d.expand("${PACKAGELOCK}"))
+
+    for pkg in packages.split():
+        pkgs_file = os.path.join(shlibswork_dir, pkg + ".pclist")
+        if pkgconfig_provided[pkg] != []:
+            f = open(pkgs_file, 'w')
+            for p in pkgconfig_provided[pkg]:
+                f.write('%s\n' % p)
+            f.close()
+
+    # Go from least to most specific since the last one found wins
+    for dir in reversed(shlibs_dirs):
+        if not os.path.exists(dir):
+            continue
+        for file in os.listdir(dir):
+            m = re.match('^(.*)\.pclist$', file)
+            if m:
+                pkg = m.group(1)
+                fd = open(os.path.join(dir, file))
+                lines = fd.readlines()
+                fd.close()
+                pkgconfig_provided[pkg] = []
+                for l in lines:
+                    pkgconfig_provided[pkg].append(l.rstrip())
+
+    for pkg in packages.split():
+        deps = []
+        for n in pkgconfig_needed[pkg]:
+            found = False
+            for k in pkgconfig_provided.keys():
+                if n in pkgconfig_provided[k]:
+                    if k != pkg and not (k in deps):
+                        deps.append(k)
+                    found = True
+            if found == False:
+                bb.note("couldn't find pkgconfig module '%s' in any package" % n)
+        deps_file = os.path.join(pkgdest, pkg + ".pcdeps")
+        if len(deps):
+            fd = open(deps_file, 'w')
+            for dep in deps:
+                fd.write(dep + '\n')
+            fd.close()
+
+    bb.utils.unlockfile(lf)
+}
+
+def read_libdep_files(d):
+    pkglibdeps = {}
+    packages = d.getVar('PACKAGES', True).split()
+    for pkg in packages:
+        pkglibdeps[pkg] = {}
+        for extension in ".shlibdeps", ".pcdeps", ".clilibdeps":
+            depsfile = d.expand("${PKGDEST}/" + pkg + extension)
+            if os.access(depsfile, os.R_OK):
+                fd = open(depsfile)
+                lines = fd.readlines()
+                fd.close()
+                for l in lines:
+                    l.rstrip()
+                    deps = bb.utils.explode_dep_versions2(l)
+                    for dep in deps:
+                        if not dep in pkglibdeps[pkg]:
+                            pkglibdeps[pkg][dep] = deps[dep]
+    return pkglibdeps
+
+python read_shlibdeps () {
+    pkglibdeps = read_libdep_files(d)
+
+    packages = d.getVar('PACKAGES', True).split()
+    for pkg in packages:
+        rdepends = bb.utils.explode_dep_versions2(d.getVar('RDEPENDS_' + pkg, True) or "")
+        for dep in pkglibdeps[pkg]:
+            # Add the dep if it's not already there, or if no comparison is set
+            if dep not in rdepends:
+                rdepends[dep] = []
+            for v in pkglibdeps[pkg][dep]:
+                if v not in rdepends[dep]:
+                    rdepends[dep].append(v)
+        d.setVar('RDEPENDS_' + pkg, bb.utils.join_deps(rdepends, commasep=False))
+}
+
+python package_depchains() {
+    """
+    For a given set of prefix and postfix modifiers, make those packages
+    RRECOMMENDS on the corresponding packages for its RDEPENDS.
+
+    Example:  If package A depends upon package B, and A's .bb emits an
+    A-dev package, this would make A-dev Recommends: B-dev.
+
+    If only one of a given suffix is specified, it will take the RRECOMMENDS
+    based on the RDEPENDS of *all* other packages. If more than one of a given
+    suffix is specified, its will only use the RDEPENDS of the single parent
+    package.
+    """
+
+    packages  = d.getVar('PACKAGES', True)
+    postfixes = (d.getVar('DEPCHAIN_POST', True) or '').split()
+    prefixes  = (d.getVar('DEPCHAIN_PRE', True) or '').split()
+
+    def pkg_adddeprrecs(pkg, base, suffix, getname, depends, d):
+
+        #bb.note('depends for %s is %s' % (base, depends))
+        rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg, True) or "")
+
+        for depend in depends:
+            if depend.find('-native') != -1 or depend.find('-cross') != -1 or depend.startswith('virtual/'):
+                #bb.note("Skipping %s" % depend)
+                continue
+            if depend.endswith('-dev'):
+                depend = depend[:-4]
+            if depend.endswith('-dbg'):
+                depend = depend[:-4]
+            pkgname = getname(depend, suffix)
+            #bb.note("Adding %s for %s" % (pkgname, depend))
+            if pkgname not in rreclist and pkgname != pkg:
+                rreclist[pkgname] = []
+
+        #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist)))
+        d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False))
+
+    def pkg_addrrecs(pkg, base, suffix, getname, rdepends, d):
+
+        #bb.note('rdepends for %s is %s' % (base, rdepends))
+        rreclist = bb.utils.explode_dep_versions2(d.getVar('RRECOMMENDS_' + pkg, True) or "")
+
+        for depend in rdepends:
+            if depend.find('virtual-locale-') != -1:
+                #bb.note("Skipping %s" % depend)
+                continue
+            if depend.endswith('-dev'):
+                depend = depend[:-4]
+            if depend.endswith('-dbg'):
+                depend = depend[:-4]
+            pkgname = getname(depend, suffix)
+            #bb.note("Adding %s for %s" % (pkgname, depend))
+            if pkgname not in rreclist and pkgname != pkg:
+                rreclist[pkgname] = []
+
+        #bb.note('setting: RRECOMMENDS_%s=%s' % (pkg, ' '.join(rreclist)))
+        d.setVar('RRECOMMENDS_%s' % pkg, bb.utils.join_deps(rreclist, commasep=False))
+
+    def add_dep(list, dep):
+        if dep not in list:
+            list.append(dep)
+
+    depends = []
+    for dep in bb.utils.explode_deps(d.getVar('DEPENDS', True) or ""):
+        add_dep(depends, dep)
+
+    rdepends = []
+    for pkg in packages.split():
+        for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + pkg, True) or ""):
+            add_dep(rdepends, dep)
+
+    #bb.note('rdepends is %s' % rdepends)
+
+    def post_getname(name, suffix):
+        return '%s%s' % (name, suffix)
+    def pre_getname(name, suffix):
+        return '%s%s' % (suffix, name)
+
+    pkgs = {}
+    for pkg in packages.split():
+        for postfix in postfixes:
+            if pkg.endswith(postfix):
+                if not postfix in pkgs:
+                    pkgs[postfix] = {}
+                pkgs[postfix][pkg] = (pkg[:-len(postfix)], post_getname)
+
+        for prefix in prefixes:
+            if pkg.startswith(prefix):
+                if not prefix in pkgs:
+                    pkgs[prefix] = {}
+                pkgs[prefix][pkg] = (pkg[:-len(prefix)], pre_getname)
+
+    if "-dbg" in pkgs:
+        pkglibdeps = read_libdep_files(d)
+        pkglibdeplist = []
+        for pkg in pkglibdeps:
+            for k in pkglibdeps[pkg]:
+                add_dep(pkglibdeplist, k)
+        # FIXME this should not look at PN once all task recipes inherit from task.bbclass
+        dbgdefaultdeps = ((d.getVar('DEPCHAIN_DBGDEFAULTDEPS', True) == '1') or (d.getVar('PN', True) or '').startswith('packagegroup-'))
+
+    for suffix in pkgs:
+        for pkg in pkgs[suffix]:
+            if d.getVarFlag('RRECOMMENDS_' + pkg, 'nodeprrecs'):
+                continue
+            (base, func) = pkgs[suffix][pkg]
+            if suffix == "-dev":
+                pkg_adddeprrecs(pkg, base, suffix, func, depends, d)
+            elif suffix == "-dbg":
+                if not dbgdefaultdeps:
+                    pkg_addrrecs(pkg, base, suffix, func, pkglibdeplist, d)
+                    continue
+            if len(pkgs[suffix]) == 1:
+                pkg_addrrecs(pkg, base, suffix, func, rdepends, d)
+            else:
+                rdeps = []
+                for dep in bb.utils.explode_deps(d.getVar('RDEPENDS_' + base, True) or ""):
+                    add_dep(rdeps, dep)
+                pkg_addrrecs(pkg, base, suffix, func, rdeps, d)
+}
+
+# Since bitbake can't determine which variables are accessed during package
+# iteration, we need to list them here:
+PACKAGEVARS = "FILES RDEPENDS RRECOMMENDS SUMMARY DESCRIPTION RSUGGESTS RPROVIDES RCONFLICTS PKG ALLOW_EMPTY pkg_postinst pkg_postrm INITSCRIPT_NAME INITSCRIPT_PARAMS DEBIAN_NOAUTONAME ALTERNATIVE PKGE PKGV PKGR USERADD_PARAM GROUPADD_PARAM CONFFILES SYSTEMD_SERVICE LICENSE SECTION pkg_preinst pkg_prerm RREPLACES GROUPMEMS_PARAM SYSTEMD_AUTO_ENABLE"
+
+def gen_packagevar(d):
+    ret = []
+    pkgs = (d.getVar("PACKAGES", True) or "").split()
+    vars = (d.getVar("PACKAGEVARS", True) or "").split()
+    for p in pkgs:
+        for v in vars:
+            ret.append(v + "_" + p)
+
+        # Ensure that changes to INCOMPATIBLE_LICENSE re-run do_package for
+        # affected recipes.
+        ret.append('LICENSE_EXCLUSION-%s' % p)
+    return " ".join(ret)
+
+PACKAGE_PREPROCESS_FUNCS ?= ""
+# Functions for setting up PKGD
+PACKAGEBUILDPKGD ?= " \
+                perform_packagecopy \
+                ${PACKAGE_PREPROCESS_FUNCS} \
+                split_and_strip_files \
+                fixup_perms \
+                "
+# Functions which split PKGD up into separate packages
+PACKAGESPLITFUNCS ?= " \
+                package_do_split_locales \
+                populate_packages"
+# Functions which process metadata based on split packages
+PACKAGEFUNCS += " \
+                package_fixsymlinks \
+                package_name_hook \
+                package_do_filedeps \
+                package_do_shlibs \
+                package_do_pkgconfig \
+                read_shlibdeps \
+                package_depchains \
+                emit_pkgdata"
+
+python do_package () {
+    # Change the following version to cause sstate to invalidate the package
+    # cache.  This is useful if an item this class depends on changes in a
+    # way that the output of this class changes.  rpmdeps is a good example
+    # as any change to rpmdeps requires this to be rerun.
+    # PACKAGE_BBCLASS_VERSION = "1"
+
+    # Init cachedpath
+    global cpath
+    cpath = oe.cachedpath.CachedPath()
+
+    ###########################################################################
+    # Sanity test the setup
+    ###########################################################################
+
+    packages = (d.getVar('PACKAGES', True) or "").split()
+    if len(packages) < 1:
+        bb.debug(1, "No packages to build, skipping do_package")
+        return
+
+    workdir = d.getVar('WORKDIR', True)
+    outdir = d.getVar('DEPLOY_DIR', True)
+    dest = d.getVar('D', True)
+    dvar = d.getVar('PKGD', True)
+    pn = d.getVar('PN', True)
+
+    if not workdir or not outdir or not dest or not dvar or not pn:
+        msg = "WORKDIR, DEPLOY_DIR, D, PN and PKGD all must be defined, unable to package"
+        package_qa_handle_error("var-undefined", msg, d)
+        return
+
+    bb.build.exec_func("package_get_auto_pr", d)
+
+    ###########################################################################
+    # Optimisations
+    ###########################################################################
+
+    # Continually expanding complex expressions is inefficient, particularly
+    # when we write to the datastore and invalidate the expansion cache. This
+    # code pre-expands some frequently used variables
+
+    def expandVar(x, d):
+        d.setVar(x, d.getVar(x, True))
+
+    for x in 'PN', 'PV', 'BPN', 'TARGET_SYS', 'EXTENDPRAUTO':
+        expandVar(x, d)
+
+    ###########################################################################
+    # Setup PKGD (from D)
+    ###########################################################################
+
+    for f in (d.getVar('PACKAGEBUILDPKGD', True) or '').split():
+        bb.build.exec_func(f, d)
+
+    ###########################################################################
+    # Split up PKGD into PKGDEST
+    ###########################################################################
+
+    cpath = oe.cachedpath.CachedPath()
+
+    for f in (d.getVar('PACKAGESPLITFUNCS', True) or '').split():
+        bb.build.exec_func(f, d)
+
+    ###########################################################################
+    # Process PKGDEST
+    ###########################################################################
+
+    # Build global list of files in each split package
+    global pkgfiles
+    pkgfiles = {}
+    packages = d.getVar('PACKAGES', True).split()
+    pkgdest = d.getVar('PKGDEST', True)
+    for pkg in packages:
+        pkgfiles[pkg] = []
+        for walkroot, dirs, files in cpath.walk(pkgdest + "/" + pkg):
+            for file in files:
+                pkgfiles[pkg].append(walkroot + os.sep + file)
+
+    for f in (d.getVar('PACKAGEFUNCS', True) or '').split():
+        bb.build.exec_func(f, d)
+}
+
+do_package[dirs] = "${SHLIBSWORKDIR} ${PKGDESTWORK} ${D}"
+do_package[vardeps] += "${PACKAGEBUILDPKGD} ${PACKAGESPLITFUNCS} ${PACKAGEFUNCS} ${@gen_packagevar(d)}"
+addtask package after do_install
+
+PACKAGELOCK = "${STAGING_DIR}/package-output.lock"
+SSTATETASKS += "do_package"
+do_package[cleandirs] = "${PKGDEST} ${PKGDESTWORK}"
+do_package[sstate-plaindirs] = "${PKGD} ${PKGDEST} ${PKGDESTWORK}"
+do_package[sstate-lockfile-shared] = "${PACKAGELOCK}"
+do_package_setscene[dirs] = "${STAGING_DIR}"
+
+python do_package_setscene () {
+    sstate_setscene(d)
+}
+addtask do_package_setscene
+
+do_packagedata () {
+	:
+}
+
+addtask packagedata before do_build after do_package
+
+SSTATETASKS += "do_packagedata"
+do_packagedata[sstate-inputdirs] = "${PKGDESTWORK}"
+do_packagedata[sstate-outputdirs] = "${PKGDATA_DIR}"
+do_packagedata[sstate-lockfile-shared] = "${PACKAGELOCK}"
+do_packagedata[stamp-extra-info] = "${MACHINE}"
+
+python do_packagedata_setscene () {
+    sstate_setscene(d)
+}
+addtask do_packagedata_setscene
+
+#
+# Helper functions for the package writing classes
+#
+
+def mapping_rename_hook(d):
+    """
+    Rewrite variables to account for package renaming in things
+    like debian.bbclass or manual PKG variable name changes
+    """
+    pkg = d.getVar("PKG", True)
+    runtime_mapping_rename("RDEPENDS", pkg, d)
+    runtime_mapping_rename("RRECOMMENDS", pkg, d)
+    runtime_mapping_rename("RSUGGESTS", pkg, d)
+
diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
new file mode 100644
index 0000000..d2fea4f
--- /dev/null
+++ b/meta/classes/package_deb.bbclass
@@ -0,0 +1,338 @@
+#
+# Copyright 2006-2008 OpenedHand Ltd.
+#
+
+inherit package
+
+IMAGE_PKGTYPE ?= "deb"
+
+DPKG_ARCH ?= "${TARGET_ARCH}" 
+
+PKGWRITEDIRDEB = "${WORKDIR}/deploy-debs"
+
+APTCONF_TARGET = "${WORKDIR}"
+
+APT_ARGS = "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
+
+#
+# install a bunch of packages using apt
+# the following shell variables needs to be set before calling this func:
+# INSTALL_ROOTFS_DEB - install root dir
+# INSTALL_BASEARCH_DEB - install base architecutre
+# INSTALL_ARCHS_DEB - list of available archs
+# INSTALL_PACKAGES_NORMAL_DEB - packages to be installed
+# INSTALL_PACKAGES_ATTEMPTONLY_DEB - packages attemped to be installed only
+# INSTALL_PACKAGES_LINGUAS_DEB - additional packages for uclibc
+# INSTALL_TASK_DEB - task name
+
+python do_package_deb () {
+    import re, copy
+    import textwrap
+    import subprocess
+
+    workdir = d.getVar('WORKDIR', True)
+    if not workdir:
+        bb.error("WORKDIR not defined, unable to package")
+        return
+
+    outdir = d.getVar('PKGWRITEDIRDEB', True)
+    if not outdir:
+        bb.error("PKGWRITEDIRDEB not defined, unable to package")
+        return
+
+    packages = d.getVar('PACKAGES', True)
+    if not packages:
+        bb.debug(1, "PACKAGES not defined, nothing to package")
+        return
+
+    tmpdir = d.getVar('TMPDIR', True)
+
+    if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK):
+        os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"))
+
+    if packages == []:
+        bb.debug(1, "No packages; nothing to do")
+        return
+
+    pkgdest = d.getVar('PKGDEST', True)
+
+    def cleanupcontrol(root):
+        for p in ['CONTROL', 'DEBIAN']:
+            p = os.path.join(root, p)
+            if os.path.exists(p):
+                bb.utils.prunedir(p)
+
+    for pkg in packages.split():
+        localdata = bb.data.createCopy(d)
+        root = "%s/%s" % (pkgdest, pkg)
+
+        lf = bb.utils.lockfile(root + ".lock")
+
+        localdata.setVar('ROOT', '')
+        localdata.setVar('ROOT_%s' % pkg, root)
+        pkgname = localdata.getVar('PKG_%s' % pkg, True)
+        if not pkgname:
+            pkgname = pkg
+        localdata.setVar('PKG', pkgname)
+
+        localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
+
+        bb.data.update_data(localdata)
+        basedir = os.path.join(os.path.dirname(root))
+
+        pkgoutdir = os.path.join(outdir, localdata.getVar('PACKAGE_ARCH', True))
+        bb.utils.mkdirhier(pkgoutdir)
+
+        os.chdir(root)
+        cleanupcontrol(root)
+        from glob import glob
+        g = glob('*')
+        if not g and localdata.getVar('ALLOW_EMPTY', False) != "1":
+            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True)))
+            bb.utils.unlockfile(lf)
+            continue
+
+        controldir = os.path.join(root, 'DEBIAN')
+        bb.utils.mkdirhier(controldir)
+        os.chmod(controldir, 0755)
+        try:
+            import codecs
+            ctrlfile = codecs.open(os.path.join(controldir, 'control'), 'w', 'utf-8')
+        except OSError:
+            bb.utils.unlockfile(lf)
+            raise bb.build.FuncFailed("unable to open control file for writing.")
+
+        fields = []
+        pe = d.getVar('PKGE', True)
+        if pe and int(pe) > 0:
+            fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
+        else:
+            fields.append(["Version: %s-%s\n", ['PKGV', 'PKGR']])
+        fields.append(["Description: %s\n", ['DESCRIPTION']])
+        fields.append(["Section: %s\n", ['SECTION']])
+        fields.append(["Priority: %s\n", ['PRIORITY']])
+        fields.append(["Maintainer: %s\n", ['MAINTAINER']])
+        fields.append(["Architecture: %s\n", ['DPKG_ARCH']])
+        fields.append(["OE: %s\n", ['PN']])
+        fields.append(["PackageArch: %s\n", ['PACKAGE_ARCH']])
+        if d.getVar('HOMEPAGE', True):
+            fields.append(["Homepage: %s\n", ['HOMEPAGE']])
+
+        # Package, Version, Maintainer, Description - mandatory
+        # Section, Priority, Essential, Architecture, Source, Depends, Pre-Depends, Recommends, Suggests, Conflicts, Replaces, Provides - Optional
+
+
+        def pullData(l, d):
+            l2 = []
+            for i in l:
+                data = d.getVar(i, True)
+                if data is None:
+                    raise KeyError(f)
+                if i == 'DPKG_ARCH' and d.getVar('PACKAGE_ARCH', True) == 'all':
+                    data = 'all'
+                elif i == 'PACKAGE_ARCH' or i == 'DPKG_ARCH':
+                   # The params in deb package control don't allow character
+                   # `_', so change the arch's `_' to `-'. Such as `x86_64'
+                   # -->`x86-64'
+                   data = data.replace('_', '-')
+                l2.append(data)
+            return l2
+
+        ctrlfile.write("Package: %s\n" % pkgname)
+        # check for required fields
+        try:
+            for (c, fs) in fields:
+                for f in fs:
+                     if localdata.getVar(f, False) is None:
+                         raise KeyError(f)
+                # Special behavior for description...
+                if 'DESCRIPTION' in fs:
+                     summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "."
+                     ctrlfile.write('Description: %s\n' % unicode(summary,'utf-8'))
+                     description = localdata.getVar('DESCRIPTION', True) or "."
+                     description = textwrap.dedent(description).strip()
+                     if '\\n' in description:
+                         # Manually indent
+                         for t in description.split('\\n'):
+                             # We don't limit the width when manually indent, but we do
+                             # need the textwrap.fill() to set the initial_indent and
+                             # subsequent_indent, so set a large width
+                             ctrlfile.write('%s\n' % unicode(textwrap.fill(t, width=100000, initial_indent=' ', subsequent_indent=' '),'utf-8'))
+                     else:
+                         # Auto indent
+                         ctrlfile.write('%s\n' % unicode(textwrap.fill(description.strip(), width=74, initial_indent=' ', subsequent_indent=' '),'utf-8'))
+
+                else:
+                     ctrlfile.write(unicode(c % tuple(pullData(fs, localdata)),'utf-8'))
+        except KeyError:
+            import sys
+            (type, value, traceback) = sys.exc_info()
+            bb.utils.unlockfile(lf)
+            ctrlfile.close()
+            raise bb.build.FuncFailed("Missing field for deb generation: %s" % value)
+        except UnicodeDecodeError:
+            bb.utils.unlockfile(lf)
+            ctrlfile.close()
+            raise bb.build.FuncFailed("Non UTF-8 characters found in one of the fields")
+
+        # more fields
+
+        custom_fields_chunk = get_package_additional_metadata("deb", localdata)
+        if custom_fields_chunk is not None:
+            ctrlfile.write(unicode(custom_fields_chunk))
+            ctrlfile.write("\n")
+
+        mapping_rename_hook(localdata)
+
+        def debian_cmp_remap(var):
+            # dpkg does not allow for '(' or ')' in a dependency name
+            # replace these instances with '__' and '__'
+            #
+            # In debian '>' and '<' do not mean what it appears they mean
+            #   '<' = less or equal
+            #   '>' = greater or equal
+            # adjust these to the '<<' and '>>' equivalents
+            #
+            for dep in var:
+                if '(' in dep:
+                    newdep = dep.replace('(', '__')
+                    newdep = newdep.replace(')', '__')
+                    if newdep != dep:
+                        var[newdep] = var[dep]
+                        del var[dep]
+            for dep in var:
+                for i, v in enumerate(var[dep]):
+                    if (v or "").startswith("< "):
+                        var[dep][i] = var[dep][i].replace("< ", "<< ")
+                    elif (v or "").startswith("> "):
+                        var[dep][i] = var[dep][i].replace("> ", ">> ")
+
+        rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS", True) or "")
+        debian_cmp_remap(rdepends)
+        for dep in rdepends:
+                if '*' in dep:
+                        del rdepends[dep]
+        rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "")
+        debian_cmp_remap(rrecommends)
+        for dep in rrecommends:
+                if '*' in dep:
+                        del rrecommends[dep]
+        rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS", True) or "")
+        debian_cmp_remap(rsuggests)
+        # Deliberately drop version information here, not wanted/supported by deb
+        rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES", True) or ""), [])
+        debian_cmp_remap(rprovides)
+        rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES", True) or "")
+        debian_cmp_remap(rreplaces)
+        rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
+        debian_cmp_remap(rconflicts)
+        if rdepends:
+            ctrlfile.write("Depends: %s\n" % unicode(bb.utils.join_deps(rdepends)))
+        if rsuggests:
+            ctrlfile.write("Suggests: %s\n" % unicode(bb.utils.join_deps(rsuggests)))
+        if rrecommends:
+            ctrlfile.write("Recommends: %s\n" % unicode(bb.utils.join_deps(rrecommends)))
+        if rprovides:
+            ctrlfile.write("Provides: %s\n" % unicode(bb.utils.join_deps(rprovides)))
+        if rreplaces:
+            ctrlfile.write("Replaces: %s\n" % unicode(bb.utils.join_deps(rreplaces)))
+        if rconflicts:
+            ctrlfile.write("Conflicts: %s\n" % unicode(bb.utils.join_deps(rconflicts)))
+        ctrlfile.close()
+
+        for script in ["preinst", "postinst", "prerm", "postrm"]:
+            scriptvar = localdata.getVar('pkg_%s' % script, True)
+            if not scriptvar:
+                continue
+            scriptvar = scriptvar.strip()
+            try:
+                scriptfile = open(os.path.join(controldir, script), 'w')
+            except OSError:
+                bb.utils.unlockfile(lf)
+                raise bb.build.FuncFailed("unable to open %s script file for writing." % script)
+
+            if scriptvar.startswith("#!"):
+                pos = scriptvar.find("\n") + 1
+                scriptfile.write(scriptvar[:pos])
+            else:
+                pos = 0
+                scriptfile.write("#!/bin/sh\n")
+
+            # Prevent the prerm/postrm scripts from being run during an upgrade
+            if script in ('prerm', 'postrm'):
+                scriptfile.write('[ "$1" != "upgrade" ] || exit 0\n')
+
+            scriptfile.write(scriptvar[pos:])
+            scriptfile.write('\n')
+            scriptfile.close()
+            os.chmod(os.path.join(controldir, script), 0755)
+
+        conffiles_str = ' '.join(get_conffiles(pkg, d))
+        if conffiles_str:
+            try:
+                conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
+            except OSError:
+                bb.utils.unlockfile(lf)
+                raise bb.build.FuncFailed("unable to open conffiles for writing.")
+            for f in conffiles_str.split():
+                if os.path.exists(oe.path.join(root, f)):
+                    conffiles.write('%s\n' % f)
+            conffiles.close()
+
+        os.chdir(basedir)
+        ret = subprocess.call("PATH=\"%s\" dpkg-deb -b %s %s" % (localdata.getVar("PATH", True), root, pkgoutdir), shell=True)
+        if ret != 0:
+            bb.utils.unlockfile(lf)
+            raise bb.build.FuncFailed("dpkg-deb execution failed")
+
+        cleanupcontrol(root)
+        bb.utils.unlockfile(lf)
+}
+# Otherwise allarch packages may change depending on override configuration
+do_package_deb[vardepsexclude] = "OVERRIDES"
+
+
+SSTATETASKS += "do_package_write_deb"
+do_package_write_deb[sstate-inputdirs] = "${PKGWRITEDIRDEB}"
+do_package_write_deb[sstate-outputdirs] = "${DEPLOY_DIR_DEB}"
+
+python do_package_write_deb_setscene () {
+    tmpdir = d.getVar('TMPDIR', True)
+
+    if os.access(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"),os.R_OK):
+        os.unlink(os.path.join(tmpdir, "stamps", "DEB_PACKAGE_INDEX_CLEAN"))
+
+    sstate_setscene(d)
+}
+addtask do_package_write_deb_setscene
+
+python () {
+    if d.getVar('PACKAGES', True) != '':
+        deps = ' dpkg-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
+        d.appendVarFlag('do_package_write_deb', 'depends', deps)
+        d.setVarFlag('do_package_write_deb', 'fakeroot', "1")
+
+    # Map TARGET_ARCH to Debian's ideas about architectures
+    darch = d.getVar('DPKG_ARCH', True)
+    if darch in ["x86", "i486", "i586", "i686", "pentium"]:
+         d.setVar('DPKG_ARCH', 'i386')
+    elif darch == "x86_64":
+         d.setVar('DPKG_ARCH', 'amd64')
+    elif darch == "arm":
+         d.setVar('DPKG_ARCH', 'armel')
+}
+
+python do_package_write_deb () {
+    bb.build.exec_func("read_subpackage_metadata", d)
+    bb.build.exec_func("do_package_deb", d)
+}
+do_package_write_deb[dirs] = "${PKGWRITEDIRDEB}"
+do_package_write_deb[cleandirs] = "${PKGWRITEDIRDEB}"
+do_package_write_deb[umask] = "022"
+addtask package_write_deb after do_packagedata do_package
+
+
+PACKAGEINDEXDEPS += "dpkg-native:do_populate_sysroot"
+PACKAGEINDEXDEPS += "apt-native:do_populate_sysroot"
+
+do_build[recrdeptask] += "do_package_write_deb"
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
new file mode 100644
index 0000000..4dd7a7e
--- /dev/null
+++ b/meta/classes/package_ipk.bbclass
@@ -0,0 +1,289 @@
+inherit package
+
+IMAGE_PKGTYPE ?= "ipk"
+
+IPKGCONF_TARGET = "${WORKDIR}/opkg.conf"
+IPKGCONF_SDK =  "${WORKDIR}/opkg-sdk.conf"
+
+PKGWRITEDIRIPK = "${WORKDIR}/deploy-ipks"
+
+# Program to be used to build opkg packages
+OPKGBUILDCMD ??= "opkg-build"
+
+OPKG_ARGS = "--force_postinstall --prefer-arch-to-version"
+OPKG_ARGS += "${@['', '--no-install-recommends'][d.getVar("NO_RECOMMENDATIONS", True) == "1"]}"
+OPKG_ARGS += "${@['', '--add-exclude ' + ' --add-exclude '.join((d.getVar('PACKAGE_EXCLUDE', True) or "").split())][(d.getVar("PACKAGE_EXCLUDE", True) or "") != ""]}"
+
+OPKGLIBDIR = "${localstatedir}/lib"
+
+python do_package_ipk () {
+    import re, copy
+    import textwrap
+    import subprocess
+
+    workdir = d.getVar('WORKDIR', True)
+    outdir = d.getVar('PKGWRITEDIRIPK', True)
+    tmpdir = d.getVar('TMPDIR', True)
+    pkgdest = d.getVar('PKGDEST', True)
+    if not workdir or not outdir or not tmpdir:
+        bb.error("Variables incorrectly set, unable to package")
+        return
+
+    packages = d.getVar('PACKAGES', True)
+    if not packages or packages == '':
+        bb.debug(1, "No packages; nothing to do")
+        return
+
+    # We're about to add new packages so the index needs to be checked
+    # so remove the appropriate stamp file.
+    if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
+        os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
+
+    def cleanupcontrol(root):
+        for p in ['CONTROL', 'DEBIAN']:
+            p = os.path.join(root, p)
+            if os.path.exists(p):
+                bb.utils.prunedir(p)
+
+    for pkg in packages.split():
+        localdata = bb.data.createCopy(d)
+        root = "%s/%s" % (pkgdest, pkg)
+
+        lf = bb.utils.lockfile(root + ".lock")
+
+        localdata.setVar('ROOT', '')
+        localdata.setVar('ROOT_%s' % pkg, root)
+        pkgname = localdata.getVar('PKG_%s' % pkg, True)
+        if not pkgname:
+            pkgname = pkg
+        localdata.setVar('PKG', pkgname)
+
+        localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
+
+        bb.data.update_data(localdata)
+        basedir = os.path.join(os.path.dirname(root))
+        arch = localdata.getVar('PACKAGE_ARCH', True)
+
+        if localdata.getVar('IPK_HIERARCHICAL_FEED', False) == "1":
+            # Spread packages across subdirectories so each isn't too crowded
+            if pkgname.startswith('lib'):
+                pkg_prefix = 'lib' + pkgname[3]
+            else:
+                pkg_prefix = pkgname[0]
+
+            # Keep -dbg, -dev, -doc, -staticdev, -locale and -locale-* packages
+            # together. These package suffixes are taken from the definitions of
+            # PACKAGES and PACKAGES_DYNAMIC in meta/conf/bitbake.conf
+            if pkgname[-4:] in ('-dbg', '-dev', '-doc'):
+                pkg_subdir = pkgname[:-4]
+            elif pkgname.endswith('-staticdev'):
+                pkg_subdir = pkgname[:-10]
+            elif pkgname.endswith('-locale'):
+                pkg_subdir = pkgname[:-7]
+            elif '-locale-' in pkgname:
+                pkg_subdir = pkgname[:pkgname.find('-locale-')]
+            else:
+                pkg_subdir = pkgname
+
+            pkgoutdir = "%s/%s/%s/%s" % (outdir, arch, pkg_prefix, pkg_subdir)
+        else:
+            pkgoutdir = "%s/%s" % (outdir, arch)
+
+        bb.utils.mkdirhier(pkgoutdir)
+        os.chdir(root)
+        cleanupcontrol(root)
+        from glob import glob
+        g = glob('*')
+        if not g and localdata.getVar('ALLOW_EMPTY', False) != "1":
+            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True)))
+            bb.utils.unlockfile(lf)
+            continue
+
+        controldir = os.path.join(root, 'CONTROL')
+        bb.utils.mkdirhier(controldir)
+        try:
+            ctrlfile = open(os.path.join(controldir, 'control'), 'w')
+        except OSError:
+            bb.utils.unlockfile(lf)
+            raise bb.build.FuncFailed("unable to open control file for writing.")
+
+        fields = []
+        pe = d.getVar('PKGE', True)
+        if pe and int(pe) > 0:
+            fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
+        else:
+            fields.append(["Version: %s-%s\n", ['PKGV', 'PKGR']])
+        fields.append(["Description: %s\n", ['DESCRIPTION']])
+        fields.append(["Section: %s\n", ['SECTION']])
+        fields.append(["Priority: %s\n", ['PRIORITY']])
+        fields.append(["Maintainer: %s\n", ['MAINTAINER']])
+        fields.append(["License: %s\n", ['LICENSE']])
+        fields.append(["Architecture: %s\n", ['PACKAGE_ARCH']])
+        fields.append(["OE: %s\n", ['PN']])
+        if d.getVar('HOMEPAGE', True):
+            fields.append(["Homepage: %s\n", ['HOMEPAGE']])
+
+        def pullData(l, d):
+            l2 = []
+            for i in l:
+                l2.append(d.getVar(i, True))
+            return l2
+
+        ctrlfile.write("Package: %s\n" % pkgname)
+        # check for required fields
+        try:
+            for (c, fs) in fields:
+                for f in fs:
+                    if localdata.getVar(f, False) is None:
+                        raise KeyError(f)
+                # Special behavior for description...
+                if 'DESCRIPTION' in fs:
+                    summary = localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or "."
+                    ctrlfile.write('Description: %s\n' % summary)
+                    description = localdata.getVar('DESCRIPTION', True) or "."
+                    description = textwrap.dedent(description).strip()
+                    if '\\n' in description:
+                        # Manually indent
+                        for t in description.split('\\n'):
+                            # We don't limit the width when manually indent, but we do
+                            # need the textwrap.fill() to set the initial_indent and
+                            # subsequent_indent, so set a large width
+                            ctrlfile.write('%s\n' % textwrap.fill(t.strip(), width=100000, initial_indent=' ', subsequent_indent=' '))
+                    else:
+                        # Auto indent
+                        ctrlfile.write('%s\n' % textwrap.fill(description, width=74, initial_indent=' ', subsequent_indent=' '))
+                else:
+                    ctrlfile.write(c % tuple(pullData(fs, localdata)))
+        except KeyError:
+            import sys
+            (type, value, traceback) = sys.exc_info()
+            ctrlfile.close()
+            bb.utils.unlockfile(lf)
+            raise bb.build.FuncFailed("Missing field for ipk generation: %s" % value)
+        # more fields
+
+        custom_fields_chunk = get_package_additional_metadata("ipk", localdata)
+        if custom_fields_chunk is not None:
+            ctrlfile.write(custom_fields_chunk)
+            ctrlfile.write("\n")
+
+        mapping_rename_hook(localdata)
+
+        def debian_cmp_remap(var):
+            # In debian '>' and '<' do not mean what it appears they mean
+            #   '<' = less or equal
+            #   '>' = greater or equal
+            # adjust these to the '<<' and '>>' equivalents
+            #
+            for dep in var:
+                for i, v in enumerate(var[dep]):
+                    if (v or "").startswith("< "):
+                        var[dep][i] = var[dep][i].replace("< ", "<< ")
+                    elif (v or "").startswith("> "):
+                        var[dep][i] = var[dep][i].replace("> ", ">> ")
+
+        rdepends = bb.utils.explode_dep_versions2(localdata.getVar("RDEPENDS", True) or "")
+        debian_cmp_remap(rdepends)
+        rrecommends = bb.utils.explode_dep_versions2(localdata.getVar("RRECOMMENDS", True) or "")
+        debian_cmp_remap(rrecommends)
+        rsuggests = bb.utils.explode_dep_versions2(localdata.getVar("RSUGGESTS", True) or "")
+        debian_cmp_remap(rsuggests)
+        # Deliberately drop version information here, not wanted/supported by ipk
+        rprovides = dict.fromkeys(bb.utils.explode_dep_versions2(localdata.getVar("RPROVIDES", True) or ""), [])
+        debian_cmp_remap(rprovides)
+        rreplaces = bb.utils.explode_dep_versions2(localdata.getVar("RREPLACES", True) or "")
+        debian_cmp_remap(rreplaces)
+        rconflicts = bb.utils.explode_dep_versions2(localdata.getVar("RCONFLICTS", True) or "")
+        debian_cmp_remap(rconflicts)
+
+        if rdepends:
+            ctrlfile.write("Depends: %s\n" % bb.utils.join_deps(rdepends))
+        if rsuggests:
+            ctrlfile.write("Suggests: %s\n" % bb.utils.join_deps(rsuggests))
+        if rrecommends:
+            ctrlfile.write("Recommends: %s\n" % bb.utils.join_deps(rrecommends))
+        if rprovides:
+            ctrlfile.write("Provides: %s\n" % bb.utils.join_deps(rprovides))
+        if rreplaces:
+            ctrlfile.write("Replaces: %s\n" % bb.utils.join_deps(rreplaces))
+        if rconflicts:
+            ctrlfile.write("Conflicts: %s\n" % bb.utils.join_deps(rconflicts))
+        src_uri = localdata.getVar("SRC_URI", True).strip() or "None"
+        if src_uri:
+            src_uri = re.sub("\s+", " ", src_uri)
+            ctrlfile.write("Source: %s\n" % " ".join(src_uri.split()))
+        ctrlfile.close()
+
+        for script in ["preinst", "postinst", "prerm", "postrm"]:
+            scriptvar = localdata.getVar('pkg_%s' % script, True)
+            if not scriptvar:
+                continue
+            try:
+                scriptfile = open(os.path.join(controldir, script), 'w')
+            except OSError:
+                bb.utils.unlockfile(lf)
+                raise bb.build.FuncFailed("unable to open %s script file for writing." % script)
+            scriptfile.write(scriptvar)
+            scriptfile.close()
+            os.chmod(os.path.join(controldir, script), 0755)
+
+        conffiles_str = ' '.join(get_conffiles(pkg, d))
+        if conffiles_str:
+            try:
+                conffiles = open(os.path.join(controldir, 'conffiles'), 'w')
+            except OSError:
+                bb.utils.unlockfile(lf)
+                raise bb.build.FuncFailed("unable to open conffiles for writing.")
+            for f in conffiles_str.split():
+                if os.path.exists(oe.path.join(root, f)):
+                    conffiles.write('%s\n' % f)
+            conffiles.close()
+
+        os.chdir(basedir)
+        ret = subprocess.call("PATH=\"%s\" %s %s %s" % (localdata.getVar("PATH", True),
+                                                          d.getVar("OPKGBUILDCMD",1), pkg, pkgoutdir), shell=True)
+        if ret != 0:
+            bb.utils.unlockfile(lf)
+            raise bb.build.FuncFailed("opkg-build execution failed")
+
+        cleanupcontrol(root)
+        bb.utils.unlockfile(lf)
+
+}
+# Otherwise allarch packages may change depending on override configuration
+do_package_ipk[vardepsexclude] = "OVERRIDES"
+
+SSTATETASKS += "do_package_write_ipk"
+do_package_write_ipk[sstate-inputdirs] = "${PKGWRITEDIRIPK}"
+do_package_write_ipk[sstate-outputdirs] = "${DEPLOY_DIR_IPK}"
+
+python do_package_write_ipk_setscene () {
+    tmpdir = d.getVar('TMPDIR', True)
+
+    if os.access(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"), os.R_OK):
+        os.unlink(os.path.join(tmpdir, "stamps", "IPK_PACKAGE_INDEX_CLEAN"))
+
+    sstate_setscene(d)
+}
+addtask do_package_write_ipk_setscene
+
+python () {
+    if d.getVar('PACKAGES', True) != '':
+        deps = ' opkg-utils-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
+        d.appendVarFlag('do_package_write_ipk', 'depends', deps)
+        d.setVarFlag('do_package_write_ipk', 'fakeroot', "1")
+}
+
+python do_package_write_ipk () {
+    bb.build.exec_func("read_subpackage_metadata", d)
+    bb.build.exec_func("do_package_ipk", d)
+}
+do_package_write_ipk[dirs] = "${PKGWRITEDIRIPK}"
+do_package_write_ipk[cleandirs] = "${PKGWRITEDIRIPK}"
+do_package_write_ipk[umask] = "022"
+addtask package_write_ipk after do_packagedata do_package
+
+PACKAGEINDEXDEPS += "opkg-utils-native:do_populate_sysroot"
+PACKAGEINDEXDEPS += "opkg-native:do_populate_sysroot"
+
+do_build[recrdeptask] += "do_package_write_ipk"
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
new file mode 100644
index 0000000..1fa1634
--- /dev/null
+++ b/meta/classes/package_rpm.bbclass
@@ -0,0 +1,774 @@
+inherit package
+
+IMAGE_PKGTYPE ?= "rpm"
+
+RPM="rpm"
+RPMBUILD="rpmbuild"
+
+PKGWRITEDIRRPM = "${WORKDIR}/deploy-rpms"
+
+# Maintaining the perfile dependencies has singificant overhead when writing the 
+# packages. When set, this value merges them for efficiency.
+MERGEPERFILEDEPS = "1"
+
+# Construct per file dependencies file
+def write_rpm_perfiledata(srcname, d):
+    workdir = d.getVar('WORKDIR', True)
+    packages = d.getVar('PACKAGES', True)
+    pkgd = d.getVar('PKGD', True)
+
+    def dump_filerdeps(varname, outfile, d):
+        outfile.write("#!/usr/bin/env python\n\n")
+        outfile.write("# Dependency table\n")
+        outfile.write('deps = {\n')
+        for pkg in packages.split():
+            dependsflist_key = 'FILE' + varname + 'FLIST' + "_" + pkg
+            dependsflist = (d.getVar(dependsflist_key, True) or "")
+            for dfile in dependsflist.split():
+                key = "FILE" + varname + "_" + dfile + "_" + pkg
+                depends_dict = bb.utils.explode_dep_versions(d.getVar(key, True) or "")
+                file = dfile.replace("@underscore@", "_")
+                file = file.replace("@closebrace@", "]")
+                file = file.replace("@openbrace@", "[")
+                file = file.replace("@tab@", "\t")
+                file = file.replace("@space@", " ")
+                file = file.replace("@at@", "@")
+                outfile.write('"' + pkgd + file + '" : "')
+                for dep in depends_dict:
+                    ver = depends_dict[dep]
+                    if dep and ver:
+                        ver = ver.replace("(","")
+                        ver = ver.replace(")","")
+                        outfile.write(dep + " " + ver + " ")
+                    else:
+                        outfile.write(dep + " ")
+                outfile.write('",\n')
+        outfile.write('}\n\n')
+        outfile.write("import sys\n")
+        outfile.write("while 1:\n")
+        outfile.write("\tline = sys.stdin.readline().strip()\n")
+        outfile.write("\tif not line:\n")
+        outfile.write("\t\tsys.exit(0)\n")
+        outfile.write("\tif line in deps:\n")
+        outfile.write("\t\tprint(deps[line] + '\\n')\n")
+
+    # OE-core dependencies a.k.a. RPM requires
+    outdepends = workdir + "/" + srcname + ".requires"
+
+    try:
+        dependsfile = open(outdepends, 'w')
+    except OSError:
+        raise bb.build.FuncFailed("unable to open spec file for writing.")
+
+    dump_filerdeps('RDEPENDS', dependsfile, d)
+
+    dependsfile.close()
+    os.chmod(outdepends, 0755)
+
+    # OE-core / RPM Provides
+    outprovides = workdir + "/" + srcname + ".provides"
+
+    try:
+        providesfile = open(outprovides, 'w')
+    except OSError:
+        raise bb.build.FuncFailed("unable to open spec file for writing.")
+
+    dump_filerdeps('RPROVIDES', providesfile, d)
+
+    providesfile.close()
+    os.chmod(outprovides, 0755)
+
+    return (outdepends, outprovides)
+
+
+python write_specfile () {
+    import oe.packagedata
+
+    # append information for logs and patches to %prep
+    def add_prep(d,spec_files_bottom):
+        if d.getVarFlag('ARCHIVER_MODE', 'srpm', True) == '1' and bb.data.inherits_class('archiver', d):
+            spec_files_bottom.append('%%prep -n %s' % d.getVar('PN', True) )
+            spec_files_bottom.append('%s' % "echo \"include logs and patches, Please check them in SOURCES\"")
+            spec_files_bottom.append('')
+
+    # append the name of tarball to key word 'SOURCE' in xxx.spec.
+    def tail_source(d):
+        if d.getVarFlag('ARCHIVER_MODE', 'srpm', True) == '1' and bb.data.inherits_class('archiver', d):
+            ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
+            if not os.path.exists(ar_outdir):
+                return
+            source_list = os.listdir(ar_outdir)
+            source_number = 0
+            for source in source_list:
+                # The rpmbuild doesn't need the root permission, but it needs
+                # to know the file's user and group name, the only user and
+                # group in fakeroot is "root" when working in fakeroot.
+                f = os.path.join(ar_outdir, source)
+                os.chown(f, 0, 0)
+                spec_preamble_top.append('Source%s: %s' % (source_number, source))
+                source_number += 1
+    # We need a simple way to remove the MLPREFIX from the package name,
+    # and dependency information...
+    def strip_multilib(name, d):
+        multilibs = d.getVar('MULTILIBS', True) or ""
+        for ext in multilibs.split():
+            eext = ext.split(':')
+            if len(eext) > 1 and eext[0] == 'multilib' and name and name.find(eext[1] + '-') >= 0:
+                name = "".join(name.split(eext[1] + '-'))
+        return name
+
+    def strip_multilib_deps(deps, d):
+        depends = bb.utils.explode_dep_versions2(deps or "")
+        newdeps = {}
+        for dep in depends:
+            newdeps[strip_multilib(dep, d)] = depends[dep]
+        return bb.utils.join_deps(newdeps)
+
+#        ml = d.getVar("MLPREFIX", True)
+#        if ml and name and len(ml) != 0 and name.find(ml) == 0:
+#            return ml.join(name.split(ml, 1)[1:])
+#        return name
+
+    # In RPM, dependencies are of the format: pkg <>= Epoch:Version-Release
+    # This format is similar to OE, however there are restrictions on the
+    # characters that can be in a field.  In the Version field, "-"
+    # characters are not allowed.  "-" is allowed in the Release field.
+    #
+    # We translate the "-" in the version to a "+", by loading the PKGV
+    # from the dependent recipe, replacing the - with a +, and then using
+    # that value to do a replace inside of this recipe's dependencies.
+    # This preserves the "-" separator between the version and release, as
+    # well as any "-" characters inside of the release field.
+    #
+    # All of this has to happen BEFORE the mapping_rename_hook as
+    # after renaming we cannot look up the dependencies in the packagedata
+    # store.
+    def translate_vers(varname, d):
+        depends = d.getVar(varname, True)
+        if depends:
+            depends_dict = bb.utils.explode_dep_versions2(depends)
+            newdeps_dict = {}
+            for dep in depends_dict:
+                verlist = []
+                for ver in depends_dict[dep]:
+                    if '-' in ver:
+                        subd = oe.packagedata.read_subpkgdata_dict(dep, d)
+                        if 'PKGV' in subd:
+                            pv = subd['PV']
+                            pkgv = subd['PKGV']
+                            reppv = pkgv.replace('-', '+')
+                            ver = ver.replace(pv, reppv).replace(pkgv, reppv)
+                        if 'PKGR' in subd:
+                            # Make sure PKGR rather than PR in ver
+                            pr = '-' + subd['PR']
+                            pkgr = '-' + subd['PKGR']
+                            if pkgr not in ver:
+                                ver = ver.replace(pr, pkgr)
+                        verlist.append(ver)
+                    else:
+                        verlist.append(ver)
+                newdeps_dict[dep] = verlist
+            depends = bb.utils.join_deps(newdeps_dict)
+            d.setVar(varname, depends.strip())
+
+    # We need to change the style the dependency from BB to RPM
+    # This needs to happen AFTER the mapping_rename_hook
+    def print_deps(variable, tag, array, d):
+        depends = variable
+        if depends:
+            depends_dict = bb.utils.explode_dep_versions2(depends)
+            for dep in depends_dict:
+                for ver in depends_dict[dep]:
+                    ver = ver.replace('(', '')
+                    ver = ver.replace(')', '')
+                    array.append("%s: %s %s" % (tag, dep, ver))
+                if not len(depends_dict[dep]):
+                    array.append("%s: %s" % (tag, dep))
+
+    def walk_files(walkpath, target, conffiles, dirfiles):
+        # We can race against the ipk/deb backends which create CONTROL or DEBIAN directories
+        # when packaging. We just ignore these files which are created in 
+        # packages-split/ and not package/
+        # We have the odd situation where the CONTROL/DEBIAN directory can be removed in the middle of
+        # of the walk, the isdir() test would then fail and the walk code would assume its a file
+        # hence we check for the names in files too.
+        for rootpath, dirs, files in os.walk(walkpath):
+            path = rootpath.replace(walkpath, "")
+            if path.endswith("DEBIAN") or path.endswith("CONTROL"):
+                continue
+            path = path.replace("%", "%%%%%%%%")
+
+            # Treat all symlinks to directories as normal files.
+            # os.walk() lists them as directories.
+            def move_to_files(dir):
+                if os.path.islink(os.path.join(rootpath, dir)):
+                    files.append(dir)
+                    return True
+                else:
+                    return False
+            dirs[:] = [dir for dir in dirs if not move_to_files(dir)]
+
+            # Directory handling can happen in two ways, either DIRFILES is not set at all
+            # in which case we fall back to the older behaviour of packages owning all their
+            # directories
+            if dirfiles is None:
+                for dir in dirs:
+                    if dir == "CONTROL" or dir == "DEBIAN":
+                        continue
+                    dir = dir.replace("%", "%%%%%%%%")
+                    # All packages own the directories their files are in...
+                    target.append('%dir "' + path + '/' + dir + '"')
+            else:
+                # packages own only empty directories or explict directory.
+                # This will prevent the overlapping of security permission.
+                if path and not files and not dirs:
+                    target.append('%dir "' + path + '"')
+                elif path and path in dirfiles:
+                    target.append('%dir "' + path + '"')
+
+            for file in files:
+                if file == "CONTROL" or file == "DEBIAN":
+                    continue
+                file = file.replace("%", "%%%%%%%%")
+                if conffiles.count(path + '/' + file):
+                    target.append('%config "' + path + '/' + file + '"')
+                else:
+                    target.append('"' + path + '/' + file + '"')
+
+    # Prevent the prerm/postrm scripts from being run during an upgrade
+    def wrap_uninstall(scriptvar):
+        scr = scriptvar.strip()
+        if scr.startswith("#!"):
+            pos = scr.find("\n") + 1
+        else:
+            pos = 0
+        scr = scr[:pos] + 'if [ "$1" = "0" ] ; then\n' + scr[pos:] + '\nfi'
+        return scr
+
+    def get_perfile(varname, pkg, d):
+        deps = []
+        dependsflist_key = 'FILE' + varname + 'FLIST' + "_" + pkg
+        dependsflist = (d.getVar(dependsflist_key, True) or "")
+        for dfile in dependsflist.split():
+            key = "FILE" + varname + "_" + dfile + "_" + pkg
+            depends = d.getVar(key, True)
+            if depends:
+                deps.append(depends)
+        return " ".join(deps)
+
+    def append_description(spec_preamble, text):
+        """
+        Add the description to the spec file.
+        """
+        import textwrap
+        dedent_text = textwrap.dedent(text).strip()
+        # Bitbake saves "\n" as "\\n"
+        if '\\n' in dedent_text:
+            for t in dedent_text.split('\\n'):
+                spec_preamble.append(t.strip())
+        else:
+            spec_preamble.append('%s' % textwrap.fill(dedent_text, width=75))
+
+    packages = d.getVar('PACKAGES', True)
+    if not packages or packages == '':
+        bb.debug(1, "No packages; nothing to do")
+        return
+
+    pkgdest = d.getVar('PKGDEST', True)
+    if not pkgdest:
+        bb.fatal("No PKGDEST")
+
+    outspecfile = d.getVar('OUTSPECFILE', True)
+    if not outspecfile:
+        bb.fatal("No OUTSPECFILE")
+
+    # Construct the SPEC file...
+    srcname    = strip_multilib(d.getVar('PN', True), d)
+    srcsummary = (d.getVar('SUMMARY', True) or d.getVar('DESCRIPTION', True) or ".")
+    srcversion = d.getVar('PKGV', True).replace('-', '+')
+    srcrelease = d.getVar('PKGR', True)
+    srcepoch   = (d.getVar('PKGE', True) or "")
+    srclicense = d.getVar('LICENSE', True)
+    srcsection = d.getVar('SECTION', True)
+    srcmaintainer  = d.getVar('MAINTAINER', True)
+    srchomepage    = d.getVar('HOMEPAGE', True)
+    srcdescription = d.getVar('DESCRIPTION', True) or "."
+    srccustomtagschunk = get_package_additional_metadata("rpm", d)
+
+    srcdepends     = strip_multilib_deps(d.getVar('DEPENDS', True), d)
+    srcrdepends    = []
+    srcrrecommends = []
+    srcrsuggests   = []
+    srcrprovides   = []
+    srcrreplaces   = []
+    srcrconflicts  = []
+    srcrobsoletes  = []
+
+    srcrpreinst  = []
+    srcrpostinst = []
+    srcrprerm    = []
+    srcrpostrm   = []
+
+    spec_preamble_top = []
+    spec_preamble_bottom = []
+
+    spec_scriptlets_top = []
+    spec_scriptlets_bottom = []
+
+    spec_files_top = []
+    spec_files_bottom = []
+
+    perfiledeps = (d.getVar("MERGEPERFILEDEPS", True) or "0") == "0"
+    extra_pkgdata = (d.getVar("RPM_EXTRA_PKGDATA", True) or "0") == "1"
+
+    for pkg in packages.split():
+        localdata = bb.data.createCopy(d)
+
+        root = "%s/%s" % (pkgdest, pkg)
+
+        localdata.setVar('ROOT', '')
+        localdata.setVar('ROOT_%s' % pkg, root)
+        pkgname = localdata.getVar('PKG_%s' % pkg, True)
+        if not pkgname:
+            pkgname = pkg
+        localdata.setVar('PKG', pkgname)
+
+        localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)
+
+        bb.data.update_data(localdata)
+
+        conffiles = get_conffiles(pkg, d)
+        dirfiles = localdata.getVar('DIRFILES', True)
+        if dirfiles is not None:
+            dirfiles = dirfiles.split()
+
+        splitname    = strip_multilib(pkgname, d)
+
+        splitsummary = (localdata.getVar('SUMMARY', True) or localdata.getVar('DESCRIPTION', True) or ".")
+        splitversion = (localdata.getVar('PKGV', True) or "").replace('-', '+')
+        splitrelease = (localdata.getVar('PKGR', True) or "")
+        splitepoch   = (localdata.getVar('PKGE', True) or "")
+        splitlicense = (localdata.getVar('LICENSE', True) or "")
+        splitsection = (localdata.getVar('SECTION', True) or "")
+        splitdescription = (localdata.getVar('DESCRIPTION', True) or ".")
+        splitcustomtagschunk = get_package_additional_metadata("rpm", localdata)
+
+        translate_vers('RDEPENDS', localdata)
+        translate_vers('RRECOMMENDS', localdata)
+        translate_vers('RSUGGESTS', localdata)
+        translate_vers('RPROVIDES', localdata)
+        translate_vers('RREPLACES', localdata)
+        translate_vers('RCONFLICTS', localdata)
+
+        # Map the dependencies into their final form
+        mapping_rename_hook(localdata)
+
+        splitrdepends    = strip_multilib_deps(localdata.getVar('RDEPENDS', True), d)
+        splitrrecommends = strip_multilib_deps(localdata.getVar('RRECOMMENDS', True), d)
+        splitrsuggests   = strip_multilib_deps(localdata.getVar('RSUGGESTS', True), d)
+        splitrprovides   = strip_multilib_deps(localdata.getVar('RPROVIDES', True), d)
+        splitrreplaces   = strip_multilib_deps(localdata.getVar('RREPLACES', True), d)
+        splitrconflicts  = strip_multilib_deps(localdata.getVar('RCONFLICTS', True), d)
+        splitrobsoletes  = []
+
+        splitrpreinst  = localdata.getVar('pkg_preinst', True)
+        splitrpostinst = localdata.getVar('pkg_postinst', True)
+        splitrprerm    = localdata.getVar('pkg_prerm', True)
+        splitrpostrm   = localdata.getVar('pkg_postrm', True)
+
+
+        if not perfiledeps:
+            # Add in summary of per file dependencies
+            splitrdepends = splitrdepends + " " + get_perfile('RDEPENDS', pkg, d)
+            splitrprovides = splitrprovides + " " + get_perfile('RPROVIDES', pkg, d)
+
+        # Gather special src/first package data
+        if srcname == splitname:
+            srcrdepends    = splitrdepends
+            srcrrecommends = splitrrecommends
+            srcrsuggests   = splitrsuggests
+            srcrprovides   = splitrprovides
+            srcrreplaces   = splitrreplaces
+            srcrconflicts  = splitrconflicts
+
+            srcrpreinst    = splitrpreinst
+            srcrpostinst   = splitrpostinst
+            srcrprerm      = splitrprerm
+            srcrpostrm     = splitrpostrm
+
+            file_list = []
+            walk_files(root, file_list, conffiles, dirfiles)
+            if not file_list and localdata.getVar('ALLOW_EMPTY', False) != "1":
+                bb.note("Not creating empty RPM package for %s" % splitname)
+            else:
+                bb.note("Creating RPM package for %s" % splitname)
+                spec_files_top.append('%files')
+                if extra_pkgdata:
+                    package_rpm_extra_pkgdata(splitname, spec_files_top, localdata)
+                spec_files_top.append('%defattr(-,-,-,-)')
+                if file_list:
+                    bb.note("Creating RPM package for %s" % splitname)
+                    spec_files_top.extend(file_list)
+                else:
+                    bb.note("Creating EMPTY RPM Package for %s" % splitname)
+                spec_files_top.append('')
+            continue
+
+        # Process subpackage data
+        spec_preamble_bottom.append('%%package -n %s' % splitname)
+        spec_preamble_bottom.append('Summary: %s' % splitsummary)
+        if srcversion != splitversion:
+            spec_preamble_bottom.append('Version: %s' % splitversion)
+        if srcrelease != splitrelease:
+            spec_preamble_bottom.append('Release: %s' % splitrelease)
+        if srcepoch != splitepoch:
+            spec_preamble_bottom.append('Epoch: %s' % splitepoch)
+        if srclicense != splitlicense:
+            spec_preamble_bottom.append('License: %s' % splitlicense)
+        spec_preamble_bottom.append('Group: %s' % splitsection)
+
+        if srccustomtagschunk != splitcustomtagschunk:
+            spec_preamble_bottom.append(splitcustomtagschunk)
+
+        # Replaces == Obsoletes && Provides
+        robsoletes = bb.utils.explode_dep_versions2(splitrobsoletes or "")
+        rprovides = bb.utils.explode_dep_versions2(splitrprovides or "")
+        rreplaces = bb.utils.explode_dep_versions2(splitrreplaces or "")
+        for dep in rreplaces:
+            if not dep in robsoletes:
+                robsoletes[dep] = rreplaces[dep]
+            if not dep in rprovides:
+                rprovides[dep] = rreplaces[dep]
+        splitrobsoletes = bb.utils.join_deps(robsoletes, commasep=False)
+        splitrprovides = bb.utils.join_deps(rprovides, commasep=False)
+
+        print_deps(splitrdepends, "Requires", spec_preamble_bottom, d)
+        if splitrpreinst:
+            print_deps(splitrdepends, "Requires(pre)", spec_preamble_bottom, d)
+        if splitrpostinst:
+            print_deps(splitrdepends, "Requires(post)", spec_preamble_bottom, d)
+        if splitrprerm:
+            print_deps(splitrdepends, "Requires(preun)", spec_preamble_bottom, d)
+        if splitrpostrm:
+            print_deps(splitrdepends, "Requires(postun)", spec_preamble_bottom, d)
+
+        # Suggests in RPM are like recommends in OE-core!
+        print_deps(splitrrecommends, "Suggests", spec_preamble_bottom, d)
+        # While there is no analog for suggests... (So call them recommends for now)
+        print_deps(splitrsuggests,  "Recommends", spec_preamble_bottom, d)
+        print_deps(splitrprovides,  "Provides", spec_preamble_bottom, d)
+        print_deps(splitrobsoletes, "Obsoletes", spec_preamble_bottom, d)
+
+        # conflicts can not be in a provide!  We will need to filter it.
+        if splitrconflicts:
+            depends_dict = bb.utils.explode_dep_versions2(splitrconflicts)
+            newdeps_dict = {}
+            for dep in depends_dict:
+                if dep not in splitrprovides:
+                    newdeps_dict[dep] = depends_dict[dep]
+            if newdeps_dict:
+                splitrconflicts = bb.utils.join_deps(newdeps_dict)
+            else:
+                splitrconflicts = ""
+
+        print_deps(splitrconflicts,  "Conflicts", spec_preamble_bottom, d)
+
+        spec_preamble_bottom.append('')
+
+        spec_preamble_bottom.append('%%description -n %s' % splitname)
+        append_description(spec_preamble_bottom, splitdescription)
+
+        spec_preamble_bottom.append('')
+
+        # Now process scriptlets
+        if splitrpreinst:
+            spec_scriptlets_bottom.append('%%pre -n %s' % splitname)
+            spec_scriptlets_bottom.append('# %s - preinst' % splitname)
+            spec_scriptlets_bottom.append(splitrpreinst)
+            spec_scriptlets_bottom.append('')
+        if splitrpostinst:
+            spec_scriptlets_bottom.append('%%post -n %s' % splitname)
+            spec_scriptlets_bottom.append('# %s - postinst' % splitname)
+            spec_scriptlets_bottom.append(splitrpostinst)
+            spec_scriptlets_bottom.append('')
+        if splitrprerm:
+            spec_scriptlets_bottom.append('%%preun -n %s' % splitname)
+            spec_scriptlets_bottom.append('# %s - prerm' % splitname)
+            scriptvar = wrap_uninstall(splitrprerm)
+            spec_scriptlets_bottom.append(scriptvar)
+            spec_scriptlets_bottom.append('')
+        if splitrpostrm:
+            spec_scriptlets_bottom.append('%%postun -n %s' % splitname)
+            spec_scriptlets_bottom.append('# %s - postrm' % splitname)
+            scriptvar = wrap_uninstall(splitrpostrm)
+            spec_scriptlets_bottom.append(scriptvar)
+            spec_scriptlets_bottom.append('')
+
+        # Now process files
+        file_list = []
+        walk_files(root, file_list, conffiles, dirfiles)
+        if not file_list and localdata.getVar('ALLOW_EMPTY', False) != "1":
+            bb.note("Not creating empty RPM package for %s" % splitname)
+        else:
+            spec_files_bottom.append('%%files -n %s' % splitname)
+            if extra_pkgdata:
+                package_rpm_extra_pkgdata(splitname, spec_files_bottom, localdata)
+            spec_files_bottom.append('%defattr(-,-,-,-)')
+            if file_list:
+                bb.note("Creating RPM package for %s" % splitname)
+                spec_files_bottom.extend(file_list)
+            else:
+                bb.note("Creating EMPTY RPM Package for %s" % splitname)
+            spec_files_bottom.append('')
+
+        del localdata
+    
+    add_prep(d,spec_files_bottom)
+    spec_preamble_top.append('Summary: %s' % srcsummary)
+    spec_preamble_top.append('Name: %s' % srcname)
+    spec_preamble_top.append('Version: %s' % srcversion)
+    spec_preamble_top.append('Release: %s' % srcrelease)
+    if srcepoch and srcepoch.strip() != "":
+        spec_preamble_top.append('Epoch: %s' % srcepoch)
+    spec_preamble_top.append('License: %s' % srclicense)
+    spec_preamble_top.append('Group: %s' % srcsection)
+    spec_preamble_top.append('Packager: %s' % srcmaintainer)
+    if srchomepage:
+        spec_preamble_top.append('URL: %s' % srchomepage)
+    if srccustomtagschunk:
+        spec_preamble_top.append(srccustomtagschunk)
+    tail_source(d)
+
+    # Replaces == Obsoletes && Provides
+    robsoletes = bb.utils.explode_dep_versions2(srcrobsoletes or "")
+    rprovides = bb.utils.explode_dep_versions2(srcrprovides or "")
+    rreplaces = bb.utils.explode_dep_versions2(srcrreplaces or "")
+    for dep in rreplaces:
+        if not dep in robsoletes:
+            robsoletes[dep] = rreplaces[dep]
+        if not dep in rprovides:
+            rprovides[dep] = rreplaces[dep]
+    srcrobsoletes = bb.utils.join_deps(robsoletes, commasep=False)
+    srcrprovides = bb.utils.join_deps(rprovides, commasep=False)
+
+    print_deps(srcdepends, "BuildRequires", spec_preamble_top, d)
+    print_deps(srcrdepends, "Requires", spec_preamble_top, d)
+    if srcrpreinst:
+        print_deps(srcrdepends, "Requires(pre)", spec_preamble_top, d)
+    if srcrpostinst:
+        print_deps(srcrdepends, "Requires(post)", spec_preamble_top, d)
+    if srcrprerm:
+        print_deps(srcrdepends, "Requires(preun)", spec_preamble_top, d)
+    if srcrpostrm:
+        print_deps(srcrdepends, "Requires(postun)", spec_preamble_top, d)
+
+    # Suggests in RPM are like recommends in OE-core!
+    print_deps(srcrrecommends, "Suggests", spec_preamble_top, d)
+    # While there is no analog for suggests... (So call them recommends for now)
+    print_deps(srcrsuggests, "Recommends", spec_preamble_top, d)
+    print_deps(srcrprovides, "Provides", spec_preamble_top, d)
+    print_deps(srcrobsoletes, "Obsoletes", spec_preamble_top, d)
+    
+    # conflicts can not be in a provide!  We will need to filter it.
+    if srcrconflicts:
+        depends_dict = bb.utils.explode_dep_versions2(srcrconflicts)
+        newdeps_dict = {}
+        for dep in depends_dict:
+            if dep not in srcrprovides:
+                newdeps_dict[dep] = depends_dict[dep]
+        if newdeps_dict:
+            srcrconflicts = bb.utils.join_deps(newdeps_dict)
+        else:
+            srcrconflicts = ""
+
+    print_deps(srcrconflicts, "Conflicts", spec_preamble_top, d)
+
+    spec_preamble_top.append('')
+
+    spec_preamble_top.append('%description')
+    append_description(spec_preamble_top, srcdescription)
+
+    spec_preamble_top.append('')
+
+    if srcrpreinst:
+        spec_scriptlets_top.append('%pre')
+        spec_scriptlets_top.append('# %s - preinst' % srcname)
+        spec_scriptlets_top.append(srcrpreinst)
+        spec_scriptlets_top.append('')
+    if srcrpostinst:
+        spec_scriptlets_top.append('%post')
+        spec_scriptlets_top.append('# %s - postinst' % srcname)
+        spec_scriptlets_top.append(srcrpostinst)
+        spec_scriptlets_top.append('')
+    if srcrprerm:
+        spec_scriptlets_top.append('%preun')
+        spec_scriptlets_top.append('# %s - prerm' % srcname)
+        scriptvar = wrap_uninstall(srcrprerm)
+        spec_scriptlets_top.append(scriptvar)
+        spec_scriptlets_top.append('')
+    if srcrpostrm:
+        spec_scriptlets_top.append('%postun')
+        spec_scriptlets_top.append('# %s - postrm' % srcname)
+        scriptvar = wrap_uninstall(srcrpostrm)
+        spec_scriptlets_top.append(scriptvar)
+        spec_scriptlets_top.append('')
+
+    # Write the SPEC file
+    try:
+        specfile = open(outspecfile, 'w')
+    except OSError:
+        raise bb.build.FuncFailed("unable to open spec file for writing.")
+
+    # RPMSPEC_PREAMBLE is a way to add arbitrary text to the top
+    # of the generated spec file
+    external_preamble = d.getVar("RPMSPEC_PREAMBLE", True)
+    if external_preamble:
+        specfile.write(external_preamble + "\n")
+
+    for line in spec_preamble_top:
+        specfile.write(line + "\n")
+
+    for line in spec_preamble_bottom:
+        specfile.write(line + "\n")
+
+    for line in spec_scriptlets_top:
+        specfile.write(line + "\n")
+
+    for line in spec_scriptlets_bottom:
+        specfile.write(line + "\n")
+
+    for line in spec_files_top:
+        specfile.write(line + "\n")
+
+    for line in spec_files_bottom:
+        specfile.write(line + "\n")
+
+    specfile.close()
+}
+# Otherwise allarch packages may change depending on override configuration
+write_specfile[vardepsexclude] = "OVERRIDES"
+
+python do_package_rpm () {
+    # We need a simple way to remove the MLPREFIX from the package name,
+    # and dependency information...
+    def strip_multilib(name, d):
+        ml = d.getVar("MLPREFIX", True)
+        if ml and name and len(ml) != 0 and name.find(ml) >= 0:
+            return "".join(name.split(ml))
+        return name
+
+    workdir = d.getVar('WORKDIR', True)
+    tmpdir = d.getVar('TMPDIR', True)
+    pkgd = d.getVar('PKGD', True)
+    pkgdest = d.getVar('PKGDEST', True)
+    if not workdir or not pkgd or not tmpdir:
+        bb.error("Variables incorrectly set, unable to package")
+        return
+
+    packages = d.getVar('PACKAGES', True)
+    if not packages or packages == '':
+        bb.debug(1, "No packages; nothing to do")
+        return
+
+    # Construct the spec file...
+    # If the spec file already exist, and has not been stored into 
+    # pseudo's files.db, it maybe cause rpmbuild src.rpm fail,
+    # so remove it before doing rpmbuild src.rpm.
+    srcname    = strip_multilib(d.getVar('PN', True), d)
+    outspecfile = workdir + "/" + srcname + ".spec"
+    if os.path.isfile(outspecfile):
+        os.remove(outspecfile)
+    d.setVar('OUTSPECFILE', outspecfile)
+    bb.build.exec_func('write_specfile', d)
+
+    perfiledeps = (d.getVar("MERGEPERFILEDEPS", True) or "0") == "0"
+    if perfiledeps:
+        outdepends, outprovides = write_rpm_perfiledata(srcname, d)
+
+    # Setup the rpmbuild arguments...
+    rpmbuild = d.getVar('RPMBUILD', True)
+    targetsys = d.getVar('TARGET_SYS', True)
+    targetvendor = d.getVar('HOST_VENDOR', True)
+    package_arch = (d.getVar('PACKAGE_ARCH', True) or "").replace("-", "_")
+    sdkpkgsuffix = (d.getVar('SDKPKGSUFFIX', True) or "nativesdk").replace("-", "_")
+    if package_arch not in "all any noarch".split() and not package_arch.endswith(sdkpkgsuffix):
+        ml_prefix = (d.getVar('MLPREFIX', True) or "").replace("-", "_")
+        d.setVar('PACKAGE_ARCH_EXTEND', ml_prefix + package_arch)
+    else:
+        d.setVar('PACKAGE_ARCH_EXTEND', package_arch)
+    pkgwritedir = d.expand('${PKGWRITEDIRRPM}/${PACKAGE_ARCH_EXTEND}')
+    d.setVar('RPM_PKGWRITEDIR', pkgwritedir)
+    bb.debug(1, 'PKGWRITEDIR: %s' % d.getVar('RPM_PKGWRITEDIR', True))
+    pkgarch = d.expand('${PACKAGE_ARCH_EXTEND}${HOST_VENDOR}-${HOST_OS}')
+    magicfile = d.expand('${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc')
+    bb.utils.mkdirhier(pkgwritedir)
+    os.chmod(pkgwritedir, 0755)
+
+    cmd = rpmbuild
+    cmd = cmd + " --nodeps --short-circuit --target " + pkgarch + " --buildroot " + pkgd
+    cmd = cmd + " --define '_topdir " + workdir + "' --define '_rpmdir " + pkgwritedir + "'"
+    cmd = cmd + " --define '_builddir " + d.getVar('S', True) + "'"
+    cmd = cmd + " --define '_build_name_fmt %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm'"
+    cmd = cmd + " --define '_use_internal_dependency_generator 0'"
+    if perfiledeps:
+        cmd = cmd + " --define '__find_requires " + outdepends + "'"
+        cmd = cmd + " --define '__find_provides " + outprovides + "'"
+    else:
+        cmd = cmd + " --define '__find_requires %{nil}'"
+        cmd = cmd + " --define '__find_provides %{nil}'"
+    cmd = cmd + " --define '_unpackaged_files_terminate_build 0'"
+    cmd = cmd + " --define 'debug_package %{nil}'"
+    cmd = cmd + " --define '_rpmfc_magic_path " + magicfile + "'"
+    cmd = cmd + " --define '_tmppath " + workdir + "'"
+    if d.getVarFlag('ARCHIVER_MODE', 'srpm', True) == '1' and bb.data.inherits_class('archiver', d):
+        cmd = cmd + " --define '_sourcedir " + d.getVar('ARCHIVER_OUTDIR', True) + "'"
+        cmdsrpm = cmd + " --define '_srcrpmdir " + d.getVar('ARCHIVER_OUTDIR', True) + "'"
+        cmdsrpm = cmdsrpm + " -bs " + outspecfile
+        # Build the .src.rpm
+        d.setVar('SBUILDSPEC', cmdsrpm + "\n")
+        d.setVarFlag('SBUILDSPEC', 'func', '1')
+        bb.build.exec_func('SBUILDSPEC', d)
+    cmd = cmd + " -bb " + outspecfile
+
+    # Build the rpm package!
+    d.setVar('BUILDSPEC', cmd + "\n")
+    d.setVarFlag('BUILDSPEC', 'func', '1')
+    bb.build.exec_func('BUILDSPEC', d)
+
+    if d.getVar('RPM_SIGN_PACKAGES', True) == '1':
+        bb.build.exec_func("sign_rpm", d)
+}
+
+python () {
+    if d.getVar('PACKAGES', True) != '':
+        deps = ' rpm-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot'
+        d.appendVarFlag('do_package_write_rpm', 'depends', deps)
+        d.setVarFlag('do_package_write_rpm', 'fakeroot', 1)
+}
+
+SSTATETASKS += "do_package_write_rpm"
+do_package_write_rpm[sstate-inputdirs] = "${PKGWRITEDIRRPM}"
+do_package_write_rpm[sstate-outputdirs] = "${DEPLOY_DIR_RPM}"
+# Take a shared lock, we can write multiple packages at the same time...
+# but we need to stop the rootfs/solver from running while we do...
+do_package_write_rpm[sstate-lockfile-shared] += "${DEPLOY_DIR_RPM}/rpm.lock"
+
+python do_package_write_rpm_setscene () {
+    sstate_setscene(d)
+}
+addtask do_package_write_rpm_setscene
+
+python do_package_write_rpm () {
+    bb.build.exec_func("read_subpackage_metadata", d)
+    bb.build.exec_func("do_package_rpm", d)
+}
+
+do_package_write_rpm[dirs] = "${PKGWRITEDIRRPM}"
+do_package_write_rpm[cleandirs] = "${PKGWRITEDIRRPM}"
+do_package_write_rpm[umask] = "022"
+addtask package_write_rpm after do_packagedata do_package
+
+PACKAGEINDEXDEPS += "rpm-native:do_populate_sysroot"
+PACKAGEINDEXDEPS += "createrepo-native:do_populate_sysroot"
+
+do_build[recrdeptask] += "do_package_write_rpm"
diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass
new file mode 100644
index 0000000..f9e2292
--- /dev/null
+++ b/meta/classes/package_tar.bbclass
@@ -0,0 +1,69 @@
+inherit package
+
+IMAGE_PKGTYPE ?= "tar"
+
+python do_package_tar () {
+    import subprocess
+    workdir = d.getVar('WORKDIR', True)
+    if not workdir:
+        bb.error("WORKDIR not defined, unable to package")
+        return
+
+    outdir = d.getVar('DEPLOY_DIR_TAR', True)
+    if not outdir:
+        bb.error("DEPLOY_DIR_TAR not defined, unable to package")
+        return
+
+    dvar = d.getVar('D', True)
+    if not dvar:
+        bb.error("D not defined, unable to package")
+        return
+
+    packages = d.getVar('PACKAGES', True)
+    if not packages:
+        bb.debug(1, "PACKAGES not defined, nothing to package")
+        return
+
+    pkgdest = d.getVar('PKGDEST', True)
+
+    bb.utils.mkdirhier(outdir)
+    bb.utils.mkdirhier(dvar)
+
+    for pkg in packages.split():
+        localdata = bb.data.createCopy(d)
+        root = "%s/%s" % (pkgdest, pkg)
+
+        overrides = localdata.getVar('OVERRIDES', False)
+        localdata.setVar('OVERRIDES', '%s:%s' % (overrides, pkg))
+        bb.data.update_data(localdata)
+
+        bb.utils.mkdirhier(root)
+        basedir = os.path.dirname(root)
+        tarfn = localdata.expand("${DEPLOY_DIR_TAR}/${PKG}-${PKGV}-${PKGR}.tar.gz")
+        os.chdir(root)
+        dlist = os.listdir(root)
+        if not dlist:
+            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, localdata.getVar('PKGV', True), localdata.getVar('PKGR', True)))
+            continue
+        args = "tar -cz --exclude=CONTROL --exclude=DEBIAN -f".split()
+        ret = subprocess.call(args + [tarfn] + dlist)
+        if ret != 0:
+            bb.error("Creation of tar %s failed." % tarfn)
+}
+
+python () {
+    if d.getVar('PACKAGES', True) != '':
+        deps = (d.getVarFlag('do_package_write_tar', 'depends') or "").split()
+        deps.append('tar-native:do_populate_sysroot')
+        deps.append('virtual/fakeroot-native:do_populate_sysroot')
+        d.setVarFlag('do_package_write_tar', 'depends', " ".join(deps))
+        d.setVarFlag('do_package_write_tar', 'fakeroot', "1")
+}
+
+
+python do_package_write_tar () {
+    bb.build.exec_func("read_subpackage_metadata", d)
+    bb.build.exec_func("do_package_tar", d)
+}
+do_package_write_tar[dirs] = "${D}"
+addtask package_write_tar before do_build after do_packagedata do_package
diff --git a/meta/classes/packagedata.bbclass b/meta/classes/packagedata.bbclass
new file mode 100644
index 0000000..3397f1e
--- /dev/null
+++ b/meta/classes/packagedata.bbclass
@@ -0,0 +1,34 @@
+python read_subpackage_metadata () {
+    import oe.packagedata
+
+    vars = {
+        "PN" : d.getVar('PN', True), 
+        "PE" : d.getVar('PE', True), 
+        "PV" : d.getVar('PV', True),
+        "PR" : d.getVar('PR', True),
+    }
+
+    data = oe.packagedata.read_pkgdata(vars["PN"], d)
+
+    for key in data.keys():
+        d.setVar(key, data[key])
+
+    for pkg in d.getVar('PACKAGES', True).split():
+        sdata = oe.packagedata.read_subpkgdata(pkg, d)
+        for key in sdata.keys():
+            if key in vars:
+                if sdata[key] != vars[key]:
+                    if key == "PN":
+                        bb.fatal("Recipe %s is trying to create package %s which was already written by recipe %s. This will cause corruption, please resolve this and only provide the package from one recipe or the other or only build one of the recipes." % (vars[key], pkg, sdata[key]))
+                    bb.fatal("Recipe %s is trying to change %s from '%s' to '%s'. This will cause do_package_write_* failures since the incorrect data will be used and they will be unable to find the right workdir." % (vars["PN"], key, vars[key], sdata[key]))
+                continue
+            #
+            # If we set unsuffixed variables here there is a chance they could clobber override versions
+            # of that variable, e.g. DESCRIPTION could clobber DESCRIPTION_<pkgname>
+            # We therefore don't clobber for the unsuffixed variable versions
+            #
+            if key.endswith("_" + pkg):
+                d.setVar(key, sdata[key])
+            else:
+                d.setVar(key, sdata[key], parsing=True)
+}
diff --git a/meta/classes/packagegroup.bbclass b/meta/classes/packagegroup.bbclass
new file mode 100644
index 0000000..56cfead
--- /dev/null
+++ b/meta/classes/packagegroup.bbclass
@@ -0,0 +1,52 @@
+# Class for packagegroup (package group) recipes
+
+# By default, only the packagegroup package itself is in PACKAGES.
+# -dbg and -dev flavours are handled by the anonfunc below.
+# This means that packagegroup recipes used to build multiple packagegroup
+# packages have to modify PACKAGES after inheriting packagegroup.bbclass.
+PACKAGES = "${PN}"
+
+# By default, packagegroup packages do not depend on a certain architecture.
+# Only if dependencies are modified by MACHINE_FEATURES, packages
+# need to be set to MACHINE_ARCH after inheriting packagegroup.bbclass
+PACKAGE_ARCH ?= "all"
+
+# Fully expanded - so it applies the overrides as well
+PACKAGE_ARCH_EXPANDED := "${PACKAGE_ARCH}"
+
+inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED', True) == 'all', 'allarch', '')}
+
+# This automatically adds -dbg and -dev flavours of all PACKAGES
+# to the list. Their dependencies (RRECOMMENDS) are handled as usual
+# by package_depchains in a following step.
+# Also mark all packages as ALLOW_EMPTY
+python () {
+    packages = d.getVar('PACKAGES', True).split()
+    genpackages = []
+    for pkg in packages:
+        d.setVar("ALLOW_EMPTY_%s" % pkg, "1")
+        for postfix in ['-dbg', '-dev', '-ptest']:
+            genpackages.append(pkg+postfix)
+    if d.getVar('PACKAGEGROUP_DISABLE_COMPLEMENTARY', True) != '1':
+        d.setVar('PACKAGES', ' '.join(packages+genpackages))
+}
+
+# We don't want to look at shared library dependencies for the
+# dbg packages
+DEPCHAIN_DBGDEFAULTDEPS = "1"
+
+# We only need the packaging tasks - disable the rest
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_install[noexec] = "1"
+do_populate_sysroot[noexec] = "1"
+
+python () {
+    initman = d.getVar("VIRTUAL-RUNTIME_init_manager", True)
+    if initman and initman in ['sysvinit', 'systemd'] and not bb.utils.contains('DISTRO_FEATURES', initman, True, False, d):
+        bb.fatal("Please ensure that your setting of VIRTUAL-RUNTIME_init_manager (%s) matches the entries enabled in DISTRO_FEATURES" % initman)
+}
+
diff --git a/meta/classes/packageinfo.bbclass b/meta/classes/packageinfo.bbclass
new file mode 100644
index 0000000..7d60ace
--- /dev/null
+++ b/meta/classes/packageinfo.bbclass
@@ -0,0 +1,22 @@
+python packageinfo_handler () {
+    import oe.packagedata
+    pkginfolist = []
+
+    pkgdata_dir = e.data.getVar("PKGDATA_DIR", True) + '/runtime/'
+    if os.path.exists(pkgdata_dir):
+        for root, dirs, files in os.walk(pkgdata_dir):
+            for pkgname in files:
+                if pkgname.endswith('.packaged'):
+                    pkgname = pkgname[:-9]
+                    pkgdatafile = root + pkgname
+                    try:
+                        sdata = oe.packagedata.read_pkgdatafile(pkgdatafile)
+                        sdata['PKG'] = pkgname
+                        pkginfolist.append(sdata)
+                    except Exception as e:
+                        bb.warn("Failed to read pkgdata file %s: %s: %s" % (pkgdatafile, e.__class__, str(e)))
+    bb.event.fire(bb.event.PackageInfo(pkginfolist), e.data)
+}
+
+addhandler packageinfo_handler
+packageinfo_handler[eventmask] = "bb.event.RequestPackageInfo"
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
new file mode 100644
index 0000000..1e2aab0
--- /dev/null
+++ b/meta/classes/patch.bbclass
@@ -0,0 +1,188 @@
+# Copyright (C) 2006  OpenedHand LTD
+
+# Point to an empty file so any user's custom settings don't break things
+QUILTRCFILE ?= "${STAGING_ETCDIR_NATIVE}/quiltrc"
+
+PATCHDEPENDENCY = "${PATCHTOOL}-native:do_populate_sysroot"
+
+inherit terminal
+
+def src_patches(d, all = False ):
+    workdir = d.getVar('WORKDIR', True)
+    fetch = bb.fetch2.Fetch([], d)
+    patches = []
+    sources = []
+    for url in fetch.urls:
+        local = patch_path(url, fetch, workdir)
+        if not local:
+            if all:
+                local = fetch.localpath(url)
+                sources.append(local)
+            continue
+
+        urldata = fetch.ud[url]
+        parm = urldata.parm
+        patchname = parm.get('pname') or os.path.basename(local)
+
+        apply, reason = should_apply(parm, d)
+        if not apply:
+            if reason:
+                bb.note("Patch %s %s" % (patchname, reason))
+            continue
+
+        patchparm = {'patchname': patchname}
+        if "striplevel" in parm:
+            striplevel = parm["striplevel"]
+        elif "pnum" in parm:
+            #bb.msg.warn(None, "Deprecated usage of 'pnum' url parameter in '%s', please use 'striplevel'" % url)
+            striplevel = parm["pnum"]
+        else:
+            striplevel = '1'
+        patchparm['striplevel'] = striplevel
+
+        patchdir = parm.get('patchdir')
+        if patchdir:
+            patchparm['patchdir'] = patchdir
+
+        localurl = bb.fetch.encodeurl(('file', '', local, '', '', patchparm))
+        patches.append(localurl)
+
+    if all:
+        return sources
+
+    return patches
+
+def patch_path(url, fetch, workdir):
+    """Return the local path of a patch, or None if this isn't a patch"""
+
+    local = fetch.localpath(url)
+    base, ext = os.path.splitext(os.path.basename(local))
+    if ext in ('.gz', '.bz2', '.Z'):
+        local = os.path.join(workdir, base)
+        ext = os.path.splitext(base)[1]
+
+    urldata = fetch.ud[url]
+    if "apply" in urldata.parm:
+        apply = oe.types.boolean(urldata.parm["apply"])
+        if not apply:
+            return
+    elif ext not in (".diff", ".patch"):
+        return
+
+    return local
+
+def should_apply(parm, d):
+    """Determine if we should apply the given patch"""
+
+    if "mindate" in parm or "maxdate" in parm:
+        pn = d.getVar('PN', True)
+        srcdate = d.getVar('SRCDATE_%s' % pn, True)
+        if not srcdate:
+            srcdate = d.getVar('SRCDATE', True)
+
+        if srcdate == "now":
+            srcdate = d.getVar('DATE', True)
+
+        if "maxdate" in parm and parm["maxdate"] < srcdate:
+            return False, 'is outdated'
+
+        if "mindate" in parm and parm["mindate"] > srcdate:
+            return False, 'is predated'
+
+
+    if "minrev" in parm:
+        srcrev = d.getVar('SRCREV', True)
+        if srcrev and srcrev < parm["minrev"]:
+            return False, 'applies to later revisions'
+
+    if "maxrev" in parm:
+        srcrev = d.getVar('SRCREV', True)
+        if srcrev and srcrev > parm["maxrev"]:
+            return False, 'applies to earlier revisions'
+
+    if "rev" in parm:
+        srcrev = d.getVar('SRCREV', True)
+        if srcrev and parm["rev"] not in srcrev:
+            return False, "doesn't apply to revision"
+
+    if "notrev" in parm:
+        srcrev = d.getVar('SRCREV', True)
+        if srcrev and parm["notrev"] in srcrev:
+            return False, "doesn't apply to revision"
+
+    return True, None
+
+should_apply[vardepsexclude] = "DATE SRCDATE"
+
+python patch_do_patch() {
+    import oe.patch
+
+    patchsetmap = {
+        "patch": oe.patch.PatchTree,
+        "quilt": oe.patch.QuiltTree,
+        "git": oe.patch.GitApplyTree,
+    }
+
+    cls = patchsetmap[d.getVar('PATCHTOOL', True) or 'quilt']
+
+    resolvermap = {
+        "noop": oe.patch.NOOPResolver,
+        "user": oe.patch.UserResolver,
+    }
+
+    rcls = resolvermap[d.getVar('PATCHRESOLVE', True) or 'user']
+
+    classes = {}
+
+    s = d.getVar('S', True)
+
+    path = os.getenv('PATH')
+    os.putenv('PATH', d.getVar('PATH', True))
+
+    # We must use one TMPDIR per process so that the "patch" processes
+    # don't generate the same temp file name.
+
+    import tempfile
+    process_tmpdir = tempfile.mkdtemp()
+    os.environ['TMPDIR'] = process_tmpdir
+
+    for patch in src_patches(d):
+        _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
+
+        if "patchdir" in parm:
+            patchdir = parm["patchdir"]
+            if not os.path.isabs(patchdir):
+                patchdir = os.path.join(s, patchdir)
+        else:
+            patchdir = s
+
+        if not patchdir in classes:
+            patchset = cls(patchdir, d)
+            resolver = rcls(patchset, oe_terminal)
+            classes[patchdir] = (patchset, resolver)
+            patchset.Clean()
+        else:
+            patchset, resolver = classes[patchdir]
+
+        bb.note("Applying patch '%s' (%s)" % (parm['patchname'], oe.path.format_display(local, d)))
+        try:
+            patchset.Import({"file":local, "strippath": parm['striplevel']}, True)
+        except Exception as exc:
+            bb.utils.remove(process_tmpdir, True)
+            bb.fatal(str(exc))
+        try:
+            resolver.Resolve()
+        except bb.BBHandledException as e:
+            bb.utils.remove(process_tmpdir, True)
+            bb.fatal(str(e))
+
+    bb.utils.remove(process_tmpdir, True)
+    del os.environ['TMPDIR']
+}
+patch_do_patch[vardepsexclude] = "PATCHRESOLVE"
+
+addtask patch after do_unpack
+do_patch[dirs] = "${WORKDIR}"
+do_patch[depends] = "${PATCHDEPENDENCY}"
+
+EXPORT_FUNCTIONS do_patch
diff --git a/meta/classes/perlnative.bbclass b/meta/classes/perlnative.bbclass
new file mode 100644
index 0000000..cc8de8b
--- /dev/null
+++ b/meta/classes/perlnative.bbclass
@@ -0,0 +1,3 @@
+EXTRANATIVEPATH += "perl-native"
+DEPENDS += "perl-native"
+OECMAKE_PERLNATIVE_DIR = "${STAGING_BINDIR_NATIVE}/perl-native"
diff --git a/meta/classes/pixbufcache.bbclass b/meta/classes/pixbufcache.bbclass
new file mode 100644
index 0000000..349967d
--- /dev/null
+++ b/meta/classes/pixbufcache.bbclass
@@ -0,0 +1,67 @@
+#
+# This class will generate the proper postinst/postrm scriptlets for pixbuf
+# packages.
+#
+
+DEPENDS += "qemu-native"
+inherit qemu
+
+PIXBUF_PACKAGES ??= "${PN}"
+
+pixbufcache_common() {
+if [ "x$D" != "x" ]; then
+	$INTERCEPT_DIR/postinst_intercept update_pixbuf_cache ${PKG} mlprefix=${MLPREFIX} libdir=${libdir} \
+		bindir=${bindir} base_libdir=${base_libdir}
+else
+
+	# Update the pixbuf loaders in case they haven't been registered yet
+	GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders gdk-pixbuf-query-loaders --update-cache
+
+	if [ -x ${bindir}/gtk-update-icon-cache ] && [ -d ${datadir}/icons ]; then
+		for icondir in /usr/share/icons/*; do
+			if [ -d ${icondir} ]; then
+				gtk-update-icon-cache -t -q ${icondir}
+			fi
+		done
+	fi
+fi
+}
+
+python populate_packages_append() {
+    pixbuf_pkgs = d.getVar('PIXBUF_PACKAGES', True).split()
+
+    for pkg in pixbuf_pkgs:
+        bb.note("adding pixbuf postinst and postrm scripts to %s" % pkg)
+        postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
+        if not postinst:
+            postinst = '#!/bin/sh\n'
+        postinst += d.getVar('pixbufcache_common', True)
+        d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+        postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
+        if not postrm:
+            postrm = '#!/bin/sh\n'
+        postrm += d.getVar('pixbufcache_common', True)
+        d.setVar('pkg_postrm_%s' % pkg, postrm)
+}
+
+gdkpixbuf_complete() {
+	GDK_PIXBUF_FATAL_LOADER=1 ${STAGING_BINDIR_NATIVE}/gdk-pixbuf-query-loaders --update-cache || exit 1
+}
+
+#
+# Add an sstate postinst hook to update the cache for native packages.
+# An error exit during populate_sysroot_setscene allows bitbake to
+# try to recover by re-building the package.
+#
+SSTATEPOSTINSTFUNCS_append_class-native = " pixbufcache_sstate_postinst"
+
+# See base.bbclass for the other half of this
+pixbufcache_sstate_postinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" ]; then
+		${gdkpixbuf_complete}
+	elif [ "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]; then
+		echo "${gdkpixbuf_complete}" >> ${STAGING_DIR}/sstatecompletions
+	fi
+}
+
diff --git a/meta/classes/pkgconfig.bbclass b/meta/classes/pkgconfig.bbclass
new file mode 100644
index 0000000..ad1f84f
--- /dev/null
+++ b/meta/classes/pkgconfig.bbclass
@@ -0,0 +1,2 @@
+DEPENDS_prepend = "pkgconfig-native "
+
diff --git a/meta/classes/populate_sdk.bbclass b/meta/classes/populate_sdk.bbclass
new file mode 100644
index 0000000..f64a911
--- /dev/null
+++ b/meta/classes/populate_sdk.bbclass
@@ -0,0 +1,7 @@
+# The majority of populate_sdk is located in populate_sdk_base
+# This chunk simply facilitates compatibility with SDK only recipes.
+
+inherit populate_sdk_base
+
+addtask populate_sdk after do_install before do_build
+
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
new file mode 100644
index 0000000..aa7a9a5
--- /dev/null
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -0,0 +1,203 @@
+inherit meta
+
+# Wildcards specifying complementary packages to install for every package that has been explicitly
+# installed into the rootfs
+COMPLEMENTARY_GLOB[dev-pkgs] = '*-dev'
+COMPLEMENTARY_GLOB[staticdev-pkgs] = '*-staticdev'
+COMPLEMENTARY_GLOB[doc-pkgs] = '*-doc'
+COMPLEMENTARY_GLOB[dbg-pkgs] = '*-dbg'
+COMPLEMENTARY_GLOB[ptest-pkgs] = '*-ptest'
+
+def complementary_globs(featurevar, d):
+    all_globs = d.getVarFlags('COMPLEMENTARY_GLOB')
+    globs = []
+    features = set((d.getVar(featurevar, True) or '').split())
+    for name, glob in all_globs.items():
+        if name in features:
+            globs.append(glob)
+    return ' '.join(globs)
+
+SDKIMAGE_FEATURES ??= "dev-pkgs dbg-pkgs"
+SDKIMAGE_INSTALL_COMPLEMENTARY = '${@complementary_globs("SDKIMAGE_FEATURES", d)}'
+
+inherit rootfs_${IMAGE_PKGTYPE}
+
+SDK_DIR = "${WORKDIR}/sdk"
+SDK_OUTPUT = "${SDK_DIR}/image"
+SDK_DEPLOY = "${DEPLOY_DIR}/sdk"
+
+B_task-populate-sdk = "${SDK_DIR}"
+
+SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}"
+
+TOOLCHAIN_HOST_TASK ?= "nativesdk-packagegroup-sdk-host packagegroup-cross-canadian-${MACHINE}"
+TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
+TOOLCHAIN_TARGET_TASK ?= " \
+    ${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \
+    ${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target-dbg')} \
+    "
+TOOLCHAIN_TARGET_TASK_ATTEMPTONLY ?= ""
+TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-toolchain-${SDK_VERSION}"
+
+SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
+SDK_DEPENDS = "virtual/fakeroot-native pbzip2-native"
+
+# We want the MULTIARCH_TARGET_SYS to point to the TUNE_PKGARCH, not PACKAGE_ARCH as it
+# could be set to the MACHINE_ARCH
+REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+PID = "${@os.getpid()}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+SDK_PACKAGING_FUNC ?= "create_shar"
+SDK_PRE_INSTALL_COMMAND ?= ""
+SDK_POST_INSTALL_COMMAND ?= ""
+SDK_RELOCATE_AFTER_INSTALL ?= "1"
+
+SDKEXTPATH ?= "~/${@d.getVar('DISTRO', True)}_sdk"
+SDK_TITLE ?= "${@d.getVar('DISTRO_NAME', True) or d.getVar('DISTRO', True)} SDK"
+
+SDK_TARGET_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.target.manifest"
+SDK_HOST_MANIFEST = "${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.host.manifest"
+python write_target_sdk_manifest () {
+    from oe.sdk import sdk_list_installed_packages
+    sdkmanifestdir = os.path.dirname(d.getVar("SDK_TARGET_MANIFEST", True))
+    if not os.path.exists(sdkmanifestdir):
+        bb.utils.mkdirhier(sdkmanifestdir)
+    with open(d.getVar('SDK_TARGET_MANIFEST', True), 'w') as output:
+        output.write(sdk_list_installed_packages(d, True, 'ver'))
+}
+
+python write_host_sdk_manifest () {
+    from oe.sdk import sdk_list_installed_packages
+    sdkmanifestdir = os.path.dirname(d.getVar("SDK_HOST_MANIFEST", True))
+    if not os.path.exists(sdkmanifestdir):
+        bb.utils.mkdirhier(sdkmanifestdir)
+    with open(d.getVar('SDK_HOST_MANIFEST', True), 'w') as output:
+        output.write(sdk_list_installed_packages(d, False, 'ver'))
+}
+
+POPULATE_SDK_POST_TARGET_COMMAND_append = " write_target_sdk_manifest ; "
+POPULATE_SDK_POST_HOST_COMMAND_append = " write_host_sdk_manifest; "
+
+# Some archs override this, we need the nativesdk version
+# turns out this is hard to get from the datastore due to TRANSLATED_TARGET_ARCH
+# manipulation.
+SDK_OLDEST_KERNEL = "2.6.32"
+
+fakeroot python do_populate_sdk() {
+    from oe.sdk import populate_sdk
+    from oe.manifest import create_manifest, Manifest
+
+    pn = d.getVar('PN', True)
+    runtime_mapping_rename("TOOLCHAIN_TARGET_TASK", pn, d)
+    runtime_mapping_rename("TOOLCHAIN_TARGET_TASK_ATTEMPTONLY", pn, d)
+
+    ld = bb.data.createCopy(d)
+    ld.setVar("PKGDATA_DIR", "${STAGING_DIR}/${SDK_ARCH}-${SDKPKGSUFFIX}${SDK_VENDOR}-${SDK_OS}/pkgdata")
+    runtime_mapping_rename("TOOLCHAIN_HOST_TASK", pn, ld)
+    runtime_mapping_rename("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", pn, ld)
+    d.setVar("TOOLCHAIN_HOST_TASK", ld.getVar("TOOLCHAIN_HOST_TASK", True))
+    d.setVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", ld.getVar("TOOLCHAIN_HOST_TASK_ATTEMPTONLY", True))
+    
+    # create target/host SDK manifests
+    create_manifest(d, manifest_dir=d.getVar('SDK_DIR', True),
+                    manifest_type=Manifest.MANIFEST_TYPE_SDK_HOST)
+    create_manifest(d, manifest_dir=d.getVar('SDK_DIR', True),
+                    manifest_type=Manifest.MANIFEST_TYPE_SDK_TARGET)
+
+    populate_sdk(d)
+
+    # Process DEFAULTTUNE
+    bb.build.exec_func("create_sdk_files", d)
+
+    bb.build.exec_func("tar_sdk", d)
+
+    sdk_packaging_func = d.getVar("SDK_PACKAGING_FUNC", True) or ""
+    if sdk_packaging_func.strip():
+        bb.build.exec_func(d.getVar("SDK_PACKAGING_FUNC", True), d)
+}
+
+fakeroot create_sdk_files() {
+	cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
+
+	# Replace the ##DEFAULT_INSTALL_DIR## with the correct pattern.
+	# Escape special characters like '+' and '.' in the SDKPATH
+	escaped_sdkpath=$(echo ${SDKPATH} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
+	sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
+}
+
+SDKTAROPTS = "--owner=root --group=root"
+
+fakeroot tar_sdk() {
+	# Package it up
+	mkdir -p ${SDK_DEPLOY}
+	cd ${SDK_OUTPUT}/${SDKPATH}
+	tar ${SDKTAROPTS} -cf - . | pbzip2 > ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2
+}
+
+fakeroot create_shar() {
+	# copy in the template shar extractor script
+	cp ${COREBASE}/meta/files/toolchain-shar-extract.sh ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+	rm -f ${T}/pre_install_command ${T}/post_install_command
+
+	if [ ${SDK_RELOCATE_AFTER_INSTALL} -eq 1 ] ; then
+		cp ${COREBASE}/meta/files/toolchain-shar-relocate.sh ${T}/post_install_command
+	fi
+	cat << "EOF" >> ${T}/pre_install_command
+${SDK_PRE_INSTALL_COMMAND}
+EOF
+
+	cat << "EOF" >> ${T}/post_install_command
+${SDK_POST_INSTALL_COMMAND}
+EOF
+	sed -i -e '/@SDK_PRE_INSTALL_COMMAND@/r ${T}/pre_install_command' \
+		-e '/@SDK_POST_INSTALL_COMMAND@/r ${T}/post_install_command' \
+		${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+	# substitute variables
+	sed -i -e 's#@SDK_ARCH@#${SDK_ARCH}#g' \
+		-e 's#@SDKPATH@#${SDKPATH}#g' \
+		-e 's#@SDKEXTPATH@#${SDKEXTPATH}#g' \
+		-e 's#@OLDEST_KERNEL@#${SDK_OLDEST_KERNEL}#g' \
+		-e 's#@REAL_MULTIMACH_TARGET_SYS@#${REAL_MULTIMACH_TARGET_SYS}#g' \
+		-e 's#@SDK_TITLE@#${SDK_TITLE}#g' \
+		-e 's#@SDK_VERSION@#${SDK_VERSION}#g' \
+		-e '/@SDK_PRE_INSTALL_COMMAND@/d' \
+		-e '/@SDK_POST_INSTALL_COMMAND@/d' \
+		${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+	# add execution permission
+	chmod +x ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+	# append the SDK tarball
+	cat ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 >> ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh
+
+	# delete the old tarball, we don't need it anymore
+	rm ${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2
+}
+
+populate_sdk_log_check() {
+	for target in $*
+	do
+		lf_path="`dirname ${BB_LOGFILE}`/log.do_$target.${PID}"
+
+		echo "log_check: Using $lf_path as logfile"
+
+		if test -e "$lf_path"
+		then
+			${IMAGE_PKGTYPE}_log_check $target $lf_path
+		else
+			echo "Cannot find logfile [$lf_path]"
+		fi
+		echo "Logfile is clean"
+	done
+}
+
+do_populate_sdk[dirs] = "${TOPDIR}"
+do_populate_sdk[depends] += "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_DEPENDS', True).split()])}  ${@d.getVarFlag('do_rootfs', 'depends', False)}"
+do_populate_sdk[rdepends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_RDEPENDS', True).split()])}"
+do_populate_sdk[recrdeptask] += "do_packagedata do_package_write_rpm do_package_write_ipk do_package_write_deb"
+addtask populate_sdk
diff --git a/meta/classes/populate_sdk_ext.bbclass b/meta/classes/populate_sdk_ext.bbclass
new file mode 100644
index 0000000..4ef8838
--- /dev/null
+++ b/meta/classes/populate_sdk_ext.bbclass
@@ -0,0 +1,275 @@
+# Extensible SDK
+
+inherit populate_sdk_base
+
+# NOTE: normally you cannot use task overrides for this kind of thing - this
+# only works because of get_sdk_ext_rdepends()
+
+TOOLCHAIN_HOST_TASK_task-populate-sdk-ext = " \
+    meta-environment-extsdk-${MACHINE} \
+    "
+
+TOOLCHAIN_TARGET_TASK_task-populate-sdk-ext = ""
+
+SDK_RDEPENDS_append_task-populate-sdk-ext = " ${SDK_TARGETS}"
+
+SDK_RELOCATE_AFTER_INSTALL_task-populate-sdk-ext = "0"
+
+SDK_LOCAL_CONF_WHITELIST ?= ""
+SDK_LOCAL_CONF_BLACKLIST ?= "CONF_VERSION BB_NUMBER_THREADS PARALLEL_MAKE PRSERV_HOST"
+SDK_INHERIT_BLACKLIST ?= "buildhistory icecc"
+SDK_UPDATE_URL ?= ""
+
+SDK_TARGETS ?= "${PN}"
+OE_INIT_ENV_SCRIPT ?= "oe-init-build-env"
+
+# The files from COREBASE that you want preserved in the COREBASE copied
+# into the sdk. This allows someone to have their own setup scripts in
+# COREBASE be preserved as well as untracked files.
+COREBASE_FILES ?= " \
+    oe-init-build-env \
+    oe-init-build-env-memres \
+    scripts \
+    LICENSE \
+    .templateconf \
+"
+
+SDK_DIR_task-populate-sdk-ext = "${WORKDIR}/sdk-ext"
+B_task-populate-sdk-ext = "${SDK_DIR}"
+TOOLCHAIN_OUTPUTNAME_task-populate-sdk-ext = "${SDK_NAME}-toolchain-ext-${SDK_VERSION}"
+
+SDK_TITLE_task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME', True) or d.getVar('DISTRO', True)} Extensible SDK"
+
+python copy_buildsystem () {
+    import re
+    import oe.copy_buildsystem
+
+    oe_init_env_script = d.getVar('OE_INIT_ENV_SCRIPT', True)
+
+    conf_bbpath = ''
+    conf_initpath = ''
+    core_meta_subdir = ''
+
+    # Copy in all metadata layers + bitbake (as repositories)
+    buildsystem = oe.copy_buildsystem.BuildSystem(d)
+    baseoutpath = d.getVar('SDK_OUTPUT', True) + '/' + d.getVar('SDKPATH', True)
+    layers_copied = buildsystem.copy_bitbake_and_layers(baseoutpath + '/layers')
+
+    sdkbblayers = []
+    corebase = os.path.basename(d.getVar('COREBASE', True))
+    for layer in layers_copied:
+        if corebase == os.path.basename(layer):
+            conf_bbpath = os.path.join('layers', layer, 'bitbake')
+        else:
+            sdkbblayers.append(layer)
+
+    for path in os.listdir(baseoutpath + '/layers'):
+        relpath = os.path.join('layers', path, oe_init_env_script)
+        if os.path.exists(os.path.join(baseoutpath, relpath)):
+            conf_initpath = relpath
+
+        relpath = os.path.join('layers', path, 'scripts', 'devtool')
+        if os.path.exists(os.path.join(baseoutpath, relpath)):
+            scriptrelpath = os.path.dirname(relpath)
+
+        relpath = os.path.join('layers', path, 'meta')
+        if os.path.exists(os.path.join(baseoutpath, relpath, 'lib', 'oe')):
+            core_meta_subdir = relpath
+
+    d.setVar('oe_init_build_env_path', conf_initpath)
+    d.setVar('scriptrelpath', scriptrelpath)
+
+    # Write out config file for devtool
+    import ConfigParser
+    config = ConfigParser.SafeConfigParser()
+    config.add_section('General')
+    config.set('General', 'bitbake_subdir', conf_bbpath)
+    config.set('General', 'init_path', conf_initpath)
+    config.set('General', 'core_meta_subdir', core_meta_subdir)
+    config.add_section('SDK')
+    config.set('SDK', 'sdk_targets', d.getVar('SDK_TARGETS', True))
+    updateurl = d.getVar('SDK_UPDATE_URL', True)
+    if updateurl:
+        config.set('SDK', 'updateserver', updateurl)
+    bb.utils.mkdirhier(os.path.join(baseoutpath, 'conf'))
+    with open(os.path.join(baseoutpath, 'conf', 'devtool.conf'), 'w') as f:
+        config.write(f)
+
+    # Create a layer for new recipes / appends
+    bbpath = d.getVar('BBPATH', True)
+    bb.process.run(['devtool', '--bbpath', bbpath, '--basepath', baseoutpath, 'create-workspace', '--create-only', os.path.join(baseoutpath, 'workspace')])
+
+    # Create bblayers.conf
+    bb.utils.mkdirhier(baseoutpath + '/conf')
+    with open(baseoutpath + '/conf/bblayers.conf', 'w') as f:
+        f.write('# WARNING: this configuration has been automatically generated and in\n')
+        f.write('# most cases should not be edited. If you need more flexibility than\n')
+        f.write('# this configuration provides, it is strongly suggested that you set\n')
+        f.write('# up a proper instance of the full build system and use that instead.\n\n')
+
+        f.write('LCONF_VERSION = "%s"\n\n' % d.getVar('LCONF_VERSION', False))
+        f.write('BBPATH = "$' + '{TOPDIR}"\n')
+        f.write('SDKBASEMETAPATH = "$' + '{TOPDIR}"\n')
+        f.write('BBLAYERS := " \\\n')
+        for layerrelpath in sdkbblayers:
+            f.write('    $' + '{SDKBASEMETAPATH}/layers/%s \\\n' % layerrelpath)
+        f.write('    $' + '{SDKBASEMETAPATH}/workspace \\\n')
+        f.write('    "\n')
+
+    # Create local.conf
+    local_conf_whitelist = (d.getVar('SDK_LOCAL_CONF_WHITELIST', True) or '').split()
+    local_conf_blacklist = (d.getVar('SDK_LOCAL_CONF_BLACKLIST', True) or '').split()
+    def handle_var(varname, origvalue, op, newlines):
+        if varname in local_conf_blacklist or (origvalue.strip().startswith('/') and not varname in local_conf_whitelist):
+            newlines.append('# Removed original setting of %s\n' % varname)
+            return None, op, 0, True
+        else:
+            return origvalue, op, 0, True
+    varlist = ['[^#=+ ]*']
+    builddir = d.getVar('TOPDIR', True)
+    with open(builddir + '/conf/local.conf', 'r') as f:
+        oldlines = f.readlines()
+    (updated, newlines) = bb.utils.edit_metadata(oldlines, varlist, handle_var)
+
+    with open(baseoutpath + '/conf/local.conf', 'w') as f:
+        f.write('# WARNING: this configuration has been automatically generated and in\n')
+        f.write('# most cases should not be edited. If you need more flexibility than\n')
+        f.write('# this configuration provides, it is strongly suggested that you set\n')
+        f.write('# up a proper instance of the full build system and use that instead.\n\n')
+        for line in newlines:
+            if line.strip() and not line.startswith('#'):
+                f.write(line)
+
+        f.write('INHERIT += "%s"\n\n' % 'uninative')
+        f.write('CONF_VERSION = "%s"\n\n' % d.getVar('CONF_VERSION', False))
+
+        # Some classes are not suitable for SDK, remove them from INHERIT
+        f.write('INHERIT_remove = "%s"\n' % d.getVar('SDK_INHERIT_BLACKLIST'))
+
+        # Bypass the default connectivity check if any
+        f.write('CONNECTIVITY_CHECK_URIS = ""\n\n')
+
+        # Another hack, but we want the native part of sstate to be kept the same
+        # regardless of the host distro
+        fixedlsbstring = 'SDK-Fixed'
+        f.write('NATIVELSBSTRING_forcevariable = "%s"\n\n' % fixedlsbstring)
+
+        # Ensure locked sstate cache objects are re-used without error
+        f.write('SIGGEN_LOCKEDSIGS_CHECK_LEVEL = "warn"\n\n')
+
+        f.write('require conf/locked-sigs.inc\n')
+        f.write('require conf/work-config.inc\n')
+
+    sigfile = d.getVar('WORKDIR', True) + '/locked-sigs.inc'
+    oe.copy_buildsystem.generate_locked_sigs(sigfile, d)
+
+    # Filter the locked signatures file to just the sstate tasks we are interested in
+    allowed_tasks = ['do_populate_lic', 'do_populate_sysroot', 'do_packagedata', 'do_package_write_ipk', 'do_package_write_rpm', 'do_package_write_deb', 'do_package_qa', 'do_deploy']
+    excluded_targets = d.getVar('SDK_TARGETS', True)
+    lockedsigs_pruned = baseoutpath + '/conf/locked-sigs.inc'
+    oe.copy_buildsystem.prune_lockedsigs(allowed_tasks,
+                                         excluded_targets,
+                                         sigfile,
+                                         lockedsigs_pruned)
+
+    sstate_out = baseoutpath + '/sstate-cache'
+    bb.utils.remove(sstate_out, True)
+    oe.copy_buildsystem.create_locked_sstate_cache(lockedsigs_pruned,
+                                                   d.getVar('SSTATE_DIR', True),
+                                                   sstate_out, d,
+                                                   fixedlsbstring)
+
+    # Create a dummy config file for additional settings
+    with open(baseoutpath + '/conf/work-config.inc', 'w') as f:
+        pass
+}
+
+def extsdk_get_buildtools_filename(d):
+    # This is somewhat of a hack
+    localdata = bb.data.createCopy(d)
+    localdata.setVar('PN', 'buildtools-tarball')
+    return localdata.expand('${SDK_NAME}-buildtools-nativesdk-standalone-*.sh')
+
+install_tools() {
+	install -d ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}
+	lnr ${SDK_OUTPUT}/${SDKPATH}/${scriptrelpath}/devtool ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/devtool
+	lnr ${SDK_OUTPUT}/${SDKPATH}/${scriptrelpath}/recipetool ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/recipetool
+	touch ${SDK_OUTPUT}/${SDKPATH}/.devtoolbase
+
+	# find latest buildtools-tarball and install it
+	buildtools_path=`ls -t1 ${SDK_DEPLOY}/${@extsdk_get_buildtools_filename(d)} | head -n1`
+	install $buildtools_path ${SDK_OUTPUT}/${SDKPATH}
+
+	install ${SDK_DEPLOY}/${BUILD_ARCH}-nativesdk-libc.tar.bz2 ${SDK_OUTPUT}/${SDKPATH}
+}
+
+# Since bitbake won't run as root it doesn't make sense to try and install
+# the extensible sdk as root.
+sdk_ext_preinst() {
+	if [ "`id -u`" = "0" ]; then
+		echo "ERROR: The extensible sdk cannot be installed as root."
+		exit 1
+	fi
+	SDK_EXTENSIBLE="1"
+}
+SDK_PRE_INSTALL_COMMAND_task-populate-sdk-ext = "${sdk_ext_preinst}"
+
+# FIXME this preparation should be done as part of the SDK construction
+sdk_ext_postinst() {
+	printf "\nExtracting buildtools...\n"
+	cd $target_sdk_dir
+	printf "buildtools\ny" | ./*buildtools-nativesdk-standalone* > /dev/null
+
+	# Make sure when the user sets up the environment, they also get
+	# the buildtools-tarball tools in their path.
+	echo ". $target_sdk_dir/buildtools/environment-setup*" >> $target_sdk_dir/environment-setup*
+
+	# Allow bitbake environment setup to be ran as part of this sdk.
+	echo "export OE_SKIP_SDK_CHECK=1" >> $target_sdk_dir/environment-setup*
+
+	# A bit of another hack, but we need this in the path only for devtool
+	# so put it at the end of $PATH.
+	echo "export PATH=\$PATH:$target_sdk_dir/sysroots/${SDK_SYS}/${bindir_nativesdk}" >> $target_sdk_dir/environment-setup*
+
+	# For now this is where uninative.bbclass expects the tarball
+	mv *-nativesdk-libc.tar.* $target_sdk_dir/`dirname ${oe_init_build_env_path}`
+
+	if [ "$prepare_buildsystem" != "no" ]; then
+	    printf "Preparing build system...\n"
+	    # dash which is /bin/sh on Ubuntu will not preserve the
+	    # current working directory when first ran, nor will it set $1 when
+	    # sourcing a script. That is why this has to look so ugly.
+	    sh -c ". buildtools/environment-setup* > preparing_build_system.log && cd $target_sdk_dir/`dirname ${oe_init_build_env_path}` && set $target_sdk_dir && . $target_sdk_dir/${oe_init_build_env_path} $target_sdk_dir >> preparing_build_system.log && bitbake ${SDK_TARGETS} >> preparing_build_system.log" || { echo "SDK preparation failed: see `pwd`/preparing_build_system.log" ; exit 1 ; }
+	fi
+	echo done
+}
+
+SDK_POST_INSTALL_COMMAND_task-populate-sdk-ext = "${sdk_ext_postinst}"
+
+SDK_POSTPROCESS_COMMAND_prepend_task-populate-sdk-ext = "copy_buildsystem; install_tools; "
+
+fakeroot python do_populate_sdk_ext() {
+    bb.build.exec_func("do_populate_sdk", d)
+}
+
+def get_sdk_ext_rdepends(d):
+    localdata = d.createCopy()
+    localdata.appendVar('OVERRIDES', ':task-populate-sdk-ext')
+    bb.data.update_data(localdata)
+    return localdata.getVarFlag('do_populate_sdk', 'rdepends', True)
+
+do_populate_sdk_ext[dirs] = "${@d.getVarFlag('do_populate_sdk', 'dirs', False)}"
+do_populate_sdk_ext[depends] += "${@d.getVarFlag('do_populate_sdk', 'depends', False)}"
+do_populate_sdk_ext[rdepends] = "${@get_sdk_ext_rdepends(d)}"
+do_populate_sdk_ext[recrdeptask] += "${@d.getVarFlag('do_populate_sdk', 'recrdeptask', False)}"
+
+
+do_populate_sdk_ext[depends] += "buildtools-tarball:do_populate_sdk uninative-tarball:do_populate_sdk"
+
+do_populate_sdk_ext[rdepends] += "${@' '.join([x + ':do_build' for x in d.getVar('SDK_TARGETS', True).split()])}"
+do_populate_sdk_ext[recrdeptask] += "do_populate_lic do_package_qa do_populate_sysroot do_deploy"
+
+# Make sure codes change in copy_buildsystem can result in rebuilt
+do_populate_sdk_ext[vardeps] += "copy_buildsystem"
+
+addtask populate_sdk_ext
diff --git a/meta/classes/prexport.bbclass b/meta/classes/prexport.bbclass
new file mode 100644
index 0000000..5a1cb33
--- /dev/null
+++ b/meta/classes/prexport.bbclass
@@ -0,0 +1,58 @@
+PRSERV_DUMPOPT_VERSION = "${PRAUTOINX}"
+PRSERV_DUMPOPT_PKGARCH  = ""
+PRSERV_DUMPOPT_CHECKSUM = ""
+PRSERV_DUMPOPT_COL = "0"
+
+PRSERV_DUMPDIR ??= "${LOG_DIR}/db"
+PRSERV_DUMPFILE ??= "${PRSERV_DUMPDIR}/prserv.inc"
+
+python prexport_handler () {
+    import bb.event
+    if not e.data:
+        return
+
+    if isinstance(e, bb.event.RecipeParsed):
+        import oe.prservice
+        #get all PR values for the current PRAUTOINX
+        ver = e.data.getVar('PRSERV_DUMPOPT_VERSION', True)
+        ver = ver.replace('%','-')
+        retval = oe.prservice.prserv_dump_db(e.data)
+        if not retval:
+            bb.fatal("prexport_handler: export failed!")
+        (metainfo, datainfo) = retval
+        if not datainfo:
+            bb.warn("prexport_handler: No AUTOPR values found for %s" % ver)
+            return
+        oe.prservice.prserv_export_tofile(e.data, None, datainfo, False)
+        if 'AUTOINC' in ver:
+            import re
+            srcpv =  bb.fetch2.get_srcrev(e.data)
+            base_ver = "AUTOINC-%s" % ver[:ver.find(srcpv)]
+            e.data.setVar('PRSERV_DUMPOPT_VERSION', base_ver)
+            retval = oe.prservice.prserv_dump_db(e.data)
+            if not retval:
+                bb.fatal("prexport_handler: export failed!")
+            (metainfo, datainfo) = retval
+            oe.prservice.prserv_export_tofile(e.data, None, datainfo, False)
+    elif isinstance(e, bb.event.ParseStarted):
+        import bb.utils
+        import oe.prservice
+        oe.prservice.prserv_check_avail(e.data)
+        #remove dumpfile
+        bb.utils.remove(e.data.getVar('PRSERV_DUMPFILE', True))
+    elif isinstance(e, bb.event.ParseCompleted):
+        import oe.prservice
+        #dump meta info of tables
+        d = e.data.createCopy()
+        d.setVar('PRSERV_DUMPOPT_COL', "1")
+        retval = oe.prservice.prserv_dump_db(d)
+        if not retval:
+            bb.error("prexport_handler: export failed!")
+            return
+        (metainfo, datainfo) = retval
+        oe.prservice.prserv_export_tofile(d, metainfo, None, True)
+
+}
+
+addhandler prexport_handler
+prexport_handler[eventmask] = "bb.event.RecipeParsed bb.event.ParseStarted bb.event.ParseCompleted"
diff --git a/meta/classes/primport.bbclass b/meta/classes/primport.bbclass
new file mode 100644
index 0000000..8ed45f0
--- /dev/null
+++ b/meta/classes/primport.bbclass
@@ -0,0 +1,21 @@
+python primport_handler () {
+    import bb.event
+    if not e.data:
+        return
+
+    if isinstance(e, bb.event.ParseCompleted):
+        import oe.prservice
+        #import all exported AUTOPR values
+        imported = oe.prservice.prserv_import_db(e.data)
+        if imported is None:
+            bb.fatal("import failed!")
+
+        for (version, pkgarch, checksum, value) in imported:
+            bb.note("imported (%s,%s,%s,%d)" % (version, pkgarch, checksum, value))
+    elif isinstance(e, bb.event.ParseStarted):
+        import oe.prservice
+        oe.prservice.prserv_check_avail(e.data)
+}
+
+addhandler primport_handler
+primport_handler[eventmask] = "bb.event.ParseCompleted bb.event.ParseStarted"
diff --git a/meta/classes/prserv.bbclass b/meta/classes/prserv.bbclass
new file mode 100644
index 0000000..139597f
--- /dev/null
+++ b/meta/classes/prserv.bbclass
@@ -0,0 +1,2 @@
+
+
diff --git a/meta/classes/ptest-gnome.bbclass b/meta/classes/ptest-gnome.bbclass
new file mode 100644
index 0000000..b2949af
--- /dev/null
+++ b/meta/classes/ptest-gnome.bbclass
@@ -0,0 +1,8 @@
+inherit ptest
+
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-installed-tests', '--disable-installed-tests', d)}"
+
+FILES_${PN}-ptest += "${libexecdir}/installed-tests/ \
+                      ${datadir}/installed-tests/"
+
+RDEPENDS_${PN}-ptest += "gnome-desktop-testing"
diff --git a/meta/classes/ptest.bbclass b/meta/classes/ptest.bbclass
new file mode 100644
index 0000000..b5f470f
--- /dev/null
+++ b/meta/classes/ptest.bbclass
@@ -0,0 +1,67 @@
+SUMMARY_${PN}-ptest ?= "${SUMMARY} - Package test files"
+DESCRIPTION_${PN}-ptest ?= "${DESCRIPTION}  \
+This package contains a test directory ${PTEST_PATH} for package test purposes."
+
+PTEST_PATH ?= "${libdir}/${PN}/ptest"
+FILES_${PN}-ptest = "${PTEST_PATH}"
+SECTION_${PN}-ptest = "devel"
+ALLOW_EMPTY_${PN}-ptest = "1"
+PTEST_ENABLED = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '1', '0', d)}"
+PTEST_ENABLED_class-native = ""
+PTEST_ENABLED_class-nativesdk = ""
+PTEST_ENABLED_class-cross-canadian = ""
+RDEPENDS_${PN}-ptest_class-native = ""
+RDEPENDS_${PN}-ptest_class-nativesdk = ""
+RRECOMMENDS_${PN}-ptest += "ptest-runner"
+
+PACKAGES =+ "${@bb.utils.contains('PTEST_ENABLED', '1', '${PN}-ptest', '', d)}"
+
+do_configure_ptest() {
+    :
+}
+
+do_configure_ptest_base() {
+    do_configure_ptest
+}
+
+do_compile_ptest() {
+    :
+}
+
+do_compile_ptest_base() {
+    do_compile_ptest
+}
+
+do_install_ptest() {
+    :
+}
+
+do_install_ptest_base() {
+    if [ -f ${WORKDIR}/run-ptest ]; then
+        install -D ${WORKDIR}/run-ptest ${D}${PTEST_PATH}/run-ptest
+        if grep -q install-ptest: Makefile; then
+            oe_runmake DESTDIR=${D}${PTEST_PATH} install-ptest
+        fi
+        do_install_ptest
+        chown -R root:root ${D}${PTEST_PATH}
+    fi
+}
+
+do_configure_ptest_base[dirs] = "${B}"
+do_compile_ptest_base[dirs] = "${B}"
+do_install_ptest_base[dirs] = "${B}"
+do_install_ptest_base[cleandirs] = "${D}${PTEST_PATH}"
+
+addtask configure_ptest_base after do_configure before do_compile
+addtask compile_ptest_base   after do_compile   before do_install
+addtask install_ptest_base   after do_install   before do_package do_populate_sysroot
+
+python () {
+    if not bb.data.inherits_class('native', d) and not bb.data.inherits_class('cross', d):
+        d.setVarFlag('do_install_ptest_base', 'fakeroot', 1)
+
+    # Remove all '*ptest_base' tasks when ptest is not enabled
+    if not(d.getVar('PTEST_ENABLED', True) == "1"):
+        for i in ['do_configure_ptest_base', 'do_compile_ptest_base', 'do_install_ptest_base']:
+            bb.build.deltask(i, d)
+}
diff --git a/meta/classes/python-dir.bbclass b/meta/classes/python-dir.bbclass
new file mode 100644
index 0000000..ebfa4b3
--- /dev/null
+++ b/meta/classes/python-dir.bbclass
@@ -0,0 +1,5 @@
+PYTHON_BASEVERSION ?= "2.7"
+PYTHON_ABI ?= ""
+PYTHON_DIR = "python${PYTHON_BASEVERSION}"
+PYTHON_PN = "python${@'' if '${PYTHON_BASEVERSION}'.startswith('2') else '3'}"
+PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/site-packages"
diff --git a/meta/classes/python3native.bbclass b/meta/classes/python3native.bbclass
new file mode 100644
index 0000000..cf83017
--- /dev/null
+++ b/meta/classes/python3native.bbclass
@@ -0,0 +1,7 @@
+PYTHON_BASEVERSION = "3.4"
+
+inherit python-dir
+
+PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}"
+EXTRANATIVEPATH += "${PYTHON_PN}-native"
+DEPENDS += " ${PYTHON_PN}-native "
diff --git a/meta/classes/pythonnative.bbclass b/meta/classes/pythonnative.bbclass
new file mode 100644
index 0000000..97029dc
--- /dev/null
+++ b/meta/classes/pythonnative.bbclass
@@ -0,0 +1,8 @@
+
+inherit python-dir
+
+PYTHON="${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN}"
+# PYTHON_EXECUTABLE is used by cmake
+PYTHON_EXECUTABLE="${PYTHON}"
+EXTRANATIVEPATH += "${PYTHON_PN}-native"
+DEPENDS += " ${PYTHON_PN}-native "
diff --git a/meta/classes/qemu.bbclass b/meta/classes/qemu.bbclass
new file mode 100644
index 0000000..601f587
--- /dev/null
+++ b/meta/classes/qemu.bbclass
@@ -0,0 +1,51 @@
+#
+# This class contains functions for recipes that need QEMU or test for its
+# existence.
+#
+
+def qemu_target_binary(data):
+    target_arch = data.getVar("TARGET_ARCH", True)
+    if target_arch in ("i486", "i586", "i686"):
+        target_arch = "i386"
+    elif target_arch == "powerpc":
+        target_arch = "ppc"
+    elif target_arch == "powerpc64":
+        target_arch = "ppc64"
+
+    return "qemu-" + target_arch
+#
+# Next function will return a string containing the command that is needed to
+# to run a certain binary through qemu. For example, in order to make a certain
+# postinstall scriptlet run at do_rootfs time and running the postinstall is
+# architecture dependent, we can run it through qemu. For example, in the
+# postinstall scriptlet, we could use the following:
+#
+# ${@qemu_run_binary(d, '$D', '/usr/bin/test_app')} [test_app arguments]
+#
+def qemu_run_binary(data, rootfs_path, binary):
+    qemu_binary = qemu_target_binary(data)
+    if qemu_binary == "qemu-allarch":
+        qemu_binary = "qemuwrapper"
+
+    libdir = rootfs_path + data.getVar("libdir", False)
+    base_libdir = rootfs_path + data.getVar("base_libdir", False)
+    qemu_options = data.getVar("QEMU_OPTIONS", True)
+
+    return "PSEUDO_UNLOAD=1 " + qemu_binary + " " + qemu_options + " -L " + rootfs_path\
+            + " -E LD_LIBRARY_PATH=" + libdir + ":" + base_libdir + " "\
+            + rootfs_path + binary
+
+# QEMU_EXTRAOPTIONS is not meant to be directly used, the extensions are 
+# PACKAGE_ARCH, not overrides and hence have to do this dance. Simply being arch 
+# specific isn't good enough.
+QEMU_OPTIONS = "-r ${OLDEST_KERNEL} ${@d.getVar("QEMU_EXTRAOPTIONS_%s" % d.getVar('PACKAGE_ARCH', True), True) or ""}"
+QEMU_EXTRAOPTIONS_iwmmxt    = " -cpu pxa270-c5"
+QEMU_EXTRAOPTIONS_armv6     = " -cpu arm1136"
+QEMU_EXTRAOPTIONS_armv7a    = " -cpu cortex-a8"
+QEMU_EXTRAOPTIONS_e500v2    = " -cpu e500v2"
+QEMU_EXTRAOPTIONS_e500mc    = " -cpu e500mc"
+QEMU_EXTRAOPTIONS_e5500     = " -cpu e5500"
+QEMU_EXTRAOPTIONS_e5500-64b = " -cpu e5500"
+QEMU_EXTRAOPTIONS_e6500     = " -cpu e6500"
+QEMU_EXTRAOPTIONS_e6500-64b = " -cpu e6500"
+QEMU_EXTRAOPTIONS_ppc7400   = " -cpu 7400"
diff --git a/meta/classes/qmake2.bbclass b/meta/classes/qmake2.bbclass
new file mode 100644
index 0000000..6e73ad2
--- /dev/null
+++ b/meta/classes/qmake2.bbclass
@@ -0,0 +1,27 @@
+#
+# QMake variables for Qt4
+#
+inherit qmake_base
+
+DEPENDS_prepend = "qt4-tools-native "
+
+export QMAKESPEC = "${STAGING_DATADIR}/qt4/mkspecs/${TARGET_OS}-oe-g++"
+export OE_QMAKE_QT_CONFIG = "${STAGING_DATADIR}/qt4/mkspecs/qconfig.pri"
+export OE_QMAKE_UIC = "${STAGING_BINDIR_NATIVE}/uic4"
+export OE_QMAKE_UIC3 = "${STAGING_BINDIR_NATIVE}/uic34"
+export OE_QMAKE_MOC = "${STAGING_BINDIR_NATIVE}/moc4"
+export OE_QMAKE_RCC = "${STAGING_BINDIR_NATIVE}/rcc4"
+export OE_QMAKE_QDBUSCPP2XML = "${STAGING_BINDIR_NATIVE}/qdbuscpp2xml4"
+export OE_QMAKE_QDBUSXML2CPP = "${STAGING_BINDIR_NATIVE}/qdbusxml2cpp4"
+export OE_QMAKE_QMAKE = "${STAGING_BINDIR_NATIVE}/qmake2"
+export OE_QMAKE_LINK = "${CXX}"
+export OE_QMAKE_CXXFLAGS = "${CXXFLAGS}"
+export OE_QMAKE_INCDIR_QT = "${STAGING_INCDIR}/qt4"
+export OE_QMAKE_LIBDIR_QT = "${STAGING_LIBDIR}"
+export OE_QMAKE_LIBS_QT = "qt"
+export OE_QMAKE_LIBS_X11 = "-lXext -lX11 -lm"
+export OE_QMAKE_LIBS_X11SM = "-lSM -lICE"
+export OE_QMAKE_LCONVERT = "${STAGING_BINDIR_NATIVE}/lconvert4"
+export OE_QMAKE_LRELEASE = "${STAGING_BINDIR_NATIVE}/lrelease4"
+export OE_QMAKE_LUPDATE = "${STAGING_BINDIR_NATIVE}/lupdate4"
+export OE_QMAKE_XMLPATTERNS = "${STAGING_BINDIR_NATIVE}/xmlpatterns4"
diff --git a/meta/classes/qmake_base.bbclass b/meta/classes/qmake_base.bbclass
new file mode 100644
index 0000000..dc98713
--- /dev/null
+++ b/meta/classes/qmake_base.bbclass
@@ -0,0 +1,119 @@
+QMAKE_MKSPEC_PATH ?= "${STAGING_DATADIR_NATIVE}/qmake"
+
+OE_QMAKE_PLATFORM = "${TARGET_OS}-oe-g++"
+QMAKESPEC := "${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}"
+
+# We override this completely to eliminate the -e normally passed in
+EXTRA_OEMAKE = ""
+
+export OE_QMAKE_CC="${CC}"
+export OE_QMAKE_CFLAGS="${CFLAGS}"
+export OE_QMAKE_CXX="${CXX}"
+export OE_QMAKE_LDFLAGS="${LDFLAGS}"
+export OE_QMAKE_AR="${AR}"
+export OE_QMAKE_STRIP="echo"
+export OE_QMAKE_RPATH="-Wl,-rpath-link,"
+
+# default to qte2 via bb.conf, inherit qt3x11 to configure for qt3x11
+
+oe_qmake_mkspecs () {
+    mkdir -p mkspecs/${OE_QMAKE_PLATFORM}
+    for f in ${QMAKE_MKSPEC_PATH}/${OE_QMAKE_PLATFORM}/*; do
+        if [ -L $f ]; then
+            lnk=`readlink $f`
+            if [ -f mkspecs/${OE_QMAKE_PLATFORM}/$lnk ]; then
+                ln -s $lnk mkspecs/${OE_QMAKE_PLATFORM}/`basename $f`
+            else
+                cp $f mkspecs/${OE_QMAKE_PLATFORM}/
+            fi
+        else
+            cp $f mkspecs/${OE_QMAKE_PLATFORM}/
+        fi
+    done
+}
+
+do_generate_qt_config_file() {
+	export QT_CONF_PATH=${WORKDIR}/qt.conf
+	cat > ${WORKDIR}/qt.conf <<EOF
+[Paths]
+Prefix =
+Binaries = ${STAGING_BINDIR_NATIVE}
+Headers = ${STAGING_INCDIR}/${QT_DIR_NAME}
+Plugins = ${STAGING_LIBDIR}/${QT_DIR_NAME}/plugins/
+Mkspecs = ${STAGING_DATADIR}/${QT_DIR_NAME}/mkspecs/
+EOF
+}
+
+addtask generate_qt_config_file after do_patch before do_configure
+
+qmake_base_do_configure() {
+	case ${QMAKESPEC} in
+	*linux-oe-g++|*linux-uclibc-oe-g++|*linux-gnueabi-oe-g++|*linux-uclibceabi-oe-g++|*linux-gnuspe-oe-g++|*linux-uclibcspe-oe-g++|*linux-gnun32-oe-g++)
+		;;
+	*-oe-g++)
+		die Unsupported target ${TARGET_OS} for oe-g++ qmake spec
+		;;
+	*)
+		bbnote Searching for qmake spec file
+		paths="${QMAKE_MKSPEC_PATH}/qws/${TARGET_OS}-${TARGET_ARCH}-g++"
+		paths="${QMAKE_MKSPEC_PATH}/${TARGET_OS}-g++ $paths"
+
+		if (echo "${TARGET_ARCH}"|grep -q 'i.86'); then
+			paths="${QMAKE_MKSPEC_PATH}/qws/${TARGET_OS}-x86-g++ $paths"
+		fi
+		for i in $paths; do
+			if test -e $i; then
+				export QMAKESPEC=$i
+				break
+			fi
+		done
+		;;
+	esac
+
+	bbnote "using qmake spec in ${QMAKESPEC}, using profiles '${QMAKE_PROFILES}'"
+
+	if [ -z "${QMAKE_PROFILES}" ]; then 
+		PROFILES="`ls *.pro`"
+	else
+		PROFILES="${QMAKE_PROFILES}"
+	fi
+
+	if [ -z "$PROFILES" ]; then
+		die "QMAKE_PROFILES not set and no profiles found in $PWD"
+        fi
+
+	if [ ! -z "${EXTRA_QMAKEVARS_POST}" ]; then
+		AFTER="-after"
+		QMAKE_VARSUBST_POST="${EXTRA_QMAKEVARS_POST}"
+		bbnote "qmake postvar substitution: ${EXTRA_QMAKEVARS_POST}"
+	fi
+
+	if [ ! -z "${EXTRA_QMAKEVARS_PRE}" ]; then
+		QMAKE_VARSUBST_PRE="${EXTRA_QMAKEVARS_PRE}"
+		bbnote "qmake prevar substitution: ${EXTRA_QMAKEVARS_PRE}"
+	fi
+
+	# Hack .pro files to use OE utilities
+	LCONVERT_NAME=$(basename ${OE_QMAKE_LCONVERT})
+	LRELEASE_NAME=$(basename ${OE_QMAKE_LRELEASE})
+	LUPDATE_NAME=$(basename ${OE_QMAKE_LUPDATE})
+	XMLPATTERNS_NAME=$(basename ${OE_QMAKE_XMLPATTERNS})
+	find -name '*.pro' \
+	     -exec sed -i -e "s|\(=\s*.*\)/$LCONVERT_NAME|\1/lconvert|g" \
+	                  -e "s|\(=\s*.*\)/$LRELEASE_NAME|\1/lrelease|g" \
+	                  -e "s|\(=\s*.*\)/$LUPDATE_NAME|\1/lupdate|g" \
+	                  -e "s|\(=\s*.*\)/$XMLPATTERNS_NAME|\1/xmlpatterns|g" \
+	                  -e "s|\(=\s*.*\)/lconvert|\1/$LCONVERT_NAME|g" \
+	                  -e "s|\(=\s*.*\)/lrelease|\1/$LRELEASE_NAME|g" \
+	                  -e "s|\(=\s*.*\)/lupdate|\1/$LUPDATE_NAME|g" \
+	                  -e "s|\(=\s*.*\)/xmlpatterns|\1/$XMLPATTERNS_NAME|g" \
+	                  '{}' ';'
+
+#bbnote "Calling '${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST'"
+	unset QMAKESPEC || true
+	${OE_QMAKE_QMAKE} -makefile -spec ${QMAKESPEC} -o Makefile $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST || die "Error calling ${OE_QMAKE_QMAKE} on $PROFILES"
+}
+
+EXPORT_FUNCTIONS do_configure
+
+addtask configure after do_unpack do_patch before do_compile
diff --git a/meta/classes/qt4e.bbclass b/meta/classes/qt4e.bbclass
new file mode 100644
index 0000000..13b1050
--- /dev/null
+++ b/meta/classes/qt4e.bbclass
@@ -0,0 +1,21 @@
+QT4EDEPENDS ?= "qt4-embedded "
+DEPENDS_prepend = "${QT4EDEPENDS}"
+
+inherit qmake2
+
+QT_BASE_NAME = "qt4-embedded"
+QT_DIR_NAME = "qtopia"
+QT_LIBINFIX = "E"
+# override variables set by qmake-base to compile Qt/Embedded apps
+#
+export QMAKESPEC = "${STAGING_DATADIR}/${QT_DIR_NAME}/mkspecs/${TARGET_OS}-oe-g++"
+export OE_QMAKE_QT_CONFIG = "${STAGING_DATADIR}/${QT_DIR_NAME}/mkspecs/qconfig.pri"
+export OE_QMAKE_INCDIR_QT = "${STAGING_INCDIR}/${QT_DIR_NAME}"
+export OE_QMAKE_LIBDIR_QT = "${STAGING_LIBDIR}"
+export OE_QMAKE_LIBS_QT = "qt"
+export OE_QMAKE_LIBS_X11 = ""
+export OE_QMAKE_EXTRA_MODULES = "network"
+EXTRA_QMAKEVARS_PRE += " QT_LIBINFIX=${QT_LIBINFIX} "
+
+# Qt4 uses atomic instructions not supported in thumb mode
+ARM_INSTRUCTION_SET = "arm"
diff --git a/meta/classes/qt4x11.bbclass b/meta/classes/qt4x11.bbclass
new file mode 100644
index 0000000..6f06d34
--- /dev/null
+++ b/meta/classes/qt4x11.bbclass
@@ -0,0 +1,14 @@
+QT4DEPENDS ?= "qt4-x11 "
+DEPENDS_prepend = "${QT4DEPENDS}"
+
+# depends on qt4-x11
+REQUIRED_DISTRO_FEATURES += "x11"
+
+inherit qmake2 distro_features_check
+
+QT_BASE_NAME = "qt4"
+QT_DIR_NAME = "qt4"
+QT_LIBINFIX = ""
+
+# Qt4 uses atomic instructions not supported in thumb mode
+ARM_INSTRUCTION_SET = "arm"
diff --git a/meta/classes/recipe_sanity.bbclass b/meta/classes/recipe_sanity.bbclass
new file mode 100644
index 0000000..ee04e33
--- /dev/null
+++ b/meta/classes/recipe_sanity.bbclass
@@ -0,0 +1,167 @@
+def __note(msg, d):
+    bb.note("%s: recipe_sanity: %s" % (d.getVar("P", True), msg))
+
+__recipe_sanity_badruntimevars = "RDEPENDS RPROVIDES RRECOMMENDS RCONFLICTS"
+def bad_runtime_vars(cfgdata, d):
+    if bb.data.inherits_class("native", d) or \
+            bb.data.inherits_class("cross", d):
+        return
+
+    for var in d.getVar("__recipe_sanity_badruntimevars", True).split():
+        val = d.getVar(var, 0)
+        if val and val != cfgdata.get(var):
+            __note("%s should be %s_${PN}" % (var, var), d)
+
+__recipe_sanity_reqvars = "DESCRIPTION"
+__recipe_sanity_reqdiffvars = ""
+def req_vars(cfgdata, d):
+    for var in d.getVar("__recipe_sanity_reqvars", True).split():
+        if not d.getVar(var, 0):
+            __note("%s should be set" % var, d)
+
+    for var in d.getVar("__recipe_sanity_reqdiffvars", True).split():
+        val = d.getVar(var, 0)
+        cfgval = cfgdata.get(var)
+
+        if not val:
+            __note("%s should be set" % var, d)
+        elif val == cfgval:
+            __note("%s should be defined to something other than default (%s)" % (var, cfgval), d)
+
+def var_renames_overwrite(cfgdata, d):
+    renames = d.getVar("__recipe_sanity_renames", 0)
+    if renames:
+        for (key, newkey, oldvalue, newvalue) in renames:
+            if oldvalue != newvalue and oldvalue != cfgdata.get(newkey):
+                __note("rename of variable '%s' to '%s' overwrote existing value '%s' with '%s'." % (key, newkey, oldvalue, newvalue), d)
+
+def incorrect_nonempty_PACKAGES(cfgdata, d):
+    if bb.data.inherits_class("native", d) or \
+            bb.data.inherits_class("cross", d):
+        if d.getVar("PACKAGES", True):
+            return True
+
+def can_use_autotools_base(cfgdata, d):
+    cfg = d.getVar("do_configure", True)
+    if not bb.data.inherits_class("autotools", d):
+        return False
+
+    for i in ["autoreconf"] + ["%s_do_configure" % cls for cls in ["gnomebase", "gnome", "e", "autotools", "efl", "gpephone", "openmoko", "openmoko2", "xfce", "xlibs"]]:
+        if cfg.find(i) != -1:
+            return False
+
+    for clsfile in d.getVar("__inherit_cache", 0):
+        (base, _) = os.path.splitext(os.path.basename(clsfile))
+        if cfg.find("%s_do_configure" % base) != -1:
+            __note("autotools_base usage needs verification, spotted %s_do_configure" % base, d)
+
+    return True
+
+def can_delete_FILESPATH(cfgdata, d):
+    expected = cfgdata.get("FILESPATH")
+    expectedpaths = d.expand(expected)
+    unexpanded = d.getVar("FILESPATH", 0)
+    filespath = d.getVar("FILESPATH", True).split(":")
+    filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)]
+    for fp in filespath:
+        if not fp in expectedpaths:
+            # __note("Path %s in FILESPATH not in the expected paths %s" %
+            # (fp, expectedpaths), d)
+            return False
+    return expected != unexpanded
+
+def can_delete_FILESDIR(cfgdata, d):
+    expected = cfgdata.get("FILESDIR")
+    #expected = "${@bb.utils.which(d.getVar('FILESPATH', True), '.')}"
+    unexpanded = d.getVar("FILESDIR", 0)
+    if unexpanded is None:
+        return False
+
+    expanded = os.path.normpath(d.getVar("FILESDIR", True))
+    filespath = d.getVar("FILESPATH", True).split(":")
+    filespath = [os.path.normpath(f) for f in filespath if os.path.exists(f)]
+
+    return unexpanded != expected and \
+           os.path.exists(expanded) and \
+           (expanded in filespath or
+            expanded == d.expand(expected))
+
+def can_delete_others(p, cfgdata, d):
+    for k in ["S", "PV", "PN", "DESCRIPTION", "DEPENDS",
+              "SECTION", "PACKAGES", "EXTRA_OECONF", "EXTRA_OEMAKE"]:
+    #for k in cfgdata:
+        unexpanded = d.getVar(k, 0)
+        cfgunexpanded = cfgdata.get(k)
+        if not cfgunexpanded:
+            continue
+
+        try:
+            expanded = d.getVar(k, True)
+            cfgexpanded = d.expand(cfgunexpanded)
+        except bb.fetch.ParameterError:
+            continue
+
+        if unexpanded != cfgunexpanded and \
+           cfgexpanded == expanded:
+           __note("candidate for removal of %s" % k, d)
+           bb.debug(1, "%s: recipe_sanity:   cfg's '%s' and d's '%s' both expand to %s" %
+                       (p, cfgunexpanded, unexpanded, expanded))
+
+python do_recipe_sanity () {
+    p = d.getVar("P", True)
+    p = "%s %s %s" % (d.getVar("PN", True), d.getVar("PV", True), d.getVar("PR", True))
+
+    sanitychecks = [
+        (can_delete_FILESDIR, "candidate for removal of FILESDIR"),
+        (can_delete_FILESPATH, "candidate for removal of FILESPATH"),
+        #(can_use_autotools_base, "candidate for use of autotools_base"),
+        (incorrect_nonempty_PACKAGES, "native or cross recipe with non-empty PACKAGES"),
+    ]
+    cfgdata = d.getVar("__recipe_sanity_cfgdata", 0)
+
+    for (func, msg) in sanitychecks:
+        if func(cfgdata, d):
+            __note(msg, d)
+
+    can_delete_others(p, cfgdata, d)
+    var_renames_overwrite(cfgdata, d)
+    req_vars(cfgdata, d)
+    bad_runtime_vars(cfgdata, d)
+}
+do_recipe_sanity[nostamp] = "1"
+addtask recipe_sanity
+
+do_recipe_sanity_all[nostamp] = "1"
+do_recipe_sanity_all[recrdeptask] = "do_recipe_sanity_all do_recipe_sanity"
+do_recipe_sanity_all () {
+    :
+}
+addtask recipe_sanity_all after do_recipe_sanity
+
+python recipe_sanity_eh () {
+    d = e.data
+
+    cfgdata = {}
+    for k in d.keys():
+    #for k in ["S", "PR", "PV", "PN", "DESCRIPTION", "LICENSE", "DEPENDS",
+    #          "SECTION"]:
+        cfgdata[k] = d.getVar(k, 0)
+
+    d.setVar("__recipe_sanity_cfgdata", cfgdata)
+    #d.setVar("__recipe_sanity_cfgdata", d)
+
+    # Sick, very sick..
+    from bb.data_smart import DataSmart
+    old = DataSmart.renameVar
+    def myrename(self, key, newkey):
+        oldvalue = self.getVar(newkey, 0)
+        old(self, key, newkey)
+        newvalue = self.getVar(newkey, 0)
+        if oldvalue:
+            renames = self.getVar("__recipe_sanity_renames", 0) or set()
+            renames.add((key, newkey, oldvalue, newvalue))
+            self.setVar("__recipe_sanity_renames", renames)
+    DataSmart.renameVar = myrename
+}
+addhandler recipe_sanity_eh
+recipe_sanity_eh[eventmask] = "bb.event.ConfigParsed"
diff --git a/meta/classes/relocatable.bbclass b/meta/classes/relocatable.bbclass
new file mode 100644
index 0000000..4ca9981
--- /dev/null
+++ b/meta/classes/relocatable.bbclass
@@ -0,0 +1,7 @@
+inherit chrpath
+
+SYSROOT_PREPROCESS_FUNCS += "relocatable_binaries_preprocess"
+
+python relocatable_binaries_preprocess() {
+    rpath_replace(d.expand('${SYSROOT_DESTDIR}'), d)
+}
diff --git a/meta/classes/report-error.bbclass b/meta/classes/report-error.bbclass
new file mode 100644
index 0000000..040c29e
--- /dev/null
+++ b/meta/classes/report-error.bbclass
@@ -0,0 +1,92 @@
+#
+# Collects debug information in order to create error report files.
+#
+# Copyright (C) 2013 Intel Corporation
+# Author: Andreea Brandusa Proca <andreea.b.proca@intel.com>
+#
+# Licensed under the MIT license, see COPYING.MIT for details
+
+ERR_REPORT_DIR ?= "${LOG_DIR}/error-report"
+
+def errorreport_getdata(e):
+    logpath = e.data.getVar('ERR_REPORT_DIR', True)
+    datafile = os.path.join(logpath, "error-report.txt")
+    with open(datafile) as f:
+        data = f.read()
+    return data
+
+def errorreport_savedata(e, newdata, file):
+    import json
+    logpath = e.data.getVar('ERR_REPORT_DIR', True)
+    datafile = os.path.join(logpath, file)
+    with open(datafile, "w") as f:
+        json.dump(newdata, f, indent=4, sort_keys=True)
+    return datafile
+
+python errorreport_handler () {
+        import json
+
+        logpath = e.data.getVar('ERR_REPORT_DIR', True)
+        datafile = os.path.join(logpath, "error-report.txt")
+
+        if isinstance(e, bb.event.BuildStarted):
+            bb.utils.mkdirhier(logpath)
+            data = {}
+            machine = e.data.getVar("MACHINE", True)
+            data['machine'] = machine
+            data['build_sys'] = e.data.getVar("BUILD_SYS", True)
+            data['nativelsb'] = e.data.getVar("NATIVELSBSTRING", True)
+            data['distro'] = e.data.getVar("DISTRO", True)
+            data['target_sys'] = e.data.getVar("TARGET_SYS", True)
+            data['failures'] = []
+            data['component'] = e.getPkgs()[0]
+            data['branch_commit'] = base_detect_branch(e.data) + ": " + base_detect_revision(e.data)
+            lock = bb.utils.lockfile(datafile + '.lock')
+            errorreport_savedata(e, data, "error-report.txt")
+            bb.utils.unlockfile(lock)
+
+        elif isinstance(e, bb.build.TaskFailed):
+            task = e.task
+            taskdata={}
+            log = e.data.getVar('BB_LOGFILE', True)
+            taskdata['package'] = e.data.expand("${PF}")
+            taskdata['task'] = task
+            if log:
+                try:
+                    logFile = open(log, 'r')
+                    logdata = logFile.read().decode('utf-8')
+                    logFile.close()
+                except:
+                    logdata = "Unable to read log file"
+
+            else:
+                logdata = "No Log"
+
+            # server will refuse failures longer than param specified in project.settings.py
+            # MAX_UPLOAD_SIZE = "5242880"
+            # use lower value, because 650 chars can be spent in task, package, version
+            max_logdata_size = 5242000
+            # upload last max_logdata_size characters
+            if len(logdata) > max_logdata_size:
+                logdata = "..." + logdata[-max_logdata_size:]
+            taskdata['log'] = logdata
+            lock = bb.utils.lockfile(datafile + '.lock')
+            jsondata = json.loads(errorreport_getdata(e))
+            jsondata['failures'].append(taskdata)
+            errorreport_savedata(e, jsondata, "error-report.txt")
+            bb.utils.unlockfile(lock)
+
+        elif isinstance(e, bb.event.BuildCompleted):
+            lock = bb.utils.lockfile(datafile + '.lock')
+            jsondata = json.loads(errorreport_getdata(e))
+            bb.utils.unlockfile(lock)
+            failures = jsondata['failures']
+            if(len(failures) > 0):
+                filename = "error_report_" + e.data.getVar("BUILDNAME", True)+".txt"
+                datafile = errorreport_savedata(e, jsondata, filename)
+                bb.note("The errors for this build are stored in %s\nYou can send the errors to a reports server by running:\n  send-error-report %s [-s server]" % (datafile, datafile))
+                bb.note("The contents of these logs will be posted in public if you use the above command with the default server. Please ensure you remove any identifying or proprietary information when prompted before sending.")
+}
+
+addhandler errorreport_handler
+errorreport_handler[eventmask] = "bb.event.BuildStarted bb.event.BuildCompleted bb.build.TaskFailed"
diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass
new file mode 100644
index 0000000..5e9efc1
--- /dev/null
+++ b/meta/classes/rm_work.bbclass
@@ -0,0 +1,120 @@
+#
+# Removes source after build
+#
+# To use it add that line to conf/local.conf:
+#
+# INHERIT += "rm_work"
+#
+# To inhibit rm_work for some recipes, specify them in RM_WORK_EXCLUDE.
+# For example, in conf/local.conf:
+#
+# RM_WORK_EXCLUDE += "icu-native icu busybox"
+#
+
+# Use the completion scheduler by default when rm_work is active
+# to try and reduce disk usage
+BB_SCHEDULER ?= "completion"
+
+RMWORK_ORIG_TASK := "${BB_DEFAULT_TASK}"
+BB_DEFAULT_TASK = "rm_work_all"
+
+do_rm_work () {
+    # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe.
+    for p in ${RM_WORK_EXCLUDE}; do
+        if [ "$p" = "${PN}" ]; then
+            bbnote "rm_work: Skipping ${PN} since it is in RM_WORK_EXCLUDE"
+            exit 0
+        fi
+    done
+
+    cd ${WORKDIR}
+    for dir in *
+    do
+        # Retain only logs and other files in temp, safely ignore
+        # failures of removing pseudo folers on NFS2/3 server.
+        if [ $dir = 'pseudo' ]; then
+            rm -rf $dir 2> /dev/null || true
+        elif [ $dir != 'temp' ]; then
+            rm -rf $dir
+        fi
+    done
+
+    # Need to add pseudo back or subsqeuent work in this workdir
+    # might fail since setscene may not rerun to recreate it
+    mkdir -p ${WORKDIR}/pseudo/
+
+    # Change normal stamps into setscene stamps as they better reflect the
+    # fact WORKDIR is now empty
+    # Also leave noexec stamps since setscene stamps don't cover them
+    cd `dirname ${STAMP}`
+    for i in `basename ${STAMP}`*
+    do
+        for j in ${SSTATETASKS} do_shared_workdir
+        do
+            case $i in
+            *do_setscene*)
+                break
+                ;;
+            *sigdata*)
+                i=dummy
+                break
+                ;;
+            *do_package_write*)
+                i=dummy
+                break
+                ;;
+            *do_build*)
+                i=dummy
+                break
+                ;;
+            # We remove do_package entirely, including any
+            # sstate version since otherwise we'd need to leave 'plaindirs' around
+            # such as 'packages' and 'packages-split' and these can be large. No end
+            # of chain tasks depend directly on do_package anymore.
+            *do_package|*do_package.*|*do_package_setscene.*)
+                rm -f $i;
+                i=dummy
+                break
+                ;;
+            *_setscene*)
+                i=dummy
+                break
+                ;;
+            *$j|*$j.*)
+                mv $i `echo $i | sed -e "s#${j}#${j}_setscene#"`
+                i=dummy
+                break
+            ;;
+            esac
+        done
+        rm -f $i
+    done
+}
+addtask rm_work after do_${RMWORK_ORIG_TASK}
+
+do_rm_work_all () {
+    :
+}
+do_rm_work_all[recrdeptask] = "do_rm_work"
+addtask rm_work_all after do_rm_work
+
+do_populate_sdk[postfuncs] += "rm_work_populatesdk"
+rm_work_populatesdk () {
+    :
+}
+rm_work_populatesdk[cleandirs] = "${WORKDIR}/sdk"
+
+do_rootfs[postfuncs] += "rm_work_rootfs"
+rm_work_rootfs () {
+    :
+}
+rm_work_rootfs[cleandirs] = "${WORKDIR}/rootfs"
+
+python () {
+    # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe.
+    excludes = (d.getVar("RM_WORK_EXCLUDE", True) or "").split()
+    pn = d.getVar("PN", True)
+    if pn in excludes:
+        d.delVarFlag('rm_work_rootfs', 'cleandirs')
+        d.delVarFlag('rm_work_populatesdk', 'cleandirs')
+}
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
new file mode 100644
index 0000000..d51b458
--- /dev/null
+++ b/meta/classes/rootfs_deb.bbclass
@@ -0,0 +1,39 @@
+#
+# Copyright 2006-2007 Openedhand Ltd.
+#
+
+ROOTFS_PKGMANAGE = "dpkg apt"
+ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
+
+do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
+do_populate_sdk[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot bzip2-native:do_populate_sysroot"
+do_rootfs[recrdeptask] += "do_package_write_deb"
+rootfs_deb_do_rootfs[vardepsexclude] += "BUILDNAME"
+do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
+
+do_rootfs[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
+do_populate_sdk[lockfiles] += "${DEPLOY_DIR_DEB}/deb.lock"
+
+python rootfs_deb_bad_recommendations() {
+    if d.getVar("BAD_RECOMMENDATIONS", True):
+        bb.warn("Debian package install does not support BAD_RECOMMENDATIONS")
+}
+do_rootfs[prefuncs] += "rootfs_deb_bad_recommendations"
+
+DEB_POSTPROCESS_COMMANDS = ""
+
+opkglibdir = "${localstatedir}/lib/opkg"
+
+python () {
+    # Map TARGET_ARCH to Debian's ideas about architectures
+    darch = d.getVar('SDK_ARCH', True)
+    if darch in ["x86", "i486", "i586", "i686", "pentium"]:
+         d.setVar('DEB_SDK_ARCH', 'i386')
+    elif darch == "x86_64":
+         d.setVar('DEB_SDK_ARCH', 'amd64')
+    elif darch == "arm":
+         d.setVar('DEB_SDK_ARCH', 'armel')
+}
+
+# This will of course only work after rootfs_deb_do_rootfs or populate_sdk_deb has been called
+DPKG_QUERY_COMMAND = "${STAGING_BINDIR_NATIVE}/dpkg-query --admindir=$INSTALL_ROOTFS_DEB/var/lib/dpkg"
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
new file mode 100644
index 0000000..dd144e4
--- /dev/null
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -0,0 +1,39 @@
+#
+# Creates a root filesystem out of IPKs
+#
+# This rootfs can be mounted via root-nfs or it can be put into an cramfs/jffs etc.
+# See image.bbclass for a usage of this.
+#
+
+EXTRAOPKGCONFIG ?= ""
+ROOTFS_PKGMANAGE = "opkg ${EXTRAOPKGCONFIG}"
+ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
+
+do_rootfs[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
+do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
+do_rootfs[recrdeptask] += "do_package_write_ipk"
+do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
+rootfs_ipk_do_rootfs[vardepsexclude] += "BUILDNAME"
+
+do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
+do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock"
+
+OPKG_PREPROCESS_COMMANDS = ""
+
+OPKG_POSTPROCESS_COMMANDS = ""
+
+OPKGLIBDIR = "${localstatedir}/lib"
+
+MULTILIBRE_ALLOW_REP = "${OPKGLIBDIR}/opkg|/usr/lib/opkg"
+
+python () {
+
+    if d.getVar('BUILD_IMAGES_FROM_FEEDS', True):
+        flags = d.getVarFlag('do_rootfs', 'recrdeptask')
+        flags = flags.replace("do_package_write_ipk", "")
+        flags = flags.replace("do_deploy", "")
+        flags = flags.replace("do_populate_sysroot", "")
+        d.setVarFlag('do_rootfs', 'recrdeptask', flags)
+        d.setVar('OPKG_PREPROCESS_COMMANDS', "")
+        d.setVar('OPKG_POSTPROCESS_COMMANDS', '')
+}
diff --git a/meta/classes/rootfs_rpm.bbclass b/meta/classes/rootfs_rpm.bbclass
new file mode 100644
index 0000000..d85d001
--- /dev/null
+++ b/meta/classes/rootfs_rpm.bbclass
@@ -0,0 +1,47 @@
+#
+# Creates a root filesystem out of rpm packages
+#
+
+ROOTFS_PKGMANAGE = "rpm smartpm"
+ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
+
+# Add 50Meg of extra space for Smart
+IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("PACKAGE_INSTALL", "smartpm", " + 51200", "" ,d)}"
+
+# Smart is python based, so be sure python-native is available to us.
+EXTRANATIVEPATH += "python-native"
+
+# opkg is needed for update-alternatives
+RPMROOTFSDEPENDS = "rpm-native:do_populate_sysroot \
+    rpmresolve-native:do_populate_sysroot \
+    python-smartpm-native:do_populate_sysroot \
+    createrepo-native:do_populate_sysroot \
+    opkg-native:do_populate_sysroot"
+
+do_rootfs[depends] += "${RPMROOTFSDEPENDS}"
+do_populate_sdk[depends] += "${RPMROOTFSDEPENDS}"
+
+do_rootfs[recrdeptask] += "do_package_write_rpm"
+rootfs_rpm_do_rootfs[vardepsexclude] += "BUILDNAME"
+do_rootfs[vardeps] += "PACKAGE_FEED_URIS"
+
+# RPM doesn't work with multiple rootfs generation at once due to collisions in the use of files 
+# in ${DEPLOY_DIR_RPM}. This can be removed if package_update_index_rpm can be called concurrently
+do_rootfs[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"
+do_populate_sdk[lockfiles] += "${DEPLOY_DIR_RPM}/rpm.lock"
+
+python () {
+    if d.getVar('BUILD_IMAGES_FROM_FEEDS', True):
+        flags = d.getVarFlag('do_rootfs', 'recrdeptask')
+        flags = flags.replace("do_package_write_rpm", "")
+        flags = flags.replace("do_deploy", "")
+        flags = flags.replace("do_populate_sysroot", "")
+        d.setVarFlag('do_rootfs', 'recrdeptask', flags)
+        d.setVar('RPM_PREPROCESS_COMMANDS', '')
+        d.setVar('RPM_POSTPROCESS_COMMANDS', '')
+
+}
+# Smart is python based, so be sure python-native is available to us.
+EXTRANATIVEPATH += "python-native"
+
+rpmlibdir = "/var/lib/rpm"
diff --git a/meta/classes/rootfsdebugfiles.bbclass b/meta/classes/rootfsdebugfiles.bbclass
new file mode 100644
index 0000000..a558871
--- /dev/null
+++ b/meta/classes/rootfsdebugfiles.bbclass
@@ -0,0 +1,36 @@
+# This class installs additional files found on the build host
+# directly into the rootfs.
+#
+# One use case is to install a constant ssh host key in
+# an image that gets created for just one machine. This
+# solves two issues:
+# - host key generation on the device can stall when the
+#   kernel has not gathered enough entropy yet (seen in practice
+#   under qemu)
+# - ssh complains by default when the host key changes
+#
+# For dropbear, with the ssh host key store along side the local.conf:
+# 1. Extend local.conf:
+#    INHERIT += "rootfsdebugfiles"
+#    ROOTFS_DEBUG_FILES += "${TOPDIR}/conf/dropbear_rsa_host_key ${IMAGE_ROOTFS}/etc/dropbear/dropbear_rsa_host_key ;"
+# 2. Boot the image once, copy the dropbear_rsa_host_key from
+#    the device into your build conf directory.
+#
+# Do not use for production images! It bypasses several
+# core build mechanisms (updating the image when one
+# of the files changes, license tracking in the image
+# manifest, ...).
+
+ROOTFS_DEBUG_FILES ?= ""
+ROOTFS_DEBUG_FILES[doc] = "Lists additional files or directories to be installed with 'cp -a' in the format 'source1 target1;source2 target2;...'"
+
+ROOTFS_POSTPROCESS_COMMAND += "rootfs_debug_files ;"
+rootfs_debug_files () {
+   #!/bin/sh -e
+   echo "${ROOTFS_DEBUG_FILES}" | sed -e 's/;/\n/g' | while read source target; do
+      if [ -e "$source" ]; then
+         mkdir -p $(dirname $target)
+         cp -a $source $target
+      fi
+   done
+}
diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
new file mode 100644
index 0000000..2eb744f
--- /dev/null
+++ b/meta/classes/sanity.bbclass
@@ -0,0 +1,945 @@
+#
+# Sanity check the users setup for common misconfigurations
+#
+
+SANITY_REQUIRED_UTILITIES ?= "patch diffstat makeinfo git bzip2 tar \
+    gzip gawk chrpath wget cpio perl"
+
+def bblayers_conf_file(d):
+    return os.path.join(d.getVar('TOPDIR', True), 'conf/bblayers.conf')
+
+def sanity_conf_read(fn):
+    with open(fn, 'r') as f:
+        lines = f.readlines()
+    return lines
+
+def sanity_conf_find_line(pattern, lines):
+    import re
+    return next(((index, line)
+        for index, line in enumerate(lines)
+        if re.search(pattern, line)), (None, None))
+
+def sanity_conf_update(fn, lines, version_var_name, new_version):
+    index, line = sanity_conf_find_line(version_var_name, lines)
+    lines[index] = '%s = "%d"\n' % (version_var_name, new_version)
+    with open(fn, "w") as f:
+        f.write(''.join(lines))
+
+# Functions added to this variable MUST throw an exception (or sys.exit()) unless they
+# successfully changed LCONF_VERSION in bblayers.conf
+BBLAYERS_CONF_UPDATE_FUNCS += "oecore_update_bblayers"
+
+python oecore_update_bblayers() {
+    # bblayers.conf is out of date, so see if we can resolve that
+
+    current_lconf = int(d.getVar('LCONF_VERSION', True))
+    if not current_lconf:
+        sys.exit()
+    lconf_version = int(d.getVar('LAYER_CONF_VERSION', True))
+    lines = []
+
+    if current_lconf < 4:
+        sys.exit()
+
+    bblayers_fn = bblayers_conf_file(d)
+    lines = sanity_conf_read(bblayers_fn)
+
+    if current_lconf == 4 and lconf_version > 4:
+        topdir_var = '$' + '{TOPDIR}'
+        index, bbpath_line = sanity_conf_find_line('BBPATH', lines)
+        if bbpath_line:
+            start = bbpath_line.find('"')
+            if start != -1 and (len(bbpath_line) != (start + 1)):
+                if bbpath_line[start + 1] == '"':
+                    lines[index] = (bbpath_line[:start + 1] +
+                                    topdir_var + bbpath_line[start + 1:])
+                else:
+                    if not topdir_var in bbpath_line:
+                        lines[index] = (bbpath_line[:start + 1] +
+                                    topdir_var + ':' + bbpath_line[start + 1:])
+            else:
+                sys.exit()
+        else:
+            index, bbfiles_line = sanity_conf_find_line('BBFILES', lines)
+            if bbfiles_line:
+                lines.insert(index, 'BBPATH = "' + topdir_var + '"\n')
+            else:
+                sys.exit()
+
+        current_lconf += 1
+        sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf)
+        return
+
+    elif current_lconf == 5 and lconf_version > 5:
+        # Null update, to avoid issues with people switching between poky and other distros
+        current_lconf = 6
+        sanity_conf_update(bblayers_fn, lines, 'LCONF_VERSION', current_lconf)
+        return
+
+    sys.exit()
+}
+
+def raise_sanity_error(msg, d, network_error=False):
+    if d.getVar("SANITY_USE_EVENTS", True) == "1":
+        try:
+            bb.event.fire(bb.event.SanityCheckFailed(msg, network_error), d)
+        except TypeError:
+            bb.event.fire(bb.event.SanityCheckFailed(msg), d)
+        return
+
+    bb.fatal(""" OE-core's config sanity checker detected a potential misconfiguration.
+    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
+    Following is the list of potential problems / advisories:
+    
+    %s""" % msg)
+
+# Check flags associated with a tuning.
+def check_toolchain_tune_args(data, tune, multilib, errs):
+    found_errors = False
+    if check_toolchain_args_present(data, tune, multilib, errs, 'CCARGS'):
+        found_errors = True
+    if check_toolchain_args_present(data, tune, multilib, errs, 'ASARGS'):
+        found_errors = True
+    if check_toolchain_args_present(data, tune, multilib, errs, 'LDARGS'):
+        found_errors = True
+
+    return found_errors
+
+def check_toolchain_args_present(data, tune, multilib, tune_errors, which):
+    args_set = (data.getVar("TUNE_%s" % which, True) or "").split()
+    args_wanted = (data.getVar("TUNEABI_REQUIRED_%s_tune-%s" % (which, tune), True) or "").split()
+    args_missing = []
+
+    # If no args are listed/required, we are done.
+    if not args_wanted:
+        return
+    for arg in args_wanted:
+        if arg not in args_set:
+            args_missing.append(arg)
+
+    found_errors = False
+    if args_missing:
+        found_errors = True
+        tune_errors.append("TUNEABI for %s requires '%s' in TUNE_%s (%s)." %
+                       (tune, ' '.join(args_missing), which, ' '.join(args_set)))
+    return found_errors
+
+# Check a single tune for validity.
+def check_toolchain_tune(data, tune, multilib):
+    tune_errors = []
+    if not tune:
+        return "No tuning found for %s multilib." % multilib
+    localdata = bb.data.createCopy(data)
+    if multilib != "default":
+        # Apply the overrides so we can look at the details.
+        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + multilib
+        localdata.setVar("OVERRIDES", overrides)
+    bb.data.update_data(localdata)
+    bb.debug(2, "Sanity-checking tuning '%s' (%s) features:" % (tune, multilib))
+    features = (localdata.getVar("TUNE_FEATURES_tune-%s" % tune, True) or "").split()
+    if not features:
+        return "Tuning '%s' has no defined features, and cannot be used." % tune
+    valid_tunes = localdata.getVarFlags('TUNEVALID') or {}
+    conflicts = localdata.getVarFlags('TUNECONFLICTS') or {}
+    # [doc] is the documentation for the variable, not a real feature
+    if 'doc' in valid_tunes:
+        del valid_tunes['doc']
+    if 'doc' in conflicts:
+        del conflicts['doc']
+    for feature in features:
+        if feature in conflicts:
+            for conflict in conflicts[feature].split():
+                if conflict in features:
+                    tune_errors.append("Feature '%s' conflicts with '%s'." %
+                        (feature, conflict))
+        if feature in valid_tunes:
+            bb.debug(2, "  %s: %s" % (feature, valid_tunes[feature]))
+        else:
+            tune_errors.append("Feature '%s' is not defined." % feature)
+    whitelist = localdata.getVar("TUNEABI_WHITELIST", True)
+    if whitelist:
+        tuneabi = localdata.getVar("TUNEABI_tune-%s" % tune, True)
+        if not tuneabi:
+            tuneabi = tune
+        if True not in [x in whitelist.split() for x in tuneabi.split()]:
+            tune_errors.append("Tuning '%s' (%s) cannot be used with any supported tuning/ABI." %
+                (tune, tuneabi))
+        else:
+            if not check_toolchain_tune_args(localdata, tuneabi, multilib, tune_errors):
+                bb.debug(2, "Sanity check: Compiler args OK for %s." % tune)
+    if tune_errors:
+        return "Tuning '%s' has the following errors:\n" % tune + '\n'.join(tune_errors)
+
+def check_toolchain(data):
+    tune_error_set = []
+    deftune = data.getVar("DEFAULTTUNE", True)
+    tune_errors = check_toolchain_tune(data, deftune, 'default')
+    if tune_errors:
+        tune_error_set.append(tune_errors)
+
+    multilibs = (data.getVar("MULTILIB_VARIANTS", True) or "").split()
+    global_multilibs = (data.getVar("MULTILIB_GLOBAL_VARIANTS", True) or "").split()
+
+    if multilibs:
+        seen_libs = []
+        seen_tunes = []
+        for lib in multilibs:
+            if lib in seen_libs:
+                tune_error_set.append("The multilib '%s' appears more than once." % lib)
+            else:
+                seen_libs.append(lib)
+            if not lib in global_multilibs:
+                tune_error_set.append("Multilib %s is not present in MULTILIB_GLOBAL_VARIANTS" % lib)
+            tune = data.getVar("DEFAULTTUNE_virtclass-multilib-%s" % lib, True)
+            if tune in seen_tunes:
+                tune_error_set.append("The tuning '%s' appears in more than one multilib." % tune)
+            else:
+                seen_libs.append(tune)
+            if tune == deftune:
+                tune_error_set.append("Multilib '%s' (%s) is also the default tuning." % (lib, deftune))
+            else:
+                tune_errors = check_toolchain_tune(data, tune, lib)
+            if tune_errors:
+                tune_error_set.append(tune_errors)
+    if tune_error_set:
+        return "Toolchain tunings invalid:\n" + '\n'.join(tune_error_set) + "\n"
+
+    return ""
+
+def check_conf_exists(fn, data):
+    bbpath = []
+    fn = data.expand(fn)
+    vbbpath = data.getVar("BBPATH", False)
+    if vbbpath:
+        bbpath += vbbpath.split(":")
+    for p in bbpath:
+        currname = os.path.join(data.expand(p), fn)
+        if os.access(currname, os.R_OK):
+            return True
+    return False
+
+def check_create_long_filename(filepath, pathname):
+    import string, random
+    testfile = os.path.join(filepath, ''.join(random.choice(string.ascii_letters) for x in range(200)))
+    try:
+        if not os.path.exists(filepath):
+            bb.utils.mkdirhier(filepath)
+        f = open(testfile, "w")
+        f.close()
+        os.remove(testfile)
+    except IOError as e:
+        import errno
+        err, strerror = e.args
+        if err == errno.ENAMETOOLONG:
+            return "Failed to create a file with a long name in %s. Please use a filesystem that does not unreasonably limit filename length.\n" % pathname
+        else:
+            return "Failed to create a file in %s: %s.\n" % (pathname, strerror)
+    except OSError as e:
+        errno, strerror = e.args
+        return "Failed to create %s directory in which to run long name sanity check: %s.\n" % (pathname, strerror)
+    return ""
+
+def check_path_length(filepath, pathname, limit):
+    if len(filepath) > limit:
+        return "The length of %s is longer than 410, this would cause unexpected errors, please use a shorter path.\n" % pathname
+    return ""
+
+def get_filesystem_id(path):
+    status, result = oe.utils.getstatusoutput("stat -f -c '%s' %s" % ("%t", path))
+    if status == 0:
+        return result
+    else:
+        bb.warn("Can't get the filesystem id of: %s" % path)
+        return None
+
+# Check that the path isn't located on nfs.
+def check_not_nfs(path, name):
+    # The nfs' filesystem id is 6969
+    if get_filesystem_id(path) == "6969":
+        return "The %s: %s can't be located on nfs.\n" % (name, path)
+    return ""
+
+# Check that path isn't a broken symlink
+def check_symlink(lnk, data):
+    if os.path.islink(lnk) and not os.path.exists(lnk):
+        raise_sanity_error("%s is a broken symlink." % lnk, data)
+
+def check_connectivity(d):
+    # URI's to check can be set in the CONNECTIVITY_CHECK_URIS variable
+    # using the same syntax as for SRC_URI. If the variable is not set
+    # the check is skipped
+    test_uris = (d.getVar('CONNECTIVITY_CHECK_URIS', True) or "").split()
+    retval = ""
+
+    # Only check connectivity if network enabled and the
+    # CONNECTIVITY_CHECK_URIS are set
+    network_enabled = not d.getVar('BB_NO_NETWORK', True)
+    check_enabled = len(test_uris)
+    # Take a copy of the data store and unset MIRRORS and PREMIRRORS
+    data = bb.data.createCopy(d)
+    data.delVar('PREMIRRORS')
+    data.delVar('MIRRORS')
+    if check_enabled and network_enabled:
+        try:
+            fetcher = bb.fetch2.Fetch(test_uris, data)
+            fetcher.checkstatus()
+        except Exception as err:
+            # Allow the message to be configured so that users can be
+            # pointed to a support mechanism.
+            msg = data.getVar('CONNECTIVITY_CHECK_MSG', True) or ""
+            if len(msg) == 0:
+                msg = "%s. Please ensure your network is configured correctly.\n" % err
+            retval = msg
+
+    return retval
+
+def check_supported_distro(sanity_data):
+    from fnmatch import fnmatch
+
+    tested_distros = sanity_data.getVar('SANITY_TESTED_DISTROS', True)
+    if not tested_distros:
+        return
+
+    try:
+        distro = oe.lsb.distro_identifier()
+    except Exception:
+        distro = None
+
+    if not distro:
+        bb.warn('Host distribution could not be determined; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.')
+
+    for supported in [x.strip() for x in tested_distros.split('\\n')]:
+        if fnmatch(distro, supported):
+            return
+
+    bb.warn('Host distribution "%s" has not been validated with this version of the build system; you may possibly experience unexpected failures. It is recommended that you use a tested distribution.' % distro)
+
+# Checks we should only make if MACHINE is set correctly
+def check_sanity_validmachine(sanity_data):
+    messages = ""
+
+    # Check TUNE_ARCH is set
+    if sanity_data.getVar('TUNE_ARCH', True) == 'INVALID':
+        messages = messages + 'TUNE_ARCH is unset. Please ensure your MACHINE configuration includes a valid tune configuration file which will set this correctly.\n'
+
+    # Check TARGET_OS is set
+    if sanity_data.getVar('TARGET_OS', True) == 'INVALID':
+        messages = messages + 'Please set TARGET_OS directly, or choose a MACHINE or DISTRO that does so.\n'
+
+    # Check that we don't have duplicate entries in PACKAGE_ARCHS & that TUNE_PKGARCH is in PACKAGE_ARCHS
+    pkgarchs = sanity_data.getVar('PACKAGE_ARCHS', True)
+    tunepkg = sanity_data.getVar('TUNE_PKGARCH', True)
+    tunefound = False
+    seen = {}
+    dups = []
+
+    for pa in pkgarchs.split():
+        if seen.get(pa, 0) == 1:
+            dups.append(pa)
+        else:
+            seen[pa] = 1
+        if pa == tunepkg:
+            tunefound = True
+
+    if len(dups):
+        messages = messages + "Error, the PACKAGE_ARCHS variable contains duplicates. The following archs are listed more than once: %s" % " ".join(dups)
+
+    if tunefound == False:
+        messages = messages + "Error, the PACKAGE_ARCHS variable does not contain TUNE_PKGARCH (%s)." % tunepkg
+
+    return messages
+
+# Checks if necessary to add option march to host gcc
+def check_gcc_march(sanity_data):
+    result = True
+    message = ""
+
+    # Check if -march not in BUILD_CFLAGS
+    if sanity_data.getVar("BUILD_CFLAGS",True).find("-march") < 0:
+        result = False
+
+        # Construct a test file
+        f = open("gcc_test.c", "w")
+        f.write("int main (){ volatile int atomic = 2; __sync_bool_compare_and_swap (&atomic, 2, 3); return 0; }\n")
+        f.close()
+
+        # Check if GCC could work without march
+        if not result:
+            status,res = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc gcc_test.c -o gcc_test")
+            if status == 0:
+                result = True;
+
+        if not result:
+            status,res = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc -march=native gcc_test.c -o gcc_test")
+            if status == 0:
+                message = "BUILD_CFLAGS_append = \" -march=native\""
+                result = True;
+
+        if not result:
+            build_arch = sanity_data.getVar('BUILD_ARCH', True)
+            status,res = oe.utils.getstatusoutput("${BUILD_PREFIX}gcc -march=%s gcc_test.c -o gcc_test" % build_arch)
+            if status == 0:
+                message = "BUILD_CFLAGS_append = \" -march=%s\"" % build_arch
+                result = True;
+
+        os.remove("gcc_test.c")
+        if os.path.exists("gcc_test"):
+            os.remove("gcc_test")
+
+    return (result, message)
+
+# Unpatched versions of make 3.82 are known to be broken.  See GNU Savannah Bug 30612.
+# Use a modified reproducer from http://savannah.gnu.org/bugs/?30612 to validate.
+def check_make_version(sanity_data):
+    from distutils.version import LooseVersion
+    status, result = oe.utils.getstatusoutput("make --version")
+    if status != 0:
+        return "Unable to execute make --version, exit code %s\n" % status
+    version = result.split()[2]
+    if LooseVersion(version) == LooseVersion("3.82"):
+        # Construct a test file
+        f = open("makefile_test", "w")
+        f.write("makefile_test.a: makefile_test_a.c makefile_test_b.c makefile_test.a( makefile_test_a.c makefile_test_b.c)\n")
+        f.write("\n")
+        f.write("makefile_test_a.c:\n")
+        f.write("	touch $@\n")
+        f.write("\n")
+        f.write("makefile_test_b.c:\n")
+        f.write("	touch $@\n")
+        f.close()
+
+        # Check if make 3.82 has been patched
+        status,result = oe.utils.getstatusoutput("make -f makefile_test")
+
+        os.remove("makefile_test")
+        if os.path.exists("makefile_test_a.c"):
+            os.remove("makefile_test_a.c")
+        if os.path.exists("makefile_test_b.c"):
+            os.remove("makefile_test_b.c")
+        if os.path.exists("makefile_test.a"):
+            os.remove("makefile_test.a")
+
+        if status != 0:
+            return "Your version of make 3.82 is broken. Please revert to 3.81 or install a patched version.\n"
+    return None
+
+
+# Tar version 1.24 and onwards handle overwriting symlinks correctly
+# but earlier versions do not; this needs to work properly for sstate
+def check_tar_version(sanity_data):
+    from distutils.version import LooseVersion
+    status, result = oe.utils.getstatusoutput("tar --version")
+    if status != 0:
+        return "Unable to execute tar --version, exit code %s\n" % status
+    version = result.split()[3]
+    if LooseVersion(version) < LooseVersion("1.24"):
+        return "Your version of tar is older than 1.24 and has bugs which will break builds. Please install a newer version of tar.\n"
+    return None
+
+# We use git parameters and functionality only found in 1.7.8 or later
+def check_git_version(sanity_data):
+    from distutils.version import LooseVersion
+    status, result = oe.utils.getstatusoutput("git --version 2> /dev/null")
+    if status != 0:
+        return "Unable to execute git --version, exit code %s\n" % status
+    version = result.split()[2]
+    if LooseVersion(version) < LooseVersion("1.7.8"):
+        return "Your version of git is older than 1.7.8 and has bugs which will break builds. Please install a newer version of git.\n"
+    return None
+
+# Check the required perl modules which may not be installed by default
+def check_perl_modules(sanity_data):
+    ret = ""
+    modules = ( "Text::ParseWords", "Thread::Queue", "Data::Dumper" )
+    for m in modules:
+        status, result = oe.utils.getstatusoutput("perl -e 'use %s' 2> /dev/null" % m)
+        if status != 0:
+            ret += "%s " % m
+    if ret:
+        return "Required perl module(s) not found: %s\n" % ret
+    return None
+
+def sanity_check_conffiles(status, d):
+    # Check we are using a valid local.conf
+    current_conf  = d.getVar('CONF_VERSION', True)
+    conf_version =  d.getVar('LOCALCONF_VERSION', True)
+
+    if current_conf != conf_version:
+        status.addresult("Your version of local.conf was generated from an older/newer version of local.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/local.conf ${COREBASE}/meta*/conf/local.conf.sample\" is a good way to visualise the changes.\n")
+
+    # Check bblayers.conf is valid
+    current_lconf = d.getVar('LCONF_VERSION', True)
+    lconf_version = d.getVar('LAYER_CONF_VERSION', True)
+    if current_lconf != lconf_version:
+        funcs = d.getVar('BBLAYERS_CONF_UPDATE_FUNCS', True).split()
+        for func in funcs:
+            success = True
+            try:
+                bb.build.exec_func(func, d)
+            except Exception:
+                success = False
+            if success:
+                bb.note("Your conf/bblayers.conf has been automatically updated.")
+                status.reparse = True
+        if not status.reparse:
+            status.addresult("Your version of bblayers.conf has the wrong LCONF_VERSION (has %s, expecting %s).\nPlease compare the your file against bblayers.conf.sample and merge any changes before continuing.\n\"meld conf/bblayers.conf ${COREBASE}/meta*/conf/bblayers.conf.sample\" is a good way to visualise the changes.\n" % (current_lconf, lconf_version))
+
+    # If we have a site.conf, check it's valid
+    if check_conf_exists("conf/site.conf", d):
+        current_sconf = d.getVar('SCONF_VERSION', True)
+        sconf_version = d.getVar('SITE_CONF_VERSION', True)
+        if current_sconf != sconf_version:
+            status.addresult("Your version of site.conf was generated from an older version of site.conf.sample and there have been updates made to this file. Please compare the two files and merge any changes before continuing.\nMatching the version numbers will remove this message.\n\"meld conf/site.conf ${COREBASE}/meta*/conf/site.conf.sample\" is a good way to visualise the changes.\n")
+
+
+def sanity_handle_abichanges(status, d):
+    #
+    # Check the 'ABI' of TMPDIR
+    #
+    import subprocess
+
+    current_abi = d.getVar('OELAYOUT_ABI', True)
+    abifile = d.getVar('SANITY_ABIFILE', True)
+    if os.path.exists(abifile):
+        with open(abifile, "r") as f:
+            abi = f.read().strip()
+        if not abi.isdigit():
+            with open(abifile, "w") as f:
+                f.write(current_abi)
+        elif abi == "2" and current_abi == "3":
+            bb.note("Converting staging from layout version 2 to layout version 3")
+            subprocess.call(d.expand("mv ${TMPDIR}/staging ${TMPDIR}/sysroots"), shell=True)
+            subprocess.call(d.expand("ln -s sysroots ${TMPDIR}/staging"), shell=True)
+            subprocess.call(d.expand("cd ${TMPDIR}/stamps; for i in */*do_populate_staging; do new=`echo $i | sed -e 's/do_populate_staging/do_populate_sysroot/'`; mv $i $new; done"), shell=True)
+            with open(abifile, "w") as f:
+                f.write(current_abi)
+        elif abi == "3" and current_abi == "4":
+            bb.note("Converting staging layout from version 3 to layout version 4")
+            if os.path.exists(d.expand("${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS}")):
+                subprocess.call(d.expand("mv ${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS} ${STAGING_BINDIR_CROSS}"), shell=True)
+                subprocess.call(d.expand("ln -s ${STAGING_BINDIR_CROSS} ${STAGING_DIR_NATIVE}${bindir_native}/${MULTIMACH_HOST_SYS}"), shell=True)
+            with open(abifile, "w") as f:
+                f.write(current_abi)
+        elif abi == "4":
+            status.addresult("Staging layout has changed. The cross directory has been deprecated and cross packages are now built under the native sysroot.\nThis requires a rebuild.\n")
+        elif abi == "5" and current_abi == "6":
+            bb.note("Converting staging layout from version 5 to layout version 6")
+            subprocess.call(d.expand("mv ${TMPDIR}/pstagelogs ${SSTATE_MANIFESTS}"), shell=True)
+            with open(abifile, "w") as f:
+                f.write(current_abi)
+        elif abi == "7" and current_abi == "8":
+            status.addresult("Your configuration is using stamp files including the sstate hash but your build directory was built with stamp files that do not include this.\nTo continue, either rebuild or switch back to the OEBasic signature handler with BB_SIGNATURE_HANDLER = 'OEBasic'.\n")
+        elif (abi != current_abi and current_abi == "9"):
+            status.addresult("The layout of the TMPDIR STAMPS directory has changed. Please clean out TMPDIR and rebuild (sstate will be still be valid and reused)\n")
+        elif (abi != current_abi and current_abi == "10" and (abi == "8" or abi == "9")):
+            bb.note("Converting staging layout from version 8/9 to layout version 10")
+            cmd = d.expand("grep -r -l sysroot-providers/virtual_kernel ${SSTATE_MANIFESTS}")
+            ret, result = oe.utils.getstatusoutput(cmd)
+            result = result.split()
+            for f in result:
+                bb.note("Uninstalling manifest file %s" % f)
+                sstate_clean_manifest(f, d)
+            with open(abifile, "w") as f:
+                f.write(current_abi)
+        elif abi == "10" and current_abi == "11":
+            bb.note("Converting staging layout from version 10 to layout version 11")
+            # Files in xf86-video-modesetting moved to xserver-xorg and bitbake can't currently handle that:
+            subprocess.call(d.expand("rm ${TMPDIR}/sysroots/*/usr/lib/xorg/modules/drivers/modesetting_drv.so ${TMPDIR}/sysroots/*/pkgdata/runtime/xf86-video-modesetting* ${TMPDIR}/sysroots/*/pkgdata/runtime-reverse/xf86-video-modesetting* ${TMPDIR}/sysroots/*/pkgdata/shlibs2/xf86-video-modesetting*"), shell=True)
+            with open(abifile, "w") as f:
+                f.write(current_abi)
+        elif (abi != current_abi):
+            # Code to convert from one ABI to another could go here if possible.
+            status.addresult("Error, TMPDIR has changed its layout version number (%s to %s) and you need to either rebuild, revert or adjust it at your own risk.\n" % (abi, current_abi))
+    else:
+        with open(abifile, "w") as f:
+            f.write(current_abi)
+
+def check_sanity_sstate_dir_change(sstate_dir, data):
+    # Sanity checks to be done when the value of SSTATE_DIR changes
+
+    # Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS)
+    testmsg = ""
+    if sstate_dir != "":
+        testmsg = check_create_long_filename(sstate_dir, "SSTATE_DIR")
+        # If we don't have permissions to SSTATE_DIR, suggest the user set it as an SSTATE_MIRRORS
+        try:
+            err = testmsg.split(': ')[1].strip()
+            if err == "Permission denied.":
+                testmsg = testmsg + "You could try using %s in SSTATE_MIRRORS rather than as an SSTATE_CACHE.\n" % (sstate_dir)
+        except IndexError:
+            pass
+    return testmsg
+       
+def check_sanity_version_change(status, d):
+    # Sanity checks to be done when SANITY_VERSION changes
+    # In other words, these tests run once in a given build directory and then 
+    # never again until the sanity version changes.
+
+    # Check the python install is complete. glib-2.0-natives requries
+    # xml.parsers.expat
+    try:
+        import xml.parsers.expat
+    except ImportError:
+        status.addresult('Your python is not a full install. Please install the module xml.parsers.expat (python-xml on openSUSE and SUSE Linux).\n')
+    import stat
+
+    status.addresult(check_make_version(d))
+    status.addresult(check_tar_version(d))
+    status.addresult(check_git_version(d))
+    status.addresult(check_perl_modules(d))
+
+    missing = ""
+
+    if not check_app_exists("${MAKE}", d):
+        missing = missing + "GNU make,"
+
+    if not check_app_exists('${BUILD_PREFIX}gcc', d):
+        missing = missing + "C Compiler (%sgcc)," % d.getVar("BUILD_PREFIX", True)
+
+    if not check_app_exists('${BUILD_PREFIX}g++', d):
+        missing = missing + "C++ Compiler (%sg++)," % d.getVar("BUILD_PREFIX", True)
+
+    required_utilities = d.getVar('SANITY_REQUIRED_UTILITIES', True)
+
+    for util in required_utilities.split():
+        if not check_app_exists(util, d):
+            missing = missing + "%s," % util
+
+    if missing:
+        missing = missing.rstrip(',')
+        status.addresult("Please install the following missing utilities: %s\n" % missing)
+
+    assume_provided = d.getVar('ASSUME_PROVIDED', True).split()
+    # Check user doesn't have ASSUME_PROVIDED = instead of += in local.conf
+    if "diffstat-native" not in assume_provided:
+        status.addresult('Please use ASSUME_PROVIDED +=, not ASSUME_PROVIDED = in your local.conf\n')
+
+    if "qemu-native" in assume_provided:
+        if not check_app_exists("qemu-arm", d):
+            status.addresult("qemu-native was in ASSUME_PROVIDED but the QEMU binaries (qemu-arm) can't be found in PATH")
+
+    if "libsdl-native" in assume_provided:
+        if not check_app_exists("sdl-config", d):
+            status.addresult("libsdl-native is set to be ASSUME_PROVIDED but sdl-config can't be found in PATH. Please either install it, or configure qemu not to require sdl.")
+
+    (result, message) = check_gcc_march(d)
+    if result and message:
+        status.addresult("Your gcc version is older than 4.5, please add the following param to local.conf\n \
+        %s\n" % message)
+    if not result:
+        status.addresult("Your gcc version is older than 4.5 or is not working properly.  Please verify you can build")
+        status.addresult(" and link something that uses atomic operations, such as: \n")
+        status.addresult("        __sync_bool_compare_and_swap (&atomic, 2, 3);\n")
+
+    # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)
+    tmpdir = d.getVar('TMPDIR', True)
+    status.addresult(check_create_long_filename(tmpdir, "TMPDIR"))
+    tmpdirmode = os.stat(tmpdir).st_mode
+    if (tmpdirmode & stat.S_ISGID):
+        status.addresult("TMPDIR is setgid, please don't build in a setgid directory")
+    if (tmpdirmode & stat.S_ISUID):
+        status.addresult("TMPDIR is setuid, please don't build in a setuid directory")
+
+    # Some third-party software apparently relies on chmod etc. being suid root (!!)
+    import stat
+    suid_check_bins = "chown chmod mknod".split()
+    for bin_cmd in suid_check_bins:
+        bin_path = bb.utils.which(os.environ["PATH"], bin_cmd)
+        if bin_path:
+            bin_stat = os.stat(bin_path)
+            if bin_stat.st_uid == 0 and bin_stat.st_mode & stat.S_ISUID:
+                status.addresult('%s has the setuid bit set. This interferes with pseudo and may cause other issues that break the build process.\n' % bin_path)
+
+    # Check that we can fetch from various network transports
+    netcheck = check_connectivity(d)
+    status.addresult(netcheck)
+    if netcheck:
+        status.network_error = True
+
+    nolibs = d.getVar('NO32LIBS', True)
+    if not nolibs:
+        lib32path = '/lib'
+        if os.path.exists('/lib64') and ( os.path.islink('/lib64') or os.path.islink('/lib') ):
+           lib32path = '/lib32'
+
+        if os.path.exists('%s/libc.so.6' % lib32path) and not os.path.exists('/usr/include/gnu/stubs-32.h'):
+            status.addresult("You have a 32-bit libc, but no 32-bit headers.  You must install the 32-bit libc headers.\n")
+
+    bbpaths = d.getVar('BBPATH', True).split(":")
+    if ("." in bbpaths or "./" in bbpaths or "" in bbpaths) and not status.reparse:
+        status.addresult("BBPATH references the current directory, either through "    \
+                "an empty entry, a './' or a '.'.\n\t This is unsafe and means your "\
+                "layer configuration is adding empty elements to BBPATH.\n\t "\
+                "Please check your layer.conf files and other BBPATH "        \
+                "settings to remove the current working directory "           \
+                "references.\n" \
+                "Parsed BBPATH is" + str(bbpaths));
+
+    oes_bb_conf = d.getVar( 'OES_BITBAKE_CONF', True)
+    if not oes_bb_conf:
+        status.addresult('You are not using the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n')
+
+    # The length of TMPDIR can't be longer than 410
+    status.addresult(check_path_length(tmpdir, "TMPDIR", 410))
+
+    # Check that TMPDIR isn't located on nfs
+    status.addresult(check_not_nfs(tmpdir, "TMPDIR"))
+
+def check_sanity_everybuild(status, d):
+    import os, stat
+    # Sanity tests which test the users environment so need to run at each build (or are so cheap
+    # it makes sense to always run them.
+
+    if 0 == os.getuid():
+        raise_sanity_error("Do not use Bitbake as root.", d)
+
+    # Check the Python version, we now have a minimum of Python 2.7.3
+    import sys
+    if sys.hexversion < 0x020703F0:
+        status.addresult('The system requires at least Python 2.7.3 to run. Please update your Python interpreter.\n')
+
+    # Check the bitbake version meets minimum requirements
+    from distutils.version import LooseVersion
+    minversion = d.getVar('BB_MIN_VERSION', True)
+    if (LooseVersion(bb.__version__) < LooseVersion(minversion)):
+        status.addresult('Bitbake version %s is required and version %s was found\n' % (minversion, bb.__version__))
+
+    sanity_check_conffiles(status, d)
+
+    paths = d.getVar('PATH', True).split(":")
+    if "." in paths or "./" in paths or "" in paths:
+        status.addresult("PATH contains '.', './' or '' (empty element), which will break the build, please remove this.\nParsed PATH is " + str(paths) + "\n")
+
+    # Check that the DISTRO is valid, if set
+    # need to take into account DISTRO renaming DISTRO
+    distro = d.getVar('DISTRO', True)
+    if distro and distro != "nodistro":
+        if not ( check_conf_exists("conf/distro/${DISTRO}.conf", d) or check_conf_exists("conf/distro/include/${DISTRO}.inc", d) ):
+            status.addresult("DISTRO '%s' not found. Please set a valid DISTRO in your local.conf\n" % d.getVar("DISTRO", True))
+
+    # Check that DL_DIR is set, exists and is writable. In theory, we should never even hit the check if DL_DIR isn't 
+    # set, since so much relies on it being set.
+    dldir = d.getVar('DL_DIR', True)
+    if not dldir:
+        status.addresult("DL_DIR is not set. Your environment is misconfigured, check that DL_DIR is set, and if the directory exists, that it is writable. \n")
+    if os.path.exists(dldir) and not os.access(dldir, os.W_OK):
+        status.addresult("DL_DIR: %s exists but you do not appear to have write access to it. \n" % dldir)
+    check_symlink(dldir, d)
+
+    # Check that the MACHINE is valid, if it is set
+    machinevalid = True
+    if d.getVar('MACHINE', True):
+        if not check_conf_exists("conf/machine/${MACHINE}.conf", d):
+            status.addresult('Please set a valid MACHINE in your local.conf or environment\n')
+            machinevalid = False
+        else:
+            status.addresult(check_sanity_validmachine(d))
+    else:
+        status.addresult('Please set a MACHINE in your local.conf or environment\n')
+        machinevalid = False
+    if machinevalid:
+        status.addresult(check_toolchain(d))
+
+    # Check that the SDKMACHINE is valid, if it is set
+    if d.getVar('SDKMACHINE', True):
+        if not check_conf_exists("conf/machine-sdk/${SDKMACHINE}.conf", d):
+            status.addresult('Specified SDKMACHINE value is not valid\n')
+        elif d.getVar('SDK_ARCH', False) == "${BUILD_ARCH}":
+            status.addresult('SDKMACHINE is set, but SDK_ARCH has not been changed as a result - SDKMACHINE may have been set too late (e.g. in the distro configuration)\n')
+
+    check_supported_distro(d)
+
+    # Check if DISPLAY is set if TEST_IMAGE is set
+    if d.getVar('TEST_IMAGE', True) == '1' or d.getVar('DEFAULT_TEST_SUITES', True):
+        testtarget = d.getVar('TEST_TARGET', True)
+        if testtarget == 'qemu' or testtarget == 'QemuTarget':
+            display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True)
+            if not display:
+                status.addresult('testimage needs an X desktop to start qemu, please set DISPLAY correctly (e.g. DISPLAY=:1.0)\n')
+
+    omask = os.umask(022)
+    if omask & 0755:
+        status.addresult("Please use a umask which allows a+rx and u+rwx\n")
+    os.umask(omask)
+
+    if d.getVar('TARGET_ARCH', True) == "arm":
+        # This path is no longer user-readable in modern (very recent) Linux
+        try:
+            if os.path.exists("/proc/sys/vm/mmap_min_addr"):
+                f = open("/proc/sys/vm/mmap_min_addr", "r")
+                try:
+                    if (int(f.read().strip()) > 65536):
+                        status.addresult("/proc/sys/vm/mmap_min_addr is not <= 65536. This will cause problems with qemu so please fix the value (as root).\n\nTo fix this in later reboots, set vm.mmap_min_addr = 65536 in /etc/sysctl.conf.\n")
+                finally:
+                    f.close()
+        except:
+            pass
+
+    oeroot = d.getVar('COREBASE', True)
+    if oeroot.find('+') != -1:
+        status.addresult("Error, you have an invalid character (+) in your COREBASE directory path. Please move the installation to a directory which doesn't include any + characters.")
+    if oeroot.find('@') != -1:
+        status.addresult("Error, you have an invalid character (@) in your COREBASE directory path. Please move the installation to a directory which doesn't include any @ characters.")
+    if oeroot.find(' ') != -1:
+        status.addresult("Error, you have a space in your COREBASE directory path. Please move the installation to a directory which doesn't include a space since autotools doesn't support this.")
+
+    # Check the format of MIRRORS, PREMIRRORS and SSTATE_MIRRORS
+    import re
+    mirror_vars = ['MIRRORS', 'PREMIRRORS', 'SSTATE_MIRRORS']
+    protocols = ['http', 'ftp', 'file', 'https', \
+                 'git', 'gitsm', 'hg', 'osc', 'p4', 'svn', \
+                 'bzr', 'cvs']
+    for mirror_var in mirror_vars:
+        mirrors = (d.getVar(mirror_var, True) or '').replace('\\n', '\n').split('\n')
+        for mirror_entry in mirrors:
+            mirror_entry = mirror_entry.strip()
+            if not mirror_entry:
+                # ignore blank lines
+                continue
+
+            try:
+                pattern, mirror = mirror_entry.split()
+            except ValueError:
+                bb.warn('Invalid %s: %s, should be 2 members.' % (mirror_var, mirror_entry.strip()))
+                continue
+
+            decoded = bb.fetch2.decodeurl(pattern)
+            try:
+                pattern_scheme = re.compile(decoded[0])
+            except re.error as exc:
+                bb.warn('Invalid scheme regex (%s) in %s; %s' % (pattern, mirror_var, mirror_entry))
+                continue
+
+            if not any(pattern_scheme.match(protocol) for protocol in protocols):
+                bb.warn('Invalid protocol (%s) in %s: %s' % (decoded[0], mirror_var, mirror_entry))
+                continue
+
+            if not any(mirror.startswith(protocol + '://') for protocol in protocols):
+                bb.warn('Invalid protocol in %s: %s' % (mirror_var, mirror_entry))
+                continue
+
+            if mirror.startswith('file://'):
+                import urlparse
+                check_symlink(urlparse.urlparse(mirror).path, d)
+                # SSTATE_MIRROR ends with a /PATH string
+                if mirror.endswith('/PATH'):
+                    # remove /PATH$ from SSTATE_MIRROR to get a working
+                    # base directory path
+                    mirror_base = urlparse.urlparse(mirror[:-1*len('/PATH')]).path
+                    check_symlink(mirror_base, d)
+
+    # Check that TMPDIR hasn't changed location since the last time we were run
+    tmpdir = d.getVar('TMPDIR', True)
+    checkfile = os.path.join(tmpdir, "saved_tmpdir")
+    if os.path.exists(checkfile):
+        with open(checkfile, "r") as f:
+            saved_tmpdir = f.read().strip()
+            if (saved_tmpdir != tmpdir):
+                status.addresult("Error, TMPDIR has changed location. You need to either move it back to %s or rebuild\n" % saved_tmpdir)
+    else:
+        bb.utils.mkdirhier(tmpdir)
+        # Remove setuid, setgid and sticky bits from TMPDIR
+        os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISUID)
+        os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISGID)
+        os.chmod(tmpdir, os.stat(tmpdir).st_mode & ~ stat.S_ISVTX)
+        with open(checkfile, "w") as f:
+            f.write(tmpdir)
+
+    # Check vmdk and live can't be built together.
+    if 'vmdk' in d.getVar('IMAGE_FSTYPES', True) and 'live' in d.getVar('IMAGE_FSTYPES', True):
+        status.addresult("Error, IMAGE_FSTYPES vmdk and live can't be built together\n")
+
+    # Check vdi and live can't be built together.
+    if 'vdi' in d.getVar('IMAGE_FSTYPES', True) and 'live' in d.getVar('IMAGE_FSTYPES', True):
+        status.addresult("Error, IMAGE_FSTYPES vdi and live can't be built together\n")
+
+    # Check qcow2 and live can't be built together.
+    if 'qcow2' in d.getVar('IMAGE_FSTYPES', True) and 'live' in d.getVar('IMAGE_FSTYPES', True):
+        status.addresult("Error, IMAGE_FSTYPES qcow2 and live can't be built together\n")
+
+    # Check /bin/sh links to dash or bash
+    real_sh = os.path.realpath('/bin/sh')
+    if not real_sh.endswith('/dash') and not real_sh.endswith('/bash'):
+        status.addresult("Error, /bin/sh links to %s, must be dash or bash\n" % real_sh)
+
+def check_sanity(sanity_data):
+    class SanityStatus(object):
+        def __init__(self):
+            self.messages = ""
+            self.network_error = False
+            self.reparse = False
+
+        def addresult(self, message):
+            if message:
+                self.messages = self.messages + message
+
+    status = SanityStatus()
+
+    tmpdir = sanity_data.getVar('TMPDIR', True)
+    sstate_dir = sanity_data.getVar('SSTATE_DIR', True)
+
+    check_symlink(sstate_dir, sanity_data)
+
+    # Check saved sanity info
+    last_sanity_version = 0
+    last_tmpdir = ""
+    last_sstate_dir = ""
+    sanityverfile = sanity_data.expand("${TOPDIR}/conf/sanity_info")
+    if os.path.exists(sanityverfile):
+        with open(sanityverfile, 'r') as f:
+            for line in f:
+                if line.startswith('SANITY_VERSION'):
+                    last_sanity_version = int(line.split()[1])
+                if line.startswith('TMPDIR'):
+                    last_tmpdir = line.split()[1]
+                if line.startswith('SSTATE_DIR'):
+                    last_sstate_dir = line.split()[1]
+
+    check_sanity_everybuild(status, sanity_data)
+    
+    sanity_version = int(sanity_data.getVar('SANITY_VERSION', True) or 1)
+    network_error = False
+    if last_sanity_version < sanity_version: 
+        check_sanity_version_change(status, sanity_data)
+        status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data))
+    else: 
+        if last_sstate_dir != sstate_dir:
+            status.addresult(check_sanity_sstate_dir_change(sstate_dir, sanity_data))
+
+    if os.path.exists(os.path.dirname(sanityverfile)) and not status.messages:
+        with open(sanityverfile, 'w') as f:
+            f.write("SANITY_VERSION %s\n" % sanity_version) 
+            f.write("TMPDIR %s\n" % tmpdir) 
+            f.write("SSTATE_DIR %s\n" % sstate_dir) 
+
+    sanity_handle_abichanges(status, sanity_data)
+
+    if status.messages != "":
+        raise_sanity_error(sanity_data.expand(status.messages), sanity_data, status.network_error)
+    return status.reparse
+
+# Create a copy of the datastore and finalise it to ensure appends and 
+# overrides are set - the datastore has yet to be finalised at ConfigParsed
+def copy_data(e):
+    sanity_data = bb.data.createCopy(e.data)
+    sanity_data.finalize()
+    return sanity_data
+
+addhandler check_sanity_eventhandler
+check_sanity_eventhandler[eventmask] = "bb.event.SanityCheck bb.event.NetworkTest"
+python check_sanity_eventhandler() {
+    if bb.event.getName(e) == "SanityCheck":
+        sanity_data = copy_data(e)
+        if e.generateevents:
+            sanity_data.setVar("SANITY_USE_EVENTS", "1")
+        reparse = check_sanity(sanity_data)
+        e.data.setVar("BB_INVALIDCONF", reparse)
+        bb.event.fire(bb.event.SanityCheckPassed(), e.data)
+    elif bb.event.getName(e) == "NetworkTest":
+        sanity_data = copy_data(e)
+        if e.generateevents:
+            sanity_data.setVar("SANITY_USE_EVENTS", "1")
+        bb.event.fire(bb.event.NetworkTestFailed() if check_connectivity(sanity_data) else bb.event.NetworkTestPassed(), e.data)
+
+    return
+}
diff --git a/meta/classes/scons.bbclass b/meta/classes/scons.bbclass
new file mode 100644
index 0000000..b8de822
--- /dev/null
+++ b/meta/classes/scons.bbclass
@@ -0,0 +1,15 @@
+DEPENDS += "python-scons-native"
+
+EXTRA_OESCONS ?= ""
+
+scons_do_compile() {
+        ${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} prefix=${prefix} ${EXTRA_OESCONS} || \
+        die "scons build execution failed."
+}
+
+scons_do_install() {
+        ${STAGING_BINDIR_NATIVE}/scons PREFIX=${D}${prefix} prefix=${D}${prefix} install ${EXTRA_OESCONS}|| \
+        die "scons install execution failed."
+}
+
+EXPORT_FUNCTIONS do_compile do_install
diff --git a/meta/classes/sdl.bbclass b/meta/classes/sdl.bbclass
new file mode 100644
index 0000000..cc31288
--- /dev/null
+++ b/meta/classes/sdl.bbclass
@@ -0,0 +1,6 @@
+#
+# (C) Michael 'Mickey' Lauer <mickey@Vanille.de>
+#
+
+DEPENDS += "virtual/libsdl libsdl-mixer libsdl-image"
+SECTION = "x11/games"
diff --git a/meta/classes/setuptools.bbclass b/meta/classes/setuptools.bbclass
new file mode 100644
index 0000000..56343b1
--- /dev/null
+++ b/meta/classes/setuptools.bbclass
@@ -0,0 +1,8 @@
+inherit distutils
+
+DEPENDS += "python-distribute-native"
+
+DISTUTILS_INSTALL_ARGS = "--root=${D} \
+    --prefix=${prefix} \
+    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
+    --install-data=${datadir}"
diff --git a/meta/classes/setuptools3.bbclass b/meta/classes/setuptools3.bbclass
new file mode 100644
index 0000000..de6dd94
--- /dev/null
+++ b/meta/classes/setuptools3.bbclass
@@ -0,0 +1,8 @@
+inherit distutils3
+
+DEPENDS += "python3-setuptools-native"
+
+DISTUTILS_INSTALL_ARGS = "--root=${D} \
+    --prefix=${prefix} \
+    --install-lib=${PYTHON_SITEPACKAGES_DIR} \
+    --install-data=${datadir}"
diff --git a/meta/classes/sign_rpm.bbclass b/meta/classes/sign_rpm.bbclass
new file mode 100644
index 0000000..0aa4cd8
--- /dev/null
+++ b/meta/classes/sign_rpm.bbclass
@@ -0,0 +1,75 @@
+# Class for generating signed RPM packages.
+#
+# Configuration variables used by this class:
+# RPM_GPG_PASSPHRASE_FILE
+#           Path to a file containing the passphrase of the signing key.
+# RPM_GPG_NAME
+#           Name of the key to sign with. Alternatively you can define
+#           %_gpg_name macro in your ~/.oerpmmacros file.
+# RPM_GPG_PUBKEY
+#           Path to a file containing the public key (in "armor" format)
+#           corresponding the signing key.
+# GPG_BIN
+#           Optional variable for specifying the gpg binary/wrapper to use for
+#           signing.
+#
+inherit sanity
+
+RPM_SIGN_PACKAGES='1'
+
+
+_check_gpg_name () {
+    macrodef=`rpm -E '%_gpg_name'`
+    [ "$macrodef" == "%_gpg_name" ] && return 1 || return 0
+}
+
+
+def rpmsign_wrapper(d, files, passphrase, gpg_name=None):
+    import pexpect
+
+    # Find the correct rpm binary
+    rpm_bin_path = d.getVar('STAGING_BINDIR_NATIVE', True) + '/rpm'
+    cmd = rpm_bin_path + " --addsign "
+    if gpg_name:
+        cmd += "--define '%%_gpg_name %s' " % gpg_name
+    else:
+        try:
+            bb.build.exec_func('_check_gpg_name', d)
+        except bb.build.FuncFailed:
+            raise_sanity_error("You need to define RPM_GPG_NAME in bitbake "
+                               "config or the %_gpg_name RPM macro defined "
+                               "(e.g. in  ~/.oerpmmacros", d)
+    if d.getVar('GPG_BIN', True):
+        cmd += "--define '%%__gpg %s' " % d.getVar('GPG_BIN', True)
+    cmd += ' '.join(files)
+
+    # Need to use pexpect for feeding the passphrase
+    proc = pexpect.spawn(cmd)
+    try:
+        proc.expect_exact('Enter pass phrase:', timeout=15)
+        proc.sendline(passphrase)
+        proc.expect(pexpect.EOF, timeout=900)
+        proc.close()
+    except pexpect.TIMEOUT as err:
+        bb.debug('rpmsign timeout: %s' % err)
+        proc.terminate()
+    return proc.exitstatus
+
+
+python sign_rpm () {
+    import glob
+
+    rpm_gpg_pass_file = (d.getVar("RPM_GPG_PASSPHRASE_FILE", True) or "")
+    if rpm_gpg_pass_file:
+        with open(rpm_gpg_pass_file) as fobj:
+            rpm_gpg_passphrase = fobj.readlines()[0].rstrip('\n')
+    else:
+        raise_sanity_error("You need to define RPM_GPG_PASSPHRASE_FILE in the config", d)
+
+    rpm_gpg_name = (d.getVar("RPM_GPG_NAME", True) or "")
+
+    rpms = glob.glob(d.getVar('RPM_PKGWRITEDIR', True) + '/*')
+
+    if rpmsign_wrapper(d, rpms, rpm_gpg_passphrase, rpm_gpg_name) != 0:
+        raise bb.build.FuncFailed("RPM signing failed")
+}
diff --git a/meta/classes/sip.bbclass b/meta/classes/sip.bbclass
new file mode 100644
index 0000000..6ed2a13
--- /dev/null
+++ b/meta/classes/sip.bbclass
@@ -0,0 +1,61 @@
+# Build Class for Sip based Python Bindings
+# (C) Michael 'Mickey' Lauer <mickey@Vanille.de>
+#
+STAGING_SIPDIR ?= "${STAGING_DATADIR_NATIVE}/sip"
+
+DEPENDS  =+ "sip-native"
+RDEPENDS_${PN} += "python-sip"
+
+# default stuff, do not uncomment
+# EXTRA_SIPTAGS = "-tWS_X11 -tQt_4_3_0"
+
+# do_generate is before do_configure so ensure that sip_native is populated in sysroot before executing it
+do_generate[depends] += "sip-native:do_populate_sysroot"
+
+sip_do_generate() {
+	if [ -z "${SIP_MODULES}" ]; then 
+		MODULES="`ls sip/*mod.sip`"
+	else
+		MODULES="${SIP_MODULES}"
+	fi
+
+	if [ -z "$MODULES" ]; then
+		die "SIP_MODULES not set and no modules found in $PWD"
+        else
+		bbnote "using modules '${SIP_MODULES}' and tags '${EXTRA_SIPTAGS}'"
+	fi
+
+	if [ -z "${EXTRA_SIPTAGS}" ]; then
+		die "EXTRA_SIPTAGS needs to be set!"
+	else
+		SIPTAGS="${EXTRA_SIPTAGS}"
+	fi
+
+	if [ ! -z "${SIP_FEATURES}" ]; then
+		FEATURES="-z ${SIP_FEATURES}"
+		bbnote "sip feature file: ${SIP_FEATURES}"
+	fi
+
+	for module in $MODULES
+	do
+		install -d ${module}/
+		echo "calling 'sip4 -I sip -I ${STAGING_SIPDIR} ${SIPTAGS} ${FEATURES} -c ${module} -b ${module}/${module}.pro.in sip/${module}/${module}mod.sip'"
+		sip4 -I ${STAGING_SIPDIR} -I sip ${SIPTAGS} ${FEATURES} -c ${module} -b ${module}/${module}.sbf \
+			sip/${module}/${module}mod.sip || die "Error calling sip on ${module}"
+		sed -e 's,target,TARGET,' -e 's,sources,SOURCES,' -e 's,headers,HEADERS,' \
+			${module}/${module}.sbf | sed s,"moc_HEADERS =","HEADERS +=", \
+			>${module}/${module}.pro
+		echo "TEMPLATE=lib" >>${module}/${module}.pro
+		[ "${module}" = "qt" ] 		&& echo "" 		>>${module}/${module}.pro
+		[ "${module}" = "qtcanvas" ] 	&& echo ""		>>${module}/${module}.pro
+		[ "${module}" = "qttable" ] 	&& echo ""		>>${module}/${module}.pro
+		[ "${module}" = "qwt" ] 	&& echo ""		>>${module}/${module}.pro
+		[ "${module}" = "qtpe" ]        && echo ""		>>${module}/${module}.pro
+		[ "${module}" = "qtpe" ]        && echo "LIBS+=-lqpe"	>>${module}/${module}.pro
+		true
+	done
+}
+
+EXPORT_FUNCTIONS do_generate
+
+addtask generate after do_unpack do_patch before do_configure
diff --git a/meta/classes/siteconfig.bbclass b/meta/classes/siteconfig.bbclass
new file mode 100644
index 0000000..45dce48
--- /dev/null
+++ b/meta/classes/siteconfig.bbclass
@@ -0,0 +1,33 @@
+python siteconfig_do_siteconfig () {
+	shared_state = sstate_state_fromvars(d)
+	if shared_state['task'] != 'populate_sysroot':
+		return
+	if not os.path.isdir(os.path.join(d.getVar('FILE_DIRNAME', True), 'site_config')):
+		bb.debug(1, "No site_config directory, skipping do_siteconfig")
+		return
+	bb.build.exec_func('do_siteconfig_gencache', d)
+	sstate_clean(shared_state, d)
+	sstate_install(shared_state, d)
+}
+
+EXTRASITECONFIG ?= ""
+
+siteconfig_do_siteconfig_gencache () {
+	mkdir -p ${WORKDIR}/site_config_${MACHINE}
+	gen-site-config ${FILE_DIRNAME}/site_config \
+		>${WORKDIR}/site_config_${MACHINE}/configure.ac
+	cd ${WORKDIR}/site_config_${MACHINE}
+	autoconf
+	rm -f ${BPN}_cache
+	CONFIG_SITE="" ${EXTRASITECONFIG} ./configure ${CONFIGUREOPTS} --cache-file ${BPN}_cache
+	sed -n -e "/ac_cv_c_bigendian/p" -e "/ac_cv_sizeof_/p" \
+		-e "/ac_cv_type_/p" -e "/ac_cv_header_/p" -e "/ac_cv_func_/p" \
+		< ${BPN}_cache > ${BPN}_config
+	mkdir -p ${SYSROOT_DESTDIR}${datadir}/${TARGET_SYS}_config_site.d
+	cp ${BPN}_config ${SYSROOT_DESTDIR}${datadir}/${TARGET_SYS}_config_site.d
+
+}
+
+do_populate_sysroot[sstate-interceptfuncs] += "do_siteconfig "
+
+EXPORT_FUNCTIONS do_siteconfig do_siteconfig_gencache
diff --git a/meta/classes/siteinfo.bbclass b/meta/classes/siteinfo.bbclass
new file mode 100644
index 0000000..9f6eac4
--- /dev/null
+++ b/meta/classes/siteinfo.bbclass
@@ -0,0 +1,171 @@
+# This class exists to provide information about the targets that
+# may be needed by other classes and/or recipes. If you add a new
+# target this will probably need to be updated.
+
+#
+# Returns information about 'what' for the named target 'target'
+# where 'target' == "<arch>-<os>"
+#
+# 'what' can be one of
+# * target: Returns the target name ("<arch>-<os>")
+# * endianess: Return "be" for big endian targets, "le" for little endian
+# * bits: Returns the bit size of the target, either "32" or "64"
+# * libc: Returns the name of the c library used by the target
+#
+# It is an error for the target not to exist.
+# If 'what' doesn't exist then an empty value is returned
+#
+def siteinfo_data(d):
+    archinfo = {
+        "allarch": "endian-little bit-32", # bogus, but better than special-casing the checks below for allarch
+        "aarch64": "endian-little bit-64 arm-common arm-64",
+        "aarch64_be": "endian-big bit-64 arm-common arm-64",
+        "arm": "endian-little bit-32 arm-common arm-32",
+        "armeb": "endian-big bit-32 arm-common arm-32",
+        "avr32": "endian-big bit-32 avr32-common",
+        "bfin": "endian-little bit-32 bfin-common",
+        "epiphany": "endian-little bit-32",
+        "i386": "endian-little bit-32 ix86-common",
+        "i486": "endian-little bit-32 ix86-common",
+        "i586": "endian-little bit-32 ix86-common",
+        "i686": "endian-little bit-32 ix86-common",
+        "ia64": "endian-little bit-64",
+        "microblaze": "endian-big bit-32 microblaze-common",
+        "microblazeeb": "endian-big bit-32 microblaze-common",
+        "microblazeel": "endian-little bit-32 microblaze-common",
+        "mips": "endian-big bit-32 mips-common",
+        "mips64": "endian-big bit-64 mips-common",
+        "mips64el": "endian-little bit-64 mips-common",
+        "mipsel": "endian-little bit-32 mips-common",
+        "powerpc": "endian-big bit-32 powerpc-common",
+        "nios2": "endian-little bit-32 nios2-common",
+        "powerpc64": "endian-big bit-64 powerpc-common",
+        "ppc": "endian-big bit-32 powerpc-common",
+        "ppc64": "endian-big bit-64 powerpc-common",
+        "sh3": "endian-little bit-32 sh-common",
+        "sh4": "endian-little bit-32 sh-common",
+        "sparc": "endian-big bit-32",
+        "viac3": "endian-little bit-32 ix86-common",
+        "x86_64": "endian-little", # bitinfo specified in targetinfo
+    }
+    osinfo = {
+        "darwin": "common-darwin",
+        "darwin9": "common-darwin",
+        "linux": "common-linux common-glibc",
+        "linux-gnu": "common-linux common-glibc",
+        "linux-gnux32": "common-linux common-glibc",
+        "linux-gnun32": "common-linux common-glibc",
+        "linux-gnueabi": "common-linux common-glibc",
+        "linux-gnuspe": "common-linux common-glibc",
+        "linux-uclibc": "common-linux common-uclibc",
+        "linux-uclibceabi": "common-linux common-uclibc",
+        "linux-uclibcspe": "common-linux common-uclibc",
+        "linux-musl": "common-linux common-musl",
+        "linux-musleabi": "common-linux common-musl",
+        "linux-muslspe": "common-linux common-musl",
+        "uclinux-uclibc": "common-uclibc",
+        "cygwin": "common-cygwin",
+        "mingw32": "common-mingw",
+    }
+    targetinfo = {
+        "aarch64-linux-gnu": "aarch64-linux",
+        "aarch64_be-linux-gnu": "aarch64_be-linux",
+        "arm-linux-gnueabi": "arm-linux",
+        "arm-linux-musleabi": "arm-linux",
+        "arm-linux-uclibceabi": "arm-linux-uclibc",
+        "armeb-linux-gnueabi": "armeb-linux",
+        "armeb-linux-uclibceabi": "armeb-linux-uclibc",
+        "armeb-linux-musleabi": "armeb-linux",
+        "mips-linux-musl": "mips-linux",
+        "mipsel-linux-musl": "mipsel-linux",
+        "mips64-linux-musl": "mips-linux",
+        "mips64el-linux-musl": "mipsel-linux",
+        "mips64-linux-gnun32": "mips-linux bit-32",
+        "mips64el-linux-gnun32": "mipsel-linux bit-32",
+        "powerpc-linux": "powerpc32-linux",
+        "powerpc-linux-musl": "powerpc-linux powerpc32-linux",
+        "powerpc-linux-uclibc": "powerpc-linux powerpc32-linux",
+        "powerpc-linux-gnuspe": "powerpc-linux powerpc32-linux",
+        "powerpc-linux-muslspe": "powerpc-linux powerpc32-linux",
+        "powerpc-linux-uclibcspe": "powerpc-linux powerpc32-linux powerpc-linux-uclibc",
+        "powerpc64-linux-gnuspe": "powerpc-linux powerpc64-linux",
+        "powerpc64-linux-muslspe": "powerpc-linux powerpc64-linux",
+        "powerpc64-linux": "powerpc-linux",
+        "x86_64-cygwin": "bit-64",
+        "x86_64-darwin": "bit-64",
+        "x86_64-darwin9": "bit-64",
+        "x86_64-linux": "bit-64",
+        "x86_64-linux-musl": "x86_64-linux bit-64",
+        "x86_64-linux-uclibc": "bit-64",
+        "x86_64-elf": "bit-64",
+        "x86_64-linux-gnu": "bit-64 x86_64-linux",
+        "x86_64-linux-gnux32": "bit-32 ix86-common x32-linux",
+        "x86_64-mingw32": "bit-64",
+    }
+
+    hostarch = d.getVar("HOST_ARCH", True)
+    hostos = d.getVar("HOST_OS", True)
+    target = "%s-%s" % (hostarch, hostos)
+
+    sitedata = []
+    if hostarch in archinfo:
+        sitedata.extend(archinfo[hostarch].split())
+    if hostos in osinfo:
+        sitedata.extend(osinfo[hostos].split())
+    if target in targetinfo:
+        sitedata.extend(targetinfo[target].split())
+    sitedata.append(target)
+    sitedata.append("common")
+
+    bb.debug(1, "SITE files %s" % sitedata);
+    return sitedata
+
+python () {
+    sitedata = set(siteinfo_data(d))
+    if "endian-little" in sitedata:
+        d.setVar("SITEINFO_ENDIANNESS", "le")
+    elif "endian-big" in sitedata:
+        d.setVar("SITEINFO_ENDIANNESS", "be")
+    else:
+        bb.error("Unable to determine endianness for architecture '%s'" %
+                 d.getVar("HOST_ARCH", True))
+        bb.fatal("Please add your architecture to siteinfo.bbclass")
+
+    if "bit-32" in sitedata:
+        d.setVar("SITEINFO_BITS", "32")
+    elif "bit-64" in sitedata:
+        d.setVar("SITEINFO_BITS", "64")
+    else:
+        bb.error("Unable to determine bit size for architecture '%s'" %
+                 d.getVar("HOST_ARCH", True))
+        bb.fatal("Please add your architecture to siteinfo.bbclass")
+}
+
+def siteinfo_get_files(d, no_cache = False):
+    sitedata = siteinfo_data(d)
+    sitefiles = ""
+    for path in d.getVar("BBPATH", True).split(":"):
+        for element in sitedata:
+            filename = os.path.join(path, "site", element)
+            if os.path.exists(filename):
+                sitefiles += filename + " "
+
+    if no_cache: return sitefiles
+
+    # Now check for siteconfig cache files
+    # Use the files copied to the aclocal cache generated by autotools.bbclass
+    # to avoid races
+    path_siteconfig = d.getVar('ACLOCALDIR', True)
+    if path_siteconfig and os.path.isdir(path_siteconfig):
+        for i in os.listdir(path_siteconfig):
+            if not i.endswith("_config"):
+                continue
+            filename = os.path.join(path_siteconfig, i)
+            sitefiles += filename + " "
+
+    return sitefiles
+
+#
+# Make some information available via variables
+#
+SITECONFIG_SYSROOTCACHE = "${STAGING_DATADIR}/${TARGET_SYS}_config_site.d"
diff --git a/meta/classes/spdx.bbclass b/meta/classes/spdx.bbclass
new file mode 100644
index 0000000..454c53e
--- /dev/null
+++ b/meta/classes/spdx.bbclass
@@ -0,0 +1,365 @@
+# This class integrates real-time license scanning, generation of SPDX standard
+# output and verifiying license info during the building process.
+# It is a combination of efforts from the OE-Core, SPDX and Fossology projects.
+#
+# For more information on FOSSology:
+#   http://www.fossology.org
+#
+# For more information on FOSSologySPDX commandline:
+#   https://github.com/spdx-tools/fossology-spdx/wiki/Fossology-SPDX-Web-API
+#
+# For more information on SPDX:
+#   http://www.spdx.org
+#
+
+# SPDX file will be output to the path which is defined as[SPDX_MANIFEST_DIR] 
+# in ./meta/conf/licenses.conf.
+
+SPDXSSTATEDIR = "${WORKDIR}/spdx_sstate_dir"
+
+# If ${S} isn't actually the top-level source directory, set SPDX_S to point at
+# the real top-level directory.
+SPDX_S ?= "${S}"
+
+python do_spdx () {
+    import os, sys
+    import json, shutil
+
+    info = {} 
+    info['workdir'] = d.getVar('WORKDIR', True)
+    info['sourcedir'] = d.getVar('SPDX_S', True)
+    info['pn'] = d.getVar('PN', True)
+    info['pv'] = d.getVar('PV', True)
+    info['spdx_version'] = d.getVar('SPDX_VERSION', True)
+    info['data_license'] = d.getVar('DATA_LICENSE', True)
+
+    sstatedir = d.getVar('SPDXSSTATEDIR', True)
+    sstatefile = os.path.join(sstatedir, info['pn'] + info['pv'] + ".spdx")
+
+    manifest_dir = d.getVar('SPDX_MANIFEST_DIR', True)
+    info['outfile'] = os.path.join(manifest_dir, info['pn'] + ".spdx" )
+
+    info['spdx_temp_dir'] = d.getVar('SPDX_TEMP_DIR', True)
+    info['tar_file'] = os.path.join(info['workdir'], info['pn'] + ".tar.gz" )
+
+    # Make sure important dirs exist
+    try:
+        bb.utils.mkdirhier(manifest_dir)
+        bb.utils.mkdirhier(sstatedir)
+        bb.utils.mkdirhier(info['spdx_temp_dir'])
+    except OSError as e:
+        bb.error("SPDX: Could not set up required directories: " + str(e))
+        return
+
+    ## get everything from cache.  use it to decide if 
+    ## something needs to be rerun 
+    cur_ver_code = get_ver_code(info['sourcedir'])
+    cache_cur = False
+    if os.path.exists(sstatefile):
+        ## cache for this package exists. read it in
+        cached_spdx = get_cached_spdx(sstatefile)
+
+        if cached_spdx['PackageVerificationCode'] == cur_ver_code:
+            bb.warn("SPDX: Verification code for " + info['pn']
+                  + "is same as cache's. do nothing")
+            cache_cur = True
+        else:
+            local_file_info = setup_foss_scan(info, True, cached_spdx['Files'])
+    else:
+        local_file_info = setup_foss_scan(info, False, None)
+
+    if cache_cur:
+        spdx_file_info = cached_spdx['Files']
+        foss_package_info = cached_spdx['Package']
+        foss_license_info = cached_spdx['Licenses']
+    else:
+        ## setup fossology command
+        foss_server = d.getVar('FOSS_SERVER', True)
+        foss_flags = d.getVar('FOSS_WGET_FLAGS', True)
+        foss_full_spdx = d.getVar('FOSS_FULL_SPDX', True) == "true" or False
+        foss_command = "wget %s --post-file=%s %s"\
+            % (foss_flags, info['tar_file'], foss_server)
+        
+        foss_result = run_fossology(foss_command, foss_full_spdx)
+        if foss_result is not None:
+            (foss_package_info, foss_file_info, foss_license_info) = foss_result
+            spdx_file_info = create_spdx_doc(local_file_info, foss_file_info)
+            ## write to cache
+            write_cached_spdx(sstatefile, cur_ver_code, foss_package_info,
+                              spdx_file_info, foss_license_info)
+        else:
+            bb.error("SPDX: Could not communicate with FOSSology server. Command was: " + foss_command)
+            return
+    
+    ## Get document and package level information
+    spdx_header_info = get_header_info(info, cur_ver_code, foss_package_info)
+    
+    ## CREATE MANIFEST
+    create_manifest(info, spdx_header_info, spdx_file_info, foss_license_info)
+
+    ## clean up the temp stuff
+    shutil.rmtree(info['spdx_temp_dir'], ignore_errors=True)
+    if os.path.exists(info['tar_file']):
+        remove_file(info['tar_file'])
+}
+addtask spdx after do_patch before do_configure
+
+def create_manifest(info, header, files, licenses):
+    import codecs
+    with codecs.open(info['outfile'], mode='w', encoding='utf-8') as f:
+        # Write header
+        f.write(header + '\n')
+
+        # Write file data
+        for chksum, block in files.iteritems():
+            f.write("FileName: " + block['FileName'] + '\n')
+            for key, value in block.iteritems():
+                if not key == 'FileName':
+                    f.write(key + ": " + value + '\n')
+            f.write('\n')
+
+        # Write license data
+        for id, block in licenses.iteritems():
+            f.write("LicenseID: " + id + '\n')
+            for key, value in block.iteritems():
+                f.write(key + ": " + value + '\n')
+            f.write('\n')
+
+def get_cached_spdx(sstatefile):
+    import json
+    import codecs
+    cached_spdx_info = {}
+    with codecs.open(sstatefile, mode='r', encoding='utf-8') as f:
+        try:
+            cached_spdx_info = json.load(f)
+        except ValueError as e:
+            cached_spdx_info = None
+    return cached_spdx_info
+
+def write_cached_spdx(sstatefile, ver_code, package_info, files, license_info):
+    import json
+    import codecs
+    spdx_doc = {}
+    spdx_doc['PackageVerificationCode'] = ver_code
+    spdx_doc['Files'] = {}
+    spdx_doc['Files'] = files
+    spdx_doc['Package'] = {}
+    spdx_doc['Package'] = package_info
+    spdx_doc['Licenses'] = {}
+    spdx_doc['Licenses'] = license_info
+    with codecs.open(sstatefile, mode='w', encoding='utf-8') as f:
+        f.write(json.dumps(spdx_doc))
+
+def setup_foss_scan(info, cache, cached_files):
+    import errno, shutil
+    import tarfile
+    file_info = {}
+    cache_dict = {}
+
+    for f_dir, f in list_files(info['sourcedir']):
+        full_path = os.path.join(f_dir, f)
+        abs_path = os.path.join(info['sourcedir'], full_path)
+        dest_dir = os.path.join(info['spdx_temp_dir'], f_dir)
+        dest_path = os.path.join(info['spdx_temp_dir'], full_path)
+
+        checksum = hash_file(abs_path)
+        if not checksum is None:
+            file_info[checksum] = {}
+            ## retain cache information if it exists
+            if cache and checksum in cached_files:
+                file_info[checksum] = cached_files[checksum]
+            ## have the file included in what's sent to the FOSSology server
+            else:
+                file_info[checksum]['FileName'] = full_path
+                try:
+                    bb.utils.mkdirhier(dest_dir)
+                    shutil.copyfile(abs_path, dest_path)
+                except OSError as e:
+                    bb.warn("SPDX: mkdirhier failed: " + str(e))
+                except shutil.Error as e:
+                    bb.warn("SPDX: copyfile failed: " + str(e))
+                except IOError as e:
+                    bb.warn("SPDX: copyfile failed: " + str(e))
+        else:
+            bb.warn("SPDX: Could not get checksum for file: " + f)
+    
+    with tarfile.open(info['tar_file'], "w:gz") as tar:
+        tar.add(info['spdx_temp_dir'], arcname=os.path.basename(info['spdx_temp_dir']))
+    
+    return file_info
+
+def remove_file(file_name):
+    try:
+        os.remove(file_name)
+    except OSError as e:
+        pass
+
+def list_files(dir):
+    for root, subFolders, files in os.walk(dir):
+        for f in files:
+            rel_root = os.path.relpath(root, dir)
+            yield rel_root, f
+    return
+
+def hash_file(file_name):
+    try:
+        with open(file_name, 'rb') as f:
+            data_string = f.read()
+            sha1 = hash_string(data_string)
+            return sha1
+    except:
+        return None
+
+def hash_string(data):
+    import hashlib
+    sha1 = hashlib.sha1()
+    sha1.update(data)
+    return sha1.hexdigest()
+
+def run_fossology(foss_command, full_spdx):
+    import string, re
+    import subprocess
+    
+    p = subprocess.Popen(foss_command.split(),
+        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+    foss_output, foss_error = p.communicate()
+    if p.returncode != 0:
+        return None
+
+    foss_output = unicode(foss_output, "utf-8")
+    foss_output = string.replace(foss_output, '\r', '')
+
+    # Package info
+    package_info = {}
+    if full_spdx:
+        # All mandatory, only one occurance
+        package_info['PackageCopyrightText'] = re.findall('PackageCopyrightText: (.*?</text>)', foss_output, re.S)[0]
+        package_info['PackageLicenseDeclared'] = re.findall('PackageLicenseDeclared: (.*)', foss_output)[0]
+        package_info['PackageLicenseConcluded'] = re.findall('PackageLicenseConcluded: (.*)', foss_output)[0]
+        # These may be more than one
+        package_info['PackageLicenseInfoFromFiles'] = re.findall('PackageLicenseInfoFromFiles: (.*)', foss_output)
+    else:
+        DEFAULT = "NOASSERTION"
+        package_info['PackageCopyrightText'] = "<text>" + DEFAULT + "</text>"
+        package_info['PackageLicenseDeclared'] = DEFAULT
+        package_info['PackageLicenseConcluded'] = DEFAULT
+        package_info['PackageLicenseInfoFromFiles'] = []
+
+    # File info
+    file_info = {}
+    records = []
+    # FileName is also in PackageFileName, so we match on FileType as well.
+    records = re.findall('FileName:.*?FileType:.*?</text>', foss_output, re.S)
+    for rec in records:
+        chksum = re.findall('FileChecksum: SHA1: (.*)\n', rec)[0]
+        file_info[chksum] = {}
+        file_info[chksum]['FileCopyrightText'] = re.findall('FileCopyrightText: '
+            + '(.*?</text>)', rec, re.S )[0]
+        fields = ['FileName', 'FileType', 'LicenseConcluded', 'LicenseInfoInFile']
+        for field in fields:
+            file_info[chksum][field] = re.findall(field + ': (.*)', rec)[0]
+
+    # Licenses
+    license_info = {}
+    licenses = []
+    licenses = re.findall('LicenseID:.*?LicenseName:.*?\n', foss_output, re.S)
+    for lic in licenses:
+        license_id = re.findall('LicenseID: (.*)\n', lic)[0]
+        license_info[license_id] = {}
+        license_info[license_id]['ExtractedText'] = re.findall('ExtractedText: (.*?</text>)', lic, re.S)[0]
+        license_info[license_id]['LicenseName'] = re.findall('LicenseName: (.*)', lic)[0]
+
+    return (package_info, file_info, license_info)
+
+def create_spdx_doc(file_info, scanned_files):
+    import json
+    ## push foss changes back into cache
+    for chksum, lic_info in scanned_files.iteritems():
+        if chksum in file_info:
+            file_info[chksum]['FileType'] = lic_info['FileType']
+            file_info[chksum]['FileChecksum: SHA1'] = chksum
+            file_info[chksum]['LicenseInfoInFile'] = lic_info['LicenseInfoInFile']
+            file_info[chksum]['LicenseConcluded'] = lic_info['LicenseConcluded']
+            file_info[chksum]['FileCopyrightText'] = lic_info['FileCopyrightText']
+        else:
+            bb.warn("SPDX: " + lic_info['FileName'] + " : " + chksum
+                + " : is not in the local file info: "
+                + json.dumps(lic_info, indent=1))
+    return file_info
+
+def get_ver_code(dirname):
+    chksums = []
+    for f_dir, f in list_files(dirname):
+        hash = hash_file(os.path.join(dirname, f_dir, f))
+        if not hash is None:
+            chksums.append(hash)
+        else:
+            bb.warn("SPDX: Could not hash file: " + path)
+    ver_code_string = ''.join(chksums).lower()
+    ver_code = hash_string(ver_code_string)
+    return ver_code
+
+def get_header_info(info, spdx_verification_code, package_info):
+    """
+        Put together the header SPDX information.
+        Eventually this needs to become a lot less
+        of a hardcoded thing.
+    """
+    from datetime import datetime
+    import os
+    head = []
+    DEFAULT = "NOASSERTION"
+
+    package_checksum = hash_file(info['tar_file'])
+    if package_checksum is None:
+        package_checksum = DEFAULT
+
+    ## document level information
+    head.append("## SPDX Document Information")
+    head.append("SPDXVersion: " + info['spdx_version'])
+    head.append("DataLicense: " + info['data_license'])
+    head.append("DocumentComment: <text>SPDX for "
+        + info['pn'] + " version " + info['pv'] + "</text>")
+    head.append("")
+
+    ## Creator information
+    ## Note that this does not give time in UTC.
+    now = datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ')
+    head.append("## Creation Information")
+    ## Tools are supposed to have a version, but FOSSology+SPDX provides none.
+    head.append("Creator: Tool: FOSSology+SPDX")
+    head.append("Created: " + now)
+    head.append("CreatorComment: <text>UNO</text>")
+    head.append("")
+
+    ## package level information
+    head.append("## Package Information")
+    head.append("PackageName: " + info['pn'])
+    head.append("PackageVersion: " + info['pv'])
+    head.append("PackageFileName: " + os.path.basename(info['tar_file']))
+    head.append("PackageSupplier: Person:" + DEFAULT)
+    head.append("PackageDownloadLocation: " + DEFAULT)
+    head.append("PackageSummary: <text></text>")
+    head.append("PackageOriginator: Person:" + DEFAULT)
+    head.append("PackageChecksum: SHA1: " + package_checksum)
+    head.append("PackageVerificationCode: " + spdx_verification_code)
+    head.append("PackageDescription: <text>" + info['pn']
+        + " version " + info['pv'] + "</text>")
+    head.append("")
+    head.append("PackageCopyrightText: "
+        + package_info['PackageCopyrightText'])
+    head.append("")
+    head.append("PackageLicenseDeclared: "
+        + package_info['PackageLicenseDeclared'])
+    head.append("PackageLicenseConcluded: "
+        + package_info['PackageLicenseConcluded'])
+
+    for licref in package_info['PackageLicenseInfoFromFiles']:
+        head.append("PackageLicenseInfoFromFiles: " + licref)
+    head.append("")
+    
+    ## header for file level
+    head.append("## File Information")
+    head.append("")
+
+    return '\n'.join(head)
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
new file mode 100644
index 0000000..b9ad6da
--- /dev/null
+++ b/meta/classes/sstate.bbclass
@@ -0,0 +1,951 @@
+SSTATE_VERSION = "3"
+
+SSTATE_MANIFESTS ?= "${TMPDIR}/sstate-control"
+SSTATE_MANFILEPREFIX = "${SSTATE_MANIFESTS}/manifest-${SSTATE_MANMACH}-${PN}"
+
+def generate_sstatefn(spec, hash, d):
+    if not hash:
+        hash = "INVALID"
+    return hash[:2] + "/" + spec + hash
+
+SSTATE_PKGARCH    = "${PACKAGE_ARCH}"
+SSTATE_PKGSPEC    = "sstate:${PN}:${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}:${PV}:${PR}:${SSTATE_PKGARCH}:${SSTATE_VERSION}:"
+SSTATE_SWSPEC     = "sstate:${BPN}::${PV}:${PR}::${SSTATE_VERSION}:"
+SSTATE_PKGNAME    = "${SSTATE_EXTRAPATH}${@generate_sstatefn(d.getVar('SSTATE_PKGSPEC', True), d.getVar('BB_TASKHASH', True), d)}"
+SSTATE_PKG        = "${SSTATE_DIR}/${SSTATE_PKGNAME}"
+SSTATE_EXTRAPATH   = ""
+SSTATE_EXTRAPATHWILDCARD = ""
+SSTATE_PATHSPEC   = "${SSTATE_DIR}/${SSTATE_EXTRAPATHWILDCARD}*/${SSTATE_PKGSPEC}"
+
+# We don't want the sstate to depend on things like the distro string
+# of the system, we let the sstate paths take care of this.
+SSTATE_EXTRAPATH[vardepvalue] = ""
+
+# For multilib rpm the allarch packagegroup files can overwrite (in theory they're identical)
+SSTATE_DUPWHITELIST = "${DEPLOY_DIR_IMAGE}/ ${DEPLOY_DIR}/licenses/ ${DEPLOY_DIR_RPM}/all/"
+# Avoid docbook/sgml catalog warnings for now
+SSTATE_DUPWHITELIST += "${STAGING_ETCDIR_NATIVE}/sgml ${STAGING_DATADIR_NATIVE}/sgml"
+# Archive the sources for many architectures in one deploy folder
+SSTATE_DUPWHITELIST += "${DEPLOY_DIR_SRC}"
+
+SSTATE_SCAN_FILES ?= "*.la *-config *_config"
+SSTATE_SCAN_CMD ?= 'find ${SSTATE_BUILDDIR} \( -name "${@"\" -o -name \"".join(d.getVar("SSTATE_SCAN_FILES", True).split())}" \) -type f'
+
+BB_HASHFILENAME = "${SSTATE_EXTRAPATH} ${SSTATE_PKGSPEC} ${SSTATE_SWSPEC}"
+
+SSTATE_ARCHS = " \
+    ${BUILD_ARCH} \
+    ${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS} \
+    ${BUILD_ARCH}_${TARGET_ARCH} \
+    ${SDK_ARCH}_${SDK_OS} \
+    ${SDK_ARCH}_${PACKAGE_ARCH} \
+    allarch \
+    ${PACKAGE_ARCH} \
+    ${MACHINE}"
+
+SSTATE_MANMACH ?= "${SSTATE_PKGARCH}"
+
+SSTATECREATEFUNCS = "sstate_hardcode_path"
+SSTATEPOSTCREATEFUNCS = ""
+SSTATEPREINSTFUNCS = ""
+SSTATEPOSTUNPACKFUNCS = "sstate_hardcode_path_unpack"
+SSTATEPOSTINSTFUNCS = ""
+EXTRA_STAGING_FIXMES ?= ""
+
+SIGGEN_LOCKEDSIGS_CHECK_LEVEL ?= 'error'
+
+# The GnuPG key ID and passphrase to use to sign sstate archives (or unset to
+# not sign)
+SSTATE_SIG_KEY ?= ""
+SSTATE_SIG_PASSPHRASE ?= ""
+# Whether to verify the GnUPG signatures when extracting sstate archives
+SSTATE_VERIFY_SIG ?= "0"
+
+# Specify dirs in which the shell function is executed and don't use ${B}
+# as default dirs to avoid possible race about ${B} with other task.
+sstate_create_package[dirs] = "${SSTATE_BUILDDIR}"
+sstate_unpack_package[dirs] = "${SSTATE_INSTDIR}"
+
+# Do not run sstate_hardcode_path() in ${B}:
+# the ${B} maybe removed by cmake_do_configure() while
+# sstate_hardcode_path() running.
+sstate_hardcode_path[dirs] = "${SSTATE_BUILDDIR}"
+
+python () {
+    if bb.data.inherits_class('native', d):
+        d.setVar('SSTATE_PKGARCH', d.getVar('BUILD_ARCH', False))
+    elif bb.data.inherits_class('crosssdk', d):
+        d.setVar('SSTATE_PKGARCH', d.expand("${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS}"))
+    elif bb.data.inherits_class('cross', d):
+        d.setVar('SSTATE_PKGARCH', d.expand("${BUILD_ARCH}_${TARGET_ARCH}"))
+    elif bb.data.inherits_class('nativesdk', d):
+        d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${SDK_OS}"))
+    elif bb.data.inherits_class('cross-canadian', d):
+        d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${PACKAGE_ARCH}"))
+    elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH", True) == "all":
+        d.setVar('SSTATE_PKGARCH', "allarch")
+    else:
+        d.setVar('SSTATE_MANMACH', d.expand("${PACKAGE_ARCH}"))
+
+    if bb.data.inherits_class('native', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross', d):
+        d.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/")
+        d.setVar('SSTATE_EXTRAPATHWILDCARD', "*/")
+
+    # These classes encode staging paths into their scripts data so can only be
+    # reused if we manipulate the paths
+    if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('sdk', d) or bb.data.inherits_class('crosssdk', d):
+        scan_cmd = "grep -Irl ${STAGING_DIR} ${SSTATE_BUILDDIR}"
+        d.setVar('SSTATE_SCAN_CMD', scan_cmd)
+
+    unique_tasks = set((d.getVar('SSTATETASKS', True) or "").split())
+    d.setVar('SSTATETASKS', " ".join(unique_tasks))
+    for task in unique_tasks:
+        d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ")
+        d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc")
+}
+
+def sstate_init(task, d):
+    ss = {}
+    ss['task'] = task
+    ss['dirs'] = []
+    ss['plaindirs'] = []
+    ss['lockfiles'] = []
+    ss['lockfiles-shared'] = []
+    return ss
+
+def sstate_state_fromvars(d, task = None):
+    if task is None:
+        task = d.getVar('BB_CURRENTTASK', True)
+        if not task:
+            bb.fatal("sstate code running without task context?!")
+        task = task.replace("_setscene", "")
+
+    if task.startswith("do_"):
+        task = task[3:]
+    inputs = (d.getVarFlag("do_" + task, 'sstate-inputdirs', True) or "").split()
+    outputs = (d.getVarFlag("do_" + task, 'sstate-outputdirs', True) or "").split()
+    plaindirs = (d.getVarFlag("do_" + task, 'sstate-plaindirs', True) or "").split()
+    lockfiles = (d.getVarFlag("do_" + task, 'sstate-lockfile', True) or "").split()
+    lockfilesshared = (d.getVarFlag("do_" + task, 'sstate-lockfile-shared', True) or "").split()
+    interceptfuncs = (d.getVarFlag("do_" + task, 'sstate-interceptfuncs', True) or "").split()
+    if not task or len(inputs) != len(outputs):
+        bb.fatal("sstate variables not setup correctly?!")
+
+    if task == "populate_lic":
+        d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}")
+        d.setVar("SSTATE_EXTRAPATH", "")
+
+    ss = sstate_init(task, d)
+    for i in range(len(inputs)):
+        sstate_add(ss, inputs[i], outputs[i], d)
+    ss['lockfiles'] = lockfiles
+    ss['lockfiles-shared'] = lockfilesshared
+    ss['plaindirs'] = plaindirs
+    ss['interceptfuncs'] = interceptfuncs
+    return ss
+
+def sstate_add(ss, source, dest, d):
+    if not source.endswith("/"):
+         source = source + "/"
+    if not dest.endswith("/"):
+         dest = dest + "/"
+    source = os.path.normpath(source)
+    dest = os.path.normpath(dest)
+    srcbase = os.path.basename(source)
+    ss['dirs'].append([srcbase, source, dest])
+    return ss
+
+def sstate_install(ss, d):
+    import oe.path
+    import oe.sstatesig
+    import subprocess
+
+    sharedfiles = []
+    shareddirs = []
+    bb.utils.mkdirhier(d.expand("${SSTATE_MANIFESTS}"))
+
+    manifest, d2 = oe.sstatesig.sstate_get_manifest_filename(ss['task'], d)
+
+    if os.access(manifest, os.R_OK):
+        bb.fatal("Package already staged (%s)?!" % manifest)
+
+    locks = []
+    for lock in ss['lockfiles-shared']:
+        locks.append(bb.utils.lockfile(lock, True))
+    for lock in ss['lockfiles']:
+        locks.append(bb.utils.lockfile(lock))
+
+    for state in ss['dirs']:
+        bb.debug(2, "Staging files from %s to %s" % (state[1], state[2]))
+        for walkroot, dirs, files in os.walk(state[1]):
+            for file in files:
+                srcpath = os.path.join(walkroot, file)
+                dstpath = srcpath.replace(state[1], state[2])
+                #bb.debug(2, "Staging %s to %s" % (srcpath, dstpath))
+                sharedfiles.append(dstpath)
+            for dir in dirs:
+                srcdir = os.path.join(walkroot, dir)
+                dstdir = srcdir.replace(state[1], state[2])
+                #bb.debug(2, "Staging %s to %s" % (srcdir, dstdir))
+                if not dstdir.endswith("/"):
+                    dstdir = dstdir + "/"
+                shareddirs.append(dstdir)
+
+    # Check the file list for conflicts against files which already exist
+    whitelist = (d.getVar("SSTATE_DUPWHITELIST", True) or "").split()
+    match = []
+    for f in sharedfiles:
+        if os.path.exists(f):
+            f = os.path.normpath(f)
+            realmatch = True
+            for w in whitelist:
+                if f.startswith(w):
+                    realmatch = False
+                    break
+            if realmatch:
+                match.append(f)
+                sstate_search_cmd = "grep -rl '%s' %s --exclude=master.list | sed -e 's:^.*/::' -e 's:\.populate-sysroot::'" % (f, d.expand("${SSTATE_MANIFESTS}"))
+                search_output = subprocess.Popen(sstate_search_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
+                if search_output != "":
+                    match.append("Matched in %s" % search_output.rstrip())
+    if match:
+        bb.error("The recipe %s is trying to install files into a shared " \
+          "area when those files already exist. Those files and their manifest " \
+          "location are:\n   %s\nPlease verify which recipe should provide the " \
+          "above files.\nThe build has stopped as continuing in this scenario WILL " \
+          "break things, if not now, possibly in the future (we've seen builds fail " \
+          "several months later). If the system knew how to recover from this " \
+          "automatically it would however there are several different scenarios " \
+          "which can result in this and we don't know which one this is. It may be " \
+          "you have switched providers of something like virtual/kernel (e.g. from " \
+          "linux-yocto to linux-yocto-dev), in that case you need to execute the " \
+          "clean task for both recipes and it will resolve this error. It may be " \
+          "you changed DISTRO_FEATURES from systemd to udev or vice versa. Cleaning " \
+          "those recipes should again resolve this error however switching " \
+          "DISTRO_FEATURES on an existing build directory is not supported, you " \
+          "should really clean out tmp and rebuild (reusing sstate should be safe). " \
+          "It could be the overlapping files detected are harmless in which case " \
+          "adding them to SSTATE_DUPWHITELIST may be the correct solution. It could " \
+          "also be your build is including two different conflicting versions of " \
+          "things (e.g. bluez 4 and bluez 5 and the correct solution for that would " \
+          "be to resolve the conflict. If in doubt, please ask on the mailing list, " \
+          "sharing the error and filelist above." % \
+          (d.getVar('PN', True), "\n ".join(match)))
+        bb.fatal("If the above message is too much, the simpler version is you're advised to wipe out tmp and rebuild (reusing sstate is fine). That will likely fix things in most (but not all) cases.")
+
+    # Write out the manifest
+    f = open(manifest, "w")
+    for file in sharedfiles:
+        f.write(file + "\n")
+
+    # We want to ensure that directories appear at the end of the manifest
+    # so that when we test to see if they should be deleted any contents
+    # added by the task will have been removed first.
+    dirs = sorted(shareddirs, key=len)
+    # Must remove children first, which will have a longer path than the parent
+    for di in reversed(dirs):
+        f.write(di + "\n")
+    f.close()
+
+    # Append to the list of manifests for this PACKAGE_ARCH
+
+    i = d2.expand("${SSTATE_MANIFESTS}/index-${SSTATE_MANMACH}")
+    l = bb.utils.lockfile(i + ".lock")
+    filedata = d.getVar("STAMP", True) + " " + d2.getVar("SSTATE_MANFILEPREFIX", True) + " " + d.getVar("WORKDIR", True) + "\n"
+    manifests = []
+    if os.path.exists(i):
+        with open(i, "r") as f:
+            manifests = f.readlines()
+    if filedata not in manifests:
+        with open(i, "a+") as f:
+            f.write(filedata)
+    bb.utils.unlockfile(l)
+
+    # Run the actual file install
+    for state in ss['dirs']:
+        if os.path.exists(state[1]):
+            oe.path.copyhardlinktree(state[1], state[2])
+
+    for postinst in (d.getVar('SSTATEPOSTINSTFUNCS', True) or '').split():
+        bb.build.exec_func(postinst, d)
+
+    for lock in locks:
+        bb.utils.unlockfile(lock)
+
+sstate_install[vardepsexclude] += "SSTATE_DUPWHITELIST STATE_MANMACH SSTATE_MANFILEPREFIX"
+sstate_install[vardeps] += "${SSTATEPOSTINSTFUNCS}"
+
+def sstate_installpkg(ss, d):
+    import oe.path
+    import subprocess
+
+    def prepdir(dir):
+        # remove dir if it exists, ensure any parent directories do exist
+        if os.path.exists(dir):
+            oe.path.remove(dir)
+        bb.utils.mkdirhier(dir)
+        oe.path.remove(dir)
+
+    sstateinst = d.expand("${WORKDIR}/sstate-install-%s/" % ss['task'])
+    sstatefetch = d.getVar('SSTATE_PKGNAME', True) + '_' + ss['task'] + ".tgz"
+    sstatepkg = d.getVar('SSTATE_PKG', True) + '_' + ss['task'] + ".tgz"
+
+    if not os.path.exists(sstatepkg):
+        pstaging_fetch(sstatefetch, sstatepkg, d)
+
+    if not os.path.isfile(sstatepkg):
+        bb.note("Staging package %s does not exist" % sstatepkg)
+        return False
+
+    sstate_clean(ss, d)
+
+    d.setVar('SSTATE_INSTDIR', sstateinst)
+    d.setVar('SSTATE_PKG', sstatepkg)
+
+    if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG", True), False):
+        if subprocess.call(["gpg", "--verify", sstatepkg + ".sig", sstatepkg]) != 0:
+            bb.warn("Cannot verify signature on sstate package %s" % sstatepkg)
+
+    for f in (d.getVar('SSTATEPREINSTFUNCS', True) or '').split() + ['sstate_unpack_package'] + (d.getVar('SSTATEPOSTUNPACKFUNCS', True) or '').split():
+        bb.build.exec_func(f, d)
+
+    for state in ss['dirs']:
+        prepdir(state[1])
+        os.rename(sstateinst + state[0], state[1])
+    sstate_install(ss, d)
+
+    for plain in ss['plaindirs']:
+        workdir = d.getVar('WORKDIR', True)
+        src = sstateinst + "/" + plain.replace(workdir, '')
+        dest = plain
+        bb.utils.mkdirhier(src)
+        prepdir(dest)
+        os.rename(src, dest)
+
+    return True
+
+python sstate_hardcode_path_unpack () {
+    # Fixup hardcoded paths
+    #
+    # Note: The logic below must match the reverse logic in
+    # sstate_hardcode_path(d)
+    import subprocess
+
+    sstateinst = d.getVar('SSTATE_INSTDIR', True)
+    fixmefn =  sstateinst + "fixmepath"
+    if os.path.isfile(fixmefn):
+        staging = d.getVar('STAGING_DIR', True)
+        staging_target = d.getVar('STAGING_DIR_TARGET', True)
+        staging_host = d.getVar('STAGING_DIR_HOST', True)
+
+        if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d):
+            sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIR:%s:g'" % (staging)
+        elif bb.data.inherits_class('cross', d):
+            sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRTARGET:%s:g; s:FIXMESTAGINGDIR:%s:g'" % (staging_target, staging)
+        else:
+            sstate_sed_cmd = "sed -i -e 's:FIXMESTAGINGDIRHOST:%s:g'" % (staging_host)
+
+        extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES', True) or ''
+        for fixmevar in extra_staging_fixmes.split():
+            fixme_path = d.getVar(fixmevar, True)
+            sstate_sed_cmd += " -e 's:FIXME_%s:%s:g'" % (fixmevar, fixme_path)
+
+        # Add sstateinst to each filename in fixmepath, use xargs to efficiently call sed
+        sstate_hardcode_cmd = "sed -e 's:^:%s:g' %s | xargs %s" % (sstateinst, fixmefn, sstate_sed_cmd)
+
+        bb.note("Replacing fixme paths in sstate package: %s" % (sstate_hardcode_cmd))
+        subprocess.call(sstate_hardcode_cmd, shell=True)
+
+        # Need to remove this or we'd copy it into the target directory and may 
+        # conflict with another writer
+        os.remove(fixmefn)
+}
+
+def sstate_clean_cachefile(ss, d):
+    import oe.path
+
+    sstatepkgfile = d.getVar('SSTATE_PATHSPEC', True) + "*_" + ss['task'] + ".tgz*"
+    bb.note("Removing %s" % sstatepkgfile)
+    oe.path.remove(sstatepkgfile)
+
+def sstate_clean_cachefiles(d):
+    for task in (d.getVar('SSTATETASKS', True) or "").split():
+        ld = d.createCopy()
+        ss = sstate_state_fromvars(ld, task)
+        sstate_clean_cachefile(ss, ld)
+
+def sstate_clean_manifest(manifest, d):
+    import oe.path
+
+    mfile = open(manifest)
+    entries = mfile.readlines()
+    mfile.close()
+
+    for entry in entries:
+        entry = entry.strip()
+        bb.debug(2, "Removing manifest: %s" % entry)
+        # We can race against another package populating directories as we're removing them
+        # so we ignore errors here.
+        try:
+            if entry.endswith("/"):
+                if os.path.islink(entry[:-1]):
+                    os.remove(entry[:-1])
+                elif os.path.exists(entry) and len(os.listdir(entry)) == 0:
+                    os.rmdir(entry[:-1])
+            else:
+                oe.path.remove(entry)
+        except OSError:
+            pass
+
+    oe.path.remove(manifest)
+
+def sstate_clean(ss, d):
+    import oe.path
+    import glob
+
+    d2 = d.createCopy()
+    stamp_clean = d.getVar("STAMPCLEAN", True)
+    extrainf = d.getVarFlag("do_" + ss['task'], 'stamp-extra-info', True)
+    if extrainf:
+        d2.setVar("SSTATE_MANMACH", extrainf)
+        wildcard_stfile = "%s.do_%s*.%s" % (stamp_clean, ss['task'], extrainf)
+    else:
+        wildcard_stfile = "%s.do_%s*" % (stamp_clean, ss['task'])
+
+    manifest = d2.expand("${SSTATE_MANFILEPREFIX}.%s" % ss['task'])
+
+    if os.path.exists(manifest):
+        locks = []
+        for lock in ss['lockfiles-shared']:
+            locks.append(bb.utils.lockfile(lock))
+        for lock in ss['lockfiles']:
+            locks.append(bb.utils.lockfile(lock))
+
+        sstate_clean_manifest(manifest, d)
+
+        for lock in locks:
+            bb.utils.unlockfile(lock)
+
+    # Remove the current and previous stamps, but keep the sigdata.
+    #
+    # The glob() matches do_task* which may match multiple tasks, for
+    # example: do_package and do_package_write_ipk, so we need to
+    # exactly match *.do_task.* and *.do_task_setscene.*
+    rm_stamp = '.do_%s.' % ss['task']
+    rm_setscene = '.do_%s_setscene.' % ss['task']
+    # For BB_SIGNATURE_HANDLER = "noop"
+    rm_nohash = ".do_%s" % ss['task']
+    for stfile in glob.glob(wildcard_stfile):
+        # Keep the sigdata
+        if ".sigdata." in stfile:
+            continue
+        # Preserve taint files in the stamps directory
+        if stfile.endswith('.taint'):
+            continue
+        if rm_stamp in stfile or rm_setscene in stfile or \
+                stfile.endswith(rm_nohash):
+            oe.path.remove(stfile)
+
+sstate_clean[vardepsexclude] = "SSTATE_MANFILEPREFIX"
+
+CLEANFUNCS += "sstate_cleanall"
+
+python sstate_cleanall() {
+    bb.note("Removing shared state for package %s" % d.getVar('PN', True))
+
+    manifest_dir = d.getVar('SSTATE_MANIFESTS', True)
+    if not os.path.exists(manifest_dir):
+        return
+
+    tasks = d.getVar('SSTATETASKS', True).split()
+    for name in tasks:
+        ld = d.createCopy()
+        shared_state = sstate_state_fromvars(ld, name)
+        sstate_clean(shared_state, ld)
+}
+
+python sstate_hardcode_path () {
+    import subprocess, platform
+
+    # Need to remove hardcoded paths and fix these when we install the
+    # staging packages.
+    #
+    # Note: the logic in this function needs to match the reverse logic
+    # in sstate_installpkg(ss, d)
+
+    staging = d.getVar('STAGING_DIR', True)
+    staging_target = d.getVar('STAGING_DIR_TARGET', True)
+    staging_host = d.getVar('STAGING_DIR_HOST', True)
+    sstate_builddir = d.getVar('SSTATE_BUILDDIR', True)
+
+    if bb.data.inherits_class('native', d) or bb.data.inherits_class('nativesdk', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross-canadian', d):
+        sstate_grep_cmd = "grep -l -e '%s'" % (staging)
+        sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIR:g'" % (staging)
+    elif bb.data.inherits_class('cross', d):
+        sstate_grep_cmd = "grep -l -e '%s' -e '%s'" % (staging_target, staging)
+        sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRTARGET:g; s:%s:FIXMESTAGINGDIR:g'" % (staging_target, staging)
+    else:
+        sstate_grep_cmd = "grep -l -e '%s'" % (staging_host)
+        sstate_sed_cmd = "sed -i -e 's:%s:FIXMESTAGINGDIRHOST:g'" % (staging_host)
+
+    extra_staging_fixmes = d.getVar('EXTRA_STAGING_FIXMES', True) or ''
+    for fixmevar in extra_staging_fixmes.split():
+        fixme_path = d.getVar(fixmevar, True)
+        sstate_sed_cmd += " -e 's:%s:FIXME_%s:g'" % (fixme_path, fixmevar)
+
+    fixmefn =  sstate_builddir + "fixmepath"
+
+    sstate_scan_cmd = d.getVar('SSTATE_SCAN_CMD', True)
+    sstate_filelist_cmd = "tee %s" % (fixmefn)
+
+    # fixmepath file needs relative paths, drop sstate_builddir prefix
+    sstate_filelist_relative_cmd = "sed -i -e 's:^%s::g' %s" % (sstate_builddir, fixmefn)
+
+    xargs_no_empty_run_cmd = '--no-run-if-empty'
+    if platform.system() == 'Darwin':
+        xargs_no_empty_run_cmd = ''
+
+    # Limit the fixpaths and sed operations based on the initial grep search
+    # This has the side effect of making sure the vfs cache is hot
+    sstate_hardcode_cmd = "%s | xargs %s | %s | xargs %s %s" % (sstate_scan_cmd, sstate_grep_cmd, sstate_filelist_cmd, xargs_no_empty_run_cmd, sstate_sed_cmd)
+
+    bb.note("Removing hardcoded paths from sstate package: '%s'" % (sstate_hardcode_cmd))
+    subprocess.call(sstate_hardcode_cmd, shell=True)
+
+        # If the fixmefn is empty, remove it..
+    if os.stat(fixmefn).st_size == 0:
+        os.remove(fixmefn)
+    else:
+        bb.note("Replacing absolute paths in fixmepath file: '%s'" % (sstate_filelist_relative_cmd))
+        subprocess.call(sstate_filelist_relative_cmd, shell=True)
+}
+
+def sstate_package(ss, d):
+    import oe.path
+
+    def make_relative_symlink(path, outputpath, d):
+        # Replace out absolute TMPDIR paths in symlinks with relative ones
+        if not os.path.islink(path):
+            return
+        link = os.readlink(path)
+        if not os.path.isabs(link):
+            return
+        if not link.startswith(tmpdir):
+            return
+
+        depth = outputpath.rpartition(tmpdir)[2].count('/')
+        base = link.partition(tmpdir)[2].strip()
+        while depth > 1:
+            base = "/.." + base
+            depth -= 1
+        base = "." + base
+
+        bb.debug(2, "Replacing absolute path %s with relative path %s for %s" % (link, base, outputpath))
+        os.remove(path)
+        os.symlink(base, path)
+
+    tmpdir = d.getVar('TMPDIR', True)
+
+    sstatebuild = d.expand("${WORKDIR}/sstate-build-%s/" % ss['task'])
+    sstatepkg = d.getVar('SSTATE_PKG', True) + '_'+ ss['task'] + ".tgz"
+    bb.utils.remove(sstatebuild, recurse=True)
+    bb.utils.mkdirhier(sstatebuild)
+    bb.utils.mkdirhier(os.path.dirname(sstatepkg))
+    for state in ss['dirs']:
+        if not os.path.exists(state[1]):
+            continue
+        srcbase = state[0].rstrip("/").rsplit('/', 1)[0]
+        for walkroot, dirs, files in os.walk(state[1]):
+            for file in files:
+                srcpath = os.path.join(walkroot, file)
+                dstpath = srcpath.replace(state[1], state[2])
+                make_relative_symlink(srcpath, dstpath, d)
+            for dir in dirs:
+                srcpath = os.path.join(walkroot, dir)
+                dstpath = srcpath.replace(state[1], state[2])
+                make_relative_symlink(srcpath, dstpath, d)
+        bb.debug(2, "Preparing tree %s for packaging at %s" % (state[1], sstatebuild + state[0]))
+        oe.path.copyhardlinktree(state[1], sstatebuild + state[0])
+
+    workdir = d.getVar('WORKDIR', True)
+    for plain in ss['plaindirs']:
+        pdir = plain.replace(workdir, sstatebuild)
+        bb.utils.mkdirhier(plain)
+        bb.utils.mkdirhier(pdir)
+        oe.path.copyhardlinktree(plain, pdir)
+
+    d.setVar('SSTATE_BUILDDIR', sstatebuild)
+    d.setVar('SSTATE_PKG', sstatepkg)
+
+    for f in (d.getVar('SSTATECREATEFUNCS', True) or '').split() + ['sstate_create_package'] + \
+             (d.getVar('SSTATEPOSTCREATEFUNCS', True) or '').split():
+        bb.build.exec_func(f, d)
+  
+    bb.siggen.dump_this_task(sstatepkg + ".siginfo", d)
+
+    return
+
+def pstaging_fetch(sstatefetch, sstatepkg, d):
+    import bb.fetch2
+
+    # Only try and fetch if the user has configured a mirror
+    mirrors = d.getVar('SSTATE_MIRRORS', True)
+    if not mirrors:
+        return
+
+    # Copy the data object and override DL_DIR and SRC_URI
+    localdata = bb.data.createCopy(d)
+    bb.data.update_data(localdata)
+
+    dldir = localdata.expand("${SSTATE_DIR}")
+    bb.utils.mkdirhier(dldir)
+
+    localdata.delVar('MIRRORS')
+    localdata.setVar('FILESPATH', dldir)
+    localdata.setVar('DL_DIR', dldir)
+    localdata.setVar('PREMIRRORS', mirrors)
+
+    # if BB_NO_NETWORK is set but we also have SSTATE_MIRROR_ALLOW_NETWORK,
+    # we'll want to allow network access for the current set of fetches.
+    if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1":
+        localdata.delVar('BB_NO_NETWORK')
+
+    # Try a fetch from the sstate mirror, if it fails just return and
+    # we will build the package
+    uris = ['file://{0}'.format(sstatefetch),
+            'file://{0}.siginfo'.format(sstatefetch)]
+    if bb.utils.to_boolean(d.getVar("SSTATE_VERIFY_SIG", True), False):
+        uris += ['file://{0}.sig'.format(sstatefetch)]
+
+    for srcuri in uris:
+        localdata.setVar('SRC_URI', srcuri)
+        try:
+            fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
+            fetcher.download()
+
+            # Need to optimise this, if using file:// urls, the fetcher just changes the local path
+            # For now work around by symlinking
+            localpath = bb.data.expand(fetcher.localpath(srcuri), localdata)
+            if localpath != sstatepkg and os.path.exists(localpath) and not os.path.exists(sstatepkg):
+                os.symlink(localpath, sstatepkg)
+
+        except bb.fetch2.BBFetchException:
+            break
+
+def sstate_setscene(d):
+    shared_state = sstate_state_fromvars(d)
+    accelerate = sstate_installpkg(shared_state, d)
+    if not accelerate:
+        raise bb.build.FuncFailed("No suitable staging package found")
+
+python sstate_task_prefunc () {
+    shared_state = sstate_state_fromvars(d)
+    sstate_clean(shared_state, d)
+}
+
+python sstate_task_postfunc () {
+    shared_state = sstate_state_fromvars(d)
+    sstate_install(shared_state, d)
+    for intercept in shared_state['interceptfuncs']:
+        bb.build.exec_func(intercept, d)
+    omask = os.umask(002)
+    if omask != 002:
+       bb.note("Using umask 002 (not %0o) for sstate packaging" % omask)
+    sstate_package(shared_state, d)
+    os.umask(omask)
+}
+  
+
+#
+# Shell function to generate a sstate package from a directory
+# set as SSTATE_BUILDDIR. Will be run from within SSTATE_BUILDDIR.
+#
+sstate_create_package () {
+	TFILE=`mktemp ${SSTATE_PKG}.XXXXXXXX`
+	# Need to handle empty directories
+	if [ "$(ls -A)" ]; then
+		set +e
+		tar -czf $TFILE *
+		ret=$?
+		if [ $ret -ne 0 ] && [ $ret -ne 1 ]; then
+			exit 1
+		fi
+		set -e
+	else
+		tar -cz --file=$TFILE --files-from=/dev/null
+	fi
+	chmod 0664 $TFILE 
+	mv -f $TFILE ${SSTATE_PKG}
+
+	if [ -n "${SSTATE_SIG_KEY}" ]; then
+		rm -f ${SSTATE_PKG}.sig
+		echo ${SSTATE_SIG_PASSPHRASE} | gpg --batch --passphrase-fd 0 --detach-sign --local-user ${SSTATE_SIG_KEY} --output ${SSTATE_PKG}.sig ${SSTATE_PKG}
+	fi
+
+	cd ${WORKDIR}
+	rm -rf ${SSTATE_BUILDDIR}
+}
+
+#
+# Shell function to decompress and prepare a package for installation
+# Will be run from within SSTATE_INSTDIR.
+#
+sstate_unpack_package () {
+	tar -xmvzf ${SSTATE_PKG}
+	# Use "! -w ||" to return true for read only files
+	[ ! -w ${SSTATE_PKG} ] || touch --no-dereference ${SSTATE_PKG}
+}
+
+BB_HASHCHECK_FUNCTION = "sstate_checkhashes"
+
+def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
+
+    ret = []
+    missed = []
+    extension = ".tgz"
+    if siginfo:
+        extension = extension + ".siginfo"
+
+    def getpathcomponents(task, d):
+        # Magic data from BB_HASHFILENAME
+        splithashfn = sq_hashfn[task].split(" ")
+        spec = splithashfn[1]
+        extrapath = splithashfn[0]
+
+        tname = sq_task[task][3:]
+
+        if tname in ["fetch", "unpack", "patch", "populate_lic", "preconfigure"] and splithashfn[2]:
+            spec = splithashfn[2]
+            extrapath = ""
+
+        return spec, extrapath, tname
+
+
+    for task in range(len(sq_fn)):
+
+        spec, extrapath, tname = getpathcomponents(task, d)
+
+        sstatefile = d.expand("${SSTATE_DIR}/" + extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + extension)
+
+        if os.path.exists(sstatefile):
+            bb.debug(2, "SState: Found valid sstate file %s" % sstatefile)
+            ret.append(task)
+            continue
+        else:
+            missed.append(task)
+            bb.debug(2, "SState: Looked for but didn't find file %s" % sstatefile)
+
+    mirrors = d.getVar("SSTATE_MIRRORS", True)
+    if mirrors:
+        # Copy the data object and override DL_DIR and SRC_URI
+        localdata = bb.data.createCopy(d)
+        bb.data.update_data(localdata)
+
+        dldir = localdata.expand("${SSTATE_DIR}")
+        localdata.delVar('MIRRORS')
+        localdata.setVar('FILESPATH', dldir)
+        localdata.setVar('DL_DIR', dldir)
+        localdata.setVar('PREMIRRORS', mirrors)
+
+        bb.debug(2, "SState using premirror of: %s" % mirrors)
+
+        # if BB_NO_NETWORK is set but we also have SSTATE_MIRROR_ALLOW_NETWORK,
+        # we'll want to allow network access for the current set of fetches.
+        if localdata.getVar('BB_NO_NETWORK', True) == "1" and localdata.getVar('SSTATE_MIRROR_ALLOW_NETWORK', True) == "1":
+            localdata.delVar('BB_NO_NETWORK')
+
+        from bb.fetch2 import FetchConnectionCache
+        def checkstatus_init(thread_worker):
+            thread_worker.connection_cache = FetchConnectionCache()
+
+        def checkstatus_end(thread_worker):
+            thread_worker.connection_cache.close_connections()
+
+        def checkstatus(thread_worker, arg):
+            (task, sstatefile) = arg
+
+            localdata2 = bb.data.createCopy(localdata)
+            srcuri = "file://" + sstatefile
+            localdata.setVar('SRC_URI', srcuri)
+            bb.debug(2, "SState: Attempting to fetch %s" % srcuri)
+
+            try:
+                fetcher = bb.fetch2.Fetch(srcuri.split(), localdata2,
+                            connection_cache=thread_worker.connection_cache)
+                fetcher.checkstatus()
+                bb.debug(2, "SState: Successful fetch test for %s" % srcuri)
+                ret.append(task)
+                if task in missed:
+                    missed.remove(task)
+            except:
+                missed.append(task)
+                bb.debug(2, "SState: Unsuccessful fetch test for %s" % srcuri)
+                pass     
+
+        tasklist = []
+        for task in range(len(sq_fn)):
+            if task in ret:
+                continue
+            spec, extrapath, tname = getpathcomponents(task, d)
+            sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + extension)
+            tasklist.append((task, sstatefile))
+
+        if tasklist:
+            bb.note("Checking sstate mirror object availability (for %s objects)" % len(tasklist))
+            import multiprocessing
+            nproc = min(multiprocessing.cpu_count(), len(tasklist))
+
+            pool = oe.utils.ThreadedPool(nproc, len(tasklist),
+                    worker_init=checkstatus_init, worker_end=checkstatus_end)
+            for t in tasklist:
+                pool.add_task(checkstatus, t)
+            pool.start()
+            pool.wait_completion()
+
+    inheritlist = d.getVar("INHERIT", True)
+    if "toaster" in inheritlist:
+        evdata = {'missed': [], 'found': []};
+        for task in missed:
+            spec, extrapath, tname = getpathcomponents(task, d)
+            sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz")
+            evdata['missed'].append( (sq_fn[task], sq_task[task], sq_hash[task], sstatefile ) )
+        for task in ret:
+            spec, extrapath, tname = getpathcomponents(task, d)
+            sstatefile = d.expand(extrapath + generate_sstatefn(spec, sq_hash[task], d) + "_" + tname + ".tgz")
+            evdata['found'].append( (sq_fn[task], sq_task[task], sq_hash[task], sstatefile ) )
+        bb.event.fire(bb.event.MetadataEvent("MissedSstate", evdata), d)
+
+    if hasattr(bb.parse.siggen, "checkhashes"):
+        bb.parse.siggen.checkhashes(missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d)
+
+    return ret
+
+BB_SETSCENE_DEPVALID = "setscene_depvalid"
+
+def setscene_depvalid(task, taskdependees, notneeded, d):
+    # taskdependees is a dict of tasks which depend on task, each being a 3 item list of [PN, TASKNAME, FILENAME]
+    # task is included in taskdependees too
+
+    bb.debug(2, "Considering setscene task: %s" % (str(taskdependees[task])))
+
+    def isNativeCross(x):
+        return x.endswith("-native") or "-cross-" in x or "-crosssdk" in x
+
+    def isPostInstDep(x):
+        if x in ["qemu-native", "gdk-pixbuf-native", "qemuwrapper-cross", "depmodwrapper-cross", "systemd-systemctl-native", "gtk-icon-utils-native"]:
+            return True
+        return False
+
+    # We only need to trigger populate_lic through direct dependencies
+    if taskdependees[task][1] == "do_populate_lic":
+        return True
+
+    for dep in taskdependees:
+        bb.debug(2, "  considering dependency: %s" % (str(taskdependees[dep])))
+        if task == dep:
+            continue
+        if dep in notneeded:
+            continue
+        # do_package_write_* and do_package doesn't need do_package
+        if taskdependees[task][1] == "do_package" and taskdependees[dep][1] in ['do_package', 'do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata', 'do_package_qa']:
+            continue
+        # do_package_write_* and do_package doesn't need do_populate_sysroot, unless is a postinstall dependency
+        if taskdependees[task][1] == "do_populate_sysroot" and taskdependees[dep][1] in ['do_package', 'do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata', 'do_package_qa']:
+            if isPostInstDep(taskdependees[task][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm']:
+                return False
+            continue
+        # Native/Cross packages don't exist and are noexec anyway
+        if isNativeCross(taskdependees[dep][0]) and taskdependees[dep][1] in ['do_package_write_deb', 'do_package_write_ipk', 'do_package_write_rpm', 'do_packagedata', 'do_package', 'do_package_qa']:
+            continue
+
+        # Consider sysroot depending on sysroot tasks
+        if taskdependees[task][1] == 'do_populate_sysroot' and taskdependees[dep][1] == 'do_populate_sysroot':
+            # base-passwd/shadow-sysroot don't need their dependencies
+            if taskdependees[dep][0].endswith(("base-passwd", "shadow-sysroot")):
+                continue
+            # Nothing need depend on libc-initial/gcc-cross-initial
+            if "-initial" in taskdependees[task][0]:
+                continue
+            # Native/Cross populate_sysroot need their dependencies
+            if isNativeCross(taskdependees[task][0]) and isNativeCross(taskdependees[dep][0]):
+                return False
+            # Target populate_sysroot depended on by cross tools need to be installed
+            if isNativeCross(taskdependees[dep][0]):
+                return False
+            # Native/cross tools depended upon by target sysroot are not needed
+            if isNativeCross(taskdependees[task][0]):
+                continue
+            # Target populate_sysroot need their dependencies
+            return False
+
+        if taskdependees[task][1] == 'do_shared_workdir':
+            continue
+
+        # This is due to the [depends] in useradd.bbclass complicating matters
+        # The logic *is* reversed here due to the way hard setscene dependencies are injected
+        if taskdependees[task][1] == 'do_package' and taskdependees[dep][0].endswith(('shadow-native', 'shadow-sysroot', 'base-passwd', 'pseudo-native')) and taskdependees[dep][1] == 'do_populate_sysroot':
+            continue
+
+        # Safe fallthrough default
+        bb.debug(2, " Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep])))
+        return False
+    return True
+
+addhandler sstate_eventhandler
+sstate_eventhandler[eventmask] = "bb.build.TaskSucceeded"
+python sstate_eventhandler() {
+    d = e.data
+    # When we write an sstate package we rewrite the SSTATE_PKG
+    spkg = d.getVar('SSTATE_PKG', True)
+    if not spkg.endswith(".tgz"):
+        taskname = d.getVar("BB_RUNTASK", True)[3:]
+        spec = d.getVar('SSTATE_PKGSPEC', True)
+        swspec = d.getVar('SSTATE_SWSPEC', True)
+        if taskname in ["fetch", "unpack", "patch", "populate_lic", "preconfigure"] and swspec:
+            d.setVar("SSTATE_PKGSPEC", "${SSTATE_SWSPEC}")
+            d.setVar("SSTATE_EXTRAPATH", "")
+        sstatepkg = d.getVar('SSTATE_PKG', True)
+        bb.siggen.dump_this_task(sstatepkg + '_' + taskname + ".tgz" ".siginfo", d)
+}
+
+SSTATE_PRUNE_OBSOLETEWORKDIR = "1"
+
+# Event handler which removes manifests and stamps file for
+# recipes which are no longer reachable in a build where they
+# once were.
+# Also optionally removes the workdir of those tasks/recipes
+#
+addhandler sstate_eventhandler2
+sstate_eventhandler2[eventmask] = "bb.event.ReachableStamps"
+python sstate_eventhandler2() {
+    import glob
+    d = e.data
+    stamps = e.stamps.values()
+    removeworkdir = (d.getVar("SSTATE_PRUNE_OBSOLETEWORKDIR", False) == "1")
+    seen = []
+    for a in d.getVar("SSTATE_ARCHS", True).split():
+        toremove = []
+        i = d.expand("${SSTATE_MANIFESTS}/index-" + a)
+        if not os.path.exists(i):
+            continue
+        with open(i, "r") as f:
+            lines = f.readlines()
+            for l in lines:
+                (stamp, manifest, workdir) = l.split()
+                if stamp not in stamps:
+                    toremove.append(l)
+                    if stamp not in seen:
+                        bb.note("Stamp %s is not reachable, removing related manifests" % stamp)
+                        seen.append(stamp)
+        for r in toremove:
+            (stamp, manifest, workdir) = r.split()
+            for m in glob.glob(manifest + ".*"):
+                sstate_clean_manifest(m, d)
+            bb.utils.remove(stamp + "*")
+            if removeworkdir:
+                bb.utils.remove(workdir, recurse = True)
+            lines.remove(r)
+        with open(i, "w") as f:
+            for l in lines:
+                f.write(l)
+}
diff --git a/meta/classes/staging.bbclass b/meta/classes/staging.bbclass
new file mode 100644
index 0000000..967eddd
--- /dev/null
+++ b/meta/classes/staging.bbclass
@@ -0,0 +1,218 @@
+
+sysroot_stage_dir() {
+	src="$1"
+	dest="$2"
+	# if the src doesn't exist don't do anything
+	if [ ! -d "$src" ]; then
+		 return
+	fi
+
+	mkdir -p "$dest"
+	(
+		cd $src
+		find . -print0 | cpio --null -pdlu $dest
+	)
+}
+
+sysroot_stage_libdir() {
+	src="$1"
+	dest="$2"
+
+	sysroot_stage_dir $src $dest
+}
+
+sysroot_stage_dirs() {
+	from="$1"
+	to="$2"
+
+	sysroot_stage_dir $from${includedir} $to${includedir}
+	if [ "${BUILD_SYS}" = "${HOST_SYS}" ]; then
+		sysroot_stage_dir $from${bindir} $to${bindir}
+		sysroot_stage_dir $from${sbindir} $to${sbindir}
+		sysroot_stage_dir $from${base_bindir} $to${base_bindir}
+		sysroot_stage_dir $from${base_sbindir} $to${base_sbindir}
+		sysroot_stage_dir $from${libexecdir} $to${libexecdir}
+		sysroot_stage_dir $from${sysconfdir} $to${sysconfdir}
+		sysroot_stage_dir $from${localstatedir} $to${localstatedir}
+	fi
+	if [ -d $from${libdir} ]
+	then
+		sysroot_stage_libdir $from${libdir} $to${libdir}
+	fi
+	if [ -d $from${base_libdir} ]
+	then
+		sysroot_stage_libdir $from${base_libdir} $to${base_libdir}
+	fi
+	if [ -d $from${nonarch_base_libdir} ]
+	then
+		sysroot_stage_libdir $from${nonarch_base_libdir} $to${nonarch_base_libdir}
+	fi
+	sysroot_stage_dir $from${datadir} $to${datadir}
+	# We don't care about docs/info/manpages/locales
+	rm -rf $to${mandir}/ $to${docdir}/ $to${infodir}/ ${to}${datadir}/locale/
+	rm -rf $to${datadir}/applications/ $to${datadir}/fonts/ $to${datadir}/pixmaps/
+}
+
+sysroot_stage_all() {
+	sysroot_stage_dirs ${D} ${SYSROOT_DESTDIR}
+}
+
+python sysroot_strip () {
+    import stat, errno
+
+    dvar = d.getVar('SYSROOT_DESTDIR', True)
+    pn = d.getVar('PN', True)
+
+    os.chdir(dvar)
+
+    # Return type (bits):
+    # 0 - not elf
+    # 1 - ELF
+    # 2 - stripped
+    # 4 - executable
+    # 8 - shared library
+    # 16 - kernel module
+    def isELF(path):
+        type = 0
+        ret, result = oe.utils.getstatusoutput("file \"%s\"" % path.replace("\"", "\\\""))
+
+        if ret:
+            bb.error("split_and_strip_files: 'file %s' failed" % path)
+            return type
+
+        # Not stripped
+        if "ELF" in result:
+            type |= 1
+            if "not stripped" not in result:
+                type |= 2
+            if "executable" in result:
+                type |= 4
+            if "shared" in result:
+                type |= 8
+        return type
+
+
+    elffiles = {}
+    inodes = {}
+    libdir = os.path.abspath(dvar + os.sep + d.getVar("libdir", True))
+    baselibdir = os.path.abspath(dvar + os.sep + d.getVar("base_libdir", True))
+    if (d.getVar('INHIBIT_SYSROOT_STRIP', True) != '1'):
+        #
+        # First lets figure out all of the files we may have to process
+        #
+        for root, dirs, files in os.walk(dvar):
+            for f in files:
+                file = os.path.join(root, f)
+
+                try:
+                    ltarget = oe.path.realpath(file, dvar, False)
+                    s = os.lstat(ltarget)
+                except OSError as e:
+                    (err, strerror) = e.args
+                    if err != errno.ENOENT:
+                        raise
+                    # Skip broken symlinks
+                    continue
+                if not s:
+                    continue
+                # Check its an excutable
+                if (s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) or (s[stat.ST_MODE] & stat.S_IXOTH) \
+                        or ((file.startswith(libdir) or file.startswith(baselibdir)) and ".so" in f):
+                    # If it's a symlink, and points to an ELF file, we capture the readlink target
+                    if os.path.islink(file):
+                        continue
+
+                    # It's a file (or hardlink), not a link
+                    # ...but is it ELF, and is it already stripped?
+                    elf_file = isELF(file)
+                    if elf_file & 1:
+                        if elf_file & 2:
+                            bb.warn("File '%s' from %s was already stripped, this will prevent future debugging!" % (file[len(dvar):], pn))
+                            continue
+
+                        if s.st_ino in inodes:
+                            os.unlink(file)
+                            os.link(inodes[s.st_ino], file)
+                        else:
+                            inodes[s.st_ino] = file
+                            # break hardlink
+                            bb.utils.copyfile(file, file)
+                            elffiles[file] = elf_file
+
+        #
+        # Now strip them (in parallel)
+        #
+        strip = d.getVar("STRIP", True)
+        sfiles = []
+        for file in elffiles:
+            elf_file = int(elffiles[file])
+            #bb.note("Strip %s" % file)
+            sfiles.append((file, elf_file, strip))
+
+        oe.utils.multiprocess_exec(sfiles, oe.package.runstrip)
+}
+
+do_populate_sysroot[dirs] = "${SYSROOT_DESTDIR}"
+do_populate_sysroot[umask] = "022"
+
+addtask populate_sysroot after do_install
+
+SYSROOT_PREPROCESS_FUNCS ?= ""
+SYSROOT_DESTDIR = "${WORKDIR}/sysroot-destdir/"
+SYSROOT_LOCK = "${STAGING_DIR}/staging.lock"
+
+# We clean out any existing sstate from the sysroot if we rerun configure
+python sysroot_cleansstate () {
+    ss = sstate_state_fromvars(d, "populate_sysroot")
+    sstate_clean(ss, d)
+}
+do_configure[prefuncs] += "sysroot_cleansstate"
+
+
+BB_SETSCENE_VERIFY_FUNCTION = "sysroot_checkhashes"
+
+def sysroot_checkhashes(covered, tasknames, fnids, fns, d, invalidtasks = None):
+    problems = set()
+    configurefnids = set()
+    if not invalidtasks:
+        invalidtasks = xrange(len(tasknames))
+    for task in invalidtasks:
+        if tasknames[task] == "do_configure" and task not in covered:
+            configurefnids.add(fnids[task])
+    for task in covered:
+        if tasknames[task] == "do_populate_sysroot" and fnids[task] in configurefnids:
+            problems.add(task)
+    return problems
+
+python do_populate_sysroot () {
+    bb.build.exec_func("sysroot_stage_all", d)
+    bb.build.exec_func("sysroot_strip", d)
+    for f in (d.getVar('SYSROOT_PREPROCESS_FUNCS', True) or '').split():
+        bb.build.exec_func(f, d)
+    pn = d.getVar("PN", True)
+    multiprov = d.getVar("MULTI_PROVIDER_WHITELIST", True).split()
+    provdir = d.expand("${SYSROOT_DESTDIR}${base_prefix}/sysroot-providers/")
+    bb.utils.mkdirhier(provdir)
+    for p in d.getVar("PROVIDES", True).split():
+        if p in multiprov:
+            continue
+        p = p.replace("/", "_")
+        with open(provdir + p, "w") as f:
+            f.write(pn)
+}
+
+do_populate_sysroot[vardeps] += "${SYSROOT_PREPROCESS_FUNCS}"
+do_populate_sysroot[vardepsexclude] += "MULTI_PROVIDER_WHITELIST"
+
+SSTATETASKS += "do_populate_sysroot"
+do_populate_sysroot[cleandirs] = "${SYSROOT_DESTDIR}"
+do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}"
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST}/"
+do_populate_sysroot[stamp-extra-info] = "${MACHINE}"
+
+python do_populate_sysroot_setscene () {
+    sstate_setscene(d)
+}
+addtask do_populate_sysroot_setscene
+
+
diff --git a/meta/classes/syslinux.bbclass b/meta/classes/syslinux.bbclass
new file mode 100644
index 0000000..44ef9a9
--- /dev/null
+++ b/meta/classes/syslinux.bbclass
@@ -0,0 +1,190 @@
+# syslinux.bbclass
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+# Provide syslinux specific functions for building bootable images.
+
+# External variables
+# ${INITRD} - indicates a list of filesystem images to concatenate and use as an initrd (optional)
+# ${ROOTFS} - indicates a filesystem image to include as the root filesystem (optional)
+# ${AUTO_SYSLINUXMENU} - set this to 1 to enable creating an automatic menu
+# ${LABELS} - a list of targets for the automatic config
+# ${APPEND} - an override list of append strings for each label
+# ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited
+# ${SYSLINUX_SPLASH} - A background for the vga boot menu if using the boot menu
+# ${SYSLINUX_DEFAULT_CONSOLE} - set to "console=ttyX" to change kernel boot default console
+# ${SYSLINUX_SERIAL} - Set an alternate serial port or turn off serial with empty string
+# ${SYSLINUX_SERIAL_TTY} - Set alternate console=tty... kernel boot argument
+# ${SYSLINUX_KERNEL_ARGS} - Add additional kernel arguments
+
+do_bootimg[depends] += "${MLPREFIX}syslinux:do_populate_sysroot \
+                        syslinux-native:do_populate_sysroot"
+
+SYSLINUXCFG  = "${S}/syslinux.cfg"
+
+ISOLINUXDIR = "/isolinux"
+SYSLINUXDIR = "/"
+# The kernel has an internal default console, which you can override with
+# a console=...some_tty...
+SYSLINUX_DEFAULT_CONSOLE ?= ""
+SYSLINUX_SERIAL ?= "0 115200"
+SYSLINUX_SERIAL_TTY ?= "console=ttyS0,115200"
+ISO_BOOTIMG = "isolinux/isolinux.bin"
+ISO_BOOTCAT = "isolinux/boot.cat"
+MKISOFS_OPTIONS = "-no-emul-boot -boot-load-size 4 -boot-info-table"
+APPEND_prepend = " ${SYSLINUX_ROOT} "
+
+# Need UUID utility code.
+inherit fs-uuid
+
+syslinux_populate() {
+	DEST=$1
+	BOOTDIR=$2
+	CFGNAME=$3
+
+	install -d ${DEST}${BOOTDIR}
+
+	# Install the config files
+	install -m 0644 ${SYSLINUXCFG} ${DEST}${BOOTDIR}/${CFGNAME}
+	if [ "${AUTO_SYSLINUXMENU}" = 1 ] ; then
+		install -m 0644 ${STAGING_DATADIR}/syslinux/vesamenu.c32 ${DEST}${BOOTDIR}/vesamenu.c32
+		install -m 0444 ${STAGING_DATADIR}/syslinux/libcom32.c32 ${DEST}${BOOTDIR}/libcom32.c32
+		install -m 0444 ${STAGING_DATADIR}/syslinux/libutil.c32 ${DEST}${BOOTDIR}/libutil.c32
+		if [ "${SYSLINUX_SPLASH}" != "" ] ; then
+			install -m 0644 ${SYSLINUX_SPLASH} ${DEST}${BOOTDIR}/splash.lss
+		fi
+	fi
+}
+
+syslinux_iso_populate() {
+	iso_dir=$1
+	syslinux_populate $iso_dir ${ISOLINUXDIR} isolinux.cfg
+	install -m 0644 ${STAGING_DATADIR}/syslinux/isolinux.bin $iso_dir${ISOLINUXDIR}
+	install -m 0644 ${STAGING_DATADIR}/syslinux/ldlinux.c32 $iso_dir${ISOLINUXDIR}
+}
+
+syslinux_hddimg_populate() {
+	hdd_dir=$1
+	syslinux_populate $hdd_dir ${SYSLINUXDIR} syslinux.cfg
+	install -m 0444 ${STAGING_DATADIR}/syslinux/ldlinux.sys $hdd_dir${SYSLINUXDIR}/ldlinux.sys
+}
+
+syslinux_hddimg_install() {
+	syslinux ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.hddimg
+}
+
+syslinux_hdddirect_install() {
+	DEST=$1
+	syslinux $DEST
+}
+
+python build_syslinux_cfg () {
+    import copy
+    import sys
+
+    workdir = d.getVar('WORKDIR', True)
+    if not workdir:
+        bb.error("WORKDIR not defined, unable to package")
+        return
+        
+    labels = d.getVar('LABELS', True)
+    if not labels:
+        bb.debug(1, "LABELS not defined, nothing to do")
+        return
+    
+    if labels == []:
+        bb.debug(1, "No labels, nothing to do")
+        return
+
+    cfile = d.getVar('SYSLINUXCFG', True)
+    if not cfile:
+        raise bb.build.FuncFailed('Unable to read SYSLINUXCFG')
+
+    try:
+        cfgfile = file(cfile, 'w')
+    except OSError:
+        raise bb.build.funcFailed('Unable to open %s' % (cfile))
+
+    cfgfile.write('# Automatically created by OE\n')
+
+    opts = d.getVar('SYSLINUX_OPTS', True)
+
+    if opts:
+        for opt in opts.split(';'):
+            cfgfile.write('%s\n' % opt)
+
+    cfgfile.write('ALLOWOPTIONS 1\n');
+    syslinux_default_console = d.getVar('SYSLINUX_DEFAULT_CONSOLE', True)
+    syslinux_serial_tty = d.getVar('SYSLINUX_SERIAL_TTY', True)
+    syslinux_serial = d.getVar('SYSLINUX_SERIAL', True)
+    if syslinux_serial:
+        cfgfile.write('SERIAL %s\n' % syslinux_serial)
+
+    menu = d.getVar('AUTO_SYSLINUXMENU', True)
+
+    if menu and syslinux_serial:
+        cfgfile.write('DEFAULT Graphics console %s\n' % (labels.split()[0]))
+    else:
+        cfgfile.write('DEFAULT %s\n' % (labels.split()[0]))
+
+    timeout = d.getVar('SYSLINUX_TIMEOUT', True)
+
+    if timeout:
+        cfgfile.write('TIMEOUT %s\n' % timeout)
+    else:
+        cfgfile.write('TIMEOUT 50\n')
+
+    prompt = d.getVar('SYSLINUX_PROMPT', True)
+    if prompt:
+        cfgfile.write('PROMPT %s\n' % prompt)
+    else:
+        cfgfile.write('PROMPT 1\n')
+
+    if menu:
+        cfgfile.write('ui vesamenu.c32\n')
+        cfgfile.write('menu title Select kernel options and boot kernel\n')
+        cfgfile.write('menu tabmsg Press [Tab] to edit, [Return] to select\n')
+        splash = d.getVar('SYSLINUX_SPLASH', True)
+        if splash:
+            cfgfile.write('menu background splash.lss\n')
+    
+    for label in labels.split():
+        localdata = bb.data.createCopy(d)
+
+        overrides = localdata.getVar('OVERRIDES', True)
+        if not overrides:
+            raise bb.build.FuncFailed('OVERRIDES not defined')
+
+        localdata.setVar('OVERRIDES', label + ':' + overrides)
+        bb.data.update_data(localdata)
+    
+        btypes = [ [ "", syslinux_default_console ] ]
+        if menu and syslinux_serial:
+            btypes = [ [ "Graphics console ", syslinux_default_console  ],
+                [ "Serial console ", syslinux_serial_tty ] ]
+
+        for btype in btypes:
+            cfgfile.write('LABEL %s%s\nKERNEL /vmlinuz\n' % (btype[0], label))
+
+            exargs = d.getVar('SYSLINUX_KERNEL_ARGS', True)
+            if exargs:
+                btype[1] += " " + exargs
+
+            append = localdata.getVar('APPEND', True)
+            initrd = localdata.getVar('INITRD', True)
+
+            if append:
+                cfgfile.write('APPEND ')
+
+                if initrd:
+                    cfgfile.write('initrd=/initrd ')
+
+                cfgfile.write('LABEL=%s '% (label))
+                append = replace_rootfs_uuid(d, append)
+                cfgfile.write('%s %s\n' % (append, btype[1]))
+            else:
+                cfgfile.write('APPEND %s\n' % btype[1])
+
+    cfgfile.close()
+}
+build_syslinux_cfg[vardeps] += "APPEND"
diff --git a/meta/classes/systemd.bbclass b/meta/classes/systemd.bbclass
new file mode 100644
index 0000000..46e72c7
--- /dev/null
+++ b/meta/classes/systemd.bbclass
@@ -0,0 +1,193 @@
+# The list of packages that should have systemd packaging scripts added.  For
+# each entry, optionally have a SYSTEMD_SERVICE_[package] that lists the service
+# files in this package.  If this variable isn't set, [package].service is used.
+SYSTEMD_PACKAGES ?= "${PN}"
+SYSTEMD_PACKAGES_class-native ?= ""
+SYSTEMD_PACKAGES_class-nativesdk ?= ""
+
+# Whether to enable or disable the services on installation.
+SYSTEMD_AUTO_ENABLE ??= "enable"
+
+# This class will be included in any recipe that supports systemd init scripts,
+# even if systemd is not in DISTRO_FEATURES.  As such don't make any changes
+# directly but check the DISTRO_FEATURES first.
+python __anonymous() {
+    # If the distro features have systemd but not sysvinit, inhibit update-rcd
+    # from doing any work so that pure-systemd images don't have redundant init
+    # files.
+    if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
+        d.appendVar("DEPENDS", " systemd-systemctl-native")
+        if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+            d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+systemd_postinst() {
+OPTS=""
+
+if [ -n "$D" ]; then
+    OPTS="--root=$D"
+fi
+
+if type systemctl >/dev/null 2>/dev/null; then
+	systemctl $OPTS ${SYSTEMD_AUTO_ENABLE} ${SYSTEMD_SERVICE}
+
+	if [ -z "$D" -a "${SYSTEMD_AUTO_ENABLE}" = "enable" ]; then
+		systemctl restart ${SYSTEMD_SERVICE}
+	fi
+fi
+}
+
+systemd_prerm() {
+OPTS=""
+
+if [ -n "$D" ]; then
+    OPTS="--root=$D"
+fi
+
+if type systemctl >/dev/null 2>/dev/null; then
+	if [ -z "$D" ]; then
+		systemctl stop ${SYSTEMD_SERVICE}
+	fi
+
+	systemctl $OPTS disable ${SYSTEMD_SERVICE}
+fi
+}
+
+
+systemd_populate_packages[vardeps] += "systemd_prerm systemd_postinst"
+systemd_populate_packages[vardepsexclude] += "OVERRIDES"
+
+
+python systemd_populate_packages() {
+    if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
+        return
+
+    def get_package_var(d, var, pkg):
+        val = (d.getVar('%s_%s' % (var, pkg), True) or "").strip()
+        if val == "":
+            val = (d.getVar(var, True) or "").strip()
+        return val
+
+    # Check if systemd-packages already included in PACKAGES
+    def systemd_check_package(pkg_systemd):
+        packages = d.getVar('PACKAGES', True)
+        if not pkg_systemd in packages.split():
+            bb.error('%s does not appear in package list, please add it' % pkg_systemd)
+
+
+    def systemd_generate_package_scripts(pkg):
+        bb.debug(1, 'adding systemd calls to postinst/postrm for %s' % pkg)
+
+        # Add pkg to the overrides so that it finds the SYSTEMD_SERVICE_pkg
+        # variable.
+        localdata = d.createCopy()
+        localdata.prependVar("OVERRIDES", pkg + ":")
+        bb.data.update_data(localdata)
+
+        postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+        if not postinst:
+            postinst = '#!/bin/sh\n'
+        postinst += localdata.getVar('systemd_postinst', True)
+        d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+        prerm = d.getVar('pkg_prerm_%s' % pkg, True)
+        if not prerm:
+            prerm = '#!/bin/sh\n'
+        prerm += localdata.getVar('systemd_prerm', True)
+        d.setVar('pkg_prerm_%s' % pkg, prerm)
+
+
+    # Add files to FILES_*-systemd if existent and not already done
+    def systemd_append_file(pkg_systemd, file_append):
+        appended = False
+        if os.path.exists(oe.path.join(d.getVar("D", True), file_append)):
+            var_name = "FILES_" + pkg_systemd
+            files = d.getVar(var_name, False) or ""
+            if file_append not in files.split():
+                d.appendVar(var_name, " " + file_append)
+                appended = True
+        return appended
+
+    # Add systemd files to FILES_*-systemd, parse for Also= and follow recursive
+    def systemd_add_files_and_parse(pkg_systemd, path, service, keys):
+        # avoid infinite recursion
+        if systemd_append_file(pkg_systemd, oe.path.join(path, service)):
+            fullpath = oe.path.join(d.getVar("D", True), path, service)
+            if service.find('.service') != -1:
+                # for *.service add *@.service
+                service_base = service.replace('.service', '')
+                systemd_add_files_and_parse(pkg_systemd, path, service_base + '@.service', keys)
+            if service.find('.socket') != -1:
+                # for *.socket add *.service and *@.service
+                service_base = service.replace('.socket', '')
+                systemd_add_files_and_parse(pkg_systemd, path, service_base + '.service', keys)
+                systemd_add_files_and_parse(pkg_systemd, path, service_base + '@.service', keys)
+            for key in keys.split():
+                # recurse all dependencies found in keys ('Also';'Conflicts';..) and add to files
+                cmd = "grep %s %s | sed 's,%s=,,g' | tr ',' '\\n'" % (key, fullpath, key)
+                pipe = os.popen(cmd, 'r')
+                line = pipe.readline()
+                while line:
+                    line = line.replace('\n', '')
+                    systemd_add_files_and_parse(pkg_systemd, path, line, keys)
+                    line = pipe.readline()
+                pipe.close()
+
+    # Check service-files and call systemd_add_files_and_parse for each entry
+    def systemd_check_services():
+        searchpaths = [oe.path.join(d.getVar("sysconfdir", True), "systemd", "system"),]
+        searchpaths.append(d.getVar("systemd_system_unitdir", True))
+        systemd_packages = d.getVar('SYSTEMD_PACKAGES', True)
+
+        keys = 'Also'
+        # scan for all in SYSTEMD_SERVICE[]
+        for pkg_systemd in systemd_packages.split():
+            for service in get_package_var(d, 'SYSTEMD_SERVICE', pkg_systemd).split():
+                path_found = ''
+                for path in searchpaths:
+                    if os.path.exists(oe.path.join(d.getVar("D", True), path, service)):
+                        path_found = path
+                        break
+                if path_found != '':
+                    systemd_add_files_and_parse(pkg_systemd, path_found, service, keys)
+                else:
+                    raise bb.build.FuncFailed("SYSTEMD_SERVICE_%s value %s does not exist" % \
+                        (pkg_systemd, service))
+
+    # Run all modifications once when creating package
+    if os.path.exists(d.getVar("D", True)):
+        for pkg in d.getVar('SYSTEMD_PACKAGES', True).split():
+            systemd_check_package(pkg)
+            if d.getVar('SYSTEMD_SERVICE_' + pkg, True):
+                systemd_generate_package_scripts(pkg)
+        systemd_check_services()
+}
+
+PACKAGESPLITFUNCS_prepend = "systemd_populate_packages "
+
+python rm_systemd_unitdir (){
+    import shutil
+    if not bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d):
+        systemd_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_unitdir', True))
+        if os.path.exists(systemd_unitdir):
+            shutil.rmtree(systemd_unitdir)
+        systemd_libdir = os.path.dirname(systemd_unitdir)
+        if (os.path.exists(systemd_libdir) and not os.listdir(systemd_libdir)):
+            os.rmdir(systemd_libdir)
+}
+do_install[postfuncs] += "rm_systemd_unitdir "
+
+python rm_sysvinit_initddir (){
+    import shutil
+    sysv_initddir = oe.path.join(d.getVar("D", True), (d.getVar('INIT_D_DIR', True) or "/etc/init.d"))
+
+    if bb.utils.contains('DISTRO_FEATURES', 'systemd', True, False, d) and \
+        not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) and \
+        os.path.exists(sysv_initddir):
+        systemd_system_unitdir = oe.path.join(d.getVar("D", True), d.getVar('systemd_system_unitdir', True))
+
+        # If systemd_system_unitdir contains anything, delete sysv_initddir
+        if (os.path.exists(systemd_system_unitdir) and os.listdir(systemd_system_unitdir)):
+            shutil.rmtree(sysv_initddir)
+}
+do_install[postfuncs] += "rm_sysvinit_initddir "
diff --git a/meta/classes/terminal.bbclass b/meta/classes/terminal.bbclass
new file mode 100644
index 0000000..e577c6d
--- /dev/null
+++ b/meta/classes/terminal.bbclass
@@ -0,0 +1,94 @@
+OE_TERMINAL ?= 'auto'
+OE_TERMINAL[type] = 'choice'
+OE_TERMINAL[choices] = 'auto none \
+                        ${@" ".join(o.name \
+                                    for o in oe.terminal.prioritized())}'
+
+OE_TERMINAL_EXPORTS += 'EXTRA_OEMAKE'
+OE_TERMINAL_EXPORTS[type] = 'list'
+
+XAUTHORITY ?= "${HOME}/.Xauthority"
+SHELL ?= "bash"
+
+
+def emit_terminal_func(command, envdata, d):
+    cmd_func = 'do_terminal'
+
+    envdata.setVar(cmd_func, 'exec ' + command)
+    envdata.setVarFlag(cmd_func, 'func', 1)
+
+    runfmt = d.getVar('BB_RUNFMT', True) or "run.{func}.{pid}"
+    runfile = runfmt.format(func=cmd_func, task=cmd_func, taskfunc=cmd_func, pid=os.getpid())
+    runfile = os.path.join(d.getVar('T', True), runfile)
+    bb.utils.mkdirhier(os.path.dirname(runfile))
+
+    with open(runfile, 'w') as script:
+        script.write('#!/bin/sh -e\n')
+        bb.data.emit_func(cmd_func, script, envdata)
+        script.write(cmd_func)
+        script.write("\n")
+    os.chmod(runfile, 0755)
+
+    return runfile
+
+def oe_terminal(command, title, d):
+    import oe.data
+    import oe.terminal
+
+    envdata = bb.data.init()
+
+    for v in os.environ:
+        envdata.setVar(v, os.environ[v])
+        envdata.setVarFlag(v, 'export', 1)
+
+    for export in oe.data.typed_value('OE_TERMINAL_EXPORTS', d):
+        value = d.getVar(export, True)
+        if value is not None:
+            os.environ[export] = str(value)
+            envdata.setVar(export, str(value))
+            envdata.setVarFlag(export, 'export', 1)
+        if export == "PSEUDO_DISABLED":
+            if "PSEUDO_UNLOAD" in os.environ:
+                del os.environ["PSEUDO_UNLOAD"]
+            envdata.delVar("PSEUDO_UNLOAD")
+
+    # Add in all variables from the user's original environment which
+    # haven't subsequntly been set/changed
+    origbbenv = d.getVar("BB_ORIGENV", False) or {}
+    for key in origbbenv:
+        if key in envdata:
+            continue
+        value = origbbenv.getVar(key, True)
+        if value is not None:
+            os.environ[key] = str(value)
+            envdata.setVar(key, str(value))
+            envdata.setVarFlag(key, 'export', 1)
+
+    # A complex PS1 might need more escaping of chars.
+    # Lets not export PS1 instead.
+    envdata.delVar("PS1")
+
+    # Replace command with an executable wrapper script
+    command = emit_terminal_func(command, envdata, d)
+
+    terminal = oe.data.typed_value('OE_TERMINAL', d).lower()
+    if terminal == 'none':
+        bb.fatal('Devshell usage disabled with OE_TERMINAL')
+    elif terminal != 'auto':
+        try:
+            oe.terminal.spawn(terminal, command, title, None, d)
+            return
+        except oe.terminal.UnsupportedTerminal:
+            bb.warn('Unsupported terminal "%s", defaulting to "auto"' %
+                    terminal)
+        except oe.terminal.ExecutionError as exc:
+            bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
+
+    try:
+        oe.terminal.spawn_preferred(command, title, None, d)
+    except oe.terminal.NoSupportedTerminals:
+        bb.fatal('No valid terminal found, unable to open devshell')
+    except oe.terminal.ExecutionError as exc:
+        bb.fatal('Unable to spawn terminal %s: %s' % (terminal, exc))
+
+oe_terminal[vardepsexclude] = "BB_ORIGENV"
diff --git a/meta/classes/testimage-auto.bbclass b/meta/classes/testimage-auto.bbclass
new file mode 100644
index 0000000..860599d
--- /dev/null
+++ b/meta/classes/testimage-auto.bbclass
@@ -0,0 +1,23 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+
+# Run tests automatically on an image after the image is constructed
+# (as opposed to testimage.bbclass alone where tests must be called
+# manually using bitbake -c testimage <image>).
+#
+# NOTE: to use this class, simply set TEST_IMAGE = "1" - no need to
+# inherit it since that will be done in image.bbclass when this variable
+# has been set.
+#
+# See testimage.bbclass for the test implementation.
+
+inherit testimage
+
+python do_testimage_auto() {
+    testimage_main(d)
+}
+addtask testimage_auto before do_build after do_rootfs
+do_testimage_auto[depends] += "${TESTIMAGEDEPENDS}"
+do_testimage_auto[lockfiles] += "${TESTIMAGELOCK}"
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
new file mode 100644
index 0000000..a1918ba
--- /dev/null
+++ b/meta/classes/testimage.bbclass
@@ -0,0 +1,422 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+
+# testimage.bbclass enables testing of qemu images using python unittests.
+# Most of the tests are commands run on target image over ssh.
+# To use it add testimage to global inherit and call your target image with -c testimage
+# You can try it out like this:
+# - first build a qemu core-image-sato
+# - add INHERIT += "testimage" in local.conf
+# - then bitbake core-image-sato -c testimage. That will run a standard suite of tests.
+
+# You can set (or append to) TEST_SUITES in local.conf to select the tests
+# which you want to run for your target.
+# The test names are the module names in meta/lib/oeqa/runtime.
+# Each name in TEST_SUITES represents a required test for the image. (no skipping allowed)
+# Appending "auto" means that it will try to run all tests that are suitable for the image (each test decides that on it's own).
+# Note that order in TEST_SUITES is relevant: tests are run in an order such that
+# tests mentioned in @skipUnlessPassed run before the tests that depend on them,
+# but without such dependencies, tests run in the order in which they are listed
+# in TEST_SUITES.
+#
+# A layer can add its own tests in lib/oeqa/runtime, provided it extends BBPATH as normal in its layer.conf.
+
+# TEST_LOG_DIR contains a command ssh log and may contain infromation about what command is running, output and return codes and for qemu a boot log till login.
+# Booting is handled by this class, and it's not a test in itself.
+# TEST_QEMUBOOT_TIMEOUT can be used to set the maximum time in seconds the launch code will wait for the login prompt.
+
+TEST_LOG_DIR ?= "${WORKDIR}/testimage"
+
+TEST_EXPORT_DIR ?= "${TMPDIR}/testimage/${PN}"
+TEST_EXPORT_ONLY ?= "0"
+
+RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'smart rpm', '', d)}"
+
+DEFAULT_TEST_SUITES = "ping auto"
+DEFAULT_TEST_SUITES_pn-core-image-minimal = "ping"
+DEFAULT_TEST_SUITES_pn-core-image-sato = "ping ssh df connman syslog xorg scp vnc date dmesg parselogs ${RPMTESTSUITE} \
+    ${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python', '', d)}"
+DEFAULT_TEST_SUITES_pn-core-image-sato-sdk = "ping ssh df connman syslog xorg scp vnc date perl ldd gcc kernelmodule dmesg python parselogs ${RPMTESTSUITE}"
+DEFAULT_TEST_SUITES_pn-core-image-lsb-sdk = "ping buildcvs buildiptables buildsudoku connman date df gcc kernelmodule ldd pam parselogs perl python scp ${RPMTESTSUITE} ssh syslog logrotate"
+DEFAULT_TEST_SUITES_pn-meta-toolchain = "auto"
+
+# aarch64 has no graphics
+DEFAULT_TEST_SUITES_remove_aarch64 = "xorg vnc"
+
+#qemumips is too slow for buildsudoku
+DEFAULT_TEST_SUITES_remove_qemumips = "buildsudoku"
+
+TEST_SUITES ?= "${DEFAULT_TEST_SUITES}"
+
+TEST_QEMUBOOT_TIMEOUT ?= "1000"
+TEST_TARGET ?= "qemu"
+TEST_TARGET_IP ?= ""
+TEST_SERVER_IP ?= ""
+
+TESTIMAGEDEPENDS = ""
+TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot"
+
+TESTIMAGELOCK = "${TMPDIR}/testimage.lock"
+TESTIMAGELOCK_qemuall = ""
+
+TESTIMAGE_DUMP_DIR ?= "/tmp/oe-saved-tests/"
+
+testimage_dump_target () {
+    top -bn1
+    ps
+    free
+    df
+    # The next command will export the default gateway IP
+    export DEFAULT_GATEWAY=$(ip route | awk '/default/ { print $3}')
+    ping -c3 $DEFAULT_GATEWAY
+    dmesg
+    netstat -an
+    ip address
+    # Next command will dump logs from /var/log/
+    find /var/log/ -type f 2>/dev/null -exec echo "====================" \; -exec echo {} \; -exec echo "====================" \; -exec cat {} \; -exec echo "" \;
+}
+
+testimage_dump_host () {
+    top -bn1
+    ps -ef
+    free
+    df
+    memstat
+    dmesg
+    netstat -an
+}
+
+python do_testimage() {
+    testimage_main(d)
+}
+addtask testimage
+do_testimage[nostamp] = "1"
+do_testimage[depends] += "${TESTIMAGEDEPENDS}"
+do_testimage[lockfiles] += "${TESTIMAGELOCK}"
+
+python do_testsdk() {
+    testsdk_main(d)
+}
+addtask testsdk
+do_testsdk[nostamp] = "1"
+do_testsdk[depends] += "${TESTIMAGEDEPENDS}"
+do_testsdk[lockfiles] += "${TESTIMAGELOCK}"
+
+# get testcase list from specified file
+# if path is a relative path, then relative to build/conf/
+def read_testlist(d, fpath):
+    if not os.path.isabs(fpath):
+        builddir = d.getVar("TOPDIR", True)
+        fpath = os.path.join(builddir, "conf", fpath)
+    if not os.path.exists(fpath):
+        bb.fatal("No such manifest file: ", fpath)
+    tcs = []
+    for line in open(fpath).readlines():
+        line = line.strip()
+        if line and not line.startswith("#"):
+            tcs.append(line)
+    return " ".join(tcs)
+
+def get_tests_list(d, type="runtime"):
+    testsuites = []
+    testslist = []
+    manifests = d.getVar("TEST_SUITES_MANIFEST", True)
+    if manifests is not None:
+        manifests = manifests.split()
+        for manifest in manifests:
+            testsuites.extend(read_testlist(d, manifest).split())
+    else:
+        testsuites = d.getVar("TEST_SUITES", True).split()
+    if type == "sdk":
+        testsuites = (d.getVar("TEST_SUITES_SDK", True) or "auto").split()
+    bbpath = d.getVar("BBPATH", True).split(':')
+
+    # This relies on lib/ under each directory in BBPATH being added to sys.path
+    # (as done by default in base.bbclass)
+    for testname in testsuites:
+        if testname != "auto":
+            if testname.startswith("oeqa."):
+                testslist.append(testname)
+                continue
+            found = False
+            for p in bbpath:
+                if os.path.exists(os.path.join(p, 'lib', 'oeqa', type, testname + '.py')):
+                    testslist.append("oeqa." + type + "." + testname)
+                    found = True
+                    break
+            if not found:
+                bb.fatal('Test %s specified in TEST_SUITES could not be found in lib/oeqa/runtime under BBPATH' % testname)
+
+    if "auto" in testsuites:
+        def add_auto_list(path):
+            if not os.path.exists(os.path.join(path, '__init__.py')):
+                bb.fatal('Tests directory %s exists but is missing __init__.py' % path)
+            files = sorted([f for f in os.listdir(path) if f.endswith('.py') and not f.startswith('_')])
+            for f in files:
+                module = 'oeqa.' + type + '.' + f[:-3]
+                if module not in testslist:
+                    testslist.append(module)
+
+        for p in bbpath:
+            testpath = os.path.join(p, 'lib', 'oeqa', type)
+            bb.debug(2, 'Searching for tests in %s' % testpath)
+            if os.path.exists(testpath):
+                add_auto_list(testpath)
+
+    return testslist
+
+
+def exportTests(d,tc):
+    import json
+    import shutil
+    import pkgutil
+
+    exportpath = d.getVar("TEST_EXPORT_DIR", True)
+
+    savedata = {}
+    savedata["d"] = {}
+    savedata["target"] = {}
+    savedata["host_dumper"] = {}
+    for key in tc.__dict__:
+        # special cases
+        if key != "d" and key != "target" and key != "host_dumper":
+            savedata[key] = getattr(tc, key)
+    savedata["target"]["ip"] = tc.target.ip or d.getVar("TEST_TARGET_IP", True)
+    savedata["target"]["server_ip"] = tc.target.server_ip or d.getVar("TEST_SERVER_IP", True)
+
+    keys = [ key for key in d.keys() if not key.startswith("_") and not key.startswith("BB") \
+            and not key.startswith("B_pn") and not key.startswith("do_") and not d.getVarFlag(key, "func")]
+    for key in keys:
+        try:
+            savedata["d"][key] = d.getVar(key, True)
+        except bb.data_smart.ExpansionError:
+            # we don't care about those anyway
+            pass
+
+    savedata["host_dumper"]["parent_dir"] = tc.host_dumper.parent_dir
+    savedata["host_dumper"]["cmds"] = tc.host_dumper.cmds
+
+    with open(os.path.join(exportpath, "testdata.json"), "w") as f:
+            json.dump(savedata, f, skipkeys=True, indent=4, sort_keys=True)
+
+    # now start copying files
+    # we'll basically copy everything under meta/lib/oeqa, with these exceptions
+    #  - oeqa/targetcontrol.py - not needed
+    #  - oeqa/selftest - something else
+    # That means:
+    #   - all tests from oeqa/runtime defined in TEST_SUITES (including from other layers)
+    #   - the contents of oeqa/utils and oeqa/runtime/files
+    #   - oeqa/oetest.py and oeqa/runexport.py (this will get copied to exportpath not exportpath/oeqa)
+    #   - __init__.py files
+    bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/runtime/files"))
+    bb.utils.mkdirhier(os.path.join(exportpath, "oeqa/utils"))
+    # copy test modules, this should cover tests in other layers too
+    for t in tc.testslist:
+        mod = pkgutil.get_loader(t)
+        shutil.copy2(mod.filename, os.path.join(exportpath, "oeqa/runtime"))
+    # copy __init__.py files
+    oeqadir = pkgutil.get_loader("oeqa").filename
+    shutil.copy2(os.path.join(oeqadir, "__init__.py"), os.path.join(exportpath, "oeqa"))
+    shutil.copy2(os.path.join(oeqadir, "runtime/__init__.py"), os.path.join(exportpath, "oeqa/runtime"))
+    # copy oeqa/oetest.py and oeqa/runexported.py
+    shutil.copy2(os.path.join(oeqadir, "oetest.py"), os.path.join(exportpath, "oeqa"))
+    shutil.copy2(os.path.join(oeqadir, "runexported.py"), exportpath)
+    # copy oeqa/utils/*.py
+    for root, dirs, files in os.walk(os.path.join(oeqadir, "utils")):
+        for f in files:
+            if f.endswith(".py"):
+                shutil.copy2(os.path.join(root, f), os.path.join(exportpath, "oeqa/utils"))
+    # copy oeqa/runtime/files/*
+    for root, dirs, files in os.walk(os.path.join(oeqadir, "runtime/files")):
+        for f in files:
+            shutil.copy2(os.path.join(root, f), os.path.join(exportpath, "oeqa/runtime/files"))
+
+    bb.plain("Exported tests to: %s" % exportpath)
+
+
+def testimage_main(d):
+    import unittest
+    import os
+    import oeqa.runtime
+    import time
+    import signal
+    from oeqa.oetest import loadTests, runTests
+    from oeqa.targetcontrol import get_target_controller
+    from oeqa.utils.dump import get_host_dumper
+
+    pn = d.getVar("PN", True)
+    export = oe.utils.conditional("TEST_EXPORT_ONLY", "1", True, False, d)
+    bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
+    if export:
+        bb.utils.remove(d.getVar("TEST_EXPORT_DIR", True), recurse=True)
+        bb.utils.mkdirhier(d.getVar("TEST_EXPORT_DIR", True))
+
+    # tests in TEST_SUITES become required tests
+    # they won't be skipped even if they aren't suitable for a image (like xorg for minimal)
+    # testslist is what we'll actually pass to the unittest loader
+    testslist = get_tests_list(d)
+    testsrequired = [t for t in d.getVar("TEST_SUITES", True).split() if t != "auto"]
+
+    tagexp = d.getVar("TEST_SUITES_TAGS", True)
+
+    # we need the host dumper in test context
+    host_dumper = get_host_dumper(d)
+
+    # the robot dance
+    target = get_target_controller(d)
+
+    class TestContext(object):
+        def __init__(self):
+            self.d = d
+            self.testslist = testslist
+            self.tagexp = tagexp
+            self.testsrequired = testsrequired
+            self.filesdir = os.path.join(os.path.dirname(os.path.abspath(oeqa.runtime.__file__)),"files")
+            self.target = target
+            self.host_dumper = host_dumper
+            self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split()
+            self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split()
+            manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + ".manifest")
+            self.sigterm = False
+            self.origsigtermhandler = signal.getsignal(signal.SIGTERM)
+            signal.signal(signal.SIGTERM, self.sigterm_exception)
+            try:
+                with open(manifest) as f:
+                    self.pkgmanifest = f.read()
+            except IOError as e:
+                bb.fatal("No package manifest file found. Did you build the image?\n%s" % e)
+
+        def sigterm_exception(self, signum, stackframe):
+            bb.warn("TestImage received SIGTERM, shutting down...")
+            self.sigterm = True
+            self.target.stop()
+
+    # test context
+    tc = TestContext()
+
+    # this is a dummy load of tests
+    # we are doing that to find compile errors in the tests themselves
+    # before booting the image
+    try:
+        loadTests(tc)
+    except Exception as e:
+        import traceback
+        bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
+
+    target.deploy()
+
+    try:
+        target.start()
+        if export:
+            exportTests(d,tc)
+        else:
+            starttime = time.time()
+            result = runTests(tc)
+            stoptime = time.time()
+            if result.wasSuccessful():
+                bb.plain("%s - Ran %d test%s in %.3fs" % (pn, result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime))
+                msg = "%s - OK - All required tests passed" % pn
+                skipped = len(result.skipped)
+                if skipped:
+                    msg += " (skipped=%d)" % skipped
+                bb.plain(msg)
+            else:
+                raise bb.build.FuncFailed("%s - FAILED - check the task log and the ssh log" % pn )
+    finally:
+        signal.signal(signal.SIGTERM, tc.origsigtermhandler)
+        target.stop()
+
+testimage_main[vardepsexclude] =+ "BB_ORIGENV"
+
+
+def testsdk_main(d):
+    import unittest
+    import os
+    import glob
+    import oeqa.runtime
+    import oeqa.sdk
+    import time
+    import subprocess
+    from oeqa.oetest import loadTests, runTests
+
+    pn = d.getVar("PN", True)
+    bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
+
+    # tests in TEST_SUITES become required tests
+    # they won't be skipped even if they aren't suitable.
+    # testslist is what we'll actually pass to the unittest loader
+    testslist = get_tests_list(d, "sdk")
+    testsrequired = [t for t in (d.getVar("TEST_SUITES_SDK", True) or "auto").split() if t != "auto"]
+
+    tcname = d.expand("${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.sh")
+    if not os.path.exists(tcname):
+        bb.fatal("The toolchain is not built. Build it before running the tests: 'bitbake <image> -c populate_sdk' .")
+
+    class TestContext(object):
+        def __init__(self):
+            self.d = d
+            self.testslist = testslist
+            self.testsrequired = testsrequired
+            self.filesdir = os.path.join(os.path.dirname(os.path.abspath(oeqa.runtime.__file__)),"files")
+            self.sdktestdir = sdktestdir
+            self.sdkenv = sdkenv
+            self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split()
+            self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split()
+            manifest = d.getVar("SDK_TARGET_MANIFEST", True)
+            try:
+                with open(manifest) as f:
+                    self.pkgmanifest = f.read()
+            except IOError as e:
+                bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e)
+            hostmanifest = d.getVar("SDK_HOST_MANIFEST", True)
+            try:
+                with open(hostmanifest) as f:
+                    self.hostpkgmanifest = f.read()
+            except IOError as e:
+                bb.fatal("No host package manifest file found. Did you build the sdk image?\n%s" % e)
+
+    sdktestdir = d.expand("${WORKDIR}/testimage-sdk/")
+    bb.utils.remove(sdktestdir, True)
+    bb.utils.mkdirhier(sdktestdir)
+    try:
+        subprocess.check_output("cd %s; %s <<EOF\n./tc\nY\nEOF" % (sdktestdir, tcname), shell=True)
+    except subprocess.CalledProcessError as e:
+        bb.fatal("Couldn't install the SDK:\n%s" % e.output)
+
+    try:
+        targets = glob.glob(d.expand(sdktestdir + "/tc/environment-setup-*"))
+        bb.warn(str(targets))
+        for sdkenv in targets:
+            bb.plain("Testing %s" % sdkenv)
+            # test context
+            tc = TestContext()
+
+            # this is a dummy load of tests
+            # we are doing that to find compile errors in the tests themselves
+            # before booting the image
+            try:
+                loadTests(tc, "sdk")
+            except Exception as e:
+                import traceback
+                bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
+
+    
+            starttime = time.time()
+            result = runTests(tc, "sdk")
+            stoptime = time.time()
+            if result.wasSuccessful():
+                bb.plain("%s SDK(%s):%s - Ran %d test%s in %.3fs" % (pn, os.path.basename(tcname), os.path.basename(sdkenv),result.testsRun, result.testsRun != 1 and "s" or "", stoptime - starttime))
+                msg = "%s - OK - All required tests passed" % pn
+                skipped = len(result.skipped)
+                if skipped:
+                    msg += " (skipped=%d)" % skipped
+                bb.plain(msg)
+            else:
+                raise bb.build.FuncFailed("%s - FAILED - check the task log and the commands log" % pn )
+    finally:
+        bb.utils.remove(sdktestdir, True)
+
+testsdk_main[vardepsexclude] =+ "BB_ORIGENV"
+
diff --git a/meta/classes/texinfo.bbclass b/meta/classes/texinfo.bbclass
new file mode 100644
index 0000000..92efbcc
--- /dev/null
+++ b/meta/classes/texinfo.bbclass
@@ -0,0 +1,15 @@
+# This class is inherited by recipes whose upstream packages invoke the
+# texinfo utilities at build-time. Native and cross recipes are made to use the
+# dummy scripts provided by texinfo-dummy-native, for improved performance. 
+# Target architecture recipes use the genuine Texinfo utilities. By default, 
+# they use the Texinfo utilities on the host system. If you want to use the
+# Texinfo recipe shipped with yoco, you can remove texinfo-native from 
+# ASSUME_PROVIDED and makeinfo from SANITY_REQUIRED_UTILITIES.
+
+TEXDEP = "texinfo-native"
+TEXDEP_class-native = "texinfo-dummy-native"
+TEXDEP_class-cross = "texinfo-dummy-native"
+DEPENDS_append = " ${TEXDEP}"
+PATH_prepend_class-native = "${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:"
+PATH_prepend_class-cross = "${STAGING_BINDIR_NATIVE}/texinfo-dummy-native:"
+
diff --git a/meta/classes/tinderclient.bbclass b/meta/classes/tinderclient.bbclass
new file mode 100644
index 0000000..6984efd
--- /dev/null
+++ b/meta/classes/tinderclient.bbclass
@@ -0,0 +1,368 @@
+def tinder_http_post(server, selector, content_type, body):
+    import httplib
+    # now post it
+    for i in range(0,5):
+        try:
+            h = httplib.HTTP(server)
+            h.putrequest('POST', selector)
+            h.putheader('content-type', content_type)
+            h.putheader('content-length', str(len(body)))
+            h.endheaders()
+            h.send(body)
+            errcode, errmsg, headers = h.getreply()
+            #print errcode, errmsg, headers
+            return (errcode,errmsg, headers, h.file)
+        except:
+            print "Error sending the report!"
+            # try again
+            pass
+
+    # return some garbage
+    return (-1, "unknown", "unknown", None)
+
+def tinder_form_data(bound, dict, log):
+    output = []
+    # for each key in the dictionary
+    for name in dict:
+        assert dict[name]
+        output.append( "--" + bound )
+        output.append( 'Content-Disposition: form-data; name="%s"' % name )
+        output.append( "" )
+        output.append( dict[name] )
+    if log:
+        output.append( "--" + bound )
+        output.append( 'Content-Disposition: form-data; name="log"; filename="log.txt"' )
+        output.append( '' )
+        output.append( log )
+    output.append( '--' + bound + '--' )
+    output.append( '' )
+
+    return "\r\n".join(output)
+
+def tinder_time_string():
+    """
+    Return the time as GMT
+    """
+    return ""
+
+def tinder_format_http_post(d,status,log):
+    """
+    Format the Tinderbox HTTP post with the data needed
+    for the tinderbox to be happy.
+    """
+
+    import random
+
+    # the variables we will need to send on this form post
+    variables =  {
+        "tree"         : d.getVar('TINDER_TREE', True),
+        "machine_name" : d.getVar('TINDER_MACHINE', True),
+        "os"           : os.uname()[0],
+        "os_version"   : os.uname()[2],
+        "compiler"     : "gcc",
+        "clobber"      : d.getVar('TINDER_CLOBBER', True) or "0",
+        "srcdate"      : d.getVar('SRCDATE', True),
+        "PN"           : d.getVar('PN', True),
+        "PV"           : d.getVar('PV', True),
+        "PR"           : d.getVar('PR', True),
+        "FILE"         : d.getVar('FILE', True) or "N/A",
+        "TARGETARCH"   : d.getVar('TARGET_ARCH', True),
+        "TARGETFPU"    : d.getVar('TARGET_FPU', True) or "Unknown",
+        "TARGETOS"     : d.getVar('TARGET_OS', True) or "Unknown",
+        "MACHINE"      : d.getVar('MACHINE', True) or "Unknown",
+        "DISTRO"       : d.getVar('DISTRO', True) or "Unknown",
+        "zecke-rocks"  : "sure",
+    }
+
+    # optionally add the status
+    if status:
+        variables["status"] = str(status)
+
+    # try to load the machine id
+    # we only need on build_status.pl but sending it
+    # always does not hurt
+    try:
+        f = file(d.getVar('TMPDIR',True)+'/tinder-machine.id', 'r')
+        id = f.read()
+        variables['machine_id'] = id
+    except:
+        pass
+
+    # the boundary we will need
+    boundary = "----------------------------------%d" % int(random.random()*1000000000000)
+
+    # now format the body
+    body = tinder_form_data( boundary, variables, log )
+
+    return ("multipart/form-data; boundary=%s" % boundary),body
+
+
+def tinder_build_start(d):
+    """
+    Inform the tinderbox that a build is starting. We do this
+    by posting our name and tree to the build_start.pl script
+    on the server.
+    """
+
+    # get the body and type
+    content_type, body = tinder_format_http_post(d,None,None)
+    server = d.getVar('TINDER_HOST', True )
+    url    = d.getVar('TINDER_URL', True )
+
+    selector = url + "/xml/build_start.pl"
+
+    #print "selector %s and url %s" % (selector, url)
+
+    # now post it
+    errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body)
+    #print errcode, errmsg, headers
+    report = h_file.read()
+
+    # now let us find the machine id that was assigned to us
+    search = "<machine id='"
+    report = report[report.find(search)+len(search):]
+    report = report[0:report.find("'")]
+
+    bb.note("Machine ID assigned by tinderbox: %s" % report )
+
+    # now we will need to save the machine number
+    # we will override any previous numbers
+    f = file(d.getVar('TMPDIR', True)+"/tinder-machine.id", 'w')
+    f.write(report)
+
+
+def tinder_send_http(d, status, _log):
+    """
+    Send this log as build status
+    """
+
+    # get the body and type
+    server = d.getVar('TINDER_HOST', True)
+    url    = d.getVar('TINDER_URL', True)
+
+    selector = url + "/xml/build_status.pl"
+
+    # now post it - in chunks of 10.000 charachters
+    new_log = _log
+    while len(new_log) > 0:
+        content_type, body = tinder_format_http_post(d,status,new_log[0:18000])
+        errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body)
+        #print errcode, errmsg, headers
+        #print h.file.read()
+        new_log = new_log[18000:]
+
+
+def tinder_print_info(d):
+    """
+    Print the TinderBox Info
+        Including informations of the BaseSystem and the Tree
+        we use.
+    """
+
+    # get the local vars
+    time    = tinder_time_string()
+    ops     = os.uname()[0]
+    version = os.uname()[2]
+    url     = d.getVar( 'TINDER_URL' , True )
+    tree    = d.getVar( 'TINDER_TREE', True )
+    branch  = d.getVar( 'TINDER_BRANCH', True )
+    srcdate = d.getVar( 'SRCDATE', True )
+    machine = d.getVar( 'MACHINE', True )
+    distro  = d.getVar( 'DISTRO', True )
+    bbfiles = d.getVar( 'BBFILES', True )
+    tarch   = d.getVar( 'TARGET_ARCH', True )
+    fpu     = d.getVar( 'TARGET_FPU', True )
+    oerev   = d.getVar( 'OE_REVISION', True ) or "unknown"
+
+    # there is a bug with tipple quoted strings
+    # i will work around but will fix the original
+    # bug as well
+    output = []
+    output.append("== Tinderbox Info" )
+    output.append("Time: %(time)s" )
+    output.append("OS: %(ops)s" )
+    output.append("%(version)s" )
+    output.append("Compiler: gcc" )
+    output.append("Tinderbox Client: 0.1" )
+    output.append("Tinderbox Client Last Modified: yesterday" )
+    output.append("Tinderbox Protocol: 0.1" )
+    output.append("URL: %(url)s" )
+    output.append("Tree: %(tree)s" )
+    output.append("Config:" )
+    output.append("branch = '%(branch)s'" )
+    output.append("TARGET_ARCH = '%(tarch)s'" )
+    output.append("TARGET_FPU = '%(fpu)s'" )
+    output.append("SRCDATE = '%(srcdate)s'" )
+    output.append("MACHINE = '%(machine)s'" )
+    output.append("DISTRO = '%(distro)s'" )
+    output.append("BBFILES = '%(bbfiles)s'" )
+    output.append("OEREV = '%(oerev)s'" )
+    output.append("== End Tinderbox Client Info" )
+
+    # now create the real output
+    return "\n".join(output) % vars()
+
+
+def tinder_print_env():
+    """
+    Print the environment variables of this build
+    """
+    time_start = tinder_time_string()
+    time_end   = tinder_time_string()
+
+    # build the environment
+    env = ""
+    for var in os.environ:
+        env += "%s=%s\n" % (var, os.environ[var])
+
+    output = []
+    output.append( "---> TINDERBOX RUNNING env %(time_start)s" )
+    output.append( env )
+    output.append( "<--- TINDERBOX FINISHED (SUCCESS) %(time_end)s" )
+
+    return "\n".join(output) % vars()
+
+def tinder_tinder_start(d, event):
+    """
+    PRINT the configuration of this build
+    """
+
+    time_start = tinder_time_string()
+    config = tinder_print_info(d)
+    #env    = tinder_print_env()
+    time_end   = tinder_time_string()
+    packages = " ".join( event.getPkgs() ) 
+
+    output = []
+    output.append( "---> TINDERBOX PRINTING CONFIGURATION %(time_start)s" )
+    output.append( config )
+    #output.append( env    )
+    output.append( "<--- TINDERBOX FINISHED PRINTING CONFIGURATION %(time_end)s" )
+    output.append( "---> TINDERBOX BUILDING '%(packages)s'" )
+    output.append( "<--- TINDERBOX STARTING BUILD NOW" )
+
+    output.append( "" )
+
+    return "\n".join(output) % vars()
+
+def tinder_do_tinder_report(event):
+    """
+    Report to the tinderbox:
+        On the BuildStart we will inform the box directly
+        On the other events we will write to the TINDER_LOG and
+        when the Task is finished we will send the report.
+
+    The above is not yet fully implemented. Currently we send
+    information immediately. The caching/queuing needs to be
+    implemented. Also sending more or less information is not
+    implemented yet.
+
+    We have two temporary files stored in the TMP directory. One file
+    contains the assigned machine id for the tinderclient. This id gets
+    assigned when we connect the box and start the build process the second
+    file is used to workaround an EventHandler limitation. If BitBake is ran
+    with the continue option we want the Build to fail even if we get the
+    BuildCompleted Event. In this case we have to look up the status and
+    send it instead of 100/success.
+    """
+    import glob
+
+    # variables
+    name = bb.event.getName(event)
+    log  = ""
+    status = 1
+    # Check what we need to do Build* shows we start or are done
+    if name == "BuildStarted":
+        tinder_build_start(event.data)
+        log = tinder_tinder_start(event.data,event)
+
+        try:
+            # truncate the tinder log file
+            f = file(event.data.getVar('TINDER_LOG', True), 'w')
+            f.write("")
+            f.close()
+        except:
+            pass
+
+        try:
+            # write a status to the file. This is needed for the -k option
+            # of BitBake
+            g = file(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w')
+            g.write("")
+            g.close()
+        except IOError:
+            pass
+
+    # Append the Task-Log (compile,configure...) to the log file
+    # we will send to the server
+    if name == "TaskSucceeded" or name == "TaskFailed":
+        log_file = glob.glob("%s/log.%s.*" % (event.data.getVar('T', True), event.task))
+
+        if len(log_file) != 0:
+            to_file  = event.data.getVar('TINDER_LOG', True)
+            log     += "".join(open(log_file[0], 'r').readlines())
+
+    # set the right 'HEADER'/Summary for the TinderBox
+    if name == "TaskStarted":
+        log += "---> TINDERBOX Task %s started\n" % event.task
+    elif name == "TaskSucceeded":
+        log += "<--- TINDERBOX Task %s done (SUCCESS)\n" % event.task
+    elif name == "TaskFailed":
+        log += "<--- TINDERBOX Task %s failed (FAILURE)\n" % event.task
+    elif name == "PkgStarted":
+        log += "---> TINDERBOX Package %s started\n" % event.data.getVar('PF', True)
+    elif name == "PkgSucceeded":
+        log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % event.data.getVar('PF', True)
+    elif name == "PkgFailed":
+        if not event.data.getVar('TINDER_AUTOBUILD', True) == "0":
+            build.exec_task('do_clean', event.data)
+        log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % event.data.getVar('PF', True)
+        status = 200
+        # remember the failure for the -k case
+        h = file(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w')
+        h.write("200")
+    elif name == "BuildCompleted":
+        log += "Build Completed\n"
+        status = 100
+        # Check if we have a old status...
+        try:
+            h = file(event.data.getVar('TMPDIR',True)+'/tinder-status', 'r')
+            status = int(h.read())
+        except:
+            pass
+
+    elif name == "MultipleProviders":
+        log += "---> TINDERBOX Multiple Providers\n"
+        log += "multiple providers are available (%s);\n" % ", ".join(event.getCandidates())
+        log += "consider defining PREFERRED_PROVIDER_%s\n" % event.getItem()
+        log += "is runtime: %d\n" % event.isRuntime()
+        log += "<--- TINDERBOX Multiple Providers\n"
+    elif name == "NoProvider":
+        log += "Error: No Provider for: %s\n" % event.getItem()
+        log += "Error:Was Runtime: %d\n" % event.isRuntime()
+        status = 200
+        # remember the failure for the -k case
+        h = file(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w')
+        h.write("200")
+
+    # now post the log
+    if len(log) == 0:
+        return
+
+    # for now we will use the http post method as it is the only one
+    log_post_method = tinder_send_http
+    log_post_method(event.data, status, log)
+
+
+# we want to be an event handler
+addhandler tinderclient_eventhandler
+python tinderclient_eventhandler() {
+    if e.data is None or bb.event.getName(e) == "MsgNote":
+        return
+
+    do_tinder_report = e.data.getVar('TINDER_REPORT', True)
+    if do_tinder_report and do_tinder_report == "1":
+        tinder_do_tinder_report(e)
+
+    return
+}
diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
new file mode 100644
index 0000000..d63cff5
--- /dev/null
+++ b/meta/classes/toaster.bbclass
@@ -0,0 +1,355 @@
+#
+# Toaster helper class
+#
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+#
+# This bbclass is designed to extract data used by OE-Core during the build process,
+# for recording in the Toaster system.
+# The data access is synchronous, preserving the build data integrity across
+# different builds.
+#
+# The data is transferred through the event system, using the MetadataEvent objects.
+#
+# The model is to enable the datadump functions as postfuncs, and have the dump
+# executed after the real taskfunc has been executed. This prevents task signature changing
+# is toaster is enabled or not. Build performance is not affected if Toaster is not enabled.
+#
+# To enable, use INHERIT in local.conf:
+#
+#       INHERIT += "toaster"
+#
+#
+#
+#
+
+# Find and dump layer info when we got the layers parsed
+
+
+
+python toaster_layerinfo_dumpdata() {
+    import subprocess
+
+    def _get_git_branch(layer_path):
+        branch = subprocess.Popen("git symbolic-ref HEAD 2>/dev/null ", cwd=layer_path, shell=True, stdout=subprocess.PIPE).communicate()[0]
+        branch = branch.replace('refs/heads/', '').rstrip()
+        return branch
+
+    def _get_git_revision(layer_path):
+        revision = subprocess.Popen("git rev-parse HEAD 2>/dev/null ", cwd=layer_path, shell=True, stdout=subprocess.PIPE).communicate()[0].rstrip()
+        return revision
+
+    def _get_url_map_name(layer_name):
+        """ Some layers have a different name on openembedded.org site,
+            this method returns the correct name to use in the URL
+        """
+
+        url_name = layer_name
+        url_mapping = {'meta': 'openembedded-core'}
+
+        for key in url_mapping.keys():
+            if key == layer_name:
+                url_name = url_mapping[key]
+
+        return url_name
+
+    def _get_layer_version_information(layer_path):
+
+        layer_version_info = {}
+        layer_version_info['branch'] = _get_git_branch(layer_path)
+        layer_version_info['commit'] = _get_git_revision(layer_path)
+        layer_version_info['priority'] = 0
+
+        return layer_version_info
+
+
+    def _get_layer_dict(layer_path):
+
+        layer_info = {}
+        layer_name = layer_path.split('/')[-1]
+        layer_url = 'http://layers.openembedded.org/layerindex/layer/{layer}/'
+        layer_url_name = _get_url_map_name(layer_name)
+
+        layer_info['name'] = layer_url_name
+        layer_info['local_path'] = layer_path
+        layer_info['layer_index_url'] = layer_url.format(layer=layer_url_name)
+        layer_info['version'] = _get_layer_version_information(layer_path)
+
+        return layer_info
+
+
+    bblayers = e.data.getVar("BBLAYERS", True)
+
+    llayerinfo = {}
+
+    for layer in { l for l in bblayers.strip().split(" ") if len(l) }:
+        llayerinfo[layer] = _get_layer_dict(layer)
+
+
+    bb.event.fire(bb.event.MetadataEvent("LayerInfo", llayerinfo), e.data)
+}
+
+# Dump package file info data
+
+def _toaster_load_pkgdatafile(dirpath, filepath):
+    import json
+    import re
+    pkgdata = {}
+    with open(os.path.join(dirpath, filepath), "r") as fin:
+        for line in fin:
+            try:
+                kn, kv = line.strip().split(": ", 1)
+                m = re.match(r"^PKG_([^A-Z:]*)", kn)
+                if m:
+                    pkgdata['OPKGN'] = m.group(1)
+                kn = "_".join([x for x in kn.split("_") if x.isupper()])
+                pkgdata[kn] = kv.strip()
+                if kn == 'FILES_INFO':
+                    pkgdata[kn] = json.loads(kv)
+
+            except ValueError:
+                pass    # ignore lines without valid key: value pairs
+    return pkgdata
+
+
+python toaster_package_dumpdata() {
+    """
+    Dumps the data created by emit_pkgdata
+    """
+    # replicate variables from the package.bbclass
+
+    packages = d.getVar('PACKAGES', True)
+    pkgdest = d.getVar('PKGDEST', True)
+
+    pkgdatadir = d.getVar('PKGDESTWORK', True)
+
+    # scan and send data for each package
+
+    lpkgdata = {}
+    for pkg in packages.split():
+
+        lpkgdata = _toaster_load_pkgdatafile(pkgdatadir + "/runtime/", pkg)
+
+        # Fire an event containing the pkg data
+        bb.event.fire(bb.event.MetadataEvent("SinglePackageInfo", lpkgdata), d)
+}
+
+# 2. Dump output image files information
+
+python toaster_image_dumpdata() {
+    """
+    Image filename for output images is not standardized.
+    image_types.bbclass will spell out IMAGE_CMD_xxx variables that actually
+    have hardcoded ways to create image file names in them.
+    So we look for files starting with the set name.
+    """
+
+    deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE', True);
+    image_name = d.getVar('IMAGE_NAME', True);
+
+    image_info_data = {}
+    artifact_info_data = {}
+
+    # collect all artifacts
+    for dirpath, dirnames, filenames in os.walk(deploy_dir_image):
+        for fn in filenames:
+            try:
+                if fn.startswith(image_name):
+                    image_output = os.path.join(dirpath, fn)
+                    image_info_data[image_output] = os.stat(image_output).st_size
+                else:
+                    import stat
+                    artifact_path = os.path.join(dirpath, fn)
+                    filestat = os.stat(artifact_path)
+                    if not os.path.islink(artifact_path):
+                        artifact_info_data[artifact_path] = filestat.st_size
+            except OSError as e:
+                bb.event.fire(bb.event.MetadataEvent("OSErrorException", e), d)
+
+    bb.event.fire(bb.event.MetadataEvent("ImageFileSize",image_info_data), d)
+    bb.event.fire(bb.event.MetadataEvent("ArtifactFileSize",artifact_info_data), d)
+}
+
+
+
+# collect list of buildstats files based on fired events; when the build completes, collect all stats and fire an event with collected data
+
+python toaster_collect_task_stats() {
+    import bb.build
+    import bb.event
+    import bb.data
+    import bb.utils
+    import os
+
+    if not e.data.getVar('BUILDSTATS_BASE', True):
+        return  # if we don't have buildstats, we cannot collect stats
+
+    def _append_read_list(v):
+        lock = bb.utils.lockfile(e.data.expand("${TOPDIR}/toaster.lock"), False, True)
+
+        with open(os.path.join(e.data.getVar('BUILDSTATS_BASE', True), "toasterstatlist"), "a") as fout:
+            bn = get_bn(e)
+            bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn)
+            taskdir = os.path.join(bsdir, e.data.expand("${PF}"))
+            fout.write("%s::%s::%s::%s\n" % (e.taskfile, e.taskname, os.path.join(taskdir, e.task), e.data.expand("${PN}")))
+
+        bb.utils.unlockfile(lock)
+
+    def _read_stats(filename):
+        cpu_usage = 0
+        disk_io = 0
+        startio = '0'
+        endio = '0'
+        started = '0'
+        ended = '0'
+        pn = ''
+        taskname = ''
+        statinfo = {}
+
+        with open(filename, 'r') as task_bs:
+            for line in task_bs.readlines():
+                k,v = line.strip().split(": ", 1)
+                statinfo[k] = v
+
+        if "CPU usage" in statinfo:
+            cpu_usage = str(statinfo["CPU usage"]).strip('% \n\r')
+
+        if "EndTimeIO" in statinfo:
+            endio = str(statinfo["EndTimeIO"]).strip('% \n\r')
+
+        if "StartTimeIO" in statinfo:
+            startio = str(statinfo["StartTimeIO"]).strip('% \n\r')
+
+        if "Started" in statinfo:
+            started = str(statinfo["Started"]).strip('% \n\r')
+
+        if "Ended" in statinfo:
+            ended = str(statinfo["Ended"]).strip('% \n\r')
+
+        disk_io = int(endio) - int(startio)
+
+        elapsed_time = float(ended) - float(started)
+
+        cpu_usage = float(cpu_usage)
+
+        return {'cpu_usage': cpu_usage, 'disk_io': disk_io, 'elapsed_time': elapsed_time}
+
+
+    if isinstance(e, (bb.build.TaskSucceeded, bb.build.TaskFailed)):
+        _append_read_list(e)
+        pass
+
+
+    if isinstance(e, bb.event.BuildCompleted) and os.path.exists(os.path.join(e.data.getVar('BUILDSTATS_BASE', True), "toasterstatlist")):
+        events = []
+        with open(os.path.join(e.data.getVar('BUILDSTATS_BASE', True), "toasterstatlist"), "r") as fin:
+            for line in fin:
+                (taskfile, taskname, filename, recipename) = line.strip().split("::")
+                events.append((taskfile, taskname, _read_stats(filename), recipename))
+        bb.event.fire(bb.event.MetadataEvent("BuildStatsList", events), e.data)
+        os.unlink(os.path.join(e.data.getVar('BUILDSTATS_BASE', True), "toasterstatlist"))
+}
+
+# dump relevant build history data as an event when the build is completed
+
+python toaster_buildhistory_dump() {
+    import re
+    BUILDHISTORY_DIR = e.data.expand("${TOPDIR}/buildhistory")
+    BUILDHISTORY_DIR_IMAGE_BASE = e.data.expand("%s/images/${MACHINE_ARCH}/${TCLIBC}/"% BUILDHISTORY_DIR)
+    pkgdata_dir = e.data.getVar("PKGDATA_DIR", True)
+
+
+    # scan the build targets for this build
+    images = {}
+    allpkgs = {}
+    files = {}
+    for target in e._pkgs:
+        installed_img_path = e.data.expand(os.path.join(BUILDHISTORY_DIR_IMAGE_BASE, target))
+        if os.path.exists(installed_img_path):
+            images[target] = {}
+            files[target] = {}
+            files[target]['dirs'] = []
+            files[target]['syms'] = []
+            files[target]['files'] = []
+            with open("%s/installed-package-sizes.txt" % installed_img_path, "r") as fin:
+                for line in fin:
+                    line = line.rstrip(";")
+                    psize, px = line.split("\t")
+                    punit, pname = px.split(" ")
+                    # this size is "installed-size" as it measures how much space it takes on disk
+                    images[target][pname.strip()] = {'size':int(psize)*1024, 'depends' : []}
+
+            with open("%s/depends.dot" % installed_img_path, "r") as fin:
+                p = re.compile(r' -> ')
+                dot = re.compile(r'.*style=dotted')
+                for line in fin:
+                    line = line.rstrip(';')
+                    linesplit = p.split(line)
+                    if len(linesplit) == 2:
+                        pname = linesplit[0].rstrip('"').strip('"')
+                        dependsname = linesplit[1].split(" ")[0].strip().strip(";").strip('"').rstrip('"')
+                        deptype = "depends"
+                        if dot.match(line):
+                            deptype = "recommends"
+                        if not pname in images[target]:
+                            images[target][pname] = {'size': 0, 'depends' : []}
+                        if not dependsname in images[target]:
+                            images[target][dependsname] = {'size': 0, 'depends' : []}
+                        images[target][pname]['depends'].append((dependsname, deptype))
+
+            with open("%s/files-in-image.txt" % installed_img_path, "r") as fin:
+                for line in fin:
+                    lc = [ x for x in line.strip().split(" ") if len(x) > 0 ]
+                    if lc[0].startswith("l"):
+                        files[target]['syms'].append(lc)
+                    elif lc[0].startswith("d"):
+                        files[target]['dirs'].append(lc)
+                    else:
+                        files[target]['files'].append(lc)
+
+            for pname in images[target]:
+                if not pname in allpkgs:
+                    try:
+                        pkgdata = _toaster_load_pkgdatafile("%s/runtime-reverse/" % pkgdata_dir, pname)
+                    except IOError as err:
+                        if err.errno == 2:
+                            # We expect this e.g. for RRECOMMENDS that are unsatisfied at runtime
+                            continue
+                        else:
+                            raise
+                    allpkgs[pname] = pkgdata
+
+
+    data = { 'pkgdata' : allpkgs, 'imgdata' : images, 'filedata' : files }
+
+    bb.event.fire(bb.event.MetadataEvent("ImagePkgList", data), e.data)
+
+}
+
+# dump information related to license manifest path
+
+python toaster_licensemanifest_dump() {
+    deploy_dir = d.getVar('DEPLOY_DIR', True);
+    image_name = d.getVar('IMAGE_NAME', True);
+
+    data = { 'deploy_dir' : deploy_dir, 'image_name' : image_name }
+
+    bb.event.fire(bb.event.MetadataEvent("LicenseManifestPath", data), d)
+}
+
+# set event handlers
+addhandler toaster_layerinfo_dumpdata
+toaster_layerinfo_dumpdata[eventmask] = "bb.event.TreeDataPreparationCompleted"
+
+addhandler toaster_collect_task_stats
+toaster_collect_task_stats[eventmask] = "bb.event.BuildCompleted bb.build.TaskSucceeded bb.build.TaskFailed"
+
+addhandler toaster_buildhistory_dump
+toaster_buildhistory_dump[eventmask] = "bb.event.BuildCompleted"
+do_package[postfuncs] += "toaster_package_dumpdata "
+do_package[vardepsexclude] += "toaster_package_dumpdata "
+
+do_rootfs[postfuncs] += "toaster_image_dumpdata "
+do_rootfs[postfuncs] += "toaster_licensemanifest_dump "
+do_rootfs[vardepsexclude] += "toaster_image_dumpdata toaster_licensemanifest_dump"
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
new file mode 100644
index 0000000..d0b2b91
--- /dev/null
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -0,0 +1,154 @@
+inherit siteinfo kernel-arch
+
+# We want to be able to change the value of MULTIMACH_TARGET_SYS, because it
+# doesn't always match our expectations... but we default to the stock value
+REAL_MULTIMACH_TARGET_SYS ?= "${MULTIMACH_TARGET_SYS}"
+TARGET_CC_ARCH_append_libc-uclibc = " -muclibc"
+TARGET_CC_ARCH_append_libc-musl = " -mmusl"
+
+# This function creates an environment-setup-script for use in a deployable SDK
+toolchain_create_sdk_env_script () {
+	# Create environment setup script
+	sdkpathnative=${7:-${SDKPATHNATIVE}}
+	prefix=${6:-${prefix_nativesdk}}
+	bindir=${5:-${bindir_nativesdk}}
+	libdir=${4:-${libdir}}
+	sysroot=${3:-${SDKTARGETSYSROOT}}
+	multimach_target_sys=${2:-${REAL_MULTIMACH_TARGET_SYS}}
+	script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-$multimach_target_sys}
+	rm -f $script
+	touch $script
+	echo 'export SDKTARGETSYSROOT='"$sysroot" >> $script
+	EXTRAPATH=""
+	for i in ${CANADIANEXTRAOS}; do
+		EXTRAPATH="$EXTRAPATH:$sdkpathnative$bindir/${TARGET_ARCH}${TARGET_VENDOR}-$i"
+	done
+	echo "export PATH=$sdkpathnative$bindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':$PATH' >> $script
+	echo "export CCACHE_PATH=$sdkpathnative$bindir:$sdkpathnative$bindir/../${HOST_SYS}/bin:$sdkpathnative$bindir/${TARGET_SYS}"$EXTRAPATH':$CCACHE_PATH' >> $script
+	echo 'export PKG_CONFIG_SYSROOT_DIR=$SDKTARGETSYSROOT' >> $script
+	echo 'export PKG_CONFIG_PATH=$SDKTARGETSYSROOT'"$libdir"'/pkgconfig' >> $script
+	echo 'export CONFIG_SITE=${SDKPATH}/site-config-'"${multimach_target_sys}" >> $script
+	echo "export OECORE_NATIVE_SYSROOT=\"$sdkpathnative\"" >> $script
+	echo 'export OECORE_TARGET_SYSROOT="$SDKTARGETSYSROOT"' >> $script
+	echo "export OECORE_ACLOCAL_OPTS=\"-I $sdkpathnative/usr/share/aclocal\"" >> $script
+	echo "export PYTHONHOME=$sdkpathnative$prefix" >> $script
+
+	toolchain_shared_env_script
+}
+
+# This function creates an environment-setup-script in the TMPDIR which enables
+# a OE-core IDE to integrate with the build tree
+toolchain_create_tree_env_script () {
+	script=${TMPDIR}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
+	rm -f $script
+	touch $script
+	echo 'export PATH=${STAGING_DIR_NATIVE}/usr/bin:${PATH}' >> $script
+	echo 'export CCACHE_PATH=${STAGING_DIR_NATIVE}/usr/bin:${CCACHE_PATH}' >> $script
+	echo 'export PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR}' >> $script
+	echo 'export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}' >> $script
+	echo 'export CONFIG_SITE="${@siteinfo_get_files(d)}"' >> $script
+	echo 'export SDKTARGETSYSROOT=${STAGING_DIR_TARGET}' >> $script
+	echo 'export OECORE_NATIVE_SYSROOT="${STAGING_DIR_NATIVE}"' >> $script
+	echo 'export OECORE_TARGET_SYSROOT="${STAGING_DIR_TARGET}"' >> $script
+	echo 'export OECORE_ACLOCAL_OPTS="-I ${STAGING_DIR_NATIVE}/usr/share/aclocal"' >> $script
+
+	toolchain_shared_env_script
+}
+
+toolchain_shared_env_script () {
+	echo 'export CC="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+	echo 'export CXX="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+	echo 'export CPP="${TARGET_PREFIX}gcc -E ${TARGET_CC_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+	echo 'export AS="${TARGET_PREFIX}as ${TARGET_AS_ARCH}"' >> $script
+	echo 'export LD="${TARGET_PREFIX}ld ${TARGET_LD_ARCH} --sysroot=$SDKTARGETSYSROOT"' >> $script
+	echo 'export GDB=${TARGET_PREFIX}gdb' >> $script
+	echo 'export STRIP=${TARGET_PREFIX}strip' >> $script
+	echo 'export RANLIB=${TARGET_PREFIX}ranlib' >> $script
+	echo 'export OBJCOPY=${TARGET_PREFIX}objcopy' >> $script
+	echo 'export OBJDUMP=${TARGET_PREFIX}objdump' >> $script
+	echo 'export AR=${TARGET_PREFIX}ar' >> $script
+	echo 'export NM=${TARGET_PREFIX}nm' >> $script
+	echo 'export M4=m4' >> $script
+	echo 'export TARGET_PREFIX=${TARGET_PREFIX}' >> $script
+	echo 'export CONFIGURE_FLAGS="--target=${TARGET_SYS} --host=${TARGET_SYS} --build=${SDK_ARCH}-linux --with-libtool-sysroot=$SDKTARGETSYSROOT"' >> $script
+	echo 'export CFLAGS="${TARGET_CFLAGS}"' >> $script
+	echo 'export CXXFLAGS="${TARGET_CXXFLAGS}"' >> $script
+	echo 'export LDFLAGS="${TARGET_LDFLAGS}"' >> $script
+	echo 'export CPPFLAGS="${TARGET_CPPFLAGS}"' >> $script
+	echo 'export KCFLAGS="--sysroot=$SDKTARGETSYSROOT"' >> $script
+	echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
+	echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
+	echo 'export ARCH=${ARCH}' >> $script
+	echo 'export CROSS_COMPILE=${TARGET_PREFIX}' >> $script
+
+    cat >> $script <<EOF
+
+# Append environment subscripts
+if [ -d "\$OECORE_TARGET_SYSROOT/environment-setup.d" ]; then
+    for envfile in \$OECORE_TARGET_SYSROOT/environment-setup.d/*.sh; do
+	    source \$envfile
+    done
+fi
+if [ -d "\$OECORE_NATIVE_SYSROOT/environment-setup.d" ]; then
+    for envfile in \$OECORE_NATIVE_SYSROOT/environment-setup.d/*.sh; do
+	    source \$envfile
+    done
+fi
+EOF
+}
+
+#we get the cached site config in the runtime
+TOOLCHAIN_CONFIGSITE_NOCACHE = "${@siteinfo_get_files(d, True)}"
+TOOLCHAIN_CONFIGSITE_SYSROOTCACHE = "${STAGING_DIR}/${MLPREFIX}${MACHINE}/${target_datadir}/${TARGET_SYS}_config_site.d"
+TOOLCHAIN_NEED_CONFIGSITE_CACHE ??= "virtual/${MLPREFIX}libc ncurses"
+
+#This function create a site config file
+toolchain_create_sdk_siteconfig () {
+	local siteconfig=$1
+
+	rm -f $siteconfig
+	touch $siteconfig
+
+	for sitefile in ${TOOLCHAIN_CONFIGSITE_NOCACHE} ; do
+		cat $sitefile >> $siteconfig
+	done
+
+	#get cached site config
+	for sitefile in ${TOOLCHAIN_NEED_CONFIGSITE_CACHE}; do
+		# Resolve virtual/* names to the real recipe name using sysroot-providers info
+		case $sitefile in virtual/*)
+			sitefile=`echo $sitefile | tr / _`
+			sitefile=`cat ${STAGING_DIR_TARGET}/sysroot-providers/$sitefile`
+		esac
+
+		if [ -r ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config ]; then
+			cat ${TOOLCHAIN_CONFIGSITE_SYSROOTCACHE}/${sitefile}_config >> $siteconfig
+		fi
+	done
+}
+# The immediate expansion above can result in unwanted path dependencies here
+toolchain_create_sdk_siteconfig[vardepsexclude] = "TOOLCHAIN_CONFIGSITE_SYSROOTCACHE"
+
+#This function create a version information file
+toolchain_create_sdk_version () {
+	local versionfile=$1
+	rm -f $versionfile
+	touch $versionfile
+	echo 'Distro: ${DISTRO}' >> $versionfile
+	echo 'Distro Version: ${DISTRO_VERSION}' >> $versionfile
+	echo 'Metadata Revision: ${METADATA_REVISION}' >> $versionfile
+	echo 'Timestamp: ${DATETIME}' >> $versionfile
+}
+toolchain_create_sdk_version[vardepsexclude] = "DATETIME"
+
+python __anonymous () {
+    import oe.classextend
+    deps = ""
+    for dep in (d.getVar('TOOLCHAIN_NEED_CONFIGSITE_CACHE', True) or "").split():
+        deps += " %s:do_populate_sysroot" % dep
+        for variant in (d.getVar('MULTILIB_VARIANTS', True) or "").split():
+            clsextend = oe.classextend.ClassExtender(variant, d)
+            newdep = clsextend.extend_name(dep)
+            deps += " %s:do_populate_sysroot" % newdep
+    d.appendVarFlag('do_configure', 'depends', deps)
+}
diff --git a/meta/classes/typecheck.bbclass b/meta/classes/typecheck.bbclass
new file mode 100644
index 0000000..72da932
--- /dev/null
+++ b/meta/classes/typecheck.bbclass
@@ -0,0 +1,12 @@
+# Check types of bitbake configuration variables
+#
+# See oe.types for details.
+
+python check_types() {
+    import oe.types
+    for key in e.data.keys():
+        if e.data.getVarFlag(key, "type"):
+            oe.data.typed_value(key, e.data)
+}
+addhandler check_types
+check_types[eventmask] = "bb.event.ConfigParsed"
diff --git a/meta/classes/uboot-config.bbclass b/meta/classes/uboot-config.bbclass
new file mode 100644
index 0000000..cb061af
--- /dev/null
+++ b/meta/classes/uboot-config.bbclass
@@ -0,0 +1,49 @@
+# Handle U-Boot config for a machine
+#
+# The format to specify it, in the machine, is:
+#
+# UBOOT_CONFIG ??= <default>
+# UBOOT_CONFIG[foo] = "config,images"
+#
+# or
+#
+# UBOOT_MACHINE = "config"
+#
+# Copyright 2013, 2014 (C) O.S. Systems Software LTDA.
+
+python () {
+    ubootmachine = d.getVar("UBOOT_MACHINE", True)
+    ubootconfigflags = d.getVarFlags('UBOOT_CONFIG')
+    # The "doc" varflag is special, we don't want to see it here
+    ubootconfigflags.pop('doc', None)
+
+    if not ubootmachine and not ubootconfigflags:
+        PN = d.getVar("PN", True)
+        FILE = os.path.basename(d.getVar("FILE", True))
+        bb.debug(1, "To build %s, see %s for instructions on \
+                 setting up your machine config" % (PN, FILE))
+        raise bb.parse.SkipPackage("Either UBOOT_MACHINE or UBOOT_CONFIG must be set in the %s machine configuration." % d.getVar("MACHINE", True))
+
+    if ubootmachine and ubootconfigflags:
+        raise bb.parse.SkipPackage("You cannot use UBOOT_MACHINE and UBOOT_CONFIG at the same time.")
+
+    if not ubootconfigflags:
+        return
+
+    ubootconfig = (d.getVar('UBOOT_CONFIG', True) or "").split()
+    if len(ubootconfig) > 0:
+        for config in ubootconfig:
+            for f, v in ubootconfigflags.items():
+                if config == f: 
+                    items = v.split(',')
+                    if items[0] and len(items) > 2:
+                        raise bb.parse.SkipPackage('Only config,images can be specified!')
+                    d.appendVar('UBOOT_MACHINE', ' ' + items[0])
+                    # IMAGE_FSTYPES appending
+                    if len(items) > 1 and items[1]:
+                        bb.debug(1, "Appending '%s' to IMAGE_FSTYPES." % items[1])
+                        d.appendVar('IMAGE_FSTYPES', ' ' + items[1])
+                    break
+    elif len(ubootconfig) == 0:
+       raise bb.parse.SkipPackage('You must set a default in UBOOT_CONFIG.')
+}
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
new file mode 100644
index 0000000..51391db
--- /dev/null
+++ b/meta/classes/uninative.bbclass
@@ -0,0 +1,44 @@
+NATIVELSBSTRING = "universal"
+
+UNINATIVE_LOADER = "${STAGING_DIR_NATIVE}/lib/ld-linux-x86-64.so.2"
+
+addhandler uninative_eventhandler
+uninative_eventhandler[eventmask] = "bb.event.BuildStarted"
+
+python uninative_eventhandler() {
+    loader = e.data.getVar("UNINATIVE_LOADER", True)
+    if not os.path.exists(loader):
+        import subprocess
+        cmd = e.data.expand("mkdir -p ${STAGING_DIR}; cd ${STAGING_DIR}; tar -xjf ${COREBASE}/${BUILD_ARCH}-nativesdk-libc.tar.bz2; ${STAGING_DIR}/relocate_sdk.py ${STAGING_DIR_NATIVE} ${UNINATIVE_LOADER} ${UNINATIVE_LOADER} ${STAGING_BINDIR_NATIVE}/patchelf-uninative")
+        #bb.warn("nativesdk lib extraction: " + cmd)
+        subprocess.check_call(cmd, shell=True)
+}
+
+SSTATEPOSTUNPACKFUNCS_append = " uninative_changeinterp"
+
+python uninative_changeinterp () {
+    import subprocess
+    import stat
+    import oe.qa
+
+    if not (bb.data.inherits_class('native', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('cross', d)):
+        return
+
+    sstateinst = d.getVar('SSTATE_INSTDIR', True)
+    for walkroot, dirs, files in os.walk(sstateinst):
+        for file in files:
+            f = os.path.join(walkroot, file)
+            if os.path.islink(f):
+                continue
+            s = os.stat(f)
+            if not ((s[stat.ST_MODE] & stat.S_IXUSR) or (s[stat.ST_MODE] & stat.S_IXGRP) or (s[stat.ST_MODE] & stat.S_IXOTH)):
+                continue
+            elf = oe.qa.ELFFile(f)
+            try:
+                elf.open()
+            except:
+                continue
+
+            #bb.warn("patchelf-uninative --set-interpreter %s %s" % (d.getVar("UNINATIVE_LOADER", True), f))
+            subprocess.call("patchelf-uninative --set-interpreter %s %s" % (d.getVar("UNINATIVE_LOADER", True), f), shell=True)
+}
diff --git a/meta/classes/update-alternatives.bbclass b/meta/classes/update-alternatives.bbclass
new file mode 100644
index 0000000..a3c1657
--- /dev/null
+++ b/meta/classes/update-alternatives.bbclass
@@ -0,0 +1,267 @@
+# This class is used to help the alternatives system which is useful when
+# multiple sources provide same command. You can use update-alternatives
+# command directly in your recipe, but in most cases this class simplifies
+# that job.
+#
+# To use this class a number of variables should be defined:
+#
+# List all of the alternatives needed by a package:
+# ALTERNATIVE_<pkg> = "name1 name2 name3 ..."
+#
+#   i.e. ALTERNATIVE_busybox = "sh sed test bracket"
+#
+# The pathname of the link
+# ALTERNATIVE_LINK_NAME[name] = "target"
+#
+#   This is the name of the binary once it's been installed onto the runtime.
+#   This name is global to all split packages in this recipe, and should match
+#   other recipes with the same functionality.
+#   i.e. ALTERNATIVE_LINK_NAME[bracket] = "/usr/bin/["
+#
+# NOTE: If ALTERNATIVE_LINK_NAME is not defined, it defaults to ${bindir}/name
+#
+# The default link to create for all targets
+# ALTERNATIVE_TARGET = "target"
+#
+#   This is useful in a multicall binary case
+#   i.e. ALTERNATIVE_TARGET = "/bin/busybox"
+#
+# A non-default link to create for a target
+# ALTERNATIVE_TARGET[name] = "target"
+#
+#   This is the name of the binary as it's been install by do_install
+#   i.e. ALTERNATIVE_TARGET[sh] = "/bin/bash"
+#
+# A package specific link for a target
+# ALTERNATIVE_TARGET_<pkg>[name] = "target"
+#
+#   This is useful when a recipe provides multiple alternatives for the
+#   same item.
+#
+# NOTE: If ALTERNATIVE_TARGET is not defined, it will inherit the value
+# from ALTERNATIVE_LINK_NAME.
+#
+# NOTE: If the ALTERNATIVE_LINK_NAME and ALTERNATIVE_TARGET are the same,
+# ALTERNATIVE_TARGET will have '.{BPN}' appended to it.  If the file
+# referenced has not been renamed, it will also be renamed.  (This avoids
+# the need to rename alternative files in the do_install step, but still
+# supports it if necessary for some reason.)
+#
+# The default priority for any alternatives
+# ALTERNATIVE_PRIORITY = "priority"
+#
+#   i.e. default is ALTERNATIVE_PRIORITY = "10"
+#
+# The non-default priority for a specific target
+# ALTERNATIVE_PRIORITY[name] = "priority"
+#
+# The package priority for a specific target
+# ALTERNATIVE_PRIORITY_<pkg>[name] = "priority"
+
+ALTERNATIVE_PRIORITY = "10"
+
+# We need special processing for vardeps because it can not work on
+# modified flag values.  So we agregate the flags into a new variable
+# and include that vairable in the set.
+UPDALTVARS  = "ALTERNATIVE ALTERNATIVE_LINK_NAME ALTERNATIVE_TARGET ALTERNATIVE_PRIORITY"
+
+def gen_updatealternativesvardeps(d):
+    pkgs = (d.getVar("PACKAGES", True) or "").split()
+    vars = (d.getVar("UPDALTVARS", True) or "").split()
+
+    # First compute them for non_pkg versions
+    for v in vars:
+        for flag in (d.getVarFlags(v) or {}):
+            if flag == "doc" or flag == "vardeps" or flag == "vardepsexp":
+                continue
+            d.appendVar('%s_VARDEPS' % (v), ' %s:%s' % (flag, d.getVarFlag(v, flag, False)))
+
+    for p in pkgs:
+        for v in vars:
+            for flag in (d.getVarFlags("%s_%s" % (v,p)) or {}):
+                if flag == "doc" or flag == "vardeps" or flag == "vardepsexp":
+                    continue
+                d.appendVar('%s_VARDEPS_%s' % (v,p), ' %s:%s' % (flag, d.getVarFlag('%s_%s' % (v,p), flag, False)))
+
+def ua_extend_depends(d):
+    if not 'virtual/update-alternatives' in d.getVar('PROVIDES', True):
+        d.appendVar('DEPENDS', ' virtual/${MLPREFIX}update-alternatives')
+
+python __anonymous() {
+    # Update Alternatives only works on target packages...
+    if bb.data.inherits_class('native', d) or \
+       bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or \
+       bb.data.inherits_class('cross-canadian', d):
+        return
+
+    # compute special vardeps
+    gen_updatealternativesvardeps(d)
+
+    # extend the depends to include virtual/update-alternatives
+    ua_extend_depends(d)
+}
+
+def gen_updatealternativesvars(d):
+    ret = []
+    pkgs = (d.getVar("PACKAGES", True) or "").split()
+    vars = (d.getVar("UPDALTVARS", True) or "").split()
+
+    for v in vars:
+        ret.append(v + "_VARDEPS")
+
+    for p in pkgs:
+        for v in vars:
+            ret.append(v + "_" + p)
+            ret.append(v + "_VARDEPS_" + p)
+    return " ".join(ret)
+
+# Now the new stuff, we use a custom function to generate the right values
+populate_packages[vardeps] += "${UPDALTVARS} ${@gen_updatealternativesvars(d)}"
+
+# We need to do the rename after the image creation step, but before
+# the split and strip steps..  packagecopy seems to be the earliest reasonable
+# place.
+python perform_packagecopy_append () {
+    # Check for deprecated usage...
+    pn = d.getVar('BPN', True)
+    if d.getVar('ALTERNATIVE_LINKS', True) != None:
+        bb.fatal('%s: Use of ALTERNATIVE_LINKS/ALTERNATIVE_PATH/ALTERNATIVE_NAME is no longer supported, please convert to the updated syntax, see update-alternatives.bbclass for more info.' % pn)
+
+    # Do actual update alternatives processing
+    pkgdest = d.getVar('PKGD', True)
+    for pkg in (d.getVar('PACKAGES', True) or "").split():
+        # If the src == dest, we know we need to rename the dest by appending ${BPN}
+        link_rename = {}
+        for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split():
+            alt_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
+            if not alt_link:
+                alt_link = "%s/%s" % (d.getVar('bindir', True), alt_name)
+                d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link)
+
+            alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
+            alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) or alt_link
+            # Sometimes alt_target is specified as relative to the link name.
+            alt_target   = os.path.join(os.path.dirname(alt_link), alt_target)
+
+            # If the link and target are the same name, we need to rename the target.
+            if alt_link == alt_target:
+                src = '%s/%s' % (pkgdest, alt_target)
+                alt_target_rename = '%s.%s' % (alt_target, pn)
+                dest = '%s/%s' % (pkgdest, alt_target_rename)
+                if os.path.lexists(dest):
+                    bb.note('%s: Already renamed: %s' % (pn, alt_target_rename))
+                elif os.path.lexists(src):
+                    if os.path.islink(src):
+                        # Delay rename of links
+                        link_rename[alt_target] = alt_target_rename
+                    else:
+                        bb.note('%s: Rename %s -> %s' % (pn, alt_target, alt_target_rename))
+                        os.rename(src, dest)
+                else:
+                    bb.warn("%s: alternative target (%s or %s) does not exist, skipping..." % (pn, alt_target, alt_target_rename))
+                    continue
+                d.setVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, alt_target_rename)
+
+        # Process delayed link names
+        # Do these after other renames so we can correct broken links
+        for alt_target in link_rename:
+            src = '%s/%s' % (pkgdest, alt_target)
+            dest = '%s/%s' % (pkgdest, link_rename[alt_target])
+            link = os.readlink(src)
+            link_target = oe.path.realpath(src, pkgdest, True)
+
+            if os.path.lexists(link_target):
+                # Ok, the link_target exists, we can rename
+                bb.note('%s: Rename (link) %s -> %s' % (pn, alt_target, link_rename[alt_target]))
+                os.rename(src, dest)
+            else:
+                # Try to resolve the broken link to link.${BPN}
+                link_maybe = '%s.%s' % (os.readlink(src), pn)
+                if os.path.lexists(os.path.join(os.path.dirname(src), link_maybe)):
+                    # Ok, the renamed link target exists.. create a new link, and remove the original
+                    bb.note('%s: Creating new link %s -> %s' % (pn, link_rename[alt_target], link_maybe))
+                    os.symlink(link_maybe, dest)
+                    os.unlink(src)
+                else:
+                    bb.warn('%s: Unable to resolve dangling symlink: %s' % (pn, alt_target))
+}
+
+PACKAGESPLITFUNCS_prepend = "populate_packages_updatealternatives "
+
+python populate_packages_updatealternatives () {
+    pn = d.getVar('BPN', True)
+
+    # Do actual update alternatives processing
+    pkgdest = d.getVar('PKGD', True)
+    for pkg in (d.getVar('PACKAGES', True) or "").split():
+        # Create post install/removal scripts
+        alt_setup_links = ""
+        alt_remove_links = ""
+        for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split():
+            alt_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
+            alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
+            alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) or alt_link
+            # Sometimes alt_target is specified as relative to the link name.
+            alt_target   = os.path.join(os.path.dirname(alt_link), alt_target)
+
+            alt_priority = d.getVarFlag('ALTERNATIVE_PRIORITY_%s' % pkg,  alt_name, True) or d.getVarFlag('ALTERNATIVE_PRIORITY',  alt_name, True)
+            alt_priority = alt_priority or d.getVar('ALTERNATIVE_PRIORITY_%s' % pkg, True) or d.getVar('ALTERNATIVE_PRIORITY', True)
+
+            # This shouldn't trigger, as it should have been resolved earlier!
+            if alt_link == alt_target:
+                bb.note('alt_link == alt_target: %s == %s -- correcting, this should not happen!' % (alt_link, alt_target))
+                alt_target = '%s.%s' % (alt_target, pn)
+
+            if not os.path.lexists('%s/%s' % (pkgdest, alt_target)):
+                bb.warn('%s: NOT adding alternative provide %s: %s does not exist' % (pn, alt_link, alt_target))
+                continue
+
+            # Default to generate shell script.. eventually we may want to change this...
+            alt_target = os.path.normpath(alt_target)
+
+            alt_setup_links  += '\tupdate-alternatives --install %s %s %s %s\n' % (alt_link, alt_name, alt_target, alt_priority)
+            alt_remove_links += '\tupdate-alternatives --remove  %s %s\n' % (alt_name, alt_target)
+
+        if alt_setup_links:
+            # RDEPENDS setup
+            provider = d.getVar('VIRTUAL-RUNTIME_update-alternatives', True)
+            if provider:
+                #bb.note('adding runtime requirement for update-alternatives for %s' % pkg)
+                d.appendVar('RDEPENDS_%s' % pkg, ' ' + d.getVar('MLPREFIX', False) + provider)
+
+            bb.note('adding update-alternatives calls to postinst/prerm for %s' % pkg)
+            bb.note('%s' % alt_setup_links)
+            postinst = d.getVar('pkg_postinst_%s' % pkg, True) or '#!/bin/sh\n'
+            postinst += alt_setup_links
+            d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+            bb.note('%s' % alt_remove_links)
+            prerm = d.getVar('pkg_prerm_%s' % pkg, True) or '#!/bin/sh\n'
+            prerm += alt_remove_links
+            d.setVar('pkg_prerm_%s' % pkg, prerm)
+}
+
+python package_do_filedeps_append () {
+    pn = d.getVar('BPN', True)
+    pkgdest = d.getVar('PKGDEST', True)
+
+    for pkg in packages.split():
+        for alt_name in (d.getVar('ALTERNATIVE_%s' % pkg, True) or "").split():
+            alt_link     = d.getVarFlag('ALTERNATIVE_LINK_NAME', alt_name, True)
+            alt_target   = d.getVarFlag('ALTERNATIVE_TARGET_%s' % pkg, alt_name, True) or d.getVarFlag('ALTERNATIVE_TARGET', alt_name, True)
+            alt_target   = alt_target or d.getVar('ALTERNATIVE_TARGET_%s' % pkg, True) or d.getVar('ALTERNATIVE_TARGET', True) or alt_link
+
+            if alt_link == alt_target:
+                bb.warn('alt_link == alt_target: %s == %s' % (alt_link, alt_target))
+                alt_target = '%s.%s' % (alt_target, pn)
+
+            if not os.path.lexists('%s/%s/%s' % (pkgdest, pkg, alt_target)):
+                continue
+
+            # Add file provide
+            trans_target = oe.package.file_translate(alt_target)
+            d.appendVar('FILERPROVIDES_%s_%s' % (trans_target, pkg), " " + alt_link)
+            if not trans_target in (d.getVar('FILERPROVIDESFLIST_%s' % pkg, True) or ""):
+                d.appendVar('FILERPROVIDESFLIST_%s' % pkg, " " + trans_target)
+}
+
diff --git a/meta/classes/update-rc.d.bbclass b/meta/classes/update-rc.d.bbclass
new file mode 100644
index 0000000..2a0a74a
--- /dev/null
+++ b/meta/classes/update-rc.d.bbclass
@@ -0,0 +1,133 @@
+UPDATERCPN ?= "${PN}"
+
+DEPENDS_append_class-target = " update-rc.d-native update-rc.d initscripts"
+UPDATERCD = "update-rc.d"
+UPDATERCD_class-cross = ""
+UPDATERCD_class-native = ""
+UPDATERCD_class-nativesdk = ""
+
+INITSCRIPT_PARAMS ?= "defaults"
+
+INIT_D_DIR = "${sysconfdir}/init.d"
+
+updatercd_preinst() {
+if [ -z "$D" -a -f "${INIT_D_DIR}/${INITSCRIPT_NAME}" ]; then
+	${INIT_D_DIR}/${INITSCRIPT_NAME} stop
+fi
+if type update-rc.d >/dev/null 2>/dev/null; then
+	if [ -n "$D" ]; then
+		OPT="-f -r $D"
+	else
+		OPT="-f"
+	fi
+	update-rc.d $OPT ${INITSCRIPT_NAME} remove
+fi
+}
+
+updatercd_postinst() {
+if type update-rc.d >/dev/null 2>/dev/null; then
+	if [ -n "$D" ]; then
+		OPT="-r $D"
+	else
+		OPT="-s"
+	fi
+	update-rc.d $OPT ${INITSCRIPT_NAME} ${INITSCRIPT_PARAMS}
+fi
+}
+
+updatercd_prerm() {
+if [ -z "$D" ]; then
+	${INIT_D_DIR}/${INITSCRIPT_NAME} stop
+fi
+}
+
+updatercd_postrm() {
+if type update-rc.d >/dev/null 2>/dev/null; then
+	if [ -n "$D" ]; then
+		OPT="-f -r $D"
+	else
+		OPT="-f"
+	fi
+	update-rc.d $OPT ${INITSCRIPT_NAME} remove
+fi
+}
+
+
+def update_rc_after_parse(d):
+    if d.getVar('INITSCRIPT_PACKAGES', False) == None:
+        if d.getVar('INITSCRIPT_NAME', False) == None:
+            raise bb.build.FuncFailed("%s inherits update-rc.d but doesn't set INITSCRIPT_NAME" % d.getVar('FILE', False))
+        if d.getVar('INITSCRIPT_PARAMS', False) == None:
+            raise bb.build.FuncFailed("%s inherits update-rc.d but doesn't set INITSCRIPT_PARAMS" % d.getVar('FILE', False))
+
+python __anonymous() {
+    update_rc_after_parse(d)
+}
+
+PACKAGESPLITFUNCS_prepend = "populate_packages_updatercd "
+PACKAGESPLITFUNCS_remove_class-nativesdk = "populate_packages_updatercd "
+
+populate_packages_updatercd[vardeps] += "updatercd_prerm updatercd_postrm updatercd_preinst updatercd_postinst"
+populate_packages_updatercd[vardepsexclude] += "OVERRIDES"
+
+python populate_packages_updatercd () {
+    def update_rcd_auto_depend(pkg):
+        import subprocess
+        import os
+        path = d.expand("${D}${INIT_D_DIR}/${INITSCRIPT_NAME}")
+        if not os.path.exists(path):
+            return
+        statement = "grep -q -w '/etc/init.d/functions' %s" % path
+        if subprocess.call(statement, shell=True) == 0:
+            mlprefix = d.getVar('MLPREFIX', True) or ""
+            d.appendVar('RDEPENDS_' + pkg, ' %sinitscripts-functions' % (mlprefix))
+
+    def update_rcd_package(pkg):
+        bb.debug(1, 'adding update-rc.d calls to preinst/postinst/prerm/postrm for %s' % pkg)
+
+        localdata = bb.data.createCopy(d)
+        overrides = localdata.getVar("OVERRIDES", True)
+        localdata.setVar("OVERRIDES", "%s:%s" % (pkg, overrides))
+        bb.data.update_data(localdata)
+
+        update_rcd_auto_depend(pkg)
+
+        preinst = d.getVar('pkg_preinst_%s' % pkg, True)
+        if not preinst:
+            preinst = '#!/bin/sh\n'
+        preinst += localdata.getVar('updatercd_preinst', True)
+        d.setVar('pkg_preinst_%s' % pkg, preinst)
+
+        postinst = d.getVar('pkg_postinst_%s' % pkg, True)
+        if not postinst:
+            postinst = '#!/bin/sh\n'
+        postinst += localdata.getVar('updatercd_postinst', True)
+        d.setVar('pkg_postinst_%s' % pkg, postinst)
+
+        prerm = d.getVar('pkg_prerm_%s' % pkg, True)
+        if not prerm:
+            prerm = '#!/bin/sh\n'
+        prerm += localdata.getVar('updatercd_prerm', True)
+        d.setVar('pkg_prerm_%s' % pkg, prerm)
+
+        postrm = d.getVar('pkg_postrm_%s' % pkg, True)
+        if not postrm:
+                postrm = '#!/bin/sh\n'
+        postrm += localdata.getVar('updatercd_postrm', True)
+        d.setVar('pkg_postrm_%s' % pkg, postrm)
+
+        d.appendVar('RRECOMMENDS_' + pkg, " ${MLPREFIX}${UPDATERCD}")
+
+    # Check that this class isn't being inhibited (generally, by
+    # systemd.bbclass) before doing any work.
+    if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d) or \
+       not d.getVar("INHIBIT_UPDATERCD_BBCLASS", True):
+        pkgs = d.getVar('INITSCRIPT_PACKAGES', True)
+        if pkgs == None:
+            pkgs = d.getVar('UPDATERCPN', True)
+            packages = (d.getVar('PACKAGES', True) or "").split()
+            if not pkgs in packages and packages != []:
+                pkgs = packages[0]
+        for pkg in pkgs.split():
+            update_rcd_package(pkg)
+}
diff --git a/meta/classes/useradd-staticids.bbclass b/meta/classes/useradd-staticids.bbclass
new file mode 100644
index 0000000..421a70a
--- /dev/null
+++ b/meta/classes/useradd-staticids.bbclass
@@ -0,0 +1,276 @@
+# In order to support a deterministic set of 'dynamic' users/groups,
+# we need a function to reformat the params based on a static file
+def update_useradd_static_config(d):
+    import argparse
+    import re
+
+    class myArgumentParser( argparse.ArgumentParser ):
+        def _print_message(self, message, file=None):
+            bb.warn("%s - %s: %s" % (d.getVar('PN', True), pkg, message))
+
+        # This should never be called...
+        def exit(self, status=0, message=None):
+            message = message or ("%s - %s: useradd.bbclass: Argument parsing exited" % (d.getVar('PN', True), pkg))
+            error(message)
+
+        def error(self, message):
+            raise bb.build.FuncFailed(message)
+
+    # We parse and rewrite the useradd components
+    def rewrite_useradd(params):
+        # The following comes from --help on useradd from shadow
+        parser = myArgumentParser(prog='useradd')
+        parser.add_argument("-b", "--base-dir", metavar="BASE_DIR", help="base directory for the home directory of the new account")
+        parser.add_argument("-c", "--comment", metavar="COMMENT", help="GECOS field of the new account")
+        parser.add_argument("-d", "--home-dir", metavar="HOME_DIR", help="home directory of the new account")
+        parser.add_argument("-D", "--defaults", help="print or change default useradd configuration", action="store_true")
+        parser.add_argument("-e", "--expiredate", metavar="EXPIRE_DATE", help="expiration date of the new account")
+        parser.add_argument("-f", "--inactive", metavar="INACTIVE", help="password inactivity period of the new account")
+        parser.add_argument("-g", "--gid", metavar="GROUP", help="name or ID of the primary group of the new account")
+        parser.add_argument("-G", "--groups", metavar="GROUPS", help="list of supplementary groups of the new account")
+        parser.add_argument("-k", "--skel", metavar="SKEL_DIR", help="use this alternative skeleton directory")
+        parser.add_argument("-K", "--key", metavar="KEY=VALUE", help="override /etc/login.defs defaults")
+        parser.add_argument("-l", "--no-log-init", help="do not add the user to the lastlog and faillog databases", action="store_true")
+        parser.add_argument("-m", "--create-home", help="create the user's home directory", action="store_true")
+        parser.add_argument("-M", "--no-create-home", help="do not create the user's home directory", action="store_true")
+        parser.add_argument("-N", "--no-user-group", help="do not create a group with the same name as the user", action="store_true")
+        parser.add_argument("-o", "--non-unique", help="allow to create users with duplicate (non-unique UID)", action="store_true")
+        parser.add_argument("-p", "--password", metavar="PASSWORD", help="encrypted password of the new account")
+        parser.add_argument("-R", "--root", metavar="CHROOT_DIR", help="directory to chroot into")
+        parser.add_argument("-r", "--system", help="create a system account", action="store_true")
+        parser.add_argument("-s", "--shell", metavar="SHELL", help="login shell of the new account")
+        parser.add_argument("-u", "--uid", metavar="UID", help="user ID of the new account")
+        parser.add_argument("-U", "--user-group", help="create a group with the same name as the user", action="store_true")
+        parser.add_argument("LOGIN", help="Login name of the new user")
+
+        # Return a list of configuration files based on either the default
+        # files/passwd or the contents of USERADD_UID_TABLES
+        # paths are resulved via BBPATH
+        def get_passwd_list(d):
+            str = ""
+            bbpath = d.getVar('BBPATH', True)
+            passwd_tables = d.getVar('USERADD_UID_TABLES', True)
+            if not passwd_tables:
+                passwd_tables = 'files/passwd'
+            for conf_file in passwd_tables.split():
+                str += " %s" % bb.utils.which(bbpath, conf_file)
+            return str
+
+        newparams = []
+        for param in re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params):
+            param = param.strip()
+            if not param:
+                continue
+            try:
+                uaargs = parser.parse_args(re.split('''[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
+            except:
+                raise bb.build.FuncFailed("%s: Unable to parse arguments for USERADD_PARAM_%s: '%s'" % (d.getVar('PN', True), pkg, param))
+
+            # files/passwd or the contents of USERADD_UID_TABLES
+            # Use the standard passwd layout:
+            #  username:password:user_id:group_id:comment:home_directory:login_shell
+            # (we want to process in reverse order, as 'last found' in the list wins)
+            #
+            # If a field is left blank, the original value will be used.  The 'username'
+            # field is required.
+            #
+            # Note: we ignore the password field, as including even the hashed password
+            # in the useradd command may introduce a security hole.  It's assumed that
+            # all new users get the default ('*' which prevents login) until the user is
+            # specifically configured by the system admin.
+            for conf in get_passwd_list(d).split()[::-1]:
+                if os.path.exists(conf):
+                    f = open(conf, "r")
+                    for line in f:
+                        if line.startswith('#'):
+                            continue
+                        field = line.rstrip().split(":")
+                        if field[0] == uaargs.LOGIN:
+                            if uaargs.uid and field[2] and (uaargs.uid != field[2]):
+                                bb.warn("%s: Changing username %s's uid from (%s) to (%s), verify configuration files!" % (d.getVar('PN', True), uaargs.LOGIN, uaargs.uid, field[2]))
+                            uaargs.uid = [field[2], uaargs.uid][not field[2]]
+
+                            # Determine the possible groupname
+                            # Unless the group name (or gid) is specified, we assume that the LOGIN is the groupname
+                            #
+                            # By default the system has creation of the matching groups enabled
+                            # So if the implicit username-group creation is on, then the implicit groupname (LOGIN)
+                            # is used, and we disable the user_group option.
+                            #
+                            uaargs.groupname = [uaargs.gid, uaargs.LOGIN][not uaargs.gid or uaargs.user_group]
+                            uaargs.groupid = [uaargs.gid, uaargs.groupname][not uaargs.gid]
+                            uaargs.groupid = [field[3], uaargs.groupid][not field[3]]
+
+                            if not uaargs.gid or uaargs.gid != uaargs.groupid:
+                                if (uaargs.groupid and uaargs.groupid.isdigit()) and (uaargs.groupname and uaargs.groupname.isdigit()) and (uaargs.groupid != uaargs.groupname):
+                                    # We want to add a group, but we don't know it's name... so we can't add the group...
+                                    # We have to assume the group has previously been added or we'll fail on the adduser...
+                                    # Note: specifying the actual gid is very rare in OE, usually the group name is specified.
+                                    bb.warn("%s: Changing gid for login %s from (%s) to (%s), verify configuration files!" % (d.getVar('PN', True), uaargs.LOGIN, uaargs.groupname, uaargs.gid))
+                                elif (uaargs.groupid and not uaargs.groupid.isdigit()) and uaargs.groupid == uaargs.groupname:
+                                    # We don't have a number, so we have to add a name
+                                    bb.debug(1, "Adding group %s!" % (uaargs.groupname))
+                                    uaargs.gid = uaargs.groupid
+                                    uaargs.user_group = False
+                                    groupadd = d.getVar("GROUPADD_PARAM_%s" % pkg, True)
+                                    newgroup = "%s %s" % (['', ' --system'][uaargs.system], uaargs.groupname)
+                                    if groupadd:
+                                        d.setVar("GROUPADD_PARAM_%s" % pkg, "%s ; %s" % (groupadd, newgroup))
+                                    else:
+                                        d.setVar("GROUPADD_PARAM_%s" % pkg, newgroup)
+                                elif uaargs.groupname and (uaargs.groupid and uaargs.groupid.isdigit()):
+                                    # We have a group name and a group number to assign it to
+                                    bb.debug(1, "Adding group %s  gid (%s)!" % (uaargs.groupname, uaargs.groupid))
+                                    uaargs.gid = uaargs.groupid
+                                    uaargs.user_group = False
+                                    groupadd = d.getVar("GROUPADD_PARAM_%s" % pkg, True)
+                                    newgroup = "-g %s %s" % (uaargs.gid, uaargs.groupname)
+                                    if groupadd:
+                                        d.setVar("GROUPADD_PARAM_%s" % pkg, "%s ; %s" % (groupadd, newgroup))
+                                    else:
+                                        d.setVar("GROUPADD_PARAM_%s" % pkg, newgroup)
+
+                            uaargs.comment = ["'%s'" % field[4], uaargs.comment][not field[4]]
+                            uaargs.home_dir = [field[5], uaargs.home_dir][not field[5]]
+                            uaargs.shell = [field[6], uaargs.shell][not field[6]]
+                            break
+
+            # Should be an error if a specific option is set...
+            if d.getVar('USERADD_ERROR_DYNAMIC', True) == '1' and not ((uaargs.uid and uaargs.uid.isdigit()) and uaargs.gid):
+                #bb.error("Skipping recipe %s, package %s which adds username %s does not have a static uid defined." % (d.getVar('PN', True),  pkg, uaargs.LOGIN))
+                raise bb.build.FuncFailed("%s - %s: Username %s does not have a static uid defined." % (d.getVar('PN', True), pkg, uaargs.LOGIN))
+
+            # Reconstruct the args...
+            newparam  = ['', ' --defaults'][uaargs.defaults]
+            newparam += ['', ' --base-dir %s' % uaargs.base_dir][uaargs.base_dir != None]
+            newparam += ['', ' --comment %s' % uaargs.comment][uaargs.comment != None]
+            newparam += ['', ' --home-dir %s' % uaargs.home_dir][uaargs.home_dir != None]
+            newparam += ['', ' --expiredata %s' % uaargs.expiredate][uaargs.expiredate != None]
+            newparam += ['', ' --inactive %s' % uaargs.inactive][uaargs.inactive != None]
+            newparam += ['', ' --gid %s' % uaargs.gid][uaargs.gid != None]
+            newparam += ['', ' --groups %s' % uaargs.groups][uaargs.groups != None]
+            newparam += ['', ' --skel %s' % uaargs.skel][uaargs.skel != None]
+            newparam += ['', ' --key %s' % uaargs.key][uaargs.key != None]
+            newparam += ['', ' --no-log-init'][uaargs.no_log_init]
+            newparam += ['', ' --create-home'][uaargs.create_home]
+            newparam += ['', ' --no-create-home'][uaargs.no_create_home]
+            newparam += ['', ' --no-user-group'][uaargs.no_user_group]
+            newparam += ['', ' --non-unique'][uaargs.non_unique]
+            newparam += ['', ' --password %s' % uaargs.password][uaargs.password != None]
+            newparam += ['', ' --root %s' % uaargs.root][uaargs.root != None]
+            newparam += ['', ' --system'][uaargs.system]
+            newparam += ['', ' --shell %s' % uaargs.shell][uaargs.shell != None]
+            newparam += ['', ' --uid %s' % uaargs.uid][uaargs.uid != None]
+            newparam += ['', ' --user-group'][uaargs.user_group]
+            newparam += ' %s' % uaargs.LOGIN
+
+            newparams.append(newparam)
+
+        return " ;".join(newparams).strip()
+
+    # We parse and rewrite the groupadd components
+    def rewrite_groupadd(params):
+        # The following comes from --help on groupadd from shadow
+        parser = myArgumentParser(prog='groupadd')
+        parser.add_argument("-f", "--force", help="exit successfully if the group already exists, and cancel -g if the GID is already used", action="store_true")
+        parser.add_argument("-g", "--gid", metavar="GID", help="use GID for the new group")
+        parser.add_argument("-K", "--key", metavar="KEY=VALUE", help="override /etc/login.defs defaults")
+        parser.add_argument("-o", "--non-unique", help="allow to create groups with duplicate (non-unique) GID", action="store_true")
+        parser.add_argument("-p", "--password", metavar="PASSWORD", help="use this encrypted password for the new group")
+        parser.add_argument("-R", "--root", metavar="CHROOT_DIR", help="directory to chroot into")
+        parser.add_argument("-r", "--system", help="create a system account", action="store_true")
+        parser.add_argument("GROUP", help="Group name of the new group")
+
+        # Return a list of configuration files based on either the default
+        # files/group or the contents of USERADD_GID_TABLES
+        # paths are resulved via BBPATH
+        def get_group_list(d):
+            str = ""
+            bbpath = d.getVar('BBPATH', True)
+            group_tables = d.getVar('USERADD_GID_TABLES', True)
+            if not group_tables:
+                group_tables = 'files/group'
+            for conf_file in group_tables.split():
+                str += " %s" % bb.utils.which(bbpath, conf_file)
+            return str
+
+        newparams = []
+        for param in re.split('''[ \t]*;[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', params):
+            param = param.strip()
+            if not param:
+                continue
+            try:
+                # If we're processing multiple lines, we could have left over values here...
+                gaargs = parser.parse_args(re.split('''[ \t]*(?=(?:[^'"]|'[^']*'|"[^"]*")*$)''', param))
+            except:
+                raise bb.build.FuncFailed("%s: Unable to parse arguments for GROUPADD_PARAM_%s: '%s'" % (d.getVar('PN', True), pkg, param))
+
+            # Need to iterate over layers and open the right file(s)
+            # Use the standard group layout:
+            #  groupname:password:group_id:group_members
+            #
+            # If a field is left blank, the original value will be used. The 'groupname' field
+            # is required.
+            #
+            # Note: similar to the passwd file, the 'password' filed is ignored
+            # Note: group_members is ignored, group members must be configured with the GROUPMEMS_PARAM
+            for conf in get_group_list(d).split()[::-1]:
+                if os.path.exists(conf):
+                    f = open(conf, "r")
+                    for line in f:
+                        if line.startswith('#'):
+                            continue
+                        field = line.rstrip().split(":")
+                        if field[0] == gaargs.GROUP and field[2]:
+                            if gaargs.gid and (gaargs.gid != field[2]):
+                                bb.warn("%s: Changing groupname %s's gid from (%s) to (%s), verify configuration files!" % (d.getVar('PN', True), gaargs.GROUP, gaargs.gid, field[2]))
+                            gaargs.gid = field[2]
+                            break
+
+            if d.getVar('USERADD_ERROR_DYNAMIC', True) == '1' and not (gaargs.gid and gaargs.gid.isdigit()):
+                #bb.error("Skipping recipe %s, package %s which adds groupname %s does not have a static gid defined." % (d.getVar('PN', True),  pkg, gaargs.GROUP))
+                raise bb.build.FuncFailed("%s - %s: Groupname %s does not have a static gid defined." % (d.getVar('PN', True), pkg, gaargs.GROUP))
+
+            # Reconstruct the args...
+            newparam  = ['', ' --force'][gaargs.force]
+            newparam += ['', ' --gid %s' % gaargs.gid][gaargs.gid != None]
+            newparam += ['', ' --key %s' % gaargs.key][gaargs.key != None]
+            newparam += ['', ' --non-unique'][gaargs.non_unique]
+            newparam += ['', ' --password %s' % gaargs.password][gaargs.password != None]
+            newparam += ['', ' --root %s' % gaargs.root][gaargs.root != None]
+            newparam += ['', ' --system'][gaargs.system]
+            newparam += ' %s' % gaargs.GROUP
+
+            newparams.append(newparam)
+
+        return " ;".join(newparams).strip()
+
+    # Load and process the users and groups, rewriting the adduser/addgroup params
+    useradd_packages = d.getVar('USERADD_PACKAGES', True)
+
+    for pkg in useradd_packages.split():
+        # Groupmems doesn't have anything we might want to change, so simply validating
+        # is a bit of a waste -- only process useradd/groupadd
+        useradd_param = d.getVar('USERADD_PARAM_%s' % pkg, True)
+        if useradd_param:
+            #bb.warn("Before: 'USERADD_PARAM_%s' - '%s'" % (pkg, useradd_param))
+            d.setVar('USERADD_PARAM_%s' % pkg, rewrite_useradd(useradd_param))
+            #bb.warn("After:  'USERADD_PARAM_%s' - '%s'" % (pkg, d.getVar('USERADD_PARAM_%s' % pkg, True)))
+
+        groupadd_param = d.getVar('GROUPADD_PARAM_%s' % pkg, True)
+        if groupadd_param:
+            #bb.warn("Before: 'GROUPADD_PARAM_%s' - '%s'" % (pkg, groupadd_param))
+            d.setVar('GROUPADD_PARAM_%s' % pkg, rewrite_groupadd(groupadd_param))
+            #bb.warn("After:  'GROUPADD_PARAM_%s' - '%s'" % (pkg, d.getVar('GROUPADD_PARAM_%s' % pkg, True)))
+
+
+
+python __anonymous() {
+    if not bb.data.inherits_class('nativesdk', d) \
+        and not bb.data.inherits_class('native', d):
+        try:
+            update_useradd_static_config(d)
+        except bb.build.FuncFailed as f:
+            bb.debug(1, "Skipping recipe %s: %s" % (d.getVar('PN', True), f))
+            raise bb.parse.SkipPackage(f)
+}
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
new file mode 100644
index 0000000..4577e56
--- /dev/null
+++ b/meta/classes/useradd.bbclass
@@ -0,0 +1,223 @@
+inherit useradd_base
+
+# base-passwd-cross provides the default passwd and group files in the
+# target sysroot, and shadow -native and -sysroot provide the utilities
+# and support files needed to add and modify user and group accounts
+DEPENDS_append = "${USERADDDEPENDS}"
+USERADDDEPENDS = " base-files shadow-native shadow-sysroot shadow"
+USERADDDEPENDS_class-cross = ""
+USERADDDEPENDS_class-native = ""
+USERADDDEPENDS_class-nativesdk = ""
+
+# This preinstall function can be run in four different contexts:
+#
+# a) Before do_install
+# b) At do_populate_sysroot_setscene when installing from sstate packages
+# c) As the preinst script in the target package at do_rootfs time
+# d) As the preinst script in the target package on device as a package upgrade
+#
+useradd_preinst () {
+OPT=""
+SYSROOT=""
+
+if test "x$D" != "x"; then
+	# Installing into a sysroot
+	SYSROOT="$D"
+	OPT="--root $D"
+
+	# Make sure login.defs is there, this is to make debian package backend work
+	# correctly while doing rootfs.
+	# The problem here is that if /etc/login.defs is treated as a config file for
+	# shadow package, then while performing preinsts for packages that depend on
+	# shadow, there might only be /etc/login.def.dpkg-new there in root filesystem.
+	if [ ! -e $D${sysconfdir}/login.defs -a -e $D${sysconfdir}/login.defs.dpkg-new ]; then
+	    cp $D${sysconfdir}/login.defs.dpkg-new $D${sysconfdir}/login.defs
+	fi
+
+	# user/group lookups should match useradd/groupadd --root
+	export PSEUDO_PASSWD="$SYSROOT:${STAGING_DIR_NATIVE}"
+fi
+
+# If we're not doing a special SSTATE/SYSROOT install
+# then set the values, otherwise use the environment
+if test "x$UA_SYSROOT" = "x"; then
+	# Installing onto a target
+	# Add groups and users defined only for this package
+	GROUPADD_PARAM="${GROUPADD_PARAM}"
+	USERADD_PARAM="${USERADD_PARAM}"
+	GROUPMEMS_PARAM="${GROUPMEMS_PARAM}"
+fi
+
+# Perform group additions first, since user additions may depend
+# on these groups existing
+if test "x$GROUPADD_PARAM" != "x"; then
+	echo "Running groupadd commands..."
+	# Invoke multiple instances of groupadd for parameter lists
+	# separated by ';'
+	opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1`
+	remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-`
+	while test "x$opts" != "x"; do
+		perform_groupadd "$SYSROOT" "$OPT $opts" 10
+		if test "x$opts" = "x$remaining"; then
+			break
+		fi
+		opts=`echo "$remaining" | cut -d ';' -f 1`
+		remaining=`echo "$remaining" | cut -d ';' -f 2-`
+	done
+fi 
+
+if test "x$USERADD_PARAM" != "x"; then
+	echo "Running useradd commands..."
+	# Invoke multiple instances of useradd for parameter lists
+	# separated by ';'
+	opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1`
+	remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2-`
+	while test "x$opts" != "x"; do
+		perform_useradd "$SYSROOT" "$OPT $opts" 10
+		if test "x$opts" = "x$remaining"; then
+			break
+		fi
+		opts=`echo "$remaining" | cut -d ';' -f 1`
+		remaining=`echo "$remaining" | cut -d ';' -f 2-`
+	done
+fi
+
+if test "x$GROUPMEMS_PARAM" != "x"; then
+	echo "Running groupmems commands..."
+	# Invoke multiple instances of groupmems for parameter lists
+	# separated by ';'
+	opts=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 1`
+	remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2-`
+	while test "x$opts" != "x"; do
+		perform_groupmems "$SYSROOT" "$OPT $opts" 10
+		if test "x$opts" = "x$remaining"; then
+			break
+		fi
+		opts=`echo "$remaining" | cut -d ';' -f 1`
+		remaining=`echo "$remaining" | cut -d ';' -f 2-`
+	done
+fi
+}
+
+useradd_sysroot () {
+	# Pseudo may (do_install) or may not (do_populate_sysroot_setscene) be running 
+	# at this point so we're explicit about the environment so pseudo can load if 
+	# not already present.
+	export PSEUDO="${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${STAGING_DIR_TARGET}${localstatedir}/pseudo ${STAGING_DIR_NATIVE}${bindir}/pseudo"
+
+	# Explicitly set $D since it isn't set to anything
+	# before do_install
+	D=${STAGING_DIR_TARGET}
+
+	# Add groups and users defined for all recipe packages
+	GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}"
+	USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}"
+	GROUPMEMS_PARAM="${@get_all_cmd_params(d, 'groupmems')}"
+
+	# Tell the system to use the environment vars
+	UA_SYSROOT=1
+
+	useradd_preinst
+}
+
+useradd_sysroot_sstate () {
+	if [ "${BB_CURRENTTASK}" = "package_setscene" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+		useradd_sysroot
+	fi
+}
+
+do_install[prefuncs] += "${SYSROOTFUNC}"
+SYSROOTFUNC = "useradd_sysroot"
+SYSROOTFUNC_class-cross = ""
+SYSROOTFUNC_class-native = ""
+SYSROOTFUNC_class-nativesdk = ""
+SSTATEPREINSTFUNCS += "${SYSROOTPOSTFUNC}"
+SYSROOTPOSTFUNC = "useradd_sysroot_sstate"
+SYSROOTPOSTFUNC_class-cross = ""
+SYSROOTPOSTFUNC_class-native = ""
+SYSROOTPOSTFUNC_class-nativesdk = ""
+
+USERADDSETSCENEDEPS = "${MLPREFIX}base-passwd:do_populate_sysroot_setscene pseudo-native:do_populate_sysroot_setscene shadow-native:do_populate_sysroot_setscene ${MLPREFIX}shadow-sysroot:do_populate_sysroot_setscene"
+USERADDSETSCENEDEPS_class-cross = ""
+USERADDSETSCENEDEPS_class-native = ""
+USERADDSETSCENEDEPS_class-nativesdk = ""
+do_package_setscene[depends] += "${USERADDSETSCENEDEPS}"
+do_populate_sysroot_setscene[depends] += "${USERADDSETSCENEDEPS}"
+
+# Recipe parse-time sanity checks
+def update_useradd_after_parse(d):
+    useradd_packages = d.getVar('USERADD_PACKAGES', True)
+
+    if not useradd_packages:
+        raise bb.build.FuncFailed("%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE', False))
+
+    for pkg in useradd_packages.split():
+        if not d.getVar('USERADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPMEMS_PARAM_%s' % pkg, True):
+            bb.fatal("%s inherits useradd but doesn't set USERADD_PARAM, GROUPADD_PARAM or GROUPMEMS_PARAM for package %s" % (d.getVar('FILE', False), pkg))
+
+python __anonymous() {
+    if not bb.data.inherits_class('nativesdk', d) \
+        and not bb.data.inherits_class('native', d):
+        update_useradd_after_parse(d)
+}
+
+# Return a single [GROUP|USER]ADD_PARAM formatted string which includes the
+# [group|user]add parameters for all USERADD_PACKAGES in this recipe
+def get_all_cmd_params(d, cmd_type):
+    import string
+    
+    param_type = cmd_type.upper() + "_PARAM_%s"
+    params = []
+
+    useradd_packages = d.getVar('USERADD_PACKAGES', True) or ""
+    for pkg in useradd_packages.split():
+        param = d.getVar(param_type % pkg, True)
+        if param:
+            params.append(param)
+
+    return "; ".join(params)
+
+# Adds the preinst script into generated packages
+fakeroot python populate_packages_prepend () {
+    def update_useradd_package(pkg):
+        bb.debug(1, 'adding user/group calls to preinst for %s' % pkg)
+
+        """
+        useradd preinst is appended here because pkg_preinst may be
+        required to execute on the target. Not doing so may cause
+        useradd preinst to be invoked twice, causing unwanted warnings.
+        """
+        preinst = d.getVar('pkg_preinst_%s' % pkg, True) or d.getVar('pkg_preinst', True)
+        if not preinst:
+            preinst = '#!/bin/sh\n'
+        preinst += 'bbnote () {\n\techo "NOTE: $*"\n}\n'
+        preinst += 'bbwarn () {\n\techo "WARNING: $*"\n}\n'
+        preinst += 'bbfatal () {\n\techo "ERROR: $*"\n\texit 1\n}\n'
+        preinst += 'perform_groupadd () {\n%s}\n' % d.getVar('perform_groupadd', True)
+        preinst += 'perform_useradd () {\n%s}\n' % d.getVar('perform_useradd', True)
+        preinst += 'perform_groupmems () {\n%s}\n' % d.getVar('perform_groupmems', True)
+        preinst += d.getVar('useradd_preinst', True)
+        d.setVar('pkg_preinst_%s' % pkg, preinst)
+
+        # RDEPENDS setup
+        rdepends = d.getVar("RDEPENDS_%s" % pkg, True) or ""
+        rdepends += ' ' + d.getVar('MLPREFIX', False) + 'base-passwd'
+        rdepends += ' ' + d.getVar('MLPREFIX', False) + 'shadow'
+        # base-files is where the default /etc/skel is packaged
+        rdepends += ' ' + d.getVar('MLPREFIX', False) + 'base-files'
+        d.setVar("RDEPENDS_%s" % pkg, rdepends)
+
+    # Add the user/group preinstall scripts and RDEPENDS requirements
+    # to packages specified by USERADD_PACKAGES
+    if not bb.data.inherits_class('nativesdk', d) \
+        and not bb.data.inherits_class('native', d):
+        useradd_packages = d.getVar('USERADD_PACKAGES', True) or ""
+        for pkg in useradd_packages.split():
+            update_useradd_package(pkg)
+}
+
+# Use the following to extend the useradd with custom functions
+USERADDEXTENSION ?= ""
+
+inherit ${USERADDEXTENSION}
diff --git a/meta/classes/useradd_base.bbclass b/meta/classes/useradd_base.bbclass
new file mode 100644
index 0000000..802f3a1
--- /dev/null
+++ b/meta/classes/useradd_base.bbclass
@@ -0,0 +1,230 @@
+# This bbclass provides basic functionality for user/group settings.
+# This bbclass is intended to be inherited by useradd.bbclass and
+# extrausers.bbclass.
+
+# The following functions basically have similar logic.
+# *) Perform necessary checks before invoking the actual command
+# *) Invoke the actual command, make retries if necessary
+# *) Error out if an error occurs.
+
+# Note that before invoking these functions, make sure the global variable
+# PSEUDO is set up correctly.
+
+perform_groupadd () {
+	local rootdir="$1"
+	local opts="$2"
+	local retries="$3"
+	bbnote "${PN}: Performing groupadd with [$opts] and $retries times of retry"
+	local groupname=`echo "$opts" | awk '{ print $NF }'`
+	local group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+	if test "x$group_exists" = "x"; then
+		local count=0
+		while true; do
+			eval $PSEUDO groupadd $opts || true
+			group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+			if test "x$group_exists" = "x"; then
+				bbwarn "${PN}: groupadd command did not succeed. Retrying..."
+			else
+				break
+			fi
+			count=`expr $count + 1`
+			if test $count = $retries; then
+				bbfatal "${PN}: Tried running groupadd command $retries times without success, giving up"
+			fi
+                        sleep $count
+		done
+	else
+		bbnote "${PN}: group $groupname already exists, not re-creating it"
+	fi
+}
+
+perform_useradd () {
+	local rootdir="$1"
+	local opts="$2"
+	local retries="$3"
+	bbnote "${PN}: Performing useradd with [$opts] and $retries times of retry"
+	local username=`echo "$opts" | awk '{ print $NF }'`
+	local user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
+	if test "x$user_exists" = "x"; then
+	       local count=0
+	       while true; do
+		       eval $PSEUDO useradd $opts || true
+		       user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
+		       if test "x$user_exists" = "x"; then
+			       bbwarn "${PN}: useradd command did not succeed. Retrying..."
+		       else
+			       break
+		       fi
+		       count=`expr $count + 1`
+		       if test $count = $retries; then
+				bbfatal "${PN}: Tried running useradd command $retries times without success, giving up"
+		       fi
+		       sleep $count
+	       done
+	else
+		bbnote "${PN}: user $username already exists, not re-creating it"
+	fi
+}
+
+perform_groupmems () {
+	local rootdir="$1"
+	local opts="$2"
+	local retries="$3"
+	bbnote "${PN}: Performing groupmems with [$opts] and $retries times of retry"
+	local groupname=`echo "$opts" | awk '{ for (i = 1; i < NF; i++) if ($i == "-g" || $i == "--group") print $(i+1) }'`
+	local username=`echo "$opts" | awk '{ for (i = 1; i < NF; i++) if ($i == "-a" || $i == "--add") print $(i+1) }'`
+	bbnote "${PN}: Running groupmems command with group $groupname and user $username"
+	# groupmems fails if /etc/gshadow does not exist
+	local gshadow=""
+	if [ -f $rootdir${sysconfdir}/gshadow ]; then
+		gshadow="yes"
+	else
+		gshadow="no"
+		touch $rootdir${sysconfdir}/gshadow
+	fi
+	local mem_exists="`grep "^$groupname:[^:]*:[^:]*:\([^,]*,\)*$username\(,[^,]*\)*" $rootdir/etc/group || true`"
+	if test "x$mem_exists" = "x"; then
+		local count=0
+		while true; do
+			eval $PSEUDO groupmems $opts || true
+			mem_exists="`grep "^$groupname:[^:]*:[^:]*:\([^,]*,\)*$username\(,[^,]*\)*" $rootdir/etc/group || true`"
+			if test "x$mem_exists" = "x"; then
+				bbwarn "${PN}: groupmems command did not succeed. Retrying..."
+			else
+				break
+			fi
+			count=`expr $count + 1`
+			if test $count = $retries; then
+				if test "x$gshadow" = "xno"; then
+					rm -f $rootdir${sysconfdir}/gshadow
+					rm -f $rootdir${sysconfdir}/gshadow-
+				fi
+				bbfatal "${PN}: Tried running groupmems command $retries times without success, giving up"
+			fi
+			sleep $count
+		done
+	else
+		bbwarn "${PN}: group $groupname already contains $username, not re-adding it"
+	fi
+	if test "x$gshadow" = "xno"; then
+		rm -f $rootdir${sysconfdir}/gshadow
+		rm -f $rootdir${sysconfdir}/gshadow-
+	fi
+}
+
+perform_groupdel () {
+	local rootdir="$1"
+	local opts="$2"
+	local retries="$3"
+	bbnote "${PN}: Performing groupdel with [$opts] and $retries times of retry"
+	local groupname=`echo "$opts" | awk '{ print $NF }'`
+	local group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+	if test "x$group_exists" != "x"; then
+		local count=0
+		while true; do
+			eval $PSEUDO groupdel $opts || true
+			group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+			if test "x$group_exists" != "x"; then
+				bbwarn "${PN}: groupdel command did not succeed. Retrying..."
+			else
+				break
+			fi
+			count=`expr $count + 1`
+			if test $count = $retries; then
+				bbfatal "${PN}: Tried running groupdel command $retries times without success, giving up"
+			fi
+			sleep $count
+		done
+	else
+		bbwarn "${PN}: group $groupname doesn't exist, not removing it"
+	fi
+}
+
+perform_userdel () {
+	local rootdir="$1"
+	local opts="$2"
+	local retries="$3"
+	bbnote "${PN}: Performing userdel with [$opts] and $retries times of retry"
+	local username=`echo "$opts" | awk '{ print $NF }'`
+	local user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
+	if test "x$user_exists" != "x"; then
+	       local count=0
+	       while true; do
+		       eval $PSEUDO userdel $opts || true
+		       user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
+		       if test "x$user_exists" != "x"; then
+			       bbwarn "${PN}: userdel command did not succeed. Retrying..."
+		       else
+			       break
+		       fi
+		       count=`expr $count + 1`
+		       if test $count = $retries; then
+				bbfatal "${PN}: Tried running userdel command $retries times without success, giving up"
+		       fi
+		       sleep $count
+	       done
+	else
+		bbwarn "${PN}: user $username doesn't exist, not removing it"
+	fi
+}
+
+perform_groupmod () {
+	# Other than the return value of groupmod, there's no simple way to judge whether the command
+	# succeeds, so we disable -e option temporarily
+	set +e
+	local rootdir="$1"
+	local opts="$2"
+	local retries="$3"
+	bbnote "${PN}: Performing groupmod with [$opts] and $retries times of retry"
+	local groupname=`echo "$opts" | awk '{ print $NF }'`
+	local group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
+	if test "x$group_exists" != "x"; then
+		local count=0
+		while true; do
+			eval $PSEUDO groupmod $opts
+			if test $? != 0; then
+				bbwarn "${PN}: groupmod command did not succeed. Retrying..."
+			else
+				break
+			fi
+			count=`expr $count + 1`
+			if test $count = $retries; then
+				bbfatal "${PN}: Tried running groupmod command $retries times without success, giving up"
+			fi
+			sleep $count
+		done
+	else
+		bbwarn "${PN}: group $groupname doesn't exist, unable to modify it"
+	fi
+	set -e
+}
+
+perform_usermod () {
+	# Same reason with groupmod, temporarily disable -e option
+	set +e
+	local rootdir="$1"
+	local opts="$2"
+	local retries="$3"
+	bbnote "${PN}: Performing usermod with [$opts] and $retries times of retry"
+	local username=`echo "$opts" | awk '{ print $NF }'`
+	local user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
+	if test "x$user_exists" != "x"; then
+	       local count=0
+	       while true; do
+		       eval $PSEUDO usermod $opts
+		       if test $? != 0; then
+			       bbwarn "${PN}: usermod command did not succeed. Retrying..."
+		       else
+			       break
+		       fi
+		       count=`expr $count + 1`
+		       if test $count = $retries; then
+				bbfatal "${PN}: Tried running usermod command $retries times without success, giving up"
+		       fi
+		       sleep $count
+	       done
+	else
+		bbwarn "${PN}: user $username doesn't exist, unable to modify it"
+	fi
+	set -e
+}
diff --git a/meta/classes/utility-tasks.bbclass b/meta/classes/utility-tasks.bbclass
new file mode 100644
index 0000000..e817b89
--- /dev/null
+++ b/meta/classes/utility-tasks.bbclass
@@ -0,0 +1,69 @@
+addtask listtasks
+do_listtasks[nostamp] = "1"
+python do_listtasks() {
+    taskdescs = {}
+    maxlen = 0
+    for e in d.keys():
+        if d.getVarFlag(e, 'task'):
+            maxlen = max(maxlen, len(e))
+            if e.endswith('_setscene'):
+                desc = "%s (setscene version)" % (d.getVarFlag(e[:-9], 'doc') or '')
+            else:
+                desc = d.getVarFlag(e, 'doc') or ''
+            taskdescs[e] = desc
+
+    tasks = sorted(taskdescs.keys())
+    for taskname in tasks:
+        bb.plain("%s  %s" % (taskname.ljust(maxlen), taskdescs[taskname]))
+}
+
+CLEANFUNCS ?= ""
+
+T_task-clean = "${LOG_DIR}/cleanlogs/${PN}"
+addtask clean
+do_clean[nostamp] = "1"
+python do_clean() {
+    """clear the build and temp directories"""
+    dir = d.expand("${WORKDIR}")
+    bb.note("Removing " + dir)
+    oe.path.remove(dir)
+
+    dir = "%s.*" % bb.data.expand(d.getVar('STAMP', False), d)
+    bb.note("Removing " + dir)
+    oe.path.remove(dir)
+
+    for f in (d.getVar('CLEANFUNCS', True) or '').split():
+        bb.build.exec_func(f, d)
+}
+
+addtask checkuri
+do_checkuri[nostamp] = "1"
+python do_checkuri() {
+    src_uri = (d.getVar('SRC_URI', True) or "").split()
+    if len(src_uri) == 0:
+        return
+
+    localdata = bb.data.createCopy(d)
+    bb.data.update_data(localdata)
+
+    try:
+        fetcher = bb.fetch2.Fetch(src_uri, localdata)
+        fetcher.checkstatus()
+    except bb.fetch2.BBFetchException, e:
+        raise bb.build.FuncFailed(e)
+}
+
+addtask checkuriall after do_checkuri
+do_checkuriall[recrdeptask] = "do_checkuriall do_checkuri"
+do_checkuriall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_checkuriall[nostamp] = "1"
+do_checkuriall() {
+	:
+}
+
+addtask fetchall after do_fetch
+do_fetchall[recrdeptask] = "do_fetchall do_fetch"
+do_fetchall[recideptask] = "do_${BB_DEFAULT_TASK}"
+do_fetchall() {
+	:
+}
diff --git a/meta/classes/utils.bbclass b/meta/classes/utils.bbclass
new file mode 100644
index 0000000..81b92cb
--- /dev/null
+++ b/meta/classes/utils.bbclass
@@ -0,0 +1,380 @@
+# For compatibility
+def base_path_join(a, *p):
+    return oe.path.join(a, *p)
+
+def base_path_relative(src, dest):
+    return oe.path.relative(src, dest)
+
+def base_path_out(path, d):
+    return oe.path.format_display(path, d)
+
+def base_read_file(filename):
+    return oe.utils.read_file(filename)
+
+def base_ifelse(condition, iftrue = True, iffalse = False):
+    return oe.utils.ifelse(condition, iftrue, iffalse)
+
+def base_conditional(variable, checkvalue, truevalue, falsevalue, d):
+    return oe.utils.conditional(variable, checkvalue, truevalue, falsevalue, d)
+
+def base_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+    return oe.utils.less_or_equal(variable, checkvalue, truevalue, falsevalue, d)
+
+def base_version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+    return oe.utils.version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d)
+
+def base_contains(variable, checkvalues, truevalue, falsevalue, d):
+    return bb.utils.contains(variable, checkvalues, truevalue, falsevalue, d)
+
+def base_both_contain(variable1, variable2, checkvalue, d):
+    return oe.utils.both_contain(variable1, variable2, checkvalue, d)
+
+def base_prune_suffix(var, suffixes, d):
+    return oe.utils.prune_suffix(var, suffixes, d)
+
+def oe_filter(f, str, d):
+    return oe.utils.str_filter(f, str, d)
+
+def oe_filter_out(f, str, d):
+    return oe.utils.str_filter_out(f, str, d)
+
+def machine_paths(d):
+    """List any existing machine specific filespath directories"""
+    machine = d.getVar("MACHINE", True)
+    filespathpkg = d.getVar("FILESPATHPKG", True).split(":")
+    for basepath in d.getVar("FILESPATHBASE", True).split(":"):
+        for pkgpath in filespathpkg:
+            machinepath = os.path.join(basepath, pkgpath, machine)
+            if os.path.isdir(machinepath):
+                yield machinepath
+
+def is_machine_specific(d):
+    """Determine whether the current recipe is machine specific"""
+    machinepaths = set(machine_paths(d))
+    srcuri = d.getVar("SRC_URI", True).split()
+    for url in srcuri:
+        fetcher = bb.fetch2.Fetch([srcuri], d)
+        if url.startswith("file://"):
+            if any(fetcher.localpath(url).startswith(mp + "/") for mp in machinepaths):
+                return True
+
+oe_soinstall() {
+	# Purpose: Install shared library file and
+	#          create the necessary links
+	# Example:
+	#
+	# oe_
+	#
+	#bbnote installing shared library $1 to $2
+	#
+	libname=`basename $1`
+	install -m 755 $1 $2/$libname
+	sonamelink=`${HOST_PREFIX}readelf -d $1 |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'`
+	solink=`echo $libname | sed -e 's/\.so\..*/.so/'`
+	ln -sf $libname $2/$sonamelink
+	ln -sf $libname $2/$solink
+}
+
+oe_libinstall() {
+	# Purpose: Install a library, in all its forms
+	# Example
+	#
+	# oe_libinstall libltdl ${STAGING_LIBDIR}/
+	# oe_libinstall -C src/libblah libblah ${D}/${libdir}/
+	dir=""
+	libtool=""
+	silent=""
+	require_static=""
+	require_shared=""
+	staging_install=""
+	while [ "$#" -gt 0 ]; do
+		case "$1" in
+		-C)
+			shift
+			dir="$1"
+			;;
+		-s)
+			silent=1
+			;;
+		-a)
+			require_static=1
+			;;
+		-so)
+			require_shared=1
+			;;
+		-*)
+			bbfatal "oe_libinstall: unknown option: $1"
+			;;
+		*)
+			break;
+			;;
+		esac
+		shift
+	done
+
+	libname="$1"
+	shift
+	destpath="$1"
+	if [ -z "$destpath" ]; then
+		bbfatal "oe_libinstall: no destination path specified"
+	fi
+	if echo "$destpath/" | egrep '^${STAGING_LIBDIR}/' >/dev/null
+	then
+		staging_install=1
+	fi
+
+	__runcmd () {
+		if [ -z "$silent" ]; then
+			echo >&2 "oe_libinstall: $*"
+		fi
+		$*
+	}
+
+	if [ -z "$dir" ]; then
+		dir=`pwd`
+	fi
+
+	dotlai=$libname.lai
+
+	# Sanity check that the libname.lai is unique
+	number_of_files=`(cd $dir; find . -name "$dotlai") | wc -l`
+	if [ $number_of_files -gt 1 ]; then
+		bbfatal "oe_libinstall: $dotlai is not unique in $dir"
+	fi
+
+
+	dir=$dir`(cd $dir;find . -name "$dotlai") | sed "s/^\.//;s/\/$dotlai\$//;q"`
+	olddir=`pwd`
+	__runcmd cd $dir
+
+	lafile=$libname.la
+
+	# If such file doesn't exist, try to cut version suffix
+	if [ ! -f "$lafile" ]; then
+		libname1=`echo "$libname" | sed 's/-[0-9.]*$//'`
+		lafile1=$libname.la
+		if [ -f "$lafile1" ]; then
+			libname=$libname1
+			lafile=$lafile1
+		fi
+	fi
+
+	if [ -f "$lafile" ]; then
+		# libtool archive
+		eval `cat $lafile|grep "^library_names="`
+		libtool=1
+	else
+		library_names="$libname.so* $libname.dll.a $libname.*.dylib"
+	fi
+
+	__runcmd install -d $destpath/
+	dota=$libname.a
+	if [ -f "$dota" -o -n "$require_static" ]; then
+		rm -f $destpath/$dota
+		__runcmd install -m 0644 $dota $destpath/
+	fi
+	if [ -f "$dotlai" -a -n "$libtool" ]; then
+		rm -f $destpath/$libname.la
+		__runcmd install -m 0644 $dotlai $destpath/$libname.la
+	fi
+
+	for name in $library_names; do
+		files=`eval echo $name`
+		for f in $files; do
+			if [ ! -e "$f" ]; then
+				if [ -n "$libtool" ]; then
+					bbfatal "oe_libinstall: $dir/$f not found."
+				fi
+			elif [ -L "$f" ]; then
+				__runcmd cp -P "$f" $destpath/
+			elif [ ! -L "$f" ]; then
+				libfile="$f"
+				rm -f $destpath/$libfile
+				__runcmd install -m 0755 $libfile $destpath/
+			fi
+		done
+	done
+
+	if [ -z "$libfile" ]; then
+		if  [ -n "$require_shared" ]; then
+			bbfatal "oe_libinstall: unable to locate shared library"
+		fi
+	elif [ -z "$libtool" ]; then
+		# special case hack for non-libtool .so.#.#.# links
+		baselibfile=`basename "$libfile"`
+		if (echo $baselibfile | grep -qE '^lib.*\.so\.[0-9.]*$'); then
+			sonamelink=`${HOST_PREFIX}readelf -d $libfile |grep 'Library soname:' |sed -e 's/.*\[\(.*\)\].*/\1/'`
+			solink=`echo $baselibfile | sed -e 's/\.so\..*/.so/'`
+			if [ -n "$sonamelink" -a x"$baselibfile" != x"$sonamelink" ]; then
+				__runcmd ln -sf $baselibfile $destpath/$sonamelink
+			fi
+			__runcmd ln -sf $baselibfile $destpath/$solink
+		fi
+	fi
+
+	__runcmd cd "$olddir"
+}
+
+oe_machinstall() {
+	# Purpose: Install machine dependent files, if available
+	#          If not available, check if there is a default
+	#          If no default, just touch the destination
+	# Example:
+	#                $1  $2   $3         $4
+	# oe_machinstall -m 0644 fstab ${D}/etc/fstab
+	#
+	# TODO: Check argument number?
+	#
+	filename=`basename $3`
+	dirname=`dirname $3`
+
+	for o in `echo ${OVERRIDES} | tr ':' ' '`; do
+		if [ -e $dirname/$o/$filename ]; then
+			bbnote $dirname/$o/$filename present, installing to $4
+			install $1 $2 $dirname/$o/$filename $4
+			return
+		fi
+	done
+#	bbnote overrides specific file NOT present, trying default=$3...
+	if [ -e $3 ]; then
+		bbnote $3 present, installing to $4
+		install $1 $2 $3 $4
+	else
+		bbnote $3 NOT present, touching empty $4
+		touch $4
+	fi
+}
+
+create_cmdline_wrapper () {
+	# Create a wrapper script where commandline options are needed
+	#
+	# These are useful to work around relocation issues, by passing extra options 
+	# to a program
+	#
+	# Usage: create_cmdline_wrapper FILENAME <extra-options>
+
+	cmd=$1
+	shift
+
+	echo "Generating wrapper script for $cmd"
+
+	mv $cmd $cmd.real
+	cmdname=`basename $cmd`
+	cat <<END >$cmd
+#!/bin/bash
+realpath=\`readlink -fn \$0\`
+exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real $@ "\$@"
+END
+	chmod +x $cmd
+}
+
+create_wrapper () {
+	# Create a wrapper script where extra environment variables are needed
+	#
+	# These are useful to work around relocation issues, by setting environment
+	# variables which point to paths in the filesystem.
+	#
+	# Usage: create_wrapper FILENAME [[VAR=VALUE]..]
+
+	cmd=$1
+	shift
+
+	echo "Generating wrapper script for $cmd"
+
+	mv $cmd $cmd.real
+	cmdname=`basename $cmd`
+	cat <<END >$cmd
+#!/bin/bash
+realpath=\`readlink -fn \$0\`
+export $@
+exec -a \`dirname \$realpath\`/$cmdname \`dirname \$realpath\`/$cmdname.real "\$@"
+END
+	chmod +x $cmd
+}
+
+# Copy files/directories from $1 to $2 but using hardlinks
+# (preserve symlinks)
+hardlinkdir () {
+	from=$1
+	to=$2
+	(cd $from; find . -print0 | cpio --null -pdlu $to)
+}
+
+
+def check_app_exists(app, d):
+    app = d.expand(app)
+    path = d.getVar('PATH', d, True)
+    return bool(bb.utils.which(path, app))
+
+def explode_deps(s):
+    return bb.utils.explode_deps(s)
+
+def base_set_filespath(path, d):
+    filespath = []
+    extrapaths = (d.getVar("FILESEXTRAPATHS", True) or "")
+    # Remove default flag which was used for checking
+    extrapaths = extrapaths.replace("__default:", "")
+    # Don't prepend empty strings to the path list
+    if extrapaths != "":
+        path = extrapaths.split(":") + path
+    # The ":" ensures we have an 'empty' override
+    overrides = (":" + (d.getVar("FILESOVERRIDES", True) or "")).split(":")
+    overrides.reverse()
+    for o in overrides:
+        for p in path:
+            if p != "": 
+                filespath.append(os.path.join(p, o))
+    return ":".join(filespath)
+
+def extend_variants(d, var, extend, delim=':'):
+    """Return a string of all bb class extend variants for the given extend"""
+    variants = []
+    whole = d.getVar(var, True) or ""
+    for ext in whole.split():
+        eext = ext.split(delim)
+        if len(eext) > 1 and eext[0] == extend:
+            variants.append(eext[1])
+    return " ".join(variants)
+
+def multilib_pkg_extend(d, pkg):
+    variants = (d.getVar("MULTILIB_VARIANTS", True) or "").split()
+    if not variants:
+        return pkg
+    pkgs = pkg
+    for v in variants:
+        pkgs = pkgs + " " + v + "-" + pkg
+    return pkgs
+
+def all_multilib_tune_values(d, var, unique = True, need_split = True, delim = ' '):
+    """Return a string of all ${var} in all multilib tune configuration"""
+    values = []
+    value = d.getVar(var, True) or ""
+    if value != "":
+        if need_split:
+            for item in value.split(delim):
+                values.append(item)
+        else:
+            values.append(value)
+    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+    for item in variants.split():
+        localdata = bb.data.createCopy(d)
+        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+        localdata.setVar("OVERRIDES", overrides)
+        localdata.setVar("MLPREFIX", item + "-")
+        bb.data.update_data(localdata)
+        value = localdata.getVar(var, True) or ""
+        if value != "":
+            if need_split:
+                for item in value.split(delim):
+                    values.append(item)
+            else:
+                values.append(value)
+    if unique:
+        #we do this to keep order as much as possible
+        ret = []
+        for value in values:
+            if not value in ret:
+                ret.append(value)
+    else:
+        ret = values
+    return " ".join(ret)
diff --git a/meta/classes/vala.bbclass b/meta/classes/vala.bbclass
new file mode 100644
index 0000000..9ff664a
--- /dev/null
+++ b/meta/classes/vala.bbclass
@@ -0,0 +1,18 @@
+# Everyone needs vala-native and targets need vala, too,
+# because that is where target builds look for .vapi files.
+#
+VALADEPENDS = ""
+VALADEPENDS_class-target = "vala"
+DEPENDS_append = " vala-native ${VALADEPENDS}"
+
+# Our patched version of Vala looks in STAGING_DATADIR for .vapi files
+export STAGING_DATADIR
+# Upstream Vala >= 0.11 looks in XDG_DATA_DIRS for .vapi files
+export XDG_DATA_DIRS = "${STAGING_DATADIR}"
+
+# Package additional files
+FILES_${PN}-dev += "\
+    ${datadir}/vala/vapi/*.vapi \
+    ${datadir}/vala/vapi/*.deps \
+    ${datadir}/gir-1.0 \
+"
diff --git a/meta/classes/waf.bbclass b/meta/classes/waf.bbclass
new file mode 100644
index 0000000..3a221e7
--- /dev/null
+++ b/meta/classes/waf.bbclass
@@ -0,0 +1,13 @@
+waf_do_configure() {
+	${S}/waf configure --prefix=${prefix} ${EXTRA_OECONF}
+}
+
+waf_do_compile()  {
+	${S}/waf build ${PARALLEL_MAKE}
+}
+
+waf_do_install() {
+	${S}/waf install --destdir=${D}
+}
+
+EXPORT_FUNCTIONS do_configure do_compile do_install
diff --git a/meta/conf/abi_version.conf b/meta/conf/abi_version.conf
new file mode 100644
index 0000000..a829687
--- /dev/null
+++ b/meta/conf/abi_version.conf
@@ -0,0 +1,7 @@
+#
+# OELAYOUT_ABI allows us to notify users when the format of TMPDIR changes in 
+# an incompatible way. Such changes should usually be detailed in the commit
+# that breaks the format and have been previously discussed on the mailing list 
+# with general agreement from the core team.
+#
+OELAYOUT_ABI = "11"
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
new file mode 100644
index 0000000..d8a66f9
--- /dev/null
+++ b/meta/conf/bitbake.conf
@@ -0,0 +1,812 @@
+##################################################################
+# Standard target filesystem paths.
+##################################################################
+#
+# If changing these values, beware that native/cross/nativesdk bbclass
+# files may also need changes to keep in sync.
+#
+
+# Used by multilib code to change the library paths
+baselib = "${BASELIB}"
+baselib[vardepvalue] = "${baselib}"
+BASELIB = "lib"
+BASELIB_powerpc64 = "lib64"
+
+# Path prefixes
+export base_prefix = ""
+export prefix = "/usr"
+export exec_prefix = "/usr"
+
+# Base paths
+export base_bindir = "${base_prefix}/bin"
+export base_sbindir = "${base_prefix}/sbin"
+export base_libdir = "${base_prefix}/${baselib}"
+export nonarch_base_libdir = "${base_prefix}/lib"
+
+# Architecture independent paths
+export sysconfdir = "${base_prefix}/etc"
+export servicedir = "${base_prefix}/srv"
+export sharedstatedir = "${base_prefix}/com"
+export localstatedir = "${base_prefix}/var"
+export datadir = "${prefix}/share"
+export infodir = "${datadir}/info"
+export mandir = "${datadir}/man"
+export docdir = "${datadir}/doc"
+export systemd_unitdir = "${nonarch_base_libdir}/systemd"
+export systemd_system_unitdir = "${nonarch_base_libdir}/systemd/system"
+export nonarch_libdir = "${exec_prefix}/lib"
+export systemd_user_unitdir = "${nonarch_libdir}/systemd/user"
+
+# Architecture dependent paths
+export bindir = "${exec_prefix}/bin"
+export sbindir = "${exec_prefix}/sbin"
+export libdir = "${exec_prefix}/${baselib}"
+export libexecdir = "${libdir}/${BPN}"
+export includedir = "${exec_prefix}/include"
+export oldincludedir = "${exec_prefix}/include"
+localedir = "${libdir}/locale"
+
+# Linkage between native/cross/nativesdk layouts
+base_bindir_native = "/bin"
+base_sbindir_native = "/sbin"
+sysconfdir_native = "/etc"
+prefix_native = "/usr"
+bindir_native = "${prefix_native}/bin"
+sbindir_native = "${prefix_native}/sbin"
+includedir_native = "${prefix_native}/include"
+libdir_native = "${prefix_native}/lib"
+libexecdir_native = "${libdir_native}/${BPN}"
+base_libdir_native = "/lib"
+datadir_native = "${prefix_native}/share"
+bindir_cross = "/bin"
+bindir_crossscripts = "${bindir}/crossscripts"
+prefix_nativesdk = "/usr"
+bindir_nativesdk = "${prefix_nativesdk}/bin"
+includedir_nativesdk = "${prefix_nativesdk}/include"
+libdir_nativesdk = "${prefix_nativesdk}/lib"
+base_libdir_nativesdk = "/lib"
+localstatedir_nativesdk = "/var"
+
+#
+# Cross recipes need to know about the target layout
+# := is used carefully here
+#
+target_datadir := "${datadir}"
+# Used to find env/perl/python
+USRBINPATH = "${bindir}"
+USRBINPATH_class-native = "/usr/bin"
+USRBINPATH_class-nativesdk = "/usr/bin"
+
+# Root home directory
+ROOT_HOME ??= "/home/root"
+
+##################################################################
+# Architecture-dependent build variables.
+##################################################################
+
+# Immediate expansion since there is no point in reapeatedly calling
+# os.uname() throughout parsing
+BUILD_ARCH := "${@os.uname()[4]}"
+BUILD_OS := "${@os.uname()[0].lower()}"
+BUILD_VENDOR = ""
+BUILD_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}"
+BUILD_PREFIX = ""
+BUILD_CC_ARCH = ""
+BUILD_LD_ARCH = ""
+BUILD_AS_ARCH = ""
+BUILD_EXEEXT = ""
+
+HOST_ARCH = "${TARGET_ARCH}"
+HOST_OS = "${TARGET_OS}"
+HOST_VENDOR = "${TARGET_VENDOR}"
+HOST_SYS = "${HOST_ARCH}${HOST_VENDOR}-${HOST_OS}"
+HOST_PREFIX = "${TARGET_PREFIX}"
+HOST_CC_ARCH = "${TARGET_CC_ARCH}"
+HOST_LD_ARCH = "${TARGET_LD_ARCH}"
+HOST_AS_ARCH = "${TARGET_AS_ARCH}"
+HOST_EXEEXT = ""
+
+TUNE_ARCH ??= "INVALID"
+TUNE_CCARGS ??= ""
+TUNE_CCARGS[vardepvalue] = "${TUNE_CCARGS}"
+TUNE_LDARGS ??= ""
+TUNE_ASARGS ??= ""
+TUNE_FEATURES ??= "${TUNE_FEATURES_tune-${DEFAULTTUNE}}"
+LIBCEXTENSION ??= ""
+ABIEXTENSION ??= ""
+USE_NLS ??= "${@bb.utils.contains('DISTRO_FEATURES', 'libc-locale-code', 'yes', 'no', d)}"
+SDKUSE_NLS ??= "yes"
+
+TARGET_ARCH = "${TUNE_ARCH}"
+TARGET_OS = "linux${LIBCEXTENSION}${ABIEXTENSION}"
+TARGET_VENDOR = "-oe"
+TARGET_SYS = "${TARGET_ARCH}${TARGET_VENDOR}${@['-' + d.getVar('TARGET_OS', True), ''][d.getVar('TARGET_OS', True) == ('' or 'custom')]}"
+TARGET_PREFIX = "${TARGET_SYS}-"
+TARGET_CC_ARCH = "${TUNE_CCARGS}"
+TARGET_LD_ARCH = "${TUNE_LDARGS}"
+TARGET_AS_ARCH = "${TUNE_ASARGS}"
+
+SDK_ARCH = "${BUILD_ARCH}"
+SDK_OS = "${BUILD_OS}"
+SDK_VENDOR = "-oesdk"
+SDK_SYS = "${SDK_ARCH}${SDK_VENDOR}${@['-' + d.getVar('SDK_OS', True), ''][d.getVar('SDK_OS', True) == ('' or 'custom')]}"
+SDK_PREFIX = "${SDK_SYS}-"
+SDK_CC_ARCH = "${BUILD_CC_ARCH}"
+SDKPKGSUFFIX = "nativesdk"
+SDK_PACKAGE_ARCHS = "all any noarch ${SDK_ARCH}-${SDKPKGSUFFIX}"
+SDK_LD_ARCH = "${BUILD_LD_ARCH}"
+SDK_AS_ARCH = "${BUILD_AS_ARCH}"
+
+TUNE_PKGARCH ??= ""
+PACKAGE_ARCH ??= "${TUNE_PKGARCH}"
+MACHINE_ARCH = "${@[d.getVar('TUNE_PKGARCH', True), d.getVar('MACHINE', True)][bool(d.getVar('MACHINE', True))].replace('-', '_')}"
+PACKAGE_EXTRA_ARCHS ??= "${PACKAGE_EXTRA_ARCHS_tune-${DEFAULTTUNE}}"
+PACKAGE_ARCHS = "all any noarch ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}"
+# MACHINE_ARCH shouldn't be included here as a variable dependency
+# since machine specific packages are handled using multimachine
+PACKAGE_ARCHS[vardepsexclude] = "MACHINE_ARCH"
+
+MULTIMACH_TARGET_SYS = "${PACKAGE_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+MULTIMACH_HOST_SYS = "${PACKAGE_ARCH}${HOST_VENDOR}-${HOST_OS}"
+
+##################################################################
+# Date/time variables.
+##################################################################
+
+DATE := "${@time.strftime('%Y%m%d',time.gmtime())}"
+TIME := "${@time.strftime('%H%M%S',time.gmtime())}"
+DATETIME = "${DATE}${TIME}"
+
+##################################################################
+# Openembedded Software Prerequisites.
+##################################################################
+
+# python-native should be here but python relies on building
+# its own in staging
+ASSUME_PROVIDED = "\
+    bzip2-native \
+    chrpath-native \
+    git-native \
+    grep-native \
+    diffstat-native \
+    patch-native \
+    perl-native-runtime \
+    python-native-runtime \
+    tar-native \
+    virtual/libintl-native \
+    texinfo-native \
+    bash-native \
+    sed-native \
+    "
+# gzip-native should be listed above?
+
+##################################################################
+# Package default variables.
+##################################################################
+
+PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[0] or 'defaultpkgname'}"
+PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[1] or '1.0'}"
+PR = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE', False),d)[2] or 'r0'}"
+PF = "${PN}-${EXTENDPE}${PV}-${PR}"
+EXTENDPE = "${@['','${PE\x7d_'][int(d.getVar('PE', True) or 0) > 0]}"
+P = "${PN}-${PV}"
+
+EXTENDPRAUTO = "${@['.${PRAUTO\x7d',''][d.getVar('PRAUTO', True) is None]}"
+PRAUTOINX = "${PF}"
+
+PKGV ?= "${PV}"
+PKGR ?= "${PR}${EXTENDPRAUTO}"
+PKGE ?= "${@['','${PE\x7d'][int(d.getVar('PE', True) or 0) > 0]}"
+EXTENDPKGEVER = "${@['','${PKGE\x7d:'][d.getVar('PKGE', True).strip() != '']}"
+EXTENDPKGV ?= "${EXTENDPKGEVER}${PKGV}-${PKGR}"
+
+# Base package name
+# Automatically derives "foo" from "foo-native", "foo-cross" or "foo-initial"
+# otherwise it is the same as PN and P
+SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -crosssdk -cross-canadian"
+BPN = "${@base_prune_suffix(d.getVar('PN', True), d.getVar('SPECIAL_PKGSUFFIX', True).split(), d)}"
+BP = "${BPN}-${PV}"
+
+# Package info.
+
+SECTION = "base"
+PRIORITY = "optional"
+SUMMARY ?= "${PN} version ${PV}-${PR}"
+DESCRIPTION ?= "${SUMMARY}."
+
+# The following two are commented out because they result in a recursive
+# definition of the variable in some corner cases.  These are left in
+# to illustrate the intended behavior.
+#SUMMARY_${PN} ?= "${SUMMARY}"
+#DESCRIPTION_${PN} ?= "${DESCRIPTION}"
+
+SUMMARY_${PN}-dbg ?= "${SUMMARY} - Debugging files"
+DESCRIPTION_${PN}-dbg ?= "${DESCRIPTION}  \
+This package contains ELF symbols and related sources for debugging purposes."
+
+SUMMARY_${PN}-dev ?= "${SUMMARY} - Development files"
+DESCRIPTION_${PN}-dev ?= "${DESCRIPTION}  \
+This package contains symbolic links, header files, and \
+related items necessary for software development."
+
+SUMMARY_${PN}-staticdev ?= "${SUMMARY} - Development files (Static Libraries)"
+DESCRIPTION_${PN}-staticdev?= "${DESCRIPTION}  \
+This package contains static libraries for software development."
+
+SUMMARY_${PN}-doc ?= "${SUMMARY} - Documentation files"
+DESCRIPTION_${PN}-doc ?= "${DESCRIPTION}  \
+This package contains documentation."
+
+LICENSE = "INVALID"
+MAINTAINER = "OE-Core Developers <openembedded-core@lists.openembedded.org>"
+HOMEPAGE = ""
+
+# Package dependencies and provides.
+
+# Ensure that -dev packages recommend the corresponding -dev packages of their
+# deps, and the same for -dbg.
+DEPCHAIN_PRE  = ""
+DEPCHAIN_POST = "-dev -dbg"
+
+DEPENDS = ""
+RDEPENDS = ""
+PROVIDES = ""
+PROVIDES_prepend = "${PN} "
+RPROVIDES = ""
+
+MULTI_PROVIDER_WHITELIST = "virtual/libintl virtual/libintl-native virtual/nativesdk-libintl virtual/xserver virtual/update-alternatives-native virtual/update-alternatives"
+
+SOLIBS = ".so.*"
+SOLIBS_darwin = ".dylib"
+
+SOLIBSDEV = ".so"
+# Due to the ordering of PACKAGES and the naming of the dev symlinks on darwin,
+# we can't make the symlinks end up in the -dev packages easily at this point. This hack
+# at least means builds aren't completely broken and symlinks don't take up much space.
+SOLIBSDEV_darwin = ".dylibbroken"
+
+PACKAGE_BEFORE_PN ?= ""
+PACKAGES = "${PN}-dbg ${PN}-staticdev ${PN}-dev ${PN}-doc ${PN}-locale ${PACKAGE_BEFORE_PN} ${PN}"
+PACKAGES_DYNAMIC = "^${PN}-locale-.*"
+FILES = ""
+
+FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*${SOLIBS} \
+            ${sysconfdir} ${sharedstatedir} ${localstatedir} \
+            ${base_bindir}/* ${base_sbindir}/* \
+            ${base_libdir}/*${SOLIBS} \
+            ${base_prefix}/lib/udev/rules.d ${prefix}/lib/udev/rules.d \
+            ${datadir}/${BPN} ${libdir}/${BPN}/* \
+            ${datadir}/pixmaps ${datadir}/applications \
+            ${datadir}/idl ${datadir}/omf ${datadir}/sounds \
+            ${libdir}/bonobo/servers"
+
+FILES_${PN}-bin = "${bindir}/* ${sbindir}/*"
+
+FILES_${PN}-doc = "${docdir} ${mandir} ${infodir} ${datadir}/gtk-doc \
+            ${datadir}/gnome/help"
+SECTION_${PN}-doc = "doc"
+
+FILES_SOLIBSDEV ?= "${base_libdir}/lib*${SOLIBSDEV} ${libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-dev = "${includedir} ${FILES_SOLIBSDEV} ${libdir}/*.la \
+                ${libdir}/*.o ${libdir}/pkgconfig ${datadir}/pkgconfig \
+                ${datadir}/aclocal ${base_libdir}/*.o \
+                ${libdir}/${BPN}/*.la ${base_libdir}/*.la"
+SECTION_${PN}-dev = "devel"
+ALLOW_EMPTY_${PN}-dev = "1"
+RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
+
+FILES_${PN}-staticdev = "${libdir}/*.a ${base_libdir}/*.a ${libdir}/${BPN}/*.a"
+SECTION_${PN}-staticdev = "devel"
+RDEPENDS_${PN}-staticdev = "${PN}-dev (= ${EXTENDPKGV})"
+
+DOTDEBUG-dbg = "${bindir}/.debug ${sbindir}/.debug ${libexecdir}/.debug ${libdir}/.debug \
+            ${base_bindir}/.debug ${base_sbindir}/.debug ${base_libdir}/.debug ${libdir}/${BPN}/.debug \
+            ${libdir}/matchbox-panel/.debug ${libexecdir}/${BPN}/.debug /usr/src/debug"
+
+DEBUGFILEDIRECTORY-dbg = "/usr/lib/debug /usr/src/debug"
+
+FILES_${PN}-dbg = "${@d.getVar(['DOTDEBUG-dbg', 'DEBUGFILEDIRECTORY-dbg'][d.getVar('PACKAGE_DEBUG_SPLIT_STYLE', True) == 'debug-file-directory'], True)}"
+
+SECTION_${PN}-dbg = "devel"
+ALLOW_EMPTY_${PN}-dbg = "1"
+
+FILES_${PN}-locale = "${datadir}/locale"
+
+# File manifest
+
+FILE_DIRNAME = "${@os.path.dirname(d.getVar('FILE', False))}"
+# FILESPATH is set in base.bbclass
+#FILESPATH = "${FILE_DIRNAME}/${PF}:${FILE_DIRNAME}/${P}:${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/${BP}:${FILE_DIRNAME}/${BPN}:${FILE_DIRNAME}/files:${FILE_DIRNAME}"
+# This default was only used for checking
+FILESEXTRAPATHS ?= "__default:"
+
+##################################################################
+# General work and output directories for the build system.
+##################################################################
+
+TMPDIR ?= "${TOPDIR}/tmp"
+CACHE = "${TMPDIR}/cache${@['', '/' + str(d.getVar('MACHINE', True))][bool(d.getVar('MACHINE', True))]}${@['', '/' + str(d.getVar('SDKMACHINE', True))][bool(d.getVar('SDKMACHINE', True))]}"
+# The persistent cache should be shared by all builds
+PERSISTENT_DIR = "${TOPDIR}/cache"
+LOG_DIR = "${TMPDIR}/log"
+CO_DIR = "${DL_DIR}"
+CVSDIR = "${CO_DIR}/cvs"
+SVNDIR = "${CO_DIR}/svn"
+GITDIR = "${CO_DIR}/git2"
+BZRDIR = "${CO_DIR}/bzr"
+HGDIR = "${CO_DIR}/hg"
+
+STAMPS_DIR ?= "${TMPDIR}/stamps"
+STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
+STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*"
+BASE_WORKDIR ?= "${TMPDIR}/work"
+WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}"
+T = "${WORKDIR}/temp"
+D = "${WORKDIR}/image"
+S = "${WORKDIR}/${BP}"
+B = "${S}"
+
+STAGING_DIR = "${TMPDIR}/sysroots"
+
+STAGING_DIR_NATIVE = "${STAGING_DIR}/${BUILD_SYS}"
+STAGING_BINDIR_NATIVE = "${STAGING_DIR_NATIVE}${bindir_native}"
+STAGING_BINDIR_CROSS = "${STAGING_BINDIR}/crossscripts"
+STAGING_BINDIR_TOOLCHAIN = "${STAGING_DIR_NATIVE}${bindir_native}/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"
+STAGING_LIBDIR_NATIVE = "${STAGING_DIR_NATIVE}${libdir_native}"
+STAGING_LIBEXECDIR_NATIVE = "${STAGING_DIR_NATIVE}${libexecdir_native}"
+STAGING_BASE_LIBDIR_NATIVE = "${STAGING_DIR_NATIVE}${base_libdir_native}"
+STAGING_SBINDIR_NATIVE = "${STAGING_DIR_NATIVE}${sbindir_native}"
+STAGING_INCDIR_NATIVE = "${STAGING_DIR_NATIVE}${includedir_native}"
+STAGING_ETCDIR_NATIVE = "${STAGING_DIR_NATIVE}${sysconfdir_native}"
+STAGING_DATADIR_NATIVE = "${STAGING_DIR_NATIVE}${datadir_native}"
+
+STAGING_DIR_HOST = "${STAGING_DIR}/${MACHINE}"
+STAGING_BINDIR = "${STAGING_DIR_HOST}${bindir}"
+STAGING_LIBDIR = "${STAGING_DIR_HOST}${libdir}"
+STAGING_LIBEXECDIR = "${STAGING_DIR_HOST}${libexecdir}"
+STAGING_BASELIBDIR = "${STAGING_DIR_HOST}${base_libdir}"
+STAGING_INCDIR = "${STAGING_DIR_HOST}${includedir}"
+STAGING_DATADIR = "${STAGING_DIR_HOST}${datadir}"
+STAGING_EXECPREFIXDIR = "${STAGING_DIR_HOST}${exec_prefix}"
+STAGING_LOADER_DIR = "${STAGING_DIR_HOST}/loader"
+STAGING_FIRMWARE_DIR = "${STAGING_DIR_HOST}/firmware"
+
+STAGING_DIR_TARGET = "${STAGING_DIR}/${MACHINE}"
+STAGING_DIR_TCBOOTSTRAP = "${STAGING_DIR_TARGET}-tcbootstrap"
+
+# Setting DEPLOY_DIR outside of TMPDIR is helpful, when you are using
+# packaged staging and/or multimachine.
+DEPLOY_DIR ?= "${TMPDIR}/deploy"
+DEPLOY_DIR_TAR = "${DEPLOY_DIR}/tar"
+DEPLOY_DIR_IPK = "${DEPLOY_DIR}/ipk"
+DEPLOY_DIR_RPM = "${DEPLOY_DIR}/rpm"
+DEPLOY_DIR_DEB = "${DEPLOY_DIR}/deb"
+DEPLOY_DIR_IMAGE ?= "${DEPLOY_DIR}/images/${MACHINE}"
+DEPLOY_DIR_TOOLS = "${DEPLOY_DIR}/tools"
+
+PKGDATA_DIR = "${STAGING_DIR_HOST}/pkgdata"
+
+##################################################################
+# SDK variables.
+##################################################################
+
+SDK_NAME_PREFIX ?= "oecore"
+SDK_NAME = "${SDK_NAME_PREFIX}-${SDK_ARCH}-${TUNE_PKGARCH}"
+SDKPATH = "/usr/local/${SDK_NAME_PREFIX}-${SDK_ARCH}"
+SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
+
+##################################################################
+# Kernel info.
+##################################################################
+
+OLDEST_KERNEL = "2.6.32"
+OLDEST_KERNEL_aarch64 = "3.14"
+STAGING_KERNEL_DIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-source"
+STAGING_KERNEL_BUILDDIR = "${TMPDIR}/work-shared/${MACHINE}/kernel-build-artifacts"
+
+##################################################################
+# Specific image creation and rootfs population info.
+##################################################################
+
+IMAGE_ROOTFS = "${WORKDIR}/rootfs"
+IMAGE_BASENAME = "${PN}"
+IMAGE_NAME = "${IMAGE_BASENAME}-${MACHINE}-${DATETIME}"
+IMAGE_NAME[vardepsexclude] += "DATETIME"
+IMAGE_LINK_NAME = "${IMAGE_BASENAME}-${MACHINE}"
+
+# This option allows for a percentage overage of the actual image size rather than a
+# fixed extra space, this is space needed for initial startup and basic operations.
+IMAGE_OVERHEAD_FACTOR ?= "1.3"
+# This option allows for adding additional space in K above and beyond what the
+# IMAGE_OVERHEAD_FACTOR might add. This space is for additional packages, user data, ...
+# To set a fixed size then overriding IMAGE_ROOTFS_SIZE with the max size one wants
+# should do the trick
+IMAGE_ROOTFS_EXTRA_SPACE ?= "0"
+
+EXTRA_IMAGEDEPENDS = ""
+
+##################################################################
+# Toolchain info.
+##################################################################
+
+PATH_prepend = "${COREBASE}/scripts:${STAGING_BINDIR_TOOLCHAIN}:${STAGING_BINDIR_CROSS}:${STAGING_DIR_NATIVE}${sbindir_native}:${STAGING_BINDIR_NATIVE}:${STAGING_DIR_NATIVE}${base_sbindir_native}:${STAGING_DIR_NATIVE}${base_bindir_native}:"
+export PATH
+
+##################################################################
+# Build utility info.
+##################################################################
+
+CCACHE ??= ""
+# Disable ccache explicitly if CCACHE is null since gcc may be a symlink
+# of ccache some distributions (e.g., Fedora 17).
+export CCACHE_DISABLE ??= "${@[0,1][d.getVar('CCACHE', True) == '']}"
+# Assign CCACHE_DIR a default value to fix a bug of ccache 3.1.7,
+# since it would always create CCACHE_DIR/.ccache even if
+# CCACHE_DISABLE = 1.
+export CCACHE_DIR ??= "${@os.getenv('HOME')}"
+
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}"
+
+export CC = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+export CXX = "${CCACHE}${HOST_PREFIX}g++ ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+export FC = "${CCACHE}${HOST_PREFIX}gfortran ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}"
+export CPP = "${HOST_PREFIX}gcc -E${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
+export LD = "${HOST_PREFIX}ld${TOOLCHAIN_OPTIONS} ${HOST_LD_ARCH}"
+export CCLD = "${CC}"
+export AR = "${HOST_PREFIX}ar"
+export AS = "${HOST_PREFIX}as ${HOST_AS_ARCH}"
+export RANLIB = "${HOST_PREFIX}ranlib"
+export STRIP = "${HOST_PREFIX}strip"
+export OBJCOPY = "${HOST_PREFIX}objcopy"
+export OBJDUMP = "${HOST_PREFIX}objdump"
+export STRINGS = "${HOST_PREFIX}strings"
+export NM = "${HOST_PREFIX}nm"
+PYTHON = "${@sys.executable}"
+
+export BUILD_CC = "${CCACHE}${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}"
+export BUILD_CXX = "${CCACHE}${BUILD_PREFIX}g++ ${BUILD_CC_ARCH}"
+export BUILD_FC = "${CCACHE}${BUILD_PREFIX}gfortran ${BUILD_CC_ARCH}"
+export BUILD_CPP = "${BUILD_PREFIX}gcc ${BUILD_CC_ARCH} -E"
+export BUILD_LD = "${BUILD_PREFIX}ld ${BUILD_LD_ARCH}"
+export BUILD_CCLD = "${BUILD_PREFIX}gcc ${BUILD_CC_ARCH}"
+export BUILD_AR = "${BUILD_PREFIX}ar"
+export BUILD_AS = "${BUILD_PREFIX}as ${BUILD_AS_ARCH}"
+export BUILD_RANLIB = "${BUILD_PREFIX}ranlib"
+export BUILD_STRIP = "${BUILD_PREFIX}strip"
+export BUILD_NM = "${BUILD_PREFIX}nm"
+
+export MAKE = "make"
+EXTRA_OEMAKE = "-e MAKEFLAGS="
+EXTRA_OECONF = ""
+export LC_ALL = "C"
+
+##################################################################
+# Patch handling.
+##################################################################
+PATCHTOOL = "quilt"
+PATCHRESOLVE = "noop"
+
+##################################################################
+# Build flags and options.
+##################################################################
+
+export BUILD_CPPFLAGS = "-isystem${STAGING_INCDIR_NATIVE}"
+BUILDSDK_CPPFLAGS = "-isystem${STAGING_INCDIR}"
+export CPPFLAGS = "${TARGET_CPPFLAGS}"
+export TARGET_CPPFLAGS = ""
+#export TARGET_CPPFLAGS = "-isystem${STAGING_DIR_TARGET}${includedir}"
+
+export BUILD_CFLAGS = "${BUILD_CPPFLAGS} ${BUILD_OPTIMIZATION}"
+BUILDSDK_CFLAGS = "${BUILDSDK_CPPFLAGS} ${BUILD_OPTIMIZATION}"
+export CFLAGS = "${TARGET_CFLAGS}"
+export TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION}"
+
+export BUILD_CXXFLAGS = "${BUILD_CFLAGS}"
+export CXXFLAGS = "${TARGET_CXXFLAGS}"
+export TARGET_CXXFLAGS = "${TARGET_CFLAGS}"
+
+export BUILD_LDFLAGS = "-L${STAGING_LIBDIR_NATIVE} \
+                        -L${STAGING_BASE_LIBDIR_NATIVE} \
+                        -Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} \
+                        -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} \
+                        -Wl,-rpath,${STAGING_LIBDIR_NATIVE} \
+                        -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE} \
+                        -Wl,-O1"
+
+BUILDSDK_LDFLAGS = "-L${STAGING_LIBDIR} \
+                    -Wl,-rpath-link,${STAGING_LIBDIR} \
+                    -Wl,-rpath,${libdir} -Wl,-O1 \
+                    -L${STAGING_DIR_HOST}${base_libdir} \
+                    -Wl,-rpath-link,${STAGING_DIR_HOST}${base_libdir} \
+                    -Wl,-rpath,${base_libdir} -Wl,-O1"
+
+LINKER_HASH_STYLE ??= "gnu"
+# mips does not support GNU hash style therefore we override
+LINKER_HASH_STYLE_mips = "sysv"
+LINKER_HASH_STYLE_mipsel = "sysv"
+LINKER_HASH_STYLE_mips64 = "sysv"
+LINKER_HASH_STYLE_mips64el = "sysv"
+LINKER_HASH_STYLE_mips64n32 = "sysv"
+LINKER_HASH_STYLE_mips64eln32 = "sysv"
+TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE', True) != 'gnu']}"
+
+export LDFLAGS = "${TARGET_LDFLAGS}"
+export TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE}"
+#export TARGET_LDFLAGS = "-L${STAGING_DIR_TARGET}${libdir} \
+#                         -Wl,-rpath-link,${STAGING_DIR_TARGET}${libdir} \
+#                         -Wl,-O1"
+
+# Which flags to leave by strip-flags() in bin/build/oebuild.sh ?
+ALLOWED_FLAGS = "-O -mcpu -march -pipe"
+
+# Pass parallel make options to the compile task
+EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
+PARALLEL_MAKEINST ??= "${PARALLEL_MAKE}"
+# Pass parallel make options to the install task
+EXTRA_OEMAKE_prepend_task-install = "${PARALLEL_MAKEINST} "
+
+##################################################################
+# Optimization flags.
+##################################################################
+DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types"
+# Disabled until the option works properly -feliminate-dwarf2-dups
+FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
+DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
+SELECTED_OPTIMIZATION = "${@d.getVar(['FULL_OPTIMIZATION', 'DEBUG_OPTIMIZATION'][d.getVar('DEBUG_BUILD', True) == '1'], True)}"
+SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION"
+BUILD_OPTIMIZATION = "-O2 -pipe"
+
+##################################################################
+# Settings used by bitbake-layers.
+##################################################################
+BBLAYERS_LAYERINDEX_URL ??= "http://layers.openembedded.org/layerindex/"
+BBLAYERS_FETCH_DIR ??= "${COREBASE}"
+
+##################################################################
+# Download locations and utilities.
+##################################################################
+
+APACHE_MIRROR = "http://www.apache.org/dist"
+DEBIAN_MIRROR = "ftp://ftp.debian.org/debian/pool"
+GENTOO_MIRROR = "http://distfiles.gentoo.org/distfiles"
+GNOME_GIT = "git://git.gnome.org"
+GNOME_MIRROR = "http://ftp.gnome.org/pub/GNOME/sources"
+GNU_MIRROR = "http://ftp.gnu.org/gnu"
+GPE_MIRROR = "http://gpe.linuxtogo.org/download/source"
+KERNELORG_MIRROR = "http://kernel.org/pub"
+SOURCEFORGE_MIRROR = "http://downloads.sourceforge.net"
+XLIBS_MIRROR = "http://xlibs.freedesktop.org/release"
+XORG_MIRROR = "http://xorg.freedesktop.org/releases"
+SAVANNAH_GNU_MIRROR = "http://download.savannah.gnu.org/releases"
+SAVANNAH_NONGNU_MIRROR = "http://download.savannah.nongnu.org/releases"
+CPAN_MIRROR = "http://search.cpan.org/CPAN"
+
+SRC_URI[vardepsexclude] += "\
+    APACHE_MIRROR \
+    CPAN_MIRROR \
+    DEBIAN_MIRROR \
+    GENTOO_MIRROR \
+    GNOME_GIT \
+    GNOME_MIRROR \
+    GNU_MIRROR \
+    GPE_MIRROR \
+    KERNELORG_MIRROR \
+    SAVANNAH_GNU_MIRROR \
+    SAVANNAH_NONGNU_MIRROR \
+    SOURCEFORGE_MIRROR \
+    XLIBS_MIRROR \
+    XORG_MIRROR \
+"
+
+# You can use the mirror of your country to get faster downloads by putting
+#  export DEBIAN_MIRROR = "ftp://ftp.de.debian.org/debian/pool"
+#     into your local.conf
+
+FETCHCMD_svn = "/usr/bin/env svn --non-interactive --trust-server-cert"
+FETCHCMD_cvs = "/usr/bin/env cvs"
+FETCHCMD_wget = "/usr/bin/env wget -t 2 -T 30 -nv --passive-ftp --no-check-certificate"
+FETCHCMD_bzr = "/usr/bin/env bzr"
+FETCHCMD_hg = "/usr/bin/env hg"
+
+SRCDATE = "${DATE}"
+SRCREV ??= "INVALID"
+AUTOREV = "${@bb.fetch2.get_autorev(d)}"
+SRCPV = "${@bb.fetch2.get_srcrev(d)}"
+SRCPV[vardepvalue] = "${SRCPV}"
+
+SRC_URI = ""
+
+# Use pseudo as the fakeroot implementation
+PSEUDO_LOCALSTATEDIR ?= "${WORKDIR}/pseudo/"
+PSEUDO_PASSWD ?= "${STAGING_DIR_TARGET}:${STAGING_DIR_NATIVE}"
+export PSEUDO_DISABLED = "1"
+#export PSEUDO_PREFIX = "${STAGING_DIR_NATIVE}${prefix_native}"
+#export PSEUDO_BINDIR = "${STAGING_DIR_NATIVE}${bindir_native}"
+#export PSEUDO_LIBDIR = "${STAGING_DIR_NATIVE}$PSEUDOBINDIR/../lib/pseudo/lib
+FAKEROOTBASEENV = "PSEUDO_BINDIR=${STAGING_BINDIR_NATIVE} PSEUDO_LIBDIR=${STAGING_BINDIR_NATIVE}/../lib/pseudo/lib PSEUDO_PREFIX=${STAGING_BINDIR_NATIVE}/../../ PSEUDO_DISABLED=1"
+FAKEROOTCMD = "${STAGING_BINDIR_NATIVE}/pseudo"
+FAKEROOTENV = "PSEUDO_PREFIX=${STAGING_DIR_NATIVE}${prefix_native} PSEUDO_LOCALSTATEDIR=${PSEUDO_LOCALSTATEDIR} PSEUDO_PASSWD=${PSEUDO_PASSWD} PSEUDO_NOSYMLINKEXP=1 PSEUDO_DISABLED=0"
+FAKEROOTNOENV = "PSEUDO_UNLOAD=1"
+FAKEROOTDIRS = "${PSEUDO_LOCALSTATEDIR}"
+PREFERRED_PROVIDER_virtual/fakeroot-native ?= "pseudo-native"
+
+##################################################################
+# Miscellaneous utilities.
+##################################################################
+
+# GNU patch tries to be intellgent about checking out read-only files from
+# a RCS, which freaks out those special folks with active Perforce clients
+# the following makes patch ignore RCS:
+
+export PATCH_GET="0"
+
+##################################################################
+# Not sure about the rest of this yet.
+##################################################################
+
+# Pre-build configuration output
+BUILDCFG_HEADER = "Build Configuration:"
+BUILDCFG_VARS = "BB_VERSION BUILD_SYS NATIVELSBSTRING TARGET_SYS MACHINE DISTRO DISTRO_VERSION TUNE_FEATURES TARGET_FPU"
+BUILDCFG_VARS[type] = "list"
+BUILDCFG_NEEDEDVARS = "TARGET_ARCH TARGET_OS"
+BUILDCFG_NEEDEDVARS[type] = "list"
+
+# Other
+
+export PKG_CONFIG_DIR = "${STAGING_DIR_HOST}${libdir}/pkgconfig"
+export PKG_CONFIG_PATH = "${PKG_CONFIG_DIR}:${STAGING_DATADIR}/pkgconfig"
+export PKG_CONFIG_LIBDIR = "${PKG_CONFIG_DIR}"
+export PKG_CONFIG_SYSROOT_DIR = "${STAGING_DIR_HOST}"
+export PKG_CONFIG_DISABLE_UNINSTALLED = "yes"
+
+###
+### Config file processing
+###
+
+# An empty distro leads to :: entries in OVERRIDES and FILEOVERRIDES which
+# is a bad idea. Setting a dummy value is better than a ton of anonymous python.
+DISTRO ??= "nodistro"
+DISTRO_NAME ??= "OpenEmbedded"
+# Overrides are processed left to right, so the ones that are named later take precedence.
+# You generally want them to go from least to most specific.
+#
+# This means that an envionment variable named '<foo>_arm' overrides an
+# environment variable '<foo>' (when ${TARGET_ARCH} is arm).
+# An environment variable '<foo>_qemuarm' overrides '<foo>' and overrides
+# '<foo>_arm' when ${MACHINE} is 'qemuarm'.
+# If you use combination ie '<foo>_qemuarm_arm', then '<foo>_qemuarm_arm' will override
+# '<foo>_qemuarm' and then '<foo>' will be overriden with that value from '<foo>_qemuarm'.
+# And finally '<foo>_forcevariable' overrides any standard variable, with the highest priority.
+#
+# This works for  functions as well, they are really just environment variables.
+# Default OVERRIDES to make compilation fail fast in case of build system misconfiguration.
+OVERRIDES = "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:build-${BUILD_OS}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}:forcevariable"
+OVERRIDES[vardepsexclude] = "MACHINEOVERRIDES"
+CLASSOVERRIDE ?= "class-target"
+DISTROOVERRIDES ?= "${@d.getVar('DISTRO', True) or ''}"
+MACHINEOVERRIDES ?= "${MACHINE}"
+MACHINEOVERRIDES[vardepsexclude] = "MACHINE"
+
+FILESOVERRIDES = "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
+
+##################################################################
+# Include the rest of the config files.
+##################################################################
+
+require conf/abi_version.conf
+include conf/site.conf
+include conf/auto.conf
+include conf/local.conf
+include conf/build/${BUILD_SYS}.conf
+include conf/target/${TARGET_SYS}.conf
+include conf/machine/${MACHINE}.conf
+include conf/machine-sdk/${SDKMACHINE}.conf
+include conf/distro/${DISTRO}.conf
+include conf/distro/defaultsetup.conf
+include conf/documentation.conf
+include conf/licenses.conf
+require conf/sanity.conf
+
+##################################################################
+# Weak variables (usually to retain backwards compatibility)
+##################################################################
+
+DL_DIR ?= "${TOPDIR}/downloads"
+SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
+IMAGE_FSTYPES ?= "tar.gz"
+INITRAMFS_FSTYPES ?= "cpio.gz"
+DEFAULT_TASK_PROVIDER ?= "packagegroup-base"
+MACHINE_TASK_PROVIDER ?= "${DEFAULT_TASK_PROVIDER}"
+
+# The size in Kbytes for the generated image if it is larger than
+# the required size (du -ks IMAGE_ROOTFS * IMAGE_OVERHEAD_FACTOR),
+# and no effect if less than it.
+IMAGE_ROOTFS_SIZE ??= "65536"
+
+# Forcefully set CACHE now so future changes to things like
+# MACHINE don't change the path to the cache
+CACHE := "${CACHE}"
+
+# Default to setting automatically based on cpu count
+BB_NUMBER_THREADS ?= "${@oe.utils.cpu_count()}"
+
+# Default to setting automatically based on cpu count
+PARALLEL_MAKE ?= "-j ${@oe.utils.cpu_count()}"
+
+##################################################################
+# Magic Cookie for SANITY CHECK
+##################################################################
+OES_BITBAKE_CONF = "1"
+
+##################################################################
+# Machine properties and packagegroup-base stuff
+##################################################################
+
+MACHINE_FEATURES ?= ""
+DISTRO_FEATURES ?= ""
+
+DISTRO_EXTRA_RDEPENDS ?= ""
+DISTRO_EXTRA_RRECOMMENDS ?= ""
+MACHINE_EXTRA_RDEPENDS ?= ""
+MACHINE_EXTRA_RRECOMMENDS ?= ""
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
+
+EXTRA_IMAGE_FEATURES ??= ""
+IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
+
+DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5"
+MACHINE_FEATURES_BACKFILL = "rtc"
+
+COMBINED_FEATURES = "${@oe.utils.set_intersect('DISTRO_FEATURES', 'MACHINE_FEATURES', d)}"
+COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES"
+
+SERIAL_CONSOLE ??= ""
+SERIAL_CONSOLES ??= "${@d.getVar('SERIAL_CONSOLE', True).replace(' ', ';')}"
+
+NO_RECOMMENDATIONS ?= ""
+BAD_RECOMMENDATIONS ?= ""
+
+# Make sure MACHINE isn't exported
+# (breaks binutils at least)
+MACHINE[unexport] = "1"
+
+# Make sure TARGET_ARCH isn't exported
+# (breaks Makefiles using implicit rules, e.g. quilt, as GNU make has this
+# in them, undocumented)
+TARGET_ARCH[unexport] = "1"
+
+# Make sure DISTRO isn't exported
+# (breaks sysvinit at least)
+DISTRO[unexport] = "1"
+
+# Make sure SHELL isn't exported
+# (can break any number of things if the user's shell isn't POSIX-compliant,
+# including the flock command). The user's shell shouldn't affect our builds.
+SHELL[unexport] = "1"
+
+# Used by canadian-cross to handle string conversions on TARGET_ARCH where needed
+TRANSLATED_TARGET_ARCH ??= "${@d.getVar('TARGET_ARCH', True).replace("_", "-")}"
+
+# Complete output from bitbake
+BB_CONSOLELOG ?= "${LOG_DIR}/cooker/${MACHINE}/${DATETIME}.log"
+
+# Setup our default hash policy
+BB_SIGNATURE_HANDLER ?= "OEBasicHash"
+BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR \
+    SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM \
+    USER FILESPATH STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE PRSERV_HOST \
+    PRSERV_DUMPDIR PRSERV_DUMPFILE PRSERV_LOCKDOWN PARALLEL_MAKE \
+    CCACHE_DIR EXTERNAL_TOOLCHAIN CCACHE CCACHE_DISABLE LICENSE_PATH SDKPKGSUFFIX \
+    WARN_QA ERROR_QA WORKDIR STAMPCLEAN PKGDATA_DIR BUILD_ARCH SSTATE_PKGARCH"
+BB_HASHCONFIG_WHITELIST ?= "${BB_HASHBASE_WHITELIST} DATE TIME SSH_AGENT_PID \
+    SSH_AUTH_SOCK PSEUDO_BUILD BB_ENV_EXTRAWHITE DISABLE_SANITY_CHECKS \
+    PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED"
+BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
+    lockfiles type vardepsexclude vardeps vardepvalue vardepvalueexclude \
+    file-checksums python func task export unexport noexec nostamp dirs cleandirs \
+    sstate-lockfile-shared prefuncs postfuncs export_func deptask rdeptask \
+    recrdeptask nodeprrecs stamp-base stamp-extra-info"
+
+MLPREFIX ??= ""
+MULTILIB_VARIANTS ??= ""
diff --git a/meta/conf/conf-notes.txt b/meta/conf/conf-notes.txt
new file mode 100644
index 0000000..66e6319
--- /dev/null
+++ b/meta/conf/conf-notes.txt
@@ -0,0 +1,8 @@
+Common targets are:
+    core-image-minimal
+    core-image-sato
+    meta-toolchain
+    adt-installer
+    meta-ide-support
+
+You can also run generated qemu images with a command like 'runqemu qemux86'
diff --git a/meta/conf/distro/defaultsetup.conf b/meta/conf/distro/defaultsetup.conf
new file mode 100644
index 0000000..71c65b1
--- /dev/null
+++ b/meta/conf/distro/defaultsetup.conf
@@ -0,0 +1,23 @@
+include conf/distro/include/default-providers.inc
+include conf/distro/include/default-versions.inc
+include conf/distro/include/default-distrovars.inc
+include conf/distro/include/world-broken.inc
+
+TCMODE ?= "default"
+require conf/distro/include/tcmode-${TCMODE}.inc
+
+TCLIBC ?= "glibc"
+require conf/distro/include/tclibc-${TCLIBC}.inc
+
+# Allow single libc distros to disable this code
+TCLIBCAPPEND ?= "-${TCLIBC}"
+TMPDIR .= "${TCLIBCAPPEND}"
+
+CACHE = "${TMPDIR}/cache/${TCMODE}-${TCLIBC}${@['', '/' + str(d.getVar('MACHINE', True))][bool(d.getVar('MACHINE', True))]}${@['', '/' + str(d.getVar('SDKMACHINE', True))][bool(d.getVar('SDKMACHINE', True))]}"
+
+USER_CLASSES ?= ""
+PACKAGE_CLASSES ?= "package_ipk"
+INHERIT_BLACKLIST = "blacklist"
+INHERIT_DISTRO ?= "debian devshell sstate license"
+INHERIT += "${PACKAGE_CLASSES} ${USER_CLASSES} ${INHERIT_DISTRO} ${INHERIT_BLACKLIST}"
+
diff --git a/meta/conf/distro/include/as-needed.inc b/meta/conf/distro/include/as-needed.inc
new file mode 100644
index 0000000..4f249fd
--- /dev/null
+++ b/meta/conf/distro/include/as-needed.inc
@@ -0,0 +1,17 @@
+
+ASNEEDED = "-Wl,--as-needed"
+
+ASNEEDED_pn-babeltrace = ""
+ASNEEDED_pn-console-tools = ""
+ASNEEDED_pn-distcc = ""
+ASNEEDED_pn-openobex = ""
+ASNEEDED_pn-icu = ""
+ASNEEDED_pn-xserver-kdrive-xomap = ""
+ASNEEDED_pn-minimo = ""
+ASNEEDED_pn-pciutils = ""
+ASNEEDED_pn-puzzles = ""
+ASNEEDED_pn-dialer = ""
+ASNEEDED_pn-pulseaudio = ""
+ASNEEDED_pn-rpm = ""
+
+TARGET_LDFLAGS += "${ASNEEDED}"
diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc
new file mode 100644
index 0000000..29b762b
--- /dev/null
+++ b/meta/conf/distro/include/default-distrovars.inc
@@ -0,0 +1,49 @@
+QA_LOGFILE = "${TMPDIR}/qa.log"
+
+OEINCLUDELOGS ?= "yes"
+KERNEL_CONSOLE ?= "ttyS0"
+KEEPUIMAGE ??= "yes"
+
+IMAGE_LINGUAS ?= "en-us en-gb"
+ENABLE_BINARY_LOCALE_GENERATION ?= "1"
+LOCALE_UTF8_ONLY ?= "0"
+
+DISTRO_FEATURES_DEFAULT ?= "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11"
+DISTRO_FEATURES_LIBC_DEFAULT ?= "ipv4 ipv6 libc-backtrace libc-big-macros libc-bsd libc-cxx-tests libc-catgets libc-charsets libc-crypt \
+					libc-crypt-ufc libc-db-aliases libc-envz libc-fcvt libc-fmtmsg libc-fstab libc-ftraverse \
+					libc-getlogin libc-idn libc-inet-anl libc-libm libc-locales libc-locale-code \
+					libc-memusage libc-nis libc-nsswitch libc-rcmd libc-rtld-debug libc-spawn libc-streams libc-sunrpc \
+					libc-utmp libc-utmpx libc-wordexp libc-posix-clang-wchar libc-posix-regexp libc-posix-regexp-glibc \
+					libc-posix-wchar-io"
+DISTRO_FEATURES_LIBC ?= "${DISTRO_FEATURES_LIBC_DEFAULT}"
+DISTRO_FEATURES_LIBC_class-nativesdk = "${DISTRO_FEATURES_LIBC_DEFAULT}"
+DISTRO_FEATURES ?= "${DISTRO_FEATURES_DEFAULT} ${DISTRO_FEATURES_LIBC}"
+
+IMAGE_FEATURES ?= ""
+
+# This is a list of packages that are used by the build system to build the distribution, they are not
+# directly part of the distribution. 
+HOSTTOOLS_WHITELIST_GPL-3.0 ?= ""
+WHITELIST_GPL-3.0 ?= "less"
+LGPLv2_WHITELIST_GPL-3.0 ?= "libassuan gnutls libtasn1 libidn"
+
+COMMERCIAL_AUDIO_PLUGINS ?= ""
+# COMMERCIAL_AUDIO_PLUGINS ?= "gst-plugins-ugly-mad gst-plugins-ugly-mpegaudioparse"
+COMMERCIAL_VIDEO_PLUGINS ?= ""
+# COMMERCIAL_VIDEO_PLUGINS ?= "gst-plugins-ugly-mpeg2dec gst-plugins-ugly-mpegstream gst-plugins-bad-mpegvideoparse"
+COMMERCIAL_QT ?= ""
+# COMMERCIAL_QT ?= "qmmp"
+# Set of common licenses used for license.bbclass
+COMMON_LICENSE_DIR ??= "${COREBASE}/meta/files/common-licenses"
+
+BB_GENERATE_MIRROR_TARBALLS ??= "0"
+
+NO32LIBS ??= "1"
+
+# Default to emitting logfiles if a build fails.
+BBINCLUDELOGS ??= "yes"
+SDK_VERSION ??= "nodistro.0"
+DISTRO_VERSION ??= "nodistro.0"
+
+# Missing checksums should raise an error
+BB_STRICT_CHECKSUM = "1"
diff --git a/meta/conf/distro/include/default-providers.inc b/meta/conf/distro/include/default-providers.inc
new file mode 100644
index 0000000..9f84d5c
--- /dev/null
+++ b/meta/conf/distro/include/default-providers.inc
@@ -0,0 +1,51 @@
+#
+# Default virtual providers
+#
+PREFERRED_PROVIDER_virtual/db ?= "db"
+PREFERRED_PROVIDER_virtual/db-native ?= "db-native"
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/xserver-xf86 ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/egl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
+PREFERRED_PROVIDER_virtual/mesa ?= "mesa"
+PREFERRED_PROVIDER_virtual/update-alternatives ?= "opkg-utils"
+PREFERRED_PROVIDER_virtual/update-alternatives-native ?= "opkg-utils-native"
+PREFERRED_PROVIDER_virtual/libx11 ?= "libx11"
+PREFERRED_PROVIDER_xf86-video-intel ?= "xf86-video-intel"
+
+#
+# Default virtual runtime providers
+#
+VIRTUAL-RUNTIME_update-alternatives ?= "update-alternatives-opkg"
+VIRTUAL-RUNTIME_apm ?= "apm"
+VIRTUAL-RUNTIME_alsa-state ?= "alsa-state"
+VIRTUAL-RUNTIME_getopt ?= "util-linux-getopt"
+VIRTUAL-RUNTIME_wireless-tools ?= "iw wireless-tools"
+
+#
+# Default recipe providers
+#
+PREFERRED_PROVIDER_dbus-glib ?= "dbus-glib"
+PREFERRED_PROVIDER_dbus-glib-native ?= "dbus-glib-native"
+PREFERRED_PROVIDER_gdk-pixbuf ?= "gdk-pixbuf"
+PREFERRED_PROVIDER_libgcc ?= "libgcc"
+PREFERRED_PROVIDER_nativesdk-libgcc ?= "nativesdk-libgcc"
+PREFERRED_PROVIDER_linux-libc-headers ?= "linux-libc-headers"
+PREFERRED_PROVIDER_nativesdk-linux-libc-headers ?= "nativesdk-linux-libc-headers"
+PREFERRED_PROVIDER_matchbox-panel ?= "matchbox-panel-2"
+PREFERRED_PROVIDER_opkg ?= "opkg"
+PREFERRED_PROVIDER_opkg-native ?= "opkg-native"
+PREFERRED_PROVIDER_nativesdk-opkg ?= "nativesdk-opkg"
+PREFERRED_PROVIDER_console-tools ?= "kbd"
+PREFERRED_PROVIDER_gzip-native ?= "pigz-native"
+PREFERRED_PROVIDER_make ?= "make"
+PREFERRED_PROVIDER_udev ?= "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','udev',d)}"
+# There are issues with runtime packages and PREFERRED_PROVIDER, see YOCTO #5044 for details
+# on this rather strange entry.
+PREFERRED_PROVIDER_bluez4 ?= "${@bb.utils.contains('DISTRO_FEATURES','bluetooth bluez5','bluez5','bluez4',d)}"
+PREFERRED_PROVIDER_bluez-hcidump ?= "${@bb.utils.contains('DISTRO_FEATURES','bluetooth bluez5','bluez5','bluez-hcidump',d)}"
+# Alternative is ltp-ddt in meta-oe: meta-oe/recipes-devtools/ltp-ddt/ltp-ddt_0.0.4.bb
+PREFERRED_PROVIDER_ltp ?= "ltp"
+PREFERRED_PROVIDER_getopt ?= "util-linux-getopt"
diff --git a/meta/conf/distro/include/default-versions.inc b/meta/conf/distro/include/default-versions.inc
new file mode 100644
index 0000000..573063e
--- /dev/null
+++ b/meta/conf/distro/include/default-versions.inc
@@ -0,0 +1,15 @@
+#
+# Default preferred versions
+#
+
+# Force the python versions in one place
+PYTHON_BASEVERSION ?= "2.7"
+PREFERRED_VERSION_python ?= "2.7.9"
+PREFERRED_VERSION_python-native ?= "2.7.9"
+
+# Force the older version of liberation-fonts until we fix the fontforge issue
+PREFERRED_VERSION_liberation-fonts ?= "1.04"
+
+# Force db-native's version to keep sync with db while
+# 'AGPL-3.0' in ${INCOMPATIBLE_LICENSE} blacklist
+PREFERRED_VERSION_db-native = "${@incompatible_license_contains('AGPL-3.0', '5.%', '6.%', d)}"
diff --git a/meta/conf/distro/include/distro_alias.inc b/meta/conf/distro/include/distro_alias.inc
new file mode 100644
index 0000000..bd3da9c
--- /dev/null
+++ b/meta/conf/distro/include/distro_alias.inc
@@ -0,0 +1,536 @@
+#
+# This is a list for tracking status of package relative to Major
+# distributions such as Fedora, Ubuntu, Debian, ... The package
+# name is the major distribution equivalent to the name used in oe-core
+#
+# The format is as a bitbake variable override for each recipe
+#
+#       DISTRO_PN_ALIAS_pn-<recipe name> = "Distro1=<pkgname> Distro2=<pkgname>"
+#
+# Please keep this list in alphabetical order.
+#
+DISTRO_PN_ALIAS_pn-aaina = "Intel"
+DISTRO_PN_ALIAS_pn-abiword-embedded = "Fedora=abiword Ubuntu=abiword"
+DISTRO_PN_ALIAS_pn-adt-installer = "Intel"
+DISTRO_PN_ALIAS_pn-alsa-state = "OE-Core"
+DISTRO_PN_ALIAS_pn-alsa-utils-alsaconf = "OE-Core"
+DISTRO_PN_ALIAS_pn-atk = "Fedora=atk OpenSuSE=atk"
+DISTRO_PN_ALIAS_pn-augeas = "Ubuntu=libaugeas0 Debian=libaugeas0"
+DISTRO_PN_ALIAS_pn-avahi-ui = "Ubuntu=avahi-discover Debian=avahi-discover"
+DISTRO_PN_ALIAS_pn-babeltrace = "OSPDT"
+DISTRO_PN_ALIAS_pn-bdwgc = "OSPDT"
+DISTRO_PN_ALIAS_pn-bigreqsproto = "Meego=xorg-x11-proto-bigreqsproto"
+DISTRO_PN_ALIAS_pn-bjam = "OpenSuSE=boost-jam Debina=bjam"
+DISTRO_PN_ALIAS_pn-blktool = "Debian=blktool Mandriva=blktool"
+DISTRO_PN_ALIAS_pn-bluez4 = "Ubuntu=bluez Debian=bluez-utils"
+DISTRO_PN_ALIAS_pn-bluez5 = "Fedora=bluez  Opensuse=bluez"
+DISTRO_PN_ALIAS_pn-bluez-dtl1-workaround = "OE-Core"
+DISTRO_PN_ALIAS_pn-bootchart2 = "Fedora=bootchart2 Opensuse=bootchart"
+DISTRO_PN_ALIAS_pn-btrfs-tools = "Debian=btrfs-tools Fedora=btrfs-progs"
+DISTRO_PN_ALIAS_pn-build-appliance-image = "OSPDT"
+DISTRO_PN_ALIAS_pn-build-compare = "Opensuse=build-compare Fedora=build-compare"
+DISTRO_PN_ALIAS_pn-builder = "OE-Core"
+DISTRO_PN_ALIAS_pn-buildtools-tarball = "OE-Core"
+DISTRO_PN_ALIAS_pn-calibrateproto = "OSPDT upstream=http://cgit.freedesktop.org/xorg/proto/calibrateproto"
+DISTRO_PN_ALIAS_pn-cdrtools = "OpenSUSE=cdrtools OSPDT"
+DISTRO_PN_ALIAS_pn-chkconfig-alternatives = "Mandriva=chkconfig Debian=chkconfig"
+DISTRO_PN_ALIAS_pn-claws-plugin-gtkhtml2-viewer = "Fedora=claws-mail-plugins OpenSuSE=claws-mail-extra-plugins Debian=claws-mail-extra-plugins"
+DISTRO_PN_ALIAS_pn-claws-plugin-maildir = "Fedora=claws-mail-plugins OpenSuSE=claws-mail-extra-plugins Debian=claws-mail-extra-plugins"
+DISTRO_PN_ALIAS_pn-claws-plugin-mailmbox = "Fedora=claws-mail-plugins OpenSuSE=claws-mail-extra-plugins Debian=claws-mail-extra-plugins"
+DISTRO_PN_ALIAS_pn-claws-plugin-rssyl = "Fedora=claws-mail-plugins OpenSuSE=claws-mail-extra-plugins Debian=claws-mail-extra-plugins"
+DISTRO_PN_ALIAS_pn-clipboard-manager = "OpenedHand"
+DISTRO_PN_ALIAS_pn-clutter = "Fedora=clutter OpenSuse=clutter Ubuntu=clutter-1.0 Mandriva=clutter Debian=clutter"
+DISTRO_PN_ALIAS_pn-clutter-1.8 = "Fedora=clutter OpenSuse=clutter Ubuntu=clutter-1.0 Mandriva=clutter Debian=clutter"
+DISTRO_PN_ALIAS_pn-clutter-gst-1.0 = "Debian=clutter-gst Ubuntu=clutter-gst Fedora=clutter-gst"
+DISTRO_PN_ALIAS_pn-clutter-gst-1.8 = "Fedora=clutter-gst Debian=libclutter-gst"
+DISTRO_PN_ALIAS_pn-clutter-gtk-1.0 = "Debian=clutter-gtk Ubuntu=clutter-gtk Fedora=clutter-gtk"
+DISTRO_PN_ALIAS_pn-clutter-gtk-1.8 = "Fedora=clutter-gtk OpenSuSE=clutter-gtk Ubuntu=clutter-gtk-0.10 Mandriva=clutter-gtk Debian=clutter-gtk"
+DISTRO_PN_ALIAS_pn-cogl-1.0 = "Debian=cogl Ubuntu=cogl Fedora=cogl"
+DISTRO_PN_ALIAS_pn-cogl = "Fedora=cogl OpenSuse=cogl Ubuntu=cogl Mandriva=cogl Debian=cogl"
+DISTRO_PN_ALIAS_pn-compositeproto = "Meego=xorg-x11-proto-compositeproto"
+DISTRO_PN_ALIAS_pn-connman = "Meego=connman"
+DISTRO_PN_ALIAS_pn-connman-conf = "OE-Core"
+DISTRO_PN_ALIAS_pn-connman-gnome = "Intel"
+DISTRO_PN_ALIAS_pn-console-tools = "Debian=console-tools Ubuntu=console-tools"
+DISTRO_PN_ALIAS_pn-core-image-base = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-clutter = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-directfb = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-full-cmdline = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-kernel-dev = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-lsb = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-lsb-dev = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-lsb-qt3 = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-lsb-sdk = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-minimal = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-minimal-dev = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-minimal-initramfs = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-minimal-mtdutils = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-rt = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-rt-sdk = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-sato = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-sato-dev = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-sato-sdk = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-testmaster = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-testmaster-initramfs = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-weston = "OE-Core"
+DISTRO_PN_ALIAS_pn-core-image-x11 = "OE-Core"
+DISTRO_PN_ALIAS_pn-cross-localedef = "OSPDT"
+DISTRO_PN_ALIAS_pn-cryptodev-linux = "OE-Core"
+DISTRO_PN_ALIAS_pn-cryptodev-module = "OE-Core"
+DISTRO_PN_ALIAS_pn-cryptodev-tests = "OE-Core"
+DISTRO_PN_ALIAS_pn-cwautomacros = "OSPDT upstream=http://cwautomacros.berlios.de/"
+DISTRO_PN_ALIAS_pn-damageproto = "Meego=xorg-x11-proto-damageproto"
+DISTRO_PN_ALIAS_pn-db = "Debian=db5.1 Ubuntu=db5.1"
+DISTRO_PN_ALIAS_pn-dbus-ptest = "Fedora=dbus Ubuntu=dbus"
+DISTRO_PN_ALIAS_pn-dbus-test = "Fedora=dbus Ubuntu=dbus"
+DISTRO_PN_ALIAS_pn-dbus-wait = "OpenedHand"
+DISTRO_PN_ALIAS_pn-depmodwrapper-cross = "OE-Core"
+DISTRO_PN_ALIAS_pn-directfb-examples = "Debian=directfb Fedora=directfb"
+DISTRO_PN_ALIAS_pn-distcc = "Debian=distcc Fedora=distcc"
+DISTRO_PN_ALIAS_pn-distcc-config = "OpenedHand"
+DISTRO_PN_ALIAS_pn-dmxproto = "Meego=xorg-x11-proto-dmxproto Ubuntu=x11proto-dmx Debian=x11proto-dmx"
+DISTRO_PN_ALIAS_pn-docbook-dsssl-stylesheets = "Fedora=docbook-style-dsssl Ubuntu=docbook-dsssl"
+DISTRO_PN_ALIAS_pn-docbook-sgml-dtd-3.1 = "Fedora=docbook-dtds Mandriva=docbook-dtd31-sgml"
+DISTRO_PN_ALIAS_pn-docbook-sgml-dtd-4.1 = "Fedora=docbook-dtds Mandriva=docbook-dtd41-sgml"
+DISTRO_PN_ALIAS_pn-docbook-sgml-dtd-4.5 = "Fedora=docbook-dtds Mandriva=docbook-dtd42-sgml"
+DISTRO_PN_ALIAS_pn-docbook-xml-dtd4 = "Ubuntu=docbook-xml Fedora=docbook-dtds"
+DISTRO_PN_ALIAS_pn-docbook-xml-dtd4-native = "Ubuntu=docbook-xml Fedora=docbook-dtds"
+DISTRO_PN_ALIAS_pn-docbook-xsl-stylesheets = "Fedora=docbook-xsl-stylesheets Opensuse=docbook-xsl-stylesheets"
+DISTRO_PN_ALIAS_pn-dri2proto = "Meego=xorg-x11-proto-dri2proto"
+DISTRO_PN_ALIAS_pn-dri3proto = "Fedora=dri3proto Opensuse=dri3proto-devel"
+DISTRO_PN_ALIAS_pn-dropbear = "Debian=dropbear Ubuntu=dropbear"
+DISTRO_PN_ALIAS_pn-dtc = "Fedora=dtc Ubuntu=dtc"
+DISTRO_PN_ALIAS_pn-eds-tools = "OpenedHand"
+DISTRO_PN_ALIAS_pn-eee-acpi-scripts = "Debian=eeepc-acpi-scripts Ubuntu=eeepc-acpi-scripts"
+DISTRO_PN_ALIAS_pn-eglibc = "OE-Core"
+DISTRO_PN_ALIAS_pn-eglibc-initial = "OE-Core"
+DISTRO_PN_ALIAS_pn-eglibc-locale = "OE-Core"
+DISTRO_PN_ALIAS_pn-eglibc-mtrace = "OE-Core"
+DISTRO_PN_ALIAS_pn-eglibc-scripts = "OE-Core"
+DISTRO_PN_ALIAS_pn-eglinfo-fb = "OE-Core"
+DISTRO_PN_ALIAS_pn-eglinfo-x11 = "OE-Core"
+DISTRO_PN_ALIAS_pn-emgd-driver-bin = "Intel"
+DISTRO_PN_ALIAS_pn-encodings = "Ubuntu=xfonts-encodings Mandriva=x11-font-encodings Debian=xfonts-encodings"
+DISTRO_PN_ALIAS_pn-evieext = "Meego=xorg-x11-proto-evieext Debian=x11proto-evie"
+DISTRO_PN_ALIAS_pn-fixesproto = "Meego=xorg-x11-proto-fixesproto"
+DISTRO_PN_ALIAS_pn-font-alias = "Fedora=xorg-x11-fonts-base Mandriva=x11-font-alias Meego=xorg-x11-fonts"
+DISTRO_PN_ALIAS_pn-fontcacheproto = "Meego=xorg-x11-proto-fontcacheproto"
+DISTRO_PN_ALIAS_pn-fontsproto = "Meego=xorg-x11-proto-fontsproto"
+DISTRO_PN_ALIAS_pn-font-util = "Meego=xorg-x11-font-utils Fedora=xorg-x11-font-utils Ubuntu=xfonts-utils Mandriva=x11-font-util Debian=xfonts-utils"
+DISTRO_PN_ALIAS_pn-formfactor = "OE-Core"
+DISTRO_PN_ALIAS_pn-fotowall = "Fedora=fotowall Ubuntu=fotowall"
+DISTRO_PN_ALIAS_pn-fstests = "OpenedHand"
+DISTRO_PN_ALIAS_pn-gail = "Fedora=gail Ubuntu=libgail-3-0"
+DISTRO_PN_ALIAS_pn-gaku = "OpenedHand"
+DISTRO_PN_ALIAS_pn-galago-daemon = "Debian=galago-daemon Ubuntu=galago-daemon"
+DISTRO_PN_ALIAS_pn-gcc-cross-initial = "OE-Core"
+DISTRO_PN_ALIAS_pn-gcc-cross-initial-i586 = "OE-Core"
+DISTRO_PN_ALIAS_pn-gcc-crosssdk-initial = "OE-Core"
+DISTRO_PN_ALIAS_pn-gcc-crosssdk-initial-x86_64 = "OE-Core"
+DISTRO_PN_ALIAS_pn-gccmakedep = "Mandriva=gccmakedep Ubuntu=xutils-dev"
+DISTRO_PN_ALIAS_pn-gcc-runtime = "Ubuntu=gcc Fedora=gcc"
+DISTRO_PN_ALIAS_pn-gcc-sanitizers = "Ubuntu=gcc Fedora=gcc"
+DISTRO_PN_ALIAS_pn-gcc-source = "Ubuntu=gcc Fedora=gcc"
+DISTRO_PN_ALIAS_pn-gconf-dbus = "Meego=GConf-dbus"
+DISTRO_PN_ALIAS_pn-gdk-pixbuf = "Debian=libgdk-pixbuf2.0 Fedora=gdk-pixbuf"
+DISTRO_PN_ALIAS_pn-gdk-pixbuf-csource = "Debian=libgdk-pixbuf2.0-0 Fedora=gdk-pixbuf2"
+DISTRO_PN_ALIAS_pn-gettext-minimal = "Debian=gettext Fedora=gettext"
+DISTRO_PN_ALIAS_pn-glib-2.0 = "Meego=glib2 Fedora=glib2 OpenSuSE=glib2 Ubuntu=glib2.0 Mandriva=glib2.0 Debian=glib2.0"
+DISTRO_PN_ALIAS_pn-glibc-locale = "OpenSuSE=glibc-locale Fedora=glibc-devel"
+DISTRO_PN_ALIAS_pn-glibc-mtrace = "Fedora=glibc-utils Ubuntu=libc-dev-bin"
+DISTRO_PN_ALIAS_pn-glibc-scripts = "Fedora=glibc Ubuntu=libc-bin"
+DISTRO_PN_ALIAS_pn-glproto = "Meego=xorg-x11-proto-glproto"
+DISTRO_PN_ALIAS_pn-gnome-desktop-testing = "Debian=gnome-desktop-testing Fedora=gnome-desktop-testing"
+DISTRO_PN_ALIAS_pn-gnu-config = "OpenedHand"
+DISTRO_PN_ALIAS_pn-gptfdisk = "Fedora=gdisk Ubuntu=gdisk"
+DISTRO_PN_ALIAS_pn-grub-efi = "Debian=grub-efi Fedora=grub2-efi"
+DISTRO_PN_ALIAS_pn-grub-efi-i586 = "Debian=grub-efi Fedora=grub2-efi"
+DISTRO_PN_ALIAS_pn-grub-efi-x86-64 = "Debian=grub-efi Fedora=grub2-efi"
+DISTRO_PN_ALIAS_pn-gst-player = "Ubuntu=gst-player Fedora=gstreamer-player"
+DISTRO_PN_ALIAS_pn-gst-plugin-bluetooth = "Ubuntu=libgstreamer-plugins-base Fedora=gstreamer-plugins-base"
+DISTRO_PN_ALIAS_pn-gstreamer1.0 = "Debian=gstreamer1.0 Ubuntu=gstreamer1.0"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-meta-base = "Meego=gstreamer Fedora=gstreamer OpenSuSE=gstreamer Ubuntu=gstreamer0.10"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-plugins-bad = "Debian=gstreamer1.0-plugins-bad Ubuntu=gstreamer1.0-plugins-bad"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-plugins-base = "Debian=gstreamer1.0-plugins-base Ubuntu=gstreamer1.0-plugins-base"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-plugins-good = "Debian=gstreamer1.0-plugins-good Ubuntu=gstreamer1.0-plugins-bad"
+DISTRO_PN_ALIAS_pn-gstreamer1.0-rtsp-server = "Ubuntu=gstreamer0.10-rtsp Fedora=gstreamer-rtsp"
+DISTRO_PN_ALIAS_pn-gtk+ = "Meego=gtk2 Fedora=gtk2 OpenSuSE=gtk2 Ubuntu=gtk+2.0 Mandriva=gtk+2.0 Debian=gtk+2.0"
+DISTRO_PN_ALIAS_pn-gtk+3 = "Ubuntu=gtk+3.0 Debian=gtk+3.0 Fedora=gtk3"
+DISTRO_PN_ALIAS_pn-gtk-doc-stub = "Fedora=gtk-doc Ubuntu=gtk-doc"
+DISTRO_PN_ALIAS_pn-gtk-engines = "Fedora=gtk2-engines OpenSuSE=gtk2-engines Ubuntu=gtk2-engines Mandriva=gtk-engines2 Debian=gtk2-engines"
+DISTRO_PN_ALIAS_pn-gtk-sato-engine = "OpenedHand"
+DISTRO_PN_ALIAS_pn-gtk-theme-torturer = "OSPDT upstream=http://wiki.laptop.org/go/GTK_for_OLPC"
+DISTRO_PN_ALIAS_pn-gtk-icon-utils-native = "OSPDT"
+DISTRO_PN_ALIAS_pn-gummiboot = "Debian=gummiboot Fedora=gummiboot"
+DISTRO_PN_ALIAS_pn-hello-mod = "OE-Core"
+DISTRO_PN_ALIAS_pn-hostap-conf = "OE-Core"
+DISTRO_PN_ALIAS_pn-hwlatdetect = "OSPDT"
+DISTRO_PN_ALIAS_pn-icecc-create-env = "OE-Core"
+DISTRO_PN_ALIAS_pn-init-ifupdown = "Debian=ifupdown Ubuntu=ifupdown"
+DISTRO_PN_ALIAS_pn-initramfs-boot = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-framework = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-live-boot = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-live-install = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-live-install-efi = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-live-install-efi-testfs = "OE-Core"
+DISTRO_PN_ALIAS_pn-initramfs-live-install-testfs = "OE-Core"
+DISTRO_PN_ALIAS_pn-initscripts = "Fedora=initscripts Mandravia=initscripts"
+DISTRO_PN_ALIAS_pn-inputproto = "Meego=xorg-x11-proto-inputproto"
+DISTRO_PN_ALIAS_pn-iproute2 = "OSPDT"
+DISTRO_PN_ALIAS_pn-jpeg = "OpenSuSE=libjpeg Ubuntu=libjpeg62"
+DISTRO_PN_ALIAS_pn-kbproto = "Meego=xorg-x11-proto-kbproto Ubuntu=x11proto-kb-dev Debian=x11proto-kb-dev"
+DISTRO_PN_ALIAS_pn-kconfig-frontends = "OSPDT"
+DISTRO_PN_ALIAS_pn-kernel-devsrc = "Debian=linux-base Ubuntu=linux"
+DISTRO_PN_ALIAS_pn-kernelshark = "Mandriva=kernelshark Ubuntu=kernelshark"
+DISTRO_PN_ALIAS_pn-kern-tools-native = "Windriver"
+DISTRO_PN_ALIAS_pn-keymaps = "OE-Core"
+DISTRO_PN_ALIAS_pn-kf = "OSPDT"
+DISTRO_PN_ALIAS_pn-lame = "Debian=lame Ubuntu=lame"
+DISTRO_PN_ALIAS_pn-latencytop = "Meego=latencytop Fedora=latencytop Debian=latencytop OpenSuSE=latencytop"
+DISTRO_PN_ALIAS_pn-ldconfig-native = "Ubuntu=libc-bin Fedora=glibc"
+DISTRO_PN_ALIAS_pn-liba52 = "Mandriva=a52dec Debian=a52dec"
+DISTRO_PN_ALIAS_pn-libacpi = "Ubuntu=libacpi Mandriva=libacpi"
+DISTRO_PN_ALIAS_pn-libatomics-ops = "Meego=libatomic-ops Debian=libatomic-ops Ubuntu=libatomic-ops OpenSuSE=libatomic-ops Mandriva=libatomic-ops"
+DISTRO_PN_ALIAS_pn-libcgroup = "Ubuntu=libcgroup1 Debian=libcgroup1"
+DISTRO_PN_ALIAS_pn-libcheck = "Ubuntu=check Fedora=check OpenSuSE=check"
+DISTRO_PN_ALIAS_pn-libclass-isa-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-libdrm-poulsbo = "Debian=libdrm-intel1 Ubuntu=libdrm-intel1"
+DISTRO_PN_ALIAS_pn-libdumpvalue-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-libenv-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-liberation-fonts = "Ubuntu=fonts-liberation Fedora=liberation-fonts-ttf"
+DISTRO_PN_ALIAS_pn-libfakekey = "Meego1.0=libfakekey Debian=libfakekey"
+DISTRO_PN_ALIAS_pn-libfile-checktree-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-libfm-extra = "Opensuse=libfm-extra4 Ubuntu=libfm-extra4"
+DISTRO_PN_ALIAS_pn-libfribidi = "OpenSuSE=fribidi Ubuntu=fribidi Mandriva=fribidi Debian=fribidi"
+DISTRO_PN_ALIAS_pn-libgcc = "Debian=libgcc4 Ubuntu=libgcc1 OpenSuSE=libgcc46"
+DISTRO_PN_ALIAS_pn-libgdbus = "Intel"
+DISTRO_PN_ALIAS_pn-libglade = "Meego=libglade2 Fedora=libglade2 OpenSuSE=libglade2 Ubuntu=libglade2 Mandriva=libglade2.0 Debian=libglade2"
+DISTRO_PN_ALIAS_pn-libglu = "Debian=libglu Ubuntu=libglu Opensuse=mesa-libglu"
+DISTRO_PN_ALIAS_pn-libgsmd = "Fedora=gsm Ubuntu=libgsm Debian=libgsm Opensuse=libgsm"
+DISTRO_PN_ALIAS_pn-libgtkstylus = "Debian=libgtkstylus Ubuntu=libgtkstylus"
+DISTRO_PN_ALIAS_pn-libgu = "OpenSuSE=glu OSPDT"
+DISTRO_PN_ALIAS_pn-libi18n-collate-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-libical = "Ubuntu=libical Fedora=libical"
+DISTRO_PN_ALIAS_pn-libiconv = "Fedora=mingw-libiconv Opensuse=cross-mingw-libiconv"
+DISTRO_PN_ALIAS_pn-libinput = "Ubuntu=libinput0 Fedora=libinput0"
+DISTRO_PN_ALIAS_pn-libjson = "Ubuntu=libjson0-dev Debian=libjson0-dev"
+DISTRO_PN_ALIAS_pn-libksba = "Fedora=libksba Debian=libksba8 Ubuntu=libksba"
+DISTRO_PN_ALIAS_pn-liblbxutil = "Mandriva=liblbxutil OpenSuse=xorg-x11-devel"
+DISTRO_PN_ALIAS_pn-libmatchbox = "Ubuntu=libmatchbox Fedora=libmatchbox"
+DISTRO_PN_ALIAS_pn-libmpc = "Fedora=libmpc OpenSuse=libmpc2"
+DISTRO_PN_ALIAS_pn-libnewt = "Debian=libnewt0.52 Fedora=newt"
+DISTRO_PN_ALIAS_pn-libnewt-python = "Ubuntu=python-newt Fedora=newt-python"
+DISTRO_PN_ALIAS_pn-libnss-mdns = "Meego=nss-mdns OpenSuSE=nss-mdns Ubuntu=nss-mdns Mandriva=nss_mdns Debian=nss-mdns"
+DISTRO_PN_ALIAS_pn-libomxil = "OSPDT upstream=http://omxil.sourceforge.net/"
+DISTRO_PN_ALIAS_pn-libowl = "Debian=owl OpenedHand"
+DISTRO_PN_ALIAS_pn-libowl-av = "OpenedHand"
+DISTRO_PN_ALIAS_pn-libpam = "Meego=pam Fedora=pam OpenSuSE=pam Ubuntu=pam Mandriva=pam Debian=pam"
+DISTRO_PN_ALIAS_pn-libpcre = "Mandriva=libpcre0 Fedora=pcre"
+DISTRO_PN_ALIAS_pn-libpng12 = "Debian=libpng12-0 Fedora=libpng"
+DISTRO_PN_ALIAS_pn-libpod-plainer-perl = "OSPDT"
+DISTRO_PN_ALIAS_pn-libsamplerate0 = "Meego=libsamplerate Fedora=libsamplerate OpenSuSE=libsamplerate Ubuntu=libsamplerate Mandriva=libsamplerate Debian=libsamplerate"
+DISTRO_PN_ALIAS_pn-libsdl = "Fedora=SDL Opensuse=SDL"
+DISTRO_PN_ALIAS_pn-libsdl2 = "Fedora=sdl2 Opensuse=libsdl2 Ubuntu=libsdl2 Debian=libsdl2"
+DISTRO_PN_ALIAS_pn-libsndfile1 = "Meego=libsndfile Fedora=libsndfile OpenSuSE=libsndfile Ubuntu=libsndfile Mandriva=libsndfile Debian=libsndfile"
+DISTRO_PN_ALIAS_pn-libsoup-2.4 = "Meego=libsoup Fedora=libsoup OpenSuSE=libsoup Ubuntu=libsoup2.4 Mandriva=libsoup Debian=libsoup2.4"
+DISTRO_PN_ALIAS_pn-libsync = "OSPDT"
+DISTRO_PN_ALIAS_pn-libtelepathy = "Debian=libtelepathy2 Ubuntu=libtelepathy2"
+DISTRO_PN_ALIAS_pn-libtimedate-perl = "Debian=libtimedate-perl Ubuntu=libtimedate-perl"
+DISTRO_PN_ALIAS_pn-liburcu = "Fedora=userspace-rcu Ubuntu=liburcu0"
+DISTRO_PN_ALIAS_pn-libusb1 = "Debian=libusb-1.0-0 Fedora=libusb1"
+DISTRO_PN_ALIAS_pn-libusb-compat = "OSPDT"
+DISTRO_PN_ALIAS_pn-libx11 = "Debian=libx11-6 Fedora=libX11 Ubuntu=libx11-6 OpenSuSE=xorg-x11-libX11"
+DISTRO_PN_ALIAS_pn-libx11-diet = "Debian=libx11-6 Fedora=libX11 Ubuntu=libx11-6 OpenSuSE=xorg-x11-libX11"
+DISTRO_PN_ALIAS_pn-libxcalibrate = "OSPDT upstream=http://cgit.freedesktop.org/xorg/lib/libXCalibrate/"
+DISTRO_PN_ALIAS_pn-libxfontcache = "Mandriva=libxfontcache Debian=libxfontcache"
+DISTRO_PN_ALIAS_pn-libxft = "Mandriva=libxft Debian=libxft2 Ubuntu=libxft2"
+DISTRO_PN_ALIAS_pn-libxi = "Ubuntu=libxi Fedora=libXi"
+DISTRO_PN_ALIAS_pn-libxkbcommon = "Fedora=libxkbcommon Debian=libxkbcommon"
+DISTRO_PN_ALIAS_pn-libxprintapputil = "Debian=libxprintapputil Ubuntu=libxprintapputil1 Mandriva=libxprintapputil"
+DISTRO_PN_ALIAS_pn-libxscrnsaver = "Fedora=libXScrnSaver Ubuntu=libxss1 Mandriva=libxscrnsaver"
+DISTRO_PN_ALIAS_pn-libxsettings-client = "Debian=libxsettings-client0 Ubuntu=libxsettings-client0 Mandriva=libXsettings-client0"
+DISTRO_PN_ALIAS_pn-libxtrap = "Debian=libxtrap6 Fedora=libXTrap"
+DISTRO_PN_ALIAS_pn-libxxf86misc = "Mandriva=libxxf86misc Fedora=libXxf86misc"
+DISTRO_PN_ALIAS_pn-linux-dummy = "Intel"
+DISTRO_PN_ALIAS_pn-linux-firmware = "Fedora=linux-firmware Ubuntu=linux-firmware"
+DISTRO_PN_ALIAS_pn-linux-libc-headers = "Debian=linux-kernel-headers Ubuntu=linux-kernel-headers"
+DISTRO_PN_ALIAS_pn-linux-libc-headers-yocto = "Debian=linux-kernel-headers Ubuntu=linux-kernel-headers"
+DISTRO_PN_ALIAS_pn-linux-yocto = "Debian=linux-base Ubuntu=linux"
+DISTRO_PN_ALIAS_pn-linux-yocto-rt = "Debian=linux-base Ubuntu=linux"
+DISTRO_PN_ALIAS_pn-linux-yocto-tiny = "OSPDT"
+DISTRO_PN_ALIAS_pn-lsbinitscripts = "Windriver"
+DISTRO_PN_ALIAS_pn-lsbsetup = "Windriver"
+DISTRO_PN_ALIAS_pn-lsbtest = "Windriver"
+DISTRO_PN_ALIAS_pn-ltp = "Mandriva=ltp Ubuntu=ltp"
+DISTRO_PN_ALIAS_pn-lttng-modules = "OSPDT upstream=http://lttng.org/"
+DISTRO_PN_ALIAS_pn-lttng-tools = "OSPDT upstream=http://lttng.org/"
+DISTRO_PN_ALIAS_pn-lttng-ust = "OSPDT upstream=http://lttng.org/"
+DISTRO_PN_ALIAS_pn-lz4 = "Debian=lz4 Fedora=lz4"
+DISTRO_PN_ALIAS_pn-lzo = "Debian=liblzo Ubuntu=liblzo Fedora=lzp"
+DISTRO_PN_ALIAS_pn-mailx = "Debian=bsd-mailx Ubuntu=bsd-mailx"
+DISTRO_PN_ALIAS_pn-makedepend = "Mandriva=makedepend Ubuntu=xutils-dev"
+DISTRO_PN_ALIAS_pn-makedevs = "OE-Core"
+DISTRO_PN_ALIAS_pn-matchbox-config-gtk = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-desktop = "Mandriva=matchbox-desktop Ubuntu=matchbox-desktop"
+DISTRO_PN_ALIAS_pn-matchbox-desktop-sato = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-keyboard = "Debian=matchbox-keyboard Fedora=matchbox-keyboard"
+DISTRO_PN_ALIAS_pn-matchbox-panel-2 = "Debian=matchbox-panel Mandriva=matchbox-panel Ubuntu=matchbox-panel"
+DISTRO_PN_ALIAS_pn-matchbox-session = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-session-sato = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-terminal = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-theme-sato = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-theme-sato-2 = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-themes-extra = "Ubuntu=matchbox-themes-extra Mandriva=matchbox-themes-extra"
+DISTRO_PN_ALIAS_pn-matchbox-themes-gtk = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-wm = "OpenedHand"
+DISTRO_PN_ALIAS_pn-matchbox-wm-2 = "Mandriva=matchbox-window-manager Debian=matchbox-window-manager"
+DISTRO_PN_ALIAS_pn-menu-cache = "OSPDT"
+DISTRO_PN_ALIAS_pn-mesa = "Fedora=mesa Ubuntu=libgl1-mesa-dri"
+DISTRO_PN_ALIAS_pn-mesa-gl = "Fedora=mesa Ubuntu=libgl1-mesa-dri"
+DISTRO_PN_ALIAS_pn-mesa-glsl = "Fedora=mesa Ubuntu=libgl1-mesa-dri"
+DISTRO_PN_ALIAS_pn-meta-environment-extsdk-qemux86 = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-environment-i586 = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-environment-qemux86 = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-environment-qemux86-64 = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-ide-support = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-toolchain = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-toolchain-qt = "OE-Core"
+DISTRO_PN_ALIAS_pn-meta-toolchain-qte = "OE-Core"
+DISTRO_PN_ALIAS_pn-mini-x-session = "OSPDT"
+DISTRO_PN_ALIAS_pn-mkelfimage = "Ubuntu=mkelfimage Fedora=mkelfimage"
+DISTRO_PN_ALIAS_pn-mkfontdir = "Mandriva=mkfontdir Ubuntu=xfonts-utils Fedora=xorg-x11-font-utils"
+DISTRO_PN_ALIAS_pn-mkfontscale = "Mandriva=mkfontscale Ubuntu=xfonts-utils Fedora=xorg-x11-font-utils"
+DISTRO_PN_ALIAS_pn-mktemp = "Mandriva=mktemp Fedora=mktemp"
+DISTRO_PN_ALIAS_pn-mmc-utils = "OE-Core"
+DISTRO_PN_ALIAS_pn-moblin-proto = "OE-Core"
+DISTRO_PN_ALIAS_pn-modutils-collateral = "OE-Core"
+DISTRO_PN_ALIAS_pn-modutils-initscripts = "OE-Core"
+DISTRO_PN_ALIAS_pn-msynctool = "OpenSuse=msynctool Mandriva=msynctool"
+DISTRO_PN_ALIAS_pn-mtd-utils = "Debian=mtd-utils Ubuntu=mtd-utils"
+DISTRO_PN_ALIAS_pn-mx-1.0 = "Ubuntu=mx Debian=mx Fedora=mx"
+DISTRO_PN_ALIAS_pn-n450-audio = "Intel"
+DISTRO_PN_ALIAS_pn-neard = "Intel"
+DISTRO_PN_ALIAS_pn-neon = "Fedora=neon Opensuse=neon"
+DISTRO_PN_ALIAS_pn-network-suspend-scripts = "OE-Core"
+DISTRO_PN_ALIAS_pn-nfs-export-root = "OpenedHand"
+DISTRO_PN_ALIAS_pn-npth = "OSPDT"
+DISTRO_PN_ALIAS_pn-nss-myhostname = "Meego=nss-mdns OpenSuSE=nss-mdns Ubuntu=nss-mdns Mandriva=nss_mdns Debian=nss-mdns"
+DISTRO_PN_ALIAS_pn-ocf-linux = "OSPDT"
+DISTRO_PN_ALIAS_pn-ofono = "Debian=ofono Ubuntu=ofono"
+DISTRO_PN_ALIAS_pn-oh-puzzles = "OpenedHand"
+DISTRO_PN_ALIAS_pn-opkg = "OSPDT upstream=http://svn.openmoko.org/trunk/src/tar"
+DISTRO_PN_ALIAS_pn-opkg-arch-config = "OE-Core"
+DISTRO_PN_ALIAS_pn-opkg-collateral = "OE-Core"
+DISTRO_PN_ALIAS_pn-opkg-keyrings = "OSPDT upstream=git://git.yoctoproject.org/opkg-utils"
+DISTRO_PN_ALIAS_pn-opkg-nogpg = "OSPDT upstream=git://git.yoctoproject.org/opkg-utils"
+DISTRO_PN_ALIAS_pn-opkg-utils = "OSPDT upstream=git://git.yoctoproject.org/opkg-utils"
+DISTRO_PN_ALIAS_pn-oprofile = "Debian=oprofile Fedora=oprofile"
+DISTRO_PN_ALIAS_pn-oprofileui = "Fedora=oprofileui Ubuntu=oprofile-gui Debian=oprofile-gui"
+DISTRO_PN_ALIAS_pn-oprofileui-server = "Fedora=oprofileui Ubuntu=oprofile-gui Debian=oprofile-gui"
+DISTRO_PN_ALIAS_pn-os-release = "OE-Core"
+DISTRO_PN_ALIAS_pn-owl-video = "OpenedHand"
+DISTRO_PN_ALIAS_pn-packagegroup-base = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-boot = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-buildessential = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-clutter = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-device-devel = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-directfb = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-eclipse-debug = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-full-cmdline = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-lsb = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-nfs = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-qt = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-qt4e = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-sdk = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-ssh-dropbear = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-ssh-openssh = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-standalone-sdk-target = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-tools = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-tools-debug = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-tools-profile = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-tools-testapps = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-x11 = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-x11-base = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-x11-mini = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-x11-sato = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-core-x11-xserver = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-cross-canadian-i586 = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-cross-canadian-qemux86 = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-cross-canadian-qemux86-64 = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-qt4e = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-qte-toolchain-host = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-qte-toolchain-target = "Intel"
+DISTRO_PN_ALIAS_pn-packagegroup-qt-toolchain-host = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-qt-toolchain-target = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-sdk-host = "OE-Core"
+DISTRO_PN_ALIAS_pn-packagegroup-self-hosted = "OE-Core"
+DISTRO_PN_ALIAS_pn-package-index = "OE-Core"
+DISTRO_PN_ALIAS_pn-patchelf = "Opensuse=patchelf Fedora=patchelf"
+DISTRO_PN_ALIAS_pn-perf = "OSPDT"
+DISTRO_PN_ALIAS_pn-piglit = "OE-Core"
+DISTRO_PN_ALIAS_pn-pkgconfig = "Ubuntu=pkg-config Fedora=pkgconfig"
+DISTRO_PN_ALIAS_pn-pointercal = "OE-Core"
+DISTRO_PN_ALIAS_pn-pointercal-xinput = "OE-Core"
+DISTRO_PN_ALIAS_pn-poky-feed-config-opkg = "OE-Core"
+DISTRO_PN_ALIAS_pn-pong-clock = "OpenedHand"
+DISTRO_PN_ALIAS_pn-portmap = "Debian=rpcbind Fedora=rpcbind"
+DISTRO_PN_ALIAS_pn-postinst-intercept = "OE-Core"
+DISTRO_PN_ALIAS_pn-powertop = "Meego=powertop Fedora=powertop Debian=powertop OpenSuSE=powertop Mandriva=powertop"
+DISTRO_PN_ALIAS_pn-ppp-dialin = "OE-Core"
+DISTRO_PN_ALIAS_pn-presentproto = "Debian=x11proto-present-dev Fedora=xorg-x11-proto-devel"
+DISTRO_PN_ALIAS_pn-printproto = "Debian=x11proto-print-dev Ubuntu=x11proto-print-dev Mandriva=x11-proto-devel"
+DISTRO_PN_ALIAS_pn-pseudo = "Windriver"
+DISTRO_PN_ALIAS_pn-psplash = "OpenedHand"
+DISTRO_PN_ALIAS_pn-ptest-runner = "OE-Core"
+DISTRO_PN_ALIAS_pn-puzzles = "Debian=sgt-puzzles Fedora=puzzles"
+DISTRO_PN_ALIAS_pn-python3 = "Fedora=python3 Debian=python3.2"
+DISTRO_PN_ALIAS_pn-python3-distribute = "Debian=python3-setuptools Fedora=python3-setuptools"
+DISTRO_PN_ALIAS_pn-python-ZSI = "OE-Core"
+DISTRO_PN_ALIAS_pn-python-argparse = "Fedora=python-argparse OpenSuSE=python-argparse"
+DISTRO_PN_ALIAS_pn-python-dbus = "Ubuntu=python-dbus Debian=python-dbus Mandriva=python-dbus"
+DISTRO_PN_ALIAS_pn-python-distribute = "Opensuse=python-setuptools Fedora=python-setuptools"
+DISTRO_PN_ALIAS_pn-python-git = "Debian=python-git Fedora=GitPython"
+DISTRO_PN_ALIAS_pn-python-mako = "Fedora=python-mako Opensuse=python-Mako"
+DISTRO_PN_ALIAS_pn-python-pycairo = "Meego=pycairo Fedora=pycairo Ubuntu=pycairo Debian=pycairo"
+DISTRO_PN_ALIAS_pn-python-pycurl = "Debian=python-pycurl Ubuntu=python-pycurl"
+DISTRO_PN_ALIAS_pn-python-pygobject = "Meego=pygobject2 Fedora=pygobject2 Ubuntu=pygobject Debian=pygobject"
+DISTRO_PN_ALIAS_pn-python-pygtk = "Debian=python-gtk2 Fedora=pygtk2 OpenSuSE=python-gtk"
+DISTRO_PN_ALIAS_pn-python-pyrex = "Mandriva=python-pyrex Ubuntu=python-pyrex"
+DISTRO_PN_ALIAS_pn-python-scons = "Fedora=scons OpenSuSE=scons Ubuntu=scons Mandriva=scons Debian=scons"
+DISTRO_PN_ALIAS_pn-python-setuptools = "Mandriva=python-setup OpenSuSE=python-setup-git"
+DISTRO_PN_ALIAS_pn-python-smartpm = "Debian=smart OpenSuSE=smart"
+DISTRO_PN_ALIAS_pn-qemu-config = "OpenedHand"
+DISTRO_PN_ALIAS_pn-qemugl = "OpenedHand"
+DISTRO_PN_ALIAS_pn-qemu-helper = "OpenedHand"
+DISTRO_PN_ALIAS_pn-qemuwrapper-cross = "OE-Core"
+DISTRO_PN_ALIAS_pn-qmmp = "Fedora=qmmp Debian=qmmp"
+DISTRO_PN_ALIAS_pn-qt4 = "Mandriva=libqt4-devel Ubuntu=libqt4-dev"
+DISTRO_PN_ALIAS_pn-qt4e-demo-image = "OE-Core"
+DISTRO_PN_ALIAS_pn-qt4-embedded = "OSPDT"
+DISTRO_PN_ALIAS_pn-qt4-graphics-system = "OE-Core"
+DISTRO_PN_ALIAS_pn-qt4-tools = "Mandriva=libqt4-devel Ubuntu=libqt4-dev"
+DISTRO_PN_ALIAS_pn-qt4-x11-free = "Ubuntu=qt-x11-free Debian=qt-x11-free"
+DISTRO_PN_ALIAS_pn-qt-demo-init = "OE-Core"
+DISTRO_PN_ALIAS_pn-quicky = "OSPDT"
+DISTRO_PN_ALIAS_pn-randrproto = "Meego=xorg-x11-proto-randrproto"
+DISTRO_PN_ALIAS_pn-readline = "Fedora=readline Debian=readline-common"
+DISTRO_PN_ALIAS_pn-recordproto = "Meego=xorg-x11-proto-recordproto"
+DISTRO_PN_ALIAS_pn-remake = "Mandriva=remake Debian=remake"
+DISTRO_PN_ALIAS_pn-renderproto = "Meego=xorg-x11-proto-renderproto"
+DISTRO_PN_ALIAS_pn-resourceproto = "Meego=xorg-x11-proto-resourceproto"
+DISTRO_PN_ALIAS_pn-rgb = "Fedora=xorg-X11-server-utils Debian=x11-xserver-utils"
+DISTRO_PN_ALIAS_pn-rpmresolve = "OSPDT"
+DISTRO_PN_ALIAS_pn-rt-tests = "Debian=rt-tests Ubuntu=rt-tests"
+DISTRO_PN_ALIAS_pn-run-postinsts = "OE-Core"
+DISTRO_PN_ALIAS_pn-sato-icon-theme = "OpenedHand"
+DISTRO_PN_ALIAS_pn-sato-screenshot = "OpenedHand"
+DISTRO_PN_ALIAS_pn-sbc = "Fedora=sbc Debian=libsbc1"
+DISTRO_PN_ALIAS_pn-screenshot = "OpenedHand"
+DISTRO_PN_ALIAS_pn-scrnsaverproto = "Meego=xorg-x11-proto-scrnsaverproto Ubuntu=x11proto-scrnsaver-dev Debian=x11proto-scrnsaver-dev"
+DISTRO_PN_ALIAS_pn-settings-daemon = "OpenedHand"
+DISTRO_PN_ALIAS_pn-sgml-common = "OpenSuSE=sgml-common Fedora=sgml-common"
+DISTRO_PN_ALIAS_pn-sgmlspl = "Debian=sgmlspl Ubuntu=sgmlspl"
+DISTRO_PN_ALIAS_pn-shadow-securetty = "Ubuntu=shadow Fedora=shadow"
+DISTRO_PN_ALIAS_pn-shadow-sysroot = "Ubuntu=shadow Fedora=shadow"
+DISTRO_PN_ALIAS_pn-shasum = "OE-Core"
+DISTRO_PN_ALIAS_pn-shutdown-desktop = "OpenedHand"
+DISTRO_PN_ALIAS_pn-signgp = "OE-Core"
+DISTRO_PN_ALIAS_pn-stat = "Debian=coreutils Fedora=coreutils"
+DISTRO_PN_ALIAS_pn-swabber = "OE-Core"
+DISTRO_PN_ALIAS_pn-sysklogd = "Debian=sysklogd Mandriva=sysklogd"
+DISTRO_PN_ALIAS_pn-sysprof = "Fedora=sysprof Debian=sysprof"
+DISTRO_PN_ALIAS_pn-systemd-compat-units = "Fedora=systemd Ubuntu=systemd"
+DISTRO_PN_ALIAS_pn-systemd-systemctl = "OE-Core"
+DISTRO_PN_ALIAS_pn-systemd-systemdctl = "Fedora=systemd Ubuntu=systemd"
+DISTRO_PN_ALIAS_pn-systemtap-uprobes = "Ubuntu=systemtap Debian=systemtap"
+DISTRO_PN_ALIAS_pn-sysvinit-inittab = "OE-Core"
+DISTRO_PN_ALIAS_pn-table = "Intel"
+DISTRO_PN_ALIAS_pn-tar-replacement = "Fedora=tar Ubuntu=tar"
+DISTRO_PN_ALIAS_pn-tcf-agent = "Windriver upstream=http://www.eclipse.org/dsdp/tm/"
+DISTRO_PN_ALIAS_pn-telepathy-python = "Debian=telepathy-python Ubuntu=telepathy-python"
+DISTRO_PN_ALIAS_pn-texinfo-dummy-native = "OE-Core"
+DISTRO_PN_ALIAS_pn-tiny-init = "OSPDT"
+DISTRO_PN_ALIAS_pn-tinylogin = "Debian=busybox Ubuntu=busybox Mandriva=busybox"
+DISTRO_PN_ALIAS_pn-trace-cmd = "Mandriva=trace-cmd Ubuntu=trace-cmd"
+DISTRO_PN_ALIAS_pn-trapproto = "Meego=xorg-x11-proto-trapproto"
+DISTRO_PN_ALIAS_pn-tremor = "OSPDT upstream=http://www.xiph.org/vorbis/"
+DISTRO_PN_ALIAS_pn-tslib = "Debian=tslib Ubuntu=tslib"
+DISTRO_PN_ALIAS_pn-ttf-bitstream-vera = "Debian=ttf-bitstream-vera Ubuntu=ttf-bitstream-vera"
+DISTRO_PN_ALIAS_pn-tzcode = "OSPDT"
+DISTRO_PN_ALIAS_pn-u-boot-fw-utils = "Ubuntu=u-boot-tools Debian=u-boot-tools"
+DISTRO_PN_ALIAS_pn-u-boot-mkimage = "Ubuntu=uboot-mkimage Debian=uboot-mkimage"
+DISTRO_PN_ALIAS_pn-udev-extraconf = "OE-Core"
+DISTRO_PN_ALIAS_pn-unfs3 = "Debian=unfs3 Fedora=unfs3"
+DISTRO_PN_ALIAS_pn-unfs-server = "OE-Core"
+DISTRO_PN_ALIAS_pn-uninative-tarball = "OE-Core"
+DISTRO_PN_ALIAS_pn-update-alternatives-dpkg = "Opensuse=update-alternatives Mandriva=update-alternatives"
+DISTRO_PN_ALIAS_pn-update-rc.d = "OE-Core"
+DISTRO_PN_ALIAS_pn-usbinit = "OE-Core"
+DISTRO_PN_ALIAS_pn-util-macros = "Meego=xorg-x11-util-macros Fedora=xorg-x11-util-macros Mandriva=x11-util-macros"
+DISTRO_PN_ALIAS_pn-v86d = "Debian=v86d Ubuntu=v86d"
+DISTRO_PN_ALIAS_pn-videoproto = "Meego=xorg-x11-proto-videoproto"
+DISTRO_PN_ALIAS_pn-waffle = "OE-Core"
+DISTRO_PN_ALIAS_pn-watchdog = "Debian=watchdog Ubuntu=watchdog Mandriva=watchdog"
+DISTRO_PN_ALIAS_pn-webkitgtk = "Fedora=webkitgtk Ubuntu=libwebkit"
+DISTRO_PN_ALIAS_pn-web-webkit = "OpenedHand"
+DISTRO_PN_ALIAS_pn-weston = "Fedora=weston OpenSuSE=weston"
+DISTRO_PN_ALIAS_pn-weston-init = "OE-Core"
+DISTRO_PN_ALIAS_pn-which = "Mandriva=which Fedora=which"
+DISTRO_PN_ALIAS_pn-wpa-supplicant = "Meego=wpa_supplicant Fedora=wpa_supplicant OpenSuSE=wpa_supplicant Ubuntu=wpasupplicant Mandriva=wpa_supplicant Debian=wpasupplicant"
+DISTRO_PN_ALIAS_pn-x11-common = "OE-Core"
+DISTRO_PN_ALIAS_pn-x11perf = "Fedora=xorg-x11-apps Ubuntu=x11-apps"
+DISTRO_PN_ALIAS_pn-x11vnc = "Fedora=x11vnc Ubuntu=x11vnc"
+DISTRO_PN_ALIAS_pn-xcb-util-image = "Debian=xcb-util Fedora=xcb-util"
+DISTRO_PN_ALIAS_pn-xcb-util-keysyms = "Debian=xcb-util Fedora=xcb-util"
+DISTRO_PN_ALIAS_pn-xcb-util-wm = "Debian=xcb-util Fedora=xcb-util"
+DISTRO_PN_ALIAS_pn-xcmiscproto = "Meego=xorg-x11-proto-xcmiscproto"
+DISTRO_PN_ALIAS_pn-xcursor-transparent-theme = "OpenedHand"
+DISTRO_PN_ALIAS_pn-xdpyinfo = "Fedora=xorg-x11-utils Ubuntu=x11-utils"
+DISTRO_PN_ALIAS_pn-xev = "Fedora=xorg-x11-utils Ubuntu=x11-utils"
+DISTRO_PN_ALIAS_pn-xextproto = "Meego=xorg-x11-proto-xextproto"
+DISTRO_PN_ALIAS_pn-xeyes = "Ubuntu=x11-apps Fedora=xorg-x11-apps"
+DISTRO_PN_ALIAS_pn-xf86bigfontproto = "Meego=xorg-x11-proto-xf86bigfontproto"
+DISTRO_PN_ALIAS_pn-xf86dgaproto = "Meego=xorg-x11-proto-xf86dgaproto"
+DISTRO_PN_ALIAS_pn-xf86driproto = "Meego=xorg-x11-proto-xf86driproto"
+DISTRO_PN_ALIAS_pn-xf86-input-evdev = "Ubuntu=xserver-xorg-input-evdev Mandriva=x11-driver-input-evdev Debian=xserver-xorg-input-evdev Fedora=xorg-x11-drv-evdev Meego=xorg-x11-drv-evdev"
+DISTRO_PN_ALIAS_pn-xf86-input-keyboard = "Meego=xorg-x11-drv-keyboard Fedora=xorg-x11-drv-keyboard Mandriva=x11-driver-input-keyboard Debian=xserver-xorg-input-keyboard"
+DISTRO_PN_ALIAS_pn-xf86-input-mouse = "Ubuntu=xserver-xorg-input-mouse Mandriva=x11-driver-input-mouse Debian=xserver-xorg-input-mouse"
+DISTRO_PN_ALIAS_pn-xf86-input-synaptics = "Meego=xorg-x11-drv-synaptics Fedora=xorg-x11-drv-synaptics Ubuntu=xserver-xorg-input-synaptics Mandriva=x11-driver-input-synaptics Debian=xfree86-driver-synaptics"
+DISTRO_PN_ALIAS_pn-xf86-input-vmmouse = "Fedora=xorg-x11-drv-vmmouse Ubuntu=xserver-xorg-input-vmmouse Mandriva=x11-driver-input-vmmouse Debian=xserver-xorg-input-vmmouse"
+DISTRO_PN_ALIAS_pn-xf86miscproto = "Meego=xorg-x11-proto-xf86miscproto"
+DISTRO_PN_ALIAS_pn-xf86rushproto = "Meego=xorg-x11-proto-xf86rushproto"
+DISTRO_PN_ALIAS_pn-xf86-video-cirrus = "Opensuse=xf86-video-cirrus Debian=xserver-xorg-video-cirrus"
+DISTRO_PN_ALIAS_pn-xf86-video-fbdev = "Ubuntu=xserver-xorg-video-fbdev Debian=xserver-xorg-video-fbdev"
+DISTRO_PN_ALIAS_pn-xf86-video-intel = "Debian=xserver-xorg-video-intel Fedora=xorg-x11-drv-intel Mandriva=x11-driver-video-intel Meego=xorg-x11-drv-intel Ubuntu=xserver-xorg-video-intel"
+DISTRO_PN_ALIAS_pn-xf86-video-modesetting = "Debian=xserver-xorg-video-modesetting Fedora=xf86-video-modesetting"
+DISTRO_PN_ALIAS_pn-xf86-video-omap = "Ubuntu=xf86-video-omap Debian=xf86-video-omap"
+DISTRO_PN_ALIAS_pn-xf86-video-omapfb = "OSPDT"
+DISTRO_PN_ALIAS_pn-xf86-video-vesa = "Debian=xserver-xorg-video-vesa Fedora=xorg-x11-drv-vesa Mandriva=x11-driver-video-vesa Ubuntu=xserver-xorg-video-vesa"
+DISTRO_PN_ALIAS_pn-xf86-video-vmware = "Debian=xserver-xorg-video-vmware Fedora=xorg-x11-drv-vmware Mandriva=x11-driver-video-vmware Ubuntu=xserver-xorg-video-vmware"
+DISTRO_PN_ALIAS_pn-xf86vidmodeproto = "Meego=xorg-x11-proto-xf86vidmodeproto Ubuntu=x11proto-xf86vidmode Debian=x11proto-xf86vidmode"
+DISTRO_PN_ALIAS_pn-xhost = "Ubuntu=x11-xserver-utils Fedora=xorg-x11-server-utils"
+DISTRO_PN_ALIAS_pn-xineramaproto = "Meego=xorg-x11-proto-xineramaproto Ubuntu=x11proto-xinerama Debian=x11proto-xinerama"
+DISTRO_PN_ALIAS_pn-xinput-calibrator = "Fedora=xinput-calibrator Mandravia=xinput-calibrator Ubuntu=xinput-calibrator"
+DISTRO_PN_ALIAS_pn-xkbcomp = "Ubuntu=x11-xkb-utils Fedora=xorg-x11-xkb-utils"
+DISTRO_PN_ALIAS_pn-xmodmap = "Meego=xorg-x11-utils-xmodmap Fedora=xorg-x11-server-utils Ubuntu=x11-xserver-utils"
+DISTRO_PN_ALIAS_pn-xorg-minimal-fonts = "Ubuntu=xfonts-base Fedora=xorg-x11-fonts-base"
+DISTRO_PN_ALIAS_pn-xprop = "Meego=xorg-x11-utils-xprop Fedora=xorg-x11-utils Ubuntu=x11-utils"
+DISTRO_PN_ALIAS_pn-xproto = "Meego=xorg-x11-proto-xproto Fedora=xorg-x11-proto-devel Ubuntu=x11proto-core-dev Debian=x11proto-core-dev Opensuse=xorg-x11-proto-devel Mandriva=x11-proto-devel"
+DISTRO_PN_ALIAS_pn-xproxymanagementprotocol = "Meego=xorg-x11-proto-xproxymanagementprotocol"
+DISTRO_PN_ALIAS_pn-xrandr = "Ubuntu=x11-xserver-utils Fedora=xorg-x11-server-utils"
+DISTRO_PN_ALIAS_pn-xrdb = "Ubuntu=x11-xserver-utils Fedora=xorg-x11-server-utils"
+DISTRO_PN_ALIAS_pn-xserver-nodm-init = "OE-Core"
+DISTRO_PN_ALIAS_pn-xserver-xf86-config = "OE-Core"
+DISTRO_PN_ALIAS_pn-xserver-xf86-dri-lite = "Fedora=xorg-x11-server Ubuntu=xserver-xorg"
+DISTRO_PN_ALIAS_pn-xserver-xf86-lite = "Fedora=xorg-x11-server Ubuntu=xserver-xorg"
+DISTRO_PN_ALIAS_pn-xserver-xorg = "Fedora=xorg-x11-server Ubuntu=xserver-xorg"
+DISTRO_PN_ALIAS_pn-xset = "Fedora=xorg-x11-server-utils Ubuntu=x11-xserver-utils Debian=x11-xserver-utils Opensuse=xorg-x11"
+DISTRO_PN_ALIAS_pn-xtscal = "OSPDT upstream=http://gpe.linuxtogo.org/download/source/"
+DISTRO_PN_ALIAS_pn-xuser-account = "OE-Core"
+DISTRO_PN_ALIAS_pn-xvideo-tests = "OpenedHand"
+DISTRO_PN_ALIAS_pn-xvinfo = "Fedora=xorg-x11-utils Ubuntu=x11-utils"
+DISTRO_PN_ALIAS_pn-xwininfo = "Fedora=xorg-x11-utils Ubuntu=x11-utils"
+DISTRO_PN_ALIAS_pn-yaffs2-utils = "OSPDT upstream=http://www.yaffs.net"
+DISTRO_PN_ALIAS_pn-zaurusd = "OpenedHand"
+DISTRO_PN_ALIAS_pn-zeroconf = "OSPDT upstream=http://www.progsoc.org/~wildfire/zeroconf/"
diff --git a/meta/conf/distro/include/package_regex.inc b/meta/conf/distro/include/package_regex.inc
new file mode 100644
index 0000000..d12999b
--- /dev/null
+++ b/meta/conf/distro/include/package_regex.inc
@@ -0,0 +1,278 @@
+# package_regex.inc - This file contains data that tracks
+# upstream project associated with a given recipe. This list is needed
+# for recipes that version information can not be automagically discovered.
+# As we automate this checking, this file will slowly be reduced.
+#"
+# This data is used by the package reporting system (packages.yoctoproject.org)
+#"
+# The format is as a bitbake variable override for each recipe
+#"
+#       REGEX_URI_pn-<recipe name> = "recipe_url"
+#	 - This is the url used by the package checking system to
+#	   get the latest version of the package
+#       REGEX_pn-<recipe name> = "package_regex"
+#	 - This is the regex the package checking system uses to
+#	   parse the page found at REGEX_URI_pn-<recipe name>
+#	GITTAGREGEX_pn-<recipe name> = "git_tag_regex"
+#	 - When source code is fetched from git, git tags are used to
+#	   determine the upstream release version. This regex can be used
+#	   to filter only relevant tags.
+#
+
+COMMON_REGEX = "(?P<pver>(\d+[\.\-_]*)+)"
+
+# Generic regex don't match
+REGEX_URI_pn-wireless-tools = "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html"
+REGEX_pn-wireless-tools = "wireless_tools\.(?P<pver>(\d+)(\..*|))\.tar\.gz"
+
+REGEX_URI_pn-sqlite3="http://www.sqlite.org/"
+REGEX_pn-sqlite3="releaselog/${COMMON_REGEX}.html"
+
+REGEX_URI_pn-dhcp = "ftp://ftp.isc.org/isc/dhcp/"
+REGEX_pn-dhcp="(?P<pver>\d+\.\d+\.(\d+?))/"
+
+REGEX_pn-foomatic-filters = "foomatic-filters-(?P<pver>((\d|\d\d)\.*)+)\.tar\.gz"
+REGEX_pn-xdg-utils = "xdg-utils-(?P<pver>((\d+[\.\-_]*)+)((rc|alpha|beta)\d+)?)\.(tar\.gz|tgz)"
+REGEX_pn-rpm="rpm-${COMMON_REGEX}-.*$"
+REGEX_pn-libtheora = "libtheora-(?P<pver>\d+(\.\d)+)\.(tar\.gz|tgz)"
+
+REGEX_pn-iputils="iputils-(?P<pver>s\d+).tar"
+REGEX_pn-nettle = "nettle-(?P<pver>\d+(\.\d+)+)\.tar"
+
+REGEX_pn-cairo = "cairo-(?P<pver>\d+(\.\d+)+)\.tar"
+REGEX_pn-cmake = "cmake-(?P<pver>\d+(\.\d+)+)\.tar"
+REGEX_pn-libsdl = "SDL-(?P<pver>\d+(\.\d+)+)\.tar"
+REGEX_pn-libxslt = "libxslt-(?P<pver>\d+(\.\d+)+)\.tar"
+
+# Exclude NC versions which lack AES encryption
+REGEX_pn-db = "db-(?P<pver>\d+\.\d+(\.\d+)?).tar"
+
+REGEX_URI_pn-autogen = "http://ftp.gnu.org/gnu/autogen/"
+REGEX_pn-autogen = "rel(?P<pver>\d+(\.\d+)+)/"
+
+# python recipe is actually python 2.x
+# also, exclude pre-releases for both python 2.x and 3.x
+REGEX_pn-python = "[Pp]ython-(?P<pver>2(\.\d+)+).tar"
+REGEX_pn-python3 = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar"
+
+# exclude betas
+REGEX_pn-tiff = "tiff-(?P<pver>\d+(\.\d+)+).tar"
+
+# exclude version 5.5.2 which triggers a false positive
+REGEX_pn-unzip = "unzip(?P<pver>(?!552).+)\.tgz"
+# similar for zip
+REGEX_pn-zip = "^zip(?P<pver>(?!232).+)\.tgz"
+
+# Isn't possible to download with the default URI web server returns
+# (403, 404, 550)
+REGEX_URI_pn-dosfstools = "https://github.com/dosfstools/dosfstools/releases"
+REGEX_pn-json-c = "json-c-(?P<pver>\d+(\.\d+)+).tar"
+# json-c releases page is fetching the list of releases in some weird XML format
+# from https://s3.amazonaws.com/json-c_releases and processes it with javascript :-/
+#REGEX_URI_pn-json-c = "https://s3.amazonaws.com/json-c_releases/releases/index.html"
+REGEX_URI_pn-chrpath = "http://alioth.debian.org/frs/?group_id=31052"
+
+REGEX_URI_pn-powertop = "https://01.org/powertop/downloads"
+REGEX_URI_pn-libsamplerate0 = "http://www.mega-nerd.com/SRC/download.html"
+REGEX_URI_pn-libxkbcommon = "http://xkbcommon.org/"
+REGEX_URI_pn-tslib = "https://github.com/kergoth/tslib/releases"
+REGEX_URI_pn-waffle="http://www.waffle-gl.org/releases.html"
+REGEX_URI_pn-lrzsz = "http://ohse.de/uwe/software/lrzsz.html"
+REGEX_URI_pn-libacpi = "http://www.ngolde.de/libacpi.html"
+REGEX_URI_pn-less  = "http://www.greenwoodsoftware.com/less/download.html"
+REGEX_URI_pn-cups = "http://www.cups.org/software.php"
+REGEX_pn-cups = "cups-(?P<pver>\d+\.\d+(\.\d+)?)-source.tar"
+REGEX_URI_pn-bzip2 = "http://www.bzip.org/downloads.html"
+REGEX_URI_pn-minicom = "https://alioth.debian.org/frs/?group_id=30018"
+REGEX_URI_pn-sysstat = "http://sebastien.godard.pagesperso-orange.fr/download.html"
+REGEX_URI_pn-libical = "https://github.com/libical/libical/releases/"
+REGEX_URI_pn-libmpc = "http://www.multiprecision.org/index.php?prog=mpc&page=download"
+REGEX_URI_pn-taglib = "http://github.com/taglib/taglib/releases/"
+REGEX_URI_pn-libevent = "http://libevent.org/"
+REGEX_URI_pn-db = "http://www.oracle.com/technetwork/products/berkeleydb/downloads/index-082944.html"
+REGEX_URI_pn-python-smartpm="https://launchpad.net/smart/trunk/"
+REGEX_URI_pn-lsof = "ftp://sunsite.ualberta.ca/pub/Mirror/lsof/"
+REGEX_URI_pn-pbzip2 = "http://compression.ca/pbzip2/"
+REGEX_URI_pn-quicky = "http://qt-apps.org/content/download.php?content=80325&id=1&tan=10417482"
+REGEX_URI_pn-libwebp = "http://downloads.webmproject.org/releases/webp/index.html"
+
+# The engine tries to use directory versioning but is a false-positive
+REGEX_URI_pn-intltool = "https://launchpad.net/intltool/trunk/"
+REGEX_URI_pn-libnfsidmap = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/"
+REGEX_URI_pn-mpfr = "http://www.mpfr.org/mpfr-current/"
+REGEX_URI_pn-nss = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Releases"
+REGEX_pn-nss = "NSS_(?P<pver>.+)_release_notes"
+
+REGEX_URI_pn-docbook-sgml-dtd-3.1 = "http://www.docbook.org/sgml/"
+REGEX_pn-docbook-sgml-dtd-3.1 = "(?P<pver>3\..+)/"
+REGEX_URI_pn-docbook-sgml-dtd-4.1 = "http://www.docbook.org/sgml/"
+REGEX_pn-docbook-sgml-dtd-4.1 = "(?P<pver>4\.1(\.\d+)*)/"
+
+# Qt recipes should be kept at 4.x
+REGEX_URI_pn-qt4-embedded = "http://download.qt.io/official_releases/qt/4.8/"
+REGEX_pn-qt4-embedded = "(?P<pver>\d+(\.\d+)+)/"
+REGEX_URI_pn-qt4-x11-free = "http://download.qt.io/official_releases/qt/4.8/"
+REGEX_pn-qt4-x11-free = "(?P<pver>\d+(\.\d+)+)/"
+REGEX_URI_pn-nativesdk-qt4-tools = "http://download.qt.io/official_releases/qt/4.8/"
+REGEX_pn-nativesdk-qt4-tools = "(?P<pver>\d+(\.\d+)+)/"
+REGEX_URI_pn-qt4-native = "http://download.qt.io/official_releases/qt/4.8/"
+REGEX_pn-qt4-native = "(?P<pver>\d+(\.\d+)+)/"
+
+# PyPI sites
+REGEX_URI_pn-python-nose = "https://pypi.python.org/pypi/nose/"
+REGEX_pn-python-nose = "/nose/${COMMON_REGEX}"
+# python-distribute 0.7.x is a simple compatibility layer that installs Setuptools 0.7+.
+# so we stick to 0.6.x series
+REGEX_URI_pn-python-distribute = "https://pypi.python.org/pypi/distribute/"
+REGEX_pn-python-distribute = "/distribute/(?P<pver>\d+.6.\d+)"
+REGEX_URI_pn-python-gitdb = "https://pypi.python.org/pypi/gitdb/"
+REGEX_URI_pn-python-async = "https://pypi.python.org/pypi/async/"
+REGEX_URI_pn-python-smmap = "https://pypi.python.org/pypi/smmap/"
+REGEX_pn-python-smmap = "/smmap/${COMMON_REGEX}"
+REGEX_URI_pn-python-git = "https://pypi.python.org/pypi/GitPython/"
+REGEX_pn-python-git = "/GitPython/${COMMON_REGEX}"
+REGEX_URI_pn-python-mako = "https://pypi.python.org/pypi/mako/"
+REGEX_pn-python-mako = "/Mako/${COMMON_REGEX}"
+REGEX_URI_pn-python-pexpect = "https://pypi.python.org/pypi/pexpect"
+REGEX_URI_pn-python3-pip = "https://pypi.python.org/pypi/pip"
+REGEX_URI_pn-python3-setuptools = "https://pypi.python.org/pypi/setuptools"
+
+# Sourceforge sites
+REGEX_URI_pn-python-scons = "http://sourceforge.net/projects/scons/files/scons/"
+REGEX_pn-python-scons = "/scons/${COMMON_REGEX}/"
+REGEX_URI_pn-expect = "http://sourceforge.net/projects/expect/files/Expect/"
+REGEX_pn-expect = "/Expect/${COMMON_REGEX}/"
+REGEX_URI_pn-docbook-xsl-stylesheets = "http://sourceforge.net/projects/docbook/files/docbook-xsl/"
+REGEX_pn-docbook-xsl-stylesheets = "/docbook-xsl/${COMMON_REGEX}/"
+REGEX_URI_pn-glew = "http://sourceforge.net/projects/glew/files/glew"
+REGEX_pn-glew = "/glew/${COMMON_REGEX}/"
+REGEX_URI_pn-menu-cache = "http://sourceforge.net/projects/lxde/files/menu-cache/1.0/"
+REGEX_URI_pn-x11vnc = "http://sourceforge.net/projects/libvncserver/files/x11vnc/"
+REGEX_pn-x11vnc = "/x11vnc/${COMMON_REGEX}/"
+REGEX_URI_pn-quota = "http://sourceforge.net/projects/linuxquota/files/quota-tools/"
+REGEX_pn-quota = "/quota-tools/${COMMON_REGEX}/"
+REGEX_URI_pn-lsb = "http://sourceforge.net/projects/lsb/files/lsb_release/"
+REGEX_pn-lsb = "/lsb_release/${COMMON_REGEX}/"
+REGEX_URI_pn-libpcre = "http://sourceforge.net/projects/pcre/files/pcre/"
+REGEX_pn-libpcre = "/pcre/${COMMON_REGEX}/"
+REGEX_URI_pn-libusb-compat = "http://sourceforge.net/projects/libusb/files/libusb-compat-0.1/"
+REGEX_pn-libusb-compat = "/libusb-compat-${COMMON_REGEX}/$"
+REGEX_URI_pn-sysfsutils = "http://sourceforge.net/projects/linux-diag/files/sysfsutils/"
+REGEX_pn-sysfsutils = "/sysfsutils/${COMMON_REGEX}/"
+REGEX_URI_pn-console-tools = "http://sourceforge.net/projects/lct/files/console-tools-devel/"
+REGEX_pn-console-tools = "/console-tools-devel/(?P<pver>(\d\d?\.)+\d\d?)/"
+REGEX_URI_pn-watchdog = "http://sourceforge.net/projects/watchdog/files/watchdog/"
+REGEX_pn-watchdog = "/watchdog/${COMMON_REGEX}/"
+REGEX_URI_pn-cracklib = "http://sourceforge.net/projects/cracklib/files/cracklib/"
+REGEX_pn-cracklib = "/cracklib/${COMMON_REGEX}/"
+REGEX_URI_pn-gptfdisk = "http://sourceforge.net/projects/gptfdisk/files/gptfdisk/"
+REGEX_pn-gptfdisk = "/gptfdisk/${COMMON_REGEX}/"
+REGEX_URI_pn-libpng12 = "http://sourceforge.net/projects/libpng/files/libpng12/"
+REGEX_pn-libpng12 = "/libpng12/${COMMON_REGEX}/"
+REGEX_URI_pn-docbook-dsssl-stylesheets = "http://sourceforge.net/projects/docbook/files/docbook-dsssl/"
+REGEX_pn-docbook-dsssl-stylesheets = "/docbook-dsssl/${COMMON_REGEX}/"
+
+REGEX_URI_pn-openjade = "http://openjade.sourceforge.net/download.html"
+REGEX_URI_pn-libpfm4 = "http://sourceforge.net/projects/perfmon2/files/libpfm4/"
+REGEX_URI_pn-liba52 = "http://liba52.sourceforge.net/downloads.html"
+REGEX_URI_pn-mpeg2dec = "http://libmpeg2.sourceforge.net/downloads.html"
+REGEX_URI_pn-pcmanfm = "http://sourceforge.net/projects/pcmanfm/files/PCManFM%20%2B%20Libfm%20%28tarball%20release%29/PCManFM/"
+REGEX_URI_pn-libcgroup = "http://sourceforge.net/projects/libcg/files/libcgroup/"
+REGEX_URI_pn-cdrtools = "http://sourceforge.net/projects/cdrtools/files/alpha/"
+
+# GIT
+GITTAGREGEX_COMMON = "(?P<pver>\d+\.\d+(\.\d+)*)"
+
+GITTAGREGEX_pn-linux-yocto = "${GITTAGREGEX_COMMON}"
+GITTAGREGEX_pn-linux-yocto-tiny = "${GITTAGREGEX_COMMON}"
+GITTAGREGEX_pn-linux-yocto-dev = "${GITTAGREGEX_COMMON}"
+GITTAGREGEX_pn-uclibc = "${GITTAGREGEX_COMMON}"
+GITTAGREGEX_pn-glibc = "${GITTAGREGEX_COMMON}"
+GITTAGREGEX_pn-cross-localedef = "${GITTAGREGEX_COMMON}"
+GITTAGREGEX_pn-binutils = "binutils-(?P<pver>\d+_(\d_?)*)"
+GITTAGREGEX_pn-bootchart2 = "${GITTAGREGEX_COMMON}"
+GITTAGREGEX_pn-remake = "(?P<pver>(\d+(\.\d+)+)\+dbg.+)"
+GITTAGREGEX_pn-tcf-agent = "(?P<pver>(\d+(\.\d+)+))"
+GITTAGREGEX_pn-chkconfig-alternatives = "chkconfig-(?P<pver>(\d+(\.\d+)+))"
+GITTAGREGEX_pn-sgmlspl = "(?P<pver>(\d+(\.\d+)+))"
+
+# Exclude x.99.x versions
+GITTAGREGEX_pn-mx-1.0 = "(?P<pver>^\d+(\.(?!99)\d+)+)"
+
+# Blacklist a bogus tag
+GITTAGREGEX_pn-file = "FILE(?P<pver>(?!6_23).+)"
+GITTAGREGEX_pn-xinetd = "xinetd-(?P<pver>(?!20030122).+)"
+
+# Blacklist debian-specific tags
+GITTAGREGEX_pn-xf86-video-omapfb = "(?P<pver>\d+(\.\d+)+)(?!-)"
+
+# GNOME related.
+#
+# GNOME2_STABLE picks stable releases in the 2.x series (so not 2.90 onwards,
+# which were GNOME 3 betas.
+#
+# GNOME_STABLE picks the latest stable release.
+
+GNOME2_STABLE = "(?P<pver>2\.([0-8]*[02468])+(\.\d+)+)"
+GNOME_STABLE = "(?P<pver>\d+\.(\d*[02468])+(\.\d+)+)"
+
+REGEX_pn-glib-2.0 = "${GNOME_STABLE}"
+REGEX_pn-atk = "${GNOME_STABLE}"
+REGEX_pn-at-spi2-core = "${GNOME_STABLE}"
+REGEX_pn-at-spi2-atk = "${GNOME_STABLE}"
+REGEX_pn-gdk-pixbuf = "${GNOME_STABLE}"
+REGEX_pn-pango = "${GNOME_STABLE}"
+REGEX_pn-gtk+ = "${GNOME2_STABLE}"
+REGEX_pn-gtk+3 = "${GNOME_STABLE}"
+REGEX_pn-gtk-engines = "${GNOME2_STABLE}"
+REGEX_pn-glib-networking = "${GNOME_STABLE}"
+REGEX_pn-librsvg = "${GNOME_STABLE}"
+REGEX_pn-libsoup-2.4 = "${GNOME_STABLE}"
+REGEX_pn-vala = "${GNOME_STABLE}"
+REGEX_pn-clutter-1.0 = "${GNOME_STABLE}"
+REGEX_pn-clutter-gtk-1.0 = "${GNOME_STABLE}"
+REGEX_pn-clutter-gst-3.0 = "${GNOME_STABLE}"
+REGEX_pn-cogl-1.0 = "${GNOME_STABLE}"
+REGEX_pn-adwaita-icon-theme = "${GNOME_STABLE}"
+REGEX_pn-vte = "${GNOME_STABLE}"
+REGEX_pn-epiphany = "${GNOME_STABLE}"
+REGEX_pn-webkitgtk = "${GNOME_STABLE}"
+REGEX_pn-p11-kit = "${GNOME_STABLE}"
+REGEX_pn-gnome-desktop3 = "${GNOME_STABLE}"
+
+# not GNOME related but uses same even-minor-release-is-stable logic
+REGEX_pn-dbus = "${GNOME_STABLE}"
+REGEX_pn-dbus-test = "${GNOME_STABLE}"
+
+# same logic applies to gstreamer releases
+REGEX_pn-gstreamer1.0 = "${GNOME_STABLE}"
+REGEX_pn-gstreamer1.0-libav = "${GNOME_STABLE}"
+REGEX_pn-gstreamer1.0-plugins-bad = "${GNOME_STABLE}"
+REGEX_pn-gstreamer1.0-plugins-base = "${GNOME_STABLE}"
+REGEX_pn-gstreamer1.0-plugins-good = "${GNOME_STABLE}"
+REGEX_pn-gstreamer1.0-plugins-ugly = "${GNOME_STABLE}"
+REGEX_pn-gstreamer1.0-rtsp-server = "${GNOME_STABLE}"
+
+# and perl
+REGEX_pn-perl = "${GNOME_STABLE}"
+
+# Keep old gcc versions at their major versions
+REGEX_pn-gcc-source-4.9.3 = "gcc-(?P<pver>4\.9\.\d+).tar"
+REGEX_pn-gcc-source-4.8.4 = "gcc-(?P<pver>4\.8\.\d+).tar"
+
+# these packages are taken from snapshots.debian.org; that source is static and goes stale
+# so we check the latest upstream from a directory that does get updated
+REGEX_URI_pn-apt = "${DEBIAN_MIRROR}/main/a/apt/"
+REGEX_URI_pn-resolvconf = "${DEBIAN_MIRROR}/main/r/resolvconf/"
+REGEX_URI_pn-net-tools = "${DEBIAN_MIRROR}/main/n/net-tools/"
+
+# same for packages from launchpad
+REGEX_URI_pn-base-passwd = "${DEBIAN_MIRROR}/main/b/base-passwd/"
+
+# for these packages we're mostly interested in tracking debian patches,
+# and not in the upstream version where all development has effectively stopped
+DEBIAN_PATCH_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)"
+REGEX_pn-net-tools = "${DEBIAN_PATCH_REGEX}"
+REGEX_pn-apmd = "${DEBIAN_PATCH_REGEX}"
+REGEX_pn-blktool = "${DEBIAN_PATCH_REGEX}"
+REGEX_pn-mailx = "${DEBIAN_PATCH_REGEX}"
diff --git a/meta/conf/distro/include/security_flags.inc b/meta/conf/distro/include/security_flags.inc
new file mode 100644
index 0000000..14ac0bf
--- /dev/null
+++ b/meta/conf/distro/include/security_flags.inc
@@ -0,0 +1,103 @@
+# Setup extra CFLAGS and LDFLAGS which have 'security' benefits. These 
+# don't work universally, there are recipes which can't use one, the other
+# or both so a blacklist is maintained here. The idea would be over
+# time to reduce this list to nothing.
+# From a Yocto Project perspective, this file is included and tested
+# in the DISTRO="poky-lsb" configuration.
+
+# _FORTIFY_SOURCE requires -O1 or higher, so disable in debug builds as they use
+# -O0 which then results in a compiler warning.
+lcl_maybe_fortify = "${@base_conditional('DEBUG_BUILD','1','','-D_FORTIFY_SOURCE=2',d)}"
+
+SECURITY_CFLAGS ?= "-fstack-protector-all -pie -fpie ${lcl_maybe_fortify}"
+SECURITY_NO_PIE_CFLAGS ?= "-fstack-protector-all ${lcl_maybe_fortify}"
+
+SECURITY_LDFLAGS ?= "-Wl,-z,relro,-z,now"
+SECURITY_X_LDFLAGS ?= "-Wl,-z,relro"
+
+# powerpc does not get on with pie for reasons not looked into as yet
+SECURITY_CFLAGS_powerpc = "-fstack-protector-all ${lcl_maybe_fortify}"
+# Deal with ppc specific linker failures when using the cflags
+SECURITY_CFLAGS_pn-dbus_powerpc = ""
+SECURITY_CFLAGS_pn-dbus-ptest_powerpc = ""
+SECURITY_CFLAGS_pn-libmatchbox_powerpc = ""
+
+# arm specific security flag issues
+SECURITY_CFLAGS_pn-lttng-tools_arm = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-aspell = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-beecrypt = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-blktrace = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-coreutils = "${SECURITY_NO_PIE_CFLAGS}"
+# Curl seems to check for FORTIFY_SOURCE in CFLAGS, but even assigned
+# to CPPFLAGS it gets picked into CFLAGS in bitbake.
+#TARGET_CPPFLAGS_pn-curl += "-D_FORTIFY_SOURCE=2"
+SECURITY_CFLAGS_pn-cups = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-curl = "-fstack-protector-all -pie -fpie"
+SECURITY_CFLAGS_pn-db = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-directfb = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-glibc = ""
+SECURITY_CFLAGS_pn-glibc-initial = ""
+SECURITY_CFLAGS_pn-elfutils = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-enchant = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-expect = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-flac = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-flex = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gcc = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gcc-runtime = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gcc-sanitizers = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gdb = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gmp = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gnutls = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-grub = ""
+SECURITY_CFLAGS_pn-grub-efi = ""
+SECURITY_CFLAGS_pn-grub-efi-native = ""
+SECURITY_CFLAGS_pn-grub-efi-x86-native = ""
+SECURITY_CFLAGS_pn-grub-efi-i586-native = ""
+SECURITY_CFLAGS_pn-grub-efi-x86-64-native = ""
+SECURITY_CFLAGS_pn-gst-plugins-bad = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gst-plugins-gl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gstreamer1.0-plugins-bad = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-gstreamer1.0-plugins-good = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-harfbuzz = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-kexec-tools = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-iptables = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libaio = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libcap = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libgcc = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libid3tag = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libnewt = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libglu = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libpcap = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libpcre = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-libproxy = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-lttng-ust = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-mesa = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-mesa-gl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-openssl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-opensp = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-ppp = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python-imaging = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python-pycurl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python-smartpm = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python-numpy = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-python3 = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-tcl = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-tiff = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-valgrind = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-zlib = "${SECURITY_NO_PIE_CFLAGS}"
+
+# These 2 have text relco errors with the pie options enabled
+SECURITY_CFLAGS_pn-ltp = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-pulseaudio = "${SECURITY_NO_PIE_CFLAGS}"
+
+TARGET_CFLAGS_append = " ${SECURITY_CFLAGS}"
+TARGET_LDFLAGS_append = " ${SECURITY_LDFLAGS}"
+
+SECURITY_LDFLAGS_pn-xf86-video-fbdev = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xf86-video-intel = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xf86-video-omapfb = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xf86-video-omap = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xf86-video-vesa = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xf86-video-vmware = "${SECURITY_X_LDFLAGS}"
+SECURITY_LDFLAGS_pn-xserver-xorg = "${SECURITY_X_LDFLAGS}"
diff --git a/meta/conf/distro/include/tclibc-baremetal.inc b/meta/conf/distro/include/tclibc-baremetal.inc
new file mode 100644
index 0000000..a8ce6d3
--- /dev/null
+++ b/meta/conf/distro/include/tclibc-baremetal.inc
@@ -0,0 +1,32 @@
+#
+# baremetal configuration
+#
+
+LIBCEXTENSION = ""
+
+# Add baremetal libc overrides to the overrides.
+LIBCOVERRIDE = ":libc-baremetal"
+OVERRIDES .= "${LIBCOVERRIDE}"
+
+ASSUME_PROVIDED += "virtual/libc virtual/libiconv"
+
+PREFERRED_PROVIDER_virtual/libc ?= "musl"
+PREFERRED_PROVIDER_virtual/libiconv ?= "musl"
+PREFERRED_PROVIDER_virtual/libintl ?= "gettext"
+PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc"
+
+USE_NLS ?= "no"
+IMAGE_LINGUAS = ""
+LIBC_DEPENDENCIES = ""
+
+EXTRA_OECONF_pn-gcc-cross-${TARGET_ARCH}_append = " --without-headers"
+DEPENDS_remove_pn-meta-toolchain = "virtual/libc virtual/${TARGET_PREFIX}compilerlibs"
+
+TARGET_OS = "elf"
+TARGET_OS_arm = "eabi"
+
+TOOLCHAIN_HOST_TASK ?= "packagegroup-cross-canadian-${MACHINE}"
+TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
+TOOLCHAIN_TARGET_TASK ?= "libgcc-dev"
+TOOLCHAIN_NEED_CONFIGSITE_CACHE_remove = "virtual/${MLPREFIX}libc zlib ncurses"
diff --git a/meta/conf/distro/include/tclibc-glibc.inc b/meta/conf/distro/include/tclibc-glibc.inc
new file mode 100644
index 0000000..649918f
--- /dev/null
+++ b/meta/conf/distro/include/tclibc-glibc.inc
@@ -0,0 +1,40 @@
+#
+# glibc specific configuration
+#
+
+LIBCEXTENSION = "${@['', '-gnu'][(d.getVar('ABIEXTENSION', True) or '') != '']}"
+
+# Add glibc overrides to the overrides for glibc.
+LIBCOVERRIDE = ":libc-glibc"
+OVERRIDES .= "${LIBCOVERRIDE}"
+
+PREFERRED_PROVIDER_virtual/libiconv ?= "glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/libintl ?= "glibc"
+PREFERRED_PROVIDER_virtual/libc ?= "glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libc ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/libc-locale ?= "glibc-locale"
+
+CXXFLAGS += "-fvisibility-inlines-hidden"
+
+LIBC_DEPENDENCIES = "libsegfault \
+		     glibc \
+		     glibc-dbg \
+		     glibc-dev \
+		     glibc-utils \
+		     glibc-thread-db \
+		     ${@get_libc_locales_dependencies(d)}"
+
+LIBC_LOCALE_DEPENDENCIES = "\
+	glibc-localedata-i18n \
+	glibc-gconv-ibm850 \
+	glibc-gconv-cp1252 \
+	glibc-gconv-iso8859-1 \
+	glibc-gconv-iso8859-15"
+
+def get_libc_locales_dependencies(d):
+    if 'libc-locales' in (d.getVar('DISTRO_FEATURES', True) or '').split() :
+        return d.getVar('LIBC_LOCALE_DEPENDENCIES', True) or ''
+    else:
+        return ''
diff --git a/meta/conf/distro/include/tclibc-musl.inc b/meta/conf/distro/include/tclibc-musl.inc
new file mode 100644
index 0000000..1ddd58e
--- /dev/null
+++ b/meta/conf/distro/include/tclibc-musl.inc
@@ -0,0 +1,27 @@
+#
+# musl specific configuration
+#
+
+LIBCEXTENSION = "-musl"
+
+# Add uclibc overrides to the overrides.
+LIBCOVERRIDE = ":libc-musl"
+OVERRIDES .= "${LIBCOVERRIDE}"
+
+PREFERRED_PROVIDER_virtual/libc ?= "musl"
+PREFERRED_PROVIDER_virtual/libiconv ?= "musl"
+PREFERRED_PROVIDER_virtual/libintl ?= "musl"
+PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc"
+
+#USE_NLS ?= "no"
+
+CXXFLAGS += "-fvisibility-inlines-hidden"
+
+IMAGE_LINGUAS = ""
+
+LIBC_DEPENDENCIES = "\
+    musl \
+    musl-dbg \
+    musl-dev \
+    "
diff --git a/meta/conf/distro/include/tclibc-uclibc.inc b/meta/conf/distro/include/tclibc-uclibc.inc
new file mode 100644
index 0000000..14c3cdb
--- /dev/null
+++ b/meta/conf/distro/include/tclibc-uclibc.inc
@@ -0,0 +1,28 @@
+#
+# uclibc specific configuration
+#
+
+LIBCEXTENSION = "-uclibc"
+
+# Add uclibc overrides to the overrides.
+LIBCOVERRIDE = ":libc-uclibc"
+OVERRIDES .= "${LIBCOVERRIDE}"
+
+PREFERRED_PROVIDER_virtual/libc ?= "uclibc"
+PREFERRED_PROVIDER_virtual/libiconv ?= "libiconv"
+PREFERRED_PROVIDER_virtual/libintl ?= "gettext"
+PREFERRED_PROVIDER_virtual/nativesdk-libintl ?= "nativesdk-glibc"
+PREFERRED_PROVIDER_virtual/nativesdk-libiconv ?= "nativesdk-glibc"
+
+USE_NLS ?= "no"
+
+CXXFLAGS += "-fvisibility-inlines-hidden"
+
+IMAGE_LINGUAS = ""
+
+LIBC_DEPENDENCIES = "\
+    uclibc \
+    uclibc-dbg \
+    uclibc-dev \
+    uclibc-thread-db \
+    "
diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc
new file mode 100644
index 0000000..f205524
--- /dev/null
+++ b/meta/conf/distro/include/tcmode-default.inc
@@ -0,0 +1,75 @@
+#
+# Default toolchain configuration
+#
+
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}binutils = "binutils-cross-${TARGET_ARCH}"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc-initial = "gcc-cross-initial-${TARGET_ARCH}"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}gcc = "gcc-cross-${TARGET_ARCH}"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++ = "gcc-cross-${TARGET_ARCH}"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs = "gcc-runtime"
+PREFERRED_PROVIDER_gdb = "gdb"
+
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}binutils-crosssdk ?= "binutils-crosssdk-${SDK_ARCH}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}gcc-initial = "gcc-crosssdk-initial-${SDK_ARCH}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}gcc = "gcc-crosssdk-${SDK_ARCH}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}g++ = "gcc-crosssdk-${SDK_ARCH}"
+PREFERRED_PROVIDER_virtual/${SDK_PREFIX}compilerlibs = "nativesdk-gcc-runtime"
+
+# Default libc config
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "${TCLIBC}"
+PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-for-gcc ?= "nativesdk-${TCLIBC}"
+PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "${TCLIBC}-initial"
+PREFERRED_PROVIDER_virtual/nativesdk-${SDK_PREFIX}libc-initial = "nativesdk-${TCLIBC}-initial"
+PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
+
+GCCVERSION ?= "5.%"
+SDKGCCVERSION ?= "${GCCVERSION}"
+BINUVERSION ?= "2.25%"
+GDBVERSION ?= "7.9%"
+GLIBCVERSION ?= "2.22"
+UCLIBCVERSION ?= "0.9.33+git%"
+LINUXLIBCVERSION ?= "4.1"
+
+PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-cross-initial-${TARGET_ARCH} ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-crosssdk-${SDK_ARCH} ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_gcc-crosssdk-initial-${SDK_ARCH} ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_gcc-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-runtime ?= "${GCCVERSION}"
+PREFERRED_VERSION_gcc-sanitizers ?= "${GCCVERSION}"
+PREFERRED_VERSION_nativesdk-gcc-runtime ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_nativesdk-gcc-sanitizers ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_libgcc ?= "${GCCVERSION}"
+PREFERRED_VERSION_libgcc-initial ?= "${GCCVERSION}"
+PREFERRED_VERSION_nativesdk-gcc ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_nativesdk-libgcc ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_nativesdk-libgcc-initial ?= "${SDKGCCVERSION}"
+PREFERRED_VERSION_binutils ?= "${BINUVERSION}"
+PREFERRED_VERSION_binutils-native ?= "${BINUVERSION}"
+PREFERRED_VERSION_binutils-cross-${TARGET_ARCH} ?= "${BINUVERSION}"
+PREFERRED_VERSION_binutils-crosssdk-${SDK_ARCH} ?= "${BINUVERSION}"
+PREFERRED_VERSION_binutils-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${BINUVERSION}"
+PREFERRED_VERSION_gdb ?= "${GDBVERSION}"
+PREFERRED_VERSION_gdb-cross-${TARGET_ARCH} ?= "${GDBVERSION}"
+PREFERRED_VERSION_gdb-cross-canadian-${TRANSLATED_TARGET_ARCH} ?= "${GDBVERSION}"
+
+PREFERRED_VERSION_linux-libc-headers ?= "${LINUXLIBCVERSION}"
+PREFERRED_VERSION_nativesdk-linux-libc-headers ?= "${LINUXLIBCVERSION}"
+PREFERRED_VERSION_glibc                    ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_glibc-locale             ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_glibc-mtrace             ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_glibc-scripts            ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_nativesdk-glibc          ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_glibc-initial            ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_nativesdk-glibc-initial  ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_cross-localedef-native   ?= "${GLIBCVERSION}"
+PREFERRED_VERSION_uclibc                   ?= "${UCLIBCVERSION}"
+PREFERRED_VERSION_uclibc-initial           ?= "${UCLIBCVERSION}"
+# don't use version earlier than 1.4 for gzip-native, as it's necessary for
+# some packages using an archive format incompatible with earlier gzip
+PREFERRED_VERSION_gzip-native ?= "1.6"
+
+# Setup suitable toolchain flags
+require conf/distro/include/as-needed.inc
+
diff --git a/meta/conf/distro/include/upstream_tracking.inc b/meta/conf/distro/include/upstream_tracking.inc
new file mode 100644
index 0000000..e2a5e6c
--- /dev/null
+++ b/meta/conf/distro/include/upstream_tracking.inc
@@ -0,0 +1,24 @@
+# NOTE: THIS FILE IS DEPRECATED. Please add new entries to the recipes themselves.
+#
+# upstream_tracking.inc - This file contains data that tracks the
+# upstream project associated with a given recipe. This list is needed
+# for recipes that version information can not be automagically discovered.
+# As we automate this checking, this file will slowed be reduced.
+#
+# This data is used by the package reporting system (packages.yoctoproject.org)
+#
+# The format is as a bitbake variable override for each recipe
+#
+#       RECIPE_UPSTREAM_VERSION_pn-<recipe name> = "<version>"
+#       RECIPE_UPSTREAM_DATE_pn-<recipe name> = "Mmm dd, YYYY"
+#	 - This is the latest upstream version and date
+#       RECIPE_NO_UPDATE_REASON_pn-<recipe name> = "<free form text>"
+#        - Used to note why a recipe should not be upgraded to a newer versoin
+#       CHECK_DATE_pn-<recipe name> = "Mmm dd, YYYY"
+#        - This is the date that upstream was last manually checked over time
+#          this should be removed as we automate this checking
+#
+# These entries will slowly be removed as we can automatically determine
+# the information in this file.  So for existing recipes that we can get 
+# from the Recipe reporting system, the entries here can be removed.
+#
diff --git a/meta/conf/distro/include/world-broken.inc b/meta/conf/distro/include/world-broken.inc
new file mode 100644
index 0000000..ab0c2dc
--- /dev/null
+++ b/meta/conf/distro/include/world-broken.inc
@@ -0,0 +1,5 @@
+#
+# Exclude known broken packages
+#
+
+
diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
new file mode 100644
index 0000000..075ab6a
--- /dev/null
+++ b/meta/conf/documentation.conf
@@ -0,0 +1,459 @@
+# this file holds documentation for known keys, possible values and
+# their meanings. Please update, correct and extend this documentation.
+# Mail your changes to openembedded-devel@openembedded.org
+
+# DESCRIPTIONS FOR TASKS #
+
+do_bootimg[doc] = "Creates a bootable live image"
+do_build[doc] = "Default task for a recipe - depends on all other normal tasks required to 'build' a recipe"
+do_bundle_initramfs[doc] = "Combines an initial ramdisk image and kernel together to form a single image"
+do_checkuri[doc] = "Validates the SRC_URI value"
+do_checkuriall[doc] = "Validates the SRC_URI value for all recipes required to build a target"
+do_clean[doc] = "Removes all output files for a target"
+do_cleanall[doc] = "Removes all output files, shared state cache, and downloaded source files for a target"
+do_cleansstate[doc] = "Removes all output files and shared state cache for a target"
+do_compile[doc] = "Compiles the source in the compilation directory"
+do_compile_kernelmodules[doc] = "Compiles loadable modules for the Linux kernel"
+do_compile_ptest_base[doc] = "Compiles the runtime test suite included in the software being built"
+do_configure[doc] = "Configures the source by enabling and disabling any build-time and configuration options for the software being built"
+do_configure_ptest_base[doc] = "Configures the runtime test suite included in the software being built"
+do_deploy[doc] = "Writes deployable output files to the deploy directory"
+do_devpyshell[doc] = "Starts an interactive Python shell for development/debugging"
+do_devshell[doc] = "Starts a shell with the environment set up for development/debugging"
+do_diffconfig[doc] = "Compares the old and new config files after running do_menuconfig for the kernel"
+do_fetch[doc] = "Fetches the source code"
+do_fetchall[doc] = "Fetches all remote sources required to build a target"
+do_generate_qt_config_file[doc] = "Writes a qt.conf file for building a Qt-based application"
+do_install[doc] = "Copies files from the compilation directory to a holding area"
+do_install_ptest_base[doc] = "Copies the runtime test suite files from the compilation directory to a holding area"
+do_kernel_checkout[doc] = "Checks out source/meta branches for a linux-yocto style kernel"
+do_kernel_configcheck[doc] = "Validates the kernel configuration for a linux-yocto style kernel"
+do_kernel_configme[doc] = "Assembles the kernel configuration for a linux-yocto style kernel"
+do_kernel_link_vmlinux[doc] = "Creates a symbolic link in arch/$arch/boot for vmlinux kernel images"
+do_listtasks[doc] = "Lists all defined tasks for a target"
+do_menuconfig[doc] = "Runs 'make menuconfig' for the kernel"
+do_package[doc] = "Analyzes the content of the holding area and splits it into subsets based on available packages and files"
+do_package_index[doc] = "Creates or updates the index in the Package Feed area"
+do_package_qa[doc] = "Runs QA checks on packaged files"
+do_package_write_deb[doc] = "Creates the actual DEB packages and places them in the Package Feed area"
+do_package_write_ipk[doc] = "Creates the actual IPK packages and places them in the Package Feed area"
+do_package_write_rpm[doc] = "Creates the actual RPM packages and places them in the Package Feed area"
+do_package_write_tar[doc] = "Creates tar archives for packages and places them in the Package Feed area"
+do_packagedata[doc] = "Creates package metadata used by the build system to generate the final packages"
+do_patch[doc] = "Locates patch files and applies them to the source code"
+do_populate_lic[doc] = "Writes license information for the recipe that is collected later when the image is constructed"
+do_populate_sdk[doc] = "Creates the file and directory structure for an installable SDK"
+do_populate_sysroot[doc] = "Copies a subset of files installed by do_install into the sysroot in order to make them available to other recipes"
+do_rm_work[doc] = "Removes work files after the build system has finished with them"
+do_rm_work_all[doc] = "Top-level task for removing work files after the build system has finished with them"
+do_rootfs[doc] = "Creates the root filesystem (file and directory structure) for an image"
+do_savedefconfig[doc] = "Creates a minimal Linux kernel configuration file"
+do_sizecheck[doc] = "Checks the size of the kernel image against KERNEL_IMAGE_MAXSIZE (if set)"
+do_spdx[doc] = "A build stage that takes the source code and scans it on a remote FOSSOLOGY server in order to produce an SPDX document"
+do_strip[doc] = "Strips unneeded sections out of the Linux kernel image"
+do_testimage[doc] = "Boots an image and performs runtime tests within the image"
+do_testimage_auto[doc] = "Boots an image and performs runtime tests within the image immediately after it has been built"
+do_testsdk[doc] = "Installs an SDK and performs runtime tests on the tools installed by it"
+do_uboot_mkimage[doc] = "Creates a uImage file from the kernel for the U-Boot bootloader"
+do_unpack[doc] = "Unpacks the source code into a working directory"
+do_validate_branches[doc] = "Ensures that the source/meta branches are on the locations specified by their SRCREV values for a linux-yocto style kernel"
+do_vmimg[doc] = "Creates an image for use with VMware or VirtualBox compatible virtual machine hosts (based on IMAGE_FSTYPES either .vmdk or .vdi)"
+
+# DESCRIPTIONS FOR VARIABLES #
+
+#A
+
+ALLOW_EMPTY[doc] = "Specifies if an output package should still be produced if it is empty."
+ALTERNATIVE[doc] = "Lists commands in a package that need an alternative binary naming scheme."
+ALTERNATIVE_LINK_NAME[doc] = "Used by the alternatives system to map duplicated commands to actual locations."
+ALTERNATIVE_PRIORITY[doc] = "Used by the alternatives system to create default priorities for duplicated commands."
+ALTERNATIVE_TARGET[doc] = "Used by the alternatives system to create default link locations for duplicated commands."
+ASSUME_PROVIDED[doc] = "List of packages (recipes actually) that are assumed to be implicitly available. BitBake does not build these packages."
+ASSUME_SHLIBS[doc] = "List of shlib:package[_version] mappings. Useful for lib packages in ASSUME_PROVIDED, for which automatic shlib dependency tracking does not work."
+AUTHOR[doc] = "Email address used to contact the original author(s) in order to send patches and forward bugs."
+AUTO_SYSLINUXMENU[doc] = "Enables creating an automatic menu for the syslinux bootloader."
+AUTOREV[doc] = "When SRCREV is set to the value of this variable, it specifies to use the latest source revision in the repository."
+
+#B
+
+B[doc] = "The Build Directory. The OpenEmbedded build system places generated objects into the Build Directory during a recipe's build process."
+BAD_RECOMMENDATIONS[doc] = "A list of packages not to install despite being recommended by a recipe. Support for this variable exists only when using the IPK or RPM packaging backends."
+BB_DANGLINGAPPENDS_WARNONLY[doc] = "Defines how BitBake handles situations where an append file (.bbappend) has no corresponding recipe file (.bb)."
+BB_DISKMON_DIRS[doc] = "Monitors disk space and available inodes during the build and allows you to control the build based on these parameters."
+BB_DISKMON_WARNINTERVAL[doc] = "Defines the disk space and free inode warning intervals. To set these intervals, define the variable in the conf/local.conf file in the Build Directory."
+BB_GENERATE_MIRROR_TARBALLS[doc] = "Causes tarballs of the Git repositories to be placed in the DL_DIR directory."
+BB_NUMBER_THREADS[doc] = "The maximum number of tasks BitBake should run in parallel at any one time. A good rule of thumb is to set this variable to twice the number of cores."
+BBCLASSEXTEND[doc] = "Allows you to extend a recipe so that it builds variants of the software. Common variants for recipes are 'native', 'cross', 'nativesdk' and multilibs."
+BBFILE_COLLECTIONS[doc] = "Lists the names of configured layers. These names are used to find the other BBFILE_* variables."
+BBFILE_PATTERN[doc] = "Variable that expands to match files from BBFILES in a particular layer. This variable is used in the layer.conf file and must be suffixed with the name of a layer."
+BBFILE_PRIORITY[doc] = "Assigns the priority for recipe files in each layer. Setting this variable allows you to prioritize a layer against other layers that contain the same recipe."
+BBFILES[doc] = "List of recipe files used by BitBake to build software."
+BBINCLUDELOGS[doc] = "Variable that controls how BitBake displays logs on build failure."
+BBINCLUDELOGS_LINES[doc] = "Amount of log lines printed on failure."
+BBLAYERS[doc] = "Lists the layers to enable during the build. This variable is defined in the bblayers.conf configuration file."
+BBLAYERS_NON_REMOVABLE[doc] = "Lists core layers that cannot be removed from the bblayers.conf file."
+BBMASK[doc] = "Prevents BitBake from processing specific recipes or recipe append files. Use the BBMASK variable from within conf/local.conf."
+BBPATH[doc] = "Used by BitBake to locate .bbclass and configuration files. This variable is analogous to the PATH variable."
+BBSERVER[doc] = "Points to the server that runs memory-resident BitBake."
+BINCONFIG_GLOB[doc] = "When inheriting binconfig.bbclass from a recipe, this variable specifies a wildcard for configuration scripts that need editing."
+BP[doc] = "The base recipe name and version but without any special recipe name suffix (i.e. -native, lib64-, and so forth). BP is comprised of ${BPN}-${PV}"
+BPN[doc] = "The bare name of the recipe. This variable is a version of the PN variable but removes common suffixes and prefixes."
+BUGTRACKER[doc] = "Specifies a URL for an upstream bug tracking website for a recipe."
+BUILD_ARCH[doc] = "The name of the building architecture (e.g. i686)."
+BUILD_OS[doc] = "The operating system (in lower case) of the building architecture (e.g. linux)."
+BUILDDIR[doc] = "Points to the location of the Build Directory."
+BUILDSTATS_BASE[doc] = "Points to the location of the directory that holds build statistics when you use and enable the buildstats class."
+BUSYBOX_SPLIT_SUID[doc] = "For the BusyBox recipe, specifies whether to split the output executable file into two parts: one for features that require setuid root, and one for the remaining features."
+
+#C
+
+CACHE[doc]  = "The directory holding the cache of the metadata."
+CFLAGS[doc] = "Flags passed to the C compiler for the target system. This variable evaluates to the same as TARGET_CFLAGS."
+CLASSOVERRIDE[doc] = "An internal variable specifying the special class override that should currently apply (e.g. "class-target", "class-native", and so forth)."
+CLEANBROKEN[doc] = "Specifies if 'make clean' does not work for a recipe (and therefore the build system should not try to use it during do_configure)"
+COMBINED_FEATURES[doc] = "A set of features common between MACHINE_FEATURES and DISTRO_FEATURES."
+COMMON_LICENSE_DIR[doc] = "Points to meta/files/common-licenses in the Source Directory, which is where generic license files reside."
+COMPATIBLE_HOST[doc] = "A regular expression that resolves to one or more hosts (when the recipe is native) or one or more targets (when the recipe is non-native) with which a recipe is compatible."
+COMPATIBLE_MACHINE[doc] = "A regular expression that resolves to one or more target machines with which a recipe is compatible."
+COMPLEMENTARY_GLOB[doc] = "Defines wildcards to match when installing a list of complementary packages for all the packages installed in an image."
+CONFFILES[doc] = "Identifies editable or configurable files that are part of a package."
+CONFIG_SITE[doc] = "A list of files that contains autoconf test results relevant to the current build. This variable is used by the Autotools utilities when running configure."
+CONFLICT_DISTRO_FEATURES[doc] = "When a recipe inherits the distro_features_check class, this variable identifies distribution features that would be in conflict should the recipe be built."
+CORE_IMAGE_EXTRA_INSTALL[doc] = "Specifies the list of packages to be added to the image. You should only set this variable in the conf/local.conf file in the Build Directory."
+COREBASE[doc] = "Specifies the parent directory of the OpenEmbedded Core Metadata layer (i.e. meta)."
+CONF_VERSION[doc] = "Tracks the version of local.conf.  Increased each time build/conf/ changes incompatibly."
+CVSDIR[doc] = "The directory where cvs checkouts will be stored in."
+
+#D
+
+D[doc] = "The destination directory."
+DATE[doc] = "The date the build was started using YMD format."
+DATETIME[doc] = "The date and time the build was started."
+DEBUG_BUILD[doc] = "Specifies to build packages with debugging information. This influences the value of the SELECTED_OPTIMIZATION variable."
+DEBUG_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and CFLAGS when compiling a system for debugging. This variable defaults to '-O -fno-omit-frame-pointer -g'."
+DEFAULT_PREFERENCE[doc] = "Specifies a weak bias for recipe selection priority."
+DEPENDS[doc] = "Lists a recipe's build-time dependencies (i.e. other recipe files)."
+DEPLOY_DIR[doc] = "Points to the general area that the OpenEmbedded build system uses to place images, packages, SDKs and other output files that are ready to be used outside of the build system."
+DEPLOY_DIR_IMAGE[doc] = "Points to the area that the OpenEmbedded build system uses to place images and other associated output files that are ready to be deployed onto the target machine."
+DEPLOYDIR[doc] = "For recipes that inherit the deploy class, the DEPLOYDIR points to a temporary work area for deployed files."
+DESCRIPTION[doc] = "The package description used by package managers. If not set, DESCRIPTION takes the value of the SUMMARY variable."
+DISTRO[doc] = "The short name of the distribution. If the variable is blank, meta/conf/distro/defaultsetup.conf will be used."
+DISTRO_EXTRA_RDEPENDS[doc] = "Specifies a list of distro-specific packages to add to all images. The variable only applies to the images that include packagegroup-base."
+DISTRO_EXTRA_RRECOMMENDS[doc] = "Specifies a list of distro-specific packages to add to all images if the packages exist. The list of packages are automatically installed but you can remove them."
+DISTRO_FEATURES[doc] = "The features enabled for the distribution."
+DISTRO_FEATURES_BACKFILL[doc] = "Features to be added to DISTRO_FEATURES if not also present in DISTRO_FEATURES_BACKFILL_CONSIDERED. This variable is set in the meta/conf/bitbake.conf file and it is not intended to be user-configurable."
+DISTRO_FEATURES_BACKFILL_CONSIDERED[doc] = "Features from DISTRO_FEATURES_BACKFILL that should not be backfilled (i.e. added to DISTRO_FEATURES) during the build."
+DISTRO_NAME[doc] = "The long name of the distribution."
+DISTRO_PN_ALIAS[doc] = "Alias names used for the recipe in various Linux distributions."
+DISTRO_VERSION[doc] = "The version of the distribution."
+DISTROOVERRIDES[doc] = "Lists overrides specific to the current distribution. By default, the variable list includes the value of the DISTRO variable."
+DL_DIR[doc] = "The central download directory used by the build process to store downloads. By default, the directory is 'downloads' in the Build Directory."
+
+#E
+
+ENABLE_BINARY_LOCALE_GENERATION[doc] = "Controls which locales for glibc are generated during the build. The variable is useful if the target device has 64Mbytes of RAM or less."
+ERROR_QA[doc] = "Specifies the quality assurance checks whose failures are reported as errors by the OpenEmbedded build system."
+EXCLUDE_FROM_WORLD[doc] = "Directs BitBake to exclude a recipe from world builds (i.e. bitbake world)."
+EXTENDPE[doc] = "Used with file and pathnames to create a prefix for a recipe's version based on the recipe's PE value. If PE is set and greater than zero for a recipe, EXTENDPE becomes that value."
+EXTENDPKGV[doc] = "The full package version specification as it appears on the final packages produced by a recipe."
+EXTERNALSRC[doc] = "If externalsrc.bbclass is inherited, this variable points to the source tree, which is outside of the OpenEmbedded build system."
+EXTERNALSRC_BUILD[doc] = "If externalsrc.bbclass is inherited, this variable points to the directory in which the recipe's source code is built, which is outside of the OpenEmbedded build system."
+EXTRA_IMAGE_FEATURES[doc] = "The list of additional features to include in an image. Configure this variable in the conf/local.conf file in the Build Directory."
+EXTRA_IMAGEDEPENDS[doc] = "A list of recipes to build that do not provide packages for installing into the root filesystem. Use this variable to list recipes that are required to build the final image, but not needed in the root filesystem."
+EXTRA_OECMAKE[doc] = "Additional cmake options."
+EXTRA_OECONF[doc] = "Additional configure script options."
+EXTRA_OEMAKE[doc] = "Additional GNU make options."
+EXTRA_OESCONS[doc] = "When a recipe inherits the scons class, this variable specifies additional configuration options you want to pass to the scons command line."
+EXTRA_QMAKEVARS_POST[doc] = "Configuration variables or options you want to pass to qmake when the arguments need to be after the .pro file list on the command line."
+EXTRA_QMAKEVARS_PRE[doc] = "Configuration variables or options you want to pass to qmake when the arguments need to be before the .pro file list on the command line."
+EXTRA_USERS_PARAMS[doc] = "When a recipe inherits the extrausers class, this variable provides image level user and group operations."
+
+#F
+
+FEED_DEPLOYDIR_BASE_URI[doc] = "Allow to serve ipk deploy directory as an ad hoc feed (bogofeed). Set to base URL of the directory as exported by HTTP. Set of ad hoc feed configs will be generated in the image."
+FILES[doc] = "The list of directories or files that are placed in packages."
+FILESEXTRAPATHS[doc] = "Extends the search path the OpenEmbedded build system uses when looking for files and patches as it processes recipes and append files."
+FILESOVERRIDES[doc] = "A subset of OVERRIDES used by the OpenEmbedded build system for creating FILESPATH."
+FILESPATH[doc] = "The default set of directories the OpenEmbedded build system uses when searching for patches and files. It is defined in the base.bbclass class found in meta/classes in the Source Directory. Do not hand-edit the FILESPATH variable."
+FILESYSTEM_PERMS_TABLES[doc] = "Allows you to define your own file permissions settings table as part of your configuration for the packaging process."
+FONT_EXTRA_RDEPENDS[doc] = "When a recipe inherits the fontcache class, this variable specifies runtime dependencies for font packages. This variable defaults to 'fontconfig-utils'."
+FONT_PACKAGES[doc] = "When a recipe inherits the fontcache class, this variable identifies packages containing font files that need to be cached by Fontconfig."
+FULL_OPTIMIZATION[doc]= "The options to pass in TARGET_CFLAGS and CFLAGS when compiling an optimized system. This variable defaults to '-fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2'."
+
+#G
+
+GITDIR[doc] = "The directory where Git clones will be stored."
+GROUPADD_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should be passed to the groupadd command if you wish to add a group to the system when the package is installed."
+GROUPMEMS_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should be passed to the groupmems command if you wish to modify the members of a group when the package is installed."
+GRUB_GFXSERIAL[doc] = "Configures the GNU GRand Unified Bootloader (GRUB) to have graphics and serial in the boot menu."
+GRUB_OPTS[doc] = "Additional options to add to the GNU GRand Unified Bootloader (GRUB) configuration."
+GRUB_TIMEOUT[doc] = "Specifies the timeout before executing the default LABEL in the GNU GRand Unified Bootloader (GRUB)."
+GTKIMMODULES_PACKAGES[doc] = "For recipes that inherit the gtk-immodules-cache class, this variable specifies the packages that contain the GTK+ input method modules being installed when the modules are in packages other than the main package."
+
+#H
+
+HOMEPAGE[doc] = "Website where more information about the software the recipe is building can be found."
+HOST_ARCH[doc] = "The name of the target architecture. Normally same as the TARGET_ARCH."
+HOST_CC_ARCH[doc] = "The name of the host architecture. Normally same as the TARGET_CC_ARCH."
+HOST_OS[doc] = "The name of the target operating system. Normally the same as the TARGET_OS."
+HOST_PREFIX[doc] = "The prefix for the cross compile toolchain. Normally same as the TARGET_PREFIX."
+HOST_SYS[doc] = "Specifies the system, including the architecture and the operating system, for with the build is occurring in the context of the current recipe."
+HOST_VENDOR[doc] = "The name of the vendor. Normally same as the TARGET_VENDOR."
+
+#I
+
+ICECC_ENV_EXEC[doc] = "Points to the icecc-create-env script that you provide."
+ICECC_PATH[doc] = "The location of the icecc binary."
+ICECC_USER_CLASS_BL[doc] = "Identifies user classes that you do not want the Icecream distributed compile support to consider."
+ICECC_USER_PACKAGE_BL[doc] = "Identifies user recipes that you do not want the Icecream distributed compile support to consider."
+ICECC_USER_PACKAGE_WL[doc] = "Identifies user recipes that use an empty PARALLEL_MAKE variable that you want to force remote distributed compilation on using the Icecream distributed compile support."
+IMAGE_BASENAME[doc] = "The base name of image output files."
+IMAGE_BOOT_FILES[doc] = "Whitespace separated list of files from ${DEPLOY_DIR_IMAGE} to place in boot partition. Entries will be installed under a same name as the source file. To change the destination file name, pass a desired name after a semicolon (eg. u-boot.img;uboot)."
+IMAGE_CLASSES[doc] = "A list of classes that all images should inherit."
+IMAGE_FEATURES[doc] = "The primary list of features to include in an image. Configure this variable in an image recipe."
+IMAGE_FSTYPES[doc] = "Formats of root filesystem images that you want to have created."
+IMAGE_INSTALL[doc] = "Specifies the packages to install into an image. Image recipes set IMAGE_INSTALL to specify the packages to install into an image through image.bbclass."
+IMAGE_LINGUAS[doc] = "Specifies the list of locales to install into the image during the root filesystem construction process."
+IMAGE_NAME[doc] = "The name of the output image files minus the extension."
+IMAGE_OVERHEAD_FACTOR[doc] = "Defines a multiplier that the build system applies to the initial image size for cases when the multiplier times the returned disk usage value for the image is greater than the sum of IMAGE_ROOTFS_SIZE and IMAGE_ROOTFS_EXTRA_SPACE."
+IMAGE_PKGTYPE[doc] = "Defines the package type (DEB, RPM, IPK, or TAR) used by the OpenEmbedded build system."
+IMAGE_POSTPROCESS_COMMAND[doc] = "Added by classes to run post processing commands once the OpenEmbedded build system has created the image."
+IMAGE_ROOTFS[doc] = "The location of the root filesystem while it is under construction (i.e. during do_rootfs)."
+IMAGE_ROOTFS_EXTRA_SPACE[doc] = "Defines additional free disk space created in the image in Kbytes. By default, this variable is set to '0'."
+IMAGE_ROOTFS_SIZE[doc] = "Defines the size in Kbytes for the generated image."
+IMAGE_TYPES[doc] = "Specifies the complete list of supported image types by default."
+INC_PR[doc] = "Helps define the recipe revision for recipes that share a common include file."
+INCOMPATIBLE_LICENSE[doc] = "Specifies a space-separated list of license names (as they would appear in LICENSE) that should be excluded from the build. Wildcard is supported, such as '*GPLv3'"
+INHIBIT_DEFAULT_DEPS[doc] = "Prevents the default dependencies, namely the C compiler and standard C library (libc), from being added to DEPENDS."
+INHIBIT_PACKAGE_STRIP[doc] = "If set to "1", causes the build to not strip binaries in resulting packages."
+INHERIT[doc] = "Causes the named class to be inherited at this point during parsing. The variable is only valid in configuration files."
+INHERIT_DISTRO[doc] = "Lists classes that will be inherited at the distribution level. It is unlikely that you want to edit this variable."
+INITRAMFS_FSTYPES[doc] = "Defines the format for the output image of an initial RAM disk (initramfs), which is used during boot."
+INITRD[doc] = "Indicates a list of filesystem images to concatenate and use as an initial RAM disk (initrd)."
+INITSCRIPT_NAME[doc] = "The filename of the initialization script as installed to ${sysconfdir}/init.d."
+INITSCRIPT_PACKAGES[doc] = "A list of the packages that contain initscripts. This variable is used in recipes when using update-rc.d.bbclass. The variable is optional and defaults to the PN variable."
+INITSCRIPT_PARAMS[doc] = "Specifies the options to pass to update-rc.d. The variable is mandatory and is used in recipes when using update-rc.d.bbclass."
+INSANE_SKIP[doc] = "Specifies the QA checks to skip for a specific package within a recipe."
+IPK_FEED_URIS[doc] = "List of ipkg feed records to put into generated image."
+
+#K
+
+KARCH[doc] = "Defines the kernel architecture used when assembling the configuration. You define the KARCH variable in the BSP Descriptions."
+KBRANCH[doc] = "A regular expression used by the build process to explicitly identify the kernel branch that is validated, patched and configured during a build."
+KBRANCH_DEFAULT[doc] = "Defines the Linux kernel source repository's default branch used to build the Linux kernel. Unless you specify otherwise, the variable initializes to 'master'."
+KERNEL_CLASSES[doc] = "A list of classes defining kernel image types that kernel class should inherit."
+KERNEL_EXTRA_ARGS[doc] = "Specifies additional make command-line arguments the OpenEmbedded build system passes on when compiling the kernel."
+KERNEL_FEATURES[doc] = "Includes additional metadata from the Yocto Project kernel Git repository. The metadata you add through this variable includes config fragments and features descriptions."
+KERNEL_IMAGETYPE[doc] = "The type of kernel to build for a device, usually set by the machine configuration files and defaults to 'zImage'."
+KERNEL_MODULE_AUTOLOAD[doc] = "Lists kernel modules that need to be auto-loaded during boot"
+KERNEL_MODULE_PROBECONF[doc] = "Lists kernel modules for which the build system expects to find module_conf_* values that specify configuration for each of the modules"
+KERNEL_PATH[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)."
+KERNEL_SRC[doc] = "The location of the kernel sources. This variable is set to the value of the STAGING_KERNEL_DIR within the module class (module.bbclass)."
+KFEATURE_DESCRIPTION[doc] = "Provides a short description of a configuration fragment. You use this variable in the .scc file that describes a configuration fragment file."
+KMACHINE[doc] = "The machine as known by the kernel."
+KTYPE[doc] = "Defines the kernel type to be used in assembling the configuration."
+
+#L
+
+LAYERDEPENDS[doc] = "Lists the layers, separated by spaces, upon which this recipe depends. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer."
+LAYERDIR[doc] = "When used inside the layer.conf configuration file, this variable provides the path of the current layer."
+LAYERVERSION[doc] = "Optionally specifies the version of a layer as a single number. This variable is used in the conf/layer.conf file and must be suffixed with the name of the specific layer."
+LEAD_SONAME[doc] = "Specifies the lead (or primary) compiled library file (.so) that the debian class applies its naming policy to given a recipe that packages multiple libraries."
+LIC_FILES_CHKSUM[doc] = "Checksums of the license text in the recipe source code."
+LICENSE[doc] = "The list of source licenses for the recipe. Logical operators '&' or '|' and parentheses can be used."
+LICENSE_PATH[doc] = "Path to additional licenses used during the build."
+LINUX_KERNEL_TYPE[doc] = "Defines the kernel type to be used in assembling the configuration."
+LINUX_VERSION[doc] = "The Linux version from kernel.org on which the Linux kernel image being built using the OpenEmbedded build system is based. You define this variable in the kernel recipe."
+LINUX_VERSION_EXTENSION[doc] = "A string extension compiled into the version string of the Linux kernel built with the OpenEmbedded build system. You define this variable in the kernel recipe."
+LOG_DIR[doc] = "Specifies the directory to which the OpenEmbedded build system writes overall log files. The default directory is ${TMPDIR}/log"
+
+#M
+
+MACHINE[doc] = "Specifies the target device for which the image is built. You define MACHINE in the conf/local.conf file in the Build Directory."
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS[doc] = "A list of required machine-specific packages to install as part of the image being built. Because this is a 'machine essential' variable, the list of packages are essential for the machine to boot."
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS[doc] = "A list of recommended machine-specific packages to install as part of the image being built. Because this is a 'machine essential' variable, the list of packages are essential for the machine to boot."
+MACHINE_EXTRA_RDEPENDS[doc] = "A list of machine-specific packages to install as part of the image being built that are not essential for the machine to boot. However, the build process for more fully-featured images depends on the packages being present."
+MACHINE_EXTRA_RRECOMMENDS[doc] = "A list of machine-specific packages to install as part of the image being built that are not essential for booting the machine. The image being built has no build dependencies on the packages in this list."
+MACHINE_FEATURES[doc] = "Specifies the list of hardware features the MACHINE supports."
+MACHINE_FEATURES_BACKFILL[doc] = "Features to be added to MACHINE_FEATURES if not also present in MACHINE_FEATURES_BACKFILL_CONSIDERED. This variable is set in the meta/conf/bitbake.conf file and is not intended to be user-configurable."
+MACHINE_FEATURES_BACKFILL_CONSIDERED[doc] = "Features from MACHINE_FEATURES_BACKFILL that should not be backfilled (i.e. added to MACHINE_FEATURES) during the build."
+MACHINEOVERRIDES[doc] = "Lists overrides specific to the current machine. By default, this list includes the value of MACHINE."
+MAINTAINER[doc] = "The email address of the distribution maintainer."
+MIRRORS[doc] = "Specifies additional paths from which the OpenEmbedded build system gets source code."
+MLPREFIX[doc] = "Specifies a prefix has been added to PN to create a special version of a recipe or package, such as a Multilib version."
+MODULE_TARBALL_DEPLOY[doc] = "Controls creation of the modules-*.tgz file. Set this variable to "0" to disable creation of this file, which contains all of the kernel modules resulting from a kernel build."
+MULTIMACH_TARGET_SYS[doc] = "Separates files for different machines such that you can build for multiple target machines using the same output directories."
+
+#N
+
+NATIVELSBSTRING[doc] = "A string identifying the host distribution."
+NO_RECOMMENDATIONS[doc] = "When set to '1', no recommended packages will be installed. Realize that some recommended packages might be required for certain system functionality, such as kernel-modules. It is up to the user to add packages to IMAGE_INSTALL as needed."
+NOHDD[doc] = "Causes the OpenEmbedded build system to skip building the .hddimg image."
+NOISO[doc] = "Causes the OpenEmbedded build system to skip building the ISO image."
+
+#O
+
+OE_BINCONFIG_EXTRA_MANGLE[doc] = "When a recipe inherits the binconfig.bbclass class, this variable specifies additional arguments passed to the "sed" command."
+OE_IMPORTS[doc] = "An internal variable used to tell the OpenEmbedded build system what Python modules to import for every Python function run by the system."
+OE_TERMINAL[doc] = "Controls how the OpenEmbedded build system spawns interactive terminals on the host development system."
+OEROOT[doc] = "The directory from which the top-level build environment setup script is sourced."
+OLDEST_KERNEL[doc] = "Declares the oldest version of the Linux kernel that the produced binaries must support."
+OVERRIDES[doc] = "BitBake uses OVERRIDES to control what variables are overridden after BitBake parses recipes and configuration files."
+
+#P
+
+P[doc] = "The recipe name and version. P is comprised of ${PN}-${PV}."
+PACKAGE_ARCH[doc] = "The architecture of the resulting package or packages."
+PACKAGE_ARCHS[doc] = "A list of architectures compatible with the given target in order of priority."
+PACKAGE_BEFORE_PN[doc] = "Enables easily adding packages to PACKAGES before ${PN} so that the packages can pick up files that would normally be included in the default package."
+PACKAGE_CLASSES[doc] = "This variable specifies the package manager to use when packaging data. It is set in the conf/local.conf file in the Build Directory."
+PACKAGE_EXCLUDE[doc] = "Packages to exclude from the installation. If a listed package is required, an error is generated."
+PACKAGE_EXTRA_ARCHS[doc] = "Specifies the list of architectures compatible with the device CPU. This variable is useful when you build for several different devices that use miscellaneous processors."
+PACKAGE_GROUP[doc] = "Defines one or more packages to include in an image when a specific item is included in IMAGE_FEATURES."
+PACKAGE_INSTALL[doc] = "List of the packages to be installed into the image. The variable is generally not user-defined and uses IMAGE_INSTALL as part of the list."
+PACKAGE_INSTALL_ATTEMPTONLY[doc] = "List of packages attempted to be installed. If a listed package fails to install, the build system does not generate an error. This variable is generally not user-defined."
+PACKAGECONFIG[doc] = "This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis."
+PACKAGES[doc] = "The list of packages to be created from the recipe."
+PACKAGES_DYNAMIC[doc] = "A promise that your recipe satisfies runtime dependencies for optional modules that are found in other recipes."
+PARALLEL_MAKE[doc] = "Specifies extra options that are passed to the make command during the compile tasks. This variable is usually in the form -j 4, where the number represents the maximum number of parallel threads make can run."
+PARALLEL_MAKEINST[doc] = "Extra options passed to the make install command during the do_install task in order to specify parallel installation."
+PATCHRESOLVE[doc] = "Enable or disable interactive patch resolution."
+PATCHTOOL[doc] = "Specifies the utility used to apply patches for a recipe during do_patch."
+PE[doc] = "The epoch of the recipe. The default value is '0'. The field is used to make upgrades possible when the versioning scheme changes in some backwards incompatible way."
+PF[doc] = "Specifies the recipe or package name and includes all version and revision numbers. This variable is comprised of ${PN}-${EXTENDPE}${PV}-${PR}."
+PIXBUF_PACKAGES[doc] = "When a recipe inherits the pixbufcache class, this variable identifies packages that contain the pixbuf loaders used with gdk-pixbuf."
+PKGD[doc] = "Points to the destination directory for files to be packaged before they are split into individual packages."
+PKGDATA_DIR[doc] = "Points to a shared, global-state directory that holds data generated during the packaging process."
+PKGDEST[doc] = "Points to the parent directory for files to be packaged after they have been split into individual packages."
+PKGDESTWORK[doc] = "Points to a temporary work area used by the do_package task to write output from the do_packagedata task."
+PN[doc] = "PN refers to a recipe name in the context of a file used by the OpenEmbedded build system as input to create a package. It refers to a package name in the context of a file created or produced by the OpenEmbedded build system."
+PNBLACKLIST[doc] = "Lists recipes you do not want the OpenEmbedded build system to build."
+PR[doc] = "The revision of the recipe. The default value for this variable is 'r0'."
+PREFERRED_PROVIDER[doc] = "If multiple recipes provide an item, this variable determines which recipe should be given preference."
+PREFERRED_VERSION[doc] = "If there are multiple versions of recipes available, this variable determines which recipe should be given preference."
+PREMIRRORS[doc] = "Specifies additional paths from which the OpenEmbedded build system gets source code."
+PRINC[doc] = "Causes the PR variable of .bbappend files to dynamically increment. This increment minimizes the impact of layer ordering. This variable defaults to '0'."
+PRIORITY[doc] = "Indicates the importance of a package.  The default value is 'optional'.  Other standard values are 'required', 'standard' and 'extra'."
+PROVIDES[doc] = "A list of aliases that a recipe also provides. These aliases are useful for satisfying dependencies of other recipes during the build as specified by DEPENDS."
+PRSERV_HOST[doc] = "The network based PR service host and port."
+PV[doc] = "The version of the recipe. The version is normally extracted from the recipe filename."
+
+#Q
+
+QMAKE_PROFILES[doc] = "Specifies your own subset of .pro files to be built for use with qmake."
+
+#R
+
+RCONFLICTS[doc] = "The list of packages that conflict with another package. Note that the package will not be installed if the conflicting packages are not first removed."
+RDEPENDS[doc] = "Lists a package's runtime dependencies (i.e. other packages) that must be installed for the package to be built. They must be the names of other packages as listed in the PACKAGES variable, not recipe names (PN)."
+REQUIRED_DISTRO_FEATURES[doc] = "When a recipe inherits the distro_features_check class, this variable identifies distribution features that must exist in the current configuration in order for the OpenEmbedded build system to build the recipe."
+RM_OLD_IMAGE[doc] = "Reclaims disk space by removing previously built versions of the same image from the images directory pointed to by the DEPLOY_DIR variable."
+RM_WORK_EXCLUDE[doc] = "With rm_work enabled, this variable specifies a list of packages whose work directories should not be removed."
+ROOTFS[doc] = "Indicates a filesystem image to include as the root filesystem."
+ROOTFS_POSTPROCESS_COMMAND[doc] = "Added by classes to run post processing commands once the OpenEmbedded build system has created the root filesystem."
+RPROVIDES[doc] = "A list of package name aliases that a package also provides. These aliases are useful for satisfying runtime dependencies of other packages both during the build and on the target."
+RRECOMMENDS[doc] = "A list of packages that extends the usability of a package being built. The package being built does not depend on this list of packages in order to successfully build, but needs them for the extended usability."
+RREPLACES[doc] = "A list of packages replaced by a package. The package manager uses this variable to determine which package should be installed to replace other package(s) during an upgrade."
+RSUGGESTS[doc] = "A list of additional packages that you can suggest for installation by the package manager at the time a package is installed. Not all package managers support this functionality."
+
+#S
+
+S[doc] = "The location in the Build Directory where unpacked package source code resides."
+SANITY_TESTED_DISTROS[doc] = "A list of the host distribution identifiers that the build system has been tested against."
+SDK_ARCH[doc] = "The target architecture for the SDK."
+SDK_DEPLOY[doc] = "The directory set up and used by the populate_sdk_base to which the SDK is deployed."
+SDK_DIR[doc] = "The parent directory used by the OpenEmbedded build system when creating SDK output."
+SDK_NAME[doc] = "The base name for SDK output files."
+SDK_OUTPUT[doc] = "The location used by the OpenEmbedded build system when creating SDK output."
+SDKIMAGE_FEATURES[doc] = "Equivalent to IMAGE_FEATURES. However, this variable applies to the SDK generated from an image using the command 'bitbake -c populate_sdk imagename'."
+SDKMACHINE[doc] = "Specifies the architecture (i.e. i686 or x86_64) for which to build SDK and ADT items."
+SECTION[doc] = "The section in which packages should be categorized. Package management utilities can make use of this variable."
+SELECTED_OPTIMIZATION[doc] = "The variable takes the value of FULL_OPTIMIZATION unless DEBUG_BUILD = '1'. In this case, the value of DEBUG_OPTIMIZATION is used."
+SERIAL_CONSOLE[doc] = "The speed and device for the serial port used to attach the serial console. This variable is given to the kernel as the 'console' parameter. After booting occurs, getty is started on that port so remote login is possible."
+SERIAL_CONSOLES[doc] = "Defines the serial consoles (TTYs) to enable using getty."
+SERIAL_CONSOLES_CHECK[doc] = "Similar to SERIAL_CONSOLES except the device is checked for existence before attempting to enable it. Supported only by SysVinit."
+SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS[doc] = "A list of recipe dependencies that should not be used to determine signatures of tasks from one recipe when they depend on tasks from another recipe."
+SIGGEN_EXCLUDERECIPES_ABISAFE[doc] = "A list of recipes that are completely stable and will never change."
+SITEINFO_BITS[doc] = "Specifies the number of bits for the target system CPU."
+SITEINFO_ENDIANNESS[doc] = "Specifies the endian byte order of the target system. The value should be either 'le' for 'little-endian' or 'be' for 'big-endian'."
+SOC_FAMILY[doc] = "Groups together machines based upon the same family of SOC (System On Chip). You typically set this variable in a common .inc file that you include in the configuration files of all the machines."
+SOLIBS[doc] = "Defines the suffix for shared libraries used on the target platform."
+SOLIBSDEV[doc] = "Defines the suffix for the development symbolic link (symlink) for shared libraries on the target platform."
+SOURCE_MIRROR_FETCH[doc] = "Switch marking build as source fetcher. Used to skip COMPATIBLE_* checking."
+SOURCE_MIRROR_URL[doc] = "URL to source mirror that will be used before fetching from original SRC_URI."
+SPECIAL_PKGSUFFIX[doc] = "A list of prefixes for PN used by the OpenEmbedded build system to create variants of recipes or packages. The list specifies the prefixes to strip off during certain circumstances such as the generation of the BPN variable."
+SRC_URI[doc] = "The list of source files - local or remote. This variable tells the OpenEmbedded build system what bits to pull in for the build and how to pull them in."
+SRC_URI_OVERRIDES_PACKAGE_ARCH[doc] = "By default, the OpenEmbedded build system automatically detects whether SRC_URI contains files that are machine-specific. If so, the build system automatically changes PACKAGE_ARCH. Setting this variable to '0' disables this behavior."
+SRCDATE[doc] = "The date of the source code used to build the package. This variable applies only if the source was fetched from a Source Code Manager (SCM)."
+SRCPV[doc] = "Returns the version string of the current package. This string is used to help define the value of PV."
+SRCREV[doc] = "The revision of the source code used to build the package. This variable applies to Subversion, Git, Mercurial and Bazaar only."
+SSTATE_DIR[doc] = "The directory for the shared state cache."
+SSTATE_MIRRORS[doc] = "Configures the OpenEmbedded build system to search other mirror locations for prebuilt cache data objects before building out the data. You can specify a filesystem directory or a remote URL such as HTTP or FTP."
+STAGING_KERNEL_DIR[doc] = "The directory with kernel headers that are required to build out-of-tree modules."
+STAMP[doc] = "Specifies the base path used to create recipe stamp files. The path to an actual stamp file is constructed by evaluating this string and then appending additional information."
+STAMPS_DIR[doc] = "Specifies the base directory in which the OpenEmbedded build system places stamps."
+SUMMARY[doc] = "The short (80 characters or less) summary of the binary package for packaging systems such as opkg, rpm or dpkg. By default, SUMMARY is used to define the DESCRIPTION variable if DESCRIPTION is not set in the recipe."
+SVNDIR[doc] = "The directory where Subversion checkouts will be stored."
+SYSLINUX_DEFAULT_CONSOLE[doc] = "Specifies the kernel boot default console."
+SYSLINUX_OPTS[doc] = "Lists additional options to add to the syslinux file."
+SYSLINUX_SERIAL[doc] = "Specifies the alternate serial port or turns it off."
+SYSLINUX_SPLASH[doc] = "An .LSS file used as the background for the VGA boot menu when you are using the boot menu."
+SYSLINUX_SERIAL_TTY[doc] = "Specifies the alternate console=tty... kernel boot argument."
+SYSROOT_PREPROCESS_FUNCS[doc] = "A list of functions to execute after files are staged into the sysroot. These functions are usually used to apply additional processing on the staged files, or to stage additional files."
+SYSTEMD_AUTO_ENABLE[doc] = "For recipes that inherit the systemd class, this variable specifies whether the service you have specified in SYSTEMD_SERVICE should be started automatically or not."
+SYSTEMD_PACKAGES[doc] = "For recipes that inherit the systemd class, this variable locates the systemd unit files when they are not found in the main recipe's package."
+SYSTEMD_SERVICE[doc] = "For recipes that inherit the systemd class, this variable specifies the systemd service name for a package."
+SYSVINIT_ENABLED_GETTYS[doc] = "Specifies which virtual terminals should be running a getty, the default is '1'."
+
+#T
+
+T[doc] = "This variable points to a directory were BitBake places temporary files, which consist mostly of task logs and scripts, when building a particular recipe."
+TARGET_ARCH[doc] = "The architecture of the device being built. The OpenEmbedded build system supports the following architectures: arm, mips, ppc, x86, x86-64."
+TARGET_CFLAGS[doc] = "Flags passed to the C compiler for the target system. This variable evaluates to the same as CFLAGS."
+TARGET_FPU[doc] = "Specifies the method for handling FPU code. For FPU-less targets, which include most ARM CPUs, the variable must be set to 'soft'. If not, the kernel emulation gets used, which results in a performance penalty."
+TARGET_OS[doc] = "Specifies the target's operating system."
+TARGET_PREFIX[doc] = "The prefix for the cross-compile toolchain (e.g. arm-linux-)."
+TARGET_SYS[doc] = "The target system is comprised of TARGET_ARCH,TARGET_VENDOR and TARGET_OS."
+TCLIBC[doc] = "Specifies GNU standard C library (libc) variant to use during the build process. You can select 'glibc' or 'uclibc'."
+TCMODE[doc] = "Enables an external toolchain (where provided by an additional layer) if set to a value other than 'default'."
+TEST_IMAGE[doc] = "Enables test booting of virtual machine images under the QEMU emulator after any root filesystems are created and runs tests against those images."
+TEST_QEMUBOOT_TIMEOUT[doc] = "The time in seconds allowed for an image to boot before automated runtime tests begin to run against an image."
+TEST_SUITES[doc] = "An ordered list of tests (modules) to run against an image when performing automated runtime testing."
+TEST_POWERCONTROL_CMD[doc] = "For automated hardware testing, specifies the command to use to control the power of the target machine under test"
+TEST_POWERCONTROL_EXTRA_ARGS[doc] = "For automated hardware testing, specifies additional arguments to pass through to the command specified in TEST_POWERCONTROL_CMD"
+TEST_SERIALCONTROL_CMD[doc] = "For automated hardware testing, specifies the command to use to connect to the serial console of the target machine under test"
+TEST_SERIALCONTROL_EXTRA_ARGS[doc] = "For automated hardware testing, specifies additional arguments to pass through to the command specified in TEST_SERIALCONTROL_CMD"
+TEST_TARGET[doc] = "For automated runtime testing, specifies the method of deploying the image and running tests on the target machine"
+THISDIR[doc] = "The directory in which the file BitBake is currently parsing is located."
+TIME[doc] = "The time the build was started using HMS format."
+TMPDIR[doc] = "The temporary directory the OpenEmbedded build system uses when it does its work building images. By default, the TMPDIR variable is named tmp within the Build Directory."
+TOOLCHAIN_HOST_TASK[doc] = "This variable lists packages the OpenEmbedded build system uses when building an SDK, which contains a cross-development environment."
+TOOLCHAIN_TARGET_TASK[doc] = "This variable lists packages the OpenEmbedded build system uses when it creates the target part of an SDK, which includes libraries and headers."
+TOPDIR[doc] = "The Build Directory. BitBake automatically sets this variable. The OpenEmbedded build system uses the Build Directory when building images."
+TRANSLATED_TARGET_ARCH[doc] = "A sanitized version of TARGET_ARCH. This variable is used where the architecture is needed in a value where underscores are not allowed."
+TUNE_PKGARCH[doc] = "The package architecture understood by the packaging system to define the architecture, ABI, and tuning of output packages."
+TUNEABI[doc] = "An underlying ABI used by a particular tuning in a given toolchain layer. This feature allows providers using prebuilt libraries to check compatibility of a tuning against their selection of libraries."
+TUNEABI_OVERRIDE[doc] = "If set, ignores TUNEABI_WHITELIST."
+TUNEABI_WHITELIST[doc] = "A whitelist of permissible TUNEABI values.  If the variable is not set, all values are allowed."
+TUNECONFLICTS[doc] = "List of conflicting features for a given feature."
+TUNEVALID[doc] = "Descriptions, stored as flags, of valid tuning features."
+
+#U
+
+UBOOT_CONFIG[doc] = "Configures the UBOOT_MACHINE and can also define IMAGE_FSTYPES for individual cases."
+UBOOT_ENTRYPOINT[doc] = "Specifies the entry point for the U-Boot image."
+UBOOT_LOADADDRESS[doc] = "Specifies the load address for the U-Boot image."
+UBOOT_LOCALVERSION[doc] = "Appends a string to the name of the local version of the U-Boot image."
+UBOOT_MACHINE[doc] = "Specifies the value passed on the make command line when building a U-Boot image."
+UBOOT_MAKE_TARGET[doc] = "Specifies the target called in the Makefile."
+UBOOT_SUFFIX[doc] = "Points to the generated U-Boot extension."
+UBOOT_TARGET[doc] = "Specifies the target used for building U-Boot."
+USE_DEVFS[doc] = "When building images, specifies to populate or not /dev. This variable defaults to '1' (leave directory empty, surely because devtmpfs do the job). Set it to '0' to use makedevs (or consider using a custom file with IMAGE_DEVICE_TABLES)."
+USER_CLASSES[doc] = "List of additional classes to use when building images that enable extra features."
+USERADD_PACKAGES[doc] = "When a recipe inherits the useradd class, this variable specifies the individual packages within the recipe that require users and/or groups to be added."
+USERADD_PARAM[doc] = "When a recipe inherits the useradd class, this variable specifies for a package what parameters should be passed to the useradd command if you wish to add a user to the system when the package is installed."
+
+#W
+
+WARN_QA[doc] = "Specifies the quality assurance checks whose failures are reported as warnings by the OpenEmbedded build system."
+WORKDIR[doc] = "The pathname of the working directory in which the OpenEmbedded build system builds a recipe. This directory is located within the TMPDIR directory structure and changes as different packages are built."
diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
new file mode 100644
index 0000000..9e80018
--- /dev/null
+++ b/meta/conf/layer.conf
@@ -0,0 +1,60 @@
+# We have a conf and classes directory, add to BBPATH
+BBPATH .= ":${LAYERDIR}"
+# We have recipes-* directories, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes-*/*/*.bb"
+
+BBFILE_COLLECTIONS += "core"
+BBFILE_PATTERN_core = "^${LAYERDIR}/"
+BBFILE_PRIORITY_core = "5"
+
+# This should only be incremented on significant changes that will
+# cause compatibility issues with other layers
+LAYERVERSION_core = "6"
+
+BBLAYERS_LAYERINDEX_NAME_core = "openembedded-core"
+
+# Set a variable to get to the top of the metadata location
+COREBASE = '${@os.path.normpath("${LAYERDIR}/../")}'
+
+# opkg-utils is for update-altnernatives :(
+SIGGEN_EXCLUDERECIPES_ABISAFE += " \
+  sysvinit-inittab \
+  shadow-securetty \
+  opkg-arch-config \
+  netbase \
+  init-ifupdown \
+  connman-conf \
+  formfactor \
+  xserver-xf86-config \
+  pointercal \
+  pointercal-xinput \
+  base-files \
+  keymaps \
+  udev-extraconf \
+  packagegroup-x11-xserver \
+  systemd-serialgetty \
+  initscripts \
+  shadow \
+  shadow-sysroot \
+  base-passwd \
+  opkg-utils \
+"
+
+SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \
+  gcc-cross-${TARGET_ARCH}->glibc \
+  gcc-cross-${TARGET_ARCH}->musl \
+  gcc-cross-${TARGET_ARCH}->uclibc \
+  gcc-cross-${TARGET_ARCH}->linux-libc-headers \
+  ppp-dialin->ppp \
+  resolvconf->bash \
+  docbook-xsl-stylesheets->perl \
+  initramfs-framework->busybox \
+  initramfs-framework->systemd \
+  initramfs-framework->udev \
+  liberation-fonts->fontconfig \
+  gnome-icon-theme->librsvg \
+  font-alias->font-util \
+  weston-init->weston \
+  weston-init->kbd \
+"
+
diff --git a/meta/conf/licenses.conf b/meta/conf/licenses.conf
new file mode 100644
index 0000000..9917c40
--- /dev/null
+++ b/meta/conf/licenses.conf
@@ -0,0 +1,189 @@
+# These aren't actually used anywhere that I can tell
+# They may be in the future (or are used by someone else
+# For completion sake, I've updated them
+SRC_DISTRIBUTE_LICENSES += "AAL Adobe AFL-1.2 AFL-2.0 AFL-2.1 AFL-3.0"
+SRC_DISTRIBUTE_LICENSES += "AGPL-3.0 ANTLR-PD Apache-1.0 Apache-1.1 Apache-2.0"
+SRC_DISTRIBUTE_LICENSES += "APL-1.0 APSL-1.0 APSL-1.1 APSL-1.2 APSL-2.0"
+SRC_DISTRIBUTE_LICENSES += "Artistic-1.0 Artistic-2.0 BitstreamVera BSD"
+SRC_DISTRIBUTE_LICENSES += "BSD-2-Clause BSD-3-Clause BSD-4-Clause BSL-1.0"
+SRC_DISTRIBUTE_LICENSES += "CATOSL-1.1 CC0-1.0 CC-BY-1.0 CC-BY-2.0 CC-BY-2.5"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-3.0 CC-BY-NC-1.0 CC-BY-NC-2.0 CC-BY-NC-2.5"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-3.0 CC-BY-NC-ND-1.0 CC-BY-NC-ND-2.0"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-ND-2.5 CC-BY-NC-ND-3.0 CC-BY-NC-SA-1.0"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-NC-SA-2.0 CC-BY-NC-SA-2.5 CC-BY-NC-SA-3.0"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-ND-1.0 CC-BY-ND-2.0 CC-BY-ND-2.5 CC-BY-ND-3.0"
+SRC_DISTRIBUTE_LICENSES += "CC-BY-SA-1.0 CC-BY-SA-2.0 CC-BY-SA-2.5 CC-BY-SA-3.0"
+SRC_DISTRIBUTE_LICENSES += "CDDL-1.0 CECILL-1.0 CECILL-2.0 CECILL-B CECILL-C"
+SRC_DISTRIBUTE_LICENSES += "ClArtistic CPAL-1.0 CPL-1.0 CUA-OPL-1.0 DSSSL"
+SRC_DISTRIBUTE_LICENSES += "ECL-1.0 ECL-2.0 eCos-2.0 EDL-1.0 EFL-1.0 EFL-2.0"
+SRC_DISTRIBUTE_LICENSES += "Elfutils-Exception Entessa EPL-1.0 ErlPL-1.1"
+SRC_DISTRIBUTE_LICENSES += "EUDatagrid EUPL-1.0 EUPL-1.1 Fair Frameworx-1.0"
+SRC_DISTRIBUTE_LICENSES += "FreeType GFDL-1.1 GFDL-1.2 GFDL-1.3 GPL-1.0"
+SRC_DISTRIBUTE_LICENSES += "GPL-2.0 GPL-2.0-with-autoconf-exception"
+SRC_DISTRIBUTE_LICENSES += "GPL-2.0-with-classpath-exception"
+SRC_DISTRIBUTE_LICENSES += "GPL-2.0-with-font-exception"
+SRC_DISTRIBUTE_LICENSES += "GPL-2.0-with-GCC-exception"
+SRC_DISTRIBUTE_LICENSES += "GPL-2-with-bison-exception GPL-3.0"
+SRC_DISTRIBUTE_LICENSES += "GPL-3.0-with-autoconf-exception"
+SRC_DISTRIBUTE_LICENSES += "GPL-3.0-with-GCC-exception"
+SRC_DISTRIBUTE_LICENSES += "gSOAP-1 gSOAP-1.3b HPND IPA IPL-1.0 ISC LGPL-2.0"
+SRC_DISTRIBUTE_LICENSES += "LGPL-2.1 LGPL-3.0 Libpng LPL-1.02 LPPL-1.0 LPPL-1.1"
+SRC_DISTRIBUTE_LICENSES += "LPPL-1.2 LPPL-1.3c MirOS MIT Motosoto MPL-1.0"
+SRC_DISTRIBUTE_LICENSES += "MPL-1.1 MS-PL MS-RL Multics NASA-1.3 Nauman NCSA"
+SRC_DISTRIBUTE_LICENSES += "NGPL Nokia NPOSL-3.0 NTP OASIS OCLC-2.0 ODbL-1.0"
+SRC_DISTRIBUTE_LICENSES += "OFL-1.1 OGTSL OLDAP-2.8 OpenSSL OSL-1.0 OSL-2.0"
+SRC_DISTRIBUTE_LICENSES += "OSL-3.0 PD PHP-3.0 PostgreSQL Proprietary"
+SRC_DISTRIBUTE_LICENSES += "Python-2.0 QPL-1.0 RHeCos-1 RHeCos-1.1 RPL-1.5"
+SRC_DISTRIBUTE_LICENSES += "RPSL-1.0 RSCPL Ruby SAX-PD SGI-1 Simple-2.0 Sleepycat"
+SRC_DISTRIBUTE_LICENSES += "SPL-1.0 SugarCRM-1 SugarCRM-1.1.3 UCB VSL-1.0 W3C"
+SRC_DISTRIBUTE_LICENSES += "Watcom-1.0 WXwindows XFree86-1.0 XFree86-1.1 Xnet XSL YPL-1.1"
+SRC_DISTRIBUTE_LICENSES += "Zimbra-1.3 Zlib ZPL-1.1 ZPL-2.0 ZPL-2.1"
+
+# Standards are great! Everyone has their own. In an effort to standardize licensing
+# names, common-licenses will use the SPDX standard license names. In order to not
+# break the non-standardized license names that we find in LICENSE, we'll set
+# up a bunch of VarFlags to accomodate non-SPDX license names.
+#
+# We should really discuss standardizing this field, but that's a longer term goal.
+# For now, we can do this and it should grab the most common LICENSE naming variations.
+#
+# We should NEVER have a GPL/LGPL without a version!!!!
+# Any mapping to MPL/LGPL/GPL should be fixed
+
+# AGPL variations
+SPDXLICENSEMAP[AGPL-3] = "AGPL-3.0"
+SPDXLICENSEMAP[AGPLv3] = "AGPL-3.0"
+SPDXLICENSEMAP[AGPLv3.0] = "AGPL-3.0"
+
+# GPL variations
+SPDXLICENSEMAP[GPL-1] = "GPL-1.0"
+SPDXLICENSEMAP[GPLv1] = "GPL-1.0"
+SPDXLICENSEMAP[GPLv1.0] = "GPL-1.0"
+SPDXLICENSEMAP[GPL-2] = "GPL-2.0"
+SPDXLICENSEMAP[GPLv2] = "GPL-2.0"
+SPDXLICENSEMAP[GPLv2.0] = "GPL-2.0"
+SPDXLICENSEMAP[GPL-3] = "GPL-3.0"
+SPDXLICENSEMAP[GPLv3] = "GPL-3.0"
+SPDXLICENSEMAP[GPLv3.0] = "GPL-3.0"
+
+#LGPL variations
+SPDXLICENSEMAP[LGPLv2] = "LGPL-2.0"
+SPDXLICENSEMAP[LGPLv2.0] = "LGPL-2.0"
+SPDXLICENSEMAP[LGPL2.1] = "LGPL-2.1"
+SPDXLICENSEMAP[LGPLv2.1] = "LGPL-2.1"
+SPDXLICENSEMAP[LGPLv3] = "LGPL-3.0"
+
+#MPL variations
+SPDXLICENSEMAP[MPL-1] = "MPL-1.0"
+SPDXLICENSEMAP[MPLv1] = "MPL-1.0"
+SPDXLICENSEMAP[MPLv1.1] = "MPL-1.1"
+SPDXLICENSEMAP[MPLv2] = "MPL-2.0"
+
+#MIT variations
+SPDXLICENSEMAP[MIT-X] = "MIT"
+SPDXLICENSEMAP[MIT-style] = "MIT"
+
+#Openssl variations
+SPDXLICENSEMAP[openssl] = "OpenSSL"
+
+#Python variations
+SPDXLICENSEMAP[PSF] = "Python-2.0"
+SPDXLICENSEMAP[PSFv2] = "Python-2.0"
+SPDXLICENSEMAP[Python-2] = "Python-2.0"
+
+#Apache variations
+SPDXLICENSEMAP[Apachev2] = "Apache-2.0"
+SPDXLICENSEMAP[Apache-2] = "Apache-2.0"
+
+#Artistic variations
+SPDXLICENSEMAP[Artisticv1] = "Artistic-1.0"
+SPDXLICENSEMAP[Artistic-1] = "Artistic-1.0"
+
+#Academic variations
+SPDXLICENSEMAP[AFL-2] = "AFL-2.0"
+SPDXLICENSEMAP[AFL-1] = "AFL-1.2"
+SPDXLICENSEMAP[AFLv2] = "AFL-2.0"
+SPDXLICENSEMAP[AFLv1] = "AFL-1.2"
+
+#Other variations
+SPDXLICENSEMAP[EPLv1.0] = "EPL-1.0"
+
+#Silicon Graphics variations
+SPDXLICENSEMAP[SGIv1] = "SGI-1"
+
+# Additional license directories. Add your custom licenses directories this path.
+# LICENSE_PATH += "${COREBASE}/custom-licenses"
+
+# Set if you want the license.manifest copied to the image
+#COPY_LIC_MANIFEST = "1"
+
+# If you want the pkg licenses copied over as well you must set
+# both COPY_LIC_MANIFEST and COPY_LIC_DIRS
+#COPY_LIC_DIRS = "1"
+
+## SPDX temporary directory
+SPDX_TEMP_DIR = "${WORKDIR}/spdx_temp"
+SPDX_MANIFEST_DIR = "/home/yocto/fossology_scans"
+
+## SPDX Format info
+SPDX_VERSION = "SPDX-1.1"
+DATA_LICENSE = "CC0-1.0"
+
+## Fossology scan information
+# You can set option to control if the copyright information will be skipped
+# during the identification process.
+#
+# It is defined as [FOSS_COPYRIGHT] in ./meta/conf/licenses.conf.
+# FOSS_COPYRIGHT = "true"
+#   NO copyright will be processed. That means only license information will be
+#   identified and output to SPDX file
+# FOSS_COPYRIGHT = "false"
+#   Copyright will be identified and output to SPDX file along with license
+#   information. The process will take more time than not processing copyright
+#   information.
+#
+
+FOSS_NO_COPYRIGHT = "true"
+
+# A option defined as[FOSS_RECURSIVE_UNPACK] in ./meta/conf/licenses.conf. is
+# used to control if FOSSology server need recursively unpack tar.gz file which
+# is sent from do_spdx task.
+#
+# FOSS_RECURSIVE_UNPACK = "false":
+#    FOSSology server does NOT recursively unpack. In the current release, this
+#    is the default choice because recursively unpack will not necessarily break
+#    down original compressed files.
+# FOSS_RECURSIVE_UNPACK = "true":
+#    FOSSology server recursively unpack components.
+#
+
+FOSS_RECURSIVE_UNPACK = "false"
+
+# An option defined as [FOSS_FULL_SPDX] in ./meta/conf/licenses.conf is used to
+# control what kind of SPDX output to get from the FOSSology server.
+#
+# FOSS_FULL_SPDX = "true":
+#   Tell FOSSology server to return full SPDX output, like if the program was
+#   run from the command line. This is needed in order to get license refs for
+#   the full package rather than individual files only.
+#
+# FOSS_FULL_SPDX = "false":
+#   Tell FOSSology to only process license information for files. All package
+#   license tags in the report will be "NOASSERTION"
+#
+
+FOSS_FULL_SPDX = "true"
+
+# FOSSologySPDX instance server. http://localhost/repo is the default
+# installation location for FOSSology.
+#
+# For more information on FOSSologySPDX commandline:
+#   https://github.com/spdx-tools/fossology-spdx/wiki/Fossology-SPDX-Web-API
+#
+
+FOSS_BASE_URL = "http://localhost/repo/?mod=spdx_license_once"
+FOSS_SERVER = "${FOSS_BASE_URL}&fullSPDXFlag=${FOSS_FULL_SPDX}&noCopyright=${FOSS_NO_COPYRIGHT}&recursiveUnpack=${FOSS_RECURSIVE_UNPACK}"
+
+FOSS_WGET_FLAGS = "-qO - --no-check-certificate --timeout=0"
+
+
diff --git a/meta/conf/machine-sdk/i586.conf b/meta/conf/machine-sdk/i586.conf
new file mode 100644
index 0000000..baacce7
--- /dev/null
+++ b/meta/conf/machine-sdk/i586.conf
@@ -0,0 +1,3 @@
+SDK_ARCH = "i586"
+SDK_CC_ARCH = "-march=i586"
+
diff --git a/meta/conf/machine-sdk/i686.conf b/meta/conf/machine-sdk/i686.conf
new file mode 100644
index 0000000..ffdb461
--- /dev/null
+++ b/meta/conf/machine-sdk/i686.conf
@@ -0,0 +1,2 @@
+SDK_ARCH = "i686"
+SDK_CC_ARCH = "-march=i686"
diff --git a/meta/conf/machine-sdk/x86_64.conf b/meta/conf/machine-sdk/x86_64.conf
new file mode 100644
index 0000000..812d67c
--- /dev/null
+++ b/meta/conf/machine-sdk/x86_64.conf
@@ -0,0 +1 @@
+SDK_ARCH = "x86_64"
diff --git a/meta/conf/machine/include/README b/meta/conf/machine/include/README
new file mode 100644
index 0000000..d66130a
--- /dev/null
+++ b/meta/conf/machine/include/README
@@ -0,0 +1,100 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+ - Initial Revision
+
+
+Introduction
+============
+The individual CPU, and ABI tunings are contained in this directory.  A
+number of local and global variables are used to control the way the
+tunings are setup and how they work together to specify an optimized
+configuration.
+
+The following is brief summary of the generic components that are used
+in these tunings.
+
+AVAILTUNES - This is a list of all of the tuning definitions currently
+available in the system.  Not all tunes in this list may be compatible
+with the machine configuration, or each other in a multilib
+configuration.  Each tuning file can add to this list using "+=", but
+should never replace the list using "=".
+
+DEFAULTTUNE - This specifies the tune to use for a particular build.
+Each tune should specify a reasonable default, which can be overriden by
+a machine or multilib configuration.  The specified tune must be listed
+in the AVAILTUNES.
+
+TUNEVALID[feature] - The <feature> is defined with a human readable
+explanation for what it does.  All architectural, cpu, abi, etc tuning
+features must be defined using TUNEVALID.
+
+TUNECONFLICTS[feature] - A list of features which conflict with <feature>.
+New sanity checks will try to reject combinations in which a single
+tuning ends up with features which conflict with each other.
+
+TUNE_FEATURES - This is automatically defined as TUNE_FEATURES_tune-<tune>.
+See TUNE_FEATURES_tune-<tune> for more information.
+
+TUNE_FEATURES_tune-<tune> - Specify the features used to describe a
+specific tune.  This is a list of features that a tune support, each
+feature must be in the TUNEVALID list.  Note: the tune and a given
+feature name may be the same, but they have different purposes.  Only
+features may be used to change behavior, while tunes are used to
+describe an overall set of features.
+
+ABIEXTENSION - An ABI extension may be specified by a specific feature
+or other tuning setting, such as TARGET_FPU.  Any ABI extensions either
+need to be defined in the architectures base arch file, i.e.
+ABIEXTENSION = "eabi" in the arm case, or appended to in specific tune
+files with a ".=".  Spaces are not allowed in this variable.
+
+TUNE_CCARGS - Setup the cflags based on the TUNE_FEATURES settings.
+These should be additive when defined using "+=".  All items in this
+list should be dynamic! i.e.
+${@bb.utils.contains("TUNE_FEATURES", "feature", "cflag", "!cflag", d)}
+
+TUNE_ARCH - The GNU canonical arch for a specific architecture.  i.e.
+arm, armeb, mips, mips64, etc.  This value is used by bitbake to setup
+configure. TUNE_ARCH definitions are specific to a given architecture.
+They may be a single static definition, or may be dynamically adjusted.
+See each architecture's README for details for that CPU family.
+
+TUNE_PKGARCH - The package architecture used by the packaging systems to
+define the architecture, abi and tuning of a particular package.
+Similarly to TUNE_ARCH, the definition of TUNE_PKGARCH is specific to
+each architecture. See each architectures README for details for that
+CPU family.
+
+PACKAGE_EXTRA_ARCHS - Lists all runtime compatible package
+architectures.  By default this is equal to
+PACKAGE_EXTRA_ARCHS_tune-<tune>.  If an architecture deviates from the
+default it will be listed in the architecture README.
+
+PACKAGE_EXTRA_ARCHS_tune-<tune> - List all of the package architectures
+that are compatible with this specific tune.  The package arch of this
+tune must be in the list.
+
+TARGET_FPU - The FPU setting for a given tune, hard (generate floating
+point instructions), soft (generate internal gcc calls), "other"
+architecture specific floating point.  This is synchronized with the
+compiler and other toolchain items.  This should be dynamically
+configured in the same way that TUNE_CCARGS is.
+
+BASE_LIB_tune-<tune> - The "/lib" location for a specific ABI.  This is
+used in a multilib configuration to place the libraries in the correct,
+non-conflicting locations.
+
+
+Best Practice
+=============
+The tune infrastructure is designed to be hierarchical. When writing a
+new tune file for a "fast-forward" CPU architecture (one that supports
+everything from a previous generation), it is recommended to require the
+previous generation tune file and specify PACKAGE_EXTRA_ARCHS using the
+previous generation's override and appending the new tune. Note that
+only one previous tune file should be included to avoid mutiple includes
+of the base arch which could lead to a broken configuration due to
+multiple prepend and append assignments.
+
+For example, for x86, there is a common x86/arch-x86.inc which is
+included in the base i586 tune file. The core2 tune builds
+on that, and corei7 builds on core2.
diff --git a/meta/conf/machine/include/arm/README b/meta/conf/machine/include/arm/README
new file mode 100644
index 0000000..a1beb75
--- /dev/null
+++ b/meta/conf/machine/include/arm/README
@@ -0,0 +1,40 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+ - Initial Revision
+
+The ARM architecture definitions are split among a number of files.
+The primary definitions for the variables are handled by the core
+arch-arm.inc file.
+
+TUNE_ARCH is set to either "arm" or "armeb" depending on the value
+of the existence of the "bigendian" feature in a given tune.
+
+A small set of ARM specific variables have been defined to allow 
+TUNE_PKGARCH to be automatically defined.  Optimized tunings must NOT 
+change the definiton of TUNE_PKGARCH.  TUNE_PKGACH_tune-<tune> will be 
+ignored.  The format of the package arch is enforced by the TUNE_PKGARCH
+default.  The format must be of the form:
+<armversion>[t][e][hf][b][-vfp][-neon]
+
+TUNE_PKGARCH is defined as:
+${ARMPKGARCH}${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}
+
+ARMPKGARCH - This is the core package arch component specified by each 
+tuning.  This is the primary identifier of a tuning.  Usual values are:
+arm, armv4, armv5, armv6, armv7a, etc.
+
+ARMPKGSFX_THUMB - This is the thumb specific suffix.  Curently it is 
+defined in feature-arm-thumb.inc.
+
+ARMPKGSFX_DSP - This is the DSP specific suffix.  Currently this is set 
+to 'e' when on armv5 and the dsp feature is enabled.
+
+ARMPKGSFX_EABI - This is the eabi specific suffix.  There are currently 
+two defined ABIs specificed, standard EABI and Hard Float (VFP) EABI.  
+When the callconvention-hard is enabled, "hf" is specified, otherwise it 
+is blank.
+
+ARMPKGSFX_ENDIAN - This is the endian specific suffix.  It is defined in 
+the core arch-arm.inc file.
+
+ARMPKGSFX_FPU - This is the FPU specific suffix.  The suffix indicates 
+specific FPU optimizations.  'vfp' and 'neon' are both defined.
diff --git a/meta/conf/machine/include/arm/arch-arm.inc b/meta/conf/machine/include/arm/arch-arm.inc
new file mode 100644
index 0000000..90b80c4
--- /dev/null
+++ b/meta/conf/machine/include/arm/arch-arm.inc
@@ -0,0 +1,17 @@
+
+TUNEVALID[bigendian] = "Enable big-endian mode."
+
+ARMPKGARCH = "${ARMPKGARCH_tune-${DEFAULTTUNE}}"
+ARMPKGSFX_ENDIAN = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "b", "", d)}"
+ARMPKGSFX_FPU ??= ""
+ARMPKGSFX_DSP ??= ""
+ARMPKGSFX_EABI ??= ""
+ARMPKGSFX_THUMB ??= ""
+
+TUNE_ARCH = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "armeb", "arm", d)}"
+TUNE_PKGARCH = "${ARMPKGARCH}${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}"
+
+ABIEXTENSION = "eabi"
+
+TARGET_FPU = "${@d.getVar('ARMPKGSFX_FPU', True).strip('-') or 'soft'}"
+
diff --git a/meta/conf/machine/include/arm/arch-arm64.inc b/meta/conf/machine/include/arm/arch-arm64.inc
new file mode 100644
index 0000000..5376b87
--- /dev/null
+++ b/meta/conf/machine/include/arm/arch-arm64.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "aarch64"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[aarch64] = "Enable instructions for aarch64"
+
+MACHINEOVERRIDES .= "${@bb.utils.contains("TUNE_FEATURES", "aarch64", ":aarch64", "" ,d)}"
+
+# Little Endian base configs
+AVAILTUNES += "aarch64 aarch64_be"
+ARMPKGARCH_tune-aarch64 ?= "aarch64"
+ARMPKGARCH_tune-aarch64_be ?= "aarch64_be"
+TUNE_FEATURES_tune-aarch64 ?= "aarch64"
+TUNE_FEATURES_tune-aarch64_be ?= "${TUNE_FEATURES_tune-aarch64} bigendian"
+BASE_LIB_tune-aarch64 = "lib64"
+BASE_LIB_tune-aarch64_be = "lib64"
+
+PACKAGE_EXTRA_ARCHS_tune-aarch64 = "aarch64"
+PACKAGE_EXTRA_ARCHS_tune-aarch64_be = "aarch64_be"
+
+ARMPKGSFX_ENDIAN_64 = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "_be", "", d)}"
+TUNE_ARCH_64 = "aarch64${ARMPKGSFX_ENDIAN_64}"
+TUNE_PKGARCH_64 = "aarch64${ARMPKGSFX_ENDIAN_64}"
+ABIEXTENSION_64 = ""
+TARGET_FPU_64 = ""
+
+# Duplicated from arch-arm.inc
+TUNE_ARCH_32 = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "armeb", "arm", d)}"
+TUNE_PKGARCH_32 = "${ARMPKGARCH}${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}${ARMPKGSFX_EABI}${ARMPKGSFX_ENDIAN}${ARMPKGSFX_FPU}"
+ABIEXTENSION_32 = "eabi"
+TARGET_FPU_32 = "${@d.getVar('ARMPKGSFX_FPU', True).strip('-') or 'soft'}"
+
+TUNE_ARCH = "${@bb.utils.contains("TUNE_FEATURES", "aarch64", "${TUNE_ARCH_64}", "${TUNE_ARCH_32}" ,d)}"
+TUNE_PKGARCH = "${@bb.utils.contains("TUNE_FEATURES", "aarch64", "${TUNE_PKGARCH_64}", "${TUNE_PKGARCH_32}" ,d)}"
+ABIEXTENSION = "${@bb.utils.contains("TUNE_FEATURES", "aarch64", "${ABIEXTENSION_64}", "${ABIEXTENSION_32}" ,d)}"
+TARGET_FPU = "${@bb.utils.contains("TUNE_FEATURES", "aarch64", "${TARGET_FPU_64}", "${TARGET_FPU_32}" ,d)}"
diff --git a/meta/conf/machine/include/arm/arch-armv4.inc b/meta/conf/machine/include/arm/arch-armv4.inc
new file mode 100644
index 0000000..52c07a8
--- /dev/null
+++ b/meta/conf/machine/include/arm/arch-armv4.inc
@@ -0,0 +1,34 @@
+DEFAULTTUNE ?= "armv4"
+
+TUNEVALID[arm] = "Enable ARM instruction set"
+TUNEVALID[armv4] = "Enable instructions for ARMv4"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv4", " -march=armv4${ARMPKGSFX_THUMB}", "", d)}"
+# enable --fix-v4bx when we have armv4 in TUNE_FEATURES, but then disable it when we have also armv5 or thumb
+# maybe we should extend bb.utils.contains to support check for any checkvalues in value, now it does 
+# checkvalues.issubset(val) which cannot be used for negative test of foo neither bar in value
+FIX_V4BX_ARMV4 = "${@bb.utils.contains("TUNE_FEATURES", "armv4", "--fix-v4bx", "", d)}"
+FIX_V4BX_ARMV5 = "${@bb.utils.contains("TUNE_FEATURES", "armv5", "", "${FIX_V4BX_ARMV4}", d)}"
+FIX_V4BX = "${@bb.utils.contains("TUNE_FEATURES", "thumb", "", "${FIX_V4BX_ARMV5}", d)}"
+TARGET_LD_KERNEL_ARCH += "${FIX_V4BX}"
+MACHINEOVERRIDES =. "${@bb.utils.contains("TUNE_FEATURES", "armv4", "armv4:", "" ,d)}"
+
+require conf/machine/include/arm/arch-arm.inc
+require conf/machine/include/arm/feature-arm-thumb.inc
+
+# Little Endian
+AVAILTUNES += "armv4 armv4t"
+ARMPKGARCH_tune-armv4 ?= "armv4"
+ARMPKGARCH_tune-armv4t ?= "armv4"
+TUNE_FEATURES_tune-armv4 ?= "arm armv4"
+TUNE_FEATURES_tune-armv4t ?= "${TUNE_FEATURES_tune-armv4} thumb"
+PACKAGE_EXTRA_ARCHS_tune-armv4 = "arm armv4"
+PACKAGE_EXTRA_ARCHS_tune-armv4t = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv4t"
+
+# Big Endian
+AVAILTUNES += "armv4b armv4tb"
+ARMPKGARCH_tune-armv4b ?= "armv4"
+ARMPKGARCH_tune-armv4tb ?= "armv4"
+TUNE_FEATURES_tune-armv4b ?= "${TUNE_FEATURES_tune-armv4} bigendian"
+TUNE_FEATURES_tune-armv4tb ?= "${TUNE_FEATURES_tune-armv4t} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv4b = "armeb armv4b"
+PACKAGE_EXTRA_ARCHS_tune-armv4tb = "${PACKAGE_EXTRA_ARCHS_tune-armv4b} armv4tb"
diff --git a/meta/conf/machine/include/arm/arch-armv5-dsp.inc b/meta/conf/machine/include/arm/arch-armv5-dsp.inc
new file mode 100644
index 0000000..524a62a
--- /dev/null
+++ b/meta/conf/machine/include/arm/arch-armv5-dsp.inc
@@ -0,0 +1,52 @@
+ARMPKGSFX_DSP = "${@bb.utils.contains("TUNE_FEATURES", [ "armv5", "dsp" ], "e", "", d)}"
+TUNEVALID[dsp] = "ARM DSP functionality"
+
+require conf/machine/include/arm/arch-armv5.inc
+
+# Little Endian
+AVAILTUNES += "armv5e armv5te"
+ARMPKGARCH_tune-armv5e ?= "armv5"
+ARMPKGARCH_tune-armv5te ?= "armv5"
+TUNE_FEATURES_tune-armv5e ?= "${TUNE_FEATURES_tune-armv5} dsp"
+TUNE_FEATURES_tune-armv5te ?= "${TUNE_FEATURES_tune-armv5t} dsp"
+PACKAGE_EXTRA_ARCHS_tune-armv5e = "${PACKAGE_EXTRA_ARCHS_tune-armv5} armv5e"
+PACKAGE_EXTRA_ARCHS_tune-armv5te = "${PACKAGE_EXTRA_ARCHS_tune-armv5t} armv5e armv5te"
+
+# Little Endian + VFP/DSP
+AVAILTUNES += "armv5e-vfp armv5te-vfp armv5ehf-vfp armv5tehf-vfp"
+ARMPKGARCH_tune-armv5e-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5te-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5ehf-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5tehf-vfp ?= "armv5"
+TUNE_FEATURES_tune-armv5e-vfp ?= "${TUNE_FEATURES_tune-armv5e} vfp"
+TUNE_FEATURES_tune-armv5te-vfp ?= "${TUNE_FEATURES_tune-armv5te} vfp"
+TUNE_FEATURES_tune-armv5ehf-vfp ?= "${TUNE_FEATURES_tune-armv5e-vfp} callconvention-hard"
+TUNE_FEATURES_tune-armv5tehf-vfp ?= "${TUNE_FEATURES_tune-armv5te-vfp} callconvention-hard"
+PACKAGE_EXTRA_ARCHS_tune-armv5e-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5-vfp} armv5e armv5e-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5te-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5t-vfp} armv5e armv5te armv5e-vfp armv5te-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5ehf-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5hf-vfp} armv5ehf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5tehf-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5thf-vfp} armv5ehf-vfp armv5tehf-vfp"
+
+# Big Endian
+AVAILTUNES += "armv5eb armv5teb"
+ARMPKGARCH_tune-armv5eb ?= "armv5"
+ARMPKGARCH_tune-armv5teb ?= "armv5"
+TUNE_FEATURES_tune-armv5eb ?= "${TUNE_FEATURES_tune-armv5e} bigendian"
+TUNE_FEATURES_tune-armv5teb ?= "${TUNE_FEATURES_tune-armv5te} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv5eb = "${PACKAGE_EXTRA_ARCHS_tune-armv5b} armv5eb"
+PACKAGE_EXTRA_ARCHS_tune-armv5teb = "${PACKAGE_EXTRA_ARCHS_tune-armv5tb} armv5eb armv5teb"
+
+# Big Endian + VFP/DSP
+AVAILTUNES += "armv5eb-vfp armv5teb-vfp armv5ehfb-vfp armv5tehfb-vfp"
+ARMPKGARCH_tune-armv5eb-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5teb-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5ehfb-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5tehfb-vfp ?= "armv5"
+TUNE_FEATURES_tune-armv5eb-vfp ?= "${TUNE_FEATURES_tune-armv5e-vfp} bigendian"
+TUNE_FEATURES_tune-armv5teb-vfp ?= "${TUNE_FEATURES_tune-armv5te-vfp} bigendian"
+TUNE_FEATURES_tune-armv5ehfb-vfp ?= "${TUNE_FEATURES_tune-armv5ehf-vfp} bigendian"
+TUNE_FEATURES_tune-armv5tehfb-vfp ?= "${TUNE_FEATURES_tune-armv5tehf-vfp} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv5eb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5b-vfp} armv5eb armv5eb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5teb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5tb-vfp} armv5eb armv5teb armv5eb-vfp armv5teb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5ehfb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5hfb-vfp} armv5ehfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5tehfb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5thfb-vfp} armv5ehfb-vfp armv5tehfb-vfp"
diff --git a/meta/conf/machine/include/arm/arch-armv5.inc b/meta/conf/machine/include/arm/arch-armv5.inc
new file mode 100644
index 0000000..5cceafa
--- /dev/null
+++ b/meta/conf/machine/include/arm/arch-armv5.inc
@@ -0,0 +1,60 @@
+DEFAULTTUNE ?= "armv5"
+
+TUNEVALID[armv5] = "Enable instructions for ARMv5"
+TUNECONFLICTS[armv5] = "armv4"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv5", " -march=armv5${ARMPKGSFX_THUMB}${ARMPKGSFX_DSP}", "", d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains("TUNE_FEATURES", "armv5", "armv5:", "" ,d)}"
+
+ARMPKGSFX_DSP = "${@bb.utils.contains("TUNE_FEATURES", [ "armv5", "dsp" ], "e", "", d)}"
+
+require conf/machine/include/arm/arch-armv4.inc
+require conf/machine/include/arm/feature-arm-vfp.inc
+
+# Little Endian
+AVAILTUNES += "armv5 armv5t"
+ARMPKGARCH_tune-armv5 ?= "armv5"
+ARMPKGARCH_tune-armv5t ?= "armv5"
+TUNE_FEATURES_tune-armv5 ?= "arm armv5"
+TUNE_FEATURES_tune-armv5t ?= "${TUNE_FEATURES_tune-armv5} thumb"
+PACKAGE_EXTRA_ARCHS_tune-armv5 = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv5"
+PACKAGE_EXTRA_ARCHS_tune-armv5t = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} armv5 armv5t"
+
+# Little Endian + VFP/DSP
+AVAILTUNES += "armv5-vfp armv5t-vfp armv5hf-vfp armv5thf-vfp"
+ARMPKGARCH_tune-armv5-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5t-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5hf-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5thf-vfp ?= "armv5"
+TUNE_FEATURES_tune-armv5-vfp ?= "${TUNE_FEATURES_tune-armv5} vfp"
+TUNE_FEATURES_tune-armv5t-vfp ?= "${TUNE_FEATURES_tune-armv5t} vfp"
+TUNE_FEATURES_tune-armv5hf-vfp ?= "${TUNE_FEATURES_tune-armv5-vfp} callconvention-hard"
+TUNE_FEATURES_tune-armv5thf-vfp ?= "${TUNE_FEATURES_tune-armv5t-vfp} callconvention-hard"
+PACKAGE_EXTRA_ARCHS_tune-armv5-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5} armv5-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5t-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5t} armv5-vfp armv5t-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5hf-vfp = "armv5hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5thf-vfp = "armv5hf-vfp armv5thf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5tehf-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5thf-vfp} armv5ehf-vfp armv5tehf-vfp"
+
+# Big Endian
+AVAILTUNES += "armv5b armv5tb"
+ARMPKGARCH_tune-armv5b ?= "armv5"
+ARMPKGARCH_tune-armv5tb ?= "armv5"
+TUNE_FEATURES_tune-armv5b ?= "${TUNE_FEATURES_tune-armv5} bigendian"
+TUNE_FEATURES_tune-armv5tb ?= "${TUNE_FEATURES_tune-armv5t} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv5b = "${PACKAGE_EXTRA_ARCHS_tune-armv4b} armv5b"
+PACKAGE_EXTRA_ARCHS_tune-armv5tb = "${PACKAGE_EXTRA_ARCHS_tune-armv4tb} armv5b armv5tb"
+
+# Big Endian + VFP/DSP
+AVAILTUNES += "armv5b-vfp armv5tb-vfp armv5hfb-vfp armv5thfb-vfp"
+ARMPKGARCH_tune-armv5b-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5tb-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5hfb-vfp ?= "armv5"
+ARMPKGARCH_tune-armv5thfb-vfp ?= "armv5"
+TUNE_FEATURES_tune-armv5b-vfp ?= "${TUNE_FEATURES_tune-armv5-vfp} bigendian"
+TUNE_FEATURES_tune-armv5tb-vfp ?= "${TUNE_FEATURES_tune-armv5t-vfp} bigendian"
+TUNE_FEATURES_tune-armv5hfb-vfp ?= "${TUNE_FEATURES_tune-armv5hf-vfp} bigendian"
+TUNE_FEATURES_tune-armv5thfb-vfp ?= "${TUNE_FEATURES_tune-armv5thf-vfp} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv5b-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5b} armv5b-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5tb-vfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5tb} armv5b-vfp armv5tb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5hfb-vfp = "armv5hfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv5thfb-vfp = "armv5hfb-vfp armv5thfb-vfp"
diff --git a/meta/conf/machine/include/arm/arch-armv6.inc b/meta/conf/machine/include/arm/arch-armv6.inc
new file mode 100644
index 0000000..4b0c5bf
--- /dev/null
+++ b/meta/conf/machine/include/arm/arch-armv6.inc
@@ -0,0 +1,50 @@
+DEFAULTTUNE ?= "armv6"
+
+TUNEVALID[armv6] = "Enable instructions for ARMv6"
+TUNECONFLICTS[armv6] = "armv4 armv5"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv6", " -march=armv6", "", d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains("TUNE_FEATURES", "armv6", "armv6:", "" ,d)}"
+
+require conf/machine/include/arm/arch-armv5-dsp.inc
+
+# Little Endian
+AVAILTUNES += "armv6-novfp armv6t-novfp armv6 armv6t armv6hf armv6thf"
+ARMPKGARCH_tune-armv6-novfp ?= "armv6"
+ARMPKGARCH_tune-armv6t-novfp ?= "armv6"
+ARMPKGARCH_tune-armv6 ?= "armv6"
+ARMPKGARCH_tune-armv6t ?= "armv6"
+ARMPKGARCH_tune-armv6hf ?= "armv6"
+ARMPKGARCH_tune-armv6thf ?= "armv6"
+TUNE_FEATURES_tune-armv6-novfp ?= "arm armv6"
+TUNE_FEATURES_tune-armv6t-novfp ?= "${TUNE_FEATURES_tune-armv6-novfp} thumb"
+TUNE_FEATURES_tune-armv6 ?= "${TUNE_FEATURES_tune-armv6-novfp} vfp"
+TUNE_FEATURES_tune-armv6t ?= "${TUNE_FEATURES_tune-armv6t-novfp} vfp"
+TUNE_FEATURES_tune-armv6hf ?= "${TUNE_FEATURES_tune-armv6} callconvention-hard"
+TUNE_FEATURES_tune-armv6thf ?= "${TUNE_FEATURES_tune-armv6t} callconvention-hard"
+PACKAGE_EXTRA_ARCHS_tune-armv6-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5e} armv6"
+PACKAGE_EXTRA_ARCHS_tune-armv6t-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5te} armv6 armv6t"
+PACKAGE_EXTRA_ARCHS_tune-armv6 = "${PACKAGE_EXTRA_ARCHS_tune-armv5e-vfp} armv6 armv6-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6t = "${PACKAGE_EXTRA_ARCHS_tune-armv5te-vfp} armv6 armv6t armv6-vfp armv6t-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6hf = "${PACKAGE_EXTRA_ARCHS_tune-armv5ehf-vfp} armv6hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6thf = "${PACKAGE_EXTRA_ARCHS_tune-armv5tehf-vfp} armv6hf-vfp armv6thf-vfp"
+
+# Big Endian
+AVAILTUNES += "armv6b-novfp armv6tb-novfp armv6b armv6tb armv6hfb armv6thfb"
+ARMPKGARCH_tune-armv6b-novfp ?= "armv6"
+ARMPKGARCH_tune-armv6tb-novfp ?= "armv6"
+ARMPKGARCH_tune-armv6b ?= "armv6"
+ARMPKGARCH_tune-armv6tb ?= "armv6"
+ARMPKGARCH_tune-armv6hfb ?= "armv6"
+ARMPKGARCH_tune-armv6thfb ?= "armv6"
+TUNE_FEATURES_tune-armv6b-novfp ?= "${TUNE_FEATURES_tune-armv6-novfp} bigendian"
+TUNE_FEATURES_tune-armv6tb-novfp ?= "${TUNE_FEATURES_tune-armv6t-novfp} bigendian"
+TUNE_FEATURES_tune-armv6b ?= "${TUNE_FEATURES_tune-armv6} bigendian"
+TUNE_FEATURES_tune-armv6tb ?= "${TUNE_FEATURES_tune-armv6t} bigendian"
+TUNE_FEATURES_tune-armv6hfb ?= "${TUNE_FEATURES_tune-armv6hf} bigendian"
+TUNE_FEATURES_tune-armv6thfb ?= "${TUNE_FEATURES_tune-armv6thf} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv6b-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5eb} armv6b"
+PACKAGE_EXTRA_ARCHS_tune-armv6tb-novfp = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb} armv6b armv6tb"
+PACKAGE_EXTRA_ARCHS_tune-armv6b = "${PACKAGE_EXTRA_ARCHS_tune-armv5eb-vfp} armv6b armv6b-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6tb = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb-vfp} armv6b armv6tb armv6b-vfp armv6tb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6hfb = "${PACKAGE_EXTRA_ARCHS_tune-armv5ehfb-vfp} armv6hfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv6thfb = "${PACKAGE_EXTRA_ARCHS_tune-armv5tehfb-vfp} armv6hfb-vfp armv6thfb-vfp"
diff --git a/meta/conf/machine/include/arm/arch-armv7a.inc b/meta/conf/machine/include/arm/arch-armv7a.inc
new file mode 100644
index 0000000..d3b6f64
--- /dev/null
+++ b/meta/conf/machine/include/arm/arch-armv7a.inc
@@ -0,0 +1,123 @@
+DEFAULTTUNE ?= "armv7a"
+
+TUNEVALID[armv7a] = "Enable instructions for ARMv7-a"
+TUNECONFLICTS[armv7a] = "armv4 armv5 armv6 armv7"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv7a", " -march=armv7-a", "", d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains("TUNE_FEATURES", "armv7a", "armv7a:", "" ,d)}"
+
+require conf/machine/include/arm/arch-armv6.inc
+require conf/machine/include/arm/feature-arm-neon.inc
+
+# Little Endian base configs
+AVAILTUNES += "armv7a armv7at armv7a-vfpv3d16 armv7at-vfpv3d16 armv7a-vfpv3 armv7at-vfpv3 armv7a-neon armv7at-neon"
+ARMPKGARCH_tune-armv7a ?= "armv7a"
+ARMPKGARCH_tune-armv7at ?= "armv7a"
+ARMPKGARCH_tune-armv7a-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7at-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7a-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7at-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7a-neon?= "armv7a"
+ARMPKGARCH_tune-armv7at-neon ?= "armv7a"
+TUNE_FEATURES_tune-armv7a ?= "arm armv7a vfp"
+TUNE_FEATURES_tune-armv7at ?= "${TUNE_FEATURES_tune-armv7a} thumb"
+TUNE_FEATURES_tune-armv7a-vfpv3d16 ?= "${TUNE_FEATURES_tune-armv7a} vfpv3d16"
+TUNE_FEATURES_tune-armv7at-vfpv3d16 ?= "${TUNE_FEATURES_tune-armv7at} vfpv3d16"
+TUNE_FEATURES_tune-armv7a-vfpv3 ?= "${TUNE_FEATURES_tune-armv7a-vfpv3d16} vfpv3"
+TUNE_FEATURES_tune-armv7at-vfpv3 ?= "${TUNE_FEATURES_tune-armv7at-vfpv3d16} vfpv3"
+TUNE_FEATURES_tune-armv7a-neon ?= "${TUNE_FEATURES_tune-armv7a} neon"
+TUNE_FEATURES_tune-armv7at-neon ?= "${TUNE_FEATURES_tune-armv7at} neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7a = "${PACKAGE_EXTRA_ARCHS_tune-armv6} armv7a armv7a-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} armv7a-vfp-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-vfpv3d16} armv7a-vfp-vfpv3d16-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7a-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} armv7a-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7at = "${PACKAGE_EXTRA_ARCHS_tune-armv6t} armv7a armv7a-vfp armv7at2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7a-vfp-vfpv3d16 armv7at2-vfp-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-vfpv3d16} armv7a-vfp-vfpv3d16-vfpv3 armv7at2-vfp-vfpv3d16-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7at-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7a-vfp-neon armv7at2-vfp-neon"
+
+# VFP Tunes
+AVAILTUNES += "armv7ahf armv7athf armv7ahf-vfpv3d16 armv7athf-vfpv3d16 armv7ahf-vfpv3 armv7athf-vfpv3 armv7ahf-neon armv7athf-neon armv7ahf-neon-vfpv4 armv7athf-neon-vfpv4"
+ARMPKGARCH_tune-armv7ahf ?= "armv7a"
+ARMPKGARCH_tune-armv7athf ?= "armv7a"
+ARMPKGARCH_tune-armv7ahf-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7athf-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7ahf-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7athf-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7ahf-neon?= "armv7a"
+ARMPKGARCH_tune-armv7athf-neon ?= "armv7a"
+ARMPKGARCH_tune-armv7ahf-neon-vfpv4 ?= "armv7a"
+ARMPKGARCH_tune-armv7athf-neon-vfpv4 ?= "armv7a"
+TUNE_FEATURES_tune-armv7ahf ?= "${TUNE_FEATURES_tune-armv7a} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf ?= "${TUNE_FEATURES_tune-armv7at} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-vfpv3d16 ?= "${TUNE_FEATURES_tune-armv7a-vfpv3d16} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf-vfpv3d16 ?= "${TUNE_FEATURES_tune-armv7at-vfpv3d16} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-vfpv3 ?= "${TUNE_FEATURES_tune-armv7a-vfpv3} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf-vfpv3 ?= "${TUNE_FEATURES_tune-armv7at-vfpv3} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-neon ?= "${TUNE_FEATURES_tune-armv7a-neon} callconvention-hard"
+TUNE_FEATURES_tune-armv7athf-neon ?= "${TUNE_FEATURES_tune-armv7at-neon} callconvention-hard"
+TUNE_FEATURES_tune-armv7ahf-neon-vfpv4 ?= "${TUNE_FEATURES_tune-armv7ahf-neon} vfpv4"
+TUNE_FEATURES_tune-armv7athf-neon-vfpv4 ?= "${TUNE_FEATURES_tune-armv7athf-neon} vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf = "${PACKAGE_EXTRA_ARCHS_tune-armv6hf} armv7ahf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7athf = "${PACKAGE_EXTRA_ARCHS_tune-armv6thf} armv7ahf-vfp armv7at2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} armv7ahf-vfp-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} armv7ahf-vfp-vfpv3d16 armv7at2hf-vfp-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-vfpv3d16} armv7ahf-vfp-vfpv3d16-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-vfpv3d16} armv7ahf-vfp-vfpv3d16-vfpv3 armv7at2hf-vfp-vfpv3d16-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} armv7ahf-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} armv7ahf-vfp-neon armv7at2hf-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} armv7ahf-vfp-neon-vfpv4"
+PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} armv7ahf-vfp-neon-vfpv4 armv7at2hf-vfp-neon-vfpv4"
+
+# Big Endian
+AVAILTUNES += "armv7ab armv7atb armv7ab-vfpv3d16 armv7atb-vfpv3d16 armv7ab-vfpv3 armv7atb-vfpv3 armv7ab-neon armv7atb-neon"
+ARMPKGARCH_tune-armv7ab ?= "armv7a"
+ARMPKGARCH_tune-armv7atb ?= "armv7a"
+ARMPKGARCH_tune-armv7ab-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7atb-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7ab-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7atb-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7ab-neon?= "armv7a"
+ARMPKGARCH_tune-armv7atb-neon ?= "armv7a"
+TUNE_FEATURES_tune-armv7ab ?= "${TUNE_FEATURES_tune-armv7a} bigendian"
+TUNE_FEATURES_tune-armv7atb ?= "${TUNE_FEATURES_tune-armv7at} bigendian"
+TUNE_FEATURES_tune-armv7ab-vfpv3d16 ?= "${TUNE_FEATURES_tune-armv7a-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7atb-vfpv3d16 ?= "${TUNE_FEATURES_tune-armv7at-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7ab-vfpv3 ?= "${TUNE_FEATURES_tune-armv7a-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7atb-vfpv3 ?= "${TUNE_FEATURES_tune-armv7at-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7ab-neon ?= "${TUNE_FEATURES_tune-armv7a-neon} bigendian"
+TUNE_FEATURES_tune-armv7atb-neon ?= "${TUNE_FEATURES_tune-armv7at-neon} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab = "${PACKAGE_EXTRA_ARCHS_tune-armv6b} armv7ab-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7atb = "${PACKAGE_EXTRA_ARCHS_tune-armv6tb} armv7ab-vfp armv7at2b-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab} armv7ab-vfp-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7atb-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab} armv7ab-vfp-vfpv3d16 armv7at2b-vfp-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3d16} armv7ab-vfp-vfpv3d16-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7atb-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab-vfpv3d16} armv7ab-vfp-vfpv3d16-vfpv3 armv7at2b-vfp-vfpv3d16-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ab-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ab} armv7ab-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7atb-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7atb} armv7ab-vfp-neon armv7at2b-vfp-neon"
+
+# Big Endian + VFP
+AVAILTUNES += "armv7ahfb armv7athfb armv7ahfb-vfpv3d16 armv7athfb-vfpv3d16 armv7ahfb-vfpv3 armv7athfb-vfpv3 armv7ahfb-neon armv7athfb-neon"
+ARMPKGARCH_tune-armv7ahfb ?= "armv7a"
+ARMPKGARCH_tune-armv7athfb ?= "armv7a"
+ARMPKGARCH_tune-armv7ahfb-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7athfb-vfpv3d16 ?= "armv7a"
+ARMPKGARCH_tune-armv7ahfb-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7athfb-vfpv3 ?= "armv7a"
+ARMPKGARCH_tune-armv7ahfb-neon?= "armv7a"
+ARMPKGARCH_tune-armv7athfb-neon ?= "armv7a"
+TUNE_FEATURES_tune-armv7ahfb ?= "${TUNE_FEATURES_tune-armv7ahf} bigendian"
+TUNE_FEATURES_tune-armv7athfb ?= "${TUNE_FEATURES_tune-armv7athf} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-vfpv3d16 ?= "${TUNE_FEATURES_tune-armv7ahf-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7athfb-vfpv3d16 ?= "${TUNE_FEATURES_tune-armv7athf-vfpv3d16} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-vfpv3 ?= "${TUNE_FEATURES_tune-armv7ahf-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7athfb-vfpv3 ?= "${TUNE_FEATURES_tune-armv7athf-vfpv3} bigendian"
+TUNE_FEATURES_tune-armv7ahfb-neon ?= "${TUNE_FEATURES_tune-armv7ahf-neon} bigendian"
+TUNE_FEATURES_tune-armv7athfb-neon ?= "${TUNE_FEATURES_tune-armv7athf-neon} bigendian"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb = "${PACKAGE_EXTRA_ARCHS_tune-armv6hfb} armv7ahfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7athfb = "${PACKAGE_EXTRA_ARCHS_tune-armv6thfb} armv7ahfb-vfp armv7at2hfb-vfp"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb} armv7ahfb-vfp-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7athfb-vfpv3d16 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb} armv7ahfb-vfp-vfpv3d16 armv7at2hfb-vfp-vfpv3d16"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-vfpv3d16} armv7ahfb-vfp-vfpv3d16-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7athfb-vfpv3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb-vfpv3d16} armv7ahfb-vfp-vfpv3d16-vfpv3 armv7at2hfb-vfp-vfpv3d16-vfpv3"
+PACKAGE_EXTRA_ARCHS_tune-armv7ahfb-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahfb} armv7ahfb-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-armv7athfb-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athfb} armv7ahfb-vfp-neon armv7at2hfb-vfp-neon"
diff --git a/meta/conf/machine/include/arm/arch-armv8.inc b/meta/conf/machine/include/arm/arch-armv8.inc
new file mode 100644
index 0000000..5e832fa
--- /dev/null
+++ b/meta/conf/machine/include/arm/arch-armv8.inc
@@ -0,0 +1 @@
+require conf/machine/include/arm/arch-arm64.inc
diff --git a/meta/conf/machine/include/arm/feature-arm-neon.inc b/meta/conf/machine/include/arm/feature-arm-neon.inc
new file mode 100644
index 0000000..e8b2b85
--- /dev/null
+++ b/meta/conf/machine/include/arm/feature-arm-neon.inc
@@ -0,0 +1,3 @@
+TUNEVALID[neon] = "Enable Neon SIMD accelerator unit."
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "neon", bb.utils.contains("TUNE_FEATURES", "vfpv4", " -mfpu=neon-vfpv4", " -mfpu=neon", d), "" , d)}"
+ARMPKGSFX_FPU .= "${@bb.utils.contains("TUNE_FEATURES", "neon", "-neon", "", d)}"
diff --git a/meta/conf/machine/include/arm/feature-arm-thumb.inc b/meta/conf/machine/include/arm/feature-arm-thumb.inc
new file mode 100644
index 0000000..5632171
--- /dev/null
+++ b/meta/conf/machine/include/arm/feature-arm-thumb.inc
@@ -0,0 +1,49 @@
+# The instruction set the compiler should use when generating application
+# code. The kernel is always compiled with arm code at present. arm code
+# is the original 32 bit ARM instruction set, thumb code is the 16 bit
+# encoded RISC sub-set. Thumb code is smaller (maybe 70% of the ARM size)
+# but requires more instructions (140% for 70% smaller code) so may be
+# slower.
+TUNEVALID[thumb] = "Use thumb instructions instead of ARM"
+ARM_THUMB_OPT = "${@['arm', 'thumb'][d.getVar('ARM_INSTRUCTION_SET', True) == 'thumb']}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv4',  't',  '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv5',  't',  '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv6',  't',  '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7a', 't2', '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7r', 't2', '', d)}"
+ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7m', 't2', '', d)}"
+
+# If the device supports ARM, then respect ARM_THUMB_OPT (which can be "arm" or "thumb")
+# If the defice doesn't support ARM, then always set "thumb" even when
+# some recipe explicitly sets ARM_INSTRUCTION_SET to "arm"
+ARM_M_OPT = "${@bb.utils.contains('TUNE_FEATURES', 'arm', '${ARM_THUMB_OPT}', 'thumb', d)}"
+python () {
+    if bb.utils.contains('TUNE_FEATURES', 'thumb', 'False', 'True', d):
+        return
+    selected = d.getVar('ARM_INSTRUCTION_SET', True)
+    if selected == None:
+        return
+    used = d.getVar('ARM_M_OPT', True)
+    if selected != used:
+        pn = d.getVar('PN', True)
+        bb.warn("Recipe '%s' selects ARM_INSTRUCTION_SET to be '%s', but tune configuration overrides it to '%s'" % (pn, selected, used))
+}
+
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' -m${ARM_M_OPT}', '', d)}"
+OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ':thumb', '', d)}"
+
+# Add suffix from ARM_THUMB_SUFFIX only if after all this we still set ARM_M_OPT to thumb
+ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', '${ARM_THUMB_SUFFIX}', '', d) if d.getVar('ARM_M_OPT', True) == 'thumb' else ''}"
+
+# Whether to compile with code to allow interworking between the two
+# instruction sets. This allows thumb code to be executed on a primarily
+# arm system and vice versa. It is strongly recommended that DISTROs not
+# turn this off - the actual cost is very small.
+TUNEVALID[no-thumb-interwork] = "Disable mixing of thumb and ARM functions"
+THUMB_TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'no-thumb-interwork', ' -mno-thumb-interwork', ' -mthumb-interwork', d)}"
+THUMB_OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'no-thumb-interwork', ':thumb-interwork', '', d)}"
+TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' ${THUMB_TUNE_CCARGS}', '', d)}"
+OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', '${THUMB_OVERRIDES}', '', d)}"
+
+# what about armv7m devices which don't support -marm (e.g. Cortex-M3)?
+TARGET_CC_KERNEL_ARCH += "${@bb.utils.contains('TUNE_FEATURES', 'thumb', '-mno-thumb-interwork -marm', '', d)}"
diff --git a/meta/conf/machine/include/arm/feature-arm-vfp.inc b/meta/conf/machine/include/arm/feature-arm-vfp.inc
new file mode 100644
index 0000000..3dfbeac
--- /dev/null
+++ b/meta/conf/machine/include/arm/feature-arm-vfp.inc
@@ -0,0 +1,17 @@
+TUNEVALID[vfp] = "Enable Vector Floating Point (vfp) unit."
+ARMPKGSFX_FPU .= "${@bb.utils.contains("TUNE_FEATURES", "vfp", "-vfp", "" ,d)}"
+
+TUNEVALID[vfpv3d16] = "Enable Vector Floating Point Version 3 with 16 registers (vfpv3-d16) unit."
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "vfpv3d16", " -mfpu=vfpv3-d16", "", d)}"
+ARMPKGSFX_FPU .= "${@bb.utils.contains("TUNE_FEATURES", "vfpv3d16", "-vfpv3d16", "" ,d)}"
+
+TUNEVALID[vfpv3] = "Enable Vector Floating Point Version 3 with 32 registers (vfpv3) unit."
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "vfpv3", " -mfpu=vfpv3", "", d)}"
+ARMPKGSFX_FPU .= "${@bb.utils.contains("TUNE_FEATURES", "vfpv3", "-vfpv3", "" ,d)}"
+
+TUNEVALID[vfpv4] = "Enable Vector Floating Point Version 4 (vfpv4) unit."
+ARMPKGSFX_FPU .= "${@bb.utils.contains("TUNE_FEATURES", "vfpv4", "-vfpv4", "" ,d)}"
+
+TUNEVALID[callconvention-hard] = "Enable EABI hard float call convention, requires VFP."
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "vfp", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", " -mfloat-abi=hard", " -mfloat-abi=softfp", d), "" ,d)}"
+ARMPKGSFX_EABI .= "${@bb.utils.contains("TUNE_FEATURES", [ "callconvention-hard", "vfp" ], "hf", "", d)}"
diff --git a/meta/conf/machine/include/mips/README b/meta/conf/machine/include/mips/README
new file mode 100644
index 0000000..c375f31
--- /dev/null
+++ b/meta/conf/machine/include/mips/README
@@ -0,0 +1,36 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+  - Initial Version
+
+MIPS currently defines 12 ABIs.  Combinations of:
+ *) Big/Little Endian
+ *) Hardware/Software Floating Point
+ *) o32, n32, n64 ABI
+
+TUNE_ARCH, the GNU canonical arch, is defined as:
+
+mips${MIPSPKGSFX_BYTE}${MIPSPKGSFX_ENDIAN}
+
+The package arch is defined in such a way to generated a standard naming
+scheme.  The scheme is: <mips variant>[-nf][-n32]
+
+TUNE_PKGARCH is defined as:
+
+${MIPSPKGSFX_VARIANT_tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPSPKGSFX_ABI}
+
+The following is a list of MIPS specific variables:
+
+MIPSPKGSFX_BYTE - This is defined as either blank and "64" for MIPS64 CPUs.
+
+MIPSPKGSFX_ENDIAN - For bigendian hardware this is blank, otherwise it's
+defined as "el".
+
+MIPSPKGSFX_VARIANT_tune-<tune> - In the default tunings it is set to the
+same value as TUNE_ARCH.  In custom, optimized tunings, the value should
+be modified to more precisely describe the tuning.
+
+MIPSPKGSFX_FPU - The value is set to "" or "-nf", where "-nf" indicates 
+that the tune is using a non-floating point ABI.
+
+MIPSPKGSFX_ABI - This is used to specify an alternative ABI when the previous
+values are not enough to distringuish the package.  "-n32" is added when
+building for N32 ABI.
diff --git a/meta/conf/machine/include/mips/arch-mips.inc b/meta/conf/machine/include/mips/arch-mips.inc
new file mode 100644
index 0000000..02626d3
--- /dev/null
+++ b/meta/conf/machine/include/mips/arch-mips.inc
@@ -0,0 +1,102 @@
+# MIPS Architecture definition
+# 12 defined ABIs, all combinations of:
+# *) Big/Little Endian
+# *) Hardware/Software Floating Point
+# *) o32, n32, n64 ABI
+
+DEFAULTTUNE ?= "mips"
+
+# Endianess
+TUNEVALID[bigendian] = "Enable big-endian mode"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -meb", " -mel", d)}"
+
+# ABI flags
+TUNEVALID[o32] = "MIPS o32 ABI"
+TUNECONFLICTS[o32] = "n32 n64"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "o32", " -mabi=32", "", d)}"
+
+TUNEVALID[n32] = "MIPS64 n32 ABI"
+TUNECONFLICTS[n32] = "o32 n64"
+ABIEXTENSION .= "${@bb.utils.contains("TUNE_FEATURES", "n32", "n32", "" ,d)}"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "n32", " -mabi=n32", "", d)}"
+
+TUNEVALID[n64] = "MIPS64 n64 ABI"
+TUNECONFLICTS[n64] = "o32 n32"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "n64", " -mabi=64", "", d)}"
+
+# Floating point
+TUNEVALID[fpu-hard] = "Use hardware FPU"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard", " -mhard-float", " -msoft-float", d)}"
+TARGET_FPU = "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard", "", "soft", d)}"
+
+# Package naming
+MIPSPKGSFX_ENDIAN = "${@bb.utils.contains("TUNE_FEATURES", "bigendian", "", "el", d)}"
+MIPSPKGSFX_BYTE = "${@bb.utils.contains("TUNE_FEATURES", "n64" , "64", "", d)}"
+MIPSPKGSFX_BYTE .= "${@bb.utils.contains("TUNE_FEATURES", "n32" , "64", "", d)}"
+MIPSPKGSFX_FPU = "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard" , "", "-nf", d)}"
+MIPSPKGSFX_ABI = "${@bb.utils.contains("TUNE_FEATURES", "n32", "-n32", "", d)}"
+
+TUNE_ARCH = "mips${MIPSPKGSFX_BYTE}${MIPSPKGSFX_ENDIAN}"
+TUNE_PKGARCH = "${MIPSPKGSFX_VARIANT_tune-${DEFAULTTUNE}}${MIPSPKGSFX_FPU}${MIPSPKGSFX_ABI}"
+
+# Base tunes
+AVAILTUNES += "mips mips64-n32 mips64 mipsel mips64el-n32 mips64el mips-nf mips64-nf-n32 mips64-nf mipsel-nf mips64el-nf-n32 mips64el-nf"
+TUNE_FEATURES_tune-mips = "o32 bigendian fpu-hard"
+BASE_LIB_tune-mips = "lib"
+MIPSPKGSFX_VARIANT_tune-mips = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips = "mips"
+
+TUNE_FEATURES_tune-mips64-n32 = "n32 bigendian fpu-hard"
+BASE_LIB_tune-mips64-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64-n32 = "mips64-n32"
+
+TUNE_FEATURES_tune-mips64 = "n64 bigendian fpu-hard"
+BASE_LIB_tune-mips64 = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64 = "mips64"
+
+TUNE_FEATURES_tune-mipsel = "o32 fpu-hard"
+BASE_LIB_tune-mipsel = "lib"
+MIPSPKGSFX_VARIANT_tune-mipsel = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsel = "mipsel"
+
+TUNE_FEATURES_tune-mips64el-n32 = "n32 fpu-hard"
+BASE_LIB_tune-mips64el-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64el-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64el-n32 = "mips64el-n32"
+
+TUNE_FEATURES_tune-mips64el = "n64 fpu-hard"
+BASE_LIB_tune-mips64el = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64el = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64el = "mips64el"
+
+TUNE_FEATURES_tune-mips-nf = "o32 bigendian"
+BASE_LIB_tune-mips-nf = "lib"
+MIPSPKGSFX_VARIANT_tune-mips-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips-nf = "mips-nf"
+
+TUNE_FEATURES_tune-mips64-nf-n32 = "n32 bigendian"
+BASE_LIB_tune-mips64-nf-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64-nf-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64-nf-n32 = "mips64-nf-n32"
+
+TUNE_FEATURES_tune-mips64-nf = "n64 bigendian"
+BASE_LIB_tune-mips64-nf = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64-nf = "mips64-nf"
+
+TUNE_FEATURES_tune-mipsel-nf = "o32"
+BASE_LIB_tune-mipsel-nf = "lib"
+MIPSPKGSFX_VARIANT_tune-mipsel-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mipsel-nf = "mipsel-nf"
+
+TUNE_FEATURES_tune-mips64el-nf-n32 = "n32"
+BASE_LIB_tune-mips64el-nf-n32 = "lib32"
+MIPSPKGSFX_VARIANT_tune-mips64el-nf-n32 = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64el-nf-n32 = "mips64el-nf-n32"
+
+TUNE_FEATURES_tune-mips64el-nf = "n64"
+BASE_LIB_tune-mips64el-nf = "lib64"
+MIPSPKGSFX_VARIANT_tune-mips64el-nf = "${TUNE_ARCH}"
+PACKAGE_EXTRA_ARCHS_tune-mips64el-nf = "mips64el-nf"
diff --git a/meta/conf/machine/include/powerpc/README b/meta/conf/machine/include/powerpc/README
new file mode 100644
index 0000000..e87fb50
--- /dev/null
+++ b/meta/conf/machine/include/powerpc/README
@@ -0,0 +1,17 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+  - Initial revision
+
+There are 4 primary PowerPC ABIs.
+# *) Hard/Soft Floating Point
+# *) 32-bit/64-bit
+
+TUNE_ARCH is defined as either "powerpc" or "powerpc64" based on the m32 
+or m64 feature.
+
+May of the PowerPC package archictures are based on legacy Linux names.
+However, a general naming scheme should be similar to: ppc[64][<family>][-nf].
+(Note: the default package architectures are "powerpc" and "powerpc64".)
+
+TUNE_PKGARCH is defined as TUNE_PKGARCH_tune-${DEFAULTTUNE}.  All 
+PowerPC tunings are required to define TUNE_PKGARCH_tune-<tune>.
+
diff --git a/meta/conf/machine/include/powerpc/arch-powerpc.inc b/meta/conf/machine/include/powerpc/arch-powerpc.inc
new file mode 100644
index 0000000..036ca3c
--- /dev/null
+++ b/meta/conf/machine/include/powerpc/arch-powerpc.inc
@@ -0,0 +1,34 @@
+# Power Architecture definition
+# Four defined ABIs, all combinations of:
+# *) Hard/Soft Floating Point
+# *) 32-bit/64-bit
+
+DEFAULTTUNE ?= "powerpc"
+
+TUNE_PKGARCH = "${TUNE_PKGARCH_tune-${DEFAULTTUNE}}"
+ABIEXTENSION ?= ""
+
+TUNEVALID[m32] = "Power ELF32 standard ABI"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "m32", " -m32", "", d)}"
+TUNE_ARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m32", "powerpc", "", d)}"
+
+TUNEVALID[fpu-hard] = "Use hardware FPU."
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "fpu-hard", " -mhard-float", "", d)}"
+
+TUNEVALID[fpu-soft] = "Use software FPU."
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "fpu-soft", " -msoft-float", "", d)}"
+TARGET_FPU .= "${@bb.utils.contains("TUNE_FEATURES", "fpu-soft", "soft", "", d)}"
+
+TUNEVALID[altivec] = "Altivec"
+
+# Basic tune definitions
+AVAILTUNES += "powerpc powerpc-nf" 
+TUNE_FEATURES_tune-powerpc-nf = "m32 fpu-soft"
+BASE_LIB_tune-powerpc-nf = "lib"
+TUNE_PKGARCH_tune-powerpc-nf = "powerpc-nf"
+PACKAGE_EXTRA_ARCHS_tune-powerpc-nf = "powerpc-nf"
+
+TUNE_FEATURES_tune-powerpc = "m32 fpu-hard"
+BASE_LIB_tune-powerpc = "lib"
+TUNE_PKGARCH_tune-powerpc = "powerpc"
+PACKAGE_EXTRA_ARCHS_tune-powerpc = "powerpc"
diff --git a/meta/conf/machine/include/powerpc/arch-powerpc64.inc b/meta/conf/machine/include/powerpc/arch-powerpc64.inc
new file mode 100644
index 0000000..8476dec
--- /dev/null
+++ b/meta/conf/machine/include/powerpc/arch-powerpc64.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "powerpc64"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[m64] = "Power ELF64 standard ABI"
+TUNECONFLICTS[m64] = "m32 nf"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "m64", " -m64", "", d)}"
+TUNE_ARCH .= "${@bb.utils.contains("TUNE_FEATURES", [ "m64" ], "powerpc64", "", d)}"
+
+AVAILTUNES += "powerpc64"
+TUNE_FEATURES_tune-powerpc64 ?= "m64 fpu-hard"
+BASE_LIB_tune-powerpc64 = "lib64"
+TUNE_PKGARCH_tune-powerpc64 = "powerpc64"
+PACKAGE_EXTRA_ARCHS_tune-powerpc64 = "powerpc64"
diff --git a/meta/conf/machine/include/qemu.inc b/meta/conf/machine/include/qemu.inc
new file mode 100644
index 0000000..d5c0b37
--- /dev/null
+++ b/meta/conf/machine/include/qemu.inc
@@ -0,0 +1,29 @@
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/egl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
+
+XSERVER ?= "xserver-xorg \
+            ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast', '', d)} \
+            xf86-input-evdev \
+            xf86-input-mouse \
+            xf86-video-fbdev \
+            xf86-input-keyboard"
+
+MACHINE_FEATURES = "alsa bluetooth usbgadget screen"
+
+MACHINEOVERRIDES =. "qemuall:"
+
+IMAGE_FSTYPES += "tar.bz2 ext4"
+
+# Don't include kernels in standard images
+RDEPENDS_kernel-base = ""
+
+# Use a common kernel recipe for all QEMU machines
+PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto"
+
+EXTRA_IMAGEDEPENDS += "qemu-native qemu-helper-native"
+
+# Provide the nfs server kernel module for all qemu images
+KERNEL_FEATURES_append_pn-linux-yocto = " features/nfsd/nfsd-enable.scc"
diff --git a/meta/conf/machine/include/sh/README b/meta/conf/machine/include/sh/README
new file mode 100644
index 0000000..b351acd
--- /dev/null
+++ b/meta/conf/machine/include/sh/README
@@ -0,0 +1,11 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+ - Initial Revision
+
+Both big endian and little endian are defined for SH.
+
+Experimental -- SH tunings have not been validated.
+
+The TUNE_ARCH is defined as ${TUNE_ARCH_tune-${DEFAULTTUNE}}.
+
+The TUNE_PKGARCH is defind as ${TUNE_PKGARCH_tune-${DEFAULTTUNE}}.
+
diff --git a/meta/conf/machine/include/sh/arch-sh.inc b/meta/conf/machine/include/sh/arch-sh.inc
new file mode 100644
index 0000000..64d4cac
--- /dev/null
+++ b/meta/conf/machine/include/sh/arch-sh.inc
@@ -0,0 +1,9 @@
+# SH Architecture definition
+
+DEFAULTTUNE ?= "sh"
+
+TUNE_ARCH = "${TUNE_ARCH_tune-${DEFAULTTUNE}}"
+TUNE_PKGARCH = "${TUNE_PKGARCH_tune-${DEFAULTTUNE}}"
+
+TUNEVALID[bigendian] = "Enabled big-endian mode."
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "bigendian", " -mb", " -ml", d)}"
diff --git a/meta/conf/machine/include/soc-family.inc b/meta/conf/machine/include/soc-family.inc
new file mode 100644
index 0000000..1ff0899
--- /dev/null
+++ b/meta/conf/machine/include/soc-family.inc
@@ -0,0 +1,3 @@
+# Add SOC_FAMILY to machine overrides so we get access to e.g. 'omap3' and 'ti335x'
+SOC_FAMILY ??= ""
+MACHINEOVERRIDES =. "${@['', '${SOC_FAMILY}:']['${SOC_FAMILY}' != '']}"
diff --git a/meta/conf/machine/include/tune-arm1136jf-s.inc b/meta/conf/machine/include/tune-arm1136jf-s.inc
new file mode 100644
index 0000000..4a131b6
--- /dev/null
+++ b/meta/conf/machine/include/tune-arm1136jf-s.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv6"
+
+require conf/machine/include/arm/arch-armv6.inc
+
+TUNEVALID[arm1136jfs] = "Enable arm1136jfs specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "arm1136jfs", " -mtune=arm1136jf-s", "", d)}"
+
+AVAILTUNES += "arm1136jfs"
+ARMPKGARCH_tune-arm1136jfs = "arm1136jfs"
+TUNE_FEATURES_tune-arm1136jfs = "${TUNE_FEATURES_tune-armv6} arm1136jfs"
+PACKAGE_EXTRA_ARCHS_tune-arm1136jfs = "${PACKAGE_EXTRA_ARCHS_tune-armv6} arm1136jfs-vfp"
diff --git a/meta/conf/machine/include/tune-arm920t.inc b/meta/conf/machine/include/tune-arm920t.inc
new file mode 100644
index 0000000..0a2eae6
--- /dev/null
+++ b/meta/conf/machine/include/tune-arm920t.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv4t"
+
+require conf/machine/include/arm/arch-armv4.inc
+
+TUNEVALID[arm920t] = "Enable arm920t specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "arm920t", " -mtune=arm920t", "", d)}"
+
+AVAILTUNES += "arm920t"
+ARMPKGARCH_tune-arm920t = "arm920t"
+TUNE_FEATURES_tune-arm920t = "${TUNE_FEATURES_tune-armv4t} arm920t"
+PACKAGE_EXTRA_ARCHS_tune-arm920t = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} arm920t arm920tt"
diff --git a/meta/conf/machine/include/tune-arm926ejs.inc b/meta/conf/machine/include/tune-arm926ejs.inc
new file mode 100644
index 0000000..335e4e0
--- /dev/null
+++ b/meta/conf/machine/include/tune-arm926ejs.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv5te"
+
+require conf/machine/include/arm/arch-armv5-dsp.inc
+
+TUNEVALID[arm926ejs] = "Enable arm926ejs specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "arm926ejs", " -mtune=arm926ej-s", "", d)}"
+
+AVAILTUNES += "arm926ejs"
+ARMPKGARCH_tune-arm926ejs = "arm926ejs"
+TUNE_FEATURES_tune-arm926ejs = "${TUNE_FEATURES_tune-armv5te} arm926ejs"
+PACKAGE_EXTRA_ARCHS_tune-arm926ejs = "${PACKAGE_EXTRA_ARCHS_tune-armv5te} arm926ejste"
diff --git a/meta/conf/machine/include/tune-arm9tdmi.inc b/meta/conf/machine/include/tune-arm9tdmi.inc
new file mode 100644
index 0000000..dee57c9
--- /dev/null
+++ b/meta/conf/machine/include/tune-arm9tdmi.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv4t"
+
+require conf/machine/include/arm/arch-armv4.inc
+
+TUNEVALID[arm9tdmi] = "Enable arm9tdmi specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "arm9tdmi", " -mtune=arm9tdmi", "", d)}"
+
+AVAILTUNES += "arm9tdmi"
+ARMPKGARCH_tune-arm9tdmi = "arm9tdmi"
+TUNE_FEATURES_tune-arm9tdmi = "${TUNE_FEATURES_tune-armv4t} arm9tdmi"
+PACKAGE_EXTRA_ARCHS_tune-arm9tdmi = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} arm9tdmit"
diff --git a/meta/conf/machine/include/tune-atom.inc b/meta/conf/machine/include/tune-atom.inc
new file mode 100644
index 0000000..5e1bb74
--- /dev/null
+++ b/meta/conf/machine/include/tune-atom.inc
@@ -0,0 +1,2 @@
+# Atom tunings are the same as core2 for now...
+require conf/machine/include/tune-core2.inc
diff --git a/meta/conf/machine/include/tune-c3.inc b/meta/conf/machine/include/tune-c3.inc
new file mode 100644
index 0000000..fafc28a
--- /dev/null
+++ b/meta/conf/machine/include/tune-c3.inc
@@ -0,0 +1,12 @@
+require conf/machine/include/x86/arch-x86.inc
+
+TUNEVALID[c3] = "VIA Cyrix III or VIA C3 specific optimizations"
+TUNECONFLICTS[c3] = "m64 mx32"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "c3", " -march=c3 -mtune=c3", "", d)}"
+
+AVAILTUNES += "c3"
+TUNE_FEATURES_tune-c3 = "${TUNE_FEATURES_tune-x86} c3"
+BASE_LIBS_tune-c3 = "${BASE_LIB_tune-x86}"
+# The following should likely be something other then i586...
+TUNE_PKGARCH_tune-c3 = "i586"
+PACKAGE_EXTRA_ARCHS_tune-c3 = "${PACKAGE_EXTRA_ARCHS_tune-x86} i386 i486 i586"
diff --git a/meta/conf/machine/include/tune-core2.inc b/meta/conf/machine/include/tune-core2.inc
new file mode 100644
index 0000000..9a4cb70
--- /dev/null
+++ b/meta/conf/machine/include/tune-core2.inc
@@ -0,0 +1,38 @@
+# Settings for the GCC(1) cpu-type "core2":
+#
+#      Intel Core2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
+#      instruction set support.
+#
+# This tune is recommended for the Intel Core 2 CPU family, including Conroe,
+# Merom and beyond, as well as the first Atom CPUs, Diamondville, and beyond.
+#
+DEFAULTTUNE ?= "core2-32"
+
+# Set x86 target arch to i686, so that glibc enables SSE optimised memcpy, etc.
+X86ARCH32 ?= "i686"
+
+# Include the previous tune to pull in PACKAGE_EXTRA_ARCHS
+require conf/machine/include/tune-i586.inc
+
+# Extra tune features
+TUNEVALID[core2] = "Enable core2 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "core2", " -march=core2 -mtune=core2 -msse3 -mfpmath=sse", "", d)}"
+
+# Extra tune selections
+AVAILTUNES += "core2-32"
+TUNE_FEATURES_tune-core2-32 = "${TUNE_FEATURES_tune-x86} core2"
+BASE_LIB_tune-core2-32 = "lib"
+TUNE_PKGARCH_tune-core2-32 = "core2-32"
+PACKAGE_EXTRA_ARCHS_tune-core2-32 = "${PACKAGE_EXTRA_ARCHS_tune-i586} core2-32"
+
+AVAILTUNES += "core2-64"
+TUNE_FEATURES_tune-core2-64 = "${TUNE_FEATURES_tune-x86-64} core2"
+BASE_LIB_tune-core2-64 = "lib64"
+TUNE_PKGARCH_tune-core2-64 = "core2-64"
+PACKAGE_EXTRA_ARCHS_tune-core2-64 = "${PACKAGE_EXTRA_ARCHS_tune-x86-64} core2-64"
+
+AVAILTUNES += "core2-64-x32"
+TUNE_FEATURES_tune-core2-64-x32 = "${TUNE_FEATURES_tune-x86-64-x32} core2"
+BASE_LIB_tune-core2-64-x32 = "libx32"
+TUNE_PKGARCH_tune-core2-64-x32 = "core2-64-x32"
+PACKAGE_EXTRA_ARCHS_tune-core2-64-x32 = "${PACKAGE_EXTRA_ARCHS_tune-x86-64-x32} core2-64-x32"
diff --git a/meta/conf/machine/include/tune-corei7.inc b/meta/conf/machine/include/tune-corei7.inc
new file mode 100644
index 0000000..42cf932
--- /dev/null
+++ b/meta/conf/machine/include/tune-corei7.inc
@@ -0,0 +1,35 @@
+# Settings for the GCC(1) cpu-type "corei7":
+#
+#     Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1
+#     and SSE4.2 instruction set support.
+#
+# This tune is recommended for Intel Nehalem and Silvermont (e.g. Bay Trail) CPUs
+# (and beyond).
+#
+DEFAULTTUNE ?= "corei7-64"
+
+# Pull in the previous tune in to pull in PACKAGE_EXTRA_ARCHS
+require conf/machine/include/tune-core2.inc
+
+# Extra tune features
+TUNEVALID[corei7] = "Enable corei7 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "corei7", " -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2", "", d)}"
+
+# Extra tune selections
+AVAILTUNES += "corei7-32"
+TUNE_FEATURES_tune-corei7-32 = "${TUNE_FEATURES_tune-x86} corei7"
+BASE_LIB_tune-corei7-32 = "lib"
+TUNE_PKGARCH_tune-corei7-32 = "corei7-32"
+PACKAGE_EXTRA_ARCHS_tune-corei7-32 = "${PACKAGE_EXTRA_ARCHS_tune-core2} corei7-32"
+
+AVAILTUNES += "corei7-64"
+TUNE_FEATURES_tune-corei7-64 = "${TUNE_FEATURES_tune-x86-64} corei7"
+BASE_LIB_tune-corei7-64 = "lib64"
+TUNE_PKGARCH_tune-corei7-64 = "corei7-64"
+PACKAGE_EXTRA_ARCHS_tune-corei7-64 = "${PACKAGE_EXTRA_ARCHS_tune-core2-64} corei7-64"
+
+AVAILTUNES += "corei7-64-x32"
+TUNE_FEATURES_tune-corei7-64-x32 = "${TUNE_FEATURES_tune-x86-64-x32} corei7"
+BASE_LIB_tune-corei7-64-x32 = "libx32"
+TUNE_PKGARCH_tune-corei7-64-x32 = "corei7-64-x32"
+PACKAGE_EXTRA_ARCHS_tune-corei7-64-x32 = "${PACKAGE_EXTRA_ARCHS_tune-core2-64-x32} corei7-64-x32"
diff --git a/meta/conf/machine/include/tune-cortexa15.inc b/meta/conf/machine/include/tune-cortexa15.inc
new file mode 100644
index 0000000..5529777
--- /dev/null
+++ b/meta/conf/machine/include/tune-cortexa15.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "armv7a-neon"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexa15] = "Enable Cortex-A15 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "cortexa15", " -mtune=cortex-a15", "", d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa15 cortexa15t cortexa15-neon cortexa15t-neon"
+ARMPKGARCH_tune-cortexa15 = "cortexa15"
+ARMPKGARCH_tune-cortexa15t = "cortexa15"
+ARMPKGARCH_tune-cortexa15-neon = "cortexa15"
+ARMPKGARCH_tune-cortexa15t-neon = "cortexa15"
+TUNE_FEATURES_tune-cortexa15 = "${TUNE_FEATURES_tune-armv7a} cortexa15"
+TUNE_FEATURES_tune-cortexa15t = "${TUNE_FEATURES_tune-armv7at} cortexa15"
+TUNE_FEATURES_tune-cortexa15-neon = "${TUNE_FEATURES_tune-armv7a-neon} cortexa15"
+TUNE_FEATURES_tune-cortexa15t-neon = "${TUNE_FEATURES_tune-armv7at-neon} cortexa15"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa15-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15t = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa15-vfp cortexa15t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa15-vfp cortexa15-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa15-vfp cortexa15-vfp-neon cortexa15t2-vfp cortexa15t2-vfp-neon"
+
+# VFP Tunes
+AVAILTUNES += "cortexa15hf cortexa15thf cortexa15hf-neon cortexa15thf-neon"
+ARMPKGARCH_tune-cortexa15hf = "cortexa15"
+ARMPKGARCH_tune-cortexa15thf = "cortexa15"
+ARMPKGARCH_tune-cortexa15hf-neon = "cortexa15"
+ARMPKGARCH_tune-cortexa15thf-neon = "cortexa15"
+TUNE_FEATURES_tune-cortexa15hf ?= "${TUNE_FEATURES_tune-armv7ahf} cortexa15"
+TUNE_FEATURES_tune-cortexa15thf ?= "${TUNE_FEATURES_tune-armv7athf} cortexa15"
+TUNE_FEATURES_tune-cortexa15hf-neon ?= "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa15"
+TUNE_FEATURES_tune-cortexa15thf-neon ?= "${TUNE_FEATURES_tune-armv7athf-neon} cortexa15"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa15hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa15hf-vfp cortexa15t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa15hf-vfp cortexa15hf-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa15thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa15hf-vfp cortexa15hf-vfp-neon cortexa15t2hf-vfp cortexa15t2hf-vfp-neon"
diff --git a/meta/conf/machine/include/tune-cortexa17.inc b/meta/conf/machine/include/tune-cortexa17.inc
new file mode 100644
index 0000000..bfc7126
--- /dev/null
+++ b/meta/conf/machine/include/tune-cortexa17.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "armv7a-neon"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexa17] = "Enable Cortex-A17 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "cortexa17", " -mtune=cortex-a17", "", d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa17 cortexa17t cortexa17-neon cortexa17t-neon"
+ARMPKGARCH_tune-cortexa17 = "cortexa17"
+ARMPKGARCH_tune-cortexa17t = "cortexa17"
+ARMPKGARCH_tune-cortexa17-neon = "cortexa17"
+ARMPKGARCH_tune-cortexa17t-neon = "cortexa17"
+TUNE_FEATURES_tune-cortexa17 = "${TUNE_FEATURES_tune-armv7a} cortexa17"
+TUNE_FEATURES_tune-cortexa17t = "${TUNE_FEATURES_tune-armv7at} cortexa17"
+TUNE_FEATURES_tune-cortexa17-neon = "${TUNE_FEATURES_tune-armv7a-neon} cortexa17"
+TUNE_FEATURES_tune-cortexa17t-neon = "${TUNE_FEATURES_tune-armv7at-neon} cortexa17"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa17-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17t = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa17-vfp cortexa17t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa17-vfp cortexa17-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa17-vfp cortexa17-vfp-neon cortexa17t2-vfp cortexa17t2-vfp-neon"
+
+# VFP Tunes
+AVAILTUNES += "cortexa17hf cortexa17thf cortexa17hf-neon cortexa17thf-neon"
+ARMPKGARCH_tune-cortexa17hf = "cortexa17"
+ARMPKGARCH_tune-cortexa17thf = "cortexa17"
+ARMPKGARCH_tune-cortexa17hf-neon = "cortexa17"
+ARMPKGARCH_tune-cortexa17thf-neon = "cortexa17"
+TUNE_FEATURES_tune-cortexa17hf ?= "${TUNE_FEATURES_tune-armv7ahf} cortexa17"
+TUNE_FEATURES_tune-cortexa17thf ?= "${TUNE_FEATURES_tune-armv7athf} cortexa17"
+TUNE_FEATURES_tune-cortexa17hf-neon ?= "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa17"
+TUNE_FEATURES_tune-cortexa17thf-neon ?= "${TUNE_FEATURES_tune-armv7athf-neon} cortexa17"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa17hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa17hf-vfp cortexa17t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa17hf-vfp cortexa17hf-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa17thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa17hf-vfp cortexa17hf-vfp-neon cortexa17t2hf-vfp cortexa17t2hf-vfp-neon"
diff --git a/meta/conf/machine/include/tune-cortexa5.inc b/meta/conf/machine/include/tune-cortexa5.inc
new file mode 100644
index 0000000..139e65c
--- /dev/null
+++ b/meta/conf/machine/include/tune-cortexa5.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "armv7a-neon"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexa5] = "Enable Cortex-A5 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "cortexa5", " -mtune=cortex-a5", "", d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa5 cortexa5t cortexa5-neon cortexa5t-neon"
+ARMPKGARCH_tune-cortexa5 = "cortexa5"
+ARMPKGARCH_tune-cortexa5t = "cortexa5"
+ARMPKGARCH_tune-cortexa5-neon = "cortexa5"
+ARMPKGARCH_tune-cortexa5t-neon = "cortexa5"
+TUNE_FEATURES_tune-cortexa5 = "${TUNE_FEATURES_tune-armv7a} cortexa5"
+TUNE_FEATURES_tune-cortexa5t = "${TUNE_FEATURES_tune-armv7at} cortexa5"
+TUNE_FEATURES_tune-cortexa5-neon = "${TUNE_FEATURES_tune-armv7a-neon} cortexa5"
+TUNE_FEATURES_tune-cortexa5t-neon = "${TUNE_FEATURES_tune-armv7at-neon} cortexa5"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa5-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5t = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa5-vfp cortexa5t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa5-vfp cortexa5-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa5-vfp cortexa5-vfp-neon cortexa5t2-vfp cortexa5t2-vfp-neon"
+
+# VFP Tunes
+AVAILTUNES += "cortexa5hf cortexa5thf cortexa5hf-neon cortexa5thf-neon"
+ARMPKGARCH_tune-cortexa5hf = "cortexa5"
+ARMPKGARCH_tune-cortexa5thf = "cortexa5"
+ARMPKGARCH_tune-cortexa5hf-neon = "cortexa5"
+ARMPKGARCH_tune-cortexa5thf-neon = "cortexa5"
+TUNE_FEATURES_tune-cortexa5hf ?= "${TUNE_FEATURES_tune-armv7ahf} cortexa5"
+TUNE_FEATURES_tune-cortexa5thf ?= "${TUNE_FEATURES_tune-armv7athf} cortexa5"
+TUNE_FEATURES_tune-cortexa5hf-neon ?= "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa5"
+TUNE_FEATURES_tune-cortexa5thf-neon ?= "${TUNE_FEATURES_tune-armv7athf-neon} cortexa5"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa5hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa5hf-vfp cortexa5t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa5hf-vfp cortexa5hf-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa5thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa5hf-vfp cortexa5hf-vfp-neon cortexa5t2hf-vfp cortexa5t2hf-vfp-neon"
diff --git a/meta/conf/machine/include/tune-cortexa7.inc b/meta/conf/machine/include/tune-cortexa7.inc
new file mode 100644
index 0000000..9d06910
--- /dev/null
+++ b/meta/conf/machine/include/tune-cortexa7.inc
@@ -0,0 +1,42 @@
+DEFAULTTUNE ?= "armv7a-neon"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexa7] = "Enable Cortex-A7 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "cortexa7", " -mtune=cortex-a7", "", d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa7 cortexa7t cortexa7-neon cortexa7t-neon"
+ARMPKGARCH_tune-cortexa7 = "cortexa7"
+ARMPKGARCH_tune-cortexa7t = "cortexa7"
+ARMPKGARCH_tune-cortexa7-neon = "cortexa7"
+ARMPKGARCH_tune-cortexa7t-neon = "cortexa7"
+TUNE_FEATURES_tune-cortexa7 = "${TUNE_FEATURES_tune-armv7a} cortexa7"
+TUNE_FEATURES_tune-cortexa7t = "${TUNE_FEATURES_tune-armv7at} cortexa7"
+TUNE_FEATURES_tune-cortexa7-neon = "${TUNE_FEATURES_tune-armv7a-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7t-neon = "${TUNE_FEATURES_tune-armv7at-neon} cortexa7"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa7-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7t = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa7-vfp cortexa7t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa7-vfp cortexa7-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa7-vfp cortexa7-vfp-neon cortexa7t2-vfp cortexa7t2-vfp-neon"
+
+# VFP Tunes
+AVAILTUNES += "cortexa7hf cortexa7thf cortexa7hf-neon cortexa7thf-neon cortexa7hf-neon-vfpv4 cortexa7thf-neon-vfpv4"
+ARMPKGARCH_tune-cortexa7hf = "cortexa7"
+ARMPKGARCH_tune-cortexa7thf = "cortexa7"
+ARMPKGARCH_tune-cortexa7hf-neon = "cortexa7"
+ARMPKGARCH_tune-cortexa7thf-neon = "cortexa7"
+ARMPKGARCH_tune-cortexa7hf-neon-vfpv4 = "cortexa7"
+ARMPKGARCH_tune-cortexa7thf-neon-vfpv4 = "cortexa7"
+TUNE_FEATURES_tune-cortexa7hf ?= "${TUNE_FEATURES_tune-armv7ahf} cortexa7"
+TUNE_FEATURES_tune-cortexa7thf ?= "${TUNE_FEATURES_tune-armv7athf} cortexa7"
+TUNE_FEATURES_tune-cortexa7hf-neon ?= "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7thf-neon ?= "${TUNE_FEATURES_tune-armv7athf-neon} cortexa7"
+TUNE_FEATURES_tune-cortexa7hf-neon-vfpv4 ?= "${TUNE_FEATURES_tune-armv7ahf-neon-vfpv4} cortexa7"
+TUNE_FEATURES_tune-cortexa7thf-neon-vfpv4 ?= "${TUNE_FEATURES_tune-armv7athf-neon-vfpv4} cortexa7"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa7hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa7hf-vfp cortexa7t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa7hf-vfp cortexa7hf-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa7hf-vfp cortexa7hf-vfp-neon cortexa7t2hf-vfp cortexa7t2hf-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7hf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon-vfpv4} cortexa7hf-vfp cortexa7hf-vfp-neon cortexa7hf-vfp-vfpv4-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa7thf-neon-vfpv4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon-vfpv4} cortexa7hf-vfp cortexa7hf-vfp-neon cortexa7t2hf-vfp cortexa7t2hf-vfp-neon cortexa7hf-vfp-vfpv4-neon cortexa7t2hf-vfp-vfpv4-neon"
diff --git a/meta/conf/machine/include/tune-cortexa8.inc b/meta/conf/machine/include/tune-cortexa8.inc
new file mode 100644
index 0000000..771537f
--- /dev/null
+++ b/meta/conf/machine/include/tune-cortexa8.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "armv7a-neon"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexa8] = "Enable Cortex-A8 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "cortexa8", " -mtune=cortex-a8", "", d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa8 cortexa8t cortexa8-neon cortexa8t-neon"
+ARMPKGARCH_tune-cortexa8 = "cortexa8"
+ARMPKGARCH_tune-cortexa8t = "cortexa8"
+ARMPKGARCH_tune-cortexa8-neon = "cortexa8"
+ARMPKGARCH_tune-cortexa8t-neon = "cortexa8"
+TUNE_FEATURES_tune-cortexa8 = "${TUNE_FEATURES_tune-armv7a} cortexa8"
+TUNE_FEATURES_tune-cortexa8t = "${TUNE_FEATURES_tune-armv7at} cortexa8"
+TUNE_FEATURES_tune-cortexa8-neon = "${TUNE_FEATURES_tune-armv7a-neon} cortexa8"
+TUNE_FEATURES_tune-cortexa8t-neon = "${TUNE_FEATURES_tune-armv7at-neon} cortexa8"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa8-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8t = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa8-vfp cortexa8t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa8-vfp cortexa8-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa8-vfp cortexa8-vfp-neon cortexa8t2-vfp cortexa8t2-vfp-neon"
+
+# VFP Tunes
+AVAILTUNES += "cortexa8hf cortexa8thf cortexa8hf-neon cortexa8thf-neon"
+ARMPKGARCH_tune-cortexa8hf = "cortexa8"
+ARMPKGARCH_tune-cortexa8thf = "cortexa8"
+ARMPKGARCH_tune-cortexa8hf-neon = "cortexa8"
+ARMPKGARCH_tune-cortexa8thf-neon = "cortexa8"
+TUNE_FEATURES_tune-cortexa8hf ?= "${TUNE_FEATURES_tune-armv7ahf} cortexa8"
+TUNE_FEATURES_tune-cortexa8thf ?= "${TUNE_FEATURES_tune-armv7athf} cortexa8"
+TUNE_FEATURES_tune-cortexa8hf-neon ?= "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa8"
+TUNE_FEATURES_tune-cortexa8thf-neon ?= "${TUNE_FEATURES_tune-armv7athf-neon} cortexa8"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa8hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa8hf-vfp cortexa8t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa8hf-vfp cortexa8hf-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa8thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa8hf-vfp cortexa8hf-vfp-neon cortexa8t2hf-vfp cortexa8t2hf-vfp-neon"
diff --git a/meta/conf/machine/include/tune-cortexa9.inc b/meta/conf/machine/include/tune-cortexa9.inc
new file mode 100644
index 0000000..700394b
--- /dev/null
+++ b/meta/conf/machine/include/tune-cortexa9.inc
@@ -0,0 +1,36 @@
+DEFAULTTUNE ?= "armv7a-neon"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexa9] = "Enable Cortex-A9 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "cortexa9", " -mtune=cortex-a9", "", d)}"
+
+# Little Endian base configs
+AVAILTUNES += "cortexa9 cortexa9t cortexa9-neon cortexa9t-neon"
+ARMPKGARCH_tune-cortexa9 = "cortexa9"
+ARMPKGARCH_tune-cortexa9t = "cortexa9"
+ARMPKGARCH_tune-cortexa9-neon = "cortexa9"
+ARMPKGARCH_tune-cortexa9t-neon = "cortexa9"
+TUNE_FEATURES_tune-cortexa9 = "${TUNE_FEATURES_tune-armv7a} cortexa9"
+TUNE_FEATURES_tune-cortexa9t = "${TUNE_FEATURES_tune-armv7at} cortexa9"
+TUNE_FEATURES_tune-cortexa9-neon = "${TUNE_FEATURES_tune-armv7a-neon} cortexa9"
+TUNE_FEATURES_tune-cortexa9t-neon = "${TUNE_FEATURES_tune-armv7at-neon} cortexa9"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9 = "${PACKAGE_EXTRA_ARCHS_tune-armv7a} cortexa9-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9t = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexa9-vfp cortexa9t2-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7a-neon} cortexa9-vfp cortexa9-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9t-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7at-neon} cortexa9-vfp cortexa9-vfp-neon cortexa9t2-vfp cortexa9t2-vfp-neon"
+
+# VFP Tunes
+AVAILTUNES += "cortexa9hf cortexa9thf cortexa9hf-neon cortexa9thf-neon"
+ARMPKGARCH_tune-cortexa9hf = "cortexa9"
+ARMPKGARCH_tune-cortexa9thf = "cortexa9"
+ARMPKGARCH_tune-cortexa9hf-neon = "cortexa9"
+ARMPKGARCH_tune-cortexa9thf-neon = "cortexa9"
+TUNE_FEATURES_tune-cortexa9hf ?= "${TUNE_FEATURES_tune-armv7ahf} cortexa9"
+TUNE_FEATURES_tune-cortexa9thf ?= "${TUNE_FEATURES_tune-armv7athf} cortexa9"
+TUNE_FEATURES_tune-cortexa9hf-neon ?= "${TUNE_FEATURES_tune-armv7ahf-neon} cortexa9"
+TUNE_FEATURES_tune-cortexa9thf-neon ?= "${TUNE_FEATURES_tune-armv7athf-neon} cortexa9"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9hf = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf} cortexa9hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9thf = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf} cortexa9hf-vfp cortexa9t2hf-vfp"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9hf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7ahf-neon} cortexa9hf-vfp cortexa9hf-vfp-neon"
+PACKAGE_EXTRA_ARCHS_tune-cortexa9thf-neon = "${PACKAGE_EXTRA_ARCHS_tune-armv7athf-neon} cortexa9hf-vfp cortexa9hf-vfp-neon cortexa9t2hf-vfp cortexa9t2hf-vfp-neon"
diff --git a/meta/conf/machine/include/tune-cortexm1.inc b/meta/conf/machine/include/tune-cortexm1.inc
new file mode 100644
index 0000000..3b65279
--- /dev/null
+++ b/meta/conf/machine/include/tune-cortexm1.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv7a"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexm1] = "Enable Cortex-M1 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "cortexm1", " -mtune=cortex-m1", "", d)}"
+
+AVAILTUNES += "cortexm1"
+ARMPKGARCH_tune-cortexm1 = "cortexm1"
+TUNE_FEATURES_tune-cortexm1 = "${TUNE_FEATURES_tune-armv7a} cortexm1"
+PACKAGE_EXTRA_ARCHS_tune-cortexm1 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} cortexm1-vfp"
diff --git a/meta/conf/machine/include/tune-cortexm3.inc b/meta/conf/machine/include/tune-cortexm3.inc
new file mode 100644
index 0000000..cbc4c0d
--- /dev/null
+++ b/meta/conf/machine/include/tune-cortexm3.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "cortexm3"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexm3] = "Enable Cortex-M3 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "cortexm3", " -mtune=cortex-m3", "", d)}"
+
+TUNEVALID[armv7m] = "Enable Cortex-M3 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv7m", " -march=armv7-m", "", d)}"
+
+AVAILTUNES += "cortexm3"
+ARMPKGARCH_tune-cortexm3 = "armv7m"
+TUNE_FEATURES_tune-cortexm3 = "armv7m vfp cortexm3"
+PACKAGE_EXTRA_ARCHS_tune-cortexm3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7m-vfp"
diff --git a/meta/conf/machine/include/tune-cortexr4.inc b/meta/conf/machine/include/tune-cortexr4.inc
new file mode 100644
index 0000000..bde649f
--- /dev/null
+++ b/meta/conf/machine/include/tune-cortexr4.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "cortexr4"
+
+require conf/machine/include/arm/arch-armv7a.inc
+
+TUNEVALID[cortexr4] = "Enable Cortex-R4 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "cortexr4", " -mtune=cortex-r4", "", d)}"
+
+TUNEVALID[armv7r] = "Enable Cortex-R4 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv7r", " -march=armv7-r", "", d)}"
+
+AVAILTUNES += "cortexr4"
+ARMPKGARCH_tune-cortexr4 = "armv7r"
+TUNE_FEATURES_tune-cortexr4 = "armv7r vfp cortexr4 arm thumb"
+PACKAGE_EXTRA_ARCHS_tune-cortexr4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7r-vfp"
diff --git a/meta/conf/machine/include/tune-ep9312.inc b/meta/conf/machine/include/tune-ep9312.inc
new file mode 100644
index 0000000..b19b438
--- /dev/null
+++ b/meta/conf/machine/include/tune-ep9312.inc
@@ -0,0 +1,12 @@
+DEFAULTTUNE ?= "ep9312"
+
+require conf/machine/include/arm/arch-armv4.inc
+
+TUNEVALID[ep9312] = "Enable Intel PXA27x specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ep9312", " -march=ep9312 -mtune=ep9312", "", d)}"
+
+AVAILTUNES += "ep9312"
+ARMPKGARCH_tune-ep9312 = "ep9312"
+# this tune does not include TUNE_FEATURES_tune-armv4t, so there is no armv4 TUNE_FEATURES => no 't' in ARMPKGSFX_THUMB
+TUNE_FEATURES_tune-ep9312 = "thumb ep9312"
+PACKAGE_EXTRA_ARCHS_tune-ep9312 = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} ep9312"
diff --git a/meta/conf/machine/include/tune-i586-nlp.inc b/meta/conf/machine/include/tune-i586-nlp.inc
new file mode 100644
index 0000000..e30602b
--- /dev/null
+++ b/meta/conf/machine/include/tune-i586-nlp.inc
@@ -0,0 +1,19 @@
+# Settings for the GCC(1) cpu-type "quark":
+#
+#
+#
+DEFAULTTUNE ?= "i586-nlp-32"
+
+# Include the previous tune to pull in PACKAGE_EXTRA_ARCHS
+require conf/machine/include/x86/arch-x86.inc
+
+# x86 with no lock prefix
+TUNEVALID[i586-nlp] = "IA32 with Lock Prefix omitted"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "i586-nlp", " -march=i586 -Wa,-momit-lock-prefix=yes", "", d)}"
+
+# Quark tune feature
+AVAILTUNES = "i586-nlp-32"
+TUNE_FEATURES_tune-i586-nlp-32 = "${TUNE_FEATURES_tune-x86} i586-nlp"
+BASE_LIB_tune-i586-nlp-32 = "lib"
+TUNE_PKGARCH_tune-i586-nlp-32 = "i586-nlp-32"
+PACKAGE_EXTRA_ARCHS_tune-i586-nlp-32 = "i586-nlp-32"
diff --git a/meta/conf/machine/include/tune-i586.inc b/meta/conf/machine/include/tune-i586.inc
new file mode 100644
index 0000000..5fbb3c7
--- /dev/null
+++ b/meta/conf/machine/include/tune-i586.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "i586"
+
+require conf/machine/include/x86/arch-x86.inc
+
+# Extra tune features
+TUNEVALID[i586] = "Enable i586 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "i586", " -march=i586", "", d)}"
+
+# Extra tune selections
+AVAILTUNES += "i586"
+TUNE_FEATURES_tune-i586 = "${TUNE_FEATURES_tune-x86} i586"
+BASE_LIB_tune-i586 = "lib"
+TUNE_PKGARCH_tune-i586 = "i586"
+PACKAGE_EXTRA_ARCHS_tune-i586 = "${PACKAGE_EXTRA_ARCHS_tune-x86} i586"
diff --git a/meta/conf/machine/include/tune-iwmmxt.inc b/meta/conf/machine/include/tune-iwmmxt.inc
new file mode 100644
index 0000000..748ca0d
--- /dev/null
+++ b/meta/conf/machine/include/tune-iwmmxt.inc
@@ -0,0 +1,14 @@
+# Configurations for the Intel PXA27x Appications Processor Family. 
+# Please use tune-xscale for PXA255/PXA26x based processors.
+
+DEFAULTTUNE ?= "iwmmxt"
+
+require conf/machine/include/arm/arch-armv5-dsp.inc
+
+TUNEVALID[iwmmxt] = "Enable Intel PXA27x specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "iwmmxt", " -march=iwmmxt -mtune=iwmmxt", "", d)}"
+
+AVAILTUNES += "iwmmxt"
+ARMPKGARCH_tune-iwmmxt = "iwmmxt"
+TUNE_FEATURES_tune-iwmmxt = "thumb iwmmxt"
+PACKAGE_EXTRA_ARCHS_tune-iwmmxt = "${PACKAGE_EXTRA_ARCHS_tune-armv5te} iwmmxt iwmmxtt"
diff --git a/meta/conf/machine/include/tune-mips32.inc b/meta/conf/machine/include/tune-mips32.inc
new file mode 100644
index 0000000..ae326ce
--- /dev/null
+++ b/meta/conf/machine/include/tune-mips32.inc
@@ -0,0 +1,25 @@
+DEFAULTTUNE ?= "mips32"
+
+require conf/machine/include/mips/arch-mips.inc
+
+TUNEVALID[mips32] = "Enable mips32 specific processor optimizations"
+TUNECONFLICTS[mips32] = "n64 n32"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "mips32", " -march=mips32", "", d)}"
+
+AVAILTUNES += "mips32 mips32el mips32-nf mips32el-nf"
+
+TUNE_FEATURES_tune-mips32 = "${TUNE_FEATURES_tune-mips} mips32"
+MIPSPKGSFX_VARIANT_tune-mips32 = "mips32"
+PACKAGE_EXTRA_ARCHS_tune-mips32 = "mips mips32"
+
+TUNE_FEATURES_tune-mips32el = "${TUNE_FEATURES_tune-mipsel} mips32"
+MIPSPKGSFX_VARIANT_tune-mips32el = "mips32el"
+PACKAGE_EXTRA_ARCHS_tune-mips32el = "mipsel mips32el"
+
+TUNE_FEATURES_tune-mips32-nf = "${TUNE_FEATURES_tune-mips-nf} mips32"
+MIPSPKGSFX_VARIANT_tune-mips32-nf = "mips32"
+PACKAGE_EXTRA_ARCHS_tune-mips32-nf = "mips-nf mips32-nf"
+
+TUNE_FEATURES_tune-mips32el-nf = "${TUNE_FEATURES_tune-mipsel-nf} mips32"
+MIPSPKGSFX_VARIANT_tune-mips32el-nf = "mips32el"
+PACKAGE_EXTRA_ARCHS_tune-mips32el-nf = "mipsel-nf mips32el-nf"
diff --git a/meta/conf/machine/include/tune-mips32r2.inc b/meta/conf/machine/include/tune-mips32r2.inc
new file mode 100644
index 0000000..c9deff8
--- /dev/null
+++ b/meta/conf/machine/include/tune-mips32r2.inc
@@ -0,0 +1,17 @@
+DEFAULTTUNE ?= "mips32r2"
+
+require conf/machine/include/tune-mips32.inc
+
+TUNEVALID[mips32r2] = "Enable mips32r2 specific processor optimizations"
+TUNECONFLICTS[mips32r2] = "n64 n32"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "mips32r2", " -march=mips32r2", "", d)}"
+
+AVAILTUNES += "mips32r2 mips32r2el"
+
+TUNE_FEATURES_tune-mips32r2 = "${TUNE_FEATURES_tune-mips} mips32r2"
+MIPSPKGSFX_VARIANT_tune-mips32r2 = "mips32r2"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2 = "mips mips32 mips32r2"
+
+TUNE_FEATURES_tune-mips32r2el = "${TUNE_FEATURES_tune-mipsel} mips32r2"
+MIPSPKGSFX_VARIANT_tune-mips32r2el = "mips32r2el"
+PACKAGE_EXTRA_ARCHS_tune-mips32r2el = "mipsel mips32el mips32r2el"
diff --git a/meta/conf/machine/include/tune-mips64.inc b/meta/conf/machine/include/tune-mips64.inc
new file mode 100644
index 0000000..9be0e0f
--- /dev/null
+++ b/meta/conf/machine/include/tune-mips64.inc
@@ -0,0 +1,3 @@
+DEFAULTTUNE ?= "mips64"
+
+require conf/machine/include/tune-mips32r2.inc
diff --git a/meta/conf/machine/include/tune-octeon.inc b/meta/conf/machine/include/tune-octeon.inc
new file mode 100644
index 0000000..f24d9db
--- /dev/null
+++ b/meta/conf/machine/include/tune-octeon.inc
@@ -0,0 +1,32 @@
+DEFAULTTUNE ?="octeon2"
+
+require conf/machine/include/tune-mips64.inc
+
+AVAILTUNES += "octeon2 octeon2_64 octeon3 octeon3_64"
+
+TUNEVALID[octeon2] = "Enable optimization related to octeon2 support"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "octeon2", " -march=octeon2 ", "",d)}"
+
+TUNE_FEATURES_tune-octeon2 = "${TUNE_FEATURES_tune-mips64-n32} octeon2"
+BASE_LIB_tune-octeon2 = "lib32"
+MIPSPKGSFX_VARIANT_tune-octeon2 = "octeon2"
+PACKAGE_EXTRA_ARCHS_tune-octeon2 = "mips64-n32 octeon2-n32"
+
+TUNE_FEATURES_tune-octeon2_64 = "${TUNE_FEATURES_tune-mips64} octeon2"
+BASE_LIB_tune-octeon2_64 = "lib64"
+MIPSPKGSFX_VARIANT_tune-octeon2_64 = "octeon2_64"
+PACKAGE_EXTRA_ARCHS_tune-octeon2_64 = "mips64 octeon2_64"
+
+
+TUNEVALID[octeon3] = "Enable optimization related to octeon3 support"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "octeon3", " -march=octeon3 ", "",d)}"
+
+TUNE_FEATURES_tune-octeon3 = "${TUNE_FEATURES_tune-mips64-n32} octeon3"
+BASE_LIB_tune-octeon3 = "lib32"
+MIPSPKGSFX_VARIANT_tune-octeon3 = "octeon3"
+PACKAGE_EXTRA_ARCHS_tune-octeon3 = "mips64-n32 octeon3-n32"
+
+TUNE_FEATURES_tune-octeon3_64 = "${TUNE_FEATURES_tune-mips64} octeon3"
+BASE_LIB_tune-octeon3_64 = "lib64"
+MIPSPKGSFX_VARIANT_tune-octeon3_64 = "octeon3_64"
+PACKAGE_EXTRA_ARCHS_tune-octeon3_64 = "mips64 octeon3_64"
diff --git a/meta/conf/machine/include/tune-power5.inc b/meta/conf/machine/include/tune-power5.inc
new file mode 100644
index 0000000..30be869
--- /dev/null
+++ b/meta/conf/machine/include/tune-power5.inc
@@ -0,0 +1,21 @@
+DEFAULTTUNE ?= "ppc64p5"
+
+require conf/machine/include/powerpc/arch-powerpc64.inc
+
+TUNEVALID[power5] = "Enable IBM Power5 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "power5", " -mcpu=power5", "", d)}"
+
+AVAILTUNES += "ppcp5 ppc64p5"
+TUNE_FEATURES_tune-ppcp5 = "m32 fpu-hard power5 altivec"
+BASE_LIB_tune-ppcp5 = "lib"
+TUNE_PKGARCH_tune-ppcp5 = "ppcp5"
+PACKAGE_EXTRA_ARCHS_tune-ppcp5 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppcp5"
+
+TUNE_FEATURES_tune-ppc64p5 = "m64 fpu-hard power5 altivec"
+BASE_LIB_tune-ppc64p5 = "lib64"
+TUNE_PKGARCH_tune-ppc64p5 = "ppc64p5"
+PACKAGE_EXTRA_ARCHS_tune-ppc64p5 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64p5"
+
+# glibc configure options to get power5 specific library
+GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains("TUNE_FEATURES", "power5", "--with-cpu=power5", "", d)}"
+GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains("TUNE_FEATURES", "power5", "--with-cpu=power5", "", d)}"
diff --git a/meta/conf/machine/include/tune-power6.inc b/meta/conf/machine/include/tune-power6.inc
new file mode 100644
index 0000000..7563798
--- /dev/null
+++ b/meta/conf/machine/include/tune-power6.inc
@@ -0,0 +1,21 @@
+DEFAULTTUNE ?= "ppcpr6"
+
+require conf/machine/include/powerpc/arch-powerpc64.inc
+
+TUNEVALID[power6] = "Enable IBM Power6 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "power6", " -mcpu=power6", "", d)}"
+
+AVAILTUNES += "ppcp6 ppc64p6"
+TUNE_FEATURES_tune-ppcp6 = "m32 fpu-hard power6 altivec"
+BASE_LIB_tune-ppcp6 = "lib"
+TUNE_PKGARCH_tune-ppcp6 = "ppcp6"
+PACKAGE_EXTRA_ARCHS_tune-ppcp6 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppcp6"
+
+TUNE_FEATURES_tune-ppc64p6 = "m64 fpu-hard power6 altivec"
+BASE_LIB_tune-ppc64p6 = "lib64"
+TUNE_PKGARCH_tune-ppc64p6 = "ppc64p6"
+PACKAGE_EXTRA_ARCHS_tune-ppc64p6 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64p6"
+
+# glibc configure options to get power6 specific library
+GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains("TUNE_FEATURES", "power6", "--with-cpu=power6", "", d)}"
+GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains("TUNE_FEATURES", "power6", "--with-cpu=power6", "", d)}"
diff --git a/meta/conf/machine/include/tune-power7.inc b/meta/conf/machine/include/tune-power7.inc
new file mode 100644
index 0000000..7069e75
--- /dev/null
+++ b/meta/conf/machine/include/tune-power7.inc
@@ -0,0 +1,21 @@
+DEFAULTTUNE ?= "ppcpr7"
+
+require conf/machine/include/powerpc/arch-powerpc64.inc
+
+TUNEVALID[power7] = "Enable IBM Power7 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "power7", " -mcpu=power7", "", d)}"
+
+AVAILTUNES += "ppcp7 ppc64p7"
+TUNE_FEATURES_tune-ppcp7 = "m32 fpu-hard power7 altivec"
+BASE_LIB_tune-ppcp7 = "lib"
+TUNE_PKGARCH_tune-ppcp7 = "ppcp7"
+PACKAGE_EXTRA_ARCHS_tune-ppcp7 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppcp7"
+
+TUNE_FEATURES_tune-ppc64p7 = "m64 fpu-hard power7 altivec"
+BASE_LIB_tune-ppc64p7 = "lib64"
+TUNE_PKGARCH_tune-ppc64p7 = "ppc64p7"
+PACKAGE_EXTRA_ARCHS_tune-ppc64p7 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64p7"
+
+# glibc configure options to get power7 specific library
+GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains("TUNE_FEATURES", "power7", "--with-cpu=power7", "", d)}"
+GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains("TUNE_FEATURES", "power7", "--with-cpu=power7", "", d)}"
diff --git a/meta/conf/machine/include/tune-ppc476.inc b/meta/conf/machine/include/tune-ppc476.inc
new file mode 100644
index 0000000..4ed185d
--- /dev/null
+++ b/meta/conf/machine/include/tune-ppc476.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "ppc476"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppc476] = "Enable ppc476 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppc476", " -mcpu=476", "", d)}"
+
+AVAILTUNES += "ppc476"
+TUNE_FEATURES_tune-ppc476 = "m32 fpu-hard ppc476"
+TUNE_PKGARCH_tune-ppc476 = "ppc476"
+PACKAGE_EXTRA_ARCHS_tune-ppc476 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppc476"
+
+# glibc configure options to get 476 specific library (for sqrt)
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppc476", "-with-cpu=476", "", d)}"
diff --git a/meta/conf/machine/include/tune-ppc603e.inc b/meta/conf/machine/include/tune-ppc603e.inc
new file mode 100644
index 0000000..d744a00
--- /dev/null
+++ b/meta/conf/machine/include/tune-ppc603e.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "ppc603e"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppc603e] = "Enable ppc603e specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppc603e", " -mcpu=603e", "", d)}"
+
+AVAILTUNES += "ppc603e"
+TUNE_FEATURES_tune-ppc603e = "m32 fpu-hard ppc603e"
+TUNE_PKGARCH_tune-ppc603e = "ppc603e"
+PACKAGE_EXTRA_ARCHS_tune-ppc603e = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppc603e"
+
+# glibc configure options to get 603e specific library (for sqrt)
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppc603e", "-with-cpu=603e", "", d)}"
diff --git a/meta/conf/machine/include/tune-ppc7400.inc b/meta/conf/machine/include/tune-ppc7400.inc
new file mode 100644
index 0000000..4ac0403
--- /dev/null
+++ b/meta/conf/machine/include/tune-ppc7400.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "ppc7400"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppc7400] = "Enable ppc7400 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppc7400", " -mcpu=7400", "", d)}"
+
+AVAILTUNES += "ppc7400"
+TUNE_FEATURES_tune-ppc7400 = "m32 fpu-hard ppc7400 altivec"
+TUNE_PKGARCH_tune-ppc7400 = "ppc7400"
+PACKAGE_EXTRA_ARCHS_tune-ppc7400 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppc7400"
+
+# glibc configure options to get 7400 specific library (for sqrt)
+#GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppc7400", "--with-cpu=power4", "", d)}"
diff --git a/meta/conf/machine/include/tune-ppce300c2.inc b/meta/conf/machine/include/tune-ppce300c2.inc
new file mode 100644
index 0000000..05a9505
--- /dev/null
+++ b/meta/conf/machine/include/tune-ppce300c2.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "ppce300c2"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppce300c2] = "Enable ppce300c2 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppce300c2", " -mcpu=e300c2", "", d)}"
+
+AVAILTUNES += "ppce300c2"
+TUNE_FEATURES_tune-ppce300c2 = "m32 fpu-soft ppce300c2"
+TUNE_PKGARCH_tune-ppce300c2 = "ppce300c2"
+PACKAGE_EXTRA_ARCHS_tune-ppce300c2 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc-nf} ppce300c2"
diff --git a/meta/conf/machine/include/tune-ppce300c3.inc b/meta/conf/machine/include/tune-ppce300c3.inc
new file mode 100644
index 0000000..b19cf22
--- /dev/null
+++ b/meta/conf/machine/include/tune-ppce300c3.inc
@@ -0,0 +1,23 @@
+DEFAULTTUNE ?= "ppce300c3"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+AVAILTUNES += "ppce300c3 ppce300c3-nf"
+
+# hard-float
+TUNEVALID[ppce300c3] = "Enable ppce300c3 specific processor optimizations"
+TUNE_FEATURES_tune-ppce300c3 = "${TUNE_FEATURES_tune-powerpc} ppce300c3"
+TUNE_PKGARCH_tune-ppce300c3 = "ppce300c3"
+PACKAGE_EXTRA_ARCHS_tune-ppce300c3 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce300c3"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", " -mcpu=e300c3", "", d)}"
+
+# glibc config options to make use of e300c3 (603e) specific sqrt/sqrtf routines
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3", "--with-cpu=e300c3", "", d)}"
+
+# soft-float
+TUNEVALID[ppce300c3-nf] = "Enable ppce300c3 specific processor optimizations (no fpu)"
+TUNE_FEATURES_tune-ppce300c3-nf = "${TUNE_FEATURES_tune-powerpc-nf} ppce300c3-nf"
+TUNE_PKGARCH_tune-ppce300c3-nf = "ppce300c3-nf"
+PACKAGE_EXTRA_ARCHS_tune-ppce300c3-nf = "${PACKAGE_EXTRA_ARCHS_tune-powerpc-nf} ppce300c3-nf"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppce300c3-nf", " -mcpu=e300c3", "", d)}"
+
diff --git a/meta/conf/machine/include/tune-ppce500.inc b/meta/conf/machine/include/tune-ppce500.inc
new file mode 100644
index 0000000..70c1f8b
--- /dev/null
+++ b/meta/conf/machine/include/tune-ppce500.inc
@@ -0,0 +1,20 @@
+DEFAULTTUNE ?= "ppce500"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppce500] = "Enable ppce500 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppce500", " -mcpu=8540", "", d)}"
+
+TUNEVALID[spe] = "Enable SPE ABI extensions"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", [ "ppce500", "spe" ], " -mabi=spe -mspe -mfloat-gprs=single", "", d)}"
+TARGET_FPU .= "${@bb.utils.contains("TUNE_FEATURES", [ "ppce500" , "spe" ], "ppc-efs", "", d)}"
+
+# spe is defined potentially in two places, so we want to be sure it will
+# only write spe once to the ABIEXTENSIONS field.
+SPEABIEXTENSION = "${@bb.utils.contains("TUNE_FEATURES", "spe", "spe", "", d)}"
+ABIEXTENSION .= "${SPEABIEXTENSION}"
+
+AVAILTUNES += "ppce500"
+TUNE_FEATURES_tune-ppce500 = "m32 spe ppce500"
+TUNE_PKGARCH_tune-ppce500 = "ppce500"
+PACKAGE_EXTRA_ARCHS_tune-ppce500 = "ppce500"
diff --git a/meta/conf/machine/include/tune-ppce500mc.inc b/meta/conf/machine/include/tune-ppce500mc.inc
new file mode 100644
index 0000000..744d8e5
--- /dev/null
+++ b/meta/conf/machine/include/tune-ppce500mc.inc
@@ -0,0 +1,14 @@
+DEFAULTTUNE ?= "ppce500mc"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppce500mc] = "Enable ppce500mc specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppce500mc", " -mcpu=e500mc", "", d)}"
+
+AVAILTUNES += "ppce500mc"
+TUNE_FEATURES_tune-ppce500mc = "m32 fpu-hard ppce500mc"
+TUNE_PKGARCH_tune-ppce500mc = "ppce500mc"
+PACKAGE_EXTRA_ARCHS_tune-ppce500mc = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce500mc"
+
+# glibc configure options to get e500mc specific library (for sqrt)
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "ppce500mc", "-with-cpu=e500mc", "", d)}"
diff --git a/meta/conf/machine/include/tune-ppce500v2.inc b/meta/conf/machine/include/tune-ppce500v2.inc
new file mode 100644
index 0000000..d014d70
--- /dev/null
+++ b/meta/conf/machine/include/tune-ppce500v2.inc
@@ -0,0 +1,20 @@
+DEFAULTTUNE ?= "ppce500v2"
+
+require conf/machine/include/powerpc/arch-powerpc.inc
+
+TUNEVALID[ppce500v2] = "Enable ppce500v2 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "ppce500v2", " -mcpu=8548", "", d)}"
+
+TUNEVALID[spe] = "Enable SPE ABI extensions"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", [ "ppce500v2", "spe" ], " -mabi=spe -mspe -mfloat-gprs=double", "", d)}"
+TARGET_FPU .= "${@bb.utils.contains("TUNE_FEATURES", [ "ppce500v2" , "spe" ], "ppc-efd", "", d)}"
+
+# spe is defined potentially in two places, so we want to be sure it will
+# only write spe once to the ABIEXTENSIONS field.
+SPEABIEXTENSION = "${@bb.utils.contains("TUNE_FEATURES", "spe", "spe", "", d)}"
+ABIEXTENSION .= "${SPEABIEXTENSION}"
+
+AVAILTUNES += "ppce500v2"
+TUNE_FEATURES_tune-ppce500v2 = "m32 spe ppce500v2"
+TUNE_PKGARCH_tune-ppce500v2 = "ppce500v2"
+PACKAGE_EXTRA_ARCHS_tune-ppce500v2 = "ppce500v2"
diff --git a/meta/conf/machine/include/tune-ppce5500.inc b/meta/conf/machine/include/tune-ppce5500.inc
new file mode 100644
index 0000000..25231ef
--- /dev/null
+++ b/meta/conf/machine/include/tune-ppce5500.inc
@@ -0,0 +1,20 @@
+DEFAULTTUNE ?= "ppce5500"
+
+require conf/machine/include/powerpc/arch-powerpc64.inc
+
+TUNEVALID[e5500] = "Enable Freescale e5500 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "e5500", " -mcpu=e5500", "", d)}"
+
+AVAILTUNES += "ppce5500 ppc64e5500"
+TUNE_FEATURES_tune-ppce5500 = "m32 fpu-hard e5500"
+BASE_LIB_tune-ppce5500 = "lib"
+TUNE_PKGARCH_tune-ppce5500 = "ppce5500"
+PACKAGE_EXTRA_ARCHS_tune-ppce5500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce5500"
+
+TUNE_FEATURES_tune-ppc64e5500 = "m64 fpu-hard e5500"
+BASE_LIB_tune-ppc64e5500 = "lib64"
+TUNE_PKGARCH_tune-ppc64e5500 = "ppc64e5500"
+PACKAGE_EXTRA_ARCHS_tune-ppc64e5500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64e5500"
+
+# glibc configure options to get e5500 specific library (for sqrt)
+GLIBC_EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "e5500", "--with-cpu=e5500", "", d)}"
diff --git a/meta/conf/machine/include/tune-ppce6500.inc b/meta/conf/machine/include/tune-ppce6500.inc
new file mode 100644
index 0000000..ea743a3
--- /dev/null
+++ b/meta/conf/machine/include/tune-ppce6500.inc
@@ -0,0 +1,21 @@
+DEFAULTTUNE ?= "ppce6500"
+
+require conf/machine/include/powerpc/arch-powerpc64.inc
+
+TUNEVALID[e6500] = "Enable Freescale e6500 specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "e6500", " -mcpu=e6500", "", d)}"
+
+AVAILTUNES += "ppce6500 ppc64e6500"
+TUNE_FEATURES_tune-ppce6500 = "m32 fpu-hard e6500 altivec"
+BASE_LIB_tune-ppce6500 = "lib"
+TUNE_PKGARCH_tune-ppce6500 = "ppce6500"
+PACKAGE_EXTRA_ARCHS_tune-ppce6500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc} ppce6500"
+
+TUNE_FEATURES_tune-ppc64e6500 = "m64 fpu-hard e6500 altivec"
+BASE_LIB_tune-ppc64e6500 = "lib64"
+TUNE_PKGARCH_tune-ppc64e6500 = "ppc64e6500"
+PACKAGE_EXTRA_ARCHS_tune-ppc64e6500 = "${PACKAGE_EXTRA_ARCHS_tune-powerpc64} ppc64e6500"
+
+# glibc configure options to get e6500 specific library
+GLIBC_EXTRA_OECONF_powerpc64 += "${@bb.utils.contains("TUNE_FEATURES", "e6500", "--with-cpu=e6500", "", d)}"
+GLIBC_EXTRA_OECONF_powerpc += "${@bb.utils.contains("TUNE_FEATURES", "e6500", "--with-cpu=e6500", "", d)}"
diff --git a/meta/conf/machine/include/tune-sh3.inc b/meta/conf/machine/include/tune-sh3.inc
new file mode 100644
index 0000000..c5ed7ba
--- /dev/null
+++ b/meta/conf/machine/include/tune-sh3.inc
@@ -0,0 +1,17 @@
+DEFAULTTUNE ?= "sh3"
+
+require conf/machine/include/sh/arch-sh.inc
+
+TUNEVALID[sh3] = "Enable SH3 optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "sh3", " -m3", "", d)}"
+
+AVAILTUNES += "sh3 sh3eb"
+TUNE_FEATURES_tune-sh3 = "sh3"
+TUNE_ARCH_tune-sh3 = "sh3"
+TUNE_PKGARCH_tune-sh3 = "sh3"
+PACKAGE_EXTRA_ARCHS_tune-sh3 = "sh sh3"
+
+TUNE_FEATURES_tune-sh3eb = "sh3 bigendian"
+TUNE_ARCH_tune-sh3eb = "sh3eb"
+TUNE_PKGARCH_tune-sh3eb = "sh3eb"
+PACKAGE_EXTRA_ARCHS_tune-sh3eb = "sheb sh3eb"
diff --git a/meta/conf/machine/include/tune-sh4.inc b/meta/conf/machine/include/tune-sh4.inc
new file mode 100644
index 0000000..56e23b9
--- /dev/null
+++ b/meta/conf/machine/include/tune-sh4.inc
@@ -0,0 +1,34 @@
+DEFAULTTUNE ?= "sh4"
+
+# Pull in sh4 for compatibility...
+require conf/machine/include/sh/arch-sh.inc
+
+TUNEVALID[sh4] = "Enable SH4 optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "sh4", " -m4", "", d)}"
+
+# NOTE: If you want to optimize to sh4a, conf/machine/include/tune-sh4a.inc.
+# But it is not compatible for sh4.
+# The binary optimized by m4a doesn't operate on sh4. It works on sh4a only.
+TUNEVALID[sh4a] = "Enable SH4a optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "sh4a", " -m4a", "", d)}"
+
+AVAILTUNES += "sh4 sh4eb sh4a sh4aeb"
+TUNE_FEATURES_tune-sh4 = "sh4"
+TUNE_ARCH_tune-sh4 = "sh4"
+TUNE_PKGARCH_tune-sh4 = "sh4"
+PACKAGE_EXTRA_ARCHS_tune-sh4 = "sh sh4"
+
+TUNE_FEATURES_tune-sh4eb = "sh4 bigendian"
+TUNE_ARCH_tune-sh4eb = "sh4eb"
+TUNE_PKGARCH_tune-sh4eb = "sh4eb"
+PACKAGE_EXTRA_ARCHS_tune-sh4eb = "sheb sh4eb"
+
+TUNE_FEATURES_tune-sh4a = "sh4a"
+TUNE_ARCH_tune-sh4a = "sh4"
+TUNE_PKGARCH_tune-sh4a = "sh4a"
+PACKAGE_EXTRA_ARCHS_tune-sh4a = "sh sh4 sh4a"
+
+TUNE_FEATURES_tune-sh4aeb = "sh4a bigendian"
+TUNE_ARCH_tune-sh4aeb = "sh4eb"
+TUNE_PKGARCH_tune-sh4aeb = "sh4aeb"
+PACKAGE_EXTRA_ARCHS_tune-sh4aeb = "sheb sh4eb sh4aeb"
diff --git a/meta/conf/machine/include/tune-strongarm1100.inc b/meta/conf/machine/include/tune-strongarm1100.inc
new file mode 100644
index 0000000..ea2fba8
--- /dev/null
+++ b/meta/conf/machine/include/tune-strongarm1100.inc
@@ -0,0 +1,11 @@
+DEFAULTTUNE ?= "armv4"
+
+require conf/machine/include/arm/arch-armv4.inc
+
+TUNEVALID[strongarm] = "Enable Strongarm 1100 series processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "strongarm", " -mtune=strongarm1100", "", d)}"
+
+AVAILTUNES += "strongarm"
+ARMPKGARCH_tune-strongarm = "strongarm"
+TUNE_FEATURES_tune-strongarm = "${TUNE_FEATURES_tune-armv4} strongarm"
+PACKAGE_EXTRA_ARCHS_tune-strongarm = "${PACKAGE_EXTRA_ARCHS_tune-armv4} strongarm"
diff --git a/meta/conf/machine/include/tune-supersparc.inc b/meta/conf/machine/include/tune-supersparc.inc
new file mode 100644
index 0000000..0faa361
--- /dev/null
+++ b/meta/conf/machine/include/tune-supersparc.inc
@@ -0,0 +1,4 @@
+TUNE_ARCH = "sparc"
+
+TUNE_CCARGS = "-mcpu=supersparc"
+TUNE_PKGARCH = "supersparc"
diff --git a/meta/conf/machine/include/tune-xscale.inc b/meta/conf/machine/include/tune-xscale.inc
new file mode 100644
index 0000000..0c5ca8d
--- /dev/null
+++ b/meta/conf/machine/include/tune-xscale.inc
@@ -0,0 +1,16 @@
+DEFAULTTUNE ?= "armv5te"
+
+require conf/machine/include/arm/arch-armv5-dsp.inc
+
+TUNEVALID[xscale] = "Enable PXA255/PXA26x Xscale specific processor optimizations"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "xscale", " -mtune=xscale", "", d)}"
+
+AVAILTUNES += "xscale"
+ARMPKGARCH_tune-xscale = "xscale"
+TUNE_FEATURES_tune-xscale = "${TUNE_FEATURES_tune-armv5te} xscale"
+PACKAGE_EXTRA_ARCHS_tune-xscale = "${PACKAGE_EXTRA_ARCHS_tune-armv5te} xscale xscalet xscalee xscalete"
+
+AVAILTUNES += "xscale-be"
+ARMPKGARCH_tune-xscale-be = "xscale"
+TUNE_FEATURES_tune-xscale-be = "${TUNE_FEATURES_tune-armv5teb} xscale bigendian"
+PACKAGE_EXTRA_ARCHS_tune-xscale-be = "${PACKAGE_EXTRA_ARCHS_tune-armv5teb} xscaleb xscaletb xscaleeb xscaleteb"
diff --git a/meta/conf/machine/include/x86-base.inc b/meta/conf/machine/include/x86-base.inc
new file mode 100644
index 0000000..f7c8a45
--- /dev/null
+++ b/meta/conf/machine/include/x86-base.inc
@@ -0,0 +1,52 @@
+#
+# Base machine settings for X86 architecture BSPs
+#
+
+#
+# common settings for X86 machines
+#
+MACHINE_FEATURES += "screen keyboard pci usbhost ext2 ext3 x86 \
+                     acpi serial usbgadget alsa"
+
+MACHINE_EXTRA_RRECOMMENDS += "kernel-modules"
+
+IMAGE_FSTYPES += "live"
+
+KERNEL_IMAGETYPE ?= "bzImage"
+
+SERIAL_CONSOLE ?= "115200 ttyS0"
+
+#
+# kernel-related variables
+#
+PREFERRED_PROVIDER_virtual/kernel ??= "linux-yocto"
+PREFERRED_VERSION_linux-yocto ??= "3.0%"
+
+#
+# XSERVER subcomponents, used to build the XSERVER variable
+#
+XSERVER_X86_BASE = "xserver-xorg \
+           xf86-input-mouse \
+           xf86-input-keyboard \
+           xf86-input-evdev \
+           xf86-input-synaptics \
+           "
+
+XSERVER_X86_EXT = " \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'xserver-xorg-extension-glx', '', d)} \
+           xserver-xorg-module-libint10 \
+           "
+
+XSERVER_X86_I915 = "xf86-video-intel \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-i915', '', d)} \
+           "
+
+XSERVER_X86_I965 = "xf86-video-intel \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-i965', '', d)} \
+           "
+
+XSERVER_X86_VESA = "xf86-video-vesa"
+
+XSERVER_X86_FBDEV = "xf86-video-fbdev"
+
+XSERVER_X86_MODESETTING = "xf86-video-modesetting"
diff --git a/meta/conf/machine/include/x86/README b/meta/conf/machine/include/x86/README
new file mode 100644
index 0000000..2b6c46c
--- /dev/null
+++ b/meta/conf/machine/include/x86/README
@@ -0,0 +1,24 @@
+2012/03/30 - Mark Hatle <mark.hatle@windriver.com>
+ - Initial version
+
+Most of the items for the X86 architectures are defined in the single
+arch-x86 file.
+
+Three ABIs are define, m32, mx32 and m64.
+
+The following is the list of X86 specific variables:
+
+X86ARCH32 - This is the 32-bit architecture GNU canonical arch, TUNE_ARCH.
+
+X86ARCH64 - This is the 64-bit architecture GNU canonical arch, TUNE_ARCH.
+
+The TUNE_PKGARCH is defined as follows:
+
+TUNE_PKGARCH = ${TUNE_PKGARCH_tune-${DEFAULTTUNE}}
+
+The package architecture for 32-bit targets is historical and generally
+set to to match the core compatible processor type, i.e. i386.
+
+For 64-bit architectures, the architecture is expected to end in '_64'.
+
+If the x32 ABI is used, then the _64 is further extended with a '_x32'.
diff --git a/meta/conf/machine/include/x86/arch-x86.inc b/meta/conf/machine/include/x86/arch-x86.inc
new file mode 100644
index 0000000..298bddc
--- /dev/null
+++ b/meta/conf/machine/include/x86/arch-x86.inc
@@ -0,0 +1,51 @@
+#
+# X86 Architecture definition (IA32, X86_64, and X32)
+#
+
+DEFAULTTUNE ?= "x86"
+TARGET_FPU ?= ""
+X86ARCH32 ?= "i586"
+X86ARCH64 ?= "x86_64"
+
+TUNE_PKGARCH = "${TUNE_PKGARCH_tune-${DEFAULTTUNE}}"
+
+# ELF32 ABI
+TUNEVALID[m32] = "IA32 ELF32 standard ABI"
+TUNECONFLICTS[m32] = "m64 mx32"
+TUNE_ARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m32", "${X86ARCH32}", "" ,d)}"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "m32", " -m32", "", d)}"
+MACHINEOVERRIDES =. "${@bb.utils.contains("TUNE_FEATURES", "m32", "x86:", "" ,d)}"
+
+# x32 ABI
+TUNEVALID[mx32] = "IA32e (x86_64) ELF32 standard ABI"
+TUNECONFLICTS[mx32] = "m64 m32"
+TUNE_ARCH .= "${@bb.utils.contains("TUNE_FEATURES", "mx32", "${X86ARCH64}", "" ,d)}"
+ABIEXTENSION .= "${@bb.utils.contains("TUNE_FEATURES", "mx32", "x32", "" ,d)}"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "mx32", " -mx32", "", d)}"
+TUNE_LDARGS += "${@bb.utils.contains("TUNE_FEATURES", "mx32", "-m elf32_x86_64", "", d)}"
+TUNE_ASARGS += "${@bb.utils.contains("TUNE_FEATURES", "mx32", "-x32", "", d)}"
+
+# ELF64 ABI
+TUNEVALID[m64] = "IA32e (x86_64) ELF64 standard ABI"
+TUNECONFLICTS[m64] = "m32 mx32"
+TUNE_ARCH .= "${@bb.utils.contains("TUNE_FEATURES", "m64", "${X86ARCH64}", "" ,d)}"
+TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "m64", " -m64", "", d)}"
+
+# Default Tune configurations
+AVAILTUNES += "x86"
+TUNE_FEATURES_tune-x86 = "m32"
+BASE_LIB_tune-x86 = "lib"
+TUNE_PKGARCH_tune-x86 = "x86"
+PACKAGE_EXTRA_ARCHS_tune-x86 = "${TUNE_PKGARCH_tune-x86}"
+
+AVAILTUNES += "x86-64"
+TUNE_FEATURES_tune-x86-64 = "m64"
+BASE_LIB_tune-x86-64 = "lib64"
+TUNE_PKGARCH_tune-x86-64 = "x86_64"
+PACKAGE_EXTRA_ARCHS_tune-x86-64 = "${TUNE_PKGARCH_tune-x86-64}"
+
+AVAILTUNES += "x86-64-x32"
+TUNE_FEATURES_tune-x86-64-x32 = "mx32"
+BASE_LIB_tune-x86-64-x32 = "libx32"
+TUNE_PKGARCH_tune-x86-64-x32 = "x86_64_x32"
+PACKAGE_EXTRA_ARCHS_tune-x86-64-x32 = "${TUNE_PKGARCH_tune-x86-64-x32}"
diff --git a/meta/conf/machine/qemuarm.conf b/meta/conf/machine/qemuarm.conf
new file mode 100644
index 0000000..cdad03f
--- /dev/null
+++ b/meta/conf/machine/qemuarm.conf
@@ -0,0 +1,12 @@
+#@TYPE: Machine
+#@NAME: arm_versatile_926ejs
+#@DESCRIPTION: arm_versatile_926ejs
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-arm926ejs.inc
+#require conf/machine/include/tune-arm1136jf-s.inc
+
+KERNEL_IMAGETYPE = "zImage"
+
+SERIAL_CONSOLES = "115200;ttyAMA0 115200;ttyAMA1"
+
diff --git a/meta/conf/machine/qemuarm64.conf b/meta/conf/machine/qemuarm64.conf
new file mode 100644
index 0000000..8459d0f
--- /dev/null
+++ b/meta/conf/machine/qemuarm64.conf
@@ -0,0 +1,12 @@
+#@TYPE: Machine
+#@NAME: generic armv8 machine
+#@DESCRIPTION: Machine configuration for running a generic armv8
+
+require conf/machine/include/arm/arch-armv8.inc
+require conf/machine/include/qemu.inc
+
+MACHINE_FEATURES = ""
+
+KERNEL_IMAGETYPE = "Image"
+
+SERIAL_CONSOLES = "38400;ttyAMA0 38400;hvc0"
diff --git a/meta/conf/machine/qemumips.conf b/meta/conf/machine/qemumips.conf
new file mode 100644
index 0000000..fbf8137
--- /dev/null
+++ b/meta/conf/machine/qemumips.conf
@@ -0,0 +1,13 @@
+#@TYPE: Machine
+#@NAME: mti_malta32_be MIPS
+#@DESCRIPTION: mti_malta32_be
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-mips32r2.inc
+
+KERNEL_IMAGETYPE = "vmlinux"
+KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
+
+SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
diff --git a/meta/conf/machine/qemumips64.conf b/meta/conf/machine/qemumips64.conf
new file mode 100644
index 0000000..8c3f1fe
--- /dev/null
+++ b/meta/conf/machine/qemumips64.conf
@@ -0,0 +1,13 @@
+#@TYPE: Machine
+#@NAME: mti-malta64-be MIPS64
+#@DESCRIPTION: mti-malta64-be
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-mips64.inc
+
+KERNEL_IMAGETYPE = "vmlinux"
+KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
+
+SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1"
+
+MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
diff --git a/meta/conf/machine/qemuppc.conf b/meta/conf/machine/qemuppc.conf
new file mode 100644
index 0000000..85cbbf7
--- /dev/null
+++ b/meta/conf/machine/qemuppc.conf
@@ -0,0 +1,11 @@
+#@TYPE: Machine
+#@NAME: qemu PPC Emulator setup
+#@DESCRIPTION: Machine configuration for running an PPC system under qemu emulation
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-ppc7400.inc
+
+KERNEL_IMAGETYPE = "vmlinux"
+
+SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1"
+
diff --git a/meta/conf/machine/qemux86-64.conf b/meta/conf/machine/qemux86-64.conf
new file mode 100644
index 0000000..a4fd43c
--- /dev/null
+++ b/meta/conf/machine/qemux86-64.conf
@@ -0,0 +1,29 @@
+#@TYPE: Machine
+#@NAME: common_pc
+#@DESCRIPTION: Machine configuration for running a common x86
+
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
+
+require conf/machine/include/qemu.inc
+DEFAULTTUNE ?= "core2-64"
+require conf/machine/include/tune-core2.inc
+
+KERNEL_IMAGETYPE = "bzImage"
+
+SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1"
+
+XSERVER = "xserver-xorg \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast', '', d)} \
+           xf86-input-vmmouse \
+           xf86-input-keyboard \
+           xf86-input-evdev \
+           xf86-video-cirrus \
+           xf86-video-fbdev \
+           xf86-video-vmware"
+
+MACHINE_FEATURES += "x86"
+
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
diff --git a/meta/conf/machine/qemux86.conf b/meta/conf/machine/qemux86.conf
new file mode 100644
index 0000000..96cea66
--- /dev/null
+++ b/meta/conf/machine/qemux86.conf
@@ -0,0 +1,28 @@
+#@TYPE: Machine
+#@NAME: common_pc
+#@DESCRIPTION: Machine configuration for running a common x86
+
+PREFERRED_PROVIDER_virtual/xserver ?= "xserver-xorg"
+PREFERRED_PROVIDER_virtual/libgl ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles1 ?= "mesa"
+PREFERRED_PROVIDER_virtual/libgles2 ?= "mesa"
+
+require conf/machine/include/qemu.inc
+require conf/machine/include/tune-i586.inc
+
+KERNEL_IMAGETYPE = "bzImage"
+
+SERIAL_CONSOLES = "115200;ttyS0 115200;ttyS1"
+
+XSERVER = "xserver-xorg \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'mesa-driver-swrast', '', d)} \
+           xf86-input-vmmouse \
+           xf86-input-keyboard \
+           xf86-input-evdev \
+           xf86-video-cirrus \
+           xf86-video-fbdev \
+           xf86-video-vmware"
+
+MACHINE_FEATURES += "x86"
+
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS += "v86d"
diff --git a/meta/conf/migrate_localcount.conf b/meta/conf/migrate_localcount.conf
new file mode 100644
index 0000000..e486e03
--- /dev/null
+++ b/meta/conf/migrate_localcount.conf
@@ -0,0 +1 @@
+INHERIT += "migrate_localcount"
diff --git a/meta/conf/multilib.conf b/meta/conf/multilib.conf
new file mode 100644
index 0000000..89a8e90
--- /dev/null
+++ b/meta/conf/multilib.conf
@@ -0,0 +1,26 @@
+
+baselib = "${@d.getVar('BASE_LIB_tune-' + (d.getVar('DEFAULTTUNE', True) or 'INVALID'), True) or d.getVar('BASELIB', True)}"
+
+MULTILIB_VARIANTS = "${@extend_variants(d,'MULTILIBS','multilib')}"
+MULTILIB_SAVE_VARNAME = "DEFAULTTUNE TARGET_ARCH TARGET_SYS"
+
+MULTILIBS ??= "multilib:lib32"
+
+STAGING_DIR_HOST = "${STAGING_DIR}/${MLPREFIX}${MACHINE}"
+STAGING_DIR_TARGET = "${STAGING_DIR}/${MLPREFIX}${MACHINE}"
+PKGDATA_DIR = "${STAGING_DIR}/${MACHINE}/pkgdata"
+
+INHERIT += "multilib_global"
+
+BBCLASSEXTEND_append = " ${MULTILIBS}"
+
+MULTILIB_GLOBAL_VARIANTS ?= "lib32 lib64 libx32"
+
+OPKG_ARGS_append = " --force-maintainer --force-overwrite"
+
+# When multilib is enabled, allarch recipes will be installed into the MACHINE
+# sysroot, not MLPREFIXMACHINE.  This means that anything using pkg-config to
+# find an allarch pkgconfig file will fail as the PKG_CONFIG_PATH only looks
+# inside the multilib sysroot.  Fix this by explicitly adding the MACHINE's
+# architecture-independent pkgconfig location to PKG_CONFIG_PATH.
+PKG_CONFIG_PATH .= ":${STAGING_DIR}/${MACHINE}${datadir}/pkgconfig"
diff --git a/meta/conf/prexport.conf b/meta/conf/prexport.conf
new file mode 100644
index 0000000..12f3acb
--- /dev/null
+++ b/meta/conf/prexport.conf
@@ -0,0 +1 @@
+INHERIT += "prexport"
diff --git a/meta/conf/primport.conf b/meta/conf/primport.conf
new file mode 100644
index 0000000..d94ea1b
--- /dev/null
+++ b/meta/conf/primport.conf
@@ -0,0 +1 @@
+INHERIT += "primport"
diff --git a/meta/conf/sanity.conf b/meta/conf/sanity.conf
new file mode 100644
index 0000000..dd156d2
--- /dev/null
+++ b/meta/conf/sanity.conf
@@ -0,0 +1,16 @@
+# Sanity checks for common user misconfigurations
+#
+# See sanity.bbclass
+#
+# Expert users can confirm their sanity with "touch conf/sanity.conf"
+BB_MIN_VERSION = "1.27.1"
+
+SANITY_ABIFILE = "${TMPDIR}/abi_version"
+
+SANITY_VERSION ?= "1"
+LOCALCONF_VERSION  ?= "1"
+LAYER_CONF_VERSION ?= "6"
+SITE_CONF_VERSION  ?= "1"
+
+INHERIT += "sanity"
+
diff --git a/meta/conf/swabber/Ubuntu-10.04.1-64/blacklist b/meta/conf/swabber/Ubuntu-10.04.1-64/blacklist
new file mode 100644
index 0000000..5fdb8f2
--- /dev/null
+++ b/meta/conf/swabber/Ubuntu-10.04.1-64/blacklist
@@ -0,0 +1,6 @@
+libneon27-gnutls
+openjdk-6-jre-headless
+openjdk-6-jre-lib
+openjdk-6-jre
+libdbus-1-3
+libneon27-gnutls
diff --git a/meta/conf/swabber/Ubuntu-10.04.1-64/filters b/meta/conf/swabber/Ubuntu-10.04.1-64/filters
new file mode 100644
index 0000000..a447f70
--- /dev/null
+++ b/meta/conf/swabber/Ubuntu-10.04.1-64/filters
@@ -0,0 +1,7 @@
+/usr/local/lib/python2.6
+/usr/lib/python2.6
+/usr/lib/pymodules/python2.6
+/usr/lib/perl/5.10
+# which is part of the debianutils packages, but we don't want to put the entire
+# debianutils package in the whitelist.
+/usr/bin/which
diff --git a/meta/conf/swabber/Ubuntu-10.04.1-64/whitelist b/meta/conf/swabber/Ubuntu-10.04.1-64/whitelist
new file mode 100644
index 0000000..f0fe963
--- /dev/null
+++ b/meta/conf/swabber/Ubuntu-10.04.1-64/whitelist
@@ -0,0 +1,23 @@
+base-files
+dash
+libacl1
+libattr1
+libbz2-1.0
+libc6
+libc-bin
+libglib2.0-0
+libncurses5
+libselinux1
+libsqlite3-0
+libssl0.9.8
+mime-support
+perl-base
+python2.6
+python2.6-minimal
+python-apport
+python-gst0.10
+python-imaging
+python-minimal
+python-support
+python-zope.interface
+zlib1g
diff --git a/meta/conf/swabber/generic/blacklist b/meta/conf/swabber/generic/blacklist
new file mode 100644
index 0000000..396bcb4
--- /dev/null
+++ b/meta/conf/swabber/generic/blacklist
@@ -0,0 +1,2 @@
+udev
+dkpg
diff --git a/meta/conf/swabber/generic/filters b/meta/conf/swabber/generic/filters
new file mode 100644
index 0000000..3b10fcb
--- /dev/null
+++ b/meta/conf/swabber/generic/filters
@@ -0,0 +1,10 @@
+/tmp
+/etc/localtime
+/etc/ld.so.cache
+/etc/ld.so.conf
+/etc/passwd
+/etc/group
+/etc/nsswitch.conf
+/proc
+/dev/null
+/dev/tty
diff --git a/meta/conf/swabber/generic/whitelist b/meta/conf/swabber/generic/whitelist
new file mode 100644
index 0000000..48ec2af
--- /dev/null
+++ b/meta/conf/swabber/generic/whitelist
@@ -0,0 +1,15 @@
+bash
+bzip2
+ccache
+coreutils
+cpp
+file
+findutils
+gawk
+grep
+hostname
+make
+sed
+tar
+util-linux
+zlib1g
diff --git a/meta/conf/toasterconf.json b/meta/conf/toasterconf.json
new file mode 100644
index 0000000..c8e42ef
--- /dev/null
+++ b/meta/conf/toasterconf.json
@@ -0,0 +1,106 @@
+{
+    "config": {
+        "MACHINE"      : "qemux86",
+        "DISTRO"       : "poky",
+        "IMAGE_FSTYPES": "ext3 jffs2 tar.bz2",
+        "IMAGE_INSTALL_append": "",
+        "PACKAGE_CLASSES": "package_rpm",
+        "SDKMACHINE"   : "x86_64"
+    },
+    "layersources": [
+        {
+            "name": "Local OpenEmbedded",
+            "sourcetype": "local",
+            "apiurl": "../../",
+            "branches": ["HEAD", "master", "fido", "dizzy"],
+            "layers": [
+                {
+                    "name": "openembedded-core",
+                    "local_path": "meta",
+                    "vcs_url": "remote:origin",
+                    "dirpath": "meta"
+                }
+            ]
+        },
+        {
+            "name": "OpenEmbedded",
+            "sourcetype": "layerindex",
+            "apiurl": "http://layers.openembedded.org/layerindex/api/",
+            "branches": ["master", "fido", "dizzy"]
+        },
+        {
+            "name": "Imported layers",
+            "sourcetype": "imported",
+            "apiurl": "",
+            "branches": ["master", "fido", "dizzy", "HEAD"]
+
+        }
+    ],
+    "bitbake" : [
+        {
+            "name": "master",
+            "giturl": "git://git.openembedded.org/bitbake",
+            "branch": "master",
+            "dirpath": ""
+        },
+        {
+            "name": "fido",
+            "giturl": "git://git.openembedded.org/bitbake",
+            "branch": "1.26",
+            "dirpath": ""
+        },
+        {
+            "name": "dizzy",
+            "giturl": "git://git.openembedded.org/bitbake",
+            "branch": "1.24",
+            "dirpath": ""
+        },
+        {
+            "name": "HEAD",
+            "giturl": "git://git.openembedded.org/bitbake",
+            "branch": "HEAD",
+            "dirpath": ""
+        }
+    ],
+
+    "defaultrelease": "master",
+
+    "releases": [
+        {
+            "name": "master",
+            "description": "OpenEmbedded master",
+            "bitbake": "master",
+            "branch": "master",
+            "defaultlayers": [ "openembedded-core" ],
+            "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" :  0 },
+            "helptext": "Toaster will run your builds using the tip of the <a href=\"http://cgit.openembedded.org/openembedded-core/log/\">OpenEmbedded master</a> branch, where active development takes place. This is not a stable branch, so your builds might not work as expected."
+        },
+        {
+            "name": "fido",
+            "description": "OpenEmbedded Fido",
+            "bitbake": "fido",
+            "branch": "fido",
+            "defaultlayers": [ "openembedded-core" ],
+            "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" :  0 },
+            "helptext": "Toaster will run your builds with the tip of the <a href=\"http://cgit.openembedded.org/openembedded-core/log/?h=fido\">OpenEmbedded \"Fido\"</a> branch"
+        },
+        {
+            "name": "dizzy",
+            "description": "OpenEmbedded Dizzy",
+            "bitbake": "dizzy",
+            "branch": "dizzy",
+            "defaultlayers": [ "openembedded-core" ],
+            "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" :  0 },
+            "helptext": "Toaster will run your builds with the tip of the <a href=\"http://cgit.openembedded.org/openembedded-core/log/?h=dizzy\">OpenEmbedded \"Dizzy\"</a> branch"
+        },
+        {
+            "name": "local",
+            "description": "Local OpenEmbedded",
+            "bitbake": "HEAD",
+            "branch": "HEAD",
+            "defaultlayers": [ "openembedded-core" ],
+            "layersourcepriority": { "Imported layers": 99, "Local OpenEmbedded" : 10, "OpenEmbedded" :  0 },
+            "helptext": "Toaster will run your builds with the version of OpenEmbedded that you have cloned or downloaded to your computer."
+        }
+    ]
+}
diff --git a/meta/files/common-licenses/AAL b/meta/files/common-licenses/AAL
new file mode 100644
index 0000000..5484226
--- /dev/null
+++ b/meta/files/common-licenses/AAL
@@ -0,0 +1,51 @@
+
+Attribution Assurance License
+Copyright (c) 2002 by AUTHOR
+PROFESSIONAL IDENTIFICATION * URL
+"PROMOTIONAL SLOGAN FOR AUTHOR`S PROFESSIONAL PRACTICE"
+
+All Rights Reserved
+ATTRIBUTION ASSURANCE LICENSE (adapted from the original BSD license)
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the conditions below are met.
+These conditions require a modest attribution to <AUTHOR> (the
+"Author"), who hopes that its promotional value may help justify the
+thousands of dollars in otherwise billable time invested in writing
+this and other freely available, open-source software.
+
+1. Redistributions of source code, in whole or part and with or without
+modification (the "Code"), must prominently display this GPG-signed
+text in verifiable form.
+2. Redistributions of the Code in binary form must be accompanied by
+this GPG-signed text in any documentation and, each time the resulting
+executable program or a program dependent thereon is launched, a
+prominent display (e.g., splash screen or banner text) of the Author`s
+attribution information, which includes:
+(a) Name ("AUTHOR"),
+(b) Professional identification ("PROFESSIONAL IDENTIFICATION"), and
+(c) URL ("URL").
+3. Neither the name nor any trademark of the Author may be used to
+endorse or promote products derived from this software without specific
+prior written permission.
+4. Users are entirely responsible, to the exclusion of the Author and
+any other persons, for compliance with (1) regulations set by owners or
+administrators of employed equipment, (2) licensing terms of any other
+software, and (3) local regulations regarding use, including those
+regarding import, export, and use of encryption software.
+
+THIS FREE SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE AUTHOR OR ANY CONTRIBUTOR BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+EFFECTS OF UNAUTHORIZED OR MALICIOUS NETWORK ACCESS;
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+--End of License
+
diff --git a/meta/files/common-licenses/AFL-1.2 b/meta/files/common-licenses/AFL-1.2
new file mode 100644
index 0000000..e8131e7
--- /dev/null
+++ b/meta/files/common-licenses/AFL-1.2
@@ -0,0 +1,123 @@
+
+  Academic Free License
+  Version 1.2
+
+This Academic Free License applies to any original work of authorship 
+(the "Original Work") whose owner (the "Licensor") has placed the 
+following notice immediately following the copyright notice for the 
+Original Work:
+
+Licensed under the Academic Free License version 1.2
+
+Grant of License. Licensor hereby grants to any person obtaining a 
+copy of the Original Work ("You") a world-wide, royalty-free, 
+non-exclusive, perpetual, non-sublicenseable license (1) to use, copy, 
+modify, merge, publish, perform, distribute and/or sell copies of the 
+Original Work and derivative works thereof, and (2) under patent claims 
+owned or controlled by the Licensor that are embodied in the Original 
+Work as furnished by the Licensor, to make, use, sell and offer for 
+sale the Original Work and derivative works thereof, subject to the 
+following conditions.
+
+Attribution Rights. You must retain, in the Source Code of any 
+Derivative Works that You create, all copyright, patent or trademark 
+notices from the Source Code of the Original Work, as well as any 
+notices of licensing and any descriptive text identified therein as an 
+"Attribution Notice." You must cause the Source Code for any Derivative 
+Works that You create to carry a prominent Attribution Notice reasonably 
+calculated to inform recipients that You have modified the Original Work.
+
+Exclusions from License Grant. Neither the names of Licensor, nor the 
+names of any contributors to the Original Work, nor any of their 
+trademarks or service marks, may be used to endorse or promote products 
+derived from this Original Work without express prior written permission 
+of the Licensor.
+
+Warranty and Disclaimer of Warranty. Licensor warrants that the copyright 
+in and to the Original Work is owned by the Licensor or that the Original 
+Work is distributed by Licensor under a valid current license from the 
+copyright owner. Except as expressly stated in the immediately proceeding 
+sentence, the Original Work is provided under this License on an "AS IS" 
+BASIS and WITHOUT WARRANTY, either express or implied, including, without 
+limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS 
+FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL 
+WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part 
+of this License. No license to Original Work is granted hereunder except 
+under this disclaimer.
+
+Limitation of Liability. Under no circumstances and under no legal theory, 
+whether in tort (including negligence), contract, or otherwise, shall the 
+Licensor be liable to any person for any direct, indirect, special, 
+incidental, or consequential damages of any character arising as a result 
+of this License or the use of the Original Work including, without 
+limitation, damages for loss of goodwill, work stoppage, computer failure 
+or malfunction, or any and all other commercial damages or losses. This 
+limitation of liability shall not apply to liability for death or personal 
+injury resulting from Licensor`s negligence to the extent applicable law 
+prohibits such limitation. Some jurisdictions do not allow the exclusion or 
+limitation of incidental or consequential damages, so this exclusion and 
+limitation may not apply to You.
+
+License to Source Code. The term "Source Code" means the preferred form of 
+the Original Work for making modifications to it and all available 
+documentation describing how to modify the Original Work. Licensor hereby 
+agrees to provide a machine-readable copy of the Source Code of the Original 
+Work along with each copy of the Original Work that Licensor distributes. 
+Licensor reserves the right to satisfy this obligation by placing a 
+machine-readable copy of the Source Code in an information repository 
+reasonably calculated to permit inexpensive and convenient access by You for 
+as long as Licensor continues to distribute the Original Work, and by 
+publishing the address of that information repository in a notice immediately 
+following the copyright notice that applies to the Original Work.
+
+Mutual Termination for Patent Action. This License shall terminate 
+automatically and You may no longer exercise any of the rights granted to You 
+by this License if You file a lawsuit in any court alleging that any OSI 
+Certified open source software that is licensed under any license containing 
+this "Mutual Termination for Patent Action" clause infringes any patent 
+claims that are essential to use that software.
+
+Right to Use. You may use the Original Work in all ways not otherwise 
+restricted or conditioned by this License or by law, and Licensor promises 
+not to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2002 Lawrence E. Rosen. All rights reserved. 
+Permission is hereby granted to copy and distribute this license without 
+modification. This license may not be modified without the express written 
+permission of its copyright owner.
+
+-- 
+END OF LICENSE. The following is intended to describe the essential 
+differences between the Academic Free License (AFL) version 1.0 and other 
+open source licenses:
+
+The Academic Free License is similar to the BSD, MIT, UoI/NCSA and Apache 
+licenses in many respects but it is intended to solve a few problems with 
+those licenses.
+    
+* The AFL is written so as to make it clear what software is being 
+licensed (by the inclusion of a statement following the copyright notice 
+in the software). This way, the license functions better than a template 
+license. The BSD, MIT and UoI/NCSA licenses apply to unidentified software.
+    
+* The AFL contains a complete copyright grant to the software. The BSD 
+and Apache licenses are vague and incomplete in that respect.
+    
+* The AFL contains a complete patent grant to the software. The BSD, MIT, 
+UoI/NCSA and Apache licenses rely on an implied patent license and contain 
+no explicit patent grant.
+    
+* The AFL makes it clear that no trademark rights are granted to the 
+licensor`s trademarks. The Apache license contains such a provision, but the 
+BSD, MIT and UoI/NCSA licenses do not.
+    
+* The AFL includes the warranty by the licensor that it either owns the 
+copyright or that it is distributing the software under a license. None of 
+the other licenses contain that warranty. All other warranties are disclaimed, 
+as is the case for the other licenses.
+
+* The AFL is itself copyrighted (with the right granted to copy and distribute 
+without modification). This ensures that the owner of the copyright to the 
+license will control changes. The Apache license contains a copyright notice, 
+but the BSD, MIT and UoI/NCSA licenses do not. 
+
diff --git a/meta/files/common-licenses/AFL-2.0 b/meta/files/common-licenses/AFL-2.0
new file mode 100644
index 0000000..ad27a28
--- /dev/null
+++ b/meta/files/common-licenses/AFL-2.0
@@ -0,0 +1,48 @@
+
+The Academic Free License
+ v. 2.0
+
+This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work:   
+Licensed under the Academic Free License version 2.0
+
+1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following: 
+a) to reproduce the Original Work in copies; 
+
+b) to prepare derivative works ("Derivative Works") based upon the Original Work; 
+
+c) to distribute copies of the Original Work and Derivative Works to the public; 
+
+d) to perform the Original Work publicly; and 
+
+e) to display the Original Work publicly.   
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works.  
+
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work.  Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes.  Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work.    
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor.  Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein.  No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2.  No right is granted to the trademarks of Licensor even if such marks are included in the Original Work.  Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license.  
+
+5) This section intentionally omitted.  
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice."  You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.  
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights.  Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.  This DISCLAIMER OF WARRANTY constitutes an essential part of this License.  No license to Original Work is granted hereunder except under this disclaimer.  
+
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses.  This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor`s negligence to the extent applicable law prohibits such limitation.  Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.  
+
+9) Acceptance and Termination. If You distribute  copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License.  Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty.  Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions.    
+
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, for patent infringement (i) against Licensor with respect to a patent applicable to software or (ii) against any entity with respect to a patent applicable to the Original Work (but excluding combinations of the Original Work with other software or hardware).    
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions.  The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.  Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. ¤ 101 et seq., the equivalent laws of other countries, and international treaty.  This section shall survive the termination of this License.  
+
+12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action.  This section shall survive the termination of this License.  
+
+13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof.  If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.    
+
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License.  For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you.  For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.   
+
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.    
+
+This license is Copyright (C) 2003 Lawrence E. Rosen.  All rights reserved.  Permission is hereby granted to copy and distribute this license without modification.  This license may not be modified without the express written permission of its copyright owner. 
+
diff --git a/meta/files/common-licenses/AFL-2.1 b/meta/files/common-licenses/AFL-2.1
new file mode 100644
index 0000000..0284e4f
--- /dev/null
+++ b/meta/files/common-licenses/AFL-2.1
@@ -0,0 +1,50 @@
+
+The Academic Free License
+v. 2.1
+
+This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work:
+
+Licensed under the Academic Free License version 2.1
+
+1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following:
+
+a) to reproduce the Original Work in copies;
+
+b) to prepare derivative works ("Derivative Works") based upon the Original Work;
+
+c) to distribute copies of the Original Work and Derivative Works to the public;
+
+d) to perform the Original Work publicly; and
+
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein. No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2. No right is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license.
+
+5) This section intentionally omitted.
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to Original Work is granted hereunder except under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor`s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
+
+9) Acceptance and Termination. If You distribute copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty. Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions.
+
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. &#194;&#167; 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License.
+
+12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved. Permission is hereby granted to copy and distribute this license without modification. This license may not be modified without the express written permission of its copyright owner.
+
diff --git a/meta/files/common-licenses/AFL-3.0 b/meta/files/common-licenses/AFL-3.0
new file mode 100644
index 0000000..126c259
--- /dev/null
+++ b/meta/files/common-licenses/AFL-3.0
@@ -0,0 +1,27 @@
+
+Academic Free License (&#8220;AFL&#8221;) v. 3.0
+This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
+Licensed under the Academic Free License version 3.0
+
+1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
+a) to reproduce the Original Work in copies, either alone or as part of a collective work;
+b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
+c) to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor&#8217;s reserved rights and remedies, in this Academic Free License;
+d) to perform the Original Work publicly; and
+e) to display the Original Work publicly.
+2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor&#8217;s trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
+5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
+9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including &#8220;fair use&#8221; or &#8220;fair dealing&#8221;). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
+12) Attorneys&#8217; Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+16) Modification of This License. This License is Copyright &#169; 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
+
diff --git a/meta/files/common-licenses/AGPL-3.0 b/meta/files/common-licenses/AGPL-3.0
new file mode 100644
index 0000000..dba13ed
--- /dev/null
+++ b/meta/files/common-licenses/AGPL-3.0
@@ -0,0 +1,661 @@
+                    GNU AFFERO GENERAL PUBLIC LICENSE
+                       Version 3, 19 November 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 Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+our General Public Licenses are 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.
+
+  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.
+
+  Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+  A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate.  Many developers of free software are heartened and
+encouraged by the resulting cooperation.  However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+  The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community.  It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server.  Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+  An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals.  This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+  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 Affero 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. Remote Network Interaction; Use with the GNU General Public License.
+
+  Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software.  This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+  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 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 work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero 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 Affero 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 Affero 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 Affero 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 Affero 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 Affero General Public License for more details.
+
+    You should have received a copy of the GNU Affero 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 your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source.  For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code.  There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+  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 AGPL, see
+<http://www.gnu.org/licenses/>.
diff --git a/meta/files/common-licenses/ANTLR-PD b/meta/files/common-licenses/ANTLR-PD
new file mode 100644
index 0000000..8b02a8c
--- /dev/null
+++ b/meta/files/common-licenses/ANTLR-PD
@@ -0,0 +1,32 @@
+
+ANTLR SOFTWARE RIGHTS
+
+ANTLR 1989-2006 Developed by Terence Parr
+Partially supported by University of San Francisco &amp; jGuru.com
+
+We reserve no legal rights to the ANTLR--it is fully in the
+public domain. An individual or company may do whatever
+they wish with source code distributed with ANTLR or the
+code generated by ANTLR, including the incorporation of
+ANTLR, or its output, into commerical software.
+
+We encourage users to develop software with ANTLR. However,
+we do ask that credit is given to us for developing
+ANTLR. By "credit", we mean that if you use ANTLR or
+incorporate any source code into one of your programs
+(commercial product, research project, or otherwise) that
+you acknowledge this fact somewhere in the documentation,
+research report, etc... If you like ANTLR and have
+developed a nice tool with the output, please mention that
+you developed it using ANTLR. In addition, we ask that the
+headers remain intact in our source code. As long as these
+guidelines are kept, we expect to continue enhancing this
+system and expect to make other tools available as they are
+completed.
+
+The primary ANTLR guy:
+
+Terence Parr
+parrt@cs.usfca.edu
+parrt@antlr.org
+
diff --git a/meta/files/common-licenses/APL-1.0 b/meta/files/common-licenses/APL-1.0
new file mode 100644
index 0000000..4805b1c
--- /dev/null
+++ b/meta/files/common-licenses/APL-1.0
@@ -0,0 +1,218 @@
+
+ADAPTIVE PUBLIC LICENSE
+Version 1.0
+THE LICENSED WORK IS PROVIDED UNDER THE TERMS OF THIS ADAPTIVE PUBLIC LICENSE ("LICENSE"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE LICENSED WORK CONSTITUTES RECIPIENT`S ACCEPTANCE OF THIS LICENSE AND ITS TERMS, WHETHER OR NOT SUCH RECIPIENT READS THE TERMS OF THIS LICENSE. "LICENSED WORK" AND "RECIPIENT" ARE DEFINED BELOW.
+
+IMPORTANT NOTE: This License is "adaptive", and the generic version or another version of an Adaptive Public License should not be relied upon to determine your rights and obligations under this License. You must read the specific Adaptive Public License that you receive with the Licensed Work, as certain terms are defined at the outset by the Initial Contributor.
+
+See Section 2.2 below, Exhibit A attached, and any Suppfile.txt accompanying this License to determine the specific adaptive features applicable to this License. For example, without limiting the foregoing, (a) for selected choice of law and jurisdiction see Part 3 of Exhibit A; (b) for the selected definition of Third Party see Part 4 of Exhibit A; and (c) for selected patent licensing terms (if any) see Section 2.2 below and Part 6 of Exhibit A.
+
+1. DEFINITIONS.
+
+1.1. "CONTRIBUTION" means:
+
+(a) In the case of the Initial Contributor, the Initial Work distributed under this License by the Initial Contributor; and
+
+(b) In the case of each Subsequent Contributor, the Subsequent Work originating from and distributed by such Subsequent Contributor.
+
+1.2. "DESIGNATED WEB SITE" means the web site having the URL identified in Part 1 of Exhibit A, which URL may be changed by the Initial Contributor by posting on the current Designated Web Site the new URL for at least sixty (60) days.
+
+1.3. "DISTRIBUTOR" means any Person that distributes the Licensed Work or any portion thereof to at least one Third Party.
+
+1.4. "ELECTRONIC DISTRIBUTION MECHANISM" means any mechanism generally accepted in the software development community for the electronic transfer of data.
+
+1.5. "EXECUTABLE" means the Licensed Work in any form other than Source Code.
+
+1.6. "GOVERNING JURISDICTION" means the state, province or other legal jurisdiction identified in Part 3 of Exhibit A.
+
+1.7. "INDEPENDENT MODULE" means a separate module of software and/or data that is not a derivative work of or copied from the Licensed Work or any portion thereof. In addition, a module does not qualify as an Independent Module but instead forms part of the Licensed Work if the module: (a) is embedded in the Licensed Work; (b) is included by reference in the Licensed Work other than by a function call or a class reference; or (c) must be included or contained, in whole or in part, within a file directory or subdirectory actually containing files making up the Licensed Work.
+
+1.8. "INITIAL CONTRIBUTOR" means the Person or entity identified as the Initial Contributor in the notice required by Part 1 of Exhibit A.
+
+1.9. "INITIAL WORK" means the initial Source Code, object code (if any) and documentation for the computer program identified in Part 2 of Exhibit A, as such Source Code, object code and documentation is distributed under this License by the Initial Contributor.
+
+1.10. "LARGER WORK" means a work that combines the Licensed Work or portions thereof with code not governed by this License.
+
+1.11. "LICENSED WORK" means the Initial Work and/or any Subsequent Work, in each case including portions thereof.
+
+1.12. "LICENSE NOTICE" has the meaning assigned in Part 5 of Exhibit A.
+
+1.13. "MODIFICATION" or "MODIFICATIONS" means any change to and/or addition to the Licensed Work.
+
+1.14. "PERSON" means an individual or other legal entity, including a corporation, partnership or other body.
+
+1.15. "RECIPIENT" means any Person who receives or obtains the Licensed Work under this License (by way of example, without limiting the foregoing, any Subsequent Contributor or Distributor).
+
+1.16. "SOURCE CODE" means the source code for a computer program, including the source code for all modules and components of the computer program, plus any associated interface definition files, and scripts used to control compilation and installation of an executable.
+
+1.17. "SUBSEQUENT CONTRIBUTOR" means any Person that makes or contributes to the making of any Subsequent Work and that distributes that Subsequent Work to at least one Third Party.
+
+1.18. "SUBSEQUENT WORK" means a work that has resulted or arises from changes to and/or additions to:
+
+(a) the Initial Work;
+
+(b) any other Subsequent Work; or
+
+(c) to any combination of the Initial Work and any such other Subsequent Work;
+
+where such changes and/or additions originate from a Subsequent Contributor. A Subsequent Work will "originate" from a Subsequent Contributor if the Subsequent Work was a result of efforts by such Subsequent Contributor (or anyone acting on such Subsequent Contributor`s behalf, such as, a contractor or other entity that is engaged by or under the direction of the Subsequent Contributor). For greater certainty, a Subsequent Work expressly excludes and shall not capture within its meaning any Independent Module.
+
+1.19. "SUPPLEMENT FILE" means a file distributed with the Licensed Work having a file name "suppfile.txt".
+
+1.20. "THIRD PARTY" has the meaning assigned in Part 4 of Exhibit A.
+
+2. LICENSE.
+
+2.1. COPYRIGHT LICENSE FROM INITIAL AND SUBSEQUENT CONTRIBUTORS.
+
+(a) Subject to the terms of this License, the Initial Contributor hereby grants each Recipient a world-wide, royalty-free, non-exclusive copyright license to:
+
+(i) reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Initial Work; and
+
+(ii) reproduce, publicly display, publicly perform, distribute, and sublicense any derivative works (if any) prepared by Recipient;
+
+in Source Code and Executable form, either with other Modifications, on an unmodified basis, or as part of a Larger Work.
+
+(b) Subject to the terms of this License, each Subsequent Contributor hereby grants each Recipient a world-wide, royalty-free, non-exclusive copyright license to:
+
+(i) reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Subsequent Work of such Subsequent Contributor; and
+
+(ii) reproduce, publicly display, publicly perform, distribute, and sublicense any derivative works (if any) prepared by Recipient;
+
+in Source Code and Executable form, either with other Modifications, on an unmodified basis, or as part of a Larger Work.
+2.2. PATENT LICENSE FROM INITIAL AND SUBSEQUENT CONTRIBUTORS.
+
+(a) This License does not include or grant any patent license whatsoever from the Initial Contributor, Subsequent Contributor, or any Distributor unless, at the time the Initial Work is first distributed or made available under this License (as the case may be), the Initial Contributor has selected pursuant to Part 6 of Exhibit A the patent terms in paragraphs A, B, C, D and E from Part 6 of Exhibit A. If this is not done then the Initial Work and any other Subsequent Work is made available under the License without any patent license (the "PATENTS-EXCLUDED LICENSE").
+
+(b) However, the Initial Contributor may subsequently distribute or make available (as the case may be) future copies of: (1) the Initial Work; or (2) any Licensed Work distributed by the Initial Contributor which includes the Initial Work (or any portion thereof) and/or any Modification made by the Initial Contributor; available under a License which includes a patent license (the "PATENTS-INCLUDED LICENSE") by selecting pursuant to Part 6 of Exhibit A the patent terms in paragraphs A, B, C, D and E from Part 6 of Exhibit A, when the Initial Contributor distributes or makes available (as the case may be) such future copies under this License.
+
+(c) If any Recipient receives or obtains one or more copies of the Initial Work or any other portion of the Licensed Work under the Patents-Included License, then all licensing of such copies under this License shall include the terms in paragraphs A, B, C, D and E from Part 6 of Exhibit A and that Recipient shall not be able to rely upon the Patents-Excluded License for any such copies. However, all Recipients that receive one or more copies of the Initial Work or any other portion of the Licensed Work under a copy of the License which includes the Patents-Excluded License shall have no patent license with respect to such copies received under the Patents-Excluded License and availability and distribution of such copies, including Modifications made by such Recipient to such copies, shall be under a copy of the License without any patent license.
+
+(d) Where a Recipient uses in combination or combines any copy of the Licensed Work (or portion thereof) licensed under a copy of the License having a Patents-Excluded License with any copy of the Licensed Work (or portion thereof) licensed under a copy of the License having a Patents-Included License, the combination (and any portion thereof) shall, from the first time such Recipient uses, makes available or distributes the combination (as the case may be), be subject to only the terms of the License having the Patents-Included License which shall include the terms in paragraphs A, B, C, D and E from Part 6 of Exhibit A.
+
+2.3. ACKNOWLEDGEMENT AND DISCLAIMER.
+
+Recipient understands and agrees that although Initial Contributor and each Subsequent Contributor grants the licenses to its Contributions set forth herein, no representation, warranty, guarantee or assurance is provided by any Initial Contributor, Subsequent Contributor, or Distributor that the Licensed Work does not infringe the patent or other intellectual property rights of any other entity. Initial Contributor, Subsequent Contributor, and each Distributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise, in relation to the Licensed Works. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, without limiting the foregoing disclaimers, if a third party patent license is required to allow Recipient to distribute the Licensed Work, it is Recipient`s responsibility to acquire that license before distributing the Licensed Work.
+
+2.4. RESERVATION.
+
+Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Initial Contributor, Subsequent Contributor, or Distributor except as expressly stated herein.
+
+3. DISTRIBUTION OBLIGATIONS.
+
+3.1. DISTRIBUTION GENERALLY.
+
+(a) A Subsequent Contributor shall make that Subsequent Contributor`s Subsequent Work(s) available to the public via an Electronic Distribution Mechanism for a period of at least twelve (12) months. The aforesaid twelve (12) month period shall begin within a reasonable time after the creation of the Subsequent Work and no later than sixty (60) days after first distribution of that Subsequent Contributor`s Subsequent Work.
+
+(b) All Distributors must distribute the Licensed Work in accordance with the terms of the License, and must include a copy of this License (including without limitation Exhibit A and the accompanying Supplement File) with each copy of the Licensed Work distributed. In particular, this License must be prominently distributed with the Licensed Work in a file called "license.txt." In addition, the License Notice in Part 5 of Exhibit A must be included at the beginning of all Source Code files, and viewable to a user in any executable such that the License Notice is reasonably brought to the attention of any party using the Licensed Work.
+
+3.2. EXECUTABLE DISTRIBUTIONS OF THE LICENSED WORK.
+
+A Distributor may choose to distribute the Licensed Work, or any portion thereof, in Executable form (an "EXECUTABLE DISTRIBUTION") to any third party, under the terms of Section 2 of this License, provided the Executable Distribution is made available under and accompanied by a copy of this License, AND provided at least ONE of the following conditions is fulfilled:
+
+(a) The Executable Distribution must be accompanied by the Source Code for the Licensed Work making up the Executable Distribution, and the Source Code must be distributed on the same media as the Executable Distribution or using an Electronic Distribution Mechanism; or
+
+(b) The Executable Distribution must be accompanied with a written offer, valid for at least thirty six (36) months, to give any third party under the terms of this License, for a charge no more than the cost of physically performing source distribution, a complete machine-readable copy of the Source Code for the Licensed Work making up the Executable Distribution, to be available and distributed using an Electronic Distribution Mechanism, and such Executable Distribution must remain available in Source Code form to any third party via the Electronic Distribution Mechanism (or any replacement Electronic Distribution Mechanism the particular Distributor may reasonably need to turn to as a substitute) for said at least thirty six (36) months.
+
+For greater certainty, the above-noted requirements apply to any Licensed Work or portion thereof distributed to any third party in Executable form, whether such distribution is made alone, in combination with a Larger Work or Independent Modules, or in some other combination.
+
+3.3. SOURCE CODE DISTRIBUTIONS.
+
+When a Distributor makes the Licensed Work, or any portion thereof, available to any Person in Source Code form, it must be made available under this License and a copy of this License must be included with each copy of the Source Code, situated so that the copy of the License is conspicuously brought to the attention of that Person. For greater clarification, this Section 3.3 applies to all distribution of the Licensed Work in any Source Code form. A Distributor may charge a fee for the physical act of transferring a copy, which charge shall be no more than the cost of physically performing source distribution.
+
+3.4. REQUIRED NOTICES IN SOURCE CODE.
+
+Each Subsequent Contributor must ensure that the notice set out in Part 5 of Exhibit A is included in each file of the Source Code for each Subsequent Work originating from that particular Subsequent Contributor, if such notice is not already included in each such file. If it is not possible to put such notice in a particular Source Code file due to its structure, then the Subsequent Contributor must include such notice in a location (such as a relevant directory in which the file is stored) where a user would be likely to look for such a notice.
+
+3.5. NO DISTRIBUTION REQUIREMENTS FOR INTERNALLY USED MODIFICATIONS.
+
+Notwithstanding Sections 3.2, 3.3 and 3.4, Recipient may, internally within its own corporation or organization use the Licensed Work, including the Initial Work and Subsequent Works, and make Modifications for internal use within Recipient`s own corporation or organization (collectively, "INTERNAL USE MODIFICATIONS"). The Recipient shall have no obligation to distribute, in either Source Code or Executable form, any such Internal Use Modifications made by Recipient in the course of such internal use, except where required below in this Section 3.5. All Internal Use Modifications distributed to any Person, whether or not a Third Party, shall be distributed pursuant to and be accompanied by the terms of this License. If the Recipient chooses to distribute any such Internal Use Modifications to any Third Party, then the Recipient shall be deemed a Subsequent Contributor, and any such Internal Use Modifications distributed to any Third Party shall be deemed a Subsequent Work originating from that Subsequent Contributor, and shall from the first such instance become part of the Licensed Work that must thereafter be distributed and made available to third parties in accordance with the terms of Sections 3.1 to 3.4 inclusive.
+
+3.6. INDEPENDENT MODULES.
+
+This License shall not apply to Independent Modules of any Initial Contributor, Subsequent Contributor, Distributor or any Recipient, and such Independent Modules may be licensed or made available under one or more separate license agreements.
+
+3.7. LARGER WORKS.
+
+Any Distributor or Recipient may create or contribute to a Larger Work by combining any of the Licensed Work with other code not governed by the terms of this License, and may distribute the Larger Work as one or more products. However, in any such case, Distributor or Recipient (as the case may be) must make sure that the requirements of this License are fulfilled for the Licensed Work portion of the Larger Work.
+
+3.8. DESCRIPTION OF DISTRIBUTED MODIFICATIONS.
+
+(a) Each Subsequent Contributor (including the Initial Contributor where the Initial Contributor also qualifies as a Subsequent Contributor) must cause each Subsequent Work created or contributed to by that Subsequent Contributor to contain a file documenting the changes, in accordance with the requirements of Part 1 of the Supplement File, that such Subsequent Contributor made in the creation or contribution to that Subsequent Work. If no Supplement File exists or no requirements are set out in Part 1 of the Supplement File, then there are no requirements for Subsequent Contributors to document changes that they make resulting in Subsequent Works.
+
+(b) The Initial Contributor may at any time introduce requirements or add to or change earlier requirements (in each case, the "EARLIER DESCRIPTION REQUIREMENTS") for documenting changes resulting in Subsequent Works by revising Part 1 of each copy of the Supplement File distributed by the Initial Contributor with future copies of the Licensed Work so that Part 1 then contains new requirements (the "NEW DESCRIPTION REQUIREMENTS") for documenting such changes.
+
+(c) Any Recipient receiving at any time any copy of an Initial Work or any Subsequent Work under a copy of this License (in each case, an "Earlier LICENSED COPY") having the Earlier Description Requirements may choose, with respect to each such Earlier Licensed Copy, to comply with the Earlier Description Requirements or the New Description Requirements. Where a Recipient chooses to comply with the New Description Requirements, that Recipient will, when thereafter distributing any copies of any such Earlier Licensed Copy, include a Supplement File having a section entitled Part 1 that contains a copy of the New Description Requirements.
+
+(d) For greater certainty, the intent of Part 1 of the Supplement File is to provide a mechanism (if any) by which Subsequent Contributors must document changes that they make to the Licensed Work resulting in Subsequent Works. Part 1 of any Supplement File shall not be used to increase or reduce the scope of the license granted in Article 2 of this License or in any other way increase or decrease the rights and obligations of any Recipient, and shall at no time serve as the basis for terminating the License. Further, a Recipient can be required to correct and change its documentation procedures to comply with Part 1 of the Supplement File, but cannot be penalised with damages. Part 1 of any Supplement File is only binding on each Recipient of any Licensed Work to the extent Part 1 sets out the requirements for documenting changes to the Initial Work or any Subsequent Work.
+
+(e) An example of a set of requirements for documenting changes and contributions made by Subsequent Contributor is set out in Part 7 of Exhibit A of this License. Part 7 is a sample only and is not binding on Recipients, unless (subject to the earlier paragraphs of this Section 3.8) those are the requirements that the Initial Contributor includes in Part 1 of the Supplement File with the copies of the Initial Work distributed under this License.
+
+3.9. USE OF DISTRIBUTOR NAME.
+
+The name of a Distributor may not be used by any other Distributor to endorse or promote the Licensed Work or products derived from the Licensed Work, without prior written permission.
+
+3.10. LIMITED RECOGNITION OF INITIAL CONTRIBUTOR.
+
+(a) As a modest attribution to the Initial Contributor, in the hope that its promotional value may help justify the time, money and effort invested in writing the Initial Work, the Initial Contributor may include in Part 2 of the Supplement File a requirement that each time an executable program resulting from the Initial Work or any Subsequent Work, or a program dependent thereon, is launched or run, a prominent display of the Initial Contributor`s attribution information must occur (the "ATTRIBUTION INFORMATION"). The Attribution Information must be included at the beginning of each Source Code file. For greater certainty, the Initial Contributor may specify in the Supplement File that the above attribution requirement only applies to an executable program resulting from the Initial Work or any Subsequent Work, but not a program dependent thereon. The intent is to provide for reasonably modest attribution, therefore the Initial Contributor may not require Recipients to display, at any time, more than the following Attribution Information: (a) a copyright notice including the name of the Initial Contributor; (b) a word or one phrase (not exceeding 10 words); (c) one digital image or graphic provided with the Initial Work; and (d) a URL (collectively, the "ATTRIBUTION LIMITS").
+
+(b) If no Supplement File exists, or no Attribution Information is set out in Part 2 of the Supplement File, then there are no requirements for Recipients to display any Attribution Information of the Initial Contributor.
+
+(c) Each Recipient acknowledges that all trademarks, service marks and/or trade names contained within Part 2 of the Supplement File distributed with the Licensed Work are the exclusive property of the Initial Contributor and may only be used with the permission of the Initial Contributor, or under circumstances otherwise permitted by law, or as expressly set out in this License.
+
+3.11. For greater certainty, any description or attribution provisions contained within a Supplement File may only be used to specify the nature of the description or attribution requirements, as the case may be. Any provision in a Supplement File that otherwise purports to modify, vary, nullify or amend any right, obligation or representation contained herein shall be deemed void to that extent, and shall be of no force or effect.
+
+4. COMMERCIAL USE AND INDEMNITY.
+
+4.1. COMMERCIAL SERVICES.
+
+A Recipient ("COMMERCIAL RECIPIENT") may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations (collectively, "SERVICES") to one or more other Recipients or Distributors. However, such Commercial Recipient may do so only on that Commercial Recipient`s own behalf, and not on behalf of any other Distributor or Recipient, and Commercial Recipient must make it clear than any such warranty, support, indemnity or liability obligation(s) is/are offered by Commercial Recipient alone. At no time may Commercial Recipient use any Services to deny any party the Licensed Work in Source Code or Executable form when so required under any of the other terms of this License. For greater certainty, this Section 4.1 does not diminish any of the other terms of this License, including without limitation the obligation of the Commercial Recipient as a Distributor, when distributing any of the Licensed Work in Source Code or Executable form, to make such distribution royalty-free (subject to the right to charge a fee of no more than the cost of physically performing Source Code or Executable distribution (as the case may be)).
+
+4.2. INDEMNITY.
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this License is intended to facilitate the commercial use of the Licensed Work, the Distributor who includes any of the Licensed Work in a commercial product offering should do so in a manner which does not create potential liability for other Distributors. Therefore, if a Distributor includes the Licensed Work in a commercial product offering or offers any Services, such Distributor ("COMMERCIAL DISTRIBUTOR") hereby agrees to defend and indemnify every other Distributor or Subsequent Contributor (in each case an "INDEMNIFIED PARTY") against any losses, damages and costs (collectively "LOSSES") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Party to the extent caused by the acts or omissions of such Commercial Distributor in connection with its distribution of any of the Licensed Work in a commercial product offering or in connection with any Services. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Party must: (a) promptly notify the Commercial Distributor in writing of such claim; and (b) allow the Commercial Distributor to control, and co-operate with the Commercial Distributor in, the defense and any related settlement negotiations. The Indemnified Party may participate in any such claim at its own expense.
+
+5. VERSIONS OF THE LICENSE.
+
+5.1. NEW VERSIONS.
+
+The Initial Contributor may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+5.2. EFFECT OF NEW VERSIONS.
+
+Once the Licensed Work or any portion thereof has been published by Initial Contributor under a particular version of the License, Recipient may choose to continue to use it under the terms of that version. However, if a Recipient chooses to use the Licensed Work under the terms of any subsequent version of the License published by the Initial Contributor, then from the date of making this choice, the Recipient must comply with the terms of that subsequent version with respect to all further reproduction, preparation of derivative works, public display of, public performance of, distribution and sublicensing by the Recipient in connection with the Licensed Work. No one other than the Initial Contributor has the right to modify the terms applicable to the Licensed Work
+
+6. DISCLAIMER OF WARRANTY.
+
+6.1. GENERAL DISCLAIMER.
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS LICENSE, THE LICENSED WORK IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT ANY REPRESENTATION, WARRANTY, GUARANTEE, ASSURANCE OR CONDITION OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LICENSED WORK IS WITH RECIPIENT. SHOULD ANY LICENSED WORK PROVE DEFECTIVE IN ANY RESPECT, RECIPIENT (NOT THE INITIAL CONTRIBUTOR OR ANY SUBSEQUENT CONTRIBUTOR) ASSUMES THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS CLAUSE CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY LICENSED WORK IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS LICENSE INCLUDING WITHOUT LIMITATION THIS DISCLAIMER.
+
+6.2. RESPONSIBILITY OF RECIPIENTS.
+
+Each Recipient is solely responsible for determining the appropriateness of using and distributing the Licensed Work and assumes all risks associated with its exercise of rights under this License, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+7. TERMINATION.
+
+7.1. This License shall continue until terminated in accordance with the express terms herein.
+
+7.2. Recipient may choose to terminate this License automatically at any time.
+
+7.3. This License, including without limitation the rights granted hereunder to a particular Recipient, will terminate automatically if such Recipient is in material breach of any of the terms of this License and fails to cure such breach within sixty (60) days of becoming aware of the breach. Without limiting the foregoing, any material breach by such Recipient of any term of any other License under which such Recipient is granted any rights to the Licensed Work shall constitute a material breach of this License.
+
+7.4. Upon termination of this License by or with respect to a particular Recipient for any reason, all rights granted hereunder and under any other License to that Recipient shall terminate. However, all sublicenses to the Licensed Work which were previously properly granted by such Recipient under a copy of this License (in each case, an "Other License" and in plural, "Other Licenses") shall survive any such termination of this License, including without limitation the rights and obligations under such Other Licenses as set out in their respective Sections 2, 3, 4, 5, 6, 7 and 8, mutatis mutandis, for so long as the respective sublicensees (i.e. other Recipients) remain in compliance with the terms of the copy of this License under which such sublicensees received rights to the Licensed Work. Any termination of such Other Licenses shall be pursuant to their respective Section 7, mutatis mutandis. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+7.5. Upon any termination of this License by or with respect to a particular Recipient, Sections 4.1, 4.2, 6.1, 6.2, 7.4, 7.5, 8.1, and 8.2, together with all provisions of this License necessary for the interpretation and enforcement of same, shall expressly survive such termination.
+
+8. LIMITATION OF LIABILITY.
+
+8.1. IN NO EVENT SHALL ANY OF INITIAL CONTRIBUTOR, ITS SUBSIDIARIES, OR AFFILIATES, OR ANY OF ITS OR THEIR RESPECTIVE OFFICERS, DIRECTORS, EMPLOYEES, AND/OR AGENTS (AS THE CASE MAY BE), HAVE ANY LIABILITY FOR ANY DIRECT DAMAGES, INDIRECT DAMAGES, PUNITIVE DAMAGES, INCIDENTAL DAMAGES, SPECIAL DAMAGES, EXEMPLARY DAMAGES, CONSEQUENTIAL DAMAGES OR ANY OTHER DAMAGES WHATSOEVER (INCLUDING WITHOUT LIMITATION LOSS OF USE, DATA OR PROFITS, OR ANY OTHER LOSS ARISING OUT OF OR IN ANY WAY RELATED TO THE USE, INABILITY TO USE, UNAUTHORIZED USE, PERFORMANCE, OR NON-PERFORMANCE OF THE LICENSED WORK OR ANY PART THEREOF OR THE PROVISION OF OR FAILURE TO PROVIDE SUPPORT SERVICES, OR THAT RESULT FROM ERRORS, DEFECTS, OMISSIONS, DELAYS IN OPERATION OR TRANSMISSION, OR ANY OTHER FAILURE OF PERFORMANCE), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) IN RELATION TO OR ARISING IN ANY WAY OUT OF THIS LICENSE OR THE USE OR DISTRIBUTION OF THE LICENSED WORK OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. THIS CLAUSE CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY LICENSED WORK IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS LICENSE INCLUDING WITHOUT LIMITATION THE LIMITATIONS SET FORTH IN THIS SECTION 8.1.
+
+8.2. EXCEPT AS EXPRESSLY SET FORTH IN THIS LICENSE, EACH RECIPIENT SHALL NOT HAVE ANY LIABILITY FOR ANY EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE LICENSED WORK OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION.
+
+9. GOVERNING LAW AND LEGAL ACTION.
+
+9.1. This License shall be governed by and construed in accordance with the laws of the Governing Jurisdiction assigned in Part 3 of Exhibit A, without regard to its conflict of law provisions. No party may bring a legal action under this License more than one year after the cause of the action arose. Each party waives its rights (if any) to a jury trial in any litigation arising under this License. Note that if the Governing Jurisdiction is not assigned in Part 3 of Exhibit A, then the Governing Jurisdiction shall be the State of New York.
+
+9.2. The courts of the Governing Jurisdiction shall have jurisdiction, but not exclusive jurisdiction, to entertain and determine all disputes and claims, whether for specific performance, injunction, damages or otherwise, 
+
diff --git a/meta/files/common-licenses/APSL-1.0 b/meta/files/common-licenses/APSL-1.0
new file mode 100644
index 0000000..024f822
--- /dev/null
+++ b/meta/files/common-licenses/APSL-1.0
@@ -0,0 +1,372 @@
+
+APPLE PUBLIC SOURCE LICENSE
+Version 1.0 - March 16, 1999
+
+Please read this License carefully before downloading this software.
+By downloading and using this software, you are agreeing to be bound by
+the terms of this License. If you do not or cannot agree to the terms
+of this License, please do not download or use the software.
+
+1. General; Definitions. This License applies to any program or other
+work which Apple Computer, Inc. ("Apple") publicly announces as
+subject to this Apple Public Source License and which contains a
+notice placed by Apple identifying such program or work as "Original
+Code" and stating that it is subject to the terms of this Apple Public
+Source License version 1.0 (or subsequent version thereof), as it may
+be revised from time to time by Apple ("License"). As used in this
+License:
+
+1.1 "Applicable Patents" mean: (a) in the case where Apple is the
+grantor of rights, (i) patents or patent applications that are now
+or hereafter acquired, owned by or assigned to Apple and (ii) whose
+claims cover subject matter contained in the Original Code, but only
+to the extent necessary to use, reproduce and/or distribute the
+Original Code without infringement; and (b) in the case where You
+are the grantor of rights, (i) patents and patent applications that
+are now or hereafter acquired, owned by or assigned to You and (ii)
+whose claims cover subject matter in Your Modifications, taken alone
+or in combination with Original Code.
+
+1.2 "Covered Code" means the Original Code, Modifications, the
+combination of Original Code and any Modifications, and/or any
+respective portions thereof.
+
+1.3 "Deploy" means to use, sublicense or distribute Covered Code other
+than for Your internal research and development (R&amp;D), and includes
+without limitation, any and all internal use or distribution of
+Covered Code within Your business or organization except for R&amp;D use,
+as well as direct or indirect sublicensing or distribution of Covered
+Code by You to any third party in any form or manner.
+
+1.4 "Larger Work" means a work which combines Covered Code or portions
+thereof with code not governed by the terms of this License.
+
+1.5 "Modifications" mean any addition to, deletion from, and/or change
+to, the substance and/or structure of Covered Code. When code is
+released as a series of files, a Modification is: (a) any addition to
+or deletion from the contents of a file containing Covered Code;
+and/or (b) any new file or other representation of computer program
+statements that contains any part of Covered Code.
+
+1.6 "Original Code" means the Source Code of a program or other work
+as originally made available by Apple under this License, including
+the Source Code of any updates or upgrades to such programs or works
+made available by Apple under this License, and that has been
+expressly identified by Apple as such in the header file(s) of such
+work.
+
+1.7 "Source Code" means the human readable form of a program or other
+work that is suitable for making modifications to it, including all
+modules it contains, plus any associated interface definition files,
+scripts used to control compilation and installation of an executable
+(object code).
+
+1.8 "You" or "Your" means an individual or a legal entity exercising
+rights under this License. For legal entities, "You" or "Your"
+includes any entity which controls, is controlled by, or is under
+common control with, You, where "control" means (a) the power, direct
+or indirect, to cause the direction or management of such entity,
+whether by contract or otherwise, or (b) ownership of fifty percent
+(50%) or more of the outstanding shares or beneficial ownership of
+such entity.
+
+2. Permitted Uses; Conditions &amp; Restrictions. Subject to the terms
+and conditions of this License, Apple hereby grants You, effective on
+the date You accept this License and download the Original Code, a
+world-wide, royalty-free, non-exclusive license, to the extent of
+Apple`s Applicable Patents and copyrights covering the Original
+Code, to do the following:
+
+2.1 You may use, copy, modify and distribute Original Code, with or
+without Modifications, solely for Your internal research and
+development, provided that You must in each instance:
+
+(a) retain and reproduce in all copies of Original Code the copyright
+and other proprietary notices and disclaimers of Apple as they appear
+in the Original Code, and keep intact all notices in the Original Code
+that refer to this License;
+
+(b) include a copy of this License with every copy of Source Code of
+Covered Code and documentation You distribute, and You may not offer
+or impose any terms on such Source Code that alter or restrict this
+License or the recipients` rights hereunder, except as permitted under
+Section 6; and
+
+(c) completely and accurately document all Modifications that you have
+made and the date of each such Modification, designate the version of
+the Original Code you used, prominently include a file carrying such
+information with the Modifications, and duplicate the notice in
+Exhibit A in each file of the Source Code of all such Modifications.
+
+2.2 You may Deploy Covered Code, provided that You must in each
+instance:
+
+(a) satisfy all the conditions of Section 2.1 with respect to the
+Source Code of the Covered Code;
+
+(b) make all Your Deployed Modifications publicly available in Source
+Code form via electronic distribution (e.g. download from a web site)
+under the terms of this License and subject to the license grants set
+forth in Section 3 below, and any additional terms You may choose to
+offer under Section 6. You must continue to make the Source Code of
+Your Deployed Modifications available for as long as you Deploy the
+Covered Code or twelve (12) months from the date of initial
+Deployment, whichever is longer;
+
+(c) must notify Apple and other third parties of how to obtain Your
+Deployed Modifications by filling out and submitting the required
+information found at
+http://www.apple.com/publicsource/modifications.html; and
+
+(d) if you Deploy Covered Code in object code, executable form only,
+include a prominent notice, in the code itself as well as in related
+documentation, stating that Source Code of the Covered Code is
+available under the terms of this License with information on how and
+where to obtain such Source Code.
+
+3. Your Grants. In consideration of, and as a condition to, the
+licenses granted to You under this License:
+
+(a) You hereby grant to Apple and all third parties a non-exclusive,
+royalty-free license, under Your Applicable Patents and other
+intellectual property rights owned or controlled by You, to use,
+reproduce, modify, distribute and Deploy Your Modifications of the
+same scope and extent as Apple`s licenses under Sections 2.1 and 2.2;
+and
+
+(b) You hereby grant to Apple and its subsidiaries a non-exclusive,
+worldwide, royalty-free, perpetual and irrevocable license, under Your
+Applicable Patents and other intellectual property rights owned or
+controlled by You, to use, reproduce, execute, compile, display,
+perform, modify or have modified (for Apple and/or its subsidiaries),
+sublicense and distribute Your Modifications, in any form, through
+multiple tiers of distribution.
+
+4. Larger Works. You may create a Larger Work by combining Covered
+Code with other code not governed by the terms of this License and
+distribute the Larger Work as a single product. In each such
+instance, You must make sure the requirements of this License are
+fulfilled for the Covered Code or any portion thereof.
+
+5. Limitations on Patent License. Except as expressly stated in
+Section 2, no other patent rights, express or implied, are granted
+by Apple herein. Modifications and/or Larger Works may require
+additional patent licenses from Apple which Apple may grant in its
+sole discretion.
+
+6. Additional Terms. You may choose to offer, and to charge a fee
+for, warranty, support, indemnity or liability obligations and/or
+other rights consistent with the scope of the license granted herein
+("Additional Terms") to one or more recipients of Covered
+Code. However, You may do so only on Your own behalf and as Your
+sole responsibility, and not on behalf of Apple. You must obtain the
+recipient`s agreement that any such Additional Terms are offered by
+You alone, and You hereby agree to indemnify, defend and hold Apple
+harmless for any liability incurred by or claims asserted against
+Apple by reason of any such Additional Terms.
+
+7. Versions of the License. Apple may publish revised and/or new
+versions of this License from time to time. Each version will be
+given a distinguishing version number. Once Original Code has been
+published under a particular version of this License, You may
+continue to use it under the terms of that version. You may also
+choose to use such Original Code under the terms of any subsequent
+version of this License published by Apple. No one other than Apple
+has the right to modify the terms applicable to Covered Code created
+under this License.
+
+8. NO WARRANTY OR SUPPORT. The Original Code may contain in whole or
+in part pre-release, untested, or not fully tested works. The
+Original Code may contain errors that could cause failures or loss
+of data, and may be incomplete or contain inaccuracies. You
+expressly acknowledge and agree that use of the Original Code, or
+any portion thereof, is at Your sole and entire risk. THE ORIGINAL
+CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT
+OF ANY KIND AND APPLE AND APPLE`S LICENSOR(S) (FOR THE PURPOSES OF
+SECTIONS 8 AND 9, APPLE AND APPLE`S LICENSOR(S) ARE COLLECTIVELY
+REFERRED TO AS "APPLE") EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR
+CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY OR
+SATISFACTORY QUALITY AND FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS. APPLE DOES NOT WARRANT THAT
+THE FUNCTIONS CONTAINED IN THE ORIGINAL CODE WILL MEET YOUR
+REQUIREMENTS, OR THAT THE OPERATION OF THE ORIGINAL CODE WILL BE
+UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE ORIGINAL CODE
+WILL BE CORRECTED. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN
+BY APPLE OR AN APPLE AUTHORIZED REPRESENTATIVE SHALL CREATE A
+WARRANTY OR IN ANY WAY INCREASE THE SCOPE OF THIS WARRANTY. You
+acknowledge that the Original Code is not intended for use in the
+operation of nuclear facilities, aircraft navigation, communication
+systems, or air traffic control machines in which case the failure
+of the Original Code could lead to death, personal injury, or severe
+physical or environmental damage.
+
+9. Liability.
+
+9.1 Infringement. If any of the Original Code becomes the subject of
+a claim of infringement ("Affected Original Code"), Apple may, at
+its sole discretion and option: (a) attempt to procure the rights
+necessary for You to continue using the Affected Original Code; (b)
+modify the Affected Original Code so that it is no longer
+infringing; or (c) terminate Your rights to use the Affected
+Original Code, effective immediately upon Apple`s posting of a
+notice to such effect on the Apple web site that is used for
+implementation of this License.
+
+9.2 LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES SHALL APPLE BE
+LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL
+DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR
+INABILITY TO USE THE ORIGINAL CODE, OR ANY PORTION THEREOF, WHETHER
+UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE),
+PRODUCTS LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF
+ESSENTIAL PURPOSE OF ANY REMEDY. In no event shall Apple`s total
+liability to You for all damages under this License exceed the
+amount of fifty dollars ($50.00).
+
+10. Trademarks. This License does not grant any rights to use the
+trademarks or trade names "Apple", "Apple Computer", "Mac OS X",
+"Mac OS X Server" or any other trademarks or trade names belonging
+to Apple (collectively "Apple Marks") and no Apple Marks may be
+used to endorse or promote products derived from the Original Code
+other than as permitted by and in strict compliance at all times
+with Apple`s third party trademark usage guidelines which are
+posted at http://www.apple.com/legal/guidelinesfor3rdparties.html.
+
+11. Ownership. Apple retains all rights, title and interest in and to
+the Original Code and any Modifications made by or on behalf of
+Apple ("Apple Modifications"), and such Apple Modifications will
+not be automatically subject to this License. Apple may, at its
+sole discretion, choose to license such Apple Modifications under
+this License, or on different terms from those contained in this
+License or may choose not to license them at all. Apple`s
+development, use, reproduction, modification, sublicensing and
+distribution of Covered Code will not be subject to this License.
+
+12. Termination.
+
+12.1 Termination. This License and the rights granted hereunder will
+terminate:
+
+(a) automatically without notice from Apple if You fail to comply with
+any term(s) of this License and fail to cure such breach within 30
+days of becoming aware of such breach; (b) immediately in the event of
+the circumstances described in Sections 9.1 and/or 13.6(b); or (c)
+automatically without notice from Apple if You, at any time during the
+term of this License, commence an action for patent infringement
+against Apple.
+
+12.2 Effect of Termination. Upon termination, You agree to
+immediately stop any further use, reproduction, modification and
+distribution of the Covered Code, or Affected Original Code in the
+case of termination under Section 9.1, and to destroy all copies of
+the Covered Code or Affected Original Code (in the case of
+termination under Section 9.1) that are in your possession or
+control. All sublicenses to the Covered Code which have been
+properly granted prior to termination shall survive any termination
+of this License. Provisions which, by their nature, should remain
+in effect beyond the termination of this License shall survive,
+including but not limited to Sections 3, 5, 8, 9, 10, 11, 12.2 and
+13. Neither party will be liable to the other for compensation,
+indemnity or damages of any sort solely as a result of terminating
+this License in accordance with its terms, and termination of this
+License will be without prejudice to any other right or remedy of
+either party.
+
+13. Miscellaneous.
+
+13.1 Export Law Assurances. You may not use or otherwise export or
+re-export the Original Code except as authorized by United States
+law and the laws of the jurisdiction in which the Original Code was
+obtained. In particular, but without limitation, the Original Code
+may not be exported or re-exported (a) into (or to a national or
+resident of) any U.S. embargoed country or (b) to anyone on the
+U.S. Treasury Department`s list of Specially Designated Nationals
+or the U.S. Department of Commerce`s Table of Denial Orders. By
+using the Original Code, You represent and warrant that You are not
+located in, under control of, or a national or resident of any such
+country or on any such list.
+
+13.2 Government End Users. The Covered Code is a "commercial item" as
+defined in FAR 2.101. Government software and technical data
+rights in the Covered Code include only those rights customarily
+provided to the public as defined in this License. This customary
+commercial license in technical data and software is provided in
+accordance with FAR 12.211 (Technical Data) and 12.212 (Computer
+Software) and, for Department of Defense purchases, DFAR
+252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3
+(Rights in Commercial Computer Software or Computer Software
+Documentation). Accordingly, all U.S. Government End Users acquire
+Covered Code with only those rights set forth herein.
+
+13.3 Relationship of Parties. This License will not be construed as
+creating an agency, partnership, joint venture or any other form of
+legal association between You and Apple, and You will not represent
+to the contrary, whether expressly, by implication, appearance or
+otherwise.
+
+13.4 Independent Development. Nothing in this License will impair
+Apple`s right to acquire, license, develop, have others develop for
+it, market and/or distribute technology or products that perform
+the same or similar functions as, or otherwise compete with,
+Modifications, Larger Works, technology or products that You may
+develop, produce, market or distribute.
+
+13.5 Waiver; Construction. Failure by Apple to enforce any provision
+of this License will not be deemed a waiver of future enforcement
+of that or any other provision. Any law or regulation which
+provides that the language of a contract shall be construed against
+the drafter will not apply to this License.
+
+13.6 Severability. (a) If for any reason a court of competent
+jurisdiction finds any provision of this License, or portion
+thereof, to be unenforceable, that provision of the License will be
+enforced to the maximum extent permissible so as to effect the
+economic benefits and intent of the parties, and the remainder of
+this License will continue in full force and effect. (b)
+Notwithstanding the foregoing, if applicable law prohibits or
+restricts You from fully and/or specifically complying with
+Sections 2 and/or 3 or prevents the enforceability of either of
+those Sections, this License will immediately terminate and You
+must immediately discontinue any use of the Covered Code and
+destroy all copies of it that are in your possession or control.
+
+13.7 Dispute Resolution. Any litigation or other dispute resolution
+between You and Apple relating to this License shall take place in
+the Northern District of California, and You and Apple hereby
+consent to the personal jurisdiction of, and venue in, the state
+and federal courts within that District with respect to this
+License. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly
+excluded.
+
+13.8 Entire Agreement; Governing Law. This License constitutes the
+entire agreement between the parties with respect to the subject
+matter hereof. This License shall be governed by the laws of the
+United States and the State of California, except that body of
+California law concerning conflicts of law.
+
+Where You are located in the province of Quebec, Canada, the following
+clause applies: The parties hereby confirm that they have requested
+that this License and all related documents be drafted in English. Les
+parties ont exige que le present contrat et tous les documents
+connexes soient rediges en anglais.
+
+EXHIBIT A.
+
+"Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
+Reserved. This file contains Original Code and/or Modifications of
+Original Code as defined in and that are subject to the Apple Public
+Source License Version 1.0 (the `License`). You may not use this file
+except in compliance with the License. Please obtain a copy of the
+License at http://www.apple.com/publicsource and read it before using
+this file.
+
+The Original Code and all software distributed under the License are
+distributed on an `AS IS` basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
+License for the specific language governing rights and limitations
+under the License."
+
diff --git a/meta/files/common-licenses/APSL-1.1 b/meta/files/common-licenses/APSL-1.1
new file mode 100644
index 0000000..425e46e
--- /dev/null
+++ b/meta/files/common-licenses/APSL-1.1
@@ -0,0 +1,374 @@
+
+APPLE PUBLIC SOURCE LICENSE
+Version 1.1 - April 19,1999
+
+Please read this License carefully before downloading this software.
+By downloading and using this software, you are agreeing to be bound
+by the terms of this License.  If you do not or cannot agree to the
+terms of this License, please do not download or use the software.
+
+1. General; Definitions.  This License applies to any program or other
+work which Apple Computer, Inc. ("Apple") publicly announces as
+subject to this Apple Public Source License and which contains a
+notice placed by Apple identifying such program or work as "Original
+Code" and stating that it is subject to the terms of this Apple Public
+Source License version 1.1 (or subsequent version thereof), as it may
+be revised from time to time by Apple ("License").  As used in this
+License:
+
+1.1 "Affected Original Code" means only those specific portions of
+Original Code that allegedly infringe upon any party`s intellectual
+property rights or are otherwise the subject of a claim of
+infringement.
+
+1.2 "Applicable Patent Rights" mean: (a) in the case where Apple is
+the grantor of rights, (i) claims of patents that are now or hereafter
+acquired, owned by or assigned to Apple and (ii) that cover subject
+matter contained in the Original Code, but only to the extent
+necessary to use, reproduce and/or distribute the Original Code
+without infringement; and (b) in the case where You are the grantor of
+rights, (i) claims of patents that are now or hereafter acquired,
+owned by or assigned to You and (ii) that cover subject matter in Your
+Modifications, taken alone or in combination with Original Code.
+
+1.3 "Covered Code" means the Original Code, Modifications, the
+combination of Original Code and any Modifications, and/or any
+respective portions thereof.
+
+1.4 "Deploy" means to use, sublicense or distribute Covered Code other
+than for Your internal research and development (R&amp;D), and includes
+without limitation, any and all internal use or distribution of
+Covered Code within Your business or organization except for R&amp;D use,
+as well as direct or indirect sublicensing or distribution of Covered
+Code by You to any third party in any form or manner.
+
+1.5 "Larger Work" means a work which combines Covered Code or portions
+thereof with code not governed by the terms of this License.
+
+1.6 "Modifications" mean any addition to, deletion from, and/or change
+to, the substance and/or structure of Covered Code.  When code is
+released as a series of files, a Modification is: (a) any addition to
+or deletion from the contents of a file containing Covered Code;
+and/or (b) any new file or other representation of computer program
+statements that contains any part of Covered Code.
+
+1.7 "Original Code" means (a) the Source Code of a program or other
+work as originally made available by Apple under this License,
+including the Source Code of any updates or upgrades to such programs
+or works made available by Apple under this License, and that has been
+expressly identified by Apple as such in the header file(s) of such
+work; and (b) the object code compiled from such Source Code and
+originally made available by Apple under this License.
+
+1.8 "Source Code" means the human readable form of a program or other
+work that is suitable for making modifications to it, including all
+modules it contains, plus any associated interface definition files,
+scripts used to control compilation and installation of an executable
+(object code).
+
+1.9 "You" or "Your" means an individual or a legal entity exercising
+rights under this License.  For legal entities, "You" or "Your"
+includes any entity which controls, is controlled by, or is under
+common control with, You, where "control" means (a) the power, direct
+or indirect, to cause the direction or management of such entity,
+whether by contract or otherwise, or (b) ownership of fifty percent
+(50%) or more of the outstanding shares or beneficial ownership of
+such entity.
+
+2. Permitted Uses; Conditions &amp; Restrictions.  Subject to the terms
+and conditions of this License, Apple hereby grants You, effective on
+the date You accept this License and download the Original Code, a
+world-wide, royalty-free, non- exclusive license, to the extent of
+Apple`s Applicable Patent Rights and copyrights covering the Original
+Code, to do the following:
+
+2.1 You may use, copy, modify and distribute Original Code, with or
+without Modifications, solely for Your internal research and
+development, provided that You must in each instance:
+
+(a) retain and reproduce in all copies of Original Code the copyright
+and other proprietary notices and disclaimers of Apple as they appear
+in the Original Code, and keep intact all notices in the Original Code
+that refer to this License;
+
+(b) include a copy of this License with every copy of Source Code of
+Covered Code and documentation You distribute, and You may not offer
+or impose any terms on such Source Code that alter or restrict this
+License or the recipients` rights hereunder, except as permitted under
+Section 6; and
+
+(c) completely and accurately document all Modifications that you have
+made and the date of each such Modification, designate the version of
+the Original Code you used, prominently include a file carrying such
+information with the Modifications, and duplicate the notice in
+Exhibit A in each file of the Source Code of all such Modifications.
+
+2.2 You may Deploy Covered Code, provided that You must in each
+  instance:
+
+(a) satisfy all the conditions of Section 2.1 with respect to the
+Source Code of the Covered Code;
+
+(b) make all Your Deployed Modifications publicly available in Source
+Code form via electronic distribution (e.g. download from a web site)
+under the terms of this License and subject to the license grants set
+forth in Section 3 below, and any additional terms You may choose to
+offer under Section 6.  You must continue to make the Source Code of
+Your Deployed Modifications available for as long as you Deploy the
+Covered Code or twelve (12) months from the date of initial
+Deployment, whichever is longer;
+
+(c) if You Deploy Covered Code containing Modifications made by You,
+inform others of how to obtain those Modifications by filling out and
+submitting the information found at
+http://www.apple.com/publicsource/modifications.html, if available;
+and
+
+(d) if You Deploy Covered Code in object code, executable form only,
+include a prominent notice, in the code itself as well as in related
+documentation, stating that Source Code of the Covered Code is
+available under the terms of this License with information on how and
+where to obtain such Source Code.
+
+3. Your Grants.  In consideration of, and as a condition to, the
+licenses granted to You under this License:
+
+(a) You hereby grant to Apple and all third parties a non-exclusive,
+royalty-free license, under Your Applicable Patent Rights and other
+intellectual property rights owned or controlled by You, to use,
+reproduce, modify, distribute and Deploy Your Modifications of the
+same scope and extent as Apple`s licenses under Sections 2.1 and 2.2;
+and
+
+(b) You hereby grant to Apple and its subsidiaries a non-exclusive,
+worldwide, royalty-free, perpetual and irrevocable license, under Your
+Applicable Patent Rights and other intellectual property rights owned
+or controlled by You, to use, reproduce, execute, compile, display,
+perform, modify or have modified (for Apple and/or its subsidiaries),
+sublicense and distribute Your Modifications, in any form, through
+multiple tiers of distribution.
+
+4. Larger Works.  You may create a Larger Work by combining Covered
+Code with other code not governed by the terms of this License and
+distribute the Larger Work as a single product.  In each such
+instance, You must make sure the requirements of this License are
+fulfilled for the Covered Code or any portion thereof.
+
+5. Limitations on Patent License.  Except as expressly stated in
+Section 2, no other patent rights, express or implied, are granted by
+Apple herein.  Modifications and/or Larger Works may require
+additional patent licenses from Apple which Apple may grant in its
+sole discretion.
+
+6. Additional Terms.  You may choose to offer, and to charge a fee
+for, warranty, support, indemnity or liability obligations and/or
+other rights consistent with the scope of the license granted herein
+("Additional Terms") to one or more recipients of Covered
+Code. However, You may do so only on Your own behalf and as Your sole
+responsibility, and not on behalf of Apple. You must obtain the
+recipient`s agreement that any such Additional Terms are offered by
+You alone, and You hereby agree to indemnify, defend and hold Apple
+harmless for any liability incurred by or claims asserted against
+Apple by reason of any such Additional Terms.
+
+7. Versions of the License.  Apple may publish revised and/or new
+versions of this License from time to time.  Each version will be
+given a distinguishing version number.  Once Original Code has been
+published under a particular version of this License, You may continue
+to use it under the terms of that version. You may also choose to use
+such Original Code under the terms of any subsequent version of this
+License published by Apple.  No one other than Apple has the right to
+modify the terms applicable to Covered Code created under this
+License.
+
+8. NO WARRANTY OR SUPPORT.  The Original Code may contain in whole or
+in part pre-release, untested, or not fully tested works.  The
+Original Code may contain errors that could cause failures or loss of
+data, and may be incomplete or contain inaccuracies.  You expressly
+acknowledge and agree that use of the Original Code, or any portion
+thereof, is at Your sole and entire risk.  THE ORIGINAL CODE IS
+PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND
+AND APPLE AND APPLE`S LICENSOR(S) (FOR THE PURPOSES OF SECTIONS 8 AND
+9, APPLE AND APPLE`S LICENSOR(S) ARE COLLECTIVELY REFERRED TO AS
+"APPLE") EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+AND/OR CONDITIONS OF MERCHANTABILITY OR SATISFACTORY QUALITY AND
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
+RIGHTS.  APPLE DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE
+ORIGINAL CODE WILL MEET YOUR REQUIREMENTS, OR THAT THE OPERATION OF
+THE ORIGINAL CODE WILL BE UNINTERRUPTED OR ERROR- FREE, OR THAT
+DEFECTS IN THE ORIGINAL CODE WILL BE CORRECTED.  NO ORAL OR WRITTEN
+INFORMATION OR ADVICE GIVEN BY APPLE OR AN APPLE AUTHORIZED
+REPRESENTATIVE SHALL CREATE A WARRANTY OR IN ANY WAY INCREASE THE
+SCOPE OF THIS WARRANTY.  You acknowledge that the Original Code is not
+intended for use in the operation of nuclear facilities, aircraft
+navigation, communication systems, or air traffic control machines in
+which case the failure of the Original Code could lead to death,
+personal injury, or severe physical or environmental damage.
+
+9. Liability.
+
+9.1 Infringement.  If any portion of, or functionality implemented by,
+the Original Code becomes the subject of a claim of infringement,
+Apple may, at its option: (a) attempt to procure the rights necessary
+for Apple and You to continue using the Affected Original Code; (b)
+modify the Affected Original Code so that it is no longer infringing;
+or (c) suspend Your rights to use, reproduce, modify, sublicense and
+distribute the Affected Original Code until a final determination of
+the claim is made by a court or governmental administrative agency of
+competent jurisdiction and Apple lifts the suspension as set forth
+below.  Such suspension of rights will be effective immediately upon
+Apple`s posting of a notice to such effect on the Apple web site that
+is used for implementation of this License.  Upon such final
+determination being made, if Apple is legally able, without the
+payment of a fee or royalty, to resume use, reproduction,
+modification, sublicensing and distribution of the Affected Original
+Code, Apple will lift the suspension of rights to the Affected
+Original Code by posting a notice to such effect on the Apple web site
+that is used for implementation of this License.  If Apple suspends
+Your rights to Affected Original Code, nothing in this License shall
+be construed to restrict You, at Your option and subject to applicable
+law, from replacing the Affected Original Code with non-infringing
+code or independently negotiating for necessary rights from such third
+party.
+
+9.2 LIMITATION OF LIABILITY.  UNDER NO CIRCUMSTANCES SHALL APPLE BE
+LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO
+USE THE ORIGINAL CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY
+OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY
+OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF
+ANY REMEDY.  In no event shall Apple`s total liability to You for all
+damages under this License exceed the amount of fifty dollars
+($50.00).
+
+10. Trademarks.  This License does not grant any rights to use the
+trademarks or trade names "Apple", "Apple Computer", "Mac OS X", "Mac
+OS X Server" or any other trademarks or trade names belonging to Apple
+(collectively "Apple Marks") and no Apple Marks may be used to endorse
+or promote products derived from the Original Code other than as
+permitted by and in strict compliance at all times with Apple`s third
+party trademark usage guidelines which are posted at
+http://www.apple.com/legal/guidelinesfor3rdparties.html.
+
+11. Ownership.  Apple retains all rights, title and interest in and to
+the Original Code and any Modifications made by or on behalf of Apple
+("Apple Modifications"), and such Apple Modifications will not be
+automatically subject to this License.  Apple may, at its sole
+discretion, choose to license such Apple Modifications under this
+License, or on different terms from those contained in this License or
+may choose not to license them at all.  Apple`s development, use,
+reproduction, modification, sublicensing and distribution of Covered
+Code will not be subject to this License.
+
+12. Termination.
+
+12.1 Termination.  This License and the rights granted hereunder will
+   terminate:
+
+(a) automatically without notice from Apple if You fail to comply with
+any term(s) of this License and fail to cure such breach within 30
+days of becoming aware of such breach; (b) immediately in the event of
+the circumstances described in Section 13.5(b); or (c) automatically
+without notice from Apple if You, at any time during the term of this
+License, commence an action for patent infringement against Apple.
+
+12.2 Effect of Termination.  Upon termination, You agree to
+immediately stop any further use, reproduction, modification,
+sublicensing and distribution of the Covered Code and to destroy all
+copies of the Covered Code that are in your possession or control.
+All sublicenses to the Covered Code which have been properly granted
+prior to termination shall survive any termination of this License.
+Provisions which, by their nature, should remain in effect beyond the
+termination of this License shall survive, including but not limited
+to Sections 3, 5, 8, 9, 10, 11, 12.2 and 13.  Neither party will be
+liable to the other for compensation, indemnity or damages of any sort
+solely as a result of terminating this License in accordance with its
+terms, and termination of this License will be without prejudice to
+any other right or remedy of either party.
+
+13.  Miscellaneous.
+
+13.1 Government End Users.  The Covered Code is a "commercial item" as
+defined in FAR 2.101.  Government software and technical data rights
+in the Covered Code include only those rights customarily provided to
+the public as defined in this License. This customary commercial
+license in technical data and software is provided in accordance with
+FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for
+Department of Defense purchases, DFAR 252.227-7015 (Technical Data --
+Commercial Items) and 227.7202-3 (Rights in Commercial Computer
+Software or Computer Software Documentation).  Accordingly, all U.S.
+Government End Users acquire Covered Code with only those rights set
+forth herein.
+
+13.2 Relationship of Parties.  This License will not be construed as
+creating an agency, partnership, joint venture or any other form of
+legal association between You and Apple, and You will not represent to
+the contrary, whether expressly, by implication, appearance or
+otherwise.
+
+13.3 Independent Development.  Nothing in this License will impair
+Apple`s right to acquire, license, develop, have others develop for
+it, market and/or distribute technology or products that perform the
+same or similar functions as, or otherwise compete with,
+Modifications, Larger Works, technology or products that You may
+develop, produce, market or distribute.
+
+13.4 Waiver; Construction.  Failure by Apple to enforce any provision
+of this License will not be deemed a waiver of future enforcement of
+that or any other provision.  Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+will not apply to this License.
+
+13.5 Severability.  (a) If for any reason a court of competent
+jurisdiction finds any provision of this License, or portion thereof,
+to be unenforceable, that provision of the License will be enforced to
+the maximum extent permissible so as to effect the economic benefits
+and intent of the parties, and the remainder of this License will
+continue in full force and effect.  (b) Notwithstanding the foregoing,
+if applicable law prohibits or restricts You from fully and/or
+specifically complying with Sections 2 and/or 3 or prevents the
+enforceability of either of those Sections, this License will
+immediately terminate and You must immediately discontinue any use of
+the Covered Code and destroy all copies of it that are in your
+possession or control.
+
+13.6 Dispute Resolution.  Any litigation or other dispute resolution
+between You and Apple relating to this License shall take place in the
+Northern District of California, and You and Apple hereby consent to
+the personal jurisdiction of, and venue in, the state and federal
+courts within that District with respect to this License. The
+application of the United Nations Convention on Contracts for the
+International Sale of Goods is expressly excluded.
+
+13.7 Entire Agreement; Governing Law.  This License constitutes the
+entire agreement between the parties with respect to the subject
+matter hereof.  This License shall be governed by the laws of the
+United States and the State of California, except that body of
+California law concerning conflicts of law.
+
+Where You are located in the province of Quebec, Canada, the following
+clause applies: The parties hereby confirm that they have requested
+that this License and all related documents be drafted in English. Les
+parties ont exige que le present contrat et tous les documents
+connexes soient rediges en anglais.
+
+EXHIBIT A.
+
+"Portions Copyright (c) 1999-2000 Apple Computer, Inc.  All Rights
+Reserved.  This file contains Original Code and/or Modifications of
+Original Code as defined in and that are subject to the Apple Public
+Source License Version 1.1 (the "License").  You may not use this file
+except in compliance with the License.  Please obtain a copy of the
+License at http://www.apple.com/publicsource and read it before using
+this file.
+
+The Original Code and all software distributed under the License are
+distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT.  Please see the
+License for the specific language governing rights and limitations
+under the License."
+
diff --git a/meta/files/common-licenses/APSL-1.2 b/meta/files/common-licenses/APSL-1.2
new file mode 100644
index 0000000..58e3530
--- /dev/null
+++ b/meta/files/common-licenses/APSL-1.2
@@ -0,0 +1,105 @@
+
+Apple Public Source License Ver. 1.2
+
+1. General; Definitions. This License applies to any program or other work which Apple Computer, Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 1.2 (or subsequent version thereof) ("License"). As used in this License:
+
+1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.
+
+1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.
+
+1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.
+
+1.4 "Deploy" means to use, sublicense or distribute Covered Code other than for Your internal research and development (R&amp;D) and/or Personal Use, and includes without limitation, any and all internal use or distribution of Covered Code within Your business or organization except for R&amp;D use and/or Personal Use, as well as direct or indirect sublicensing or distribution of Covered Code by You to any third party in any form or manner.
+
+1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+1.6 "Modifications" mean any addition to, deletion from, and/or change to, the substance and/or structure of the Original Code, any previous Modifications, the combination of Original Code and any previous Modifications, and/or any respective portions thereof. When code is released as a series of files, a Modification is: (a) any addition to or deletion from the contents of a file containing Covered Code; and/or (b) any new file or other representation of computer program statements that contains any part of Covered Code.
+
+1.7 "Original Code" means (a) the Source Code of a program or other work as originally made available by Apple under this License, including the Source Code of any updates or upgrades to such programs or works made available by Apple under this License, and that has been expressly identified by Apple as such in the header file(s) of such work; and (b) the object code compiled from such Source Code and originally made available by Apple under this License.
+
+1.8 "Personal Use" means use of Covered Code by an individual solely for his or her personal, private and non-commercial purposes. An individual`s use of Covered Code in his or her capacity as an officer, employee, member, independent contractor or agent of a corporation, business or organization (commercial or non-commercial) does not qualify as Personal Use.
+
+1.9 "Source Code" means the human readable form of a program or other work that is suitable for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an executable (object code).
+
+1.10 "You" or "Your" means an individual or a legal entity exercising rights under this License. For legal entities, "You" or "Your" includes any entity which controls, is controlled by, or is under common control with, You, where "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+2. Permitted Uses; Conditions &amp; Restrictions.Subject to the terms and conditions of this License, Apple hereby grants You, effective on the date You accept this License and download the Original Code, a world-wide, royalty-free, non-exclusive license, to the extent of Apple`s Applicable Patent Rights and copyrights covering the Original Code, to do the following:
+
+2.1 You may use, reproduce, display, perform, modify and distribute Original Code, with or without Modifications, solely for Your internal research and development and/or Personal Use, provided that in each instance:
+
+(a) You must retain and reproduce in all copies of Original Code the copyright and other proprietary notices and disclaimers of Apple as they appear in the Original Code, and keep intact all notices in the Original Code that refer to this License; and
+
+(b) You must include a copy of this License with every copy of Source Code of Covered Code and documentation You distribute, and You may not offer or impose any terms on such Source Code that alter or restrict this License or the recipients` rights hereunder, except as permitted under Section 6.
+
+2.2 You may use, reproduce, display, perform, modify and Deploy Covered Code, provided that in each instance:
+
+(a) You must satisfy all the conditions of Section 2.1 with respect to the Source Code of the Covered Code;
+
+(b) You must duplicate, to the extent it does not already exist, the notice in Exhibit A in each file of the Source Code of all Your Modifications, and cause the modified files to carry prominent notices stating that You changed the files and the date of any change;
+
+(c) You must make Source Code of all Your Deployed Modifications publicly available under the terms of this License, including the license grants set forth in Section 3 below, for as long as you Deploy the Covered Code or twelve (12) months from the date of initial Deployment, whichever is longer. You should preferably distribute the Source Code of Your Deployed Modifications electronically (e.g. download from a web site); and
+
+(d) if You Deploy Covered Code in object code, executable form only, You must include a prominent notice, in the code itself as well as in related documentation, stating that Source Code of the Covered Code is available under the terms of this License with information on how and where to obtain such Source Code.
+
+2.3 You expressly acknowledge and agree that although Apple and each Contributor grants the licenses to their respective portions of the Covered Code set forth herein, no assurances are provided by Apple or any Contributor that the Covered Code does not infringe the patent or other intellectual property rights of any other entity. Apple and each Contributor disclaim any liability to You for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, You hereby assume sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow You to distribute the Covered Code, it is Your responsibility to acquire that license before distributing the Covered Code.
+
+3. Your Grants. In consideration of, and as a condition to, the licenses granted to You under this License:
+
+(a) You hereby grant to Apple and all third parties a non-exclusive, royalty-free license, under Your Applicable Patent Rights and other intellectual property rights (other than patent) owned or controlled by You, to use, reproduce, display, perform, modify, distribute and Deploy Your Modifications of the same scope and extent as Apple`s licenses under Sections 2.1 and 2.2; and
+
+(b) You hereby grant to Apple and its subsidiaries a non-exclusive, worldwide, royalty-free, perpetual and irrevocable license, under Your Applicable Patent Rights and other intellectual property rights (other than patent) owned or controlled by You, to use, reproduce, display, perform, modify or have modified (for Apple and/or its subsidiaries), sublicense and distribute Your Modifications, in any form, through multiple tiers of distribution.
+
+4. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In each such instance, You must make sure the requirements of this License are fulfilled for the Covered Code or any portion thereof.
+
+5. Limitations on Patent License. Except as expressly stated in Section 2, no other patent rights, express or implied, are granted by Apple herein. Modifications and/or Larger Works may require additional patent licenses from Apple which Apple may grant in its sole discretion.
+
+6. Additional Terms. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with the scope of the license granted herein ("Additional Terms") to one or more recipients of Covered Code. However, You may do so only on Your own behalf and as Your sole responsibility, and not on behalf of Apple or any Contributor. You must obtain the recipient`s agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold Apple and every Contributor harmless for any liability incurred by or claims asserted against Apple or such Contributor by reason of any such Additional Terms.
+
+7. Versions of the License. Apple may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Once Original Code has been published under a particular version of this License, You may continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of this License published by Apple. No one other than Apple has the right to modify the terms applicable to Covered Code created under this License.
+
+8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part pre-release, untested, or not fully tested works. The Covered Code may contain errors that could cause failures or loss of data, and may be incomplete or contain inaccuracies. You expressly acknowledge and agree that use of the Covered Code, or any portion thereof, is at Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND APPLE`S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge that the Covered Code is not intended for use in the operation of nuclear facilities, aircraft navigation, communication systems, or air traffic control machines in which case the failure of the Covered Code could lead to death, personal injury, or severe physical or environmental damage.
+
+9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Apple`s total liability to You for all damages (other than as may be required by applicable law) under this License exceed the amount of fifty dollars ($50.00).
+
+10. Trademarks. This License does not grant any rights to use the trademarks or trade names "Apple", "Apple Computer", "Mac OS X", "Mac OS X Server", "QuickTime", "QuickTime Streaming Server" or any other trademarks or trade names belonging to Apple (collectively "Apple Marks") or to any trademark or trade name belonging to any Contributor. No Apple Marks may be used to endorse or promote products derived from the Original Code other than as permitted by and in strict compliance at all times with Apple`s third party trademark usage guidelines which are posted at http://www.apple.com/legal/guidelinesfor3rdparties.html.
+
+11. Ownership. Subject to the licenses granted under this License, each Contributor retains all rights, title and interest in and to any Modifications made by such Contributor. Apple retains all rights, title and interest in and to the Original Code and any Modifications made by or on behalf of Apple ("Apple Modifications"), and such Apple Modifications will not be automatically subject to this License. Apple may, at its sole discretion, choose to license such Apple Modifications under this License, or on different terms from those contained in this License or may choose not to license them at all.
+
+12. Termination.
+
+12.1 Termination. This License and the rights granted hereunder will terminate:
+
+(a) automatically without notice from Apple if You fail to comply with any term(s) of this License and fail to cure such breach within 30 days of becoming aware of such breach;
+
+(b) immediately in the event of the circumstances described in Section 13.5(b); or
+
+(c) automatically without notice from Apple if You, at any time during the term of this License, commence an action for patent infringement against Apple.
+
+12.2 Effect of Termination. Upon termination, You agree to immediately stop any further use, reproduction, modification, sublicensing and distribution of the Covered Code and to destroy all copies of the Covered Code that are in your possession or control. All sublicenses to the Covered Code which have been properly granted prior to termination shall survive any termination of this License. Provisions which, by their nature, should remain in effect beyond the termination of this License shall survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for compensation, indemnity or damages of any sort solely as a result of terminating this License in accordance with its terms, and termination of this License will be without prejudice to any other right or remedy of any party.
+
+13. Miscellaneous.
+
+13.1 Government End Users. The Covered Code is a "commercial item" as defined in FAR 2.101. Government software and technical data rights in the Covered Code include only those rights customarily provided to the public as defined in this License. This customary commercial license in technical data and software is provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software or Computer Software Documentation). Accordingly, all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+13.2 Relationship of Parties. This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between or amongYou, Apple or any Contributor, and You will not represent to the contrary, whether expressly, by implication, appearance or otherwise.
+
+13.3 Independent Development. Nothing in this License will impair Apple`s right to acquire, license, develop, have others develop for it, market and/or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Larger Works, technology or products that You may develop, produce, market or distribute.
+
+13.4 Waiver; Construction. Failure by Apple or any Contributor to enforce any provision of this License will not be deemed a waiver of future enforcement of that or any other provision. Any law or regulation which provides that the language of a contract shall be construed against the drafter will not apply to this License.
+
+13.5 Severability. (a) If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and effect. (b) Notwithstanding the foregoing, if applicable law prohibits or restricts You from fully and/or specifically complying with Sections 2 and/or 3 or prevents the enforceability of either of those Sections, this License will immediately terminate and You must immediately discontinue any use of the Covered Code and destroy all copies of it that are in your possession or control.
+
+13.6 Dispute Resolution. Any litigation or other dispute resolution between You and Apple relating to this License shall take place in the Northern District of California, and You and Apple hereby consent to the personal jurisdiction of, and venue in, the state and federal courts within that District with respect to this License. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.
+
+13.7 Entire Agreement; Governing Law. This License constitutes the entire agreement between the parties with respect to the subject matter hereof. This License shall be governed by the laws of the United States and the State of California, except that body of California law concerning conflicts of law.
+
+Where You are located in the province of Quebec, Canada, the following clause applies: The parties hereby confirm that they have requested that this License and all related documents be drafted in English. Les parties ont exig&#233; que le pr&#233;sent contrat et tous les documents connexes soient r&#233;dig&#233;s en anglais.
+
+EXHIBIT A.
+
+"Portions Copyright (c) 1999-2001 Apple Computer, Inc. All Rights Reserved.
+
+This file contains Original Code and/or Modifications of Original Code as defined in and that are subject to the Apple Public Source License Version 1.2 (the `License`). You may not use this file except in compliance with the License. Please obtain a copy of the License at http://www.apple.com/publicsource and read it before using this file.
+
+The Original Code and all software distributed under the License are distributed on an `AS IS` basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the specific language governing rights and limitations under the License."
+
diff --git a/meta/files/common-licenses/APSL-2.0 b/meta/files/common-licenses/APSL-2.0
new file mode 100644
index 0000000..d12e8b4
--- /dev/null
+++ b/meta/files/common-licenses/APSL-2.0
@@ -0,0 +1,102 @@
+
+APPLE PUBLIC SOURCE LICENSE
+Version 2.0 -  August 6, 2003
+
+Please read this License carefully before downloading this software.  By downloading or using this software, you are agreeing to be bound by the terms of this License.  If you do not or cannot agree to the terms of this License, please do not download or use the software.
+
+Apple Note:  In January 2007, Apple changed its corporate name from "Apple Computer, Inc." to "Apple Inc."  This change has been reflected below and copyright years updated, but no other changes have been made to the APSL 2.0.
+
+1. General; Definitions.  This License applies to any program or other work which Apple Inc. ("Apple") makes publicly available and which contains a notice placed by Apple identifying such program or work as "Original Code" and stating that it is subject to the terms of this Apple Public Source License version 2.0 ("License").  As used in this License:
+
+1.1  "Applicable Patent Rights" mean:  (a) in the case where Apple is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Apple and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.
+
+1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.
+
+1.3  "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.
+
+1.4 "Externally Deploy" means: (a) to sublicense, distribute or otherwise make Covered Code available, directly or indirectly, to anyone other than You; and/or (b) to use Covered Code, alone or as part of a Larger Work, in any way to provide a service, including but not limited to delivery of content, through electronic communication with a client other than You.
+
+1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+1.6 "Modifications" mean any addition to, deletion from, and/or change to, the substance and/or structure of the Original Code, any previous Modifications, the combination of Original Code and any previous Modifications, and/or any respective portions thereof.  When code is released as a series of files, a Modification is:  (a) any addition to or deletion from the contents of a file containing Covered Code; and/or (b) any new file or other representation of computer program statements that contains any part of Covered Code. 
+
+1.7 "Original Code" means (a) the Source Code of a program or other work as originally made available by Apple under this License, including the Source Code of any updates or upgrades to such programs or works made available by Apple under this License, and that has been expressly identified by Apple as such in the header file(s) of such work; and (b) the object code compiled from such Source Code and originally made available by Apple under this License
+
+1.8 "Source Code" means the human readable form of a program or other work that is suitable for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an executable (object code).
+
+1.9 "You" or "Your" means an individual or a legal entity exercising rights under this License.  For legal entities, "You" or "Your" includes any entity which controls, is controlled by, or is under common control with, You, where "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+2. Permitted Uses; Conditions &amp; Restrictions.   Subject to the terms and conditions of this License, Apple hereby grants You, effective on the date You accept this License and download the Original Code, a world-wide, royalty-free, non-exclusive license, to the extent of Apple`s Applicable Patent Rights and copyrights covering the Original Code, to do the following:
+
+2.1 Unmodified Code.  You may use, reproduce, display, perform, internally distribute within Your organization, and Externally Deploy verbatim, unmodified copies of the Original Code, for commercial or non-commercial purposes, provided that in each instance:
+
+(a) You must retain and reproduce in all copies of Original Code the copyright and other proprietary notices and disclaimers of Apple as they appear in the Original Code, and keep intact all notices in the Original Code that refer to this License; and
+
+(b)  You must include a copy of this License with every copy of Source Code of Covered Code and documentation You distribute or Externally Deploy, and You may not offer or impose any terms on such Source Code that alter or restrict this License or the recipients` rights hereunder, except as permitted under Section 6.
+
+2.2 Modified Code.  You may modify Covered Code and use, reproduce, display, perform, internally distribute within Your organization, and Externally Deploy Your Modifications and Covered Code, for commercial or non-commercial purposes, provided that in each instance You also meet all of these conditions:
+
+(a) You must satisfy all the conditions of Section 2.1 with respect to the Source Code of the Covered Code; 
+
+(b) You must duplicate, to the extent it does not already exist, the notice in Exhibit A in each file of the Source Code of all Your Modifications, and cause the modified files to carry prominent notices stating that You changed the files and the date of any change; and
+
+(c) If You Externally Deploy Your Modifications, You must make Source Code of all Your Externally Deployed Modifications either available to those to whom You have Externally Deployed Your Modifications, or publicly available.  Source Code of Your Externally Deployed Modifications must be released under the terms set forth in this License, including the license grants set forth in Section 3 below, for as long as you Externally Deploy the Covered Code or twelve (12) months from the date of initial External Deployment, whichever is longer. You should preferably distribute the Source Code of Your Externally Deployed Modifications electronically (e.g. download from a web site).
+
+2.3 Distribution of Executable Versions.  In addition, if You Externally Deploy Covered Code (Original Code and/or Modifications) in object code, executable form only, You must include a prominent notice, in the code itself as well as in related documentation, stating that Source Code of the Covered Code is available under the terms of this License with information on how and where to obtain such Source Code.  
+
+2.4 Third Party Rights.  You expressly acknowledge and agree that although Apple and each Contributor grants the licenses to their respective portions of the Covered Code set forth herein, no assurances are provided by Apple or any Contributor that the Covered Code does not infringe the patent or other intellectual property rights of any other entity. Apple and each Contributor disclaim any liability to You for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, You hereby assume sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow You to distribute the Covered Code, it is Your responsibility to acquire that license before distributing the Covered Code.
+
+3. Your Grants.  In consideration of, and as a condition to, the licenses granted to You under this License, You hereby grant to any person or entity receiving or distributing Covered Code under this License a non-exclusive, royalty-free, perpetual, irrevocable license, under Your Applicable Patent Rights and other intellectual property rights (other than patent) owned or controlled by You, to use, reproduce, display, perform, modify, sublicense, distribute and Externally Deploy Your Modifications of the same scope and extent as Apple`s licenses under Sections 2.1 and 2.2 above.  
+
+4. Larger Works.  You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product.  In each such instance, You must make sure the requirements of this License are fulfilled for the Covered Code or any portion thereof. 
+
+5. Limitations on Patent License.   Except as expressly stated in Section 2, no other patent rights, express or implied, are granted by Apple herein.  Modifications and/or Larger Works may require additional patent licenses from Apple which Apple may grant in its sole discretion.  
+
+6. Additional Terms.  You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with the scope of the license granted herein ("Additional Terms") to one or more recipients of Covered Code. However, You may do so only on Your own behalf and as Your sole responsibility, and not on behalf of Apple or any Contributor. You must obtain the recipient`s agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold Apple and every Contributor harmless for any liability incurred by or claims asserted against Apple or such Contributor by reason of any such Additional Terms. 
+
+7. Versions of the License.  Apple may publish revised and/or new versions of this License from time to time.  Each version will be given a distinguishing version number.  Once Original Code has been published under a particular version of this License, You may continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of this License published by Apple.  No one other than Apple has the right to modify the terms applicable to Covered Code created under this License.  
+
+8. NO WARRANTY OR SUPPORT.  The Covered Code may contain in whole or in part pre-release, untested, or not fully tested works.  The Covered Code may contain errors that could cause failures or loss of data, and may be incomplete or contain inaccuracies.  You expressly acknowledge and agree that use of the Covered Code, or any portion thereof, is at Your sole and entire risk.  THE COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND APPLE`S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.  APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED.  NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY.  You acknowledge that the Covered Code is not intended for use in the operation of nuclear facilities, aircraft navigation, communication systems, or air traffic control machines in which case the failure of the Covered Code could lead to death, personal injury, or severe physical or environmental damage.
+
+9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Apple`s total liability to You for all damages (other than as may be required by applicable law) under this License exceed the amount of fifty dollars ($50.00).
+
+10. Trademarks.  This License does not grant any rights to use the trademarks or trade names  "Apple", "Mac", "Mac OS", "QuickTime", "QuickTime Streaming Server" or any other trademarks, service marks, logos or trade names belonging to Apple (collectively "Apple Marks") or to any trademark, service mark, logo or trade name belonging to any Contributor.  You agree not to use any Apple Marks in or as part of the name of products derived from the Original Code or to endorse or promote products derived from the Original Code other than as expressly permitted by and in strict compliance at all times with Apple`s third party trademark usage guidelines which are posted at http://www.apple.com/legal/guidelinesfor3rdparties.html.  
+
+11. Ownership. Subject to the licenses granted under this License, each Contributor retains all rights, title and interest in and to any Modifications made by such Contributor.  Apple retains all rights, title and interest in and to the Original Code and any Modifications made by or on behalf of Apple ("Apple Modifications"), and such Apple Modifications will not be automatically subject to this License.  Apple may, at its sole discretion, choose to license such Apple Modifications under this License, or on different terms from those contained in this License or may choose not to license them at all.  
+
+12. Termination.  
+
+12.1 Termination.  This License and the rights granted hereunder will terminate:
+
+(a) automatically without notice from Apple if You fail to comply with any term(s) of this License and fail to cure such breach within 30 days of becoming aware of such breach;
+(b) immediately in the event of the circumstances described in Section 13.5(b); or
+(c) automatically without notice from Apple if You, at any time during the term of this License, commence an action for patent infringement against Apple; provided that Apple did not first commence an action for patent infringement against You in that instance.
+
+12.2 Effect of Termination.  Upon termination, You agree to immediately stop any further use, reproduction, modification, sublicensing and distribution of the Covered Code.  All sublicenses to the Covered Code which have been properly granted prior to termination shall survive any termination of this License.  Provisions which, by their nature, should remain in effect beyond the termination of this License shall survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, 12.2 and 13.  No party will be liable to any other for compensation, indemnity or damages of any sort solely as a result of terminating this License in accordance with its terms, and termination of this License will be without prejudice to any other right or remedy of any party.
+
+13.  Miscellaneous.
+
+13.1 Government End Users.   The Covered Code is a "commercial item" as defined in FAR 2.101.  Government software and technical data rights in the Covered Code include only those rights customarily provided to the public as defined in this License. This customary commercial license in technical data and software is provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software or Computer Software Documentation).  Accordingly, all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+13.2 Relationship of Parties.  This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between or among You, Apple or any Contributor, and You will not represent to the contrary, whether expressly, by implication, appearance or otherwise.
+
+13.3 Independent Development.   Nothing in this License will impair Apple`s right to acquire, license, develop, have others develop for it, market and/or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Larger Works, technology or products that You may develop, produce, market or distribute.
+
+13.4 Waiver; Construction.  Failure by Apple or any Contributor to enforce any provision of this License will not be deemed a waiver of future enforcement of that or any other provision.  Any law or regulation which provides that the language of a contract shall be construed against the drafter will not apply to this License.
+
+13.5 Severability.  (a) If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and effect.  (b) Notwithstanding the foregoing, if applicable law prohibits or restricts You from fully and/or specifically complying with Sections 2 and/or 3 or prevents the enforceability of either of those Sections, this License will immediately terminate and You must immediately discontinue any use of the Covered Code and destroy all copies of it that are in your possession or control.
+
+13.6 Dispute Resolution.  Any litigation or other dispute resolution between You and Apple relating to this License shall take place in the Northern District of California, and You and Apple hereby consent to the personal jurisdiction of, and venue in, the state and federal courts within that District with respect to this License. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.
+
+13.7 Entire Agreement; Governing Law.  This License constitutes the entire agreement between the parties with respect to the subject matter hereof.  This License shall be governed by the laws of the United States and the State of California, except that body of California law concerning conflicts of law. 
+
+Where You are located in the province of Quebec, Canada, the following clause applies:  The parties hereby confirm that they have requested that this License and all related documents be drafted in English.  Les parties ont exig&#233; que le pr&#233;sent contrat et tous les documents connexes soient r&#233;dig&#233;s en anglais.
+
+EXHIBIT A. 
+
+"Portions Copyright (c) 1999-2007 Apple Inc.  All Rights Reserved.
+
+This file contains Original Code and/or Modifications of Original Code as defined in and that are subject to the Apple Public Source License Version 2.0 (the `License`).  You may not use this file except in compliance with the License.  Please obtain a copy of the License at http://www.opensource.apple.com/apsl/ and read it before using this file.
+
+The Original Code and all software distributed under the License are distributed on an `AS IS` basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.  Please see the License for the specific language governing rights and limitations under the License." 
+
diff --git a/meta/files/common-licenses/Adobe b/meta/files/common-licenses/Adobe
new file mode 100644
index 0000000..64779da
--- /dev/null
+++ b/meta/files/common-licenses/Adobe
@@ -0,0 +1,14 @@
+Copyright 1990-1998 Adobe Systems Incorporated.
+All Rights Reserved.
+  
+Patents Pending
+
+NOTICE: All information contained herein is the property of Adobe
+Systems Incorporated.
+
+Permission is granted for redistribution of this file provided
+this copyright notice is maintained intact and that the contents
+of this file are not altered in any way from its original form.
+
+PostScript and Display PostScript are trademarks of Adobe Systems
+Incorporated which may be registered in certain jurisdictions.
diff --git a/meta/files/common-licenses/Apache-1.0 b/meta/files/common-licenses/Apache-1.0
new file mode 100644
index 0000000..26e9089
--- /dev/null
+++ b/meta/files/common-licenses/Apache-1.0
@@ -0,0 +1,61 @@
+
+/* ====================================================================
+ * Copyright (c) 1995-1999 The Apache Group.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ *    software must display the following acknowledgment:
+ *    "This product includes software developed by the Apache Group
+ *    for use in the Apache HTTP server project (http://www.apache.org/)."
+ *
+ * 4. The names "Apache Server" and "Apache Group" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For written permission, please contact
+ *    apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache"
+ *    nor may "Apache" appear in their names without prior written
+ *    permission of the Apache Group.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by the Apache Group
+ *    for use in the Apache HTTP server project (http://www.apache.org/)."
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS`` AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Group and was originally based
+ * on public domain software written at the National Center for
+ * Supercomputing Applications, University of Illinois, Urbana-Champaign.
+ * For more information on the Apache Group and the Apache HTTP server
+ * project, please see <http://www.apache.org/>.
+ *
+ */
+
+
+
+
diff --git a/meta/files/common-licenses/Apache-1.1 b/meta/files/common-licenses/Apache-1.1
new file mode 100644
index 0000000..c25ec00
--- /dev/null
+++ b/meta/files/common-licenses/Apache-1.1
@@ -0,0 +1,60 @@
+
+/* ====================================================================
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2000 The Apache Software Foundation.  All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ *    if any, must include the following acknowledgment:
+ *       "This product includes software developed by the
+ *        Apache Software Foundation (http://www.apache.org/)."
+ *    Alternately, this acknowledgment may appear in the software itself,
+ *    if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Apache" and "Apache Software Foundation" must
+ *    not be used to endorse or promote products derived from this
+ *    software without prior written permission. For written
+ *    permission, please contact apache@apache.org.
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ *    nor may "Apache" appear in their name, without prior written
+ *    permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS`` AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ * Portions of this software are based upon public domain software
+ * originally written at the National Center for Supercomputing Applications,
+ * University of Illinois, Urbana-Champaign.
+ */
+
+
diff --git a/meta/files/common-licenses/Apache-2.0 b/meta/files/common-licenses/Apache-2.0
new file mode 100644
index 0000000..b3201ab
--- /dev/null
+++ b/meta/files/common-licenses/Apache-2.0
@@ -0,0 +1,204 @@
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don`t include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
diff --git a/meta/files/common-licenses/Artistic-1.0 b/meta/files/common-licenses/Artistic-1.0
new file mode 100644
index 0000000..807e4d2
--- /dev/null
+++ b/meta/files/common-licenses/Artistic-1.0
@@ -0,0 +1,50 @@
+
+The Artistic License
+Preamble
+
+The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications.
+
+Definitions:
+
+"Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification.
+"Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder.
+"Copyright Holder" is whoever is named in the copyright or copyrights for the package.
+"You" is you, if you`re thinking about copying or distributing this Package.
+"Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.)
+"Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it.
+1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following:
+
+a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package.
+
+b) use the modified Package only within your corporation or organization.
+
+c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version.
+
+d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following:
+
+a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version.
+
+b) accompany the distribution with the machine-readable source of the Package with your modifications.
+
+c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version.
+
+d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own.
+
+6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package.
+
+7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package.
+
+8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission.
+
+9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
+
diff --git a/meta/files/common-licenses/Artistic-2.0 b/meta/files/common-licenses/Artistic-2.0
new file mode 100644
index 0000000..c0f8d19
--- /dev/null
+++ b/meta/files/common-licenses/Artistic-2.0
@@ -0,0 +1,203 @@
+
+         The Artistic License 2.0
+
+     Copyright (c) 2000-2006, The Perl Foundation.
+
+     Everyone is permitted to copy and distribute verbatim copies
+      of this license document, but changing it is not allowed.
+
+Preamble
+
+This license establishes the terms under which a given free software
+Package may be copied, modified, distributed, and/or redistributed.
+The intent is that the Copyright Holder maintains some artistic
+control over the development of that Package while still keeping the
+Package available as open source and free software.
+
+You are always permitted to make arrangements wholly outside of this
+license directly with the Copyright Holder of a given Package.  If the
+terms of this license do not permit the full use that you propose to
+make of the Package, you should contact the Copyright Holder and seek
+a different licensing arrangement. 
+
+Definitions
+
+    "Copyright Holder" means the individual(s) or organization(s)
+    named in the copyright notice for the entire Package.
+
+    "Contributor" means any party that has contributed code or other
+    material to the Package, in accordance with the Copyright Holder`s
+    procedures.
+
+    "You" and "your" means any person who would like to copy,
+    distribute, or modify the Package.
+
+    "Package" means the collection of files distributed by the
+    Copyright Holder, and derivatives of that collection and/or of
+    those files. A given Package may consist of either the Standard
+    Version, or a Modified Version.
+
+    "Distribute" means providing a copy of the Package or making it
+    accessible to anyone else, or in the case of a company or
+    organization, to others outside of your company or organization.
+
+    "Distributor Fee" means any fee that you charge for Distributing
+    this Package or providing support for this Package to another
+    party.  It does not mean licensing fees.
+
+    "Standard Version" refers to the Package if it has not been
+    modified, or has been modified only in ways explicitly requested
+    by the Copyright Holder.
+
+    "Modified Version" means the Package, if it has been changed, and
+    such changes were not explicitly requested by the Copyright
+    Holder. 
+
+    "Original License" means this Artistic License as Distributed with
+    the Standard Version of the Package, in its current version or as
+    it may be modified by The Perl Foundation in the future.
+
+    "Source" form means the source code, documentation source, and
+    configuration files for the Package.
+
+    "Compiled" form means the compiled bytecode, object code, binary,
+    or any other form resulting from mechanical transformation or
+    translation of the Source form.
+
+
+Permission for Use and Modification Without Distribution
+
+(1)  You are permitted to use the Standard Version and create and use
+Modified Versions for any purpose without restriction, provided that
+you do not Distribute the Modified Version.
+
+
+Permissions for Redistribution of the Standard Version
+
+(2)  You may Distribute verbatim copies of the Source form of the
+Standard Version of this Package in any medium without restriction,
+either gratis or for a Distributor Fee, provided that you duplicate
+all of the original copyright notices and associated disclaimers.  At
+your discretion, such verbatim copies may or may not include a
+Compiled form of the Package.
+
+(3)  You may apply any bug fixes, portability changes, and other
+modifications made available from the Copyright Holder.  The resulting
+Package will still be considered the Standard Version, and as such
+will be subject to the Original License.
+
+
+Distribution of Modified Versions of the Package as Source 
+
+(4)  You may Distribute your Modified Version as Source (either gratis
+or for a Distributor Fee, and with or without a Compiled form of the
+Modified Version) provided that you clearly document how it differs
+from the Standard Version, including, but not limited to, documenting
+any non-standard features, executables, or modules, and provided that
+you do at least ONE of the following:
+
+    (a)  make the Modified Version available to the Copyright Holder
+    of the Standard Version, under the Original License, so that the
+    Copyright Holder may include your modifications in the Standard
+    Version.
+
+    (b)  ensure that installation of your Modified Version does not
+    prevent the user installing or running the Standard Version. In
+    addition, the Modified Version must bear a name that is different
+    from the name of the Standard Version.
+
+    (c)  allow anyone who receives a copy of the Modified Version to
+    make the Source form of the Modified Version available to others
+    under
+  
+ (i)  the Original License or
+
+ (ii)  a license that permits the licensee to freely copy,
+ modify and redistribute the Modified Version using the same
+ licensing terms that apply to the copy that the licensee
+ received, and requires that the Source form of the Modified
+ Version, and of any works derived from it, be made freely
+ available in that license fees are prohibited but Distributor
+ Fees are allowed.
+
+
+Distribution of Compiled Forms of the Standard Version 
+or Modified Versions without the Source
+
+(5)  You may Distribute Compiled forms of the Standard Version without
+the Source, provided that you include complete instructions on how to
+get the Source of the Standard Version.  Such instructions must be
+valid at the time of your distribution.  If these instructions, at any
+time while you are carrying out such distribution, become invalid, you
+must provide new instructions on demand or cease further distribution.
+If you provide valid instructions or cease distribution within thirty
+days after you become aware that the instructions are invalid, then
+you do not forfeit any of your rights under this license.
+
+(6)  You may Distribute a Modified Version in Compiled form without
+the Source, provided that you comply with Section 4 with respect to
+the Source of the Modified Version.
+
+
+Aggregating or Linking the Package 
+
+(7)  You may aggregate the Package (either the Standard Version or
+Modified Version) with other packages and Distribute the resulting
+aggregation provided that you do not charge a licensing fee for the
+Package.  Distributor Fees are permitted, and licensing fees for other
+components in the aggregation are permitted. The terms of this license
+apply to the use and Distribution of the Standard or Modified Versions
+as included in the aggregation.
+
+(8) You are permitted to link Modified and Standard Versions with
+other works, to embed the Package in a larger work of your own, or to
+build stand-alone binary or bytecode versions of applications that
+include the Package, and Distribute the result without restriction,
+provided the result does not expose a direct interface to the Package.
+
+
+Items That are Not Considered Part of a Modified Version 
+
+(9) Works (including, but not limited to, modules and scripts) that
+merely extend or make use of the Package, do not, by themselves, cause
+the Package to be a Modified Version.  In addition, such works are not
+considered parts of the Package itself, and are not subject to the
+terms of this license.
+
+
+General Provisions
+
+(10)  Any use, modification, and distribution of the Standard or
+Modified Versions is governed by this Artistic License. By using,
+modifying or distributing the Package, you accept this license. Do not
+use, modify, or distribute the Package, if you do not accept this
+license.
+
+(11)  If your Modified Version has been derived from a Modified
+Version made by someone other than you, you are nevertheless required
+to ensure that your Modified Version complies with the requirements of
+this license.
+
+(12)  This license does not grant you the right to use any trademark,
+service mark, tradename, or logo of the Copyright Holder.
+
+(13)  This license includes the non-exclusive, worldwide,
+free-of-charge patent license to make, have made, use, offer to sell,
+sell, import and otherwise transfer the Package with respect to any
+patent claims licensable by the Copyright Holder that are necessarily
+infringed by the Package. If you institute patent litigation
+(including a cross-claim or counterclaim) against any party alleging
+that the Package constitutes direct or contributory patent
+infringement, then this Artistic License to you shall terminate on the
+date that such litigation is filed.
+
+(14)  Disclaimer of Warranty:
+THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
+IS` AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
+LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/meta/files/common-licenses/BSD b/meta/files/common-licenses/BSD
new file mode 100644
index 0000000..c7a0aa4
--- /dev/null
+++ b/meta/files/common-licenses/BSD
@@ -0,0 +1,26 @@
+Copyright (c) The Regents of the University of California.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the University nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/meta/files/common-licenses/BSD-0-Clause b/meta/files/common-licenses/BSD-0-Clause
new file mode 100644
index 0000000..328bdd6
--- /dev/null
+++ b/meta/files/common-licenses/BSD-0-Clause
@@ -0,0 +1,12 @@
+Copyright (C) <YEAR> by <OWNER>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/meta/files/common-licenses/BSD-2-Clause b/meta/files/common-licenses/BSD-2-Clause
new file mode 100644
index 0000000..ade0f34
--- /dev/null
+++ b/meta/files/common-licenses/BSD-2-Clause
@@ -0,0 +1,13 @@
+
+The FreeBSD Copyright
+
+Copyright 1992-2010 The FreeBSD Project. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+THIS SOFTWARE IS PROVIDED BY THE FREEBSD PROJECT ``AS IS`` AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.
+
diff --git a/meta/files/common-licenses/BSD-3-Clause b/meta/files/common-licenses/BSD-3-Clause
new file mode 100644
index 0000000..d13865e
--- /dev/null
+++ b/meta/files/common-licenses/BSD-3-Clause
@@ -0,0 +1,11 @@
+
+Copyright (c) <YEAR>, <OWNER>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/meta/files/common-licenses/BSD-4-Clause b/meta/files/common-licenses/BSD-4-Clause
new file mode 100644
index 0000000..7b162de
--- /dev/null
+++ b/meta/files/common-licenses/BSD-4-Clause
@@ -0,0 +1,29 @@
+
+Copyright (c) <year>, <copyright holder>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. All advertising materials mentioning features or use of this software
+   must display the following acknowledgement:
+   This product includes software developed by the <organization>.
+4. Neither the name of the <organization> nor the
+   names of its contributors may be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS`` AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/meta/files/common-licenses/BSL-1.0 b/meta/files/common-licenses/BSL-1.0
new file mode 100644
index 0000000..8ea8eae
--- /dev/null
+++ b/meta/files/common-licenses/BSL-1.0
@@ -0,0 +1,25 @@
+
+Boost Software License - Version 1.0 - August 17th, 2003
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
diff --git a/meta/files/common-licenses/BitstreamVera b/meta/files/common-licenses/BitstreamVera
new file mode 100644
index 0000000..e6f03aa
--- /dev/null
+++ b/meta/files/common-licenses/BitstreamVera
@@ -0,0 +1,160 @@
+Bitstream Vera Fonts Copyright
+
+The fonts have a generous copyright, allowing derivative works (as
+long as "Bitstream" or "Vera" are not in the names), and full
+redistribution (so long as they are not *sold* by themselves). They
+can be be bundled, redistributed and sold with any software.
+
+The fonts are distributed under the following copyright:
+
+Copyright
+=========
+
+Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
+Vera is a trademark of Bitstream, Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the fonts accompanying this license ("Fonts") and associated
+documentation files (the "Font Software"), to reproduce and distribute
+the Font Software, including without limitation the rights to use,
+copy, merge, publish, distribute, and/or sell copies of the Font
+Software, and to permit persons to whom the Font Software is furnished
+to do so, subject to the following conditions:
+
+The above copyright and trademark notices and this permission notice
+shall be included in all copies of one or more of the Font Software
+typefaces.
+
+The Font Software may be modified, altered, or added to, and in
+particular the designs of glyphs or characters in the Fonts may be
+modified and additional glyphs or characters may be added to the
+Fonts, only if the fonts are renamed to names not containing either
+the words "Bitstream" or the word "Vera".
+
+This License becomes null and void to the extent applicable to Fonts
+or Font Software that has been modified and is distributed under the
+"Bitstream Vera" names.
+
+The Font Software may be sold as part of a larger software package but
+no copy of one or more of the Font Software typefaces may be sold by
+itself.
+
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
+BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
+SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
+
+Except as contained in this notice, the names of Gnome, the Gnome
+Foundation, and Bitstream Inc., shall not be used in advertising or
+otherwise to promote the sale, use or other dealings in this Font
+Software without prior written authorization from the Gnome Foundation
+or Bitstream Inc., respectively. For further information, contact:
+fonts at gnome dot org.
+
+Copyright FAQ
+=============
+
+1. I don't understand the resale restriction... What gives?
+
+Bitstream is giving away these fonts, but wishes to ensure its
+competitors can't just drop the fonts as is into a font sale system
+and sell them as is. It seems fair that if Bitstream can't make money
+from the Bitstream Vera fonts, their competitors should not be able to
+do so either. You can sell the fonts as part of any software package,
+however.
+
+2. I want to package these fonts separately for distribution and
+sale as part of a larger software package or system. Can I do so?
+
+Yes. A RPM or Debian package is a "larger software package" to begin
+with, and you aren't selling them independently by themselves.
+See 1. above.
+
+3. Are derivative works allowed?
+Yes!
+
+4. Can I change or add to the font(s)?
+Yes, but you must change the name(s) of the font(s).
+
+5. Under what terms are derivative works allowed?
+
+You must change the name(s) of the fonts. This is to ensure the
+quality of the fonts, both to protect Bitstream and Gnome. We want to
+ensure that if an application has opened a font specifically of these
+names, it gets what it expects (though of course, using fontconfig,
+substitutions could still could have occurred during font
+opening). You must include the Bitstream copyright. Additional
+copyrights can be added, as per copyright law. Happy Font Hacking!
+
+6. If I have improvements for Bitstream Vera, is it possible they might get
+adopted in future versions?
+
+Yes. The contract between the Gnome Foundation and Bitstream has
+provisions for working with Bitstream to ensure quality additions to
+the Bitstream Vera font family. Please contact us if you have such
+additions. Note, that in general, we will want such additions for the
+entire family, not just a single font, and that you'll have to keep
+both Gnome and Jim Lyles, Vera's designer, happy! To make sense to add
+glyphs to the font, they must be stylistically in keeping with Vera's
+design. Vera cannot become a "ransom note" font. Jim Lyles will be
+providing a document describing the design elements used in Vera, as a
+guide and aid for people interested in contributing to Vera.
+
+7. I want to sell a software package that uses these fonts: Can I do so?
+
+Sure. Bundle the fonts with your software and sell your software
+with the fonts. That is the intent of the copyright.
+
+8. If applications have built the names "Bitstream Vera" into them,
+can I override this somehow to use fonts of my choosing?
+
+This depends on exact details of the software. Most open source
+systems and software (e.g., Gnome, KDE, etc.) are now converting to
+use fontconfig (see www.fontconfig.org) to handle font configuration,
+selection and substitution; it has provisions for overriding font
+names and subsituting alternatives. An example is provided by the
+supplied local.conf file, which chooses the family Bitstream Vera for
+"sans", "serif" and "monospace". Other software (e.g., the XFree86
+core server) has other mechanisms for font substitution.
+
+Show details Hide details
+
+Change log
+r2011 by mark.nickel on Mar 3, 2011   Diff
+
+Majority of Multi-Line text editing is in
+the commit.  Also added some specific free
+fonts to replace the existing set as we
+need some additional font metrics that we
+use in the Text Editing rendering
+pipeline.
+
+You can see the font licenses in the
+editor/fonts folder under each font.
+
+Still have some cleanup to do to add the
+text formatting (left,right,center) as
+...
+
+Go to: 	
+Hide comments
+Show comments
+
+Older revisions
+All revisions of this file
+
+File info
+Size: 5953 bytes, 123 lines
+View raw file
+
+File properties
+
+svn:executable
+    *
+
+
diff --git a/meta/files/common-licenses/CATOSL-1.1 b/meta/files/common-licenses/CATOSL-1.1
new file mode 100644
index 0000000..63e8a56
--- /dev/null
+++ b/meta/files/common-licenses/CATOSL-1.1
@@ -0,0 +1,116 @@
+
+Computer Associates Trusted Open Source License
+Version 1.1
+
+
+(text)
+
+PLEASE READ THIS DOCUMENT CAREFULLY AND IN ITS ENTIRETY. THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMPUTER ASSOCIATES TRUSTED OPEN SOURCE LICENSE ("LICENSE"). ANY USE, REPRODUCTION, MODIFICATION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES THE RECIPIENT`S ACCEPTANCE OF THIS LICENSE.
+
+License Background
+Computer Associates International, Inc. (CA) believes in open source. We believe that the open source development approach can take appropriate software programs to unprecedented levels of quality, growth, and innovation. To demonstrate our continuing commitment to open source, we are releasing the Program (as defined below) under this License.
+
+This License is intended to permit contributors and recipients of the Program to use the Program, including its source code, freely and without many of the concerns of some other open source licenses. Although we expect the underlying Program, and Contributions (as defined below) made to such Program, to remain open, this License is designed to permit you to maintain your own software programs free of this License unless you choose to do so. Thus, only your Contributions to the Program must be distributed under the terms of this License.
+
+The provisions that follow set forth the terms and conditions under which you may use the Program.
+
+1. DEFINITIONS
+
+1.1 Contribution means (a) in the case of CA, the Original Program; and (b) in the case of each Contributor (including CA), changes and additions to the Program, where such changes and/or additions to the Program originate from and are distributed by that particular Contributor to unaffiliated third parties. A Contribution originates from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributors behalf. Contributions do not include additions to the Program which: (x) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (y) are not derivative works of the Program.
+
+1.2 Contributor means CA and any other person or entity that distributes the Program.
+
+1.3 Contributor Version means as to a Contributor, that version of the Program that includes the Contributors Contribution but not any Contributions made to the Program thereafter.
+
+1.4 Larger Work means a work that combines the Program or portions thereof with code not governed by the terms of this License.
+
+1.5 Licensed Patents mean patents licensable by a Contributor that are infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+1.6 Original Program means the original version of the software to which this License is attached and as released by CA, including source code, object code and documentation, if any.
+
+1.7 Program means the Original Program and Contributions.
+
+1.8 Recipient means anyone who modifies, copies, uses or distributes the Program.
+
+2. GRANT OF RIGHTS
+
+2.1 Subject to the terms of this License, each Contributor hereby grants Recipient an irrevocable, non-exclusive, worldwide, royalty-free license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form. For the avoidance of doubt, the license provided in this Section 2.1 shall not include a license to any Licensed Patents of a Contributor.
+
+2.2 Subject to the terms of this License, each Contributor hereby grants Recipient an irrevocable, non-exclusive, worldwide, royalty-free license to the Licensed Patents to the extent necessary to make, use, sell, offer to sell and import the Contribution of such Contributor, if any, in source code and object code form. The license granted in this Section 2.2 shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes the Licensed Patents to be infringed by such combination. Notwithstanding the foregoing, no license is granted under this Section 2.2: (a) for any code or works that do not include the Contributor Version, as it exists and is used in accordance with the terms hereof; (b) for infringements caused by: (i) third party modifications of the Contributor Version; or (ii) the combination of Contributions made by each such Contributor with other software (except as part of the Contributor Version) or other devices; or (c) with respect to Licensed Patents infringed by the Program in the absence of Contributions made by that Contributor.
+
+2.3 Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, except as provided in Section 2.4, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other person or entity. Each Contributor disclaims any liability to Recipient for claims brought by any other person or entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any.
+
+2.4 Each Contributor represents and warrants that it has all right, title and interest in the copyrights in its Contributions, and has the right to grant the copyright licenses set forth in this License.
+
+3. DISTRIBUTION REQUIREMENTS
+
+3.1 If the Program is distributed in object code form, then a prominent notice must be included in the code itself as well as in any related documentation, stating that the source code for the Program is available from the Contributor with information on how and where to obtain the source code. A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+it complies with the terms and conditions of this License; and
+its license agreement:
+effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose, to the maximum extent permitted by applicable law;
+effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits, to the maximum extent permitted by applicable law;
+states that any provisions which are inconsistent with this License are offered by that Contributor alone and not by any other party; and
+states that source code for the Program is available from such Contributor at the cost of distribution, and informs licensees how to obtain it in a reasonable manner.
+3.2 When the Program is made available in source code form:
+
+it must be made available under this License; and
+a copy of this License must be included with each copy of the Program.
+3.3 This License is intended to facilitate the commercial distribution of the Program by any Contributor. However, Contributors may only charge Recipients a one-time, upfront fee for the distribution of the Program. Contributors may not charge Recipients any recurring charge, license fee, or any ongoing royalty for the Recipients exercise of its rights under this License to the Program. Contributors shall make the source code for the Contributor Version they distribute available at a cost, if any, equal to the cost to the Contributor to physically copy and distribute the work. It is not the intent of this License to prohibit a Contributor from charging fees for any service or maintenance that a Contributor may charge to a Recipient, so long as such fees are not an attempt to circumvent the foregoing restrictions on charging royalties or other recurring fees for the Program itself.
+
+3.4 A Contributor may create a Larger Work by combining the Program with other software code not governed by the terms of this License, and distribute the Larger Work as a single product. In such a case, the Contributor must make sure that the requirements of this License are fulfilled for the Program. Any Contributor who includes the Program in a commercial product offering, including as part of a Larger Work, may subject itself, but not any other Contributor, to additional contractual commitments, including, but not limited to, performance warranties and non-infringement representations on suchContributors behalf. No Contributor may create any additional liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (Commercial Contributor) hereby agrees to defend and indemnify every other Contributor (Indemnified Contributor) who made Contributions to the Program distributed by the Commercial Contributor against any losses, damages and costs (collectively Losses) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions, including any additional contractual commitments, of such Commercial Contributor in connection with its distribution of the Program. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement.
+
+3.5 If Contributor has knowledge that a license under a third partys intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must (a) include a text file with the Program source code distribution titled ../IP_ISSUES, and (b) notify CA in writing at Computer Associates International, Inc., One Computer Associates Plaza, Islandia, New York 11749, Attn: Open Source Group or by email at opensource@ca.com, both describing the claim and the party making the claim in sufficient detail that a Recipient and CA will know whom to contact with regard to such matter. If Contributor obtains such knowledge after the Contribution is made available, Contributor shall also promptly modify the IP_ISSUES file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Program that such new knowledge has been obtained.
+
+3.6 Recipient shall not remove, obscure, or modify any CA or other Contributor copyright or patent proprietary notices appearing in the Program, whether in the source code, object code or in any documentation. In addition to the obligations set forth in Section 4, each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. CONTRIBUTION RESTRICTIONS
+
+4.1 Each Contributor must cause the Program to which the Contributor provides a Contribution to contain a file documenting the changes the Contributor made to create its version of the Program and the date of any change. Each Contributor must also include a prominent statement that the Contribution is derived, directly or indirectly, from the Program distributed by a prior Contributor, including the name of the prior Contributor from which such Contribution was derived, in (a) the Program source code, and (b) in any notice in an executable version or related documentation in which the Contributor describes the origin or ownership of the Program.
+
+5. NO WARRANTY
+
+5.1 EXCEPT AS EXPRESSLY SET FORTH IN THIS LICENSE, THE PROGRAM IS PROVIDED AS IS AND IN ITS PRESENT STATE AND CONDITION. NO WARRANTY, REPRESENTATION, CONDITION, UNDERTAKING OR TERM, EXPRESS OR IMPLIED, STATUTORY OR OTHERWISE, AS TO THE CONDITION, QUALITY, DURABILITY, PERFORMANCE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE OR USE OF THE PROGRAM IS GIVEN OR ASSUMED BY ANY CONTRIBUTOR AND ALL SUCH WARRANTIES, REPRESENTATIONS, CONDITIONS, UNDERTAKINGS AND TERMS ARE HEREBY EXCLUDED TO THE FULLEST EXTENT PERMITTED BY LAW.
+
+5.2 Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this License, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+5.3 Each Recipient acknowledges that the Program is not intended for use in the operation of nuclear facilities, aircraft navigation, communication systems, or air traffic control machines in which case the failure of the Program could lead to death, personal injury, or severe physical or environmental damage.
+
+6. DISCLAIMER OF LIABILITY
+
+6.1 EXCEPT AS EXPRESSLY SET FORTH IN THIS LICENSE, AND TO THE EXTENT PERMITTED BY LAW, NO CONTRIBUTOR SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. TRADEMARKS AND BRANDING
+
+7.1 This License does not grant any Recipient or any third party any rights to use the trademarks or trade names now or subsequently posted at http://www.ca.com/catrdmrk.htm, or any other trademarks, service marks, logos or trade names belonging to CA (collectively CA Marks) or to any trademark, service mark, logo or trade name belonging to any Contributor. Recipient agrees not to use any CA Marks in or as part of the name of products derived from the Original Program or to endorse or promote products derived from the Original Program.
+
+7.2 Subject to Section 7.1, Recipients may distribute the Program under trademarks, logos, and product names belonging to the Recipient provided that all copyright and other attribution notices remain in the Program.
+
+8. PATENT LITIGATION
+
+8.1 If Recipient institutes patent litigation against any person or entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipients patent(s), then such Recipients rights granted under Section 2.2 shall terminate as of the date such litigation is filed.
+
+9. OWNERSHIP
+
+9.1 Subject to the licenses granted under this License in Sections 2.1 and 2.2 above, each Contributor retains all rights, title and interest in and to any Contributions made by such Contributor. CA retains all rights, title and interest in and to the Original Program and any Contributions made by or on behalf of CA (CA Contributions), and such CA Contributions will not be automatically subject to this License. CA may, at its sole discretion, choose to license such CA Contributions under this License, or on different terms from those contained in this License or may choose not to license them at all.
+
+10. TERMINATION
+
+10.1 All of Recipients rights under this License shall terminate if it fails to comply with any of the material terms or conditions of this License and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If Recipients rights under this License terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipients obligations under this License and any licenses granted by Recipient as a Contributor relating to the Program shall continue and survive termination.
+
+11. GENERAL
+
+11.1 If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+11.2 CA may publish new versions (including revisions) of this License from time to time. Each new version of the License will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the License under which it was received. In addition, after a new version of the License is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. No one other than CA has the right to modify this License.
+
+11.3 If it is impossible for Recipient to comply with any of the terms of this License with respect to some or all of the Program due to statute, judicial order, or regulation, then Recipient must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the IP_ISSUES file described in Section 3.5 and must be included with all distributions of the Program source code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a Recipient of ordinary skill to be able to understand it.
+
+11.4 This License is governed by the laws of the State of New York. No Recipient will bring a legal action under this License more than one year after the cause of action arose. Each Recipient waives its rights to a jury trial in any resulting litigation. Any litigation or other dispute resolution between a Recipient and CA relating to this License shall take place in the State of New York, and Recipient and CA hereby consent to the personal jurisdiction of, and venue in, the state and federal courts within that district with respect to this License. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.
+
+11.5 Where Recipient is located in the province of Quebec, Canada, the following clause applies: The parties hereby confirm that they have requested that this License and all related documents be drafted in English. Les parties contractantes confirment qu`elles ont exige que le present contrat et tous les documents associes soient rediges en anglais.
+
+11.6 The Program is subject to all export and import laws, restrictions and regulations of the country in which Recipient receives the Program. Recipient is solely responsible for complying with and ensuring that Recipient does not export, re-export, or import the Program in violation of such laws, restrictions or regulations, or without any necessary licenses and authorizations.
+
+11.7 This License constitutes the entire agreement between the parties with respect to the subject matter hereof.
+
diff --git a/meta/files/common-licenses/CC-BY-1.0 b/meta/files/common-licenses/CC-BY-1.0
new file mode 100644
index 0000000..ca0b752
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-1.0
@@ -0,0 +1,60 @@
+
+Creative Commons
+Attribution 1.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry:
+Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments;
+The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party.
+EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-2.0 b/meta/files/common-licenses/CC-BY-2.0
new file mode 100644
index 0000000..0e17a45
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-2.0
@@ -0,0 +1,63 @@
+
+Creative Commons
+Attribution 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-2.5 b/meta/files/common-licenses/CC-BY-2.5
new file mode 100644
index 0000000..2e3d193
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-2.5
@@ -0,0 +1,63 @@
+
+Creative Commons
+Attribution 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(b), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(b), as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-3.0 b/meta/files/common-licenses/CC-BY-3.0
new file mode 100644
index 0000000..593d562
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-3.0
@@ -0,0 +1,70 @@
+
+Creative Commons
+Attribution 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
+to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
+to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
+to Distribute and Publicly Perform Adaptations.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
+Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested.
+If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author`s honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-1.0 b/meta/files/common-licenses/CC-BY-NC-1.0
new file mode 100644
index 0000000..6c5d229
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-1.0
@@ -0,0 +1,63 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial 1.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry:
+Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments;
+The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party.
+EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-2.0 b/meta/files/common-licenses/CC-BY-NC-2.0
new file mode 100644
index 0000000..4dc5176
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-2.0
@@ -0,0 +1,66 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(d) and 4(e).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-2.5 b/meta/files/common-licenses/CC-BY-NC-2.5
new file mode 100644
index 0000000..98e61e1
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-2.5
@@ -0,0 +1,66 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(d) and 4(e).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-3.0 b/meta/files/common-licenses/CC-BY-NC-3.0
new file mode 100644
index 0000000..cf3425d
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-3.0
@@ -0,0 +1,72 @@
+
+Creative Commons
+
+Attribution-NonCommercial 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
+to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
+to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
+to Distribute and Publicly Perform Adaptations.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, (iv) consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c).
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author`s honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of the License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-ND-1.0 b/meta/files/common-licenses/CC-BY-NC-ND-1.0
new file mode 100644
index 0000000..b17d84e
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-ND-1.0
@@ -0,0 +1,5 @@
+
+Creative Commons
+
+Attribution-NoDerivs-NonCommercial 1.0  CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. License  THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.  BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.  1. Definitions  "Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License. "Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. "Licensor" means the individual or entity that offers the Work under the terms of this License. "Original Author" means the individual or entity who created the Work. "Work" means the copyrightable work of authorship offered under the terms of this License. "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. 2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.  3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:  to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works; to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works; The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.  4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:  You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works. If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit. 5. Representations, Warranties and Disclaimer  By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry: Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments; The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party. EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK. 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  7. Termination  This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. 8. Miscellaneous  Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.  Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.  Creative Commons may be contacted at http://creativecommons.org/.
+
diff --git a/meta/files/common-licenses/CC-BY-NC-ND-2.0 b/meta/files/common-licenses/CC-BY-NC-ND-2.0
new file mode 100644
index 0000000..f46c170
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-ND-2.0
@@ -0,0 +1,63 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial-NoDerivs 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Derivative Works. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(d) and 4(e).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; and to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-ND-2.5 b/meta/files/common-licenses/CC-BY-NC-ND-2.5
new file mode 100644
index 0000000..cb7aa59
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-ND-2.5
@@ -0,0 +1,63 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial-NoDerivs 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Derivative Works. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(d) and 4(e).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; and to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-ND-3.0 b/meta/files/common-licenses/CC-BY-NC-ND-3.0
new file mode 100644
index 0000000..3c954db
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-ND-3.0
@@ -0,0 +1,69 @@
+
+Creative Commons
+
+Attribution-NonCommercial-NoDerivs 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
+to Distribute and Publicly Perform the Work including as incorporated in Collections.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Section 4(d).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(b).
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-SA-1.0 b/meta/files/common-licenses/CC-BY-NC-SA-1.0
new file mode 100644
index 0000000..239fd6a
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-SA-1.0
@@ -0,0 +1,64 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial-ShareAlike 1.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry:
+Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments;
+The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party.
+EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-SA-2.0 b/meta/files/common-licenses/CC-BY-NC-SA-2.0
new file mode 100644
index 0000000..9f07f81
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-SA-2.0
@@ -0,0 +1,68 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial-ShareAlike 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, Noncommercial, ShareAlike.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(e) and 4(f).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-NonCommercial-ShareAlike 2.0 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-SA-2.5 b/meta/files/common-licenses/CC-BY-NC-SA-2.5
new file mode 100644
index 0000000..025ccca
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-SA-2.5
@@ -0,0 +1,68 @@
+
+Creative Commons
+
+
+Attribution-NonCommercial-ShareAlike 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, Noncommercial, ShareAlike.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights set forth in Sections 4(e) and 4(f).
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(d), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(d), as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-NonCommercial-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in connection with the exchange of copyrighted works.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+For the avoidance of doubt, where the Work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor reserves the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work if that performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Mechanical Rights and Statutory Royalties. Licensor reserves the exclusive right to collect, whether individually or via a music rights agency or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions), if Your distribution of such cover version is primarily intended for or directed toward commercial advantage or private monetary compensation.
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor reserves the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions), if Your public digital performance is primarily intended for or directed toward commercial advantage or private monetary compensation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-NC-SA-3.0 b/meta/files/common-licenses/CC-BY-NC-SA-3.0
new file mode 100644
index 0000000..d0cb1c5
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-NC-SA-3.0
@@ -0,0 +1,74 @@
+
+Creative Commons
+
+Attribution-NonCommercial-ShareAlike 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(g) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, Noncommercial, ShareAlike.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
+to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
+to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
+to Distribute and Publicly Perform Adaptations.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved, including but not limited to the rights described in Section 4(e).
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(d), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(d), as requested.
+You may Distribute or Publicly Perform an Adaptation only under: (i) the terms of this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-NonCommercial-ShareAlike 3.0 US) ("Applicable License"). You must include a copy of, or the URI, for Applicable License with every copy of each Adaptation You Distribute or Publicly Perform. You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License. You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License.
+You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation. The exchange of the Work for other copyrighted works by means of digital file-sharing or otherwise shall not be considered to be intended for or directed toward commercial advantage or private monetary compensation, provided there is no payment of any monetary compensation in con-nection with the exchange of copyrighted works.
+If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and, (iv) consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(d) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License if Your exercise of such rights is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c) and otherwise waives the right to collect royalties through any statutory or compulsory licensing scheme; and,
+Voluntary License Schemes. The Licensor reserves the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License that is for a purpose or use which is otherwise than noncommercial as permitted under Section 4(c).
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author`s honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING AND TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO THIS EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-ND-1.0 b/meta/files/common-licenses/CC-BY-ND-1.0
new file mode 100644
index 0000000..7358186
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-ND-1.0
@@ -0,0 +1,59 @@
+
+Creative Commons
+
+
+Attribution-NoDerivs 1.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry:
+Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments;
+The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party.
+EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-ND-2.0 b/meta/files/common-licenses/CC-BY-ND-2.0
new file mode 100644
index 0000000..d2c974b
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-ND-2.0
@@ -0,0 +1,62 @@
+
+Creative Commons
+
+
+Attribution-NoDerivs 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Derivative Works. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; and to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-ND-2.5 b/meta/files/common-licenses/CC-BY-ND-2.5
new file mode 100644
index 0000000..b5e4546
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-ND-2.5
@@ -0,0 +1,62 @@
+
+Creative Commons
+
+
+Attribution-NoDerivs 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Derivative Works. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(b), as requested.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; and to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-ND-3.0 b/meta/files/common-licenses/CC-BY-ND-3.0
new file mode 100644
index 0000000..4f64e30
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-ND-3.0
@@ -0,0 +1,68 @@
+
+Creative Commons
+
+Attribution-NoDerivs 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License.
+"Distribute" means to make available to the public the original and copies of the Work through sale or other transfer of ownership.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; and,
+to Distribute and Publicly Perform the Work including as incorporated in Collections.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
+Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats, but otherwise you have no rights to make Adaptations. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested.
+If You Distribute, or Publicly Perform the Work or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work. The credit required by this Section 4(b) may be implemented in any reasonable manner; provided, however, that in the case of a Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-SA-1.0 b/meta/files/common-licenses/CC-BY-SA-1.0
new file mode 100644
index 0000000..9f1394b
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-SA-1.0
@@ -0,0 +1,63 @@
+
+Creative Commons
+
+
+Attribution-ShareAlike 1.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DRAFT LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works;
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+By offering the Work for public release under this License, Licensor represents and warrants that, to the best of Licensor`s knowledge after reasonable inquiry:
+Licensor has secured all rights in the Work necessary to grant the license rights hereunder and to permit the lawful exercise of the rights granted hereunder without You having any obligation to pay any royalties, compulsory license fees, residuals or any other payments;
+The Work does not infringe the copyright, trademark, publicity rights, common law rights or any other right of any third party or constitute defamation, invasion of privacy or other tortious injury to any third party.
+EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK.
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-SA-2.0 b/meta/files/common-licenses/CC-BY-SA-2.0
new file mode 100644
index 0000000..a82434a
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-SA-2.0
@@ -0,0 +1,67 @@
+
+Creative Commons
+
+
+Attribution-ShareAlike 2.0
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any reference to such Licensor or the Original Author, as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any reference to such Licensor or the Original Author, as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.0 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and give the Original Author credit reasonable to the medium or means You are utilizing by conveying the name (or pseudonym if applicable) of the Original Author if supplied; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-SA-2.5 b/meta/files/common-licenses/CC-BY-SA-2.5
new file mode 100644
index 0000000..7f8dd5c
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-SA-2.5
@@ -0,0 +1,67 @@
+
+Creative Commons
+
+
+Attribution-ShareAlike 2.5
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Collective Work" means a work, such as a periodical issue, anthology or encyclopedia, in which the Work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. A work that constitutes a Collective Work will not be considered a Derivative Work (as defined below) for the purposes of this License.
+"Derivative Work" means a work based upon the Work or upon the Work and other pre-existing works, such as a translation, musical arrangement, dramatization, fictionalization, motion picture version, sound recording, art reproduction, abridgment, condensation, or any other form in which the Work may be recast, transformed, or adapted, except that a work that constitutes a Collective Work will not be considered a Derivative Work for the purpose of this License. For the avoidance of doubt, where the Work is a musical composition or sound recording, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered a Derivative Work for the purpose of this License.
+"Licensor" means the individual or entity that offers the Work under the terms of this License.
+"Original Author" means the individual or entity who created the Work.
+"Work" means the copyrightable work of authorship offered under the terms of this License.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
+2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or restrict any rights arising from fair use, first sale or other limitations on the exclusive rights of the copyright owner under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to reproduce the Work, to incorporate the Work into one or more Collective Works, and to reproduce the Work as incorporated in the Collective Works;
+to create and reproduce Derivative Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission the Work including as incorporated in Collective Works;
+to distribute copies or phonorecords of, display publicly, perform publicly, and perform publicly by means of a digital audio transmission Derivative Works.
+For the avoidance of doubt, where the work is a musical composition:
+
+Performance Royalties Under Blanket Licenses. Licensor waives the exclusive right to collect, whether individually or via a performance rights society (e.g. ASCAP, BMI, SESAC), royalties for the public performance or public digital performance (e.g. webcast) of the Work.
+Mechanical Rights and Statutory Royalties. Licensor waives the exclusive right to collect, whether individually or via a music rights society or designated agent (e.g. Harry Fox Agency), royalties for any phonorecord You create from the Work ("cover version") and distribute, subject to the compulsory license created by 17 USC Section 115 of the US Copyright Act (or the equivalent in other jurisdictions).
+Webcasting Rights and Statutory Royalties. For the avoidance of doubt, where the Work is a sound recording, Licensor waives the exclusive right to collect, whether individually or via a performance-rights society (e.g. SoundExchange), royalties for the public digital performance (e.g. webcast) of the Work, subject to the compulsory license created by 17 USC Section 114 of the US Copyright Act (or the equivalent in other jurisdictions).
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. All rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions.The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may distribute, publicly display, publicly perform, or publicly digitally perform the Work only under the terms of this License, and You must include a copy of, or the Uniform Resource Identifier for, this License with every copy or phonorecord of the Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Work that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Work itself to be made subject to the terms of this License. If You create a Collective Work, upon notice from any Licensor You must, to the extent practicable, remove from the Collective Work any credit as required by clause 4(c), as requested. If You create a Derivative Work, upon notice from any Licensor You must, to the extent practicable, remove from the Derivative Work any credit as required by clause 4(c), as requested.
+You may distribute, publicly display, publicly perform, or publicly digitally perform a Derivative Work only under the terms of this License, a later version of this License with the same License Elements as this License, or a Creative Commons iCommons license that contains the same License Elements as this License (e.g. Attribution-ShareAlike 2.5 Japan). You must include a copy of, or the Uniform Resource Identifier for, this License or other license specified in the previous sentence with every copy or phonorecord of each Derivative Work You distribute, publicly display, publicly perform, or publicly digitally perform. You may not offer or impose any terms on the Derivative Works that alter or restrict the terms of this License or the recipients` exercise of the rights granted hereunder, and You must keep intact all notices that refer to this License and to the disclaimer of warranties. You may not distribute, publicly display, publicly perform, or publicly digitally perform the Derivative Work with any technological measures that control access or use of the Work in a manner inconsistent with the terms of this License Agreement. The above applies to the Derivative Work as incorporated in a Collective Work, but this does not require the Collective Work apart from the Derivative Work itself to be made subject to the terms of this License.
+If you distribute, publicly display, publicly perform, or publicly digitally perform the Work or any Derivative Works or Collective Works, You must keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or (ii) if the Original Author and/or Licensor designate another party or parties (e.g. a sponsor institute, publishing entity, journal) for attribution in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; the title of the Work if supplied; to the extent reasonably practicable, the Uniform Resource Identifier, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and in the case of a Derivative Work, a credit identifying the use of the Work in the Derivative Work (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). Such credit may be implemented in any reasonable manner; provided, however, that in the case of a Derivative Work or Collective Work, at a minimum such credit will appear where any other comparable authorship credit appears and in a manner at least as prominent as such other comparable authorship credit.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE MATERIALS, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Derivative Works or Collective Works from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You distribute or publicly digitally perform the Work or a Collective Work, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You distribute or publicly digitally perform a Derivative Work, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, neither party will use the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC-BY-SA-3.0 b/meta/files/common-licenses/CC-BY-SA-3.0
new file mode 100644
index 0000000..70bbd6c
--- /dev/null
+++ b/meta/files/common-licenses/CC-BY-SA-3.0
@@ -0,0 +1,74 @@
+
+Creative Commons
+
+Attribution-ShareAlike 3.0 Unported
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE.
+License
+
+THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
+
+BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
+
+1. Definitions
+
+"Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License.
+"Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined below) for the purposes of this License.
+"Creative Commons Compatible License" means a license that is listed at http://creativecommons.org/compatiblelicenses that has been approved by Creative Commons as being essentially equivalent to this License, including, at a minimum, because that license: (i) contains terms that have the same purpose, meaning and effect as the License Elements of this License; and, (ii) explicitly permits the relicensing of adaptations of works made available under that license under this License or a Creative Commons jurisdiction license with the same License Elements as this License.
+"Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership.
+"License Elements" means the following high-level license attributes as selected by Licensor and indicated in the title of this License: Attribution, ShareAlike.
+"Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License.
+"Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast.
+"Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work.
+"You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation.
+"Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images.
+"Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium.
+2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws.
+
+3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below:
+
+to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections;
+to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified.";
+to Distribute and Publicly Perform the Work including as incorporated in Collections; and,
+to Distribute and Publicly Perform Adaptations.
+For the avoidance of doubt:
+
+Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License;
+Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and,
+Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License.
+The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved.
+
+4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions:
+
+You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(c), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(c), as requested.
+You may Distribute or Publicly Perform an Adaptation only under the terms of: (i) this License; (ii) a later version of this License with the same License Elements as this License; (iii) a Creative Commons jurisdiction license (either this or a later license version) that contains the same License Elements as this License (e.g., Attribution-ShareAlike 3.0 US)); (iv) a Creative Commons Compatible License. If you license the Adaptation under one of the licenses mentioned in (iv), you must comply with the terms of that license. If you license the Adaptation under the terms of any of the licenses mentioned in (i), (ii) or (iii) (the "Applicable License"), you must comply with the terms of the Applicable License generally and the following provisions: (I) You must include a copy of, or the URI for, the Applicable License with every copy of each Adaptation You Distribute or Publicly Perform; (II) You may not offer or impose any terms on the Adaptation that restrict the terms of the Applicable License or the ability of the recipient of the Adaptation to exercise the rights granted to that recipient under the terms of the Applicable License; (III) You must keep intact all notices that refer to the Applicable License and to the disclaimer of warranties with every copy of the Work as included in the Adaptation You Distribute or Publicly Perform; (IV) when You Distribute or Publicly Perform the Adaptation, You may not impose any effective technological measures on the Adaptation that restrict the ability of a recipient of the Adaptation from You to exercise the rights granted to that recipient under the terms of the Applicable License. This Section 4(b) applies to the Adaptation as incorporated in a Collection, but this does not require the Collection apart from the Adaptation itself to be made subject to the terms of the Applicable License.
+If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor`s copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Ssection 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4(c) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties.
+Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author`s honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author`s honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise.
+5. Representations, Warranties and Disclaimer
+
+UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU.
+
+6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. Termination
+
+This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License.
+Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above.
+8. Miscellaneous
+
+Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License.
+Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License.
+If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent.
+This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You.
+The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law.
+Creative Commons Notice
+
+Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor.
+
+Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons` then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of the License.
+
+Creative Commons may be contacted at http://creativecommons.org/.
+
+&#171; Back to Commons Deed
+
diff --git a/meta/files/common-licenses/CC0-1.0 b/meta/files/common-licenses/CC0-1.0
new file mode 100644
index 0000000..52cf88b
--- /dev/null
+++ b/meta/files/common-licenses/CC0-1.0
@@ -0,0 +1,32 @@
+
+Creative Commons Zero 1.0 Universal (CC0)
+
+CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER.
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following:
+
+the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work;
+moral rights retained by the original author(s) and/or performer(s);
+publicity and privacy rights pertaining to a person`s image or likeness depicted in a Work;
+rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below;
+rights protecting the extraction, dissemination, use and reuse of data in a Work;
+database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and
+other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof.
+2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer`s Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer`s heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer`s express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer`s express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer`s Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer`s express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document.
+Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
+Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person`s Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
+Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
+
diff --git a/meta/files/common-licenses/CDDL-1.0 b/meta/files/common-licenses/CDDL-1.0
new file mode 100644
index 0000000..74198e7
--- /dev/null
+++ b/meta/files/common-licenses/CDDL-1.0
@@ -0,0 +1,131 @@
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
+Version 1.0
+1. Definitions.
+
+1.1. &#8220;Contributor&#8221; means each individual or entity that creates or contributes to the creation of Modifications.
+
+1.2. &#8220;Contributor Version&#8221; means the combination of the Original Software, prior Modifications used by a Contributor (if any), and the Modifications made by that particular Contributor.
+
+1.3. &#8220;Covered Software&#8221; means (a) the Original Software, or (b) Modifications, or (c) the combination of files containing Original Software with files containing Modifications, in each case including portions thereof.
+
+1.4. &#8220;Executable&#8221; means the Covered Software in any form other than Source Code.
+
+1.5. &#8220;Initial Developer&#8221; means the individual or entity that first makes Original Software available under this License.
+
+1.6. &#8220;Larger Work&#8221; means a work which combines Covered Software or portions thereof with code not governed by the terms of this License.
+
+1.7. &#8220;License&#8221; means this document.
+
+1.8. &#8220;Licensable&#8221; means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+1.9. &#8220;Modifications&#8221; means the Source Code and Executable form of any of the following:
+
+A. Any file that results from an addition to, deletion from or modification of the contents of a file containing Original Software or previous Modifications;
+
+B. Any new file that contains any part of the Original Software or previous Modification; or
+
+C. Any new file that is contributed or otherwise made available under the terms of this License.
+
+1.10. &#8220;Original Software&#8221; means the Source Code and Executable form of computer software code that is originally released under this License.
+
+1.11. &#8220;Patent Claims&#8221; means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+
+1.12. &#8220;Source Code&#8221; means (a) the common form of computer software code in which modifications are made and (b) associated documentation included in or with such code.
+
+1.13. &#8220;You&#8221; (or &#8220;Your&#8221;) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, &#8220;You&#8221; includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, &#8220;control&#8221; means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+
+2. License Grants.
+
+2.1. The Initial Developer Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, the Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer, to use, reproduce, modify, display, perform, sublicense and distribute the Original Software (or portions thereof), with or without Modifications, and/or as part of a Larger Work; and
+
+(b) under Patent Claims infringed by the making, using or selling of Original Software, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Software (or portions thereof).
+
+(c) The licenses granted in Sections 2.1(a) and (b) are effective on the date Initial Developer first distributes or otherwise makes the Original Software available to a third party under the terms of this License.
+
+(d) Notwithstanding Section 2.1(b) above, no patent license is granted: (1) for code that You delete from the Original Software, or (2) for infringements caused by: (i) the modification of the Original Software, or (ii) the combination of the Original Software with other software or devices.
+
+2.2. Contributor Grant.
+
+Conditioned upon Your compliance with Section 3.1 below and subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof), either on an unmodified basis, with other Modifications, as Covered Software and/or as part of a Larger Work; and
+
+(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (1) Modifications made by that Contributor (or portions thereof); and (2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+(c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first distributes or otherwise makes the Modifications available to a third party.
+
+(d) Notwithstanding Section 2.2(b) above, no patent license is granted: (1) for any code that Contributor has deleted from the Contributor Version; (2) for infringements caused by: (i) third party modifications of Contributor Version, or (ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or (3) under Patent Claims infringed by Covered Software in the absence of Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make available in Executable form must also be made available in Source Code form and that Source Code form must be distributed only under the terms of this License. You must include a copy of this License with every copy of the Source Code form of the Covered Software You distribute or otherwise make available. You must inform recipients of any such Covered Software in Executable form as to how they can obtain such Covered Software in Source Code form in a reasonable manner on or through a medium customarily used for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute are governed by the terms of this License. You represent that You believe Your Modifications are Your original creation(s) and/or You have sufficient rights to grant the rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that identifies You as the Contributor of the Modification. You may not remove or alter any copyright, patent or trademark notices contained within the Covered Software, or any notices of licensing or any descriptive text giving attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered Software in Source Code form that alters or restricts the applicable version of this License or the recipients&#8217; rights hereunder. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, you may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered Software under the terms of this License or under the terms of a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable form does not attempt to limit or alter the recipient&#8217;s rights in the Source Code form from the rights set forth in this License. If You distribute the Covered Software in Executable form under a different license, You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Software.
+
+4. Versions of the License.
+
+4.1. New Versions.
+
+Sun Microsystems, Inc. is the initial license steward and may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Except as provided in Section 4.3, no one other than the license steward has the right to modify this License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. If the Initial Developer includes a notice in the Original Software prohibiting it from being distributed or otherwise made available under any subsequent version of the License, You must distribute and make the Covered Software available under the terms of the version of the License under which You originally received the Covered Software. Otherwise, You may also choose to use, distribute or otherwise make the Covered Software available under the terms of any subsequent version of the License published by the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a new license for Your Original Software, You may create and use a modified version of this License if You: (a) rename the license and remove any references to the name of the license steward (except to note that the license differs from this License); and (b) otherwise make it clear that the license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN &#8220;AS IS&#8221; BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+6. TERMINATION.
+
+6.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding declaratory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You assert such claim is referred to as &#8220;Participant&#8221;) alleging that the Participant Software (meaning the Contributor Version where the Participant is a Contributor or the Original Software where the Participant is the Initial Developer) directly or indirectly infringes any patent, then any and all rights granted directly or indirectly to You by such Participant, the Initial Developer (if the Initial Developer is not the Participant) and all Contributors under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively and automatically at the expiration of such 60 day notice period, unless if within such 60 day period You withdraw Your claim with respect to the Participant Software against such Participant either unilaterally or pursuant to a written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2 above, all end user licenses that have been validly granted by You or any distributor hereunder prior to termination (excluding licenses granted to You by any distributor) shall survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY&#8217;S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a &#8220;commercial item,&#8221; as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of &#8220;commercial computer software&#8221; (as that term is defined at 48 C.F.R. &#167; 252.227-7014(a)(1)) and &#8220;commercial computer software documentation&#8221; as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Software with only those rights set forth herein. This U.S. Government Rights clause is in lieu of, and supersedes, any other FAR, DFAR, or other clause or provision that addresses Government rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by the law of the jurisdiction specified in a notice contained within the Original Software (except to the extent applicable law, if any, provides otherwise), excluding such jurisdiction&#8217;s conflict-of-law provisions. Any litigation relating to this License shall be subject to the jurisdiction of the courts located in the jurisdiction and venue specified in a notice contained within the Original Software, with the losing party responsible for costs, including, without limitation, court costs and reasonable attorneys&#8217; fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. You agree that You alone are responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries) when You use, distribute or otherwise make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+
diff --git a/meta/files/common-licenses/CECILL-1.0 b/meta/files/common-licenses/CECILL-1.0
new file mode 100644
index 0000000..3d31745
--- /dev/null
+++ b/meta/files/common-licenses/CECILL-1.0
@@ -0,0 +1,242 @@
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL
+
+Avertissement
+
+Ce contrat est une licence de logiciel libre issue d&#8217;une concertation entre ses auteurs afin que le respect de deux grands principes pr&#233;side &#224; sa r&#233;daction:
+
+d&#8217;une part, sa conformit&#233; au droit fran&#231;ais, tant au regard du droit de la responsabilit&#233; civile que du droit de la propri&#233;t&#233; intellectuelle et de la protection qu&#8217;il offre aux auteurs et titulaires des droits patrimoniaux sur un logiciel.
+d&#8217;autre part, le respect des principes de diffusion des logiciels libres: acc&#232;s au code source, droits &#233;tendus conf&#233;r&#233;s aux utilisateurs.
+Les auteurs de la licence CeCILL1 sont:
+
+Commissariat &#224; l&#8217;Energie Atomique &#8211; CEA, &#233;tablissement public de caract&#232;re scientifique technique et industriel, dont le si&#232;ge est situ&#233; 31-33 rue de la F&#233;d&#233;ration, 75752 PARIS cedex 15.
+
+Centre National de la Recherche Scientifique &#8211; CNRS, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; 3 rue Michel-Ange 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique &#8211; INRIA, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex.
+
+PREAMBULE
+
+Ce contrat est une licence de logiciel libre dont l`objectif est de conf&#233;rer aux utilisateurs la libert&#233; de modification et de redistribution du logiciel r&#233;gi par cette licence dans le cadre d`un mod&#232;le de diffusion &#171;open source&#187;.
+
+L`exercice de ces libert&#233;s est assorti de certains devoirs &#224; la charge des utilisateurs afin de pr&#233;server ce statut au cours des redistributions ult&#233;rieures.
+
+L&#8217;accessibilit&#233; au code source et les droits de copie, de modification et de redistribution qui en d&#233;coulent ont pour contrepartie de n&#8217;offrir aux utilisateurs qu&#8217;une garantie limit&#233;e et de ne faire peser sur l&#8217;auteur du logiciel, le titulaire des droits patrimoniaux et les conc&#233;dants successifs qu&#8217;une responsabilit&#233; restreinte.
+
+A cet &#233;gard l&#8217;attention de l&#8217;utilisateur est attir&#233;e sur les risques associ&#233;s au chargement, &#224; l&#8217;utilisation, &#224; la modification et/ou au d&#233;veloppement et &#224; la reproduction du logiciel par l&#8217;utilisateur &#233;tant donn&#233; sa sp&#233;cificit&#233; de logiciel libre, qui peut le rendre complexe &#224; manipuler et qui le r&#233;serve donc &#224; des d&#233;veloppeurs et des professionnels avertis poss&#233;dant des connaissances informatiques approfondies. Les utilisateurs sont donc invit&#233;s &#224; charger et tester l&#8217;ad&#233;quation du Logiciel &#224; leurs besoins dans des conditions permettant d`assurer la s&#233;curit&#233; de leurs syst&#232;mes et ou de leurs donn&#233;es et, plus g&#233;n&#233;ralement, &#224; l`utiliser et l`exploiter dans les m&#234;me conditions de s&#233;curit&#233;. Ce contrat peut &#234;tre reproduit et diffus&#233; librement, sous r&#233;serve de le conserver en l&#8217;&#233;tat, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s&#8217;appliquer &#224; tout logiciel dont le titulaire des droits patrimoniaux d&#233;cide de soumettre l&#8217;exploitation aux dispositions qu&#8217;il contient.
+
+Article 1er - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu&#8217;ils seront &#233;crits avec une lettre capitale, auront la signification suivante:
+
+Contrat: d&#233;signe le pr&#233;sent contrat de licence, ses &#233;ventuelles versions post&#233;rieures et annexes.
+
+Logiciel: d&#233;signe le logiciel sous sa forme de Code Objet et/ou de Code Source et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de l&#8217;acceptation du Contrat par le Licenci&#233;.
+
+Logiciel Initial: d&#233;signe le Logiciel sous sa forme de Code Source et de Code Objet et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de leur premi&#232;re diffusion sous les termes du Contrat.
+
+Logiciel Modifi&#233;: d&#233;signe le Logiciel modifi&#233; par au moins une Contribution.
+
+Code Source: d&#233;signe l&#8217;ensemble des instructions et des lignes de programme du Logiciel et auquel l&#8217;acc&#232;s est n&#233;cessaire en vue de modifier le Logiciel.
+
+Code Objet: d&#233;signe les fichiers binaires issus de la compilation du Code Source.
+
+Titulaire : d&#233;signe le d&#233;tenteur des droits patrimoniaux d&#8217;auteur sur le Logiciel Initial.
+
+Licenci&#233;(s): d&#233;signe le ou les utilisateur(s) du Logiciel ayant accept&#233; le Contrat.
+
+Contributeur: d&#233;signe le Licenci&#233; auteur d&#8217;au moins une Contribution.
+
+Conc&#233;dant: d&#233;signe le Titulaire ou toute personne physique ou morale distribuant le Logiciel sous le Contrat.
+
+Contributions: d&#233;signe l&#8217;ensemble des modifications, corrections, traductions, adaptations et/ou nouvelles fonctionnalit&#233;s int&#233;gr&#233;es dans le Logiciel par tout Contributeur, ainsi que les Modules Statiques.
+
+Module: d&#233;signe un ensemble de fichiers sources y compris leur documentation qui, une fois compil&#233; sous forme ex&#233;cutable, permet de r&#233;aliser des fonctionnalit&#233;s ou services suppl&#233;mentaires &#224; ceux fournis par le Logiciel.
+
+Module Dynamique: d&#233;signe tout Module, cr&#233;&#233; par le Contributeur, ind&#233;pendant du Logiciel, tel que ce Module et le Logiciel sont sous forme de deux ex&#233;cutables ind&#233;pendants qui s&#8217;ex&#233;cutent dans un espace d&#8217;adressage ind&#233;pendant, l&#8217;un appelant l&#8217;autre au moment de leur ex&#233;cution.
+
+Module Statique: d&#233;signe tout Module cr&#233;&#233; par le Contributeur et li&#233; au Logiciel par un lien statique rendant leur code objet d&#233;pendant l`un de l`autre. Ce Module et le Logiciel auquel il est li&#233;, sont regroup&#233;s en un seul ex&#233;cutable.
+
+Parties: d&#233;signe collectivement le Licenci&#233; et le Conc&#233;dant.
+
+Ces termes s&#8217;entendent au singulier comme au pluriel.
+
+Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Conc&#233;dant au Licenci&#233; d&#8217;une Licence non exclusive, transf&#233;rable et mondiale du Logiciel telle que d&#233;finie ci-apr&#232;s &#224; l`article 5 pour toute la dur&#233;e de protection des droits portant sur ce Logiciel.
+
+Article 3 - ACCEPTATION
+
+3.1. L&#8217;acceptation par le Licenci&#233; des termes du Contrat est r&#233;put&#233;e acquise du fait du premier des faits suivants:
+
+(i) le chargement du Logiciel par tout moyen notamment par t&#233;l&#233;chargement &#224; partir d&#8217;un serveur distant ou par chargement &#224; partir d&#8217;un support physique;
+(ii) le premier exercice par le Licenci&#233; de l&#8217;un quelconque des droits conc&#233;d&#233;s par le Contrat.
+3.2. Un exemplaire du Contrat, contenant notamment un avertissement relatif aux sp&#233;cificit&#233;s du Logiciel, &#224; la restriction de garantie et &#224; la limitation &#224; un usage par des utilisateurs exp&#233;riment&#233;s a &#233;t&#233; mis &#224; disposition du Licenci&#233; pr&#233;alablement &#224; son acceptation telle que d&#233;finie &#224; l`article 3.1 ci dessus et le Licenci&#233; reconna&#238;t en avoir pris connaissances.
+
+Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+4.1.ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur &#224; la date de son acceptation par le Licenci&#233; telle que d&#233;finie en 3.1.
+
+4.2. DUREE
+
+Le Contrat produira ses effets pendant toute la dur&#233;e l&#233;gale de protection des droits patrimoniaux portant sur le Logiciel.
+
+Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Conc&#233;dant conc&#232;de au Licenci&#233;, qui accepte, les droits suivants sur le Logiciel pour toutes destinations et pour la dur&#233;e du Contrat dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+Par ailleurs, le Conc&#233;dant conc&#232;de au Licenci&#233; &#224; titre gracieux les droits d&#8217;exploitation du ou des brevets qu&#8217;il d&#233;tient sur tout ou partie des inventions impl&#233;ment&#233;es dans le Logiciel.
+
+5.1. DROITS D&#8217;UTILISATION
+
+Le Licenci&#233; est autoris&#233; &#224; utiliser le Logiciel, sans restriction quant aux domaines d&#8217;application, &#233;tant ci-apr&#232;s pr&#233;cis&#233; que cela comporte:
+
+la reproduction permanente ou provisoire du Logiciel en tout ou partie par tout moyen et sous toute forme.
+
+le chargement, l&#8217;affichage, l&#8217;ex&#233;cution, ou le stockage du Logiciel sur tout support.
+
+la possibilit&#233; d&#8217;en observer, d&#8217;en &#233;tudier, ou d&#8217;en tester le fonctionnement afin de d&#233;terminer les id&#233;es et principes qui sont &#224; la base de n&#8217;importe quel &#233;l&#233;ment de ce Logiciel; et ceci, lorsque le Licenci&#233; effectue toute op&#233;ration de chargement, d&#8217;affichage, d&#8217;ex&#233;cution, de transmission ou de stockage du Logiciel qu&#8217;il est en droit d&#8217;effectuer en vertu du Contrat.
+
+5.2. DROIT D&#8217;APPORTER DES CONTRIBUTIONS
+
+Le droit d&#8217;apporter des Contributions comporte le droit de traduire, d&#8217;adapter, d&#8217;arranger ou d&#8217;apporter toute autre modification du Logiciel et le droit de reproduire le Logiciel en r&#233;sultant.
+
+Le Licenci&#233; est autoris&#233; &#224; apporter toute Contribution au Logiciel sous r&#233;serve de mentionner, de fa&#231;on explicite, son nom en tant qu&#8217;auteur de cette Contribution et la date de cr&#233;ation de celle-ci.
+
+5.3. DROITS DE DISTRIBUTION ET DE DIFFUSION
+
+Le droit de distribution et de diffusion comporte notamment le droit de transmettre et de communiquer le Logiciel au public sur tout support et par tout moyen ainsi que le droit de mettre sur le march&#233; &#224; titre on&#233;reux ou gratuit, un ou des exemplaires du Logiciel par tout proc&#233;d&#233;.
+
+Le Licenci&#233; est autoris&#233; &#224; redistribuer des copies du Logiciel, modifi&#233; ou non, &#224; des tiers dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+5.3.1. REDISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licenci&#233; est autoris&#233; &#224; redistribuer des copies conformes du Logiciel, sous forme de Code Source ou de Code Objet, &#224; condition que cette redistribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d&#8217;un exemplaire du Contrat,
+
+d&#8217;un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le Code Objet du Logiciel est redistribu&#233;, le Licenci&#233; permette aux futurs Licenci&#233;s d&#8217;acc&#233;der facilement au Code Source complet du Logiciel en indiquant les modalit&#233;s d&#8217;acc&#232;s, &#233;tant entendu que le co&#251;t additionnel d&#8217;acquisition du Code Source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.2. REDISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licenci&#233; apporte une Contribution au Logiciel, les conditions de redistribution du Logiciel Modifi&#233; sont alors soumises &#224; l&#8217;int&#233;gralit&#233; des dispositions du Contrat.
+
+Le Licenci&#233; est autoris&#233; &#224; redistribuer le Logiciel Modifi&#233;, sous forme de Code Source ou de Code Objet, &#224; condition que cette redistribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d&#8217;un exemplaire du Contrat,
+
+d&#8217;un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le Code Objet du Logiciel Modifi&#233; est redistribu&#233;, le Licenci&#233; permette aux futurs Licenci&#233;s d&#8217;acc&#233;der facilement au Code Source complet du Logiciel Modifi&#233; en indiquant les modalit&#233;s d&#8217;acc&#232;s, &#233;tant entendu que le co&#251;t additionnel d&#8217;acquisition du Code Source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.3. REDISTRIBUTION DES MODULES DYNAMIQUES
+
+Lorsque le Licenci&#233; a d&#233;velopp&#233; un Module Dynamique les conditions du Contrat ne s&#8217;appliquent pas &#224; ce Module Dynamique, qui peut &#234;tre distribu&#233; sous un contrat de licence diff&#233;rent.
+
+5.3.4. COMPATIBILITE AVEC LA LICENCE GPL
+
+Dans le cas o&#249; le Logiciel, Modifi&#233; ou non, est int&#233;gr&#233; &#224; un code soumis aux dispositions de la licence GPL, le Licenci&#233; est autoris&#233; &#224; redistribuer l&#8217;ensemble sous la licence GPL.
+
+Dans le cas o&#249; le Logiciel Modifi&#233; int&#232;gre un code soumis aux dispositions de la licence GPL, le Licenci&#233; est autoris&#233; &#224; redistribuer le Logiciel Modifi&#233; sous la licence GPL.
+
+Article 6 - PROPRIETE INTELLECTUELLE
+
+6.1. SUR LE LOGICIEL INITIAL
+
+Le Titulaire est d&#233;tenteur des droits patrimoniaux sur le Logiciel Initial. Toute utilisation du Logiciel Initial est soumise au respect des conditions dans lesquelles le Titulaire a choisi de diffuser son &#339;uvre et nul autre n&#8217;a la facult&#233; de modifier les conditions de diffusion de ce Logiciel Initial.
+
+Le Titulaire s`engage &#224; maintenir la diffusion du Logiciel initial sous les conditions du Contrat et ce, pour la dur&#233;e vis&#233;e &#224; l`article 4.2.
+
+6.2. SUR LES CONTRIBUTIONS
+
+Les droits de propri&#233;t&#233; intellectuelle sur les Contributions sont attach&#233;s au titulaire de droits patrimoniaux d&#233;sign&#233; par la l&#233;gislation applicable.
+
+6.3. SUR LES MODULES DYNAMIQUES
+
+Le Licenci&#233; ayant d&#233;velopp&#233; un Module Dynamique est titulaire des droits de propri&#233;t&#233; intellectuelle sur ce Module Dynamique et reste libre du choix du contrat r&#233;gissant sa diffusion.
+
+6.4. DISPOSITIONS COMMUNES
+
+6.4.1. Le Licenci&#233; s&#8217;engage express&#233;ment:
+
+&#224; ne pas supprimer ou modifier de quelque mani&#232;re que ce soit les mentions de propri&#233;t&#233; intellectuelle appos&#233;es sur le Logiciel;
+
+&#224; reproduire &#224; l&#8217;identique lesdites mentions de propri&#233;t&#233; intellectuelle sur les copies du Logiciel.
+
+6.4.2. Le Licenci&#233; s&#8217;engage &#224; ne pas porter atteinte, directement ou indirectement, aux droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs et &#224; prendre, le cas &#233;ch&#233;ant, &#224; l&#8217;&#233;gard de son personnel toutes les mesures n&#233;cessaires pour assurer le respect des dits droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs.
+
+Article 7 - SERVICES ASSOCIES
+
+7.1. Le Contrat n&#8217;oblige en aucun cas le Conc&#233;dant &#224; la r&#233;alisation de prestations d&#8217;assistance technique ou de maintenance du Logiciel.
+
+Cependant le Conc&#233;dant reste libre de proposer ce type de services. Les termes et conditions d&#8217;une telle assistance technique et/ou d&#8217;une telle maintenance seront alors d&#233;termin&#233;s dans un acte s&#233;par&#233;. Ces actes de maintenance et/ou assistance technique n&#8217;engageront que la seule responsabilit&#233; du Conc&#233;dant qui les propose.
+
+7.2. De m&#234;me, tout Conc&#233;dant est libre de proposer, sous sa seule responsabilit&#233;, &#224; ses licenci&#233;s une garantie, qui n&#8217;engagera que lui, lors de la redistribution du Logiciel et/ou du Logiciel Modifi&#233; et ce, dans les conditions qu&#8217;il souhaite. Cette garantie et les modalit&#233;s financi&#232;res de son application feront l&#8217;objet d&#8217;un acte s&#233;par&#233; entre le Conc&#233;dant et le Licenci&#233;.
+
+Article 8 - RESPONSABILITE
+
+8.1. Sous r&#233;serve des dispositions de l&#8217;article 8.2, si le Conc&#233;dant n&#8217;ex&#233;cute pas tout ou partie des obligations mises &#224; sa charge par le Contrat, le Licenci&#233; a la facult&#233;, sous r&#233;serve de prouver la faute du Conc&#233;dant concern&#233;, de solliciter la r&#233;paration du pr&#233;judice direct qu&#8217;il subit et dont il apportera la preuve.
+
+8.2. La responsabilit&#233; du Conc&#233;dant est limit&#233;e aux engagements pris en application du Contrat et ne saurait &#234;tre engag&#233;e en raison notamment:(i) des dommages dus &#224; l&#8217;inex&#233;cution, totale ou partielle, de ses obligations par le Licenci&#233;, (ii) des dommages directs ou indirects d&#233;coulant de l&#8217;utilisation ou des performances du Logiciel subis par le Licenci&#233; lorsqu&#8217;il s&#8217;agit d&#8217;un professionnel utilisant le Logiciel &#224; des fins professionnelles et (iii) des dommages indirects d&#233;coulant de l&#8217;utilisation ou des performances du Logiciel. Les Parties conviennent express&#233;ment que tout pr&#233;judice financier ou commercial (par exemple perte de donn&#233;es, perte de b&#233;n&#233;fices, perte d&#8217;exploitation, perte de client&#232;le ou de commandes, manque &#224; gagner, trouble commercial quelconque) ou toute action dirig&#233;e contre le Licenci&#233; par un tiers, constitue un dommage indirect et n&#8217;ouvre pas droit &#224; r&#233;paration par le Conc&#233;dant.
+
+Article 9 - GARANTIE
+
+9.1. Le Licenci&#233; reconna&#238;t que l&#8217;&#233;tat actuel des connaissances scientifiques et techniques au moment de la mise en circulation du Logiciel ne permet pas d&#8217;en tester et d&#8217;en v&#233;rifier toutes les utilisations ni de d&#233;tecter l&#8217;existence d&#8217;&#233;ventuels d&#233;fauts. L&#8217;attention du Licenci&#233; a &#233;t&#233; attir&#233;e sur ce point sur les risques associ&#233;s au chargement, &#224; l&#8217;utilisation, la modification et/ou au d&#233;veloppement et &#224; la reproduction du Logiciel qui sont r&#233;serv&#233;s &#224; des utilisateurs avertis.
+
+Il rel&#232;ve de la responsabilit&#233; du Licenci&#233; de contr&#244;ler, par tous moyens, l&#8217;ad&#233;quation du produit &#224; ses besoins, son bon fonctionnement et de s`assurer qu&#8217;il ne causera pas de dommages aux personnes et aux biens.
+
+9.2. Le Conc&#233;dant d&#233;clare de bonne foi &#234;tre en droit de conc&#233;der l`ensemble des droits attach&#233;s au Logiciel (comprenant notamment les droits vis&#233;s &#224; l`article 5).
+
+9.3. Le Licenci&#233; reconna&#238;t que le Logiciel est fourni &#171;en l`&#233;tat&#187; par le Conc&#233;dant sans autre garantie, expresse ou tacite, que celle pr&#233;vue &#224; l&#8217;article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, son caract&#232;re s&#233;curis&#233;, innovant ou pertinent.
+
+En particulier, le Conc&#233;dant ne garantit pas que le Logiciel est exempt d`erreur, qu&#8217;il fonctionnera sans interruption, qu&#8217;il sera compatible avec l&#8217;&#233;quipement du Licenci&#233; et sa configuration logicielle ni qu&#8217;il remplira les besoins du Licenci&#233;.
+
+9.4. Le Conc&#233;dant ne garantit pas, de mani&#232;re expresse ou tacite, que le Logiciel ne porte pas atteinte &#224; un quelconque droit de propri&#233;t&#233; intellectuelle d&#8217;un tiers portant sur un brevet, un logiciel ou sur tout autre droit de propri&#233;t&#233;. Ainsi, le Conc&#233;dant exclut toute garantie au profit du Licenci&#233; contre les actions en contrefa&#231;on qui pourraient &#234;tre diligent&#233;es au titre de l&#8217;utilisation, de la modification, et de la redistribution du Logiciel. N&#233;anmoins, si de telles actions sont exerc&#233;es contre le Licenci&#233;, le Conc&#233;dant lui apportera son aide technique et juridique pour sa d&#233;fense. Cette aide technique et juridique est d&#233;termin&#233;e au cas par cas entre le Conc&#233;dant concern&#233; et le Licenci&#233; dans le cadre d&#8217;un protocole d&#8217;accord. Le Conc&#233;dant d&#233;gage toute responsabilit&#233; quant &#224; l&#8217;utilisation de la d&#233;nomination du Logiciel par le Licenci&#233;. Aucune garantie n&#8217;est apport&#233;e quant &#224; l&#8217;existence de droits ant&#233;rieurs sur le nom du Logiciel et sur l&#8217;existence d&#8217;une marque.
+
+Article 10 - RESILIATION
+
+10.1. En cas de manquement par le Licenci&#233; aux obligations mises &#224; sa charge par le Contrat, le Conc&#233;dant pourra r&#233;silier de plein droit le Contrat trente (30) jours apr&#232;s notification adress&#233;e au Licenci&#233; et rest&#233;e sans effet.
+
+10.2. Le Licenci&#233; dont le Contrat est r&#233;sili&#233; n&#8217;est plus autoris&#233; &#224; utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les licences qu&#8217;il aura conc&#233;d&#233;es ant&#233;rieurement &#224; la r&#233;siliation du Contrat resteront valides sous r&#233;serve qu&#8217;elles aient &#233;t&#233; effectu&#233;es en conformit&#233; avec le Contrat.
+
+Article 11 - DISPOSITIONS DIVERSES
+
+11.1. CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d&#8217;un retard ou d&#8217;une d&#233;faillance d&#8217;ex&#233;cution du Contrat qui serait d&#251; &#224; un cas de force majeure, un cas fortuit ou une cause ext&#233;rieure, telle que, notamment, le mauvais fonctionnement ou les interruptions du r&#233;seau &#233;lectrique ou de t&#233;l&#233;communication, la paralysie du r&#233;seau li&#233;e &#224; une attaque informatique, l&#8217;intervention des autorit&#233;s gouvernementales, les catastrophes naturelles, les d&#233;g&#226;ts des eaux, les tremblements de terre, le feu, les explosions, les gr&#232;ves et les conflits sociaux, l&#8217;&#233;tat de guerre&#8230;
+
+11.2. Le fait, par l&#8217;une ou l&#8217;autre des Parties, d&#8217;omettre en une ou plusieurs occasions de se pr&#233;valoir d&#8217;une ou plusieurs dispositions du Contrat, ne pourra en aucun cas impliquer renonciation par la Partie int&#233;ress&#233;e &#224; s&#8217;en pr&#233;valoir ult&#233;rieurement.
+
+11.3. Le Contrat annule et remplace toute convention ant&#233;rieure, &#233;crite ou orale, entre les Parties sur le m&#234;me objet et constitue l&#8217;accord entier entre les Parties sur cet objet. Aucune addition ou modification aux termes du Contrat n&#8217;aura d&#8217;effet &#224; l&#8217;&#233;gard des Parties &#224; moins d&#8217;&#234;tre faite par &#233;crit et sign&#233;e par leurs repr&#233;sentants d&#251;ment habilit&#233;s.
+
+11.4. Dans l&#8217;hypoth&#232;se o&#249; une ou plusieurs des dispositions du Contrat s&#8217;av&#232;rerait contraire &#224; une loi ou &#224; un texte applicable, existants ou futurs, cette loi ou ce texte pr&#233;vaudrait, et les Parties feraient les amendements n&#233;cessaires pour se conformer &#224; cette loi ou &#224; ce texte. Toutes les autres dispositions resteront en vigueur. De m&#234;me, la nullit&#233;, pour quelque raison que ce soit, d&#8217;une des dispositions du Contrat ne saurait entra&#238;ner la nullit&#233; de l&#8217;ensemble du Contrat.
+
+11.5. LANGUE
+
+Le Contrat est r&#233;dig&#233; en langue fran&#231;aise et en langue anglaise. En cas de divergence d&#8217;interpr&#233;tation, seule la version fran&#231;aise fait foi.
+
+Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1. Toute personne est autoris&#233;e &#224; copier et distribuer des copies de ce Contrat.
+
+12.2. Afin d&#8217;en pr&#233;server la coh&#233;rence, le texte du Contrat est prot&#233;g&#233; et ne peut &#234;tre modifi&#233; que par les auteurs de la licence, lesquels se r&#233;servent le droit de publier p&#233;riodiquement des mises &#224; jour ou de nouvelles versions du Contrat, qui poss&#232;deront chacune un num&#233;ro distinct. Ces versions ult&#233;rieures seront susceptibles de prendre en compte de nouvelles probl&#233;matiques rencontr&#233;es par les logiciels libres.
+
+12.3. Tout Logiciel diffus&#233; sous une version donn&#233;e du Contrat ne pourra faire l`objet d`une diffusion ult&#233;rieure que sous la m&#234;me version du Contrat ou une version post&#233;rieure, sous r&#233;serve des dispositions de l`article 5.3.4.
+
+Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1. Le Contrat est r&#233;gi par la loi fran&#231;aise. Les Parties conviennent de tenter de r&#233;gler &#224; l&#8217;amiable les diff&#233;rends ou litiges qui viendraient &#224; se produire par suite ou &#224; l&#8217;occasion du Contrat.
+
+13.2. A d&#233;faut d&#8217;accord amiable dans un d&#233;lai de deux (2) mois &#224; compter de leur survenance et sauf situation relevant d&#8217;une proc&#233;dure d&#8217;urgence, les diff&#233;rends ou litiges seront port&#233;s par la Partie la plus diligente devant les Tribunaux comp&#233;tents de Paris.
+
+1 Ce: CEA, C: CNRS, I: INRIA, LL: Logiciel Libre
+
+
+Version 1 du 21/06/2004
+
diff --git a/meta/files/common-licenses/CECILL-2.0 b/meta/files/common-licenses/CECILL-2.0
new file mode 100644
index 0000000..7bc14a6
--- /dev/null
+++ b/meta/files/common-licenses/CECILL-2.0
@@ -0,0 +1,243 @@
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL
+
+Avertissement
+
+Ce contrat est une licence de logiciel libre issue d`une concertation entre ses auteurs afin que le respect de deux grands principes pr&#233;side &#224; sa r&#233;daction:
+
+d`une part, le respect des principes de diffusion des logiciels libres: acc&#232;s au code source, droits &#233;tendus conf&#233;r&#233;s aux utilisateurs,
+d`autre part, la d&#233;signation d`un droit applicable, le droit fran&#231;ais, auquel elle est conforme, tant au regard du droit de la responsabilit&#233; civile que du droit de la propri&#233;t&#233; intellectuelle et de la protection qu`il offre aux auteurs et titulaires des droits patrimoniaux sur un logiciel.
+Les auteurs de la licence CeCILL1 sont:
+
+Commissariat &#224; l`Energie Atomique - CEA, &#233;tablissement public de recherche &#224; caract&#232;re scientifique, technique et industriel, dont le si&#232;ge est situ&#233; 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
+
+Centre National de la Recherche Scientifique - CNRS, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; 3 rue Michel-Ange, 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique - INRIA, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex.
+
+Pr&#233;ambule
+
+Ce contrat est une licence de logiciel libre dont l`objectif est de conf&#233;rer aux utilisateurs la libert&#233; de modification et de redistribution du logiciel r&#233;gi par cette licence dans le cadre d`un mod&#232;le de diffusion en logiciel libre.
+
+L`exercice de ces libert&#233;s est assorti de certains devoirs &#224; la charge des utilisateurs afin de pr&#233;server ce statut au cours des redistributions ult&#233;rieures.
+
+L`accessibilit&#233; au code source et les droits de copie, de modification et de redistribution qui en d&#233;coulent ont pour contrepartie de n`offrir aux utilisateurs qu`une garantie limit&#233;e et de ne faire peser sur l`auteur du logiciel, le titulaire des droits patrimoniaux et les conc&#233;dants successifs qu`une responsabilit&#233; restreinte.
+
+A cet &#233;gard l`attention de l`utilisateur est attir&#233;e sur les risques associ&#233;s au chargement, &#224; l`utilisation, &#224; la modification et/ou au d&#233;veloppement et &#224; la reproduction du logiciel par l`utilisateur &#233;tant donn&#233; sa sp&#233;cificit&#233; de logiciel libre, qui peut le rendre complexe &#224; manipuler et qui le r&#233;serve donc &#224; des d&#233;veloppeurs ou des professionnels avertis poss&#233;dant des connaissances informatiques approfondies. Les utilisateurs sont donc invit&#233;s &#224; charger et tester l`ad&#233;quation du logiciel &#224; leurs besoins dans des conditions permettant d`assurer la s&#233;curit&#233; de leurs syst&#232;mes et/ou de leurs donn&#233;es et, plus g&#233;n&#233;ralement, &#224; l`utiliser et l`exploiter dans les m&#234;mes conditions de s&#233;curit&#233;. Ce contrat peut &#234;tre reproduit et diffus&#233; librement, sous r&#233;serve de le conserver en l`&#233;tat, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s`appliquer &#224; tout logiciel dont le titulaire des droits patrimoniaux d&#233;cide de soumettre l`exploitation aux dispositions qu`il contient.
+
+Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu`ils seront &#233;crits avec une lettre capitale, auront la signification suivante:
+
+Contrat: d&#233;signe le pr&#233;sent contrat de licence, ses &#233;ventuelles versions post&#233;rieures et annexes.
+
+Logiciel: d&#233;signe le logiciel sous sa forme de Code Objet et/ou de Code Source et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de l`acceptation du Contrat par le Licenci&#233;.
+
+Logiciel Initial: d&#233;signe le Logiciel sous sa forme de Code Source et &#233;ventuellement de Code Objet et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de leur premi&#232;re diffusion sous les termes du Contrat.
+
+Logiciel Modifi&#233;: d&#233;signe le Logiciel modifi&#233; par au moins une Contribution.
+
+Code Source: d&#233;signe l`ensemble des instructions et des lignes de programme du Logiciel et auquel l`acc&#232;s est n&#233;cessaire en vue de modifier le Logiciel.
+
+Code Objet: d&#233;signe les fichiers binaires issus de la compilation du Code Source.
+
+Titulaire: d&#233;signe le ou les d&#233;tenteurs des droits patrimoniaux d`auteur sur le Logiciel Initial.
+
+Licenci&#233;: d&#233;signe le ou les utilisateurs du Logiciel ayant accept&#233; le Contrat.
+
+Contributeur: d&#233;signe le Licenci&#233; auteur d`au moins une Contribution.
+
+Conc&#233;dant: d&#233;signe le Titulaire ou toute personne physique ou morale distribuant le Logiciel sous le Contrat.
+
+Contribution: d&#233;signe l`ensemble des modifications, corrections, traductions, adaptations et/ou nouvelles fonctionnalit&#233;s int&#233;gr&#233;es dans le Logiciel par tout Contributeur, ainsi que tout Module Interne.
+
+Module: d&#233;signe un ensemble de fichiers sources y compris leur documentation qui permet de r&#233;aliser des fonctionnalit&#233;s ou services suppl&#233;mentaires &#224; ceux fournis par le Logiciel.
+
+Module Externe: d&#233;signe tout Module, non d&#233;riv&#233; du Logiciel, tel que ce Module et le Logiciel s`ex&#233;cutent dans des espaces d`adressage diff&#233;rents, l`un appelant l`autre au moment de leur ex&#233;cution.
+
+Module Interne: d&#233;signe tout Module li&#233; au Logiciel de telle sorte qu`ils s`ex&#233;cutent dans le m&#234;me espace d`adressage.
+
+GNU GPL: d&#233;signe la GNU General Public License dans sa version 2 ou toute version ult&#233;rieure, telle que publi&#233;e par Free Software Foundation Inc.
+
+Parties: d&#233;signe collectivement le Licenci&#233; et le Conc&#233;dant.
+
+Ces termes s`entendent au singulier comme au pluriel.
+
+Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Conc&#233;dant au Licenci&#233; d`une licence non exclusive, cessible et mondiale du Logiciel telle que d&#233;finie ci-apr&#232;s &#224; l`article 5 pour toute la dur&#233;e de protection des droits portant sur ce Logiciel.
+
+Article 3 - ACCEPTATION
+
+3.1 L`acceptation par le Licenci&#233; des termes du Contrat est r&#233;put&#233;e acquise du fait du premier des faits suivants:
+
+(i) le chargement du Logiciel par tout moyen notamment par t&#233;l&#233;chargement &#224; partir d`un serveur distant ou par chargement &#224; partir d`un support physique;
+(ii) le premier exercice par le Licenci&#233; de l`un quelconque des droits conc&#233;d&#233;s par le Contrat.
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement relatif aux sp&#233;cificit&#233;s du Logiciel, &#224; la restriction de garantie et &#224; la limitation &#224; un usage par des utilisateurs exp&#233;riment&#233;s a &#233;t&#233; mis &#224; disposition du Licenci&#233; pr&#233;alablement &#224; son acceptation telle que d&#233;finie &#224; l`article 3.1 ci dessus et le Licenci&#233; reconna&#238;t en avoir pris connaissance.
+
+Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur &#224; la date de son acceptation par le Licenci&#233; telle que d&#233;finie en 3.1.
+
+4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la dur&#233;e l&#233;gale de protection des droits patrimoniaux portant sur le Logiciel.
+
+Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Conc&#233;dant conc&#232;de au Licenci&#233;, qui accepte, les droits suivants sur le Logiciel pour toutes destinations et pour la dur&#233;e du Contrat dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+Par ailleurs, si le Conc&#233;dant d&#233;tient ou venait &#224; d&#233;tenir un ou plusieurs brevets d`invention prot&#233;geant tout ou partie des fonctionnalit&#233;s du Logiciel ou de ses composants, il s`engage &#224; ne pas opposer les &#233;ventuels droits conf&#233;r&#233;s par ces brevets aux Licenci&#233;s successifs qui utiliseraient, exploiteraient ou modifieraient le Logiciel. En cas de cession de ces brevets, le Conc&#233;dant s`engage &#224; faire reprendre les obligations du pr&#233;sent alin&#233;a aux cessionnaires.
+
+5.1 DROIT D`UTILISATION
+
+Le Licenci&#233; est autoris&#233; &#224; utiliser le Logiciel, sans restriction quant aux domaines d`application, &#233;tant ci-apr&#232;s pr&#233;cis&#233; que cela comporte:
+
+la reproduction permanente ou provisoire du Logiciel en tout ou partie par tout moyen et sous toute forme.
+
+le chargement, l`affichage, l`ex&#233;cution, ou le stockage du Logiciel sur tout support.
+
+la possibilit&#233; d`en observer, d`en &#233;tudier, ou d`en tester le fonctionnement afin de d&#233;terminer les id&#233;es et principes qui sont &#224; la base de n`importe quel &#233;l&#233;ment de ce Logiciel; et ceci, lorsque le Licenci&#233; effectue toute op&#233;ration de chargement, d`affichage, d`ex&#233;cution, de transmission ou de stockage du Logiciel qu`il est en droit d`effectuer en vertu du Contrat.
+
+5.2 DROIT D`APPORTER DES CONTRIBUTIONS
+
+Le droit d`apporter des Contributions comporte le droit de traduire, d`adapter, d`arranger ou d`apporter toute autre modification au Logiciel et le droit de reproduire le logiciel en r&#233;sultant.
+
+Le Licenci&#233; est autoris&#233; &#224; apporter toute Contribution au Logiciel sous r&#233;serve de mentionner, de fa&#231;on explicite, son nom en tant qu`auteur de cette Contribution et la date de cr&#233;ation de celle-ci.
+
+5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de transmettre et de communiquer le Logiciel au public sur tout support et par tout moyen ainsi que le droit de mettre sur le march&#233; &#224; titre on&#233;reux ou gratuit, un ou des exemplaires du Logiciel par tout proc&#233;d&#233;.
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies du Logiciel, modifi&#233; ou non, &#224; des tiers dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies conformes du Logiciel, sous forme de Code Source ou de Code Objet, &#224; condition que cette distribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d`un exemplaire du Contrat,
+
+d`un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le Code Objet du Logiciel est redistribu&#233;, le Licenci&#233; permette aux futurs Licenci&#233;s d`acc&#233;der facilement au Code Source complet du Logiciel en indiquant les modalit&#233;s d`acc&#232;s, &#233;tant entendu que le co&#251;t additionnel d`acquisition du Code Source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licenci&#233; apporte une Contribution au Logiciel, les conditions de distribution du Logiciel Modifi&#233; en r&#233;sultant sont alors soumises &#224; l`int&#233;gralit&#233; des dispositions du Contrat.
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer le Logiciel Modifi&#233;, sous forme de code source ou de code objet, &#224; condition que cette distribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d`un exemplaire du Contrat,
+
+d`un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le code objet du Logiciel Modifi&#233; est redistribu&#233;, le Licenci&#233; permette aux futurs Licenci&#233;s d`acc&#233;der facilement au code source complet du Logiciel Modifi&#233; en indiquant les modalit&#233;s d`acc&#232;s, &#233;tant entendu que le co&#251;t additionnel d`acquisition du code source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.3 DISTRIBUTION DES MODULES EXTERNES
+
+Lorsque le Licenci&#233; a d&#233;velopp&#233; un Module Externe les conditions du Contrat ne s`appliquent pas &#224; ce Module Externe, qui peut &#234;tre distribu&#233; sous un contrat de licence diff&#233;rent.
+
+5.3.4 COMPATIBILITE AVEC LA LICENCE GNU GPL
+
+Le Licenci&#233; peut inclure un code soumis aux dispositions d`une des versions de la licence GNU GPL dans le Logiciel modifi&#233; ou non et distribuer l`ensemble sous les conditions de la m&#234;me version de la licence GNU GPL.
+
+Le Licenci&#233; peut inclure le Logiciel modifi&#233; ou non dans un code soumis aux dispositions d`une des versions de la licence GNU GPL et distribuer l`ensemble sous les conditions de la m&#234;me version de la licence GNU GPL.
+
+Article 6 - PROPRIETE INTELLECTUELLE
+
+6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est d&#233;tenteur des droits patrimoniaux sur le Logiciel Initial. Toute utilisation du Logiciel Initial est soumise au respect des conditions dans lesquelles le Titulaire a choisi de diffuser son oeuvre et nul autre n`a la facult&#233; de modifier les conditions de diffusion de ce Logiciel Initial.
+
+Le Titulaire s`engage &#224; ce que le Logiciel Initial reste au moins r&#233;gi par le Contrat et ce, pour la dur&#233;e vis&#233;e &#224; l`article 4.2.
+
+6.2 SUR LES CONTRIBUTIONS
+
+Le Licenci&#233; qui a d&#233;velopp&#233; une Contribution est titulaire sur celle-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable.
+
+6.3 SUR LES MODULES EXTERNES
+
+Le Licenci&#233; qui a d&#233;velopp&#233; un Module Externe est titulaire sur celui-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable et reste libre du choix du contrat r&#233;gissant sa diffusion.
+
+6.4 DISPOSITIONS COMMUNES
+
+Le Licenci&#233; s`engage express&#233;ment:
+
+&#224; ne pas supprimer ou modifier de quelque mani&#232;re que ce soit les mentions de propri&#233;t&#233; intellectuelle appos&#233;es sur le Logiciel;
+
+&#224; reproduire &#224; l`identique lesdites mentions de propri&#233;t&#233; intellectuelle sur les copies du Logiciel modifi&#233; ou non.
+
+Le Licenci&#233; s`engage &#224; ne pas porter atteinte, directement ou indirectement, aux droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs sur le Logiciel et &#224; prendre, le cas &#233;ch&#233;ant, &#224; l`&#233;gard de son personnel toutes les mesures n&#233;cessaires pour assurer le respect des dits droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs.
+
+Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n`oblige en aucun cas le Conc&#233;dant &#224; la r&#233;alisation de prestations d`assistance technique ou de maintenance du Logiciel.
+
+Cependant le Conc&#233;dant reste libre de proposer ce type de services. Les termes et conditions d`une telle assistance technique et/ou d`une telle maintenance seront alors d&#233;termin&#233;s dans un acte s&#233;par&#233;. Ces actes de maintenance et/ou assistance technique n`engageront que la seule responsabilit&#233; du Conc&#233;dant qui les propose.
+
+7.2 De m&#234;me, tout Conc&#233;dant est libre de proposer, sous sa seule responsabilit&#233;, &#224; ses licenci&#233;s une garantie, qui n`engagera que lui, lors de la redistribution du Logiciel et/ou du Logiciel Modifi&#233; et ce, dans les conditions qu`il souhaite. Cette garantie et les modalit&#233;s financi&#232;res de son application feront l`objet d`un acte s&#233;par&#233; entre le Conc&#233;dant et le Licenci&#233;.
+
+Article 8 - RESPONSABILITE
+
+8.1 Sous r&#233;serve des dispositions de l`article 8.2, le Licenci&#233; a la facult&#233;, sous r&#233;serve de prouver la faute du Conc&#233;dant concern&#233;, de solliciter la r&#233;paration du pr&#233;judice direct qu`il subirait du fait du Logiciel et dont il apportera la preuve.
+
+8.2 La responsabilit&#233; du Conc&#233;dant est limit&#233;e aux engagements pris en application du Contrat et ne saurait &#234;tre engag&#233;e en raison notamment: (i) des dommages dus &#224; l`inex&#233;cution, totale ou partielle, de ses obligations par le Licenci&#233;, (ii) des dommages directs ou indirects d&#233;coulant de l`utilisation ou des performances du Logiciel subis par le Licenci&#233; et (iii) plus g&#233;n&#233;ralement d`un quelconque dommage indirect. En particulier, les Parties conviennent express&#233;ment que tout pr&#233;judice financier ou commercial (par exemple perte de donn&#233;es, perte de b&#233;n&#233;fices, perte d`exploitation, perte de client&#232;le ou de commandes, manque &#224; gagner, trouble commercial quelconque) ou toute action dirig&#233;e contre le Licenci&#233; par un tiers, constitue un dommage indirect et n`ouvre pas droit &#224; r&#233;paration par le Conc&#233;dant.
+
+Article 9 - GARANTIE
+
+9.1 Le Licenci&#233; reconna&#238;t que l`&#233;tat actuel des connaissances scientifiques et techniques au moment de la mise en circulation du Logiciel ne permet pas d`en tester et d`en v&#233;rifier toutes les utilisations ni de d&#233;tecter l`existence d`&#233;ventuels d&#233;fauts. L`attention du Licenci&#233; a &#233;t&#233; attir&#233;e sur ce point sur les risques associ&#233;s au chargement, &#224; l`utilisation, la modification et/ou au d&#233;veloppement et &#224; la reproduction du Logiciel qui sont r&#233;serv&#233;s &#224; des utilisateurs avertis.
+
+Il rel&#232;ve de la responsabilit&#233; du Licenci&#233; de contr&#244;ler, par tous moyens, l`ad&#233;quation du produit &#224; ses besoins, son bon fonctionnement et de s`assurer qu`il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Conc&#233;dant d&#233;clare de bonne foi &#234;tre en droit de conc&#233;der l`ensemble des droits attach&#233;s au Logiciel (comprenant notamment les droits vis&#233;s &#224; l`article 5).
+
+9.3 Le Licenci&#233; reconna&#238;t que le Logiciel est fourni "en l`&#233;tat" par le Conc&#233;dant sans autre garantie, expresse ou tacite, que celle pr&#233;vue &#224; l`article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, son caract&#232;re s&#233;curis&#233;, innovant ou pertinent.
+
+En particulier, le Conc&#233;dant ne garantit pas que le Logiciel est exempt d`erreur, qu`il fonctionnera sans interruption, qu`il sera compatible avec l`&#233;quipement du Licenci&#233; et sa configuration logicielle ni qu`il remplira les besoins du Licenci&#233;.
+
+9.4 Le Conc&#233;dant ne garantit pas, de mani&#232;re expresse ou tacite, que le Logiciel ne porte pas atteinte &#224; un quelconque droit de propri&#233;t&#233; intellectuelle d`un tiers portant sur un brevet, un logiciel ou sur tout autre droit de propri&#233;t&#233;. Ainsi, le Conc&#233;dant exclut toute garantie au profit du Licenci&#233; contre les actions en contrefa&#231;on qui pourraient &#234;tre diligent&#233;es au titre de l`utilisation, de la modification, et de la redistribution du Logiciel. N&#233;anmoins, si de telles actions sont exerc&#233;es contre le Licenci&#233;, le Conc&#233;dant lui apportera son aide technique et juridique pour sa d&#233;fense. Cette aide technique et juridique est d&#233;termin&#233;e au cas par cas entre le Conc&#233;dant concern&#233; et le Licenci&#233; dans le cadre d`un protocole d`accord. Le Conc&#233;dant d&#233;gage toute responsabilit&#233; quant &#224; l`utilisation de la d&#233;nomination du Logiciel par le Licenci&#233;. Aucune garantie n`est apport&#233;e quant &#224; l`existence de droits ant&#233;rieurs sur le nom du Logiciel et sur l`existence d`une marque.
+
+Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licenci&#233; aux obligations mises &#224; sa charge par le Contrat, le Conc&#233;dant pourra r&#233;silier de plein droit le Contrat trente (30) jours apr&#232;s notification adress&#233;e au Licenci&#233; et rest&#233;e sans effet.
+
+10.2 Le Licenci&#233; dont le Contrat est r&#233;sili&#233; n`est plus autoris&#233; &#224; utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les licences qu`il aura conc&#233;d&#233;es ant&#233;rieurement &#224; la r&#233;siliation du Contrat resteront valides sous r&#233;serve qu`elles aient &#233;t&#233; effectu&#233;es en conformit&#233; avec le Contrat.
+
+Article 11 - DISPOSITIONS DIVERSES
+
+11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d`un retard ou d`une d&#233;faillance d`ex&#233;cution du Contrat qui serait d&#251; &#224; un cas de force majeure, un cas fortuit ou une cause ext&#233;rieure, telle que, notamment, le mauvais fonctionnement ou les interruptions du r&#233;seau &#233;lectrique ou de t&#233;l&#233;communication, la paralysie du r&#233;seau li&#233;e &#224; une attaque informatique, l`intervention des autorit&#233;s gouvernementales, les catastrophes naturelles, les d&#233;g&#226;ts des eaux, les tremblements de terre, le feu, les explosions, les gr&#232;ves et les conflits sociaux, l`&#233;tat de guerre...
+
+11.2 Le fait, par l`une ou l`autre des Parties, d`omettre en une ou plusieurs occasions de se pr&#233;valoir d`une ou plusieurs dispositions du Contrat, ne pourra en aucun cas impliquer renonciation par la Partie int&#233;ress&#233;e &#224; s`en pr&#233;valoir ult&#233;rieurement.
+
+11.3 Le Contrat annule et remplace toute convention ant&#233;rieure, &#233;crite ou orale, entre les Parties sur le m&#234;me objet et constitue l`accord entier entre les Parties sur cet objet. Aucune addition ou modification aux termes du Contrat n`aura d`effet &#224; l`&#233;gard des Parties &#224; moins d`&#234;tre faite par &#233;crit et sign&#233;e par leurs repr&#233;sentants d&#251;ment habilit&#233;s.
+
+11.4 Dans l`hypoth&#232;se o&#249; une ou plusieurs des dispositions du Contrat s`av&#232;rerait contraire &#224; une loi ou &#224; un texte applicable, existants ou futurs, cette loi ou ce texte pr&#233;vaudrait, et les Parties feraient les amendements n&#233;cessaires pour se conformer &#224; cette loi ou &#224; ce texte. Toutes les autres dispositions resteront en vigueur. De m&#234;me, la nullit&#233;, pour quelque raison que ce soit, d`une des dispositions du Contrat ne saurait entra&#238;ner la nullit&#233; de l`ensemble du Contrat.
+
+11.5 LANGUE
+
+Le Contrat est r&#233;dig&#233; en langue fran&#231;aise et en langue anglaise, ces deux versions faisant &#233;galement foi.
+
+Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autoris&#233;e &#224; copier et distribuer des copies de ce Contrat.
+
+12.2 Afin d`en pr&#233;server la coh&#233;rence, le texte du Contrat est prot&#233;g&#233; et ne peut &#234;tre modifi&#233; que par les auteurs de la licence, lesquels se r&#233;servent le droit de publier p&#233;riodiquement des mises &#224; jour ou de nouvelles versions du Contrat, qui poss&#233;deront chacune un num&#233;ro distinct. Ces versions ult&#233;rieures seront susceptibles de prendre en compte de nouvelles probl&#233;matiques rencontr&#233;es par les logiciels libres.
+
+12.3 Tout Logiciel diffus&#233; sous une version donn&#233;e du Contrat ne pourra faire l`objet d`une diffusion ult&#233;rieure que sous la m&#234;me version du Contrat ou une version post&#233;rieure, sous r&#233;serve des dispositions de l`article 5.3.4.
+
+Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est r&#233;gi par la loi fran&#231;aise. Les Parties conviennent de tenter de r&#233;gler &#224; l`amiable les diff&#233;rends ou litiges qui viendraient &#224; se produire par suite ou &#224; l`occasion du Contrat.
+
+13.2 A d&#233;faut d`accord amiable dans un d&#233;lai de deux (2) mois &#224; compter de leur survenance et sauf situation relevant d`une proc&#233;dure d`urgence, les diff&#233;rends ou litiges seront port&#233;s par la Partie la plus diligente devant les Tribunaux comp&#233;tents de Paris.
+
+1 CeCILL est pour Ce(a) C(nrs) I(nria) L(ogiciel) L(ibre)
+
+Version 2.0 du 2006-09-05.
+
diff --git a/meta/files/common-licenses/CECILL-B b/meta/files/common-licenses/CECILL-B
new file mode 100644
index 0000000..1cc244f
--- /dev/null
+++ b/meta/files/common-licenses/CECILL-B
@@ -0,0 +1,247 @@
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-B
+
+Avertissement
+
+Ce contrat est une licence de logiciel libre issue d`une concertation entre ses auteurs afin que le respect de deux grands principes pr&#233;side &#224; sa r&#233;daction:
+
+d`une part, le respect des principes de diffusion des logiciels libres: acc&#232;s au code source, droits &#233;tendus conf&#233;r&#233;s aux utilisateurs,
+d`autre part, la d&#233;signation d`un droit applicable, le droit fran&#231;ais, auquel elle est conforme, tant au regard du droit de la responsabilit&#233; civile que du droit de la propri&#233;t&#233; intellectuelle et de la protection qu`il offre aux auteurs et titulaires des droits patrimoniaux sur un logiciel.
+Les auteurs de la licence CeCILL-B1 sont:
+
+Commissariat &#224; l`Energie Atomique - CEA, &#233;tablissement public de recherche &#224; caract&#232;re scientifique, technique et industriel, dont le si&#232;ge est situ&#233; 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
+
+Centre National de la Recherche Scientifique - CNRS, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; 3 rue Michel-Ange, 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique - INRIA, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex.
+
+Pr&#233;ambule
+
+Ce contrat est une licence de logiciel libre dont l`objectif est de conf&#233;rer aux utilisateurs une tr&#232;s large libert&#233; de modification et de redistribution du logiciel r&#233;gi par cette licence.
+
+L`exercice de cette libert&#233; est assorti d`une obligation forte de citation &#224; la charge de ceux qui distribueraient un logiciel incorporant un logiciel r&#233;gi par la pr&#233;sente licence afin d`assurer que les contributions de tous soient correctement identifi&#233;es et reconnues.
+
+L`accessibilit&#233; au code source et les droits de copie, de modification et de redistribution qui d&#233;coulent de ce contrat ont pour contrepartie de n`offrir aux utilisateurs qu`une garantie limit&#233;e et de ne faire peser sur l`auteur du logiciel, le titulaire des droits patrimoniaux et les conc&#233;dants successifs qu`une responsabilit&#233; restreinte.
+
+A cet &#233;gard l`attention de l`utilisateur est attir&#233;e sur les risques associ&#233;s au chargement, &#224; l`utilisation, &#224; la modification et/ou au d&#233;veloppement et &#224; la reproduction du logiciel par l`utilisateur &#233;tant donn&#233; sa sp&#233;cificit&#233; de logiciel libre, qui peut le rendre complexe &#224; manipuler et qui le r&#233;serve donc &#224; des d&#233;veloppeurs ou des professionnels avertis poss&#233;dant des connaissances informatiques approfondies. Les utilisateurs sont donc invit&#233;s &#224; charger et tester l`ad&#233;quation du logiciel &#224; leurs besoins dans des conditions permettant d`assurer la s&#233;curit&#233; de leurs syst&#232;mes et/ou de leurs donn&#233;es et, plus g&#233;n&#233;ralement, &#224; l`utiliser et l`exploiter dans les m&#234;mes conditions de s&#233;curit&#233;. Ce contrat peut &#234;tre reproduit et diffus&#233; librement, sous r&#233;serve de le conserver en l`&#233;tat, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s`appliquer &#224; tout logiciel dont le titulaire des droits patrimoniaux d&#233;cide de soumettre l`exploitation aux dispositions qu`il contient.
+
+Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu`ils seront &#233;crits avec une lettre capitale, auront la signification suivante:
+
+Contrat: d&#233;signe le pr&#233;sent contrat de licence, ses &#233;ventuelles versions post&#233;rieures et annexes.
+
+Logiciel: d&#233;signe le logiciel sous sa forme de Code Objet et/ou de Code Source et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de l`acceptation du Contrat par le Licenci&#233;.
+
+Logiciel Initial: d&#233;signe le Logiciel sous sa forme de Code Source et &#233;ventuellement de Code Objet et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de leur premi&#232;re diffusion sous les termes du Contrat.
+
+Logiciel Modifi&#233;: d&#233;signe le Logiciel modifi&#233; par au moins une Contribution.
+
+Code Source: d&#233;signe l`ensemble des instructions et des lignes de programme du Logiciel et auquel l`acc&#232;s est n&#233;cessaire en vue de modifier le Logiciel.
+
+Code Objet: d&#233;signe les fichiers binaires issus de la compilation du Code Source.
+
+Titulaire: d&#233;signe le ou les d&#233;tenteurs des droits patrimoniaux d`auteur sur le Logiciel Initial.
+
+Licenci&#233;: d&#233;signe le ou les utilisateurs du Logiciel ayant accept&#233; le Contrat.
+
+Contributeur: d&#233;signe le Licenci&#233; auteur d`au moins une Contribution.
+
+Conc&#233;dant: d&#233;signe le Titulaire ou toute personne physique ou morale distribuant le Logiciel sous le Contrat.
+
+Contribution: d&#233;signe l`ensemble des modifications, corrections, traductions, adaptations et/ou nouvelles fonctionnalit&#233;s int&#233;gr&#233;es dans le Logiciel par tout Contributeur, ainsi que tout Module Interne.
+
+Module: d&#233;signe un ensemble de fichiers sources y compris leur documentation qui permet de r&#233;aliser des fonctionnalit&#233;s ou services suppl&#233;mentaires &#224; ceux fournis par le Logiciel.
+
+Module Externe: d&#233;signe tout Module, non d&#233;riv&#233; du Logiciel, tel que ce Module et le Logiciel s`ex&#233;cutent dans des espaces d`adressage diff&#233;rents, l`un appelant l`autre au moment de leur ex&#233;cution.
+
+Module Interne: d&#233;signe tout Module li&#233; au Logiciel de telle sorte qu`ils s`ex&#233;cutent dans le m&#234;me espace d`adressage.
+
+Parties: d&#233;signe collectivement le Licenci&#233; et le Conc&#233;dant.
+
+Ces termes s`entendent au singulier comme au pluriel.
+
+Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Conc&#233;dant au Licenci&#233; d`une licence non exclusive, cessible et mondiale du Logiciel telle que d&#233;finie ci-apr&#232;s &#224; l`article 5 pour toute la dur&#233;e de protection des droits portant sur ce Logiciel.
+
+Article 3 - ACCEPTATION
+
+3.1 L`acceptation par le Licenci&#233; des termes du Contrat est r&#233;put&#233;e acquise du fait du premier des faits suivants:
+
+(i) le chargement du Logiciel par tout moyen notamment par t&#233;l&#233;chargement &#224; partir d`un serveur distant ou par chargement &#224; partir d`un support physique;
+(ii) le premier exercice par le Licenci&#233; de l`un quelconque des droits conc&#233;d&#233;s par le Contrat.
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement relatif aux sp&#233;cificit&#233;s du Logiciel, &#224; la restriction de garantie et &#224; la limitation &#224; un usage par des utilisateurs exp&#233;riment&#233;s a &#233;t&#233; mis &#224; disposition du Licenci&#233; pr&#233;alablement &#224; son acceptation telle que d&#233;finie &#224; l`article 3.1 ci dessus et le Licenci&#233; reconna&#238;t en avoir pris connaissance.
+
+Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur &#224; la date de son acceptation par le Licenci&#233; telle que d&#233;finie en 3.1.
+
+4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la dur&#233;e l&#233;gale de protection des droits patrimoniaux portant sur le Logiciel.
+
+Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Conc&#233;dant conc&#232;de au Licenci&#233;, qui accepte, les droits suivants sur le Logiciel pour toutes destinations et pour la dur&#233;e du Contrat dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+Par ailleurs, si le Conc&#233;dant d&#233;tient ou venait &#224; d&#233;tenir un ou plusieurs brevets d`invention prot&#233;geant tout ou partie des fonctionnalit&#233;s du Logiciel ou de ses composants, il s`engage &#224; ne pas opposer les &#233;ventuels droits conf&#233;r&#233;s par ces brevets aux Licenci&#233;s successifs qui utiliseraient, exploiteraient ou modifieraient le Logiciel. En cas de cession de ces brevets, le Conc&#233;dant s`engage &#224; faire reprendre les obligations du pr&#233;sent alin&#233;a aux cessionnaires.
+
+5.1 DROIT D`UTILISATION
+
+Le Licenci&#233; est autoris&#233; &#224; utiliser le Logiciel, sans restriction quant aux domaines d`application, &#233;tant ci-apr&#232;s pr&#233;cis&#233; que cela comporte:
+
+la reproduction permanente ou provisoire du Logiciel en tout ou partie par tout moyen et sous toute forme.
+
+le chargement, l`affichage, l`ex&#233;cution, ou le stockage du Logiciel sur tout support.
+
+la possibilit&#233; d`en observer, d`en &#233;tudier, ou d`en tester le fonctionnement afin de d&#233;terminer les id&#233;es et principes qui sont &#224; la base de n`importe quel &#233;l&#233;ment de ce Logiciel; et ceci, lorsque le Licenci&#233; effectue toute op&#233;ration de chargement, d`affichage, d`ex&#233;cution, de transmission ou de stockage du Logiciel qu`il est en droit d`effectuer en vertu du Contrat.
+
+5.2 DROIT D`APPORTER DES CONTRIBUTIONS
+
+Le droit d`apporter des Contributions comporte le droit de traduire, d`adapter, d`arranger ou d`apporter toute autre modification au Logiciel et le droit de reproduire le logiciel en r&#233;sultant.
+
+Le Licenci&#233; est autoris&#233; &#224; apporter toute Contribution au Logiciel sous r&#233;serve de mentionner, de fa&#231;on explicite, son nom en tant qu`auteur de cette Contribution et la date de cr&#233;ation de celle-ci.
+
+5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de transmettre et de communiquer le Logiciel au public sur tout support et par tout moyen ainsi que le droit de mettre sur le march&#233; &#224; titre on&#233;reux ou gratuit, un ou des exemplaires du Logiciel par tout proc&#233;d&#233;.
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies du Logiciel, modifi&#233; ou non, &#224; des tiers dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies conformes du Logiciel, sous forme de Code Source ou de Code Objet, &#224; condition que cette distribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d`un exemplaire du Contrat,
+
+d`un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le Code Objet du Logiciel est redistribu&#233;, le Licenci&#233; permette un acc&#232;s effectif au Code Source complet du Logiciel pendant au moins toute la dur&#233;e de sa distribution du Logiciel, &#233;tant entendu que le co&#251;t additionnel d`acquisition du Code Source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licenci&#233; apporte une Contribution au Logiciel, le Logiciel Modifi&#233; peut &#234;tre distribu&#233; sous un contrat de licence autre que le pr&#233;sent Contrat sous r&#233;serve du respect des dispositions de l`article 5.3.4.
+
+5.3.3 DISTRIBUTION DES MODULES EXTERNES
+
+Lorsque le Licenci&#233; a d&#233;velopp&#233; un Module Externe les conditions du Contrat ne s`appliquent pas &#224; ce Module Externe, qui peut &#234;tre distribu&#233; sous un contrat de licence diff&#233;rent.
+
+5.3.4 CITATIONS
+
+Le Licenci&#233; qui distribue un Logiciel Modifi&#233; s`engage express&#233;ment:
+
+&#224; indiquer dans sa documentation qu`il a &#233;t&#233; r&#233;alis&#233; &#224; partir du Logiciel r&#233;gi par le Contrat, en reproduisant les mentions de propri&#233;t&#233; intellectuelle du Logiciel,
+
+&#224; faire en sorte que l`utilisation du Logiciel, ses mentions de propri&#233;t&#233; intellectuelle et le fait qu`il est r&#233;gi par le Contrat soient indiqu&#233;s dans un texte facilement accessible depuis l`interface du Logiciel Modifi&#233;,
+
+&#224; mentionner, sur un site Web librement accessible d&#233;crivant le Logiciel Modifi&#233;, et pendant au moins toute la dur&#233;e de sa distribution, qu`il a &#233;t&#233; r&#233;alis&#233; &#224; partir du Logiciel r&#233;gi par le Contrat, en reproduisant les mentions de propri&#233;t&#233; intellectuelle du Logiciel,
+
+lorsqu`il le distribue &#224; un tiers susceptible de distribuer lui-m&#234;me un Logiciel Modifi&#233;, sans avoir &#224; en distribuer le code source, &#224; faire ses meilleurs efforts pour que les obligations du pr&#233;sent article 5.3.4 soient reprises par le dit tiers.
+
+Lorsque le Logiciel modifi&#233; ou non est distribu&#233; avec un Module Externe qui a &#233;t&#233; con&#231;u pour l`utiliser, le Licenci&#233; doit soumettre le dit Module Externe aux obligations pr&#233;c&#233;dentes.
+
+5.3.5 COMPATIBILITE AVEC LES LICENCES CeCILL et CeCILL-C
+
+Lorsqu`un Logiciel Modifi&#233; contient une Contribution soumise au contrat de licence CeCILL, les stipulations pr&#233;vues &#224; l`article 5.3.4 sont facultatives.
+
+Un Logiciel Modifi&#233; peut &#234;tre distribu&#233; sous le contrat de licence CeCILL-C. Les stipulations pr&#233;vues &#224; l`article 5.3.4 sont alors facultatives.
+
+Article 6 - PROPRIETE INTELLECTUELLE
+
+6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est d&#233;tenteur des droits patrimoniaux sur le Logiciel Initial. Toute utilisation du Logiciel Initial est soumise au respect des conditions dans lesquelles le Titulaire a choisi de diffuser son oeuvre et nul autre n`a la facult&#233; de modifier les conditions de diffusion de ce Logiciel Initial.
+
+Le Titulaire s`engage &#224; ce que le Logiciel Initial reste au moins r&#233;gi par le Contrat et ce, pour la dur&#233;e vis&#233;e &#224; l`article 4.2.
+
+6.2 SUR LES CONTRIBUTIONS
+
+Le Licenci&#233; qui a d&#233;velopp&#233; une Contribution est titulaire sur celle-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable.
+
+6.3 SUR LES MODULES EXTERNES
+
+Le Licenci&#233; qui a d&#233;velopp&#233; un Module Externe est titulaire sur celui-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable et reste libre du choix du contrat r&#233;gissant sa diffusion.
+
+6.4 DISPOSITIONS COMMUNES
+
+Le Licenci&#233; s`engage express&#233;ment:
+
+&#224; ne pas supprimer ou modifier de quelque mani&#232;re que ce soit les mentions de propri&#233;t&#233; intellectuelle appos&#233;es sur le Logiciel;
+
+&#224; reproduire &#224; l`identique lesdites mentions de propri&#233;t&#233; intellectuelle sur les copies du Logiciel modifi&#233; ou non.
+
+Le Licenci&#233; s`engage &#224; ne pas porter atteinte, directement ou indirectement, aux droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs sur le Logiciel et &#224; prendre, le cas &#233;ch&#233;ant, &#224; l`&#233;gard de son personnel toutes les mesures n&#233;cessaires pour assurer le respect des dits droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs.
+
+Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n`oblige en aucun cas le Conc&#233;dant &#224; la r&#233;alisation de prestations d`assistance technique ou de maintenance du Logiciel.
+
+Cependant le Conc&#233;dant reste libre de proposer ce type de services. Les termes et conditions d`une telle assistance technique et/ou d`une telle maintenance seront alors d&#233;termin&#233;s dans un acte s&#233;par&#233;. Ces actes de maintenance et/ou assistance technique n`engageront que la seule responsabilit&#233; du Conc&#233;dant qui les propose.
+
+7.2 De m&#234;me, tout Conc&#233;dant est libre de proposer, sous sa seule responsabilit&#233;, &#224; ses licenci&#233;s une garantie, qui n`engagera que lui, lors de la redistribution du Logiciel et/ou du Logiciel Modifi&#233; et ce, dans les conditions qu`il souhaite. Cette garantie et les modalit&#233;s financi&#232;res de son application feront l`objet d`un acte s&#233;par&#233; entre le Conc&#233;dant et le Licenci&#233;.
+
+Article 8 - RESPONSABILITE
+
+8.1 Sous r&#233;serve des dispositions de l`article 8.2, le Licenci&#233; a la facult&#233;, sous r&#233;serve de prouver la faute du Conc&#233;dant concern&#233;, de solliciter la r&#233;paration du pr&#233;judice direct qu`il subirait du fait du Logiciel et dont il apportera la preuve.
+
+8.2 La responsabilit&#233; du Conc&#233;dant est limit&#233;e aux engagements pris en application du Contrat et ne saurait &#234;tre engag&#233;e en raison notamment: (i) des dommages dus &#224; l`inex&#233;cution, totale ou partielle, de ses obligations par le Licenci&#233;, (ii) des dommages directs ou indirects d&#233;coulant de l`utilisation ou des performances du Logiciel subis par le Licenci&#233; et (iii) plus g&#233;n&#233;ralement d`un quelconque dommage indirect. En particulier, les Parties conviennent express&#233;ment que tout pr&#233;judice financier ou commercial (par exemple perte de donn&#233;es, perte de b&#233;n&#233;fices, perte d`exploitation, perte de client&#232;le ou de commandes, manque &#224; gagner, trouble commercial quelconque) ou toute action dirig&#233;e contre le Licenci&#233; par un tiers, constitue un dommage indirect et n`ouvre pas droit &#224; r&#233;paration par le Conc&#233;dant.
+
+Article 9 - GARANTIE
+
+9.1 Le Licenci&#233; reconna&#238;t que l`&#233;tat actuel des connaissances scientifiques et techniques au moment de la mise en circulation du Logiciel ne permet pas d`en tester et d`en v&#233;rifier toutes les utilisations ni de d&#233;tecter l`existence d`&#233;ventuels d&#233;fauts. L`attention du Licenci&#233; a &#233;t&#233; attir&#233;e sur ce point sur les risques associ&#233;s au chargement, &#224; l`utilisation, la modification et/ou au d&#233;veloppement et &#224; la reproduction du Logiciel qui sont r&#233;serv&#233;s &#224; des utilisateurs avertis.
+
+Il rel&#232;ve de la responsabilit&#233; du Licenci&#233; de contr&#244;ler, par tous moyens, l`ad&#233;quation du produit &#224; ses besoins, son bon fonctionnement et de s`assurer qu`il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Conc&#233;dant d&#233;clare de bonne foi &#234;tre en droit de conc&#233;der l`ensemble des droits attach&#233;s au Logiciel (comprenant notamment les droits vis&#233;s &#224; l`article 5).
+
+9.3 Le Licenci&#233; reconna&#238;t que le Logiciel est fourni "en l`&#233;tat" par le Conc&#233;dant sans autre garantie, expresse ou tacite, que celle pr&#233;vue &#224; l`article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, son caract&#232;re s&#233;curis&#233;, innovant ou pertinent.
+
+En particulier, le Conc&#233;dant ne garantit pas que le Logiciel est exempt d`erreur, qu`il fonctionnera sans interruption, qu`il sera compatible avec l`&#233;quipement du Licenci&#233; et sa configuration logicielle ni qu`il remplira les besoins du Licenci&#233;.
+
+9.4 Le Conc&#233;dant ne garantit pas, de mani&#232;re expresse ou tacite, que le Logiciel ne porte pas atteinte &#224; un quelconque droit de propri&#233;t&#233; intellectuelle d`un tiers portant sur un brevet, un logiciel ou sur tout autre droit de propri&#233;t&#233;. Ainsi, le Conc&#233;dant exclut toute garantie au profit du Licenci&#233; contre les actions en contrefa&#231;on qui pourraient &#234;tre diligent&#233;es au titre de l`utilisation, de la modification, et de la redistribution du Logiciel. N&#233;anmoins, si de telles actions sont exerc&#233;es contre le Licenci&#233;, le Conc&#233;dant lui apportera son aide technique et juridique pour sa d&#233;fense. Cette aide technique et juridique est d&#233;termin&#233;e au cas par cas entre le Conc&#233;dant concern&#233; et le Licenci&#233; dans le cadre d`un protocole d`accord. Le Conc&#233;dant d&#233;gage toute responsabilit&#233; quant &#224; l`utilisation de la d&#233;nomination du Logiciel par le Licenci&#233;. Aucune garantie n`est apport&#233;e quant &#224; l`existence de droits ant&#233;rieurs sur le nom du Logiciel et sur l`existence d`une marque.
+
+Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licenci&#233; aux obligations mises &#224; sa charge par le Contrat, le Conc&#233;dant pourra r&#233;silier de plein droit le Contrat trente (30) jours apr&#232;s notification adress&#233;e au Licenci&#233; et rest&#233;e sans effet.
+
+10.2 Le Licenci&#233; dont le Contrat est r&#233;sili&#233; n`est plus autoris&#233; &#224; utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les licences qu`il aura conc&#233;d&#233;es ant&#233;rieurement &#224; la r&#233;siliation du Contrat resteront valides sous r&#233;serve qu`elles aient &#233;t&#233; effectu&#233;es en conformit&#233; avec le Contrat.
+
+Article 11 - DISPOSITIONS DIVERSES
+
+11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d`un retard ou d`une d&#233;faillance d`ex&#233;cution du Contrat qui serait d&#251; &#224; un cas de force majeure, un cas fortuit ou une cause ext&#233;rieure, telle que, notamment, le mauvais fonctionnement ou les interruptions du r&#233;seau &#233;lectrique ou de t&#233;l&#233;communication, la paralysie du r&#233;seau li&#233;e &#224; une attaque informatique, l`intervention des autorit&#233;s gouvernementales, les catastrophes naturelles, les d&#233;g&#226;ts des eaux, les tremblements de terre, le feu, les explosions, les gr&#232;ves et les conflits sociaux, l`&#233;tat de guerre...
+
+11.2 Le fait, par l`une ou l`autre des Parties, d`omettre en une ou plusieurs occasions de se pr&#233;valoir d`une ou plusieurs dispositions du Contrat, ne pourra en aucun cas impliquer renonciation par la Partie int&#233;ress&#233;e &#224; s`en pr&#233;valoir ult&#233;rieurement.
+
+11.3 Le Contrat annule et remplace toute convention ant&#233;rieure, &#233;crite ou orale, entre les Parties sur le m&#234;me objet et constitue l`accord entier entre les Parties sur cet objet. Aucune addition ou modification aux termes du Contrat n`aura d`effet &#224; l`&#233;gard des Parties &#224; moins d`&#234;tre faite par &#233;crit et sign&#233;e par leurs repr&#233;sentants d&#251;ment habilit&#233;s.
+
+11.4 Dans l`hypoth&#232;se o&#249; une ou plusieurs des dispositions du Contrat s`av&#232;rerait contraire &#224; une loi ou &#224; un texte applicable, existants ou futurs, cette loi ou ce texte pr&#233;vaudrait, et les Parties feraient les amendements n&#233;cessaires pour se conformer &#224; cette loi ou &#224; ce texte. Toutes les autres dispositions resteront en vigueur. De m&#234;me, la nullit&#233;, pour quelque raison que ce soit, d`une des dispositions du Contrat ne saurait entra&#238;ner la nullit&#233; de l`ensemble du Contrat.
+
+11.5 LANGUE
+
+Le Contrat est r&#233;dig&#233; en langue fran&#231;aise et en langue anglaise, ces deux versions faisant &#233;galement foi.
+
+Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autoris&#233;e &#224; copier et distribuer des copies de ce Contrat.
+
+12.2 Afin d`en pr&#233;server la coh&#233;rence, le texte du Contrat est prot&#233;g&#233; et ne peut &#234;tre modifi&#233; que par les auteurs de la licence, lesquels se r&#233;servent le droit de publier p&#233;riodiquement des mises &#224; jour ou de nouvelles versions du Contrat, qui poss&#233;deront chacune un num&#233;ro distinct. Ces versions ult&#233;rieures seront susceptibles de prendre en compte de nouvelles probl&#233;matiques rencontr&#233;es par les logiciels libres.
+
+12.3 Tout Logiciel diffus&#233; sous une version donn&#233;e du Contrat ne pourra faire l`objet d`une diffusion ult&#233;rieure que sous la m&#234;me version du Contrat ou une version post&#233;rieure.
+
+Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est r&#233;gi par la loi fran&#231;aise. Les Parties conviennent de tenter de r&#233;gler &#224; l`amiable les diff&#233;rends ou litiges qui viendraient &#224; se produire par suite ou &#224; l`occasion du Contrat.
+
+13.2 A d&#233;faut d`accord amiable dans un d&#233;lai de deux (2) mois &#224; compter de leur survenance et sauf situation relevant d`une proc&#233;dure d`urgence, les diff&#233;rends ou litiges seront port&#233;s par la Partie la plus diligente devant les Tribunaux comp&#233;tents de Paris.
+
+1 CeCILL est pour Ce(a) C(nrs) I(nria) L(ogiciel) L(ibre)
+
+Version 1.0 du 2006-09-05.
+
diff --git a/meta/files/common-licenses/CECILL-C b/meta/files/common-licenses/CECILL-C
new file mode 100644
index 0000000..7e8ef86
--- /dev/null
+++ b/meta/files/common-licenses/CECILL-C
@@ -0,0 +1,241 @@
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-C
+
+Avertissement
+
+Ce contrat est une licence de logiciel libre issue d`une concertation entre ses auteurs afin que le respect de deux grands principes pr&#233;side &#224; sa r&#233;daction:
+
+d`une part, le respect des principes de diffusion des logiciels libres: acc&#232;s au code source, droits &#233;tendus conf&#233;r&#233;s aux utilisateurs,
+d`autre part, la d&#233;signation d`un droit applicable, le droit fran&#231;ais, auquel elle est conforme, tant au regard du droit de la responsabilit&#233; civile que du droit de la propri&#233;t&#233; intellectuelle et de la protection qu`il offre aux auteurs et titulaires des droits patrimoniaux sur un logiciel.
+Les auteurs de la licence CeCILL-C1 sont:
+
+Commissariat &#224; l`Energie Atomique - CEA, &#233;tablissement public de recherche &#224; caract&#232;re scientifique, technique et industriel, dont le si&#232;ge est situ&#233; 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
+
+Centre National de la Recherche Scientifique - CNRS, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; 3 rue Michel-Ange, 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique - INRIA, &#233;tablissement public &#224; caract&#232;re scientifique et technologique, dont le si&#232;ge est situ&#233; Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex.
+
+Pr&#233;ambule
+
+Ce contrat est une licence de logiciel libre dont l`objectif est de conf&#233;rer aux utilisateurs la libert&#233; de modifier et de r&#233;utiliser le logiciel r&#233;gi par cette licence.
+
+L`exercice de cette libert&#233; est assorti d`une obligation de remettre &#224; la disposition de la communaut&#233; les modifications apport&#233;es au code source du logiciel afin de contribuer &#224; son &#233;volution.
+
+L`accessibilit&#233; au code source et les droits de copie, de modification et de redistribution qui d&#233;coulent de ce contrat ont pour contrepartie de n`offrir aux utilisateurs qu`une garantie limit&#233;e et de ne faire peser sur l`auteur du logiciel, le titulaire des droits patrimoniaux et les conc&#233;dants successifs qu`une responsabilit&#233; restreinte.
+
+A cet &#233;gard l`attention de l`utilisateur est attir&#233;e sur les risques associ&#233;s au chargement, &#224; l`utilisation, &#224; la modification et/ou au d&#233;veloppement et &#224; la reproduction du logiciel par l`utilisateur &#233;tant donn&#233; sa sp&#233;cificit&#233; de logiciel libre, qui peut le rendre complexe &#224; manipuler et qui le r&#233;serve donc &#224; des d&#233;veloppeurs ou des professionnels avertis poss&#233;dant des connaissances informatiques approfondies. Les utilisateurs sont donc invit&#233;s &#224; charger et tester l`ad&#233;quation du logiciel &#224; leurs besoins dans des conditions permettant d`assurer la s&#233;curit&#233; de leurs syst&#232;mes et/ou de leurs donn&#233;es et, plus g&#233;n&#233;ralement, &#224; l`utiliser et l`exploiter dans les m&#234;mes conditions de s&#233;curit&#233;. Ce contrat peut &#234;tre reproduit et diffus&#233; librement, sous r&#233;serve de le conserver en l`&#233;tat, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s`appliquer &#224; tout logiciel dont le titulaire des droits patrimoniaux d&#233;cide de soumettre l`exploitation aux dispositions qu`il contient.
+
+Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu`ils seront &#233;crits avec une lettre capitale, auront la signification suivante:
+
+Contrat: d&#233;signe le pr&#233;sent contrat de licence, ses &#233;ventuelles versions post&#233;rieures et annexes.
+
+Logiciel: d&#233;signe le logiciel sous sa forme de Code Objet et/ou de Code Source et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de l`acceptation du Contrat par le Licenci&#233;.
+
+Logiciel Initial: d&#233;signe le Logiciel sous sa forme de Code Source et &#233;ventuellement de Code Objet et le cas &#233;ch&#233;ant sa documentation, dans leur &#233;tat au moment de leur premi&#232;re diffusion sous les termes du Contrat.
+
+Logiciel Modifi&#233;: d&#233;signe le Logiciel modifi&#233; par au moins une Contribution Int&#233;gr&#233;e.
+
+Code Source: d&#233;signe l`ensemble des instructions et des lignes de programme du Logiciel et auquel l`acc&#232;s est n&#233;cessaire en vue de modifier le Logiciel.
+
+Code Objet: d&#233;signe les fichiers binaires issus de la compilation du Code Source.
+
+Titulaire: d&#233;signe le ou les d&#233;tenteurs des droits patrimoniaux d`auteur sur le Logiciel Initial.
+
+Licenci&#233;: d&#233;signe le ou les utilisateurs du Logiciel ayant accept&#233; le Contrat.
+
+Contributeur: d&#233;signe le Licenci&#233; auteur d`au moins une Contribution Int&#233;gr&#233;e.
+
+Conc&#233;dant: d&#233;signe le Titulaire ou toute personne physique ou morale distribuant le Logiciel sous le Contrat.
+
+Contribution Int&#233;gr&#233;e: d&#233;signe l`ensemble des modifications, corrections, traductions, adaptations et/ou nouvelles fonctionnalit&#233;s int&#233;gr&#233;es dans le Code Source par tout Contributeur.
+
+Module Li&#233;: d&#233;signe un ensemble de fichiers sources y compris leur documentation qui, sans modification du Code Source, permet de r&#233;aliser des fonctionnalit&#233;s ou services suppl&#233;mentaires &#224; ceux fournis par le Logiciel.
+
+Logiciel D&#233;riv&#233;: d&#233;signe toute combinaison du Logiciel, modifi&#233; ou non, et d`un Module Li&#233;.
+
+Parties: d&#233;signe collectivement le Licenci&#233; et le Conc&#233;dant.
+
+Ces termes s`entendent au singulier comme au pluriel.
+
+Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Conc&#233;dant au Licenci&#233; d`une licence non exclusive, cessible et mondiale du Logiciel telle que d&#233;finie ci-apr&#232;s &#224; l`article 5 pour toute la dur&#233;e de protection des droits portant sur ce Logiciel.
+
+Article 3 - ACCEPTATION
+
+3.1 L`acceptation par le Licenci&#233; des termes du Contrat est r&#233;put&#233;e acquise du fait du premier des faits suivants:
+
+(i) le chargement du Logiciel par tout moyen notamment par t&#233;l&#233;chargement &#224; partir d`un serveur distant ou par chargement &#224; partir d`un support physique;
+(ii) le premier exercice par le Licenci&#233; de l`un quelconque des droits conc&#233;d&#233;s par le Contrat.
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement relatif aux sp&#233;cificit&#233;s du Logiciel, &#224; la restriction de garantie et &#224; la limitation &#224; un usage par des utilisateurs exp&#233;riment&#233;s a &#233;t&#233; mis &#224; disposition du Licenci&#233; pr&#233;alablement &#224; son acceptation telle que d&#233;finie &#224; l`article 3.1 ci dessus et le Licenci&#233; reconna&#238;t en avoir pris connaissance.
+
+Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur &#224; la date de son acceptation par le Licenci&#233; telle que d&#233;finie en 3.1.
+
+4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la dur&#233;e l&#233;gale de protection des droits patrimoniaux portant sur le Logiciel.
+
+Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Conc&#233;dant conc&#232;de au Licenci&#233;, qui accepte, les droits suivants sur le Logiciel pour toutes destinations et pour la dur&#233;e du Contrat dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+Par ailleurs, si le Conc&#233;dant d&#233;tient ou venait &#224; d&#233;tenir un ou plusieurs brevets d`invention prot&#233;geant tout ou partie des fonctionnalit&#233;s du Logiciel ou de ses composants, il s`engage &#224; ne pas opposer les &#233;ventuels droits conf&#233;r&#233;s par ces brevets aux Licenci&#233;s successifs qui utiliseraient, exploiteraient ou modifieraient le Logiciel. En cas de cession de ces brevets, le Conc&#233;dant s`engage &#224; faire reprendre les obligations du pr&#233;sent alin&#233;a aux cessionnaires.
+
+5.1 DROIT D`UTILISATION
+
+Le Licenci&#233; est autoris&#233; &#224; utiliser le Logiciel, sans restriction quant aux domaines d`application, &#233;tant ci-apr&#232;s pr&#233;cis&#233; que cela comporte:
+
+la reproduction permanente ou provisoire du Logiciel en tout ou partie par tout moyen et sous toute forme.
+
+le chargement, l`affichage, l`ex&#233;cution, ou le stockage du Logiciel sur tout support.
+
+la possibilit&#233; d`en observer, d`en &#233;tudier, ou d`en tester le fonctionnement afin de d&#233;terminer les id&#233;es et principes qui sont &#224; la base de n`importe quel &#233;l&#233;ment de ce Logiciel; et ceci, lorsque le Licenci&#233; effectue toute op&#233;ration de chargement, d`affichage, d`ex&#233;cution, de transmission ou de stockage du Logiciel qu`il est en droit d`effectuer en vertu du Contrat.
+
+5.2 DROIT DE MODIFICATION
+
+Le droit de modification comporte le droit de traduire, d`adapter, d`arranger ou d`apporter toute autre modification au Logiciel et le droit de reproduire le logiciel en r&#233;sultant. Il comprend en particulier le droit de cr&#233;er un Logiciel D&#233;riv&#233;.
+
+Le Licenci&#233; est autoris&#233; &#224; apporter toute modification au Logiciel sous r&#233;serve de mentionner, de fa&#231;on explicite, son nom en tant qu`auteur de cette modification et la date de cr&#233;ation de celle-ci.
+
+5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de transmettre et de communiquer le Logiciel au public sur tout support et par tout moyen ainsi que le droit de mettre sur le march&#233; &#224; titre on&#233;reux ou gratuit, un ou des exemplaires du Logiciel par tout proc&#233;d&#233;.
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies du Logiciel, modifi&#233; ou non, &#224; des tiers dans les conditions ci-apr&#232;s d&#233;taill&#233;es.
+
+5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer des copies conformes du Logiciel, sous forme de Code Source ou de Code Objet, &#224; condition que cette distribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d`un exemplaire du Contrat,
+
+d`un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le Code Objet du Logiciel est redistribu&#233;, le Licenci&#233; permette un acc&#232;s effectif au Code Source complet du Logiciel pendant au moins toute la dur&#233;e de sa distribution du Logiciel, &#233;tant entendu que le co&#251;t additionnel d`acquisition du Code Source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licenci&#233; apporte une Contribution Int&#233;gr&#233;e au Logiciel, les conditions de distribution du Logiciel Modifi&#233; en r&#233;sultant sont alors soumises &#224; l`int&#233;gralit&#233; des dispositions du Contrat.
+
+Le Licenci&#233; est autoris&#233; &#224; distribuer le Logiciel Modifi&#233; sous forme de code source ou de code objet, &#224; condition que cette distribution respecte les dispositions du Contrat dans leur totalit&#233; et soit accompagn&#233;e:
+
+d`un exemplaire du Contrat,
+
+d`un avertissement relatif &#224; la restriction de garantie et de responsabilit&#233; du Conc&#233;dant telle que pr&#233;vue aux articles 8 et 9,
+
+et que, dans le cas o&#249; seul le code objet du Logiciel Modifi&#233; est redistribu&#233;, le Licenci&#233; permette un acc&#232;s effectif &#224; son code source complet pendant au moins toute la dur&#233;e de sa distribution du Logiciel Modifi&#233;, &#233;tant entendu que le co&#251;t additionnel d`acquisition du code source ne devra pas exc&#233;der le simple co&#251;t de transfert des donn&#233;es.
+
+5.3.3 DISTRIBUTION DU LOGICIEL DERIVE
+
+Lorsque le Licenci&#233; cr&#233;e un Logiciel D&#233;riv&#233;, ce Logiciel D&#233;riv&#233; peut &#234;tre distribu&#233; sous un contrat de licence autre que le pr&#233;sent Contrat &#224; condition de respecter les obligations de mention des droits sur le Logiciel telles que d&#233;finies &#224; l`article 6.4. Dans le cas o&#249; la cr&#233;ation du Logiciel D&#233;riv&#233; a n&#233;cessit&#233; une modification du Code Source le licenci&#233; s`engage &#224; ce que:
+
+le Logiciel Modifi&#233; correspondant &#224; cette modification soit r&#233;gi par le pr&#233;sent Contrat,
+les Contributions Int&#233;gr&#233;es dont le Logiciel Modifi&#233; r&#233;sulte soient clairement identifi&#233;es et document&#233;es,
+le Licenci&#233; permette un acc&#232;s effectif au code source du Logiciel Modifi&#233;, pendant au moins toute la dur&#233;e de la distribution du Logiciel D&#233;riv&#233;, de telle sorte que ces modifications puissent &#234;tre reprises dans une version ult&#233;rieure du Logiciel, &#233;tant entendu que le co&#251;t additionnel d`acquisition du code source du Logiciel Modifi&#233; ne devra pas exc&#233;der le simple co&#251;t du transfert des donn&#233;es.
+5.3.4 COMPATIBILITE AVEC LA LICENCE CeCILL
+
+Lorsqu`un Logiciel Modifi&#233; contient une Contribution Int&#233;gr&#233;e soumise au contrat de licence CeCILL, ou lorsqu`un Logiciel D&#233;riv&#233; contient un Module Li&#233; soumis au contrat de licence CeCILL, les stipulations pr&#233;vues au troisi&#232;me item de l`article 6.4 sont facultatives.
+
+Article 6 - PROPRIETE INTELLECTUELLE
+
+6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est d&#233;tenteur des droits patrimoniaux sur le Logiciel Initial. Toute utilisation du Logiciel Initial est soumise au respect des conditions dans lesquelles le Titulaire a choisi de diffuser son oeuvre et nul autre n`a la facult&#233; de modifier les conditions de diffusion de ce Logiciel Initial.
+
+Le Titulaire s`engage &#224; ce que le Logiciel Initial reste au moins r&#233;gi par le Contrat et ce, pour la dur&#233;e vis&#233;e &#224; l`article 4.2.
+
+6.2 SUR LES CONTRIBUTIONS INTEGREES
+
+Le Licenci&#233; qui a d&#233;velopp&#233; une Contribution Int&#233;gr&#233;e est titulaire sur celle-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable.
+
+6.3 SUR LES MODULES LIES
+
+Le Licenci&#233; qui a d&#233;velopp&#233; un Module Li&#233; est titulaire sur celui-ci des droits de propri&#233;t&#233; intellectuelle dans les conditions d&#233;finies par la l&#233;gislation applicable et reste libre du choix du contrat r&#233;gissant sa diffusion dans les conditions d&#233;finies &#224; l`article 5.3.3.
+
+6.4 MENTIONS DES DROITS
+
+Le Licenci&#233; s`engage express&#233;ment:
+
+&#224; ne pas supprimer ou modifier de quelque mani&#232;re que ce soit les mentions de propri&#233;t&#233; intellectuelle appos&#233;es sur le Logiciel;
+
+&#224; reproduire &#224; l`identique lesdites mentions de propri&#233;t&#233; intellectuelle sur les copies du Logiciel modifi&#233; ou non;
+
+&#224; faire en sorte que l`utilisation du Logiciel, ses mentions de propri&#233;t&#233; intellectuelle et le fait qu`il est r&#233;gi par le Contrat soient indiqu&#233;s dans un texte facilement accessible notamment depuis l`interface de tout Logiciel D&#233;riv&#233;.
+Le Licenci&#233; s`engage &#224; ne pas porter atteinte, directement ou indirectement, aux droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs sur le Logiciel et &#224; prendre, le cas &#233;ch&#233;ant, &#224; l`&#233;gard de son personnel toutes les mesures n&#233;cessaires pour assurer le respect des dits droits de propri&#233;t&#233; intellectuelle du Titulaire et/ou des Contributeurs.
+
+Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n`oblige en aucun cas le Conc&#233;dant &#224; la r&#233;alisation de prestations d`assistance technique ou de maintenance du Logiciel.
+
+Cependant le Conc&#233;dant reste libre de proposer ce type de services. Les termes et conditions d`une telle assistance technique et/ou d`une telle maintenance seront alors d&#233;termin&#233;s dans un acte s&#233;par&#233;. Ces actes de maintenance et/ou assistance technique n`engageront que la seule responsabilit&#233; du Conc&#233;dant qui les propose.
+
+7.2 De m&#234;me, tout Conc&#233;dant est libre de proposer, sous sa seule responsabilit&#233;, &#224; ses licenci&#233;s une garantie, qui n`engagera que lui, lors de la redistribution du Logiciel et/ou du Logiciel Modifi&#233; et ce, dans les conditions qu`il souhaite. Cette garantie et les modalit&#233;s financi&#232;res de son application feront l`objet d`un acte s&#233;par&#233; entre le Conc&#233;dant et le Licenci&#233;.
+
+Article 8 - RESPONSABILITE
+
+8.1 Sous r&#233;serve des dispositions de l`article 8.2, le Licenci&#233; a la facult&#233;, sous r&#233;serve de prouver la faute du Conc&#233;dant concern&#233;, de solliciter la r&#233;paration du pr&#233;judice direct qu`il subirait du fait du Logiciel et dont il apportera la preuve.
+
+8.2 La responsabilit&#233; du Conc&#233;dant est limit&#233;e aux engagements pris en application du Contrat et ne saurait &#234;tre engag&#233;e en raison notamment: (i) des dommages dus &#224; l`inex&#233;cution, totale ou partielle, de ses obligations par le Licenci&#233;, (ii) des dommages directs ou indirects d&#233;coulant de l`utilisation ou des performances du Logiciel subis par le Licenci&#233; et (iii) plus g&#233;n&#233;ralement d`un quelconque dommage indirect. En particulier, les Parties conviennent express&#233;ment que tout pr&#233;judice financier ou commercial (par exemple perte de donn&#233;es, perte de b&#233;n&#233;fices, perte d`exploitation, perte de client&#232;le ou de commandes, manque &#224; gagner, trouble commercial quelconque) ou toute action dirig&#233;e contre le Licenci&#233; par un tiers, constitue un dommage indirect et n`ouvre pas droit &#224; r&#233;paration par le Conc&#233;dant.
+
+Article 9 - GARANTIE
+
+9.1 Le Licenci&#233; reconna&#238;t que l`&#233;tat actuel des connaissances scientifiques et techniques au moment de la mise en circulation du Logiciel ne permet pas d`en tester et d`en v&#233;rifier toutes les utilisations ni de d&#233;tecter l`existence d`&#233;ventuels d&#233;fauts. L`attention du Licenci&#233; a &#233;t&#233; attir&#233;e sur ce point sur les risques associ&#233;s au chargement, &#224; l`utilisation, la modification et/ou au d&#233;veloppement et &#224; la reproduction du Logiciel qui sont r&#233;serv&#233;s &#224; des utilisateurs avertis.
+
+Il rel&#232;ve de la responsabilit&#233; du Licenci&#233; de contr&#244;ler, par tous moyens, l`ad&#233;quation du produit &#224; ses besoins, son bon fonctionnement et de s`assurer qu`il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Conc&#233;dant d&#233;clare de bonne foi &#234;tre en droit de conc&#233;der l`ensemble des droits attach&#233;s au Logiciel (comprenant notamment les droits vis&#233;s &#224; l`article 5).
+
+9.3 Le Licenci&#233; reconna&#238;t que le Logiciel est fourni "en l`&#233;tat" par le Conc&#233;dant sans autre garantie, expresse ou tacite, que celle pr&#233;vue &#224; l`article 9.2 et notamment sans aucune garantie sur sa valeur commerciale, son caract&#232;re s&#233;curis&#233;, innovant ou pertinent.
+
+En particulier, le Conc&#233;dant ne garantit pas que le Logiciel est exempt d`erreur, qu`il fonctionnera sans interruption, qu`il sera compatible avec l`&#233;quipement du Licenci&#233; et sa configuration logicielle ni qu`il remplira les besoins du Licenci&#233;.
+
+9.4 Le Conc&#233;dant ne garantit pas, de mani&#232;re expresse ou tacite, que le Logiciel ne porte pas atteinte &#224; un quelconque droit de propri&#233;t&#233; intellectuelle d`un tiers portant sur un brevet, un logiciel ou sur tout autre droit de propri&#233;t&#233;. Ainsi, le Conc&#233;dant exclut toute garantie au profit du Licenci&#233; contre les actions en contrefa&#231;on qui pourraient &#234;tre diligent&#233;es au titre de l`utilisation, de la modification, et de la redistribution du Logiciel. N&#233;anmoins, si de telles actions sont exerc&#233;es contre le Licenci&#233;, le Conc&#233;dant lui apportera son aide technique et juridique pour sa d&#233;fense. Cette aide technique et juridique est d&#233;termin&#233;e au cas par cas entre le Conc&#233;dant concern&#233; et le Licenci&#233; dans le cadre d`un protocole d`accord. Le Conc&#233;dant d&#233;gage toute responsabilit&#233; quant &#224; l`utilisation de la d&#233;nomination du Logiciel par le Licenci&#233;. Aucune garantie n`est apport&#233;e quant &#224; l`existence de droits ant&#233;rieurs sur le nom du Logiciel et sur l`existence d`une marque.
+
+Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licenci&#233; aux obligations mises &#224; sa charge par le Contrat, le Conc&#233;dant pourra r&#233;silier de plein droit le Contrat trente (30) jours apr&#232;s notification adress&#233;e au Licenci&#233; et rest&#233;e sans effet.
+
+10.2 Le Licenci&#233; dont le Contrat est r&#233;sili&#233; n`est plus autoris&#233; &#224; utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les licences qu`il aura conc&#233;d&#233;es ant&#233;rieurement &#224; la r&#233;siliation du Contrat resteront valides sous r&#233;serve qu`elles aient &#233;t&#233; effectu&#233;es en conformit&#233; avec le Contrat.
+
+Article 11 - DISPOSITIONS DIVERSES
+
+11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d`un retard ou d`une d&#233;faillance d`ex&#233;cution du Contrat qui serait d&#251; &#224; un cas de force majeure, un cas fortuit ou une cause ext&#233;rieure, telle que, notamment, le mauvais fonctionnement ou les interruptions du r&#233;seau &#233;lectrique ou de t&#233;l&#233;communication, la paralysie du r&#233;seau li&#233;e &#224; une attaque informatique, l`intervention des autorit&#233;s gouvernementales, les catastrophes naturelles, les d&#233;g&#226;ts des eaux, les tremblements de terre, le feu, les explosions, les gr&#232;ves et les conflits sociaux, l`&#233;tat de guerre...
+
+11.2 Le fait, par l`une ou l`autre des Parties, d`omettre en une ou plusieurs occasions de se pr&#233;valoir d`une ou plusieurs dispositions du Contrat, ne pourra en aucun cas impliquer renonciation par la Partie int&#233;ress&#233;e &#224; s`en pr&#233;valoir ult&#233;rieurement.
+
+11.3 Le Contrat annule et remplace toute convention ant&#233;rieure, &#233;crite ou orale, entre les Parties sur le m&#234;me objet et constitue l`accord entier entre les Parties sur cet objet. Aucune addition ou modification aux termes du Contrat n`aura d`effet &#224; l`&#233;gard des Parties &#224; moins d`&#234;tre faite par &#233;crit et sign&#233;e par leurs repr&#233;sentants d&#251;ment habilit&#233;s.
+
+11.4 Dans l`hypoth&#232;se o&#249; une ou plusieurs des dispositions du Contrat s`av&#232;rerait contraire &#224; une loi ou &#224; un texte applicable, existants ou futurs, cette loi ou ce texte pr&#233;vaudrait, et les Parties feraient les amendements n&#233;cessaires pour se conformer &#224; cette loi ou &#224; ce texte. Toutes les autres dispositions resteront en vigueur. De m&#234;me, la nullit&#233;, pour quelque raison que ce soit, d`une des dispositions du Contrat ne saurait entra&#238;ner la nullit&#233; de l`ensemble du Contrat.
+
+11.5 LANGUE
+
+Le Contrat est r&#233;dig&#233; en langue fran&#231;aise et en langue anglaise, ces deux versions faisant &#233;galement foi.
+
+Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autoris&#233;e &#224; copier et distribuer des copies de ce Contrat.
+
+12.2 Afin d`en pr&#233;server la coh&#233;rence, le texte du Contrat est prot&#233;g&#233; et ne peut &#234;tre modifi&#233; que par les auteurs de la licence, lesquels se r&#233;servent le droit de publier p&#233;riodiquement des mises &#224; jour ou de nouvelles versions du Contrat, qui poss&#233;deront chacune un num&#233;ro distinct. Ces versions ult&#233;rieures seront susceptibles de prendre en compte de nouvelles probl&#233;matiques rencontr&#233;es par les logiciels libres.
+
+12.3 Tout Logiciel diffus&#233; sous une version donn&#233;e du Contrat ne pourra faire l`objet d`une diffusion ult&#233;rieure que sous la m&#234;me version du Contrat ou une version post&#233;rieure.
+
+Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est r&#233;gi par la loi fran&#231;aise. Les Parties conviennent de tenter de r&#233;gler &#224; l`amiable les diff&#233;rends ou litiges qui viendraient &#224; se produire par suite ou &#224; l`occasion du Contrat.
+
+13.2 A d&#233;faut d`accord amiable dans un d&#233;lai de deux (2) mois &#224; compter de leur survenance et sauf situation relevant d`une proc&#233;dure d`urgence, les diff&#233;rends ou litiges seront port&#233;s par la Partie la plus diligente devant les Tribunaux comp&#233;tents de Paris.
+
+1 CeCILL est pour Ce(a) C(nrs) I(nria) L(ogiciel) L(ibre)
+
+Version 1.0 du 2006-09-05.
+
diff --git a/meta/files/common-licenses/CPAL-1.0 b/meta/files/common-licenses/CPAL-1.0
new file mode 100644
index 0000000..aafb0e2
--- /dev/null
+++ b/meta/files/common-licenses/CPAL-1.0
@@ -0,0 +1,109 @@
+
+Common Public Attribution License Version 1.0 (CPAL)
+1. &#8220;Definitions&#8221;
+1.0.1 &#8220;Commercial Use&#8221; means distribution or otherwise making the Covered Code available to a third party.
+1.1 &#8220;Contributor&#8221; means each entity that creates or contributes to the creation of Modifications.
+1.2 &#8220;Contributor Version&#8221; means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+1.3 &#8220;Covered Code&#8221; means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+1.4 &#8220;Electronic Distribution Mechanism&#8221; means a mechanism generally accepted in the software development community for the electronic transfer of data.
+1.5 &#8220;Executable&#8221; means Covered Code in any form other than Source Code.
+1.6 &#8220;Initial Developer&#8221; means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+1.7 &#8220;Larger Work&#8221; means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+1.8 &#8220;License&#8221; means this document.
+1.8.1 &#8220;Licensable&#8221; means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+1.9 &#8220;Modifications&#8221; means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+B. Any new file that contains any part of the Original Code or previous Modifications.
+1.10 &#8220;Original Code&#8221; means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+1.10.1 &#8220;Patent Claims&#8221; means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+1.11 &#8220;Source Code&#8221; means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor&#8217;s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+1.12 &#8220;You&#8221; (or &#8220;Your&#8221;) means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, &#8220;You&#8221; includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, &#8220;control&#8221; means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+2. Source Code License.
+2.1 The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+(b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+(c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
+(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
+2.2 Contributor Grant.
+Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
+(d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
+3. Distribution Obligations.
+3.1 Application of License.
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients&#8217; rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+3.2 Availability of Source Code.
+Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+3.3 Description of Modifications.
+You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+3.4 Intellectual Property Matters
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party&#8217;s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled &#8220;LEGAL&#8221; which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+(b) Contributor APIs.
+If Contributor&#8217;s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
+(c) Representations.
+Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor&#8217;s Modifications are Contributor&#8217;s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+3.5 Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients&#8217; rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+3.6 Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients&#8217; rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient&#8217;s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer, Original Developer or any Contributor. You hereby agree to indemnify the Initial Developer, Original Developer and every Contributor for any liability incurred by the Initial Developer, Original Developer or such Contributor as a result of any such terms You offer.
+3.7 Larger Works.
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+5. Application of this License.
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+6. Versions of the License.
+6.1 New Versions.
+Socialtext, Inc. (&#8220;Socialtext&#8221;) may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+6.2 Effect of New Versions.
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Socialtext. No one other than Socialtext has the right to modify the terms applicable to Covered Code created under this License.
+6.3 Derivative Works.
+If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases &#8220;Socialtext&#8221;, &#8220;CPAL&#8221; or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the CPAL. (Filling in the name of the Initial Developer, Original Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+7. DISCLAIMER OF WARRANTY.
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN &#8220;AS IS&#8221; BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER, ORIGINAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+8. TERMINATION.
+8.1 This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+8.2 If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer, Original Developer or a Contributor (the Initial Developer, Original Developer or Contributor against whom You file such action is referred to as &#8220;Participant&#8221;) alleging that:
+(a) such Participant&#8217;s Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+(b) any software, hardware, or device, other than such Participant&#8217;s Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
+8.3 If You assert a patent infringement claim against Participant alleging that such Participant&#8217;s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+8.4 In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+9. LIMITATION OF LIABILITY.
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ORIGINAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY&#8217;S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+10. U.S. GOVERNMENT END USERS.
+The Covered Code is a &#8220;commercial item,&#8221; as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of &#8220;commercial computer software&#8221; and &#8220;commercial computer software documentation,&#8221; as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+11. MISCELLANEOUS.
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys&#8217; fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+12. RESPONSIBILITY FOR CLAIMS.
+As between Initial Developer, Original Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer, Original Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+13. MULTIPLE-LICENSED CODE.
+Initial Developer may designate portions of the Covered Code as Multiple-Licensed. Multiple-Licensed means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the CPAL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
+14. ADDITIONAL TERM: ATTRIBUTION
+(a) As a modest attribution to the organizer of the development of the Original Code (&#8220;Original Developer&#8221;), in the hope that its promotional value may help justify the time, money and effort invested in writing the Original Code, the Original Developer may include in Exhibit B (&#8220;Attribution Information&#8221;) a requirement that each time an Executable and Source Code or a Larger Work is launched or initially run (which includes initiating a session), a prominent display of the Original Developer&#8217;s Attribution Information (as defined below) must occur on the graphic user interface employed by the end user to access such Covered Code (which may include display on a splash screen), if any. The size of the graphic image should be consistent with the size of the other elements of the Attribution Information. If the access by the end user to the Executable and Source Code does not create a graphic user interface for access to the Covered Code, this obligation shall not apply. If the Original Code displays such Attribution Information in a particular form (such as in the form of a splash screen, notice at login, an &#8220;about&#8221; display, or dedicated attribution area on user interface screens), continued use of such form for that Attribution Information is one way of meeting this requirement for notice.
+(b) Attribution information may only include a copyright notice, a brief phrase, graphic image and a URL (&#8220;Attribution Information&#8221;) and is subject to the Attribution Limits as defined below. For these purposes, prominent shall mean display for sufficient duration to give reasonable notice to the user of the identity of the Original Developer and that if You include Attribution Information or similar information for other parties, You must ensure that the Attribution Information for the Original Developer shall be no less prominent than such Attribution Information or similar information for the other party. For greater certainty, the Original Developer may choose to specify in Exhibit B below that the above attribution requirement only applies to an Executable and Source Code resulting from the Original Code or any Modification, but not a Larger Work. The intent is to provide for reasonably modest attribution, therefore the Original Developer cannot require that You display, at any time, more than the following information as Attribution Information: (a) a copyright notice including the name of the Original Developer; (b) a word or one phrase (not exceeding 10 words); (c) one graphic image provided by the Original Developer; and (d) a URL (collectively, the &#8220;Attribution Limits&#8221;).
+(c) If Exhibit B does not include any Attribution Information, then there are no requirements for You to display any Attribution Information of the Original Developer.
+(d) You acknowledge that all trademarks, service marks and/or trade names contained within the Attribution Information distributed with the Covered Code are the exclusive property of their owners and may only be used with the permission of their owners, or under circumstances otherwise permitted by law or as expressly set out in this License.
+15. ADDITIONAL TERM: NETWORK USE.
+The term &#8220;External Deployment&#8221; means the use, distribution, or communication of the Original Code or Modifications in any way such that the Original Code or Modifications may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Code or Modifications as a distribution under section 3.1 and make Source Code available under Section 3.2.
+
+ EXHIBIT A. Common Public Attribution License Version 1.0.
+&#8220;The contents of this file are subject to the Common Public Attribution License Version 1.0 (the &#8220;License&#8221;); you may not use this file except in compliance with the License. You may obtain a copy of the License at _____________. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.
+Software distributed under the License is distributed on an &#8220;AS IS&#8221; basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
+The Original Code is______________________.
+The Original Developer is not the Initial Developer and is __________. If left blank, the Original Developer is the Initial Developer.
+The Initial Developer of the Original Code is ____________. All portions of the code written by ___________ are Copyright (c) _____. All Rights Reserved.
+Contributor ______________________.
+Alternatively, the contents of this file may be used under the terms of the _____ license (the [___] License), in which case the provisions of [______] License are applicable instead of those above.
+If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the CPAL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the [___] License. If you do not delete the provisions above, a recipient may use your version of this file under either the CPAL or the [___] License.&#8221;
+[NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.]
+
+ EXHIBIT B. Attribution Information
+Attribution Copyright Notice: _______________________
+Attribution Phrase (not exceeding 10 words): _______________________
+Attribution URL: _______________________
+Graphic Image as provided in the Covered Code, if any.
+Display of Attribution Information is [required/not required] in Larger Works which are defined in the CPAL as a work which combines Covered Code or portions thereof with code not governed by the terms of the CPAL.
+
diff --git a/meta/files/common-licenses/CPL-1.0 b/meta/files/common-licenses/CPL-1.0
new file mode 100644
index 0000000..517c20f
--- /dev/null
+++ b/meta/files/common-licenses/CPL-1.0
@@ -0,0 +1,215 @@
+
+Common Public License Version 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
+LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
+CONSTITUTES RECIPIENT`S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and
+documentation distributed under this Agreement, and
+
+b) in the case of each subsequent Contributor:
+
+i) changes to the Program, and
+
+ii) additions to the Program;
+
+where such changes and/or additions to the Program originate from and are
+distributed by that particular Contributor. A Contribution `originates` from a
+Contributor if it was added to the Program by such Contributor itself or anyone
+acting on such Contributor`s behalf. Contributions do not include additions to
+the Program which: (i) are separate modules of software distributed in
+conjunction with the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a Contributor which are
+necessarily infringed by the use or sale of its Contribution alone or when
+combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement,
+including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free copyright license to
+reproduce, prepare derivative works of, publicly display, publicly perform,
+distribute and sublicense the Contribution of such Contributor, if any, and such
+derivative works, in source code and object code form.
+
+b) Subject to the terms of this Agreement, each Contributor hereby grants
+Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
+Patents to make, use, sell, offer to sell, import and otherwise transfer the
+Contribution of such Contributor, if any, in source code and object code form.
+This patent license shall apply to the combination of the Contribution and the
+Program if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered by the
+Licensed Patents. The patent license shall not apply to any other combinations
+which include the Contribution. No hardware per se is licensed hereunder.
+
+c) Recipient understands that although each Contributor grants the licenses
+to its Contributions set forth herein, no assurances are provided by any
+Contributor that the Program does not infringe the patent or other intellectual
+property rights of any other entity. Each Contributor disclaims any liability to
+Recipient for claims brought by any other entity based on infringement of
+intellectual property rights or otherwise. As a condition to exercising the
+rights and licenses granted hereunder, each Recipient hereby assumes sole
+responsibility to secure any other intellectual property rights needed, if any.
+For example, if a third party patent license is required to allow Recipient to
+distribute the Program, it is Recipient`s responsibility to acquire that license
+before distributing the Program.
+
+d) Each Contributor represents that to its knowledge it has sufficient
+copyright rights in its Contribution, if any, to grant the copyright license set
+forth in this Agreement.
+
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its
+own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+
+b) its license agreement:
+
+i) effectively disclaims on behalf of all Contributors all warranties and
+conditions, express and implied, including warranties or conditions of title and
+non-infringement, and implied warranties or conditions of merchantability and
+fitness for a particular purpose;
+
+ii) effectively excludes on behalf of all Contributors all liability for
+damages, including direct, indirect, special, incidental and consequential
+damages, such as lost profits;
+
+iii) states that any provisions which differ from this Agreement are offered
+by that Contributor alone and not by any other party; and
+
+iv) states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable manner on or
+through a medium customarily used for software exchange.
+
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+
+b) a copy of this Agreement must be included with each copy of the Program.
+
+Contributors may not remove or alter any copyright notices contained within the
+Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if
+any, in a manner that reasonably allows subsequent Recipients to identify the
+originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with
+respect to end users, business partners and the like. While this license is
+intended to facilitate the commercial use of the Program, the Contributor who
+includes the Program in a commercial product offering should do so in a manner
+which does not create potential liability for other Contributors. Therefore, if
+a Contributor includes the Program in a commercial product offering, such
+Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
+every other Contributor ("Indemnified Contributor") against any losses, damages
+and costs (collectively "Losses") arising from claims, lawsuits and other legal
+actions brought by a third party against the Indemnified Contributor to the
+extent caused by the acts or omissions of such Commercial Contributor in
+connection with its distribution of the Program in a commercial product
+offering. The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement. In order
+to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
+Contributor in writing of such claim, and b) allow the Commercial Contributor to
+control, and cooperate with the Commercial Contributor in, the defense and any
+related settlement negotiations. The Indemnified Contributor may participate in
+any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product
+offering, Product X. That Contributor is then a Commercial Contributor. If that
+Commercial Contributor then makes performance claims, or offers warranties
+related to Product X, those performance claims and warranties are such
+Commercial Contributor`s responsibility alone. Under this section, the
+Commercial Contributor would have to defend claims against the other
+Contributors related to those performance claims and warranties, and if a court
+requires any other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
+IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
+NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
+Recipient is solely responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its exercise of
+rights under this Agreement, including but not limited to the risks and costs of
+program errors, compliance with applicable laws, damage to or loss of data,
+programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
+CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
+PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable
+law, it shall not affect the validity or enforceability of the remainder of the
+terms of this Agreement, and without further action by the parties hereto, such
+provision shall be reformed to the minimum extent necessary to make such
+provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to
+a patent applicable to software (including a cross-claim or counterclaim in a
+lawsuit), then any patent licenses granted by that Contributor to such Recipient
+under this Agreement shall terminate as of the date such litigation is filed. In
+addition, if Recipient institutes patent litigation against any entity
+(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
+itself (excluding combinations of the Program with other software or hardware)
+infringes such Recipient`s patent(s), then such Recipient`s rights granted under
+Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient`s rights under this Agreement shall terminate if it fails to
+comply with any of the material terms or conditions of this Agreement and does
+not cure such failure in a reasonable period of time after becoming aware of
+such noncompliance. If all Recipient`s rights under this Agreement terminate,
+Recipient agrees to cease use and distribution of the Program as soon as
+reasonably practicable. However, Recipient`s obligations under this Agreement
+and any licenses granted by Recipient relating to the Program shall continue and
+survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in
+order to avoid inconsistency the Agreement is copyrighted and may only be
+modified in the following manner. The Agreement Steward reserves the right to
+publish new versions (including revisions) of this Agreement from time to time.
+No one other than the Agreement Steward has the right to modify this Agreement.
+IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
+as the Agreement Steward to a suitable separate entity. Each new version of the
+Agreement will be given a distinguishing version number. The Program (including
+Contributions) may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the Agreement
+is published, Contributor may elect to distribute the Program (including its
+Contributions) under the new version. Except as expressly stated in Sections
+2(a) and 2(b) above, Recipient receives no rights or licenses to the
+intellectual property of any Contributor under this Agreement, whether
+expressly, by implication, estoppel or otherwise. All rights in the Program not
+expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the
+intellectual property laws of the United States of America. No party to this
+Agreement will bring a legal action under this Agreement more than one year
+after the cause of action arose. Each party waives its rights to a jury trial in
+any resulting litigation.
+
diff --git a/meta/files/common-licenses/CUA-OPL-1.0 b/meta/files/common-licenses/CUA-OPL-1.0
new file mode 100644
index 0000000..1ff59eb
--- /dev/null
+++ b/meta/files/common-licenses/CUA-OPL-1.0
@@ -0,0 +1,471 @@
+
+CUA Office Public License Version 1.0
+(plain text)
+1. Definitions.
+
+1.0.1. "Commercial Use" means distribution or otherwise making the
+Covered Code available to a third party.
+
+1.1. "Contributor" means each entity that creates or contributes to
+the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original
+Code, prior Modifications used by a Contributor, and the Modifications
+made by that particular Contributor.
+
+1.3. "Covered Code" means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case
+including portions thereof.
+
+1.4. "Electronic Distribution Mechanism" means a mechanism generally
+accepted in the software development community for the electronic
+transfer of data.
+
+1.5. "Executable" means Covered Code in any form other than Source
+Code.
+
+1.6. "Initial Developer" means the individual or entity identified
+as the Initial Developer in the Source Code notice required by Exhibit
+A.
+
+1.7. "Larger Work" means a work which combines Covered Code or
+portions thereof with code not governed by the terms of this License.
+
+1.8. "License" means this document.
+
+1.8.1. "Licensable" means having the right to grant, to the maximum
+extent possible, whether at the time of the initial grant or
+subsequently acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means any addition to or deletion from the
+substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:
+
+A. Any addition to or deletion from the contents of a file
+containing Original Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or
+previous Modifications.
+
+1.10. "Original Code" means Source Code of computer software code
+which is described in the Source Code notice required by Exhibit A as
+Original Code, and which, at the time of its release under this
+License is not already Covered Code governed by this License.
+
+1.10.1. "Patent Claims" means any patent claim(s), now owned or
+hereafter acquired, including without limitation, method, process,
+and apparatus claims, in any patent Licensable by grantor.
+
+1.11. "Source Code" means the preferred form of the Covered Code for
+making modifications to it, including all modules it contains, plus
+any associated interface definition files, scripts used to control
+compilation and installation of an Executable, or source code
+differential comparisons against either the Original Code or another
+well known, available Covered Code of the Contributor`s choice. The
+Source Code can be in a compressed or archival form, provided the
+appropriate decompression or de-archiving software is widely available
+for no charge.
+
+1.12. "You" (or "Your") means an individual or a legal entity
+exercising rights under, and complying with all of the terms of, this
+License or a future version of this License issued under Section 6.1.
+For legal entities, "You" includes any entity which controls, is
+controlled by, or is under common control with You. For purposes of
+this definition, "control" means (a) the power, direct or indirect,
+to cause the direction or management of such entity, whether by
+contract or otherwise, or (b) ownership of more than fifty percent
+(50%) of the outstanding shares or beneficial ownership of such
+entity.
+
+2. Source Code License.
+
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:
+
+(a) under intellectual property rights (other than patent or
+trademark) Licensable by Initial Developer to use, reproduce,
+modify, display, perform, sublicense and distribute the Original
+Code (or portions thereof) with or without Modifications, and/or
+as part of a Larger Work; and
+
+(b) under Patents Claims infringed by the making, using or
+selling of Original Code, to make, have made, use, practice,
+sell, and offer for sale, and/or otherwise dispose of the
+Original Code (or portions thereof).
+
+(c) the licenses granted in this Section 2.1(a) and (b) are
+effective on the date Initial Developer first distributes
+Original Code under the terms of this License.
+
+(d) Notwithstanding Section 2.1(b) above, no patent license is
+granted: 1) for code that You delete from the Original Code; 2)
+separate from the Original Code; or 3) for infringements caused
+by: i) the modification of the Original Code or ii) the
+combination of the Original Code with other software or devices.
+
+2.2. Contributor Grant.
+Subject to third party intellectual property claims, each Contributor
+hereby grants You a world-wide, royalty-free, non-exclusive license
+
+(a) under intellectual property rights (other than patent or
+trademark) Licensable by Contributor, to use, reproduce, modify,
+display, perform, sublicense and distribute the Modifications
+created by such Contributor (or portions thereof) either on an
+unmodified basis, with other Modifications, as Covered Code
+and/or as part of a Larger Work; and
+
+(b) under Patent Claims infringed by the making, using, or
+selling of Modifications made by that Contributor either alone
+and/or in combination with its Contributor Version (or portions
+of such combination), to make, use, sell, offer for sale, have
+made, and/or otherwise dispose of: 1) Modifications made by that
+Contributor (or portions thereof); and 2) the combination of
+Modifications made by that Contributor with its Contributor
+Version (or portions of such combination).
+
+(c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+effective on the date Contributor first makes Commercial Use of
+the Covered Code.
+
+(d) Notwithstanding Section 2.2(b) above, no patent license is
+granted: 1) for any code that Contributor has deleted from the
+Contributor Version; 2) separate from the Contributor Version;
+3) for infringements caused by: i) third party modifications of
+Contributor Version or ii) the combination of Modifications made
+by that Contributor with other software (except as part of the
+Contributor Version) or other devices; or 4) under Patent Claims
+infringed by Covered Code in the absence of Modifications made by
+that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Application of License.
+The Modifications which You create or to which You contribute are
+governed by the terms of this License, including without limitation
+Section 2.2. The Source Code version of Covered Code may be
+distributed only under the terms of this License or a future version
+of this License released under Section 6.1, and You must include a
+copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code
+version that alters or restricts the applicable version of this
+License or the recipients` rights hereunder. However, You may include
+an additional document offering the additional rights described in
+Section 3.5.
+
+3.2. Availability of Source Code.
+Any Modification which You create or to which You contribute must be
+made available in Source Code form under the terms of this License
+either on the same media as an Executable version or via an accepted
+Electronic Distribution Mechanism to anyone to whom you made an
+Executable version available; and if made available via Electronic
+Distribution Mechanism, must remain available for at least twelve (12)
+months after the date it initially became available, or at least six
+(6) months after a subsequent version of that particular Modification
+has been made available to such recipients. You are responsible for
+ensuring that the Source Code version remains available even if the
+Electronic Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which You contribute to contain a
+file documenting the changes You made to create that Covered Code and
+the date of any change. You must include a prominent statement that
+the Modification is derived, directly or indirectly, from Original
+Code provided by the Initial Developer and including the name of the
+Initial Developer in (a) the Source Code, and (b) in any notice in an
+Executable version or related documentation in which You describe the
+origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party`s
+intellectual property rights is required to exercise the rights
+granted by such Contributor under Sections 2.1 or 2.2,
+Contributor must include a text file with the Source Code
+distribution titled "LEGAL" which describes the claim and the
+party making the claim in sufficient detail that a recipient will
+know whom to contact. If Contributor obtains such knowledge after
+the Modification is made available as described in Section 3.2,
+Contributor shall promptly modify the LEGAL file in all copies
+Contributor makes available thereafter and shall take other steps
+(such as notifying appropriate mailing lists or newsgroups)
+reasonably calculated to inform those who received the Covered
+Code that new knowledge has been obtained.
+
+(b) Contributor APIs.
+
+If Contributor`s Modifications include an application programming
+interface and Contributor has knowledge of patent licenses which
+are reasonably necessary to implement that API, Contributor must
+also include this information in the LEGAL file.
+
+(c) Representations.
+
+Contributor represents that, except as disclosed pursuant to
+Section 3.4(a) above, Contributor believes that Contributor`s
+Modifications are Contributor`s original creation(s) and/or
+Contributor has sufficient rights to grant the rights conveyed by
+this License.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source
+Code. If it is not possible to put such notice in a particular Source
+Code file due to its structure, then You must include such notice in a
+location (such as a relevant directory) where a user would be likely
+to look for such a notice. If You created one or more Modification(s)
+You may add your name as a Contributor to the notice described in
+Exhibit A. You must also duplicate this License in any documentation
+for the Source Code where You describe recipients` rights or ownership
+rights relating to Covered Code. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability
+obligations to one or more recipients of Covered Code. However, You
+may do so only on Your own behalf, and not on behalf of the Initial
+Developer or any Contributor. You must make it absolutely clear than
+any such warranty, support, indemnity or liability obligation is
+offered by You alone, and You hereby agree to indemnify the Initial
+Developer and every Contributor for any liability incurred by the
+Initial Developer or such Contributor as a result of warranty,
+support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the
+requirements of Section 3.1-3.5 have been met for that Covered Code,
+and if You include a notice stating that the Source Code version of
+the Covered Code is available under the terms of this License,
+including a description of how and where You have fulfilled the
+obligations of Section 3.2. The notice must be conspicuously included
+in any notice in an Executable version, related documentation or
+collateral in which You describe recipients` rights relating to the
+Covered Code. You may distribute the Executable version of Covered
+Code or ownership rights under a license of Your choice, which may
+contain terms different from this License, provided that You are in
+compliance with the terms of this License and that the license for the
+Executable version does not attempt to limit or alter the recipient`s
+rights in the Source Code version from the rights set forth in this
+License. If You distribute the Executable version under a different
+license You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial
+Developer or any Contributor. You hereby agree to indemnify the
+Initial Developer and every Contributor for any liability incurred by
+the Initial Developer or such Contributor as a result of any such
+terms You offer.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code
+not governed by the terms of this License and distribute the Larger
+Work as a single product. In such a case, You must make sure the
+requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Code due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description
+must be included in the LEGAL file described in Section 3.4 and must
+be included with all distributions of the Source Code. Except to the
+extent prohibited by statute or regulation, such description must be
+sufficiently detailed for a recipient of ordinary skill to be able to
+understand it.
+
+5. Application of this License.
+
+This License applies to code to which the Initial Developer has
+attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+6.1. New Versions.
+CUA Office Project may publish revised
+and/or new versions of the License from time to time. Each version
+will be given a distinguishing version number.
+
+6.2. Effect of New Versions.
+Once Covered Code has been published under a particular version of the
+License, You may always continue to use it under the terms of that
+version. You may also choose to use such Covered Code under the terms
+of any subsequent version of the License published by CUA Office Project. No one
+other than CUA Office Project has the right to modify the terms applicable to
+Covered Code created under this License.
+
+6.3. Derivative Works.
+If You create or use a modified version of this License (which you may
+only do in order to apply it to code which is not already Covered Code
+governed by this License), You must (a) rename Your license so that
+the phrases "CUA Office", "CUA", "CUAPL", or any confusingly similar phrase do not appear in your
+license (except to note that your license differs from this License)
+and (b) otherwise make it clear that Your version of the license
+contains terms which differ from the CUA Office Public License. (Filling in the name of the Initial
+Developer, Original Code or Contributor in the notice described in
+Exhibit A shall not of themselves be deemed to be modifications of
+this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+8.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. All
+sublicenses to the Covered Code which are properly granted shall
+survive any termination of this License. Provisions which, by their
+nature, must remain in effect beyond the termination of this License
+shall survive.
+
+8.2. If You initiate litigation by asserting a patent infringement
+claim (excluding declatory judgment actions) against Initial Developer
+or a Contributor (the Initial Developer or Contributor against whom
+You file such action is referred to as "Participant") alleging that:
+
+(a) such Participant`s Contributor Version directly or indirectly
+infringes any patent, then any and all rights granted by such
+Participant to You under Sections 2.1 and/or 2.2 of this License
+shall, upon 60 days notice from Participant terminate prospectively,
+unless if within 60 days after receipt of notice You either: (i)
+agree in writing to pay Participant a mutually agreeable reasonable
+royalty for Your past and future use of Modifications made by such
+Participant, or (ii) withdraw Your litigation claim with respect to
+the Contributor Version against such Participant. If within 60 days
+of notice, a reasonable royalty and payment arrangement are not
+mutually agreed upon in writing by the parties or the litigation claim
+is not withdrawn, the rights granted by Participant to You under
+Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+the 60 day notice period specified above.
+
+(b) any software, hardware, or device, other than such Participant`s
+Contributor Version, directly or indirectly infringes any patent, then
+any rights granted to You by such Participant under Sections 2.1(b)
+and 2.2(b) are revoked effective as of the date You first made, used,
+sold, distributed, or had made, Modifications made by that
+Participant.
+
+8.3. If You assert a patent infringement claim against Participant
+alleging that such Participant`s Contributor Version directly or
+indirectly infringes any patent where such claim is resolved (such as
+by license or settlement) prior to the initiation of patent
+infringement litigation, then the reasonable value of the licenses
+granted by such Participant under Sections 2.1 or 2.2 shall be taken
+into account in determining the amount or value of any payment or
+license.
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above,
+all end user license agreements (excluding distributors and resellers)
+which have been validly granted by You or any distributor hereunder
+prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+The Covered Code is a "commercial item," as that term is defined in
+48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" and "commercial computer software documentation," as such
+terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+all U.S. Government End Users acquire Covered Code with only those
+rights set forth herein.
+
+11. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. This License shall be governed by
+California law provisions (except to the extent applicable law, if
+any, provides otherwise), excluding its conflict-of-law provisions.
+With respect to disputes in which at least one party is a citizen of,
+or an entity chartered or registered to do business in the United
+States of America, any litigation relating to this License shall be
+subject to the jurisdiction of the Federal Courts of the Northern
+District of California, with venue lying in Santa Clara County,
+California, with the losing party responsible for costs, including
+without limitation, court costs and reasonable attorneys` fees and
+expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded.
+Any law or regulation which provides that the language of a contract
+shall be construed against the drafter shall not apply to this
+License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly,
+out of its utilization of rights under this License and You agree to
+work with Initial Developer and Contributors to distribute such
+responsibility on an equitable basis. Nothing herein is intended or
+shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+Initial Developer may designate portions of the Covered Code as
+"Multiple-Licensed". "Multiple-Licensed" means that the Initial
+Developer permits you to utilize portions of the Covered Code under
+Your choice of the NPL or the alternative licenses, if any, specified
+by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A - CUA Office Public License.
+
+``The contents of this file are subject to the CUA Office Public License
+Version 1.0 (the "License"); you may not use this file except in
+compliance with the License. You may obtain a copy of the License at
+http://cuaoffice.sourceforge.net/
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+License for the specific language governing rights and limitations
+under the License.
+
+The Original Code is ______________________________________.
+
+The Initial Developer of the Original Code is ________________________.
+Portions created by ______________________ are Copyright (C) ______
+_______________________. All Rights Reserved.
+
+Contributor(s): ______________________________________.
+
+Alternatively, the contents of this file may be used under the terms
+of the _____ license (the "[___] License"), in which case the
+provisions of [______] License are applicable instead of those
+above. If you wish to allow use of your version of this file only
+under the terms of the [____] License and not to allow others to use
+your version of this file under the CUAPL, indicate your decision by
+deleting the provisions above and replace them with the notice and
+other provisions required by the [___] License. If you do not delete
+the provisions above, a recipient may use your version of this file
+under either the CUAPL or the [___] License."
+
+[NOTE: The text of this Exhibit A may differ slightly from the text of
+the notices in the Source Code files of the Original Code. You should
+use the text of this Exhibit A rather than the text found in the
+Original Code Source Code for Your Modifications.]
+
diff --git a/meta/files/common-licenses/ClArtistic b/meta/files/common-licenses/ClArtistic
new file mode 100644
index 0000000..8d5a4aa
--- /dev/null
+++ b/meta/files/common-licenses/ClArtistic
@@ -0,0 +1,138 @@
+
+       The Clarified Artistic License
+
+    Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
+
+Definitions:
+
+ "Package" refers to the collection of files distributed by the
+ Copyright Holder, and derivatives of that collection of files
+ created through textual modification.
+
+ "Standard Version" refers to such a Package if it has not been
+ modified, or has been modified in accordance with the wishes
+ of the Copyright Holder as specified below.
+
+ "Copyright Holder" is whoever is named in the copyright or
+ copyrights for the package.
+
+ "You" is you, if you`re thinking about copying or distributing
+ this Package.
+
+ "Distribution fee" is a fee you charge for providing a copy
+        of this Package to another party.
+
+ "Freely Available" means that no fee is charged for the right to
+        use the item, though there may be fees involved in handling the
+        item.  It also means that recipients of the item may redistribute
+        it under the same conditions they received it.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain, or those made Freely Available, or from
+the Copyright Holder.  A Package modified in such a way shall still be
+considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
+
+    a) place your modifications in the Public Domain or otherwise make them
+    Freely Available, such as by posting said modifications to Usenet or an
+    equivalent medium, or placing the modifications on a major network
+    archive site allowing unrestricted access to them, or by allowing the
+    Copyright Holder to include your modifications in the Standard Version
+    of the Package.
+
+    b) use the modified Package only within your corporation or organization.
+
+    c) rename any non-standard executables so the names do not conflict
+    with standard executables, which must also be provided, and provide
+    a separate manual page for each non-standard executable that clearly
+    documents how it differs from the Standard Version.
+
+    d) make other distribution arrangements with the Copyright Holder.
+
+    e) permit and encourge anyone who receives a copy of the modified Package
+       permission to make your modifications Freely Available
+       in some specific way.
+
+
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
+
+    a) distribute a Standard Version of the executables and library files,
+    together with instructions (in the manual page or equivalent) on where
+    to get the Standard Version.
+
+    b) accompany the distribution with the machine-readable source of
+    the Package with your modifications.
+
+    c) give non-standard executables non-standard names, and clearly
+    document the differences in manual pages (or equivalent), together
+    with instructions on where to get the Standard Version.
+
+    d) make other distribution arrangements with the Copyright Holder.
+
+    e) offer the machine-readable source of the Package, with your
+       modifications, by mail order.
+
+5. You may charge a distribution fee for any distribution of this Package.
+If you offer support for this Package, you may charge any fee you choose
+for that support.  You may not charge a license fee for the right to use
+this Package itself.  You may distribute this Package in aggregate with
+other (possibly commercial and possibly nonfree) programs as part of a
+larger (possibly commercial and possibly nonfree) software distribution,
+and charge license fees for other parts of that software distribution,
+provided that you do not advertise this Package as a product of your own.
+If the Package includes an interpreter, You may embed this Package`s
+interpreter within an executable of yours (by linking); this shall be
+construed as a mere form of aggregation, provided that the complete
+Standard Version of the interpreter is so embedded.
+
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whoever generated
+them, and may be sold commercially, and may be aggregated with this
+Package.  If such scripts or library files are aggregated with this
+Package via the so-called "undump" or "unexec" methods of producing a
+binary executable image, then distribution of such an image shall
+neither be construed as a distribution of this Package nor shall it
+fall under the restrictions of Paragraphs 3 and 4, provided that you do
+not represent such an executable image as a Standard Version of this
+Package.
+
+7. C subroutines (or comparably compiled subroutines in other
+languages) supplied by you and linked into this Package in order to
+emulate subroutines and variables of the language defined by this
+Package shall not be considered part of this Package, but are the
+equivalent of input as in Paragraph 6, provided these subroutines do
+not change the language in any way that would cause it to fail the
+regression tests for the language.
+
+8. Aggregation of the Standard Version of the Package with a commercial
+distribution is always permitted provided that the use of this Package
+is embedded; that is, when no overt attempt is made to make this Package`s
+interfaces visible to the end user of the commercial distribution.
+Such use shall not be construed as a distribution of this Package.
+
+9. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+    The End
+
diff --git a/meta/files/common-licenses/DSSSL b/meta/files/common-licenses/DSSSL
new file mode 100644
index 0000000..7159dfb
--- /dev/null
+++ b/meta/files/common-licenses/DSSSL
@@ -0,0 +1,49 @@
+Copyright
+---------
+
+Copyright (C) 1997-2001 Norman Walsh
+
+The original inspiration for these stylesheets came from the
+work of Jon Bosak, Anders Berglund, Tony Graham, Terry Allen,
+James Clark, and many others.  I am indebted to them and to the
+community of users on dssslist@mulberrytech.com for making
+substantial contributions to this work and for answering my many
+questions.
+
+This software may be distributed under the same terms as Jade:
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the ``Software''), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+Except as contained in this notice, the names of individuals
+credited with contribution to this software shall not be used in
+advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization
+from the individuals in question.
+
+Any stylesheet derived from this Software that is publically
+distributed will be identified with a different name and the
+version strings in any derived Software will be changed so that
+no possibility of confusion between the derived package and this
+Software will exist.
+
+Warranty
+--------
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT.  IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER
+CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/meta/files/common-licenses/ECL-1.0 b/meta/files/common-licenses/ECL-1.0
new file mode 100644
index 0000000..bbc8be1
--- /dev/null
+++ b/meta/files/common-licenses/ECL-1.0
@@ -0,0 +1,55 @@
+
+This Educational Community License (the "License") applies
+to any original work of authorship (the "Original Work") whose owner
+(the "Licensor") has placed the following notice immediately following
+the copyright notice for the Original Work:
+
+Copyright (c) <year> <copyright holders>
+
+Licensed under the Educational Community License version 1.0
+
+This Original Work, including software, source code, documents,
+or other related items, is being provided by the copyright holder(s)
+subject to the terms of the Educational Community License. By
+obtaining, using and/or copying this Original Work, you agree that you
+have read, understand, and will comply with the following terms and
+conditions of the Educational Community License:
+
+Permission to use, copy, modify, merge, publish, distribute, and
+sublicense this Original Work and its documentation, with or without
+modification, for any purpose, and without fee or royalty to the
+copyright holder(s) is hereby granted, provided that you include the
+following on ALL copies of the Original Work or portions thereof,
+including modifications or derivatives, that you make:
+
+
+The full text of the Educational Community License in a location viewable to
+users of the redistributed or derivative work.
+
+
+Any pre-existing intellectual property disclaimers, notices, or terms and
+conditions.
+
+
+
+Notice of any changes or modifications to the Original Work, including the
+date the changes were made.
+
+
+Any modifications of the Original Work must be distributed in such a manner as
+to avoid any confusion with the Original Work of the copyright holders.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+The name and trademarks of copyright holder(s) may NOT be used
+in advertising or publicity pertaining to the Original or Derivative
+Works without specific, written prior permission. Title to copyright in
+the Original Work and any associated documentation will at all times
+remain with the copyright holders.
+
diff --git a/meta/files/common-licenses/ECL-2.0 b/meta/files/common-licenses/ECL-2.0
new file mode 100644
index 0000000..54c99e7
--- /dev/null
+++ b/meta/files/common-licenses/ECL-2.0
@@ -0,0 +1,99 @@
+
+Educational Community License, Version 2.0
+(plain text)
+Educational Community License
+
+Version 2.0, April 2007
+
+http://www.osedu.org/licenses/
+
+The Educational Community License version 2.0 ("ECL") consists of the Apache 2.0 license, modified to change the scope of the patent grant in section 3 to be specific to the needs of the education communities using this license. The original Apache 2.0 license can be found at: http://www.apache.org/licenses/LICENSE-2.0
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License.
+
+Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License.
+
+Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. Any patent license granted hereby with respect to contributions by an individual employed by an institution or organization is limited to patent claims where the individual that is the author of the Work is also the inventor of the patent claims licensed, and where the organization or institution has the right to grant such license under applicable grant and research funding agreements. No other express or implied licenses are granted.
+
+4. Redistribution.
+
+You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions.
+
+Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks.
+
+This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty.
+
+Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability.
+
+In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability.
+
+While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Educational Community License to your work
+
+To apply the Educational Community License to your work, attach
+the following boilerplate notice, with the fields enclosed by
+brackets "[]" replaced with your own identifying information.
+(Don`t include the brackets!) The text should be enclosed in the
+appropriate comment syntax for the file format. We also recommend
+that a file or class name and description of purpose be included on
+the same "printed page" as the copyright notice for easier
+identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner] Licensed under the
+ Educational Community License, Version 2.0 (the "License"); you may
+ not use this file except in compliance with the License. You may
+ obtain a copy of the License at
+ 
+ http://www.osedu.org/licenses/ECL-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an "AS IS"
+ BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ or implied. See the License for the specific language governing
+ permissions and limitations under the License.
+
diff --git a/meta/files/common-licenses/EDL-1.0 b/meta/files/common-licenses/EDL-1.0
new file mode 100644
index 0000000..53b1eb0
--- /dev/null
+++ b/meta/files/common-licenses/EDL-1.0
@@ -0,0 +1,13 @@
+Eclipse Distribution License - v 1.0
+
+Copyright (c) 2007, Eclipse Foundation, Inc. and its licensors.
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    * Neither the name of the Eclipse Foundation, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/meta/files/common-licenses/EFL-1.0 b/meta/files/common-licenses/EFL-1.0
new file mode 100644
index 0000000..c399605
--- /dev/null
+++ b/meta/files/common-licenses/EFL-1.0
@@ -0,0 +1,25 @@
+
+Eiffel Forum License, version 1
+
+Permission is hereby granted to use, copy, modify and/or distribute
+this package, provided that:
+
+  - copyright notices are retained unchanged
+
+  - any distribution of this package, whether modified or not,
+    includes this file
+
+Permission is hereby also granted to distribute binary programs which
+depend on this package, provided that:
+
+  - if the binary program depends on a modified version of this
+    package, you must publicly release the modified version of this
+    package
+
+THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE.
+
diff --git a/meta/files/common-licenses/EFL-2.0 b/meta/files/common-licenses/EFL-2.0
new file mode 100644
index 0000000..be37f90
--- /dev/null
+++ b/meta/files/common-licenses/EFL-2.0
@@ -0,0 +1,12 @@
+
+Eiffel Forum License, version 2
+
+Permission is hereby granted to use, copy, modify and/or distribute this package, provided that:
+copyright notices are retained unchanged,
+any distribution of this package, whether modified or not, includes this license text.
+Permission is hereby also granted to distribute binary programs which depend on this package. If the binary program depends on a modified version of this package, you are encouraged to publicly release the modified version of this package.
+***********************
+
+THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT WARRANTY. ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS PACKAGE. 
+***********************
+
diff --git a/meta/files/common-licenses/EPL-1.0 b/meta/files/common-licenses/EPL-1.0
new file mode 100644
index 0000000..1d76e57
--- /dev/null
+++ b/meta/files/common-licenses/EPL-1.0
@@ -0,0 +1,72 @@
+
+Eclipse Public License - v 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT`S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+
+"Contribution" means:
+
+a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+b) in the case of each subsequent Contributor:
+i) changes to the Program, and
+ii) additions to the Program;
+where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution `originates` from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor`s behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+"Contributor" means any person or entity that distributes the Program.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Program" means the Contributions distributed in accordance with this Agreement.
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient`s responsibility to acquire that license before distributing the Program.
+d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
+a) it complies with the terms and conditions of this Agreement; and
+b) its license agreement:
+i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+a) it must be made available under this Agreement; and
+b) a copy of this Agreement must be included with each copy of the Program.
+Contributors may not remove or alter any copyright notices contained within the Program.
+
+Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor`s responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient`s patent(s), then such Recipient`s rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient`s rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient`s rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient`s obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
diff --git a/meta/files/common-licenses/EUDatagrid b/meta/files/common-licenses/EUDatagrid
new file mode 100644
index 0000000..d96e504
--- /dev/null
+++ b/meta/files/common-licenses/EUDatagrid
@@ -0,0 +1,29 @@
+
+EU DataGrid Software License
+
+Copyright (c) 2001 EU DataGrid. All rights reserved.
+
+This software includes voluntary contributions made to the EU DataGrid. For more information on the EU DataGrid, please see http://www.eu-datagrid.org/.
+
+Installation, use, reproduction, display, modification and redistribution of this software, with or without modification, in source and binary forms, are permitted. Any exercise of rights under this license by you or your sub-licensees is subject to the following conditions:
+
+1. Redistributions of this software, with or without modification, must reproduce the above copyright notice and the above license statement as well as this list of conditions, in the software, the user documentation and any other materials provided with the software.
+
+2. The user documentation, if any, included with a redistribution, must include the following notice:
+"This product includes software developed by the EU DataGrid (http://www.eu-datagrid.org/)."
+
+Alternatively, if that is where third-party acknowledgments normally appear, this acknowledgment must be reproduced in the software itself.
+
+3. The names "EDG", "EDG Toolkit", &#8220;EU DataGrid&#8221; and "EU DataGrid Project" may not be used to endorse or promote software, or products derived
+therefrom, except with prior written permission by hep-project-grid-edg-license@cern.ch.
+
+4. You are under no obligation to provide anyone with any bug fixes, patches, upgrades or other modifications, enhancements or derivatives of the features,functionality or performance of this software that you may develop. However, if you publish or distribute your modifications, enhancements or derivative works without contemporaneously requiring users to enter into a separate written license agreement, then you are deemed to have granted participants in the EU DataGrid a worldwide, non-exclusive, royalty-free, perpetual license to install, use, reproduce, display, modify, redistribute and sub-license your modifications, enhancements or derivative works, whether in binary or source code form, under the license conditions stated in this list of conditions.
+
+5. DISCLAIMER 
+
+THIS SOFTWARE IS PROVIDED BY THE EU DATAGRID AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, OF SATISFACTORY QUALITY, AND FITNESS FOR A PARTICULAR PURPOSE OR USE ARE DISCLAIMED. THE EU DATAGRID AND CONTRIBUTORS MAKE NO REPRESENTATION THAT THE SOFTWARE, MODIFICATIONS, ENHANCEMENTS OR DERIVATIVE WORKS THEREOF, WILL NOT INFRINGE ANY PATENT, COPYRIGHT, TRADE SECRET OR OTHER PROPRIETARY RIGHT. 
+
+6. LIMITATION OF LIABILITY
+
+THE EU DATAGRID AND CONTRIBUTORS SHALL HAVE NO LIABILITY TO LICENSEE OR OTHER PERSONS FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, LOSS OF USE, DATA OR PROFITS, OR BUSINESS INTERRUPTION, HOWEVER CAUSED AND ON ANY THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR OTHERWISE, ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 
+
diff --git a/meta/files/common-licenses/EUPL-1.0 b/meta/files/common-licenses/EUPL-1.0
new file mode 100644
index 0000000..40ecbfe
--- /dev/null
+++ b/meta/files/common-licenses/EUPL-1.0
@@ -0,0 +1,184 @@
+
+European Union Public Licence 
+V.1.0 
+EUPL &#169; the European Community 2007 
+This European Union Public Licence (the &#8220;EUPL&#8221;) applies to the Work or Software (as 
+defined below) which is provided under the terms of this Licence. Any use of the Work, other 
+than as authorised under this Licence is prohibited (to the extent such use is covered by a right 
+of the copyright holder of the Work). 
+The Original Work is provided under the terms of this Licence when the Licensor (as defined 
+below) has placed the following notice immediately following the copyright notice for the 
+Original Work: 
+Licensed under the EUPL V.1.0 
+or has expressed by any other mean his willingness to license under the EUPL. 
+1. Definitions
+In this Licence, the following terms have the following meaning: 
+&#8722; The Licence: this Licence. 
+&#8722; The Original Work or the Software: the software distributed and/or communicated by 
+the Licensor under this Licence, available as Source Code and also as Executable 
+Code as the case may be. 
+&#8722; Derivative Works: the works or software that could be created by the Licensee, based 
+upon the Original Work or modifications thereof. This Licence does not define the 
+extent of modification or dependence on the Original Work required in order to 
+classify a work as a Derivative Work; this extent is determined by copyright law 
+applicable in the country mentioned in Article 15.  
+&#8722; The Work: the Original Work and/or its Derivative Works. 
+&#8722; The Source Code: the human-readable form of the Work which is the most 
+convenient for people to study and modify. 
+&#8722; The Executable Code: any code which has generally been compiled and which is 
+meant to be interpreted by a computer as a program. 
+&#8722; The Licensor: the natural or legal person that  distributes and/or communicates the 
+Work under the Licence. 
+&#8722; Contributor(s): any natural or legal person who modifies the Work under the 
+Licence, or otherwise contributes to the creation of a Derivative Work. 
+&#8722; The Licensee or &#8220;You&#8221;:  any natural or legal person who makes any usage of the 
+Software under the terms of the Licence. &#8722; Distribution and/or Communication: any act of selling,  giving, lending, renting, 
+distributing, communicating, transmitting, or otherwise making available, on-line or 
+off-line, copies of the Work at the disposal of any other natural or legal person. 
+2. Scope of the rights granted by the Licence
+The Licensor hereby grants You a world-wide,  royalty-free, non-exclusive, sub-licensable 
+licence to do the following, for the duration of copyright vested in the Original Work: 
+&#8722; use the Work in any circumstance and for all usage, 
+&#8722; reproduce the Work, 
+&#8722; modify the Original Work, and make Derivative Works based upon the Work, 
+&#8722; communicate to the public, including the right to make available or display the Work 
+or copies thereof to the public and perform publicly, as the case may be, the Work, 
+&#8722; distribute the Work or copies thereof, 
+&#8722; lend and rent the Work or copies thereof, 
+&#8722; sub-license rights in the Work or copies thereof. 
+Those rights can be exercised on any media,  supports and formats, whether now known or 
+later invented, as far as the applicable law permits so. 
+In the countries where moral rights apply, the Licensor waives his right to exercise his moral 
+right to the extent allowed by law in order to make effective the licence of the economic rights 
+here above listed. 
+The Licensor grants to the Licensee royalty-free, non exclusive usage rights to any patents 
+held by the Licensor, to the extent necessary to make use of the rights granted on the Work 
+under this Licence. 
+3. Communication of the Source Code
+The Licensor may provide the Work either in its Source Code form, or as Executable Code. If 
+the Work is provided as Executable Code,  the Licensor provides in addition a machinereadable copy of the Source Code of the Work along with each copy of the Work that the 
+Licensor distributes or indicates, in a notice following the copyright notice attached to the 
+Work, a repository where the Source Code is easily and freely accessible for as long as the 
+Licensor continues to distribute and/or communicate the Work. 
+4. Limitations on copyright
+Nothing in this Licence is intended to deprive the Licensee of the benefits from any exception 
+or limitation to the exclusive rights of the rights owners in the Original Work or Software, of 
+the exhaustion of those rights or of other applicable limitations thereto. 
+5. Obligations of the Licensee
+The grant of the rights mentioned above is subject to some restrictions and obligations 
+imposed on the Licensee. Those obligations are the following: Attribution right: the Licensee shall keep intact all copyright, patent or trademarks notices 
+and all notices that refer to the Licence and to the disclaimer of warranties. The Licensee must 
+include a copy of such notices and a copy of the Licence with every copy of the Work he/she 
+distributes and/or communicates. The Licensee must cause any Derivative Work to carry 
+prominent notices stating that the Work has been modified and the date of modification. 
+Copyleft clause: If the Licensee distributes and/or  communicates copies of the Original 
+Works or Derivative Works based upon the Original Work, this Distribution and/or 
+Communication will be done under the terms  of this Licence. The Licensee (becoming 
+Licensor) cannot offer or impose any additional terms or  conditions on the Work or 
+Derivative Work that alter or restrict the terms of the Licence. 
+Compatibility clause: If the Licensee Distributes and/or Communicates Derivative Works or 
+copies thereof based upon both the Original Work and another work licensed under a 
+Compatible Licence, this Distribution and/or Communication can be done under the terms of 
+this Compatible Licence. For the sake of this clause, &#8220;Compatible Licence&#8221; refers to the 
+licences listed in the appendix attached to  this Licence. Should the  Licensee&#8217;s obligations 
+under the Compatible Licence conflict with his/her  obligations under this Licence, the 
+obligations of the Compatible Licence shall prevail.  
+Provision of Source Code: When distributing and/or communicating copies of the Work, the 
+Licensee will provide a machine-readable copy of the Source Code or  indicate a repository 
+where this Source will be easily and freely available for as long as the Licensee continues to 
+distribute and/or communicate the Work. 
+Legal Protection: This Licence does not grant permission to use the trade names, trademarks, 
+service marks, or names of the Licensor, except as required for reasonable and customary use 
+in describing the origin of the Work and reproducing the content of the copyright notice. 
+6. Chain of Authorship
+The original Licensor warrants that the copyright in the Original Work granted hereunder is 
+owned by him/her or licensed to him/her and that he/she has the power and authority to grant 
+the Licence. 
+Each Contributor warrants that the copyright in the modifications he/she brings to the Work 
+are owned by him/her or licensed to him/her and that he/she has the power and authority to 
+grant the Licence. 
+Each time You, as a Licensee,  receive the Work, the original Licensor and subsequent 
+Contributors grant You a licence to their contributions to the Work, under the terms of this 
+Licence. 
+7. Disclaimer of Warranty
+The Work is a work in progress, which is continuously improved by numerous contributors. It 
+is not a finished work and may therefore contain defects or &#8220;bugs&#8221; inherent to this type of 
+software development. 
+For the above reason, the Work is provided under the Licence on an &#8220;as is&#8221; basis and without 
+warranties of any kind concerning the Work,  including without limitation merchantability, 
+fitness for a particular purpose, absence of defects or errors, accuracy, non-infringement of 
+intellectual property rights other than copyright as stated in Article 6 of this Licence. This disclaimer of warranty is an essential part of the Licence and a condition for the grant of 
+any rights to the Work. 
+8. Disclaimer of Liability
+Except in the cases of wilful misconduct or damages directly caused to natural persons, the 
+Licensor will in no event be liable for any direct or indirect, material or moral, damages of 
+any kind, arising out of  the Licence or of the use of the Work, including without limitation, 
+damages for loss of goodwill, work stoppage, computer failure or malfunction, loss of data or 
+any commercial damage, even if the Licensor has been advised of the  possibility of such 
+damage. However, the Licensor will be liable under statutory product liability laws as far such 
+laws apply to the Work. 
+9. Additional agreements
+While distributing the Original Work or Derivative Works, You may choose to conclude an 
+additional agreement to offer, and charge a fee for, acceptance  of support, warranty, 
+indemnity, or other liability obligations and/or services consistent with this Licence. 
+However, in accepting such obligations, You may act only on your own behalf and on your 
+sole responsibility, not on behalf of the original Licensor or any other Contributor, and only if 
+You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred 
+by, or claims asserted against such Contributor by the fact You have accepted any such 
+warranty or additional liability. 
+10. Acceptance of the Licence
+The provisions of this Licence can be accepted by clicking on an icon &#8220;I agree&#8221; placed under 
+the bottom of a window displaying the text of this Licence or by affirming consent in any 
+other similar way, in accordance with the rules of applicable law. Clicking on that icon 
+indicates your clear and irrevocable acceptance of this Licence and  all of its terms and 
+conditions.  
+Similarly, you irrevocably accept this Licence and all of its terms and conditions by 
+exercising any rights granted to You by Article 2 of this Licence, such as the use of the Work, 
+the creation by You of a Derivative Work or the Distribution and/or Communication by You 
+of the Work or copies thereof.  
+11. Information to the public
+In case of any Distribution and/or Communication of the Work by means of electronic 
+communication by You (for example, by offering to download the Work from a remote 
+location) the distribution channel or media (for example, a website) must at least provide to 
+the public the information requested by the applicable law regarding the identification and 
+address of the Licensor, the Licence and the way it may be accessible, concluded, stored and 
+reproduced by the Licensee. 
+12. Termination of the Licence
+The Licence and the rights granted hereunder will terminate automatically upon any breach by 
+the Licensee of the terms of the Licence. 
+Such a termination will not terminate the licences of any person who has received the Work 
+from the Licensee under the Licence, provided such persons remain in full compliance with 
+the Licence.  13. Miscellaneous
+Without prejudice of Article 9 above, the Licence represents the complete agreement between 
+the Parties as to the Work licensed hereunder. 
+If any provision of the Licence is invalid or unenforceable under applicable law, this will not 
+affect the validity or enforceability of the Licence as a whole. Such provision will be 
+construed and/or reformed so as necessary to make it valid and enforceable. 
+The European Commission may put into force translations and/or binding new versions of 
+this Licence, so far this is required and reasonable. New versions of the Licence will be 
+published with a unique version number. The new version of the Licence becomes binding for 
+You as soon as You become aware of its publication. 
+14. Jurisdiction
+Any litigation resulting from the interpretation of this License, arising between the European 
+Commission, as a Licensor, and any Licensee, will be subject to the jurisdiction of the Court 
+of Justice of the European Communities, as laid down in article 238 of the Treaty establishing 
+the European Community. 
+Any litigation arising between Parties, other  than the European Commission, and resulting 
+from the interpretation of this License, will be subject to the exclusive jurisdiction of the 
+competent court where the Licensor resides or conducts its primary business. 
+15. Applicable Law
+This Licence shall be governed by the law of the European Union country where the Licensor 
+resides or has his registered office. 
+This licence shall be governed by the Belgian law if: 
+&#8722; a litigation arises between the European Commission, as a Licensor, and any 
+Licensee; 
+&#8722; the Licensor, other than the European Commission, has no residence or registered 
+office inside a European Union country.  
+ ===Appendix
+&#8220;Compatible Licences&#8221; according to article 5 EUPL are: 
+&#8722; General Public License (GPL) v. 2 
+&#8722; Open Software License (OSL) v. 2.1, v. 3.0 
+&#8722; Common Public License v. 1.0 
+&#8722; Eclipse Public License v. 1.0 
+&#8722; Cecill v. 2.0 
+
diff --git a/meta/files/common-licenses/EUPL-1.1 b/meta/files/common-licenses/EUPL-1.1
new file mode 100644
index 0000000..6e1d84f
--- /dev/null
+++ b/meta/files/common-licenses/EUPL-1.1
@@ -0,0 +1,204 @@
+
+European Union Public Licence
+V. 1.1
+EUPL &#169; the European Community 2007
+This European Union Public Licence (the &#8220;EUPL&#8221;) applies to the Work or Software
+(as defined below) which is provided under the terms of this Licence. Any use of the
+Work, other than as authorised under this Licence is prohibited (to the extent such use
+is covered by a right of the copyright holder of the Work).
+The Original Work is provided under the terms of this Licence when the Licensor (as
+defined below) has placed the following notice immediately following the copyright
+notice for the Original Work:
+Licensed under the EUPL V.1.1
+or has expressed by any other mean his willingness to license under the EUPL.
+1. Definitions
+In this Licence, the following terms have the following meaning:
+- The Licence: this Licence.
+- The Original Work or the Software: the software distributed and/or communicated
+by the Licensor under this Licence, available as Source Code and also as Executable
+Code as the case may be.
+- Derivative Works: the works or software that could be created by the Licensee,
+based upon the Original Work or modifications thereof. This Licence does not define
+the extent of modification or dependence on the Original Work required in order to
+classify a work as a Derivative Work; this extent is determined by copyright law
+applicable in the country mentioned in Article 15.
+- The Work: the Original Work and/or its Derivative Works.
+- The Source Code: the human-readable form of the Work which is the most
+convenient for people to study and modify.
+- The Executable Code: any code which has generally been compiled and which is
+meant to be interpreted by a computer as a program.
+- The Licensor: the natural or legal person that distributes and/or communicates the
+Work under the Licence.
+- Contributor(s): any natural or legal person who modifies the Work under the
+Licence, or otherwise contributes to the creation of a Derivative Work.
+- The Licensee or &#8220;You&#8221;: any natural or legal person who makes any usage of the
+Software under the terms of the Licence.
+- Distribution and/or Communication: any act of selling, giving, lending, renting,
+distributing, communicating, transmitting, or otherwise making available, on-line or
+off-line, copies of the Work or providing access to its essential functionalities at the
+disposal of any other natural or legal person.
+2. Scope of the rights granted by the Licence
+The Licensor hereby grants You a world-wide, royalty-free, non-exclusive, sublicensable
+licence to do the following, for the duration of copyright vested in the
+Original Work:
+- use the Work in any circumstance and for all usage,
+- reproduce the Work,
+- modify the Original Work, and make Derivative Works based upon the Work,
+- communicate to the public, including the right to make available or display the
+Work or copies thereof to the public and perform publicly, as the case may be,
+the Work,
+- distribute the Work or copies thereof,
+- lend and rent the Work or copies thereof,
+- sub-license rights in the Work or copies thereof.
+Those rights can be exercised on any media, supports and formats, whether now
+known or later invented, as far as the applicable law permits so.
+In the countries where moral rights apply, the Licensor waives his right to exercise his
+moral right to the extent allowed by law in order to make effective the licence of the
+economic rights here above listed.
+The Licensor grants to the Licensee royalty-free, non exclusive usage rights to any
+patents held by the Licensor, to the extent necessary to make use of the rights granted
+on the Work under this Licence.
+3. Communication of the Source Code
+The Licensor may provide the Work either in its Source Code form, or as Executable
+Code. If the Work is provided as Executable Code, the Licensor provides in addition a
+machine-readable copy of the Source Code of the Work along with each copy of the
+Work that the Licensor distributes or indicates, in a notice following the copyright
+notice attached to the Work, a repository where the Source Code is easily and freely
+accessible for as long as the Licensor continues to distribute and/or communicate the
+Work.
+4. Limitations on copyright
+Nothing in this Licence is intended to deprive the Licensee of the benefits from any
+exception or limitation to the exclusive rights of the rights owners in the Original
+Work or Software, of the exhaustion of those rights or of other applicable limitations
+thereto.
+5. Obligations of the Licensee
+The grant of the rights mentioned above is subject to some restrictions and obligations
+imposed on the Licensee. Those obligations are the following:
+Attribution right: the Licensee shall keep intact all copyright, patent or trademarks
+notices and all notices that refer to the Licence and to the disclaimer of warranties.
+The Licensee must include a copy of such notices and a copy of the Licence with
+every copy of the Work he/she distributes and/or communicates. The Licensee must
+cause any Derivative Work to carry prominent notices stating that the Work has been
+modified and the date of modification.
+Copyleft clause: If the Licensee distributes and/or communicates copies of the
+Original Works or Derivative Works based upon the Original Work, this Distribution
+and/or Communication will be done under the terms of this Licence or of a later
+version of this Licence unless the Original Work is expressly distributed only under
+this version of the Licence. The Licensee (becoming Licensor) cannot offer or impose
+any additional terms or conditions on the Work or Derivative Work that alter or
+restrict the terms of the Licence.
+Compatibility clause: If the Licensee Distributes and/or Communicates Derivative
+Works or copies thereof based upon both the Original Work and another work
+licensed under a Compatible Licence, this Distribution and/or Communication can be
+done under the terms of this Compatible Licence. For the sake of this clause,
+&#8220;Compatible Licence&#8221; refers to the licences listed in the appendix attached to this
+Licence. Should the Licensee&#8217;s obligations under the Compatible Licence conflict
+with his/her obligations under this Licence, the obligations of the Compatible Licence
+shall prevail.
+Provision of Source Code: When distributing and/or communicating copies of the
+Work, the Licensee will provide a machine-readable copy of the Source Code or
+indicate a repository where this Source will be easily and freely available for as long
+as the Licensee continues to distribute and/or communicate the Work.
+Legal Protection: This Licence does not grant permission to use the trade names,
+trademarks, service marks, or names of the Licensor, except as required for
+reasonable and customary use in describing the origin of the Work and reproducing
+the content of the copyright notice.
+6. Chain of Authorship
+The original Licensor warrants that the copyright in the Original Work granted
+hereunder is owned by him/her or licensed to him/her and that he/she has the power
+and authority to grant the Licence.
+Each Contributor warrants that the copyright in the modifications he/she brings to the
+Work are owned by him/her or licensed to him/her and that he/she has the power and
+authority to grant the Licence.
+Each time You accept the Licence, the original Licensor and subsequent Contributors
+grant You a licence to their contributions to the Work, under the terms of this
+Licence.
+7. Disclaimer of Warranty
+The Work is a work in progress, which is continuously improved by numerous
+contributors. It is not a finished work and may therefore contain defects or &#8220;bugs&#8221;
+inherent to this type of software development.
+For the above reason, the Work is provided under the Licence on an &#8220;as is&#8221; basis and
+without warranties of any kind concerning the Work, including without limitation
+merchantability, fitness for a particular purpose, absence of defects or errors,
+accuracy, non-infringement of intellectual property rights other than copyright as
+stated in Article 6 of this Licence.
+This disclaimer of warranty is an essential part of the Licence and a condition for the
+grant of any rights to the Work.
+8. Disclaimer of Liability
+Except in the cases of wilful misconduct or damages directly caused to natural
+persons, the Licensor will in no event be liable for any direct or indirect, material or
+moral, damages of any kind, arising out of the Licence or of the use of the Work,
+including without limitation, damages for loss of goodwill, work stoppage, computer
+failure or malfunction, loss of data or any commercial damage, even if the Licensor
+has been advised of the possibility of such damage. However, the Licensor will be
+liable under statutory product liability laws as far such laws apply to the Work.
+9. Additional agreements
+While distributing the Original Work or Derivative Works, You may choose to
+conclude an additional agreement to offer, and charge a fee for, acceptance of support,
+warranty, indemnity, or other liability obligations and/or services consistent with this
+Licence. However, in accepting such obligations, You may act only on your own
+behalf and on your sole responsibility, not on behalf of the original Licensor or any
+other Contributor, and only if You agree to indemnify, defend, and hold each
+Contributor harmless for any liability incurred by, or claims asserted against such
+Contributor by the fact You have accepted any such warranty or additional liability.
+10. Acceptance of the Licence
+The provisions of this Licence can be accepted by clicking on an icon &#8220;I agree&#8221;
+placed under the bottom of a window displaying the text of this Licence or by
+affirming consent in any other similar way, in accordance with the rules of applicable
+law. Clicking on that icon indicates your clear and irrevocable acceptance of this
+Licence and all of its terms and conditions.
+Similarly, you irrevocably accept this Licence and all of its terms and conditions by
+exercising any rights granted to You by Article 2 of this Licence, such as the use of
+the Work, the creation by You of a Derivative Work or the Distribution and/or
+Communication by You of the Work or copies thereof.
+11. Information to the public
+In case of any Distribution and/or Communication of the Work by means of electronic
+communication by You (for example, by offering to download the Work from a
+remote location) the distribution channel or media (for example, a website) must at
+least provide to the public the information requested by the applicable law regarding
+the Licensor, the Licence and the way it may be accessible, concluded, stored and
+reproduced by the Licensee.
+12. Termination of the Licence
+The Licence and the rights granted hereunder will terminate automatically upon any
+breach by the Licensee of the terms of the Licence.
+Such a termination will not terminate the licences of any person who has received the
+Work from the Licensee under the Licence, provided such persons remain in full
+compliance with the Licence.
+13. Miscellaneous
+Without prejudice of Article 9 above, the Licence represents the complete agreement
+between the Parties as to the Work licensed hereunder.
+If any provision of the Licence is invalid or unenforceable under applicable law, this
+will not affect the validity or enforceability of the Licence as a whole. Such provision
+will be construed and/or reformed so as necessary to make it valid and enforceable.
+The European Commission may publish other linguistic versions and/or new versions
+of this Licence, so far this is required and reasonable, without reducing the scope of
+the rights granted by the Licence. New versions of the Licence will be published with
+a unique version number.
+All linguistic versions of this Licence, approved by the European Commission, have
+identical value. Parties can take advantage of the linguistic version of their choice.
+14. Jurisdiction
+Any litigation resulting from the interpretation of this License, arising between the
+European Commission, as a Licensor, and any Licensee, will be subject to the
+jurisdiction of the Court of Justice of the European Communities, as laid down in
+article 238 of the Treaty establishing the European Community.
+Any litigation arising between Parties, other than the European Commission, and
+resulting from the interpretation of this License, will be subject to the exclusive
+jurisdiction of the competent court where the Licensor resides or conducts its primary
+business.
+15. Applicable Law
+This Licence shall be governed by the law of the European Union country where the
+Licensor resides or has his registered office.
+This licence shall be governed by the Belgian law if:
+- a litigation arises between the European Commission, as a Licensor, and any
+Licensee;
+- the Licensor, other than the European Commission, has no residence or
+registered office inside a European Union country.
+===
+Appendix
+&#8220;Compatible Licences&#8221; according to article 5 EUPL are:
+- GNU General Public License (GNU GPL) v. 2
+- Open Software License (OSL) v. 2.1, v. 3.0
+- Common Public License v. 1.0
+- Eclipse Public License v. 1.0
+- Cecill v. 2.0
+
diff --git a/meta/files/common-licenses/Elfutils-Exception b/meta/files/common-licenses/Elfutils-Exception
new file mode 100644
index 0000000..627d769
--- /dev/null
+++ b/meta/files/common-licenses/Elfutils-Exception
@@ -0,0 +1,12 @@
+   This file describes the limits of the Exception under which you are allowed
+   to distribute Non-GPL Code in linked combination with Red Hat elfutils.
+   For the full text of the license, please see one of the header files
+   included with the source distribution or the file COPYING found in the
+   top level directory of the source.
+
+   The Approved Interfaces are the functions declared in the files:
+
+   libelf.h
+   libdw.h
+   libdwfl.h
+
diff --git a/meta/files/common-licenses/Entessa b/meta/files/common-licenses/Entessa
new file mode 100644
index 0000000..d4dadd2
--- /dev/null
+++ b/meta/files/common-licenses/Entessa
@@ -0,0 +1,20 @@
+
+Entessa Public License Version. 1.0
+Copyright (c) 2003 Entessa, LLC. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+The end-user documentation included with the redistribution, if any, must include the following acknowledgment: 
+"This product includes open source software developed by openSEAL (http://www.openseal.org/)."
+
+Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear.
+
+The names "openSEAL" and "Entessa" must not be used to endorse or promote products derived from this software without prior written permission. For written permission, please contact epl@entessa.com.
+Products derived from this software may not be called "openSEAL", nor may "openSEAL" appear in their name, without prior written permission of Entessa.
+THIS SOFTWARE IS PROVIDED ``AS IS`` AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ENTESSA, LLC, OPENSEAL OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+============================================================
+
+This software consists of voluntary contributions made by many individuals on behalf of openSEAL and was originally based on software contributed by Entessa, LLC, http://www.entessa.com. For more information on the openSEAL, please see <http://www.openseal.org/>.
+
diff --git a/meta/files/common-licenses/ErlPL-1.1 b/meta/files/common-licenses/ErlPL-1.1
new file mode 100644
index 0000000..5961ccf
--- /dev/null
+++ b/meta/files/common-licenses/ErlPL-1.1
@@ -0,0 +1,288 @@
+
+ERLANG PUBLIC LICENSE
+Version 1.1
+
+1. Definitions.
+
+1.1. ``Contributor`` means each entity that creates or contributes to
+the creation of Modifications.
+
+1.2. ``Contributor Version`` means the combination of the Original
+Code, prior Modifications used by a Contributor, and the Modifications
+made by that particular Contributor.
+
+1.3. ``Covered Code`` means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case
+including portions thereof.
+
+1.4. ``Electronic Distribution Mechanism`` means a mechanism generally
+accepted in the software development community for the electronic
+transfer of data.
+
+1.5. ``Executable`` means Covered Code in any form other than Source
+Code.
+
+1.6. ``Initial Developer`` means the individual or entity identified
+as the Initial Developer in the Source Code notice required by Exhibit
+A.
+
+1.7. ``Larger Work`` means a work which combines Covered Code or
+portions thereof with code not governed by the terms of this License.
+
+1.8. ``License`` means this document.
+
+1.9. ``Modifications`` means any addition to or deletion from the
+substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:
+
+A. Any addition to or deletion from the contents of a file containing
+   Original Code or previous Modifications. 
+
+B. Any new file that contains any part of the Original Code or
+   previous Modifications. 
+
+1.10. ``Original Code`` means Source Code of computer software code
+which is described in the Source Code notice required by Exhibit A as
+Original Code, and which, at the time of its release under this
+License is not already Covered Code governed by this License.
+
+1.11. ``Source Code`` means the preferred form of the Covered Code for
+making modifications to it, including all modules it contains, plus
+any associated interface definition files, scripts used to control
+compilation and installation of an Executable, or a list of source
+code differential comparisons against either the Original Code or
+another well known, available Covered Code of the Contributor`s
+choice. The Source Code can be in a compressed or archival form,
+provided the appropriate decompression or de-archiving software is
+widely available for no charge.
+
+1.12. ``You`` means an individual or a legal entity exercising rights
+under, and complying with all of the terms of, this License. For legal
+entities,``You`` includes any entity which controls, is controlled by,
+or is under common control with You. For purposes of this definition,
+``control`` means (a) the power, direct or indirect, to cause the
+direction or management of such entity, whether by contract or
+otherwise, or (b) ownership of fifty percent (50%) or more of the
+outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and
+    distribute the Original Code (or portions thereof) with or without
+    Modifications, or as part of a Larger Work; and 
+
+(b) under patents now or hereafter owned or controlled by Initial
+    Developer, to make, have made, use and sell (``Utilize``) the
+    Original Code (or portions thereof), but solely to the extent that
+    any such patent is reasonably necessary to enable You to Utilize
+    the Original Code (or portions thereof) and not to any greater
+    extent that may be necessary to Utilize further Modifications or
+    combinations. 
+
+2.2. Contributor Grant.
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and
+    distribute the Modifications created by such Contributor (or
+    portions thereof) either on an unmodified basis, with other
+    Modifications, as Covered Code or as part of a Larger Work; and 
+
+(b) under patents now or hereafter owned or controlled by Contributor,
+    to Utilize the Contributor Version (or portions thereof), but
+    solely to the extent that any such patent is reasonably necessary
+    to enable You to Utilize the Contributor Version (or portions
+    thereof), and not to any greater extent that may be necessary to
+    Utilize further Modifications or combinations. 
+
+3. Distribution Obligations.
+
+3.1. Application of License.
+The Modifications which You contribute are governed by the terms of
+this License, including without limitation Section 2.2. The Source
+Code version of Covered Code may be distributed only under the terms
+of this License, and You must include a copy of this License with
+every copy of the Source Code You distribute. You may not offer or
+impose any terms on any Source Code version that alters or restricts
+the applicable version of this License or the recipients` rights
+hereunder. However, You may include an additional document offering
+the additional rights described in Section 3.5. 
+
+3.2. Availability of Source Code.
+Any Modification which You contribute must be made available in Source
+Code form under the terms of this License either on the same media as
+an Executable version or via an accepted Electronic Distribution
+Mechanism to anyone to whom you made an Executable version available;
+and if made available via Electronic Distribution Mechanism, must
+remain available for at least twelve (12) months after the date it
+initially became available, or at least six (6) months after a
+subsequent version of that particular Modification has been made
+available to such recipients. You are responsible for ensuring that
+the Source Code version remains available even if the Electronic
+Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which you contribute to contain a
+file documenting the changes You made to create that Covered Code and
+the date of any change. You must include a prominent statement that
+the Modification is derived, directly or indirectly, from Original
+Code provided by the Initial Developer and including the name of the
+Initial Developer in (a) the Source Code, and (b) in any notice in an
+Executable version or related documentation in which You describe the
+origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims.
+    If You have knowledge that a party claims an intellectual property
+    right in particular functionality or code (or its utilization
+    under this License), you must include a text file with the source
+    code distribution titled ``LEGAL`` which describes the claim and
+    the party making the claim in sufficient detail that a recipient
+    will know whom to contact. If you obtain such knowledge after You
+    make Your Modification available as described in Section 3.2, You
+    shall promptly modify the LEGAL file in all copies You make
+    available thereafter and shall take other steps (such as notifying
+    appropriate mailing lists or newsgroups) reasonably calculated to
+    inform those who received the Covered Code that new knowledge has
+    been obtained. 
+
+(b) Contributor APIs.
+    If Your Modification is an application programming interface and
+    You own or control patents which are reasonably necessary to
+    implement that API, you must also include this information in the
+    LEGAL file. 
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source
+Code, and this License in any documentation for the Source Code, where
+You describe recipients` rights relating to Covered Code. If You
+created one or more Modification(s), You may add your name as a
+Contributor to the notice described in Exhibit A. If it is not
+possible to put such notice in a particular Source Code file due to
+its structure, then you must include such notice in a location (such
+as a relevant directory file) where a user would be likely to look for
+such a notice. You may choose to offer, and to charge a fee for,
+warranty, support, indemnity or liability obligations to one or more
+recipients of Covered Code. However, You may do so only on Your own
+behalf, and not on behalf of the Initial Developer or any
+Contributor. You must make it absolutely clear than any such warranty,
+support, indemnity or liability obligation is offered by You alone,
+and You hereby agree to indemnify the Initial Developer and every
+Contributor for any liability incurred by the Initial Developer or
+such Contributor as a result of warranty, support, indemnity or
+liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the
+requirements of Section 3.1-3.5 have been met for that Covered Code,
+and if You include a notice stating that the Source Code version of
+the Covered Code is available under the terms of this License,
+including a description of how and where You have fulfilled the
+obligations of Section 3.2. The notice must be conspicuously included
+in any notice in an Executable version, related documentation or
+collateral in which You describe recipients` rights relating to the
+Covered Code. You may distribute the Executable version of Covered
+Code under a license of Your choice, which may contain terms different
+from this License, provided that You are in compliance with the terms
+of this License and that the license for the Executable version does
+not attempt to limit or alter the recipient`s rights in the Source
+Code version from the rights set forth in this License. If You
+distribute the Executable version under a different license You must
+make it absolutely clear that any terms which differ from this License
+are offered by You alone, not by the Initial Developer or any
+Contributor. You hereby agree to indemnify the Initial Developer and
+every Contributor for any liability incurred by the Initial Developer
+or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code
+not governed by the terms of this License and distribute the Larger
+Work as a single product. In such a case, You must make sure the
+requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Code due to statute
+or regulation then You must: (a) comply with the terms of this License
+to the maximum extent possible; and (b) describe the limitations and
+the code they affect. Such description must be included in the LEGAL
+file described in Section 3.4 and must be included with all
+distributions of the Source Code. Except to the extent prohibited by
+statute or regulation, such description must be sufficiently detailed
+for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+
+This License applies to code to which the Initial Developer has
+attached the notice in Exhibit A, and to related Covered Code.
+
+6. CONNECTION TO MOZILLA PUBLIC LICENSE
+
+This Erlang License is a derivative work of the Mozilla Public
+License, Version 1.0. It contains terms which differ from the Mozilla
+Public License, Version 1.0.
+
+7. DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS`` BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR
+NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF
+THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE
+IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
+CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
+CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART
+OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER
+EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. All
+sublicenses to the Covered Code which are properly granted shall
+survive any termination of this License. Provisions which, by their
+nature, must remain in effect beyond the termination of this License
+shall survive.
+
+9. DISCLAIMER OF LIABILITY
+Any utilization of Covered Code shall not cause the Initial Developer
+or any Contributor to be liable for any damages (neither direct nor
+indirect).
+
+10. MISCELLANEOUS
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision is held to be unenforceable, such
+provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be construed by and in accordance with
+the substantive laws of Sweden. Any dispute, controversy or claim
+arising out of or relating to this License, or the breach, termination
+or invalidity thereof, shall be subject to the exclusive jurisdiction
+of Swedish courts, with the Stockholm City Court as the first
+instance.
+ 
+EXHIBIT A.
+
+``The contents of this file are subject to the Erlang Public License,
+Version 1.1, (the "License"); you may not use this file except in
+compliance with the License. You should have received a copy of the
+Erlang Public License along with this software. If not, it can be
+retrieved via the world wide web at http://www.erlang.org/.
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+the License for the specific language governing rights and limitations
+under the License.
+
+The Initial Developer of the Original Code is Ericsson Utvecklings AB.
+Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
+AB. All Rights Reserved.``
+
diff --git a/meta/files/common-licenses/FSF-Unlimited b/meta/files/common-licenses/FSF-Unlimited
new file mode 100644
index 0000000..010a981
--- /dev/null
+++ b/meta/files/common-licenses/FSF-Unlimited
@@ -0,0 +1,4 @@
+Copyright (C) 1997-2010 Free Software Foundation, Inc.
+This file is free software; the Free Software Foundation
+gives unlimited permission to copy and/or distribute it,
+with or without modifications, as long as this notice is preserved.
diff --git a/meta/files/common-licenses/Fair b/meta/files/common-licenses/Fair
new file mode 100644
index 0000000..475b01d
--- /dev/null
+++ b/meta/files/common-licenses/Fair
@@ -0,0 +1,11 @@
+
+Fair License
+(plain text)
+<Copyright Information>
+
+Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.
+
+DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
+
+[2004, Fair License: rhid.com/fair (this URL no longer works)]
+
diff --git a/meta/files/common-licenses/Frameworx-1.0 b/meta/files/common-licenses/Frameworx-1.0
new file mode 100644
index 0000000..2abb184
--- /dev/null
+++ b/meta/files/common-licenses/Frameworx-1.0
@@ -0,0 +1,69 @@
+
+THE FRAMEWORX OPEN LICENSE 1.0
+This License Agreement, The Frameworx Open License 1.0, has been entered into between The Frameworx Company and you, the licensee hereunder, effective as of Your acceptance of the Frameworx Code Base or an Downstream Distribution (each as defined below).
+
+AGREEMENT BACKGROUND
+The Frameworx Company is committed to the belief that open source software results in better quality, greater technical and product innovation in the market place and a more empowered and productive developer and end-user community. Our objective is to ensure that the Frameworx Code Base, and the source code for improvements and innovations to it, remain free and open to the community.To further these beliefs and objectives, we are distributing the Frameworx Code Base, without royalties and in source code form, to the community pursuant to this License Agreement.
+
+AGREEMENT TERMS
+The Frameworx Company and You have agreed as follows:
+1.Definitions.The following terms have the following respective meanings:
+
+(a)     Frameworx Code Base means the software developed by The Frameworx Company and made available under this License Agreement
+
+(b)     Downstream Distribution means any direct or indirect release, distribution or remote availability of software (i) that directly or indirectly contains, or depends for its intended functioning on, the Frameworx Code Base or any portion or element thereof and (ii) in which rights to use and distribute such Frameworx Code Base software depend, directly or indirectly, on the License provided in Section 2 below.
+
+(c)     "Source Code" to any software means the preferred form for making modifications to that software, including any associated documentation, interface definition files and compilation or installation scripts, or any version thereof that has been compressed or archived, and can be reconstituted, using an appropriate and generally available archival or compression technology.
+
+(d)     Value-Added Services means any commercial or fee-based software-related service, including without limitation: system or application development or consulting; technical or end-user support or training; distribution maintenance, configuration or versioning; or outsourced, hosted or network-based application services.
+
+2. License Grant. Subject to the terms and conditions hereof, The Frameworx Company hereby grants You a non-exclusive license (the License), subject to third party intellectual property claims, and for no fee other than a nominal charge reflecting the costs of physical distribution, to:
+
+(a)     use the Frameworx Code Base, in either Source Code or machine-readable form;
+
+(b)     make modifications, additions and deletions to the content or structure of the Frameworx Code Base; or
+
+(c)     create larger works or derivative works including the Frameworx Code Base or any portion or element thereof; and
+
+(d)     release, distribute or make available, either generally or to any specific third-party, any of the foregoing in Source Code or binary form.
+
+3. License Conditions. The grant of the License under Section 1 hereof, and your exercise of all rights in connection with this License Agreement, will remain subject to the following terms and conditions, as well as to the other provisions hereof:
+
+(a)     Complete Source Code for any Downstream Distribution directly or indirectly made by You that contains, or depends for its intended functionality on, the Frameworx Code Base, or any portion or element thereof, shall be made freely available to all users thereof on terms and conditions no more restrictive, and no less favorable for any user (including, without limitation, with regard to Source Code availability and royalty-free use) than those terms and conditions provided in this License Agreement.
+
+(b)     Any Value-Added Services that you offer or provide, directly or indirectly, in relation to any Downstream Distribution shall be offered and provided on commercial terms that are reasonably commensurate to the fair market value of such Value-Added Services. In addition, the terms and conditions on which any such Value Added Services are so offered or provided shall be consistent with, and shall fully support, the intent and purpose of this License Agreement.
+
+(c)     All Downstream Distributions shall:
+
+                               (i)            include all portions and elements of the Frameworx Code Base required to build the Source Code of such Downstream Distribution into a fully functional machine-executable system, or additional build scripts or comparable software necessary and sufficient for such purposes;
+
+                             (ii)            include, in each file containing any portion or element of the Frameworx Code Base, the following identifying legend: This file contains software that has been made available under The Frameworx Open License 1.0. Use and distribution hereof are subject to the restrictions set forth therein.
+
+                            (iii)            include all other copyright notices, authorship credits, warranty disclaimers (including that provided in Section 6 below), legends, documentation, annotations and comments contained in the Frameworx Code Base as provided to You hereunder;
+
+                            (iv)            contain an unaltered copy of the html file named frameworx_community_invitation.html included within the Frameworx Code Base that acknowledges new users and provides them with information on the Frameworx Code Base community;
+
+                              (v)            contain an unaltered copy of the text file named the_frameworx_license.txt included within the Frameworx Code Base that includes a text copy of the form of this License Agreement; and
+
+                            (vi)            prominently display to any viewer or user of the Source Code of such Open Downstream Distribution, in the place and manner normally used for such displays, the following legend:
+
+Source code licensed under from The Frameworx Company is contained herein, and such source code has been obtained either under The Frameworx Open License, or another license granted by The Frameworx Company. Use and distribution hereof is subject to the restrictions provided in the relevant such license and to the copyrights of the licensor thereunder. A copy of The Frameworx Open License is provided in a file named the_frameworx_license.txt and included herein, and may also be available for inspection at http://www.frameworx.com.
+
+4. Restrictions on Open Downstream Distributions. Each Downstream Distribution made by You, and by any party directly or indirectly obtaining rights to the Frameworx Code Base through You, shall be made subject to a license grant or agreement to the extent necessary so that each distributee under that Downstream Distribution will be subject to the same restrictions on re-distribution and use as are binding on You hereunder. You may satisfy this licensing requirement either by:
+
+(a)     requiring as a condition to any Downstream Distribution made by you, or by any direct or indirect distributee of Your Downstream Distribution (or any portion or element thereof), that each distributee under the relevant Downstream Distribution obtain a direct license (on the same terms and conditions as those in this License Agreement) from The Frameworx Company; or
+
+(b)     sub-licensing all (and not less than all) of Your rights and obligations hereunder to that distributee, including (without limitation) Your obligation to require distributees to be bound by license restrictions as contemplated by this Section 4 above.
+
+The Frameworx Company hereby grants to you all rights to sub-license your rights hereunder as necessary to fully effect the intent and purpose of this Section 4 above, provided, however, that your rights and obligations hereunder shall be unaffected by any such sublicensing. In addition, The Frameworx Company expressly retains all rights to take all appropriate action (including legal action) against any such direct or indirect sub-licensee to ensure its full compliance with the intent and purposes of this License Agreement.
+
+5. Intellectual Property. Except as expressly provided herein, this License Agreement preserves and respects Your and The Frameworx Companys respective intellectual property rights, including, in the case of The Frameworx Company, its copyrights and patent rights relating to the Frameworx Code Base.
+
+6. Warranty Disclaimer. THE SOFTWARE LICENSED HEREUNDER IS PROVIDED ``AS IS.`` ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT, ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE LICENSOR OF THIS SOFTWARE, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES INCLUDING (BUT NOT LIMITED TO) PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+7. License Violation. The License, and all of your rights thereunder, shall be deemed automatically terminated and void as of any Downstream Distribution directly or indirectly made or facilitated by You that violates the provisions of this License Agreement, provided, however, that this License Agreement shall survive any such termination in order to remedy the effects of such violation. This License Agreement shall be binding on the legal successors and assigns of the parties hereto.
+
+Your agreement to the foregoing as of the date hereof has been evidenced by your acceptance of the relevant software distribution hereunder.
+
+(C) THE FRAMEWORX COMPANY 2003
+
diff --git a/meta/files/common-licenses/FreeType b/meta/files/common-licenses/FreeType
new file mode 100644
index 0000000..b7d4d11
--- /dev/null
+++ b/meta/files/common-licenses/FreeType
@@ -0,0 +1,170 @@
+                    The FreeType Project LICENSE
+                    ----------------------------
+
+                            2006-Jan-27
+
+                    Copyright 1996-2002, 2006 by
+          David Turner, Robert Wilhelm, and Werner Lemberg
+
+
+
+Introduction
+============
+
+  The FreeType  Project is distributed in  several archive packages;
+  some of them may contain, in addition to the FreeType font engine,
+  various tools and  contributions which rely on, or  relate to, the
+  FreeType Project.
+
+  This  license applies  to all  files found  in such  packages, and
+  which do not  fall under their own explicit  license.  The license
+  affects  thus  the  FreeType   font  engine,  the  test  programs,
+  documentation and makefiles, at the very least.
+
+  This  license   was  inspired  by  the  BSD,   Artistic,  and  IJG
+  (Independent JPEG  Group) licenses, which  all encourage inclusion
+  and  use of  free  software in  commercial  and freeware  products
+  alike.  As a consequence, its main points are that:
+
+    o We don't promise that this software works. However, we will be
+      interested in any kind of bug reports. (`as is' distribution)
+
+    o You can  use this software for whatever you  want, in parts or
+      full form, without having to pay us. (`royalty-free' usage)
+
+    o You may not pretend that  you wrote this software.  If you use
+      it, or  only parts of it,  in a program,  you must acknowledge
+      somewhere  in  your  documentation  that  you  have  used  the
+      FreeType code. (`credits')
+
+  We  specifically  permit  and  encourage  the  inclusion  of  this
+  software, with  or without modifications,  in commercial products.
+  We  disclaim  all warranties  covering  The  FreeType Project  and
+  assume no liability related to The FreeType Project.
+
+
+  Finally,  many  people  asked  us  for  a  preferred  form  for  a
+  credit/disclaimer to use in compliance with this license.  We thus
+  encourage you to use the following text:
+
+   """  
+    Portions of this software are copyright � <year> The FreeType
+    Project (www.freetype.org).  All rights reserved.
+   """
+
+  Please replace <year> with the value from the FreeType version you
+  actually use.
+
+
+Legal Terms
+===========
+
+0. Definitions
+--------------
+
+  Throughout this license,  the terms `package', `FreeType Project',
+  and  `FreeType  archive' refer  to  the  set  of files  originally
+  distributed  by the  authors  (David Turner,  Robert Wilhelm,  and
+  Werner Lemberg) as the `FreeType Project', be they named as alpha,
+  beta or final release.
+
+  `You' refers to  the licensee, or person using  the project, where
+  `using' is a generic term including compiling the project's source
+  code as  well as linking it  to form a  `program' or `executable'.
+  This  program is  referred to  as  `a program  using the  FreeType
+  engine'.
+
+  This  license applies  to all  files distributed  in  the original
+  FreeType  Project,   including  all  source   code,  binaries  and
+  documentation,  unless  otherwise  stated   in  the  file  in  its
+  original, unmodified form as  distributed in the original archive.
+  If you are  unsure whether or not a particular  file is covered by
+  this license, you must contact us to verify this.
+
+  The FreeType  Project is copyright (C) 1996-2000  by David Turner,
+  Robert Wilhelm, and Werner Lemberg.  All rights reserved except as
+  specified below.
+
+1. No Warranty
+--------------
+
+  THE FREETYPE PROJECT  IS PROVIDED `AS IS' WITHOUT  WARRANTY OF ANY
+  KIND, EITHER  EXPRESS OR IMPLIED,  INCLUDING, BUT NOT  LIMITED TO,
+  WARRANTIES  OF  MERCHANTABILITY   AND  FITNESS  FOR  A  PARTICULAR
+  PURPOSE.  IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
+  BE LIABLE  FOR ANY DAMAGES CAUSED  BY THE USE OR  THE INABILITY TO
+  USE, OF THE FREETYPE PROJECT.
+
+2. Redistribution
+-----------------
+
+  This  license  grants  a  worldwide, royalty-free,  perpetual  and
+  irrevocable right  and license to use,  execute, perform, compile,
+  display,  copy,   create  derivative  works   of,  distribute  and
+  sublicense the  FreeType Project (in  both source and  object code
+  forms)  and  derivative works  thereof  for  any  purpose; and  to
+  authorize others  to exercise  some or all  of the  rights granted
+  herein, subject to the following conditions:
+
+    o Redistribution of  source code  must retain this  license file
+      (`FTL.TXT') unaltered; any  additions, deletions or changes to
+      the original  files must be clearly  indicated in accompanying
+      documentation.   The  copyright   notices  of  the  unaltered,
+      original  files must  be  preserved in  all  copies of  source
+      files.
+
+    o Redistribution in binary form must provide a  disclaimer  that
+      states  that  the software is based in part of the work of the
+      FreeType Team,  in  the  distribution  documentation.  We also
+      encourage you to put an URL to the FreeType web page  in  your
+      documentation, though this isn't mandatory.
+
+  These conditions  apply to any  software derived from or  based on
+  the FreeType Project,  not just the unmodified files.   If you use
+  our work, you  must acknowledge us.  However, no  fee need be paid
+  to us.
+
+3. Advertising
+--------------
+
+  Neither the  FreeType authors and  contributors nor you  shall use
+  the name of the  other for commercial, advertising, or promotional
+  purposes without specific prior written permission.
+
+  We suggest,  but do not require, that  you use one or  more of the
+  following phrases to refer  to this software in your documentation
+  or advertising  materials: `FreeType Project',  `FreeType Engine',
+  `FreeType library', or `FreeType Distribution'.
+
+  As  you have  not signed  this license,  you are  not  required to
+  accept  it.   However,  as  the FreeType  Project  is  copyrighted
+  material, only  this license, or  another one contracted  with the
+  authors, grants you  the right to use, distribute,  and modify it.
+  Therefore,  by  using,  distributing,  or modifying  the  FreeType
+  Project, you indicate that you understand and accept all the terms
+  of this license.
+
+4. Contacts
+-----------
+
+  There are two mailing lists related to FreeType:
+
+    o freetype@nongnu.org
+
+      Discusses general use and applications of FreeType, as well as
+      future and  wanted additions to the  library and distribution.
+      If  you are looking  for support,  start in  this list  if you
+      haven't found anything to help you in the documentation.
+
+    o freetype-devel@nongnu.org
+
+      Discusses bugs,  as well  as engine internals,  design issues,
+      specific licenses, porting, etc.
+
+  Our home page can be found at
+
+    http://www.freetype.org
+
+
+--- end of FTL.TXT ---
+
diff --git a/meta/files/common-licenses/GFDL-1.1 b/meta/files/common-licenses/GFDL-1.1
new file mode 100644
index 0000000..4a0fe1c
--- /dev/null
+++ b/meta/files/common-licenses/GFDL-1.1
@@ -0,0 +1,397 @@
+		GNU Free Documentation License
+		  Version 1.2, November 2002
+
+
+ Copyright (C) 2000,2001,2002  Free Software Foundation, Inc.
+     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense.  It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does.  But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book.  We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The "Document", below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as "you".  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject.  (Thus, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.)  The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters.  A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification.  Examples of
+transparent image formats include PNG, XCF and JPG.  Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page.  For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License.  You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute.  However, you may accept
+compensation in exchange for copies.  If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover.  Both covers must also clearly and legibly identify
+you as the publisher of these copies.  The front cover must present
+the full title with all words of the title equally prominent and
+visible.  You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it.  In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+   from that of the Document, and from those of previous versions
+   (which should, if there were any, be listed in the History section
+   of the Document).  You may use the same title as a previous version
+   if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+   responsible for authorship of the modifications in the Modified
+   Version, together with at least five of the principal authors of the
+   Document (all of its principal authors, if it has fewer than five),
+   unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+   Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+   adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+   giving the public permission to use the Modified Version under the
+   terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+   and required Cover Texts given in the Document's license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+   to it an item stating at least the title, year, new authors, and
+   publisher of the Modified Version as given on the Title Page.  If
+   there is no section Entitled "History" in the Document, create one
+   stating the title, year, authors, and publisher of the Document as
+   given on its Title Page, then add an item describing the Modified
+   Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+   public access to a Transparent copy of the Document, and likewise
+   the network locations given in the Document for previous versions
+   it was based on.  These may be placed in the "History" section.
+   You may omit a network location for a work that was published at
+   least four years before the Document itself, or if the original
+   publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+   Preserve the Title of the section, and preserve in the section all
+   the substance and tone of each of the contributor acknowledgements
+   and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+   unaltered in their text and in their titles.  Section numbers
+   or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements".  Such a section
+   may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+   or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant.  To do this, add their titles to the
+list of Invariant Sections in the Modified Version's license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version.  Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity.  If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy.  If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications".  You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation's users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document's Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections.  You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License.  Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License.  However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation 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.  See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation.  If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+    Copyright (c)  YEAR  YOUR NAME.
+    Permission is granted to copy, distribute and/or modify this document
+    under the terms of the GNU Free Documentation License, Version 1.2
+    or any later version published by the Free Software Foundation;
+    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+    A copy of the license is included in the section entitled "GNU
+    Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+    with the Invariant Sections being LIST THEIR TITLES, with the
+    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
diff --git a/meta/files/common-licenses/GFDL-1.2 b/meta/files/common-licenses/GFDL-1.2
new file mode 100644
index 0000000..ec872c6
--- /dev/null
+++ b/meta/files/common-licenses/GFDL-1.2
@@ -0,0 +1,399 @@
+
+                GNU Free Documentation License
+                  Version 1.2, November 2002
+
+
+ Copyright (C) 2000,2001,2002  Free Software Foundation, Inc.
+     51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense.  It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does.  But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book.  We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The "Document", below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as "you".  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document`s overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject.  (Thus, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.)  The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters.  A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification.  Examples of
+transparent image formats include PNG, XCF and JPG.  Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page.  For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work`s title,
+preceding the beginning of the body of the text.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License.  You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute.  However, you may accept
+compensation in exchange for copies.  If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document`s license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover.  Both covers must also clearly and legibly identify
+you as the publisher of these copies.  The front cover must present
+the full title with all words of the title equally prominent and
+visible.  You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to give
+them a chance to provide you with an updated version of the Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it.  In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+   from that of the Document, and from those of previous versions
+   (which should, if there were any, be listed in the History section
+   of the Document).  You may use the same title as a previous version
+   if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+   responsible for authorship of the modifications in the Modified
+   Version, together with at least five of the principal authors of the
+   Document (all of its principal authors, if it has fewer than five),
+   unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+   Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+   adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+   giving the public permission to use the Modified Version under the
+   terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+   and required Cover Texts given in the Document`s license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+   to it an item stating at least the title, year, new authors, and
+   publisher of the Modified Version as given on the Title Page.  If
+   there is no section Entitled "History" in the Document, create one
+   stating the title, year, authors, and publisher of the Document as
+   given on its Title Page, then add an item describing the Modified
+   Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+   public access to a Transparent copy of the Document, and likewise
+   the network locations given in the Document for previous versions
+   it was based on.  These may be placed in the "History" section.
+   You may omit a network location for a work that was published at
+   least four years before the Document itself, or if the original
+   publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+   Preserve the Title of the section, and preserve in the section all
+   the substance and tone of each of the contributor acknowledgements
+   and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+   unaltered in their text and in their titles.  Section numbers
+   or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements".  Such a section
+   may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+   or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant.  To do this, add their titles to the
+list of Invariant Sections in the Modified Version`s license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version.  Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity.  If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy.  If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications".  You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other documents
+released under this License, and replace the individual copies of this
+License in the various documents with a single copy that is included in
+the collection, provided that you follow the rules of this License for
+verbatim copying of each of the documents in all other respects.
+
+You may extract a single document from such a collection, and distribute
+it individually under this License, provided you insert a copy of this
+License into the extracted document, and follow this License in all
+other respects regarding verbatim copying of that document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation`s users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document`s Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections.  You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document except
+as expressly provided for under this License.  Any other attempt to
+copy, modify, sublicense or distribute the Document is void, and will
+automatically terminate your rights under this License.  However,
+parties who have received copies, or rights, from you under this
+License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions
+of the GNU Free Documentation 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.  See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation.  If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+    Copyright (c)  YEAR  YOUR NAME.
+    Permission is granted to copy, distribute and/or modify this document
+    under the terms of the GNU Free Documentation License, Version 1.2
+    or any later version published by the Free Software Foundation;
+    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+    A copy of the license is included in the section entitled "GNU
+    Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+    with the Invariant Sections being LIST THEIR TITLES, with the
+    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
diff --git a/meta/files/common-licenses/GFDL-1.3 b/meta/files/common-licenses/GFDL-1.3
new file mode 100644
index 0000000..ab11a44
--- /dev/null
+++ b/meta/files/common-licenses/GFDL-1.3
@@ -0,0 +1,453 @@
+
+
+                GNU Free Documentation License
+                 Version 1.3, 3 November 2008
+
+
+ Copyright (C) 2000, 2001, 2002, 2007, 2008 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.
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense.  It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does.  But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book.  We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License.  Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein.  The "Document", below,
+refers to any such manual or work.  Any member of the public is a
+licensee, and is addressed as "you".  You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document`s overall
+subject (or to related matters) and contains nothing that could fall
+directly within that overall subject.  (Thus, if the Document is in
+part a textbook of mathematics, a Secondary Section may not explain
+any mathematics.)  The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License.  If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant.  The Document may contain zero
+Invariant Sections.  If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License.  A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters.  A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text.  A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification.  Examples of
+transparent image formats include PNG, XCF and JPG.  Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page.  For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work`s title,
+preceding the beginning of the body of the text.
+
+The "publisher" means any person or entity that distributes copies of
+the Document to the public.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language.  (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".)  To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document.  These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no
+other conditions whatsoever to those of this License.  You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute.  However, you may accept
+compensation in exchange for copies.  If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document`s license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover.  Both covers must also clearly and legibly identify
+you as the publisher of these copies.  The front cover must present
+the full title with all words of the title equally prominent and
+visible.  You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document numbering
+more than 100, you must either include a machine-readable Transparent
+copy along with each Opaque copy, or state in or with each Opaque copy
+a computer-network location from which the general network-using
+public has access to download using public-standard network protocols
+a complete Transparent copy of the Document, free of added material.
+If you use the latter option, you must take reasonably prudent steps,
+when you begin distribution of Opaque copies in quantity, to ensure
+that this Transparent copy will remain thus accessible at the stated
+location until at least one year after the last time you distribute an
+Opaque copy (directly or through your agents or retailers) of that
+edition to the public.
+
+It is requested, but not required, that you contact the authors of the
+Document well before redistributing any large number of copies, to
+give them a chance to provide you with an updated version of the
+Document.
+
+
+4. MODIFICATIONS
+
+You may copy and distribute a Modified Version of the Document under
+the conditions of sections 2 and 3 above, provided that you release
+the Modified Version under precisely this License, with the Modified
+Version filling the role of the Document, thus licensing distribution
+and modification of the Modified Version to whoever possesses a copy
+of it.  In addition, you must do these things in the Modified Version:
+
+A. Use in the Title Page (and on the covers, if any) a title distinct
+   from that of the Document, and from those of previous versions
+   (which should, if there were any, be listed in the History section
+   of the Document).  You may use the same title as a previous version
+   if the original publisher of that version gives permission.
+B. List on the Title Page, as authors, one or more persons or entities
+   responsible for authorship of the modifications in the Modified
+   Version, together with at least five of the principal authors of the
+   Document (all of its principal authors, if it has fewer than five),
+   unless they release you from this requirement.
+C. State on the Title page the name of the publisher of the
+   Modified Version, as the publisher.
+D. Preserve all the copyright notices of the Document.
+E. Add an appropriate copyright notice for your modifications
+   adjacent to the other copyright notices.
+F. Include, immediately after the copyright notices, a license notice
+   giving the public permission to use the Modified Version under the
+   terms of this License, in the form shown in the Addendum below.
+G. Preserve in that license notice the full lists of Invariant Sections
+   and required Cover Texts given in the Document`s license notice.
+H. Include an unaltered copy of this License.
+I. Preserve the section Entitled "History", Preserve its Title, and add
+   to it an item stating at least the title, year, new authors, and
+   publisher of the Modified Version as given on the Title Page.  If
+   there is no section Entitled "History" in the Document, create one
+   stating the title, year, authors, and publisher of the Document as
+   given on its Title Page, then add an item describing the Modified
+   Version as stated in the previous sentence.
+J. Preserve the network location, if any, given in the Document for
+   public access to a Transparent copy of the Document, and likewise
+   the network locations given in the Document for previous versions
+   it was based on.  These may be placed in the "History" section.
+   You may omit a network location for a work that was published at
+   least four years before the Document itself, or if the original
+   publisher of the version it refers to gives permission.
+K. For any section Entitled "Acknowledgements" or "Dedications",
+   Preserve the Title of the section, and preserve in the section all
+   the substance and tone of each of the contributor acknowledgements
+   and/or dedications given therein.
+L. Preserve all the Invariant Sections of the Document,
+   unaltered in their text and in their titles.  Section numbers
+   or the equivalent are not considered part of the section titles.
+M. Delete any section Entitled "Endorsements".  Such a section
+   may not be included in the Modified Version.
+N. Do not retitle any existing section to be Entitled "Endorsements"
+   or to conflict in title with any Invariant Section.
+O. Preserve any Warranty Disclaimers.
+
+If the Modified Version includes new front-matter sections or
+appendices that qualify as Secondary Sections and contain no material
+copied from the Document, you may at your option designate some or all
+of these sections as invariant.  To do this, add their titles to the
+list of Invariant Sections in the Modified Version`s license notice.
+These titles must be distinct from any other section titles.
+
+You may add a section Entitled "Endorsements", provided it contains
+nothing but endorsements of your Modified Version by various
+parties--for example, statements of peer review or that the text has
+been approved by an organization as the authoritative definition of a
+standard.
+
+You may add a passage of up to five words as a Front-Cover Text, and a
+passage of up to 25 words as a Back-Cover Text, to the end of the list
+of Cover Texts in the Modified Version.  Only one passage of
+Front-Cover Text and one of Back-Cover Text may be added by (or
+through arrangements made by) any one entity.  If the Document already
+includes a cover text for the same cover, previously added by you or
+by arrangement made by the same entity you are acting on behalf of,
+you may not add another; but you may replace the old one, on explicit
+permission from the previous publisher that added the old one.
+
+The author(s) and publisher(s) of the Document do not by this License
+give permission to use their names for publicity for or to assert or
+imply endorsement of any Modified Version.
+
+
+5. COMBINING DOCUMENTS
+
+You may combine the Document with other documents released under this
+License, under the terms defined in section 4 above for modified
+versions, provided that you include in the combination all of the
+Invariant Sections of all of the original documents, unmodified, and
+list them all as Invariant Sections of your combined work in its
+license notice, and that you preserve all their Warranty Disclaimers.
+
+The combined work need only contain one copy of this License, and
+multiple identical Invariant Sections may be replaced with a single
+copy.  If there are multiple Invariant Sections with the same name but
+different contents, make the title of each such section unique by
+adding at the end of it, in parentheses, the name of the original
+author or publisher of that section if known, or else a unique number.
+Make the same adjustment to the section titles in the list of
+Invariant Sections in the license notice of the combined work.
+
+In the combination, you must combine any sections Entitled "History"
+in the various original documents, forming one section Entitled
+"History"; likewise combine any sections Entitled "Acknowledgements",
+and any sections Entitled "Dedications".  You must delete all sections
+Entitled "Endorsements".
+
+
+6. COLLECTIONS OF DOCUMENTS
+
+You may make a collection consisting of the Document and other
+documents released under this License, and replace the individual
+copies of this License in the various documents with a single copy
+that is included in the collection, provided that you follow the rules
+of this License for verbatim copying of each of the documents in all
+other respects.
+
+You may extract a single document from such a collection, and
+distribute it individually under this License, provided you insert a
+copy of this License into the extracted document, and follow this
+License in all other respects regarding verbatim copying of that
+document.
+
+
+7. AGGREGATION WITH INDEPENDENT WORKS
+
+A compilation of the Document or its derivatives with other separate
+and independent documents or works, in or on a volume of a storage or
+distribution medium, is called an "aggregate" if the copyright
+resulting from the compilation is not used to limit the legal rights
+of the compilation`s users beyond what the individual works permit.
+When the Document is included in an aggregate, this License does not
+apply to the other works in the aggregate which are not themselves
+derivative works of the Document.
+
+If the Cover Text requirement of section 3 is applicable to these
+copies of the Document, then if the Document is less than one half of
+the entire aggregate, the Document`s Cover Texts may be placed on
+covers that bracket the Document within the aggregate, or the
+electronic equivalent of covers if the Document is in electronic form.
+Otherwise they must appear on printed covers that bracket the whole
+aggregate.
+
+
+8. TRANSLATION
+
+Translation is considered a kind of modification, so you may
+distribute translations of the Document under the terms of section 4.
+Replacing Invariant Sections with translations requires special
+permission from their copyright holders, but you may include
+translations of some or all Invariant Sections in addition to the
+original versions of these Invariant Sections.  You may include a
+translation of this License, and all the license notices in the
+Document, and any Warranty Disclaimers, provided that you also include
+the original English version of this License and the original versions
+of those notices and disclaimers.  In case of a disagreement between
+the translation and the original version of this License or a notice
+or disclaimer, the original version will prevail.
+
+If a section in the Document is Entitled "Acknowledgements",
+"Dedications", or "History", the requirement (section 4) to Preserve
+its Title (section 1) will typically require changing the actual
+title.
+
+
+9. TERMINATION
+
+You may not copy, modify, sublicense, or distribute the Document
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense, or distribute it is void, and
+will automatically terminate your rights under this License.
+
+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, receipt of a copy of some or all of the same material does
+not give you any rights to use it.
+
+
+10. FUTURE REVISIONS OF THIS LICENSE
+
+The Free Software Foundation may publish new, revised versions of the
+GNU Free Documentation 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.  See
+http://www.gnu.org/copyleft/.
+
+Each version of the License is given a distinguishing version number.
+If the Document specifies that a particular numbered version of this
+License "or any later version" applies to it, you have the option of
+following the terms and conditions either of that specified version or
+of any later version that has been published (not as a draft) by the
+Free Software Foundation.  If the Document does not specify a version
+number of this License, you may choose any version ever published (not
+as a draft) by the Free Software Foundation.  If the Document
+specifies that a proxy can decide which future versions of this
+License can be used, that proxy`s public statement of acceptance of a
+version permanently authorizes you to choose that version for the
+Document.
+
+11. RELICENSING
+
+"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+World Wide Web server that publishes copyrightable works and also
+provides prominent facilities for anybody to edit those works.  A
+public wiki that anybody can edit is an example of such a server.  A
+"Massive Multiauthor Collaboration" (or "MMC") contained in the site
+means any set of copyrightable works thus published on the MMC site.
+
+"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 
+license published by Creative Commons Corporation, a not-for-profit 
+corporation with a principal place of business in San Francisco, 
+California, as well as future copyleft versions of that license 
+published by that same organization.
+
+"Incorporate" means to publish or republish a Document, in whole or in 
+part, as part of another Document.
+
+An MMC is "eligible for relicensing" if it is licensed under this 
+License, and if all works that were first published under this License 
+somewhere other than this MMC, and subsequently incorporated in whole or 
+in part into the MMC, (1) had no cover texts or invariant sections, and 
+(2) were thus incorporated prior to November 1, 2008.
+
+The operator of an MMC Site may republish an MMC contained in the site
+under CC-BY-SA on the same site at any time before August 1, 2009,
+provided the MMC is eligible for relicensing.
+
+
+ADDENDUM: How to use this License for your documents
+
+To use this License in a document you have written, include a copy of
+the License in the document and put the following copyright and
+license notices just after the title page:
+
+    Copyright (c)  YEAR  YOUR NAME.
+    Permission is granted to copy, distribute and/or modify this document
+    under the terms of the GNU Free Documentation License, Version 1.3
+    or any later version published by the Free Software Foundation;
+    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
+    A copy of the license is included in the section entitled "GNU
+    Free Documentation License".
+
+If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
+replace the "with...Texts." line with this:
+
+    with the Invariant Sections being LIST THEIR TITLES, with the
+    Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
+
+If you have Invariant Sections without Cover Texts, or some other
+combination of the three, merge those two alternatives to suit the
+situation.
+
+If your document contains nontrivial examples of program code, we
+recommend releasing these examples in parallel under your choice of
+free software license, such as the GNU General Public License,
+to permit their use in free software.
+
diff --git a/meta/files/common-licenses/GPL-1.0 b/meta/files/common-licenses/GPL-1.0
new file mode 100644
index 0000000..9d4ef93
--- /dev/null
+++ b/meta/files/common-licenses/GPL-1.0
@@ -0,0 +1,252 @@
+
+GNU General Public License, version 1
+
+                    GNU GENERAL PUBLIC LICENSE
+                     Version 1, February 1989
+
+ Copyright (C) 1989 Free Software Foundation, Inc.
+                    51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The license agreements of most software companies try to keep users
+at the mercy of those companies.  By contrast, our General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  The
+General Public License applies to the Free Software Foundation`s
+software and to any other program whose authors commit to using it.
+You can use it for your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Specifically, the General Public License is designed to make
+sure that you have the freedom to give away or sell copies of free
+software, that you receive source code or can get it if you want it,
+that you can change the software or use pieces of it in new free
+programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of a such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must tell them their rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author`s protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors` reputations.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any program or other work which
+contains a notice placed by the copyright holder saying it may be
+distributed under the terms of this General Public License.  The
+"Program", below, refers to any such program or work, and a "work based
+on the Program" means either the Program or any work containing the
+Program or a portion of it, either verbatim or with modifications.  Each
+licensee is addressed as "you".
+
+  1. You may copy and distribute verbatim copies of the Program`s source
+code as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this
+General Public License and to the absence of any warranty; and give any
+other recipients of the Program a copy of this General Public License
+along with the Program.  You may charge a fee for the physical act of
+transferring a copy.
+
+  2. You may modify your copy or copies of the Program or any portion of
+it, and copy and distribute such modifications under the terms of Paragraph
+1 above, provided that you also do the following:
+
+    a) cause the modified files to carry prominent notices stating that
+    you changed the files and the date of any change; and
+
+    b) cause the whole of any work that you distribute or publish, that
+    in whole or in part contains the Program or any part thereof, either
+    with or without modifications, to be licensed at no charge to all
+    third parties under the terms of this General Public License (except
+    that you may choose to grant warranty protection to some or all
+    third parties, at your option).
+
+    c) If the modified program normally reads commands interactively when
+    run, you must cause it, when started running for such interactive use
+    in the simplest and most usual way, to print or display an
+    announcement including an appropriate copyright notice and a notice
+    that there is no warranty (or else, saying that you provide a
+    warranty) and that users may redistribute the program under these
+    conditions, and telling the user how to view a copy of this General
+    Public License.
+
+    d) You may charge a fee for the physical act of transferring a
+    copy, and you may at your option offer warranty protection in
+    exchange for a fee.
+
+Mere aggregation of another independent work with the Program (or its
+derivative) on a volume of a storage or distribution medium does not bring
+the other work under the scope of these terms.
+
+  3. You may copy and distribute the Program (or a portion or derivative of
+it, under Paragraph 2) in object code or executable form under the terms of
+Paragraphs 1 and 2 above provided that you also do one of the following:
+
+    a) accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of
+    Paragraphs 1 and 2 above; or,
+
+    b) accompany it with a written offer, valid for at least three
+    years, to give any third party free (except for a nominal charge
+    for the cost of distribution) a complete machine-readable copy of the
+    corresponding source code, to be distributed under the terms of
+    Paragraphs 1 and 2 above; or,
+
+    c) accompany it with the information you received as to where the
+    corresponding source code may be obtained.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form alone.)
+
+Source code for a work means the preferred form of the work for making
+modifications to it.  For an executable file, complete source code means
+all the source code for all modules it contains; but, as a special
+exception, it need not include source code for modules which are standard
+libraries that accompany the operating system on which the executable
+file runs, or for standard header files or definitions files that
+accompany that operating system.
+
+  4. You may not copy, modify, sublicense, distribute or transfer the
+Program except as expressly provided under this General Public License.
+Any attempt otherwise to copy, modify, sublicense, distribute or transfer
+the Program is void, and will automatically terminate your rights to use
+the Program under this License.  However, parties who have received
+copies, or rights to use copies, from you under this General Public
+License will not have their licenses terminated so long as such parties
+remain in full compliance.
+
+  5. By copying, distributing or modifying the Program (or any work based
+on the Program) you indicate your acceptance of this license to do so,
+and all its terms and conditions.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the original
+licensor to copy, distribute or modify the Program subject to these
+terms and conditions.  You may not impose any further restrictions on the
+recipients` exercise of the rights granted herein.
+
+  7. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of the license which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+the license, you may choose any version ever published by the Free Software
+Foundation.
+
+  8. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                            NO WARRANTY
+
+  9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                     END OF TERMS AND CONDITIONS
+
+        Appendix: 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 humanity, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+  To do so, attach the following notices to the program.  It is safest to
+attach them to the start of each source file to most effectively convey
+the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program`s name and a brief idea of what it does.>
+    Copyright (C) 19yy  <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 1, or (at your option)
+    any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) 19xx name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w`.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c` for details.
+
+The hypothetical commands `show w` and `show c` should show the
+appropriate parts of the General Public License.  Of course, the
+commands you use may be called something other than `show w` and `show
+c`; they could even be mouse-clicks or menu items--whatever suits your
+program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  program `Gnomovision` (a program to direct compilers to make passes
+  at assemblers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+That`s all there is to it!
+
diff --git a/meta/files/common-licenses/GPL-2-with-bison-exception b/meta/files/common-licenses/GPL-2-with-bison-exception
new file mode 100644
index 0000000..dd34273
--- /dev/null
+++ b/meta/files/common-licenses/GPL-2-with-bison-exception
@@ -0,0 +1,7 @@
+
+insert GPL v2 text here
+
+Bison Exception
+As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn`t itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception.
+This special exception was added by the Free Software Foundation in version 2.2 of Bison.
+
diff --git a/meta/files/common-licenses/GPL-2.0 b/meta/files/common-licenses/GPL-2.0
new file mode 100644
index 0000000..7f5abbc
--- /dev/null
+++ b/meta/files/common-licenses/GPL-2.0
@@ -0,0 +1,132 @@
+
+GNU GENERAL PUBLIC LICENSE
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.  
+51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation`s software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author`s protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors` reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone`s free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program`s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients` exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+one line to give the program`s name and an idea of what it does.
+Copyright (C) yyyy  name of author
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+Gnomovision version 69, Copyright (C) year name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w`.  This is free software, and you are welcome
+to redistribute it under certain conditions; type `show c` 
+for details.
+The hypothetical commands `show w` and `show c` should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w` and `show c`; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright
+interest in the program `Gnomovision`
+(which makes passes at compilers) written 
+by James Hacker.
+
+signature of Ty Coon, 1 April 1989
+Ty Coon, President of Vice
+This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
+
diff --git a/meta/files/common-licenses/GPL-2.0-with-GCC-exception b/meta/files/common-licenses/GPL-2.0-with-GCC-exception
new file mode 100644
index 0000000..ff8de09
--- /dev/null
+++ b/meta/files/common-licenses/GPL-2.0-with-GCC-exception
@@ -0,0 +1,17 @@
+
+insert GPL v2 text here
+
+GCC Linking Exception
+In addition to the permissions in the GNU General Public License, the Free
+Software Foundation gives you unlimited permission to link the compiled version
+of this file into combinations with other programs, and to distribute those
+combinations without any restriction coming from the use of this file. (The
+General Public License restrictions do apply in other respects; for example,
+they cover modification of the file, and distribution when not linked into a
+combine executable.)
+
+
+
+
+
+
diff --git a/meta/files/common-licenses/GPL-2.0-with-OpenSSL-exception b/meta/files/common-licenses/GPL-2.0-with-OpenSSL-exception
new file mode 100644
index 0000000..7586c62
--- /dev/null
+++ b/meta/files/common-licenses/GPL-2.0-with-OpenSSL-exception
@@ -0,0 +1,285 @@
+
+GNU GENERAL PUBLIC LICENSE
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.  
+51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation`s software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author`s protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors` reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone`s free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program`s source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients` exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+one line to give the program`s name and an idea of what it does.
+Copyright (C) yyyy  name of author
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+Gnomovision version 69, Copyright (C) year name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w`.  This is free software, and you are welcome
+to redistribute it under certain conditions; type `show c` 
+for details.
+The hypothetical commands `show w` and `show c` should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w` and `show c`; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright
+interest in the program `Gnomovision`
+(which makes passes at compilers) written 
+by James Hacker.
+
+signature of Ty Coon, 1 April 1989
+Ty Coon, President of Vice
+This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
+
+
+In addition, as a special exception, the copyright holder
+gives permission to link the code of this program with
+any version of the OpenSSL library which is distributed
+under a license identical to that listed in the included
+COPYING.OpenSSL file, and distribute linked combinations
+including the two. You must obey the GNU General Public
+License in all respects for all of the code used other
+than OpenSSL. If you modify this file, you may extend this
+exception to your version of the file, but you are not
+obligated to do so. If you do not wish to do so, delete
+this exception statement from your version.
+
+
+    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, version 2 of the License
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+
+  LICENSE ISSUES
+  ==============
+
+  The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
+  the OpenSSL License and the original SSLeay license apply to the toolkit.
+  See below for the actual license texts. Actually both licenses are BSD-style
+  Open Source licenses. In case of any license issues related to OpenSSL
+  please contact openssl-core@openssl.org.
+
+  OpenSSL License
+  ---------------
+
+/* ====================================================================
+ * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer. 
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in
+ *    the documentation and/or other materials provided with the
+ *    distribution.
+ *
+ * 3. All advertising materials mentioning features or use of this
+ *    software must display the following acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ *
+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+ *    endorse or promote products derived from this software without
+ *    prior written permission. For written permission, please contact
+ *    openssl-core@openssl.org.
+ *
+ * 5. Products derived from this software may not be called "OpenSSL"
+ *    nor may "OpenSSL" appear in their names without prior written
+ *    permission of the OpenSSL Project.
+ *
+ * 6. Redistributions of any form whatsoever must retain the following
+ *    acknowledgment:
+ *    "This product includes software developed by the OpenSSL Project
+ *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This product includes cryptographic software written by Eric Young
+ * (eay@cryptsoft.com).  This product includes software written by Tim
+ * Hudson (tjh@cryptsoft.com).
+ *
+ */
+
+ Original SSLeay License
+ -----------------------
+
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+ * All rights reserved.
+ *
+ * This package is an SSL implementation written
+ * by Eric Young (eay@cryptsoft.com).
+ * The implementation was written so as to conform with Netscapes SSL.
+ * 
+ * This library is free for commercial and non-commercial use as long as
+ * the following conditions are aheared to.  The following conditions
+ * apply to all code found in this distribution, be it the RC4, RSA,
+ * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+ * included with this distribution is covered by the same copyright terms
+ * except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ * 
+ * Copyright remains Eric Young's, and as such any Copyright notices in
+ * the code are not to be removed.
+ * If this package is used in a product, Eric Young should be given attribution
+ * as the author of the parts of the library used.
+ * This can be in the form of a textual message at program startup or
+ * in documentation (online or textual) provided with the package.
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *    "This product includes cryptographic software written by
+ *     Eric Young (eay@cryptsoft.com)"
+ *    The word 'cryptographic' can be left out if the rouines from the library
+ *    being used are not cryptographic related :-).
+ * 4. If you include any Windows specific code (or a derivative thereof) from 
+ *    the apps directory (application code) you must include an acknowledgement:
+ *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ * 
+ * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * 
+ * The licence and distribution terms for any publically available version or
+ * derivative of this code cannot be changed.  i.e. this code cannot simply be
+ * copied and put under another distribution licence
+ * [including the GNU Public Licence.]
+ */
diff --git a/meta/files/common-licenses/GPL-2.0-with-autoconf-exception b/meta/files/common-licenses/GPL-2.0-with-autoconf-exception
new file mode 100644
index 0000000..a22aad7
--- /dev/null
+++ b/meta/files/common-licenses/GPL-2.0-with-autoconf-exception
@@ -0,0 +1,6 @@
+
+insert GPL v2 license text here
+
+As a special exception, the respective Autoconf Macro`s copyright owner gives unlimited permission to copy, distribute and modify the configure scripts that are the output of Autoconf when processing the Macro. You need not follow the terms of the GNU General Public License when using  or 
+This special exception to the GPL applies to versions of the Autoconf Macro released by the Autoconf Archive. When you make and distribute a modified version of the Autoconf Macro, you may extend this special exception to the GPL to apply to your modified version as well.
+
diff --git a/meta/files/common-licenses/GPL-2.0-with-classpath-exception b/meta/files/common-licenses/GPL-2.0-with-classpath-exception
new file mode 100644
index 0000000..8d3e9cd
--- /dev/null
+++ b/meta/files/common-licenses/GPL-2.0-with-classpath-exception
@@ -0,0 +1,7 @@
+
+insert GPL v2 license text here
+
+Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination.
+
+As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
+
diff --git a/meta/files/common-licenses/GPL-2.0-with-font-exception b/meta/files/common-licenses/GPL-2.0-with-font-exception
new file mode 100644
index 0000000..abb42f9
--- /dev/null
+++ b/meta/files/common-licenses/GPL-2.0-with-font-exception
@@ -0,0 +1,18 @@
+
+insert GPL v2 text here
+
+Font Exception
+As a special exception, if you create a document which uses this font, and
+embed this font or unaltered portions of this font into the document, this font
+does not by itself cause the resulting document to be covered by the GNU
+General Public License. This exception does not however invalidate any other
+reasons why the document might be covered by the GNU General Public License. If
+you modify this font, you may extend this exception to your version of the
+font, but you are not obligated to do so. If you do not wish to do so, delete
+this exception statement from your version.
+
+
+
+
+
+
diff --git a/meta/files/common-licenses/GPL-3.0 b/meta/files/common-licenses/GPL-3.0
new file mode 100644
index 0000000..e0665a6
--- /dev/null
+++ b/meta/files/common-licenses/GPL-3.0
@@ -0,0 +1,225 @@
+GNU GENERAL PUBLIC LICENSE
+
+Version 3, 29 June 2007
+
+Copyright © 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/meta/files/common-licenses/GPL-3.0-with-GCC-exception b/meta/files/common-licenses/GPL-3.0-with-GCC-exception
new file mode 100644
index 0000000..6c968b6
--- /dev/null
+++ b/meta/files/common-licenses/GPL-3.0-with-GCC-exception
@@ -0,0 +1,27 @@
+
+insert GPL v3 text here
+
+GCC RUNTIME LIBRARY EXCEPTION
+Version 3.1, 31 March 2009
+
+General information:
+http://www.gnu.org/licenses/gcc-exception.html
+Copyright (C) 2009 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.
+This GCC Runtime Library Exception ("Exception") is an additional permission under section 7 of the GNU General Public License, version 3 ("GPLv3"). It applies to a given file (the "Runtime Library") that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception.
+When you use GCC to compile a program, GCC may combine portions of certain GCC header files and runtime libraries with the compiled program. The purpose of this Exception is to allow compilation of non-GPL (including proprietary) programs to use, in this way, the header files and runtime libraries covered by this Exception.
+
+0. Definitions.
+A file is an "Independent Module" if it either requires the Runtime Library for execution after a Compilation Process, or makes use of an interface provided by the Runtime Library, but is not otherwise based on the Runtime Library.
+"GCC" means a version of the GNU Compiler Collection, with or without modifications, governed by version 3 (or a specified later version) of the GNU General Public License (GPL) with the option of using any subsequent versions published by the FSF.
+"GPL-compatible Software" is software whose conditions of propagation, modification and use would permit combination with GCC in accord with the license of GCC.
+"Target Code" refers to output from any compiler for a real or virtual target processor architecture, in executable form or suitable for input to an assembler, loader, linker and/or execution phase. Notwithstanding that, Target Code does not include data in any format that is used as a compiler intermediate representation, or used for producing a compiler intermediate representation.
+The "Compilation Process" transforms code entirely represented in non-intermediate languages designed for human-written code, and/or in Java Virtual Machine byte code, into Target Code. Thus, for example, use of source code generators and preprocessors need not be considered part of the Compilation Process, since the Compilation Process can be understood as starting with the output of the generators or preprocessors.
+A Compilation Process is "Eligible" if it is done using GCC, alone or with other GPL-compatible software, or if it is done without using any work based on GCC. For example, using non-GPL-compatible Software to optimize any GCC intermediate representations would not qualify as an Eligible Compilation Process.
+
+1. Grant of Additional Permission.
+You have permission to propagate a work of Target Code formed by combining the Runtime Library with Independent Modules, even if such propagation would otherwise violate the terms of GPLv3, provided that all Target Code was generated by Eligible Compilation Processes. You may then convey such a combination under terms of your choice, consistent with the licensing of the Independent Modules.
+
+2. No Weakening of GCC Copyleft.
+The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of GCC.
+
diff --git a/meta/files/common-licenses/GPL-3.0-with-autoconf-exception b/meta/files/common-licenses/GPL-3.0-with-autoconf-exception
new file mode 100644
index 0000000..a86f0d7
--- /dev/null
+++ b/meta/files/common-licenses/GPL-3.0-with-autoconf-exception
@@ -0,0 +1,28 @@
+
+insert GPL v3 text here
+
+AUTOCONF CONFIGURE SCRIPT EXCEPTION
+
+Version 3.0, 18 August 2009
+
+Copyright &#169; 2009 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.
+
+This Exception is an additional permission under section 7 of the GNU General Public License, version 3 ("GPLv3"). It applies to a given file that bears a notice placed by the copyright holder of the file stating that the file is governed by GPLv3 along with this Exception.
+
+The purpose of this Exception is to allow distribution of Autoconf`s typical output under terms of the recipient`s choice (including proprietary).
+
+0. Definitions.
+"Covered Code" is the source or object code of a version of Autoconf that is a covered work under this License.
+
+"Normally Copied Code" for a version of Autoconf means all parts of its Covered Code which that version can copy from its code (i.e., not from its input file) into its minimally verbose, non-debugging and non-tracing output.
+
+"Ineligible Code" is Covered Code that is not Normally Copied Code.
+
+1. Grant of Additional Permission.
+You have permission to propagate output of Autoconf, even if such propagation would otherwise violate the terms of GPLv3. However, if by modifying Autoconf you cause any Ineligible Code of the version you received to become Normally Copied Code of your modified version, then you void this Exception for the resulting covered work. If you convey that resulting covered work, you must remove this Exception in accordance with the second paragraph of Section 7 of GPLv3.
+
+2. No Weakening of Autoconf Copyleft.
+The availability of this Exception does not imply any general presumption that third-party software is unaffected by the copyleft requirements of the license of Autoconf.
+
diff --git a/meta/files/common-licenses/HPND b/meta/files/common-licenses/HPND
new file mode 100644
index 0000000..274bbdb
--- /dev/null
+++ b/meta/files/common-licenses/HPND
@@ -0,0 +1,11 @@
+
+Historical Permission Notice and Disclaimer
+
+<copyright notice>
+
+Permission to use, copy, modify and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies[,] [and] that both [that] [the] copyright notice and this permission notice appear in supporting documentation[, and that the name [of] <copyright holder> [or <related entities>] not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission]. [<copyright holder> makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.]
+
+[<copyright holder> DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS[,][.] IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.]
+
+---
+
diff --git a/meta/files/common-licenses/ICU b/meta/files/common-licenses/ICU
new file mode 100644
index 0000000..a29b6fb
--- /dev/null
+++ b/meta/files/common-licenses/ICU
@@ -0,0 +1,13 @@
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1995-2012 International Business Machines Corporation and others
+
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, provided that the above copyright notice(s) and this permission notice appear in all copies of the Software and that both the above copyright notice(s) and this permission notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization of the copyright holder.
+
+All trademarks and registered trademarks mentioned herein are the property of their respective owners. 
diff --git a/meta/files/common-licenses/IPA b/meta/files/common-licenses/IPA
new file mode 100644
index 0000000..d465b1c
--- /dev/null
+++ b/meta/files/common-licenses/IPA
@@ -0,0 +1,95 @@
+
+IPA Font License Agreement v1.0 
+ 
+
+The Licensor provides the Licensed Program (as defined in Article 1 below) under the terms of this license agreement ("Agreement").  Any use, reproduction or distribution of the Licensed Program, or any exercise of rights under this Agreement by a Recipient (as defined in Article 1 below) constitutes the Recipient`s acceptance of this Agreement.
+
+
+Article 1 (Definitions)
+
+1.         "Digital Font Program" shall mean a computer program containing, or used to render or display fonts.
+
+2.         "Licensed Program" shall mean a Digital Font Program licensed by the Licensor under this Agreement.
+
+3.         "Derived Program" shall mean a Digital Font Program created as a result of a modification, addition, deletion, replacement or any other adaptation to or of a part or all of the Licensed Program, and includes a case where a Digital Font Program newly created by retrieving font information from a part or all of the Licensed Program or Embedded Fonts from a Digital Document File with or without modification of the retrieved font information. 
+
+4.         "Digital Content" shall mean products provided to end users in the form of digital data, including video content, motion and/or still pictures, TV programs or other broadcasting content and products consisting of character text, pictures, photographic images, graphic symbols and/or the like.
+
+5.         "Digital Document File" shall mean a PDF file or other Digital Content created by various software programs in which a part or all of the Licensed Program becomes embedded or contained in the file for the display of the font ("Embedded Fonts").  Embedded Fonts are used only in the display of characters in the particular Digital Document File within which they are embedded, and shall be distinguished from those in any Digital Font Program, which may be used for display of characters outside that particular Digital Document File.
+
+6.         "Computer" shall include a server in this Agreement.
+
+7.         "Reproduction and Other Exploitation" shall mean reproduction, transfer, distribution, lease, public transmission, presentation, exhibition, adaptation and any other exploitation.
+
+8.         "Recipient" shall mean anyone who receives the Licensed Program under this Agreement, including one that receives the Licensed Program from a Recipient.
+
+ 
+
+Article 2 (Grant of License)
+
+The Licensor grants to the Recipient a license to use the Licensed Program in any and all countries in accordance with each of the provisions set forth in this Agreement. However, any and all rights underlying in the Licensed Program shall be held by the Licensor. In no sense is this Agreement intended to transfer any right relating to the Licensed Program held by the Licensor except as specifically set forth herein or any right relating to any trademark, trade name, or service mark to the Recipient.
+
+ 
+
+1.         The Recipient may install the Licensed Program on any number of Computers and use the same in accordance with the provisions set forth in this Agreement.
+
+2.         The Recipient may use the Licensed Program, with or without modification in printed materials or in Digital Content as an expression of character texts or the like.
+
+3.         The Recipient may conduct Reproduction and Other Exploitation of the printed materials and Digital Content created in accordance with the preceding Paragraph, for commercial or non-commercial purposes and in any form of media including but not limited to broadcasting, communication and various recording media.
+
+4.         If any Recipient extracts Embedded Fonts from a Digital Document File to create a Derived Program, such Derived Program shall be subject to the terms of this agreement.  
+
+5.         If any Recipient performs Reproduction or Other Exploitation of a Digital Document File in which Embedded Fonts of the Licensed Program are used only for rendering the Digital Content within such Digital Document File then such Recipient shall have no further obligations under this Agreement in relation to such actions.
+
+6.         The Recipient may reproduce the Licensed Program as is without modification and transfer such copies, publicly transmit or otherwise redistribute the Licensed Program to a third party for commercial or non-commercial purposes ("Redistribute"), in accordance with the provisions set forth in Article 3 Paragraph 2.
+
+7.         The Recipient may create, use, reproduce and/or Redistribute a Derived Program under the terms stated above for the Licensed Program: provided, that the Recipient shall follow the provisions set forth in Article 3 Paragraph 1 when Redistributing the Derived Program. 
+
+
+Article 3 (Restriction)
+
+The license granted in the preceding Article shall be subject to the following restrictions:
+
+
+1.         If a Derived Program is Redistributed pursuant to Paragraph 4 and 7 of the preceding Article, the following conditions must be met :
+
+(1)                The following must be also Redistributed together with the Derived Program, or be made available online or by means of mailing mechanisms in exchange for a cost which does not exceed the total costs of postage, storage medium and handling fees:
+
+(a)    a copy of the Derived Program; and
+
+(b)    any additional file created by the font developing program in the course of creating the Derived Program that can be used for further modification of the Derived Program, if any.
+
+(2)                It is required to also Redistribute means to enable recipients of the Derived Program to replace the Derived Program with the Licensed Program first released under this License (the "Original Program").  Such means may be to provide a difference file from the Original Program, or instructions setting out a method to replace the Derived Program with the Original Program.
+
+(3)                The Recipient must license the Derived Program under the terms and conditions of this Agreement.
+
+(4)                No one may use or include the name of the Licensed Program as a program name, font name or file name of the Derived Program.
+
+(5)                Any material to be made available online or by means of mailing a medium to satisfy the requirements of this paragraph may be provided, verbatim, by any party wishing to do so.
+
+2.         If the Recipient Redistributes the Licensed Program pursuant to Paragraph 6 of the preceding Article, the Recipient shall meet all of the following conditions:
+
+(1)                The Recipient may not change the name of the Licensed Program.
+
+(2)                The Recipient may not alter or otherwise modify the Licensed Program.
+
+(3)                The Recipient must attach a copy of this Agreement to the Licensed Program.
+
+3.         THIS LICENSED PROGRAM IS PROVIDED BY THE LICENSOR "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTY AS TO THE LICENSED PROGRAM OR ANY DERIVED PROGRAM, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.  IN NO EVENT SHALL THE LICENSOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXTENDED, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO; PROCUREMENT OF SUBSTITUTED GOODS OR SERVICE; DAMAGES ARISING FROM SYSTEM FAILURE; LOSS OR CORRUPTION OF EXISTING DATA OR PROGRAM; LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE INSTALLATION, USE, THE REPRODUCTION OR OTHER EXPLOITATION OF THE LICENSED PROGRAM OR ANY DERIVED PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+4.         The Licensor is under no obligation to respond to any technical questions or inquiries, or provide any other user support in connection with the installation, use or the Reproduction and Other Exploitation of the Licensed Program or Derived Programs thereof.
+
+
+Article 4 (Termination of Agreement)
+
+1.         The term of this Agreement shall begin from the time of receipt of the Licensed Program by the Recipient and shall continue as long as the Recipient retains any such Licensed Program in any way.
+
+2.         Notwithstanding the provision set forth in the preceding Paragraph, in the event of the breach of any of the provisions set forth in this Agreement by the Recipient, this Agreement shall automatically terminate without any notice. In the case of such termination, the Recipient may not use or conduct Reproduction and Other Exploitation of the Licensed Program or a Derived Program: provided that such termination shall not affect any rights of any other Recipient receiving the Licensed Program or the Derived Program from such Recipient who breached this Agreement.
+
+
+Article 5 (Governing Law)
+
+1.         IPA may publish revised and/or new versions of this License.  In such an event, the Recipient may select either this Agreement or any subsequent version of the Agreement in using, conducting the Reproduction and Other Exploitation of, or Redistributing the Licensed Program or a Derived Program. Other matters not specified above shall be subject to the Copyright Law of Japan and other related laws and regulations of Japan.
+
+2.         This Agreement shall be construed under the laws of Japan.
+
diff --git a/meta/files/common-licenses/IPL-1.0 b/meta/files/common-licenses/IPL-1.0
new file mode 100644
index 0000000..2b136c9
--- /dev/null
+++ b/meta/files/common-licenses/IPL-1.0
@@ -0,0 +1,213 @@
+
+IBM Public License Version 1.0
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS IBM
+PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
+OF THE PROGRAM CONSTITUTES RECIPIENT`S ACCEPTANCE OF THIS AGREEMENT.
+
+1. DEFINITIONS
+"Contribution" means:
+
+in the case of International Business Machines Corporation ("IBM"), the Original Program, and
+in the case of each Contributor,
+changes to the Program, and
+additions to the Program;
+where such changes and/or additions to the Program originate from and
+are distributed by that particular Contributor. A Contribution
+`originates` from a Contributor if it was added to the Program by
+such Contributor itself or anyone acting on such Contributor`s
+behalf. Contributions do not include additions to the Program which:
+(i) are separate modules of software distributed in conjunction with
+the Program under their own license agreement, and (ii) are not
+derivative works of the Program.
+
+"Contributor" means IBM and any other entity that distributes the Program.
+
+"Licensed Patents " mean patent claims licensable by a
+Contributor which are necessarily infringed by the use or sale of its
+Contribution alone or when combined with the Program.
+
+"Original Program" means the original version of the software
+accompanying this Agreement as released by IBM, including source
+code, object code and documentation, if any.
+
+"Program" means the Original Program and Contributions.
+
+"Recipient" means anyone who receives the Program under this
+Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free copyright
+license to reproduce, prepare derivative works of, publicly display,
+publicly perform, distribute and sublicense the Contribution of such
+Contributor, if any, and such derivative works, in source code and
+object code form.
+Subject to the terms of this Agreement, each Contributor hereby
+grants Recipient a non-exclusive, worldwide, royalty-free patent
+license under Licensed Patents to make, use, sell, offer to sell,
+import and otherwise transfer the Contribution of such Contributor,
+if any, in source code and object code form. This patent license
+shall apply to the combination of the Contribution and the Program
+if, at the time the Contribution is added by the Contributor, such
+addition of the Contribution causes such combination to be covered by
+the Licensed Patents. The patent license shall not apply to any
+other combinations which include the Contribution. No hardware per
+se is licensed hereunder.
+
+Recipient understands that although each Contributor grants the
+licenses to its Contributions set forth herein, no assurances are
+provided by any Contributor that the Program does not infringe the
+patent or other intellectual property rights of any other entity.
+Each Contributor disclaims any liability to Recipient for claims
+brought by any other entity based on infringement of intellectual
+property rights or otherwise. As a condition to exercising the
+rights and licenses granted hereunder, each Recipient hereby assumes
+sole responsibility to secure any other intellectual property rights
+needed, if any. For example, if a third party patent license is
+required to allow Recipient to distribute the Program, it is
+Recipient`s responsibility to acquire that license before
+distributing the Program.
+Each Contributor represents that to its knowledge it has
+sufficient copyright rights in its Contribution, if any, to grant the
+copyright license set forth in this Agreement.
+3. REQUIREMENTS
+A Contributor may choose to distribute
+the Program in object code form under its own license agreement,
+provided that:
+
+it complies with the terms and conditions of this Agreement; and
+its license agreement:
+effectively disclaims on behalf of all Contributors all warranties
+and conditions, express and implied, including warranties or
+conditions of title and non-infringement, and implied warranties or
+conditions of merchantability and fitness for a particular purpose;
+effectively excludes on behalf of all Contributors all liability
+for damages, including direct, indirect, special, incidental and
+consequential damages, such as lost profits;
+states that any provisions which differ from this Agreement are
+offered by that Contributor alone and not by any other party; and
+
+states that source code for the Program is available from such
+Contributor, and informs licensees how to obtain it in a reasonable
+manner on or through a medium customarily used for software exchange.
+When the Program is made available in source code form:
+
+it must be made available under this Agreement; and
+a copy of this Agreement must be included with each copy of the
+Program.
+Each Contributor must include the following in a conspicuous location in the Program:
+
+Copyright (C) 1996, 1999 International Business Machines Corporation and others. All Rights Reserved.
+
+In addition, each Contributor must identify itself as the originator
+of its Contribution, if any, in a manner that reasonably allows
+subsequent Recipients to identify the originator of the Contribution.
+
+4. COMMERCIAL DISTRIBUTION
+Commercial distributors of software may accept certain
+responsibilities with respect to end users, business partners and the
+like. While this license is intended to facilitate the commercial
+use of the Program, the Contributor who includes the Program in a
+commercial product offering should do so in a manner which does not
+create potential liability for other Contributors. Therefore, if a
+Contributor includes the Program in a commercial product offering,
+such Contributor ("Commercial Contributor") hereby agrees to defend
+and indemnify every other Contributor ("Indemnified Contributor")
+against any losses, damages and costs (collectively "Losses") arising
+from claims, lawsuits and other legal actions brought by a third
+party against the Indemnified Contributor to the extent caused by the
+acts or omissions of such Commercial Contributor in connection with
+its distribution of the Program in a commercial product offering.
+The obligations in this section do not apply to any claims or Losses
+relating to any actual or alleged intellectual property infringement.
+In order to qualify, an Indemnified Contributor must: a) promptly
+notify the Commercial Contributor in writing of such claim, and b)
+allow the Commercial Contributor to control, and cooperate with the
+Commercial Contributor in, the defense and any related settlement
+negotiations. The Indemnified Contributor may participate in any
+such claim at its own expense.
+
+For example, a Contributor might include the Program in a commercial
+product offering, Product X. That Contributor is then a Commercial
+Contributor. If that Commercial Contributor then makes performance
+claims, or offers warranties related to Product X, those performance
+claims and warranties are such Commercial Contributor`s
+responsibility alone. Under this section, the Commercial Contributor
+would have to defend claims against the other Contributors related to
+those performance claims and warranties, and if a court requires any
+other Contributor to pay any damages as a result, the Commercial
+Contributor must pay those damages.
+
+5. NO WARRANTY
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
+PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
+WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
+OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
+responsible for determining the appropriateness of using and
+distributing the Program and assumes all risks associated with its
+exercise of rights under this Agreement, including but not limited to
+the risks and costs of program errors, compliance with applicable
+laws, damage to or loss of data, programs or equipment, and
+unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
+NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
+GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. GENERAL
+If any provision of this Agreement is invalid or unenforceable under
+applicable law, it shall not affect the validity or enforceability of
+the remainder of the terms of this Agreement, and without further
+action by the parties hereto, such provision shall be reformed to the
+minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with
+respect to a patent applicable to software (including a cross-claim
+or counterclaim in a lawsuit), then any patent licenses granted by
+that Contributor to such Recipient under this Agreement shall
+terminate as of the date such litigation is filed. In addition, if
+Recipient institutes patent litigation against any entity (including
+a cross-claim or counterclaim in a lawsuit) alleging that the Program
+itself (excluding combinations of the Program with other software or
+hardware) infringes such Recipient`s patent(s), then such Recipient`s
+rights granted under Section 2(b) shall terminate as of the date such
+litigation is filed.
+
+All Recipient`s rights under this Agreement shall terminate if it
+fails to comply with any of the material terms or conditions of this
+Agreement and does not cure such failure in a reasonable period of
+time after becoming aware of such noncompliance. If all Recipient`s
+rights under this Agreement terminate, Recipient agrees to cease use
+and distribution of the Program as soon as reasonably practicable.
+However, Recipient`s obligations under this Agreement and any
+licenses granted by Recipient relating to the Program shall continue
+and survive.
+
+IBM may publish new versions (including revisions) of this Agreement
+from time to time. Each new version of the Agreement will be given a
+distinguishing version number. The Program (including Contributions)
+may always be distributed subject to the version of the Agreement
+under which it was received. In addition, after a new version of the
+Agreement is published, Contributor may elect to distribute the
+Program (including its Contributions) under the new version. No one
+other than IBM has the right to modify this Agreement. Except as
+expressly stated in Sections 2(a) and 2(b) above, Recipient receives
+no rights or licenses to the intellectual property of any Contributor
+under this Agreement, whether expressly, by implication, estoppel or
+otherwise. All rights in the Program not expressly granted under
+this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and
+the intellectual property laws of the United States of America. No
+party to this Agreement will bring a legal action under this
+Agreement more than one year after the cause of action arose. Each
+party waives its rights to a jury trial in any resulting litigation.
+
diff --git a/meta/files/common-licenses/ISC b/meta/files/common-licenses/ISC
new file mode 100644
index 0000000..97af105
--- /dev/null
+++ b/meta/files/common-licenses/ISC
@@ -0,0 +1,10 @@
+
+ISC License:
+
+Copyright &#169; 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
+Copyright &#169; 1995-2003 by Internet Software Consortium
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/meta/files/common-licenses/LGPL-2.0 b/meta/files/common-licenses/LGPL-2.0
new file mode 100644
index 0000000..5931d43
--- /dev/null
+++ b/meta/files/common-licenses/LGPL-2.0
@@ -0,0 +1,342 @@
+GNU LIBRARY GENERAL PUBLIC LICENSE
+
+
+
+Version 2, June 1991
+
+
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+
+of this license document, but changing it is not allowed.
+
+
+
+[This is the first released version of the library GPL.  It is
+
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+Preamble
+
+
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+
+
+This license, the Library General Public License, applies to some specially designated Free Software Foundation software, and to any other libraries whose authors decide to use it. You can use it for your libraries, too.
+
+
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library, or if you modify it.
+
+
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link a program with the library, you must provide complete object files to the recipients so that they can relink them with the library, after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+
+
+Our method of protecting your rights has two steps: (1) copyright the library, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the library.
+
+
+
+Also, for each distributor's protection, we want to make certain that everyone understands that there is no warranty for this free library. If the library is modified by someone else and passed on, we want its recipients to know that what they have is not the original version, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that companies distributing free software will individually obtain patent licenses, thus in effect transforming the program into proprietary software. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License, which was designed for utility programs. This license, the GNU Library General Public License, applies to certain designated libraries. This license is quite different from the ordinary one; be sure to read it in full, and don't assume that anything in it is the same as in the ordinary license.
+
+
+
+The reason we have a separate public license for some libraries is that they blur the distinction we usually make between modifying or adding to a program and simply using it. Linking a program with a library, without changing the library, is in some sense simply using the library, and is analogous to running a utility program or application program. However, in a textual and legal sense, the linked executable is a combined work, a derivative of the original library, and the ordinary General Public License treats it as such.
+
+
+
+Because of this blurred distinction, using the ordinary General Public License for libraries did not effectively promote software sharing, because most developers did not use the libraries. We concluded that weaker conditions might promote sharing better.
+
+
+
+However, unrestricted linking of non-free programs would deprive the users of those programs of all benefit from the free status of the libraries themselves. This Library General Public License is intended to permit developers of non-free programs to use free libraries, while preserving your freedom as a user of such programs to change the free libraries that are incorporated in them. (We have not seen how to achieve this as regards changes in header files, but we have achieved it as regards changes in the actual functions of the Library.) The hope is that this will lead to faster development of free libraries.
+
+
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, while the latter only works together with the library.
+
+
+
+Note that it is possible for a library to be covered by the ordinary General Public License rather than by this special one.
+
+
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+
+
+0. This License Agreement applies to any software library which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Library General Public License (also called "this License"). Each licensee is addressed as "you".
+
+
+
+A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+
+
+The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
+
+
+
+"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+
+
+1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+
+
+a) The modified work must itself be a software library.
+
+b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+
+c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+
+d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+
+(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
+
+
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+
+
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+
+
+However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+
+
+When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+
+
+6. As an exception to the Sections above, you may also compile or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
+
+
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+
+
+a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+
+b) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+
+c) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+
+d) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
+
+For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+
+
+a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+
+b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+
+
+13. The Free Software Foundation may publish revised and/or new versions of the Library General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+
+
+NO WARRANTY
+
+
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+
+END OF TERMS AND CONDITIONS
+
+
+
+How to Apply These Terms to Your New Libraries
+
+
+
+If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
+
+
+
+To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+
+
+one line to give the library's name and an idea of what it does.
+
+Copyright (C) year  name of author
+
+
+
+This library is free software; you can redistribute it and/or
+
+modify it under the terms of the GNU Library General Public
+
+License as published by the Free Software Foundation; either
+
+version 2 of the License, or (at your option) any later version.
+
+
+
+This library is distributed in the hope that it will be useful,
+
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+
+Library General Public License for more details.
+
+
+
+You should have received a copy of the GNU Library General Public
+
+License along with this library; if not, write to the
+
+Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+
+Boston, MA  02110-1301, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
+
+
+
+Yoyodyne, Inc., hereby disclaims all copyright interest in
+
+the library `Frob' (a library for tweaking knobs) written
+
+by James Random Hacker.
+
+
+
+signature of Ty Coon, 1 April 1990
+
+Ty Coon, President of Vice
+
+That's all there is to it!
+
diff --git a/meta/files/common-licenses/LGPL-2.1 b/meta/files/common-licenses/LGPL-2.1
new file mode 100644
index 0000000..a0e735a
--- /dev/null
+++ b/meta/files/common-licenses/LGPL-2.1
@@ -0,0 +1,176 @@
+
+GNU LESSER GENERAL PUBLIC LICENSE
+
+Version 2.1, February 1999
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author`s reputation will not be affected by problems that might be introduced by others.
+
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
+
+We call this license the "Lesser" General Public License because it does Less to protect the user`s freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users` freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
+
+A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
+
+"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library`s complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) The modified work must itself be a software library.
+b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer`s own use and reverse engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user`s computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
+c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
+For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients` exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Libraries
+
+If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
+
+To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+one line to give the library`s name and an idea of what it does.
+Copyright (C) year  name of author
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation; either
+version 2.1 of the License, or (at your option) any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright interest in
+the library `Frob` (a library for tweaking knobs) written
+by James Random Hacker.
+
+signature of Ty Coon, 1 April 1990
+Ty Coon, President of Vice
+That`s all there is to it!
+
diff --git a/meta/files/common-licenses/LGPL-3.0 b/meta/files/common-licenses/LGPL-3.0
new file mode 100644
index 0000000..6be29bf
--- /dev/null
+++ b/meta/files/common-licenses/LGPL-3.0
@@ -0,0 +1,65 @@
+GNU LESSER GENERAL PUBLIC LICENSE
+
+Version 3, 29 June 2007
+
+Copyright © 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.
+
+This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
+0. Additional Definitions.
+
+As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License.
+
+“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.
+
+An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.
+
+A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”.
+
+The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
+
+The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
+1. Exception to Section 3 of the GNU GPL.
+
+You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
+2. Conveying Modified Versions.
+
+If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
+
+    * a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or
+    * b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
+
+3. Object Code Incorporating Material from Library Header Files.
+
+The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
+
+    * a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
+    * b) Accompany the object code with a copy of the GNU GPL and this license document.
+
+4. Combined Works.
+
+You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:
+
+    * a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
+    * b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
+    * c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
+    * d) Do one of the following:
+          o 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
+          o 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
+    * e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
+
+5. Combined Libraries.
+
+You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
+
+    * a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.
+    * b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+
+6. Revised Versions of the GNU Lesser General Public License.
+
+The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.
+
+If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
diff --git a/meta/files/common-licenses/LPL-1.02 b/meta/files/common-licenses/LPL-1.02
new file mode 100644
index 0000000..e933748
--- /dev/null
+++ b/meta/files/common-licenses/LPL-1.02
@@ -0,0 +1,76 @@
+
+Lucent Public License Version 1.02 
+
+THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT`S ACCEPTANCE OF THIS AGREEMENT.
+1. DEFINITIONS
+
+"Contribution" means:
+
+in the case of Lucent Technologies Inc. ("LUCENT"), the Original Program, and
+in the case of each Contributor,
+changes to the Program, and
+additions to the Program;
+where such changes and/or additions to the Program were added to the Program by such Contributor itself or anyone acting on such Contributor`s behalf, and the Contributor explicitly consents, in accordance with Section 3C, to characterization of the changes and/or additions as Contributions.
+"Contributor" means LUCENT and any other entity that has Contributed a Contribution to the Program.
+
+"Distributor" means a Recipient that distributes the Program, modifications to the Program, or any part thereof.
+
+"Licensed Patents" mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
+"Original Program" means the original version of the software accompanying this Agreement as released by LUCENT, including source code, object code and documentation, if any.
+
+"Program" means the Original Program and Contributions or any part thereof
+
+"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+2. GRANT OF RIGHTS
+
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. The patent license granted by a Contributor shall also apply to the combination of the Contribution of that Contributor and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license granted by a Contributor shall not apply to (i) any other combinations which include the Contribution, nor to (ii) Contributions of other Contributors. No hardware per se is licensed hereunder.
+Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient`s responsibility to acquire that license before distributing the Program.
+Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+3. REQUIREMENTS
+
+A. Distributor may choose to distribute the Program in any form under this Agreement or under its own license agreement, provided that:
+
+it complies with the terms and conditions of this Agreement;
+if the Program is distributed in source code or other tangible form, a copy of this Agreement or Distributor`s own license agreement is included with each copy of the Program; and
+if distributed under Distributor`s own license agreement, such license agreement:
+effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits; and
+states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party.
+B. Each Distributor must include the following in a conspicuous location in the Program:
+
+Copyright (C) 2003, Lucent Technologies Inc. and others. All Rights Reserved.
+C. In addition, each Contributor must identify itself as the originator of its Contribution in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution. Also, each Contributor must agree that the additions and/or changes are intended to be a Contribution. Once a Contribution is contributed, it may not thereafter be revoked.
+
+4. COMMERCIAL DISTRIBUTION
+
+Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Distributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for Contributors. Therefore, if a Distributor includes the Program in a commercial product offering, such Distributor ("Commercial Distributor") hereby agrees to defend and indemnify every Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Distributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Distributor in writing of such claim, and b) allow the Commercial Distributor to control, and cooperate with the Commercial Distributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
+For example, a Distributor might include the Program in a commercial product offering, Product X. That Distributor is then a Commercial Distributor. If that Commercial Distributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Distributor`s responsibility alone. Under this section, the Commercial Distributor would have to defend claims against the Contributors related to those performance claims and warranties, and if a court requires any Contributor to pay any damages as a result, the Commercial Distributor must pay those damages.
+
+5. NO WARRANTY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+6. DISCLAIMER OF LIABILITY
+
+EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+7. EXPORT CONTROL
+
+Recipient agrees that Recipient alone is responsible for compliance with the United States export administration regulations (and the export control laws and regulation of any other countries).
+
+8. GENERAL
+
+If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
+If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient`s patent(s), then such Recipient`s rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
+All Recipient`s rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient`s rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient`s obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
+LUCENT may publish new versions (including revisions) of this Agreement from time to time. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. No one other than LUCENT has the right to modify this Agreement. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
+This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
diff --git a/meta/files/common-licenses/LPPL-1.0 b/meta/files/common-licenses/LPPL-1.0
new file mode 100644
index 0000000..f9ef35d
--- /dev/null
+++ b/meta/files/common-licenses/LPPL-1.0
@@ -0,0 +1,213 @@
+
+LaTeX Project Public License
+============================
+ 
+LPPL Version 1.0  1999-03-01
+
+Copyright 1999 LaTeX3 Project
+    Everyone is permitted to copy and distribute verbatim copies
+    of this license document, but modification is not allowed.
+
+
+Preamble
+========
+
+The LaTeX Project Public License (LPPL) is the license under which the
+base LaTeX distribution is distributed. As described below you may use
+this licence for any software that you wish to distribute. 
+
+It may be particularly suitable if your software is TeX related (such
+as a LaTeX package file) but it may be used for any software, even if
+it is unrelated to TeX.
+
+To use this license, the files of your distribution should have an
+explicit copyright notice giving your name and the year, together
+with a reference to this license.
+
+A typical example would be
+
+   %% pig.sty
+   %% Copyright 2001 M. Y. Name
+
+   % This program can redistributed and/or modified under the terms
+   % of the LaTeX Project Public License Distributed from CTAN
+   % archives in directory macros/latex/base/lppl.txt; either
+   % version 1 of the License, or (at your option) any later version.
+
+Given such a notice in the file, the conditions of this document would
+apply, with:
+
+`The Program` referring to the software `pig.sty`  and 
+`The Copyright Holder` referring to the person `M. Y. Name`.
+
+To see a real example, see the file legal.txt which carries the
+copyright notice for the base latex distribution.
+
+This license gives terms under which files of The Program may be
+distributed and modified. Individual files may have specific further
+constraints on modification, but no file should have restrictions on
+distribution other than those specified below. 
+This is to ensure that a distributor wishing to distribute a complete
+unmodified copy of The Program need only check the conditions in this
+file, and does not need to check every file in The Program for extra
+restrictions. If you do need to modify the distribution terms of some
+files, do not refer to this license, instead distribute The Program
+under a different license. You may use the parts of the text of LPPL as
+a model for your own license, but your license should not directly refer
+to the LPPL or otherwise give the impression that The Program is
+distributed under the LPPL. 
+
+
+
+The LaTeX Project Public License
+================================
+Terms And Conditions For Copying, Distribution And Modification
+===============================================================
+
+
+WARRANTY
+========
+
+There is no warranty for The Program, to the extent permitted by
+applicable law.  Except when otherwise stated in writing, The
+Copyright Holder provides 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.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any of the individual authors named in
+the source for The Program, be liable to you for damages, including
+any general, special, incidental or consequential damages arising out
+of any use of The Program or out of inability to use The Program
+(including but not limited to loss of data or data being rendered
+inaccurate or losses sustained by you or by third parties as a result
+of 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.
+
+
+DISTRIBUTION
+============
+
+Redistribution of unchanged files is allowed provided that all files
+that make up the distribution of The Program are distributed.
+In particular this means that The Program has to be distributed
+including its documentation if documentation was part of the original
+distribution.
+
+The distribution of The Program will contain a prominent file
+listing all the files covered by this license.
+
+If you receive only some of these files from someone, complain!
+
+The distribution of changed versions of certain files included in the
+The Program, and the reuse of code from The Program, are allowed
+under the following restrictions:
+
+ * It is allowed only if the legal notice in the file does not
+   expressly forbid it.
+   See note below, under "Conditions on individual files".
+ 
+ * You rename the file before you make any changes to it, unless the
+   file explicitly says that renaming is not required.  Any such changed
+   files must be distributed under a license that forbids distribution
+   of those files, and any files derived from them, under the names used
+   by the original files in the distribution of The Program.
+
+ * You change any `identification string` in The Program to clearly 
+   indicate that the file is not part of the standard system.
+
+ * If The Program includes an `error report address` so that errors
+   may be reported to The Copyright Holder, or other specified
+   addresses, this address must be changed in any modified versions of
+   The Program, so that reports for files not maintained by the
+   original program maintainers are directed to the maintainers of the
+   changed files. 
+
+ * You acknowledge the source and authorship of the original version
+   in the modified file.
+
+ * You also distribute the unmodified version of the file or
+   alternatively provide sufficient information so that the
+   user of your modified file can be reasonably expected to be
+   able to obtain an original, unmodified copy of The Program.
+   For example, you may specify a URL to a site that you expect
+   will freely provide the user with a copy of The Program (either
+   the version on which your modification is based, or perhaps a
+   later version).
+
+ * If The Program is intended to be used with, or is based on, LaTeX,
+   then files with the following file extensions which have special
+   meaning in LaTeX Software, have special modification rules under the
+   license:
+ 
+    - Files with extension `.ins` (installation files): these files may
+      not be modified at all because they contain the legal notices
+      that are placed in the generated files.
+ 
+    - Files with extension `.fd` (LaTeX font definitions files): these
+      files are allowed to be modified without changing the name, but
+      only to enable use of all available fonts and to prevent attempts
+      to access unavailable fonts. However, modified files are not
+      allowed to be distributed in place of original files.
+ 
+    - Files with extension `.cfg` (configuration files): these files
+      can be created or modified to enable easy configuration of the
+      system.  The documentation in cfgguide.tex in the base LaTeX
+      distribution describes when it makes sense to modify or generate
+      such files.
+ 
+
+The above restrictions are not intended to prohibit, and hence do
+not apply to, the updating, by any method, of a file so that it
+becomes identical to the latest version of that file in The Program.
+
+========================================================================
+
+NOTES
+=====
+
+We believe that these requirements give you the freedom you to make
+modifications that conform with whatever technical specifications you
+wish, whilst maintaining the availability, integrity and reliability of
+The Program.  If you do not see how to achieve your goal whilst
+adhering to these requirements then read the document cfgguide.tex
+in the base LaTeX distribution for suggestions. 
+
+Because of the portability and exchangeability aspects of systems
+like LaTeX, The LaTeX3 Project deprecates the distribution of
+non-standard versions of components of LaTeX or of generally available
+contributed code for them but such distributions are permitted under the
+above restrictions.
+
+The document modguide.tex in the base LaTeX distribution details
+the reasons for the legal requirements detailed above.
+Even if The Program is unrelated to LaTeX, the argument in
+modguide.tex may still apply, and should be read before
+a modified version of The Program is distributed.
+
+
+Conditions on individual files
+==============================
+
+The individual files may bear additional conditions which supersede
+the general conditions on distribution and modification contained in
+this file. If there are any such files, the distribution of The
+Program will contain a prominent file that lists all the exceptional
+files.
+
+Typical examples of files with more restrictive modification
+conditions would be files that contain the text of copyright notices.
+
+ * The conditions on individual files differ only in the
+   extent of *modification* that is allowed.
+
+ * The conditions on *distribution* are the same for all the files.
+   Thus a (re)distributor of a complete, unchanged copy of The Program
+   need meet only the conditions in this file; it is not necessary to
+   check the header of every file in the distribution to check that a
+   distribution meets these requirements.
+
diff --git a/meta/files/common-licenses/LPPL-1.1 b/meta/files/common-licenses/LPPL-1.1
new file mode 100644
index 0000000..8083319
--- /dev/null
+++ b/meta/files/common-licenses/LPPL-1.1
@@ -0,0 +1,316 @@
+
+
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.1  1999-07-10
+
+Copyright 1999 LaTeX3 Project
+    Everyone is allowed to distribute verbatim copies of this
+    license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the license under which the
+base LaTeX distribution is distributed.
+
+You may use this license for any program that you have written and wish
+to distribute.  This license may be particularly suitable if your
+program is TeX-related (such as a LaTeX package), but you may use it
+even if your program is unrelated to TeX.  The section `WHETHER AND HOW
+TO DISTRIBUTE PROGRAMS UNDER THIS LICENSE`, below, gives instructions,
+examples, and recommendations for authors who are considering
+distributing their programs under this license.
+
+In this license document, `The Program` refers to any program
+distributed under this license.
+
+This license gives conditions under which The Program may be distributed
+and conditions under which modified versions of The Program may be
+distributed.  Individual files of The Program may bear supplementary
+and/or superseding conditions on modification of themselves and on the
+distribution of modified versions of themselves, but *no* file of The
+Program may bear supplementary or superseding conditions on the
+distribution of an unmodified copy of the file.  A distributor wishing
+to distribute a complete, unmodified copy of The Program therefore
+needs to check the conditions only in this license and nowhere else.
+
+Activities other than distribution and/or modification of The Program
+are not covered by this license; they are outside its scope.  In
+particular, the act of running The Program is not restricted.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of The Program
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+The Program.  If you do not see how to achieve your goal while 
+meeting these conditions, then read the document `cfgguide.tex`
+in the base LaTeX distribution for suggestions.
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+You may distribute a complete, unmodified copy of The Program.
+Distribution of only part of The Program is not allowed.
+
+You may not modify in any way a file of The Program that bears a legal
+notice forbidding modification of that file.
+
+You may distribute a modified file of The Program if, and only if, the
+following eight conditions are met:
+
+  1. You must meet any additional conditions borne by the file on the
+     distribution of a modified version of the file as described below
+     in the subsection `Additional Conditions on Individual Files of
+     The Program`.
+ 
+  2. If the file is a LaTeX software file, then you must meet any
+     applicable additional conditions on the distribution of a modified
+     version of the file that are described below in the subsection
+     `Additional Conditions on LaTeX Software Files`.
+ 
+  3. You must not distribute the modified file with the filename of the
+     original file.
+ 
+  4. In the modified file, you must acknowledge the authorship and
+     name of the original file, and the name (if any) of the program
+     which contains it.
+ 
+  5. You must change any identification string in the file to indicate
+     clearly that the modified file is not part of The Program.
+ 
+  6. You must change any addresses in the modified file for the
+     reporting of errors in the file or in The Program generally to
+     ensure that reports for files no longer maintained by the original
+     maintainers will be directed to the maintainers of the modified
+     files.
+ 
+  7. You must distribute the modified file under a license that forbids
+     distribution both of the modified file and of any files derived
+     from the modified file with the filename of the original file.
+ 
+  8. You must do either (A) or (B):
+
+       (A) distribute a copy of The Program (that is, a complete,
+           unmodified copy of The Program) together with the modified
+           file; if your distribution of the modified file is made by
+           offering access to copy the modified file from a designated
+           place, then offering equivalent access to copy The Program
+           from the same place meets this condition, even though third
+           parties are not compelled to copy The Program along with the
+           modified file;
+
+       (B) provide to those who receive the modified file information
+           that is sufficient for them to obtain a copy of The Program;
+           for example, you may provide a Uniform Resource Locator (URL)
+           for a site that you expect will provide them with a copy of 
+           The Program free of charge (either the version from which
+           your modification is derived, or perhaps a later version).
+
+Note that in the above, `distribution` of a file means making the
+file available to others by any means.  This includes, for instance,
+installing the file on any machine in such a way that the file is
+accessible by users other than yourself.  `Modification` of a file
+means any procedure that produces a derivative file under any
+applicable law -- that is, a file containing the original file or
+a significant portion of it, either verbatim or with modifications
+and/or translated into another language.
+
+Changing the name of a file is considered to be a modification of
+the file.
+
+The distribution conditions in this license do not have to be
+applied to files that have been modified in accordance with the
+above conditions.  Note, however, that Condition 7. does apply to
+any such modified file.
+
+The conditions above are not intended to prohibit, and hence do not
+apply to, the updating, by any method, of a file so that it becomes
+identical to the latest version of that file of The Program.
+
+ 
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a file of The Program, even for your own
+personal use, without also meeting the above eight conditions for
+distributing the modified file.  While you might intend that such
+modified files will never be distributed, often this will happen by
+accident -- you may forget that you have modified the file; or it may
+not occur to you when allowing others to access the modified file
+that you are thus distributing it and violating the conditions of
+this license.  It is usually in your best interest to keep your copy
+of The Program identical with the public one.  Many programs provide
+ways to control the behavior of that program without altering its
+licensed files.
+
+
+Additional Conditions on Individual Files of The Program
+--------------------------------------------------------
+
+An individual file of The Program may bear additional conditions that
+supplement and/or supersede the conditions in this license if, and only
+if, such additional conditions exclusively concern modification of the
+file or distribution of a modified version of the file.  The conditions
+on individual files of The Program therefore may differ only with
+respect to the kind and extent of modification of those files that
+is allowed, and with respect to the distribution of modified versions
+of those files.
+
+
+Additional Conditions on LaTeX Software Files
+---------------------------------------------
+
+If a file of The Program is intended to be used with LaTeX (that is,
+if it is a LaTeX software file), then the following additional
+conditions, which supplement and/or supersede the conditions
+above, apply to the file according to its filename extension:
+
+  - You may not modify any file with filename extension `.ins` since
+    these are installation files containing the legal notices that are
+    placed in the files they generate.
+ 
+  - You may distribute modified versions of files with filename
+    extension `.fd` (LaTeX font definition files) under the standard
+    conditions of the LPPL as described above.  You may also distribute
+    such modified LaTeX font definition files with their original names
+    provided that:
+    (1) the only changes to the original files either enable use of
+        available fonts or prevent attempts to access unavailable fonts;
+    (2) you also distribute the original, unmodified files (TeX input
+        paths can be used to control which set of LaTeX font definition
+        files is actually used by TeX).
+
+  - You may distribute modified versions of files with filename
+    extension `.cfg` (configuration files) with their original names.
+    The Program may (and usually will) specify the range of commands
+    that are allowed in a particular configuration file.
+ 
+Because of portability and exchangeability issues in LaTeX software,
+The LaTeX3 Project deprecates the distribution of modified versions of
+components of LaTeX or of generally available contributed code for them,
+but such distribution can meet the conditions of this license.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for The Program.  Except when otherwise stated in
+writing, The Copyright Holder provides 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.
+
+In no event unless agreed to in writing will The Copyright Holder, or
+any author named in the files of The Program, or any other party who may
+distribute and/or modify The Program as permitted below, be liable to
+you for damages, including any general, special, incidental or
+consequential damages arising out of any use of The Program or out of
+inability to use The Program (including, but not limited to, loss of
+data, data being rendered inaccurate, or losses sustained by anyone as
+a result of any failure of The Program to operate with any other
+programs), even if The Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+WHETHER AND HOW TO DISTRIBUTE PROGRAMS UNDER THIS LICENSE
+=========================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+programs under this license.  These authors are addressed as `you` in
+this section.
+
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your program you want or need to use *distribution*
+conditions that differ from those in this license, then do not refer to
+this license anywhere in your program but instead distribute your
+program under a different license.  You may use the text of this license
+as a model for your own license, but your license should not refer to
+the LPPL or otherwise give the impression that your program is
+distributed under the LPPL.
+
+The document `modguide.tex` in the base LaTeX distribution explains
+the motivation behind the conditions of this license.  It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate.  Even if your program is
+unrelated to LaTeX, the discussion in `modguide.tex` may still be
+relevant, and authors intending to distribute their programs under any
+license are encouraged to read it.
+
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the files of your program both
+an explicit copyright notice including your name and the year and also
+a statement that the distribution and/or modification of the file is
+constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+  %% pig.dtx
+  %% Copyright 2001 M. Y. Name
+  %
+  % This program may be distributed and/or modified under the
+  % conditions of the LaTeX Project Public License, either version 1.1
+  % of this license or (at your option) any later version.
+  % The latest version of this license is in
+  %   http://www.latex-project.org/lppl.txt
+  % and version 1.1 or later is part of all distributions of LaTeX 
+  % version 1999/06/01 or later.
+  %
+  % This program consists of the files pig.dtx and pig.ins
+
+Given such a notice and statement in a file, the conditions given in
+this license document would apply, with `The Program` referring to the
+two files `pig.dtx` and `pig.ins`, and `The Copyright Holder` referring
+to the person `M. Y. Name`.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes The Program
+
+   The LPPL requires that distributions of The Program contain all the
+   files of The Program.  It is therefore important that you provide a
+   way for the licensee to determine which files constitute The Program.
+   This could, for example, be achieved by explicitly listing all the
+   files of The Program near the copyright notice of each file or by
+   using a line like
+
+    % This program consists of all files listed in manifest.txt.
+
+   in that place.  In the absence of an unequivocal list it might be
+   impossible for the licensee to determine what is considered by you
+   to comprise The Program.
+
+ Noting Exceptional Files
+  
+   If The Program contains any files bearing additional conditions on
+   modification, or on distribution of modified versions, of those
+   files (other than those listed in `Additional Conditions on LaTeX
+   Software Files`), then it is recommended that The Program contain a
+   prominent file that defines the exceptional conditions, and either
+   lists the exceptional files or defines one or more categories of
+   exceptional files.
+
+   Files containing the text of a license (such as this file) are
+   often examples of files bearing more restrictive conditions on
+   modification.  LaTeX configuration files (with filename extension
+   `.cfg`) are examples of files bearing less restrictive conditions
+   on the distribution of a modified version of the file.  The
+   additional conditions on LaTeX software given above are examples 
+   of declaring a category of files bearing exceptional additional
+   conditions.
+
diff --git a/meta/files/common-licenses/LPPL-1.2 b/meta/files/common-licenses/LPPL-1.2
new file mode 100644
index 0000000..c391a47
--- /dev/null
+++ b/meta/files/common-licenses/LPPL-1.2
@@ -0,0 +1,320 @@
+
+
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.2  1999-09-03
+
+Copyright 1999 LaTeX3 Project
+    Everyone is allowed to distribute verbatim copies of this
+    license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the license under which the
+base LaTeX distribution is distributed.
+
+You may use this license for any program that you have written and wish
+to distribute.  This license may be particularly suitable if your
+program is TeX-related (such as a LaTeX package), but you may use it
+even if your program is unrelated to TeX.  The section `WHETHER AND HOW
+TO DISTRIBUTE PROGRAMS UNDER THIS LICENSE`, below, gives instructions,
+examples, and recommendations for authors who are considering
+distributing their programs under this license.
+
+In this license document, `The Program` refers to any program
+distributed under this license.
+
+This license gives conditions under which The Program may be distributed
+and conditions under which modified versions of The Program may be
+distributed.  Individual files of The Program may bear supplementary
+and/or superseding conditions on modification of themselves and on the
+distribution of modified versions of themselves, but *no* file of The
+Program may bear supplementary or superseding conditions on the
+distribution of an unmodified copy of the file.  A distributor wishing
+to distribute a complete, unmodified copy of The Program therefore
+needs to check the conditions only in this license and nowhere else.
+
+Activities other than distribution and/or modification of The Program
+are not covered by this license; they are outside its scope.  In
+particular, the act of running The Program is not restricted.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of The Program
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+The Program.  If you do not see how to achieve your goal while 
+meeting these conditions, then read the document `cfgguide.tex`
+in the base LaTeX distribution for suggestions.
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+You may distribute a complete, unmodified copy of The Program.
+Distribution of only part of The Program is not allowed.
+
+You may not modify in any way a file of The Program that bears a legal
+notice forbidding modification of that file.
+
+You may distribute a modified file of The Program if, and only if, the
+following eight conditions are met:
+
+  1. You must meet any additional conditions borne by the file on the
+     distribution of a modified version of the file as described below
+     in the subsection `Additional Conditions on Individual Files of
+     The Program`.
+ 
+  2. If the file is a LaTeX software file, then you must meet any
+     applicable additional conditions on the distribution of a modified
+     version of the file that are described below in the subsection
+     `Additional Conditions on LaTeX Software Files`.
+ 
+  3. You must not distribute the modified file with the filename of the
+     original file.
+ 
+  4. In the modified file, you must acknowledge the authorship and
+     name of the original file, and the name (if any) of the program
+     which contains it.
+ 
+  5. You must change any identification string in the file to indicate
+     clearly that the modified file is not part of The Program.
+ 
+  6. You must change any addresses in the modified file for the
+     reporting of errors in the file or in The Program generally to
+     ensure that reports for files no longer maintained by the original
+     maintainers will be directed to the maintainers of the modified
+     files.
+ 
+  7. You must distribute the modified file under a license that forbids
+     distribution both of the modified file and of any files derived
+     from the modified file with the filename of the original file.
+ 
+  8. You must do either (A) or (B):
+
+       (A) distribute a copy of The Program (that is, a complete,
+           unmodified copy of The Program) together with the modified
+           file; if your distribution of the modified file is made by
+           offering access to copy the modified file from a designated
+           place, then offering equivalent access to copy The Program
+           from the same place meets this condition, even though third
+           parties are not compelled to copy The Program along with the
+           modified file;
+
+       (B) provide to those who receive the modified file information
+           that is sufficient for them to obtain a copy of The Program;
+           for example, you may provide a Uniform Resource Locator (URL)
+           for a site that you expect will provide them with a copy of 
+           The Program free of charge (either the version from which
+           your modification is derived, or perhaps a later version).
+
+Note that in the above, `distribution` of a file means making the
+file available to others by any means.  This includes, for instance,
+installing the file on any machine in such a way that the file is
+accessible by users other than yourself.  `Modification` of a file
+means any procedure that produces a derivative file under any
+applicable law -- that is, a file containing the original file or
+a significant portion of it, either verbatim or with modifications
+and/or translated into another language.
+
+Changing the name of a file (other than as necessitated by the file
+conventions of the target file systems) is considered to be a
+modification of the file.
+
+The distribution conditions in this license do not have to be
+applied to files that have been modified in accordance with the
+above conditions.  Note, however, that Condition 7. does apply to
+any such modified file.
+
+The conditions above are not intended to prohibit, and hence do not
+apply to, the updating, by any method, of a file so that it becomes
+identical to the latest version of that file of The Program.
+
+ 
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a file of The Program, even for your own
+personal use, without also meeting the above eight conditions for
+distributing the modified file.  While you might intend that such
+modified files will never be distributed, often this will happen by
+accident -- you may forget that you have modified the file; or it may
+not occur to you when allowing others to access the modified file
+that you are thus distributing it and violating the conditions of
+this license.  It is usually in your best interest to keep your copy
+of The Program identical with the public one.  Many programs provide
+ways to control the behavior of that program without altering its
+licensed files.
+
+
+Additional Conditions on Individual Files of The Program
+--------------------------------------------------------
+
+An individual file of The Program may bear additional conditions that
+supplement and/or supersede the conditions in this license if, and only
+if, such additional conditions exclusively concern modification of the
+file or distribution of a modified version of the file.  The conditions
+on individual files of The Program therefore may differ only with
+respect to the kind and extent of modification of those files that
+is allowed, and with respect to the distribution of modified versions
+of those files.
+
+
+Additional Conditions on LaTeX Software Files
+---------------------------------------------
+
+If a file of The Program is intended to be used with LaTeX (that is,
+if it is a LaTeX software file), then the following additional
+conditions, which supplement and/or supersede the conditions
+above, apply to the file according to its filename extension:
+
+  - You may not modify any file with filename extension `.ins` since
+    these are installation files containing the legal notices that are
+    placed in the files they generate.
+ 
+  - You may distribute modified versions of files with filename
+    extension `.fd` (LaTeX font definition files) under the standard
+    conditions of the LPPL as described above.  You may also distribute
+    such modified LaTeX font definition files with their original names
+    provided that:
+    (1) the only changes to the original files either enable use of
+        available fonts or prevent attempts to access unavailable fonts;
+    (2) you also distribute the original, unmodified files (TeX input
+        paths can be used to control which set of LaTeX font definition
+        files is actually used by TeX).
+
+  - You may distribute modified versions of files with filename
+    extension `.cfg` (configuration files) with their original names.
+    The Program may (and usually will) specify the range of commands
+    that are allowed in a particular configuration file.
+ 
+Because of portability and exchangeability issues in LaTeX software,
+The LaTeX3 Project deprecates the distribution of modified versions of
+components of LaTeX or of generally available contributed code for them,
+but such distribution can meet the conditions of this license.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for The Program.  Except when otherwise stated in
+writing, The Copyright Holder provides 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.
+
+In no event unless agreed to in writing will The Copyright Holder, or
+any author named in the files of The Program, or any other party who may
+distribute and/or modify The Program as permitted above, be liable to
+you for damages, including any general, special, incidental or
+consequential damages arising out of any use of The Program or out of
+inability to use The Program (including, but not limited to, loss of
+data, data being rendered inaccurate, or losses sustained by anyone as
+a result of any failure of The Program to operate with any other
+programs), even if The Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+WHETHER AND HOW TO DISTRIBUTE PROGRAMS UNDER THIS LICENSE
+=========================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+programs under this license.  These authors are addressed as `you` in
+this section.
+
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your program you want or need to use *distribution*
+conditions that differ from those in this license, then do not refer to
+this license anywhere in your program but instead distribute your
+program under a different license.  You may use the text of this license
+as a model for your own license, but your license should not refer to
+the LPPL or otherwise give the impression that your program is
+distributed under the LPPL.
+
+The document `modguide.tex` in the base LaTeX distribution explains
+the motivation behind the conditions of this license.  It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate.  Even if your program is
+unrelated to LaTeX, the discussion in `modguide.tex` may still be
+relevant, and authors intending to distribute their programs under any
+license are encouraged to read it.
+
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the files of your program both
+an explicit copyright notice including your name and the year and also
+a statement that the distribution and/or modification of the file is
+constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+  %% pig.dtx
+  %% Copyright 2001 M. Y. Name
+  %
+  % This program may be distributed and/or modified under the
+  % conditions of the LaTeX Project Public License, either version 1.2
+  % of this license or (at your option) any later version.
+  % The latest version of this license is in
+  %   http://www.latex-project.org/lppl.txt
+  % and version 1.2 or later is part of all distributions of LaTeX 
+  % version 1999/12/01 or later.
+  %
+  % This program consists of the files pig.dtx and pig.ins
+
+Given such a notice and statement in a file, the conditions given in
+this license document would apply, with `The Program` referring to the
+two files `pig.dtx` and `pig.ins`, and `The Copyright Holder` referring
+to the person `M. Y. Name`.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes The Program
+
+   The LPPL requires that distributions of The Program contain all the
+   files of The Program.  It is therefore important that you provide a
+   way for the licensee to determine which files constitute The Program.
+   This could, for example, be achieved by explicitly listing all the
+   files of The Program near the copyright notice of each file or by
+   using a line like
+
+    % This program consists of all files listed in manifest.txt.
+
+   in that place.  In the absence of an unequivocal list it might be
+   impossible for the licensee to determine what is considered by you
+   to comprise The Program.
+
+ Noting Exceptional Files
+  
+   If The Program contains any files bearing additional conditions on
+   modification, or on distribution of modified versions, of those
+   files (other than those listed in `Additional Conditions on LaTeX
+   Software Files`), then it is recommended that The Program contain a
+   prominent file that defines the exceptional conditions, and either
+   lists the exceptional files or defines one or more categories of
+   exceptional files.
+
+   Files containing the text of a license (such as this file) are
+   often examples of files bearing more restrictive conditions on
+   modification.  LaTeX configuration files (with filename extension
+   `.cfg`) are examples of files bearing less restrictive conditions
+   on the distribution of a modified version of the file.  The
+   additional conditions on LaTeX software given above are examples 
+   of declaring a category of files bearing exceptional additional
+   conditions.
+
+
+
+
diff --git a/meta/files/common-licenses/LPPL-1.3c b/meta/files/common-licenses/LPPL-1.3c
new file mode 100644
index 0000000..755e3bb
--- /dev/null
+++ b/meta/files/common-licenses/LPPL-1.3c
@@ -0,0 +1,418 @@
+
+The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c  2008-05-04
+
+Copyright 1999 2002-2008 LaTeX3 Project
+    Everyone is allowed to distribute verbatim copies of this
+    license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute.  This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but 
+it is written in such a way that you can use it even if your work is 
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE`,
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work.  If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex`
+and `modguide.tex` in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+   `Work`
+    Any work being distributed under this License.
+    
+   `Derived Work`
+    Any work that under any applicable law is derived from the Work.
+
+   `Modification` 
+    Any procedure that produces a Derived Work under any applicable
+    law -- for example, the production of a file containing an
+    original file associated with the Work or a significant portion of
+    such a file, either verbatim or with modifications and/or
+    translated into another language.
+
+   `Modify`
+    To apply any procedure that produces a Derived Work under any
+    applicable law.
+    
+   `Distribution`
+    Making copies of the Work available from one person to another, in
+    whole or in part.  Distribution includes (but is not limited to)
+    making any electronic components of the Work accessible by
+    file transfer protocols such as FTP or HTTP or by shared file
+    systems such as Sun`s Network File System (NFS).
+
+   `Compiled Work`
+    A version of the Work that has been processed into a form where it
+    is directly usable on a computer system.  This processing may
+    include using installation facilities provided by the Work,
+    transformations of the Work, copying of components of the Work, or
+    other activities.  Note that modification of any installation
+    facilities provided by the Work constitutes modification of the Work.
+
+   `Current Maintainer`
+    A person or persons nominated as such within the Work.  If there is
+    no such explicit nomination then it is the `Copyright Holder` under
+    any applicable law.
+
+   `Base Interpreter` 
+    A program or process that is normally needed for running or
+    interpreting a part or the whole of the Work.    
+
+    A Base Interpreter may depend on external components but these
+    are not considered part of the Base Interpreter provided that each
+    external component clearly identifies itself whenever it is used
+    interactively.  Unless explicitly specified when applying the
+    license to the Work, the only applicable Base Interpreter is a
+    `LaTeX-Format` or in the case of files belonging to the 
+    `LaTeX-format` a program implementing the `TeX language`.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1.  Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope.  In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2.  You may distribute a complete, unmodified copy of the Work as you
+received it.  Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3.  You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4.  If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work.  You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work.  Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5.  If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6.  If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition.  Only
+the Current Maintainer is allowed to add such statements of exemption 
+to a component of the Work. 
+
+  a. If a component of this Derived Work can be a direct replacement
+     for a component of the Work when that component is used with the
+     Base Interpreter, then, wherever this component of the Work
+     identifies itself to the user when used interactively with that
+     Base Interpreter, the replacement component of this Derived Work
+     clearly and unambiguously identifies itself as a modified version
+     of this component to the user when used interactively with that
+     Base Interpreter.
+     
+  b. Every component of the Derived Work contains prominent notices
+     detailing the nature of the changes to that component, or a
+     prominent reference to another file that is distributed as part
+     of the Derived Work and that contains a complete and accurate log
+     of the changes.
+  
+  c. No information in the Derived Work implies that any persons,
+     including (but not limited to) the authors of the original version
+     of the Work, provide any support, including (but not limited to)
+     the reporting and handling of errors, to recipients of the
+     Derived Work unless those persons have stated explicitly that
+     they do provide such support for the Derived Work.
+
+  d. You distribute at least one of the following with the Derived Work:
+
+       1. A complete, unmodified copy of the Work; 
+          if your distribution of a modified component is made by
+          offering access to copy the modified component from a
+          designated place, then offering equivalent access to copy
+          the Work from the same or some similar place meets this
+          condition, even though third parties are not compelled to
+          copy the Work along with the modified component;
+
+       2. Information that is sufficient to obtain a complete,
+          unmodified copy of the Work.
+
+7.  If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8.  The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9.  Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+     
+10. a. A Derived Work may be distributed under a different license
+       provided that license itself honors the conditions listed in
+       Clause 6 above, in regard to the Work, though it does not have
+       to honor the rest of the conditions in this license.
+      
+    b. If a Derived Work is distributed under a different license, that
+       Derived Work must provide sufficient documentation as part of
+       itself to allow each recipient of that Derived Work to honor the 
+       restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12.  Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work.  Except when otherwise stated in
+writing, the Copyright Holder provides the Work `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 Work is with you.  Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained` if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained`.
+
+The Work has the status `maintained` if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained` to `unmaintained` if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1.  Make a reasonable attempt to trace the Current Maintainer (and
+     the Copyright Holder, if the two differ) through the means of
+     an Internet or similar search.
+
+ 2.  If this search is successful, then enquire whether the Work
+     is still maintained.
+
+  a. If it is being maintained, then ask the Current Maintainer
+     to update their communication data within one month.
+     
+  b. If the search is unsuccessful or no action to resume active
+     maintenance is taken by the Current Maintainer, then announce
+     within the pertinent community your intention to take over
+     maintenance.  (If the Work is a LaTeX work, this could be
+     done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+     maintenance of the Work to you, then this takes effect
+     immediately upon announcement.
+     
+  b. If the Current Maintainer is not reachable and the Copyright
+     Holder agrees that maintenance of the Work be passed to you,
+     then this takes effect immediately upon announcement.  
+    
+ 4.  If you make an `intention announcement` as described in 2b. above
+     and after three months your intention is challenged neither by
+     the Current Maintainer nor by the Copyright Holder nor by other
+     people, then you may arrange for the Work to be changed so as
+     to name you as the (new) Current Maintainer.
+     
+ 5.  If the previously unreachable Current Maintainer becomes
+     reachable once more within three months of a change completed
+     under the terms of 3b) or 4), then that Current Maintainer must
+     become or remain the Current Maintainer upon request provided
+     they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer.  You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license.  These authors are addressed as `you` in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license.  You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex` in the base LaTeX distribution explains
+the motivation behind the conditions of this license.  It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate.  Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex` may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component.  While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community.  It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one.  Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified.  Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+  %% pig.dtx
+  %% Copyright 2005 M. Y. Name
+  %
+  % This work may be distributed and/or modified under the
+  % conditions of the LaTeX Project Public License, either version 1.3
+  % of this license or (at your option) any later version.
+  % The latest version of this license is in
+  %   http://www.latex-project.org/lppl.txt
+  % and version 1.3 or later is part of all distributions of LaTeX
+  % version 2005/12/01 or later.
+  %
+  % This work has the LPPL maintenance status `maintained`.
+  % 
+  % The Current Maintainer of this work is M. Y. Name.
+  %
+  % This work consists of the files pig.dtx and pig.ins
+  % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work` referring
+to the three files `pig.dtx`, `pig.ins`, and `pig.sty` (the last being
+generated from `pig.dtx` using `pig.ins`), the `Base Interpreter`
+referring to any `LaTeX-Format`, and both `Copyright Holder` and
+`Current Maintainer` referring to the person `M. Y. Name`.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained` above into `author-maintained`.  
+However, we recommend that you use `maintained`, as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+   The LPPL requires that distributions of the Work contain all the
+   files of the Work.  It is therefore important that you provide a
+   way for the licensee to determine which files constitute the Work.
+   This could, for example, be achieved by explicitly listing all the
+   files of the Work near the copyright notice of each file or by
+   using a line such as:
+
+    % This work consists of all files listed in manifest.txt.
+   
+   in that place.  In the absence of an unequivocal list it might be
+   impossible for the licensee to determine what is considered by you
+   to comprise the Work and, in such a case, the licensee would be
+   entitled to make reasonable conjectures as to which files comprise
+   the Work.
+
+
diff --git a/meta/files/common-licenses/Libpng b/meta/files/common-licenses/Libpng
new file mode 100644
index 0000000..a9d5b03
--- /dev/null
+++ b/meta/files/common-licenses/Libpng
@@ -0,0 +1,112 @@
+
+This copy of the libpng notices is provided for your convenience.  In case of
+any discrepancy between this copy and the notices in the file png.h that is
+included in the libpng distribution, the latter shall prevail.
+
+COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
+
+If you modify libpng you may insert additional notices immediately following
+this sentence.
+
+This code is released under the libpng license.
+
+libpng versions 1.2.6, August 15, 2004, through 1.4.5, December 9, 2010, are
+Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.2.5
+with the following individual added to the list of Contributing Authors
+
+   Cosmin Truta
+
+libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, are
+Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-1.0.6
+with the following individuals added to the list of Contributing Authors
+
+   Simon-Pierre Cadieux
+   Eric S. Raymond
+   Gilles Vollant
+
+and with the following additions to the disclaimer:
+
+   There is no warranty against interference with your enjoyment of the
+   library or against infringement.  There is no warranty that our
+   efforts or the library will fulfill any of your particular purposes
+   or needs.  This library is provided with all faults, and the entire
+   risk of satisfactory quality, performance, accuracy, and effort is with
+   the user.
+
+libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+Copyright (c) 1998, 1999 Glenn Randers-Pehrson, and are
+distributed according to the same disclaimer and license as libpng-0.96,
+with the following individuals added to the list of Contributing Authors:
+
+   Tom Lane
+   Glenn Randers-Pehrson
+   Willem van Schaik
+
+libpng versions 0.89, June 1996, through 0.96, May 1997, are
+Copyright (c) 1996, 1997 Andreas Dilger
+Distributed according to the same disclaimer and license as libpng-0.88,
+with the following individuals added to the list of Contributing Authors:
+
+   John Bowler
+   Kevin Bracey
+   Sam Bushell
+   Magnus Holmgren
+   Greg Roelofs
+   Tom Tanner
+
+libpng versions 0.5, May 1995, through 0.88, January 1996, are
+Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.
+
+For the purposes of this copyright and license, "Contributing Authors"
+is defined as the following set of individuals:
+
+   Andreas Dilger
+   Dave Martindale
+   Guy Eric Schalnat
+   Paul Schmidt
+   Tim Wegner
+
+The PNG Reference Library is supplied "AS IS".  The Contributing Authors
+and Group 42, Inc. disclaim all warranties, expressed or implied,
+including, without limitation, the warranties of merchantability and of
+fitness for any purpose.  The Contributing Authors and Group 42, Inc.
+assume no liability for direct, indirect, incidental, special, exemplary,
+or consequential damages, which may result from the use of the PNG
+Reference Library, even if advised of the possibility of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+source code, or portions hereof, for any purpose, without fee, subject
+to the following restrictions:
+
+1. The origin of this source code must not be misrepresented.
+
+2. Altered versions must be plainly marked as such and must not
+   be misrepresented as being the original source.
+
+3. This Copyright notice may not be removed or altered from any
+   source or altered source distribution.
+
+The Contributing Authors and Group 42, Inc. specifically permit, without
+fee, and encourage the use of this source code as a component to
+supporting the PNG file format in commercial products.  If you use this
+source code in a product, acknowledgment is not required but would be
+appreciated.
+
+
+A "png_get_copyright" function is available, for convenient use in "about"
+boxes and the like:
+
+   printf("%s",png_get_copyright(NULL));
+
+Also, the PNG logo (in PNG format, of course) is supplied in the
+files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31).
+
+Libpng is OSI Certified Open Source Software.  OSI Certified Open Source is a
+certification mark of the Open Source Initiative.
+
+Glenn Randers-Pehrson
+glennrp at users.sourceforge.net
+December 9, 2010
+
diff --git a/meta/files/common-licenses/MIT b/meta/files/common-licenses/MIT
new file mode 100644
index 0000000..33f8bef
--- /dev/null
+++ b/meta/files/common-licenses/MIT
@@ -0,0 +1,23 @@
+
+MIT License
+
+Copyright (c) <year> <copyright holders>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
diff --git a/meta/files/common-licenses/MPL-1.0 b/meta/files/common-licenses/MPL-1.0
new file mode 100644
index 0000000..83dc3f6
--- /dev/null
+++ b/meta/files/common-licenses/MPL-1.0
@@ -0,0 +1,109 @@
+
+MOZILLA PUBLIC LICENSE
+Version 1.0
+
+1. Definitions.
+
+1.1. ``Contributor`` means each entity that creates or contributes to the creation of Modifications.
+1.2. ``Contributor Version`` means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+1.3. ``Covered Code`` means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+1.4. ``Electronic Distribution Mechanism`` means a mechanism generally accepted in the software development community for the electronic transfer of data.
+
+1.5. ``Executable`` means Covered Code in any form other than Source Code.
+
+1.6. ``Initial Developer`` means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+
+1.7. ``Larger Work`` means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+1.8. ``License`` means this document.
+
+1.9. ``Modifications`` means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+
+A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or previous Modifications.
+
+1.10. ``Original Code`` means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+
+1.11. ``Source Code`` means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or a list of source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+1.12. ``You`` means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, ``You`` includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, ``control`` means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+2.1. The Initial Developer Grant. 
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, or as part of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Initial Developer, to make, have made, use and sell (``Utilize``) the Original Code (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to Utilize the Original Code (or portions thereof) and not to any greater extent that may be necessary to Utilize further Modifications or combinations.
+
+2.2. Contributor Grant. 
+Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code or as part of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Contributor, to Utilize the Contributor Version (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to Utilize the Contributor Version (or portions thereof), and not to any greater extent that may be necessary to Utilize further Modifications or combinations.
+
+3. Distribution Obligations.
+3.1. Application of License. 
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+3.2. Availability of Source Code. 
+Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications. 
+You must cause all Covered Code to which you contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims. 
+If You have knowledge that a party claims an intellectual property right in particular functionality or code (or its utilization under this License), you must include a text file with the source code distribution titled ``LEGAL`` which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If you obtain such knowledge after You make Your Modification available as described in Section 3.2, You shall promptly modify the LEGAL file in all copies You make available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+
+(b) Contributor APIs. 
+If Your Modification is an application programming interface and You own or control patents which are reasonably necessary to implement that API, you must also include this information in the LEGAL file.
+
+3.5. Required Notices. 
+You must duplicate the notice in Exhibit A in each file of the Source Code, and this License in any documentation for the Source Code, where You describe recipients` rights relating to Covered Code. If You created one or more Modification(s), You may add your name as a Contributor to the notice described in Exhibit A. If it is not possible to put such notice in a particular Source Code file due to its structure, then you must include such notice in a location (such as a relevant directory file) where a user would be likely to look for such a notice. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions. 
+You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients` rights relating to the Covered Code. You may distribute the Executable version of Covered Code under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works. 
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A, and to related Covered Code.
+6. Versions of the License.
+6.1. New Versions. 
+Netscape Communications Corporation (``Netscape``) may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+6.2. Effect of New Versions. 
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License.
+
+6.3. Derivative Works. 
+If you create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), you must (a) rename Your license so that the phrases ``Mozilla``, ``MOZILLAPL``, ``MOZPL``, ``Netscape``, ``NPL`` or any confusingly similar phrase do not appear anywhere in your license and (b) otherwise make it clear that your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY.
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN ``AS IS`` BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+8. TERMINATION.
+This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+9. LIMITATION OF LIABILITY.
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+10. U.S. GOVERNMENT END USERS.
+The Covered Code is a ``commercial item,`` as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer software`` and ``commercial computer software documentation,`` as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+11. MISCELLANEOUS.
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in, the United States of America: (a) unless otherwise agreed in writing, all disputes relating to this License (excepting any dispute relating to intellectual property rights) shall be subject to final and binding arbitration, with the losing party paying all costs of arbitration; (b) any arbitration relating to this Agreement shall be held in Santa Clara County, California, under the auspices of JAMS/EndDispute; and (c) any litigation relating to this Agreement shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+12. RESPONSIBILITY FOR CLAIMS.
+Except in cases where another Contributor has failed to comply with Section 3.4, You are responsible for damages arising, directly or indirectly, out of Your utilization of rights under this License, based on the number of copies of Covered Code you made available, the revenues you received from utilizing such rights, and other relevant factors. You agree to work with affected parties to distribute responsibility on an equitable basis.
+EXHIBIT A.
+``The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
+Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
+
+The Original Code is ______________________________________.
+
+The Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) ______ _______________________. All Rights Reserved.
+
+Contributor(s): ______________________________________.``
+
diff --git a/meta/files/common-licenses/MPL-1.1 b/meta/files/common-licenses/MPL-1.1
new file mode 100644
index 0000000..6aa8c4e
--- /dev/null
+++ b/meta/files/common-licenses/MPL-1.1
@@ -0,0 +1,185 @@
+
+Mozilla Public License Version 1.1
+
+1. Definitions.
+
+1.0.1. "Commercial Use"
+means distribution or otherwise making the Covered Code available to a third party.
+1.1. "Contributor"
+means each entity that creates or contributes to the creation of Modifications.
+1.2. "Contributor Version"
+means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+1.3. "Covered Code"
+means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+1.4. "Electronic Distribution Mechanism"
+means a mechanism generally accepted in the software development community for the electronic transfer of data.
+1.5. "Executable"
+means Covered Code in any form other than Source Code.
+1.6. "Initial Developer"
+means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+1.7. "Larger Work"
+means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+1.8. "License"
+means this document.
+1.8.1. "Licensable"
+means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+1.9. "Modifications"
+means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+Any new file that contains any part of the Original Code or previous Modifications.
+1.10. "Original Code"
+means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+1.10.1. "Patent Claims"
+means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+1.11. "Source Code"
+means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+1.12. "You" (or "Your")
+means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+2. Source Code License.
+
+2.1. The Initial Developer Grant.
+
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+the licenses granted in this Section 2.1 (a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
+Notwithstanding Section 2.1 (b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices.
+2.2. Contributor Grant.
+
+Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+
+under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+the licenses granted in Sections 2.2 (a) and 2.2 (b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
+Notwithstanding Section 2.2 (b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
+3. Distribution Obligations.
+
+3.1. Application of License.
+
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+
+3.2. Availability of Source Code.
+
+Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+
+You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims
+
+If Contributor has knowledge that a license under a third party`s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+
+(b) Contributor APIs
+
+If Contributor`s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
+
+(c) Representations.
+
+Contributor represents that, except as disclosed pursuant to Section 3.4 (a) above, Contributor believes that Contributor`s Modifications are Contributor`s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+
+3.5. Required Notices.
+
+You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients` rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+
+You may distribute Covered Code in Executable form only if the requirements of Sections 3.1, 3.2, 3.3, 3.4 and 3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients` rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works.
+
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+6.1. New Versions
+
+Netscape Communications Corporation ("Netscape") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+6.2. Effect of New Versions
+
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License.
+
+6.3. Derivative Works
+
+If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. Termination
+
+8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that:
+
+such Participant`s Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+any software, hardware, or device, other than such Participant`s Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
+8.3. If You assert a patent infringement claim against Participant alleging that such Participant`s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. government end users
+
+The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+11. Miscellaneous
+
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys` fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+12. Responsibility for claims
+
+As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+
+13. Multiple-licensed code
+
+Initial Developer may designate portions of the Covered Code as "Multiple-Licensed". "Multiple-Licensed" means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the MPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
+
+Exhibit A - Mozilla Public License.
+
+"The contents of this file are subject to the Mozilla Public License
+Version 1.1 (the "License"); you may not use this file except in
+compliance with the License. You may obtain a copy of the License at
+http://www.mozilla.org/MPL/
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+License for the specific language governing rights and limitations
+under the License.
+
+The Original Code is ______________________________________.
+
+The Initial Developer of the Original Code is ________________________.
+Portions created by ______________________ are Copyright (C) ______
+_______________________. All Rights Reserved.
+
+Contributor(s): ______________________________________.
+
+Alternatively, the contents of this file may be used under the terms
+of the _____ license (the  "[___] License"), in which case the
+provisions of [______] License are applicable instead of those
+above. If you wish to allow use of your version of this file only
+under the terms of the [____] License and not to allow others to use
+your version of this file under the MPL, indicate your decision by
+deleting the provisions above and replace them with the notice and
+other provisions required by the [___] License. If you do not delete
+the provisions above, a recipient may use your version of this file
+under either the MPL or the [___] License."
+NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.
+
diff --git a/meta/files/common-licenses/MPL-2.0 b/meta/files/common-licenses/MPL-2.0
new file mode 100644
index 0000000..14e2f77
--- /dev/null
+++ b/meta/files/common-licenses/MPL-2.0
@@ -0,0 +1,373 @@
+Mozilla Public License Version 2.0
+==================================
+
+1. Definitions
+--------------
+
+1.1. "Contributor"
+    means each individual or legal entity that creates, contributes to
+    the creation of, or owns Covered Software.
+
+1.2. "Contributor Version"
+    means the combination of the Contributions of others (if any) used
+    by a Contributor and that particular Contributor's Contribution.
+
+1.3. "Contribution"
+    means Covered Software of a particular Contributor.
+
+1.4. "Covered Software"
+    means Source Code Form to which the initial Contributor has attached
+    the notice in Exhibit A, the Executable Form of such Source Code
+    Form, and Modifications of such Source Code Form, in each case
+    including portions thereof.
+
+1.5. "Incompatible With Secondary Licenses"
+    means
+
+    (a) that the initial Contributor has attached the notice described
+        in Exhibit B to the Covered Software; or
+
+    (b) that the Covered Software was made available under the terms of
+        version 1.1 or earlier of the License, but not also under the
+        terms of a Secondary License.
+
+1.6. "Executable Form"
+    means any form of the work other than Source Code Form.
+
+1.7. "Larger Work"
+    means a work that combines Covered Software with other material, in 
+    a separate file or files, that is not Covered Software.
+
+1.8. "License"
+    means this document.
+
+1.9. "Licensable"
+    means having the right to grant, to the maximum extent possible,
+    whether at the time of the initial grant or subsequently, any and
+    all of the rights conveyed by this License.
+
+1.10. "Modifications"
+    means any of the following:
+
+    (a) any file in Source Code Form that results from an addition to,
+        deletion from, or modification of the contents of Covered
+        Software; or
+
+    (b) any new file in Source Code Form that contains any Covered
+        Software.
+
+1.11. "Patent Claims" of a Contributor
+    means any patent claim(s), including without limitation, method,
+    process, and apparatus claims, in any patent Licensable by such
+    Contributor that would be infringed, but for the grant of the
+    License, by the making, using, selling, offering for sale, having
+    made, import, or transfer of either its Contributions or its
+    Contributor Version.
+
+1.12. "Secondary License"
+    means either the GNU General Public License, Version 2.0, the GNU
+    Lesser General Public License, Version 2.1, the GNU Affero General
+    Public License, Version 3.0, or any later versions of those
+    licenses.
+
+1.13. "Source Code Form"
+    means the form of the work preferred for making modifications.
+
+1.14. "You" (or "Your")
+    means an individual or a legal entity exercising rights under this
+    License. For legal entities, "You" includes any entity that
+    controls, is controlled by, or is under common control with You. For
+    purposes of this definition, "control" means (a) the power, direct
+    or indirect, to cause the direction or management of such entity,
+    whether by contract or otherwise, or (b) ownership of more than
+    fifty percent (50%) of the outstanding shares or beneficial
+    ownership of such entity.
+
+2. License Grants and Conditions
+--------------------------------
+
+2.1. Grants
+
+Each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license:
+
+(a) under intellectual property rights (other than patent or trademark)
+    Licensable by such Contributor to use, reproduce, make available,
+    modify, display, perform, distribute, and otherwise exploit its
+    Contributions, either on an unmodified basis, with Modifications, or
+    as part of a Larger Work; and
+
+(b) under Patent Claims of such Contributor to make, use, sell, offer
+    for sale, have made, import, and otherwise transfer either its
+    Contributions or its Contributor Version.
+
+2.2. Effective Date
+
+The licenses granted in Section 2.1 with respect to any Contribution
+become effective for each Contribution on the date the Contributor first
+distributes such Contribution.
+
+2.3. Limitations on Grant Scope
+
+The licenses granted in this Section 2 are the only rights granted under
+this License. No additional rights or licenses will be implied from the
+distribution or licensing of Covered Software under this License.
+Notwithstanding Section 2.1(b) above, no patent license is granted by a
+Contributor:
+
+(a) for any code that a Contributor has removed from Covered Software;
+    or
+
+(b) for infringements caused by: (i) Your and any other third party's
+    modifications of Covered Software, or (ii) the combination of its
+    Contributions with other software (except as part of its Contributor
+    Version); or
+
+(c) under Patent Claims infringed by Covered Software in the absence of
+    its Contributions.
+
+This License does not grant any rights in the trademarks, service marks,
+or logos of any Contributor (except as may be necessary to comply with
+the notice requirements in Section 3.4).
+
+2.4. Subsequent Licenses
+
+No Contributor makes additional grants as a result of Your choice to
+distribute the Covered Software under a subsequent version of this
+License (see Section 10.2) or under the terms of a Secondary License (if
+permitted under the terms of Section 3.3).
+
+2.5. Representation
+
+Each Contributor represents that the Contributor believes its
+Contributions are its original creation(s) or it has sufficient rights
+to grant the rights to its Contributions conveyed by this License.
+
+2.6. Fair Use
+
+This License is not intended to limit any rights You have under
+applicable copyright doctrines of fair use, fair dealing, or other
+equivalents.
+
+2.7. Conditions
+
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
+in Section 2.1.
+
+3. Responsibilities
+-------------------
+
+3.1. Distribution of Source Form
+
+All distribution of Covered Software in Source Code Form, including any
+Modifications that You create or to which You contribute, must be under
+the terms of this License. You must inform recipients that the Source
+Code Form of the Covered Software is governed by the terms of this
+License, and how they can obtain a copy of this License. You may not
+attempt to alter or restrict the recipients' rights in the Source Code
+Form.
+
+3.2. Distribution of Executable Form
+
+If You distribute Covered Software in Executable Form then:
+
+(a) such Covered Software must also be made available in Source Code
+    Form, as described in Section 3.1, and You must inform recipients of
+    the Executable Form how they can obtain a copy of such Source Code
+    Form by reasonable means in a timely manner, at a charge no more
+    than the cost of distribution to the recipient; and
+
+(b) You may distribute such Executable Form under the terms of this
+    License, or sublicense it under different terms, provided that the
+    license for the Executable Form does not attempt to limit or alter
+    the recipients' rights in the Source Code Form under this License.
+
+3.3. Distribution of a Larger Work
+
+You may create and distribute a Larger Work under terms of Your choice,
+provided that You also comply with the requirements of this License for
+the Covered Software. If the Larger Work is a combination of Covered
+Software with a work governed by one or more Secondary Licenses, and the
+Covered Software is not Incompatible With Secondary Licenses, this
+License permits You to additionally distribute such Covered Software
+under the terms of such Secondary License(s), so that the recipient of
+the Larger Work may, at their option, further distribute the Covered
+Software under the terms of either this License or such Secondary
+License(s).
+
+3.4. Notices
+
+You may not remove or alter the substance of any license notices
+(including copyright notices, patent notices, disclaimers of warranty,
+or limitations of liability) contained within the Source Code Form of
+the Covered Software, except that You may alter any license notices to
+the extent required to remedy known factual inaccuracies.
+
+3.5. Application of Additional Terms
+
+You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered
+Software. However, You may do so only on Your own behalf, and not on
+behalf of any Contributor. You must make it absolutely clear that any
+such warranty, support, indemnity, or liability obligation is offered by
+You alone, and You hereby agree to indemnify every Contributor for any
+liability incurred by such Contributor as a result of warranty, support,
+indemnity or liability terms You offer. You may include additional
+disclaimers of warranty and limitations of liability specific to any
+jurisdiction.
+
+4. Inability to Comply Due to Statute or Regulation
+---------------------------------------------------
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description must
+be placed in a text file included with all distributions of the Covered
+Software under this License. Except to the extent prohibited by statute
+or regulation, such description must be sufficiently detailed for a
+recipient of ordinary skill to be able to understand it.
+
+5. Termination
+--------------
+
+5.1. The rights granted under this License will terminate automatically
+if You fail to comply with any of its terms. However, if You become
+compliant, then the rights granted under this License from a particular
+Contributor are reinstated (a) provisionally, unless and until such
+Contributor explicitly and finally terminates Your grants, and (b) on an
+ongoing basis, if such Contributor fails to notify You of the
+non-compliance by some reasonable means prior to 60 days after You have
+come back into compliance. Moreover, Your grants from a particular
+Contributor are reinstated on an ongoing basis if such Contributor
+notifies You of the non-compliance by some reasonable means, this is the
+first time You have received notice of non-compliance with this License
+from such Contributor, and You become compliant prior to 30 days after
+Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent
+infringement claim (excluding declaratory judgment actions,
+counter-claims, and cross-claims) alleging that a Contributor Version
+directly or indirectly infringes any patent, then the rights granted to
+You by any and all Contributors for the Covered Software under Section
+2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or Your distributors under this License
+prior to termination shall survive termination.
+
+************************************************************************
+*                                                                      *
+*  6. Disclaimer of Warranty                                           *
+*  -------------------------                                           *
+*                                                                      *
+*  Covered Software is provided under this License on an "as is"       *
+*  basis, without warranty of any kind, either expressed, implied, or  *
+*  statutory, including, without limitation, warranties that the       *
+*  Covered Software is free of defects, merchantable, fit for a        *
+*  particular purpose or non-infringing. The entire risk as to the     *
+*  quality and performance of the Covered Software is with You.        *
+*  Should any Covered Software prove defective in any respect, You     *
+*  (not any Contributor) assume the cost of any necessary servicing,   *
+*  repair, or correction. This disclaimer of warranty constitutes an   *
+*  essential part of this License. No use of any Covered Software is   *
+*  authorized under this License except under this disclaimer.         *
+*                                                                      *
+************************************************************************
+
+************************************************************************
+*                                                                      *
+*  7. Limitation of Liability                                          *
+*  --------------------------                                          *
+*                                                                      *
+*  Under no circumstances and under no legal theory, whether tort      *
+*  (including negligence), contract, or otherwise, shall any           *
+*  Contributor, or anyone who distributes Covered Software as          *
+*  permitted above, be liable to You for any direct, indirect,         *
+*  special, incidental, or consequential damages of any character      *
+*  including, without limitation, damages for lost profits, loss of    *
+*  goodwill, work stoppage, computer failure or malfunction, or any    *
+*  and all other commercial damages or losses, even if such party      *
+*  shall have been informed of the possibility of such damages. This   *
+*  limitation of liability shall not apply to liability for death or   *
+*  personal injury resulting from such party's negligence to the       *
+*  extent applicable law prohibits such limitation. Some               *
+*  jurisdictions do not allow the exclusion or limitation of           *
+*  incidental or consequential damages, so this exclusion and          *
+*  limitation may not apply to You.                                    *
+*                                                                      *
+************************************************************************
+
+8. Litigation
+-------------
+
+Any litigation relating to this License may be brought only in the
+courts of a jurisdiction where the defendant maintains its principal
+place of business and such litigation shall be governed by laws of that
+jurisdiction, without reference to its conflict-of-law provisions.
+Nothing in this Section shall prevent a party's ability to bring
+cross-claims or counter-claims.
+
+9. Miscellaneous
+----------------
+
+This License represents the complete agreement concerning the subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. Any law or regulation which provides
+that the language of a contract shall be construed against the drafter
+shall not be used to construe this License against a Contributor.
+
+10. Versions of the License
+---------------------------
+
+10.1. New Versions
+
+Mozilla Foundation is the license steward. Except as provided in Section
+10.3, no one other than the license steward has the right to modify or
+publish new versions of this License. Each version will be given a
+distinguishing version number.
+
+10.2. Effect of New Versions
+
+You may distribute the Covered Software under the terms of the version
+of the License under which You originally received the Covered Software,
+or under the terms of any subsequent version published by the license
+steward.
+
+10.3. Modified Versions
+
+If you create software not governed by this License, and you want to
+create a new license for such software, you may create and use a
+modified version of this License if you rename the license and remove
+any references to the name of the license steward (except to note that
+such modified license differs from this License).
+
+10.4. Distributing Source Code Form that is Incompatible With Secondary
+Licenses
+
+If You choose to distribute Source Code Form that is Incompatible With
+Secondary Licenses under the terms of this version of the License, the
+notice described in Exhibit B of this License must be attached.
+
+Exhibit A - Source Code Form License Notice
+-------------------------------------------
+
+  This Source Code Form is subject to the terms of the Mozilla Public
+  License, v. 2.0. If a copy of the MPL was not distributed with this
+  file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+If it is not possible or desirable to put the notice in a particular
+file, then You may include the notice in a location (such as a LICENSE
+file in a relevant directory) where a recipient would be likely to look
+for such a notice.
+
+You may add additional accurate notices of copyright ownership.
+
+Exhibit B - "Incompatible With Secondary Licenses" Notice
+---------------------------------------------------------
+
+  This Source Code Form is "Incompatible With Secondary Licenses", as
+  defined by the Mozilla Public License, v. 2.0.
diff --git a/meta/files/common-licenses/MS-PL b/meta/files/common-licenses/MS-PL
new file mode 100644
index 0000000..e90d6b4
--- /dev/null
+++ b/meta/files/common-licenses/MS-PL
@@ -0,0 +1,19 @@
+
+Microsoft Public License (Ms-PL)
+ 
+
+This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
+ 
+
+Definitions
+The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. A "contribution" is the original software, or any additions or changes to the software. A "contributor" is any person that distributes its contribution under this license. "Licensed patents" are a contributor`s patent claims that read directly on its contribution.
+Grant of Rights
+(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
+(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
+Conditions and Limitations
+(A) No Trademark License- This license does not grant you rights to use any contributors` name, logo, or trademarks. 
+(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. 
+(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. 
+(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. 
+(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
+
diff --git a/meta/files/common-licenses/MS-RL b/meta/files/common-licenses/MS-RL
new file mode 100644
index 0000000..f703c0d
--- /dev/null
+++ b/meta/files/common-licenses/MS-RL
@@ -0,0 +1,23 @@
+
+Microsoft Reciprocal License (Ms-RL)
+ 
+
+This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
+ 
+
+Definitions
+The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
+A "contribution" is the original software, or any additions or changes to the software. 
+A "contributor" is any person that distributes its contribution under this license. 
+"Licensed patents" are a contributor`s patent claims that read directly on its contribution.
+Grant of Rights
+(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
+(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
+Conditions and Limitations
+(A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose. 
+(B) No Trademark License- This license does not grant you rights to use any contributors` name, logo, or trademarks. 
+(C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. 
+(D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. 
+(E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. 
+(F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees, or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
+
diff --git a/meta/files/common-licenses/MirOS b/meta/files/common-licenses/MirOS
new file mode 100644
index 0000000..146768e
--- /dev/null
+++ b/meta/files/common-licenses/MirOS
@@ -0,0 +1,58 @@
+
+MirOS License
+
+/*-
+* Copyright &#169; year, year, year, &#8230;
+* First M. Last <user@host.domain>
+*
+* Provided that these terms and disclaimer and all copyright notices
+* are retained or reproduced in an accompanying document, permission
+* is granted to deal in this work without restriction, including un&#8208;
+* limited rights to use, publicly perform, distribute, sell, modify,
+* merge, give away, or sublicence.
+*
+* This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
+* the utmost extent permitted by applicable law, neither express nor
+* implied; without malicious intent or gross negligence. In no event
+* may a licensor, author or contributor be held liable for indirect,
+* direct, other damage, loss, or other issues arising in any way out
+* of dealing in the work, even if advised of the possibility of such
+* damage or existence of a defect, except proven that it results out
+* of said person`s immediate fault when using the work as intended.
+*/
+
+I_N_S_T_R_U_C_T_I_O_N_S_:_
+To apply the template(&#185;) specify the years of copyright (separated by
+comma, not as a range), the legal names of the copyright holders, and
+the real names of the authors if different. Avoid adding text.
+
+R_A_T_I_O_N_A_L_E_:_
+This licence is apt for any kind of work (such as source code, fonts,
+documentation, graphics, sound etc.) and the preferred terms for work
+added to MirBSD. It has been drafted as universally usable equivalent
+of the "historic permission notice"&#8317;&#178;&#8318; adapted to Europen law because
+in some (droit d`auteur) countries authors cannot disclaim all liabi&#8208;
+lities. Compliance to DFSG&#8317;&#179;&#8318; 1.1 is ensured, and GPLv2 compatibility
+is asserted unless advertising clauses are used. The MirOS Licence is
+certified to conform to OKD&#8317;&#8308;&#8318; 1.0 and OSD&#8317;&#8309;&#8318; 1.9, and qualifies as a
+Free Software&#8317;&#8310;&#8318; and also Free Documentation&#8317;&#8311;&#8318; licence and is inclu&#8208;
+ded in some relevant lists&#8317;&#8312;&#8318;&#8317;&#8313;&#8318;&#8317;&#185;&#8304;&#8318;.
+
+We believe you are not liable for work inserted which is intellectual
+property of third parties, if you were not aware of the fact, act ap&#8208;
+propriately as soon as you become aware of that problem, seek an ami&#8208;
+cable solution for all parties, and never knowingly distribute a work
+without being authorised to do so by its licensors.
+
+R_E_F_E_R_E_N_C_E_S_:_
+&#9312; also at http://mirbsd.de/MirOS-Licence
+&#9313; http://www.opensource.org/licenses/historical.php
+&#9314; http://www.debian.org/social_contract#guidelines
+&#9315; http://www.opendefinition.org/1.0
+&#9316; http://www.opensource.org/docs/osd
+&#9317; http://www.gnu.org/philosophy/free-sw.html
+&#9318; http://www.gnu.org/philosophy/free-doc.html
+&#9319; http://www.ifross.de/ifross_html/lizenzcenter.html
+&#9320; http://www.opendefinition.org/licenses
+&#9321; http://opensource.org/licenses/miros.html
+
diff --git a/meta/files/common-licenses/Motosoto b/meta/files/common-licenses/Motosoto
new file mode 100644
index 0000000..7a524f6
--- /dev/null
+++ b/meta/files/common-licenses/Motosoto
@@ -0,0 +1,422 @@
+
+MOTOSOTO OPEN SOURCE LICENSE - Version 0.9.1
+This Motosoto Open Source License (the "License") applies to "Community
+Portal Server" and related software products as well as any updatesor
+maintenance releases of that software ("Motosoto Products") that are
+distributed by Motosoto.Com B.V. ("Licensor"). Any Motosoto
+Product licensed pursuant to this License is a "Licensed Product." Licensed
+Product, in its entirety, is protected by Dutch copyright law.
+This
+License identifies the terms under which you may use, copy, distribute or modify
+Licensed Product and has been submitted to the Open Software Initiative (OSI)
+for approval.
+
+Preamble
+
+This Preamble is intended to describe, in plain English, the nature and scope of
+this License. However, this Preamble is not a part of this license. The legal
+effect of this License is dependent only upon the terms of the License and not
+this Preamble.
+This License complies with the Open Source Definition and has been approved by
+Open Source Initiative. Software distributed under this License may be marked
+as "OSI Certified Open Source Software."
+
+This License provides that:
+
+1. You may use, sell or give away the Licensed Product, alone or as a
+component of an aggregate software distribution containing
+programs from several different sources. No royalty or other fee is
+required.
+
+2. Both Source Code and executable versions of the Licensed Product,
+including Modifications made by previous Contributors, are
+available for your use. (The terms "Licensed Product," "Modifications,"
+"Contributors" and "Source Code" are defined in the License.)
+
+3. You are allowed to make Modifications to the Licensed Product, and you
+can create Derivative Works from it. (The term "Derivative
+Works" is defined in the License.)
+
+4. By accepting the Licensed Product under the provisions of this License,
+you agree that any Modifications you make to the Licensed
+Product and then distribute are governed by the provisions of this
+License. In particular, you must make the Source Code of your
+Modifications available to others.
+
+5. You may use the Licensed Product for any purpose, but the Licensor is
+not providing you any warranty whatsoever, nor is the Licensor
+accepting any liability in the event that the Licensed Product doesn`t
+work properly or causes you any injury or damages.
+
+6. If you sublicense the Licensed Product or Derivative Works, you may
+charge fees for warranty or support, or for accepting indemnity
+or liability obligations to your customers. You cannot charge for the
+Source Code.
+
+7. If you assert any patent claims against the Licensor relating to the
+Licensed Product, or if you breach any terms of the License, your
+rights to the Licensed Product under this License automatically
+terminate.
+
+You may use this License to distribute your own Derivative Works, in which
+case the provisions of this License will apply to your Derivative
+Works just as they do to the original Licensed Product.
+
+Alternatively, you may distribute your Derivative Works under any other
+OSI-approved Open Source license, or under a proprietary license of
+your choice. If you use any license other than this License, however, you must
+continue to fulfill the requirements of this License (including the
+provisions relating to publishing the Source Code) for those portions of your
+Derivative Works that consist of the Licensed Product, including
+the files containing Modifications.
+
+New versions of this License may be published from time to time. You may
+choose to continue to use the license terms in this version of the
+License or those from the new version. However, only the Licensor has the right
+to change the License terms as they apply to the Licensed
+Product.
+This License relies on precise definitions for certain terms. Those terms are
+defined when they are first used, and the definitions are repeated for
+your convenience in a Glossary at the end of the License.
+
+License Terms
+
+1. Grant of License From Licensor.
+
+Licensor
+hereby grants you a world-wide, royalty-free, non-exclusive license, subject to
+third
+party intellectual property claims, to do the following:
+
+a. Use, reproduce, modify, display, perform, sublicense and
+distribute Licensed Product or portions thereof (including
+Modifications as hereinafter defined), in both Source Code or as
+an executable program. "Source Code" means the preferred
+form for making modifications to the Licensed Product, including
+all modules contained therein, plus any associated
+interface definition files, scripts used to control compilation
+and installation of an executable program, or a list of
+differential comparisons against the Source Code of the Licensed
+Product.
+
+b. Create Derivative Works (as that term is defined under Dutch
+copyright law) of Licensed Product by adding to or deleting
+from the substance or structure of said Licensed Product.
+
+c. Under claims of patents now or hereafter owned or controlled
+by Licensor, to make, use, sell, offer for sale, have made,
+and/or otherwise dispose of Licensed Product or portions thereof,
+but solely to the extent that any such claim is necessary to
+enable you to make, use, sell, offer for sale, have made, and/or
+otherwise dispose of Licensed Product or portions thereof or
+Derivative Works thereof.
+
+2. Grant of License to Modifications From
+Contributor.
+
+"Modifications" means any additions to or
+deletions from the substance or
+structure of (i) a file containing Licensed Product, or (ii) any new file
+that contains any part of Licensed Product. Hereinafter in this
+License, the term "Licensed Product" shall include all previous
+Modifications that you receive from any Contributor. By
+application of the provisions in Section 4(a) below, each person or
+entity who created or contributed to the creation of, and distributed,
+a Modification (a "Contributor") hereby grants you a world-wide,
+royalty-free, non-exclusive license, subject to third party
+intellectual property claims, to do the following:
+
+a. Use, reproduce, modify, display, perform, sublicense and
+distribute any Modifications created by such Contributor or
+portions thereof, in both Source Code or as an executable program,
+either on an unmodified basis or as part of Derivative
+Works.
+
+b. Under claims of patents now or hereafter owned or controlled by
+Contributor, to make, use, sell, offer for sale, have made,
+and/or otherwise dispose of Modifications or portions thereof, but
+solely to the extent that any such claim is necessary to
+enable you to make, use, sell, offer for sale, have made, and/or
+otherwise dispose of Modifications or portions thereof or
+Derivative Works thereof.
+
+3. Exclusions From License Grant.
+
+Nothing in
+this License shall be deemed to grant any rights to trademarks, copyrights,
+patents,
+trade secrets or any other intellectual property of Licensor or any
+Contributor except as expressly stated herein. No patent license is
+granted separate from the Licensed Product, for code that you delete from
+the Licensed Product, or for combinations of the Licensed
+Product with other software or hardware. No right is granted to the
+trademarks of Licensor or any Contributor even if such marks are
+included in the Licensed Product. Nothing in this License shall be
+interpreted to prohibit Licensor from licensing under different
+terms from this License any code that Licensor otherwise would have a
+right to license.
+
+4. Your Obligations Regarding Distribution.
+
+a. Application of This License to Your
+Modifications. As an express condition for your use of the Licensed
+Product, you
+hereby agree that any Modifications that you create or to which
+you contribute, and which you distribute, are governed by the
+terms of this License including, without limitation, Section 2.
+Any Modifications that you create or to which you contribute
+may be distributed only under the terms of this License or a
+future version of this License released under Section 7. You must
+include a copy of this License with every copy of the
+Modifications you distribute. You agree not to offer or impose any
+terms on any Source Code or executable version of the Licensed
+Product or Modifications that alter or restrict the applicable
+version of this License or the recipients` rights hereunder.
+However, you may include an additional document offering the
+additional rights described in Section 4(e).
+
+b. Availability of Source Code. You must make
+available, under the terms of this License, the Source Code of the Licensed
+Product and any Modifications that you distribute, either on the
+same media as you distribute any executable or other form
+of the Licensed Product, or via a mechanism generally accepted in
+the software development community for the electronic
+transfer of data (an "Electronic Distribution Mechanism"). The
+Source Code for any version of Licensed Product or
+Modifications that you distribute must remain available for at
+least twelve (12) months after the date it initially became
+available, or at least six (6) months after a subsequent version
+of said Licensed Product or Modifications has been made
+available. You are responsible for ensuring that the Source Code
+version remains available even if the Electronic Distribution
+Mechanism is maintained by a third party.
+
+c. Description of Modifications. You must cause any
+Modifications that you create or to which you contribute, and which
+you distribute, to contain a file documenting the additions,
+changes or deletions you made to create or contribute to those
+Modifications, and the dates of any such additions, changes or
+deletions. You must include a prominent statement that the
+Modifications are derived, directly or indirectly, from the
+Licensed Product and include the names of the Licensor and any
+Contributor to the Licensed Product in (i) the Source Code and
+(ii) in any notice displayed by a version of the Licensed
+Product you distribute or in related documentation in which you
+describe the origin or ownership of the Licensed Product.
+You may not modify or delete any preexisting copyright notices in
+the Licensed Product.
+
+d. Intellectual Property Matters.
+
+i. Third Party Claims. If you have
+knowledge that a license to a third party`s intellectual property right is
+required
+to exercise the rights granted by this License, you must
+include a text file with the Source Code distribution titled
+"LEGAL" that describes the claim and the party making the
+claim in sufficient detail that a recipient will know
+whom to contact. If you obtain such knowledge after you make
+any Modifications available as described in Section
+4(b), you shall promptly modify the LEGAL file in all copies
+you make available thereafter and shall take other
+steps (such as notifying appropriate mailing lists or
+newsgroups) reasonably calculated to inform those who
+received the Licensed Product from you that new knowledge
+has been obtained.
+
+ii. Contributor APIs. If your
+Modifications include an application programming interface ("API") and you have
+knowledge of patent licenses that are reasonably necessary
+to implement that API, you must also include this
+information in the LEGAL file.
+
+iii. Representations. You represent that,
+except as disclosed pursuant to 4(d)(i) above, you believe that any
+Modifications you distribute are your original creations and
+that you have sufficient rights to grant the rights
+conveyed by this License.
+
+e. Required Notices. You must duplicate this
+License in any documentation you provide along with the Source Code of any
+Modifications you create or to which you contribute, and which you
+distribute, wherever you describe recipients` rights
+relating to Licensed Product. You must duplicate the notice
+contained in Exhibit A (the "Notice") in each file of the Source
+Code of any copy you distribute of the Licensed Product. If you
+created a Modification, you may add your name as a
+Contributor to the Notice. If it is not possible to put the Notice
+in a particular Source Code file due to its structure, then
+you must include such Notice in a location (such as a relevant
+directory file) where a user would be likely to look for such a
+notice. You may choose to offer, and charge a fee for, warranty,
+support, indemnity or liability obligations to one or more
+recipients of Licensed Product. However, you may do so only on
+your own behalf, and not on behalf of the Licensor or any
+Contributor. You must make it clear that any such warranty,
+support, indemnity or liability obligation is offered by you
+alone, and you hereby agree to indemnify the Licensor and every
+Contributor for any liability incurred by the Licensor or such
+Contributor as a result of warranty, support, indemnity or
+liability terms you offer.
+
+f. Distribution of Executable Versions. You may
+distribute Licensed Product as an executable program under a license of
+your choice that may contain terms different from this License
+provided (i) you have satisfied the requirements of Sections
+4(a) through 4(e) for that distribution, (ii) you include a
+conspicuous notice in the executable version, related documentation
+and collateral materials stating that the Source Code version of
+the Licensed Product is available under the terms of this
+License, including a description of how and where you have
+fulfilled the obligations of Section 4(b), (iii) you retain all
+existing copyright notices in the Licensed Product, and (iv) you
+make it clear that any terms that differ from this License are
+offered by you alone, not by Licensor or any Contributor. You
+hereby agree to indemnify the Licensor and every Contributor
+for any liability incurred by Licensor or such Contributor as a
+result of any terms you offer.
+
+g. Distribution of Derivative Works. You may
+create Derivative Works (e.g., combinations of some or all of the Licensed
+Product with other code) and distribute the Derivative Works as
+products under any other license you select, with the
+proviso that the requirements of this License are fulfilled for
+those portions of the Derivative Works that consist of the
+Licensed Product or any Modifications thereto.
+
+5. Inability to Comply Due to Statute or
+Regulation.
+
+If it is impossible for you to comply with any of
+the terms of this License with
+respect to some or all of the Licensed Product due to statute, judicial
+order, or regulation, then you must (i) comply with the terms of
+this License to the maximum extent possible, (ii) cite the statute or
+regulation that prohibits you from adhering to the License, and
+(iii) describe the limitations and the code they affect. Such description
+must be included in the LEGAL file described in Section 4(d),
+and must be included with all distributions of the Source Code. Except to
+the extent prohibited by statute or regulation, such
+description must be sufficiently detailed for a recipient of ordinary
+skill at computer programming to be able to understand it.
+
+6. Application of This License.
+
+This License
+applies to code to which Licensor or Contributor has attached the Notice in
+Exhibit A,
+which is incorporated herein by this reference.
+
+7. Versions of This License.
+
+a. Version. The Motosoto Open Source License is
+derived from the Jabber Open Source License. All changes are related to
+applicable law and the location of court.
+
+b. New Versions. Licensor may publish from time to
+time revised and/or new versions of the License.
+
+c. Effect of New Versions. Once Licensed Product
+has been published under a particular version of the License, you may always
+continue to use it under the terms of that version. You may also
+choose to use such Licensed Product under the terms of any
+subsequent version of the License published by Licensor. No one
+other than Lic ensor has the right to modify the terms
+applicable to Licensed Product created under this License.
+
+d. Derivative Works of this License. If you
+create or use a modified version of this License, which you may do only in
+order to
+apply it to software that is not already a Licensed Product under
+this License, you must rename your license so that it is not
+confusingly similar to this License, and must make it clear that
+your license contains terms that differ from this License. In
+so naming your license, you may not use any trademark of Licensor
+or any Contributor.
+
+8. Disclaimer of Warranty.
+
+LICENSED PRODUCT IS
+PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT
+WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, WITHOUT
+LIMITATION, WARRANTIES
+THAT THE LICENSED PRODUCT IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A
+PARTICULAR PURPOSE OR
+NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LICENSED PRODUCT IS
+WITH YOU. SHOULD LICENSED PRODUCT PROVE DEFECTIVE IN ANY RESPECT, YOU
+(AND NOT THE LICENSOR OR
+ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR
+OR CORRECTION. THIS
+DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO
+USE OF LICENSED
+PRODUCT IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+9. Termination.
+
+a. Automatic Termination Upon Breach. This
+license and the rights granted hereunder will terminate automatically if you
+fail to comply with the terms herein and fail to cure such breach
+within thirty (30) days of becoming aware of the breach.
+All sublicenses to the Licensed Product that are properly granted
+shall survive any termination of this license. Provisions
+that, by their nature, must remain in effect beyond the
+termination of this License, shall survive.
+
+b. Termination Upon Assertion of Patent
+Infringement. If you initiate litigation by asserting a patent
+infringement claim
+(excluding declaratory judgment actions) against Licensor or a
+Contributor (Licensor or Contributor against whom you file
+such an action is referred to herein as "Respondent") alleging
+that Licensed Product directly or indirectly infringes any
+patent, then any and all rights granted by such Respondent to you
+under Sections 1 or 2 of this License shall terminate
+prospectively upon sixty (60) days notice from Respondent (the
+"Notice Period") unless within that Notice Period you
+either agree in writing (i) to pay Respondent a mutually agreeable
+reasonably royalty for your past or future use of Licensed
+Product made by such Respondent, or (ii) withdraw your litigation
+claim with respect to Licensed Product against such
+Respondent. If within said Notice Period a reasonable royalty and
+payment arrangement are not mutually agreed upon in
+writing by the parties or the litigation claim is not withdrawn,
+the rights granted by Licensor to you under Sections 1 and 2
+automatically terminate at the expiration of said Notice
+Period.
+
+c. Reasonable Value of This License. If you assert a
+patent infringement claim against Respondent alleging that Licensed
+Product directly or indirectly infringes any patent where such
+claim is resolved (such as by license or settlement) prior to
+the initiation of patent infringement litigation, then the
+reasonable value of the licenses granted by said Respondent under
+Sections 1 and 2 shall be taken into account in determining the
+amount or value of any payment or license.
+
+d. No Retroactive Effect of Termination. In the
+event of termination under Sections 9(a) or 9(b) above, all end user license
+agreements (excluding licenses to distributors and reselle rs)
+that have been validly granted by you or any distributor
+hereunder prior to termination shall survive
+termination.
+
+10. Limitation of Liability.
+
+UNDER NO
+CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE LICENSOR, ANY
+CONTRIBUTOR, OR ANY
+DISTRIBUTOR OF LICENSED PRODUCT, OR ANY SUPPLIER OF ANY OF SUCH PARTIES,
+BE LIABLE TO ANY PERSON
+FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+CHARACTER INCLUDING,
+WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER
+FAILURE OR
+MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF
+SUCH PARTY SHALL
+HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT
+APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH
+PARTY
+
diff --git a/meta/files/common-licenses/Multics b/meta/files/common-licenses/Multics
new file mode 100644
index 0000000..a487645
--- /dev/null
+++ b/meta/files/common-licenses/Multics
@@ -0,0 +1,40 @@
+
+Multics License
+
+Historical Background
+
+This edition of the Multics software materials and documentation is
+provided and donated to Massachusetts Institute of Technology by Group
+BULL including BULL HN Information Systems Inc. as a contribution to
+computer science knowledge. This donation is made also to give evidence
+of the common contributions of Massachusetts Institute of Technology,
+Bell Laboratories, General Electric, Honeywell Information Systems
+Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems
+Inc. to the development of this operating system. Multics development
+was initiated by Massachusetts Institute of Technology Project MAC
+(1963-1970), renamed the MIT Laboratory for Computer Science and
+Artificial Intelligence in the mid 1970s, under the leadership of
+Professor Fernando Jose Corbato. Users consider that Multics provided the
+best software architecture for managing computer hardware properly and
+for executing programs. Many subsequent operating systems incorporated
+Multics principles. Multics was distributed in 1975 to 2000 by Group
+Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as
+successor in interest by change in name only to Honeywell Bull Inc. and
+Honeywell Information Systems Inc. .
+
+-----------------------------------------------------------
+
+Permission to use, copy, modify, and distribute these programs and their
+documentation for any purpose and without fee is hereby granted,provided
+that the below copyright notice and historical background appear in all
+copies and that both the copyright notice and historical background and
+this permission notice appear in supporting documentation, and that
+the names of MIT, HIS, BULL or BULL HN not be used in advertising or
+publicity pertaining to distribution of the programs without specific
+prior written permission.
+Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information
+Systems Inc.
+Copyright 2006 by BULL HN Information Systems Inc.
+Copyright 2006 by Bull SAS
+All Rights Reserved
+
diff --git a/meta/files/common-licenses/NASA-1.3 b/meta/files/common-licenses/NASA-1.3
new file mode 100644
index 0000000..123182d
--- /dev/null
+++ b/meta/files/common-licenses/NASA-1.3
@@ -0,0 +1,79 @@
+
+ASA OPEN SOURCE AGREEMENT VERSION 1.3
+
+THIS OPEN SOURCE AGREEMENT ("AGREEMENT") DEFINES THE RIGHTS OF USE, REPRODUCTION, DISTRIBUTION, MODIFICATION AND REDISTRIBUTION OF CERTAIN COMPUTER SOFTWARE ORIGINALLY RELEASED BY THE UNITED STATES GOVERNMENT AS REPRESENTED BY THE GOVERNMENT AGENCY LISTED BELOW ("GOVERNMENT AGENCY"). THE UNITED STATES GOVERNMENT, AS REPRESENTED BY GOVERNMENT AGENCY, IS AN INTENDED THIRD-PARTY BENEFICIARY OF ALL SUBSEQUENT DISTRIBUTIONS OR REDISTRIBUTIONS OF THE SUBJECT SOFTWARE. ANYONE WHO USES, REPRODUCES, DISTRIBUTES, MODIFIES OR REDISTRIBUTES THE SUBJECT SOFTWARE, AS DEFINED HEREIN, OR ANY PART THEREOF, IS, BY THAT ACTION, ACCEPTING IN FULL THE RESPONSIBILITIES AND OBLIGATIONS CONTAINED IN THIS AGREEMENT.
+
+Government Agency: _____ Government Agency Original Software Designation: __ Government Agency Original Software Title: _____ User Registration Requested. Please Visit http://___ Government Agency Point of Contact for Original Software: _____
+
+DEFINITIONS
+A. "Contributor" means Government Agency, as the developer of the Original Software, and any entity that makes a Modification. B. "Covered Patents" mean patent claims licensable by a Contributor that are necessarily infringed by the use or sale of its Modification alone or when combined with the Subject Software. C. "Display" means the showing of a copy of the Subject Software, either directly or by means of an image, or any other device. D. "Distribution" means conveyance or transfer of the Subject Software, regardless of means, to another. E. "Larger Work" means computer software that combines Subject Software, or portions thereof, with software separate from the Subject Software that is not governed by the terms of this Agreement. F. "Modification" means any alteration of, including addition to or deletion from, the substance or structure of either the Original Software or Subject Software, and includes derivative works, as that term is defined in the Copyright Statute, 17 USC 101. However, the act of including Subject Software as part of a Larger Work does not in and of itself constitute a Modification. G. "Original Software" means the computer software first released under this Agreement by Government Agency with Government Agency designation __ and entitled _________, including source code, object code and accompanying documentation, if any. H. "Recipient" means anyone who acquires the Subject Software under this Agreement, including all Contributors. I. "Redistribution" means Distribution of the Subject Software after a Modification has been made. J. "Reproduction" means the making of a counterpart, image or copy of the Subject Software. K. "Sale" means the exchange of the Subject Software for money or equivalent value. L. "Subject Software" means the Original Software, Modifications, or any respective parts thereof. M. "Use" means the application or employment of the Subject Software for any purpose.
+
+GRANT OF RIGHTS
+A. Under Non-Patent Rights: Subject to the terms and conditions of this Agreement, each Contributor, with respect to its own contribution to the Subject Software, hereby grants to each Recipient a non-exclusive, world-wide, royalty-free license to engage in the following activities pertaining to the Subject Software:
+
+Use
+Distribution
+Reproduction
+Modification
+Redistribution
+Display
+B. Under Patent Rights: Subject to the terms and conditions of this Agreement, each Contributor, with respect to its own contribution to the Subject Software, hereby grants to each Recipient under Covered Patents a non-exclusive, world-wide, royalty-free license to engage in the following activities pertaining to the Subject Software:
+
+Use
+Distribution
+Reproduction
+Sale
+Offer for Sale
+C. The rights granted under Paragraph B. also apply to the combination of a Contributor`s Modification and the Subject Software if, at the time the Modification is added by the Contributor, the addition of such Modification causes the combination to be covered by the Covered Patents. It does not apply to any other combinations that include a Modification.
+
+D. The rights granted in Paragraphs A. and B. allow the Recipient to sublicense those same rights. Such sublicense must be under the same terms and conditions of this Agreement.
+
+OBLIGATIONS OF RECIPIENT
+A. Distribution or Redistribution of the Subject Software must be made under this Agreement except for additions covered under paragraph 3H.
+
+Whenever a Recipient distributes or redistributes the Subject Software, a copy of this Agreement must be included with each copy of the Subject Software; and
+If Recipient distributes or redistributes the Subject Software in any form other than source code, Recipient must also make the source code freely available, and must provide with each copy of the Subject Software information on how to obtain the source code in a reasonable manner on or through a medium customarily used for software exchange.
+B. Each Recipient must ensure that the following copyright notice appears prominently in the Subject Software:
+
+[Government Agency will insert the applicable copyright notice in each agreement accompanying the initial distribution of original software and remove this bracketed language.]
+
+[The following copyright notice will be used if created by a contractor pursuant to Government Agency contract and rights obtained from creator by assignment. Government Agency will insert the year and its Agency designation and remove the bracketed language.] Copyright &#65533; {YEAR} United States Government as represented by ___ ____. All Rights Reserved.
+
+[The following copyright notice will be used if created by civil servants only. Government Agency will insert the year and its Agency designation and remove the bracketed language.] Copyright &#65533; {YEAR} United States Government as represented by ____ ____. No copyright is claimed in the United States under Title 17, U.S.Code. All Other Rights Reserved.
+
+C. Each Contributor must characterize its alteration of the Subject Software as a Modification and must identify itself as the originator of its Modification in a manner that reasonably allows subsequent Recipients to identify the originator of the Modification. In fulfillment of these requirements, Contributor must include a file (e.g., a change log file) that describes the alterations made and the date of the alterations, identifies Contributor as originator of the alterations, and consents to characterization of the alterations as a Modification, for example, by including a statement that the Modification is derived, directly or indirectly, from Original Software provided by Government Agency. Once consent is granted, it may not thereafter be revoked.
+
+D. A Contributor may add its own copyright notice to the Subject Software. Once a copyright notice has been added to the Subject Software, a Recipient may not remove it without the express permission of the Contributor who added the notice.
+
+E. A Recipient may not make any representation in the Subject Software or in any promotional, advertising or other material that may be construed as an endorsement by Government Agency or by any prior Recipient of any product or service provided by Recipient, or that may seek to obtain commercial advantage by the fact of Government Agency`s or a prior Recipient`s participation in this Agreement.
+
+F. In an effort to track usage and maintain accurate records of the Subject Software, each Recipient, upon receipt of the Subject Software, is requested to register with Government Agency by visiting the following website: ______. Recipient`s name and personal information shall be used for statistical purposes only. Once a Recipient makes a Modification available, it is requested that the Recipient inform Government Agency at the web site provided above how to access the Modification.
+
+[Alternative paragraph for use when a web site for release and monitoring of subject software will not be supported by releasing Government Agency] In an effort to track usage and maintain accurate records of the Subject Software, each Recipient, upon receipt of the Subject Software, is requested to provide Government Agency, by e-mail to the Government Agency Point of Contact listed in clause 5.F., the following information: ______. Recipient`s name and personal information shall be used for statistical purposes only. Once a Recipient makes a Modification available, it is requested that the Recipient inform Government Agency, by e-mail to the Government Agency Point of Contact listed in clause 5.F., how to access the Modification.
+
+G. Each Contributor represents that that its Modification is believed to be Contributor`s original creation and does not violate any existing agreements, regulations, statutes or rules, and further that Contributor has sufficient rights to grant the rights conveyed by this Agreement.
+
+H. A Recipient may choose to offer, and to charge a fee for, warranty, support, indemnity and/or liability obligations to one or more other Recipients of the Subject Software. A Recipient may do so, however, only on its own behalf and not on behalf of Government Agency or any other Recipient. Such a Recipient must make it absolutely clear that any such warranty, support, indemnity and/or liability obligation is offered by that Recipient alone. Further, such Recipient agrees to indemnify Government Agency and every other Recipient for any liability incurred by them as a result of warranty, support, indemnity and/or liability offered by such Recipient.
+
+I. A Recipient may create a Larger Work by combining Subject Software with separate software not governed by the terms of this agreement and distribute the Larger Work as a single product. In such case, the Recipient must make sure Subject Software, or portions thereof, included in the Larger Work is subject to this Agreement.
+
+J. Notwithstanding any provisions contained herein, Recipient is hereby put on notice that export of any goods or technical data from the United States may require some form of export license from the U.S. Government. Failure to obtain necessary export licenses may result in criminal liability under U.S. laws. Government Agency neither represents that a license shall not be required nor that, if required, it shall be issued. Nothing granted herein provides any such export license.
+
+DISCLAIMER OF WARRANTIES AND LIABILITIES; WAIVER AND INDEMNIFICATION
+A. No Warranty: THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE. THIS AGREEMENT DOES NOT, IN ANY MANNER, CONSTITUTE AN ENDORSEMENT BY GOVERNMENT AGENCY OR ANY PRIOR RECIPIENT OF ANY RESULTS, RESULTING DESIGNS, HARDWARE, SOFTWARE PRODUCTS OR ANY OTHER APPLICATIONS RESULTING FROM USE OF THE SUBJECT SOFTWARE. FURTHER, GOVERNMENT AGENCY DISCLAIMS ALL WARRANTIES AND LIABILITIES REGARDING THIRD-PARTY SOFTWARE, IF PRESENT IN THE ORIGINAL SOFTWARE, AND DISTRIBUTES IT "AS IS."
+
+B. Waiver and Indemnity: RECIPIENT AGREES TO WAIVE ANY AND ALL CLAIMS AGAINST THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT. IF RECIPIENT`S USE OF THE SUBJECT SOFTWARE RESULTS IN ANY LIABILITIES, DEMANDS, DAMAGES, EXPENSES OR LOSSES ARISING FROM SUCH USE, INCLUDING ANY DAMAGES FROM PRODUCTS BASED ON, OR RESULTING FROM, RECIPIENT`S USE OF THE SUBJECT SOFTWARE, RECIPIENT SHALL INDEMNIFY AND HOLD HARMLESS THE UNITED STATES GOVERNMENT, ITS CONTRACTORS AND SUBCONTRACTORS, AS WELL AS ANY PRIOR RECIPIENT, TO THE EXTENT PERMITTED BY LAW. RECIPIENT`S SOLE REMEDY FOR ANY SUCH MATTER SHALL BE THE IMMEDIATE, UNILATERAL TERMINATION OF THIS AGREEMENT.
+
+GENERAL TERMS
+A. Termination: This Agreement and the rights granted hereunder will terminate automatically if a Recipient fails to comply with these terms and conditions, and fails to cure such noncompliance within thirty (30) days of becoming aware of such noncompliance. Upon termination, a Recipient agrees to immediately cease use and distribution of the Subject Software. All sublicenses to the Subject Software properly granted by the breaching Recipient shall survive any such termination of this Agreement.
+
+B. Severability: If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement.
+
+C. Applicable Law: This Agreement shall be subject to United States federal law only for all purposes, including, but not limited to, determining the validity of this Agreement, the meaning of its provisions and the rights, obligations and remedies of the parties.
+
+D. Entire Understanding: This Agreement constitutes the entire understanding and agreement of the parties relating to release of the Subject Software and may not be superseded, modified or amended except by further written agreement duly executed by the parties.
+
+E. Binding Authority: By accepting and using the Subject Software under this Agreement, a Recipient affirms its authority to bind the Recipient to all terms and conditions of this Agreement and that that Recipient hereby agrees to all terms and conditions herein.
+
+F. Point of Contact: Any Recipient contact with Government Agency is to be directed to the designated representative as follows: ___________.
+
diff --git a/meta/files/common-licenses/NCSA b/meta/files/common-licenses/NCSA
new file mode 100644
index 0000000..d0ddc9b
--- /dev/null
+++ b/meta/files/common-licenses/NCSA
@@ -0,0 +1,34 @@
+
+University of Illinois/NCSA Open Source License
+Copyright (c) <Year> <Owner Organization Name> 
+All rights reserved.
+
+Developed by:   <Name of Development Group>
+                       <Name of Institution>
+                        <URL for Development Group/Institution>
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal with the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimers.
+Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimers
+in the documentation and/or other materials provided with the
+distribution.
+Neither the names of <Name of Development Group, Name of
+Institution>, nor the names of its contributors may be used to endorse
+or promote products derived from this Software without specific prior
+written permission.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
+
diff --git a/meta/files/common-licenses/NGPL b/meta/files/common-licenses/NGPL
new file mode 100644
index 0000000..2096eab
--- /dev/null
+++ b/meta/files/common-licenses/NGPL
@@ -0,0 +1,45 @@
+
+
+NETHACK GENERAL PUBLIC LICENSE
+
+(Copyright 1989 M. Stephenson) 
+(Based on the BISON general public license, copyright 1988 Richard M. Stallman)
+
+Everyone is permitted to copy and distribute verbatim copies of this license, but changing it is not allowed. You can also use this wording to make the terms for other programs.
+The license agreements of most software companies keep you at the mercy of those companies. By contrast, our general public license is intended to give everyone the right to share NetHack. To make sure that you get the rights we want you to have, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. Hence this license agreement.
+
+Specifically, we want to make sure that you have the right to give away copies of NetHack, that you receive source code or else can get it if you want it, that you can change NetHack or use pieces of it in new free programs, and that you know you can do these things.
+
+To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of NetHack, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights.
+
+Also, for our own protection, we must make certain that everyone finds out that there is no warranty for NetHack. If NetHack is modified by someone else and passed on, we want its recipients to know that what they have is not what we distributed.
+
+Therefore we (Mike Stephenson and other holders of NetHack copyrights) make the following terms which say what you must do to be allowed to distribute or change NetHack.
+
+COPYING POLICIES
+
+You may copy and distribute verbatim copies of NetHack source code as you receive it, in any medium, provided that you keep intact the notices on all files that refer to copyrights, to this License Agreement, and to the absence of any warranty; and give any other recipients of the NetHack program a copy of this License Agreement along with the program.
+You may modify your copy or copies of NetHack or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above (including distributing this License Agreement), provided that you also do the following:
+a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and
+
+b) cause the whole of any work that you distribute or publish, that in whole or in part contains or is a derivative of NetHack or any part thereof, to be licensed at no charge to all third parties on terms identical to those contained in this License Agreement (except that you may choose to grant more extensive warranty protection to some or all third parties, at your option)
+
+c) You may charge a distribution fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+You may copy and distribute NetHack (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following:
+a) accompany it with the complete machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or,
+
+b) accompany it with full information as to how to obtain the complete machine-readable source code from an appropriate archive site. (This alternative is allowed only for noncommercial distribution.)
+
+For these purposes, complete source code means either the full source distribution as originally released over Usenet or updated copies of the files in this distribution used to create the object code or executable.
+
+You may not copy, sublicense, distribute or transfer NetHack except as expressly provided under this License Agreement. Any attempt otherwise to copy, sublicense, distribute or transfer NetHack is void and your rights to use the program under this License agreement shall be automatically terminated. However, parties who have received computer software programs from you with this License Agreement will not have their licenses terminated so long as such parties remain in full compliance.
+Stated plainly: You are permitted to modify NetHack, or otherwise use parts of NetHack, provided that you comply with the conditions specified above; in particular, your modified NetHack or program containing parts of NetHack must remain freely available as provided in this License Agreement. In other words, go ahead and share NetHack, but don`t try to stop anyone else from sharing it farther. 
+[  Home  |  Version 3.4.3  |  Contact Us  ]
+
+
+
+Hosted by:       
+NetHack is Copyright 1985-2003 by Stichting Mathematisch Centrum and M. Stephenson. See our license for details.
+This site is Copyright 1999-2009 by Kenneth Lorber, Kensington, Maryland.
+
diff --git a/meta/files/common-licenses/NPOSL-3.0 b/meta/files/common-licenses/NPOSL-3.0
new file mode 100644
index 0000000..3a2a662
--- /dev/null
+++ b/meta/files/common-licenses/NPOSL-3.0
@@ -0,0 +1,61 @@
+
+Non-Profit Open Software License ("Non-Profit OSL") 3.0
+
+This Non-Profit Open Software License ("Non-Profit OSL") version 3.0 (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
+
+Licensed under the Non-Profit Open Software License version 3.0
+
+1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
+
+a) to reproduce the Original Work in copies, either alone or as part of a collective work;
+
+b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
+
+c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Non-Profit Open Software License or as provided in section 17(d);
+
+d) to perform the Original Work publicly; and
+
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor`s trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
+
+5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. The Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
+
+9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
+
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
+
+12) Attorneys` Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+16) Modification of This License. This License is Copyright &#169; 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
+
+17) Non-Profit Amendment. The name of this amended version of the Open Software License ("OSL 3.0") is "Non-Profit Open Software License 3.0". The original OSL 3.0 license has been amended as follows:
+
+(a) Licensor represents and declares that it is a not-for-profit organization that derives no revenue whatsoever from the distribution of the Original Work or Derivative Works thereof, or from support or services relating thereto.
+
+(b) The first sentence of Section 7 ["Warranty of Provenance"] of OSL 3.0 has been stricken. For Original Works licensed under this Non-Profit OSL 3.0, LICENSOR OFFERS NO WARRANTIES WHATSOEVER.
+
+(c) In the first sentence of Section 8 ["Limitation of Liability"] of this Non-Profit OSL 3.0, the list of damages for which LIABILITY IS LIMITED now includes "direct" damages.
+
+(d) The proviso in Section 1(c) of this License now refers to this "Non-Profit Open Software License" rather than the "Open Software License". You may distribute or communicate the Original Work or Derivative Works thereof under this Non-Profit OSL 3.0 license only if You make the representation and declaration in paragraph (a) of this Section 17. Otherwise, You shall distribute or communicate the Original Work or Derivative Works thereof only under the OSL 3.0 license and You shall publish clear licensing notices so stating. Also by way of clarification, this License does not authorize You to distribute or communicate works under this Non-Profit OSL 3.0 if You received them under the original OSL 3.0 license.
+
+(e) Original Works licensed under this license shall reference "Non-Profit OSL 3.0" in licensing notices to distinguish them from works licensed under the original OSL 3.0 license.
+
diff --git a/meta/files/common-licenses/NTP b/meta/files/common-licenses/NTP
new file mode 100644
index 0000000..b3572b0
--- /dev/null
+++ b/meta/files/common-licenses/NTP
@@ -0,0 +1,7 @@
+
+NTP License (NTP)
+
+Copyright (c) (CopyrightHoldersName) (From 4-digit-year)-(To 4-digit-year)
+
+Permission to use, copy, modify, and distribute this software and its documentation for any purpose with or without fee is hereby granted, provided that the above copyright notice appears in all copies and that both the copyright notice and this permission notice appear in supporting documentation, and that the name (TrademarkedName) not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. (TrademarkedName) makes no representations about the suitability this software for any purpose. It is provided "as is" without express or implied warranty.
+
diff --git a/meta/files/common-licenses/Nauman b/meta/files/common-licenses/Nauman
new file mode 100644
index 0000000..69ce785
--- /dev/null
+++ b/meta/files/common-licenses/Nauman
@@ -0,0 +1,50 @@
+
+NAUMEN Public License
+This software is Copyright (c) NAUMEN (tm) and Contributors.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the following
+conditions are met:
+
+1. Redistributions in source code must retain the above
+copyright notice, this list of conditions, and the following
+disclaimer.
+
+2. Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions, and the following
+disclaimer in the documentation and/or other materials
+provided with the distribution.
+
+3. The name NAUMEN (tm) must not be used to
+endorse or promote products derived from this software without prior
+written permission from NAUMEN.
+
+4. The right to distribute this software or to use it for any
+purpose does not give you the right to use Servicemarks (sm)
+or Trademarks (tm) of NAUMEN.
+
+5. If any files originating from NAUMEN or Contributors are modified, you must
+cause the modified files to carry prominent notices stating
+that you changed the files and the date of any change.
+
+Disclaimer:
+
+THIS SOFTWARE IS PROVIDED BY NAUMEN "AS IS" AND ANY EXPRESSED
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NAUMEN
+OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+This software consists of contributions made by NAUMEN
+and Contributors. Specific attributions are listed in the
+accompanying credits file.
+
diff --git a/meta/files/common-licenses/Nokia b/meta/files/common-licenses/Nokia
new file mode 100644
index 0000000..0037716
--- /dev/null
+++ b/meta/files/common-licenses/Nokia
@@ -0,0 +1,423 @@
+
+Nokia Open Source License (NOKOS
+License) Version 1.0a
+ 1. DEFINITIONS.
+
+"Affiliates" of a party shall mean an entity
+
+a) which is directly or indirectly controlling such party;
+
+b) which is under the same direct or indirect ownership or control
+as such party; or
+
+c) which is directly or indirectly owned or controlled by such party.
+
+For these purposes, an entity shall be treated as being controlled
+by another if that other entity has fifty percent (50%) or more of the
+votes in such entity, is able to direct its affairs and/or to control the
+composition of its board of directors or equivalent body.
+
+"Commercial Use" shall mean distribution or otherwise making
+the Covered Software available to a third party.
+
+``Contributor`` shall mean each entity that creates or contributes
+to the creation of Modifications.
+
+``Contributor Version`` shall mean in case of any Contributor
+the combination of the Original Software, prior Modifications used by a
+Contributor, and the Modifications made by that particular Contributor 
+and in case of Nokia in addition the Original Software in any form, including
+the form as Exceutable.
+
+``Covered Software`` shall mean the Original Software or Modifications
+or the combination of the Original Software and Modifications, in each
+case including portions thereof.
+
+``Electronic Distribution Mechanism`` shall mean a mechanism
+generally accepted in the software development community for the electronic
+transfer of data.
+
+``Executable`` shall mean Covered Software in any form other
+than Source Code.
+
+``Nokia`` shall mean Nokia Corporation and its Affiliates.
+
+``Larger Work`` shall mean a work, which combines Covered Software
+or portions thereof with code not governed by the terms of this License.
+
+``License`` shall mean this document.
+
+"Licensable" shall mean having the right to grant, to the maximum
+extent possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+``Modifications`` shall mean any addition to or deletion from
+the substance or structure of either the Original Software or any previous
+Modifications. When Covered Software is released as a series of files,
+a Modification is:
+
+a) Any addition to or deletion from the contents of a file containing
+Original Software or previous Modifications.
+
+b) Any new file that contains any part of the Original Software or
+previous Modifications.
+
+``Original Software`` shall mean the Source Code of computer
+software code which is described in the Source Code notice required by
+Exhibit A as Original Software, and which, at the time of its release under
+this License is not already Covered Software governed by this License.
+
+"Patent Claims" shall mean any patent claim(s), now owned
+or hereafter acquired, including without limitation, method, process, and
+apparatus claims, in any patent Licensable by grantor.
+
+``Source Code`` shall mean the preferred form of the Covered
+Software for making modifications to it, including all modules it contains,
+plus any associated interface definition files, scripts used to control
+compilation and installation of an Executable, or source code differential
+comparisons against either the Original Software or another well known,
+available Covered Software of the Contributor`s choice. The Source Code
+can be in a compressed or archival form, provided the appropriate decompression
+or de-archiving software is widely available for no charge.
+
+"You`` (or "Your") shall mean an individual or a legal
+entity exercising rights under, and complying with all of the terms of,
+this License or a future version of this License issued under Section 6.1.
+For legal entities, "You`` includes Affiliates of such entity.
+
+2. SOURCE CODE LICENSE.
+
+2.1 Nokia Grant.
+
+Subject to the terms of this License, Nokia hereby grants You a world-wide,
+royalty-free, non-exclusive license, subject to third party intellectual
+property claims:
+
+a) under copyrights Licensable by Nokia to use, reproduce, modify,
+display, perform, sublicense and distribute the Original Software (or portions
+thereof) with or without Modifications, and/or as part of a Larger Work;
+
+b) and under Patents Claims necessarily infringed by the making, using
+or selling of Original Software, to make, have made, use, practice, sell,
+and offer for sale, and/or otherwise dispose of the Original Software (or
+portions thereof).
+
+c) The licenses granted in this Section 2.1(a) and (b) are effective
+on the date Nokia first distributes Original Software under the terms of
+this License.
+
+d) Notwithstanding Section 2.1(b) above, no patent license is granted:
+1) for code that You delete from the Original Software; 2) separate from
+the Original Software; or 3) for infringements caused by: i) the modification
+of the Original Software or ii) the combination of the Original Software
+with other software or devices.
+
+2.2 Contributor Grant.
+
+Subject to the terms of this License and subject to third party intellectual
+property claims, each Contributor hereby grants You a world-wide, royalty-free,
+non-exclusive license
+
+a) under copyrights Licensable by Contributor, to use, reproduce, modify,
+display, perform, sublicense and distribute the Modifications created by
+such Contributor (or portions thereof) either on an unmodified basis, with
+other Modifications, as Covered Software and/or as part of a Larger Work;
+and
+
+b) under Patent Claims necessarily infringed by the making, using,
+or selling of Modifications made by that Contributor either alone and/or
+in combination with its Contributor Version (or portions of such combination),
+to make, use, sell, offer for sale, have made, and/or otherwise dispose
+of: 1) Modifications made by that Contributor (or portions thereof); and
+2) the combination of Modifications made by that Contributor with its Contributor
+Version (or portions of such combination).
+
+c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective
+on the date Contributor first makes Commercial Use of the Covered Software.
+
+d) Notwithstanding Section 2.2(b) above, no patent license is granted:
+1) for any code that Contributor has deleted from the Contributor Version;
+2) separate from the Contributor Version; 3) for infringements caused by:
+i) third party modifications of Contributor Version or ii) the combination
+of Modifications made by that Contributor with other software (except as
+part of the Contributor Version) or other devices; or 4) under Patent Claims
+infringed by Covered Software in the absence of Modifications made by that
+Contributor.
+
+3. DISTRIBUTION OBLIGATIONS.
+
+3.1 Application of License.
+
+
+The Modifications which You create or to which You contribute are governed
+by the terms of this License, including without limitation Section 2.2.
+The Source Code version of Covered Software may be distributed only under
+the terms of this License or a future version of this License released
+under Section 6.1, and You must include a copy of this License with every
+copy of the Source Code You distribute. You may not offer or impose any
+terms on any Source Code version that alters or restricts the applicable
+version of this License or the recipients` rights hereunder. However, You
+may include an additional document offering the additional rights described
+in Section 3.5.
+
+3.2 Availability of Source Code.
+
+Any Modification which You create or to which You contribute must be
+made available in Source Code form under the terms of this License either
+on the same media as an Executable version or via an accepted Electronic
+Distribution Mechanism to anyone to whom you made an Executable version
+available; and if made available via Electronic Distribution Mechanism,
+must remain available for at least twelve (12) months after the date it
+initially became available, or at least six (6) months after a subsequent
+version of that particular Modification has been made available to such
+recipients. You are responsible for ensuring that the Source Code version
+remains available even if the Electronic Distribution Mechanism is maintained
+by a third party.
+
+3.3 Description of Modifications.
+
+You must cause all Covered Software to which You contribute to contain
+a file documenting the changes You made to create that Covered Software
+and the date of any change. You must include a prominent statement that
+the Modification is derived, directly or indirectly, from Original Software
+provided by Nokia and including the name of Nokia in (a) the Source Code,
+and (b) in any notice in an Executable version or related documentation
+in which You describe the origin or ownership of the Covered Software.
+
+3.4  Intellectual Property Matters
+
+(a) Third Party Claims.
+
+If Contributor has knowledge that a license under a third party`s intellectual
+property rights is required to exercise the rights granted by such Contributor
+under Sections 2.1 or 2.2, Contributor must include a text file with the
+Source Code distribution titled "LEGAL`` which describes the claim and
+the party making the claim in sufficient detail that a recipient will know
+whom to contact. If Contributor obtains such knowledge after the Modification
+is made available as described in Section 3.2, Contributor shall promptly
+modify the LEGAL file in all copies Contributor makes available thereafter
+and shall take other steps (such as notifying appropriate mailing lists
+or newsgroups) reasonably calculated to inform those who received the Covered
+Software that new knowledge has been obtained.
+
+(b) Contributor APIs.
+
+If Contributor`s Modifications include an application programming interface
+and Contributor has knowledge of patent licenses which are reasonably necessary
+to implement that API, Contributor must also include this information in
+the LEGAL file.
+
+(c) Representations.
+
+Contributor represents that, except as disclosed pursuant to Section
+3.4(a) above, Contributor believes that Contributor`s Modifications are
+Contributor`s original creation(s) and/or Contributor has sufficient rights
+to grant the rights conveyed by this License.
+
+3.5 Required Notices.
+
+You must duplicate the notice in Exhibit A in each file of the Source
+Code. If it is not possible to put such notice in a particular Source Code
+file due to its structure, then You must include such notice in a location
+(such as a relevant directory) where a user would be likely to look for
+such a notice. If You created one or more Modification(s) You may add your
+name as a Contributor to the notice described in Exhibit A. You must also
+duplicate this License in any documentation for the Source Code where You
+describe recipients` rights or ownership rights relating to Covered Software.
+You may choose to offer, and to charge a fee for, warranty, support, indemnity
+or liability obligations to one or more recipients of Covered Software.
+However, You may do so only on Your own behalf, and not on behalf of Nokia
+or any Contributor. You must make it absolutely clear that any such warranty,
+support, indemnity or liability obligation is offered by You alone, and
+You hereby agree to indemnify Nokia and every Contributor for any liability
+incurred by Nokia or such Contributor as a result of warranty, support,
+indemnity or liability terms You offer.
+
+3.6 Distribution of Executable Versions.
+
+You may distribute Covered Software in Executable form only if the
+requirements of Section 3.1-3.5 have been met for that Covered Software,
+and if You include a notice stating that the Source Code version of the
+Covered Software is available under the terms of this License, including
+a description of how and where You have fulfilled the obligations of Section
+3.2. The notice must be conspicuously included in any notice in an Executable
+version, related documentation or collateral in which You describe recipients`
+rights relating to the Covered Software. You may distribute the Executable
+version of Covered Software or ownership rights under a license of Your
+choice, which may contain terms different from this License, provided that
+You are in compliance with the terms of this License and that the license
+for the Executable version does not attempt to limit or alter the recipient`s
+rights in the Source Code version from the rights set forth in this License.
+If You distribute the Executable version under a different license You
+must make it absolutely clear that any terms which differ from this License
+are offered by You alone, not by Nokia or any Contributor. You hereby agree
+to indemnify Nokia and every Contributor for any liability incurred by
+Nokia or such Contributor as a result of any such terms You offer.
+
+3.7 Larger Works.
+
+You may create a Larger Work by combining Covered Software with other
+software not governed by the terms of this License and distribute the Larger
+Work as a single product. In such a case, You must make sure the requirements
+of this License are fulfilled for the Covered Software.
+
+4. INABILITY TO COMPLY DUE TO STATUTE OR REGULATION.
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Software due to statute,
+judicial order, or regulation then You must: (a) comply with the terms
+of this License to the maximum extent possible; and (b) describe the limitations
+and the code they affect. Such description must be included in the LEGAL
+file described in Section 3.4 and must be included with all distributions
+of the Source Code.
+
+Except to the extent prohibited by statute or regulation, such description
+must be sufficiently detailed for a recipient of ordinary skill to be able
+to understand it.
+
+5. APPLICATION OF THIS LICENSE.
+
+This License applies to code to which Nokia has attached the notice
+in Exhibit A and to related Covered Software.
+
+6. VERSIONS OF THE LICENSE.
+
+
+6.1 New Versions.
+
+Nokia may publish revised and/or new versions of the License from time
+to time. Each version will be given a distinguishing version number.
+
+6.2 Effect of New Versions.
+
+Once Covered Software has been published under a particular version
+of the License, You may always continue to use it under the terms of that
+version. You may also choose to use such Covered Software under the terms
+of any subsequent version of the License published by Nokia. No one other
+than Nokia has the right to modify the terms applicable to Covered Software
+created under this License.
+
+7. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS`` BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
+LIMITATION, WARRANTIES THAT THE COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE,
+FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE
+QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY
+COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT NOKIA, ITS LICENSORS
+OR AFFILIATES OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
+SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF  WARRANTY CONSTITUTES
+AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED
+HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+8.1 This License and the rights granted hereunder will terminate automatically
+if You fail to comply with terms herein and fail to cure such breach within
+30 days of becoming aware of the breach. All sublicenses to the Covered
+Software which are properly granted shall survive any termination of this
+License. Provisions which, by their nature, must remain in effect beyond
+the termination of this License shall survive.
+
+8.2 If You initiate litigation by asserting a patent infringement claim
+(excluding declatory judgment actions) against Nokia or a Contributor (Nokia
+or Contributor against whom You file such action is referred to as "Participant")
+alleging that:
+
+a) such Participant`s Contributor Version directly or indirectly infringes
+any patent, then any and all rights granted by such Participant to You
+under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice
+from Participant terminate prospectively, unless if within 60 days after
+receipt of notice You either: (i) agree in writing to pay Participant a
+mutually agreeable reasonable royalty for Your past and future use of Modifications
+made by such Participant, or (ii) withdraw Your litigation claim with respect
+to the Contributor Version against such Participant. If within 60 days
+of notice, a reasonable royalty and payment arrangement are not mutually
+agreed upon in writing by the parties or the litigation claim is not withdrawn,
+the rights granted by Participant to You under Sections 2.1 and/or 2.2
+automatically terminate at the expiration of the 60 day notice period specified
+above.
+
+b) any software, hardware, or device, other than such Participant`s
+Contributor Version, directly or indirectly infringes any patent, then
+any rights granted to You by such Participant under Sections 2.1(b) and
+2.2(b) are revoked effective as of the date You first made, used, sold,
+distributed, or had made, Modifications made by that Participant.
+
+8.3 If You assert a patent infringement claim against Participant alleging
+that such Participant`s Contributor Version directly or indirectly infringes
+any patent where such claim is resolved (such as by license or settlement)
+prior to the initiation of patent infringement litigation, then the reasonable
+value of the licenses granted by such Participant under Sections 2.1 or
+2.2 shall be taken into account in determining the amount or value of any
+payment or license.
+
+8.4 In the event of termination under Sections 8.1 or 8.2 above, all
+end user license agreements (excluding distributors and resellers) which
+have been validly granted by You or any distributor hereunder prior to
+termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, NOKIA, ANY OTHER CONTRIBUTOR,
+OR ANY DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH
+PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
+DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION,
+OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL
+HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION
+OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS
+SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION
+OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, BUT MAY ALLOW LIABILITY TO BE LIMITED;
+IN SUCH CASES, A PARTY`s, ITS EMPLOYEES, LICENSORS OR AFFILIATES` LIABILITY
+SHALL BE LIMITED TO U.S. $50. Nothing contained in this License shall prejudice
+the statutory rights of any party dealing as a consumer.
+
+10. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject matter
+hereof. All rights in the Covered Software not expressly granted under
+this License are reserved. Nothing in this License shall grant You any
+rights to use any of the trademarks of Nokia or any of its Affiliates,
+even if any of such trademarks are included in any part of Covered Software
+and/or documentation to it.
+
+This License is governed by the laws of Finland excluding its conflict-of-law
+provisions. All disputes arising from or relating to this Agreement shall
+be settled by a single arbitrator appointed by the Central Chamber of Commerce
+of Finland. The arbitration procedure shall take place in Helsinki, Finland
+in the English language. If any part of this Agreement is found void and
+unenforceable, it will not affect the validity of the balance of the Agreement,
+which shall remain valid and enforceable according to its terms.
+
+11. RESPONSIBILITY FOR CLAIMS.
+
+As between Nokia and the Contributors, each party is responsible for
+claims and damages arising, directly or indirectly, out of its utilization
+of rights under this License and You agree to work with Nokia and Contributors
+to distribute such responsibility on an equitable basis. Nothing herein
+is intended or shall be deemed to constitute any admission of liability.
+
+ 
+
+EXHIBIT A
+
+The contents of this file are subject to the NOKOS License Version 1.0
+(the "License"); you may not use this file except in compliance with the
+License.
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF  ANY KIND, either express or implied. See
+the License for the specific language governing rights and limitations
+under the License.
+
+The Original Software is
+
+______________________________________.
+
+Copyright &#169; <year> Nokia and others. All Rights Reserved.
+
+Contributor(s): ______________________________________.
+
diff --git a/meta/files/common-licenses/OASIS b/meta/files/common-licenses/OASIS
new file mode 100644
index 0000000..f93df7a
--- /dev/null
+++ b/meta/files/common-licenses/OASIS
@@ -0,0 +1,13 @@
+  Permission to use, copy, modify and distribute the DocBook DTD and
+  its accompanying documentation for any purpose and without fee is
+  hereby granted in perpetuity, provided that the above copyright
+  notice and this paragraph appear in all copies.  The copyright
+  holders make no representation about the suitability of the DTD for
+  any purpose.  It is provided "as is" without expressed or implied
+  warranty.
+
+  If you modify the DocBook DTD in any way, except for declaring and
+  referencing additional sets of general entities and declaring
+  additional notations, label your DTD as a variant of DocBook.  See
+  the maintenance documentation for more information.
+
diff --git a/meta/files/common-licenses/OCLC-2.0 b/meta/files/common-licenses/OCLC-2.0
new file mode 100644
index 0000000..139e3f7
--- /dev/null
+++ b/meta/files/common-licenses/OCLC-2.0
@@ -0,0 +1,78 @@
+
+OCLC Research Public License 2.0
+Terms &amp; Conditions Of Use
+May, 2002
+Copyright &#169; 2002. OCLC Online Computer Library Center, Inc. All Rights Reserved
+
+PLEASE READ THIS DOCUMENT CAREFULLY. BY DOWNLOADING OR USING THE CODE BASE AND/OR DOCUMENTATION ACCOMPANYING THIS LICENSE (THE "License"), YOU AGREE TO THE FOLLOWING TERMS AND CONDITIONS OF THIS LICENSE.
+
+Section 1. Your Rights
+
+Subject to these terms and conditions of this License, the OCLC Office of Research (the "Original Contributor") and each subsequent contributor (collectively with the Original Contributor, the "Contributors") hereby grant you a non-exclusive, worldwide, no-charge, transferable license to execute, prepare derivative works of, and distribute (internally and externally), for commercial and noncommercial purposes, the original code contributed by Original Contributor and all Modifications (collectively called the "Program").
+
+Section 2. Definitions
+
+A "Modification" to the Program is any addition to or deletion from the contents of any file of the Program and any new file that contains any part of the Program. If you make a Modification and distribute the Program externally you are a "Contributor." The distribution of the Program must be under the terms of this license including those in Section 3 below.
+
+A "Combined Work" results from combining and integrating all or parts of the Program with other code. A Combined Work may be thought of as having multiple parents or being result of multiple lines of code development.
+
+Section 3. Distribution Licensing Terms
+
+A. General Requirements
+Except as necessary to recognize third-party rights or third-party restriction (see below), a distribution of the Program in any of the forms listed below must not put any further restrictions on the recipient&#8217;s exercise of the rights granted herein.
+
+As a Contributor, you represent that your Modification(s) are your original creation(s) and, to the best of your knowledge, no third party has any claim (including but not limited to intellectual property claims) relating to your Modification(s). You represent that each of your Modifications includes complete details of any third-party right or other third-party restriction associated with any part of your Modification (including a copy of any applicable license agreement).
+
+The Program must be distributed without charge beyond the costs of physically transferring the files to the recipient.
+
+This Warranty Disclaimer/Limitation of Liability must be prominently displayed with every distribution of the Program in any form:
+
+YOU AGREE THAT THE PROGRAM IS PROVIDED AS-IS, WITHOUT WARRANTY OF ANY KIND (EITHER EXPRESS OR IMPLIED). ACCORDINGLY, OCLC MAKES NO WARRANTIES, REPRESENTATIONS OR GUARANTEES, EITHER EXPRESS OR IMPLIED, AND DISCLAIMS ALL SUCH WARRANTIES, REPRESENTATIONS OR GUARANTEES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ANY PARTICULAR PURPOSE, AS TO: (A) THE FUNCTIONALITY OR NONINFRINGEMENT OF PROGRAM, ANY MODIFICATION, A COMBINED WORK OR AN AGGREGATE WORK; OR (B) THE RESULTS OF ANY PROJECT UNDERTAKEN USING THE PROGRAM, ANY MODIFICATION, A COMBINED WORK OR AN AGGREGATE WORK. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, CONSEQUENTIAL OR ANY OTHER DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE PROGRAM, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. YOU HEREBY WAIVE ANY CLAIMS FOR DAMAGES OF ANY KIND AGAINST CONTRIBUTORS WHICH MAY RESULT FROM YOUR USE OF THE PROGRAM.
+
+B. Requirements for a Distribution of Modifiable Code
+If you distribute the Program in a form to which the recipient can make Modifications (e.g. source code), the terms of this license apply to use by recipient. In addition, each source and data file of the Program and any Modification you distribute must contain the following notice:
+
+"Copyright (c) 2000- (insert then current year) OCLC Online Computer Library Center, Inc. and other contributors. All rights reserved. The contents of this file, as updated from time to time by the OCLC Office of Research, are subject to OCLC Research Public License Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a current copy of the License at http://purl.oclc.org/oclc/research/ORPL/. Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. This software consists of voluntary contributions made by many individuals on behalf of OCLC Research. For more information on OCLC Research, please see http://www.oclc.org/research/. The Original Code is ______________________________. The Initial Developer of the Original Code is ________________________. Portions created by ______________________ are Copyright (C) _____ _______________________. All Rights Reserved. Contributor(s): ______________________________________."
+
+C. Requirements for a Distribution of Non-modifiable Code
+If you distribute the Program in a form to which the recipient cannot make Modifications (e.g. object code), the terms of this license apply to use by recipient and you must include the following statement in appropriate and conspicuous locations:
+
+"Copyright (c) 2000- (insert then current year) OCLC Online Computer Library Center, Inc. and other contributors. All rights reserved."
+
+In addition, the source code must be included with the object code distribution or the distributor must provide the source code to the recipient upon request.
+
+D. Requirements for a Combined Work Distribution
+Distributions of Combined Works are subject to the terms of this license and must be made at no charge to the recipient beyond the costs of physically transferring the files to recipient.
+
+A Combined Work may be distributed as either modifiable or non-modifiable code. The requirements of Section 3.B or 3.C above (as appropriate) apply to such distributions.
+
+An "Aggregate Work" is when the Program exists, without integration, with other programs on a storage medium. This License does not apply to portions of an Aggregate Work which are not covered by the definition of "Program" provided in this License. You are not forbidden from selling an Aggregate Work. However, the Program contained in an Aggregate Work is subject to this License. Also, should the Program be extracted from an Aggregate Work, this License applies to any use of the Program apart from the Aggregate Work.
+
+Section 4. License Grant
+
+For purposes of permitting use of your Modifications by OCLC and other licensees hereunder, you hereby grant to OCLC and such other licensees the non-exclusive, worldwide, royalty-free, transferable, sublicenseable license to execute, copy, alter, delete, modify, adapt, change, revise, enhance, develop, publicly display, distribute (internally and externally) and/or create derivative works based on your Modifications (and derivative works thereof) in accordance with these Terms. This Section 4 shall survive termination of this License for any reason.
+
+Section 5. Termination of Rights
+
+This non-exclusive license (with respect to the grant from a particular Contributor) automatically terminates for any entity that initiates legal action for intellectual property infringement (with respect to the Program) against such Contributor as of the initiation of such action.
+
+If you fail to comply with this License, your rights (but not your obligations) under this License shall terminate automatically unless you cure such breach within thirty (30) days of becoming aware of the noncompliance. All sublicenses granted by you which preexist such termination and are properly granted shall survive such termination.
+
+Section 6. Other Terms
+
+Except for the copyright notices required above, you may not use any trademark of any of the Contributors without the prior written consent of the relevant Contributor. You agree not to remove, alter or obscure any copyright or other proprietary rights notice contained in the Program.
+
+All transfers of the Program or any part thereof shall be made in compliance with U.S. import/export regulations or other restrictions of the U.S. Department of Commerce, as well as other similar trade or commerce restrictions which might apply.
+
+Any patent obtained by any party covering the Program or any part thereof must include a provision providing for the free, perpetual and unrestricted commercial and noncommercial use by any third party.
+
+If, as a consequence of a court judgment or settlement relating to intellectual property infringement or any other cause of action, conditions are imposed on you that contradict the conditions of this License, such conditions do not excuse you from compliance with this License. If you cannot distribute the Program so as to simultaneously satisfy your obligations under this License and such other conditions, you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, you could not satisfy both the patent license and this License, and you would be required to refrain entirely from distribution of the Program.
+
+If you learn of a third party claim or other restriction relating to a Program you have already distributed you shall promptly redo your Program to address the issue and take all reasonable steps to inform those who may have received the Program at issue. An example of an appropriate reasonable step to inform would be posting an announcement on an appropriate web bulletin board.
+
+The provisions of this License are deemed to be severable, and the invalidity or unenforceability of any provision shall not affect or impair the remaining provisions which shall continue in full force and effect. In substitution for any provision held unlawful, there shall be substituted a provision of similar import reflecting the original intent of the parties hereto to the extent permissible under law.
+
+The Original Contributor from time to time may change this License, and the amended license will apply to all copies of the Program downloaded after the new license is posted. This License grants only the rights expressly stated herein and provides you with no implied rights or licenses to the intellectual property of any Contributor.
+
+This License is the complete and exclusive statement of the agreement between the parties concerning the subject matter hereof and may not be amended except by the written agreement of the parties. This License shall be governed by and construed in accordance with the laws of the State of Ohio and the United States of America, without regard to principles of conflicts of law.
+
diff --git a/meta/files/common-licenses/ODbL-1.0 b/meta/files/common-licenses/ODbL-1.0
new file mode 100644
index 0000000..c9f144e
--- /dev/null
+++ b/meta/files/common-licenses/ODbL-1.0
@@ -0,0 +1,543 @@
+
+## ODC Open Database License (ODbL)
+
+### Preamble
+
+The Open Database License (ODbL) is a license agreement intended to
+allow users to freely share, modify, and use this Database while
+maintaining this same freedom for others. Many databases are covered by
+copyright, and therefore this document licenses these rights. Some
+jurisdictions, mainly in the European Union, have specific rights that
+cover databases, and so the ODbL addresses these rights, too. Finally,
+the ODbL is also an agreement in contract for users of this Database to
+act in certain ways in return for accessing this Database.
+
+Databases can contain a wide variety of types of content (images,
+audiovisual material, and sounds all in the same database, for example),
+and so the ODbL only governs the rights over the Database, and not the
+contents of the Database individually. Licensors should use the ODbL
+together with another license for the contents, if the contents have a
+single set of rights that uniformly covers all of the contents. If the
+contents have multiple sets of different rights, Licensors should
+describe what rights govern what contents together in the individual
+record or in some other way that clarifies what rights apply. 
+
+Sometimes the contents of a database, or the database itself, can be
+covered by other rights not addressed here (such as private contracts,
+trade mark over the name, or privacy rights / data protection rights
+over information in the contents), and so you are advised that you may
+have to consult other documents or clear other rights before doing
+activities not covered by this License.
+
+------
+
+The Licensor (as defined below) 
+
+and 
+
+You (as defined below) 
+
+agree as follows: 
+
+### 1.0 Definitions of Capitalised Words
+
+"Collective Database" &#8211; Means this Database in unmodified form as part
+of a collection of independent databases in themselves that together are
+assembled into a collective whole. A work that constitutes a Collective
+Database will not be considered a Derivative Database.
+
+"Convey" &#8211; As a verb, means Using the Database, a Derivative Database,
+or the Database as part of a Collective Database in any way that enables
+a Person to make or receive copies of the Database or a Derivative
+Database.  Conveying does not include interaction with a user through a
+computer network, or creating and Using a Produced Work, where no
+transfer of a copy of the Database or a Derivative Database occurs.
+"Contents" &#8211; The contents of this Database, which includes the
+information, independent works, or other material collected into the
+Database. For example, the contents of the Database could be factual
+data or works such as images, audiovisual material, text, or sounds.
+
+"Database" &#8211; A collection of material (the Contents) arranged in a
+systematic or methodical way and individually accessible by electronic
+or other means offered under the terms of this License.
+
+"Database Directive" &#8211; Means Directive 96/9/EC of the European
+Parliament and of the Council of 11 March 1996 on the legal protection
+of databases, as amended or succeeded.
+
+"Database Right" &#8211; Means rights resulting from the Chapter III ("sui
+generis") rights in the Database Directive (as amended and as transposed
+by member states), which includes the Extraction and Re-utilisation of
+the whole or a Substantial part of the Contents, as well as any similar
+rights available in the relevant jurisdiction under Section 10.4. 
+
+"Derivative Database" &#8211; Means a database based upon the Database, and
+includes any translation, adaptation, arrangement, modification, or any
+other alteration of the Database or of a Substantial part of the
+Contents. This includes, but is not limited to, Extracting or
+Re-utilising the whole or a Substantial part of the Contents in a new
+Database.
+
+"Extraction" &#8211; Means the permanent or temporary transfer of all or a
+Substantial part of the Contents to another medium by any means or in
+any form.
+
+"License" &#8211; Means this license agreement and is both a license of rights
+such as copyright and Database Rights and an agreement in contract.
+
+"Licensor" &#8211; Means the Person that offers the Database under the terms
+of this License. 
+
+"Person" &#8211; Means a natural or legal person or a body of persons
+corporate or incorporate.
+
+"Produced Work" &#8211;  a work (such as an image, audiovisual material, text,
+or sounds) resulting from using the whole or a Substantial part of the
+Contents (via a search or other query) from this Database, a Derivative
+Database, or this Database as part of a Collective Database.  
+
+"Publicly" &#8211; means to Persons other than You or under Your control by
+either more than 50% ownership or by the power to direct their
+activities (such as contracting with an independent consultant). 
+
+"Re-utilisation" &#8211; means any form of making available to the public all
+or a Substantial part of the Contents by the distribution of copies, by
+renting, by online or other forms of transmission.
+
+"Substantial" &#8211; Means substantial in terms of quantity or quality or a
+combination of both. The repeated and systematic Extraction or
+Re-utilisation of insubstantial parts of the Contents may amount to the
+Extraction or Re-utilisation of a Substantial part of the Contents.
+
+"Use" &#8211; As a verb, means doing any act that is restricted by copyright
+or Database Rights whether in the original medium or any other; and
+includes without limitation distributing, copying, publicly performing,
+publicly displaying, and preparing derivative works of the Database, as
+well as modifying the Database as may be technically necessary to use it
+in a different mode or format. 
+
+"You" &#8211; Means a Person exercising rights under this License who has not
+previously violated the terms of this License with respect to the
+Database, or who has received express permission from the Licensor to
+exercise rights under this License despite a previous violation.
+
+Words in the singular include the plural and vice versa.
+
+### 2.0 What this License covers
+
+2.1. Legal effect of this document. This License is:
+
+  a. A license of applicable copyright and neighbouring rights;
+
+  b. A license of the Database Right; and
+
+  c. An agreement in contract between You and the Licensor.
+
+2.2 Legal rights covered. This License covers the legal rights in the
+Database, including:
+
+  a. Copyright. Any copyright or neighbouring rights in the Database.
+  The copyright licensed includes any individual elements of the
+  Database, but does not cover the copyright over the Contents
+  independent of this Database. See Section 2.4 for details. Copyright
+  law varies between jurisdictions, but is likely to cover: the Database
+  model or schema, which is the structure, arrangement, and organisation
+  of the Database, and can also include the Database tables and table
+  indexes; the data entry and output sheets; and the Field names of
+  Contents stored in the Database;
+
+  b. Database Rights. Database Rights only extend to the Extraction and
+  Re-utilisation of the whole or a Substantial part of the Contents.
+  Database Rights can apply even when there is no copyright over the
+  Database. Database Rights can also apply when the Contents are removed
+  from the Database and are selected and arranged in a way that would
+  not infringe any applicable copyright; and
+
+  c. Contract. This is an agreement between You and the Licensor for
+  access to the Database. In return you agree to certain conditions of
+  use on this access as outlined in this License. 
+
+2.3 Rights not covered. 
+
+  a. This License does not apply to computer programs used in the making
+  or operation of the Database; 
+
+  b. This License does not cover any patents over the Contents or the
+  Database; and
+
+  c. This License does not cover any trademarks associated with the
+  Database. 
+
+2.4 Relationship to Contents in the Database. The individual items of
+the Contents contained in this Database may be covered by other rights,
+including copyright, patent, data protection, privacy, or personality
+rights, and this License does not cover any rights (other than Database
+Rights or in contract) in individual Contents contained in the Database.
+For example, if used on a Database of images (the Contents), this
+License would not apply to copyright over individual images, which could
+have their own separate licenses, or one single license covering all of
+the rights over the images.  
+
+### 3.0 Rights granted
+
+3.1 Subject to the terms and conditions of this License, the Licensor
+grants to You a worldwide, royalty-free, non-exclusive, terminable (but
+only under Section 9) license to Use the Database for the duration of
+any applicable copyright and Database Rights. These rights explicitly
+include commercial use, and do not exclude any field of endeavour. To
+the extent possible in the relevant jurisdiction, these rights may be
+exercised in all media and formats whether now known or created in the
+future. 
+
+The rights granted cover, for example:
+
+  a. Extraction and Re-utilisation of the whole or a Substantial part of
+  the Contents;
+
+  b. Creation of Derivative Databases;
+
+  c. Creation of Collective Databases;
+
+  d. Creation of temporary or permanent reproductions by any means and
+  in any form, in whole or in part, including of any Derivative
+  Databases or as a part of Collective Databases; and
+
+  e. Distribution, communication, display, lending, making available, or
+  performance to the public by any means and in any form, in whole or in
+  part, including of any Derivative Database or as a part of Collective
+  Databases.
+
+3.2 Compulsory license schemes. For the avoidance of doubt:
+
+  a. Non-waivable compulsory license schemes. In those jurisdictions in
+  which the right to collect royalties through any statutory or
+  compulsory licensing scheme cannot be waived, the Licensor reserves
+  the exclusive right to collect such royalties for any exercise by You
+  of the rights granted under this License;
+
+  b. Waivable compulsory license schemes. In those jurisdictions in
+  which the right to collect royalties through any statutory or
+  compulsory licensing scheme can be waived, the Licensor waives the
+  exclusive right to collect such royalties for any exercise by You of
+  the rights granted under this License; and,
+
+  c. Voluntary license schemes. The Licensor waives the right to collect
+  royalties, whether individually or, in the event that the Licensor is
+  a member of a collecting society that administers voluntary licensing
+  schemes, via that society, from any exercise by You of the rights
+  granted under this License.
+
+3.3 The right to release the Database under different terms, or to stop
+distributing or making available the Database, is reserved. Note that
+this Database may be multiple-licensed, and so You may have the choice
+of using alternative licenses for this Database. Subject to Section
+10.4, all other rights not expressly granted by Licensor are reserved.
+
+### 4.0 Conditions of Use
+
+4.1 The rights granted in Section 3 above are expressly made subject to
+Your complying with the following conditions of use. These are important
+conditions of this License, and if You fail to follow them, You will be
+in material breach of its terms.
+
+4.2 Notices. If You Publicly Convey this Database, any Derivative
+Database, or the Database as part of a Collective Database, then You
+must: 
+
+  a. Do so only under the terms of this License or another license
+  permitted under Section 4.4;
+
+  b. Include a copy of this License (or, as applicable, a license
+  permitted under Section 4.4) or its Uniform Resource Identifier (URI)
+  with the Database or Derivative Database, including both in the
+  Database or Derivative Database and in any relevant documentation; and
+
+  c. Keep intact any copyright or Database Right notices and notices
+  that refer to this License.
+
+  d. If it is not possible to put the required notices in a particular
+  file due to its structure, then You must include the notices in a
+  location (such as a relevant directory) where users would be likely to
+  look for it.
+
+4.3 Notice for using output (Contents). Creating and Using a Produced
+Work does not require the notice in Section 4.2. However, if you
+Publicly Use a Produced Work, You must include a notice associated with
+the Produced Work reasonably calculated to make any Person that uses,
+views, accesses, interacts with, or is otherwise exposed to the Produced
+Work aware that Content was obtained from the Database, Derivative
+Database, or the Database as part of a Collective Database, and that it
+is available under this License.
+
+  a. Example notice. The following text will satisfy notice under
+  Section 4.3:
+
+        Contains information from DATABASE NAME, which is made available
+        here under the Open Database License (ODbL).
+
+DATABASE NAME should be replaced with the name of the Database and a
+hyperlink to the URI of the Database. "Open Database License" should
+contain a hyperlink to the URI of the text of this License. If
+hyperlinks are not possible, You should include the plain text of the
+required URI`s with the above notice.
+ 
+4.4 Share alike. 
+
+  a. Any Derivative Database that You Publicly Use must be only under
+  the terms of: 
+
+    i. This License;
+
+    ii. A later version of this License similar in spirit to this
+      License; or
+
+    iii. A compatible license. 
+
+  If You license the Derivative Database under one of the licenses
+  mentioned in (iii), You must comply with the terms of that license. 
+
+  b. For the avoidance of doubt, Extraction or Re-utilisation of the
+  whole or a Substantial part of the Contents into a new database is a
+  Derivative Database and must comply with Section 4.4. 
+
+  c. Derivative Databases and Produced Works.  A Derivative Database is
+  Publicly Used and so must comply with Section 4.4. if a Produced Work
+  created from the Derivative Database is Publicly Used.
+
+  d. Share Alike and additional Contents. For the avoidance of doubt,
+  You must not add Contents to Derivative Databases under Section 4.4 a
+  that are incompatible with the rights granted under this License. 
+
+  e. Compatible licenses. Licensors may authorise a proxy to determine
+  compatible licenses under Section 4.4 a iii. If they do so, the
+  authorised proxy`s public statement of acceptance of a compatible
+  license grants You permission to use the compatible license.
+
+
+4.5 Limits of Share Alike.  The requirements of Section 4.4 do not apply
+in the following:
+
+  a. For the avoidance of doubt, You are not required to license
+  Collective Databases under this License if You incorporate this
+  Database or a Derivative Database in the collection, but this License
+  still applies to this Database or a Derivative Database as a part of
+  the Collective Database; 
+
+  b. Using this Database, a Derivative Database, or this Database as
+  part of a Collective Database to create a Produced Work does not
+  create a Derivative Database for purposes of  Section 4.4; and
+
+  c. Use of a Derivative Database internally within an organisation is
+  not to the public and therefore does not fall under the requirements
+  of Section 4.4.
+
+4.6 Access to Derivative Databases. If You Publicly Use a Derivative
+Database or a Produced Work from a Derivative Database, You must also
+offer to recipients of the Derivative Database or Produced Work a copy
+in a machine readable form of:
+
+  a. The entire Derivative Database; or
+
+  b. A file containing all of the alterations made to the Database or
+  the method of making the alterations to the Database (such as an
+  algorithm), including any additional Contents, that make up all the
+  differences between the Database and the Derivative Database.
+
+The Derivative Database (under a.) or alteration file (under b.) must be
+available at no more than a reasonable production cost for physical
+distributions and free of charge if distributed over the internet.
+
+4.7 Technological measures and additional terms
+
+  a. This License does not allow You to impose (except subject to
+  Section 4.7 b.)  any terms or any technological measures on the
+  Database, a Derivative Database, or the whole or a Substantial part of
+  the Contents that alter or restrict the terms of this License, or any
+  rights granted under it, or have the effect or intent of restricting
+  the ability of any person to exercise those rights.
+
+  b. Parallel distribution. You may impose terms or technological
+  measures on the Database, a Derivative Database, or the whole or a
+  Substantial part of the Contents (a "Restricted Database") in
+  contravention of Section 4.74 a. only if You also make a copy of the
+  Database or a Derivative Database available to the recipient of the
+  Restricted Database:
+
+    i. That is available without additional fee;
+
+    ii. That is available in a medium that does not alter or restrict
+    the terms of this License, or any rights granted under it, or have
+    the effect or intent of restricting the ability of any person to
+    exercise those rights (an "Unrestricted Database"); and
+
+    iii. The Unrestricted Database is at least as accessible to the
+    recipient as a practical matter as the Restricted Database.
+
+  c. For the avoidance of doubt, You may place this Database or a
+  Derivative Database in an authenticated environment, behind a
+  password, or within a similar access control scheme provided that You
+  do not alter or restrict the terms of this License or any rights
+  granted under it or have the effect or intent of restricting the
+  ability of any person to exercise those rights. 
+
+4.8 Licensing of others. You may not sublicense the Database. Each time
+You communicate the Database, the whole or Substantial part of the
+Contents, or any Derivative Database to anyone else in any way, the
+Licensor offers to the recipient a license to the Database on the same
+terms and conditions as this License. You are not responsible for
+enforcing compliance by third parties with this License, but You may
+enforce any rights that You have over a Derivative Database. You are
+solely responsible for any modifications of a Derivative Database made
+by You or another Person at Your direction. You may not impose any
+further restrictions on the exercise of the rights granted or affirmed
+under this License.
+
+### 5.0 Moral rights
+
+5.1 Moral rights. This section covers moral rights, including any rights
+to be identified as the author of the Database or to object to treatment
+that would otherwise prejudice the author`s honour and reputation, or
+any other derogatory treatment:
+
+  a. For jurisdictions allowing waiver of moral rights, Licensor waives
+  all moral rights that Licensor may have in the Database to the fullest
+  extent possible by the law of the relevant jurisdiction under Section
+  10.4; 
+
+  b. If waiver of moral rights under Section 5.1 a in the relevant
+  jurisdiction is not possible, Licensor agrees not to assert any moral
+  rights over the Database and waives all claims in moral rights to the
+  fullest extent possible by the law of the relevant jurisdiction under
+  Section 10.4; and
+
+  c. For jurisdictions not allowing waiver or an agreement not to assert
+  moral rights under Section 5.1 a and b, the author may retain their
+  moral rights over certain aspects of the Database.
+
+Please note that some jurisdictions do not allow for the waiver of moral
+rights, and so moral rights may still subsist over the Database in some
+jurisdictions.
+
+### 6.0 Fair dealing, Database exceptions, and other rights not affected 
+
+6.1 This License does not affect any rights that You or anyone else may
+independently have under any applicable law to make any use of this
+Database, including without limitation:
+
+  a. Exceptions to the Database Right including: Extraction of Contents
+  from non-electronic Databases for private purposes, Extraction for
+  purposes of illustration for teaching or scientific research, and
+  Extraction or Re-utilisation for public security or an administrative
+  or judicial procedure. 
+
+  b. Fair dealing, fair use, or any other legally recognised limitation
+  or exception to infringement of copyright or other applicable laws. 
+
+6.2 This License does not affect any rights of lawful users to Extract
+and Re-utilise insubstantial parts of the Contents, evaluated
+quantitatively or qualitatively, for any purposes whatsoever, including
+creating a Derivative Database (subject to other rights over the
+Contents, see Section 2.4). The repeated and systematic Extraction or
+Re-utilisation of insubstantial parts of the Contents may however amount
+to the Extraction or Re-utilisation of a Substantial part of the
+Contents.
+
+### 7.0 Warranties and Disclaimer
+
+7.1 The Database is licensed by the Licensor "as is" and without any
+warranty of any kind, either express, implied, or arising by statute,
+custom, course of dealing, or trade usage. Licensor specifically
+disclaims any and all implied warranties or conditions of title,
+non-infringement, accuracy or completeness, the presence or absence of
+errors, fitness for a particular purpose, merchantability, or otherwise.
+Some jurisdictions do not allow the exclusion of implied warranties, so
+this exclusion may not apply to You.
+
+### 8.0 Limitation of liability
+
+8.1 Subject to any liability that may not be excluded or limited by law,
+the Licensor is not liable for, and expressly excludes, all liability
+for loss or damage however and whenever caused to anyone by any use
+under this License, whether by You or by anyone else, and whether caused
+by any fault on the part of the Licensor or not. This exclusion of
+liability includes, but is not limited to, any special, incidental,
+consequential, punitive, or exemplary damages such as loss of revenue,
+data, anticipated profits, and lost business. This exclusion applies
+even if the Licensor has been advised of the possibility of such
+damages.
+
+8.2 If liability may not be excluded by law, it is limited to actual and
+direct financial loss to the extent it is caused by proved negligence on
+the part of the Licensor.
+
+### 9.0 Termination of Your rights under this License
+
+9.1 Any breach by You of the terms and conditions of this License
+automatically terminates this License with immediate effect and without
+notice to You. For the avoidance of doubt, Persons who have received the
+Database, the whole or a Substantial part of the Contents, Derivative
+Databases, or the Database as part of a Collective Database from You
+under this License will not have their licenses terminated provided
+their use is in full compliance with this License or a license granted
+under Section 4.8 of this License.  Sections 1, 2, 7, 8, 9 and 10 will
+survive any termination of this License.
+
+9.2 If You are not in breach of the terms of this License, the Licensor
+will not terminate Your rights under it. 
+
+9.3 Unless terminated under Section 9.1, this License is granted to You
+for the duration of applicable rights in the Database. 
+
+9.4 Reinstatement of rights. If you cease any breach of the terms and
+conditions of this License, then your full rights under this License
+will be reinstated:
+
+  a. Provisionally and subject to permanent termination until the 60th
+  day after cessation of breach; 
+
+  b. Permanently on the 60th day after cessation of breach unless
+  otherwise reasonably notified by the Licensor; or
+
+  c.  Permanently if reasonably notified by the Licensor of the
+  violation, this is the first time You have received notice of
+  violation of this License from  the Licensor, and You cure the
+  violation prior to 30 days after your receipt of the notice.
+
+Persons subject to permanent termination of rights are not eligible to
+be a recipient and receive a license under Section 4.8.
+
+9.5 Notwithstanding the above, Licensor reserves the right to release
+the Database under different license terms or to stop distributing or
+making available the Database. Releasing the Database under different
+license terms or stopping the distribution of the Database will not
+withdraw this License (or any other license that has been, or is
+required to be, granted under the terms of this License), and this
+License will continue in full force and effect unless terminated as
+stated above.
+
+### 10.0 General
+
+10.1 If any provision of this License is held to be invalid or
+unenforceable, that must not affect the validity or enforceability of
+the remainder of the terms and conditions of this License and each
+remaining provision of this License shall be valid and enforced to the
+fullest extent permitted by law. 
+
+10.2 This License is the entire agreement between the parties with
+respect to the rights granted here over the Database. It replaces any
+earlier understandings, agreements or representations with respect to
+the Database. 
+
+10.3 If You are in breach of the terms of this License, You will not be
+entitled to rely on the terms of this License or to complain of any
+breach by the Licensor. 
+
+10.4 Choice of law. This License takes effect in and will be governed by
+the laws of the relevant jurisdiction in which the License terms are
+sought to be enforced. If the standard suite of rights granted under
+applicable copyright law and Database Rights in the relevant
+jurisdiction includes additional rights not granted under this License,
+these additional rights are granted in this License in order to meet the
+terms of this License.
+
+
diff --git a/meta/files/common-licenses/OFL-1.1 b/meta/files/common-licenses/OFL-1.1
new file mode 100644
index 0000000..e644bce
--- /dev/null
+++ b/meta/files/common-licenses/OFL-1.1
@@ -0,0 +1,88 @@
+
+SIL OPEN FONT LICENSE
+
+Version 1.1 - 26 February 2007
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded, 
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
+
diff --git a/meta/files/common-licenses/OGTSL b/meta/files/common-licenses/OGTSL
new file mode 100644
index 0000000..8a0cad7
--- /dev/null
+++ b/meta/files/common-licenses/OGTSL
@@ -0,0 +1,120 @@
+
+The Open Group Test Suite License
+
+Preamble
+
+The intent of this document is to state the conditions under which
+a Package may be copied, such that the Copyright Holder maintains
+some semblance of artistic control over the development of the
+package, while giving the users of the package the right to use and
+distribute the Package in a more-or-less customary fashion, plus
+the right to make reasonable modifications.
+
+Testing is essential for proper development and maintenance of
+standards-based products.
+
+For buyers: adequate conformance testing leads to reduced
+integration costs and protection of investments in applications,
+software and people.
+
+For software developers: conformance testing of platforms and
+middleware greatly reduces the cost of developing and maintaining
+multi-platform application software.
+
+For suppliers: In-depth testing increases customer satisfaction and
+keeps development and support costs in check. API conformance is
+highly measurable and suppliers who claim it must be able to
+substantiate that claim.
+
+As such, since these are benchmark measures of conformance, we feel
+the integrity of test tools is of importance. In order to preserve
+the integrity of the existing conformance modes of this test
+package and to permit recipients of modified versions of this
+package to run the original test modes, this license requires that
+the original test modes be preserved.
+
+If you find a bug in one of the standards mode test cases, please
+let us know so we can feed this back into the original, and also
+raise any specification issues with the appropriate bodies (for
+example the POSIX committees).
+
+Definitions: 
+
+     "Package" refers to the collection of files distributed by the
+     Copyright Holder, and derivatives of that collection of files
+     created through textual modification. 
+     "Standard Version" refers to such a Package if it has not been
+     modified, or has been modified in accordance with the wishes
+     of the Copyright Holder. 
+     "Copyright Holder" is whoever is named in the copyright or
+     copyrights for the package. "You" is you, if you`re thinking
+     about copying or distributing this Package. 
+     "Reasonable copying fee" is whatever you can justify on the
+     basis of media cost, duplication charges, time of people
+     involved, and so on. (You will not be required to justify it
+     to the Copyright Holder, but only to the computing community
+     at large as a market that must bear the fee.) 
+     "Freely Available" means that no fee is charged for the item
+     itself, though there may be fees involved in handling the
+     item. It also means that recipients of the item may
+     redistribute it under the same conditions they received it. 
+
+1. You may make and give away verbatim copies of the source form of
+the Standard Version of this Package without restriction, provided
+that you duplicate all of the original copyright notices and
+associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other
+modifications derived from the Public Domain or from the Copyright
+Holder. A Package modified in such a way shall still be considered
+the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way,
+provided that you insert a prominent notice in each changed file
+stating how and when you changed that file, and provided that you
+do at least the following:
+
+     rename any non-standard executables and testcases so the
+     names do not conflict with standard executables and
+     testcases, which must also be provided, and provide a
+     separate manual page for each non-standard executable and
+     testcase that clearly documents how it differs from the
+     Standard Version.
+
+4. You may distribute the programs of this Package in object code
+or executable form, provided that you do at least the following: 
+
+     accompany any non-standard executables and testcases with
+     their corresponding Standard Version executables and
+     testcases, giving the non-standard executables and
+     testcases non-standard names, and clearly documenting the
+     differences in manual pages (or equivalent), together with
+     instructions on where to get the Standard Version.
+
+5. You may charge a reasonable copying fee for any distribution of
+this Package. You may charge any fee you choose for support of this
+Package. You may not charge a fee for this Package itself. However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial)
+software distribution provided that you do not advertise this
+Package as a product of your own.
+
+6. The scripts and library files supplied as input to or produced
+as output from the programs of this Package do not automatically
+fall under the copyright of this Package, but belong to whomever
+generated them, and may be sold commercially, and may be aggregated
+with this Package.
+
+7.Subroutines supplied by you and linked into this Package shall
+not be considered part of this Package. 
+
+8. The name of the Copyright Holder may not be used to endorse or
+promote products derived from this software without specific prior
+written permission.
+
+9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
+
diff --git a/meta/files/common-licenses/OLDAP-2.8 b/meta/files/common-licenses/OLDAP-2.8
new file mode 100644
index 0000000..be253da
--- /dev/null
+++ b/meta/files/common-licenses/OLDAP-2.8
@@ -0,0 +1,49 @@
+
+The OpenLDAP Public License
+  Version 2.8, 17 August 2003
+
+Redistribution and use of this software and associated documentation
+("Software"), with or without modification, are permitted provided
+that the following conditions are met:
+
+1. Redistributions in source form must retain copyright statements
+   and notices,
+
+2. Redistributions in binary form must reproduce applicable copyright
+   statements and notices, this list of conditions, and the following
+   disclaimer in the documentation and/or other materials provided
+   with the distribution, and
+
+3. Redistributions must contain a verbatim copy of this document.
+
+The OpenLDAP Foundation may revise this license from time to time.
+Each revision is distinguished by a version number.  You may use
+this Software under terms of this license revision or under the
+terms of any subsequent revision of the license.
+
+THIS SOFTWARE IS PROVIDED BY THE OPENLDAP FOUNDATION AND ITS
+CONTRIBUTORS ``AS IS`` AND ANY EXPRESSED OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT
+SHALL THE OPENLDAP FOUNDATION, ITS CONTRIBUTORS, OR THE AUTHOR(S)
+OR OWNER(S) OF THE SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+The names of the authors and copyright holders must not be used in
+advertising or otherwise to promote the sale, use or other dealing
+in this Software without specific, written prior permission.  Title
+to copyright in this Software shall at all times remain with copyright
+holders.
+
+OpenLDAP is a registered trademark of the OpenLDAP Foundation.
+
+Copyright 1999-2003 The OpenLDAP Foundation, Redwood City,
+California, USA.  All Rights Reserved.  Permission to copy and
+distribute verbatim copies of this document is granted.
+
diff --git a/meta/files/common-licenses/OSL-1.0 b/meta/files/common-licenses/OSL-1.0
new file mode 100644
index 0000000..85ad0da
--- /dev/null
+++ b/meta/files/common-licenses/OSL-1.0
@@ -0,0 +1,164 @@
+
+The Open Software License
+v. 1.0
+
+This Open Software License (the "License") applies to any original
+work of authorship (the "Original Work") whose owner (the "Licensor")
+has placed the following notice immediately following the copyright
+notice for the Original Work: "Licensed under the Open Software
+License version 1.0"
+
+License Terms
+
+1) Grant of Copyright License. Licensor hereby grants You a
+world-wide, royalty-free, non-exclusive, perpetual, non-sublicenseable
+license to do the following:
+
+a) to reproduce the Original Work in copies;
+
+b) to prepare derivative works ("Derivative Works") based upon the
+Original Work;
+
+c) to distribute copies of the Original Work and Derivative Works
+to the public, with the proviso that copies of Original Work or
+Derivative Works that You distribute shall be licensed under the
+Open Software License;
+
+d) to perform the Original Work publicly; and
+
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide,
+royalty-free, non-exclusive, perpetual, non-sublicenseable license,
+under patent claims owned or controlled by the Licensor that are
+embodied in the Original Work as furnished by the Licensor ("Licensed
+Claims") to make, use, sell and offer for sale the Original Work.
+Licensor hereby grants You a world-wide, royalty-free, non-exclusive,
+perpetual, non-sublicenseable license under the Licensed Claims to
+make, use, sell and offer for sale Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the
+preferred form of the Original Work for making modifications to it and
+all available documentation describing how to access and modify the
+Original Work. Licensor hereby agrees to provide a machine-readable
+copy of the Source Code of the Original Work along with each copy of
+the Original Work that Licensor distributes. Licensor reserves the
+right to satisfy this obligation by placing a machine-readable copy of
+the Source Code in an information repository reasonably calculated to
+permit inexpensive and convenient access by You for as long as
+Licensor continues to distribute the Original Work, and by publishing
+the address of that information repository in a notice immediately
+following the copyright notice that applies to the Original Work.
+
+4) Exclusions From License Grant. Nothing in this License shall be
+deemed to grant any rights to trademarks, copyrights, patents, trade
+secrets or any other intellectual property of Licensor except as
+expressly stated herein. No patent license is granted to make, use,
+sell or offer to sell embodiments of any patent claims other than the
+Licensed Claims defined in Section 2. No right is granted to the
+trademarks of Licensor even if such marks are included in the Original
+Work. Nothing in this License shall be interpreted to prohibit
+Licensor from licensing under different terms from this License any
+Original Work that Licensor otherwise would have a right to license.
+
+5) External Deployment. The term "External Deployment" means the use
+or distribution of the Original Work or Derivative Works in any way
+such that the Original Work or Derivative Works may be accessed or
+used by anyone other than You, whether the Original Work or Derivative
+Works are distributed to those persons, made available as an
+application intended for use over a computer network, or used to
+provide services or otherwise deliver content to anyone other than
+You. As an express condition for the grants of license hereunder, You
+agree that any External Deployment by You shall be deemed a
+distribution and shall be licensed to all under the terms of this
+License, as prescribed in section 1(c) herein.
+
+6) Warranty and Disclaimer of Warranty. LICENSOR WARRANTS THAT THE
+COPYRIGHT IN AND TO THE ORIGINAL WORK IS OWNED BY THE LICENSOR OR THAT
+THE ORIGINAL WORK IS DISTRIBUTED BY LICENSOR UNDER A VALID CURRENT
+LICENSE FROM THE COPYRIGHT OWNER. EXCEPT AS EXPRESSLY STATED IN THE
+IMMEDIATELY PRECEEDING SENTENCE, THE ORIGINAL WORK IS PROVIDED UNDER
+THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY, EITHER EXPRESS OR
+IMPLIED, INCLUDING, WITHOUT LIMITATION, THE WARRANTY OF
+NON-INFRINGEMENT AND WARRANTIES THAT THE ORIGINAL WORK IS MERCHANTABLE
+OR FIT FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF
+THE ORIGINAL WORK IS WITH YOU. THIS DISCLAIMER OF WARRANTY CONSTITUTES
+AN ESSENTIAL PART OF THIS LICENSE. NO LICENSE TO ORIGINAL WORK IS
+GRANTED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+7) Limitation of Liability. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
+THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE,
+SHALL THE LICENSOR BE LIABLE TO ANY PERSON FOR ANY DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING
+AS A RESULT OF THIS LICENSE OR THE USE OF THE ORIGINAL WORK INCLUDING,
+WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE,
+COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL
+DAMAGES OR LOSSES, EVEN IF SUCH PERSON SHALL HAVE BEEN INFORMED OF THE
+POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT
+APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH
+PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
+LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR
+LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION
+AND LIMITATION MAY NOT APPLY TO YOU.
+
+8) Acceptance and Termination. Nothing else but this License (or
+another written agreement between Licensor and You) grants You
+permission to create Derivative Works based upon the Original Work,
+and any attempt to do so except under the terms of this License (or
+another written agreement between Licensor and You) is expressly
+prohibited by U.S. copyright law, the equivalent laws of other
+countries, and by international treaty. Therefore, by exercising any
+of the rights granted to You in Sections 1 and 2 herein, You indicate
+Your acceptance of this License and all of its terms and conditions.
+This license shall terminate immediately and you may no longer
+exercise any of the rights granted to You by this License upon Your
+failure to honor the proviso in Section 1(c) herein.
+
+9) Mutual Termination for Patent Action. This License shall terminate
+automatically and You may no longer exercise any of the rights granted
+to You by this License if You file a lawsuit in any court alleging
+that any OSI Certified open source software that is licensed under any
+license containing this "Mutual Termination for Patent Action" clause
+infringes any patent claims that are essential to use that software.
+
+10) Jurisdiction, Venue and Governing Law. You agree that any lawsuit
+arising under or relating to this License shall be maintained in the
+courts of the jurisdiction wherein the Licensor resides or in which
+Licensor conducts its primary business, and under the laws of that
+jurisdiction excluding its conflict-of-law provisions. The application
+of the United Nations Convention on Contracts for the International
+Sale of Goods is expressly excluded. Any use of the Original Work
+outside the scope of this License or after its termination shall be
+subject to the requirements and penalties of the U.S. Copyright Act,
+17 U.S.C. &#167; 101 et seq., the equivalent laws of other countries, and
+international treaty. This section shall survive the termination of
+this License.
+
+11) Attorneys Fees. In any action to enforce the terms of this License
+or seeking damages relating thereto, the prevailing party shall be
+entitled to recover its costs and expenses, including, without
+limitation, reasonable attorneys` fees and costs incurred in
+connection with such action, including any appeal of such action. This
+section shall survive the termination of this License.
+
+12) Miscellaneous. This License represents the complete agreement
+concerning the subject matter hereof. If any provision of this License
+is held to be unenforceable, such provision shall be reformed only to
+the extent necessary to make it enforceable.
+
+13) Definition of "You" in This License. "You" throughout this
+License, whether in upper or lower case, means an individual or a
+legal entity exercising rights under, and complying with all of the
+terms of, this License. For legal entities, "You" includes any entity
+that controls, is controlled by, or is under common control with you.
+For purposes of this definition, "control" means (i) the power, direct
+or indirect, to cause the direction or management of such entity,
+whether by contract or otherwise, or (ii) ownership of fifty percent
+(50%) or more of the outstanding shares, or (iii) beneficial ownership
+of such entity.
+
+This license is Copyright (C) 2002 Lawrence E. Rosen. All rights
+reserved. Permission is hereby granted to copy and distribute this
+license without modification. This license may not be modified without
+the express written permission of its copyright owner.
+
diff --git a/meta/files/common-licenses/OSL-2.0 b/meta/files/common-licenses/OSL-2.0
new file mode 100644
index 0000000..9fe5c9e
--- /dev/null
+++ b/meta/files/common-licenses/OSL-2.0
@@ -0,0 +1,48 @@
+
+Open Software License
+v. 2.0
+
+This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work:
+
+Licensed under the Open Software License version 2.0
+1) Grant of Copyright License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license to do the following:
+
+a) to reproduce the Original Work in copies;
+b) to prepare derivative works ("Derivative Works") based upon the Original Work;
+
+c) to distribute copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute shall be licensed under the Open Software License;
+
+d) to perform the Original Work publicly; and
+
+e) to display the Original Work publicly.
+
+2) Grant of Patent License. Licensor hereby grants You a world-wide, royalty-free, non-exclusive, perpetual, sublicenseable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, to make, use, sell and offer for sale the Original Work and Derivative Works.
+
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor hereby agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work, and by publishing the address of that information repository in a notice immediately following the copyright notice that applies to the Original Work.
+
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior written permission of the Licensor. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor except as expressly stated herein. No patent license is granted to make, use, sell or offer to sell embodiments of any patent claims other than the licensed claims defined in Section 2. No right is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any Original Work that Licensor otherwise would have a right to license.
+
+5) External Deployment. The term "External Deployment" means the use or distribution of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether the Original Work or Derivative Works are distributed to those persons or made available as an application intended for use over a computer network. As an express condition for the grants of license hereunder, You agree that any External Deployment by You of a Derivative Work shall be deemed a distribution and shall be licensed to all under the terms of this License, as prescribed in section 1(c) herein.
+
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately proceeding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to Original Work is granted hereunder except under this disclaimer.
+
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to any person for any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to liability for death or personal injury resulting from Licensor`s negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
+
+9) Acceptance and Termination. If You distribute copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. Nothing else but this License (or another written agreement between Licensor and You) grants You permission to create Derivative Works based upon the Original Work or to exercise any of the rights granted in Section 1 herein, and any attempt to do so except under the terms of this License (or another written agreement between Licensor and You) is expressly prohibited by U.S. copyright law, the equivalent laws of other countries, and by international treaty. Therefore, by exercising any of the rights granted to You in Section 1 herein, You indicate Your acceptance of this License and all of its terms and conditions. This License shall terminate immediately and you may no longer exercise any of the rights granted to You by this License upon Your failure to honor the proviso in Section 1(c) herein.
+
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, for patent infringement (i) against Licensor with respect to a patent applicable to software or (ii) against any entity with respect to a patent applicable to the Original Work (but excluding combinations of the Original Work with other software or hardware).
+
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of the U.S. Copyright Act, 17 U.S.C. 101 et seq., the equivalent laws of other countries, and international treaty. This section shall survive the termination of this License.
+
+12) Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+
+13) Miscellaneous. This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+
+This license is Copyright (C) 2003 Lawrence E. Rosen. All rights reserved. Permission is hereby granted to copy and distribute this license without modification. This license may not be modified without the express written permission of its copyright owner.
+
diff --git a/meta/files/common-licenses/OSL-3.0 b/meta/files/common-licenses/OSL-3.0
new file mode 100644
index 0000000..1557749
--- /dev/null
+++ b/meta/files/common-licenses/OSL-3.0
@@ -0,0 +1,27 @@
+
+Open Software License (&#8220;OSL&#8221;) v. 3.0
+This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:
+Licensed under the Open Software License version 3.0
+
+1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:
+a) to reproduce the Original Work in copies, either alone or as part of a collective work;
+b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
+c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License;
+d) to perform the Original Work publicly; and
+e) to display the Original Work publicly.
+2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.
+3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.
+4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor&#8217;s trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.
+5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).
+6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.
+7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.
+8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.
+9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including &#8220;fair use&#8221; or &#8220;fair dealing&#8221;). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).
+10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.
+11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.
+12) Attorneys&#8217; Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys` fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.
+13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.
+14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.
+16) Modification of This License. This License is Copyright &#169; 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.
+
diff --git a/meta/files/common-licenses/OpenSSL b/meta/files/common-licenses/OpenSSL
new file mode 100644
index 0000000..d4270a3
--- /dev/null
+++ b/meta/files/common-licenses/OpenSSL
@@ -0,0 +1,107 @@
+
+OpenSSL License
+
+ ====================================================================
+  Copyright (c) 1998-2008 The OpenSSL Project.  All rights reserved.
+ 
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+ 
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+ 
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+ 
+  3. All advertising materials mentioning features or use of this
+     software must display the following acknowledgment:
+     "This product includes software developed by the OpenSSL Project
+     for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
+ 
+  4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
+     endorse or promote products derived from this software without
+     prior written permission. For written permission, please contact
+     openssl-core@openssl.org.
+ 
+  5. Products derived from this software may not be called "OpenSSL"
+     nor may "OpenSSL" appear in their names without prior written
+     permission of the OpenSSL Project.
+ 
+  6. Redistributions of any form whatsoever must retain the following
+     acknowledgment:
+     "This product includes software developed by the OpenSSL Project
+     for use in the OpenSSL Toolkit (http://www.openssl.org/)"
+ 
+  THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS`` AND ANY
+  EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
+  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+  OF THE POSSIBILITY OF SUCH DAMAGE.
+  ====================================================================
+ 
+  This product includes cryptographic software written by Eric Young
+  (eay@cryptsoft.com).  This product includes software written by Tim
+  Hudson (tjh@cryptsoft.com).
+ 
+
+ Original SSLeay License
+ -----------------------
+
+Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
+All rights reserved.
+ 
+  This package is an SSL implementation written
+  by Eric Young (eay@cryptsoft.com).
+  The implementation was written so as to conform with Netscapes SSL.
+ 
+  This library is free for commercial and non-commercial use as long as
+  the following conditions are aheared to.  The following conditions
+  apply to all code found in this distribution, be it the RC4, RSA,
+  lhash, DES, etc., code; not just the SSL code.  The SSL documentation
+  included with this distribution is covered by the same copyright terms
+  except that the holder is Tim Hudson (tjh@cryptsoft.com).
+ 
+  Copyright remains Eric Young`s, and as such any Copyright notices in
+  the code are not to be removed.
+  If this package is used in a product, Eric Young should be given attribution
+  as the author of the parts of the library used.
+  This can be in the form of a textual message at program startup or
+  in documentation (online or textual) provided with the package.
+ 
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions
+  are met:
+  1. Redistributions of source code must retain the copyright
+     notice, this list of conditions and the following disclaimer.
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in the
+     documentation and/or other materials provided with the distribution.
+  3. All advertising materials mentioning features or use of this software
+     must display the following acknowledgement:
+     "This product includes cryptographic software written by
+      Eric Young (eay@cryptsoft.com)"
+     The word `cryptographic` can be left out if the rouines from the library
+     being used are not cryptographic related :-).
+  4. If you include any Windows specific code (or a derivative thereof) from
+     the apps directory (application code) you must include an acknowledgement:
+     "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
+ 
+  THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS`` AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+  The licence and distribution terms for any publically available version or derivative of this code cannot be changed.  i.e. this code cannot simply be copied and put under another distribution licence
+  [including the GNU Public Licence.]
+ 
+
+
+
diff --git a/meta/files/common-licenses/PD b/meta/files/common-licenses/PD
new file mode 100644
index 0000000..21fb878
--- /dev/null
+++ b/meta/files/common-licenses/PD
@@ -0,0 +1 @@
+This is a placeholder for the Public Domain License
diff --git a/meta/files/common-licenses/PHP-3.0 b/meta/files/common-licenses/PHP-3.0
new file mode 100644
index 0000000..ef0b203
--- /dev/null
+++ b/meta/files/common-licenses/PHP-3.0
@@ -0,0 +1,70 @@
+
+-------------------------------------------------------------------- 
+                  The PHP License, version 3.01
+Copyright (c) 1999 - 2010 The PHP Group. All rights reserved.
+-------------------------------------------------------------------- 
+
+Redistribution and use in source and binary forms, with or without
+modification, is permitted provided that the following conditions
+are met:
+
+  1. Redistributions of source code must retain the above copyright
+     notice, this list of conditions and the following disclaimer.
+ 
+  2. Redistributions in binary form must reproduce the above copyright
+     notice, this list of conditions and the following disclaimer in
+     the documentation and/or other materials provided with the
+     distribution.
+ 
+  3. The name "PHP" must not be used to endorse or promote products
+     derived from this software without prior written permission. For
+     written permission, please contact group@php.net.
+  
+  4. Products derived from this software may not be called "PHP", nor
+     may "PHP" appear in their name, without prior written permission
+     from group@php.net.  You may indicate that your software works in
+     conjunction with PHP by saying "Foo for PHP" instead of calling
+     it "PHP Foo" or "phpfoo"
+ 
+  5. The PHP Group may publish revised and/or new versions of the
+     license from time to time. Each version will be given a
+     distinguishing version number.
+     Once covered code has been published under a particular version
+     of the license, you may always continue to use it under the terms
+     of that version. You may also choose to use such covered code
+     under the terms of any subsequent version of the license
+     published by the PHP Group. No one other than the PHP Group has
+     the right to modify the terms applicable to covered code created
+     under this License.
+
+  6. Redistributions of any form whatsoever must retain the following
+     acknowledgment:
+     "This product includes PHP software, freely available from
+     <http://www.php.net/software/>".
+
+THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS`` AND 
+ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
+PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE PHP
+DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+-------------------------------------------------------------------- 
+
+This software consists of voluntary contributions made by many
+individuals on behalf of the PHP Group.
+
+The PHP Group can be contacted via Email at group@php.net.
+
+For more information on the PHP Group and the PHP project, 
+please see <http://www.php.net>.
+
+PHP includes the Zend Engine, freely available at
+<http://www.zend.com>.
+
diff --git a/meta/files/common-licenses/PostgreSQL b/meta/files/common-licenses/PostgreSQL
new file mode 100644
index 0000000..ae658dc
--- /dev/null
+++ b/meta/files/common-licenses/PostgreSQL
@@ -0,0 +1,14 @@
+
+PostgreSQL Database Management System
+(formerly known as Postgres, then as Postgres95)
+
+Portions Copyright (c) 1996-2010, The PostgreSQL Global Development Group
+
+Portions Copyright (c) 1994, The Regents of the University of California
+
+Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
diff --git a/meta/files/common-licenses/Proprietary b/meta/files/common-licenses/Proprietary
new file mode 100644
index 0000000..6618758
--- /dev/null
+++ b/meta/files/common-licenses/Proprietary
@@ -0,0 +1 @@
+Proprietary license.
diff --git a/meta/files/common-licenses/Python-2.0 b/meta/files/common-licenses/Python-2.0
new file mode 100644
index 0000000..9d3e862
--- /dev/null
+++ b/meta/files/common-licenses/Python-2.0
@@ -0,0 +1,192 @@
+
+PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+--------------------------------------------
+
+1. This LICENSE AGREEMENT is between the Python Software Foundation
+("PSF"), and the Individual or Organization ("Licensee") accessing and
+otherwise using this software ("Python") in source or binary form and
+its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, PSF
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python
+alone or in any derivative version, provided, however, that PSF`s
+License Agreement and PSF`s notice of copyright, i.e., "Copyright (c)
+2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation; All Rights
+Reserved" are retained in Python alone or in any derivative version
+prepared by Licensee.
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python.
+
+4. PSF is making Python available to Licensee on an "AS IS"
+basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between PSF and
+Licensee. This License Agreement does not grant permission to use PSF
+trademarks or trade name in a trademark sense to endorse or promote
+products or services of Licensee, or any third party.
+
+8. By copying, installing or otherwise using Python, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
+-------------------------------------------
+
+BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
+
+1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
+office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
+Individual or Organization ("Licensee") accessing and otherwise using
+this software in source or binary form and its associated
+documentation ("the Software").
+
+2. Subject to the terms and conditions of this BeOpen Python License
+Agreement, BeOpen hereby grants Licensee a non-exclusive,
+royalty-free, world-wide license to reproduce, analyze, test, perform
+and/or display publicly, prepare derivative works, distribute, and
+otherwise use the Software alone or in any derivative version,
+provided, however, that the BeOpen Python License is retained in the
+Software, alone or in any derivative version prepared by Licensee.
+
+3. BeOpen is making the Software available to Licensee on an "AS IS"
+basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
+SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
+AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
+DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+5. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+6. This License Agreement shall be governed by and interpreted in all
+respects by the law of the State of California, excluding conflict of
+law provisions. Nothing in this License Agreement shall be deemed to
+create any relationship of agency, partnership, or joint venture
+between BeOpen and Licensee. This License Agreement does not grant
+permission to use BeOpen trademarks or trade names in a trademark
+sense to endorse or promote products or services of Licensee, or any
+third party. As an exception, the "BeOpen Python" logos available at
+http://www.pythonlabs.com/logos.html may be used according to the
+permissions granted on that web page.
+
+7. By copying, installing or otherwise using the software, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
+---------------------------------------
+
+1. This LICENSE AGREEMENT is between the Corporation for National
+Research Initiatives, having an office at 1895 Preston White Drive,
+Reston, VA 20191 ("CNRI"), and the Individual or Organization
+("Licensee") accessing and otherwise using Python 1.6.1 software in
+source or binary form and its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, CNRI
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python 1.6.1
+alone or in any derivative version, provided, however, that CNRI`s
+License Agreement and CNRI`s notice of copyright, i.e., "Copyright (c)
+1995-2001 Corporation for National Research Initiatives; All Rights
+Reserved" are retained in Python 1.6.1 alone or in any derivative
+version prepared by Licensee. Alternately, in lieu of CNRI`s License
+Agreement, Licensee may substitute the following text (omitting the
+quotes): "Python 1.6.1 is made available subject to the terms and
+conditions in CNRI`s License Agreement. This Agreement together with
+Python 1.6.1 may be located on the Internet using the following
+unique, persistent identifier (known as a handle): 1895.22/1013. This
+Agreement may also be obtained from a proxy server on the Internet
+using the following URL: http://hdl.handle.net/1895.22/1013".
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python 1.6.1 or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python 1.6.1.
+
+4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
+basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. This License Agreement shall be governed by the federal
+intellectual property law of the United States, including without
+limitation the federal copyright law, and, to the extent such
+U.S. federal law does not apply, by the law of the Commonwealth of
+Virginia, excluding Virginia`s conflict of law provisions.
+Notwithstanding the foregoing, with regard to derivative works based
+on Python 1.6.1 that incorporate non-separable material that was
+previously distributed under the GNU General Public License (GPL), the
+law of the Commonwealth of Virginia shall govern this License
+Agreement only as to issues arising under or with respect to
+Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
+License Agreement shall be deemed to create any relationship of
+agency, partnership, or joint venture between CNRI and Licensee. This
+License Agreement does not grant permission to use CNRI trademarks or
+trade name in a trademark sense to endorse or promote products or
+services of Licensee, or any third party.
+
+8. By clicking on the "ACCEPT" button where indicated, or by copying,
+installing or otherwise using Python 1.6.1, Licensee agrees to be
+bound by the terms and conditions of this License Agreement.
+
+ACCEPT
+
+CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
+--------------------------------------------------
+
+Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
+The Netherlands. All rights reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Stichting Mathematisch
+Centrum or CWI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
diff --git a/meta/files/common-licenses/QPL-1.0 b/meta/files/common-licenses/QPL-1.0
new file mode 100644
index 0000000..7d433ab
--- /dev/null
+++ b/meta/files/common-licenses/QPL-1.0
@@ -0,0 +1,48 @@
+
+THE Q PUBLIC LICENSE version 1.0
+
+Copyright (C) 1999-2005 Trolltech AS, Norway.
+Everyone is permitted to copy and distribute this license document.
+The intent of this license is to establish freedom to share and change the software regulated by this license under the open source model.
+
+This license applies to any software containing a notice placed by the copyright holder saying that it may be distributed under the terms of the Q Public License version 1.0. Such software is herein referred to as the Software. This license covers modification and distribution of the Software, use of third-party application programs based on the Software, and development of free software which uses the Software.
+
+Granted Rights
+
+1. You are granted the non-exclusive rights set forth in this license provided you agree to and comply with any and all conditions in this license. Whole or partial distribution of the Software, or software items that link with the Software, in any form signifies acceptance of this license.
+
+2. You may copy and distribute the Software in unmodified form provided that the entire package, including - but not restricted to - copyright, trademark notices and disclaimers, as released by the initial developer of the Software, is distributed.
+
+3. You may make modifications to the Software and distribute your modifications, in a form that is separate from the Software, such as patches. The following restrictions apply to modifications:
+
+a. Modifications must not alter or remove any copyright notices in the Software.
+b. When modifications to the Software are released under this license, a non-exclusive royalty-free right is granted to the initial developer of the Software to distribute your modification in future versions of the Software provided such versions remain available under these terms in addition to any other license(s) of the initial developer.
+
+4. You may distribute machine-executable forms of the Software or machine-executable forms of modified versions of the Software, provided that you meet these restrictions:
+
+a. You must include this license document in the distribution.
+b. You must ensure that all recipients of the machine-executable forms are also able to receive the complete machine-readable source code to the distributed Software, including all modifications, without any charge beyond the costs of data transfer, and place prominent notices in the distribution explaining this.
+
+c. You must ensure that all modifications included in the machine-executable forms are available under the terms of this license.
+
+5. You may use the original or modified versions of the Software to compile, link and run application programs legally developed by you or by others.
+
+6. You may develop application programs, reusable components and other software items that link with the original or modified versions of the Software. These items, when distributed, are subject to the following requirements:
+
+a. You must ensure that all recipients of machine-executable forms of these items are also able to receive and use the complete machine-readable source code to the items without any charge beyond the costs of data transfer.
+b. You must explicitly license all recipients of your items to use and re-distribute original and modified versions of the items in both machine-executable and source code forms. The recipients must be able to do so without any charges whatsoever, and they must be able to re-distribute to anyone they choose.
+
+c. If the items are not available to the general public, and the initial developer of the Software requests a copy of the items, then you must supply one.
+
+Limitations of Liability
+
+In no event shall the initial developers or copyright holders be liable for any damages whatsoever, including - but not restricted to - lost revenue or profits or other direct, indirect, special, incidental or consequential damages, even if they have been advised of the possibility of such damages, except to the extent invariable law, if any, provides otherwise.
+
+No Warranty
+
+The Software and this license document are provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+Choice of Law
+
+This license is governed by the Laws of Norway. Disputes shall be settled by Oslo City Court.
+
diff --git a/meta/files/common-licenses/RHeCos-1 b/meta/files/common-licenses/RHeCos-1
new file mode 100644
index 0000000..2ab40b7
--- /dev/null
+++ b/meta/files/common-licenses/RHeCos-1
@@ -0,0 +1,401 @@
+
+Red Hat eCos Public License v1.1
+
+1. DEFINITIONS
+
+1.1. "Contributor" means each entity that creates or contributes to
+the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original
+Code, prior Modifications used by a Contributor, and the Modifications made by
+that particular Contributor.
+
+1.3. "Covered Code" means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case including
+portions thereof.
+
+1.4. "Electronic Distribution Mechanism" means a mechanism generally
+accepted in the software development community for the electronic transfer of
+data.
+
+1.5. "Executable" means Covered Code in any form other than Source
+Code.
+
+1.6. "Initial Developer" means the individual or entity identified as
+the Initial Developer in the Source Code notice required by Exhibit A.
+
+1.7. "Larger Work" means a work which combines Covered Code or
+portions thereof with code not governed by the terms of this License.
+
+1.8. "License" means this document.
+
+1.9. "Modifications" means any addition to or deletion from the
+substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:
+
+A. Any addition to or deletion from the contents of a file containing Original
+Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or previous
+Modifications.
+
+1.10. "Original Code" means Source Code of computer software code
+which is described in the Source Code notice required by Exhibit A as Original
+Code, and which, at the time of its release under this License is not already
+Covered Code governed by this License.
+
+1.11. "Source Code" means the preferred form of the Covered Code for
+making modifications to it, including all modules it contains, plus any
+associated interface definition files, scripts used to control compilation and
+installation of an Executable, or a list of source code differential
+comparisons against either the Original Code or another well known, available
+Covered Code of the Contributor's choice. The Source Code can be in a
+compressed or archival form, provided the appropriate decompression or de-
+archiving software is widely available for no charge.
+
+1.12. "You" means an individual or a legal entity exercising rights
+under, and complying with all of the terms of, this License or a future version
+of this License issued under Section 6.1. For legal entities, "You"
+includes any entity which controls, is controlled by, or is under common
+control with You. For purposes of this definition, "control" means
+(a) the power, direct or indirect, to cause the direction or management of such
+entity, whether by contract or otherwise, or (b) ownership of fifty percent
+(50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+1.13. "Red Hat Branded Code" is code that Red Hat distributes and/or
+permits others to distribute under different terms than the Red Hat eCos Public
+License. Red Hat's Branded Code may contain part or all of the Covered Code.
+
+2. SOURCE CODE LICENSE
+
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free, non-
+exclusive license, subject to third party intellectual property claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the
+Original Code (or portions thereof) with or without Modifications, or as part
+of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Initial Developer, to
+make, have made, use and sell ("Utilize") the Original Code (or
+portions thereof), but solely to the extent that any such patent is reasonably
+necessary to enable You to Utilize the Original Code (or portions thereof) and
+not to any greater extent that may be necessary to Utilize further
+Modifications or combinations.
+
+2.2. Contributor Grant.
+Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive
+license, subject to third party intellectual property claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the
+Modifications created by such Contributor (or portions thereof) either on an
+unmodified basis, with other Modifications, as Covered Code or as part of a
+Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Contributor, to
+Utilize the Contributor Version (or portions thereof), but solely to the extent
+that any such patent is reasonably necessary to enable You to Utilize the
+Contributor Version (or portions thereof), and not to any greater extent that
+may be necessary to Utilize further Modifications or combinations.
+
+3. DISTRIBUTION OBLIGATIONS
+
+3.1. Application of License.
+The Modifications which You create or to which You contribute are governed by
+the terms of this License, including without limitation Section 2.2. The Source
+Code version of Covered Code may be distributed only under the terms of this
+License or a future version of this License released under Section 6.1, and You
+must include a copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code version
+that alters or restricts the applicable version of this License or the
+recipients' rights hereunder. However, You may include an additional document
+offering the additional rights described in Section 3.5.
+
+3.2. Availability of Source Code.
+Any Modification which You create or to which You contribute must be made
+available in Source Code form under the terms of this License via an accepted
+Electronic Distribution Mechanism to anyone to whom you made an Executable
+version available and to the Initial Developer; and if made available via
+Electronic Distribution Mechanism, must remain available for at least twelve
+(12) months after the date it initially became available, or at least six (6)
+months after a subsequent version of that particular Modification has been made
+available to such recipients. You are responsible for ensuring that the Source
+Code version remains available even if the Electronic Distribution Mechanism is
+maintained by a third party. You are responsible for notifying the Initial
+Developer of the Modification and the location of the Source if a contact means
+is provided. Red Hat will be acting as maintainer of the Source and may provide
+an Electronic Distribution mechanism for the Modification to be made available.
+You can contact Red Hat to make the Modification available and to notify the
+Initial Developer. (http://sourceware.cygnus.com/ecos/)
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which you contribute to contain a file
+documenting the changes You made to create that Covered Code and the date of
+any change. You must include a prominent statement that the Modification is
+derived, directly or indirectly, from Original Code provided by the Initial
+Developer and including the name of the Initial Developer in (a) the Source
+Code, and (b) in any notice in an Executable version or related documentation
+in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+(a) Third Party Claims.
+If You have knowledge that a party claims an intellectual property right in
+particular functionality or code (or its utilization under this License), you
+must include a text file with the source code distribution titled
+"LEGAL" which describes the claim and the party making the claim in
+sufficient detail that a recipient will know whom to contact. If you obtain
+such knowledge after You make Your Modification available as described in
+Section 3.2, You shall promptly modify the LEGAL file in all copies You make
+available thereafter and shall take other steps (such as notifying appropriate
+mailing lists or newsgroups) reasonably calculated to inform those who received
+the Covered Code that new knowledge has been obtained.
+
+(b) Contributor APIs.
+If Your Modification is an application programming interface and You own or
+control patents which are reasonably necessary to implement that API, you must
+also include this information in the LEGAL file.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source Code, and
+this License in any documentation for the Source Code, where You describe
+recipients' rights relating to Covered Code. If You created one or more
+Modification(s), You may add your name as a Contributor to the Source Code. If
+it is not possible to put such notice in a particular Source Code file due to
+its structure, then you must include such notice in a location (such as a
+relevant directory file) where a user would be likely to look for such a
+notice. You may choose to offer, and to charge a fee for, warranty, support,
+indemnity or liability obligations to one or more recipients of Covered Code.
+
+However, You may do so only on Your own behalf, and not on behalf of the
+Initial Developer or any Contributor. You must make it absolutely clear that
+any such warranty, support, indemnity or liability obligation is offered by You
+alone, and You hereby agree to indemnify the Initial Developer and every
+Contributor for any liability incurred by the Initial Developer or such
+Contributor as a result of warranty, support, indemnity or liability terms You
+offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the requirements of
+Section 3.1-3.5 have been met for that Covered Code, and if You include a
+notice stating that the Source Code version of the Covered Code is available
+under the terms of this License, including a description of how and where You
+have fulfilled the obligations of Section 3.2. The notice must be conspicuously
+included in any notice in an Executable version, related documentation or
+collateral in which You describe recipients' rights relating to the Covered
+Code. You may distribute the Executable version of Covered Code under a license
+of Your choice, which may contain terms different from this License, provided
+that You are in compliance with the terms of this License and that the license
+for the Executable version does not attempt to limit or alter the recipient's
+rights in the Source Code version from the rights set forth in this License. If
+You distribute the Executable version under a different license You must make
+it absolutely clear that any terms which differ from this License are offered
+by You alone, not by the Initial Developer or any Contributor. You hereby agree
+to indemnify the Initial Developer and every Contributor for any liability
+incurred by the Initial Developer or such Contributor as a result of any such
+terms You offer.
+
+If you distribute executable versions containing Covered Code, you must
+reproduce the notice in Exhibit B in the documentation and/or other materials
+provided with the product.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code not
+governed by the terms of this License and distribute the Larger Work as a
+single product. In such a case, You must make sure the requirements of this
+License are fulfilled for the Covered Code.
+
+4. INABILITY TO COMPLY DUE TO STATUTE OR REGULATION
+
+If it is impossible for You to comply with any of the terms of this License
+with respect to some or all of the Covered Code due to statute or regulation
+then You must: (a) comply with the terms of this License to the maximum extent
+possible; (b) cite the statute or regulation that prohibits you from adhering
+to the license; and (c) describe the limitations and the code they affect. Such
+description must be included in the LEGAL file described in Section 3.4 and
+must be included with all distributions of the Source Code. Except to the
+extent prohibited by statute or regulation, such description must be
+sufficiently detailed for a recipient of ordinary skill to be able to
+understand it. You must submit this LEGAL file to Red Hat for review, and You
+will not be able use the covered code in any means until permission is granted
+from Red Hat to allow for the inability to comply due to statute or regulation.
+
+5. APPLICATION OF THIS LICENSE
+
+This License applies to code to which the Initial Developer has attached the
+notice in Exhibit A, and to related Covered Code.
+
+Red Hat may include Covered Code in products without such additional products
+becoming subject to the terms of this License, and may license such additional
+products on different terms from those contained in this License.
+
+Red Hat may license the Source Code of Red Hat Branded Code without Red Hat
+Branded Code becoming subject to the terms of this License, and may license Red
+Hat Branded Code on different terms from those contained in this License.
+Contact Red Hat for details of alternate licensing terms available.
+
+6. VERSIONS OF THE LICENSE
+
+6.1. New Versions.
+Red Hat may publish revised and/or new versions of the License from time to
+time. Each version will be given a distinguishing version number.
+
+6.2. Effect of New Versions.
+Once Covered Code has been published under a particular version of the License,
+You may always continue to use it under the terms of that version. You may also
+choose to use such Covered Code under the terms of any subsequent version of
+the License published by Red Hat. No one other than Red Hat has the right to
+modify the terms applicable to Covered Code beyond what is granted under this
+and subsequent Licenses.
+
+6.3. Derivative Works.
+If you create or use a modified version of this License (which you may only do
+in order to apply it to code which is not already Covered Code governed by this
+License), you must (a) rename Your license so that the phrases
+"ECOS", "eCos", "Red Hat", "RHEPL" or
+any confusingly similar phrase do not appear anywhere in your license and (b)
+otherwise make it clear that your version of the license contains terms which
+differ from the Red Hat eCos Public License. (Filling in the name of the
+Initial Developer, Original Code or Contributor in the notice described in
+Exhibit A shall not of themselves be deemed to be modifications of this
+License.)
+
+7. DISCLAIMER OF WARRANTY
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
+LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE,
+FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE
+QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED
+CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY
+OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
+CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+DISCLAIMER.
+
+8. TERMINATION
+
+This License and the rights granted hereunder will terminate automatically if
+You fail to comply with terms herein and fail to cure such breach within 30
+days of becoming aware of the breach. All sublicenses to the Covered Code which
+are properly granted shall survive any termination of this License. Provisions
+which, by their nature, must remain in effect beyond the termination of this
+License shall survive.
+
+9. LIMITATION OF LIABILITY
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY OTHER
+CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH
+PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL,
+INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
+MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH
+PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS
+LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL
+INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR
+LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND
+LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS
+
+The Covered Code is a "commercial item," as that term is defined in
+48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+software" and "commercial computer software documentation," as
+such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R.
+12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S.
+Government End Users acquire Covered Code with only those rights set forth
+herein.
+
+11. MISCELLANEOUS
+
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable, such
+provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by California law provisions
+(except to the extent applicable law, if any, provides otherwise), excluding
+its conflict-of-law provisions. With respect to disputes in which at least one
+party is a citizen of, or an entity chartered or registered to do business in,
+the United States of America: (a) unless otherwise agreed in writing, all
+disputes relating to this License (excepting any dispute relating to
+intellectual property rights) shall be subject to final and binding
+arbitration, with the losing party paying all costs of arbitration; (b) any
+arbitration relating to this Agreement shall be held in Santa Clara County,
+California, under the auspices of JAMS/EndDispute; and (c) any litigation
+relating to this Agreement shall be subject to the jurisdiction of the Federal
+Courts of the Northern District of California, with venue lying in Santa Clara
+County, California, with the losing party responsible for costs, including
+without limitation, court costs and reasonable attorneys fees and expenses. The
+application of the United Nations Convention on Contracts for the International
+Sale of Goods is expressly excluded. Any law or regulation which provides that
+the language of a contract shall be construed against the drafter shall not
+apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS
+
+Except in cases where another Contributor has failed to comply with Section
+3.4, You are responsible for damages arising, directly or indirectly, out of
+Your utilization of rights under this License, based on the number of copies of
+Covered Code you made available, the revenues you received from utilizing such
+rights, and other relevant factors. You agree to work with affected parties to
+distribute responsibility on an equitable basis.
+
+13. ADDITIONAL TERMS APPLICABLE TO THE RED HAT ECOS PUBLIC LICENSE
+
+Nothing in this License shall be interpreted to prohibit Red Hat from licensing
+under different terms than this License any code which Red Hat otherwise would
+have a right to license.
+
+Red Hat and logo - This License does not grant any rights to use the trademark
+Red Hat, the Red Hat logo, eCos logo, even if such marks are included in the
+Original Code. You may contact Red Hat for permission to display the Red Hat
+and eCos marks in either the documentation or the Executable version beyond
+that required in Exhibit B.
+
+Inability to Comply Due to Contractual Obligation - To the extent that Red Hat
+is limited contractually from making third party code available under this
+License, Red Hat may choose to integrate such third party code into Covered
+Code without being required to distribute such third party code in Source Code
+form, even if such third party code would otherwise be considered
+"Modifications" under this License.
+
+EXHIBIT A
+
+"The contents of this file are subject to the Red Hat eCos Public License
+Version 1.1 (the "License"); you may not use this file except in
+compliance with the License. You may obtain a copy of the License at http://
+www.redhat.com/
+
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the License.
+
+The Original Code is eCos - Embedded Configurable Operating System, released
+September 30, 1998. The Initial Developer of the Original Code is Red Hat.
+Portions created by Red Hat are Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
+All Rights Reserved."
+
+EXHIBIT B
+
+Part of the software embedded in this product is eCos - Embedded Configurable
+Operating System, a trademark of Red Hat. Portions created by Red Hat are
+Copyright (C) 1998, 1999, 2000 Red Hat, Inc. (http://www.redhat.com/). All
+Rights Reserved.
+
+THE SOFTWARE IN THIS PRODUCT WAS IN PART PROVIDED BY RED HAT AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.
+
+
+
+
+
+
diff --git a/meta/files/common-licenses/RHeCos-1.1 b/meta/files/common-licenses/RHeCos-1.1
new file mode 100644
index 0000000..f98900a
--- /dev/null
+++ b/meta/files/common-licenses/RHeCos-1.1
@@ -0,0 +1,151 @@
+
+Red Hat eCos Public License v1.1
+
+1. DEFINITIONS
+
+1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+1.3. "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+1.4. "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data.
+
+1.5. "Executable" means Covered Code in any form other than Source Code.
+
+1.6. "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+
+1.7. "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+1.8. "License" means this document.
+
+1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+
+A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or previous Modifications.
+
+1.10. "Original Code" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+
+1.11. "Source Code" means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or a list of source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+1.12. "You" means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+1.13. "Red Hat Branded Code" is code that Red Hat distributes and/or permits others to distribute under different terms than the Red Hat eCos Public License. Red Hat`s Branded Code may contain part or all of the Covered Code.
+
+2. SOURCE CODE LICENSE
+
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, or as part of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Initial Developer, to make, have made, use and sell ("Utilize") the Original Code (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to Utilize the Original Code (or portions thereof) and not to any greater extent that may be necessary to Utilize further Modifications or combinations.
+
+2.2. Contributor Grant.
+Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+(a) to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code or as part of a Larger Work; and
+
+(b) under patents now or hereafter owned or controlled by Contributor, to Utilize the Contributor Version (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to Utilize the Contributor Version (or portions thereof), and not to any greater extent that may be necessary to Utilize further Modifications or combinations.
+
+3. DISTRIBUTION OBLIGATIONS
+
+3.1. Application of License.
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+
+3.2. Availability of Source Code.
+Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available and to the Initial Developer; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. You are responsible for notifying the Initial Developer of the Modification and the location of the Source if a contact means is provided. Red Hat will be acting as maintainer of the Source and may provide an Electronic Distribution mechanism for the Modification to be made available. You can contact Red Hat to make the Modification available and to notify the Initial Developer. (http://sourceware.cygnus.com/ecos/)
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which you contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+(a) Third Party Claims. 
+If You have knowledge that a party claims an intellectual property right in particular functionality or code (or its utilization under this License), you must include a text file with the source code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If you obtain such knowledge after You make Your Modification available as described in Section 3.2, You shall promptly modify the LEGAL file in all copies You make available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+
+(b) Contributor APIs. 
+If Your Modification is an application programming interface and You own or control patents which are reasonably necessary to implement that API, you must also include this information in the LEGAL file.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source Code, and this License in any documentation for the Source Code, where You describe recipients` rights relating to Covered Code. If You created one or more Modification(s), You may add your name as a Contributor to the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then you must include such notice in a location (such as a relevant directory file) where a user would be likely to look for such a notice. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code.
+
+However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear that any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients` rights relating to the Covered Code. You may distribute the Executable version of Covered Code under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+If you distribute executable versions containing Covered Code, you must reproduce the notice in Exhibit B in the documentation and/or other materials provided with the product.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. INABILITY TO COMPLY DUE TO STATUTE OR REGULATION
+
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; (b) cite the statute or regulation that prohibits you from adhering to the license; and (c) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. You must submit this LEGAL file to Red Hat for review, and You will not be able use the covered code in any means until permission is granted from Red Hat to allow for the inability to comply due to statute or regulation.
+
+5. APPLICATION OF THIS LICENSE
+
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A, and to related Covered Code.
+
+Red Hat may include Covered Code in products without such additional products becoming subject to the terms of this License, and may license such additional products on different terms from those contained in this License.
+
+Red Hat may license the Source Code of Red Hat Branded Code without Red Hat Branded Code becoming subject to the terms of this License, and may license Red Hat Branded Code on different terms from those contained in this License. Contact Red Hat for details of alternate licensing terms available.
+
+6. VERSIONS OF THE LICENSE
+
+6.1. New Versions.
+Red Hat may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+6.2. Effect of New Versions.
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Red Hat. No one other than Red Hat has the right to modify the terms applicable to Covered Code beyond what is granted under this and subsequent Licenses.
+
+6.3. Derivative Works.
+If you create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), you must (a) rename Your license so that the phrases "ECOS", "eCos", "Red Hat", "RHEPL" or any confusingly similar phrase do not appear anywhere in your license and (b) otherwise make it clear that your version of the license contains terms which differ from the Red Hat eCos Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION
+
+This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+9. LIMITATION OF LIABILITY
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS
+
+The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+11. MISCELLANEOUS
+
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in, the United States of America: (a) unless otherwise agreed in writing, all disputes relating to this License (excepting any dispute relating to intellectual property rights) shall be subject to final and binding arbitration, with the losing party paying all costs of arbitration; (b) any arbitration relating to this Agreement shall be held in Santa Clara County, California, under the auspices of JAMS/EndDispute; and (c) any litigation relating to this Agreement shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS
+
+Except in cases where another Contributor has failed to comply with Section 3.4, You are responsible for damages arising, directly or indirectly, out of Your utilization of rights under this License, based on the number of copies of Covered Code you made available, the revenues you received from utilizing such rights, and other relevant factors. You agree to work with affected parties to distribute responsibility on an equitable basis.
+
+13. ADDITIONAL TERMS APPLICABLE TO THE RED HAT ECOS PUBLIC LICENSE
+
+Nothing in this License shall be interpreted to prohibit Red Hat from licensing under different terms than this License any code which Red Hat otherwise would have a right to license.
+
+Red Hat and logo - This License does not grant any rights to use the trademark Red Hat, the Red Hat logo, eCos logo, even if such marks are included in the Original Code. You may contact Red Hat for permission to display the Red Hat and eCos marks in either the documentation or the Executable version beyond that required in Exhibit B.
+
+Inability to Comply Due to Contractual Obligation - To the extent that Red Hat is limited contractually from making third party code available under this License, Red Hat may choose to integrate such third party code into Covered Code without being required to distribute such third party code in Source Code form, even if such third party code would otherwise be considered "Modifications" under this License.
+
+EXHIBIT A
+
+"The contents of this file are subject to the Red Hat eCos Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.redhat.com/
+
+Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
+
+The Original Code is eCos - Embedded Configurable Operating System, released September 30, 1998. The Initial Developer of the Original Code is Red Hat. Portions created by Red Hat are Copyright (C) 1998, 1999, 2000 Red Hat, Inc. All Rights Reserved."
+
+EXHIBIT B
+
+Part of the software embedded in this product is eCos - Embedded Configurable Operating System, a trademark of Red Hat. Portions created by Red Hat are Copyright (C) 1998, 1999, 2000 Red Hat, Inc. (http://www.redhat.com/). All Rights Reserved.
+
+THE SOFTWARE IN THIS PRODUCT WAS IN PART PROVIDED BY RED HAT AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/meta/files/common-licenses/RPL-1.5 b/meta/files/common-licenses/RPL-1.5
new file mode 100644
index 0000000..2190875
--- /dev/null
+++ b/meta/files/common-licenses/RPL-1.5
@@ -0,0 +1,546 @@
+
+Reciprocal Public License 1.5 (RPL1.5)
+
+Reciprocal Public License (RPL)
+
+Version 1.5, July 15, 2007
+
+Copyright (C) 2001-2007
+Technical Pursuit Inc.,
+All Rights Reserved.
+
+PREAMBLE
+
+The Reciprocal Public License (RPL) is based on the concept of reciprocity or,
+if you prefer, fairness.
+
+In short, this license grew out of a desire to close loopholes in previous open
+source licenses, loopholes that allowed parties to acquire open source software
+and derive financial benefit from it without having to release their
+improvements or derivatives to the community which enabled them. This occurred
+any time an entity did not release their application to a "third party".
+
+While there is a certain freedom in this model of licensing, it struck the
+authors of the RPL as being unfair to the open source community at large and to
+the original authors of the works in particular. After all, bug fixes,
+extensions, and meaningful and valuable derivatives were not consistently
+finding their way back into the community where they could fuel further, and
+faster, growth and expansion of the overall open source software base.
+
+While you should clearly read and understand the entire license, the essence of
+the RPL is found in two definitions: "Deploy" and "Required Components".
+
+Regarding deployment, under the RPL your changes, bug fixes, extensions, etc.
+must be made available to the open source community at large when you Deploy in
+any form -- either internally or to an outside party. Once you start running
+the software you have to start sharing the software.
+
+Further, under the RPL all components you author including schemas, scripts,
+source code, etc. -- regardless of whether they`re compiled into a single
+binary or used as two halves of client/server application -- must be shared.
+You have to share the whole pie, not an isolated slice of it.
+
+In addition to these goals, the RPL was authored to meet the requirements of
+the Open Source Definition as maintained by the Open Source Initiative (OSI).
+
+The specific terms and conditions of the license are defined in the remainder
+of this document.
+
+LICENSE TERMS
+
+1.0 General; Applicability &amp; Definitions. This Reciprocal Public License
+Version 1.5 ("License") applies to any programs or other works as well as any
+and all updates or maintenance releases of said programs or works ("Software")
+not already covered by this License which the Software copyright holder
+("Licensor") makes available containing a License Notice (hereinafter defined)
+from the Licensor specifying or allowing use or distribution under the terms of
+this License. As used in this License:
+
+1.1 "Contributor" means any person or entity who created or contributed to the
+creation of an Extension.
+
+1.2 "Deploy" means to use, Serve, sublicense or distribute Licensed Software
+other than for Your internal Research and/or Personal Use, and includes
+without limitation, any and all internal use or distribution of Licensed
+Software within Your business or organization other than for Research and/or
+Personal Use, as well as direct or indirect sublicensing or distribution of
+Licensed Software by You to any third party in any form or manner.
+
+1.3 "Derivative Works" as used in this License is defined under U.S. copyright
+law.
+
+1.4 "Electronic Distribution Mechanism" means a mechanism generally accepted
+in the software development community for the electronic transfer of data such
+as download from an FTP server or web site, where such mechanism is publicly
+accessible.
+
+1.5 "Extensions" means any Modifications, Derivative Works, or Required
+Components as those terms are defined in this License.
+
+1.6 "License" means this Reciprocal Public License.
+
+1.7 "License Notice" means any notice contained in EXHIBIT A.
+
+1.8 "Licensed Software" means any Software licensed pursuant to this License.
+Licensed Software also includes all previous Extensions from any Contributor
+that You receive.
+
+1.9 "Licensor" means the copyright holder of any Software previously not
+covered by this License who releases the Software under the terms of this
+License.
+
+1.10 "Modifications" means any additions to or deletions from the substance or
+structure of (i) a file or other storage containing Licensed Software, or (ii)
+any new file or storage that contains any part of Licensed Software, or (iii)
+any file or storage which replaces or otherwise alters the original
+functionality of Licensed Software at runtime.
+
+1.11 "Personal Use" means use of Licensed Software by an individual solely for
+his or her personal, private and non-commercial purposes. An individual`s use
+of Licensed Software in his or her capacity as an officer, employee, member,
+independent contractor or agent of a corporation, business or organization
+(commercial or non-commercial) does not qualify as Personal Use.
+
+1.12 "Required Components" means any text, programs, scripts, schema,
+interface definitions, control files, or other works created by You which are
+required by a third party of average skill to successfully install and run
+Licensed Software containing Your Modifications, or to install and run Your
+Derivative Works.
+
+1.13 "Research" means investigation or experimentation for the purpose of
+understanding the nature and limits of the Licensed Software and its potential
+uses.
+
+1.14 "Serve" means to deliver Licensed Software and/or Your Extensions by
+means of a computer network to one or more computers for purposes of execution
+of Licensed Software and/or Your Extensions.
+
+1.15 "Software" means any computer programs or other works as well as any
+updates or maintenance releases of those programs or works which are
+distributed publicly by Licensor.
+
+1.16 "Source Code" means the preferred form for making modifications to the
+Licensed Software and/or Your Extensions, including all modules contained
+therein, plus any associated text, interface definition files, scripts used to
+control compilation and installation of an executable program or other
+components required by a third party of average skill to build a running
+version of the Licensed Software or Your Extensions.
+
+1.17 "User-Visible Attribution Notice" means any notice contained in EXHIBIT B.
+
+1.18 "You" or "Your" means an individual or a legal entity exercising rights
+under this License. For legal entities, "You" or "Your" includes any entity
+which controls, is controlled by, or is under common control with, You, where
+"control" means (a) the power, direct or indirect, to cause the direction or
+management of such entity, whether by contract or otherwise, or (b) ownership
+of fifty percent (50%) or more of the outstanding shares or beneficial
+ownership of such entity.
+
+2.0 Acceptance Of License. You are not required to accept this License since
+you have not signed it, however nothing else grants you permission to use,
+copy, distribute, modify, or create derivatives of either the Software or any
+Extensions created by a Contributor. These actions are prohibited by law if
+you do not accept this License. Therefore, by performing any of these actions
+You indicate Your acceptance of this License and Your agreement to be bound by
+all its terms and conditions. IF YOU DO NOT AGREE WITH ALL THE TERMS AND
+CONDITIONS OF THIS LICENSE DO NOT USE, MODIFY, CREATE DERIVATIVES, OR
+DISTRIBUTE THE SOFTWARE. IF IT IS IMPOSSIBLE FOR YOU TO COMPLY WITH ALL THE
+TERMS AND CONDITIONS OF THIS LICENSE THEN YOU CAN NOT USE, MODIFY, CREATE
+DERIVATIVES, OR DISTRIBUTE THE SOFTWARE.
+
+3.0 Grant of License From Licensor. Subject to the terms and conditions of
+this License, Licensor hereby grants You a world-wide, royalty-free, non-
+exclusive license, subject to Licensor`s intellectual property rights, and any
+third party intellectual property claims derived from the Licensed Software
+under this License, to do the following:
+
+3.1 Use, reproduce, modify, display, perform, sublicense and distribute
+Licensed Software and Your Extensions in both Source Code form or as an
+executable program.
+
+3.2 Create Derivative Works (as that term is defined under U.S. copyright law)
+of Licensed Software by adding to or deleting from the substance or structure
+of said Licensed Software.
+
+3.3 Under claims of patents now or hereafter owned or controlled by Licensor,
+to make, use, have made, and/or otherwise dispose of Licensed Software or
+portions thereof, but solely to the extent that any such claim is necessary to
+enable You to make, use, have made, and/or otherwise dispose of Licensed
+Software or portions thereof.
+
+3.4 Licensor reserves the right to release new versions of the Software with
+different features, specifications, capabilities, functions, licensing terms,
+general availability or other characteristics. Title, ownership rights, and
+intellectual property rights in and to the Licensed Software shall remain in
+Licensor and/or its Contributors.
+
+4.0 Grant of License From Contributor. By application of the provisions in
+Section 6 below, each Contributor hereby grants You a world-wide, royalty-
+free, non-exclusive license, subject to said Contributor`s intellectual
+property rights, and any third party intellectual property claims derived from
+the Licensed Software under this License, to do the following:
+
+4.1 Use, reproduce, modify, display, perform, sublicense and distribute any
+Extensions Deployed by such Contributor or portions thereof, in both Source
+Code form or as an executable program, either on an unmodified basis or as
+part of Derivative Works.
+
+4.2 Under claims of patents now or hereafter owned or controlled by
+Contributor, to make, use, have made, and/or otherwise dispose of Extensions
+or portions thereof, but solely to the extent that any such claim is necessary
+to enable You to make, use, have made, and/or otherwise dispose of
+Licensed Software or portions thereof.
+
+5.0 Exclusions From License Grant. Nothing in this License shall be deemed to
+grant any rights to trademarks, copyrights, patents, trade secrets or any
+other intellectual property of Licensor or any Contributor except as expressly
+stated herein. Except as expressly stated in Sections 3 and 4, no other patent
+rights, express or implied, are granted herein. Your Extensions may require
+additional patent licenses from Licensor or Contributors which each may grant
+in its sole discretion. No right is granted to the trademarks of Licensor or
+any Contributor even if such marks are included in the Licensed Software.
+Nothing in this License shall be interpreted to prohibit Licensor from
+licensing under different terms from this License any code that Licensor
+otherwise would have a right to license.
+
+5.1 You expressly acknowledge and agree that although Licensor and each
+Contributor grants the licenses to their respective portions of the Licensed
+Software set forth herein, no assurances are provided by Licensor or any
+Contributor that the Licensed Software does not infringe the patent or other
+intellectual property rights of any other entity. Licensor and each
+Contributor disclaim any liability to You for claims brought by any other
+entity based on infringement of intellectual property rights or otherwise. As
+a condition to exercising the rights and licenses granted hereunder, You
+hereby assume sole responsibility to secure any other intellectual property
+rights needed, if any. For example, if a third party patent license is
+required to allow You to distribute the Licensed Software, it is Your
+responsibility to acquire that license before distributing the Licensed
+Software.
+
+6.0 Your Obligations And Grants. In consideration of, and as an express
+condition to, the licenses granted to You under this License You hereby agree
+that any Modifications, Derivative Works, or Required Components (collectively
+Extensions) that You create or to which You contribute are governed by the
+terms of this License including, without limitation, Section 4. Any Extensions
+that You create or to which You contribute must be Deployed under the terms of
+this License or a future version of this License released under Section 7. You
+hereby grant to Licensor and all third parties a world-wide, non-exclusive,
+royalty-free license under those intellectual property rights You own or
+control to use, reproduce, display, perform, modify, create derivatives,
+sublicense, and distribute Licensed Software, in any form. Any Extensions You
+make and Deploy must have a distinct title so as to readily tell any
+subsequent user or Contributor that the Extensions are by You. You must
+include a copy of this License or directions on how to obtain a copy with
+every copy of the Extensions You distribute. You agree not to offer or impose
+any terms on any Source Code or executable version of the Licensed Software,
+or its Extensions that alter or restrict the applicable version of this
+License or the recipients` rights hereunder.
+
+6.1 Availability of Source Code. You must make available, under the terms of
+this License, the Source Code of any Extensions that You Deploy, via an
+Electronic Distribution Mechanism. The Source Code for any version that You
+Deploy must be made available within one (1) month of when you Deploy and must
+remain available for no less than twelve (12) months after the date You cease
+to Deploy. You are responsible for ensuring that the Source Code to each
+version You Deploy remains available even if the Electronic Distribution
+Mechanism is maintained by a third party. You may not charge a fee for any
+copy of the Source Code distributed under this Section in excess of Your
+actual cost of duplication and distribution of said copy.
+
+6.2 Description of Modifications. You must cause any Modifications that You
+create or to which You contribute to be documented in the Source Code, clearly
+describing the additions, changes or deletions You made. You must include a
+prominent statement that the Modifications are derived, directly or indirectly,
+from the Licensed Software and include the names of the Licensor and any
+Contributor to the Licensed Software in (i) the Source Code and (ii) in any
+notice displayed by the Licensed Software You distribute or in related
+documentation in which You describe the origin or ownership of the Licensed
+Software. You may not modify or delete any pre-existing copyright notices,
+change notices or License text in the Licensed Software without written
+permission of the respective Licensor or Contributor.
+
+6.3 Intellectual Property Matters.
+
+a. Third Party Claims. If You have knowledge that a license to a third party`s
+intellectual property right is required to exercise the rights granted by this
+License, You must include a human-readable file with Your distribution that
+describes the claim and the party making the claim in sufficient detail that a
+recipient will know whom to contact.
+
+b. Contributor APIs. If Your Extensions include an application programming
+interface ("API") and You have knowledge of patent licenses that are
+reasonably necessary to implement that API, You must also include this
+information in a human-readable file supplied with Your distribution.
+
+c. Representations. You represent that, except as disclosed pursuant to 6.3(a)
+above, You believe that any Extensions You distribute are Your original
+creations and that You have sufficient rights to grant the rights conveyed by
+this License.
+
+6.4 Required Notices.
+
+a. License Text. You must duplicate this License or instructions on how to
+acquire a copy in any documentation You provide along with the Source Code of
+any Extensions You create or to which You contribute, wherever You describe
+recipients` rights relating to Licensed Software.
+
+b. License Notice. You must duplicate any notice contained in EXHIBIT A (the
+"License Notice") in each file of the Source Code of any copy You distribute
+of the Licensed Software and Your Extensions. If You create an Extension, You
+may add Your name as a Contributor to the Source Code and accompanying
+documentation along with a description of the contribution. If it is not
+possible to put the License Notice in a particular Source Code file due to its
+structure, then You must include such License Notice in a location where a
+user would be likely to look for such a notice.
+
+c. Source Code Availability. You must notify the software community of the
+availability of Source Code to Your Extensions within one (1) month of the date
+You initially Deploy and include in such notification a description of the
+Extensions, and instructions on how to acquire the Source Code. Should such
+instructions change you must notify the software community of revised
+instructions within one (1) month of the date of change. You must provide
+notification by posting to appropriate news groups, mailing lists, weblogs, or
+other sites where a publicly accessible search engine would reasonably be
+expected to index your post in relationship to queries regarding the Licensed
+Software and/or Your Extensions.
+
+d. User-Visible Attribution. You must duplicate any notice contained in
+EXHIBIT B (the "User-Visible Attribution Notice") in each user-visible display
+of the Licensed Software and Your Extensions which delineates copyright,
+ownership, or similar attribution information. If You create an Extension,
+You may add Your name as a Contributor, and add Your attribution notice, as an
+equally visible and functional element of any User-Visible Attribution Notice
+content. To ensure proper attribution, You must also include such User-Visible
+Attribution Notice in at least one location in the Software documentation
+where a user would be likely to look for such notice.
+
+6.5 Additional Terms. You may choose to offer, and charge a fee for, warranty,
+support, indemnity or liability obligations to one or more recipients of
+Licensed Software. However, You may do so only on Your own behalf, and not on
+behalf of the Licensor or any Contributor except as permitted under other
+agreements between you and Licensor or Contributor. You must make it clear that
+any such warranty, support, indemnity or liability obligation is offered by You
+alone, and You hereby agree to indemnify the Licensor and every Contributor for
+any liability plus attorney fees, costs, and related expenses due to any such
+action or claim incurred by the Licensor or such Contributor as a result of
+warranty, support, indemnity or liability terms You offer.
+
+6.6 Conflicts With Other Licenses. Where any portion of Your Extensions, by
+virtue of being Derivative Works of another product or similar circumstance,
+fall under the terms of another license, the terms of that license should be
+honored however You must also make Your Extensions available under this
+License. If the terms of this License continue to conflict with the terms of
+the other license you may write the Licensor for permission to resolve the
+conflict in a fashion that remains consistent with the intent of this License.
+Such permission will be granted at the sole discretion of the Licensor.
+
+7.0 Versions of This License. Licensor may publish from time to time revised
+versions of the License. Once Licensed Software has been published under a
+particular version of the License, You may always continue to use it under the
+terms of that version. You may also choose to use such Licensed Software under
+the terms of any subsequent version of the License published by Licensor. No
+one other than Licensor has the right to modify the terms applicable to
+Licensed Software created under this License.
+
+7.1 If You create or use a modified version of this License, which You may do
+only in order to apply it to software that is not already Licensed Software
+under this License, You must rename Your license so that it is not confusingly
+similar to this License, and must make it clear that Your license contains
+terms that differ from this License. In so naming Your license, You may not
+use any trademark of Licensor or of any Contributor. Should Your modifications
+to this License be limited to alteration of a) Section 13.8 solely to modify
+the legal Jurisdiction or Venue for disputes, b) EXHIBIT A solely to define
+License Notice text, or c) to EXHIBIT B solely to define a User-Visible
+Attribution Notice, You may continue to refer to Your License as the
+Reciprocal Public License or simply the RPL.
+
+8.0 Disclaimer of Warranty. LICENSED SOFTWARE IS PROVIDED UNDER THIS LICENSE
+ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
+INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE LICENSED SOFTWARE IS FREE
+OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+FURTHER THERE IS NO WARRANTY MADE AND ALL IMPLIED WARRANTIES ARE DISCLAIMED
+THAT THE LICENSED SOFTWARE MEETS OR COMPLIES WITH ANY DESCRIPTION OF
+PERFORMANCE OR OPERATION, SAID COMPATIBILITY AND SUITABILITY BEING YOUR
+RESPONSIBILITY. LICENSOR DISCLAIMS ANY WARRANTY, IMPLIED OR EXPRESSED, THAT
+ANY CONTRIBUTOR`S EXTENSIONS MEET ANY STANDARD OF COMPATIBILITY OR DESCRIPTION
+OF PERFORMANCE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LICENSED SOFTWARE IS WITH YOU. SHOULD LICENSED SOFTWARE PROVE DEFECTIVE IN ANY
+RESPECT, YOU (AND NOT THE LICENSOR OR ANY OTHER CONTRIBUTOR) ASSUME THE COST
+OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. UNDER THE TERMS OF THIS
+LICENSOR WILL NOT SUPPORT THIS SOFTWARE AND IS UNDER NO OBLIGATION TO ISSUE
+UPDATES TO THIS SOFTWARE. LICENSOR HAS NO KNOWLEDGE OF ERRANT CODE OR VIRUS IN
+THIS SOFTWARE, BUT DOES NOT WARRANT THAT THE SOFTWARE IS FREE FROM SUCH ERRORS
+OR VIRUSES. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+LICENSE. NO USE OF LICENSED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+DISCLAIMER.
+
+9.0 Limitation of Liability. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY,
+WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL THE
+LICENSOR, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF LICENSED SOFTWARE, OR ANY
+SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING,
+WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER
+FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES,
+EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH
+DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH
+OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT
+APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS
+EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10.0 High Risk Activities. THE LICENSED SOFTWARE IS NOT FAULT-TOLERANT AND IS
+NOT DESIGNED, MANUFACTURED, OR INTENDED FOR USE OR DISTRIBUTION AS ON-LINE
+CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE PERFORMANCE,
+SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR
+COMMUNICATIONS SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE SUPPORT MACHINES, OR
+WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE LICENSED SOFTWARE COULD LEAD
+DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE
+("HIGH RISK ACTIVITIES"). LICENSOR AND CONTRIBUTORS SPECIFICALLY DISCLAIM ANY
+EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR HIGH RISK ACTIVITIES.
+
+11.0 Responsibility for Claims. As between Licensor and Contributors, each
+party is responsible for claims and damages arising, directly or indirectly,
+out of its utilization of rights under this License which specifically
+disclaims warranties and limits any liability of the Licensor. This paragraph
+is to be used in conjunction with and controlled by the Disclaimer Of
+Warranties of Section 8, the Limitation Of Damages in Section 9, and the
+disclaimer against use for High Risk Activities in Section 10. The Licensor
+has thereby disclaimed all warranties and limited any damages that it is or
+may be liable for. You agree to work with Licensor and Contributors to
+distribute such responsibility on an equitable basis consistent with the terms
+of this License including Sections 8, 9, and 10. Nothing herein is intended or
+shall be deemed to constitute any admission of liability.
+
+12.0 Termination. This License and all rights granted hereunder will terminate
+immediately in the event of the circumstances described in Section 13.6 or if
+applicable law prohibits or restricts You from fully and or specifically
+complying with Sections 3, 4 and/or 6, or prevents the enforceability of any
+of those Sections, and You must immediately discontinue any use of Licensed
+Software.
+
+12.1 Automatic Termination Upon Breach. This License and the rights granted
+hereunder will terminate automatically if You fail to comply with the terms
+herein and fail to cure such breach within thirty (30) days of becoming aware
+of the breach. All sublicenses to the Licensed Software that are properly
+granted shall survive any termination of this License. Provisions that, by
+their nature, must remain in effect beyond the termination of this License,
+shall survive.
+
+12.2 Termination Upon Assertion of Patent Infringement. If You initiate
+litigation by asserting a patent infringement claim (excluding declaratory
+judgment actions) against Licensor or a Contributor (Licensor or Contributor
+against whom You file such an action is referred to herein as "Respondent")
+alleging that Licensed Software directly or indirectly infringes any patent,
+then any and all rights granted by such Respondent to You under Sections 3 or
+4 of this License shall terminate prospectively upon sixty (60) days notice
+from Respondent (the "Notice Period") unless within that Notice Period You
+either agree in writing (i) to pay Respondent a mutually agreeable reasonably
+royalty for Your past or future use of Licensed Software made by such
+Respondent, or (ii) withdraw Your litigation claim with respect to Licensed
+Software against such Respondent. If within said Notice Period a reasonable
+royalty and payment arrangement are not mutually agreed upon in writing by the
+parties or the litigation claim is not withdrawn, the rights granted by
+Licensor to You under Sections 3 and 4 automatically terminate at the
+expiration of said Notice Period.
+
+12.3 Reasonable Value of This License. If You assert a patent infringement
+claim against Respondent alleging that Licensed Software directly or
+indirectly infringes any patent where such claim is resolved (such as by
+license or settlement) prior to the initiation of patent infringement
+litigation, then the reasonable value of the licenses granted by said
+Respondent under Sections 3 and 4 shall be taken into account in determining
+the amount or value of any payment or license.
+
+12.4 No Retroactive Effect of Termination. In the event of termination under
+this Section all end user license agreements (excluding licenses to
+distributors and resellers) that have been validly granted by You or any
+distributor hereunder prior to termination shall survive termination.
+
+13.0 Miscellaneous.
+
+13.1 U.S. Government End Users. The Licensed Software is a "commercial item,"
+as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of
+"commercial computer software" and "commercial computer software
+documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995).
+Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4
+(June 1995), all U.S. Government End Users acquire Licensed Software with only
+those rights set forth herein.
+
+13.2 Relationship of Parties. This License will not be construed as creating
+an agency, partnership, joint venture, or any other form of legal association
+between or among You, Licensor, or any Contributor, and You will not represent
+to the contrary, whether expressly, by implication, appearance, or otherwise.
+
+13.3 Independent Development. Nothing in this License will impair Licensor`s
+right to acquire, license, develop, subcontract, market, or distribute
+technology or products that perform the same or similar functions as, or
+otherwise compete with, Extensions that You may develop, produce, market, or
+distribute.
+
+13.4 Consent To Breach Not Waiver. Failure by Licensor or Contributor to
+enforce any provision of this License will not be deemed a waiver of future enforcement
+of that or any other provision.
+
+13.5 Severability. This License represents the complete agreement concerning
+the subject matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent necessary
+to make it enforceable.
+
+13.6 Inability to Comply Due to Statute or Regulation. If it is impossible for
+You to comply with any of the terms of this License with respect to some or
+all of the Licensed Software due to statute, judicial order, or regulation,
+then You cannot use, modify, or distribute the software.
+
+13.7 Export Restrictions. You may be restricted with respect to downloading or
+otherwise acquiring, exporting, or reexporting the Licensed Software or any
+underlying information or technology by United States and other applicable
+laws and regulations. By downloading or by otherwise obtaining the Licensed
+Software, You are agreeing to be responsible for compliance with all
+applicable laws and regulations.
+
+13.8 Arbitration, Jurisdiction &amp; Venue. This License shall be governed by
+Colorado law provisions (except to the extent applicable law, if any, provides
+otherwise), excluding its conflict-of-law provisions. You expressly agree that
+any dispute relating to this License shall be submitted to binding arbitration
+under the rules then prevailing of the American Arbitration Association. You
+further agree that Adams County, Colorado USA is proper venue and grant such
+arbitration proceeding jurisdiction as may be appropriate for purposes of
+resolving any dispute under this License. Judgement upon any award made in
+arbitration may be entered and enforced in any court of competent
+jurisdiction. The arbitrator shall award attorney`s fees and costs of
+arbitration to the prevailing party. Should either party find it necessary to
+enforce its arbitration award or seek specific performance of such award in a
+civil court of competent jurisdiction, the prevailing party shall be entitled
+to reasonable attorney`s fees and costs. The application of the United Nations
+Convention on Contracts for the International Sale of Goods is expressly
+excluded. You and Licensor expressly waive any rights to a jury trial in any
+litigation concerning Licensed Software or this License. Any law or regulation
+that provides that the language of a contract shall be construed against the
+drafter shall not apply to this License.
+
+13.9 Entire Agreement. This License constitutes the entire agreement between
+the parties with respect to the subject matter hereof.
+
+EXHIBIT A
+
+The License Notice below must appear in each file of the Source Code of any
+copy You distribute of the Licensed Software or any Extensions thereto:
+
+Unless explicitly acquired and licensed from Licensor under another
+license, the contents of this file are subject to the Reciprocal Public
+License ("RPL") Version 1.5, or subsequent versions as allowed by the RPL,
+and You may not copy or use this file in either source code or executable
+form, except in compliance with the terms and conditions of the RPL.
+
+All software distributed under the RPL is provided strictly on an "AS
+IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND
+LICENSOR HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
+LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+PURPOSE, QUIET ENJOYMENT, OR NON-INFRINGEMENT. See the RPL for specific
+language governing rights and limitations under the RPL.
+
+EXHIBIT B
+
+The User-Visible Attribution Notice below, when provided, must appear in each
+user-visible display as defined in Section 6.4 (d):
+
diff --git a/meta/files/common-licenses/RPSL-1.0 b/meta/files/common-licenses/RPSL-1.0
new file mode 100644
index 0000000..80814f9
--- /dev/null
+++ b/meta/files/common-licenses/RPSL-1.0
@@ -0,0 +1,182 @@
+
+RealNetworks Public Source License Version 1.0
+
+(Rev. Date October 28, 2002)
+
+Also available in text format.
+
+1. General Definitions. This License applies to any program or other work which RealNetworks, Inc., or any other entity that elects to use this license, ("Licensor") makes publicly available and which contains a notice placed by Licensor identifying such program or work as "Original Code" and stating that it is subject to the terms of this RealNetworks Public Source License version 1.0 (or subsequent version thereof) ("License"). You are not required to accept this License. However, nothing else grants You permission to use, copy, modify or distribute the software or its derivative works. These actions are prohibited by law if You do not accept this License. Therefore, by modifying, copying or distributing the software (or any work based on the software), You indicate your acceptance of this License to do so, and all its terms and conditions. In addition, you agree to the terms of this License by clicking the Accept button or downloading the software. As used in this License:
+
+1.1 "Applicable Patent Rights" mean: (a) in the case where Licensor is the grantor of rights, claims of patents that (i) are now or hereafter acquired, owned by or assigned to Licensor and (ii) are necessarily infringed by using or making the Original Code alone and not in combination with other software or hardware; and (b) in the case where You are the grantor of rights, claims of patents that (i) are now or hereafter acquired, owned by or assigned to You and (ii) are infringed (directly or indirectly) by using or making Your Modifications, taken alone or in combination with Original Code.
+
+1.2 "Compatible Source License" means any one of the licenses listed on Exhibit B or at https://www.helixcommunity.org/content/complicense or other licenses specifically identified by Licensor in writing. Notwithstanding any term to the contrary in any Compatible Source License, any code covered by any Compatible Source License that is used with Covered Code must be made readily available in Source Code format for royalty-free use under the terms of the Compatible Source License or this License.
+
+1.3 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.
+
+1.4 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.
+
+1.5 "Deploy" means to use, sublicense or distribute Covered Code other than for Your internal research and development (R&amp;D) and/or Personal Use, and includes without limitation, any and all internal use or distribution of Covered Code within Your business or organization except for R&amp;D use and/or Personal Use, as well as direct or indirect sublicensing or distribution of Covered Code by You to any third party in any form or manner.
+
+1.6 "Derivative Work" means either the Covered Code or any derivative work under United States copyright law, and including any work containing or including any portion of the Covered Code or Modifications, either verbatim or with modifications and/or translated into another language. Derivative Work also includes any work which combines any portion of Covered Code or Modifications with code not otherwise governed by the terms of this License.
+
+1.7 "Externally Deploy" means to Deploy the Covered Code in any way that may be accessed or used by anyone other than You, used to provide any services to anyone other than You, or used in any way to deliver any content to anyone other than You, whether the Covered Code is distributed to those parties, made available as an application intended for use over a computer network, or used to provide services or otherwise deliver content to anyone other than You.
+
+1.8. "Interface" means interfaces, functions, properties, class definitions, APIs, header files, GUIDs, V-Tables, and/or protocols allowing one piece of software, firmware or hardware to communicate or interoperate with another piece of software, firmware or hardware.
+
+1.9 "Modifications" mean any addition to, deletion from, and/or change to, the substance and/or structure of the Original Code, any previous Modifications, the combination of Original Code and any previous Modifications, and/or any respective portions thereof. When code is released as a series of files, a Modification is: (a) any addition to or deletion from the contents of a file containing Covered Code; and/or (b) any new file or other representation of computer program statements that contains any part of Covered Code.
+
+1.10 "Original Code" means (a) the Source Code of a program or other work as originally made available by Licensor under this License, including the Source Code of any updates or upgrades to such programs or works made available by Licensor under this License, and that has been expressly identified by Licensor as such in the header file(s) of such work; and (b) the object code compiled from such Source Code and originally made available by Licensor under this License.
+
+1.11 "Personal Use" means use of Covered Code by an individual solely for his or her personal, private and non-commercial purposes. An individual`s use of Covered Code in his or her capacity as an officer, employee, member, independent contractor or agent of a corporation, business or organization (commercial or non-commercial) does not qualify as Personal Use.
+
+1.12 "Source Code" means the human readable form of a program or other work that is suitable for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an executable (object code).
+
+1.13 "You" or "Your" means an individual or a legal entity exercising rights under this License. For legal entities, "You" or "Your" includes any entity which controls, is controlled by, or is under common control with, You, where "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+2. Permitted Uses; Conditions &amp; Restrictions. Subject to the terms and conditions of this License, Licensor hereby grants You, effective on the date You accept this License (via downloading or using Covered Code or otherwise indicating your acceptance of this License), a worldwide, royalty-free, non-exclusive copyright license, to the extent of Licensor`s copyrights cover the Original Code, to do the following:
+
+2.1 You may reproduce, display, perform, modify and Deploy Covered Code, provided that in each instance:
+
+(a) You must retain and reproduce in all copies of Original Code the copyright and other proprietary notices and disclaimers of Licensor as they appear in the Original Code, and keep intact all notices in the Original Code that refer to this License;
+
+(b) You must include a copy of this License with every copy of Source Code of Covered Code and documentation You distribute, and You may not offer or impose any terms on such Source Code that alter or restrict this License or the recipients` rights hereunder, except as permitted under Section 6;
+
+(c) You must duplicate, to the extent it does not already exist, the notice in Exhibit A in each file of the Source Code of all Your Modifications, and cause the modified files to carry prominent notices stating that You changed the files and the date of any change;
+
+(d) You must make Source Code of all Your Externally Deployed Modifications publicly available under the terms of this License, including the license grants set forth in Section 3 below, for as long as you Deploy the Covered Code or twelve (12) months from the date of initial Deployment, whichever is longer. You should preferably distribute the Source Code of Your Deployed Modifications electronically (e.g. download from a web site); and
+
+(e) if You Deploy Covered Code in object code, executable form only, You must include a prominent notice, in the code itself as well as in related documentation, stating that Source Code of the Covered Code is available under the terms of this License with information on how and where to obtain such Source Code. You must also include the Object Code Notice set forth in Exhibit A in the "about" box or other appropriate place where other copyright notices are placed, including any packaging materials.
+
+2.2 You expressly acknowledge and agree that although Licensor and each Contributor grants the licenses to their respective portions of the Covered Code set forth herein, no assurances are provided by Licensor or any Contributor that the Covered Code does not infringe the patent or other intellectual property rights of any other entity. Licensor and each Contributor disclaim any liability to You for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, You hereby assume sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow You to make, use, sell, import or offer for sale the Covered Code, it is Your responsibility to acquire such license(s).
+
+2.3 Subject to the terms and conditions of this License, Licensor hereby grants You, effective on the date You accept this License (via downloading or using Covered Code or otherwise indicating your acceptance of this License), a worldwide, royalty-free, perpetual, non-exclusive patent license under Licensor`s Applicable Patent Rights to make, use, sell, offer for sale and import the Covered Code, provided that in each instance you comply with the terms of this License.
+
+3. Your Grants. In consideration of, and as a condition to, the licenses granted to You under this License:
+
+(a) You grant to Licensor and all third parties a non-exclusive, perpetual, irrevocable, royalty free license under Your Applicable Patent Rights and other intellectual property rights owned or controlled by You, to make, sell, offer for sale, use, import, reproduce, display, perform, modify, distribute and Deploy Your Modifications of the same scope and extent as Licensor`s licenses under Sections 2.1 and 2.2; and
+
+(b) You grant to Licensor and its subsidiaries a non-exclusive, worldwide, royalty-free, perpetual and irrevocable license, under Your Applicable Patent Rights and other intellectual property rights owned or controlled by You, to make, use, sell, offer for sale, import, reproduce, display, perform, distribute, modify or have modified (for Licensor and/or its subsidiaries), sublicense and distribute Your Modifications, in any form and for any purpose, through multiple tiers of distribution.
+
+(c) You agree not use any information derived from Your use and review of the Covered Code, including but not limited to any algorithms or inventions that may be contained in the Covered Code, for the purpose of asserting any of Your patent rights, or assisting a third party to assert any of its patent rights, against Licensor or any Contributor.
+
+4. Derivative Works. You may create a Derivative Work by combining Covered Code with other code not otherwise governed by the terms of this License and distribute the Derivative Work as an integrated product. In each such instance, You must make sure the requirements of this License are fulfilled for the Covered Code or any portion thereof, including all Modifications.
+
+4.1 You must cause any Derivative Work that you distribute, publish or Externally Deploy, that in whole or in part contains or is derived from the Covered Code or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License and no other license except as provided in Section 4.2. You also must make Source Code available for the Derivative Work under the same terms as Modifications, described in Sections 2 and 3, above.
+
+4.2 Compatible Source Licenses. Software modules that have been independently developed without any use of Covered Code and which contain no portion of the Covered Code, Modifications or other Derivative Works, but are used or combined in any way with the Covered Code or any Derivative Work to form a larger Derivative Work, are exempt from the conditions described in Section 4.1 but only to the extent that: the software module, including any software that is linked to, integrated with, or part of the same applications as, the software module by any method must be wholly subject to one of the Compatible Source Licenses. Notwithstanding the foregoing, all Covered Code must be subject to the terms of this License. Thus, the entire Derivative Work must be licensed under a combination of the RPSL (for Covered Code) and a Compatible Source License for any independently developed software modules within the Derivative Work. The foregoing requirement applies even if the Compatible Source License would ordinarily allow the software module to link with, or form larger works with, other software that is not subject to the Compatible Source License. For example, although the Mozilla Public License v1.1 allows Mozilla code to be combined with proprietary software that is not subject to the MPL, if MPL-licensed code is used with Covered Code the MPL-licensed code could not be combined or linked with any code not governed by the MPL. The general intent of this section 4.2 is to enable use of Covered Code with applications that are wholly subject to an acceptable open source license. You are responsible for determining whether your use of software with Covered Code is allowed under Your license to such software.
+
+4.3 Mere aggregation of another work not based on the Covered Code with the Covered Code (or with a work based on the Covered Code) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. If You deliver the Covered Code for combination and/or integration with an application previously provided by You (for example, via automatic updating technology), such combination and/or integration constitutes a Derivative Work subject to the terms of this License.
+
+5. Exclusions From License Grant. Nothing in this License shall be deemed to grant any rights to trademarks, copyrights, patents, trade secrets or any other intellectual property of Licensor or any Contributor except as expressly stated herein. No right is granted to the trademarks of Licensor or any Contributor even if such marks are included in the Covered Code. Nothing in this License shall be interpreted to prohibit Licensor from licensing under different terms from this License any code that Licensor otherwise would have a right to license. Modifications, Derivative Works and/or any use or combination of Covered Code with other technology provided by Licensor or third parties may require additional patent licenses from Licensor which Licensor may grant in its sole discretion. No patent license is granted separate from the Original Code or combinations of the Original Code with other software or hardware.
+
+5.1. Trademarks. This License does not grant any rights to use the trademarks or trade names owned by Licensor ("Licensor Marks" defined in Exhibit C) or to any trademark or trade name belonging to any Contributor. No Licensor Marks may be used to endorse or promote products derived from the Original Code other than as permitted by the Licensor Trademark Policy defined in Exhibit C.
+
+6. Additional Terms. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with the scope of the license granted herein ("Additional Terms") to one or more recipients of Covered Code. However, You may do so only on Your own behalf and as Your sole responsibility, and not on behalf of Licensor or any Contributor. You must obtain the recipient`s agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold Licensor and every Contributor harmless for any liability incurred by or claims asserted against Licensor or such Contributor by reason of any such Additional Terms.
+
+7. Versions of the License. Licensor may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Once Original Code has been published under a particular version of this License, You may continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of this License published by Licensor. No one other than Licensor has the right to modify the terms applicable to Covered Code created under this License.
+
+8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part pre-release, untested, or not fully tested works. The Covered Code may contain errors that could cause failures or loss of data, and may be incomplete or contain inaccuracies. You expressly acknowledge and agree that use of the Covered Code, or any portion thereof, is at Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND LICENSOR AND LICENSOR`S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "LICENSOR" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. LICENSOR AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR WRITTEN DOCUMENTATION, INFORMATION OR ADVICE GIVEN BY LICENSOR, A LICENSOR AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge that the Covered Code is not intended for use in high risk activities, including, but not limited to, the design, construction, operation or maintenance of nuclear facilities, aircraft navigation, aircraft communication systems, or air traffic control machines in which case the failure of the Covered Code could lead to death, personal injury, or severe physical or environmental damage. Licensor disclaims any express or implied warranty of fitness for such uses.
+
+9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL LICENSOR OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE OR STRICT LIABILITY), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF LICENSOR OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Licensor`s total liability to You for all damages (other than as may be required by applicable law) under this License exceed the amount of ten dollars ($10.00).
+
+10. Ownership. Subject to the licenses granted under this License, each Contributor retains all rights, title and interest in and to any Modifications made by such Contributor. Licensor retains all rights, title and interest in and to the Original Code and any Modifications made by or on behalf of Licensor ("Licensor Modifications"), and such Licensor Modifications will not be automatically subject to this License. Licensor may, at its sole discretion, choose to license such Licensor Modifications under this License, or on different terms from those contained in this License or may choose not to license them at all.
+
+11. Termination.
+
+11.1 Term and Termination. The term of this License is perpetual unless terminated as provided below. This License and the rights granted hereunder will terminate:
+
+(a) automatically without notice from Licensor if You fail to comply with any term(s) of this License and fail to cure such breach within 30 days of becoming aware of such breach;
+
+(b) immediately in the event of the circumstances described in Section 12.5(b); or
+
+(c) automatically without notice from Licensor if You, at any time during the term of this License, commence an action for patent infringement against Licensor (including by cross-claim or counter claim in a lawsuit);
+
+(d) upon written notice from Licensor if You, at any time during the term of this License, commence an action for patent infringement against any third party alleging that the Covered Code itself (excluding combinations with other software or hardware) infringes any patent (including by cross-claim or counter claim in a lawsuit).
+
+11.2 Effect of Termination. Upon termination, You agree to immediately stop any further use, reproduction, modification, sublicensing and distribution of the Covered Code and to destroy all copies of the Covered Code that are in your possession or control. All sublicenses to the Covered Code which have been properly granted prior to termination shall survive any termination of this License. Provisions which, by their nature, should remain in effect beyond the termination of this License shall survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for compensation, indemnity or damages of any sort solely as a result of terminating this License in accordance with its terms, and termination of this License will be without prejudice to any other right or remedy of any party.
+
+12. Miscellaneous.
+
+12.1 Government End Users. The Covered Code is a "commercial item" as defined in FAR 2.101. Government software and technical data rights in the Covered Code include only those rights customarily provided to the public as defined in this License. This customary commercial license in technical data and software is provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software or Computer Software Documentation). Accordingly, all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+12.2 Relationship of Parties. This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between or among You, Licensor or any Contributor, and You will not represent to the contrary, whether expressly, by implication, appearance or otherwise.
+
+12.3 Independent Development. Nothing in this License will impair Licensor`s right to acquire, license, develop, have others develop for it, market and/or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Derivative Works, technology or products that You may develop, produce, market or distribute.
+
+12.4 Waiver; Construction. Failure by Licensor or any Contributor to enforce any provision of this License will not be deemed a waiver of future enforcement of that or any other provision. Any law or regulation which provides that the language of a contract shall be construed against the drafter will not apply to this License.
+
+12.5 Severability. (a) If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and effect. (b) Notwithstanding the foregoing, if applicable law prohibits or restricts You from fully and/or specifically complying with Sections 2 and/or 3 or prevents the enforceability of either of those Sections, this License will immediately terminate and You must immediately discontinue any use of the Covered Code and destroy all copies of it that are in your possession or control.
+
+12.6 Dispute Resolution. Any litigation or other dispute resolution between You and Licensor relating to this License shall take place in the Seattle, Washington, and You and Licensor hereby consent to the personal jurisdiction of, and venue in, the state and federal courts within that District with respect to this License. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.
+
+12.7 Export/Import Laws. This software is subject to all export and import laws and restrictions and regulations of the country in which you receive the Covered Code and You are solely responsible for ensuring that You do not export, re-export or import the Covered Code or any direct product thereof in violation of any such restrictions, laws or regulations, or without all necessary authorizations.
+
+12.8 Entire Agreement; Governing Law. This License constitutes the entire agreement between the parties with respect to the subject matter hereof. This License shall be governed by the laws of the United States and the State of Washington.
+
+Where You are located in the province of Quebec, Canada, the following clause applies: The parties hereby confirm that they have requested that this License and all related documents be drafted in English. Les parties ont exig&#233; que le pr&#233;sent contrat et tous les documents connexes soient r&#233;dig&#233;s en anglais.
+
+
+EXHIBIT A.
+
+"Copyright &#169; 1995-2002 RealNetworks, Inc. and/or its licensors. All Rights Reserved.
+
+The contents of this file, and the files included with this file, are subject to the current version of the RealNetworks Public Source License Version 1.0 (the "RPSL") available at https://www.helixcommunity.org/content/rpsl unless you have licensed the file under the RealNetworks Community Source License Version 1.0 (the "RCSL") available at https://www.helixcommunity.org/content/rcsl, in which case the RCSL will apply. You may also obtain the license terms directly from RealNetworks. You may not use this file except in compliance with the RPSL or, if you have a valid RCSL with RealNetworks applicable to this file, the RCSL. Please see the applicable RPSL or RCSL for the rights, obligations and limitations governing use of the contents of the file.
+
+This file is part of the Helix DNA Technology. RealNetworks is the developer of the Original code and owns the copyrights in the portions it created.
+
+This file, and the files included with this file, is distributed and made available on an `AS IS` basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+
+Contributor(s): ____________________________________
+
+Technology Compatibility Kit Test Suite(s) Location (if licensed under the RCSL):
+
+________________________________"
+
+Object Code Notice: Helix DNA Client technology included. Copyright &#169; RealNetworks, Inc., 1995-2002. All rights reserved.
+
+EXHIBIT B
+
+Compatible Source Licenses for the RealNetworks Public Source License. The following list applies to the most recent version of the license as of October 25, 2002, unless otherwise indicated.
+
+Academic Free License
+Apache Software License
+Apple Public Source License
+Artistic license
+Attribution Assurance Licenses
+BSD license
+Common Public License1
+Eiffel Forum License
+GNU General Public License (GPL)1
+GNU Library or "Lesser" General Public License (LGPL)1
+IBM Public License
+Intel Open Source License
+Jabber Open Source License
+MIT license
+MITRE Collaborative Virtual Workspace License (CVW License)
+Motosoto License
+Mozilla Public License 1.0 (MPL)
+Mozilla Public License 1.1 (MPL)
+Nokia Open Source License
+Open Group Test Suite License
+Python Software Foundation License
+Ricoh Source Code Public License
+Sun Industry Standards Source License (SISSL)
+Sun Public License
+University of Illinois/NCSA Open Source License
+Vovida Software License v. 1.0
+W3C License
+X.Net License
+Zope Public License
+zlib/libpng license
+1Note: because this license contains certain reciprocal licensing terms that purport to extend to independently developed code, You may be prohibited under the terms of this otherwise compatible license from using code licensed under its terms with Covered Code because Covered Code may only be licensed under the RealNetworks Public Source License. Any attempt to apply non RPSL license terms, including without limitation the GPL, to Covered Code is expressly forbidden. You are responsible for ensuring that Your use of Compatible Source Licensed code does not violate either the RPSL or the Compatible Source License.
+
+The latest version of this list can be found at: https://www.helixcommunity.org/content/complicense
+
+EXHIBIT C
+
+RealNetworks` Trademark policy.
+
+RealNetworks defines the following trademarks collectively as "Licensor Trademarks": "RealNetworks", "RealPlayer", "RealJukebox", "RealSystem", "RealAudio", "RealVideo", "RealOne Player", "RealMedia", "Helix" or any other trademarks or trade names belonging to RealNetworks.
+
+RealNetworks "Licensor Trademark Policy" forbids any use of Licensor Trademarks except as permitted by and in strict compliance at all times with RealNetworks` third party trademark usage guidelines which are posted at www.realnetworks.com/info/helixlogo.html.
+
diff --git a/meta/files/common-licenses/RSCPL b/meta/files/common-licenses/RSCPL
new file mode 100644
index 0000000..bedbbc1
--- /dev/null
+++ b/meta/files/common-licenses/RSCPL
@@ -0,0 +1,193 @@
+
+Ricoh Source Code Public License
+
+Version 1.0
+
+
+1. Definitions.
+
+
+1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications.
+
+
+1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+
+1.3. "Electronic Distribution Mechanism" means a website or any other mechanism generally accepted in the software development community for the electronic transfer of data.
+
+
+1.4. "Executable Code" means Governed Code in any form other than Source Code.
+
+
+1.5. "Governed Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+
+1.6. "Larger Work" means a work which combines Governed Code or portions thereof with code not governed by the terms of this License.
+
+
+1.7. "Licensable" means the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+
+1.8. "License" means this document.
+
+
+1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Governed Code is released as a series of files, a Modification is:
+
+
+(a) Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+
+(b) Any new file that contains any part of the Original Code or previous Modifications.
+
+
+
+1.10. "Original Code" means the "Platform for Information Applications" Source Code as released under this License by RSV.
+
+
+1.11 "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by the grantor of a license thereto.
+
+1.12. "RSV" means Ricoh Silicon Valley, Inc., a California corporation with offices at 2882 Sand Hill Road, Suite 115, Menlo Park, CA 94025-7022.
+
+1.13. "Source Code" means the preferred form of the Governed Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of Executable Code, or a list of source code differential comparisons against either the Original Code or another well known, available Governed Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+
+1.14. "You" means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+
+
+2. Source Code License.
+
+2.1. Grant from RSV. RSV hereby grants You a worldwide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+
+(a) to use, reproduce, modify, create derivative works of, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, or as part of a Larger Work; and
+
+(b) under Patent Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+
+
+
+2.2. Contributor Grant. Each Contributor hereby grants You a worldwide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+
+
+(a) to use, reproduce, modify, create derivative works of, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Governed Code or as part of a Larger Work; and
+
+(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: (i) Modifications made by that Contributor (or portions thereof); and (ii) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+
+
+3. Distribution Obligations.
+
+
+
+3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Governed Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+
+
+3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable Code version or via an Electronic Distribution Mechanism to anyone to whom you made an Executable Code version available; and if made available via an Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+
+3.3. Description of Modifications. You must cause all Governed Code to which you contribute to contain a file documenting the changes You made to create that Governed Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by RSV and including the name of RSV in (a) the Source Code, and (b) in any notice in an Executable Code version or related documentation in which You describe the origin or ownership of the Governed Code.
+
+
+3.4. Intellectual Property Matters.
+
+3.4.1. Third Party Claims. If You have knowledge that a party claims an intellectual property right in particular functionality or code (or its utilization under this License), you must include a text file with the source code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If you obtain such knowledge after You make Your Modification available as described in Section 3.2, You shall promptly modify the LEGAL file in all copies You make available thereafter and shall take other steps (such as notifying RSV and appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Governed Code that new knowledge has been obtained. In the event that You are a Contributor, You represent that, except as disclosed in the LEGAL file, your Modifications are your original creations and, to the best of your knowledge, no third party has any claim (including but not limited to intellectual property claims) relating to your Modifications. You represent that the LEGAL file includes complete details of any license or other restriction associated with any part of your Modifications.
+
+3.4.2. Contributor APIs. If Your Modification is an application programming interface and You own or control patents which are reasonably necessary to implement that API, you must also include this information in the LEGAL file.
+
+
+3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code, and this License in any documentation for the Source Code, where You describe recipients` rights relating to Governed Code. If You created one or more Modification(s), You may add your name as a Contributor to the notice described in Exhibit A. If it is not possible to put such notice in a particular Source Code file due to its structure, then you must include such notice in a location (such as a relevant directory file) where a user would be likely to look for such a notice. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Governed Code. However, You may do so only on Your own behalf, and not on behalf of RSV or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify RSV and every Contributor for any liability incurred by RSV or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+
+3.6. Distribution of Executable Code Versions. You may distribute Governed Code in Executable Code form only if the requirements of Section 3.1-3.5 have been met for that Governed Code, and if You include a prominent notice stating that the Source Code version of the Governed Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable Code version, related documentation or collateral in which You describe recipients` rights relating to the Governed Code. You may distribute the Executable Code version of Governed Code under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable Code version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable Code version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by RSV or any Contributor. You hereby agree to indemnify RSV and every Contributor for any liability incurred by RSV or such Contributor as a result of any such terms You offer.
+
+
+3.7. Larger Works. You may create a Larger Work by combining Governed Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Governed Code.
+
+
+4. Inability to Comply Due to Statute or Regulation.
+
+If it is impossible for You to comply with any of theterms of this License with respect to some or all of the Governed Code due to statute or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+
+5. Trademark Usage.
+
+
+
+5.1. Advertising Materials. All advertising materials mentioning features or use of the Governed Code must display the following acknowledgement: "This product includes software developed by Ricoh Silicon Valley, Inc."
+
+
+5.2. Endorsements. The names "Ricoh," "Ricoh Silicon Valley," and "RSV" must not be used to endorse or promote Contributor Versions or Larger Works without the prior written permission of RSV.
+
+
+5.3. Product Names. Contributor Versions and Larger Works may not be called "Ricoh" nor may the word "Ricoh" appear in their names without the prior written permission of RSV.
+
+
+6. Versions of the License.
+
+
+
+6.1. New Versions. RSV may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+
+
+6.2. Effect of New Versions. Once Governed Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Governed Code under the terms of any subsequent version of the License published by RSV. No one other than RSV has the right to modify the terms applicable to Governed Code created under this License.
+
+
+7. Disclaimer of Warranty.
+
+GOVERNED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE GOVERNED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE GOVERNED CODE IS WITH YOU. SHOULD ANY GOVERNED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT RSV OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY GOVERNED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+
+8. Termination.
+
+
+
+8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Governed Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+
+
+8.2. If You initiate patent infringement litigation against RSV or a Contributor (RSV or the Contributor against whom You file such action is referred to as "Participant") alleging that:
+
+
+(a) such Participant`s Original Code or Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of the Original Code or the Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Original Code or the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+
+(b) any software, hardware, or device provided to You by the Participant, other than such Participant`s Original Code or Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Original Code or the Modifications made by that Participant.
+
+
+
+8.3. If You assert a patent infringement claim against Participant alleging that such Participant`s Original Code or Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+
+
+9. Limitation of Liability.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL RSV, ANY CONTRIBUTOR, OR ANY DISTRIBUTOR OF GOVERNED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THAT EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. TO THE EXTENT THAT ANY EXCLUSION OF DAMAGES ABOVE IS NOT VALID, YOU AGREE THAT IN NO EVENT WILL RSVS LIABILITY UNDER OR RELATED TO THIS AGREEMENT EXCEED FIVE THOUSAND DOLLARS ($5,000). THE GOVERNED CODE IS NOT INTENDED FOR USE IN CONNECTION WITH ANY NUCLER, AVIATION, MASS TRANSIT OR MEDICAL APPLICATION OR ANY OTHER INHERENTLY DANGEROUS APPLICATION THAT COULD RESULT IN DEATH, PERSONAL INJURY, CATASTROPHIC DAMAGE OR MASS DESTRUCTION, AND YOU AGREE THAT NEITHER RSV NOR ANY CONTRIBUTOR SHALL HAVE ANY LIABILITY OF ANY NATURE AS A RESULT OF ANY SUCH USE OF THE GOVERNED CODE.
+
+
+10. U.S. Government End Users.
+
+The Governed Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Governed Code with only those rights set forth herein.
+
+
+11. Miscellaneous.
+
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. The parties submit to personal jurisdiction in California and further agree that any cause of action arising under or related to this Agreement shall be brought in the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California. The losing party shall be responsible for costs, including without limitation, court costs and reasonable attorneys fees and expenses. Notwithstanding anything to the contrary herein, RSV may seek injunctive relief related to a breach of this Agreement in any court of competent jurisdiction. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+
+12. Responsibility for Claims.
+
+Except in cases where another Contributor has failed to comply with Section 3.4, You are responsible for damages arising, directly or indirectly, out of Your utilization of rights under this License, based on the number of copies of Governed Code you made available, the revenues you received from utilizing such rights, and other relevant factors. You agree to work with affected parties to distribute responsibility on an equitable basis.
+
+
+
+ 
+
+EXHIBIT A
+
+"The contents of this file are subject to the Ricoh Source Code Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.risource.org/RPL
+
+Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
+
+This code was initially developed by Ricoh Silicon Valley, Inc. Portions created by Ricoh Silicon Valley, Inc. are Copyright (C) 1995-1999. All Rights Reserved.
+
+Contributor(s): ______________________________________."
+
diff --git a/meta/files/common-licenses/Ruby b/meta/files/common-licenses/Ruby
new file mode 100644
index 0000000..bc2e57f
--- /dev/null
+++ b/meta/files/common-licenses/Ruby
@@ -0,0 +1,60 @@
+
+Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.co.jp>.
+You can redistribute it and/or modify it under either the terms of the GPL
+(see COPYING.txt file), or the conditions below:
+
+  1. You may make and give away verbatim copies of the source form of the
+     software without restriction, provided that you duplicate all of the
+     original copyright notices and associated disclaimers.
+
+  2. You may modify your copy of the software in any way, provided that
+     you do at least ONE of the following:
+
+       a) place your modifications in the Public Domain or otherwise
+          make them Freely Available, such as by posting said
+   modifications to Usenet or an equivalent medium, or by allowing
+   the author to include your modifications in the software.
+
+       b) use the modified software only within your corporation or
+          organization.
+
+       c) rename any non-standard executables so the names do not conflict
+   with standard executables, which must also be provided.
+
+       d) make other distribution arrangements with the author.
+
+  3. You may distribute the software in object code or executable
+     form, provided that you do at least ONE of the following:
+
+       a) distribute the executables and library files of the software,
+   together with instructions (in the manual page or equivalent)
+   on where to get the original distribution.
+
+       b) accompany the distribution with the machine-readable source of
+   the software.
+
+       c) give non-standard executables non-standard names, with
+          instructions on where to get the original software distribution.
+
+       d) make other distribution arrangements with the author.
+
+  4. You may modify and include the part of the software into any other
+     software (possibly commercial).  But some files in the distribution
+     are not written by the author, so that they are not under this terms.
+
+     They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some
+     files under the ./missing directory.  See each file for the copying
+     condition.
+
+  5. The scripts and library files supplied as input to or produced as 
+     output from the software do not automatically fall under the
+     copyright of the software, but belong to whomever generated them, 
+     and may be sold commercially, and may be aggregated with this
+     software.
+
+  6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+     IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+     PURPOSE.
+
+
diff --git a/meta/files/common-licenses/SAX-PD b/meta/files/common-licenses/SAX-PD
new file mode 100644
index 0000000..a1fd113
--- /dev/null
+++ b/meta/files/common-licenses/SAX-PD
@@ -0,0 +1,33 @@
+
+Copyright Status for SAX
+
+SAX is free!
+
+In fact, it`s not possible to own a license to SAX, since it`s been placed in the public domain.
+
+No Warranty
+
+Because SAX is released to the public domain, there is no warranty for the design or for the software implementation, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide SAX "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 SAX is with you. Should SAX prove defective, you assume the cost of all necessary servicing, repair or correction.
+
+In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who may modify and/or redistribute SAX, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use SAX (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 SAX to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages.
+
+Copyright Disclaimers
+
+This page includes statements to that effect by David Megginson, who would have been able to claim copyright for the original work.
+
+SAX 1.0
+
+Version 1.0 of the Simple API for XML (SAX), created collectively by the membership of the XML-DEV mailing list, is hereby released into the public domain.
+
+No one owns SAX: you may use it freely in both commercial and non-commercial applications, bundle it with your software distribution, include it on a CD-ROM, list the source code in a book, mirror the documentation at your own web site, or use it in any other way you see fit.
+
+David Megginson, Megginson Technologies Ltd.
+1998-05-11
+
+SAX 2.0
+
+I hereby abandon any property rights to SAX 2.0 (the Simple API for XML), and release all of the SAX 2.0 source code, compiled code, and documentation contained in this distribution into the Public Domain. SAX comes with NO WARRANTY or guarantee of fitness for any purpose.
+
+David Megginson, Megginson Technologies Ltd.
+2000-05-05
+
diff --git a/meta/files/common-licenses/SGI-1 b/meta/files/common-licenses/SGI-1
new file mode 100644
index 0000000..e399856
--- /dev/null
+++ b/meta/files/common-licenses/SGI-1
@@ -0,0 +1,36 @@
+/*
+ * (c) Copyright 1993, Silicon Graphics, Inc.
+ * ALL RIGHTS RESERVED 
+ * Permission to use, copy, modify, and distribute this software for 
+ * any purpose and without fee is hereby granted, provided that the above
+ * copyright notice appear in all copies and that both the copyright notice
+ * and this permission notice appear in supporting documentation, and that 
+ * the name of Silicon Graphics, Inc. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission. 
+ *
+ * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
+ * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
+ * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
+ * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
+ * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
+ * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
+ * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
+ * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
+ * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
+ * 
+ * US Government Users Restricted Rights 
+ * Use, duplication, or disclosure by the Government is subject to
+ * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
+ * (c)(1)(ii) of the Rights in Technical Data and Computer Software
+ * clause at DFARS 252.227-7013 and/or in similar or successor
+ * clauses in the FAR or the DOD or NASA FAR Supplement.
+ * Unpublished-- rights reserved under the copyright laws of the
+ * United States.  Contractor/manufacturer is Silicon Graphics,
+ * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
+ *
+ * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
+ */
diff --git a/meta/files/common-licenses/SMAIL_GPL b/meta/files/common-licenses/SMAIL_GPL
new file mode 100644
index 0000000..dfc3fd1
--- /dev/null
+++ b/meta/files/common-licenses/SMAIL_GPL
@@ -0,0 +1,164 @@
+This is the Debian GNU/Linux package debianutils.
+
+It is an original Debian package.  Programs in it were maintained by
+Guy Maor <maor@debian.org>, and are now maintained by Clint Adams
+<schizo@debian.org>.
+
+All its programs except readlink, savelog, and which may be
+redistributed under the terms of the GNU GPL, Version 2 or later,
+found on Debian systems in the file /usr/share/common-licenses/GPL.
+
+which is in the public domain.
+
+readlink is Copyright (c) 1997 Kenneth Stailey, and may also be
+distributed under the terms of the BSD copyright.
+
+savelog may be redistributed under the following terms: (The rest of
+this file consists of savelog's distribution terms.)
+
+#ident	"@(#)smail:RELEASE-3_2:COPYING,v 1.2 1996/06/14 18:59:10 woods Exp"
+
+		     SMAIL GENERAL PUBLIC LICENSE
+		       (Clarified 11 Feb 1988)
+
+ Copyright (C)  1988 Landon Curt Noll & Ronald S. Karr
+ Copyright (C)  1992 Ronald S. Karr
+ Copyleft (GNU) 1988 Landon Curt Noll & Ronald S. Karr
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license, but changing it is not allowed.  You can also
+ use this wording to make the terms for other programs.
+
+  The license agreements of most software companies keep you at the
+mercy of those companies.  By contrast, our general public license is
+intended to give everyone the right to share SMAIL.  To make sure that
+you get the rights we want you to have, we need to make restrictions
+that forbid anyone to deny you these rights or to ask you to surrender
+the rights.  Hence this license agreement.
+
+  Specifically, we want to make sure that you have the right to give
+away copies of SMAIL, that you receive source code or else can get it
+if you want it, that you can change SMAIL or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To make sure that everyone has such rights, we have to forbid you to
+deprive anyone else of these rights.  For example, if you distribute
+copies of SMAIL, you must give the recipients all the rights that you
+have.  You must make sure that they, too, receive or can get the
+source code.  And you must tell them their rights.
+
+  Also, for our own protection, we must make certain that everyone
+finds out that there is no warranty for SMAIL.  If SMAIL is modified by
+someone else and passed on, we want its recipients to know that what
+they have is not what we distributed, so that any problems introduced
+by others will not reflect on our reputation.
+
+  Therefore we (Landon Curt Noll and Ronald S. Karr) make the following 
+terms which say what you must do to be allowed to distribute or change 
+SMAIL.
+
+
+			COPYING POLICIES
+
+  1. You may copy and distribute verbatim copies of SMAIL source code
+as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy a valid copyright notice "Copyright
+(C) 1988 Landon Curt Noll & Ronald S. Karr" (or with whatever year is
+appropriate); keep intact the notices on all files that refer to this
+License Agreement and to the absence of any warranty; and give any
+other recipients of the SMAIL program a copy of this License
+Agreement along with the program.  You may charge a distribution fee
+for the physical act of transferring a copy.
+
+  2. You may modify your copy or copies of SMAIL or any portion of it,
+and copy and distribute such modifications under the terms of
+Paragraph 1 above, provided that you also do the following:
+
+    a) cause the modified files to carry prominent notices stating
+    that you changed the files and the date of any change; and
+
+    b) cause the whole of any work that you distribute or publish,
+    that in whole or in part contains or is a derivative of SMAIL or
+    any part thereof, to be licensed at no charge to all third
+    parties on terms identical to those contained in this License
+    Agreement (except that you may choose to grant more extensive
+    warranty protection to some or all third parties, at your option).
+
+    c) You may charge a distribution fee for the physical act of
+    transferring a copy, and you may at your option offer warranty
+    protection in exchange for a fee.
+
+Mere aggregation of another unrelated program with this program (or its
+derivative) on a volume of a storage or distribution medium does not bring
+the other program under the scope of these terms.
+
+  3. You may copy and distribute SMAIL (or a portion or derivative of it,
+under Paragraph 2) in object code or executable form under the terms of
+Paragraphs 1 and 2 above provided that you also do one of the following:
+
+    a) accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of
+    Paragraphs 1 and 2 above; or,
+
+    b) accompany it with a written offer, valid for at least three
+    years, to give any third party free (except for a nominal
+    shipping charge) a complete machine-readable copy of the
+    corresponding source code, to be distributed under the terms of
+    Paragraphs 1 and 2 above; or,
+
+    c) accompany it with the information you received as to where the
+    corresponding source code may be obtained.  (This alternative is
+    allowed only for non-commercial distribution and only if you
+    received the program in object code or executable form alone.)
+
+For an executable file, complete source code means all the source code for
+all modules it contains; but, as a special exception, it need not include
+source code for modules which are standard libraries that accompany the
+operating system on which the executable file runs.
+
+  4. You may not copy, sublicense, distribute or transfer SMAIL
+except as expressly provided under this License Agreement.  Any attempt
+otherwise to copy, sublicense, distribute or transfer SMAIL is void and
+your rights to use the program under this License agreement shall be
+automatically terminated.  However, parties who have received computer
+software programs from you with this License Agreement will not have
+their licenses terminated so long as such parties remain in full compliance.
+
+  5. If you wish to incorporate parts of SMAIL into other free
+programs whose distribution conditions are different, write to Landon
+Curt Noll & Ronald S. Karr via the Free Software Foundation at 51
+Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.  We have not yet
+worked out a simple rule that can be stated here, but we will often
+permit this.  We will be guided by the two goals of preserving the
+free status of all derivatives of our free software and of promoting
+the sharing and reuse of software.
+
+Your comments and suggestions about our licensing policies and our
+software are welcome!  This contract was based on the contract made by
+the Free Software Foundation.  Please contact the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
+USA, or call (617) 542-5942 for details on copylefted material in
+general.
+
+		       NO WARRANTY
+
+  BECAUSE SMAIL IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY NO
+WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING, LANDON CURT NOLL & RONALD S. KARR AND/OR
+OTHER PARTIES PROVIDE SMAIL "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 SMAIL IS WITH
+YOU.  SHOULD SMAIL PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
+NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL LANDON CURT NOLL &
+RONALD S. KARR AND/OR ANY OTHER PARTY WHO MAY MODIFY AND REDISTRIBUTE
+SMAIL AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE
+(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED
+INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE
+PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) SMAIL, EVEN IF YOU HAVE
+BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR FOR ANY CLAIM BY
+ANY OTHER PARTY.
diff --git a/meta/files/common-licenses/SPL-1.0 b/meta/files/common-licenses/SPL-1.0
new file mode 100644
index 0000000..2848b36
--- /dev/null
+++ b/meta/files/common-licenses/SPL-1.0
@@ -0,0 +1,507 @@
+
+SUN PUBLIC LICENSE Version 1.0
+
+1. Definitions.
+
+1.0.1. "Commercial Use" means distribution or otherwise making the
+Covered Code available to a third party.
+
+1.1. "Contributor" means each entity that creates or contributes to
+the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the Original Code,
+prior Modifications used by a Contributor, and the Modifications made
+by that particular Contributor.
+
+1.3. "Covered Code" means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case
+including portions thereof and corresponding documentation released
+with the source code.
+
+1.4. "Electronic Distribution Mechanism" means a mechanism generally
+accepted in the software development community for the electronic
+transfer of data.
+
+1.5. "Executable" means Covered Code in any form other than Source
+Code.
+
+1.6. "Initial Developer" means the individual or entity identified as
+the Initial Developer in the Source Code notice required by Exhibit
+A.
+
+1.7. "Larger Work" means a work which combines Covered Code or
+portions thereof with code not governed by the terms of this
+License.
+
+1.8. "License" means this document.
+
+1.8.1. "Licensable" means having the right to grant, to the maximum
+extent possible, whether at the time of the initial grant or
+subsequently acquired, any and all of the rights conveyed herein.
+
+1.9. "Modifications" means any addition to or deletion from the
+substance or structure of either the Original Code or any previous
+Modifications. When Covered Code is released as a series of files, a
+Modification is:
+
+A. Any addition to or deletion from the contents of a file containing
+Original Code or previous Modifications.
+
+B. Any new file that contains any part of the Original Code or
+previous Modifications.
+
+1.10. "Original Code"../ means Source Code of computer software code
+which is described in the Source Code notice required by Exhibit A as
+Original Code, and which, at the time of its release under this
+License is not already Covered Code governed by this License.
+
+1.10.1. "Patent Claims" means any patent claim(s), now owned or
+hereafter acquired, including without limitation, method, process, and
+apparatus claims, in any patent Licensable by grantor.
+
+1.11. "Source Code"../ means the preferred form of the Covered Code
+for
+making modifications to it, including all modules it contains, plus
+any associated documentation, interface definition files, scripts used
+to control compilation and installation of an Executable, or source
+code differential comparisons against either the Original Code or
+another well known, available Covered Code of the Contributor`s
+choice. The Source Code can be in a compressed or archival form,
+provided the appropriate decompression or de-archiving software is
+widely available for no charge.
+
+1.12. "You" (or "Your") means an individual or a legal entity
+exercising rights under, and complying with all of the terms of, this
+License or a future version of this License issued under Section 6.1.
+For legal entities, "You" includes any entity which controls, is
+controlled by, or is under common control with You. For purposes of
+this definition, "control"../ means (a) the power, direct or indirect,
+to
+cause the direction or management of such entity, whether by contract
+or otherwise, or (b) ownership of more than fifty percent (50%) of the
+outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+
+2.1 The Initial Developer Grant.
+
+The Initial Developer hereby grants You a world-wide, royalty-free,
+non-exclusive license, subject to third party intellectual property
+claims:
+
+(a) under intellectual property rights (other than patent or
+trademark) Licensable by Initial Developer to use, reproduce, modify,
+display, perform, sublicense and distribute the Original Code (or
+portions thereof) with or without Modifications, and/or as part of a
+Larger Work; and
+
+(b) under Patent Claims infringed by the making, using or selling of
+Original Code, to make, have made, use, practice, sell, and offer for
+sale, and/or otherwise dispose of the Original Code (or portions
+thereof).
+
+(c) the licenses granted in this Section 2.1(a) and (b) are effective
+on the date Initial Developer first distributes Original Code under
+the terms of this License.
+
+(d) Notwithstanding Section 2.1(b) above, no patent license is
+granted: 1) for code that You delete from the Original Code; 2)
+separate from the Original Code; or 3) for infringements caused
+by:
+
+i) the modification of the Original Code or ii) the combination of the
+Original Code with other software or devices.
+
+2.2. Contributor Grant.
+
+Subject to third party intellectual property claims, each Contributor
+hereby grants You a world-wide, royalty-free, non-exclusive license
+
+(a) under intellectual property rights (other than patent
+or
+trademark) Licensable by Contributor, to use, reproduce, modify,
+display, perform, sublicense and distribute the Modifications created
+by such Contributor (or portions thereof) either on an unmodified
+basis, with other Modifications, as Covered Code and/or as part of a
+Larger Work; and
+
+b) under Patent Claims infringed by the making, using, or selling of
+Modifications made by that Contributor either alone and/or in
+combination with its Contributor Version (or portions of such
+combination), to make, use, sell, offer for sale, have made, and/or
+otherwise dispose of: 1) Modifications made by that Contributor (or
+portions thereof); and 2) the combination of Modifications made by
+that Contributor with its Contributor Version (or portions of such
+combination).
+
+(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective
+on the date Contributor first makes Commercial Use of the Covered
+Code.
+
+(d) notwithstanding Section 2.2(b) above, no patent license is
+granted: 1) for any code that Contributor has deleted from the
+Contributor Version; 2) separate from the Contributor Version; 3) for
+infringements caused by: i) third party modifications of Contributor
+Version or ii) the combination of Modifications made by that
+Contributor with other software (except as part of the Contributor
+Version) or other devices; or 4) under Patent Claims infringed by
+Covered Code in the absence of Modifications made by that
+Contributor.
+
+3. Distribution Obligations.
+
+3.1. Application of License.
+
+The Modifications which You create or to which You contribute are
+governed by the terms of this License, including without limitation
+Section 2.2. The Source Code version of Covered Code may be
+distributed only under the terms of this License or a future version
+of this License released under Section 6.1, and You must include a
+copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code
+version that alters or restricts the applicable version of this
+License or the recipients` rights hereunder. However, You may include
+an additional document offering the additional rights described in
+Section 3.5.
+
+3.2. Availability of Source Code.
+
+Any Modification which You create or to which You contribute must be
+made available in Source Code form under the terms of this License
+either on the same media as an Executable version or via an accepted
+Electronic Distribution Mechanism to anyone to whom you made an
+Executable version available; and if made available via Electronic
+Distribution Mechanism, must remain available for at least twelve (12)
+months after the date it initially became available, or at least six
+(6) months after a subsequent version of that particular Modification
+has been made available to such recipients. You are responsible for
+ensuring that the Source Code version remains available even if the
+Electronic Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+
+You must cause all Covered Code to which You contribute to contain a
+file documenting the changes You made to create that Covered Code and
+the date of any change. You must include a prominent statement that
+the Modification is derived, directly or indirectly, from Original
+Code provided by the Initial Developer and including the name of the
+Initial Developer in (a) the Source Code, and (b) in any notice in an
+Executable version or related documentation in which You describe the
+origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters.
+
+(a) Third Party Claims.
+
+If Contributor has knowledge that a license under a third party`s
+intellectual property rights is required to exercise the rights
+granted by such Contributor under Sections 2.1 or 2.2, Contributor
+must include a text file with the Source Code distribution titled
+"../LEGAL`` which describes the claim and the party making the claim in
+sufficient detail that a recipient will know whom to contact. If
+Contributor obtains such knowledge after the Modification is made
+available as described in Section 3.2, Contributor shall promptly
+modify the LEGAL file in all copies Contributor makes available
+thereafter and shall take other steps (such as notifying appropriate
+mailing lists or newsgroups) reasonably calculated to inform those who
+received the Covered Code that new knowledge has been obtained.
+
+(b) Contributor APIs.
+
+If Contributor`s Modifications include an application programming
+interface ("API"../) and Contributor has knowledge of patent licenses
+which are reasonably necessary to implement that API, Contributor must
+also include this information in the LEGAL file.
+
+(c) Representations.
+
+Contributor represents that, except as disclosed pursuant to Section
+3.4(a) above, Contributor believes that Contributor`s Modifications
+are Contributor`s original creation(s) and/or Contributor has
+sufficient rights to grant the rights conveyed by this
+License
+
+.
+
+3.5. Required Notices.
+
+You must duplicate the notice in Exhibit A in each file of the Source
+Code. If it is not possible to put such notice in a particular Source
+Code file due to its structure, then You must include such notice in a
+location (such as a relevant directory) where a user would be likely
+to look for such a notice. If You created one or more Modification(s)
+You may add your name as a Contributor to the notice described in
+Exhibit A. You must also duplicate this License in any documentation
+for the Source Code where You describe recipients` rights or ownership
+rights relating to Covered Code. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability
+obligations to one or more recipients of Covered Code. However, You
+may do so only on Your own behalf, and not on behalf of the Initial
+Developer or any Contributor. You must make it absolutely clear than
+any such warranty, support, indemnity or liability obligation is
+offered by You alone, and You hereby agree to indemnify the Initial
+Developer and every Contributor for any liability incurred by the
+Initial Developer or such Contributor as a result of warranty,
+support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+
+You may distribute Covered Code in Executable form only if the
+requirements of Section 3.1-3.5 have been met for that Covered Code,
+and if You include a notice stating that the Source Code version of
+the Covered Code is available under the terms of this License,
+including a description of how and where You have fulfilled the
+obligations of Section 3.2. The notice must be conspicuously included
+in any notice in an Executable version, related documentation or
+collateral in which You describe recipients` rights relating to the
+Covered Code. You may distribute the Executable version of Covered
+Code or ownership rights under a license of Your choice, which may
+contain terms different from this License, provided that You are in
+compliance with the terms of this License and that the license for the
+Executable version does not attempt to limit or alter the recipient`s
+rights in the Source Code version from the rights set forth in this
+License. If You distribute the Executable version under a different
+license You must make it absolutely clear that any terms which differ
+from this License are offered by You alone, not by the Initial
+Developer or any Contributor. You hereby agree to indemnify the
+Initial Developer and every Contributor for any liability incurred by
+the Initial Developer or such Contributor as a result of any such
+terms You offer.
+
+3.7. Larger Works.
+
+You may create a Larger Work by combining Covered Code with other
+code
+not governed by the terms of this License and distribute the Larger
+Work as a single product. In such a case, You must make sure the
+requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+If it is impossible for You to comply with any of the terms of this
+License with respect to some or all of the Covered Code due to
+statute, judicial order, or regulation then You must: (a) comply with
+the terms of this License to the maximum extent possible; and (b)
+describe the limitations and the code they affect. Such description
+must be included in the LEGAL file described in Section 3.4 and must
+be included with all distributions of the Source Code. Except to the
+extent prohibited by statute or regulation, such description must be
+sufficiently detailed for a recipient of ordinary skill to be able to
+understand it.
+
+5. Application of this License.
+
+This License applies to code to which the Initial Developer has
+attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+6.1. New Versions.
+
+Sun Microsystems, Inc. ("Sun") may publish revised and/or new versions
+of the License from time to time. Each version will be given a
+distinguishing version number.
+
+6.2. Effect of New Versions.
+
+Once Covered Code has been published under a particular version of
+the
+License, You may always continue to use it under the terms of that
+version. You may also choose to use such Covered Code under the terms
+of any subsequent version of the License published by Sun. No one
+other than Sun has the right to modify the terms applicable to Covered
+Code created under this License.
+
+6.3. Derivative Works.
+
+If You create or use a modified version of this License (which you
+may
+only do in order to apply it to code which is not already Covered Code
+governed by this License), You must: (a) rename Your license so that
+the phrases "Sun," "Sun Public License," or "SPL"../ or any confusingly
+similar phrase do not appear in your license (except to note that your
+license differs from this License) and (b) otherwise make it clear
+that Your version of the license contains terms which differ from the
+Sun Public License. (Filling in the name of the Initial Developer,
+Original Code or Contributor in the notice described in Exhibit A
+shall not of themselves be deemed to be modifications of this
+License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "../AS IS`` BASIS,
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+DISCLAIMER.
+
+8. TERMINATION.
+
+8.1. This License and the rights granted hereunder will terminate
+automatically if You fail to comply with terms herein and fail to cure
+such breach within 30 days of becoming aware of the breach. All
+sublicenses to the Covered Code which are properly granted shall
+survive any termination of this License. Provisions which, by their
+nature, must remain in effect beyond the termination of this License
+shall survive.
+
+8.2. If You initiate litigation by asserting a patent infringement
+claim (excluding declaratory judgment actions) against Initial Developer
+or a Contributor (the Initial Developer or Contributor against whom
+You file such action is referred to as "Participant") alleging
+that:
+
+(a) such Participant`s Contributor Version directly or indirectly
+infringes any patent, then any and all rights granted by such
+Participant to You under Sections 2.1 and/or 2.2 of this License
+shall, upon 60 days notice from Participant terminate prospectively,
+unless if within 60 days after receipt of notice You either: (i)
+agree in writing to pay Participant a mutually agreeable reasonable
+royalty for Your past and future use of Modifications made by such
+Participant, or (ii) withdraw Your litigation claim with respect to
+the Contributor Version against such Participant. If within 60 days
+of notice, a reasonable royalty and payment arrangement are not
+mutually agreed upon in writing by the parties or the litigation claim
+is not withdrawn, the rights granted by Participant to You under
+Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+the 60 day notice period specified above.
+
+(b) any software, hardware, or device, other than such Participant`s
+Contributor Version, directly or indirectly infringes any patent, then
+any rights granted to You by such Participant under Sections 2.1(b)
+and 2.2(b) are revoked effective as of the date You first made, used,
+sold, distributed, or had made, Modifications made by that
+Participant.
+
+8.3. If You assert a patent infringement claim against Participant
+alleging that such Participant`s Contributor Version directly or
+indirectly infringes any patent where such claim is resolved (such as
+by license or settlement) prior to the initiation of patent
+infringement litigation, then the reasonable value of the licenses
+granted by such Participant under Sections 2.1 or 2.2 shall be taken
+into account in determining the amount or value of any payment or
+license.
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above,
+all
+end user license agreements (excluding distributors and resellers)
+which have been validly granted by You or any distributor hereunder
+prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+The Covered Code is a "commercial item," as that term is defined in
+48
+C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software"
+and "commercial computer software documentation,"../ as such terms are
+used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R.
+12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all
+U.S. Government End Users acquire Covered Code with only those rights
+set forth herein.
+
+11. MISCELLANEOUS.
+
+This License represents the complete agreement concerning subject
+matter hereof. If any provision of this License is held to be
+unenforceable, such provision shall be reformed only to the extent
+necessary to make it enforceable. This License shall be governed by
+California law provisions (except to the extent applicable law, if
+any, provides otherwise), excluding its conflict-of-law provisions.
+With respect to disputes in which at least one party is a citizen of,
+or an entity chartered or registered to do business in the United
+States of America, any litigation relating to this License shall be
+subject to the jurisdiction of the Federal Courts of the Northern
+District of California, with venue lying in Santa Clara County,
+California, with the losing party responsible for costs, including
+without limitation, court costs and reasonable attorneys` fees and
+expenses. The application of the United Nations Convention on
+Contracts for the International Sale of Goods is expressly excluded.
+Any law or regulation which provides that the language of a contract
+shall be construed against the drafter shall not apply to this
+License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is
+responsible for claims and damages arising, directly or indirectly,
+out of its utilization of rights under this License and You agree to
+work with Initial Developer and Contributors to distribute such
+responsibility on an equitable basis. Nothing herein is intended or
+shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+Initial Developer may designate portions of the Covered Code as
+?Multiple-Licensed?. ?Multiple-Licensed? means that the Initial
+Developer permits you to utilize portions of the Covered Code under
+Your choice of the alternative licenses, if any, specified by the
+Initial Developer in the file described in Exhibit A.
+
+Exhibit A -Sun Public License Notice.
+
+The contents of this file are subject to the Sun Public License
+
+Version 1.0 (the License); you may not use this file except in
+
+compliance with the License. A copy of the License is available at
+
+http://www.sun.com/
+
+The Original Code is _________________. The Initial Developer of the
+
+Original Code is ___________. Portions created by ______ are Copyright
+
+(C)_________. All Rights Reserved.
+
+Contributor(s): ______________________________________.
+
+Alternatively, the contents of this file may be used under the terms
+
+of the _____ license (the ?[___] License?), in which case the
+
+provisions of [______] License are applicable instead of those above.
+
+If you wish to allow use of your version of this file only under the
+
+terms of the [____] License and not to allow others to use your
+
+version of this file under the SPL, indicate your decision by deleting
+
+the provisions above and replace them with the notice and other
+
+provisions required by the [___] License. If you do not delete the
+
+provisions above, a recipient may use your version of this file under
+
+either the SPL or the [___] License.
+[NOTE: The text of this Exhibit A may differ slightly from the text of
+
+the notices in the Source Code files of the Original Code. You should
+
+use the text of this Exhibit A rather than the text found in the
+
+Original Code Source Code for Your Modifications.]
+
diff --git a/meta/files/common-licenses/Simple-2.0 b/meta/files/common-licenses/Simple-2.0
new file mode 100644
index 0000000..d28357d
--- /dev/null
+++ b/meta/files/common-licenses/Simple-2.0
@@ -0,0 +1,27 @@
+
+Simple Public License (SimPL)
+
+Preamble
+This Simple Public License 2.0 (SimPL 2.0 for short) is a plain language implementation of GPL 2.0.  The words are different, but the goal is the same - to guarantee for all users the freedom to share and change software.  If anyone wonders about the meaning of the SimPL, they should interpret it as consistent with GPL 2.0.
+Simple Public License (SimPL) 2.0
+The SimPL applies to the software`s source and object code and comes with any rights that I have in it (other than trademarks). You agree to the SimPL by copying, distributing, or making a derivative work of the software.
+
+You get the royalty free right to:
+Use the software for any purpose;
+Make derivative works of it (this is called a "Derived Work");
+Copy and distribute it and any Derived Work.
+If you distribute the software or a Derived Work, you must give back to the community by:
+Prominently noting the date of any changes you make;
+Leaving other people`s copyright notices, warranty disclaimers, and license terms  in place;
+Providing the source code, build scripts, installation scripts, and interface definitions in a form that is easy to get and best to modify;
+Licensing it to everyone under SimPL, or substantially similar terms (such as GPL 2.0), without adding further restrictions to the rights provided;
+Conspicuously announcing that it is available under that license.
+There are some things that you must shoulder:
+You get NO WARRANTIES. None of any kind;
+If the software damages you in any way, you may only recover direct damages up to the amount you paid for it (that is zero if you did not pay anything). You may not recover any other damages, including those called "consequential damages." (The state or country where you live may not allow you to limit your liability in this way, so this may not apply to you);
+The SimPL continues perpetually, except that your license rights end automatically if:
+You do not abide by the "give back to the community" terms (your licensees get to keep their rights if they abide);
+Anyone prevents you from distributing the software under the terms of the SimPL.
+License for the License
+You may do anything that you want with the SimPL text; it`s a license form to use in any way that you find helpful.  To avoid confusion, however, if you change the terms in any way then you may not call your license the Simple Public License or the SimPL (but feel free to acknowledge that your license is "based on the Simple Public License").
+
diff --git a/meta/files/common-licenses/Sleepycat b/meta/files/common-licenses/Sleepycat
new file mode 100644
index 0000000..02e9d84
--- /dev/null
+++ b/meta/files/common-licenses/Sleepycat
@@ -0,0 +1,90 @@
+
+The Sleepycat License
+Copyright (c) 1990-1999
+Sleepycat Software. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+Redistributions in any form must be accompanied by information on
+how to obtain complete source code for the DB software and any
+accompanying software that uses the DB software. The source code
+must either be included in the distribution or be available for no
+more than the cost of distribution plus a nominal fee, and must be
+freely redistributable under reasonable conditions. For an
+executable file, complete source code means the source code for all
+modules it contains. It does not include source code for modules or
+files that typically accompany the major components of the operating
+system on which the executable file runs.
+THIS SOFTWARE IS PROVIDED BY SLEEPYCAT SOFTWARE ``AS IS`` AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
+NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL SLEEPYCAT SOFTWARE
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+
+Copyright (c) 1990, 1993, 1994, 1995
+The Regents of the University of California. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+Neither the name of the University nor the names of its contributors
+may be used to endorse or promote products derived from this software
+without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS`` AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
+Copyright (c) 1995, 1996
+The President and Fellows of Harvard University. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+Neither the name of the University nor the names of its contributors
+may be used to endorse or promote products derived from this software
+without specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY HARVARD AND ITS CONTRIBUTORS ``AS IS`` AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL HARVARD OR ITS CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+
diff --git a/meta/files/common-licenses/SugarCRM-1 b/meta/files/common-licenses/SugarCRM-1
new file mode 100644
index 0000000..acbb4e0
--- /dev/null
+++ b/meta/files/common-licenses/SugarCRM-1
@@ -0,0 +1,431 @@
+
+SUGARCRM PUBLIC LICENSE
+
+Version 1.1.3
+
+The SugarCRM Public License Version ("SPL") consists of the Mozilla
+Public License Version 1.1, modified to be specific to SugarCRM, with the
+Additional Terms in Exhibit B. The original Mozilla Public License 1.1 can be
+found at: http://www.mozilla.org/MPL/MPL-1.1.html
+
+
+1. Definitions.
+
+1.0.1. "Commercial Use" means distribution or otherwise making the
+Covered Code available to a third party.
+1.1. ''Contributor'' means each entity that creates or contributes to the
+creation of Modifications.
+
+1.2. ''Contributor Version'' means the combination of the Original Code, prior
+Modifications used by a Contributor, and the Modifications made by that
+particular Contributor.
+
+1.3. ''Covered Code'' means the Original Code or Modifications or the
+combination of the Original Code and Modifications, in each case including
+portions thereof.
+
+1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted
+in the software development community for the electronic transfer of data.
+
+1.5. ''Executable'' means Covered Code in any form other than Source Code.
+
+1.6. ''Initial Developer'' means the individual or entity identified as the
+Initial Developer in the Source Code notice required by Exhibit A.
+
+1.7. ''Larger Work'' means a work which combines Covered Code or portions
+thereof with code not governed by the terms of this License.
+
+1.8. ''License'' means this document.
+
+1.8.1. "Licensable" means having the right to grant, to the maximum
+extent possible, whether at the time of the initial grant or subsequently
+acquired, any and all of the rights conveyed herein.
+
+1.9. ''Modifications'' means any addition to or deletion from the substance or
+structure of either the Original Code or any previous Modifications. When
+Covered Code is released as a series of files, a Modification is:
+
+A. Any addition to or deletion from the contents of a file containing Original
+Code or previous Modifications.
+B. Any new file that contains any part of the Original Code or previous
+Modifications.
+1.10. ''Original Code'' means Source Code of computer software code which is
+described in the Source Code notice required by Exhibit A as Original Code, and
+which, at the time of its release under this License is not already Covered
+Code governed by this License.
+1.10.1. "Patent Claims" means any patent claim(s), now owned or
+hereafter acquired, including without limitation, method, process, and
+apparatus claims, in any patent Licensable by grantor.
+
+1.11. ''Source Code'' means the preferred form of the Covered Code for making
+modifications to it, including all modules it contains, plus any associated
+interface definition files, scripts used to control compilation and
+installation of an Executable, or source code differential comparisons against
+either the Original Code or another well known, available Covered Code of the
+Contributor's choice. The Source Code can be in a compressed or archival form,
+provided the appropriate decompression or de-archiving software is widely
+available for no charge.
+
+1.12. "You'' (or "Your") means an individual or a legal entity
+exercising rights under, and complying with all of the terms of, this License
+or a future version of this License issued under Section 6.1. For legal
+entities, "You'' includes any entity which controls, is controlled by, or
+is under common control with You. For purposes of this definition,
+"control'' means (a) the power, direct or indirect, to cause the direction
+or management of such entity, whether by contract or otherwise, or (b)
+ownership of more than fifty percent (50%) of the outstanding shares or
+beneficial ownership of such entity.
+
+2. Source Code License.
+2.1. The Initial Developer Grant.
+The Initial Developer hereby grants You a world-wide, royalty-free, non-
+exclusive license, subject to third party intellectual property claims:
+(a) under intellectual property rights (other than patent or trademark)
+Licensable by Initial Developer to use, reproduce, modify, display, perform,
+sublicense and distribute the Original Code (or portions thereof) with or
+without Modifications, and/or as part of a Larger Work; and
+(b) under Patents Claims infringed by the making, using or selling of Original
+Code, to make, have made, use, practice, sell, and offer for sale, and/or
+otherwise dispose of the Original Code (or portions thereof).
+
+(c) the licenses granted in this Section 2.1(a) and (b) are effective on the
+date Initial Developer first distributes Original Code under the terms of this
+License.
+(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for
+code that You delete from the Original Code; 2) separate from the Original
+Code; or 3) for infringements caused by: i) the modification of the Original
+Code or ii) the combination of the Original Code with other software or
+devices.
+2.2. Contributor Grant.
+Subject to third party intellectual property claims, each Contributor hereby
+grants You a world-wide, royalty-free, non-exclusive license
+
+(a) under intellectual property rights (other than patent or trademark)
+Licensable by Contributor, to use, reproduce, modify, display, perform,
+sublicense and distribute the Modifications created by such Contributor (or
+portions thereof) either on an unmodified basis, with other Modifications, as
+Covered Code and/or as part of a Larger Work; and
+(b) under Patent Claims infringed by the making, using, or selling of
+Modifications made by that Contributor either alone and/or in combination with
+its Contributor Version (or portions of such combination), to make, use, sell,
+offer for sale, have made, and/or otherwise dispose of: 1) Modifications made
+by that Contributor (or portions thereof); and 2) the combination of
+Modifications made by that Contributor with its Contributor Version (or
+portions of such combination).
+
+(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the
+date Contributor first makes Commercial Use of the Covered Code.
+
+(d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for
+any code that Contributor has deleted from the Contributor Version; 2) separate
+from the Contributor Version; 3) for infringements caused by: i) third party
+modifications of Contributor Version or ii) the combination of Modifications
+made by that Contributor with other software (except as part of the Contributor
+Version) or other devices; or 4) under Patent Claims infringed by Covered Code
+in the absence of Modifications made by that Contributor.
+
+
+3. Distribution Obligations.
+
+3.1. Application of License.
+The Modifications which You create or to which You contribute are governed by
+the terms of this License, including without limitation Section 2.2. The Source
+Code version of Covered Code may be distributed only under the terms of this
+License or a future version of this License released under Section 6.1, and You
+must include a copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code version
+that alters or restricts the applicable version of this License or the
+recipients' rights hereunder. However, You may include an additional document
+offering the additional rights described in Section 3.5.
+3.2. Availability of Source Code.
+Any Modification which You create or to which You contribute must be made
+available in Source Code form under the terms of this License either on the
+same media as an Executable version or via an accepted Electronic Distribution
+Mechanism to anyone to whom you made an Executable version available; and if
+made available via Electronic Distribution Mechanism, must remain available for
+at least twelve (12) months after the date it initially became available, or at
+least six (6) months after a subsequent version of that particular Modification
+has been made available to such recipients. You are responsible for ensuring
+that the Source Code version remains available even if the Electronic
+Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications.
+You must cause all Covered Code to which You contribute to contain a file
+documenting the changes You made to create that Covered Code and the date of
+any change. You must include a prominent statement that the Modification is
+derived, directly or indirectly, from Original Code provided by the Initial
+Developer and including the name of the Initial Developer in (a) the Source
+Code, and (b) in any notice in an Executable version or related documentation
+in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party's intellectual
+property rights is required to exercise the rights granted by such Contributor
+under Sections 2.1 or 2.2, Contributor must include a text file with the Source
+Code distribution titled "LEGAL'' which describes the claim and the party
+making the claim in sufficient detail that a recipient will know whom to
+contact. If Contributor obtains such knowledge after the Modification is made
+available as described in Section 3.2, Contributor shall promptly modify the
+LEGAL file in all copies Contributor makes available thereafter and shall take
+other steps (such as notifying appropriate mailing lists or newsgroups)
+reasonably calculated to inform those who received the Covered Code that new
+knowledge has been obtained.
+(b) Contributor APIs.
+If Contributor's Modifications include an application programming interface and
+Contributor has knowledge of patent licenses which are reasonably necessary to
+implement that API, Contributor must also include this information in the LEGAL
+file.
+(c) Representations.
+Contributor represents that, except as disclosed pursuant to Section 3.4(a)
+above, Contributor believes that Contributor's Modifications are Contributor's
+original creation(s) and/or Contributor has sufficient rights to grant the
+rights conveyed by this License.
+
+3.5. Required Notices.
+You must duplicate the notice in Exhibit A in each file of the Source Code. If
+it is not possible to put such notice in a particular Source Code file due to
+its structure, then You must include such notice in a location (such as a
+relevant directory) where a user would be likely to look for such a notice. If
+You created one or more Modification(s) You may add your name as a Contributor
+to the notice described in Exhibit A. You must also duplicate this License in
+any documentation for the Source Code where You describe recipients' rights or
+ownership rights relating to Covered Code. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to one
+or more recipients of Covered Code. However, You may do so only on Your own
+behalf, and not on behalf of the Initial Developer or any Contributor. You must
+make it absolutely clear than any such warranty, support, indemnity or
+liability obligation is offered by You alone, and You hereby agree to indemnify
+the Initial Developer and every Contributor for any liability incurred by the
+Initial Developer or such Contributor as a result of warranty, support,
+indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions.
+You may distribute Covered Code in Executable form only if the requirements of
+Section 3.1-3.5 have been met for that Covered Code, and if You include a
+notice stating that the Source Code version of the Covered Code is available
+under the terms of this License, including a description of how and where You
+have fulfilled the obligations of Section 3.2. The notice must be conspicuously
+included in any notice in an Executable version, related documentation or
+collateral in which You describe recipients' rights relating to the Covered
+Code. You may distribute the Executable version of Covered Code or ownership
+rights under a license of Your choice, which may contain terms different from
+this License, provided that You are in compliance with the terms of this
+License and that the license for the Executable version does not attempt to
+limit or alter the recipient's rights in the Source Code version from the
+rights set forth in this License. If You distribute the Executable version
+under a different license You must make it absolutely clear that any terms
+which differ from this License are offered by You alone, not by the Initial
+Developer or any Contributor. You hereby agree to indemnify the Initial
+Developer and every Contributor for any liability incurred by the Initial
+Developer or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works.
+You may create a Larger Work by combining Covered Code with other code not
+governed by the terms of this License and distribute the Larger Work as a
+single product. In such a case, You must make sure the requirements of this
+License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this License
+with respect to some or all of the Covered Code due to statute, judicial order,
+or regulation then You must: (a) comply with the terms of this License to the
+maximum extent possible; and (b) describe the limitations and the code they
+affect. Such description must be included in the LEGAL file described in
+Section 3.4 and must be included with all distributions of the Source Code.
+Except to the extent prohibited by statute or regulation, such description must
+be sufficiently detailed for a recipient of ordinary skill to be able to
+understand it.
+
+5. Application of this License.
+This License applies to code to which the Initial Developer has attached the
+notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+6.1. New Versions.
+SugarCRM Inc. (''SugarCRM'') may publish revised and/or new versions of the
+License from time to time. Each version will be given a distinguishing version
+number.
+6.2. Effect of New Versions.
+Once Covered Code has been published under a particular version of the License,
+You may always continue to use it under the terms of that version. You may also
+choose to use such Covered Code under the terms of any subsequent version of
+the License published by SugarCRM. No one other than SugarCRM has the right to
+modify the terms applicable to Covered Code created under this License.
+
+6.3. Derivative Works.
+If You create or use a modified version of this License (which you may only do
+in order to apply it to code which is not already Covered Code governed by this
+License), You must (a) rename Your license so that the phrases ''SugarCRM'',
+''SPL'' or any confusingly similar phrase do not appear in your license (except
+to note that your license differs from this License) and (b) otherwise make it
+clear that Your version of the license contains terms which differ from the
+SugarCRM Public License. (Filling in the name of the Initial Developer,
+Original Code or Contributor in the notice described in Exhibit A shall not of
+themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY.
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT
+WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT
+LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE,
+FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE
+QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED
+CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY
+OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
+CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
+LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+DISCLAIMER.
+
+8. TERMINATION.
+8.1. This License and the rights granted hereunder will terminate automatically
+if You fail to comply with terms herein and fail to cure such breach within 30
+days of becoming aware of the breach. All sublicenses to the Covered Code which
+are properly granted shall survive any termination of this License. Provisions
+which, by their nature, must remain in effect beyond the termination of this
+License shall survive.
+8.2. If You initiate litigation by asserting a patent infringement claim
+(excluding declatory judgment actions) against Initial Developer or a
+Contributor (the Initial Developer or Contributor against whom You file such
+action is referred to as "Participant") alleging that:
+
+(a) such Participant's Contributor Version directly or indirectly infringes any
+patent, then any and all rights granted by such Participant to You under
+Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from
+Participant terminate prospectively, unless if within 60 days after receipt of
+notice You either: (i) agree in writing to pay Participant a mutually agreeable
+reasonable royalty for Your past and future use of Modifications made by such
+Participant, or (ii) withdraw Your litigation claim with respect to the
+Contributor Version against such Participant. If within 60 days of notice, a
+reasonable royalty and payment arrangement are not mutually agreed upon in
+writing by the parties or the litigation claim is not withdrawn, the rights
+granted by Participant to You under Sections 2.1 and/or 2.2 automatically
+terminate at the expiration of the 60 day notice period specified above.
+
+(b) any software, hardware, or device, other than such Participant's
+Contributor Version, directly or indirectly infringes any patent, then any
+rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are
+revoked effective as of the date You first made, used, sold, distributed, or
+had made, Modifications made by that Participant.
+
+8.3. If You assert a patent infringement claim against Participant alleging
+that such Participant's Contributor Version directly or indirectly infringes
+any patent where such claim is resolved (such as by license or settlement)
+prior to the initiation of patent infringement litigation, then the reasonable
+value of the licenses granted by such Participant under Sections 2.1 or 2.2
+shall be taken into account in determining the amount or value of any payment
+or license.
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user
+license agreements (excluding distributors and resellers) which have been
+validly granted by You or any distributor hereunder prior to termination shall
+survive termination.
+
+9. LIMITATION OF LIABILITY.
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY
+OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
+DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION,
+OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL
+HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING
+FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
+LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF
+INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT
+APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R.
+2.101 (Oct. 1995), consisting of ''commercial computer software'' and
+''commercial computer software documentation,'' as such terms are used in 48
+C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R.
+227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users
+acquire Covered Code with only those rights set forth herein.
+
+11. MISCELLANEOUS.
+This License represents the complete agreement concerning subject matter
+hereof. If any provision of this License is held to be unenforceable, such
+provision shall be reformed only to the extent necessary to make it
+enforceable. This License shall be governed by California law provisions
+(except to the extent applicable law, if any, provides otherwise), excluding
+its conflict-of-law provisions. With respect to disputes in which at least one
+party is a citizen of, or an entity chartered or registered to do business in
+the United States of America, any litigation relating to this License shall be
+subject to the jurisdiction of the Federal Courts of the Northern District of
+California, with venue lying in Santa Clara County, California, with the losing
+party responsible for costs, including without limitation, court costs and
+reasonable attorneys' fees and expenses. The application of the United Nations
+Convention on Contracts for the International Sale of Goods is expressly
+excluded. Any law or regulation which provides that the language of a contract
+shall be construed against the drafter shall not apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+As between Initial Developer and the Contributors, each party is responsible
+for claims and damages arising, directly or indirectly, out of its utilization
+of rights under this License and You agree to work with Initial Developer and
+Contributors to distribute such responsibility on an equitable basis. Nothing
+herein is intended or shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+Initial Developer may designate portions of the Covered Code as
+"Multiple-Licensed". "Multiple-Licensed" means that the
+Initial Developer permits you to utilize portions of the Covered Code under
+Your choice of the SPL or the alternative licenses, if any, specified by the
+Initial Developer in the file described in Exhibit A.
+SugarCRM Public License 1.1.3 - Exhibit A
+
+The contents of this file are subject to the SugarCRM Public License Version
+1.1.3
+("License"); You may not use this file except in compliance with the
+License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+Software distributed under the License is distributed on an "AS IS"
+basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+the specific language governing rights and limitations under the License.
+
+The Original Code is: SugarCRM Open Source
+
+The Initial Developer of the Original Code is SugarCRM, Inc.
+Portions created by SugarCRM are Copyright (C) 2004 SugarCRM, Inc.;
+All Rights Reserved.
+Contributor(s): ______________________________________.
+[NOTE: The text of this Exhibit A may differ slightly from the text of the
+notices in the Source Code files of the Original Code. You should use the text
+of this Exhibit A rather than the text found in the Original Code Source Code
+for Your Modifications.]
+
+SugarCRM Public License 1.1.3 - Exhibit B
+
+Additional Terms applicable to the SugarCRM Public License.
+
+I. Effect.
+These additional terms described in this SugarCRM Public License &ndash;
+Additional Terms shall apply to the Covered Code under this License.
+
+II. SugarCRM and logo.
+This License does not grant any rights to use the trademarks
+"SugarCRM" and the "SugarCRM" logos even if such marks are
+included in the Original Code or Modifications.
+
+However, in addition to the other notice obligations, all copies of the Covered
+Code in Executable and Source Code form distributed must, as a form of
+attribution of the original author, include on each user interface screen (i)
+the "Powered by SugarCRM" logo and (ii) the copyright notice in the
+same form as the latest version of the Covered Code distributed by SugarCRM,
+Inc. at the time of distribution of such copy. In addition, the "Powered
+by SugarCRM" logo must be visible to all users and be located at the very
+bottom center of each user interface screen. Notwithstanding the above, the
+dimensions of the "Powered By SugarCRM" logo must be at least 106 x
+23 pixels. When users click on the "Powered by SugarCRM" logo it must
+direct them back to http://www.sugarforge.org. In addition, the copyright
+notice must remain visible to all users at all times at the bottom of the user
+interface screen. When users click on the copyright notice, it must direct them
+back to http://www.sugarcrm.com
+
+
+
+
+
+
diff --git a/meta/files/common-licenses/SugarCRM-1.1.3 b/meta/files/common-licenses/SugarCRM-1.1.3
new file mode 100644
index 0000000..509681a
--- /dev/null
+++ b/meta/files/common-licenses/SugarCRM-1.1.3
@@ -0,0 +1,160 @@
+
+SUGARCRM PUBLIC LICENSE
+
+Version 1.1.3
+
+The SugarCRM Public License Version ("SPL") consists of the Mozilla Public License Version 1.1, modified to be specific to SugarCRM, with the Additional Terms in Exhibit B. The original Mozilla Public License 1.1 can be found at: http://www.mozilla.org/MPL/MPL-1.1.html
+
+
+1. Definitions.
+
+1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party.
+1.1. ``Contributor`` means each entity that creates or contributes to the creation of Modifications.
+
+1.2. ``Contributor Version`` means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+
+1.3. ``Covered Code`` means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof.
+
+1.4. ``Electronic Distribution Mechanism`` means a mechanism generally accepted in the software development community for the electronic transfer of data.
+
+1.5. ``Executable`` means Covered Code in any form other than Source Code.
+
+1.6. ``Initial Developer`` means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+
+1.7. ``Larger Work`` means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+1.8. ``License`` means this document.
+
+1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+
+1.9. ``Modifications`` means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+
+A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+B. Any new file that contains any part of the Original Code or previous Modifications. 
+1.10. ``Original Code`` means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+
+1.11. ``Source Code`` means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+
+1.12. "You`` (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You`` includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control`` means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+
+2. Source Code License.
+2.1. The Initial Developer Grant. 
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+(a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+(b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof).
+
+(c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License.
+(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. 
+2.2. Contributor Grant. 
+Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+
+(a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+(b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination).
+
+(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code.
+
+(d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor.
+
+
+3. Distribution Obligations.
+
+3.1. Application of License. 
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5.
+3.2. Availability of Source Code. 
+Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party.
+
+3.3. Description of Modifications. 
+You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters
+
+(a) Third Party Claims. 
+If Contributor has knowledge that a license under a third party`s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL`` which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+(b) Contributor APIs. 
+If Contributor`s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. 
+(c) Representations.
+Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor`s Modifications are Contributor`s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+
+3.5. Required Notices. 
+You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients` rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer.
+
+3.6. Distribution of Executable Versions. 
+You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients` rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer.
+
+3.7. Larger Works. 
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+
+5. Application of this License.
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+6.1. New Versions. 
+SugarCRM Inc. (``SugarCRM``) may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number.
+6.2. Effect of New Versions. 
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by SugarCRM. No one other than SugarCRM has the right to modify the terms applicable to Covered Code created under this License.
+
+6.3. Derivative Works. 
+If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ``SugarCRM``, ``SPL`` or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the SugarCRM Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+
+7. DISCLAIMER OF WARRANTY.
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS`` BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that:
+
+(a) such Participant`s Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above.
+
+(b) any software, hardware, or device, other than such Participant`s Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant.
+
+8.3. If You assert a patent infringement claim against Participant alleging that such Participant`s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+
+8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+The Covered Code is a ``commercial item,`` as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ``commercial computer software`` and ``commercial computer software documentation,`` as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+11. MISCELLANEOUS.
+This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys` fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+Initial Developer may designate portions of the Covered Code as &#8220;Multiple-Licensed&#8221;. &#8220;Multiple-Licensed&#8221; means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the SPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A.
+SugarCRM Public License 1.1.3 - Exhibit A
+
+The contents of this file are subject to the SugarCRM Public License Version 1.1.3
+("License"); You may not use this file except in compliance with the 
+License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
+Software distributed under the License is distributed on an "AS IS" basis,
+WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
+the specific language governing rights and limitations under the License.
+
+The Original Code is: SugarCRM Open Source
+
+The Initial Developer of the Original Code is SugarCRM, Inc.
+Portions created by SugarCRM are Copyright (C) 2004 SugarCRM, Inc.;
+All Rights Reserved.
+Contributor(s): ______________________________________.
+[NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.]
+
+SugarCRM Public License 1.1.3 - Exhibit B
+
+Additional Terms applicable to the SugarCRM Public License.
+
+I. Effect.
+These additional terms described in this SugarCRM Public License &#8211; Additional Terms shall apply to the Covered Code under this License.
+
+II. SugarCRM and logo.
+This License does not grant any rights to use the trademarks "SugarCRM" and the "SugarCRM" logos even if such marks are included in the Original Code or Modifications.
+
+However, in addition to the other notice obligations, all copies of the Covered Code in Executable and Source Code form distributed must, as a form of attribution of the original author, include on each user interface screen (i) the "Powered by SugarCRM" logo and (ii) the copyright notice in the same form as the latest version of the Covered Code distributed by SugarCRM, Inc. at the time of distribution of such copy. In addition, the "Powered by SugarCRM" logo must be visible to all users and be located at the very bottom center of each user interface screen. Notwithstanding the above, the dimensions of the "Powered By SugarCRM" logo must be at least 106 x 23 pixels. When users click on the "Powered by SugarCRM" logo it must direct them back to http://www.sugarforge.org. In addition, the copyright notice must remain visible to all users at all times at the bottom of the user interface screen. When users click on the copyright notice, it must direct them back to http://www.sugarcrm.com
+
diff --git a/meta/files/common-licenses/UCB b/meta/files/common-licenses/UCB
new file mode 100644
index 0000000..79a757a
--- /dev/null
+++ b/meta/files/common-licenses/UCB
@@ -0,0 +1,26 @@
+   Copyright (c) 1987, 1989, 1990, 1991, 1992, 1993, 1994
+        The Regents of the University of California.  All rights reserved.
+
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+   1. Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+   2. Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+   3. Neither the name of the University nor the names of its contributors
+      may be used to endorse or promote products derived from this software
+      without specific prior written permission.
+
+   THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+   ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+   FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+   OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+   SUCH DAMAGE.
diff --git a/meta/files/common-licenses/VSL-1.0 b/meta/files/common-licenses/VSL-1.0
new file mode 100644
index 0000000..36bae5c
--- /dev/null
+++ b/meta/files/common-licenses/VSL-1.0
@@ -0,0 +1,49 @@
+
+Vovida Software License v. 1.0
+
+This license applies to all software incorporated in the "Vovida
+Open Communication Application Library" except for those portions
+incorporating third party software specifically identified as being
+licensed under separate license.
+
+The Vovida Software License, Version 1.0
+Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in
+the documentation and/or other materials provided with the
+distribution.
+
+3. The names "VOCAL", "Vovida Open Communication Application Library",
+and "Vovida Open Communication Application Library (VOCAL)" must
+not be used to endorse or promote products derived from this
+software without prior written permission. For written
+permission, please contact vocal@vovida.org.
+
+4. Products derived from this software may not be called "VOCAL", nor
+may "VOCAL" appear in their name, without prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
+NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
+NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DAMAGES
+IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+
+
diff --git a/meta/files/common-licenses/W3C b/meta/files/common-licenses/W3C
new file mode 100644
index 0000000..e4b8c46
--- /dev/null
+++ b/meta/files/common-licenses/W3C
@@ -0,0 +1,17 @@
+
+W3C SOFTWARE NOTICE AND LICENSE
+This work (and included software, documentation such as READMEs, or other related items) is being provided by the copyright holders under the following license.
+License
+By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions.
+Permission to copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications:
+The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
+Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body of any redistributed or derivative code.
+Notice of any changes or modifications to the files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
+Disclaimers
+THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
+COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
+The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
+Notes
+This version: http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+This formulation of W3C`s notice and license became active on December 31 2002. This version removes the copyright ownership notice such that this license can be used with materials other than those owned by the W3C, reflects that ERCIM is now a host of the W3C, includes references to this specific dated version of the license, and removes the ambiguous grant of "use". Otherwise, this version is the same as the previous version and is written so as to preserve the Free Software Foundation`s assessment of GPL compatibility and OSI`s certification under the Open Source Definition.
+
diff --git a/meta/files/common-licenses/WXwindows b/meta/files/common-licenses/WXwindows
new file mode 100644
index 0000000..1fe0948
--- /dev/null
+++ b/meta/files/common-licenses/WXwindows
@@ -0,0 +1,55 @@
+
+                wxWindows Library Licence, Version 3.1
+                ======================================
+
+  Copyright (C) 1998-2005 Julian Smart, Robert Roebling et al
+
+  Everyone is permitted to copy and distribute verbatim copies
+  of this licence document, but changing it is not allowed.
+
+                       WXWINDOWS LIBRARY LICENCE
+     TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+  
+  This library is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Library General Public Licence as published by
+  the Free Software Foundation; either version 2 of the Licence, or (at
+  your option) any later version.
+  
+  This library is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
+  General Public Licence for more details.
+
+  You should have received a copy of the GNU Library General Public Licence
+  along with this software, usually in a file named COPYING.LIB.  If not,
+  write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+  Boston, MA 02111-1307 USA.
+
+  EXCEPTION NOTICE
+
+  1. As a special exception, the copyright holders of this library give
+  permission for additional uses of the text contained in this release of
+  the library as licenced under the wxWindows Library Licence, applying
+  either version 3.1 of the Licence, or (at your option) any later version of
+  the Licence as published by the copyright holders of version
+  3.1 of the Licence document.
+
+  2. The exception is that you may use, copy, link, modify and distribute
+  under your own terms, binary object code versions of works based
+  on the Library.
+
+  3. If you copy code from files distributed under the terms of the GNU
+  General Public Licence or the GNU Library General Public Licence into a
+  copy of this library, as this licence permits, the exception does not
+  apply to the code that you add in this way.  To avoid misleading anyone as
+  to the status of such modified files, you must delete this exception
+  notice from such code and/or adjust the licensing conditions notice
+  accordingly.
+
+  4. If you write modifications of your own for this library, it is your
+  choice whether to permit this exception to apply to your modifications. 
+  If you do not wish that, you must delete the exception notice from such
+  code and/or adjust the licensing conditions notice accordingly.
+
+
+
diff --git a/meta/files/common-licenses/Watcom-1.0 b/meta/files/common-licenses/Watcom-1.0
new file mode 100644
index 0000000..6bb619a
--- /dev/null
+++ b/meta/files/common-licenses/Watcom-1.0
@@ -0,0 +1,140 @@
+
+Sybase Open Watcom Public License version 1.0
+
+USE OF THE SYBASE OPEN WATCOM SOFTWARE DESCRIBED BELOW ("SOFTWARE") IS SUBJECT TO THE TERMS AND CONDITIONS SET FORTH IN THE SYBASE OPEN WATCOM PUBLIC LICENSE SET FORTH BELOW ("LICENSE"). YOU MAY NOT USE THE SOFTWARE IN ANY MANNER UNLESS YOU ACCEPT THE TERMS AND CONDITIONS OF THE LICENSE. YOU INDICATE YOUR ACCEPTANCE BY IN ANY MANNER USING (INCLUDING WITHOUT LIMITATION BY REPRODUCING, MODIFYING OR DISTRIBUTING) THE SOFTWARE. IF YOU DO NOT ACCEPT ALL OF THE TERMS AND CONDITIONS OF THE LICENSE, DO NOT USE THE SOFTWARE IN ANY MANNER.
+
+Sybase Open Watcom Public License version 1.0
+1. General; Definitions. This License applies only to the following software programs: the open source versions of Sybase`s Watcom C/C++ and Fortran compiler products ("Software"), which are modified versions of, with significant changes from, the last versions made commercially available by Sybase. As used in this License:
+
+
+1.1 "Applicable Patent Rights" mean: (a) in the case where Sybase is the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to Sybase and (ii) that cover subject matter contained in the Original Code, but only to the extent necessary to use, reproduce and/or distribute the Original Code without infringement; and (b) in the case where You are the grantor of rights, (i) claims of patents that are now or hereafter acquired, owned by or assigned to You and (ii) that cover subject matter in Your Modifications, taken alone or in combination with Original Code.
+
+
+1.2 "Contributor" means any person or entity that creates or contributes to the creation of Modifications.
+
+
+1.3 "Covered Code" means the Original Code, Modifications, the combination of Original Code and any Modifications, and/or any respective portions thereof.
+
+
+1.4 "Deploy" means to use, sublicense or distribute Covered Code other than for Your internal research and development (R&amp;D) and/or Personal Use, and includes without limitation, any and all internal use or distribution of Covered Code within Your business or organization except for R&amp;D use and/or Personal Use, as well as direct or indirect sublicensing or distribution of Covered Code by You to any third party in any form or manner.
+
+
+1.5 "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+
+
+1.6 "Modifications" mean any addition to, deletion from, and/or change to, the substance and/or structure of the Original Code, any previous Modifications, the combination of Original Code and any previous Modifications, and/or any respective portions thereof. When code is released as a series of files, a Modification is: (a) any addition to or deletion from the contents of a file containing Covered Code; and/or (b) any new file or other representation of computer program statements that contains any part of Covered Code.
+
+
+1.7 "Original Code" means (a) the Source Code of a program or other work as originally made available by Sybase under this License, including the Source Code of any updates or upgrades to such programs or works made available by Sybase under this License, and that has been expressly identified by Sybase as such in the header file(s) of such work; and (b) the object code compiled from such Source Code and originally made available by Sybase under this License.
+
+
+1.8 "Personal Use" means use of Covered Code by an individual solely for his or her personal, private and non-commercial purposes. An individual`s use of Covered Code in his or her capacity as an officer, employee, member, independent contractor or agent of a corporation, business or organization (commercial or non-commercial) does not qualify as Personal Use.
+
+
+1.9 "Source Code" means the human readable form of a program or other work that is suitable for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an executable (object code).
+
+
+1.10 "You" or "Your" means an individual or a legal entity exercising rights under this License. For legal entities, "You" or "Your" includes any entity which controls, is controlled by, or is under common control with, You, where "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity.
+
+
+2. Permitted Uses; Conditions &amp; Restrictions.Subject to the terms and conditions of this License, Sybase hereby grants You, effective on the date You accept this License and download the Original Code, a world-wide, royalty-free, non-exclusive license, to the extent of Sybase`s Applicable Patent Rights and copyrights covering the Original Code, to do the following:
+
+
+2.1 You may use, reproduce, display, perform, modify and distribute Original Code, with or without Modifications, solely for Your internal research and development and/or Personal Use, provided that in each instance:
+
+(a) You must retain and reproduce in all copies of Original Code the copyright and other proprietary notices and disclaimers of Sybase as they appear in the Original Code, and keep intact all notices in the Original Code that refer to this License; and 
+
+(b) You must retain and reproduce a copy of this License with every copy of Source Code of Covered Code and documentation You distribute, and You may not offer or impose any terms on such Source Code that alter or restrict this License or the recipients` rights hereunder, except as permitted under Section 6.
+
+(c) Whenever reasonably feasible you should include the copy of this License in a click-wrap format, which requires affirmative acceptance by clicking on an "I accept" button or similar mechanism. If a click-wrap format is not included, you must include a statement that any use (including without limitation reproduction, modification or distribution) of the Software, and any other affirmative act that you define, constitutes acceptance of the License, and instructing the user not to use the Covered Code in any manner if the user does not accept all of the terms and conditions of the License.
+
+
+2.2 You may use, reproduce, display, perform, modify and Deploy Covered Code, provided that in each instance:
+
+(a) You must satisfy all the conditions of Section 2.1 with respect to the Source Code of the Covered Code; 
+
+(b) You must duplicate, to the extent it does not already exist, the notice in Exhibit A in each file of the Source Code of all Your Modifications, and cause the modified files to carry prominent notices stating that You changed the files and the date of any change; 
+
+(c) You must make Source Code of all Your Deployed Modifications publicly available under the terms of this License, including the license grants set forth in Section 3 below, for as long as you Deploy the Covered Code or twelve (12) months from the date of initial Deployment, whichever is longer. You should preferably distribute the Source Code of Your Deployed Modifications electronically (e.g. download from a web site); 
+
+(d) if You Deploy Covered Code in object code, executable form only, You must include a prominent notice, in the code itself as well as in related documentation, stating that Source Code of the Covered Code is available under the terms of this License with information on how and where to obtain such Source Code; and 
+
+(e) the object code form of the Covered Code may be distributed under Your own license agreement, provided that such license agreement contains terms no less protective of Sybase and each Contributor than the terms of this License, and stating that any provisions which differ from this License are offered by You alone and not by any other party.
+
+
+2.3 You expressly acknowledge and agree that although Sybase and each Contributor grants the licenses to their respective portions of the Covered Code set forth herein, no assurances are provided by Sybase or any Contributor that the Covered Code does not infringe the patent or other intellectual property rights of any other entity. Sybase and each Contributor disclaim any liability to You for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, You hereby assume sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow You to distribute the Covered Code, it is Your responsibility to acquire that license before distributing the Covered Code.
+
+
+3. Your Grants. In consideration of, and as a condition to, the licenses granted to You under this License, You hereby grant to Sybase and all third parties a non-exclusive, royalty-free license, under Your Applicable Patent Rights and other intellectual property rights (other than patent) owned or controlled by You, to use, reproduce, display, perform, modify, distribute and Deploy Your Modifications of the same scope and extent as Sybase`s licenses under Sections 2.1 and 2.2.
+
+
+4. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In each such instance, You must make sure the requirements of this License are fulfilled for the Covered Code or any portion thereof.
+
+
+5. Limitations on Patent License. Except as expressly stated in Section 2, no other patent rights, express or implied, are granted by Sybase herein. Modifications and/or Larger Works may require additional patent licenses from Sybase which Sybase may grant in its sole discretion.
+
+
+6. Additional Terms. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations and/or other rights consistent with this License ("Additional Terms") to one or more recipients of Covered Code. However, You may do so only on Your own behalf and as Your sole responsibility, and not on behalf of Sybase or any Contributor. You must obtain the recipient`s agreement that any such Additional Terms are offered by You alone, and You hereby agree to indemnify, defend and hold Sybase and every Contributor harmless for any liability incurred by or claims asserted against Sybase or such Contributor by reason of any such Additional Terms.
+
+
+7. Versions of the License. Sybase may publish revised and/or new versions of this License from time to time. Each version will be given a distinguishing version number. Once Original Code has been published under a particular version of this License, You may continue to use it under the terms of that version. You may also choose to use such Original Code under the terms of any subsequent version of this License published by Sybase. No one other than Sybase has the right to modify the terms applicable to Covered Code created under this License.
+
+
+8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in part pre-release, untested, or not fully tested works. The Covered Code may contain errors that could cause failures or loss of data, and may be incomplete or contain inaccuracies. You expressly acknowledge and agree that use of the Covered Code, or any portion thereof, is at Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND SYBASE AND SYBASE`S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "SYBASE" FOR THE PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. SYBASE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY SYBASE, A SYBASE AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. You acknowledge that the Covered Code is not intended for use in the operation of nuclear facilities, aircraft navigation, communication systems, or air traffic control machines in which case the failure of the Covered Code could lead to death, personal injury, or severe physical or environmental damage.
+
+
+9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL SYBASE OR ANY CONTRIBUTOR BE LIABLE FOR ANY DIRECT, INCIDENTAL, SPECIAL, INDIRECT, CONSEQUENTIAL OR OTHER DAMAGES OF ANY KIND ARISING OUT OF OR RELATING TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF SYBASE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF INCIDENTAL OR CONSEQUENTIAL OR OTHER DAMAGES OF ANY KIND, SO THIS LIMITATION MAY NOT APPLY TO YOU. In no event shall Sybase`s or any Contributor`s total liability to You for all damages (other than as may be required by applicable law) under this License exceed the amount of five hundred dollars ($500.00).
+
+
+10. Trademarks. This License does not grant any rights to use the trademarks or trade names "Sybase" or any other trademarks or trade names belonging to Sybase (collectively "Sybase Marks") or to any trademark or trade name belonging to any Contributor("Contributor Marks"). No Sybase Marks or Contributor Marks may be used to endorse or promote products derived from the Original Code or Covered Code other than with the prior written consent of Sybase or the Contributor, as applicable.
+
+
+11. Ownership. Subject to the licenses granted under this License, each Contributor retains all rights, title and interest in and to any Modifications made by such Contributor. Sybase retains all rights, title and interest in and to the Original Code and any Modifications made by or on behalf of Sybase ("Sybase Modifications"), and such Sybase Modifications will not be automatically subject to this License. Sybase may, at its sole discretion, choose to license such Sybase Modifications under this License, or on different terms from those contained in this License or may choose not to license them at all.
+
+12. Termination.
+
+
+12.1 Termination. This License and the rights granted hereunder will terminate:
+
+(a) automatically without notice if You fail to comply with any term(s) of this License and fail to cure such breach within 30 days of becoming aware of such breach;
+
+(b) immediately in the event of the circumstances described in Section 13.5(b); or
+
+(c) automatically without notice if You, at any time during the term of this License, commence an action for patent infringement (including as a cross claim or counterclaim) against Sybase or any Contributor.
+
+
+12.2 Effect of Termination. Upon termination, You agree to immediately stop any further use, reproduction, modification, sublicensing and distribution of the Covered Code and to destroy all copies of the Covered Code that are in your possession or control. All sublicenses to the Covered Code that have been properly granted prior to termination shall survive any termination of this License. Provisions which, by their nature, should remain in effect beyond the termination of this License shall survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, 12.2 and 13. No party will be liable to any other for compensation, indemnity or damages of any sort solely as a result of terminating this License in accordance with its terms, and termination of this License will be without prejudice to any other right or remedy of any party.
+
+
+13. Miscellaneous.
+
+
+13.1 Government End Users. The Covered Code is a "commercial item" as defined in FAR 2.101. Government software and technical data rights in the Covered Code include only those rights customarily provided to the public as defined in this License. This customary commercial license in technical data and software is provided in accordance with FAR 12.211 (Technical Data) and 12.212 (Computer Software) and, for Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- Commercial Items) and 227.7202-3 (Rights in Commercial Computer Software or Computer Software Documentation). Accordingly, all U.S. Government End Users acquire Covered Code with only those rights set forth herein.
+
+
+13.2 Relationship of Parties. This License will not be construed as creating an agency, partnership, joint venture or any other form of legal association between or among you, Sybase or any Contributor, and You will not represent to the contrary, whether expressly, by implication, appearance or otherwise.
+
+
+13.3 Independent Development. Nothing in this License will impair Sybase`s or any Contributor`s right to acquire, license, develop, have others develop for it, market and/or distribute technology or products that perform the same or similar functions as, or otherwise compete with, Modifications, Larger Works, technology or products that You may develop, produce, market or distribute.
+
+
+13.4 Waiver; Construction. Failure by Sybase or any Contributor to enforce any provision of this License will not be deemed a waiver of future enforcement of that or any other provision. Any law or regulation which provides that the language of a contract shall be construed against the drafter will not apply to this License.
+
+
+13.5 Severability. (a) If for any reason a court of competent jurisdiction finds any provision of this License, or portion thereof, to be unenforceable, that provision of the License will be enforced to the maximum extent permissible so as to effect the economic benefits and intent of the parties, and the remainder of this License will continue in full force and effect. (b) Notwithstanding the foregoing, if applicable law prohibits or restricts You from fully and/or specifically complying with Sections 2 and/or 3 or prevents the enforceability of either of those Sections, this License will immediately terminate and You must immediately discontinue any use of the Covered Code and destroy all copies of it that are in your possession or control.
+
+
+13.6 Dispute Resolution. Any litigation or other dispute resolution between You and Sybase relating to this License shall take place in the Northern District of California, and You and Sybase hereby consent to the personal jurisdiction of, and venue in, the state and federal courts within that District with respect to this License. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded.
+
+
+13.7 Entire Agreement; Governing Law. This License constitutes the entire agreement between the parties with respect to the subject matter hereof. This License shall be governed by the laws of the United States and the State of California, except that body of California law concerning conflicts of law.
+Where You are located in the province of Quebec, Canada, the following clause applies: The parties hereby confirm that they have requested that this License and all related documents be drafted in English. Les parties ont exig&#232; que le pr&#232;sent contrat et tous les documents connexes soient r&#232;di&#232;s en anglais.
+
+
+EXHIBIT A. 
+
+"Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
+This file contains Original Code and/or Modifications of Original Code as defined in and that are subject to the Sybase Open Watcom Public License version 1.0 (the `License`). You may not use this file except in compliance with the License. BY USING THIS FILE YOU AGREE TO ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is provided with the Original Code and Modifications, and is also available at www.sybase.com/developer/opensource. 
+
+The Original Code and all software distributed under the License are distributed on an `AS IS` basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the specific language governing rights and limitations under the License."
+
diff --git a/meta/files/common-licenses/XFree86-1.0 b/meta/files/common-licenses/XFree86-1.0
new file mode 100644
index 0000000..b1f3bf4
--- /dev/null
+++ b/meta/files/common-licenses/XFree86-1.0
@@ -0,0 +1,22 @@
+Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+Except as contained in this notice, the name of the XFree86 Project shall not
+be used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the XFree86 Project.
diff --git a/meta/files/common-licenses/XFree86-1.1 b/meta/files/common-licenses/XFree86-1.1
new file mode 100644
index 0000000..c2a5cb2
--- /dev/null
+++ b/meta/files/common-licenses/XFree86-1.1
@@ -0,0 +1,18 @@
+
+XFree86 License (version 1.1)
+
+Copyright (C) 1994-2006 The XFree86 Project, Inc.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions, and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution, and in the same place and form as other copyright, license and disclaimer information.
+
+3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by The XFree86 Project, Inc (http://www.xfree86.org/) and its contributors", in the same place and form as other third-party acknowledgments. Alternately, this acknowledgment may appear in the software itself, in the same form and location as other such third-party acknowledgments.
+
+4. Except as contained in this notice, the name of The XFree86 Project, Inc shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The XFree86 Project, Inc.
+
+THIS SOFTWARE IS PROVIDED ``AS IS`` AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE XFREE86 PROJECT, INC OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/meta/files/common-licenses/XSL b/meta/files/common-licenses/XSL
new file mode 100644
index 0000000..0a82d60
--- /dev/null
+++ b/meta/files/common-licenses/XSL
@@ -0,0 +1,48 @@
+Copyright
+---------
+Copyright (C) 1999-2007 Norman Walsh
+Copyright (C) 2003 Jiří Kosek
+Copyright (C) 2004-2007 Steve Ball
+Copyright (C) 2005-2008 The DocBook Project
+Copyright (C) 2011-2012 O'Reilly Media
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the ``Software''), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+Except as contained in this notice, the names of individuals
+credited with contribution to this software shall not be used in
+advertising or otherwise to promote the sale, use or other
+dealings in this Software without prior written authorization
+from the individuals in question.
+
+Any stylesheet derived from this Software that is publically
+distributed will be identified with a different name and the
+version strings in any derived Software will be changed so that
+no possibility of confusion between the derived package and this
+Software will exist.
+
+Warranty
+--------
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT.  IN NO EVENT SHALL NORMAN WALSH OR ANY OTHER
+CONTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Contacting the Author
+---------------------
+The DocBook XSL stylesheets are maintained by Norman Walsh,
+<ndw@nwalsh.com>, and members of the DocBook Project,
+<docbook-developers@sf.net>
diff --git a/meta/files/common-licenses/Xnet b/meta/files/common-licenses/Xnet
new file mode 100644
index 0000000..0444edf
--- /dev/null
+++ b/meta/files/common-licenses/Xnet
@@ -0,0 +1,27 @@
+
+The X.Net, Inc. License
+This License has been voluntarily deprecated by its author.
+
+Copyright (c) 2000-2001 X.Net, Inc. Lafayette, California, USA
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+This agreement shall be governed in all respects by the laws of the State of
+California and by the laws of the United States of America.
+
diff --git a/meta/files/common-licenses/YPL-1.1 b/meta/files/common-licenses/YPL-1.1
new file mode 100644
index 0000000..4a1880a
--- /dev/null
+++ b/meta/files/common-licenses/YPL-1.1
@@ -0,0 +1,30 @@
+
+Yahoo! Public License, Version 1.1 (YPL)
+This Yahoo! Public License (this "Agreement") is a legal agreement that describes the terms under which Yahoo! Inc., a Delaware corporation having its principal place of business at 701 First Avenue, Sunnyvale, California 94089 ("Yahoo!") will provide software to you via download or otherwise ("Software"). By using the Software, you, an individual or an entity ("You") agree to the terms of this Agreement.
+
+In consideration of the mutual promises and upon the terms and conditions set forth below, the parties agree as follows:
+
+Grant of Copyright License
+1.1 - Subject to the terms and conditions of this Agreement, Yahoo! hereby grants to You, under any and all of its copyright interest in and to the Software, a royalty-free, non-exclusive, non-transferable license to copy, modify, compile, execute, and distribute the Software and Modifications. For the purposes of this Agreement, any change to, addition to, or abridgement of the Software made by You is a "Modification;" however, any file You add to the Software that does not contain any part of the Software is not a "Modification."
+1.2 - If You are an individual acting on behalf of a corporation or other entity, Your use of the Software or any Modification is subject to Your having the authority to bind such corporation or entity to this Agreement. Providing copies to persons within such corporation or entity is not considered distribution for purposes of this Agreement.
+1.3 - For the Software or any Modification You distribute in source code format, You must do so only under the terms of this Agreement, and You must include a complete copy of this Agreement with Your distribution. With respect to any Modification You distribute in source code format, the terms of this Agreement will apply to You in the same way those terms apply to Yahoo! with respect to the Software. In other words, when You are distributing Modifications under this Agreement, You "stand in the shoes" of Yahoo! in terms of the rights You grant and how the terms and conditions apply to You and the licensees of Your Modifications. Notwithstanding the foregoing, when You "stand in the shoes" of Yahoo!, You are not subject to the jurisdiction provision under Section 7, which requires all disputes under this Agreement to be subject to the jurisdiction of federal or state courts of northern California.
+1.4 - For the Software or any Modification You distribute in compiled or object code format, You must also provide recipients with access to the Software or Modification in source code format along with a complete copy of this Agreement. The distribution of the Software or Modifications in compiled or object code format may be under a license of Your choice, provided that You are in compliance with the terms of this Agreement. In addition, You must make absolutely clear that any license terms applying to such Software or Modification that differ from this Agreement are offered by You alone and not by Yahoo!, and that such license does not restrict recipients from exercising rights in the source code to the Software granted by Yahoo! under this Agreement or rights in the source code to any Modification granted by You as described in Section 1.3.
+1.5 - This Agreement does not limit Your right to distribute files that are entirely Your own work (i.e., which do not incorporate any portion of the Software and are not Modifications) under any terms You choose.
+Support
+Yahoo! has no obligation to provide technical support or updates to You. Nothing in this Agreement requires Yahoo! to enter into any license with You for any other edition of the Software.
+Intellectual Property Rights
+3.1 - Except for the license expressly granted under copyright in Section 1.1, no rights, licenses or forbearances are granted or may arise in relation to this Agreement whether expressly, by implication, exhaustion, estoppel or otherwise. All rights, including all intellectual property rights, that are not expressly granted under this Agreement are hereby reserved.
+3.2 - In any copy of the Software or in any Modification you create, You must retain and reproduce, any and all copyright, patent, trademark, and attribution notices that are included in the Software in the same form as they appear in the Software. This includes the preservation of attribution notices in the form of trademarks or logos that exist within a user interface of the Software.
+3.3 - This license does not grant You rights to use any party`s name, logo, or trademarks, except solely as necessary to comply with Section 3.2.
+Disclaimer of Warranties
+THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND. YAHOO! MAKES NO WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY REGARDING OR RELATING TO THE SOFTWARE. SPECIFICALLY, YAHOO! DOES NOT WARRANT THAT THE SOFTWARE WILL BE ERROR FREE OR WILL PERFORM IN AN UNINTERRUPTED MANNER. TO THE GREATEST EXTENT ALLOWED BY LAW, YAHOO! SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (EVEN IF YAHOO! HAD BEEN INFORMED OF SUCH PURPOSE), AND NONINFRINGEMENT WITH RESPECT TO THE SOFTWARE, ANY MODIFICATIONS THERETO AND WITH RESPECT TO THE USE OF THE FOREGOING.
+Limitation of Liability
+IN NO EVENT WILL YAHOO! BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES OF ANY KIND (INCLUDING WITHOUT LIMITATION LOSS OF PROFITS, LOSS OF USE, BUSINESS INTERRUPTION, LOSS OF DATA, COST OF COVER) IN CONNECTION WITH OR ARISING OUT OF OR RELATING TO THE FURNISHING, PERFORMANCE OR USE OF THE SOFTWARE OR ANY OTHER RIGHTS GRANTED HEREUNDER, WHETHER ALLEGED AS A BREACH OF CONTRACT OR TORTIOUS CONDUCT, INCLUDING NEGLIGENCE, AND EVEN IF YAHOO! HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+Term and Termination
+6.1 - This Agreement will continue in effect unless and until terminated earlier pursuant to this Section 6.
+6.2 - In the event You violate the terms of this Agreement, Yahoo! may terminate this Agreement.
+6.3 - All licenses granted hereunder shall terminate upon the termination of this Agreement. Termination will be in addition to any rights and remedies available to Yahoo! at law or equity or under this Agreement.
+6.4 - Termination of this Agreement will not affect the provisions regarding reservation of rights (Section 3.1), provisions disclaiming or limiting Yahoo!`s liability (Sections 4 and 5), Termination (Section 6) or Miscellaneous (Section 7), which provisions will survive termination of this Agreement.
+Miscellaneous
+This Agreement contains the entire agreement of the parties with respect to the subject matter of this Agreement and supersedes all previous communications, representations, understandings and agreements, either oral or written, between the parties with respect to said subject matter. The relationship of the parties hereunder is that of independent contractors, and this Agreement will not be construed as creating an agency, partnership, joint venture or any other form of legal association between the parties. If any term, condition, or provision in this Agreement is found to be invalid, unlawful or unenforceable to any extent, this Agreement will be construed in a manner that most closely effectuates the intent of this Agreement. Such invalid term, condition or provision will be severed from the remaining terms, conditions and provisions, which will continue to be valid and enforceable to the fullest extent permitted by law. This Agreement will be interpreted and construed in accordance with the laws of the State of California and the United States of America, without regard to conflict of law principles. The U.N. Convention on Contracts for the International Sale of Goods shall not apply to this Agreement. All disputes arising out of this Agreement involving Yahoo! or any of its subsidiaries shall be subject to the jurisdiction of the federal or state courts of northern California, with venue lying in Santa Clara County, California. No rights may be assigned, no obligations may be delegated, and this Agreement may not be transferred by You, in whole or in part, whether voluntary or by operation of law, including by way of sale of assets, merger or consolidation, without the prior written consent of Yahoo!, and any purported assignment, delegation or transfer without such consent shall be void ab initio. Any waiver of the provisions of this Agreement or of a party`s rights or remedies under this Agreement must be in writing to be effective. Failure, neglect or delay by a party to enforce the provisions of this Agreement or its rights or remedies at any time, will not be construed or be deemed to be a waiver of such party`s rights under this Agreement and will not in any way affect the validity of the whole or any part of this Agreement or prejudice such party`s right to take subsequent action.
+
diff --git a/meta/files/common-licenses/ZPL-1.1 b/meta/files/common-licenses/ZPL-1.1
new file mode 100644
index 0000000..a6aabec
--- /dev/null
+++ b/meta/files/common-licenses/ZPL-1.1
@@ -0,0 +1,28 @@
+
+Zope Public License (ZPL) Version 1.1
+
+Copyright (c) Zope Corporation. All rights reserved.
+
+This license has been certified as open source.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions in source code must retain the above copyright notice, this list of conditions, and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.
+All advertising materials and documentation mentioning features derived from or use of this software must display the following acknowledgement:
+"This product includes software developed by Zope Corporation for use in the Z Object Publishing Environment (http://www.zope.com/)."
+
+In the event that the product being advertised includes an intact Zope distribution (with copyright and license included) then this clause is waived.
+
+Names associated with Zope or Zope Corporation must not be used to endorse or promote products derived from this software without prior written permission from Zope Corporation.
+Modified redistributions of any form whatsoever must retain the following acknowledgment:
+"This product includes software developed by Zope Corporation for use in the Z Object Publishing Environment (http://www.zope.com/)."
+
+Intact (re-)distributions of any official Zope release do not require an external acknowledgement.
+
+Modifications are encouraged but must be packaged separately as patches to official Zope releases. Distributions that do not clearly separate the patches from the original work must be clearly labeled as unofficial distributions. Modifications which do not carry the name Zope may be packaged in any form, as long as they conform to all of the clauses above.
+Disclaimer
+THIS SOFTWARE IS PROVIDED BY ZOPE CORPORATION ``AS IS`` AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ZOPE CORPORATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+This software consists of contributions made by Zope Corporation and many individuals on behalf of Zope Corporation. Specific attributions are listed in the accompanying credits file.
+
diff --git a/meta/files/common-licenses/ZPL-2.0 b/meta/files/common-licenses/ZPL-2.0
new file mode 100644
index 0000000..3ae2083
--- /dev/null
+++ b/meta/files/common-licenses/ZPL-2.0
@@ -0,0 +1,61 @@
+
+Zope Public License (ZPL) Version 2.0
+-----------------------------------------------
+
+This software is Copyright (c) Zope Corporation (tm) and
+Contributors. All rights reserved.
+
+This license has been certified as open source. It has also
+been designated as GPL compatible by the Free Software
+Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or
+without modification, are permitted provided that the
+following conditions are met:
+
+1. Redistributions in source code must retain the above
+   copyright notice, this list of conditions, and the following
+   disclaimer.
+
+2. Redistributions in binary form must reproduce the above
+   copyright notice, this list of conditions, and the following
+   disclaimer in the documentation and/or other materials
+   provided with the distribution.
+
+3. The name Zope Corporation (tm) must not be used to
+   endorse or promote products derived from this software
+   without prior written permission from Zope Corporation.
+
+4. The right to distribute this software or to use it for
+   any purpose does not give you the right to use Servicemarks
+   (sm) or Trademarks (tm) of Zope Corporation. Use of them is
+   covered in a separate agreement (see
+   http://www.zope.com/Marks).
+
+5. If any files are modified, you must cause the modified
+   files to carry prominent notices stating that you changed
+   the files and the date of any change.
+
+Disclaimer
+
+  THIS SOFTWARE IS PROVIDED BY ZOPE CORPORATION ``AS IS``
+  AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+  NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+  NO EVENT SHALL ZOPE CORPORATION OR ITS CONTRIBUTORS BE
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+  DAMAGE.
+
+
+This software consists of contributions made by Zope
+Corporation and many individuals on behalf of Zope
+Corporation.  Specific attributions are listed in the
+accompanying credits file.
+
diff --git a/meta/files/common-licenses/ZPL-2.1 b/meta/files/common-licenses/ZPL-2.1
new file mode 100644
index 0000000..2d9d43f
--- /dev/null
+++ b/meta/files/common-licenses/ZPL-2.1
@@ -0,0 +1,18 @@
+
+ZPL 2.1
+Zope Public License (ZPL) Version 2.1
+
+A copyright notice accompanies this license document that identifies the copyright holders.
+
+This license has been certified as open source. It has also been designated as GPL compatible by the Free Software Foundation (FSF).
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions in source code must retain the accompanying copyright notice, this list of conditions, and the following disclaimer.
+Redistributions in binary form must reproduce the accompanying copyright notice, this list of conditions, and the following disclaimer in the documentation and/or other materials provided with the distribution.
+Names of the copyright holders must not be used to endorse or promote products derived from this software without prior written permission from the copyright holders.
+The right to distribute this software or to use it for any purpose does not give you the right to use Servicemarks (sm) or Trademarks (tm) of the copyright holders. Use of them is covered by separate agreement with the copyright holders.
+If any files are modified, you must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+Disclaimer
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS`` AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/meta/files/common-licenses/Zimbra-1.3 b/meta/files/common-licenses/Zimbra-1.3
new file mode 100644
index 0000000..79b7b34
--- /dev/null
+++ b/meta/files/common-licenses/Zimbra-1.3
@@ -0,0 +1,30 @@
+
+Zimbra Public License, Version 1.3 (ZPL)
+This Zimbra Public License (this "Agreement") is a legal agreement that describes the terms under which VMware, Inc., a Delaware corporation having its principal place of business at 3401 Hillview Avenue, Palo Alto, California 94304 ("VMware") will provide software to you via download or otherwise ("Software"). By using the Software, you, an individual or an entity ("You") agree to the terms of this Agreement.
+
+In consideration of the mutual promises and upon the terms and conditions set forth below, the parties agree as follows:
+
+1. Grant of Copyright License
+1.1 - Subject to the terms and conditions of this Agreement, VMware hereby grants to You, under any and all of its copyright interest in and to the Software, a royalty-free, non-exclusive, non-transferable license to copy, modify, compile, execute, and distribute the Software and Modifications. For the purposes of this Agreement, any change to, addition to, or abridgement of the Software made by You is a "Modification;" however, any file You add to the Software that does not contain any part of the Software is not a "Modification."
+1.2 - If You are an individual acting on behalf of a corporation or other entity, Your use of the Software or any Modification is subject to Your having the authority to bind such corporation or entity to this Agreement. Providing copies to persons within such corporation or entity is not considered distribution for purposes of this Agreement.
+1.3 - For the Software or any Modification You distribute in source code format, You must do so only under the terms of this Agreement, and You must include a complete copy of this Agreement with Your distribution. With respect to any Modification You distribute in source code format, the terms of this Agreement will apply to You in the same way those terms apply to VMware with respect to the Software. In other words, when You are distributing Modifications under this Agreement, You "stand in the shoes" of VMware in terms of the rights You grant and how the terms and conditions apply to You and the licensees of Your Modifications. Notwithstanding the foregoing, when You "stand in the shoes" of VMware, You are not subject to the jurisdiction provision under Section 7, which requires all disputes under this Agreement to be subject to the jurisdiction of federal or state courts of northern California.
+1.4 - For the Software or any Modification You distribute in compiled or object code format, You must also provide recipients with access to the Software or Modification in source code format along with a complete copy of this Agreement. The distribution of the Software or Modifications in compiled or object code format may be under a license of Your choice, provided that You are in compliance with the terms of this Agreement. In addition, You must make absolutely clear that any license terms applying to such Software or Modification that differ from this Agreement are offered by You alone and not by VMware, and that such license does not restrict recipients from exercising rights in the source code to the Software granted by VMware under this Agreement or rights in the source code to any Modification granted by You as described in Section 1.3.
+1.5 - This Agreement does not limit Your right to distribute files that are entirely Your own work (i.e., which do not incorporate any portion of the Software and are not Modifications) under any terms You choose.
+2. Support
+VMware has no obligation to provide technical support or updates to You. Nothing in this Agreement requires VMware to enter into any license with You for any other edition of the Software.
+3. Intellectual Property Rights
+3.1 - Except for the license expressly granted under copyright in Section 1.1, no rights, licenses or forbearances are granted or may arise in relation to this Agreement whether expressly, by implication, exhaustion, estoppel or otherwise. All rights, including all intellectual property rights, that are not expressly granted under this Agreement are hereby reserved.
+3.2 - In any copy of the Software or in any Modification you create, You must retain and reproduce, any and all copyright, patent, trademark, and attribution notices that are included in the Software in the same form as they appear in the Software. This includes the preservation of attribution notices in the form of trademarks or logos that exist within a user interface of the Software.
+3.3 - This license does not grant You rights to use any party`s name, logo, or trademarks, except solely as necessary to comply with Section 3.2.
+4. Disclaimer of Warranties
+THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND. VMWARE MAKES NO WARRANTIES, WHETHER EXPRESS, IMPLIED, OR STATUTORY REGARDING OR RELATING TO THE SOFTWARE. SPECIFICALLY, VMWARE DOES NOT WARRANT THAT THE SOFTWARE WILL BE ERROR FREE OR WILL PERFORM IN AN UNINTERRUPTED MANNER. TO THE GREATEST EXTENT ALLOWED BY LAW, VMWARE SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (EVEN IF VMWARE HAD BEEN INFORMED OF SUCH PURPOSE), AND NONINFRINGEMENT WITH RESPECT TO THE SOFTWARE, ANY MODIFICATIONS THERETO AND WITH RESPECT TO THE USE OF THE FOREGOING.
+5. Limitation of Liability
+IN NO EVENT WILL VMWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES OF ANY KIND (INCLUDING WITHOUT LIMITATION LOSS OF PROFITS, LOSS OF USE, BUSINESS INTERRUPTION, LOSS OF DATA, COST OF COVER) IN CONNECTION WITH OR ARISING OUT OF OR RELATING TO THE FURNISHING, PERFORMANCE OR USE OF THE SOFTWARE OR ANY OTHER RIGHTS GRANTED HEREUNDER, WHETHER ALLEGED AS A BREACH OF CONTRACT OR TORTIOUS CONDUCT, INCLUDING NEGLIGENCE, AND EVEN IF VMWARE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+6. Term and Termination
+6.1 - This Agreement will continue in effect unless and until terminated earlier pursuant to this Section 6.
+6.2 - In the event You violate the terms of this Agreement, VMware may terminate this Agreement.
+6.3 - All licenses granted hereunder shall terminate upon the termination of this Agreement. Termination will be in addition to any rights and remedies available to VMware at law or equity or under this Agreement.
+6.4 - Termination of this Agreement will not affect the provisions regarding reservation of rights (Section 3.1), provisions disclaiming or limiting VMware`s liability (Sections 4 and 5), Termination (Section 6) or Miscellaneous (Section 7), which provisions will survive termination of this Agreement.
+7. Miscellaneous
+This Agreement contains the entire agreement of the parties with respect to the subject matter of this Agreement and supersedes all previous communications, representations, understandings and agreements, either oral or written, between the parties with respect to said subject matter. The relationship of the parties hereunder is that of independent contractors, and this Agreement will not be construed as creating an agency, partnership, joint venture or any other form of legal association between the parties. If any term, condition, or provision in this Agreement is found to be invalid, unlawful or unenforceable to any extent, this Agreement will be construed in a manner that most closely effectuates the intent of this Agreement. Such invalid term, condition or provision will be severed from the remaining terms, conditions and provisions, which will continue to be valid and enforceable to the fullest extent permitted by law. This Agreement will be interpreted and construed in accordance with the laws of the State of California and the United States of America, without regard to conflict of law principles. The U.N. Convention on Contracts for the International Sale of Goods shall not apply to this Agreement. All disputes arising out of this Agreement involving VMware or any of its subsidiaries shall be subject to the jurisdiction of the federal or state courts of northern California, with venue lying in Santa Clara County, California. No rights may be assigned, no obligations may be delegated, and this Agreement may not be transferred by You, in whole or in part, whether voluntary or by operation of law, including by way of sale of assets, merger or consolidation, without the prior written consent of VMware, and any purported assignment, delegation or transfer without such consent shall be void ab initio. Any waiver of the provisions of this Agreement or of a party`s rights or remedies under this Agreement must be in writing to be effective. Failure, neglect or delay by a party to enforce the provisions of this Agreement or its rights or remedies at any time, will not be construed or be deemed to be a waiver of such party`s rights under this Agreement and will not in any way affect the validity of the whole or any part of this Agreement or prejudice such party`s right to take subsequent action.
+
diff --git a/meta/files/common-licenses/Zlib b/meta/files/common-licenses/Zlib
new file mode 100644
index 0000000..f8b3884
--- /dev/null
+++ b/meta/files/common-licenses/Zlib
@@ -0,0 +1,21 @@
+
+zlib License
+
+
+  This software is provided `as-is`, without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+
diff --git a/meta/files/common-licenses/bzip2 b/meta/files/common-licenses/bzip2
new file mode 100644
index 0000000..8ec599d
--- /dev/null
+++ b/meta/files/common-licenses/bzip2
@@ -0,0 +1,41 @@
+--------------------------------------------------------------------------
+
+This program, "bzip2", the associated library "libbzip2", and all
+documentation, are copyright (C) 1996-2010 Julian R Seward.  All
+rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. The origin of this software must not be misrepresented; you must
+   not claim that you wrote the original software.  If you use this
+   software in a product, an acknowledgment in the product
+   documentation would be appreciated but is not required.
+
+3. Altered source versions must be plainly marked as such, and must
+   not be misrepresented as being the original software.
+
+4. The name of the author may not be used to endorse or promote
+   products derived from this software without specific prior written
+   permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+Julian Seward, jseward@bzip.org
+bzip2/libbzip2 version 1.0.6 of 6 September 2010
+
+--------------------------------------------------------------------------
diff --git a/meta/files/common-licenses/eCos-2.0 b/meta/files/common-licenses/eCos-2.0
new file mode 100644
index 0000000..39b5d63
--- /dev/null
+++ b/meta/files/common-licenses/eCos-2.0
@@ -0,0 +1,18 @@
+
+The eCos license version 2.0
+
+This file is part of eCos, the Embedded Configurable Operating System. Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+eCos is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 or (at your option) any later version.
+
+eCos is distributed in the hope that 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 eCos; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+As a special exception, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other works to produce a work based on this file, this file does not by itself cause the resulting work to be covered by the GNU General Public License. However the source code for this file must still be made available in accordance with section (3) of the GNU General Public License.
+
+This exception does not invalidate any other reasons why a work based on this file might be covered by the GNU General Public License.
+
+Alternative licenses for eCos may be arranged by contacting Red Hat, Inc. at http://sources.redhat.com/ecos/ecos-license/ -------------------------------------------
+
+####ECOSGPLCOPYRIGHTEND####
+
diff --git a/meta/files/common-licenses/gSOAP-1 b/meta/files/common-licenses/gSOAP-1
new file mode 100644
index 0000000..3f8638a
--- /dev/null
+++ b/meta/files/common-licenses/gSOAP-1
@@ -0,0 +1,380 @@
+
+gSOAP Public License
+
+Version 1.3b
+
+The gSOAP public license is derived from the Mozilla Public License (MPL1.1).
+The sections that were deleted from the original MPL1.1 text are 1.0.1, 2.1.
+(c),(d), 2.2.(c),(d), 8.2.(b), 10, and 11. Section 3.8 was added. The modified
+sections are 2.1.(b), 2.2.(b), 3.2 (simplified), 3.5 (deleted the last
+sentence), and 3.6 (simplified).
+This license applies to the gSOAP software package, with the exception of the
+soapcpp2 and wsdl2h source code located in gsoap/src and gsoap/wsdl, all code
+generated by soapcpp2 and wsdl2h, the UDDI source code gsoap/uddi2, and the Web
+server sample source code samples/webserver. To use any of these software tools
+and components commercially, a commercial license is required and can be
+obtained from www.genivia.com.
+1 DEFINITIONS.
+
+1.0.1.
+1.1. "Contributor"
+means each entity that creates or contributes to the creation of Modifications.
+1.2. "Contributor Version"
+means the combination of the Original Code, prior Modifications used by a
+Contributor, and the Modifications made by that particular Contributor.
+1.3. "Covered Code"
+means the Original Code, or Modifications or the combination of the Original
+Code, and Modifications, in each case including portions thereof.
+1.4. "Electronic Distribution Mechanism"
+means a mechanism generally accepted in the software development community for
+the electronic transfer of data.
+1.5. "Executable"
+means Covered Code in any form other than Source Code.
+1.6. "Initial Developer"
+means the individual or entity identified as the Initial Developer in the
+Source Code notice required by Exhibit A.
+1.7. "Larger Work"
+means a work which combines Covered Code or portions thereof with code not
+governed by the terms of this License.
+1.8. "License"
+means this document.
+1.8.1. "Licensable"
+means having the right to grant, to the maximum extent possible, whether at the
+time of the initial grant or subsequently acquired, any and all of the rights
+conveyed herein.
+1.9. "Modifications"
+means any addition to or deletion from the substance or structure of either the
+Original Code or any previous Modifications. When Covered Code is released as a
+series of files, a Modification is:
+A.
+Any addition to or deletion from the contents of a file containing Original
+Code or previous Modifications.
+B.
+Any new file that contains any part of the Original Code, or previous
+Modifications.
+1.10. "Original Code"
+means Source Code of computer software code which is described in the Source
+Code notice required by Exhibit A as Original Code, and which, at the time of
+its release under this License is not already Covered Code governed by this
+License.
+1.10.1. "Patent Claims"
+means any patent claim(s), now owned or hereafter acquired, including without
+limitation, method, process, and apparatus claims, in any patent Licensable by
+grantor.
+1.11. "Source Code"
+means the preferred form of the Covered Code for making modifications to it,
+including all modules it contains, plus any associated interface definition
+files, scripts used to control compilation and installation of an Executable,
+or source code differential comparisons against either the Original Code or
+another well known, available Covered Code of the Contributor's choice. The
+Source Code can be in a compressed or archival form, provided the appropriate
+decompression or de-archiving software is widely available for no charge.
+1.12. "You" (or "Your")
+means an individual or a legal entity exercising rights under, and complying
+with all of the terms of, this License or a future version of this License
+issued under Section 6.1. For legal entities, "You" includes any
+entity which controls, is controlled by, or is under common control with You.
+For purposes of this definition, "control" means (a) the power,
+direct or indirect, to cause the direction or management of such entity,
+whether by contract or otherwise, or (b) ownership of more than fifty percent
+(50%) of the outstanding shares or beneficial ownership of such entity.
+2 SOURCE CODE LICENSE.
+
+2.1. The Initial Developer Grant.
+
+The Initial Developer hereby grants You a world-wide, royalty-free, non-
+exclusive license, subject to third party intellectual property claims:
+(a)
+under intellectual property rights (other than patent or trademark) Licensable
+by Initial Developer to use, reproduce, modify, display, perform, sublicense
+and distribute the Original Code (or portions thereof) with or without
+Modifications, and/or as part of a Larger Work; and
+(b)
+under patents now or hereafter owned or controlled by Initial Developer, to
+make, have made, use and sell ("offer to sell and import") the
+Original Code, Modifications, or portions thereof, but solely to the extent
+that any such patent is reasonably necessary to enable You to utilize, alone or
+in combination with other software, the Original Code, Modifications, or any
+combination or portions thereof.
+(c)
+(d)
+
+2.2. Contributor Grant.
+
+Subject to third party intellectual property claims, each Contributor hereby
+grants You a world-wide, royalty-free, non-exclusive license
+(a)
+under intellectual property rights (other than patent or trademark) Licensable
+by Contributor, to use, reproduce, modify, display, perform, sublicense and
+distribute the Modifications created by such Contributor (or portions thereof)
+either on an unmodified basis, with other Modifications, as Covered Code and/or
+as part of a Larger Work; and
+(b)
+under patents now or hereafter owned or controlled by Contributor, to make,
+have made, use and sell ("offer to sell and import") the Contributor
+Version (or portions thereof), but solely to the extent that any such patent is
+reasonably necessary to enable You to utilize, alone or in combination with
+other software, the Contributor Version (or portions thereof).
+(c)
+(d)
+3 DISTRIBUTION OBLIGATIONS.
+
+3.1. Application of License.
+
+The Modifications which You create or to which You contribute are governed by
+the terms of this License, including without limitation Section 2.2. The Source
+Code version of Covered Code may be distributed only under the terms of this
+License or a future version of this License released under Section 6.1, and You
+must include a copy of this License with every copy of the Source Code You
+distribute. You may not offer or impose any terms on any Source Code version
+that alters or restricts the applicable version of this License or the
+recipients' rights hereunder. However, You may include an additional document
+offering the additional rights described in Section 3.5.
+
+3.2. Availability of Source Code.
+
+Any Modification created by You will be provided to the Initial Developer in
+Source Code form and are subject to the terms of the License.
+
+3.3. Description of Modifications.
+
+You must cause all Covered Code to which You contribute to contain a file
+documenting the changes You made to create that Covered Code and the date of
+any change. You must include a prominent statement that the Modification is
+derived, directly or indirectly, from Original Code provided by the Initial
+Developer and including the name of the Initial Developer in (a) the Source
+Code, and (b) in any notice in an Executable version or related documentation
+in which You describe the origin or ownership of the Covered Code.
+
+3.4. Intellectual Property Matters.
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party's intellectual
+property rights is required to exercise the rights granted by such Contributor
+under Sections 2.1 or 2.2, Contributor must include a text file with the Source
+Code distribution titled "LEGAL" which describes the claim and the
+party making the claim in sufficient detail that a recipient will know whom to
+contact. If Contributor obtains such knowledge after the Modification is made
+available as described in Section 3.2, Contributor shall promptly modify the
+LEGAL file in all copies Contributor makes available thereafter and shall take
+other steps (such as notifying appropriate mailing lists or newsgroups)
+reasonably calculated to inform those who received the Covered Code that new
+knowledge has been obtained.
+(b) Contributor APIs.
+If Contributor's Modifications include an application programming interface and
+Contributor has knowledge of patent licenses which are reasonably necessary to
+implement that API, Contributor must also include this information in the LEGAL
+file.
+(c) Representations.
+Contributor represents that, except as disclosed pursuant to Section 3.4(a)
+above, Contributor believes that Contributor's Modifications are Contributor's
+original creation(s) and/or Contributor has sufficient rights to grant the
+rights conveyed by this License.
+
+3.5. Required Notices.
+
+You must duplicate the notice in Exhibit A in each file of the Source Code. If
+it is not possible to put such notice in a particular Source Code file due to
+its structure, then You must include such notice in a location (such as a
+relevant directory) where a user would be likely to look for such a notice. If
+You created one or more Modification(s) You may add your name as a Contributor
+to the notice described in Exhibit A. You must also duplicate this License in
+any documentation for the Source Code where You describe recipients' rights or
+ownership rights relating to Covered Code. You may choose to offer, and to
+charge a fee for, warranty, support, indemnity or liability obligations to one
+or more recipients of Covered Code. However, You may do so only on Your own
+behalf, and not on behalf of the Initial Developer or any Contributor.
+
+3.6. Distribution of Executable Versions.
+
+You may distribute Covered Code in Executable form only if the requirements of
+Section 3.1-3.5 have been met for that Covered Code. You may distribute the
+Executable version of Covered Code or ownership rights under a license of Your
+choice, which may contain terms different from this License, provided that You
+are in compliance with the terms of this License and that the license for the
+Executable version does not attempt to limit or alter the recipient's rights in
+the Source Code version from the rights set forth in this License. If You
+distribute the Executable version under a different license You must make it
+absolutely clear that any terms which differ from this License are offered by
+You alone, not by the Initial Developer or any Contributor. If you distribute
+executable versions containing Covered Code as part of a product, you must
+reproduce the notice in Exhibit B in the documentation and/or other materials
+provided with the product.
+
+3.7. Larger Works.
+
+You may create a Larger Work by combining Covered Code with other code not
+governed by the terms of this License and distribute the Larger Work as a
+single product. In such a case, You must make sure the requirements of this
+License are fulfilled for the Covered Code.
+
+3.8. Restrictions.
+
+You may not remove any product identification, copyright, proprietary notices
+or labels from gSOAP.
+4 INABILITY TO COMPLY DUE TO STATUTE OR REGULATION.
+
+If it is impossible for You to comply with any of the terms of this License
+with respect to some or all of the Covered Code due to statute, judicial order,
+or regulation then You must: (a) comply with the terms of this License to the
+maximum extent possible; and (b) describe the limitations and the code they
+affect. Such description must be included in the LEGAL file described in
+Section 3.4 and must be included with all distributions of the Source Code.
+Except to the extent prohibited by statute or regulation, such description must
+be sufficiently detailed for a recipient of ordinary skill to be able to
+understand it.
+5 APPLICATION OF THIS LICENSE.
+
+This License applies to code to which the Initial Developer has attached the
+notice in Exhibit A and to related Covered Code.
+6 VERSIONS OF THE LICENSE.
+
+6.1. New Versions.
+
+Grantor may publish revised and/or new versions of the License from time to
+time. Each version will be given a distinguishing version number.
+
+6.2. Effect of New Versions.
+
+Once Covered Code has been published under a particular version of the License,
+You may always continue to use it under the terms of that version. You may also
+choose to use such Covered Code under the terms of any subsequent version of
+the License.
+
+6.3. Derivative Works.
+
+If You create or use a modified version of this License (which you may only do
+in order to apply it to code which is not already Covered Code governed by this
+License), You must (a) rename Your license so that the phrase "gSOAP"
+or any confusingly similar phrase do not appear in your license (except to note
+that your license differs from this License) and (b) otherwise make it clear
+that Your version of the license contains terms which differ from the gSOAP
+Public License. (Filling in the name of the Initial Developer, Original Code or
+Contributor in the notice described in Exhibit A shall not of themselves be
+deemed to be modifications of this License.)
+7 DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING,
+WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A
+PARTICULAR PURPOSE, NONINFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY
+RIGHTS, AND ANY WARRANTY THAT MAY ARISE BY REASON OF TRADE USAGE, CUSTOM, OR
+COURSE OF DEALING. WITHOUT LIMITING THE FOREGOING, YOU ACKNOWLEDGE THAT THE
+SOFTWARE IS PROVIDED "AS IS" AND THAT THE AUTHORS DO NOT WARRANT THE
+SOFTWARE WILL RUN UNINTERRUPTED OR ERROR FREE. LIMITED LIABILITY THE ENTIRE
+RISK AS TO RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY YOU. UNDER NO
+CIRCUMSTANCES WILL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL,
+EXEMPLARY OR CONSEQUENTIAL DAMAGES OF ANY KIND OR NATURE WHATSOEVER, WHETHER
+BASED ON CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
+OTHERWISE, ARISING OUT OF OR IN ANY WAY RELATED TO THE SOFTWARE, EVEN IF THE
+AUTHORS HAVE BEEN ADVISED ON THE POSSIBILITY OF SUCH DAMAGE OR IF SUCH DAMAGE
+COULD HAVE BEEN REASONABLY FORESEEN, AND NOTWITHSTANDING ANY FAILURE OF
+ESSENTIAL PURPOSE OF ANY EXCLUSIVE REMEDY PROVIDED. SUCH LIMITATION ON DAMAGES
+INCLUDES, BUT IS NOT LIMITED TO, DAMAGES FOR LOSS OF GOODWILL, LOST PROFITS,
+LOSS OF DATA OR SOFTWARE, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION OR
+IMPAIRMENT OF OTHER GOODS. IN NO EVENT WILL THE AUTHORS BE LIABLE FOR THE COSTS
+OF PROCUREMENT OF SUBSTITUTE SOFTWARE OR SERVICES. YOU ACKNOWLEDGE THAT THIS
+SOFTWARE IS NOT DESIGNED FOR USE IN ON-LINE EQUIPMENT IN HAZARDOUS ENVIRONMENTS
+SUCH AS OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR CONTROL, OR
+LIFE-CRITICAL APPLICATIONS. THE AUTHORS EXPRESSLY DISCLAIM ANY LIABILITY
+RESULTING FROM USE OF THE SOFTWARE IN ANY SUCH ON-LINE EQUIPMENT IN HAZARDOUS
+ENVIRONMENTS AND ACCEPTS NO LIABILITY IN RESPECT OF ANY ACTIONS OR CLAIMS BASED
+ON THE USE OF THE SOFTWARE IN ANY SUCH ON-LINE EQUIPMENT IN HAZARDOUS
+ENVIRONMENTS BY YOU. FOR PURPOSES OF THIS PARAGRAPH, THE TERM "LIFE-
+CRITICAL APPLICATION" MEANS AN APPLICATION IN WHICH THE FUNCTIONING OR
+MALFUNCTIONING OF THE SOFTWARE MAY RESULT DIRECTLY OR INDIRECTLY IN PHYSICAL
+INJURY OR LOSS OF HUMAN LIFE. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN
+ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED
+HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+8 TERMINATION.
+
+8.1.
+This License and the rights granted hereunder will terminate automatically if
+You fail to comply with terms herein and fail to cure such breach within 30
+days of becoming aware of the breach. All sublicenses to the Covered Code which
+are properly granted shall survive any termination of this License. Provisions
+which, by their nature, must remain in effect beyond the termination of this
+License shall survive.
+8.2.
+8.3.
+If You assert a patent infringement claim against Participant alleging that
+such Participant's Contributor Version directly or indirectly infringes any
+patent where such claim is resolved (such as by license or settlement) prior to
+the initiation of patent infringement litigation, then the reasonable value of
+the licenses granted by such Participant under Sections 2.1 or 2.2 shall be
+taken into account in determining the amount or value of any payment or
+license.
+8.4.
+In the event of termination under Sections 8.1 or 8.2 above, all end user
+license agreements (excluding distributors and resellers) which have been
+validly granted by You or any distributor hereunder prior to termination shall
+survive termination.
+9 LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING
+NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY
+OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY
+OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL,
+OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION,
+DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION,
+OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL
+HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING
+FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH
+LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF
+INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT
+APPLY TO YOU.
+10 U.S. GOVERNMENT END USERS.
+
+11 MISCELLANEOUS.
+
+12 RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is responsible
+for claims and damages arising, directly or indirectly, out of its utilization
+of rights under this License and You agree to work with Initial Developer and
+Contributors to distribute such responsibility on an equitable basis. Nothing
+herein is intended or shall be deemed to constitute any admission of liability.
+EXHIBIT A.
+
+"The contents of this file are subject to the gSOAP Public License Version
+1.3 (the "License"); you may not use this file except in compliance
+with the License. You may obtain a copy of the License at
+http://www.cs.fsu.edu/ engelen/soaplicense.html
+Software distributed under the License is distributed on an "AS IS"
+basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+for the specific language governing rights and limitations under the License.
+The Original Code of the gSOAP Software is: stdsoap.h, stdsoap2.h, stdsoap.c,
+stdsoap2.c, stdsoap.cpp, stdsoap2.cpp, soapcpp2.h, soapcpp2.c, soapcpp2_lex.l,
+soapcpp2_yacc.y, error2.h, error2.c, symbol2.c, init2.c, soapdoc2.html, and
+soapdoc2.pdf, httpget.h, httpget.c, stl.h, stldeque.h, stllist.h, stlvector.h,
+stlset.h.
+The Initial Developer of the Original Code is Robert A. van Engelen. Portions
+created by Robert A. van Engelen are Copyright (C) 2001-2004 Robert A. van
+Engelen, Genivia inc. All Rights Reserved.
+Contributor(s):
+"________________________."
+[Note: The text of this Exhibit A may differ slightly form the text of the
+notices in the Source Code files of the Original code. You should use the text
+of this Exhibit A rather than the text found in the Original Code Source Code
+for Your Modifications.]
+EXHIBIT B.
+
+"Part of the software embedded in this product is gSOAP software.
+Portions created by gSOAP are Copyright (C) 2001-2009 Robert A. van Engelen,
+Genivia inc. All Rights Reserved.
+THE SOFTWARE IN THIS PRODUCT WAS IN PART PROVIDED BY GENIVIA INC AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
+
+
+
+
+
diff --git a/meta/files/common-licenses/gSOAP-1.3b b/meta/files/common-licenses/gSOAP-1.3b
new file mode 100644
index 0000000..68c942b
--- /dev/null
+++ b/meta/files/common-licenses/gSOAP-1.3b
@@ -0,0 +1,157 @@
+
+gSOAP Public License
+
+Version 1.3b
+
+The gSOAP public license is derived from the Mozilla Public License (MPL1.1). The sections that were deleted from the original MPL1.1 text are 1.0.1, 2.1.(c),(d), 2.2.(c),(d), 8.2.(b), 10, and 11. Section 3.8 was added. The modified sections are 2.1.(b), 2.2.(b), 3.2 (simplified), 3.5 (deleted the last sentence), and 3.6 (simplified).
+This license applies to the gSOAP software package, with the exception of the soapcpp2 and wsdl2h source code located in gsoap/src and gsoap/wsdl, all code generated by soapcpp2 and wsdl2h, the UDDI source code gsoap/uddi2, and the Web server sample source code samples/webserver. To use any of these software tools and components commercially, a commercial license is required and can be obtained from www.genivia.com.
+1  DEFINITIONS.
+
+1.0.1.
+1.1. "Contributor"
+means each entity that creates or contributes to the creation of Modifications.
+1.2. "Contributor Version"
+means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor.
+1.3. "Covered Code"
+means the Original Code, or Modifications or the combination of the Original Code, and Modifications, in each case including portions thereof.
+1.4. "Electronic Distribution Mechanism"
+means a mechanism generally accepted in the software development community for the electronic transfer of data.
+1.5. "Executable"
+means Covered Code in any form other than Source Code.
+1.6. "Initial Developer"
+means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A.
+1.7. "Larger Work"
+means a work which combines Covered Code or portions thereof with code not governed by the terms of this License.
+1.8. "License"
+means this document.
+1.8.1. "Licensable"
+means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein.
+1.9. "Modifications"
+means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is:
+A.
+Any addition to or deletion from the contents of a file containing Original Code or previous Modifications.
+B.
+Any new file that contains any part of the Original Code, or previous Modifications.
+1.10. "Original Code"
+means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License.
+1.10.1. "Patent Claims"
+means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor.
+1.11. "Source Code"
+means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor`s choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge.
+1.12. "You" (or "Your")
+means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
+2  SOURCE CODE LICENSE.
+
+2.1. The Initial Developer Grant.
+
+The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims:
+(a)
+under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and
+(b)
+under patents now or hereafter owned or controlled by Initial Developer, to make, have made, use and sell ("offer to sell and import") the Original Code, Modifications, or portions thereof, but solely to the extent that any such patent is reasonably necessary to enable You to utilize, alone or in combination with other software, the Original Code, Modifications, or any combination or portions thereof.
+(c)
+(d)
+
+2.2. Contributor Grant.
+
+Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license
+(a)
+under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and
+(b)
+under patents now or hereafter owned or controlled by Contributor, to make, have made, use and sell ("offer to sell and import") the Contributor Version (or portions thereof), but solely to the extent that any such patent is reasonably necessary to enable You to utilize, alone or in combination with other software, the Contributor Version (or portions thereof).
+(c)
+(d)
+3  DISTRIBUTION OBLIGATIONS.
+
+3.1. Application of License.
+
+The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients` rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. 
+
+3.2. Availability of Source Code.
+
+Any Modification created by You will be provided to the Initial Developer in Source Code form and are subject to the terms of the License. 
+
+3.3. Description of Modifications.
+
+You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. 
+
+3.4. Intellectual Property Matters.
+(a) Third Party Claims.
+If Contributor has knowledge that a license under a third party`s intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained.
+(b) Contributor APIs.
+If Contributor`s Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file.
+(c) Representations.
+Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor`s Modifications are Contributor`s original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License.
+
+3.5. Required Notices.
+
+You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients` rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. 
+
+3.6. Distribution of Executable Versions.
+
+You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient`s rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. If you distribute executable versions containing Covered Code as part of a product, you must reproduce the notice in Exhibit B in the documentation and/or other materials provided with the product. 
+
+3.7. Larger Works.
+
+You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. 
+
+3.8. Restrictions.
+
+You may not remove any product identification, copyright, proprietary notices or labels from gSOAP.
+4  INABILITY TO COMPLY DUE TO STATUTE OR REGULATION.
+
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
+5  APPLICATION OF THIS LICENSE.
+
+This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code.
+6  VERSIONS OF THE LICENSE.
+
+6.1. New Versions.
+
+Grantor may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. 
+
+6.2. Effect of New Versions.
+
+Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License. 
+
+6.3. Derivative Works.
+
+If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrase "gSOAP" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the gSOAP Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.)
+7  DISCLAIMER OF WARRANTY.
+
+COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY, OF FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS, AND ANY WARRANTY THAT MAY ARISE BY REASON OF TRADE USAGE, CUSTOM, OR COURSE OF DEALING. WITHOUT LIMITING THE FOREGOING, YOU ACKNOWLEDGE THAT THE SOFTWARE IS PROVIDED "AS IS" AND THAT THE AUTHORS DO NOT WARRANT THE SOFTWARE WILL RUN UNINTERRUPTED OR ERROR FREE. LIMITED LIABILITY THE ENTIRE RISK AS TO RESULTS AND PERFORMANCE OF THE SOFTWARE IS ASSUMED BY YOU. UNDER NO CIRCUMSTANCES WILL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES OF ANY KIND OR NATURE WHATSOEVER, WHETHER BASED ON CONTRACT, WARRANTY, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, ARISING OUT OF OR IN ANY WAY RELATED TO THE SOFTWARE, EVEN IF THE AUTHORS HAVE BEEN ADVISED ON THE POSSIBILITY OF SUCH DAMAGE OR IF SUCH DAMAGE COULD HAVE BEEN REASONABLY FORESEEN, AND NOTWITHSTANDING ANY FAILURE OF ESSENTIAL PURPOSE OF ANY EXCLUSIVE REMEDY PROVIDED. SUCH LIMITATION ON DAMAGES INCLUDES, BUT IS NOT LIMITED TO, DAMAGES FOR LOSS OF GOODWILL, LOST PROFITS, LOSS OF DATA OR SOFTWARE, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION OR IMPAIRMENT OF OTHER GOODS. IN NO EVENT WILL THE AUTHORS BE LIABLE FOR THE COSTS OF PROCUREMENT OF SUBSTITUTE SOFTWARE OR SERVICES. YOU ACKNOWLEDGE THAT THIS SOFTWARE IS NOT DESIGNED FOR USE IN ON-LINE EQUIPMENT IN HAZARDOUS ENVIRONMENTS SUCH AS OPERATION OF NUCLEAR FACILITIES, AIRCRAFT NAVIGATION OR CONTROL, OR LIFE-CRITICAL APPLICATIONS. THE AUTHORS EXPRESSLY DISCLAIM ANY LIABILITY RESULTING FROM USE OF THE SOFTWARE IN ANY SUCH ON-LINE EQUIPMENT IN HAZARDOUS ENVIRONMENTS AND ACCEPTS NO LIABILITY IN RESPECT OF ANY ACTIONS OR CLAIMS BASED ON THE USE OF THE SOFTWARE IN ANY SUCH ON-LINE EQUIPMENT IN HAZARDOUS ENVIRONMENTS BY YOU. FOR PURPOSES OF THIS PARAGRAPH, THE TERM "LIFE-CRITICAL APPLICATION" MEANS AN APPLICATION IN WHICH THE FUNCTIONING OR MALFUNCTIONING OF THE SOFTWARE MAY RESULT DIRECTLY OR INDIRECTLY IN PHYSICAL INJURY OR LOSS OF HUMAN LIFE. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+8  TERMINATION.
+
+8.1.
+This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive.
+8.2.
+8.3.
+If You assert a patent infringement claim against Participant alleging that such Participant`s Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license.
+8.4.
+In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination.
+9  LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY`S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+10  U.S. GOVERNMENT END USERS.
+
+11  MISCELLANEOUS.
+
+12  RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability.
+EXHIBIT A.
+
+"The contents of this file are subject to the gSOAP Public License Version 1.3 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
+http://www.cs.fsu.edu/ engelen/soaplicense.html
+Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
+The Original Code of the gSOAP Software is: stdsoap.h, stdsoap2.h, stdsoap.c, stdsoap2.c, stdsoap.cpp, stdsoap2.cpp, soapcpp2.h, soapcpp2.c, soapcpp2_lex.l, soapcpp2_yacc.y, error2.h, error2.c, symbol2.c, init2.c, soapdoc2.html, and soapdoc2.pdf, httpget.h, httpget.c, stl.h, stldeque.h, stllist.h, stlvector.h, stlset.h.
+The Initial Developer of the Original Code is Robert A. van Engelen. Portions created by Robert A. van Engelen are Copyright (C) 2001-2004 Robert A. van Engelen, Genivia inc. All Rights Reserved.
+Contributor(s):
+"________________________."
+[Note: The text of this Exhibit A may differ slightly form the text of the notices in the Source Code files of the Original code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.]
+EXHIBIT B.
+
+"Part of the software embedded in this product is gSOAP software.
+Portions created by gSOAP are Copyright (C) 2001-2009 Robert A. van Engelen, Genivia inc. All Rights Reserved.
+THE SOFTWARE IN THIS PRODUCT WAS IN PART PROVIDED BY GENIVIA INC AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+
diff --git a/meta/files/common-licenses/tcl b/meta/files/common-licenses/tcl
new file mode 100644
index 0000000..d8049cd
--- /dev/null
+++ b/meta/files/common-licenses/tcl
@@ -0,0 +1,40 @@
+This software is copyrighted by the Regents of the University of
+California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
+Corporation and other parties.  The following terms apply to all files
+associated with the software unless explicitly disclaimed in
+individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7014 (b) (3) of DFARs.  Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license.
diff --git a/meta/files/common-licenses/unfs3 b/meta/files/common-licenses/unfs3
new file mode 100644
index 0000000..7f2b53f
--- /dev/null
+++ b/meta/files/common-licenses/unfs3
@@ -0,0 +1,24 @@
+UNFS3 user-space NFSv3 server
+(C) 2003, Pascal Schmidt <unfs3-server@ewetel.net>
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+3. The name of the author may not be used to endorse or promote products
+   derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/meta/files/deploydir_readme.txt b/meta/files/deploydir_readme.txt
new file mode 100644
index 0000000..97ec185
--- /dev/null
+++ b/meta/files/deploydir_readme.txt
@@ -0,0 +1,8 @@
+Files in the deploy directory will not be re-created automatically if you
+delete them. If you do delete a file, you will need to run:
+
+  bitbake -c clean TARGET
+  bitbake TARGET
+
+where TARGET is the name of the appropriate package or target e.g.
+"virtual/kernel" for the kernel, an image, etc.
diff --git a/meta/files/device_table-minimal.txt b/meta/files/device_table-minimal.txt
new file mode 100644
index 0000000..e4891cc
--- /dev/null
+++ b/meta/files/device_table-minimal.txt
@@ -0,0 +1,35 @@
+#<path>	<type> <mode>	<uid>	<gid>	<major>	<minor>	<start>	<inc>	<count>
+#/dev/mem    c      640      0       0       1       1       0        0        -
+#
+#type can be one of: 
+#    f	A regular file
+#    d	Directory
+#    c	Character special device file
+#    b	Block special device file
+#    p	Fifo (named pipe)
+
+/dev		d	755	root	root	-	-	-	-	-
+/dev/console	c	662	root	tty	5	1	-	-	-
+/dev/fb0	c	600	root	root	29	0	-	-	-
+/dev/hda	b	660	root	disk	3	0	-	-	-
+/dev/hda	b	660	root	disk	3	1	1	1	4
+/dev/kmem	c	640	root	kmem	1	2	-	-	-
+/dev/kmsg	c	600	root	root	1	11	-	-	-
+/dev/mem	c	640	root	kmem	1	1	-	-	-
+/dev/mmcblk0	b	660	root	disk	179	0	-	-	-
+/dev/mmcblk0p	b	660	root	disk	179	1	1	1	4
+/dev/mtd	c	660	root	disk	90	0	0	2	8
+/dev/mtdblock	b	640	root	root	31	0	0	1	8
+/dev/null	c	666	root	root	1	3	-	-	-
+/dev/ram	b	640	root	root	1	0	0	1	4
+/dev/random	c	644	root	root	1	8	-	-	-
+/dev/rtc	c	644	root	root	254	0	0	1	2
+/dev/sda	b	660	root	disk	8	0	-	-	-
+/dev/sda	b	660	root	disk	8	1	1	1	4
+/dev/sdb	b	660	root	disk	8	16	-	-	-
+/dev/sdb	b	660	root	disk	8	17	1	1	4
+/dev/tty	c	662	root	tty	5	0	-	-	-
+/dev/tty	c	666	root	tty	4	0	0	1	8
+/dev/ttyS	c	640	root	tty	4	64	0	1	2
+/dev/urandom	c	644	root	root	1	9	-	-	-
+/dev/zero	c	644	root	root	1	5	-	-	-
diff --git a/meta/files/fs-perms.txt b/meta/files/fs-perms.txt
new file mode 100644
index 0000000..109cbe5
--- /dev/null
+++ b/meta/files/fs-perms.txt
@@ -0,0 +1,67 @@
+# This file contains a list of files and directories with known permissions.
+# It is used by the packaging class to ensure that the permissions, owners and
+# group of listed files and directories are in sync across the system.
+#
+# The format of this file 
+#
+#<path>	<mode>	<uid>	<gid>	<walk>	<fmode>	<fuid>	<fgid>
+#
+# or
+#
+#<path> link <target>
+#
+# <path>: directory path
+# <mode>: mode for directory
+# <uid>:  uid for directory
+# <gid>:  gid for directory
+# <walk>: recursively walk the directory?  true or false
+# <fmode>: if walking, new mode for files
+# <fuid>:  if walking, new uid for files
+# <fgid>:  if walking, new gid for files
+# <target>: turn the directory into a symlink point to target
+#
+# in mode, uid or gid, a "-" means don't change any existing values
+#
+# /usr/src		0755	root	root	false	-	-	-
+# /usr/share/man	0755	root	root	true	0644	root	root
+
+# Note: all standard config directories are automatically assigned "0755 root root false - - -"
+
+# Documentation should always be corrected
+${mandir}		0755	root	root	true	0644	root	root
+${infodir}		0755	root	root	true	0644	root	root
+${docdir}		0755	root	root	true	0644	root	root
+${datadir}/gtk-doc	0755	root	root	true	0644	root	root
+
+# Fixup locales
+${datadir}/locale	0755	root	root	true	0644	root	root
+
+# Cleanup headers
+${includedir}		0755	root	root	true	0644	root	root
+${oldincludedir}	0755	root	root	true	0644	root	root
+
+# Cleanup debug src
+/usr/src/debug		0755	root	root	true	-	root	root
+
+# Items from base-files
+# Links
+${localstatedir}/run	link	/run
+${localstatedir}/log	link	volatile/log
+${localstatedir}/lock	link	/run/lock
+${localstatedir}/tmp	link	volatile/tmp
+
+/home				0755	root	root	false - - -
+/srv				0755	root	root	false - - -
+${prefix}/src			0755	root	root	false - - -
+${localstatedir}/local		0755	root	root	false - - -
+
+# Special permissions from base-files
+# Set 1777
+/tmp				01777	root	root	false - - -
+${localstatedir}/volatile/tmp	01777	root	root	false - - -
+
+# Set 755-lsb
+/srv				0755	root	root	false - - -
+
+# Set 2775-lsb
+/var/mail			02775	root	mail	false - - -
diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh
new file mode 100644
index 0000000..cd0a547
--- /dev/null
+++ b/meta/files/toolchain-shar-extract.sh
@@ -0,0 +1,189 @@
+#!/bin/bash
+
+INST_ARCH=$(uname -m | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
+SDK_ARCH=$(echo @SDK_ARCH@ | sed -e "s/i[3-6]86/ix86/" -e "s/x86[-_]64/x86_64/")
+
+verlte () {
+	[  "$1" = "`printf "$1\n$2" | sort -V | head -n1`" ]
+}
+
+verlt() {
+	[ "$1" = "$2" ] && return 1 || verlte $1 $2
+}
+
+verlt `uname -r` @OLDEST_KERNEL@
+if [ $? = 0 ]; then
+	echo "Error: The SDK needs a kernel > @OLDEST_KERNEL@"
+	exit 1
+fi
+
+if [ "$INST_ARCH" != "$SDK_ARCH" ]; then
+	# Allow for installation of ix86 SDK on x86_64 host
+	if [ "$INST_ARCH" != x86_64 -o "$SDK_ARCH" != ix86 ]; then
+		echo "Error: Installation machine not supported!"
+		exit 1
+	fi
+fi
+
+DEFAULT_INSTALL_DIR="@SDKPATH@"
+SUDO_EXEC=""
+target_sdk_dir=""
+answer=""
+relocate=1
+savescripts=0
+verbose=0
+while getopts ":yd:nDRS" OPT; do
+	case $OPT in
+	y)
+		answer="Y"
+		;;
+	d)
+		target_sdk_dir=$OPTARG
+		;;
+	n)
+		prepare_buildsystem="no"
+		;;
+	D)
+		verbose=1
+		;;
+	R)
+		relocate=0
+		savescripts=1
+		;;
+	S)
+		savescripts=1
+		;;
+	*)
+		echo "Usage: $(basename $0) [-y] [-d <dir>]"
+		echo "  -y         Automatic yes to all prompts"
+		echo "  -d <dir>   Install the SDK to <dir>"
+		echo "======== Extensible SDK only options ============"
+		echo "  -n         Do not prepare the build system"
+		echo "======== Advanced DEBUGGING ONLY OPTIONS ========"
+		echo "  -S         Save relocation scripts"
+		echo "  -R         Do not relocate executables"
+		echo "  -D         use set -x to see what is going on"
+		exit 1
+		;;
+	esac
+done
+
+echo "@SDK_TITLE@ installer version @SDK_VERSION@"
+echo "==========================================================="
+
+if [ $verbose = 1 ] ; then
+	set -x
+fi
+
+@SDK_PRE_INSTALL_COMMAND@
+
+# SDK_EXTENSIBLE is exposed from the SDK_PRE_INSTALL_COMMAND above
+if [ "$SDK_EXTENSIBLE" = "1" ]; then
+	DEFAULT_INSTALL_DIR="@SDKEXTPATH@"
+fi
+
+if [ "$target_sdk_dir" = "" ]; then
+	if [ "$answer" = "Y" ]; then
+		target_sdk_dir="$DEFAULT_INSTALL_DIR"
+	else
+		read -e -p "Enter target directory for SDK (default: $DEFAULT_INSTALL_DIR): " target_sdk_dir
+		[ "$target_sdk_dir" = "" ] && target_sdk_dir=$DEFAULT_INSTALL_DIR
+	fi
+fi
+
+eval target_sdk_dir=$(echo "$target_sdk_dir"|sed 's/ /\\ /g')
+if [ -d "$target_sdk_dir" ]; then
+	target_sdk_dir=$(cd "$target_sdk_dir"; pwd)
+else
+	target_sdk_dir=$(readlink -m "$target_sdk_dir")
+fi
+
+if [ "$SDK_EXTENSIBLE" = "1" ]; then
+	# We're going to be running the build system, additional restrictions apply
+	if echo "$target_sdk_dir" | grep -q '[+\ @]'; then
+		echo "The target directory path ($target_sdk_dir) contains illegal" \
+		     "characters such as spaces, @ or +. Abort!"
+		exit 1
+	fi
+else
+	if [ -n "$(echo $target_sdk_dir|grep ' ')" ]; then
+		echo "The target directory path ($target_sdk_dir) contains spaces. Abort!"
+		exit 1
+	fi
+fi
+
+if [ -e "$target_sdk_dir/environment-setup-@REAL_MULTIMACH_TARGET_SYS@" ]; then
+	echo "The directory \"$target_sdk_dir\" already contains a SDK for this architecture."
+	printf "If you continue, existing files will be overwritten! Proceed[y/N]? "
+
+	default_answer="n"
+else
+	printf "You are about to install the SDK to \"$target_sdk_dir\". Proceed[Y/n]? "
+
+	default_answer="y"
+fi
+
+if [ "$answer" = "" ]; then
+	read answer
+	[ "$answer" = "" ] && answer="$default_answer"
+else
+	echo $answer
+fi
+
+if [ "$answer" != "Y" -a "$answer" != "y" ]; then
+	echo "Installation aborted!"
+	exit 1
+fi
+
+# Try to create the directory (this will not succeed if user doesn't have rights)
+mkdir -p $target_sdk_dir >/dev/null 2>&1
+
+# if don't have the right to access dir, gain by sudo 
+if [ ! -x $target_sdk_dir -o ! -w $target_sdk_dir -o ! -r $target_sdk_dir ]; then 
+	if [ "$SDK_EXTENSIBLE" = "1" ]; then
+		echo "Unable to access \"$target_sdk_dir\", will not attempt to use" \
+		     "sudo as as extensible SDK cannot be used as root."
+		exit 1
+	fi
+
+	SUDO_EXEC=$(which "sudo")
+	if [ -z $SUDO_EXEC ]; then
+		echo "No command 'sudo' found, please install sudo first. Abort!"
+		exit 1
+	fi
+
+	# test sudo could gain root right
+	$SUDO_EXEC pwd >/dev/null 2>&1
+	[ $? -ne 0 ] && echo "Sorry, you are not allowed to execute as root." && exit 1
+
+	# now that we have sudo rights, create the directory
+	$SUDO_EXEC mkdir -p $target_sdk_dir >/dev/null 2>&1
+fi
+
+payload_offset=$(($(grep -na -m1 "^MARKER:$" $0|cut -d':' -f1) + 1))
+
+printf "Extracting SDK..."
+tail -n +$payload_offset $0| $SUDO_EXEC tar xj -C $target_sdk_dir
+echo "done"
+
+printf "Setting it up..."
+# fix environment paths
+for env_setup_script in `ls $target_sdk_dir/environment-setup-*`; do
+	$SUDO_EXEC sed -e "s:@SDKPATH@:$target_sdk_dir:g" -i $env_setup_script
+done
+
+@SDK_POST_INSTALL_COMMAND@
+
+# delete the relocating script, so that user is forced to re-run the installer
+# if he/she wants another location for the sdk
+if [ $savescripts = 0 ] ; then
+	$SUDO_EXEC rm -f ${env_setup_script%/*}/relocate_sdk.py ${env_setup_script%/*}/relocate_sdk.sh
+fi
+
+echo "SDK has been successfully set up and is ready to be used."
+echo "Each time you wish to use the SDK in a new shell session, you need to source the environment setup script e.g."
+echo " \$ . $target_sdk_dir/environment-setup-@REAL_MULTIMACH_TARGET_SYS@"
+
+exit 0
+
+MARKER:
diff --git a/meta/files/toolchain-shar-relocate.sh b/meta/files/toolchain-shar-relocate.sh
new file mode 100644
index 0000000..dfb8e16
--- /dev/null
+++ b/meta/files/toolchain-shar-relocate.sh
@@ -0,0 +1,50 @@
+# fix dynamic loader paths in all ELF SDK binaries
+native_sysroot=$($SUDO_EXEC cat $env_setup_script |grep 'OECORE_NATIVE_SYSROOT='|cut -d'=' -f2|tr -d '"')
+dl_path=$($SUDO_EXEC find $native_sysroot/lib -name "ld-linux*")
+if [ "$dl_path" = "" ] ; then
+	echo "SDK could not be set up. Relocate script unable to find ld-linux.so. Abort!"
+	exit 1
+fi
+executable_files=$($SUDO_EXEC find $native_sysroot -type f \
+	\( -perm -0100 -o -perm -0010 -o -perm -0001 \) -printf "'%h/%f' ")
+
+tdir=`mktemp -d`
+if [ x$tdir = x ] ; then
+   echo "SDK relocate failed, could not create a temporary directory"
+   exit 1
+fi
+echo "#!/bin/bash" > $tdir/relocate_sdk.sh
+echo exec ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files >> $tdir/relocate_sdk.sh
+$SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
+$SUDO_EXEC chmod 755 ${env_setup_script%/*}/relocate_sdk.sh
+rm -rf $tdir
+if [ $relocate = 1 ] ; then
+	$SUDO_EXEC ${env_setup_script%/*}/relocate_sdk.sh
+	if [ $? -ne 0 ]; then
+		echo "SDK could not be set up. Relocate script failed. Abort!"
+		exit 1
+	fi
+fi
+
+# replace @SDKPATH@ with the new prefix in all text files: configs/scripts/etc
+for replace in "$target_sdk_dir -maxdepth 1" "$native_sysroot"; do
+	$SUDO_EXEC find $replace -type f -exec file '{}' \; | \
+		grep ":.*\(ASCII\|script\|source\).*text" | \
+		awk -F':' '{printf "\"%s\"\n", $1}' | \
+		grep -v "$target_sdk_dir/environment-setup-*" | \
+		$SUDO_EXEC xargs -n32 sed -i -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:g"
+done
+
+# change all symlinks pointing to @SDKPATH@
+for l in $($SUDO_EXEC find $native_sysroot -type l); do
+	$SUDO_EXEC ln -sfn $(readlink $l|$SUDO_EXEC sed -e "s:$DEFAULT_INSTALL_DIR:$target_sdk_dir:") $l
+done
+
+# find out all perl scripts in $native_sysroot and modify them replacing the
+# host perl with SDK perl.
+for perl_script in $($SUDO_EXEC find $native_sysroot -type f -exec grep -l "^#!.*perl" '{}' \;); do
+	$SUDO_EXEC sed -i -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" -e \
+		"s: /usr/bin/perl: /usr/bin/env perl:g" $perl_script
+done
+
+echo done
diff --git a/meta/lib/oe/__init__.py b/meta/lib/oe/__init__.py
new file mode 100644
index 0000000..3ad9513
--- /dev/null
+++ b/meta/lib/oe/__init__.py
@@ -0,0 +1,2 @@
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py
new file mode 100644
index 0000000..5395c76
--- /dev/null
+++ b/meta/lib/oe/buildhistory_analysis.py
@@ -0,0 +1,456 @@
+# Report significant differences in the buildhistory repository since a specific revision
+#
+# Copyright (C) 2012 Intel Corporation
+# Author: Paul Eggleton <paul.eggleton@linux.intel.com>
+#
+# Note: requires GitPython 0.3.1+
+#
+# You can use this from the command line by running scripts/buildhistory-diff
+#
+
+import sys
+import os.path
+import difflib
+import git
+import re
+import bb.utils
+
+
+# How to display fields
+list_fields = ['DEPENDS', 'RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RREPLACES', 'RCONFLICTS', 'FILES', 'FILELIST', 'USER_CLASSES', 'IMAGE_CLASSES', 'IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS', 'PACKAGE_EXCLUDE']
+list_order_fields = ['PACKAGES']
+defaultval_map = {'PKG': 'PKG', 'PKGE': 'PE', 'PKGV': 'PV', 'PKGR': 'PR'}
+numeric_fields = ['PKGSIZE', 'IMAGESIZE']
+# Fields to monitor
+monitor_fields = ['RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RREPLACES', 'RCONFLICTS', 'PACKAGES', 'FILELIST', 'PKGSIZE', 'IMAGESIZE', 'PKG']
+ver_monitor_fields = ['PKGE', 'PKGV', 'PKGR']
+# Percentage change to alert for numeric fields
+monitor_numeric_threshold = 10
+# Image files to monitor (note that image-info.txt is handled separately)
+img_monitor_files = ['installed-package-names.txt', 'files-in-image.txt']
+# Related context fields for reporting (note: PE, PV & PR are always reported for monitored package fields)
+related_fields = {}
+related_fields['RDEPENDS'] = ['DEPENDS']
+related_fields['RRECOMMENDS'] = ['DEPENDS']
+related_fields['FILELIST'] = ['FILES']
+related_fields['PKGSIZE'] = ['FILELIST']
+related_fields['files-in-image.txt'] = ['installed-package-names.txt', 'USER_CLASSES', 'IMAGE_CLASSES', 'ROOTFS_POSTPROCESS_COMMAND', 'IMAGE_POSTPROCESS_COMMAND']
+related_fields['installed-package-names.txt'] = ['IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS', 'NO_RECOMMENDATIONS', 'PACKAGE_EXCLUDE']
+
+
+class ChangeRecord:
+    def __init__(self, path, fieldname, oldvalue, newvalue, monitored):
+        self.path = path
+        self.fieldname = fieldname
+        self.oldvalue = oldvalue
+        self.newvalue = newvalue
+        self.monitored = monitored
+        self.related = []
+        self.filechanges = None
+
+    def __str__(self):
+        return self._str_internal(True)
+
+    def _str_internal(self, outer):
+        if outer:
+            if '/image-files/' in self.path:
+                prefix = '%s: ' % self.path.split('/image-files/')[0]
+            else:
+                prefix = '%s: ' % self.path
+        else:
+            prefix = ''
+
+        def pkglist_combine(depver):
+            pkglist = []
+            for k,v in depver.iteritems():
+                if v:
+                    pkglist.append("%s (%s)" % (k,v))
+                else:
+                    pkglist.append(k)
+            return pkglist
+
+        if self.fieldname in list_fields or self.fieldname in list_order_fields:
+            if self.fieldname in ['RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RREPLACES', 'RCONFLICTS']:
+                (depvera, depverb) = compare_pkg_lists(self.oldvalue, self.newvalue)
+                aitems = pkglist_combine(depvera)
+                bitems = pkglist_combine(depverb)
+            else:
+                aitems = self.oldvalue.split()
+                bitems = self.newvalue.split()
+            removed = list(set(aitems) - set(bitems))
+            added = list(set(bitems) - set(aitems))
+
+            if removed or added:
+                if removed and not bitems:
+                    out = '%s: removed all items "%s"' % (self.fieldname, ' '.join(removed))
+                else:
+                    out = '%s:%s%s' % (self.fieldname, ' removed "%s"' % ' '.join(removed) if removed else '', ' added "%s"' % ' '.join(added) if added else '')
+            else:
+                out = '%s changed order' % self.fieldname
+        elif self.fieldname in numeric_fields:
+            aval = int(self.oldvalue or 0)
+            bval = int(self.newvalue or 0)
+            if aval != 0:
+                percentchg = ((bval - aval) / float(aval)) * 100
+            else:
+                percentchg = 100
+            out = '%s changed from %s to %s (%s%d%%)' % (self.fieldname, self.oldvalue or "''", self.newvalue or "''", '+' if percentchg > 0 else '', percentchg)
+        elif self.fieldname in defaultval_map:
+            out = '%s changed from %s to %s' % (self.fieldname, self.oldvalue, self.newvalue)
+            if self.fieldname == 'PKG' and '[default]' in self.newvalue:
+                out += ' - may indicate debian renaming failure'
+        elif self.fieldname in ['pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm']:
+            if self.oldvalue and self.newvalue:
+                out = '%s changed:\n  ' % self.fieldname
+            elif self.newvalue:
+                out = '%s added:\n  ' % self.fieldname
+            elif self.oldvalue:
+                out = '%s cleared:\n  ' % self.fieldname
+            alines = self.oldvalue.splitlines()
+            blines = self.newvalue.splitlines()
+            diff = difflib.unified_diff(alines, blines, self.fieldname, self.fieldname, lineterm='')
+            out += '\n  '.join(list(diff)[2:])
+            out += '\n  --'
+        elif self.fieldname in img_monitor_files or '/image-files/' in self.path:
+            fieldname = self.fieldname
+            if '/image-files/' in self.path:
+                fieldname = os.path.join('/' + self.path.split('/image-files/')[1], self.fieldname)
+                out = 'Changes to %s:\n  ' % fieldname
+            else:
+                if outer:
+                    prefix = 'Changes to %s ' % self.path
+                out = '(%s):\n  ' % self.fieldname
+            if self.filechanges:
+                out += '\n  '.join(['%s' % i for i in self.filechanges])
+            else:
+                alines = self.oldvalue.splitlines()
+                blines = self.newvalue.splitlines()
+                diff = difflib.unified_diff(alines, blines, fieldname, fieldname, lineterm='')
+                out += '\n  '.join(list(diff))
+                out += '\n  --'
+        else:
+            out = '%s changed from "%s" to "%s"' % (self.fieldname, self.oldvalue, self.newvalue)
+
+        if self.related:
+            for chg in self.related:
+                if not outer and chg.fieldname in ['PE', 'PV', 'PR']:
+                    continue
+                for line in chg._str_internal(False).splitlines():
+                    out += '\n  * %s' % line
+
+        return '%s%s' % (prefix, out)
+
+class FileChange:
+    changetype_add = 'A'
+    changetype_remove = 'R'
+    changetype_type = 'T'
+    changetype_perms = 'P'
+    changetype_ownergroup = 'O'
+    changetype_link = 'L'
+
+    def __init__(self, path, changetype, oldvalue = None, newvalue = None):
+        self.path = path
+        self.changetype = changetype
+        self.oldvalue = oldvalue
+        self.newvalue = newvalue
+
+    def _ftype_str(self, ftype):
+        if ftype == '-':
+            return 'file'
+        elif ftype == 'd':
+            return 'directory'
+        elif ftype == 'l':
+            return 'symlink'
+        elif ftype == 'c':
+            return 'char device'
+        elif ftype == 'b':
+            return 'block device'
+        elif ftype == 'p':
+            return 'fifo'
+        elif ftype == 's':
+            return 'socket'
+        else:
+            return 'unknown (%s)' % ftype
+
+    def __str__(self):
+        if self.changetype == self.changetype_add:
+            return '%s was added' % self.path
+        elif self.changetype == self.changetype_remove:
+            return '%s was removed' % self.path
+        elif self.changetype == self.changetype_type:
+            return '%s changed type from %s to %s' % (self.path, self._ftype_str(self.oldvalue), self._ftype_str(self.newvalue))
+        elif self.changetype == self.changetype_perms:
+            return '%s changed permissions from %s to %s' % (self.path, self.oldvalue, self.newvalue)
+        elif self.changetype == self.changetype_ownergroup:
+            return '%s changed owner/group from %s to %s' % (self.path, self.oldvalue, self.newvalue)
+        elif self.changetype == self.changetype_link:
+            return '%s changed symlink target from %s to %s' % (self.path, self.oldvalue, self.newvalue)
+        else:
+            return '%s changed (unknown)' % self.path
+
+
+def blob_to_dict(blob):
+    alines = blob.data_stream.read().splitlines()
+    adict = {}
+    for line in alines:
+        splitv = [i.strip() for i in line.split('=',1)]
+        if len(splitv) > 1:
+            adict[splitv[0]] = splitv[1]
+    return adict
+
+
+def file_list_to_dict(lines):
+    adict = {}
+    for line in lines:
+        # Leave the last few fields intact so we handle file names containing spaces
+        splitv = line.split(None,4)
+        # Grab the path and remove the leading .
+        path = splitv[4][1:].strip()
+        # Handle symlinks
+        if(' -> ' in path):
+            target = path.split(' -> ')[1]
+            path = path.split(' -> ')[0]
+            adict[path] = splitv[0:3] + [target]
+        else:
+            adict[path] = splitv[0:3]
+    return adict
+
+
+def compare_file_lists(alines, blines):
+    adict = file_list_to_dict(alines)
+    bdict = file_list_to_dict(blines)
+    filechanges = []
+    for path, splitv in adict.iteritems():
+        newsplitv = bdict.pop(path, None)
+        if newsplitv:
+            # Check type
+            oldvalue = splitv[0][0]
+            newvalue = newsplitv[0][0]
+            if oldvalue != newvalue:
+                filechanges.append(FileChange(path, FileChange.changetype_type, oldvalue, newvalue))
+            # Check permissions
+            oldvalue = splitv[0][1:]
+            newvalue = newsplitv[0][1:]
+            if oldvalue != newvalue:
+                filechanges.append(FileChange(path, FileChange.changetype_perms, oldvalue, newvalue))
+            # Check owner/group
+            oldvalue = '%s/%s' % (splitv[1], splitv[2])
+            newvalue = '%s/%s' % (newsplitv[1], newsplitv[2])
+            if oldvalue != newvalue:
+                filechanges.append(FileChange(path, FileChange.changetype_ownergroup, oldvalue, newvalue))
+            # Check symlink target
+            if newsplitv[0][0] == 'l':
+                if len(splitv) > 3:
+                    oldvalue = splitv[3]
+                else:
+                    oldvalue = None
+                newvalue = newsplitv[3]
+                if oldvalue != newvalue:
+                    filechanges.append(FileChange(path, FileChange.changetype_link, oldvalue, newvalue))
+        else:
+            filechanges.append(FileChange(path, FileChange.changetype_remove))
+
+    # Whatever is left over has been added
+    for path in bdict:
+        filechanges.append(FileChange(path, FileChange.changetype_add))
+
+    return filechanges
+
+
+def compare_lists(alines, blines):
+    removed = list(set(alines) - set(blines))
+    added = list(set(blines) - set(alines))
+
+    filechanges = []
+    for pkg in removed:
+        filechanges.append(FileChange(pkg, FileChange.changetype_remove))
+    for pkg in added:
+        filechanges.append(FileChange(pkg, FileChange.changetype_add))
+
+    return filechanges
+
+
+def compare_pkg_lists(astr, bstr):
+    depvera = bb.utils.explode_dep_versions2(astr)
+    depverb = bb.utils.explode_dep_versions2(bstr)
+
+    # Strip out changes where the version has increased
+    remove = []
+    for k in depvera:
+        if k in depverb:
+            dva = depvera[k]
+            dvb = depverb[k]
+            if dva and dvb and len(dva) == len(dvb):
+                # Since length is the same, sort so that prefixes (e.g. >=) will line up
+                dva.sort()
+                dvb.sort()
+                removeit = True
+                for dvai, dvbi in zip(dva, dvb):
+                    if dvai != dvbi:
+                        aiprefix = dvai.split(' ')[0]
+                        biprefix = dvbi.split(' ')[0]
+                        if aiprefix == biprefix and aiprefix in ['>=', '=']:
+                            if bb.utils.vercmp(bb.utils.split_version(dvai), bb.utils.split_version(dvbi)) > 0:
+                                removeit = False
+                                break
+                        else:
+                            removeit = False
+                            break
+                if removeit:
+                    remove.append(k)
+
+    for k in remove:
+        depvera.pop(k)
+        depverb.pop(k)
+
+    return (depvera, depverb)
+
+
+def compare_dict_blobs(path, ablob, bblob, report_all, report_ver):
+    adict = blob_to_dict(ablob)
+    bdict = blob_to_dict(bblob)
+
+    pkgname = os.path.basename(path)
+
+    defaultvals = {}
+    defaultvals['PKG'] = pkgname
+    defaultvals['PKGE'] = '0'
+
+    changes = []
+    keys = list(set(adict.keys()) | set(bdict.keys()) | set(defaultval_map.keys()))
+    for key in keys:
+        astr = adict.get(key, '')
+        bstr = bdict.get(key, '')
+        if key in ver_monitor_fields:
+            monitored = report_ver or astr or bstr
+        else:
+            monitored = key in monitor_fields
+        mapped_key = defaultval_map.get(key, '')
+        if mapped_key:
+            if not astr:
+                astr = '%s [default]' % adict.get(mapped_key, defaultvals.get(key, ''))
+            if not bstr:
+                bstr = '%s [default]' % bdict.get(mapped_key, defaultvals.get(key, ''))
+
+        if astr != bstr:
+            if (not report_all) and key in numeric_fields:
+                aval = int(astr or 0)
+                bval = int(bstr or 0)
+                if aval != 0:
+                    percentchg = ((bval - aval) / float(aval)) * 100
+                else:
+                    percentchg = 100
+                if abs(percentchg) < monitor_numeric_threshold:
+                    continue
+            elif (not report_all) and key in list_fields:
+                if key == "FILELIST" and path.endswith("-dbg") and bstr.strip() != '':
+                    continue
+                if key in ['RPROVIDES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RREPLACES', 'RCONFLICTS']:
+                    (depvera, depverb) = compare_pkg_lists(astr, bstr)
+                    if depvera == depverb:
+                        continue
+                alist = astr.split()
+                alist.sort()
+                blist = bstr.split()
+                blist.sort()
+                # We don't care about the removal of self-dependencies
+                if pkgname in alist and not pkgname in blist:
+                    alist.remove(pkgname)
+                if ' '.join(alist) == ' '.join(blist):
+                    continue
+
+            chg = ChangeRecord(path, key, astr, bstr, monitored)
+            changes.append(chg)
+    return changes
+
+
+def process_changes(repopath, revision1, revision2='HEAD', report_all=False, report_ver=False):
+    repo = git.Repo(repopath)
+    assert repo.bare == False
+    commit = repo.commit(revision1)
+    diff = commit.diff(revision2)
+
+    changes = []
+    for d in diff.iter_change_type('M'):
+        path = os.path.dirname(d.a_blob.path)
+        if path.startswith('packages/'):
+            filename = os.path.basename(d.a_blob.path)
+            if filename == 'latest':
+                changes.extend(compare_dict_blobs(path, d.a_blob, d.b_blob, report_all, report_ver))
+            elif filename.startswith('latest.'):
+                chg = ChangeRecord(path, filename, d.a_blob.data_stream.read(), d.b_blob.data_stream.read(), True)
+                changes.append(chg)
+        elif path.startswith('images/'):
+            filename = os.path.basename(d.a_blob.path)
+            if filename in img_monitor_files:
+                if filename == 'files-in-image.txt':
+                    alines = d.a_blob.data_stream.read().splitlines()
+                    blines = d.b_blob.data_stream.read().splitlines()
+                    filechanges = compare_file_lists(alines,blines)
+                    if filechanges:
+                        chg = ChangeRecord(path, filename, None, None, True)
+                        chg.filechanges = filechanges
+                        changes.append(chg)
+                elif filename == 'installed-package-names.txt':
+                    alines = d.a_blob.data_stream.read().splitlines()
+                    blines = d.b_blob.data_stream.read().splitlines()
+                    filechanges = compare_lists(alines,blines)
+                    if filechanges:
+                        chg = ChangeRecord(path, filename, None, None, True)
+                        chg.filechanges = filechanges
+                        changes.append(chg)
+                else:
+                    chg = ChangeRecord(path, filename, d.a_blob.data_stream.read(), d.b_blob.data_stream.read(), True)
+                    changes.append(chg)
+            elif filename == 'image-info.txt':
+                changes.extend(compare_dict_blobs(path, d.a_blob, d.b_blob, report_all, report_ver))
+            elif '/image-files/' in path:
+                chg = ChangeRecord(path, filename, d.a_blob.data_stream.read(), d.b_blob.data_stream.read(), True)
+                changes.append(chg)
+
+    # Look for added preinst/postinst/prerm/postrm
+    # (without reporting newly added recipes)
+    addedpkgs = []
+    addedchanges = []
+    for d in diff.iter_change_type('A'):
+        path = os.path.dirname(d.b_blob.path)
+        if path.startswith('packages/'):
+            filename = os.path.basename(d.b_blob.path)
+            if filename == 'latest':
+                addedpkgs.append(path)
+            elif filename.startswith('latest.'):
+                chg = ChangeRecord(path, filename[7:], '', d.b_blob.data_stream.read(), True)
+                addedchanges.append(chg)
+    for chg in addedchanges:
+        found = False
+        for pkg in addedpkgs:
+            if chg.path.startswith(pkg):
+                found = True
+                break
+        if not found:
+            changes.append(chg)
+
+    # Look for cleared preinst/postinst/prerm/postrm
+    for d in diff.iter_change_type('D'):
+        path = os.path.dirname(d.a_blob.path)
+        if path.startswith('packages/'):
+            filename = os.path.basename(d.a_blob.path)
+            if filename != 'latest' and filename.startswith('latest.'):
+                chg = ChangeRecord(path, filename[7:], d.a_blob.data_stream.read(), '', True)
+                changes.append(chg)
+
+    # Link related changes
+    for chg in changes:
+        if chg.monitored:
+            for chg2 in changes:
+                # (Check dirname in the case of fields from recipe info files)
+                if chg.path == chg2.path or os.path.dirname(chg.path) == chg2.path:
+                    if chg2.fieldname in related_fields.get(chg.fieldname, []):
+                        chg.related.append(chg2)
+                    elif chg.path == chg2.path and chg.path.startswith('packages/') and chg2.fieldname in ['PE', 'PV', 'PR']:
+                        chg.related.append(chg2)
+
+    if report_all:
+        return changes
+    else:
+        return [chg for chg in changes if chg.monitored]
diff --git a/meta/lib/oe/cachedpath.py b/meta/lib/oe/cachedpath.py
new file mode 100644
index 0000000..0840cc4
--- /dev/null
+++ b/meta/lib/oe/cachedpath.py
@@ -0,0 +1,233 @@
+#
+# Based on standard python library functions but avoid
+# repeated stat calls. Its assumed the files will not change from under us
+# so we can cache stat calls.
+#
+
+import os
+import errno
+import stat as statmod
+
+class CachedPath(object):
+    def __init__(self):
+        self.statcache = {}
+        self.lstatcache = {}
+        self.normpathcache = {}
+        return
+
+    def updatecache(self, x):
+        x = self.normpath(x)
+        if x in self.statcache:
+            del self.statcache[x]
+        if x in self.lstatcache:
+            del self.lstatcache[x]
+
+    def normpath(self, path):
+        if path in self.normpathcache:
+            return self.normpathcache[path]
+        newpath = os.path.normpath(path)
+        self.normpathcache[path] = newpath
+        return newpath
+
+    def _callstat(self, path):
+        if path in self.statcache:
+            return self.statcache[path]
+        try:
+            st = os.stat(path)
+            self.statcache[path] = st
+            return st
+        except os.error:
+            self.statcache[path] = False
+            return False
+
+    # We might as well call lstat and then only 
+    # call stat as well in the symbolic link case
+    # since this turns out to be much more optimal
+    # in real world usage of this cache
+    def callstat(self, path):
+        path = self.normpath(path)
+        self.calllstat(path)
+        return self.statcache[path]
+
+    def calllstat(self, path):
+        path = self.normpath(path)
+        if path in self.lstatcache:
+            return self.lstatcache[path]
+        #bb.error("LStatpath:" + path)
+        try:
+            lst = os.lstat(path)
+            self.lstatcache[path] = lst
+            if not statmod.S_ISLNK(lst.st_mode):
+                self.statcache[path] = lst
+            else:
+                self._callstat(path)
+            return lst
+        except (os.error, AttributeError):
+            self.lstatcache[path] = False
+            self.statcache[path] = False
+            return False
+
+    # This follows symbolic links, so both islink() and isdir() can be true
+    # for the same path ono systems that support symlinks
+    def isfile(self, path):
+        """Test whether a path is a regular file"""
+        st = self.callstat(path)
+        if not st:
+            return False
+        return statmod.S_ISREG(st.st_mode)
+
+    # Is a path a directory?
+    # This follows symbolic links, so both islink() and isdir()
+    # can be true for the same path on systems that support symlinks
+    def isdir(self, s):
+        """Return true if the pathname refers to an existing directory."""
+        st = self.callstat(s)
+        if not st:
+            return False
+        return statmod.S_ISDIR(st.st_mode)
+
+    def islink(self, path):
+        """Test whether a path is a symbolic link"""
+        st = self.calllstat(path)
+        if not st:
+            return False
+        return statmod.S_ISLNK(st.st_mode)
+
+    # Does a path exist?
+    # This is false for dangling symbolic links on systems that support them.
+    def exists(self, path):
+        """Test whether a path exists.  Returns False for broken symbolic links"""
+        if self.callstat(path):
+            return True
+        return False
+
+    def lexists(self, path):
+        """Test whether a path exists.  Returns True for broken symbolic links"""
+        if self.calllstat(path):
+            return True
+        return False
+
+    def stat(self, path):
+        return self.callstat(path)
+
+    def lstat(self, path):
+        return self.calllstat(path)
+
+    def walk(self, top, topdown=True, onerror=None, followlinks=False):
+        # Matches os.walk, not os.path.walk()
+
+        # We may not have read permission for top, in which case we can't
+        # get a list of the files the directory contains.  os.path.walk
+        # always suppressed the exception then, rather than blow up for a
+        # minor reason when (say) a thousand readable directories are still
+        # left to visit.  That logic is copied here.
+        try:
+            names = os.listdir(top)
+        except os.error as err:
+            if onerror is not None:
+                onerror(err)
+            return
+
+        dirs, nondirs = [], []
+        for name in names:
+            if self.isdir(os.path.join(top, name)):
+                dirs.append(name)
+            else:
+                nondirs.append(name)
+
+        if topdown:
+            yield top, dirs, nondirs
+        for name in dirs:
+            new_path = os.path.join(top, name)
+            if followlinks or not self.islink(new_path):
+                for x in self.walk(new_path, topdown, onerror, followlinks):
+                    yield x
+        if not topdown:
+            yield top, dirs, nondirs
+
+    ## realpath() related functions
+    def __is_path_below(self, file, root):
+        return (file + os.path.sep).startswith(root)
+
+    def __realpath_rel(self, start, rel_path, root, loop_cnt, assume_dir):
+        """Calculates real path of symlink 'start' + 'rel_path' below
+        'root'; no part of 'start' below 'root' must contain symlinks. """
+        have_dir = True
+
+        for d in rel_path.split(os.path.sep):
+            if not have_dir and not assume_dir:
+                raise OSError(errno.ENOENT, "no such directory %s" % start)
+
+            if d == os.path.pardir: # '..'
+                if len(start) >= len(root):
+                    # do not follow '..' before root
+                    start = os.path.dirname(start)
+                else:
+                    # emit warning?
+                    pass
+            else:
+                (start, have_dir) = self.__realpath(os.path.join(start, d),
+                                                    root, loop_cnt, assume_dir)
+
+            assert(self.__is_path_below(start, root))
+
+        return start
+
+    def __realpath(self, file, root, loop_cnt, assume_dir):
+        while self.islink(file) and len(file) >= len(root):
+            if loop_cnt == 0:
+                raise OSError(errno.ELOOP, file)
+
+            loop_cnt -= 1
+            target = os.path.normpath(os.readlink(file))
+    
+            if not os.path.isabs(target):
+                tdir = os.path.dirname(file)
+                assert(self.__is_path_below(tdir, root))
+            else:
+                tdir = root
+
+            file = self.__realpath_rel(tdir, target, root, loop_cnt, assume_dir)
+
+        try:
+            is_dir = self.isdir(file)
+        except:
+            is_dir = False
+
+        return (file, is_dir)
+
+    def realpath(self, file, root, use_physdir = True, loop_cnt = 100, assume_dir = False):
+        """ Returns the canonical path of 'file' with assuming a
+        toplevel 'root' directory. When 'use_physdir' is set, all
+        preceding path components of 'file' will be resolved first;
+        this flag should be set unless it is guaranteed that there is
+        no symlink in the path. When 'assume_dir' is not set, missing
+        path components will raise an ENOENT error"""
+
+        root = os.path.normpath(root)
+        file = os.path.normpath(file)
+
+        if not root.endswith(os.path.sep):
+            # letting root end with '/' makes some things easier
+            root = root + os.path.sep
+
+        if not self.__is_path_below(file, root):
+            raise OSError(errno.EINVAL, "file '%s' is not below root" % file)
+
+        try:
+            if use_physdir:
+                file = self.__realpath_rel(root, file[(len(root) - 1):], root, loop_cnt, assume_dir)
+            else:
+                file = self.__realpath(file, root, loop_cnt, assume_dir)[0]
+        except OSError as e:
+            if e.errno == errno.ELOOP:
+                # make ELOOP more readable; without catching it, there will
+                # be printed a backtrace with 100s of OSError exceptions
+                # else
+                raise OSError(errno.ELOOP,
+                              "too much recursions while resolving '%s'; loop in '%s'" %
+                              (file, e.strerror))
+
+            raise
+
+        return file
diff --git a/meta/lib/oe/classextend.py b/meta/lib/oe/classextend.py
new file mode 100644
index 0000000..5107ecd
--- /dev/null
+++ b/meta/lib/oe/classextend.py
@@ -0,0 +1,120 @@
+class ClassExtender(object):
+    def __init__(self, extname, d):
+        self.extname = extname
+        self.d = d
+        self.pkgs_mapping = []
+
+    def extend_name(self, name):
+        if name.startswith("kernel-") or name == "virtual/kernel":
+            return name
+        if name.startswith("rtld"):
+            return name
+        if name.endswith("-crosssdk"):
+            return name
+        if name.endswith("-" + self.extname):
+            name = name.replace("-" + self.extname, "")
+        if name.startswith("virtual/"):
+            subs = name.split("/", 1)[1]
+            if not subs.startswith(self.extname):
+                return "virtual/" + self.extname + "-" + subs
+            return name
+        if not name.startswith(self.extname):
+            return self.extname + "-" + name
+        return name
+
+    def map_variable(self, varname, setvar = True):
+        var = self.d.getVar(varname, True)
+        if not var:
+            return ""
+        var = var.split()
+        newvar = []
+        for v in var:
+            newvar.append(self.extend_name(v))
+        newdata =  " ".join(newvar)
+        if setvar:
+            self.d.setVar(varname, newdata)
+        return newdata
+
+    def map_regexp_variable(self, varname, setvar = True):
+        var = self.d.getVar(varname, True)
+        if not var:
+            return ""
+        var = var.split()
+        newvar = []
+        for v in var:
+            if v.startswith("^" + self.extname):
+                newvar.append(v)
+            elif v.startswith("^"):
+                newvar.append("^" + self.extname + "-" + v[1:])
+            else:
+                newvar.append(self.extend_name(v))
+        newdata =  " ".join(newvar)
+        if setvar:
+            self.d.setVar(varname, newdata)
+        return newdata
+
+    def map_depends(self, dep):
+        if dep.endswith(("-native", "-native-runtime")) or ('nativesdk-' in dep) or ('cross-canadian' in dep) or ('-crosssdk-' in dep):
+            return dep
+        else:
+            # Do not extend for that already have multilib prefix
+            var = self.d.getVar("MULTILIB_VARIANTS", True)
+            if var:
+                var = var.split()
+                for v in var:
+                    if dep.startswith(v):
+                        return dep
+            return self.extend_name(dep)
+
+    def map_depends_variable(self, varname, suffix = ""):
+        # We need to preserve EXTENDPKGV so it can be expanded correctly later
+        if suffix:
+            varname = varname + "_" + suffix
+        orig = self.d.getVar("EXTENDPKGV", False)
+        self.d.setVar("EXTENDPKGV", "EXTENDPKGV")
+        deps = self.d.getVar(varname, True)
+        if not deps:
+            self.d.setVar("EXTENDPKGV", orig)
+            return
+        deps = bb.utils.explode_dep_versions2(deps)
+        newdeps = {}
+        for dep in deps:
+            newdeps[self.map_depends(dep)] = deps[dep]
+
+        self.d.setVar(varname, bb.utils.join_deps(newdeps, False).replace("EXTENDPKGV", "${EXTENDPKGV}"))
+        self.d.setVar("EXTENDPKGV", orig)
+
+    def map_packagevars(self):
+        for pkg in (self.d.getVar("PACKAGES", True).split() + [""]):
+            self.map_depends_variable("RDEPENDS", pkg)
+            self.map_depends_variable("RRECOMMENDS", pkg)
+            self.map_depends_variable("RSUGGESTS", pkg)
+            self.map_depends_variable("RPROVIDES", pkg)
+            self.map_depends_variable("RREPLACES", pkg)
+            self.map_depends_variable("RCONFLICTS", pkg)
+            self.map_depends_variable("PKG", pkg)
+
+    def rename_packages(self):
+        for pkg in (self.d.getVar("PACKAGES", True) or "").split():
+            if pkg.startswith(self.extname):
+               self.pkgs_mapping.append([pkg.split(self.extname + "-")[1], pkg])
+               continue
+            self.pkgs_mapping.append([pkg, self.extend_name(pkg)])
+
+        self.d.setVar("PACKAGES", " ".join([row[1] for row in self.pkgs_mapping]))
+
+    def rename_package_variables(self, variables):
+        for pkg_mapping in self.pkgs_mapping:
+            for subs in variables:
+                self.d.renameVar("%s_%s" % (subs, pkg_mapping[0]), "%s_%s" % (subs, pkg_mapping[1]))
+
+class NativesdkClassExtender(ClassExtender):
+    def map_depends(self, dep):
+        if dep.startswith(self.extname):
+            return dep
+        if dep.endswith(("-gcc-initial", "-gcc", "-g++")):
+            return dep + "-crosssdk"
+        elif dep.endswith(("-native", "-native-runtime")) or ('nativesdk-' in dep) or ('-cross-' in dep) or ('-crosssdk-' in dep):
+            return dep
+        else:
+            return self.extend_name(dep)
diff --git a/meta/lib/oe/classutils.py b/meta/lib/oe/classutils.py
new file mode 100644
index 0000000..58188fd
--- /dev/null
+++ b/meta/lib/oe/classutils.py
@@ -0,0 +1,43 @@
+class ClassRegistry(type):
+    """Maintain a registry of classes, indexed by name.
+
+Note that this implementation requires that the names be unique, as it uses
+a dictionary to hold the classes by name.
+
+The name in the registry can be overridden via the 'name' attribute of the
+class, and the 'priority' attribute controls priority. The prioritized()
+method returns the registered classes in priority order.
+
+Subclasses of ClassRegistry may define an 'implemented' property to exert
+control over whether the class will be added to the registry (e.g. to keep
+abstract base classes out of the registry)."""
+    priority = 0
+    class __metaclass__(type):
+        """Give each ClassRegistry their own registry"""
+        def __init__(cls, name, bases, attrs):
+            cls.registry = {}
+            type.__init__(cls, name, bases, attrs)
+
+    def __init__(cls, name, bases, attrs):
+        super(ClassRegistry, cls).__init__(name, bases, attrs)
+        try:
+            if not cls.implemented:
+                return
+        except AttributeError:
+            pass
+
+        try:
+            cls.name
+        except AttributeError:
+            cls.name = name
+        cls.registry[cls.name] = cls
+
+    @classmethod
+    def prioritized(tcls):
+        return sorted(tcls.registry.values(),
+                      key=lambda v: v.priority, reverse=True)
+
+    def unregister(cls):
+        for key in cls.registry.keys():
+            if cls.registry[key] is cls:
+                del cls.registry[key]
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py
new file mode 100644
index 0000000..979578c
--- /dev/null
+++ b/meta/lib/oe/copy_buildsystem.py
@@ -0,0 +1,101 @@
+# This class should provide easy access to the different aspects of the
+# buildsystem such as layers, bitbake location, etc.
+import stat
+import shutil
+
+def _smart_copy(src, dest):
+    # smart_copy will choose the correct function depending on whether the
+    # source is a file or a directory.
+    mode = os.stat(src).st_mode
+    if stat.S_ISDIR(mode):
+        shutil.copytree(src, dest, symlinks=True)
+    else:
+        shutil.copyfile(src, dest)
+        shutil.copymode(src, dest)
+
+class BuildSystem(object):
+    def __init__(self, d):
+        self.d = d
+        self.layerdirs = d.getVar('BBLAYERS', True).split()
+
+    def copy_bitbake_and_layers(self, destdir):
+        # Copy in all metadata layers + bitbake (as repositories)
+        layers_copied = []
+        bb.utils.mkdirhier(destdir)
+        layers = list(self.layerdirs)
+
+        corebase = self.d.getVar('COREBASE', True)
+        layers.append(corebase)
+
+        corebase_files = self.d.getVar('COREBASE_FILES', True).split()
+        corebase_files = [corebase + '/' +x for x in corebase_files]
+        # Make sure bitbake goes in
+        bitbake_dir = bb.__file__.rsplit('/', 3)[0]
+        corebase_files.append(bitbake_dir)
+
+        for layer in layers:
+            layerconf = os.path.join(layer, 'conf', 'layer.conf')
+            if os.path.exists(layerconf):
+                with open(layerconf, 'r') as f:
+                    if f.readline().startswith("# ### workspace layer auto-generated by devtool ###"):
+                        bb.warn("Skipping local workspace layer %s" % layer)
+                        continue
+
+            # If the layer was already under corebase, leave it there
+            # since layers such as meta have issues when moved.
+            layerdestpath = destdir
+            if corebase == os.path.dirname(layer):
+                layerdestpath += '/' + os.path.basename(corebase)
+            layerdestpath += '/' + os.path.basename(layer)
+
+            layer_relative = os.path.relpath(layerdestpath,
+                                             destdir)
+            layers_copied.append(layer_relative)
+
+            # Treat corebase as special since it typically will contain
+            # build directories or other custom items.
+            if corebase == layer:
+                bb.utils.mkdirhier(layerdestpath)
+                for f in corebase_files:
+                    f_basename = os.path.basename(f)
+                    destname = os.path.join(layerdestpath, f_basename)
+                    _smart_copy(f, destname)
+            else:
+                if os.path.exists(layerdestpath):
+                    bb.note("Skipping layer %s, already handled" % layer)
+                else:
+                    _smart_copy(layer, layerdestpath)
+
+        return layers_copied
+
+def generate_locked_sigs(sigfile, d):
+    bb.utils.mkdirhier(os.path.dirname(sigfile))
+    depd = d.getVar('BB_TASKDEPDATA', True)
+    tasks = ['%s.%s' % (v[2], v[1]) for v in depd.itervalues()]
+    bb.parse.siggen.dump_lockedsigs(sigfile, tasks)
+
+def prune_lockedsigs(allowed_tasks, excluded_targets, lockedsigs, pruned_output):
+    with open(lockedsigs, 'r') as infile:
+        bb.utils.mkdirhier(os.path.dirname(pruned_output))
+        with open(pruned_output, 'w') as f:
+            invalue = False
+            for line in infile:
+                if invalue:
+                    if line.endswith('\\\n'):
+                        splitval = line.strip().split(':')
+                        if splitval[1] in allowed_tasks and not splitval[0] in excluded_targets:
+                            f.write(line)
+                    else:
+                        f.write(line)
+                        invalue = False
+                elif line.startswith('SIGGEN_LOCKEDSIGS'):
+                    invalue = True
+                    f.write(line)
+
+def create_locked_sstate_cache(lockedsigs, input_sstate_cache, output_sstate_cache, d, fixedlsbstring=""):
+    bb.note('Generating sstate-cache...')
+
+    bb.process.run("gen-lockedsig-cache %s %s %s" % (lockedsigs, input_sstate_cache, output_sstate_cache))
+    if fixedlsbstring:
+        os.rename(output_sstate_cache + '/' + d.getVar('NATIVELSBSTRING', True),
+        output_sstate_cache + '/' + fixedlsbstring)
diff --git a/meta/lib/oe/data.py b/meta/lib/oe/data.py
new file mode 100644
index 0000000..4cc0e02
--- /dev/null
+++ b/meta/lib/oe/data.py
@@ -0,0 +1,17 @@
+import oe.maketype
+
+def typed_value(key, d):
+    """Construct a value for the specified metadata variable, using its flags
+    to determine the type and parameters for construction."""
+    var_type = d.getVarFlag(key, 'type')
+    flags = d.getVarFlags(key)
+    if flags is not None:
+        flags = dict((flag, d.expand(value))
+                     for flag, value in flags.iteritems())
+    else:
+        flags = {}
+
+    try:
+        return oe.maketype.create(d.getVar(key, True) or '', var_type, **flags)
+    except (TypeError, ValueError), exc:
+        bb.msg.fatal("Data", "%s: %s" % (key, str(exc)))
diff --git a/meta/lib/oe/distro_check.py b/meta/lib/oe/distro_check.py
new file mode 100644
index 0000000..8ed5b0e
--- /dev/null
+++ b/meta/lib/oe/distro_check.py
@@ -0,0 +1,383 @@
+def get_links_from_url(url):
+    "Return all the href links found on the web location"
+
+    import urllib, sgmllib
+    
+    class LinksParser(sgmllib.SGMLParser):
+        def parse(self, s):
+            "Parse the given string 's'."
+            self.feed(s)
+            self.close()
+    
+        def __init__(self, verbose=0):
+            "Initialise an object passing 'verbose' to the superclass."
+            sgmllib.SGMLParser.__init__(self, verbose)
+            self.hyperlinks = []
+    
+        def start_a(self, attributes):
+            "Process a hyperlink and its 'attributes'."
+            for name, value in attributes:
+                if name == "href":
+                    self.hyperlinks.append(value.strip('/'))
+    
+        def get_hyperlinks(self):
+            "Return the list of hyperlinks."
+            return self.hyperlinks
+
+    sock = urllib.urlopen(url)
+    webpage = sock.read()
+    sock.close()
+
+    linksparser = LinksParser()
+    linksparser.parse(webpage)
+    return linksparser.get_hyperlinks()
+
+def find_latest_numeric_release(url):
+    "Find the latest listed numeric release on the given url"
+    max=0
+    maxstr=""
+    for link in get_links_from_url(url):
+        try:
+            release = float(link)
+        except:
+            release = 0
+        if release > max:
+            max = release
+            maxstr = link
+    return maxstr
+
+def is_src_rpm(name):
+    "Check if the link is pointing to a src.rpm file"
+    if name[-8:] == ".src.rpm":
+        return True
+    else:
+        return False
+
+def package_name_from_srpm(srpm):
+    "Strip out the package name from the src.rpm filename"
+    strings = srpm.split('-')
+    package_name = strings[0]
+    for i in range(1, len (strings) - 1):
+        str = strings[i]
+        if not str[0].isdigit():
+            package_name += '-' + str
+    return package_name
+
+def clean_package_list(package_list):
+    "Removes multiple entries of packages and sorts the list"
+    set = {}
+    map(set.__setitem__, package_list, [])
+    return set.keys()
+
+
+def get_latest_released_meego_source_package_list():
+    "Returns list of all the name os packages in the latest meego distro"
+
+    package_names = []
+    try:
+        f = open("/tmp/Meego-1.1", "r")
+        for line in f:
+            package_names.append(line[:-1] + ":" + "main") # Also strip the '\n' at the end
+    except IOError: pass
+    package_list=clean_package_list(package_names)
+    return "1.0", package_list
+
+def get_source_package_list_from_url(url, section):
+    "Return a sectioned list of package names from a URL list"
+
+    bb.note("Reading %s: %s" % (url, section))
+    links = get_links_from_url(url)
+    srpms = filter(is_src_rpm, links)
+    names_list = map(package_name_from_srpm, srpms)
+
+    new_pkgs = []
+    for pkgs in names_list:
+       new_pkgs.append(pkgs + ":" + section)
+
+    return new_pkgs
+
+def get_latest_released_fedora_source_package_list():
+    "Returns list of all the name os packages in the latest fedora distro"
+    latest = find_latest_numeric_release("http://archive.fedoraproject.org/pub/fedora/linux/releases/")
+
+    package_names = get_source_package_list_from_url("http://archive.fedoraproject.org/pub/fedora/linux/releases/%s/Fedora/source/SRPMS/" % latest, "main")
+
+#    package_names += get_source_package_list_from_url("http://download.fedora.redhat.com/pub/fedora/linux/releases/%s/Everything/source/SPRMS/" % latest, "everything")
+    package_names += get_source_package_list_from_url("http://archive.fedoraproject.org/pub/fedora/linux/updates/%s/SRPMS/" % latest, "updates")
+
+    package_list=clean_package_list(package_names)
+        
+    return latest, package_list
+
+def get_latest_released_opensuse_source_package_list():
+    "Returns list of all the name os packages in the latest opensuse distro"
+    latest = find_latest_numeric_release("http://download.opensuse.org/source/distribution/")
+
+    package_names = get_source_package_list_from_url("http://download.opensuse.org/source/distribution/%s/repo/oss/suse/src/" % latest, "main")
+    package_names += get_source_package_list_from_url("http://download.opensuse.org/update/%s/rpm/src/" % latest, "updates")
+
+    package_list=clean_package_list(package_names)
+    return latest, package_list
+
+def get_latest_released_mandriva_source_package_list():
+    "Returns list of all the name os packages in the latest mandriva distro"
+    latest = find_latest_numeric_release("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/")
+    package_names = get_source_package_list_from_url("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/%s/SRPMS/main/release/" % latest, "main")
+#    package_names += get_source_package_list_from_url("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/%s/SRPMS/contrib/release/" % latest, "contrib")
+    package_names += get_source_package_list_from_url("http://distrib-coffee.ipsl.jussieu.fr/pub/linux/MandrivaLinux/official/%s/SRPMS/main/updates/" % latest, "updates")
+
+    package_list=clean_package_list(package_names)
+    return latest, package_list
+
+def find_latest_debian_release(url):
+    "Find the latest listed debian release on the given url"
+
+    releases = []
+    for link in get_links_from_url(url):
+        if link[:6] == "Debian":
+            if ';' not in link:
+                releases.append(link)
+    releases.sort()
+    try:
+        return releases.pop()[6:]
+    except:
+        return "_NotFound_"
+
+def get_debian_style_source_package_list(url, section):
+    "Return the list of package-names stored in the debian style Sources.gz file"
+    import urllib
+    sock = urllib.urlopen(url)
+    import tempfile
+    tmpfile = tempfile.NamedTemporaryFile(mode='wb', prefix='oecore.', suffix='.tmp', delete=False)
+    tmpfilename=tmpfile.name
+    tmpfile.write(sock.read())
+    sock.close()
+    tmpfile.close()
+    import gzip
+    bb.note("Reading %s: %s" % (url, section))
+
+    f = gzip.open(tmpfilename)
+    package_names = []
+    for line in f:
+        if line[:9] == "Package: ":
+            package_names.append(line[9:-1] + ":" + section) # Also strip the '\n' at the end
+    os.unlink(tmpfilename)
+
+    return package_names
+
+def get_latest_released_debian_source_package_list():
+    "Returns list of all the name os packages in the latest debian distro"
+    latest = find_latest_debian_release("http://ftp.debian.org/debian/dists/")
+    url = "http://ftp.debian.org/debian/dists/stable/main/source/Sources.gz" 
+    package_names = get_debian_style_source_package_list(url, "main")
+#    url = "http://ftp.debian.org/debian/dists/stable/contrib/source/Sources.gz" 
+#    package_names += get_debian_style_source_package_list(url, "contrib")
+    url = "http://ftp.debian.org/debian/dists/stable-proposed-updates/main/source/Sources.gz" 
+    package_names += get_debian_style_source_package_list(url, "updates")
+    package_list=clean_package_list(package_names)
+    return latest, package_list
+
+def find_latest_ubuntu_release(url):
+    "Find the latest listed ubuntu release on the given url"
+    url += "?C=M;O=D" # Descending Sort by Last Modified
+    for link in get_links_from_url(url):
+        if link[-8:] == "-updates":
+            return link[:-8]
+    return "_NotFound_"
+
+def get_latest_released_ubuntu_source_package_list():
+    "Returns list of all the name os packages in the latest ubuntu distro"
+    latest = find_latest_ubuntu_release("http://archive.ubuntu.com/ubuntu/dists/")
+    url = "http://archive.ubuntu.com/ubuntu/dists/%s/main/source/Sources.gz" % latest
+    package_names = get_debian_style_source_package_list(url, "main")
+#    url = "http://archive.ubuntu.com/ubuntu/dists/%s/multiverse/source/Sources.gz" % latest
+#    package_names += get_debian_style_source_package_list(url, "multiverse")
+#    url = "http://archive.ubuntu.com/ubuntu/dists/%s/universe/source/Sources.gz" % latest
+#    package_names += get_debian_style_source_package_list(url, "universe")
+    url = "http://archive.ubuntu.com/ubuntu/dists/%s-updates/main/source/Sources.gz" % latest
+    package_names += get_debian_style_source_package_list(url, "updates")
+    package_list=clean_package_list(package_names)
+    return latest, package_list
+
+def create_distro_packages_list(distro_check_dir):
+    pkglst_dir = os.path.join(distro_check_dir, "package_lists")
+    if not os.path.isdir (pkglst_dir):
+        os.makedirs(pkglst_dir)
+    # first clear old stuff
+    for file in os.listdir(pkglst_dir):
+        os.unlink(os.path.join(pkglst_dir, file))
+ 
+    per_distro_functions = [
+                            ["Debian", get_latest_released_debian_source_package_list],
+                            ["Ubuntu", get_latest_released_ubuntu_source_package_list],
+                            ["Fedora", get_latest_released_fedora_source_package_list],
+                            ["OpenSuSE", get_latest_released_opensuse_source_package_list],
+                            ["Mandriva", get_latest_released_mandriva_source_package_list],
+                            ["Meego", get_latest_released_meego_source_package_list]
+                           ]
+ 
+    from datetime import datetime
+    begin = datetime.now()
+    for distro in per_distro_functions:
+        name = distro[0]
+        release, package_list = distro[1]()
+        bb.note("Distro: %s, Latest Release: %s, # src packages: %d" % (name, release, len(package_list)))
+        package_list_file = os.path.join(pkglst_dir, name + "-" + release)
+        f = open(package_list_file, "w+b")
+        for pkg in package_list:
+            f.write(pkg + "\n")
+        f.close()
+    end = datetime.now()
+    delta = end - begin
+    bb.note("package_list generatiosn took this much time: %d seconds" % delta.seconds)
+
+def update_distro_data(distro_check_dir, datetime):
+    """
+        If distro packages list data is old then rebuild it.
+        The operations has to be protected by a lock so that
+        only one thread performes it at a time.
+    """
+    if not os.path.isdir (distro_check_dir):
+        try:
+            bb.note ("Making new directory: %s" % distro_check_dir)
+            os.makedirs (distro_check_dir)
+        except OSError:
+            raise Exception('Unable to create directory %s' % (distro_check_dir))
+
+
+    datetime_file = os.path.join(distro_check_dir, "build_datetime")
+    saved_datetime = "_invalid_"
+    import fcntl
+    try:
+        if not os.path.exists(datetime_file):
+            open(datetime_file, 'w+b').close() # touch the file so that the next open won't fail
+
+        f = open(datetime_file, "r+b")
+        fcntl.lockf(f, fcntl.LOCK_EX)
+        saved_datetime = f.read()
+        if saved_datetime[0:8] != datetime[0:8]:
+            bb.note("The build datetime did not match: saved:%s current:%s" % (saved_datetime, datetime))
+            bb.note("Regenerating distro package lists")
+            create_distro_packages_list(distro_check_dir)
+            f.seek(0)
+            f.write(datetime)
+
+    except OSError:
+        raise Exception('Unable to read/write this file: %s' % (datetime_file))
+    finally:
+        fcntl.lockf(f, fcntl.LOCK_UN)
+        f.close()
+ 
+def compare_in_distro_packages_list(distro_check_dir, d):
+    if not os.path.isdir(distro_check_dir):
+        raise Exception("compare_in_distro_packages_list: invalid distro_check_dir passed")
+        
+    localdata = bb.data.createCopy(d)
+    pkglst_dir = os.path.join(distro_check_dir, "package_lists")
+    matching_distros = []
+    pn = d.getVar('PN', True)
+    recipe_name = d.getVar('PN', True)
+    bb.note("Checking: %s" % pn)
+
+    trim_dict = dict({"-native":"-native", "-cross":"-cross", "-initial":"-initial"})
+
+    if pn.find("-native") != -1:
+        pnstripped = pn.split("-native")
+        localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+        bb.data.update_data(localdata)
+        recipe_name = pnstripped[0]
+
+    if pn.startswith("nativesdk-"):
+        pnstripped = pn.split("nativesdk-")
+        localdata.setVar('OVERRIDES', "pn-" + pnstripped[1] + ":" + d.getVar('OVERRIDES', True))
+        bb.data.update_data(localdata)
+        recipe_name = pnstripped[1]
+
+    if pn.find("-cross") != -1:
+        pnstripped = pn.split("-cross")
+        localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+        bb.data.update_data(localdata)
+        recipe_name = pnstripped[0]
+
+    if pn.find("-initial") != -1:
+        pnstripped = pn.split("-initial")
+        localdata.setVar('OVERRIDES', "pn-" + pnstripped[0] + ":" + d.getVar('OVERRIDES', True))
+        bb.data.update_data(localdata)
+        recipe_name = pnstripped[0]
+
+    bb.note("Recipe: %s" % recipe_name)
+    tmp = localdata.getVar('DISTRO_PN_ALIAS', True)
+
+    distro_exceptions = dict({"OE-Core":'OE-Core', "OpenedHand":'OpenedHand', "Intel":'Intel', "Upstream":'Upstream', "Windriver":'Windriver', "OSPDT":'OSPDT Approved', "Poky":'poky'})
+
+    if tmp:
+        list = tmp.split(' ')
+        for str in list:
+            if str and str.find("=") == -1 and distro_exceptions[str]:
+                matching_distros.append(str)
+
+    distro_pn_aliases = {}
+    if tmp:
+        list = tmp.split(' ')
+        for str in list:
+            if str.find("=") != -1:
+                (dist, pn_alias) = str.split('=')
+                distro_pn_aliases[dist.strip().lower()] = pn_alias.strip()
+ 
+    for file in os.listdir(pkglst_dir):
+        (distro, distro_release) = file.split("-")
+        f = open(os.path.join(pkglst_dir, file), "rb")
+        for line in f:
+            (pkg, section) = line.split(":")
+            if distro.lower() in distro_pn_aliases:
+                pn = distro_pn_aliases[distro.lower()]
+            else:
+                pn = recipe_name
+            if pn == pkg:
+                matching_distros.append(distro + "-" + section[:-1]) # strip the \n at the end
+                f.close()
+                break
+        f.close()
+
+    
+    if tmp != None:
+	list = tmp.split(' ')
+	for item in list:
+            matching_distros.append(item)
+    bb.note("Matching: %s" % matching_distros)
+    return matching_distros
+
+def create_log_file(d, logname):
+    import subprocess
+    logpath = d.getVar('LOG_DIR', True)
+    bb.utils.mkdirhier(logpath)
+    logfn, logsuffix = os.path.splitext(logname)
+    logfile = os.path.join(logpath, "%s.%s%s" % (logfn, d.getVar('DATETIME', True), logsuffix))
+    if not os.path.exists(logfile):
+            slogfile = os.path.join(logpath, logname)
+            if os.path.exists(slogfile):
+                    os.remove(slogfile)
+            subprocess.call("touch %s" % logfile, shell=True)
+            os.symlink(logfile, slogfile)
+            d.setVar('LOG_FILE', logfile)
+    return logfile
+
+
+def save_distro_check_result(result, datetime, result_file, d):
+    pn = d.getVar('PN', True)
+    logdir = d.getVar('LOG_DIR', True)
+    if not logdir:
+        bb.error("LOG_DIR variable is not defined, can't write the distro_check results")
+        return
+    if not os.path.isdir(logdir):
+        os.makedirs(logdir)
+    line = pn
+    for i in result:
+        line = line + "," + i
+    f = open(result_file, "a")
+    import fcntl
+    fcntl.lockf(f, fcntl.LOCK_EX)
+    f.seek(0, os.SEEK_END) # seek to the end of file
+    f.write(line + "\n")
+    fcntl.lockf(f, fcntl.LOCK_UN)
+    f.close()
diff --git a/meta/lib/oe/image.py b/meta/lib/oe/image.py
new file mode 100644
index 0000000..2361955
--- /dev/null
+++ b/meta/lib/oe/image.py
@@ -0,0 +1,386 @@
+from oe.utils import execute_pre_post_process
+import os
+import subprocess
+import multiprocessing
+
+
+def generate_image(arg):
+    (type, subimages, create_img_cmd) = arg
+
+    bb.note("Running image creation script for %s: %s ..." %
+            (type, create_img_cmd))
+
+    try:
+        output = subprocess.check_output(create_img_cmd,
+                                         stderr=subprocess.STDOUT)
+    except subprocess.CalledProcessError as e:
+        return("Error: The image creation script '%s' returned %d:\n%s" %
+               (e.cmd, e.returncode, e.output))
+
+    bb.note("Script output:\n%s" % output)
+
+    return None
+
+
+"""
+This class will help compute IMAGE_FSTYPE dependencies and group them in batches
+that can be executed in parallel.
+
+The next example is for illustration purposes, highly unlikely to happen in real life.
+It's just one of the test cases I used to test the algorithm:
+
+For:
+IMAGE_FSTYPES = "i1 i2 i3 i4 i5"
+IMAGE_TYPEDEP_i4 = "i2"
+IMAGE_TYPEDEP_i5 = "i6 i4"
+IMAGE_TYPEDEP_i6 = "i7"
+IMAGE_TYPEDEP_i7 = "i2"
+
+We get the following list of batches that can be executed in parallel, having the
+dependencies satisfied:
+
+[['i1', 'i3', 'i2'], ['i4', 'i7'], ['i6'], ['i5']]
+"""
+class ImageDepGraph(object):
+    def __init__(self, d):
+        self.d = d
+        self.graph = dict()
+        self.deps_array = dict()
+
+    def _construct_dep_graph(self, image_fstypes):
+        graph = dict()
+
+        def add_node(node):
+            base_type = self._image_base_type(node)
+            deps = (self.d.getVar('IMAGE_TYPEDEP_' + node, True) or "")
+            base_deps = (self.d.getVar('IMAGE_TYPEDEP_' + base_type, True) or "")
+            if deps != "" or base_deps != "":
+                graph[node] = deps
+
+                for dep in deps.split() + base_deps.split():
+                    if not dep in graph:
+                        add_node(dep)
+            else:
+                graph[node] = ""
+
+        for fstype in image_fstypes:
+            add_node(fstype)
+
+        return graph
+
+    def _clean_graph(self):
+        # Live and VMDK/VDI images will be processed via inheriting
+        # bbclass and does not get processed here. Remove them from the fstypes
+        # graph. Their dependencies are already added, so no worries here.
+        remove_list = (self.d.getVar('IMAGE_TYPES_MASKED', True) or "").split()
+
+        for item in remove_list:
+            self.graph.pop(item, None)
+
+    def _image_base_type(self, type):
+        ctypes = self.d.getVar('COMPRESSIONTYPES', True).split()
+        if type in ["vmdk", "vdi", "qcow2", "live", "iso", "hddimg"]:
+            type = "ext4"
+        basetype = type
+        for ctype in ctypes:
+            if type.endswith("." + ctype):
+                basetype = type[:-len("." + ctype)]
+                break
+
+        return basetype
+
+    def _compute_dependencies(self):
+        """
+        returns dict object of nodes with [no_of_depends_on, no_of_depended_by]
+        for each node
+        """
+        deps_array = dict()
+        for node in self.graph:
+            deps_array[node] = [0, 0]
+
+        for node in self.graph:
+            deps = self.graph[node].split()
+            deps_array[node][0] += len(deps)
+            for dep in deps:
+                deps_array[dep][1] += 1
+
+        return deps_array
+
+    def _sort_graph(self):
+        sorted_list = []
+        group = []
+        for node in self.graph:
+            if node not in self.deps_array:
+                continue
+
+            depends_on = self.deps_array[node][0]
+
+            if depends_on == 0:
+                group.append(node)
+
+        if len(group) == 0 and len(self.deps_array) != 0:
+            bb.fatal("possible fstype circular dependency...")
+
+        sorted_list.append(group)
+
+        # remove added nodes from deps_array
+        for item in group:
+            for node in self.graph:
+                if item in self.graph[node].split():
+                    self.deps_array[node][0] -= 1
+
+            self.deps_array.pop(item, None)
+
+        if len(self.deps_array):
+            # recursive call, to find the next group
+            sorted_list += self._sort_graph()
+
+        return sorted_list
+
+    def group_fstypes(self, image_fstypes):
+        self.graph = self._construct_dep_graph(image_fstypes)
+
+        self._clean_graph()
+
+        self.deps_array = self._compute_dependencies()
+
+        alltypes = [node for node in self.graph]
+
+        return (alltypes, self._sort_graph())
+
+
+class Image(ImageDepGraph):
+    def __init__(self, d):
+        self.d = d
+
+        super(Image, self).__init__(d)
+
+    def _get_rootfs_size(self):
+        """compute the rootfs size"""
+        rootfs_alignment = int(self.d.getVar('IMAGE_ROOTFS_ALIGNMENT', True))
+        overhead_factor = float(self.d.getVar('IMAGE_OVERHEAD_FACTOR', True))
+        rootfs_req_size = int(self.d.getVar('IMAGE_ROOTFS_SIZE', True))
+        rootfs_extra_space = eval(self.d.getVar('IMAGE_ROOTFS_EXTRA_SPACE', True))
+        rootfs_maxsize = self.d.getVar('IMAGE_ROOTFS_MAXSIZE', True)
+
+        output = subprocess.check_output(['du', '-ks',
+                                          self.d.getVar('IMAGE_ROOTFS', True)])
+        size_kb = int(output.split()[0])
+        base_size = size_kb * overhead_factor
+        base_size = (base_size, rootfs_req_size)[base_size < rootfs_req_size] + \
+            rootfs_extra_space
+
+        if base_size != int(base_size):
+            base_size = int(base_size + 1)
+
+        base_size += rootfs_alignment - 1
+        base_size -= base_size % rootfs_alignment
+
+        # Check the rootfs size against IMAGE_ROOTFS_MAXSIZE (if set)
+        if rootfs_maxsize:
+            rootfs_maxsize_int = int(rootfs_maxsize)
+            if base_size > rootfs_maxsize_int:
+                bb.fatal("The rootfs size %d(K) overrides the max size %d(K)" % \
+                    (base_size, rootfs_maxsize_int))
+
+        return base_size
+
+    def _create_symlinks(self, subimages):
+        """create symlinks to the newly created image"""
+        deploy_dir = self.d.getVar('DEPLOY_DIR_IMAGE', True)
+        img_name = self.d.getVar('IMAGE_NAME', True)
+        link_name = self.d.getVar('IMAGE_LINK_NAME', True)
+        manifest_name = self.d.getVar('IMAGE_MANIFEST', True)
+
+        os.chdir(deploy_dir)
+
+        if link_name:
+            for type in subimages:
+                if os.path.exists(img_name + ".rootfs." + type):
+                    dst = link_name + "." + type
+                    src = img_name + ".rootfs." + type
+                    bb.note("Creating symlink: %s -> %s" % (dst, src))
+                    os.symlink(src, dst)
+
+            if manifest_name is not None and \
+                    os.path.exists(manifest_name) and \
+                    not os.path.exists(link_name + ".manifest"):
+                os.symlink(os.path.basename(manifest_name),
+                           link_name + ".manifest")
+
+    def _remove_old_symlinks(self):
+        """remove the symlinks to old binaries"""
+
+        if self.d.getVar('IMAGE_LINK_NAME', True):
+            deploy_dir = self.d.getVar('DEPLOY_DIR_IMAGE', True)
+            for img in os.listdir(deploy_dir):
+                if img.find(self.d.getVar('IMAGE_LINK_NAME', True)) == 0:
+                    img = os.path.join(deploy_dir, img)
+                    if os.path.islink(img):
+                        if self.d.getVar('RM_OLD_IMAGE', True) == "1" and \
+                                os.path.exists(os.path.realpath(img)):
+                            os.remove(os.path.realpath(img))
+
+                        os.remove(img)
+
+    """
+    This function will just filter out the compressed image types from the
+    fstype groups returning a (filtered_fstype_groups, cimages) tuple.
+    """
+    def _filter_out_commpressed(self, fstype_groups):
+        ctypes = self.d.getVar('COMPRESSIONTYPES', True).split()
+        cimages = {}
+
+        filtered_groups = []
+        for group in fstype_groups:
+            filtered_group = []
+            for type in group:
+                basetype = None
+                for ctype in ctypes:
+                    if type.endswith("." + ctype):
+                        basetype = type[:-len("." + ctype)]
+                        if basetype not in filtered_group:
+                            filtered_group.append(basetype)
+                        if basetype not in cimages:
+                            cimages[basetype] = []
+                        if ctype not in cimages[basetype]:
+                            cimages[basetype].append(ctype)
+                        break
+                if not basetype and type not in filtered_group:
+                    filtered_group.append(type)
+
+            filtered_groups.append(filtered_group)
+
+        return (filtered_groups, cimages)
+
+    def _get_image_types(self):
+        """returns a (types, cimages) tuple"""
+
+        alltypes, fstype_groups = self.group_fstypes(self.d.getVar('IMAGE_FSTYPES', True).split())
+
+        filtered_groups, cimages = self._filter_out_commpressed(fstype_groups)
+
+        return (alltypes, filtered_groups, cimages)
+
+    def _write_script(self, type, cmds):
+        tempdir = self.d.getVar('T', True)
+        script_name = os.path.join(tempdir, "create_image." + type)
+        rootfs_size = self._get_rootfs_size()
+
+        self.d.setVar('img_creation_func', '\n'.join(cmds))
+        self.d.setVarFlag('img_creation_func', 'func', 1)
+        self.d.setVarFlag('img_creation_func', 'fakeroot', 1)
+        self.d.setVar('ROOTFS_SIZE', str(rootfs_size))
+
+        with open(script_name, "w+") as script:
+            script.write("%s" % bb.build.shell_trap_code())
+            script.write("export ROOTFS_SIZE=%d\n" % rootfs_size)
+            bb.data.emit_func('img_creation_func', script, self.d)
+            script.write("img_creation_func\n")
+
+        os.chmod(script_name, 0775)
+
+        return script_name
+
+    def _get_imagecmds(self):
+        old_overrides = self.d.getVar('OVERRIDES', 0)
+
+        alltypes, fstype_groups, cimages = self._get_image_types()
+
+        image_cmd_groups = []
+
+        bb.note("The image creation groups are: %s" % str(fstype_groups))
+        for fstype_group in fstype_groups:
+            image_cmds = []
+            for type in fstype_group:
+                cmds = []
+                subimages = []
+
+                localdata = bb.data.createCopy(self.d)
+                localdata.setVar('OVERRIDES', '%s:%s' % (type, old_overrides))
+                bb.data.update_data(localdata)
+                localdata.setVar('type', type)
+
+                image_cmd = localdata.getVar("IMAGE_CMD", True)
+                if image_cmd:
+                    cmds.append("\t" + image_cmd)
+                else:
+                    bb.fatal("No IMAGE_CMD defined for IMAGE_FSTYPES entry '%s' - possibly invalid type name or missing support class" % type)
+                cmds.append(localdata.expand("\tcd ${DEPLOY_DIR_IMAGE}"))
+
+                if type in cimages:
+                    for ctype in cimages[type]:
+                        cmds.append("\t" + localdata.getVar("COMPRESS_CMD_" + ctype, True))
+                        subimages.append(type + "." + ctype)
+
+                if type not in alltypes:
+                    cmds.append(localdata.expand("\trm ${IMAGE_NAME}.rootfs.${type}"))
+                else:
+                    subimages.append(type)
+
+                script_name = self._write_script(type, cmds)
+
+                image_cmds.append((type, subimages, script_name))
+
+            image_cmd_groups.append(image_cmds)
+
+        return image_cmd_groups
+
+    def _write_wic_env(self):
+        """
+        Write environment variables used by wic
+        to tmp/sysroots/<machine>/imgdata/<image>.env
+        """
+        stdir = self.d.getVar('STAGING_DIR_TARGET', True)
+        outdir = os.path.join(stdir, 'imgdata')
+        if not os.path.exists(outdir):
+            os.makedirs(outdir)
+        basename = self.d.getVar('IMAGE_BASENAME', True)
+        with open(os.path.join(outdir, basename) + '.env', 'w') as envf:
+            for var in self.d.getVar('WICVARS', True).split():
+                value = self.d.getVar(var, True)
+                if value:
+                    envf.write('%s="%s"\n' % (var, value.strip()))
+
+    def create(self):
+        bb.note("###### Generate images #######")
+        pre_process_cmds = self.d.getVar("IMAGE_PREPROCESS_COMMAND", True)
+        post_process_cmds = self.d.getVar("IMAGE_POSTPROCESS_COMMAND", True)
+
+        execute_pre_post_process(self.d, pre_process_cmds)
+
+        self._remove_old_symlinks()
+
+        image_cmd_groups = self._get_imagecmds()
+
+        self._write_wic_env()
+
+        for image_cmds in image_cmd_groups:
+            # create the images in parallel
+            nproc = multiprocessing.cpu_count()
+            pool = bb.utils.multiprocessingpool(nproc)
+            results = list(pool.imap(generate_image, image_cmds))
+            pool.close()
+            pool.join()
+
+            for result in results:
+                if result is not None:
+                    bb.fatal(result)
+
+            for image_type, subimages, script in image_cmds:
+                bb.note("Creating symlinks for %s image ..." % image_type)
+                self._create_symlinks(subimages)
+
+        execute_pre_post_process(self.d, post_process_cmds)
+
+
+def create_image(d):
+    Image(d).create()
+
+if __name__ == "__main__":
+    """
+    Image creation can be called independent from bitbake environment.
+    """
+    """
+    TBD
+    """
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py
new file mode 100644
index 0000000..f0f661c
--- /dev/null
+++ b/meta/lib/oe/license.py
@@ -0,0 +1,217 @@
+# vi:sts=4:sw=4:et
+"""Code for parsing OpenEmbedded license strings"""
+
+import ast
+import re
+from fnmatch import fnmatchcase as fnmatch
+
+def license_ok(license, dont_want_licenses):
+    """ Return False if License exist in dont_want_licenses else True """
+    for dwl in dont_want_licenses:
+        # If you want to exclude license named generically 'X', we
+        # surely want to exclude 'X+' as well.  In consequence, we
+        # will exclude a trailing '+' character from LICENSE in
+        # case INCOMPATIBLE_LICENSE is not a 'X+' license.
+        lic = license
+        if not re.search('\+$', dwl):
+            lic = re.sub('\+', '', license)
+        if fnmatch(lic, dwl):
+            return False
+    return True
+
+class LicenseError(Exception):
+    pass
+
+class LicenseSyntaxError(LicenseError):
+    def __init__(self, licensestr, exc):
+        self.licensestr = licensestr
+        self.exc = exc
+        LicenseError.__init__(self)
+
+    def __str__(self):
+        return "error in '%s': %s" % (self.licensestr, self.exc)
+
+class InvalidLicense(LicenseError):
+    def __init__(self, license):
+        self.license = license
+        LicenseError.__init__(self)
+
+    def __str__(self):
+        return "invalid characters in license '%s'" % self.license
+
+license_operator_chars = '&|() '
+license_operator = re.compile('([' + license_operator_chars + '])')
+license_pattern = re.compile('[a-zA-Z0-9.+_\-]+$')
+
+class LicenseVisitor(ast.NodeVisitor):
+    """Get elements based on OpenEmbedded license strings"""
+    def get_elements(self, licensestr):
+        new_elements = []
+        elements = filter(lambda x: x.strip(), license_operator.split(licensestr))
+        for pos, element in enumerate(elements):
+            if license_pattern.match(element):
+                if pos > 0 and license_pattern.match(elements[pos-1]):
+                    new_elements.append('&')
+                element = '"' + element + '"'
+            elif not license_operator.match(element):
+                raise InvalidLicense(element)
+            new_elements.append(element)
+
+        return new_elements
+
+    """Syntax tree visitor which can accept elements previously generated with
+    OpenEmbedded license string"""
+    def visit_elements(self, elements):
+        self.visit(ast.parse(' '.join(elements)))
+
+    """Syntax tree visitor which can accept OpenEmbedded license strings"""
+    def visit_string(self, licensestr):
+        self.visit_elements(self.get_elements(licensestr))
+
+class FlattenVisitor(LicenseVisitor):
+    """Flatten a license tree (parsed from a string) by selecting one of each
+    set of OR options, in the way the user specifies"""
+    def __init__(self, choose_licenses):
+        self.choose_licenses = choose_licenses
+        self.licenses = []
+        LicenseVisitor.__init__(self)
+
+    def visit_Str(self, node):
+        self.licenses.append(node.s)
+
+    def visit_BinOp(self, node):
+        if isinstance(node.op, ast.BitOr):
+            left = FlattenVisitor(self.choose_licenses)
+            left.visit(node.left)
+
+            right = FlattenVisitor(self.choose_licenses)
+            right.visit(node.right)
+
+            selected = self.choose_licenses(left.licenses, right.licenses)
+            self.licenses.extend(selected)
+        else:
+            self.generic_visit(node)
+
+def flattened_licenses(licensestr, choose_licenses):
+    """Given a license string and choose_licenses function, return a flat list of licenses"""
+    flatten = FlattenVisitor(choose_licenses)
+    try:
+        flatten.visit_string(licensestr)
+    except SyntaxError as exc:
+        raise LicenseSyntaxError(licensestr, exc)
+    return flatten.licenses
+
+def is_included(licensestr, whitelist=None, blacklist=None):
+    """Given a license string and whitelist and blacklist, determine if the
+    license string matches the whitelist and does not match the blacklist.
+
+    Returns a tuple holding the boolean state and a list of the applicable
+    licenses which were excluded (or None, if the state is True)
+    """
+
+    def include_license(license):
+        return any(fnmatch(license, pattern) for pattern in whitelist)
+
+    def exclude_license(license):
+        return any(fnmatch(license, pattern) for pattern in blacklist)
+
+    def choose_licenses(alpha, beta):
+        """Select the option in an OR which is the 'best' (has the most
+        included licenses)."""
+        alpha_weight = len(filter(include_license, alpha))
+        beta_weight = len(filter(include_license, beta))
+        if alpha_weight > beta_weight:
+            return alpha
+        else:
+            return beta
+
+    if not whitelist:
+        whitelist = ['*']
+
+    if not blacklist:
+        blacklist = []
+
+    licenses = flattened_licenses(licensestr, choose_licenses)
+    excluded = filter(lambda lic: exclude_license(lic), licenses)
+    included = filter(lambda lic: include_license(lic), licenses)
+    if excluded:
+        return False, excluded
+    else:
+        return True, included
+
+class ManifestVisitor(LicenseVisitor):
+    """Walk license tree (parsed from a string) removing the incompatible
+    licenses specified"""
+    def __init__(self, dont_want_licenses, canonical_license, d):
+        self._dont_want_licenses = dont_want_licenses
+        self._canonical_license = canonical_license
+        self._d = d
+        self._operators = []
+
+        self.licenses = []
+        self.licensestr = ''
+
+        LicenseVisitor.__init__(self)
+
+    def visit(self, node):
+        if isinstance(node, ast.Str):
+            lic = node.s
+
+            if license_ok(self._canonical_license(self._d, lic),
+                    self._dont_want_licenses) == True:
+                if self._operators:
+                    ops = []
+                    for op in self._operators:
+                        if op == '[':
+                            ops.append(op)
+                        elif op == ']':
+                            ops.append(op)
+                        else:
+                            if not ops:
+                                ops.append(op)
+                            elif ops[-1] in ['[', ']']:
+                                ops.append(op)
+                            else:
+                                ops[-1] = op 
+
+                    for op in ops:
+                        if op == '[' or op == ']':
+                            self.licensestr += op
+                        elif self.licenses:
+                            self.licensestr += ' ' + op + ' '
+
+                    self._operators = []
+
+                self.licensestr += lic
+                self.licenses.append(lic)
+        elif isinstance(node, ast.BitAnd):
+            self._operators.append("&")
+        elif isinstance(node, ast.BitOr):
+            self._operators.append("|")
+        elif isinstance(node, ast.List):
+            self._operators.append("[")
+        elif isinstance(node, ast.Load):
+            self.licensestr += "]"
+
+        self.generic_visit(node)
+
+def manifest_licenses(licensestr, dont_want_licenses, canonical_license, d):
+    """Given a license string and dont_want_licenses list,
+       return license string filtered and a list of licenses"""
+    manifest = ManifestVisitor(dont_want_licenses, canonical_license, d)
+
+    try:
+        elements = manifest.get_elements(licensestr)
+
+        # Replace '()' to '[]' for handle in ast as List and Load types.
+        elements = ['[' if e == '(' else e for e in elements]
+        elements = [']' if e == ')' else e for e in elements]
+
+        manifest.visit_elements(elements)
+    except SyntaxError as exc:
+        raise LicenseSyntaxError(licensestr, exc)
+
+    # Replace '[]' to '()' for output correct license.
+    manifest.licensestr = manifest.licensestr.replace('[', '(').replace(']', ')')
+
+    return (manifest.licensestr, manifest.licenses)
diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py
new file mode 100644
index 0000000..ddfe71b
--- /dev/null
+++ b/meta/lib/oe/lsb.py
@@ -0,0 +1,83 @@
+def release_dict():
+    """Return the output of lsb_release -ir as a dictionary"""
+    from subprocess import PIPE
+
+    try:
+        output, err = bb.process.run(['lsb_release', '-ir'], stderr=PIPE)
+    except bb.process.CmdError as exc:
+        return None
+
+    data = {}
+    for line in output.splitlines():
+        if line.startswith("-e"): line = line[3:]
+        try:
+            key, value = line.split(":\t", 1)
+        except ValueError:
+            continue
+        else:
+            data[key] = value
+    return data
+
+def release_dict_file():
+    """ Try to gather LSB release information manually when lsb_release tool is unavailable """
+    data = None
+    try:
+        if os.path.exists('/etc/lsb-release'):
+            data = {}
+            with open('/etc/lsb-release') as f:
+                for line in f:
+                    key, value = line.split("=", 1)
+                    data[key] = value.strip()
+        elif os.path.exists('/etc/redhat-release'):
+            data = {}
+            with open('/etc/redhat-release') as f:
+                distro = f.readline().strip()
+            import re
+            match = re.match(r'(.*) release (.*) \((.*)\)', distro)
+            if match:
+                data['DISTRIB_ID'] = match.group(1)
+                data['DISTRIB_RELEASE'] = match.group(2)
+        elif os.path.exists('/etc/os-release'):
+            data = {}
+            with open('/etc/os-release') as f:
+                for line in f:
+                    if line.startswith('NAME='):
+                        data['DISTRIB_ID'] = line[5:].rstrip().strip('"')
+                    if line.startswith('VERSION_ID='):
+                        data['DISTRIB_RELEASE'] = line[11:].rstrip().strip('"')
+        elif os.path.exists('/etc/SuSE-release'):
+            data = {}
+            data['DISTRIB_ID'] = 'SUSE LINUX'
+            with open('/etc/SuSE-release') as f:
+                for line in f:
+                    if line.startswith('VERSION = '):
+                        data['DISTRIB_RELEASE'] = line[10:].rstrip()
+                        break
+
+    except IOError:
+        return None
+    return data
+
+def distro_identifier(adjust_hook=None):
+    """Return a distro identifier string based upon lsb_release -ri,
+       with optional adjustment via a hook"""
+
+    lsb_data = release_dict()
+    if lsb_data:
+        distro_id, release = lsb_data['Distributor ID'], lsb_data['Release']
+    else:
+        lsb_data_file = release_dict_file()
+        if lsb_data_file:
+            distro_id, release = lsb_data_file['DISTRIB_ID'], lsb_data_file.get('DISTRIB_RELEASE', None)
+        else:
+            distro_id, release = None, None
+
+    if adjust_hook:
+        distro_id, release = adjust_hook(distro_id, release)
+    if not distro_id:
+        return "Unknown"
+    if release:
+        id_str = '{0}-{1}'.format(distro_id, release)
+    else:
+        id_str = distro_id
+    return id_str.replace(' ','-').replace('/','-')
diff --git a/meta/lib/oe/maketype.py b/meta/lib/oe/maketype.py
new file mode 100644
index 0000000..139f333
--- /dev/null
+++ b/meta/lib/oe/maketype.py
@@ -0,0 +1,99 @@
+"""OpenEmbedded variable typing support
+
+Types are defined in the metadata by name, using the 'type' flag on a
+variable.  Other flags may be utilized in the construction of the types.  See
+the arguments of the type's factory for details.
+"""
+
+import inspect
+import types
+
+available_types = {}
+
+class MissingFlag(TypeError):
+    """A particular flag is required to construct the type, but has not been
+    provided."""
+    def __init__(self, flag, type):
+        self.flag = flag
+        self.type = type
+        TypeError.__init__(self)
+
+    def __str__(self):
+        return "Type '%s' requires flag '%s'" % (self.type, self.flag)
+
+def factory(var_type):
+    """Return the factory for a specified type."""
+    if var_type is None:
+        raise TypeError("No type specified. Valid types: %s" %
+                        ', '.join(available_types))
+    try:
+        return available_types[var_type]
+    except KeyError:
+        raise TypeError("Invalid type '%s':\n  Valid types: %s" %
+                        (var_type, ', '.join(available_types)))
+
+def create(value, var_type, **flags):
+    """Create an object of the specified type, given the specified flags and
+    string value."""
+    obj = factory(var_type)
+    objflags = {}
+    for flag in obj.flags:
+        if flag not in flags:
+            if flag not in obj.optflags:
+                raise MissingFlag(flag, var_type)
+        else:
+            objflags[flag] = flags[flag]
+
+    return obj(value, **objflags)
+
+def get_callable_args(obj):
+    """Grab all but the first argument of the specified callable, returning
+    the list, as well as a list of which of the arguments have default
+    values."""
+    if type(obj) is type:
+        obj = obj.__init__
+
+    args, varargs, keywords, defaults = inspect.getargspec(obj)
+    flaglist = []
+    if args:
+        if len(args) > 1 and args[0] == 'self':
+            args = args[1:]
+        flaglist.extend(args)
+
+    optional = set()
+    if defaults:
+        optional |= set(flaglist[-len(defaults):])
+    return flaglist, optional
+
+def factory_setup(name, obj):
+    """Prepare a factory for use."""
+    args, optional = get_callable_args(obj)
+    extra_args = args[1:]
+    if extra_args:
+        obj.flags, optional = extra_args, optional
+        obj.optflags = set(optional)
+    else:
+        obj.flags = obj.optflags = ()
+
+    if not hasattr(obj, 'name'):
+        obj.name = name
+
+def register(name, factory):
+    """Register a type, given its name and a factory callable.
+
+    Determines the required and optional flags from the factory's
+    arguments."""
+    factory_setup(name, factory)
+    available_types[factory.name] = factory
+
+
+# Register all our included types
+for name in dir(types):
+    if name.startswith('_'):
+        continue
+
+    obj = getattr(types, name)
+    if not callable(obj):
+        continue
+
+    register(name, obj)
diff --git a/meta/lib/oe/manifest.py b/meta/lib/oe/manifest.py
new file mode 100644
index 0000000..42832f1
--- /dev/null
+++ b/meta/lib/oe/manifest.py
@@ -0,0 +1,345 @@
+from abc import ABCMeta, abstractmethod
+import os
+import re
+import bb
+
+
+class Manifest(object):
+    """
+    This is an abstract class. Do not instantiate this directly.
+    """
+    __metaclass__ = ABCMeta
+
+    PKG_TYPE_MUST_INSTALL = "mip"
+    PKG_TYPE_MULTILIB = "mlp"
+    PKG_TYPE_LANGUAGE = "lgp"
+    PKG_TYPE_ATTEMPT_ONLY = "aop"
+
+    MANIFEST_TYPE_IMAGE = "image"
+    MANIFEST_TYPE_SDK_HOST = "sdk_host"
+    MANIFEST_TYPE_SDK_TARGET = "sdk_target"
+
+    var_maps = {
+        MANIFEST_TYPE_IMAGE: {
+            "PACKAGE_INSTALL": PKG_TYPE_MUST_INSTALL,
+            "PACKAGE_INSTALL_ATTEMPTONLY": PKG_TYPE_ATTEMPT_ONLY,
+            "LINGUAS_INSTALL": PKG_TYPE_LANGUAGE
+        },
+        MANIFEST_TYPE_SDK_HOST: {
+            "TOOLCHAIN_HOST_TASK": PKG_TYPE_MUST_INSTALL,
+            "TOOLCHAIN_HOST_TASK_ATTEMPTONLY": PKG_TYPE_ATTEMPT_ONLY
+        },
+        MANIFEST_TYPE_SDK_TARGET: {
+            "TOOLCHAIN_TARGET_TASK": PKG_TYPE_MUST_INSTALL,
+            "TOOLCHAIN_TARGET_TASK_ATTEMPTONLY": PKG_TYPE_ATTEMPT_ONLY
+        }
+    }
+
+    INSTALL_ORDER = [
+        PKG_TYPE_LANGUAGE,
+        PKG_TYPE_MUST_INSTALL,
+        PKG_TYPE_ATTEMPT_ONLY,
+        PKG_TYPE_MULTILIB
+    ]
+
+    initial_manifest_file_header = \
+        "# This file was generated automatically and contains the packages\n" \
+        "# passed on to the package manager in order to create the rootfs.\n\n" \
+        "# Format:\n" \
+        "#  <package_type>,<package_name>\n" \
+        "# where:\n" \
+        "#   <package_type> can be:\n" \
+        "#      'mip' = must install package\n" \
+        "#      'aop' = attempt only package\n" \
+        "#      'mlp' = multilib package\n" \
+        "#      'lgp' = language package\n\n"
+
+    def __init__(self, d, manifest_dir=None, manifest_type=MANIFEST_TYPE_IMAGE):
+        self.d = d
+        self.manifest_type = manifest_type
+
+        if manifest_dir is None:
+            if manifest_type != self.MANIFEST_TYPE_IMAGE:
+                self.manifest_dir = self.d.getVar('SDK_DIR', True)
+            else:
+                self.manifest_dir = self.d.getVar('WORKDIR', True)
+        else:
+            self.manifest_dir = manifest_dir
+
+        bb.utils.mkdirhier(self.manifest_dir)
+
+        self.initial_manifest = os.path.join(self.manifest_dir, "%s_initial_manifest" % manifest_type)
+        self.final_manifest = os.path.join(self.manifest_dir, "%s_final_manifest" % manifest_type)
+        self.full_manifest = os.path.join(self.manifest_dir, "%s_full_manifest" % manifest_type)
+
+        # packages in the following vars will be split in 'must install' and
+        # 'multilib'
+        self.vars_to_split = ["PACKAGE_INSTALL",
+                              "TOOLCHAIN_HOST_TASK",
+                              "TOOLCHAIN_TARGET_TASK"]
+
+    """
+    This creates a standard initial manifest for core-image-(minimal|sato|sato-sdk).
+    This will be used for testing until the class is implemented properly!
+    """
+    def _create_dummy_initial(self):
+        image_rootfs = self.d.getVar('IMAGE_ROOTFS', True)
+        pkg_list = dict()
+        if image_rootfs.find("core-image-sato-sdk") > 0:
+            pkg_list[self.PKG_TYPE_MUST_INSTALL] = \
+                "packagegroup-core-x11-sato-games packagegroup-base-extended " \
+                "packagegroup-core-x11-sato packagegroup-core-x11-base " \
+                "packagegroup-core-sdk packagegroup-core-tools-debug " \
+                "packagegroup-core-boot packagegroup-core-tools-testapps " \
+                "packagegroup-core-eclipse-debug packagegroup-core-qt-demoapps " \
+                "apt packagegroup-core-tools-profile psplash " \
+                "packagegroup-core-standalone-sdk-target " \
+                "packagegroup-core-ssh-openssh dpkg kernel-dev"
+            pkg_list[self.PKG_TYPE_LANGUAGE] = \
+                "locale-base-en-us locale-base-en-gb"
+        elif image_rootfs.find("core-image-sato") > 0:
+            pkg_list[self.PKG_TYPE_MUST_INSTALL] = \
+                "packagegroup-core-ssh-dropbear packagegroup-core-x11-sato-games " \
+                "packagegroup-core-x11-base psplash apt dpkg packagegroup-base-extended " \
+                "packagegroup-core-x11-sato packagegroup-core-boot"
+            pkg_list['lgp'] = \
+                "locale-base-en-us locale-base-en-gb"
+        elif image_rootfs.find("core-image-minimal") > 0:
+            pkg_list[self.PKG_TYPE_MUST_INSTALL] = "run-postinsts packagegroup-core-boot"
+
+        with open(self.initial_manifest, "w+") as manifest:
+            manifest.write(self.initial_manifest_file_header)
+
+            for pkg_type in pkg_list:
+                for pkg in pkg_list[pkg_type].split():
+                    manifest.write("%s,%s\n" % (pkg_type, pkg))
+
+    """
+    This will create the initial manifest which will be used by Rootfs class to
+    generate the rootfs
+    """
+    @abstractmethod
+    def create_initial(self):
+        pass
+
+    """
+    This creates the manifest after everything has been installed.
+    """
+    @abstractmethod
+    def create_final(self):
+        pass
+
+    """
+    This creates the manifest after the package in initial manifest has been
+    dummy installed. It lists all *to be installed* packages. There is no real
+    installation, just a test.
+    """
+    @abstractmethod
+    def create_full(self, pm):
+        pass
+
+    """
+    The following function parses an initial manifest and returns a dictionary
+    object with the must install, attempt only, multilib and language packages.
+    """
+    def parse_initial_manifest(self):
+        pkgs = dict()
+
+        with open(self.initial_manifest) as manifest:
+            for line in manifest.read().split('\n'):
+                comment = re.match("^#.*", line)
+                pattern = "^(%s|%s|%s|%s),(.*)$" % \
+                          (self.PKG_TYPE_MUST_INSTALL,
+                           self.PKG_TYPE_ATTEMPT_ONLY,
+                           self.PKG_TYPE_MULTILIB,
+                           self.PKG_TYPE_LANGUAGE)
+                pkg = re.match(pattern, line)
+
+                if comment is not None:
+                    continue
+
+                if pkg is not None:
+                    pkg_type = pkg.group(1)
+                    pkg_name = pkg.group(2)
+
+                    if not pkg_type in pkgs:
+                        pkgs[pkg_type] = [pkg_name]
+                    else:
+                        pkgs[pkg_type].append(pkg_name)
+
+        return pkgs
+
+    '''
+    This following function parses a full manifest and return a list
+    object with packages.
+    '''
+    def parse_full_manifest(self):
+        installed_pkgs = list()
+        if not os.path.exists(self.full_manifest):
+            bb.note('full manifest not exist')
+            return installed_pkgs
+
+        with open(self.full_manifest, 'r') as manifest:
+            for pkg in manifest.read().split('\n'):
+                installed_pkgs.append(pkg.strip())
+
+        return installed_pkgs
+
+
+class RpmManifest(Manifest):
+    """
+    Returns a dictionary object with mip and mlp packages.
+    """
+    def _split_multilib(self, pkg_list):
+        pkgs = dict()
+
+        for pkg in pkg_list.split():
+            pkg_type = self.PKG_TYPE_MUST_INSTALL
+
+            ml_variants = self.d.getVar('MULTILIB_VARIANTS', True).split()
+
+            for ml_variant in ml_variants:
+                if pkg.startswith(ml_variant + '-'):
+                    pkg_type = self.PKG_TYPE_MULTILIB
+
+            if not pkg_type in pkgs:
+                pkgs[pkg_type] = pkg
+            else:
+                pkgs[pkg_type] += " " + pkg
+
+        return pkgs
+
+    def create_initial(self):
+        pkgs = dict()
+
+        with open(self.initial_manifest, "w+") as manifest:
+            manifest.write(self.initial_manifest_file_header)
+
+            for var in self.var_maps[self.manifest_type]:
+                if var in self.vars_to_split:
+                    split_pkgs = self._split_multilib(self.d.getVar(var, True))
+                    if split_pkgs is not None:
+                        pkgs = dict(pkgs.items() + split_pkgs.items())
+                else:
+                    pkg_list = self.d.getVar(var, True)
+                    if pkg_list is not None:
+                        pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var, True)
+
+            for pkg_type in pkgs:
+                for pkg in pkgs[pkg_type].split():
+                    manifest.write("%s,%s\n" % (pkg_type, pkg))
+
+    def create_final(self):
+        pass
+
+    def create_full(self, pm):
+        pass
+
+
+class OpkgManifest(Manifest):
+    """
+    Returns a dictionary object with mip and mlp packages.
+    """
+    def _split_multilib(self, pkg_list):
+        pkgs = dict()
+
+        for pkg in pkg_list.split():
+            pkg_type = self.PKG_TYPE_MUST_INSTALL
+
+            ml_variants = self.d.getVar('MULTILIB_VARIANTS', True).split()
+
+            for ml_variant in ml_variants:
+                if pkg.startswith(ml_variant + '-'):
+                    pkg_type = self.PKG_TYPE_MULTILIB
+
+            if not pkg_type in pkgs:
+                pkgs[pkg_type] = pkg
+            else:
+                pkgs[pkg_type] += " " + pkg
+
+        return pkgs
+
+    def create_initial(self):
+        pkgs = dict()
+
+        with open(self.initial_manifest, "w+") as manifest:
+            manifest.write(self.initial_manifest_file_header)
+
+            for var in self.var_maps[self.manifest_type]:
+                if var in self.vars_to_split:
+                    split_pkgs = self._split_multilib(self.d.getVar(var, True))
+                    if split_pkgs is not None:
+                        pkgs = dict(pkgs.items() + split_pkgs.items())
+                else:
+                    pkg_list = self.d.getVar(var, True)
+                    if pkg_list is not None:
+                        pkgs[self.var_maps[self.manifest_type][var]] = self.d.getVar(var, True)
+
+            for pkg_type in pkgs:
+                for pkg in pkgs[pkg_type].split():
+                    manifest.write("%s,%s\n" % (pkg_type, pkg))
+
+    def create_final(self):
+        pass
+
+    def create_full(self, pm):
+        if not os.path.exists(self.initial_manifest):
+            self.create_initial()
+
+        initial_manifest = self.parse_initial_manifest()
+        pkgs_to_install = list()
+        for pkg_type in initial_manifest:
+            pkgs_to_install += initial_manifest[pkg_type]
+        if len(pkgs_to_install) == 0:
+            return
+
+        output = pm.dummy_install(pkgs_to_install)
+
+        with open(self.full_manifest, 'w+') as manifest:
+            pkg_re = re.compile('^Installing ([^ ]+) [^ ].*')
+            for line in set(output.split('\n')):
+                m = pkg_re.match(line)
+                if m:
+                    manifest.write(m.group(1) + '\n')
+
+        return
+
+
+class DpkgManifest(Manifest):
+    def create_initial(self):
+        with open(self.initial_manifest, "w+") as manifest:
+            manifest.write(self.initial_manifest_file_header)
+
+            for var in self.var_maps[self.manifest_type]:
+                pkg_list = self.d.getVar(var, True)
+
+                if pkg_list is None:
+                    continue
+
+                for pkg in pkg_list.split():
+                    manifest.write("%s,%s\n" %
+                                   (self.var_maps[self.manifest_type][var], pkg))
+
+    def create_final(self):
+        pass
+
+    def create_full(self, pm):
+        pass
+
+
+def create_manifest(d, final_manifest=False, manifest_dir=None,
+                    manifest_type=Manifest.MANIFEST_TYPE_IMAGE):
+    manifest_map = {'rpm': RpmManifest,
+                    'ipk': OpkgManifest,
+                    'deb': DpkgManifest}
+
+    manifest = manifest_map[d.getVar('IMAGE_PKGTYPE', True)](d, manifest_dir, manifest_type)
+
+    if final_manifest:
+        manifest.create_final()
+    else:
+        manifest.create_initial()
+
+
+if __name__ == "__main__":
+    pass
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
new file mode 100644
index 0000000..f176446
--- /dev/null
+++ b/meta/lib/oe/package.py
@@ -0,0 +1,125 @@
+def runstrip(arg):
+    # Function to strip a single file, called from split_and_strip_files below
+    # A working 'file' (one which works on the target architecture)
+    #
+    # The elftype is a bit pattern (explained in split_and_strip_files) to tell
+    # us what type of file we're processing...
+    # 4 - executable
+    # 8 - shared library
+    # 16 - kernel module
+
+    import commands, stat, subprocess
+
+    (file, elftype, strip) = arg
+
+    newmode = None
+    if not os.access(file, os.W_OK) or os.access(file, os.R_OK):
+        origmode = os.stat(file)[stat.ST_MODE]
+        newmode = origmode | stat.S_IWRITE | stat.S_IREAD
+        os.chmod(file, newmode)
+
+    extraflags = ""
+
+    # kernel module    
+    if elftype & 16:
+        extraflags = "--strip-debug --remove-section=.comment --remove-section=.note --preserve-dates"
+    # .so and shared library
+    elif ".so" in file and elftype & 8:
+        extraflags = "--remove-section=.comment --remove-section=.note --strip-unneeded"
+    # shared or executable:
+    elif elftype & 8 or elftype & 4:
+        extraflags = "--remove-section=.comment --remove-section=.note"
+
+    stripcmd = "'%s' %s '%s'" % (strip, extraflags, file)
+    bb.debug(1, "runstrip: %s" % stripcmd)
+
+    try:
+        output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT, shell=True)
+    except subprocess.CalledProcessError as e:
+        bb.error("runstrip: '%s' strip command failed with %s (%s)" % (stripcmd, e.returncode, e.output))
+
+    if newmode:
+        os.chmod(file, origmode)
+
+    return
+
+
+def file_translate(file):
+    ft = file.replace("@", "@at@")
+    ft = ft.replace(" ", "@space@")
+    ft = ft.replace("\t", "@tab@")
+    ft = ft.replace("[", "@openbrace@")
+    ft = ft.replace("]", "@closebrace@")
+    ft = ft.replace("_", "@underscore@")
+    return ft
+
+def filedeprunner(arg):
+    import re, subprocess, shlex
+
+    (pkg, pkgfiles, rpmdeps, pkgdest) = arg
+    provides = {}
+    requires = {}
+
+    r = re.compile(r'[<>=]+ +[^ ]*')
+
+    def process_deps(pipe, pkg, pkgdest, provides, requires):
+        for line in pipe:
+            f = line.split(" ", 1)[0].strip()
+            line = line.split(" ", 1)[1].strip()
+
+            if line.startswith("Requires:"):
+                i = requires
+            elif line.startswith("Provides:"):
+                i = provides
+            else:
+                continue
+
+            file = f.replace(pkgdest + "/" + pkg, "")
+            file = file_translate(file)
+            value = line.split(":", 1)[1].strip()
+            value = r.sub(r'(\g<0>)', value)
+
+            if value.startswith("rpmlib("):
+                continue
+            if value == "python":
+                continue
+            if file not in i:
+                i[file] = []
+            i[file].append(value)
+
+        return provides, requires
+
+    try:
+        dep_popen = subprocess.Popen(shlex.split(rpmdeps) + pkgfiles, stdout=subprocess.PIPE)
+        provides, requires = process_deps(dep_popen.stdout, pkg, pkgdest, provides, requires)
+    except OSError as e:
+        bb.error("rpmdeps: '%s' command failed, '%s'" % (shlex.split(rpmdeps) + pkgfiles, e))
+        raise e
+
+    return (pkg, provides, requires)
+
+
+def read_shlib_providers(d):
+    import re
+
+    shlib_provider = {}
+    shlibs_dirs = d.getVar('SHLIBSDIRS', True).split()
+    list_re = re.compile('^(.*)\.list$')
+    # Go from least to most specific since the last one found wins
+    for dir in reversed(shlibs_dirs):
+        bb.debug(2, "Reading shlib providers in %s" % (dir))
+        if not os.path.exists(dir):
+            continue
+        for file in os.listdir(dir):
+            m = list_re.match(file)
+            if m:
+                dep_pkg = m.group(1)
+                fd = open(os.path.join(dir, file))
+                lines = fd.readlines()
+                fd.close()
+                for l in lines:
+                    s = l.strip().split(":")
+                    if s[0] not in shlib_provider:
+                        shlib_provider[s[0]] = {}
+                    shlib_provider[s[0]][s[1]] = (dep_pkg, s[2])
+    return shlib_provider
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
new file mode 100644
index 0000000..292ed44
--- /dev/null
+++ b/meta/lib/oe/package_manager.py
@@ -0,0 +1,1900 @@
+from abc import ABCMeta, abstractmethod
+import os
+import glob
+import subprocess
+import shutil
+import multiprocessing
+import re
+import bb
+import tempfile
+import oe.utils
+
+
+# this can be used by all PM backends to create the index files in parallel
+def create_index(arg):
+    index_cmd = arg
+
+    try:
+        bb.note("Executing '%s' ..." % index_cmd)
+        result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True)
+    except subprocess.CalledProcessError as e:
+        return("Index creation command '%s' failed with return code %d:\n%s" %
+               (e.cmd, e.returncode, e.output))
+
+    if result:
+        bb.note(result)
+
+    return None
+
+
+class Indexer(object):
+    __metaclass__ = ABCMeta
+
+    def __init__(self, d, deploy_dir):
+        self.d = d
+        self.deploy_dir = deploy_dir
+
+    @abstractmethod
+    def write_index(self):
+        pass
+
+
+class RpmIndexer(Indexer):
+    def get_ml_prefix_and_os_list(self, arch_var=None, os_var=None):
+        package_archs = {
+            'default': [],
+        }
+
+        target_os = {
+            'default': "",
+        }
+
+        if arch_var is not None and os_var is not None:
+            package_archs['default'] = self.d.getVar(arch_var, True).split()
+            package_archs['default'].reverse()
+            target_os['default'] = self.d.getVar(os_var, True).strip()
+        else:
+            package_archs['default'] = self.d.getVar("PACKAGE_ARCHS", True).split()
+            # arch order is reversed.  This ensures the -best- match is
+            # listed first!
+            package_archs['default'].reverse()
+            target_os['default'] = self.d.getVar("TARGET_OS", True).strip()
+            multilibs = self.d.getVar('MULTILIBS', True) or ""
+            for ext in multilibs.split():
+                eext = ext.split(':')
+                if len(eext) > 1 and eext[0] == 'multilib':
+                    localdata = bb.data.createCopy(self.d)
+                    default_tune_key = "DEFAULTTUNE_virtclass-multilib-" + eext[1]
+                    default_tune = localdata.getVar(default_tune_key, False)
+                    if default_tune is None:
+                        default_tune_key = "DEFAULTTUNE_ML_" + eext[1]
+                        default_tune = localdata.getVar(default_tune_key, False)
+                    if default_tune:
+                        localdata.setVar("DEFAULTTUNE", default_tune)
+                        bb.data.update_data(localdata)
+                        package_archs[eext[1]] = localdata.getVar('PACKAGE_ARCHS',
+                                                                  True).split()
+                        package_archs[eext[1]].reverse()
+                        target_os[eext[1]] = localdata.getVar("TARGET_OS",
+                                                              True).strip()
+
+        ml_prefix_list = dict()
+        for mlib in package_archs:
+            if mlib == 'default':
+                ml_prefix_list[mlib] = package_archs[mlib]
+            else:
+                ml_prefix_list[mlib] = list()
+                for arch in package_archs[mlib]:
+                    if arch in ['all', 'noarch', 'any']:
+                        ml_prefix_list[mlib].append(arch)
+                    else:
+                        ml_prefix_list[mlib].append(mlib + "_" + arch)
+
+        return (ml_prefix_list, target_os)
+
+    def write_index(self):
+        sdk_pkg_archs = (self.d.getVar('SDK_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
+        all_mlb_pkg_archs = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
+
+        mlb_prefix_list = self.get_ml_prefix_and_os_list()[0]
+
+        archs = set()
+        for item in mlb_prefix_list:
+            archs = archs.union(set(i.replace('-', '_') for i in mlb_prefix_list[item]))
+
+        if len(archs) == 0:
+            archs = archs.union(set(all_mlb_pkg_archs))
+
+        archs = archs.union(set(sdk_pkg_archs))
+
+        rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo")
+        if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
+            pkgfeed_gpg_name = self.d.getVar('PACKAGE_FEED_GPG_NAME', True)
+            pkgfeed_gpg_pass = self.d.getVar('PACKAGE_FEED_GPG_PASSPHRASE_FILE', True)
+        else:
+            pkgfeed_gpg_name = None
+            pkgfeed_gpg_pass = None
+        gpg_bin = self.d.getVar('GPG_BIN', True) or \
+                  bb.utils.which(os.getenv('PATH'), "gpg")
+
+        index_cmds = []
+        repo_sign_cmds = []
+        rpm_dirs_found = False
+        for arch in archs:
+            dbpath = os.path.join(self.d.getVar('WORKDIR', True), 'rpmdb', arch)
+            if os.path.exists(dbpath):
+                bb.utils.remove(dbpath, True)
+            arch_dir = os.path.join(self.deploy_dir, arch)
+            if not os.path.isdir(arch_dir):
+                continue
+
+            index_cmds.append("%s --dbpath %s --update -q %s" % \
+                             (rpm_createrepo, dbpath, arch_dir))
+            if pkgfeed_gpg_name:
+                repomd_file = os.path.join(arch_dir, 'repodata', 'repomd.xml')
+                gpg_cmd = "%s --detach-sign --armor --batch --no-tty --yes " \
+                          "--passphrase-file '%s' -u '%s' %s" % (gpg_bin,
+                          pkgfeed_gpg_pass, pkgfeed_gpg_name, repomd_file)
+                repo_sign_cmds.append(gpg_cmd)
+
+            rpm_dirs_found = True
+
+        if not rpm_dirs_found:
+            bb.note("There are no packages in %s" % self.deploy_dir)
+            return
+
+        # Create repodata
+        result = oe.utils.multiprocess_exec(index_cmds, create_index)
+        if result:
+            bb.fatal('%s' % ('\n'.join(result)))
+        # Sign repomd
+        result = oe.utils.multiprocess_exec(repo_sign_cmds, create_index)
+        if result:
+            bb.fatal('%s' % ('\n'.join(result)))
+        # Copy pubkey(s) to repo
+        distro_version = self.d.getVar('DISTRO_VERSION', True) or "oe.0"
+        if self.d.getVar('RPM_SIGN_PACKAGES', True) == '1':
+            shutil.copy2(self.d.getVar('RPM_GPG_PUBKEY', True),
+                         os.path.join(self.deploy_dir,
+                                      'RPM-GPG-KEY-%s' % distro_version))
+        if self.d.getVar('PACKAGE_FEED_SIGN', True) == '1':
+            shutil.copy2(self.d.getVar('PACKAGE_FEED_GPG_PUBKEY', True),
+                         os.path.join(self.deploy_dir,
+                                      'REPODATA-GPG-KEY-%s' % distro_version))
+
+
+class OpkgIndexer(Indexer):
+    def write_index(self):
+        arch_vars = ["ALL_MULTILIB_PACKAGE_ARCHS",
+                     "SDK_PACKAGE_ARCHS",
+                     "MULTILIB_ARCHS"]
+
+        opkg_index_cmd = bb.utils.which(os.getenv('PATH'), "opkg-make-index")
+
+        if not os.path.exists(os.path.join(self.deploy_dir, "Packages")):
+            open(os.path.join(self.deploy_dir, "Packages"), "w").close()
+
+        index_cmds = []
+        for arch_var in arch_vars:
+            archs = self.d.getVar(arch_var, True)
+            if archs is None:
+                continue
+
+            for arch in archs.split():
+                pkgs_dir = os.path.join(self.deploy_dir, arch)
+                pkgs_file = os.path.join(pkgs_dir, "Packages")
+
+                if not os.path.isdir(pkgs_dir):
+                    continue
+
+                if not os.path.exists(pkgs_file):
+                    open(pkgs_file, "w").close()
+
+                index_cmds.append('%s -r %s -p %s -m %s' %
+                                  (opkg_index_cmd, pkgs_file, pkgs_file, pkgs_dir))
+
+        if len(index_cmds) == 0:
+            bb.note("There are no packages in %s!" % self.deploy_dir)
+            return
+
+        result = oe.utils.multiprocess_exec(index_cmds, create_index)
+        if result:
+            bb.fatal('%s' % ('\n'.join(result)))
+
+
+
+class DpkgIndexer(Indexer):
+    def _create_configs(self):
+        bb.utils.mkdirhier(self.apt_conf_dir)
+        bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "lists", "partial"))
+        bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "apt.conf.d"))
+        bb.utils.mkdirhier(os.path.join(self.apt_conf_dir, "preferences.d"))
+
+        with open(os.path.join(self.apt_conf_dir, "preferences"),
+                "w") as prefs_file:
+            pass
+        with open(os.path.join(self.apt_conf_dir, "sources.list"),
+                "w+") as sources_file:
+            pass
+
+        with open(self.apt_conf_file, "w") as apt_conf:
+            with open(os.path.join(self.d.expand("${STAGING_ETCDIR_NATIVE}"),
+                "apt", "apt.conf.sample")) as apt_conf_sample:
+                for line in apt_conf_sample.read().split("\n"):
+                    line = re.sub("#ROOTFS#", "/dev/null", line)
+                    line = re.sub("#APTCONF#", self.apt_conf_dir, line)
+                    apt_conf.write(line + "\n")
+
+    def write_index(self):
+        self.apt_conf_dir = os.path.join(self.d.expand("${APTCONF_TARGET}"),
+                "apt-ftparchive")
+        self.apt_conf_file = os.path.join(self.apt_conf_dir, "apt.conf")
+        self._create_configs()
+
+        os.environ['APT_CONFIG'] = self.apt_conf_file
+
+        pkg_archs = self.d.getVar('PACKAGE_ARCHS', True)
+        if pkg_archs is not None:
+            arch_list = pkg_archs.split()
+        sdk_pkg_archs = self.d.getVar('SDK_PACKAGE_ARCHS', True)
+        if sdk_pkg_archs is not None:
+            for a in sdk_pkg_archs.split():
+                if a not in pkg_archs:
+                    arch_list.append(a)
+
+        all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
+        arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in arch_list)
+
+        apt_ftparchive = bb.utils.which(os.getenv('PATH'), "apt-ftparchive")
+        gzip = bb.utils.which(os.getenv('PATH'), "gzip")
+
+        index_cmds = []
+        deb_dirs_found = False
+        for arch in arch_list:
+            arch_dir = os.path.join(self.deploy_dir, arch)
+            if not os.path.isdir(arch_dir):
+                continue
+
+            cmd = "cd %s; PSEUDO_UNLOAD=1 %s packages . > Packages;" % (arch_dir, apt_ftparchive)
+
+            cmd += "%s -fc Packages > Packages.gz;" % gzip
+
+            with open(os.path.join(arch_dir, "Release"), "w+") as release:
+                release.write("Label: %s\n" % arch)
+
+            cmd += "PSEUDO_UNLOAD=1 %s release . >> Release" % apt_ftparchive
+            
+            index_cmds.append(cmd)
+
+            deb_dirs_found = True
+
+        if not deb_dirs_found:
+            bb.note("There are no packages in %s" % self.deploy_dir)
+            return
+
+        result = oe.utils.multiprocess_exec(index_cmds, create_index)
+        if result:
+            bb.fatal('%s' % ('\n'.join(result)))
+
+
+
+class PkgsList(object):
+    __metaclass__ = ABCMeta
+
+    def __init__(self, d, rootfs_dir):
+        self.d = d
+        self.rootfs_dir = rootfs_dir
+
+    @abstractmethod
+    def list(self, format=None):
+        pass
+
+
+class RpmPkgsList(PkgsList):
+    def __init__(self, d, rootfs_dir, arch_var=None, os_var=None):
+        super(RpmPkgsList, self).__init__(d, rootfs_dir)
+
+        self.rpm_cmd = bb.utils.which(os.getenv('PATH'), "rpm")
+        self.image_rpmlib = os.path.join(self.rootfs_dir, 'var/lib/rpm')
+
+        self.ml_prefix_list, self.ml_os_list = \
+            RpmIndexer(d, rootfs_dir).get_ml_prefix_and_os_list(arch_var, os_var)
+
+        # Determine rpm version
+        cmd = "%s --version" % self.rpm_cmd
+        try:
+            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Getting rpm version failed. Command '%s' "
+                     "returned %d:\n%s" % (cmd, e.returncode, e.output))
+        self.rpm_version = int(output.split()[-1].split('.')[0])
+
+    '''
+    Translate the RPM/Smart format names to the OE multilib format names
+    '''
+    def _pkg_translate_smart_to_oe(self, pkg, arch):
+        new_pkg = pkg
+        new_arch = arch
+        fixed_arch = arch.replace('_', '-')
+        found = 0
+        for mlib in self.ml_prefix_list:
+            for cmp_arch in self.ml_prefix_list[mlib]:
+                fixed_cmp_arch = cmp_arch.replace('_', '-')
+                if fixed_arch == fixed_cmp_arch:
+                    if mlib == 'default':
+                        new_pkg = pkg
+                        new_arch = cmp_arch
+                    else:
+                        new_pkg = mlib + '-' + pkg
+                        # We need to strip off the ${mlib}_ prefix on the arch
+                        new_arch = cmp_arch.replace(mlib + '_', '')
+
+                    # Workaround for bug 3565. Simply look to see if we
+                    # know of a package with that name, if not try again!
+                    filename = os.path.join(self.d.getVar('PKGDATA_DIR', True),
+                                            'runtime-reverse',
+                                            new_pkg)
+                    if os.path.exists(filename):
+                        found = 1
+                        break
+
+            if found == 1 and fixed_arch == fixed_cmp_arch:
+                break
+        #bb.note('%s, %s -> %s, %s' % (pkg, arch, new_pkg, new_arch))
+        return new_pkg, new_arch
+
+    def _list_pkg_deps(self):
+        cmd = [bb.utils.which(os.getenv('PATH'), "rpmresolve"),
+               "-t", self.image_rpmlib]
+
+        try:
+            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip()
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Cannot get the package dependencies. Command '%s' "
+                     "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output))
+
+        return output
+
+    def list(self, format=None):
+        if format == "deps":
+            if self.rpm_version == 4:
+                bb.fatal("'deps' format dependency listings are not supported with rpm 4 since rpmresolve does not work")
+            return self._list_pkg_deps()
+
+        cmd = self.rpm_cmd + ' --root ' + self.rootfs_dir
+        cmd += ' -D "_dbpath /var/lib/rpm" -qa'
+        if self.rpm_version == 4:
+            cmd += " --qf '[%{NAME} %{ARCH} %{VERSION}\n]'"
+        else:
+            cmd += " --qf '[%{NAME} %{ARCH} %{VERSION} %{PACKAGEORIGIN}\n]'"
+
+        try:
+            # bb.note(cmd)
+            tmp_output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip()
+
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Cannot get the installed packages list. Command '%s' "
+                     "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+        output = list()
+        for line in tmp_output.split('\n'):
+            if len(line.strip()) == 0:
+                continue
+            pkg = line.split()[0]
+            arch = line.split()[1]
+            ver = line.split()[2]
+            # Skip GPG keys
+            if pkg == 'gpg-pubkey':
+                continue
+            if self.rpm_version == 4:
+                pkgorigin = "unknown"
+            else:
+                pkgorigin = line.split()[3]
+            new_pkg, new_arch = self._pkg_translate_smart_to_oe(pkg, arch)
+
+            if format == "arch":
+                output.append('%s %s' % (new_pkg, new_arch))
+            elif format == "file":
+                output.append('%s %s %s' % (new_pkg, pkgorigin, new_arch))
+            elif format == "ver":
+                output.append('%s %s %s' % (new_pkg, new_arch, ver))
+            else:
+                output.append('%s' % (new_pkg))
+
+            output.sort()
+
+        return '\n'.join(output)
+
+
+class OpkgPkgsList(PkgsList):
+    def __init__(self, d, rootfs_dir, config_file):
+        super(OpkgPkgsList, self).__init__(d, rootfs_dir)
+
+        self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
+        self.opkg_args = "-f %s -o %s " % (config_file, rootfs_dir)
+        self.opkg_args += self.d.getVar("OPKG_ARGS", True)
+
+    def list(self, format=None):
+        opkg_query_cmd = bb.utils.which(os.getenv('PATH'), "opkg-query-helper.py")
+
+        if format == "arch":
+            cmd = "%s %s status | %s -a" % \
+                (self.opkg_cmd, self.opkg_args, opkg_query_cmd)
+        elif format == "file":
+            cmd = "%s %s status | %s -f" % \
+                (self.opkg_cmd, self.opkg_args, opkg_query_cmd)
+        elif format == "ver":
+            cmd = "%s %s status | %s -v" % \
+                (self.opkg_cmd, self.opkg_args, opkg_query_cmd)
+        elif format == "deps":
+            cmd = "%s %s status | %s" % \
+                (self.opkg_cmd, self.opkg_args, opkg_query_cmd)
+        else:
+            cmd = "%s %s list_installed | cut -d' ' -f1" % \
+                (self.opkg_cmd, self.opkg_args)
+
+        try:
+            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip()
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Cannot get the installed packages list. Command '%s' "
+                     "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+        if output and format == "file":
+            tmp_output = ""
+            for line in output.split('\n'):
+                pkg, pkg_file, pkg_arch = line.split()
+                full_path = os.path.join(self.rootfs_dir, pkg_arch, pkg_file)
+                if os.path.exists(full_path):
+                    tmp_output += "%s %s %s\n" % (pkg, full_path, pkg_arch)
+                else:
+                    tmp_output += "%s %s %s\n" % (pkg, pkg_file, pkg_arch)
+
+            output = tmp_output
+
+        return output
+
+
+class DpkgPkgsList(PkgsList):
+    def list(self, format=None):
+        cmd = [bb.utils.which(os.getenv('PATH'), "dpkg-query"),
+               "--admindir=%s/var/lib/dpkg" % self.rootfs_dir,
+               "-W"]
+
+        if format == "arch":
+            cmd.append("-f=${Package} ${PackageArch}\n")
+        elif format == "file":
+            cmd.append("-f=${Package} ${Package}_${Version}_${Architecture}.deb ${PackageArch}\n")
+        elif format == "ver":
+            cmd.append("-f=${Package} ${PackageArch} ${Version}\n")
+        elif format == "deps":
+            cmd.append("-f=Package: ${Package}\nDepends: ${Depends}\nRecommends: ${Recommends}\n\n")
+        else:
+            cmd.append("-f=${Package}\n")
+
+        try:
+            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT).strip()
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Cannot get the installed packages list. Command '%s' "
+                     "returned %d:\n%s" % (' '.join(cmd), e.returncode, e.output))
+
+        if format == "file":
+            tmp_output = ""
+            for line in tuple(output.split('\n')):
+                if not line.strip():
+                    continue
+                pkg, pkg_file, pkg_arch = line.split()
+                full_path = os.path.join(self.rootfs_dir, pkg_arch, pkg_file)
+                if os.path.exists(full_path):
+                    tmp_output += "%s %s %s\n" % (pkg, full_path, pkg_arch)
+                else:
+                    tmp_output += "%s %s %s\n" % (pkg, pkg_file, pkg_arch)
+
+            output = tmp_output
+        elif format == "deps":
+            opkg_query_cmd = bb.utils.which(os.getenv('PATH'), "opkg-query-helper.py")
+            file_out = tempfile.NamedTemporaryFile()
+            file_out.write(output)
+            file_out.flush()
+
+            try:
+                output = subprocess.check_output("cat %s | %s" %
+                                                 (file_out.name, opkg_query_cmd),
+                                                 stderr=subprocess.STDOUT,
+                                                 shell=True)
+            except subprocess.CalledProcessError as e:
+                file_out.close()
+                bb.fatal("Cannot compute packages dependencies. Command '%s' "
+                         "returned %d:\n%s" % (e.cmd, e.returncode, e.output))
+
+            file_out.close()
+
+        return output
+
+
+class PackageManager(object):
+    """
+    This is an abstract class. Do not instantiate this directly.
+    """
+    __metaclass__ = ABCMeta
+
+    def __init__(self, d):
+        self.d = d
+        self.deploy_dir = None
+        self.deploy_lock = None
+        self.feed_uris = self.d.getVar('PACKAGE_FEED_URIS', True) or ""
+        self.feed_prefix = self.d.getVar('PACKAGE_FEED_PREFIX', True) or ""
+
+    """
+    Update the package manager package database.
+    """
+    @abstractmethod
+    def update(self):
+        pass
+
+    """
+    Install a list of packages. 'pkgs' is a list object. If 'attempt_only' is
+    True, installation failures are ignored.
+    """
+    @abstractmethod
+    def install(self, pkgs, attempt_only=False):
+        pass
+
+    """
+    Remove a list of packages. 'pkgs' is a list object. If 'with_dependencies'
+    is False, the any dependencies are left in place.
+    """
+    @abstractmethod
+    def remove(self, pkgs, with_dependencies=True):
+        pass
+
+    """
+    This function creates the index files
+    """
+    @abstractmethod
+    def write_index(self):
+        pass
+
+    @abstractmethod
+    def remove_packaging_data(self):
+        pass
+
+    @abstractmethod
+    def list_installed(self, format=None):
+        pass
+
+    @abstractmethod
+    def insert_feeds_uris(self):
+        pass
+
+    """
+    Install complementary packages based upon the list of currently installed
+    packages e.g. locales, *-dev, *-dbg, etc. This will only attempt to install
+    these packages, if they don't exist then no error will occur.  Note: every
+    backend needs to call this function explicitly after the normal package
+    installation
+    """
+    def install_complementary(self, globs=None):
+        # we need to write the list of installed packages to a file because the
+        # oe-pkgdata-util reads it from a file
+        installed_pkgs_file = os.path.join(self.d.getVar('WORKDIR', True),
+                                           "installed_pkgs.txt")
+        with open(installed_pkgs_file, "w+") as installed_pkgs:
+            installed_pkgs.write(self.list_installed("arch"))
+
+        if globs is None:
+            globs = self.d.getVar('IMAGE_INSTALL_COMPLEMENTARY', True)
+            split_linguas = set()
+
+            for translation in self.d.getVar('IMAGE_LINGUAS', True).split():
+                split_linguas.add(translation)
+                split_linguas.add(translation.split('-')[0])
+
+            split_linguas = sorted(split_linguas)
+
+            for lang in split_linguas:
+                globs += " *-locale-%s" % lang
+
+        if globs is None:
+            return
+
+        cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
+               "-p", self.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file,
+               globs]
+        exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY', True)
+        if exclude:
+            cmd.extend(['-x', exclude])
+        try:
+            bb.note("Installing complementary packages ...")
+            complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Could not compute complementary packages list. Command "
+                     "'%s' returned %d:\n%s" %
+                     (' '.join(cmd), e.returncode, e.output))
+
+        self.install(complementary_pkgs.split(), attempt_only=True)
+
+    def deploy_dir_lock(self):
+        if self.deploy_dir is None:
+            raise RuntimeError("deploy_dir is not set!")
+
+        lock_file_name = os.path.join(self.deploy_dir, "deploy.lock")
+
+        self.deploy_lock = bb.utils.lockfile(lock_file_name)
+
+    def deploy_dir_unlock(self):
+        if self.deploy_lock is None:
+            return
+
+        bb.utils.unlockfile(self.deploy_lock)
+
+        self.deploy_lock = None
+
+
+class RpmPM(PackageManager):
+    def __init__(self,
+                 d,
+                 target_rootfs,
+                 target_vendor,
+                 task_name='target',
+                 providename=None,
+                 arch_var=None,
+                 os_var=None):
+        super(RpmPM, self).__init__(d)
+        self.target_rootfs = target_rootfs
+        self.target_vendor = target_vendor
+        self.task_name = task_name
+        self.providename = providename
+        self.fullpkglist = list()
+        self.deploy_dir = self.d.getVar('DEPLOY_DIR_RPM', True)
+        self.etcrpm_dir = os.path.join(self.target_rootfs, "etc/rpm")
+        self.install_dir_name = "oe_install"
+        self.install_dir_path = os.path.join(self.target_rootfs, self.install_dir_name)
+        self.rpm_cmd = bb.utils.which(os.getenv('PATH'), "rpm")
+        self.smart_cmd = bb.utils.which(os.getenv('PATH'), "smart")
+        self.smart_opt = "--log-level=warning --data-dir=" + os.path.join(target_rootfs,
+                                                      'var/lib/smart')
+        self.scriptlet_wrapper = self.d.expand('${WORKDIR}/scriptlet_wrapper')
+        self.solution_manifest = self.d.expand('${T}/saved/%s_solution' %
+                                               self.task_name)
+        self.saved_rpmlib = self.d.expand('${T}/saved/%s' % self.task_name)
+        self.image_rpmlib = os.path.join(self.target_rootfs, 'var/lib/rpm')
+
+        if not os.path.exists(self.d.expand('${T}/saved')):
+            bb.utils.mkdirhier(self.d.expand('${T}/saved'))
+
+        self.indexer = RpmIndexer(self.d, self.deploy_dir)
+        self.pkgs_list = RpmPkgsList(self.d, self.target_rootfs, arch_var, os_var)
+        self.rpm_version = self.pkgs_list.rpm_version
+
+        self.ml_prefix_list, self.ml_os_list = self.indexer.get_ml_prefix_and_os_list(arch_var, os_var)
+
+    def insert_feeds_uris(self):
+        if self.feed_uris == "":
+            return
+
+        # List must be prefered to least preferred order
+        default_platform_extra = set()
+        platform_extra = set()
+        bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or ""
+        for mlib in self.ml_os_list:
+            for arch in self.ml_prefix_list[mlib]:
+                plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib]
+                if mlib == bbextendvariant:
+                        default_platform_extra.add(plt)
+                else:
+                        platform_extra.add(plt)
+
+        platform_extra = platform_extra.union(default_platform_extra)
+
+        arch_list = []
+        for canonical_arch in platform_extra:
+            arch = canonical_arch.split('-')[0]
+            if not os.path.exists(os.path.join(self.deploy_dir, arch)):
+                continue
+            arch_list.append(arch)
+
+        uri_iterator = 0
+        channel_priority = 10 + 5 * len(self.feed_uris.split()) * len(arch_list)
+
+        for uri in self.feed_uris.split():
+            full_uri = uri
+            if self.feed_prefix:
+                full_uri = os.path.join(uri, self.feed_prefix)
+            for arch in arch_list:
+                bb.note('Note: adding Smart channel url%d%s (%s)' %
+                        (uri_iterator, arch, channel_priority))
+                self._invoke_smart('channel --add url%d-%s type=rpm-md baseurl=%s/%s -y'
+                                   % (uri_iterator, arch, full_uri, arch))
+                self._invoke_smart('channel --set url%d-%s priority=%d' %
+                                   (uri_iterator, arch, channel_priority))
+                channel_priority -= 5
+            uri_iterator += 1
+
+    '''
+    Create configs for rpm and smart, and multilib is supported
+    '''
+    def create_configs(self):
+        target_arch = self.d.getVar('TARGET_ARCH', True)
+        platform = '%s%s-%s' % (target_arch.replace('-', '_'),
+                                self.target_vendor,
+                                self.ml_os_list['default'])
+
+        # List must be prefered to least preferred order
+        default_platform_extra = list()
+        platform_extra = list()
+        bbextendvariant = self.d.getVar('BBEXTENDVARIANT', True) or ""
+        for mlib in self.ml_os_list:
+            for arch in self.ml_prefix_list[mlib]:
+                plt = arch.replace('-', '_') + '-.*-' + self.ml_os_list[mlib]
+                if mlib == bbextendvariant:
+                    if plt not in default_platform_extra:
+                        default_platform_extra.append(plt)
+                else:
+                    if plt not in platform_extra:
+                        platform_extra.append(plt)
+        platform_extra = default_platform_extra + platform_extra
+
+        self._create_configs(platform, platform_extra)
+
+    def _invoke_smart(self, args):
+        cmd = "%s %s %s" % (self.smart_cmd, self.smart_opt, args)
+        # bb.note(cmd)
+        try:
+            complementary_pkgs = subprocess.check_output(cmd,
+                                                         stderr=subprocess.STDOUT,
+                                                         shell=True)
+            # bb.note(complementary_pkgs)
+            return complementary_pkgs
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Could not invoke smart. Command "
+                     "'%s' returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+    def _search_pkg_name_in_feeds(self, pkg, feed_archs):
+        for arch in feed_archs:
+            arch = arch.replace('-', '_')
+            regex_match = re.compile(r"^%s-[^-]*-[^-]*@%s$" % \
+                (re.escape(pkg), re.escape(arch)))
+            for p in self.fullpkglist:
+                if regex_match.match(p) is not None:
+                    # First found is best match
+                    # bb.note('%s -> %s' % (pkg, pkg + '@' + arch))
+                    return pkg + '@' + arch
+
+        # Search provides if not found by pkgname.
+        bb.note('Not found %s by name, searching provides ...' % pkg)
+        cmd = "%s %s query --provides %s --show-format='$name-$version'" % \
+                (self.smart_cmd, self.smart_opt, pkg)
+        cmd += " | sed -ne 's/ *Provides://p'"
+        bb.note('cmd: %s' % cmd)
+        output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+        # Found a provider
+        if output:
+            bb.note('Found providers for %s: %s' % (pkg, output))
+            for p in output.split():
+                for arch in feed_archs:
+                    arch = arch.replace('-', '_')
+                    if p.rstrip().endswith('@' + arch):
+                        return p
+
+        return ""
+
+    '''
+    Translate the OE multilib format names to the RPM/Smart format names
+    It searched the RPM/Smart format names in probable multilib feeds first,
+    and then searched the default base feed.
+    '''
+    def _pkg_translate_oe_to_smart(self, pkgs, attempt_only=False):
+        new_pkgs = list()
+
+        for pkg in pkgs:
+            new_pkg = pkg
+            # Search new_pkg in probable multilibs first
+            for mlib in self.ml_prefix_list:
+                # Jump the default archs
+                if mlib == 'default':
+                    continue
+
+                subst = pkg.replace(mlib + '-', '')
+                # if the pkg in this multilib feed
+                if subst != pkg:
+                    feed_archs = self.ml_prefix_list[mlib]
+                    new_pkg = self._search_pkg_name_in_feeds(subst, feed_archs)
+                    if not new_pkg:
+                        # Failed to translate, package not found!
+                        err_msg = '%s not found in the %s feeds (%s).\n' % \
+                                  (pkg, mlib, " ".join(feed_archs))
+                        if not attempt_only:
+                            err_msg += " ".join(self.fullpkglist)
+                            bb.fatal(err_msg)
+                        bb.warn(err_msg)
+                    else:
+                        new_pkgs.append(new_pkg)
+
+                    break
+
+            # Apparently not a multilib package...
+            if pkg == new_pkg:
+                # Search new_pkg in default archs
+                default_archs = self.ml_prefix_list['default']
+                new_pkg = self._search_pkg_name_in_feeds(pkg, default_archs)
+                if not new_pkg:
+                    err_msg = '%s not found in the base feeds (%s).\n' % \
+                              (pkg, ' '.join(default_archs))
+                    if not attempt_only:
+                        err_msg += " ".join(self.fullpkglist)
+                        bb.fatal(err_msg)
+                    bb.warn(err_msg)
+                else:
+                    new_pkgs.append(new_pkg)
+
+        return new_pkgs
+
+    def _create_configs(self, platform, platform_extra):
+        # Setup base system configuration
+        bb.note("configuring RPM platform settings")
+
+        # Configure internal RPM environment when using Smart
+        os.environ['RPM_ETCRPM'] = self.etcrpm_dir
+        bb.utils.mkdirhier(self.etcrpm_dir)
+
+        # Setup temporary directory -- install...
+        if os.path.exists(self.install_dir_path):
+            bb.utils.remove(self.install_dir_path, True)
+        bb.utils.mkdirhier(os.path.join(self.install_dir_path, 'tmp'))
+
+        channel_priority = 5
+        platform_dir = os.path.join(self.etcrpm_dir, "platform")
+        sdkos = self.d.getVar("SDK_OS", True)
+        with open(platform_dir, "w+") as platform_fd:
+            platform_fd.write(platform + '\n')
+            for pt in platform_extra:
+                channel_priority += 5
+                if sdkos:
+                    tmp = re.sub("-%s$" % sdkos, "-%s\n" % sdkos, pt)
+                tmp = re.sub("-linux.*$", "-linux.*\n", tmp)
+                platform_fd.write(tmp)
+
+        # Tell RPM that the "/" directory exist and is available
+        bb.note("configuring RPM system provides")
+        sysinfo_dir = os.path.join(self.etcrpm_dir, "sysinfo")
+        bb.utils.mkdirhier(sysinfo_dir)
+        with open(os.path.join(sysinfo_dir, "Dirnames"), "w+") as dirnames:
+            dirnames.write("/\n")
+
+        if self.providename:
+            providename_dir = os.path.join(sysinfo_dir, "Providename")
+            if not os.path.exists(providename_dir):
+                providename_content = '\n'.join(self.providename)
+                providename_content += '\n'
+                open(providename_dir, "w+").write(providename_content)
+
+        # Configure RPM... we enforce these settings!
+        bb.note("configuring RPM DB settings")
+        # After change the __db.* cache size, log file will not be
+        # generated automatically, that will raise some warnings,
+        # so touch a bare log for rpm write into it.
+        if self.rpm_version == 5:
+            rpmlib_log = os.path.join(self.image_rpmlib, 'log', 'log.0000000001')
+            if not os.path.exists(rpmlib_log):
+                bb.utils.mkdirhier(os.path.join(self.image_rpmlib, 'log'))
+                open(rpmlib_log, 'w+').close()
+
+            DB_CONFIG_CONTENT = "# ================ Environment\n" \
+                "set_data_dir .\n" \
+                "set_create_dir .\n" \
+                "set_lg_dir ./log\n" \
+                "set_tmp_dir ./tmp\n" \
+                "set_flags db_log_autoremove on\n" \
+                "\n" \
+                "# -- thread_count must be >= 8\n" \
+                "set_thread_count 64\n" \
+                "\n" \
+                "# ================ Logging\n" \
+                "\n" \
+                "# ================ Memory Pool\n" \
+                "set_cachesize 0 1048576 0\n" \
+                "set_mp_mmapsize 268435456\n" \
+                "\n" \
+                "# ================ Locking\n" \
+                "set_lk_max_locks 16384\n" \
+                "set_lk_max_lockers 16384\n" \
+                "set_lk_max_objects 16384\n" \
+                "mutex_set_max 163840\n" \
+                "\n" \
+                "# ================ Replication\n"
+
+            db_config_dir = os.path.join(self.image_rpmlib, 'DB_CONFIG')
+            if not os.path.exists(db_config_dir):
+                open(db_config_dir, 'w+').write(DB_CONFIG_CONTENT)
+
+        # Create database so that smart doesn't complain (lazy init)
+        opt = "-qa"
+        if self.rpm_version == 4:
+            opt = "--initdb"
+        cmd = "%s --root %s --dbpath /var/lib/rpm %s > /dev/null" % (
+              self.rpm_cmd, self.target_rootfs, opt)
+        try:
+            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Create rpm database failed. Command '%s' "
+                     "returned %d:\n%s" % (cmd, e.returncode, e.output))
+        # Import GPG key to RPM database of the target system
+        if self.d.getVar('RPM_SIGN_PACKAGES', True) == '1':
+            pubkey_path = self.d.getVar('RPM_GPG_PUBKEY', True)
+            cmd = "%s --root %s --dbpath /var/lib/rpm --import %s > /dev/null" % (
+                  self.rpm_cmd, self.target_rootfs, pubkey_path)
+            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+
+        # Configure smart
+        bb.note("configuring Smart settings")
+        bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
+                        True)
+        self._invoke_smart('config --set rpm-root=%s' % self.target_rootfs)
+        self._invoke_smart('config --set rpm-dbpath=/var/lib/rpm')
+        self._invoke_smart('config --set rpm-extra-macros._var=%s' %
+                           self.d.getVar('localstatedir', True))
+        cmd = "config --set rpm-extra-macros._tmppath=/%s/tmp" % (self.install_dir_name)
+
+        prefer_color = self.d.getVar('RPM_PREFER_ELF_ARCH', True)
+        if prefer_color:
+            if prefer_color not in ['0', '1', '2', '4']:
+                bb.fatal("Invalid RPM_PREFER_ELF_ARCH: %s, it should be one of:\n"
+                        "\t1: ELF32 wins\n"
+                        "\t2: ELF64 wins\n"
+                        "\t4: ELF64 N32 wins (mips64 or mips64el only)" %
+                        prefer_color)
+            if prefer_color == "4" and self.d.getVar("TUNE_ARCH", True) not in \
+                                    ['mips64', 'mips64el']:
+                bb.fatal("RPM_PREFER_ELF_ARCH = \"4\" is for mips64 or mips64el "
+                         "only.")
+            self._invoke_smart('config --set rpm-extra-macros._prefer_color=%s'
+                        % prefer_color)
+
+        self._invoke_smart(cmd)
+        self._invoke_smart('config --set rpm-ignoresize=1')
+
+        # Write common configuration for host and target usage
+        self._invoke_smart('config --set rpm-nolinktos=1')
+        self._invoke_smart('config --set rpm-noparentdirs=1')
+        check_signature = self.d.getVar('RPM_CHECK_SIGNATURES', True)
+        if check_signature and check_signature.strip() == "0":
+            self._invoke_smart('config --set rpm-check-signatures=false')
+        for i in self.d.getVar('BAD_RECOMMENDATIONS', True).split():
+            self._invoke_smart('flag --set ignore-recommends %s' % i)
+
+        # Do the following configurations here, to avoid them being
+        # saved for field upgrade
+        if self.d.getVar('NO_RECOMMENDATIONS', True).strip() == "1":
+            self._invoke_smart('config --set ignore-all-recommends=1')
+        pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE', True) or ""
+        for i in pkg_exclude.split():
+            self._invoke_smart('flag --set exclude-packages %s' % i)
+
+        # Optional debugging
+        # self._invoke_smart('config --set rpm-log-level=debug')
+        # cmd = 'config --set rpm-log-file=/tmp/smart-debug-logfile'
+        # self._invoke_smart(cmd)
+        ch_already_added = []
+        for canonical_arch in platform_extra:
+            arch = canonical_arch.split('-')[0]
+            arch_channel = os.path.join(self.deploy_dir, arch)
+            if os.path.exists(arch_channel) and not arch in ch_already_added:
+                bb.note('Note: adding Smart channel %s (%s)' %
+                        (arch, channel_priority))
+                self._invoke_smart('channel --add %s type=rpm-md baseurl=%s -y'
+                                   % (arch, arch_channel))
+                self._invoke_smart('channel --set %s priority=%d' %
+                                   (arch, channel_priority))
+                channel_priority -= 5
+
+                ch_already_added.append(arch)
+
+        bb.note('adding Smart RPM DB channel')
+        self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
+
+        # Construct install scriptlet wrapper.
+        # Scripts need to be ordered when executed, this ensures numeric order.
+        # If we ever run into needing more the 899 scripts, we'll have to.
+        # change num to start with 1000.
+        #
+        if self.rpm_version == 4:
+            scriptletcmd = "$2 $3 $4\n"
+            scriptpath = "$3"
+        else:
+            scriptletcmd = "$2 $1/$3 $4\n"
+            scriptpath = "$1/$3"
+
+        SCRIPTLET_FORMAT = "#!/bin/bash\n" \
+            "\n" \
+            "export PATH=%s\n" \
+            "export D=%s\n" \
+            'export OFFLINE_ROOT="$D"\n' \
+            'export IPKG_OFFLINE_ROOT="$D"\n' \
+            'export OPKG_OFFLINE_ROOT="$D"\n' \
+            "export INTERCEPT_DIR=%s\n" \
+            "export NATIVE_ROOT=%s\n" \
+            "\n" \
+            + scriptletcmd + \
+            "if [ $? -ne 0 ]; then\n" \
+            "  if [ $4 -eq 1 ]; then\n" \
+            "    mkdir -p $1/etc/rpm-postinsts\n" \
+            "    num=100\n" \
+            "    while [ -e $1/etc/rpm-postinsts/${num}-* ]; do num=$((num + 1)); done\n" \
+            "    name=`head -1 " + scriptpath + " | cut -d\' \' -f 2`\n" \
+            '    echo "#!$2" > $1/etc/rpm-postinsts/${num}-${name}\n' \
+            '    echo "# Arg: $4" >> $1/etc/rpm-postinsts/${num}-${name}\n' \
+            "    cat " + scriptpath + " >> $1/etc/rpm-postinsts/${num}-${name}\n" \
+            "    chmod +x $1/etc/rpm-postinsts/${num}-${name}\n" \
+            "  else\n" \
+            '    echo "Error: pre/post remove scriptlet failed"\n' \
+            "  fi\n" \
+            "fi\n"
+
+        intercept_dir = self.d.expand('${WORKDIR}/intercept_scripts')
+        native_root = self.d.getVar('STAGING_DIR_NATIVE', True)
+        scriptlet_content = SCRIPTLET_FORMAT % (os.environ['PATH'],
+                                                self.target_rootfs,
+                                                intercept_dir,
+                                                native_root)
+        open(self.scriptlet_wrapper, 'w+').write(scriptlet_content)
+
+        bb.note("Note: configuring RPM cross-install scriptlet_wrapper")
+        os.chmod(self.scriptlet_wrapper, 0755)
+        cmd = 'config --set rpm-extra-macros._cross_scriptlet_wrapper=%s' % \
+              self.scriptlet_wrapper
+        self._invoke_smart(cmd)
+
+        # Debug to show smart config info
+        # bb.note(self._invoke_smart('config --show'))
+
+    def update(self):
+        self._invoke_smart('update rpmsys')
+
+    '''
+    Install pkgs with smart, the pkg name is oe format
+    '''
+    def install(self, pkgs, attempt_only=False):
+
+        if not pkgs:
+            bb.note("There are no packages to install")
+            return
+        bb.note("Installing the following packages: %s" % ' '.join(pkgs))
+        pkgs = self._pkg_translate_oe_to_smart(pkgs, attempt_only)
+
+        if not attempt_only:
+            bb.note('to be installed: %s' % ' '.join(pkgs))
+            cmd = "%s %s install -y %s" % \
+                  (self.smart_cmd, self.smart_opt, ' '.join(pkgs))
+            bb.note(cmd)
+        else:
+            bb.note('installing attempt only packages...')
+            bb.note('Attempting %s' % ' '.join(pkgs))
+            cmd = "%s %s install --attempt -y %s" % \
+                  (self.smart_cmd, self.smart_opt, ' '.join(pkgs))
+        try:
+            output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+            bb.note(output)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Unable to install packages. Command '%s' "
+                     "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+    '''
+    Remove pkgs with smart, the pkg name is smart/rpm format
+    '''
+    def remove(self, pkgs, with_dependencies=True):
+        bb.note('to be removed: ' + ' '.join(pkgs))
+
+        if not with_dependencies:
+            cmd = "%s -e --nodeps " % self.rpm_cmd
+            cmd += "--root=%s " % self.target_rootfs
+            cmd += "--dbpath=/var/lib/rpm "
+            cmd += "--define='_cross_scriptlet_wrapper %s' " % \
+                   self.scriptlet_wrapper
+            cmd += "--define='_tmppath /%s/tmp' %s" % (self.install_dir_name, ' '.join(pkgs))
+        else:
+            # for pkg in pkgs:
+            #   bb.note('Debug: What required: %s' % pkg)
+            #   bb.note(self._invoke_smart('query %s --show-requiredby' % pkg))
+
+            cmd = "%s %s remove -y %s" % (self.smart_cmd,
+                                          self.smart_opt,
+                                          ' '.join(pkgs))
+
+        try:
+            bb.note(cmd)
+            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+            bb.note(output)
+        except subprocess.CalledProcessError as e:
+            bb.note("Unable to remove packages. Command '%s' "
+                    "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+    def upgrade(self):
+        bb.note('smart upgrade')
+        self._invoke_smart('upgrade')
+
+    def write_index(self):
+        result = self.indexer.write_index()
+
+        if result is not None:
+            bb.fatal(result)
+
+    def remove_packaging_data(self):
+        bb.utils.remove(self.image_rpmlib, True)
+        bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
+                        True)
+        bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/opkg'), True)
+
+        # remove temp directory
+        bb.utils.remove(self.install_dir_path, True)
+
+    def backup_packaging_data(self):
+        # Save the rpmlib for increment rpm image generation
+        if os.path.exists(self.saved_rpmlib):
+            bb.utils.remove(self.saved_rpmlib, True)
+        shutil.copytree(self.image_rpmlib,
+                        self.saved_rpmlib,
+                        symlinks=True)
+
+    def recovery_packaging_data(self):
+        # Move the rpmlib back
+        if os.path.exists(self.saved_rpmlib):
+            if os.path.exists(self.image_rpmlib):
+                bb.utils.remove(self.image_rpmlib, True)
+
+            bb.note('Recovery packaging data')
+            shutil.copytree(self.saved_rpmlib,
+                            self.image_rpmlib,
+                            symlinks=True)
+
+    def list_installed(self, format=None):
+        return self.pkgs_list.list(format)
+
+    '''
+    If incremental install, we need to determine what we've got,
+    what we need to add, and what to remove...
+    The dump_install_solution will dump and save the new install
+    solution.
+    '''
+    def dump_install_solution(self, pkgs):
+        bb.note('creating new install solution for incremental install')
+        if len(pkgs) == 0:
+            return
+
+        pkgs = self._pkg_translate_oe_to_smart(pkgs, False)
+        install_pkgs = list()
+
+        cmd = "%s %s install -y --dump %s 2>%s" %  \
+              (self.smart_cmd,
+               self.smart_opt,
+               ' '.join(pkgs),
+               self.solution_manifest)
+        try:
+            # Disable rpmsys channel for the fake install
+            self._invoke_smart('channel --disable rpmsys')
+
+            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+            with open(self.solution_manifest, 'r') as manifest:
+                for pkg in manifest.read().split('\n'):
+                    if '@' in pkg:
+                        install_pkgs.append(pkg)
+        except subprocess.CalledProcessError as e:
+            bb.note("Unable to dump install packages. Command '%s' "
+                    "returned %d:\n%s" % (cmd, e.returncode, e.output))
+        # Recovery rpmsys channel
+        self._invoke_smart('channel --enable rpmsys')
+        return install_pkgs
+
+    '''
+    If incremental install, we need to determine what we've got,
+    what we need to add, and what to remove...
+    The load_old_install_solution will load the previous install
+    solution
+    '''
+    def load_old_install_solution(self):
+        bb.note('load old install solution for incremental install')
+        installed_pkgs = list()
+        if not os.path.exists(self.solution_manifest):
+            bb.note('old install solution not exist')
+            return installed_pkgs
+
+        with open(self.solution_manifest, 'r') as manifest:
+            for pkg in manifest.read().split('\n'):
+                if '@' in pkg:
+                    installed_pkgs.append(pkg.strip())
+
+        return installed_pkgs
+
+    '''
+    Dump all available packages in feeds, it should be invoked after the
+    newest rpm index was created
+    '''
+    def dump_all_available_pkgs(self):
+        available_manifest = self.d.expand('${T}/saved/available_pkgs.txt')
+        available_pkgs = list()
+        cmd = "%s %s query --output %s" %  \
+              (self.smart_cmd, self.smart_opt, available_manifest)
+        try:
+            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+            with open(available_manifest, 'r') as manifest:
+                for pkg in manifest.read().split('\n'):
+                    if '@' in pkg:
+                        available_pkgs.append(pkg.strip())
+        except subprocess.CalledProcessError as e:
+            bb.note("Unable to list all available packages. Command '%s' "
+                    "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+        self.fullpkglist = available_pkgs
+
+        return
+
+    def save_rpmpostinst(self, pkg):
+        mlibs = (self.d.getVar('MULTILIB_GLOBAL_VARIANTS', False) or "").split()
+
+        new_pkg = pkg
+        # Remove any multilib prefix from the package name
+        for mlib in mlibs:
+            if mlib in pkg:
+                new_pkg = pkg.replace(mlib + '-', '')
+                break
+
+        bb.note('  * postponing %s' % new_pkg)
+        saved_dir = self.target_rootfs + self.d.expand('${sysconfdir}/rpm-postinsts/') + new_pkg
+
+        cmd = self.rpm_cmd + ' -q --scripts --root ' + self.target_rootfs
+        cmd += ' --dbpath=/var/lib/rpm ' + new_pkg
+        cmd += ' | sed -n -e "/^postinstall scriptlet (using .*):$/,/^.* scriptlet (using .*):$/ {/.*/p}"'
+        cmd += ' | sed -e "/postinstall scriptlet (using \(.*\)):$/d"'
+        cmd += ' -e "/^.* scriptlet (using .*):$/d" > %s' % saved_dir
+
+        try:
+            bb.note(cmd)
+            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True).strip()
+            bb.note(output)
+            os.chmod(saved_dir, 0755)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Invoke save_rpmpostinst failed. Command '%s' "
+                     "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+    '''Write common configuration for target usage'''
+    def rpm_setup_smart_target_config(self):
+        bb.utils.remove(os.path.join(self.target_rootfs, 'var/lib/smart'),
+                        True)
+
+        self._invoke_smart('config --set rpm-nolinktos=1')
+        self._invoke_smart('config --set rpm-noparentdirs=1')
+        for i in self.d.getVar('BAD_RECOMMENDATIONS', True).split():
+            self._invoke_smart('flag --set ignore-recommends %s' % i)
+        self._invoke_smart('channel --add rpmsys type=rpm-sys -y')
+
+    '''
+    The rpm db lock files were produced after invoking rpm to query on
+    build system, and they caused the rpm on target didn't work, so we
+    need to unlock the rpm db by removing the lock files.
+    '''
+    def unlock_rpm_db(self):
+        # Remove rpm db lock files
+        rpm_db_locks = glob.glob('%s/var/lib/rpm/__db.*' % self.target_rootfs)
+        for f in rpm_db_locks:
+            bb.utils.remove(f, True)
+
+
+class OpkgPM(PackageManager):
+    def __init__(self, d, target_rootfs, config_file, archs, task_name='target'):
+        super(OpkgPM, self).__init__(d)
+
+        self.target_rootfs = target_rootfs
+        self.config_file = config_file
+        self.pkg_archs = archs
+        self.task_name = task_name
+
+        self.deploy_dir = self.d.getVar("DEPLOY_DIR_IPK", True)
+        self.deploy_lock_file = os.path.join(self.deploy_dir, "deploy.lock")
+        self.opkg_cmd = bb.utils.which(os.getenv('PATH'), "opkg")
+        self.opkg_args = "--volatile-cache -f %s -o %s " % (self.config_file, target_rootfs)
+        self.opkg_args += self.d.getVar("OPKG_ARGS", True)
+
+        opkg_lib_dir = self.d.getVar('OPKGLIBDIR', True)
+        if opkg_lib_dir[0] == "/":
+            opkg_lib_dir = opkg_lib_dir[1:]
+
+        self.opkg_dir = os.path.join(target_rootfs, opkg_lib_dir, "opkg")
+
+        bb.utils.mkdirhier(self.opkg_dir)
+
+        self.saved_opkg_dir = self.d.expand('${T}/saved/%s' % self.task_name)
+        if not os.path.exists(self.d.expand('${T}/saved')):
+            bb.utils.mkdirhier(self.d.expand('${T}/saved'))
+
+        if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1":
+            self._create_config()
+        else:
+            self._create_custom_config()
+
+        self.indexer = OpkgIndexer(self.d, self.deploy_dir)
+
+    """
+    This function will change a package's status in /var/lib/opkg/status file.
+    If 'packages' is None then the new_status will be applied to all
+    packages
+    """
+    def mark_packages(self, status_tag, packages=None):
+        status_file = os.path.join(self.opkg_dir, "status")
+
+        with open(status_file, "r") as sf:
+            with open(status_file + ".tmp", "w+") as tmp_sf:
+                if packages is None:
+                    tmp_sf.write(re.sub(r"Package: (.*?)\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)",
+                                        r"Package: \1\n\2Status: \3%s" % status_tag,
+                                        sf.read()))
+                else:
+                    if type(packages).__name__ != "list":
+                        raise TypeError("'packages' should be a list object")
+
+                    status = sf.read()
+                    for pkg in packages:
+                        status = re.sub(r"Package: %s\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)" % pkg,
+                                        r"Package: %s\n\1Status: \2%s" % (pkg, status_tag),
+                                        status)
+
+                    tmp_sf.write(status)
+
+        os.rename(status_file + ".tmp", status_file)
+
+    def _create_custom_config(self):
+        bb.note("Building from feeds activated!")
+
+        with open(self.config_file, "w+") as config_file:
+            priority = 1
+            for arch in self.pkg_archs.split():
+                config_file.write("arch %s %d\n" % (arch, priority))
+                priority += 5
+
+            for line in (self.d.getVar('IPK_FEED_URIS', True) or "").split():
+                feed_match = re.match("^[ \t]*(.*)##([^ \t]*)[ \t]*$", line)
+
+                if feed_match is not None:
+                    feed_name = feed_match.group(1)
+                    feed_uri = feed_match.group(2)
+
+                    bb.note("Add %s feed with URL %s" % (feed_name, feed_uri))
+
+                    config_file.write("src/gz %s %s\n" % (feed_name, feed_uri))
+
+            """
+            Allow to use package deploy directory contents as quick devel-testing
+            feed. This creates individual feed configs for each arch subdir of those
+            specified as compatible for the current machine.
+            NOTE: Development-helper feature, NOT a full-fledged feed.
+            """
+            if (self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True) or "") != "":
+                for arch in self.pkg_archs.split():
+                    cfg_file_name = os.path.join(self.target_rootfs,
+                                                 self.d.getVar("sysconfdir", True),
+                                                 "opkg",
+                                                 "local-%s-feed.conf" % arch)
+
+                    with open(cfg_file_name, "w+") as cfg_file:
+                        cfg_file.write("src/gz local-%s %s/%s" %
+                                       (arch,
+                                        self.d.getVar('FEED_DEPLOYDIR_BASE_URI', True),
+                                        arch))
+
+    def _create_config(self):
+        with open(self.config_file, "w+") as config_file:
+            priority = 1
+            for arch in self.pkg_archs.split():
+                config_file.write("arch %s %d\n" % (arch, priority))
+                priority += 5
+
+            config_file.write("src oe file:%s\n" % self.deploy_dir)
+
+            for arch in self.pkg_archs.split():
+                pkgs_dir = os.path.join(self.deploy_dir, arch)
+                if os.path.isdir(pkgs_dir):
+                    config_file.write("src oe-%s file:%s\n" %
+                                      (arch, pkgs_dir))
+
+    def insert_feeds_uris(self):
+        if self.feed_uris == "":
+            return
+
+        rootfs_config = os.path.join('%s/etc/opkg/base-feeds.conf'
+                                  % self.target_rootfs)
+
+        with open(rootfs_config, "w+") as config_file:
+            uri_iterator = 0
+            for uri in self.feed_uris.split():
+                full_uri = uri
+                if self.feed_prefix:
+                    full_uri = os.path.join(uri, self.feed_prefix)
+
+                for arch in self.pkg_archs.split():
+                    if not os.path.exists(os.path.join(self.deploy_dir, arch)):
+                        continue
+                    bb.note('Note: adding opkg feed url-%s-%d (%s)' %
+                        (arch, uri_iterator, full_uri))
+
+                    config_file.write("src/gz uri-%s-%d %s/%s\n" %
+                                      (arch, uri_iterator, full_uri, arch))
+                uri_iterator += 1
+
+    def update(self):
+        self.deploy_dir_lock()
+
+        cmd = "%s %s update" % (self.opkg_cmd, self.opkg_args)
+
+        try:
+            subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+        except subprocess.CalledProcessError as e:
+            self.deploy_dir_unlock()
+            bb.fatal("Unable to update the package index files. Command '%s' "
+                     "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+        self.deploy_dir_unlock()
+
+    def install(self, pkgs, attempt_only=False):
+        if attempt_only and len(pkgs) == 0:
+            return
+
+        cmd = "%s %s install %s" % (self.opkg_cmd, self.opkg_args, ' '.join(pkgs))
+
+        os.environ['D'] = self.target_rootfs
+        os.environ['OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR', True),
+                                                   "intercept_scripts")
+        os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE', True)
+
+        try:
+            bb.note("Installing the following packages: %s" % ' '.join(pkgs))
+            bb.note(cmd)
+            output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+            bb.note(output)
+        except subprocess.CalledProcessError as e:
+            (bb.fatal, bb.note)[attempt_only]("Unable to install packages. "
+                                              "Command '%s' returned %d:\n%s" %
+                                              (cmd, e.returncode, e.output))
+
+    def remove(self, pkgs, with_dependencies=True):
+        if with_dependencies:
+            cmd = "%s %s --force-depends --force-remove --force-removal-of-dependent-packages remove %s" % \
+                (self.opkg_cmd, self.opkg_args, ' '.join(pkgs))
+        else:
+            cmd = "%s %s --force-depends remove %s" % \
+                (self.opkg_cmd, self.opkg_args, ' '.join(pkgs))
+
+        try:
+            bb.note(cmd)
+            output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+            bb.note(output)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Unable to remove packages. Command '%s' "
+                     "returned %d:\n%s" % (e.cmd, e.returncode, e.output))
+
+    def write_index(self):
+        self.deploy_dir_lock()
+
+        result = self.indexer.write_index()
+
+        self.deploy_dir_unlock()
+
+        if result is not None:
+            bb.fatal(result)
+
+    def remove_packaging_data(self):
+        bb.utils.remove(self.opkg_dir, True)
+        # create the directory back, it's needed by PM lock
+        bb.utils.mkdirhier(self.opkg_dir)
+
+    def list_installed(self, format=None):
+        return OpkgPkgsList(self.d, self.target_rootfs, self.config_file).list(format)
+
+    def handle_bad_recommendations(self):
+        bad_recommendations = self.d.getVar("BAD_RECOMMENDATIONS", True) or ""
+        if bad_recommendations.strip() == "":
+            return
+
+        status_file = os.path.join(self.opkg_dir, "status")
+
+        # If status file existed, it means the bad recommendations has already
+        # been handled
+        if os.path.exists(status_file):
+            return
+
+        cmd = "%s %s info " % (self.opkg_cmd, self.opkg_args)
+
+        with open(status_file, "w+") as status:
+            for pkg in bad_recommendations.split():
+                pkg_info = cmd + pkg
+
+                try:
+                    output = subprocess.check_output(pkg_info.split(), stderr=subprocess.STDOUT).strip()
+                except subprocess.CalledProcessError as e:
+                    bb.fatal("Cannot get package info. Command '%s' "
+                             "returned %d:\n%s" % (pkg_info, e.returncode, e.output))
+
+                if output == "":
+                    bb.note("Ignored bad recommendation: '%s' is "
+                            "not a package" % pkg)
+                    continue
+
+                for line in output.split('\n'):
+                    if line.startswith("Status:"):
+                        status.write("Status: deinstall hold not-installed\n")
+                    else:
+                        status.write(line + "\n")
+
+                # Append a blank line after each package entry to ensure that it
+                # is separated from the following entry
+                status.write("\n")
+
+    '''
+    The following function dummy installs pkgs and returns the log of output.
+    '''
+    def dummy_install(self, pkgs):
+        if len(pkgs) == 0:
+            return
+
+        # Create an temp dir as opkg root for dummy installation
+        temp_rootfs = self.d.expand('${T}/opkg')
+        temp_opkg_dir = os.path.join(temp_rootfs, 'var/lib/opkg')
+        bb.utils.mkdirhier(temp_opkg_dir)
+
+        opkg_args = "-f %s -o %s " % (self.config_file, temp_rootfs)
+        opkg_args += self.d.getVar("OPKG_ARGS", True)
+
+        cmd = "%s %s update" % (self.opkg_cmd, opkg_args)
+        try:
+            subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Unable to update. Command '%s' "
+                     "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+        # Dummy installation
+        cmd = "%s %s --noaction install %s " % (self.opkg_cmd,
+                                                opkg_args,
+                                                ' '.join(pkgs))
+        try:
+            output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Unable to dummy install packages. Command '%s' "
+                     "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+        bb.utils.remove(temp_rootfs, True)
+
+        return output
+
+    def backup_packaging_data(self):
+        # Save the opkglib for increment ipk image generation
+        if os.path.exists(self.saved_opkg_dir):
+            bb.utils.remove(self.saved_opkg_dir, True)
+        shutil.copytree(self.opkg_dir,
+                        self.saved_opkg_dir,
+                        symlinks=True)
+
+    def recover_packaging_data(self):
+        # Move the opkglib back
+        if os.path.exists(self.saved_opkg_dir):
+            if os.path.exists(self.opkg_dir):
+                bb.utils.remove(self.opkg_dir, True)
+
+            bb.note('Recover packaging data')
+            shutil.copytree(self.saved_opkg_dir,
+                            self.opkg_dir,
+                            symlinks=True)
+
+
+class DpkgPM(PackageManager):
+    def __init__(self, d, target_rootfs, archs, base_archs, apt_conf_dir=None):
+        super(DpkgPM, self).__init__(d)
+        self.target_rootfs = target_rootfs
+        self.deploy_dir = self.d.getVar('DEPLOY_DIR_DEB', True)
+        if apt_conf_dir is None:
+            self.apt_conf_dir = self.d.expand("${APTCONF_TARGET}/apt")
+        else:
+            self.apt_conf_dir = apt_conf_dir
+        self.apt_conf_file = os.path.join(self.apt_conf_dir, "apt.conf")
+        self.apt_get_cmd = bb.utils.which(os.getenv('PATH'), "apt-get")
+
+        self.apt_args = d.getVar("APT_ARGS", True)
+
+        self.all_arch_list = archs.split()
+        all_mlb_pkg_arch_list = (self.d.getVar('ALL_MULTILIB_PACKAGE_ARCHS', True) or "").replace('-', '_').split()
+        self.all_arch_list.extend(arch for arch in all_mlb_pkg_arch_list if arch not in self.all_arch_list)
+
+        self._create_configs(archs, base_archs)
+
+        self.indexer = DpkgIndexer(self.d, self.deploy_dir)
+
+    """
+    This function will change a package's status in /var/lib/dpkg/status file.
+    If 'packages' is None then the new_status will be applied to all
+    packages
+    """
+    def mark_packages(self, status_tag, packages=None):
+        status_file = self.target_rootfs + "/var/lib/dpkg/status"
+
+        with open(status_file, "r") as sf:
+            with open(status_file + ".tmp", "w+") as tmp_sf:
+                if packages is None:
+                    tmp_sf.write(re.sub(r"Package: (.*?)\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)",
+                                        r"Package: \1\n\2Status: \3%s" % status_tag,
+                                        sf.read()))
+                else:
+                    if type(packages).__name__ != "list":
+                        raise TypeError("'packages' should be a list object")
+
+                    status = sf.read()
+                    for pkg in packages:
+                        status = re.sub(r"Package: %s\n((?:[^\n]+\n)*?)Status: (.*)(?:unpacked|installed)" % pkg,
+                                        r"Package: %s\n\1Status: \2%s" % (pkg, status_tag),
+                                        status)
+
+                    tmp_sf.write(status)
+
+        os.rename(status_file + ".tmp", status_file)
+
+    """
+    Run the pre/post installs for package "package_name". If package_name is
+    None, then run all pre/post install scriptlets.
+    """
+    def run_pre_post_installs(self, package_name=None):
+        info_dir = self.target_rootfs + "/var/lib/dpkg/info"
+        suffixes = [(".preinst", "Preinstall"), (".postinst", "Postinstall")]
+        status_file = self.target_rootfs + "/var/lib/dpkg/status"
+        installed_pkgs = []
+
+        with open(status_file, "r") as status:
+            for line in status.read().split('\n'):
+                m = re.match("^Package: (.*)", line)
+                if m is not None:
+                    installed_pkgs.append(m.group(1))
+
+        if package_name is not None and not package_name in installed_pkgs:
+            return
+
+        os.environ['D'] = self.target_rootfs
+        os.environ['OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['IPKG_OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['OPKG_OFFLINE_ROOT'] = self.target_rootfs
+        os.environ['INTERCEPT_DIR'] = os.path.join(self.d.getVar('WORKDIR', True),
+                                                   "intercept_scripts")
+        os.environ['NATIVE_ROOT'] = self.d.getVar('STAGING_DIR_NATIVE', True)
+
+        failed_pkgs = []
+        for pkg_name in installed_pkgs:
+            for suffix in suffixes:
+                p_full = os.path.join(info_dir, pkg_name + suffix[0])
+                if os.path.exists(p_full):
+                    try:
+                        bb.note("Executing %s for package: %s ..." %
+                                 (suffix[1].lower(), pkg_name))
+                        subprocess.check_output(p_full, stderr=subprocess.STDOUT)
+                    except subprocess.CalledProcessError as e:
+                        bb.note("%s for package %s failed with %d:\n%s" %
+                                (suffix[1], pkg_name, e.returncode, e.output))
+                        failed_pkgs.append(pkg_name)
+                        break
+
+        if len(failed_pkgs):
+            self.mark_packages("unpacked", failed_pkgs)
+
+    def update(self):
+        os.environ['APT_CONFIG'] = self.apt_conf_file
+
+        self.deploy_dir_lock()
+
+        cmd = "%s update" % self.apt_get_cmd
+
+        try:
+            subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Unable to update the package index files. Command '%s' "
+                     "returned %d:\n%s" % (e.cmd, e.returncode, e.output))
+
+        self.deploy_dir_unlock()
+
+    def install(self, pkgs, attempt_only=False):
+        if attempt_only and len(pkgs) == 0:
+            return
+
+        os.environ['APT_CONFIG'] = self.apt_conf_file
+
+        cmd = "%s %s install --force-yes --allow-unauthenticated %s" % \
+              (self.apt_get_cmd, self.apt_args, ' '.join(pkgs))
+
+        try:
+            bb.note("Installing the following packages: %s" % ' '.join(pkgs))
+            subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+        except subprocess.CalledProcessError as e:
+            (bb.fatal, bb.note)[attempt_only]("Unable to install packages. "
+                                              "Command '%s' returned %d:\n%s" %
+                                              (cmd, e.returncode, e.output))
+
+        # rename *.dpkg-new files/dirs
+        for root, dirs, files in os.walk(self.target_rootfs):
+            for dir in dirs:
+                new_dir = re.sub("\.dpkg-new", "", dir)
+                if dir != new_dir:
+                    os.rename(os.path.join(root, dir),
+                              os.path.join(root, new_dir))
+
+            for file in files:
+                new_file = re.sub("\.dpkg-new", "", file)
+                if file != new_file:
+                    os.rename(os.path.join(root, file),
+                              os.path.join(root, new_file))
+
+
+    def remove(self, pkgs, with_dependencies=True):
+        if with_dependencies:
+            os.environ['APT_CONFIG'] = self.apt_conf_file
+            cmd = "%s purge %s" % (self.apt_get_cmd, ' '.join(pkgs))
+        else:
+            cmd = "%s --admindir=%s/var/lib/dpkg --instdir=%s" \
+                  " -P --force-depends %s" % \
+                  (bb.utils.which(os.getenv('PATH'), "dpkg"),
+                   self.target_rootfs, self.target_rootfs, ' '.join(pkgs))
+
+        try:
+            subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Unable to remove packages. Command '%s' "
+                     "returned %d:\n%s" % (e.cmd, e.returncode, e.output))
+
+    def write_index(self):
+        self.deploy_dir_lock()
+
+        result = self.indexer.write_index()
+
+        self.deploy_dir_unlock()
+
+        if result is not None:
+            bb.fatal(result)
+
+    def insert_feeds_uris(self):
+        if self.feed_uris == "":
+            return
+
+        sources_conf = os.path.join("%s/etc/apt/sources.list"
+                                    % self.target_rootfs)
+        arch_list = []
+
+        for arch in self.all_arch_list:
+            if not os.path.exists(os.path.join(self.deploy_dir, arch)):
+                continue
+            arch_list.append(arch)
+
+        with open(sources_conf, "w+") as sources_file:
+            for uri in self.feed_uris.split():
+                full_uri = uri
+                if self.feed_prefix:
+                    full_uri = os.path.join(uri, self.feed_prefix)
+                for arch in arch_list:
+                    bb.note('Note: adding dpkg channel at (%s)' % uri)
+                    sources_file.write("deb %s/%s ./\n" %
+                                       (full_uri, arch))
+
+    def _create_configs(self, archs, base_archs):
+        base_archs = re.sub("_", "-", base_archs)
+
+        if os.path.exists(self.apt_conf_dir):
+            bb.utils.remove(self.apt_conf_dir, True)
+
+        bb.utils.mkdirhier(self.apt_conf_dir)
+        bb.utils.mkdirhier(self.apt_conf_dir + "/lists/partial/")
+        bb.utils.mkdirhier(self.apt_conf_dir + "/apt.conf.d/")
+
+        arch_list = []
+        for arch in self.all_arch_list:
+            if not os.path.exists(os.path.join(self.deploy_dir, arch)):
+                continue
+            arch_list.append(arch)
+
+        with open(os.path.join(self.apt_conf_dir, "preferences"), "w+") as prefs_file:
+            priority = 801
+            for arch in arch_list:
+                prefs_file.write(
+                    "Package: *\n"
+                    "Pin: release l=%s\n"
+                    "Pin-Priority: %d\n\n" % (arch, priority))
+
+                priority += 5
+
+            pkg_exclude = self.d.getVar('PACKAGE_EXCLUDE', True) or ""
+            for pkg in pkg_exclude.split():
+                prefs_file.write(
+                    "Package: %s\n"
+                    "Pin: release *\n"
+                    "Pin-Priority: -1\n\n" % pkg)
+
+        arch_list.reverse()
+
+        with open(os.path.join(self.apt_conf_dir, "sources.list"), "w+") as sources_file:
+            for arch in arch_list:
+                sources_file.write("deb file:%s/ ./\n" %
+                                   os.path.join(self.deploy_dir, arch))
+
+        base_arch_list = base_archs.split()
+        multilib_variants = self.d.getVar("MULTILIB_VARIANTS", True);
+        for variant in multilib_variants.split():
+            if variant == "lib32":
+                base_arch_list.append("i386")
+            elif variant == "lib64":
+                base_arch_list.append("amd64")
+
+        with open(self.apt_conf_file, "w+") as apt_conf:
+            with open(self.d.expand("${STAGING_ETCDIR_NATIVE}/apt/apt.conf.sample")) as apt_conf_sample:
+                for line in apt_conf_sample.read().split("\n"):
+                    match_arch = re.match("  Architecture \".*\";$", line)
+                    architectures = ""
+                    if match_arch:
+                        for base_arch in base_arch_list:
+                            architectures += "\"%s\";" % base_arch
+                        apt_conf.write("  Architectures {%s};\n" % architectures);
+                        apt_conf.write("  Architecture \"%s\";\n" % base_archs)
+                    else:
+                        line = re.sub("#ROOTFS#", self.target_rootfs, line)
+                        line = re.sub("#APTCONF#", self.apt_conf_dir, line)
+                        apt_conf.write(line + "\n")
+
+        target_dpkg_dir = "%s/var/lib/dpkg" % self.target_rootfs
+        bb.utils.mkdirhier(os.path.join(target_dpkg_dir, "info"))
+
+        bb.utils.mkdirhier(os.path.join(target_dpkg_dir, "updates"))
+
+        if not os.path.exists(os.path.join(target_dpkg_dir, "status")):
+            open(os.path.join(target_dpkg_dir, "status"), "w+").close()
+        if not os.path.exists(os.path.join(target_dpkg_dir, "available")):
+            open(os.path.join(target_dpkg_dir, "available"), "w+").close()
+
+    def remove_packaging_data(self):
+        bb.utils.remove(os.path.join(self.target_rootfs,
+                                     self.d.getVar('opkglibdir', True)), True)
+        bb.utils.remove(self.target_rootfs + "/var/lib/dpkg/", True)
+
+    def fix_broken_dependencies(self):
+        os.environ['APT_CONFIG'] = self.apt_conf_file
+
+        cmd = "%s %s -f install" % (self.apt_get_cmd, self.apt_args)
+
+        try:
+            subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Cannot fix broken dependencies. Command '%s' "
+                     "returned %d:\n%s" % (cmd, e.returncode, e.output))
+
+    def list_installed(self, format=None):
+        return DpkgPkgsList(self.d, self.target_rootfs).list()
+
+
+def generate_index_files(d):
+    classes = d.getVar('PACKAGE_CLASSES', True).replace("package_", "").split()
+
+    indexer_map = {
+        "rpm": (RpmIndexer, d.getVar('DEPLOY_DIR_RPM', True)),
+        "ipk": (OpkgIndexer, d.getVar('DEPLOY_DIR_IPK', True)),
+        "deb": (DpkgIndexer, d.getVar('DEPLOY_DIR_DEB', True))
+    }
+
+    result = None
+
+    for pkg_class in classes:
+        if not pkg_class in indexer_map:
+            continue
+
+        if os.path.exists(indexer_map[pkg_class][1]):
+            result = indexer_map[pkg_class][0](d, indexer_map[pkg_class][1]).write_index()
+
+            if result is not None:
+                bb.fatal(result)
+
+if __name__ == "__main__":
+    """
+    We should be able to run this as a standalone script, from outside bitbake
+    environment.
+    """
+    """
+    TBD
+    """
diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py
new file mode 100644
index 0000000..cd5f044
--- /dev/null
+++ b/meta/lib/oe/packagedata.py
@@ -0,0 +1,94 @@
+import codecs
+
+def packaged(pkg, d):
+    return os.access(get_subpkgedata_fn(pkg, d) + '.packaged', os.R_OK)
+
+def read_pkgdatafile(fn):
+    pkgdata = {}
+
+    def decode(str):
+        c = codecs.getdecoder("string_escape")
+        return c(str)[0]
+
+    if os.access(fn, os.R_OK):
+        import re
+        f = open(fn, 'r')
+        lines = f.readlines()
+        f.close()
+        r = re.compile("([^:]+):\s*(.*)")
+        for l in lines:
+            m = r.match(l)
+            if m:
+                pkgdata[m.group(1)] = decode(m.group(2))
+
+    return pkgdata
+
+def get_subpkgedata_fn(pkg, d):
+    return d.expand('${PKGDATA_DIR}/runtime/%s' % pkg)
+
+def has_subpkgdata(pkg, d):
+    return os.access(get_subpkgedata_fn(pkg, d), os.R_OK)
+
+def read_subpkgdata(pkg, d):
+    return read_pkgdatafile(get_subpkgedata_fn(pkg, d))
+
+def has_pkgdata(pn, d):
+    fn = d.expand('${PKGDATA_DIR}/%s' % pn)
+    return os.access(fn, os.R_OK)
+
+def read_pkgdata(pn, d):
+    fn = d.expand('${PKGDATA_DIR}/%s' % pn)
+    return read_pkgdatafile(fn)
+
+#
+# Collapse FOO_pkg variables into FOO
+#
+def read_subpkgdata_dict(pkg, d):
+    ret = {}
+    subd = read_pkgdatafile(get_subpkgedata_fn(pkg, d))
+    for var in subd:
+        newvar = var.replace("_" + pkg, "")
+        if newvar == var and var + "_" + pkg in subd:
+            continue
+        ret[newvar] = subd[var]
+    return ret
+
+def _pkgmap(d):
+    """Return a dictionary mapping package to recipe name."""
+
+    pkgdatadir = d.getVar("PKGDATA_DIR", True)
+
+    pkgmap = {}
+    try:
+        files = os.listdir(pkgdatadir)
+    except OSError:
+        bb.warn("No files in %s?" % pkgdatadir)
+        files = []
+
+    for pn in filter(lambda f: not os.path.isdir(os.path.join(pkgdatadir, f)), files):
+        try:
+            pkgdata = read_pkgdatafile(os.path.join(pkgdatadir, pn))
+        except OSError:
+            continue
+
+        packages = pkgdata.get("PACKAGES") or ""
+        for pkg in packages.split():
+            pkgmap[pkg] = pn
+
+    return pkgmap
+
+def pkgmap(d):
+    """Return a dictionary mapping package to recipe name.
+    Cache the mapping in the metadata"""
+
+    pkgmap_data = d.getVar("__pkgmap_data", False)
+    if pkgmap_data is None:
+        pkgmap_data = _pkgmap(d)
+        d.setVar("__pkgmap_data", pkgmap_data)
+
+    return pkgmap_data
+
+def recipename(pkg, d):
+    """Return the recipe name for the given binary package name."""
+
+    return pkgmap(d).get(pkg)
diff --git a/meta/lib/oe/packagegroup.py b/meta/lib/oe/packagegroup.py
new file mode 100644
index 0000000..12eb421
--- /dev/null
+++ b/meta/lib/oe/packagegroup.py
@@ -0,0 +1,36 @@
+import itertools
+
+def is_optional(feature, d):
+    packages = d.getVar("FEATURE_PACKAGES_%s" % feature, True)
+    if packages:
+        return bool(d.getVarFlag("FEATURE_PACKAGES_%s" % feature, "optional"))
+    else:
+        return bool(d.getVarFlag("PACKAGE_GROUP_%s" % feature, "optional"))
+
+def packages(features, d):
+    for feature in features:
+        packages = d.getVar("FEATURE_PACKAGES_%s" % feature, True)
+        if not packages:
+            packages = d.getVar("PACKAGE_GROUP_%s" % feature, True)
+        for pkg in (packages or "").split():
+            yield pkg
+
+def required_packages(features, d):
+    req = filter(lambda feature: not is_optional(feature, d), features)
+    return packages(req, d)
+
+def optional_packages(features, d):
+    opt = filter(lambda feature: is_optional(feature, d), features)
+    return packages(opt, d)
+
+def active_packages(features, d):
+    return itertools.chain(required_packages(features, d),
+                           optional_packages(features, d))
+
+def active_recipes(features, d):
+    import oe.packagedata
+
+    for pkg in active_packages(features, d):
+        recipe = oe.packagedata.recipename(pkg, d)
+        if recipe:
+            yield recipe
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
new file mode 100644
index 0000000..108bf1d
--- /dev/null
+++ b/meta/lib/oe/patch.py
@@ -0,0 +1,659 @@
+import oe.path
+
+class NotFoundError(bb.BBHandledException):
+    def __init__(self, path):
+        self.path = path
+
+    def __str__(self):
+        return "Error: %s not found." % self.path
+
+class CmdError(bb.BBHandledException):
+    def __init__(self, exitstatus, output):
+        self.status = exitstatus
+        self.output = output
+
+    def __str__(self):
+        return "Command Error: exit status: %d  Output:\n%s" % (self.status, self.output)
+
+
+def runcmd(args, dir = None):
+    import pipes
+
+    if dir:
+        olddir = os.path.abspath(os.curdir)
+        if not os.path.exists(dir):
+            raise NotFoundError(dir)
+        os.chdir(dir)
+        # print("cwd: %s -> %s" % (olddir, dir))
+
+    try:
+        args = [ pipes.quote(str(arg)) for arg in args ]
+        cmd = " ".join(args)
+        # print("cmd: %s" % cmd)
+        (exitstatus, output) = oe.utils.getstatusoutput(cmd)
+        if exitstatus != 0:
+            raise CmdError(exitstatus >> 8, output)
+        return output
+
+    finally:
+        if dir:
+            os.chdir(olddir)
+
+class PatchError(Exception):
+    def __init__(self, msg):
+        self.msg = msg
+
+    def __str__(self):
+        return "Patch Error: %s" % self.msg
+
+class PatchSet(object):
+    defaults = {
+        "strippath": 1
+    }
+
+    def __init__(self, dir, d):
+        self.dir = dir
+        self.d = d
+        self.patches = []
+        self._current = None
+
+    def current(self):
+        return self._current
+
+    def Clean(self):
+        """
+        Clean out the patch set.  Generally includes unapplying all
+        patches and wiping out all associated metadata.
+        """
+        raise NotImplementedError()
+
+    def Import(self, patch, force):
+        if not patch.get("file"):
+            if not patch.get("remote"):
+                raise PatchError("Patch file must be specified in patch import.")
+            else:
+                patch["file"] = bb.fetch2.localpath(patch["remote"], self.d)
+
+        for param in PatchSet.defaults:
+            if not patch.get(param):
+                patch[param] = PatchSet.defaults[param]
+
+        if patch.get("remote"):
+            patch["file"] = bb.data.expand(bb.fetch2.localpath(patch["remote"], self.d), self.d)
+
+        patch["filemd5"] = bb.utils.md5_file(patch["file"])
+
+    def Push(self, force):
+        raise NotImplementedError()
+
+    def Pop(self, force):
+        raise NotImplementedError()
+
+    def Refresh(self, remote = None, all = None):
+        raise NotImplementedError()
+
+    @staticmethod
+    def getPatchedFiles(patchfile, striplevel, srcdir=None):
+        """
+        Read a patch file and determine which files it will modify.
+        Params:
+            patchfile: the patch file to read
+            striplevel: the strip level at which the patch is going to be applied
+            srcdir: optional path to join onto the patched file paths
+        Returns:
+            A list of tuples of file path and change mode ('A' for add,
+            'D' for delete or 'M' for modify)
+        """
+
+        def patchedpath(patchline):
+            filepth = patchline.split()[1]
+            if filepth.endswith('/dev/null'):
+                return '/dev/null'
+            filesplit = filepth.split(os.sep)
+            if striplevel > len(filesplit):
+                bb.error('Patch %s has invalid strip level %d' % (patchfile, striplevel))
+                return None
+            return os.sep.join(filesplit[striplevel:])
+
+        copiedmode = False
+        filelist = []
+        with open(patchfile) as f:
+            for line in f:
+                if line.startswith('--- '):
+                    patchpth = patchedpath(line)
+                    if not patchpth:
+                        break
+                    if copiedmode:
+                        addedfile = patchpth
+                    else:
+                        removedfile = patchpth
+                elif line.startswith('+++ '):
+                    addedfile = patchedpath(line)
+                    if not addedfile:
+                        break
+                elif line.startswith('*** '):
+                    copiedmode = True
+                    removedfile = patchedpath(line)
+                    if not removedfile:
+                        break
+                else:
+                    removedfile = None
+                    addedfile = None
+
+                if addedfile and removedfile:
+                    if removedfile == '/dev/null':
+                        mode = 'A'
+                    elif addedfile == '/dev/null':
+                        mode = 'D'
+                    else:
+                        mode = 'M'
+                    if srcdir:
+                        fullpath = os.path.abspath(os.path.join(srcdir, addedfile))
+                    else:
+                        fullpath = addedfile
+                    filelist.append((fullpath, mode))
+
+        return filelist
+
+
+class PatchTree(PatchSet):
+    def __init__(self, dir, d):
+        PatchSet.__init__(self, dir, d)
+        self.patchdir = os.path.join(self.dir, 'patches')
+        self.seriespath = os.path.join(self.dir, 'patches', 'series')
+        bb.utils.mkdirhier(self.patchdir)
+
+    def _appendPatchFile(self, patch, strippath):
+        with open(self.seriespath, 'a') as f:
+            f.write(os.path.basename(patch) + "," + strippath + "\n")
+        shellcmd = ["cat", patch, ">" , self.patchdir + "/" + os.path.basename(patch)]
+        runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+
+    def _removePatch(self, p):
+        patch = {}
+        patch['file'] = p.split(",")[0]
+        patch['strippath'] = p.split(",")[1]
+        self._applypatch(patch, False, True)
+
+    def _removePatchFile(self, all = False):
+        if not os.path.exists(self.seriespath):
+            return
+        with open(self.seriespath, 'r+') as f:
+            patches = f.readlines()
+        if all:
+            for p in reversed(patches):
+                self._removePatch(os.path.join(self.patchdir, p.strip()))
+            patches = []
+        else:
+            self._removePatch(os.path.join(self.patchdir, patches[-1].strip()))
+            patches.pop()
+        with open(self.seriespath, 'w') as f:
+            for p in patches:
+                f.write(p)
+         
+    def Import(self, patch, force = None):
+        """"""
+        PatchSet.Import(self, patch, force)
+
+        if self._current is not None:
+            i = self._current + 1
+        else:
+            i = 0
+        self.patches.insert(i, patch)
+
+    def _applypatch(self, patch, force = False, reverse = False, run = True):
+        shellcmd = ["cat", patch['file'], "|", "patch", "-p", patch['strippath']]
+        if reverse:
+            shellcmd.append('-R')
+
+        if not run:
+            return "sh" + "-c" + " ".join(shellcmd)
+
+        if not force:
+            shellcmd.append('--dry-run')
+
+        output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+
+        if force:
+            return
+
+        shellcmd.pop(len(shellcmd) - 1)
+        output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+
+        if not reverse:
+            self._appendPatchFile(patch['file'], patch['strippath'])
+
+        return output
+
+    def Push(self, force = False, all = False, run = True):
+        bb.note("self._current is %s" % self._current)
+        bb.note("patches is %s" % self.patches)
+        if all:
+            for i in self.patches:
+                bb.note("applying patch %s" % i)
+                self._applypatch(i, force)
+                self._current = i
+        else:
+            if self._current is not None:
+                next = self._current + 1
+            else:
+                next = 0
+
+            bb.note("applying patch %s" % self.patches[next])
+            ret = self._applypatch(self.patches[next], force)
+
+            self._current = next
+            return ret
+
+    def Pop(self, force = None, all = None):
+        if all:
+            self._removePatchFile(True)
+            self._current = None
+        else:
+            self._removePatchFile(False)
+
+        if self._current == 0:
+            self._current = None
+
+        if self._current is not None:
+            self._current = self._current - 1
+
+    def Clean(self):
+        """"""
+        self.Pop(all=True)
+
+class GitApplyTree(PatchTree):
+    patch_line_prefix = '%% original patch'
+
+    def __init__(self, dir, d):
+        PatchTree.__init__(self, dir, d)
+
+    @staticmethod
+    def extractPatchHeader(patchfile):
+        """
+        Extract just the header lines from the top of a patch file
+        """
+        lines = []
+        with open(patchfile, 'r') as f:
+            for line in f.readlines():
+                if line.startswith('Index: ') or line.startswith('diff -') or line.startswith('---'):
+                    break
+                lines.append(line)
+        return lines
+
+    @staticmethod
+    def prepareCommit(patchfile):
+        """
+        Prepare a git commit command line based on the header from a patch file
+        (typically this is useful for patches that cannot be applied with "git am" due to formatting)
+        """
+        import tempfile
+        import re
+        author_re = re.compile('[\S ]+ <\S+@\S+\.\S+>')
+        # Process patch header and extract useful information
+        lines = GitApplyTree.extractPatchHeader(patchfile)
+        outlines = []
+        author = None
+        date = None
+        for line in lines:
+            if line.startswith('Subject: '):
+                subject = line.split(':', 1)[1]
+                # Remove any [PATCH][oe-core] etc.
+                subject = re.sub(r'\[.+?\]\s*', '', subject)
+                outlines.insert(0, '%s\n\n' % subject.strip())
+                continue
+            if line.startswith('From: ') or line.startswith('Author: '):
+                authorval = line.split(':', 1)[1].strip().replace('"', '')
+                # git is fussy about author formatting i.e. it must be Name <email@domain>
+                if author_re.match(authorval):
+                    author = authorval
+                    continue
+            if line.startswith('Date: '):
+                if date is None:
+                    dateval = line.split(':', 1)[1].strip()
+                    # Very crude check for date format, since git will blow up if it's not in the right
+                    # format. Without e.g. a python-dateutils dependency we can't do a whole lot more
+                    if len(dateval) > 12:
+                        date = dateval
+                continue
+            if line.startswith('Signed-off-by: '):
+                authorval = line.split(':', 1)[1].strip().replace('"', '')
+                # git is fussy about author formatting i.e. it must be Name <email@domain>
+                if author_re.match(authorval):
+                    author = authorval
+            outlines.append(line)
+        # Write out commit message to a file
+        with tempfile.NamedTemporaryFile('w', delete=False) as tf:
+            tmpfile = tf.name
+            for line in outlines:
+                tf.write(line)
+        # Prepare git command
+        cmd = ["git", "commit", "-F", tmpfile]
+        # git doesn't like plain email addresses as authors
+        if author and '<' in author:
+            cmd.append('--author="%s"' % author)
+        if date:
+            cmd.append('--date="%s"' % date)
+        return (tmpfile, cmd)
+
+    @staticmethod
+    def extractPatches(tree, startcommit, outdir):
+        import tempfile
+        import shutil
+        tempdir = tempfile.mkdtemp(prefix='oepatch')
+        try:
+            shellcmd = ["git", "format-patch", startcommit, "-o", tempdir]
+            out = runcmd(["sh", "-c", " ".join(shellcmd)], tree)
+            if out:
+                for srcfile in out.split():
+                    patchlines = []
+                    outfile = None
+                    with open(srcfile, 'r') as f:
+                        for line in f:
+                            if line.startswith(GitApplyTree.patch_line_prefix):
+                                outfile = line.split()[-1].strip()
+                                continue
+                            patchlines.append(line)
+                    if not outfile:
+                        outfile = os.path.basename(srcfile)
+                    with open(os.path.join(outdir, outfile), 'w') as of:
+                        for line in patchlines:
+                            of.write(line)
+        finally:
+            shutil.rmtree(tempdir)
+
+    def _applypatch(self, patch, force = False, reverse = False, run = True):
+        import shutil
+
+        def _applypatchhelper(shellcmd, patch, force = False, reverse = False, run = True):
+            if reverse:
+                shellcmd.append('-R')
+
+            shellcmd.append(patch['file'])
+
+            if not run:
+                return "sh" + "-c" + " ".join(shellcmd)
+
+            return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+
+        # Add hooks which add a pointer to the original patch file name in the commit message
+        reporoot = (runcmd("git rev-parse --show-toplevel".split(), self.dir) or '').strip()
+        if not reporoot:
+            raise Exception("Cannot get repository root for directory %s" % self.dir)
+        commithook = os.path.join(reporoot, '.git', 'hooks', 'commit-msg')
+        commithook_backup = commithook + '.devtool-orig'
+        applyhook = os.path.join(reporoot, '.git', 'hooks', 'applypatch-msg')
+        applyhook_backup = applyhook + '.devtool-orig'
+        if os.path.exists(commithook):
+            shutil.move(commithook, commithook_backup)
+        if os.path.exists(applyhook):
+            shutil.move(applyhook, applyhook_backup)
+        with open(commithook, 'w') as f:
+            # NOTE: the formatting here is significant; if you change it you'll also need to
+            # change other places which read it back
+            f.write('echo >> $1\n')
+            f.write('echo "%s: $PATCHFILE" >> $1\n' % GitApplyTree.patch_line_prefix)
+        os.chmod(commithook, 0755)
+        shutil.copy2(commithook, applyhook)
+        try:
+            patchfilevar = 'PATCHFILE="%s"' % os.path.basename(patch['file'])
+            try:
+                shellcmd = [patchfilevar, "git", "--work-tree=%s" % reporoot, "am", "-3", "--keep-cr", "-p%s" % patch['strippath']]
+                return _applypatchhelper(shellcmd, patch, force, reverse, run)
+            except CmdError:
+                # Need to abort the git am, or we'll still be within it at the end
+                try:
+                    shellcmd = ["git", "--work-tree=%s" % reporoot, "am", "--abort"]
+                    runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+                except CmdError:
+                    pass
+                # Fall back to git apply
+                shellcmd = ["git", "--git-dir=%s" % reporoot, "apply", "-p%s" % patch['strippath']]
+                try:
+                    output = _applypatchhelper(shellcmd, patch, force, reverse, run)
+                except CmdError:
+                    # Fall back to patch
+                    output = PatchTree._applypatch(self, patch, force, reverse, run)
+                # Add all files
+                shellcmd = ["git", "add", "-f", "-A", "."]
+                output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+                # Exclude the patches directory
+                shellcmd = ["git", "reset", "HEAD", self.patchdir]
+                output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+                # Commit the result
+                (tmpfile, shellcmd) = self.prepareCommit(patch['file'])
+                try:
+                    shellcmd.insert(0, patchfilevar)
+                    output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+                finally:
+                    os.remove(tmpfile)
+                return output
+        finally:
+            os.remove(commithook)
+            os.remove(applyhook)
+            if os.path.exists(commithook_backup):
+                shutil.move(commithook_backup, commithook)
+            if os.path.exists(applyhook_backup):
+                shutil.move(applyhook_backup, applyhook)
+
+
+class QuiltTree(PatchSet):
+    def _runcmd(self, args, run = True):
+        quiltrc = self.d.getVar('QUILTRCFILE', True)
+        if not run:
+            return ["quilt"] + ["--quiltrc"] + [quiltrc] + args
+        runcmd(["quilt"] + ["--quiltrc"] + [quiltrc] + args, self.dir)
+
+    def _quiltpatchpath(self, file):
+        return os.path.join(self.dir, "patches", os.path.basename(file))
+
+
+    def __init__(self, dir, d):
+        PatchSet.__init__(self, dir, d)
+        self.initialized = False
+        p = os.path.join(self.dir, 'patches')
+        if not os.path.exists(p):
+            os.makedirs(p)
+
+    def Clean(self):
+        try:
+            self._runcmd(["pop", "-a", "-f"])
+            oe.path.remove(os.path.join(self.dir, "patches","series"))
+        except Exception:
+            pass
+        self.initialized = True
+
+    def InitFromDir(self):
+        # read series -> self.patches
+        seriespath = os.path.join(self.dir, 'patches', 'series')
+        if not os.path.exists(self.dir):
+            raise NotFoundError(self.dir)
+        if os.path.exists(seriespath):
+            with open(seriespath, 'r') as f:
+                for line in f.readlines():
+                    patch = {}
+                    parts = line.strip().split()
+                    patch["quiltfile"] = self._quiltpatchpath(parts[0])
+                    patch["quiltfilemd5"] = bb.utils.md5_file(patch["quiltfile"])
+                    if len(parts) > 1:
+                        patch["strippath"] = parts[1][2:]
+                    self.patches.append(patch)
+
+            # determine which patches are applied -> self._current
+            try:
+                output = runcmd(["quilt", "applied"], self.dir)
+            except CmdError:
+                import sys
+                if sys.exc_value.output.strip() == "No patches applied":
+                    return
+                else:
+                    raise
+            output = [val for val in output.split('\n') if not val.startswith('#')]
+            for patch in self.patches:
+                if os.path.basename(patch["quiltfile"]) == output[-1]:
+                    self._current = self.patches.index(patch)
+        self.initialized = True
+
+    def Import(self, patch, force = None):
+        if not self.initialized:
+            self.InitFromDir()
+        PatchSet.Import(self, patch, force)
+        oe.path.symlink(patch["file"], self._quiltpatchpath(patch["file"]), force=True)
+        with open(os.path.join(self.dir, "patches", "series"), "a") as f:
+            f.write(os.path.basename(patch["file"]) + " -p" + patch["strippath"] + "\n")
+        patch["quiltfile"] = self._quiltpatchpath(patch["file"])
+        patch["quiltfilemd5"] = bb.utils.md5_file(patch["quiltfile"])
+
+        # TODO: determine if the file being imported:
+        #      1) is already imported, and is the same
+        #      2) is already imported, but differs
+
+        self.patches.insert(self._current or 0, patch)
+
+
+    def Push(self, force = False, all = False, run = True):
+        # quilt push [-f]
+
+        args = ["push"]
+        if force:
+            args.append("-f")
+        if all:
+            args.append("-a")
+        if not run:
+            return self._runcmd(args, run)
+
+        self._runcmd(args)
+
+        if self._current is not None:
+            self._current = self._current + 1
+        else:
+            self._current = 0
+
+    def Pop(self, force = None, all = None):
+        # quilt pop [-f]
+        args = ["pop"]
+        if force:
+            args.append("-f")
+        if all:
+            args.append("-a")
+
+        self._runcmd(args)
+
+        if self._current == 0:
+            self._current = None
+
+        if self._current is not None:
+            self._current = self._current - 1
+
+    def Refresh(self, **kwargs):
+        if kwargs.get("remote"):
+            patch = self.patches[kwargs["patch"]]
+            if not patch:
+                raise PatchError("No patch found at index %s in patchset." % kwargs["patch"])
+            (type, host, path, user, pswd, parm) = bb.fetch.decodeurl(patch["remote"])
+            if type == "file":
+                import shutil
+                if not patch.get("file") and patch.get("remote"):
+                    patch["file"] = bb.fetch2.localpath(patch["remote"], self.d)
+
+                shutil.copyfile(patch["quiltfile"], patch["file"])
+            else:
+                raise PatchError("Unable to do a remote refresh of %s, unsupported remote url scheme %s." % (os.path.basename(patch["quiltfile"]), type))
+        else:
+            # quilt refresh
+            args = ["refresh"]
+            if kwargs.get("quiltfile"):
+                args.append(os.path.basename(kwargs["quiltfile"]))
+            elif kwargs.get("patch"):
+                args.append(os.path.basename(self.patches[kwargs["patch"]]["quiltfile"]))
+            self._runcmd(args)
+
+class Resolver(object):
+    def __init__(self, patchset, terminal):
+        raise NotImplementedError()
+
+    def Resolve(self):
+        raise NotImplementedError()
+
+    def Revert(self):
+        raise NotImplementedError()
+
+    def Finalize(self):
+        raise NotImplementedError()
+
+class NOOPResolver(Resolver):
+    def __init__(self, patchset, terminal):
+        self.patchset = patchset
+        self.terminal = terminal
+
+    def Resolve(self):
+        olddir = os.path.abspath(os.curdir)
+        os.chdir(self.patchset.dir)
+        try:
+            self.patchset.Push()
+        except Exception:
+            import sys
+            os.chdir(olddir)
+            raise
+
+# Patch resolver which relies on the user doing all the work involved in the
+# resolution, with the exception of refreshing the remote copy of the patch
+# files (the urls).
+class UserResolver(Resolver):
+    def __init__(self, patchset, terminal):
+        self.patchset = patchset
+        self.terminal = terminal
+
+    # Force a push in the patchset, then drop to a shell for the user to
+    # resolve any rejected hunks
+    def Resolve(self):
+        olddir = os.path.abspath(os.curdir)
+        os.chdir(self.patchset.dir)
+        try:
+            self.patchset.Push(False)
+        except CmdError as v:
+            # Patch application failed
+            patchcmd = self.patchset.Push(True, False, False)
+
+            t = self.patchset.d.getVar('T', True)
+            if not t:
+                bb.msg.fatal("Build", "T not set")
+            bb.utils.mkdirhier(t)
+            import random
+            rcfile = "%s/bashrc.%s.%s" % (t, str(os.getpid()), random.random())
+            with open(rcfile, "w") as f:
+                f.write("echo '*** Manual patch resolution mode ***'\n")
+                f.write("echo 'Dropping to a shell, so patch rejects can be fixed manually.'\n")
+                f.write("echo 'Run \"quilt refresh\" when patch is corrected, press CTRL+D to exit.'\n")
+                f.write("echo ''\n")
+                f.write(" ".join(patchcmd) + "\n")
+            os.chmod(rcfile, 0775)
+
+            self.terminal("bash --rcfile " + rcfile, 'Patch Rejects: Please fix patch rejects manually', self.patchset.d)
+
+            # Construct a new PatchSet after the user's changes, compare the
+            # sets, checking patches for modifications, and doing a remote
+            # refresh on each.
+            oldpatchset = self.patchset
+            self.patchset = oldpatchset.__class__(self.patchset.dir, self.patchset.d)
+
+            for patch in self.patchset.patches:
+                oldpatch = None
+                for opatch in oldpatchset.patches:
+                    if opatch["quiltfile"] == patch["quiltfile"]:
+                        oldpatch = opatch
+
+                if oldpatch:
+                    patch["remote"] = oldpatch["remote"]
+                    if patch["quiltfile"] == oldpatch["quiltfile"]:
+                        if patch["quiltfilemd5"] != oldpatch["quiltfilemd5"]:
+                            bb.note("Patch %s has changed, updating remote url %s" % (os.path.basename(patch["quiltfile"]), patch["remote"]))
+                            # user change?  remote refresh
+                            self.patchset.Refresh(remote=True, patch=self.patchset.patches.index(patch))
+                        else:
+                            # User did not fix the problem.  Abort.
+                            raise PatchError("Patch application failed, and user did not fix and refresh the patch.")
+        except Exception:
+            os.chdir(olddir)
+            raise
+        os.chdir(olddir)
diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
new file mode 100644
index 0000000..413ebfb
--- /dev/null
+++ b/meta/lib/oe/path.py
@@ -0,0 +1,243 @@
+import errno
+import glob
+import shutil
+import subprocess
+import os.path
+
+def join(*paths):
+    """Like os.path.join but doesn't treat absolute RHS specially"""
+    return os.path.normpath("/".join(paths))
+
+def relative(src, dest):
+    """ Return a relative path from src to dest.
+
+    >>> relative("/usr/bin", "/tmp/foo/bar")
+    ../../tmp/foo/bar
+
+    >>> relative("/usr/bin", "/usr/lib")
+    ../lib
+
+    >>> relative("/tmp", "/tmp/foo/bar")
+    foo/bar
+    """
+
+    return os.path.relpath(dest, src)
+
+def make_relative_symlink(path):
+    """ Convert an absolute symlink to a relative one """
+    if not os.path.islink(path):
+        return
+    link = os.readlink(path)
+    if not os.path.isabs(link):
+        return
+
+    # find the common ancestor directory
+    ancestor = path
+    depth = 0
+    while ancestor and not link.startswith(ancestor):
+        ancestor = ancestor.rpartition('/')[0]
+        depth += 1
+
+    if not ancestor:
+        print("make_relative_symlink() Error: unable to find the common ancestor of %s and its target" % path)
+        return
+
+    base = link.partition(ancestor)[2].strip('/')
+    while depth > 1:
+        base = "../" + base
+        depth -= 1
+
+    os.remove(path)
+    os.symlink(base, path)
+
+def format_display(path, metadata):
+    """ Prepare a path for display to the user. """
+    rel = relative(metadata.getVar("TOPDIR", True), path)
+    if len(rel) > len(path):
+        return path
+    else:
+        return rel
+
+def copytree(src, dst):
+    # We could use something like shutil.copytree here but it turns out to
+    # to be slow. It takes twice as long copying to an empty directory. 
+    # If dst already has contents performance can be 15 time slower
+    # This way we also preserve hardlinks between files in the tree.
+
+    bb.utils.mkdirhier(dst)
+    cmd = 'tar -cf - -C %s -p . | tar -xf - -C %s' % (src, dst)
+    check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+
+def copyhardlinktree(src, dst):
+    """ Make the hard link when possible, otherwise copy. """
+    bb.utils.mkdirhier(dst)
+    if os.path.isdir(src) and not len(os.listdir(src)):
+        return	
+
+    if (os.stat(src).st_dev ==  os.stat(dst).st_dev):
+        # Need to copy directories only with tar first since cp will error if two 
+        # writers try and create a directory at the same time
+        cmd = 'cd %s; find . -type d -print | tar -cf - -C %s -p --files-from - --no-recursion | tar -xf - -C %s' % (src, src, dst)
+        check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+        cmd = 'cd %s; find . -print0 | cpio --null -pdlu %s' % (src, dst)
+        check_output(cmd, shell=True, stderr=subprocess.STDOUT)
+    else:
+        copytree(src, dst)
+
+def remove(path, recurse=True):
+    """Equivalent to rm -f or rm -rf"""
+    for name in glob.glob(path):
+        try:
+            os.unlink(name)
+        except OSError as exc:
+            if recurse and exc.errno == errno.EISDIR:
+                shutil.rmtree(name)
+            elif exc.errno != errno.ENOENT:
+                raise
+
+def symlink(source, destination, force=False):
+    """Create a symbolic link"""
+    try:
+        if force:
+            remove(destination)
+        os.symlink(source, destination)
+    except OSError as e:
+        if e.errno != errno.EEXIST or os.readlink(destination) != source:
+            raise
+
+class CalledProcessError(Exception):
+    def __init__(self, retcode, cmd, output = None):
+        self.retcode = retcode
+        self.cmd = cmd
+        self.output = output
+    def __str__(self):
+        return "Command '%s' returned non-zero exit status %d with output %s" % (self.cmd, self.retcode, self.output)
+
+# Not needed when we move to python 2.7
+def check_output(*popenargs, **kwargs):
+    r"""Run command with arguments and return its output as a byte string.
+
+    If the exit code was non-zero it raises a CalledProcessError.  The
+    CalledProcessError object will have the return code in the returncode
+    attribute and output in the output attribute.
+
+    The arguments are the same as for the Popen constructor.  Example:
+
+    >>> check_output(["ls", "-l", "/dev/null"])
+    'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'
+
+    The stdout argument is not allowed as it is used internally.
+    To capture standard error in the result, use stderr=STDOUT.
+
+    >>> check_output(["/bin/sh", "-c",
+    ...               "ls -l non_existent_file ; exit 0"],
+    ...              stderr=STDOUT)
+    'ls: non_existent_file: No such file or directory\n'
+    """
+    if 'stdout' in kwargs:
+        raise ValueError('stdout argument not allowed, it will be overridden.')
+    process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
+    output, unused_err = process.communicate()
+    retcode = process.poll()
+    if retcode:
+        cmd = kwargs.get("args")
+        if cmd is None:
+            cmd = popenargs[0]
+        raise CalledProcessError(retcode, cmd, output=output)
+    return output
+
+def find(dir, **walkoptions):
+    """ Given a directory, recurses into that directory,
+    returning all files as absolute paths. """
+
+    for root, dirs, files in os.walk(dir, **walkoptions):
+        for file in files:
+            yield os.path.join(root, file)
+
+
+## realpath() related functions
+def __is_path_below(file, root):
+    return (file + os.path.sep).startswith(root)
+
+def __realpath_rel(start, rel_path, root, loop_cnt, assume_dir):
+    """Calculates real path of symlink 'start' + 'rel_path' below
+    'root'; no part of 'start' below 'root' must contain symlinks. """
+    have_dir = True
+
+    for d in rel_path.split(os.path.sep):
+        if not have_dir and not assume_dir:
+            raise OSError(errno.ENOENT, "no such directory %s" % start)
+
+        if d == os.path.pardir: # '..'
+            if len(start) >= len(root):
+                # do not follow '..' before root
+                start = os.path.dirname(start)
+            else:
+                # emit warning?
+                pass
+        else:
+            (start, have_dir) = __realpath(os.path.join(start, d),
+                                           root, loop_cnt, assume_dir)
+
+        assert(__is_path_below(start, root))
+
+    return start
+
+def __realpath(file, root, loop_cnt, assume_dir):
+    while os.path.islink(file) and len(file) >= len(root):
+        if loop_cnt == 0:
+            raise OSError(errno.ELOOP, file)
+
+        loop_cnt -= 1
+        target = os.path.normpath(os.readlink(file))
+
+        if not os.path.isabs(target):
+            tdir = os.path.dirname(file)
+            assert(__is_path_below(tdir, root))
+        else:
+            tdir = root
+
+        file = __realpath_rel(tdir, target, root, loop_cnt, assume_dir)
+
+    try:
+        is_dir = os.path.isdir(file)
+    except:
+        is_dir = false
+
+    return (file, is_dir)
+
+def realpath(file, root, use_physdir = True, loop_cnt = 100, assume_dir = False):
+    """ Returns the canonical path of 'file' with assuming a
+    toplevel 'root' directory. When 'use_physdir' is set, all
+    preceding path components of 'file' will be resolved first;
+    this flag should be set unless it is guaranteed that there is
+    no symlink in the path. When 'assume_dir' is not set, missing
+    path components will raise an ENOENT error"""
+
+    root = os.path.normpath(root)
+    file = os.path.normpath(file)
+
+    if not root.endswith(os.path.sep):
+        # letting root end with '/' makes some things easier
+        root = root + os.path.sep
+
+    if not __is_path_below(file, root):
+        raise OSError(errno.EINVAL, "file '%s' is not below root" % file)
+
+    try:
+        if use_physdir:
+            file = __realpath_rel(root, file[(len(root) - 1):], root, loop_cnt, assume_dir)
+        else:
+            file = __realpath(file, root, loop_cnt, assume_dir)[0]
+    except OSError as e:
+        if e.errno == errno.ELOOP:
+            # make ELOOP more readable; without catching it, there will
+            # be printed a backtrace with 100s of OSError exceptions
+            # else
+            raise OSError(errno.ELOOP,
+                          "too much recursions while resolving '%s'; loop in '%s'" %
+                          (file, e.strerror))
+
+        raise
+
+    return file
diff --git a/meta/lib/oe/prservice.py b/meta/lib/oe/prservice.py
new file mode 100644
index 0000000..b0cbcb1
--- /dev/null
+++ b/meta/lib/oe/prservice.py
@@ -0,0 +1,126 @@
+
+def prserv_make_conn(d, check = False):
+    import prserv.serv
+    host_params = filter(None, (d.getVar("PRSERV_HOST", True) or '').split(':'))
+    try:
+        conn = None
+        conn = prserv.serv.PRServerConnection(host_params[0], int(host_params[1]))
+        if check:
+            if not conn.ping():
+                raise Exception('service not available')
+        d.setVar("__PRSERV_CONN",conn)
+    except Exception, exc:
+        bb.fatal("Connecting to PR service %s:%s failed: %s" % (host_params[0], host_params[1], str(exc)))
+
+    return conn
+
+def prserv_dump_db(d):
+    if not d.getVar('PRSERV_HOST', True):
+        bb.error("Not using network based PR service")
+        return None
+
+    conn = d.getVar("__PRSERV_CONN", True)
+    if conn is None:
+        conn = prserv_make_conn(d)
+        if conn is None:
+            bb.error("Making connection failed to remote PR service")
+            return None
+
+    #dump db
+    opt_version = d.getVar('PRSERV_DUMPOPT_VERSION', True)
+    opt_pkgarch = d.getVar('PRSERV_DUMPOPT_PKGARCH', True)
+    opt_checksum = d.getVar('PRSERV_DUMPOPT_CHECKSUM', True)
+    opt_col = ("1" == d.getVar('PRSERV_DUMPOPT_COL', True))
+    return conn.export(opt_version, opt_pkgarch, opt_checksum, opt_col)
+
+def prserv_import_db(d, filter_version=None, filter_pkgarch=None, filter_checksum=None):
+    if not d.getVar('PRSERV_HOST', True):
+        bb.error("Not using network based PR service")
+        return None
+
+    conn = d.getVar("__PRSERV_CONN", True)
+    if conn is None:
+        conn = prserv_make_conn(d)
+        if conn is None:
+            bb.error("Making connection failed to remote PR service")
+            return None
+    #get the entry values
+    imported = []
+    prefix = "PRAUTO$"
+    for v in d.keys():
+        if v.startswith(prefix):
+            (remain, sep, checksum) = v.rpartition('$')
+            (remain, sep, pkgarch) = remain.rpartition('$')
+            (remain, sep, version) = remain.rpartition('$')
+            if (remain + '$' != prefix) or \
+               (filter_version and filter_version != version) or \
+               (filter_pkgarch and filter_pkgarch != pkgarch) or \
+               (filter_checksum and filter_checksum != checksum):
+               continue
+            try:
+                value = int(d.getVar(remain + '$' + version + '$' + pkgarch + '$' + checksum, True))
+            except BaseException as exc:
+                bb.debug("Not valid value of %s:%s" % (v,str(exc)))
+                continue
+            ret = conn.importone(version,pkgarch,checksum,value)
+            if ret != value:
+                bb.error("importing(%s,%s,%s,%d) failed. DB may have larger value %d" % (version,pkgarch,checksum,value,ret))
+            else:
+               imported.append((version,pkgarch,checksum,value))
+    return imported
+
+def prserv_export_tofile(d, metainfo, datainfo, lockdown, nomax=False):
+    import bb.utils
+    #initilize the output file
+    bb.utils.mkdirhier(d.getVar('PRSERV_DUMPDIR', True))
+    df = d.getVar('PRSERV_DUMPFILE', True)
+    #write data
+    lf = bb.utils.lockfile("%s.lock" % df)
+    f = open(df, "a")
+    if metainfo:
+        #dump column info 
+        f.write("#PR_core_ver = \"%s\"\n\n" % metainfo['core_ver']);
+        f.write("#Table: %s\n" % metainfo['tbl_name'])
+        f.write("#Columns:\n")
+        f.write("#name      \t type    \t notn    \t dflt    \t pk\n")
+        f.write("#----------\t --------\t --------\t --------\t ----\n")
+        for i in range(len(metainfo['col_info'])):
+            f.write("#%10s\t %8s\t %8s\t %8s\t %4s\n" % 
+                    (metainfo['col_info'][i]['name'], 
+                     metainfo['col_info'][i]['type'], 
+                     metainfo['col_info'][i]['notnull'], 
+                     metainfo['col_info'][i]['dflt_value'], 
+                     metainfo['col_info'][i]['pk']))
+        f.write("\n")
+
+    if lockdown:
+        f.write("PRSERV_LOCKDOWN = \"1\"\n\n")
+
+    if datainfo:
+        idx = {}
+        for i in range(len(datainfo)):
+            pkgarch = datainfo[i]['pkgarch']
+            value = datainfo[i]['value']
+            if pkgarch not in idx:
+                idx[pkgarch] = i
+            elif value > datainfo[idx[pkgarch]]['value']:
+                idx[pkgarch] = i
+            f.write("PRAUTO$%s$%s$%s = \"%s\"\n" % 
+                (str(datainfo[i]['version']), pkgarch, str(datainfo[i]['checksum']), str(value)))
+        if not nomax:
+            for i in idx:
+                f.write("PRAUTO_%s_%s = \"%s\"\n" % (str(datainfo[idx[i]]['version']),str(datainfo[idx[i]]['pkgarch']),str(datainfo[idx[i]]['value'])))
+    f.close()
+    bb.utils.unlockfile(lf)
+
+def prserv_check_avail(d):
+    host_params = filter(None, (d.getVar("PRSERV_HOST", True) or '').split(':'))
+    try:
+        if len(host_params) != 2:
+            raise TypeError
+        else:
+            int(host_params[1])
+    except TypeError:
+        bb.fatal('Undefined/incorrect PRSERV_HOST value. Format: "host:port"')
+    else:
+        prserv_make_conn(d, True)
diff --git a/meta/lib/oe/qa.py b/meta/lib/oe/qa.py
new file mode 100644
index 0000000..d5cdaa0
--- /dev/null
+++ b/meta/lib/oe/qa.py
@@ -0,0 +1,111 @@
+class ELFFile:
+    EI_NIDENT = 16
+
+    EI_CLASS      = 4
+    EI_DATA       = 5
+    EI_VERSION    = 6
+    EI_OSABI      = 7
+    EI_ABIVERSION = 8
+
+    # possible values for EI_CLASS
+    ELFCLASSNONE = 0
+    ELFCLASS32   = 1
+    ELFCLASS64   = 2
+
+    # possible value for EI_VERSION
+    EV_CURRENT   = 1
+
+    # possible values for EI_DATA
+    ELFDATANONE  = 0
+    ELFDATA2LSB  = 1
+    ELFDATA2MSB  = 2
+
+    def my_assert(self, expectation, result):
+        if not expectation == result:
+            #print "'%x','%x' %s" % (ord(expectation), ord(result), self.name)
+            raise Exception("This does not work as expected")
+
+    def __init__(self, name, bits = 0):
+        self.name = name
+        self.bits = bits
+        self.objdump_output = {}
+
+    def open(self):
+        self.file = file(self.name, "r")
+        self.data = self.file.read(ELFFile.EI_NIDENT+4)
+
+        self.my_assert(len(self.data), ELFFile.EI_NIDENT+4)
+        self.my_assert(self.data[0], chr(0x7f) )
+        self.my_assert(self.data[1], 'E')
+        self.my_assert(self.data[2], 'L')
+        self.my_assert(self.data[3], 'F')
+        if self.bits == 0:
+            if self.data[ELFFile.EI_CLASS] == chr(ELFFile.ELFCLASS32):
+                self.bits = 32
+            elif self.data[ELFFile.EI_CLASS] == chr(ELFFile.ELFCLASS64):
+                self.bits = 64
+            else:
+                # Not 32-bit or 64.. lets assert
+                raise Exception("ELF but not 32 or 64 bit.")
+        elif self.bits == 32:
+            self.my_assert(self.data[ELFFile.EI_CLASS], chr(ELFFile.ELFCLASS32))
+        elif self.bits == 64:
+            self.my_assert(self.data[ELFFile.EI_CLASS], chr(ELFFile.ELFCLASS64))
+        else:
+            raise Exception("Must specify unknown, 32 or 64 bit size.")
+        self.my_assert(self.data[ELFFile.EI_VERSION], chr(ELFFile.EV_CURRENT) )
+
+        self.sex = self.data[ELFFile.EI_DATA]
+        if self.sex == chr(ELFFile.ELFDATANONE):
+            raise Exception("self.sex == ELFDATANONE")
+        elif self.sex == chr(ELFFile.ELFDATA2LSB):
+            self.sex = "<"
+        elif self.sex == chr(ELFFile.ELFDATA2MSB):
+            self.sex = ">"
+        else:
+            raise Exception("Unknown self.sex")
+
+    def osAbi(self):
+        return ord(self.data[ELFFile.EI_OSABI])
+
+    def abiVersion(self):
+        return ord(self.data[ELFFile.EI_ABIVERSION])
+
+    def abiSize(self):
+        return self.bits
+
+    def isLittleEndian(self):
+        return self.sex == "<"
+
+    def isBigEngian(self):
+        return self.sex == ">"
+
+    def machine(self):
+        """
+        We know the sex stored in self.sex and we
+        know the position
+        """
+        import struct
+        (a,) = struct.unpack(self.sex+"H", self.data[18:20])
+        return a
+
+    def run_objdump(self, cmd, d):
+        import bb.process
+        import sys
+
+        if cmd in self.objdump_output:
+            return self.objdump_output[cmd]
+
+        objdump = d.getVar('OBJDUMP', True)
+
+        env = os.environ.copy()
+        env["LC_ALL"] = "C"
+        env["PATH"] = d.getVar('PATH', True)
+
+        try:
+            bb.note("%s %s %s" % (objdump, cmd, self.name))
+            self.objdump_output[cmd] = bb.process.run([objdump, cmd, self.name], env=env, shell=False)[0]
+            return self.objdump_output[cmd]
+        except Exception as e:
+            bb.note("%s %s %s failed: %s" % (objdump, cmd, self.name, e))
+            return ""
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
new file mode 100644
index 0000000..d4fa726
--- /dev/null
+++ b/meta/lib/oe/recipeutils.py
@@ -0,0 +1,740 @@
+# Utility functions for reading and modifying recipes
+#
+# Some code borrowed from the OE layer index
+#
+# Copyright (C) 2013-2015 Intel Corporation
+#
+
+import sys
+import os
+import os.path
+import tempfile
+import textwrap
+import difflib
+import utils
+import shutil
+import re
+import fnmatch
+from collections import OrderedDict, defaultdict
+
+
+# Help us to find places to insert values
+recipe_progression = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION', 'LICENSE', 'LIC_FILES_CHKSUM', 'PROVIDES', 'DEPENDS', 'PR', 'PV', 'SRCREV', 'SRC_URI', 'S', 'do_fetch', 'do_unpack', 'do_patch', 'EXTRA_OECONF', 'do_configure', 'EXTRA_OEMAKE', 'do_compile', 'do_install', 'do_populate_sysroot', 'INITSCRIPT', 'USERADD', 'GROUPADD', 'PACKAGES', 'FILES', 'RDEPENDS', 'RRECOMMENDS', 'RSUGGESTS', 'RPROVIDES', 'RREPLACES', 'RCONFLICTS', 'ALLOW_EMPTY', 'do_package', 'do_deploy']
+# Variables that sometimes are a bit long but shouldn't be wrapped
+nowrap_vars = ['SUMMARY', 'HOMEPAGE', 'BUGTRACKER']
+list_vars = ['SRC_URI', 'LIC_FILES_CHKSUM']
+meta_vars = ['SUMMARY', 'DESCRIPTION', 'HOMEPAGE', 'BUGTRACKER', 'SECTION']
+
+
+def pn_to_recipe(cooker, pn):
+    """Convert a recipe name (PN) to the path to the recipe file"""
+    import bb.providers
+
+    if pn in cooker.recipecache.pkg_pn:
+        filenames = cooker.recipecache.pkg_pn[pn]
+        best = bb.providers.findBestProvider(pn, cooker.data, cooker.recipecache, cooker.recipecache.pkg_pn)
+        return best[3]
+    else:
+        return None
+
+
+def get_unavailable_reasons(cooker, pn):
+    """If a recipe could not be found, find out why if possible"""
+    import bb.taskdata
+    taskdata = bb.taskdata.TaskData(None, skiplist=cooker.skiplist)
+    return taskdata.get_reasons(pn)
+
+
+def parse_recipe(fn, appendfiles, d):
+    """
+    Parse an individual recipe file, optionally with a list of
+    bbappend files.
+    """
+    import bb.cache
+    envdata = bb.cache.Cache.loadDataFull(fn, appendfiles, d)
+    return envdata
+
+
+def parse_recipe_simple(cooker, pn, d, appends=True):
+    """
+    Parse a recipe and optionally all bbappends that apply to it
+    in the current configuration.
+    """
+    import bb.providers
+
+    recipefile = pn_to_recipe(cooker, pn)
+    if not recipefile:
+        skipreasons = get_unavailable_reasons(cooker, pn)
+        # We may as well re-use bb.providers.NoProvider here
+        if skipreasons:
+            raise bb.providers.NoProvider(skipreasons)
+        else:
+            raise bb.providers.NoProvider('Unable to find any recipe file matching %s' % pn)
+    if appends:
+        appendfiles = cooker.collection.get_file_appends(recipefile)
+    return parse_recipe(recipefile, appendfiles, d)
+
+
+def get_var_files(fn, varlist, d):
+    """Find the file in which each of a list of variables is set.
+    Note: requires variable history to be enabled when parsing.
+    """
+    varfiles = {}
+    for v in varlist:
+        history = d.varhistory.variable(v)
+        files = []
+        for event in history:
+            if 'file' in event and not 'flag' in event:
+                files.append(event['file'])
+        if files:
+            actualfile = files[-1]
+        else:
+            actualfile = None
+        varfiles[v] = actualfile
+
+    return varfiles
+
+
+def patch_recipe_file(fn, values, patch=False, relpath=''):
+    """Update or insert variable values into a recipe file (assuming you
+       have already identified the exact file you want to update.)
+       Note that some manual inspection/intervention may be required
+       since this cannot handle all situations.
+    """
+    remainingnames = {}
+    for k in values.keys():
+        remainingnames[k] = recipe_progression.index(k) if k in recipe_progression else -1
+    remainingnames = OrderedDict(sorted(remainingnames.iteritems(), key=lambda x: x[1]))
+
+    with tempfile.NamedTemporaryFile('w', delete=False) as tf:
+        def outputvalue(name):
+            rawtext = '%s = "%s"\n' % (name, values[name])
+            if name in nowrap_vars:
+                tf.write(rawtext)
+            elif name in list_vars:
+                splitvalue = values[name].split()
+                if len(splitvalue) > 1:
+                    linesplit = ' \\\n' + (' ' * (len(name) + 4))
+                    tf.write('%s = "%s%s"\n' % (name, linesplit.join(splitvalue), linesplit))
+                else:
+                    tf.write(rawtext)
+            else:
+                wrapped = textwrap.wrap(rawtext)
+                for wrapline in wrapped[:-1]:
+                    tf.write('%s \\\n' % wrapline)
+                tf.write('%s\n' % wrapped[-1])
+
+        tfn = tf.name
+        with open(fn, 'r') as f:
+            # First runthrough - find existing names (so we know not to insert based on recipe_progression)
+            # Second runthrough - make the changes
+            existingnames = []
+            for runthrough in [1, 2]:
+                currname = None
+                for line in f:
+                    if not currname:
+                        insert = False
+                        for k in remainingnames.keys():
+                            for p in recipe_progression:
+                                if re.match('^%s(_prepend|_append)*[ ?:=(]' % p, line):
+                                    if remainingnames[k] > -1 and recipe_progression.index(p) > remainingnames[k] and runthrough > 1 and not k in existingnames:
+                                        outputvalue(k)
+                                        del remainingnames[k]
+                                    break
+                        for k in remainingnames.keys():
+                            if re.match('^%s[ ?:=]' % k, line):
+                                currname = k
+                                if runthrough == 1:
+                                    existingnames.append(k)
+                                else:
+                                    del remainingnames[k]
+                                break
+                        if currname and runthrough > 1:
+                            outputvalue(currname)
+
+                    if currname:
+                        sline = line.rstrip()
+                        if not sline.endswith('\\'):
+                            currname = None
+                        continue
+                    if runthrough > 1:
+                        tf.write(line)
+                f.seek(0)
+        if remainingnames:
+            tf.write('\n')
+            for k in remainingnames.keys():
+                outputvalue(k)
+
+    with open(tfn, 'U') as f:
+        tolines = f.readlines()
+    if patch:
+        with open(fn, 'U') as f:
+            fromlines = f.readlines()
+        relfn = os.path.relpath(fn, relpath)
+        diff = difflib.unified_diff(fromlines, tolines, 'a/%s' % relfn, 'b/%s' % relfn)
+        os.remove(tfn)
+        return diff
+    else:
+        with open(fn, 'w') as f:
+            f.writelines(tolines)
+        os.remove(tfn)
+        return None
+
+def localise_file_vars(fn, varfiles, varlist):
+    """Given a list of variables and variable history (fetched with get_var_files())
+    find where each variable should be set/changed. This handles for example where a
+    recipe includes an inc file where variables might be changed - in most cases
+    we want to update the inc file when changing the variable value rather than adding
+    it to the recipe itself.
+    """
+    fndir = os.path.dirname(fn) + os.sep
+
+    first_meta_file = None
+    for v in meta_vars:
+        f = varfiles.get(v, None)
+        if f:
+            actualdir = os.path.dirname(f) + os.sep
+            if actualdir.startswith(fndir):
+                first_meta_file = f
+                break
+
+    filevars = defaultdict(list)
+    for v in varlist:
+        f = varfiles[v]
+        # Only return files that are in the same directory as the recipe or in some directory below there
+        # (this excludes bbclass files and common inc files that wouldn't be appropriate to set the variable
+        # in if we were going to set a value specific to this recipe)
+        if f:
+            actualfile = f
+        else:
+            # Variable isn't in a file, if it's one of the "meta" vars, use the first file with a meta var in it
+            if first_meta_file:
+                actualfile = first_meta_file
+            else:
+                actualfile = fn
+
+        actualdir = os.path.dirname(actualfile) + os.sep
+        if not actualdir.startswith(fndir):
+            actualfile = fn
+        filevars[actualfile].append(v)
+
+    return filevars
+
+def patch_recipe(d, fn, varvalues, patch=False, relpath=''):
+    """Modify a list of variable values in the specified recipe. Handles inc files if
+    used by the recipe.
+    """
+    varlist = varvalues.keys()
+    varfiles = get_var_files(fn, varlist, d)
+    locs = localise_file_vars(fn, varfiles, varlist)
+    patches = []
+    for f,v in locs.iteritems():
+        vals = {k: varvalues[k] for k in v}
+        patchdata = patch_recipe_file(f, vals, patch, relpath)
+        if patch:
+            patches.append(patchdata)
+
+    if patch:
+        return patches
+    else:
+        return None
+
+
+
+def copy_recipe_files(d, tgt_dir, whole_dir=False, download=True):
+    """Copy (local) recipe files, including both files included via include/require,
+    and files referred to in the SRC_URI variable."""
+    import bb.fetch2
+    import oe.path
+
+    # FIXME need a warning if the unexpanded SRC_URI value contains variable references
+
+    uris = (d.getVar('SRC_URI', True) or "").split()
+    fetch = bb.fetch2.Fetch(uris, d)
+    if download:
+        fetch.download()
+
+    # Copy local files to target directory and gather any remote files
+    bb_dir = os.path.dirname(d.getVar('FILE', True)) + os.sep
+    remotes = []
+    includes = [path for path in d.getVar('BBINCLUDED', True).split() if
+                path.startswith(bb_dir) and os.path.exists(path)]
+    for path in fetch.localpaths() + includes:
+        # Only import files that are under the meta directory
+        if path.startswith(bb_dir):
+            if not whole_dir:
+                relpath = os.path.relpath(path, bb_dir)
+                subdir = os.path.join(tgt_dir, os.path.dirname(relpath))
+                if not os.path.exists(subdir):
+                    os.makedirs(subdir)
+                shutil.copy2(path, os.path.join(tgt_dir, relpath))
+        else:
+            remotes.append(path)
+    # Simply copy whole meta dir, if requested
+    if whole_dir:
+        shutil.copytree(bb_dir, tgt_dir)
+
+    return remotes
+
+
+def get_recipe_patches(d):
+    """Get a list of the patches included in SRC_URI within a recipe."""
+    patchfiles = []
+    # Execute src_patches() defined in patch.bbclass - this works since that class
+    # is inherited globally
+    patches = bb.utils.exec_flat_python_func('src_patches', d)
+    for patch in patches:
+        _, _, local, _, _, parm = bb.fetch.decodeurl(patch)
+        patchfiles.append(local)
+    return patchfiles
+
+
+def get_recipe_patched_files(d):
+    """
+    Get the list of patches for a recipe along with the files each patch modifies.
+    Params:
+        d: the datastore for the recipe
+    Returns:
+        a dict mapping patch file path to a list of tuples of changed files and
+        change mode ('A' for add, 'D' for delete or 'M' for modify)
+    """
+    import oe.patch
+    # Execute src_patches() defined in patch.bbclass - this works since that class
+    # is inherited globally
+    patches = bb.utils.exec_flat_python_func('src_patches', d)
+    patchedfiles = {}
+    for patch in patches:
+        _, _, patchfile, _, _, parm = bb.fetch.decodeurl(patch)
+        striplevel = int(parm['striplevel'])
+        patchedfiles[patchfile] = oe.patch.PatchSet.getPatchedFiles(patchfile, striplevel, os.path.join(d.getVar('S', True), parm.get('patchdir', '')))
+    return patchedfiles
+
+
+def validate_pn(pn):
+    """Perform validation on a recipe name (PN) for a new recipe."""
+    reserved_names = ['forcevariable', 'append', 'prepend', 'remove']
+    if not re.match('[0-9a-z-.]+', pn):
+        return 'Recipe name "%s" is invalid: only characters 0-9, a-z, - and . are allowed' % pn
+    elif pn in reserved_names:
+        return 'Recipe name "%s" is invalid: is a reserved keyword' % pn
+    elif pn.startswith('pn-'):
+        return 'Recipe name "%s" is invalid: names starting with "pn-" are reserved' % pn
+    return ''
+
+
+def get_bbappend_path(d, destlayerdir, wildcardver=False):
+    """Determine how a bbappend for a recipe should be named and located within another layer"""
+
+    import bb.cookerdata
+
+    destlayerdir = os.path.abspath(destlayerdir)
+    recipefile = d.getVar('FILE', True)
+    recipefn = os.path.splitext(os.path.basename(recipefile))[0]
+    if wildcardver and '_' in recipefn:
+        recipefn = recipefn.split('_', 1)[0] + '_%'
+    appendfn = recipefn + '.bbappend'
+
+    # Parse the specified layer's layer.conf file directly, in case the layer isn't in bblayers.conf
+    confdata = d.createCopy()
+    confdata.setVar('BBFILES', '')
+    confdata.setVar('LAYERDIR', destlayerdir)
+    destlayerconf = os.path.join(destlayerdir, "conf", "layer.conf")
+    confdata = bb.cookerdata.parse_config_file(destlayerconf, confdata)
+
+    origlayerdir = find_layerdir(recipefile)
+    if not origlayerdir:
+        return (None, False)
+    # Now join this to the path where the bbappend is going and check if it is covered by BBFILES
+    appendpath = os.path.join(destlayerdir, os.path.relpath(os.path.dirname(recipefile), origlayerdir), appendfn)
+    closepath = ''
+    pathok = True
+    for bbfilespec in confdata.getVar('BBFILES', True).split():
+        if fnmatch.fnmatchcase(appendpath, bbfilespec):
+            # Our append path works, we're done
+            break
+        elif bbfilespec.startswith(destlayerdir) and fnmatch.fnmatchcase('test.bbappend', os.path.basename(bbfilespec)):
+            # Try to find the longest matching path
+            if len(bbfilespec) > len(closepath):
+                closepath = bbfilespec
+    else:
+        # Unfortunately the bbappend layer and the original recipe's layer don't have the same structure
+        if closepath:
+            # bbappend layer's layer.conf at least has a spec that picks up .bbappend files
+            # Now we just need to substitute out any wildcards
+            appendsubdir = os.path.relpath(os.path.dirname(closepath), destlayerdir)
+            if 'recipes-*' in appendsubdir:
+                # Try to copy this part from the original recipe path
+                res = re.search('/recipes-[^/]+/', recipefile)
+                if res:
+                    appendsubdir = appendsubdir.replace('/recipes-*/', res.group(0))
+            # This is crude, but we have to do something
+            appendsubdir = appendsubdir.replace('*', recipefn.split('_')[0])
+            appendsubdir = appendsubdir.replace('?', 'a')
+            appendpath = os.path.join(destlayerdir, appendsubdir, appendfn)
+        else:
+            pathok = False
+    return (appendpath, pathok)
+
+
+def bbappend_recipe(rd, destlayerdir, srcfiles, install=None, wildcardver=False, machine=None, extralines=None, removevalues=None):
+    """
+    Writes a bbappend file for a recipe
+    Parameters:
+        rd: data dictionary for the recipe
+        destlayerdir: base directory of the layer to place the bbappend in
+            (subdirectory path from there will be determined automatically)
+        srcfiles: dict of source files to add to SRC_URI, where the value
+            is the full path to the file to be added, and the value is the
+            original filename as it would appear in SRC_URI or None if it
+            isn't already present. You may pass None for this parameter if
+            you simply want to specify your own content via the extralines
+            parameter.
+        install: dict mapping entries in srcfiles to a tuple of two elements:
+            install path (*without* ${D} prefix) and permission value (as a
+            string, e.g. '0644').
+        wildcardver: True to use a % wildcard in the bbappend filename, or
+            False to make the bbappend specific to the recipe version.
+        machine:
+            If specified, make the changes in the bbappend specific to this
+            machine. This will also cause PACKAGE_ARCH = "${MACHINE_ARCH}"
+            to be added to the bbappend.
+        extralines:
+            Extra lines to add to the bbappend. This may be a dict of name
+            value pairs, or simply a list of the lines.
+        removevalues:
+            Variable values to remove - a dict of names/values.
+    """
+
+    if not removevalues:
+        removevalues = {}
+
+    # Determine how the bbappend should be named
+    appendpath, pathok = get_bbappend_path(rd, destlayerdir, wildcardver)
+    if not appendpath:
+        bb.error('Unable to determine layer directory containing %s' % recipefile)
+        return (None, None)
+    if not pathok:
+        bb.warn('Unable to determine correct subdirectory path for bbappend file - check that what %s adds to BBFILES also matches .bbappend files. Using %s for now, but until you fix this the bbappend will not be applied.' % (os.path.join(destlayerdir, 'conf', 'layer.conf'), os.path.dirname(appendpath)))
+
+    appenddir = os.path.dirname(appendpath)
+    bb.utils.mkdirhier(appenddir)
+
+    # FIXME check if the bbappend doesn't get overridden by a higher priority layer?
+
+    layerdirs = [os.path.abspath(layerdir) for layerdir in rd.getVar('BBLAYERS', True).split()]
+    if not os.path.abspath(destlayerdir) in layerdirs:
+        bb.warn('Specified layer is not currently enabled in bblayers.conf, you will need to add it before this bbappend will be active')
+
+    bbappendlines = []
+    if extralines:
+        if isinstance(extralines, dict):
+            for name, value in extralines.iteritems():
+                bbappendlines.append((name, '=', value))
+        else:
+            # Do our best to split it
+            for line in extralines:
+                if line[-1] == '\n':
+                    line = line[:-1]
+                splitline = line.split(None, 2)
+                if len(splitline) == 3:
+                    bbappendlines.append(tuple(splitline))
+                else:
+                    raise Exception('Invalid extralines value passed')
+
+    def popline(varname):
+        for i in xrange(0, len(bbappendlines)):
+            if bbappendlines[i][0] == varname:
+                line = bbappendlines.pop(i)
+                return line
+        return None
+
+    def appendline(varname, op, value):
+        for i in xrange(0, len(bbappendlines)):
+            item = bbappendlines[i]
+            if item[0] == varname:
+                bbappendlines[i] = (item[0], item[1], item[2] + ' ' + value)
+                break
+        else:
+            bbappendlines.append((varname, op, value))
+
+    destsubdir = rd.getVar('PN', True)
+    if srcfiles:
+        bbappendlines.append(('FILESEXTRAPATHS_prepend', ':=', '${THISDIR}/${PN}:'))
+
+    appendoverride = ''
+    if machine:
+        bbappendlines.append(('PACKAGE_ARCH', '=', '${MACHINE_ARCH}'))
+        appendoverride = '_%s' % machine
+    copyfiles = {}
+    if srcfiles:
+        instfunclines = []
+        for newfile, origsrcfile in srcfiles.iteritems():
+            srcfile = origsrcfile
+            srcurientry = None
+            if not srcfile:
+                srcfile = os.path.basename(newfile)
+                srcurientry = 'file://%s' % srcfile
+                # Double-check it's not there already
+                # FIXME do we care if the entry is added by another bbappend that might go away?
+                if not srcurientry in rd.getVar('SRC_URI', True).split():
+                    if machine:
+                        appendline('SRC_URI_append%s' % appendoverride, '=', ' ' + srcurientry)
+                    else:
+                        appendline('SRC_URI', '+=', srcurientry)
+            copyfiles[newfile] = srcfile
+            if install:
+                institem = install.pop(newfile, None)
+                if institem:
+                    (destpath, perms) = institem
+                    instdestpath = replace_dir_vars(destpath, rd)
+                    instdirline = 'install -d ${D}%s' % os.path.dirname(instdestpath)
+                    if not instdirline in instfunclines:
+                        instfunclines.append(instdirline)
+                    instfunclines.append('install -m %s ${WORKDIR}/%s ${D}%s' % (perms, os.path.basename(srcfile), instdestpath))
+        if instfunclines:
+            bbappendlines.append(('do_install_append%s()' % appendoverride, '', instfunclines))
+
+    bb.note('Writing append file %s' % appendpath)
+
+    if os.path.exists(appendpath):
+        # Work around lack of nonlocal in python 2
+        extvars = {'destsubdir': destsubdir}
+
+        def appendfile_varfunc(varname, origvalue, op, newlines):
+            if varname == 'FILESEXTRAPATHS_prepend':
+                if origvalue.startswith('${THISDIR}/'):
+                    popline('FILESEXTRAPATHS_prepend')
+                    extvars['destsubdir'] = rd.expand(origvalue.split('${THISDIR}/', 1)[1].rstrip(':'))
+            elif varname == 'PACKAGE_ARCH':
+                if machine:
+                    popline('PACKAGE_ARCH')
+                    return (machine, None, 4, False)
+            elif varname.startswith('do_install_append'):
+                func = popline(varname)
+                if func:
+                    instfunclines = [line.strip() for line in origvalue.strip('\n').splitlines()]
+                    for line in func[2]:
+                        if not line in instfunclines:
+                            instfunclines.append(line)
+                    return (instfunclines, None, 4, False)
+            else:
+                splitval = origvalue.split()
+                changed = False
+                removevar = varname
+                if varname in ['SRC_URI', 'SRC_URI_append%s' % appendoverride]:
+                    removevar = 'SRC_URI'
+                    line = popline(varname)
+                    if line:
+                        if line[2] not in splitval:
+                            splitval.append(line[2])
+                            changed = True
+                else:
+                    line = popline(varname)
+                    if line:
+                        splitval = [line[2]]
+                        changed = True
+
+                if removevar in removevalues:
+                    remove = removevalues[removevar]
+                    if isinstance(remove, basestring):
+                        if remove in splitval:
+                            splitval.remove(remove)
+                            changed = True
+                    else:
+                        for removeitem in remove:
+                            if removeitem in splitval:
+                                splitval.remove(removeitem)
+                                changed = True
+
+                if changed:
+                    newvalue = splitval
+                    if len(newvalue) == 1:
+                        # Ensure it's written out as one line
+                        if '_append' in varname:
+                            newvalue = ' ' + newvalue[0]
+                        else:
+                            newvalue = newvalue[0]
+                    if not newvalue and (op in ['+=', '.='] or '_append' in varname):
+                        # There's no point appending nothing
+                        newvalue = None
+                    if varname.endswith('()'):
+                        indent = 4
+                    else:
+                        indent = -1
+                    return (newvalue, None, indent, True)
+            return (origvalue, None, 4, False)
+
+        varnames = [item[0] for item in bbappendlines]
+        if removevalues:
+            varnames.extend(removevalues.keys())
+
+        with open(appendpath, 'r') as f:
+            (updated, newlines) = bb.utils.edit_metadata(f, varnames, appendfile_varfunc)
+
+        destsubdir = extvars['destsubdir']
+    else:
+        updated = False
+        newlines = []
+
+    if bbappendlines:
+        for line in bbappendlines:
+            if line[0].endswith('()'):
+                newlines.append('%s {\n    %s\n}\n' % (line[0], '\n    '.join(line[2])))
+            else:
+                newlines.append('%s %s "%s"\n\n' % line)
+        updated = True
+
+    if updated:
+        with open(appendpath, 'w') as f:
+            f.writelines(newlines)
+
+    if copyfiles:
+        if machine:
+            destsubdir = os.path.join(destsubdir, machine)
+        for newfile, srcfile in copyfiles.iteritems():
+            filedest = os.path.join(appenddir, destsubdir, os.path.basename(srcfile))
+            if os.path.abspath(newfile) != os.path.abspath(filedest):
+                bb.note('Copying %s to %s' % (newfile, filedest))
+                bb.utils.mkdirhier(os.path.dirname(filedest))
+                shutil.copyfile(newfile, filedest)
+
+    return (appendpath, os.path.join(appenddir, destsubdir))
+
+
+def find_layerdir(fn):
+    """ Figure out relative path to base of layer for a file (e.g. a recipe)"""
+    pth = os.path.dirname(fn)
+    layerdir = ''
+    while pth:
+        if os.path.exists(os.path.join(pth, 'conf', 'layer.conf')):
+            layerdir = pth
+            break
+        pth = os.path.dirname(pth)
+    return layerdir
+
+
+def replace_dir_vars(path, d):
+    """Replace common directory paths with appropriate variable references (e.g. /etc becomes ${sysconfdir})"""
+    dirvars = {}
+    # Sort by length so we get the variables we're interested in first
+    for var in sorted(d.keys(), key=len):
+        if var.endswith('dir') and var.lower() == var:
+            value = d.getVar(var, True)
+            if value.startswith('/') and not '\n' in value and value not in dirvars:
+                dirvars[value] = var
+    for dirpath in sorted(dirvars.keys(), reverse=True):
+        path = path.replace(dirpath, '${%s}' % dirvars[dirpath])
+    return path
+
+def get_recipe_pv_without_srcpv(pv, uri_type):
+    """
+    Get PV without SRCPV common in SCM's for now only
+    support git.
+
+    Returns tuple with pv, prefix and suffix.
+    """
+    pfx = ''
+    sfx = ''
+
+    if uri_type == 'git':
+        git_regex = re.compile("(?P<pfx>v?)(?P<ver>[^\+]*)((?P<sfx>\+(git)?r?(AUTOINC\+))(?P<rev>.*))?")
+        m = git_regex.match(pv)
+
+        if m:
+            pv = m.group('ver')
+            pfx = m.group('pfx')
+            sfx = m.group('sfx')
+    else:
+        regex = re.compile("(?P<pfx>(v|r)?)(?P<ver>.*)")
+        m = regex.match(pv)
+        if m:
+            pv = m.group('ver')
+            pfx = m.group('pfx')
+
+    return (pv, pfx, sfx)
+
+def get_recipe_upstream_version(rd):
+    """
+        Get upstream version of recipe using bb.fetch2 methods with support for
+        http, https, ftp and git.
+
+        bb.fetch2 exceptions can be raised,
+            FetchError when don't have network access or upstream site don't response.
+            NoMethodError when uri latest_versionstring method isn't implemented.
+
+        Returns a dictonary with version, type and datetime.
+        Type can be A for Automatic, M for Manual and U for Unknown.
+    """
+    from bb.fetch2 import decodeurl
+    from datetime import datetime
+
+    ru = {}
+    ru['version'] = ''
+    ru['type'] = 'U'
+    ru['datetime'] = ''
+
+    # XXX: If don't have SRC_URI means that don't have upstream sources so
+    # returns 1.0.
+    src_uris = rd.getVar('SRC_URI', True)
+    if not src_uris:
+        ru['version'] = '1.0'
+        ru['type'] = 'M'
+        ru['datetime'] = datetime.now()
+        return ru
+
+    # XXX: we suppose that the first entry points to the upstream sources
+    src_uri = src_uris.split()[0]
+    uri_type, _, _, _, _, _ =  decodeurl(src_uri)
+
+    pv = rd.getVar('PV', True)
+
+    manual_upstream_version = rd.getVar("RECIPE_UPSTREAM_VERSION", True)
+    if manual_upstream_version:
+        # manual tracking of upstream version.
+        ru['version'] = manual_upstream_version
+        ru['type'] = 'M'
+
+        manual_upstream_date = rd.getVar("CHECK_DATE", True)
+        if manual_upstream_date:
+            date = datetime.strptime(manual_upstream_date, "%b %d, %Y")
+        else:
+            date = datetime.now()
+        ru['datetime'] = date
+
+    elif uri_type == "file":
+        # files are always up-to-date
+        ru['version'] =  pv
+        ru['type'] = 'A'
+        ru['datetime'] = datetime.now()
+    else:
+        ud = bb.fetch2.FetchData(src_uri, rd)
+        pupver = ud.method.latest_versionstring(ud, rd)
+        (upversion, revision) = pupver
+
+        # format git version version+gitAUTOINC+HASH
+        if uri_type == 'git':
+            (pv, pfx, sfx) = get_recipe_pv_without_srcpv(pv, uri_type)
+
+            # if contains revision but not upversion use current pv
+            if upversion == '' and revision:
+                upversion = pv
+
+            if upversion:
+                tmp = upversion
+                upversion = ''
+
+                if pfx:
+                    upversion = pfx + tmp
+                else:
+                    upversion = tmp
+
+                if sfx:
+                    upversion = upversion + sfx + revision[:10]
+
+        if upversion:
+            ru['version'] = upversion
+            ru['type'] = 'A'
+
+        ru['datetime'] = datetime.now()
+
+    return ru
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
new file mode 100644
index 0000000..3b53fce
--- /dev/null
+++ b/meta/lib/oe/rootfs.py
@@ -0,0 +1,984 @@
+from abc import ABCMeta, abstractmethod
+from oe.utils import execute_pre_post_process
+from oe.package_manager import *
+from oe.manifest import *
+import oe.path
+import filecmp
+import shutil
+import os
+import subprocess
+import re
+
+
+class Rootfs(object):
+    """
+    This is an abstract class. Do not instantiate this directly.
+    """
+    __metaclass__ = ABCMeta
+
+    def __init__(self, d):
+        self.d = d
+        self.pm = None
+        self.image_rootfs = self.d.getVar('IMAGE_ROOTFS', True)
+        self.deploy_dir_image = self.d.getVar('DEPLOY_DIR_IMAGE', True)
+
+        self.install_order = Manifest.INSTALL_ORDER
+
+    @abstractmethod
+    def _create(self):
+        pass
+
+    @abstractmethod
+    def _get_delayed_postinsts(self):
+        pass
+
+    @abstractmethod
+    def _save_postinsts(self):
+        pass
+
+    @abstractmethod
+    def _log_check(self):
+        pass
+
+    def _log_check_warn(self):
+        r = re.compile('^(warn|Warn|NOTE: warn|NOTE: Warn|WARNING:)')
+        log_path = self.d.expand("${T}/log.do_rootfs")
+        with open(log_path, 'r') as log:
+            for line in log:
+                if 'log_check' in line or 'NOTE:' in line:
+                    continue
+
+                m = r.search(line)
+                if m:
+                    bb.warn('[log_check] %s: found a warning message in the logfile (keyword \'%s\'):\n[log_check] %s'
+				    % (self.d.getVar('PN', True), m.group(), line))
+
+    def _log_check_error(self):
+        r = re.compile(self.log_check_regex)
+        log_path = self.d.expand("${T}/log.do_rootfs")
+        with open(log_path, 'r') as log:
+            found_error = 0
+            message = "\n"
+            for line in log:
+                if 'log_check' in line:
+                    continue
+
+                m = r.search(line)
+                if m:
+                    found_error = 1
+                    bb.warn('[log_check] %s: found an error message in the logfile (keyword \'%s\'):\n[log_check] %s'
+				    % (self.d.getVar('PN', True), m.group(), line))
+
+                if found_error >= 1 and found_error <= 5:
+                    message += line + '\n'
+                    found_error += 1
+
+                if found_error == 6:
+                    bb.fatal(message)
+
+    def _insert_feed_uris(self):
+        if bb.utils.contains("IMAGE_FEATURES", "package-management",
+                         True, False, self.d):
+            self.pm.insert_feeds_uris()
+
+    @abstractmethod
+    def _handle_intercept_failure(self, failed_script):
+        pass
+
+    """
+    The _cleanup() method should be used to clean-up stuff that we don't really
+    want to end up on target. For example, in the case of RPM, the DB locks.
+    The method is called, once, at the end of create() method.
+    """
+    @abstractmethod
+    def _cleanup(self):
+        pass
+
+    def _setup_dbg_rootfs(self, dirs):
+        gen_debugfs = self.d.getVar('IMAGE_GEN_DEBUGFS', True) or '0'
+        if gen_debugfs != '1':
+           return
+
+        bb.note("  Renaming the original rootfs...")
+        try:
+            shutil.rmtree(self.image_rootfs + '-orig')
+        except:
+            pass
+        os.rename(self.image_rootfs, self.image_rootfs + '-orig')
+
+        bb.note("  Creating debug rootfs...")
+        bb.utils.mkdirhier(self.image_rootfs)
+
+        bb.note("  Copying back package database...")
+        for dir in dirs:
+            bb.utils.mkdirhier(self.image_rootfs + os.path.dirname(dir))
+            shutil.copytree(self.image_rootfs + '-orig' + dir, self.image_rootfs + dir)
+
+        cpath = oe.cachedpath.CachedPath()
+        # Copy files located in /usr/lib/debug or /usr/src/debug
+        for dir in ["/usr/lib/debug", "/usr/src/debug"]:
+            src = self.image_rootfs + '-orig' + dir
+            if cpath.exists(src):
+                dst = self.image_rootfs + dir
+                bb.utils.mkdirhier(os.path.dirname(dst))
+                shutil.copytree(src, dst)
+
+        # Copy files with suffix '.debug' or located in '.debug' dir.
+        for root, dirs, files in cpath.walk(self.image_rootfs + '-orig'):
+            relative_dir = root[len(self.image_rootfs + '-orig'):]
+            for f in files:
+                if f.endswith('.debug') or '/.debug' in relative_dir:
+                    bb.utils.mkdirhier(self.image_rootfs + relative_dir)
+                    shutil.copy(os.path.join(root, f),
+                                self.image_rootfs + relative_dir)
+
+        bb.note("  Install complementary '*-dbg' packages...")
+        self.pm.install_complementary('*-dbg')
+
+        bb.note("  Rename debug rootfs...")
+        try:
+            shutil.rmtree(self.image_rootfs + '-dbg')
+        except:
+            pass
+        os.rename(self.image_rootfs, self.image_rootfs + '-dbg')
+
+        bb.note("  Restoreing original rootfs...")
+        os.rename(self.image_rootfs + '-orig', self.image_rootfs)
+
+    def _exec_shell_cmd(self, cmd):
+        fakerootcmd = self.d.getVar('FAKEROOT', True)
+        if fakerootcmd is not None:
+            exec_cmd = [fakerootcmd, cmd]
+        else:
+            exec_cmd = cmd
+
+        try:
+            subprocess.check_output(exec_cmd, stderr=subprocess.STDOUT)
+        except subprocess.CalledProcessError as e:
+            return("Command '%s' returned %d:\n%s" % (e.cmd, e.returncode, e.output))
+
+        return None
+
+    def create(self):
+        bb.note("###### Generate rootfs #######")
+        pre_process_cmds = self.d.getVar("ROOTFS_PREPROCESS_COMMAND", True)
+        post_process_cmds = self.d.getVar("ROOTFS_POSTPROCESS_COMMAND", True)
+
+        postinst_intercepts_dir = self.d.getVar("POSTINST_INTERCEPTS_DIR", True)
+        if not postinst_intercepts_dir:
+            postinst_intercepts_dir = self.d.expand("${COREBASE}/scripts/postinst-intercepts")
+        intercepts_dir = os.path.join(self.d.getVar('WORKDIR', True),
+                                      "intercept_scripts")
+
+        bb.utils.remove(intercepts_dir, True)
+
+        bb.utils.mkdirhier(self.image_rootfs)
+
+        bb.utils.mkdirhier(self.deploy_dir_image)
+
+        shutil.copytree(postinst_intercepts_dir, intercepts_dir)
+
+        shutil.copy(self.d.expand("${COREBASE}/meta/files/deploydir_readme.txt"),
+                    self.deploy_dir_image +
+                    "/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt")
+
+        execute_pre_post_process(self.d, pre_process_cmds)
+
+        # call the package manager dependent create method
+        self._create()
+
+        sysconfdir = self.image_rootfs + self.d.getVar('sysconfdir', True)
+        bb.utils.mkdirhier(sysconfdir)
+        with open(sysconfdir + "/version", "w+") as ver:
+            ver.write(self.d.getVar('BUILDNAME', True) + "\n")
+
+        self._run_intercepts()
+
+        execute_pre_post_process(self.d, post_process_cmds)
+
+        if bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
+                         True, False, self.d):
+            delayed_postinsts = self._get_delayed_postinsts()
+            if delayed_postinsts is not None:
+                bb.fatal("The following packages could not be configured "
+                         "offline and rootfs is read-only: %s" %
+                         delayed_postinsts)
+
+        if self.d.getVar('USE_DEVFS', True) != "1":
+            self._create_devfs()
+
+        self._uninstall_unneeded()
+
+        self._insert_feed_uris()
+
+        self._run_ldconfig()
+
+        if self.d.getVar('USE_DEPMOD', True) != "0":
+            self._generate_kernel_module_deps()
+
+        self._cleanup()
+        self._log_check()
+
+    def _uninstall_unneeded(self):
+        # Remove unneeded init script symlinks
+        delayed_postinsts = self._get_delayed_postinsts()
+        if delayed_postinsts is None:
+            if os.path.exists(self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/init.d/run-postinsts")):
+                self._exec_shell_cmd(["update-rc.d", "-f", "-r",
+                                      self.d.getVar('IMAGE_ROOTFS', True),
+                                      "run-postinsts", "remove"])
+
+        runtime_pkgmanage = bb.utils.contains("IMAGE_FEATURES", "package-management",
+                         True, False, self.d)
+        sysvcompat_in_distro = bb.utils.contains("DISTRO_FEATURES", [ "systemd", "sysvinit" ],
+                         True, False, self.d)
+        image_rorfs = bb.utils.contains("IMAGE_FEATURES", "read-only-rootfs",
+                         True, False, self.d)
+        if sysvcompat_in_distro and not image_rorfs:
+            pkg_to_remove = ""
+        else:
+            pkg_to_remove = "update-rc.d"
+        if not runtime_pkgmanage:
+            # Remove components that we don't need if we're not going to install
+            # additional packages at runtime
+            if delayed_postinsts is None:
+                installed_pkgs_dir = self.d.expand('${WORKDIR}/installed_pkgs.txt')
+                pkgs_to_remove = list()
+                with open(installed_pkgs_dir, "r+") as installed_pkgs:
+                    pkgs_installed = installed_pkgs.read().splitlines()
+                    for pkg_installed in pkgs_installed[:]:
+                        pkg = pkg_installed.split()[0]
+                        if pkg in ["update-rc.d",
+                                "base-passwd",
+                                "shadow",
+                                "update-alternatives", pkg_to_remove,
+                                self.d.getVar("ROOTFS_BOOTSTRAP_INSTALL", True)
+                                ]:
+                            pkgs_to_remove.append(pkg)
+                            pkgs_installed.remove(pkg_installed)
+
+                if len(pkgs_to_remove) > 0:
+                    self.pm.remove(pkgs_to_remove, False)
+                    # Update installed_pkgs.txt
+                    open(installed_pkgs_dir, "w+").write('\n'.join(pkgs_installed))
+
+            else:
+                self._save_postinsts()
+
+        post_uninstall_cmds = self.d.getVar("ROOTFS_POSTUNINSTALL_COMMAND", True)
+        execute_pre_post_process(self.d, post_uninstall_cmds)
+
+        if not runtime_pkgmanage:
+            # Remove the package manager data files
+            self.pm.remove_packaging_data()
+
+    def _run_intercepts(self):
+        intercepts_dir = os.path.join(self.d.getVar('WORKDIR', True),
+                                      "intercept_scripts")
+
+        bb.note("Running intercept scripts:")
+        os.environ['D'] = self.image_rootfs
+        for script in os.listdir(intercepts_dir):
+            script_full = os.path.join(intercepts_dir, script)
+
+            if script == "postinst_intercept" or not os.access(script_full, os.X_OK):
+                continue
+
+            bb.note("> Executing %s intercept ..." % script)
+
+            try:
+                subprocess.check_call(script_full)
+            except subprocess.CalledProcessError as e:
+                bb.warn("The postinstall intercept hook '%s' failed (exit code: %d)! See log for details!" %
+                        (script, e.returncode))
+
+                with open(script_full) as intercept:
+                    registered_pkgs = None
+                    for line in intercept.read().split("\n"):
+                        m = re.match("^##PKGS:(.*)", line)
+                        if m is not None:
+                            registered_pkgs = m.group(1).strip()
+                            break
+
+                    if registered_pkgs is not None:
+                        bb.warn("The postinstalls for the following packages "
+                                "will be postponed for first boot: %s" %
+                                registered_pkgs)
+
+                        # call the backend dependent handler
+                        self._handle_intercept_failure(registered_pkgs)
+
+    def _run_ldconfig(self):
+        if self.d.getVar('LDCONFIGDEPEND', True):
+            bb.note("Executing: ldconfig -r" + self.image_rootfs + "-c new -v")
+            self._exec_shell_cmd(['ldconfig', '-r', self.image_rootfs, '-c',
+                                  'new', '-v'])
+
+    def _check_for_kernel_modules(self, modules_dir):
+        for root, dirs, files in os.walk(modules_dir, topdown=True):
+            for name in files:
+                found_ko = name.endswith(".ko")
+                if found_ko:
+                    return found_ko
+        return False
+
+    def _generate_kernel_module_deps(self):
+        modules_dir = os.path.join(self.image_rootfs, 'lib', 'modules')
+        # if we don't have any modules don't bother to do the depmod
+        if not self._check_for_kernel_modules(modules_dir):
+            bb.note("No Kernel Modules found, not running depmod")
+            return
+
+        kernel_abi_ver_file = oe.path.join(self.d.getVar('PKGDATA_DIR', True), "kernel-depmod",
+                                           'kernel-abiversion')
+        if not os.path.exists(kernel_abi_ver_file):
+            bb.fatal("No kernel-abiversion file found (%s), cannot run depmod, aborting" % kernel_abi_ver_file)
+
+        kernel_ver = open(kernel_abi_ver_file).read().strip(' \n')
+        versioned_modules_dir = os.path.join(self.image_rootfs, modules_dir, kernel_ver)
+
+        bb.utils.mkdirhier(versioned_modules_dir)
+
+        self._exec_shell_cmd(['depmodwrapper', '-a', '-b', self.image_rootfs, kernel_ver])
+
+    """
+    Create devfs:
+    * IMAGE_DEVICE_TABLE is the old name to an absolute path to a device table file
+    * IMAGE_DEVICE_TABLES is a new name for a file, or list of files, seached
+      for in the BBPATH
+    If neither are specified then the default name of files/device_table-minimal.txt
+    is searched for in the BBPATH (same as the old version.)
+    """
+    def _create_devfs(self):
+        devtable_list = []
+        devtable = self.d.getVar('IMAGE_DEVICE_TABLE', True)
+        if devtable is not None:
+            devtable_list.append(devtable)
+        else:
+            devtables = self.d.getVar('IMAGE_DEVICE_TABLES', True)
+            if devtables is None:
+                devtables = 'files/device_table-minimal.txt'
+            for devtable in devtables.split():
+                devtable_list.append("%s" % bb.utils.which(self.d.getVar('BBPATH', True), devtable))
+
+        for devtable in devtable_list:
+            self._exec_shell_cmd(["makedevs", "-r",
+                                  self.image_rootfs, "-D", devtable])
+
+
+class RpmRootfs(Rootfs):
+    def __init__(self, d, manifest_dir):
+        super(RpmRootfs, self).__init__(d)
+        self.log_check_regex = '(unpacking of archive failed|Cannot find package'\
+                               '|exit 1|ERROR: |Error: |Error |ERROR '\
+                               '|Failed |Failed: |Failed$|Failed\(\d+\):)'
+        self.manifest = RpmManifest(d, manifest_dir)
+
+        self.pm = RpmPM(d,
+                        d.getVar('IMAGE_ROOTFS', True),
+                        self.d.getVar('TARGET_VENDOR', True)
+                        )
+
+        self.inc_rpm_image_gen = self.d.getVar('INC_RPM_IMAGE_GEN', True)
+        if self.inc_rpm_image_gen != "1":
+            bb.utils.remove(self.image_rootfs, True)
+        else:
+            self.pm.recovery_packaging_data()
+        bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS', True), True)
+
+        self.pm.create_configs()
+
+    '''
+    While rpm incremental image generation is enabled, it will remove the
+    unneeded pkgs by comparing the new install solution manifest and the
+    old installed manifest.
+    '''
+    def _create_incremental(self, pkgs_initial_install):
+        if self.inc_rpm_image_gen == "1":
+
+            pkgs_to_install = list()
+            for pkg_type in pkgs_initial_install:
+                pkgs_to_install += pkgs_initial_install[pkg_type]
+
+            installed_manifest = self.pm.load_old_install_solution()
+            solution_manifest = self.pm.dump_install_solution(pkgs_to_install)
+
+            pkg_to_remove = list()
+            for pkg in installed_manifest:
+                if pkg not in solution_manifest:
+                    pkg_to_remove.append(pkg)
+
+            self.pm.update()
+
+            bb.note('incremental update -- upgrade packages in place ')
+            self.pm.upgrade()
+            if pkg_to_remove != []:
+                bb.note('incremental removed: %s' % ' '.join(pkg_to_remove))
+                self.pm.remove(pkg_to_remove)
+
+    def _create(self):
+        pkgs_to_install = self.manifest.parse_initial_manifest()
+        rpm_pre_process_cmds = self.d.getVar('RPM_PREPROCESS_COMMANDS', True)
+        rpm_post_process_cmds = self.d.getVar('RPM_POSTPROCESS_COMMANDS', True)
+
+        # update PM index files
+        self.pm.write_index()
+
+        execute_pre_post_process(self.d, rpm_pre_process_cmds)
+
+        self.pm.dump_all_available_pkgs()
+
+        if self.inc_rpm_image_gen == "1":
+            self._create_incremental(pkgs_to_install)
+
+        self.pm.update()
+
+        pkgs = []
+        pkgs_attempt = []
+        for pkg_type in pkgs_to_install:
+            if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+                pkgs_attempt += pkgs_to_install[pkg_type]
+            else:
+                pkgs += pkgs_to_install[pkg_type]
+
+        self.pm.install(pkgs)
+
+        self.pm.install(pkgs_attempt, True)
+
+        self.pm.install_complementary()
+
+        self._setup_dbg_rootfs(['/etc/rpm', '/var/lib/rpm', '/var/lib/smart'])
+
+        execute_pre_post_process(self.d, rpm_post_process_cmds)
+
+        self._log_check()
+
+        if self.inc_rpm_image_gen == "1":
+            self.pm.backup_packaging_data()
+
+        self.pm.rpm_setup_smart_target_config()
+
+    @staticmethod
+    def _depends_list():
+        return ['DEPLOY_DIR_RPM', 'INC_RPM_IMAGE_GEN', 'RPM_PREPROCESS_COMMANDS',
+                'RPM_POSTPROCESS_COMMANDS', 'RPM_PREFER_ELF_ARCH']
+
+    def _get_delayed_postinsts(self):
+        postinst_dir = self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts")
+        if os.path.isdir(postinst_dir):
+            files = os.listdir(postinst_dir)
+            for f in files:
+                bb.note('Delayed package scriptlet: %s' % f)
+            return files
+
+        return None
+
+    def _save_postinsts(self):
+        # this is just a stub. For RPM, the failed postinstalls are
+        # already saved in /etc/rpm-postinsts
+        pass
+
+    def _log_check_error(self):
+        r = re.compile('(unpacking of archive failed|Cannot find package|exit 1|ERR|Fail)')
+        log_path = self.d.expand("${T}/log.do_rootfs")
+        with open(log_path, 'r') as log:
+            found_error = 0
+            message = "\n"
+            for line in log.read().split('\n'):
+                if 'log_check' in line:
+                    continue
+                # sh -x may emit code which isn't actually executed
+                if line.startswith('+'):
+		    continue
+
+                m = r.search(line)
+                if m:
+                    found_error = 1
+                    bb.warn('log_check: There were error messages in the logfile')
+                    bb.warn('log_check: Matched keyword: [%s]\n\n' % m.group())
+
+                if found_error >= 1 and found_error <= 5:
+                    message += line + '\n'
+                    found_error += 1
+
+                if found_error == 6:
+                    bb.fatal(message)
+
+    def _log_check(self):
+        self._log_check_warn()
+        self._log_check_error()
+
+    def _handle_intercept_failure(self, registered_pkgs):
+        rpm_postinsts_dir = self.image_rootfs + self.d.expand('${sysconfdir}/rpm-postinsts/')
+        bb.utils.mkdirhier(rpm_postinsts_dir)
+
+        # Save the package postinstalls in /etc/rpm-postinsts
+        for pkg in registered_pkgs.split():
+            self.pm.save_rpmpostinst(pkg)
+
+    def _cleanup(self):
+        # during the execution of postprocess commands, rpm is called several
+        # times to get the files installed, dependencies, etc. This creates the
+        # __db.00* (Berkeley DB files that hold locks, rpm specific environment
+        # settings, etc.), that should not get into the final rootfs
+        self.pm.unlock_rpm_db()
+        if os.path.isdir(self.pm.install_dir_path + "/tmp") and not os.listdir(self.pm.install_dir_path + "/tmp"):
+           bb.utils.remove(self.pm.install_dir_path + "/tmp", True)
+        if os.path.isdir(self.pm.install_dir_path) and not os.listdir(self.pm.install_dir_path):
+           bb.utils.remove(self.pm.install_dir_path, True)
+
+class DpkgOpkgRootfs(Rootfs):
+    def __init__(self, d):
+        super(DpkgOpkgRootfs, self).__init__(d)
+
+    def _get_pkgs_postinsts(self, status_file):
+        def _get_pkg_depends_list(pkg_depends):
+            pkg_depends_list = []
+            # filter version requirements like libc (>= 1.1)
+            for dep in pkg_depends.split(', '):
+                m_dep = re.match("^(.*) \(.*\)$", dep)
+                if m_dep:
+                    dep = m_dep.group(1)
+                pkg_depends_list.append(dep)
+
+            return pkg_depends_list
+
+        pkgs = {}
+        pkg_name = ""
+        pkg_status_match = False
+        pkg_depends = ""
+
+        with open(status_file) as status:
+            data = status.read()
+            status.close()
+            for line in data.split('\n'):
+                m_pkg = re.match("^Package: (.*)", line)
+                m_status = re.match("^Status:.*unpacked", line)
+                m_depends = re.match("^Depends: (.*)", line)
+
+                if m_pkg is not None:
+                    if pkg_name and pkg_status_match:
+                        pkgs[pkg_name] = _get_pkg_depends_list(pkg_depends)
+
+                    pkg_name = m_pkg.group(1)
+                    pkg_status_match = False
+                    pkg_depends = ""
+                elif m_status is not None:
+                    pkg_status_match = True
+                elif m_depends is not None:
+                    pkg_depends = m_depends.group(1)
+
+        # remove package dependencies not in postinsts
+        pkg_names = pkgs.keys()
+        for pkg_name in pkg_names:
+            deps = pkgs[pkg_name][:]
+
+            for d in deps:
+                if d not in pkg_names:
+                    pkgs[pkg_name].remove(d)
+
+        return pkgs
+
+    def _get_delayed_postinsts_common(self, status_file):
+        def _dep_resolve(graph, node, resolved, seen):
+            seen.append(node)
+
+            for edge in graph[node]:
+                if edge not in resolved:
+                    if edge in seen:
+                        raise RuntimeError("Packages %s and %s have " \
+                                "a circular dependency in postinsts scripts." \
+                                % (node, edge))
+                    _dep_resolve(graph, edge, resolved, seen)
+
+            resolved.append(node)
+
+        pkg_list = []
+
+        pkgs = self._get_pkgs_postinsts(status_file)
+        if pkgs:
+            root = "__packagegroup_postinst__"
+            pkgs[root] = pkgs.keys()
+            _dep_resolve(pkgs, root, pkg_list, [])
+            pkg_list.remove(root)
+
+        if len(pkg_list) == 0:
+            return None
+
+        return pkg_list
+
+    def _save_postinsts_common(self, dst_postinst_dir, src_postinst_dir):
+        num = 0
+        for p in self._get_delayed_postinsts():
+            bb.utils.mkdirhier(dst_postinst_dir)
+
+            if os.path.exists(os.path.join(src_postinst_dir, p + ".postinst")):
+                shutil.copy(os.path.join(src_postinst_dir, p + ".postinst"),
+                            os.path.join(dst_postinst_dir, "%03d-%s" % (num, p)))
+
+            num += 1
+
+class DpkgRootfs(DpkgOpkgRootfs):
+    def __init__(self, d, manifest_dir):
+        super(DpkgRootfs, self).__init__(d)
+        self.log_check_regex = '^E:'
+
+        bb.utils.remove(self.image_rootfs, True)
+        bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS', True), True)
+        self.manifest = DpkgManifest(d, manifest_dir)
+        self.pm = DpkgPM(d, d.getVar('IMAGE_ROOTFS', True),
+                         d.getVar('PACKAGE_ARCHS', True),
+                         d.getVar('DPKG_ARCH', True))
+
+
+    def _create(self):
+        pkgs_to_install = self.manifest.parse_initial_manifest()
+        deb_pre_process_cmds = self.d.getVar('DEB_PREPROCESS_COMMANDS', True)
+        deb_post_process_cmds = self.d.getVar('DEB_POSTPROCESS_COMMANDS', True)
+
+        alt_dir = self.d.expand("${IMAGE_ROOTFS}/var/lib/dpkg/alternatives")
+        bb.utils.mkdirhier(alt_dir)
+
+        # update PM index files
+        self.pm.write_index()
+
+        execute_pre_post_process(self.d, deb_pre_process_cmds)
+
+        self.pm.update()
+
+        for pkg_type in self.install_order:
+            if pkg_type in pkgs_to_install:
+                self.pm.install(pkgs_to_install[pkg_type],
+                                [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+        self.pm.install_complementary()
+
+        self._setup_dbg_rootfs(['/var/lib/dpkg'])
+
+        self.pm.fix_broken_dependencies()
+
+        self.pm.mark_packages("installed")
+
+        self.pm.run_pre_post_installs()
+
+        execute_pre_post_process(self.d, deb_post_process_cmds)
+
+    @staticmethod
+    def _depends_list():
+        return ['DEPLOY_DIR_DEB', 'DEB_SDK_ARCH', 'APTCONF_TARGET', 'APT_ARGS', 'DPKG_ARCH', 'DEB_PREPROCESS_COMMANDS', 'DEB_POSTPROCESS_COMMANDS']
+
+    def _get_delayed_postinsts(self):
+        status_file = self.image_rootfs + "/var/lib/dpkg/status"
+        return self._get_delayed_postinsts_common(status_file)
+
+    def _save_postinsts(self):
+        dst_postinst_dir = self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/deb-postinsts")
+        src_postinst_dir = self.d.expand("${IMAGE_ROOTFS}/var/lib/dpkg/info")
+        return self._save_postinsts_common(dst_postinst_dir, src_postinst_dir)
+
+    def _handle_intercept_failure(self, registered_pkgs):
+        self.pm.mark_packages("unpacked", registered_pkgs.split())
+
+    def _log_check(self):
+        self._log_check_warn()
+        self._log_check_error()
+
+    def _cleanup(self):
+        pass
+
+
+class OpkgRootfs(DpkgOpkgRootfs):
+    def __init__(self, d, manifest_dir):
+        super(OpkgRootfs, self).__init__(d)
+        self.log_check_regex = '(exit 1|Collected errors)'
+
+        self.manifest = OpkgManifest(d, manifest_dir)
+        self.opkg_conf = self.d.getVar("IPKGCONF_TARGET", True)
+        self.pkg_archs = self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True)
+
+        self.inc_opkg_image_gen = self.d.getVar('INC_IPK_IMAGE_GEN', True) or ""
+        if self._remove_old_rootfs():
+            bb.utils.remove(self.image_rootfs, True)
+            self.pm = OpkgPM(d,
+                             self.image_rootfs,
+                             self.opkg_conf,
+                             self.pkg_archs)
+        else:
+            self.pm = OpkgPM(d,
+                             self.image_rootfs,
+                             self.opkg_conf,
+                             self.pkg_archs)
+            self.pm.recover_packaging_data()
+
+        bb.utils.remove(self.d.getVar('MULTILIB_TEMP_ROOTFS', True), True)
+
+    def _prelink_file(self, root_dir, filename):
+        bb.note('prelink %s in %s' % (filename, root_dir))
+        prelink_cfg = oe.path.join(root_dir,
+                                   self.d.expand('${sysconfdir}/prelink.conf'))
+        if not os.path.exists(prelink_cfg):
+            shutil.copy(self.d.expand('${STAGING_DIR_NATIVE}${sysconfdir_native}/prelink.conf'),
+                        prelink_cfg)
+
+        cmd_prelink = self.d.expand('${STAGING_DIR_NATIVE}${sbindir_native}/prelink')
+        self._exec_shell_cmd([cmd_prelink,
+                              '--root',
+                              root_dir,
+                              '-amR',
+                              '-N',
+                              '-c',
+                              self.d.expand('${sysconfdir}/prelink.conf')])
+
+    '''
+    Compare two files with the same key twice to see if they are equal.
+    If they are not equal, it means they are duplicated and come from
+    different packages.
+    1st: Comapre them directly;
+    2nd: While incremental image creation is enabled, one of the
+         files could be probaly prelinked in the previous image
+         creation and the file has been changed, so we need to
+         prelink the other one and compare them.
+    '''
+    def _file_equal(self, key, f1, f2):
+
+        # Both of them are not prelinked
+        if filecmp.cmp(f1, f2):
+            return True
+
+        if self.image_rootfs not in f1:
+            self._prelink_file(f1.replace(key, ''), f1)
+
+        if self.image_rootfs not in f2:
+            self._prelink_file(f2.replace(key, ''), f2)
+
+        # Both of them are prelinked
+        if filecmp.cmp(f1, f2):
+            return True
+
+        # Not equal
+        return False
+
+    """
+    This function was reused from the old implementation.
+    See commit: "image.bbclass: Added variables for multilib support." by
+    Lianhao Lu.
+    """
+    def _multilib_sanity_test(self, dirs):
+
+        allow_replace = self.d.getVar("MULTILIBRE_ALLOW_REP", True)
+        if allow_replace is None:
+            allow_replace = ""
+
+        allow_rep = re.compile(re.sub("\|$", "", allow_replace))
+        error_prompt = "Multilib check error:"
+
+        files = {}
+        for dir in dirs:
+            for root, subfolders, subfiles in os.walk(dir):
+                for file in subfiles:
+                    item = os.path.join(root, file)
+                    key = str(os.path.join("/", os.path.relpath(item, dir)))
+
+                    valid = True
+                    if key in files:
+                        #check whether the file is allow to replace
+                        if allow_rep.match(key):
+                            valid = True
+                        else:
+                            if os.path.exists(files[key]) and \
+                               os.path.exists(item) and \
+                               not self._file_equal(key, files[key], item):
+                                valid = False
+                                bb.fatal("%s duplicate files %s %s is not the same\n" %
+                                         (error_prompt, item, files[key]))
+
+                    #pass the check, add to list
+                    if valid:
+                        files[key] = item
+
+    def _multilib_test_install(self, pkgs):
+        ml_temp = self.d.getVar("MULTILIB_TEMP_ROOTFS", True)
+        bb.utils.mkdirhier(ml_temp)
+
+        dirs = [self.image_rootfs]
+
+        for variant in self.d.getVar("MULTILIB_VARIANTS", True).split():
+            ml_target_rootfs = os.path.join(ml_temp, variant)
+
+            bb.utils.remove(ml_target_rootfs, True)
+
+            ml_opkg_conf = os.path.join(ml_temp,
+                                        variant + "-" + os.path.basename(self.opkg_conf))
+
+            ml_pm = OpkgPM(self.d, ml_target_rootfs, ml_opkg_conf, self.pkg_archs)
+
+            ml_pm.update()
+            ml_pm.install(pkgs)
+
+            dirs.append(ml_target_rootfs)
+
+        self._multilib_sanity_test(dirs)
+
+    '''
+    While ipk incremental image generation is enabled, it will remove the
+    unneeded pkgs by comparing the old full manifest in previous existing
+    image and the new full manifest in the current image.
+    '''
+    def _remove_extra_packages(self, pkgs_initial_install):
+        if self.inc_opkg_image_gen == "1":
+            # Parse full manifest in previous existing image creation session
+            old_full_manifest = self.manifest.parse_full_manifest()
+
+            # Create full manifest for the current image session, the old one
+            # will be replaced by the new one.
+            self.manifest.create_full(self.pm)
+
+            # Parse full manifest in current image creation session
+            new_full_manifest = self.manifest.parse_full_manifest()
+
+            pkg_to_remove = list()
+            for pkg in old_full_manifest:
+                if pkg not in new_full_manifest:
+                    pkg_to_remove.append(pkg)
+
+            if pkg_to_remove != []:
+                bb.note('decremental removed: %s' % ' '.join(pkg_to_remove))
+                self.pm.remove(pkg_to_remove)
+
+    '''
+    Compare with previous existing image creation, if some conditions
+    triggered, the previous old image should be removed.
+    The conditions include any of 'PACKAGE_EXCLUDE, NO_RECOMMENDATIONS
+    and BAD_RECOMMENDATIONS' has been changed.
+    '''
+    def _remove_old_rootfs(self):
+        if self.inc_opkg_image_gen != "1":
+            return True
+
+        vars_list_file = self.d.expand('${T}/vars_list')
+
+        old_vars_list = ""
+        if os.path.exists(vars_list_file):
+            old_vars_list = open(vars_list_file, 'r+').read()
+
+        new_vars_list = '%s:%s:%s\n' % \
+                ((self.d.getVar('BAD_RECOMMENDATIONS', True) or '').strip(),
+                 (self.d.getVar('NO_RECOMMENDATIONS', True) or '').strip(),
+                 (self.d.getVar('PACKAGE_EXCLUDE', True) or '').strip())
+        open(vars_list_file, 'w+').write(new_vars_list)
+
+        if old_vars_list != new_vars_list:
+            return True
+
+        return False
+
+    def _create(self):
+        pkgs_to_install = self.manifest.parse_initial_manifest()
+        opkg_pre_process_cmds = self.d.getVar('OPKG_PREPROCESS_COMMANDS', True)
+        opkg_post_process_cmds = self.d.getVar('OPKG_POSTPROCESS_COMMANDS', True)
+        rootfs_post_install_cmds = self.d.getVar('ROOTFS_POSTINSTALL_COMMAND', True)
+
+        # update PM index files, unless users provide their own feeds
+        if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1":
+            self.pm.write_index()
+
+        execute_pre_post_process(self.d, opkg_pre_process_cmds)
+
+        self.pm.update()
+
+        self.pm.handle_bad_recommendations()
+
+        if self.inc_opkg_image_gen == "1":
+            self._remove_extra_packages(pkgs_to_install)
+
+        for pkg_type in self.install_order:
+            if pkg_type in pkgs_to_install:
+                # For multilib, we perform a sanity test before final install
+                # If sanity test fails, it will automatically do a bb.fatal()
+                # and the installation will stop
+                if pkg_type == Manifest.PKG_TYPE_MULTILIB:
+                    self._multilib_test_install(pkgs_to_install[pkg_type])
+
+                self.pm.install(pkgs_to_install[pkg_type],
+                                [False, True][pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY])
+
+        self.pm.install_complementary()
+
+        self._setup_dbg_rootfs(['/var/lib/opkg'])
+
+        execute_pre_post_process(self.d, opkg_post_process_cmds)
+        execute_pre_post_process(self.d, rootfs_post_install_cmds)
+
+        if self.inc_opkg_image_gen == "1":
+            self.pm.backup_packaging_data()
+
+    @staticmethod
+    def _depends_list():
+        return ['IPKGCONF_SDK', 'IPK_FEED_URIS', 'DEPLOY_DIR_IPK', 'IPKGCONF_TARGET', 'INC_IPK_IMAGE_GEN', 'OPKG_ARGS', 'OPKGLIBDIR', 'OPKG_PREPROCESS_COMMANDS', 'OPKG_POSTPROCESS_COMMANDS', 'OPKGLIBDIR']
+
+    def _get_delayed_postinsts(self):
+        status_file = os.path.join(self.image_rootfs,
+                                   self.d.getVar('OPKGLIBDIR', True).strip('/'),
+                                   "opkg", "status")
+        return self._get_delayed_postinsts_common(status_file)
+
+    def _save_postinsts(self):
+        dst_postinst_dir = self.d.expand("${IMAGE_ROOTFS}${sysconfdir}/ipk-postinsts")
+        src_postinst_dir = self.d.expand("${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/info")
+        return self._save_postinsts_common(dst_postinst_dir, src_postinst_dir)
+
+    def _handle_intercept_failure(self, registered_pkgs):
+        self.pm.mark_packages("unpacked", registered_pkgs.split())
+
+    def _log_check(self):
+        self._log_check_warn()
+        self._log_check_error()
+
+    def _cleanup(self):
+        pass
+
+def get_class_for_type(imgtype):
+    return {"rpm": RpmRootfs,
+            "ipk": OpkgRootfs,
+            "deb": DpkgRootfs}[imgtype]
+
+def variable_depends(d, manifest_dir=None):
+    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    cls = get_class_for_type(img_type)
+    return cls._depends_list()
+
+def create_rootfs(d, manifest_dir=None):
+    env_bkp = os.environ.copy()
+
+    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    if img_type == "rpm":
+        RpmRootfs(d, manifest_dir).create()
+    elif img_type == "ipk":
+        OpkgRootfs(d, manifest_dir).create()
+    elif img_type == "deb":
+        DpkgRootfs(d, manifest_dir).create()
+
+    os.environ.clear()
+    os.environ.update(env_bkp)
+
+
+def image_list_installed_packages(d, format=None, rootfs_dir=None):
+    if not rootfs_dir:
+        rootfs_dir = d.getVar('IMAGE_ROOTFS', True)
+
+    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    if img_type == "rpm":
+        return RpmPkgsList(d, rootfs_dir).list(format)
+    elif img_type == "ipk":
+        return OpkgPkgsList(d, rootfs_dir, d.getVar("IPKGCONF_TARGET", True)).list(format)
+    elif img_type == "deb":
+        return DpkgPkgsList(d, rootfs_dir).list(format)
+
+if __name__ == "__main__":
+    """
+    We should be able to run this as a standalone script, from outside bitbake
+    environment.
+    """
+    """
+    TBD
+    """
diff --git a/meta/lib/oe/sdk.py b/meta/lib/oe/sdk.py
new file mode 100644
index 0000000..53da0f0
--- /dev/null
+++ b/meta/lib/oe/sdk.py
@@ -0,0 +1,349 @@
+from abc import ABCMeta, abstractmethod
+from oe.utils import execute_pre_post_process
+from oe.manifest import *
+from oe.package_manager import *
+import os
+import shutil
+import glob
+
+
+class Sdk(object):
+    __metaclass__ = ABCMeta
+
+    def __init__(self, d, manifest_dir):
+        self.d = d
+        self.sdk_output = self.d.getVar('SDK_OUTPUT', True)
+        self.sdk_native_path = self.d.getVar('SDKPATHNATIVE', True).strip('/')
+        self.target_path = self.d.getVar('SDKTARGETSYSROOT', True).strip('/')
+        self.sysconfdir = self.d.getVar('sysconfdir', True).strip('/')
+
+        self.sdk_target_sysroot = os.path.join(self.sdk_output, self.target_path)
+        self.sdk_host_sysroot = self.sdk_output
+
+        if manifest_dir is None:
+            self.manifest_dir = self.d.getVar("SDK_DIR", True)
+        else:
+            self.manifest_dir = manifest_dir
+
+        bb.utils.remove(self.sdk_output, True)
+
+        self.install_order = Manifest.INSTALL_ORDER
+
+    @abstractmethod
+    def _populate(self):
+        pass
+
+    def populate(self):
+        bb.utils.mkdirhier(self.sdk_output)
+
+        # call backend dependent implementation
+        self._populate()
+
+        # Don't ship any libGL in the SDK
+        bb.utils.remove(os.path.join(self.sdk_output, self.sdk_native_path,
+                                     self.d.getVar('libdir_nativesdk', True).strip('/'),
+                                     "libGL*"))
+
+        # Fix or remove broken .la files
+        bb.utils.remove(os.path.join(self.sdk_output, self.sdk_native_path,
+                                     self.d.getVar('libdir_nativesdk', True).strip('/'),
+                                     "*.la"))
+
+        # Link the ld.so.cache file into the hosts filesystem
+        link_name = os.path.join(self.sdk_output, self.sdk_native_path,
+                                 self.sysconfdir, "ld.so.cache")
+        bb.utils.mkdirhier(os.path.dirname(link_name))
+        os.symlink("/etc/ld.so.cache", link_name)
+
+        execute_pre_post_process(self.d, self.d.getVar('SDK_POSTPROCESS_COMMAND', True))
+
+
+class RpmSdk(Sdk):
+    def __init__(self, d, manifest_dir=None):
+        super(RpmSdk, self).__init__(d, manifest_dir)
+
+        self.target_manifest = RpmManifest(d, self.manifest_dir,
+                                           Manifest.MANIFEST_TYPE_SDK_TARGET)
+        self.host_manifest = RpmManifest(d, self.manifest_dir,
+                                         Manifest.MANIFEST_TYPE_SDK_HOST)
+
+        target_providename = ['/bin/sh',
+                              '/bin/bash',
+                              '/usr/bin/env',
+                              '/usr/bin/perl',
+                              'pkgconfig'
+                              ]
+
+        self.target_pm = RpmPM(d,
+                               self.sdk_target_sysroot,
+                               self.d.getVar('TARGET_VENDOR', True),
+                               'target',
+                               target_providename
+                               )
+
+        sdk_providename = ['/bin/sh',
+                           '/bin/bash',
+                           '/usr/bin/env',
+                           '/usr/bin/perl',
+                           'pkgconfig',
+                           'libGL.so()(64bit)',
+                           'libGL.so'
+                           ]
+
+        self.host_pm = RpmPM(d,
+                             self.sdk_host_sysroot,
+                             self.d.getVar('SDK_VENDOR', True),
+                             'host',
+                             sdk_providename,
+                             "SDK_PACKAGE_ARCHS",
+                             "SDK_OS"
+                             )
+
+    def _populate_sysroot(self, pm, manifest):
+        pkgs_to_install = manifest.parse_initial_manifest()
+
+        pm.create_configs()
+        pm.write_index()
+        pm.dump_all_available_pkgs()
+        pm.update()
+
+        pkgs = []
+        pkgs_attempt = []
+        for pkg_type in pkgs_to_install:
+            if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+                pkgs_attempt += pkgs_to_install[pkg_type]
+            else:
+                pkgs += pkgs_to_install[pkg_type]
+
+        pm.install(pkgs)
+
+        pm.install(pkgs_attempt, True)
+
+    def _populate(self):
+        bb.note("Installing TARGET packages")
+        self._populate_sysroot(self.target_pm, self.target_manifest)
+
+        self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY', True))
+
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND", True))
+
+        self.target_pm.remove_packaging_data()
+
+        bb.note("Installing NATIVESDK packages")
+        self._populate_sysroot(self.host_pm, self.host_manifest)
+
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND", True))
+
+        self.host_pm.remove_packaging_data()
+
+        # Move host RPM library data
+        native_rpm_state_dir = os.path.join(self.sdk_output,
+                                            self.sdk_native_path,
+                                            self.d.getVar('localstatedir_nativesdk', True).strip('/'),
+                                            "lib",
+                                            "rpm"
+                                            )
+        bb.utils.mkdirhier(native_rpm_state_dir)
+        for f in glob.glob(os.path.join(self.sdk_output,
+                                        "var",
+                                        "lib",
+                                        "rpm",
+                                        "*")):
+            bb.utils.movefile(f, native_rpm_state_dir)
+
+        bb.utils.remove(os.path.join(self.sdk_output, "var"), True)
+
+        # Move host sysconfig data
+        native_sysconf_dir = os.path.join(self.sdk_output,
+                                          self.sdk_native_path,
+                                          self.d.getVar('sysconfdir',
+                                                        True).strip('/'),
+                                          )
+        bb.utils.mkdirhier(native_sysconf_dir)
+        for f in glob.glob(os.path.join(self.sdk_output, "etc", "*")):
+            bb.utils.movefile(f, native_sysconf_dir)
+        bb.utils.remove(os.path.join(self.sdk_output, "etc"), True)
+
+
+class OpkgSdk(Sdk):
+    def __init__(self, d, manifest_dir=None):
+        super(OpkgSdk, self).__init__(d, manifest_dir)
+
+        self.target_conf = self.d.getVar("IPKGCONF_TARGET", True)
+        self.host_conf = self.d.getVar("IPKGCONF_SDK", True)
+
+        self.target_manifest = OpkgManifest(d, self.manifest_dir,
+                                            Manifest.MANIFEST_TYPE_SDK_TARGET)
+        self.host_manifest = OpkgManifest(d, self.manifest_dir,
+                                          Manifest.MANIFEST_TYPE_SDK_HOST)
+
+        self.target_pm = OpkgPM(d, self.sdk_target_sysroot, self.target_conf,
+                                self.d.getVar("ALL_MULTILIB_PACKAGE_ARCHS", True))
+
+        self.host_pm = OpkgPM(d, self.sdk_host_sysroot, self.host_conf,
+                              self.d.getVar("SDK_PACKAGE_ARCHS", True))
+
+    def _populate_sysroot(self, pm, manifest):
+        pkgs_to_install = manifest.parse_initial_manifest()
+
+        if (self.d.getVar('BUILD_IMAGES_FROM_FEEDS', True) or "") != "1":
+            pm.write_index()
+
+        pm.update()
+
+        pkgs = []
+        pkgs_attempt = []
+        for pkg_type in pkgs_to_install:
+            if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+                pkgs_attempt += pkgs_to_install[pkg_type]
+            else:
+                pkgs += pkgs_to_install[pkg_type]
+
+        pm.install(pkgs)
+
+        pm.install(pkgs_attempt, True)
+
+    def _populate(self):
+        bb.note("Installing TARGET packages")
+        self._populate_sysroot(self.target_pm, self.target_manifest)
+
+        self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY', True))
+
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND", True))
+
+        bb.note("Installing NATIVESDK packages")
+        self._populate_sysroot(self.host_pm, self.host_manifest)
+
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND", True))
+
+        target_sysconfdir = os.path.join(self.sdk_target_sysroot, self.sysconfdir)
+        host_sysconfdir = os.path.join(self.sdk_host_sysroot, self.sysconfdir)
+
+        bb.utils.mkdirhier(target_sysconfdir)
+        shutil.copy(self.target_conf, target_sysconfdir)
+        os.chmod(os.path.join(target_sysconfdir,
+                              os.path.basename(self.target_conf)), 0644)
+
+        bb.utils.mkdirhier(host_sysconfdir)
+        shutil.copy(self.host_conf, host_sysconfdir)
+        os.chmod(os.path.join(host_sysconfdir,
+                              os.path.basename(self.host_conf)), 0644)
+
+        native_opkg_state_dir = os.path.join(self.sdk_output, self.sdk_native_path,
+                                             self.d.getVar('localstatedir_nativesdk', True).strip('/'),
+                                             "lib", "opkg")
+        bb.utils.mkdirhier(native_opkg_state_dir)
+        for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "opkg", "*")):
+            bb.utils.movefile(f, native_opkg_state_dir)
+
+        bb.utils.remove(os.path.join(self.sdk_output, "var"), True)
+
+
+class DpkgSdk(Sdk):
+    def __init__(self, d, manifest_dir=None):
+        super(DpkgSdk, self).__init__(d, manifest_dir)
+
+        self.target_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET", True), "apt")
+        self.host_conf_dir = os.path.join(self.d.getVar("APTCONF_TARGET", True), "apt-sdk")
+
+        self.target_manifest = DpkgManifest(d, self.manifest_dir,
+                                            Manifest.MANIFEST_TYPE_SDK_TARGET)
+        self.host_manifest = DpkgManifest(d, self.manifest_dir,
+                                          Manifest.MANIFEST_TYPE_SDK_HOST)
+
+        self.target_pm = DpkgPM(d, self.sdk_target_sysroot,
+                                self.d.getVar("PACKAGE_ARCHS", True),
+                                self.d.getVar("DPKG_ARCH", True),
+                                self.target_conf_dir)
+
+        self.host_pm = DpkgPM(d, self.sdk_host_sysroot,
+                              self.d.getVar("SDK_PACKAGE_ARCHS", True),
+                              self.d.getVar("DEB_SDK_ARCH", True),
+                              self.host_conf_dir)
+
+    def _copy_apt_dir_to(self, dst_dir):
+        staging_etcdir_native = self.d.getVar("STAGING_ETCDIR_NATIVE", True)
+
+        bb.utils.remove(dst_dir, True)
+
+        shutil.copytree(os.path.join(staging_etcdir_native, "apt"), dst_dir)
+
+    def _populate_sysroot(self, pm, manifest):
+        pkgs_to_install = manifest.parse_initial_manifest()
+
+        pm.write_index()
+        pm.update()
+
+        pkgs = []
+        pkgs_attempt = []
+        for pkg_type in pkgs_to_install:
+            if pkg_type == Manifest.PKG_TYPE_ATTEMPT_ONLY:
+                pkgs_attempt += pkgs_to_install[pkg_type]
+            else:
+                pkgs += pkgs_to_install[pkg_type]
+
+        pm.install(pkgs)
+
+        pm.install(pkgs_attempt, True)
+
+    def _populate(self):
+        bb.note("Installing TARGET packages")
+        self._populate_sysroot(self.target_pm, self.target_manifest)
+
+        self.target_pm.install_complementary(self.d.getVar('SDKIMAGE_INSTALL_COMPLEMENTARY', True))
+
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_TARGET_COMMAND", True))
+
+        self._copy_apt_dir_to(os.path.join(self.sdk_target_sysroot, "etc", "apt"))
+
+        bb.note("Installing NATIVESDK packages")
+        self._populate_sysroot(self.host_pm, self.host_manifest)
+
+        execute_pre_post_process(self.d, self.d.getVar("POPULATE_SDK_POST_HOST_COMMAND", True))
+
+        self._copy_apt_dir_to(os.path.join(self.sdk_output, self.sdk_native_path,
+                                           "etc", "apt"))
+
+        native_dpkg_state_dir = os.path.join(self.sdk_output, self.sdk_native_path,
+                                             "var", "lib", "dpkg")
+        bb.utils.mkdirhier(native_dpkg_state_dir)
+        for f in glob.glob(os.path.join(self.sdk_output, "var", "lib", "dpkg", "*")):
+            bb.utils.movefile(f, native_dpkg_state_dir)
+
+        bb.utils.remove(os.path.join(self.sdk_output, "var"), True)
+
+
+def sdk_list_installed_packages(d, target, format=None, rootfs_dir=None):
+    if rootfs_dir is None:
+        sdk_output = d.getVar('SDK_OUTPUT', True)
+        target_path = d.getVar('SDKTARGETSYSROOT', True).strip('/')
+
+        rootfs_dir = [sdk_output, os.path.join(sdk_output, target_path)][target is True]
+
+    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    if img_type == "rpm":
+        arch_var = ["SDK_PACKAGE_ARCHS", None][target is True]
+        os_var = ["SDK_OS", None][target is True]
+        return RpmPkgsList(d, rootfs_dir, arch_var, os_var).list(format)
+    elif img_type == "ipk":
+        conf_file_var = ["IPKGCONF_SDK", "IPKGCONF_TARGET"][target is True]
+        return OpkgPkgsList(d, rootfs_dir, d.getVar(conf_file_var, True)).list(format)
+    elif img_type == "deb":
+        return DpkgPkgsList(d, rootfs_dir).list(format)
+
+def populate_sdk(d, manifest_dir=None):
+    env_bkp = os.environ.copy()
+
+    img_type = d.getVar('IMAGE_PKGTYPE', True)
+    if img_type == "rpm":
+        RpmSdk(d, manifest_dir).populate()
+    elif img_type == "ipk":
+        OpkgSdk(d, manifest_dir).populate()
+    elif img_type == "deb":
+        DpkgSdk(d, manifest_dir).populate()
+
+    os.environ.clear()
+    os.environ.update(env_bkp)
+
+if __name__ == "__main__":
+    pass
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
new file mode 100644
index 0000000..cb46712
--- /dev/null
+++ b/meta/lib/oe/sstatesig.py
@@ -0,0 +1,291 @@
+import bb.siggen
+
+def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCache):
+    # Return True if we should keep the dependency, False to drop it
+    def isNative(x):
+        return x.endswith("-native")
+    def isCross(x):
+        return "-cross-" in x
+    def isNativeSDK(x):
+        return x.startswith("nativesdk-")
+    def isKernel(fn):
+        inherits = " ".join(dataCache.inherits[fn])
+        return inherits.find("/module-base.bbclass") != -1 or inherits.find("/linux-kernel-base.bbclass") != -1
+    def isPackageGroup(fn):
+        inherits = " ".join(dataCache.inherits[fn])
+        return "/packagegroup.bbclass" in inherits
+    def isAllArch(fn):
+        inherits = " ".join(dataCache.inherits[fn])
+        return "/allarch.bbclass" in inherits
+    def isImage(fn):
+        return "/image.bbclass" in " ".join(dataCache.inherits[fn])
+
+    # Always include our own inter-task dependencies
+    if recipename == depname:
+        return True
+
+    # Quilt (patch application) changing isn't likely to affect anything
+    excludelist = ['quilt-native', 'subversion-native', 'git-native']
+    if depname in excludelist and recipename != depname:
+        return False
+
+    # Exclude well defined recipe->dependency
+    if "%s->%s" % (recipename, depname) in siggen.saferecipedeps:
+        return False
+
+    # Don't change native/cross/nativesdk recipe dependencies any further
+    if isNative(recipename) or isCross(recipename) or isNativeSDK(recipename):
+        return True
+
+    # Only target packages beyond here
+
+    # allarch packagegroups are assumed to have well behaved names which don't change between architecures/tunes
+    if isPackageGroup(fn) and isAllArch(fn):
+        return False  
+
+    # Exclude well defined machine specific configurations which don't change ABI
+    if depname in siggen.abisaferecipes and not isImage(fn):
+        return False
+
+    # Kernel modules are well namespaced. We don't want to depend on the kernel's checksum
+    # if we're just doing an RRECOMMENDS_xxx = "kernel-module-*", not least because the checksum
+    # is machine specific.
+    # Therefore if we're not a kernel or a module recipe (inheriting the kernel classes)
+    # and we reccomend a kernel-module, we exclude the dependency.
+    depfn = dep.rsplit(".", 1)[0]
+    if dataCache and isKernel(depfn) and not isKernel(fn):
+        for pkg in dataCache.runrecs[fn]:
+            if " ".join(dataCache.runrecs[fn][pkg]).find("kernel-module-") != -1:
+                return False
+
+    # Default to keep dependencies
+    return True
+
+def sstate_lockedsigs(d):
+    sigs = {}
+    types = (d.getVar("SIGGEN_LOCKEDSIGS_TYPES", True) or "").split()
+    for t in types:
+        lockedsigs = (d.getVar("SIGGEN_LOCKEDSIGS_%s" % t, True) or "").split()
+        for ls in lockedsigs:
+            pn, task, h = ls.split(":", 2)
+            if pn not in sigs:
+                sigs[pn] = {}
+            sigs[pn][task] = h
+    return sigs
+
+class SignatureGeneratorOEBasic(bb.siggen.SignatureGeneratorBasic):
+    name = "OEBasic"
+    def init_rundepcheck(self, data):
+        self.abisaferecipes = (data.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE", True) or "").split()
+        self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS", True) or "").split()
+        pass
+    def rundep_check(self, fn, recipename, task, dep, depname, dataCache = None):
+        return sstate_rundepfilter(self, fn, recipename, task, dep, depname, dataCache)
+
+class SignatureGeneratorOEBasicHash(bb.siggen.SignatureGeneratorBasicHash):
+    name = "OEBasicHash"
+    def init_rundepcheck(self, data):
+        self.abisaferecipes = (data.getVar("SIGGEN_EXCLUDERECIPES_ABISAFE", True) or "").split()
+        self.saferecipedeps = (data.getVar("SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS", True) or "").split()
+        self.lockedsigs = sstate_lockedsigs(data)
+        self.lockedhashes = {}
+        self.lockedpnmap = {}
+        self.lockedhashfn = {}
+        self.machine = data.getVar("MACHINE", True)
+        self.mismatch_msgs = []
+        pass
+    def rundep_check(self, fn, recipename, task, dep, depname, dataCache = None):
+        return sstate_rundepfilter(self, fn, recipename, task, dep, depname, dataCache)
+
+    def get_taskdata(self):
+        data = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskdata()
+        return (data, self.lockedpnmap, self.lockedhashfn)
+
+    def set_taskdata(self, data):
+        coredata, self.lockedpnmap, self.lockedhashfn = data
+        super(bb.siggen.SignatureGeneratorBasicHash, self).set_taskdata(coredata)
+
+    def dump_sigs(self, dataCache, options):
+        self.dump_lockedsigs()
+        return super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigs(dataCache, options)
+
+    def get_taskhash(self, fn, task, deps, dataCache):
+        h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(fn, task, deps, dataCache)
+
+        recipename = dataCache.pkg_fn[fn]
+        self.lockedpnmap[fn] = recipename
+        self.lockedhashfn[fn] = dataCache.hashfn[fn]
+        if recipename in self.lockedsigs:
+            if task in self.lockedsigs[recipename]:
+                k = fn + "." + task
+                h_locked = self.lockedsigs[recipename][task]
+                self.lockedhashes[k] = h_locked
+                self.taskhash[k] = h_locked
+                #bb.warn("Using %s %s %s" % (recipename, task, h))
+
+                if h != h_locked:
+                    self.mismatch_msgs.append('The %s:%s sig (%s) changed, use locked sig %s to instead'
+                                          % (recipename, task, h, h_locked))
+
+                return h_locked
+        #bb.warn("%s %s %s" % (recipename, task, h))
+        return h
+
+    def dump_sigtask(self, fn, task, stampbase, runtime):
+        k = fn + "." + task
+        if k in self.lockedhashes:
+            return
+        super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime)
+
+    def dump_lockedsigs(self, sigfile=None, taskfilter=None):
+        if not sigfile:
+            sigfile = os.getcwd() + "/locked-sigs.inc"
+
+        bb.plain("Writing locked sigs to %s" % sigfile)
+        types = {}
+        for k in self.runtaskdeps:
+            if taskfilter:
+                if not k in taskfilter:
+                    continue
+            fn = k.rsplit(".",1)[0]
+            t = self.lockedhashfn[fn].split(" ")[1].split(":")[5]
+            t = 't-' + t.replace('_', '-')
+            if t not in types:
+                types[t] = []
+            types[t].append(k)
+
+        with open(sigfile, "w") as f:
+            for t in types:
+                f.write('SIGGEN_LOCKEDSIGS_%s = "\\\n' % t)
+                types[t].sort()
+                sortedk = sorted(types[t], key=lambda k: self.lockedpnmap[k.rsplit(".",1)[0]])
+                for k in sortedk:
+                    fn = k.rsplit(".",1)[0]
+                    task = k.rsplit(".",1)[1]
+                    if k not in self.taskhash:
+                        continue
+                    f.write("    " + self.lockedpnmap[fn] + ":" + task + ":" + self.taskhash[k] + " \\\n")
+                f.write('    "\n')
+            f.write('SIGGEN_LOCKEDSIGS_TYPES_%s = "%s"' % (self.machine, " ".join(types.keys())))
+
+    def checkhashes(self, missed, ret, sq_fn, sq_task, sq_hash, sq_hashfn, d):
+        checklevel = d.getVar("SIGGEN_LOCKEDSIGS_CHECK_LEVEL", True)
+        for task in range(len(sq_fn)):
+            if task not in ret:
+                for pn in self.lockedsigs:
+                    if sq_hash[task] in self.lockedsigs[pn].itervalues():
+                        self.mismatch_msgs.append("Locked sig is set for %s:%s (%s) yet not in sstate cache?"
+                                               % (pn, sq_task[task], sq_hash[task]))
+
+        if self.mismatch_msgs and checklevel == 'warn':
+            bb.warn("\n".join(self.mismatch_msgs))
+        elif self.mismatch_msgs and checklevel == 'error':
+            bb.fatal("\n".join(self.mismatch_msgs))
+
+
+# Insert these classes into siggen's namespace so it can see and select them
+bb.siggen.SignatureGeneratorOEBasic = SignatureGeneratorOEBasic
+bb.siggen.SignatureGeneratorOEBasicHash = SignatureGeneratorOEBasicHash
+
+
+def find_siginfo(pn, taskname, taskhashlist, d):
+    """ Find signature data files for comparison purposes """
+
+    import fnmatch
+    import glob
+
+    if taskhashlist:
+        hashfiles = {}
+
+    if not taskname:
+        # We have to derive pn and taskname
+        key = pn
+        splitit = key.split('.bb.')
+        taskname = splitit[1]
+        pn = os.path.basename(splitit[0]).split('_')[0]
+        if key.startswith('virtual:native:'):
+            pn = pn + '-native'
+
+    filedates = {}
+
+    # First search in stamps dir
+    localdata = d.createCopy()
+    localdata.setVar('MULTIMACH_TARGET_SYS', '*')
+    localdata.setVar('PN', pn)
+    localdata.setVar('PV', '*')
+    localdata.setVar('PR', '*')
+    localdata.setVar('EXTENDPE', '')
+    stamp = localdata.getVar('STAMP', True)
+    filespec = '%s.%s.sigdata.*' % (stamp, taskname)
+    foundall = False
+    import glob
+    for fullpath in glob.glob(filespec):
+        match = False
+        if taskhashlist:
+            for taskhash in taskhashlist:
+                if fullpath.endswith('.%s' % taskhash):
+                    hashfiles[taskhash] = fullpath
+                    if len(hashfiles) == len(taskhashlist):
+                        foundall = True
+                        break
+        else:
+            try:
+                filedates[fullpath] = os.stat(fullpath).st_mtime
+            except OSError:
+                continue
+
+    if not taskhashlist or (len(filedates) < 2 and not foundall):
+        # That didn't work, look in sstate-cache
+        hashes = taskhashlist or ['*']
+        localdata = bb.data.createCopy(d)
+        for hashval in hashes:
+            localdata.setVar('PACKAGE_ARCH', '*')
+            localdata.setVar('TARGET_VENDOR', '*')
+            localdata.setVar('TARGET_OS', '*')
+            localdata.setVar('PN', pn)
+            localdata.setVar('PV', '*')
+            localdata.setVar('PR', '*')
+            localdata.setVar('BB_TASKHASH', hashval)
+            swspec = localdata.getVar('SSTATE_SWSPEC', True)
+            if taskname in ['do_fetch', 'do_unpack', 'do_patch', 'do_populate_lic', 'do_preconfigure'] and swspec:
+                localdata.setVar('SSTATE_PKGSPEC', '${SSTATE_SWSPEC}')
+            elif pn.endswith('-native') or "-cross-" in pn or "-crosssdk-" in pn:
+                localdata.setVar('SSTATE_EXTRAPATH', "${NATIVELSBSTRING}/")
+            sstatename = taskname[3:]
+            filespec = '%s_%s.*.siginfo' % (localdata.getVar('SSTATE_PKG', True), sstatename)
+
+            if hashval != '*':
+                sstatedir = "%s/%s" % (d.getVar('SSTATE_DIR', True), hashval[:2])
+            else:
+                sstatedir = d.getVar('SSTATE_DIR', True)
+
+            for root, dirs, files in os.walk(sstatedir):
+                for fn in files:
+                    fullpath = os.path.join(root, fn)
+                    if fnmatch.fnmatch(fullpath, filespec):
+                        if taskhashlist:
+                            hashfiles[hashval] = fullpath
+                        else:
+                            try:
+                                filedates[fullpath] = os.stat(fullpath).st_mtime
+                            except:
+                                continue
+
+    if taskhashlist:
+        return hashfiles
+    else:
+        return filedates
+
+bb.siggen.find_siginfo = find_siginfo
+
+
+def sstate_get_manifest_filename(task, d):
+    """
+    Return the sstate manifest file path for a particular task.
+    Also returns the datastore that can be used to query related variables.
+    """
+    d2 = d.createCopy()
+    extrainf = d.getVarFlag("do_" + task, 'stamp-extra-info', True)
+    if extrainf:
+        d2.setVar("SSTATE_MANMACH", extrainf)
+    return (d2.expand("${SSTATE_MANFILEPREFIX}.%s" % task), d2)
diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
new file mode 100644
index 0000000..52a8913
--- /dev/null
+++ b/meta/lib/oe/terminal.py
@@ -0,0 +1,263 @@
+import logging
+import oe.classutils
+import shlex
+from bb.process import Popen, ExecutionError
+from distutils.version import LooseVersion
+
+logger = logging.getLogger('BitBake.OE.Terminal')
+
+
+class UnsupportedTerminal(Exception):
+    pass
+
+class NoSupportedTerminals(Exception):
+    pass
+
+
+class Registry(oe.classutils.ClassRegistry):
+    command = None
+
+    def __init__(cls, name, bases, attrs):
+        super(Registry, cls).__init__(name.lower(), bases, attrs)
+
+    @property
+    def implemented(cls):
+        return bool(cls.command)
+
+
+class Terminal(Popen):
+    __metaclass__ = Registry
+
+    def __init__(self, sh_cmd, title=None, env=None, d=None):
+        fmt_sh_cmd = self.format_command(sh_cmd, title)
+        try:
+            Popen.__init__(self, fmt_sh_cmd, env=env)
+        except OSError as exc:
+            import errno
+            if exc.errno == errno.ENOENT:
+                raise UnsupportedTerminal(self.name)
+            else:
+                raise
+
+    def format_command(self, sh_cmd, title):
+        fmt = {'title': title or 'Terminal', 'command': sh_cmd}
+        if isinstance(self.command, basestring):
+            return shlex.split(self.command.format(**fmt))
+        else:
+            return [element.format(**fmt) for element in self.command]
+
+class XTerminal(Terminal):
+    def __init__(self, sh_cmd, title=None, env=None, d=None):
+        Terminal.__init__(self, sh_cmd, title, env, d)
+        if not os.environ.get('DISPLAY'):
+            raise UnsupportedTerminal(self.name)
+
+class Gnome(XTerminal):
+    command = 'gnome-terminal -t "{title}" --disable-factory -x {command}'
+    priority = 2
+
+    def __init__(self, sh_cmd, title=None, env=None, d=None):
+        # Recent versions of gnome-terminal does not support non-UTF8 charset:
+        # https://bugzilla.gnome.org/show_bug.cgi?id=732127; as a workaround,
+        # clearing the LC_ALL environment variable so it uses the locale.
+        # Once fixed on the gnome-terminal project, this should be removed.
+        if os.getenv('LC_ALL'): os.putenv('LC_ALL','')
+
+        # Check version
+        vernum = check_terminal_version("gnome-terminal")
+        if vernum and LooseVersion(vernum) >= '3.10':
+            logger.debug(1, 'Gnome-Terminal 3.10 or later does not support --disable-factory')
+            self.command = 'gnome-terminal -t "{title}" -x {command}'
+        XTerminal.__init__(self, sh_cmd, title, env, d)
+
+class Mate(XTerminal):
+    command = 'mate-terminal -t "{title}" -x {command}'
+    priority = 2
+
+class Xfce(XTerminal):
+    command = 'xfce4-terminal -T "{title}" -e "{command}"'
+    priority = 2
+
+class Terminology(XTerminal):
+    command = 'terminology -T="{title}" -e {command}'
+    priority = 2
+
+class Konsole(XTerminal):
+    command = 'konsole --nofork -p tabtitle="{title}" -e {command}'
+    priority = 2
+
+    def __init__(self, sh_cmd, title=None, env=None, d=None):
+        # Check version
+        vernum = check_terminal_version("konsole")
+        if vernum and LooseVersion(vernum) < '2.0.0':
+            # Konsole from KDE 3.x
+            self.command = 'konsole -T "{title}" -e {command}'
+        XTerminal.__init__(self, sh_cmd, title, env, d)
+
+class XTerm(XTerminal):
+    command = 'xterm -T "{title}" -e {command}'
+    priority = 1
+
+class Rxvt(XTerminal):
+    command = 'rxvt -T "{title}" -e {command}'
+    priority = 1
+
+class Screen(Terminal):
+    command = 'screen -D -m -t "{title}" -S devshell {command}'
+
+    def __init__(self, sh_cmd, title=None, env=None, d=None):
+        s_id = "devshell_%i" % os.getpid()
+        self.command = "screen -D -m -t \"{title}\" -S %s {command}" % s_id
+        Terminal.__init__(self, sh_cmd, title, env, d)
+        msg = 'Screen started. Please connect in another terminal with ' \
+            '"screen -r %s"' % s_id
+        if (d):
+            bb.event.fire(bb.event.LogExecTTY(msg, "screen -r %s" % s_id,
+                                              0.5, 10), d)
+        else:
+            logger.warn(msg)
+
+class TmuxRunning(Terminal):
+    """Open a new pane in the current running tmux window"""
+    name = 'tmux-running'
+    command = 'tmux split-window "{command}"'
+    priority = 2.75
+
+    def __init__(self, sh_cmd, title=None, env=None, d=None):
+        if not bb.utils.which(os.getenv('PATH'), 'tmux'):
+            raise UnsupportedTerminal('tmux is not installed')
+
+        if not os.getenv('TMUX'):
+            raise UnsupportedTerminal('tmux is not running')
+
+        if not check_tmux_pane_size('tmux'):
+            raise UnsupportedTerminal('tmux pane too small')
+
+        Terminal.__init__(self, sh_cmd, title, env, d)
+
+class TmuxNewWindow(Terminal):
+    """Open a new window in the current running tmux session"""
+    name = 'tmux-new-window'
+    command = 'tmux new-window -n "{title}" "{command}"'
+    priority = 2.70
+
+    def __init__(self, sh_cmd, title=None, env=None, d=None):
+        if not bb.utils.which(os.getenv('PATH'), 'tmux'):
+            raise UnsupportedTerminal('tmux is not installed')
+
+        if not os.getenv('TMUX'):
+            raise UnsupportedTerminal('tmux is not running')
+
+        Terminal.__init__(self, sh_cmd, title, env, d)
+
+class Tmux(Terminal):
+    """Start a new tmux session and window"""
+    command = 'tmux new -d -s devshell -n devshell "{command}"'
+    priority = 0.75
+
+    def __init__(self, sh_cmd, title=None, env=None, d=None):
+        if not bb.utils.which(os.getenv('PATH'), 'tmux'):
+            raise UnsupportedTerminal('tmux is not installed')
+
+        # TODO: consider using a 'devshell' session shared amongst all
+        # devshells, if it's already there, add a new window to it.
+        window_name = 'devshell-%i' % os.getpid()
+
+        self.command = 'tmux new -d -s {0} -n {0} "{{command}}"'.format(window_name)
+        Terminal.__init__(self, sh_cmd, title, env, d)
+
+        attach_cmd = 'tmux att -t {0}'.format(window_name)
+        msg = 'Tmux started. Please connect in another terminal with `tmux att -t {0}`'.format(window_name)
+        if d:
+            bb.event.fire(bb.event.LogExecTTY(msg, attach_cmd, 0.5, 10), d)
+        else:
+            logger.warn(msg)
+
+class Custom(Terminal):
+    command = 'false' # This is a placeholder
+    priority = 3
+
+    def __init__(self, sh_cmd, title=None, env=None, d=None):
+        self.command = d and d.getVar('OE_TERMINAL_CUSTOMCMD', True)
+        if self.command:
+            if not '{command}' in self.command:
+                self.command += ' {command}'
+            Terminal.__init__(self, sh_cmd, title, env, d)
+            logger.warn('Custom terminal was started.')
+        else:
+            logger.debug(1, 'No custom terminal (OE_TERMINAL_CUSTOMCMD) set')
+            raise UnsupportedTerminal('OE_TERMINAL_CUSTOMCMD not set')
+
+
+def prioritized():
+    return Registry.prioritized()
+
+def spawn_preferred(sh_cmd, title=None, env=None, d=None):
+    """Spawn the first supported terminal, by priority"""
+    for terminal in prioritized():
+        try:
+            spawn(terminal.name, sh_cmd, title, env, d)
+            break
+        except UnsupportedTerminal:
+            continue
+    else:
+        raise NoSupportedTerminals()
+
+def spawn(name, sh_cmd, title=None, env=None, d=None):
+    """Spawn the specified terminal, by name"""
+    logger.debug(1, 'Attempting to spawn terminal "%s"', name)
+    try:
+        terminal = Registry.registry[name]
+    except KeyError:
+        raise UnsupportedTerminal(name)
+
+    pipe = terminal(sh_cmd, title, env, d)
+    output = pipe.communicate()[0]
+    if pipe.returncode != 0:
+        raise ExecutionError(sh_cmd, pipe.returncode, output)
+
+def check_tmux_pane_size(tmux):
+    import subprocess as sub
+    try:
+        p = sub.Popen('%s list-panes -F "#{?pane_active,#{pane_height},}"' % tmux,
+                shell=True,stdout=sub.PIPE,stderr=sub.PIPE)
+        out, err = p.communicate()
+        size = int(out.strip())
+    except OSError as exc:
+        import errno
+        if exc.errno == errno.ENOENT:
+            return None
+        else:
+            raise
+    if size/2 >= 19:
+        return True
+    return False
+
+def check_terminal_version(terminalName):
+    import subprocess as sub
+    try:
+        p = sub.Popen(['sh', '-c', '%s --version' % terminalName],stdout=sub.PIPE,stderr=sub.PIPE)
+        out, err = p.communicate()
+        ver_info = out.rstrip().split('\n')
+    except OSError as exc:
+        import errno
+        if exc.errno == errno.ENOENT:
+            return None
+        else:
+            raise
+    vernum = None
+    for ver in ver_info:
+        if ver.startswith('Konsole'):
+            vernum = ver.split(' ')[-1]
+        if ver.startswith('GNOME Terminal'):
+            vernum = ver.split(' ')[-1]
+    return vernum
+
+def distro_name():
+    try:
+        p = Popen(['lsb_release', '-i'])
+        out, err = p.communicate()
+        distro = out.split(':')[1].strip().lower()
+    except:
+        distro = "unknown"
+    return distro
diff --git a/meta/lib/oe/tests/__init__.py b/meta/lib/oe/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta/lib/oe/tests/__init__.py
diff --git a/meta/lib/oe/tests/test_license.py b/meta/lib/oe/tests/test_license.py
new file mode 100644
index 0000000..c388886
--- /dev/null
+++ b/meta/lib/oe/tests/test_license.py
@@ -0,0 +1,68 @@
+import unittest
+import oe.license
+
+class SeenVisitor(oe.license.LicenseVisitor):
+    def __init__(self):
+        self.seen = []
+        oe.license.LicenseVisitor.__init__(self)
+
+    def visit_Str(self, node):
+        self.seen.append(node.s)
+
+class TestSingleLicense(unittest.TestCase):
+    licenses = [
+        "GPLv2",
+        "LGPL-2.0",
+        "Artistic",
+        "MIT",
+        "GPLv3+",
+        "FOO_BAR",
+    ]
+    invalid_licenses = ["GPL/BSD"]
+
+    @staticmethod
+    def parse(licensestr):
+        visitor = SeenVisitor()
+        visitor.visit_string(licensestr)
+        return visitor.seen
+
+    def test_single_licenses(self):
+        for license in self.licenses:
+            licenses = self.parse(license)
+            self.assertListEqual(licenses, [license])
+
+    def test_invalid_licenses(self):
+        for license in self.invalid_licenses:
+            with self.assertRaises(oe.license.InvalidLicense) as cm:
+                self.parse(license)
+            self.assertEqual(cm.exception.license, license)
+
+class TestSimpleCombinations(unittest.TestCase):
+    tests = {
+        "FOO&BAR": ["FOO", "BAR"],
+        "BAZ & MOO": ["BAZ", "MOO"],
+        "ALPHA|BETA": ["ALPHA"],
+        "BAZ&MOO|FOO": ["FOO"],
+        "FOO&BAR|BAZ": ["FOO", "BAR"],
+    }
+    preferred = ["ALPHA", "FOO", "BAR"]
+
+    def test_tests(self):
+        def choose(a, b):
+            if all(lic in self.preferred for lic in b):
+                return b
+            else:
+                return a
+
+        for license, expected in self.tests.items():
+            licenses = oe.license.flattened_licenses(license, choose)
+            self.assertListEqual(licenses, expected)
+
+class TestComplexCombinations(TestSimpleCombinations):
+    tests = {
+        "FOO & (BAR | BAZ)&MOO": ["FOO", "BAR", "MOO"],
+        "(ALPHA|(BETA&THETA)|OMEGA)&DELTA": ["OMEGA", "DELTA"],
+        "((ALPHA|BETA)&FOO)|BAZ": ["BETA", "FOO"],
+        "(GPL-2.0|Proprietary)&BSD-4-clause&MIT": ["GPL-2.0", "BSD-4-clause", "MIT"],
+    }
+    preferred = ["BAR", "OMEGA", "BETA", "GPL-2.0"]
diff --git a/meta/lib/oe/tests/test_path.py b/meta/lib/oe/tests/test_path.py
new file mode 100644
index 0000000..3d41ce1
--- /dev/null
+++ b/meta/lib/oe/tests/test_path.py
@@ -0,0 +1,89 @@
+import unittest
+import oe, oe.path
+import tempfile
+import os
+import errno
+import shutil
+
+class TestRealPath(unittest.TestCase):
+    DIRS = [ "a", "b", "etc", "sbin", "usr", "usr/bin", "usr/binX", "usr/sbin", "usr/include", "usr/include/gdbm" ]
+    FILES = [ "etc/passwd", "b/file" ]
+    LINKS = [
+        ( "bin",             "/usr/bin",             "/usr/bin" ),
+        ( "binX",            "usr/binX",             "/usr/binX" ),
+        ( "c",               "broken",               "/broken" ),
+        ( "etc/passwd-1",    "passwd",               "/etc/passwd" ),
+        ( "etc/passwd-2",    "passwd-1",             "/etc/passwd" ),
+        ( "etc/passwd-3",    "/etc/passwd-1",        "/etc/passwd" ),
+        ( "etc/shadow-1",    "/etc/shadow",          "/etc/shadow" ),
+        ( "etc/shadow-2",    "/etc/shadow-1",        "/etc/shadow" ),
+        ( "prog-A",          "bin/prog-A",           "/usr/bin/prog-A" ),
+        ( "prog-B",          "/bin/prog-B",          "/usr/bin/prog-B" ),
+        ( "usr/bin/prog-C",  "../../sbin/prog-C",    "/sbin/prog-C" ),
+        ( "usr/bin/prog-D",  "/sbin/prog-D",         "/sbin/prog-D" ),
+        ( "usr/binX/prog-E", "../sbin/prog-E",       None ),
+        ( "usr/bin/prog-F",  "../../../sbin/prog-F", "/sbin/prog-F" ),
+        ( "loop",            "a/loop",               None ),
+        ( "a/loop",          "../loop",              None ),
+        ( "b/test",          "file/foo",             "/b/file/foo" ),
+    ]
+
+    LINKS_PHYS = [
+        ( "./",          "/",                "" ),
+        ( "binX/prog-E", "/usr/sbin/prog-E", "/sbin/prog-E" ),
+    ]
+
+    EXCEPTIONS = [
+        ( "loop",   errno.ELOOP ),
+        ( "b/test", errno.ENOENT ),
+    ]
+
+    def __del__(self):
+        try:
+            #os.system("tree -F %s" % self.tmpdir)
+            shutil.rmtree(self.tmpdir)
+        except:
+            pass
+
+    def setUp(self):
+        self.tmpdir = tempfile.mkdtemp(prefix = "oe-test_path")
+        self.root = os.path.join(self.tmpdir, "R")
+
+        os.mkdir(os.path.join(self.tmpdir, "_real"))
+        os.symlink("_real", self.root)
+
+        for d in self.DIRS:
+            os.mkdir(os.path.join(self.root, d))
+        for f in self.FILES:
+            file(os.path.join(self.root, f), "w")
+        for l in self.LINKS:
+            os.symlink(l[1], os.path.join(self.root, l[0]))
+
+    def __realpath(self, file, use_physdir, assume_dir = True):
+        return oe.path.realpath(os.path.join(self.root, file), self.root,
+                                use_physdir, assume_dir = assume_dir)
+
+    def test_norm(self):
+        for l in self.LINKS:
+            if l[2] == None:
+                continue
+
+            target_p = self.__realpath(l[0], True)
+            target_l = self.__realpath(l[0], False)
+
+            if l[2] != False:
+                self.assertEqual(target_p, target_l)
+                self.assertEqual(l[2], target_p[len(self.root):])
+
+    def test_phys(self):
+        for l in self.LINKS_PHYS:
+            target_p = self.__realpath(l[0], True)
+            target_l = self.__realpath(l[0], False)
+
+            self.assertEqual(l[1], target_p[len(self.root):])
+            self.assertEqual(l[2], target_l[len(self.root):])
+
+    def test_loop(self):
+        for e in self.EXCEPTIONS:
+            self.assertRaisesRegexp(OSError, r'\[Errno %u\]' % e[1],
+                                    self.__realpath, e[0], False, False)
diff --git a/meta/lib/oe/tests/test_types.py b/meta/lib/oe/tests/test_types.py
new file mode 100644
index 0000000..367cc30
--- /dev/null
+++ b/meta/lib/oe/tests/test_types.py
@@ -0,0 +1,62 @@
+import unittest
+from oe.maketype import create, factory
+
+class TestTypes(unittest.TestCase):
+    def assertIsInstance(self, obj, cls):
+        return self.assertTrue(isinstance(obj, cls))
+
+    def assertIsNot(self, obj, other):
+        return self.assertFalse(obj is other)
+
+    def assertFactoryCreated(self, value, type, **flags):
+        cls = factory(type)
+        self.assertIsNot(cls, None)
+        self.assertIsInstance(create(value, type, **flags), cls)
+
+class TestBooleanType(TestTypes):
+    def test_invalid(self):
+        self.assertRaises(ValueError, create, '', 'boolean')
+        self.assertRaises(ValueError, create, 'foo', 'boolean')
+        self.assertRaises(TypeError, create, object(), 'boolean')
+
+    def test_true(self):
+        self.assertTrue(create('y', 'boolean'))
+        self.assertTrue(create('yes', 'boolean'))
+        self.assertTrue(create('1', 'boolean'))
+        self.assertTrue(create('t', 'boolean'))
+        self.assertTrue(create('true', 'boolean'))
+        self.assertTrue(create('TRUE', 'boolean'))
+        self.assertTrue(create('truE', 'boolean'))
+
+    def test_false(self):
+        self.assertFalse(create('n', 'boolean'))
+        self.assertFalse(create('no', 'boolean'))
+        self.assertFalse(create('0', 'boolean'))
+        self.assertFalse(create('f', 'boolean'))
+        self.assertFalse(create('false', 'boolean'))
+        self.assertFalse(create('FALSE', 'boolean'))
+        self.assertFalse(create('faLse', 'boolean'))
+
+    def test_bool_equality(self):
+        self.assertEqual(create('n', 'boolean'), False)
+        self.assertNotEqual(create('n', 'boolean'), True)
+        self.assertEqual(create('y', 'boolean'), True)
+        self.assertNotEqual(create('y', 'boolean'), False)
+
+class TestList(TestTypes):
+    def assertListEqual(self, value, valid, sep=None):
+        obj = create(value, 'list', separator=sep)
+        self.assertEqual(obj, valid)
+        if sep is not None:
+            self.assertEqual(obj.separator, sep)
+        self.assertEqual(str(obj), obj.separator.join(obj))
+
+    def test_list_nosep(self):
+        testlist = ['alpha', 'beta', 'theta']
+        self.assertListEqual('alpha beta theta', testlist)
+        self.assertListEqual('alpha  beta\ttheta', testlist)
+        self.assertListEqual('alpha', ['alpha'])
+
+    def test_list_usersep(self):
+        self.assertListEqual('foo:bar', ['foo', 'bar'], ':')
+        self.assertListEqual('foo:bar:baz', ['foo', 'bar', 'baz'], ':')
diff --git a/meta/lib/oe/tests/test_utils.py b/meta/lib/oe/tests/test_utils.py
new file mode 100644
index 0000000..5d9ac52
--- /dev/null
+++ b/meta/lib/oe/tests/test_utils.py
@@ -0,0 +1,51 @@
+import unittest
+from oe.utils import packages_filter_out_system
+
+class TestPackagesFilterOutSystem(unittest.TestCase):
+    def test_filter(self):
+        """
+        Test that oe.utils.packages_filter_out_system works.
+        """
+        try:
+            import bb
+        except ImportError:
+            self.skipTest("Cannot import bb")
+
+        d = bb.data_smart.DataSmart()
+        d.setVar("PN", "foo")
+
+        d.setVar("PACKAGES", "foo foo-doc foo-dev")
+        pkgs = packages_filter_out_system(d)
+        self.assertEqual(pkgs, [])
+
+        d.setVar("PACKAGES", "foo foo-doc foo-data foo-dev")
+        pkgs = packages_filter_out_system(d)
+        self.assertEqual(pkgs, ["foo-data"])
+
+        d.setVar("PACKAGES", "foo foo-locale-en-gb")
+        pkgs = packages_filter_out_system(d)
+        self.assertEqual(pkgs, [])
+
+        d.setVar("PACKAGES", "foo foo-data foo-locale-en-gb")
+        pkgs = packages_filter_out_system(d)
+        self.assertEqual(pkgs, ["foo-data"])
+
+
+class TestTrimVersion(unittest.TestCase):
+    def test_version_exception(self):
+        with self.assertRaises(TypeError):
+            trim_version(None, 2)
+        with self.assertRaises(TypeError):
+            trim_version((1, 2, 3), 2)
+
+    def test_num_exception(self):
+        with self.assertRaises(ValueError):
+            trim_version("1.2.3", 0)
+        with self.assertRaises(ValueError):
+            trim_version("1.2.3", -1)
+
+    def test_valid(self):
+        self.assertEqual(trim_version("1.2.3", 1), "1")
+        self.assertEqual(trim_version("1.2.3", 2), "1.2")
+        self.assertEqual(trim_version("1.2.3", 3), "1.2.3")
+        self.assertEqual(trim_version("1.2.3", 4), "1.2.3")
diff --git a/meta/lib/oe/types.py b/meta/lib/oe/types.py
new file mode 100644
index 0000000..7f47c17
--- /dev/null
+++ b/meta/lib/oe/types.py
@@ -0,0 +1,153 @@
+import errno
+import re
+import os
+
+
+class OEList(list):
+    """OpenEmbedded 'list' type
+
+    Acts as an ordinary list, but is constructed from a string value and a
+    separator (optional), and re-joins itself when converted to a string with
+    str().  Set the variable type flag to 'list' to use this type, and the
+    'separator' flag may be specified (defaulting to whitespace)."""
+
+    name = "list"
+
+    def __init__(self, value, separator = None):
+        if value is not None:
+            list.__init__(self, value.split(separator))
+        else:
+            list.__init__(self)
+
+        if separator is None:
+            self.separator = " "
+        else:
+            self.separator = separator
+
+    def __str__(self):
+        return self.separator.join(self)
+
+def choice(value, choices):
+    """OpenEmbedded 'choice' type
+
+    Acts as a multiple choice for the user.  To use this, set the variable
+    type flag to 'choice', and set the 'choices' flag to a space separated
+    list of valid values."""
+    if not isinstance(value, basestring):
+        raise TypeError("choice accepts a string, not '%s'" % type(value))
+
+    value = value.lower()
+    choices = choices.lower()
+    if value not in choices.split():
+        raise ValueError("Invalid choice '%s'.  Valid choices: %s" %
+                         (value, choices))
+    return value
+
+class NoMatch(object):
+    """Stub python regex pattern object which never matches anything"""
+    def findall(self, string, flags=0):
+        return None
+
+    def finditer(self, string, flags=0):
+        return None
+
+    def match(self, flags=0):
+        return None
+
+    def search(self, string, flags=0):
+        return None
+
+    def split(self, string, maxsplit=0):
+        return None
+
+    def sub(pattern, repl, string, count=0):
+        return None
+
+    def subn(pattern, repl, string, count=0):
+        return None
+
+NoMatch = NoMatch()
+
+def regex(value, regexflags=None):
+    """OpenEmbedded 'regex' type
+
+    Acts as a regular expression, returning the pre-compiled regular
+    expression pattern object.  To use this type, set the variable type flag
+    to 'regex', and optionally, set the 'regexflags' type to a space separated
+    list of the flags to control the regular expression matching (e.g.
+    FOO[regexflags] += 'ignorecase').  See the python documentation on the
+    're' module for a list of valid flags."""
+
+    flagval = 0
+    if regexflags:
+        for flag in regexflags.split():
+            flag = flag.upper()
+            try:
+                flagval |= getattr(re, flag)
+            except AttributeError:
+                raise ValueError("Invalid regex flag '%s'" % flag)
+
+    if not value:
+        # Let's ensure that the default behavior for an undefined or empty
+        # variable is to match nothing. If the user explicitly wants to match
+        # anything, they can match '.*' instead.
+        return NoMatch
+
+    try:
+        return re.compile(value, flagval)
+    except re.error as exc:
+        raise ValueError("Invalid regex value '%s': %s" %
+                         (value, exc.args[0]))
+
+def boolean(value):
+    """OpenEmbedded 'boolean' type
+
+    Valid values for true: 'yes', 'y', 'true', 't', '1'
+    Valid values for false: 'no', 'n', 'false', 'f', '0'
+    """
+
+    if not isinstance(value, basestring):
+        raise TypeError("boolean accepts a string, not '%s'" % type(value))
+
+    value = value.lower()
+    if value in ('yes', 'y', 'true', 't', '1'):
+        return True
+    elif value in ('no', 'n', 'false', 'f', '0'):
+        return False
+    raise ValueError("Invalid boolean value '%s'" % value)
+
+def integer(value, numberbase=10):
+    """OpenEmbedded 'integer' type
+
+    Defaults to base 10, but this can be specified using the optional
+    'numberbase' flag."""
+
+    return int(value, int(numberbase))
+
+_float = float
+def float(value, fromhex='false'):
+    """OpenEmbedded floating point type
+
+    To use this type, set the type flag to 'float', and optionally set the
+    'fromhex' flag to a true value (obeying the same rules as for the
+    'boolean' type) if the value is in base 16 rather than base 10."""
+
+    if boolean(fromhex):
+        return _float.fromhex(value)
+    else:
+        return _float(value)
+
+def path(value, relativeto='', normalize='true', mustexist='false'):
+    value = os.path.join(relativeto, value)
+
+    if boolean(normalize):
+        value = os.path.normpath(value)
+
+    if boolean(mustexist):
+        try:
+            open(value, 'r')
+        except IOError as exc:
+            if exc.errno == errno.ENOENT:
+                raise ValueError("{0}: {1}".format(value, os.strerror(errno.ENOENT)))
+
+    return value
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
new file mode 100644
index 0000000..cee087f
--- /dev/null
+++ b/meta/lib/oe/utils.py
@@ -0,0 +1,273 @@
+try:
+    # Python 2
+    import commands as cmdstatus
+except ImportError:
+    # Python 3
+    import subprocess as cmdstatus
+
+def read_file(filename):
+    try:
+        f = open( filename, "r" )
+    except IOError as reason:
+        return "" # WARNING: can't raise an error now because of the new RDEPENDS handling. This is a bit ugly. :M:
+    else:
+        data = f.read().strip()
+        f.close()
+        return data
+    return None
+
+def ifelse(condition, iftrue = True, iffalse = False):
+    if condition:
+        return iftrue
+    else:
+        return iffalse
+
+def conditional(variable, checkvalue, truevalue, falsevalue, d):
+    if d.getVar(variable,1) == checkvalue:
+        return truevalue
+    else:
+        return falsevalue
+
+def less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+    if float(d.getVar(variable,1)) <= float(checkvalue):
+        return truevalue
+    else:
+        return falsevalue
+
+def version_less_or_equal(variable, checkvalue, truevalue, falsevalue, d):
+    result = bb.utils.vercmp_string(d.getVar(variable,True), checkvalue)
+    if result <= 0:
+        return truevalue
+    else:
+        return falsevalue
+
+def both_contain(variable1, variable2, checkvalue, d):
+    val1 = d.getVar(variable1, True)
+    val2 = d.getVar(variable2, True)
+    val1 = set(val1.split())
+    val2 = set(val2.split())
+    if isinstance(checkvalue, basestring):
+        checkvalue = set(checkvalue.split())
+    else:
+        checkvalue = set(checkvalue)
+    if checkvalue.issubset(val1) and checkvalue.issubset(val2):
+        return " ".join(checkvalue)
+    else:
+        return ""
+
+def set_intersect(variable1, variable2, d):
+    """
+    Expand both variables, interpret them as lists of strings, and return the
+    intersection as a flattened string.
+
+    For example:
+    s1 = "a b c"
+    s2 = "b c d"
+    s3 = set_intersect(s1, s2)
+    => s3 = "b c"
+    """
+    val1 = set(d.getVar(variable1, True).split())
+    val2 = set(d.getVar(variable2, True).split())
+    return " ".join(val1 & val2)
+
+def prune_suffix(var, suffixes, d):
+    # See if var ends with any of the suffixes listed and
+    # remove it if found
+    for suffix in suffixes:
+        if var.endswith(suffix):
+            var = var.replace(suffix, "")
+
+    prefix = d.getVar("MLPREFIX", True)
+    if prefix and var.startswith(prefix):
+        var = var.replace(prefix, "")
+
+    return var
+
+def str_filter(f, str, d):
+    from re import match
+    return " ".join(filter(lambda x: match(f, x, 0), str.split()))
+
+def str_filter_out(f, str, d):
+    from re import match
+    return " ".join(filter(lambda x: not match(f, x, 0), str.split()))
+
+def param_bool(cfg, field, dflt = None):
+    """Lookup <field> in <cfg> map and convert it to a boolean; take
+    <dflt> when this <field> does not exist"""
+    value = cfg.get(field, dflt)
+    strvalue = str(value).lower()
+    if strvalue in ('yes', 'y', 'true', 't', '1'):
+        return True
+    elif strvalue in ('no', 'n', 'false', 'f', '0'):
+        return False
+    raise ValueError("invalid value for boolean parameter '%s': '%s'" % (field, value))
+
+def inherits(d, *classes):
+    """Return True if the metadata inherits any of the specified classes"""
+    return any(bb.data.inherits_class(cls, d) for cls in classes)
+
+def features_backfill(var,d):
+    # This construct allows the addition of new features to variable specified
+    # as var
+    # Example for var = "DISTRO_FEATURES"
+    # This construct allows the addition of new features to DISTRO_FEATURES
+    # that if not present would disable existing functionality, without
+    # disturbing distributions that have already set DISTRO_FEATURES.
+    # Distributions wanting to elide a value in DISTRO_FEATURES_BACKFILL should
+    # add the feature to DISTRO_FEATURES_BACKFILL_CONSIDERED
+    features = (d.getVar(var, True) or "").split()
+    backfill = (d.getVar(var+"_BACKFILL", True) or "").split()
+    considered = (d.getVar(var+"_BACKFILL_CONSIDERED", True) or "").split()
+
+    addfeatures = []
+    for feature in backfill:
+        if feature not in features and feature not in considered:
+            addfeatures.append(feature)
+
+    if addfeatures:
+        d.appendVar(var, " " + " ".join(addfeatures))
+
+
+def packages_filter_out_system(d):
+    """
+    Return a list of packages from PACKAGES with the "system" packages such as
+    PN-dbg PN-doc PN-locale-eb-gb removed.
+    """
+    pn = d.getVar('PN', True)
+    blacklist = map(lambda suffix: pn + suffix, ('', '-dbg', '-dev', '-doc', '-locale', '-staticdev'))
+    localepkg = pn + "-locale-"
+    pkgs = []
+
+    for pkg in d.getVar('PACKAGES', True).split():
+        if pkg not in blacklist and localepkg not in pkg:
+            pkgs.append(pkg)
+    return pkgs
+
+def getstatusoutput(cmd):
+    return cmdstatus.getstatusoutput(cmd)
+
+
+def trim_version(version, num_parts=2):
+    """
+    Return just the first <num_parts> of <version>, split by periods.  For
+    example, trim_version("1.2.3", 2) will return "1.2".
+    """
+    if type(version) is not str:
+        raise TypeError("Version should be a string")
+    if num_parts < 1:
+        raise ValueError("Cannot split to parts < 1")
+
+    parts = version.split(".")
+    trimmed = ".".join(parts[:num_parts])
+    return trimmed
+
+def cpu_count():
+    import multiprocessing
+    return multiprocessing.cpu_count()
+
+def execute_pre_post_process(d, cmds):
+    if cmds is None:
+        return
+
+    for cmd in cmds.strip().split(';'):
+        cmd = cmd.strip()
+        if cmd != '':
+            bb.note("Executing %s ..." % cmd)
+            bb.build.exec_func(cmd, d)
+
+def multiprocess_exec(commands, function):
+    import signal
+    import multiprocessing
+
+    if not commands:
+        return []
+
+    def init_worker():
+        signal.signal(signal.SIGINT, signal.SIG_IGN)
+
+    nproc = min(multiprocessing.cpu_count(), len(commands))
+    pool = bb.utils.multiprocessingpool(nproc, init_worker)
+    imap = pool.imap(function, commands)
+
+    try:
+        res = list(imap)
+        pool.close()
+        pool.join()
+        results = []
+        for result in res:
+            if result is not None:
+                results.append(result)
+        return results
+
+    except KeyboardInterrupt:
+        pool.terminate()
+        pool.join()
+        raise
+
+def squashspaces(string):
+    import re
+    return re.sub("\s+", " ", string).strip()
+
+#
+# Python 2.7 doesn't have threaded pools (just multiprocessing)
+# so implement a version here
+#
+
+from Queue import Queue
+from threading import Thread
+
+class ThreadedWorker(Thread):
+    """Thread executing tasks from a given tasks queue"""
+    def __init__(self, tasks, worker_init, worker_end):
+        Thread.__init__(self)
+        self.tasks = tasks
+        self.daemon = True
+
+        self.worker_init = worker_init
+        self.worker_end = worker_end
+
+    def run(self):
+        from Queue import Empty
+
+        if self.worker_init is not None:
+            self.worker_init(self)
+
+        while True:
+            try:
+                func, args, kargs = self.tasks.get(block=False)
+            except Empty:
+                if self.worker_end is not None:
+                    self.worker_end(self)
+                break
+
+            try:
+                func(self, *args, **kargs)
+            except Exception, e:
+                print e
+            finally:
+                self.tasks.task_done()
+
+class ThreadedPool:
+    """Pool of threads consuming tasks from a queue"""
+    def __init__(self, num_workers, num_tasks, worker_init=None,
+            worker_end=None):
+        self.tasks = Queue(num_tasks)
+        self.workers = []
+
+        for _ in range(num_workers):
+            worker = ThreadedWorker(self.tasks, worker_init, worker_end)
+            self.workers.append(worker)
+
+    def start(self):
+        for worker in self.workers:
+            worker.start()
+
+    def add_task(self, func, *args, **kargs):
+        """Add a task to the queue"""
+        self.tasks.put((func, args, kargs))
+
+    def wait_completion(self):
+        """Wait for completion of all the tasks in the queue"""
+        self.tasks.join()
+        for worker in self.workers:
+            worker.join()
diff --git a/meta/lib/oeqa/__init__.py b/meta/lib/oeqa/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta/lib/oeqa/__init__.py
diff --git a/meta/lib/oeqa/controllers/__init__.py b/meta/lib/oeqa/controllers/__init__.py
new file mode 100644
index 0000000..8eda927
--- /dev/null
+++ b/meta/lib/oeqa/controllers/__init__.py
@@ -0,0 +1,3 @@
+# Enable other layers to have modules in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/meta/lib/oeqa/controllers/masterimage.py b/meta/lib/oeqa/controllers/masterimage.py
new file mode 100644
index 0000000..522f9eb
--- /dev/null
+++ b/meta/lib/oeqa/controllers/masterimage.py
@@ -0,0 +1,201 @@
+# Copyright (C) 2014 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module adds support to testimage.bbclass to deploy images and run
+# tests using a "master image" - this is a "known good" image that is
+# installed onto the device as part of initial setup and will be booted into
+# with no interaction; we can then use it to deploy the image to be tested
+# to a second partition before running the tests.
+#
+# For an example master image, see core-image-testmaster
+# (meta/recipes-extended/images/core-image-testmaster.bb)
+
+import os
+import bb
+import traceback
+import time
+import subprocess
+
+import oeqa.targetcontrol
+import oeqa.utils.sshcontrol as sshcontrol
+import oeqa.utils.commands as commands
+from oeqa.utils import CommandError
+
+from abc import ABCMeta, abstractmethod
+
+class MasterImageHardwareTarget(oeqa.targetcontrol.BaseTarget):
+
+    __metaclass__ = ABCMeta
+
+    supported_image_fstypes = ['tar.gz', 'tar.bz2']
+
+    def __init__(self, d):
+        super(MasterImageHardwareTarget, self).__init__(d)
+
+        # target ip
+        addr = d.getVar("TEST_TARGET_IP", True) or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
+        self.ip = addr.split(":")[0]
+        try:
+            self.port = addr.split(":")[1]
+        except IndexError:
+            self.port = None
+        bb.note("Target IP: %s" % self.ip)
+        self.server_ip = d.getVar("TEST_SERVER_IP", True)
+        if not self.server_ip:
+            try:
+                self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]
+            except Exception as e:
+                bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e)
+        bb.note("Server IP: %s" % self.server_ip)
+
+        # test rootfs + kernel
+        self.image_fstype = self.get_image_fstype(d)
+        self.rootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype)
+        self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
+        if not os.path.isfile(self.rootfs):
+            # we could've checked that IMAGE_FSTYPES contains tar.gz but the config for running testimage might not be
+            # the same as the config with which the image was build, ie
+            # you bitbake core-image-sato with IMAGE_FSTYPES += "tar.gz"
+            # and your autobuilder overwrites the config, adds the test bits and runs bitbake core-image-sato -c testimage
+            bb.fatal("No rootfs found. Did you build the image ?\nIf yes, did you build it with IMAGE_FSTYPES += \"tar.gz\" ? \
+                      \nExpected path: %s" % self.rootfs)
+        if not os.path.isfile(self.kernel):
+            bb.fatal("No kernel found. Expected path: %s" % self.kernel)
+
+        # master ssh connection
+        self.master = None
+        # if the user knows what they are doing, then by all means...
+        self.user_cmds = d.getVar("TEST_DEPLOY_CMDS", True)
+        self.deploy_cmds = None
+
+        # this is the name of the command that controls the power for a board
+        # e.g: TEST_POWERCONTROL_CMD = "/home/user/myscripts/powercontrol.py ${MACHINE} what-ever-other-args-the-script-wants"
+        # the command should take as the last argument "off" and "on" and "cycle" (off, on)
+        self.powercontrol_cmd = d.getVar("TEST_POWERCONTROL_CMD", True) or None
+        self.powercontrol_args = d.getVar("TEST_POWERCONTROL_EXTRA_ARGS", False) or ""
+
+        self.serialcontrol_cmd = d.getVar("TEST_SERIALCONTROL_CMD", True) or None
+        self.serialcontrol_args = d.getVar("TEST_SERIALCONTROL_EXTRA_ARGS", False) or ""
+
+        self.origenv = os.environ
+        if self.powercontrol_cmd or self.serialcontrol_cmd:
+            # the external script for controlling power might use ssh
+            # ssh + keys means we need the original user env
+            bborigenv = d.getVar("BB_ORIGENV", False) or {}
+            for key in bborigenv:
+                val = bborigenv.getVar(key, True)
+                if val is not None:
+                    self.origenv[key] = str(val)
+
+        if self.powercontrol_cmd:
+            if self.powercontrol_args:
+                self.powercontrol_cmd = "%s %s" % (self.powercontrol_cmd, self.powercontrol_args)
+        if self.serialcontrol_cmd:
+            if self.serialcontrol_args:
+                self.serialcontrol_cmd = "%s %s" % (self.serialcontrol_cmd, self.serialcontrol_args)
+
+    def power_ctl(self, msg):
+        if self.powercontrol_cmd:
+            cmd = "%s %s" % (self.powercontrol_cmd, msg)
+            try:
+                commands.runCmd(cmd, assert_error=False, preexec_fn=os.setsid, env=self.origenv)
+            except CommandError as e:
+                bb.fatal(str(e))
+
+    def power_cycle(self, conn):
+        if self.powercontrol_cmd:
+            # be nice, don't just cut power
+            conn.run("shutdown -h now")
+            time.sleep(10)
+            self.power_ctl("cycle")
+        else:
+            status, output = conn.run("reboot")
+            if status != 0:
+                bb.error("Failed rebooting target and no power control command defined. You need to manually reset the device.\n%s" % output)
+
+    def _wait_until_booted(self):
+        ''' Waits until the target device has booted (if we have just power cycled it) '''
+        # Subclasses with better methods of determining boot can override this
+        time.sleep(120)
+
+    def deploy(self):
+        # base class just sets the ssh log file for us
+        super(MasterImageHardwareTarget, self).deploy()
+        self.master = sshcontrol.SSHControl(ip=self.ip, logfile=self.sshlog, timeout=600, port=self.port)
+        status, output = self.master.run("cat /etc/masterimage")
+        if status != 0:
+            # We're not booted into the master image, so try rebooting
+            bb.plain("%s - booting into the master image" % self.pn)
+            self.power_ctl("cycle")
+            self._wait_until_booted()
+
+        bb.plain("%s - deploying image on target" % self.pn)
+        status, output = self.master.run("cat /etc/masterimage")
+        if status != 0:
+            bb.fatal("No ssh connectivity or target isn't running a master image.\n%s" % output)
+        if self.user_cmds:
+            self.deploy_cmds = self.user_cmds.split("\n")
+        try:
+            self._deploy()
+        except Exception as e:
+            bb.fatal("Failed deploying test image: %s" % e)
+
+    @abstractmethod
+    def _deploy(self):
+        pass
+
+    def start(self, params=None):
+        bb.plain("%s - boot test image on target" % self.pn)
+        self._start()
+        # set the ssh object for the target/test image
+        self.connection = sshcontrol.SSHControl(self.ip, logfile=self.sshlog, port=self.port)
+        bb.plain("%s - start running tests" % self.pn)
+
+    @abstractmethod
+    def _start(self):
+        pass
+
+    def stop(self):
+        bb.plain("%s - reboot/powercycle target" % self.pn)
+        self.power_cycle(self.connection)
+
+
+class GummibootTarget(MasterImageHardwareTarget):
+
+    def __init__(self, d):
+        super(GummibootTarget, self).__init__(d)
+        # this the value we need to set in the LoaderEntryOneShot EFI variable
+        # so the system boots the 'test' bootloader label and not the default
+        # The first four bytes are EFI bits, and the rest is an utf-16le string
+        # (EFI vars values need to be utf-16)
+        # $ echo -en "test\0" | iconv -f ascii -t utf-16le | hexdump -C
+        # 00000000  74 00 65 00 73 00 74 00  00 00                    |t.e.s.t...|
+        self.efivarvalue = r'\x07\x00\x00\x00\x74\x00\x65\x00\x73\x00\x74\x00\x00\x00'
+        self.deploy_cmds = [
+                'mount -L boot /boot',
+                'mkdir -p /mnt/testrootfs',
+                'mount -L testrootfs /mnt/testrootfs',
+                'modprobe efivarfs',
+                'mount -t efivarfs efivarfs /sys/firmware/efi/efivars',
+                'cp ~/test-kernel /boot',
+                'rm -rf /mnt/testrootfs/*',
+                'tar xvf ~/test-rootfs.%s -C /mnt/testrootfs' % self.image_fstype,
+                'printf "%s" > /sys/firmware/efi/efivars/LoaderEntryOneShot-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f' % self.efivarvalue
+                ]
+
+    def _deploy(self):
+        # make sure these aren't mounted
+        self.master.run("umount /boot; umount /mnt/testrootfs; umount /sys/firmware/efi/efivars;")
+        # from now on, every deploy cmd should return 0
+        # else an exception will be thrown by sshcontrol
+        self.master.ignore_status = False
+        self.master.copy_to(self.rootfs, "~/test-rootfs." + self.image_fstype)
+        self.master.copy_to(self.kernel, "~/test-kernel")
+        for cmd in self.deploy_cmds:
+            self.master.run(cmd)
+
+    def _start(self, params=None):
+        self.power_cycle(self.master)
+        # there are better ways than a timeout but this should work for now
+        time.sleep(120)
diff --git a/meta/lib/oeqa/controllers/testtargetloader.py b/meta/lib/oeqa/controllers/testtargetloader.py
new file mode 100644
index 0000000..a1b7b1d
--- /dev/null
+++ b/meta/lib/oeqa/controllers/testtargetloader.py
@@ -0,0 +1,70 @@
+import types
+import bb
+import os
+
+# This class is responsible for loading a test target controller
+class TestTargetLoader:
+
+    # Search oeqa.controllers module directory for and return a controller  
+    # corresponding to the given target name. 
+    # AttributeError raised if not found.
+    # ImportError raised if a provided module can not be imported.
+    def get_controller_module(self, target, bbpath):
+        controllerslist = self.get_controller_modulenames(bbpath)
+        bb.note("Available controller modules: %s" % str(controllerslist))
+        controller = self.load_controller_from_name(target, controllerslist)
+        return controller
+
+    # Return a list of all python modules in lib/oeqa/controllers for each
+    # layer in bbpath
+    def get_controller_modulenames(self, bbpath):
+
+        controllerslist = []
+
+        def add_controller_list(path):
+            if not os.path.exists(os.path.join(path, '__init__.py')):
+                bb.fatal('Controllers directory %s exists but is missing __init__.py' % path)
+            files = sorted([f for f in os.listdir(path) if f.endswith('.py') and not f.startswith('_')])
+            for f in files:
+                module = 'oeqa.controllers.' + f[:-3]
+                if module not in controllerslist:
+                    controllerslist.append(module)
+                else:
+                    bb.warn("Duplicate controller module found for %s, only one added. Layers should create unique controller module names" % module)
+
+        for p in bbpath:
+            controllerpath = os.path.join(p, 'lib', 'oeqa', 'controllers')
+            bb.debug(2, 'Searching for target controllers in %s' % controllerpath)
+            if os.path.exists(controllerpath):
+                add_controller_list(controllerpath)
+        return controllerslist
+
+    # Search for and return a controller from given target name and
+    # set of module names. 
+    # Raise AttributeError if not found.
+    # Raise ImportError if a provided module can not be imported
+    def load_controller_from_name(self, target, modulenames):
+        for name in modulenames:
+            obj = self.load_controller_from_module(target, name)
+            if obj:
+                return obj
+        raise AttributeError("Unable to load {0} from available modules: {1}".format(target, str(modulenames)))
+
+    # Search for and return a controller or None from given module name
+    def load_controller_from_module(self, target, modulename):
+        obj = None
+        # import module, allowing it to raise import exception
+        module = __import__(modulename, globals(), locals(), [target])
+        # look for target class in the module, catching any exceptions as it
+        # is valid that a module may not have the target class.
+        try:
+            obj = getattr(module, target)
+            if obj: 
+                from oeqa.targetcontrol import BaseTarget
+                if (not isinstance(obj, (type, types.ClassType))):
+                    bb.warn("Target {0} found, but not of type Class".format(target))
+                if( not issubclass(obj, BaseTarget)):
+                    bb.warn("Target {0} found, but subclass is not BaseTarget".format(target))
+        except:
+            obj = None
+        return obj
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
new file mode 100644
index 0000000..0fe68d4
--- /dev/null
+++ b/meta/lib/oeqa/oetest.py
@@ -0,0 +1,214 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Main unittest module used by testimage.bbclass
+# This provides the oeRuntimeTest base class which is inherited by all tests in meta/lib/oeqa/runtime.
+
+# It also has some helper functions and it's responsible for actually starting the tests
+
+import os, re, mmap
+import unittest
+import inspect
+import subprocess
+import bb
+from oeqa.utils.decorators import LogResults, gettag
+from sys import exc_info, exc_clear
+
+def getVar(obj):
+    #extend form dict, if a variable didn't exists, need find it in testcase
+    class VarDict(dict):
+        def __getitem__(self, key):
+            return gettag(obj, key)
+    return VarDict()
+
+def checkTags(tc, tagexp):
+    return eval(tagexp, None, getVar(tc))
+
+
+def filterByTagExp(testsuite, tagexp):
+    if not tagexp:
+        return testsuite
+    caseList = []
+    for each in testsuite:
+        if not isinstance(each, unittest.BaseTestSuite):
+            if checkTags(each, tagexp):
+                caseList.append(each)
+        else:
+            caseList.append(filterByTagExp(each, tagexp))
+    return testsuite.__class__(caseList)
+
+def loadTests(tc, type="runtime"):
+    if type == "runtime":
+        # set the context object passed from the test class
+        setattr(oeTest, "tc", tc)
+        # set ps command to use
+        setattr(oeRuntimeTest, "pscmd", "ps -ef" if oeTest.hasPackage("procps") else "ps")
+        # prepare test suite, loader and runner
+        suite = unittest.TestSuite()
+    elif type == "sdk":
+        # set the context object passed from the test class
+        setattr(oeTest, "tc", tc)
+    testloader = unittest.TestLoader()
+    testloader.sortTestMethodsUsing = None
+    suites = [testloader.loadTestsFromName(name) for name in tc.testslist]
+    suites = filterByTagExp(suites, getattr(tc, "tagexp", None))
+
+    def getTests(test):
+        '''Return all individual tests executed when running the suite.'''
+        # Unfortunately unittest does not have an API for this, so we have
+        # to rely on implementation details. This only needs to work
+        # for TestSuite containing TestCase.
+        method = getattr(test, '_testMethodName', None)
+        if method:
+            # leaf case: a TestCase
+            yield test
+        else:
+            # Look into TestSuite.
+            tests = getattr(test, '_tests', [])
+            for t1 in tests:
+                for t2 in getTests(t1):
+                    yield t2
+
+    # Determine dependencies between suites by looking for @skipUnlessPassed
+    # method annotations. Suite A depends on suite B if any method in A
+    # depends on a method on B.
+    for suite in suites:
+        suite.dependencies = []
+        suite.depth = 0
+        for test in getTests(suite):
+            methodname = getattr(test, '_testMethodName', None)
+            if methodname:
+                method = getattr(test, methodname)
+                depends_on = getattr(method, '_depends_on', None)
+                if depends_on:
+                    for dep_suite in suites:
+                        if depends_on in [getattr(t, '_testMethodName', None) for t in getTests(dep_suite)]:
+                            if dep_suite not in suite.dependencies and \
+                               dep_suite is not suite:
+                                suite.dependencies.append(dep_suite)
+                            break
+                    else:
+                        bb.warn("Test %s was declared as @skipUnlessPassed('%s') but that test is either not defined or not active. Will run the test anyway." %
+                                (test, depends_on))
+    # Use brute-force topological sort to determine ordering. Sort by
+    # depth (higher depth = must run later), with original ordering to
+    # break ties.
+    def set_suite_depth(suite):
+        for dep in suite.dependencies:
+            new_depth = set_suite_depth(dep) + 1
+            if new_depth > suite.depth:
+                suite.depth = new_depth
+        return suite.depth
+    for index, suite in enumerate(suites):
+        set_suite_depth(suite)
+        suite.index = index
+    suites.sort(cmp=lambda a,b: cmp((a.depth, a.index), (b.depth, b.index)))
+    return testloader.suiteClass(suites)
+
+def runTests(tc, type="runtime"):
+
+    suite = loadTests(tc, type)
+    bb.note("Test modules  %s" % tc.testslist)
+    if hasattr(tc, "tagexp") and tc.tagexp:
+        bb.note("Filter test cases by tags: %s" % tc.tagexp)
+    bb.note("Found %s tests" % suite.countTestCases())
+    runner = unittest.TextTestRunner(verbosity=2)
+    result = runner.run(suite)
+
+    return result
+
+@LogResults
+class oeTest(unittest.TestCase):
+
+    longMessage = True
+
+    @classmethod
+    def hasPackage(self, pkg):
+        for item in oeTest.tc.pkgmanifest.split('\n'):
+            if re.match(pkg, item):
+                return True
+        return False
+
+    @classmethod
+    def hasFeature(self,feature):
+
+        if feature in oeTest.tc.imagefeatures or \
+                feature in oeTest.tc.distrofeatures:
+            return True
+        else:
+            return False
+
+class oeRuntimeTest(oeTest):
+    def __init__(self, methodName='runTest'):
+        self.target = oeRuntimeTest.tc.target
+        super(oeRuntimeTest, self).__init__(methodName)
+
+    def setUp(self):
+        # Check if test needs to run
+        if self.tc.sigterm:
+            self.fail("Got SIGTERM")
+        elif (type(self.target).__name__ == "QemuTarget"):
+            self.assertTrue(self.target.check(), msg = "Qemu not running?")
+
+    def tearDown(self):
+        # If a test fails or there is an exception
+        if not exc_info() == (None, None, None):
+            exc_clear()
+            #Only dump for QemuTarget
+            if (type(self.target).__name__ == "QemuTarget"):
+                self.tc.host_dumper.create_dir(self._testMethodName)
+                self.tc.host_dumper.dump_host()
+                self.target.target_dumper.dump_target(
+                        self.tc.host_dumper.dump_dir)
+                print ("%s dump data stored in %s" % (self._testMethodName,
+                         self.tc.host_dumper.dump_dir))
+
+    #TODO: use package_manager.py to install packages on any type of image
+    def install_packages(self, packagelist):
+        for package in packagelist:
+            (status, result) = self.target.run("smart install -y "+package)
+            if status != 0:
+                return status
+
+class oeSDKTest(oeTest):
+    def __init__(self, methodName='runTest'):
+        self.sdktestdir = oeSDKTest.tc.sdktestdir
+        super(oeSDKTest, self).__init__(methodName)
+
+    @classmethod
+    def hasHostPackage(self, pkg):
+
+        if re.search(pkg, oeTest.tc.hostpkgmanifest):
+            return True
+        return False
+
+    def _run(self, cmd):
+        return subprocess.check_output(cmd, shell=True)
+
+def getmodule(pos=2):
+    # stack returns a list of tuples containg frame information
+    # First element of the list the is current frame, caller is 1
+    frameinfo = inspect.stack()[pos]
+    modname = inspect.getmodulename(frameinfo[1])
+    #modname = inspect.getmodule(frameinfo[0]).__name__
+    return modname
+
+def skipModule(reason, pos=2):
+    modname = getmodule(pos)
+    if modname not in oeTest.tc.testsrequired:
+        raise unittest.SkipTest("%s: %s" % (modname, reason))
+    else:
+        raise Exception("\nTest %s wants to be skipped.\nReason is: %s" \
+                "\nTest was required in TEST_SUITES, so either the condition for skipping is wrong" \
+                "\nor the image really doesn't have the required feature/package when it should." % (modname, reason))
+
+def skipModuleIf(cond, reason):
+
+    if cond:
+        skipModule(reason, 3)
+
+def skipModuleUnless(cond, reason):
+
+    if not cond:
+        skipModule(reason, 3)
diff --git a/meta/lib/oeqa/runexported.py b/meta/lib/oeqa/runexported.py
new file mode 100755
index 0000000..96442b1
--- /dev/null
+++ b/meta/lib/oeqa/runexported.py
@@ -0,0 +1,146 @@
+#!/usr/bin/env python
+
+
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This script should be used outside of the build system to run image tests.
+# It needs a json file as input as exported by the build.
+# E.g for an already built image:
+#- export the tests:
+#   TEST_EXPORT_ONLY = "1"
+#   TEST_TARGET  = "simpleremote"
+#   TEST_TARGET_IP = "192.168.7.2"
+#   TEST_SERVER_IP = "192.168.7.1"
+# bitbake core-image-sato -c testimage
+# Setup your target, e.g for qemu: runqemu core-image-sato
+# cd build/tmp/testimage/core-image-sato
+# ./runexported.py testdata.json
+
+import sys
+import os
+import time
+from optparse import OptionParser
+
+try:
+    import simplejson as json
+except ImportError:
+    import json
+
+sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa")))
+
+from oeqa.oetest import runTests
+from oeqa.utils.sshcontrol import SSHControl
+from oeqa.utils.dump import get_host_dumper
+
+# this isn't pretty but we need a fake target object
+# for running the tests externally as we don't care
+# about deploy/start we only care about the connection methods (run, copy)
+class FakeTarget(object):
+    def __init__(self, d):
+        self.connection = None
+        self.ip = None
+        self.server_ip = None
+        self.datetime = time.strftime('%Y%m%d%H%M%S',time.gmtime())
+        self.testdir = d.getVar("TEST_LOG_DIR", True)
+        self.pn = d.getVar("PN", True)
+
+    def exportStart(self):
+        self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
+        sshloglink = os.path.join(self.testdir, "ssh_target_log")
+        if os.path.islink(sshloglink):
+            os.unlink(sshloglink)
+        os.symlink(self.sshlog, sshloglink)
+        print("SSH log file: %s" %  self.sshlog)
+        self.connection = SSHControl(self.ip, logfile=self.sshlog)
+
+    def run(self, cmd, timeout=None):
+        return self.connection.run(cmd, timeout)
+
+    def copy_to(self, localpath, remotepath):
+        return self.connection.copy_to(localpath, remotepath)
+
+    def copy_from(self, remotepath, localpath):
+        return self.connection.copy_from(remotepath, localpath)
+
+
+class MyDataDict(dict):
+    def getVar(self, key, unused = None):
+        return self.get(key, "")
+
+class TestContext(object):
+    def __init__(self):
+        self.d = None
+        self.target = None
+
+def main():
+
+    usage = "usage: %prog [options] <json file>"
+    parser = OptionParser(usage=usage)
+    parser.add_option("-t", "--target-ip", dest="ip", help="The IP address of the target machine. Use this to \
+            overwrite the value determined from TEST_TARGET_IP at build time")
+    parser.add_option("-s", "--server-ip", dest="server_ip", help="The IP address of this machine. Use this to \
+            overwrite the value determined from TEST_SERVER_IP at build time.")
+    parser.add_option("-d", "--deploy-dir", dest="deploy_dir", help="Full path to the package feeds, that this \
+            the contents of what used to be DEPLOY_DIR on the build machine. If not specified it will use the value \
+            specified in the json if that directory actually exists or it will error out.")
+    parser.add_option("-l", "--log-dir", dest="log_dir", help="This sets the path for TEST_LOG_DIR. If not specified \
+            the current dir is used. This is used for usually creating a ssh log file and a scp test file.")
+
+    (options, args) = parser.parse_args()
+    if len(args) != 1:
+        parser.error("Incorrect number of arguments. The one and only argument should be a json file exported by the build system")
+
+    with open(args[0], "r") as f:
+        loaded = json.load(f)
+
+    if options.ip:
+        loaded["target"]["ip"] = options.ip
+    if options.server_ip:
+        loaded["target"]["server_ip"] = options.server_ip
+
+    d = MyDataDict()
+    for key in loaded["d"].keys():
+        d[key] = loaded["d"][key]
+
+    if options.log_dir:
+        d["TEST_LOG_DIR"] = options.log_dir
+    else:
+        d["TEST_LOG_DIR"] = os.path.abspath(os.path.dirname(__file__))
+    if options.deploy_dir:
+        d["DEPLOY_DIR"] = options.deploy_dir
+    else:
+        if not os.path.isdir(d["DEPLOY_DIR"]):
+            raise Exception("The path to DEPLOY_DIR does not exists: %s" % d["DEPLOY_DIR"])
+
+
+    target = FakeTarget(d)
+    for key in loaded["target"].keys():
+        setattr(target, key, loaded["target"][key])
+
+    host_dumper = get_host_dumper(d)
+    host_dumper.parent_dir = loaded["host_dumper"]["parent_dir"]
+    host_dumper.cmds = loaded["host_dumper"]["cmds"]
+
+    tc = TestContext()
+    setattr(tc, "d", d)
+    setattr(tc, "target", target)
+    setattr(tc, "host_dumper", host_dumper)
+    for key in loaded.keys():
+        if key != "d" and key != "target" and key != "host_dumper":
+            setattr(tc, key, loaded[key])
+
+    target.exportStart()
+    runTests(tc)
+
+    return 0
+
+if __name__ == "__main__":
+    try:
+        ret = main()
+    except Exception:
+        ret = 1
+        import traceback
+        traceback.print_exc(5)
+    sys.exit(ret)
diff --git a/meta/lib/oeqa/runtime/__init__.py b/meta/lib/oeqa/runtime/__init__.py
new file mode 100644
index 0000000..4cf3fa7
--- /dev/null
+++ b/meta/lib/oeqa/runtime/__init__.py
@@ -0,0 +1,3 @@
+# Enable other layers to have tests in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/meta/lib/oeqa/runtime/_ptest.py b/meta/lib/oeqa/runtime/_ptest.py
new file mode 100644
index 0000000..81c9c43
--- /dev/null
+++ b/meta/lib/oeqa/runtime/_ptest.py
@@ -0,0 +1,125 @@
+import unittest, os, shutil
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.logparser import *
+from oeqa.utils.httpserver import HTTPService
+import bb
+import glob
+from oe.package_manager import RpmPkgsList
+import subprocess
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("package-management"):
+        skipModule("Image doesn't have package management feature")
+    if not oeRuntimeTest.hasPackage("smart"):
+        skipModule("Image doesn't have smart installed")
+    if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
+        skipModule("Rpm is not the primary package manager")
+
+class PtestRunnerTest(oeRuntimeTest):
+
+    # a ptest log parser
+    def parse_ptest(self, logfile):
+        parser = Lparser(test_0_pass_regex="^PASS:(.+)", test_0_fail_regex="^FAIL:(.+)", section_0_begin_regex="^BEGIN: .*/(.+)/ptest", section_0_end_regex="^END: .*/(.+)/ptest")
+        parser.init()
+        result = Result()
+
+        with open(logfile) as f:
+            for line in f:
+                result_tuple = parser.parse_line(line)
+                if not result_tuple:
+                    continue
+                result_tuple = line_type, category, status, name = parser.parse_line(line)
+
+                if line_type == 'section' and status == 'begin':
+                    current_section = name
+                    continue
+
+                if line_type == 'section' and status == 'end':
+                    current_section = None
+                    continue
+
+                if line_type == 'test' and status == 'pass':
+                    result.store(current_section, name, status)
+                    continue
+
+                if line_type == 'test' and status == 'fail':
+                    result.store(current_section, name, status)
+                    continue
+
+        result.sort_tests()
+        return result
+
+    @classmethod
+    def setUpClass(self):
+        #note the existing channels that are on the board before creating new ones
+#        self.existingchannels = set()
+#        (status, result) = oeRuntimeTest.tc.target.run('smart channel --show | grep "\["', 0)
+#        for x in result.split("\n"):
+#            self.existingchannels.add(x)
+        self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), oeRuntimeTest.tc.target.server_ip)
+        self.repo_server.start()
+
+    @classmethod
+    def tearDownClass(self):
+        self.repo_server.stop()
+        #remove created channels to be able to repeat the tests on same image
+#        (status, result) = oeRuntimeTest.tc.target.run('smart channel --show | grep "\["', 0)
+#        for x in result.split("\n"):
+#            if x not in self.existingchannels:
+#                oeRuntimeTest.tc.target.run('smart channel --remove '+x[1:-1]+' -y', 0)
+
+    def add_smart_channel(self):
+        image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE', True)
+        deploy_url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, image_pkgtype)
+        pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS', True).replace("-","_").split()
+        for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)):
+            if arch in pkgarchs:
+                self.target.run('smart channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url), 0)
+        self.target.run('smart update', 0)
+
+    def install_complementary(self, globs=None):
+        installed_pkgs_file = os.path.join(oeRuntimeTest.tc.d.getVar('WORKDIR', True),
+                                           "installed_pkgs.txt")
+        self.pkgs_list = RpmPkgsList(oeRuntimeTest.tc.d, oeRuntimeTest.tc.d.getVar('IMAGE_ROOTFS', True), oeRuntimeTest.tc.d.getVar('arch_var', True), oeRuntimeTest.tc.d.getVar('os_var', True))
+        with open(installed_pkgs_file, "w+") as installed_pkgs:
+            installed_pkgs.write(self.pkgs_list.list("arch"))
+
+        cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
+               "-p", oeRuntimeTest.tc.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file,
+               globs]
+        try:
+            bb.note("Installing complementary packages ...")
+            complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
+        except subprocess.CalledProcessError as e:
+            bb.fatal("Could not compute complementary packages list. Command "
+                     "'%s' returned %d:\n%s" %
+                     (' '.join(cmd), e.returncode, e.output))
+
+        return complementary_pkgs.split()
+
+    def setUp(self):
+        self.ptest_log = os.path.join(oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR",True), "ptest-%s.log" % oeRuntimeTest.tc.d.getVar('DATETIME', True))
+
+    @skipUnlessPassed('test_ssh')
+    def test_ptestrunner(self):
+        self.add_smart_channel()
+        (runnerstatus, result) = self.target.run('which ptest-runner', 0)
+        cond = oeRuntimeTest.hasPackage("ptest-runner") and oeRuntimeTest.hasFeature("ptest") and oeRuntimeTest.hasPackage("-ptest") and (runnerstatus != 0)
+        if cond:
+            self.install_packages(self.install_complementary("*-ptest"))
+            self.install_packages(['ptest-runner'])
+
+        (runnerstatus, result) = self.target.run('/usr/bin/ptest-runner > /tmp/ptest.log 2>&1', 0)
+        #exit code is !=0 even if ptest-runner executes because some ptest tests fail.
+        self.assertTrue(runnerstatus != 127, msg="Cannot execute ptest-runner!")
+        self.target.copy_from('/tmp/ptest.log', self.ptest_log)
+        shutil.copyfile(self.ptest_log, "ptest.log")
+
+        result = self.parse_ptest("ptest.log")
+        log_results_to_location = "./results"
+        if os.path.exists(log_results_to_location):
+            shutil.rmtree(log_results_to_location)
+        os.makedirs(log_results_to_location)
+
+        result.log_as_files(log_results_to_location, test_status = ['pass','fail'])
diff --git a/meta/lib/oeqa/runtime/_qemutiny.py b/meta/lib/oeqa/runtime/_qemutiny.py
new file mode 100644
index 0000000..a3c29f3
--- /dev/null
+++ b/meta/lib/oeqa/runtime/_qemutiny.py
@@ -0,0 +1,9 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.qemutinyrunner import *
+
+class QemuTinyTest(oeRuntimeTest):
+
+    def test_boot_tiny(self):
+        (status, output) = self.target.run_serial('uname -a')
+        self.assertTrue("yocto-tiny" in output, msg="Cannot detect poky tiny boot!")
\ No newline at end of file
diff --git a/meta/lib/oeqa/runtime/buildcvs.py b/meta/lib/oeqa/runtime/buildcvs.py
new file mode 100644
index 0000000..fe6cbfb
--- /dev/null
+++ b/meta/lib/oeqa/runtime/buildcvs.py
@@ -0,0 +1,31 @@
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import TargetBuildProject
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("tools-sdk"):
+        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+class BuildCvsTest(oeRuntimeTest):
+
+    @classmethod
+    def setUpClass(self):
+        self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
+                        "http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/cvs-1.12.13.tar.bz2")
+        self.project.download_archive()
+
+    @testcase(205)
+    @skipUnlessPassed("test_ssh")
+    def test_cvs(self):
+        self.assertEqual(self.project.run_configure(), 0,
+                        msg="Running configure failed")
+
+        self.assertEqual(self.project.run_make(), 0,
+                        msg="Running make failed")
+
+        self.assertEqual(self.project.run_install(), 0,
+                        msg="Running make install failed")
+
+    @classmethod
+    def tearDownClass(self):
+        self.project.clean()
diff --git a/meta/lib/oeqa/runtime/buildiptables.py b/meta/lib/oeqa/runtime/buildiptables.py
new file mode 100644
index 0000000..09e252d
--- /dev/null
+++ b/meta/lib/oeqa/runtime/buildiptables.py
@@ -0,0 +1,31 @@
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import TargetBuildProject
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("tools-sdk"):
+        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+class BuildIptablesTest(oeRuntimeTest):
+
+    @classmethod
+    def setUpClass(self):
+        self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
+                        "http://netfilter.org/projects/iptables/files/iptables-1.4.13.tar.bz2")
+        self.project.download_archive()
+
+    @testcase(206)
+    @skipUnlessPassed("test_ssh")
+    def test_iptables(self):
+        self.assertEqual(self.project.run_configure(), 0,
+                        msg="Running configure failed")
+
+        self.assertEqual(self.project.run_make(), 0,
+                        msg="Running make failed")
+
+        self.assertEqual(self.project.run_install(), 0,
+                        msg="Running make install failed")
+
+    @classmethod
+    def tearDownClass(self):
+        self.project.clean()
diff --git a/meta/lib/oeqa/runtime/buildsudoku.py b/meta/lib/oeqa/runtime/buildsudoku.py
new file mode 100644
index 0000000..802b060
--- /dev/null
+++ b/meta/lib/oeqa/runtime/buildsudoku.py
@@ -0,0 +1,28 @@
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import TargetBuildProject
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("tools-sdk"):
+        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+class SudokuTest(oeRuntimeTest):
+
+    @classmethod
+    def setUpClass(self):
+        self.project = TargetBuildProject(oeRuntimeTest.tc.target, oeRuntimeTest.tc.d,
+                        "http://downloads.sourceforge.net/project/sudoku-savant/sudoku-savant/sudoku-savant-1.3/sudoku-savant-1.3.tar.bz2")
+        self.project.download_archive()
+
+    @testcase(207)
+    @skipUnlessPassed("test_ssh")
+    def test_sudoku(self):
+        self.assertEqual(self.project.run_configure(), 0,
+                        msg="Running configure failed")
+
+        self.assertEqual(self.project.run_make(), 0,
+                        msg="Running make failed")
+
+    @classmethod
+    def tearDownClass(self):
+        self.project.clean()
diff --git a/meta/lib/oeqa/runtime/connman.py b/meta/lib/oeqa/runtime/connman.py
new file mode 100644
index 0000000..ee69e5d
--- /dev/null
+++ b/meta/lib/oeqa/runtime/connman.py
@@ -0,0 +1,54 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasPackage("connman"):
+        skipModule("No connman package in image")
+
+
+class ConnmanTest(oeRuntimeTest):
+
+    def service_status(self, service):
+        if oeRuntimeTest.hasFeature("systemd"):
+            (status, output) = self.target.run('systemctl status -l %s' % service)
+            return output
+        else:
+            return "Unable to get status or logs for %s" % service
+
+    @testcase(961)
+    @skipUnlessPassed('test_ssh')
+    def test_connmand_help(self):
+        (status, output) = self.target.run('/usr/sbin/connmand --help')
+        self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
+
+    @testcase(221)
+    @skipUnlessPassed('test_connmand_help')
+    def test_connmand_running(self):
+        (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand')
+        if status != 0:
+            print self.service_status("connman")
+            self.fail("No connmand process running")
+
+    @testcase(223)
+    def test_only_one_connmand_in_background(self):
+        """
+        Summary:     Only one connmand in background
+        Expected:    There will be only one connmand instance in background.
+        Product:     BSPs
+        Author:      Alexandru Georgescu <alexandru.c.georgescu@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+
+        # Make sure that 'connmand' is running in background
+        (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand')
+        self.assertEqual(0, status, 'Failed to find "connmand" process running in background.')
+
+        # Start a new instance of 'connmand'
+        (status, output) = self.target.run('connmand')
+        self.assertEqual(0, status, 'Failed to start a new "connmand" process.')
+
+        # Make sure that only one 'connmand' is running in background
+        (status, output) = self.target.run(oeRuntimeTest.pscmd + ' | grep [c]onnmand | wc -l')
+        self.assertEqual(0, status, 'Failed to find "connmand" process running in background.')
+        self.assertEqual(1, int(output), 'Found {} connmand processes running, expected 1.'.format(output))
diff --git a/meta/lib/oeqa/runtime/date.py b/meta/lib/oeqa/runtime/date.py
new file mode 100644
index 0000000..3a8fe84
--- /dev/null
+++ b/meta/lib/oeqa/runtime/date.py
@@ -0,0 +1,31 @@
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+import re
+
+class DateTest(oeRuntimeTest):
+
+    def setUp(self):
+        if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
+            self.target.run('systemctl stop systemd-timesyncd')
+
+    def tearDown(self):
+        if oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True) == "systemd":
+            self.target.run('systemctl start systemd-timesyncd')
+
+    @testcase(211)
+    @skipUnlessPassed("test_ssh")
+    def test_date(self):
+        (status, output) = self.target.run('date +"%Y-%m-%d %T"')
+        self.assertEqual(status, 0, msg="Failed to get initial date, output: %s" % output)
+        oldDate = output
+
+        sampleDate = '"2016-08-09 10:00:00"'
+        (status, output) = self.target.run("date -s %s" % sampleDate)
+        self.assertEqual(status, 0, msg="Date set failed, output: %s" % output)
+
+        (status, output) = self.target.run("date -R")
+        p = re.match('Tue, 09 Aug 2016 10:00:.. \+0000', output)
+        self.assertTrue(p, msg="The date was not set correctly, output: %s" % output)
+
+        (status, output) = self.target.run('date -s "%s"' % oldDate)
+        self.assertEqual(status, 0, msg="Failed to reset date, output: %s" % output)
diff --git a/meta/lib/oeqa/runtime/df.py b/meta/lib/oeqa/runtime/df.py
new file mode 100644
index 0000000..09569d5
--- /dev/null
+++ b/meta/lib/oeqa/runtime/df.py
@@ -0,0 +1,12 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+
+
+class DfTest(oeRuntimeTest):
+
+    @testcase(234)
+    @skipUnlessPassed("test_ssh")
+    def test_df(self):
+        (status,output) = self.target.run("df / | sed -n '2p' | awk '{print $4}'")
+        self.assertTrue(int(output)>5120, msg="Not enough space on image. Current size is %s" % output)
diff --git a/meta/lib/oeqa/runtime/dmesg.py b/meta/lib/oeqa/runtime/dmesg.py
new file mode 100644
index 0000000..5831471
--- /dev/null
+++ b/meta/lib/oeqa/runtime/dmesg.py
@@ -0,0 +1,12 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+
+
+class DmesgTest(oeRuntimeTest):
+
+    @testcase(215)
+    @skipUnlessPassed('test_ssh')
+    def test_dmesg(self):
+        (status, output) = self.target.run('dmesg | grep -v mmci-pl18x | grep -v "error changing net interface name" | grep -iv "dma timeout" | grep -v usbhid | grep -i error')
+        self.assertEqual(status, 1, msg = "Error messages in dmesg log: %s" % output)
diff --git a/meta/lib/oeqa/runtime/files/hellomod.c b/meta/lib/oeqa/runtime/files/hellomod.c
new file mode 100644
index 0000000..a383397
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/hellomod.c
@@ -0,0 +1,19 @@
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+
+static int __init hello_init(void)
+{
+        printk(KERN_INFO "Hello world!\n");
+        return 0;
+}
+
+static void __exit hello_cleanup(void)
+{
+        printk(KERN_INFO "Cleaning up hellomod.\n");
+}
+
+module_init(hello_init);
+module_exit(hello_cleanup);
+
+MODULE_LICENSE("GPL");
diff --git a/meta/lib/oeqa/runtime/files/hellomod_makefile b/meta/lib/oeqa/runtime/files/hellomod_makefile
new file mode 100644
index 0000000..b92d5c8
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/hellomod_makefile
@@ -0,0 +1,8 @@
+obj-m := hellomod.o
+KDIR := /usr/src/kernel
+
+all:
+	$(MAKE) -C $(KDIR) M=$(PWD) modules
+
+clean:
+	$(MAKE) -C $(KDIR) M=$(PWD) clean
diff --git a/meta/lib/oeqa/runtime/files/test.c b/meta/lib/oeqa/runtime/files/test.c
new file mode 100644
index 0000000..2d8389c
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/test.c
@@ -0,0 +1,26 @@
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+double convert(long long l)
+{
+  return (double)l;
+}
+
+int main(int argc, char * argv[]) {
+
+  long long l = 10;
+  double f;
+  double check = 10.0;
+
+  f = convert(l);
+  printf("convert: %lld => %f\n", l, f);
+  if ( f != check ) exit(1);
+
+  f = 1234.67;
+  check = 1234.0;
+  printf("floorf(%f) = %f\n", f, floorf(f));
+  if ( floorf(f) != check) exit(1);
+
+  return 0;
+}
diff --git a/meta/lib/oeqa/runtime/files/test.cpp b/meta/lib/oeqa/runtime/files/test.cpp
new file mode 100644
index 0000000..9e1a764
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/test.cpp
@@ -0,0 +1,3 @@
+#include <limits>
+
+int main() {}
\ No newline at end of file
diff --git a/meta/lib/oeqa/runtime/files/test.pl b/meta/lib/oeqa/runtime/files/test.pl
new file mode 100644
index 0000000..689c8f1
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/test.pl
@@ -0,0 +1,2 @@
+$a = 9.01e+21 - 9.01e+21 + 0.01;
+print ("the value of a is ", $a, "\n");
diff --git a/meta/lib/oeqa/runtime/files/test.py b/meta/lib/oeqa/runtime/files/test.py
new file mode 100644
index 0000000..f3a2273
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/test.py
@@ -0,0 +1,6 @@
+import os
+
+os.system('touch /tmp/testfile.python')
+
+a = 9.01e+21 - 9.01e+21 + 0.01
+print "the value of a is %s" % a
diff --git a/meta/lib/oeqa/runtime/files/testmakefile b/meta/lib/oeqa/runtime/files/testmakefile
new file mode 100644
index 0000000..ca1844e
--- /dev/null
+++ b/meta/lib/oeqa/runtime/files/testmakefile
@@ -0,0 +1,5 @@
+test: test.o
+	gcc -o test test.o -lm
+test.o: test.c
+	gcc -c test.c
+
diff --git a/meta/lib/oeqa/runtime/gcc.py b/meta/lib/oeqa/runtime/gcc.py
new file mode 100644
index 0000000..d90cd17
--- /dev/null
+++ b/meta/lib/oeqa/runtime/gcc.py
@@ -0,0 +1,47 @@
+import unittest
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("tools-sdk"):
+        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+
+class GccCompileTest(oeRuntimeTest):
+
+    @classmethod
+    def setUpClass(self):
+        oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.c"), "/tmp/test.c")
+        oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "testmakefile"), "/tmp/testmakefile")
+        oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.cpp"), "/tmp/test.cpp")
+
+    @testcase(203)
+    def test_gcc_compile(self):
+        (status, output) = self.target.run('gcc /tmp/test.c -o /tmp/test -lm')
+        self.assertEqual(status, 0, msg="gcc compile failed, output: %s" % output)
+        (status, output) = self.target.run('/tmp/test')
+        self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
+
+    @testcase(200)
+    def test_gpp_compile(self):
+        (status, output) = self.target.run('g++ /tmp/test.c -o /tmp/test -lm')
+        self.assertEqual(status, 0, msg="g++ compile failed, output: %s" % output)
+        (status, output) = self.target.run('/tmp/test')
+        self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
+
+    @testcase(1142)
+    def test_gpp2_compile(self):
+        (status, output) = self.target.run('g++ /tmp/test.cpp -o /tmp/test -lm')
+        self.assertEqual(status, 0, msg="g++ compile failed, output: %s" % output)
+        (status, output) = self.target.run('/tmp/test')
+        self.assertEqual(status, 0, msg="running compiled file failed, output %s" % output)
+
+    @testcase(204)
+    def test_make(self):
+        (status, output) = self.target.run('cd /tmp; make -f testmakefile')
+        self.assertEqual(status, 0, msg="running make failed, output %s" % output)
+
+    @classmethod
+    def tearDownClass(self):
+        oeRuntimeTest.tc.target.run("rm /tmp/test.c /tmp/test.o /tmp/test /tmp/testmakefile")
diff --git a/meta/lib/oeqa/runtime/kernelmodule.py b/meta/lib/oeqa/runtime/kernelmodule.py
new file mode 100644
index 0000000..2e81720
--- /dev/null
+++ b/meta/lib/oeqa/runtime/kernelmodule.py
@@ -0,0 +1,34 @@
+import unittest
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("tools-sdk"):
+        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+
+class KernelModuleTest(oeRuntimeTest):
+
+    def setUp(self):
+        self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod.c"), "/tmp/hellomod.c")
+        self.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "hellomod_makefile"), "/tmp/Makefile")
+
+    @testcase('316')
+    @skipUnlessPassed('test_ssh')
+    @skipUnlessPassed('test_gcc_compile')
+    def test_kernel_module(self):
+        cmds = [
+            'cd /usr/src/kernel && make scripts',
+            'cd /tmp && make',
+            'cd /tmp && insmod hellomod.ko',
+            'lsmod | grep hellomod',
+            'dmesg | grep Hello',
+            'rmmod hellomod', 'dmesg | grep "Cleaning up hellomod"'
+            ]
+        for cmd in cmds:
+            (status, output) = self.target.run(cmd, 900)
+            self.assertEqual(status, 0, msg="\n".join([cmd, output]))
+
+    def tearDown(self):
+        self.target.run('rm -f /tmp/Makefile /tmp/hellomod.c')
diff --git a/meta/lib/oeqa/runtime/ldd.py b/meta/lib/oeqa/runtime/ldd.py
new file mode 100644
index 0000000..47b3885
--- /dev/null
+++ b/meta/lib/oeqa/runtime/ldd.py
@@ -0,0 +1,21 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("tools-sdk"):
+        skipModule("Image doesn't have tools-sdk in IMAGE_FEATURES")
+
+class LddTest(oeRuntimeTest):
+
+    @testcase(962)
+    @skipUnlessPassed('test_ssh')
+    def test_ldd_exists(self):
+        (status, output) = self.target.run('which ldd')
+        self.assertEqual(status, 0, msg = "ldd does not exist in PATH: which ldd: %s" % output)
+
+    @testcase(239)
+    @skipUnlessPassed('test_ldd_exists')
+    def test_ldd_rtldlist_check(self):
+        (status, output) = self.target.run('for i in $(which ldd | xargs cat | grep "^RTLDLIST"|cut -d\'=\' -f2|tr -d \'"\'); do test -f $i && echo $i && break; done')
+        self.assertEqual(status, 0, msg = "ldd path not correct or RTLDLIST files don't exist. ")
diff --git a/meta/lib/oeqa/runtime/logrotate.py b/meta/lib/oeqa/runtime/logrotate.py
new file mode 100644
index 0000000..86d791c
--- /dev/null
+++ b/meta/lib/oeqa/runtime/logrotate.py
@@ -0,0 +1,28 @@
+# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=289 testcase
+# Note that the image under test must have logrotate installed
+
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasPackage("logrotate"):
+        skipModule("No logrotate package in image")
+
+
+class LogrotateTest(oeRuntimeTest):
+
+    @skipUnlessPassed("test_ssh")
+    def test_1_logrotate_setup(self):
+        (status, output) = self.target.run('mkdir /home/root/logrotate_dir')
+        self.assertEqual(status, 0, msg = "Could not create logrotate_dir. Output: %s" % output)
+        (status, output) = self.target.run("sed -i 's#wtmp {#wtmp {\\n    olddir /home/root/logrotate_dir#' /etc/logrotate.conf")
+        self.assertEqual(status, 0, msg = "Could not write to logrotate.conf file. Status and output: %s and %s)" % (status, output))
+
+    @testcase(289)
+    @skipUnlessPassed("test_1_logrotate_setup")
+    def test_2_logrotate(self):
+        (status, output) = self.target.run('logrotate -f /etc/logrotate.conf')
+        self.assertEqual(status, 0, msg = "logrotate service could not be reloaded. Status and output: %s and %s" % (status, output))
+        output = self.target.run('ls -la /home/root/logrotate_dir/ | wc -l')[1]
+        self.assertTrue(int(output)>=3, msg = "new logfile could not be created. List of files within log directory: %s" %(self.target.run('ls -la /home/root/logrotate_dir')[1]))
diff --git a/meta/lib/oeqa/runtime/multilib.py b/meta/lib/oeqa/runtime/multilib.py
new file mode 100644
index 0000000..e1bcc42
--- /dev/null
+++ b/meta/lib/oeqa/runtime/multilib.py
@@ -0,0 +1,48 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    multilibs = oeRuntimeTest.tc.d.getVar("MULTILIBS", True) or ""
+    if "multilib:lib32" not in multilibs:
+        skipModule("this isn't a multilib:lib32 image")
+
+
+class MultilibTest(oeRuntimeTest):
+
+    def parse(self, s):
+        """
+        Parse the output of readelf -h and return the binary class, or fail.
+        """
+        l = [l.split()[1] for l in s.split('\n') if "Class:" in l]
+        if l:
+            return l[0]
+        else:
+            self.fail("Cannot parse readelf output\n" + s)
+
+    @skipUnlessPassed('test_ssh')
+    def test_check_multilib_libc(self):
+        """
+        Check that a multilib image has both 32-bit and 64-bit libc in.
+        """
+
+        (status, output) = self.target.run("readelf -h /lib/libc.so.6")
+        self.assertEqual(status, 0, "Failed to readelf /lib/libc.so.6")
+        class32 = self.parse(output)
+
+        (status, output) = self.target.run("readelf -h /lib64/libc.so.6")
+        self.assertEqual(status, 0, "Failed to readelf /lib64/libc.so.6")
+        class64 = self.parse(output)
+
+        self.assertEqual(class32, "ELF32", msg="/lib/libc.so.6 isn't ELF32 (is %s)" % class32)
+        self.assertEqual(class64, "ELF64", msg="/lib64/libc.so.6 isn't ELF64 (is %s)" % class64)
+
+    @testcase('279')
+    @skipUnlessPassed('test_check_multilib_libc')
+    def test_file_connman(self):
+        self.assertTrue(oeRuntimeTest.hasPackage('lib32-connman-gnome'), msg="This test assumes lib32-connman-gnome is installed")
+
+        (status, output) = self.target.run("readelf -h /usr/bin/connman-applet")
+        self.assertEqual(status, 0, "Failed to readelf /usr/bin/connman-applet")
+        theclass = self.parse(output)
+        self.assertEqual(theclass, "ELF32", msg="connman-applet isn't ELF32 (is %s)" % theclass)
diff --git a/meta/lib/oeqa/runtime/pam.py b/meta/lib/oeqa/runtime/pam.py
new file mode 100644
index 0000000..c8205c9
--- /dev/null
+++ b/meta/lib/oeqa/runtime/pam.py
@@ -0,0 +1,25 @@
+# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=287 testcase
+# Note that the image under test must have "pam" in DISTRO_FEATURES
+
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("pam"):
+        skipModule("target doesn't have 'pam' in DISTRO_FEATURES")
+
+
+class PamBasicTest(oeRuntimeTest):
+
+    @testcase(287)
+    @skipUnlessPassed('test_ssh')
+    def test_pam(self):
+        (status, output) = self.target.run('login --help')
+        self.assertEqual(status, 1, msg = "login command does not work as expected. Status and output:%s and %s" %(status, output))
+        (status, output) = self.target.run('passwd --help')
+        self.assertEqual(status, 0, msg = "passwd command does not work as expected. Status and output:%s and %s" %(status, output))
+        (status, output) = self.target.run('su --help')
+        self.assertEqual(status, 0, msg = "su command does not work as expected. Status and output:%s and %s" %(status, output))
+        (status, output) = self.target.run('useradd --help')
+        self.assertEqual(status, 0, msg = "useradd command does not work as expected. Status and output:%s and %s" %(status, output))
diff --git a/meta/lib/oeqa/runtime/parselogs.py b/meta/lib/oeqa/runtime/parselogs.py
new file mode 100644
index 0000000..e20947b
--- /dev/null
+++ b/meta/lib/oeqa/runtime/parselogs.py
@@ -0,0 +1,257 @@
+import os
+import unittest
+import subprocess
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+
+#in the future these lists could be moved outside of module
+errors = ["error", "cannot", "can\'t", "failed"]
+
+common_errors = [
+    "(WW) warning, (EE) error, (NI) not implemented, (??) unknown.",
+    "dma timeout",
+    "can\'t add hid device:",
+    "usbhid: probe of ",
+    "_OSC failed (AE_ERROR)",
+    "_OSC failed (AE_SUPPORT)",
+    "AE_ALREADY_EXISTS",
+    "ACPI _OSC request failed (AE_SUPPORT)",
+    "can\'t disable ASPM",
+    "Failed to load module \"vesa\"",
+    "Failed to load module vesa",
+    "Failed to load module \"modesetting\"",
+    "Failed to load module modesetting",
+    "Failed to load module \"glx\"",
+    "Failed to load module \"fbdev\"",
+    "Failed to load module fbdev",
+    "Failed to load module glx",
+    "[drm] Cannot find any crtc or sizes - going 1024x768",
+    "_OSC failed (AE_NOT_FOUND); disabling ASPM",
+    "Open ACPI failed (/var/run/acpid.socket) (No such file or directory)",
+    "NX (Execute Disable) protection cannot be enabled: non-PAE kernel!",
+    "hd.: possibly failed opcode",
+    'NETLINK INITIALIZATION FAILED',
+    'kernel: Cannot find map file',
+    'omap_hwmod: debugss: _wait_target_disable failed',
+    'VGA arbiter: cannot open kernel arbiter, no multi-card support',
+    'Failed to find URL:http://ipv4.connman.net/online/status.html',
+    'Online check failed for',
+    ]
+
+x86_common = [
+    '[drm:psb_do_init] *ERROR* Debug is',
+    'wrong ELF class',
+    'Could not enable PowerButton event',
+    'probe of LNXPWRBN:00 failed with error -22',
+] + common_errors
+
+qemux86_common = [
+    'Fast TSC calibration', 
+    'wrong ELF class',
+    "fail to add MMCONFIG information, can't access extended PCI configuration space under this bridge.",
+    "can't claim BAR ",
+] + common_errors
+
+ignore_errors = { 
+    'default' : common_errors,
+    'qemux86' : [
+        'Failed to access perfctr msr (MSR',
+        ] + qemux86_common,
+    'qemux86-64' : qemux86_common,
+    'qemumips' : [
+        'Failed to load module "glx"',
+        'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
+        ] + common_errors,
+    'qemumips64' : [
+        'pci 0000:00:00.0: [Firmware Bug]: reg 0x..: invalid BAR (can\'t size)',
+         ] + common_errors,
+    'qemuppc' : [
+        'PCI 0000:00 Cannot reserve Legacy IO [io  0x0000-0x0fff]',
+        'host side 80-wire cable detection failed, limiting max speed',
+        'mode "640x480" test failed',
+        'Failed to load module "glx"',
+        ] + common_errors,
+    'qemuarm' : [
+        'mmci-pl18x: probe of fpga:05 failed with error -22',
+        'mmci-pl18x: probe of fpga:0b failed with error -22',
+        'Failed to load module "glx"'
+        ] + common_errors,
+    'qemuarm64' : [
+        'Fatal server error:',
+        '(EE) Server terminated with error (1). Closing log file.',
+        ] + common_errors,
+    'emenlow' : [
+        '[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness',
+        '(EE) Failed to load module "psb"',
+        '(EE) Failed to load module psb',
+        '(EE) Failed to load module "psbdrv"',
+        '(EE) Failed to load module psbdrv',
+        '(EE) open /dev/fb0: No such file or directory',
+        '(EE) AIGLX: reverting to software rendering',
+        ] + x86_common,
+    'core2_32' : [
+        'ACPI: No _BQC method, cannot determine initial brightness',
+        '[Firmware Bug]: ACPI: No _BQC method, cannot determine initial brightness',
+        '(EE) Failed to load module "psb"',
+        '(EE) Failed to load module psb',
+        '(EE) Failed to load module "psbdrv"',
+        '(EE) Failed to load module psbdrv',
+        '(EE) open /dev/fb0: No such file or directory',
+        '(EE) AIGLX: reverting to software rendering',
+        ] + x86_common,
+    'intel-corei7-64' : [
+        "controller can't do DEVSLP, turning off",
+        ] + common_errors,
+    'crownbay' : x86_common,
+    'genericx86' : x86_common,
+    'genericx86-64' : x86_common,
+    'edgerouter' : [
+        'Fatal server error:',
+        ] + common_errors,
+    'minnow' : [
+        'netlink init failed',
+        ] + common_errors,
+    'jasperforest' : [
+        'Activated service \'org.bluez\' failed:',
+        'Unable to find NFC netlink family',
+        'netlink init failed',
+        ] + common_errors,
+}
+
+log_locations = ["/var/log/","/var/log/dmesg", "/tmp/dmesg_output.log"]
+
+class ParseLogsTest(oeRuntimeTest):
+
+    @classmethod
+    def setUpClass(self):
+        self.errors = errors
+        self.ignore_errors = ignore_errors
+        self.log_locations = log_locations
+        self.msg = ""
+
+    def getMachine(self):
+        return oeRuntimeTest.tc.d.getVar("MACHINE", True)
+
+    #get some information on the CPU of the machine to display at the beginning of the output. This info might be useful in some cases.
+    def getHardwareInfo(self):
+        hwi = ""
+        (status, cpu_name) = self.target.run("cat /proc/cpuinfo | grep \"model name\" | head -n1 | awk 'BEGIN{FS=\":\"}{print $2}'")
+        (status, cpu_physical_cores) = self.target.run("cat /proc/cpuinfo | grep \"cpu cores\" | head -n1 | awk {'print $4'}")
+        (status, cpu_logical_cores) = self.target.run("cat /proc/cpuinfo | grep \"processor\" | wc -l")
+        (status, cpu_arch) = self.target.run("uname -m")
+        hwi += "Machine information: \n"
+        hwi += "*******************************\n"
+        hwi += "Machine name: "+self.getMachine()+"\n"
+        hwi += "CPU: "+str(cpu_name)+"\n"
+        hwi += "Arch: "+str(cpu_arch)+"\n"
+        hwi += "Physical cores: "+str(cpu_physical_cores)+"\n"
+        hwi += "Logical cores: "+str(cpu_logical_cores)+"\n"
+        hwi += "*******************************\n"
+        return hwi
+
+    #go through the log locations provided and if it's a folder create a list with all the .log files in it, if it's a file just add 
+    #it to that list
+    def getLogList(self, log_locations):
+        logs = []
+        for location in log_locations:
+            (status, output) = self.target.run("test -f "+str(location))
+            if (status == 0):
+                logs.append(str(location))
+            else:
+                (status, output) = self.target.run("test -d "+str(location))
+                if (status == 0):
+                    (status, output) = self.target.run("find "+str(location)+"/*.log -maxdepth 1 -type f")
+                    if (status == 0):
+                        output = output.splitlines()
+                        for logfile in output:
+                            logs.append(os.path.join(location,str(logfile)))
+        return logs
+
+    #copy the log files to be parsed locally
+    def transfer_logs(self, log_list):
+        target_logs = 'target_logs'
+        if not os.path.exists(target_logs):
+            os.makedirs(target_logs)
+        for f in log_list:
+            self.target.copy_from(f, target_logs)
+
+    #get the local list of logs
+    def get_local_log_list(self, log_locations):
+        self.transfer_logs(self.getLogList(log_locations))
+        logs = [ os.path.join('target_logs',f) for f in os.listdir('target_logs') if os.path.isfile(os.path.join('target_logs',f)) ]
+        return logs
+
+    #build the grep command to be used with filters and exclusions
+    def build_grepcmd(self, errors, ignore_errors, log):
+        grepcmd = "grep "
+        grepcmd +="-Ei \""
+        for error in errors:
+            grepcmd += error+"|"
+        grepcmd = grepcmd[:-1]
+        grepcmd += "\" "+str(log)+" | grep -Eiv \'"
+        try:
+            errorlist = ignore_errors[self.getMachine()]
+        except KeyError:
+            self.msg += "No ignore list found for this machine, using default\n"
+            errorlist = ignore_errors['default']
+        for ignore_error in errorlist:
+            ignore_error = ignore_error.replace("(", "\(")
+            ignore_error = ignore_error.replace(")", "\)")
+            ignore_error = ignore_error.replace("'", ".")
+            ignore_error = ignore_error.replace("?", "\?")
+            ignore_error = ignore_error.replace("[", "\[")
+            ignore_error = ignore_error.replace("]", "\]")
+            ignore_error = ignore_error.replace("*", "\*")
+            grepcmd += ignore_error+"|"
+        grepcmd = grepcmd[:-1]
+        grepcmd += "\'"
+        return grepcmd
+
+    #grep only the errors so that their context could be collected. Default context is 10 lines before and after the error itself
+    def parse_logs(self, errors, ignore_errors, logs, lines_before = 10, lines_after = 10):
+        results = {}
+        rez = []
+        grep_output = ''
+        for log in logs:
+            result = None
+            thegrep = self.build_grepcmd(errors, ignore_errors, log)
+            try:
+                result = subprocess.check_output(thegrep, shell=True)
+            except:
+                pass
+            if (result is not None):
+                results[log.replace('target_logs/','')] = {}
+                rez = result.splitlines()
+                for xrez in rez:
+                    command = "grep \"\\"+str(xrez)+"\" -B "+str(lines_before)+" -A "+str(lines_after)+" "+str(log)
+                    try:
+                        grep_output = subprocess.check_output(command, shell=True)
+                    except:
+                        pass
+                    results[log.replace('target_logs/','')][xrez]=grep_output
+        return results
+
+    #get the output of dmesg and write it in a file. This file is added to log_locations.
+    def write_dmesg(self):
+        (status, dmesg) = self.target.run("dmesg")
+        (status, dmesg2) = self.target.run("echo \""+str(dmesg)+"\" > /tmp/dmesg_output.log")
+
+    @testcase(1059)
+    @skipUnlessPassed('test_ssh')
+    def test_parselogs(self):
+        self.write_dmesg()
+        log_list = self.get_local_log_list(self.log_locations)
+        result = self.parse_logs(self.errors, self.ignore_errors, log_list)
+        print self.getHardwareInfo()
+        errcount = 0
+        for log in result:
+            self.msg += "Log: "+log+"\n"
+            self.msg += "-----------------------\n"
+            for error in result[log]:
+                errcount += 1
+                self.msg += "Central error: "+str(error)+"\n"
+                self.msg +=  "***********************\n"
+                self.msg +=  result[str(log)][str(error)]+"\n"
+                self.msg +=  "***********************\n"
+        self.msg += "%s errors found in logs." % errcount
+        self.assertEqual(errcount, 0, msg=self.msg)
diff --git a/meta/lib/oeqa/runtime/perl.py b/meta/lib/oeqa/runtime/perl.py
new file mode 100644
index 0000000..e044d0a
--- /dev/null
+++ b/meta/lib/oeqa/runtime/perl.py
@@ -0,0 +1,30 @@
+import unittest
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasPackage("perl"):
+        skipModule("No perl package in the image")
+
+
+class PerlTest(oeRuntimeTest):
+
+    @classmethod
+    def setUpClass(self):
+        oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.pl"), "/tmp/test.pl")
+
+    @testcase(1141)
+    def test_perl_exists(self):
+        (status, output) = self.target.run('which perl')
+        self.assertEqual(status, 0, msg="Perl binary not in PATH or not on target.")
+
+    @testcase(208)
+    def test_perl_works(self):
+        (status, output) = self.target.run('perl /tmp/test.pl')
+        self.assertEqual(status, 0, msg="Exit status was not 0. Output: %s" % output)
+        self.assertEqual(output, "the value of a is 0.01", msg="Incorrect output: %s" % output)
+
+    @classmethod
+    def tearDownClass(self):
+        oeRuntimeTest.tc.target.run("rm /tmp/test.pl")
diff --git a/meta/lib/oeqa/runtime/ping.py b/meta/lib/oeqa/runtime/ping.py
new file mode 100644
index 0000000..80c4601
--- /dev/null
+++ b/meta/lib/oeqa/runtime/ping.py
@@ -0,0 +1,22 @@
+import subprocess
+import unittest
+import sys
+import time
+from oeqa.oetest import oeRuntimeTest
+from oeqa.utils.decorators import *
+
+class PingTest(oeRuntimeTest):
+
+    @testcase(964)
+    def test_ping(self):
+        output = ''
+        count = 0
+        endtime = time.time() + 60
+        while count < 5 and time.time() < endtime:
+            proc = subprocess.Popen("ping -c 1 %s" % self.target.ip, shell=True, stdout=subprocess.PIPE)
+            output += proc.communicate()[0]
+            if proc.poll() == 0:
+                count += 1
+            else:
+                count = 0
+        self.assertEqual(count, 5, msg = "Expected 5 consecutive replies, got %d.\nping output is:\n%s" % (count,output))
diff --git a/meta/lib/oeqa/runtime/python.py b/meta/lib/oeqa/runtime/python.py
new file mode 100644
index 0000000..26edb7a
--- /dev/null
+++ b/meta/lib/oeqa/runtime/python.py
@@ -0,0 +1,35 @@
+import unittest
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasPackage("python"):
+        skipModule("No python package in the image")
+
+
+class PythonTest(oeRuntimeTest):
+
+    @classmethod
+    def setUpClass(self):
+        oeRuntimeTest.tc.target.copy_to(os.path.join(oeRuntimeTest.tc.filesdir, "test.py"), "/tmp/test.py")
+
+    @testcase(1145)
+    def test_python_exists(self):
+        (status, output) = self.target.run('which python')
+        self.assertEqual(status, 0, msg="Python binary not in PATH or not on target.")
+
+    @testcase(965)
+    def test_python_stdout(self):
+        (status, output) = self.target.run('python /tmp/test.py')
+        self.assertEqual(status, 0, msg="Exit status was not 0. Output: %s" % output)
+        self.assertEqual(output, "the value of a is 0.01", msg="Incorrect output: %s" % output)
+
+    @testcase(1146)
+    def test_python_testfile(self):
+        (status, output) = self.target.run('ls /tmp/testfile.python')
+        self.assertEqual(status, 0, msg="Python test file generate failed.")
+
+    @classmethod
+    def tearDownClass(self):
+        oeRuntimeTest.tc.target.run("rm /tmp/test.py /tmp/testfile.python")
diff --git a/meta/lib/oeqa/runtime/rpm.py b/meta/lib/oeqa/runtime/rpm.py
new file mode 100644
index 0000000..32aae24
--- /dev/null
+++ b/meta/lib/oeqa/runtime/rpm.py
@@ -0,0 +1,101 @@
+import unittest
+import os
+import fnmatch
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("package-management"):
+            skipModule("rpm module skipped: target doesn't have package-management in IMAGE_FEATURES")
+    if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
+            skipModule("rpm module skipped: target doesn't have rpm as primary package manager")
+
+
+class RpmBasicTest(oeRuntimeTest):
+
+    @testcase(960)
+    @skipUnlessPassed('test_ssh')
+    def test_rpm_help(self):
+        (status, output) = self.target.run('rpm --help')
+        self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
+
+    @testcase(191)
+    @skipUnlessPassed('test_rpm_help')
+    def test_rpm_query(self):
+        (status, output) = self.target.run('rpm -q rpm')
+        self.assertEqual(status, 0, msg="status and output: %s and %s" % (status,output))
+
+class RpmInstallRemoveTest(oeRuntimeTest):
+
+    @classmethod
+    def setUpClass(self):
+        pkgarch = oeRuntimeTest.tc.d.getVar('TUNE_PKGARCH', True).replace("-", "_")
+        rpmdir = os.path.join(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), "rpm", pkgarch)
+        # pick rpm-doc as a test file to get installed, because it's small and it will always be built for standard targets
+        for f in fnmatch.filter(os.listdir(rpmdir), "rpm-doc-*.%s.rpm" % pkgarch):
+            testrpmfile = f
+        oeRuntimeTest.tc.target.copy_to(os.path.join(rpmdir,testrpmfile), "/tmp/rpm-doc.rpm")
+
+    @testcase(192)
+    @skipUnlessPassed('test_rpm_help')
+    def test_rpm_install(self):
+        (status, output) = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
+        self.assertEqual(status, 0, msg="Failed to install rpm-doc package: %s" % output)
+
+    @testcase(194)
+    @skipUnlessPassed('test_rpm_install')
+    def test_rpm_remove(self):
+        (status,output) = self.target.run('rpm -e rpm-doc')
+        self.assertEqual(status, 0, msg="Failed to remove rpm-doc package: %s" % output)
+
+    @testcase(1096)
+    @skipUnlessPassed('test_ssh')
+    def test_rpm_query_nonroot(self):
+        (status, output) = self.target.run('useradd test1')
+        self.assertTrue(status == 0, msg="Failed to create new user")
+        (status, output) = self.target.run('sudo -u test1 id')
+        self.assertTrue('(test1)' in output, msg="Failed to execute as new user")
+        (status, output) = self.target.run('sudo -u test1 rpm -qa')
+        self.assertEqual(status, 0, msg="status: %s. Cannot run rpm -qa" % status)
+
+    @testcase(195)
+    @skipUnlessPassed('test_rpm_install')
+    def test_check_rpm_install_removal_log_file_size(self):
+        """
+        Summary:     Check rpm install/removal log file size
+        Expected:    There should be some method to keep rpm log in a small size .
+        Product:     BSPs
+        Author:      Alexandru Georgescu <alexandru.c.georgescu@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+        db_files_cmd = 'ls /var/lib/rpm/__db.*'
+        get_log_size_cmd = "du /var/lib/rpm/log/log.* | awk '{print $1}'"
+
+        # Make sure that some database files are under /var/lib/rpm as '__db.xxx'
+        (status, output) = self.target.run(db_files_cmd)
+        self.assertEqual(0, status, 'Failed to find database files under /var/lib/rpm/ as __db.xxx')
+
+        # Remove the package just in case
+        self.target.run('rpm -e rpm-doc')
+
+        # Install/Remove a package 10 times
+        for i in range(10):
+            (status, output) = self.target.run('rpm -ivh /tmp/rpm-doc.rpm')
+            self.assertEqual(0, status, "Failed to install rpm-doc package. Reason: {}".format(output))
+
+            (status, output) = self.target.run('rpm -e rpm-doc')
+            self.assertEqual(0, status, "Failed to remove rpm-doc package. Reason: {}".format(output))
+
+        # Get the size of log file
+        (status, output) = self.target.run(get_log_size_cmd)
+        self.assertEqual(0, status, 'Failed to get the final size of the log file.')
+
+        # Compare each log size
+        for log_file_size in output:
+            self.assertLessEqual(int(log_file_size), 11264,
+                                   'Log file size is greater that expected (~10MB), found {} bytes'.format(log_file_size))
+
+    @classmethod
+    def tearDownClass(self):
+        oeRuntimeTest.tc.target.run('rm -f /tmp/rpm-doc.rpm')
+
diff --git a/meta/lib/oeqa/runtime/scanelf.py b/meta/lib/oeqa/runtime/scanelf.py
new file mode 100644
index 0000000..43a024a
--- /dev/null
+++ b/meta/lib/oeqa/runtime/scanelf.py
@@ -0,0 +1,28 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasPackage("pax-utils"):
+        skipModule("pax-utils package not installed")
+
+class ScanelfTest(oeRuntimeTest):
+
+    def setUp(self):
+        self.scancmd = 'scanelf --quiet --recursive --mount --ldpath --path'
+
+    @testcase(966)
+    @skipUnlessPassed('test_ssh')
+    def test_scanelf_textrel(self):
+        # print TEXTREL information
+        self.scancmd += " --textrel"
+        (status, output) = self.target.run(self.scancmd)
+        self.assertEqual(output.strip(), "", "\n".join([self.scancmd, output]))
+
+    @testcase(967)
+    @skipUnlessPassed('test_ssh')
+    def test_scanelf_rpath(self):
+        # print RPATH information
+        self.scancmd += " --rpath"
+        (status, output) = self.target.run(self.scancmd)
+        self.assertEqual(output.strip(), "", "\n".join([self.scancmd, output]))
diff --git a/meta/lib/oeqa/runtime/scp.py b/meta/lib/oeqa/runtime/scp.py
new file mode 100644
index 0000000..48e87d2
--- /dev/null
+++ b/meta/lib/oeqa/runtime/scp.py
@@ -0,0 +1,22 @@
+import os
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import skipUnlessPassed, testcase
+
+def setUpModule():
+    if not (oeRuntimeTest.hasPackage("dropbear") or oeRuntimeTest.hasPackage("openssh-sshd")):
+        skipModule("No ssh package in image")
+
+class ScpTest(oeRuntimeTest):
+
+    @testcase(220)
+    @skipUnlessPassed('test_ssh')
+    def test_scp_file(self):
+        test_log_dir = oeRuntimeTest.tc.d.getVar("TEST_LOG_DIR", True)
+        test_file_path = os.path.join(test_log_dir, 'test_scp_file')
+        with open(test_file_path, 'w') as test_scp_file:
+            test_scp_file.seek(2 ** 22 - 1)
+            test_scp_file.write(os.linesep)
+        (status, output) = self.target.copy_to(test_file_path, '/tmp/test_scp_file')
+        self.assertEqual(status, 0, msg = "File could not be copied. Output: %s" % output)
+        (status, output) = self.target.run("ls -la /tmp/test_scp_file")
+        self.assertEqual(status, 0, msg = "SCP test failed")
diff --git a/meta/lib/oeqa/runtime/skeletoninit.py b/meta/lib/oeqa/runtime/skeletoninit.py
new file mode 100644
index 0000000..cb0cb9b
--- /dev/null
+++ b/meta/lib/oeqa/runtime/skeletoninit.py
@@ -0,0 +1,29 @@
+# This test should cover https://bugzilla.yoctoproject.org/tr_show_case.cgi?case_id=284 testcase
+# Note that the image under test must have meta-skeleton layer in bblayers and IMAGE_INSTALL_append = " service" in local.conf
+
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasPackage("service"):
+        skipModule("No service package in image")
+
+
+class SkeletonBasicTest(oeRuntimeTest):
+
+    @skipUnlessPassed('test_ssh')
+    @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image")
+    def test_skeleton_availability(self):
+        (status, output) = self.target.run('ls /etc/init.d/skeleton')
+        self.assertEqual(status, 0, msg = "skeleton init script not found. Output:\n%s " % output)
+        (status, output) =  self.target.run('ls /usr/sbin/skeleton-test')
+        self.assertEqual(status, 0, msg = "skeleton-test not found. Output:\n%s" % output)
+
+    @testcase(284)
+    @skipUnlessPassed('test_skeleton_availability')
+    @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image")
+    def test_skeleton_script(self):
+        output1 = self.target.run("/etc/init.d/skeleton start")[1]
+        (status, output2) = self.target.run(oeRuntimeTest.pscmd + ' | grep [s]keleton-test')
+        self.assertEqual(status, 0, msg = "Skeleton script could not be started:\n%s\n%s" % (output1, output2))
diff --git a/meta/lib/oeqa/runtime/smart.py b/meta/lib/oeqa/runtime/smart.py
new file mode 100644
index 0000000..e41668d
--- /dev/null
+++ b/meta/lib/oeqa/runtime/smart.py
@@ -0,0 +1,175 @@
+import unittest
+import re
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.httpserver import HTTPService
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("package-management"):
+        skipModule("Image doesn't have package management feature")
+    if not oeRuntimeTest.hasPackage("smart"):
+        skipModule("Image doesn't have smart installed")
+    if "package_rpm" != oeRuntimeTest.tc.d.getVar("PACKAGE_CLASSES", True).split()[0]:
+        skipModule("Rpm is not the primary package manager")
+
+class SmartTest(oeRuntimeTest):
+
+    @skipUnlessPassed('test_smart_help')
+    def smart(self, command, expected = 0):
+        command = 'smart %s' % command
+        status, output = self.target.run(command, 1500)
+        message = os.linesep.join([command, output])
+        self.assertEqual(status, expected, message)
+        self.assertFalse("Cannot allocate memory" in output, message)
+        return output
+
+class SmartBasicTest(SmartTest):
+
+    @testcase(716)
+    @skipUnlessPassed('test_ssh')
+    def test_smart_help(self):
+        self.smart('--help')
+
+    @testcase(968)
+    def test_smart_version(self):
+        self.smart('--version')
+
+    @testcase(721)
+    def test_smart_info(self):
+        self.smart('info python-smartpm')
+
+    @testcase(421)
+    def test_smart_query(self):
+        self.smart('query python-smartpm')
+
+    @testcase(720)
+    def test_smart_search(self):
+        self.smart('search python-smartpm')
+
+    @testcase(722)
+    def test_smart_stats(self):
+        self.smart('stats')
+
+class SmartRepoTest(SmartTest):
+
+    @classmethod
+    def setUpClass(self):
+        self.repolist = []
+        self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), oeRuntimeTest.tc.target.server_ip)
+        self.repo_server.start()
+
+    @classmethod
+    def tearDownClass(self):
+        self.repo_server.stop()
+        for i in self.repolist:
+            oeRuntimeTest.tc.target.run('smart channel -y --remove '+str(i))
+
+    @testcase(1143)
+    def test_smart_channel(self):
+        self.smart('channel', 1)
+
+    @testcase(719)
+    def test_smart_channel_add(self):
+        image_pkgtype = self.tc.d.getVar('IMAGE_PKGTYPE', True)
+        deploy_url = 'http://%s:%s/%s' %(self.target.server_ip, self.repo_server.port, image_pkgtype)
+        pkgarchs = self.tc.d.getVar('PACKAGE_ARCHS', True).replace("-","_").split()
+        for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)):
+            if arch in pkgarchs:
+                self.smart('channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url))
+                self.repolist.append(arch)
+        self.smart('update')
+
+    @testcase(969)
+    def test_smart_channel_help(self):
+        self.smart('channel --help')
+
+    @testcase(970)
+    def test_smart_channel_list(self):
+        self.smart('channel --list')
+
+    @testcase(971)
+    def test_smart_channel_show(self):
+        self.smart('channel --show')
+
+    @testcase(717)
+    def test_smart_channel_rpmsys(self):
+        self.smart('channel --show rpmsys')
+        self.smart('channel --disable rpmsys')
+        self.smart('channel --enable rpmsys')
+
+    @testcase(1144)
+    @skipUnlessPassed('test_smart_channel_add')
+    def test_smart_install(self):
+        self.smart('remove -y psplash-default')
+        self.smart('install -y psplash-default')
+
+    @testcase(728)
+    @skipUnlessPassed('test_smart_install')
+    def test_smart_install_dependency(self):
+        self.smart('remove -y psplash')
+        self.smart('install -y psplash-default')
+
+    @testcase(723)
+    @skipUnlessPassed('test_smart_channel_add')
+    def test_smart_install_from_disk(self):
+        self.smart('remove -y psplash-default')
+        self.smart('download psplash-default')
+        self.smart('install -y ./psplash-default*')
+
+    @testcase(725)
+    @skipUnlessPassed('test_smart_channel_add')
+    def test_smart_install_from_http(self):
+        output = self.smart('download --urls psplash-default')
+        url = re.search('(http://.*/psplash-default.*\.rpm)', output)
+        self.assertTrue(url, msg="Couln't find download url in %s" % output)
+        self.smart('remove -y psplash-default')
+        self.smart('install -y %s' % url.group(0))
+
+    @testcase(729)
+    @skipUnlessPassed('test_smart_install')
+    def test_smart_reinstall(self):
+        self.smart('reinstall -y psplash-default')
+
+    @testcase(727)
+    @skipUnlessPassed('test_smart_channel_add')
+    def test_smart_remote_repo(self):
+        self.smart('update')
+        self.smart('install -y psplash')
+        self.smart('remove -y psplash')
+
+    @testcase(726)
+    def test_smart_local_dir(self):
+        self.target.run('mkdir /tmp/myrpmdir')
+        self.smart('channel --add myrpmdir type=rpm-dir path=/tmp/myrpmdir -y')
+        self.target.run('cd /tmp/myrpmdir')
+        self.smart('download psplash')
+        output = self.smart('channel --list')
+        for i in output.split("\n"):
+            if ("rpmsys" != str(i)) and ("myrpmdir" != str(i)):
+                self.smart('channel --disable '+str(i))
+        self.target.run('cd /home/root')
+        self.smart('install psplash')
+        for i in output.split("\n"):
+            if ("rpmsys" != str(i)) and ("myrpmdir" != str(i)):
+                self.smart('channel --enable '+str(i))
+        self.smart('channel --remove myrpmdir -y')
+        self.target.run("rm -rf /tmp/myrpmdir")
+
+    @testcase(718)
+    def test_smart_add_rpmdir(self):
+        self.target.run('mkdir /tmp/myrpmdir')
+        self.smart('channel --add myrpmdir type=rpm-dir path=/tmp/myrpmdir -y')
+        self.smart('channel --disable myrpmdir -y')
+        output = self.smart('channel --show myrpmdir')
+        self.assertTrue("disabled = yes" in output, msg="Failed to disable rpm dir")
+        self.smart('channel --enable  myrpmdir -y')
+        output = self.smart('channel --show myrpmdir')
+        self.assertFalse("disabled = yes" in output, msg="Failed to enable rpm dir")
+        self.smart('channel --remove myrpmdir -y')
+        self.target.run("rm -rf /tmp/myrpmdir")
+
+    @testcase(731)
+    @skipUnlessPassed('test_smart_channel_add')
+    def test_smart_remove_package(self):
+        self.smart('install -y psplash')
+        self.smart('remove -y psplash')
\ No newline at end of file
diff --git a/meta/lib/oeqa/runtime/ssh.py b/meta/lib/oeqa/runtime/ssh.py
new file mode 100644
index 0000000..0e76d5d
--- /dev/null
+++ b/meta/lib/oeqa/runtime/ssh.py
@@ -0,0 +1,19 @@
+import subprocess
+import unittest
+import sys
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not (oeRuntimeTest.hasPackage("dropbear") or oeRuntimeTest.hasPackage("openssh")):
+        skipModule("No ssh package in image")
+
+class SshTest(oeRuntimeTest):
+
+    @testcase(224)
+    @skipUnlessPassed('test_ping')
+    def test_ssh(self):
+        (status, output) = self.target.run('uname -a')
+        self.assertEqual(status, 0, msg="SSH Test failed: %s" % output)
+        (status, output) = self.target.run('cat /etc/masterimage')
+        self.assertEqual(status, 1, msg="This isn't the right image  - /etc/masterimage shouldn't be here %s" % output)
diff --git a/meta/lib/oeqa/runtime/syslog.py b/meta/lib/oeqa/runtime/syslog.py
new file mode 100644
index 0000000..2601dd9
--- /dev/null
+++ b/meta/lib/oeqa/runtime/syslog.py
@@ -0,0 +1,45 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not (oeRuntimeTest.hasPackage("busybox-syslog") or oeRuntimeTest.hasPackage("sysklogd")):
+        skipModule("No syslog package in image")
+
+class SyslogTest(oeRuntimeTest):
+
+    @testcase(201)
+    @skipUnlessPassed("test_syslog_help")
+    def test_syslog_running(self):
+        (status,output) = self.target.run(oeRuntimeTest.pscmd + ' | grep -i [s]yslogd')
+        self.assertEqual(status, 0, msg="no syslogd process, ps output: %s" % self.target.run(oeRuntimeTest.pscmd)[1])
+
+class SyslogTestConfig(oeRuntimeTest):
+
+    @testcase(1149)
+    @skipUnlessPassed("test_syslog_running")
+    def test_syslog_logger(self):
+        (status,output) = self.target.run('logger foobar && test -e /var/log/messages && grep foobar /var/log/messages || logread | grep foobar')
+        self.assertEqual(status, 0, msg="Test log string not found in /var/log/messages. Output: %s " % output)
+
+    @testcase(1150)
+    @skipUnlessPassed("test_syslog_running")
+    def test_syslog_restart(self):
+        if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False):
+            (status,output) = self.target.run('/etc/init.d/syslog restart')
+        else:
+            (status,output) = self.target.run('systemctl restart syslog.service')
+
+    @testcase(202)
+    @skipUnlessPassed("test_syslog_restart")
+    @skipUnlessPassed("test_syslog_logger")
+    @unittest.skipIf("systemd" == oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", False), "Not appropiate for systemd image")
+    @unittest.skipIf(oeRuntimeTest.hasPackage("sysklogd") or not oeRuntimeTest.hasPackage("busybox"), "Non-busybox syslog")
+    def test_syslog_startup_config(self):
+        self.target.run('echo "LOGFILE=/var/log/test" >> /etc/syslog-startup.conf')
+        (status,output) = self.target.run('/etc/init.d/syslog restart')
+        self.assertEqual(status, 0, msg="Could not restart syslog service. Status and output: %s and %s" % (status,output))
+        (status,output) = self.target.run('logger foobar && grep foobar /var/log/test')
+        self.assertEqual(status, 0, msg="Test log string not found. Output: %s " % output)
+        self.target.run("sed -i 's#LOGFILE=/var/log/test##' /etc/syslog-startup.conf")
+        self.target.run('/etc/init.d/syslog restart')
diff --git a/meta/lib/oeqa/runtime/systemd.py b/meta/lib/oeqa/runtime/systemd.py
new file mode 100644
index 0000000..c74394c
--- /dev/null
+++ b/meta/lib/oeqa/runtime/systemd.py
@@ -0,0 +1,101 @@
+import unittest
+import re
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("systemd"):
+            skipModule("target doesn't have systemd in DISTRO_FEATURES")
+    if "systemd" != oeRuntimeTest.tc.d.getVar("VIRTUAL-RUNTIME_init_manager", True):
+            skipModule("systemd is not the init manager for this image")
+
+
+class SystemdTest(oeRuntimeTest):
+
+    def systemctl(self, action = '', target = '', expected = 0, verbose = False):
+        command = 'systemctl %s %s' % (action, target)
+        status, output = self.target.run(command)
+        message = '\n'.join([command, output])
+        if status != expected and verbose:
+            message += self.target.run('systemctl status --full %s' % target)[1]
+        self.assertEqual(status, expected, message)
+        return output
+
+
+class SystemdBasicTests(SystemdTest):
+
+    @skipUnlessPassed('test_ssh')
+    def test_systemd_basic(self):
+        self.systemctl('--version')
+
+    @testcase(551)
+    @skipUnlessPassed('test_system_basic')
+    def test_systemd_list(self):
+        self.systemctl('list-unit-files')
+
+    def settle(self):
+        """
+        Block until systemd has finished activating any units being activated,
+        or until two minutes has elapsed.
+
+        Returns a tuple, either (True, '') if all units have finished
+        activating, or (False, message string) if there are still units
+        activating (generally, failing units that restart).
+        """
+        import time
+        endtime = time.time() + (60 * 2)
+        while True:
+            status, output = self.target.run('systemctl --state=activating')
+            if "0 loaded units listed" in output:
+                return (True, '')
+            if time.time() >= endtime:
+                return (False, output)
+            time.sleep(10)
+
+    @testcase(550)
+    @skipUnlessPassed('test_systemd_basic')
+    def test_systemd_failed(self):
+        settled, output = self.settle()
+        self.assertTrue(settled, msg="Timed out waiting for systemd to settle:\n" + output)
+
+        output = self.systemctl('list-units', '--failed')
+        match = re.search("0 loaded units listed", output)
+        if not match:
+            output += self.systemctl('status --full --failed')
+        self.assertTrue(match, msg="Some systemd units failed:\n%s" % output)
+
+
+class SystemdServiceTests(SystemdTest):
+
+    def check_for_avahi(self):
+        if not self.hasPackage('avahi-daemon'):
+            raise unittest.SkipTest("Testcase dependency not met: need avahi-daemon installed on target")
+
+    @skipUnlessPassed('test_systemd_basic')
+    def test_systemd_status(self):
+        self.check_for_avahi()
+        self.systemctl('status --full', 'avahi-daemon.service')
+
+    @testcase(695)
+    @skipUnlessPassed('test_systemd_status')
+    def test_systemd_stop_start(self):
+        self.check_for_avahi()
+        self.systemctl('stop', 'avahi-daemon.service')
+        self.systemctl('is-active', 'avahi-daemon.service', expected=3, verbose=True)
+        self.systemctl('start','avahi-daemon.service')
+        self.systemctl('is-active', 'avahi-daemon.service', verbose=True)
+
+    @testcase(696)
+    @skipUnlessPassed('test_systemd_basic')
+    def test_systemd_disable_enable(self):
+        self.check_for_avahi()
+        self.systemctl('disable', 'avahi-daemon.service')
+        self.systemctl('is-enabled', 'avahi-daemon.service', expected=1)
+        self.systemctl('enable', 'avahi-daemon.service')
+        self.systemctl('is-enabled', 'avahi-daemon.service')
+
+class SystemdJournalTests(SystemdTest):
+    @skipUnlessPassed('test_ssh')
+    def test_systemd_journal(self):
+        (status, output) = self.target.run('journalctl')
+        self.assertEqual(status, 0, output)
diff --git a/meta/lib/oeqa/runtime/vnc.py b/meta/lib/oeqa/runtime/vnc.py
new file mode 100644
index 0000000..f31deff
--- /dev/null
+++ b/meta/lib/oeqa/runtime/vnc.py
@@ -0,0 +1,20 @@
+from oeqa.oetest import oeRuntimeTest, skipModuleUnless
+from oeqa.utils.decorators import *
+import re
+
+def setUpModule():
+    skipModuleUnless(oeRuntimeTest.hasPackage('x11vnc'), "No x11vnc package in image")
+
+class VNCTest(oeRuntimeTest):
+
+    @testcase(213)
+    @skipUnlessPassed('test_ssh')
+    def test_vnc(self):
+        (status, output) = self.target.run('x11vnc -display :0 -bg -o x11vnc.log')
+        self.assertEqual(status, 0, msg="x11vnc server failed to start: %s" % output)
+        port = re.search('PORT=[0-9]*', output)
+        self.assertTrue(port, msg="Listening port not specified in command output: %s" %output)
+
+        vncport = port.group(0).split('=')[1]
+        (status, output) = self.target.run('netstat -ntl | grep ":%s"' % vncport)
+        self.assertEqual(status, 0, msg="x11vnc server not running on port %s\n\n%s" % (vncport, self.target.run('netstat -ntl; cat x11vnc.log')[1]))
diff --git a/meta/lib/oeqa/runtime/x32lib.py b/meta/lib/oeqa/runtime/x32lib.py
new file mode 100644
index 0000000..ce5e214
--- /dev/null
+++ b/meta/lib/oeqa/runtime/x32lib.py
@@ -0,0 +1,18 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+        #check if DEFAULTTUNE is set and it's value is: x86-64-x32
+        defaulttune = oeRuntimeTest.tc.d.getVar("DEFAULTTUNE", True)
+        if "x86-64-x32" not in defaulttune:
+            skipModule("DEFAULTTUNE is not set to x86-64-x32")
+
+class X32libTest(oeRuntimeTest):
+
+    @testcase(281)
+    @skipUnlessPassed("test_ssh")
+    def test_x32_file(self):
+        status1 = self.target.run("readelf -h /bin/ls | grep Class | grep ELF32")[0]
+        status2 = self.target.run("readelf -h /bin/ls | grep Machine | grep X86-64")[0]
+        self.assertTrue(status1 == 0 and status2 == 0, msg="/bin/ls isn't an X86-64 ELF32 binary. readelf says: %s" % self.target.run("readelf -h /bin/ls")[1])
diff --git a/meta/lib/oeqa/runtime/xorg.py b/meta/lib/oeqa/runtime/xorg.py
new file mode 100644
index 0000000..12bcd37
--- /dev/null
+++ b/meta/lib/oeqa/runtime/xorg.py
@@ -0,0 +1,16 @@
+import unittest
+from oeqa.oetest import oeRuntimeTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeRuntimeTest.hasFeature("x11-base"):
+            skipModule("target doesn't have x11 in IMAGE_FEATURES")
+
+
+class XorgTest(oeRuntimeTest):
+
+    @testcase(1151)
+    @skipUnlessPassed('test_ssh')
+    def test_xorg_running(self):
+        (status, output) = self.target.run(oeRuntimeTest.pscmd + ' |  grep -v xinit | grep [X]org')
+        self.assertEqual(status, 0, msg="Xorg does not appear to be running %s" % self.target.run(oeRuntimeTest.pscmd)[1])
diff --git a/meta/lib/oeqa/sdk/__init__.py b/meta/lib/oeqa/sdk/__init__.py
new file mode 100644
index 0000000..4cf3fa7
--- /dev/null
+++ b/meta/lib/oeqa/sdk/__init__.py
@@ -0,0 +1,3 @@
+# Enable other layers to have tests in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/meta/lib/oeqa/sdk/buildcvs.py b/meta/lib/oeqa/sdk/buildcvs.py
new file mode 100644
index 0000000..c7146fa
--- /dev/null
+++ b/meta/lib/oeqa/sdk/buildcvs.py
@@ -0,0 +1,25 @@
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import SDKBuildProject
+
+class BuildCvsTest(oeSDKTest):
+
+    @classmethod
+    def setUpClass(self):
+        self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/cvs/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
+                        "http://ftp.gnu.org/non-gnu/cvs/source/feature/1.12.13/cvs-1.12.13.tar.bz2")
+        self.project.download_archive()
+
+    def test_cvs(self):
+        self.assertEqual(self.project.run_configure(), 0,
+                        msg="Running configure failed")
+
+        self.assertEqual(self.project.run_make(), 0,
+                        msg="Running make failed")
+
+        self.assertEqual(self.project.run_install(), 0,
+                        msg="Running make install failed")
+
+    @classmethod
+    def tearDownClass(self):
+        self.project.clean()
diff --git a/meta/lib/oeqa/sdk/buildiptables.py b/meta/lib/oeqa/sdk/buildiptables.py
new file mode 100644
index 0000000..062e531
--- /dev/null
+++ b/meta/lib/oeqa/sdk/buildiptables.py
@@ -0,0 +1,26 @@
+from oeqa.oetest import oeSDKTest
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import SDKBuildProject
+
+
+class BuildIptablesTest(oeSDKTest):
+
+    @classmethod
+    def setUpClass(self):
+        self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/iptables/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
+                        "http://netfilter.org/projects/iptables/files/iptables-1.4.13.tar.bz2")
+        self.project.download_archive()
+
+    def test_iptables(self):
+        self.assertEqual(self.project.run_configure(), 0,
+                        msg="Running configure failed")
+
+        self.assertEqual(self.project.run_make(), 0,
+                        msg="Running make failed")
+
+        self.assertEqual(self.project.run_install(), 0,
+                        msg="Running make install failed")
+
+    @classmethod
+    def tearDownClass(self):
+        self.project.clean()
diff --git a/meta/lib/oeqa/sdk/buildsudoku.py b/meta/lib/oeqa/sdk/buildsudoku.py
new file mode 100644
index 0000000..dea77c6
--- /dev/null
+++ b/meta/lib/oeqa/sdk/buildsudoku.py
@@ -0,0 +1,26 @@
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+from oeqa.utils.targetbuild import SDKBuildProject
+
+def setUpModule():
+    if not oeSDKTest.hasPackage("gtk\+"):
+        skipModule("Image doesn't have gtk+ in manifest")
+
+class SudokuTest(oeSDKTest):
+
+    @classmethod
+    def setUpClass(self):
+        self.project = SDKBuildProject(oeSDKTest.tc.sdktestdir + "/sudoku/", oeSDKTest.tc.sdkenv, oeSDKTest.tc.d,
+                        "http://downloads.sourceforge.net/project/sudoku-savant/sudoku-savant/sudoku-savant-1.3/sudoku-savant-1.3.tar.bz2")
+        self.project.download_archive()
+
+    def test_sudoku(self):
+        self.assertEqual(self.project.run_configure(), 0,
+                        msg="Running configure failed")
+
+        self.assertEqual(self.project.run_make(), 0,
+                        msg="Running make failed")
+
+    @classmethod
+    def tearDownClass(self):
+        self.project.clean()
diff --git a/meta/lib/oeqa/sdk/gcc.py b/meta/lib/oeqa/sdk/gcc.py
new file mode 100644
index 0000000..67994b9
--- /dev/null
+++ b/meta/lib/oeqa/sdk/gcc.py
@@ -0,0 +1,36 @@
+import unittest
+import os
+import shutil
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    machine = oeSDKTest.tc.d.getVar("MACHINE", True)
+    if not oeSDKTest.hasHostPackage("packagegroup-cross-canadian-" + machine):
+        skipModule("SDK doesn't contain a cross-canadian toolchain")
+
+
+class GccCompileTest(oeSDKTest):
+
+    @classmethod
+    def setUpClass(self):
+        for f in ['test.c', 'test.cpp', 'testmakefile']:
+            shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
+
+    def test_gcc_compile(self):
+        self._run('$CC %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
+
+    def test_gpp_compile(self):
+        self._run('$CXX %s/test.c -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
+
+    def test_gpp2_compile(self):
+        self._run('$CXX %s/test.cpp -o %s/test -lm' % (self.tc.sdktestdir, self.tc.sdktestdir))
+
+    def test_make(self):
+        self._run('cd %s; make -f testmakefile' % self.tc.sdktestdir)
+
+    @classmethod
+    def tearDownClass(self):
+        files = [self.tc.sdktestdir + f for f in ['test.c', 'test.cpp', 'test.o', 'test', 'testmakefile']]
+        for f in files:
+            bb.utils.remove(f)
diff --git a/meta/lib/oeqa/sdk/perl.py b/meta/lib/oeqa/sdk/perl.py
new file mode 100644
index 0000000..45f422e
--- /dev/null
+++ b/meta/lib/oeqa/sdk/perl.py
@@ -0,0 +1,28 @@
+import unittest
+import os
+import shutil
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeSDKTest.hasHostPackage("nativesdk-perl"):
+        skipModule("No perl package in the SDK")
+
+
+class PerlTest(oeSDKTest):
+
+    @classmethod
+    def setUpClass(self):
+        for f in ['test.pl']:
+            shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
+        self.testfile = self.tc.sdktestdir + "test.pl"
+
+    def test_perl_exists(self):
+        self._run('which perl')
+
+    def test_perl_works(self):
+        self._run('perl %s/test.pl' % self.tc.sdktestdir)
+
+    @classmethod
+    def tearDownClass(self):
+        bb.utils.remove("%s/test.pl" % self.tc.sdktestdir)
diff --git a/meta/lib/oeqa/sdk/python.py b/meta/lib/oeqa/sdk/python.py
new file mode 100644
index 0000000..896fab4
--- /dev/null
+++ b/meta/lib/oeqa/sdk/python.py
@@ -0,0 +1,32 @@
+import unittest
+import os
+import shutil
+from oeqa.oetest import oeSDKTest, skipModule
+from oeqa.utils.decorators import *
+
+def setUpModule():
+    if not oeSDKTest.hasHostPackage("nativesdk-python"):
+        skipModule("No python package in the SDK")
+
+
+class PythonTest(oeSDKTest):
+
+    @classmethod
+    def setUpClass(self):
+        for f in ['test.py']:
+            shutil.copyfile(os.path.join(self.tc.filesdir, f), self.tc.sdktestdir + f)
+
+    def test_python_exists(self):
+        self._run('which python')
+
+    def test_python_stdout(self):
+        output = self._run('python %s/test.py' % self.tc.sdktestdir)
+        self.assertEqual(output.strip(), "the value of a is 0.01", msg="Incorrect output: %s" % output)
+
+    def test_python_testfile(self):
+        self._run('ls /tmp/testfile.python')
+
+    @classmethod
+    def tearDownClass(self):
+        bb.utils.remove("%s/test.py" % self.tc.sdktestdir)
+        bb.utils.remove("/tmp/testfile.python")
diff --git a/meta/lib/oeqa/selftest/__init__.py b/meta/lib/oeqa/selftest/__init__.py
new file mode 100644
index 0000000..3ad9513
--- /dev/null
+++ b/meta/lib/oeqa/selftest/__init__.py
@@ -0,0 +1,2 @@
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
diff --git a/meta/lib/oeqa/selftest/_sstatetests_noauto.py b/meta/lib/oeqa/selftest/_sstatetests_noauto.py
new file mode 100644
index 0000000..fc9ae7e
--- /dev/null
+++ b/meta/lib/oeqa/selftest/_sstatetests_noauto.py
@@ -0,0 +1,95 @@
+import datetime
+import unittest
+import os
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.selftest.sstate import SStateBase
+
+
+class RebuildFromSState(SStateBase):
+
+    @classmethod
+    def setUpClass(self):
+        self.builddir = os.path.join(os.environ.get('BUILDDIR'))
+
+    def get_dep_targets(self, primary_targets):
+        found_targets = []
+        bitbake("-g " + ' '.join(map(str, primary_targets)))
+        with open(os.path.join(self.builddir, 'pn-buildlist'), 'r') as pnfile:
+            found_targets = pnfile.read().splitlines()
+        return found_targets
+
+    def configure_builddir(self, builddir):
+        os.mkdir(builddir)
+        self.track_for_cleanup(builddir)
+        os.mkdir(os.path.join(builddir, 'conf'))
+        shutil.copyfile(os.path.join(os.environ.get('BUILDDIR'), 'conf/local.conf'), os.path.join(builddir, 'conf/local.conf'))
+        config = {}
+        config['default_sstate_dir'] = "SSTATE_DIR ?= \"${TOPDIR}/sstate-cache\""
+        config['null_sstate_mirrors'] = "SSTATE_MIRRORS = \"\""
+        config['default_tmp_dir'] = "TMPDIR = \"${TOPDIR}/tmp\""
+        for key in config:
+            ftools.append_file(os.path.join(builddir, 'conf/selftest.inc'), config[key])
+        shutil.copyfile(os.path.join(os.environ.get('BUILDDIR'), 'conf/bblayers.conf'), os.path.join(builddir, 'conf/bblayers.conf'))
+        try:
+            shutil.copyfile(os.path.join(os.environ.get('BUILDDIR'), 'conf/auto.conf'), os.path.join(builddir, 'conf/auto.conf'))
+        except:
+            pass
+
+    def hardlink_tree(self, src, dst):
+        os.mkdir(dst)
+        self.track_for_cleanup(dst)
+        for root, dirs, files in os.walk(src):
+            if root == src:
+                continue
+            os.mkdir(os.path.join(dst, root.split(src)[1][1:]))
+            for sstate_file in files:
+                os.link(os.path.join(root, sstate_file), os.path.join(dst, root.split(src)[1][1:], sstate_file))
+
+    def run_test_sstate_rebuild(self, primary_targets, relocate=False, rebuild_dependencies=False):
+        buildA = os.path.join(self.builddir, 'buildA')
+        if relocate:
+            buildB = os.path.join(self.builddir, 'buildB')
+        else:
+            buildB = buildA
+
+        if rebuild_dependencies:
+            rebuild_targets = self.get_dep_targets(primary_targets)
+        else:
+            rebuild_targets = primary_targets
+
+        self.configure_builddir(buildA)
+        runCmd((". %s/oe-init-build-env %s && " % (get_bb_var('COREBASE'), buildA)) + 'bitbake  ' + ' '.join(map(str, primary_targets)), shell=True, executable='/bin/bash')
+        self.hardlink_tree(os.path.join(buildA, 'sstate-cache'), os.path.join(self.builddir, 'sstate-cache-buildA'))
+        shutil.rmtree(buildA)
+
+        failed_rebuild = []
+        failed_cleansstate = []
+        for target in rebuild_targets:
+            self.configure_builddir(buildB)
+            self.hardlink_tree(os.path.join(self.builddir, 'sstate-cache-buildA'), os.path.join(buildB, 'sstate-cache'))
+
+            result_cleansstate = runCmd((". %s/oe-init-build-env %s && " % (get_bb_var('COREBASE'), buildB)) + 'bitbake -ccleansstate ' + target, ignore_status=True, shell=True, executable='/bin/bash')
+            if not result_cleansstate.status == 0:
+                failed_cleansstate.append(target)
+                shutil.rmtree(buildB)
+                continue
+
+            result_build = runCmd((". %s/oe-init-build-env %s && " % (get_bb_var('COREBASE'), buildB)) + 'bitbake ' + target, ignore_status=True, shell=True, executable='/bin/bash')
+            if not result_build.status == 0:
+                failed_rebuild.append(target)
+
+            shutil.rmtree(buildB)
+
+        self.assertFalse(failed_rebuild, msg="The following recipes have failed to rebuild: %s" % ' '.join(map(str, failed_rebuild)))
+        self.assertFalse(failed_cleansstate, msg="The following recipes have failed cleansstate(all others have passed both cleansstate and rebuild from sstate tests): %s" % ' '.join(map(str, failed_cleansstate)))
+
+    def test_sstate_relocation(self):
+        self.run_test_sstate_rebuild(['core-image-sato-sdk'], relocate=True, rebuild_dependencies=True)
+
+    def test_sstate_rebuild(self):
+        self.run_test_sstate_rebuild(['core-image-sato-sdk'], relocate=False, rebuild_dependencies=True)
diff --git a/meta/lib/oeqa/selftest/_toaster.py b/meta/lib/oeqa/selftest/_toaster.py
new file mode 100644
index 0000000..c424659
--- /dev/null
+++ b/meta/lib/oeqa/selftest/_toaster.py
@@ -0,0 +1,320 @@
+import unittest
+import os
+import sys
+import shlex, subprocess
+import urllib, commands, time, getpass, re, json, shlex
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd
+
+sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../', 'bitbake/lib/toaster')))
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "toastermain.settings")
+
+import toastermain.settings
+from django.db.models import Q
+from orm.models import *
+from oeqa.utils.decorators import testcase
+
+class ToasterSetup(oeSelfTest):
+
+    def recipe_parse(self, file_path, var):
+        for line in open(file_path,'r'):
+            if line.find(var) > -1:
+                val = line.split(" = ")[1].replace("\"", "").strip()
+                return val
+
+    def fix_file_path(self, file_path):
+        if ":" in file_path:
+            file_path=file_path.split(":")[2]
+        return file_path
+
+class Toaster_DB_Tests(ToasterSetup):
+
+    # Check if build name is unique - tc_id=795
+    @testcase(795)
+    def test_Build_Unique_Name(self):
+        all_builds = Build.objects.all().count()
+        distinct_builds = Build.objects.values('id').distinct().count()
+        self.assertEqual(distinct_builds, all_builds, msg = 'Build name is not unique')
+
+    # Check if build coocker log path is unique - tc_id=819
+    @testcase(819)
+    def test_Build_Unique_Cooker_Log_Path(self):
+        distinct_path = Build.objects.values('cooker_log_path').distinct().count()
+        total_builds = Build.objects.values('id').count()
+        self.assertEqual(distinct_path, total_builds, msg = 'Build coocker log path is not unique')
+
+    # Check if task order is unique for one build - tc=824
+    @testcase(824)
+    def test_Task_Unique_Order(self):
+        builds = Build.objects.values('id')
+        cnt_err = []
+        for build in builds:
+            total_task_order = Task.objects.filter(build = build['id']).values('order').count()
+            distinct_task_order = Task.objects.filter(build = build['id']).values('order').distinct().count()
+            if (total_task_order != distinct_task_order):
+                cnt_err.append(build['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for build id: %s' % cnt_err)
+
+    # Check task order sequence for one build - tc=825
+    @testcase(825)
+    def test_Task_Order_Sequence(self):
+        builds = builds = Build.objects.values('id')
+        cnt_err = []
+        for build in builds:
+            tasks = Task.objects.filter(Q(build = build['id']), ~Q(order = None), ~Q(task_name__contains = '_setscene')).values('id', 'order').order_by("order")
+            cnt_tasks = 0
+            for task in tasks:
+                cnt_tasks += 1
+                if (task['order'] != cnt_tasks):
+                    cnt_err.append(task['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
+
+    # Check if disk_io matches the difference between EndTimeIO and StartTimeIO in build stats - tc=828
+    ### this needs to be updated ###
+    #def test_Task_Disk_IO_TC828(self):
+
+    # Check if outcome = 2 (SSTATE) then sstate_result must be 3 (RESTORED) - tc=832
+    @testcase(832)
+    def test_Task_If_Outcome_2_Sstate_Result_Must_Be_3(self):
+        tasks = Task.objects.filter(outcome = 2).values('id', 'sstate_result')
+        cnt_err = []
+        for task in tasks:
+            if (row['sstate_result'] != 3):
+                cnt_err.append(task['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
+
+    # Check if outcome = 1 (COVERED) or 3 (EXISTING) then sstate_result must be 0 (SSTATE_NA) - tc=833
+    @testcase(833)
+    def test_Task_If_Outcome_1_3_Sstate_Result_Must_Be_0(self):
+        tasks = Task.objects.filter(outcome__in = (1, 3)).values('id', 'sstate_result')
+        cnt_err = []
+        for task in tasks:
+            if (task['sstate_result'] != 0):
+                cnt_err.append(task['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
+
+    # Check if outcome is 0 (SUCCESS) or 4 (FAILED) then sstate_result must be 0 (NA), 1 (MISS) or 2 (FAILED) - tc=834
+    @testcase(834)
+    def test_Task_If_Outcome_0_4_Sstate_Result_Must_Be_0_1_2(self):
+        tasks = Task.objects.filter(outcome__in = (0, 4)).values('id', 'sstate_result')
+        cnt_err = []
+        for task in tasks:
+            if (task['sstate_result'] not in [0, 1, 2]):
+                cnt_err.append(task['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
+
+    # Check if task_executed = TRUE (1), script_type must be 0 (CODING_NA), 2 (CODING_PYTHON), 3 (CODING_SHELL) - tc=891
+    @testcase(891)
+    def test_Task_If_Task_Executed_True_Script_Type_0_2_3(self):
+        tasks = Task.objects.filter(task_executed = 1).values('id', 'script_type')
+        cnt_err = []
+        for task in tasks:
+            if (task['script_type'] not in [0, 2, 3]):
+                cnt_err.append(task['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
+
+    # Check if task_executed = TRUE (1), outcome must be 0 (SUCCESS) or 4 (FAILED) - tc=836
+    @testcase(836)
+    def test_Task_If_Task_Executed_True_Outcome_0_4(self):
+        tasks = Task.objects.filter(task_executed = 1).values('id', 'outcome')
+        cnt_err = []
+        for task in tasks:
+            if (task['outcome'] not in [0, 4]):
+                cnt_err.append(task['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
+
+    # Check if task_executed = FALSE (0), script_type must be 0 - tc=890
+    @testcase(890)
+    def test_Task_If_Task_Executed_False_Script_Type_0(self):
+        tasks = Task.objects.filter(task_executed = 0).values('id', 'script_type')
+        cnt_err = []
+        for task in tasks:
+            if (task['script_type'] != 0):
+                cnt_err.append(task['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
+
+    # Check if task_executed = FALSE (0) and build outcome = SUCCEEDED (0), task outcome must be 1 (COVERED), 2 (CACHED), 3 (PREBUILT), 5 (EMPTY) - tc=837
+    @testcase(837)
+    def test_Task_If_Task_Executed_False_Outcome_1_2_3_5(self):
+        builds = Build.objects.filter(outcome = 0).values('id')
+        cnt_err = []
+        for build in builds:
+            tasks = Task.objects.filter(build = build['id'], task_executed = 0).values('id', 'outcome')
+            for task in tasks:
+                if (task['outcome'] not in [1, 2, 3, 5]):
+                    cnt_err.append(task['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task id: %s' % cnt_err)
+
+    # Key verification - tc=888
+    @testcase(888)
+    def test_Target_Installed_Package(self):
+        rows = Target_Installed_Package.objects.values('id', 'target_id', 'package_id')
+        cnt_err = []
+        for row in rows:
+            target = Target.objects.filter(id = row['target_id']).values('id')
+            package = Package.objects.filter(id = row['package_id']).values('id')
+            if (not target or not package):
+                cnt_err.append(row['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for target installed package id: %s' % cnt_err)
+
+    # Key verification - tc=889
+    @testcase(889)
+    def test_Task_Dependency(self):
+        rows = Task_Dependency.objects.values('id', 'task_id', 'depends_on_id')
+        cnt_err = []
+        for row in rows:
+            task_id = Task.objects.filter(id = row['task_id']).values('id')
+            depends_on_id = Task.objects.filter(id = row['depends_on_id']).values('id')
+            if (not task_id or not depends_on_id):
+                cnt_err.append(row['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for task dependency id: %s' % cnt_err)
+
+    # Check if build target file_name is populated only if is_image=true AND orm_build.outcome=0 then if the file exists and its size matches the file_size value
+    ### Need to add the tc in the test run
+    @testcase(1037)
+    def test_Target_File_Name_Populated(self):
+        builds = Build.objects.filter(outcome = 0).values('id')
+        for build in builds:
+            targets = Target.objects.filter(build_id = build['id'], is_image = 1).values('id')
+            for target in targets:
+                target_files = Target_Image_File.objects.filter(target_id = target['id']).values('id', 'file_name', 'file_size')
+                cnt_err = []
+                for file_info in target_files:
+                    target_id = file_info['id']
+                    target_file_name = file_info['file_name']
+                    target_file_size = file_info['file_size']
+                    if (not target_file_name or not target_file_size):
+                        cnt_err.append(target_id)
+                    else:
+                        if (not os.path.exists(target_file_name)):
+                            cnt_err.append(target_id)
+                        else:
+                            if (os.path.getsize(target_file_name) != target_file_size):
+                                cnt_err.append(target_id)
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for target image file id: %s' % cnt_err)
+
+    # Key verification - tc=884
+    @testcase(884)
+    def test_Package_Dependency(self):
+        cnt_err = []
+        deps = Package_Dependency.objects.values('id', 'package_id', 'depends_on_id')
+        for dep in deps:
+            if (dep['package_id'] == dep['depends_on_id']):
+                cnt_err.append(dep['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package dependency id: %s' % cnt_err)
+
+    # Recipe key verification, recipe name does not depends on a recipe having the same name - tc=883
+    @testcase(883)
+    def test_Recipe_Dependency(self):
+        deps = Recipe_Dependency.objects.values('id', 'recipe_id', 'depends_on_id')
+        cnt_err = []
+        for dep in deps:
+            if (not dep['recipe_id'] or not dep['depends_on_id']):
+                cnt_err.append(dep['id'])
+            else:
+                name = Recipe.objects.filter(id = dep['recipe_id']).values('name')
+                dep_name = Recipe.objects.filter(id = dep['depends_on_id']).values('name')
+                if (name == dep_name):
+                    cnt_err.append(dep['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for recipe dependency id: %s' % cnt_err)
+
+    # Check if package name does not start with a number (0-9) - tc=846
+    @testcase(846)
+    def test_Package_Name_For_Number(self):
+        packages = Package.objects.filter(~Q(size = -1)).values('id', 'name')
+        cnt_err = []
+        for package in packages:
+            if (package['name'][0].isdigit() is True):
+                cnt_err.append(package['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
+
+    # Check if package version starts with a number (0-9) - tc=847
+    @testcase(847)
+    def test_Package_Version_Starts_With_Number(self):
+        packages = Package.objects.filter(~Q(size = -1)).values('id', 'version')
+        cnt_err = []
+        for package in packages:
+            if (package['version'][0].isdigit() is False):
+                cnt_err.append(package['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
+
+    # Check if package revision starts with 'r' - tc=848
+    @testcase(848)
+    def test_Package_Revision_Starts_With_r(self):
+        packages = Package.objects.filter(~Q(size = -1)).values('id', 'revision')
+        cnt_err = []
+        for package in packages:
+            if (package['revision'][0].startswith("r") is False):
+                cnt_err.append(package['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
+
+    # Check the validity of the package build_id
+    ### TC must be added in test run
+    @testcase(1038)
+    def test_Package_Build_Id(self):
+        packages = Package.objects.filter(~Q(size = -1)).values('id', 'build_id')
+        cnt_err = []
+        for package in packages:
+            build_id = Build.objects.filter(id = package['build_id']).values('id')
+            if (not build_id):
+                cnt_err.append(package['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
+
+    # Check the validity of package recipe_id
+    ### TC must be added in test run
+    @testcase(1039)
+    def test_Package_Recipe_Id(self):
+        packages = Package.objects.filter(~Q(size = -1)).values('id', 'recipe_id')
+        cnt_err = []
+        for package in packages:
+            recipe_id = Recipe.objects.filter(id = package['recipe_id']).values('id')
+            if (not recipe_id):
+                cnt_err.append(package['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
+
+    # Check if package installed_size field is not null
+    ### TC must be aded in test run
+    @testcase(1040)
+    def test_Package_Installed_Size_Not_NULL(self):
+        packages = Package.objects.filter(installed_size__isnull = True).values('id')
+        cnt_err = []
+        for package in packages:
+            cnt_err.append(package['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for package id: %s' % cnt_err)
+
+    # Check if all layers requests return exit code is 200 - tc=843
+    @testcase(843)
+    def test_Layers_Requests_Exit_Code(self):
+        layers = Layer.objects.values('id', 'layer_index_url')
+        cnt_err = []
+        for layer in layers:
+            resp = urllib.urlopen(layer['layer_index_url'])
+            if (resp.getcode() != 200):
+                cnt_err.append(layer['id'])
+        self.assertEqual(len(cnt_err), 0, msg = 'Errors for layer id: %s' % cnt_err)
+
+    # Check if django server starts regardless of the timezone set on the machine - tc=905
+    @testcase(905)
+    def test_Start_Django_Timezone(self):
+        current_path = os.getcwd()
+        zonefilelist = []
+        ZONEINFOPATH = '/usr/share/zoneinfo/'
+        os.chdir("../bitbake/lib/toaster/")
+        cnt_err = 0
+        for filename in os.listdir(ZONEINFOPATH):
+            if os.path.isfile(os.path.join(ZONEINFOPATH, filename)):
+                zonefilelist.append(filename)
+        for k in range(len(zonefilelist)):
+            if k <= 5:
+                files = zonefilelist[k]
+                os.system("export TZ="+str(files)+"; python manage.py runserver > /dev/null 2>&1 &")
+                time.sleep(3)
+                pid = subprocess.check_output("ps aux | grep '[/u]sr/bin/python manage.py runserver' | awk '{print $2}'", shell = True)
+                if pid:
+                    os.system("kill -9 "+str(pid))
+                else:
+                    cnt_err.append(zonefilelist[k])
+        self.assertEqual(cnt_err, 0, msg = 'Errors django server does not start with timezone: %s' % cnt_err)
+        os.chdir(current_path)
diff --git a/meta/lib/oeqa/selftest/base.py b/meta/lib/oeqa/selftest/base.py
new file mode 100644
index 0000000..b2faa66
--- /dev/null
+++ b/meta/lib/oeqa/selftest/base.py
@@ -0,0 +1,153 @@
+# Copyright (c) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+
+# DESCRIPTION
+# Base class inherited by test classes in meta/lib/selftest
+
+import unittest
+import os
+import sys
+import shutil
+import logging
+import errno
+
+import oeqa.utils.ftools as ftools
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.utils.decorators import LogResults
+
+@LogResults
+class oeSelfTest(unittest.TestCase):
+
+    log = logging.getLogger("selftest.base")
+    longMessage = True
+
+    def __init__(self, methodName="runTest"):
+        self.builddir = os.environ.get("BUILDDIR")
+        self.localconf_path = os.path.join(self.builddir, "conf/local.conf")
+        self.testinc_path = os.path.join(self.builddir, "conf/selftest.inc")
+        self.local_bblayers_path = os.path.join(self.builddir, "conf/bblayers.conf")
+        self.testinc_bblayers_path = os.path.join(self.builddir, "conf/bblayers.inc")
+        self.testlayer_path = oeSelfTest.testlayer_path
+        self._extra_tear_down_commands = []
+        self._track_for_cleanup = []
+        super(oeSelfTest, self).__init__(methodName)
+
+    def setUp(self):
+        os.chdir(self.builddir)
+        # we don't know what the previous test left around in config or inc files
+        # if it failed so we need a fresh start
+        try:
+            os.remove(self.testinc_path)
+        except OSError as e:
+            if e.errno != errno.ENOENT:
+                raise
+        for root, _, files in os.walk(self.testlayer_path):
+            for f in files:
+                if f == 'test_recipe.inc':
+                    os.remove(os.path.join(root, f))
+        try:
+            os.remove(self.testinc_bblayers_path)
+        except OSError as e:
+            if e.errno != errno.ENOENT:
+                raise
+        # tests might need their own setup
+        # but if they overwrite this one they have to call
+        # super each time, so let's give them an alternative
+        self.setUpLocal()
+
+    def setUpLocal(self):
+        pass
+
+    def tearDown(self):
+        if self._extra_tear_down_commands:
+            failed_extra_commands = []
+            for command in self._extra_tear_down_commands:
+                result = runCmd(command, ignore_status=True)
+                if not result.status ==  0:
+                    failed_extra_commands.append(command)
+            if failed_extra_commands:
+                self.log.warning("tearDown commands have failed: %s" % ', '.join(map(str, failed_extra_commands)))
+                self.log.debug("Trying to move on.")
+            self._extra_tear_down_commands = []
+
+        if self._track_for_cleanup:
+            for path in self._track_for_cleanup:
+                if os.path.isdir(path):
+                    shutil.rmtree(path)
+                if os.path.isfile(path):
+                    os.remove(path)
+            self._track_for_cleanup = []
+
+        self.tearDownLocal()
+
+    def tearDownLocal(self):
+        pass
+
+    # add test specific commands to the tearDown method.
+    def add_command_to_tearDown(self, command):
+        self.log.debug("Adding command '%s' to tearDown for this test." % command)
+        self._extra_tear_down_commands.append(command)
+    # add test specific files or directories to be removed in the tearDown method
+    def track_for_cleanup(self, path):
+        self.log.debug("Adding path '%s' to be cleaned up when test is over" % path)
+        self._track_for_cleanup.append(path)
+
+    # write to <builddir>/conf/selftest.inc
+    def write_config(self, data):
+        self.log.debug("Writing to: %s\n%s\n" % (self.testinc_path, data))
+        ftools.write_file(self.testinc_path, data)
+
+    # append to <builddir>/conf/selftest.inc
+    def append_config(self, data):
+        self.log.debug("Appending to: %s\n%s\n" % (self.testinc_path, data))
+        ftools.append_file(self.testinc_path, data)
+
+    # remove data from <builddir>/conf/selftest.inc
+    def remove_config(self, data):
+        self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_path, data))
+        ftools.remove_from_file(self.testinc_path, data)
+
+    # write to meta-sefltest/recipes-test/<recipe>/test_recipe.inc
+    def write_recipeinc(self, recipe, data):
+        inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
+        self.log.debug("Writing to: %s\n%s\n" % (inc_file, data))
+        ftools.write_file(inc_file, data)
+
+    # append data to meta-sefltest/recipes-test/<recipe>/test_recipe.inc
+    def append_recipeinc(self, recipe, data):
+        inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
+        self.log.debug("Appending to: %s\n%s\n" % (inc_file, data))
+        ftools.append_file(inc_file, data)
+
+    # remove data from meta-sefltest/recipes-test/<recipe>/test_recipe.inc
+    def remove_recipeinc(self, recipe, data):
+        inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
+        self.log.debug("Removing from: %s\n%s\n" % (inc_file, data))
+        ftools.remove_from_file(inc_file, data)
+
+    # delete meta-sefltest/recipes-test/<recipe>/test_recipe.inc file
+    def delete_recipeinc(self, recipe):
+        inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc')
+        self.log.debug("Deleting file: %s" % inc_file)
+        try:
+            os.remove(inc_file)
+        except OSError as e:
+            if e.errno != errno.ENOENT:
+                raise
+
+    # write to <builddir>/conf/bblayers.inc
+    def write_bblayers_config(self, data):
+        self.log.debug("Writing to: %s\n%s\n" % (self.testinc_bblayers_path, data))
+        ftools.write_file(self.testinc_bblayers_path, data)
+
+    # append to <builddir>/conf/bblayers.inc
+    def append_bblayers_config(self, data):
+        self.log.debug("Appending to: %s\n%s\n" % (self.testinc_bblayers_path, data))
+        ftools.append_file(self.testinc_bblayers_path, data)
+
+    # remove data from <builddir>/conf/bblayers.inc
+    def remove_bblayers_config(self, data):
+        self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_bblayers_path, data))
+        ftools.remove_from_file(self.testinc_bblayers_path, data)
diff --git a/meta/lib/oeqa/selftest/bblayers.py b/meta/lib/oeqa/selftest/bblayers.py
new file mode 100644
index 0000000..20c17e4
--- /dev/null
+++ b/meta/lib/oeqa/selftest/bblayers.py
@@ -0,0 +1,62 @@
+import unittest
+import os
+import logging
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class BitbakeLayers(oeSelfTest):
+
+    @testcase(756)
+    def test_bitbakelayers_showcrossdepends(self):
+        result = runCmd('bitbake-layers show-cross-depends')
+        self.assertTrue('aspell' in result.output, msg = "No dependencies were shown. bitbake-layers show-cross-depends output: %s" % result.output)
+
+    @testcase(83)
+    def test_bitbakelayers_showlayers(self):
+        result = runCmd('bitbake-layers show-layers')
+        self.assertTrue('meta-selftest' in result.output, msg = "No layers were shown. bitbake-layers show-layers output: %s" % result.output)
+
+    @testcase(93)
+    def test_bitbakelayers_showappends(self):
+        result = runCmd('bitbake-layers show-appends')
+        self.assertTrue('xcursor-transparent-theme_0.1.1.bbappend' in result.output, msg="xcursor-transparent-theme_0.1.1.bbappend file was not recognised.  bitbake-layers show-appends output: %s" % result.output)
+
+    @testcase(90)
+    def test_bitbakelayers_showoverlayed(self):
+        result = runCmd('bitbake-layers show-overlayed')
+        self.assertTrue('aspell' in result.output, msg="aspell overlayed recipe was not recognised bitbake-layers show-overlayed %s" % result.output)
+
+    @testcase(95)
+    def test_bitbakelayers_flatten(self):
+        testoutdir = os.path.join(self.builddir, 'test_bitbakelayers_flatten')
+        self.assertFalse(os.path.isdir(testoutdir), msg = "test_bitbakelayers_flatten should not exist at this point in time")
+        self.track_for_cleanup(testoutdir)
+        result = runCmd('bitbake-layers flatten %s' % testoutdir)
+        bb_file = os.path.join(testoutdir, 'recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb')
+        self.assertTrue(os.path.isfile(bb_file), msg = "Cannot find xcursor-transparent-theme_0.1.1.bb in the test_bitbakelayers_flatten local dir.")
+        contents = ftools.read_file(bb_file)
+        find_in_contents = re.search("##### bbappended from meta-selftest #####\n(.*\n)*include test_recipe.inc", contents)
+        self.assertTrue(find_in_contents, msg = "Flattening layers did not work. bitbake-layers flatten output: %s" % result.output)
+
+    @testcase(1195)
+    def test_bitbakelayers_add_remove(self):
+        test_layer = os.path.join(get_bb_var('COREBASE'), 'meta-skeleton')
+        result = runCmd('bitbake-layers show-layers')
+        self.assertNotIn('meta-skeleton', result.output, "This test cannot run with meta-skeleton in bblayers.conf. bitbake-layers show-layers output: %s" % result.output)
+        result = runCmd('bitbake-layers add-layer %s' % test_layer)
+        result = runCmd('bitbake-layers show-layers')
+        self.assertIn('meta-skeleton', result.output, msg = "Something wrong happened. meta-skeleton layer was not added to conf/bblayers.conf.  bitbake-layers show-layers output: %s" % result.output)
+        result = runCmd('bitbake-layers remove-layer %s' % test_layer)
+        result = runCmd('bitbake-layers show-layers')
+        self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step.  bitbake-layers show-layers output: %s" % result.output)
+        result = runCmd('bitbake-layers add-layer %s' % test_layer)
+        result = runCmd('bitbake-layers show-layers')
+        self.assertIn('meta-skeleton', result.output, msg = "Something wrong happened. meta-skeleton layer was not added to conf/bblayers.conf.  bitbake-layers show-layers output: %s" % result.output)
+        result = runCmd('bitbake-layers remove-layer */meta-skeleton')
+        result = runCmd('bitbake-layers show-layers')
+        self.assertNotIn('meta-skeleton', result.output, msg = "meta-skeleton should have been removed at this step.  bitbake-layers show-layers output: %s" % result.output)
diff --git a/meta/lib/oeqa/selftest/bbtests.py b/meta/lib/oeqa/selftest/bbtests.py
new file mode 100644
index 0000000..3d6860f
--- /dev/null
+++ b/meta/lib/oeqa/selftest/bbtests.py
@@ -0,0 +1,201 @@
+import unittest
+import os
+import logging
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class BitbakeTests(oeSelfTest):
+
+    @testcase(789)
+    def test_run_bitbake_from_dir_1(self):
+        os.chdir(os.path.join(self.builddir, 'conf'))
+        self.assertEqual(bitbake('-e').status, 0, msg = "bitbake couldn't run from \"conf\" dir")
+
+    @testcase(790)
+    def test_run_bitbake_from_dir_2(self):
+        my_env = os.environ.copy()
+        my_env['BBPATH'] = my_env['BUILDDIR']
+        os.chdir(os.path.dirname(os.environ['BUILDDIR']))
+        self.assertEqual(bitbake('-e', env=my_env).status, 0, msg = "bitbake couldn't run from builddir")
+
+    @testcase(806)
+    def test_event_handler(self):
+        self.write_config("INHERIT += \"test_events\"")
+        result = bitbake('m4-native')
+        find_build_started = re.search("NOTE: Test for bb\.event\.BuildStarted(\n.*)*NOTE: Preparing RunQueue", result.output)
+        find_build_completed = re.search("Tasks Summary:.*(\n.*)*NOTE: Test for bb\.event\.BuildCompleted", result.output)
+        self.assertTrue(find_build_started, msg = "Match failed in:\n%s"  % result.output)
+        self.assertTrue(find_build_completed, msg = "Match failed in:\n%s" % result.output)
+        self.assertFalse('Test for bb.event.InvalidEvent' in result.output, msg = "\"Test for bb.event.InvalidEvent\" message found during bitbake process. bitbake output: %s" % result.output)
+
+    @testcase(103)
+    def test_local_sstate(self):
+        bitbake('m4-native -ccleansstate')
+        bitbake('m4-native')
+        bitbake('m4-native -cclean')
+        result = bitbake('m4-native')
+        find_setscene = re.search("m4-native.*do_.*_setscene", result.output)
+        self.assertTrue(find_setscene, msg = "No \"m4-native.*do_.*_setscene\" message found during bitbake m4-native. bitbake output: %s" % result.output )
+
+    @testcase(105)
+    def test_bitbake_invalid_recipe(self):
+        result = bitbake('-b asdf', ignore_status=True)
+        self.assertTrue("ERROR: Unable to find any recipe file matching 'asdf'" in result.output, msg = "Though asdf recipe doesn't exist, bitbake didn't output any err. message. bitbake output: %s" % result.output)
+
+    @testcase(107)
+    def test_bitbake_invalid_target(self):
+        result = bitbake('asdf', ignore_status=True)
+        self.assertTrue("ERROR: Nothing PROVIDES 'asdf'" in result.output, msg = "Though no 'asdf' target exists, bitbake didn't output any err. message. bitbake output: %s" % result.output)
+
+    @testcase(106)
+    def test_warnings_errors(self):
+        result = bitbake('-b asdf', ignore_status=True)
+        find_warnings = re.search("Summary: There w.{2,3}? [1-9][0-9]* WARNING messages* shown", result.output)
+        find_errors = re.search("Summary: There w.{2,3}? [1-9][0-9]* ERROR messages* shown", result.output)
+        self.assertTrue(find_warnings, msg="Did not find the mumber of warnings at the end of the build:\n" + result.output)
+        self.assertTrue(find_errors, msg="Did not find the mumber of errors at the end of the build:\n" + result.output)
+
+    @testcase(108)
+    def test_invalid_patch(self):
+        self.write_recipeinc('man', 'SRC_URI += "file://man-1.5h1-make.patch"')
+        result = bitbake('man -c patch', ignore_status=True)
+        self.delete_recipeinc('man')
+        bitbake('-cclean man')
+        self.assertTrue("ERROR: Function failed: patch_do_patch" in result.output, msg = "Though no man-1.5h1-make.patch file exists, bitbake didn't output any err. message. bitbake output: %s" % result.output)
+
+    @testcase(163)
+    def test_force_task(self):
+        bitbake('m4-native')
+        self.add_command_to_tearDown('bitbake -c clean m4-native')
+        result = bitbake('-C compile m4-native')
+        look_for_tasks = ['do_compile', 'do_install', 'do_populate_sysroot']
+        for task in look_for_tasks:
+            find_task = re.search("m4-native.*%s" % task, result.output)
+            self.assertTrue(find_task, msg = "Couldn't find %s task. bitbake output %s" % (task, result.output))
+
+    @testcase(167)
+    def test_bitbake_g(self):
+        result = bitbake('-g core-image-full-cmdline')
+        for f in ['pn-buildlist', 'pn-depends.dot', 'package-depends.dot', 'task-depends.dot']:
+            self.addCleanup(os.remove, f)
+        self.assertTrue('NOTE: PN build list saved to \'pn-buildlist\'' in result.output, msg = "No dependency \"pn-buildlist\" file was generated for the given task target. bitbake output: %s" % result.output)
+        self.assertTrue('openssh' in ftools.read_file(os.path.join(self.builddir, 'pn-buildlist')), msg = "No \"openssh\" dependency found in pn-buildlist file.")
+
+    @testcase(899)
+    def test_image_manifest(self):
+        bitbake('core-image-minimal')
+        deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-minimal")
+        imagename = get_bb_var("IMAGE_LINK_NAME", target="core-image-minimal")
+        manifest = os.path.join(deploydir, imagename + ".manifest")
+        self.assertTrue(os.path.islink(manifest), msg="No manifest file created for image. It should have been created in %s" % manifest)
+
+    @testcase(168)
+    def test_invalid_recipe_src_uri(self):
+        data = 'SRC_URI = "file://invalid"'
+        self.write_recipeinc('man', data)
+        self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
+SSTATE_DIR = \"${TOPDIR}/download-selftest\"
+""")
+        bitbake('-ccleanall man')
+        result = bitbake('-c fetch man', ignore_status=True)
+        bitbake('-ccleanall man')
+        self.delete_recipeinc('man')
+        self.assertEqual(result.status, 1, msg="Command succeded when it should have failed. bitbake output: %s" % result.output)
+        self.assertTrue('Fetcher failure: Unable to find file file://invalid anywhere. The paths that were searched were:' in result.output, msg = "\"invalid\" file \
+doesn't exist, yet no error message encountered. bitbake output: %s" % result.output)
+        self.assertTrue('ERROR: Function failed: Fetcher failure for URL: \'file://invalid\'. Unable to fetch URL from any source.' in result.output, msg = "\"invalid\" file \
+doesn't exist, yet fetcher didn't report any error. bitbake output: %s" % result.output)
+
+    @testcase(171)
+    def test_rename_downloaded_file(self):
+        self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
+SSTATE_DIR = \"${TOPDIR}/download-selftest\"
+""")
+        data = 'SRC_URI_append = ";downloadfilename=test-aspell.tar.gz"'
+        self.write_recipeinc('aspell', data)
+        bitbake('-ccleanall aspell')
+        result = bitbake('-c fetch aspell', ignore_status=True)
+        self.delete_recipeinc('aspell')
+        self.addCleanup(bitbake, '-ccleanall aspell')
+        self.assertEqual(result.status, 0, msg = "Couldn't fetch aspell. %s" % result.output)
+        self.assertTrue(os.path.isfile(os.path.join(get_bb_var("DL_DIR"), 'test-aspell.tar.gz')), msg = "File rename failed. No corresponding test-aspell.tar.gz file found under %s" % str(get_bb_var("DL_DIR")))
+        self.assertTrue(os.path.isfile(os.path.join(get_bb_var("DL_DIR"), 'test-aspell.tar.gz.done')), "File rename failed. No corresponding test-aspell.tar.gz.done file found under %s" % str(get_bb_var("DL_DIR")))
+
+    @testcase(1028)
+    def test_environment(self):
+        self.append_config("TEST_ENV=\"localconf\"")
+        self.addCleanup(self.remove_config, "TEST_ENV=\"localconf\"")
+        result = runCmd('bitbake -e | grep TEST_ENV=')
+        self.assertTrue('localconf' in result.output, msg = "bitbake didn't report any value for TEST_ENV variable. To test, run 'bitbake -e | grep TEST_ENV='")
+
+    @testcase(1029)
+    def test_dry_run(self):
+        result = runCmd('bitbake -n m4-native')
+        self.assertEqual(0, result.status, "bitbake dry run didn't run as expected. %s" % result.output)
+
+    @testcase(1030)
+    def test_just_parse(self):
+        result = runCmd('bitbake -p')
+        self.assertEqual(0, result.status, "errors encountered when parsing recipes. %s" % result.output)
+
+    @testcase(1031)
+    def test_version(self):
+        result = runCmd('bitbake -s | grep wget')
+        find = re.search("wget *:([0-9a-zA-Z\.\-]+)", result.output)
+        self.assertTrue(find, "No version returned for searched recipe. bitbake output: %s" % result.output)
+
+    @testcase(1032)
+    def test_prefile(self):
+        preconf = os.path.join(self.builddir, 'conf/prefile.conf')
+        self.track_for_cleanup(preconf)
+        ftools.write_file(preconf ,"TEST_PREFILE=\"prefile\"")
+        result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=')
+        self.assertTrue('prefile' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration. ")
+        self.append_config("TEST_PREFILE=\"localconf\"")
+        self.addCleanup(self.remove_config, "TEST_PREFILE=\"localconf\"")
+        result = runCmd('bitbake -r conf/prefile.conf -e | grep TEST_PREFILE=')
+        self.assertTrue('localconf' in result.output, "Preconfigure file \"prefile.conf\"was not taken into consideration.")
+
+    @testcase(1033)
+    def test_postfile(self):
+        postconf = os.path.join(self.builddir, 'conf/postfile.conf')
+        self.track_for_cleanup(postconf)
+        ftools.write_file(postconf , "TEST_POSTFILE=\"postfile\"")
+        self.append_config("TEST_POSTFILE=\"localconf\"")
+        self.addCleanup(self.remove_config, "TEST_POSTFILE=\"localconf\"")
+        result = runCmd('bitbake -R conf/postfile.conf -e | grep TEST_POSTFILE=')
+        self.assertTrue('postfile' in result.output, "Postconfigure file \"postfile.conf\"was not taken into consideration.")
+
+    @testcase(1034)
+    def test_checkuri(self):
+        result = runCmd('bitbake -c checkuri m4')
+        self.assertEqual(0, result.status, msg = "\"checkuri\" task was not executed. bitbake output: %s" % result.output)
+
+    @testcase(1035)
+    def test_continue(self):
+        self.write_config("""DL_DIR = \"${TOPDIR}/download-selftest\"
+SSTATE_DIR = \"${TOPDIR}/download-selftest\"
+""")
+        self.write_recipeinc('man',"\ndo_fail_task () {\nexit 1 \n}\n\naddtask do_fail_task before do_fetch\n" )
+        runCmd('bitbake -c cleanall man xcursor-transparent-theme')
+        result = runCmd('bitbake man xcursor-transparent-theme -k', ignore_status=True)
+        errorpos = result.output.find('ERROR: Function failed: do_fail_task')
+        manver = re.search("NOTE: recipe xcursor-transparent-theme-(.*?): task do_unpack: Started", result.output)
+        continuepos = result.output.find('NOTE: recipe xcursor-transparent-theme-%s: task do_unpack: Started' % manver.group(1))
+        self.assertLess(errorpos,continuepos, msg = "bitbake didn't pass do_fail_task. bitbake output: %s" % result.output)
+
+    @testcase(1119)
+    def test_non_gplv3(self):
+        data = 'INCOMPATIBLE_LICENSE = "GPLv3"'
+        conf = os.path.join(self.builddir, 'conf/local.conf')
+        ftools.append_file(conf ,data)
+        self.addCleanup(ftools.remove_from_file, conf ,data)
+        result = bitbake('readline', ignore_status=True)
+        self.assertEqual(result.status, 0, "Bitbake failed, exit code %s, output %s" % (result.status, result.output))
+        self.assertFalse(os.path.isfile(os.path.join(self.builddir, 'tmp/deploy/licenses/readline/generic_GPLv3')))
+        self.assertTrue(os.path.isfile(os.path.join(self.builddir, 'tmp/deploy/licenses/readline/generic_GPLv2')))
diff --git a/meta/lib/oeqa/selftest/buildhistory.py b/meta/lib/oeqa/selftest/buildhistory.py
new file mode 100644
index 0000000..d8cae46
--- /dev/null
+++ b/meta/lib/oeqa/selftest/buildhistory.py
@@ -0,0 +1,45 @@
+import unittest
+import os
+import re
+import shutil
+import datetime
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
+
+
+class BuildhistoryBase(oeSelfTest):
+
+    def config_buildhistory(self, tmp_bh_location=False):
+        if (not 'buildhistory' in get_bb_var('USER_CLASSES')) and (not 'buildhistory' in get_bb_var('INHERIT')):
+            add_buildhistory_config = 'INHERIT += "buildhistory"\nBUILDHISTORY_COMMIT = "1"'
+            self.append_config(add_buildhistory_config)
+
+        if tmp_bh_location:
+            # Using a temporary buildhistory location for testing
+            tmp_bh_dir = os.path.join(self.builddir, "tmp_buildhistory_%s" % datetime.datetime.now().strftime('%Y%m%d%H%M%S'))
+            buildhistory_dir_config = "BUILDHISTORY_DIR = \"%s\"" % tmp_bh_dir
+            self.append_config(buildhistory_dir_config)
+            self.track_for_cleanup(tmp_bh_dir)
+
+    def run_buildhistory_operation(self, target, global_config='', target_config='', change_bh_location=False, expect_error=False, error_regex=''):
+        if change_bh_location:
+            tmp_bh_location = True
+        else:
+            tmp_bh_location = False
+        self.config_buildhistory(tmp_bh_location)
+
+        self.append_config(global_config)
+        self.append_recipeinc(target, target_config)
+        bitbake("-cclean %s" % target)
+        result = bitbake(target, ignore_status=True)
+        self.remove_config(global_config)
+        self.remove_recipeinc(target, target_config)
+
+        if expect_error:
+            self.assertEqual(result.status, 1, msg="Error expected for global config '%s' and target config '%s'" % (global_config, target_config))
+            search_for_error = re.search(error_regex, result.output)
+            self.assertTrue(search_for_error, msg="Could not find desired error in output: %s" % error_regex)
+        else:
+            self.assertEqual(result.status, 0, msg="Command 'bitbake %s' has failed unexpectedly: %s" % (target, result.output))
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
new file mode 100644
index 0000000..483803b
--- /dev/null
+++ b/meta/lib/oeqa/selftest/buildoptions.py
@@ -0,0 +1,149 @@
+import unittest
+import os
+import logging
+import re
+import glob as g
+import pexpect as p
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.selftest.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+import oeqa.utils.ftools as ftools
+from oeqa.utils.decorators import testcase
+
+class ImageOptionsTests(oeSelfTest):
+
+    @testcase(761)
+    def test_incremental_image_generation(self):
+        image_pkgtype = get_bb_var("IMAGE_PKGTYPE")
+        if image_pkgtype != 'rpm':
+            self.skipTest('Not using RPM as main package format')
+        bitbake("-c cleanall core-image-minimal")
+        self.write_config('INC_RPM_IMAGE_GEN = "1"')
+        self.append_config('IMAGE_FEATURES += "ssh-server-openssh"')
+        bitbake("core-image-minimal")
+        log_data_file = os.path.join(get_bb_var("WORKDIR", "core-image-minimal"), "temp/log.do_rootfs")
+        log_data_created = ftools.read_file(log_data_file)
+        incremental_created = re.search("NOTE: load old install solution for incremental install\nNOTE: old install solution not exist\nNOTE: creating new install solution for incremental install(\n.*)*NOTE: Installing the following packages:.*packagegroup-core-ssh-openssh", log_data_created)
+        self.remove_config('IMAGE_FEATURES += "ssh-server-openssh"')
+        self.assertTrue(incremental_created, msg = "Match failed in:\n%s" % log_data_created)
+        bitbake("core-image-minimal")
+        log_data_removed = ftools.read_file(log_data_file)
+        incremental_removed = re.search("NOTE: load old install solution for incremental install\nNOTE: creating new install solution for incremental install(\n.*)*NOTE: incremental removed:.*openssh-sshd-.*", log_data_removed)
+        self.assertTrue(incremental_removed, msg = "Match failed in:\n%s" % log_data_removed)
+
+    @testcase(925)
+    def test_rm_old_image(self):
+        bitbake("core-image-minimal")
+        deploydir = get_bb_var("DEPLOY_DIR_IMAGE", target="core-image-minimal")
+        imagename = get_bb_var("IMAGE_LINK_NAME", target="core-image-minimal")
+        deploydir_files = os.listdir(deploydir)
+        track_original_files = []
+        for image_file in deploydir_files:
+            if imagename in image_file and os.path.islink(os.path.join(deploydir, image_file)):
+                track_original_files.append(os.path.realpath(os.path.join(deploydir, image_file)))
+        self.append_config("RM_OLD_IMAGE = \"1\"")
+        bitbake("-C rootfs core-image-minimal")
+        deploydir_files = os.listdir(deploydir)
+        remaining_not_expected = [path for path in track_original_files if os.path.basename(path) in deploydir_files]
+        self.assertFalse(remaining_not_expected, msg="\nThe following image files were not removed: %s" % ', '.join(map(str, remaining_not_expected)))
+
+    @testcase(286)
+    def test_ccache_tool(self):
+        bitbake("ccache-native")
+        self.assertTrue(os.path.isfile(os.path.join(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native'), "ccache")), msg = "No ccache found under %s" % str(get_bb_var('STAGING_BINDIR_NATIVE', 'ccache-native')))
+        self.write_config('INHERIT += "ccache"')
+        bitbake("m4 -c cleansstate")
+        bitbake("m4 -c compile")
+        self.addCleanup(bitbake, 'ccache-native -ccleansstate')
+        res = runCmd("grep ccache %s" % (os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile")), ignore_status=True)
+        self.assertEqual(0, res.status, msg="No match for ccache in m4 log.do_compile. For further details: %s" % os.path.join(get_bb_var("WORKDIR","m4"),"temp/log.do_compile"))
+
+
+class DiskMonTest(oeSelfTest):
+
+    @testcase(277)
+    def test_stoptask_behavior(self):
+        self.write_config('BB_DISKMON_DIRS = "STOPTASKS,${TMPDIR},100000G,100K"')
+        res = bitbake("m4", ignore_status = True)
+        self.assertTrue('ERROR: No new tasks can be executed since the disk space monitor action is "STOPTASKS"!' in res.output, msg = "Tasks should have stopped. Disk monitor is set to STOPTASK: %s" % res.output)
+        self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output))
+        self.write_config('BB_DISKMON_DIRS = "ABORT,${TMPDIR},100000G,100K"')
+        res = bitbake("m4", ignore_status = True)
+        self.assertTrue('ERROR: Immediately abort since the disk space monitor action is "ABORT"!' in res.output, "Tasks should have been aborted immediatelly. Disk monitor is set to ABORT: %s" % res.output)
+        self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output))
+        self.write_config('BB_DISKMON_DIRS = "WARN,${TMPDIR},100000G,100K"')
+        res = bitbake("m4")
+        self.assertTrue('WARNING: The free space' in res.output, msg = "A warning should have been displayed for disk monitor is set to WARN: %s" %res.output)
+
+class SanityOptionsTest(oeSelfTest):
+
+    @testcase(927)
+    def test_options_warnqa_errorqa_switch(self):
+        bitbake("xcursor-transparent-theme -ccleansstate")
+
+        if "packages-list" not in get_bb_var("ERROR_QA"):
+            self.write_config("ERROR_QA_append = \" packages-list\"")
+
+        self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"')
+        res = bitbake("xcursor-transparent-theme", ignore_status=True)
+        self.delete_recipeinc('xcursor-transparent-theme')
+        self.assertTrue("ERROR: QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors." in res.output, msg=res.output)
+        self.assertEqual(res.status, 1, msg = "bitbake reported exit code %s. It should have been 1. Bitbake output: %s" % (str(res.status), res.output))
+        self.write_recipeinc('xcursor-transparent-theme', 'PACKAGES += \"${PN}-dbg\"')
+        self.append_config('ERROR_QA_remove = "packages-list"')
+        self.append_config('WARN_QA_append = " packages-list"')
+        bitbake("xcursor-transparent-theme -ccleansstate")
+        res = bitbake("xcursor-transparent-theme")
+        self.delete_recipeinc('xcursor-transparent-theme')
+        self.assertTrue("WARNING: QA Issue: xcursor-transparent-theme-dbg is listed in PACKAGES multiple times, this leads to packaging errors." in res.output, msg=res.output)
+
+    @testcase(278)
+    def test_sanity_userspace_dependency(self):
+        self.append_config('WARN_QA_append = " unsafe-references-in-binaries unsafe-references-in-scripts"')
+        bitbake("-ccleansstate gzip nfs-utils")
+        res = bitbake("gzip nfs-utils")
+        self.assertTrue("WARNING: QA Issue: gzip" in res.output, "WARNING: QA Issue: gzip message is not present in bitbake's output: %s" % res.output)
+        self.assertTrue("WARNING: QA Issue: nfs-utils" in res.output, "WARNING: QA Issue: nfs-utils message is not present in bitbake's output: %s" % res.output)
+
+class BuildhistoryTests(BuildhistoryBase):
+
+    @testcase(293)
+    def test_buildhistory_basic(self):
+        self.run_buildhistory_operation('xcursor-transparent-theme')
+        self.assertTrue(os.path.isdir(get_bb_var('BUILDHISTORY_DIR')), "buildhistory dir was not created.")
+
+    @testcase(294)
+    def test_buildhistory_buildtime_pr_backwards(self):
+        self.add_command_to_tearDown('cleanup-workdir')
+        target = 'xcursor-transparent-theme'
+        error = "ERROR: QA Issue: Package version for package %s went backwards which would break package feeds from (.*-r1 to .*-r0)" % target
+        self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
+        self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True, error_regex=error)
+
+class BuildImagesTest(oeSelfTest):
+    @testcase(563)
+    def test_directfb(self):
+        """
+        This method is used to test the build of directfb image for arm arch.
+        In essence we build a coreimagedirectfb and test the exitcode of bitbake that in case of success is 0.
+        """
+        self.add_command_to_tearDown('cleanupworkdir')
+        self.write_config("DISTRO_FEATURES_remove = \"x11\"\nDISTRO_FEATURES_append = \" directfb\"\nMACHINE ??= \"qemuarm\"")
+        res = bitbake("core-image-directfb", ignore_status=True)
+        self.assertEqual(res.status, 0, "\ncoreimagedirectfb failed to build. Please check logs for further details.\nbitbake output %s" % res.output)
+
+class ArchiverTest(oeSelfTest):
+    @testcase(926)
+    def test_arch_work_dir_and_export_source(self):
+        """
+        Test for archiving the work directory and exporting the source files.
+        """
+        self.add_command_to_tearDown('cleanupworkdir')
+        self.write_config("INHERIT = \"archiver\"\nARCHIVER_MODE[src] = \"original\"\nARCHIVER_MODE[srpm] = \"1\"")
+        res = bitbake("xcursor-transparent-theme", ignore_status=True)
+        self.assertEqual(res.status, 0, "\nCouldn't build xcursortransparenttheme.\nbitbake output %s" % res.output)
+        pkgs_path = g.glob(str(self.builddir) + "/tmp/deploy/sources/allarch*/xcurs*")
+        src_file_glob = str(pkgs_path[0]) + "/xcursor*.src.rpm"
+        tar_file_glob = str(pkgs_path[0]) + "/xcursor*.tar.gz"
+        self.assertTrue((g.glob(src_file_glob) and g.glob(tar_file_glob)), "Couldn't find .src.rpm and .tar.gz files under tmp/deploy/sources/allarch*/xcursor*")
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
new file mode 100644
index 0000000..6e731d6
--- /dev/null
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -0,0 +1,971 @@
+import unittest
+import os
+import logging
+import re
+import shutil
+import tempfile
+import glob
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer, runqemu
+from oeqa.utils.decorators import testcase
+
+class DevtoolBase(oeSelfTest):
+
+    def _test_recipe_contents(self, recipefile, checkvars, checkinherits):
+        with open(recipefile, 'r') as f:
+            for line in f:
+                if '=' in line:
+                    splitline = line.split('=', 1)
+                    var = splitline[0].rstrip()
+                    value = splitline[1].strip().strip('"')
+                    if var in checkvars:
+                        needvalue = checkvars.pop(var)
+                        self.assertEqual(value, needvalue, 'values for %s do not match' % var)
+                if line.startswith('inherit '):
+                    inherits = line.split()[1:]
+
+        self.assertEqual(checkvars, {}, 'Some variables not found: %s' % checkvars)
+
+        for inherit in checkinherits:
+            self.assertIn(inherit, inherits, 'Missing inherit of %s' % inherit)
+
+    def _check_bbappend(self, testrecipe, recipefile, appenddir):
+        result = runCmd('bitbake-layers show-appends', cwd=self.builddir)
+        resultlines = result.output.splitlines()
+        inrecipe = False
+        bbappends = []
+        bbappendfile = None
+        for line in resultlines:
+            if inrecipe:
+                if line.startswith(' '):
+                    bbappends.append(line.strip())
+                else:
+                    break
+            elif line == '%s:' % os.path.basename(recipefile):
+                inrecipe = True
+        self.assertLessEqual(len(bbappends), 2, '%s recipe is being bbappended by another layer - bbappends found:\n  %s' % (testrecipe, '\n  '.join(bbappends)))
+        for bbappend in bbappends:
+            if bbappend.startswith(appenddir):
+                bbappendfile = bbappend
+                break
+        else:
+            self.fail('bbappend for recipe %s does not seem to be created in test layer' % testrecipe)
+        return bbappendfile
+
+    def _create_temp_layer(self, templayerdir, addlayer, templayername, priority=999, recipepathspec='recipes-*/*'):
+        create_temp_layer(templayerdir, templayername, priority, recipepathspec)
+        if addlayer:
+            self.add_command_to_tearDown('bitbake-layers remove-layer %s || true' % templayerdir)
+            result = runCmd('bitbake-layers add-layer %s' % templayerdir, cwd=self.builddir)
+
+    def _process_ls_output(self, output):
+        """
+        Convert ls -l output to a format we can reasonably compare from one context
+        to another (e.g. from host to target)
+        """
+        filelist = []
+        for line in output.splitlines():
+            splitline = line.split()
+            # Remove trailing . on perms
+            splitline[0] = splitline[0].rstrip('.')
+            # Remove leading . on paths
+            splitline[-1] = splitline[-1].lstrip('.')
+            # Drop fields we don't want to compare
+            del splitline[7]
+            del splitline[6]
+            del splitline[5]
+            del splitline[4]
+            del splitline[1]
+            filelist.append(' '.join(splitline))
+        return filelist
+
+
+class DevtoolTests(DevtoolBase):
+
+    @testcase(1158)
+    def test_create_workspace(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        result = runCmd('bitbake-layers show-layers')
+        self.assertTrue('/workspace' not in result.output, 'This test cannot be run with a workspace layer in bblayers.conf')
+        # Try creating a workspace layer with a specific path
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        result = runCmd('devtool create-workspace %s' % tempdir)
+        self.assertTrue(os.path.isfile(os.path.join(tempdir, 'conf', 'layer.conf')), msg = "No workspace created. devtool output: %s " % result.output)
+        result = runCmd('bitbake-layers show-layers')
+        self.assertIn(tempdir, result.output)
+        # Try creating a workspace layer with the default path
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        result = runCmd('devtool create-workspace')
+        self.assertTrue(os.path.isfile(os.path.join(workspacedir, 'conf', 'layer.conf')), msg = "No workspace created. devtool output: %s " % result.output)
+        result = runCmd('bitbake-layers show-layers')
+        self.assertNotIn(tempdir, result.output)
+        self.assertIn(workspacedir, result.output)
+
+    @testcase(1159)
+    def test_devtool_add(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        # Fetch source
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        url = 'http://www.ivarch.com/programs/sources/pv-1.5.3.tar.bz2'
+        result = runCmd('wget %s' % url, cwd=tempdir)
+        result = runCmd('tar xfv pv-1.5.3.tar.bz2', cwd=tempdir)
+        srcdir = os.path.join(tempdir, 'pv-1.5.3')
+        self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure')), 'Unable to find configure script in source directory')
+        # Test devtool add
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake -c cleansstate pv')
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        result = runCmd('devtool add pv %s' % srcdir)
+        self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+        # Test devtool status
+        result = runCmd('devtool status')
+        self.assertIn('pv', result.output)
+        self.assertIn(srcdir, result.output)
+        # Clean up anything in the workdir/sysroot/sstate cache (have to do this *after* devtool add since the recipe only exists then)
+        bitbake('pv -c cleansstate')
+        # Test devtool build
+        result = runCmd('devtool build pv')
+        installdir = get_bb_var('D', 'pv')
+        self.assertTrue(installdir, 'Could not query installdir variable')
+        bindir = get_bb_var('bindir', 'pv')
+        self.assertTrue(bindir, 'Could not query bindir variable')
+        if bindir[0] == '/':
+            bindir = bindir[1:]
+        self.assertTrue(os.path.isfile(os.path.join(installdir, bindir, 'pv')), 'pv binary not found in D')
+
+    @testcase(1162)
+    def test_devtool_add_library(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        # We don't have the ability to pick up this dependency automatically yet...
+        bitbake('libusb1')
+        # Fetch source
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        url = 'http://www.intra2net.com/en/developer/libftdi/download/libftdi1-1.1.tar.bz2'
+        result = runCmd('wget %s' % url, cwd=tempdir)
+        result = runCmd('tar xfv libftdi1-1.1.tar.bz2', cwd=tempdir)
+        srcdir = os.path.join(tempdir, 'libftdi1-1.1')
+        self.assertTrue(os.path.isfile(os.path.join(srcdir, 'CMakeLists.txt')), 'Unable to find CMakeLists.txt in source directory')
+        # Test devtool add (and use -V so we test that too)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        result = runCmd('devtool add libftdi %s -V 1.1' % srcdir)
+        self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+        # Test devtool status
+        result = runCmd('devtool status')
+        self.assertIn('libftdi', result.output)
+        self.assertIn(srcdir, result.output)
+        # Clean up anything in the workdir/sysroot/sstate cache (have to do this *after* devtool add since the recipe only exists then)
+        bitbake('libftdi -c cleansstate')
+        # Test devtool build
+        result = runCmd('devtool build libftdi')
+        staging_libdir = get_bb_var('STAGING_LIBDIR', 'libftdi')
+        self.assertTrue(staging_libdir, 'Could not query STAGING_LIBDIR variable')
+        self.assertTrue(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), "libftdi binary not found in STAGING_LIBDIR. Output of devtool build libftdi %s" % result.output)
+        # Test devtool reset
+        stampprefix = get_bb_var('STAMP', 'libftdi')
+        result = runCmd('devtool reset libftdi')
+        result = runCmd('devtool status')
+        self.assertNotIn('libftdi', result.output)
+        self.assertTrue(stampprefix, 'Unable to get STAMP value for recipe libftdi')
+        matches = glob.glob(stampprefix + '*')
+        self.assertFalse(matches, 'Stamp files exist for recipe libftdi that should have been cleaned')
+        self.assertFalse(os.path.isfile(os.path.join(staging_libdir, 'libftdi1.so.2.1.0')), 'libftdi binary still found in STAGING_LIBDIR after cleaning')
+
+    @testcase(1160)
+    def test_devtool_add_fetch(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        # Fetch source
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        testver = '0.23'
+        url = 'https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-%s.tar.gz' % testver
+        testrecipe = 'python-markupsafe'
+        srcdir = os.path.join(tempdir, testrecipe)
+        # Test devtool add
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url))
+        self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created. %s' % result.output)
+        self.assertTrue(os.path.isfile(os.path.join(srcdir, 'setup.py')), 'Unable to find setup.py in source directory')
+        # Test devtool status
+        result = runCmd('devtool status')
+        self.assertIn(testrecipe, result.output)
+        self.assertIn(srcdir, result.output)
+        # Check recipe
+        recipefile = get_bb_var('FILE', testrecipe)
+        self.assertIn('%s.bb' % testrecipe, recipefile, 'Recipe file incorrectly named')
+        checkvars = {}
+        checkvars['S'] = '${WORKDIR}/MarkupSafe-%s' % testver
+        checkvars['SRC_URI'] = url
+        self._test_recipe_contents(recipefile, checkvars, [])
+        # Try with version specified
+        result = runCmd('devtool reset -n %s' % testrecipe)
+        shutil.rmtree(srcdir)
+        result = runCmd('devtool add %s %s -f %s -V %s' % (testrecipe, srcdir, url, testver))
+        self.assertTrue(os.path.isfile(os.path.join(srcdir, 'setup.py')), 'Unable to find setup.py in source directory')
+        # Test devtool status
+        result = runCmd('devtool status')
+        self.assertIn(testrecipe, result.output)
+        self.assertIn(srcdir, result.output)
+        # Check recipe
+        recipefile = get_bb_var('FILE', testrecipe)
+        self.assertIn('%s_%s.bb' % (testrecipe, testver), recipefile, 'Recipe file incorrectly named')
+        checkvars = {}
+        checkvars['S'] = '${WORKDIR}/MarkupSafe-${PV}'
+        checkvars['SRC_URI'] = url.replace(testver, '${PV}')
+        self._test_recipe_contents(recipefile, checkvars, [])
+
+    @testcase(1161)
+    def test_devtool_add_fetch_git(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        # Fetch source
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        url = 'git://git.yoctoproject.org/libmatchbox'
+        checkrev = '462f0652055d89c648ddd54fd7b03f175c2c6973'
+        testrecipe = 'libmatchbox2'
+        srcdir = os.path.join(tempdir, testrecipe)
+        # Test devtool add
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake -c cleansstate %s' % testrecipe)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        result = runCmd('devtool add %s %s -f %s' % (testrecipe, srcdir, url))
+        self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created: %s' % result.output)
+        self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure.ac in source directory')
+        # Test devtool status
+        result = runCmd('devtool status')
+        self.assertIn(testrecipe, result.output)
+        self.assertIn(srcdir, result.output)
+        # Check recipe
+        recipefile = get_bb_var('FILE', testrecipe)
+        self.assertIn('_git.bb', recipefile, 'Recipe file incorrectly named')
+        checkvars = {}
+        checkvars['S'] = '${WORKDIR}/git'
+        checkvars['PV'] = '1.0+git${SRCPV}'
+        checkvars['SRC_URI'] = url
+        checkvars['SRCREV'] = '${AUTOREV}'
+        self._test_recipe_contents(recipefile, checkvars, [])
+        # Try with revision and version specified
+        result = runCmd('devtool reset -n %s' % testrecipe)
+        shutil.rmtree(srcdir)
+        url_rev = '%s;rev=%s' % (url, checkrev)
+        result = runCmd('devtool add %s %s -f "%s" -V 1.5' % (testrecipe, srcdir, url_rev))
+        self.assertTrue(os.path.isfile(os.path.join(srcdir, 'configure.ac')), 'Unable to find configure.ac in source directory')
+        # Test devtool status
+        result = runCmd('devtool status')
+        self.assertIn(testrecipe, result.output)
+        self.assertIn(srcdir, result.output)
+        # Check recipe
+        recipefile = get_bb_var('FILE', testrecipe)
+        self.assertIn('_git.bb', recipefile, 'Recipe file incorrectly named')
+        checkvars = {}
+        checkvars['S'] = '${WORKDIR}/git'
+        checkvars['PV'] = '1.5+git${SRCPV}'
+        checkvars['SRC_URI'] = url
+        checkvars['SRCREV'] = checkrev
+        self._test_recipe_contents(recipefile, checkvars, [])
+
+    @testcase(1164)
+    def test_devtool_modify(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        # Clean up anything in the workdir/sysroot/sstate cache
+        bitbake('mdadm -c cleansstate')
+        # Try modifying a recipe
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        self.add_command_to_tearDown('bitbake -c clean mdadm')
+        result = runCmd('devtool modify mdadm -x %s' % tempdir)
+        self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found')
+        self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
+        self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+        matches = glob.glob(os.path.join(workspacedir, 'appends', 'mdadm_*.bbappend'))
+        self.assertTrue(matches, 'bbappend not created %s' % result.output)
+        # Test devtool status
+        result = runCmd('devtool status')
+        self.assertIn('mdadm', result.output)
+        self.assertIn(tempdir, result.output)
+        # Check git repo
+        result = runCmd('git status --porcelain', cwd=tempdir)
+        self.assertEqual(result.output.strip(), "", 'Created git repo is not clean')
+        result = runCmd('git symbolic-ref HEAD', cwd=tempdir)
+        self.assertEqual(result.output.strip(), "refs/heads/devtool", 'Wrong branch in git repo')
+        # Try building
+        bitbake('mdadm')
+        # Try making (minor) modifications to the source
+        result = runCmd("sed -i 's!^\.TH.*!.TH MDADM 8 \"\" v9.999-custom!' %s" % os.path.join(tempdir, 'mdadm.8.in'))
+        bitbake('mdadm -c package')
+        pkgd = get_bb_var('PKGD', 'mdadm')
+        self.assertTrue(pkgd, 'Could not query PKGD variable')
+        mandir = get_bb_var('mandir', 'mdadm')
+        self.assertTrue(mandir, 'Could not query mandir variable')
+        if mandir[0] == '/':
+            mandir = mandir[1:]
+        with open(os.path.join(pkgd, mandir, 'man8', 'mdadm.8'), 'r') as f:
+            for line in f:
+                if line.startswith('.TH'):
+                    self.assertEqual(line.rstrip(), '.TH MDADM 8 "" v9.999-custom', 'man file not modified. man searched file path: %s' % os.path.join(pkgd, mandir, 'man8', 'mdadm.8'))
+        # Test devtool reset
+        stampprefix = get_bb_var('STAMP', 'mdadm')
+        result = runCmd('devtool reset mdadm')
+        result = runCmd('devtool status')
+        self.assertNotIn('mdadm', result.output)
+        self.assertTrue(stampprefix, 'Unable to get STAMP value for recipe mdadm')
+        matches = glob.glob(stampprefix + '*')
+        self.assertFalse(matches, 'Stamp files exist for recipe mdadm that should have been cleaned')
+
+    @testcase(1166)
+    def test_devtool_modify_invalid(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        # Try modifying some recipes
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+        testrecipes = 'perf kernel-devsrc package-index core-image-minimal meta-toolchain packagegroup-core-sdk meta-ide-support'.split()
+        # Find actual name of gcc-source since it now includes the version - crude, but good enough for this purpose
+        result = runCmd('bitbake-layers show-recipes gcc-source*')
+        reading = False
+        for line in result.output.splitlines():
+            if line.startswith('=='):
+                reading = True
+            elif reading and not line.startswith(' '):
+                testrecipes.append(line.split(':')[0])
+        for testrecipe in testrecipes:
+            # Check it's a valid recipe
+            bitbake('%s -e' % testrecipe)
+            # devtool extract should fail
+            result = runCmd('devtool extract %s %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True)
+            self.assertNotEqual(result.status, 0, 'devtool extract on %s should have failed. devtool output: %s' % (testrecipe, result.output))
+            self.assertNotIn('Fetching ', result.output, 'devtool extract on %s should have errored out before trying to fetch' % testrecipe)
+            self.assertIn('ERROR: ', result.output, 'devtool extract on %s should have given an ERROR' % testrecipe)
+            # devtool modify should fail
+            result = runCmd('devtool modify %s -x %s' % (testrecipe, os.path.join(tempdir, testrecipe)), ignore_status=True)
+            self.assertNotEqual(result.status, 0, 'devtool modify on %s should have failed. devtool output: %s' %  (testrecipe, result.output))
+            self.assertIn('ERROR: ', result.output, 'devtool modify on %s should have given an ERROR' % testrecipe)
+
+    def test_devtool_modify_native(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        # Try modifying some recipes
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+
+        bbclassextended = False
+        inheritnative = False
+        testrecipes = 'mtools-native apt-native desktop-file-utils-native'.split()
+        for testrecipe in testrecipes:
+            checkextend = 'native' in (get_bb_var('BBCLASSEXTEND', testrecipe) or '').split()
+            if not bbclassextended:
+                bbclassextended = checkextend
+            if not inheritnative:
+                inheritnative = not checkextend
+            result = runCmd('devtool modify %s -x %s' % (testrecipe, os.path.join(tempdir, testrecipe)))
+            self.assertNotIn('ERROR: ', result.output, 'ERROR in devtool modify output: %s' % result.output)
+            result = runCmd('devtool build %s' % testrecipe)
+            self.assertNotIn('ERROR: ', result.output, 'ERROR in devtool build output: %s' % result.output)
+            result = runCmd('devtool reset %s' % testrecipe)
+            self.assertNotIn('ERROR: ', result.output, 'ERROR in devtool reset output: %s' % result.output)
+
+        self.assertTrue(bbclassextended, 'None of these recipes are BBCLASSEXTENDed to native - need to adjust testrecipes list: %s' % ', '.join(testrecipes))
+        self.assertTrue(inheritnative, 'None of these recipes do "inherit native" - need to adjust testrecipes list: %s' % ', '.join(testrecipes))
+
+
+    @testcase(1165)
+    def test_devtool_modify_git(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        testrecipe = 'mkelfimage'
+        src_uri = get_bb_var('SRC_URI', testrecipe)
+        self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
+        # Clean up anything in the workdir/sysroot/sstate cache
+        bitbake('%s -c cleansstate' % testrecipe)
+        # Try modifying a recipe
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe)
+        result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+        self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile')), 'Extracted source could not be found')
+        self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
+        self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created. devtool output: %s' % result.output)
+        matches = glob.glob(os.path.join(workspacedir, 'appends', 'mkelfimage_*.bbappend'))
+        self.assertTrue(matches, 'bbappend not created')
+        # Test devtool status
+        result = runCmd('devtool status')
+        self.assertIn(testrecipe, result.output)
+        self.assertIn(tempdir, result.output)
+        # Check git repo
+        result = runCmd('git status --porcelain', cwd=tempdir)
+        self.assertEqual(result.output.strip(), "", 'Created git repo is not clean')
+        result = runCmd('git symbolic-ref HEAD', cwd=tempdir)
+        self.assertEqual(result.output.strip(), "refs/heads/devtool", 'Wrong branch in git repo')
+        # Try building
+        bitbake(testrecipe)
+
+    @testcase(1167)
+    def test_devtool_modify_localfiles(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        testrecipe = 'lighttpd'
+        src_uri = (get_bb_var('SRC_URI', testrecipe) or '').split()
+        foundlocal = False
+        for item in src_uri:
+            if item.startswith('file://') and '.patch' not in item:
+                foundlocal = True
+                break
+        self.assertTrue(foundlocal, 'This test expects the %s recipe to fetch local files and it seems that it no longer does' % testrecipe)
+        # Clean up anything in the workdir/sysroot/sstate cache
+        bitbake('%s -c cleansstate' % testrecipe)
+        # Try modifying a recipe
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe)
+        result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+        self.assertTrue(os.path.exists(os.path.join(tempdir, 'configure.ac')), 'Extracted source could not be found')
+        self.assertTrue(os.path.exists(os.path.join(workspacedir, 'conf', 'layer.conf')), 'Workspace directory not created')
+        matches = glob.glob(os.path.join(workspacedir, 'appends', '%s_*.bbappend' % testrecipe))
+        self.assertTrue(matches, 'bbappend not created')
+        # Test devtool status
+        result = runCmd('devtool status')
+        self.assertIn(testrecipe, result.output)
+        self.assertIn(tempdir, result.output)
+        # Try building
+        bitbake(testrecipe)
+
+    @testcase(1169)
+    def test_devtool_update_recipe(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        testrecipe = 'minicom'
+        recipefile = get_bb_var('FILE', testrecipe)
+        src_uri = get_bb_var('SRC_URI', testrecipe)
+        self.assertNotIn('git://', src_uri, 'This test expects the %s recipe to NOT be a git recipe' % testrecipe)
+        result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+        self.assertEqual(result.output.strip(), "", '%s recipe is not clean' % testrecipe)
+        # First, modify a recipe
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        # (don't bother with cleaning the recipe on teardown, we won't be building it)
+        result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+        # Check git repo
+        self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
+        result = runCmd('git status --porcelain', cwd=tempdir)
+        self.assertEqual(result.output.strip(), "", 'Created git repo is not clean')
+        result = runCmd('git symbolic-ref HEAD', cwd=tempdir)
+        self.assertEqual(result.output.strip(), "refs/heads/devtool", 'Wrong branch in git repo')
+        # Add a couple of commits
+        # FIXME: this only tests adding, need to also test update and remove
+        result = runCmd('echo "Additional line" >> README', cwd=tempdir)
+        result = runCmd('git commit -a -m "Change the README"', cwd=tempdir)
+        result = runCmd('echo "A new file" > devtool-new-file', cwd=tempdir)
+        result = runCmd('git add devtool-new-file', cwd=tempdir)
+        result = runCmd('git commit -m "Add a new file"', cwd=tempdir)
+        self.add_command_to_tearDown('cd %s; rm %s/*.patch; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+        result = runCmd('devtool update-recipe %s' % testrecipe)
+        result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+        self.assertNotEqual(result.output.strip(), "", '%s recipe should be modified' % testrecipe)
+        status = result.output.splitlines()
+        self.assertEqual(len(status), 3, 'Less/more files modified than expected. Entire status:\n%s' % result.output)
+        for line in status:
+            if line.endswith('0001-Change-the-README.patch'):
+                self.assertEqual(line[:3], '?? ', 'Unexpected status in line: %s' % line)
+            elif line.endswith('0002-Add-a-new-file.patch'):
+                self.assertEqual(line[:3], '?? ', 'Unexpected status in line: %s' % line)
+            elif re.search('%s_[^_]*.bb$' % testrecipe, line):
+                self.assertEqual(line[:3], ' M ', 'Unexpected status in line: %s' % line)
+            else:
+                raise AssertionError('Unexpected modified file in status: %s' % line)
+
+    @testcase(1172)
+    def test_devtool_update_recipe_git(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        testrecipe = 'mtd-utils'
+        recipefile = get_bb_var('FILE', testrecipe)
+        src_uri = get_bb_var('SRC_URI', testrecipe)
+        self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
+        patches = []
+        for entry in src_uri.split():
+            if entry.startswith('file://') and entry.endswith('.patch'):
+                patches.append(entry[7:].split(';')[0])
+        self.assertGreater(len(patches), 0, 'The %s recipe does not appear to contain any patches, so this test will not be effective' % testrecipe)
+        result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+        self.assertEqual(result.output.strip(), "", '%s recipe is not clean' % testrecipe)
+        # First, modify a recipe
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        # (don't bother with cleaning the recipe on teardown, we won't be building it)
+        result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+        # Check git repo
+        self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
+        result = runCmd('git status --porcelain', cwd=tempdir)
+        self.assertEqual(result.output.strip(), "", 'Created git repo is not clean')
+        result = runCmd('git symbolic-ref HEAD', cwd=tempdir)
+        self.assertEqual(result.output.strip(), "refs/heads/devtool", 'Wrong branch in git repo')
+        # Add a couple of commits
+        # FIXME: this only tests adding, need to also test update and remove
+        result = runCmd('echo "# Additional line" >> Makefile', cwd=tempdir)
+        result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempdir)
+        result = runCmd('echo "A new file" > devtool-new-file', cwd=tempdir)
+        result = runCmd('git add devtool-new-file', cwd=tempdir)
+        result = runCmd('git commit -m "Add a new file"', cwd=tempdir)
+        self.add_command_to_tearDown('cd %s; rm -rf %s; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, testrecipe, os.path.basename(recipefile)))
+        result = runCmd('devtool update-recipe -m srcrev %s' % testrecipe)
+        result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+        self.assertNotEqual(result.output.strip(), "", '%s recipe should be modified' % testrecipe)
+        status = result.output.splitlines()
+        for line in status:
+            for patch in patches:
+                if line.endswith(patch):
+                    self.assertEqual(line[:3], ' D ', 'Unexpected status in line: %s' % line)
+                    break
+            else:
+                if re.search('%s_[^_]*.bb$' % testrecipe, line):
+                    self.assertEqual(line[:3], ' M ', 'Unexpected status in line: %s' % line)
+                else:
+                    raise AssertionError('Unexpected modified file in status: %s' % line)
+        result = runCmd('git diff %s' % os.path.basename(recipefile), cwd=os.path.dirname(recipefile))
+        addlines = ['SRCREV = ".*"', 'SRC_URI = "git://git.infradead.org/mtd-utils.git"']
+        srcurilines = src_uri.split()
+        srcurilines[0] = 'SRC_URI = "' + srcurilines[0]
+        srcurilines.append('"')
+        removelines = ['SRCREV = ".*"'] + srcurilines
+        for line in result.output.splitlines():
+            if line.startswith('+++') or line.startswith('---'):
+                continue
+            elif line.startswith('+'):
+                matched = False
+                for item in addlines:
+                    if re.match(item, line[1:].strip()):
+                        matched = True
+                        break
+                self.assertTrue(matched, 'Unexpected diff add line: %s' % line)
+            elif line.startswith('-'):
+                matched = False
+                for item in removelines:
+                    if re.match(item, line[1:].strip()):
+                        matched = True
+                        break
+                self.assertTrue(matched, 'Unexpected diff remove line: %s' % line)
+        # Now try with auto mode
+        runCmd('cd %s; git checkout %s %s' % (os.path.dirname(recipefile), testrecipe, os.path.basename(recipefile)))
+        result = runCmd('devtool update-recipe %s' % testrecipe)
+        result = runCmd('git rev-parse --show-toplevel')
+        topleveldir = result.output.strip()
+        result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+        status = result.output.splitlines()
+        relpatchpath = os.path.join(os.path.relpath(os.path.dirname(recipefile), topleveldir), testrecipe)
+        expectedstatus = [('M', os.path.relpath(recipefile, topleveldir)),
+                          ('??', '%s/0001-Change-the-Makefile.patch' % relpatchpath),
+                          ('??', '%s/0002-Add-a-new-file.patch' % relpatchpath)]
+        for line in status:
+            statusline = line.split(None, 1)
+            for fstatus, fn in expectedstatus:
+                if fn == statusline[1]:
+                    if fstatus != statusline[0]:
+                        self.fail('Unexpected status in line: %s' % line)
+                    break
+            else:
+                self.fail('Unexpected modified file in line: %s' % line)
+
+    @testcase(1170)
+    def test_devtool_update_recipe_append(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        testrecipe = 'mdadm'
+        recipefile = get_bb_var('FILE', testrecipe)
+        src_uri = get_bb_var('SRC_URI', testrecipe)
+        self.assertNotIn('git://', src_uri, 'This test expects the %s recipe to NOT be a git recipe' % testrecipe)
+        result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+        self.assertEqual(result.output.strip(), "", '%s recipe is not clean' % testrecipe)
+        # First, modify a recipe
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        tempsrcdir = os.path.join(tempdir, 'source')
+        templayerdir = os.path.join(tempdir, 'layer')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        # (don't bother with cleaning the recipe on teardown, we won't be building it)
+        result = runCmd('devtool modify %s -x %s' % (testrecipe, tempsrcdir))
+        # Check git repo
+        self.assertTrue(os.path.isdir(os.path.join(tempsrcdir, '.git')), 'git repository for external source tree not found')
+        result = runCmd('git status --porcelain', cwd=tempsrcdir)
+        self.assertEqual(result.output.strip(), "", 'Created git repo is not clean')
+        result = runCmd('git symbolic-ref HEAD', cwd=tempsrcdir)
+        self.assertEqual(result.output.strip(), "refs/heads/devtool", 'Wrong branch in git repo')
+        # Add a commit
+        result = runCmd("sed 's!\\(#define VERSION\\W*\"[^\"]*\\)\"!\\1-custom\"!' -i ReadMe.c", cwd=tempsrcdir)
+        result = runCmd('git commit -a -m "Add our custom version"', cwd=tempsrcdir)
+        self.add_command_to_tearDown('cd %s; rm -f %s/*.patch; git checkout .' % (os.path.dirname(recipefile), testrecipe))
+        # Create a temporary layer and add it to bblayers.conf
+        self._create_temp_layer(templayerdir, True, 'selftestupdaterecipe')
+        # Create the bbappend
+        result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
+        self.assertNotIn('WARNING:', result.output)
+        # Check recipe is still clean
+        result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+        self.assertEqual(result.output.strip(), "", '%s recipe is not clean' % testrecipe)
+        # Check bbappend was created
+        splitpath = os.path.dirname(recipefile).split(os.sep)
+        appenddir = os.path.join(templayerdir, splitpath[-2], splitpath[-1])
+        bbappendfile = self._check_bbappend(testrecipe, recipefile, appenddir)
+        patchfile = os.path.join(appenddir, testrecipe, '0001-Add-our-custom-version.patch')
+        self.assertTrue(os.path.exists(patchfile), 'Patch file not created')
+
+        # Check bbappend contents
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'SRC_URI += "file://0001-Add-our-custom-version.patch"\n',
+                         '\n']
+        with open(bbappendfile, 'r') as f:
+            self.assertEqual(expectedlines, f.readlines())
+
+        # Check we can run it again and bbappend isn't modified
+        result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
+        with open(bbappendfile, 'r') as f:
+            self.assertEqual(expectedlines, f.readlines())
+        # Drop new commit and check patch gets deleted
+        result = runCmd('git reset HEAD^', cwd=tempsrcdir)
+        result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
+        self.assertFalse(os.path.exists(patchfile), 'Patch file not deleted')
+        expectedlines2 = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n']
+        with open(bbappendfile, 'r') as f:
+            self.assertEqual(expectedlines2, f.readlines())
+        # Put commit back and check we can run it if layer isn't in bblayers.conf
+        os.remove(bbappendfile)
+        result = runCmd('git commit -a -m "Add our custom version"', cwd=tempsrcdir)
+        result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir)
+        result = runCmd('devtool update-recipe %s -a %s' % (testrecipe, templayerdir))
+        self.assertIn('WARNING: Specified layer is not currently enabled in bblayers.conf', result.output)
+        self.assertTrue(os.path.exists(patchfile), 'Patch file not created (with disabled layer)')
+        with open(bbappendfile, 'r') as f:
+            self.assertEqual(expectedlines, f.readlines())
+        # Deleting isn't expected to work under these circumstances
+
+    @testcase(1171)
+    def test_devtool_update_recipe_append_git(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        testrecipe = 'mtd-utils'
+        recipefile = get_bb_var('FILE', testrecipe)
+        src_uri = get_bb_var('SRC_URI', testrecipe)
+        self.assertIn('git://', src_uri, 'This test expects the %s recipe to be a git recipe' % testrecipe)
+        for entry in src_uri.split():
+            if entry.startswith('git://'):
+                git_uri = entry
+                break
+        result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+        self.assertEqual(result.output.strip(), "", '%s recipe is not clean' % testrecipe)
+        # First, modify a recipe
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        tempsrcdir = os.path.join(tempdir, 'source')
+        templayerdir = os.path.join(tempdir, 'layer')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        # (don't bother with cleaning the recipe on teardown, we won't be building it)
+        result = runCmd('devtool modify %s -x %s' % (testrecipe, tempsrcdir))
+        # Check git repo
+        self.assertTrue(os.path.isdir(os.path.join(tempsrcdir, '.git')), 'git repository for external source tree not found')
+        result = runCmd('git status --porcelain', cwd=tempsrcdir)
+        self.assertEqual(result.output.strip(), "", 'Created git repo is not clean')
+        result = runCmd('git symbolic-ref HEAD', cwd=tempsrcdir)
+        self.assertEqual(result.output.strip(), "refs/heads/devtool", 'Wrong branch in git repo')
+        # Add a commit
+        result = runCmd('echo "# Additional line" >> Makefile', cwd=tempsrcdir)
+        result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempsrcdir)
+        self.add_command_to_tearDown('cd %s; rm -f %s/*.patch; git checkout .' % (os.path.dirname(recipefile), testrecipe))
+        # Create a temporary layer
+        os.makedirs(os.path.join(templayerdir, 'conf'))
+        with open(os.path.join(templayerdir, 'conf', 'layer.conf'), 'w') as f:
+            f.write('BBPATH .= ":${LAYERDIR}"\n')
+            f.write('BBFILES += "${LAYERDIR}/recipes-*/*/*.bbappend"\n')
+            f.write('BBFILE_COLLECTIONS += "oeselftesttemplayer"\n')
+            f.write('BBFILE_PATTERN_oeselftesttemplayer = "^${LAYERDIR}/"\n')
+            f.write('BBFILE_PRIORITY_oeselftesttemplayer = "999"\n')
+            f.write('BBFILE_PATTERN_IGNORE_EMPTY_oeselftesttemplayer = "1"\n')
+        self.add_command_to_tearDown('bitbake-layers remove-layer %s || true' % templayerdir)
+        result = runCmd('bitbake-layers add-layer %s' % templayerdir, cwd=self.builddir)
+        # Create the bbappend
+        result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir))
+        self.assertNotIn('WARNING:', result.output)
+        # Check recipe is still clean
+        result = runCmd('git status . --porcelain', cwd=os.path.dirname(recipefile))
+        self.assertEqual(result.output.strip(), "", '%s recipe is not clean' % testrecipe)
+        # Check bbappend was created
+        splitpath = os.path.dirname(recipefile).split(os.sep)
+        appenddir = os.path.join(templayerdir, splitpath[-2], splitpath[-1])
+        bbappendfile = self._check_bbappend(testrecipe, recipefile, appenddir)
+        self.assertFalse(os.path.exists(os.path.join(appenddir, testrecipe)), 'Patch directory should not be created')
+
+        # Check bbappend contents
+        result = runCmd('git rev-parse HEAD', cwd=tempsrcdir)
+        expectedlines = ['SRCREV = "%s"\n' % result.output,
+                         '\n',
+                         'SRC_URI = "%s"\n' % git_uri,
+                         '\n']
+        with open(bbappendfile, 'r') as f:
+            self.assertEqual(expectedlines, f.readlines())
+
+        # Check we can run it again and bbappend isn't modified
+        result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir))
+        with open(bbappendfile, 'r') as f:
+            self.assertEqual(expectedlines, f.readlines())
+        # Drop new commit and check SRCREV changes
+        result = runCmd('git reset HEAD^', cwd=tempsrcdir)
+        result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir))
+        self.assertFalse(os.path.exists(os.path.join(appenddir, testrecipe)), 'Patch directory should not be created')
+        result = runCmd('git rev-parse HEAD', cwd=tempsrcdir)
+        expectedlines = ['SRCREV = "%s"\n' % result.output,
+                         '\n',
+                         'SRC_URI = "%s"\n' % git_uri,
+                         '\n']
+        with open(bbappendfile, 'r') as f:
+            self.assertEqual(expectedlines, f.readlines())
+        # Put commit back and check we can run it if layer isn't in bblayers.conf
+        os.remove(bbappendfile)
+        result = runCmd('git commit -a -m "Change the Makefile"', cwd=tempsrcdir)
+        result = runCmd('bitbake-layers remove-layer %s' % templayerdir, cwd=self.builddir)
+        result = runCmd('devtool update-recipe -m srcrev %s -a %s' % (testrecipe, templayerdir))
+        self.assertIn('WARNING: Specified layer is not currently enabled in bblayers.conf', result.output)
+        self.assertFalse(os.path.exists(os.path.join(appenddir, testrecipe)), 'Patch directory should not be created')
+        result = runCmd('git rev-parse HEAD', cwd=tempsrcdir)
+        expectedlines = ['SRCREV = "%s"\n' % result.output,
+                         '\n',
+                         'SRC_URI = "%s"\n' % git_uri,
+                         '\n']
+        with open(bbappendfile, 'r') as f:
+            self.assertEqual(expectedlines, f.readlines())
+        # Deleting isn't expected to work under these circumstances
+
+    @testcase(1163)
+    def test_devtool_extract(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        # Try devtool extract
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        result = runCmd('devtool extract remake %s' % tempdir)
+        self.assertTrue(os.path.exists(os.path.join(tempdir, 'Makefile.am')), 'Extracted source could not be found')
+        self.assertTrue(os.path.isdir(os.path.join(tempdir, '.git')), 'git repository for external source tree not found')
+
+    @testcase(1168)
+    def test_devtool_reset_all(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        testrecipe1 = 'mdadm'
+        testrecipe2 = 'cronie'
+        result = runCmd('devtool modify -x %s %s' % (testrecipe1, os.path.join(tempdir, testrecipe1)))
+        result = runCmd('devtool modify -x %s %s' % (testrecipe2, os.path.join(tempdir, testrecipe2)))
+        result = runCmd('devtool build %s' % testrecipe1)
+        result = runCmd('devtool build %s' % testrecipe2)
+        stampprefix1 = get_bb_var('STAMP', testrecipe1)
+        self.assertTrue(stampprefix1, 'Unable to get STAMP value for recipe %s' % testrecipe1)
+        stampprefix2 = get_bb_var('STAMP', testrecipe2)
+        self.assertTrue(stampprefix2, 'Unable to get STAMP value for recipe %s' % testrecipe2)
+        result = runCmd('devtool reset -a')
+        self.assertIn(testrecipe1, result.output)
+        self.assertIn(testrecipe2, result.output)
+        result = runCmd('devtool status')
+        self.assertNotIn(testrecipe1, result.output)
+        self.assertNotIn(testrecipe2, result.output)
+        matches1 = glob.glob(stampprefix1 + '*')
+        self.assertFalse(matches1, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe1)
+        matches2 = glob.glob(stampprefix2 + '*')
+        self.assertFalse(matches2, 'Stamp files exist for recipe %s that should have been cleaned' % testrecipe2)
+
+    def test_devtool_deploy_target(self):
+        # NOTE: Whilst this test would seemingly be better placed as a runtime test,
+        # unfortunately the runtime tests run under bitbake and you can't run
+        # devtool within bitbake (since devtool needs to run bitbake itself).
+        # Additionally we are testing build-time functionality as well, so
+        # really this has to be done as an oe-selftest test.
+        #
+        # Check preconditions
+        machine = get_bb_var('MACHINE')
+        if not machine.startswith('qemu'):
+            self.skipTest('This test only works with qemu machines')
+        if not os.path.exists('/etc/runqemu-nosudo'):
+            self.skipTest('You must set up tap devices with scripts/runqemu-gen-tapdevs before running this test')
+        result = runCmd('PATH="$PATH:/sbin:/usr/sbin" ip tuntap show', ignore_status=True)
+        if result.status != 0:
+            result = runCmd('PATH="$PATH:/sbin:/usr/sbin" ifconfig -a', ignore_status=True)
+            if result.status != 0:
+                self.skipTest('Failed to determine if tap devices exist with ifconfig or ip: %s' % result.output)
+        for line in result.output.splitlines():
+            if line.startswith('tap'):
+                break
+        else:
+            self.skipTest('No tap devices found - you must set up tap devices with scripts/runqemu-gen-tapdevs before running this test')
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        # Definitions
+        testrecipe = 'mdadm'
+        testfile = '/sbin/mdadm'
+        testimage = 'oe-selftest-image'
+        testcommand = '/sbin/mdadm --help'
+        # Build an image to run
+        bitbake("%s qemu-native qemu-helper-native" % testimage)
+        deploy_dir_image = get_bb_var('DEPLOY_DIR_IMAGE')
+        self.add_command_to_tearDown('bitbake -c clean %s' % testimage)
+        self.add_command_to_tearDown('rm -f %s/%s*' % (deploy_dir_image, testimage))
+        # Clean recipe so the first deploy will fail
+        bitbake("%s -c clean" % testrecipe)
+        # Try devtool modify
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        self.add_command_to_tearDown('bitbake -c clean %s' % testrecipe)
+        result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
+        # Test that deploy-target at this point fails (properly)
+        result = runCmd('devtool deploy-target -n %s root@localhost' % testrecipe, ignore_status=True)
+        self.assertNotEqual(result.output, 0, 'devtool deploy-target should have failed, output: %s' % result.output)
+        self.assertNotIn(result.output, 'Traceback', 'devtool deploy-target should have failed with a proper error not a traceback, output: %s' % result.output)
+        result = runCmd('devtool build %s' % testrecipe)
+        # First try a dry-run of deploy-target
+        result = runCmd('devtool deploy-target -n %s root@localhost' % testrecipe)
+        self.assertIn('  %s' % testfile, result.output)
+        # Boot the image
+        with runqemu(testimage, self) as qemu:
+            # Now really test deploy-target
+            result = runCmd('devtool deploy-target -c %s root@%s' % (testrecipe, qemu.ip))
+            # Run a test command to see if it was installed properly
+            sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
+            result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand))
+            # Check if it deployed all of the files with the right ownership/perms
+            # First look on the host - need to do this under pseudo to get the correct ownership/perms
+            installdir = get_bb_var('D', testrecipe)
+            fakerootenv = get_bb_var('FAKEROOTENV', testrecipe)
+            fakerootcmd = get_bb_var('FAKEROOTCMD', testrecipe)
+            result = runCmd('%s %s find . -type f -exec ls -l {} \;' % (fakerootenv, fakerootcmd), cwd=installdir)
+            filelist1 = self._process_ls_output(result.output)
+
+            # Now look on the target
+            tempdir2 = tempfile.mkdtemp(prefix='devtoolqa')
+            self.track_for_cleanup(tempdir2)
+            tmpfilelist = os.path.join(tempdir2, 'files.txt')
+            with open(tmpfilelist, 'w') as f:
+                for line in filelist1:
+                    splitline = line.split()
+                    f.write(splitline[-1] + '\n')
+            result = runCmd('cat %s | ssh -q %s root@%s \'xargs ls -l\'' % (tmpfilelist, sshargs, qemu.ip))
+            filelist2 = self._process_ls_output(result.output)
+            filelist1.sort(key=lambda item: item.split()[-1])
+            filelist2.sort(key=lambda item: item.split()[-1])
+            self.assertEqual(filelist1, filelist2)
+            # Test undeploy-target
+            result = runCmd('devtool undeploy-target -c %s root@%s' % (testrecipe, qemu.ip))
+            result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand), ignore_status=True)
+            self.assertNotEqual(result, 0, 'undeploy-target did not remove command as it should have')
+
+    def test_devtool_build_image(self):
+        """Test devtool build-image plugin"""
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        image = 'core-image-minimal'
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
+        self.add_command_to_tearDown('bitbake -c clean %s' % image)
+        bitbake('%s -c clean' % image)
+        # Add target and native recipes to workspace
+        for recipe in ('mdadm', 'parted-native'):
+            tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+            self.track_for_cleanup(tempdir)
+            self.add_command_to_tearDown('bitbake -c clean %s' % recipe)
+            runCmd('devtool modify %s -x %s' % (recipe, tempdir))
+        # Try to build image
+        result = runCmd('devtool build-image %s' % image)
+        self.assertNotEqual(result, 0, 'devtool build-image failed')
+        # Check if image.bbappend has required content
+        bbappend = os.path.join(workspacedir, 'appends', image+'.bbappend')
+        self.assertTrue(os.path.isfile(bbappend), 'bbappend not created %s' % result.output)
+        # NOTE: native recipe parted-native should not be in IMAGE_INSTALL_append
+        self.assertTrue('IMAGE_INSTALL_append = " mdadm"\n' in open(bbappend).readlines(),
+                        'IMAGE_INSTALL_append = " mdadm" not found in %s' % bbappend)
+
+    def test_devtool_upgrade(self):
+        # Check preconditions
+        workspacedir = os.path.join(self.builddir, 'workspace')
+        self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory')
+        # Check parameters
+        result = runCmd('devtool upgrade -h')
+        for param in 'recipename srctree --version -V --branch -b --keep-temp --no-patch'.split():
+            self.assertIn(param, result.output)
+        # For the moment, we are using a real recipe.
+        recipe='devtool-upgrade'
+        version='0.2'
+        tempdir = tempfile.mkdtemp(prefix='devtoolqa')
+        # Check that recipe is not already under devtool control
+        result = runCmd('devtool status')
+        self.assertNotIn(recipe, result.output)
+        # Check upgrade. Code does not check if new PV is older or newer that current PV, so, it may be that
+        # we are downgrading instead of upgrading.
+        result = runCmd('devtool upgrade %s %s -V %s' % (recipe, tempdir, version))
+        # Check if srctree at least is populated
+        self.assertTrue(len(os.listdir(tempdir)) > 0, 'scrtree (%s) should be populated with new (%s) source code' % (tempdir, version))
+        # Check new recipe folder is present
+        self.assertTrue(os.path.exists(os.path.join(workspacedir,'recipes',recipe)), 'Recipe folder should exist')
+        # Check new recipe file is present
+        self.assertTrue(os.path.exists(os.path.join(workspacedir,'recipes',recipe,"%s_%s.bb" % (recipe,version))), 'Recipe folder should exist')
+        # Check devtool status and make sure recipe is present
+        result = runCmd('devtool status')
+        self.assertIn(recipe, result.output)
+        self.assertIn(tempdir, result.output)
+        # Check devtool reset recipe
+        result = runCmd('devtool reset %s -n' % recipe)
+        result = runCmd('devtool status')
+        self.assertNotIn(recipe, result.output)
+        self.track_for_cleanup(tempdir)
+        self.track_for_cleanup(workspacedir)
+        self.add_command_to_tearDown('bitbake-layers remove-layer */workspace')
diff --git a/meta/lib/oeqa/selftest/imagefeatures.py b/meta/lib/oeqa/selftest/imagefeatures.py
new file mode 100644
index 0000000..fcffc42
--- /dev/null
+++ b/meta/lib/oeqa/selftest/imagefeatures.py
@@ -0,0 +1,168 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, runqemu
+from oeqa.utils.decorators import testcase
+from oeqa.utils.sshcontrol import SSHControl
+import os
+import sys
+import logging
+
+class ImageFeatures(oeSelfTest):
+
+    test_user = 'tester'
+    root_user = 'root'
+
+    @testcase(1107)
+    def test_non_root_user_can_connect_via_ssh_without_password(self):
+        """
+        Summary: Check if non root user can connect via ssh without password
+        Expected: 1. Connection to the image via ssh using root user without providing a password should be allowed.
+                  2. Connection to the image via ssh using tester user without providing a password should be allowed.
+        Product: oe-core
+        Author: Ionut Chisanovici <ionutx.chisanovici@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+
+        features = 'EXTRA_IMAGE_FEATURES = "ssh-server-openssh empty-root-password allow-empty-password"\n'
+        features += 'INHERIT += "extrausers"\n'
+        features += 'EXTRA_USERS_PARAMS = "useradd -p \'\' {}; usermod -s /bin/sh {};"'.format(self.test_user, self.test_user)
+
+        # Append 'features' to local.conf
+        self.append_config(features)
+
+        # Build a core-image-minimal
+        bitbake('core-image-minimal')
+
+        with runqemu("core-image-minimal", self) as qemu:
+            # Attempt to ssh with each user into qemu with empty password
+            for user in [self.root_user, self.test_user]:
+                ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user=user)
+                status, output = ssh.run("true")
+                self.assertEqual(status, 0, 'ssh to user %s failed with %s' % (user, output))
+
+    @testcase(1115)
+    def test_all_users_can_connect_via_ssh_without_password(self):
+        """
+        Summary:     Check if all users can connect via ssh without password
+        Expected: 1. Connection to the image via ssh using root user without providing a password should NOT be allowed.
+                  2. Connection to the image via ssh using tester user without providing a password should be allowed.
+        Product:     oe-core
+        Author:      Ionut Chisanovici <ionutx.chisanovici@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+
+        features = 'EXTRA_IMAGE_FEATURES = "ssh-server-openssh allow-empty-password"\n'
+        features += 'INHERIT += "extrausers"\n'
+        features += 'EXTRA_USERS_PARAMS = "useradd -p \'\' {}; usermod -s /bin/sh {};"'.format(self.test_user, self.test_user)
+
+        # Append 'features' to local.conf
+        self.append_config(features)
+
+        # Build a core-image-minimal
+        bitbake('core-image-minimal')
+
+        with runqemu("core-image-minimal", self) as qemu:
+            # Attempt to ssh with each user into qemu with empty password
+            for user in [self.root_user, self.test_user]:
+                ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user=user)
+                status, output = ssh.run("true")
+                if user == 'root':
+                    self.assertNotEqual(status, 0, 'ssh to user root was allowed when it should not have been')
+                else:
+                    self.assertEqual(status, 0, 'ssh to user tester failed with %s' % output)
+
+
+    @testcase(1114)
+    def test_rpm_version_4_support_on_image(self):
+        """
+        Summary:     Check rpm version 4 support on image
+        Expected:    Rpm version must be 4.x
+        Product:     oe-core
+        Author:      Ionut Chisanovici <ionutx.chisanovici@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+
+        features = 'PREFERRED_VERSION_rpm = "4.%"\n'
+        features += 'PREFERRED_VERSION_rpm-native = "4.%"\n'
+        # Use openssh in IMAGE_INSTALL instead of ssh-server-openssh in EXTRA_IMAGE_FEATURES as a workaround for bug 8047
+        features += 'IMAGE_INSTALL_append = " openssh"\n'
+        features += 'EXTRA_IMAGE_FEATURES = "empty-root-password allow-empty-password package-management"\n'
+        features += 'RPMROOTFSDEPENDS_remove = "rpmresolve-native:do_populate_sysroot"'
+
+        # Append 'features' to local.conf
+        self.append_config(features)
+
+        # Build a core-image-minimal
+        bitbake('core-image-minimal')
+
+        # Check the native version of rpm is correct
+        native_bindir = get_bb_var('STAGING_BINDIR_NATIVE')
+        result = runCmd(os.path.join(native_bindir, 'rpm') + ' --version')
+        self.assertIn('version 4.', result.output)
+
+        # Check manifest for the rpm package
+        deploydir = get_bb_var('DEPLOY_DIR_IMAGE')
+        imgname = get_bb_var('IMAGE_LINK_NAME', 'core-image-minimal')
+        with open(os.path.join(deploydir, imgname) + '.manifest', 'r') as f:
+            for line in f:
+                splitline = line.split()
+                if len(splitline) > 2:
+                    rpm_version = splitline[2]
+                    if splitline[0] == 'rpm':
+                        if not rpm_version.startswith('4.'):
+                            self.fail('rpm version %s found in image, expected 4.x' % rpm_version)
+                        break
+            else:
+                self.fail('No rpm package found in image')
+
+        # Now do a couple of runtime tests
+        with runqemu("core-image-minimal", self) as qemu:
+            command = "rpm --version"
+            status, output = qemu.run(command)
+            self.assertEqual(0, status, 'Failed to run command "%s": %s' % (command, output))
+            found_rpm_version = output.strip()
+
+            # Make sure the retrieved rpm version is the expected one
+            if rpm_version not in found_rpm_version:
+                self.fail('RPM version is not {}, found instead {}.'.format(rpm_version, found_rpm_version))
+
+            # Test that the rpm database is there and working
+            command = "rpm -qa"
+            status, output = qemu.run(command)
+            self.assertEqual(0, status, 'Failed to run command "%s": %s' % (command, output))
+            self.assertIn('packagegroup-core-boot', output)
+            self.assertIn('busybox', output)
+
+
+    @testcase(1116)
+    def test_clutter_image_can_be_built(self):
+        """
+        Summary:     Check if clutter image can be built
+        Expected:    1. core-image-clutter can be built
+        Product:     oe-core
+        Author:      Ionut Chisanovici <ionutx.chisanovici@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+
+        # Build a core-image-clutter
+        bitbake('core-image-clutter')
+
+    @testcase(1117)
+    def test_wayland_support_in_image(self):
+        """
+        Summary:     Check Wayland support in image
+        Expected:    1. Wayland image can be build
+                     2. Wayland feature can be installed
+        Product:     oe-core
+        Author:      Ionut Chisanovici <ionutx.chisanovici@intel.com>
+        AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
+        """
+
+        features = 'DISTRO_FEATURES_append = " wayland"\n'
+        features += 'CORE_IMAGE_EXTRA_INSTALL += "wayland weston"'
+
+        # Append 'features' to local.conf
+        self.append_config(features)
+
+        # Build a core-image-weston
+        bitbake('core-image-weston')
+
diff --git a/meta/lib/oeqa/selftest/layerappend.py b/meta/lib/oeqa/selftest/layerappend.py
new file mode 100644
index 0000000..a82a6c8
--- /dev/null
+++ b/meta/lib/oeqa/selftest/layerappend.py
@@ -0,0 +1,96 @@
+import unittest
+import os
+import logging
+import re
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.selftest.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+import oeqa.utils.ftools as ftools
+from oeqa.utils.decorators import testcase
+
+class LayerAppendTests(oeSelfTest):
+    layerconf = """
+# We have a conf and classes directory, append to BBPATH
+BBPATH .= ":${LAYERDIR}"
+
+# We have a recipes directory, add to BBFILES
+BBFILES += "${LAYERDIR}/recipes*/*.bb ${LAYERDIR}/recipes*/*.bbappend"
+
+BBFILE_COLLECTIONS += "meta-layerINT"
+BBFILE_PATTERN_meta-layerINT := "^${LAYERDIR}/"
+BBFILE_PRIORITY_meta-layerINT = "6"
+"""
+    recipe = """
+LICENSE="CLOSED"
+INHIBIT_DEFAULT_DEPS = "1"
+
+python do_build() {
+    bb.plain('Building ...')
+}
+addtask build
+"""
+    append = """
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append = " file://appendtest.txt"
+
+sysroot_stage_all_append() {
+	install -m 644 ${WORKDIR}/appendtest.txt ${SYSROOT_DESTDIR}/
+}
+
+"""
+
+    append2 = """
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+SRC_URI_append += "file://appendtest.txt"
+"""
+    layerappend = "BBLAYERS += \"COREBASE/meta-layertest0 COREBASE/meta-layertest1 COREBASE/meta-layertest2\""
+
+    def tearDownLocal(self):
+        ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend.replace("COREBASE", self.builddir + "/.."))
+
+    @testcase(1196)
+    def test_layer_appends(self):
+        corebase = get_bb_var("COREBASE")
+        stagingdir = get_bb_var("STAGING_DIR_TARGET")
+        for l in ["0", "1", "2"]:
+            layer = os.path.join(corebase, "meta-layertest" + l)
+            self.assertFalse(os.path.exists(layer))
+            os.mkdir(layer)
+            os.mkdir(layer + "/conf")
+            with open(layer + "/conf/layer.conf", "w") as f:
+                f.write(self.layerconf.replace("INT", l))
+            os.mkdir(layer + "/recipes-test")
+            if l == "0":
+                with open(layer + "/recipes-test/layerappendtest.bb", "w") as f:
+                    f.write(self.recipe)
+            elif l == "1":
+                with open(layer + "/recipes-test/layerappendtest.bbappend", "w") as f:
+                    f.write(self.append)
+                os.mkdir(layer + "/recipes-test/layerappendtest")
+                with open(layer + "/recipes-test/layerappendtest/appendtest.txt", "w") as f:
+                    f.write("Layer 1 test")
+            elif l == "2":
+                with open(layer + "/recipes-test/layerappendtest.bbappend", "w") as f:
+                    f.write(self.append2)
+                os.mkdir(layer + "/recipes-test/layerappendtest")
+                with open(layer + "/recipes-test/layerappendtest/appendtest.txt", "w") as f:
+                    f.write("Layer 2 test")
+            self.track_for_cleanup(layer)
+        ftools.append_file(self.builddir + "/conf/bblayers.conf", self.layerappend.replace("COREBASE", self.builddir + "/.."))
+        bitbake("layerappendtest")
+        data = ftools.read_file(stagingdir + "/appendtest.txt")
+        self.assertEqual(data, "Layer 2 test")
+        os.remove(corebase + "/meta-layertest2/recipes-test/layerappendtest/appendtest.txt")
+        bitbake("layerappendtest")
+        data = ftools.read_file(stagingdir + "/appendtest.txt")
+        self.assertEqual(data, "Layer 1 test")
+        with open(corebase + "/meta-layertest2/recipes-test/layerappendtest/appendtest.txt", "w") as f:
+            f.write("Layer 2 test")
+        bitbake("layerappendtest")
+        data = ftools.read_file(stagingdir + "/appendtest.txt")
+        self.assertEqual(data, "Layer 2 test")
+
+
diff --git a/meta/lib/oeqa/selftest/lic-checksum.py b/meta/lib/oeqa/selftest/lic-checksum.py
new file mode 100644
index 0000000..bd3b9a1
--- /dev/null
+++ b/meta/lib/oeqa/selftest/lic-checksum.py
@@ -0,0 +1,31 @@
+import os
+import tempfile
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import bitbake
+from oeqa.utils import CommandError
+from oeqa.utils.decorators import testcase
+
+class LicenseTests(oeSelfTest):
+
+    # Verify that changing a license file that has an absolute path causes
+    # the license qa to fail due to a mismatched md5sum.
+    @testcase(1197)
+    def test_nonmatching_checksum(self):
+        bitbake_cmd = '-c configure emptytest'
+        error_msg = 'ERROR: emptytest: The new md5 checksum is 8d777f385d3dfec8815d20f7496026dc'
+
+        lic_file, lic_path = tempfile.mkstemp()
+        os.close(lic_file)
+        self.track_for_cleanup(lic_path)
+
+        self.write_recipeinc('emptytest', 'INHIBIT_DEFAULT_DEPS = "1"')
+        self.append_recipeinc('emptytest', 'LIC_FILES_CHKSUM = "file://%s;md5=d41d8cd98f00b204e9800998ecf8427e"' % lic_path)
+        result = bitbake(bitbake_cmd)
+
+        with open(lic_path, "w") as f:
+            f.write("data")
+
+        result = bitbake(bitbake_cmd, ignore_status=True)
+        if error_msg not in result.output:
+            raise AssertionError(result.output)
diff --git a/meta/lib/oeqa/selftest/oescripts.py b/meta/lib/oeqa/selftest/oescripts.py
new file mode 100644
index 0000000..31cd508
--- /dev/null
+++ b/meta/lib/oeqa/selftest/oescripts.py
@@ -0,0 +1,54 @@
+import datetime
+import unittest
+import os
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.selftest.buildhistory import BuildhistoryBase
+from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.utils.decorators import testcase
+
+class TestScripts(oeSelfTest):
+
+    @testcase(300)
+    def test_cleanup_workdir(self):
+        path = os.path.dirname(get_bb_var('WORKDIR', 'gzip'))
+        old_version_recipe = os.path.join(get_bb_var('COREBASE'), 'meta/recipes-extended/gzip/gzip_1.3.12.bb')
+        old_version = '1.3.12'
+        bitbake("-ccleansstate gzip")
+        bitbake("-ccleansstate -b %s" % old_version_recipe)
+        if os.path.exists(get_bb_var('WORKDIR', "-b %s" % old_version_recipe)):
+            shutil.rmtree(get_bb_var('WORKDIR', "-b %s" % old_version_recipe))
+        if os.path.exists(get_bb_var('WORKDIR', 'gzip')):
+            shutil.rmtree(get_bb_var('WORKDIR', 'gzip'))
+
+        if os.path.exists(path):
+            initial_contents = os.listdir(path)
+        else:
+            initial_contents = []
+
+        bitbake('gzip')
+        intermediary_contents = os.listdir(path)
+        bitbake("-b %s" % old_version_recipe)
+        runCmd('cleanup-workdir')
+        remaining_contents = os.listdir(path)
+
+        expected_contents = [x for x in intermediary_contents if x not in initial_contents]
+        remaining_not_expected = [x for x in remaining_contents if x not in expected_contents]
+        self.assertFalse(remaining_not_expected, msg="Not all necessary content has been deleted from %s: %s" % (path, ', '.join(map(str, remaining_not_expected))))
+        expected_not_remaining = [x for x in expected_contents if x not in remaining_contents]
+        self.assertFalse(expected_not_remaining, msg="The script removed extra contents from %s: %s" % (path, ', '.join(map(str, expected_not_remaining))))
+
+class BuildhistoryDiffTests(BuildhistoryBase):
+
+    @testcase(295)
+    def test_buildhistory_diff(self):
+        self.add_command_to_tearDown('cleanup-workdir')
+        target = 'xcursor-transparent-theme'
+        self.run_buildhistory_operation(target, target_config="PR = \"r1\"", change_bh_location=True)
+        self.run_buildhistory_operation(target, target_config="PR = \"r0\"", change_bh_location=False, expect_error=True)
+        result = runCmd("buildhistory-diff -p %s" % get_bb_var('BUILDHISTORY_DIR'))
+        expected_output = 'PR changed from "r1" to "r0"'
+        self.assertTrue(expected_output in result.output, msg="Did not find expected output: %s" % result.output)
diff --git a/meta/lib/oeqa/selftest/pkgdata.py b/meta/lib/oeqa/selftest/pkgdata.py
new file mode 100644
index 0000000..138b03a
--- /dev/null
+++ b/meta/lib/oeqa/selftest/pkgdata.py
@@ -0,0 +1,226 @@
+import unittest
+import os
+import tempfile
+import logging
+import fnmatch
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class OePkgdataUtilTests(oeSelfTest):
+
+    @classmethod
+    def setUpClass(cls):
+        # Ensure we have the right data in pkgdata
+        logger = logging.getLogger("selftest")
+        logger.info('Running bitbake to generate pkgdata')
+        bitbake('glibc busybox zlib bash')
+
+    @testcase(1203)
+    def test_lookup_pkg(self):
+        # Forward tests
+        result = runCmd('oe-pkgdata-util lookup-pkg "glibc busybox"')
+        self.assertEqual(result.output, 'libc6\nbusybox')
+        result = runCmd('oe-pkgdata-util lookup-pkg zlib-dev')
+        self.assertEqual(result.output, 'libz-dev')
+        result = runCmd('oe-pkgdata-util lookup-pkg nonexistentpkg', ignore_status=True)
+        self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
+        self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
+        # Reverse tests
+        result = runCmd('oe-pkgdata-util lookup-pkg -r "libc6 busybox"')
+        self.assertEqual(result.output, 'glibc\nbusybox')
+        result = runCmd('oe-pkgdata-util lookup-pkg -r libz-dev')
+        self.assertEqual(result.output, 'zlib-dev')
+        result = runCmd('oe-pkgdata-util lookup-pkg -r nonexistentpkg', ignore_status=True)
+        self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
+        self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
+
+    @testcase(1205)
+    def test_read_value(self):
+        result = runCmd('oe-pkgdata-util read-value PN libz1')
+        self.assertEqual(result.output, 'zlib')
+        result = runCmd('oe-pkgdata-util read-value PKGSIZE bash')
+        pkgsize = int(result.output.strip())
+        self.assertGreater(pkgsize, 1, "Size should be greater than 1. %s" % result.output)
+
+    @testcase(1198)
+    def test_find_path(self):
+        result = runCmd('oe-pkgdata-util find-path /lib/libc.so.6')
+        self.assertEqual(result.output, 'glibc: /lib/libc.so.6')
+        result = runCmd('oe-pkgdata-util find-path /bin/bash')
+        self.assertEqual(result.output, 'bash: /bin/bash')
+        result = runCmd('oe-pkgdata-util find-path /not/exist', ignore_status=True)
+        self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
+        self.assertEqual(result.output, 'ERROR: Unable to find any package producing path /not/exist')
+
+    @testcase(1204)
+    def test_lookup_recipe(self):
+        result = runCmd('oe-pkgdata-util lookup-recipe "libc6-staticdev busybox"')
+        self.assertEqual(result.output, 'glibc\nbusybox')
+        result = runCmd('oe-pkgdata-util lookup-recipe libz-dbg')
+        self.assertEqual(result.output, 'zlib')
+        result = runCmd('oe-pkgdata-util lookup-recipe nonexistentpkg', ignore_status=True)
+        self.assertEqual(result.status, 1, "Status different than 1. output: %s" % result.output)
+        self.assertEqual(result.output, 'ERROR: The following packages could not be found: nonexistentpkg')
+
+    @testcase(1202)
+    def test_list_pkgs(self):
+        # No arguments
+        result = runCmd('oe-pkgdata-util list-pkgs')
+        pkglist = result.output.split()
+        self.assertIn('glibc-utils', pkglist, "Listed packages: %s" % result.output)
+        self.assertIn('zlib-dev', pkglist, "Listed packages: %s" % result.output)
+        # No pkgspec, runtime
+        result = runCmd('oe-pkgdata-util list-pkgs -r')
+        pkglist = result.output.split()
+        self.assertIn('libc6-utils', pkglist, "Listed packages: %s" % result.output)
+        self.assertIn('libz-dev', pkglist, "Listed packages: %s" % result.output)
+        # With recipe specified
+        result = runCmd('oe-pkgdata-util list-pkgs -p zlib')
+        pkglist = sorted(result.output.split())
+        try:
+            pkglist.remove('zlib-ptest') # in case ptest is disabled
+        except ValueError:
+            pass
+        self.assertEqual(pkglist, ['zlib', 'zlib-dbg', 'zlib-dev', 'zlib-doc', 'zlib-staticdev'], "Packages listed after remove: %s" % result.output)
+        # With recipe specified, runtime
+        result = runCmd('oe-pkgdata-util list-pkgs -p zlib -r')
+        pkglist = sorted(result.output.split())
+        try:
+            pkglist.remove('libz-ptest') # in case ptest is disabled
+        except ValueError:
+            pass
+        self.assertEqual(pkglist, ['libz-dbg', 'libz-dev', 'libz-doc', 'libz-staticdev', 'libz1'], "Packages listed after remove: %s" % result.output)
+        # With recipe specified and unpackaged
+        result = runCmd('oe-pkgdata-util list-pkgs -p zlib -u')
+        pkglist = sorted(result.output.split())
+        self.assertIn('zlib-locale', pkglist, "Listed packages: %s" % result.output)
+        # With recipe specified and unpackaged, runtime
+        result = runCmd('oe-pkgdata-util list-pkgs -p zlib -u -r')
+        pkglist = sorted(result.output.split())
+        self.assertIn('libz-locale', pkglist, "Listed packages: %s" % result.output)
+        # With recipe specified and pkgspec
+        result = runCmd('oe-pkgdata-util list-pkgs -p zlib "*-d*"')
+        pkglist = sorted(result.output.split())
+        self.assertEqual(pkglist, ['zlib-dbg', 'zlib-dev', 'zlib-doc'], "Packages listed: %s" % result.output)
+        # With recipe specified and pkgspec, runtime
+        result = runCmd('oe-pkgdata-util list-pkgs -p zlib -r "*-d*"')
+        pkglist = sorted(result.output.split())
+        self.assertEqual(pkglist, ['libz-dbg', 'libz-dev', 'libz-doc'], "Packages listed: %s" % result.output)
+
+    @testcase(1201)
+    def test_list_pkg_files(self):
+        def splitoutput(output):
+            files = {}
+            curpkg = None
+            for line in output.splitlines():
+                if line.startswith('\t'):
+                    self.assertTrue(curpkg, 'Unexpected non-package line:\n%s' % line)
+                    files[curpkg].append(line.strip())
+                else:
+                    self.assertTrue(line.rstrip().endswith(':'), 'Invalid package line in output:\n%s' % line)
+                    curpkg = line.split(':')[0]
+                    files[curpkg] = []
+            return files
+        base_libdir = get_bb_var('base_libdir')
+        libdir = get_bb_var('libdir')
+        includedir = get_bb_var('includedir')
+        mandir = get_bb_var('mandir')
+        # Test recipe-space package name
+        result = runCmd('oe-pkgdata-util list-pkg-files zlib-dev zlib-doc')
+        files = splitoutput(result.output)
+        self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev'])
+        self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc'])
+        # Test runtime package name
+        result = runCmd('oe-pkgdata-util list-pkg-files -r libz1 libz-dev')
+        files = splitoutput(result.output)
+        self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertGreater(len(files['libz1']), 1)
+        libspec = os.path.join(base_libdir, 'libz.so.1.*')
+        found = False
+        for fileitem in files['libz1']:
+            if fnmatch.fnmatchcase(fileitem, libspec):
+                found = True
+                break
+        self.assertTrue(found, 'Could not find zlib library file %s in libz1 package file list: %s' % (libspec, files['libz1']))
+        self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev'])
+        # Test recipe
+        result = runCmd('oe-pkgdata-util list-pkg-files -p zlib')
+        files = splitoutput(result.output)
+        self.assertIn('zlib-dbg', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('zlib-staticdev', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('zlib', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertNotIn('zlib-locale', files.keys(), "listed pkgs. files: %s" %result.output)
+        # (ignore ptest, might not be there depending on config)
+        self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev'])
+        self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc'])
+        self.assertIn(os.path.join(libdir, 'libz.a'), files['zlib-staticdev'])
+        # Test recipe, runtime
+        result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -r')
+        files = splitoutput(result.output)
+        self.assertIn('libz-dbg', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('libz-doc', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('libz-staticdev', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertNotIn('libz-locale', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev'])
+        self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc'])
+        self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev'])
+        # Test recipe, unpackaged
+        result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -u')
+        files = splitoutput(result.output)
+        self.assertIn('zlib-dbg', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('zlib-doc', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('zlib-dev', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('zlib-staticdev', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('zlib', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('zlib-locale', files.keys(), "listed pkgs. files: %s" %result.output) # this is the key one
+        self.assertIn(os.path.join(includedir, 'zlib.h'), files['zlib-dev'])
+        self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['zlib-doc'])
+        self.assertIn(os.path.join(libdir, 'libz.a'), files['zlib-staticdev'])
+        # Test recipe, runtime, unpackaged
+        result = runCmd('oe-pkgdata-util list-pkg-files -p zlib -r -u')
+        files = splitoutput(result.output)
+        self.assertIn('libz-dbg', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('libz-doc', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('libz-dev', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('libz-staticdev', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('libz1', files.keys(), "listed pkgs. files: %s" %result.output)
+        self.assertIn('libz-locale', files.keys(), "listed pkgs. files: %s" %result.output) # this is the key one
+        self.assertIn(os.path.join(includedir, 'zlib.h'), files['libz-dev'])
+        self.assertIn(os.path.join(mandir, 'man3/zlib.3'), files['libz-doc'])
+        self.assertIn(os.path.join(libdir, 'libz.a'), files['libz-staticdev'])
+
+    @testcase(1200)
+    def test_glob(self):
+        tempdir = tempfile.mkdtemp(prefix='pkgdataqa')
+        self.track_for_cleanup(tempdir)
+        pkglistfile = os.path.join(tempdir, 'pkglist')
+        with open(pkglistfile, 'w') as f:
+            f.write('libc6\n')
+            f.write('libz1\n')
+            f.write('busybox\n')
+        result = runCmd('oe-pkgdata-util glob %s "*-dev"' % pkglistfile)
+        desiredresult = ['libc6-dev', 'libz-dev', 'busybox-dev']
+        self.assertEqual(sorted(result.output.split()), sorted(desiredresult))
+        # The following should not error (because when we use this during rootfs construction, sometimes the complementary package won't exist)
+        result = runCmd('oe-pkgdata-util glob %s "*-nonexistent"' % pkglistfile)
+        self.assertEqual(result.output, '')
+        # Test exclude option
+        result = runCmd('oe-pkgdata-util glob %s "*-dev *-dbg" -x "^libz"' % pkglistfile)
+        resultlist = result.output.split()
+        self.assertNotIn('libz-dev', resultlist)
+        self.assertNotIn('libz-dbg', resultlist)
+
+    @testcase(1206)
+    def test_specify_pkgdatadir(self):
+        result = runCmd('oe-pkgdata-util -p %s lookup-pkg glibc' % get_bb_var('PKGDATA_DIR'))
+        self.assertEqual(result.output, 'libc6')
diff --git a/meta/lib/oeqa/selftest/prservice.py b/meta/lib/oeqa/selftest/prservice.py
new file mode 100644
index 0000000..4187fbf
--- /dev/null
+++ b/meta/lib/oeqa/selftest/prservice.py
@@ -0,0 +1,121 @@
+import unittest
+import os
+import logging
+import re
+import shutil
+import datetime
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+from oeqa.utils.decorators import testcase
+
+class BitbakePrTests(oeSelfTest):
+
+    def get_pr_version(self, package_name):
+        pkgdata_dir = get_bb_var('PKGDATA_DIR')
+        package_data_file = os.path.join(pkgdata_dir, 'runtime', package_name)
+        package_data = ftools.read_file(package_data_file)
+        find_pr = re.search("PKGR: r[0-9]+\.([0-9]+)", package_data)
+        self.assertTrue(find_pr, "No PKG revision found in %s" % package_data_file)
+        return int(find_pr.group(1))
+
+    def get_task_stamp(self, package_name, recipe_task):
+        stampdata = get_bb_var('STAMP', target=package_name).split('/')
+        prefix = stampdata[-1]
+        package_stamps_path = "/".join(stampdata[:-1])
+        stamps = []
+        for stamp in os.listdir(package_stamps_path):
+            find_stamp = re.match("%s\.%s\.([a-z0-9]{32})" % (prefix, recipe_task), stamp)
+            if find_stamp:
+                stamps.append(find_stamp.group(1))
+        self.assertFalse(len(stamps) == 0, msg="Cound not find stamp for task %s for recipe %s" % (recipe_task, package_name))
+        self.assertFalse(len(stamps) > 1, msg="Found multiple %s stamps for the %s recipe in the %s directory." % (recipe_task, package_name, package_stamps_path))
+        return str(stamps[0])
+
+    def increment_package_pr(self, package_name):
+        inc_data = "do_package_append() {\nbb.build.exec_func('do_test_prserv', d)\n}\ndo_test_prserv() {\necho \"The current date is: %s\"\n}" % datetime.datetime.now()
+        self.write_recipeinc(package_name, inc_data)
+        bitbake("-ccleansstate %s" % package_name)
+        res = bitbake(package_name, ignore_status=True)
+        self.delete_recipeinc(package_name)
+        self.assertEqual(res.status, 0, msg=res.output)
+        self.assertTrue("NOTE: Started PRServer with DBfile" in res.output, msg=res.output)
+
+    def config_pr_tests(self, package_name, package_type='rpm', pr_socket='localhost:0'):
+        config_package_data = 'PACKAGE_CLASSES = "package_%s"' % package_type
+        self.write_config(config_package_data)
+        config_server_data = 'PRSERV_HOST = "%s"' % pr_socket
+        self.append_config(config_server_data)
+
+    def run_test_pr_service(self, package_name, package_type='rpm', track_task='do_package', pr_socket='localhost:0'):
+        self.config_pr_tests(package_name, package_type, pr_socket)
+
+        self.increment_package_pr(package_name)
+        pr_1 = self.get_pr_version(package_name)
+        stamp_1 = self.get_task_stamp(package_name, track_task)
+
+        self.increment_package_pr(package_name)
+        pr_2 = self.get_pr_version(package_name)
+        stamp_2 = self.get_task_stamp(package_name, track_task)
+
+        bitbake("-ccleansstate %s" % package_name)
+        self.assertTrue(pr_2 - pr_1 == 1, "Step between same pkg. revision is greater than 1")
+        self.assertTrue(stamp_1 != stamp_2, "Different pkg rev. but same stamp: %s" % stamp_1)
+
+    def run_test_pr_export_import(self, package_name, replace_current_db=True):
+        self.config_pr_tests(package_name)
+
+        self.increment_package_pr(package_name)
+        pr_1 = self.get_pr_version(package_name)
+
+        exported_db_path = os.path.join(self.builddir, 'export.inc')
+        export_result = runCmd("bitbake-prserv-tool export %s" % exported_db_path, ignore_status=True)
+        self.assertEqual(export_result.status, 0, msg="PR Service database export failed: %s" % export_result.output)
+
+        if replace_current_db:
+            current_db_path = os.path.join(get_bb_var('PERSISTENT_DIR'), 'prserv.sqlite3')
+            self.assertTrue(os.path.exists(current_db_path), msg="Path to current PR Service database is invalid: %s" % current_db_path)
+            os.remove(current_db_path)
+
+        import_result = runCmd("bitbake-prserv-tool import %s" % exported_db_path, ignore_status=True)
+        os.remove(exported_db_path)
+        self.assertEqual(import_result.status, 0, msg="PR Service database import failed: %s" % import_result.output)
+
+        self.increment_package_pr(package_name)
+        pr_2 = self.get_pr_version(package_name)
+
+        bitbake("-ccleansstate %s" % package_name)
+        self.assertTrue(pr_2 - pr_1 == 1, "Step between same pkg. revision is greater than 1")
+
+    @testcase(930)
+    def test_import_export_replace_db(self):
+        self.run_test_pr_export_import('m4')
+
+    @testcase(931)
+    def test_import_export_override_db(self):
+        self.run_test_pr_export_import('m4', replace_current_db=False)
+
+    @testcase(932)
+    def test_pr_service_rpm_arch_dep(self):
+        self.run_test_pr_service('m4', 'rpm', 'do_package')
+
+    @testcase(934)
+    def test_pr_service_deb_arch_dep(self):
+        self.run_test_pr_service('m4', 'deb', 'do_package')
+
+    @testcase(933)
+    def test_pr_service_ipk_arch_dep(self):
+        self.run_test_pr_service('m4', 'ipk', 'do_package')
+
+    @testcase(935)
+    def test_pr_service_rpm_arch_indep(self):
+        self.run_test_pr_service('xcursor-transparent-theme', 'rpm', 'do_package')
+
+    @testcase(937)
+    def test_pr_service_deb_arch_indep(self):
+        self.run_test_pr_service('xcursor-transparent-theme', 'deb', 'do_package')
+
+    @testcase(936)
+    def test_pr_service_ipk_arch_indep(self):
+        self.run_test_pr_service('xcursor-transparent-theme', 'ipk', 'do_package')
diff --git a/meta/lib/oeqa/selftest/recipetool.py b/meta/lib/oeqa/selftest/recipetool.py
new file mode 100644
index 0000000..c34ad68
--- /dev/null
+++ b/meta/lib/oeqa/selftest/recipetool.py
@@ -0,0 +1,554 @@
+import os
+import logging
+import tempfile
+import urlparse
+
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, create_temp_layer
+from oeqa.utils.decorators import testcase
+from oeqa.selftest import devtool
+
+
+templayerdir = None
+
+
+def setUpModule():
+    global templayerdir
+    templayerdir = tempfile.mkdtemp(prefix='recipetoolqa')
+    create_temp_layer(templayerdir, 'selftestrecipetool')
+    runCmd('bitbake-layers add-layer %s' % templayerdir)
+
+
+def tearDownModule():
+    runCmd('bitbake-layers remove-layer %s' % templayerdir, ignore_status=True)
+    runCmd('rm -rf %s' % templayerdir)
+
+
+class RecipetoolBase(devtool.DevtoolBase):
+    def setUpLocal(self):
+        self.templayerdir = templayerdir
+        self.tempdir = tempfile.mkdtemp(prefix='recipetoolqa')
+        self.track_for_cleanup(self.tempdir)
+        self.testfile = os.path.join(self.tempdir, 'testfile')
+        with open(self.testfile, 'w') as f:
+            f.write('Test file\n')
+
+    def tearDownLocal(self):
+        runCmd('rm -rf %s/recipes-*' % self.templayerdir)
+
+    def _try_recipetool_appendcmd(self, cmd, testrecipe, expectedfiles, expectedlines=None):
+        result = runCmd(cmd)
+        self.assertNotIn('Traceback', result.output)
+
+        # Check the bbappend was created and applies properly
+        recipefile = get_bb_var('FILE', testrecipe)
+        bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir)
+
+        # Check the bbappend contents
+        if expectedlines is not None:
+            with open(bbappendfile, 'r') as f:
+                self.assertEqual(expectedlines, f.readlines(), "Expected lines are not present in %s" % bbappendfile)
+
+        # Check file was copied
+        filesdir = os.path.join(os.path.dirname(bbappendfile), testrecipe)
+        for expectedfile in expectedfiles:
+            self.assertTrue(os.path.isfile(os.path.join(filesdir, expectedfile)), 'Expected file %s to be copied next to bbappend, but it wasn\'t' % expectedfile)
+
+        # Check no other files created
+        createdfiles = []
+        for root, _, files in os.walk(filesdir):
+            for f in files:
+                createdfiles.append(os.path.relpath(os.path.join(root, f), filesdir))
+        self.assertTrue(sorted(createdfiles), sorted(expectedfiles))
+
+        return bbappendfile, result.output
+
+
+class RecipetoolTests(RecipetoolBase):
+    @classmethod
+    def setUpClass(cls):
+        # Ensure we have the right data in shlibs/pkgdata
+        logger = logging.getLogger("selftest")
+        logger.info('Running bitbake to generate pkgdata')
+        bitbake('-c packagedata base-files coreutils busybox selftest-recipetool-appendfile')
+
+    @classmethod
+    def tearDownClass(cls):
+        # Shouldn't leave any traces of this artificial recipe behind
+        bitbake('-c cleansstate selftest-recipetool-appendfile')
+
+    def _try_recipetool_appendfile(self, testrecipe, destfile, newfile, options, expectedlines, expectedfiles):
+        cmd = 'recipetool appendfile %s %s %s %s' % (self.templayerdir, destfile, newfile, options)
+        return self._try_recipetool_appendcmd(cmd, testrecipe, expectedfiles, expectedlines)
+
+    def _try_recipetool_appendfile_fail(self, destfile, newfile, checkerror):
+        cmd = 'recipetool appendfile %s %s %s' % (self.templayerdir, destfile, newfile)
+        result = runCmd(cmd, ignore_status=True)
+        self.assertNotEqual(result.status, 0, 'Command "%s" should have failed but didn\'t' % cmd)
+        self.assertNotIn('Traceback', result.output)
+        for errorstr in checkerror:
+            self.assertIn(errorstr, result.output)
+
+    @testcase(1177)
+    def test_recipetool_appendfile_basic(self):
+        # Basic test
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                        '\n']
+        _, output = self._try_recipetool_appendfile('base-files', '/etc/motd', self.testfile, '', expectedlines, ['motd'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1183)
+    def test_recipetool_appendfile_invalid(self):
+        # Test some commands that should error
+        self._try_recipetool_appendfile_fail('/etc/passwd', self.testfile, ['ERROR: /etc/passwd cannot be handled by this tool', 'useradd', 'extrausers'])
+        self._try_recipetool_appendfile_fail('/etc/timestamp', self.testfile, ['ERROR: /etc/timestamp cannot be handled by this tool'])
+        self._try_recipetool_appendfile_fail('/dev/console', self.testfile, ['ERROR: /dev/console cannot be handled by this tool'])
+
+    @testcase(1176)
+    def test_recipetool_appendfile_alternatives(self):
+        # Now try with a file we know should be an alternative
+        # (this is very much a fake example, but one we know is reliably an alternative)
+        self._try_recipetool_appendfile_fail('/bin/ls', self.testfile, ['ERROR: File /bin/ls is an alternative possibly provided by the following recipes:', 'coreutils', 'busybox'])
+        corebase = get_bb_var('COREBASE')
+        # Need a test file - should be executable
+        testfile2 = os.path.join(corebase, 'oe-init-build-env')
+        testfile2name = os.path.basename(testfile2)
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'SRC_URI += "file://%s"\n' % testfile2name,
+                         '\n',
+                         'do_install_append() {\n',
+                         '    install -d ${D}${base_bindir}\n',
+                         '    install -m 0755 ${WORKDIR}/%s ${D}${base_bindir}/ls\n' % testfile2name,
+                         '}\n']
+        self._try_recipetool_appendfile('coreutils', '/bin/ls', testfile2, '-r coreutils', expectedlines, [testfile2name])
+        # Now try bbappending the same file again, contents should not change
+        bbappendfile, _ = self._try_recipetool_appendfile('coreutils', '/bin/ls', self.testfile, '-r coreutils', expectedlines, [testfile2name])
+        # But file should have
+        copiedfile = os.path.join(os.path.dirname(bbappendfile), 'coreutils', testfile2name)
+        result = runCmd('diff -q %s %s' % (testfile2, copiedfile), ignore_status=True)
+        self.assertNotEqual(result.status, 0, 'New file should have been copied but was not %s' % result.output)
+
+    @testcase(1178)
+    def test_recipetool_appendfile_binary(self):
+        # Try appending a binary file
+        # /bin/ls can be a symlink to /usr/bin/ls
+        ls = os.path.realpath("/bin/ls")
+        result = runCmd('recipetool appendfile %s /bin/ls %s -r coreutils' % (self.templayerdir, ls))
+        self.assertIn('WARNING: ', result.output)
+        self.assertIn('is a binary', result.output)
+
+    @testcase(1173)
+    def test_recipetool_appendfile_add(self):
+        corebase = get_bb_var('COREBASE')
+        # Try arbitrary file add to a recipe
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'SRC_URI += "file://testfile"\n',
+                         '\n',
+                         'do_install_append() {\n',
+                         '    install -d ${D}${datadir}\n',
+                         '    install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
+                         '}\n']
+        self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase', expectedlines, ['testfile'])
+        # Try adding another file, this time where the source file is executable
+        # (so we're testing that, plus modifying an existing bbappend)
+        testfile2 = os.path.join(corebase, 'oe-init-build-env')
+        testfile2name = os.path.basename(testfile2)
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'SRC_URI += "file://testfile \\\n',
+                         '            file://%s \\\n' % testfile2name,
+                         '            "\n',
+                         '\n',
+                         'do_install_append() {\n',
+                         '    install -d ${D}${datadir}\n',
+                         '    install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
+                         '    install -m 0755 ${WORKDIR}/%s ${D}${datadir}/scriptname\n' % testfile2name,
+                         '}\n']
+        self._try_recipetool_appendfile('netbase', '/usr/share/scriptname', testfile2, '-r netbase', expectedlines, ['testfile', testfile2name])
+
+    @testcase(1174)
+    def test_recipetool_appendfile_add_bindir(self):
+        # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'SRC_URI += "file://testfile"\n',
+                         '\n',
+                         'do_install_append() {\n',
+                         '    install -d ${D}${bindir}\n',
+                         '    install -m 0755 ${WORKDIR}/testfile ${D}${bindir}/selftest-recipetool-testbin\n',
+                         '}\n']
+        _, output = self._try_recipetool_appendfile('netbase', '/usr/bin/selftest-recipetool-testbin', self.testfile, '-r netbase', expectedlines, ['testfile'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1175)
+    def test_recipetool_appendfile_add_machine(self):
+        # Try arbitrary file add to a recipe, this time to a location such that should be installed as executable
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'PACKAGE_ARCH = "${MACHINE_ARCH}"\n',
+                         '\n',
+                         'SRC_URI_append_mymachine = " file://testfile"\n',
+                         '\n',
+                         'do_install_append_mymachine() {\n',
+                         '    install -d ${D}${datadir}\n',
+                         '    install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/something\n',
+                         '}\n']
+        _, output = self._try_recipetool_appendfile('netbase', '/usr/share/something', self.testfile, '-r netbase -m mymachine', expectedlines, ['mymachine/testfile'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1184)
+    def test_recipetool_appendfile_orig(self):
+        # A file that's in SRC_URI and in do_install with the same name
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-orig', self.testfile, '', expectedlines, ['selftest-replaceme-orig'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1191)
+    def test_recipetool_appendfile_todir(self):
+        # A file that's in SRC_URI and in do_install with destination directory rather than file
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-todir', self.testfile, '', expectedlines, ['selftest-replaceme-todir'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1187)
+    def test_recipetool_appendfile_renamed(self):
+        # A file that's in SRC_URI with a different name to the destination file
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-renamed', self.testfile, '', expectedlines, ['file1'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1190)
+    def test_recipetool_appendfile_subdir(self):
+        # A file that's in SRC_URI in a subdir
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'SRC_URI += "file://testfile"\n',
+                         '\n',
+                         'do_install_append() {\n',
+                         '    install -d ${D}${datadir}\n',
+                         '    install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-subdir\n',
+                         '}\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-subdir', self.testfile, '', expectedlines, ['testfile'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1189)
+    def test_recipetool_appendfile_src_glob(self):
+        # A file that's in SRC_URI as a glob
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'SRC_URI += "file://testfile"\n',
+                         '\n',
+                         'do_install_append() {\n',
+                         '    install -d ${D}${datadir}\n',
+                         '    install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-src-globfile\n',
+                         '}\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-src-globfile', self.testfile, '', expectedlines, ['testfile'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1181)
+    def test_recipetool_appendfile_inst_glob(self):
+        # A file that's in do_install as a glob
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-globfile'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1182)
+    def test_recipetool_appendfile_inst_todir_glob(self):
+        # A file that's in do_install as a glob with destination as a directory
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-todir-globfile', self.testfile, '', expectedlines, ['selftest-replaceme-inst-todir-globfile'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1185)
+    def test_recipetool_appendfile_patch(self):
+        # A file that's added by a patch in SRC_URI
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'SRC_URI += "file://testfile"\n',
+                         '\n',
+                         'do_install_append() {\n',
+                         '    install -d ${D}${sysconfdir}\n',
+                         '    install -m 0644 ${WORKDIR}/testfile ${D}${sysconfdir}/selftest-replaceme-patched\n',
+                         '}\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/etc/selftest-replaceme-patched', self.testfile, '', expectedlines, ['testfile'])
+        for line in output.splitlines():
+            if line.startswith('WARNING: '):
+                self.assertIn('add-file.patch', line, 'Unexpected warning found in output:\n%s' % line)
+                break
+        else:
+            self.fail('Patch warning not found in output:\n%s' % output)
+
+    @testcase(1188)
+    def test_recipetool_appendfile_script(self):
+        # Now, a file that's in SRC_URI but installed by a script (so no mention in do_install)
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'SRC_URI += "file://testfile"\n',
+                         '\n',
+                         'do_install_append() {\n',
+                         '    install -d ${D}${datadir}\n',
+                         '    install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-scripted\n',
+                         '}\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-scripted', self.testfile, '', expectedlines, ['testfile'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1180)
+    def test_recipetool_appendfile_inst_func(self):
+        # A file that's installed from a function called by do_install
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-inst-func', self.testfile, '', expectedlines, ['selftest-replaceme-inst-func'])
+        self.assertNotIn('WARNING: ', output)
+
+    @testcase(1186)
+    def test_recipetool_appendfile_postinstall(self):
+        # A file that's created by a postinstall script (and explicitly mentioned in it)
+        # First try without specifying recipe
+        self._try_recipetool_appendfile_fail('/usr/share/selftest-replaceme-postinst', self.testfile, ['File /usr/share/selftest-replaceme-postinst may be written out in a pre/postinstall script of the following recipes:', 'selftest-recipetool-appendfile'])
+        # Now specify recipe
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n',
+                         'SRC_URI += "file://testfile"\n',
+                         '\n',
+                         'do_install_append() {\n',
+                         '    install -d ${D}${datadir}\n',
+                         '    install -m 0644 ${WORKDIR}/testfile ${D}${datadir}/selftest-replaceme-postinst\n',
+                         '}\n']
+        _, output = self._try_recipetool_appendfile('selftest-recipetool-appendfile', '/usr/share/selftest-replaceme-postinst', self.testfile, '-r selftest-recipetool-appendfile', expectedlines, ['testfile'])
+
+    @testcase(1179)
+    def test_recipetool_appendfile_extlayer(self):
+        # Try creating a bbappend in a layer that's not in bblayers.conf and has a different structure
+        exttemplayerdir = os.path.join(self.tempdir, 'extlayer')
+        self._create_temp_layer(exttemplayerdir, False, 'oeselftestextlayer', recipepathspec='metadata/recipes/recipes-*/*')
+        result = runCmd('recipetool appendfile %s /usr/share/selftest-replaceme-orig %s' % (exttemplayerdir, self.testfile))
+        self.assertNotIn('Traceback', result.output)
+        createdfiles = []
+        for root, _, files in os.walk(exttemplayerdir):
+            for f in files:
+                createdfiles.append(os.path.relpath(os.path.join(root, f), exttemplayerdir))
+        createdfiles.remove('conf/layer.conf')
+        expectedfiles = ['metadata/recipes/recipes-test/selftest-recipetool-appendfile/selftest-recipetool-appendfile.bbappend',
+                         'metadata/recipes/recipes-test/selftest-recipetool-appendfile/selftest-recipetool-appendfile/selftest-replaceme-orig']
+        self.assertEqual(sorted(createdfiles), sorted(expectedfiles))
+
+    @testcase(1192)
+    def test_recipetool_appendfile_wildcard(self):
+
+        def try_appendfile_wc(options):
+            result = runCmd('recipetool appendfile %s /etc/profile %s %s' % (self.templayerdir, self.testfile, options))
+            self.assertNotIn('Traceback', result.output)
+            bbappendfile = None
+            for root, _, files in os.walk(self.templayerdir):
+                for f in files:
+                    if f.endswith('.bbappend'):
+                        bbappendfile = f
+                        break
+            if not bbappendfile:
+                self.fail('No bbappend file created')
+            runCmd('rm -rf %s/recipes-*' % self.templayerdir)
+            return bbappendfile
+
+        # Check without wildcard option
+        recipefn = os.path.basename(get_bb_var('FILE', 'base-files'))
+        filename = try_appendfile_wc('')
+        self.assertEqual(filename, recipefn.replace('.bb', '.bbappend'))
+        # Now check with wildcard option
+        filename = try_appendfile_wc('-w')
+        self.assertEqual(filename, recipefn.split('_')[0] + '_%.bbappend')
+
+    @testcase(1193)
+    def test_recipetool_create(self):
+        # Try adding a recipe
+        tempsrc = os.path.join(self.tempdir, 'srctree')
+        os.makedirs(tempsrc)
+        recipefile = os.path.join(self.tempdir, 'logrotate_3.8.7.bb')
+        srcuri = 'https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.8.7.tar.gz'
+        result = runCmd('recipetool create -o %s %s -x %s' % (recipefile, srcuri, tempsrc))
+        self.assertTrue(os.path.isfile(recipefile))
+        checkvars = {}
+        checkvars['LICENSE'] = 'GPLv2'
+        checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=18810669f13b87348459e611d31ab760'
+        checkvars['SRC_URI'] = 'https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.gz'
+        checkvars['SRC_URI[md5sum]'] = '99e08503ef24c3e2e3ff74cc5f3be213'
+        checkvars['SRC_URI[sha256sum]'] = 'f6ba691f40e30e640efa2752c1f9499a3f9738257660994de70a45fe00d12b64'
+        self._test_recipe_contents(recipefile, checkvars, [])
+
+    @testcase(1194)
+    def test_recipetool_create_git(self):
+        # Ensure we have the right data in shlibs/pkgdata
+        bitbake('libpng pango libx11 libxext jpeg')
+        # Try adding a recipe
+        tempsrc = os.path.join(self.tempdir, 'srctree')
+        os.makedirs(tempsrc)
+        recipefile = os.path.join(self.tempdir, 'libmatchbox.bb')
+        srcuri = 'git://git.yoctoproject.org/libmatchbox'
+        result = runCmd('recipetool create -o %s %s -x %s' % (recipefile, srcuri, tempsrc))
+        self.assertTrue(os.path.isfile(recipefile), 'recipetool did not create recipe file; output:\n%s' % result.output)
+        checkvars = {}
+        checkvars['LICENSE'] = 'LGPLv2.1'
+        checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34'
+        checkvars['S'] = '${WORKDIR}/git'
+        checkvars['PV'] = '1.0+git${SRCPV}'
+        checkvars['SRC_URI'] = srcuri
+        checkvars['DEPENDS'] = 'libpng pango libx11 libxext jpeg'
+        inherits = ['autotools', 'pkgconfig']
+        self._test_recipe_contents(recipefile, checkvars, inherits)
+
+
+class RecipetoolAppendsrcBase(RecipetoolBase):
+    def _try_recipetool_appendsrcfile(self, testrecipe, newfile, destfile, options, expectedlines, expectedfiles):
+        cmd = 'recipetool appendsrcfile %s %s %s %s %s' % (options, self.templayerdir, testrecipe, newfile, destfile)
+        return self._try_recipetool_appendcmd(cmd, testrecipe, expectedfiles, expectedlines)
+
+    def _try_recipetool_appendsrcfiles(self, testrecipe, newfiles, expectedlines=None, expectedfiles=None, destdir=None, options=''):
+
+        if destdir:
+            options += ' -D %s' % destdir
+
+        if expectedfiles is None:
+            expectedfiles = [os.path.basename(f) for f in newfiles]
+
+        cmd = 'recipetool appendsrcfiles %s %s %s %s' % (options, self.templayerdir, testrecipe, ' '.join(newfiles))
+        return self._try_recipetool_appendcmd(cmd, testrecipe, expectedfiles, expectedlines)
+
+    def _try_recipetool_appendsrcfile_fail(self, testrecipe, newfile, destfile, checkerror):
+        cmd = 'recipetool appendsrcfile %s %s %s %s' % (self.templayerdir, testrecipe, newfile, destfile or '')
+        result = runCmd(cmd, ignore_status=True)
+        self.assertNotEqual(result.status, 0, 'Command "%s" should have failed but didn\'t' % cmd)
+        self.assertNotIn('Traceback', result.output)
+        for errorstr in checkerror:
+            self.assertIn(errorstr, result.output)
+
+    @staticmethod
+    def _get_first_file_uri(recipe):
+        '''Return the first file:// in SRC_URI for the specified recipe.'''
+        src_uri = get_bb_var('SRC_URI', recipe).split()
+        for uri in src_uri:
+            p = urlparse.urlparse(uri)
+            if p.scheme == 'file':
+                return p.netloc + p.path
+
+    def _test_appendsrcfile(self, testrecipe, filename=None, destdir=None, has_src_uri=True, srcdir=None, newfile=None, options=''):
+        if newfile is None:
+            newfile = self.testfile
+
+        if srcdir:
+            if destdir:
+                expected_subdir = os.path.join(srcdir, destdir)
+            else:
+                expected_subdir = srcdir
+        else:
+            options += " -W"
+            expected_subdir = destdir
+
+        if filename:
+            if destdir:
+                destpath = os.path.join(destdir, filename)
+            else:
+                destpath = filename
+        else:
+            filename = os.path.basename(newfile)
+            if destdir:
+                destpath = destdir + os.sep
+            else:
+                destpath = '.' + os.sep
+
+        expectedlines = ['FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"\n',
+                         '\n']
+        if has_src_uri:
+            uri = 'file://%s' % filename
+            if expected_subdir:
+                uri += ';subdir=%s' % expected_subdir
+            expectedlines[0:0] = ['SRC_URI += "%s"\n' % uri,
+                                  '\n']
+
+        return self._try_recipetool_appendsrcfile(testrecipe, newfile, destpath, options, expectedlines, [filename])
+
+    def _test_appendsrcfiles(self, testrecipe, newfiles, expectedfiles=None, destdir=None, options=''):
+        if expectedfiles is None:
+            expectedfiles = [os.path.basename(n) for n in newfiles]
+
+        self._try_recipetool_appendsrcfiles(testrecipe, newfiles, expectedfiles=expectedfiles, destdir=destdir, options=options)
+
+        src_uri = get_bb_var('SRC_URI', testrecipe).split()
+        for f in expectedfiles:
+            if destdir:
+                self.assertIn('file://%s;subdir=%s' % (f, destdir), src_uri)
+            else:
+                self.assertIn('file://%s' % f, src_uri)
+
+        recipefile = get_bb_var('FILE', testrecipe)
+        bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir)
+        filesdir = os.path.join(os.path.dirname(bbappendfile), testrecipe)
+        filesextrapaths = get_bb_var('FILESEXTRAPATHS', testrecipe).split(':')
+        self.assertIn(filesdir, filesextrapaths)
+
+
+class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase):
+    def test_recipetool_appendsrcfile_basic(self):
+        self._test_appendsrcfile('base-files', 'a-file')
+
+    def test_recipetool_appendsrcfile_basic_wildcard(self):
+        testrecipe = 'base-files'
+        self._test_appendsrcfile(testrecipe, 'a-file', options='-w')
+        recipefile = get_bb_var('FILE', testrecipe)
+        bbappendfile = self._check_bbappend(testrecipe, recipefile, self.templayerdir)
+        self.assertEqual(os.path.basename(bbappendfile), '%s_%%.bbappend' % testrecipe)
+
+    def test_recipetool_appendsrcfile_subdir_basic(self):
+        self._test_appendsrcfile('base-files', 'a-file', 'tmp')
+
+    def test_recipetool_appendsrcfile_subdir_basic_dirdest(self):
+        self._test_appendsrcfile('base-files', destdir='tmp')
+
+    def test_recipetool_appendsrcfile_srcdir_basic(self):
+        testrecipe = 'bash'
+        srcdir = get_bb_var('S', testrecipe)
+        workdir = get_bb_var('WORKDIR', testrecipe)
+        subdir = os.path.relpath(srcdir, workdir)
+        self._test_appendsrcfile(testrecipe, 'a-file', srcdir=subdir)
+
+    def test_recipetool_appendsrcfile_existing_in_src_uri(self):
+        testrecipe = 'base-files'
+        filepath = self._get_first_file_uri(testrecipe)
+        self.assertTrue(filepath, 'Unable to test, no file:// uri found in SRC_URI for %s' % testrecipe)
+        self._test_appendsrcfile(testrecipe, filepath, has_src_uri=False)
+
+    def test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(self):
+        testrecipe = 'base-files'
+        subdir = 'tmp'
+        filepath = self._get_first_file_uri(testrecipe)
+        self.assertTrue(filepath, 'Unable to test, no file:// uri found in SRC_URI for %s' % testrecipe)
+
+        output = self._test_appendsrcfile(testrecipe, filepath, subdir, has_src_uri=False)
+        self.assertTrue(any('with different parameters' in l for l in output))
+
+    def test_recipetool_appendsrcfile_replace_file_srcdir(self):
+        testrecipe = 'bash'
+        filepath = 'Makefile.in'
+        srcdir = get_bb_var('S', testrecipe)
+        workdir = get_bb_var('WORKDIR', testrecipe)
+        subdir = os.path.relpath(srcdir, workdir)
+
+        self._test_appendsrcfile(testrecipe, filepath, srcdir=subdir)
+        bitbake('%s:do_unpack' % testrecipe)
+        self.assertEqual(open(self.testfile, 'r').read(), open(os.path.join(srcdir, filepath), 'r').read())
+
+    def test_recipetool_appendsrcfiles_basic(self, destdir=None):
+        newfiles = [self.testfile]
+        for i in range(1, 5):
+            testfile = os.path.join(self.tempdir, 'testfile%d' % i)
+            with open(testfile, 'w') as f:
+                f.write('Test file %d\n' % i)
+            newfiles.append(testfile)
+        self._test_appendsrcfiles('gcc', newfiles, destdir=destdir, options='-W')
+
+    def test_recipetool_appendsrcfiles_basic_subdir(self):
+        self.test_recipetool_appendsrcfiles_basic(destdir='testdir')
diff --git a/meta/lib/oeqa/selftest/sstate.py b/meta/lib/oeqa/selftest/sstate.py
new file mode 100644
index 0000000..5989724
--- /dev/null
+++ b/meta/lib/oeqa/selftest/sstate.py
@@ -0,0 +1,53 @@
+import datetime
+import unittest
+import os
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+
+
+class SStateBase(oeSelfTest):
+
+    def setUpLocal(self):
+        self.temp_sstate_location = None
+        self.sstate_path = get_bb_var('SSTATE_DIR')
+        self.distro = get_bb_var('NATIVELSBSTRING')
+        self.distro_specific_sstate = os.path.join(self.sstate_path, self.distro)
+
+    # Creates a special sstate configuration with the option to add sstate mirrors
+    def config_sstate(self, temp_sstate_location=False, add_local_mirrors=[]):
+        self.temp_sstate_location = temp_sstate_location
+
+        if self.temp_sstate_location:
+            temp_sstate_path = os.path.join(self.builddir, "temp_sstate_%s" % datetime.datetime.now().strftime('%Y%m%d%H%M%S'))
+            config_temp_sstate = "SSTATE_DIR = \"%s\"" % temp_sstate_path
+            self.append_config(config_temp_sstate)
+            self.track_for_cleanup(temp_sstate_path)
+        self.sstate_path = get_bb_var('SSTATE_DIR')
+        self.distro = get_bb_var('NATIVELSBSTRING')
+        self.distro_specific_sstate = os.path.join(self.sstate_path, self.distro)
+
+        if add_local_mirrors:
+            config_set_sstate_if_not_set = 'SSTATE_MIRRORS ?= ""'
+            self.append_config(config_set_sstate_if_not_set)
+            for local_mirror in add_local_mirrors:
+                self.assertFalse(os.path.join(local_mirror) == os.path.join(self.sstate_path), msg='Cannot add the current sstate path as a sstate mirror')
+                config_sstate_mirror = "SSTATE_MIRRORS += \"file://.* file:///%s/PATH\"" % local_mirror
+                self.append_config(config_sstate_mirror)
+
+    # Returns a list containing sstate files
+    def search_sstate(self, filename_regex, distro_specific=True, distro_nonspecific=True):
+        result = []
+        for root, dirs, files in os.walk(self.sstate_path):
+            if distro_specific and re.search("%s/[a-z0-9]{2}$" % self.distro, root):
+                for f in files:
+                    if re.search(filename_regex, f):
+                        result.append(f)
+            if distro_nonspecific and re.search("%s/[a-z0-9]{2}$" % self.sstate_path, root):
+                for f in files:
+                    if re.search(filename_regex, f):
+                        result.append(f)
+        return result
diff --git a/meta/lib/oeqa/selftest/sstatetests.py b/meta/lib/oeqa/selftest/sstatetests.py
new file mode 100644
index 0000000..6906b21
--- /dev/null
+++ b/meta/lib/oeqa/selftest/sstatetests.py
@@ -0,0 +1,308 @@
+import datetime
+import unittest
+import os
+import re
+import shutil
+
+import oeqa.utils.ftools as ftools
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_test_layer
+from oeqa.selftest.sstate import SStateBase
+from oeqa.utils.decorators import testcase
+
+class SStateTests(SStateBase):
+
+    # Test sstate files creation and their location
+    def run_test_sstate_creation(self, targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True, should_pass=True):
+        self.config_sstate(temp_sstate_location)
+
+        if  self.temp_sstate_location:
+            bitbake(['-cclean'] + targets)
+        else:
+            bitbake(['-ccleansstate'] + targets)
+
+        bitbake(targets)
+        file_tracker = self.search_sstate('|'.join(map(str, targets)), distro_specific, distro_nonspecific)
+        if should_pass:
+            self.assertTrue(file_tracker , msg="Could not find sstate files for: %s" % ', '.join(map(str, targets)))
+        else:
+            self.assertTrue(not file_tracker , msg="Found sstate files in the wrong place for: %s" % ', '.join(map(str, targets)))
+
+    @testcase(975)
+    def test_sstate_creation_distro_specific_pass(self):
+        targetarch = get_bb_var('TUNE_ARCH')
+        self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
+
+    @testcase(975)
+    def test_sstate_creation_distro_specific_fail(self):
+        targetarch = get_bb_var('TUNE_ARCH')
+        self.run_test_sstate_creation(['binutils-cross-'+ targetarch, 'binutils-native'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True, should_pass=False)
+
+    @testcase(976)
+    def test_sstate_creation_distro_nonspecific_pass(self):
+        self.run_test_sstate_creation(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+
+    @testcase(976)
+    def test_sstate_creation_distro_nonspecific_fail(self):
+        self.run_test_sstate_creation(['glibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True, should_pass=False)
+
+
+    # Test the sstate files deletion part of the do_cleansstate task
+    def run_test_cleansstate_task(self, targets, distro_specific=True, distro_nonspecific=True, temp_sstate_location=True):
+        self.config_sstate(temp_sstate_location)
+
+        bitbake(['-ccleansstate'] + targets)
+
+        bitbake(targets)
+        tgz_created = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific)
+        self.assertTrue(tgz_created, msg="Could not find sstate .tgz files for: %s" % ', '.join(map(str, targets)))
+
+        siginfo_created = self.search_sstate('|'.join(map(str, [s + '.*?\.siginfo$' for s in targets])), distro_specific, distro_nonspecific)
+        self.assertTrue(siginfo_created, msg="Could not find sstate .siginfo files for: %s" % ', '.join(map(str, targets)))
+
+        bitbake(['-ccleansstate'] + targets)
+        tgz_removed = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific, distro_nonspecific)
+        self.assertTrue(not tgz_removed, msg="do_cleansstate didn't remove .tgz sstate files for: %s" % ', '.join(map(str, targets)))
+
+    @testcase(977)
+    def test_cleansstate_task_distro_specific_nonspecific(self):
+        targetarch = get_bb_var('TUNE_ARCH')
+        self.run_test_cleansstate_task(['binutils-cross-' + targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=True, temp_sstate_location=True)
+
+    @testcase(977)
+    def test_cleansstate_task_distro_nonspecific(self):
+        self.run_test_cleansstate_task(['glibc-initial'], distro_specific=False, distro_nonspecific=True, temp_sstate_location=True)
+
+    @testcase(977)
+    def test_cleansstate_task_distro_specific(self):
+        targetarch = get_bb_var('TUNE_ARCH')
+        self.run_test_cleansstate_task(['binutils-cross-'+ targetarch, 'binutils-native', 'glibc-initial'], distro_specific=True, distro_nonspecific=False, temp_sstate_location=True)
+
+
+    # Test rebuilding of distro-specific sstate files
+    def run_test_rebuild_distro_specific_sstate(self, targets, temp_sstate_location=True):
+        self.config_sstate(temp_sstate_location)
+
+        bitbake(['-ccleansstate'] + targets)
+
+        bitbake(targets)
+        self.assertTrue(self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=False, distro_nonspecific=True) == [], msg="Found distro non-specific sstate for: %s" % ', '.join(map(str, targets)))
+        file_tracker_1 = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False)
+        self.assertTrue(len(file_tracker_1) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets)))
+
+        self.track_for_cleanup(self.distro_specific_sstate + "_old")
+        shutil.copytree(self.distro_specific_sstate, self.distro_specific_sstate + "_old")
+        shutil.rmtree(self.distro_specific_sstate)
+
+        bitbake(['-cclean'] + targets)
+        bitbake(targets)
+        file_tracker_2 = self.search_sstate('|'.join(map(str, [s + '.*?\.tgz$' for s in targets])), distro_specific=True, distro_nonspecific=False)
+        self.assertTrue(len(file_tracker_2) >= len(targets), msg = "Not all sstate files ware created for: %s" % ', '.join(map(str, targets)))
+
+        not_recreated = [x for x in file_tracker_1 if x not in file_tracker_2]
+        self.assertTrue(not_recreated == [], msg="The following sstate files ware not recreated: %s" % ', '.join(map(str, not_recreated)))
+
+        created_once = [x for x in file_tracker_2 if x not in file_tracker_1]
+        self.assertTrue(created_once == [], msg="The following sstate files ware created only in the second run: %s" % ', '.join(map(str, created_once)))
+
+    @testcase(175)
+    def test_rebuild_distro_specific_sstate_cross_native_targets(self):
+        targetarch = get_bb_var('TUNE_ARCH')
+        self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch, 'binutils-native'], temp_sstate_location=True)
+
+    @testcase(175)
+    def test_rebuild_distro_specific_sstate_cross_target(self):
+        targetarch = get_bb_var('TUNE_ARCH')
+        self.run_test_rebuild_distro_specific_sstate(['binutils-cross-' + targetarch], temp_sstate_location=True)
+
+    @testcase(175)
+    def test_rebuild_distro_specific_sstate_native_target(self):
+        self.run_test_rebuild_distro_specific_sstate(['binutils-native'], temp_sstate_location=True)
+
+
+    # Test the sstate-cache-management script. Each element in the global_config list is used with the corresponding element in the target_config list
+    # global_config elements are expected to not generate any sstate files that would be removed by sstate-cache-management.sh (such as changing the value of MACHINE)
+    def run_test_sstate_cache_management_script(self, target, global_config=[''], target_config=[''], ignore_patterns=[]):
+        self.assertTrue(global_config)
+        self.assertTrue(target_config)
+        self.assertTrue(len(global_config) == len(target_config), msg='Lists global_config and target_config should have the same number of elements')
+        self.config_sstate(temp_sstate_location=True, add_local_mirrors=[self.sstate_path])
+
+        # If buildhistory is enabled, we need to disable version-going-backwards QA checks for this test. It may report errors otherwise.
+        if ('buildhistory' in get_bb_var('USER_CLASSES')) or ('buildhistory' in get_bb_var('INHERIT')):
+            remove_errors_config = 'ERROR_QA_remove = "version-going-backwards"'
+            self.append_config(remove_errors_config)
+
+        # For not this only checks if random sstate tasks are handled correctly as a group.
+        # In the future we should add control over what tasks we check for.
+
+        sstate_archs_list = []
+        expected_remaining_sstate = []
+        for idx in range(len(target_config)):
+            self.append_config(global_config[idx])
+            self.append_recipeinc(target, target_config[idx])
+            sstate_arch = get_bb_var('SSTATE_PKGARCH', target)
+            if not sstate_arch in sstate_archs_list:
+                sstate_archs_list.append(sstate_arch)
+            if target_config[idx] == target_config[-1]:
+                target_sstate_before_build = self.search_sstate(target + '.*?\.tgz$')
+            bitbake("-cclean %s" % target)
+            result = bitbake(target, ignore_status=True)
+            if target_config[idx] == target_config[-1]:
+                target_sstate_after_build = self.search_sstate(target + '.*?\.tgz$')
+                expected_remaining_sstate += [x for x in target_sstate_after_build if x not in target_sstate_before_build if not any(pattern in x for pattern in ignore_patterns)]
+            self.remove_config(global_config[idx])
+            self.remove_recipeinc(target, target_config[idx])
+            self.assertEqual(result.status, 0, msg = "build of %s failed with %s" % (target, result.output))
+
+        runCmd("sstate-cache-management.sh -y --cache-dir=%s --remove-duplicated --extra-archs=%s" % (self.sstate_path, ','.join(map(str, sstate_archs_list))))
+        actual_remaining_sstate = [x for x in self.search_sstate(target + '.*?\.tgz$') if not any(pattern in x for pattern in ignore_patterns)]
+
+        actual_not_expected = [x for x in actual_remaining_sstate if x not in expected_remaining_sstate]
+        self.assertFalse(actual_not_expected, msg="Files should have been removed but ware not: %s" % ', '.join(map(str, actual_not_expected)))
+        expected_not_actual = [x for x in expected_remaining_sstate if x not in actual_remaining_sstate]
+        self.assertFalse(expected_not_actual, msg="Extra files ware removed: %s" ', '.join(map(str, expected_not_actual)))
+
+    @testcase(973)
+    def test_sstate_cache_management_script_using_pr_1(self):
+        global_config = []
+        target_config = []
+        global_config.append('')
+        target_config.append('PR = "0"')
+        self.run_test_sstate_cache_management_script('m4', global_config,  target_config, ignore_patterns=['populate_lic'])
+
+    @testcase(978)
+    def test_sstate_cache_management_script_using_pr_2(self):
+        global_config = []
+        target_config = []
+        global_config.append('')
+        target_config.append('PR = "0"')
+        global_config.append('')
+        target_config.append('PR = "1"')
+        self.run_test_sstate_cache_management_script('m4', global_config,  target_config, ignore_patterns=['populate_lic'])
+
+    @testcase(979)
+    def test_sstate_cache_management_script_using_pr_3(self):
+        global_config = []
+        target_config = []
+        global_config.append('MACHINE = "qemux86-64"')
+        target_config.append('PR = "0"')
+        global_config.append(global_config[0])
+        target_config.append('PR = "1"')
+        global_config.append('MACHINE = "qemux86"')
+        target_config.append('PR = "1"')
+        self.run_test_sstate_cache_management_script('m4', global_config,  target_config, ignore_patterns=['populate_lic'])
+
+    @testcase(974)
+    def test_sstate_cache_management_script_using_machine(self):
+        global_config = []
+        target_config = []
+        global_config.append('MACHINE = "qemux86-64"')
+        target_config.append('')
+        global_config.append('MACHINE = "qemux86"')
+        target_config.append('')
+        self.run_test_sstate_cache_management_script('m4', global_config,  target_config, ignore_patterns=['populate_lic'])
+
+    @testcase(1270)
+    def test_sstate_32_64_same_hash(self):
+        """
+        The sstate checksums for both native and target should not vary whether
+        they're built on a 32 or 64 bit system. Rather than requiring two different 
+        build machines and running a builds, override the variables calling uname()
+        manually and check using bitbake -S.
+        """
+
+        topdir = get_bb_var('TOPDIR')
+        targetvendor = get_bb_var('TARGET_VENDOR')
+        self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
+BUILD_ARCH = \"x86_64\"
+BUILD_OS = \"linux\"
+""")
+        self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+        bitbake("core-image-sato -S none")
+        self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+BUILD_ARCH = \"i686\"
+BUILD_OS = \"linux\"
+""")
+        self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
+        bitbake("core-image-sato -S none")
+
+        def get_files(d):
+            f = []
+            for root, dirs, files in os.walk(d):
+                f.extend(os.path.join(root, name) for name in files)
+            return f
+        files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/")
+        files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
+        files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash").replace("i686-linux", "x86_64-linux").replace("i686" + targetvendor + "-linux", "x86_64" + targetvendor + "-linux", ) for x in files2]
+        self.assertItemsEqual(files1, files2)
+
+
+    @testcase(1271)
+    def test_sstate_nativelsbstring_same_hash(self):
+        """
+        The sstate checksums should be independent of whichever NATIVELSBSTRING is
+        detected. Rather than requiring two different build machines and running 
+        builds, override the variables manually and check using bitbake -S.
+        """
+
+        topdir = get_bb_var('TOPDIR')
+        self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
+NATIVELSBSTRING = \"DistroA\"
+""")
+        self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+        bitbake("core-image-sato -S none")
+        self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+NATIVELSBSTRING = \"DistroB\"
+""")
+        self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
+        bitbake("core-image-sato -S none")
+
+        def get_files(d):
+            f = []
+            for root, dirs, files in os.walk(d):
+                f.extend(os.path.join(root, name) for name in files)
+            return f
+        files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/")
+        files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/")
+        files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
+        self.assertItemsEqual(files1, files2)
+
+    def test_sstate_allarch_samesigs(self):
+        """
+        The sstate checksums off allarch packages should be independent of whichever 
+        MACHINE is set. Check this using bitbake -S.
+        """
+
+        topdir = get_bb_var('TOPDIR')
+        targetos = get_bb_var('TARGET_OS')
+        targetvendor = get_bb_var('TARGET_VENDOR')
+        self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash\"
+MACHINE = \"qemux86\"
+""")
+        self.track_for_cleanup(topdir + "/tmp-sstatesamehash")
+        bitbake("world -S none")
+        self.write_config("""
+TMPDIR = \"${TOPDIR}/tmp-sstatesamehash2\"
+MACHINE = \"qemuarm\"
+""")
+        self.track_for_cleanup(topdir + "/tmp-sstatesamehash2")
+        bitbake("world -S none")
+
+        def get_files(d):
+            f = []
+            for root, dirs, files in os.walk(d):
+                for name in files:
+                    if "do_build" not in name:
+                        f.append(os.path.join(root, name))
+            return f
+        files1 = get_files(topdir + "/tmp-sstatesamehash/stamps/all" + targetvendor + "-" + targetos)
+        files2 = get_files(topdir + "/tmp-sstatesamehash2/stamps/all" + targetvendor + "-" + targetos)
+        files2 = [x.replace("tmp-sstatesamehash2", "tmp-sstatesamehash") for x in files2]
+        self.maxDiff = None
+        self.assertItemsEqual(files1, files2)
diff --git a/meta/lib/oeqa/selftest/wic.py b/meta/lib/oeqa/selftest/wic.py
new file mode 100644
index 0000000..3dc54a4
--- /dev/null
+++ b/meta/lib/oeqa/selftest/wic.py
@@ -0,0 +1,236 @@
+#!/usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# Copyright (c) 2015, Intel Corporation.
+# All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# AUTHORS
+# Ed Bartosh <ed.bartosh@linux.intel.com>
+
+"""Test cases for wic."""
+
+import os
+import sys
+
+from glob import glob
+from shutil import rmtree
+
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var
+
+class Wic(oeSelfTest):
+    """Wic test class."""
+
+    resultdir = "/var/tmp/wic/build/"
+
+    @classmethod
+    def setUpClass(cls):
+        """Build wic runtime dependencies."""
+        bitbake('syslinux syslinux-native parted-native gptfdisk-native '
+                'dosfstools-native mtools-native')
+        Wic.image_is_ready = False
+
+    def setUp(self):
+        """This code is executed before each test method."""
+        if not Wic.image_is_ready:
+            # build core-image-minimal with required features
+            features = 'IMAGE_FSTYPES += " hddimg"\nMACHINE_FEATURES_append = " efi"\n'
+            self.append_config(features)
+            bitbake('core-image-minimal')
+            # set this class variable to avoid buiding image many times
+            Wic.image_is_ready = True
+
+        rmtree(self.resultdir, ignore_errors=True)
+
+    def test01_help(self):
+        """Test wic --help"""
+        self.assertEqual(0, runCmd('wic --help').status)
+
+    def test02_createhelp(self):
+        """Test wic create --help"""
+        self.assertEqual(0, runCmd('wic create --help').status)
+
+    def test03_listhelp(self):
+        """Test wic list --help"""
+        self.assertEqual(0, runCmd('wic list --help').status)
+
+    def test04_build_image_name(self):
+        """Test wic create directdisk --image-name core-image-minimal"""
+        self.assertEqual(0, runCmd("wic create directdisk "
+                                   "--image-name core-image-minimal").status)
+        self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+
+    def test05_build_artifacts(self):
+        """Test wic create directdisk providing all artifacts."""
+        vars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
+                        for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
+                                    'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
+        status = runCmd("wic create directdisk "
+                        "-b %(staging_datadir)s "
+                        "-k %(deploy_dir_image)s "
+                        "-n %(staging_dir_native)s "
+                        "-r %(image_rootfs)s" % vars).status
+        self.assertEqual(0, status)
+        self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+
+    def test06_gpt_image(self):
+        """Test creation of core-image-minimal with gpt table and UUID boot"""
+        self.assertEqual(0, runCmd("wic create directdisk-gpt "
+                                   "--image-name core-image-minimal").status)
+        self.assertEqual(1, len(glob(self.resultdir + "directdisk-*.direct")))
+
+    def test07_unsupported_subcommand(self):
+        """Test unsupported subcommand"""
+        self.assertEqual(1, runCmd('wic unsupported',
+                         ignore_status=True).status)
+
+    def test08_no_command(self):
+        """Test wic without command"""
+        self.assertEqual(1, runCmd('wic', ignore_status=True).status)
+
+    def test09_help_kickstart(self):
+        """Test wic help overview"""
+        self.assertEqual(0, runCmd('wic help overview').status)
+
+    def test10_help_plugins(self):
+        """Test wic help plugins"""
+        self.assertEqual(0, runCmd('wic help plugins').status)
+
+    def test11_help_kickstart(self):
+        """Test wic help kickstart"""
+        self.assertEqual(0, runCmd('wic help kickstart').status)
+
+    def test12_compress_gzip(self):
+        """Test compressing an image with gzip"""
+        self.assertEqual(0, runCmd("wic create directdisk "
+                                   "--image-name core-image-minimal "
+                                   "-c gzip").status)
+        self.assertEqual(1, len(glob(self.resultdir + \
+                                         "directdisk-*.direct.gz")))
+
+    def test13_compress_gzip(self):
+        """Test compressing an image with bzip2"""
+        self.assertEqual(0, runCmd("wic create directdisk "
+                                   "--image-name core-image-minimal "
+                                   "-c bzip2").status)
+        self.assertEqual(1, len(glob(self.resultdir + \
+                                         "directdisk-*.direct.bz2")))
+
+    def test14_compress_gzip(self):
+        """Test compressing an image with xz"""
+        self.assertEqual(0, runCmd("wic create directdisk "
+                                   "--image-name core-image-minimal "
+                                   "-c xz").status)
+        self.assertEqual(1, len(glob(self.resultdir + \
+                                         "directdisk-*.direct.xz")))
+
+    def test15_wrong_compressor(self):
+        """Test how wic breaks if wrong compressor is provided"""
+        self.assertEqual(2, runCmd("wic create directdisk "
+                                   "--image-name core-image-minimal "
+                                   "-c wrong", ignore_status=True).status)
+
+    def test16_rootfs_indirect_recipes(self):
+        """Test usage of rootfs plugin with rootfs recipes"""
+        wks = "directdisk-multi-rootfs"
+        self.assertEqual(0, runCmd("wic create %s "
+                                   "--image-name core-image-minimal "
+                                   "--rootfs rootfs1=core-image-minimal "
+                                   "--rootfs rootfs2=core-image-minimal" \
+                                   % wks).status)
+        self.assertEqual(1, len(glob(self.resultdir + "%s*.direct" % wks)))
+
+    def test17_rootfs_artifacts(self):
+        """Test usage of rootfs plugin with rootfs paths"""
+        vars = dict((var.lower(), get_bb_var(var, 'core-image-minimal')) \
+                        for var in ('STAGING_DATADIR', 'DEPLOY_DIR_IMAGE',
+                                    'STAGING_DIR_NATIVE', 'IMAGE_ROOTFS'))
+        vars['wks'] = "directdisk-multi-rootfs"
+        status = runCmd("wic create %(wks)s "
+                        "-b %(staging_datadir)s "
+                        "-k %(deploy_dir_image)s "
+                        "-n %(staging_dir_native)s "
+                        "--rootfs-dir rootfs1=%(image_rootfs)s "
+                        "--rootfs-dir rootfs2=%(image_rootfs)s" \
+                        % vars).status
+        self.assertEqual(0, status)
+        self.assertEqual(1, len(glob(self.resultdir + \
+                                     "%(wks)s-*.direct" % vars)))
+
+    def test18_iso_image(self):
+        """Test creation of hybrid iso imagewith legacy and EFI boot"""
+        self.assertEqual(0, runCmd("wic create mkhybridiso "
+                                   "--image-name core-image-minimal").status)
+        self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.direct")))
+        self.assertEqual(1, len(glob(self.resultdir + "HYBRID_ISO_IMG-*.iso")))
+
+    def test19_image_env(self):
+        """Test generation of <image>.env files."""
+        image = 'core-image-minimal'
+        stdir = get_bb_var('STAGING_DIR_TARGET', image)
+        imgdatadir = os.path.join(stdir, 'imgdata')
+
+        basename = get_bb_var('IMAGE_BASENAME', image)
+        self.assertEqual(basename, image)
+        path = os.path.join(imgdatadir, basename) + '.env'
+        self.assertTrue(os.path.isfile(path))
+
+        wicvars = set(get_bb_var('WICVARS', image).split())
+        # filter out optional variables
+        wicvars = wicvars.difference(('HDDDIR', 'IMAGE_BOOT_FILES',
+                                      'INITRD', 'ISODIR'))
+        with open(path) as envfile:
+            content = dict(line.split("=", 1) for line in envfile)
+            # test if variables used by wic present in the .env file
+            for var in wicvars:
+                self.assertTrue(var in content, "%s is not in .env file" % var)
+                self.assertTrue(content[var])
+
+    def test20_wic_image_type(self):
+        """Test building wic images by bitbake"""
+        self.assertEqual(0, bitbake('wic-image-minimal').status)
+
+        deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE')
+        machine = get_bb_var('MACHINE')
+        prefix = os.path.join(deploy_dir, 'wic-image-minimal-%s.' % machine)
+        # check if we have result image and manifests symlinks
+        # pointing to existing files
+        for suffix in ('wic.bz2', 'manifest'):
+            path = prefix + suffix
+            self.assertTrue(os.path.islink(path))
+            self.assertTrue(os.path.isfile(os.path.realpath(path)))
+
+    def test21_qemux86_directdisk(self):
+        """Test creation of qemux-86-directdisk image"""
+        image = "qemux86-directdisk"
+        self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
+                                   % image).status)
+        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
+
+    def test22_mkgummidisk(self):
+        """Test creation of mkgummidisk image"""
+        image = "mkgummidisk"
+        self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
+                                   % image).status)
+        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
+
+    def test23_mkefidisk(self):
+        """Test creation of mkefidisk image"""
+        image = "mkefidisk"
+        self.assertEqual(0, runCmd("wic create %s -e core-image-minimal" \
+                                   % image).status)
+        self.assertEqual(1, len(glob(self.resultdir + "%s-*direct" % image)))
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py
new file mode 100644
index 0000000..edc0d01
--- /dev/null
+++ b/meta/lib/oeqa/targetcontrol.py
@@ -0,0 +1,240 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module is used by testimage.bbclass for setting up and controlling a target machine.
+
+import os
+import shutil
+import subprocess
+import bb
+import traceback
+import sys
+import logging
+from oeqa.utils.sshcontrol import SSHControl
+from oeqa.utils.qemurunner import QemuRunner
+from oeqa.utils.qemutinyrunner import QemuTinyRunner
+from oeqa.utils.dump import TargetDumper
+from oeqa.controllers.testtargetloader import TestTargetLoader
+from abc import ABCMeta, abstractmethod
+
+def get_target_controller(d):
+    testtarget = d.getVar("TEST_TARGET", True)
+    # old, simple names
+    if testtarget == "qemu":
+        return QemuTarget(d)
+    elif testtarget == "simpleremote":
+        return SimpleRemoteTarget(d)
+    else:
+        # use the class name
+        try:
+            # is it a core class defined here?
+            controller = getattr(sys.modules[__name__], testtarget)
+        except AttributeError:
+            # nope, perhaps a layer defined one
+            try:
+                bbpath = d.getVar("BBPATH", True).split(':')
+                testtargetloader = TestTargetLoader()
+                controller = testtargetloader.get_controller_module(testtarget, bbpath)
+            except ImportError as e:
+                bb.fatal("Failed to import {0} from available controller modules:\n{1}".format(testtarget,traceback.format_exc()))
+            except AttributeError as e:
+                bb.fatal("Invalid TEST_TARGET - " + str(e))
+        return controller(d)
+
+
+class BaseTarget(object):
+
+    __metaclass__ = ABCMeta
+
+    supported_image_fstypes = []
+
+    def __init__(self, d):
+        self.connection = None
+        self.ip = None
+        self.server_ip = None
+        self.datetime = d.getVar('DATETIME', True)
+        self.testdir = d.getVar("TEST_LOG_DIR", True)
+        self.pn = d.getVar("PN", True)
+
+    @abstractmethod
+    def deploy(self):
+
+        self.sshlog = os.path.join(self.testdir, "ssh_target_log.%s" % self.datetime)
+        sshloglink = os.path.join(self.testdir, "ssh_target_log")
+        if os.path.islink(sshloglink):
+            os.unlink(sshloglink)
+        os.symlink(self.sshlog, sshloglink)
+        bb.note("SSH log file: %s" %  self.sshlog)
+
+    @abstractmethod
+    def start(self, params=None):
+        pass
+
+    @abstractmethod
+    def stop(self):
+        pass
+
+    @classmethod
+    def get_extra_files(self):
+        return None
+
+    @classmethod
+    def match_image_fstype(self, d, image_fstypes=None):
+        if not image_fstypes:
+            image_fstypes = d.getVar('IMAGE_FSTYPES', True).split(' ')
+        possible_image_fstypes = [fstype for fstype in self.supported_image_fstypes if fstype in image_fstypes]
+        if possible_image_fstypes:
+            return possible_image_fstypes[0]
+        else:
+            return None
+
+    def get_image_fstype(self, d):
+        image_fstype = self.match_image_fstype(d)
+        if image_fstype:
+            return image_fstype
+        else:
+            bb.fatal("IMAGE_FSTYPES should contain a Target Controller supported image fstype: %s " % ', '.join(map(str, self.supported_image_fstypes)))
+
+    def restart(self, params=None):
+        self.stop()
+        self.start(params)
+
+    def run(self, cmd, timeout=None):
+        return self.connection.run(cmd, timeout)
+
+    def copy_to(self, localpath, remotepath):
+        return self.connection.copy_to(localpath, remotepath)
+
+    def copy_from(self, remotepath, localpath):
+        return self.connection.copy_from(remotepath, localpath)
+
+
+
+class QemuTarget(BaseTarget):
+
+    supported_image_fstypes = ['ext3', 'ext4', 'cpio.gz']
+
+    def __init__(self, d):
+
+        super(QemuTarget, self).__init__(d)
+
+        self.image_fstype = self.get_image_fstype(d)
+        self.qemulog = os.path.join(self.testdir, "qemu_boot_log.%s" % self.datetime)
+        self.origrootfs = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True),  d.getVar("IMAGE_LINK_NAME", True) + '.' + self.image_fstype)
+        self.rootfs = os.path.join(self.testdir, d.getVar("IMAGE_LINK_NAME", True) + '-testimage.' + self.image_fstype)
+        self.kernel = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("KERNEL_IMAGETYPE", False) + '-' + d.getVar('MACHINE', False) + '.bin')
+        dump_target_cmds = d.getVar("testimage_dump_target", True)
+        dump_host_cmds = d.getVar("testimage_dump_host", True)
+        dump_dir = d.getVar("TESTIMAGE_DUMP_DIR", True)
+
+        # Log QemuRunner log output to a file
+        import oe.path
+        bb.utils.mkdirhier(self.testdir)
+        self.qemurunnerlog = os.path.join(self.testdir, 'qemurunner_log.%s' % self.datetime)
+        logger = logging.getLogger('BitBake.QemuRunner')
+        loggerhandler = logging.FileHandler(self.qemurunnerlog)
+        loggerhandler.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
+        logger.addHandler(loggerhandler)
+        oe.path.symlink(os.path.basename(self.qemurunnerlog), os.path.join(self.testdir, 'qemurunner_log'), force=True)
+
+        if d.getVar("DISTRO", True) == "poky-tiny":
+            self.runner = QemuTinyRunner(machine=d.getVar("MACHINE", True),
+                            rootfs=self.rootfs,
+                            tmpdir = d.getVar("TMPDIR", True),
+                            deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE", True),
+                            display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True),
+                            logfile = self.qemulog,
+                            kernel = self.kernel,
+                            boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True)))
+        else:
+            self.runner = QemuRunner(machine=d.getVar("MACHINE", True),
+                            rootfs=self.rootfs,
+                            tmpdir = d.getVar("TMPDIR", True),
+                            deploy_dir_image = d.getVar("DEPLOY_DIR_IMAGE", True),
+                            display = d.getVar("BB_ORIGENV", False).getVar("DISPLAY", True),
+                            logfile = self.qemulog,
+                            boottime = int(d.getVar("TEST_QEMUBOOT_TIMEOUT", True)),
+                            dump_dir = dump_dir,
+                            dump_host_cmds = d.getVar("testimage_dump_host", True))
+
+        self.target_dumper = TargetDumper(dump_target_cmds, dump_dir, self.runner)
+
+    def deploy(self):
+        try:
+            bb.utils.mkdirhier(self.testdir)
+            shutil.copyfile(self.origrootfs, self.rootfs)
+        except Exception as e:
+            bb.fatal("Error copying rootfs: %s" % e)
+
+        qemuloglink = os.path.join(self.testdir, "qemu_boot_log")
+        if os.path.islink(qemuloglink):
+            os.unlink(qemuloglink)
+        os.symlink(self.qemulog, qemuloglink)
+
+        bb.note("rootfs file: %s" %  self.rootfs)
+        bb.note("Qemu log file: %s" % self.qemulog)
+        super(QemuTarget, self).deploy()
+
+    def start(self, params=None):
+        if self.runner.start(params):
+            self.ip = self.runner.ip
+            self.server_ip = self.runner.server_ip
+            self.connection = SSHControl(ip=self.ip, logfile=self.sshlog)
+        else:
+            self.stop()
+            if os.path.exists(self.qemulog):
+                with open(self.qemulog, 'r') as f:
+                    bb.error("Qemu log output from %s:\n%s" % (self.qemulog, f.read()))
+            raise bb.build.FuncFailed("%s - FAILED to start qemu - check the task log and the boot log" % self.pn)
+
+    def check(self):
+        return self.runner.is_alive()
+
+    def stop(self):
+        self.runner.stop()
+        self.connection = None
+        self.ip = None
+        self.server_ip = None
+
+    def restart(self, params=None):
+        if self.runner.restart(params):
+            self.ip = self.runner.ip
+            self.server_ip = self.runner.server_ip
+            self.connection = SSHControl(ip=self.ip, logfile=self.sshlog)
+        else:
+            raise bb.build.FuncFailed("%s - FAILED to re-start qemu - check the task log and the boot log" % self.pn)
+
+    def run_serial(self, command):
+        return self.runner.run_serial(command)
+
+
+class SimpleRemoteTarget(BaseTarget):
+
+    def __init__(self, d):
+        super(SimpleRemoteTarget, self).__init__(d)
+        addr = d.getVar("TEST_TARGET_IP", True) or bb.fatal('Please set TEST_TARGET_IP with the IP address of the machine you want to run the tests on.')
+        self.ip = addr.split(":")[0]
+        try:
+            self.port = addr.split(":")[1]
+        except IndexError:
+            self.port = None
+        bb.note("Target IP: %s" % self.ip)
+        self.server_ip = d.getVar("TEST_SERVER_IP", True)
+        if not self.server_ip:
+            try:
+                self.server_ip = subprocess.check_output(['ip', 'route', 'get', self.ip ]).split("\n")[0].split()[-1]
+            except Exception as e:
+                bb.fatal("Failed to determine the host IP address (alternatively you can set TEST_SERVER_IP with the IP address of this machine): %s" % e)
+        bb.note("Server IP: %s" % self.server_ip)
+
+    def deploy(self):
+        super(SimpleRemoteTarget, self).deploy()
+
+    def start(self, params=None):
+        self.connection = SSHControl(self.ip, logfile=self.sshlog, port=self.port)
+
+    def stop(self):
+        self.connection = None
+        self.ip = None
+        self.server_ip = None
diff --git a/meta/lib/oeqa/utils/__init__.py b/meta/lib/oeqa/utils/__init__.py
new file mode 100644
index 0000000..2260046
--- /dev/null
+++ b/meta/lib/oeqa/utils/__init__.py
@@ -0,0 +1,15 @@
+# Enable other layers to have modules in the same named directory
+from pkgutil import extend_path
+__path__ = extend_path(__path__, __name__)
+
+
+# Borrowed from CalledProcessError
+
+class CommandError(Exception):
+    def __init__(self, retcode, cmd, output = None):
+        self.retcode = retcode
+        self.cmd = cmd
+        self.output = output
+    def __str__(self):
+        return "Command '%s' returned non-zero exit status %d with output: %s" % (self.cmd, self.retcode, self.output)
+
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
new file mode 100644
index 0000000..08e2cbb
--- /dev/null
+++ b/meta/lib/oeqa/utils/commands.py
@@ -0,0 +1,224 @@
+# Copyright (c) 2013-2014 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# DESCRIPTION
+# This module is mainly used by scripts/oe-selftest and modules under meta/oeqa/selftest
+# It provides a class and methods for running commands on the host in a convienent way for tests.
+
+
+
+import os
+import sys
+import signal
+import subprocess
+import threading
+import logging
+from oeqa.utils import CommandError
+from oeqa.utils import ftools
+import re
+import contextlib
+
+class Command(object):
+    def __init__(self, command, bg=False, timeout=None, data=None, **options):
+
+        self.defaultopts = {
+            "stdout": subprocess.PIPE,
+            "stderr": subprocess.STDOUT,
+            "stdin": None,
+            "shell": False,
+            "bufsize": -1,
+        }
+
+        self.cmd = command
+        self.bg = bg
+        self.timeout = timeout
+        self.data = data
+
+        self.options = dict(self.defaultopts)
+        if isinstance(self.cmd, basestring):
+            self.options["shell"] = True
+        if self.data:
+            self.options['stdin'] = subprocess.PIPE
+        self.options.update(options)
+
+        self.status = None
+        self.output = None
+        self.error = None
+        self.thread = None
+
+        self.log = logging.getLogger("utils.commands")
+
+    def run(self):
+        self.process = subprocess.Popen(self.cmd, **self.options)
+
+        def commThread():
+            self.output, self.error = self.process.communicate(self.data)
+
+        self.thread = threading.Thread(target=commThread)
+        self.thread.start()
+
+        self.log.debug("Running command '%s'" % self.cmd)
+
+        if not self.bg:
+            self.thread.join(self.timeout)
+            self.stop()
+
+    def stop(self):
+        if self.thread.isAlive():
+            self.process.terminate()
+            # let's give it more time to terminate gracefully before killing it
+            self.thread.join(5)
+            if self.thread.isAlive():
+                self.process.kill()
+                self.thread.join()
+
+        self.output = self.output.rstrip()
+        self.status = self.process.poll()
+
+        self.log.debug("Command '%s' returned %d as exit code." % (self.cmd, self.status))
+        # logging the complete output is insane
+        # bitbake -e output is really big
+        # and makes the log file useless
+        if self.status:
+            lout = "\n".join(self.output.splitlines()[-20:])
+            self.log.debug("Last 20 lines:\n%s" % lout)
+
+
+class Result(object):
+    pass
+
+
+def runCmd(command, ignore_status=False, timeout=None, assert_error=True, **options):
+    result = Result()
+
+    cmd = Command(command, timeout=timeout, **options)
+    cmd.run()
+
+    result.command = command
+    result.status = cmd.status
+    result.output = cmd.output
+    result.pid = cmd.process.pid
+
+    if result.status and not ignore_status:
+        if assert_error:
+            raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, result.output))
+        else:
+            raise CommandError(result.status, command, result.output)
+
+    return result
+
+
+def bitbake(command, ignore_status=False, timeout=None, postconfig=None, **options):
+
+    if postconfig:
+        postconfig_file = os.path.join(os.environ.get('BUILDDIR'), 'oeqa-post.conf')
+        ftools.write_file(postconfig_file, postconfig)
+        extra_args = "-R %s" % postconfig_file
+    else:
+        extra_args = ""
+
+    if isinstance(command, basestring):
+        cmd = "bitbake " + extra_args + " " + command
+    else:
+        cmd = [ "bitbake" ] + [a for a in (command + extra_args.split(" ")) if a not in [""]]
+
+    try:
+        return runCmd(cmd, ignore_status, timeout, **options)
+    finally:
+        if postconfig:
+            os.remove(postconfig_file)
+
+
+def get_bb_env(target=None, postconfig=None):
+    if target:
+        return bitbake("-e %s" % target, postconfig=postconfig).output
+    else:
+        return bitbake("-e", postconfig=postconfig).output
+
+def get_bb_var(var, target=None, postconfig=None):
+    val = None
+    bbenv = get_bb_env(target, postconfig=postconfig)
+    lastline = None
+    for line in bbenv.splitlines():
+        if re.search("^(export )?%s=" % var, line):
+            val = line.split('=', 1)[1]
+            val = val.strip('\"')
+            break
+        elif re.match("unset %s$" % var, line):
+            # Handle [unexport] variables
+            if lastline.startswith('#   "'):
+                val = lastline.split('\"')[1]
+                break
+        lastline = line
+    return val
+
+def get_test_layer():
+    layers = get_bb_var("BBLAYERS").split()
+    testlayer = None
+    for l in layers:
+        if '~' in l:
+            l = os.path.expanduser(l)
+        if "/meta-selftest" in l and os.path.isdir(l):
+            testlayer = l
+            break
+    return testlayer
+
+def create_temp_layer(templayerdir, templayername, priority=999, recipepathspec='recipes-*/*'):
+    os.makedirs(os.path.join(templayerdir, 'conf'))
+    with open(os.path.join(templayerdir, 'conf', 'layer.conf'), 'w') as f:
+        f.write('BBPATH .= ":${LAYERDIR}"\n')
+        f.write('BBFILES += "${LAYERDIR}/%s/*.bb \\' % recipepathspec)
+        f.write('            ${LAYERDIR}/%s/*.bbappend"\n' % recipepathspec)
+        f.write('BBFILE_COLLECTIONS += "%s"\n' % templayername)
+        f.write('BBFILE_PATTERN_%s = "^${LAYERDIR}/"\n' % templayername)
+        f.write('BBFILE_PRIORITY_%s = "%d"\n' % (templayername, priority))
+        f.write('BBFILE_PATTERN_IGNORE_EMPTY_%s = "1"\n' % templayername)
+
+
+@contextlib.contextmanager
+def runqemu(pn, test):
+
+    import bb.tinfoil
+    import bb.build
+
+    tinfoil = bb.tinfoil.Tinfoil()
+    tinfoil.prepare(False)
+    try:
+        tinfoil.logger.setLevel(logging.WARNING)
+        import oeqa.targetcontrol
+        tinfoil.config_data.setVar("TEST_LOG_DIR", "${WORKDIR}/testimage")
+        tinfoil.config_data.setVar("TEST_QEMUBOOT_TIMEOUT", "1000")
+        import oe.recipeutils
+        recipefile = oe.recipeutils.pn_to_recipe(tinfoil.cooker, pn)
+        recipedata = oe.recipeutils.parse_recipe(recipefile, [], tinfoil.config_data)
+
+        # The QemuRunner log is saved out, but we need to ensure it is at the right
+        # log level (and then ensure that since it's a child of the BitBake logger,
+        # we disable propagation so we don't then see the log events on the console)
+        logger = logging.getLogger('BitBake.QemuRunner')
+        logger.setLevel(logging.DEBUG)
+        logger.propagate = False
+        logdir = recipedata.getVar("TEST_LOG_DIR", True)
+
+        qemu = oeqa.targetcontrol.QemuTarget(recipedata)
+    finally:
+        # We need to shut down tinfoil early here in case we actually want
+        # to run tinfoil-using utilities with the running QEMU instance.
+        # Luckily QemuTarget doesn't need it after the constructor.
+        tinfoil.shutdown()
+
+    try:
+        qemu.deploy()
+        try:
+            qemu.start()
+        except bb.build.FuncFailed:
+            raise Exception('Failed to start QEMU - see the logs in %s' % logdir)
+
+        yield qemu
+
+    finally:
+        try:
+            qemu.stop()
+        except:
+            pass
diff --git a/meta/lib/oeqa/utils/decorators.py b/meta/lib/oeqa/utils/decorators.py
new file mode 100644
index 0000000..162a88f
--- /dev/null
+++ b/meta/lib/oeqa/utils/decorators.py
@@ -0,0 +1,222 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Some custom decorators that can be used by unittests
+# Most useful is skipUnlessPassed which can be used for
+# creating dependecies between two test methods.
+
+import os
+import logging
+import sys
+import unittest
+import threading
+import signal
+from functools import wraps
+
+#get the "result" object from one of the upper frames provided that one of these upper frames is a unittest.case frame
+class getResults(object):
+    def __init__(self):
+        #dynamically determine the unittest.case frame and use it to get the name of the test method
+        ident = threading.current_thread().ident
+        upperf = sys._current_frames()[ident]
+        while (upperf.f_globals['__name__'] != 'unittest.case'):
+            upperf = upperf.f_back
+
+        def handleList(items):
+            ret = []
+            # items is a list of tuples, (test, failure) or (_ErrorHandler(), Exception())
+            for i in items:
+                s = i[0].id()
+                #Handle the _ErrorHolder objects from skipModule failures
+                if "setUpModule (" in s:
+                    ret.append(s.replace("setUpModule (", "").replace(")",""))
+                else:
+                    ret.append(s)
+            return ret
+        self.faillist = handleList(upperf.f_locals['result'].failures)
+        self.errorlist = handleList(upperf.f_locals['result'].errors)
+        self.skiplist = handleList(upperf.f_locals['result'].skipped)
+
+    def getFailList(self):
+        return self.faillist
+
+    def getErrorList(self):
+        return self.errorlist
+
+    def getSkipList(self):
+        return self.skiplist
+
+class skipIfFailure(object):
+
+    def __init__(self,testcase):
+        self.testcase = testcase
+
+    def __call__(self,f):
+        def wrapped_f(*args):
+            res = getResults()
+            if self.testcase in (res.getFailList() or res.getErrorList()):
+                raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
+            return f(*args)
+        wrapped_f.__name__ = f.__name__
+        return wrapped_f
+
+class skipIfSkipped(object):
+
+    def __init__(self,testcase):
+        self.testcase = testcase
+
+    def __call__(self,f):
+        def wrapped_f(*args):
+            res = getResults()
+            if self.testcase in res.getSkipList():
+                raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
+            return f(*args)
+        wrapped_f.__name__ = f.__name__
+        return wrapped_f
+
+class skipUnlessPassed(object):
+
+    def __init__(self,testcase):
+        self.testcase = testcase
+
+    def __call__(self,f):
+        def wrapped_f(*args):
+            res = getResults()
+            if self.testcase in res.getSkipList() or \
+                    self.testcase in res.getFailList() or \
+                    self.testcase in res.getErrorList():
+                raise unittest.SkipTest("Testcase dependency not met: %s" % self.testcase)
+            return f(*args)
+        wrapped_f.__name__ = f.__name__
+        wrapped_f._depends_on = self.testcase
+        return wrapped_f
+
+class testcase(object):
+
+    def __init__(self, test_case):
+        self.test_case = test_case
+
+    def __call__(self, func):
+        def wrapped_f(*args):
+            return func(*args)
+        wrapped_f.test_case = self.test_case
+        wrapped_f.__name__ = func.__name__
+        return wrapped_f
+
+class NoParsingFilter(logging.Filter):
+    def filter(self, record):
+        return record.levelno == 100
+
+def LogResults(original_class):
+    orig_method = original_class.run
+
+    #rewrite the run method of unittest.TestCase to add testcase logging
+    def run(self, result, *args, **kws):
+        orig_method(self, result, *args, **kws)
+        passed = True
+        testMethod = getattr(self, self._testMethodName)
+        #if test case is decorated then use it's number, else use it's name
+        try:
+            test_case = testMethod.test_case
+        except AttributeError:
+            test_case = self._testMethodName
+
+        class_name = str(testMethod.im_class).split("'")[1]
+
+        #create custom logging level for filtering.
+        custom_log_level = 100
+        logging.addLevelName(custom_log_level, 'RESULTS')
+        caller = os.path.basename(sys.argv[0])
+
+        def results(self, message, *args, **kws):
+            if self.isEnabledFor(custom_log_level):
+                self.log(custom_log_level, message, *args, **kws)
+        logging.Logger.results = results
+
+        logging.basicConfig(filename=os.path.join(os.getcwd(),'results-'+caller+'.log'),
+                            filemode='w',
+                            format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
+                            datefmt='%H:%M:%S',
+                            level=custom_log_level)
+        for handler in logging.root.handlers:
+            handler.addFilter(NoParsingFilter())
+        local_log = logging.getLogger(caller)
+
+        #check status of tests and record it
+
+        for (name, msg) in result.errors:
+            if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+                local_log.results("Testcase "+str(test_case)+": ERROR")
+                local_log.results("Testcase "+str(test_case)+":\n"+msg)
+                passed = False
+        for (name, msg) in result.failures:
+            if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+                local_log.results("Testcase "+str(test_case)+": FAILED")
+                local_log.results("Testcase "+str(test_case)+":\n"+msg)
+                passed = False
+        for (name, msg) in result.skipped:
+            if (self._testMethodName == str(name).split(' ')[0]) and (class_name in str(name).split(' ')[1]):
+                local_log.results("Testcase "+str(test_case)+": SKIPPED")
+                passed = False
+        if passed:
+            local_log.results("Testcase "+str(test_case)+": PASSED")
+
+    original_class.run = run
+    return original_class
+
+class TimeOut(BaseException):
+    pass
+
+def timeout(seconds):
+    def decorator(fn):
+        if hasattr(signal, 'alarm'):
+            @wraps(fn)
+            def wrapped_f(*args, **kw):
+                current_frame = sys._getframe()
+                def raiseTimeOut(signal, frame):
+                    if frame is not current_frame:
+                        raise TimeOut('%s seconds' % seconds)
+                prev_handler = signal.signal(signal.SIGALRM, raiseTimeOut)
+                try:
+                    signal.alarm(seconds)
+                    return fn(*args, **kw)
+                finally:
+                    signal.alarm(0)
+                    signal.signal(signal.SIGALRM, prev_handler)
+            return wrapped_f
+        else:
+            return fn
+    return decorator
+
+__tag_prefix = "tag__"
+def tag(*args, **kwargs):
+    """Decorator that adds attributes to classes or functions
+    for use with the Attribute (-a) plugin.
+    """
+    def wrap_ob(ob):
+        for name in args:
+            setattr(ob, __tag_prefix + name, True)
+        for name, value in kwargs.iteritems():
+            setattr(ob, __tag_prefix + name, value)
+        return ob
+    return wrap_ob
+
+def gettag(obj, key, default=None):
+    key = __tag_prefix + key
+    if not isinstance(obj, unittest.TestCase):
+        return getattr(obj, key, default)
+    tc_method = getattr(obj, obj._testMethodName)
+    ret = getattr(tc_method, key, getattr(obj, key, default))
+    return ret
+
+def getAllTags(obj):
+    def __gettags(o):
+        r = {k[len(__tag_prefix):]:getattr(o,k) for k in dir(o) if k.startswith(__tag_prefix)}
+        return r
+    if not isinstance(obj, unittest.TestCase):
+        return __gettags(obj)
+    tc_method = getattr(obj, obj._testMethodName)
+    ret = __gettags(obj)
+    ret.update(__gettags(tc_method))
+    return ret
diff --git a/meta/lib/oeqa/utils/dump.py b/meta/lib/oeqa/utils/dump.py
new file mode 100644
index 0000000..4ae871c
--- /dev/null
+++ b/meta/lib/oeqa/utils/dump.py
@@ -0,0 +1,87 @@
+import os
+import sys
+import errno
+import datetime
+import itertools
+from commands import runCmd
+
+def get_host_dumper(d):
+    cmds = d.getVar("testimage_dump_host", True)
+    parent_dir = d.getVar("TESTIMAGE_DUMP_DIR", True)
+    return HostDumper(cmds, parent_dir)
+
+
+class BaseDumper(object):
+    """ Base class to dump commands from host/target """
+
+    def __init__(self, cmds, parent_dir):
+        self.cmds = []
+        self.parent_dir = parent_dir
+        if not cmds:
+            return
+        for cmd in cmds.split('\n'):
+            cmd = cmd.lstrip()
+            if not cmd or cmd[0] == '#':
+                continue
+            self.cmds.append(cmd)
+
+    def create_dir(self, dir_suffix):
+        dump_subdir = ("%s_%s" % (
+                datetime.datetime.now().strftime('%Y%m%d%H%M'),
+                dir_suffix))
+        dump_dir = os.path.join(self.parent_dir, dump_subdir)
+        try:
+            os.makedirs(dump_dir)
+        except OSError as err:
+            if err.errno != errno.EEXIST:
+                raise err
+        self.dump_dir = dump_dir
+
+    def _write_dump(self, command, output):
+        if isinstance(self, HostDumper):
+            prefix = "host"
+        elif isinstance(self, TargetDumper):
+            prefix = "target"
+        else:
+            prefix = "unknown"
+        for i in itertools.count():
+            filename = "%s_%02d_%s" % (prefix, i, command)
+            fullname = os.path.join(self.dump_dir, filename)
+            if not os.path.exists(fullname):
+                break
+        with open(fullname, 'w') as dump_file:
+            dump_file.write(output)
+
+
+class HostDumper(BaseDumper):
+    """ Class to get dumps from the host running the tests """
+
+    def __init__(self, cmds, parent_dir):
+        super(HostDumper, self).__init__(cmds, parent_dir)
+
+    def dump_host(self, dump_dir=""):
+        if dump_dir:
+            self.dump_dir = dump_dir
+        for cmd in self.cmds:
+            result = runCmd(cmd, ignore_status=True)
+            self._write_dump(cmd.split()[0], result.output)
+
+
+class TargetDumper(BaseDumper):
+    """ Class to get dumps from target, it only works with QemuRunner """
+
+    def __init__(self, cmds, parent_dir, qemurunner):
+        super(TargetDumper, self).__init__(cmds, parent_dir)
+        self.runner = qemurunner
+
+    def dump_target(self, dump_dir=""):
+        if dump_dir:
+            self.dump_dir = dump_dir
+        for cmd in self.cmds:
+            # We can continue with the testing if serial commands fail
+            try:
+                (status, output) = self.runner.run_serial(cmd)
+                self._write_dump(cmd.split()[0], output)
+            except:
+                print("Tried to dump info from target but "
+                        "serial console failed")
diff --git a/meta/lib/oeqa/utils/ftools.py b/meta/lib/oeqa/utils/ftools.py
new file mode 100644
index 0000000..64ebe3d
--- /dev/null
+++ b/meta/lib/oeqa/utils/ftools.py
@@ -0,0 +1,27 @@
+import os
+import re
+
+def write_file(path, data):
+    wdata = data.rstrip() + "\n"
+    with open(path, "w") as f:
+        f.write(wdata)
+
+def append_file(path, data):
+    wdata = data.rstrip() + "\n"
+    with open(path, "a") as f:
+            f.write(wdata)
+
+def read_file(path):
+    data = None
+    with open(path) as f:
+        data = f.read()
+    return data
+
+def remove_from_file(path, data):
+    lines = read_file(path).splitlines()
+    rmdata = data.strip().splitlines()
+    for l in rmdata:
+        for c in range(0, lines.count(l)):
+            i = lines.index(l)
+            del(lines[i])
+    write_file(path, "\n".join(lines))
diff --git a/meta/lib/oeqa/utils/httpserver.py b/meta/lib/oeqa/utils/httpserver.py
new file mode 100644
index 0000000..76518d8
--- /dev/null
+++ b/meta/lib/oeqa/utils/httpserver.py
@@ -0,0 +1,35 @@
+import SimpleHTTPServer
+import multiprocessing
+import os
+
+class HTTPServer(SimpleHTTPServer.BaseHTTPServer.HTTPServer):
+
+    def server_start(self, root_dir):
+        import signal
+        signal.signal(signal.SIGTERM, signal.SIG_DFL)
+        os.chdir(root_dir)
+        self.serve_forever()
+
+class HTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
+
+    def log_message(self, format_str, *args):
+        pass
+
+class HTTPService(object):
+
+    def __init__(self, root_dir, host=''):
+        self.root_dir = root_dir
+        self.host = host
+        self.port = 0
+
+    def start(self):
+        self.server = HTTPServer((self.host, self.port), HTTPRequestHandler)
+        if self.port == 0:
+            self.port = self.server.server_port
+        self.process = multiprocessing.Process(target=self.server.server_start, args=[self.root_dir])
+        self.process.start()
+
+    def stop(self):
+        self.server.server_close()
+        self.process.terminate()
+        self.process.join()
diff --git a/meta/lib/oeqa/utils/logparser.py b/meta/lib/oeqa/utils/logparser.py
new file mode 100644
index 0000000..87b5035
--- /dev/null
+++ b/meta/lib/oeqa/utils/logparser.py
@@ -0,0 +1,125 @@
+#!/usr/bin/env python
+
+import sys
+import os
+import re
+import ftools
+
+
+# A parser that can be used to identify weather a line is a test result or a section statement.
+class Lparser(object):
+
+    def __init__(self, test_0_pass_regex, test_0_fail_regex, section_0_begin_regex=None, section_0_end_regex=None, **kwargs):
+        # Initialize the arguments dictionary
+        if kwargs:
+            self.args = kwargs
+        else:
+            self.args = {}
+
+        # Add the default args to the dictionary
+        self.args['test_0_pass_regex'] = test_0_pass_regex
+        self.args['test_0_fail_regex'] = test_0_fail_regex
+        if section_0_begin_regex:
+            self.args['section_0_begin_regex'] = section_0_begin_regex
+        if section_0_end_regex:
+            self.args['section_0_end_regex'] = section_0_end_regex
+
+        self.test_possible_status = ['pass', 'fail', 'error']
+        self.section_possible_status = ['begin', 'end']
+
+        self.initialized = False
+
+
+    # Initialize the parser with the current configuration
+    def init(self):
+
+        # extra arguments can be added by the user to define new test and section categories. They must follow a pre-defined pattern: <type>_<category_name>_<status>_regex
+        self.test_argument_pattern = "^test_(.+?)_(%s)_regex" % '|'.join(map(str, self.test_possible_status))
+        self.section_argument_pattern = "^section_(.+?)_(%s)_regex" % '|'.join(map(str, self.section_possible_status))
+
+        # Initialize the test and section regex dictionaries
+        self.test_regex = {}
+        self.section_regex ={}
+
+        for arg, value in self.args.items():
+            if not value:
+                raise Exception('The value of provided argument %s is %s. Should have a valid value.' % (key, value))
+            is_test =  re.search(self.test_argument_pattern, arg)
+            is_section = re.search(self.section_argument_pattern, arg)
+            if is_test:
+                if not is_test.group(1) in self.test_regex:
+                    self.test_regex[is_test.group(1)] = {}
+                self.test_regex[is_test.group(1)][is_test.group(2)] = re.compile(value)
+            elif is_section:
+                if not is_section.group(1) in self.section_regex:
+                    self.section_regex[is_section.group(1)] = {}
+                self.section_regex[is_section.group(1)][is_section.group(2)] = re.compile(value)
+            else:
+                # TODO: Make these call a traceback instead of a simple exception..
+                raise Exception("The provided argument name does not correspond to any valid type. Please give one of the following types:\nfor tests: %s\nfor sections: %s" % (self.test_argument_pattern, self.section_argument_pattern))
+
+        self.initialized = True
+
+    # Parse a line and return a tuple containing the type of result (test/section) and its category, status and name
+    def parse_line(self, line):
+        if not self.initialized:
+            raise Exception("The parser is not initialized..")
+
+        for test_category, test_status_list in self.test_regex.items():
+            for test_status, status_regex in test_status_list.items():
+                test_name = status_regex.search(line)
+                if test_name:
+                    return ['test', test_category, test_status, test_name.group(1)]
+
+        for section_category, section_status_list in self.section_regex.items():
+            for section_status, status_regex in section_status_list.items():
+                section_name = status_regex.search(line)
+                if section_name:
+                    return ['section', section_category, section_status, section_name.group(1)]
+        return None
+
+
+class Result(object):
+
+    def __init__(self):
+        self.result_dict = {}
+
+    def store(self, section, test, status):
+        if not section in self.result_dict:
+            self.result_dict[section] = []
+
+        self.result_dict[section].append((test, status))
+
+    # sort tests by the test name(the first element of the tuple), for each section. This can be helpful when using git to diff for changes by making sure they are always in the same order.
+    def sort_tests(self):
+        for package in self.result_dict:
+            sorted_results = sorted(self.result_dict[package], key=lambda tup: tup[0])
+            self.result_dict[package] = sorted_results
+
+    # Log the results as files. The file name is the section name and the contents are the tests in that section.
+    def log_as_files(self, target_dir, test_status):
+        status_regex = re.compile('|'.join(map(str, test_status)))
+        if not type(test_status) == type([]):
+            raise Exception("test_status should be a list. Got " + str(test_status) + " instead.")
+        if not os.path.exists(target_dir):
+            raise Exception("Target directory does not exist: %s" % target_dir)
+
+        for section, test_results in self.result_dict.items():
+            prefix = ''
+            for x in test_status:
+                prefix +=x+'.'
+            if (section != ''):
+                prefix += section
+            section_file = os.path.join(target_dir, prefix)
+            # purge the file contents if it exists
+            open(section_file, 'w').close()
+            for test_result in test_results:
+                (test_name, status) = test_result
+                # we log only the tests with status in the test_status list
+                match_status = status_regex.search(status)
+                if match_status:
+                    ftools.append_file(section_file, status + ": " + test_name)
+
+    # Not yet implemented!
+    def log_to_lava(self):
+        pass
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
new file mode 100644
index 0000000..d32c9db
--- /dev/null
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -0,0 +1,519 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module provides a class for starting qemu images using runqemu.
+# It's used by testimage.bbclass.
+
+import subprocess
+import os
+import time
+import signal
+import re
+import socket
+import select
+import errno
+import threading
+from oeqa.utils.dump import HostDumper
+
+import logging
+logger = logging.getLogger("BitBake.QemuRunner")
+
+class QemuRunner:
+
+    def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, boottime, dump_dir, dump_host_cmds):
+
+        # Popen object for runqemu
+        self.runqemu = None
+        # pid of the qemu process that runqemu will start
+        self.qemupid = None
+        # target ip - from the command line
+        self.ip = None
+        # host ip - where qemu is running
+        self.server_ip = None
+
+        self.machine = machine
+        self.rootfs = rootfs
+        self.display = display
+        self.tmpdir = tmpdir
+        self.deploy_dir_image = deploy_dir_image
+        self.logfile = logfile
+        self.boottime = boottime
+        self.logged = False
+        self.thread = None
+
+        self.runqemutime = 60
+        self.host_dumper = HostDumper(dump_host_cmds, dump_dir)
+
+    def create_socket(self):
+        try:
+            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+            sock.setblocking(0)
+            sock.bind(("127.0.0.1",0))
+            sock.listen(2)
+            port = sock.getsockname()[1]
+            logger.info("Created listening socket for qemu serial console on: 127.0.0.1:%s" % port)
+            return (sock, port)
+
+        except socket.error:
+            sock.close()
+            raise
+
+    def log(self, msg):
+        if self.logfile:
+            with open(self.logfile, "a") as f:
+                f.write("%s" % msg)
+
+    def getOutput(self, o):
+        import fcntl
+        fl = fcntl.fcntl(o, fcntl.F_GETFL)
+        fcntl.fcntl(o, fcntl.F_SETFL, fl | os.O_NONBLOCK)
+        return os.read(o.fileno(), 1000000)
+
+
+    def handleSIGCHLD(self, signum, frame):
+        if self.runqemu and self.runqemu.poll():
+            if self.runqemu.returncode:
+                logger.info('runqemu exited with code %d' % self.runqemu.returncode)
+                logger.info("Output from runqemu:\n%s" % self.getOutput(self.runqemu.stdout))
+                self.stop()
+                self._dump_host()
+                raise SystemExit
+
+    def start(self, qemuparams = None):
+        if self.display:
+            os.environ["DISPLAY"] = self.display
+        else:
+            logger.error("To start qemu I need a X desktop, please set DISPLAY correctly (e.g. DISPLAY=:1)")
+            return False
+        if not os.path.exists(self.rootfs):
+            logger.error("Invalid rootfs %s" % self.rootfs)
+            return False
+        if not os.path.exists(self.tmpdir):
+            logger.error("Invalid TMPDIR path %s" % self.tmpdir)
+            return False
+        else:
+            os.environ["OE_TMPDIR"] = self.tmpdir
+        if not os.path.exists(self.deploy_dir_image):
+            logger.error("Invalid DEPLOY_DIR_IMAGE path %s" % self.deploy_dir_image)
+            return False
+        else:
+            os.environ["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image
+
+        try:
+            threadsock, threadport = self.create_socket()
+            self.server_socket, self.serverport = self.create_socket()
+        except socket.error, msg:
+            logger.error("Failed to create listening socket: %s" % msg[1])
+            return False
+
+        # Set this flag so that Qemu doesn't do any grabs as SDL grabs interact
+        # badly with screensavers.
+        os.environ["QEMU_DONT_GRAB"] = "1"
+        self.qemuparams = 'bootparams="console=tty1 console=ttyS0,115200n8" qemuparams="-serial tcp:127.0.0.1:{}"'.format(threadport)
+        if qemuparams:
+            self.qemuparams = self.qemuparams[:-1] + " " + qemuparams + " " + '\"'
+
+        self.origchldhandler = signal.getsignal(signal.SIGCHLD)
+        signal.signal(signal.SIGCHLD, self.handleSIGCHLD)
+
+        launch_cmd = 'runqemu tcpserial=%s %s %s %s' % (self.serverport, self.machine, self.rootfs, self.qemuparams)
+        # FIXME: We pass in stdin=subprocess.PIPE here to work around stty
+        # blocking at the end of the runqemu script when using this within
+        # oe-selftest (this makes stty error out immediately). There ought
+        # to be a proper fix but this will suffice for now.
+        self.runqemu = subprocess.Popen(launch_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, preexec_fn=os.setpgrp)
+        output = self.runqemu.stdout
+
+        #
+        # We need the preexec_fn above so that all runqemu processes can easily be killed 
+        # (by killing their process group). This presents a problem if this controlling
+        # process itself is killed however since those processes don't notice the death 
+        # of the parent and merrily continue on.
+        #
+        # Rather than hack runqemu to deal with this, we add something here instead. 
+        # Basically we fork off another process which holds an open pipe to the parent
+        # and also is setpgrp. If/when the pipe sees EOF from the parent dieing, it kills
+        # the process group. This is like pctrl's PDEATHSIG but for a process group
+        # rather than a single process.
+        #
+        r, w = os.pipe()
+        self.monitorpid = os.fork()
+        if self.monitorpid:
+            os.close(r)
+            self.monitorpipe = os.fdopen(w, "w")
+        else:
+            # child process
+            os.setpgrp()
+            os.close(w)
+            r = os.fdopen(r)
+            x = r.read()
+            os.killpg(os.getpgid(self.runqemu.pid), signal.SIGTERM)
+            sys.exit(0)
+
+        logger.info("runqemu started, pid is %s" % self.runqemu.pid)
+        logger.info("waiting at most %s seconds for qemu pid" % self.runqemutime)
+        endtime = time.time() + self.runqemutime
+        while not self.is_alive() and time.time() < endtime:
+            if self.runqemu.poll():
+                if self.runqemu.returncode:
+                    # No point waiting any longer
+                    logger.info('runqemu exited with code %d' % self.runqemu.returncode)
+                    self._dump_host()
+                    self.stop()
+                    logger.info("Output from runqemu:\n%s" % self.getOutput(output))
+                    return False
+            time.sleep(1)
+
+        if self.is_alive():
+            logger.info("qemu started - qemu procces pid is %s" % self.qemupid)
+            cmdline = ''
+            with open('/proc/%s/cmdline' % self.qemupid) as p:
+                cmdline = p.read()
+            try:
+                ips = re.findall("((?:[0-9]{1,3}\.){3}[0-9]{1,3})", cmdline.split("ip=")[1])
+                if not ips or len(ips) != 3:
+                    raise ValueError
+                else:
+                    self.ip = ips[0]
+                    self.server_ip = ips[1]
+            except IndexError, ValueError:
+                logger.info("Couldn't get ip from qemu process arguments! Here is the qemu command line used:\n%s\nand output from runqemu:\n%s" % (cmdline, self.getOutput(output)))
+                self._dump_host()
+                self.stop()
+                return False
+            logger.info("qemu cmdline used:\n{}".format(cmdline))
+            logger.info("Target IP: %s" % self.ip)
+            logger.info("Server IP: %s" % self.server_ip)
+
+            logger.info("Starting logging thread")
+            self.thread = LoggingThread(self.log, threadsock, logger)
+            self.thread.start()
+            if not self.thread.connection_established.wait(self.boottime):
+                logger.error("Didn't receive a console connection from qemu. "
+                             "Here is the qemu command line used:\n%s\nand "
+                             "output from runqemu:\n%s" % (cmdline,
+                                                           self.getOutput(output)))
+                self.stop_thread()
+                return False
+
+            logger.info("Waiting at most %d seconds for login banner" % self.boottime)
+            endtime = time.time() + self.boottime
+            socklist = [self.server_socket]
+            reachedlogin = False
+            stopread = False
+            qemusock = None
+            bootlog = ''
+            while time.time() < endtime and not stopread:
+                sread, swrite, serror = select.select(socklist, [], [], 5)
+                for sock in sread:
+                    if sock is self.server_socket:
+                        qemusock, addr = self.server_socket.accept()
+                        qemusock.setblocking(0)
+                        socklist.append(qemusock)
+                        socklist.remove(self.server_socket)
+                        logger.info("Connection from %s:%s" % addr)
+                    else:
+                        data = sock.recv(1024)
+                        if data:
+                            bootlog += data
+                            if re.search(".* login:", bootlog):
+                                self.server_socket = qemusock
+                                stopread = True
+                                reachedlogin = True
+                                logger.info("Reached login banner")
+                        else:
+                            socklist.remove(sock)
+                            sock.close()
+                            stopread = True
+
+            if not reachedlogin:
+                logger.info("Target didn't reached login boot in %d seconds" % self.boottime)
+                lines = "\n".join(bootlog.splitlines()[-25:])
+                logger.info("Last 25 lines of text:\n%s" % lines)
+                logger.info("Check full boot log: %s" % self.logfile)
+                self._dump_host()
+                self.stop()
+                return False
+
+            # If we are not able to login the tests can continue
+            try:
+                (status, output) = self.run_serial("root\n", raw=True)
+                if re.search("root@[a-zA-Z0-9\-]+:~#", output):
+                    self.logged = True
+                    logger.info("Logged as root in serial console")
+                else:
+                    logger.info("Couldn't login into serial console"
+                            " as root using blank password")
+            except:
+                logger.info("Serial console failed while trying to login")
+
+        else:
+            logger.info("Qemu pid didn't appeared in %s seconds" % self.runqemutime)
+            self._dump_host()
+            self.stop()
+            logger.info("Output from runqemu:\n%s" % self.getOutput(output))
+            return False
+
+        return self.is_alive()
+
+    def stop(self):
+        self.stop_thread()
+        if self.runqemu:
+            signal.signal(signal.SIGCHLD, self.origchldhandler)
+            os.kill(self.monitorpid, signal.SIGKILL)
+            logger.info("Sending SIGTERM to runqemu")
+            try:
+                os.killpg(os.getpgid(self.runqemu.pid), signal.SIGTERM)
+            except OSError as e:
+                if e.errno != errno.ESRCH:
+                    raise
+            endtime = time.time() + self.runqemutime
+            while self.runqemu.poll() is None and time.time() < endtime:
+                time.sleep(1)
+            if self.runqemu.poll() is None:
+                logger.info("Sending SIGKILL to runqemu")
+                os.killpg(os.getpgid(self.runqemu.pid), signal.SIGKILL)
+            self.runqemu = None
+        if hasattr(self, 'server_socket') and self.server_socket:
+            self.server_socket.close()
+            self.server_socket = None
+        self.qemupid = None
+        self.ip = None
+        signal.signal(signal.SIGCHLD, self.origchldhandler)
+
+    def stop_thread(self):
+        if self.thread and self.thread.is_alive():
+            self.thread.stop()
+            self.thread.join()
+
+    def restart(self, qemuparams = None):
+        logger.info("Restarting qemu process")
+        if self.runqemu.poll() is None:
+            self.stop()
+        if self.start(qemuparams):
+            return True
+        return False
+
+    def is_alive(self):
+        if not self.runqemu:
+            return False
+        qemu_child = self.find_child(str(self.runqemu.pid))
+        if qemu_child:
+            self.qemupid = qemu_child[0]
+            if os.path.exists("/proc/" + str(self.qemupid)):
+                return True
+        return False
+
+    def find_child(self,parent_pid):
+        #
+        # Walk the process tree from the process specified looking for a qemu-system. Return its [pid'cmd]
+        #
+        ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,command'], stdout=subprocess.PIPE).communicate()[0]
+        processes = ps.split('\n')
+        nfields = len(processes[0].split()) - 1
+        pids = {}
+        commands = {}
+        for row in processes[1:]:
+            data = row.split(None, nfields)
+            if len(data) != 3:
+                continue
+            if data[1] not in pids:
+                pids[data[1]] = []
+
+            pids[data[1]].append(data[0])
+            commands[data[0]] = data[2]
+
+        if parent_pid not in pids:
+            return []
+
+        parents = []
+        newparents = pids[parent_pid]
+        while newparents:
+            next = []
+            for p in newparents:
+                if p in pids:
+                    for n in pids[p]:
+                        if n not in parents and n not in next:
+                            next.append(n)
+                if p not in parents:
+                    parents.append(p)
+                    newparents = next
+        #print "Children matching %s:" % str(parents)
+        for p in parents:
+            # Need to be careful here since runqemu-internal runs "ldd qemu-system-xxxx"
+            # Also, old versions of ldd (2.11) run "LD_XXXX qemu-system-xxxx"
+            basecmd = commands[p].split()[0]
+            basecmd = os.path.basename(basecmd)
+            if "qemu-system" in basecmd and "-serial tcp" in commands[p]:
+                return [int(p),commands[p]]
+
+    def run_serial(self, command, raw=False):
+        # We assume target system have echo to get command status
+        if not raw:
+            command = "%s; echo $?\n" % command
+        self.server_socket.sendall(command)
+        data = ''
+        status = 0
+        stopread = False
+        endtime = time.time()+5
+        while time.time()<endtime and not stopread:
+            sread, _, _ = select.select([self.server_socket],[],[],5)
+            for sock in sread:
+                answer = sock.recv(1024)
+                if answer:
+                    data += answer
+                    # Search the prompt to stop
+                    if re.search("[a-zA-Z0-9]+@[a-zA-Z0-9\-]+:~#", data):
+                        stopread = True
+                        break
+                else:
+                    raise Exception("No data on serial console socket")
+        if data:
+            if raw:
+                status = 1
+            else:
+                # Remove first line (command line) and last line (prompt)
+                data = data[data.find('$?\r\n')+4:data.rfind('\r\n')]
+                index = data.rfind('\r\n')
+                if index == -1:
+                    status_cmd = data
+                    data = ""
+                else:
+                    status_cmd = data[index+2:]
+                    data = data[:index]
+                if (status_cmd == "0"):
+                    status = 1
+        return (status, str(data))
+
+
+    def _dump_host(self):
+        self.host_dumper.create_dir("qemu")
+        logger.warn("Qemu ended unexpectedly, dump data from host"
+                " is in %s" % self.host_dumper.dump_dir)
+        self.host_dumper.dump_host()
+
+# This class is for reading data from a socket and passing it to logfunc
+# to be processed. It's completely event driven and has a straightforward
+# event loop. The mechanism for stopping the thread is a simple pipe which
+# will wake up the poll and allow for tearing everything down.
+class LoggingThread(threading.Thread):
+    def __init__(self, logfunc, sock, logger):
+        self.connection_established = threading.Event()
+        self.serversock = sock
+        self.logfunc = logfunc
+        self.logger = logger
+        self.readsock = None
+        self.running = False
+
+        self.errorevents = select.POLLERR | select.POLLHUP | select.POLLNVAL
+        self.readevents = select.POLLIN | select.POLLPRI
+
+        threading.Thread.__init__(self, target=self.threadtarget)
+
+    def threadtarget(self):
+        try:
+            self.eventloop()
+        finally:
+            self.teardown()
+
+    def run(self):
+        self.logger.info("Starting logging thread")
+        self.readpipe, self.writepipe = os.pipe()
+        threading.Thread.run(self)
+
+    def stop(self):
+        self.logger.info("Stopping logging thread")
+        if self.running:
+            os.write(self.writepipe, "stop")
+
+    def teardown(self):
+        self.logger.info("Tearing down logging thread")
+        self.close_socket(self.serversock)
+
+        if self.readsock is not None:
+            self.close_socket(self.readsock)
+
+        self.close_ignore_error(self.readpipe)
+        self.close_ignore_error(self.writepipe)
+        self.running = False
+
+    def eventloop(self):
+        poll = select.poll()
+        eventmask = self.errorevents | self.readevents
+        poll.register(self.serversock.fileno())
+        poll.register(self.readpipe, eventmask)
+
+        breakout = False
+        self.running = True
+        self.logger.info("Starting thread event loop")
+        while not breakout:
+            events = poll.poll()
+            for event in events:
+                # An error occurred, bail out
+                if event[1] & self.errorevents:
+                    raise Exception(self.stringify_event(event[1]))
+
+                # Event to stop the thread
+                if self.readpipe == event[0]:
+                    self.logger.info("Stop event received")
+                    breakout = True
+                    break
+
+                # A connection request was received
+                elif self.serversock.fileno() == event[0]:
+                    self.logger.info("Connection request received")
+                    self.readsock, _ = self.serversock.accept()
+                    self.readsock.setblocking(0)
+                    poll.unregister(self.serversock.fileno())
+                    poll.register(self.readsock.fileno())
+
+                    self.logger.info("Setting connection established event")
+                    self.connection_established.set()
+
+                # Actual data to be logged
+                elif self.readsock.fileno() == event[0]:
+                    data = self.recv(1024)
+                    self.logfunc(data)
+
+    # Since the socket is non-blocking make sure to honor EAGAIN
+    # and EWOULDBLOCK.
+    def recv(self, count):
+        try:
+            data = self.readsock.recv(count)
+        except socket.error as e:
+            if e.errno == errno.EAGAIN or e.errno == errno.EWOULDBLOCK:
+                return ''
+            else:
+                raise
+
+        if data is None:
+            raise Exception("No data on read ready socket")
+        elif not data:
+            # This actually means an orderly shutdown
+            # happened. But for this code it counts as an
+            # error since the connection shouldn't go away
+            # until qemu exits.
+            raise Exception("Console connection closed unexpectedly")
+
+        return data
+
+    def stringify_event(self, event):
+        val = ''
+        if select.POLLERR == event:
+            val = 'POLLER'
+        elif select.POLLHUP == event:
+            val = 'POLLHUP'
+        elif select.POLLNVAL == event:
+            val = 'POLLNVAL'
+        return val
+
+    def close_socket(self, sock):
+        sock.shutdown(socket.SHUT_RDWR)
+        sock.close()
+
+    def close_ignore_error(self, fd):
+        try:
+            os.close(fd)
+        except OSError:
+            pass
diff --git a/meta/lib/oeqa/utils/qemutinyrunner.py b/meta/lib/oeqa/utils/qemutinyrunner.py
new file mode 100644
index 0000000..4f95101
--- /dev/null
+++ b/meta/lib/oeqa/utils/qemutinyrunner.py
@@ -0,0 +1,170 @@
+# Copyright (C) 2015 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# This module provides a class for starting qemu images of poky tiny.
+# It's used by testimage.bbclass.
+
+import subprocess
+import os
+import time
+import signal
+import re
+import socket
+import select
+import bb
+from qemurunner import QemuRunner
+
+class QemuTinyRunner(QemuRunner):
+
+    def __init__(self, machine, rootfs, display, tmpdir, deploy_dir_image, logfile, kernel, boottime):
+
+        # Popen object for runqemu
+        self.runqemu = None
+        # pid of the qemu process that runqemu will start
+        self.qemupid = None
+        # target ip - from the command line
+        self.ip = None
+        # host ip - where qemu is running
+        self.server_ip = None
+
+        self.machine = machine
+        self.rootfs = rootfs
+        self.display = display
+        self.tmpdir = tmpdir
+        self.deploy_dir_image = deploy_dir_image
+        self.logfile = logfile
+        self.boottime = boottime
+
+        self.runqemutime = 60
+        self.socketfile = "console.sock"
+        self.server_socket = None
+        self.kernel = kernel
+
+
+    def create_socket(self):
+        tries = 3
+        while tries > 0:
+            try:
+                self.server_socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+                self.server_socket.connect(self.socketfile)
+                bb.note("Created listening socket for qemu serial console.")
+                tries = 0
+            except socket.error, msg:
+                self.server_socket.close()
+                bb.fatal("Failed to create listening socket.")
+                tries -= 1
+
+    def log(self, msg):
+        if self.logfile:
+            with open(self.logfile, "a") as f:
+                f.write("%s" % msg)
+
+    def start(self, qemuparams = None):
+
+        if self.display:
+            os.environ["DISPLAY"] = self.display
+        else:
+            bb.error("To start qemu I need a X desktop, please set DISPLAY correctly (e.g. DISPLAY=:1)")
+            return False
+        if not os.path.exists(self.rootfs):
+            bb.error("Invalid rootfs %s" % self.rootfs)
+            return False
+        if not os.path.exists(self.tmpdir):
+            bb.error("Invalid TMPDIR path %s" % self.tmpdir)
+            return False
+        else:
+            os.environ["OE_TMPDIR"] = self.tmpdir
+        if not os.path.exists(self.deploy_dir_image):
+            bb.error("Invalid DEPLOY_DIR_IMAGE path %s" % self.deploy_dir_image)
+            return False
+        else:
+            os.environ["DEPLOY_DIR_IMAGE"] = self.deploy_dir_image
+
+        # Set this flag so that Qemu doesn't do any grabs as SDL grabs interact
+        # badly with screensavers.
+        os.environ["QEMU_DONT_GRAB"] = "1"
+        self.qemuparams = '--append "root=/dev/ram0 console=ttyS0" -nographic -serial unix:%s,server,nowait' % self.socketfile
+
+        launch_cmd = 'qemu-system-i386 -kernel %s -initrd %s %s' % (self.kernel, self.rootfs, self.qemuparams)
+        self.runqemu = subprocess.Popen(launch_cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT,preexec_fn=os.setpgrp)
+
+        bb.note("runqemu started, pid is %s" % self.runqemu.pid)
+        bb.note("waiting at most %s seconds for qemu pid" % self.runqemutime)
+        endtime = time.time() + self.runqemutime
+        while not self.is_alive() and time.time() < endtime:
+            time.sleep(1)
+
+        if self.is_alive():
+            bb.note("qemu started - qemu procces pid is %s" % self.qemupid)
+            self.create_socket()
+        else:
+            bb.note("Qemu pid didn't appeared in %s seconds" % self.runqemutime)
+            output = self.runqemu.stdout
+            self.stop()
+            bb.note("Output from runqemu:\n%s" % output.read())
+            return False
+
+        return self.is_alive()
+
+    def run_serial(self, command):
+        self.server_socket.sendall(command+'\n')
+        data = ''
+        status = 0
+        stopread = False
+        endtime = time.time()+5
+        while time.time()<endtime and not stopread:
+                sread, _, _ = select.select([self.server_socket],[],[],5)
+                for sock in sread:
+                        answer = sock.recv(1024)
+                        if answer:
+                                data += answer
+                        else:
+                                sock.close()
+                                stopread = True
+        if not data:
+            status = 1
+        return (status, str(data))
+
+    def find_child(self,parent_pid):
+        #
+        # Walk the process tree from the process specified looking for a qemu-system. Return its [pid'cmd]
+        #
+        ps = subprocess.Popen(['ps', 'axww', '-o', 'pid,ppid,command'], stdout=subprocess.PIPE).communicate()[0]
+        processes = ps.split('\n')
+        nfields = len(processes[0].split()) - 1
+        pids = {}
+        commands = {}
+        for row in processes[1:]:
+            data = row.split(None, nfields)
+            if len(data) != 3:
+                continue
+            if data[1] not in pids:
+                pids[data[1]] = []
+
+            pids[data[1]].append(data[0])
+            commands[data[0]] = data[2]
+
+        if parent_pid not in pids:
+            return []
+
+        parents = []
+        newparents = pids[parent_pid]
+        while newparents:
+            next = []
+            for p in newparents:
+                if p in pids:
+                    for n in pids[p]:
+                        if n not in parents and n not in next:
+                            next.append(n)
+                if p not in parents:
+                    parents.append(p)
+                    newparents = next
+        #print "Children matching %s:" % str(parents)
+        for p in parents:
+            # Need to be careful here since runqemu-internal runs "ldd qemu-system-xxxx"
+            # Also, old versions of ldd (2.11) run "LD_XXXX qemu-system-xxxx"
+            basecmd = commands[p].split()[0]
+            basecmd = os.path.basename(basecmd)
+            if "qemu-system" in basecmd and "-serial unix" in commands[p]:
+                return [int(p),commands[p]]
\ No newline at end of file
diff --git a/meta/lib/oeqa/utils/sshcontrol.py b/meta/lib/oeqa/utils/sshcontrol.py
new file mode 100644
index 0000000..00f5051
--- /dev/null
+++ b/meta/lib/oeqa/utils/sshcontrol.py
@@ -0,0 +1,154 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Provides a class for setting up ssh connections,
+# running commands and copying files to/from a target.
+# It's used by testimage.bbclass and tests in lib/oeqa/runtime.
+
+import subprocess
+import time
+import os
+import select
+
+
+class SSHProcess(object):
+    def __init__(self, **options):
+
+        self.defaultopts = {
+            "stdout": subprocess.PIPE,
+            "stderr": subprocess.STDOUT,
+            "stdin": None,
+            "shell": False,
+            "bufsize": -1,
+            "preexec_fn": os.setsid,
+        }
+        self.options = dict(self.defaultopts)
+        self.options.update(options)
+        self.status = None
+        self.output = None
+        self.process = None
+        self.starttime = None
+        self.logfile = None
+
+        # Unset DISPLAY which means we won't trigger SSH_ASKPASS
+        env = os.environ.copy()
+        if "DISPLAY" in env:
+            del env['DISPLAY']
+        self.options['env'] = env
+
+    def log(self, msg):
+        if self.logfile:
+            with open(self.logfile, "a") as f:
+               f.write("%s" % msg)
+
+    def _run(self, command, timeout=None, logfile=None):
+        self.logfile = logfile
+        self.starttime = time.time()
+        output = ''
+        self.process = subprocess.Popen(command, **self.options)
+        if timeout:
+            endtime = self.starttime + timeout
+            eof = False
+            while time.time() < endtime and not eof:
+                if select.select([self.process.stdout], [], [], 5)[0] != []:
+                    data = os.read(self.process.stdout.fileno(), 1024)
+                    if not data:
+                        self.process.stdout.close()
+                        eof = True
+                    else:
+                        output += data
+                        self.log(data)
+                        endtime = time.time() + timeout
+
+
+            # process hasn't returned yet
+            if not eof:
+                self.process.terminate()
+                time.sleep(5)
+                try:
+                    self.process.kill()
+                except OSError:
+                    pass
+                lastline = "\nProcess killed - no output for %d seconds. Total running time: %d seconds." % (timeout, time.time() - self.starttime)
+                self.log(lastline)
+                output += lastline
+        else:
+            output = self.process.communicate()[0]
+            self.log(output.rstrip())
+
+        self.status = self.process.wait()
+        self.output = output.rstrip()
+
+    def run(self, command, timeout=None, logfile=None):
+        try:
+            self._run(command, timeout, logfile)
+        except:
+            # Need to guard against a SystemExit or other exception occuring whilst running
+            # and ensure we don't leave a process behind.
+            if self.process.poll() is None:
+                self.process.kill()
+                self.status = self.process.wait()
+            raise
+        return (self.status, self.output)
+
+class SSHControl(object):
+    def __init__(self, ip, logfile=None, timeout=300, user='root', port=None):
+        self.ip = ip
+        self.defaulttimeout = timeout
+        self.ignore_status = True
+        self.logfile = logfile
+        self.user = user
+        self.ssh_options = [
+                '-o', 'UserKnownHostsFile=/dev/null',
+                '-o', 'StrictHostKeyChecking=no',
+                '-o', 'LogLevel=ERROR'
+                ]
+        self.ssh = ['ssh', '-l', self.user ] + self.ssh_options
+        self.scp = ['scp'] + self.ssh_options
+        if port:
+            self.ssh = self.ssh + [ '-p', port ]
+            self.scp = self.scp + [ '-P', port ]
+
+    def log(self, msg):
+        if self.logfile:
+            with open(self.logfile, "a") as f:
+                f.write("%s\n" % msg)
+
+    def _internal_run(self, command, timeout=None, ignore_status = True):
+        self.log("[Running]$ %s" % " ".join(command))
+
+        proc = SSHProcess()
+        status, output = proc.run(command, timeout, logfile=self.logfile)
+
+        self.log("[Command returned '%d' after %.2f seconds]" % (status, time.time() - proc.starttime))
+
+        if status and not ignore_status:
+            raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, status, output))
+
+        return (status, output)
+
+    def run(self, command, timeout=None):
+        """
+        command - ssh command to run
+        timeout=<val> - kill command if there is no output after <val> seconds
+        timeout=None - kill command if there is no output after a default value seconds
+        timeout=0 - no timeout, let command run until it returns
+        """
+
+        # We need to source /etc/profile for a proper PATH on the target
+        command = self.ssh + [self.ip, ' . /etc/profile; ' + command]
+
+        if timeout is None:
+            return self._internal_run(command, self.defaulttimeout, self.ignore_status)
+        if timeout == 0:
+            return self._internal_run(command, None, self.ignore_status)
+        return self._internal_run(command, timeout, self.ignore_status)
+
+    def copy_to(self, localpath, remotepath):
+        command = self.scp + [localpath, '%s@%s:%s' % (self.user, self.ip, remotepath)]
+        return self._internal_run(command, ignore_status=False)
+
+    def copy_from(self, remotepath, localpath):
+        command = self.scp + ['%s@%s:%s' % (self.user, self.ip, remotepath), localpath]
+        return self._internal_run(command, ignore_status=False)
diff --git a/meta/lib/oeqa/utils/targetbuild.py b/meta/lib/oeqa/utils/targetbuild.py
new file mode 100644
index 0000000..f850d78
--- /dev/null
+++ b/meta/lib/oeqa/utils/targetbuild.py
@@ -0,0 +1,137 @@
+# Copyright (C) 2013 Intel Corporation
+#
+# Released under the MIT license (see COPYING.MIT)
+
+# Provides a class for automating build tests for projects
+
+import os
+import re
+import bb.utils
+import subprocess
+from abc import ABCMeta, abstractmethod
+
+class BuildProject():
+
+    __metaclass__ = ABCMeta
+
+    def __init__(self, d, uri, foldername=None, tmpdir="/tmp/"):
+        self.d = d
+        self.uri = uri
+        self.archive = os.path.basename(uri)
+        self.localarchive = os.path.join(tmpdir,self.archive)
+        self.fname = re.sub(r'.tar.bz2|tar.gz$', '', self.archive)
+        if foldername:
+            self.fname = foldername
+
+    # Download self.archive to self.localarchive
+    def _download_archive(self):
+
+        dl_dir = self.d.getVar("DL_DIR", True)
+        if dl_dir and os.path.exists(os.path.join(dl_dir, self.archive)):
+            bb.utils.copyfile(os.path.join(dl_dir, self.archive), self.localarchive)
+            return
+
+        exportvars = ['HTTP_PROXY', 'http_proxy',
+                      'HTTPS_PROXY', 'https_proxy',
+                      'FTP_PROXY', 'ftp_proxy',
+                      'FTPS_PROXY', 'ftps_proxy',
+                      'NO_PROXY', 'no_proxy',
+                      'ALL_PROXY', 'all_proxy',
+                      'SOCKS5_USER', 'SOCKS5_PASSWD']
+
+        cmd = ''
+        for var in exportvars:
+            val = self.d.getVar(var, True)
+            if val:
+                cmd = 'export ' + var + '=\"%s\"; %s' % (val, cmd)
+
+        cmd = cmd + "wget -O %s %s" % (self.localarchive, self.uri)
+        subprocess.check_call(cmd, shell=True)
+
+    # This method should provide a way to run a command in the desired environment.
+    @abstractmethod
+    def _run(self, cmd):
+        pass
+
+    # The timeout parameter of target.run is set to 0 to make the ssh command
+    # run with no timeout.
+    def run_configure(self, configure_args='', extra_cmds=''):
+        return self._run('cd %s; %s ./configure %s' % (self.targetdir, extra_cmds, configure_args))
+
+    def run_make(self, make_args=''):
+        return self._run('cd %s; make %s' % (self.targetdir, make_args))
+
+    def run_install(self, install_args=''):
+        return self._run('cd %s; make install %s' % (self.targetdir, install_args))
+
+    def clean(self):
+        self._run('rm -rf %s' % self.targetdir)
+        subprocess.call('rm -f %s' % self.localarchive, shell=True)
+        pass
+
+class TargetBuildProject(BuildProject):
+
+    def __init__(self, target, d, uri, foldername=None):
+        self.target = target
+        self.targetdir = "~/"
+        BuildProject.__init__(self, d, uri, foldername, tmpdir="/tmp")
+
+    def download_archive(self):
+
+        self._download_archive()
+
+        (status, output) = self.target.copy_to(self.localarchive, self.targetdir)
+        if status != 0:
+            raise Exception("Failed to copy archive to target, output: %s" % output)
+
+        (status, output) = self.target.run('tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir))
+        if status != 0:
+            raise Exception("Failed to extract archive, output: %s" % output)
+
+        #Change targetdir to project folder
+        self.targetdir = self.targetdir + self.fname
+
+    # The timeout parameter of target.run is set to 0 to make the ssh command
+    # run with no timeout.
+    def _run(self, cmd):
+        return self.target.run(cmd, 0)[0]
+
+
+class SDKBuildProject(BuildProject):
+
+    def __init__(self, testpath, sdkenv, d, uri, foldername=None):
+        self.sdkenv = sdkenv
+        self.testdir = testpath
+        self.targetdir = testpath
+        bb.utils.mkdirhier(testpath)
+        self.datetime = d.getVar('DATETIME', True)
+        self.testlogdir = d.getVar("TEST_LOG_DIR", True)
+        bb.utils.mkdirhier(self.testlogdir)
+        self.logfile = os.path.join(self.testlogdir, "sdk_target_log.%s" % self.datetime)
+        BuildProject.__init__(self, d, uri, foldername, tmpdir=testpath)
+
+    def download_archive(self):
+
+        self._download_archive()
+
+        cmd = 'tar xf %s%s -C %s' % (self.targetdir, self.archive, self.targetdir)
+        subprocess.check_call(cmd, shell=True)
+
+        #Change targetdir to project folder
+        self.targetdir = self.targetdir + self.fname
+
+    def run_configure(self, configure_args=''):
+        return super(SDKBuildProject, self).run_configure(configure_args=(configure_args or '$CONFIGURE_FLAGS'), extra_cmds=' gnu-configize; ')
+
+    def run_install(self, install_args=''):
+        return super(SDKBuildProject, self).run_install(install_args=(install_args or "DESTDIR=%s/../install" % self.targetdir))
+
+    def log(self, msg):
+        if self.logfile:
+            with open(self.logfile, "a") as f:
+               f.write("%s\n" % msg)
+
+    def _run(self, cmd):
+        self.log("Running . %s; " % self.sdkenv + cmd)
+        return subprocess.call(". %s; " % self.sdkenv + cmd, shell=True)
+
diff --git a/meta/recipes-bsp/acpid/acpid.inc b/meta/recipes-bsp/acpid/acpid.inc
new file mode 100644
index 0000000..e015619
--- /dev/null
+++ b/meta/recipes-bsp/acpid/acpid.inc
@@ -0,0 +1,30 @@
+SUMMARY = "A daemon for delivering ACPI events"
+HOMEPAGE = "http://sourceforge.net/projects/acpid/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=33140&atid=407341"
+SECTION = "base"
+LICENSE = "GPLv2+"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/acpid2/acpid-${PV}.tar.xz \
+           file://init \
+           file://acpid.service \
+          "
+
+inherit autotools update-rc.d systemd
+
+INITSCRIPT_NAME = "acpid"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "acpid.service"
+
+do_install_append () {
+	install -d ${D}${sysconfdir}/init.d
+	sed -e 's,/usr/sbin,${sbindir},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/acpid
+	chmod 755 ${D}${sysconfdir}/init.d/acpid
+
+	install -d ${D}${sysconfdir}/acpi
+	install -d ${D}${sysconfdir}/acpi/events
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/acpid.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/acpid.service
+}
diff --git a/meta/recipes-bsp/acpid/acpid/acpid.service b/meta/recipes-bsp/acpid/acpid/acpid.service
new file mode 100644
index 0000000..f70e740
--- /dev/null
+++ b/meta/recipes-bsp/acpid/acpid/acpid.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=ACPI Event Daemon
+After=syslog.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/acpid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-bsp/acpid/acpid/init b/meta/recipes-bsp/acpid/acpid/init
new file mode 100755
index 0000000..40ff385
--- /dev/null
+++ b/meta/recipes-bsp/acpid/acpid/init
@@ -0,0 +1,31 @@
+#! /bin/sh -e
+
+test -x /usr/sbin/acpid || exit 0
+test -d /proc/acpi || exit 0
+mkdir -p /etc/acpi/events
+
+case "$1" in
+  start)
+    echo -n "Starting Advanced Configuration and Power Interface daemon: "
+    if [ ! -d /etc/acpi/events ]; then
+        echo "There is not any rule configuration file."
+    else
+        start-stop-daemon -o -S -x /usr/sbin/acpid -- -c /etc/acpi/events
+        echo "acpid."
+    fi
+    ;;
+  stop)
+    echo -n "Stopping Advanced Configuration and Power Interface daemon: "
+    start-stop-daemon -o -K -x /usr/sbin/acpid
+    echo "acpid."
+    ;;
+  restart|force-reload) 
+    $0 stop
+    $0 start
+    ;;
+  *)
+    echo "Usage: /etc/init.d/acpid {start|stop|restart|force-reload}"
+    exit 1
+esac
+
+exit 0
diff --git a/meta/recipes-bsp/acpid/acpid_2.0.23.bb b/meta/recipes-bsp/acpid/acpid_2.0.23.bb
new file mode 100644
index 0000000..a5317a4
--- /dev/null
+++ b/meta/recipes-bsp/acpid/acpid_2.0.23.bb
@@ -0,0 +1,7 @@
+require acpid.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+                    file://acpid.h;endline=24;md5=324a9cf225ae69ddaad1bf9d942115b5"
+
+SRC_URI[md5sum] = "d7bcdcdefcd53b03730e50ba842554ea"
+SRC_URI[sha256sum] = "4396aaec13510c3a1faa941a15a4b5335b6ae4fbec8438b9249b88c3b66187ee"
diff --git a/meta/recipes-bsp/alsa-state/alsa-state.bb b/meta/recipes-bsp/alsa-state/alsa-state.bb
new file mode 100644
index 0000000..d0f7bb3
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state.bb
@@ -0,0 +1,67 @@
+# Copyright Matthias Hentges <devel@hentges.net> (c) 2007
+# License: MIT (see http://www.opensource.org/licenses/mit-license.php
+#               for a copy of the license)
+#
+# Filename: alsa-state.bb
+
+SUMMARY = "Alsa scenario files to enable alsa state restoration"
+DESCRIPTION = "Alsa Scenario Files - an init script and state files to restore \
+sound state at system boot and save it at system shut down."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PV = "0.2.0"
+PR = "r5"
+
+SRC_URI = "\
+  file://asound.conf \
+  file://asound.state \
+  file://alsa-state-init \
+"
+
+S = "${WORKDIR}"
+
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python __anonymous() {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "alsa-state"
+INITSCRIPT_PARAMS = "start 39 S . stop 31 0 6 ."
+
+do_install() {
+    # Only install the init script when 'sysvinit' is in DISTRO_FEATURES.
+    if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+	sed -i -e "s:#STATEDIR#:${localstatedir}/lib/alsa:g" ${WORKDIR}/alsa-state-init
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/alsa-state-init ${D}${sysconfdir}/init.d/alsa-state
+    fi
+
+    install -d ${D}/${localstatedir}/lib/alsa
+    install -d ${D}${sysconfdir}
+    install -m 0644 ${WORKDIR}/asound.conf ${D}${sysconfdir}
+    install -m 0644 ${WORKDIR}/*.state ${D}${localstatedir}/lib/alsa
+}
+
+PACKAGES += "alsa-states"
+
+RRECOMMENDS_alsa-state = "alsa-states"
+
+RDEPENDS_${PN} = "alsa-utils-alsactl"
+FILES_${PN} = "${sysconfdir}/init.d ${sysconfdir}/asound.conf"
+CONFFILES_${PN} = "${sysconfdir}/asound.conf"
+
+FILES_alsa-states = "${localstatedir}/lib/alsa/*.state"
+
+pkg_postinst_${PN}() {
+	if test -z "$D"
+	then
+		if test -x ${sbindir}/alsactl
+		then
+			${sbindir}/alsactl -f ${localstatedir}/lib/alsa/asound.state restore
+		fi
+	fi
+}
diff --git a/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
new file mode 100755
index 0000000..eee59cb
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state/alsa-state-init
@@ -0,0 +1,39 @@
+#! /bin/sh
+#
+# Copyright Matthias Hentges <devel@hentges.net> (c) 2007
+# License: GPL (see http://www.gnu.org/licenses/gpl.txt for a copy of the license)
+#
+# Filename: alsa-state
+# Date: 20070308 (YMD)
+
+# source function library
+. /etc/init.d/functions
+
+asound_restore(){
+	echo "ALSA: Restoring mixer settings..."
+	if test -x /usr/sbin/alsactl -a -e #STATEDIR#/asound.state
+	then
+		/usr/sbin/alsactl -f #STATEDIR#/asound.state restore &
+	fi
+}
+
+asound_store(){
+	echo "ALSA: Storing mixer settings..."
+	if test -x /usr/sbin/alsactl
+	then
+		/usr/sbin/alsactl -f #STATEDIR#/asound.state store
+	fi
+}
+
+case "$1" in
+start)		asound_restore ;;
+stop)		asound_store ;;
+  status)
+    status /usr/sbin/alsactl;
+    exit $?
+  ;;
+  *)
+    echo "Usage: /etc/init.d/alsa-state {start|stop|status}"
+    exit 1
+  ;;
+esac
diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.conf b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
new file mode 100644
index 0000000..03653cf
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.conf
@@ -0,0 +1 @@
+# Global alsa-lib configuration
diff --git a/meta/recipes-bsp/alsa-state/alsa-state/asound.state b/meta/recipes-bsp/alsa-state/alsa-state/asound.state
new file mode 100644
index 0000000..ddd1cce
--- /dev/null
+++ b/meta/recipes-bsp/alsa-state/alsa-state/asound.state
@@ -0,0 +1 @@
+# Dummy file, do not delete
diff --git a/meta/recipes-bsp/apmd/apmd/apmd.service b/meta/recipes-bsp/apmd/apmd/apmd.service
new file mode 100644
index 0000000..ffab823
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd/apmd.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Advanced Power Management daemon
+After=remote-fs.target
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/default/apmd
+ExecStart=@SBINDIR@/apmd -P @SYSCONFDIR@/apm/apmd_proxy $APMD
diff --git a/meta/recipes-bsp/apmd/apmd/apmd_proxy b/meta/recipes-bsp/apmd/apmd/apmd_proxy
new file mode 100644
index 0000000..c48ee4e
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd/apmd_proxy
@@ -0,0 +1,91 @@
+#!/bin/sh
+# 
+# apmd_proxy - program dispatcher for APM daemon
+#
+# Written by Craig Markwardt (craigm@lheamail.gsfc.nasa.gov) 21 May 1999
+# Modified for Debian by Avery Pennarun
+#
+# This shell script is called by the APM daemon (apmd) when a power
+# management event occurs.  Its first and second arguments describe the
+# event.  For example, apmd will call "apmd_proxy suspend system" just
+# before the system is suspended.
+#
+# Here are the possible arguments:
+#
+# start              - APM daemon has started
+# stop               - APM daemon is shutting down
+# suspend critical   - APM system indicates critical suspend (++)
+# suspend system     - APM system has requested suspend mode
+# suspend user       - User has requested suspend mode
+# standby system     - APM system has requested standby mode 
+# standby user       - User has requested standby mode
+# resume suspend     - System has resumed from suspend mode
+# resume standby     - System has resumed from standby mode
+# resume critical    - System has resumed from critical suspend
+# change battery     - APM system reported low battery
+# change power       - APM system reported AC/battery change
+# change time        - APM system reported time change (*)
+# change capability  - APM system reported config. change (+)
+#
+# (*) - APM daemon may be configured to not call these sequences
+# (+) - Available if APM kernel supports it.
+# (++) - "suspend critical" is never passed to apmd from the kernel,
+#   so we will never see it here.  Scripts that process "resume
+#   critical" events need to take this into account.
+#
+# It is the proxy script's responsibility to examine the APM status
+# (via /proc/apm) or other status and to take appropriate actions.
+# For example, the script might unmount network drives before the
+# machine is suspended.
+#
+# In Debian, the usual way of adding functionality to the proxy is to
+# add a script to /etc/apm/event.d.  This script will be called by
+# apmd_proxy (via run-parts) with the same arguments.
+#
+# If it is important that a certain set of script be run in a certain
+# order on suspend and in a different order on resume, then put all
+# the scripts in /etc/apm/scripts.d instead of /etc/apm/event.d and
+# symlink to these from /etc/apm/suspend.d, /etc/apm/resume.d and
+# /etc/apm/other.d using names whose lexicographical order is the same
+# as the desired order of execution.
+#
+# If the kernel's APM driver supports it, apmd_proxy can return a non-zero
+# exit status on suspend and standby events, indicating that the suspend
+# or standby event should be rejected.
+#
+# *******************************************************************
+
+set -e
+
+# The following doesn't yet work, because current kernels (up to at least
+# 2.4.20) do not support rejection of APM events.  Supporting this would
+# require substantial modifications to the APM driver.  We will re-enable
+# this feature if the driver is ever modified.       -- cph@debian.org
+#
+#SUSPEND_ON_AC=false
+#[ -r /etc/apm/apmd_proxy.conf ] && . /etc/apm/apmd_proxy.conf
+#
+#if [ "${SUSPEND_ON_AC}" = "false" -a "${2}" = "system" ] \
+#	&& on_ac_power >/dev/null; then
+#    # Reject system suspends and standbys if we are on AC power
+#    exit 1  # Reject (NOTE kernel support must be enabled)
+#fi
+
+if [ "${1}" = "suspend" -o "${1}" = "standby" ]; then
+    run-parts -a "${1}" -a "${2}" /etc/apm/event.d
+    if [ -d /etc/apm/suspend.d ]; then
+        run-parts -a "${1}" -a "${2}" /etc/apm/suspend.d
+    fi
+elif [ "${1}" = "resume" ]; then
+    if [ -d /etc/apm/resume.d ]; then
+        run-parts -a "${1}" -a "${2}" /etc/apm/resume.d
+    fi
+    run-parts -a "${1}" -a "${2}" /etc/apm/event.d
+else
+    run-parts -a "${1}" -a "${2}" /etc/apm/event.d
+    if [ -d /etc/apm/other.d ]; then
+        run-parts -a "${1}" -a "${2}" /etc/apm/other.d
+    fi
+fi
+
+exit 0
diff --git a/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf b/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf
new file mode 100644
index 0000000..751145c
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd/apmd_proxy.conf
@@ -0,0 +1,16 @@
+# /etc/apm/apmd_proxy.conf: configuration file for apmd.
+#
+# This file is managed by debconf when installing or reconfiguring the
+# package.  It is generated by merging the answers gathered by debconf
+# into the template file "/usr/share/apmd/apmd_proxy.conf".
+
+# The following doesn't yet work, because current kernels (up to at least
+# 2.4.20) do not support rejection of APM events.  Supporting this would
+# require substantial modifications to the APM driver.  We will re-enable
+# this feature if the driver is ever modified.       -- cph@debian.org
+#
+# Set the following to "false" if you want to reject system suspend or
+# system standby requests when the computer is running on AC power.
+# Otherwise set this to "true".  Such requests are never rejected when
+# the computer is running on battery power.
+#SUSPEND_ON_AC=true
diff --git a/meta/recipes-bsp/apmd/apmd/default b/meta/recipes-bsp/apmd/apmd/default
new file mode 100644
index 0000000..4b7965a
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd/default
@@ -0,0 +1,8 @@
+#
+# Default for /etc/init.d/apmd
+#
+
+# As apmd can be called with arguments, we use the following variable
+# to store them, e.g., APMD="-w 5 -p 2".
+# See the manual page apmd(8) for details.
+APMD="--proxy-timeout 30"
diff --git a/meta/recipes-bsp/apmd/apmd/init b/meta/recipes-bsp/apmd/apmd/init
new file mode 100755
index 0000000..c0b41aa
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd/init
@@ -0,0 +1,51 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          apmd
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Advanced Power Management daemon
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+[ -f /etc/default/apmd ] && . /etc/default/apmd
+
+case "$1" in
+    start)
+	echo -n "Starting advanced power management daemon: "
+	start-stop-daemon -S -x /usr/sbin/apmd -- \
+		-P /etc/apm/apmd_proxy $APMD
+	if [ $? = 0 ]; then
+	    echo "apmd."
+	else
+	    echo "(failed.)"
+	fi
+	;;
+    stop)
+	echo -n "Stopping advanced power management daemon: "
+	start-stop-daemon -K \
+		-x /usr/sbin/apmd
+	echo "apmd."
+	;;
+    status)
+	status /usr/sbin/apmd;
+	exit $?
+	;;
+    restart|force-reload) 
+	$0 stop
+	$0 start
+	exit
+	;;
+    *)
+	echo "Usage: /etc/init.d/apmd {start|stop|status|restart|force-reload}"
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-bsp/apmd/apmd/legacy.patch b/meta/recipes-bsp/apmd/apmd/legacy.patch
new file mode 100644
index 0000000..5db895e
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd/legacy.patch
@@ -0,0 +1,133 @@
+From 3595933d221f0ba836917debc0776b8723972ec9 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Tue, 11 Aug 2015 17:40:50 +0300
+Subject: [PATCH 1/3] Patch with fixes provided by Debian.
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/a/apmd/apmd_3.2.2-15.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ Makefile |  2 +-
+ apm.c    |  3 ++-
+ apm.h    |  9 +++++++++
+ apmd.c   | 15 ++++++++-------
+ 4 files changed, 20 insertions(+), 9 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index bf346d9..92fc0fd 100644
+--- a/Makefile
++++ b/Makefile
+@@ -43,7 +43,7 @@ DESTDIR=
+ 
+ CC=gcc
+ CFLAGS=-O -g
+-XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include \
++XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \
+ 		-I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \
+ 		-DVERSION=\"$(VERSION)\" \
+ 		-DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\"
+diff --git a/apm.c b/apm.c
+index b21c057..0359b1c 100644
+--- a/apm.c
++++ b/apm.c
+@@ -219,12 +219,13 @@ int main(int argc, char **argv)
+ 		}
+ 	}
+ 													    
+-
++#if 0
+     if (!(i.apm_flags & APM_32_BIT_SUPPORT))
+     {
+ 	fprintf(stderr, "32-bit APM interface not supported\n");
+ 	exit(1);
+     }
++#endif
+ 
+     if (verbose && (i.apm_flags & 0x10))
+ 	printf("APM BIOS Power Management is currently disabled\n");
+diff --git a/apm.h b/apm.h
+index fb24dfd..824cc06 100644
+--- a/apm.h
++++ b/apm.h
+@@ -20,6 +20,13 @@
+  * $Id: apm.h,v 1.7 1999/07/05 22:31:11 apenwarr Exp $
+  * 
+  */
++#ifndef _APM_H
++#define _APM_H 1
++
++#ifndef __KERNEL_STRICT_NAMES
++#define __KERNEL_STRICT_NAMES
++#endif
++
+ #include <linux/apm_bios.h>
+ #include <sys/types.h>
+ 
+@@ -93,3 +100,5 @@ extern int apm_reject(int fd);
+ #else
+ #define apm_reject(fd)   (-EINVAL)
+ #endif
++
++#endif
+diff --git a/apmd.c b/apmd.c
+index 49ed3a1..560f536 100644
+--- a/apmd.c
++++ b/apmd.c
+@@ -343,7 +343,7 @@ static int call_proxy(apm_event_t event)
+ 		/* parent */
+ 		int status, retval;
+ 		ssize_t len;
+-		time_t time_limit;
++		time_t countdown;
+ 
+ 		if (pid < 0) {
+ 			/* Couldn't fork */
+@@ -356,8 +356,9 @@ static int call_proxy(apm_event_t event)
+ 		/* Capture the child's output, if any, but only until it terminates */
+ 		close(fds[1]);
+ 		fcntl(fds[0], F_SETFL, O_RDONLY|O_NONBLOCK);
+-		time_limit = time(0) + proxy_timeout;
++		countdown = proxy_timeout;
+ 		do {
++			countdown -= 1;
+ 			while ((len = read(fds[0], line, sizeof(line)-1)) > 0) {
+ 				line[len] = 0;
+ 				APMD_SYSLOG(LOG_INFO, "+ %s", line);
+@@ -372,16 +373,16 @@ static int call_proxy(apm_event_t event)
+ 				goto proxy_done;
+ 			}
+ 				
+-			sleep(1);
++			while (sleep(1) > 0) ;
+ 		} while (
+-			(time(0) < time_limit)
++			(countdown >= 0)
+ 			|| (proxy_timeout < 0)
+ 		);
+ 
+ 		APMD_SYSLOG(LOG_NOTICE, "Proxy has been running more than %d seconds; killing it", proxy_timeout);
+ 
+ 		kill(pid, SIGTERM);
+-		time_limit = time(0) + 5;
++		countdown = 5;
+ 		do {
+ 			retval = waitpid(pid, &status, WNOHANG);
+ 			if (retval == pid)
+@@ -392,9 +393,9 @@ static int call_proxy(apm_event_t event)
+ 				goto proxy_done;
+ 			}
+ 
+-			sleep(1);
++			while (sleep(1) > 0) ;
+ 
+-		} while (time(0) < time_limit);
++		} while (countdown >= 0);
+ 
+ 		kill(pid, SIGKILL);
+ 		status = __W_EXITCODE(0, SIGKILL);
+-- 
+2.1.4
+
diff --git a/meta/recipes-bsp/apmd/apmd/libtool.patch b/meta/recipes-bsp/apmd/apmd/libtool.patch
new file mode 100644
index 0000000..834ee08
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd/libtool.patch
@@ -0,0 +1,33 @@
+Add by RP to address "unable to infer tagged configuration" error:
+   commit 35de05e61b88c0808a5e885bb0efdf420555d5ad
+   Author: Richard Purdie <rpurdie@rpsys.net>
+   Date:   Sun Jun 1 16:13:38 2008 +0000
+
+   apmd: Use libtool --tag options to avoid problems with libtool 2.2.4 (from poky)
+
+However I didn't see same issue with current libtool-2.2.10. Also per my understanding,
+the default tag, if not specified, falls back to CC. So disable it from patching, but
+keep it here. If we encounter similar issue in the future, we could then push upstream
+
+Comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-16
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: apmd-3.2.2.orig/Makefile
+===================================================================
+--- apmd-3.2.2.orig.orig/Makefile	2004-01-04 08:13:18.000000000 +0000
++++ apmd-3.2.2.orig/Makefile	2008-04-21 17:10:03.000000000 +0100
+@@ -58,9 +57,8 @@
+ #CFLAGS=-O3 -m486 -fomit-frame-pointer
+ #LDFLAGS=-s
+ 
+-LIBTOOL=libtool --quiet
+-LT_COMPILE = $(LIBTOOL) --mode=compile $(CC)
+-LT_LINK = $(LIBTOOL) --mode=link $(CC)
++LT_COMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC)
++LT_LINK = $(LIBTOOL)  --tag=CC --mode=link $(CC)
+ LT_INSTALL = $(LIBTOOL) --mode=install install
+ LT_CLEAN = $(LIBTOOL) --mode=clean rm
+ 
diff --git a/meta/recipes-bsp/apmd/apmd/unlinux.patch b/meta/recipes-bsp/apmd/apmd/unlinux.patch
new file mode 100644
index 0000000..ec8206c
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd/unlinux.patch
@@ -0,0 +1,25 @@
+copy OE commit message here:
+   commit 9456cdc1cf43e3ba9e6d88c63560c1b6fdee4359
+   Author: Michael Krelin <hacker@klever.net>
+   Date:   Tue May 29 12:27:45 2007 +0000
+
+   apmd: prevent build from interferring with host kernel headers. Closes #1257
+
+comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-13
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- apmd-3.2.2.orig/Makefile
++++ apmd-3.2.2/Makefile
+@@ -43,8 +43,7 @@
+ 
+ CC=gcc
+ CFLAGS=-O -g
+-XTRACFLAGS=-Wall -pipe -I. -I/usr/src/linux/include -I/usr/X11R6/include \
+-		-I/usr/src/linux-2.2/include -I /usr/src/linux-2.0/include \
++XTRACFLAGS=-Wall -pipe -I. \
+ 		-DVERSION=\"$(VERSION)\" \
+ 		-DDEFAULT_PROXY_NAME=\"$(PROXY_DIR)/apmd_proxy\"
+ LDFLAGS=
diff --git a/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb b/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb
new file mode 100644
index 0000000..ea10526
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd_3.2.2-15.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Utilities for Advanced Power Management"
+DESCRIPTION = "The Advanced Power Management (APM) support provides \
+access to battery status information and a set of tools for managing \
+notebook power consumption."
+HOMEPAGE = "http://apenwarr.ca/apmd/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://apm.h;beginline=6;endline=18;md5=7d4acc1250910a89f84ce3cc6557c4c2"
+DEPENDS = "libtool-cross"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/a/apmd/apmd_3.2.2.orig.tar.gz;name=tarball \
+           file://legacy.patch \
+           file://libtool.patch \
+           file://unlinux.patch \
+           file://init \
+           file://default \
+           file://apmd_proxy \
+           file://apmd_proxy.conf \
+           file://apmd.service"
+
+SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8"
+SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d"
+
+S = "${WORKDIR}/apmd-3.2.2.orig"
+
+inherit update-rc.d systemd
+
+INITSCRIPT_NAME = "apmd"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "apmd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+do_compile() {
+	# apmd doesn't use whole autotools. Just libtool for installation
+	oe_runmake "LIBTOOL=${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool" apm apmd
+}
+
+do_install() {
+	install -d ${D}${sysconfdir}
+	install -d ${D}${sysconfdir}/apm
+	install -d ${D}${sysconfdir}/apm/event.d
+	install -d ${D}${sysconfdir}/apm/other.d
+	install -d ${D}${sysconfdir}/apm/suspend.d
+	install -d ${D}${sysconfdir}/apm/resume.d
+	install -d ${D}${sysconfdir}/apm/scripts.d
+	install -d ${D}${sysconfdir}/default
+	install -d ${D}${sysconfdir}/init.d
+	install -d ${D}${sbindir}
+	install -d ${D}${bindir}
+	install -d ${D}${libdir}
+	install -d ${D}${datadir}/apmd
+	install -d ${D}${includedir}
+
+	install -m 4755 ${S}/.libs/apm ${D}${bindir}/apm
+	install -m 0755 ${S}/.libs/apmd ${D}${sbindir}/apmd
+	install -m 0755 ${WORKDIR}/apmd_proxy ${D}${sysconfdir}/apm/
+	install -m 0644 ${WORKDIR}/apmd_proxy.conf ${D}${datadir}/apmd/
+	install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/apmd
+	oe_libinstall -so libapm ${D}${libdir}
+	install -m 0644 apm.h ${D}${includedir}
+
+	sed -e 's,/usr/sbin,${sbindir},g; s,/etc,${sysconfdir},g;' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/apmd
+	chmod 755 ${D}${sysconfdir}/init.d/apmd
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/apmd.service ${D}${systemd_unitdir}/system/
+	sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+		-e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apmd.service
+}
+
+PACKAGES =+ "libapm apm"
+
+FILES_libapm = "${libdir}/libapm${SOLIBS}"
+FILES_apm = "${bindir}/apm*"
diff --git a/meta/recipes-bsp/eee-acpi-scripts/eee-acpi-scripts_git.bb b/meta/recipes-bsp/eee-acpi-scripts/eee-acpi-scripts_git.bb
new file mode 100644
index 0000000..c2a02aa
--- /dev/null
+++ b/meta/recipes-bsp/eee-acpi-scripts/eee-acpi-scripts_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "eeePC specific ACPI scripts"
+HOMEPAGE = "http://alioth.debian.org/projects/debian-eeepc/"
+SECTION = "base"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=77ef83ab5f4af938a93edb61f7b74f2c"
+
+SRCREV = "9d4cdedca25b396405f8587f9c4fbf8229e041c2"
+PV = "1.1.12+git${SRCPV}"
+
+SRC_URI = "git://git.debian.org/git/debian-eeepc/eeepc-acpi-scripts.git \
+	   file://remove-doc-check.patch \
+	   file://powerbtn.patch \
+	   file://policy-funcs "
+
+S = "${WORKDIR}/git"
+
+FILES_${PN} = "${datadir}/acpi-support/ \
+               ${datadir}/eeepc-acpi-scripts \
+               ${sysconfdir}/default/ \
+               ${sysconfdir}/acpi/"
+
+do_install () {
+	install -d ${D}${sysconfdir}/default/
+	install -d ${D}${sysconfdir}/acpi/actions/
+	install -d ${D}${sysconfdir}/acpi/events/
+	install -d ${D}${sysconfdir}/acpi/lib/udev/rules.d
+	install -d ${D}${datadir}/eeepc-acpi-scripts/
+	install -d ${D}${datadir}/acpi-support/
+	install -m 644 ${S}/events/* ${D}${sysconfdir}/acpi/events/
+	install -m 644 ${S}/lib/udev/rules.d/* ${D}${sysconfdir}/acpi/lib/udev/rules.d/
+	install ${S}/actions/* ${D}${sysconfdir}/acpi/actions/
+	install -m 0644 ${S}/acpilib/functions.sh ${D}${datadir}/eeepc-acpi-scripts/
+	install -m 0644 ${WORKDIR}/policy-funcs ${D}${datadir}/acpi-support/
+	install -m 0644 ${S}/debian/eeepc-acpi-scripts.default* ${D}${sysconfdir}/default/
+}
+
+RDEPENDS_${PN} = "pm-utils"
+
diff --git a/meta/recipes-bsp/eee-acpi-scripts/files/policy-funcs b/meta/recipes-bsp/eee-acpi-scripts/files/policy-funcs
new file mode 100644
index 0000000..fd099df
--- /dev/null
+++ b/meta/recipes-bsp/eee-acpi-scripts/files/policy-funcs
@@ -0,0 +1,8 @@
+CheckPolicy() {
+	if pidof gnome-power-manager kpowersave > /dev/null ||
+	   (pidof dcopserver > /dev/null && test -x /usr/bin/dcop && /usr/bin/dcop kded kded loadedModules | grep -q klaptopdaemon) ; then
+		echo 0;
+	else
+		echo 1;
+	fi
+}
diff --git a/meta/recipes-bsp/eee-acpi-scripts/files/powerbtn.patch b/meta/recipes-bsp/eee-acpi-scripts/files/powerbtn.patch
new file mode 100644
index 0000000..403e556
--- /dev/null
+++ b/meta/recipes-bsp/eee-acpi-scripts/files/powerbtn.patch
@@ -0,0 +1,22 @@
+---
+ actions/power.sh |    3 +++
+ events/powerbtn  |    2 ++
+ 2 files changed, 5 insertions(+)
+
+Upstream-Status: Inappropriate [enable feature]
+
+Index: git/events/powerbtn
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ git/events/powerbtn	2008-10-08 17:43:35.000000000 +0200
+@@ -0,0 +1,2 @@
++event=button/power PWRF
++action=/etc/acpi/actions/power.sh
+Index: git/actions/power.sh
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ git/actions/power.sh	2008-10-08 17:45:26.000000000 +0200
+@@ -0,0 +1,3 @@
++#!/bin/sh
++
++/sbin/shutdown -h now "Power button pressed"
diff --git a/meta/recipes-bsp/eee-acpi-scripts/files/remove-doc-check.patch b/meta/recipes-bsp/eee-acpi-scripts/files/remove-doc-check.patch
new file mode 100644
index 0000000..efb3dca
--- /dev/null
+++ b/meta/recipes-bsp/eee-acpi-scripts/files/remove-doc-check.patch
@@ -0,0 +1,60 @@
+---
+ actions/hotkey.sh     |    3 ---
+ actions/suspend.sh    |    3 ---
+ actions/vga-toggle.sh |    3 ---
+ actions/volume.sh     |    3 ---
+ 4 files changed, 12 deletions(-)
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: git/eeepc-acpi-scripts/volume.sh
+===================================================================
+--- git.orig/eeepc-acpi-scripts/volume.sh	2011-11-29 19:21:55.000000000 +0800
++++ git/eeepc-acpi-scripts/volume.sh	2011-11-29 19:41:36.000000000 +0800
+@@ -3,12 +3,10 @@
+ [ -d /sys/devices/platform/eeepc ] || [ -d /sys/devices/platform/eeepc-wmi ] || exit 0
+ # Volume controls
+ 
+-# do nothing if package is removed
+ PKG=eeepc-acpi-scripts
+ PKG_DIR=/usr/share/acpi-support/$PKG
+ FUNC_LIB=$PKG_DIR/lib/functions.sh
+ DEFAULT=/etc/default/$PKG
+-[ -e "$FUNC_LIB" ] || exit 0
+ 
+ . $FUNC_LIB
+ . $PKG_DIR/lib/sound.sh
+Index: git/eeepc-acpi-scripts/hotkey.sh
+===================================================================
+--- git.orig/eeepc-acpi-scripts/hotkey.sh	2011-11-29 19:21:55.000000000 +0800
++++ git/eeepc-acpi-scripts/hotkey.sh	2011-11-29 19:39:51.000000000 +0800
+@@ -1,12 +1,10 @@
+ #!/bin/sh
+ 
+ [ -d /sys/devices/platform/eeepc ] || [ -d /sys/devices/platform/eeepc-wmi ] || exit 0
+-# do nothing if package is removed
+ PKG=eeepc-acpi-scripts
+ PKG_DIR=/usr/share/acpi-support/$PKG
+ FUNC_LIB=$PKG_DIR/lib/functions.sh
+ DEFAULT=/etc/default/$PKG
+-[ -e "$FUNC_LIB" ] || exit 0
+ 
+ case $(runlevel) in
+     *0|*6)
+Index: git/eeepc-acpi-scripts/vga-toggle.sh
+===================================================================
+--- git.orig/eeepc-acpi-scripts/vga-toggle.sh	2011-11-29 19:21:55.000000000 +0800
++++ git/eeepc-acpi-scripts/vga-toggle.sh	2011-11-29 19:40:24.000000000 +0800
+@@ -1,12 +1,10 @@
+ #!/bin/sh
+ 
+ [ -d /sys/devices/platform/eeepc ] || [ -d /sys/devices/platform/eeepc-wmi ] || exit 0
+-# do nothing if package is removed
+ PKG=eeepc-acpi-scripts
+ PKG_DIR=/usr/share/acpi-support/$PKG
+ FUNC_LIB=$PKG_DIR/lib/functions.sh
+ DEFAULT=/etc/default/$PKG
+-[ -e "$FUNC_LIB" ] || exit 0
+ 
+ if [ -e "$DEFAULT" ]; then . "$DEFAULT"; fi
+ . $FUNC_LIB
diff --git a/meta/recipes-bsp/formfactor/files/config b/meta/recipes-bsp/formfactor/files/config
new file mode 100755
index 0000000..41066de
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/config
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+if [ -e /etc/formfactor/machconfig ]; then
+    . /etc/formfactor/machconfig
+fi
+
+if [ -z "$HAVE_TOUCHSCREEN" ]; then
+    HAVE_TOUCHSCREEN=0
+fi
+
+if [ -z "$HAVE_KEYBOARD" ]; then
+    HAVE_KEYBOARD=0
+fi
+
+if [ -z "$HAVE_KEYBOARD_PORTRAIT" ]; then
+    HAVE_KEYBOARD_PORTRAIT=0
+fi
+
+if [ -z "$HAVE_KEYBOARD_LANDSCAPE" ]; then
+    HAVE_KEYBOARD_LANDSCAPE=0
+fi
+
+if [ -z "$DISPLAY_CAN_ROTATE" ]; then
+    DISPLAY_CAN_ROTATE=0
+fi
+
+if [ -z "$DISPLAY_ORIENTATION" ]; then
+    DISPLAY_ORIENTATION=0
+fi
+
+if [ -e "/dev/fb" ]; then
+    if [ -z "$DISPLAY_WIDTH_PIXELS" ]; then
+        DISPLAY_WIDTH_PIXELS=`/usr/sbin/fbset | grep geometry | awk '{ print $2 }'`
+    fi
+
+    if [ -z "$DISPLAY_HEIGHT_PIXELS" ]; then
+        DISPLAY_HEIGHT_PIXELS=`/usr/sbin/fbset | grep geometry | awk '{ print $3 }'`
+    fi
+
+    if [ -z "$DISPLAY_BPP" ]; then
+        DISPLAY_BPP=`/usr/sbin/fbset | grep geometry | awk '{ print $6 }'`
+    fi
+fi
+
+# 
+# No way to guess these or have any defaults
+#
+#DISPLAY_WIDTH_MM
+#DISPLAY_HEIGHT_MM
+#DISPLAY_SUBPIXEL_ORDER=
diff --git a/meta/recipes-bsp/formfactor/files/machconfig b/meta/recipes-bsp/formfactor/files/machconfig
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/machconfig
diff --git a/meta/recipes-bsp/formfactor/files/qemuarm/machconfig b/meta/recipes-bsp/formfactor/files/qemuarm/machconfig
new file mode 100755
index 0000000..56a2ae2
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/qemuarm/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+ 
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+#DISPLAY_WIDTH_PIXELS=640
+#DISPLAY_HEIGHT_PIXELS=480
+#DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/meta/recipes-bsp/formfactor/files/qemuarmv6/machconfig b/meta/recipes-bsp/formfactor/files/qemuarmv6/machconfig
new file mode 100755
index 0000000..56a2ae2
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/qemuarmv6/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+ 
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+#DISPLAY_WIDTH_PIXELS=640
+#DISPLAY_HEIGHT_PIXELS=480
+#DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/meta/recipes-bsp/formfactor/files/qemuarmv7/machconfig b/meta/recipes-bsp/formfactor/files/qemuarmv7/machconfig
new file mode 100755
index 0000000..56a2ae2
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/qemuarmv7/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+ 
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+#DISPLAY_WIDTH_PIXELS=640
+#DISPLAY_HEIGHT_PIXELS=480
+#DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/meta/recipes-bsp/formfactor/files/qemumips/machconfig b/meta/recipes-bsp/formfactor/files/qemumips/machconfig
new file mode 100755
index 0000000..56777b6
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/qemumips/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+ 
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+DISPLAY_WIDTH_PIXELS=640
+DISPLAY_HEIGHT_PIXELS=480
+DISPLAY_BPP=16
+DISPLAY_DPI=150
+#DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/meta/recipes-bsp/formfactor/files/qemuppc/machconfig b/meta/recipes-bsp/formfactor/files/qemuppc/machconfig
new file mode 100755
index 0000000..5ea2270
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/qemuppc/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+ 
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+DISPLAY_WIDTH_PIXELS=800
+DISPLAY_HEIGHT_PIXELS=600
+DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/meta/recipes-bsp/formfactor/files/qemux86-64/machconfig b/meta/recipes-bsp/formfactor/files/qemux86-64/machconfig
new file mode 100755
index 0000000..56a2ae2
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/qemux86-64/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+ 
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+#DISPLAY_WIDTH_PIXELS=640
+#DISPLAY_HEIGHT_PIXELS=480
+#DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/meta/recipes-bsp/formfactor/files/qemux86/machconfig b/meta/recipes-bsp/formfactor/files/qemux86/machconfig
new file mode 100755
index 0000000..56a2ae2
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/files/qemux86/machconfig
@@ -0,0 +1,10 @@
+HAVE_TOUCHSCREEN=1
+HAVE_KEYBOARD=1
+ 
+DISPLAY_CAN_ROTATE=0
+DISPLAY_ORIENTATION=0
+#DISPLAY_WIDTH_PIXELS=640
+#DISPLAY_HEIGHT_PIXELS=480
+#DISPLAY_BPP=16
+DISPLAY_DPI=150
+DISPLAY_SUBPIXEL_ORDER=vrgb
diff --git a/meta/recipes-bsp/formfactor/formfactor_0.0.bb b/meta/recipes-bsp/formfactor/formfactor_0.0.bb
new file mode 100644
index 0000000..5c30bd5
--- /dev/null
+++ b/meta/recipes-bsp/formfactor/formfactor_0.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Device formfactor information"
+SECTION = "base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PR = "r45"
+
+SRC_URI = "file://config file://machconfig"
+S = "${WORKDIR}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_install() {
+	# Install file only if it has contents
+        install -d ${D}${sysconfdir}/formfactor/
+        install -m 0644 ${S}/config ${D}${sysconfdir}/formfactor/
+	if [ -s "${S}/machconfig" ]; then
+	        install -m 0644 ${S}/machconfig ${D}${sysconfdir}/formfactor/
+	fi
+}
diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-Make-setjmp.S-portable-to-ARM.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-Make-setjmp.S-portable-to-ARM.patch
new file mode 100644
index 0000000..ced128a
--- /dev/null
+++ b/meta/recipes-bsp/gnu-efi/gnu-efi/gnu-efi-Make-setjmp.S-portable-to-ARM.patch
@@ -0,0 +1,50 @@
+From 8a356d4b6a242ce63b73920d3ed33f88f9e12fe3 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Sun, 6 Sep 2015 05:20:43 -0400
+Subject: [PATCH] gnu-efi: Make setjmp.S portable to ARM
+
+This patch fixes the following error:
+
+  .../lib/arm/setjmp.S:18: Error: unrecognized symbol type ""
+  .../lib/arm/setjmp.S:26: Error: unrecognized symbol type ""
+
+The problem is the assembly syntax that is used is not portable to ARM,
+where the '@' symbol is a comment:
+
+  > Note on targets where the @ character is the start of a comment
+  > (eg ARM) then another character is used instead. For example the
+  > ARM port uses the % character.
+
+(From https://sourceware.org/binutils/docs-2.25/as/Section.html#Section)
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ lib/arm/setjmp.S | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/arm/setjmp.S b/lib/arm/setjmp.S
+index 6e3fbf0..85c8705 100644
+--- a/lib/arm/setjmp.S
++++ b/lib/arm/setjmp.S
+@@ -15,7 +15,7 @@ BASIS,
+ 	.text
+ 	.arm
+ 	.globl	setjmp
+-	.type	setjmp, @function
++	.type	setjmp, %function
+ setjmp:
+ 	mov	r3, r13
+ 	stmia	r0, {r3-r12,r14}
+@@ -23,6 +23,6 @@ setjmp:
+ 	bx	lr
+ 
+ 	.globl	longjmp
+-	.type	longjmp, @function
++	.type	longjmp, %function
+ longjmp:
+ 	ldmia	r0, {r3-r12,r14}
+-- 
+1.9.1
+
diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch
new file mode 100644
index 0000000..1b2ae1e
--- /dev/null
+++ b/meta/recipes-bsp/gnu-efi/gnu-efi/lib-Makefile-fix-parallel-issue.patch
@@ -0,0 +1,38 @@
+From 0daa354a16aa3cade56ed423d0f8a04cf1c22f9d Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 23 Apr 2015 01:49:31 -0700
+Subject: [PATCH] lib/Makefile: fix parallel issue
+
+Fixed:
+Assembler messages:
+Fatal error: can't create runtime/rtlock.o: No such file or directory
+Assembler messages:
+Fatal error: can't create runtime/rtdata.o: No such file or directory
+Assembler messages:
+Fatal error: can't create runtime/vm.o: No such file or directory
+Assembler messages:
+Fatal error: can't create runtime/efirtlib.o: No such file or directory
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ lib/Makefile |    2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index dc4b94a..f64d1ed 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -73,6 +73,8 @@ all: libsubdirs libefi.a
+ libsubdirs:
+ 	for sdir in $(SUBDIRS); do mkdir -p $$sdir; done
+ 
++$(OBJS): libsubdirs
++
+ libefi.a: $(OBJS)
+ 	$(AR) rv $@ $(OBJS)
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch
new file mode 100644
index 0000000..e5b47c1
--- /dev/null
+++ b/meta/recipes-bsp/gnu-efi/gnu-efi/parallel-make-archives.patch
@@ -0,0 +1,48 @@
+Fix parallel make failure for archives
+
+Upstream-Status: Pending
+
+The lib and gnuefi makefiles were using the lib.a() form which compiles
+and ar's as a pair instead of compiling all and then ar'ing which can
+parallelize better. This was resulting in build failures on larger values
+of -j.
+
+See http://www.chemie.fu-berlin.de/chemnet/use/info/make/make_toc.html#TOC105
+for details.
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Darren Hart <dvhart@linux.intel.com>
+---
+---
+ gnuefi/Makefile |    3 ++-
+ lib/Makefile    |    3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+Index: gnu-efi-3.0/lib/Makefile
+===================================================================
+--- gnu-efi-3.0.orig/lib/Makefile
++++ gnu-efi-3.0/lib/Makefile
+@@ -66,7 +66,8 @@ all: libsubdirs libefi.a
+ libsubdirs:
+ 	for sdir in $(SUBDIRS); do mkdir -p $$sdir; done
+ 
+-libefi.a: $(patsubst %,libefi.a(%),$(OBJS))
++libefi.a: $(OBJS)
++	$(AR) rv $@ $(OBJS)
+ 
+ clean:
+ 	rm -f libefi.a *~ $(OBJS) */*.o
+Index: gnu-efi-3.0/gnuefi/Makefile
+===================================================================
+--- gnu-efi-3.0.orig/gnuefi/Makefile
++++ gnu-efi-3.0/gnuefi/Makefile
+@@ -51,7 +51,8 @@ TARGETS	= crt0-efi-$(ARCH).o libgnuefi.a
+ 
+ all:	$(TARGETS)
+ 
+-libgnuefi.a: $(patsubst %,libgnuefi.a(%),$(OBJS))
++libgnuefi.a: $(OBJS)
++	$(AR) rv $@ $(OBJS)
+ 
+ clean:
+ 	rm -f $(TARGETS) *~ *.o $(OBJS)
diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.3.bb b/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.3.bb
new file mode 100644
index 0000000..1a1ba40
--- /dev/null
+++ b/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.3.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Libraries for producing EFI binaries"
+HOMEPAGE = "http://sourceforge.net/projects/gnu-efi/"
+SECTION = "devel"
+LICENSE = "GPLv2+ | BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://gnuefi/crt0-efi-arm.S;beginline=4;endline=9;md5=2240d7bbdf0928294c2f4a68b14d6591 \
+                    file://gnuefi/crt0-efi-aarch64.S;beginline=4;endline=16;md5=e582764a4776e60c95bf9ab617343d36 \
+                    file://inc/efishellintf.h;beginline=13;endline=20;md5=202766b79d708eff3cc70fce15fb80c7 \
+                    file://inc/efishellparm.h;beginline=4;endline=11;md5=468b1231b05bbc84bae3a0d5774e3bb5 \
+                    file://lib/arm/div64.S;beginline=6;endline=12;md5=a96c84f5ad12b4f011f98b5d039242f2 \
+                    file://lib/arm/math.c;beginline=4;endline=10;md5=64dd1987cee1dcf59d11aa572cfa644e \
+                    file://lib/arm/initplat.c;beginline=4;endline=10;md5=64dd1987cee1dcf59d11aa572cfa644e \
+                    file://lib/arm/lib1funcs.S;beginline=9;endline=33;md5=f56d5ebbc87136bc66cfe24db82bcf01 \
+                    file://lib/aarch64/math.c;beginline=9;endline=33;md5=cfade4c560e033a7bb02dab282872c7d \
+                    file://lib/aarch64/initplat.c;beginline=9;endline=33;md5=900cb1ffbe3e1ded344102be921830f1 \
+                   "
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2 \
+           file://parallel-make-archives.patch \
+           file://lib-Makefile-fix-parallel-issue.patch \
+           file://gnu-efi-Make-setjmp.S-portable-to-ARM.patch \
+          "
+
+SRC_URI[md5sum] = "15a4bcbc18a9a5e8110ed955970622e6"
+SRC_URI[sha256sum] = "c530f21a15fd9c214dd92d29a6caa20fac989289267512020b6da1f5e6f5b4cb"
+
+COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
+
+def gnu_efi_arch(d):
+    import re
+    tarch = d.getVar("TARGET_ARCH", True)
+    if re.match("i[3456789]86", tarch):
+        return "ia32"
+    return tarch
+
+EXTRA_OEMAKE = "'ARCH=${@gnu_efi_arch(d)}' 'CC=${CC}' 'AS=${AS}' 'LD=${LD}' 'AR=${AR}' \
+                'RANLIB=${RANLIB}' 'OBJCOPY=${OBJCOPY}' 'PREFIX=${prefix}' 'LIBDIR=${libdir}' \
+                "
+
+do_install() {
+        oe_runmake install INSTALLROOT="${D}"
+}
+
+FILES_${PN} += "${libdir}/*.lds"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-bsp/grub/files/0001-Fix-build-with-glibc-2.20.patch b/meta/recipes-bsp/grub/files/0001-Fix-build-with-glibc-2.20.patch
new file mode 100644
index 0000000..46aaa97
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0001-Fix-build-with-glibc-2.20.patch
@@ -0,0 +1,32 @@
+From 275fe0269ecc00af4788afaf9dc151a50b25645b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 28 Aug 2014 19:26:14 -0700
+Subject: [PATCH] Fix build with glibc 2.20
+
+* grub-core/kern/emu/hostfs.c: squahes below warning
+  warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Submitted
+
+---
+ grub-core/kern/emu/hostfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/kern/emu/hostfs.c b/grub-core/kern/emu/hostfs.c
+index 7e725f6..8dd8e65 100644
+--- a/grub-core/kern/emu/hostfs.c
++++ b/grub-core/kern/emu/hostfs.c
+@@ -19,7 +19,7 @@
+ 
+ #include <config-util.h>
+ 
+-#define _BSD_SOURCE
++#define _DEFAULT_SOURCE
+ #include <grub/fs.h>
+ #include <grub/file.h>
+ #include <grub/disk.h>
+-- 
+2.1.0
+
diff --git a/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..67dc115
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: grub-2.00/grub-core/gnulib/Makefile.am
+===================================================================
+--- grub-2.00.orig/grub-core/gnulib/Makefile.am
++++ grub-2.00/grub-core/gnulib/Makefile.am
+@@ -410,7 +410,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
diff --git a/meta/recipes-bsp/grub/files/0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch b/meta/recipes-bsp/grub/files/0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch
new file mode 100644
index 0000000..255e3eb
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Backport
+
+Original commit: http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/net/bootp.c?id=f06c2172c0b32052f22e37523445cf8e7affaea3
+
+From 149d2a14f4723778ced23f439487201ccbf1a2c9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 23 Apr 2015 07:03:34 +0000
+Subject: [PATCH] parse_dhcp_vendor: Add missing const qualifiers.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ grub-core/net/bootp.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
+index bc07d53..44131ed 100644
+--- a/grub-core/net/bootp.c
++++ b/grub-core/net/bootp.c
+@@ -52,9 +52,9 @@ set_env_limn_ro (const char *intername, const char *suffix,
+ }
+ 
+ static void
+-parse_dhcp_vendor (const char *name, void *vend, int limit, int *mask)
++parse_dhcp_vendor (const char *name, const void *vend, int limit, int *mask)
+ {
+-  grub_uint8_t *ptr, *ptr0;
++  const grub_uint8_t *ptr, *ptr0;
+ 
+   ptr = ptr0 = vend;
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-bsp/grub/files/cfg b/meta/recipes-bsp/grub/files/cfg
new file mode 100644
index 0000000..8ca53d2
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/cfg
@@ -0,0 +1,2 @@
+search.file ($cmdpath)/EFI/BOOT/grub.cfg root
+set prefix=($root)/EFI/BOOT
diff --git a/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch b/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch
new file mode 100644
index 0000000..0eece08
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/check-if-liblzma-is-disabled.patch
@@ -0,0 +1,33 @@
+Disable liblzma if --enable-liblzma=no
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1029,10 +1029,20 @@ fi
+ 
+ AC_SUBST([LIBGEOM])
+ 
+-AC_CHECK_LIB([lzma], [lzma_code],
+-             [LIBLZMA="-llzma"
+-              AC_DEFINE([HAVE_LIBLZMA], [1],
+-                        [Define to 1 if you have the LZMA library.])],)
++AC_ARG_ENABLE([liblzma],
++              [AS_HELP_STRING([--enable-liblzma],
++                              [enable liblzma integration (default=guessed)])])
++if test x"$enable_liblzma" = xno ; then
++  liblzma_excuse="explicitly disabled"
++fi
++
++if test x"$liblzma_excuse" = x ; then
++  AC_CHECK_LIB([lzma], [lzma_code],
++               [LIBLZMA="-llzma"
++                AC_DEFINE([HAVE_LIBLZMA], [1],
++                          [Define to 1 if you have the LZMA library.])],)
++fi
++
+ AC_SUBST([LIBLZMA])
+ 
+ AC_ARG_ENABLE([libzfs],
diff --git a/meta/recipes-bsp/grub/files/fix-endianness-problem.patch b/meta/recipes-bsp/grub/files/fix-endianness-problem.patch
new file mode 100644
index 0000000..079992a
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/fix-endianness-problem.patch
@@ -0,0 +1,44 @@
+grub-core/net/tftp.c: fix endianness problem.
+
+	* grub-core/net/tftp.c (ack): Fix endianness problem.
+	(tftp_receive): Likewise.
+	Reported by: Michael Davidsaver.
+
+Upstream-Status: Backport
+
+diff --git a/ChangeLog b/ChangeLog
+index 81bdae9..c2f42d5 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,9 @@
++2012-07-02  Vladimir Serbinenko  <phcoder@gmail.com>
++
++	* grub-core/net/tftp.c (ack): Fix endianness problem.
++	(tftp_receive): Likewise.
++	Reported by: Michael Davidsaver.
++
+ 2012-06-27  Vladimir Serbinenko  <phcoder@gmail.com>
+ 
+ 	* configure.ac: Bump version to 2.00.
+diff --git a/grub-core/net/tftp.c b/grub-core/net/tftp.c
+index 9c70efb..d0f39ea 100644
+--- a/grub-core/net/tftp.c
++++ b/grub-core/net/tftp.c
+@@ -143,7 +143,7 @@ ack (tftp_data_t data, grub_uint16_t block)
+ 
+   tftph_ack = (struct tftphdr *) nb_ack.data;
+   tftph_ack->opcode = grub_cpu_to_be16 (TFTP_ACK);
+-  tftph_ack->u.ack.block = block;
++  tftph_ack->u.ack.block = grub_cpu_to_be16 (block);
+ 
+   err = grub_net_send_udp_packet (data->sock, &nb_ack);
+   if (err)
+@@ -225,7 +225,7 @@ tftp_receive (grub_net_udp_socket_t sock __attribute__ ((unused)),
+ 	    grub_priority_queue_pop (data->pq);
+ 
+ 	    if (file->device->net->packs.count < 50)
+-	      err = ack (data, tftph->u.data.block);
++	      err = ack (data, data->block + 1);
+ 	    else
+ 	      {
+ 		file->device->net->stall = 1;
diff --git a/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch b/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch
new file mode 100644
index 0000000..61ae2f5
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/fix-issue-with-flex-2.5.37.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Backport
+
+This fixes compilation issues when using flex-2.5.37. It was taken from upstream.
+
+Original author is: Vladimir Serbinenko  <phcoder@gmail.com>
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: grub-2.00/grub-core/script/yylex.l
+===================================================================
+--- grub-2.00.orig/grub-core/script/yylex.l	2012-06-08 23:24:15.000000000 +0300
++++ grub-2.00/grub-core/script/yylex.l	2013-07-31 14:34:40.708100982 +0300
+@@ -29,6 +29,8 @@
+ #pragma GCC diagnostic ignored "-Wmissing-prototypes"
+ #pragma GCC diagnostic ignored "-Wmissing-declarations"
+ #pragma GCC diagnostic ignored "-Wunsafe-loop-optimizations"
++#pragma GCC diagnostic ignored "-Wunused-function"
++#pragma GCC diagnostic ignored "-Wsign-compare"
+ 
+ #define yyfree    grub_lexer_yyfree
+ #define yyalloc   grub_lexer_yyalloc
diff --git a/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch b/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch
new file mode 100644
index 0000000..eb8916c
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-2.00-add-oe-kernel.patch
@@ -0,0 +1,53 @@
+From 7ab576a7c61406b7e63739d1b11017ae336b9008 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 3 Mar 2014 03:34:48 -0500
+Subject: [PATCH] grub.d/10_linux.in: add oe's kernel name
+
+Our kernel's name is bzImage, we need add it to grub.d/10_linux.in so
+that the grub-mkconfig and grub-install can work correctly.
+
+We only need add the bzImage to util/grub.d/10_linux.in, but also add it
+to util/grub.d/20_linux_xen.in to keep compatibility.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ util/grub.d/10_linux.in     |    4 ++--
+ util/grub.d/20_linux_xen.in |    2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in
+index 14402e8..c58f417 100644
+--- a/util/grub.d/10_linux.in
++++ b/util/grub.d/10_linux.in
+@@ -153,11 +153,11 @@ EOF
+ machine=`uname -m`
+ case "x$machine" in
+     xi?86 | xx86_64)
+-	list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
++	list=`for i in /boot/bzImage-* /bzImage-* /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
+                   if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+               done` ;;
+     *) 
+-	list=`for i in /boot/vmlinuz-* /boot/vmlinux-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
++	list=`for i in /boot/bzImage-* /boot/vmlinuz-* /boot/vmlinux-* /bzImage-* /vmlinuz-* /vmlinux-* /boot/kernel-* ; do
+                   if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
+ 	     done` ;;
+ esac
+diff --git a/util/grub.d/20_linux_xen.in b/util/grub.d/20_linux_xen.in
+index 1d94502..b2decf3 100644
+--- a/util/grub.d/20_linux_xen.in
++++ b/util/grub.d/20_linux_xen.in
+@@ -138,7 +138,7 @@ EOF
+ EOF
+ }
+ 
+-linux_list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
++linux_list=`for i in /boot/bzImage[xz]-* /bzImage[xz]-* /boot/vmlinu[xz]-* /vmlinu[xz]-* /boot/kernel-*; do
+     if grub_file_is_not_garbage "$i"; then
+     	basename=$(basename $i)
+ 	version=$(echo $basename | sed -e "s,^[^0-9]*-,,g")
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch b/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch
new file mode 100644
index 0000000..09ef4db
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-2.00-fix-enable_execute_stack-check.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Pending
+
+
+This patch avoids this configure failure
+
+configure:20306: checking whether `ccache i586-poky-linux-gcc  -m32    -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow' generates calls to `__enable_execute_stack()'
+configure:20320: ccache i586-poky-linux-gcc  -m32    -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow -O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -mfpmath=387 -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -Wno-trampolines -falign-loops=1 -S conftest.c
+conftest.c:308:6: error: no previous prototype for 'g' [-Werror=missing-prototypes]
+cc1: all warnings being treated as errors
+configure:20323: $? = 1
+configure:20327: error: ccache i586-poky-linux-gcc  -m32    -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/builddisk/build/build0/tmp/sysroots/emenlow failed to produce assembly code
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/04/13
+
+Index: grub-2.00/acinclude.m4
+===================================================================
+--- grub-2.00.orig/acinclude.m4
++++ grub-2.00/acinclude.m4
+@@ -317,6 +317,7 @@ dnl Check if the C compiler generates ca
+ AC_DEFUN([grub_CHECK_ENABLE_EXECUTE_STACK],[
+ AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()'])
+ AC_LANG_CONFTEST([AC_LANG_SOURCE([[
++void g (int);
+ void f (int (*p) (void));
+ void g (int i)
+ {
diff --git a/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch b/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch
new file mode 100644
index 0000000..c557f13
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-2.00-fpmath-sse-387-fix.patch
@@ -0,0 +1,24 @@
+Upstream-Status: pending
+
+This patch fixes this configure issue for grub when -mfpmath=sse is in the gcc parameters.
+
+configure:20574: i586-poky-linux-gcc  -m32    -march=core2 -msse3 -mtune=generic -mfpmath=sse --sysroot=/usr/local/dev/yocto/grubtest2/build/tmp/sysroots/emenlow -o conftest -O2 -pipe -g -feliminate-unused-debug-types -Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes -Wundef -Wstrict-prototypes -g -falign-jumps=1 -falign-loops=1 -falign-functions=1 -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -fno-dwarf2-cfi-asm -m32 -fno-stack-protector -mno-stack-arg-probe -Werror -nostdlib -Wl,--defsym,___main=0x8100  -Wall -W -I$(top_srcdir)/include -I$(top_builddir)/include  -DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed conftest.c  >&5
+conftest.c:1:0: error: SSE instruction set disabled, using 387 arithmetics [-Werror]
+cc1: all warnings being treated as errors
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/04/13
+
+Index: grub-1.99/configure.ac
+===================================================================
+--- grub-1.99.orig/configure.ac
++++ grub-1.99/configure.ac
+@@ -378,7 +378,7 @@ if test "x$target_cpu" = xi386; then
+ 
+   # Some toolchains enable these features by default, but they need
+   # registers that aren't set up properly in GRUB.
+-  TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow"
++  TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow -mfpmath=387"
+ fi
+ 
+ # By default, GCC 4.4 generates .eh_frame sections containing unwind
diff --git a/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch b/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch
new file mode 100644
index 0000000..4588fca
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-efi-allow-a-compilation-without-mcmodel-large.patch
@@ -0,0 +1,131 @@
+Allow a compilation without -mcmodel=large
+
+It's provided by Vladimir Serbinenko, and he will commit
+it upstream so it should be backport patch.
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+--
+diff --git a/configure.ac b/configure.ac
+index 9f8fb8a..2c5e6ed 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -723,9 +723,7 @@ if test "$target_cpu" = x86_64; then
+ 		      [grub_cv_cc_mcmodel=yes],
+ 		      [grub_cv_cc_mcmodel=no])
+   ])
+-  if test "x$grub_cv_cc_mcmodel" = xno; then
+-    AC_MSG_ERROR([-mcmodel=large not supported. Upgrade your gcc.])
+-  else
++  if test "x$grub_cv_cc_mcmodel" = xyes; then
+     TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large"
+   fi
+ fi
+diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c
+index 1409b5d..6e9dace 100644
+--- a/grub-core/kern/efi/mm.c
++++ b/grub-core/kern/efi/mm.c
+@@ -32,6 +32,12 @@
+ #define BYTES_TO_PAGES(bytes)	(((bytes) + 0xfff) >> 12)
+ #define PAGES_TO_BYTES(pages)	((pages) << 12)
+
++#if defined (__code_model_large__) || !defined (__x86_64__)
++#define MAX_USABLE_ADDRESS 0xffffffff
++#else
++#define MAX_USABLE_ADDRESS 0x7fffffff
++#endif
++
+ /* The size of a memory map obtained from the firmware. This must be
+    a multiplier of 4KB.  */
+ #define MEMORY_MAP_SIZE	0x3000
+@@ -58,7 +64,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
+
+ #if 1
+   /* Limit the memory access to less than 4GB for 32-bit platforms.  */
+-  if (address > 0xffffffff)
++  if (address > MAX_USABLE_ADDRESS)
+     return 0;
+ #endif
+
+@@ -66,7 +72,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
+   if (address == 0)
+     {
+       type = GRUB_EFI_ALLOCATE_MAX_ADDRESS;
+-      address = 0xffffffff;
++      address = MAX_USABLE_ADDRESS;
+     }
+   else
+     type = GRUB_EFI_ALLOCATE_ADDRESS;
+@@ -86,7 +92,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
+     {
+       /* Uggh, the address 0 was allocated... This is too annoying,
+ 	 so reallocate another one.  */
+-      address = 0xffffffff;
++      address = MAX_USABLE_ADDRESS;
+       status = efi_call_4 (b->allocate_pages, type, GRUB_EFI_LOADER_DATA, pages, &address);
+       grub_efi_free_pages (0, pages);
+       if (status != GRUB_EFI_SUCCESS)
+@@ -319,7 +325,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
+     {
+       if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY
+ #if 1
+-	  && desc->physical_start <= 0xffffffff
++	  && desc->physical_start <= MAX_USABLE_ADDRESS
+ #endif
+ 	  && desc->physical_start + PAGES_TO_BYTES (desc->num_pages) > 0x100000
+ 	  && desc->num_pages != 0)
+@@ -337,9 +343,9 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
+ #if 1
+ 	  if (BYTES_TO_PAGES (filtered_desc->physical_start)
+ 	      + filtered_desc->num_pages
+-	      > BYTES_TO_PAGES (0x100000000LL))
++	      > BYTES_TO_PAGES (MAX_USABLE_ADDRESS+1LL))
+ 	    filtered_desc->num_pages
+-	      = (BYTES_TO_PAGES (0x100000000LL)
++	      = (BYTES_TO_PAGES (MAX_USABLE_ADDRESS+1LL)
+ 		 - BYTES_TO_PAGES (filtered_desc->physical_start));
+ #endif
+
+diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c
+index 65f09ef..17c1215 100644
+--- a/grub-core/kern/x86_64/dl.c
++++ b/grub-core/kern/x86_64/dl.c
+@@ -100,14 +100,32 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr)
+ 		    break;
+
+ 		  case R_X86_64_PC32:
+-		    *addr32 += rel->r_addend + sym->st_value -
+-		              (Elf64_Xword) seg->addr - rel->r_offset;
++		    {
++		      grub_int64_t value;
++		      value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value -
++			(Elf64_Xword) seg->addr - rel->r_offset;
++		      if (value != (grub_int32_t) value)
++			return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range");
++		      *addr32 = value;
++		    }
+ 		    break;
+
+                   case R_X86_64_32:
++		    {
++		      grub_uint64_t value = *addr32 + rel->r_addend + sym->st_value;
++		      if (value != (grub_uint32_t) value)
++			return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range");
++		      *addr32 = value;
++		    }
++		    break;
+                   case R_X86_64_32S:
+-                    *addr32 += rel->r_addend + sym->st_value;
+-                    break;
++		    {
++		      grub_int64_t value = ((grub_int32_t) *addr32) + rel->r_addend + sym->st_value;
++		      if (value != (grub_int32_t) value)
++			return grub_error (GRUB_ERR_BAD_MODULE, "relocation out of range");
++		      *addr32 = value;
++		    }
++		    break;
+
+ 		  default:
+ 		    return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
diff --git a/meta/recipes-bsp/grub/files/grub-efi-fix-with-glibc-2.20.patch b/meta/recipes-bsp/grub/files/grub-efi-fix-with-glibc-2.20.patch
new file mode 100644
index 0000000..4f12628
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-efi-fix-with-glibc-2.20.patch
@@ -0,0 +1,32 @@
+From eb6368e65f6988eebad26cebdec057f797bceb40 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 9 Sep 2014 00:02:30 -0700
+Subject: [PATCH] Fix build with glibc 2.20
+
+* grub-core/kern/emu/hostfs.c: squahes below warning
+  warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
+
+Upstream-Status: Submitted
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ grub-core/kern/emu/hostfs.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/grub-core/kern/emu/hostfs.c b/grub-core/kern/emu/hostfs.c
+index 3cb089c..a51ee32 100644
+--- a/grub-core/kern/emu/hostfs.c
++++ b/grub-core/kern/emu/hostfs.c
+@@ -16,7 +16,7 @@
+  *  You should have received a copy of the GNU General Public License
+  *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+  */
+-#define _BSD_SOURCE
++#define _DEFAULT_SOURCE
+ #include <grub/fs.h>
+ #include <grub/file.h>
+ #include <grub/disk.h>
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-bsp/grub/files/grub-install.in.patch b/meta/recipes-bsp/grub/files/grub-install.in.patch
new file mode 100644
index 0000000..326951d
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-install.in.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Our use of grub-install doesn't require the -x option, so we should be
+be able make use of grep versions that don't support it.
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: grub-1.99/util/grub-install.in
+===================================================================
+--- grub-1.99.orig/util/grub-install.in	2011-09-09 22:37:20.093906679 -0500
++++ grub-1.99/util/grub-install.in	2011-09-09 22:37:30.854737882 -0500
+@@ -510,7 +510,7 @@
+ 
+ if [ "x${devabstraction_module}" = "x" ] ; then
+     if [ x"${install_device}" != x ]; then
+-      if echo "${install_device}" | grep -qx "(.*)" ; then
++      if echo "${install_device}" | grep -q "(.*)" ; then
+         install_drive="${install_device}"
+       else
+         install_drive="`"$grub_probe" --device-map="${device_map}" --target=drive --device "${install_device}"`" || exit 1
diff --git a/meta/recipes-bsp/grub/files/grub-no-unused-result.patch b/meta/recipes-bsp/grub/files/grub-no-unused-result.patch
new file mode 100644
index 0000000..4cbd083
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub-no-unused-result.patch
@@ -0,0 +1,19 @@
+Signed-off-by: Radu Moisan <radu.moisan@intel.com>
+Upstream-Status: Pending
+
+I had an error because of an unused return value for read().
+I added -Wno-unused-result.
+
+Index: grub-2.00/configure.ac
+===================================================================
+--- grub-2.00.orig/configure.ac	2012-08-13 16:32:33.000000000 +0300
++++ grub-2.00/configure.ac	2012-08-13 16:38:22.000000000 +0300
+@@ -394,7 +394,7 @@
+ LIBS=""
+ 
+ # debug flags.
+-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
++WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wno-unused-result -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
+ HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
+ TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
+ TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
diff --git a/meta/recipes-bsp/grub/files/grub2-fix-initrd-size-bug.patch b/meta/recipes-bsp/grub/files/grub2-fix-initrd-size-bug.patch
new file mode 100644
index 0000000..d114f48
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub2-fix-initrd-size-bug.patch
@@ -0,0 +1,48 @@
+From 8fbb150a56966edde4dc07b8d01be5eb149b65ab Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@ubuntu.com>
+Date: Sun, 20 Jan 2013 23:03:35 +0000
+Subject: [PATCH 1/1] * grub-core/loader/i386/linux.c (grub_cmd_initrd): Don't
+ add the initrd size to addr_min, since the initrd will be allocated after
+ this address.
+
+commit 6a0debbd9167e8f79cdef5497a73d23e580c0cd4 upstream
+
+Upstream-Status: Backport
+
+Signed-off-by: Shan Hai <shan.hai@windriver.com>
+---
+ ChangeLog                     | 6 ++++++
+ grub-core/loader/i386/linux.c | 3 +--
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index c2f42d5..40cb508 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,9 @@
++2013-01-20  Colin Watson  <cjwatson@ubuntu.com>
++
++	* grub-core/loader/i386/linux.c (grub_cmd_initrd): Don't add the
++	initrd size to addr_min, since the initrd will be allocated after
++	this address.
++
+ 2012-07-02  Vladimir Serbinenko  <phcoder@gmail.com>
+ 
+ 	* grub-core/net/tftp.c (ack): Fix endianness problem.
+diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
+index 62087cf..e2425c8 100644
+--- a/grub-core/loader/i386/linux.c
++++ b/grub-core/loader/i386/linux.c
+@@ -1098,8 +1098,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)),
+      worse than that of Linux 2.3.xx, so avoid the last 64kb.  */
+   addr_max -= 0x10000;
+ 
+-  addr_min = (grub_addr_t) prot_mode_target + prot_init_space
+-             + page_align (size);
++  addr_min = (grub_addr_t) prot_mode_target + prot_init_space;
+ 
+   /* Put the initrd as high as possible, 4KiB aligned.  */
+   addr = (addr_max - size) & ~0xFFF;
+-- 
+1.8.5.2.233.g932f7e4
+
diff --git a/meta/recipes-bsp/grub/files/grub2-remove-sparc64-setup-from-x86-builds.patch b/meta/recipes-bsp/grub/files/grub2-remove-sparc64-setup-from-x86-builds.patch
new file mode 100644
index 0000000..6259a1a
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/grub2-remove-sparc64-setup-from-x86-builds.patch
@@ -0,0 +1,104 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+remove the grub-sparc64-setup files from the x86 builds.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+--- a/Makefile.util.am	2014-08-15 11:41:02.441011278 -0700
++++ b/Makefile.util.am	2014-08-15 11:44:26.245021142 -0700
+@@ -4692,9 +4692,9 @@
+ endif
+ 
+ if COND_emu
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+ 
+ grub-sparc64-setup.8: grub-sparc64-setup
+ 	chmod a+x grub-sparc64-setup
+@@ -4715,9 +4715,9 @@
+ endif
+ 
+ if COND_i386_pc
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+ 
+ grub-sparc64-setup.8: grub-sparc64-setup
+ 	chmod a+x grub-sparc64-setup
+@@ -4738,9 +4738,9 @@
+ endif
+ 
+ if COND_i386_efi
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+ 
+ grub-sparc64-setup.8: grub-sparc64-setup
+ 	chmod a+x grub-sparc64-setup
+@@ -4761,9 +4761,9 @@
+ endif
+ 
+ if COND_i386_qemu
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+ 
+ grub-sparc64-setup.8: grub-sparc64-setup
+ 	chmod a+x grub-sparc64-setup
+@@ -4784,9 +4784,9 @@
+ endif
+ 
+ if COND_i386_coreboot
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+ 
+ grub-sparc64-setup.8: grub-sparc64-setup
+ 	chmod a+x grub-sparc64-setup
+@@ -4807,9 +4807,9 @@
+ endif
+ 
+ if COND_i386_multiboot
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+ 
+ grub-sparc64-setup.8: grub-sparc64-setup
+ 	chmod a+x grub-sparc64-setup
+@@ -4830,9 +4830,9 @@
+ endif
+ 
+ if COND_i386_ieee1275
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+ 
+ grub-sparc64-setup.8: grub-sparc64-setup
+ 	chmod a+x grub-sparc64-setup
+@@ -4853,9 +4853,9 @@
+ endif
+ 
+ if COND_x86_64_efi
+-sbin_PROGRAMS += grub-sparc64-setup
++sbin_PROGRAMS +=
+ if COND_MAN_PAGES
+-man_MANS += grub-sparc64-setup.8
++man_MANS +=
+ 
+ grub-sparc64-setup.8: grub-sparc64-setup
+ 	chmod a+x grub-sparc64-setup
diff --git a/meta/recipes-bsp/grub/files/remove-gets.patch b/meta/recipes-bsp/grub/files/remove-gets.patch
new file mode 100644
index 0000000..463f784
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/remove-gets.patch
@@ -0,0 +1,20 @@
+ISO C11 removes the specification of gets() from the C language, eglibc 2.16+ removed it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: grub-1.99/grub-core/gnulib/stdio.in.h
+===================================================================
+--- grub-1.99.orig/grub-core/gnulib/stdio.in.h	2010-12-01 06:45:43.000000000 -0800
++++ grub-1.99/grub-core/gnulib/stdio.in.h	2012-07-04 12:25:02.057099107 -0700
+@@ -140,8 +140,10 @@
+ /* It is very rare that the developer ever has full control of stdin,
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
++#if defined gets
+ #undef gets
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
++#endif
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/meta/recipes-bsp/grub/grub-0.97/autohell.patch b/meta/recipes-bsp/grub/grub-0.97/autohell.patch
new file mode 100644
index 0000000..d66207a
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/autohell.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ configure.ac |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: grub-0.97/configure.ac
+===================================================================
+--- grub-0.97.orig/configure.ac	2008-09-12 17:39:52.000000000 +0200
++++ grub-0.97/configure.ac	2008-09-12 17:40:21.000000000 +0200
+@@ -60,8 +60,8 @@ AC_PROG_CC
+ _AM_DEPENDENCIES(CC)
+ 
+ dnl Because recent automake complains about AS, set it here.
+-CCAS="$CC"
+-AC_SUBST(CCAS)
++AM_PROG_AS
++AC_SUBST(AS)
+ 
+ AC_ARG_WITH(binutils,
+   [  --with-binutils=DIR     search the directory DIR to find binutils])
diff --git a/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch b/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch
new file mode 100644
index 0000000..d225d13
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch
@@ -0,0 +1,101 @@
+Upstream-Status: Inappropriate [No Longer Maintained]
+
+diff -Naur grub-0.97-800/stage2/fsys_ext2fs.c grub-0.97-810/stage2/fsys_ext2fs.c
+--- grub-0.97-800/stage2/fsys_ext2fs.c	2008-07-21 00:40:21.668879475 -0600
++++ grub-0.97-810/stage2/fsys_ext2fs.c	2008-07-21 01:01:11.063953773 -0600
+@@ -79,7 +79,52 @@
+     __u32 s_rev_level;		/* Revision level */
+     __u16 s_def_resuid;		/* Default uid for reserved blocks */
+     __u16 s_def_resgid;		/* Default gid for reserved blocks */
+-    __u32 s_reserved[235];	/* Padding to the end of the block */
++    /*
++     * These fields are for EXT2_DYNAMIC_REV superblocks only.
++     *
++     * Note: the difference between the compatible feature set and
++     * the incompatible feature set is that if there is a bit set
++     * in the incompatible feature set that the kernel doesn't
++     * know about, it should refuse to mount the filesystem.
++     *
++     * e2fsck's requirements are more strict; if it doesn't know
++     * about a feature in either the compatible or incompatible
++     * feature set, it must abort and not try to meddle with
++     * things it doesn't understand...
++     */
++    __u32 s_first_ino;		/* First non-reserved inode */
++    __u16 s_inode_size;		/* size of inode structure */
++    __u16 s_block_group_nr;	/* block group # of this superblock */
++    __u32 s_feature_compat;	/* compatible feature set */
++    __u32 s_feature_incompat;	/* incompatible feature set */
++    __u32 s_feature_ro_compat;	/* readonly-compatible feature set */
++    __u8  s_uuid[16];		/* 128-bit uuid for volume */
++    char  s_volume_name[16];	/* volume name */
++    char  s_last_mounted[64];	/* directory where last mounted */
++    __u32 s_algorithm_usage_bitmap; /* For compression */
++    /*
++     * Performance hints.  Directory preallocation should only
++     * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on.
++     */
++    __u8  s_prealloc_blocks;	/* Nr of blocks to try to preallocate*/
++    __u8  s_prealloc_dir_blocks;	/* Nr to preallocate for dirs */
++    __u16 s_reserved_gdt_blocks;/* Per group table for online growth */
++    /*
++     * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.
++     */
++    __u8 s_journal_uuid[16];	/* uuid of journal superblock */
++    __u32 s_journal_inum;	/* inode number of journal file */
++    __u32 s_journal_dev;	/* device number of journal file */
++    __u32 s_last_orphan;	/* start of list of inodes to delete */
++    __u32 s_hash_seed[4];	/* HTREE hash seed */
++    __u8  s_def_hash_version;	/* Default hash version to use */
++    __u8  s_jnl_backup_type; 	/* Default type of journal backup */
++    __u16 s_reserved_word_pad;
++    __u32 s_default_mount_opts;
++    __u32 s_first_meta_bg;	/* First metablock group */
++    __u32 s_mkfs_time;		/* When the filesystem was created */
++    __u32 s_jnl_blocks[17]; 	/* Backup of the journal inode */
++    __u32 s_reserved[172];	/* Padding to the end of the block */
+   };
+ 
+ struct ext2_group_desc
+@@ -218,6 +263,14 @@
+ #define EXT2_ADDR_PER_BLOCK(s)          (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
+ #define EXT2_ADDR_PER_BLOCK_BITS(s)		(log2(EXT2_ADDR_PER_BLOCK(s)))
+ 
++#define EXT2_GOOD_OLD_REV   0   /* The good old (original) format */
++#define EXT2_DYNAMIC_REV    1   /* V2 format w/ dynamic inode sizes */
++#define EXT2_GOOD_OLD_INODE_SIZE 128
++#define EXT2_INODE_SIZE(s)  (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
++                 EXT2_GOOD_OLD_INODE_SIZE : \
++                 (s)->s_inode_size)
++#define EXT2_INODES_PER_BLOCK(s)	(EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))
++
+ /* linux/ext2_fs.h */
+ #define EXT2_BLOCK_SIZE_BITS(s)        ((s)->s_log_block_size + 10)
+ /* kind of from ext2/super.c */
+@@ -553,7 +606,7 @@
+       gdp = GROUP_DESC;
+       ino_blk = gdp[desc].bg_inode_table +
+ 	(((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
+-	 >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
++	 >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
+ #ifdef E2DEBUG
+       printf ("inode table fsblock=%d\n", ino_blk);
+ #endif /* E2DEBUG */
+@@ -565,13 +618,12 @@
+       /* reset indirect blocks! */
+       mapblock2 = mapblock1 = -1;
+ 
+-      raw_inode = INODE +
+-	((current_ino - 1)
+-	 & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1));
++      raw_inode = (struct ext2_inode *)((char *)INODE +
++	((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) *
++	EXT2_INODE_SIZE (SUPERBLOCK));
+ #ifdef E2DEBUG
+       printf ("ipb=%d, sizeof(inode)=%d\n",
+-	      (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)),
+-	      sizeof (struct ext2_inode));
++	      EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK));
+       printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode);
+       printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE);
+       for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode;
diff --git a/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch b/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..0cf7dc9
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/grub_fix_for_automake-1.12.patch
@@ -0,0 +1,74 @@
+Upstream-Status: Inappropriate
+
+Subject: [PATCH] grub: fix for automake-1.12
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| stage1/Makefile.am:2: error: 'pkglibdir' is not a legitimate directory for 'DATA'
+| stage2/Makefile.am:35: error: 'pkglibdir' is not a legitimate directory for 'DATA'
+| stage2/Makefile.am:46: error: 'pkglibdir' is not a legitimate directory for 'DATA'
+| autoreconf: automake failed with exit status: 1
+| ERROR: autoreconf execution failed.
+
+The upstream status is marked as 'Inappropriate' because this problem is not uncommon,
+it has been there for a long time and no change in upstream.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+Index: grub-0.97/stage1/Makefile.am
+===================================================================
+--- a/stage1/Makefile.am
++++ b/stage1/Makefile.am
+@@ -1,7 +1,7 @@
+-pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
+-nodist_pkglib_DATA = stage1
++pkgdatadir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
++nodist_pkgdata_DATA = stage1
+ 
+-CLEANFILES = $(nodist_pkglib_DATA)
++CLEANFILES = $(nodist_pkgdata_DATA)
+ 
+ # We can't use builtins or standard includes.
+ AM_CCASFLAGS = $(STAGE1_CFLAGS) -fno-builtin -nostdinc
+Index: grub-0.97/stage2/Makefile.am
+===================================================================
+--- a/stage2/Makefile.am
++++ b/stage2/Makefile.am
+@@ -27,12 +27,12 @@ libgrub_a_CFLAGS = $(GRUB_CFLAGS) -I$(top_srcdir)/lib \
+ 	-DUSE_MD5_PASSWORDS=1 -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1
+ 
+ # Stage 2 and Stage 1.5's.
+-pkglibdir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
++pkgdatadir = $(libdir)/$(PACKAGE)/$(host_cpu)-$(host_vendor)
+ 
+ EXTRA_PROGRAMS = nbloader.exec pxeloader.exec diskless.exec
+ 
+ if DISKLESS_SUPPORT
+-pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
++pkgdata_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
+ 	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
+ 	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5 \
+ 	nbgrub pxegrub
+@@ -43,7 +43,7 @@ noinst_PROGRAMS = pre_stage2.exec start.exec start_eltorito.exec \
+ 	reiserfs_stage1_5.exec ufs2_stage1_5.exec vstafs_stage1_5.exec \
+ 	xfs_stage1_5.exec nbloader.exec pxeloader.exec diskless.exec
+ else
+-pkglib_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
++pkgdata_DATA = stage2 stage2_eltorito e2fs_stage1_5 fat_stage1_5 \
+ 	ffs_stage1_5 iso9660_stage1_5 jfs_stage1_5 minix_stage1_5 \
+ 	reiserfs_stage1_5 ufs2_stage1_5 vstafs_stage1_5 xfs_stage1_5
+ noinst_DATA = pre_stage2 start start_eltorito
+@@ -105,7 +105,7 @@ else
+ BUILT_SOURCES = stage2_size.h
+ endif
+ 
+-CLEANFILES = $(pkglib_DATA) $(noinst_DATA) $(BUILT_SOURCES)
++CLEANFILES = $(pkgdata_DATA) $(noinst_DATA) $(BUILT_SOURCES)
+ 
+ stage2_size.h: pre_stage2
+ 	-rm -f stage2_size.h
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch b/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
new file mode 100644
index 0000000..70037e4
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [disable feature]
+
+After the commit "tcmode-default: switch to gcc 4.6.0 for x86, x86-64 & arm",
+we got bug 1099 (http://bugzilla.yoctoproject.org/show_bug.cgi?id=1099):
+
+Running "install --stage2=/ssd/boot/grub/stage2 /boot/grub/stage1(hd0)
+     /boot/grub/stage2 p /boot/grub/menu list" failed
+Error 6: Mismatched or corrupt version of stage1/stage2
+
+This turned out to be a gcc's bug. See
+https://bugs.gentoo.org/show_bug.cgi?id=360513
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333
+
+Upstream gcc seems uninterested in the bug, so at present we can disable the
+option as a workaround. Thanks Ryan Hill for the investigation and the
+workaround patch.
+
+Dexuan Cui <dexuan.cui@intel.com>
+Wed Jun 29 20:21:39 CST 2011
+
+--- grub-0.97/stage2/Makefile.am.orig
++++ grub-0.97/stage2/Makefile.am
+@@ -79,7 +79,7 @@
+ HERCULES_FLAGS =
+ endif
+ 
+-STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
++STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-reorder-functions -fno-builtin -nostdinc \
+ 	$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
+ 
+ STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
diff --git a/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch b/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch
new file mode 100644
index 0000000..bd8e0a8
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/objcopy-absolute.patch
@@ -0,0 +1,40 @@
+
+This patch is from ubuntu:
+  * objcopy-absolute.diff (update): Remove .note, .comment, and
+    .note.gnu.build-id sections from images (LP: #444703).
+
+Upstream-Status: Inappropriate [no longer maintained]
+
+Index: b/acinclude.m4
+===================================================================
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -61,7 +61,7 @@
+   else
+     AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr])
+   fi
+-  if AC_TRY_COMMAND([${OBJCOPY-objcopy} -O binary conftest.exec conftest]); then :
++  if AC_TRY_COMMAND([${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then :
+   else
+     AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files])
+   fi
+Index: b/stage1/Makefile.am
+===================================================================
+--- a/stage1/Makefile.am
++++ b/stage1/Makefile.am
+@@ -12,4 +12,4 @@
+
+ SUFFIXES = .exec
+ .exec:
+-	$(OBJCOPY) -O binary $< $@
++	$(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
+Index: b/stage2/Makefile.am
+===================================================================
+--- a/stage2/Makefile.am
++++ b/stage2/Makefile.am
+@@ -293,4 +293,4 @@
+ # General rule for making a raw binary.
+ SUFFIXES = .exec
+ .exec:
+-	$(OBJCOPY) -O binary $< $@
++	$(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@
diff --git a/meta/recipes-bsp/grub/grub-efi_2.00.bb b/meta/recipes-bsp/grub/grub-efi_2.00.bb
new file mode 100644
index 0000000..7b44eab
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-efi_2.00.bb
@@ -0,0 +1,66 @@
+require grub2.inc
+
+DEPENDS_class-target = "grub-efi-native"
+RDEPENDS_${PN}_class-target = "diffutils freetype"
+PR = "r3"
+
+SRC_URI += " \
+           file://cfg \
+          "
+
+S = "${WORKDIR}/grub-${PV}"
+
+# Determine the target arch for the grub modules
+python __anonymous () {
+    import re
+    target = d.getVar('TARGET_ARCH', True)
+    if target == "x86_64":
+        grubtarget = 'x86_64'
+        grubimage = "bootx64.efi"
+    elif re.match('i.86', target):
+        grubtarget = 'i386'
+        grubimage = "bootia32.efi"
+    else:
+        raise bb.parse.SkipPackage("grub-efi is incompatible with target %s" % target)
+    d.setVar("GRUB_TARGET", grubtarget)
+    d.setVar("GRUB_IMAGE", grubimage)
+}
+
+inherit deploy
+
+CACHED_CONFIGUREVARS += "ac_cv_path_HELP2MAN="
+EXTRA_OECONF = "--with-platform=efi --disable-grub-mkfont \
+                --enable-efiemu=no --program-prefix='' \
+                --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
+
+do_install_class-native() {
+	install -d ${D}${bindir}
+	install -m 755 grub-mkimage ${D}${bindir}
+}
+
+GRUB_BUILDIN ?= "boot linux ext2 fat serial part_msdos part_gpt normal efi_gop iso9660 search"
+
+do_deploy() {
+	# Search for the grub.cfg on the local boot media by using the
+	# built in cfg file provided via this recipe
+	grub-mkimage -c ../cfg -p /EFI/BOOT -d ./grub-core/ \
+	               -O ${GRUB_TARGET}-efi -o ./${GRUB_IMAGE} \
+	               ${GRUB_BUILDIN}
+	install -m 644 ${B}/${GRUB_IMAGE} ${DEPLOYDIR}
+}
+
+do_deploy_class-native() {
+	:
+}
+
+addtask deploy after do_install before do_build
+
+FILES_${PN}-dbg += "${libdir}/grub/${GRUB_TARGET}-efi/.debug \
+                   /boot/efi/EFI/BOOT/${GRUB_TARGET}-efi/.debug \
+                    "
+FILES_${PN} += "${libdir}/grub/${GRUB_TARGET}-efi \
+                ${datadir}/grub \
+                "
+
+BBCLASSEXTEND = "native"
+
diff --git a/meta/recipes-bsp/grub/grub/autogen.sh-exclude-pc.patch b/meta/recipes-bsp/grub/grub/autogen.sh-exclude-pc.patch
new file mode 100644
index 0000000..fc5aa4e
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub/autogen.sh-exclude-pc.patch
@@ -0,0 +1,34 @@
+From ff8f68cc48fd3c30d55e1d570d51f2e0952c968e Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sat, 25 Jan 2014 23:49:44 -0500
+Subject: [PATCH] autogen.sh: exclude .pc from po/POTFILES.in
+
+Exclude the .pc from po/POTFILES.in since quilt uses "patch --backup",
+which will create the backup file under .pc, this may cause unexpected
+errors, for example, on CentOS 5.x, if the backup file is null
+(newfile), it's mode will be 000, then we will get errors when xgettext
+try to read it.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ autogen.sh |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/autogen.sh b/autogen.sh
+index 7424428..843619e 100755
+--- a/autogen.sh
++++ b/autogen.sh
+@@ -5,7 +5,7 @@ set -e
+ export LC_COLLATE=C
+ unset LC_ALL
+ 
+-find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c'  ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
++find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c'  ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' ! -path './.pc/*' | sort > po/POTFILES.in
+ find util -iname '*.in' ! -name Makefile.in  |sort > po/POTFILES-shell.in
+ 
+ echo "Importing unicode..."
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
new file mode 100644
index 0000000..312771b
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -0,0 +1,51 @@
+SUMMARY = "GRUB2 is the next-generation GRand Unified Bootloader"
+
+DESCRIPTION = "GRUB2 is the next generaion of a GPLed bootloader \
+intended to unify bootloading across x86 operating systems. In \
+addition to loading the Linux kernel, it implements the Multiboot \
+standard, which allows for flexible loading of multiple boot images."
+
+HOMEPAGE = "http://www.gnu.org/software/grub/"
+SECTION = "bootloaders"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "ftp://ftp.gnu.org/gnu/grub/grub-${PV}.tar.gz \
+           file://grub-2.00-fpmath-sse-387-fix.patch \
+           file://check-if-liblzma-is-disabled.patch \
+           file://fix-issue-with-flex-2.5.37.patch \
+           file://grub-2.00-add-oe-kernel.patch \
+           file://grub-install.in.patch \
+           file://remove-gets.patch \
+           file://fix-endianness-problem.patch \
+           file://grub2-remove-sparc64-setup-from-x86-builds.patch \
+           file://grub-2.00-fix-enable_execute_stack-check.patch \
+           file://grub-no-unused-result.patch \
+           file://grub-efi-allow-a-compilation-without-mcmodel-large.patch \
+           file://grub-efi-fix-with-glibc-2.20.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           file://0001-parse_dhcp_vendor-Add-missing-const-qualifiers.patch \
+           file://grub2-fix-initrd-size-bug.patch \
+            "
+
+DEPENDS = "flex-native bison-native xz"
+
+SRC_URI[md5sum] = "e927540b6eda8b024fb0391eeaa4091c"
+SRC_URI[sha256sum] = "65b39a0558f8c802209c574f4d02ca263a804e8a564bc6caf1cd0fd3b3cc11e3"
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*)-(linux|freebsd.*)'
+
+inherit autotools gettext texinfo
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[grub-mount] = "--enable-grub-mount,--disable-grub-mount,fuse"
+PACKAGECONFIG[device-mapper] = "--enable-device-mapper,--disable-device-mapper,lvm2"
+
+# grub and grub-efi's sysroot/${datadir}/grub/grub-mkconfig_lib are
+# conflicted, remove it since no one uses it.
+SYSROOT_PREPROCESS_FUNCS_class-target += "remove_sysroot_mkconfig_lib"
+remove_sysroot_mkconfig_lib() {
+    rm -r "${SYSROOT_DESTDIR}${datadir}/grub/grub-mkconfig_lib"
+}
+
diff --git a/meta/recipes-bsp/grub/grub_0.97.bb b/meta/recipes-bsp/grub/grub_0.97.bb
new file mode 100644
index 0000000..997a045
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub_0.97.bb
@@ -0,0 +1,35 @@
+SUMMARY = "GRUB is the GRand Unified Bootloader"
+DESCRIPTION = "GRUB is a GPLed bootloader intended to unify bootloading across x86 \
+operating systems. In addition to loading the Linux kernel, it implements the Multiboot \
+standard, which allows for flexible loading of multiple boot images."
+HOMEPAGE = "http://www.gnu.org/software/grub/"
+SECTION = "bootloaders"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b \
+                    file://grub/main.c;beginline=3;endline=9;md5=22a5f28d2130fff9f2a17ed54be90ed6"
+
+RDEPENDS_${PN} = "diffutils"
+PR = "r6"
+
+SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz; \
+           file://no-reorder-functions.patch \
+           file://autohell.patch \
+           file://grub_fix_for_automake-1.12.patch \
+           file://objcopy-absolute.patch \
+           file://grub-support-256byte-inode.patch \
+"
+
+SRC_URI[md5sum] = "cd3f3eb54446be6003156158d51f4884"
+SRC_URI[sha256sum] = "4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b"
+
+inherit autotools texinfo
+
+COMPATIBLE_HOST = "i.86.*-linux"
+
+EXTRA_OECONF = "--without-curses"
+
+do_install_append_vmware() {
+	mkdir -p ${D}/boot/
+	ln -sf ../usr/lib/grub/{$TARGET_ARCH}{$TARGET_VENDOR}/ ${D}/boot/grub
+}
diff --git a/meta/recipes-bsp/grub/grub_2.00.bb b/meta/recipes-bsp/grub/grub_2.00.bb
new file mode 100644
index 0000000..88a709e
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub_2.00.bb
@@ -0,0 +1,17 @@
+require grub2.inc
+
+RDEPENDS_${PN} = "diffutils freetype"
+PR = "r1"
+
+FILES_${PN}-dbg += "${libdir}/${BPN}/i386-pc/.debug"
+
+
+EXTRA_OECONF = "--with-platform=pc --disable-grub-mkfont --program-prefix="" \
+               --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
+
+do_install_append () {
+    install -d ${D}${sysconfdir}/grub.d
+}
+
+INSANE_SKIP_${PN} = "arch"
+INSANE_SKIP_${PN}-dbg = "arch"
diff --git a/meta/recipes-bsp/grub/grub_git.bb b/meta/recipes-bsp/grub/grub_git.bb
new file mode 100644
index 0000000..c2760c9
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub_git.bb
@@ -0,0 +1,50 @@
+require grub2.inc
+
+DEPENDS += "autogen-native"
+
+DEFAULT_PREFERENCE = "-1"
+DEFAULT_PREFERENCE_arm = "1"
+
+PV = "2.00+${SRCPV}"
+SRCREV = "87de66d9d83446ecddb29cfbdf7369102c8e209e"
+SRC_URI = "git://git.savannah.gnu.org/grub.git \
+           file://grub-2.00-fpmath-sse-387-fix.patch \
+           file://autogen.sh-exclude-pc.patch \
+           file://grub-2.00-add-oe-kernel.patch \
+           file://0001-Fix-build-with-glibc-2.20.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*)-(linux.*|freebsd.*)'
+
+inherit autotools gettext texinfo
+
+# configure.ac has code to set this automagically from the target tuple
+# but the OE freeform one (core2-foo-bar-linux) don't work with that.
+
+GRUBPLATFORM_arm = "uboot"
+GRUBPLATFORM_aarch64 = "efi"
+GRUBPLATFORM ??= "pc"
+
+EXTRA_OECONF = "--with-platform=${GRUBPLATFORM} --disable-grub-mkfont --program-prefix="" \
+                --enable-liblzma=no --enable-device-mapper=no --enable-libzfs=no"
+
+do_configure_prepend() {
+    ( cd ${S}
+      ${S}/autogen.sh )
+}
+
+do_install_append () {
+    install -d ${D}${sysconfdir}/grub.d
+ 
+}
+
+# debugedit chokes on bare metal binaries
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+RDEPENDS_${PN} = "diffutils freetype"
+FILES_${PN}-dbg += "${libdir}/${BPN}/*/.debug"
+
+INSANE_SKIP_${PN} = "arch"
+INSANE_SKIP_${PN}-dbg = "arch"
diff --git a/meta/recipes-bsp/gummiboot/gummiboot/fix-objcopy.patch b/meta/recipes-bsp/gummiboot/gummiboot/fix-objcopy.patch
new file mode 100644
index 0000000..49f5593
--- /dev/null
+++ b/meta/recipes-bsp/gummiboot/gummiboot/fix-objcopy.patch
@@ -0,0 +1,45 @@
+From 0f7f9e3bb1d0e1b93f3ad8a1d5d7bdd3fbf27494 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 27 Mar 2014 07:20:33 +0000
+Subject: [PATCH] Makefile.am: use objcopy from the env
+
+It uses the "objcopy" directly, which is not suitable for cross compile.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.am | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+Index: git/Makefile.am
+===================================================================
+--- git.orig/Makefile.am
++++ git/Makefile.am
+@@ -19,6 +19,8 @@
+ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+ AM_MAKEFLAGS = --no-print-directory
+ 
++OBJCOPY ?= objcopy
++
+ gummibootlibdir = $(prefix)/lib/gummiboot
+ 
+ AM_CPPFLAGS = -include config.h
+@@ -148,7 +150,7 @@ $(gummiboot_solib): $(gummiboot_objects)
+ .DELETE_ON_ERROR: $(gummboot_solib)
+ 
+ $(gummiboot): $(gummiboot_solib)
+-	$(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
++	$(AM_V_GEN) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
+ 	  -j .dynsym -j .rel -j .rela -j .reloc \
+ 	  --target=efi-app-$(ARCH) $< $@
+ 
+@@ -183,7 +185,7 @@ $(stub_solib): $(stub_objects)
+ .DELETE_ON_ERROR: $(gummboot_solib)
+ 
+ $(stub): $(stub_solib)
+-	$(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
++	$(AM_V_GEN) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
+ 	  -j .dynsym -j .rel -j .rela -j .reloc \
+ 	  --target=efi-app-$(ARCH) $< $@
+ 
diff --git a/meta/recipes-bsp/gummiboot/gummiboot_git.bb b/meta/recipes-bsp/gummiboot/gummiboot_git.bb
new file mode 100644
index 0000000..91c3db9
--- /dev/null
+++ b/meta/recipes-bsp/gummiboot/gummiboot_git.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Gummiboot is a simple UEFI boot manager which executes configured EFI images."
+HOMEPAGE = "http://freedesktop.org/wiki/Software/gummiboot"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "gnu-efi util-linux"
+
+inherit autotools pkgconfig
+inherit deploy
+
+PV = "48+git${SRCPV}"
+SRCREV = "2bcd919c681c952eb867ef1bdb458f1bc49c2d55"
+SRC_URI = "git://anongit.freedesktop.org/gummiboot \
+           file://fix-objcopy.patch \
+          "
+
+# Note: Add COMPATIBLE_HOST here is only because it depends on gnu-efi
+# which has set the COMPATIBLE_HOST, the gummiboot itself may work on
+# more hosts.
+COMPATIBLE_HOST = "(x86_64.*|i.86.*)-linux"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "--disable-manpages --with-efi-includedir=${STAGING_INCDIR} \
+                --with-efi-ldsdir=${STAGING_LIBDIR} \
+                --with-efi-libdir=${STAGING_LIBDIR}"
+
+EXTRA_OEMAKE += "gummibootlibdir=${libdir}/gummiboot"
+
+do_deploy () {
+        install ${B}/gummiboot*.efi ${DEPLOYDIR}
+}
+addtask deploy before do_build after do_compile
diff --git a/meta/recipes-bsp/hostap/files/COPYING.patch b/meta/recipes-bsp/hostap/files/COPYING.patch
new file mode 100644
index 0000000..05c70c9
--- /dev/null
+++ b/meta/recipes-bsp/hostap/files/COPYING.patch
@@ -0,0 +1,346 @@
+Upstream-Status: Inappropriate [other]
+
+diff -ruN hostap-conf-1.0-orig/COPYING hostap-conf-1.0/COPYING
+--- hostap-conf-1.0-orig/COPYING	1970-01-01 08:00:00.000000000 +0800
++++ hostap-conf-1.0/COPYING	2010-12-09 16:36:48.000000000 +0800
+@@ -0,0 +1,340 @@
++		    GNU GENERAL PUBLIC LICENSE
++		       Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
++                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++			    Preamble
++
++  The licenses for most software are designed to take away your
++freedom to share and change it.  By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users.  This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it.  (Some other Free Software Foundation software is covered by
++the GNU Library General Public License instead.)  You can apply it to
++your programs, too.
++
++  When we speak of free software, we are referring to freedom, not
++price.  Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++  To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++  For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have.  You must make sure that they, too, receive or can get the
++source code.  And you must show them these terms so they know their
++rights.
++
++  We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++  Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software.  If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++  Finally, any free program is threatened constantly by software
++patents.  We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary.  To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++  The precise terms and conditions for copying, distribution and
++modification follow.
++
++		    GNU GENERAL PUBLIC LICENSE
++   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++  0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License.  The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language.  (Hereinafter, translation is included without limitation in
++the term "modification".)  Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope.  The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++  1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++  2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++    a) You must cause the modified files to carry prominent notices
++    stating that you changed the files and the date of any change.
++
++    b) You must cause any work that you distribute or publish, that in
++    whole or in part contains or is derived from the Program or any
++    part thereof, to be licensed as a whole at no charge to all third
++    parties under the terms of this License.
++
++    c) If the modified program normally reads commands interactively
++    when run, you must cause it, when started running for such
++    interactive use in the most ordinary way, to print or display an
++    announcement including an appropriate copyright notice and a
++    notice that there is no warranty (or else, saying that you provide
++    a warranty) and that users may redistribute the program under
++    these conditions, and telling the user how to view a copy of this
++    License.  (Exception: if the Program itself is interactive but
++    does not normally print such an announcement, your work based on
++    the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole.  If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works.  But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++  3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++    a) Accompany it with the complete corresponding machine-readable
++    source code, which must be distributed under the terms of Sections
++    1 and 2 above on a medium customarily used for software interchange; or,
++
++    b) Accompany it with a written offer, valid for at least three
++    years, to give any third party, for a charge no more than your
++    cost of physically performing source distribution, a complete
++    machine-readable copy of the corresponding source code, to be
++    distributed under the terms of Sections 1 and 2 above on a medium
++    customarily used for software interchange; or,
++
++    c) Accompany it with the information you received as to the offer
++    to distribute corresponding source code.  (This alternative is
++    allowed only for noncommercial distribution and only if you
++    received the program in object code or executable form with such
++    an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it.  For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable.  However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++  4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License.  Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++  5. You are not required to accept this License, since you have not
++signed it.  However, nothing else grants you permission to modify or
++distribute the Program or its derivative works.  These actions are
++prohibited by law if you do not accept this License.  Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++  6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions.  You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++  7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License.  If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all.  For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices.  Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++  8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded.  In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++  9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time.  Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number.  If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation.  If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++  10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission.  For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this.  Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++			    NO WARRANTY
++
++  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++		     END OF TERMS AND CONDITIONS
++
++	    How to Apply These Terms to Your New Programs
++
++  If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++  To do so, attach the following notices to the program.  It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++    <one line to give the program's name and a brief idea of what it does.>
++    Copyright (C) <year>  <name of author>
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation; either version 2 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License
++    along with this program; if not, write to the Free Software
++    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++    Gnomovision version 69, Copyright (C) year name of author
++    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++    This is free software, and you are welcome to redistribute it
++    under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License.  Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary.  Here is a sample; alter the names:
++
++  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++  `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++  <signature of Ty Coon>, 1 April 1989
++  Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs.  If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library.  If this is what you want to do, use the GNU Library General
++Public License instead of this License.
diff --git a/meta/recipes-bsp/hostap/files/hostap-fw-load.patch b/meta/recipes-bsp/hostap/files/hostap-fw-load.patch
new file mode 100644
index 0000000..050bdc1
--- /dev/null
+++ b/meta/recipes-bsp/hostap/files/hostap-fw-load.patch
@@ -0,0 +1,22 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+Upstream-Status: Inappropriate [configuration]
+
+--- hostap-utils-0.2.4/hostap_fw_load~hostap-fw-load
++++ hostap-utils-0.2.4/hostap_fw_load
+@@ -6,9 +6,9 @@
+ # Firmware images for the card
+ # TODO: could try to select correct firmware type automatically
+ 
+-PRI=/etc/pcmcia/PM010102.HEX
+-STA=/etc/pcmcia/RF010802.HEX
+-PRISM2_SREC=/usr/local/bin/prism2_srec
++PRI=/etc/pcmcia/pm010102.hex
++STA=/etc/pcmcia/rf010804.hex
++PRISM2_SREC=/usr/sbin/prism2_srec
+ 
+ set -e
+ 
diff --git a/meta/recipes-bsp/hostap/files/hostap_cs.conf b/meta/recipes-bsp/hostap/files/hostap_cs.conf
new file mode 100644
index 0000000..8dda82a
--- /dev/null
+++ b/meta/recipes-bsp/hostap/files/hostap_cs.conf
@@ -0,0 +1,193 @@
+module "hostap_cs" opts "channel=3 iw_mode=2 essid=any ignore_cis_vcc=1"
+
+card "Actiontec 802CI2"
+  manfid 0x1668, 0x0101
+  bind "hostap_cs"
+
+card "AirWay 802.11 Adapter (PCMCIA)"
+  #version "AirWay", "802.11 Adapter (PCMCIA)"
+  manfid 0x0261, 0x0002
+  bind "hostap_cs"
+
+card "Asus SpaceLink WL110"
+   manfid 0x02aa,0x0002
+   bind "hostap_cs"
+
+## handhelds.org bug 964
+card "Belkin F5D6060 Ethernet"
+   #version "PCMCIA", "11M WLAN Card v2.5", "ISL37300P", "RevA"
+   manfid 0x0274, 0x1612
+   bind "hostap_cs"
+
+card "Compaq 11Mbps Wireless PC Card"
+  manfid 0x028a, 0x0002
+  bind "hostap_cs"
+
+card "Compaq WL100 11 Mbps Wireless Adapter"
+  manfid 0x0138, 0x0002
+  bind "hostap_cs"
+
+card "Compaq HNW-100 11 Mbps Wireless Adapter"
+  manfid 0x028a, 0x0002
+  bind "hostap_cs"
+
+card "D-Link DWL-650"
+  version "D", "Link DWL-650 11Mbps WLAN Card"
+  bind "hostap_cs"
+
+card "D-Link DRC-650"
+  version "D", "Link DRC-650 11Mbps WLAN Card"
+  bind "hostap_cs"
+
+card "D-Link DCF660"
+  manfid 0xd601, 0x0005
+  bind "hostap_cs"
+
+card "Farallon SkyLINE"
+  version "INTERSIL", "HFA384x/IEEE"
+  bind "hostap_cs"
+
+card "HyperLink Wireless PC Card 11Mbps"
+  version "HyperLink", "Wireless PC Card 11Mbps"
+  bind "hostap_cs"
+
+# card "Intersil PRISM2 11 Mbps Wireless Adapter"
+#   manfid 0x0156, 0x0002
+#  bind "hostap_cs"
+
+card "LA4111 Spectrum24 Wireless LAN PC Card"
+  version "Symbol Technologies"
+  bind "hostap_cs"
+
+card "Linksys WPC11 11Mbps 802.11b WLAN Card"
+  version "Instant Wireless ", " Network PC CARD", "Version 01.02"
+  bind "hostap_cs"
+
+card "Linksys WCF11 11Mbps 802.11b WLAN Card"
+   manfid 0x0274, 0x3301                                   
+   bind "hostap_cs" 
+
+## handhelds.org bug #790
+card "Linksys Wireless CompactFlash Card WCF12"
+  manfid 0x028a, 0x0673
+  bind "hostap_cs"
+
+card "Linksys WLAN CF Card"
+  manfid 0x0274, 0x3301
+  bind "hostap_cs"
+
+card "NETGEAR MA701 Wireless CF Card"
+  manfid 0xd601, 0x0002
+  bind "hostap_cs"
+
+card "Nortel Networks eMobility 802.11 Wireless Adapter"
+  manfid 0x01eb, 0x080a
+  bind "hostap_cs"
+
+card "PLANEX GeoWave GW-CF110"
+  version "PLANEX", "GeoWave/GW-CF110"
+  bind "hostap_cs"
+
+card "PROXIM LAN PC CARD HARMONY 80211B"
+  version "PROXIM", "LAN PC CARD HARMONY 80211B"
+  bind "hostap_cs"
+
+card "Proxim RangeLAN/DS"
+  version "PROXIM","RangeLAN-DS/LAN PC CARD"
+  manfid 0x0126, 0x8000
+  bind "hostap_cs"
+
+card "Safeway 802.11b Wireless Adapter"
+  manfid 0xd601, 0x0002
+  bind "hostap_cs"
+
+card "SAMSUNG 11Mbps WLAN Card"
+  version "SAMSUNG", "11Mbps WLAN Card"
+  bind "hostap_cs"
+
+# needs firmware upload via hostap_fw_load
+card "SanDisk ConnectPlus OEM (0MB)"
+   manfid 0xd601, 0x0010
+   bind "hostap_cs"
+
+# needs special activation (>=hostap 0.3.2 only) plus firmware upload
+card "SanDisk ConnectPlus w/ Memory"
+   version "SanDisk", "ConnectPlus"
+   manfid 0xd601, 0x0101
+   bind "hostap_cs" to 0
+#   bind "ide-cs" to 1
+
+card "Senao/Origo 80211b WLAN Card"
+   manfid 0x000b,0x7100
+   bind "hostap_cs"
+
+card "Sitecom WL-007 WLAN CF Card"
+  manfid 0xd601, 0x0004
+  bind "hostap_cs"
+
+card "SMC2632 802.11 (prism2) Card"
+  version "SMC", "SMC2632W", "Version 01.02", ""
+  bind "hostap_cs"
+
+card "SpeedStream SS1021 Wireless Adapter"
+  #version "Siemens", "SpeedStream Wireless PCMCIA"
+  manfid 0x02ac, 0x0002
+  bind "hostap_cs"
+
+card "ZCOMAX AirRunner/XI-300"
+  #version "ZCOMAX", "AirRunner/XI-300"
+  manfid 0xd601, 0x0002
+  bind "hostap_cs"
+
+card "Zonet ZCF1100"
+  manfid 0x000b, 0x7100
+  bind "hostap_cs"
+  
+card "Wireless LAN Adapter Version 01.02"
+   version "Wireless", "LAN Adapter", "Version 01.02"
+#   manfid 0x0156, 0x0002
+   bind "hostap_cs"
+
+card "Ambicom WL1100C 11Mbs Card 802.11b"
+  version "AmbiCom", "WL1100C 802.11b CF-Card", "2.2"
+  manfid 0xd601,0x0002
+  bind "hostap_cs"
+
+card "Ambicom WL1100C 11Mbs Card 802.11b"
+  manfid 0xd601,0x0002
+  bind "hostap_cs"
+
+card "Sandisk Connect SDWCFB-000"
+  manfid 0xd601,0x0005
+  bind "hostap_cs"
+
+# Cards with Intersil firmware (Prism chipset)
+
+card "Linksys WPC11 11Mbps 802.11b WLAN Card"
+  version "The Linksys Group, Inc.", "Instant Wireless Network PC Card", "ISL37300P", "RevA"
+  bind "hostap_cs"
+
+card "Linksys CompactFlash Wireless Card"
+  version "Linksys", "Wireless CompactFlash Card"
+  bind "hostap_cs"
+
+card "ACTIONTEC PRISM Wireless LAN PC Card"
+  version "ACTIONTEC", "PRISM Wireless LAN PC Card"
+  bind "hostap_cs"
+
+card "Linksys WPC11 Version 3"
+  manfid 0x0274,0x1613
+  bind "hostap_cs"
+
+card "BENQ AWL100"
+  version "BENQ", "AWL100 PCMCIA ADAPTER"
+  bind "hostap_cs"
+
+card "Pretec WLAN"
+  version "Pretec", "CompactWLAN Card 802.11b", "2.5"
+  manfid 0x0156, 0x0002
+  bind "hostap_cs"
+
+card "TrendNet TEW PC16"
+  manfid 0x0274, 0x1601
+  bind "hostap_cs"
diff --git a/meta/recipes-bsp/hostap/files/hostap_cs.conf-upstream b/meta/recipes-bsp/hostap/files/hostap_cs.conf-upstream
new file mode 100644
index 0000000..5b7385a
--- /dev/null
+++ b/meta/recipes-bsp/hostap/files/hostap_cs.conf-upstream
@@ -0,0 +1,191 @@
+device "hostap_cs"
+   class "network" module "hostap", "hostap_cs"
+
+card "Intersil PRISM2 Reference Design 11Mb/s WLAN Card"
+   version "INTERSIL", "HFA384x/IEEE"
+   bind "hostap_cs"
+
+card "Compaq WL100 11Mb/s WLAN Card"
+   manfid 0x0138, 0x0002
+   bind "hostap_cs"
+
+card "Compaq WL200"
+   version "Compaq", "WL200_11Mbps_Wireless_PCI_Card"
+   bind "hostap_cs"
+
+card "EMTAC A2424i 11Mbps WLAN Card"
+   manfid 0xc250, 0x0002
+#   cis "cis/Emtac.dat"
+   bind "hostap_cs"
+
+card "Linksys WPC11 11Mbps WLAN Card"
+   version "Instant Wireless ", " Network PC CARD", "Version 01.02"
+   bind "hostap_cs"
+
+card "Linksys WPC11 Ver 2.5 11Mbps WLAN Card"
+   manfid 0x0274, 0x1612
+   bind "hostap_cs"
+
+card "Linksys WPC11 Ver 3 11Mbps WLAN Card"
+   manfid 0x0274, 0x1613
+   bind "hostap_cs"
+
+card "Linksys WCF12 Wireless CompactFlash Card"
+   version "Linksys", "Wireless CompactFlash Card"
+   bind "hostap_cs"
+
+card "D-Link DWL-650 11Mbps WLAN Card"
+   version "D", "Link DWL-650 11Mbps WLAN Card", "Version 01.02"
+   bind "hostap_cs"
+
+card "D-Link DRC-650 11Mbps WLAN Card"
+#  version "D", "Link DRC-650 11Mbps WLAN Card", "Version 01.02"
+   manfid 0x028a, 0x0002
+   bind "hostap_cs"
+
+card "ZoomAir 4100 11Mb/s WLAN Card"
+   version "ZoomAir 11Mbps High", "Rate wireless Networking"
+   bind "hostap_cs"
+
+card "Addtron AWP-100 11Mbps WLAN Card"
+   version "Addtron", "AWP-100 Wireless PCMCIA", "Version 01.02"
+   bind "hostap_cs"
+
+card "Samsung SWL2000-N 11Mb/s WLAN Card"
+   manfid 0x0250, 0x0002
+   bind "hostap_cs"
+
+card "SMC 2632W 11Mbps WLAN Card"
+   version "SMC", "SMC2632W", "Version 01.02"
+   bind "hostap_cs"
+
+card "BroMax Freeport 11Mbps WLAN Card"
+   version "Intersil", "PRISM 2_5 PCMCIA ADAPTER", "ISL37300P", "Eval-RevA"
+   bind "hostap_cs"
+
+card "Z-Com XI300 11Mb/s WLAN Card"
+   manfid 0xd601, 0x0002
+   bind "hostap_cs"
+
+card "Zcomax XI-325H 200mW"
+#   version " ", "IEEE 802.11 Wireless LAN/PC Card"
+   manfid 0xd601, 0x0005
+   bind "hostap_cs"
+
+card "3Com AirConnect PCI 777A"
+   manfid 0x0101, 0x0777
+   bind "hostap_cs"
+
+card "U.S. Robotics IEEE 802.11b PC-CARD"
+   version "U.S. Robotics", "IEEE 802.11b PC-CARD", "Version 01.02"
+#   manfid 0x0156, 0x0002
+   bind "hostap_cs"
+
+card "Longshine LCR-8531 11Mbps WLAN PCMCIA CARD"
+   version "OEM", "PRISM2 IEEE 802.11 PC-Card", "Version 01.02"
+#   manfid 0x0156, 0x0002
+   bind "hostap_cs"
+
+card "Philips 802.11b WLAN PCMCIA"
+   manfid 0x000b, 0x7300
+   bind "hostap_cs"
+
+card "Proxim RangeLAN"
+#   version "PROXIM", "RangeLAN-DS/LAN PC CARD"
+   manfid 0x0126, 0x8000
+   bind "hostap_cs"
+
+card "Buffalo WLI-CF-S11G"
+   version "BUFFALO", "WLI-CF-S11G"
+#  manfid 0x026f, 0x030b
+   bind "hostap_cs"
+
+card "Level-One WPC-0100"
+   version "Digital Data Communications", "WPC-0100", "Version 00.00"
+   manfid 0x0156, 0x0002
+   bind "hostap_cs"
+
+card "Belkin 802.11b WLAN PCMCIA"
+   version "Belkin", "11Mbps Wireless Notebook Network Adapter", "Version 01.02"
+   manfid 0x0156, 0x0002
+   bind "hostap_cs"
+
+card "Senao SL-2011CD/SL-2011CDPLUS"
+   version "INTERSIL", "HFA384x/IEEE", "Version 01.02"
+   manfid 0x0156, 0x0002
+   bind "hostap_cs"
+
+card "Fulbond Airbond XI-300B"
+   version " ", "IEEE 802.11 Wireless LAN/PC Card"
+   manfid 0xd601, 0x0002
+   bind "hostap_cs"
+
+card "Netgear MA401"
+   version "NETGEAR MA401 Wireless PC", "Card", "Version 01.00"
+#   manfid 0x0156, 0x0002
+   bind "hostap_cs"
+
+card "D-Link DWL-650 Rev. P1"
+   version "D-Link", "DWL-650 Wireless PC Card RevP", "ISL37101P-10", "A3"
+#   manfid 0x000b, 0x7110
+   bind "hostap_cs"
+
+card "SonicWALL Long Range Wireless Card"
+   version "SonicWALL", "Long Range Wireless Card", "ISL37100P", "1.0"
+   manfid 0x000b, 0x7100
+   bind "hostap_cs"
+
+card "Senao NL-2011CD PLUS Ext2 Mercury"
+   version "WLAN", "11Mbps_PC-Card_3.0", "ISL37100P", "Eval-RevA"
+   manfid 0x000b, 0x7100
+   bind "hostap_cs"
+
+card "Airvast WL100"
+   version "AIRVAST", "IEEE 802.11b Wireless PCMCIA Card", "HFA3863"
+   manfid 0x50c2, 0x0001
+   bind "hostap_cs"
+
+card "Microsoft Wireless Notebook Adapter MN-520 1.0.3"
+   version "Microsoft", "Wireless Notebook Adapter MN-520", "", "1.0.3"
+   manfid 0x02d2, 0x0001
+   bind "hostap_cs"
+
+card "NETGEAR MA401RA"
+   version "NETGEAR MA401RA Wireless PC", "Card", "ISL37300P", "Eval-RevA"
+   manfid 0x000b, 0x7300
+   bind "hostap_cs"
+
+card "Allied Telesyn AT-WCL452"
+   version "Allied Telesyn", "AT-WCL452 Wireless PCMCIA Radio", "Ver. 1.00"
+   manfid 0xc00f, 0x0000
+   bind "hostap_cs"
+
+card "corega WL PCCL-11"
+   version "corega", "WL PCCL-11", "ISL37300P", "RevA"
+   manfid 0xc00f, 0x0000
+   bind "hostap_cs"
+
+card "SanDisk ConnectPlus"
+   version "SanDisk", "ConnectPlus"
+   manfid 0xd601, 0x0101
+   bind "hostap_cs" to 0
+   bind "ide-cs" to 1
+
+card "ASUS WL-100 8011b WLAN PC Card"
+   version "ASUS", "802_11b_PC_CARD_25", "Version 01.00"
+   manfid 0x02aa, 0x0002
+   bind "hostap_cs"
+
+card "ZyXel Zyair B-101 802.11b WLAN card"
+   version " ", "IEEE 802.11 Wireless LAN/PC Card"
+   manfid 0xd601, 0x0010
+   bind "hostap_cs"
+
+card "WLAN PRISM PCMCIA CARD 37300P RevB6"
+   version "WLAN", "PRISM PCMCIA CARD", "37300P", "Revision B6"
+   manfid 0x50c2, 0x7300
+   bind "hostap_cs"
+
+
+# Optional configuration parameters for hostap_cs.o
+# module "hostap_cs" opts "channel=3 iw_mode=3 essid=test ignore_cis_vcc=0"
diff --git a/meta/recipes-bsp/hostap/files/hostap_cs.modalias b/meta/recipes-bsp/hostap/files/hostap_cs.modalias
new file mode 100644
index 0000000..2848351
--- /dev/null
+++ b/meta/recipes-bsp/hostap/files/hostap_cs.modalias
@@ -0,0 +1,28 @@
+# product info: "Pretec", "CompactWLAN Card 802.11b", "2.5"
+alias pcmcia:m0156c0002f06fn00pfn00pa1CADD3E5pbE697636Cpc7A5BFCF1pd00000000 hostap_cs
+
+# manufacturer ID which exist in orinoco_cs AND in hostap_cs
+alias pcmcia:m000Bc7100f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m000Bc7300f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0126c8000f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0138c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0250c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0274c1612f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m0274c1613f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m028Ac0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m02AAc0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:m50C2c7300f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:mD601c0002f06fn00pfn00pa*pb*pc*pd* hostap_cs
+alias pcmcia:mD601c0005f06fn00pfn00pa*pb*pc*pd* hostap_cs
+
+# product info: "Linksys", "Wireless CompactFlash Card", "", ""
+alias pcmcia:m028Ac0673f06fn00pfn00pa0733CC81pb0C52F395pc00000000pd00000000 hostap_cs
+
+# product info:"PLANEX COMMUNICATION INC","PLANEX GW-CF11X Wireless CF Card", "", ""
+alias pcmcia:mD601c0010f06fn00pfn00pa4703CF68pbFAD7318Dpc00000000pd00000000 hostap_cs
+
+# 0x0156, 0x0002 and "Version 01.02" only appear for Prism based cards.
+alias pcmcia:m0156c0002f06fn00pfn00pa*pb*pc4B74BAA0pd00000000 hostap_cs
+
+# "BUFFALO", "WLI-CF-S11G", "", ""
+alias pcmcia:m026Fc030Bf06fn00pfn00pa2DECECE3pb82067C18pc00000000pd00000000 hostap_cs
diff --git a/meta/recipes-bsp/hostap/hostap-conf_1.0.bb b/meta/recipes-bsp/hostap/hostap-conf_1.0.bb
new file mode 100644
index 0000000..e1d4c54
--- /dev/null
+++ b/meta/recipes-bsp/hostap/hostap-conf_1.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Configuration files for HostAP (wifi) driver"
+DESCRIPTION = "PCMCIA-cs configuration files for wireless LAN cards based on Intersil's Prism2/2.5/3 chipset."
+SECTION = "kernel/modules"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+PR = "r15"
+
+SRC_URI = "file://hostap_cs.modalias \
+           file://COPYING.patch"
+
+inherit allarch
+
+S = "${WORKDIR}"
+
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${sysconfdir}/modprobe.d
+
+	install -m 0644 ${WORKDIR}/hostap_cs.modalias ${D}${sysconfdir}/modprobe.d/hostap_cs.conf
+}
+
diff --git a/meta/recipes-bsp/hostap/hostap-utils-0.4.7/ldflags.patch b/meta/recipes-bsp/hostap/hostap-utils-0.4.7/ldflags.patch
new file mode 100644
index 0000000..3e99d0d
--- /dev/null
+++ b/meta/recipes-bsp/hostap/hostap-utils-0.4.7/ldflags.patch
@@ -0,0 +1,27 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- hostap-utils-0.4.7.orig/Makefile
++++ hostap-utils-0.4.7/Makefile
+@@ -14,17 +14,17 @@ prism2_srec.o: prism2_srec.c util.h
+ hostap_crypt_conf: hostap_crypt_conf.c
+
+ hostap_diag: hostap_diag.o util.o
+-	$(CC) -o hostap_diag $(CFLAGS) hostap_diag.o util.o
++	$(CC) -o hostap_diag $(CFLAGS) $(LDFLAGS) hostap_diag.o util.o
+
+ hostap_diag.o: hostap_diag.c util.h
+
+ util.o: util.c util.h
+
+ hostap_io_debug: hostap_io_debug.c
+-	$(CC) -o hostap_io_debug $(CFLAGS) hostap_io_debug.c
++	$(CC) -o hostap_io_debug $(CFLAGS) $(LDFLAGS) hostap_io_debug.c
+
+ hostap_rid: hostap_rid.o util.o
+-	$(CC) -o hostap_rid $(CFLAGS) hostap_rid.o util.o
++	$(CC) -o hostap_rid $(CFLAGS) $(LDFLAGS) hostap_rid.o util.o
+
+ hostap_rid.o: hostap_rid.c util.h
diff --git a/meta/recipes-bsp/hostap/hostap-utils.inc b/meta/recipes-bsp/hostap/hostap-utils.inc
new file mode 100644
index 0000000..89d977a
--- /dev/null
+++ b/meta/recipes-bsp/hostap/hostap-utils.inc
@@ -0,0 +1,26 @@
+SUMMARY = "User mode helpers for the hostap driver"
+DESCRIPTION = "The hostap driver supports Host AP mode, it allows for IEEE 802.11 \
+management functions on the host computer and allows the system to act as an access point."
+HOMEPAGE = "http://hostap.epitest.fi"
+BUGTRACKER = "http://hostap.epitest.fi/bugz/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+			file://util.c;beginline=1;endline=9;md5=d3b9280851302e5ba34e5fb717489b6d"
+SECTION = "kernel/userland"
+PR = "r4"
+
+SRC_URI = "http://hostap.epitest.fi/releases/hostap-utils-${PV}.tar.gz \
+	   file://hostap-fw-load.patch"
+S = "${WORKDIR}/hostap-utils-${PV}"
+
+BINARIES = "hostap_crypt_conf hostap_diag hostap_fw_load hostap_io_debug \
+	    hostap_rid prism2_param prism2_srec split_combined_hex"
+
+do_install() {
+	install -d ${D}${sbindir}/
+	for f in ${BINARIES}
+	do
+		install -m 0755 $f ${D}${sbindir}/
+	done
+}
+
diff --git a/meta/recipes-bsp/hostap/hostap-utils_0.4.7.bb b/meta/recipes-bsp/hostap/hostap-utils_0.4.7.bb
new file mode 100644
index 0000000..be5481f
--- /dev/null
+++ b/meta/recipes-bsp/hostap/hostap-utils_0.4.7.bb
@@ -0,0 +1,5 @@
+require hostap-utils.inc
+
+SRC_URI += "file://ldflags.patch"
+SRC_URI[md5sum] = "afe041581b8f01666e353bec20917c85"
+SRC_URI[sha256sum] = "c6f598d8e356c1620fa009eca0a700bf1105e16817eefd77d891994261009355"
diff --git a/meta/recipes-bsp/keymaps/files/GPLv2.patch b/meta/recipes-bsp/keymaps/files/GPLv2.patch
new file mode 100644
index 0000000..1ee8181
--- /dev/null
+++ b/meta/recipes-bsp/keymaps/files/GPLv2.patch
@@ -0,0 +1,347 @@
+Upstream-Status: Inappropriate [licensing]
+
+diff --git a/COPYING b/COPYING
+new file mode 100644
+index 0000000..d511905
+--- /dev/null
++++ b/COPYING
+@@ -0,0 +1,339 @@
++		    GNU GENERAL PUBLIC LICENSE
++		       Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++			    Preamble
++
++  The licenses for most software are designed to take away your
++freedom to share and change it.  By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users.  This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it.  (Some other Free Software Foundation software is covered by
++the GNU Lesser General Public License instead.)  You can apply it to
++your programs, too.
++
++  When we speak of free software, we are referring to freedom, not
++price.  Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++  To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++  For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have.  You must make sure that they, too, receive or can get the
++source code.  And you must show them these terms so they know their
++rights.
++
++  We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++  Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software.  If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++  Finally, any free program is threatened constantly by software
++patents.  We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary.  To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++  The precise terms and conditions for copying, distribution and
++modification follow.
++
++		    GNU GENERAL PUBLIC LICENSE
++   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++  0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License.  The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language.  (Hereinafter, translation is included without limitation in
++the term "modification".)  Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope.  The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++  1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++  2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++    a) You must cause the modified files to carry prominent notices
++    stating that you changed the files and the date of any change.
++
++    b) You must cause any work that you distribute or publish, that in
++    whole or in part contains or is derived from the Program or any
++    part thereof, to be licensed as a whole at no charge to all third
++    parties under the terms of this License.
++
++    c) If the modified program normally reads commands interactively
++    when run, you must cause it, when started running for such
++    interactive use in the most ordinary way, to print or display an
++    announcement including an appropriate copyright notice and a
++    notice that there is no warranty (or else, saying that you provide
++    a warranty) and that users may redistribute the program under
++    these conditions, and telling the user how to view a copy of this
++    License.  (Exception: if the Program itself is interactive but
++    does not normally print such an announcement, your work based on
++    the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole.  If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works.  But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++  3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++    a) Accompany it with the complete corresponding machine-readable
++    source code, which must be distributed under the terms of Sections
++    1 and 2 above on a medium customarily used for software interchange; or,
++
++    b) Accompany it with a written offer, valid for at least three
++    years, to give any third party, for a charge no more than your
++    cost of physically performing source distribution, a complete
++    machine-readable copy of the corresponding source code, to be
++    distributed under the terms of Sections 1 and 2 above on a medium
++    customarily used for software interchange; or,
++
++    c) Accompany it with the information you received as to the offer
++    to distribute corresponding source code.  (This alternative is
++    allowed only for noncommercial distribution and only if you
++    received the program in object code or executable form with such
++    an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it.  For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable.  However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++  4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License.  Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++  5. You are not required to accept this License, since you have not
++signed it.  However, nothing else grants you permission to modify or
++distribute the Program or its derivative works.  These actions are
++prohibited by law if you do not accept this License.  Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++  6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions.  You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++  7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License.  If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all.  For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices.  Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++  8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded.  In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++  9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time.  Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number.  If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation.  If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++  10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission.  For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this.  Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++			    NO WARRANTY
++
++  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++		     END OF TERMS AND CONDITIONS
++
++	    How to Apply These Terms to Your New Programs
++
++  If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++  To do so, attach the following notices to the program.  It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++    <one line to give the program's name and a brief idea of what it does.>
++    Copyright (C) <year>  <name of author>
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation; either version 2 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License along
++    with this program; if not, write to the Free Software Foundation, Inc.,
++    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++    Gnomovision version 69, Copyright (C) year name of author
++    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++    This is free software, and you are welcome to redistribute it
++    under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License.  Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary.  Here is a sample; alter the names:
++
++  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++  `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++  <signature of Ty Coon>, 1 April 1989
++  Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs.  If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library.  If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.
diff --git a/meta/recipes-bsp/keymaps/files/keymap.sh b/meta/recipes-bsp/keymaps/files/keymap.sh
new file mode 100755
index 0000000..6ebc634
--- /dev/null
+++ b/meta/recipes-bsp/keymaps/files/keymap.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# load keymap, if existing
+
+KERNEL_MAJMIN=`uname -r | cut -d '.' -f 1,2`
+if [ -e /etc/keymap-$KERNEL_MAJMIN.map ]; then
+	loadkeys /etc/keymap-$KERNEL_MAJMIN.map
+fi
+
+if ( ls "/etc" | grep -q "keymap-extension-${KERNEL_MAJMIN}" )
+then
+	for extension in `ls -1 /etc/keymap-extension-$KERNEL_MAJMIN*` 
+	do	
+		loadkeys "$extension"
+	done
+fi
diff --git a/meta/recipes-bsp/keymaps/keymaps_1.0.bb b/meta/recipes-bsp/keymaps/keymaps_1.0.bb
new file mode 100644
index 0000000..5793a76
--- /dev/null
+++ b/meta/recipes-bsp/keymaps/keymaps_1.0.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Keyboard maps"
+DESCRIPTION = "Keymaps and initscript to set the keymap on bootup."
+SECTION = "base"
+
+RDEPENDS_${PN} = "kbd"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+PR = "r31"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python __anonymous() {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+inherit update-rc.d
+
+SRC_URI = "file://keymap.sh \
+	   file://GPLv2.patch"
+
+INITSCRIPT_NAME = "keymap.sh"
+INITSCRIPT_PARAMS = "start 01 S ."
+
+S = "${WORKDIR}"
+
+do_install () {
+    # Only install the script if 'sysvinit' is in DISTRO_FEATURES
+    # THe ulitity this script provides could be achieved by systemd-vconsole-setup.service
+    if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+	install -d ${D}${sysconfdir}/init.d/
+	install -m 0755 ${WORKDIR}/keymap.sh ${D}${sysconfdir}/init.d/
+    fi
+}
+
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask keymap.service
+	fi
+}
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/meta/recipes-bsp/libacpi/files/ldflags.patch b/meta/recipes-bsp/libacpi/files/ldflags.patch
new file mode 100644
index 0000000..a7424c3
--- /dev/null
+++ b/meta/recipes-bsp/libacpi/files/ldflags.patch
@@ -0,0 +1,41 @@
+libacpi: Remove QA warning: No GNU_HASH in the elf binary
+
+Upstream-Status: Inappropriate [other]
+  Useful within bitbake environment only.
+
+Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
+
+---
+ Makefile  |    3 ++-
+ config.mk |    1 +
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+--- libacpi-0.2.orig/Makefile
++++ libacpi-0.2/Makefile
+@@ -19,6 +19,7 @@ options:
+ 	@echo "CFLAGS   = ${CFLAGS}"
+ 	@echo "CC       = ${CC}"
+ 	@echo "SOFLAGS  = ${SOFLAGS}"
++	@echo "LDFLAGS  = ${LDFLAGS}"
+ 	@echo "LD       = ${LD}"
+ 
+ .c.o:
+@@ -34,7 +35,7 @@ libacpi.a: ${OBJ}
+ 
+ libacpi.so: ${OBJ}
+ 	@echo LD $@
+-	@${CC} ${SOFLAGS} -o $@.${SOVERSION} ${OBJ}
++	@${CC} ${SOFLAGS} ${LDFLAGS} -o $@.${SOVERSION} ${OBJ}
+ 
+ test-libacpi: ${OBJ_test}
+ 	@echo LD $@
+--- libacpi-0.2.orig/config.mk
++++ libacpi-0.2/config.mk
+@@ -10,6 +10,7 @@ MANPREFIX = ${PREFIX}/share/man
+ SOFLAGS = -shared -Wl,-soname,${SONAME}
+ CFLAGS += -fPIC -g --pedantic -Wall -Wextra
+ ARFLAGS = cr
++LDFLAGS =
+ 
+ # Compiler and linker
+ CC = cc
diff --git a/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch b/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
new file mode 100644
index 0000000..2fed344
--- /dev/null
+++ b/meta/recipes-bsp/libacpi/files/libacpi_fix_for_x32.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Pending
+
+Fix libacpi for x32
+    
+    libacpi doesn't use base_libdir for install.  This patch adds
+    base_libdir support so that x32 libraries are installed properly.
+
+Patch Received from:  H.J. Lu <hjl.tools@gmail.com>
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/05
+
+Index: libacpi-0.2/Makefile
+===================================================================
+--- libacpi-0.2.orig/Makefile
++++ libacpi-0.2/Makefile
+@@ -8,6 +8,10 @@ SRC_test = test-libacpi.c libacpi.c list
+ OBJ = ${SRC:.c=.o}
+ OBJ_test = ${SRC_test:.c=.o}
+ 
++ifndef base_libdir
++base_libdir=/lib
++endif
++
+ all: options libacpi.a libacpi.so test-libacpi
+ 
+ options:
+@@ -42,13 +46,13 @@ install: all
+ 	@mkdir -p ${DESTDIR}${PREFIX}/include
+ 	@cp -f libacpi.h ${DESTDIR}${PREFIX}/include
+ 	@chmod 644 ${DESTDIR}${PREFIX}/include/libacpi.h
+-	@echo installing library to ${DESTDIR}${PREFIX}/lib
+-	@mkdir -p ${DESTDIR}${PREFIX}/lib
+-	@cp -f libacpi.a ${DESTDIR}${PREFIX}/lib
+-	@chmod 644 ${DESTDIR}${PREFIX}/lib/libacpi.a
+-	@cp -f ${SONAME} ${DESTDIR}${PREFIX}/lib/
+-	@chmod 644 ${DESTDIR}${PREFIX}/lib/${SONAME}
+-	@ln -s ${SONAME} ${DESTDIR}${PREFIX}/lib/libacpi.so
++	@echo installing library to ${DESTDIR}${PREFIX}${base_libdir}
++	@mkdir -p ${DESTDIR}${PREFIX}${base_libdir}
++	@cp -f libacpi.a ${DESTDIR}${PREFIX}${base_libdir}
++	@chmod 644 ${DESTDIR}${PREFIX}${base_libdir}/libacpi.a
++	@cp -f ${SONAME} ${DESTDIR}${PREFIX}${base_libdir}/
++	@chmod 644 ${DESTDIR}${PREFIX}${base_libdir}/${SONAME}
++	@ln -s ${SONAME} ${DESTDIR}${PREFIX}${base_libdir}/libacpi.so
+ 	@echo installing test-libacpi to ${DESTDIR}${PREFIX}/bin
+ 	@mkdir -p ${DESTDIR}${PREFIX}/bin
+ 	@cp -f test-libacpi ${DESTDIR}${PREFIX}/bin
diff --git a/meta/recipes-bsp/libacpi/files/makefile-fix.patch b/meta/recipes-bsp/libacpi/files/makefile-fix.patch
new file mode 100644
index 0000000..c34ef34
--- /dev/null
+++ b/meta/recipes-bsp/libacpi/files/makefile-fix.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Pending
+
+---
+ Makefile  |    6 +++---
+ config.mk |    3 ++-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+Index: libacpi-0.2/Makefile
+===================================================================
+--- libacpi-0.2.orig/Makefile	2007-07-29 14:09:34.000000000 +0200
++++ libacpi-0.2/Makefile	2008-09-26 10:34:53.000000000 +0200
+@@ -25,16 +25,16 @@ ${OBJ}: config.mk libacpi.h
+ 
+ libacpi.a: ${OBJ}
+ 	@echo AR $@
+-	@${AR} $@ ${OBJ}
++	${AR} ${ARFLAGS} $@ ${OBJ}
+ 	@${RANLIB} $@
+ 
+ libacpi.so: ${OBJ}
+ 	@echo LD $@
+-	@${LD} ${SOFLAGS} -o $@.${SOVERSION} ${OBJ}
++	@${CC} ${SOFLAGS} -o $@.${SOVERSION} ${OBJ}
+ 
+ test-libacpi: ${OBJ_test}
+ 	@echo LD $@
+-	@${LD} -o $@ ${OBJ_test} ${LDFLAGS}
++	@${CC} -o $@ ${OBJ_test} ${LDFLAGS}
+ 	@strip $@
+ 
+ install: all
+Index: libacpi-0.2/config.mk
+===================================================================
+--- libacpi-0.2.orig/config.mk	2007-07-29 14:09:34.000000000 +0200
++++ libacpi-0.2/config.mk	2008-09-26 10:34:33.000000000 +0200
+@@ -9,9 +9,10 @@ MANPREFIX = ${PREFIX}/share/man
+ # flags
+ SOFLAGS = -shared -Wl,-soname,${SONAME}
+ CFLAGS += -fPIC -g --pedantic -Wall -Wextra
++ARFLAGS = cr
+ 
+ # Compiler and linker
+ CC = cc
+ LD = ${CC}
+-AR = ar cr
++AR = ar
+ RANLIB = ranlib
diff --git a/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch b/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch
new file mode 100644
index 0000000..bca75fb
--- /dev/null
+++ b/meta/recipes-bsp/libacpi/files/use_correct_strip_in_cross_environment.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Used the cross strip instead of host strip to avoid this build error:
+
+| strip: Unable to recognise the format of the input file `test-libacpi'
+| make: *** [test-libacpi] Error 1
+| ERROR: oe_runmake failed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/07
+
+Index: libacpi-0.2/Makefile
+===================================================================
+--- libacpi-0.2.orig/Makefile
++++ libacpi-0.2/Makefile
+@@ -39,7 +39,7 @@ libacpi.so: ${OBJ}
+ test-libacpi: ${OBJ_test}
+ 	@echo LD $@
+ 	@${CC} -o $@ ${OBJ_test} ${LDFLAGS}
+-	@strip $@
++	@${STRIP} $@
+ 
+ install: all
+ 	@echo installing header to ${DESTDIR}${PREFIX}/include
diff --git a/meta/recipes-bsp/libacpi/libacpi_0.2.bb b/meta/recipes-bsp/libacpi/libacpi_0.2.bb
new file mode 100644
index 0000000..bf302f3
--- /dev/null
+++ b/meta/recipes-bsp/libacpi/libacpi_0.2.bb
@@ -0,0 +1,30 @@
+SUMMARY = "ACPI data gathering library"
+DESCRIPTION = "General purpose shared library for programs gathering ACPI data on Linux. \
+Thermal zones, battery infomration, fan information and AC states are implemented."
+SECTION = "base"
+HOMEPAGE = "http://www.ngolde.de/libacpi.html"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fec17f82f16630adf2dfb7d2a46f21c5"
+PR = "r6"
+
+SRC_URI = "http://www.ngolde.de/download/libacpi-${PV}.tar.gz \
+	   file://makefile-fix.patch \
+	   file://libacpi_fix_for_x32.patch \
+	   file://use_correct_strip_in_cross_environment.patch \
+	   file://ldflags.patch "
+
+SRC_URI[md5sum] = "05b53dd7bead66dda35fec502b91066c"
+SRC_URI[sha256sum] = "13086e31d428b9c125954d48ac497b754bbbce2ef34ea29ecd903e82e25bad29"
+
+inherit lib_package
+
+COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)'
+
+CFLAGS += "-fPIC"
+EXTRA_OEMAKE += 'STRIP="echo"'
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_install() {
+	oe_runmake install DESTDIR=${D} PREFIX=${exec_prefix}
+}
diff --git a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/acdefine.patch b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/acdefine.patch
new file mode 100644
index 0000000..682cf41
--- /dev/null
+++ b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/acdefine.patch
@@ -0,0 +1,19 @@
+Add a description to the AC_DEFINE for LOCALEDIR so that it appears in config.h
+and silences a fatal warning.
+
+Upstream-Status:Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.in b/configure.in
+index c10460c..aa20263 100644
+--- a/configure.in
++++ b/configure.in
+@@ -258,7 +258,7 @@ AC_SUBST(LIBS)
+ 
+ AM_GNU_GETTEXT
+ 
+-AC_DEFINE_UNQUOTED(LOCALEDIR,"$prefix/$DATADIRNAME")
++AC_DEFINE_UNQUOTED(LOCALEDIR,"$prefix/$DATADIRNAME",[locale directory])
+ 
+ AC_OUTPUT([Makefile intl/Makefile lib/Makefile testsuite/Makefile  m4/Makefile \
+ man/Makefile po/Makefile.in src/Makefile debian/rules Specfile systype \
diff --git a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools.patch b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools.patch
new file mode 100644
index 0000000..3945198
--- /dev/null
+++ b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/autotools.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [configuration]
+
+--- lrzsz-0.12.20/acinclude.m4~autotools	1998-12-27 17:08:59.000000000 -0500
++++ lrzsz-0.12.20/acinclude.m4	2004-05-09 22:26:19.000000000 -0400
+@@ -1,12 +1,11 @@
+ dnl AC_REPLACE_GNU_GETOPT
+-AC_DEFUN(AC_REPLACE_GNU_GETOPT,
+-[AC_CHECK_FUNC(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"])
+-AC_SUBST(LIBOBJS)dnl
+-])
++AC_DEFUN([AC_REPLACE_GNU_GETOPT],
++[AC_CHECK_FUNC(getopt_long, , [AC_LIBOBJ([getopt1])
++AC_LIBOBJ([getopt])dnl])])
+ 
+ dnl
+ dnl taken from taylor uucp
+-AC_DEFUN(LRZSZ_ERRNO_DECL,[
++AC_DEFUN([LRZSZ_ERRNO_DECL],[
+ AC_MSG_CHECKING(for errno declaration)
+ AC_CACHE_VAL(lrzsz_cv_decl_errno,
+ [AC_TRY_COMPILE([#include <errno.h>], [int i = errno; errno = 1;],
+@@ -23,7 +21,7 @@
+ ])
+ 
+ dnl LRZSZ_TYPE_SPEED_T
+-AC_DEFUN(LRZSZ_TYPE_SPEED_T,[
++AC_DEFUN([LRZSZ_TYPE_SPEED_T],[
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([LRZSZ_HEADERS_TERM_IO])dnl
+ AC_MSG_CHECKING(for speed_t)
+@@ -61,7 +59,7 @@
+ fi
+ ])
+ 
+-AC_DEFUN(lrzsz_HEADER_SYS_SELECT,
++AC_DEFUN([lrzsz_HEADER_SYS_SELECT],
+ [AC_CACHE_CHECK([whether sys/time.h and sys/select.h may both be included],
+   lrzsz_cv_header_sys_select,
+ [AC_TRY_COMPILE([#include <sys/types.h>
diff --git a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/gettext.patch b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/gettext.patch
new file mode 100644
index 0000000..1a24a1f
--- /dev/null
+++ b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/gettext.patch
@@ -0,0 +1,21884 @@
+Upstream-Status: Inappropriate [configuration]
+
+--- lrzsz-0.12.20.safe/ABOUT-NLS	1998-04-26 09:22:30.000000000 -0400
++++ lrzsz-0.12.20/ABOUT-NLS	2004-09-12 14:40:34.323752952 -0400
+@@ -1,14 +1,14 @@
+ Notes on the Free Translation Project
+ *************************************
+ 
+-   Free software is going international!  The Free Translation Project
+-is a way to get maintainers of free software, translators, and users all
++Free software is going international!  The Free Translation Project is
++a way to get maintainers of free software, translators, and users all
+ together, so that will gradually become able to speak many languages.
+ A few packages already provide translations for their messages.
+ 
+    If you found this `ABOUT-NLS' file inside a distribution, you may
+ assume that the distributed package does use GNU `gettext' internally,
+-itself available at your nearest GNU archive site.  But you do *not*
++itself available at your nearest GNU archive site.  But you do _not_
+ need to install GNU `gettext' prior to configuring, installing or using
+ this package with messages translated.
+ 
+@@ -22,10 +22,10 @@
+ `gettext' which is used.  The information can be found in the
+ `intl/VERSION' file, in internationalized packages.
+ 
+-One advise in advance
+-=====================
++Quick configuration advice
++==========================
+ 
+-   If you want to exploit the full power of internationalization, you
++If you want to exploit the full power of internationalization, you
+ should configure it using
+ 
+      ./configure --with-included-gettext
+@@ -34,42 +34,40 @@
+ package, despite the existence of internationalizing capabilities in the
+ operating system where this package is being installed.  So far, only
+ the `gettext' implementation in the GNU C library version 2 provides as
+-many features (such as locale alias or message inheritance) as the
+-implementation here.  It is also not possible to offer this additional
+-functionality on top of a `catgets' implementation.  Future versions of
+-GNU `gettext' will very likely convey even more functionality.  So it
+-might be a good idea to change to GNU `gettext' as soon as possible.
++many features (such as locale alias, message inheritance, automatic
++charset conversion or plural form handling) as the implementation here.
++It is also not possible to offer this additional functionality on top
++of a `catgets' implementation.  Future versions of GNU `gettext' will
++very likely convey even more functionality.  So it might be a good idea
++to change to GNU `gettext' as soon as possible.
+ 
+-   So you need not provide this option if you are using GNU libc 2 or
++   So you need _not_ provide this option if you are using GNU libc 2 or
+ you have installed a recent copy of the GNU gettext package with the
+ included `libintl'.
+ 
+ INSTALL Matters
+ ===============
+ 
+-   Some packages are "localizable" when properly installed; the
+-programs they contain can be made to speak your own native language.
+-Most such packages use GNU `gettext'.  Other packages have their own
+-ways to internationalization, predating GNU `gettext'.
++Some packages are "localizable" when properly installed; the programs
++they contain can be made to speak your own native language.  Most such
++packages use GNU `gettext'.  Other packages have their own ways to
++internationalization, predating GNU `gettext'.
+ 
+    By default, this package will be installed to allow translation of
+-messages.  It will automatically detect whether the system provides
+-usable `catgets' (if using this is selected by the installer) or
+-`gettext' functions.  If neither is available, the GNU `gettext' own
++messages.  It will automatically detect whether the system already
++provides the GNU `gettext' functions.  If not, the GNU `gettext' own
+ library will be used.  This library is wholly contained within this
+ package, usually in the `intl/' subdirectory, so prior installation of
+-the GNU `gettext' package is *not* required.  Installers may use
++the GNU `gettext' package is _not_ required.  Installers may use
+ special options at configuration time for changing the default
+ behaviour.  The commands:
+ 
+      ./configure --with-included-gettext
+-     ./configure --with-catgets
+      ./configure --disable-nls
+ 
+-will respectively bypass any pre-existing `catgets' or `gettext' to use
+-the internationalizing routines provided within this package, enable
+-the use of the `catgets' functions (if found on the locale system), or
+-else, *totally* disable translation of messages.
++will respectively bypass any pre-existing `gettext' to use the
++internationalizing routines provided within this package, or else,
++_totally_ disable translation of messages.
+ 
+    When you already have GNU `gettext' installed on your system and run
+ configure without an option for your new package, `configure' will
+@@ -83,18 +81,10 @@
+ 
+ to prevent auto-detection.
+ 
+-   By default the configuration process will not test for the `catgets'
+-function and therefore they will not be used.  The reasons are already
+-given above: the emulation on top of `catgets' cannot provide all the
+-extensions provided by the GNU `gettext' library.  If you nevertheless
+-want to use the `catgets' functions use
+-
+-     ./configure --with-catgets
+-
+-to enable the test for `catgets' (this causes no harm if `catgets' is
+-not available on your system).  If you really select this option we
+-would like to hear about the reasons because we cannot think of any
+-good one ourself.
++   The configuration process will not test for the `catgets' function
++and therefore it will not be used.  The reason is that even an
++emulation of `gettext' on top of `catgets' could not provide all the
++extensions of the GNU `gettext' library.
+ 
+    Internationalized packages have usually many `po/LL.po' files, where
+ LL gives an ISO 639 two-letter code identifying the language.  Unless
+@@ -108,57 +98,73 @@
+ Using This Package
+ ==================
+ 
+-   As a user, if your language has been installed for this package, you
++As a user, if your language has been installed for this package, you
+ only have to set the `LANG' environment variable to the appropriate
+-ISO 639 `LL' two-letter code prior to using the programs in the
+-package.  For example, let's suppose that you speak German.  At the
+-shell prompt, merely execute `setenv LANG de' (in `csh'),
+-`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash').  This
+-can be done from your `.login' or `.profile' file, once and for all.
++`LL_CC' combination.  Here `LL' is an ISO 639 two-letter language code,
++and `CC' is an ISO 3166 two-letter country code.  For example, let's
++suppose that you speak German and live in Germany.  At the shell
++prompt, merely execute `setenv LANG de_DE' (in `csh'),
++`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
++This can be done from your `.login' or `.profile' file, once and for
++all.
+ 
+-   An operating system might already offer message localization for
+-many of its programs, while other programs have been installed locally
+-with the full capabilities of GNU `gettext'.  Just using `gettext'
+-extended syntax for `LANG' would break proper localization of already
+-available operating system programs.  In this case, users should set
+-both `LANGUAGE' and `LANG' variables in their environment, as programs
+-using GNU `gettext' give preference to `LANGUAGE'.  For example, some
+-Swedish users would rather read translations in German than English for
+-when Swedish is not available.  This is easily accomplished by setting
+-`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'.
++   You might think that the country code specification is redundant.
++But in fact, some languages have dialects in different countries.  For
++example, `de_AT' is used for Austria, and `pt_BR' for Brazil.  The
++country code serves to distinguish the dialects.
++
++   The locale naming convention of `LL_CC', with `LL' denoting the
++language and `CC' denoting the country, is the one use on systems based
++on GNU libc.  On other systems, some variations of this scheme are
++used, such as `LL' or `LL_CC.ENCODING'.  You can get the list of
++locales supported by your system for your country by running the command
++`locale -a | grep '^LL''.
++
++   Not all programs have translations for all languages.  By default, an
++English message is shown in place of a nonexistent translation.  If you
++understand other languages, you can set up a priority list of languages.
++This is done through a different environment variable, called
++`LANGUAGE'.  GNU `gettext' gives preference to `LANGUAGE' over `LANG'
++for the purpose of message handling, but you still need to have `LANG'
++set to the primary language; this is required by other parts of the
++system libraries.  For example, some Swedish users who would rather
++read translations in German than English for when Swedish is not
++available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
++
++   Special advice for Norwegian users: The language code for Norwegian
++bokma*l changed from `no' to `nb' recently (in 2003).  During the
++transition period, while some message catalogs for this language are
++installed under `nb' and some older ones under `no', it's recommended
++for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
++older translations are used.
++
++   In the `LANGUAGE' environment variable, but not in the `LANG'
++environment variable, `LL_CC' combinations can be abbreviated as `LL'
++to denote the language's main dialect.  For example, `de' is equivalent
++to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
++(Portuguese as spoken in Portugal) in this context.
+ 
+ Translating Teams
+ =================
+ 
+-   For the Free Translation Project to be a success, we need interested
++For the Free Translation Project to be a success, we need interested
+ people who like their own language and write it well, and who are also
+ able to synergize with other translators speaking the same language.
+-Each translation team has its own mailing list, courtesy of Linux
+-International.  You may reach your translation team at the address
+-`LL@li.org', replacing LL by the two-letter ISO 639 code for your
+-language.  Language codes are *not* the same as the country codes given
+-in ISO 3166.  The following translation teams exist, as of August 1997:
+-
+-     Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en',
+-     Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian
+-     `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja',
+-     Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish
+-     `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es',
+-     Swedish `sv', and Turkish `tr'.
+-
+-For example, you may reach the Chinese translation team by writing to
+-`zh@li.org'.
++Each translation team has its own mailing list.  The up-to-date list of
++teams can be found at the Free Translation Project's homepage,
++`http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams"
++area.
+ 
+-   If you'd like to volunteer to *work* at translating messages, you
++   If you'd like to volunteer to _work_ at translating messages, you
+ should become a member of the translating team for your own language.
+-The subscribing address is *not* the same as the list itself, it has
++The subscribing address is _not_ the same as the list itself, it has
+ `-request' appended.  For example, speakers of Swedish can send a
+ message to `sv-request@li.org', having this message body:
+ 
+      subscribe
+ 
+    Keep in mind that team members are expected to participate
+-*actively* in translations, or at solving translational difficulties,
++_actively_ in translations, or at solving translational difficulties,
+ rather than merely lurking around.  If your team does not exist yet and
+ you want to start one, or if you are unsure about what to do or how to
+ get started, please write to `translation@iro.umontreal.ca' to reach the
+@@ -171,43 +177,559 @@
+ Available Packages
+ ==================
+ 
+-   Languages are not equally supported in all packages.  The following
+-matrix shows the current state of internationalization, as of August
+-1997.  The matrix shows, in regard of each package, for which languages
+-PO files have been submitted to translation coordination.
++Languages are not equally supported in all packages.  The following
++matrix shows the current state of internationalization, as of January
++2004.  The matrix shows, in regard of each package, for which languages
++PO files have been submitted to translation coordination, with a
++translation percentage of at least 50%.
+ 
+-     Ready PO files    cs da de en es fi fr it ja ko nl no pl pt sl sv
+-                     .-------------------------------------------------.
+-     bash            |       []          []          []                |  3
+-     bison           |       []          []          []                |  3
+-     clisp           |       [] [] []    []                            |  4
+-     cpio            |       []    []    []          []    []          |  5
+-     diffutils       |       []    []    []                []       [] |  5
+-     enscript        |       []    [] [] []          []          []    |  6
+-     fileutils       | []    []    []    []       [] []    [] [] [] [] | 10
+-     findutils       |       []    []    [] []    [] []    []       [] |  8
+-     flex            |             []    []       []                [] |  4
+-     gcal            |       []          []          []    []       [] |  5
+-     gettext         |       []    []    []       [] [] [] [] [] [] [] | 11
+-     grep            |       []    []    []       [] [] [] []    [] [] |  9
+-     hello           |       []    []    []       [] [] [] [] [] [] [] | 10
+-     id-utils        |       []          []                []          |  3
+-     indent          |    [] []                   []       []          |  4
+-     libc            |       []    []    []       [] []    []       [] |  7
+-     m4              |       []          []    []    []             [] |  5
+-     make            |       []    []    []       [] []    []          |  6
+-     music           |                   []                []          |  2
+-     ptx             |       []    []    []          [] [] [] []    [] |  8
+-     recode          |    [] []    []    []          []    [] [] [] [] |  9
+-     sh-utils        |       []          []          [] [] [] []    [] |  7
+-     sharutils       |       []    []    []          []             [] |  5
+-     tar             |       []          [] []    [] [] [] [] [] [] [] | 10
+-     texinfo         |                   []                            |  1
+-     textutils       | []    []    []    []       [] [] [] []       [] |  9
+-     wdiff           | []    []    []    []          [] [] []       [] |  8
+-                     `-------------------------------------------------'
+-       16 languages    cs da de en es fi fr it ja ko nl no pl pt sl sv
+-       27 packages      3  2 24  1 17  1 26  2  1 11 20  9 19  7  7 17  167
++     Ready PO files       af am ar az be bg bs ca cs da de el en en_GB eo es
++                        +----------------------------------------------------+
++     a2ps               |             []             [] [] []                |
++     aegis              |                               ()                   |
++     ant-phone          |                               ()                   |
++     anubis             |                                                    |
++     ap-utils           |                                                    |
++     aspell             |             []                                     |
++     bash               |                      []       []             [] [] |
++     batchelor          |                                                    |
++     bfd                |                            []                   [] |
++     binutils           |                            []                   [] |
++     bison              |                            [] []                [] |
++     bluez-pin          | []                      []                   []    |
++     clisp              |                                                    |
++     clisp              |                               []    []          [] |
++     console-tools      |                         []    []                   |
++     coreutils          |                      []    [] []                [] |
++     cpio               |                            [] []                [] |
++     darkstat           |                []          ()                   [] |
++     diffutils          |                      [] [] [] [] []          [] [] |
++     e2fsprogs          |                         []    []                [] |
++     enscript           |                      []    [] []        []         |
++     error              |                      []    [] []        []      [] |
++     fetchmail          |                      [] () [] [] []             [] |
++     fileutils          |                            [] []                [] |
++     findutils          |             []       []    [] [] []          [] [] |
++     flex               |                      []    [] []                [] |
++     fslint             |                                                    |
++     gas                |                                                 [] |
++     gawk               |                      []    [] []                [] |
++     gbiff              |                               []                   |
++     gcal               |                      []                            |
++     gcc                |                            []                   [] |
++     gettext            |             []       []    [] []                [] |
++     gettext-examples   | []                   []       []                [] |
++     gettext-runtime    |             []       []    [] []                [] |
++     gettext-tools      |                      []       []                [] |
++     gimp-print         |                         [] [] []        []      [] |
++     gliv               |                                                    |
++     glunarclock        |                            [] []                   |
++     gnubiff            |                               []                   |
++     gnucash            |                         []    ()        []      [] |
++     gnucash-glossary   |                            [] ()                [] |
++     gnupg              |                      [] ()    [] []          [] [] |
++     gpe-aerial         |                         []                         |
++     gpe-beam           |                         []    []                   |
++     gpe-calendar       |                         []    []                   |
++     gpe-clock          |                         []    []                   |
++     gpe-conf           |                         []    []                   |
++     gpe-contacts       |                         []    []                   |
++     gpe-edit           |                         []                         |
++     gpe-go             |                         []                         |
++     gpe-login          |                         []    []                   |
++     gpe-ownerinfo      |                         []    []                   |
++     gpe-sketchbook     |                         []    []                   |
++     gpe-su             |                         []    []                   |
++     gpe-taskmanager    |                         []    []                   |
++     gpe-timesheet      |                         []                         |
++     gpe-today          |                         []    []                   |
++     gpe-todo           |                         []    []                   |
++     gphoto2            |                         [] [] []                [] |
++     gprof              |                            [] []                [] |
++     gpsdrive           |                               ()    ()          () |
++     gramadoir          |                               []                   |
++     grep               |             [] []    []       [] []             [] |
++     gretl              |                                                 [] |
++     gtick              | []                            ()                   |
++     hello              |                      []    [] [] []          [] [] |
++     id-utils           |                            [] []                   |
++     indent             |                      []       []             [] [] |
++     iso_3166           |          []    [] [] [] [] [] [] []          [] [] |
++     iso_3166_1         |                      [] [] [] [] []             [] |
++     iso_3166_2         |                                                    |
++     iso_3166_3         |                               []                   |
++     iso_4217           |                      []    [] []                [] |
++     iso_639            |                                                    |
++     jpilot             |                         [] []                   [] |
++     jtag               |                                                    |
++     jwhois             |                                                 [] |
++     kbd                |                         [] [] [] []             [] |
++     latrine            |                               ()                   |
++     ld                 |                            []                   [] |
++     libc               |                      [] [] [] [] []             [] |
++     libgpewidget       |                         []    []                   |
++     libiconv           |                      []    [] []             [] [] |
++     lifelines          |                            [] ()                   |
++     lilypond           |                               []                   |
++     lingoteach         |                                                    |
++     lingoteach_lessons |                               ()                () |
++     lynx               |                      [] [] [] []                   |
++     m4                 |                         [] [] [] []                |
++     mailutils          |                      []                         [] |
++     make               |                            [] []                [] |
++     man-db             |                      [] () [] []                () |
++     minicom            |                         []    []                [] |
++     mysecretdiary      |                            [] []                [] |
++     nano               |                      [] () [] []                [] |
++     nano_1_0           |                      [] () [] []                [] |
++     opcodes            |                                                 [] |
++     parted             |                      [] [] [] []                [] |
++     ptx                |                      []    [] []             [] [] |
++     python             |                                                    |
++     radius             |                                                 [] |
++     recode             |             []       []    [] [] []          [] [] |
++     rpm                |                         [] []                      |
++     screem             |                                                    |
++     scrollkeeper       |             []       [] [] [] []                [] |
++     sed                | []                   []    [] []             [] [] |
++     sh-utils           |                            [] []                [] |
++     shared-mime-info   |                                                    |
++     sharutils          |                      [] [] [] [] []             [] |
++     silky              |                               ()                   |
++     skencil            |                            [] ()                [] |
++     sketch             |                            [] ()                [] |
++     soundtracker       |                            [] []                [] |
++     sp                 |                               []                   |
++     tar                |                         [] [] []                [] |
++     texinfo            |                            [] []             []    |
++     textutils          |                      []    [] []                [] |
++     tin                |                               ()        ()         |
++     tp-robot           |                                                    |
++     tuxpaint           |                      [] [] [] [] []     []      [] |
++     unicode-han-tra... |                                                    |
++     unicode-transla... |                                                    |
++     util-linux         |                      [] [] [] []                [] |
++     vorbis-tools       |             []          [] []                   [] |
++     wastesedge         |                               ()                   |
++     wdiff              |                      []    [] []                [] |
++     wget               |                []    []    [] [] []             [] |
++     xchat              |                      []       [] []             [] |
++     xfree86_xkb_xml    |                         [] []                      |
++     xpad               |                                                 [] |
++                        +----------------------------------------------------+
++                          af am ar az be bg bs ca cs da de el en en_GB eo es
++                           4  0  0  1  9  4  1 40 41 60 78 17  1   5   13 68
++     
++                          et eu fa fi fr ga gl he hr hu id is it ja ko lg
++                        +-------------------------------------------------+
++     a2ps               | []       [] []                      ()    ()    |
++     aegis              |                                                 |
++     ant-phone          |             []                                  |
++     anubis             |             []                                  |
++     ap-utils           |             []                                  |
++     aspell             |             [] []                               |
++     bash               |             []             []                   |
++     batchelor          |             [] []                               |
++     bfd                |             []                                  |
++     binutils           |             []                         []       |
++     bison              | []          []                []    []          |
++     bluez-pin          |          [] [] []          [] []                |
++     clisp              |                                                 |
++     clisp              |             []                                  |
++     console-tools      |                                                 |
++     coreutils          | []       [] [] []                   [] []       |
++     cpio               |             []    []       []             []    |
++     darkstat           |             () []          [] []                |
++     diffutils          |          [] []    [] []    [] []       []       |
++     e2fsprogs          |                                                 |
++     enscript           |             []          []                      |
++     error              |          [] [] []          []                   |
++     fetchmail          |                                        []       |
++     fileutils          | []          [] []          []       [] []       |
++     findutils          | []       [] [] [] []    [] [] []    [] [] []    |
++     flex               |             [] []                         []    |
++     fslint             |             []                                  |
++     gas                |             []                                  |
++     gawk               |             []       []                []       |
++     gbiff              |             []                                  |
++     gcal               |             []                                  |
++     gcc                |             []                                  |
++     gettext            |             []                         [] []    |
++     gettext-examples   |             []                         []       |
++     gettext-runtime    |          [] []                []       [] []    |
++     gettext-tools      |             []                         [] []    |
++     gimp-print         |             []                         []       |
++     gliv               |             ()                                  |
++     glunarclock        |          []    [] []       []                   |
++     gnubiff            |             []                                  |
++     gnucash            |             ()                      []          |
++     gnucash-glossary   |                                     []          |
++     gnupg              | []       [] []    []          []    [] []       |
++     gpe-aerial         |             []                                  |
++     gpe-beam           |             []                                  |
++     gpe-calendar       |             []             [] []                |
++     gpe-clock          |             []                                  |
++     gpe-conf           |             []                                  |
++     gpe-contacts       |             []             []                   |
++     gpe-edit           |             []                []                |
++     gpe-go             |             []                                  |
++     gpe-login          |             []             []                   |
++     gpe-ownerinfo      |             []             [] []                |
++     gpe-sketchbook     |             []                                  |
++     gpe-su             |             []                                  |
++     gpe-taskmanager    |             []                                  |
++     gpe-timesheet      |             [] []             []                |
++     gpe-today          |             [] []                               |
++     gpe-todo           |             []                []                |
++     gphoto2            |             []             []          []       |
++     gprof              |             []                []                |
++     gpsdrive           |             ()                      () ()       |
++     gramadoir          |             [] []                               |
++     grep               | []       [] [] [] [] [] [] [] []    [] []       |
++     gretl              |             []                      []          |
++     gtick              |          [] [] []                               |
++     hello              | []    [] [] [] [] [] [] [] [] []    [] [] []    |
++     id-utils           |             []             [] []    []          |
++     indent             | []       [] [] [] []       [] []    [] []       |
++     iso_3166           |    []       [] []       [] [] []    []          |
++     iso_3166_1         |    []       [] []          [] []                |
++     iso_3166_2         |                                                 |
++     iso_3166_3         |                                                 |
++     iso_4217           | []          []    []       []       [] []       |
++     iso_639            |                                                 |
++     jpilot             |             []                         ()       |
++     jtag               |             []                                  |
++     jwhois             |             []             [] []    []          |
++     kbd                |             []                                  |
++     latrine            |             []                                  |
++     ld                 |             []                                  |
++     libc               |          [] []    []       []          [] []    |
++     libgpewidget       |             [] []          [] []                |
++     libiconv           | []       [] [] [] []    [] [] []    []          |
++     lifelines          |             ()                                  |
++     lilypond           |             []                                  |
++     lingoteach         |             []                []                |
++     lingoteach_lessons |                                                 |
++     lynx               | []                         []       [] []       |
++     m4                 |             []    []          []       []       |
++     mailutils          |                                                 |
++     make               |             []    [] [] []             [] []    |
++     man-db             |                                     () ()       |
++     minicom            |          [] []             []          []       |
++     mysecretdiary      |             []                []                |
++     nano               |             []    []          []    []          |
++     nano_1_0           |             []    []          []    []          |
++     opcodes            |             []                                  |
++     parted             |             []    []                   []       |
++     ptx                | []       [] [] [] []       [] []                |
++     python             |                                                 |
++     radius             |             []                                  |
++     recode             |             []    [] []    [] []    []          |
++     rpm                |             []                            []    |
++     screem             |                                                 |
++     scrollkeeper       |                            []                   |
++     sed                | []       [] [] [] []       [] []    [] []       |
++     sh-utils           | []       [] [] []          []       [] []       |
++     shared-mime-info   |          [] []             []                   |
++     sharutils          | []          []    []       []          []       |
++     silky              |          () []             ()       ()          |
++     skencil            |             []                                  |
++     sketch             |             []                                  |
++     soundtracker       |             []                      []          |
++     sp                 |             []                         ()       |
++     tar                | []       [] []    []    [] [] []    [] []       |
++     texinfo            |             []       [] []             []       |
++     textutils          |             [] [] []       []          [] []    |
++     tin                | []          ()                                  |
++     tp-robot           |             []                                  |
++     tuxpaint           |          [] []       []    [] [] [] [] [] []    |
++     unicode-han-tra... |                                                 |
++     unicode-transla... |             [] []                               |
++     util-linux         | []       [] []             []       () []       |
++     vorbis-tools       |             []                                  |
++     wastesedge         |             ()                                  |
++     wdiff              | []          [] [] []       [] []                |
++     wget               | []       [] []    []    [] []          []       |
++     xchat              | []       [] []                                  |
++     xfree86_xkb_xml    |             []             []                   |
++     xpad               |             [] []                               |
++                        +-------------------------------------------------+
++                          et eu fa fi fr ga gl he hr hu id is it ja ko lg
++                          22  2  1 26 106 28 24  8 10 41 33  1 26 33 12  0
++     
++                          lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru
++                        +-----------------------------------------------------+
++     a2ps               |             []       []    ()     ()     []   [] [] |
++     aegis              |                      ()                       () () |
++     ant-phone          |                      []                       []    |
++     anubis             |             []    [] []           []          [] [] |
++     ap-utils           |                      []           ()          []    |
++     aspell             |                      []                             |
++     bash               |                                          []   [] [] |
++     batchelor          |                                               []    |
++     bfd                |                                               []    |
++     binutils           |                                                  [] |
++     bison              |             []       []                  []   [] [] |
++     bluez-pin          |                      []           []          []    |
++     clisp              |                                                     |
++     clisp              |                      []                             |
++     console-tools      |                                                  [] |
++     coreutils          |                                   []             [] |
++     cpio               |                      []           []     []   [] [] |
++     darkstat           |             []       []                  []   []    |
++     diffutils          |             []       []           []     []   [] [] |
++     e2fsprogs          |                                   []                |
++     enscript           |                      []                  []   [] [] |
++     error              |                      []                  []   []    |
++     fetchmail          |                      []           []     ()      [] |
++     fileutils          |                                   []          [] [] |
++     findutils          |                      []           []     []   [] [] |
++     flex               |                                   []     []   [] [] |
++     fslint             |                      []                       []    |
++     gas                |                                                     |
++     gawk               |                                   []     []   []    |
++     gbiff              |                      []                       []    |
++     gcal               |                                                     |
++     gcc                |                                                     |
++     gettext            |                                   []          [] [] |
++     gettext-examples   |                      []           []          []    |
++     gettext-runtime    |                      []           []          [] [] |
++     gettext-tools      |                                   []          []    |
++     gimp-print         |                      []                             |
++     gliv               |                      []                  []   []    |
++     glunarclock        |             []       []                       [] [] |
++     gnubiff            |                      []                             |
++     gnucash            |                      []              []  ()      [] |
++     gnucash-glossary   |                      []              []             |
++     gnupg              |                                               []    |
++     gpe-aerial         |                      []              []       [] [] |
++     gpe-beam           |                      []              []       [] [] |
++     gpe-calendar       |                      []              []       [] [] |
++     gpe-clock          |                      []              []       [] [] |
++     gpe-conf           |                      []              []       [] [] |
++     gpe-contacts       |                      []              []       [] [] |
++     gpe-edit           |                      []              []       [] [] |
++     gpe-go             |                      []                       [] [] |
++     gpe-login          |                      []              []       [] [] |
++     gpe-ownerinfo      |                      []              []       [] [] |
++     gpe-sketchbook     |                      []              []       [] [] |
++     gpe-su             |                      []              []       [] [] |
++     gpe-taskmanager    |                      []              []       [] [] |
++     gpe-timesheet      |                      []              []       [] [] |
++     gpe-today          |                      []              []       [] [] |
++     gpe-todo           |                      []              []       [] [] |
++     gphoto2            |                                               []    |
++     gprof              |                                          []   []    |
++     gpsdrive           |                      ()    ()                 []    |
++     gramadoir          |                      ()                       []    |
++     grep               |                                   [] []  []   [] [] |
++     gretl              |                                                     |
++     gtick              |                      []                       [] [] |
++     hello              |    []       []    [] [] [] []     []     []   [] [] |
++     id-utils           |                      []                  []   [] [] |
++     indent             |                      []                  []   [] [] |
++     iso_3166           |          []                [] []                    |
++     iso_3166_1         |                      []    []                       |
++     iso_3166_2         |                                                     |
++     iso_3166_3         |                      []                             |
++     iso_4217           |          []          [] [] []     [] []  []      [] |
++     iso_639            |          []                                         |
++     jpilot             |                      ()    ()                       |
++     jtag               |                                                     |
++     jwhois             |                      []           []     []   [] () |
++     kbd                |                      []           []          []    |
++     latrine            |                                               []    |
++     ld                 |                                                     |
++     libc               |                   []       []     []     []         |
++     libgpewidget       |                      []              []       []    |
++     libiconv           |                      []           []     []   [] [] |
++     lifelines          |                                                     |
++     lilypond           |                                                     |
++     lingoteach         |                                                     |
++     lingoteach_lessons |                                                     |
++     lynx               |                      []                  []      [] |
++     m4                 |                      []           []     []   [] [] |
++     mailutils          |                                   []          [] [] |
++     make               |                      []           []     []      [] |
++     man-db             |                                               []    |
++     minicom            |                                   []     []   [] [] |
++     mysecretdiary      |                      []                  []   []    |
++     nano               |             []       []           []          [] [] |
++     nano_1_0           |             []    []    []        []          [] [] |
++     opcodes            |                      []                       []    |
++     parted             |                         []        [] []  []         |
++     ptx                |                   [] []    []     [] []  []   [] [] |
++     python             |                                                     |
++     radius             |                                   []             [] |
++     recode             |                                   []     []   [] [] |
++     rpm                |                                   [] []          [] |
++     screem             |                                                     |
++     scrollkeeper       |                   [] []           []          [] [] |
++     sed                |                                   []     []   []    |
++     sh-utils           |                   []                             [] |
++     shared-mime-info   |                      [] []                          |
++     sharutils          |                      []                          [] |
++     silky              |                                                  () |
++     skencil            |                                      []  []         |
++     sketch             |                                      []  []         |
++     soundtracker       |                                                     |
++     sp                 |                                                     |
++     tar                |             []    []       []     []     []   []    |
++     texinfo            |                   []              []          [] [] |
++     textutils          |                   []                             [] |
++     tin                |                                                     |
++     tp-robot           |                      []                             |
++     tuxpaint           | []          []       [] []        [] []  []   []    |
++     unicode-han-tra... |                                                     |
++     unicode-transla... |                                                     |
++     util-linux         |                      []                  []      [] |
++     vorbis-tools       |                      []                       [] [] |
++     wastesedge         |                                                     |
++     wdiff              |             []                    []     []   [] [] |
++     wget               |                                   []          [] [] |
++     xchat              |    []                []                          [] |
++     xfree86_xkb_xml    |                      []                          [] |
++     xpad               |                      []                       []    |
++                        +-----------------------------------------------------+
++                          lt lv mk mn ms mt nb nl nn no nso pl pt pt_BR ro ru
++                           1  2  0  3 12  0 10 69  6  7  1  40 26  36   76 63
++     
++                          sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu
++                        +-----------------------------------------------------+
++     a2ps               |    []    []       [] []                             | 16
++     aegis              |                                                     |  0
++     ant-phone          |                                                     |  3
++     anubis             |                   [] []                             |  9
++     ap-utils           |                      ()                             |  3
++     aspell             |                                                     |  4
++     bash               |                                                     |  9
++     batchelor          |                                                     |  3
++     bfd                |          []       []                                |  6
++     binutils           |          []       []                  []            |  8
++     bison              |          []       []                                | 14
++     bluez-pin          | []       []                    []                   | 14
++     clisp              |                                                     |  0
++     clisp              |                                                     |  5
++     console-tools      |                                                     |  3
++     coreutils          |    []    []       []                        []      | 16
++     cpio               |          []                           []            | 14
++     darkstat           | []    [] []                           ()    ()      | 12
++     diffutils          |          []       []                        []      | 23
++     e2fsprogs          |          []       []                                |  6
++     enscript           |          []       []                                | 12
++     error              | []                []                        []      | 15
++     fetchmail          | []                []                                | 11
++     fileutils          |    []    []       []                  []    []      | 17
++     findutils          | [] [] [] []       []                  []            | 29
++     flex               |          []       []                                | 13
++     fslint             |                                                     |  3
++     gas                |                   []                                |  3
++     gawk               |          []       []                                | 12
++     gbiff              |                                                     |  4
++     gcal               |          []       []                                |  4
++     gcc                |                   []                                |  4
++     gettext            | [] []    []       []                        []      | 16
++     gettext-examples   | []    [] []       []                  []            | 14
++     gettext-runtime    | [] [] [] []       [] []               []    []      | 22
++     gettext-tools      | [] [] [] []       []                  []            | 14
++     gimp-print         | []       []                                         | 10
++     gliv               |                                                     |  3
++     glunarclock        |       [] []                    []                   | 13
++     gnubiff            |                                                     |  3
++     gnucash            | []                                          []      |  9
++     gnucash-glossary   | []       []                                 []      |  8
++     gnupg              | []       []       []                        []      | 17
++     gpe-aerial         |          []                                         |  7
++     gpe-beam           |          []                                         |  8
++     gpe-calendar       | []       []                    []           []      | 13
++     gpe-clock          | []    [] []                                         | 10
++     gpe-conf           | []       []                                         |  9
++     gpe-contacts       | []       []                                 []      | 11
++     gpe-edit           | []    [] []                    []           []      | 12
++     gpe-go             |                                                     |  5
++     gpe-login          | []    [] []                    []           []      | 13
++     gpe-ownerinfo      | []    [] []                                 []      | 13
++     gpe-sketchbook     | []       []                                         |  9
++     gpe-su             | []    [] []                                         | 10
++     gpe-taskmanager    | []    [] []                                         | 10
++     gpe-timesheet      | []    [] []                                 []      | 12
++     gpe-today          | []    [] []                    []           []      | 13
++     gpe-todo           | []       []                    []           []      | 12
++     gphoto2            | []       []                           []            | 11
++     gprof              |          []       []                                |  9
++     gpsdrive           | []       []                                         |  3
++     gramadoir          | []                                                  |  5
++     grep               |    [] []          [] []                             | 26
++     gretl              |                                                     |  3
++     gtick              |                                                     |  7
++     hello              | []    [] []       [] []                             | 34
++     id-utils           |          []       []                                | 12
++     indent             | []    [] []       []                                | 21
++     iso_3166           | [] [] [] []       []    []     []                   | 27
++     iso_3166_1         | [] []             []                                | 16
++     iso_3166_2         |                                                     |  0
++     iso_3166_3         |                                                     |  2
++     iso_4217           | [] []    []       [] []               []            | 24
++     iso_639            |                                                     |  1
++     jpilot             |          []       []        []        []    []      |  9
++     jtag               | []                                                  |  2
++     jwhois             |          ()       []                        []      | 11
++     kbd                |          []       []                                | 11
++     latrine            |                                                     |  2
++     ld                 |          []       []                                |  5
++     libc               | []       []       []                  []            | 20
++     libgpewidget       | []    [] []                    []                   | 13
++     libiconv           | [] [] [] []       [] []        []     []            | 27
++     lifelines          |          []                                         |  2
++     lilypond           |          []                                         |  3
++     lingoteach         |                                                     |  2
++     lingoteach_lessons |                                       ()            |  0
++     lynx               |          []       [] []                             | 14
++     m4                 |          []                           []            | 15
++     mailutils          |                                                     |  5
++     make               |          []       []                  []            | 16
++     man-db             |          []                                         |  5
++     minicom            |                                                     | 11
++     mysecretdiary      |          []       []                                | 10
++     nano               |       [] []       [] []                             | 17
++     nano_1_0           |          []       [] []                             | 17
++     opcodes            |          []       []                                |  6
++     parted             |          []       []                  []            | 15
++     ptx                |          []       []                                | 22
++     python             |                                                     |  0
++     radius             |                                                     |  4
++     recode             |    []    []       []                                | 20
++     rpm                |          []       []                                |  9
++     screem             |          []                           []            |  2
++     scrollkeeper       | []    [] []                                         | 15
++     sed                | [] [] [] []       [] []                             | 24
++     sh-utils           |    []             []                                | 14
++     shared-mime-info   |       [] []                                         |  7
++     sharutils          |       [] []       []                        []      | 17
++     silky              | ()                                                  |  3
++     skencil            |          []                                         |  6
++     sketch             |          []                                         |  6
++     soundtracker       | []       []                                         |  7
++     sp                 |                   []                                |  3
++     tar                | [] []    []       []                  []            | 24
++     texinfo            |          []       []                  []            | 14
++     textutils          |    []    []       []                        []      | 16
++     tin                |                                                     |  1
++     tp-robot           |                                                     |  2
++     tuxpaint           | []       []       []           []     []            | 29
++     unicode-han-tra... |                                                     |  0
++     unicode-transla... |                                                     |  2
++     util-linux         |          []       []                                | 15
++     vorbis-tools       |                                                     |  8
++     wastesedge         |                                                     |  0
++     wdiff              | []       []       []                                | 18
++     wget               | [] [] [] []       [] []               []    []      | 24
++     xchat              | [] [] [] []                           []            | 15
++     xfree86_xkb_xml    | []    []          [] []               []            | 11
++     xpad               |                                                     |  5
++                        +-----------------------------------------------------+
++       63 teams           sk sl sr sv ta th tr uk ven vi wa xh zh_CN zh_TW zu
++      131 domains         47 19 28 83  0  0 59 13  1   1 11  0  22    22    0  1373
+ 
+    Some counters in the preceding matrix are higher than the number of
+ visible blocks let us expect.  This is because a few extra PO files are
+@@ -220,6 +742,27 @@
+ lag between the mere existence a PO file and its wide availability in a
+ distribution.
+ 
+-   If August 1997 seems to be old, you may fetch a more recent copy of
+-this `ABOUT-NLS' file on most GNU archive sites.
++   If January 2004 seems to be old, you may fetch a more recent copy of
++this `ABOUT-NLS' file on most GNU archive sites.  The most up-to-date
++matrix with full percentage details can be found at
++`http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'.
++
++Using `gettext' in new packages
++===============================
++
++If you are writing a freely available program and want to
++internationalize it you are welcome to use GNU `gettext' in your
++package.  Of course you have to respect the GNU Library General Public
++License which covers the use of the GNU `gettext' library.  This means
++in particular that even non-free programs can use `libintl' as a shared
++library, whereas only free software can use `libintl' as a static
++library or use modified versions of `libintl'.
++
++   Once the sources are changed appropriately and the setup can handle
++the use of `gettext' the only thing missing are the translations.  The
++Free Translation Project is also available for packages which are not
++developed inside the GNU project.  Therefore the information given above
++applies also for every other Free Software Project.  Contact
++`translation@iro.umontreal.ca' to make the `.pot' files available to
++the translation teams.
+ 
+--- lrzsz-0.12.20.safe/ChangeLog	1998-12-29 17:49:56.000000000 -0500
++++ lrzsz-0.12.20/ChangeLog	2004-09-12 14:40:35.846521456 -0400
+@@ -1,3 +1,11 @@
++2004-09-12  gettextize  <bug-gnu-gettext@gnu.org>
++
++	* Makefile.am (ACLOCAL_AMFLAGS): New variable.
++	(EXTRA_DIST): Add config.rpath.
++	* configure.in (AC_OUTPUT): Add m4/Makefile.
++	(AC_OUTPUT): Remove command that created po/Makefile.
++	(AC_LINK_FILES): Remove invocation.
++
+ 1998-12-29	Uwe Ohse  <uwe@ohse.de>
+ 
+ 	* src/lrz.c: removed stpcpy call.
+--- lrzsz-0.12.20.safe/config.rpath	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/config.rpath	2004-09-12 14:40:34.329752040 -0400
+@@ -0,0 +1,548 @@
++#! /bin/sh
++# Output a system dependent set of variables, describing how to set the
++# run time search path of shared libraries in an executable.
++#
++#   Copyright 1996-2003 Free Software Foundation, Inc.
++#   Taken from GNU libtool, 2001
++#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
++#
++#   This program is free software; you can redistribute it and/or modify
++#   it under the terms of the GNU General Public License as published by
++#   the Free Software Foundation; either version 2 of the License, or
++#   (at your option) any later version.
++#
++#   This program is distributed in the hope that it will be useful, but
++#   WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++#   General Public License for more details.
++#
++#   You should have received a copy of the GNU General Public License
++#   along with this program; if not, write to the Free Software
++#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++#
++#   As a special exception to the GNU General Public License, if you
++#   distribute this file as part of a program that contains a
++#   configuration script generated by Autoconf, you may include it under
++#   the same distribution terms that you use for the rest of that program.
++#
++# The first argument passed to this file is the canonical host specification,
++#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
++# or
++#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
++# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
++# should be set by the caller.
++#
++# The set of defined variables is at the end of this script.
++
++# Known limitations:
++# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
++#   than 256 bytes, otherwise the compiler driver will dump core. The only
++#   known workaround is to choose shorter directory names for the build
++#   directory and/or the installation directory.
++
++# All known linkers require a `.a' archive for static linking (except M$VC,
++# which needs '.lib').
++libext=a
++shrext=.so
++
++host="$1"
++host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
++host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
++host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
++
++# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
++
++wl=
++if test "$GCC" = yes; then
++  wl='-Wl,'
++else
++  case "$host_os" in
++    aix*)
++      wl='-Wl,'
++      ;;
++    mingw* | pw32* | os2*)
++      ;;
++    hpux9* | hpux10* | hpux11*)
++      wl='-Wl,'
++      ;;
++    irix5* | irix6* | nonstopux*)
++      wl='-Wl,'
++      ;;
++    newsos6)
++      ;;
++    linux*)
++      case $CC in
++        icc|ecc)
++          wl='-Wl,'
++          ;;
++        ccc)
++          wl='-Wl,'
++          ;;
++      esac
++      ;;
++    osf3* | osf4* | osf5*)
++      wl='-Wl,'
++      ;;
++    sco3.2v5*)
++      ;;
++    solaris*)
++      wl='-Wl,'
++      ;;
++    sunos4*)
++      wl='-Qoption ld '
++      ;;
++    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++      wl='-Wl,'
++      ;;
++    sysv4*MP*)
++      ;;
++    uts4*)
++      ;;
++  esac
++fi
++
++# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
++
++hardcode_libdir_flag_spec=
++hardcode_libdir_separator=
++hardcode_direct=no
++hardcode_minus_L=no
++
++case "$host_os" in
++  cygwin* | mingw* | pw32*)
++    # FIXME: the MSVC++ port hasn't been tested in a loooong time
++    # When not using gcc, we currently assume that we are using
++    # Microsoft Visual C++.
++    if test "$GCC" != yes; then
++      with_gnu_ld=no
++    fi
++    ;;
++  openbsd*)
++    with_gnu_ld=no
++    ;;
++esac
++
++ld_shlibs=yes
++if test "$with_gnu_ld" = yes; then
++  case "$host_os" in
++    aix3* | aix4* | aix5*)
++      # On AIX/PPC, the GNU linker is very broken
++      if test "$host_cpu" != ia64; then
++        ld_shlibs=no
++      fi
++      ;;
++    amigaos*)
++      hardcode_libdir_flag_spec='-L$libdir'
++      hardcode_minus_L=yes
++      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
++      # that the semantics of dynamic libraries on AmigaOS, at least up
++      # to version 4, is to share data among multiple programs linked
++      # with the same dynamic library.  Since this doesn't match the
++      # behavior of shared libraries on other platforms, we can use
++      # them.
++      ld_shlibs=no
++      ;;
++    beos*)
++      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++        :
++      else
++        ld_shlibs=no
++      fi
++      ;;
++    cygwin* | mingw* | pw32*)
++      # hardcode_libdir_flag_spec is actually meaningless, as there is
++      # no search path for DLLs.
++      hardcode_libdir_flag_spec='-L$libdir'
++      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
++        :
++      else
++        ld_shlibs=no
++      fi
++      ;;
++    netbsd*)
++      ;;
++    solaris* | sysv5*)
++      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
++        ld_shlibs=no
++      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++        :
++      else
++        ld_shlibs=no
++      fi
++      ;;
++    sunos4*)
++      hardcode_direct=yes
++      ;;
++    *)
++      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
++        :
++      else
++        ld_shlibs=no
++      fi
++      ;;
++  esac
++  if test "$ld_shlibs" = yes; then
++    # Unlike libtool, we use -rpath here, not --rpath, since the documented
++    # option of GNU ld is called -rpath, not --rpath.
++    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++  fi
++else
++  case "$host_os" in
++    aix3*)
++      # Note: this linker hardcodes the directories in LIBPATH if there
++      # are no directories specified by -L.
++      hardcode_minus_L=yes
++      if test "$GCC" = yes; then
++        # Neither direct hardcoding nor static linking is supported with a
++        # broken collect2.
++        hardcode_direct=unsupported
++      fi
++      ;;
++    aix4* | aix5*)
++      if test "$host_cpu" = ia64; then
++        # On IA64, the linker does run time linking by default, so we don't
++        # have to do anything special.
++        aix_use_runtimelinking=no
++      else
++        aix_use_runtimelinking=no
++        # Test if we are trying to use run time linking or normal
++        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
++        # need to do runtime linking.
++        case $host_os in aix4.[23]|aix4.[23].*|aix5*)
++          for ld_flag in $LDFLAGS; do
++            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
++              aix_use_runtimelinking=yes
++              break
++            fi
++          done
++        esac
++      fi
++      hardcode_direct=yes
++      hardcode_libdir_separator=':'
++      if test "$GCC" = yes; then
++        case $host_os in aix4.[012]|aix4.[012].*)
++          collect2name=`${CC} -print-prog-name=collect2`
++          if test -f "$collect2name" && \
++            strings "$collect2name" | grep resolve_lib_name >/dev/null
++          then
++            # We have reworked collect2
++            hardcode_direct=yes
++          else
++            # We have old collect2
++            hardcode_direct=unsupported
++            hardcode_minus_L=yes
++            hardcode_libdir_flag_spec='-L$libdir'
++            hardcode_libdir_separator=
++          fi
++        esac
++      fi
++      # Begin _LT_AC_SYS_LIBPATH_AIX.
++      echo 'int main () { return 0; }' > conftest.c
++      ${CC} ${LDFLAGS} conftest.c -o conftest
++      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
++}'`
++      if test -z "$aix_libpath"; then
++        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
++}'`
++      fi
++      if test -z "$aix_libpath"; then
++        aix_libpath="/usr/lib:/lib"
++      fi
++      rm -f conftest.c conftest
++      # End _LT_AC_SYS_LIBPATH_AIX.
++      if test "$aix_use_runtimelinking" = yes; then
++        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
++      else
++        if test "$host_cpu" = ia64; then
++          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
++        else
++          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
++        fi
++      fi
++      ;;
++    amigaos*)
++      hardcode_libdir_flag_spec='-L$libdir'
++      hardcode_minus_L=yes
++      # see comment about different semantics on the GNU ld section
++      ld_shlibs=no
++      ;;
++    bsdi4*)
++      ;;
++    cygwin* | mingw* | pw32*)
++      # When not using gcc, we currently assume that we are using
++      # Microsoft Visual C++.
++      # hardcode_libdir_flag_spec is actually meaningless, as there is
++      # no search path for DLLs.
++      hardcode_libdir_flag_spec=' '
++      libext=lib
++      ;;
++    darwin* | rhapsody*)
++      if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
++        hardcode_direct=no
++      fi
++      ;;
++    dgux*)
++      hardcode_libdir_flag_spec='-L$libdir'
++      ;;
++    freebsd1*)
++      ld_shlibs=no
++      ;;
++    freebsd2.2*)
++      hardcode_libdir_flag_spec='-R$libdir'
++      hardcode_direct=yes
++      ;;
++    freebsd2*)
++      hardcode_direct=yes
++      hardcode_minus_L=yes
++      ;;
++    freebsd*)
++      hardcode_libdir_flag_spec='-R$libdir'
++      hardcode_direct=yes
++      ;;
++    hpux9*)
++      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++      hardcode_libdir_separator=:
++      hardcode_direct=yes
++      # hardcode_minus_L: Not really in the search PATH,
++      # but as the default location of the library.
++      hardcode_minus_L=yes
++      ;;
++    hpux10* | hpux11*)
++      if test "$with_gnu_ld" = no; then
++        case "$host_cpu" in
++          hppa*64*)
++            hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++            hardcode_libdir_separator=:
++            hardcode_direct=no
++            ;;
++          ia64*)
++            hardcode_libdir_flag_spec='-L$libdir'
++            hardcode_direct=no
++            # hardcode_minus_L: Not really in the search PATH,
++            # but as the default location of the library.
++            hardcode_minus_L=yes
++            ;;
++          *)
++            hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
++            hardcode_libdir_separator=:
++            hardcode_direct=yes
++            # hardcode_minus_L: Not really in the search PATH,
++            # but as the default location of the library.
++            hardcode_minus_L=yes
++            ;;
++        esac
++      fi
++      ;;
++    irix5* | irix6* | nonstopux*)
++      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++      hardcode_libdir_separator=:
++      ;;
++    netbsd*)
++      hardcode_libdir_flag_spec='-R$libdir'
++      hardcode_direct=yes
++      ;;
++    newsos6)
++      hardcode_direct=yes
++      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++      hardcode_libdir_separator=:
++      ;;
++    openbsd*)
++      hardcode_direct=yes
++      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
++      else
++        case "$host_os" in
++          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
++            hardcode_libdir_flag_spec='-R$libdir'
++            ;;
++          *)
++            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
++            ;;
++        esac
++      fi
++      ;;
++    os2*)
++      hardcode_libdir_flag_spec='-L$libdir'
++      hardcode_minus_L=yes
++      ;;
++    osf3*)
++      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++      hardcode_libdir_separator=:
++      ;;
++    osf4* | osf5*)
++      if test "$GCC" = yes; then
++        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
++      else
++        # Both cc and cxx compiler support -rpath directly
++        hardcode_libdir_flag_spec='-rpath $libdir'
++      fi
++      hardcode_libdir_separator=:
++      ;;
++    sco3.2v5*)
++      ;;
++    solaris*)
++      hardcode_libdir_flag_spec='-R$libdir'
++      ;;
++    sunos4*)
++      hardcode_libdir_flag_spec='-L$libdir'
++      hardcode_direct=yes
++      hardcode_minus_L=yes
++      ;;
++    sysv4)
++      case $host_vendor in
++        sni)
++          hardcode_direct=yes # is this really true???
++          ;;
++        siemens)
++          hardcode_direct=no
++          ;;
++        motorola)
++          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
++          ;;
++      esac
++      ;;
++    sysv4.3*)
++      ;;
++    sysv4*MP*)
++      if test -d /usr/nec; then
++        ld_shlibs=yes
++      fi
++      ;;
++    sysv4.2uw2*)
++      hardcode_direct=yes
++      hardcode_minus_L=no
++      ;;
++    sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[78]* | unixware7*)
++      ;;
++    sysv5*)
++      hardcode_libdir_flag_spec=
++      ;;
++    uts4*)
++      hardcode_libdir_flag_spec='-L$libdir'
++      ;;
++    *)
++      ld_shlibs=no
++      ;;
++  esac
++fi
++
++# Check dynamic linker characteristics
++# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
++libname_spec='lib$name'
++case "$host_os" in
++  aix3*)
++    ;;
++  aix4* | aix5*)
++    ;;
++  amigaos*)
++    ;;
++  beos*)
++    ;;
++  bsdi4*)
++    ;;
++  cygwin* | mingw* | pw32*)
++    shrext=.dll
++    ;;
++  darwin* | rhapsody*)
++    shrext=.dylib
++    ;;
++  dgux*)
++    ;;
++  freebsd1*)
++    ;;
++  freebsd*)
++    ;;
++  gnu*)
++    ;;
++  hpux9* | hpux10* | hpux11*)
++    case "$host_cpu" in
++      ia64*)
++        shrext=.so
++        ;;
++      hppa*64*)
++        shrext=.sl
++        ;;
++      *)
++        shrext=.sl
++        ;;
++    esac
++    ;;
++  irix5* | irix6* | nonstopux*)
++    case "$host_os" in
++      irix5* | nonstopux*)
++        libsuff= shlibsuff=
++        ;;
++      *)
++        case $LD in
++          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
++          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
++          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
++          *) libsuff= shlibsuff= ;;
++        esac
++        ;;
++    esac
++    ;;
++  linux*oldld* | linux*aout* | linux*coff*)
++    ;;
++  linux*)
++    ;;
++  netbsd*)
++    ;;
++  newsos6)
++    ;;
++  nto-qnx)
++    ;;
++  openbsd*)
++    ;;
++  os2*)
++    libname_spec='$name'
++    shrext=.dll
++    ;;
++  osf3* | osf4* | osf5*)
++    ;;
++  sco3.2v5*)
++    ;;
++  solaris*)
++    ;;
++  sunos4*)
++    ;;
++  sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++    ;;
++  sysv4*MP*)
++    ;;
++  uts4*)
++    ;;
++esac
++
++sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
++escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
++shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
++escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
++
++sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
++
++# How to pass a linker flag through the compiler.
++wl="$escaped_wl"
++
++# Static library suffix (normally "a").
++libext="$libext"
++
++# Shared library suffix (normally "so").
++shlibext="$shlibext"
++
++# Flag to hardcode \$libdir into a binary during linking.
++# This must work even if \$libdir does not exist.
++hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
++
++# Whether we need a single -rpath flag with a separated argument.
++hardcode_libdir_separator="$hardcode_libdir_separator"
++
++# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
++# resulting binary.
++hardcode_direct="$hardcode_direct"
++
++# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
++# resulting binary.
++hardcode_minus_L="$hardcode_minus_L"
++
++EOF
+--- lrzsz-0.12.20.safe/configure.in	2004-09-12 14:39:55.161706488 -0400
++++ lrzsz-0.12.20/configure.in	2004-09-12 14:40:35.816526016 -0400
+@@ -260,11 +260,10 @@
+ AM_GNU_GETTEXT
+ 
+ AC_DEFINE_UNQUOTED(LOCALEDIR,"$prefix/$DATADIRNAME")
+-AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+ 
+-AC_OUTPUT([Makefile intl/Makefile lib/Makefile testsuite/Makefile \
++AC_OUTPUT([Makefile intl/Makefile lib/Makefile testsuite/Makefile  m4/Makefile \
+ man/Makefile po/Makefile.in src/Makefile debian/rules Specfile systype \
+ src/lrzszbug],
+-[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; 
++[
+ chmod +x debian/rules;
+ test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
+--- lrzsz-0.12.20.safe/intl/bindtextdom.c	1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/bindtextdom.c	2004-09-12 14:40:34.343749912 -0400
+@@ -1,59 +1,75 @@
+ /* Implementation of the bindtextdomain(3) function
+-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++   Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+ 
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#else
+-# ifdef HAVE_MALLOC_H
+-#  include <malloc.h>
+-# else
+-void free ();
+-# endif
+-#endif
++#include <stddef.h>
++#include <stdlib.h>
++#include <string.h>
+ 
+-#if defined HAVE_STRING_H || defined _LIBC
+-# include <string.h>
++#ifdef _LIBC
++# include <libintl.h>
+ #else
+-# include <strings.h>
+-# ifndef memcpy
+-#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+-# endif
++# include "libgnuintl.h"
+ #endif
++#include "gettextP.h"
+ 
+ #ifdef _LIBC
+-# include <libintl.h>
++/* We have to handle multi-threaded applications.  */
++# include <bits/libc-lock.h>
+ #else
+-# include "libgettext.h"
++/* Provide dummy implementation if this is outside glibc.  */
++# define __libc_rwlock_define(CLASS, NAME)
++# define __libc_rwlock_wrlock(NAME)
++# define __libc_rwlock_unlock(NAME)
++#endif
++
++/* The internal variables in the standalone libintl.a must have different
++   names than the internal variables in GNU libc, otherwise programs
++   using libintl.a cannot be linked statically.  */
++#if !defined _LIBC
++# define _nl_default_dirname libintl_nl_default_dirname
++# define _nl_domain_bindings libintl_nl_domain_bindings
++#endif
++
++/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>.  */
++#ifndef offsetof
++# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
+ #endif
+-#include "gettext.h"
+-#include "gettextP.h"
+ 
+ /* @@ end of prolog @@ */
+ 
+ /* Contains the default location of the message catalogs.  */
+ extern const char _nl_default_dirname[];
++#ifdef _LIBC
++extern const char _nl_default_dirname_internal[] attribute_hidden;
++#else
++# define INTUSE(name) name
++#endif
+ 
+ /* List with bindings of specific domains.  */
+ extern struct binding *_nl_domain_bindings;
+ 
++/* Lock variable to protect the global data in the gettext implementation.  */
++__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
++
+ 
+ /* Names for the libintl functions are a problem.  They must not clash
+    with existing names and they should follow ANSI C.  But this source
+@@ -61,23 +77,41 @@
+    prefix.  So we have to make a difference here.  */
+ #ifdef _LIBC
+ # define BINDTEXTDOMAIN __bindtextdomain
+-# define strdup(str) __strdup (str)
++# define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset
++# ifndef strdup
++#  define strdup(str) __strdup (str)
++# endif
+ #else
+-# define BINDTEXTDOMAIN bindtextdomain__
++# define BINDTEXTDOMAIN libintl_bindtextdomain
++# define BIND_TEXTDOMAIN_CODESET libintl_bind_textdomain_codeset
+ #endif
+ 
+-/* Specify that the DOMAINNAME message catalog will be found
+-   in DIRNAME rather than in the system locale data base.  */
+-char *
+-BINDTEXTDOMAIN (domainname, dirname)
+-     const char *domainname;
+-     const char *dirname;
++/* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP
++   to be used for the DOMAINNAME message catalog.
++   If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not
++   modified, only the current value is returned.
++   If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither
++   modified nor returned.  */
++static void
++set_binding_values (const char *domainname,
++		    const char **dirnamep, const char **codesetp)
+ {
+   struct binding *binding;
++  int modified;
+ 
+   /* Some sanity checks.  */
+   if (domainname == NULL || domainname[0] == '\0')
+-    return NULL;
++    {
++      if (dirnamep)
++	*dirnamep = NULL;
++      if (codesetp)
++	*codesetp = NULL;
++      return;
++    }
++
++  __libc_rwlock_wrlock (_nl_state_lock);
++
++  modified = 0;
+ 
+   for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+     {
+@@ -93,81 +127,173 @@
+ 	}
+     }
+ 
+-  if (dirname == NULL)
+-    /* The current binding has be to returned.  */
+-    return binding == NULL ? (char *) _nl_default_dirname : binding->dirname;
+-
+   if (binding != NULL)
+     {
+-      /* The domain is already bound.  If the new value and the old
+-	 one are equal we simply do nothing.  Otherwise replace the
+-	 old binding.  */
+-      if (strcmp (dirname, binding->dirname) != 0)
++      if (dirnamep)
+ 	{
+-	  char *new_dirname;
++	  const char *dirname = *dirnamep;
+ 
+-	  if (strcmp (dirname, _nl_default_dirname) == 0)
+-	    new_dirname = (char *) _nl_default_dirname;
++	  if (dirname == NULL)
++	    /* The current binding has be to returned.  */
++	    *dirnamep = binding->dirname;
+ 	  else
+ 	    {
++	      /* The domain is already bound.  If the new value and the old
++		 one are equal we simply do nothing.  Otherwise replace the
++		 old binding.  */
++	      char *result = binding->dirname;
++	      if (strcmp (dirname, result) != 0)
++		{
++		  if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
++		    result = (char *) INTUSE(_nl_default_dirname);
++		  else
++		    {
+ #if defined _LIBC || defined HAVE_STRDUP
+-	      new_dirname = strdup (dirname);
+-	      if (new_dirname == NULL)
+-		return NULL;
++		      result = strdup (dirname);
+ #else
+-	      size_t len = strlen (dirname) + 1;
+-	      new_dirname = (char *) malloc (len);
+-	      if (new_dirname == NULL)
+-		return NULL;
+-
+-	      memcpy (new_dirname, dirname, len);
++		      size_t len = strlen (dirname) + 1;
++		      result = (char *) malloc (len);
++		      if (__builtin_expect (result != NULL, 1))
++			memcpy (result, dirname, len);
+ #endif
++		    }
++
++		  if (__builtin_expect (result != NULL, 1))
++		    {
++		      if (binding->dirname != INTUSE(_nl_default_dirname))
++			free (binding->dirname);
++
++		      binding->dirname = result;
++		      modified = 1;
++		    }
++		}
++	      *dirnamep = result;
+ 	    }
++	}
+ 
+-	  if (binding->dirname != _nl_default_dirname)
+-	    free (binding->dirname);
++      if (codesetp)
++	{
++	  const char *codeset = *codesetp;
+ 
+-	  binding->dirname = new_dirname;
++	  if (codeset == NULL)
++	    /* The current binding has be to returned.  */
++	    *codesetp = binding->codeset;
++	  else
++	    {
++	      /* The domain is already bound.  If the new value and the old
++		 one are equal we simply do nothing.  Otherwise replace the
++		 old binding.  */
++	      char *result = binding->codeset;
++	      if (result == NULL || strcmp (codeset, result) != 0)
++		{
++#if defined _LIBC || defined HAVE_STRDUP
++		  result = strdup (codeset);
++#else
++		  size_t len = strlen (codeset) + 1;
++		  result = (char *) malloc (len);
++		  if (__builtin_expect (result != NULL, 1))
++		    memcpy (result, codeset, len);
++#endif
++
++		  if (__builtin_expect (result != NULL, 1))
++		    {
++		      if (binding->codeset != NULL)
++			free (binding->codeset);
++
++		      binding->codeset = result;
++		      binding->codeset_cntr++;
++		      modified = 1;
++		    }
++		}
++	      *codesetp = result;
++	    }
+ 	}
+     }
++  else if ((dirnamep == NULL || *dirnamep == NULL)
++	   && (codesetp == NULL || *codesetp == NULL))
++    {
++      /* Simply return the default values.  */
++      if (dirnamep)
++	*dirnamep = INTUSE(_nl_default_dirname);
++      if (codesetp)
++	*codesetp = NULL;
++    }
+   else
+     {
+       /* We have to create a new binding.  */
+-      size_t len;
++      size_t len = strlen (domainname) + 1;
+       struct binding *new_binding =
+-	(struct binding *) malloc (sizeof (*new_binding));
++	(struct binding *) malloc (offsetof (struct binding, domainname) + len);
+ 
+-      if (new_binding == NULL)
+-	return NULL;
++      if (__builtin_expect (new_binding == NULL, 0))
++	goto failed;
+ 
++      memcpy (new_binding->domainname, domainname, len);
++
++      if (dirnamep)
++	{
++	  const char *dirname = *dirnamep;
++
++	  if (dirname == NULL)
++	    /* The default value.  */
++	    dirname = INTUSE(_nl_default_dirname);
++	  else
++	    {
++	      if (strcmp (dirname, INTUSE(_nl_default_dirname)) == 0)
++		dirname = INTUSE(_nl_default_dirname);
++	      else
++		{
++		  char *result;
+ #if defined _LIBC || defined HAVE_STRDUP
+-      new_binding->domainname = strdup (domainname);
+-      if (new_binding->domainname == NULL)
+-	return NULL;
++		  result = strdup (dirname);
++		  if (__builtin_expect (result == NULL, 0))
++		    goto failed_dirname;
+ #else
+-      len = strlen (domainname) + 1;
+-      new_binding->domainname = (char *) malloc (len);
+-      if (new_binding->domainname == NULL)
+-	return NULL;
+-      memcpy (new_binding->domainname, domainname, len);
++		  size_t len = strlen (dirname) + 1;
++		  result = (char *) malloc (len);
++		  if (__builtin_expect (result == NULL, 0))
++		    goto failed_dirname;
++		  memcpy (result, dirname, len);
+ #endif
+-
+-      if (strcmp (dirname, _nl_default_dirname) == 0)
+-	new_binding->dirname = (char *) _nl_default_dirname;
++		  dirname = result;
++		}
++	    }
++	  *dirnamep = dirname;
++	  new_binding->dirname = (char *) dirname;
++	}
+       else
++	/* The default value.  */
++	new_binding->dirname = (char *) INTUSE(_nl_default_dirname);
++
++      new_binding->codeset_cntr = 0;
++
++      if (codesetp)
+ 	{
++	  const char *codeset = *codesetp;
++
++	  if (codeset != NULL)
++	    {
++	      char *result;
++
+ #if defined _LIBC || defined HAVE_STRDUP
+-	  new_binding->dirname = strdup (dirname);
+-	  if (new_binding->dirname == NULL)
+-	    return NULL;
++	      result = strdup (codeset);
++	      if (__builtin_expect (result == NULL, 0))
++		goto failed_codeset;
+ #else
+-	  len = strlen (dirname) + 1;
+-	  new_binding->dirname = (char *) malloc (len);
+-	  if (new_binding->dirname == NULL)
+-	    return NULL;
+-	  memcpy (new_binding->dirname, dirname, len);
++	      size_t len = strlen (codeset) + 1;
++	      result = (char *) malloc (len);
++	      if (__builtin_expect (result == NULL, 0))
++		goto failed_codeset;
++	      memcpy (result, codeset, len);
+ #endif
++	      codeset = result;
++	      new_binding->codeset_cntr++;
++	    }
++	  *codesetp = codeset;
++	  new_binding->codeset = (char *) codeset;
+ 	}
++      else
++	new_binding->codeset = NULL;
+ 
+       /* Now enqueue it.  */
+       if (_nl_domain_bindings == NULL
+@@ -187,13 +313,51 @@
+ 	  binding->next = new_binding;
+ 	}
+ 
+-      binding = new_binding;
++      modified = 1;
++
++      /* Here we deal with memory allocation failures.  */
++      if (0)
++	{
++	failed_codeset:
++	  if (new_binding->dirname != INTUSE(_nl_default_dirname))
++	    free (new_binding->dirname);
++	failed_dirname:
++	  free (new_binding);
++	failed:
++	  if (dirnamep)
++	    *dirnamep = NULL;
++	  if (codesetp)
++	    *codesetp = NULL;
++	}
+     }
+ 
+-  return binding->dirname;
++  /* If we modified any binding, we flush the caches.  */
++  if (modified)
++    ++_nl_msg_cat_cntr;
++
++  __libc_rwlock_unlock (_nl_state_lock);
++}
++
++/* Specify that the DOMAINNAME message catalog will be found
++   in DIRNAME rather than in the system locale data base.  */
++char *
++BINDTEXTDOMAIN (const char *domainname, const char *dirname)
++{
++  set_binding_values (domainname, &dirname, NULL);
++  return (char *) dirname;
++}
++
++/* Specify the character encoding in which the messages from the
++   DOMAINNAME message catalog will be returned.  */
++char *
++BIND_TEXTDOMAIN_CODESET (const char *domainname, const char *codeset)
++{
++  set_binding_values (domainname, NULL, &codeset);
++  return (char *) codeset;
+ }
+ 
+ #ifdef _LIBC
+-/* Alias for function name in GNU C Library.  */
++/* Aliases for function names in GNU C Library.  */
+ weak_alias (__bindtextdomain, bindtextdomain);
++weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset);
+ #endif
+--- lrzsz-0.12.20.safe/intl/cat-compat.c	1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/cat-compat.c	1969-12-31 19:00:00.000000000 -0500
+@@ -1,262 +0,0 @@
+-/* Compatibility code for gettext-using-catgets interface.
+-   Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+-
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
+-   any later version.
+-
+-   This program is distributed in the hope that it will be useful,
+-   but WITHOUT ANY WARRANTY; without even the implied warranty of
+-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-   GNU General Public License for more details.
+-
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+-
+-#ifdef HAVE_CONFIG_H
+-# include <config.h>
+-#endif
+-
+-#include <stdio.h>
+-
+-#ifdef STDC_HEADERS
+-# include <stdlib.h>
+-# include <string.h>
+-#else
+-char *getenv ();
+-# ifdef HAVE_MALLOC_H
+-#  include <malloc.h>
+-# endif
+-#endif
+-
+-#ifdef HAVE_NL_TYPES_H
+-# include <nl_types.h>
+-#endif
+-
+-#include "libgettext.h"
+-
+-/* @@ end of prolog @@ */
+-
+-/* XPG3 defines the result of `setlocale (category, NULL)' as:
+-   ``Directs `setlocale()' to query `category' and return the current
+-     setting of `local'.''
+-   However it does not specify the exact format.  And even worse: POSIX
+-   defines this not at all.  So we can use this feature only on selected
+-   system (e.g. those using GNU C Library).  */
+-#ifdef _LIBC
+-# define HAVE_LOCALE_NULL
+-#endif
+-
+-/* The catalog descriptor.  */
+-static nl_catd catalog = (nl_catd) -1;
+-
+-/* Name of the default catalog.  */
+-static const char default_catalog_name[] = "messages";
+-
+-/* Name of currently used catalog.  */
+-static const char *catalog_name = default_catalog_name;
+-
+-/* Get ID for given string.  If not found return -1.  */
+-static int msg_to_cat_id PARAMS ((const char *msg));
+-
+-/* Substitution for systems lacking this function in their C library.  */
+-#if !_LIBC && !HAVE_STPCPY
+-static char *stpcpy PARAMS ((char *dest, const char *src));
+-#endif
+-
+-
+-/* Set currently used domain/catalog.  */
+-char *
+-textdomain (domainname)
+-     const char *domainname;
+-{
+-  nl_catd new_catalog;
+-  char *new_name;
+-  size_t new_name_len;
+-  char *lang;
+-
+-#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \
+-    && defined HAVE_LOCALE_NULL
+-  lang = setlocale (LC_MESSAGES, NULL);
+-#else
+-  lang = getenv ("LC_ALL");
+-  if (lang == NULL || lang[0] == '\0')
+-    {
+-      lang = getenv ("LC_MESSAGES");
+-      if (lang == NULL || lang[0] == '\0')
+-	lang = getenv ("LANG");
+-    }
+-#endif
+-  if (lang == NULL || lang[0] == '\0')
+-    lang = "C";
+-
+-  /* See whether name of currently used domain is asked.  */
+-  if (domainname == NULL)
+-    return (char *) catalog_name;
+-
+-  if (domainname[0] == '\0')
+-    domainname = default_catalog_name;
+-
+-  /* Compute length of added path element.  */
+-  new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang)
+-		 + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1
+-		 + sizeof (".cat");
+-
+-  new_name = (char *) malloc (new_name_len);
+-  if (new_name == NULL)
+-    return NULL;
+-
+-  strcpy (new_name, PACKAGE);
+-  new_catalog = catopen (new_name, 0);
+-
+-  if (new_catalog == (nl_catd) -1)
+-    {
+-      /* NLSPATH search didn't work, try absolute path */
+-      sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang,
+-	       PACKAGE);
+-      new_catalog = catopen (new_name, 0);
+-
+-      if (new_catalog == (nl_catd) -1)
+-	{
+-	  free (new_name);
+-	  return (char *) catalog_name;
+-	}
+-    }
+-
+-  /* Close old catalog.  */
+-  if (catalog != (nl_catd) -1)
+-    catclose (catalog);
+-  if (catalog_name != default_catalog_name)
+-    free ((char *) catalog_name);
+-
+-  catalog = new_catalog;
+-  catalog_name = new_name;
+-
+-  return (char *) catalog_name;
+-}
+-
+-char *
+-bindtextdomain (domainname, dirname)
+-     const char *domainname;
+-     const char *dirname;
+-{
+-#if HAVE_SETENV || HAVE_PUTENV
+-  char *old_val, *new_val, *cp;
+-  size_t new_val_len;
+-
+-  /* This does not make much sense here but to be compatible do it.  */
+-  if (domainname == NULL)
+-    return NULL;
+-
+-  /* Compute length of added path element.  If we use setenv we don't need
+-     the first byts for NLSPATH=, but why complicate the code for this
+-     peanuts.  */
+-  new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname)
+-		+ sizeof ("/%L/LC_MESSAGES/%N.cat");
+-
+-  old_val = getenv ("NLSPATH");
+-  if (old_val == NULL || old_val[0] == '\0')
+-    {
+-      old_val = NULL;
+-      new_val_len += 1 + sizeof (LOCALEDIR) - 1
+-	             + sizeof ("/%L/LC_MESSAGES/%N.cat");
+-    }
+-  else
+-    new_val_len += strlen (old_val);
+-
+-  new_val = (char *) malloc (new_val_len);
+-  if (new_val == NULL)
+-    return NULL;
+-
+-# if HAVE_SETENV
+-  cp = new_val;
+-# else
+-  cp = stpcpy (new_val, "NLSPATH=");
+-# endif
+-
+-  cp = stpcpy (cp, dirname);
+-  cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:");
+-
+-  if (old_val == NULL)
+-    {
+-# if __STDC__
+-      stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat");
+-# else
+-
+-      cp = stpcpy (cp, LOCALEDIR);
+-      stpcpy (cp, "/%L/LC_MESSAGES/%N.cat");
+-# endif
+-    }
+-  else
+-    stpcpy (cp, old_val);
+-
+-# if HAVE_SETENV
+-  setenv ("NLSPATH", new_val, 1);
+-  free (new_val);
+-# else
+-  putenv (new_val);
+-  /* Do *not* free the environment entry we just entered.  It is used
+-     from now on.   */
+-# endif
+-
+-#endif
+-
+-  return (char *) domainname;
+-}
+-
+-#undef gettext
+-char *
+-gettext (msg)
+-     const char *msg;
+-{
+-  int msgid;
+-
+-  if (msg == NULL || catalog == (nl_catd) -1)
+-    return (char *) msg;
+-
+-  /* Get the message from the catalog.  We always use set number 1.
+-     The message ID is computed by the function `msg_to_cat_id'
+-     which works on the table generated by `po-to-tbl'.  */
+-  msgid = msg_to_cat_id (msg);
+-  if (msgid == -1)
+-    return (char *) msg;
+-
+-  return catgets (catalog, 1, msgid, (char *) msg);
+-}
+-
+-/* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries
+-   for the one equal to msg.  If it is found return the ID.  In case when
+-   the string is not found return -1.  */
+-static int
+-msg_to_cat_id (msg)
+-     const char *msg;
+-{
+-  int cnt;
+-
+-  for (cnt = 0; cnt < _msg_tbl_length; ++cnt)
+-    if (strcmp (msg, _msg_tbl[cnt]._msg) == 0)
+-      return _msg_tbl[cnt]._msg_number;
+-
+-  return -1;
+-}
+-
+-
+-/* @@ begin of epilog @@ */
+-
+-/* We don't want libintl.a to depend on any other library.  So we
+-   avoid the non-standard function stpcpy.  In GNU C Library this
+-   function is available, though.  Also allow the symbol HAVE_STPCPY
+-   to be defined.  */
+-#if !_LIBC && !HAVE_STPCPY
+-static char *
+-stpcpy (dest, src)
+-     char *dest;
+-     const char *src;
+-{
+-  while ((*dest++ = *src++) != '\0')
+-    /* Do nothing. */ ;
+-  return dest - 1;
+-}
+-#endif
+--- lrzsz-0.12.20.safe/intl/ChangeLog	1998-04-26 09:22:35.000000000 -0400
++++ lrzsz-0.12.20/intl/ChangeLog	2004-09-12 14:40:34.349749000 -0400
+@@ -1,1022 +1,4 @@
+-1997-09-06 02:10  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* intlh.inst.in: Reformat copyright.
+-
+-1997-08-19 15:22  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* dcgettext.c (DCGETTEXT): Remove wrong comment.
+-
+-1997-08-16 00:13  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* Makefile.in (install-data): Don't change directory to install.
+-
+-1997-08-01 14:30  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* cat-compat.c: Fix copyright.
+-
+-	* localealias.c: Don't define strchr unless !HAVE_STRCHR.
+-
+-	* loadmsgcat.c: Update copyright.  Fix typos.
+-
+-	* l10nflist.c: Don't define strchr unless !HAVE_STRCHR.
+-	(_nl_make_l10nflist): Handle sponsor and revision correctly.
+-
+-	* gettext.c: Update copyright.
+-	* gettext.h: Likewise.
+-	* hash-string.h: Likewise.
+-
+-	* finddomain.c: Remoave dead code.  Define strchr only if
+-	!HAVE_STRCHR.
+-
+-	* explodename.c: Include <sys/types.h>.
+-
+-	* explodename.c: Reformat copyright text.
+-	(_nl_explode_name): Fix typo.
+-
+-	* dcgettext.c: Define and use __set_errno.
+-	(guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is
+-	not defined.
+-
+-	* bindtextdom.c: Pretty printing.
+-
+-1997-05-01 02:25  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* dcgettext.c (guess_category_value): Don't depend on
+-	HAVE_LC_MESSAGES.  We don't need the macro here.
+-	Patch by Bruno Haible <haible@ilog.fr>.
+-
+-	* cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL
+-	macro.  Instead use HAVE_LOCALE_NULL and define it when using
+-	glibc, as in dcgettext.c.
+-	Patch by Bruno Haible <haible@ilog.fr>.
+-
+-	* Makefile.in (CPPFLAGS): New variable.  Reported by Franc,ois
+-	Pinard.
+-
+-Mon Mar 10 06:51:17 1997  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* Makefile.in: Implement handling of libtool.
+-
+-	* gettextP.h: Change data structures for use of generic lowlevel
+-	i18n file handling.
+-
+-Wed Dec  4 20:21:18 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* textdomain.c: Put parentheses around arguments of memcpy macro
+-	definition.
+-	* localealias.c: Likewise.
+-	* l10nflist.c: Likewise.
+-	* finddomain.c: Likewise.
+-	* bindtextdom.c: Likewise.
+-	Reported by Thomas Esken.
+-
+-Mon Nov 25 22:57:51 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* textdomain.c: Move definition of `memcpy` macro to right
+-	position.
+-
+-Fri Nov 22 04:01:58 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* finddomain.c [!HAVE_STRING_H && !_LIBC]: Define memcpy using
+- 	bcopy if not already defined.  Reported by Thomas Esken.
+-	* bindtextdom.c: Likewise.
+-	* l10nflist.c: Likewise.
+-	* localealias.c: Likewise.
+-	* textdomain.c: Likewise.
+-
+-Tue Oct 29 11:10:27 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* Makefile.in (libdir): Change to use exec_prefix instead of
+- 	prefix.  Reported by Knut-HåvardAksnes <etokna@eto.ericsson.se>.
+-
+-Sat Aug 31 03:07:09 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* l10nflist.c (_nl_normalize_codeset): We convert to lower case,
+-	so don't prepend uppercase `ISO' for only numeric arg.
+-
+-Fri Jul 19 00:15:46 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* l10nflist.c: Move inclusion of argz.h, ctype.h, stdlib.h after
+-	definition of _GNU_SOURCE.  Patch by Roland McGrath.
+-
+-	* Makefile.in (uninstall): Fix another bug with `for' loop and
+-	empty arguments.  Patch by Jim Meyering.  Correct name os
+-	uninstalled files: no intl- prefix anymore.
+-
+-	* Makefile.in (install-data): Again work around shells which
+-	cannot handle mpty for list.  Reported by Jim Meyering.
+-
+-Sat Jul 13 18:11:35 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* Makefile.in (install): Split goal.  Now depend on install-exec
+-        and install-data.
+-	(install-exec, install-data): New goals.  Created from former
+-	install goal.
+-	Reported by Karl Berry.
+-
+-Sat Jun 22 04:58:14 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* Makefile.in (MKINSTALLDIRS): New variable.  Path to
+-        mkinstalldirs script.
+-	(install): use MKINSTALLDIRS variable or if the script is not present
+-	try to find it in the $top_scrdir).
+-
+-Wed Jun 19 02:56:56 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* l10nflist.c: Linux libc *partly* includes the argz_* functions.
+-	Grr.  Work around by renaming the static version and use macros
+-	for renaming.
+-
+-Tue Jun 18 20:11:17 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* l10nflist.c: Correct presence test macros of __argz_* functions.
+-
+-	* l10nflist.c: Include <argz.h> based on test of it instead when
+-	__argz_* functions are available.
+-	Reported by Andreas Schwab.
+-
+-Thu Jun 13 15:17:44 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* explodename.c, l10nflist.c: Define NULL for dumb systems.
+-
+-Tue Jun 11 17:05:13 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* intlh.inst.in, libgettext.h (dcgettext): Rename local variable
+-	result to __result to prevent name clash.
+-
+-	* l10nflist.c, localealias.c, dcgettext.c: Define _GNU_SOURCE to
+-        get prototype for stpcpy and strcasecmp.
+-
+-	* intlh.inst.in, libgettext.h: Move declaration of
+-	`_nl_msg_cat_cntr' outside __extension__ block to prevent warning
+-	from gcc's -Wnested-extern option.
+-
+-Fri Jun  7 01:58:00 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* Makefile.in (install): Remove comment.
+-
+-Thu Jun  6 17:28:17 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* Makefile.in (install): Work around for another Buglix stupidity.
+-	Always use an `else' close for `if's.  Reported by Nelson Beebe.
+-
+-	* Makefile.in (intlh.inst): Correct typo in phony rule.
+-	Reported by Nelson Beebe.
+-
+-Thu Jun  6 01:49:52 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* dcgettext.c (read_alias_file): Rename variable alloca_list to
+-	block_list as the macro calls assume.
+-	Patch by Eric Backus.
+-
+-	* localealias.c [!HAVE_ALLOCA]: Define alloca as macro using
+-        malloc.
+-	(read_alias_file): Rename varriabe alloca_list to block_list as the
+-	macro calls assume.
+-	Patch by Eric Backus.
+-
+-	* l10nflist.c: Correct conditional for <argz.h> inclusion.
+-	Reported by Roland McGrath.
+-
+-	* Makefile.in (all): Depend on all-@USE_INCLUDED_LIBINTL@, not
+-        all-@USE_NLS@.
+-
+-	* Makefile.in (install): intlh.inst comes from local dir, not
+-        $(srcdir).
+-
+-	* Makefile.in (intlh.inst): Special handling of this goal.  If
+-	used in gettext, this is really a rul to construct this file.  If
+-	used in any other package it is defined as a .PHONY rule with
+-	empty body.
+-
+-	* finddomain.c: Extract locale file information handling into
+-	l10nfile.c.  Rename local stpcpy__ function to stpcpy.
+-
+-	* dcgettext.c (stpcpy): Add local definition.
+-
+-	* l10nflist.c: Solve some portability problems.  Patches partly by
+-	Thomas Esken.  Add local definition of stpcpy.
+-
+-Tue Jun  4 02:47:49 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* intlh.inst.in: Don't depend including <locale.h> on
+-	HAVE_LOCALE_H.  Instead configure must rewrite this fiile
+-	depending on the result of the configure run.
+-
+-	* Makefile.in (install): libintl.inst is now called intlh.inst.
+-	Add rules for updating intlh.inst from intlh.inst.in.
+-
+-	* libintl.inst: Renamed to intlh.inst.in.
+-
+-	* localealias.c, dcgettext.c [__GNUC__]: Define HAVE_ALLOCA to 1
+-        because gcc has __buitlin_alloca.
+-	Reported by Roland McGrath.
+-
+-Mon Jun  3 00:32:16 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* Makefile.in (installcheck): New goal to fulfill needs of
+-        automake's distcheck.
+-
+-	* Makefile.in (install): Reorder commands so that VERSION is
+-        found.
+-
+-	* Makefile.in (gettextsrcdir): Now use subdirectory intl/ in
+-        @datadir@/gettext.
+-	(COMSRCS): Add l10nfile.c.
+-	(OBJECTS): Add l10nfile.o.
+-	(DISTFILES): Rename to DISTFILE.normal.  Remove $(DISTFILES.common).
+-	(DISTFILE.gettext): Remove $(DISTFILES.common).
+-	(all-gettext): Remove goal.
+-	(install): If $(PACKAGE) = gettext install, otherwose do nothing.  No
+-	package but gettext itself should install libintl.h + headers.
+-	(dist): Extend goal to work for gettext, too.
+-	(dist-gettext): Remove goal.
+-
+-	* dcgettext.c [!HAVE_ALLOCA]: Define macro alloca by using malloc.
+-
+-Sun Jun  2 17:33:06 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* loadmsgcat.c (_nl_load_domain): Parameter is now comes from
+-        find_l10nfile.
+-
+-Sat Jun  1 02:23:03 1996  Ulrich Drepper  <drepper@cygnus.com>
+-
+-	* l10nflist.c (__argz_next): Add definition.
+-
+-	* dcgettext.c [!HAVE_ALLOCA]: Add code for handling missing alloca
+-	code.  Use new l10nfile handling.
+-
+-	* localealias.c [!HAVE_ALLOCA]: Add code for handling missing
+-        alloca code.
+-
+-	* l10nflist.c: Initial revision.
+-
+-Tue Apr  2 18:51:18 1996  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (all-gettext): New goal.  Same as all-yes.
+-
+-Thu Mar 28 23:01:22 1996  Karl Eichwalder  <ke@ke.central.de>
+-
+-	* Makefile.in (gettextsrcdir): Define using @datadir@.
+-
+-Tue Mar 26 12:39:14 1996  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c: Include <ctype.h>.  Reported by Roland McGrath.
+-
+-Sat Mar 23 02:00:35 1996  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c (stpcpy): Rename to stpcpy__ to prevent clashing
+-        with external declaration.
+-
+-Sat Mar  2 00:47:09 1996  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (all-no): Rename from all_no.
+-
+-Sat Feb 17 00:25:59 1996  Ulrich Drepper  <drepper@myware>
+-
+-	* gettextP.h [loaded_domain]: Array `successor' must now contain up
+-        to 63 elements (because of codeset name normalization).
+-
+-	* finddomain.c: Implement codeset name normalization.
+-
+-Thu Feb 15 04:39:09 1996  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (all): Define to `all-@USE_NLS@'.
+-	(all-yes, all_no): New goals.  `all-no' is noop, `all-yes'
+-	is former all.
+-
+-Mon Jan 15 21:46:01 1996  Howard Gayle  <howard@hal.com>
+-
+-	* localealias.c (alias_compare): Increment string pointers in loop
+-        of strcasecmp replacement.
+-
+-Fri Dec 29 21:16:34 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (install-src): Who commented this goal out ? :-)
+-
+-Fri Dec 29 15:08:16 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* dcgettext.c (DCGETTEXT): Save `errno'.  Failing system calls
+-	should not effect it because a missing catalog is no error.
+-	Reported by Harald K<o:>nig <koenig@tat.physik.uni-tuebingen.de>.
+-
+-Tue Dec 19 22:09:13 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (Makefile): Explicitly use $(SHELL) for running
+-        shell scripts.
+-
+-Fri Dec 15 17:34:59 1995  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>
+-
+-	* Makefile.in (install-src): Only install library and header when
+-	we use the own implementation.  Don't do it when using the
+-	system's gettext or catgets functions.
+-
+-	* dcgettext.c (find_msg): Must not swap domain->hash_size here.
+-
+-Sat Dec  9 16:24:37 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* localealias.c, libintl.inst, libgettext.h, hash-string.h,
+-	gettextP.h, finddomain.c, dcgettext.c, cat-compat.c:
+-	Use PARAMS instead of __P.  Suggested by Roland McGrath.
+-
+-Tue Dec  5 11:39:14 1995  Larry Schwimmer  <rosebud@cyclone.stanford.edu>
+-
+-	* libgettext.h: Use `#if !defined (_LIBINTL_H)' instead of `#if
+-	!_LIBINTL_H' because Solaris defines _LIBINTL_H as empty.
+-
+-Mon Dec  4 15:42:07 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (install-src):
+-	Install libintl.inst instead of libintl.h.install.
+-
+-Sat Dec  2 22:51:38 1995  Marcus Daniels  <marcus@sysc.pdx.edu>
+-
+-	* cat-compat.c (textdomain):
+-	Reverse order in which files are tried you load.  First
+-	try local file, when this failed absolute path.
+-
+-Wed Nov 29 02:03:53 1995  Nelson H. F. Beebe  <beebe@math.utah.edu>
+-
+-	* cat-compat.c (bindtextdomain): Add missing { }.
+-
+-Sun Nov 26 18:21:41 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* libintl.inst: Add missing __P definition.  Reported by Nelson Beebe.
+-
+-	* Makefile.in:
+-	Add dummy `all' and `dvi' goals.  Reported by Tom Tromey.
+-
+-Sat Nov 25 16:12:01 1995  Franc,ois Pinard  <pinard@iro.umontreal.ca>
+-
+-	* hash-string.h: Capitalize arguments of macros.
+-
+-Sat Nov 25 12:01:36 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (DISTFILES): Prevent files names longer than 13
+-	characters.  libintl.h.glibc->libintl.glibc,
+-	libintl.h.install->libintl.inst.  Reported by Joshua R. Poulson.
+-
+-Sat Nov 25 11:31:12 1995  Eric Backus  <ericb@lsid.hp.com>
+-
+-	* dcgettext.c: Fix bug in preprocessor conditionals.
+-
+-Sat Nov 25 02:35:27 1995  Nelson H. F. Beebe  <beebe@math.utah.edu>
+-
+-	* libgettext.h: Solaris cc does not understand
+-	 #if !SYMBOL1 && !SYMBOL2.  Sad	but true.
+-
+-Thu Nov 23 16:22:14 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* hash-string.h (hash_string):
+-	Fix for machine with >32 bit `unsigned long's.
+-
+-	* dcgettext.c (DCGETTEXT):
+-	Fix horrible bug in loop for alternative translation.
+-
+-Thu Nov 23 01:45:29 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* po2tbl.sed.in, linux-msg.sed, xopen-msg.sed:
+-	Some further simplifications in message number generation.
+-
+-Mon Nov 20 21:08:43 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* libintl.h.glibc: Use __const instead of const in prototypes.
+-
+-	* Makefile.in (install-src):
+-	Install libintl.h.install instead of libintl.h.  This
+-	is a stripped-down version.  Suggested by Peter Miller.
+-
+-	* libintl.h.install, libintl.h.glibc: Initial revision.
+-
+-	* localealias.c (_nl_expand_alias, read_alias_file):
+-	Protect prototypes in type casts by __P.
+-
+-Tue Nov 14 16:43:58 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* hash-string.h: Correct prototype for hash_string.
+-
+-Sun Nov 12 12:42:30 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* hash-string.h (hash_string): Add prototype.
+-
+-	* gettextP.h: Fix copyright.
+-	(SWAP): Add prototype.
+-
+-Wed Nov  8 22:56:33 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* localealias.c (read_alias_file): Forgot sizeof.
+-	Avoid calling *printf function.  This introduces a big overhead.
+-	Patch by Roland McGrath.
+-
+-Tue Nov  7 14:21:08 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy.
+-
+-	* finddomain.c (stpcpy):
+-	Define substitution function local.  The macro was to flaky.
+-
+-	* cat-compat.c: Fix typo.
+-
+-	* xopen-msg.sed, linux-msg.sed:
+-	While bringing message number to right place only accept digits.
+-
+-	* linux-msg.sed, xopen-msg.sed: Now that the counter does not have
+-	leading 0s we don't need to remove them.  Reported by Marcus
+-	Daniels.
+-
+-	* Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in
+-	dependency.  Reported by Marcus Daniels.
+-
+-	* cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement.
+-	Generally cleanup using #if instead of #ifndef.
+-
+-	* Makefile.in: Correct typos in comment.  By Franc,ois Pinard.
+-
+-Mon Nov  6 00:27:02 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (install-src): Don't install libintl.h and libintl.a
+-	if we use an available gettext implementation.
+-
+-Sun Nov  5 22:02:08 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS.  Reported
+-	by Franc,ois Pinard.
+-
+-	* libgettext.h: Use #if instead of #ifdef/#ifndef.
+-
+-	* finddomain.c:
+-	Comments describing what has to be done should start with FIXME.
+-
+-Sun Nov  5 19:38:01 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (DISTFILES): Split.  Use DISTFILES with normal meaning.
+-	DISTFILES.common names the files common to both dist goals.
+-	DISTFILES.gettext are the files only distributed in GNU gettext.
+-
+-Sun Nov  5 17:32:54 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* dcgettext.c (DCGETTEXT): Correct searching in derived locales.
+-	This was necessary since a change in _nl_find_msg several weeks
+-	ago.  I really don't know this is still not fixed.
+-
+-Sun Nov  5 12:43:12 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL.  This
+-	might mark a special condition.
+-
+-	* finddomain.c (make_entry_rec): Don't make illegal entry as decided.
+-
+-	* Makefile.in (dist): Suppress error message when ln failed.
+-	Get files from $(srcdir) explicitly.
+-
+-	* libgettext.h (gettext_const): Rename to gettext_noop.
+-
+-Fri Nov  3 07:36:50 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c (make_entry_rec):
+-	Protect against wrong locale names by testing mask.
+-
+-	* libgettext.h (gettext_const): Add macro definition.
+-	Capitalize macro arguments.
+-
+-Thu Nov  2 23:15:51 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c (_nl_find_domain):
+-	Test for pointer != NULL before accessing value.
+-	Reported by Tom Tromey.
+-
+-	* gettext.c (NULL):
+-	Define as (void*)0 instad of 0.  Reported by Franc,ois Pinard.
+-
+-Mon Oct 30 21:28:52 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* po2tbl.sed.in: Serious typo bug fixed by Jim Meyering.
+-
+-Sat Oct 28 23:20:47 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* libgettext.h: Disable dcgettext optimization for Solaris 2.3.
+-
+-	* localealias.c (alias_compare):
+-	Peter Miller reported that tolower in some systems is
+-	even dumber than I thought.  Protect call by `isupper'.
+-
+-Fri Oct 27 22:22:51 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (libdir, includedir): New variables.
+-	(install-src): Install libintl.a and libintl.h in correct dirs.
+-
+-Fri Oct 27 22:07:29 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c.
+-
+-	* po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques.
+-
+-	* localealias.c:
+-	Fix typo and superflous test.  Reported by Christian von Roques.
+-
+-Fri Oct  6 11:52:05 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c (_nl_find_domain):
+-	Correct some remainder from the pre-CEN syntax.  Now
+-	we don't have a constant number of successors anymore.
+-
+-Wed Sep 27 21:41:13 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (DISTFILES): Add libintl.h.glibc.
+-
+-	* Makefile.in (dist-libc): Add goal for packing sources for glibc.
+-	(COMSRCS, COMHDRS): Splitted to separate sources shared with glibc.
+-
+-	* loadmsgcat.c: Forget to continue #if line.
+-
+-	* localealias.c:
+-	[_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name
+-	space clean.
+-
+-	* dcgettext.c, finddomain.c: Better comment to last change.
+-
+-	* loadmsgcat.c:
+-	[_LIBC]: Rename fstat, open, close, read, mmap, and munmap to
+-	__fstat, __open, __close, __read, __mmap, and __munmap resp
+-	to keep ANSI C name space clean.
+-
+-	* finddomain.c:
+-	[_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean.
+-
+-	* dcgettext.c:
+-	[_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to
+-	keep ANSI C name space clean.
+-
+-	* libgettext.h:
+-	Include sys/types.h for those old SysV systems out there.
+-	Reported by Francesco Potorti`.
+-
+-	* loadmsgcat.c (use_mmap): Define if compiled for glibc.
+-
+-	* bindtextdom.c: Include all those standard headers
+-	unconditionally if _LIBC is defined.
+-
+-	* finddomain.c: Fix 2 times defiend -> defined.
+-
+-	* textdomain.c: Include libintl.h instead of libgettext.h when
+-	compiling for glibc.  Include all those standard headers
+-	unconditionally if _LIBC is defined.
+-
+-	* localealias.c, loadmsgcat.c: Prepare to be compiled in glibc.
+-
+-	* gettext.c:
+-	Include libintl.h instead of libgettext.h when compiling for glibc.
+-	Get NULL from stddef.h if we compile for glibc.
+-
+-	* finddomain.c: Include libintl.h instead of libgettext.h when
+-	compiling for glibc.  Include all those standard headers
+-	unconditionally if _LIBC is defined.
+-
+-	* dcgettext.c: Include all those standard headers unconditionally
+-	if _LIBC is defined.
+-
+-	* dgettext.c: If compiled in glibc include libintl.h instead of
+-	libgettext.h.
+-	(locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc.
+-
+-	* dcgettext.c: If compiled in glibc include libintl.h instead of
+-	libgettext.h.
+-	(getcwd): Don't rely on HAVE_GETCWD when compiling for glibc.
+-
+-	* bindtextdom.c:
+-	If compiled in glibc include libintl.h instead of libgettext.h.
+-
+-Mon Sep 25 22:23:06 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0.
+-	Reported by Marcus Daniels.
+-
+-	* cat-compat.c (bindtextdomain):
+-	String used in putenv must not be recycled.
+-	Reported by Marcus Daniels.
+-
+-	* libgettext.h (__USE_GNU_GETTEXT):
+-	Additional symbol to signal that we use GNU gettext
+-	library.
+-
+-	* cat-compat.c (bindtextdomain):
+-	Fix bug with the strange stpcpy replacement.
+-	Reported by Nelson Beebe.
+-
+-Sat Sep 23 08:23:51 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* cat-compat.c: Include <string.h> for stpcpy prototype.
+-
+-	* localealias.c (read_alias_file):
+-	While expand strdup code temporary variable `cp' hided
+-	higher level variable with same name.  Rename to `tp'.
+-
+-	* textdomain.c (textdomain):
+-	Avoid warning by using temporary variable in strdup code.
+-
+-	* finddomain.c (_nl_find_domain): Remove unused variable `application'.
+-
+-Thu Sep 21 15:51:44 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* localealias.c (alias_compare):
+-	Use strcasecmp() only if available.  Else use
+-	implementation in place.
+-
+-	* intl-compat.c:
+-	Wrapper functions now call *__ functions instead of __*.
+-
+-	* libgettext.h: Declare prototypes for *__ functions instead for __*.
+-
+-	* cat-compat.c, loadmsgcat.c:
+-	Don't use xmalloc, xstrdup, and stpcpy.  These functions are not part
+-	of the standard libc and so prevent libintl.a from being used
+-	standalone.
+-
+-	* bindtextdom.c:
+-	Don't use xmalloc, xstrdup, and stpcpy.  These functions are not part
+-	of the standard libc and so prevent libintl.a from being used
+-	standalone.
+-	Rename to bindtextdomain__ if not used in GNU C Library.
+-
+-	* dgettext.c:
+-	Rename function to dgettext__ if not used in GNU C Library.
+-
+-	* gettext.c:
+-	Don't use xmalloc, xstrdup, and stpcpy.  These functions are not part
+-	of the standard libc and so prevent libintl.a from being used
+-	standalone.
+-	Functions now called gettext__ if not used in GNU C Library.
+-
+-	* dcgettext.c, localealias.c, textdomain.c, finddomain.c:
+-	Don't use xmalloc, xstrdup, and stpcpy.  These functions are not part
+-	of the standard libc and so prevent libintl.a from being used
+-	standalone.
+-
+-Sun Sep 17 23:14:49 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c: Correct some bugs in handling of CEN standard
+- 	locale definitions.
+-
+-Thu Sep  7 01:49:28 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c: Implement CEN syntax.
+-
+-	* gettextP.h (loaded_domain): Extend number of successors to 31.
+-
+-Sat Aug 19 19:25:29 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (aliaspath): Remove path to X11 locale dir.
+-
+-	* Makefile.in: Make install-src depend on install.  This helps
+- 	gettext to install the sources and other packages can use the
+- 	install goal.
+-
+-Sat Aug 19 15:19:33 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (uninstall): Remove stuff installed by install-src.
+-
+-Tue Aug 15 13:13:53 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* VERSION.in: Initial revision.
+-
+-	* Makefile.in (DISTFILES):
+-	Add VERSION file.  This is not necessary for gettext, but
+-	for other packages using this library.
+-
+-Tue Aug 15 06:16:44 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* gettextP.h (_nl_find_domain):
+-	New prototype after changing search strategy.
+-
+-	* finddomain.c (_nl_find_domain):
+-	We now try only to find a specified catalog.  Fall back to other
+-	catalogs listed in the locale list is now done in __dcgettext.
+-
+-	* dcgettext.c (__dcgettext):
+-	Now we provide message fall back even to different languages.
+-	I.e. if a message is not available in one language all the other
+- 	in the locale list a tried.  Formerly fall back was only possible
+- 	within one language.  Implemented by moving one loop from
+- 	_nl_find_domain to here.
+-
+-Mon Aug 14 23:45:50 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (gettextsrcdir):
+-	Directory where source of GNU gettext library are made
+-	available.
+-	(INSTALL, INSTALL_DATA): Programs used for installing sources.
+-	(gettext-src): New.  Rule to install GNU gettext sources for use in
+-	gettextize shell script.
+-
+-Sun Aug 13 14:40:48 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* loadmsgcat.c (_nl_load_domain):
+-	Use mmap for loading only when munmap function is
+-	also available.
+-
+-	* Makefile.in (install): Depend on `all' goal.
+-
+-Wed Aug  9 11:04:33 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* localealias.c (read_alias_file):
+-	Do not overwrite '\n' when terminating alias value string.
+-
+-	* localealias.c (read_alias_file):
+-	Handle long lines.  Ignore the rest not fitting in
+-	the buffer after the initial `fgets' call.
+-
+-Wed Aug  9 00:54:29 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* gettextP.h (_nl_load_domain):
+-	Add prototype, replacing prototype for _nl_load_msg_cat.
+-
+-	* finddomain.c (_nl_find_domain):
+-	Remove unneeded variable filename and filename_len.
+-	(expand_alias): Remove prototype because functions does not
+- 	exist anymore.
+-
+-	* localealias.c (read_alias_file):
+-	Change type of fname_len parameter to int.
+-	(xmalloc): Add prototype.
+-
+-	* loadmsgcat.c: Better prototypes for xmalloc.
+-
+-Tue Aug  8 22:30:39 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c (_nl_find_domain):
+-	Allow alias name to be constructed from the four components.
+-
+-	* Makefile.in (aliaspath): New variable.  Set to preliminary value.
+-	(SOURCES): Add localealias.c.
+-	(OBJECTS): Add localealias.o.
+-
+-	* gettextP.h: Add prototype for _nl_expand_alias.
+-
+-	* finddomain.c: Aliasing handled in intl/localealias.c.
+-
+-	* localealias.c: Aliasing for locale names.
+-
+-	* bindtextdom.c: Better prototypes for xmalloc and xstrdup.
+-
+-Mon Aug  7 23:47:42 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (DISTFILES): gettext.perl is now found in misc/.
+-
+-	* cat-compat.c (bindtextdomain):
+-	Correct implementation.  dirname parameter was not used.
+-	Reported by Marcus Daniels.
+-
+-	* gettextP.h (loaded_domain):
+-	New fields `successor' and `decided' for oo, lazy
+-	message handling implementation.
+-
+-	* dcgettext.c:
+-	Adopt for oo, lazy message handliing.
+-  	Now we can inherit translations from less specific locales.
+-	(find_msg): New function.
+-
+-	* loadmsgcat.c, finddomain.c:
+-	Complete rewrite.  Implement oo, lazy message handling :-).
+-  	We now have an additional environment variable `LANGUAGE' with
+- 	a higher priority than LC_ALL for the LC_MESSAGE locale.
+-  	Here we can set a colon separated list of specifications each
+- 	of the form `language[_territory[.codeset]][@modifier]'.
+-
+-Sat Aug  5 09:55:42 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c (unistd.h):
+-	Include to get _PC_PATH_MAX defined on system having it.
+-
+-Fri Aug  4 22:42:00 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* finddomain.c (stpcpy): Include prototype.
+-
+-	* Makefile.in (dist): Remove `copying instead' message.
+-
+-Wed Aug  2 18:52:03 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (ID, TAGS): Do not use $^.
+-
+-Tue Aug  1 20:07:11 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (TAGS, ID): Use $^ as command argument.
+-	(TAGS): Give etags -o option t write to current directory,
+- 	not $(srcdir).
+-	(ID): Use $(srcdir) instead os $(top_srcdir)/src.
+-	(distclean): Remove ID.
+-
+-Sun Jul 30 11:51:46 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (gnulocaledir):
+-	New variable, always using share/ for data directory.
+-	(DEFS): Add GNULOCALEDIR, used in finddomain.c.
+-
+-	* finddomain.c (_nl_default_dirname):
+-	Set to GNULOCALEDIR, because it always has to point
+-	to the directory where GNU gettext Library writes it to.
+-
+-	* intl-compat.c (textdomain, bindtextdomain):
+-	Undefine macros before function definition.
+-
+-Sat Jul 22 01:10:02 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* libgettext.h (_LIBINTL_H):
+-	Protect definition in case where this file is included as
+-	libgettext.h on Solaris machines.  Add comment about this.
+-
+-Wed Jul 19 02:36:42 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* intl-compat.c (textdomain): Correct typo.
+-
+-Wed Jul 19 01:51:35 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* dcgettext.c (dcgettext): Function now called __dcgettext.
+-
+-	* dgettext.c (dgettext): Now called __dgettext and calls
+- 	__dcgettext.
+-
+-	* gettext.c (gettext):
+-	Function now called __gettext and calls __dgettext.
+-
+-	* textdomain.c (textdomain): Function now called __textdomain.
+-
+-	* bindtextdom.c (bindtextdomain): Function now called
+- 	__bindtextdomain.
+-
+-	* intl-compat.c: Initial revision.
+-
+-	* Makefile.in (SOURCES): Add intl-compat.c.
+-	(OBJECTS): We always compile the GNU gettext library functions.
+-  	OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o,
+- 	and intl-compat.o.
+-  	(GETTOBJS): Contains now only intl-compat.o.
+-
+-	* libgettext.h:
+-	Re-include protection matches dualistic character of libgettext.h.
+-	For all functions in GNU gettext library define __ counter part.
+-
+-	* finddomain.c (strchr): Define as index if not found in C library.
+-	(_nl_find_domain): For relative paths paste / in between.
+-
+-Tue Jul 18 16:37:45 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h.
+-
+-	* xopen-msg.sed: Fix bug with `msgstr ""' lines.
+-	A little bit better comments.
+-
+-Tue Jul 18 01:18:27 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in:
+-	po-mode.el, makelinks, combine-sh are now found in ../misc.
+-
+-	* po-mode.el, makelinks, combine-sh, elisp-comp:
+-	Moved to ../misc/.
+-
+-	* libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__.
+-
+-Sun Jul 16 22:33:02 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (INSTALL, INSTALL_DATA): New variables.
+-	(install-data, uninstall): Install/uninstall .elc file.
+-
+-	* po-mode.el (Installation comment):
+-	Add .pox as possible extension of .po files.
+-
+-Sun Jul 16 13:23:27 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* elisp-comp: Complete new version by Franc,ois: This does not
+- 	fail when not compiling in the source directory.
+-
+-Sun Jul 16 00:12:17 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (../po/cat-id-tbl.o):
+-	Use $(MAKE) instead of make for recursive make.
+-
+-	* Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh.
+-	(install-exec): Add missing dummy goal.
+-	(install-data, uninstall): @ in multi-line shell command at
+- 	beginning, not in front of echo.  Reported by Eric Backus.
+-
+-Sat Jul 15 00:21:28 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (DISTFILES):
+-	Rename libgettext.perl to gettext.perl to fit in 14 chars
+-	file systems.
+-
+-	* gettext.perl:
+- 	Rename to gettext.perl to fit in 14 chars file systems.
+-
+-Thu Jul 13 23:17:20 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* cat-compat.c: If !STDC_HEADERS try to include malloc.h.
+-
+-Thu Jul 13 20:55:02 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* po2tbl.sed.in: Pretty printing.
+-
+-	* linux-msg.sed, xopen-msg.sed:
+-	Correct bugs with handling substitute flags in branches.
+-
+-	* hash-string.h (hash_string):
+-	Old K&R compilers don't under stand `unsigned char'.
+-
+-	* gettext.h (nls_uint32):
+-	Some old K&R compilers (eg HP) don't understand `unsigned int'.
+-
+-	* cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes.
+-
+-Thu Jul 13 01:34:33 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (ELCFILES): New variable.
+-	(DISTFILES): Add elisp-comp.
+-	Add implicit rule for .el -> .elc compilation.
+-	(install-data): install $ELCFILES
+-	(clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp.
+-
+-	* elisp-comp: Initial revision
+-
+-Wed Jul 12 16:14:52 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in:
+-	cat-id-tbl.c is now found in po/.  This enables us to use an identical
+-	intl/ directory in all packages.
+-
+-	* dcgettext.c (dcgettext): hashing does not work for table size <= 2.
+-
+-	* textdomain.c: fix typo (#if def -> #if defined)
+-
+-Tue Jul 11 18:44:43 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in (stamp-cat-id): use top_srcdir to address source files
+-	(DISTFILES,distclean): move tupdate.perl to src/
+-
+-	* po-to-tbl.sed.in:
+-	add additional jump to clear change flag to recognize multiline strings
+-
+-Tue Jul 11 01:32:50 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* textdomain.c: Protect inclusion of stdlib.h and string.h.
+-
+-	* loadmsgcat.c: Protect inclusion of stdlib.h.
+-
+-	* libgettext.h: Protect inclusion of locale.h.
+-	Allow use in C++ programs.
+-	Define NULL is not happened already.
+-
+-	* Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of
+-	po-to-tbl.sed.
+-	(distclean): remove po-to-tbl.sed and tupdate.perl.
+-
+-	* tupdate.perl.in: Substitute Perl path even in exec line.
+-	Don't include entries without translation from old .po file.
+-
+-Tue Jul  4 00:41:51 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* tupdate.perl.in: use "Updated: " in msgid "".
+-
+-	* cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR).
+- 	Define getenv if !__STDC__.
+-
+-	* bindtextdom.c: Protect stdlib.h and string.h inclusion.
+- 	Define free if !__STDC__.
+-
+-	* finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
+- 	Define free if !__STDC__.
+-
+-	* cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
+-
+-Mon Jul  3 23:56:30 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR.
+-	Remove unneeded $(srcdir) from Makefile.in dependency.
+-
+-	* makelinks: Add copyright and short description.
+-
+-	* po-mode.el: Last version for 0.7.
+-
+-	* tupdate.perl.in: Fix die message.
+-
+-	* dcgettext.c: Protect include of string.h.
+-
+-	* gettext.c: Protect include of stdlib.h and further tries to get NULL.
+-
+-	* finddomain.c: Some corrections in includes.
+-
+-	* Makefile.in (INCLUDES): Prune list correct path to Makefile.in.
+-
+-	* po-to-tbl.sed: Adopt for new .po file format.
+-
+-	* linux-msg.sed, xopen-msg.sed: Adopt for new .po file format.
+-
+-Sun Jul  2 23:55:03 1995  Ulrich Drepper  <drepper@myware>
+-
+-	* tupdate.perl.in: Complete rewrite for new .po file format.
++2004-01-29  GNU  <bug-gnu-gettext@gnu.org>
+ 
+-Sun Jul  2 02:06:50 1995  Ulrich Drepper  <drepper@myware>
++	* Version 0.14.1 released.
+ 
+-	* First official release.  This directory contains all the code
+-	needed to internationalize own packages.  It provides functions
+-	which allow to use the X/Open catgets function with an interface
+-	like the Uniforum gettext function.  For system which does not
+-	have neither of those a complete implementation is provided.
+--- lrzsz-0.12.20.safe/intl/config.charset	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/config.charset	2004-09-12 14:40:34.354748240 -0400
+@@ -0,0 +1,608 @@
++#! /bin/sh
++# Output a system dependent table of character encoding aliases.
++#
++#   Copyright (C) 2000-2004 Free Software Foundation, Inc.
++#
++#   This program is free software; you can redistribute it and/or modify it
++#   under the terms of the GNU Library General Public License as published
++#   by the Free Software Foundation; either version 2, or (at your option)
++#   any later version.
++#
++#   This program is distributed in the hope that it will be useful,
++#   but WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++#   Library General Public License for more details.
++#
++#   You should have received a copy of the GNU Library General Public
++#   License along with this program; if not, write to the Free Software
++#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++#   USA.
++#
++# The table consists of lines of the form
++#    ALIAS  CANONICAL
++#
++# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
++# ALIAS is compared in a case sensitive way.
++#
++# CANONICAL is the GNU canonical name for this character encoding.
++# It must be an encoding supported by libiconv. Support by GNU libc is
++# also desirable. CANONICAL is case insensitive. Usually an upper case
++# MIME charset name is preferred.
++# The current list of GNU canonical charset names is as follows.
++#
++#       name              MIME?             used by which systems
++#   ASCII, ANSI_X3.4-1968       glibc solaris freebsd darwin
++#   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd darwin
++#   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd darwin
++#   ISO-8859-3              Y   glibc solaris
++#   ISO-8859-4              Y   osf solaris freebsd darwin
++#   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd darwin
++#   ISO-8859-6              Y   glibc aix hpux solaris
++#   ISO-8859-7              Y   glibc aix hpux irix osf solaris
++#   ISO-8859-8              Y   glibc aix hpux osf solaris
++#   ISO-8859-9              Y   glibc aix hpux irix osf solaris
++#   ISO-8859-13                 glibc
++#   ISO-8859-14                 glibc
++#   ISO-8859-15                 glibc aix osf solaris freebsd
++#   KOI8-R                  Y   glibc solaris freebsd darwin
++#   KOI8-U                  Y   glibc freebsd darwin
++#   KOI8-T                      glibc
++#   CP437                       dos
++#   CP775                       dos
++#   CP850                       aix osf dos
++#   CP852                       dos
++#   CP855                       dos
++#   CP856                       aix
++#   CP857                       dos
++#   CP861                       dos
++#   CP862                       dos
++#   CP864                       dos
++#   CP865                       dos
++#   CP866                       freebsd darwin dos
++#   CP869                       dos
++#   CP874                       woe32 dos
++#   CP922                       aix
++#   CP932                       aix woe32 dos
++#   CP943                       aix
++#   CP949                       osf woe32 dos
++#   CP950                       woe32 dos
++#   CP1046                      aix
++#   CP1124                      aix
++#   CP1125                      dos
++#   CP1129                      aix
++#   CP1250                      woe32
++#   CP1251                      glibc solaris darwin woe32
++#   CP1252                      aix woe32
++#   CP1253                      woe32
++#   CP1254                      woe32
++#   CP1255                      glibc woe32
++#   CP1256                      woe32
++#   CP1257                      woe32
++#   GB2312                  Y   glibc aix hpux irix solaris freebsd darwin
++#   EUC-JP                  Y   glibc aix hpux irix osf solaris freebsd darwin
++#   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd darwin
++#   EUC-TW                      glibc aix hpux irix osf solaris
++#   BIG5                    Y   glibc aix hpux osf solaris freebsd darwin
++#   BIG5-HKSCS                  glibc solaris
++#   GBK                         glibc aix osf solaris woe32 dos
++#   GB18030                     glibc solaris
++#   SHIFT_JIS               Y   hpux osf solaris freebsd darwin
++#   JOHAB                       glibc solaris woe32
++#   TIS-620                     glibc aix hpux osf solaris
++#   VISCII                  Y   glibc
++#   TCVN5712-1                  glibc
++#   GEORGIAN-PS                 glibc
++#   HP-ROMAN8                   hpux
++#   HP-ARABIC8                  hpux
++#   HP-GREEK8                   hpux
++#   HP-HEBREW8                  hpux
++#   HP-TURKISH8                 hpux
++#   HP-KANA8                    hpux
++#   DEC-KANJI                   osf
++#   DEC-HANYU                   osf
++#   UTF-8                   Y   glibc aix hpux osf solaris
++#
++# Note: Names which are not marked as being a MIME name should not be used in
++# Internet protocols for information interchange (mail, news, etc.).
++#
++# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
++# must understand both names and treat them as equivalent.
++#
++# The first argument passed to this file is the canonical host specification,
++#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
++# or
++#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
++
++host="$1"
++os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
++echo "# This file contains a table of character encoding aliases,"
++echo "# suitable for operating system '${os}'."
++echo "# It was automatically generated from config.charset."
++# List of references, updated during installation:
++echo "# Packages using this file: "
++case "$os" in
++    linux-gnulibc1*)
++	# Linux libc5 doesn't have nl_langinfo(CODESET); therefore
++	# localcharset.c falls back to using the full locale name
++	# from the environment variables.
++	echo "C ASCII"
++	echo "POSIX ASCII"
++	for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
++	         en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
++	         en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
++	         es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
++	         et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
++	         fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
++	         it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
++	         sv_FI sv_SE; do
++	  echo "$l ISO-8859-1"
++	  echo "$l.iso-8859-1 ISO-8859-1"
++	  echo "$l.iso-8859-15 ISO-8859-15"
++	  echo "$l.iso-8859-15@euro ISO-8859-15"
++	  echo "$l@euro ISO-8859-15"
++	  echo "$l.cp-437 CP437"
++	  echo "$l.cp-850 CP850"
++	  echo "$l.cp-1252 CP1252"
++	  echo "$l.cp-1252@euro CP1252"
++	  #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
++	  echo "$l.utf-8 UTF-8"
++	  echo "$l.utf-8@euro UTF-8"
++	done
++	for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
++	         sl_SI sr sr_CS sr_YU; do
++	  echo "$l ISO-8859-2"
++	  echo "$l.iso-8859-2 ISO-8859-2"
++	  echo "$l.cp-852 CP852"
++	  echo "$l.cp-1250 CP1250"
++	  echo "$l.utf-8 UTF-8"
++	done
++	for l in mk mk_MK ru ru_RU; do
++	  echo "$l ISO-8859-5"
++	  echo "$l.iso-8859-5 ISO-8859-5"
++	  echo "$l.koi8-r KOI8-R"
++	  echo "$l.cp-866 CP866"
++	  echo "$l.cp-1251 CP1251"
++	  echo "$l.utf-8 UTF-8"
++	done
++	for l in ar ar_SA; do
++	  echo "$l ISO-8859-6"
++	  echo "$l.iso-8859-6 ISO-8859-6"
++	  echo "$l.cp-864 CP864"
++	  #echo "$l.cp-868 CP868" # not a commonly used encoding
++	  echo "$l.cp-1256 CP1256"
++	  echo "$l.utf-8 UTF-8"
++	done
++	for l in el el_GR gr gr_GR; do
++	  echo "$l ISO-8859-7"
++	  echo "$l.iso-8859-7 ISO-8859-7"
++	  echo "$l.cp-869 CP869"
++	  echo "$l.cp-1253 CP1253"
++	  echo "$l.cp-1253@euro CP1253"
++	  echo "$l.utf-8 UTF-8"
++	  echo "$l.utf-8@euro UTF-8"
++	done
++	for l in he he_IL iw iw_IL; do
++	  echo "$l ISO-8859-8"
++	  echo "$l.iso-8859-8 ISO-8859-8"
++	  echo "$l.cp-862 CP862"
++	  echo "$l.cp-1255 CP1255"
++	  echo "$l.utf-8 UTF-8"
++	done
++	for l in tr tr_TR; do
++	  echo "$l ISO-8859-9"
++	  echo "$l.iso-8859-9 ISO-8859-9"
++	  echo "$l.cp-857 CP857"
++	  echo "$l.cp-1254 CP1254"
++	  echo "$l.utf-8 UTF-8"
++	done
++	for l in lt lt_LT lv lv_LV; do
++	  #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
++	  echo "$l ISO-8859-13"
++	done
++	for l in ru_UA uk uk_UA; do
++	  echo "$l KOI8-U"
++	done
++	for l in zh zh_CN; do
++	  #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
++	  echo "$l GB2312"
++	done
++	for l in ja ja_JP ja_JP.EUC; do
++	  echo "$l EUC-JP"
++	done
++	for l in ko ko_KR; do
++	  echo "$l EUC-KR"
++	done
++	for l in th th_TH; do
++	  echo "$l TIS-620"
++	done
++	for l in fa fa_IR; do
++	  #echo "$l ISIRI-3342" # a broken encoding
++	  echo "$l.utf-8 UTF-8"
++	done
++	;;
++    linux* | *-gnu*)
++	# With glibc-2.1 or newer, we don't need any canonicalization,
++	# because glibc has iconv and both glibc and libiconv support all
++	# GNU canonical names directly. Therefore, the Makefile does not
++	# need to install the alias file at all.
++	# The following applies only to glibc-2.0.x and older libcs.
++	echo "ISO_646.IRV:1983 ASCII"
++	;;
++    aix*)
++	echo "ISO8859-1 ISO-8859-1"
++	echo "ISO8859-2 ISO-8859-2"
++	echo "ISO8859-5 ISO-8859-5"
++	echo "ISO8859-6 ISO-8859-6"
++	echo "ISO8859-7 ISO-8859-7"
++	echo "ISO8859-8 ISO-8859-8"
++	echo "ISO8859-9 ISO-8859-9"
++	echo "ISO8859-15 ISO-8859-15"
++	echo "IBM-850 CP850"
++	echo "IBM-856 CP856"
++	echo "IBM-921 ISO-8859-13"
++	echo "IBM-922 CP922"
++	echo "IBM-932 CP932"
++	echo "IBM-943 CP943"
++	echo "IBM-1046 CP1046"
++	echo "IBM-1124 CP1124"
++	echo "IBM-1129 CP1129"
++	echo "IBM-1252 CP1252"
++	echo "IBM-eucCN GB2312"
++	echo "IBM-eucJP EUC-JP"
++	echo "IBM-eucKR EUC-KR"
++	echo "IBM-eucTW EUC-TW"
++	echo "big5 BIG5"
++	echo "GBK GBK"
++	echo "TIS-620 TIS-620"
++	echo "UTF-8 UTF-8"
++	;;
++    hpux*)
++	echo "iso88591 ISO-8859-1"
++	echo "iso88592 ISO-8859-2"
++	echo "iso88595 ISO-8859-5"
++	echo "iso88596 ISO-8859-6"
++	echo "iso88597 ISO-8859-7"
++	echo "iso88598 ISO-8859-8"
++	echo "iso88599 ISO-8859-9"
++	echo "iso885915 ISO-8859-15"
++	echo "roman8 HP-ROMAN8"
++	echo "arabic8 HP-ARABIC8"
++	echo "greek8 HP-GREEK8"
++	echo "hebrew8 HP-HEBREW8"
++	echo "turkish8 HP-TURKISH8"
++	echo "kana8 HP-KANA8"
++	echo "tis620 TIS-620"
++	echo "big5 BIG5"
++	echo "eucJP EUC-JP"
++	echo "eucKR EUC-KR"
++	echo "eucTW EUC-TW"
++	echo "hp15CN GB2312"
++	#echo "ccdc ?" # what is this?
++	echo "SJIS SHIFT_JIS"
++	echo "utf8 UTF-8"
++	;;
++    irix*)
++	echo "ISO8859-1 ISO-8859-1"
++	echo "ISO8859-2 ISO-8859-2"
++	echo "ISO8859-5 ISO-8859-5"
++	echo "ISO8859-7 ISO-8859-7"
++	echo "ISO8859-9 ISO-8859-9"
++	echo "eucCN GB2312"
++	echo "eucJP EUC-JP"
++	echo "eucKR EUC-KR"
++	echo "eucTW EUC-TW"
++	;;
++    osf*)
++	echo "ISO8859-1 ISO-8859-1"
++	echo "ISO8859-2 ISO-8859-2"
++	echo "ISO8859-4 ISO-8859-4"
++	echo "ISO8859-5 ISO-8859-5"
++	echo "ISO8859-7 ISO-8859-7"
++	echo "ISO8859-8 ISO-8859-8"
++	echo "ISO8859-9 ISO-8859-9"
++	echo "ISO8859-15 ISO-8859-15"
++	echo "cp850 CP850"
++	echo "big5 BIG5"
++	echo "dechanyu DEC-HANYU"
++	echo "dechanzi GB2312"
++	echo "deckanji DEC-KANJI"
++	echo "deckorean EUC-KR"
++	echo "eucJP EUC-JP"
++	echo "eucKR EUC-KR"
++	echo "eucTW EUC-TW"
++	echo "GBK GBK"
++	echo "KSC5601 CP949"
++	echo "sdeckanji EUC-JP"
++	echo "SJIS SHIFT_JIS"
++	echo "TACTIS TIS-620"
++	echo "UTF-8 UTF-8"
++	;;
++    solaris*)
++	echo "646 ASCII"
++	echo "ISO8859-1 ISO-8859-1"
++	echo "ISO8859-2 ISO-8859-2"
++	echo "ISO8859-3 ISO-8859-3"
++	echo "ISO8859-4 ISO-8859-4"
++	echo "ISO8859-5 ISO-8859-5"
++	echo "ISO8859-6 ISO-8859-6"
++	echo "ISO8859-7 ISO-8859-7"
++	echo "ISO8859-8 ISO-8859-8"
++	echo "ISO8859-9 ISO-8859-9"
++	echo "ISO8859-15 ISO-8859-15"
++	echo "koi8-r KOI8-R"
++	echo "ansi-1251 CP1251"
++	echo "BIG5 BIG5"
++	echo "Big5-HKSCS BIG5-HKSCS"
++	echo "gb2312 GB2312"
++	echo "GBK GBK"
++	echo "GB18030 GB18030"
++	echo "cns11643 EUC-TW"
++	echo "5601 EUC-KR"
++	echo "ko_KR.johap92 JOHAB"
++	echo "eucJP EUC-JP"
++	echo "PCK SHIFT_JIS"
++	echo "TIS620.2533 TIS-620"
++	#echo "sun_eu_greek ?" # what is this?
++	echo "UTF-8 UTF-8"
++	;;
++    freebsd* | os2*)
++	# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
++	# localcharset.c falls back to using the full locale name
++	# from the environment variables.
++	# Likewise for OS/2. OS/2 has XFree86 just like FreeBSD. Just
++	# reuse FreeBSD's locale data for OS/2.
++	echo "C ASCII"
++	echo "US-ASCII ASCII"
++	for l in la_LN lt_LN; do
++	  echo "$l.ASCII ASCII"
++	done
++	for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
++	         fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
++	         lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
++	  echo "$l.ISO_8859-1 ISO-8859-1"
++	  echo "$l.DIS_8859-15 ISO-8859-15"
++	done
++	for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
++	  echo "$l.ISO_8859-2 ISO-8859-2"
++	done
++	for l in la_LN lt_LT; do
++	  echo "$l.ISO_8859-4 ISO-8859-4"
++	done
++	for l in ru_RU ru_SU; do
++	  echo "$l.KOI8-R KOI8-R"
++	  echo "$l.ISO_8859-5 ISO-8859-5"
++	  echo "$l.CP866 CP866"
++	done
++	echo "uk_UA.KOI8-U KOI8-U"
++	echo "zh_TW.BIG5 BIG5"
++	echo "zh_TW.Big5 BIG5"
++	echo "zh_CN.EUC GB2312"
++	echo "ja_JP.EUC EUC-JP"
++	echo "ja_JP.SJIS SHIFT_JIS"
++	echo "ja_JP.Shift_JIS SHIFT_JIS"
++	echo "ko_KR.EUC EUC-KR"
++	;;
++    netbsd*)
++	echo "646 ASCII"
++	echo "ISO8859-1 ISO-8859-1"
++	echo "ISO8859-2 ISO-8859-2"
++	echo "ISO8859-4 ISO-8859-4"
++	echo "ISO8859-5 ISO-8859-5"
++	echo "ISO8859-15 ISO-8859-15"
++	echo "eucCN GB2312"
++	echo "eucJP EUC-JP"
++	echo "eucKR EUC-KR"
++	echo "eucTW EUC-TW"
++	echo "BIG5 BIG5"
++	echo "SJIS SHIFT_JIS"
++	;;
++    darwin*)
++	# Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
++	# localcharset.c falls back to using the full locale name
++	# from the environment variables.
++	echo "C ASCII"
++	for l in en_AU en_CA en_GB en_US la_LN; do
++	  echo "$l.US-ASCII ASCII"
++	done
++	for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
++	         fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
++	         nl_NL no_NO pt_PT sv_SE; do
++	  echo "$l ISO-8859-1"
++	  echo "$l.ISO8859-1 ISO-8859-1"
++	  echo "$l.ISO8859-15 ISO-8859-15"
++	done
++	for l in la_LN; do
++	  echo "$l.ISO8859-1 ISO-8859-1"
++	  echo "$l.ISO8859-15 ISO-8859-15"
++	done
++	for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
++	  echo "$l.ISO8859-2 ISO-8859-2"
++	done
++	for l in la_LN lt_LT; do
++	  echo "$l.ISO8859-4 ISO-8859-4"
++	done
++	for l in ru_RU; do
++	  echo "$l.KOI8-R KOI8-R"
++	  echo "$l.ISO8859-5 ISO-8859-5"
++	  echo "$l.CP866 CP866"
++	done
++	for l in bg_BG; do
++	  echo "$l.CP1251 CP1251"
++	done
++	echo "uk_UA.KOI8-U KOI8-U"
++	echo "zh_TW.BIG5 BIG5"
++	echo "zh_TW.Big5 BIG5"
++	echo "zh_CN.EUC GB2312"
++	echo "ja_JP.EUC EUC-JP"
++	echo "ja_JP.SJIS SHIFT_JIS"
++	echo "ko_KR.EUC EUC-KR"
++	;;
++    beos*)
++	# BeOS has a single locale, and it has UTF-8 encoding.
++	echo "* UTF-8"
++	;;
++    msdosdjgpp*)
++	# DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
++	# localcharset.c falls back to using the full locale name
++	# from the environment variables.
++	echo "#"
++	echo "# The encodings given here may not all be correct."
++	echo "# If you find that the encoding given for your language and"
++	echo "# country is not the one your DOS machine actually uses, just"
++	echo "# correct it in this file, and send a mail to"
++	echo "# Juan Manuel Guerrero <st001906@hrz1.hrz.tu-darmstadt.de>"
++	echo "# and Bruno Haible <bruno@clisp.org>."
++	echo "#"
++	echo "C ASCII"
++	# ISO-8859-1 languages
++	echo "ca CP850"
++	echo "ca_ES CP850"
++	echo "da CP865"    # not CP850 ??
++	echo "da_DK CP865" # not CP850 ??
++	echo "de CP850"
++	echo "de_AT CP850"
++	echo "de_CH CP850"
++	echo "de_DE CP850"
++	echo "en CP850"
++	echo "en_AU CP850" # not CP437 ??
++	echo "en_CA CP850"
++	echo "en_GB CP850"
++	echo "en_NZ CP437"
++	echo "en_US CP437"
++	echo "en_ZA CP850" # not CP437 ??
++	echo "es CP850"
++	echo "es_AR CP850"
++	echo "es_BO CP850"
++	echo "es_CL CP850"
++	echo "es_CO CP850"
++	echo "es_CR CP850"
++	echo "es_CU CP850"
++	echo "es_DO CP850"
++	echo "es_EC CP850"
++	echo "es_ES CP850"
++	echo "es_GT CP850"
++	echo "es_HN CP850"
++	echo "es_MX CP850"
++	echo "es_NI CP850"
++	echo "es_PA CP850"
++	echo "es_PY CP850"
++	echo "es_PE CP850"
++	echo "es_SV CP850"
++	echo "es_UY CP850"
++	echo "es_VE CP850"
++	echo "et CP850"
++	echo "et_EE CP850"
++	echo "eu CP850"
++	echo "eu_ES CP850"
++	echo "fi CP850"
++	echo "fi_FI CP850"
++	echo "fr CP850"
++	echo "fr_BE CP850"
++	echo "fr_CA CP850"
++	echo "fr_CH CP850"
++	echo "fr_FR CP850"
++	echo "ga CP850"
++	echo "ga_IE CP850"
++	echo "gd CP850"
++	echo "gd_GB CP850"
++	echo "gl CP850"
++	echo "gl_ES CP850"
++	echo "id CP850"    # not CP437 ??
++	echo "id_ID CP850" # not CP437 ??
++	echo "is CP861"    # not CP850 ??
++	echo "is_IS CP861" # not CP850 ??
++	echo "it CP850"
++	echo "it_CH CP850"
++	echo "it_IT CP850"
++	echo "lt CP775"
++	echo "lt_LT CP775"
++	echo "lv CP775"
++	echo "lv_LV CP775"
++	echo "nb CP865"    # not CP850 ??
++	echo "nb_NO CP865" # not CP850 ??
++	echo "nl CP850"
++	echo "nl_BE CP850"
++	echo "nl_NL CP850"
++	echo "nn CP865"    # not CP850 ??
++	echo "nn_NO CP865" # not CP850 ??
++	echo "no CP865"    # not CP850 ??
++	echo "no_NO CP865" # not CP850 ??
++	echo "pt CP850"
++	echo "pt_BR CP850"
++	echo "pt_PT CP850"
++	echo "sv CP850"
++	echo "sv_SE CP850"
++	# ISO-8859-2 languages
++	echo "cs CP852"
++	echo "cs_CZ CP852"
++	echo "hr CP852"
++	echo "hr_HR CP852"
++	echo "hu CP852"
++	echo "hu_HU CP852"
++	echo "pl CP852"
++	echo "pl_PL CP852"
++	echo "ro CP852"
++	echo "ro_RO CP852"
++	echo "sk CP852"
++	echo "sk_SK CP852"
++	echo "sl CP852"
++	echo "sl_SI CP852"
++	echo "sq CP852"
++	echo "sq_AL CP852"
++	echo "sr CP852"    # CP852 or CP866 or CP855 ??
++	echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
++	echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
++	# ISO-8859-3 languages
++	echo "mt CP850"
++	echo "mt_MT CP850"
++	# ISO-8859-5 languages
++	echo "be CP866"
++	echo "be_BE CP866"
++	echo "bg CP866"    # not CP855 ??
++	echo "bg_BG CP866" # not CP855 ??
++	echo "mk CP866"    # not CP855 ??
++	echo "mk_MK CP866" # not CP855 ??
++	echo "ru CP866"
++	echo "ru_RU CP866"
++	echo "uk CP1125"
++	echo "uk_UA CP1125"
++	# ISO-8859-6 languages
++	echo "ar CP864"
++	echo "ar_AE CP864"
++	echo "ar_DZ CP864"
++	echo "ar_EG CP864"
++	echo "ar_IQ CP864"
++	echo "ar_IR CP864"
++	echo "ar_JO CP864"
++	echo "ar_KW CP864"
++	echo "ar_MA CP864"
++	echo "ar_OM CP864"
++	echo "ar_QA CP864"
++	echo "ar_SA CP864"
++	echo "ar_SY CP864"
++	# ISO-8859-7 languages
++	echo "el CP869"
++	echo "el_GR CP869"
++	# ISO-8859-8 languages
++	echo "he CP862"
++	echo "he_IL CP862"
++	# ISO-8859-9 languages
++	echo "tr CP857"
++	echo "tr_TR CP857"
++	# Japanese
++	echo "ja CP932"
++	echo "ja_JP CP932"
++	# Chinese
++	echo "zh_CN GBK"
++	echo "zh_TW CP950" # not CP938 ??
++	# Korean
++	echo "kr CP949"    # not CP934 ??
++	echo "kr_KR CP949" # not CP934 ??
++	# Thai
++	echo "th CP874"
++	echo "th_TH CP874"
++	# Other
++	echo "eo CP850"
++	echo "eo_EO CP850"
++	;;
++esac
+--- lrzsz-0.12.20.safe/intl/dcgettext.c	1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/dcgettext.c	2004-09-12 14:40:34.359747480 -0400
+@@ -1,593 +1,56 @@
+-/* Implementation of the dcgettext(3) function
+-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++/* Implementation of the dcgettext(3) function.
++   Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+ 
+-#include <sys/types.h>
+-
+-#ifdef __GNUC__
+-# define alloca __builtin_alloca
+-# define HAVE_ALLOCA 1
+-#else
+-# if defined HAVE_ALLOCA_H || defined _LIBC
+-#  include <alloca.h>
+-# else
+-#  ifdef _AIX
+- #pragma alloca
+-#  else
+-#   ifndef alloca
+-char *alloca ();
+-#   endif
+-#  endif
+-# endif
+-#endif
+-
+-#include <errno.h>
+-#ifndef errno
+-extern int errno;
+-#endif
+-#ifndef __set_errno
+-# define __set_errno(val) errno = (val)
+-#endif
+-
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#else
+-char *getenv ();
+-# ifdef HAVE_MALLOC_H
+-#  include <malloc.h>
+-# else
+-void free ();
+-# endif
+-#endif
+-
+-#if defined HAVE_STRING_H || defined _LIBC
+-# ifndef _GNU_SOURCE
+-#  define _GNU_SOURCE	1
+-# endif
+-# include <string.h>
+-#else
+-# include <strings.h>
+-#endif
+-#if !HAVE_STRCHR && !defined _LIBC
+-# ifndef strchr
+-#  define strchr index
+-# endif
+-#endif
+-
+-#if defined HAVE_UNISTD_H || defined _LIBC
+-# include <unistd.h>
+-#endif
+-
+-#include "gettext.h"
+ #include "gettextP.h"
+ #ifdef _LIBC
+ # include <libintl.h>
+ #else
+-# include "libgettext.h"
++# include "libgnuintl.h"
+ #endif
+-#include "hash-string.h"
+ 
+ /* @@ end of prolog @@ */
+ 
+-#ifdef _LIBC
+-/* Rename the non ANSI C functions.  This is required by the standard
+-   because some ANSI C functions will require linking with this object
+-   file and the name space must not be polluted.  */
+-# define getcwd __getcwd
+-# define stpcpy __stpcpy
+-#else
+-# if !defined HAVE_GETCWD
+-char *getwd ();
+-#  define getcwd(buf, max) getwd (buf)
+-# else
+-char *getcwd ();
+-# endif
+-# ifndef HAVE_STPCPY
+-static char *stpcpy PARAMS ((char *dest, const char *src));
+-# endif
+-#endif
+-
+-/* Amount to increase buffer size by in each try.  */
+-#define PATH_INCR 32
+-
+-/* The following is from pathmax.h.  */
+-/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
+-   PATH_MAX but might cause redefinition warnings when sys/param.h is
+-   later included (as on MORE/BSD 4.3).  */
+-#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__))
+-# include <limits.h>
+-#endif
+-
+-#ifndef _POSIX_PATH_MAX
+-# define _POSIX_PATH_MAX 255
+-#endif
+-
+-#if !defined(PATH_MAX) && defined(_PC_PATH_MAX)
+-# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
+-#endif
+-
+-/* Don't include sys/param.h if it already has been.  */
+-#if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN)
+-# include <sys/param.h>
+-#endif
+-
+-#if !defined(PATH_MAX) && defined(MAXPATHLEN)
+-# define PATH_MAX MAXPATHLEN
+-#endif
+-
+-#ifndef PATH_MAX
+-# define PATH_MAX _POSIX_PATH_MAX
+-#endif
+-
+-/* XPG3 defines the result of `setlocale (category, NULL)' as:
+-   ``Directs `setlocale()' to query `category' and return the current
+-     setting of `local'.''
+-   However it does not specify the exact format.  And even worse: POSIX
+-   defines this not at all.  So we can use this feature only on selected
+-   system (e.g. those using GNU C Library).  */
+-#ifdef _LIBC
+-# define HAVE_LOCALE_NULL
+-#endif
+-
+-/* Name of the default domain used for gettext(3) prior any call to
+-   textdomain(3).  The default value for this is "messages".  */
+-const char _nl_default_default_domain[] = "messages";
+-
+-/* Value used as the default domain for gettext(3).  */
+-const char *_nl_current_default_domain = _nl_default_default_domain;
+-
+-/* Contains the default location of the message catalogs.  */
+-const char _nl_default_dirname[] = GNULOCALEDIR;
+-
+-/* List with bindings of specific domains created by bindtextdomain()
+-   calls.  */
+-struct binding *_nl_domain_bindings;
+-
+-/* Prototypes for local functions.  */
+-static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file,
+-			       const char *msgid));
+-static const char *category_to_name PARAMS ((int category));
+-static const char *guess_category_value PARAMS ((int category,
+-						 const char *categoryname));
+-
+-
+-/* For those loosing systems which don't have `alloca' we have to add
+-   some additional code emulating it.  */
+-#ifdef HAVE_ALLOCA
+-/* Nothing has to be done.  */
+-# define ADD_BLOCK(list, address) /* nothing */
+-# define FREE_BLOCKS(list) /* nothing */
+-#else
+-struct block_list
+-{
+-  void *address;
+-  struct block_list *next;
+-};
+-# define ADD_BLOCK(list, addr)						      \
+-  do {									      \
+-    struct block_list *newp = (struct block_list *) malloc (sizeof (*newp));  \
+-    /* If we cannot get a free block we cannot add the new element to	      \
+-       the list.  */							      \
+-    if (newp != NULL) {							      \
+-      newp->address = (addr);						      \
+-      newp->next = (list);						      \
+-      (list) = newp;							      \
+-    }									      \
+-  } while (0)
+-# define FREE_BLOCKS(list)						      \
+-  do {									      \
+-    while (list != NULL) {						      \
+-      struct block_list *old = list;					      \
+-      list = list->next;						      \
+-      free (old);							      \
+-    }									      \
+-  } while (0)
+-# undef alloca
+-# define alloca(size) (malloc (size))
+-#endif	/* have alloca */
+-
+-
+ /* Names for the libintl functions are a problem.  They must not clash
+    with existing names and they should follow ANSI C.  But this source
+    code is also used in GNU C Library where the names have a __
+    prefix.  So we have to make a difference here.  */
+ #ifdef _LIBC
+ # define DCGETTEXT __dcgettext
++# define DCIGETTEXT __dcigettext
+ #else
+-# define DCGETTEXT dcgettext__
++# define DCGETTEXT libintl_dcgettext
++# define DCIGETTEXT libintl_dcigettext
+ #endif
+ 
+ /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+    locale.  */
+ char *
+-DCGETTEXT (domainname, msgid, category)
+-     const char *domainname;
+-     const char *msgid;
+-     int category;
++DCGETTEXT (const char *domainname, const char *msgid, int category)
+ {
+-#ifndef HAVE_ALLOCA
+-  struct block_list *block_list = NULL;
+-#endif
+-  struct loaded_l10nfile *domain;
+-  struct binding *binding;
+-  const char *categoryname;
+-  const char *categoryvalue;
+-  char *dirname, *xdomainname;
+-  char *single_locale;
+-  char *retval;
+-  int saved_errno = errno;
+-
+-  /* If no real MSGID is given return NULL.  */
+-  if (msgid == NULL)
+-    return NULL;
+-
+-  /* If DOMAINNAME is NULL, we are interested in the default domain.  If
+-     CATEGORY is not LC_MESSAGES this might not make much sense but the
+-     defintion left this undefined.  */
+-  if (domainname == NULL)
+-    domainname = _nl_current_default_domain;
+-
+-  /* First find matching binding.  */
+-  for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+-    {
+-      int compare = strcmp (domainname, binding->domainname);
+-      if (compare == 0)
+-	/* We found it!  */
+-	break;
+-      if (compare < 0)
+-	{
+-	  /* It is not in the list.  */
+-	  binding = NULL;
+-	  break;
+-	}
+-    }
+-
+-  if (binding == NULL)
+-    dirname = (char *) _nl_default_dirname;
+-  else if (binding->dirname[0] == '/')
+-    dirname = binding->dirname;
+-  else
+-    {
+-      /* We have a relative path.  Make it absolute now.  */
+-      size_t dirname_len = strlen (binding->dirname) + 1;
+-      size_t path_max;
+-      char *ret;
+-
+-      path_max = (unsigned) PATH_MAX;
+-      path_max += 2;		/* The getcwd docs say to do this.  */
+-
+-      dirname = (char *) alloca (path_max + dirname_len);
+-      ADD_BLOCK (block_list, dirname);
+-
+-      __set_errno (0);
+-      while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE)
+-	{
+-	  path_max += PATH_INCR;
+-	  dirname = (char *) alloca (path_max + dirname_len);
+-	  ADD_BLOCK (block_list, dirname);
+-	  __set_errno (0);
+-	}
+-
+-      if (ret == NULL)
+-	{
+-	  /* We cannot get the current working directory.  Don't signal an
+-	     error but simply return the default string.  */
+-	  FREE_BLOCKS (block_list);
+-	  __set_errno (saved_errno);
+-	  return (char *) msgid;
+-	}
+-
+-      stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
+-    }
+-
+-  /* Now determine the symbolic name of CATEGORY and its value.  */
+-  categoryname = category_to_name (category);
+-  categoryvalue = guess_category_value (category, categoryname);
+-
+-  xdomainname = (char *) alloca (strlen (categoryname)
+-				 + strlen (domainname) + 5);
+-  ADD_BLOCK (block_list, xdomainname);
+-
+-  stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
+-		  domainname),
+-	  ".mo");
+-
+-  /* Creating working area.  */
+-  single_locale = (char *) alloca (strlen (categoryvalue) + 1);
+-  ADD_BLOCK (block_list, single_locale);
+-
+-
+-  /* Search for the given string.  This is a loop because we perhaps
+-     got an ordered list of languages to consider for th translation.  */
+-  while (1)
+-    {
+-      /* Make CATEGORYVALUE point to the next element of the list.  */
+-      while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
+-	++categoryvalue;
+-      if (categoryvalue[0] == '\0')
+-	{
+-	  /* The whole contents of CATEGORYVALUE has been searched but
+-	     no valid entry has been found.  We solve this situation
+-	     by implicitly appending a "C" entry, i.e. no translation
+-	     will take place.  */
+-	  single_locale[0] = 'C';
+-	  single_locale[1] = '\0';
+-	}
+-      else
+-	{
+-	  char *cp = single_locale;
+-	  while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
+-	    *cp++ = *categoryvalue++;
+-	  *cp = '\0';
+-	}
+-
+-      /* If the current locale value is C (or POSIX) we don't load a
+-	 domain.  Return the MSGID.  */
+-      if (strcmp (single_locale, "C") == 0
+-	  || strcmp (single_locale, "POSIX") == 0)
+-	{
+-	  FREE_BLOCKS (block_list);
+-	  __set_errno (saved_errno);
+-	  return (char *) msgid;
+-	}
+-
+-
+-      /* Find structure describing the message catalog matching the
+-	 DOMAINNAME and CATEGORY.  */
+-      domain = _nl_find_domain (dirname, single_locale, xdomainname);
+-
+-      if (domain != NULL)
+-	{
+-	  retval = find_msg (domain, msgid);
+-
+-	  if (retval == NULL)
+-	    {
+-	      int cnt;
+-
+-	      for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
+-		{
+-		  retval = find_msg (domain->successor[cnt], msgid);
+-
+-		  if (retval != NULL)
+-		    break;
+-		}
+-	    }
+-
+-	  if (retval != NULL)
+-	    {
+-	      FREE_BLOCKS (block_list);
+-	      __set_errno (saved_errno);
+-	      return retval;
+-	    }
+-	}
+-    }
+-  /* NOTREACHED */
++  return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category);
+ }
+ 
+ #ifdef _LIBC
+ /* Alias for function name in GNU C Library.  */
++INTDEF(__dcgettext)
+ weak_alias (__dcgettext, dcgettext);
+ #endif
+-
+-
+-static char *
+-find_msg (domain_file, msgid)
+-     struct loaded_l10nfile *domain_file;
+-     const char *msgid;
+-{
+-  size_t top, act, bottom;
+-  struct loaded_domain *domain;
+-
+-  if (domain_file->decided == 0)
+-    _nl_load_domain (domain_file);
+-
+-  if (domain_file->data == NULL)
+-    return NULL;
+-
+-  domain = (struct loaded_domain *) domain_file->data;
+-
+-  /* Locate the MSGID and its translation.  */
+-  if (domain->hash_size > 2 && domain->hash_tab != NULL)
+-    {
+-      /* Use the hashing table.  */
+-      nls_uint32 len = strlen (msgid);
+-      nls_uint32 hash_val = hash_string (msgid);
+-      nls_uint32 idx = hash_val % domain->hash_size;
+-      nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
+-      nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]);
+-
+-      if (nstr == 0)
+-	/* Hash table entry is empty.  */
+-	return NULL;
+-
+-      if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
+-	  && strcmp (msgid,
+-		     domain->data + W (domain->must_swap,
+-				       domain->orig_tab[nstr - 1].offset)) == 0)
+-	return (char *) domain->data + W (domain->must_swap,
+-					  domain->trans_tab[nstr - 1].offset);
+-
+-      while (1)
+-	{
+-	  if (idx >= domain->hash_size - incr)
+-	    idx -= domain->hash_size - incr;
+-	  else
+-	    idx += incr;
+-
+-	  nstr = W (domain->must_swap, domain->hash_tab[idx]);
+-	  if (nstr == 0)
+-	    /* Hash table entry is empty.  */
+-	    return NULL;
+-
+-	  if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
+-	      && strcmp (msgid,
+-			 domain->data + W (domain->must_swap,
+-					   domain->orig_tab[nstr - 1].offset))
+-	         == 0)
+-	    return (char *) domain->data
+-	      + W (domain->must_swap, domain->trans_tab[nstr - 1].offset);
+-	}
+-      /* NOTREACHED */
+-    }
+-
+-  /* Now we try the default method:  binary search in the sorted
+-     array of messages.  */
+-  bottom = 0;
+-  top = domain->nstrings;
+-  while (bottom < top)
+-    {
+-      int cmp_val;
+-
+-      act = (bottom + top) / 2;
+-      cmp_val = strcmp (msgid, domain->data
+-			       + W (domain->must_swap,
+-				    domain->orig_tab[act].offset));
+-      if (cmp_val < 0)
+-	top = act;
+-      else if (cmp_val > 0)
+-	bottom = act + 1;
+-      else
+-	break;
+-    }
+-
+-  /* If an translation is found return this.  */
+-  return bottom >= top ? NULL : (char *) domain->data
+-                                + W (domain->must_swap,
+-				     domain->trans_tab[act].offset);
+-}
+-
+-
+-/* Return string representation of locale CATEGORY.  */
+-static const char *
+-category_to_name (category)
+-     int category;
+-{
+-  const char *retval;
+-
+-  switch (category)
+-  {
+-#ifdef LC_COLLATE
+-  case LC_COLLATE:
+-    retval = "LC_COLLATE";
+-    break;
+-#endif
+-#ifdef LC_CTYPE
+-  case LC_CTYPE:
+-    retval = "LC_CTYPE";
+-    break;
+-#endif
+-#ifdef LC_MONETARY
+-  case LC_MONETARY:
+-    retval = "LC_MONETARY";
+-    break;
+-#endif
+-#ifdef LC_NUMERIC
+-  case LC_NUMERIC:
+-    retval = "LC_NUMERIC";
+-    break;
+-#endif
+-#ifdef LC_TIME
+-  case LC_TIME:
+-    retval = "LC_TIME";
+-    break;
+-#endif
+-#ifdef LC_MESSAGES
+-  case LC_MESSAGES:
+-    retval = "LC_MESSAGES";
+-    break;
+-#endif
+-#ifdef LC_RESPONSE
+-  case LC_RESPONSE:
+-    retval = "LC_RESPONSE";
+-    break;
+-#endif
+-#ifdef LC_ALL
+-  case LC_ALL:
+-    /* This might not make sense but is perhaps better than any other
+-       value.  */
+-    retval = "LC_ALL";
+-    break;
+-#endif
+-  default:
+-    /* If you have a better idea for a default value let me know.  */
+-    retval = "LC_XXX";
+-  }
+-
+-  return retval;
+-}
+-
+-/* Guess value of current locale from value of the environment variables.  */
+-static const char *
+-guess_category_value (category, categoryname)
+-     int category;
+-     const char *categoryname;
+-{
+-  const char *retval;
+-
+-  /* The highest priority value is the `LANGUAGE' environment
+-     variable.  This is a GNU extension.  */
+-  retval = getenv ("LANGUAGE");
+-  if (retval != NULL && retval[0] != '\0')
+-    return retval;
+-
+-  /* `LANGUAGE' is not set.  So we have to proceed with the POSIX
+-     methods of looking to `LC_ALL', `LC_xxx', and `LANG'.  On some
+-     systems this can be done by the `setlocale' function itself.  */
+-#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
+-  return setlocale (category, NULL);
+-#else
+-  /* Setting of LC_ALL overwrites all other.  */
+-  retval = getenv ("LC_ALL");
+-  if (retval != NULL && retval[0] != '\0')
+-    return retval;
+-
+-  /* Next comes the name of the desired category.  */
+-  retval = getenv (categoryname);
+-  if (retval != NULL && retval[0] != '\0')
+-    return retval;
+-
+-  /* Last possibility is the LANG environment variable.  */
+-  retval = getenv ("LANG");
+-  if (retval != NULL && retval[0] != '\0')
+-    return retval;
+-
+-  /* We use C as the default domain.  POSIX says this is implementation
+-     defined.  */
+-  return "C";
+-#endif
+-}
+-
+-/* @@ begin of epilog @@ */
+-
+-/* We don't want libintl.a to depend on any other library.  So we
+-   avoid the non-standard function stpcpy.  In GNU C Library this
+-   function is available, though.  Also allow the symbol HAVE_STPCPY
+-   to be defined.  */
+-#if !_LIBC && !HAVE_STPCPY
+-static char *
+-stpcpy (dest, src)
+-     char *dest;
+-     const char *src;
+-{
+-  while ((*dest++ = *src++) != '\0')
+-    /* Do nothing. */ ;
+-  return dest - 1;
+-}
+-#endif
+--- lrzsz-0.12.20.safe/intl/dcigettext.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/dcigettext.c	2004-09-12 14:40:34.369745960 -0400
+@@ -0,0 +1,1219 @@
++/* Implementation of the internal dcigettext function.
++   Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* Tell glibc's <string.h> to provide a prototype for mempcpy().
++   This must come before <config.h> because <config.h> may include
++   <features.h>, and once <features.h> has been included, it's too late.  */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE	1
++#endif
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <sys/types.h>
++
++#ifdef __GNUC__
++# define alloca __builtin_alloca
++# define HAVE_ALLOCA 1
++#else
++# ifdef _MSC_VER
++#  include <malloc.h>
++#  define alloca _alloca
++# else
++#  if defined HAVE_ALLOCA_H || defined _LIBC
++#   include <alloca.h>
++#  else
++#   ifdef _AIX
++ #pragma alloca
++#   else
++#    ifndef alloca
++char *alloca ();
++#    endif
++#   endif
++#  endif
++# endif
++#endif
++
++#include <errno.h>
++#ifndef errno
++extern int errno;
++#endif
++#ifndef __set_errno
++# define __set_errno(val) errno = (val)
++#endif
++
++#include <stddef.h>
++#include <stdlib.h>
++#include <string.h>
++
++#if defined HAVE_UNISTD_H || defined _LIBC
++# include <unistd.h>
++#endif
++
++#include <locale.h>
++
++#ifdef _LIBC
++  /* Guess whether integer division by zero raises signal SIGFPE.
++     Set to 1 only if you know for sure.  In case of doubt, set to 0.  */
++# if defined __alpha__ || defined __arm__ || defined __i386__ \
++     || defined __m68k__ || defined __s390__
++#  define INTDIV0_RAISES_SIGFPE 1
++# else
++#  define INTDIV0_RAISES_SIGFPE 0
++# endif
++#endif
++#if !INTDIV0_RAISES_SIGFPE
++# include <signal.h>
++#endif
++
++#if defined HAVE_SYS_PARAM_H || defined _LIBC
++# include <sys/param.h>
++#endif
++
++#include "gettextP.h"
++#include "plural-exp.h"
++#ifdef _LIBC
++# include <libintl.h>
++#else
++# include "libgnuintl.h"
++#endif
++#include "hash-string.h"
++
++/* Thread safetyness.  */
++#ifdef _LIBC
++# include <bits/libc-lock.h>
++#else
++/* Provide dummy implementation if this is outside glibc.  */
++# define __libc_lock_define_initialized(CLASS, NAME)
++# define __libc_lock_lock(NAME)
++# define __libc_lock_unlock(NAME)
++# define __libc_rwlock_define_initialized(CLASS, NAME)
++# define __libc_rwlock_rdlock(NAME)
++# define __libc_rwlock_unlock(NAME)
++#endif
++
++/* Alignment of types.  */
++#if defined __GNUC__ && __GNUC__ >= 2
++# define alignof(TYPE) __alignof__ (TYPE)
++#else
++# define alignof(TYPE) \
++    ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2)
++#endif
++
++/* The internal variables in the standalone libintl.a must have different
++   names than the internal variables in GNU libc, otherwise programs
++   using libintl.a cannot be linked statically.  */
++#if !defined _LIBC
++# define _nl_default_default_domain libintl_nl_default_default_domain
++# define _nl_current_default_domain libintl_nl_current_default_domain
++# define _nl_default_dirname libintl_nl_default_dirname
++# define _nl_domain_bindings libintl_nl_domain_bindings
++#endif
++
++/* Some compilers, like SunOS4 cc, don't have offsetof in <stddef.h>.  */
++#ifndef offsetof
++# define offsetof(type,ident) ((size_t)&(((type*)0)->ident))
++#endif
++
++/* @@ end of prolog @@ */
++
++#ifdef _LIBC
++/* Rename the non ANSI C functions.  This is required by the standard
++   because some ANSI C functions will require linking with this object
++   file and the name space must not be polluted.  */
++# define getcwd __getcwd
++# ifndef stpcpy
++#  define stpcpy __stpcpy
++# endif
++# define tfind __tfind
++#else
++# if !defined HAVE_GETCWD
++char *getwd ();
++#  define getcwd(buf, max) getwd (buf)
++# else
++#  if VMS
++#   define getcwd(buf, max) (getcwd) (buf, max, 0)
++#  else
++char *getcwd ();
++#  endif
++# endif
++# ifndef HAVE_STPCPY
++static char *stpcpy (char *dest, const char *src);
++# endif
++# ifndef HAVE_MEMPCPY
++static void *mempcpy (void *dest, const void *src, size_t n);
++# endif
++#endif
++
++/* Amount to increase buffer size by in each try.  */
++#define PATH_INCR 32
++
++/* The following is from pathmax.h.  */
++/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
++   PATH_MAX but might cause redefinition warnings when sys/param.h is
++   later included (as on MORE/BSD 4.3).  */
++#if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__)
++# include <limits.h>
++#endif
++
++#ifndef _POSIX_PATH_MAX
++# define _POSIX_PATH_MAX 255
++#endif
++
++#if !defined PATH_MAX && defined _PC_PATH_MAX
++# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
++#endif
++
++/* Don't include sys/param.h if it already has been.  */
++#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
++# include <sys/param.h>
++#endif
++
++#if !defined PATH_MAX && defined MAXPATHLEN
++# define PATH_MAX MAXPATHLEN
++#endif
++
++#ifndef PATH_MAX
++# define PATH_MAX _POSIX_PATH_MAX
++#endif
++
++/* Pathname support.
++   ISSLASH(C)           tests whether C is a directory separator character.
++   IS_ABSOLUTE_PATH(P)  tests whether P is an absolute path.  If it is not,
++                        it may be concatenated to a directory pathname.
++   IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
++ */
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++  /* Win32, OS/2, DOS */
++# define ISSLASH(C) ((C) == '/' || (C) == '\\')
++# define HAS_DEVICE(P) \
++    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
++     && (P)[1] == ':')
++# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
++# define IS_PATH_WITH_DIR(P) \
++    (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
++#else
++  /* Unix */
++# define ISSLASH(C) ((C) == '/')
++# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
++# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
++#endif
++
++/* This is the type used for the search tree where known translations
++   are stored.  */
++struct known_translation_t
++{
++  /* Domain in which to search.  */
++  char *domainname;
++
++  /* The category.  */
++  int category;
++
++  /* State of the catalog counter at the point the string was found.  */
++  int counter;
++
++  /* Catalog where the string was found.  */
++  struct loaded_l10nfile *domain;
++
++  /* And finally the translation.  */
++  const char *translation;
++  size_t translation_length;
++
++  /* Pointer to the string in question.  */
++  char msgid[ZERO];
++};
++
++/* Root of the search tree with known translations.  We can use this
++   only if the system provides the `tsearch' function family.  */
++#if defined HAVE_TSEARCH || defined _LIBC
++# include <search.h>
++
++static void *root;
++
++# ifdef _LIBC
++#  define tsearch __tsearch
++# endif
++
++/* Function to compare two entries in the table of known translations.  */
++static int
++transcmp (const void *p1, const void *p2)
++{
++  const struct known_translation_t *s1;
++  const struct known_translation_t *s2;
++  int result;
++
++  s1 = (const struct known_translation_t *) p1;
++  s2 = (const struct known_translation_t *) p2;
++
++  result = strcmp (s1->msgid, s2->msgid);
++  if (result == 0)
++    {
++      result = strcmp (s1->domainname, s2->domainname);
++      if (result == 0)
++	/* We compare the category last (though this is the cheapest
++	   operation) since it is hopefully always the same (namely
++	   LC_MESSAGES).  */
++	result = s1->category - s2->category;
++    }
++
++  return result;
++}
++#endif
++
++#ifndef INTVARDEF
++# define INTVARDEF(name)
++#endif
++#ifndef INTUSE
++# define INTUSE(name) name
++#endif
++
++/* Name of the default domain used for gettext(3) prior any call to
++   textdomain(3).  The default value for this is "messages".  */
++const char _nl_default_default_domain[] attribute_hidden = "messages";
++
++/* Value used as the default domain for gettext(3).  */
++const char *_nl_current_default_domain attribute_hidden
++     = _nl_default_default_domain;
++
++/* Contains the default location of the message catalogs.  */
++#if defined __EMX__
++extern const char _nl_default_dirname[];
++#else
++const char _nl_default_dirname[] = LOCALEDIR;
++INTVARDEF (_nl_default_dirname)
++#endif
++
++/* List with bindings of specific domains created by bindtextdomain()
++   calls.  */
++struct binding *_nl_domain_bindings;
++
++/* Prototypes for local functions.  */
++static char *plural_lookup (struct loaded_l10nfile *domain,
++			    unsigned long int n,
++			    const char *translation, size_t translation_len)
++     internal_function;
++static const char *guess_category_value (int category,
++					 const char *categoryname)
++     internal_function;
++#ifdef _LIBC
++# include "../locale/localeinfo.h"
++# define category_to_name(category)	_nl_category_names[category]
++#else
++static const char *category_to_name (int category) internal_function;
++#endif
++
++
++/* For those loosing systems which don't have `alloca' we have to add
++   some additional code emulating it.  */
++#ifdef HAVE_ALLOCA
++/* Nothing has to be done.  */
++# define freea(p) /* nothing */
++# define ADD_BLOCK(list, address) /* nothing */
++# define FREE_BLOCKS(list) /* nothing */
++#else
++struct block_list
++{
++  void *address;
++  struct block_list *next;
++};
++# define ADD_BLOCK(list, addr)						      \
++  do {									      \
++    struct block_list *newp = (struct block_list *) malloc (sizeof (*newp));  \
++    /* If we cannot get a free block we cannot add the new element to	      \
++       the list.  */							      \
++    if (newp != NULL) {							      \
++      newp->address = (addr);						      \
++      newp->next = (list);						      \
++      (list) = newp;							      \
++    }									      \
++  } while (0)
++# define FREE_BLOCKS(list)						      \
++  do {									      \
++    while (list != NULL) {						      \
++      struct block_list *old = list;					      \
++      list = list->next;						      \
++      free (old->address);						      \
++      free (old);							      \
++    }									      \
++  } while (0)
++# undef alloca
++# define alloca(size) (malloc (size))
++# define freea(p) free (p)
++#endif	/* have alloca */
++
++
++#ifdef _LIBC
++/* List of blocks allocated for translations.  */
++typedef struct transmem_list
++{
++  struct transmem_list *next;
++  char data[ZERO];
++} transmem_block_t;
++static struct transmem_list *transmem_list;
++#else
++typedef unsigned char transmem_block_t;
++#endif
++
++
++/* Names for the libintl functions are a problem.  They must not clash
++   with existing names and they should follow ANSI C.  But this source
++   code is also used in GNU C Library where the names have a __
++   prefix.  So we have to make a difference here.  */
++#ifdef _LIBC
++# define DCIGETTEXT __dcigettext
++#else
++# define DCIGETTEXT libintl_dcigettext
++#endif
++
++/* Lock variable to protect the global data in the gettext implementation.  */
++#ifdef _LIBC
++__libc_rwlock_define_initialized (, _nl_state_lock attribute_hidden)
++#endif
++
++/* Checking whether the binaries runs SUID must be done and glibc provides
++   easier methods therefore we make a difference here.  */
++#ifdef _LIBC
++# define ENABLE_SECURE __libc_enable_secure
++# define DETERMINE_SECURE
++#else
++# ifndef HAVE_GETUID
++#  define getuid() 0
++# endif
++# ifndef HAVE_GETGID
++#  define getgid() 0
++# endif
++# ifndef HAVE_GETEUID
++#  define geteuid() getuid()
++# endif
++# ifndef HAVE_GETEGID
++#  define getegid() getgid()
++# endif
++static int enable_secure;
++# define ENABLE_SECURE (enable_secure == 1)
++# define DETERMINE_SECURE \
++  if (enable_secure == 0)						      \
++    {									      \
++      if (getuid () != geteuid () || getgid () != getegid ())		      \
++	enable_secure = 1;						      \
++      else								      \
++	enable_secure = -1;						      \
++    }
++#endif
++
++/* Get the function to evaluate the plural expression.  */
++#include "eval-plural.h"
++
++/* Look up MSGID in the DOMAINNAME message catalog for the current
++   CATEGORY locale and, if PLURAL is nonzero, search over string
++   depending on the plural form determined by N.  */
++char *
++DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
++	    int plural, unsigned long int n, int category)
++{
++#ifndef HAVE_ALLOCA
++  struct block_list *block_list = NULL;
++#endif
++  struct loaded_l10nfile *domain;
++  struct binding *binding;
++  const char *categoryname;
++  const char *categoryvalue;
++  char *dirname, *xdomainname;
++  char *single_locale;
++  char *retval;
++  size_t retlen;
++  int saved_errno;
++#if defined HAVE_TSEARCH || defined _LIBC
++  struct known_translation_t *search;
++  struct known_translation_t **foundp = NULL;
++  size_t msgid_len;
++#endif
++  size_t domainname_len;
++
++  /* If no real MSGID is given return NULL.  */
++  if (msgid1 == NULL)
++    return NULL;
++
++#ifdef _LIBC
++  if (category < 0 || category >= __LC_LAST || category == LC_ALL)
++    /* Bogus.  */
++    return (plural == 0
++	    ? (char *) msgid1
++	    /* Use the Germanic plural rule.  */
++	    : n == 1 ? (char *) msgid1 : (char *) msgid2);
++#endif
++
++  __libc_rwlock_rdlock (_nl_state_lock);
++
++  /* If DOMAINNAME is NULL, we are interested in the default domain.  If
++     CATEGORY is not LC_MESSAGES this might not make much sense but the
++     definition left this undefined.  */
++  if (domainname == NULL)
++    domainname = _nl_current_default_domain;
++
++  /* OS/2 specific: backward compatibility with older libintl versions  */
++#ifdef LC_MESSAGES_COMPAT
++  if (category == LC_MESSAGES_COMPAT)
++    category = LC_MESSAGES;
++#endif
++
++#if defined HAVE_TSEARCH || defined _LIBC
++  msgid_len = strlen (msgid1) + 1;
++
++  /* Try to find the translation among those which we found at
++     some time.  */
++  search = (struct known_translation_t *)
++	   alloca (offsetof (struct known_translation_t, msgid) + msgid_len);
++  memcpy (search->msgid, msgid1, msgid_len);
++  search->domainname = (char *) domainname;
++  search->category = category;
++
++  foundp = (struct known_translation_t **) tfind (search, &root, transcmp);
++  freea (search);
++  if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr)
++    {
++      /* Now deal with plural.  */
++      if (plural)
++	retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation,
++				(*foundp)->translation_length);
++      else
++	retval = (char *) (*foundp)->translation;
++
++      __libc_rwlock_unlock (_nl_state_lock);
++      return retval;
++    }
++#endif
++
++  /* Preserve the `errno' value.  */
++  saved_errno = errno;
++
++  /* See whether this is a SUID binary or not.  */
++  DETERMINE_SECURE;
++
++  /* First find matching binding.  */
++  for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
++    {
++      int compare = strcmp (domainname, binding->domainname);
++      if (compare == 0)
++	/* We found it!  */
++	break;
++      if (compare < 0)
++	{
++	  /* It is not in the list.  */
++	  binding = NULL;
++	  break;
++	}
++    }
++
++  if (binding == NULL)
++    dirname = (char *) INTUSE(_nl_default_dirname);
++  else if (IS_ABSOLUTE_PATH (binding->dirname))
++    dirname = binding->dirname;
++  else
++    {
++      /* We have a relative path.  Make it absolute now.  */
++      size_t dirname_len = strlen (binding->dirname) + 1;
++      size_t path_max;
++      char *ret;
++
++      path_max = (unsigned int) PATH_MAX;
++      path_max += 2;		/* The getcwd docs say to do this.  */
++
++      for (;;)
++	{
++	  dirname = (char *) alloca (path_max + dirname_len);
++	  ADD_BLOCK (block_list, dirname);
++
++	  __set_errno (0);
++	  ret = getcwd (dirname, path_max);
++	  if (ret != NULL || errno != ERANGE)
++	    break;
++
++	  path_max += path_max / 2;
++	  path_max += PATH_INCR;
++	}
++
++      if (ret == NULL)
++	/* We cannot get the current working directory.  Don't signal an
++	   error but simply return the default string.  */
++	goto return_untranslated;
++
++      stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
++    }
++
++  /* Now determine the symbolic name of CATEGORY and its value.  */
++  categoryname = category_to_name (category);
++  categoryvalue = guess_category_value (category, categoryname);
++
++  domainname_len = strlen (domainname);
++  xdomainname = (char *) alloca (strlen (categoryname)
++				 + domainname_len + 5);
++  ADD_BLOCK (block_list, xdomainname);
++
++  stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
++		  domainname, domainname_len),
++	  ".mo");
++
++  /* Creating working area.  */
++  single_locale = (char *) alloca (strlen (categoryvalue) + 1);
++  ADD_BLOCK (block_list, single_locale);
++
++
++  /* Search for the given string.  This is a loop because we perhaps
++     got an ordered list of languages to consider for the translation.  */
++  while (1)
++    {
++      /* Make CATEGORYVALUE point to the next element of the list.  */
++      while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
++	++categoryvalue;
++      if (categoryvalue[0] == '\0')
++	{
++	  /* The whole contents of CATEGORYVALUE has been searched but
++	     no valid entry has been found.  We solve this situation
++	     by implicitly appending a "C" entry, i.e. no translation
++	     will take place.  */
++	  single_locale[0] = 'C';
++	  single_locale[1] = '\0';
++	}
++      else
++	{
++	  char *cp = single_locale;
++	  while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
++	    *cp++ = *categoryvalue++;
++	  *cp = '\0';
++
++	  /* When this is a SUID binary we must not allow accessing files
++	     outside the dedicated directories.  */
++	  if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale))
++	    /* Ingore this entry.  */
++	    continue;
++	}
++
++      /* If the current locale value is C (or POSIX) we don't load a
++	 domain.  Return the MSGID.  */
++      if (strcmp (single_locale, "C") == 0
++	  || strcmp (single_locale, "POSIX") == 0)
++	break;
++
++      /* Find structure describing the message catalog matching the
++	 DOMAINNAME and CATEGORY.  */
++      domain = _nl_find_domain (dirname, single_locale, xdomainname, binding);
++
++      if (domain != NULL)
++	{
++	  retval = _nl_find_msg (domain, binding, msgid1, &retlen);
++
++	  if (retval == NULL)
++	    {
++	      int cnt;
++
++	      for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
++		{
++		  retval = _nl_find_msg (domain->successor[cnt], binding,
++					 msgid1, &retlen);
++
++		  if (retval != NULL)
++		    {
++		      domain = domain->successor[cnt];
++		      break;
++		    }
++		}
++	    }
++
++	  if (retval != NULL)
++	    {
++	      /* Found the translation of MSGID1 in domain DOMAIN:
++		 starting at RETVAL, RETLEN bytes.  */
++	      FREE_BLOCKS (block_list);
++#if defined HAVE_TSEARCH || defined _LIBC
++	      if (foundp == NULL)
++		{
++		  /* Create a new entry and add it to the search tree.  */
++		  struct known_translation_t *newp;
++
++		  newp = (struct known_translation_t *)
++		    malloc (offsetof (struct known_translation_t, msgid)
++			    + msgid_len + domainname_len + 1);
++		  if (newp != NULL)
++		    {
++		      newp->domainname =
++			mempcpy (newp->msgid, msgid1, msgid_len);
++		      memcpy (newp->domainname, domainname, domainname_len + 1);
++		      newp->category = category;
++		      newp->counter = _nl_msg_cat_cntr;
++		      newp->domain = domain;
++		      newp->translation = retval;
++		      newp->translation_length = retlen;
++
++		      /* Insert the entry in the search tree.  */
++		      foundp = (struct known_translation_t **)
++			tsearch (newp, &root, transcmp);
++		      if (foundp == NULL
++			  || __builtin_expect (*foundp != newp, 0))
++			/* The insert failed.  */
++			free (newp);
++		    }
++		}
++	      else
++		{
++		  /* We can update the existing entry.  */
++		  (*foundp)->counter = _nl_msg_cat_cntr;
++		  (*foundp)->domain = domain;
++		  (*foundp)->translation = retval;
++		  (*foundp)->translation_length = retlen;
++		}
++#endif
++	      __set_errno (saved_errno);
++
++	      /* Now deal with plural.  */
++	      if (plural)
++		retval = plural_lookup (domain, n, retval, retlen);
++
++	      __libc_rwlock_unlock (_nl_state_lock);
++	      return retval;
++	    }
++	}
++    }
++
++ return_untranslated:
++  /* Return the untranslated MSGID.  */
++  FREE_BLOCKS (block_list);
++  __libc_rwlock_unlock (_nl_state_lock);
++#ifndef _LIBC
++  if (!ENABLE_SECURE)
++    {
++      extern void _nl_log_untranslated (const char *logfilename,
++					const char *domainname,
++					const char *msgid1, const char *msgid2,
++					int plural);
++      const char *logfilename = getenv ("GETTEXT_LOG_UNTRANSLATED");
++
++      if (logfilename != NULL && logfilename[0] != '\0')
++	_nl_log_untranslated (logfilename, domainname, msgid1, msgid2, plural);
++    }
++#endif
++  __set_errno (saved_errno);
++  return (plural == 0
++	  ? (char *) msgid1
++	  /* Use the Germanic plural rule.  */
++	  : n == 1 ? (char *) msgid1 : (char *) msgid2);
++}
++
++
++char *
++internal_function
++_nl_find_msg (struct loaded_l10nfile *domain_file,
++	      struct binding *domainbinding, const char *msgid,
++	      size_t *lengthp)
++{
++  struct loaded_domain *domain;
++  nls_uint32 nstrings;
++  size_t act;
++  char *result;
++  size_t resultlen;
++
++  if (domain_file->decided == 0)
++    _nl_load_domain (domain_file, domainbinding);
++
++  if (domain_file->data == NULL)
++    return NULL;
++
++  domain = (struct loaded_domain *) domain_file->data;
++
++  nstrings = domain->nstrings;
++
++  /* Locate the MSGID and its translation.  */
++  if (domain->hash_tab != NULL)
++    {
++      /* Use the hashing table.  */
++      nls_uint32 len = strlen (msgid);
++      nls_uint32 hash_val = hash_string (msgid);
++      nls_uint32 idx = hash_val % domain->hash_size;
++      nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
++
++      while (1)
++	{
++	  nls_uint32 nstr =
++	    W (domain->must_swap_hash_tab, domain->hash_tab[idx]);
++
++	  if (nstr == 0)
++	    /* Hash table entry is empty.  */
++	    return NULL;
++
++	  nstr--;
++
++	  /* Compare msgid with the original string at index nstr.
++	     We compare the lengths with >=, not ==, because plural entries
++	     are represented by strings with an embedded NUL.  */
++	  if (nstr < nstrings
++	      ? W (domain->must_swap, domain->orig_tab[nstr].length) >= len
++		&& (strcmp (msgid,
++			    domain->data + W (domain->must_swap,
++					      domain->orig_tab[nstr].offset))
++		    == 0)
++	      : domain->orig_sysdep_tab[nstr - nstrings].length > len
++		&& (strcmp (msgid,
++			    domain->orig_sysdep_tab[nstr - nstrings].pointer)
++		    == 0))
++	    {
++	      act = nstr;
++	      goto found;
++	    }
++
++	  if (idx >= domain->hash_size - incr)
++	    idx -= domain->hash_size - incr;
++	  else
++	    idx += incr;
++	}
++      /* NOTREACHED */
++    }
++  else
++    {
++      /* Try the default method:  binary search in the sorted array of
++	 messages.  */
++      size_t top, bottom;
++
++      bottom = 0;
++      top = nstrings;
++      while (bottom < top)
++	{
++	  int cmp_val;
++
++	  act = (bottom + top) / 2;
++	  cmp_val = strcmp (msgid, (domain->data
++				    + W (domain->must_swap,
++					 domain->orig_tab[act].offset)));
++	  if (cmp_val < 0)
++	    top = act;
++	  else if (cmp_val > 0)
++	    bottom = act + 1;
++	  else
++	    goto found;
++	}
++      /* No translation was found.  */
++      return NULL;
++    }
++
++ found:
++  /* The translation was found at index ACT.  If we have to convert the
++     string to use a different character set, this is the time.  */
++  if (act < nstrings)
++    {
++      result = (char *)
++	(domain->data + W (domain->must_swap, domain->trans_tab[act].offset));
++      resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1;
++    }
++  else
++    {
++      result = (char *) domain->trans_sysdep_tab[act - nstrings].pointer;
++      resultlen = domain->trans_sysdep_tab[act - nstrings].length;
++    }
++
++#if defined _LIBC || HAVE_ICONV
++  if (domain->codeset_cntr
++      != (domainbinding != NULL ? domainbinding->codeset_cntr : 0))
++    {
++      /* The domain's codeset has changed through bind_textdomain_codeset()
++	 since the message catalog was initialized or last accessed.  We
++	 have to reinitialize the converter.  */
++      _nl_free_domain_conv (domain);
++      _nl_init_domain_conv (domain_file, domain, domainbinding);
++    }
++
++  if (
++# ifdef _LIBC
++      domain->conv != (__gconv_t) -1
++# else
++#  if HAVE_ICONV
++      domain->conv != (iconv_t) -1
++#  endif
++# endif
++      )
++    {
++      /* We are supposed to do a conversion.  First allocate an
++	 appropriate table with the same structure as the table
++	 of translations in the file, where we can put the pointers
++	 to the converted strings in.
++	 There is a slight complication with plural entries.  They
++	 are represented by consecutive NUL terminated strings.  We
++	 handle this case by converting RESULTLEN bytes, including
++	 NULs.  */
++
++      if (domain->conv_tab == NULL
++	  && ((domain->conv_tab =
++		 (char **) calloc (nstrings + domain->n_sysdep_strings,
++				   sizeof (char *)))
++	      == NULL))
++	/* Mark that we didn't succeed allocating a table.  */
++	domain->conv_tab = (char **) -1;
++
++      if (__builtin_expect (domain->conv_tab == (char **) -1, 0))
++	/* Nothing we can do, no more memory.  */
++	goto converted;
++
++      if (domain->conv_tab[act] == NULL)
++	{
++	  /* We haven't used this string so far, so it is not
++	     translated yet.  Do this now.  */
++	  /* We use a bit more efficient memory handling.
++	     We allocate always larger blocks which get used over
++	     time.  This is faster than many small allocations.   */
++	  __libc_lock_define_initialized (static, lock)
++# define INITIAL_BLOCK_SIZE	4080
++	  static unsigned char *freemem;
++	  static size_t freemem_size;
++
++	  const unsigned char *inbuf;
++	  unsigned char *outbuf;
++	  int malloc_count;
++# ifndef _LIBC
++	  transmem_block_t *transmem_list = NULL;
++# endif
++
++	  __libc_lock_lock (lock);
++
++	  inbuf = (const unsigned char *) result;
++	  outbuf = freemem + sizeof (size_t);
++
++	  malloc_count = 0;
++	  while (1)
++	    {
++	      transmem_block_t *newmem;
++# ifdef _LIBC
++	      size_t non_reversible;
++	      int res;
++
++	      if (freemem_size < sizeof (size_t))
++		goto resize_freemem;
++
++	      res = __gconv (domain->conv,
++			     &inbuf, inbuf + resultlen,
++			     &outbuf,
++			     outbuf + freemem_size - sizeof (size_t),
++			     &non_reversible);
++
++	      if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT)
++		break;
++
++	      if (res != __GCONV_FULL_OUTPUT)
++		{
++		  __libc_lock_unlock (lock);
++		  goto converted;
++		}
++
++	      inbuf = result;
++# else
++#  if HAVE_ICONV
++	      const char *inptr = (const char *) inbuf;
++	      size_t inleft = resultlen;
++	      char *outptr = (char *) outbuf;
++	      size_t outleft;
++
++	      if (freemem_size < sizeof (size_t))
++		goto resize_freemem;
++
++	      outleft = freemem_size - sizeof (size_t);
++	      if (iconv (domain->conv,
++			 (ICONV_CONST char **) &inptr, &inleft,
++			 &outptr, &outleft)
++		  != (size_t) (-1))
++		{
++		  outbuf = (unsigned char *) outptr;
++		  break;
++		}
++	      if (errno != E2BIG)
++		{
++		  __libc_lock_unlock (lock);
++		  goto converted;
++		}
++#  endif
++# endif
++
++	    resize_freemem:
++	      /* We must allocate a new buffer or resize the old one.  */
++	      if (malloc_count > 0)
++		{
++		  ++malloc_count;
++		  freemem_size = malloc_count * INITIAL_BLOCK_SIZE;
++		  newmem = (transmem_block_t *) realloc (transmem_list,
++							 freemem_size);
++# ifdef _LIBC
++		  if (newmem != NULL)
++		    transmem_list = transmem_list->next;
++		  else
++		    {
++		      struct transmem_list *old = transmem_list;
++
++		      transmem_list = transmem_list->next;
++		      free (old);
++		    }
++# endif
++		}
++	      else
++		{
++		  malloc_count = 1;
++		  freemem_size = INITIAL_BLOCK_SIZE;
++		  newmem = (transmem_block_t *) malloc (freemem_size);
++		}
++	      if (__builtin_expect (newmem == NULL, 0))
++		{
++		  freemem = NULL;
++		  freemem_size = 0;
++		  __libc_lock_unlock (lock);
++		  goto converted;
++		}
++
++# ifdef _LIBC
++	      /* Add the block to the list of blocks we have to free
++                 at some point.  */
++	      newmem->next = transmem_list;
++	      transmem_list = newmem;
++
++	      freemem = newmem->data;
++	      freemem_size -= offsetof (struct transmem_list, data);
++# else
++	      transmem_list = newmem;
++	      freemem = newmem;
++# endif
++
++	      outbuf = freemem + sizeof (size_t);
++	    }
++
++	  /* We have now in our buffer a converted string.  Put this
++	     into the table of conversions.  */
++	  *(size_t *) freemem = outbuf - freemem - sizeof (size_t);
++	  domain->conv_tab[act] = (char *) freemem;
++	  /* Shrink freemem, but keep it aligned.  */
++	  freemem_size -= outbuf - freemem;
++	  freemem = outbuf;
++	  freemem += freemem_size & (alignof (size_t) - 1);
++	  freemem_size = freemem_size & ~ (alignof (size_t) - 1);
++
++	  __libc_lock_unlock (lock);
++	}
++
++      /* Now domain->conv_tab[act] contains the translation of all
++	 the plural variants.  */
++      result = domain->conv_tab[act] + sizeof (size_t);
++      resultlen = *(size_t *) domain->conv_tab[act];
++    }
++
++ converted:
++  /* The result string is converted.  */
++
++#endif /* _LIBC || HAVE_ICONV */
++
++  *lengthp = resultlen;
++  return result;
++}
++
++
++/* Look up a plural variant.  */
++static char *
++internal_function
++plural_lookup (struct loaded_l10nfile *domain, unsigned long int n,
++	       const char *translation, size_t translation_len)
++{
++  struct loaded_domain *domaindata = (struct loaded_domain *) domain->data;
++  unsigned long int index;
++  const char *p;
++
++  index = plural_eval (domaindata->plural, n);
++  if (index >= domaindata->nplurals)
++    /* This should never happen.  It means the plural expression and the
++       given maximum value do not match.  */
++    index = 0;
++
++  /* Skip INDEX strings at TRANSLATION.  */
++  p = translation;
++  while (index-- > 0)
++    {
++#ifdef _LIBC
++      p = __rawmemchr (p, '\0');
++#else
++      p = strchr (p, '\0');
++#endif
++      /* And skip over the NUL byte.  */
++      p++;
++
++      if (p >= translation + translation_len)
++	/* This should never happen.  It means the plural expression
++	   evaluated to a value larger than the number of variants
++	   available for MSGID1.  */
++	return (char *) translation;
++    }
++  return (char *) p;
++}
++
++#ifndef _LIBC
++/* Return string representation of locale CATEGORY.  */
++static const char *
++internal_function
++category_to_name (int category)
++{
++  const char *retval;
++
++  switch (category)
++  {
++#ifdef LC_COLLATE
++  case LC_COLLATE:
++    retval = "LC_COLLATE";
++    break;
++#endif
++#ifdef LC_CTYPE
++  case LC_CTYPE:
++    retval = "LC_CTYPE";
++    break;
++#endif
++#ifdef LC_MONETARY
++  case LC_MONETARY:
++    retval = "LC_MONETARY";
++    break;
++#endif
++#ifdef LC_NUMERIC
++  case LC_NUMERIC:
++    retval = "LC_NUMERIC";
++    break;
++#endif
++#ifdef LC_TIME
++  case LC_TIME:
++    retval = "LC_TIME";
++    break;
++#endif
++#ifdef LC_MESSAGES
++  case LC_MESSAGES:
++    retval = "LC_MESSAGES";
++    break;
++#endif
++#ifdef LC_RESPONSE
++  case LC_RESPONSE:
++    retval = "LC_RESPONSE";
++    break;
++#endif
++#ifdef LC_ALL
++  case LC_ALL:
++    /* This might not make sense but is perhaps better than any other
++       value.  */
++    retval = "LC_ALL";
++    break;
++#endif
++  default:
++    /* If you have a better idea for a default value let me know.  */
++    retval = "LC_XXX";
++  }
++
++  return retval;
++}
++#endif
++
++/* Guess value of current locale from value of the environment variables.  */
++static const char *
++internal_function
++guess_category_value (int category, const char *categoryname)
++{
++  const char *language;
++  const char *retval;
++
++  /* The highest priority value is the `LANGUAGE' environment
++     variable.  But we don't use the value if the currently selected
++     locale is the C locale.  This is a GNU extension.  */
++  language = getenv ("LANGUAGE");
++  if (language != NULL && language[0] == '\0')
++    language = NULL;
++
++  /* We have to proceed with the POSIX methods of looking to `LC_ALL',
++     `LC_xxx', and `LANG'.  On some systems this can be done by the
++     `setlocale' function itself.  */
++#ifdef _LIBC
++  retval = __current_locale_name (category);
++#else
++  retval = _nl_locale_name (category, categoryname);
++#endif
++
++  /* Ignore LANGUAGE if the locale is set to "C" because
++     1. "C" locale usually uses the ASCII encoding, and most international
++	messages use non-ASCII characters. These characters get displayed
++	as question marks (if using glibc's iconv()) or as invalid 8-bit
++	characters (because other iconv()s refuse to convert most non-ASCII
++	characters to ASCII). In any case, the output is ugly.
++     2. The precise output of some programs in the "C" locale is specified
++	by POSIX and should not depend on environment variables like
++	"LANGUAGE".  We allow such programs to use gettext().  */
++  return language != NULL && strcmp (retval, "C") != 0 ? language : retval;
++}
++
++/* @@ begin of epilog @@ */
++
++/* We don't want libintl.a to depend on any other library.  So we
++   avoid the non-standard function stpcpy.  In GNU C Library this
++   function is available, though.  Also allow the symbol HAVE_STPCPY
++   to be defined.  */
++#if !_LIBC && !HAVE_STPCPY
++static char *
++stpcpy (char *dest, const char *src)
++{
++  while ((*dest++ = *src++) != '\0')
++    /* Do nothing. */ ;
++  return dest - 1;
++}
++#endif
++
++#if !_LIBC && !HAVE_MEMPCPY
++static void *
++mempcpy (void *dest, const void *src, size_t n)
++{
++  return (void *) ((char *) memcpy (dest, src, n) + n);
++}
++#endif
++
++
++#ifdef _LIBC
++/* If we want to free all resources we have to do some work at
++   program's end.  */
++libc_freeres_fn (free_mem)
++{
++  void *old;
++
++  while (_nl_domain_bindings != NULL)
++    {
++      struct binding *oldp = _nl_domain_bindings;
++      _nl_domain_bindings = _nl_domain_bindings->next;
++      if (oldp->dirname != INTUSE(_nl_default_dirname))
++	/* Yes, this is a pointer comparison.  */
++	free (oldp->dirname);
++      free (oldp->codeset);
++      free (oldp);
++    }
++
++  if (_nl_current_default_domain != _nl_default_default_domain)
++    /* Yes, again a pointer comparison.  */
++    free ((char *) _nl_current_default_domain);
++
++  /* Remove the search tree with the known translations.  */
++  __tdestroy (root, free);
++  root = NULL;
++
++  while (transmem_list != NULL)
++    {
++      old = transmem_list;
++      transmem_list = transmem_list->next;
++      free (old);
++    }
++}
++#endif
+--- lrzsz-0.12.20.safe/intl/dcngettext.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/dcngettext.c	2004-09-12 14:40:34.375745048 -0400
+@@ -0,0 +1,57 @@
++/* Implementation of the dcngettext(3) function.
++   Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include "gettextP.h"
++#ifdef _LIBC
++# include <libintl.h>
++#else
++# include "libgnuintl.h"
++#endif
++
++/* @@ end of prolog @@ */
++
++/* Names for the libintl functions are a problem.  They must not clash
++   with existing names and they should follow ANSI C.  But this source
++   code is also used in GNU C Library where the names have a __
++   prefix.  So we have to make a difference here.  */
++#ifdef _LIBC
++# define DCNGETTEXT __dcngettext
++# define DCIGETTEXT __dcigettext
++#else
++# define DCNGETTEXT libintl_dcngettext
++# define DCIGETTEXT libintl_dcigettext
++#endif
++
++/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
++   locale.  */
++char *
++DCNGETTEXT (const char *domainname,
++	    const char *msgid1, const char *msgid2, unsigned long int n,
++	    int category)
++{
++  return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category);
++}
++
++#ifdef _LIBC
++/* Alias for function name in GNU C Library.  */
++weak_alias (__dcngettext, dcngettext);
++#endif
+--- lrzsz-0.12.20.safe/intl/dgettext.c	1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/dgettext.c	2004-09-12 14:40:34.380744288 -0400
+@@ -1,32 +1,33 @@
+-/* dgettext.c -- implementation of the dgettext(3) function
+-   Copyright (C) 1995 Software Foundation, Inc.
++/* Implementation of the dgettext(3) function.
++   Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
+ 
+-This program is free software; you can redistribute it and/or modify
+-it under the terms of the GNU General Public License as published by
+-the Free Software Foundation; either version 2, or (at your option)
+-any later version.
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
+ 
+-This program is distributed in the hope that 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.
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-You should have received a copy of the GNU General Public License
+-along with this program; if not, write to the Free Software
+-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+ 
+-#if defined HAVE_LOCALE_H || defined _LIBC
+-# include <locale.h>
+-#endif
++#include "gettextP.h"
++
++#include <locale.h>
+ 
+ #ifdef _LIBC
+ # include <libintl.h>
+ #else
+-# include "libgettext.h"
++# include "libgnuintl.h"
+ #endif
+ 
+ /* @@ end of prolog @@ */
+@@ -37,18 +38,16 @@
+    prefix.  So we have to make a difference here.  */
+ #ifdef _LIBC
+ # define DGETTEXT __dgettext
+-# define DCGETTEXT __dcgettext
++# define DCGETTEXT INTUSE(__dcgettext)
+ #else
+-# define DGETTEXT dgettext__
+-# define DCGETTEXT dcgettext__
++# define DGETTEXT libintl_dgettext
++# define DCGETTEXT libintl_dcgettext
+ #endif
+ 
+ /* Look up MSGID in the DOMAINNAME message catalog of the current
+    LC_MESSAGES locale.  */
+ char *
+-DGETTEXT (domainname, msgid)
+-     const char *domainname;
+-     const char *msgid;
++DGETTEXT (const char *domainname, const char *msgid)
+ {
+   return DCGETTEXT (domainname, msgid, LC_MESSAGES);
+ }
+--- lrzsz-0.12.20.safe/intl/dngettext.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/dngettext.c	2004-09-12 14:40:34.385743528 -0400
+@@ -0,0 +1,59 @@
++/* Implementation of the dngettext(3) function.
++   Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include "gettextP.h"
++
++#include <locale.h>
++
++#ifdef _LIBC
++# include <libintl.h>
++#else
++# include "libgnuintl.h"
++#endif
++
++/* @@ end of prolog @@ */
++
++/* Names for the libintl functions are a problem.  They must not clash
++   with existing names and they should follow ANSI C.  But this source
++   code is also used in GNU C Library where the names have a __
++   prefix.  So we have to make a difference here.  */
++#ifdef _LIBC
++# define DNGETTEXT __dngettext
++# define DCNGETTEXT __dcngettext
++#else
++# define DNGETTEXT libintl_dngettext
++# define DCNGETTEXT libintl_dcngettext
++#endif
++
++/* Look up MSGID in the DOMAINNAME message catalog of the current
++   LC_MESSAGES locale and skip message according to the plural form.  */
++char *
++DNGETTEXT (const char *domainname,
++	   const char *msgid1, const char *msgid2, unsigned long int n)
++{
++  return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES);
++}
++
++#ifdef _LIBC
++/* Alias for function name in GNU C Library.  */
++weak_alias (__dngettext, dngettext);
++#endif
+--- lrzsz-0.12.20.safe/intl/eval-plural.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/eval-plural.h	2004-09-12 14:40:34.390742768 -0400
+@@ -0,0 +1,108 @@
++/* Plural expression evaluation.
++   Copyright (C) 2000-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef STATIC
++#define STATIC static
++#endif
++
++/* Evaluate the plural expression and return an index value.  */
++STATIC
++unsigned long int
++internal_function
++plural_eval (struct expression *pexp, unsigned long int n)
++{
++  switch (pexp->nargs)
++    {
++    case 0:
++      switch (pexp->operation)
++	{
++	case var:
++	  return n;
++	case num:
++	  return pexp->val.num;
++	default:
++	  break;
++	}
++      /* NOTREACHED */
++      break;
++    case 1:
++      {
++	/* pexp->operation must be lnot.  */
++	unsigned long int arg = plural_eval (pexp->val.args[0], n);
++	return ! arg;
++      }
++    case 2:
++      {
++	unsigned long int leftarg = plural_eval (pexp->val.args[0], n);
++	if (pexp->operation == lor)
++	  return leftarg || plural_eval (pexp->val.args[1], n);
++	else if (pexp->operation == land)
++	  return leftarg && plural_eval (pexp->val.args[1], n);
++	else
++	  {
++	    unsigned long int rightarg = plural_eval (pexp->val.args[1], n);
++
++	    switch (pexp->operation)
++	      {
++	      case mult:
++		return leftarg * rightarg;
++	      case divide:
++#if !INTDIV0_RAISES_SIGFPE
++		if (rightarg == 0)
++		  raise (SIGFPE);
++#endif
++		return leftarg / rightarg;
++	      case module:
++#if !INTDIV0_RAISES_SIGFPE
++		if (rightarg == 0)
++		  raise (SIGFPE);
++#endif
++		return leftarg % rightarg;
++	      case plus:
++		return leftarg + rightarg;
++	      case minus:
++		return leftarg - rightarg;
++	      case less_than:
++		return leftarg < rightarg;
++	      case greater_than:
++		return leftarg > rightarg;
++	      case less_or_equal:
++		return leftarg <= rightarg;
++	      case greater_or_equal:
++		return leftarg >= rightarg;
++	      case equal:
++		return leftarg == rightarg;
++	      case not_equal:
++		return leftarg != rightarg;
++	      default:
++		break;
++	      }
++	  }
++	/* NOTREACHED */
++	break;
++      }
++    case 3:
++      {
++	/* pexp->operation must be qmop.  */
++	unsigned long int boolarg = plural_eval (pexp->val.args[0], n);
++	return plural_eval (pexp->val.args[boolarg ? 1 : 2], n);
++      }
++    }
++  /* NOTREACHED */
++  return 0;
++}
+--- lrzsz-0.12.20.safe/intl/explodename.c	1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/explodename.c	2004-09-12 14:40:34.395742008 -0400
+@@ -1,19 +1,20 @@
+-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++/* Copyright (C) 1995-1998, 2000-2001, 2003 Free Software Foundation, Inc.
+    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+@@ -36,18 +37,23 @@
+ 
+ /* @@ end of prolog @@ */
+ 
++char *
++_nl_find_language (const char *name)
++{
++  while (name[0] != '\0' && name[0] != '_' && name[0] != '@'
++	 && name[0] != '+' && name[0] != ',')
++    ++name;
++
++  return (char *) name;
++}
++
++
+ int
+-_nl_explode_name (name, language, modifier, territory, codeset,
+-		  normalized_codeset, special, sponsor, revision)
+-     char *name;
+-     const char **language;
+-     const char **modifier;
+-     const char **territory;
+-     const char **codeset;
+-     const char **normalized_codeset;
+-     const char **special;
+-     const char **sponsor;
+-     const char **revision;
++_nl_explode_name (char *name,
++		  const char **language, const char **modifier,
++		  const char **territory, const char **codeset,
++		  const char **normalized_codeset, const char **special,
++		  const char **sponsor, const char **revision)
+ {
+   enum { undecided, xpg, cen } syntax;
+   char *cp;
+@@ -67,9 +73,7 @@
+   mask = 0;
+   syntax = undecided;
+   *language = cp = name;
+-  while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@'
+-	 && cp[0] != '+' && cp[0] != ',')
+-    ++cp;
++  cp = _nl_find_language (*language);
+ 
+   if (*language == cp)
+     /* This does not make sense: language has to be specified.  Use
+--- lrzsz-0.12.20.safe/intl/finddomain.c	1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/finddomain.c	2004-09-12 14:40:34.415738968 -0400
+@@ -1,64 +1,40 @@
+ /* Handle list of needed message catalogs
+-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+-   Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
++   Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
++   Written by Ulrich Drepper <drepper@gnu.org>, 1995.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+ 
+-#include <ctype.h>
+-#include <errno.h>
+ #include <stdio.h>
+ #include <sys/types.h>
+-
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#else
+-# ifdef HAVE_MALLOC_H
+-#  include <malloc.h>
+-# else
+-void free ();
+-# endif
+-#endif
+-
+-#if defined HAVE_STRING_H || defined _LIBC
+-# include <string.h>
+-#else
+-# include <strings.h>
+-# ifndef memcpy
+-#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+-# endif
+-#endif
+-#if !HAVE_STRCHR && !defined _LIBC
+-# ifndef strchr
+-#  define strchr index
+-# endif
+-#endif
++#include <stdlib.h>
++#include <string.h>
+ 
+ #if defined HAVE_UNISTD_H || defined _LIBC
+ # include <unistd.h>
+ #endif
+ 
+-#include "gettext.h"
+ #include "gettextP.h"
+ #ifdef _LIBC
+ # include <libintl.h>
+ #else
+-# include "libgettext.h"
++# include "libgnuintl.h"
+ #endif
+ 
+ /* @@ end of prolog @@ */
+@@ -70,10 +46,9 @@
+    the DOMAINNAME and CATEGORY parameters with respect to the currently
+    established bindings.  */
+ struct loaded_l10nfile *
+-_nl_find_domain (dirname, locale, domainname)
+-     const char *dirname;
+-     char *locale;
+-     const char *domainname;
++internal_function
++_nl_find_domain (const char *dirname, char *locale,
++		 const char *domainname, struct binding *domainbinding)
+ {
+   struct loaded_l10nfile *retval;
+   const char *language;
+@@ -95,9 +70,9 @@
+ 
+ 	language[_territory][+audience][+special][,[sponsor][_revision]]
+ 
+-     Beside the first all of them are allowed to be missing.  If the
+-     full specified locale is not found, the less specific one are
+-     looked for.  The various part will be stripped of according to
++     Beside the first part all of them are allowed to be missing.  If
++     the full specified locale is not found, the less specific one are
++     looked for.  The various parts will be stripped off according to
+      the following order:
+ 		(1) revision
+ 		(2) sponsor
+@@ -119,7 +94,7 @@
+       int cnt;
+ 
+       if (retval->decided == 0)
+-	_nl_load_domain (retval);
++	_nl_load_domain (retval, domainbinding);
+ 
+       if (retval->data != NULL)
+ 	return retval;
+@@ -127,7 +102,7 @@
+       for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ 	{
+ 	  if (retval->successor[cnt]->decided == 0)
+-	    _nl_load_domain (retval->successor[cnt]);
++	    _nl_load_domain (retval->successor[cnt], domainbinding);
+ 
+ 	  if (retval->successor[cnt]->data != NULL)
+ 	    break;
+@@ -142,12 +117,18 @@
+   alias_value = _nl_expand_alias (locale);
+   if (alias_value != NULL)
+     {
++#if defined _LIBC || defined HAVE_STRDUP
++      locale = strdup (alias_value);
++      if (locale == NULL)
++	return NULL;
++#else
+       size_t len = strlen (alias_value) + 1;
+       locale = (char *) malloc (len);
+       if (locale == NULL)
+ 	return NULL;
+ 
+       memcpy (locale, alias_value, len);
++#endif
+     }
+ 
+   /* Now we determine the single parts of the locale name.  First
+@@ -168,14 +149,14 @@
+     return NULL;
+ 
+   if (retval->decided == 0)
+-    _nl_load_domain (retval);
++    _nl_load_domain (retval, domainbinding);
+   if (retval->data == NULL)
+     {
+       int cnt;
+       for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ 	{
+ 	  if (retval->successor[cnt]->decided == 0)
+-	    _nl_load_domain (retval->successor[cnt]);
++	    _nl_load_domain (retval->successor[cnt], domainbinding);
+ 	  if (retval->successor[cnt]->data != NULL)
+ 	    break;
+ 	}
+@@ -185,5 +166,27 @@
+   if (alias_value != NULL)
+     free (locale);
+ 
++  /* The space for normalized_codeset is dynamically allocated.  Free it.  */
++  if (mask & XPG_NORM_CODESET)
++    free ((void *) normalized_codeset);
++
+   return retval;
+ }
++
++
++#ifdef _LIBC
++libc_freeres_fn (free_mem)
++{
++  struct loaded_l10nfile *runp = _nl_loaded_domains;
++
++  while (runp != NULL)
++    {
++      struct loaded_l10nfile *here = runp;
++      if (runp->data != NULL)
++	_nl_unload_domain ((struct loaded_domain *) runp->data);
++      runp = runp->next;
++      free ((char *) here->filename);
++      free (here);
++    }
++}
++#endif
+--- lrzsz-0.12.20.safe/intl/gettext.c	1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/gettext.c	2004-09-12 14:40:34.420738208 -0400
+@@ -1,19 +1,20 @@
+-/* Implementation of gettext(3) function
+-   Copyright (C) 1995, 1997 Free Software Foundation, Inc.
++/* Implementation of gettext(3) function.
++   Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+@@ -23,21 +24,14 @@
+ # define __need_NULL
+ # include <stddef.h>
+ #else
+-# ifdef STDC_HEADERS
+-#  include <stdlib.h>		/* Just for NULL.  */
+-# else
+-#  ifdef HAVE_STRING_H
+-#   include <string.h>
+-#  else
+-#   define NULL ((void *) 0)
+-#  endif
+-# endif
++# include <stdlib.h>		/* Just for NULL.  */
+ #endif
+ 
++#include "gettextP.h"
+ #ifdef _LIBC
+ # include <libintl.h>
+ #else
+-# include "libgettext.h"
++# include "libgnuintl.h"
+ #endif
+ 
+ /* @@ end of prolog @@ */
+@@ -48,20 +42,19 @@
+    prefix.  So we have to make a difference here.  */
+ #ifdef _LIBC
+ # define GETTEXT __gettext
+-# define DGETTEXT __dgettext
++# define DCGETTEXT INTUSE(__dcgettext)
+ #else
+-# define GETTEXT gettext__
+-# define DGETTEXT dgettext__
++# define GETTEXT libintl_gettext
++# define DCGETTEXT libintl_dcgettext
+ #endif
+ 
+ /* Look up MSGID in the current default message catalog for the current
+    LC_MESSAGES locale.  If not found, returns MSGID itself (the default
+    text).  */
+ char *
+-GETTEXT (msgid)
+-     const char *msgid;
++GETTEXT (const char *msgid)
+ {
+-  return DGETTEXT (NULL, msgid);
++  return DCGETTEXT (NULL, msgid, LC_MESSAGES);
+ }
+ 
+ #ifdef _LIBC
+--- lrzsz-0.12.20.safe/intl/gettext.h	1998-04-26 09:22:35.000000000 -0400
++++ lrzsz-0.12.20/intl/gettext.h	1969-12-31 19:00:00.000000000 -0500
+@@ -1,105 +0,0 @@
+-/* Internal header for GNU gettext internationalization functions
+-   Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+-
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
+-   any later version.
+-
+-   This program is distributed in the hope that it will be useful,
+-   but WITHOUT ANY WARRANTY; without even the implied warranty of
+-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-   GNU General Public License for more details.
+-
+-   You should have received a copy of the GNU Library General Public
+-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+-   Boston, MA 02111-1307, USA.  */
+-
+-#ifndef _GETTEXT_H
+-#define _GETTEXT_H 1
+-
+-#include <stdio.h>
+-
+-#if HAVE_LIMITS_H || _LIBC
+-# include <limits.h>
+-#endif
+-
+-/* @@ end of prolog @@ */
+-
+-/* The magic number of the GNU message catalog format.  */
+-#define _MAGIC 0x950412de
+-#define _MAGIC_SWAPPED 0xde120495
+-
+-/* Revision number of the currently used .mo (binary) file format.  */
+-#define MO_REVISION_NUMBER 0
+-
+-/* The following contortions are an attempt to use the C preprocessor
+-   to determine an unsigned integral type that is 32 bits wide.  An
+-   alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
+-   doing that would require that the configure script compile and *run*
+-   the resulting executable.  Locally running cross-compiled executables
+-   is usually not possible.  */
+-
+-#if __STDC__
+-# define UINT_MAX_32_BITS 4294967295U
+-#else
+-# define UINT_MAX_32_BITS 0xFFFFFFFF
+-#endif
+-
+-/* If UINT_MAX isn't defined, assume it's a 32-bit type.
+-   This should be valid for all systems GNU cares about because
+-   that doesn't include 16-bit systems, and only modern systems
+-   (that certainly have <limits.h>) have 64+-bit integral types.  */
+-
+-#ifndef UINT_MAX
+-# define UINT_MAX UINT_MAX_32_BITS
+-#endif
+-
+-#if UINT_MAX == UINT_MAX_32_BITS
+-typedef unsigned nls_uint32;
+-#else
+-# if USHRT_MAX == UINT_MAX_32_BITS
+-typedef unsigned short nls_uint32;
+-# else
+-#  if ULONG_MAX == UINT_MAX_32_BITS
+-typedef unsigned long nls_uint32;
+-#  else
+-  /* The following line is intended to throw an error.  Using #error is
+-     not portable enough.  */
+-  "Cannot determine unsigned 32-bit data type."
+-#  endif
+-# endif
+-#endif
+-
+-
+-/* Header for binary .mo file format.  */
+-struct mo_file_header
+-{
+-  /* The magic number.  */
+-  nls_uint32 magic;
+-  /* The revision number of the file format.  */
+-  nls_uint32 revision;
+-  /* The number of strings pairs.  */
+-  nls_uint32 nstrings;
+-  /* Offset of table with start offsets of original strings.  */
+-  nls_uint32 orig_tab_offset;
+-  /* Offset of table with start offsets of translation strings.  */
+-  nls_uint32 trans_tab_offset;
+-  /* Size of hashing table.  */
+-  nls_uint32 hash_tab_size;
+-  /* Offset of first hashing entry.  */
+-  nls_uint32 hash_tab_offset;
+-};
+-
+-struct string_desc
+-{
+-  /* Length of addressed string.  */
+-  nls_uint32 length;
+-  /* Offset of string in file.  */
+-  nls_uint32 offset;
+-};
+-
+-/* @@ begin of epilog @@ */
+-
+-#endif	/* gettext.h  */
+--- lrzsz-0.12.20.safe/intl/gettextP.h	1998-04-26 09:22:35.000000000 -0400
++++ lrzsz-0.12.20/intl/gettextP.h	2004-09-12 14:40:34.426737296 -0400
+@@ -1,33 +1,53 @@
+-/* Header describing internals of gettext library
+-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++/* Header describing internals of libintl library.
++   Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
++   Written by Ulrich Drepper <drepper@cygnus.com>, 1995.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
+ 
+ #ifndef _GETTEXTP_H
+ #define _GETTEXTP_H
+ 
++#include <stddef.h>		/* Get size_t.  */
++
++#ifdef _LIBC
++# include "../iconv/gconv_int.h"
++#else
++# if HAVE_ICONV
++#  include <iconv.h>
++# endif
++#endif
++
+ #include "loadinfo.h"
+ 
++#include "gmo.h"		/* Get nls_uint32.  */
++
+ /* @@ end of prolog @@ */
+ 
+-#ifndef PARAMS
+-# if __STDC__
+-#  define PARAMS(args) args
+-# else
+-#  define PARAMS(args) ()
+-# endif
++#ifndef internal_function
++# define internal_function
++#endif
++
++#ifndef attribute_hidden
++# define attribute_hidden
++#endif
++
++/* Tell the compiler when a conditional or integer expression is
++   almost always true or almost always false.  */
++#ifndef HAVE_BUILTIN_EXPECT
++# define __builtin_expect(expr, val) (expr)
+ #endif
+ 
+ #ifndef W
+@@ -35,38 +55,160 @@
+ #endif
+ 
+ 
+-static nls_uint32 SWAP PARAMS ((nls_uint32 i));
+-
++#ifdef _LIBC
++# include <byteswap.h>
++# define SWAP(i) bswap_32 (i)
++#else
+ static inline nls_uint32
+ SWAP (i)
+      nls_uint32 i;
+ {
+   return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
+ }
++#endif
++
+ 
++/* In-memory representation of system dependent string.  */
++struct sysdep_string_desc
++{
++  /* Length of addressed string, including the trailing NUL.  */
++  size_t length;
++  /* Pointer to addressed string.  */
++  const char *pointer;
++};
+ 
++/* The representation of an opened message catalog.  */
+ struct loaded_domain
+ {
++  /* Pointer to memory containing the .mo file.  */
+   const char *data;
++  /* 1 if the memory is mmap()ed, 0 if the memory is malloc()ed.  */
++  int use_mmap;
++  /* Size of mmap()ed memory.  */
++  size_t mmap_size;
++  /* 1 if the .mo file uses a different endianness than this machine.  */
+   int must_swap;
++  /* Pointer to additional malloc()ed memory.  */
++  void *malloced;
++
++  /* Number of static strings pairs.  */
+   nls_uint32 nstrings;
+-  struct string_desc *orig_tab;
+-  struct string_desc *trans_tab;
++  /* Pointer to descriptors of original strings in the file.  */
++  const struct string_desc *orig_tab;
++  /* Pointer to descriptors of translated strings in the file.  */
++  const struct string_desc *trans_tab;
++
++  /* Number of system dependent strings pairs.  */
++  nls_uint32 n_sysdep_strings;
++  /* Pointer to descriptors of original sysdep strings.  */
++  const struct sysdep_string_desc *orig_sysdep_tab;
++  /* Pointer to descriptors of translated sysdep strings.  */
++  const struct sysdep_string_desc *trans_sysdep_tab;
++
++  /* Size of hash table.  */
+   nls_uint32 hash_size;
+-  nls_uint32 *hash_tab;
++  /* Pointer to hash table.  */
++  const nls_uint32 *hash_tab;
++  /* 1 if the hash table uses a different endianness than this machine.  */
++  int must_swap_hash_tab;
++
++  int codeset_cntr;
++#ifdef _LIBC
++  __gconv_t conv;
++#else
++# if HAVE_ICONV
++  iconv_t conv;
++# endif
++#endif
++  char **conv_tab;
++
++  struct expression *plural;
++  unsigned long int nplurals;
+ };
+ 
++/* We want to allocate a string at the end of the struct.  But ISO C
++   doesn't allow zero sized arrays.  */
++#ifdef __GNUC__
++# define ZERO 0
++#else
++# define ZERO 1
++#endif
++
++/* A set of settings bound to a message domain.  Used to store settings
++   from bindtextdomain() and bind_textdomain_codeset().  */
+ struct binding
+ {
+   struct binding *next;
+-  char *domainname;
+   char *dirname;
++  int codeset_cntr;	/* Incremented each time codeset changes.  */
++  char *codeset;
++  char domainname[ZERO];
+ };
+ 
+-struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
+-						 char *__locale,
+-						 const char *__domainname));
+-void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain));
++/* A counter which is incremented each time some previous translations
++   become invalid.
++   This variable is part of the external ABI of the GNU libintl.  */
++extern int _nl_msg_cat_cntr;
++
++#ifndef _LIBC
++const char *_nl_locale_name (int category, const char *categoryname);
++#endif
++
++struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
++					 const char *__domainname,
++					 struct binding *__domainbinding)
++     internal_function;
++void _nl_load_domain (struct loaded_l10nfile *__domain,
++		      struct binding *__domainbinding)
++     internal_function;
++void _nl_unload_domain (struct loaded_domain *__domain)
++     internal_function;
++const char *_nl_init_domain_conv (struct loaded_l10nfile *__domain_file,
++				  struct loaded_domain *__domain,
++				  struct binding *__domainbinding)
++     internal_function;
++void _nl_free_domain_conv (struct loaded_domain *__domain)
++     internal_function;
++
++char *_nl_find_msg (struct loaded_l10nfile *domain_file,
++		    struct binding *domainbinding, const char *msgid,
++		    size_t *lengthp)
++     internal_function;
++
++#ifdef _LIBC
++extern char *__gettext (const char *__msgid);
++extern char *__dgettext (const char *__domainname, const char *__msgid);
++extern char *__dcgettext (const char *__domainname, const char *__msgid,
++			  int __category);
++extern char *__ngettext (const char *__msgid1, const char *__msgid2,
++			 unsigned long int __n);
++extern char *__dngettext (const char *__domainname,
++			  const char *__msgid1, const char *__msgid2,
++			  unsigned long int n);
++extern char *__dcngettext (const char *__domainname,
++			   const char *__msgid1, const char *__msgid2,
++			   unsigned long int __n, int __category);
++extern char *__dcigettext (const char *__domainname,
++			   const char *__msgid1, const char *__msgid2,
++			   int __plural, unsigned long int __n,
++			   int __category);
++extern char *__textdomain (const char *__domainname);
++extern char *__bindtextdomain (const char *__domainname,
++			       const char *__dirname);
++extern char *__bind_textdomain_codeset (const char *__domainname,
++					const char *__codeset);
++#else
++/* Declare the exported libintl_* functions, in a way that allows us to
++   call them under their real name.  */
++# undef _INTL_REDIRECT_INLINE
++# undef _INTL_REDIRECT_MACROS
++# define _INTL_REDIRECT_MACROS
++# include "libgnuintl.h"
++extern char *libintl_dcigettext (const char *__domainname,
++				 const char *__msgid1, const char *__msgid2,
++				 int __plural, unsigned long int __n,
++				 int __category);
++#endif
+ 
+ /* @@ begin of epilog @@ */
+ 
+--- lrzsz-0.12.20.safe/intl/gmo.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/gmo.h	2004-09-12 14:40:34.431736536 -0400
+@@ -0,0 +1,149 @@
++/* Description of GNU message catalog format: general file layout.
++   Copyright (C) 1995, 1997, 2000-2002, 2004 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _GETTEXT_H
++#define _GETTEXT_H 1
++
++#include <limits.h>
++
++/* @@ end of prolog @@ */
++
++/* The magic number of the GNU message catalog format.  */
++#define _MAGIC 0x950412de
++#define _MAGIC_SWAPPED 0xde120495
++
++/* Revision number of the currently used .mo (binary) file format.  */
++#define MO_REVISION_NUMBER 0
++#define MO_REVISION_NUMBER_WITH_SYSDEP_I 1
++
++/* The following contortions are an attempt to use the C preprocessor
++   to determine an unsigned integral type that is 32 bits wide.  An
++   alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
++   as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
++   when cross-compiling.  */
++
++#if __STDC__
++# define UINT_MAX_32_BITS 4294967295U
++#else
++# define UINT_MAX_32_BITS 0xFFFFFFFF
++#endif
++
++/* If UINT_MAX isn't defined, assume it's a 32-bit type.
++   This should be valid for all systems GNU cares about because
++   that doesn't include 16-bit systems, and only modern systems
++   (that certainly have <limits.h>) have 64+-bit integral types.  */
++
++#ifndef UINT_MAX
++# define UINT_MAX UINT_MAX_32_BITS
++#endif
++
++#if UINT_MAX == UINT_MAX_32_BITS
++typedef unsigned nls_uint32;
++#else
++# if USHRT_MAX == UINT_MAX_32_BITS
++typedef unsigned short nls_uint32;
++# else
++#  if ULONG_MAX == UINT_MAX_32_BITS
++typedef unsigned long nls_uint32;
++#  else
++  /* The following line is intended to throw an error.  Using #error is
++     not portable enough.  */
++  "Cannot determine unsigned 32-bit data type."
++#  endif
++# endif
++#endif
++
++
++/* Header for binary .mo file format.  */
++struct mo_file_header
++{
++  /* The magic number.  */
++  nls_uint32 magic;
++  /* The revision number of the file format.  */
++  nls_uint32 revision;
++
++  /* The following are only used in .mo files with major revision 0 or 1.  */
++
++  /* The number of strings pairs.  */
++  nls_uint32 nstrings;
++  /* Offset of table with start offsets of original strings.  */
++  nls_uint32 orig_tab_offset;
++  /* Offset of table with start offsets of translated strings.  */
++  nls_uint32 trans_tab_offset;
++  /* Size of hash table.  */
++  nls_uint32 hash_tab_size;
++  /* Offset of first hash table entry.  */
++  nls_uint32 hash_tab_offset;
++
++  /* The following are only used in .mo files with minor revision >= 1.  */
++
++  /* The number of system dependent segments.  */
++  nls_uint32 n_sysdep_segments;
++  /* Offset of table describing system dependent segments.  */
++  nls_uint32 sysdep_segments_offset;
++  /* The number of system dependent strings pairs.  */
++  nls_uint32 n_sysdep_strings;
++  /* Offset of table with start offsets of original sysdep strings.  */
++  nls_uint32 orig_sysdep_tab_offset;
++  /* Offset of table with start offsets of translated sysdep strings.  */
++  nls_uint32 trans_sysdep_tab_offset;
++};
++
++/* Descriptor for static string contained in the binary .mo file.  */
++struct string_desc
++{
++  /* Length of addressed string, not including the trailing NUL.  */
++  nls_uint32 length;
++  /* Offset of string in file.  */
++  nls_uint32 offset;
++};
++
++/* The following are only used in .mo files with minor revision >= 1.  */
++
++/* Descriptor for system dependent string segment.  */
++struct sysdep_segment
++{
++  /* Length of addressed string, including the trailing NUL.  */
++  nls_uint32 length;
++  /* Offset of string in file.  */
++  nls_uint32 offset;
++};
++
++/* Descriptor for system dependent string.  */
++struct sysdep_string
++{
++  /* Offset of static string segments in file.  */
++  nls_uint32 offset;
++  /* Alternating sequence of static and system dependent segments.
++     The last segment is a static segment, including the trailing NUL.  */
++  struct segment_pair
++  {
++    /* Size of static segment.  */
++    nls_uint32 segsize;
++    /* Reference to system dependent string segment, or ~0 at the end.  */
++    nls_uint32 sysdepref;
++  } segments[1];
++};
++
++/* Marker for the end of the segments[] array.  This has the value 0xFFFFFFFF,
++   regardless whether 'int' is 16 bit, 32 bit, or 64 bit.  */
++#define SEGMENTS_END ((nls_uint32) ~0)
++
++/* @@ begin of epilog @@ */
++
++#endif	/* gettext.h  */
+--- lrzsz-0.12.20.safe/intl/hash-string.h	1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/hash-string.h	2004-09-12 14:40:34.436735776 -0400
+@@ -1,35 +1,23 @@
+-/* Implements a string hashing function.
+-   Copyright (C) 1995, 1997 Free Software Foundation, Inc.
++/* Description of GNU message catalog format: string hashing function.
++   Copyright (C) 1995, 1997-1998, 2000-2003 Free Software Foundation, Inc.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+    You should have received a copy of the GNU Library General Public
+-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+-   Boston, MA 02111-1307, USA.  */
+-
+-#ifdef HAVE_VALUES_H
+-# include <values.h>
+-#endif
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
+ 
+ /* @@ end of prolog @@ */
+ 
+-#ifndef PARAMS
+-# if __STDC__
+-#  define PARAMS(Args) Args
+-# else
+-#  define PARAMS(Args) ()
+-# endif
+-#endif
+-
+ /* We assume to have `unsigned long int' value with at least 32 bits.  */
+ #define HASHWORDBITS 32
+ 
+@@ -37,11 +25,8 @@
+ /* Defines the so called `hashpjw' function by P.J. Weinberger
+    [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
+    1986, 1987 Bell Telephone Laboratories, Inc.]  */
+-static unsigned long hash_string PARAMS ((const char *__str_param));
+-
+-static inline unsigned long
+-hash_string (str_param)
+-     const char *str_param;
++static inline unsigned long int
++hash_string (const char *str_param)
+ {
+   unsigned long int hval, g;
+   const char *str = str_param;
+@@ -51,8 +36,8 @@
+   while (*str != '\0')
+     {
+       hval <<= 4;
+-      hval += (unsigned long) *str++;
+-      g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4));
++      hval += (unsigned char) *str++;
++      g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4));
+       if (g != 0)
+ 	{
+ 	  hval ^= g >> (HASHWORDBITS - 8);
+--- lrzsz-0.12.20.safe/intl/intl-compat.c	1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/intl-compat.c	2004-09-12 14:40:34.441735016 -0400
+@@ -1,76 +1,131 @@
+ /* intl-compat.c - Stub functions to call gettext functions from GNU gettext
+    Library.
+-   Copyright (C) 1995 Software Foundation, Inc.
++   Copyright (C) 1995, 2000-2003 Software Foundation, Inc.
+ 
+-This program is free software; you can redistribute it and/or modify
+-it under the terms of the GNU General Public License as published by
+-the Free Software Foundation; either version 2, or (at your option)
+-any later version.
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
+ 
+-This program is distributed in the hope that 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.
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-You should have received a copy of the GNU General Public License
+-along with this program; if not, write to the Free Software
+-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+ 
+-#include "libgettext.h"
++#include "gettextP.h"
+ 
+ /* @@ end of prolog @@ */
+ 
++/* This file redirects the gettext functions (without prefix) to those
++   defined in the included GNU libintl library (with "libintl_" prefix).
++   It is compiled into libintl in order to make the AM_GNU_GETTEXT test
++   of gettext <= 0.11.2 work with the libintl library >= 0.11.3 which
++   has the redirections primarily in the <libintl.h> include file.
++   It is also compiled into libgnuintl so that libgnuintl.so can be used
++   as LD_PRELOADable library on glibc systems, to provide the extra
++   features that the functions in the libc don't have (namely, logging).  */
++
+ 
+ #undef gettext
+ #undef dgettext
+ #undef dcgettext
++#undef ngettext
++#undef dngettext
++#undef dcngettext
+ #undef textdomain
+ #undef bindtextdomain
++#undef bind_textdomain_codeset
++
++
++/* When building a DLL, we must export some functions.  Note that because
++   the functions are only defined for binary backward compatibility, we
++   don't need to use __declspec(dllimport) in any case.  */
++#if defined _MSC_VER && BUILDING_DLL
++# define DLL_EXPORTED __declspec(dllexport)
++#else
++# define DLL_EXPORTED
++#endif
+ 
+ 
++DLL_EXPORTED
+ char *
+-bindtextdomain (domainname, dirname)
+-     const char *domainname;
+-     const char *dirname;
++gettext (const char *msgid)
+ {
+-  return bindtextdomain__ (domainname, dirname);
++  return libintl_gettext (msgid);
+ }
+ 
+ 
++DLL_EXPORTED
+ char *
+-dcgettext (domainname, msgid, category)
+-     const char *domainname;
+-     const char *msgid;
+-     int category;
++dgettext (const char *domainname, const char *msgid)
+ {
+-  return dcgettext__ (domainname, msgid, category);
++  return libintl_dgettext (domainname, msgid);
+ }
+ 
+ 
++DLL_EXPORTED
+ char *
+-dgettext (domainname, msgid)
+-     const char *domainname;
+-     const char *msgid;
++dcgettext (const char *domainname, const char *msgid, int category)
+ {
+-  return dgettext__ (domainname, msgid);
++  return libintl_dcgettext (domainname, msgid, category);
+ }
+ 
+ 
++DLL_EXPORTED
+ char *
+-gettext (msgid)
+-     const char *msgid;
++ngettext (const char *msgid1, const char *msgid2, unsigned long int n)
+ {
+-  return gettext__ (msgid);
++  return libintl_ngettext (msgid1, msgid2, n);
+ }
+ 
+ 
++DLL_EXPORTED
+ char *
+-textdomain (domainname)
+-     const char *domainname;
++dngettext (const char *domainname,
++	   const char *msgid1, const char *msgid2, unsigned long int n)
+ {
+-  return textdomain__ (domainname);
++  return libintl_dngettext (domainname, msgid1, msgid2, n);
++}
++
++
++DLL_EXPORTED
++char *
++dcngettext (const char *domainname,
++	    const char *msgid1, const char *msgid2, unsigned long int n,
++	    int category)
++{
++  return libintl_dcngettext (domainname, msgid1, msgid2, n, category);
++}
++
++
++DLL_EXPORTED
++char *
++textdomain (const char *domainname)
++{
++  return libintl_textdomain (domainname);
++}
++
++
++DLL_EXPORTED
++char *
++bindtextdomain (const char *domainname, const char *dirname)
++{
++  return libintl_bindtextdomain (domainname, dirname);
++}
++
++
++DLL_EXPORTED
++char *
++bind_textdomain_codeset (const char *domainname, const char *codeset)
++{
++  return libintl_bind_textdomain_codeset (domainname, codeset);
+ }
+--- lrzsz-0.12.20.safe/intl/l10nflist.c	1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/l10nflist.c	2004-09-12 14:40:34.457732584 -0400
+@@ -1,52 +1,40 @@
+-/* Handle list of needed message catalogs
+-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+-   Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
++/* Copyright (C) 1995-1999, 2000-2003 Free Software Foundation, Inc.
++   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* Tell glibc's <string.h> to provide a prototype for stpcpy().
++   This must come before <config.h> because <config.h> may include
++   <features.h>, and once <features.h> has been included, it's too late.  */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE	1
++#endif
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+ 
+-
+-#if defined HAVE_STRING_H || defined _LIBC
+-# ifndef _GNU_SOURCE
+-#  define _GNU_SOURCE	1
+-# endif
+-# include <string.h>
+-#else
+-# include <strings.h>
+-# ifndef memcpy
+-#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+-# endif
+-#endif
+-#if !HAVE_STRCHR && !defined _LIBC
+-# ifndef strchr
+-#  define strchr index
+-# endif
+-#endif
++#include <string.h>
+ 
+ #if defined _LIBC || defined HAVE_ARGZ_H
+ # include <argz.h>
+ #endif
+ #include <ctype.h>
+ #include <sys/types.h>
+-
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#endif
++#include <stdlib.h>
+ 
+ #include "loadinfo.h"
+ 
+@@ -65,23 +53,39 @@
+ /* Rename the non ANSI C functions.  This is required by the standard
+    because some ANSI C functions will require linking with this object
+    file and the name space must not be polluted.  */
+-# define stpcpy(dest, src) __stpcpy(dest, src)
++# ifndef stpcpy
++#  define stpcpy(dest, src) __stpcpy(dest, src)
++# endif
+ #else
+ # ifndef HAVE_STPCPY
+-static char *stpcpy PARAMS ((char *dest, const char *src));
++static char *stpcpy (char *dest, const char *src);
+ # endif
+ #endif
+ 
++/* Pathname support.
++   ISSLASH(C)           tests whether C is a directory separator character.
++   IS_ABSOLUTE_PATH(P)  tests whether P is an absolute path.  If it is not,
++                        it may be concatenated to a directory pathname.
++ */
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++  /* Win32, OS/2, DOS */
++# define ISSLASH(C) ((C) == '/' || (C) == '\\')
++# define HAS_DEVICE(P) \
++    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
++     && (P)[1] == ':')
++# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
++#else
++  /* Unix */
++# define ISSLASH(C) ((C) == '/')
++# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
++#endif
++
+ /* Define function which are usually not available.  */
+ 
+ #if !defined _LIBC && !defined HAVE___ARGZ_COUNT
+ /* Returns the number of strings in ARGZ.  */
+-static size_t argz_count__ PARAMS ((const char *argz, size_t len));
+-
+ static size_t
+-argz_count__ (argz, len)
+-     const char *argz;
+-     size_t len;
++argz_count__ (const char *argz, size_t len)
+ {
+   size_t count = 0;
+   while (len > 0)
+@@ -95,18 +99,17 @@
+ }
+ # undef __argz_count
+ # define __argz_count(argz, len) argz_count__ (argz, len)
++#else
++# ifdef _LIBC
++#  define __argz_count(argz, len) INTUSE(__argz_count) (argz, len)
++# endif
+ #endif	/* !_LIBC && !HAVE___ARGZ_COUNT */
+ 
+ #if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
+ /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+    except the last into the character SEP.  */
+-static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
+-
+ static void
+-argz_stringify__ (argz, len, sep)
+-     char *argz;
+-     size_t len;
+-     int sep;
++argz_stringify__ (char *argz, size_t len, int sep)
+ {
+   while (len > 0)
+     {
+@@ -119,17 +122,16 @@
+ }
+ # undef __argz_stringify
+ # define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
++#else
++# ifdef _LIBC
++#  define __argz_stringify(argz, len, sep) \
++  INTUSE(__argz_stringify) (argz, len, sep)
++# endif
+ #endif	/* !_LIBC && !HAVE___ARGZ_STRINGIFY */
+ 
+ #if !defined _LIBC && !defined HAVE___ARGZ_NEXT
+-static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
+-				  const char *entry));
+-
+ static char *
+-argz_next__ (argz, argz_len, entry)
+-     char *argz;
+-     size_t argz_len;
+-     const char *entry;
++argz_next__ (char *argz, size_t argz_len, const char *entry)
+ {
+   if (entry)
+     {
+@@ -150,11 +152,8 @@
+ 
+ 
+ /* Return number of bits set in X.  */
+-static int pop PARAMS ((int x));
+-
+ static inline int
+-pop (x)
+-     int x;
++pop (int x)
+ {
+   /* We assume that no more than 16 bits are used.  */
+   x = ((x & ~0x5555) >> 1) + (x & 0x5555);
+@@ -167,31 +166,27 @@
+ 
+ 
+ struct loaded_l10nfile *
+-_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
+-		    territory, codeset, normalized_codeset, modifier, special,
+-		    sponsor, revision, filename, do_allocate)
+-     struct loaded_l10nfile **l10nfile_list;
+-     const char *dirlist;
+-     size_t dirlist_len;
+-     int mask;
+-     const char *language;
+-     const char *territory;
+-     const char *codeset;
+-     const char *normalized_codeset;
+-     const char *modifier;
+-     const char *special;
+-     const char *sponsor;
+-     const char *revision;
+-     const char *filename;
+-     int do_allocate;
++_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
++		    const char *dirlist, size_t dirlist_len,
++		    int mask, const char *language, const char *territory,
++		    const char *codeset, const char *normalized_codeset,
++		    const char *modifier, const char *special,
++		    const char *sponsor, const char *revision,
++		    const char *filename, int do_allocate)
+ {
+   char *abs_filename;
+-  struct loaded_l10nfile *last = NULL;
++  struct loaded_l10nfile **lastp;
+   struct loaded_l10nfile *retval;
+   char *cp;
++  size_t dirlist_count;
+   size_t entries;
+   int cnt;
+ 
++  /* If LANGUAGE contains an absolute directory specification, we ignore
++     DIRLIST.  */
++  if (IS_ABSOLUTE_PATH (language))
++    dirlist_len = 0;
++
+   /* Allocate room for the full file name.  */
+   abs_filename = (char *) malloc (dirlist_len
+ 				  + strlen (language)
+@@ -209,7 +204,7 @@
+ 				  + (((mask & CEN_SPONSOR) != 0
+ 				      || (mask & CEN_REVISION) != 0)
+ 				     ? (1 + ((mask & CEN_SPONSOR) != 0
+-					     ? strlen (sponsor) + 1 : 0)
++					     ? strlen (sponsor) : 0)
+ 					+ ((mask & CEN_REVISION) != 0
+ 					   ? strlen (revision) + 1 : 0)) : 0)
+ 				  + 1 + strlen (filename) + 1);
+@@ -217,14 +212,16 @@
+   if (abs_filename == NULL)
+     return NULL;
+ 
+-  retval = NULL;
+-  last = NULL;
+-
+   /* Construct file name.  */
+-  memcpy (abs_filename, dirlist, dirlist_len);
+-  __argz_stringify (abs_filename, dirlist_len, ':');
+-  cp = abs_filename + (dirlist_len - 1);
+-  *cp++ = '/';
++  cp = abs_filename;
++  if (dirlist_len > 0)
++    {
++      memcpy (cp, dirlist, dirlist_len);
++      __argz_stringify (cp, dirlist_len, PATH_SEPARATOR);
++      cp += dirlist_len;
++      cp[-1] = '/';
++    }
++
+   cp = stpcpy (cp, language);
+ 
+   if ((mask & TERRITORY) != 0)
+@@ -271,7 +268,7 @@
+ 
+   /* Look in list of already loaded domains whether it is already
+      available.  */
+-  last = NULL;
++  lastp = l10nfile_list;
+   for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
+     if (retval->filename != NULL)
+       {
+@@ -286,7 +283,7 @@
+ 	    break;
+ 	  }
+ 
+-	last = retval;
++	lastp = &retval->next;
+       }
+ 
+   if (retval != NULL || do_allocate == 0)
+@@ -295,48 +292,66 @@
+       return retval;
+     }
+ 
+-  retval = (struct loaded_l10nfile *)
+-    malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
+-				* (1 << pop (mask))
+-				* sizeof (struct loaded_l10nfile *)));
++  dirlist_count = (dirlist_len > 0 ? __argz_count (dirlist, dirlist_len) : 1);
++
++  /* Allocate a new loaded_l10nfile.  */
++  retval =
++    (struct loaded_l10nfile *)
++    malloc (sizeof (*retval)
++	    + (((dirlist_count << pop (mask)) + (dirlist_count > 1 ? 1 : 0))
++	       * sizeof (struct loaded_l10nfile *)));
+   if (retval == NULL)
+     return NULL;
+ 
+   retval->filename = abs_filename;
+-  retval->decided = (__argz_count (dirlist, dirlist_len) != 1
++
++  /* We set retval->data to NULL here; it is filled in later.
++     Setting retval->decided to 1 here means that retval does not
++     correspond to a real file (dirlist_count > 1) or is not worth
++     looking up (if an unnormalized codeset was specified).  */
++  retval->decided = (dirlist_count > 1
+ 		     || ((mask & XPG_CODESET) != 0
+ 			 && (mask & XPG_NORM_CODESET) != 0));
+   retval->data = NULL;
+ 
+-  if (last == NULL)
+-    {
+-      retval->next = *l10nfile_list;
+-      *l10nfile_list = retval;
+-    }
+-  else
+-    {
+-      retval->next = last->next;
+-      last->next = retval;
+-    }
++  retval->next = *lastp;
++  *lastp = retval;
+ 
+   entries = 0;
+-  /* If the DIRLIST is a real list the RETVAL entry corresponds not to
+-     a real file.  So we have to use the DIRLIST separation mechanism
+-     of the inner loop.  */
+-  cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
+-  for (; cnt >= 0; --cnt)
++  /* Recurse to fill the inheritance list of RETVAL.
++     If the DIRLIST is a real list (i.e. DIRLIST_COUNT > 1), the RETVAL
++     entry does not correspond to a real file; retval->filename contains
++     colons.  In this case we loop across all elements of DIRLIST and
++     across all bit patterns dominated by MASK.
++     If the DIRLIST is a single directory or entirely redundant (i.e.
++     DIRLIST_COUNT == 1), we loop across all bit patterns dominated by
++     MASK, excluding MASK itself.
++     In either case, we loop down from MASK to 0.  This has the effect
++     that the extra bits in the locale name are dropped in this order:
++     first the modifier, then the territory, then the codeset, then the
++     normalized_codeset.  */
++  for (cnt = dirlist_count > 1 ? mask : mask - 1; cnt >= 0; --cnt)
+     if ((cnt & ~mask) == 0
+ 	&& ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
+ 	&& ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
+       {
+-	/* Iterate over all elements of the DIRLIST.  */
+-	char *dir = NULL;
++	if (dirlist_count > 1)
++	  {
++	    /* Iterate over all elements of the DIRLIST.  */
++	    char *dir = NULL;
+ 
+-	while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
+-	       != NULL)
++	    while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
++		   != NULL)
++	      retval->successor[entries++]
++		= _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1,
++				      cnt, language, territory, codeset,
++				      normalized_codeset, modifier, special,
++				      sponsor, revision, filename, 1);
++	  }
++	else
+ 	  retval->successor[entries++]
+-	    = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
+-				  language, territory, codeset,
++	    = _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len,
++				  cnt, language, territory, codeset,
+ 				  normalized_codeset, modifier, special,
+ 				  sponsor, revision, filename, 1);
+       }
+@@ -347,11 +362,10 @@
+ 
+ /* Normalize codeset name.  There is no standard for the codeset
+    names.  Normalization allows the user to use any of the common
+-   names.  */
++   names.  The return value is dynamically allocated and has to be
++   freed by the caller.  */
+ const char *
+-_nl_normalize_codeset (codeset, name_len)
+-     const char *codeset;
+-     size_t name_len;
++_nl_normalize_codeset (const char *codeset, size_t name_len)
+ {
+   int len = 0;
+   int only_digit = 1;
+@@ -360,11 +374,11 @@
+   size_t cnt;
+ 
+   for (cnt = 0; cnt < name_len; ++cnt)
+-    if (isalnum (codeset[cnt]))
++    if (isalnum ((unsigned char) codeset[cnt]))
+       {
+ 	++len;
+ 
+-	if (isalpha (codeset[cnt]))
++	if (isalpha ((unsigned char) codeset[cnt]))
+ 	  only_digit = 0;
+       }
+ 
+@@ -378,9 +392,9 @@
+ 	wp = retval;
+ 
+       for (cnt = 0; cnt < name_len; ++cnt)
+-	if (isalpha (codeset[cnt]))
+-	  *wp++ = tolower (codeset[cnt]);
+-	else if (isdigit (codeset[cnt]))
++	if (isalpha ((unsigned char) codeset[cnt]))
++	  *wp++ = tolower ((unsigned char) codeset[cnt]);
++	else if (isdigit ((unsigned char) codeset[cnt]))
+ 	  *wp++ = codeset[cnt];
+ 
+       *wp = '\0';
+@@ -398,9 +412,7 @@
+    to be defined.  */
+ #if !_LIBC && !HAVE_STPCPY
+ static char *
+-stpcpy (dest, src)
+-     char *dest;
+-     const char *src;
++stpcpy (char *dest, const char *src)
+ {
+   while ((*dest++ = *src++) != '\0')
+     /* Do nothing. */ ;
+--- lrzsz-0.12.20.safe/intl/libgettext.h	1998-04-26 09:22:36.000000000 -0400
++++ lrzsz-0.12.20/intl/libgettext.h	1969-12-31 19:00:00.000000000 -0500
+@@ -1,182 +0,0 @@
+-/* Message catalogs for internationalization.
+-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+-
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
+-   any later version.
+-
+-   This program is distributed in the hope that it will be useful,
+-   but WITHOUT ANY WARRANTY; without even the implied warranty of
+-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-   GNU General Public License for more details.
+-
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+-
+-/* Because on some systems (e.g. Solaris) we sometimes have to include
+-   the systems libintl.h as well as this file we have more complex
+-   include protection above.  But the systems header might perhaps also
+-   define _LIBINTL_H and therefore we have to protect the definition here.  */
+-
+-#if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H)
+-#if !defined (_LIBINTL_H)
+-# define _LIBINTL_H	1
+-#endif
+-#define _LIBGETTEXT_H	1
+-
+-/* We define an additional symbol to signal that we use the GNU
+-   implementation of gettext.  */
+-#define __USE_GNU_GETTEXT 1
+-
+-#include <sys/types.h>
+-
+-#if HAVE_LOCALE_H
+-# include <locale.h>
+-#endif
+-
+-
+-#ifdef __cplusplus
+-extern "C" {
+-#endif
+-
+-/* @@ end of prolog @@ */
+-
+-#ifndef PARAMS
+-# if __STDC__
+-#  define PARAMS(args) args
+-# else
+-#  define PARAMS(args) ()
+-# endif
+-#endif
+-
+-#ifndef NULL
+-# if !defined __cplusplus || defined __GNUC__
+-#  define NULL ((void *) 0)
+-# else
+-#  define NULL (0)
+-# endif
+-#endif
+-
+-#if !HAVE_LC_MESSAGES
+-/* This value determines the behaviour of the gettext() and dgettext()
+-   function.  But some system does not have this defined.  Define it
+-   to a default value.  */
+-# define LC_MESSAGES (-1)
+-#endif
+-
+-
+-/* Declarations for gettext-using-catgets interface.  Derived from
+-   Jim Meyering's libintl.h.  */
+-struct _msg_ent
+-{
+-  const char *_msg;
+-  int _msg_number;
+-};
+-
+-
+-#if HAVE_CATGETS
+-/* These two variables are defined in the automatically by po-to-tbl.sed
+-   generated file `cat-id-tbl.c'.  */
+-extern const struct _msg_ent _msg_tbl[];
+-extern int _msg_tbl_length;
+-#endif
+-
+-
+-/* For automatical extraction of messages sometimes no real
+-   translation is needed.  Instead the string itself is the result.  */
+-#define gettext_noop(Str) (Str)
+-
+-/* Look up MSGID in the current default message catalog for the current
+-   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
+-   text).  */
+-extern char *gettext PARAMS ((const char *__msgid));
+-extern char *gettext__ PARAMS ((const char *__msgid));
+-
+-/* Look up MSGID in the DOMAINNAME message catalog for the current
+-   LC_MESSAGES locale.  */
+-extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
+-extern char *dgettext__ PARAMS ((const char *__domainname,
+-				 const char *__msgid));
+-
+-/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+-   locale.  */
+-extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
+-				int __category));
+-extern char *dcgettext__ PARAMS ((const char *__domainname,
+-				  const char *__msgid, int __category));
+-
+-
+-/* Set the current default message catalog to DOMAINNAME.
+-   If DOMAINNAME is null, return the current default.
+-   If DOMAINNAME is "", reset to the default of "messages".  */
+-extern char *textdomain PARAMS ((const char *__domainname));
+-extern char *textdomain__ PARAMS ((const char *__domainname));
+-
+-/* Specify that the DOMAINNAME message catalog will be found
+-   in DIRNAME rather than in the system locale data base.  */
+-extern char *bindtextdomain PARAMS ((const char *__domainname,
+-				  const char *__dirname));
+-extern char *bindtextdomain__ PARAMS ((const char *__domainname,
+-				    const char *__dirname));
+-
+-#if ENABLE_NLS
+-
+-/* Solaris 2.3 has the gettext function but dcgettext is missing.
+-   So we omit this optimization for Solaris 2.3.  BTW, Solaris 2.4
+-   has dcgettext.  */
+-# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
+-
+-#  define gettext(Msgid)						      \
+-     dgettext (NULL, Msgid)
+-
+-#  define dgettext(Domainname, Msgid)					      \
+-     dcgettext (Domainname, Msgid, LC_MESSAGES)
+-
+-#  if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7
+-/* This global variable is defined in loadmsgcat.c.  We need a sign,
+-   whether a new catalog was loaded, which can be associated with all
+-   translations.  */
+-extern int _nl_msg_cat_cntr;
+-
+-#   define dcgettext(Domainname, Msgid, Category)			      \
+-  (__extension__							      \
+-   ({									      \
+-     char *__result;							      \
+-     if (__builtin_constant_p (Msgid))					      \
+-       {								      \
+-	 static char *__translation__;					      \
+-	 static int __catalog_counter__;				      \
+-	 if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr)    \
+-	   {								      \
+-	     __translation__ =						      \
+-	       dcgettext__ (Domainname, Msgid, Category);		      \
+-	     __catalog_counter__ = _nl_msg_cat_cntr;			      \
+-	   }								      \
+-	 __result = __translation__;					      \
+-       }								      \
+-     else								      \
+-       __result = dcgettext__ (Domainname, Msgid, Category);		      \
+-     __result;								      \
+-    }))
+-#  endif
+-# endif
+-
+-#else
+-
+-# define gettext(Msgid) (Msgid)
+-# define dgettext(Domainname, Msgid) (Msgid)
+-# define dcgettext(Domainname, Msgid, Category) (Msgid)
+-# define textdomain(Domainname) while (0) /* nothing */
+-# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
+-
+-#endif
+-
+-/* @@ begin of epilog @@ */
+-
+-#ifdef __cplusplus
+-}
+-#endif
+-
+-#endif
+--- lrzsz-0.12.20.safe/intl/libgnuintl.h.in	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/libgnuintl.h.in	2004-09-12 14:40:34.462731824 -0400
+@@ -0,0 +1,383 @@
++/* Message catalogs for internationalization.
++   Copyright (C) 1995-1997, 2000-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _LIBINTL_H
++#define _LIBINTL_H	1
++
++#include <locale.h>
++
++/* The LC_MESSAGES locale category is the category used by the functions
++   gettext() and dgettext().  It is specified in POSIX, but not in ANSI C.
++   On systems that don't define it, use an arbitrary value instead.
++   On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
++   then includes <libintl.h> (i.e. this file!) and then only defines
++   LC_MESSAGES.  To avoid a redefinition warning, don't define LC_MESSAGES
++   in this case.  */
++#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
++# define LC_MESSAGES 1729
++#endif
++
++/* We define an additional symbol to signal that we use the GNU
++   implementation of gettext.  */
++#define __USE_GNU_GETTEXT 1
++
++/* Provide information about the supported file formats.  Returns the
++   maximum minor revision number supported for a given major revision.  */
++#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
++  ((major) == 0 ? 1 : -1)
++
++/* Resolve a platform specific conflict on DJGPP.  GNU gettext takes
++   precedence over _conio_gettext.  */
++#ifdef __DJGPP__
++# undef gettext
++#endif
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++/* We redirect the functions to those prefixed with "libintl_".  This is
++   necessary, because some systems define gettext/textdomain/... in the C
++   library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
++   If we used the unprefixed names, there would be cases where the
++   definition in the C library would override the one in the libintl.so
++   shared library.  Recall that on ELF systems, the symbols are looked
++   up in the following order:
++     1. in the executable,
++     2. in the shared libraries specified on the link command line, in order,
++     3. in the dependencies of the shared libraries specified on the link
++        command line,
++     4. in the dlopen()ed shared libraries, in the order in which they were
++        dlopen()ed.
++   The definition in the C library would override the one in libintl.so if
++   either
++     * -lc is given on the link command line and -lintl isn't, or
++     * -lc is given on the link command line before -lintl, or
++     * libintl.so is a dependency of a dlopen()ed shared library but not
++       linked to the executable at link time.
++   Since Solaris gettext() behaves differently than GNU gettext(), this
++   would be unacceptable.
++
++   The redirection happens by default through macros in C, so that &gettext
++   is independent of the compilation unit, but through inline functions in
++   C++, in order not to interfere with the name mangling of class fields or
++   class methods called 'gettext'.  */
++
++/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
++   If he doesn't, we choose the method.  A third possible method is
++   _INTL_REDIRECT_ASM, supported only by GCC.  */
++#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
++# if __GNUC__ >= 2 && !defined __APPLE_CC__ && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
++#  define _INTL_REDIRECT_ASM
++# else
++#  ifdef __cplusplus
++#   define _INTL_REDIRECT_INLINE
++#  else
++#   define _INTL_REDIRECT_MACROS
++#  endif
++# endif
++#endif
++/* Auxiliary macros.  */
++#ifdef _INTL_REDIRECT_ASM
++# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
++# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
++# define _INTL_STRINGIFY(prefix) #prefix
++#else
++# define _INTL_ASM(cname)
++#endif
++
++/* Look up MSGID in the current default message catalog for the current
++   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
++   text).  */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_gettext (const char *__msgid);
++static inline char *gettext (const char *__msgid)
++{
++  return libintl_gettext (__msgid);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define gettext libintl_gettext
++#endif
++extern char *gettext (const char *__msgid)
++       _INTL_ASM (libintl_gettext);
++#endif
++
++/* Look up MSGID in the DOMAINNAME message catalog for the current
++   LC_MESSAGES locale.  */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_dgettext (const char *__domainname, const char *__msgid);
++static inline char *dgettext (const char *__domainname, const char *__msgid)
++{
++  return libintl_dgettext (__domainname, __msgid);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define dgettext libintl_dgettext
++#endif
++extern char *dgettext (const char *__domainname, const char *__msgid)
++       _INTL_ASM (libintl_dgettext);
++#endif
++
++/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
++   locale.  */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
++				int __category);
++static inline char *dcgettext (const char *__domainname, const char *__msgid,
++			       int __category)
++{
++  return libintl_dcgettext (__domainname, __msgid, __category);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define dcgettext libintl_dcgettext
++#endif
++extern char *dcgettext (const char *__domainname, const char *__msgid,
++			int __category)
++       _INTL_ASM (libintl_dcgettext);
++#endif
++
++
++/* Similar to `gettext' but select the plural form corresponding to the
++   number N.  */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
++			       unsigned long int __n);
++static inline char *ngettext (const char *__msgid1, const char *__msgid2,
++			      unsigned long int __n)
++{
++  return libintl_ngettext (__msgid1, __msgid2, __n);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define ngettext libintl_ngettext
++#endif
++extern char *ngettext (const char *__msgid1, const char *__msgid2,
++		       unsigned long int __n)
++       _INTL_ASM (libintl_ngettext);
++#endif
++
++/* Similar to `dgettext' but select the plural form corresponding to the
++   number N.  */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
++				const char *__msgid2, unsigned long int __n);
++static inline char *dngettext (const char *__domainname, const char *__msgid1,
++			       const char *__msgid2, unsigned long int __n)
++{
++  return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define dngettext libintl_dngettext
++#endif
++extern char *dngettext (const char *__domainname,
++			const char *__msgid1, const char *__msgid2,
++			unsigned long int __n)
++       _INTL_ASM (libintl_dngettext);
++#endif
++
++/* Similar to `dcgettext' but select the plural form corresponding to the
++   number N.  */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_dcngettext (const char *__domainname,
++				 const char *__msgid1, const char *__msgid2,
++				 unsigned long int __n, int __category);
++static inline char *dcngettext (const char *__domainname,
++				const char *__msgid1, const char *__msgid2,
++				unsigned long int __n, int __category)
++{
++  return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define dcngettext libintl_dcngettext
++#endif
++extern char *dcngettext (const char *__domainname,
++			 const char *__msgid1, const char *__msgid2,
++			 unsigned long int __n, int __category)
++       _INTL_ASM (libintl_dcngettext);
++#endif
++
++
++/* Set the current default message catalog to DOMAINNAME.
++   If DOMAINNAME is null, return the current default.
++   If DOMAINNAME is "", reset to the default of "messages".  */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_textdomain (const char *__domainname);
++static inline char *textdomain (const char *__domainname)
++{
++  return libintl_textdomain (__domainname);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define textdomain libintl_textdomain
++#endif
++extern char *textdomain (const char *__domainname)
++       _INTL_ASM (libintl_textdomain);
++#endif
++
++/* Specify that the DOMAINNAME message catalog will be found
++   in DIRNAME rather than in the system locale data base.  */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_bindtextdomain (const char *__domainname,
++				     const char *__dirname);
++static inline char *bindtextdomain (const char *__domainname,
++				    const char *__dirname)
++{
++  return libintl_bindtextdomain (__domainname, __dirname);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define bindtextdomain libintl_bindtextdomain
++#endif
++extern char *bindtextdomain (const char *__domainname, const char *__dirname)
++       _INTL_ASM (libintl_bindtextdomain);
++#endif
++
++/* Specify the character encoding in which the messages from the
++   DOMAINNAME message catalog will be returned.  */
++#ifdef _INTL_REDIRECT_INLINE
++extern char *libintl_bind_textdomain_codeset (const char *__domainname,
++					      const char *__codeset);
++static inline char *bind_textdomain_codeset (const char *__domainname,
++					     const char *__codeset)
++{
++  return libintl_bind_textdomain_codeset (__domainname, __codeset);
++}
++#else
++#ifdef _INTL_REDIRECT_MACROS
++# define bind_textdomain_codeset libintl_bind_textdomain_codeset
++#endif
++extern char *bind_textdomain_codeset (const char *__domainname,
++				      const char *__codeset)
++       _INTL_ASM (libintl_bind_textdomain_codeset);
++#endif
++
++
++/* Support for format strings with positions in *printf(), following the
++   POSIX/XSI specification.
++   Note: These replacements for the *printf() functions are visible only
++   in source files that #include <libintl.h> or #include "gettext.h".
++   Packages that use *printf() in source files that don't refer to _()
++   or gettext() but for which the format string could be the return value
++   of _() or gettext() need to add this #include.  Oh well.  */
++
++#if !@HAVE_POSIX_PRINTF@
++
++#include <stdio.h>
++#include <stddef.h>
++
++/* Get va_list.  */
++#if __STDC__ || defined __cplusplus || defined _MSC_VER
++# include <stdarg.h>
++#else
++# include <varargs.h>
++#endif
++
++#undef fprintf
++#define fprintf libintl_fprintf
++extern int fprintf (FILE *, const char *, ...);
++#undef vfprintf
++#define vfprintf libintl_vfprintf
++extern int vfprintf (FILE *, const char *, va_list);
++
++#undef printf
++#define printf libintl_printf
++extern int printf (const char *, ...);
++#undef vprintf
++#define vprintf libintl_vprintf
++extern int vprintf (const char *, va_list);
++
++#undef sprintf
++#define sprintf libintl_sprintf
++extern int sprintf (char *, const char *, ...);
++#undef vsprintf
++#define vsprintf libintl_vsprintf
++extern int vsprintf (char *, const char *, va_list);
++
++#if @HAVE_SNPRINTF@
++
++#undef snprintf
++#define snprintf libintl_snprintf
++extern int snprintf (char *, size_t, const char *, ...);
++#undef vsnprintf
++#define vsnprintf libintl_vsnprintf
++extern int vsnprintf (char *, size_t, const char *, va_list);
++
++#endif
++
++#if @HAVE_ASPRINTF@
++
++#undef asprintf
++#define asprintf libintl_asprintf
++extern int asprintf (char **, const char *, ...);
++#undef vasprintf
++#define vasprintf libintl_vasprintf
++extern int vasprintf (char **, const char *, va_list);
++
++#endif
++
++#if @HAVE_WPRINTF@
++
++#undef fwprintf
++#define fwprintf libintl_fwprintf
++extern int fwprintf (FILE *, const wchar_t *, ...);
++#undef vfwprintf
++#define vfwprintf libintl_vfwprintf
++extern int vfwprintf (FILE *, const wchar_t *, va_list);
++
++#undef wprintf
++#define wprintf libintl_wprintf
++extern int wprintf (const wchar_t *, ...);
++#undef vwprintf
++#define vwprintf libintl_vwprintf
++extern int vwprintf (const wchar_t *, va_list);
++
++#undef swprintf
++#define swprintf libintl_swprintf
++extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
++#undef vswprintf
++#define vswprintf libintl_vswprintf
++extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
++
++#endif
++
++#endif
++
++
++/* Support for relocatable packages.  */
++
++/* Sets the original and the current installation prefix of the package.
++   Relocation simply replaces a pathname starting with the original prefix
++   by the corresponding pathname with the current prefix instead.  Both
++   prefixes should be directory names without trailing slash (i.e. use ""
++   instead of "/").  */
++#define libintl_set_relocation_prefix libintl_set_relocation_prefix
++extern void
++       libintl_set_relocation_prefix (const char *orig_prefix,
++				      const char *curr_prefix);
++
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* libintl.h */
+--- lrzsz-0.12.20.safe/intl/linux-msg.sed	1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/linux-msg.sed	1969-12-31 19:00:00.000000000 -0500
+@@ -1,100 +0,0 @@
+-# po2msg.sed - Convert Uniforum style .po file to Linux style .msg file
+-# Copyright (C) 1995 Free Software Foundation, Inc.
+-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+-#
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-#
+-#
+-# The first directive in the .msg should be the definition of the
+-# message set number.  We use always set number 1.
+-#
+-1 {
+-  i\
+-$set 1 # Automatically created by po2msg.sed
+-  h
+-  s/.*/0/
+-  x
+-}
+-#
+-# Mitch's old catalog format does not allow comments.
+-#
+-# We copy the original message as a comment into the .msg file.
+-#
+-/^msgid/ {
+-  s/msgid[ 	]*"//
+-#
+-# This does not work now with the new format.
+-# /"$/! {
+-#   s/\\$//
+-#   s/$/ ... (more lines following)"/
+-# }
+-  x
+-# The following nice solution is by
+-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+-  td
+-# Increment a decimal number in pattern space.
+-# First hide trailing `9' digits.
+-  :d
+-  s/9\(_*\)$/_\1/
+-  td
+-# Assure at least one digit is available.
+-  s/^\(_*\)$/0\1/
+-# Increment the last digit.
+-  s/8\(_*\)$/9\1/
+-  s/7\(_*\)$/8\1/
+-  s/6\(_*\)$/7\1/
+-  s/5\(_*\)$/6\1/
+-  s/4\(_*\)$/5\1/
+-  s/3\(_*\)$/4\1/
+-  s/2\(_*\)$/3\1/
+-  s/1\(_*\)$/2\1/
+-  s/0\(_*\)$/1\1/
+-# Convert the hidden `9' digits to `0's.
+-  s/_/0/g
+-  x
+-  G
+-  s/\(.*\)"\n\([0-9]*\)/$ #\2 Original Message:(\1)/p
+-}
+-#
+-# The .msg file contains, other then the .po file, only the translations
+-# but each given a unique ID.  Starting from 1 and incrementing by 1 for
+-# each message we assign them to the messages.
+-# It is important that the .po file used to generate the cat-id-tbl.c file
+-# (with po-to-tbl) is the same as the one used here.  (At least the order
+-# of declarations must not be changed.)
+-#
+-/^msgstr/ {
+-  s/msgstr[ 	]*"\(.*\)"/# \1/
+-# Clear substitution flag.
+-  tb
+-# Append the next line.
+-  :b
+-  N
+-# Look whether second part is continuation line.
+-  s/\(.*\n\)"\(.*\)"/\1\2/
+-# Yes, then branch.
+-  ta
+-  P
+-  D
+-# Note that D includes a jump to the start!!
+-# We found a continuation line.  But before printing insert '\'.
+-  :a
+-  s/\(.*\)\(\n.*\)/\1\\\2/
+-  P
+-# We cannot use D here.
+-  s/.*\n\(.*\)/\1/
+-  tb
+-}
+-d
+--- lrzsz-0.12.20.safe/intl/loadinfo.h	1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/loadinfo.h	2004-09-12 14:40:34.468730912 -0400
+@@ -1,9 +1,54 @@
+-#ifndef PARAMS
+-# if __STDC__
+-#  define PARAMS(args) args
+-# else
+-#  define PARAMS(args) ()
+-# endif
++/* Copyright (C) 1996-1999, 2000-2003 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _LOADINFO_H
++#define _LOADINFO_H	1
++
++/* Declarations of locale dependent catalog lookup functions.
++   Implemented in
++
++     localealias.c    Possibly replace a locale name by another.
++     explodename.c    Split a locale name into its various fields.
++     l10nflist.c      Generate a list of filenames of possible message catalogs.
++     finddomain.c     Find and open the relevant message catalogs.
++
++   The main function _nl_find_domain() in finddomain.c is declared
++   in gettextP.h.
++ */
++
++#ifndef internal_function
++# define internal_function
++#endif
++
++/* Tell the compiler when a conditional or integer expression is
++   almost always true or almost always false.  */
++#ifndef HAVE_BUILTIN_EXPECT
++# define __builtin_expect(expr, val) (expr)
++#endif
++
++/* Separator in PATH like lists of pathnames.  */
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++  /* Win32, OS/2, DOS */
++# define PATH_SEPARATOR ';'
++#else
++  /* Unix */
++# define PATH_SEPARATOR ':'
+ #endif
+ 
+ /* Encoding of locale name parts.  */
+@@ -32,27 +77,69 @@
+ };
+ 
+ 
+-extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
+-						  size_t name_len));
++/* Normalize codeset name.  There is no standard for the codeset
++   names.  Normalization allows the user to use any of the common
++   names.  The return value is dynamically allocated and has to be
++   freed by the caller.  */
++extern const char *_nl_normalize_codeset (const char *codeset,
++					  size_t name_len);
+ 
++/* Lookup a locale dependent file.
++   *L10NFILE_LIST denotes a pool of lookup results of locale dependent
++   files of the same kind, sorted in decreasing order of ->filename.
++   DIRLIST and DIRLIST_LEN are an argz list of directories in which to
++   look, containing at least one directory (i.e. DIRLIST_LEN > 0).
++   MASK, LANGUAGE, TERRITORY, CODESET, NORMALIZED_CODESET, MODIFIER,
++   SPECIAL, SPONSOR, REVISION are the pieces of the locale name, as
++   produced by _nl_explode_name().  FILENAME is the filename suffix.
++   The return value is the lookup result, either found in *L10NFILE_LIST,
++   or - if DO_ALLOCATE is nonzero - freshly allocated, or possibly NULL.
++   If the return value is non-NULL, it is added to *L10NFILE_LIST, and
++   its ->next field denotes the chaining inside *L10NFILE_LIST, and
++   furthermore its ->successor[] field contains a list of other lookup
++   results from which this lookup result inherits.  */
+ extern struct loaded_l10nfile *
+-_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
+-			    const char *dirlist, size_t dirlist_len, int mask,
+-			    const char *language, const char *territory,
+-			    const char *codeset,
+-			    const char *normalized_codeset,
+-			    const char *modifier, const char *special,
+-			    const char *sponsor, const char *revision,
+-			    const char *filename, int do_allocate));
++_nl_make_l10nflist (struct loaded_l10nfile **l10nfile_list,
++		    const char *dirlist, size_t dirlist_len, int mask,
++		    const char *language, const char *territory,
++		    const char *codeset, const char *normalized_codeset,
++		    const char *modifier, const char *special,
++		    const char *sponsor, const char *revision,
++		    const char *filename, int do_allocate);
+ 
++/* Lookup the real locale name for a locale alias NAME, or NULL if
++   NAME is not a locale alias (but possibly a real locale name).
++   The return value is statically allocated and must not be freed.  */
++extern const char *_nl_expand_alias (const char *name);
+ 
+-extern const char *_nl_expand_alias PARAMS ((const char *name));
++/* Split a locale name NAME into its pieces: language, modifier,
++   territory, codeset, special, sponsor, revision.
++   NAME gets destructively modified: NUL bytes are inserted here and
++   there.  *LANGUAGE gets assigned NAME.  Each of *MODIFIER, *TERRITORY,
++   *CODESET, *SPECIAL, *SPONSOR, *REVISION gets assigned either a
++   pointer into the old NAME string, or NULL.  *NORMALIZED_CODESET
++   gets assigned the expanded *CODESET, if it is different from *CODESET;
++   this one is dynamically allocated and has to be freed by the caller.
++   The return value is a bitmask, where each bit corresponds to one
++   filled-in value:
++     XPG_MODIFIER, CEN_AUDIENCE  for *MODIFIER,
++     TERRITORY                   for *TERRITORY,
++     XPG_CODESET                 for *CODESET,
++     XPG_NORM_CODESET            for *NORMALIZED_CODESET,
++     CEN_SPECIAL                 for *SPECIAL,
++     CEN_SPONSOR                 for *SPONSOR,
++     CEN_REVISION                for *REVISION.
++ */
++extern int _nl_explode_name (char *name, const char **language,
++			     const char **modifier, const char **territory,
++			     const char **codeset,
++			     const char **normalized_codeset,
++			     const char **special, const char **sponsor,
++			     const char **revision);
+ 
+-extern int _nl_explode_name PARAMS ((char *name, const char **language,
+-				     const char **modifier,
+-				     const char **territory,
+-				     const char **codeset,
+-				     const char **normalized_codeset,
+-				     const char **special,
+-				     const char **sponsor,
+-				     const char **revision));
++/* Split a locale name NAME into a leading language part and all the
++   rest.  Return a pointer to the first character after the language,
++   i.e. to the first byte of the rest.  */
++extern char *_nl_find_language (const char *name);
++
++#endif	/* loadinfo.h */
+--- lrzsz-0.12.20.safe/intl/loadmsgcat.c	1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/loadmsgcat.c	2004-09-12 14:40:34.473730152 -0400
+@@ -1,42 +1,455 @@
+-/* Load needed message catalogs
+-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++/* Load needed message catalogs.
++   Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* Tell glibc's <string.h> to provide a prototype for mempcpy().
++   This must come before <config.h> because <config.h> may include
++   <features.h>, and once <features.h> has been included, it's too late.  */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE    1
++#endif
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+ 
++#include <ctype.h>
++#include <errno.h>
+ #include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ 
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
++#ifdef __GNUC__
++# undef  alloca
++# define alloca __builtin_alloca
++# define HAVE_ALLOCA 1
++#else
++# ifdef _MSC_VER
++#  include <malloc.h>
++#  define alloca _alloca
++# else
++#  if defined HAVE_ALLOCA_H || defined _LIBC
++#   include <alloca.h>
++#  else
++#   ifdef _AIX
++ #pragma alloca
++#   else
++#    ifndef alloca
++char *alloca ();
++#    endif
++#   endif
++#  endif
++# endif
+ #endif
+ 
++#include <stdlib.h>
++#include <string.h>
++
+ #if defined HAVE_UNISTD_H || defined _LIBC
+ # include <unistd.h>
+ #endif
+ 
+-#if (defined HAVE_MMAP && defined HAVE_MUNMAP) || defined _LIBC
++#ifdef _LIBC
++# include <langinfo.h>
++# include <locale.h>
++#endif
++
++#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
++    || (defined _LIBC && defined _POSIX_MAPPED_FILES)
+ # include <sys/mman.h>
++# undef HAVE_MMAP
++# define HAVE_MMAP	1
++#else
++# undef HAVE_MMAP
+ #endif
+ 
+-#include "gettext.h"
++#if defined HAVE_STDINT_H_WITH_UINTMAX || defined _LIBC
++# include <stdint.h>
++#endif
++#if defined HAVE_INTTYPES_H || defined _LIBC
++# include <inttypes.h>
++#endif
++
++#include "gmo.h"
+ #include "gettextP.h"
++#include "hash-string.h"
++#include "plural-exp.h"
++
++#ifdef _LIBC
++# include "../locale/localeinfo.h"
++#endif
++
++/* Provide fallback values for macros that ought to be defined in <inttypes.h>.
++   Note that our fallback values need not be literal strings, because we don't
++   use them with preprocessor string concatenation.  */
++#if !defined PRId8 || PRI_MACROS_BROKEN
++# undef PRId8
++# define PRId8 "d"
++#endif
++#if !defined PRIi8 || PRI_MACROS_BROKEN
++# undef PRIi8
++# define PRIi8 "i"
++#endif
++#if !defined PRIo8 || PRI_MACROS_BROKEN
++# undef PRIo8
++# define PRIo8 "o"
++#endif
++#if !defined PRIu8 || PRI_MACROS_BROKEN
++# undef PRIu8
++# define PRIu8 "u"
++#endif
++#if !defined PRIx8 || PRI_MACROS_BROKEN
++# undef PRIx8
++# define PRIx8 "x"
++#endif
++#if !defined PRIX8 || PRI_MACROS_BROKEN
++# undef PRIX8
++# define PRIX8 "X"
++#endif
++#if !defined PRId16 || PRI_MACROS_BROKEN
++# undef PRId16
++# define PRId16 "d"
++#endif
++#if !defined PRIi16 || PRI_MACROS_BROKEN
++# undef PRIi16
++# define PRIi16 "i"
++#endif
++#if !defined PRIo16 || PRI_MACROS_BROKEN
++# undef PRIo16
++# define PRIo16 "o"
++#endif
++#if !defined PRIu16 || PRI_MACROS_BROKEN
++# undef PRIu16
++# define PRIu16 "u"
++#endif
++#if !defined PRIx16 || PRI_MACROS_BROKEN
++# undef PRIx16
++# define PRIx16 "x"
++#endif
++#if !defined PRIX16 || PRI_MACROS_BROKEN
++# undef PRIX16
++# define PRIX16 "X"
++#endif
++#if !defined PRId32 || PRI_MACROS_BROKEN
++# undef PRId32
++# define PRId32 "d"
++#endif
++#if !defined PRIi32 || PRI_MACROS_BROKEN
++# undef PRIi32
++# define PRIi32 "i"
++#endif
++#if !defined PRIo32 || PRI_MACROS_BROKEN
++# undef PRIo32
++# define PRIo32 "o"
++#endif
++#if !defined PRIu32 || PRI_MACROS_BROKEN
++# undef PRIu32
++# define PRIu32 "u"
++#endif
++#if !defined PRIx32 || PRI_MACROS_BROKEN
++# undef PRIx32
++# define PRIx32 "x"
++#endif
++#if !defined PRIX32 || PRI_MACROS_BROKEN
++# undef PRIX32
++# define PRIX32 "X"
++#endif
++#if !defined PRId64 || PRI_MACROS_BROKEN
++# undef PRId64
++# define PRId64 (sizeof (long) == 8 ? "ld" : "lld")
++#endif
++#if !defined PRIi64 || PRI_MACROS_BROKEN
++# undef PRIi64
++# define PRIi64 (sizeof (long) == 8 ? "li" : "lli")
++#endif
++#if !defined PRIo64 || PRI_MACROS_BROKEN
++# undef PRIo64
++# define PRIo64 (sizeof (long) == 8 ? "lo" : "llo")
++#endif
++#if !defined PRIu64 || PRI_MACROS_BROKEN
++# undef PRIu64
++# define PRIu64 (sizeof (long) == 8 ? "lu" : "llu")
++#endif
++#if !defined PRIx64 || PRI_MACROS_BROKEN
++# undef PRIx64
++# define PRIx64 (sizeof (long) == 8 ? "lx" : "llx")
++#endif
++#if !defined PRIX64 || PRI_MACROS_BROKEN
++# undef PRIX64
++# define PRIX64 (sizeof (long) == 8 ? "lX" : "llX")
++#endif
++#if !defined PRIdLEAST8 || PRI_MACROS_BROKEN
++# undef PRIdLEAST8
++# define PRIdLEAST8 "d"
++#endif
++#if !defined PRIiLEAST8 || PRI_MACROS_BROKEN
++# undef PRIiLEAST8
++# define PRIiLEAST8 "i"
++#endif
++#if !defined PRIoLEAST8 || PRI_MACROS_BROKEN
++# undef PRIoLEAST8
++# define PRIoLEAST8 "o"
++#endif
++#if !defined PRIuLEAST8 || PRI_MACROS_BROKEN
++# undef PRIuLEAST8
++# define PRIuLEAST8 "u"
++#endif
++#if !defined PRIxLEAST8 || PRI_MACROS_BROKEN
++# undef PRIxLEAST8
++# define PRIxLEAST8 "x"
++#endif
++#if !defined PRIXLEAST8 || PRI_MACROS_BROKEN
++# undef PRIXLEAST8
++# define PRIXLEAST8 "X"
++#endif
++#if !defined PRIdLEAST16 || PRI_MACROS_BROKEN
++# undef PRIdLEAST16
++# define PRIdLEAST16 "d"
++#endif
++#if !defined PRIiLEAST16 || PRI_MACROS_BROKEN
++# undef PRIiLEAST16
++# define PRIiLEAST16 "i"
++#endif
++#if !defined PRIoLEAST16 || PRI_MACROS_BROKEN
++# undef PRIoLEAST16
++# define PRIoLEAST16 "o"
++#endif
++#if !defined PRIuLEAST16 || PRI_MACROS_BROKEN
++# undef PRIuLEAST16
++# define PRIuLEAST16 "u"
++#endif
++#if !defined PRIxLEAST16 || PRI_MACROS_BROKEN
++# undef PRIxLEAST16
++# define PRIxLEAST16 "x"
++#endif
++#if !defined PRIXLEAST16 || PRI_MACROS_BROKEN
++# undef PRIXLEAST16
++# define PRIXLEAST16 "X"
++#endif
++#if !defined PRIdLEAST32 || PRI_MACROS_BROKEN
++# undef PRIdLEAST32
++# define PRIdLEAST32 "d"
++#endif
++#if !defined PRIiLEAST32 || PRI_MACROS_BROKEN
++# undef PRIiLEAST32
++# define PRIiLEAST32 "i"
++#endif
++#if !defined PRIoLEAST32 || PRI_MACROS_BROKEN
++# undef PRIoLEAST32
++# define PRIoLEAST32 "o"
++#endif
++#if !defined PRIuLEAST32 || PRI_MACROS_BROKEN
++# undef PRIuLEAST32
++# define PRIuLEAST32 "u"
++#endif
++#if !defined PRIxLEAST32 || PRI_MACROS_BROKEN
++# undef PRIxLEAST32
++# define PRIxLEAST32 "x"
++#endif
++#if !defined PRIXLEAST32 || PRI_MACROS_BROKEN
++# undef PRIXLEAST32
++# define PRIXLEAST32 "X"
++#endif
++#if !defined PRIdLEAST64 || PRI_MACROS_BROKEN
++# undef PRIdLEAST64
++# define PRIdLEAST64 PRId64
++#endif
++#if !defined PRIiLEAST64 || PRI_MACROS_BROKEN
++# undef PRIiLEAST64
++# define PRIiLEAST64 PRIi64
++#endif
++#if !defined PRIoLEAST64 || PRI_MACROS_BROKEN
++# undef PRIoLEAST64
++# define PRIoLEAST64 PRIo64
++#endif
++#if !defined PRIuLEAST64 || PRI_MACROS_BROKEN
++# undef PRIuLEAST64
++# define PRIuLEAST64 PRIu64
++#endif
++#if !defined PRIxLEAST64 || PRI_MACROS_BROKEN
++# undef PRIxLEAST64
++# define PRIxLEAST64 PRIx64
++#endif
++#if !defined PRIXLEAST64 || PRI_MACROS_BROKEN
++# undef PRIXLEAST64
++# define PRIXLEAST64 PRIX64
++#endif
++#if !defined PRIdFAST8 || PRI_MACROS_BROKEN
++# undef PRIdFAST8
++# define PRIdFAST8 "d"
++#endif
++#if !defined PRIiFAST8 || PRI_MACROS_BROKEN
++# undef PRIiFAST8
++# define PRIiFAST8 "i"
++#endif
++#if !defined PRIoFAST8 || PRI_MACROS_BROKEN
++# undef PRIoFAST8
++# define PRIoFAST8 "o"
++#endif
++#if !defined PRIuFAST8 || PRI_MACROS_BROKEN
++# undef PRIuFAST8
++# define PRIuFAST8 "u"
++#endif
++#if !defined PRIxFAST8 || PRI_MACROS_BROKEN
++# undef PRIxFAST8
++# define PRIxFAST8 "x"
++#endif
++#if !defined PRIXFAST8 || PRI_MACROS_BROKEN
++# undef PRIXFAST8
++# define PRIXFAST8 "X"
++#endif
++#if !defined PRIdFAST16 || PRI_MACROS_BROKEN
++# undef PRIdFAST16
++# define PRIdFAST16 "d"
++#endif
++#if !defined PRIiFAST16 || PRI_MACROS_BROKEN
++# undef PRIiFAST16
++# define PRIiFAST16 "i"
++#endif
++#if !defined PRIoFAST16 || PRI_MACROS_BROKEN
++# undef PRIoFAST16
++# define PRIoFAST16 "o"
++#endif
++#if !defined PRIuFAST16 || PRI_MACROS_BROKEN
++# undef PRIuFAST16
++# define PRIuFAST16 "u"
++#endif
++#if !defined PRIxFAST16 || PRI_MACROS_BROKEN
++# undef PRIxFAST16
++# define PRIxFAST16 "x"
++#endif
++#if !defined PRIXFAST16 || PRI_MACROS_BROKEN
++# undef PRIXFAST16
++# define PRIXFAST16 "X"
++#endif
++#if !defined PRIdFAST32 || PRI_MACROS_BROKEN
++# undef PRIdFAST32
++# define PRIdFAST32 "d"
++#endif
++#if !defined PRIiFAST32 || PRI_MACROS_BROKEN
++# undef PRIiFAST32
++# define PRIiFAST32 "i"
++#endif
++#if !defined PRIoFAST32 || PRI_MACROS_BROKEN
++# undef PRIoFAST32
++# define PRIoFAST32 "o"
++#endif
++#if !defined PRIuFAST32 || PRI_MACROS_BROKEN
++# undef PRIuFAST32
++# define PRIuFAST32 "u"
++#endif
++#if !defined PRIxFAST32 || PRI_MACROS_BROKEN
++# undef PRIxFAST32
++# define PRIxFAST32 "x"
++#endif
++#if !defined PRIXFAST32 || PRI_MACROS_BROKEN
++# undef PRIXFAST32
++# define PRIXFAST32 "X"
++#endif
++#if !defined PRIdFAST64 || PRI_MACROS_BROKEN
++# undef PRIdFAST64
++# define PRIdFAST64 PRId64
++#endif
++#if !defined PRIiFAST64 || PRI_MACROS_BROKEN
++# undef PRIiFAST64
++# define PRIiFAST64 PRIi64
++#endif
++#if !defined PRIoFAST64 || PRI_MACROS_BROKEN
++# undef PRIoFAST64
++# define PRIoFAST64 PRIo64
++#endif
++#if !defined PRIuFAST64 || PRI_MACROS_BROKEN
++# undef PRIuFAST64
++# define PRIuFAST64 PRIu64
++#endif
++#if !defined PRIxFAST64 || PRI_MACROS_BROKEN
++# undef PRIxFAST64
++# define PRIxFAST64 PRIx64
++#endif
++#if !defined PRIXFAST64 || PRI_MACROS_BROKEN
++# undef PRIXFAST64
++# define PRIXFAST64 PRIX64
++#endif
++#if !defined PRIdMAX || PRI_MACROS_BROKEN
++# undef PRIdMAX
++# define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld")
++#endif
++#if !defined PRIiMAX || PRI_MACROS_BROKEN
++# undef PRIiMAX
++# define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli")
++#endif
++#if !defined PRIoMAX || PRI_MACROS_BROKEN
++# undef PRIoMAX
++# define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo")
++#endif
++#if !defined PRIuMAX || PRI_MACROS_BROKEN
++# undef PRIuMAX
++# define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu")
++#endif
++#if !defined PRIxMAX || PRI_MACROS_BROKEN
++# undef PRIxMAX
++# define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx")
++#endif
++#if !defined PRIXMAX || PRI_MACROS_BROKEN
++# undef PRIXMAX
++# define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX")
++#endif
++#if !defined PRIdPTR || PRI_MACROS_BROKEN
++# undef PRIdPTR
++# define PRIdPTR \
++  (sizeof (void *) == sizeof (long) ? "ld" : \
++   sizeof (void *) == sizeof (int) ? "d" : \
++   "lld")
++#endif
++#if !defined PRIiPTR || PRI_MACROS_BROKEN
++# undef PRIiPTR
++# define PRIiPTR \
++  (sizeof (void *) == sizeof (long) ? "li" : \
++   sizeof (void *) == sizeof (int) ? "i" : \
++   "lli")
++#endif
++#if !defined PRIoPTR || PRI_MACROS_BROKEN
++# undef PRIoPTR
++# define PRIoPTR \
++  (sizeof (void *) == sizeof (long) ? "lo" : \
++   sizeof (void *) == sizeof (int) ? "o" : \
++   "llo")
++#endif
++#if !defined PRIuPTR || PRI_MACROS_BROKEN
++# undef PRIuPTR
++# define PRIuPTR \
++  (sizeof (void *) == sizeof (long) ? "lu" : \
++   sizeof (void *) == sizeof (int) ? "u" : \
++   "llu")
++#endif
++#if !defined PRIxPTR || PRI_MACROS_BROKEN
++# undef PRIxPTR
++# define PRIxPTR \
++  (sizeof (void *) == sizeof (long) ? "lx" : \
++   sizeof (void *) == sizeof (int) ? "x" : \
++   "llx")
++#endif
++#if !defined PRIXPTR || PRI_MACROS_BROKEN
++# undef PRIXPTR
++# define PRIXPTR \
++  (sizeof (void *) == sizeof (long) ? "lX" : \
++   sizeof (void *) == sizeof (int) ? "X" : \
++   "llX")
++#endif
+ 
+ /* @@ end of prolog @@ */
+ 
+@@ -44,7 +457,6 @@
+ /* Rename the non ISO C functions.  This is required by the standard
+    because some ISO C functions will require linking with this object
+    file and the name space must not be polluted.  */
+-# define fstat  __fstat
+ # define open   __open
+ # define close  __close
+ # define read   __read
+@@ -52,30 +464,471 @@
+ # define munmap __munmap
+ #endif
+ 
++/* For those losing systems which don't have `alloca' we have to add
++   some additional code emulating it.  */
++#ifdef HAVE_ALLOCA
++# define freea(p) /* nothing */
++#else
++# define alloca(n) malloc (n)
++# define freea(p) free (p)
++#endif
++
++/* For systems that distinguish between text and binary I/O.
++   O_BINARY is usually declared in <fcntl.h>. */
++#if !defined O_BINARY && defined _O_BINARY
++  /* For MSC-compatible compilers.  */
++# define O_BINARY _O_BINARY
++# define O_TEXT _O_TEXT
++#endif
++#ifdef __BEOS__
++  /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect.  */
++# undef O_BINARY
++# undef O_TEXT
++#endif
++/* On reasonable systems, binary I/O is the default.  */
++#ifndef O_BINARY
++# define O_BINARY 0
++#endif
++
++
+ /* We need a sign, whether a new catalog was loaded, which can be associated
+    with all translations.  This is important if the translations are
+    cached by one of GCC's features.  */
+-int _nl_msg_cat_cntr = 0;
++int _nl_msg_cat_cntr;
+ 
+ 
++/* Expand a system dependent string segment.  Return NULL if unsupported.  */
++static const char *
++get_sysdep_segment_value (const char *name)
++{
++  /* Test for an ISO C 99 section 7.8.1 format string directive.
++     Syntax:
++     P R I { d | i | o | u | x | X }
++     { { | LEAST | FAST } { 8 | 16 | 32 | 64 } | MAX | PTR }  */
++  /* We don't use a table of 14 times 6 'const char *' strings here, because
++     data relocations cost startup time.  */
++  if (name[0] == 'P' && name[1] == 'R' && name[2] == 'I')
++    {
++      if (name[3] == 'd' || name[3] == 'i' || name[3] == 'o' || name[3] == 'u'
++	  || name[3] == 'x' || name[3] == 'X')
++	{
++	  if (name[4] == '8' && name[5] == '\0')
++	    {
++	      if (name[3] == 'd')
++		return PRId8;
++	      if (name[3] == 'i')
++		return PRIi8;
++	      if (name[3] == 'o')
++		return PRIo8;
++	      if (name[3] == 'u')
++		return PRIu8;
++	      if (name[3] == 'x')
++		return PRIx8;
++	      if (name[3] == 'X')
++		return PRIX8;
++	      abort ();
++	    }
++	  if (name[4] == '1' && name[5] == '6' && name[6] == '\0')
++	    {
++	      if (name[3] == 'd')
++		return PRId16;
++	      if (name[3] == 'i')
++		return PRIi16;
++	      if (name[3] == 'o')
++		return PRIo16;
++	      if (name[3] == 'u')
++		return PRIu16;
++	      if (name[3] == 'x')
++		return PRIx16;
++	      if (name[3] == 'X')
++		return PRIX16;
++	      abort ();
++	    }
++	  if (name[4] == '3' && name[5] == '2' && name[6] == '\0')
++	    {
++	      if (name[3] == 'd')
++		return PRId32;
++	      if (name[3] == 'i')
++		return PRIi32;
++	      if (name[3] == 'o')
++		return PRIo32;
++	      if (name[3] == 'u')
++		return PRIu32;
++	      if (name[3] == 'x')
++		return PRIx32;
++	      if (name[3] == 'X')
++		return PRIX32;
++	      abort ();
++	    }
++	  if (name[4] == '6' && name[5] == '4' && name[6] == '\0')
++	    {
++	      if (name[3] == 'd')
++		return PRId64;
++	      if (name[3] == 'i')
++		return PRIi64;
++	      if (name[3] == 'o')
++		return PRIo64;
++	      if (name[3] == 'u')
++		return PRIu64;
++	      if (name[3] == 'x')
++		return PRIx64;
++	      if (name[3] == 'X')
++		return PRIX64;
++	      abort ();
++	    }
++	  if (name[4] == 'L' && name[5] == 'E' && name[6] == 'A'
++	      && name[7] == 'S' && name[8] == 'T')
++	    {
++	      if (name[9] == '8' && name[10] == '\0')
++		{
++		  if (name[3] == 'd')
++		    return PRIdLEAST8;
++		  if (name[3] == 'i')
++		    return PRIiLEAST8;
++		  if (name[3] == 'o')
++		    return PRIoLEAST8;
++		  if (name[3] == 'u')
++		    return PRIuLEAST8;
++		  if (name[3] == 'x')
++		    return PRIxLEAST8;
++		  if (name[3] == 'X')
++		    return PRIXLEAST8;
++		  abort ();
++		}
++	      if (name[9] == '1' && name[10] == '6' && name[11] == '\0')
++		{
++		  if (name[3] == 'd')
++		    return PRIdLEAST16;
++		  if (name[3] == 'i')
++		    return PRIiLEAST16;
++		  if (name[3] == 'o')
++		    return PRIoLEAST16;
++		  if (name[3] == 'u')
++		    return PRIuLEAST16;
++		  if (name[3] == 'x')
++		    return PRIxLEAST16;
++		  if (name[3] == 'X')
++		    return PRIXLEAST16;
++		  abort ();
++		}
++	      if (name[9] == '3' && name[10] == '2' && name[11] == '\0')
++		{
++		  if (name[3] == 'd')
++		    return PRIdLEAST32;
++		  if (name[3] == 'i')
++		    return PRIiLEAST32;
++		  if (name[3] == 'o')
++		    return PRIoLEAST32;
++		  if (name[3] == 'u')
++		    return PRIuLEAST32;
++		  if (name[3] == 'x')
++		    return PRIxLEAST32;
++		  if (name[3] == 'X')
++		    return PRIXLEAST32;
++		  abort ();
++		}
++	      if (name[9] == '6' && name[10] == '4' && name[11] == '\0')
++		{
++		  if (name[3] == 'd')
++		    return PRIdLEAST64;
++		  if (name[3] == 'i')
++		    return PRIiLEAST64;
++		  if (name[3] == 'o')
++		    return PRIoLEAST64;
++		  if (name[3] == 'u')
++		    return PRIuLEAST64;
++		  if (name[3] == 'x')
++		    return PRIxLEAST64;
++		  if (name[3] == 'X')
++		    return PRIXLEAST64;
++		  abort ();
++		}
++	    }
++	  if (name[4] == 'F' && name[5] == 'A' && name[6] == 'S'
++	      && name[7] == 'T')
++	    {
++	      if (name[8] == '8' && name[9] == '\0')
++		{
++		  if (name[3] == 'd')
++		    return PRIdFAST8;
++		  if (name[3] == 'i')
++		    return PRIiFAST8;
++		  if (name[3] == 'o')
++		    return PRIoFAST8;
++		  if (name[3] == 'u')
++		    return PRIuFAST8;
++		  if (name[3] == 'x')
++		    return PRIxFAST8;
++		  if (name[3] == 'X')
++		    return PRIXFAST8;
++		  abort ();
++		}
++	      if (name[8] == '1' && name[9] == '6' && name[10] == '\0')
++		{
++		  if (name[3] == 'd')
++		    return PRIdFAST16;
++		  if (name[3] == 'i')
++		    return PRIiFAST16;
++		  if (name[3] == 'o')
++		    return PRIoFAST16;
++		  if (name[3] == 'u')
++		    return PRIuFAST16;
++		  if (name[3] == 'x')
++		    return PRIxFAST16;
++		  if (name[3] == 'X')
++		    return PRIXFAST16;
++		  abort ();
++		}
++	      if (name[8] == '3' && name[9] == '2' && name[10] == '\0')
++		{
++		  if (name[3] == 'd')
++		    return PRIdFAST32;
++		  if (name[3] == 'i')
++		    return PRIiFAST32;
++		  if (name[3] == 'o')
++		    return PRIoFAST32;
++		  if (name[3] == 'u')
++		    return PRIuFAST32;
++		  if (name[3] == 'x')
++		    return PRIxFAST32;
++		  if (name[3] == 'X')
++		    return PRIXFAST32;
++		  abort ();
++		}
++	      if (name[8] == '6' && name[9] == '4' && name[10] == '\0')
++		{
++		  if (name[3] == 'd')
++		    return PRIdFAST64;
++		  if (name[3] == 'i')
++		    return PRIiFAST64;
++		  if (name[3] == 'o')
++		    return PRIoFAST64;
++		  if (name[3] == 'u')
++		    return PRIuFAST64;
++		  if (name[3] == 'x')
++		    return PRIxFAST64;
++		  if (name[3] == 'X')
++		    return PRIXFAST64;
++		  abort ();
++		}
++	    }
++	  if (name[4] == 'M' && name[5] == 'A' && name[6] == 'X'
++	      && name[7] == '\0')
++	    {
++	      if (name[3] == 'd')
++		return PRIdMAX;
++	      if (name[3] == 'i')
++		return PRIiMAX;
++	      if (name[3] == 'o')
++		return PRIoMAX;
++	      if (name[3] == 'u')
++		return PRIuMAX;
++	      if (name[3] == 'x')
++		return PRIxMAX;
++	      if (name[3] == 'X')
++		return PRIXMAX;
++	      abort ();
++	    }
++	  if (name[4] == 'P' && name[5] == 'T' && name[6] == 'R'
++	      && name[7] == '\0')
++	    {
++	      if (name[3] == 'd')
++		return PRIdPTR;
++	      if (name[3] == 'i')
++		return PRIiPTR;
++	      if (name[3] == 'o')
++		return PRIoPTR;
++	      if (name[3] == 'u')
++		return PRIuPTR;
++	      if (name[3] == 'x')
++		return PRIxPTR;
++	      if (name[3] == 'X')
++		return PRIXPTR;
++	      abort ();
++	    }
++	}
++    }
++  /* Test for a glibc specific printf() format directive flag.  */
++  if (name[0] == 'I' && name[1] == '\0')
++    {
++#if defined _LIBC || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
++      /* The 'I' flag, in numeric format directives, replaces ASCII digits
++	 with the 'outdigits' defined in the LC_CTYPE locale facet.  This is
++	 used for Farsi (Persian) and maybe Arabic.  */
++      return "I";
++#else
++      return "";
++#endif
++    }
++  /* Other system dependent strings are not valid.  */
++  return NULL;
++}
++
++/* Initialize the codeset dependent parts of an opened message catalog.
++   Return the header entry.  */
++const char *
++internal_function
++_nl_init_domain_conv (struct loaded_l10nfile *domain_file,
++		      struct loaded_domain *domain,
++		      struct binding *domainbinding)
++{
++  /* Find out about the character set the file is encoded with.
++     This can be found (in textual form) in the entry "".  If this
++     entry does not exist or if this does not contain the `charset='
++     information, we will assume the charset matches the one the
++     current locale and we don't have to perform any conversion.  */
++  char *nullentry;
++  size_t nullentrylen;
++
++  /* Preinitialize fields, to avoid recursion during _nl_find_msg.  */
++  domain->codeset_cntr =
++    (domainbinding != NULL ? domainbinding->codeset_cntr : 0);
++#ifdef _LIBC
++  domain->conv = (__gconv_t) -1;
++#else
++# if HAVE_ICONV
++  domain->conv = (iconv_t) -1;
++# endif
++#endif
++  domain->conv_tab = NULL;
++
++  /* Get the header entry.  */
++  nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen);
++
++  if (nullentry != NULL)
++    {
++#if defined _LIBC || HAVE_ICONV
++      const char *charsetstr;
++
++      charsetstr = strstr (nullentry, "charset=");
++      if (charsetstr != NULL)
++	{
++	  size_t len;
++	  char *charset;
++	  const char *outcharset;
++
++	  charsetstr += strlen ("charset=");
++	  len = strcspn (charsetstr, " \t\n");
++
++	  charset = (char *) alloca (len + 1);
++# if defined _LIBC || HAVE_MEMPCPY
++	  *((char *) mempcpy (charset, charsetstr, len)) = '\0';
++# else
++	  memcpy (charset, charsetstr, len);
++	  charset[len] = '\0';
++# endif
++
++	  /* The output charset should normally be determined by the
++	     locale.  But sometimes the locale is not used or not correctly
++	     set up, so we provide a possibility for the user to override
++	     this.  Moreover, the value specified through
++	     bind_textdomain_codeset overrides both.  */
++	  if (domainbinding != NULL && domainbinding->codeset != NULL)
++	    outcharset = domainbinding->codeset;
++	  else
++	    {
++	      outcharset = getenv ("OUTPUT_CHARSET");
++	      if (outcharset == NULL || outcharset[0] == '\0')
++		{
++# ifdef _LIBC
++		  outcharset = _NL_CURRENT (LC_CTYPE, CODESET);
++# else
++#  if HAVE_ICONV
++		  extern const char *locale_charset (void);
++		  outcharset = locale_charset ();
++#  endif
++# endif
++		}
++	    }
++
++# ifdef _LIBC
++	  /* We always want to use transliteration.  */
++	  outcharset = norm_add_slashes (outcharset, "TRANSLIT");
++	  charset = norm_add_slashes (charset, NULL);
++	  if (__gconv_open (outcharset, charset, &domain->conv,
++			    GCONV_AVOID_NOCONV)
++	      != __GCONV_OK)
++	    domain->conv = (__gconv_t) -1;
++# else
++#  if HAVE_ICONV
++	  /* When using GNU libc >= 2.2 or GNU libiconv >= 1.5,
++	     we want to use transliteration.  */
++#   if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2 \
++       || _LIBICONV_VERSION >= 0x0105
++	  if (strchr (outcharset, '/') == NULL)
++	    {
++	      char *tmp;
++
++	      len = strlen (outcharset);
++	      tmp = (char *) alloca (len + 10 + 1);
++	      memcpy (tmp, outcharset, len);
++	      memcpy (tmp + len, "//TRANSLIT", 10 + 1);
++	      outcharset = tmp;
++
++	      domain->conv = iconv_open (outcharset, charset);
++
++	      freea (outcharset);
++	    }
++	  else
++#   endif
++	    domain->conv = iconv_open (outcharset, charset);
++#  endif
++# endif
++
++	  freea (charset);
++	}
++#endif /* _LIBC || HAVE_ICONV */
++    }
++
++  return nullentry;
++}
++
++/* Frees the codeset dependent parts of an opened message catalog.  */
++void
++internal_function
++_nl_free_domain_conv (struct loaded_domain *domain)
++{
++  if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1)
++    free (domain->conv_tab);
++
++#ifdef _LIBC
++  if (domain->conv != (__gconv_t) -1)
++    __gconv_close (domain->conv);
++#else
++# if HAVE_ICONV
++  if (domain->conv != (iconv_t) -1)
++    iconv_close (domain->conv);
++# endif
++#endif
++}
++
+ /* Load the message catalogs specified by FILENAME.  If it is no valid
+    message catalog do nothing.  */
+ void
+-_nl_load_domain (domain_file)
+-     struct loaded_l10nfile *domain_file;
++internal_function
++_nl_load_domain (struct loaded_l10nfile *domain_file,
++		 struct binding *domainbinding)
+ {
+   int fd;
++  size_t size;
++#ifdef _LIBC
++  struct stat64 st;
++#else
+   struct stat st;
++#endif
+   struct mo_file_header *data = (struct mo_file_header *) -1;
+-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+-    || defined _LIBC
+   int use_mmap = 0;
+-#endif
+   struct loaded_domain *domain;
++  int revision;
++  const char *nullentry;
+ 
+   domain_file->decided = 1;
+   domain_file->data = NULL;
+ 
++  /* Note that it would be useless to store domainbinding in domain_file
++     because domainbinding might be == NULL now but != NULL later (after
++     a call to bind_textdomain_codeset).  */
++
+   /* If the record does not represent a valid locale the FILENAME
+      might be NULL.  This can happen when according to the given
+      specification the locale file name is different for XPG and CEN
+@@ -84,27 +937,32 @@
+     return;
+ 
+   /* Try to open the addressed file.  */
+-  fd = open (domain_file->filename, O_RDONLY);
++  fd = open (domain_file->filename, O_RDONLY | O_BINARY);
+   if (fd == -1)
+     return;
+ 
+   /* We must know about the size of the file.  */
+-  if (fstat (fd, &st) != 0
+-      && st.st_size < (off_t) sizeof (struct mo_file_header))
++  if (
++#ifdef _LIBC
++      __builtin_expect (fstat64 (fd, &st) != 0, 0)
++#else
++      __builtin_expect (fstat (fd, &st) != 0, 0)
++#endif
++      || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0)
++      || __builtin_expect (size < sizeof (struct mo_file_header), 0))
+     {
+       /* Something went wrong.  */
+       close (fd);
+       return;
+     }
+ 
+-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+-    || defined _LIBC
++#ifdef HAVE_MMAP
+   /* Now we are ready to load the file.  If mmap() is available we try
+      this first.  If not available or it failed we try to load it.  */
+-  data = (struct mo_file_header *) mmap (NULL, st.st_size, PROT_READ,
++  data = (struct mo_file_header *) mmap (NULL, size, PROT_READ,
+ 					 MAP_PRIVATE, fd, 0);
+ 
+-  if (data != (struct mo_file_header *) -1)
++  if (__builtin_expect (data != (struct mo_file_header *) -1, 1))
+     {
+       /* mmap() call was successful.  */
+       close (fd);
+@@ -116,24 +974,27 @@
+      it manually.  */
+   if (data == (struct mo_file_header *) -1)
+     {
+-      off_t to_read;
++      size_t to_read;
+       char *read_ptr;
+ 
+-      data = (struct mo_file_header *) malloc (st.st_size);
++      data = (struct mo_file_header *) malloc (size);
+       if (data == NULL)
+ 	return;
+ 
+-      to_read = st.st_size;
++      to_read = size;
+       read_ptr = (char *) data;
+       do
+ 	{
+ 	  long int nb = (long int) read (fd, read_ptr, to_read);
+-	  if (nb == -1)
++	  if (nb <= 0)
+ 	    {
++#ifdef EINTR
++	      if (nb == -1 && errno == EINTR)
++		continue;
++#endif
+ 	      close (fd);
+ 	      return;
+ 	    }
+-
+ 	  read_ptr += nb;
+ 	  to_read -= nb;
+ 	}
+@@ -144,47 +1005,378 @@
+ 
+   /* Using the magic number we can test whether it really is a message
+      catalog file.  */
+-  if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED)
++  if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED,
++			0))
+     {
+       /* The magic number is wrong: not a message catalog file.  */
+-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+-    || defined _LIBC
++#ifdef HAVE_MMAP
+       if (use_mmap)
+-	munmap ((caddr_t) data, st.st_size);
++	munmap ((caddr_t) data, size);
+       else
+ #endif
+ 	free (data);
+       return;
+     }
+ 
+-  domain_file->data
+-    = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
+-  if (domain_file->data == NULL)
++  domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
++  if (domain == NULL)
+     return;
++  domain_file->data = domain;
+ 
+-  domain = (struct loaded_domain *) domain_file->data;
+   domain->data = (char *) data;
++  domain->use_mmap = use_mmap;
++  domain->mmap_size = size;
+   domain->must_swap = data->magic != _MAGIC;
++  domain->malloced = NULL;
+ 
+   /* Fill in the information about the available tables.  */
+-  switch (W (domain->must_swap, data->revision))
++  revision = W (domain->must_swap, data->revision);
++  /* We support only the major revisions 0 and 1.  */
++  switch (revision >> 16)
+     {
+     case 0:
++    case 1:
+       domain->nstrings = W (domain->must_swap, data->nstrings);
+-      domain->orig_tab = (struct string_desc *)
++      domain->orig_tab = (const struct string_desc *)
+ 	((char *) data + W (domain->must_swap, data->orig_tab_offset));
+-      domain->trans_tab = (struct string_desc *)
++      domain->trans_tab = (const struct string_desc *)
+ 	((char *) data + W (domain->must_swap, data->trans_tab_offset));
+       domain->hash_size = W (domain->must_swap, data->hash_tab_size);
+-      domain->hash_tab = (nls_uint32 *)
+-	((char *) data + W (domain->must_swap, data->hash_tab_offset));
++      domain->hash_tab =
++	(domain->hash_size > 2
++	 ? (const nls_uint32 *)
++	   ((char *) data + W (domain->must_swap, data->hash_tab_offset))
++	 : NULL);
++      domain->must_swap_hash_tab = domain->must_swap;
++
++      /* Now dispatch on the minor revision.  */
++      switch (revision & 0xffff)
++	{
++	case 0:
++	  domain->n_sysdep_strings = 0;
++	  domain->orig_sysdep_tab = NULL;
++	  domain->trans_sysdep_tab = NULL;
++	  break;
++	case 1:
++	default:
++	  {
++	    nls_uint32 n_sysdep_strings;
++
++	    if (domain->hash_tab == NULL)
++	      /* This is invalid.  These minor revisions need a hash table.  */
++	      goto invalid;
++
++	    n_sysdep_strings =
++	      W (domain->must_swap, data->n_sysdep_strings);
++	    if (n_sysdep_strings > 0)
++	      {
++		nls_uint32 n_sysdep_segments;
++		const struct sysdep_segment *sysdep_segments;
++		const char **sysdep_segment_values;
++		const nls_uint32 *orig_sysdep_tab;
++		const nls_uint32 *trans_sysdep_tab;
++		nls_uint32 n_inmem_sysdep_strings;
++		size_t memneed;
++		char *mem;
++		struct sysdep_string_desc *inmem_orig_sysdep_tab;
++		struct sysdep_string_desc *inmem_trans_sysdep_tab;
++		nls_uint32 *inmem_hash_tab;
++		unsigned int i, j;
++
++		/* Get the values of the system dependent segments.  */
++		n_sysdep_segments =
++		  W (domain->must_swap, data->n_sysdep_segments);
++		sysdep_segments = (const struct sysdep_segment *)
++		  ((char *) data
++		   + W (domain->must_swap, data->sysdep_segments_offset));
++		sysdep_segment_values =
++		  alloca (n_sysdep_segments * sizeof (const char *));
++		for (i = 0; i < n_sysdep_segments; i++)
++		  {
++		    const char *name =
++		      (char *) data
++		      + W (domain->must_swap, sysdep_segments[i].offset);
++		    nls_uint32 namelen =
++		      W (domain->must_swap, sysdep_segments[i].length);
++
++		    if (!(namelen > 0 && name[namelen - 1] == '\0'))
++		      {
++			freea (sysdep_segment_values);
++			goto invalid;
++		      }
++
++		    sysdep_segment_values[i] = get_sysdep_segment_value (name);
++		  }
++
++		orig_sysdep_tab = (const nls_uint32 *)
++		  ((char *) data
++		   + W (domain->must_swap, data->orig_sysdep_tab_offset));
++		trans_sysdep_tab = (const nls_uint32 *)
++		  ((char *) data
++		   + W (domain->must_swap, data->trans_sysdep_tab_offset));
++
++		/* Compute the amount of additional memory needed for the
++		   system dependent strings and the augmented hash table.
++		   At the same time, also drop string pairs which refer to
++		   an undefined system dependent segment.  */
++		n_inmem_sysdep_strings = 0;
++		memneed = domain->hash_size * sizeof (nls_uint32);
++		for (i = 0; i < n_sysdep_strings; i++)
++		  {
++		    int valid = 1;
++		    size_t needs[2];
++
++		    for (j = 0; j < 2; j++)
++		      {
++			const struct sysdep_string *sysdep_string =
++			  (const struct sysdep_string *)
++			  ((char *) data
++			   + W (domain->must_swap,
++				j == 0
++				? orig_sysdep_tab[i]
++				: trans_sysdep_tab[i]));
++			size_t need = 0;
++			const struct segment_pair *p = sysdep_string->segments;
++
++			if (W (domain->must_swap, p->sysdepref) != SEGMENTS_END)
++			  for (p = sysdep_string->segments;; p++)
++			    {
++			      nls_uint32 sysdepref;
++
++			      need += W (domain->must_swap, p->segsize);
++
++			      sysdepref = W (domain->must_swap, p->sysdepref);
++			      if (sysdepref == SEGMENTS_END)
++				break;
++
++			      if (sysdepref >= n_sysdep_segments)
++				{
++				  /* Invalid.  */
++				  freea (sysdep_segment_values);
++				  goto invalid;
++				}
++
++			      if (sysdep_segment_values[sysdepref] == NULL)
++				{
++				  /* This particular string pair is invalid.  */
++				  valid = 0;
++				  break;
++				}
++
++			      need += strlen (sysdep_segment_values[sysdepref]);
++			    }
++
++			needs[j] = need;
++			if (!valid)
++			  break;
++		      }
++
++		    if (valid)
++		      {
++			n_inmem_sysdep_strings++;
++			memneed += needs[0] + needs[1];
++		      }
++		  }
++		memneed += 2 * n_inmem_sysdep_strings
++			   * sizeof (struct sysdep_string_desc);
++
++		if (n_inmem_sysdep_strings > 0)
++		  {
++		    unsigned int k;
++
++		    /* Allocate additional memory.  */
++		    mem = (char *) malloc (memneed);
++		    if (mem == NULL)
++		      goto invalid;
++
++		    domain->malloced = mem;
++		    inmem_orig_sysdep_tab = (struct sysdep_string_desc *) mem;
++		    mem += n_inmem_sysdep_strings
++			   * sizeof (struct sysdep_string_desc);
++		    inmem_trans_sysdep_tab = (struct sysdep_string_desc *) mem;
++		    mem += n_inmem_sysdep_strings
++			   * sizeof (struct sysdep_string_desc);
++		    inmem_hash_tab = (nls_uint32 *) mem;
++		    mem += domain->hash_size * sizeof (nls_uint32);
++
++		    /* Compute the system dependent strings.  */
++		    k = 0;
++		    for (i = 0; i < n_sysdep_strings; i++)
++		      {
++			int valid = 1;
++
++			for (j = 0; j < 2; j++)
++			  {
++			    const struct sysdep_string *sysdep_string =
++			      (const struct sysdep_string *)
++			      ((char *) data
++			       + W (domain->must_swap,
++				    j == 0
++				    ? orig_sysdep_tab[i]
++				    : trans_sysdep_tab[i]));
++			    const struct segment_pair *p =
++			      sysdep_string->segments;
++
++			    if (W (domain->must_swap, p->sysdepref)
++				!= SEGMENTS_END)
++			      for (p = sysdep_string->segments;; p++)
++				{
++				  nls_uint32 sysdepref;
++
++				  sysdepref =
++				    W (domain->must_swap, p->sysdepref);
++				  if (sysdepref == SEGMENTS_END)
++				    break;
++
++				  if (sysdep_segment_values[sysdepref] == NULL)
++				    {
++				      /* This particular string pair is
++					 invalid.  */
++				      valid = 0;
++				      break;
++				    }
++				}
++
++			    if (!valid)
++			      break;
++			  }
++
++			if (valid)
++			  {
++			    for (j = 0; j < 2; j++)
++			      {
++				const struct sysdep_string *sysdep_string =
++				  (const struct sysdep_string *)
++				  ((char *) data
++				   + W (domain->must_swap,
++					j == 0
++					? orig_sysdep_tab[i]
++					: trans_sysdep_tab[i]));
++				const char *static_segments =
++				  (char *) data
++				  + W (domain->must_swap, sysdep_string->offset);
++				const struct segment_pair *p =
++				  sysdep_string->segments;
++
++				/* Concatenate the segments, and fill
++				   inmem_orig_sysdep_tab[k] (for j == 0) and
++				   inmem_trans_sysdep_tab[k] (for j == 1).  */
++
++				struct sysdep_string_desc *inmem_tab_entry =
++				  (j == 0
++				   ? inmem_orig_sysdep_tab
++				   : inmem_trans_sysdep_tab)
++				  + k;
++
++				if (W (domain->must_swap, p->sysdepref)
++				    == SEGMENTS_END)
++				  {
++				    /* Only one static segment.  */
++				    inmem_tab_entry->length =
++				      W (domain->must_swap, p->segsize);
++				    inmem_tab_entry->pointer = static_segments;
++				  }
++				else
++				  {
++				    inmem_tab_entry->pointer = mem;
++
++				    for (p = sysdep_string->segments;; p++)
++				      {
++					nls_uint32 segsize =
++					  W (domain->must_swap, p->segsize);
++					nls_uint32 sysdepref =
++					  W (domain->must_swap, p->sysdepref);
++					size_t n;
++
++					if (segsize > 0)
++					  {
++					    memcpy (mem, static_segments, segsize);
++					    mem += segsize;
++					    static_segments += segsize;
++					  }
++
++					if (sysdepref == SEGMENTS_END)
++					  break;
++
++					n = strlen (sysdep_segment_values[sysdepref]);
++					memcpy (mem, sysdep_segment_values[sysdepref], n);
++					mem += n;
++				      }
++
++				    inmem_tab_entry->length =
++				      mem - inmem_tab_entry->pointer;
++				  }
++			      }
++
++			    k++;
++			  }
++		      }
++		    if (k != n_inmem_sysdep_strings)
++		      abort ();
++
++		    /* Compute the augmented hash table.  */
++		    for (i = 0; i < domain->hash_size; i++)
++		      inmem_hash_tab[i] =
++			W (domain->must_swap_hash_tab, domain->hash_tab[i]);
++		    for (i = 0; i < n_inmem_sysdep_strings; i++)
++		      {
++			const char *msgid = inmem_orig_sysdep_tab[i].pointer;
++			nls_uint32 hash_val = hash_string (msgid);
++			nls_uint32 idx = hash_val % domain->hash_size;
++			nls_uint32 incr =
++			  1 + (hash_val % (domain->hash_size - 2));
++
++			for (;;)
++			  {
++			    if (inmem_hash_tab[idx] == 0)
++			      {
++				/* Hash table entry is empty.  Use it.  */
++				inmem_hash_tab[idx] = 1 + domain->nstrings + i;
++				break;
++			      }
++
++			    if (idx >= domain->hash_size - incr)
++			      idx -= domain->hash_size - incr;
++			    else
++			      idx += incr;
++			  }
++		      }
++
++		    domain->n_sysdep_strings = n_inmem_sysdep_strings;
++		    domain->orig_sysdep_tab = inmem_orig_sysdep_tab;
++		    domain->trans_sysdep_tab = inmem_trans_sysdep_tab;
++
++		    domain->hash_tab = inmem_hash_tab;
++		    domain->must_swap_hash_tab = 0;
++		  }
++		else
++		  {
++		    domain->n_sysdep_strings = 0;
++		    domain->orig_sysdep_tab = NULL;
++		    domain->trans_sysdep_tab = NULL;
++		  }
++
++		freea (sysdep_segment_values);
++	      }
++	    else
++	      {
++		domain->n_sysdep_strings = 0;
++		domain->orig_sysdep_tab = NULL;
++		domain->trans_sysdep_tab = NULL;
++	      }
++	  }
++	  break;
++	}
+       break;
+     default:
+-      /* This is an illegal revision.  */
+-#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+-    || defined _LIBC
++      /* This is an invalid revision.  */
++    invalid:
++      /* This is an invalid .mo file.  */
++      if (domain->malloced)
++	free (domain->malloced);
++#ifdef HAVE_MMAP
+       if (use_mmap)
+-	munmap ((caddr_t) data, st.st_size);
++	munmap ((caddr_t) data, size);
+       else
+ #endif
+ 	free (data);
+@@ -193,7 +1385,36 @@
+       return;
+     }
+ 
+-  /* Show that one domain is changed.  This might make some cached
+-     translations invalid.  */
+-  ++_nl_msg_cat_cntr;
++  /* Now initialize the character set converter from the character set
++     the file is encoded with (found in the header entry) to the domain's
++     specified character set or the locale's character set.  */
++  nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding);
++
++  /* Also look for a plural specification.  */
++  EXTRACT_PLURAL_EXPRESSION (nullentry, &domain->plural, &domain->nplurals);
+ }
++
++
++#ifdef _LIBC
++void
++internal_function
++_nl_unload_domain (struct loaded_domain *domain)
++{
++  if (domain->plural != &__gettext_germanic_plural)
++    __gettext_free_exp (domain->plural);
++
++  _nl_free_domain_conv (domain);
++
++  if (domain->malloced)
++    free (domain->malloced);
++
++# ifdef _POSIX_MAPPED_FILES
++  if (domain->use_mmap)
++    munmap ((caddr_t) domain->data, domain->mmap_size);
++  else
++# endif	/* _POSIX_MAPPED_FILES */
++    free ((void *) domain->data);
++
++  free (domain);
++}
++#endif
+--- lrzsz-0.12.20.safe/intl/localcharset.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/localcharset.c	2004-09-12 14:40:34.478729392 -0400
+@@ -0,0 +1,398 @@
++/* Determine a canonical name for the current locale's character encoding.
++
++   Copyright (C) 2000-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* Written by Bruno Haible <bruno@clisp.org>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++/* Specification.  */
++#include "localcharset.h"
++
++#if HAVE_STDDEF_H
++# include <stddef.h>
++#endif
++
++#include <stdio.h>
++#if HAVE_STRING_H
++# include <string.h>
++#else
++# include <strings.h>
++#endif
++#if HAVE_STDLIB_H
++# include <stdlib.h>
++#endif
++
++#if defined _WIN32 || defined __WIN32__
++# undef WIN32   /* avoid warning on mingw32 */
++# define WIN32
++#endif
++
++#if defined __EMX__
++/* Assume EMX program runs on OS/2, even if compiled under DOS.  */
++# define OS2
++#endif
++
++#if !defined WIN32
++# if HAVE_LANGINFO_CODESET
++#  include <langinfo.h>
++# else
++#  if HAVE_SETLOCALE
++#   include <locale.h>
++#  endif
++# endif
++#elif defined WIN32
++# define WIN32_LEAN_AND_MEAN
++# include <windows.h>
++#endif
++#if defined OS2
++# define INCL_DOS
++# include <os2.h>
++#endif
++
++#if ENABLE_RELOCATABLE
++# include "relocatable.h"
++#else
++# define relocate(pathname) (pathname)
++#endif
++
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++  /* Win32, OS/2, DOS */
++# define ISSLASH(C) ((C) == '/' || (C) == '\\')
++#endif
++
++#ifndef DIRECTORY_SEPARATOR
++# define DIRECTORY_SEPARATOR '/'
++#endif
++
++#ifndef ISSLASH
++# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
++#endif
++
++#if HAVE_DECL_GETC_UNLOCKED
++# undef getc
++# define getc getc_unlocked
++#endif
++
++/* The following static variable is declared 'volatile' to avoid a
++   possible multithread problem in the function get_charset_aliases. If we
++   are running in a threaded environment, and if two threads initialize
++   'charset_aliases' simultaneously, both will produce the same value,
++   and everything will be ok if the two assignments to 'charset_aliases'
++   are atomic. But I don't know what will happen if the two assignments mix.  */
++#if __STDC__ != 1
++# define volatile /* empty */
++#endif
++/* Pointer to the contents of the charset.alias file, if it has already been
++   read, else NULL.  Its format is:
++   ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0'  */
++static const char * volatile charset_aliases;
++
++/* Return a pointer to the contents of the charset.alias file.  */
++static const char *
++get_charset_aliases ()
++{
++  const char *cp;
++
++  cp = charset_aliases;
++  if (cp == NULL)
++    {
++#if !(defined VMS || defined WIN32)
++      FILE *fp;
++      const char *dir = relocate (LIBDIR);
++      const char *base = "charset.alias";
++      char *file_name;
++
++      /* Concatenate dir and base into freshly allocated file_name.  */
++      {
++	size_t dir_len = strlen (dir);
++	size_t base_len = strlen (base);
++	int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
++	file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
++	if (file_name != NULL)
++	  {
++	    memcpy (file_name, dir, dir_len);
++	    if (add_slash)
++	      file_name[dir_len] = DIRECTORY_SEPARATOR;
++	    memcpy (file_name + dir_len + add_slash, base, base_len + 1);
++	  }
++      }
++
++      if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL)
++	/* Out of memory or file not found, treat it as empty.  */
++	cp = "";
++      else
++	{
++	  /* Parse the file's contents.  */
++	  int c;
++	  char buf1[50+1];
++	  char buf2[50+1];
++	  char *res_ptr = NULL;
++	  size_t res_size = 0;
++	  size_t l1, l2;
++
++	  for (;;)
++	    {
++	      c = getc (fp);
++	      if (c == EOF)
++		break;
++	      if (c == '\n' || c == ' ' || c == '\t')
++		continue;
++	      if (c == '#')
++		{
++		  /* Skip comment, to end of line.  */
++		  do
++		    c = getc (fp);
++		  while (!(c == EOF || c == '\n'));
++		  if (c == EOF)
++		    break;
++		  continue;
++		}
++	      ungetc (c, fp);
++	      if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
++		break;
++	      l1 = strlen (buf1);
++	      l2 = strlen (buf2);
++	      if (res_size == 0)
++		{
++		  res_size = l1 + 1 + l2 + 1;
++		  res_ptr = (char *) malloc (res_size + 1);
++		}
++	      else
++		{
++		  res_size += l1 + 1 + l2 + 1;
++		  res_ptr = (char *) realloc (res_ptr, res_size + 1);
++		}
++	      if (res_ptr == NULL)
++		{
++		  /* Out of memory. */
++		  res_size = 0;
++		  break;
++		}
++	      strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
++	      strcpy (res_ptr + res_size - (l2 + 1), buf2);
++	    }
++	  fclose (fp);
++	  if (res_size == 0)
++	    cp = "";
++	  else
++	    {
++	      *(res_ptr + res_size) = '\0';
++	      cp = res_ptr;
++	    }
++	}
++
++      if (file_name != NULL)
++	free (file_name);
++
++#else
++
++# if defined VMS
++      /* To avoid the troubles of an extra file charset.alias_vms in the
++	 sources of many GNU packages, simply inline the aliases here.  */
++      /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
++	 "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
++	 section 10.7 "Handling Different Character Sets".  */
++      cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
++	   "ISO8859-2" "\0" "ISO-8859-2" "\0"
++	   "ISO8859-5" "\0" "ISO-8859-5" "\0"
++	   "ISO8859-7" "\0" "ISO-8859-7" "\0"
++	   "ISO8859-8" "\0" "ISO-8859-8" "\0"
++	   "ISO8859-9" "\0" "ISO-8859-9" "\0"
++	   /* Japanese */
++	   "eucJP" "\0" "EUC-JP" "\0"
++	   "SJIS" "\0" "SHIFT_JIS" "\0"
++	   "DECKANJI" "\0" "DEC-KANJI" "\0"
++	   "SDECKANJI" "\0" "EUC-JP" "\0"
++	   /* Chinese */
++	   "eucTW" "\0" "EUC-TW" "\0"
++	   "DECHANYU" "\0" "DEC-HANYU" "\0"
++	   "DECHANZI" "\0" "GB2312" "\0"
++	   /* Korean */
++	   "DECKOREAN" "\0" "EUC-KR" "\0";
++# endif
++
++# if defined WIN32
++      /* To avoid the troubles of installing a separate file in the same
++	 directory as the DLL and of retrieving the DLL's directory at
++	 runtime, simply inline the aliases here.  */
++
++      cp = "CP936" "\0" "GBK" "\0"
++	   "CP1361" "\0" "JOHAB" "\0"
++	   "CP20127" "\0" "ASCII" "\0"
++	   "CP20866" "\0" "KOI8-R" "\0"
++	   "CP21866" "\0" "KOI8-RU" "\0"
++	   "CP28591" "\0" "ISO-8859-1" "\0"
++	   "CP28592" "\0" "ISO-8859-2" "\0"
++	   "CP28593" "\0" "ISO-8859-3" "\0"
++	   "CP28594" "\0" "ISO-8859-4" "\0"
++	   "CP28595" "\0" "ISO-8859-5" "\0"
++	   "CP28596" "\0" "ISO-8859-6" "\0"
++	   "CP28597" "\0" "ISO-8859-7" "\0"
++	   "CP28598" "\0" "ISO-8859-8" "\0"
++	   "CP28599" "\0" "ISO-8859-9" "\0"
++	   "CP28605" "\0" "ISO-8859-15" "\0";
++# endif
++#endif
++
++      charset_aliases = cp;
++    }
++
++  return cp;
++}
++
++/* Determine the current locale's character encoding, and canonicalize it
++   into one of the canonical names listed in config.charset.
++   The result must not be freed; it is statically allocated.
++   If the canonical name cannot be determined, the result is a non-canonical
++   name.  */
++
++#ifdef STATIC
++STATIC
++#endif
++const char *
++locale_charset ()
++{
++  const char *codeset;
++  const char *aliases;
++
++#if !(defined WIN32 || defined OS2)
++
++# if HAVE_LANGINFO_CODESET
++
++  /* Most systems support nl_langinfo (CODESET) nowadays.  */
++  codeset = nl_langinfo (CODESET);
++
++# else
++
++  /* On old systems which lack it, use setlocale or getenv.  */
++  const char *locale = NULL;
++
++  /* But most old systems don't have a complete set of locales.  Some
++     (like SunOS 4 or DJGPP) have only the C locale.  Therefore we don't
++     use setlocale here; it would return "C" when it doesn't support the
++     locale name the user has set.  */
++#  if HAVE_SETLOCALE && 0
++  locale = setlocale (LC_CTYPE, NULL);
++#  endif
++  if (locale == NULL || locale[0] == '\0')
++    {
++      locale = getenv ("LC_ALL");
++      if (locale == NULL || locale[0] == '\0')
++	{
++	  locale = getenv ("LC_CTYPE");
++	  if (locale == NULL || locale[0] == '\0')
++	    locale = getenv ("LANG");
++	}
++    }
++
++  /* On some old systems, one used to set locale = "iso8859_1". On others,
++     you set it to "language_COUNTRY.charset". In any case, we resolve it
++     through the charset.alias file.  */
++  codeset = locale;
++
++# endif
++
++#elif defined WIN32
++
++  static char buf[2 + 10 + 1];
++
++  /* Woe32 has a function returning the locale's codepage as a number.  */
++  sprintf (buf, "CP%u", GetACP ());
++  codeset = buf;
++
++#elif defined OS2
++
++  const char *locale;
++  static char buf[2 + 10 + 1];
++  ULONG cp[3];
++  ULONG cplen;
++
++  /* Allow user to override the codeset, as set in the operating system,
++     with standard language environment variables.  */
++  locale = getenv ("LC_ALL");
++  if (locale == NULL || locale[0] == '\0')
++    {
++      locale = getenv ("LC_CTYPE");
++      if (locale == NULL || locale[0] == '\0')
++	locale = getenv ("LANG");
++    }
++  if (locale != NULL && locale[0] != '\0')
++    {
++      /* If the locale name contains an encoding after the dot, return it.  */
++      const char *dot = strchr (locale, '.');
++
++      if (dot != NULL)
++	{
++	  const char *modifier;
++
++	  dot++;
++	  /* Look for the possible @... trailer and remove it, if any.  */
++	  modifier = strchr (dot, '@');
++	  if (modifier == NULL)
++	    return dot;
++	  if (modifier - dot < sizeof (buf))
++	    {
++	      memcpy (buf, dot, modifier - dot);
++	      buf [modifier - dot] = '\0';
++	      return buf;
++	    }
++	}
++
++      /* Resolve through the charset.alias file.  */
++      codeset = locale;
++    }
++  else
++    {
++      /* OS/2 has a function returning the locale's codepage as a number.  */
++      if (DosQueryCp (sizeof (cp), cp, &cplen))
++	codeset = "";
++      else
++	{
++	  sprintf (buf, "CP%u", cp[0]);
++	  codeset = buf;
++	}
++    }
++
++#endif
++
++  if (codeset == NULL)
++    /* The canonical name cannot be determined.  */
++    codeset = "";
++
++  /* Resolve alias. */
++  for (aliases = get_charset_aliases ();
++       *aliases != '\0';
++       aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
++    if (strcmp (codeset, aliases) == 0
++	|| (aliases[0] == '*' && aliases[1] == '\0'))
++      {
++	codeset = aliases + strlen (aliases) + 1;
++	break;
++      }
++
++  /* Don't return an empty string.  GNU libc and GNU libiconv interpret
++     the empty string as denoting "the locale's character encoding",
++     thus GNU libiconv would call this function a second time.  */
++  if (codeset[0] == '\0')
++    codeset = "ASCII";
++
++  return codeset;
++}
+--- lrzsz-0.12.20.safe/intl/localcharset.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/localcharset.h	2004-09-12 14:40:34.483728632 -0400
+@@ -0,0 +1,42 @@
++/* Determine a canonical name for the current locale's character encoding.
++   Copyright (C) 2000-2003 Free Software Foundation, Inc.
++   This file is part of the GNU CHARSET Library.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _LOCALCHARSET_H
++#define _LOCALCHARSET_H
++
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++/* Determine the current locale's character encoding, and canonicalize it
++   into one of the canonical names listed in config.charset.
++   The result must not be freed; it is statically allocated.
++   If the canonical name cannot be determined, the result is a non-canonical
++   name.  */
++extern const char * locale_charset (void);
++
++
++#ifdef __cplusplus
++}
++#endif
++
++
++#endif /* _LOCALCHARSET_H */
+--- lrzsz-0.12.20.safe/intl/locale.alias	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/locale.alias	2004-09-12 14:40:34.499726200 -0400
+@@ -0,0 +1,78 @@
++# Locale name alias data base.
++# Copyright (C) 1996-2001,2003 Free Software Foundation, Inc.
++#
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Library General Public License as published
++# by the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# Library General Public License for more details.
++#
++# You should have received a copy of the GNU Library General Public
++# License along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++# USA.
++
++# The format of this file is the same as for the corresponding file of
++# the X Window System, which normally can be found in
++#	/usr/lib/X11/locale/locale.alias
++# A single line contains two fields: an alias and a substitution value.
++# All entries are case independent.
++
++# Note: This file is far from being complete.  If you have a value for
++# your own site which you think might be useful for others too, share
++# it with the rest of us.  Send it using the `glibcbug' script to
++# bugs@gnu.org.
++
++# Packages using this file: 
++
++bokmal		nb_NO.ISO-8859-1
++bokmål		nb_NO.ISO-8859-1
++catalan		ca_ES.ISO-8859-1
++croatian	hr_HR.ISO-8859-2
++czech		cs_CZ.ISO-8859-2
++danish          da_DK.ISO-8859-1
++dansk		da_DK.ISO-8859-1
++deutsch		de_DE.ISO-8859-1
++dutch		nl_NL.ISO-8859-1
++eesti		et_EE.ISO-8859-1
++estonian	et_EE.ISO-8859-1
++finnish         fi_FI.ISO-8859-1
++français	fr_FR.ISO-8859-1
++french		fr_FR.ISO-8859-1
++galego		gl_ES.ISO-8859-1
++galician	gl_ES.ISO-8859-1
++german		de_DE.ISO-8859-1
++greek           el_GR.ISO-8859-7
++hebrew          he_IL.ISO-8859-8
++hrvatski	hr_HR.ISO-8859-2
++hungarian       hu_HU.ISO-8859-2
++icelandic       is_IS.ISO-8859-1
++italian         it_IT.ISO-8859-1
++japanese	ja_JP.eucJP
++japanese.euc	ja_JP.eucJP
++ja_JP		ja_JP.eucJP
++ja_JP.ujis	ja_JP.eucJP
++japanese.sjis	ja_JP.SJIS
++korean		ko_KR.eucKR
++korean.euc 	ko_KR.eucKR
++ko_KR		ko_KR.eucKR
++lithuanian      lt_LT.ISO-8859-13
++no_NO		nb_NO.ISO-8859-1
++no_NO.ISO-8859-1 nb_NO.ISO-8859-1
++norwegian       nb_NO.ISO-8859-1
++nynorsk		nn_NO.ISO-8859-1
++polish          pl_PL.ISO-8859-2
++portuguese      pt_PT.ISO-8859-1
++romanian        ro_RO.ISO-8859-2
++russian         ru_RU.ISO-8859-5
++slovak          sk_SK.ISO-8859-2
++slovene         sl_SI.ISO-8859-2
++slovenian       sl_SI.ISO-8859-2
++spanish         es_ES.ISO-8859-1
++swedish         sv_SE.ISO-8859-1
++thai		th_TH.TIS-620
++turkish         tr_TR.ISO-8859-9
+--- lrzsz-0.12.20.safe/intl/localealias.c	1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/localealias.c	2004-09-12 14:40:34.505725288 -0400
+@@ -1,20 +1,27 @@
+-/* Handle aliases for locale names
+-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+-   Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
++/* Handle aliases for locale names.
++   Copyright (C) 1995-1999, 2000-2001, 2003 Free Software Foundation, Inc.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* Tell glibc's <string.h> to provide a prototype for mempcpy().
++   This must come before <config.h> because <config.h> may include
++   <features.h>, and once <features.h> has been included, it's too late.  */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE    1
++#endif
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+@@ -22,56 +29,45 @@
+ 
+ #include <ctype.h>
+ #include <stdio.h>
++#if defined _LIBC || defined HAVE___FSETLOCKING
++# include <stdio_ext.h>
++#endif
+ #include <sys/types.h>
+ 
+ #ifdef __GNUC__
++# undef alloca
+ # define alloca __builtin_alloca
+ # define HAVE_ALLOCA 1
+ #else
+-# if defined HAVE_ALLOCA_H || defined _LIBC
+-#  include <alloca.h>
++# ifdef _MSC_VER
++#  include <malloc.h>
++#  define alloca _alloca
+ # else
+-#  ifdef _AIX
+- #pragma alloca
++#  if defined HAVE_ALLOCA_H || defined _LIBC
++#   include <alloca.h>
+ #  else
+-#   ifndef alloca
++#   ifdef _AIX
++ #pragma alloca
++#   else
++#    ifndef alloca
+ char *alloca ();
++#    endif
+ #   endif
+ #  endif
+ # endif
+ #endif
+ 
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#else
+-char *getenv ();
+-# ifdef HAVE_MALLOC_H
+-#  include <malloc.h>
+-# else
+-void free ();
+-# endif
+-#endif
++#include <stdlib.h>
++#include <string.h>
+ 
+-#if defined HAVE_STRING_H || defined _LIBC
+-# ifndef _GNU_SOURCE
+-#  define _GNU_SOURCE	1
+-# endif
+-# include <string.h>
++#include "gettextP.h"
++
++#if ENABLE_RELOCATABLE
++# include "relocatable.h"
+ #else
+-# include <strings.h>
+-# ifndef memcpy
+-#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+-# endif
+-#endif
+-#if !HAVE_STRCHR && !defined _LIBC
+-# ifndef strchr
+-#  define strchr index
+-# endif
++# define relocate(pathname) (pathname)
+ #endif
+ 
+-#include "gettext.h"
+-#include "gettextP.h"
+-
+ /* @@ end of prolog @@ */
+ 
+ #ifdef _LIBC
+@@ -79,43 +75,49 @@
+    because some ANSI C functions will require linking with this object
+    file and the name space must not be polluted.  */
+ # define strcasecmp __strcasecmp
++
++# ifndef mempcpy
++#  define mempcpy __mempcpy
++# endif
++# define HAVE_MEMPCPY	1
++# define HAVE___FSETLOCKING	1
++
++/* We need locking here since we can be called from different places.  */
++# include <bits/libc-lock.h>
++
++__libc_lock_define_initialized (static, lock);
++#endif
++
++#ifndef internal_function
++# define internal_function
+ #endif
+ 
++/* Some optimizations for glibc.  */
++#ifdef _LIBC
++# define FEOF(fp)		feof_unlocked (fp)
++# define FGETS(buf, n, fp)	fgets_unlocked (buf, n, fp)
++#else
++# define FEOF(fp)		feof (fp)
++# define FGETS(buf, n, fp)	fgets (buf, n, fp)
++#endif
+ 
+-/* For those loosing systems which don't have `alloca' we have to add
++/* For those losing systems which don't have `alloca' we have to add
+    some additional code emulating it.  */
+ #ifdef HAVE_ALLOCA
+-/* Nothing has to be done.  */
+-# define ADD_BLOCK(list, address) /* nothing */
+-# define FREE_BLOCKS(list) /* nothing */
++# define freea(p) /* nothing */
+ #else
+-struct block_list
+-{
+-  void *address;
+-  struct block_list *next;
+-};
+-# define ADD_BLOCK(list, addr)						      \
+-  do {									      \
+-    struct block_list *newp = (struct block_list *) malloc (sizeof (*newp));  \
+-    /* If we cannot get a free block we cannot add the new element to	      \
+-       the list.  */							      \
+-    if (newp != NULL) {							      \
+-      newp->address = (addr);						      \
+-      newp->next = (list);						      \
+-      (list) = newp;							      \
+-    }									      \
+-  } while (0)
+-# define FREE_BLOCKS(list)						      \
+-  do {									      \
+-    while (list != NULL) {						      \
+-      struct block_list *old = list;					      \
+-      list = list->next;						      \
+-      free (old);							      \
+-    }									      \
+-  } while (0)
+-# undef alloca
+-# define alloca(size) (malloc (size))
+-#endif	/* have alloca */
++# define alloca(n) malloc (n)
++# define freea(p) free (p)
++#endif
++
++#if defined _LIBC_REENTRANT || HAVE_DECL_FGETS_UNLOCKED
++# undef fgets
++# define fgets(buf, len, s) fgets_unlocked (buf, len, s)
++#endif
++#if defined _LIBC_REENTRANT || HAVE_DECL_FEOF_UNLOCKED
++# undef feof
++# define feof(s) feof_unlocked (s)
++#endif
+ 
+ 
+ struct alias_map
+@@ -125,26 +127,41 @@
+ };
+ 
+ 
+-static struct alias_map *map;
+-static size_t nmap = 0;
+-static size_t maxmap = 0;
++#ifndef _LIBC
++# define libc_freeres_ptr(decl) decl
++#endif
++
++libc_freeres_ptr (static char *string_space);
++static size_t string_space_act;
++static size_t string_space_max;
++libc_freeres_ptr (static struct alias_map *map);
++static size_t nmap;
++static size_t maxmap;
+ 
+ 
+ /* Prototypes for local functions.  */
+-static size_t read_alias_file PARAMS ((const char *fname, int fname_len));
+-static void extend_alias_table PARAMS ((void));
+-static int alias_compare PARAMS ((const struct alias_map *map1,
+-				  const struct alias_map *map2));
++static size_t read_alias_file (const char *fname, int fname_len)
++     internal_function;
++static int extend_alias_table (void);
++static int alias_compare (const struct alias_map *map1,
++			  const struct alias_map *map2);
+ 
+ 
+ const char *
+-_nl_expand_alias (name)
+-    const char *name;
++_nl_expand_alias (const char *name)
+ {
+-  static const char *locale_alias_path = LOCALE_ALIAS_PATH;
++  static const char *locale_alias_path;
+   struct alias_map *retval;
++  const char *result = NULL;
+   size_t added;
+ 
++#ifdef _LIBC
++  __libc_lock_lock (lock);
++#endif
++
++  if (locale_alias_path == NULL)
++    locale_alias_path = LOCALE_ALIAS_PATH;
++
+   do
+     {
+       struct alias_map item;
+@@ -154,15 +171,18 @@
+       if (nmap > 0)
+ 	retval = (struct alias_map *) bsearch (&item, map, nmap,
+ 					       sizeof (struct alias_map),
+-					       (int (*) PARAMS ((const void *,
+-								 const void *))
++					       (int (*) (const void *,
++							 const void *)
+ 						) alias_compare);
+       else
+ 	retval = NULL;
+ 
+       /* We really found an alias.  Return the value.  */
+       if (retval != NULL)
+-	return retval->value;
++	{
++	  result = retval->value;
++	  break;
++	}
+ 
+       /* Perhaps we can find another alias file.  */
+       added = 0;
+@@ -170,11 +190,12 @@
+ 	{
+ 	  const char *start;
+ 
+-	  while (locale_alias_path[0] == ':')
++	  while (locale_alias_path[0] == PATH_SEPARATOR)
+ 	    ++locale_alias_path;
+ 	  start = locale_alias_path;
+ 
+-	  while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
++	  while (locale_alias_path[0] != '\0'
++		 && locale_alias_path[0] != PATH_SEPARATOR)
+ 	    ++locale_alias_path;
+ 
+ 	  if (start < locale_alias_path)
+@@ -183,78 +204,87 @@
+     }
+   while (added != 0);
+ 
+-  return NULL;
++#ifdef _LIBC
++  __libc_lock_unlock (lock);
++#endif
++
++  return result;
+ }
+ 
+ 
+ static size_t
+-read_alias_file (fname, fname_len)
+-     const char *fname;
+-     int fname_len;
++internal_function
++read_alias_file (const char *fname, int fname_len)
+ {
+-#ifndef HAVE_ALLOCA
+-  struct block_list *block_list = NULL;
+-#endif
+   FILE *fp;
+   char *full_fname;
+   size_t added;
+   static const char aliasfile[] = "/locale.alias";
+ 
+   full_fname = (char *) alloca (fname_len + sizeof aliasfile);
+-  ADD_BLOCK (block_list, full_fname);
++#ifdef HAVE_MEMPCPY
++  mempcpy (mempcpy (full_fname, fname, fname_len),
++	   aliasfile, sizeof aliasfile);
++#else
+   memcpy (full_fname, fname, fname_len);
+   memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
++#endif
+ 
+-  fp = fopen (full_fname, "r");
++  fp = fopen (relocate (full_fname), "r");
++  freea (full_fname);
+   if (fp == NULL)
+-    {
+-      FREE_BLOCKS (block_list);
+-      return 0;
+-    }
++    return 0;
++
++#ifdef HAVE___FSETLOCKING
++  /* No threads present.  */
++  __fsetlocking (fp, FSETLOCKING_BYCALLER);
++#endif
+ 
+   added = 0;
+-  while (!feof (fp))
++  while (!FEOF (fp))
+     {
+       /* It is a reasonable approach to use a fix buffer here because
+ 	 a) we are only interested in the first two fields
+ 	 b) these fields must be usable as file names and so must not
+ 	    be that long
+-       */
+-      char buf[BUFSIZ];
++	 We avoid a multi-kilobyte buffer here since this would use up
++	 stack space which we might not have if the program ran out of
++	 memory.  */
++      char buf[400];
+       char *alias;
+       char *value;
+       char *cp;
+ 
+-      if (fgets (buf, BUFSIZ, fp) == NULL)
++      if (FGETS (buf, sizeof buf, fp) == NULL)
+ 	/* EOF reached.  */
+ 	break;
+ 
+       cp = buf;
+       /* Ignore leading white space.  */
+-      while (isspace (cp[0]))
++      while (isspace ((unsigned char) cp[0]))
+ 	++cp;
+ 
+       /* A leading '#' signals a comment line.  */
+       if (cp[0] != '\0' && cp[0] != '#')
+ 	{
+ 	  alias = cp++;
+-	  while (cp[0] != '\0' && !isspace (cp[0]))
++	  while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
+ 	    ++cp;
+ 	  /* Terminate alias name.  */
+ 	  if (cp[0] != '\0')
+ 	    *cp++ = '\0';
+ 
+ 	  /* Now look for the beginning of the value.  */
+-	  while (isspace (cp[0]))
++	  while (isspace ((unsigned char) cp[0]))
+ 	    ++cp;
+ 
+ 	  if (cp[0] != '\0')
+ 	    {
+-	      char *tp;
+-	      size_t len;
++	      size_t alias_len;
++	      size_t value_len;
+ 
+ 	      value = cp++;
+-	      while (cp[0] != '\0' && !isspace (cp[0]))
++	      while (cp[0] != '\0' && !isspace ((unsigned char) cp[0]))
+ 		++cp;
+ 	      /* Terminate value.  */
+ 	      if (cp[0] == '\n')
+@@ -269,28 +299,44 @@
+ 		*cp++ = '\0';
+ 
+ 	      if (nmap >= maxmap)
+-		extend_alias_table ();
+-
+-	      /* We cannot depend on strdup available in the libc.  Sigh!  */
+-	      len = strlen (alias) + 1;
+-	      tp = (char *) malloc (len);
+-	      if (tp == NULL)
+-		{
+-		  FREE_BLOCKS (block_list);
++		if (__builtin_expect (extend_alias_table (), 0))
+ 		  return added;
+-		}
+-	      memcpy (tp, alias, len);
+-	      map[nmap].alias = tp;
+ 
+-	      len = strlen (value) + 1;
+-	      tp = (char *) malloc (len);
+-	      if (tp == NULL)
++	      alias_len = strlen (alias) + 1;
++	      value_len = strlen (value) + 1;
++
++	      if (string_space_act + alias_len + value_len > string_space_max)
+ 		{
+-		  FREE_BLOCKS (block_list);
+-		  return added;
++		  /* Increase size of memory pool.  */
++		  size_t new_size = (string_space_max
++				     + (alias_len + value_len > 1024
++					? alias_len + value_len : 1024));
++		  char *new_pool = (char *) realloc (string_space, new_size);
++		  if (new_pool == NULL)
++		    return added;
++
++		  if (__builtin_expect (string_space != new_pool, 0))
++		    {
++		      size_t i;
++
++		      for (i = 0; i < nmap; i++)
++			{
++			  map[i].alias += new_pool - string_space;
++			  map[i].value += new_pool - string_space;
++			}
++		    }
++
++		  string_space = new_pool;
++		  string_space_max = new_size;
+ 		}
+-	      memcpy (tp, value, len);
+-	      map[nmap].value = tp;
++
++	      map[nmap].alias = memcpy (&string_space[string_space_act],
++					alias, alias_len);
++	      string_space_act += alias_len;
++
++	      map[nmap].value = memcpy (&string_space[string_space_act],
++					value, value_len);
++	      string_space_act += value_len;
+ 
+ 	      ++nmap;
+ 	      ++added;
+@@ -299,14 +345,11 @@
+ 
+       /* Possibly not the whole line fits into the buffer.  Ignore
+ 	 the rest of the line.  */
+-      while (strchr (cp, '\n') == NULL)
+-	{
+-	  cp = buf;
+-	  if (fgets (buf, BUFSIZ, fp) == NULL)
+-	    /* Make sure the inner loop will be left.  The outer loop
+-	       will exit at the `feof' test.  */
+-	    *cp = '\n';
+-	}
++      while (strchr (buf, '\n') == NULL)
++	if (FGETS (buf, sizeof buf, fp) == NULL)
++	  /* Make sure the inner loop will be left.  The outer loop
++	     will exit at the `feof' test.  */
++	  break;
+     }
+ 
+   /* Should we test for ferror()?  I think we have to silently ignore
+@@ -315,40 +358,33 @@
+ 
+   if (added > 0)
+     qsort (map, nmap, sizeof (struct alias_map),
+-	   (int (*) PARAMS ((const void *, const void *))) alias_compare);
++	   (int (*) (const void *, const void *)) alias_compare);
+ 
+-  FREE_BLOCKS (block_list);
+   return added;
+ }
+ 
+ 
+-static void
++static int
+ extend_alias_table ()
+ {
+   size_t new_size;
+   struct alias_map *new_map;
+ 
+   new_size = maxmap == 0 ? 100 : 2 * maxmap;
+-  new_map = (struct alias_map *) malloc (new_size
+-					 * sizeof (struct alias_map));
++  new_map = (struct alias_map *) realloc (map, (new_size
++						* sizeof (struct alias_map)));
+   if (new_map == NULL)
+     /* Simply don't extend: we don't have any more core.  */
+-    return;
+-
+-  memcpy (new_map, map, nmap * sizeof (struct alias_map));
+-
+-  if (maxmap != 0)
+-    free (map);
++    return -1;
+ 
+   map = new_map;
+   maxmap = new_size;
++  return 0;
+ }
+ 
+ 
+ static int
+-alias_compare (map1, map2)
+-     const struct alias_map *map1;
+-     const struct alias_map *map2;
++alias_compare (const struct alias_map *map1, const struct alias_map *map2)
+ {
+ #if defined _LIBC || defined HAVE_STRCASECMP
+   return strcasecmp (map1->alias, map2->alias);
+--- lrzsz-0.12.20.safe/intl/localename.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/localename.c	2004-09-12 14:40:34.510724528 -0400
+@@ -0,0 +1,1142 @@
++/* Determine the current selected locale.
++   Copyright (C) 1995-1999, 2000-2004 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* Written by Ulrich Drepper <drepper@gnu.org>, 1995.  */
++/* Win32 code written by Tor Lillqvist <tml@iki.fi>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <stdlib.h>
++#include <locale.h>
++
++#if defined _WIN32 || defined __WIN32__
++# undef WIN32   /* avoid warning on mingw32 */
++# define WIN32
++#endif
++
++#ifdef WIN32
++# define WIN32_LEAN_AND_MEAN
++# include <windows.h>
++/* List of language codes, sorted by value:
++   0x01 LANG_ARABIC
++   0x02 LANG_BULGARIAN
++   0x03 LANG_CATALAN
++   0x04 LANG_CHINESE
++   0x05 LANG_CZECH
++   0x06 LANG_DANISH
++   0x07 LANG_GERMAN
++   0x08 LANG_GREEK
++   0x09 LANG_ENGLISH
++   0x0a LANG_SPANISH
++   0x0b LANG_FINNISH
++   0x0c LANG_FRENCH
++   0x0d LANG_HEBREW
++   0x0e LANG_HUNGARIAN
++   0x0f LANG_ICELANDIC
++   0x10 LANG_ITALIAN
++   0x11 LANG_JAPANESE
++   0x12 LANG_KOREAN
++   0x13 LANG_DUTCH
++   0x14 LANG_NORWEGIAN
++   0x15 LANG_POLISH
++   0x16 LANG_PORTUGUESE
++   0x17 LANG_RHAETO_ROMANCE
++   0x18 LANG_ROMANIAN
++   0x19 LANG_RUSSIAN
++   0x1a LANG_CROATIAN == LANG_SERBIAN
++   0x1b LANG_SLOVAK
++   0x1c LANG_ALBANIAN
++   0x1d LANG_SWEDISH
++   0x1e LANG_THAI
++   0x1f LANG_TURKISH
++   0x20 LANG_URDU
++   0x21 LANG_INDONESIAN
++   0x22 LANG_UKRAINIAN
++   0x23 LANG_BELARUSIAN
++   0x24 LANG_SLOVENIAN
++   0x25 LANG_ESTONIAN
++   0x26 LANG_LATVIAN
++   0x27 LANG_LITHUANIAN
++   0x28 LANG_TAJIK
++   0x29 LANG_FARSI
++   0x2a LANG_VIETNAMESE
++   0x2b LANG_ARMENIAN
++   0x2c LANG_AZERI
++   0x2d LANG_BASQUE
++   0x2e LANG_SORBIAN
++   0x2f LANG_MACEDONIAN
++   0x30 LANG_SUTU
++   0x31 LANG_TSONGA
++   0x32 LANG_TSWANA
++   0x33 LANG_VENDA
++   0x34 LANG_XHOSA
++   0x35 LANG_ZULU
++   0x36 LANG_AFRIKAANS
++   0x37 LANG_GEORGIAN
++   0x38 LANG_FAEROESE
++   0x39 LANG_HINDI
++   0x3a LANG_MALTESE
++   0x3b LANG_SAAMI
++   0x3c LANG_GAELIC
++   0x3d LANG_YIDDISH
++   0x3e LANG_MALAY
++   0x3f LANG_KAZAK
++   0x40 LANG_KYRGYZ
++   0x41 LANG_SWAHILI
++   0x42 LANG_TURKMEN
++   0x43 LANG_UZBEK
++   0x44 LANG_TATAR
++   0x45 LANG_BENGALI
++   0x46 LANG_PUNJABI
++   0x47 LANG_GUJARATI
++   0x48 LANG_ORIYA
++   0x49 LANG_TAMIL
++   0x4a LANG_TELUGU
++   0x4b LANG_KANNADA
++   0x4c LANG_MALAYALAM
++   0x4d LANG_ASSAMESE
++   0x4e LANG_MARATHI
++   0x4f LANG_SANSKRIT
++   0x50 LANG_MONGOLIAN
++   0x51 LANG_TIBETAN
++   0x52 LANG_WELSH
++   0x53 LANG_CAMBODIAN
++   0x54 LANG_LAO
++   0x55 LANG_BURMESE
++   0x56 LANG_GALICIAN
++   0x57 LANG_KONKANI
++   0x58 LANG_MANIPURI
++   0x59 LANG_SINDHI
++   0x5a LANG_SYRIAC
++   0x5b LANG_SINHALESE
++   0x5c LANG_CHEROKEE
++   0x5d LANG_INUKTITUT
++   0x5e LANG_AMHARIC
++   0x5f LANG_TAMAZIGHT
++   0x60 LANG_KASHMIRI
++   0x61 LANG_NEPALI
++   0x62 LANG_FRISIAN
++   0x63 LANG_PASHTO
++   0x64 LANG_TAGALOG
++   0x65 LANG_DIVEHI
++   0x66 LANG_EDO
++   0x67 LANG_FULFULDE
++   0x68 LANG_HAUSA
++   0x69 LANG_IBIBIO
++   0x6a LANG_YORUBA
++   0x70 LANG_IGBO
++   0x71 LANG_KANURI
++   0x72 LANG_OROMO
++   0x73 LANG_TIGRINYA
++   0x74 LANG_GUARANI
++   0x75 LANG_HAWAIIAN
++   0x76 LANG_LATIN
++   0x77 LANG_SOMALI
++   0x78 LANG_YI
++   0x79 LANG_PAPIAMENTU
++*/
++/* Mingw headers don't have latest language and sublanguage codes.  */
++# ifndef LANG_AFRIKAANS
++# define LANG_AFRIKAANS 0x36
++# endif
++# ifndef LANG_ALBANIAN
++# define LANG_ALBANIAN 0x1c
++# endif
++# ifndef LANG_AMHARIC
++# define LANG_AMHARIC 0x5e
++# endif
++# ifndef LANG_ARABIC
++# define LANG_ARABIC 0x01
++# endif
++# ifndef LANG_ARMENIAN
++# define LANG_ARMENIAN 0x2b
++# endif
++# ifndef LANG_ASSAMESE
++# define LANG_ASSAMESE 0x4d
++# endif
++# ifndef LANG_AZERI
++# define LANG_AZERI 0x2c
++# endif
++# ifndef LANG_BASQUE
++# define LANG_BASQUE 0x2d
++# endif
++# ifndef LANG_BELARUSIAN
++# define LANG_BELARUSIAN 0x23
++# endif
++# ifndef LANG_BENGALI
++# define LANG_BENGALI 0x45
++# endif
++# ifndef LANG_BURMESE
++# define LANG_BURMESE 0x55
++# endif
++# ifndef LANG_CAMBODIAN
++# define LANG_CAMBODIAN 0x53
++# endif
++# ifndef LANG_CATALAN
++# define LANG_CATALAN 0x03
++# endif
++# ifndef LANG_CHEROKEE
++# define LANG_CHEROKEE 0x5c
++# endif
++# ifndef LANG_DIVEHI
++# define LANG_DIVEHI 0x65
++# endif
++# ifndef LANG_EDO
++# define LANG_EDO 0x66
++# endif
++# ifndef LANG_ESTONIAN
++# define LANG_ESTONIAN 0x25
++# endif
++# ifndef LANG_FAEROESE
++# define LANG_FAEROESE 0x38
++# endif
++# ifndef LANG_FARSI
++# define LANG_FARSI 0x29
++# endif
++# ifndef LANG_FRISIAN
++# define LANG_FRISIAN 0x62
++# endif
++# ifndef LANG_FULFULDE
++# define LANG_FULFULDE 0x67
++# endif
++# ifndef LANG_GAELIC
++# define LANG_GAELIC 0x3c
++# endif
++# ifndef LANG_GALICIAN
++# define LANG_GALICIAN 0x56
++# endif
++# ifndef LANG_GEORGIAN
++# define LANG_GEORGIAN 0x37
++# endif
++# ifndef LANG_GUARANI
++# define LANG_GUARANI 0x74
++# endif
++# ifndef LANG_GUJARATI
++# define LANG_GUJARATI 0x47
++# endif
++# ifndef LANG_HAUSA
++# define LANG_HAUSA 0x68
++# endif
++# ifndef LANG_HAWAIIAN
++# define LANG_HAWAIIAN 0x75
++# endif
++# ifndef LANG_HEBREW
++# define LANG_HEBREW 0x0d
++# endif
++# ifndef LANG_HINDI
++# define LANG_HINDI 0x39
++# endif
++# ifndef LANG_IBIBIO
++# define LANG_IBIBIO 0x69
++# endif
++# ifndef LANG_IGBO
++# define LANG_IGBO 0x70
++# endif
++# ifndef LANG_INDONESIAN
++# define LANG_INDONESIAN 0x21
++# endif
++# ifndef LANG_INUKTITUT
++# define LANG_INUKTITUT 0x5d
++# endif
++# ifndef LANG_KANNADA
++# define LANG_KANNADA 0x4b
++# endif
++# ifndef LANG_KANURI
++# define LANG_KANURI 0x71
++# endif
++# ifndef LANG_KASHMIRI
++# define LANG_KASHMIRI 0x60
++# endif
++# ifndef LANG_KAZAK
++# define LANG_KAZAK 0x3f
++# endif
++# ifndef LANG_KONKANI
++# define LANG_KONKANI 0x57
++# endif
++# ifndef LANG_KYRGYZ
++# define LANG_KYRGYZ 0x40
++# endif
++# ifndef LANG_LAO
++# define LANG_LAO 0x54
++# endif
++# ifndef LANG_LATIN
++# define LANG_LATIN 0x76
++# endif
++# ifndef LANG_LATVIAN
++# define LANG_LATVIAN 0x26
++# endif
++# ifndef LANG_LITHUANIAN
++# define LANG_LITHUANIAN 0x27
++# endif
++# ifndef LANG_MACEDONIAN
++# define LANG_MACEDONIAN 0x2f
++# endif
++# ifndef LANG_MALAY
++# define LANG_MALAY 0x3e
++# endif
++# ifndef LANG_MALAYALAM
++# define LANG_MALAYALAM 0x4c
++# endif
++# ifndef LANG_MALTESE
++# define LANG_MALTESE 0x3a
++# endif
++# ifndef LANG_MANIPURI
++# define LANG_MANIPURI 0x58
++# endif
++# ifndef LANG_MARATHI
++# define LANG_MARATHI 0x4e
++# endif
++# ifndef LANG_MONGOLIAN
++# define LANG_MONGOLIAN 0x50
++# endif
++# ifndef LANG_NEPALI
++# define LANG_NEPALI 0x61
++# endif
++# ifndef LANG_ORIYA
++# define LANG_ORIYA 0x48
++# endif
++# ifndef LANG_OROMO
++# define LANG_OROMO 0x72
++# endif
++# ifndef LANG_PAPIAMENTU
++# define LANG_PAPIAMENTU 0x79
++# endif
++# ifndef LANG_PASHTO
++# define LANG_PASHTO 0x63
++# endif
++# ifndef LANG_PUNJABI
++# define LANG_PUNJABI 0x46
++# endif
++# ifndef LANG_RHAETO_ROMANCE
++# define LANG_RHAETO_ROMANCE 0x17
++# endif
++# ifndef LANG_SAAMI
++# define LANG_SAAMI 0x3b
++# endif
++# ifndef LANG_SANSKRIT
++# define LANG_SANSKRIT 0x4f
++# endif
++# ifndef LANG_SERBIAN
++# define LANG_SERBIAN 0x1a
++# endif
++# ifndef LANG_SINDHI
++# define LANG_SINDHI 0x59
++# endif
++# ifndef LANG_SINHALESE
++# define LANG_SINHALESE 0x5b
++# endif
++# ifndef LANG_SLOVAK
++# define LANG_SLOVAK 0x1b
++# endif
++# ifndef LANG_SOMALI
++# define LANG_SOMALI 0x77
++# endif
++# ifndef LANG_SORBIAN
++# define LANG_SORBIAN 0x2e
++# endif
++# ifndef LANG_SUTU
++# define LANG_SUTU 0x30
++# endif
++# ifndef LANG_SWAHILI
++# define LANG_SWAHILI 0x41
++# endif
++# ifndef LANG_SYRIAC
++# define LANG_SYRIAC 0x5a
++# endif
++# ifndef LANG_TAGALOG
++# define LANG_TAGALOG 0x64
++# endif
++# ifndef LANG_TAJIK
++# define LANG_TAJIK 0x28
++# endif
++# ifndef LANG_TAMAZIGHT
++# define LANG_TAMAZIGHT 0x5f
++# endif
++# ifndef LANG_TAMIL
++# define LANG_TAMIL 0x49
++# endif
++# ifndef LANG_TATAR
++# define LANG_TATAR 0x44
++# endif
++# ifndef LANG_TELUGU
++# define LANG_TELUGU 0x4a
++# endif
++# ifndef LANG_THAI
++# define LANG_THAI 0x1e
++# endif
++# ifndef LANG_TIBETAN
++# define LANG_TIBETAN 0x51
++# endif
++# ifndef LANG_TIGRINYA
++# define LANG_TIGRINYA 0x73
++# endif
++# ifndef LANG_TSONGA
++# define LANG_TSONGA 0x31
++# endif
++# ifndef LANG_TSWANA
++# define LANG_TSWANA 0x32
++# endif
++# ifndef LANG_TURKMEN
++# define LANG_TURKMEN 0x42
++# endif
++# ifndef LANG_UKRAINIAN
++# define LANG_UKRAINIAN 0x22
++# endif
++# ifndef LANG_URDU
++# define LANG_URDU 0x20
++# endif
++# ifndef LANG_UZBEK
++# define LANG_UZBEK 0x43
++# endif
++# ifndef LANG_VENDA
++# define LANG_VENDA 0x33
++# endif
++# ifndef LANG_VIETNAMESE
++# define LANG_VIETNAMESE 0x2a
++# endif
++# ifndef LANG_WELSH
++# define LANG_WELSH 0x52
++# endif
++# ifndef LANG_XHOSA
++# define LANG_XHOSA 0x34
++# endif
++# ifndef LANG_YI
++# define LANG_YI 0x78
++# endif
++# ifndef LANG_YIDDISH
++# define LANG_YIDDISH 0x3d
++# endif
++# ifndef LANG_YORUBA
++# define LANG_YORUBA 0x6a
++# endif
++# ifndef LANG_ZULU
++# define LANG_ZULU 0x35
++# endif
++# ifndef SUBLANG_ARABIC_SAUDI_ARABIA
++# define SUBLANG_ARABIC_SAUDI_ARABIA 0x01
++# endif
++# ifndef SUBLANG_ARABIC_IRAQ
++# define SUBLANG_ARABIC_IRAQ 0x02
++# endif
++# ifndef SUBLANG_ARABIC_EGYPT
++# define SUBLANG_ARABIC_EGYPT 0x03
++# endif
++# ifndef SUBLANG_ARABIC_LIBYA
++# define SUBLANG_ARABIC_LIBYA 0x04
++# endif
++# ifndef SUBLANG_ARABIC_ALGERIA
++# define SUBLANG_ARABIC_ALGERIA 0x05
++# endif
++# ifndef SUBLANG_ARABIC_MOROCCO
++# define SUBLANG_ARABIC_MOROCCO 0x06
++# endif
++# ifndef SUBLANG_ARABIC_TUNISIA
++# define SUBLANG_ARABIC_TUNISIA 0x07
++# endif
++# ifndef SUBLANG_ARABIC_OMAN
++# define SUBLANG_ARABIC_OMAN 0x08
++# endif
++# ifndef SUBLANG_ARABIC_YEMEN
++# define SUBLANG_ARABIC_YEMEN 0x09
++# endif
++# ifndef SUBLANG_ARABIC_SYRIA
++# define SUBLANG_ARABIC_SYRIA 0x0a
++# endif
++# ifndef SUBLANG_ARABIC_JORDAN
++# define SUBLANG_ARABIC_JORDAN 0x0b
++# endif
++# ifndef SUBLANG_ARABIC_LEBANON
++# define SUBLANG_ARABIC_LEBANON 0x0c
++# endif
++# ifndef SUBLANG_ARABIC_KUWAIT
++# define SUBLANG_ARABIC_KUWAIT 0x0d
++# endif
++# ifndef SUBLANG_ARABIC_UAE
++# define SUBLANG_ARABIC_UAE 0x0e
++# endif
++# ifndef SUBLANG_ARABIC_BAHRAIN
++# define SUBLANG_ARABIC_BAHRAIN 0x0f
++# endif
++# ifndef SUBLANG_ARABIC_QATAR
++# define SUBLANG_ARABIC_QATAR 0x10
++# endif
++# ifndef SUBLANG_AZERI_LATIN
++# define SUBLANG_AZERI_LATIN 0x01
++# endif
++# ifndef SUBLANG_AZERI_CYRILLIC
++# define SUBLANG_AZERI_CYRILLIC 0x02
++# endif
++# ifndef SUBLANG_BENGALI_INDIA
++# define SUBLANG_BENGALI_INDIA 0x00
++# endif
++# ifndef SUBLANG_BENGALI_BANGLADESH
++# define SUBLANG_BENGALI_BANGLADESH 0x01
++# endif
++# ifndef SUBLANG_CHINESE_MACAU
++# define SUBLANG_CHINESE_MACAU 0x05
++# endif
++# ifndef SUBLANG_ENGLISH_SOUTH_AFRICA
++# define SUBLANG_ENGLISH_SOUTH_AFRICA 0x07
++# endif
++# ifndef SUBLANG_ENGLISH_JAMAICA
++# define SUBLANG_ENGLISH_JAMAICA 0x08
++# endif
++# ifndef SUBLANG_ENGLISH_CARIBBEAN
++# define SUBLANG_ENGLISH_CARIBBEAN 0x09
++# endif
++# ifndef SUBLANG_ENGLISH_BELIZE
++# define SUBLANG_ENGLISH_BELIZE 0x0a
++# endif
++# ifndef SUBLANG_ENGLISH_TRINIDAD
++# define SUBLANG_ENGLISH_TRINIDAD 0x0b
++# endif
++# ifndef SUBLANG_ENGLISH_ZIMBABWE
++# define SUBLANG_ENGLISH_ZIMBABWE 0x0c
++# endif
++# ifndef SUBLANG_ENGLISH_PHILIPPINES
++# define SUBLANG_ENGLISH_PHILIPPINES 0x0d
++# endif
++# ifndef SUBLANG_ENGLISH_INDONESIA
++# define SUBLANG_ENGLISH_INDONESIA 0x0e
++# endif
++# ifndef SUBLANG_ENGLISH_HONGKONG
++# define SUBLANG_ENGLISH_HONGKONG 0x0f
++# endif
++# ifndef SUBLANG_ENGLISH_INDIA
++# define SUBLANG_ENGLISH_INDIA 0x10
++# endif
++# ifndef SUBLANG_ENGLISH_MALAYSIA
++# define SUBLANG_ENGLISH_MALAYSIA 0x11
++# endif
++# ifndef SUBLANG_ENGLISH_SINGAPORE
++# define SUBLANG_ENGLISH_SINGAPORE 0x12
++# endif
++# ifndef SUBLANG_FRENCH_LUXEMBOURG
++# define SUBLANG_FRENCH_LUXEMBOURG 0x05
++# endif
++# ifndef SUBLANG_FRENCH_MONACO
++# define SUBLANG_FRENCH_MONACO 0x06
++# endif
++# ifndef SUBLANG_FRENCH_WESTINDIES
++# define SUBLANG_FRENCH_WESTINDIES 0x07
++# endif
++# ifndef SUBLANG_FRENCH_REUNION
++# define SUBLANG_FRENCH_REUNION 0x08
++# endif
++# ifndef SUBLANG_FRENCH_CONGO
++# define SUBLANG_FRENCH_CONGO 0x09
++# endif
++# ifndef SUBLANG_FRENCH_SENEGAL
++# define SUBLANG_FRENCH_SENEGAL 0x0a
++# endif
++# ifndef SUBLANG_FRENCH_CAMEROON
++# define SUBLANG_FRENCH_CAMEROON 0x0b
++# endif
++# ifndef SUBLANG_FRENCH_COTEDIVOIRE
++# define SUBLANG_FRENCH_COTEDIVOIRE 0x0c
++# endif
++# ifndef SUBLANG_FRENCH_MALI
++# define SUBLANG_FRENCH_MALI 0x0d
++# endif
++# ifndef SUBLANG_FRENCH_MOROCCO
++# define SUBLANG_FRENCH_MOROCCO 0x0e
++# endif
++# ifndef SUBLANG_FRENCH_HAITI
++# define SUBLANG_FRENCH_HAITI 0x0f
++# endif
++# ifndef SUBLANG_GERMAN_LUXEMBOURG
++# define SUBLANG_GERMAN_LUXEMBOURG 0x04
++# endif
++# ifndef SUBLANG_GERMAN_LIECHTENSTEIN
++# define SUBLANG_GERMAN_LIECHTENSTEIN 0x05
++# endif
++# ifndef SUBLANG_KASHMIRI_INDIA
++# define SUBLANG_KASHMIRI_INDIA 0x02
++# endif
++# ifndef SUBLANG_MALAY_MALAYSIA
++# define SUBLANG_MALAY_MALAYSIA 0x01
++# endif
++# ifndef SUBLANG_MALAY_BRUNEI_DARUSSALAM
++# define SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02
++# endif
++# ifndef SUBLANG_NEPALI_INDIA
++# define SUBLANG_NEPALI_INDIA 0x02
++# endif
++# ifndef SUBLANG_PUNJABI_INDIA
++# define SUBLANG_PUNJABI_INDIA 0x00
++# endif
++# ifndef SUBLANG_PUNJABI_PAKISTAN
++# define SUBLANG_PUNJABI_PAKISTAN 0x01
++# endif
++# ifndef SUBLANG_ROMANIAN_ROMANIA
++# define SUBLANG_ROMANIAN_ROMANIA 0x00
++# endif
++# ifndef SUBLANG_ROMANIAN_MOLDOVA
++# define SUBLANG_ROMANIAN_MOLDOVA 0x01
++# endif
++# ifndef SUBLANG_SERBIAN_LATIN
++# define SUBLANG_SERBIAN_LATIN 0x02
++# endif
++# ifndef SUBLANG_SERBIAN_CYRILLIC
++# define SUBLANG_SERBIAN_CYRILLIC 0x03
++# endif
++# ifndef SUBLANG_SINDHI_INDIA
++# define SUBLANG_SINDHI_INDIA 0x00
++# endif
++# ifndef SUBLANG_SINDHI_PAKISTAN
++# define SUBLANG_SINDHI_PAKISTAN 0x01
++# endif
++# ifndef SUBLANG_SPANISH_GUATEMALA
++# define SUBLANG_SPANISH_GUATEMALA 0x04
++# endif
++# ifndef SUBLANG_SPANISH_COSTA_RICA
++# define SUBLANG_SPANISH_COSTA_RICA 0x05
++# endif
++# ifndef SUBLANG_SPANISH_PANAMA
++# define SUBLANG_SPANISH_PANAMA 0x06
++# endif
++# ifndef SUBLANG_SPANISH_DOMINICAN_REPUBLIC
++# define SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07
++# endif
++# ifndef SUBLANG_SPANISH_VENEZUELA
++# define SUBLANG_SPANISH_VENEZUELA 0x08
++# endif
++# ifndef SUBLANG_SPANISH_COLOMBIA
++# define SUBLANG_SPANISH_COLOMBIA 0x09
++# endif
++# ifndef SUBLANG_SPANISH_PERU
++# define SUBLANG_SPANISH_PERU 0x0a
++# endif
++# ifndef SUBLANG_SPANISH_ARGENTINA
++# define SUBLANG_SPANISH_ARGENTINA 0x0b
++# endif
++# ifndef SUBLANG_SPANISH_ECUADOR
++# define SUBLANG_SPANISH_ECUADOR 0x0c
++# endif
++# ifndef SUBLANG_SPANISH_CHILE
++# define SUBLANG_SPANISH_CHILE 0x0d
++# endif
++# ifndef SUBLANG_SPANISH_URUGUAY
++# define SUBLANG_SPANISH_URUGUAY 0x0e
++# endif
++# ifndef SUBLANG_SPANISH_PARAGUAY
++# define SUBLANG_SPANISH_PARAGUAY 0x0f
++# endif
++# ifndef SUBLANG_SPANISH_BOLIVIA
++# define SUBLANG_SPANISH_BOLIVIA 0x10
++# endif
++# ifndef SUBLANG_SPANISH_EL_SALVADOR
++# define SUBLANG_SPANISH_EL_SALVADOR 0x11
++# endif
++# ifndef SUBLANG_SPANISH_HONDURAS
++# define SUBLANG_SPANISH_HONDURAS 0x12
++# endif
++# ifndef SUBLANG_SPANISH_NICARAGUA
++# define SUBLANG_SPANISH_NICARAGUA 0x13
++# endif
++# ifndef SUBLANG_SPANISH_PUERTO_RICO
++# define SUBLANG_SPANISH_PUERTO_RICO 0x14
++# endif
++# ifndef SUBLANG_SWEDISH_FINLAND
++# define SUBLANG_SWEDISH_FINLAND 0x02
++# endif
++# ifndef SUBLANG_TAMAZIGHT_ARABIC
++# define SUBLANG_TAMAZIGHT_ARABIC 0x01
++# endif
++# ifndef SUBLANG_TAMAZIGHT_LATIN
++# define SUBLANG_TAMAZIGHT_LATIN 0x02
++# endif
++# ifndef SUBLANG_TIGRINYA_ETHIOPIA
++# define SUBLANG_TIGRINYA_ETHIOPIA 0x00
++# endif
++# ifndef SUBLANG_TIGRINYA_ERITREA
++# define SUBLANG_TIGRINYA_ERITREA 0x01
++# endif
++# ifndef SUBLANG_URDU_PAKISTAN
++# define SUBLANG_URDU_PAKISTAN 0x01
++# endif
++# ifndef SUBLANG_URDU_INDIA
++# define SUBLANG_URDU_INDIA 0x02
++# endif
++# ifndef SUBLANG_UZBEK_LATIN
++# define SUBLANG_UZBEK_LATIN 0x01
++# endif
++# ifndef SUBLANG_UZBEK_CYRILLIC
++# define SUBLANG_UZBEK_CYRILLIC 0x02
++# endif
++#endif
++
++/* XPG3 defines the result of 'setlocale (category, NULL)' as:
++   "Directs 'setlocale()' to query 'category' and return the current
++    setting of 'local'."
++   However it does not specify the exact format.  Neither do SUSV2 and
++   ISO C 99.  So we can use this feature only on selected systems (e.g.
++   those using GNU C Library).  */
++#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2)
++# define HAVE_LOCALE_NULL
++#endif
++
++/* Determine the current locale's name, and canonicalize it into XPG syntax
++     language[_territory[.codeset]][@modifier]
++   The codeset part in the result is not reliable; the locale_charset()
++   should be used for codeset information instead.
++   The result must not be freed; it is statically allocated.  */
++
++const char *
++_nl_locale_name (int category, const char *categoryname)
++{
++  const char *retval;
++
++#ifndef WIN32
++
++  /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
++     On some systems this can be done by the 'setlocale' function itself.  */
++# if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
++  retval = setlocale (category, NULL);
++# else
++  /* Setting of LC_ALL overwrites all other.  */
++  retval = getenv ("LC_ALL");
++  if (retval == NULL || retval[0] == '\0')
++    {
++      /* Next comes the name of the desired category.  */
++      retval = getenv (categoryname);
++      if (retval == NULL || retval[0] == '\0')
++	{
++	  /* Last possibility is the LANG environment variable.  */
++	  retval = getenv ("LANG");
++	  if (retval == NULL || retval[0] == '\0')
++	    /* We use C as the default domain.  POSIX says this is
++	       implementation defined.  */
++	    retval = "C";
++	}
++    }
++# endif
++
++  return retval;
++
++#else /* WIN32 */
++
++  /* Return an XPG style locale name language[_territory][@modifier].
++     Don't even bother determining the codeset; it's not useful in this
++     context, because message catalogs are not specific to a single
++     codeset.  */
++
++  LCID lcid;
++  LANGID langid;
++  int primary, sub;
++
++  /* Let the user override the system settings through environment
++     variables, as on POSIX systems.  */
++  retval = getenv ("LC_ALL");
++  if (retval != NULL && retval[0] != '\0')
++    return retval;
++  retval = getenv (categoryname);
++  if (retval != NULL && retval[0] != '\0')
++    return retval;
++  retval = getenv ("LANG");
++  if (retval != NULL && retval[0] != '\0')
++    return retval;
++
++  /* Use native Win32 API locale ID.  */
++  lcid = GetThreadLocale ();
++
++  /* Strip off the sorting rules, keep only the language part.  */
++  langid = LANGIDFROMLCID (lcid);
++
++  /* Split into language and territory part.  */
++  primary = PRIMARYLANGID (langid);
++  sub = SUBLANGID (langid);
++
++  /* Dispatch on language.
++     See also http://www.unicode.org/unicode/onlinedat/languages.html .
++     For details about languages, see http://www.ethnologue.com/ .  */
++  switch (primary)
++    {
++    case LANG_AFRIKAANS: return "af_ZA";
++    case LANG_ALBANIAN: return "sq_AL";
++    case LANG_AMHARIC: return "am_ET";
++    case LANG_ARABIC:
++      switch (sub)
++	{
++	case SUBLANG_ARABIC_SAUDI_ARABIA: return "ar_SA";
++	case SUBLANG_ARABIC_IRAQ: return "ar_IQ";
++	case SUBLANG_ARABIC_EGYPT: return "ar_EG";
++	case SUBLANG_ARABIC_LIBYA: return "ar_LY";
++	case SUBLANG_ARABIC_ALGERIA: return "ar_DZ";
++	case SUBLANG_ARABIC_MOROCCO: return "ar_MA";
++	case SUBLANG_ARABIC_TUNISIA: return "ar_TN";
++	case SUBLANG_ARABIC_OMAN: return "ar_OM";
++	case SUBLANG_ARABIC_YEMEN: return "ar_YE";
++	case SUBLANG_ARABIC_SYRIA: return "ar_SY";
++	case SUBLANG_ARABIC_JORDAN: return "ar_JO";
++	case SUBLANG_ARABIC_LEBANON: return "ar_LB";
++	case SUBLANG_ARABIC_KUWAIT: return "ar_KW";
++	case SUBLANG_ARABIC_UAE: return "ar_AE";
++	case SUBLANG_ARABIC_BAHRAIN: return "ar_BH";
++	case SUBLANG_ARABIC_QATAR: return "ar_QA";
++	}
++      return "ar";
++    case LANG_ARMENIAN: return "hy_AM";
++    case LANG_ASSAMESE: return "as_IN";
++    case LANG_AZERI:
++      switch (sub)
++	{
++	/* FIXME: Adjust this when Azerbaijani locales appear on Unix.  */
++	case SUBLANG_AZERI_LATIN: return "az_AZ@latin";
++	case SUBLANG_AZERI_CYRILLIC: return "az_AZ@cyrillic";
++	}
++      return "az";
++    case LANG_BASQUE:
++      return "eu"; /* Ambiguous: could be "eu_ES" or "eu_FR".  */
++    case LANG_BELARUSIAN: return "be_BY";
++    case LANG_BENGALI:
++      switch (sub)
++	{
++	case SUBLANG_BENGALI_INDIA: return "bn_IN";
++	case SUBLANG_BENGALI_BANGLADESH: return "bn_BD";
++	}
++      return "bn";
++    case LANG_BULGARIAN: return "bg_BG";
++    case LANG_BURMESE: return "my_MM";
++    case LANG_CAMBODIAN: return "km_KH";
++    case LANG_CATALAN: return "ca_ES";
++    case LANG_CHEROKEE: return "chr_US";
++    case LANG_CHINESE:
++      switch (sub)
++	{
++	case SUBLANG_CHINESE_TRADITIONAL: return "zh_TW";
++	case SUBLANG_CHINESE_SIMPLIFIED: return "zh_CN";
++	case SUBLANG_CHINESE_HONGKONG: return "zh_HK";
++	case SUBLANG_CHINESE_SINGAPORE: return "zh_SG";
++	case SUBLANG_CHINESE_MACAU: return "zh_MO";
++	}
++      return "zh";
++    case LANG_CROATIAN:		/* LANG_CROATIAN == LANG_SERBIAN
++				 * What used to be called Serbo-Croatian
++				 * should really now be two separate
++				 * languages because of political reasons.
++				 * (Says tml, who knows nothing about Serbian
++				 * or Croatian.)
++				 * (I can feel those flames coming already.)
++				 */
++      switch (sub)
++	{
++	case SUBLANG_DEFAULT: return "hr_HR";
++	case SUBLANG_SERBIAN_LATIN: return "sr_CS";
++	case SUBLANG_SERBIAN_CYRILLIC: return "sr_CS@cyrillic";
++	}
++      return "hr";
++    case LANG_CZECH: return "cs_CZ";
++    case LANG_DANISH: return "da_DK";
++    case LANG_DIVEHI: return "dv_MV";
++    case LANG_DUTCH:
++      switch (sub)
++	{
++	case SUBLANG_DUTCH: return "nl_NL";
++	case SUBLANG_DUTCH_BELGIAN: /* FLEMISH, VLAAMS */ return "nl_BE";
++	}
++      return "nl";
++    case LANG_EDO: return "bin_NG";
++    case LANG_ENGLISH:
++      switch (sub)
++	{
++	/* SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. Heh. I thought
++	 * English was the language spoken in England.
++	 * Oh well.
++	 */
++	case SUBLANG_ENGLISH_US: return "en_US";
++	case SUBLANG_ENGLISH_UK: return "en_GB";
++	case SUBLANG_ENGLISH_AUS: return "en_AU";
++	case SUBLANG_ENGLISH_CAN: return "en_CA";
++	case SUBLANG_ENGLISH_NZ: return "en_NZ";
++	case SUBLANG_ENGLISH_EIRE: return "en_IE";
++	case SUBLANG_ENGLISH_SOUTH_AFRICA: return "en_ZA";
++	case SUBLANG_ENGLISH_JAMAICA: return "en_JM";
++	case SUBLANG_ENGLISH_CARIBBEAN: return "en_GD"; /* Grenada? */
++	case SUBLANG_ENGLISH_BELIZE: return "en_BZ";
++	case SUBLANG_ENGLISH_TRINIDAD: return "en_TT";
++	case SUBLANG_ENGLISH_ZIMBABWE: return "en_ZW";
++	case SUBLANG_ENGLISH_PHILIPPINES: return "en_PH";
++	case SUBLANG_ENGLISH_INDONESIA: return "en_ID";
++	case SUBLANG_ENGLISH_HONGKONG: return "en_HK";
++	case SUBLANG_ENGLISH_INDIA: return "en_IN";
++	case SUBLANG_ENGLISH_MALAYSIA: return "en_MY";
++	case SUBLANG_ENGLISH_SINGAPORE: return "en_SG";
++	}
++      return "en";
++    case LANG_ESTONIAN: return "et_EE";
++    case LANG_FAEROESE: return "fo_FO";
++    case LANG_FARSI: return "fa_IR";
++    case LANG_FINNISH: return "fi_FI";
++    case LANG_FRENCH:
++      switch (sub)
++	{
++	case SUBLANG_FRENCH: return "fr_FR";
++	case SUBLANG_FRENCH_BELGIAN: /* WALLOON */ return "fr_BE";
++	case SUBLANG_FRENCH_CANADIAN: return "fr_CA";
++	case SUBLANG_FRENCH_SWISS: return "fr_CH";
++	case SUBLANG_FRENCH_LUXEMBOURG: return "fr_LU";
++	case SUBLANG_FRENCH_MONACO: return "fr_MC";
++	case SUBLANG_FRENCH_WESTINDIES: return "fr"; /* Caribbean? */
++	case SUBLANG_FRENCH_REUNION: return "fr_RE";
++	case SUBLANG_FRENCH_CONGO: return "fr_CG";
++	case SUBLANG_FRENCH_SENEGAL: return "fr_SN";
++	case SUBLANG_FRENCH_CAMEROON: return "fr_CM";
++	case SUBLANG_FRENCH_COTEDIVOIRE: return "fr_CI";
++	case SUBLANG_FRENCH_MALI: return "fr_ML";
++	case SUBLANG_FRENCH_MOROCCO: return "fr_MA";
++	case SUBLANG_FRENCH_HAITI: return "fr_HT";
++	}
++      return "fr";
++    case LANG_FRISIAN: return "fy_NL";
++    case LANG_FULFULDE:
++      /* Spoken in Nigeria, Guinea, Senegal, Mali, Niger, Cameroon, Benin. */
++      return "ff_NG";
++    case LANG_GAELIC:
++      switch (sub)
++	{
++	case 0x01: /* SCOTTISH */ return "gd_GB";
++	case 0x02: /* IRISH */ return "ga_IE";
++	}
++      return "C";
++    case LANG_GALICIAN: return "gl_ES";
++    case LANG_GEORGIAN: return "ka_GE";
++    case LANG_GERMAN:
++      switch (sub)
++	{
++	case SUBLANG_GERMAN: return "de_DE";
++	case SUBLANG_GERMAN_SWISS: return "de_CH";
++	case SUBLANG_GERMAN_AUSTRIAN: return "de_AT";
++	case SUBLANG_GERMAN_LUXEMBOURG: return "de_LU";
++	case SUBLANG_GERMAN_LIECHTENSTEIN: return "de_LI";
++	}
++      return "de";
++    case LANG_GREEK: return "el_GR";
++    case LANG_GUARANI: return "gn_PY";
++    case LANG_GUJARATI: return "gu_IN";
++    case LANG_HAUSA: return "ha_NG";
++    case LANG_HAWAIIAN:
++      /* FIXME: Do they mean Hawaiian ("haw_US", 1000 speakers)
++	 or Hawaii Creole English ("cpe_US", 600000 speakers)?  */
++      return "cpe_US";
++    case LANG_HEBREW: return "he_IL";
++    case LANG_HINDI: return "hi_IN";
++    case LANG_HUNGARIAN: return "hu_HU";
++    case LANG_IBIBIO: return "nic_NG";
++    case LANG_ICELANDIC: return "is_IS";
++    case LANG_IGBO: return "ig_NG";
++    case LANG_INDONESIAN: return "id_ID";
++    case LANG_INUKTITUT: return "iu_CA";
++    case LANG_ITALIAN:
++      switch (sub)
++	{
++	case SUBLANG_ITALIAN: return "it_IT";
++	case SUBLANG_ITALIAN_SWISS: return "it_CH";
++	}
++      return "it";
++    case LANG_JAPANESE: return "ja_JP";
++    case LANG_KANNADA: return "kn_IN";
++    case LANG_KANURI: return "kr_NG";
++    case LANG_KASHMIRI:
++      switch (sub)
++	{
++	case SUBLANG_DEFAULT: return "ks_PK";
++	case SUBLANG_KASHMIRI_INDIA: return "ks_IN";
++	}
++      return "ks";
++    case LANG_KAZAK: return "kk_KZ";
++    case LANG_KONKANI:
++      /* FIXME: Adjust this when such locales appear on Unix.  */
++      return "kok_IN";
++    case LANG_KOREAN: return "ko_KR";
++    case LANG_KYRGYZ: return "ky_KG";
++    case LANG_LAO: return "lo_LA";
++    case LANG_LATIN: return "la_VA";
++    case LANG_LATVIAN: return "lv_LV";
++    case LANG_LITHUANIAN: return "lt_LT";
++    case LANG_MACEDONIAN: return "mk_MK";
++    case LANG_MALAY:
++      switch (sub)
++	{
++	case SUBLANG_MALAY_MALAYSIA: return "ms_MY";
++	case SUBLANG_MALAY_BRUNEI_DARUSSALAM: return "ms_BN";
++	}
++      return "ms";
++    case LANG_MALAYALAM: return "ml_IN";
++    case LANG_MALTESE: return "mt_MT";
++    case LANG_MANIPURI:
++      /* FIXME: Adjust this when such locales appear on Unix.  */
++      return "mni_IN";
++    case LANG_MARATHI: return "mr_IN";
++    case LANG_MONGOLIAN:
++      return "mn"; /* Ambiguous: could be "mn_CN" or "mn_MN".  */
++    case LANG_NEPALI:
++      switch (sub)
++	{
++	case SUBLANG_DEFAULT: return "ne_NP";
++	case SUBLANG_NEPALI_INDIA: return "ne_IN";
++	}
++      return "ne";
++    case LANG_NORWEGIAN:
++      switch (sub)
++	{
++	case SUBLANG_NORWEGIAN_BOKMAL: return "no_NO";
++	case SUBLANG_NORWEGIAN_NYNORSK: return "nn_NO";
++	}
++      return "no";
++    case LANG_ORIYA: return "or_IN";
++    case LANG_OROMO: return "om_ET";
++    case LANG_PAPIAMENTU: return "pap_AN";
++    case LANG_PASHTO:
++      return "ps"; /* Ambiguous: could be "ps_PK" or "ps_AF".  */
++    case LANG_POLISH: return "pl_PL";
++    case LANG_PORTUGUESE:
++      switch (sub)
++	{
++	case SUBLANG_PORTUGUESE: return "pt_PT";
++	/* Hmm. SUBLANG_PORTUGUESE_BRAZILIAN == SUBLANG_DEFAULT.
++	   Same phenomenon as SUBLANG_ENGLISH_US == SUBLANG_DEFAULT. */
++	case SUBLANG_PORTUGUESE_BRAZILIAN: return "pt_BR";
++	}
++      return "pt";
++    case LANG_PUNJABI:
++      switch (sub)
++	{
++	case SUBLANG_PUNJABI_INDIA: return "pa_IN"; /* Gurmukhi script */
++	case SUBLANG_PUNJABI_PAKISTAN: return "pa_PK"; /* Arabic script */
++	}
++      return "pa";
++    case LANG_RHAETO_ROMANCE: return "rm_CH";
++    case LANG_ROMANIAN:
++      switch (sub)
++	{
++	case SUBLANG_ROMANIAN_ROMANIA: return "ro_RO";
++	case SUBLANG_ROMANIAN_MOLDOVA: return "ro_MD";
++	}
++      return "ro";
++    case LANG_RUSSIAN:
++      return "ru"; /* Ambiguous: could be "ru_RU" or "ru_UA" or "ru_MD".  */
++    case LANG_SAAMI: /* actually Northern Sami */ return "se_NO";
++    case LANG_SANSKRIT: return "sa_IN";
++    case LANG_SINDHI:
++      switch (sub)
++	{
++	case SUBLANG_SINDHI_INDIA: return "sd_IN";
++	case SUBLANG_SINDHI_PAKISTAN: return "sd_PK";
++	}
++      return "sd";
++    case LANG_SINHALESE: return "si_LK";
++    case LANG_SLOVAK: return "sk_SK";
++    case LANG_SLOVENIAN: return "sl_SI";
++    case LANG_SOMALI: return "so_SO";
++    case LANG_SORBIAN:
++      /* FIXME: Adjust this when such locales appear on Unix.  */
++      return "wen_DE";
++    case LANG_SPANISH:
++      switch (sub)
++	{
++	case SUBLANG_SPANISH: return "es_ES";
++	case SUBLANG_SPANISH_MEXICAN: return "es_MX";
++	case SUBLANG_SPANISH_MODERN:
++	  return "es_ES@modern";	/* not seen on Unix */
++	case SUBLANG_SPANISH_GUATEMALA: return "es_GT";
++	case SUBLANG_SPANISH_COSTA_RICA: return "es_CR";
++	case SUBLANG_SPANISH_PANAMA: return "es_PA";
++	case SUBLANG_SPANISH_DOMINICAN_REPUBLIC: return "es_DO";
++	case SUBLANG_SPANISH_VENEZUELA: return "es_VE";
++	case SUBLANG_SPANISH_COLOMBIA: return "es_CO";
++	case SUBLANG_SPANISH_PERU: return "es_PE";
++	case SUBLANG_SPANISH_ARGENTINA: return "es_AR";
++	case SUBLANG_SPANISH_ECUADOR: return "es_EC";
++	case SUBLANG_SPANISH_CHILE: return "es_CL";
++	case SUBLANG_SPANISH_URUGUAY: return "es_UY";
++	case SUBLANG_SPANISH_PARAGUAY: return "es_PY";
++	case SUBLANG_SPANISH_BOLIVIA: return "es_BO";
++	case SUBLANG_SPANISH_EL_SALVADOR: return "es_SV";
++	case SUBLANG_SPANISH_HONDURAS: return "es_HN";
++	case SUBLANG_SPANISH_NICARAGUA: return "es_NI";
++	case SUBLANG_SPANISH_PUERTO_RICO: return "es_PR";
++	}
++      return "es";
++    case LANG_SUTU: return "bnt_TZ"; /* or "st_LS" or "nso_ZA"? */
++    case LANG_SWAHILI: return "sw_KE";
++    case LANG_SWEDISH:
++      switch (sub)
++	{
++	case SUBLANG_DEFAULT: return "sv_SE";
++	case SUBLANG_SWEDISH_FINLAND: return "sv_FI";
++	}
++      return "sv";
++    case LANG_SYRIAC: return "syr_TR"; /* An extinct language.  */
++    case LANG_TAGALOG: return "tl_PH";
++    case LANG_TAJIK: return "tg_TJ";
++    case LANG_TAMAZIGHT:
++      switch (sub)
++	{
++	/* FIXME: Adjust this when Tamazight locales appear on Unix.  */
++	case SUBLANG_TAMAZIGHT_ARABIC: return "ber_MA@arabic";
++	case SUBLANG_TAMAZIGHT_LATIN: return "ber_MA@latin";
++	}
++      return "ber_MA";
++    case LANG_TAMIL:
++      return "ta"; /* Ambiguous: could be "ta_IN" or "ta_LK" or "ta_SG".  */
++    case LANG_TATAR: return "tt_RU";
++    case LANG_TELUGU: return "te_IN";
++    case LANG_THAI: return "th_TH";
++    case LANG_TIBETAN: return "bo_CN";
++    case LANG_TIGRINYA:
++      switch (sub)
++	{
++	case SUBLANG_TIGRINYA_ETHIOPIA: return "ti_ET";
++	case SUBLANG_TIGRINYA_ERITREA: return "ti_ER";
++	}
++      return "ti";
++    case LANG_TSONGA: return "ts_ZA";
++    case LANG_TSWANA: return "tn_BW";
++    case LANG_TURKISH: return "tr_TR";
++    case LANG_TURKMEN: return "tk_TM";
++    case LANG_UKRAINIAN: return "uk_UA";
++    case LANG_URDU:
++      switch (sub)
++	{
++	case SUBLANG_URDU_PAKISTAN: return "ur_PK";
++	case SUBLANG_URDU_INDIA: return "ur_IN";
++	}
++      return "ur";
++    case LANG_UZBEK:
++      switch (sub)
++	{
++	case SUBLANG_UZBEK_LATIN: return "uz_UZ";
++	case SUBLANG_UZBEK_CYRILLIC: return "uz_UZ@cyrillic";
++	}
++      return "uz";
++    case LANG_VENDA: return "ve_ZA";
++    case LANG_VIETNAMESE: return "vi_VN";
++    case LANG_WELSH: return "cy_GB";
++    case LANG_XHOSA: return "xh_ZA";
++    case LANG_YI: return "sit_CN";
++    case LANG_YIDDISH: return "yi_IL";
++    case LANG_YORUBA: return "yo_NG";
++    case LANG_ZULU: return "zu_ZA";
++    default: return "C";
++    }
++
++#endif
++}
+--- lrzsz-0.12.20.safe/intl/log.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/log.c	2004-09-12 14:40:34.515723768 -0400
+@@ -0,0 +1,98 @@
++/* Log file output.
++   Copyright (C) 2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* Written by Bruno Haible <bruno@clisp.org>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++/* Print an ASCII string with quotes and escape sequences where needed.  */
++static void
++print_escaped (FILE *stream, const char *str)
++{
++  putc ('"', stream);
++  for (; *str != '\0'; str++)
++    if (*str == '\n')
++      {
++	fputs ("\\n\"", stream);
++	if (str[1] == '\0')
++	  return;
++	fputs ("\n\"", stream);
++      }
++    else
++      {
++	if (*str == '"' || *str == '\\')
++	  putc ('\\', stream);
++	putc (*str, stream);
++      }
++  putc ('"', stream);
++}
++
++/* Add to the log file an entry denoting a failed translation.  */
++void
++_nl_log_untranslated (const char *logfilename, const char *domainname,
++		      const char *msgid1, const char *msgid2, int plural)
++{
++  static char *last_logfilename = NULL;
++  static FILE *last_logfile = NULL;
++  FILE *logfile;
++
++  /* Can we reuse the last opened logfile?  */
++  if (last_logfilename == NULL || strcmp (logfilename, last_logfilename) != 0)
++    {
++      /* Close the last used logfile.  */
++      if (last_logfilename != NULL)
++	{
++	  if (last_logfile != NULL)
++	    {
++	      fclose (last_logfile);
++	      last_logfile = NULL;
++	    }
++	  free (last_logfilename);
++	  last_logfilename = NULL;
++	}
++      /* Open the logfile.  */
++      last_logfilename = (char *) malloc (strlen (logfilename) + 1);
++      if (last_logfilename == NULL)
++	return;
++      strcpy (last_logfilename, logfilename);
++      last_logfile = fopen (logfilename, "a");
++      if (last_logfile == NULL)
++	return;
++    }
++  logfile = last_logfile;
++
++  fprintf (logfile, "domain ");
++  print_escaped (logfile, domainname);
++  fprintf (logfile, "\nmsgid ");
++  print_escaped (logfile, msgid1);
++  if (plural)
++    {
++      fprintf (logfile, "\nmsgid_plural ");
++      print_escaped (logfile, msgid2);
++      fprintf (logfile, "\nmsgstr[0] \"\"\n");
++    }
++  else
++    fprintf (logfile, "\nmsgstr \"\"\n");
++  putc ('\n', logfile);
++}
+--- lrzsz-0.12.20.safe/intl/Makefile.in	1998-04-26 09:22:35.000000000 -0400
++++ lrzsz-0.12.20/intl/Makefile.in	2004-09-12 14:40:34.521722856 -0400
+@@ -1,19 +1,20 @@
+-# Makefile for directory with message catalog handling in GNU NLS Utilities.
+-# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
++# Makefile for directory with message catalog handling library of GNU gettext
++# Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
+ #
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
++# This program is free software; you can redistribute it and/or modify it
++# under the terms of the GNU Library General Public License as published
++# by the Free Software Foundation; either version 2, or (at your option)
+ # any later version.
+ #
+ # This program is distributed in the hope that 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.
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++# Library General Public License for more details.
+ #
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++# You should have received a copy of the GNU Library General Public
++# License along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++# USA.
+ 
+ PACKAGE = @PACKAGE@
+ VERSION = @VERSION@
+@@ -23,118 +24,341 @@
+ srcdir = @srcdir@
+ top_srcdir = @top_srcdir@
+ top_builddir = ..
+-VPATH = @srcdir@
++#VPATH = $(srcdir)
+ 
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ transform = @program_transform_name@
+-libdir = $(exec_prefix)/lib
+-includedir = $(prefix)/include
+-datadir = $(prefix)/@DATADIRNAME@
++libdir = @libdir@
++includedir = @includedir@
++datadir = @datadir@
+ localedir = $(datadir)/locale
+-gnulocaledir = $(prefix)/share/locale
+-gettextsrcdir = @datadir@/gettext/intl
+-aliaspath = $(localedir):.
++gettextsrcdir = $(datadir)/gettext/intl
++aliaspath = $(localedir)
+ subdir = intl
+ 
+ INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+ MKINSTALLDIRS = @MKINSTALLDIRS@
++mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
+ 
+-l = @l@
++l = @INTL_LIBTOOL_SUFFIX_PREFIX@
+ 
+ AR = ar
+ CC = @CC@
+ LIBTOOL = @LIBTOOL@
+ RANLIB = @RANLIB@
++YACC = @INTLBISON@ -y -d
++YFLAGS = --name-prefix=__gettext
+ 
+-DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \
+--DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@
++DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
++-DLIBDIR=\"$(libdir)\" -DIN_LIBINTL \
++-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
++-Dset_relocation_prefix=libintl_set_relocation_prefix \
++-Drelocate=libintl_relocate \
++-DDEPENDS_ON_LIBICONV=1 @DEFS@
+ CPPFLAGS = @CPPFLAGS@
+ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
++LIBS = @LIBS@
+ 
+ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+ 
+-HEADERS = $(COMHDRS) libgettext.h loadinfo.h
+-COMHDRS = gettext.h gettextP.h hash-string.h
+-SOURCES = $(COMSRCS) intl-compat.c cat-compat.c
+-COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
+-finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
+-explodename.c
+-OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
+-finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
+-explodename.$lo
+-CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$lo
+-GETTOBJS = intl-compat.$lo
+-DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \
+-xopen-msg.sed $(HEADERS) $(SOURCES)
++HEADERS = \
++  gmo.h \
++  gettextP.h \
++  hash-string.h \
++  loadinfo.h \
++  plural-exp.h \
++  eval-plural.h \
++  localcharset.h \
++  relocatable.h \
++  xsize.h \
++  printf-args.h printf-args.c \
++  printf-parse.h wprintf-parse.h printf-parse.c \
++  vasnprintf.h vasnwprintf.h vasnprintf.c \
++  os2compat.h \
++  libgnuintl.h.in
++SOURCES = \
++  bindtextdom.c \
++  dcgettext.c \
++  dgettext.c \
++  gettext.c \
++  finddomain.c \
++  loadmsgcat.c \
++  localealias.c \
++  textdomain.c \
++  l10nflist.c \
++  explodename.c \
++  dcigettext.c \
++  dcngettext.c \
++  dngettext.c \
++  ngettext.c \
++  plural.y \
++  plural-exp.c \
++  localcharset.c \
++  relocatable.c \
++  localename.c \
++  log.c \
++  printf.c \
++  osdep.c \
++  os2compat.c \
++  intl-compat.c
++OBJECTS = \
++  bindtextdom.$lo \
++  dcgettext.$lo \
++  dgettext.$lo \
++  gettext.$lo \
++  finddomain.$lo \
++  loadmsgcat.$lo \
++  localealias.$lo \
++  textdomain.$lo \
++  l10nflist.$lo \
++  explodename.$lo \
++  dcigettext.$lo \
++  dcngettext.$lo \
++  dngettext.$lo \
++  ngettext.$lo \
++  plural.$lo \
++  plural-exp.$lo \
++  localcharset.$lo \
++  relocatable.$lo \
++  localename.$lo \
++  log.$lo \
++  printf.$lo \
++  osdep.$lo \
++  intl-compat.$lo
++DISTFILES.common = Makefile.in \
++config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES)
++DISTFILES.generated = plural.c
+ DISTFILES.normal = VERSION
+-DISTFILES.gettext = libintl.glibc intlh.inst.in
++DISTFILES.gettext = COPYING.LIB-2.0 COPYING.LIB-2.1 libintl.glibc \
++libgnuintl.h_vms Makefile.vms \
++libgnuintl.h.msvc-static libgnuintl.h.msvc-shared README.woe32 Makefile.msvc
++DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c \
++COPYING.LIB-2 gettext.h libgettext.h plural-eval.c libgnuintl.h
++
++all: all-@USE_INCLUDED_LIBINTL@
++all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed
++all-no: all-no-@BUILD_INCLUDED_LIBINTL@
++all-no-yes: libgnuintl.$la
++all-no-no:
++
++libintl.a libgnuintl.a: $(OBJECTS)
++	rm -f $@
++	$(AR) cru $@ $(OBJECTS)
++	$(RANLIB) $@
++
++libintl.la libgnuintl.la: $(OBJECTS)
++	$(LIBTOOL) --mode=link \
++	  $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
++	  $(OBJECTS) @LTLIBICONV@ $(LIBS) -lc \
++	  -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
++	  -rpath $(libdir) \
++	  -no-undefined
++
++# Libtool's library version information for libintl.
++# Before making a gettext release, the gettext maintainer must change this
++# according to the libtool documentation, section "Library interface versions".
++# Maintainers of other packages that include the intl directory must *not*
++# change these values.
++LTV_CURRENT=7
++LTV_REVISION=0
++LTV_AGE=4
+ 
+ .SUFFIXES:
+-.SUFFIXES: .c .o .lo
++.SUFFIXES: .c .y .o .lo .sin .sed
++
+ .c.o:
+ 	$(COMPILE) $<
+-.c.lo:
+-	$(LIBTOOL) --mode=compile $(COMPILE) $<
+ 
+-INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/lib
++.y.c:
++	$(YACC) $(YFLAGS) --output $@ $<
++	rm -f $*.h
+ 
+-all: all-@USE_INCLUDED_LIBINTL@
++bindtextdom.lo: $(srcdir)/bindtextdom.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c
++dcgettext.lo: $(srcdir)/dcgettext.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcgettext.c
++dgettext.lo: $(srcdir)/dgettext.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dgettext.c
++gettext.lo: $(srcdir)/gettext.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/gettext.c
++finddomain.lo: $(srcdir)/finddomain.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/finddomain.c
++loadmsgcat.lo: $(srcdir)/loadmsgcat.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/loadmsgcat.c
++localealias.lo: $(srcdir)/localealias.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localealias.c
++textdomain.lo: $(srcdir)/textdomain.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/textdomain.c
++l10nflist.lo: $(srcdir)/l10nflist.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/l10nflist.c
++explodename.lo: $(srcdir)/explodename.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/explodename.c
++dcigettext.lo: $(srcdir)/dcigettext.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcigettext.c
++dcngettext.lo: $(srcdir)/dcngettext.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dcngettext.c
++dngettext.lo: $(srcdir)/dngettext.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/dngettext.c
++ngettext.lo: $(srcdir)/ngettext.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/ngettext.c
++plural.lo: $(srcdir)/plural.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural.c
++plural-exp.lo: $(srcdir)/plural-exp.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/plural-exp.c
++localcharset.lo: $(srcdir)/localcharset.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localcharset.c
++relocatable.lo: $(srcdir)/relocatable.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/relocatable.c
++localename.lo: $(srcdir)/localename.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/localename.c
++log.lo: $(srcdir)/log.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/log.c
++printf.lo: $(srcdir)/printf.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/printf.c
++osdep.lo: $(srcdir)/osdep.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/osdep.c
++intl-compat.lo: $(srcdir)/intl-compat.c
++	$(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c
+ 
+-all-yes: libintl.$la intlh.inst
+-all-no:
++ref-add.sed: $(srcdir)/ref-add.sin
++	sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-add.sin > t-ref-add.sed
++	mv t-ref-add.sed ref-add.sed
++ref-del.sed: $(srcdir)/ref-del.sin
++	sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $(srcdir)/ref-del.sin > t-ref-del.sed
++	mv t-ref-del.sed ref-del.sed
+ 
+-libintl.a: $(OBJECTS)
+-	rm -f $@
+-	$(AR) cru $@ $(OBJECTS)
+-	$(RANLIB) $@
++INCLUDES = -I. -I$(srcdir) -I..
+ 
+-libintl.la: $(OBJECTS)
+-	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \
+-		   -version-info 1:0 -rpath $(libdir)
++libgnuintl.h: $(srcdir)/libgnuintl.h.in
++	sed -e 's,@''HAVE_POSIX_PRINTF''@,@HAVE_POSIX_PRINTF@,g' \
++	    -e 's,@''HAVE_ASPRINTF''@,@HAVE_ASPRINTF@,g' \
++	    -e 's,@''HAVE_SNPRINTF''@,@HAVE_SNPRINTF@,g' \
++	    -e 's,@''HAVE_WPRINTF''@,@HAVE_WPRINTF@,g' \
++	  < $(srcdir)/libgnuintl.h.in > libgnuintl.h
+ 
+-../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot
+-	cd ../po && $(MAKE) cat-id-tbl.$lo
++libintl.h: libgnuintl.h
++	cp libgnuintl.h libintl.h
+ 
+-check: all
++charset.alias: $(srcdir)/config.charset
++	$(SHELL) $(srcdir)/config.charset '@host@' > t-$@
++	mv t-$@ $@
+ 
+-# This installation goal is only used in GNU gettext.  Packages which
+-# only use the library should use install instead.
++check: all
+ 
+ # We must not install the libintl.h/libintl.a files if we are on a
+-# system which has the gettext() function in its C library or in a
+-# separate library or use the catgets interface.  A special case is
+-# where configure found a previously installed GNU gettext library.
++# system which has the GNU gettext() function in its C library or in a
++# separate library.
+ # If you want to use the one which comes with this version of the
+ # package, you have to use `configure --with-included-gettext'.
+ install: install-exec install-data
+ install-exec: all
+-	if test "$(PACKAGE)" = "gettext" \
+-	   && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
+-	  if test -r $(MKINSTALLDIRS); then \
+-	    $(MKINSTALLDIRS) $(libdir) $(includedir); \
+-	  else \
+-	    $(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \
++	if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
++	   && test '@USE_INCLUDED_LIBINTL@' = yes; then \
++	  $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
++	  $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \
++	  $(LIBTOOL) --mode=install \
++	    $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \
++	  if test "@RELOCATABLE@" = yes; then \
++	    dependencies=`sed -n -e 's,^dependency_libs=\(.*\),\1,p' < $(DESTDIR)$(libdir)/libintl.la | sed -e "s,^',," -e "s,'\$$,,"`; \
++	    if test -n "$$dependencies"; then \
++	      rm -f $(DESTDIR)$(libdir)/libintl.la; \
++	    fi; \
+ 	  fi; \
+-	  $(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \
+-	  $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
+ 	else \
+ 	  : ; \
+ 	fi
+-install-data: all
+-	if test "$(PACKAGE)" = "gettext"; then \
+-	  if test -r $(MKINSTALLDIRS); then \
+-	    $(MKINSTALLDIRS) $(gettextsrcdir); \
++	if test "$(PACKAGE)" = "gettext-tools" \
++	   && test '@USE_INCLUDED_LIBINTL@' = no; then \
++	  $(mkinstalldirs) $(DESTDIR)$(libdir); \
++	  $(LIBTOOL) --mode=install \
++	    $(INSTALL_DATA) libgnuintl.$la $(DESTDIR)$(libdir)/libgnuintl.$la; \
++	  rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
++	  $(INSTALL_DATA) $(DESTDIR)$(libdir)/libgnuintl.so $(DESTDIR)$(libdir)/preloadable_libintl.so; \
++	  $(LIBTOOL) --mode=uninstall \
++	    rm -f $(DESTDIR)$(libdir)/libgnuintl.$la; \
++	else \
++	  : ; \
++	fi
++	if test '@USE_INCLUDED_LIBINTL@' = yes; then \
++	  test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
++	  temp=$(DESTDIR)$(libdir)/t-charset.alias; \
++	  dest=$(DESTDIR)$(libdir)/charset.alias; \
++	  if test -f $(DESTDIR)$(libdir)/charset.alias; then \
++	    orig=$(DESTDIR)$(libdir)/charset.alias; \
++	    sed -f ref-add.sed $$orig > $$temp; \
++	    $(INSTALL_DATA) $$temp $$dest; \
++	    rm -f $$temp; \
+ 	  else \
+-	    $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
++	    if test @GLIBC21@ = no; then \
++	      orig=charset.alias; \
++	      sed -f ref-add.sed $$orig > $$temp; \
++	      $(INSTALL_DATA) $$temp $$dest; \
++	      rm -f $$temp; \
++	    fi; \
+ 	  fi; \
+-	  $(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \
+-	  dists="$(DISTFILES.common)"; \
++	  $(mkinstalldirs) $(DESTDIR)$(localedir); \
++	  test -f $(DESTDIR)$(localedir)/locale.alias \
++	    && orig=$(DESTDIR)$(localedir)/locale.alias \
++	    || orig=$(srcdir)/locale.alias; \
++	  temp=$(DESTDIR)$(localedir)/t-locale.alias; \
++	  dest=$(DESTDIR)$(localedir)/locale.alias; \
++	  sed -f ref-add.sed $$orig > $$temp; \
++	  $(INSTALL_DATA) $$temp $$dest; \
++	  rm -f $$temp; \
++	else \
++	  : ; \
++	fi
++install-data: all
++	if test "$(PACKAGE)" = "gettext-tools"; then \
++	  $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
++	  $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \
++	  $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \
++	  dists="COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common)"; \
+ 	  for file in $$dists; do \
+-	    $(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \
++	    $(INSTALL_DATA) $(srcdir)/$$file \
++			    $(DESTDIR)$(gettextsrcdir)/$$file; \
+ 	  done; \
++	  chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \
++	  dists="$(DISTFILES.generated)"; \
++	  for file in $$dists; do \
++	    if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
++	    $(INSTALL_DATA) $$dir/$$file \
++			    $(DESTDIR)$(gettextsrcdir)/$$file; \
++	  done; \
++	  dists="$(DISTFILES.obsolete)"; \
++	  for file in $$dists; do \
++	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
++	  done; \
++	else \
++	  : ; \
++	fi
++
++install-strip: install
++
++installdirs:
++	if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
++	   && test '@USE_INCLUDED_LIBINTL@' = yes; then \
++	  $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \
++	else \
++	  : ; \
++	fi
++	if test "$(PACKAGE)" = "gettext-tools" \
++	   && test '@USE_INCLUDED_LIBINTL@' = no; then \
++	  $(mkinstalldirs) $(DESTDIR)$(libdir); \
++	else \
++	  : ; \
++	fi
++	if test '@USE_INCLUDED_LIBINTL@' = yes; then \
++	  test @GLIBC21@ != no || $(mkinstalldirs) $(DESTDIR)$(libdir); \
++	  $(mkinstalldirs) $(DESTDIR)$(localedir); \
++	else \
++	  : ; \
++	fi
++	if test "$(PACKAGE)" = "gettext-tools"; then \
++	  $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ 	else \
+ 	  : ; \
+ 	fi
+@@ -143,22 +367,76 @@
+ installcheck:
+ 
+ uninstall:
+-	dists="$(DISTFILES.common)"; \
+-	for file in $$dists; do \
+-	  rm -f $(gettextsrcdir)/$$file; \
+-	done
++	if { test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; } \
++	   && test '@USE_INCLUDED_LIBINTL@' = yes; then \
++	  rm -f $(DESTDIR)$(includedir)/libintl.h; \
++	  $(LIBTOOL) --mode=uninstall \
++	    rm -f $(DESTDIR)$(libdir)/libintl.$la; \
++	else \
++	  : ; \
++	fi
++	if test "$(PACKAGE)" = "gettext-tools" \
++	   && test '@USE_INCLUDED_LIBINTL@' = no; then \
++	  rm -f $(DESTDIR)$(libdir)/preloadable_libintl.so; \
++	else \
++	  : ; \
++	fi
++	if test '@USE_INCLUDED_LIBINTL@' = yes; then \
++	  if test -f $(DESTDIR)$(libdir)/charset.alias; then \
++	    temp=$(DESTDIR)$(libdir)/t-charset.alias; \
++	    dest=$(DESTDIR)$(libdir)/charset.alias; \
++	    sed -f ref-del.sed $$dest > $$temp; \
++	    if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
++	      rm -f $$dest; \
++	    else \
++	      $(INSTALL_DATA) $$temp $$dest; \
++	    fi; \
++	    rm -f $$temp; \
++	  fi; \
++	  if test -f $(DESTDIR)$(localedir)/locale.alias; then \
++	    temp=$(DESTDIR)$(localedir)/t-locale.alias; \
++	    dest=$(DESTDIR)$(localedir)/locale.alias; \
++	    sed -f ref-del.sed $$dest > $$temp; \
++	    if grep '^# Packages using this file: $$' $$temp > /dev/null; then \
++	      rm -f $$dest; \
++	    else \
++	      $(INSTALL_DATA) $$temp $$dest; \
++	    fi; \
++	    rm -f $$temp; \
++	  fi; \
++	else \
++	  : ; \
++	fi
++	if test "$(PACKAGE)" = "gettext-tools"; then \
++	  for file in VERSION ChangeLog COPYING.LIB-2.0 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \
++	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
++	  done; \
++	else \
++	  : ; \
++	fi
+ 
+-info dvi:
++info dvi ps pdf html:
+ 
+-$(OBJECTS): ../config.h libgettext.h
+-bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
+-dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
++$(OBJECTS): ../config.h libgnuintl.h
++bindtextdom.$lo dcgettext.$lo dcigettext.$lo dcngettext.$lo dgettext.$lo dngettext.$lo finddomain.$lo gettext.$lo intl-compat.$lo loadmsgcat.$lo localealias.$lo ngettext.$lo textdomain.$lo: $(srcdir)/gettextP.h $(srcdir)/gmo.h $(srcdir)/loadinfo.h
++dcigettext.$lo loadmsgcat.$lo: $(srcdir)/hash-string.h
++explodename.$lo l10nflist.$lo: $(srcdir)/loadinfo.h
++dcigettext.$lo loadmsgcat.$lo plural.$lo plural-exp.$lo: $(srcdir)/plural-exp.h
++dcigettext.$lo: $(srcdir)/eval-plural.h
++localcharset.$lo: $(srcdir)/localcharset.h
++localealias.$lo localcharset.$lo relocatable.$lo: $(srcdir)/relocatable.h
++printf.$lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-parse.h $(srcdir)/wprintf-parse.h $(srcdir)/xsize.h $(srcdir)/printf-parse.c $(srcdir)/vasnprintf.h $(srcdir)/vasnwprintf.h $(srcdir)/vasnprintf.c
+ 
+ tags: TAGS
+ 
+ TAGS: $(HEADERS) $(SOURCES)
+ 	here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
+ 
++ctags: CTAGS
++
++CTAGS: $(HEADERS) $(SOURCES)
++	here=`pwd`; cd $(srcdir) && ctags -o $$here/CTAGS $(HEADERS) $(SOURCES)
++
+ id: ID
+ 
+ ID: $(HEADERS) $(SOURCES)
+@@ -166,12 +444,19 @@
+ 
+ 
+ mostlyclean:
+-	rm -f *.a *.o *.lo core core.*
++	rm -f *.a *.la *.o *.obj *.lo core core.*
++	rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed
++	rm -f -r .libs _libs
+ 
+ clean: mostlyclean
+ 
+ distclean: clean
+-	rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h
++	rm -f Makefile ID TAGS
++	if test "$(PACKAGE)" = "gettext-runtime" || test "$(PACKAGE)" = "gettext-tools"; then \
++	  rm -f ChangeLog.inst $(DISTFILES.normal); \
++	else \
++	  : ; \
++	fi
+ 
+ maintainer-clean: distclean
+ 	@echo "This command is intended for maintainers to use;"
+@@ -181,33 +466,27 @@
+ # GNU gettext needs not contain the file `VERSION' but contains some
+ # other files which should not be distributed in other packages.
+ distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+-dist distdir: Makefile $(DISTFILES)
+-	if test "$(PACKAGE)" = gettext; then \
+-	  additional="$(DISTFILES.gettext)"; \
++dist distdir: Makefile
++	if test "$(PACKAGE)" = "gettext-tools"; then \
++	  : ; \
+ 	else \
+-	  additional="$(DISTFILES.normal)"; \
+-	fi; \
+-	for file in $(DISTFILES.common) $$additional; do \
+-	  ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+-	    || cp -p $(srcdir)/$$file $(distdir); \
+-	done
+-
+-dist-libc:
+-	tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc
+-
+-Makefile: Makefile.in ../config.status
+-	cd .. \
+-	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
++	  if test "$(PACKAGE)" = "gettext-runtime"; then \
++	    additional="$(DISTFILES.gettext)"; \
++	  else \
++	    additional="$(DISTFILES.normal)"; \
++	  fi; \
++	  $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \
++	  for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \
++	    if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
++	    cp -p $$dir/$$file $(distdir); \
++	  done; \
++	fi
+ 
+-# The dependency for intlh.inst is different in gettext and all other
+-# packages.  Because we cannot you GNU make features we have to solve
+-# the problem while rewriting Makefile.in.
+-@GT_YES@intlh.inst: intlh.inst.in ../config.status
+-@GT_YES@	cd .. \
+-@GT_YES@	&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
+-@GT_YES@	  $(SHELL) ./config.status
+-@GT_NO@.PHONY: intlh.inst
+-@GT_NO@intlh.inst:
++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
++	cd $(top_builddir) && $(SHELL) ./config.status
++# This would be more efficient, but doesn't work any more with autoconf-2.57,
++# when AC_CONFIG_FILES([intl/Makefile:somedir/Makefile.in]) is used.
++#	cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+ 
+ # Tell versions [3.59,3.63) of GNU make not to export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+--- lrzsz-0.12.20.safe/intl/ngettext.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/ngettext.c	2004-09-12 14:40:34.533721032 -0400
+@@ -0,0 +1,65 @@
++/* Implementation of ngettext(3) function.
++   Copyright (C) 1995, 1997, 2000-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#ifdef _LIBC
++# define __need_NULL
++# include <stddef.h>
++#else
++# include <stdlib.h>		/* Just for NULL.  */
++#endif
++
++#include "gettextP.h"
++#ifdef _LIBC
++# include <libintl.h>
++#else
++# include "libgnuintl.h"
++#endif
++
++#include <locale.h>
++
++/* @@ end of prolog @@ */
++
++/* Names for the libintl functions are a problem.  They must not clash
++   with existing names and they should follow ANSI C.  But this source
++   code is also used in GNU C Library where the names have a __
++   prefix.  So we have to make a difference here.  */
++#ifdef _LIBC
++# define NGETTEXT __ngettext
++# define DCNGETTEXT __dcngettext
++#else
++# define NGETTEXT libintl_ngettext
++# define DCNGETTEXT libintl_dcngettext
++#endif
++
++/* Look up MSGID in the current default message catalog for the current
++   LC_MESSAGES locale.  If not found, returns MSGID itself (the default
++   text).  */
++char *
++NGETTEXT (const char *msgid1, const char *msgid2, unsigned long int n)
++{
++  return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES);
++}
++
++#ifdef _LIBC
++/* Alias for function name in GNU C Library.  */
++weak_alias (__ngettext, ngettext);
++#endif
+--- lrzsz-0.12.20.safe/intl/os2compat.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/os2compat.c	2004-09-12 14:40:34.539720120 -0400
+@@ -0,0 +1,98 @@
++/* OS/2 compatibility functions.
++   Copyright (C) 2001-2002 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#define OS2_AWARE
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#include <stdlib.h>
++#include <string.h>
++#include <sys/param.h>
++
++/* A version of getenv() that works from DLLs */
++extern unsigned long DosScanEnv (const unsigned char *pszName, unsigned char **ppszValue);
++
++char *
++_nl_getenv (const char *name)
++{
++  unsigned char *value;
++  if (DosScanEnv (name, &value))
++    return NULL;
++  else
++    return value;
++}
++
++/* A fixed size buffer.  */
++char libintl_nl_default_dirname[MAXPATHLEN+1];
++
++char *_nlos2_libdir = NULL;
++char *_nlos2_localealiaspath = NULL;
++char *_nlos2_localedir = NULL;
++
++static __attribute__((constructor)) void
++nlos2_initialize ()
++{
++  char *root = getenv ("UNIXROOT");
++  char *gnulocaledir = getenv ("GNULOCALEDIR");
++
++  _nlos2_libdir = gnulocaledir;
++  if (!_nlos2_libdir)
++    {
++      if (root)
++        {
++          size_t sl = strlen (root);
++          _nlos2_libdir = (char *) malloc (sl + strlen (LIBDIR) + 1);
++          memcpy (_nlos2_libdir, root, sl);
++          memcpy (_nlos2_libdir + sl, LIBDIR, strlen (LIBDIR) + 1);
++        }
++      else
++        _nlos2_libdir = LIBDIR;
++    }
++
++  _nlos2_localealiaspath = gnulocaledir;
++  if (!_nlos2_localealiaspath)
++    {
++      if (root)
++        {
++          size_t sl = strlen (root);
++          _nlos2_localealiaspath = (char *) malloc (sl + strlen (LOCALE_ALIAS_PATH) + 1);
++          memcpy (_nlos2_localealiaspath, root, sl);
++          memcpy (_nlos2_localealiaspath + sl, LOCALE_ALIAS_PATH, strlen (LOCALE_ALIAS_PATH) + 1);
++        }
++     else
++        _nlos2_localealiaspath = LOCALE_ALIAS_PATH;
++    }
++
++  _nlos2_localedir = gnulocaledir;
++  if (!_nlos2_localedir)
++    {
++      if (root)
++        {
++          size_t sl = strlen (root);
++          _nlos2_localedir = (char *) malloc (sl + strlen (LOCALEDIR) + 1);
++          memcpy (_nlos2_localedir, root, sl);
++          memcpy (_nlos2_localedir + sl, LOCALEDIR, strlen (LOCALEDIR) + 1);
++        }
++      else
++        _nlos2_localedir = LOCALEDIR;
++    }
++
++  if (strlen (_nlos2_localedir) <= MAXPATHLEN)
++    strcpy (libintl_nl_default_dirname, _nlos2_localedir);
++}
+--- lrzsz-0.12.20.safe/intl/os2compat.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/os2compat.h	2004-09-12 14:40:34.544719360 -0400
+@@ -0,0 +1,46 @@
++/* OS/2 compatibility defines.
++   This file is intended to be included from config.h
++   Copyright (C) 2001-2002 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* When included from os2compat.h we need all the original definitions */
++#ifndef OS2_AWARE
++
++#undef LIBDIR
++#define LIBDIR			_nlos2_libdir
++extern char *_nlos2_libdir;
++
++#undef LOCALEDIR
++#define LOCALEDIR		_nlos2_localedir
++extern char *_nlos2_localedir;
++
++#undef LOCALE_ALIAS_PATH
++#define LOCALE_ALIAS_PATH	_nlos2_localealiaspath
++extern char *_nlos2_localealiaspath;
++
++#endif
++
++#undef HAVE_STRCASECMP
++#define HAVE_STRCASECMP 1
++#define strcasecmp stricmp
++#define strncasecmp strnicmp
++
++/* We have our own getenv() which works even if library is compiled as DLL */
++#define getenv _nl_getenv
++
++/* Older versions of gettext used -1 as the value of LC_MESSAGES */
++#define LC_MESSAGES_COMPAT (-1)
+--- lrzsz-0.12.20.safe/intl/osdep.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/osdep.c	2004-09-12 14:40:34.550718448 -0400
+@@ -0,0 +1,24 @@
++/* OS dependent parts of libintl.
++   Copyright (C) 2001-2002 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#if defined __EMX__
++# include "os2compat.c"
++#else
++/* Avoid AIX compiler warning.  */
++typedef int dummy;
++#endif
+--- lrzsz-0.12.20.safe/intl/plural.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/plural.c	2004-09-12 14:40:36.571411256 -0400
+@@ -0,0 +1,1490 @@
++/* A Bison parser, made from plural.y
++   by GNU bison 1.35.  */
++
++#define YYBISON 1  /* Identify Bison output.  */
++
++#define yyparse __gettextparse
++#define yylex __gettextlex
++#define yyerror __gettexterror
++#define yylval __gettextlval
++#define yychar __gettextchar
++#define yydebug __gettextdebug
++#define yynerrs __gettextnerrs
++# define	EQUOP2	257
++# define	CMPOP2	258
++# define	ADDOP2	259
++# define	MULOP2	260
++# define	NUMBER	261
++
++#line 1 "plural.y"
++
++/* Expression parsing for plural form selection.
++   Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
++   Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* The bison generated parser uses alloca.  AIX 3 forces us to put this
++   declaration at the beginning of the file.  The declaration in bison's
++   skeleton file comes too late.  This must come before <config.h>
++   because <config.h> may include arbitrary system headers.  */
++#if defined _AIX && !defined __GNUC__
++ #pragma alloca
++#endif
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <stddef.h>
++#include <stdlib.h>
++#include "plural-exp.h"
++
++/* The main function generated by the parser is called __gettextparse,
++   but we want it to be called PLURAL_PARSE.  */
++#ifndef _LIBC
++# define __gettextparse PLURAL_PARSE
++#endif
++
++#define YYLEX_PARAM	&((struct parse_args *) arg)->cp
++#define YYPARSE_PARAM	arg
++
++#line 49 "plural.y"
++#ifndef YYSTYPE
++typedef union {
++  unsigned long int num;
++  enum operator op;
++  struct expression *exp;
++} yystype;
++# define YYSTYPE yystype
++# define YYSTYPE_IS_TRIVIAL 1
++#endif
++#line 55 "plural.y"
++
++/* Prototypes for local functions.  */
++static int yylex (YYSTYPE *lval, const char **pexp);
++static void yyerror (const char *str);
++
++/* Allocation of expressions.  */
++
++static struct expression *
++new_exp (int nargs, enum operator op, struct expression * const *args)
++{
++  int i;
++  struct expression *newp;
++
++  /* If any of the argument could not be malloc'ed, just return NULL.  */
++  for (i = nargs - 1; i >= 0; i--)
++    if (args[i] == NULL)
++      goto fail;
++
++  /* Allocate a new expression.  */
++  newp = (struct expression *) malloc (sizeof (*newp));
++  if (newp != NULL)
++    {
++      newp->nargs = nargs;
++      newp->operation = op;
++      for (i = nargs - 1; i >= 0; i--)
++	newp->val.args[i] = args[i];
++      return newp;
++    }
++
++ fail:
++  for (i = nargs - 1; i >= 0; i--)
++    FREE_EXPRESSION (args[i]);
++
++  return NULL;
++}
++
++static inline struct expression *
++new_exp_0 (enum operator op)
++{
++  return new_exp (0, op, NULL);
++}
++
++static inline struct expression *
++new_exp_1 (enum operator op, struct expression *right)
++{
++  struct expression *args[1];
++
++  args[0] = right;
++  return new_exp (1, op, args);
++}
++
++static struct expression *
++new_exp_2 (enum operator op, struct expression *left, struct expression *right)
++{
++  struct expression *args[2];
++
++  args[0] = left;
++  args[1] = right;
++  return new_exp (2, op, args);
++}
++
++static inline struct expression *
++new_exp_3 (enum operator op, struct expression *bexp,
++	   struct expression *tbranch, struct expression *fbranch)
++{
++  struct expression *args[3];
++
++  args[0] = bexp;
++  args[1] = tbranch;
++  args[2] = fbranch;
++  return new_exp (3, op, args);
++}
++
++#ifndef YYDEBUG
++# define YYDEBUG 0
++#endif
++
++
++
++#define	YYFINAL		27
++#define	YYFLAG		-32768
++#define	YYNTBASE	16
++
++/* YYTRANSLATE(YYLEX) -- Bison token number corresponding to YYLEX. */
++#define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18)
++
++/* YYTRANSLATE[YYLEX] -- Bison token number corresponding to YYLEX. */
++static const char yytranslate[] =
++{
++       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,    10,     2,     2,     2,     2,     5,     2,
++      14,    15,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,    12,     2,
++       2,     2,     2,     3,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++      13,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     4,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
++       2,     2,     2,     2,     2,     2,     1,     6,     7,     8,
++       9,    11
++};
++
++#if YYDEBUG
++static const short yyprhs[] =
++{
++       0,     0,     2,     8,    12,    16,    20,    24,    28,    32,
++      35,    37,    39
++};
++static const short yyrhs[] =
++{
++      17,     0,    17,     3,    17,    12,    17,     0,    17,     4,
++      17,     0,    17,     5,    17,     0,    17,     6,    17,     0,
++      17,     7,    17,     0,    17,     8,    17,     0,    17,     9,
++      17,     0,    10,    17,     0,    13,     0,    11,     0,    14,
++      17,    15,     0
++};
++
++#endif
++
++#if YYDEBUG
++/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
++static const short yyrline[] =
++{
++       0,   150,   158,   162,   166,   170,   174,   178,   182,   186,
++     190,   194,   199
++};
++#endif
++
++
++#if (YYDEBUG) || defined YYERROR_VERBOSE
++
++/* YYTNAME[TOKEN_NUM] -- String name of the token TOKEN_NUM. */
++static const char *const yytname[] =
++{
++  "$", "error", "$undefined.", "'?'", "'|'", "'&'", "EQUOP2", "CMPOP2", 
++  "ADDOP2", "MULOP2", "'!'", "NUMBER", "':'", "'n'", "'('", "')'", 
++  "start", "exp", 0
++};
++#endif
++
++/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
++static const short yyr1[] =
++{
++       0,    16,    17,    17,    17,    17,    17,    17,    17,    17,
++      17,    17,    17
++};
++
++/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
++static const short yyr2[] =
++{
++       0,     1,     5,     3,     3,     3,     3,     3,     3,     2,
++       1,     1,     3
++};
++
++/* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
++   doesn't specify something else to do.  Zero means the default is an
++   error. */
++static const short yydefact[] =
++{
++       0,     0,    11,    10,     0,     1,     9,     0,     0,     0,
++       0,     0,     0,     0,     0,    12,     0,     3,     4,     5,
++       6,     7,     8,     0,     2,     0,     0,     0
++};
++
++static const short yydefgoto[] =
++{
++      25,     5
++};
++
++static const short yypact[] =
++{
++      -9,    -9,-32768,-32768,    -9,    34,-32768,    11,    -9,    -9,
++      -9,    -9,    -9,    -9,    -9,-32768,    24,    39,    43,    16,
++      26,    -3,-32768,    -9,    34,    21,    53,-32768
++};
++
++static const short yypgoto[] =
++{
++  -32768,    -1
++};
++
++
++#define	YYLAST		53
++
++
++static const short yytable[] =
++{
++       6,     1,     2,     7,     3,     4,    14,    16,    17,    18,
++      19,    20,    21,    22,     8,     9,    10,    11,    12,    13,
++      14,    26,    24,    12,    13,    14,    15,     8,     9,    10,
++      11,    12,    13,    14,    13,    14,    23,     8,     9,    10,
++      11,    12,    13,    14,    10,    11,    12,    13,    14,    11,
++      12,    13,    14,    27
++};
++
++static const short yycheck[] =
++{
++       1,    10,    11,     4,    13,    14,     9,     8,     9,    10,
++      11,    12,    13,    14,     3,     4,     5,     6,     7,     8,
++       9,     0,    23,     7,     8,     9,    15,     3,     4,     5,
++       6,     7,     8,     9,     8,     9,    12,     3,     4,     5,
++       6,     7,     8,     9,     5,     6,     7,     8,     9,     6,
++       7,     8,     9,     0
++};
++#define YYPURE 1
++
++/* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
++#line 3 "/usr/local/share/bison/bison.simple"
++
++/* Skeleton output parser for bison,
++
++   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software
++   Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++/* As a special exception, when this file is copied by Bison into a
++   Bison output file, you may use that output file without restriction.
++   This special exception was added by the Free Software Foundation
++   in version 1.24 of Bison.  */
++
++/* This is the parser code that is written into each bison parser when
++   the %semantic_parser declaration is not specified in the grammar.
++   It was written by Richard Stallman by simplifying the hairy parser
++   used when %semantic_parser is specified.  */
++
++/* All symbols defined below should begin with yy or YY, to avoid
++   infringing on user name space.  This should be done even for local
++   variables, as they might otherwise be expanded by user macros.
++   There are some unavoidable exceptions within include files to
++   define necessary library symbols; they are noted "INFRINGES ON
++   USER NAME SPACE" below.  */
++
++#if ! defined (yyoverflow) || defined (YYERROR_VERBOSE)
++
++/* The parser invokes alloca or malloc; define the necessary symbols.  */
++
++# if YYSTACK_USE_ALLOCA
++#  define YYSTACK_ALLOC alloca
++# else
++#  ifndef YYSTACK_USE_ALLOCA
++#   if defined (alloca) || defined (_ALLOCA_H)
++#    define YYSTACK_ALLOC alloca
++#   else
++#    ifdef __GNUC__
++#     define YYSTACK_ALLOC __builtin_alloca
++#    endif
++#   endif
++#  endif
++# endif
++
++# ifdef YYSTACK_ALLOC
++   /* Pacify GCC's `empty if-body' warning. */
++#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
++# else
++#  if defined (__STDC__) || defined (__cplusplus)
++#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
++#   define YYSIZE_T size_t
++#  endif
++#  define YYSTACK_ALLOC malloc
++#  define YYSTACK_FREE free
++# endif
++#endif /* ! defined (yyoverflow) || defined (YYERROR_VERBOSE) */
++
++
++#if (! defined (yyoverflow) \
++     && (! defined (__cplusplus) \
++	 || (YYLTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
++
++/* A type that is properly aligned for any stack member.  */
++union yyalloc
++{
++  short yyss;
++  YYSTYPE yyvs;
++# if YYLSP_NEEDED
++  YYLTYPE yyls;
++# endif
++};
++
++/* The size of the maximum gap between one aligned stack and the next.  */
++# define YYSTACK_GAP_MAX (sizeof (union yyalloc) - 1)
++
++/* The size of an array large to enough to hold all stacks, each with
++   N elements.  */
++# if YYLSP_NEEDED
++#  define YYSTACK_BYTES(N) \
++     ((N) * (sizeof (short) + sizeof (YYSTYPE) + sizeof (YYLTYPE))	\
++      + 2 * YYSTACK_GAP_MAX)
++# else
++#  define YYSTACK_BYTES(N) \
++     ((N) * (sizeof (short) + sizeof (YYSTYPE))				\
++      + YYSTACK_GAP_MAX)
++# endif
++
++/* Copy COUNT objects from FROM to TO.  The source and destination do
++   not overlap.  */
++# ifndef YYCOPY
++#  if 1 < __GNUC__
++#   define YYCOPY(To, From, Count) \
++      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
++#  else
++#   define YYCOPY(To, From, Count)		\
++      do					\
++	{					\
++	  register YYSIZE_T yyi;		\
++	  for (yyi = 0; yyi < (Count); yyi++)	\
++	    (To)[yyi] = (From)[yyi];		\
++	}					\
++      while (0)
++#  endif
++# endif
++
++/* Relocate STACK from its old location to the new one.  The
++   local variables YYSIZE and YYSTACKSIZE give the old and new number of
++   elements in the stack, and YYPTR gives the new location of the
++   stack.  Advance YYPTR to a properly aligned location for the next
++   stack.  */
++# define YYSTACK_RELOCATE(Stack)					\
++    do									\
++      {									\
++	YYSIZE_T yynewbytes;						\
++	YYCOPY (&yyptr->Stack, Stack, yysize);				\
++	Stack = &yyptr->Stack;						\
++	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAX;	\
++	yyptr += yynewbytes / sizeof (*yyptr);				\
++      }									\
++    while (0)
++
++#endif
++
++
++#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
++# define YYSIZE_T __SIZE_TYPE__
++#endif
++#if ! defined (YYSIZE_T) && defined (size_t)
++# define YYSIZE_T size_t
++#endif
++#if ! defined (YYSIZE_T)
++# if defined (__STDC__) || defined (__cplusplus)
++#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
++#  define YYSIZE_T size_t
++# endif
++#endif
++#if ! defined (YYSIZE_T)
++# define YYSIZE_T unsigned int
++#endif
++
++#define yyerrok		(yyerrstatus = 0)
++#define yyclearin	(yychar = YYEMPTY)
++#define YYEMPTY		-2
++#define YYEOF		0
++#define YYACCEPT	goto yyacceptlab
++#define YYABORT 	goto yyabortlab
++#define YYERROR		goto yyerrlab1
++/* Like YYERROR except do call yyerror.  This remains here temporarily
++   to ease the transition to the new meaning of YYERROR, for GCC.
++   Once GCC version 2 has supplanted version 1, this can go.  */
++#define YYFAIL		goto yyerrlab
++#define YYRECOVERING()  (!!yyerrstatus)
++#define YYBACKUP(Token, Value)					\
++do								\
++  if (yychar == YYEMPTY && yylen == 1)				\
++    {								\
++      yychar = (Token);						\
++      yylval = (Value);						\
++      yychar1 = YYTRANSLATE (yychar);				\
++      YYPOPSTACK;						\
++      goto yybackup;						\
++    }								\
++  else								\
++    { 								\
++      yyerror ("syntax error: cannot back up");			\
++      YYERROR;							\
++    }								\
++while (0)
++
++#define YYTERROR	1
++#define YYERRCODE	256
++
++
++/* YYLLOC_DEFAULT -- Compute the default location (before the actions
++   are run).
++
++   When YYLLOC_DEFAULT is run, CURRENT is set the location of the
++   first token.  By default, to implement support for ranges, extend
++   its range to the last symbol.  */
++
++#ifndef YYLLOC_DEFAULT
++# define YYLLOC_DEFAULT(Current, Rhs, N)       	\
++   Current.last_line   = Rhs[N].last_line;	\
++   Current.last_column = Rhs[N].last_column;
++#endif
++
++
++/* YYLEX -- calling `yylex' with the right arguments.  */
++
++#if YYPURE
++# if YYLSP_NEEDED
++#  ifdef YYLEX_PARAM
++#   define YYLEX		yylex (&yylval, &yylloc, YYLEX_PARAM)
++#  else
++#   define YYLEX		yylex (&yylval, &yylloc)
++#  endif
++# else /* !YYLSP_NEEDED */
++#  ifdef YYLEX_PARAM
++#   define YYLEX		yylex (&yylval, YYLEX_PARAM)
++#  else
++#   define YYLEX		yylex (&yylval)
++#  endif
++# endif /* !YYLSP_NEEDED */
++#else /* !YYPURE */
++# define YYLEX			yylex ()
++#endif /* !YYPURE */
++
++
++/* Enable debugging if requested.  */
++#if YYDEBUG
++
++# ifndef YYFPRINTF
++#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
++#  define YYFPRINTF fprintf
++# endif
++
++# define YYDPRINTF(Args)			\
++do {						\
++  if (yydebug)					\
++    YYFPRINTF Args;				\
++} while (0)
++/* Nonzero means print parse trace.  It is left uninitialized so that
++   multiple parsers can coexist.  */
++int yydebug;
++#else /* !YYDEBUG */
++# define YYDPRINTF(Args)
++#endif /* !YYDEBUG */
++
++/* YYINITDEPTH -- initial size of the parser's stacks.  */
++#ifndef	YYINITDEPTH
++# define YYINITDEPTH 200
++#endif
++
++/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
++   if the built-in stack extension method is used).
++
++   Do not make this value too large; the results are undefined if
++   SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
++   evaluated with infinite-precision integer arithmetic.  */
++
++#if YYMAXDEPTH == 0
++# undef YYMAXDEPTH
++#endif
++
++#ifndef YYMAXDEPTH
++# define YYMAXDEPTH 10000
++#endif
++
++#ifdef YYERROR_VERBOSE
++
++# ifndef yystrlen
++#  if defined (__GLIBC__) && defined (_STRING_H)
++#   define yystrlen strlen
++#  else
++/* Return the length of YYSTR.  */
++static YYSIZE_T
++#   if defined (__STDC__) || defined (__cplusplus)
++yystrlen (const char *yystr)
++#   else
++yystrlen (yystr)
++     const char *yystr;
++#   endif
++{
++  register const char *yys = yystr;
++
++  while (*yys++ != '\0')
++    continue;
++
++  return yys - yystr - 1;
++}
++#  endif
++# endif
++
++# ifndef yystpcpy
++#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
++#   define yystpcpy stpcpy
++#  else
++/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
++   YYDEST.  */
++static char *
++#   if defined (__STDC__) || defined (__cplusplus)
++yystpcpy (char *yydest, const char *yysrc)
++#   else
++yystpcpy (yydest, yysrc)
++     char *yydest;
++     const char *yysrc;
++#   endif
++{
++  register char *yyd = yydest;
++  register const char *yys = yysrc;
++
++  while ((*yyd++ = *yys++) != '\0')
++    continue;
++
++  return yyd - 1;
++}
++#  endif
++# endif
++#endif
++
++#line 315 "/usr/local/share/bison/bison.simple"
++
++
++/* The user can define YYPARSE_PARAM as the name of an argument to be passed
++   into yyparse.  The argument should have type void *.
++   It should actually point to an object.
++   Grammar actions can access the variable by casting it
++   to the proper pointer type.  */
++
++#ifdef YYPARSE_PARAM
++# if defined (__STDC__) || defined (__cplusplus)
++#  define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
++#  define YYPARSE_PARAM_DECL
++# else
++#  define YYPARSE_PARAM_ARG YYPARSE_PARAM
++#  define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
++# endif
++#else /* !YYPARSE_PARAM */
++# define YYPARSE_PARAM_ARG
++# define YYPARSE_PARAM_DECL
++#endif /* !YYPARSE_PARAM */
++
++/* Prevent warning if -Wstrict-prototypes.  */
++#ifdef __GNUC__
++# ifdef YYPARSE_PARAM
++int yyparse (void *);
++# else
++int yyparse (void);
++# endif
++#endif
++
++/* YY_DECL_VARIABLES -- depending whether we use a pure parser,
++   variables are global, or local to YYPARSE.  */
++
++#define YY_DECL_NON_LSP_VARIABLES			\
++/* The lookahead symbol.  */				\
++int yychar;						\
++							\
++/* The semantic value of the lookahead symbol. */	\
++YYSTYPE yylval;						\
++							\
++/* Number of parse errors so far.  */			\
++int yynerrs;
++
++#if YYLSP_NEEDED
++# define YY_DECL_VARIABLES			\
++YY_DECL_NON_LSP_VARIABLES			\
++						\
++/* Location data for the lookahead symbol.  */	\
++YYLTYPE yylloc;
++#else
++# define YY_DECL_VARIABLES			\
++YY_DECL_NON_LSP_VARIABLES
++#endif
++
++
++/* If nonreentrant, generate the variables here. */
++
++#if !YYPURE
++YY_DECL_VARIABLES
++#endif  /* !YYPURE */
++
++int
++yyparse (YYPARSE_PARAM_ARG)
++     YYPARSE_PARAM_DECL
++{
++  /* If reentrant, generate the variables here. */
++#if YYPURE
++  YY_DECL_VARIABLES
++#endif  /* !YYPURE */
++
++  register int yystate;
++  register int yyn;
++  int yyresult;
++  /* Number of tokens to shift before error messages enabled.  */
++  int yyerrstatus;
++  /* Lookahead token as an internal (translated) token number.  */
++  int yychar1 = 0;
++
++  /* Three stacks and their tools:
++     `yyss': related to states,
++     `yyvs': related to semantic values,
++     `yyls': related to locations.
++
++     Refer to the stacks thru separate pointers, to allow yyoverflow
++     to reallocate them elsewhere.  */
++
++  /* The state stack. */
++  short	yyssa[YYINITDEPTH];
++  short *yyss = yyssa;
++  register short *yyssp;
++
++  /* The semantic value stack.  */
++  YYSTYPE yyvsa[YYINITDEPTH];
++  YYSTYPE *yyvs = yyvsa;
++  register YYSTYPE *yyvsp;
++
++#if YYLSP_NEEDED
++  /* The location stack.  */
++  YYLTYPE yylsa[YYINITDEPTH];
++  YYLTYPE *yyls = yylsa;
++  YYLTYPE *yylsp;
++#endif
++
++#if YYLSP_NEEDED
++# define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
++#else
++# define YYPOPSTACK   (yyvsp--, yyssp--)
++#endif
++
++  YYSIZE_T yystacksize = YYINITDEPTH;
++
++
++  /* The variables used to return semantic value and location from the
++     action routines.  */
++  YYSTYPE yyval;
++#if YYLSP_NEEDED
++  YYLTYPE yyloc;
++#endif
++
++  /* When reducing, the number of symbols on the RHS of the reduced
++     rule. */
++  int yylen;
++
++  YYDPRINTF ((stderr, "Starting parse\n"));
++
++  yystate = 0;
++  yyerrstatus = 0;
++  yynerrs = 0;
++  yychar = YYEMPTY;		/* Cause a token to be read.  */
++
++  /* Initialize stack pointers.
++     Waste one element of value and location stack
++     so that they stay on the same level as the state stack.
++     The wasted elements are never initialized.  */
++
++  yyssp = yyss;
++  yyvsp = yyvs;
++#if YYLSP_NEEDED
++  yylsp = yyls;
++#endif
++  goto yysetstate;
++
++/*------------------------------------------------------------.
++| yynewstate -- Push a new state, which is found in yystate.  |
++`------------------------------------------------------------*/
++ yynewstate:
++  /* In all cases, when you get here, the value and location stacks
++     have just been pushed. so pushing a state here evens the stacks.
++     */
++  yyssp++;
++
++ yysetstate:
++  *yyssp = yystate;
++
++  if (yyssp >= yyss + yystacksize - 1)
++    {
++      /* Get the current used size of the three stacks, in elements.  */
++      YYSIZE_T yysize = yyssp - yyss + 1;
++
++#ifdef yyoverflow
++      {
++	/* Give user a chance to reallocate the stack. Use copies of
++	   these so that the &'s don't force the real ones into
++	   memory.  */
++	YYSTYPE *yyvs1 = yyvs;
++	short *yyss1 = yyss;
++
++	/* Each stack pointer address is followed by the size of the
++	   data in use in that stack, in bytes.  */
++# if YYLSP_NEEDED
++	YYLTYPE *yyls1 = yyls;
++	/* This used to be a conditional around just the two extra args,
++	   but that might be undefined if yyoverflow is a macro.  */
++	yyoverflow ("parser stack overflow",
++		    &yyss1, yysize * sizeof (*yyssp),
++		    &yyvs1, yysize * sizeof (*yyvsp),
++		    &yyls1, yysize * sizeof (*yylsp),
++		    &yystacksize);
++	yyls = yyls1;
++# else
++	yyoverflow ("parser stack overflow",
++		    &yyss1, yysize * sizeof (*yyssp),
++		    &yyvs1, yysize * sizeof (*yyvsp),
++		    &yystacksize);
++# endif
++	yyss = yyss1;
++	yyvs = yyvs1;
++      }
++#else /* no yyoverflow */
++# ifndef YYSTACK_RELOCATE
++      goto yyoverflowlab;
++# else
++      /* Extend the stack our own way.  */
++      if (yystacksize >= YYMAXDEPTH)
++	goto yyoverflowlab;
++      yystacksize *= 2;
++      if (yystacksize > YYMAXDEPTH)
++	yystacksize = YYMAXDEPTH;
++
++      {
++	short *yyss1 = yyss;
++	union yyalloc *yyptr =
++	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
++	if (! yyptr)
++	  goto yyoverflowlab;
++	YYSTACK_RELOCATE (yyss);
++	YYSTACK_RELOCATE (yyvs);
++# if YYLSP_NEEDED
++	YYSTACK_RELOCATE (yyls);
++# endif
++# undef YYSTACK_RELOCATE
++	if (yyss1 != yyssa)
++	  YYSTACK_FREE (yyss1);
++      }
++# endif
++#endif /* no yyoverflow */
++
++      yyssp = yyss + yysize - 1;
++      yyvsp = yyvs + yysize - 1;
++#if YYLSP_NEEDED
++      yylsp = yyls + yysize - 1;
++#endif
++
++      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
++		  (unsigned long int) yystacksize));
++
++      if (yyssp >= yyss + yystacksize - 1)
++	YYABORT;
++    }
++
++  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
++
++  goto yybackup;
++
++
++/*-----------.
++| yybackup.  |
++`-----------*/
++yybackup:
++
++/* Do appropriate processing given the current state.  */
++/* Read a lookahead token if we need one and don't already have one.  */
++/* yyresume: */
++
++  /* First try to decide what to do without reference to lookahead token.  */
++
++  yyn = yypact[yystate];
++  if (yyn == YYFLAG)
++    goto yydefault;
++
++  /* Not known => get a lookahead token if don't already have one.  */
++
++  /* yychar is either YYEMPTY or YYEOF
++     or a valid token in external form.  */
++
++  if (yychar == YYEMPTY)
++    {
++      YYDPRINTF ((stderr, "Reading a token: "));
++      yychar = YYLEX;
++    }
++
++  /* Convert token to internal form (in yychar1) for indexing tables with */
++
++  if (yychar <= 0)		/* This means end of input. */
++    {
++      yychar1 = 0;
++      yychar = YYEOF;		/* Don't call YYLEX any more */
++
++      YYDPRINTF ((stderr, "Now at end of input.\n"));
++    }
++  else
++    {
++      yychar1 = YYTRANSLATE (yychar);
++
++#if YYDEBUG
++     /* We have to keep this `#if YYDEBUG', since we use variables
++	which are defined only if `YYDEBUG' is set.  */
++      if (yydebug)
++	{
++	  YYFPRINTF (stderr, "Next token is %d (%s",
++		     yychar, yytname[yychar1]);
++	  /* Give the individual parser a way to print the precise
++	     meaning of a token, for further debugging info.  */
++# ifdef YYPRINT
++	  YYPRINT (stderr, yychar, yylval);
++# endif
++	  YYFPRINTF (stderr, ")\n");
++	}
++#endif
++    }
++
++  yyn += yychar1;
++  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
++    goto yydefault;
++
++  yyn = yytable[yyn];
++
++  /* yyn is what to do for this token type in this state.
++     Negative => reduce, -yyn is rule number.
++     Positive => shift, yyn is new state.
++       New state is final state => don't bother to shift,
++       just return success.
++     0, or most negative number => error.  */
++
++  if (yyn < 0)
++    {
++      if (yyn == YYFLAG)
++	goto yyerrlab;
++      yyn = -yyn;
++      goto yyreduce;
++    }
++  else if (yyn == 0)
++    goto yyerrlab;
++
++  if (yyn == YYFINAL)
++    YYACCEPT;
++
++  /* Shift the lookahead token.  */
++  YYDPRINTF ((stderr, "Shifting token %d (%s), ",
++	      yychar, yytname[yychar1]));
++
++  /* Discard the token being shifted unless it is eof.  */
++  if (yychar != YYEOF)
++    yychar = YYEMPTY;
++
++  *++yyvsp = yylval;
++#if YYLSP_NEEDED
++  *++yylsp = yylloc;
++#endif
++
++  /* Count tokens shifted since error; after three, turn off error
++     status.  */
++  if (yyerrstatus)
++    yyerrstatus--;
++
++  yystate = yyn;
++  goto yynewstate;
++
++
++/*-----------------------------------------------------------.
++| yydefault -- do the default action for the current state.  |
++`-----------------------------------------------------------*/
++yydefault:
++  yyn = yydefact[yystate];
++  if (yyn == 0)
++    goto yyerrlab;
++  goto yyreduce;
++
++
++/*-----------------------------.
++| yyreduce -- Do a reduction.  |
++`-----------------------------*/
++yyreduce:
++  /* yyn is the number of a rule to reduce with.  */
++  yylen = yyr2[yyn];
++
++  /* If YYLEN is nonzero, implement the default value of the action:
++     `$$ = $1'.
++
++     Otherwise, the following line sets YYVAL to the semantic value of
++     the lookahead token.  This behavior is undocumented and Bison
++     users should not rely upon it.  Assigning to YYVAL
++     unconditionally makes the parser a bit smaller, and it avoids a
++     GCC warning that YYVAL may be used uninitialized.  */
++  yyval = yyvsp[1-yylen];
++
++#if YYLSP_NEEDED
++  /* Similarly for the default location.  Let the user run additional
++     commands if for instance locations are ranges.  */
++  yyloc = yylsp[1-yylen];
++  YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
++#endif
++
++#if YYDEBUG
++  /* We have to keep this `#if YYDEBUG', since we use variables which
++     are defined only if `YYDEBUG' is set.  */
++  if (yydebug)
++    {
++      int yyi;
++
++      YYFPRINTF (stderr, "Reducing via rule %d (line %d), ",
++		 yyn, yyrline[yyn]);
++
++      /* Print the symbols being reduced, and their result.  */
++      for (yyi = yyprhs[yyn]; yyrhs[yyi] > 0; yyi++)
++	YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
++      YYFPRINTF (stderr, " -> %s\n", yytname[yyr1[yyn]]);
++    }
++#endif
++
++  switch (yyn) {
++
++case 1:
++#line 151 "plural.y"
++{
++	    if (yyvsp[0].exp == NULL)
++	      YYABORT;
++	    ((struct parse_args *) arg)->res = yyvsp[0].exp;
++	  }
++    break;
++case 2:
++#line 159 "plural.y"
++{
++	    yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp);
++	  }
++    break;
++case 3:
++#line 163 "plural.y"
++{
++	    yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp);
++	  }
++    break;
++case 4:
++#line 167 "plural.y"
++{
++	    yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp);
++	  }
++    break;
++case 5:
++#line 171 "plural.y"
++{
++	    yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
++	  }
++    break;
++case 6:
++#line 175 "plural.y"
++{
++	    yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
++	  }
++    break;
++case 7:
++#line 179 "plural.y"
++{
++	    yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
++	  }
++    break;
++case 8:
++#line 183 "plural.y"
++{
++	    yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp);
++	  }
++    break;
++case 9:
++#line 187 "plural.y"
++{
++	    yyval.exp = new_exp_1 (lnot, yyvsp[0].exp);
++	  }
++    break;
++case 10:
++#line 191 "plural.y"
++{
++	    yyval.exp = new_exp_0 (var);
++	  }
++    break;
++case 11:
++#line 195 "plural.y"
++{
++	    if ((yyval.exp = new_exp_0 (num)) != NULL)
++	      yyval.exp->val.num = yyvsp[0].num;
++	  }
++    break;
++case 12:
++#line 200 "plural.y"
++{
++	    yyval.exp = yyvsp[-1].exp;
++	  }
++    break;
++}
++
++#line 705 "/usr/local/share/bison/bison.simple"
++
++
++  yyvsp -= yylen;
++  yyssp -= yylen;
++#if YYLSP_NEEDED
++  yylsp -= yylen;
++#endif
++
++#if YYDEBUG
++  if (yydebug)
++    {
++      short *yyssp1 = yyss - 1;
++      YYFPRINTF (stderr, "state stack now");
++      while (yyssp1 != yyssp)
++	YYFPRINTF (stderr, " %d", *++yyssp1);
++      YYFPRINTF (stderr, "\n");
++    }
++#endif
++
++  *++yyvsp = yyval;
++#if YYLSP_NEEDED
++  *++yylsp = yyloc;
++#endif
++
++  /* Now `shift' the result of the reduction.  Determine what state
++     that goes to, based on the state we popped back to and the rule
++     number reduced by.  */
++
++  yyn = yyr1[yyn];
++
++  yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
++  if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
++    yystate = yytable[yystate];
++  else
++    yystate = yydefgoto[yyn - YYNTBASE];
++
++  goto yynewstate;
++
++
++/*------------------------------------.
++| yyerrlab -- here on detecting error |
++`------------------------------------*/
++yyerrlab:
++  /* If not already recovering from an error, report this error.  */
++  if (!yyerrstatus)
++    {
++      ++yynerrs;
++
++#ifdef YYERROR_VERBOSE
++      yyn = yypact[yystate];
++
++      if (yyn > YYFLAG && yyn < YYLAST)
++	{
++	  YYSIZE_T yysize = 0;
++	  char *yymsg;
++	  int yyx, yycount;
++
++	  yycount = 0;
++	  /* Start YYX at -YYN if negative to avoid negative indexes in
++	     YYCHECK.  */
++	  for (yyx = yyn < 0 ? -yyn : 0;
++	       yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++)
++	    if (yycheck[yyx + yyn] == yyx)
++	      yysize += yystrlen (yytname[yyx]) + 15, yycount++;
++	  yysize += yystrlen ("parse error, unexpected ") + 1;
++	  yysize += yystrlen (yytname[YYTRANSLATE (yychar)]);
++	  yymsg = (char *) YYSTACK_ALLOC (yysize);
++	  if (yymsg != 0)
++	    {
++	      char *yyp = yystpcpy (yymsg, "parse error, unexpected ");
++	      yyp = yystpcpy (yyp, yytname[YYTRANSLATE (yychar)]);
++
++	      if (yycount < 5)
++		{
++		  yycount = 0;
++		  for (yyx = yyn < 0 ? -yyn : 0;
++		       yyx < (int) (sizeof (yytname) / sizeof (char *));
++		       yyx++)
++		    if (yycheck[yyx + yyn] == yyx)
++		      {
++			const char *yyq = ! yycount ? ", expecting " : " or ";
++			yyp = yystpcpy (yyp, yyq);
++			yyp = yystpcpy (yyp, yytname[yyx]);
++			yycount++;
++		      }
++		}
++	      yyerror (yymsg);
++	      YYSTACK_FREE (yymsg);
++	    }
++	  else
++	    yyerror ("parse error; also virtual memory exhausted");
++	}
++      else
++#endif /* defined (YYERROR_VERBOSE) */
++	yyerror ("parse error");
++    }
++  goto yyerrlab1;
++
++
++/*--------------------------------------------------.
++| yyerrlab1 -- error raised explicitly by an action |
++`--------------------------------------------------*/
++yyerrlab1:
++  if (yyerrstatus == 3)
++    {
++      /* If just tried and failed to reuse lookahead token after an
++	 error, discard it.  */
++
++      /* return failure if at end of input */
++      if (yychar == YYEOF)
++	YYABORT;
++      YYDPRINTF ((stderr, "Discarding token %d (%s).\n",
++		  yychar, yytname[yychar1]));
++      yychar = YYEMPTY;
++    }
++
++  /* Else will try to reuse lookahead token after shifting the error
++     token.  */
++
++  yyerrstatus = 3;		/* Each real token shifted decrements this */
++
++  goto yyerrhandle;
++
++
++/*-------------------------------------------------------------------.
++| yyerrdefault -- current state does not do anything special for the |
++| error token.                                                       |
++`-------------------------------------------------------------------*/
++yyerrdefault:
++#if 0
++  /* This is wrong; only states that explicitly want error tokens
++     should shift them.  */
++
++  /* If its default is to accept any token, ok.  Otherwise pop it.  */
++  yyn = yydefact[yystate];
++  if (yyn)
++    goto yydefault;
++#endif
++
++
++/*---------------------------------------------------------------.
++| yyerrpop -- pop the current state because it cannot handle the |
++| error token                                                    |
++`---------------------------------------------------------------*/
++yyerrpop:
++  if (yyssp == yyss)
++    YYABORT;
++  yyvsp--;
++  yystate = *--yyssp;
++#if YYLSP_NEEDED
++  yylsp--;
++#endif
++
++#if YYDEBUG
++  if (yydebug)
++    {
++      short *yyssp1 = yyss - 1;
++      YYFPRINTF (stderr, "Error: state stack now");
++      while (yyssp1 != yyssp)
++	YYFPRINTF (stderr, " %d", *++yyssp1);
++      YYFPRINTF (stderr, "\n");
++    }
++#endif
++
++/*--------------.
++| yyerrhandle.  |
++`--------------*/
++yyerrhandle:
++  yyn = yypact[yystate];
++  if (yyn == YYFLAG)
++    goto yyerrdefault;
++
++  yyn += YYTERROR;
++  if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
++    goto yyerrdefault;
++
++  yyn = yytable[yyn];
++  if (yyn < 0)
++    {
++      if (yyn == YYFLAG)
++	goto yyerrpop;
++      yyn = -yyn;
++      goto yyreduce;
++    }
++  else if (yyn == 0)
++    goto yyerrpop;
++
++  if (yyn == YYFINAL)
++    YYACCEPT;
++
++  YYDPRINTF ((stderr, "Shifting error token, "));
++
++  *++yyvsp = yylval;
++#if YYLSP_NEEDED
++  *++yylsp = yylloc;
++#endif
++
++  yystate = yyn;
++  goto yynewstate;
++
++
++/*-------------------------------------.
++| yyacceptlab -- YYACCEPT comes here.  |
++`-------------------------------------*/
++yyacceptlab:
++  yyresult = 0;
++  goto yyreturn;
++
++/*-----------------------------------.
++| yyabortlab -- YYABORT comes here.  |
++`-----------------------------------*/
++yyabortlab:
++  yyresult = 1;
++  goto yyreturn;
++
++/*---------------------------------------------.
++| yyoverflowab -- parser overflow comes here.  |
++`---------------------------------------------*/
++yyoverflowlab:
++  yyerror ("parser stack overflow");
++  yyresult = 2;
++  /* Fall through.  */
++
++yyreturn:
++#ifndef yyoverflow
++  if (yyss != yyssa)
++    YYSTACK_FREE (yyss);
++#endif
++  return yyresult;
++}
++#line 205 "plural.y"
++
++
++void
++internal_function
++FREE_EXPRESSION (struct expression *exp)
++{
++  if (exp == NULL)
++    return;
++
++  /* Handle the recursive case.  */
++  switch (exp->nargs)
++    {
++    case 3:
++      FREE_EXPRESSION (exp->val.args[2]);
++      /* FALLTHROUGH */
++    case 2:
++      FREE_EXPRESSION (exp->val.args[1]);
++      /* FALLTHROUGH */
++    case 1:
++      FREE_EXPRESSION (exp->val.args[0]);
++      /* FALLTHROUGH */
++    default:
++      break;
++    }
++
++  free (exp);
++}
++
++
++static int
++yylex (YYSTYPE *lval, const char **pexp)
++{
++  const char *exp = *pexp;
++  int result;
++
++  while (1)
++    {
++      if (exp[0] == '\0')
++	{
++	  *pexp = exp;
++	  return YYEOF;
++	}
++
++      if (exp[0] != ' ' && exp[0] != '\t')
++	break;
++
++      ++exp;
++    }
++
++  result = *exp++;
++  switch (result)
++    {
++    case '0': case '1': case '2': case '3': case '4':
++    case '5': case '6': case '7': case '8': case '9':
++      {
++	unsigned long int n = result - '0';
++	while (exp[0] >= '0' && exp[0] <= '9')
++	  {
++	    n *= 10;
++	    n += exp[0] - '0';
++	    ++exp;
++	  }
++	lval->num = n;
++	result = NUMBER;
++      }
++      break;
++
++    case '=':
++      if (exp[0] == '=')
++	{
++	  ++exp;
++	  lval->op = equal;
++	  result = EQUOP2;
++	}
++      else
++	result = YYERRCODE;
++      break;
++
++    case '!':
++      if (exp[0] == '=')
++	{
++	  ++exp;
++	  lval->op = not_equal;
++	  result = EQUOP2;
++	}
++      break;
++
++    case '&':
++    case '|':
++      if (exp[0] == result)
++	++exp;
++      else
++	result = YYERRCODE;
++      break;
++
++    case '<':
++      if (exp[0] == '=')
++	{
++	  ++exp;
++	  lval->op = less_or_equal;
++	}
++      else
++	lval->op = less_than;
++      result = CMPOP2;
++      break;
++
++    case '>':
++      if (exp[0] == '=')
++	{
++	  ++exp;
++	  lval->op = greater_or_equal;
++	}
++      else
++	lval->op = greater_than;
++      result = CMPOP2;
++      break;
++
++    case '*':
++      lval->op = mult;
++      result = MULOP2;
++      break;
++
++    case '/':
++      lval->op = divide;
++      result = MULOP2;
++      break;
++
++    case '%':
++      lval->op = module;
++      result = MULOP2;
++      break;
++
++    case '+':
++      lval->op = plus;
++      result = ADDOP2;
++      break;
++
++    case '-':
++      lval->op = minus;
++      result = ADDOP2;
++      break;
++
++    case 'n':
++    case '?':
++    case ':':
++    case '(':
++    case ')':
++      /* Nothing, just return the character.  */
++      break;
++
++    case ';':
++    case '\n':
++    case '\0':
++      /* Be safe and let the user call this function again.  */
++      --exp;
++      result = YYEOF;
++      break;
++
++    default:
++      result = YYERRCODE;
++#if YYDEBUG != 0
++      --exp;
++#endif
++      break;
++    }
++
++  *pexp = exp;
++
++  return result;
++}
++
++
++static void
++yyerror (const char *str)
++{
++  /* Do nothing.  We don't print error messages here.  */
++}
+--- lrzsz-0.12.20.safe/intl/plural-exp.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/plural-exp.c	2004-09-12 14:40:34.578714192 -0400
+@@ -0,0 +1,154 @@
++/* Expression parsing for plural form selection.
++   Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
++   Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <ctype.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include "plural-exp.h"
++
++#if (defined __GNUC__ && !defined __APPLE_CC__) \
++    || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
++
++/* These structs are the constant expression for the germanic plural
++   form determination.  It represents the expression  "n != 1".  */
++static const struct expression plvar =
++{
++  .nargs = 0,
++  .operation = var,
++};
++static const struct expression plone =
++{
++  .nargs = 0,
++  .operation = num,
++  .val =
++  {
++    .num = 1
++  }
++};
++struct expression GERMANIC_PLURAL =
++{
++  .nargs = 2,
++  .operation = not_equal,
++  .val =
++  {
++    .args =
++    {
++      [0] = (struct expression *) &plvar,
++      [1] = (struct expression *) &plone
++    }
++  }
++};
++
++# define INIT_GERMANIC_PLURAL()
++
++#else
++
++/* For compilers without support for ISO C 99 struct/union initializers:
++   Initialization at run-time.  */
++
++static struct expression plvar;
++static struct expression plone;
++struct expression GERMANIC_PLURAL;
++
++static void
++init_germanic_plural ()
++{
++  if (plone.val.num == 0)
++    {
++      plvar.nargs = 0;
++      plvar.operation = var;
++
++      plone.nargs = 0;
++      plone.operation = num;
++      plone.val.num = 1;
++
++      GERMANIC_PLURAL.nargs = 2;
++      GERMANIC_PLURAL.operation = not_equal;
++      GERMANIC_PLURAL.val.args[0] = &plvar;
++      GERMANIC_PLURAL.val.args[1] = &plone;
++    }
++}
++
++# define INIT_GERMANIC_PLURAL() init_germanic_plural ()
++
++#endif
++
++void
++internal_function
++EXTRACT_PLURAL_EXPRESSION (const char *nullentry, struct expression **pluralp,
++			   unsigned long int *npluralsp)
++{
++  if (nullentry != NULL)
++    {
++      const char *plural;
++      const char *nplurals;
++
++      plural = strstr (nullentry, "plural=");
++      nplurals = strstr (nullentry, "nplurals=");
++      if (plural == NULL || nplurals == NULL)
++	goto no_plural;
++      else
++	{
++	  char *endp;
++	  unsigned long int n;
++	  struct parse_args args;
++
++	  /* First get the number.  */
++	  nplurals += 9;
++	  while (*nplurals != '\0' && isspace ((unsigned char) *nplurals))
++	    ++nplurals;
++	  if (!(*nplurals >= '0' && *nplurals <= '9'))
++	    goto no_plural;
++#if defined HAVE_STRTOUL || defined _LIBC
++	  n = strtoul (nplurals, &endp, 10);
++#else
++	  for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++)
++	    n = n * 10 + (*endp - '0');
++#endif
++	  if (nplurals == endp)
++	    goto no_plural;
++	  *npluralsp = n;
++
++	  /* Due to the restrictions bison imposes onto the interface of the
++	     scanner function we have to put the input string and the result
++	     passed up from the parser into the same structure which address
++	     is passed down to the parser.  */
++	  plural += 7;
++	  args.cp = plural;
++	  if (PLURAL_PARSE (&args) != 0)
++	    goto no_plural;
++	  *pluralp = args.res;
++	}
++    }
++  else
++    {
++      /* By default we are using the Germanic form: singular form only
++         for `one', the plural form otherwise.  Yes, this is also what
++         English is using since English is a Germanic language.  */
++    no_plural:
++      INIT_GERMANIC_PLURAL ();
++      *pluralp = &GERMANIC_PLURAL;
++      *npluralsp = 2;
++    }
++}
+--- lrzsz-0.12.20.safe/intl/plural-exp.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/plural-exp.h	2004-09-12 14:40:34.584713280 -0400
+@@ -0,0 +1,118 @@
++/* Expression parsing and evaluation for plural form selection.
++   Copyright (C) 2000-2003 Free Software Foundation, Inc.
++   Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _PLURAL_EXP_H
++#define _PLURAL_EXP_H
++
++#ifndef internal_function
++# define internal_function
++#endif
++
++#ifndef attribute_hidden
++# define attribute_hidden
++#endif
++
++
++/* This is the representation of the expressions to determine the
++   plural form.  */
++struct expression
++{
++  int nargs;			/* Number of arguments.  */
++  enum operator
++  {
++    /* Without arguments:  */
++    var,			/* The variable "n".  */
++    num,			/* Decimal number.  */
++    /* Unary operators:  */
++    lnot,			/* Logical NOT.  */
++    /* Binary operators:  */
++    mult,			/* Multiplication.  */
++    divide,			/* Division.  */
++    module,			/* Modulo operation.  */
++    plus,			/* Addition.  */
++    minus,			/* Subtraction.  */
++    less_than,			/* Comparison.  */
++    greater_than,		/* Comparison.  */
++    less_or_equal,		/* Comparison.  */
++    greater_or_equal,		/* Comparison.  */
++    equal,			/* Comparison for equality.  */
++    not_equal,			/* Comparison for inequality.  */
++    land,			/* Logical AND.  */
++    lor,			/* Logical OR.  */
++    /* Ternary operators:  */
++    qmop			/* Question mark operator.  */
++  } operation;
++  union
++  {
++    unsigned long int num;	/* Number value for `num'.  */
++    struct expression *args[3];	/* Up to three arguments.  */
++  } val;
++};
++
++/* This is the data structure to pass information to the parser and get
++   the result in a thread-safe way.  */
++struct parse_args
++{
++  const char *cp;
++  struct expression *res;
++};
++
++
++/* Names for the libintl functions are a problem.  This source code is used
++   1. in the GNU C Library library,
++   2. in the GNU libintl library,
++   3. in the GNU gettext tools.
++   The function names in each situation must be different, to allow for
++   binary incompatible changes in 'struct expression'.  Furthermore,
++   1. in the GNU C Library library, the names have a __ prefix,
++   2.+3. in the GNU libintl library and in the GNU gettext tools, the names
++         must follow ANSI C and not start with __.
++   So we have to distinguish the three cases.  */
++#ifdef _LIBC
++# define FREE_EXPRESSION __gettext_free_exp
++# define PLURAL_PARSE __gettextparse
++# define GERMANIC_PLURAL __gettext_germanic_plural
++# define EXTRACT_PLURAL_EXPRESSION __gettext_extract_plural
++#elif defined (IN_LIBINTL)
++# define FREE_EXPRESSION libintl_gettext_free_exp
++# define PLURAL_PARSE libintl_gettextparse
++# define GERMANIC_PLURAL libintl_gettext_germanic_plural
++# define EXTRACT_PLURAL_EXPRESSION libintl_gettext_extract_plural
++#else
++# define FREE_EXPRESSION free_plural_expression
++# define PLURAL_PARSE parse_plural_expression
++# define GERMANIC_PLURAL germanic_plural
++# define EXTRACT_PLURAL_EXPRESSION extract_plural_expression
++#endif
++
++extern void FREE_EXPRESSION (struct expression *exp)
++     internal_function;
++extern int PLURAL_PARSE (void *arg);
++extern struct expression GERMANIC_PLURAL attribute_hidden;
++extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry,
++				       struct expression **pluralp,
++				       unsigned long int *npluralsp)
++     internal_function;
++
++#if !defined (_LIBC) && !defined (IN_LIBINTL)
++extern unsigned long int plural_eval (struct expression *pexp,
++				      unsigned long int n);
++#endif
++
++#endif /* _PLURAL_EXP_H */
+--- lrzsz-0.12.20.safe/intl/plural.y	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/plural.y	2004-09-12 14:40:34.589712520 -0400
+@@ -0,0 +1,381 @@
++%{
++/* Expression parsing for plural form selection.
++   Copyright (C) 2000-2001, 2003 Free Software Foundation, Inc.
++   Written by Ulrich Drepper <drepper@cygnus.com>, 2000.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* The bison generated parser uses alloca.  AIX 3 forces us to put this
++   declaration at the beginning of the file.  The declaration in bison's
++   skeleton file comes too late.  This must come before <config.h>
++   because <config.h> may include arbitrary system headers.  */
++#if defined _AIX && !defined __GNUC__
++ #pragma alloca
++#endif
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <stddef.h>
++#include <stdlib.h>
++#include "plural-exp.h"
++
++/* The main function generated by the parser is called __gettextparse,
++   but we want it to be called PLURAL_PARSE.  */
++#ifndef _LIBC
++# define __gettextparse PLURAL_PARSE
++#endif
++
++#define YYLEX_PARAM	&((struct parse_args *) arg)->cp
++#define YYPARSE_PARAM	arg
++%}
++%pure_parser
++%expect 7
++
++%union {
++  unsigned long int num;
++  enum operator op;
++  struct expression *exp;
++}
++
++%{
++/* Prototypes for local functions.  */
++static int yylex (YYSTYPE *lval, const char **pexp);
++static void yyerror (const char *str);
++
++/* Allocation of expressions.  */
++
++static struct expression *
++new_exp (int nargs, enum operator op, struct expression * const *args)
++{
++  int i;
++  struct expression *newp;
++
++  /* If any of the argument could not be malloc'ed, just return NULL.  */
++  for (i = nargs - 1; i >= 0; i--)
++    if (args[i] == NULL)
++      goto fail;
++
++  /* Allocate a new expression.  */
++  newp = (struct expression *) malloc (sizeof (*newp));
++  if (newp != NULL)
++    {
++      newp->nargs = nargs;
++      newp->operation = op;
++      for (i = nargs - 1; i >= 0; i--)
++	newp->val.args[i] = args[i];
++      return newp;
++    }
++
++ fail:
++  for (i = nargs - 1; i >= 0; i--)
++    FREE_EXPRESSION (args[i]);
++
++  return NULL;
++}
++
++static inline struct expression *
++new_exp_0 (enum operator op)
++{
++  return new_exp (0, op, NULL);
++}
++
++static inline struct expression *
++new_exp_1 (enum operator op, struct expression *right)
++{
++  struct expression *args[1];
++
++  args[0] = right;
++  return new_exp (1, op, args);
++}
++
++static struct expression *
++new_exp_2 (enum operator op, struct expression *left, struct expression *right)
++{
++  struct expression *args[2];
++
++  args[0] = left;
++  args[1] = right;
++  return new_exp (2, op, args);
++}
++
++static inline struct expression *
++new_exp_3 (enum operator op, struct expression *bexp,
++	   struct expression *tbranch, struct expression *fbranch)
++{
++  struct expression *args[3];
++
++  args[0] = bexp;
++  args[1] = tbranch;
++  args[2] = fbranch;
++  return new_exp (3, op, args);
++}
++
++%}
++
++/* This declares that all operators have the same associativity and the
++   precedence order as in C.  See [Harbison, Steele: C, A Reference Manual].
++   There is no unary minus and no bitwise operators.
++   Operators with the same syntactic behaviour have been merged into a single
++   token, to save space in the array generated by bison.  */
++%right '?'		/*   ?		*/
++%left '|'		/*   ||		*/
++%left '&'		/*   &&		*/
++%left EQUOP2		/*   == !=	*/
++%left CMPOP2		/*   < > <= >=	*/
++%left ADDOP2		/*   + -	*/
++%left MULOP2		/*   * / %	*/
++%right '!'		/*   !		*/
++
++%token <op> EQUOP2 CMPOP2 ADDOP2 MULOP2
++%token <num> NUMBER
++%type <exp> exp
++
++%%
++
++start:	  exp
++	  {
++	    if ($1 == NULL)
++	      YYABORT;
++	    ((struct parse_args *) arg)->res = $1;
++	  }
++	;
++
++exp:	  exp '?' exp ':' exp
++	  {
++	    $$ = new_exp_3 (qmop, $1, $3, $5);
++	  }
++	| exp '|' exp
++	  {
++	    $$ = new_exp_2 (lor, $1, $3);
++	  }
++	| exp '&' exp
++	  {
++	    $$ = new_exp_2 (land, $1, $3);
++	  }
++	| exp EQUOP2 exp
++	  {
++	    $$ = new_exp_2 ($2, $1, $3);
++	  }
++	| exp CMPOP2 exp
++	  {
++	    $$ = new_exp_2 ($2, $1, $3);
++	  }
++	| exp ADDOP2 exp
++	  {
++	    $$ = new_exp_2 ($2, $1, $3);
++	  }
++	| exp MULOP2 exp
++	  {
++	    $$ = new_exp_2 ($2, $1, $3);
++	  }
++	| '!' exp
++	  {
++	    $$ = new_exp_1 (lnot, $2);
++	  }
++	| 'n'
++	  {
++	    $$ = new_exp_0 (var);
++	  }
++	| NUMBER
++	  {
++	    if (($$ = new_exp_0 (num)) != NULL)
++	      $$->val.num = $1;
++	  }
++	| '(' exp ')'
++	  {
++	    $$ = $2;
++	  }
++	;
++
++%%
++
++void
++internal_function
++FREE_EXPRESSION (struct expression *exp)
++{
++  if (exp == NULL)
++    return;
++
++  /* Handle the recursive case.  */
++  switch (exp->nargs)
++    {
++    case 3:
++      FREE_EXPRESSION (exp->val.args[2]);
++      /* FALLTHROUGH */
++    case 2:
++      FREE_EXPRESSION (exp->val.args[1]);
++      /* FALLTHROUGH */
++    case 1:
++      FREE_EXPRESSION (exp->val.args[0]);
++      /* FALLTHROUGH */
++    default:
++      break;
++    }
++
++  free (exp);
++}
++
++
++static int
++yylex (YYSTYPE *lval, const char **pexp)
++{
++  const char *exp = *pexp;
++  int result;
++
++  while (1)
++    {
++      if (exp[0] == '\0')
++	{
++	  *pexp = exp;
++	  return YYEOF;
++	}
++
++      if (exp[0] != ' ' && exp[0] != '\t')
++	break;
++
++      ++exp;
++    }
++
++  result = *exp++;
++  switch (result)
++    {
++    case '0': case '1': case '2': case '3': case '4':
++    case '5': case '6': case '7': case '8': case '9':
++      {
++	unsigned long int n = result - '0';
++	while (exp[0] >= '0' && exp[0] <= '9')
++	  {
++	    n *= 10;
++	    n += exp[0] - '0';
++	    ++exp;
++	  }
++	lval->num = n;
++	result = NUMBER;
++      }
++      break;
++
++    case '=':
++      if (exp[0] == '=')
++	{
++	  ++exp;
++	  lval->op = equal;
++	  result = EQUOP2;
++	}
++      else
++	result = YYERRCODE;
++      break;
++
++    case '!':
++      if (exp[0] == '=')
++	{
++	  ++exp;
++	  lval->op = not_equal;
++	  result = EQUOP2;
++	}
++      break;
++
++    case '&':
++    case '|':
++      if (exp[0] == result)
++	++exp;
++      else
++	result = YYERRCODE;
++      break;
++
++    case '<':
++      if (exp[0] == '=')
++	{
++	  ++exp;
++	  lval->op = less_or_equal;
++	}
++      else
++	lval->op = less_than;
++      result = CMPOP2;
++      break;
++
++    case '>':
++      if (exp[0] == '=')
++	{
++	  ++exp;
++	  lval->op = greater_or_equal;
++	}
++      else
++	lval->op = greater_than;
++      result = CMPOP2;
++      break;
++
++    case '*':
++      lval->op = mult;
++      result = MULOP2;
++      break;
++
++    case '/':
++      lval->op = divide;
++      result = MULOP2;
++      break;
++
++    case '%':
++      lval->op = module;
++      result = MULOP2;
++      break;
++
++    case '+':
++      lval->op = plus;
++      result = ADDOP2;
++      break;
++
++    case '-':
++      lval->op = minus;
++      result = ADDOP2;
++      break;
++
++    case 'n':
++    case '?':
++    case ':':
++    case '(':
++    case ')':
++      /* Nothing, just return the character.  */
++      break;
++
++    case ';':
++    case '\n':
++    case '\0':
++      /* Be safe and let the user call this function again.  */
++      --exp;
++      result = YYEOF;
++      break;
++
++    default:
++      result = YYERRCODE;
++#if YYDEBUG != 0
++      --exp;
++#endif
++      break;
++    }
++
++  *pexp = exp;
++
++  return result;
++}
++
++
++static void
++yyerror (const char *str)
++{
++  /* Do nothing.  We don't print error messages here.  */
++}
+--- lrzsz-0.12.20.safe/intl/po2tbl.sed.in	1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/po2tbl.sed.in	1969-12-31 19:00:00.000000000 -0500
+@@ -1,102 +0,0 @@
+-# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets
+-# Copyright (C) 1995 Free Software Foundation, Inc.
+-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+-#
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-#
+-1 {
+-  i\
+-/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot.  */\
+-\
+-#if HAVE_CONFIG_H\
+-# include <config.h>\
+-#endif\
+-\
+-#include "libgettext.h"\
+-\
+-const struct _msg_ent _msg_tbl[] = {
+-  h
+-  s/.*/0/
+-  x
+-}
+-#
+-# Write msgid entries in C array form.
+-#
+-/^msgid/ {
+-  s/msgid[ 	]*\(".*"\)/  {\1/
+-  tb
+-# Append the next line
+-  :b
+-  N
+-# Look whether second part is continuation line.
+-  s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
+-# Yes, then branch.
+-  ta
+-# Because we assume that the input file correctly formed the line
+-# just read cannot be again be a msgid line.  So it's safe to ignore
+-# it.
+-  s/\(.*\)\n.*/\1/
+-  bc
+-# We found a continuation line.  But before printing insert '\'.
+-  :a
+-  s/\(.*\)\(\n.*\)/\1\\\2/
+-  P
+-# We cannot use D here.
+-  s/.*\n\(.*\)/\1/
+-# Some buggy seds do not clear the `successful substitution since last ``t'''
+-# flag on `N', so we do a `t' here to clear it.
+-  tb
+-# Not reached
+-  :c
+-  x
+-# The following nice solution is by
+-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+-  td
+-# Increment a decimal number in pattern space.
+-# First hide trailing `9' digits.
+-  :d
+-  s/9\(_*\)$/_\1/
+-  td
+-# Assure at least one digit is available.
+-  s/^\(_*\)$/0\1/
+-# Increment the last digit.
+-  s/8\(_*\)$/9\1/
+-  s/7\(_*\)$/8\1/
+-  s/6\(_*\)$/7\1/
+-  s/5\(_*\)$/6\1/
+-  s/4\(_*\)$/5\1/
+-  s/3\(_*\)$/4\1/
+-  s/2\(_*\)$/3\1/
+-  s/1\(_*\)$/2\1/
+-  s/0\(_*\)$/1\1/
+-# Convert the hidden `9' digits to `0's.
+-  s/_/0/g
+-  x
+-  G
+-  s/\(.*\)\n\([0-9]*\)/\1, \2},/
+-  s/\(.*\)"$/\1/
+-  p
+-}
+-#
+-# Last line.
+-#
+-$ {
+-  i\
+-};\
+-
+-  g
+-  s/0*\(.*\)/int _msg_tbl_length = \1;/p
+-}
+-d
+--- lrzsz-0.12.20.safe/intl/printf-args.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/printf-args.c	2004-09-12 14:40:34.595711608 -0400
+@@ -0,0 +1,119 @@
++/* Decomposed printf argument list.
++   Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++/* Specification.  */
++#include "printf-args.h"
++
++#ifdef STATIC
++STATIC
++#endif
++int
++printf_fetchargs (va_list args, arguments *a)
++{
++  size_t i;
++  argument *ap;
++
++  for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
++    switch (ap->type)
++      {
++      case TYPE_SCHAR:
++	ap->a.a_schar = va_arg (args, /*signed char*/ int);
++	break;
++      case TYPE_UCHAR:
++	ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
++	break;
++      case TYPE_SHORT:
++	ap->a.a_short = va_arg (args, /*short*/ int);
++	break;
++      case TYPE_USHORT:
++	ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
++	break;
++      case TYPE_INT:
++	ap->a.a_int = va_arg (args, int);
++	break;
++      case TYPE_UINT:
++	ap->a.a_uint = va_arg (args, unsigned int);
++	break;
++      case TYPE_LONGINT:
++	ap->a.a_longint = va_arg (args, long int);
++	break;
++      case TYPE_ULONGINT:
++	ap->a.a_ulongint = va_arg (args, unsigned long int);
++	break;
++#ifdef HAVE_LONG_LONG
++      case TYPE_LONGLONGINT:
++	ap->a.a_longlongint = va_arg (args, long long int);
++	break;
++      case TYPE_ULONGLONGINT:
++	ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
++	break;
++#endif
++      case TYPE_DOUBLE:
++	ap->a.a_double = va_arg (args, double);
++	break;
++#ifdef HAVE_LONG_DOUBLE
++      case TYPE_LONGDOUBLE:
++	ap->a.a_longdouble = va_arg (args, long double);
++	break;
++#endif
++      case TYPE_CHAR:
++	ap->a.a_char = va_arg (args, int);
++	break;
++#ifdef HAVE_WINT_T
++      case TYPE_WIDE_CHAR:
++	ap->a.a_wide_char = va_arg (args, wint_t);
++	break;
++#endif
++      case TYPE_STRING:
++	ap->a.a_string = va_arg (args, const char *);
++	break;
++#ifdef HAVE_WCHAR_T
++      case TYPE_WIDE_STRING:
++	ap->a.a_wide_string = va_arg (args, const wchar_t *);
++	break;
++#endif
++      case TYPE_POINTER:
++	ap->a.a_pointer = va_arg (args, void *);
++	break;
++      case TYPE_COUNT_SCHAR_POINTER:
++	ap->a.a_count_schar_pointer = va_arg (args, signed char *);
++	break;
++      case TYPE_COUNT_SHORT_POINTER:
++	ap->a.a_count_short_pointer = va_arg (args, short *);
++	break;
++      case TYPE_COUNT_INT_POINTER:
++	ap->a.a_count_int_pointer = va_arg (args, int *);
++	break;
++      case TYPE_COUNT_LONGINT_POINTER:
++	ap->a.a_count_longint_pointer = va_arg (args, long int *);
++	break;
++#ifdef HAVE_LONG_LONG
++      case TYPE_COUNT_LONGLONGINT_POINTER:
++	ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
++	break;
++#endif
++      default:
++	/* Unknown type.  */
++	return -1;
++      }
++  return 0;
++}
+--- lrzsz-0.12.20.safe/intl/printf-args.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/printf-args.h	2004-09-12 14:40:34.601710696 -0400
+@@ -0,0 +1,137 @@
++/* Decomposed printf argument list.
++   Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _PRINTF_ARGS_H
++#define _PRINTF_ARGS_H
++
++/* Get size_t.  */
++#include <stddef.h>
++
++/* Get wchar_t.  */
++#ifdef HAVE_WCHAR_T
++# include <stddef.h>
++#endif
++
++/* Get wint_t.  */
++#ifdef HAVE_WINT_T
++# include <wchar.h>
++#endif
++
++/* Get va_list.  */
++#include <stdarg.h>
++
++
++/* Argument types */
++typedef enum
++{
++  TYPE_NONE,
++  TYPE_SCHAR,
++  TYPE_UCHAR,
++  TYPE_SHORT,
++  TYPE_USHORT,
++  TYPE_INT,
++  TYPE_UINT,
++  TYPE_LONGINT,
++  TYPE_ULONGINT,
++#ifdef HAVE_LONG_LONG
++  TYPE_LONGLONGINT,
++  TYPE_ULONGLONGINT,
++#endif
++  TYPE_DOUBLE,
++#ifdef HAVE_LONG_DOUBLE
++  TYPE_LONGDOUBLE,
++#endif
++  TYPE_CHAR,
++#ifdef HAVE_WINT_T
++  TYPE_WIDE_CHAR,
++#endif
++  TYPE_STRING,
++#ifdef HAVE_WCHAR_T
++  TYPE_WIDE_STRING,
++#endif
++  TYPE_POINTER,
++  TYPE_COUNT_SCHAR_POINTER,
++  TYPE_COUNT_SHORT_POINTER,
++  TYPE_COUNT_INT_POINTER,
++  TYPE_COUNT_LONGINT_POINTER
++#ifdef HAVE_LONG_LONG
++, TYPE_COUNT_LONGLONGINT_POINTER
++#endif
++} arg_type;
++
++/* Polymorphic argument */
++typedef struct
++{
++  arg_type type;
++  union
++  {
++    signed char			a_schar;
++    unsigned char		a_uchar;
++    short			a_short;
++    unsigned short		a_ushort;
++    int				a_int;
++    unsigned int		a_uint;
++    long int			a_longint;
++    unsigned long int		a_ulongint;
++#ifdef HAVE_LONG_LONG
++    long long int		a_longlongint;
++    unsigned long long int	a_ulonglongint;
++#endif
++    float			a_float;
++    double			a_double;
++#ifdef HAVE_LONG_DOUBLE
++    long double			a_longdouble;
++#endif
++    int				a_char;
++#ifdef HAVE_WINT_T
++    wint_t			a_wide_char;
++#endif
++    const char*			a_string;
++#ifdef HAVE_WCHAR_T
++    const wchar_t*		a_wide_string;
++#endif
++    void*			a_pointer;
++    signed char *		a_count_schar_pointer;
++    short *			a_count_short_pointer;
++    int *			a_count_int_pointer;
++    long int *			a_count_longint_pointer;
++#ifdef HAVE_LONG_LONG
++    long long int *		a_count_longlongint_pointer;
++#endif
++  }
++  a;
++}
++argument;
++
++typedef struct
++{
++  size_t count;
++  argument *arg;
++}
++arguments;
++
++
++/* Fetch the arguments, putting them into a. */
++#ifdef STATIC
++STATIC
++#else
++extern
++#endif
++int printf_fetchargs (va_list args, arguments *a);
++
++#endif /* _PRINTF_ARGS_H */
+--- lrzsz-0.12.20.safe/intl/printf.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/printf.c	2004-09-12 14:40:34.607709784 -0400
+@@ -0,0 +1,371 @@
++/* Formatted output to strings, using POSIX/XSI format strings with positions.
++   Copyright (C) 2003 Free Software Foundation, Inc.
++   Written by Bruno Haible <bruno@clisp.org>, 2003.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#ifdef __GNUC__
++# define alloca __builtin_alloca
++# define HAVE_ALLOCA 1
++#else
++# ifdef _MSC_VER
++#  include <malloc.h>
++#  define alloca _alloca
++# else
++#  if defined HAVE_ALLOCA_H || defined _LIBC
++#   include <alloca.h>
++#  else
++#   ifdef _AIX
++ #pragma alloca
++#   else
++#    ifndef alloca
++char *alloca ();
++#    endif
++#   endif
++#  endif
++# endif
++#endif
++
++#include <stdio.h>
++
++#if !HAVE_POSIX_PRINTF
++
++#include <stdlib.h>
++#include <string.h>
++
++/* When building a DLL, we must export some functions.  Note that because
++   the functions are only defined for binary backward compatibility, we
++   don't need to use __declspec(dllimport) in any case.  */
++#if defined _MSC_VER && BUILDING_DLL
++# define DLL_EXPORTED __declspec(dllexport)
++#else
++# define DLL_EXPORTED
++#endif
++
++#define STATIC static
++
++/* Define auxiliary functions declared in "printf-args.h".  */
++#include "printf-args.c"
++
++/* Define auxiliary functions declared in "printf-parse.h".  */
++#include "printf-parse.c"
++
++/* Define functions declared in "vasnprintf.h".  */
++#define vasnprintf libintl_vasnprintf
++#include "vasnprintf.c"
++#if 0 /* not needed */
++#define asnprintf libintl_asnprintf
++#include "asnprintf.c"
++#endif
++
++DLL_EXPORTED
++int
++libintl_vfprintf (FILE *stream, const char *format, va_list args)
++{
++  if (strchr (format, '$') == NULL)
++    return vfprintf (stream, format, args);
++  else
++    {
++      size_t length;
++      char *result = libintl_vasnprintf (NULL, &length, format, args);
++      int retval = -1;
++      if (result != NULL)
++	{
++	  if (fwrite (result, 1, length, stream) == length)
++	    retval = length;
++	  free (result);
++	}
++      return retval;
++    }
++}
++
++DLL_EXPORTED
++int
++libintl_fprintf (FILE *stream, const char *format, ...)
++{
++  va_list args;
++  int retval;
++
++  va_start (args, format);
++  retval = libintl_vfprintf (stream, format, args);
++  va_end (args);
++  return retval;
++}
++
++DLL_EXPORTED
++int
++libintl_vprintf (const char *format, va_list args)
++{
++  return libintl_vfprintf (stdout, format, args);
++}
++
++DLL_EXPORTED
++int
++libintl_printf (const char *format, ...)
++{
++  va_list args;
++  int retval;
++
++  va_start (args, format);
++  retval = libintl_vprintf (format, args);
++  va_end (args);
++  return retval;
++}
++
++DLL_EXPORTED
++int
++libintl_vsprintf (char *resultbuf, const char *format, va_list args)
++{
++  if (strchr (format, '$') == NULL)
++    return vsprintf (resultbuf, format, args);
++  else
++    {
++      size_t length = (size_t) ~0 / (4 * sizeof (char));
++      char *result = libintl_vasnprintf (resultbuf, &length, format, args);
++      if (result != resultbuf)
++	{
++	  free (result);
++	  return -1;
++	}
++      else
++	return length;
++    }
++}
++
++DLL_EXPORTED
++int
++libintl_sprintf (char *resultbuf, const char *format, ...)
++{
++  va_list args;
++  int retval;
++
++  va_start (args, format);
++  retval = libintl_vsprintf (resultbuf, format, args);
++  va_end (args);
++  return retval;
++}
++
++#if HAVE_SNPRINTF
++
++# if HAVE_DECL__SNPRINTF
++   /* Windows.  */
++#  define system_vsnprintf _vsnprintf
++# else
++   /* Unix.  */
++#  define system_vsnprintf vsnprintf
++# endif
++
++DLL_EXPORTED
++int
++libintl_vsnprintf (char *resultbuf, size_t length, const char *format, va_list args)
++{
++  if (strchr (format, '$') == NULL)
++    return system_vsnprintf (resultbuf, length, format, args);
++  else
++    {
++      size_t maxlength = length;
++      char *result = libintl_vasnprintf (resultbuf, &length, format, args);
++      if (result != resultbuf)
++	{
++	  if (maxlength > 0)
++	    {
++	      if (length < maxlength)
++		abort ();
++	      memcpy (resultbuf, result, maxlength - 1);
++	      resultbuf[maxlength - 1] = '\0';
++	    }
++	  free (result);
++	  return -1;
++	}
++      else
++	return length;
++    }
++}
++
++DLL_EXPORTED
++int
++libintl_snprintf (char *resultbuf, size_t length, const char *format, ...)
++{
++  va_list args;
++  int retval;
++
++  va_start (args, format);
++  retval = libintl_vsnprintf (resultbuf, length, format, args);
++  va_end (args);
++  return retval;
++}
++
++#endif
++
++#if HAVE_ASPRINTF
++
++DLL_EXPORTED
++int
++libintl_vasprintf (char **resultp, const char *format, va_list args)
++{
++  size_t length;
++  char *result = libintl_vasnprintf (NULL, &length, format, args);
++  if (result == NULL)
++    return -1;
++  *resultp = result;
++  return length;
++}
++
++DLL_EXPORTED
++int
++libintl_asprintf (char **resultp, const char *format, ...)
++{
++  va_list args;
++  int retval;
++
++  va_start (args, format);
++  retval = libintl_vasprintf (resultp, format, args);
++  va_end (args);
++  return retval;
++}
++
++#endif
++
++#if HAVE_FWPRINTF
++
++#include <wchar.h>
++
++#define WIDE_CHAR_VERSION 1
++
++/* Define auxiliary functions declared in "wprintf-parse.h".  */
++#include "printf-parse.c"
++
++/* Define functions declared in "vasnprintf.h".  */
++#define vasnwprintf libintl_vasnwprintf
++#include "vasnprintf.c"
++#if 0 /* not needed */
++#define asnwprintf libintl_asnwprintf
++#include "asnprintf.c"
++#endif
++
++# if HAVE_DECL__SNWPRINTF
++   /* Windows.  */
++#  define system_vswprintf _vsnwprintf
++# else
++   /* Unix.  */
++#  define system_vswprintf vswprintf
++# endif
++
++DLL_EXPORTED
++int
++libintl_vfwprintf (FILE *stream, const wchar_t *format, va_list args)
++{
++  if (wcschr (format, '$') == NULL)
++    return vfwprintf (stream, format, args);
++  else
++    {
++      size_t length;
++      wchar_t *result = libintl_vasnwprintf (NULL, &length, format, args);
++      int retval = -1;
++      if (result != NULL)
++	{
++	  size_t i;
++	  for (i = 0; i < length; i++)
++	    if (fputwc (result[i], stream) == WEOF)
++	      break;
++	  if (i == length)
++	    retval = length;
++	  free (result);
++	}
++      return retval;
++    }
++}
++
++DLL_EXPORTED
++int
++libintl_fwprintf (FILE *stream, const wchar_t *format, ...)
++{
++  va_list args;
++  int retval;
++
++  va_start (args, format);
++  retval = libintl_vfwprintf (stream, format, args);
++  va_end (args);
++  return retval;
++}
++
++DLL_EXPORTED
++int
++libintl_vwprintf (const wchar_t *format, va_list args)
++{
++  return libintl_vfwprintf (stdout, format, args);
++}
++
++DLL_EXPORTED
++int
++libintl_wprintf (const wchar_t *format, ...)
++{
++  va_list args;
++  int retval;
++
++  va_start (args, format);
++  retval = libintl_vwprintf (format, args);
++  va_end (args);
++  return retval;
++}
++
++DLL_EXPORTED
++int
++libintl_vswprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, va_list args)
++{
++  if (wcschr (format, '$') == NULL)
++    return system_vswprintf (resultbuf, length, format, args);
++  else
++    {
++      size_t maxlength = length;
++      wchar_t *result = libintl_vasnwprintf (resultbuf, &length, format, args);
++      if (result != resultbuf)
++	{
++	  if (maxlength > 0)
++	    {
++	      if (length < maxlength)
++		abort ();
++	      memcpy (resultbuf, result, (maxlength - 1) * sizeof (wchar_t));
++	      resultbuf[maxlength - 1] = 0;
++	    }
++	  free (result);
++	  return -1;
++	}
++      else
++	return length;
++    }
++}
++
++DLL_EXPORTED
++int
++libintl_swprintf (wchar_t *resultbuf, size_t length, const wchar_t *format, ...)
++{
++  va_list args;
++  int retval;
++
++  va_start (args, format);
++  retval = libintl_vswprintf (resultbuf, length, format, args);
++  va_end (args);
++  return retval;
++}
++
++#endif
++
++#endif
+--- lrzsz-0.12.20.safe/intl/printf-parse.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/printf-parse.c	2004-09-12 14:40:34.622707504 -0400
+@@ -0,0 +1,537 @@
++/* Formatted output to strings.
++   Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++/* Specification.  */
++#if WIDE_CHAR_VERSION
++# include "wprintf-parse.h"
++#else
++# include "printf-parse.h"
++#endif
++
++/* Get size_t, NULL.  */
++#include <stddef.h>
++
++/* Get intmax_t.  */
++#if HAVE_STDINT_H_WITH_UINTMAX
++# include <stdint.h>
++#endif
++#if HAVE_INTTYPES_H_WITH_UINTMAX
++# include <inttypes.h>
++#endif
++
++/* malloc(), realloc(), free().  */
++#include <stdlib.h>
++
++/* Checked size_t computations.  */
++#include "xsize.h"
++
++#if WIDE_CHAR_VERSION
++# define PRINTF_PARSE wprintf_parse
++# define CHAR_T wchar_t
++# define DIRECTIVE wchar_t_directive
++# define DIRECTIVES wchar_t_directives
++#else
++# define PRINTF_PARSE printf_parse
++# define CHAR_T char
++# define DIRECTIVE char_directive
++# define DIRECTIVES char_directives
++#endif
++
++#ifdef STATIC
++STATIC
++#endif
++int
++PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
++{
++  const CHAR_T *cp = format;		/* pointer into format */
++  size_t arg_posn = 0;		/* number of regular arguments consumed */
++  size_t d_allocated;			/* allocated elements of d->dir */
++  size_t a_allocated;			/* allocated elements of a->arg */
++  size_t max_width_length = 0;
++  size_t max_precision_length = 0;
++
++  d->count = 0;
++  d_allocated = 1;
++  d->dir = malloc (d_allocated * sizeof (DIRECTIVE));
++  if (d->dir == NULL)
++    /* Out of memory.  */
++    return -1;
++
++  a->count = 0;
++  a_allocated = 0;
++  a->arg = NULL;
++
++#define REGISTER_ARG(_index_,_type_) \
++  {									\
++    size_t n = (_index_);						\
++    if (n >= a_allocated)						\
++      {									\
++	size_t memory_size;						\
++	argument *memory;						\
++									\
++	a_allocated = xtimes (a_allocated, 2);				\
++	if (a_allocated <= n)						\
++	  a_allocated = xsum (n, 1);					\
++	memory_size = xtimes (a_allocated, sizeof (argument));		\
++	if (size_overflow_p (memory_size))				\
++	  /* Overflow, would lead to out of memory.  */			\
++	  goto error;							\
++	memory = (a->arg						\
++		  ? realloc (a->arg, memory_size)			\
++		  : malloc (memory_size));				\
++	if (memory == NULL)						\
++	  /* Out of memory.  */						\
++	  goto error;							\
++	a->arg = memory;						\
++      }									\
++    while (a->count <= n)						\
++      a->arg[a->count++].type = TYPE_NONE;				\
++    if (a->arg[n].type == TYPE_NONE)					\
++      a->arg[n].type = (_type_);					\
++    else if (a->arg[n].type != (_type_))				\
++      /* Ambiguous type for positional argument.  */			\
++      goto error;							\
++  }
++
++  while (*cp != '\0')
++    {
++      CHAR_T c = *cp++;
++      if (c == '%')
++	{
++	  size_t arg_index = ARG_NONE;
++	  DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */
++
++	  /* Initialize the next directive.  */
++	  dp->dir_start = cp - 1;
++	  dp->flags = 0;
++	  dp->width_start = NULL;
++	  dp->width_end = NULL;
++	  dp->width_arg_index = ARG_NONE;
++	  dp->precision_start = NULL;
++	  dp->precision_end = NULL;
++	  dp->precision_arg_index = ARG_NONE;
++	  dp->arg_index = ARG_NONE;
++
++	  /* Test for positional argument.  */
++	  if (*cp >= '0' && *cp <= '9')
++	    {
++	      const CHAR_T *np;
++
++	      for (np = cp; *np >= '0' && *np <= '9'; np++)
++		;
++	      if (*np == '$')
++		{
++		  size_t n = 0;
++
++		  for (np = cp; *np >= '0' && *np <= '9'; np++)
++		    n = xsum (xtimes (n, 10), *np - '0');
++		  if (n == 0)
++		    /* Positional argument 0.  */
++		    goto error;
++		  if (size_overflow_p (n))
++		    /* n too large, would lead to out of memory later.  */
++		    goto error;
++		  arg_index = n - 1;
++		  cp = np + 1;
++		}
++	    }
++
++	  /* Read the flags.  */
++	  for (;;)
++	    {
++	      if (*cp == '\'')
++		{
++		  dp->flags |= FLAG_GROUP;
++		  cp++;
++		}
++	      else if (*cp == '-')
++		{
++		  dp->flags |= FLAG_LEFT;
++		  cp++;
++		}
++	      else if (*cp == '+')
++		{
++		  dp->flags |= FLAG_SHOWSIGN;
++		  cp++;
++		}
++	      else if (*cp == ' ')
++		{
++		  dp->flags |= FLAG_SPACE;
++		  cp++;
++		}
++	      else if (*cp == '#')
++		{
++		  dp->flags |= FLAG_ALT;
++		  cp++;
++		}
++	      else if (*cp == '0')
++		{
++		  dp->flags |= FLAG_ZERO;
++		  cp++;
++		}
++	      else
++		break;
++	    }
++
++	  /* Parse the field width.  */
++	  if (*cp == '*')
++	    {
++	      dp->width_start = cp;
++	      cp++;
++	      dp->width_end = cp;
++	      if (max_width_length < 1)
++		max_width_length = 1;
++
++	      /* Test for positional argument.  */
++	      if (*cp >= '0' && *cp <= '9')
++		{
++		  const CHAR_T *np;
++
++		  for (np = cp; *np >= '0' && *np <= '9'; np++)
++		    ;
++		  if (*np == '$')
++		    {
++		      size_t n = 0;
++
++		      for (np = cp; *np >= '0' && *np <= '9'; np++)
++			n = xsum (xtimes (n, 10), *np - '0');
++		      if (n == 0)
++			/* Positional argument 0.  */
++			goto error;
++		      if (size_overflow_p (n))
++			/* n too large, would lead to out of memory later.  */
++			goto error;
++		      dp->width_arg_index = n - 1;
++		      cp = np + 1;
++		    }
++		}
++	      if (dp->width_arg_index == ARG_NONE)
++		{
++		  dp->width_arg_index = arg_posn++;
++		  if (dp->width_arg_index == ARG_NONE)
++		    /* arg_posn wrapped around.  */
++		    goto error;
++		}
++	      REGISTER_ARG (dp->width_arg_index, TYPE_INT);
++	    }
++	  else if (*cp >= '0' && *cp <= '9')
++	    {
++	      size_t width_length;
++
++	      dp->width_start = cp;
++	      for (; *cp >= '0' && *cp <= '9'; cp++)
++		;
++	      dp->width_end = cp;
++	      width_length = dp->width_end - dp->width_start;
++	      if (max_width_length < width_length)
++		max_width_length = width_length;
++	    }
++
++	  /* Parse the precision.  */
++	  if (*cp == '.')
++	    {
++	      cp++;
++	      if (*cp == '*')
++		{
++		  dp->precision_start = cp - 1;
++		  cp++;
++		  dp->precision_end = cp;
++		  if (max_precision_length < 2)
++		    max_precision_length = 2;
++
++		  /* Test for positional argument.  */
++		  if (*cp >= '0' && *cp <= '9')
++		    {
++		      const CHAR_T *np;
++
++		      for (np = cp; *np >= '0' && *np <= '9'; np++)
++			;
++		      if (*np == '$')
++			{
++			  size_t n = 0;
++
++			  for (np = cp; *np >= '0' && *np <= '9'; np++)
++			    n = xsum (xtimes (n, 10), *np - '0');
++			  if (n == 0)
++			    /* Positional argument 0.  */
++			    goto error;
++			  if (size_overflow_p (n))
++			    /* n too large, would lead to out of memory
++			       later.  */
++			    goto error;
++			  dp->precision_arg_index = n - 1;
++			  cp = np + 1;
++			}
++		    }
++		  if (dp->precision_arg_index == ARG_NONE)
++		    {
++		      dp->precision_arg_index = arg_posn++;
++		      if (dp->precision_arg_index == ARG_NONE)
++			/* arg_posn wrapped around.  */
++			goto error;
++		    }
++		  REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
++		}
++	      else
++		{
++		  size_t precision_length;
++
++		  dp->precision_start = cp - 1;
++		  for (; *cp >= '0' && *cp <= '9'; cp++)
++		    ;
++		  dp->precision_end = cp;
++		  precision_length = dp->precision_end - dp->precision_start;
++		  if (max_precision_length < precision_length)
++		    max_precision_length = precision_length;
++		}
++	    }
++
++	  {
++	    arg_type type;
++
++	    /* Parse argument type/size specifiers.  */
++	    {
++	      int flags = 0;
++
++	      for (;;)
++		{
++		  if (*cp == 'h')
++		    {
++		      flags |= (1 << (flags & 1));
++		      cp++;
++		    }
++		  else if (*cp == 'L')
++		    {
++		      flags |= 4;
++		      cp++;
++		    }
++		  else if (*cp == 'l')
++		    {
++		      flags += 8;
++		      cp++;
++		    }
++#ifdef HAVE_INTMAX_T
++		  else if (*cp == 'j')
++		    {
++		      if (sizeof (intmax_t) > sizeof (long))
++			{
++			  /* intmax_t = long long */
++			  flags += 16;
++			}
++		      else if (sizeof (intmax_t) > sizeof (int))
++			{
++			  /* intmax_t = long */
++			  flags += 8;
++			}
++		      cp++;
++		    }
++#endif
++		  else if (*cp == 'z' || *cp == 'Z')
++		    {
++		      /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
++			 because the warning facility in gcc-2.95.2 understands
++			 only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784).  */
++		      if (sizeof (size_t) > sizeof (long))
++			{
++			  /* size_t = long long */
++			  flags += 16;
++			}
++		      else if (sizeof (size_t) > sizeof (int))
++			{
++			  /* size_t = long */
++			  flags += 8;
++			}
++		      cp++;
++		    }
++		  else if (*cp == 't')
++		    {
++		      if (sizeof (ptrdiff_t) > sizeof (long))
++			{
++			  /* ptrdiff_t = long long */
++			  flags += 16;
++			}
++		      else if (sizeof (ptrdiff_t) > sizeof (int))
++			{
++			  /* ptrdiff_t = long */
++			  flags += 8;
++			}
++		      cp++;
++		    }
++		  else
++		    break;
++		}
++
++	      /* Read the conversion character.  */
++	      c = *cp++;
++	      switch (c)
++		{
++		case 'd': case 'i':
++#ifdef HAVE_LONG_LONG
++		  if (flags >= 16 || (flags & 4))
++		    type = TYPE_LONGLONGINT;
++		  else
++#endif
++		  if (flags >= 8)
++		    type = TYPE_LONGINT;
++		  else if (flags & 2)
++		    type = TYPE_SCHAR;
++		  else if (flags & 1)
++		    type = TYPE_SHORT;
++		  else
++		    type = TYPE_INT;
++		  break;
++		case 'o': case 'u': case 'x': case 'X':
++#ifdef HAVE_LONG_LONG
++		  if (flags >= 16 || (flags & 4))
++		    type = TYPE_ULONGLONGINT;
++		  else
++#endif
++		  if (flags >= 8)
++		    type = TYPE_ULONGINT;
++		  else if (flags & 2)
++		    type = TYPE_UCHAR;
++		  else if (flags & 1)
++		    type = TYPE_USHORT;
++		  else
++		    type = TYPE_UINT;
++		  break;
++		case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
++		case 'a': case 'A':
++#ifdef HAVE_LONG_DOUBLE
++		  if (flags >= 16 || (flags & 4))
++		    type = TYPE_LONGDOUBLE;
++		  else
++#endif
++		  type = TYPE_DOUBLE;
++		  break;
++		case 'c':
++		  if (flags >= 8)
++#ifdef HAVE_WINT_T
++		    type = TYPE_WIDE_CHAR;
++#else
++		    goto error;
++#endif
++		  else
++		    type = TYPE_CHAR;
++		  break;
++#ifdef HAVE_WINT_T
++		case 'C':
++		  type = TYPE_WIDE_CHAR;
++		  c = 'c';
++		  break;
++#endif
++		case 's':
++		  if (flags >= 8)
++#ifdef HAVE_WCHAR_T
++		    type = TYPE_WIDE_STRING;
++#else
++		    goto error;
++#endif
++		  else
++		    type = TYPE_STRING;
++		  break;
++#ifdef HAVE_WCHAR_T
++		case 'S':
++		  type = TYPE_WIDE_STRING;
++		  c = 's';
++		  break;
++#endif
++		case 'p':
++		  type = TYPE_POINTER;
++		  break;
++		case 'n':
++#ifdef HAVE_LONG_LONG
++		  if (flags >= 16 || (flags & 4))
++		    type = TYPE_COUNT_LONGLONGINT_POINTER;
++		  else
++#endif
++		  if (flags >= 8)
++		    type = TYPE_COUNT_LONGINT_POINTER;
++		  else if (flags & 2)
++		    type = TYPE_COUNT_SCHAR_POINTER;
++		  else if (flags & 1)
++		    type = TYPE_COUNT_SHORT_POINTER;
++		  else
++		    type = TYPE_COUNT_INT_POINTER;
++		  break;
++		case '%':
++		  type = TYPE_NONE;
++		  break;
++		default:
++		  /* Unknown conversion character.  */
++		  goto error;
++		}
++	    }
++
++	    if (type != TYPE_NONE)
++	      {
++		dp->arg_index = arg_index;
++		if (dp->arg_index == ARG_NONE)
++		  {
++		    dp->arg_index = arg_posn++;
++		    if (dp->arg_index == ARG_NONE)
++		      /* arg_posn wrapped around.  */
++		      goto error;
++		  }
++		REGISTER_ARG (dp->arg_index, type);
++	      }
++	    dp->conversion = c;
++	    dp->dir_end = cp;
++	  }
++
++	  d->count++;
++	  if (d->count >= d_allocated)
++	    {
++	      size_t memory_size;
++	      DIRECTIVE *memory;
++
++	      d_allocated = xtimes (d_allocated, 2);
++	      memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
++	      if (size_overflow_p (memory_size))
++		/* Overflow, would lead to out of memory.  */
++		goto error;
++	      memory = realloc (d->dir, memory_size);
++	      if (memory == NULL)
++		/* Out of memory.  */
++		goto error;
++	      d->dir = memory;
++	    }
++	}
++    }
++  d->dir[d->count].dir_start = cp;
++
++  d->max_width_length = max_width_length;
++  d->max_precision_length = max_precision_length;
++  return 0;
++
++error:
++  if (a->arg)
++    free (a->arg);
++  if (d->dir)
++    free (d->dir);
++  return -1;
++}
++
++#undef DIRECTIVES
++#undef DIRECTIVE
++#undef CHAR_T
++#undef PRINTF_PARSE
+--- lrzsz-0.12.20.safe/intl/printf-parse.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/printf-parse.h	2004-09-12 14:40:34.628706592 -0400
+@@ -0,0 +1,75 @@
++/* Parse printf format string.
++   Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _PRINTF_PARSE_H
++#define _PRINTF_PARSE_H
++
++#include "printf-args.h"
++
++
++/* Flags */
++#define FLAG_GROUP	 1	/* ' flag */
++#define FLAG_LEFT	 2	/* - flag */
++#define FLAG_SHOWSIGN	 4	/* + flag */
++#define FLAG_SPACE	 8	/* space flag */
++#define FLAG_ALT	16	/* # flag */
++#define FLAG_ZERO	32
++
++/* arg_index value indicating that no argument is consumed.  */
++#define ARG_NONE	(~(size_t)0)
++
++/* A parsed directive.  */
++typedef struct
++{
++  const char* dir_start;
++  const char* dir_end;
++  int flags;
++  const char* width_start;
++  const char* width_end;
++  size_t width_arg_index;
++  const char* precision_start;
++  const char* precision_end;
++  size_t precision_arg_index;
++  char conversion; /* d i o u x X f e E g G c s p n U % but not C S */
++  size_t arg_index;
++}
++char_directive;
++
++/* A parsed format string.  */
++typedef struct
++{
++  size_t count;
++  char_directive *dir;
++  size_t max_width_length;
++  size_t max_precision_length;
++}
++char_directives;
++
++
++/* Parses the format string.  Fills in the number N of directives, and fills
++   in directives[0], ..., directives[N-1], and sets directives[N].dir_start
++   to the end of the format string.  Also fills in the arg_type fields of the
++   arguments and the needed count of arguments.  */
++#ifdef STATIC
++STATIC
++#else
++extern
++#endif
++int printf_parse (const char *format, char_directives *d, arguments *a);
++
++#endif /* _PRINTF_PARSE_H */
+--- lrzsz-0.12.20.safe/intl/ref-add.sin	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/ref-add.sin	2004-09-12 14:40:34.633705832 -0400
+@@ -0,0 +1,31 @@
++# Add this package to a list of references stored in a text file.
++#
++#   Copyright (C) 2000 Free Software Foundation, Inc.
++#
++#   This program is free software; you can redistribute it and/or modify it
++#   under the terms of the GNU Library General Public License as published
++#   by the Free Software Foundation; either version 2, or (at your option)
++#   any later version.
++#
++#   This program is distributed in the hope that it will be useful,
++#   but WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++#   Library General Public License for more details.
++#
++#   You should have received a copy of the GNU Library General Public
++#   License along with this program; if not, write to the Free Software
++#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++#   USA.
++#
++# Written by Bruno Haible <haible@clisp.cons.org>.
++#
++/^# Packages using this file: / {
++  s/# Packages using this file://
++  ta
++  :a
++  s/ @PACKAGE@ / @PACKAGE@ /
++  tb
++  s/ $/ @PACKAGE@ /
++  :b
++  s/^/# Packages using this file:/
++}
+--- lrzsz-0.12.20.safe/intl/ref-del.sin	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/ref-del.sin	2004-09-12 14:40:34.638705072 -0400
+@@ -0,0 +1,26 @@
++# Remove this package from a list of references stored in a text file.
++#
++#   Copyright (C) 2000 Free Software Foundation, Inc.
++#
++#   This program is free software; you can redistribute it and/or modify it
++#   under the terms of the GNU Library General Public License as published
++#   by the Free Software Foundation; either version 2, or (at your option)
++#   any later version.
++#
++#   This program is distributed in the hope that it will be useful,
++#   but WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++#   Library General Public License for more details.
++#
++#   You should have received a copy of the GNU Library General Public
++#   License along with this program; if not, write to the Free Software
++#   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++#   USA.
++#
++# Written by Bruno Haible <haible@clisp.cons.org>.
++#
++/^# Packages using this file: / {
++  s/# Packages using this file://
++  s/ @PACKAGE@ / /
++  s/^/# Packages using this file:/
++}
+--- lrzsz-0.12.20.safe/intl/relocatable.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/relocatable.c	2004-09-12 14:40:34.644704160 -0400
+@@ -0,0 +1,449 @@
++/* Provide relocatable packages.
++   Copyright (C) 2003 Free Software Foundation, Inc.
++   Written by Bruno Haible <bruno@clisp.org>, 2003.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++
++/* Tell glibc's <stdio.h> to provide a prototype for getline().
++   This must come before <config.h> because <config.h> may include
++   <features.h>, and once <features.h> has been included, it's too late.  */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE	1
++#endif
++
++#ifdef HAVE_CONFIG_H
++# include "config.h"
++#endif
++
++/* Specification.  */
++#include "relocatable.h"
++
++#if ENABLE_RELOCATABLE
++
++#include <stddef.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++
++#ifdef NO_XMALLOC
++# define xmalloc malloc
++#else
++# include "xalloc.h"
++#endif
++
++#if defined _WIN32 || defined __WIN32__
++# define WIN32_LEAN_AND_MEAN
++# include <windows.h>
++#endif
++
++#if DEPENDS_ON_LIBCHARSET
++# include <libcharset.h>
++#endif
++#if DEPENDS_ON_LIBICONV && HAVE_ICONV
++# include <iconv.h>
++#endif
++#if DEPENDS_ON_LIBINTL && ENABLE_NLS
++# include <libintl.h>
++#endif
++
++/* Faked cheap 'bool'.  */
++#undef bool
++#undef false
++#undef true
++#define bool int
++#define false 0
++#define true 1
++
++/* Pathname support.
++   ISSLASH(C)           tests whether C is a directory separator character.
++   IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
++ */
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++  /* Win32, OS/2, DOS */
++# define ISSLASH(C) ((C) == '/' || (C) == '\\')
++# define HAS_DEVICE(P) \
++    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
++     && (P)[1] == ':')
++# define IS_PATH_WITH_DIR(P) \
++    (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
++# define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
++#else
++  /* Unix */
++# define ISSLASH(C) ((C) == '/')
++# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
++# define FILESYSTEM_PREFIX_LEN(P) 0
++#endif
++
++/* Original installation prefix.  */
++static char *orig_prefix;
++static size_t orig_prefix_len;
++/* Current installation prefix.  */
++static char *curr_prefix;
++static size_t curr_prefix_len;
++/* These prefixes do not end in a slash.  Anything that will be concatenated
++   to them must start with a slash.  */
++
++/* Sets the original and the current installation prefix of this module.
++   Relocation simply replaces a pathname starting with the original prefix
++   by the corresponding pathname with the current prefix instead.  Both
++   prefixes should be directory names without trailing slash (i.e. use ""
++   instead of "/").  */
++static void
++set_this_relocation_prefix (const char *orig_prefix_arg,
++			    const char *curr_prefix_arg)
++{
++  if (orig_prefix_arg != NULL && curr_prefix_arg != NULL
++      /* Optimization: if orig_prefix and curr_prefix are equal, the
++	 relocation is a nop.  */
++      && strcmp (orig_prefix_arg, curr_prefix_arg) != 0)
++    {
++      /* Duplicate the argument strings.  */
++      char *memory;
++
++      orig_prefix_len = strlen (orig_prefix_arg);
++      curr_prefix_len = strlen (curr_prefix_arg);
++      memory = (char *) xmalloc (orig_prefix_len + 1 + curr_prefix_len + 1);
++#ifdef NO_XMALLOC
++      if (memory != NULL)
++#endif
++	{
++	  memcpy (memory, orig_prefix_arg, orig_prefix_len + 1);
++	  orig_prefix = memory;
++	  memory += orig_prefix_len + 1;
++	  memcpy (memory, curr_prefix_arg, curr_prefix_len + 1);
++	  curr_prefix = memory;
++	  return;
++	}
++    }
++  orig_prefix = NULL;
++  curr_prefix = NULL;
++  /* Don't worry about wasted memory here - this function is usually only
++     called once.  */
++}
++
++/* Sets the original and the current installation prefix of the package.
++   Relocation simply replaces a pathname starting with the original prefix
++   by the corresponding pathname with the current prefix instead.  Both
++   prefixes should be directory names without trailing slash (i.e. use ""
++   instead of "/").  */
++void
++set_relocation_prefix (const char *orig_prefix_arg, const char *curr_prefix_arg)
++{
++  set_this_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
++
++  /* Now notify all dependent libraries.  */
++#if DEPENDS_ON_LIBCHARSET
++  libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
++#endif
++#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109
++  libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
++#endif
++#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix
++  libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
++#endif
++}
++
++#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
++
++/* Convenience function:
++   Computes the current installation prefix, based on the original
++   installation prefix, the original installation directory of a particular
++   file, and the current pathname of this file.  Returns NULL upon failure.  */
++#ifdef IN_LIBRARY
++#define compute_curr_prefix local_compute_curr_prefix
++static
++#endif
++const char *
++compute_curr_prefix (const char *orig_installprefix,
++		     const char *orig_installdir,
++		     const char *curr_pathname)
++{
++  const char *curr_installdir;
++  const char *rel_installdir;
++
++  if (curr_pathname == NULL)
++    return NULL;
++
++  /* Determine the relative installation directory, relative to the prefix.
++     This is simply the difference between orig_installprefix and
++     orig_installdir.  */
++  if (strncmp (orig_installprefix, orig_installdir, strlen (orig_installprefix))
++      != 0)
++    /* Shouldn't happen - nothing should be installed outside $(prefix).  */
++    return NULL;
++  rel_installdir = orig_installdir + strlen (orig_installprefix);
++
++  /* Determine the current installation directory.  */
++  {
++    const char *p_base = curr_pathname + FILESYSTEM_PREFIX_LEN (curr_pathname);
++    const char *p = curr_pathname + strlen (curr_pathname);
++    char *q;
++
++    while (p > p_base)
++      {
++	p--;
++	if (ISSLASH (*p))
++	  break;
++      }
++
++    q = (char *) xmalloc (p - curr_pathname + 1);
++#ifdef NO_XMALLOC
++    if (q == NULL)
++      return NULL;
++#endif
++    memcpy (q, curr_pathname, p - curr_pathname);
++    q[p - curr_pathname] = '\0';
++    curr_installdir = q;
++  }
++
++  /* Compute the current installation prefix by removing the trailing
++     rel_installdir from it.  */
++  {
++    const char *rp = rel_installdir + strlen (rel_installdir);
++    const char *cp = curr_installdir + strlen (curr_installdir);
++    const char *cp_base =
++      curr_installdir + FILESYSTEM_PREFIX_LEN (curr_installdir);
++
++    while (rp > rel_installdir && cp > cp_base)
++      {
++	bool same = false;
++	const char *rpi = rp;
++	const char *cpi = cp;
++
++	while (rpi > rel_installdir && cpi > cp_base)
++	  {
++	    rpi--;
++	    cpi--;
++	    if (ISSLASH (*rpi) || ISSLASH (*cpi))
++	      {
++		if (ISSLASH (*rpi) && ISSLASH (*cpi))
++		  same = true;
++		break;
++	      }
++#if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__
++	    /* Win32, OS/2, DOS - case insignificant filesystem */
++	    if ((*rpi >= 'a' && *rpi <= 'z' ? *rpi - 'a' + 'A' : *rpi)
++		!= (*cpi >= 'a' && *cpi <= 'z' ? *cpi - 'a' + 'A' : *cpi))
++	      break;
++#else
++	    if (*rpi != *cpi)
++	      break;
++#endif
++	  }
++	if (!same)
++	  break;
++	/* The last pathname component was the same.  opi and cpi now point
++	   to the slash before it.  */
++	rp = rpi;
++	cp = cpi;
++      }
++
++    if (rp > rel_installdir)
++      /* Unexpected: The curr_installdir does not end with rel_installdir.  */
++      return NULL;
++
++    {
++      size_t curr_prefix_len = cp - curr_installdir;
++      char *curr_prefix;
++
++      curr_prefix = (char *) xmalloc (curr_prefix_len + 1);
++#ifdef NO_XMALLOC
++      if (curr_prefix == NULL)
++	return NULL;
++#endif
++      memcpy (curr_prefix, curr_installdir, curr_prefix_len);
++      curr_prefix[curr_prefix_len] = '\0';
++
++      return curr_prefix;
++    }
++  }
++}
++
++#endif /* !IN_LIBRARY || PIC */
++
++#if defined PIC && defined INSTALLDIR
++
++/* Full pathname of shared library, or NULL.  */
++static char *shared_library_fullname;
++
++#if defined _WIN32 || defined __WIN32__
++
++/* Determine the full pathname of the shared library when it is loaded.  */
++
++BOOL WINAPI
++DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
++{
++  (void) reserved;
++
++  if (event == DLL_PROCESS_ATTACH)
++    {
++      /* The DLL is being loaded into an application's address range.  */
++      static char location[MAX_PATH];
++
++      if (!GetModuleFileName (module_handle, location, sizeof (location)))
++	/* Shouldn't happen.  */
++	return FALSE;
++
++      if (!IS_PATH_WITH_DIR (location))
++	/* Shouldn't happen.  */
++	return FALSE;
++
++      shared_library_fullname = strdup (location);
++    }
++
++  return TRUE;
++}
++
++#else /* Unix */
++
++static void
++find_shared_library_fullname ()
++{
++#if defined __linux__ && __GLIBC__ >= 2
++  /* Linux has /proc/self/maps. glibc 2 has the getline() function.  */
++  FILE *fp;
++
++  /* Open the current process' maps file.  It describes one VMA per line.  */
++  fp = fopen ("/proc/self/maps", "r");
++  if (fp)
++    {
++      unsigned long address = (unsigned long) &find_shared_library_fullname;
++      for (;;)
++	{
++	  unsigned long start, end;
++	  int c;
++
++	  if (fscanf (fp, "%lx-%lx", &start, &end) != 2)
++	    break;
++	  if (address >= start && address <= end - 1)
++	    {
++	      /* Found it.  Now see if this line contains a filename.  */
++	      while (c = getc (fp), c != EOF && c != '\n' && c != '/')
++		continue;
++	      if (c == '/')
++		{
++		  size_t size;
++		  int len;
++
++		  ungetc (c, fp);
++		  shared_library_fullname = NULL; size = 0;
++		  len = getline (&shared_library_fullname, &size, fp);
++		  if (len >= 0)
++		    {
++		      /* Success: filled shared_library_fullname.  */
++		      if (len > 0 && shared_library_fullname[len - 1] == '\n')
++			shared_library_fullname[len - 1] = '\0';
++		    }
++		}
++	      break;
++	    }
++	  while (c = getc (fp), c != EOF && c != '\n')
++	    continue;
++	}
++      fclose (fp);
++    }
++#endif
++}
++
++#endif /* WIN32 / Unix */
++
++/* Return the full pathname of the current shared library.
++   Return NULL if unknown.
++   Guaranteed to work only on Linux and Woe32.  */
++static char *
++get_shared_library_fullname ()
++{
++#if !(defined _WIN32 || defined __WIN32__)
++  static bool tried_find_shared_library_fullname;
++  if (!tried_find_shared_library_fullname)
++    {
++      find_shared_library_fullname ();
++      tried_find_shared_library_fullname = true;
++    }
++#endif
++  return shared_library_fullname;
++}
++
++#endif /* PIC */
++
++/* Returns the pathname, relocated according to the current installation
++   directory.  */
++const char *
++relocate (const char *pathname)
++{
++#if defined PIC && defined INSTALLDIR
++  static int initialized;
++
++  /* Initialization code for a shared library.  */
++  if (!initialized)
++    {
++      /* At this point, orig_prefix and curr_prefix likely have already been
++	 set through the main program's set_program_name_and_installdir
++	 function.  This is sufficient in the case that the library has
++	 initially been installed in the same orig_prefix.  But we can do
++	 better, to also cover the cases that 1. it has been installed
++	 in a different prefix before being moved to orig_prefix and (later)
++	 to curr_prefix, 2. unlike the program, it has not moved away from
++	 orig_prefix.  */
++      const char *orig_installprefix = INSTALLPREFIX;
++      const char *orig_installdir = INSTALLDIR;
++      const char *curr_prefix_better;
++
++      curr_prefix_better =
++	compute_curr_prefix (orig_installprefix, orig_installdir,
++			     get_shared_library_fullname ());
++      if (curr_prefix_better == NULL)
++	curr_prefix_better = curr_prefix;
++
++      set_relocation_prefix (orig_installprefix, curr_prefix_better);
++
++      initialized = 1;
++    }
++#endif
++
++  /* Note: It is not necessary to perform case insensitive comparison here,
++     even for DOS-like filesystems, because the pathname argument was
++     typically created from the same Makefile variable as orig_prefix came
++     from.  */
++  if (orig_prefix != NULL && curr_prefix != NULL
++      && strncmp (pathname, orig_prefix, orig_prefix_len) == 0)
++    {
++      if (pathname[orig_prefix_len] == '\0')
++	/* pathname equals orig_prefix.  */
++	return curr_prefix;
++      if (ISSLASH (pathname[orig_prefix_len]))
++	{
++	  /* pathname starts with orig_prefix.  */
++	  const char *pathname_tail = &pathname[orig_prefix_len];
++	  char *result =
++	    (char *) xmalloc (curr_prefix_len + strlen (pathname_tail) + 1);
++
++#ifdef NO_XMALLOC
++	  if (result != NULL)
++#endif
++	    {
++	      memcpy (result, curr_prefix, curr_prefix_len);
++	      strcpy (result + curr_prefix_len, pathname_tail);
++	      return result;
++	    }
++	}
++    }
++  /* Nothing to relocate.  */
++  return pathname;
++}
++
++#endif
+--- lrzsz-0.12.20.safe/intl/relocatable.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/relocatable.h	2004-09-12 14:40:34.651703096 -0400
+@@ -0,0 +1,77 @@
++/* Provide relocatable packages.
++   Copyright (C) 2003 Free Software Foundation, Inc.
++   Written by Bruno Haible <bruno@clisp.org>, 2003.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _RELOCATABLE_H
++#define _RELOCATABLE_H
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++
++
++/* This can be enabled through the configure --enable-relocatable option.  */
++#if ENABLE_RELOCATABLE
++
++/* When building a DLL, we must export some functions.  Note that because
++   this is a private .h file, we don't need to use __declspec(dllimport)
++   in any case.  */
++#if defined _MSC_VER && BUILDING_DLL
++# define RELOCATABLE_DLL_EXPORTED __declspec(dllexport)
++#else
++# define RELOCATABLE_DLL_EXPORTED
++#endif
++
++/* Sets the original and the current installation prefix of the package.
++   Relocation simply replaces a pathname starting with the original prefix
++   by the corresponding pathname with the current prefix instead.  Both
++   prefixes should be directory names without trailing slash (i.e. use ""
++   instead of "/").  */
++extern RELOCATABLE_DLL_EXPORTED void
++       set_relocation_prefix (const char *orig_prefix,
++			      const char *curr_prefix);
++
++/* Returns the pathname, relocated according to the current installation
++   directory.  */
++extern const char * relocate (const char *pathname);
++
++/* Memory management: relocate() leaks memory, because it has to construct
++   a fresh pathname.  If this is a problem because your program calls
++   relocate() frequently, think about caching the result.  */
++
++/* Convenience function:
++   Computes the current installation prefix, based on the original
++   installation prefix, the original installation directory of a particular
++   file, and the current pathname of this file.  Returns NULL upon failure.  */
++extern const char * compute_curr_prefix (const char *orig_installprefix,
++					 const char *orig_installdir,
++					 const char *curr_pathname);
++
++#else
++
++/* By default, we use the hardwired pathnames.  */
++#define relocate(pathname) (pathname)
++
++#endif
++
++
++#ifdef __cplusplus
++}
++#endif
++
++#endif /* _RELOCATABLE_H */
+--- lrzsz-0.12.20.safe/intl/textdomain.c	1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/textdomain.c	2004-09-12 14:40:34.656702336 -0400
+@@ -1,51 +1,60 @@
+-/* Implementation of the textdomain(3) function
+-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+-   Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
++/* Implementation of the textdomain(3) function.
++   Copyright (C) 1995-1998, 2000-2003 Free Software Foundation, Inc.
+ 
+-   This program is free software; you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 2, or (at your option)
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
+    any later version.
+ 
+    This program is distributed in the hope that 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.
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
+ 
+-   You should have received a copy of the GNU General Public License
+-   along with this program; if not, write to the Free Software Foundation,
+-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
+ 
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
+ 
+-#if defined STDC_HEADERS || defined _LIBC
+-# include <stdlib.h>
+-#endif
++#include <stdlib.h>
++#include <string.h>
+ 
+-#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC
+-# include <string.h>
++#ifdef _LIBC
++# include <libintl.h>
+ #else
+-# include <strings.h>
+-# ifndef memcpy
+-#  define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+-# endif
++# include "libgnuintl.h"
+ #endif
++#include "gettextP.h"
+ 
+ #ifdef _LIBC
+-# include <libintl.h>
++/* We have to handle multi-threaded applications.  */
++# include <bits/libc-lock.h>
+ #else
+-# include "libgettext.h"
++/* Provide dummy implementation if this is outside glibc.  */
++# define __libc_rwlock_define(CLASS, NAME)
++# define __libc_rwlock_wrlock(NAME)
++# define __libc_rwlock_unlock(NAME)
++#endif
++
++/* The internal variables in the standalone libintl.a must have different
++   names than the internal variables in GNU libc, otherwise programs
++   using libintl.a cannot be linked statically.  */
++#if !defined _LIBC
++# define _nl_default_default_domain libintl_nl_default_default_domain
++# define _nl_current_default_domain libintl_nl_current_default_domain
+ #endif
+ 
+ /* @@ end of prolog @@ */
+ 
+ /* Name of the default text domain.  */
+-extern const char _nl_default_default_domain[];
++extern const char _nl_default_default_domain[] attribute_hidden;
+ 
+ /* Default text domain in which entries for gettext(3) are to be found.  */
+-extern const char *_nl_current_default_domain;
++extern const char *_nl_current_default_domain attribute_hidden;
+ 
+ 
+ /* Names for the libintl functions are a problem.  They must not clash
+@@ -54,50 +63,76 @@
+    prefix.  So we have to make a difference here.  */
+ #ifdef _LIBC
+ # define TEXTDOMAIN __textdomain
+-# define strdup(str) __strdup (str)
++# ifndef strdup
++#  define strdup(str) __strdup (str)
++# endif
+ #else
+-# define TEXTDOMAIN textdomain__
++# define TEXTDOMAIN libintl_textdomain
+ #endif
+ 
++/* Lock variable to protect the global data in the gettext implementation.  */
++__libc_rwlock_define (extern, _nl_state_lock attribute_hidden)
++
+ /* Set the current default message catalog to DOMAINNAME.
+    If DOMAINNAME is null, return the current default.
+    If DOMAINNAME is "", reset to the default of "messages".  */
+ char *
+-TEXTDOMAIN (domainname)
+-     const char *domainname;
++TEXTDOMAIN (const char *domainname)
+ {
+-  char *old;
++  char *new_domain;
++  char *old_domain;
+ 
+   /* A NULL pointer requests the current setting.  */
+   if (domainname == NULL)
+     return (char *) _nl_current_default_domain;
+ 
+-  old = (char *) _nl_current_default_domain;
++  __libc_rwlock_wrlock (_nl_state_lock);
++
++  old_domain = (char *) _nl_current_default_domain;
+ 
+   /* If domain name is the null string set to default domain "messages".  */
+   if (domainname[0] == '\0'
+       || strcmp (domainname, _nl_default_default_domain) == 0)
+-    _nl_current_default_domain = _nl_default_default_domain;
++    {
++      _nl_current_default_domain = _nl_default_default_domain;
++      new_domain = (char *) _nl_current_default_domain;
++    }
++  else if (strcmp (domainname, old_domain) == 0)
++    /* This can happen and people will use it to signal that some
++       environment variable changed.  */
++    new_domain = old_domain;
+   else
+     {
+       /* If the following malloc fails `_nl_current_default_domain'
+ 	 will be NULL.  This value will be returned and so signals we
+ 	 are out of core.  */
+ #if defined _LIBC || defined HAVE_STRDUP
+-      _nl_current_default_domain = strdup (domainname);
++      new_domain = strdup (domainname);
+ #else
+       size_t len = strlen (domainname) + 1;
+-      char *cp = (char *) malloc (len);
+-      if (cp != NULL)
+-	memcpy (cp, domainname, len);
+-      _nl_current_default_domain = cp;
++      new_domain = (char *) malloc (len);
++      if (new_domain != NULL)
++	memcpy (new_domain, domainname, len);
+ #endif
++
++      if (new_domain != NULL)
++	_nl_current_default_domain = new_domain;
+     }
+ 
+-  if (old != _nl_default_default_domain)
+-    free (old);
++  /* We use this possibility to signal a change of the loaded catalogs
++     since this is most likely the case and there is no other easy we
++     to do it.  Do it only when the call was successful.  */
++  if (new_domain != NULL)
++    {
++      ++_nl_msg_cat_cntr;
+ 
+-  return (char *) _nl_current_default_domain;
++      if (old_domain != new_domain && old_domain != _nl_default_default_domain)
++	free (old_domain);
++    }
++
++  __libc_rwlock_unlock (_nl_state_lock);
++
++  return new_domain;
+ }
+ 
+ #ifdef _LIBC
+--- lrzsz-0.12.20.safe/intl/vasnprintf.c	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/vasnprintf.c	2004-09-12 14:40:34.662701424 -0400
+@@ -0,0 +1,887 @@
++/* vsprintf with automatic memory allocation.
++   Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
++   This must come before <config.h> because <config.h> may include
++   <features.h>, and once <features.h> has been included, it's too late.  */
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE    1
++#endif
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++#ifndef IN_LIBINTL
++# include <alloca.h>
++#endif
++
++/* Specification.  */
++#if WIDE_CHAR_VERSION
++# include "vasnwprintf.h"
++#else
++# include "vasnprintf.h"
++#endif
++
++#include <stdio.h>	/* snprintf(), sprintf() */
++#include <stdlib.h>	/* abort(), malloc(), realloc(), free() */
++#include <string.h>	/* memcpy(), strlen() */
++#include <errno.h>	/* errno */
++#include <limits.h>	/* CHAR_BIT */
++#include <float.h>	/* DBL_MAX_EXP, LDBL_MAX_EXP */
++#if WIDE_CHAR_VERSION
++# include "wprintf-parse.h"
++#else
++# include "printf-parse.h"
++#endif
++
++/* Checked size_t computations.  */
++#include "xsize.h"
++
++#ifdef HAVE_WCHAR_T
++# ifdef HAVE_WCSLEN
++#  define local_wcslen wcslen
++# else
++   /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
++      a dependency towards this library, here is a local substitute.
++      Define this substitute only once, even if this file is included
++      twice in the same compilation unit.  */
++#  ifndef local_wcslen_defined
++#   define local_wcslen_defined 1
++static size_t
++local_wcslen (const wchar_t *s)
++{
++  const wchar_t *ptr;
++
++  for (ptr = s; *ptr != (wchar_t) 0; ptr++)
++    ;
++  return ptr - s;
++}
++#  endif
++# endif
++#endif
++
++#if WIDE_CHAR_VERSION
++# define VASNPRINTF vasnwprintf
++# define CHAR_T wchar_t
++# define DIRECTIVE wchar_t_directive
++# define DIRECTIVES wchar_t_directives
++# define PRINTF_PARSE wprintf_parse
++# define USE_SNPRINTF 1
++# if HAVE_DECL__SNWPRINTF
++   /* On Windows, the function swprintf() has a different signature than
++      on Unix; we use the _snwprintf() function instead.  */
++#  define SNPRINTF _snwprintf
++# else
++   /* Unix.  */
++#  define SNPRINTF swprintf
++# endif
++#else
++# define VASNPRINTF vasnprintf
++# define CHAR_T char
++# define DIRECTIVE char_directive
++# define DIRECTIVES char_directives
++# define PRINTF_PARSE printf_parse
++# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
++# if HAVE_DECL__SNPRINTF
++   /* Windows.  */
++#  define SNPRINTF _snprintf
++# else
++   /* Unix.  */
++#  define SNPRINTF snprintf
++# endif
++#endif
++
++CHAR_T *
++VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args)
++{
++  DIRECTIVES d;
++  arguments a;
++
++  if (PRINTF_PARSE (format, &d, &a) < 0)
++    {
++      errno = EINVAL;
++      return NULL;
++    }
++
++#define CLEANUP() \
++  free (d.dir);								\
++  if (a.arg)								\
++    free (a.arg);
++
++  if (printf_fetchargs (args, &a) < 0)
++    {
++      CLEANUP ();
++      errno = EINVAL;
++      return NULL;
++    }
++
++  {
++    size_t buf_neededlength;
++    CHAR_T *buf;
++    CHAR_T *buf_malloced;
++    const CHAR_T *cp;
++    size_t i;
++    DIRECTIVE *dp;
++    /* Output string accumulator.  */
++    CHAR_T *result;
++    size_t allocated;
++    size_t length;
++
++    /* Allocate a small buffer that will hold a directive passed to
++       sprintf or snprintf.  */
++    buf_neededlength =
++      xsum4 (7, d.max_width_length, d.max_precision_length, 6);
++#if HAVE_ALLOCA
++    if (buf_neededlength < 4000 / sizeof (CHAR_T))
++      {
++	buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T));
++	buf_malloced = NULL;
++      }
++    else
++#endif
++      {
++	size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T));
++	if (size_overflow_p (buf_memsize))
++	  goto out_of_memory_1;
++	buf = (CHAR_T *) malloc (buf_memsize);
++	if (buf == NULL)
++	  goto out_of_memory_1;
++	buf_malloced = buf;
++      }
++
++    if (resultbuf != NULL)
++      {
++	result = resultbuf;
++	allocated = *lengthp;
++      }
++    else
++      {
++	result = NULL;
++	allocated = 0;
++      }
++    length = 0;
++    /* Invariants:
++       result is either == resultbuf or == NULL or malloc-allocated.
++       If length > 0, then result != NULL.  */
++
++    /* Ensures that allocated >= needed.  Aborts through a jump to
++       out_of_memory if needed is SIZE_MAX or otherwise too big.  */
++#define ENSURE_ALLOCATION(needed) \
++    if ((needed) > allocated)						     \
++      {									     \
++	size_t memory_size;						     \
++	CHAR_T *memory;							     \
++									     \
++	allocated = (allocated > 0 ? xtimes (allocated, 2) : 12);	     \
++	if ((needed) > allocated)					     \
++	  allocated = (needed);						     \
++	memory_size = xtimes (allocated, sizeof (CHAR_T));		     \
++	if (size_overflow_p (memory_size))				     \
++	  goto out_of_memory;						     \
++	if (result == resultbuf || result == NULL)			     \
++	  memory = (CHAR_T *) malloc (memory_size);			     \
++	else								     \
++	  memory = (CHAR_T *) realloc (result, memory_size);		     \
++	if (memory == NULL)						     \
++	  goto out_of_memory;						     \
++	if (result == resultbuf && length > 0)				     \
++	  memcpy (memory, result, length * sizeof (CHAR_T));		     \
++	result = memory;						     \
++      }
++
++    for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
++      {
++	if (cp != dp->dir_start)
++	  {
++	    size_t n = dp->dir_start - cp;
++	    size_t augmented_length = xsum (length, n);
++
++	    ENSURE_ALLOCATION (augmented_length);
++	    memcpy (result + length, cp, n * sizeof (CHAR_T));
++	    length = augmented_length;
++	  }
++	if (i == d.count)
++	  break;
++
++	/* Execute a single directive.  */
++	if (dp->conversion == '%')
++	  {
++	    size_t augmented_length;
++
++	    if (!(dp->arg_index == ARG_NONE))
++	      abort ();
++	    augmented_length = xsum (length, 1);
++	    ENSURE_ALLOCATION (augmented_length);
++	    result[length] = '%';
++	    length = augmented_length;
++	  }
++	else
++	  {
++	    if (!(dp->arg_index != ARG_NONE))
++	      abort ();
++
++	    if (dp->conversion == 'n')
++	      {
++		switch (a.arg[dp->arg_index].type)
++		  {
++		  case TYPE_COUNT_SCHAR_POINTER:
++		    *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
++		    break;
++		  case TYPE_COUNT_SHORT_POINTER:
++		    *a.arg[dp->arg_index].a.a_count_short_pointer = length;
++		    break;
++		  case TYPE_COUNT_INT_POINTER:
++		    *a.arg[dp->arg_index].a.a_count_int_pointer = length;
++		    break;
++		  case TYPE_COUNT_LONGINT_POINTER:
++		    *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
++		    break;
++#ifdef HAVE_LONG_LONG
++		  case TYPE_COUNT_LONGLONGINT_POINTER:
++		    *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
++		    break;
++#endif
++		  default:
++		    abort ();
++		  }
++	      }
++	    else
++	      {
++		arg_type type = a.arg[dp->arg_index].type;
++		CHAR_T *p;
++		unsigned int prefix_count;
++		int prefixes[2];
++#if !USE_SNPRINTF
++		size_t tmp_length;
++		CHAR_T tmpbuf[700];
++		CHAR_T *tmp;
++
++		/* Allocate a temporary buffer of sufficient size for calling
++		   sprintf.  */
++		{
++		  size_t width;
++		  size_t precision;
++
++		  width = 0;
++		  if (dp->width_start != dp->width_end)
++		    {
++		      if (dp->width_arg_index != ARG_NONE)
++			{
++			  int arg;
++
++			  if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
++			    abort ();
++			  arg = a.arg[dp->width_arg_index].a.a_int;
++			  width = (arg < 0 ? (unsigned int) (-arg) : arg);
++			}
++		      else
++			{
++			  const CHAR_T *digitp = dp->width_start;
++
++			  do
++			    width = xsum (xtimes (width, 10), *digitp++ - '0');
++			  while (digitp != dp->width_end);
++			}
++		    }
++
++		  precision = 6;
++		  if (dp->precision_start != dp->precision_end)
++		    {
++		      if (dp->precision_arg_index != ARG_NONE)
++			{
++			  int arg;
++
++			  if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
++			    abort ();
++			  arg = a.arg[dp->precision_arg_index].a.a_int;
++			  precision = (arg < 0 ? 0 : arg);
++			}
++		      else
++			{
++			  const CHAR_T *digitp = dp->precision_start + 1;
++
++			  precision = 0;
++			  do
++			    precision = xsum (xtimes (precision, 10), *digitp++ - '0');
++			  while (digitp != dp->precision_end);
++			}
++		    }
++
++		  switch (dp->conversion)
++		    {
++
++		    case 'd': case 'i': case 'u':
++# ifdef HAVE_LONG_LONG
++		      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
++			tmp_length =
++			  (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
++					  * 0.30103 /* binary -> decimal */
++					  * 2 /* estimate for FLAG_GROUP */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 1; /* account for leading sign */
++		      else
++# endif
++		      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
++			tmp_length =
++			  (unsigned int) (sizeof (unsigned long) * CHAR_BIT
++					  * 0.30103 /* binary -> decimal */
++					  * 2 /* estimate for FLAG_GROUP */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 1; /* account for leading sign */
++		      else
++			tmp_length =
++			  (unsigned int) (sizeof (unsigned int) * CHAR_BIT
++					  * 0.30103 /* binary -> decimal */
++					  * 2 /* estimate for FLAG_GROUP */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 1; /* account for leading sign */
++		      break;
++
++		    case 'o':
++# ifdef HAVE_LONG_LONG
++		      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
++			tmp_length =
++			  (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
++					  * 0.333334 /* binary -> octal */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 1; /* account for leading sign */
++		      else
++# endif
++		      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
++			tmp_length =
++			  (unsigned int) (sizeof (unsigned long) * CHAR_BIT
++					  * 0.333334 /* binary -> octal */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 1; /* account for leading sign */
++		      else
++			tmp_length =
++			  (unsigned int) (sizeof (unsigned int) * CHAR_BIT
++					  * 0.333334 /* binary -> octal */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 1; /* account for leading sign */
++		      break;
++
++		    case 'x': case 'X':
++# ifdef HAVE_LONG_LONG
++		      if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
++			tmp_length =
++			  (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
++					  * 0.25 /* binary -> hexadecimal */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 2; /* account for leading sign or alternate form */
++		      else
++# endif
++		      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
++			tmp_length =
++			  (unsigned int) (sizeof (unsigned long) * CHAR_BIT
++					  * 0.25 /* binary -> hexadecimal */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 2; /* account for leading sign or alternate form */
++		      else
++			tmp_length =
++			  (unsigned int) (sizeof (unsigned int) * CHAR_BIT
++					  * 0.25 /* binary -> hexadecimal */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 2; /* account for leading sign or alternate form */
++		      break;
++
++		    case 'f': case 'F':
++# ifdef HAVE_LONG_DOUBLE
++		      if (type == TYPE_LONGDOUBLE)
++			tmp_length =
++			  (unsigned int) (LDBL_MAX_EXP
++					  * 0.30103 /* binary -> decimal */
++					  * 2 /* estimate for FLAG_GROUP */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 10; /* sign, decimal point etc. */
++		      else
++# endif
++			tmp_length =
++			  (unsigned int) (DBL_MAX_EXP
++					  * 0.30103 /* binary -> decimal */
++					  * 2 /* estimate for FLAG_GROUP */
++					 )
++			  + 1 /* turn floor into ceil */
++			  + 10; /* sign, decimal point etc. */
++		      tmp_length = xsum (tmp_length, precision);
++		      break;
++
++		    case 'e': case 'E': case 'g': case 'G':
++		    case 'a': case 'A':
++		      tmp_length =
++			12; /* sign, decimal point, exponent etc. */
++		      tmp_length = xsum (tmp_length, precision);
++		      break;
++
++		    case 'c':
++# if defined HAVE_WINT_T && !WIDE_CHAR_VERSION
++		      if (type == TYPE_WIDE_CHAR)
++			tmp_length = MB_CUR_MAX;
++		      else
++# endif
++			tmp_length = 1;
++		      break;
++
++		    case 's':
++# ifdef HAVE_WCHAR_T
++		      if (type == TYPE_WIDE_STRING)
++			{
++			  tmp_length =
++			    local_wcslen (a.arg[dp->arg_index].a.a_wide_string);
++
++#  if !WIDE_CHAR_VERSION
++			  tmp_length = xtimes (tmp_length, MB_CUR_MAX);
++#  endif
++			}
++		      else
++# endif
++			tmp_length = strlen (a.arg[dp->arg_index].a.a_string);
++		      break;
++
++		    case 'p':
++		      tmp_length =
++			(unsigned int) (sizeof (void *) * CHAR_BIT
++					* 0.25 /* binary -> hexadecimal */
++				       )
++			  + 1 /* turn floor into ceil */
++			  + 2; /* account for leading 0x */
++		      break;
++
++		    default:
++		      abort ();
++		    }
++
++		  if (tmp_length < width)
++		    tmp_length = width;
++
++		  tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
++		}
++
++		if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T))
++		  tmp = tmpbuf;
++		else
++		  {
++		    size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T));
++
++		    if (size_overflow_p (tmp_memsize))
++		      /* Overflow, would lead to out of memory.  */
++		      goto out_of_memory;
++		    tmp = (CHAR_T *) malloc (tmp_memsize);
++		    if (tmp == NULL)
++		      /* Out of memory.  */
++		      goto out_of_memory;
++		  }
++#endif
++
++		/* Construct the format string for calling snprintf or
++		   sprintf.  */
++		p = buf;
++		*p++ = '%';
++		if (dp->flags & FLAG_GROUP)
++		  *p++ = '\'';
++		if (dp->flags & FLAG_LEFT)
++		  *p++ = '-';
++		if (dp->flags & FLAG_SHOWSIGN)
++		  *p++ = '+';
++		if (dp->flags & FLAG_SPACE)
++		  *p++ = ' ';
++		if (dp->flags & FLAG_ALT)
++		  *p++ = '#';
++		if (dp->flags & FLAG_ZERO)
++		  *p++ = '0';
++		if (dp->width_start != dp->width_end)
++		  {
++		    size_t n = dp->width_end - dp->width_start;
++		    memcpy (p, dp->width_start, n * sizeof (CHAR_T));
++		    p += n;
++		  }
++		if (dp->precision_start != dp->precision_end)
++		  {
++		    size_t n = dp->precision_end - dp->precision_start;
++		    memcpy (p, dp->precision_start, n * sizeof (CHAR_T));
++		    p += n;
++		  }
++
++		switch (type)
++		  {
++#ifdef HAVE_LONG_LONG
++		  case TYPE_LONGLONGINT:
++		  case TYPE_ULONGLONGINT:
++		    *p++ = 'l';
++		    /*FALLTHROUGH*/
++#endif
++		  case TYPE_LONGINT:
++		  case TYPE_ULONGINT:
++#ifdef HAVE_WINT_T
++		  case TYPE_WIDE_CHAR:
++#endif
++#ifdef HAVE_WCHAR_T
++		  case TYPE_WIDE_STRING:
++#endif
++		    *p++ = 'l';
++		    break;
++#ifdef HAVE_LONG_DOUBLE
++		  case TYPE_LONGDOUBLE:
++		    *p++ = 'L';
++		    break;
++#endif
++		  default:
++		    break;
++		  }
++		*p = dp->conversion;
++#if USE_SNPRINTF
++		p[1] = '%';
++		p[2] = 'n';
++		p[3] = '\0';
++#else
++		p[1] = '\0';
++#endif
++
++		/* Construct the arguments for calling snprintf or sprintf.  */
++		prefix_count = 0;
++		if (dp->width_arg_index != ARG_NONE)
++		  {
++		    if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
++		      abort ();
++		    prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
++		  }
++		if (dp->precision_arg_index != ARG_NONE)
++		  {
++		    if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
++		      abort ();
++		    prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
++		  }
++
++#if USE_SNPRINTF
++		/* Prepare checking whether snprintf returns the count
++		   via %n.  */
++		ENSURE_ALLOCATION (xsum (length, 1));
++		result[length] = '\0';
++#endif
++
++		for (;;)
++		  {
++		    size_t maxlen;
++		    int count;
++		    int retcount;
++
++		    maxlen = allocated - length;
++		    count = -1;
++		    retcount = 0;
++
++#if USE_SNPRINTF
++# define SNPRINTF_BUF(arg) \
++		    switch (prefix_count)				    \
++		      {							    \
++		      case 0:						    \
++			retcount = SNPRINTF (result + length, maxlen, buf,  \
++					     arg, &count);		    \
++			break;						    \
++		      case 1:						    \
++			retcount = SNPRINTF (result + length, maxlen, buf,  \
++					     prefixes[0], arg, &count);	    \
++			break;						    \
++		      case 2:						    \
++			retcount = SNPRINTF (result + length, maxlen, buf,  \
++					     prefixes[0], prefixes[1], arg, \
++					     &count);			    \
++			break;						    \
++		      default:						    \
++			abort ();					    \
++		      }
++#else
++# define SNPRINTF_BUF(arg) \
++		    switch (prefix_count)				    \
++		      {							    \
++		      case 0:						    \
++			count = sprintf (tmp, buf, arg);		    \
++			break;						    \
++		      case 1:						    \
++			count = sprintf (tmp, buf, prefixes[0], arg);	    \
++			break;						    \
++		      case 2:						    \
++			count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
++					 arg);				    \
++			break;						    \
++		      default:						    \
++			abort ();					    \
++		      }
++#endif
++
++		    switch (type)
++		      {
++		      case TYPE_SCHAR:
++			{
++			  int arg = a.arg[dp->arg_index].a.a_schar;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++		      case TYPE_UCHAR:
++			{
++			  unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++		      case TYPE_SHORT:
++			{
++			  int arg = a.arg[dp->arg_index].a.a_short;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++		      case TYPE_USHORT:
++			{
++			  unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++		      case TYPE_INT:
++			{
++			  int arg = a.arg[dp->arg_index].a.a_int;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++		      case TYPE_UINT:
++			{
++			  unsigned int arg = a.arg[dp->arg_index].a.a_uint;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++		      case TYPE_LONGINT:
++			{
++			  long int arg = a.arg[dp->arg_index].a.a_longint;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++		      case TYPE_ULONGINT:
++			{
++			  unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++#ifdef HAVE_LONG_LONG
++		      case TYPE_LONGLONGINT:
++			{
++			  long long int arg = a.arg[dp->arg_index].a.a_longlongint;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++		      case TYPE_ULONGLONGINT:
++			{
++			  unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++#endif
++		      case TYPE_DOUBLE:
++			{
++			  double arg = a.arg[dp->arg_index].a.a_double;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++#ifdef HAVE_LONG_DOUBLE
++		      case TYPE_LONGDOUBLE:
++			{
++			  long double arg = a.arg[dp->arg_index].a.a_longdouble;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++#endif
++		      case TYPE_CHAR:
++			{
++			  int arg = a.arg[dp->arg_index].a.a_char;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++#ifdef HAVE_WINT_T
++		      case TYPE_WIDE_CHAR:
++			{
++			  wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++#endif
++		      case TYPE_STRING:
++			{
++			  const char *arg = a.arg[dp->arg_index].a.a_string;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++#ifdef HAVE_WCHAR_T
++		      case TYPE_WIDE_STRING:
++			{
++			  const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++#endif
++		      case TYPE_POINTER:
++			{
++			  void *arg = a.arg[dp->arg_index].a.a_pointer;
++			  SNPRINTF_BUF (arg);
++			}
++			break;
++		      default:
++			abort ();
++		      }
++
++#if USE_SNPRINTF
++		    /* Portability: Not all implementations of snprintf()
++		       are ISO C 99 compliant.  Determine the number of
++		       bytes that snprintf() has produced or would have
++		       produced.  */
++		    if (count >= 0)
++		      {
++			/* Verify that snprintf() has NUL-terminated its
++			   result.  */
++			if (count < maxlen && result[length + count] != '\0')
++			  abort ();
++			/* Portability hack.  */
++			if (retcount > count)
++			  count = retcount;
++		      }
++		    else
++		      {
++			/* snprintf() doesn't understand the '%n'
++			   directive.  */
++			if (p[1] != '\0')
++			  {
++			    /* Don't use the '%n' directive; instead, look
++			       at the snprintf() return value.  */
++			    p[1] = '\0';
++			    continue;
++			  }
++			else
++			  {
++			    /* Look at the snprintf() return value.  */
++			    if (retcount < 0)
++			      {
++				/* HP-UX 10.20 snprintf() is doubly deficient:
++				   It doesn't understand the '%n' directive,
++				   *and* it returns -1 (rather than the length
++				   that would have been required) when the
++				   buffer is too small.  */
++				size_t bigger_need =
++				  xsum (xtimes (allocated, 2), 12);
++				ENSURE_ALLOCATION (bigger_need);
++				continue;
++			      }
++			    else
++			      count = retcount;
++			  }
++		      }
++#endif
++
++		    /* Attempt to handle failure.  */
++		    if (count < 0)
++		      {
++			if (!(result == resultbuf || result == NULL))
++			  free (result);
++			if (buf_malloced != NULL)
++			  free (buf_malloced);
++			CLEANUP ();
++			errno = EINVAL;
++			return NULL;
++		      }
++
++#if !USE_SNPRINTF
++		    if (count >= tmp_length)
++		      /* tmp_length was incorrectly calculated - fix the
++			 code above!  */
++		      abort ();
++#endif
++
++		    /* Make room for the result.  */
++		    if (count >= maxlen)
++		      {
++			/* Need at least count bytes.  But allocate
++			   proportionally, to avoid looping eternally if
++			   snprintf() reports a too small count.  */
++			size_t n =
++			  xmax (xsum (length, count), xtimes (allocated, 2));
++
++			ENSURE_ALLOCATION (n);
++#if USE_SNPRINTF
++			continue;
++#endif
++		      }
++
++#if USE_SNPRINTF
++		    /* The snprintf() result did fit.  */
++#else
++		    /* Append the sprintf() result.  */
++		    memcpy (result + length, tmp, count * sizeof (CHAR_T));
++		    if (tmp != tmpbuf)
++		      free (tmp);
++#endif
++
++		    length += count;
++		    break;
++		  }
++	      }
++	  }
++      }
++
++    /* Add the final NUL.  */
++    ENSURE_ALLOCATION (xsum (length, 1));
++    result[length] = '\0';
++
++    if (result != resultbuf && length + 1 < allocated)
++      {
++	/* Shrink the allocated memory if possible.  */
++	CHAR_T *memory;
++
++	memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T));
++	if (memory != NULL)
++	  result = memory;
++      }
++
++    if (buf_malloced != NULL)
++      free (buf_malloced);
++    CLEANUP ();
++    *lengthp = length;
++    return result;
++
++  out_of_memory:
++    if (!(result == resultbuf || result == NULL))
++      free (result);
++    if (buf_malloced != NULL)
++      free (buf_malloced);
++  out_of_memory_1:
++    CLEANUP ();
++    errno = ENOMEM;
++    return NULL;
++  }
++}
++
++#undef SNPRINTF
++#undef USE_SNPRINTF
++#undef PRINTF_PARSE
++#undef DIRECTIVES
++#undef DIRECTIVE
++#undef CHAR_T
++#undef VASNPRINTF
+--- lrzsz-0.12.20.safe/intl/vasnprintf.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/vasnprintf.h	2004-09-12 14:40:34.667700664 -0400
+@@ -0,0 +1,61 @@
++/* vsprintf with automatic memory allocation.
++   Copyright (C) 2002-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _VASNPRINTF_H
++#define _VASNPRINTF_H
++
++/* Get va_list.  */
++#include <stdarg.h>
++
++/* Get size_t.  */
++#include <stddef.h>
++
++#ifndef __attribute__
++/* This feature is available in gcc versions 2.5 and later.  */
++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
++#  define __attribute__(Spec) /* empty */
++# endif
++/* The __-protected variants of `format' and `printf' attributes
++   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
++#  define __format__ format
++#  define __printf__ printf
++# endif
++#endif
++
++#ifdef	__cplusplus
++extern "C" {
++#endif
++
++/* Write formatted output to a string dynamically allocated with malloc().
++   You can pass a preallocated buffer for the result in RESULTBUF and its
++   size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
++   If successful, return the address of the string (this may be = RESULTBUF
++   if no dynamic memory allocation was necessary) and set *LENGTHP to the
++   number of resulting bytes, excluding the trailing NUL.  Upon error, set
++   errno and return NULL.  */
++extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
++       __attribute__ ((__format__ (__printf__, 3, 4)));
++extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
++       __attribute__ ((__format__ (__printf__, 3, 0)));
++
++#ifdef	__cplusplus
++}
++#endif
++
++#endif /* _VASNPRINTF_H */
+--- lrzsz-0.12.20.safe/intl/vasnwprintf.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/vasnwprintf.h	2004-09-12 14:40:34.673699752 -0400
+@@ -0,0 +1,46 @@
++/* vswprintf with automatic memory allocation.
++   Copyright (C) 2002-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _VASNWPRINTF_H
++#define _VASNWPRINTF_H
++
++/* Get va_list.  */
++#include <stdarg.h>
++
++/* Get wchar_t, size_t.  */
++#include <stddef.h>
++
++#ifdef	__cplusplus
++extern "C" {
++#endif
++
++/* Write formatted output to a string dynamically allocated with malloc().
++   You can pass a preallocated buffer for the result in RESULTBUF and its
++   size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
++   If successful, return the address of the string (this may be = RESULTBUF
++   if no dynamic memory allocation was necessary) and set *LENGTHP to the
++   number of resulting bytes, excluding the trailing NUL.  Upon error, set
++   errno and return NULL.  */
++extern wchar_t * asnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, ...);
++extern wchar_t * vasnwprintf (wchar_t *resultbuf, size_t *lengthp, const wchar_t *format, va_list args);
++
++#ifdef	__cplusplus
++}
++#endif
++
++#endif /* _VASNWPRINTF_H */
+--- lrzsz-0.12.20.safe/intl/VERSION	1998-04-26 09:22:37.000000000 -0400
++++ lrzsz-0.12.20/intl/VERSION	2004-09-12 14:40:34.679698840 -0400
+@@ -1 +1 @@
+-GNU gettext library from gettext-0.10.32
++GNU gettext library from gettext-0.14.1
+--- lrzsz-0.12.20.safe/intl/wprintf-parse.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/wprintf-parse.h	2004-09-12 14:40:34.695696408 -0400
+@@ -0,0 +1,75 @@
++/* Parse printf format string.
++   Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _WPRINTF_PARSE_H
++#define _WPRINTF_PARSE_H
++
++#include "printf-args.h"
++
++
++/* Flags */
++#define FLAG_GROUP	 1	/* ' flag */
++#define FLAG_LEFT	 2	/* - flag */
++#define FLAG_SHOWSIGN	 4	/* + flag */
++#define FLAG_SPACE	 8	/* space flag */
++#define FLAG_ALT	16	/* # flag */
++#define FLAG_ZERO	32
++
++/* arg_index value indicating that no argument is consumed.  */
++#define ARG_NONE	(~(size_t)0)
++
++/* A parsed directive.  */
++typedef struct
++{
++  const wchar_t* dir_start;
++  const wchar_t* dir_end;
++  int flags;
++  const wchar_t* width_start;
++  const wchar_t* width_end;
++  size_t width_arg_index;
++  const wchar_t* precision_start;
++  const wchar_t* precision_end;
++  size_t precision_arg_index;
++  wchar_t conversion; /* d i o u x X f e E g G c s p n U % but not C S */
++  size_t arg_index;
++}
++wchar_t_directive;
++
++/* A parsed format string.  */
++typedef struct
++{
++  size_t count;
++  wchar_t_directive *dir;
++  size_t max_width_length;
++  size_t max_precision_length;
++}
++wchar_t_directives;
++
++
++/* Parses the format string.  Fills in the number N of directives, and fills
++   in directives[0], ..., directives[N-1], and sets directives[N].dir_start
++   to the end of the format string.  Also fills in the arg_type fields of the
++   arguments and the needed count of arguments.  */
++#ifdef STATIC
++STATIC
++#else
++extern
++#endif
++int wprintf_parse (const wchar_t *format, wchar_t_directives *d, arguments *a);
++
++#endif /* _WPRINTF_PARSE_H */
+--- lrzsz-0.12.20.safe/intl/xopen-msg.sed	1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/intl/xopen-msg.sed	1969-12-31 19:00:00.000000000 -0500
+@@ -1,104 +0,0 @@
+-# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file
+-# Copyright (C) 1995 Free Software Foundation, Inc.
+-# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+-#
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-#
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-# GNU General Public License for more details.
+-#
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-#
+-#
+-# The first directive in the .msg should be the definition of the
+-# message set number.  We use always set number 1.
+-#
+-1 {
+-  i\
+-$set 1 # Automatically created by po2msg.sed
+-  h
+-  s/.*/0/
+-  x
+-}
+-#
+-# We copy all comments into the .msg file.  Perhaps they can help.
+-#
+-/^#/ s/^#[ 	]*/$ /p
+-#
+-# We copy the original message as a comment into the .msg file.
+-#
+-/^msgid/ {
+-# Does not work now
+-#  /"$/! {
+-#    s/\\$//
+-#    s/$/ ... (more lines following)"/
+-#  }
+-  s/^msgid[ 	]*"\(.*\)"$/$ Original Message: \1/
+-  p
+-}
+-#
+-# The .msg file contains, other then the .po file, only the translations
+-# but each given a unique ID.  Starting from 1 and incrementing by 1 for
+-# each message we assign them to the messages.
+-# It is important that the .po file used to generate the cat-id-tbl.c file
+-# (with po-to-tbl) is the same as the one used here.  (At least the order
+-# of declarations must not be changed.)
+-#
+-/^msgstr/ {
+-  s/msgstr[ 	]*"\(.*\)"/\1/
+-  x
+-# The following nice solution is by
+-# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+-  td
+-# Increment a decimal number in pattern space.
+-# First hide trailing `9' digits.
+-  :d
+-  s/9\(_*\)$/_\1/
+-  td
+-# Assure at least one digit is available.
+-  s/^\(_*\)$/0\1/
+-# Increment the last digit.
+-  s/8\(_*\)$/9\1/
+-  s/7\(_*\)$/8\1/
+-  s/6\(_*\)$/7\1/
+-  s/5\(_*\)$/6\1/
+-  s/4\(_*\)$/5\1/
+-  s/3\(_*\)$/4\1/
+-  s/2\(_*\)$/3\1/
+-  s/1\(_*\)$/2\1/
+-  s/0\(_*\)$/1\1/
+-# Convert the hidden `9' digits to `0's.
+-  s/_/0/g
+-  x
+-# Bring the line in the format `<number> <message>'
+-  G
+-  s/^[^\n]*$/& /
+-  s/\(.*\)\n\([0-9]*\)/\2 \1/
+-# Clear flag from last substitution.
+-  tb
+-# Append the next line.
+-  :b
+-  N
+-# Look whether second part is a continuation line.
+-  s/\(.*\n\)"\(.*\)"/\1\2/
+-# Yes, then branch.
+-  ta
+-  P
+-  D
+-# Note that `D' includes a jump to the start!!
+-# We found a continuation line.  But before printing insert '\'.
+-  :a
+-  s/\(.*\)\(\n.*\)/\1\\\2/
+-  P
+-# We cannot use the sed command `D' here
+-  s/.*\n\(.*\)/\1/
+-  tb
+-}
+-d
+--- lrzsz-0.12.20.safe/intl/xsize.h	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/intl/xsize.h	2004-09-12 14:40:34.700695648 -0400
+@@ -0,0 +1,109 @@
++/* xsize.h -- Checked size_t computations.
++
++   Copyright (C) 2003 Free Software Foundation, Inc.
++
++   This program is free software; you can redistribute it and/or modify it
++   under the terms of the GNU Library General Public License as published
++   by the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Library General Public License for more details.
++
++   You should have received a copy of the GNU Library General Public
++   License along with this program; if not, write to the Free Software
++   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++   USA.  */
++
++#ifndef _XSIZE_H
++#define _XSIZE_H
++
++/* Get size_t.  */
++#include <stddef.h>
++
++/* Get SIZE_MAX.  */
++#include <limits.h>
++#if HAVE_STDINT_H
++# include <stdint.h>
++#endif
++
++/* The size of memory objects is often computed through expressions of
++   type size_t. Example:
++      void* p = malloc (header_size + n * element_size).
++   These computations can lead to overflow.  When this happens, malloc()
++   returns a piece of memory that is way too small, and the program then
++   crashes while attempting to fill the memory.
++   To avoid this, the functions and macros in this file check for overflow.
++   The convention is that SIZE_MAX represents overflow.
++   malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
++   implementation that uses mmap --, it's recommended to use size_overflow_p()
++   or size_in_bounds_p() before invoking malloc().
++   The example thus becomes:
++      size_t size = xsum (header_size, xtimes (n, element_size));
++      void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
++*/
++
++/* Convert an arbitrary value >= 0 to type size_t.  */
++#define xcast_size_t(N) \
++  ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
++
++/* Sum of two sizes, with overflow check.  */
++static inline size_t
++#if __GNUC__ >= 3
++__attribute__ ((__pure__))
++#endif
++xsum (size_t size1, size_t size2)
++{
++  size_t sum = size1 + size2;
++  return (sum >= size1 ? sum : SIZE_MAX);
++}
++
++/* Sum of three sizes, with overflow check.  */
++static inline size_t
++#if __GNUC__ >= 3
++__attribute__ ((__pure__))
++#endif
++xsum3 (size_t size1, size_t size2, size_t size3)
++{
++  return xsum (xsum (size1, size2), size3);
++}
++
++/* Sum of four sizes, with overflow check.  */
++static inline size_t
++#if __GNUC__ >= 3
++__attribute__ ((__pure__))
++#endif
++xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
++{
++  return xsum (xsum (xsum (size1, size2), size3), size4);
++}
++
++/* Maximum of two sizes, with overflow check.  */
++static inline size_t
++#if __GNUC__ >= 3
++__attribute__ ((__pure__))
++#endif
++xmax (size_t size1, size_t size2)
++{
++  /* No explicit check is needed here, because for any n:
++     max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX.  */
++  return (size1 >= size2 ? size1 : size2);
++}
++
++/* Multiplication of a count with an element size, with overflow check.
++   The count must be >= 0 and the element size must be > 0.
++   This is a macro, not an inline function, so that it works correctly even
++   when N is of a wider tupe and N > SIZE_MAX.  */
++#define xtimes(N, ELSIZE) \
++  ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
++
++/* Check for overflow.  */
++#define size_overflow_p(SIZE) \
++  ((SIZE) == SIZE_MAX)
++/* Check against overflow.  */
++#define size_in_bounds_p(SIZE) \
++  ((SIZE) != SIZE_MAX)
++
++#endif /* _XSIZE_H */
+--- lrzsz-0.12.20.safe/m4/ChangeLog	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/ChangeLog	2004-09-12 14:40:35.054641840 -0400
+@@ -0,0 +1,32 @@
++2004-09-12  gettextize  <bug-gnu-gettext@gnu.org>
++
++	* codeset.m4: New file, from gettext-0.14.1.
++	* gettext.m4: New file, from gettext-0.14.1.
++	* glibc21.m4: New file, from gettext-0.14.1.
++	* iconv.m4: New file, from gettext-0.14.1.
++	* intdiv0.m4: New file, from gettext-0.14.1.
++	* intmax.m4: New file, from gettext-0.14.1.
++	* inttypes.m4: New file, from gettext-0.14.1.
++	* inttypes_h.m4: New file, from gettext-0.14.1.
++	* inttypes-pri.m4: New file, from gettext-0.14.1.
++	* isc-posix.m4: New file, from gettext-0.14.1.
++	* lcmessage.m4: New file, from gettext-0.14.1.
++	* lib-ld.m4: New file, from gettext-0.14.1.
++	* lib-link.m4: New file, from gettext-0.14.1.
++	* lib-prefix.m4: New file, from gettext-0.14.1.
++	* longdouble.m4: New file, from gettext-0.14.1.
++	* longlong.m4: New file, from gettext-0.14.1.
++	* nls.m4: New file, from gettext-0.14.1.
++	* po.m4: New file, from gettext-0.14.1.
++	* printf-posix.m4: New file, from gettext-0.14.1.
++	* progtest.m4: New file, from gettext-0.14.1.
++	* signed.m4: New file, from gettext-0.14.1.
++	* size_max.m4: New file, from gettext-0.14.1.
++	* stdint_h.m4: New file, from gettext-0.14.1.
++	* uintmax_t.m4: New file, from gettext-0.14.1.
++	* ulonglong.m4: New file, from gettext-0.14.1.
++	* wchar_t.m4: New file, from gettext-0.14.1.
++	* wint_t.m4: New file, from gettext-0.14.1.
++	* xsize.m4: New file, from gettext-0.14.1.
++	* Makefile.am: New file.
++
+--- lrzsz-0.12.20.safe/m4/codeset.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/codeset.m4	2004-09-12 14:40:34.820677408 -0400
+@@ -0,0 +1,23 @@
++# codeset.m4 serial AM1 (gettext-0.10.40)
++dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([AM_LANGINFO_CODESET],
++[
++  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
++    [AC_TRY_LINK([#include <langinfo.h>],
++      [char* cs = nl_langinfo(CODESET);],
++      am_cv_langinfo_codeset=yes,
++      am_cv_langinfo_codeset=no)
++    ])
++  if test $am_cv_langinfo_codeset = yes; then
++    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
++      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/gettext.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/gettext.m4	2004-09-12 14:40:34.826676496 -0400
+@@ -0,0 +1,487 @@
++# gettext.m4 serial 28 (gettext-0.13)
++dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
++dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
++
++dnl Macro to add for using GNU gettext.
++
++dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
++dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
++dnl    default (if it is not specified or empty) is 'no-libtool'.
++dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
++dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
++dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
++dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
++dnl    depending on --{enable,disable}-{shared,static} and on the presence of
++dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
++dnl    $(top_builddir)/intl/libintl.a will be created.
++dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
++dnl    implementations (in libc or libintl) without the ngettext() function
++dnl    will be ignored.  If NEEDSYMBOL is specified and is
++dnl    'need-formatstring-macros', then GNU gettext implementations that don't
++dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
++dnl INTLDIR is used to find the intl libraries.  If empty,
++dnl    the value `$(top_builddir)/intl/' is used.
++dnl
++dnl The result of the configuration is one of three cases:
++dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
++dnl    and used.
++dnl    Catalog format: GNU --> install in $(datadir)
++dnl    Catalog extension: .mo after installation, .gmo in source tree
++dnl 2) GNU gettext has been found in the system's C library.
++dnl    Catalog format: GNU --> install in $(datadir)
++dnl    Catalog extension: .mo after installation, .gmo in source tree
++dnl 3) No internationalization, always use English msgid.
++dnl    Catalog format: none
++dnl    Catalog extension: none
++dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
++dnl The use of .gmo is historical (it was needed to avoid overwriting the
++dnl GNU format catalogs when building on a platform with an X/Open gettext),
++dnl but we keep it in order not to force irrelevant filename changes on the
++dnl maintainers.
++dnl
++AC_DEFUN([AM_GNU_GETTEXT],
++[
++  dnl Argument checking.
++  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
++    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
++])])])])])
++  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
++    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
++])])])])
++  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
++  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
++
++  AC_REQUIRE([AM_PO_SUBDIRS])dnl
++  ifelse(gt_included_intl, yes, [
++    AC_REQUIRE([AM_INTL_SUBDIR])dnl
++  ])
++
++  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
++  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++  AC_REQUIRE([AC_LIB_RPATH])
++
++  dnl Sometimes libintl requires libiconv, so first search for libiconv.
++  dnl Ideally we would do this search only after the
++  dnl      if test "$USE_NLS" = "yes"; then
++  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
++  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
++  dnl the configure script would need to contain the same shell code
++  dnl again, outside any 'if'. There are two solutions:
++  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
++  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
++  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
++  dnl documented, we avoid it.
++  ifelse(gt_included_intl, yes, , [
++    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
++  ])
++
++  dnl Set USE_NLS.
++  AM_NLS
++
++  ifelse(gt_included_intl, yes, [
++    BUILD_INCLUDED_LIBINTL=no
++    USE_INCLUDED_LIBINTL=no
++  ])
++  LIBINTL=
++  LTLIBINTL=
++  POSUB=
++
++  dnl If we use NLS figure out what method
++  if test "$USE_NLS" = "yes"; then
++    gt_use_preinstalled_gnugettext=no
++    ifelse(gt_included_intl, yes, [
++      AC_MSG_CHECKING([whether included gettext is requested])
++      AC_ARG_WITH(included-gettext,
++        [  --with-included-gettext use the GNU gettext library included here],
++        nls_cv_force_use_gnu_gettext=$withval,
++        nls_cv_force_use_gnu_gettext=no)
++      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
++
++      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
++      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
++    ])
++        dnl User does not insist on using GNU NLS library.  Figure out what
++        dnl to use.  If GNU gettext is available we use this.  Else we have
++        dnl to fall back to GNU NLS library.
++
++        dnl Add a version number to the cache macros.
++        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
++        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
++        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
++
++        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
++         [AC_TRY_LINK([#include <libintl.h>
++]ifelse([$2], [need-formatstring-macros],
++[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
++#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
++#endif
++changequote(,)dnl
++typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
++changequote([,])dnl
++], [])[extern int _nl_msg_cat_cntr;
++extern int *_nl_domain_bindings;],
++            [bindtextdomain ("", "");
++return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
++            gt_cv_func_gnugettext_libc=yes,
++            gt_cv_func_gnugettext_libc=no)])
++
++        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
++          dnl Sometimes libintl requires libiconv, so first search for libiconv.
++          ifelse(gt_included_intl, yes, , [
++            AM_ICONV_LINK
++          ])
++          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
++          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
++          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
++          dnl even if libiconv doesn't exist.
++          AC_LIB_LINKFLAGS_BODY([intl])
++          AC_CACHE_CHECK([for GNU gettext in libintl],
++            gt_cv_func_gnugettext_libintl,
++           [gt_save_CPPFLAGS="$CPPFLAGS"
++            CPPFLAGS="$CPPFLAGS $INCINTL"
++            gt_save_LIBS="$LIBS"
++            LIBS="$LIBS $LIBINTL"
++            dnl Now see whether libintl exists and does not depend on libiconv.
++            AC_TRY_LINK([#include <libintl.h>
++]ifelse([$2], [need-formatstring-macros],
++[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
++#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
++#endif
++changequote(,)dnl
++typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
++changequote([,])dnl
++], [])[extern int _nl_msg_cat_cntr;
++extern
++#ifdef __cplusplus
++"C"
++#endif
++const char *_nl_expand_alias ();],
++              [bindtextdomain ("", "");
++return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
++              gt_cv_func_gnugettext_libintl=yes,
++              gt_cv_func_gnugettext_libintl=no)
++            dnl Now see whether libintl exists and depends on libiconv.
++            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
++              LIBS="$LIBS $LIBICONV"
++              AC_TRY_LINK([#include <libintl.h>
++]ifelse([$2], [need-formatstring-macros],
++[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
++#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
++#endif
++changequote(,)dnl
++typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
++changequote([,])dnl
++], [])[extern int _nl_msg_cat_cntr;
++extern
++#ifdef __cplusplus
++"C"
++#endif
++const char *_nl_expand_alias ();],
++                [bindtextdomain ("", "");
++return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
++               [LIBINTL="$LIBINTL $LIBICONV"
++                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
++                gt_cv_func_gnugettext_libintl=yes
++               ])
++            fi
++            CPPFLAGS="$gt_save_CPPFLAGS"
++            LIBS="$gt_save_LIBS"])
++        fi
++
++        dnl If an already present or preinstalled GNU gettext() is found,
++        dnl use it.  But if this macro is used in GNU gettext, and GNU
++        dnl gettext is already preinstalled in libintl, we update this
++        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
++        if test "$gt_cv_func_gnugettext_libc" = "yes" \
++           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
++                && test "$PACKAGE" != gettext-runtime \
++                && test "$PACKAGE" != gettext-tools; }; then
++          gt_use_preinstalled_gnugettext=yes
++        else
++          dnl Reset the values set by searching for libintl.
++          LIBINTL=
++          LTLIBINTL=
++          INCINTL=
++        fi
++
++    ifelse(gt_included_intl, yes, [
++        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
++          dnl GNU gettext is not found in the C library.
++          dnl Fall back on included GNU gettext library.
++          nls_cv_use_gnu_gettext=yes
++        fi
++      fi
++
++      if test "$nls_cv_use_gnu_gettext" = "yes"; then
++        dnl Mark actions used to generate GNU NLS library.
++        BUILD_INCLUDED_LIBINTL=yes
++        USE_INCLUDED_LIBINTL=yes
++        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
++        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
++        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
++      fi
++
++      if test "$gt_use_preinstalled_gnugettext" = "yes" \
++         || test "$nls_cv_use_gnu_gettext" = "yes"; then
++        dnl Mark actions to use GNU gettext tools.
++        CATOBJEXT=.gmo
++      fi
++    ])
++
++    if test "$gt_use_preinstalled_gnugettext" = "yes" \
++       || test "$nls_cv_use_gnu_gettext" = "yes"; then
++      AC_DEFINE(ENABLE_NLS, 1,
++        [Define to 1 if translation of program messages to the user's native language
++   is requested.])
++    else
++      USE_NLS=no
++    fi
++  fi
++
++  AC_MSG_CHECKING([whether to use NLS])
++  AC_MSG_RESULT([$USE_NLS])
++  if test "$USE_NLS" = "yes"; then
++    AC_MSG_CHECKING([where the gettext function comes from])
++    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
++      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
++        gt_source="external libintl"
++      else
++        gt_source="libc"
++      fi
++    else
++      gt_source="included intl directory"
++    fi
++    AC_MSG_RESULT([$gt_source])
++  fi
++
++  if test "$USE_NLS" = "yes"; then
++
++    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
++      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
++        AC_MSG_CHECKING([how to link with libintl])
++        AC_MSG_RESULT([$LIBINTL])
++        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
++      fi
++
++      dnl For backward compatibility. Some packages may be using this.
++      AC_DEFINE(HAVE_GETTEXT, 1,
++       [Define if the GNU gettext() function is already present or preinstalled.])
++      AC_DEFINE(HAVE_DCGETTEXT, 1,
++       [Define if the GNU dcgettext() function is already present or preinstalled.])
++    fi
++
++    dnl We need to process the po/ directory.
++    POSUB=po
++  fi
++
++  ifelse(gt_included_intl, yes, [
++    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
++    dnl to 'yes' because some of the testsuite requires it.
++    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
++      BUILD_INCLUDED_LIBINTL=yes
++    fi
++
++    dnl Make all variables we use known to autoconf.
++    AC_SUBST(BUILD_INCLUDED_LIBINTL)
++    AC_SUBST(USE_INCLUDED_LIBINTL)
++    AC_SUBST(CATOBJEXT)
++
++    dnl For backward compatibility. Some configure.ins may be using this.
++    nls_cv_header_intl=
++    nls_cv_header_libgt=
++
++    dnl For backward compatibility. Some Makefiles may be using this.
++    DATADIRNAME=share
++    AC_SUBST(DATADIRNAME)
++
++    dnl For backward compatibility. Some Makefiles may be using this.
++    INSTOBJEXT=.mo
++    AC_SUBST(INSTOBJEXT)
++
++    dnl For backward compatibility. Some Makefiles may be using this.
++    GENCAT=gencat
++    AC_SUBST(GENCAT)
++
++    dnl For backward compatibility. Some Makefiles may be using this.
++    if test "$USE_INCLUDED_LIBINTL" = yes; then
++      INTLOBJS="\$(GETTOBJS)"
++    fi
++    AC_SUBST(INTLOBJS)
++
++    dnl Enable libtool support if the surrounding package wishes it.
++    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
++    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
++  ])
++
++  dnl For backward compatibility. Some Makefiles may be using this.
++  INTLLIBS="$LIBINTL"
++  AC_SUBST(INTLLIBS)
++
++  dnl Make all documented variables known to autoconf.
++  AC_SUBST(LIBINTL)
++  AC_SUBST(LTLIBINTL)
++  AC_SUBST(POSUB)
++])
++
++
++dnl Checks for all prerequisites of the intl subdirectory,
++dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
++dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
++AC_DEFUN([AM_INTL_SUBDIR],
++[
++  AC_REQUIRE([AC_PROG_INSTALL])dnl
++  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
++  AC_REQUIRE([AC_PROG_CC])dnl
++  AC_REQUIRE([AC_CANONICAL_HOST])dnl
++  AC_REQUIRE([AC_PROG_RANLIB])dnl
++  AC_REQUIRE([AC_ISC_POSIX])dnl
++  AC_REQUIRE([AC_HEADER_STDC])dnl
++  AC_REQUIRE([AC_C_CONST])dnl
++  AC_REQUIRE([bh_C_SIGNED])dnl
++  AC_REQUIRE([AC_C_INLINE])dnl
++  AC_REQUIRE([AC_TYPE_OFF_T])dnl
++  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
++  AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
++  AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
++  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
++  AC_REQUIRE([gt_TYPE_WINT_T])dnl
++  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
++  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
++  AC_REQUIRE([gt_TYPE_INTMAX_T])
++  AC_REQUIRE([gt_PRINTF_POSIX])
++  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
++  AC_REQUIRE([AC_FUNC_MMAP])dnl
++  AC_REQUIRE([jm_GLIBC21])dnl
++  AC_REQUIRE([gt_INTDIV0])dnl
++  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
++  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
++  AC_REQUIRE([gt_INTTYPES_PRI])dnl
++  AC_REQUIRE([gl_XSIZE])dnl
++
++  AC_CHECK_TYPE([ptrdiff_t], ,
++    [AC_DEFINE([ptrdiff_t], [long],
++       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
++    ])
++  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
++stdlib.h string.h unistd.h sys/param.h])
++  AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
++mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
++strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
++__fsetlocking])
++
++  dnl Use the _snprintf function only if it is declared (because on NetBSD it
++  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
++  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
++  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
++
++  dnl Use the *_unlocked functions only if they are declared.
++  dnl (because some of them were defined without being declared in Solaris
++  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
++  dnl on Solaris 2.5.1 to run on Solaris 2.6).
++  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
++  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
++  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
++  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
++
++  case $gt_cv_func_printf_posix in
++    *yes) HAVE_POSIX_PRINTF=1 ;;
++    *) HAVE_POSIX_PRINTF=0 ;;
++  esac
++  AC_SUBST([HAVE_POSIX_PRINTF])
++  if test "$ac_cv_func_asprintf" = yes; then
++    HAVE_ASPRINTF=1
++  else
++    HAVE_ASPRINTF=0
++  fi
++  AC_SUBST([HAVE_ASPRINTF])
++  if test "$ac_cv_func_snprintf" = yes; then
++    HAVE_SNPRINTF=1
++  else
++    HAVE_SNPRINTF=0
++  fi
++  AC_SUBST([HAVE_SNPRINTF])
++  if test "$ac_cv_func_wprintf" = yes; then
++    HAVE_WPRINTF=1
++  else
++    HAVE_WPRINTF=0
++  fi
++  AC_SUBST([HAVE_WPRINTF])
++
++  AM_ICONV
++  AM_LANGINFO_CODESET
++  if test $ac_cv_header_locale_h = yes; then
++    AM_LC_MESSAGES
++  fi
++
++  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
++  dnl because plural.y uses bison specific features. It requires at least
++  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
++  dnl compile.
++  dnl bison is only needed for the maintainer (who touches plural.y). But in
++  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
++  dnl the rule in general Makefile. Now, some people carelessly touch the
++  dnl files or have a broken "make" program, hence the plural.c rule will
++  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
++  dnl present or too old.
++  AC_CHECK_PROGS([INTLBISON], [bison])
++  if test -z "$INTLBISON"; then
++    ac_verc_fail=yes
++  else
++    dnl Found it, now check the version.
++    AC_MSG_CHECKING([version of bison])
++changequote(<<,>>)dnl
++    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
++    case $ac_prog_version in
++      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
++      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
++changequote([,])dnl
++         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
++      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
++    esac
++    AC_MSG_RESULT([$ac_prog_version])
++  fi
++  if test $ac_verc_fail = yes; then
++    INTLBISON=:
++  fi
++])
++
++
++dnl gt_CHECK_DECL(FUNC, INCLUDES)
++dnl Check whether a function is declared.
++AC_DEFUN([gt_CHECK_DECL],
++[
++  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
++    [AC_TRY_COMPILE([$2], [
++#ifndef $1
++  char *p = (char *) $1;
++#endif
++], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
++  if test $ac_cv_have_decl_$1 = yes; then
++    gt_value=1
++  else
++    gt_value=0
++  fi
++  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
++    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
++])
++
++
++dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
++AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
+--- lrzsz-0.12.20.safe/m4/glibc21.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/glibc21.m4	2004-09-12 14:40:34.833675432 -0400
+@@ -0,0 +1,32 @@
++# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
++dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++# Test for the GNU C Library, version 2.1 or newer.
++# From Bruno Haible.
++
++AC_DEFUN([jm_GLIBC21],
++  [
++    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
++      ac_cv_gnu_library_2_1,
++      [AC_EGREP_CPP([Lucky GNU user],
++	[
++#include <features.h>
++#ifdef __GNU_LIBRARY__
++ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
++  Lucky GNU user
++ #endif
++#endif
++	],
++	ac_cv_gnu_library_2_1=yes,
++	ac_cv_gnu_library_2_1=no)
++      ]
++    )
++    AC_SUBST(GLIBC21)
++    GLIBC21="$ac_cv_gnu_library_2_1"
++  ]
++)
+--- lrzsz-0.12.20.safe/m4/iconv.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/iconv.m4	2004-09-12 14:40:34.839674520 -0400
+@@ -0,0 +1,103 @@
++# iconv.m4 serial AM4 (gettext-0.11.3)
++dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
++[
++  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
++  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++  AC_REQUIRE([AC_LIB_RPATH])
++
++  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
++  dnl accordingly.
++  AC_LIB_LINKFLAGS_BODY([iconv])
++])
++
++AC_DEFUN([AM_ICONV_LINK],
++[
++  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
++  dnl those with the standalone portable GNU libiconv installed).
++
++  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
++  dnl accordingly.
++  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
++
++  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
++  dnl because if the user has installed libiconv and not disabled its use
++  dnl via --without-libiconv-prefix, he wants to use it. The first
++  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
++  am_save_CPPFLAGS="$CPPFLAGS"
++  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
++
++  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
++    am_cv_func_iconv="no, consider installing GNU libiconv"
++    am_cv_lib_iconv=no
++    AC_TRY_LINK([#include <stdlib.h>
++#include <iconv.h>],
++      [iconv_t cd = iconv_open("","");
++       iconv(cd,NULL,NULL,NULL,NULL);
++       iconv_close(cd);],
++      am_cv_func_iconv=yes)
++    if test "$am_cv_func_iconv" != yes; then
++      am_save_LIBS="$LIBS"
++      LIBS="$LIBS $LIBICONV"
++      AC_TRY_LINK([#include <stdlib.h>
++#include <iconv.h>],
++        [iconv_t cd = iconv_open("","");
++         iconv(cd,NULL,NULL,NULL,NULL);
++         iconv_close(cd);],
++        am_cv_lib_iconv=yes
++        am_cv_func_iconv=yes)
++      LIBS="$am_save_LIBS"
++    fi
++  ])
++  if test "$am_cv_func_iconv" = yes; then
++    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
++  fi
++  if test "$am_cv_lib_iconv" = yes; then
++    AC_MSG_CHECKING([how to link with libiconv])
++    AC_MSG_RESULT([$LIBICONV])
++  else
++    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
++    dnl either.
++    CPPFLAGS="$am_save_CPPFLAGS"
++    LIBICONV=
++    LTLIBICONV=
++  fi
++  AC_SUBST(LIBICONV)
++  AC_SUBST(LTLIBICONV)
++])
++
++AC_DEFUN([AM_ICONV],
++[
++  AM_ICONV_LINK
++  if test "$am_cv_func_iconv" = yes; then
++    AC_MSG_CHECKING([for iconv declaration])
++    AC_CACHE_VAL(am_cv_proto_iconv, [
++      AC_TRY_COMPILE([
++#include <stdlib.h>
++#include <iconv.h>
++extern
++#ifdef __cplusplus
++"C"
++#endif
++#if defined(__STDC__) || defined(__cplusplus)
++size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
++#else
++size_t iconv();
++#endif
++], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
++      am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
++    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
++    AC_MSG_RESULT([$]{ac_t:-
++         }[$]am_cv_proto_iconv)
++    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
++      [Define as const if the declaration of iconv() needs const.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/intdiv0.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/intdiv0.m4	2004-09-12 14:40:34.845673608 -0400
+@@ -0,0 +1,72 @@
++# intdiv0.m4 serial 1 (gettext-0.11.3)
++dnl Copyright (C) 2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([gt_INTDIV0],
++[
++  AC_REQUIRE([AC_PROG_CC])dnl
++  AC_REQUIRE([AC_CANONICAL_HOST])dnl
++
++  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
++    gt_cv_int_divbyzero_sigfpe,
++    [
++      AC_TRY_RUN([
++#include <stdlib.h>
++#include <signal.h>
++
++static void
++#ifdef __cplusplus
++sigfpe_handler (int sig)
++#else
++sigfpe_handler (sig) int sig;
++#endif
++{
++  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
++  exit (sig != SIGFPE);
++}
++
++int x = 1;
++int y = 0;
++int z;
++int nan;
++
++int main ()
++{
++  signal (SIGFPE, sigfpe_handler);
++/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
++#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
++  signal (SIGTRAP, sigfpe_handler);
++#endif
++/* Linux/SPARC yields signal SIGILL.  */
++#if defined (__sparc__) && defined (__linux__)
++  signal (SIGILL, sigfpe_handler);
++#endif
++
++  z = x / y;
++  nan = y / y;
++  exit (1);
++}
++], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
++        [
++          # Guess based on the CPU.
++          case "$host_cpu" in
++            alpha* | i[34567]86 | m68k | s390*)
++              gt_cv_int_divbyzero_sigfpe="guessing yes";;
++            *)
++              gt_cv_int_divbyzero_sigfpe="guessing no";;
++          esac
++        ])
++    ])
++  case "$gt_cv_int_divbyzero_sigfpe" in
++    *yes) value=1;;
++    *) value=0;;
++  esac
++  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
++    [Define if integer division by zero raises signal SIGFPE.])
++])
+--- lrzsz-0.12.20.safe/m4/intmax.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/intmax.m4	2004-09-12 14:40:34.855672088 -0400
+@@ -0,0 +1,32 @@
++# intmax.m4 serial 1 (gettext-0.12)
++dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++dnl Test whether the system has the 'intmax_t' type, but don't attempt to
++dnl find a replacement if it is lacking.
++
++AC_DEFUN([gt_TYPE_INTMAX_T],
++[
++  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
++  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
++  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
++    [AC_TRY_COMPILE([
++#include <stddef.h> 
++#include <stdlib.h>
++#if HAVE_STDINT_H_WITH_UINTMAX
++#include <stdint.h>
++#endif
++#if HAVE_INTTYPES_H_WITH_UINTMAX
++#include <inttypes.h>
++#endif
++], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
++  if test $gt_cv_c_intmax_t = yes; then
++    AC_DEFINE(HAVE_INTMAX_T, 1,
++      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/inttypes_h.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/inttypes_h.m4	2004-09-12 14:40:34.868670112 -0400
+@@ -0,0 +1,28 @@
++# inttypes_h.m4 serial 5 (gettext-0.12)
++dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
++# doesn't clash with <sys/types.h>, and declares uintmax_t.
++
++AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
++[
++  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
++  [AC_TRY_COMPILE(
++    [#include <sys/types.h>
++#include <inttypes.h>],
++    [uintmax_t i = (uintmax_t) -1;],
++    jm_ac_cv_header_inttypes_h=yes,
++    jm_ac_cv_header_inttypes_h=no)])
++  if test $jm_ac_cv_header_inttypes_h = yes; then
++    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
++      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
++       and declares uintmax_t. ])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/inttypes.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/inttypes.m4	2004-09-12 14:40:34.861671176 -0400
+@@ -0,0 +1,27 @@
++# inttypes.m4 serial 1 (gettext-0.11.4)
++dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
++# <sys/types.h>.
++
++AC_DEFUN([gt_HEADER_INTTYPES_H],
++[
++  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
++  [
++    AC_TRY_COMPILE(
++      [#include <sys/types.h>
++#include <inttypes.h>],
++      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
++  ])
++  if test $gt_cv_header_inttypes_h = yes; then
++    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
++      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/inttypes-pri.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/inttypes-pri.m4	2004-09-12 14:40:34.874669200 -0400
+@@ -0,0 +1,32 @@
++# inttypes-pri.m4 serial 1 (gettext-0.11.4)
++dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
++# macros to non-string values.  This is the case on AIX 4.3.3.
++
++AC_DEFUN([gt_INTTYPES_PRI],
++[
++  AC_REQUIRE([gt_HEADER_INTTYPES_H])
++  if test $gt_cv_header_inttypes_h = yes; then
++    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
++      gt_cv_inttypes_pri_broken,
++      [
++        AC_TRY_COMPILE([#include <inttypes.h>
++#ifdef PRId32
++char *p = PRId32;
++#endif
++], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
++      ])
++  fi
++  if test "$gt_cv_inttypes_pri_broken" = yes; then
++    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
++      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/isc-posix.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/isc-posix.m4	2004-09-12 14:40:34.885667528 -0400
+@@ -0,0 +1,26 @@
++# isc-posix.m4 serial 2 (gettext-0.11.2)
++dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
++
++# This test replaces the one in autoconf.
++# Currently this macro should have the same name as the autoconf macro
++# because gettext's gettext.m4 (distributed in the automake package)
++# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
++# give these diagnostics:
++#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
++#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
++
++undefine([AC_ISC_POSIX])
++
++AC_DEFUN([AC_ISC_POSIX],
++  [
++    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
++    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
++  ]
++)
+--- lrzsz-0.12.20.safe/m4/lcmessage.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/lcmessage.m4	2004-09-12 14:40:34.902664944 -0400
+@@ -0,0 +1,32 @@
++# lcmessage.m4 serial 3 (gettext-0.11.3)
++dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
++
++# Check whether LC_MESSAGES is available in <locale.h>.
++
++AC_DEFUN([AM_LC_MESSAGES],
++[
++  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
++    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
++       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
++  if test $am_cv_val_LC_MESSAGES = yes; then
++    AC_DEFINE(HAVE_LC_MESSAGES, 1,
++      [Define if your <locale.h> file defines LC_MESSAGES.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/lib-ld.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/lib-ld.m4	2004-09-12 14:40:34.908664032 -0400
+@@ -0,0 +1,112 @@
++# lib-ld.m4 serial 3 (gettext-0.13)
++dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl Subroutines of libtool.m4,
++dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
++dnl with libtool.m4.
++
++dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
++AC_DEFUN([AC_LIB_PROG_LD_GNU],
++[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
++[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
++case `$LD -v 2>&1 </dev/null` in
++*GNU* | *'with BFD'*)
++  acl_cv_prog_gnu_ld=yes ;;
++*)
++  acl_cv_prog_gnu_ld=no ;;
++esac])
++with_gnu_ld=$acl_cv_prog_gnu_ld
++])
++
++dnl From libtool-1.4. Sets the variable LD.
++AC_DEFUN([AC_LIB_PROG_LD],
++[AC_ARG_WITH(gnu-ld,
++[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
++test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
++AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_CANONICAL_HOST])dnl
++# Prepare PATH_SEPARATOR.
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++  echo "#! /bin/sh" >conf$$.sh
++  echo  "exit 0"   >>conf$$.sh
++  chmod +x conf$$.sh
++  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++    PATH_SEPARATOR=';'
++  else
++    PATH_SEPARATOR=:
++  fi
++  rm -f conf$$.sh
++fi
++ac_prog=ld
++if test "$GCC" = yes; then
++  # Check if gcc -print-prog-name=ld gives a path.
++  AC_MSG_CHECKING([for ld used by GCC])
++  case $host in
++  *-*-mingw*)
++    # gcc leaves a trailing carriage return which upsets mingw
++    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
++  *)
++    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
++  esac
++  case $ac_prog in
++    # Accept absolute paths.
++    [[\\/]* | [A-Za-z]:[\\/]*)]
++      [re_direlt='/[^/][^/]*/\.\./']
++      # Canonicalize the path of ld
++      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
++      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
++	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
++      done
++      test -z "$LD" && LD="$ac_prog"
++      ;;
++  "")
++    # If it fails, then pretend we aren't using GCC.
++    ac_prog=ld
++    ;;
++  *)
++    # If it is relative, then search for the first ld in PATH.
++    with_gnu_ld=unknown
++    ;;
++  esac
++elif test "$with_gnu_ld" = yes; then
++  AC_MSG_CHECKING([for GNU ld])
++else
++  AC_MSG_CHECKING([for non-GNU ld])
++fi
++AC_CACHE_VAL(acl_cv_path_LD,
++[if test -z "$LD"; then
++  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++  for ac_dir in $PATH; do
++    test -z "$ac_dir" && ac_dir=.
++    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
++      acl_cv_path_LD="$ac_dir/$ac_prog"
++      # Check to see if the program is GNU ld.  I'd rather use --version,
++      # but apparently some GNU ld's only accept -v.
++      # Break only if it was the GNU/non-GNU ld that we prefer.
++      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
++      *GNU* | *'with BFD'*)
++	test "$with_gnu_ld" != no && break ;;
++      *)
++	test "$with_gnu_ld" != yes && break ;;
++      esac
++    fi
++  done
++  IFS="$ac_save_ifs"
++else
++  acl_cv_path_LD="$LD" # Let the user override the test with a path.
++fi])
++LD="$acl_cv_path_LD"
++if test -n "$LD"; then
++  AC_MSG_RESULT($LD)
++else
++  AC_MSG_RESULT(no)
++fi
++test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
++AC_LIB_PROG_LD_GNU
++])
+--- lrzsz-0.12.20.safe/m4/lib-link.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/lib-link.m4	2004-09-12 14:40:34.914663120 -0400
+@@ -0,0 +1,551 @@
++# lib-link.m4 serial 4 (gettext-0.12)
++dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
++dnl the libraries corresponding to explicit and implicit dependencies.
++dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
++dnl augments the CPPFLAGS variable.
++AC_DEFUN([AC_LIB_LINKFLAGS],
++[
++  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++  AC_REQUIRE([AC_LIB_RPATH])
++  define([Name],[translit([$1],[./-], [___])])
++  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
++    AC_LIB_LINKFLAGS_BODY([$1], [$2])
++    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
++    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
++    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
++  ])
++  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
++  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
++  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
++  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
++  AC_SUBST([LIB]NAME)
++  AC_SUBST([LTLIB]NAME)
++  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
++  dnl results of this search when this library appears as a dependency.
++  HAVE_LIB[]NAME=yes
++  undefine([Name])
++  undefine([NAME])
++])
++
++dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
++dnl searches for libname and the libraries corresponding to explicit and
++dnl implicit dependencies, together with the specified include files and
++dnl the ability to compile and link the specified testcode. If found, it
++dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
++dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
++dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
++dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
++AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
++[
++  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++  AC_REQUIRE([AC_LIB_RPATH])
++  define([Name],[translit([$1],[./-], [___])])
++  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++
++  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
++  dnl accordingly.
++  AC_LIB_LINKFLAGS_BODY([$1], [$2])
++
++  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
++  dnl because if the user has installed lib[]Name and not disabled its use
++  dnl via --without-lib[]Name-prefix, he wants to use it.
++  ac_save_CPPFLAGS="$CPPFLAGS"
++  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
++
++  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
++    ac_save_LIBS="$LIBS"
++    LIBS="$LIBS $LIB[]NAME"
++    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
++    LIBS="$ac_save_LIBS"
++  ])
++  if test "$ac_cv_lib[]Name" = yes; then
++    HAVE_LIB[]NAME=yes
++    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
++    AC_MSG_CHECKING([how to link with lib[]$1])
++    AC_MSG_RESULT([$LIB[]NAME])
++  else
++    HAVE_LIB[]NAME=no
++    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
++    dnl $INC[]NAME either.
++    CPPFLAGS="$ac_save_CPPFLAGS"
++    LIB[]NAME=
++    LTLIB[]NAME=
++  fi
++  AC_SUBST([HAVE_LIB]NAME)
++  AC_SUBST([LIB]NAME)
++  AC_SUBST([LTLIB]NAME)
++  undefine([Name])
++  undefine([NAME])
++])
++
++dnl Determine the platform dependent parameters needed to use rpath:
++dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
++dnl hardcode_direct, hardcode_minus_L.
++AC_DEFUN([AC_LIB_RPATH],
++[
++  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
++  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
++  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
++  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
++  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
++    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
++    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
++    . ./conftest.sh
++    rm -f ./conftest.sh
++    acl_cv_rpath=done
++  ])
++  wl="$acl_cv_wl"
++  libext="$acl_cv_libext"
++  shlibext="$acl_cv_shlibext"
++  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
++  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
++  hardcode_direct="$acl_cv_hardcode_direct"
++  hardcode_minus_L="$acl_cv_hardcode_minus_L"
++  dnl Determine whether the user wants rpath handling at all.
++  AC_ARG_ENABLE(rpath,
++    [  --disable-rpath         do not hardcode runtime library paths],
++    :, enable_rpath=yes)
++])
++
++dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
++dnl the libraries corresponding to explicit and implicit dependencies.
++dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
++AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
++[
++  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++  dnl By default, look in $includedir and $libdir.
++  use_additional=yes
++  AC_LIB_WITH_FINAL_PREFIX([
++    eval additional_includedir=\"$includedir\"
++    eval additional_libdir=\"$libdir\"
++  ])
++  AC_LIB_ARG_WITH([lib$1-prefix],
++[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
++  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
++[
++    if test "X$withval" = "Xno"; then
++      use_additional=no
++    else
++      if test "X$withval" = "X"; then
++        AC_LIB_WITH_FINAL_PREFIX([
++          eval additional_includedir=\"$includedir\"
++          eval additional_libdir=\"$libdir\"
++        ])
++      else
++        additional_includedir="$withval/include"
++        additional_libdir="$withval/lib"
++      fi
++    fi
++])
++  dnl Search the library and its dependencies in $additional_libdir and
++  dnl $LDFLAGS. Using breadth-first-seach.
++  LIB[]NAME=
++  LTLIB[]NAME=
++  INC[]NAME=
++  rpathdirs=
++  ltrpathdirs=
++  names_already_handled=
++  names_next_round='$1 $2'
++  while test -n "$names_next_round"; do
++    names_this_round="$names_next_round"
++    names_next_round=
++    for name in $names_this_round; do
++      already_handled=
++      for n in $names_already_handled; do
++        if test "$n" = "$name"; then
++          already_handled=yes
++          break
++        fi
++      done
++      if test -z "$already_handled"; then
++        names_already_handled="$names_already_handled $name"
++        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
++        dnl or AC_LIB_HAVE_LINKFLAGS call.
++        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
++        eval value=\"\$HAVE_LIB$uppername\"
++        if test -n "$value"; then
++          if test "$value" = yes; then
++            eval value=\"\$LIB$uppername\"
++            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
++            eval value=\"\$LTLIB$uppername\"
++            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
++          else
++            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
++            dnl that this library doesn't exist. So just drop it.
++            :
++          fi
++        else
++          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
++          dnl and the already constructed $LIBNAME/$LTLIBNAME.
++          found_dir=
++          found_la=
++          found_so=
++          found_a=
++          if test $use_additional = yes; then
++            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
++              found_dir="$additional_libdir"
++              found_so="$additional_libdir/lib$name.$shlibext"
++              if test -f "$additional_libdir/lib$name.la"; then
++                found_la="$additional_libdir/lib$name.la"
++              fi
++            else
++              if test -f "$additional_libdir/lib$name.$libext"; then
++                found_dir="$additional_libdir"
++                found_a="$additional_libdir/lib$name.$libext"
++                if test -f "$additional_libdir/lib$name.la"; then
++                  found_la="$additional_libdir/lib$name.la"
++                fi
++              fi
++            fi
++          fi
++          if test "X$found_dir" = "X"; then
++            for x in $LDFLAGS $LTLIB[]NAME; do
++              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++              case "$x" in
++                -L*)
++                  dir=`echo "X$x" | sed -e 's/^X-L//'`
++                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
++                    found_dir="$dir"
++                    found_so="$dir/lib$name.$shlibext"
++                    if test -f "$dir/lib$name.la"; then
++                      found_la="$dir/lib$name.la"
++                    fi
++                  else
++                    if test -f "$dir/lib$name.$libext"; then
++                      found_dir="$dir"
++                      found_a="$dir/lib$name.$libext"
++                      if test -f "$dir/lib$name.la"; then
++                        found_la="$dir/lib$name.la"
++                      fi
++                    fi
++                  fi
++                  ;;
++              esac
++              if test "X$found_dir" != "X"; then
++                break
++              fi
++            done
++          fi
++          if test "X$found_dir" != "X"; then
++            dnl Found the library.
++            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
++            if test "X$found_so" != "X"; then
++              dnl Linking with a shared library. We attempt to hardcode its
++              dnl directory into the executable's runpath, unless it's the
++              dnl standard /usr/lib.
++              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
++                dnl No hardcoding is needed.
++                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++              else
++                dnl Use an explicit option to hardcode DIR into the resulting
++                dnl binary.
++                dnl Potentially add DIR to ltrpathdirs.
++                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
++                haveit=
++                for x in $ltrpathdirs; do
++                  if test "X$x" = "X$found_dir"; then
++                    haveit=yes
++                    break
++                  fi
++                done
++                if test -z "$haveit"; then
++                  ltrpathdirs="$ltrpathdirs $found_dir"
++                fi
++                dnl The hardcoding into $LIBNAME is system dependent.
++                if test "$hardcode_direct" = yes; then
++                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
++                  dnl resulting binary.
++                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++                else
++                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
++                    dnl Use an explicit option to hardcode DIR into the resulting
++                    dnl binary.
++                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++                    dnl Potentially add DIR to rpathdirs.
++                    dnl The rpathdirs will be appended to $LIBNAME at the end.
++                    haveit=
++                    for x in $rpathdirs; do
++                      if test "X$x" = "X$found_dir"; then
++                        haveit=yes
++                        break
++                      fi
++                    done
++                    if test -z "$haveit"; then
++                      rpathdirs="$rpathdirs $found_dir"
++                    fi
++                  else
++                    dnl Rely on "-L$found_dir".
++                    dnl But don't add it if it's already contained in the LDFLAGS
++                    dnl or the already constructed $LIBNAME
++                    haveit=
++                    for x in $LDFLAGS $LIB[]NAME; do
++                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++                      if test "X$x" = "X-L$found_dir"; then
++                        haveit=yes
++                        break
++                      fi
++                    done
++                    if test -z "$haveit"; then
++                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
++                    fi
++                    if test "$hardcode_minus_L" != no; then
++                      dnl FIXME: Not sure whether we should use
++                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
++                      dnl here.
++                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++                    else
++                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
++                      dnl here, because this doesn't fit in flags passed to the
++                      dnl compiler. So give up. No hardcoding. This affects only
++                      dnl very old systems.
++                      dnl FIXME: Not sure whether we should use
++                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
++                      dnl here.
++                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
++                    fi
++                  fi
++                fi
++              fi
++            else
++              if test "X$found_a" != "X"; then
++                dnl Linking with a static library.
++                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
++              else
++                dnl We shouldn't come here, but anyway it's good to have a
++                dnl fallback.
++                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
++              fi
++            fi
++            dnl Assume the include files are nearby.
++            additional_includedir=
++            case "$found_dir" in
++              */lib | */lib/)
++                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
++                additional_includedir="$basedir/include"
++                ;;
++            esac
++            if test "X$additional_includedir" != "X"; then
++              dnl Potentially add $additional_includedir to $INCNAME.
++              dnl But don't add it
++              dnl   1. if it's the standard /usr/include,
++              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
++              dnl   3. if it's already present in $CPPFLAGS or the already
++              dnl      constructed $INCNAME,
++              dnl   4. if it doesn't exist as a directory.
++              if test "X$additional_includedir" != "X/usr/include"; then
++                haveit=
++                if test "X$additional_includedir" = "X/usr/local/include"; then
++                  if test -n "$GCC"; then
++                    case $host_os in
++                      linux*) haveit=yes;;
++                    esac
++                  fi
++                fi
++                if test -z "$haveit"; then
++                  for x in $CPPFLAGS $INC[]NAME; do
++                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++                    if test "X$x" = "X-I$additional_includedir"; then
++                      haveit=yes
++                      break
++                    fi
++                  done
++                  if test -z "$haveit"; then
++                    if test -d "$additional_includedir"; then
++                      dnl Really add $additional_includedir to $INCNAME.
++                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
++                    fi
++                  fi
++                fi
++              fi
++            fi
++            dnl Look for dependencies.
++            if test -n "$found_la"; then
++              dnl Read the .la file. It defines the variables
++              dnl dlname, library_names, old_library, dependency_libs, current,
++              dnl age, revision, installed, dlopen, dlpreopen, libdir.
++              save_libdir="$libdir"
++              case "$found_la" in
++                */* | *\\*) . "$found_la" ;;
++                *) . "./$found_la" ;;
++              esac
++              libdir="$save_libdir"
++              dnl We use only dependency_libs.
++              for dep in $dependency_libs; do
++                case "$dep" in
++                  -L*)
++                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
++                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
++                    dnl But don't add it
++                    dnl   1. if it's the standard /usr/lib,
++                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
++                    dnl   3. if it's already present in $LDFLAGS or the already
++                    dnl      constructed $LIBNAME,
++                    dnl   4. if it doesn't exist as a directory.
++                    if test "X$additional_libdir" != "X/usr/lib"; then
++                      haveit=
++                      if test "X$additional_libdir" = "X/usr/local/lib"; then
++                        if test -n "$GCC"; then
++                          case $host_os in
++                            linux*) haveit=yes;;
++                          esac
++                        fi
++                      fi
++                      if test -z "$haveit"; then
++                        haveit=
++                        for x in $LDFLAGS $LIB[]NAME; do
++                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++                          if test "X$x" = "X-L$additional_libdir"; then
++                            haveit=yes
++                            break
++                          fi
++                        done
++                        if test -z "$haveit"; then
++                          if test -d "$additional_libdir"; then
++                            dnl Really add $additional_libdir to $LIBNAME.
++                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
++                          fi
++                        fi
++                        haveit=
++                        for x in $LDFLAGS $LTLIB[]NAME; do
++                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++                          if test "X$x" = "X-L$additional_libdir"; then
++                            haveit=yes
++                            break
++                          fi
++                        done
++                        if test -z "$haveit"; then
++                          if test -d "$additional_libdir"; then
++                            dnl Really add $additional_libdir to $LTLIBNAME.
++                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
++                          fi
++                        fi
++                      fi
++                    fi
++                    ;;
++                  -R*)
++                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
++                    if test "$enable_rpath" != no; then
++                      dnl Potentially add DIR to rpathdirs.
++                      dnl The rpathdirs will be appended to $LIBNAME at the end.
++                      haveit=
++                      for x in $rpathdirs; do
++                        if test "X$x" = "X$dir"; then
++                          haveit=yes
++                          break
++                        fi
++                      done
++                      if test -z "$haveit"; then
++                        rpathdirs="$rpathdirs $dir"
++                      fi
++                      dnl Potentially add DIR to ltrpathdirs.
++                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
++                      haveit=
++                      for x in $ltrpathdirs; do
++                        if test "X$x" = "X$dir"; then
++                          haveit=yes
++                          break
++                        fi
++                      done
++                      if test -z "$haveit"; then
++                        ltrpathdirs="$ltrpathdirs $dir"
++                      fi
++                    fi
++                    ;;
++                  -l*)
++                    dnl Handle this in the next round.
++                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
++                    ;;
++                  *.la)
++                    dnl Handle this in the next round. Throw away the .la's
++                    dnl directory; it is already contained in a preceding -L
++                    dnl option.
++                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
++                    ;;
++                  *)
++                    dnl Most likely an immediate library name.
++                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
++                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
++                    ;;
++                esac
++              done
++            fi
++          else
++            dnl Didn't find the library; assume it is in the system directories
++            dnl known to the linker and runtime loader. (All the system
++            dnl directories known to the linker should also be known to the
++            dnl runtime loader, otherwise the system is severely misconfigured.)
++            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
++            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
++          fi
++        fi
++      fi
++    done
++  done
++  if test "X$rpathdirs" != "X"; then
++    if test -n "$hardcode_libdir_separator"; then
++      dnl Weird platform: only the last -rpath option counts, the user must
++      dnl pass all path elements in one option. We can arrange that for a
++      dnl single library, but not when more than one $LIBNAMEs are used.
++      alldirs=
++      for found_dir in $rpathdirs; do
++        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
++      done
++      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
++      acl_save_libdir="$libdir"
++      libdir="$alldirs"
++      eval flag=\"$hardcode_libdir_flag_spec\"
++      libdir="$acl_save_libdir"
++      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
++    else
++      dnl The -rpath options are cumulative.
++      for found_dir in $rpathdirs; do
++        acl_save_libdir="$libdir"
++        libdir="$found_dir"
++        eval flag=\"$hardcode_libdir_flag_spec\"
++        libdir="$acl_save_libdir"
++        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
++      done
++    fi
++  fi
++  if test "X$ltrpathdirs" != "X"; then
++    dnl When using libtool, the option that works for both libraries and
++    dnl executables is -R. The -R options are cumulative.
++    for found_dir in $ltrpathdirs; do
++      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
++    done
++  fi
++])
++
++dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
++dnl unless already present in VAR.
++dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
++dnl contains two or three consecutive elements that belong together.
++AC_DEFUN([AC_LIB_APPENDTOVAR],
++[
++  for element in [$2]; do
++    haveit=
++    for x in $[$1]; do
++      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++      if test "X$x" = "X$element"; then
++        haveit=yes
++        break
++      fi
++    done
++    if test -z "$haveit"; then
++      [$1]="${[$1]}${[$1]:+ }$element"
++    fi
++  done
++])
+--- lrzsz-0.12.20.safe/m4/lib-prefix.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/lib-prefix.m4	2004-09-12 14:40:34.921662056 -0400
+@@ -0,0 +1,155 @@
++# lib-prefix.m4 serial 3 (gettext-0.13)
++dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
++dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
++dnl require excessive bracketing.
++ifdef([AC_HELP_STRING],
++[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
++[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
++
++dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
++dnl to access previously installed libraries. The basic assumption is that
++dnl a user will want packages to use other packages he previously installed
++dnl with the same --prefix option.
++dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
++dnl libraries, but is otherwise very convenient.
++AC_DEFUN([AC_LIB_PREFIX],
++[
++  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
++  AC_REQUIRE([AC_PROG_CC])
++  AC_REQUIRE([AC_CANONICAL_HOST])
++  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++  dnl By default, look in $includedir and $libdir.
++  use_additional=yes
++  AC_LIB_WITH_FINAL_PREFIX([
++    eval additional_includedir=\"$includedir\"
++    eval additional_libdir=\"$libdir\"
++  ])
++  AC_LIB_ARG_WITH([lib-prefix],
++[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
++  --without-lib-prefix    don't search for libraries in includedir and libdir],
++[
++    if test "X$withval" = "Xno"; then
++      use_additional=no
++    else
++      if test "X$withval" = "X"; then
++        AC_LIB_WITH_FINAL_PREFIX([
++          eval additional_includedir=\"$includedir\"
++          eval additional_libdir=\"$libdir\"
++        ])
++      else
++        additional_includedir="$withval/include"
++        additional_libdir="$withval/lib"
++      fi
++    fi
++])
++  if test $use_additional = yes; then
++    dnl Potentially add $additional_includedir to $CPPFLAGS.
++    dnl But don't add it
++    dnl   1. if it's the standard /usr/include,
++    dnl   2. if it's already present in $CPPFLAGS,
++    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
++    dnl   4. if it doesn't exist as a directory.
++    if test "X$additional_includedir" != "X/usr/include"; then
++      haveit=
++      for x in $CPPFLAGS; do
++        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++        if test "X$x" = "X-I$additional_includedir"; then
++          haveit=yes
++          break
++        fi
++      done
++      if test -z "$haveit"; then
++        if test "X$additional_includedir" = "X/usr/local/include"; then
++          if test -n "$GCC"; then
++            case $host_os in
++              linux*) haveit=yes;;
++            esac
++          fi
++        fi
++        if test -z "$haveit"; then
++          if test -d "$additional_includedir"; then
++            dnl Really add $additional_includedir to $CPPFLAGS.
++            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
++          fi
++        fi
++      fi
++    fi
++    dnl Potentially add $additional_libdir to $LDFLAGS.
++    dnl But don't add it
++    dnl   1. if it's the standard /usr/lib,
++    dnl   2. if it's already present in $LDFLAGS,
++    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
++    dnl   4. if it doesn't exist as a directory.
++    if test "X$additional_libdir" != "X/usr/lib"; then
++      haveit=
++      for x in $LDFLAGS; do
++        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++        if test "X$x" = "X-L$additional_libdir"; then
++          haveit=yes
++          break
++        fi
++      done
++      if test -z "$haveit"; then
++        if test "X$additional_libdir" = "X/usr/local/lib"; then
++          if test -n "$GCC"; then
++            case $host_os in
++              linux*) haveit=yes;;
++            esac
++          fi
++        fi
++        if test -z "$haveit"; then
++          if test -d "$additional_libdir"; then
++            dnl Really add $additional_libdir to $LDFLAGS.
++            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
++          fi
++        fi
++      fi
++    fi
++  fi
++])
++
++dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
++dnl acl_final_exec_prefix, containing the values to which $prefix and
++dnl $exec_prefix will expand at the end of the configure script.
++AC_DEFUN([AC_LIB_PREPARE_PREFIX],
++[
++  dnl Unfortunately, prefix and exec_prefix get only finally determined
++  dnl at the end of configure.
++  if test "X$prefix" = "XNONE"; then
++    acl_final_prefix="$ac_default_prefix"
++  else
++    acl_final_prefix="$prefix"
++  fi
++  if test "X$exec_prefix" = "XNONE"; then
++    acl_final_exec_prefix='${prefix}'
++  else
++    acl_final_exec_prefix="$exec_prefix"
++  fi
++  acl_save_prefix="$prefix"
++  prefix="$acl_final_prefix"
++  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
++  prefix="$acl_save_prefix"
++])
++
++dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
++dnl variables prefix and exec_prefix bound to the values they will have
++dnl at the end of the configure script.
++AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
++[
++  acl_save_prefix="$prefix"
++  prefix="$acl_final_prefix"
++  acl_save_exec_prefix="$exec_prefix"
++  exec_prefix="$acl_final_exec_prefix"
++  $1
++  exec_prefix="$acl_save_exec_prefix"
++  prefix="$acl_save_prefix"
++])
+--- lrzsz-0.12.20.safe/m4/longdouble.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/longdouble.m4	2004-09-12 14:40:34.942658864 -0400
+@@ -0,0 +1,30 @@
++# longdouble.m4 serial 1 (gettext-0.12)
++dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++dnl Test whether the compiler supports the 'long double' type.
++dnl Prerequisite: AC_PROG_CC
++
++AC_DEFUN([gt_TYPE_LONGDOUBLE],
++[
++  AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
++    [if test "$GCC" = yes; then
++       gt_cv_c_long_double=yes
++     else
++       AC_TRY_COMPILE([
++         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
++         long double foo = 0.0;
++         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
++         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
++         ], ,
++         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
++     fi])
++  if test $gt_cv_c_long_double = yes; then
++    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/longlong.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/longlong.m4	2004-09-12 14:40:34.949657800 -0400
+@@ -0,0 +1,25 @@
++# longlong.m4 serial 4
++dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_LONG_LONG if 'long long' works.
++
++AC_DEFUN([jm_AC_TYPE_LONG_LONG],
++[
++  AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
++  [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
++    [long long llmax = (long long) -1;
++     return ll << i | ll >> i | llmax / ll | llmax % ll;],
++    ac_cv_type_long_long=yes,
++    ac_cv_type_long_long=no)])
++  if test $ac_cv_type_long_long = yes; then
++    AC_DEFINE(HAVE_LONG_LONG, 1,
++      [Define if you have the 'long long' type.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/Makefile.am	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/Makefile.am	2004-09-12 14:40:35.048642752 -0400
+@@ -0,0 +1 @@
++EXTRA_DIST = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 intmax.m4 inttypes.m4 inttypes_h.m4 inttypes-pri.m4 isc-posix.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 longdouble.m4 longlong.m4 nls.m4 po.m4 printf-posix.m4 progtest.m4 signed.m4 size_max.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4 wchar_t.m4 wint_t.m4 xsize.m4
+--- lrzsz-0.12.20.safe/m4/nls.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/nls.m4	2004-09-12 14:40:34.955656888 -0400
+@@ -0,0 +1,49 @@
++# nls.m4 serial 1 (gettext-0.12)
++dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
++dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
++
++AC_DEFUN([AM_NLS],
++[
++  AC_MSG_CHECKING([whether NLS is requested])
++  dnl Default is enabled NLS
++  AC_ARG_ENABLE(nls,
++    [  --disable-nls           do not use Native Language Support],
++    USE_NLS=$enableval, USE_NLS=yes)
++  AC_MSG_RESULT($USE_NLS)
++  AC_SUBST(USE_NLS)
++])
++
++AC_DEFUN([AM_MKINSTALLDIRS],
++[
++  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
++  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
++  dnl Try to locate it.
++  MKINSTALLDIRS=
++  if test -n "$ac_aux_dir"; then
++    case "$ac_aux_dir" in
++      /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
++      *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
++    esac
++  fi
++  if test -z "$MKINSTALLDIRS"; then
++    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
++  fi
++  AC_SUBST(MKINSTALLDIRS)
++])
+--- lrzsz-0.12.20.safe/m4/po.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/po.m4	2004-09-12 14:40:34.961655976 -0400
+@@ -0,0 +1,426 @@
++# po.m4 serial 3 (gettext-0.14)
++dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
++dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
++
++dnl Checks for all prerequisites of the po subdirectory.
++AC_DEFUN([AM_PO_SUBDIRS],
++[
++  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
++  AC_REQUIRE([AC_PROG_INSTALL])dnl
++  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
++  AC_REQUIRE([AM_NLS])dnl
++
++  dnl Perform the following tests also if --disable-nls has been given,
++  dnl because they are needed for "make dist" to work.
++
++  dnl Search for GNU msgfmt in the PATH.
++  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
++  dnl The second test excludes FreeBSD msgfmt.
++  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
++    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
++     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
++    :)
++  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
++
++  dnl Search for GNU xgettext 0.12 or newer in the PATH.
++  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
++  dnl The second test excludes FreeBSD xgettext.
++  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
++    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
++     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
++    :)
++  dnl Remove leftover from FreeBSD xgettext call.
++  rm -f messages.po
++
++  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
++  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
++    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
++
++  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
++  dnl Test whether we really found GNU msgfmt.
++  if test "$GMSGFMT" != ":"; then
++    dnl If it is no GNU msgfmt we define it as : so that the
++    dnl Makefiles still can work.
++    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
++       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
++      : ;
++    else
++      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
++      AC_MSG_RESULT(
++        [found $GMSGFMT program is not GNU msgfmt; ignore it])
++      GMSGFMT=":"
++    fi
++  fi
++
++  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
++  dnl Test whether we really found GNU xgettext.
++  if test "$XGETTEXT" != ":"; then
++    dnl If it is no GNU xgettext we define it as : so that the
++    dnl Makefiles still can work.
++    if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
++       (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
++      : ;
++    else
++      AC_MSG_RESULT(
++        [found xgettext program is not GNU xgettext; ignore it])
++      XGETTEXT=":"
++    fi
++    dnl Remove leftover from FreeBSD xgettext call.
++    rm -f messages.po
++  fi
++
++  AC_OUTPUT_COMMANDS([
++    for ac_file in $CONFIG_FILES; do
++      # Support "outfile[:infile[:infile...]]"
++      case "$ac_file" in
++        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
++      esac
++      # PO directories have a Makefile.in generated from Makefile.in.in.
++      case "$ac_file" in */Makefile.in)
++        # Adjust a relative srcdir.
++        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
++        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
++        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
++        # In autoconf-2.13 it is called $ac_given_srcdir.
++        # In autoconf-2.50 it is called $srcdir.
++        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
++        case "$ac_given_srcdir" in
++          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
++          /*) top_srcdir="$ac_given_srcdir" ;;
++          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
++        esac
++        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
++          rm -f "$ac_dir/POTFILES"
++          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
++          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ 	]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
++          POMAKEFILEDEPS="POTFILES.in"
++          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
++          # on $ac_dir but don't depend on user-specified configuration
++          # parameters.
++          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
++            # The LINGUAS file contains the set of available languages.
++            if test -n "$OBSOLETE_ALL_LINGUAS"; then
++              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
++            fi
++            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
++            # Hide the ALL_LINGUAS assigment from automake.
++            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
++            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
++          else
++            # The set of available languages was given in configure.in.
++            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
++          fi
++          # Compute POFILES
++          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
++          # Compute UPDATEPOFILES
++          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
++          # Compute DUMMYPOFILES
++          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
++          # Compute GMOFILES
++          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
++          case "$ac_given_srcdir" in
++            .) srcdirpre= ;;
++            *) srcdirpre='$(srcdir)/' ;;
++          esac
++          POFILES=
++          UPDATEPOFILES=
++          DUMMYPOFILES=
++          GMOFILES=
++          for lang in $ALL_LINGUAS; do
++            POFILES="$POFILES $srcdirpre$lang.po"
++            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
++            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
++            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
++          done
++          # CATALOGS depends on both $ac_dir and the user's LINGUAS
++          # environment variable.
++          INST_LINGUAS=
++          if test -n "$ALL_LINGUAS"; then
++            for presentlang in $ALL_LINGUAS; do
++              useit=no
++              if test "%UNSET%" != "$LINGUAS"; then
++                desiredlanguages="$LINGUAS"
++              else
++                desiredlanguages="$ALL_LINGUAS"
++              fi
++              for desiredlang in $desiredlanguages; do
++                # Use the presentlang catalog if desiredlang is
++                #   a. equal to presentlang, or
++                #   b. a variant of presentlang (because in this case,
++                #      presentlang can be used as a fallback for messages
++                #      which are not translated in the desiredlang catalog).
++                case "$desiredlang" in
++                  "$presentlang"*) useit=yes;;
++                esac
++              done
++              if test $useit = yes; then
++                INST_LINGUAS="$INST_LINGUAS $presentlang"
++              fi
++            done
++          fi
++          CATALOGS=
++          if test -n "$INST_LINGUAS"; then
++            for lang in $INST_LINGUAS; do
++              CATALOGS="$CATALOGS $lang.gmo"
++            done
++          fi
++          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
++          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
++          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
++            if test -f "$f"; then
++              case "$f" in
++                *.orig | *.bak | *~) ;;
++                *) cat "$f" >> "$ac_dir/Makefile" ;;
++              esac
++            fi
++          done
++        fi
++        ;;
++      esac
++    done],
++   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
++    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
++    # from automake.
++    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
++    # Capture the value of LINGUAS because we need it to compute CATALOGS.
++    LINGUAS="${LINGUAS-%UNSET%}"
++   ])
++])
++
++dnl Postprocesses a Makefile in a directory containing PO files.
++AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
++[
++  # When this code is run, in config.status, two variables have already been
++  # set:
++  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
++  # - LINGUAS is the value of the environment variable LINGUAS at configure
++  #   time.
++
++changequote(,)dnl
++  # Adjust a relative srcdir.
++  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
++  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
++  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
++  # In autoconf-2.13 it is called $ac_given_srcdir.
++  # In autoconf-2.50 it is called $srcdir.
++  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
++  case "$ac_given_srcdir" in
++    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
++    /*) top_srcdir="$ac_given_srcdir" ;;
++    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
++  esac
++
++  # Find a way to echo strings without interpreting backslash.
++  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
++    gt_echo='echo'
++  else
++    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
++      gt_echo='printf %s\n'
++    else
++      echo_func () {
++        cat <<EOT
++$*
++EOT
++      }
++      gt_echo='echo_func'
++    fi
++  fi
++
++  # A sed script that extracts the value of VARIABLE from a Makefile.
++  sed_x_variable='
++# Test if the hold space is empty.
++x
++s/P/P/
++x
++ta
++# Yes it was empty. Look if we have the expected variable definition.
++/^[	 ]*VARIABLE[	 ]*=/{
++  # Seen the first line of the variable definition.
++  s/^[	 ]*VARIABLE[	 ]*=//
++  ba
++}
++bd
++:a
++# Here we are processing a line from the variable definition.
++# Remove comment, more precisely replace it with a space.
++s/#.*$/ /
++# See if the line ends in a backslash.
++tb
++:b
++s/\\$//
++# Print the line, without the trailing backslash.
++p
++tc
++# There was no trailing backslash. The end of the variable definition is
++# reached. Clear the hold space.
++s/^.*$//
++x
++bd
++:c
++# A trailing backslash means that the variable definition continues in the
++# next line. Put a nonempty string into the hold space to indicate this.
++s/^.*$/P/
++x
++:d
++'
++changequote([,])dnl
++
++  # Set POTFILES to the value of the Makefile variable POTFILES.
++  sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
++  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
++  # Compute POTFILES_DEPS as
++  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
++  POTFILES_DEPS=
++  for file in $POTFILES; do
++    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
++  done
++  POMAKEFILEDEPS=""
++
++  if test -n "$OBSOLETE_ALL_LINGUAS"; then
++    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
++  fi
++  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
++    # The LINGUAS file contains the set of available languages.
++    ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
++    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
++  else
++    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
++    sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
++    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
++  fi
++  # Hide the ALL_LINGUAS assigment from automake.
++  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
++  # Compute POFILES
++  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
++  # Compute UPDATEPOFILES
++  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
++  # Compute DUMMYPOFILES
++  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
++  # Compute GMOFILES
++  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
++  # Compute PROPERTIESFILES
++  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
++  # Compute CLASSFILES
++  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
++  # Compute QMFILES
++  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
++  # Compute MSGFILES
++  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
++  # Compute RESOURCESDLLFILES
++  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
++  case "$ac_given_srcdir" in
++    .) srcdirpre= ;;
++    *) srcdirpre='$(srcdir)/' ;;
++  esac
++  POFILES=
++  UPDATEPOFILES=
++  DUMMYPOFILES=
++  GMOFILES=
++  PROPERTIESFILES=
++  CLASSFILES=
++  QMFILES=
++  MSGFILES=
++  RESOURCESDLLFILES=
++  for lang in $ALL_LINGUAS; do
++    POFILES="$POFILES $srcdirpre$lang.po"
++    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
++    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
++    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
++    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
++    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
++    QMFILES="$QMFILES $srcdirpre$lang.qm"
++    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
++    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
++    frobbedlang=`echo $lang | sed -e 's/_/-/g'`
++    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
++  done
++  # CATALOGS depends on both $ac_dir and the user's LINGUAS
++  # environment variable.
++  INST_LINGUAS=
++  if test -n "$ALL_LINGUAS"; then
++    for presentlang in $ALL_LINGUAS; do
++      useit=no
++      if test "%UNSET%" != "$LINGUAS"; then
++        desiredlanguages="$LINGUAS"
++      else
++        desiredlanguages="$ALL_LINGUAS"
++      fi
++      for desiredlang in $desiredlanguages; do
++        # Use the presentlang catalog if desiredlang is
++        #   a. equal to presentlang, or
++        #   b. a variant of presentlang (because in this case,
++        #      presentlang can be used as a fallback for messages
++        #      which are not translated in the desiredlang catalog).
++        case "$desiredlang" in
++          "$presentlang"*) useit=yes;;
++        esac
++      done
++      if test $useit = yes; then
++        INST_LINGUAS="$INST_LINGUAS $presentlang"
++      fi
++    done
++  fi
++  CATALOGS=
++  JAVACATALOGS=
++  QTCATALOGS=
++  TCLCATALOGS=
++  CSHARPCATALOGS=
++  if test -n "$INST_LINGUAS"; then
++    for lang in $INST_LINGUAS; do
++      CATALOGS="$CATALOGS $lang.gmo"
++      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
++      QTCATALOGS="$QTCATALOGS $lang.qm"
++      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
++      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
++      frobbedlang=`echo $lang | sed -e 's/_/-/g'`
++      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
++    done
++  fi
++
++  sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
++  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
++    # Add dependencies that cannot be formulated as a simple suffix rule.
++    for lang in $ALL_LINGUAS; do
++      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
++      cat >> "$ac_file.tmp" <<EOF
++$frobbedlang.msg: $lang.po
++	@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
++	\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
++EOF
++    done
++  fi
++  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
++    # Add dependencies that cannot be formulated as a simple suffix rule.
++    for lang in $ALL_LINGUAS; do
++      frobbedlang=`echo $lang | sed -e 's/_/-/g'`
++      cat >> "$ac_file.tmp" <<EOF
++$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
++	@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
++	\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
++EOF
++    done
++  fi
++  if test -n "$POMAKEFILEDEPS"; then
++    cat >> "$ac_file.tmp" <<EOF
++Makefile: $POMAKEFILEDEPS
++EOF
++  fi
++  mv "$ac_file.tmp" "$ac_file"
++])
+--- lrzsz-0.12.20.safe/m4/printf-posix.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/printf-posix.m4	2004-09-12 14:40:34.974654000 -0400
+@@ -0,0 +1,46 @@
++# printf-posix.m4 serial 2 (gettext-0.13.1)
++dnl Copyright (C) 2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++dnl Test whether the printf() function supports POSIX/XSI format strings with
++dnl positions.
++
++AC_DEFUN([gt_PRINTF_POSIX],
++[
++  AC_REQUIRE([AC_PROG_CC])
++  AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
++    gt_cv_func_printf_posix,
++    [
++      AC_TRY_RUN([
++#include <stdio.h>
++#include <string.h>
++/* The string "%2$d %1$d", with dollar characters protected from the shell's
++   dollar expansion (possibly an autoconf bug).  */
++static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
++static char buf[100];
++int main ()
++{
++  sprintf (buf, format, 33, 55);
++  return (strcmp (buf, "55 33") != 0);
++}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
++      [
++        AC_EGREP_CPP(notposix, [
++#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
++  notposix
++#endif
++        ], gt_cv_func_printf_posix="guessing no",
++           gt_cv_func_printf_posix="guessing yes")
++      ])
++    ])
++  case $gt_cv_func_printf_posix in
++    *yes)
++      AC_DEFINE(HAVE_POSIX_PRINTF, 1,
++        [Define if your printf() function supports format strings with positions.])
++      ;;
++  esac
++])
+--- lrzsz-0.12.20.safe/m4/progtest.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/progtest.m4	2004-09-12 14:40:34.990651568 -0400
+@@ -0,0 +1,91 @@
++# progtest.m4 serial 3 (gettext-0.12)
++dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
++
++# Search path for a program which passes the given test.
++
++dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
++dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
++AC_DEFUN([AM_PATH_PROG_WITH_TEST],
++[
++# Prepare PATH_SEPARATOR.
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++  echo "#! /bin/sh" >conf$$.sh
++  echo  "exit 0"   >>conf$$.sh
++  chmod +x conf$$.sh
++  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++    PATH_SEPARATOR=';'
++  else
++    PATH_SEPARATOR=:
++  fi
++  rm -f conf$$.sh
++fi
++
++# Find out how to test for executable files. Don't use a zero-byte file,
++# as systems may use methods other than mode bits to determine executability.
++cat >conf$$.file <<_ASEOF
++#! /bin/sh
++exit 0
++_ASEOF
++chmod +x conf$$.file
++if test -x conf$$.file >/dev/null 2>&1; then
++  ac_executable_p="test -x"
++else
++  ac_executable_p="test -f"
++fi
++rm -f conf$$.file
++
++# Extract the first word of "$2", so it can be a program name with args.
++set dummy $2; ac_word=[$]2
++AC_MSG_CHECKING([for $ac_word])
++AC_CACHE_VAL(ac_cv_path_$1,
++[case "[$]$1" in
++  [[\\/]]* | ?:[[\\/]]*)
++    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
++    ;;
++  *)
++    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
++    for ac_dir in ifelse([$5], , $PATH, [$5]); do
++      IFS="$ac_save_IFS"
++      test -z "$ac_dir" && ac_dir=.
++      for ac_exec_ext in '' $ac_executable_extensions; do
++        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
++          if [$3]; then
++            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
++            break 2
++          fi
++        fi
++      done
++    done
++    IFS="$ac_save_IFS"
++dnl If no 4th arg is given, leave the cache variable unset,
++dnl so AC_PATH_PROGS will keep looking.
++ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
++])dnl
++    ;;
++esac])dnl
++$1="$ac_cv_path_$1"
++if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
++  AC_MSG_RESULT([$]$1)
++else
++  AC_MSG_RESULT(no)
++fi
++AC_SUBST($1)dnl
++])
+--- lrzsz-0.12.20.safe/m4/signed.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/signed.m4	2004-09-12 14:40:34.996650656 -0400
+@@ -0,0 +1,19 @@
++# signed.m4 serial 1 (gettext-0.10.40)
++dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([bh_C_SIGNED],
++[
++  AC_CACHE_CHECK([for signed], bh_cv_c_signed,
++   [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
++  if test $bh_cv_c_signed = no; then
++    AC_DEFINE(signed, ,
++              [Define to empty if the C compiler doesn't support this keyword.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/size_max.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/size_max.m4	2004-09-12 14:40:35.003649592 -0400
+@@ -0,0 +1,61 @@
++# size_max.m4 serial 2
++dnl Copyright (C) 2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([gl_SIZE_MAX],
++[
++  AC_CHECK_HEADERS(stdint.h)
++  dnl First test whether the system already has SIZE_MAX.
++  AC_MSG_CHECKING([for SIZE_MAX])
++  result=
++  AC_EGREP_CPP([Found it], [
++#include <limits.h>
++#if HAVE_STDINT_H
++#include <stdint.h>
++#endif
++#ifdef SIZE_MAX
++Found it
++#endif
++], result=yes)
++  if test -z "$result"; then
++    dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
++    dnl than the type 'unsigned long'.
++    dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
++    dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
++    _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
++      [#include <stddef.h>], result=?)
++    _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
++      [#include <stddef.h>], result=?)
++    _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
++      [#include <stddef.h>], result=?)
++    if test "$fits_in_uint" = 1; then
++      dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
++      dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
++      AC_TRY_COMPILE([#include <stddef.h>
++        extern size_t foo;
++        extern unsigned long foo;
++        ], [], fits_in_uint=0)
++    fi
++    if test -z "$result"; then
++      if test "$fits_in_uint" = 1; then
++        result="$res_hi$res_lo"U
++      else
++        result="$res_hi$res_lo"UL
++      fi
++    else
++      dnl Shouldn't happen, but who knows...
++      result='~(size_t)0'
++    fi
++  fi
++  AC_MSG_RESULT([$result])
++  if test "$result" != yes; then
++    AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
++      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/stdint_h.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/stdint_h.m4	2004-09-12 14:40:35.009648680 -0400
+@@ -0,0 +1,28 @@
++# stdint_h.m4 serial 3 (gettext-0.12)
++dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
++# doesn't clash with <sys/types.h>, and declares uintmax_t.
++
++AC_DEFUN([jm_AC_HEADER_STDINT_H],
++[
++  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
++  [AC_TRY_COMPILE(
++    [#include <sys/types.h>
++#include <stdint.h>],
++    [uintmax_t i = (uintmax_t) -1;],
++    jm_ac_cv_header_stdint_h=yes,
++    jm_ac_cv_header_stdint_h=no)])
++  if test $jm_ac_cv_header_stdint_h = yes; then
++    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
++      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
++       and declares uintmax_t. ])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/uintmax_t.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/uintmax_t.m4	2004-09-12 14:40:35.021646856 -0400
+@@ -0,0 +1,32 @@
++# uintmax_t.m4 serial 7 (gettext-0.12)
++dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++AC_PREREQ(2.13)
++
++# Define uintmax_t to 'unsigned long' or 'unsigned long long'
++# if it is not already defined in <stdint.h> or <inttypes.h>.
++
++AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
++[
++  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
++  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
++  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
++    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
++    test $ac_cv_type_unsigned_long_long = yes \
++      && ac_type='unsigned long long' \
++      || ac_type='unsigned long'
++    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
++      [Define to unsigned long or unsigned long long
++       if <stdint.h> and <inttypes.h> don't define.])
++  else
++    AC_DEFINE(HAVE_UINTMAX_T, 1,
++      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/ulonglong.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/ulonglong.m4	2004-09-12 14:40:35.028645792 -0400
+@@ -0,0 +1,25 @@
++# ulonglong.m4 serial 3
++dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
++
++AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
++[
++  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
++  [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
++    [unsigned long long ullmax = (unsigned long long) -1;
++     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
++    ac_cv_type_unsigned_long_long=yes,
++    ac_cv_type_unsigned_long_long=no)])
++  if test $ac_cv_type_unsigned_long_long = yes; then
++    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
++      [Define if you have the 'unsigned long long' type.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/wchar_t.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/wchar_t.m4	2004-09-12 14:40:35.034644880 -0400
+@@ -0,0 +1,22 @@
++# wchar_t.m4 serial 1 (gettext-0.12)
++dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++dnl Test whether <stddef.h> has the 'wchar_t' type.
++dnl Prerequisite: AC_PROG_CC
++
++AC_DEFUN([gt_TYPE_WCHAR_T],
++[
++  AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
++    [AC_TRY_COMPILE([#include <stddef.h>
++       wchar_t foo = (wchar_t)'\0';], ,
++       gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
++  if test $gt_cv_c_wchar_t = yes; then
++    AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/wint_t.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/wint_t.m4	2004-09-12 14:40:35.040643968 -0400
+@@ -0,0 +1,22 @@
++# wint_t.m4 serial 1 (gettext-0.12)
++dnl Copyright (C) 2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++dnl Test whether <wchar.h> has the 'wint_t' type.
++dnl Prerequisite: AC_PROG_CC
++
++AC_DEFUN([gt_TYPE_WINT_T],
++[
++  AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
++    [AC_TRY_COMPILE([#include <wchar.h>
++       wint_t foo = (wchar_t)'\0';], ,
++       gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
++  if test $gt_cv_c_wint_t = yes; then
++    AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
++  fi
++])
+--- lrzsz-0.12.20.safe/m4/xsize.m4	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/m4/xsize.m4	2004-09-12 14:40:35.047642904 -0400
+@@ -0,0 +1,14 @@
++# xsize.m4 serial 2
++dnl Copyright (C) 2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++AC_DEFUN([gl_XSIZE],
++[
++  dnl Prerequisites of lib/xsize.h.
++  AC_REQUIRE([gl_SIZE_MAX])
++  AC_CHECK_HEADERS(stdint.h)
++])
+--- lrzsz-0.12.20.safe/Makefile.am	1998-12-30 06:19:40.000000000 -0500
++++ lrzsz-0.12.20/Makefile.am	2004-09-12 14:40:35.121631656 -0400
+@@ -1,5 +1,5 @@
+ SUBDIRS = lib intl src po man testsuite
+-EXTRA_DIST = check.lrzsz COMPATABILITY README.cvs README.isdn4linux \
++EXTRA_DIST = config.rpath  check.lrzsz COMPATABILITY README.cvs README.isdn4linux \
+ 	README.gettext rpmrc buildrpm systype.in fastcheck.sh README.tests \
+ 	beos-runpiped.c fastcheck.beos
+ noinst_SCRIPTS=systype
+@@ -83,3 +83,5 @@
+ rpm: $(PR).tar.gz Specfile
+ 	$(srcdir)/buildrpm $(srcdir)
+ 
++
++ACLOCAL_AMFLAGS = -I m4
+--- lrzsz-0.12.20.safe/Makefile.in	1998-12-30 11:31:40.000000000 -0500
++++ lrzsz-0.12.20/Makefile.in	2004-09-12 14:40:35.109633480 -0400
+@@ -125,7 +125,7 @@
+ 	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+ 
+ $(ACLOCAL_M4):  configure.in  acinclude.m4
+-	cd $(srcdir) && $(ACLOCAL)
++	cd $(srcdir) && $(ACLOCAL) -I m4
+ 
+ config.status: $(srcdir)/configure
+ 	$(SHELL) ./config.status --recheck
+--- lrzsz-0.12.20.safe/mkinstalldirs	1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/mkinstalldirs	2004-09-12 14:40:34.337750824 -0400
+@@ -1,34 +1,150 @@
+ #! /bin/sh
+ # mkinstalldirs --- make directory hierarchy
+-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
++
++scriptversion=2004-02-15.20
++
++# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
+ # Created: 1993-05-16
+-# Last modified: 1995-03-05
+-# Public domain
++# Public domain.
++#
++# This file is maintained in Automake, please report
++# bugs to <bug-automake@gnu.org> or send patches to
++# <automake-patches@gnu.org>.
+ 
+ errstatus=0
++dirmode=""
+ 
+-for file in ${1+"$@"} ; do
+-   set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+-   shift
++usage="\
++Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+ 
+-   pathcomp=
+-   for d in ${1+"$@"} ; do
+-     pathcomp="$pathcomp$d"
+-     case "$pathcomp" in
+-       -* ) pathcomp=./$pathcomp ;;
+-     esac
++Create each directory DIR (with mode MODE, if specified), including all
++leading file name components.
+ 
+-     if test ! -d "$pathcomp"; then
+-        echo "mkdir $pathcomp" 1>&2
+-        mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+-     fi
++Report bugs to <bug-automake@gnu.org>."
+ 
+-     if test ! -d "$pathcomp"; then
++# process command line arguments
++while test $# -gt 0 ; do
++  case $1 in
++    -h | --help | --h*)         # -h for help
++      echo "$usage"
++      exit 0
++      ;;
++    -m)                         # -m PERM arg
++      shift
++      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
++      dirmode=$1
++      shift
++      ;;
++    --version)
++      echo "$0 $scriptversion"
++      exit 0
++      ;;
++    --)                         # stop option processing
++      shift
++      break
++      ;;
++    -*)                         # unknown option
++      echo "$usage" 1>&2
++      exit 1
++      ;;
++    *)                          # first non-opt arg
++      break
++      ;;
++  esac
++done
++
++for file
++do
++  if test -d "$file"; then
++    shift
++  else
++    break
++  fi
++done
++
++case $# in
++  0) exit 0 ;;
++esac
++
++# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
++# mkdir -p a/c at the same time, both will detect that a is missing,
++# one will create a, then the other will try to create a and die with
++# a "File exists" error.  This is a problem when calling mkinstalldirs
++# from a parallel make.  We use --version in the probe to restrict
++# ourselves to GNU mkdir, which is thread-safe.
++case $dirmode in
++  '')
++    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
++      echo "mkdir -p -- $*"
++      exec mkdir -p -- "$@"
++    else
++      # On NextStep and OpenStep, the `mkdir' command does not
++      # recognize any option.  It will interpret all options as
++      # directories to create, and then abort because `.' already
++      # exists.
++      test -d ./-p && rmdir ./-p
++      test -d ./--version && rmdir ./--version
++    fi
++    ;;
++  *)
++    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
++       test ! -d ./--version; then
++      echo "mkdir -m $dirmode -p -- $*"
++      exec mkdir -m "$dirmode" -p -- "$@"
++    else
++      # Clean up after NextStep and OpenStep mkdir.
++      for d in ./-m ./-p ./--version "./$dirmode";
++      do
++        test -d $d && rmdir $d
++      done
++    fi
++    ;;
++esac
++
++for file
++do
++  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
++  shift
++
++  pathcomp=
++  for d
++  do
++    pathcomp="$pathcomp$d"
++    case $pathcomp in
++      -*) pathcomp=./$pathcomp ;;
++    esac
++
++    if test ! -d "$pathcomp"; then
++      echo "mkdir $pathcomp"
++
++      mkdir "$pathcomp" || lasterr=$?
++
++      if test ! -d "$pathcomp"; then
+ 	errstatus=$lasterr
+-     fi
++      else
++	if test ! -z "$dirmode"; then
++	  echo "chmod $dirmode $pathcomp"
++	  lasterr=""
++	  chmod "$dirmode" "$pathcomp" || lasterr=$?
+ 
+-     pathcomp="$pathcomp/"
+-   done
++	  if test ! -z "$lasterr"; then
++	    errstatus=$lasterr
++	  fi
++	fi
++      fi
++    fi
++
++    pathcomp="$pathcomp/"
++  done
+ done
+ 
+ exit $errstatus
++
++# Local Variables:
++# mode: shell-script
++# sh-indentation: 2
++# eval: (add-hook 'write-file-hooks 'time-stamp)
++# time-stamp-start: "scriptversion="
++# time-stamp-format: "%:y-%02m-%02d.%02H"
++# time-stamp-end: "$"
++# End:
+--- lrzsz-0.12.20.safe/po/boldquot.sed	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/boldquot.sed	2004-09-12 14:40:34.723692152 -0400
+@@ -0,0 +1,10 @@
++s/"\([^"]*\)"/“\1”/g
++s/`\([^`']*\)'/‘\1’/g
++s/ '\([^`']*\)' / ‘\1’ /g
++s/ '\([^`']*\)'$/ ‘\1’/g
++s/^'\([^`']*\)' /‘\1’ /g
++s/“”/""/g
++s/“/“/g
++s/”/”/g
++s/‘/‘/g
++s/’/’/g
+--- lrzsz-0.12.20.safe/po/cat-id-tbl.c	1998-12-29 04:24:24.000000000 -0500
++++ lrzsz-0.12.20/po/cat-id-tbl.c	1969-12-31 19:00:00.000000000 -0500
+@@ -1,234 +0,0 @@
+-/* Automatically generated by po2tbl.sed from lrzsz.pot.  */
+-
+-#if HAVE_CONFIG_H
+-# include <config.h>
+-#endif
+-
+-#include "libgettext.h"
+-
+-const struct _msg_ent _msg_tbl[] = {
+-  {"", 1},
+-  {"io_mode(,2) in rbsb.c not implemented\n", 2},
+-  {"caught signal %d; exiting", 3},
+-  {"command tries", 4},
+-  {"packetlength", 5},
+-  {"packetlength out of range 24..%ld", 6},
+-  {"framelength", 7},
+-  {"framelength out of range 32..%ld", 8},
+-  {"min_bps", 9},
+-  {"min_bps must be >= 0", 10},
+-  {"min_bps_time", 11},
+-  {"min_bps_time must be > 1", 12},
+-  {"hour to large (0..23)", 13},
+-  {"unparsable stop time\n", 14},
+-  {"minute to large (0..59)", 15},
+-  {"stop time to small", 16},
+-  {"stop-at", 17},
+-  {"timeout", 18},
+-  {"timeout out of range 10..1000", 19},
+-  {"security violation: can't do that under restricted shell\n", 20},
+-  {"window size", 21},
+-  {"cannot turnoff syslog", 22},
+-  {"startup delay", 23},
+-  {"out of memory", 24},
+-  {"this program was never intended to be used setuid\n", 25},
+-  {"need at least one file to send", 26},
+-  {"Can't send command in restricted mode\n", 27},
+-  {"hostname too long\n", 28},
+-  {"illegal server address\n", 29},
+-  {"can read only one file from stdin", 30},
+-  {"Transfer incomplete\n", 31},
+-  {"Transfer complete\n", 32},
+-  {"send_pseudo %s: cannot open tmpfile %s: %s", 33},
+-  {"send_pseudo %s: cannot lstat tmpfile %s: %s", 34},
+-  {"send_pseudo %s: avoiding symlink trap", 35},
+-  {"send_pseudo %s: cannot write to tmpfile %s: %s", 36},
+-  {"send_pseudo %s: failed", 37},
+-  {"send_pseudo %s: ok", 38},
+-  {"tcp protocol init failed\n", 39},
+-  {"Answering TIMESYNC at %s", 40},
+-  {"timezone", 41},
+-  {"timezone unknown", 42},
+-  {"Can't open any requested files.", 43},
+-  {"security violation: not allowed to upload from %s", 44},
+-  {"cannot open %s", 45},
+-  {"is not a file: %s", 46},
+-  {"%s/%s: error occured", 47},
+-  {"skipped: %s", 48},
+-  {"%s/%s: skipped", 49},
+-  {"Bytes Sent:%7ld   BPS:%-8ld                        \n", 50},
+-  {"Sending %s, %ld blocks: ", 51},
+-  {"Give your local XMODEM receive command now.", 52},
+-  {"Sending: %s\n", 53},
+-  {"Timeout on pathname", 54},
+-  {"Receiver Cancelled", 55},
+-  {"No ACK on EOT", 56},
+-  {"Xmodem sectors/kbytes sent: %3d/%2dk", 57},
+-  {"Ymodem sectors/kbytes sent: %3d/%2dk", 58},
+-  {"Cancelled", 59},
+-  {"Timeout on sector ACK", 60},
+-  {"NAK on sector", 61},
+-  {"Got burst for sector ACK", 62},
+-  {"Got %02x for sector ACK", 63},
+-  {"Retry Count Exceeded", 64},
+-  {"Try `%s --help' for more information.\n", 65},
+-  {"%s version %s\n", 66},
+-  {"Usage: %s [options] file ...\n", 67},
+-  {"   or: %s [options] -{c|i} COMMAND\n", 68},
+-  {"Send file(s) with ZMODEM/YMODEM/XMODEM protocol\n", 69},
+-  {"\
+-    (X) = option applies to XMODEM only\n\
+-    (Y) = option applies to YMODEM only\n\
+-    (Z) = option applies to ZMODEM only\n", 70},
+-  {"\
+-  -+, --append                append to existing destination file (Z)\n\
+-  -2, --twostop               use 2 stop bits\n\
+-  -4, --try-4k                go up to 4K blocksize\n\
+-      --start-4k              start with 4K blocksize (doesn't try 8)\n\
+-  -8, --try-8k                go up to 8K blocksize\n\
+-      --start-8k              start with 8K blocksize\n\
+-  -a, --ascii                 ASCII transfer (change CR/LF to LF)\n\
+-  -b, --binary                binary transfer\n\
+-  -B, --bufsize N             buffer N bytes (N==auto: buffer whole file)\n\
+-  -c, --command COMMAND       execute remote command COMMAND (Z)\n\
+-  -C, --command-tries N       try N times to execute a command (Z)\n\
+-  -d, --dot-to-slash          change '.' to '/' in pathnames (Y/Z)\n\
+-      --delay-startup N       sleep N seconds before doing anything\n\
+-  -e, --escape                escape all control characters (Z)\n\
+-  -E, --rename                force receiver to rename files it already has\n\
+-  -f, --full-path             send full pathname (Y/Z)\n\
+-  -i, --immediate-command CMD send remote CMD, return immediately (Z)\n\
+-  -h, --help                  print this usage message\n\
+-  -k, --1k                    send 1024 byte packets (X)\n\
+-  -L, --packetlen N           limit subpacket length to N bytes (Z)\n\
+-  -l, --framelen N            limit frame length to N bytes (l>=L) (Z)\n\
+-  -m, --min-bps N             stop transmission if BPS below N\n\
+-  -M, --min-bps-time N          for at least N seconds (default: 120)\n", 71},
+-  {"\
+-  -n, --newer                 send file if source newer (Z)\n\
+-  -N, --newer-or-longer       send file if source newer or longer (Z)\n\
+-  -o, --16-bit-crc            use 16 bit CRC instead of 32 bit CRC (Z)\n\
+-  -O, --disable-timeouts      disable timeout code, wait forever\n\
+-  -p, --protect               protect existing destination file (Z)\n\
+-  -r, --resume                resume interrupted file transfer (Z)\n\
+-  -R, --restricted            restricted, more secure mode\n\
+-  -q, --quiet                 quiet (no progress reports)\n\
+-  -s, --stop-at {HH:MM|+N}    stop transmission at HH:MM or in N seconds\n\
+-      --tcp                   build a TCP connection to transmit files\n\
+-      --tcp-server            open socket, wait for connection\n\
+-  -u, --unlink                unlink file after transmission\n\
+-  -U, --unrestrict            turn off restricted mode (if allowed to)\n\
+-  -v, --verbose               be verbose, provide debugging information\n\
+-  -w, --windowsize N          Window is N bytes (Z)\n\
+-  -X, --xmodem                use XMODEM protocol\n\
+-  -y, --overwrite             overwrite existing files\n\
+-  -Y, --overwrite-or-skip     overwrite existing files, else skip\n\
+-      --ymodem                use YMODEM protocol\n\
+-  -Z, --zmodem                use ZMODEM protocol\n\
+-\n\
+-short options use the same arguments as the long ones\n", 72},
+-  {"got ZRQINIT", 73},
+-  {"got ZCAN", 74},
+-  {"blklen now %d\n", 75},
+-  {"zsendfdata: bps rate %ld below min %ld", 76},
+-  {"zsendfdata: reached stop time", 77},
+-  {"Bytes Sent:%7ld/%7ld   BPS:%-8ld ETA %02d:%02d  ", 78},
+-  {"calc_blklen: reduced to %d due to error\n", 79},
+-  {"calc_blklen: returned old value %d due to low bpe diff\n", 80},
+-  {"calc_blklen: old %ld, new %ld, d %ld\n", 81},
+-  {"calc_blklen: calc total_bytes=%ld, bpe=%ld, ec=%ld\n", 82},
+-  {"calc_blklen: blklen %d, ok %ld, failed %ld -> %lu\n", 83},
+-  {"calc_blklen: returned %d as best\n", 84},
+-  {"\
+-\n\
+-countem: Total %d %ld\n", 85},
+-  {"Bad escape sequence %x", 86},
+-  {"Sender Canceled", 87},
+-  {"TIMEOUT", 88},
+-  {"Bad data subpacket", 89},
+-  {"Data subpacket too long", 90},
+-  {"Garbage count exceeded", 91},
+-  {"Got %s", 92},
+-  {"Retry %d: ", 93},
+-  {"don't have settimeofday, will not set time\n", 94},
+-  {"not running as root (this is good!), can not set time\n", 95},
+-  {"bytes_per_error", 96},
+-  {"bytes-per-error should be >100", 97},
+-  {"O_SYNC not supported by the kernel", 98},
+-  {"garbage on commandline", 99},
+-  {"Usage: %s [options] [filename.if.xmodem]\n", 100},
+-  {"Receive files with ZMODEM/YMODEM/XMODEM protocol\n", 101},
+-  {"\
+-  -+, --append                append to existing files\n\
+-  -a, --ascii                 ASCII transfer (change CR/LF to LF)\n\
+-  -b, --binary                binary transfer\n\
+-  -B, --bufsize N             buffer N bytes (N==auto: buffer whole file)\n\
+-  -c, --with-crc              Use 16 bit CRC (X)\n\
+-  -C, --allow-remote-commands allow execution of remote commands (Z)\n\
+-  -D, --null                  write all received data to /dev/null\n\
+-      --delay-startup N       sleep N seconds before doing anything\n\
+-  -e, --escape                Escape control characters (Z)\n\
+-  -E, --rename                rename any files already existing\n\
+-      --errors N              generate CRC error every N bytes (debugging)\n\
+-  -h, --help                  Help, print this usage message\n\
+-  -m, --min-bps N             stop transmission if BPS below N\n\
+-  -M, --min-bps-time N          for at least N seconds (default: 120)\n\
+-  -O, --disable-timeouts      disable timeout code, wait forever for data\n\
+-      --o-sync                open output file(s) in synchronous write mode\n\
+-  -p, --protect               protect existing files\n\
+-  -q, --quiet                 quiet, no progress reports\n\
+-  -r, --resume                try to resume interrupted file transfer (Z)\n\
+-  -R, --restricted            restricted, more secure mode\n\
+-  -s, --stop-at {HH:MM|+N}    stop transmission at HH:MM or in N seconds\n\
+-  -S, --timesync              request remote time (twice: set local time)\n\
+-      --syslog[=off]          turn syslog on or off, if possible\n\
+-  -t, --timeout N             set timeout to N tenths of a second\n\
+-  -u, --keep-uppercase        keep upper case filenames\n\
+-  -U, --unrestrict            disable restricted mode (if allowed to)\n\
+-  -v, --verbose               be verbose, provide debugging information\n\
+-  -w, --windowsize N          Window is N bytes (Z)\n\
+-  -X  --xmodem                use XMODEM protocol\n\
+-  -y, --overwrite             Yes, clobber existing file if any\n\
+-      --ymodem                use YMODEM protocol\n\
+-  -Z, --zmodem                use ZMODEM protocol\n\
+-\n\
+-short options use the same arguments as the long ones\n", 102},
+-  {"%s waiting to receive.", 103},
+-  {"\rBytes received: %7ld/%7ld   BPS:%-6ld                \r\n", 104},
+-  {"%s: ready to receive %s", 105},
+-  {"\rBytes received: %7ld   BPS:%-6ld                \r\n", 106},
+-  {"\
+-\r\n\
+-%s: %s removed.\r\n", 107},
+-  {"Pathname fetch returned EOT", 108},
+-  {"Received dup Sector", 109},
+-  {"Sync Error", 110},
+-  {"CRC", 111},
+-  {"Checksum", 112},
+-  {"Sector number garbled", 113},
+-  {"Sender Cancelled", 114},
+-  {"Got 0%o sector header", 115},
+-  {"file name ends with a /, skipped: %s\n", 116},
+-  {"zmanag=%d, Lzmanag=%d\n", 117},
+-  {"zconv=%d\n", 118},
+-  {"file exists, skipped: %s\n", 119},
+-  {"TIMESYNC: here %ld, remote %ld, diff %ld seconds\n", 120},
+-  {"TIMESYNC: cannot set time: %s\n", 121},
+-  {"cannot tmpfile() for tcp protocol synchronization", 122},
+-  {"Topipe", 123},
+-  {"Receiving: %s\n", 124},
+-  {"Blocks received: %d", 125},
+-  {"%s: %s exists\n", 126},
+-  {"%s:\tSecurity Violation", 127},
+-  {"remote command execution requested", 128},
+-  {"not executed", 129},
+-  {"got ZRINIT", 130},
+-  {"Skipped", 131},
+-  {"rzfile: bps rate %ld below min %ld", 132},
+-  {"rzfile: reached stop time", 133},
+-  {"\rBytes received: %7ld/%7ld   BPS:%-6ld ETA %02d:%02d  ", 134},
+-  {"fgets for tcp protocol synchronization failed: ", 135},
+-  {"file close error", 136},
+-};
+-
+-int _msg_tbl_length = 136;
+--- lrzsz-0.12.20.safe/po/ChangeLog	1998-04-26 09:20:52.000000000 -0400
++++ lrzsz-0.12.20/po/ChangeLog	2004-09-12 14:40:34.793681512 -0400
+@@ -1,3 +1,15 @@
++2004-09-12  gettextize  <bug-gnu-gettext@gnu.org>
++
++	* boldquot.sed: New file, from gettext-0.14.1.
++	* en@boldquot.header: New file, from gettext-0.14.1.
++	* en@quot.header: New file, from gettext-0.14.1.
++	* insert-header.sin: New file, from gettext-0.14.1.
++	* quot.sed: New file, from gettext-0.14.1.
++	* remove-potcdate.sin: New file, from gettext-0.14.1.
++	* Rules-quot: New file, from gettext-0.14.1.
++	* cat-id-tbl.c: Remove file.
++	* stamp-cat-id: Remove file.
++
+ /* Automatically generated by po2tbl.sed from lrzsz.pot.  */
+ 
+ #if HAVE_CONFIG_H
+--- lrzsz-0.12.20.safe/po/en@boldquot.header	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/en@boldquot.header	2004-09-12 14:40:34.731690936 -0400
+@@ -0,0 +1,25 @@
++# All this catalog "translates" are quotation characters.
++# The msgids must be ASCII and therefore cannot contain real quotation
++# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
++# and double quote (0x22). These substitutes look strange; see
++# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
++#
++# This catalog translates grave accent (0x60) and apostrophe (0x27) to
++# left single quotation mark (U+2018) and right single quotation mark (U+2019).
++# It also translates pairs of apostrophe (0x27) to
++# left single quotation mark (U+2018) and right single quotation mark (U+2019)
++# and pairs of quotation mark (0x22) to
++# left double quotation mark (U+201C) and right double quotation mark (U+201D).
++#
++# When output to an UTF-8 terminal, the quotation characters appear perfectly.
++# When output to an ISO-8859-1 terminal, the single quotation marks are
++# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
++# grave/acute accent (by libiconv), and the double quotation marks are
++# transliterated to 0x22.
++# When output to an ASCII terminal, the single quotation marks are
++# transliterated to apostrophes, and the double quotation marks are
++# transliterated to 0x22.
++#
++# This catalog furthermore displays the text between the quotation marks in
++# bold face, assuming the VT100/XTerm escape sequences.
++#
+--- lrzsz-0.12.20.safe/po/en@quot.header	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/en@quot.header	2004-09-12 14:40:34.737690024 -0400
+@@ -0,0 +1,22 @@
++# All this catalog "translates" are quotation characters.
++# The msgids must be ASCII and therefore cannot contain real quotation
++# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
++# and double quote (0x22). These substitutes look strange; see
++# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
++#
++# This catalog translates grave accent (0x60) and apostrophe (0x27) to
++# left single quotation mark (U+2018) and right single quotation mark (U+2019).
++# It also translates pairs of apostrophe (0x27) to
++# left single quotation mark (U+2018) and right single quotation mark (U+2019)
++# and pairs of quotation mark (0x22) to
++# left double quotation mark (U+201C) and right double quotation mark (U+201D).
++#
++# When output to an UTF-8 terminal, the quotation characters appear perfectly.
++# When output to an ISO-8859-1 terminal, the single quotation marks are
++# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
++# grave/acute accent (by libiconv), and the double quotation marks are
++# transliterated to 0x22.
++# When output to an ASCII terminal, the single quotation marks are
++# transliterated to apostrophes, and the double quotation marks are
++# transliterated to 0x22.
++#
+--- lrzsz-0.12.20.safe/po/insert-header.sin	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/insert-header.sin	2004-09-12 14:40:34.743689112 -0400
+@@ -0,0 +1,23 @@
++# Sed script that inserts the file called HEADER before the header entry.
++#
++# At each occurrence of a line starting with "msgid ", we execute the following
++# commands. At the first occurrence, insert the file. At the following
++# occurrences, do nothing. The distinction between the first and the following
++# occurrences is achieved by looking at the hold space.
++/^msgid /{
++x
++# Test if the hold space is empty.
++s/m/m/
++ta
++# Yes it was empty. First occurrence. Read the file.
++r HEADER
++# Output the file's contents by reading the next line. But don't lose the
++# current line while doing this.
++g
++N
++bb
++:a
++# The hold space was nonempty. Following occurrences. Do nothing.
++x
++:b
++}
+--- lrzsz-0.12.20.safe/po/Makevars	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/Makevars	2004-09-12 14:40:34.748688352 -0400
+@@ -0,0 +1,41 @@
++# Makefile variables for PO directory in any package using GNU gettext.
++
++# Usually the message domain is the same as the package name.
++DOMAIN = $(PACKAGE)
++
++# These two variables depend on the location of this directory.
++subdir = po
++top_builddir = ..
++
++# These options get passed to xgettext.
++XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
++
++# This is the copyright holder that gets inserted into the header of the
++# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
++# package.  (Note that the msgstr strings, extracted from the package's
++# sources, belong to the copyright holder of the package.)  Translators are
++# expected to transfer the copyright for their translations to this person
++# or entity, or to disclaim their copyright.  The empty string stands for
++# the public domain; in this case the translators are expected to disclaim
++# their copyright.
++COPYRIGHT_HOLDER = Free Software Foundation, Inc.
++
++# This is the email address or URL to which the translators shall report
++# bugs in the untranslated strings:
++# - Strings which are not entire sentences, see the maintainer guidelines
++#   in the GNU gettext documentation, section 'Preparing Strings'.
++# - Strings which use unclear terms or require additional context to be
++#   understood.
++# - Strings which make invalid assumptions about notation of date, time or
++#   money.
++# - Pluralisation problems.
++# - Incorrect English spelling.
++# - Incorrect formatting.
++# It can be your email address, or a mailing list address where translators
++# can write to without being subscribed, or the URL of a web page through
++# which the translators can contact you.
++MSGID_BUGS_ADDRESS =
++
++# This is the list of locale categories, beyond LC_MESSAGES, for which the
++# message catalogs shall be used.  It is usually empty.
++EXTRA_LOCALE_CATEGORIES =
+--- lrzsz-0.12.20.safe/po/quot.sed	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/quot.sed	2004-09-12 14:40:34.754687440 -0400
+@@ -0,0 +1,6 @@
++s/"\([^"]*\)"/“\1”/g
++s/`\([^`']*\)'/‘\1’/g
++s/ '\([^`']*\)' / ‘\1’ /g
++s/ '\([^`']*\)'$/ ‘\1’/g
++s/^'\([^`']*\)' /‘\1’ /g
++s/“”/""/g
+--- lrzsz-0.12.20.safe/po/remove-potcdate.sin	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/remove-potcdate.sin	2004-09-12 14:40:34.762686224 -0400
+@@ -0,0 +1,19 @@
++# Sed script that remove the POT-Creation-Date line in the header entry
++# from a POT file.
++#
++# The distinction between the first and the following occurrences of the
++# pattern is achieved by looking at the hold space.
++/^"POT-Creation-Date: .*"$/{
++x
++# Test if the hold space is empty.
++s/P/P/
++ta
++# Yes it was empty. First occurrence. Remove the line.
++g
++d
++bb
++:a
++# The hold space was nonempty. Following occurrences. Do nothing.
++x
++:b
++}
+--- lrzsz-0.12.20.safe/po/Rules-quot	1969-12-31 19:00:00.000000000 -0500
++++ lrzsz-0.12.20/po/Rules-quot	2004-09-12 14:40:34.778683792 -0400
+@@ -0,0 +1,47 @@
++# Special Makefile rules for English message catalogs with quotation marks.
++
++DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
++
++.SUFFIXES: .insert-header .po-update-en
++
++en@quot.po-create:
++	$(MAKE) en@quot.po-update
++en@boldquot.po-create:
++	$(MAKE) en@boldquot.po-update
++
++en@quot.po-update: en@quot.po-update-en
++en@boldquot.po-update: en@boldquot.po-update-en
++
++.insert-header.po-update-en:
++	@lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
++	if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
++	tmpdir=`pwd`; \
++	echo "$$lang:"; \
++	ll=`echo $$lang | sed -e 's/@.*//'`; \
++	LC_ALL=C; export LC_ALL; \
++	cd $(srcdir); \
++	if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
++	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
++	    rm -f $$tmpdir/$$lang.new.po; \
++	  else \
++	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
++	      :; \
++	    else \
++	      echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
++	      exit 1; \
++	    fi; \
++	  fi; \
++	else \
++	  echo "creation of $$lang.po failed!" 1>&2; \
++	  rm -f $$tmpdir/$$lang.new.po; \
++	fi
++
++en@quot.insert-header: insert-header.sin
++	sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
++
++en@boldquot.insert-header: insert-header.sin
++	sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
++
++mostlyclean: mostlyclean-quot
++mostlyclean-quot:
++	rm -f *.insert-header
+--- lrzsz-0.12.20.safe/po/stamp-cat-id	1998-12-30 02:50:01.000000000 -0500
++++ lrzsz-0.12.20/po/stamp-cat-id	1969-12-31 19:00:00.000000000 -0500
+@@ -1 +0,0 @@
+-timestamp
+--- lrzsz-0.12.20.safe/src/Makefile.am	1998-12-28 03:38:47.000000000 -0500
++++ lrzsz-0.12.20/src/Makefile.am	2004-09-12 14:40:53.665812512 -0400
+@@ -2,12 +2,12 @@
+ lrz_SOURCES=lrz.c timing.c zperr.c zreadline.c crctab.c rbsb.c zm.c protname.c tcp.c lsyslog.c canit.c
+ lsz_SOURCES=lsz.c timing.c zperr.c zreadline.c crctab.c rbsb.c zm.c protname.c tcp.c lsyslog.c canit.c
+ noinst_HEADERS = timing.h zglobal.h zmodem.h
+-datadir = $(prefix)/@DATADIRNAME@
++datadir = $(prefix)/share
+ localedir = $(datadir)/locale
+ CFLAGS=@CFLAGS@
+ DISTCLEAN_FILES=lrzszbug
+ 
+-LDADD = ../lib/libzmodem.a @INTLLIBS@
++LDADD = ../lib/libzmodem.a @LIBINTL@
+ AUTOMAKE_OPTIONS=ansi2knr
+ EXTRA_DIST = ansi2knr.1 ansi2knr.c lrzszbug.in
+ INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir)/src -I../intl -I$(top_srcdir)/lib
diff --git a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz-check-locale.h.patch b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz-check-locale.h.patch
new file mode 100644
index 0000000..9e46dfa
--- /dev/null
+++ b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz-check-locale.h.patch
@@ -0,0 +1,32 @@
+From 28b473c3c96682a820e292cc1be006e19aee11bc Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Fri, 24 May 2013 01:07:24 -0400
+Subject: [PATCH] lrzsz check locale.h
+
+fix the build failure when using -O0 in a debug build:
+lrz.c:284:13: error: 'LC_ALL' undeclared (first use in this function)
+
+Upstream-Status: Submitted [uwe@ohse.de]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+ configure.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 6e2064c..c10460c 100644
+--- a/configure.in
++++ b/configure.in
+@@ -130,7 +130,7 @@ AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h sys/times.h)
+ LRZSZ_HEADERS_TERM_IO
+ AC_CHECK_HEADERS(termios.h sys/termios.h termio.h sys/termio.h sgtty.h)
+ AC_CHECK_HEADERS(sys/mman.h utime.h syslog.h sys/syslog.h sys/param.h)
+-AC_CHECK_HEADERS(sys/select.h strings.h arpa/inet.h)
++AC_CHECK_HEADERS(sys/select.h strings.h locale.h arpa/inet.h)
+ 
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_TYPE_SIZE_T
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz_fix_for_automake-1.12.patch b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..b4529f4
--- /dev/null
+++ b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/lrzsz_fix_for_automake-1.12.patch
@@ -0,0 +1,49 @@
+Upstream-Status: Pending
+
+This patch fixes following issue with automake 1.12
+
+| configure.in:95: error: automatic de-ANSI-fication support has been removed
+...
+| lib/Makefile.am:3: error: automatic de-ANSI-fication support has been removed
+| lib/Makefile.am: installing './depcomp'
+| src/Makefile.am:11: error: automatic de-ANSI-fication support has been removed
+
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/03
+
+Index: lrzsz-0.12.20/configure.in
+===================================================================
+--- lrzsz-0.12.20.orig/configure.in
++++ lrzsz-0.12.20/configure.in
+@@ -92,7 +92,6 @@ AC_PROG_RANLIB
+ AC_ISC_POSIX
+ AC_AIX
+ AC_MINIX
+-AM_C_PROTOTYPES
+ AC_C_CONST
+ AC_C_INLINE
+ 
+Index: lrzsz-0.12.20/lib/Makefile.am
+===================================================================
+--- lrzsz-0.12.20.orig/lib/Makefile.am
++++ lrzsz-0.12.20/lib/Makefile.am
+@@ -1,6 +1,5 @@
+ noinst_LIBRARIES=libzmodem.a
+ CFLAGS=@CFLAGS@
+-AUTOMAKE_OPTIONS=ansi2knr
+ 
+ EXTRA_DIST = alloca.c ansi2knr.1 ansi2knr.c \
+ 	getopt.c getopt1.c mkdir.c mktime.c \
+Index: lrzsz-0.12.20/src/Makefile.am
+===================================================================
+--- lrzsz-0.12.20.orig/src/Makefile.am
++++ lrzsz-0.12.20/src/Makefile.am
+@@ -8,7 +8,6 @@ CFLAGS=@CFLAGS@
+ DISTCLEAN_FILES=lrzszbug
+ 
+ LDADD = ../lib/libzmodem.a @LIBINTL@
+-AUTOMAKE_OPTIONS=ansi2knr
+ EXTRA_DIST = ansi2knr.1 ansi2knr.c lrzszbug.in
+ INCLUDES = -I.. -I$(srcdir) -I$(top_srcdir)/src -I../intl -I$(top_srcdir)/lib
+ #DEFS = -DLOCALEDIR=\"$(localedir)\" -DOS=\"@host_os@\" -DCPU=\"@host_cpu@\"
diff --git a/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/makefile.patch b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/makefile.patch
new file mode 100644
index 0000000..ace592c
--- /dev/null
+++ b/meta/recipes-bsp/lrzsz/lrzsz-0.12.20/makefile.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN lrzsz-0.12.20_org/src/Makefile.in lrzsz-0.12.20_patch/src/Makefile.in
+--- lrzsz-0.12.20_org/src/Makefile.in	1998-12-30 17:31:46.000000000 +0100
++++ lrzsz-0.12.20_patch/src/Makefile.in	2004-04-29 13:57:33.434909656 +0200
+@@ -372,13 +372,13 @@
+ 	rm -f $(DESTDIR)/$(bindir)/`echo lsb | sed -e '$(transform)'`
+ 	ln $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \
+ 		$(DESTDIR)/$(bindir)/`echo lsb |sed -e '$(transform)'` 
+-	rm -f $(bindir)/`echo lsx | sed -e '$(transform)'`
++	rm -f $(DESTDIR)/$(bindir)/`echo lsx | sed -e '$(transform)'`
+ 	ln $(DESTDIR)/$(bindir)/`echo lsz |sed -e '$(transform)'` \
+ 		$(DESTDIR)/$(bindir)/`echo lsx |sed -e '$(transform)'` 
+-	rm -f $(bindir)/`echo lrb | sed -e '$(transform)'`
++	rm -f $(DESTDIR)/$(bindir)/`echo lrb | sed -e '$(transform)'`
+ 	ln $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \
+ 		$(DESTDIR)/$(bindir)/`echo lrb |sed -e '$(transform)'` 
+-	rm -f $(bindir)/`echo lrx | sed -e '$(transform)'`
++	rm -f $(DESTDIR)/$(bindir)/`echo lrx | sed -e '$(transform)'`
+ 	ln $(DESTDIR)/$(bindir)/`echo lrz |sed -e '$(transform)'` \
+ 		$(DESTDIR)/$(bindir)/`echo lrx |sed -e '$(transform)'` 
+ #	rm -f $(bindir)/`echo lrzszbug | sed -e '$(transform)'`
diff --git a/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb b/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
new file mode 100644
index 0000000..e0ce57d
--- /dev/null
+++ b/meta/recipes-bsp/lrzsz/lrzsz_0.12.20.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Tools for zmodem/xmodem/ymodem file transfer"
+DESCRIPTION = "Lrzsz is a cosmetically modified zmodem/ymodem/xmodem package built from \
+the public-domain version of Chuck Forsberg's rzsz package. \
+These programs use error correcting protocols ({z,x,y}modem) to send (sz, sx, sb) and \
+receive (rz, rx, rb) files over a dial-in serial port from a variety of programs \
+running under various operating systems. "
+HOMEPAGE = "http://www.ohse.de/uwe/software/lrzsz.html"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+			file://src/lrz.c;beginline=1;endline=10;md5=5276956373ff7d8758837f6399a1045f"
+SECTION = "console/network"
+DEPENDS = ""
+PR = "r6"
+
+SRC_URI = "http://www.ohse.de/uwe/releases/lrzsz-${PV}.tar.gz \
+	   file://autotools.patch \
+	   file://makefile.patch \
+	   file://gettext.patch \
+	   file://acdefine.patch \
+	   file://lrzsz_fix_for_automake-1.12.patch \
+           file://lrzsz-check-locale.h.patch \
+           "
+
+SRC_URI[md5sum] = "b5ce6a74abc9b9eb2af94dffdfd372a4"
+SRC_URI[sha256sum] = "c28b36b14bddb014d9e9c97c52459852f97bd405f89113f30bee45ed92728ff1"
+
+inherit autotools gettext
+
+do_install() {
+	install -d ${D}${bindir}/
+	install -m 0755 src/lrz src/lsz ${D}${bindir}/
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "rz rx rb sz sx sb"
+
+ALTERNATIVE_TARGET[rz] = "${bindir}/lrz"
+ALTERNATIVE_TARGET[rx] = "${bindir}/lrz"
+ALTERNATIVE_TARGET[rb] = "${bindir}/lrz"
+
+ALTERNATIVE_TARGET[sz] = "${bindir}/lsz"
+ALTERNATIVE_TARGET[sx] = "${bindir}/lsz"
+ALTERNATIVE_TARGET[sb] = "${bindir}/lsz"
diff --git a/meta/recipes-bsp/pciutils/pciutils/configure.patch b/meta/recipes-bsp/pciutils/pciutils/configure.patch
new file mode 100644
index 0000000..66c9f91
--- /dev/null
+++ b/meta/recipes-bsp/pciutils/pciutils/configure.patch
@@ -0,0 +1,104 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+---
+
+7/30/2010 - rebased to 3.1.5 by Qing He <qing.he@intel.com>
+1/22/2012 - rebased to 3.1.9 by Shane Wang <shane.wang@intel.com>
+
+diff -r af2b10cc3c14 Makefile
+--- a/Makefile	Sun Jan 22 18:36:34 2012 +0800
++++ b/Makefile	Sun Jan 22 18:38:54 2012 +0800
+@@ -37,7 +37,6 @@
+ # Commands
+ INSTALL=install
+ DIRINSTALL=install -d
+-STRIP=-s
+ CC=$(CROSS_COMPILE)gcc
+ AR=$(CROSS_COMPILE)ar
+ RANLIB=$(CROSS_COMPILE)ranlib
+@@ -86,7 +85,7 @@
+ example.o: example.c $(PCIINC)
+ 
+ %: %.o
+-	$(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LDLIBS) -o $@
++	$(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) -o $@
+ 
+ %.8 %.7: %.man
+ 	M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#"
+@@ -101,7 +100,7 @@
+ install: all
+ # -c is ignored on Linux, but required on FreeBSD
+ 	$(DIRINSTALL) -m 755 $(DESTDIR)$(SBINDIR) $(DESTDIR)$(IDSDIR) $(DESTDIR)$(MANDIR)/man8 $(DESTDIR)$(MANDIR)/man7
+-	$(INSTALL) -c -m 755 $(STRIP) lspci setpci $(DESTDIR)$(SBINDIR)
++	$(INSTALL) -c -m 755 lspci setpci $(DESTDIR)$(SBINDIR)
+ 	$(INSTALL) -c -m 755 update-pciids $(DESTDIR)$(SBINDIR)
+ 	$(INSTALL) -c -m 644 $(PCI_IDS) $(DESTDIR)$(IDSDIR)
+ 	$(INSTALL) -c -m 644 lspci.8 setpci.8 update-pciids.8 $(DESTDIR)$(MANDIR)/man8
+diff -r af2b10cc3c14 lib/configure
+--- a/lib/configure	Sun Jan 22 18:36:34 2012 +0800
++++ b/lib/configure	Sun Jan 22 18:38:54 2012 +0800
+@@ -14,6 +14,10 @@
+ 	fi
+ }
+ 
++VERSION=$1
++IDSDIR=$2
++DNS=yes
++
+ if [ -z "$VERSION" -o -z "$IDSDIR" ] ; then
+ 	echo >&2 "Please run the configure script from the top-level Makefile"
+ 	exit 1
+@@ -21,8 +25,8 @@
+ 
+ echo_n "Configuring libpci for your system..."
+ if [ -z "$HOST" ] ; then
+-	sys=`uname -s`
+-	rel=`uname -r`
++	sys=${3:-`uname -s`}
++	rel=
+ 	realsys="$sys"
+ 	if [ "$sys" = "AIX" -a -x /usr/bin/oslevel -a -x /usr/sbin/lsattr ]
+ 	then
+@@ -30,7 +34,7 @@
+ 		proc=`/usr/sbin/lsdev -C -c processor -S available -F name | head -1`
+ 		cpu=`/usr/sbin/lsattr -F value -l $proc -a type | sed 's/_.*//'`
+ 	else
+-		cpu=`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`
++		cpu=${4:-`uname -m | sed 's/^i.86$/i386/;s/^sun4u$/sparc64/;s/^i86pc$/i386/;s/^BePC$/i386/;s/^BeMac$/powerpc/;s/^BeBox$/powerpc/'`}
+ 	fi
+ 	if [ "$sys" = "GNU/kFreeBSD" -o "$sys" = "DragonFly" ]
+ 	then
+@@ -40,7 +44,7 @@
+ 	then
+ 		sys=cygwin
+ 	fi
+-	HOST=${3:-$cpu-$sys}
++	HOST=$cpu-$sys
+ fi
+ [ -n "$RELEASE" ] && rel="${RELEASE}"
+ # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
+@@ -49,6 +53,21 @@
+ sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ echo " $host $rel $cpu $sys"
+ 
++if [ "$host" = "linux--gnueabi" ]
++then
++	sys=linux
++fi
++
++if [ "$host" = "linux--uclibc" ]
++then
++	sys=linux
++fi
++
++if [ "$host" = "linux--uclibceabi" ]
++then
++	sys=linux
++fi
++
+ c=config.h
+ m=config.mk
+ echo >$c '#define PCI_CONFIG_H'
diff --git a/meta/recipes-bsp/pciutils/pciutils/guess-fix.patch b/meta/recipes-bsp/pciutils/pciutils/guess-fix.patch
new file mode 100644
index 0000000..540b4a0
--- /dev/null
+++ b/meta/recipes-bsp/pciutils/pciutils/guess-fix.patch
@@ -0,0 +1,37 @@
+the original guess algorithm is broken for many archs
+for example, the following two would break:
+	arm-linux-gnueabi  --> sys=gnueabi
+	x86_64-unknown-pc-linux-gnu  --> sys = pc-linux-gnu
+
+use a simpler scheme here and hope it works for all the cases
+
+Upstream-Status: Pending
+
+7/30/2010 - created by Qing He <qing.he@intel.com>
+
+diff --git a/lib/configure b/lib/configure
+index 4318b05..84f6acb 100755
+--- a/lib/configure
++++ b/lib/configure
+@@ -53,20 +53,7 @@ cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+ sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ echo " $host $rel $cpu $sys"
+ 
+-if [ "$host" = "linux--gnueabi" ]
+-then
+-	sys=linux
+-fi
+-
+-if [ "$host" = "linux--uclibc" ]
+-then
+-	sys=linux
+-fi
+-
+-if [ "$host" = "linux--uclibceabi" ]
+-then
+-	sys=linux
+-fi
++{ echo "$host" | grep linux; } && sys=linux
+ 
+ c=config.h
+ m=config.mk
diff --git a/meta/recipes-bsp/pciutils/pciutils/makefile.patch b/meta/recipes-bsp/pciutils/pciutils/makefile.patch
new file mode 100644
index 0000000..c3fbc6f
--- /dev/null
+++ b/meta/recipes-bsp/pciutils/pciutils/makefile.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Ionut Radu <ionutx.radu@intel.com>
+
+Index: pciutils-3.2.0/Makefile
+===================================================================
+--- pciutils-3.2.0.orig/Makefile
++++ pciutils-3.2.0/Makefile
+@@ -35,7 +35,7 @@ SHAREDIR=$(PREFIX)/share
+ IDSDIR=$(SHAREDIR)
+ MANDIR:=$(shell if [ -d $(PREFIX)/share/man ] ; then echo $(PREFIX)/share/man ; else echo $(PREFIX)/man ; fi)
+ INCDIR=$(PREFIX)/include
+-LIBDIR=$(PREFIX)/lib
++LIBDIR=$(libdir)
+ PKGCFDIR=$(LIBDIR)/pkgconfig
+ 
+ # Commands
+@@ -94,7 +94,7 @@ example: example.o lib/$(PCILIB_DEV)
+ example.o: example.c $(PCIINC)
+ 
+ %: %.o
+-	$(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) -o $@
++	$(CC) $(LDFLAGS) $(TARGET_ARCH) $^ $(LIB_LDLIBS) $(LDLIBS) -o $@
+ 
+ %.8 %.7: %.man
+ 	M=`echo $(DATE) | sed 's/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/'` ; sed <$< >$@ "s/@TODAY@/$$M/;s/@VERSION@/pciutils-$(VERSION)/;s#@IDSDIR@#$(IDSDIR)#"
diff --git a/meta/recipes-bsp/pciutils/pciutils_3.3.1.bb b/meta/recipes-bsp/pciutils/pciutils_3.3.1.bb
new file mode 100644
index 0000000..91a8cd3
--- /dev/null
+++ b/meta/recipes-bsp/pciutils/pciutils_3.3.1.bb
@@ -0,0 +1,60 @@
+SUMMARY = "PCI utilities"
+DESCRIPTION = 'The PCI Utilities package contains a library for portable access \
+to PCI bus configuration space and several utilities based on this library.'
+HOMEPAGE = "http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+DEPENDS = "zlib kmod"
+
+SRC_URI = "${KERNELORG_MIRROR}/software/utils/pciutils/pciutils-${PV}.tar.xz \
+           file://configure.patch \
+           file://guess-fix.patch \
+           file://makefile.patch"
+
+SRC_URI[md5sum] = "4c340a317987d61a11ee2cf139ef1191"
+SRC_URI[sha256sum] = "514a3bdb77e4cdbe9e970e1885af46e0ba2011bf97364368c455ade0edd4e3a9"
+
+inherit multilib_header
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'hwdb', '', d)}"
+PACKAGECONFIG[hwdb] = "HWDB=yes,HWDB=no,udev"
+
+PCI_CONF_FLAG = "ZLIB=yes DNS=yes SHARED=yes"
+
+# see configure.patch
+do_configure () {
+	(
+	  cd lib && \
+	  # EXTRA_OECONF for this recipe could only possibly contain 'HWDB=yes/no', so we put it
+	  # before ./configure
+	  ${PCI_CONF_FLAG} ${EXTRA_OECONF} ./configure ${PV} ${datadir} ${TARGET_OS} ${TARGET_ARCH}
+	)
+}
+
+export PREFIX = "${prefix}"
+export SBINDIR = "${sbindir}"
+export SHAREDIR = "${datadir}"
+export MANDIR = "${mandir}"
+
+EXTRA_OEMAKE += "${PCI_CONF_FLAG}"
+
+# The configure script breaks if the HOST variable is set
+HOST[unexport] = "1"
+
+do_install () {
+	oe_runmake DESTDIR=${D} install install-lib
+
+	install -d ${D}${bindir}
+	ln -s ../sbin/lspci ${D}${bindir}/lspci
+
+	oe_multilib_header pci/config.h
+}
+
+PACKAGES =+ "${PN}-ids libpci"
+FILES_${PN}-ids = "${datadir}/pci.ids*"
+FILES_libpci = "${libdir}/libpci.so.*"
+SUMMARY_${PN}-ids = "PCI utilities - device ID database"
+DESCRIPTION_${PN}-ids = "Package providing the PCI device ID database for pciutils."
+RDEPENDS_${PN} += "${PN}-ids"
diff --git a/meta/recipes-bsp/pcmciautils/pcmciautils-018/0001-fix-a-parallel-building-issue.patch b/meta/recipes-bsp/pcmciautils/pcmciautils-018/0001-fix-a-parallel-building-issue.patch
new file mode 100644
index 0000000..7b01040
--- /dev/null
+++ b/meta/recipes-bsp/pcmciautils/pcmciautils-018/0001-fix-a-parallel-building-issue.patch
@@ -0,0 +1,45 @@
+From 5a793a1a9fb3477719aabf7e27ff22ed1acdf559 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Tue, 19 May 2015 15:54:24 +0800
+Subject: [PATCH] fix a parallel building issue
+
+Fixed:
+|   src/lex_config.c:34:25: fatal error: yacc_config.h: No such file or directory
+|
+|    #include "yacc_config.h"
+|                            ^
+|   compilation terminated.
+
+And:
+Compiling lex_config.c.
+  src/lex_config.l:34:25: fatal error: yacc_config.h: No such file or directory
+
+Upstream-Status: Pending
+
+there are two Makefile rules to generate lex_config.o, one is to generate
+lex_config.o other is to generate src/lex_config.o, so we can remove one.
+and add the needed dependence for lex_config.o
+
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ Makefile | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d45fdc3..4c53bc2 100644
+--- a/Makefile
++++ b/Makefile
+@@ -246,8 +246,7 @@ $(PCMCIA_SOCKET_STARTUP): $(LIBC) src/startup.o src/yacc_config.o src/lex_config
+ 	$(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) src/startup.o src/yacc_config.o src/lex_config.o $(LIB_OBJS) $(ARCH_LIB_OBJS)
+ 	$(QUIET) $(STRIPCMD) $@
+ 
+-yacc_config.o lex_config.o: %.o: %.c
+-	$(CC) -c -MD -O -pipe $(CPPFLAGS) $<
++src/lex_config.o:src/yacc_config.h
+ 
+ debugtools: ccdv $(CBDUMP) $(CISDUMP)
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_fix.patch b/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_fix.patch
new file mode 100644
index 0000000..7b0ce21
--- /dev/null
+++ b/meta/recipes-bsp/pcmciautils/pcmciautils-018/makefile_fix.patch
@@ -0,0 +1,101 @@
+Upstream-Status: Inappropriate [configuration]
+
+Hardcoded paths are bad...
+This lets us use the install from OE's native sysroot
+rebase the patch to 018, removing hardcoded path for true
+as well. Removing of -D in install invocation is a little
+questionable, is it some GNU extention?
+
+-Khem Raj <raj.khem@gmail.com>
+
+Index: pcmciautils-018/Makefile
+===================================================================
+--- pcmciautils-018.orig/Makefile
++++ pcmciautils-018/Makefile
+@@ -76,7 +76,7 @@ sbindir =	${exec_prefix}/sbin
+ mandir =	${prefix}/usr/share/man
+ udevdir =	${prefix}/lib/udev
+ 
+-INSTALL = /usr/bin/install -c
++INSTALL = install -c
+ INSTALL_PROGRAM = ${INSTALL}
+ INSTALL_DATA  = ${INSTALL} -m 644
+ INSTALL_SCRIPT = ${INSTALL_PROGRAM}
+@@ -180,7 +180,7 @@ endif
+ # if DEBUG is enabled, then we do not strip or optimize
+ ifeq ($(strip $(DEBUG)),true)
+ 	CFLAGS  += -O1 -g -DDEBUG -D_GNU_SOURCE
+-	STRIPCMD = /bin/true -Since_we_are_debugging
++	STRIPCMD = true -Since_we_are_debugging
+ else
+ 	CFLAGS  += $(OPTIMIZATION) -fomit-frame-pointer -D_GNU_SOURCE
+ 	STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
+@@ -273,30 +273,32 @@ clean:
+ 
+ install-hotplug:
+ 	$(INSTALL) -d $(DESTDIR)$(hotplugdir)
+-	$(INSTALL_PROGRAM) -D hotplug/pcmcia.agent $(DESTDIR)$(hotplugdir)/pcmcia.agent
+-	$(INSTALL_PROGRAM) -D hotplug/pcmcia.rc $(DESTDIR)$(hotplugdir)/pcmcia.rc
++	$(INSTALL_PROGRAM) hotplug/pcmcia.agent $(DESTDIR)$(hotplugdir)/pcmcia.agent
++	$(INSTALL_PROGRAM) hotplug/pcmcia.rc $(DESTDIR)$(hotplugdir)/pcmcia.rc
+ 
+ uninstall-hotplug:
+ 	- rm -f $(DESTDIR)$(hotplugdir)/pcmcia.agent $(DESTDIR)$(hotplugdir)/pcmcia.rc
+ 
+ install-socket-hotplug:
+-	$(INSTALL_PROGRAM) -D hotplug/pcmcia_socket.agent $(DESTDIR)$(hotplugdir)/pcmcia_socket.agent
+-	$(INSTALL_PROGRAM) -D hotplug/pcmcia_socket.rc $(DESTDIR)$(hotplugdir)/pcmcia_socket.rc
++	$(INSTALL_PROGRAM) hotplug/pcmcia_socket.agent $(DESTDIR)$(hotplugdir)/pcmcia_socket.agent
++	$(INSTALL_PROGRAM) hotplug/pcmcia_socket.rc $(DESTDIR)$(hotplugdir)/pcmcia_socket.rc
+ 
+ uninstall-socket-hotplug:
+ 	- rm -f $(DESTDIR)$(hotplugdir)/pcmcia_socket.agent $(DESTDIR)$(hotplugdir)/pcmcia_socket.rc
+ 
+ install-socket-tools:
+-	$(INSTALL_PROGRAM) -D $(PCMCIA_SOCKET_STARTUP) $(DESTDIR)$(udevhelperdir)/$(PCMCIA_SOCKET_STARTUP)
++	$(INSTALL) -d $(DESTDIR)$(udevhelperdir)
++	$(INSTALL_PROGRAM) $(PCMCIA_SOCKET_STARTUP) $(DESTDIR)$(udevhelperdir)/$(PCMCIA_SOCKET_STARTUP)
+ 
+ uninstall-socket-tools:
+ 	- rm -f $(DESTDIR)$(udevhelperdir)/$(PCMCIA_SOCKET_STARTUP)
+ 
+ install-tools:
+ 	$(INSTALL) -d $(DESTDIR)$(sbindir)
+-	$(INSTALL_PROGRAM) -D $(PCCARDCTL) $(DESTDIR)$(sbindir)/$(PCCARDCTL)
++	$(INSTALL) -d $(DESTDIR)$(udevhelperdir)
++	$(INSTALL_PROGRAM) $(PCCARDCTL) $(DESTDIR)$(sbindir)/$(PCCARDCTL)
+ 	$(SYMLINK) $(PCCARDCTL) $(DESTDIR)$(sbindir)/$(LSPCMCIA)
+-	$(INSTALL_PROGRAM) -D $(PCMCIA_CHECK_BROKEN_CIS) $(DESTDIR)$(udevhelperdir)/$(PCMCIA_CHECK_BROKEN_CIS)
++	$(INSTALL_PROGRAM) $(PCMCIA_CHECK_BROKEN_CIS) $(DESTDIR)$(udevhelperdir)/$(PCMCIA_CHECK_BROKEN_CIS)
+ 
+ uninstall-tools:
+ 	- rm -f $(DESTDIR)$(sbindir)/$(PCCARDCTL)
+@@ -305,22 +307,24 @@ uninstall-tools:
+ 
+ install-config:
+ 	$(INSTALL) -d $(DESTDIR)$(pcmciaconfdir)
+-	$(INSTALL_DATA)  -D config/config.opts $(DESTDIR)$(pcmciaconfdir)/config.opts
++	$(INSTALL_DATA)  config/config.opts $(DESTDIR)$(pcmciaconfdir)/config.opts
+ 	if [ -f config/config.opts.$(ARCH) ]; then \
+-		$(INSTALL_DATA) -D config/config.opts.$(ARCH) $(DESTDIR)$(pcmciaconfdir)/config.opts; \
++		$(INSTALL_DATA) config/config.opts.$(ARCH) $(DESTDIR)$(pcmciaconfdir)/config.opts; \
+ 	fi
+ 
+ uninstall-config:
+ #	- rm -f $(DESTDIR)$(pcmciaconfdir)/config.opts
+ 
+ install-udev:
+-	$(INSTALL_DATA) -D $(UDEV_RULES_FILE) $(DESTDIR)$(udevrulesdir)/60-pcmcia.rules
++	$(INSTALL) -d $(DESTDIR)$(udevrulesdir)
++	$(INSTALL_DATA) $(UDEV_RULES_FILE) $(DESTDIR)$(udevrulesdir)/60-pcmcia.rules
+ 
+ uninstall-udev:
+ 	- rm -f $(DESTDIR)$(udevrulesdir)/60-pcmcia.rules
+ 
+ install-man:
+-	$(INSTALL_DATA) -D man/man8/pccardctl.8 $(DESTDIR)$(mandir)/man8/pccardctl.8
++	$(INSTALL) -d $(DESTDIR)$(mandir)/man8
++	$(INSTALL_DATA) man/man8/pccardctl.8 $(DESTDIR)$(mandir)/man8/pccardctl.8
+ 	$(SYMLINK) pccardctl.8 $(DESTDIR)$(mandir)/man8/lspcmcia.8
+ 
+ uninstall-man:
diff --git a/meta/recipes-bsp/pcmciautils/pcmciautils.inc b/meta/recipes-bsp/pcmciautils/pcmciautils.inc
new file mode 100644
index 0000000..9d1c55b
--- /dev/null
+++ b/meta/recipes-bsp/pcmciautils/pcmciautils.inc
@@ -0,0 +1,32 @@
+SUMMARY = "Linux kernel userland utilities for the PCMCIA subsystem"
+HOMEPAGE = "https://www.kernel.org/pub/linux/utils/kernel/pcmcia/"
+SECTION = "kernel/userland"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "udev sysfsutils flex-native"
+RDEPENDS_${PN} = "udev module-init-tools"
+
+SRC_URI = "http://mirror.linux.org.au/linux/utils/kernel/pcmcia/${BP}.tar.bz2"
+
+S = "${WORKDIR}/pcmciautils-${PV}"
+
+export HOSTCC = "${BUILD_CC}"
+export etcdir = "${sysconfdir}"
+export sbindir = "${base_sbindir}"
+export pcmciaconfdir = "${sysconfdir}/pcmcia"
+export udevdir = "`pkg-config --variable=udevdir udev`"
+export udevrulesdir = "`pkg-config --variable=udevdir udev`/rules.d"
+export UDEV = "1"
+LD = "${CC}"
+CFLAGS =+ "-I${S}/src"
+CFLAGS =+ "-DPCMCIAUTILS_VERSION=\\"${PV}\\""
+
+EXTRA_OEMAKE = "-e 'STRIP=echo' 'LIB_OBJS=-lc -lsysfs' 'LEX=flex'"
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install
+}
+
+CONFFILES_${PN} += "${sysconfdir}/pcmcia/config.opts"
diff --git a/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb b/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb
new file mode 100644
index 0000000..857bd07
--- /dev/null
+++ b/meta/recipes-bsp/pcmciautils/pcmciautils_018.bb
@@ -0,0 +1,13 @@
+require pcmciautils.inc
+
+SRC_URI += "file://makefile_fix.patch \
+            file://0001-fix-a-parallel-building-issue.patch \
+"
+
+SRC_URI[md5sum] = "5d85669b3440baa4532363da6caaf1b4"
+SRC_URI[sha256sum] = "79e6ae441278e178c07501d492394ed2c0326fdb66894f6d040ec811b0dc8ed5"
+
+PR = "r1"
+
+FILES_${PN}-dbg += "*/udev/.debug */*/udev/.debug"
+FILES_${PN} += "*/udev */*/udev"
diff --git a/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb b/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb
new file mode 100644
index 0000000..8d35187
--- /dev/null
+++ b/meta/recipes-bsp/pm-utils/pm-utils_1.4.1.bb
@@ -0,0 +1,26 @@
+SECTION = "base"
+SUMMARY = "Utilities and scripts for power management"
+DESCRIPTION = "Simple shell command line tools to suspend and hibernate."
+HOMEPAGE = "http://pm-utils.freedesktop.org/wiki/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://src/pm-pmu.c;beginline=1;endline=22;md5=3c1ddbc54e735fb4a0386e14c78a3147"
+
+PR = "r1"
+
+SRC_URI = "http://pm-utils.freedesktop.org/releases/pm-utils-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "1742a556089c36c3a89eb1b957da5a60"
+SRC_URI[sha256sum] = "8ed899032866d88b2933a1d34cc75e8ae42dcde20e1cc21836baaae3d4370c0b"
+
+inherit pkgconfig autotools
+
+RDEPENDS_${PN} = "grep bash"
+
+do_configure_prepend () {
+	( cd ${S}; autoreconf -f -i -s )
+}
+
+FILES_${PN} += "${libdir}/${BPN}/*"
+FILES_${PN}-dbg += "${libdir}/${BPN}/bin/.debug \
+		    ${datadir}/doc/pm-utils/README.debugging"
diff --git a/meta/recipes-bsp/pointercal/pointercal/COPYING b/meta/recipes-bsp/pointercal/pointercal/COPYING
new file mode 100644
index 0000000..63f5293
--- /dev/null
+++ b/meta/recipes-bsp/pointercal/pointercal/COPYING
@@ -0,0 +1,2 @@
+This is a blank COPYING file, and should be filled in by original author in future.
+
diff --git a/meta/recipes-bsp/pointercal/pointercal/pointercal b/meta/recipes-bsp/pointercal/pointercal/pointercal
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta/recipes-bsp/pointercal/pointercal/pointercal
diff --git a/meta/recipes-bsp/pointercal/pointercal/qemuarm/pointercal b/meta/recipes-bsp/pointercal/pointercal/qemuarm/pointercal
new file mode 100644
index 0000000..abd84ca
--- /dev/null
+++ b/meta/recipes-bsp/pointercal/pointercal/qemuarm/pointercal
@@ -0,0 +1 @@
+8313 4 -8526 7 8334 -82604 65536
diff --git a/meta/recipes-bsp/pointercal/pointercal/qemuarmv6/pointercal b/meta/recipes-bsp/pointercal/pointercal/qemuarmv6/pointercal
new file mode 100644
index 0000000..abd84ca
--- /dev/null
+++ b/meta/recipes-bsp/pointercal/pointercal/qemuarmv6/pointercal
@@ -0,0 +1 @@
+8313 4 -8526 7 8334 -82604 65536
diff --git a/meta/recipes-bsp/pointercal/pointercal/qemuarmv7/pointercal b/meta/recipes-bsp/pointercal/pointercal/qemuarmv7/pointercal
new file mode 100644
index 0000000..abd84ca
--- /dev/null
+++ b/meta/recipes-bsp/pointercal/pointercal/qemuarmv7/pointercal
@@ -0,0 +1 @@
+8313 4 -8526 7 8334 -82604 65536
diff --git a/meta/recipes-bsp/pointercal/pointercal/qemumips/pointercal b/meta/recipes-bsp/pointercal/pointercal/qemumips/pointercal
new file mode 100644
index 0000000..abd84ca
--- /dev/null
+++ b/meta/recipes-bsp/pointercal/pointercal/qemumips/pointercal
@@ -0,0 +1 @@
+8313 4 -8526 7 8334 -82604 65536
diff --git a/meta/recipes-bsp/pointercal/pointercal/qemuppc/pointercal b/meta/recipes-bsp/pointercal/pointercal/qemuppc/pointercal
new file mode 100644
index 0000000..c2d6e37
--- /dev/null
+++ b/meta/recipes-bsp/pointercal/pointercal/qemuppc/pointercal
Binary files differ
diff --git a/meta/recipes-bsp/pointercal/pointercal/qemux86-64/pointercal b/meta/recipes-bsp/pointercal/pointercal/qemux86-64/pointercal
new file mode 100644
index 0000000..640053d
--- /dev/null
+++ b/meta/recipes-bsp/pointercal/pointercal/qemux86-64/pointercal
@@ -0,0 +1 @@
+1280 0 1002 0 960 328 65536
diff --git a/meta/recipes-bsp/pointercal/pointercal/qemux86/pointercal b/meta/recipes-bsp/pointercal/pointercal/qemux86/pointercal
new file mode 100644
index 0000000..640053d
--- /dev/null
+++ b/meta/recipes-bsp/pointercal/pointercal/qemux86/pointercal
@@ -0,0 +1 @@
+1280 0 1002 0 960 328 65536
diff --git a/meta/recipes-bsp/pointercal/pointercal_0.0.bb b/meta/recipes-bsp/pointercal/pointercal_0.0.bb
new file mode 100644
index 0000000..df735a5
--- /dev/null
+++ b/meta/recipes-bsp/pointercal/pointercal_0.0.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Touchscreen calibration data"
+SECTION = "base"
+PR = "r11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4b5fcfc87fb615860d398b5e38685edf"
+
+SRC_URI = "file://pointercal \
+           file://COPYING"
+
+S = "${WORKDIR}"
+
+do_install() {
+	# Only install file if it has a contents
+	if [ -s ${S}/pointercal ]; then
+	        install -d ${D}${sysconfdir}/
+	        install -m 0644 ${S}/pointercal ${D}${sysconfdir}/
+	fi
+}
+
+ALLOW_EMPTY_${PN} = "1"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/meta/recipes-bsp/setserial/setserial/add_stdlib.patch b/meta/recipes-bsp/setserial/setserial/add_stdlib.patch
new file mode 100644
index 0000000..e34f262
--- /dev/null
+++ b/meta/recipes-bsp/setserial/setserial/add_stdlib.patch
@@ -0,0 +1,18 @@
+# This patch addes stdlib.h to fix compiler warnings due to the exit
+# built-in not being defined and getting an incorrect implicit definition
+
+Upstream-Status: Pending
+
+Created-by: Saul Wold <saul.wold@intel.com>
+
+--- setserial-2.17/setserial.c	2010-09-02 14:11:27.569763088 -0700
++++ setserial-2.17_fixed/setserial.c	2010-09-02 14:11:08.546264139 -0700
+@@ -11,6 +11,7 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <fcntl.h>
+ #include <termios.h>
+ #include <string.h>
+
diff --git a/meta/recipes-bsp/setserial/setserial/ldflags.patch b/meta/recipes-bsp/setserial/setserial/ldflags.patch
new file mode 100644
index 0000000..174adc8
--- /dev/null
+++ b/meta/recipes-bsp/setserial/setserial/ldflags.patch
@@ -0,0 +1,24 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- setserial-2.17.orig/Makefile.in
++++ setserial-2.17/Makefile.in
+@@ -13,6 +13,7 @@ STRIP = @STRIP@
+ CC = @CC@
+ RM = rm -f
+ CFLAGS = @CFLAGS@
++LDFLAGS = @LDFLAGS@
+ DEFS = @DEFS@
+ INCS = -I.
+ TAR = tar
+@@ -20,7 +21,7 @@ TAR = tar
+ all: setserial setserial.cat
+
+ setserial: setserial.c
+-	$(CC) $(CFLAGS) $(DEFS) $(INCS) setserial.c -o setserial
++	$(CC) $(CFLAGS) $(LDFLAGS) $(DEFS) $(INCS) setserial.c -o setserial
+
+ setserial.cat: setserial.8
+	nroff -man setserial.8 > setserial.cat
diff --git a/meta/recipes-bsp/setserial/setserial_2.17.bb b/meta/recipes-bsp/setserial/setserial_2.17.bb
new file mode 100644
index 0000000..8dbddd7
--- /dev/null
+++ b/meta/recipes-bsp/setserial/setserial_2.17.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Controls the configuration of serial ports"
+DESCRIPTION = "setserial is a program designed to set and/or report the configuration information associated with a serial port"
+HOMEPAGE = "http://setserial.sourceforge.net"
+AUTHOR = "Theodore Ts'o <tytso@mit.edu>"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2.0"
+LIC_FILES_CHKSUM = "file://version.h;beginline=1;endline=6;md5=2e7c59cb9e57e356ae81f50f4e4dfd99"
+PR = "r3"
+
+DEPENDS += "groff-native"
+
+inherit autotools-brokensep
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/setserial/${BPN}-${PV}.tar.gz \
+           file://add_stdlib.patch \
+           file://ldflags.patch \
+          "
+
+SRC_URI[md5sum] = "c4867d72c41564318e0107745eb7a0f2"
+SRC_URI[sha256sum] = "7e4487d320ac31558563424189435d396ddf77953bb23111a17a3d1487b5794a"
+
+do_install() {
+    install -d ${D}${bindir}
+    install -d ${D}${mandir}/man8
+
+    install -m 0755 ${S}/setserial   ${D}${bindir}
+    install -m 0644 ${S}/setserial.8 ${D}${mandir}/man8
+}
diff --git a/meta/recipes-bsp/u-boot/u-boot-fw-utils_2015.07.bb b/meta/recipes-bsp/u-boot/u-boot-fw-utils_2015.07.bb
new file mode 100644
index 0000000..0df7a05
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/u-boot-fw-utils_2015.07.bb
@@ -0,0 +1,49 @@
+SUMMARY = "U-Boot bootloader fw_printenv/setenv utilities"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95"
+SECTION = "bootloader"
+DEPENDS = "mtd-utils"
+
+# This revision corresponds to the tag "v2015.07"
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "33711bdd4a4dce942fb5ae85a68899a8357bdd94"
+
+PV = "v2015.07+git${SRCPV}"
+
+SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
+
+S = "${WORKDIR}/git"
+
+INSANE_SKIP_${PN} = "already-stripped"
+EXTRA_OEMAKE_class-target = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+EXTRA_OEMAKE_class-cross = 'ARCH=${TARGET_ARCH} CC="${CC} ${CFLAGS} ${LDFLAGS}" V=1'
+
+inherit uboot-config
+
+do_compile () {
+	oe_runmake ${UBOOT_MACHINE}
+	oe_runmake env
+}
+
+do_install () {
+	install -d ${D}${base_sbindir}
+	install -d ${D}${sysconfdir}
+	install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_printenv
+	install -m 755 ${S}/tools/env/fw_printenv ${D}${base_sbindir}/fw_setenv
+	install -m 0644 ${S}/tools/env/fw_env.config ${D}${sysconfdir}/fw_env.config
+}
+
+do_install_class-cross () {
+	install -d ${D}${bindir_cross}
+	install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_printenv
+	install -m 755 ${S}/tools/env/fw_printenv ${D}${bindir_cross}/fw_setenv
+}
+
+SYSROOT_PREPROCESS_FUNCS_class-cross = "uboot_fw_utils_cross"
+uboot_fw_utils_cross() {
+	sysroot_stage_dir ${D}${bindir_cross} ${SYSROOT_DESTDIR}${bindir_cross}
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+BBCLASSEXTEND = "cross"
diff --git a/meta/recipes-bsp/u-boot/u-boot-mkimage_2015.07.bb b/meta/recipes-bsp/u-boot/u-boot-mkimage_2015.07.bb
new file mode 100644
index 0000000..ba29bbb
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/u-boot-mkimage_2015.07.bb
@@ -0,0 +1,32 @@
+SUMMARY = "U-Boot bootloader image creation tool"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95"
+SECTION = "bootloader"
+
+DEPENDS = "openssl"
+
+# This revision corresponds to the tag "v2015.07"
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "33711bdd4a4dce942fb5ae85a68899a8357bdd94"
+
+PV = "v2015.07+git${SRCPV}"
+
+SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = 'CROSS_COMPILE="${TARGET_PREFIX}" CC="${CC} ${CFLAGS} ${LDFLAGS}" STRIP=true V=1'
+
+do_compile () {
+	oe_runmake sandbox_defconfig
+	oe_runmake cross_tools NO_SDL=1
+}
+
+do_install () {
+	install -d ${D}${bindir}
+	install -m 0755 tools/mkimage ${D}${bindir}/uboot-mkimage
+	ln -sf uboot-mkimage ${D}${bindir}/mkimage
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-bsp/u-boot/u-boot.inc b/meta/recipes-bsp/u-boot/u-boot.inc
new file mode 100644
index 0000000..e66ffd1
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/u-boot.inc
@@ -0,0 +1,290 @@
+SUMMARY = "Universal Boot Loader for embedded devices"
+HOMEPAGE = "http://www.denx.de/wiki/U-Boot/WebHome"
+SECTION = "bootloaders"
+PROVIDES = "virtual/bootloader"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://Licenses/README;md5=0507cd7da8e7ad6d6701926ec9b84c95"
+
+SRC_URI = "git://git.denx.de/u-boot.git;branch=master"
+
+S = "${WORKDIR}/git"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit uboot-config deploy
+
+EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}" V=1'
+EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}"'
+
+PACKAGECONFIG ??= "openssl"
+# u-boot will compile its own tools during the build, with specific
+# configurations (aka when CONFIG_FIT_SIGNATURE is enabled) openssl is needed as
+# a host build dependency.
+PACKAGECONFIG[openssl] = ",,openssl-native"
+
+# Allow setting an additional version string that will be picked up by the
+# u-boot build system and appended to the u-boot version.  If the .scmversion
+# file already exists it will not be overwritten.
+UBOOT_LOCALVERSION ?= ""
+
+# Some versions of u-boot use .bin and others use .img.  By default use .bin
+# but enable individual recipes to change this value.
+UBOOT_SUFFIX ??= "bin"
+UBOOT_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_SUFFIX}"
+UBOOT_BINARY ?= "u-boot.${UBOOT_SUFFIX}"
+UBOOT_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_SUFFIX}"
+UBOOT_MAKE_TARGET ?= "all"
+
+# Output the ELF generated. Some platforms can use the ELF file and directly
+# load it (JTAG booting, QEMU) additionally the ELF can be used for debugging
+# purposes.
+UBOOT_ELF ?= ""
+UBOOT_ELF_SUFFIX ?= "elf"
+UBOOT_ELF_IMAGE ?= "u-boot-${MACHINE}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}"
+UBOOT_ELF_BINARY ?= "u-boot.${UBOOT_ELF_SUFFIX}"
+UBOOT_ELF_SYMLINK ?= "u-boot-${MACHINE}.${UBOOT_ELF_SUFFIX}"
+
+# Some versions of u-boot build an SPL (Second Program Loader) image that
+# should be packaged along with the u-boot binary as well as placed in the
+# deploy directory.  For those versions they can set the following variables
+# to allow packaging the SPL.
+SPL_BINARY ?= ""
+SPL_IMAGE ?= "${SPL_BINARY}-${MACHINE}-${PV}-${PR}"
+SPL_SYMLINK ?= "${SPL_BINARY}-${MACHINE}"
+
+# Additional environment variables or a script can be installed alongside
+# u-boot to be used automatically on boot.  This file, typically 'uEnv.txt'
+# or 'boot.scr', should be packaged along with u-boot as well as placed in the
+# deploy directory.  Machine configurations needing one of these files should
+# include it in the SRC_URI and set the UBOOT_ENV parameter.
+UBOOT_ENV_SUFFIX ?= "txt"
+UBOOT_ENV ?= ""
+UBOOT_ENV_BINARY ?= "${UBOOT_ENV}.${UBOOT_ENV_SUFFIX}"
+UBOOT_ENV_IMAGE ?= "${UBOOT_ENV}-${MACHINE}-${PV}-${PR}.${UBOOT_ENV_SUFFIX}"
+UBOOT_ENV_SYMLINK ?= "${UBOOT_ENV}-${MACHINE}.${UBOOT_ENV_SUFFIX}"
+
+do_compile () {
+	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then
+		sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' config.mk
+	fi
+
+	unset LDFLAGS
+	unset CFLAGS
+	unset CPPFLAGS
+
+	if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]
+	then
+		echo ${UBOOT_LOCALVERSION} > ${B}/.scmversion
+		echo ${UBOOT_LOCALVERSION} > ${S}/.scmversion
+	fi
+    
+    if [ "x${UBOOT_CONFIG}" != "x" ]
+    then
+        for config in ${UBOOT_MACHINE}; do
+            i=`expr $i + 1`;
+            for type  in ${UBOOT_CONFIG}; do
+                j=`expr $j + 1`;
+                if [ $j -eq $i ]
+                then
+                    oe_runmake O=${config} ${config}
+                    oe_runmake O=${config} ${UBOOT_MAKE_TARGET}
+                    cp  ${S}/${config}/${UBOOT_BINARY}  ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX}
+                fi
+            done
+            unset  j
+        done
+        unset  i
+    else
+        oe_runmake ${UBOOT_MACHINE}
+        oe_runmake ${UBOOT_MAKE_TARGET}
+    fi
+
+}
+
+do_install () {
+    if [ "x${UBOOT_CONFIG}" != "x" ]
+    then
+        for config in ${UBOOT_MACHINE}; do
+            i=`expr $i + 1`;
+            for type in ${UBOOT_CONFIG}; do
+                j=`expr $j + 1`;
+                if [ $j -eq $i ]
+                then
+                    install -d ${D}/boot
+                    install ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
+                    ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
+                    ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${D}/boot/${UBOOT_BINARY}
+                fi
+            done
+            unset  j
+        done
+        unset  i
+    else
+        install -d ${D}/boot
+        install ${S}/${UBOOT_BINARY} ${D}/boot/${UBOOT_IMAGE}
+        ln -sf ${UBOOT_IMAGE} ${D}/boot/${UBOOT_BINARY}
+    fi
+
+    if [ "x${UBOOT_ELF}" != "x" ]
+    then
+        if [ "x${UBOOT_CONFIG}" != "x" ]
+        then
+            for config in ${UBOOT_MACHINE}; do
+                i=`expr $i + 1`;
+                for type in ${UBOOT_CONFIG}; do
+                    j=`expr $j + 1`;
+                    if [ $j -eq $i ]
+                    then
+                        install ${S}/${config}/${UBOOT_ELF} ${D}/boot/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
+                        ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}-${type}
+                        ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${D}/boot/${UBOOT_BINARY}
+                    fi
+                done
+                unset j
+            done
+            unset i
+        else
+            install ${S}/${UBOOT_ELF} ${D}/boot/${UBOOT_ELF_IMAGE}
+            ln -sf ${UBOOT_ELF_IMAGE} ${D}/boot/${UBOOT_ELF_BINARY}
+        fi
+    fi
+
+    if [ -e ${WORKDIR}/fw_env.config ] ; then
+        install -d ${D}${sysconfdir}
+        install -m 644 ${WORKDIR}/fw_env.config ${D}${sysconfdir}/fw_env.config
+    fi
+
+    if [ "x${SPL_BINARY}" != "x" ]
+    then
+        if [ "x${UBOOT_CONFIG}" != "x" ]   
+        then
+            for config in ${UBOOT_MACHINE}; do
+                i=`expr $i + 1`;
+                for type in ${UBOOT_CONFIG}; do
+                    j=`expr $j + 1`;
+                    if [ $j -eq $i ]
+                    then
+                         install ${S}/${config}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}-${type}-${PV}-${PR}
+                         ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARY}-${type}
+                         ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${D}/boot/${SPL_BINARY}
+                    fi
+                done
+                unset  j
+            done
+            unset  i
+        else
+            install ${S}/${SPL_BINARY} ${D}/boot/${SPL_IMAGE}
+            ln -sf ${SPL_IMAGE} ${D}/boot/${SPL_BINARY}
+        fi
+    fi
+
+    if [ "x${UBOOT_ENV}" != "x" ]
+    then
+        install ${WORKDIR}/${UBOOT_ENV_BINARY} ${D}/boot/${UBOOT_ENV_IMAGE}
+        ln -sf ${UBOOT_ENV_IMAGE} ${D}/boot/${UBOOT_ENV_BINARY}
+    fi
+}
+
+FILES_${PN} = "/boot ${sysconfdir}"
+# Ensure the split debug part of any elf files are put into dbg
+FILES_${PN}-dbg += "/boot/.debug"
+
+do_deploy () {
+    if [ "x${UBOOT_CONFIG}" != "x" ]
+    then
+        for config in ${UBOOT_MACHINE}; do
+            i=`expr $i + 1`;
+            for type in ${UBOOT_CONFIG}; do
+                j=`expr $j + 1`;
+                if [ $j -eq $i ]
+                then
+                    install -d ${DEPLOYDIR}
+                    install ${S}/${config}/u-boot-${type}.${UBOOT_SUFFIX} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX}
+                    cd ${DEPLOYDIR}
+                    ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}-${type}
+                    ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_SYMLINK}
+                    ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}-${type}
+                    ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_SUFFIX} ${UBOOT_BINARY}
+                fi 
+            done 
+            unset  j
+        done
+        unset  i
+    else
+        install -d ${DEPLOYDIR}
+        install ${S}/${UBOOT_BINARY} ${DEPLOYDIR}/${UBOOT_IMAGE}
+        cd ${DEPLOYDIR}
+        rm -f ${UBOOT_BINARY} ${UBOOT_SYMLINK}
+        ln -sf ${UBOOT_IMAGE} ${UBOOT_SYMLINK}
+        ln -sf ${UBOOT_IMAGE} ${UBOOT_BINARY}
+   fi
+
+    if [ "x${UBOOT_ELF}" != "x" ]
+    then
+        if [ "x${UBOOT_CONFIG}" != "x" ]
+        then
+            for config in ${UBOOT_MACHINE}; do
+                i=`expr $i + 1`;
+                for type in ${UBOOT_CONFIG}; do
+                    j=`expr $j + 1`;
+                    if [ $j -eq $i ]
+                    then
+                        install ${S}/${config}/${UBOOT_ELF} ${DEPLOYDIR}/u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX}
+                        ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}-${type}
+                        ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
+                        ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}-${type}
+                        ln -sf u-boot-${type}-${PV}-${PR}.${UBOOT_ELF_SUFFIX} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
+                    fi
+                done
+                unset j
+            done
+            unset i
+        else
+            install ${S}/${UBOOT_ELF} ${DEPLOYDIR}/${UBOOT_ELF_IMAGE}
+            ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_BINARY}
+            ln -sf ${UBOOT_ELF_IMAGE} ${DEPLOYDIR}/${UBOOT_ELF_SYMLINK}
+        fi
+    fi
+
+
+     if [ "x${SPL_BINARY}" != "x" ]
+     then
+         if [ "x${UBOOT_CONFIG}" != "x" ]   
+         then
+             for config in ${UBOOT_MACHINE}; do
+                 i=`expr $i + 1`;
+                 for type in ${UBOOT_CONFIG}; do
+                     j=`expr $j + 1`;
+                     if [ $j -eq $i ]
+                     then
+                         install ${S}/${config}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}-${type}-${PV}-${PR}
+                         rm -f ${DEPLOYDIR}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
+                         ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARY}-${type}
+                         ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_BINARY}
+                         ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}-${type}
+                         ln -sf ${SPL_IMAGE}-${type}-${PV}-${PR} ${DEPLOYDIR}/${SPL_SYMLINK}
+                     fi
+                 done
+                 unset  j
+             done
+             unset  i
+         else
+             install ${S}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_IMAGE}
+             rm -f ${DEPLOYDIR}/${SPL_BINARY} ${DEPLOYDIR}/${SPL_SYMLINK}
+             ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_BINARY}
+             ln -sf ${SPL_IMAGE} ${DEPLOYDIR}/${SPL_SYMLINK}
+         fi
+     fi
+
+
+    if [ "x${UBOOT_ENV}" != "x" ]
+    then
+        install ${WORKDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_IMAGE}
+        rm -f ${DEPLOYDIR}/${UBOOT_ENV_BINARY} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
+        ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_BINARY}
+        ln -sf ${UBOOT_ENV_IMAGE} ${DEPLOYDIR}/${UBOOT_ENV_SYMLINK}
+    fi
+}
+
+addtask deploy before do_build after do_compile
diff --git a/meta/recipes-bsp/u-boot/u-boot/0001-u-boot-mpc85xx-u-boot-.lds-remove-_GLOBAL_OFFSET_TAB.patch b/meta/recipes-bsp/u-boot/u-boot/0001-u-boot-mpc85xx-u-boot-.lds-remove-_GLOBAL_OFFSET_TAB.patch
new file mode 100644
index 0000000..dfbcd45
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/u-boot/0001-u-boot-mpc85xx-u-boot-.lds-remove-_GLOBAL_OFFSET_TAB.patch
@@ -0,0 +1,184 @@
+From 92598e1515b2ec3851af1f064075d0457f01272d Mon Sep 17 00:00:00 2001
+From: Zhenhua Luo <zhenhua.luo@freescale.com>
+Date: Mon, 9 Feb 2015 18:33:56 +0800
+Subject: [PATCH] powerpc/cpu/*/u-boot*.lds: remove _GLOBAL_OFFSET_TABLE_
+ definition
+Organization: O.S. Systems Software LTDA.
+
+In binutils-2.25, the _GLOBAL_OFFSET_TABLE_ symbols defined by PROVIDE in
+u-boot.lds overrides the linker built-in symbols
+(https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=b893397a4b1316610f49819344817715e4305de9),
+so the linker is treating _GLOBAL_OFFSET_TABLE_ as a definition into the .reloc section.
+
+To align with the change of binutils-2.25, the _GLOBAL_OFFSET_TABLE_ symbol
+should not be defined in sections, and the symbols in linker generated .got
+section should be used(https://sourceware.org/ml/binutils/2008-09/msg00122.html).
+
+Fixed the following build errors with binutils-2.25:
+| powerpc-poky-linux-gnuspe-ld.bfd: _GLOBAL_OFFSET_TABLE_ not defined in linker created .got
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+
+Upstream-Status: Pending
+---
+ arch/powerpc/cpu/mpc512x/u-boot.lds          | 1 -
+ arch/powerpc/cpu/mpc5xx/u-boot.lds           | 1 -
+ arch/powerpc/cpu/mpc5xxx/u-boot.lds          | 1 -
+ arch/powerpc/cpu/mpc8260/u-boot.lds          | 1 -
+ arch/powerpc/cpu/mpc83xx/u-boot-spl.lds      | 1 -
+ arch/powerpc/cpu/mpc83xx/u-boot.lds          | 1 -
+ arch/powerpc/cpu/mpc85xx/u-boot-nand.lds     | 1 -
+ arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds | 1 -
+ arch/powerpc/cpu/mpc85xx/u-boot-spl.lds      | 1 -
+ arch/powerpc/cpu/mpc85xx/u-boot.lds          | 1 -
+ arch/powerpc/cpu/mpc86xx/u-boot.lds          | 1 -
+ arch/powerpc/cpu/ppc4xx/u-boot.lds           | 1 -
+ 12 files changed, 12 deletions(-)
+
+diff --git a/arch/powerpc/cpu/mpc512x/u-boot.lds b/arch/powerpc/cpu/mpc512x/u-boot.lds
+index 9658b21..b32f74e 100644
+--- a/arch/powerpc/cpu/mpc512x/u-boot.lds
++++ b/arch/powerpc/cpu/mpc512x/u-boot.lds
+@@ -24,7 +24,6 @@ SECTIONS
+     _GOT2_TABLE_ = .;
+     KEEP(*(.got2))
+     KEEP(*(.got))
+-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+     _FIXUP_TABLE_ = .;
+     KEEP(*(.fixup))
+     *(.fixup)
+diff --git a/arch/powerpc/cpu/mpc5xx/u-boot.lds b/arch/powerpc/cpu/mpc5xx/u-boot.lds
+index 7198465..6a53571 100644
+--- a/arch/powerpc/cpu/mpc5xx/u-boot.lds
++++ b/arch/powerpc/cpu/mpc5xx/u-boot.lds
+@@ -33,7 +33,6 @@ SECTIONS
+     _GOT2_TABLE_ = .;
+     KEEP(*(.got2))
+     KEEP(*(.got))
+-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+     _FIXUP_TABLE_ = .;
+     KEEP(*(.fixup))
+   }
+diff --git a/arch/powerpc/cpu/mpc5xxx/u-boot.lds b/arch/powerpc/cpu/mpc5xxx/u-boot.lds
+index cd9e23f..aa80d3d 100644
+--- a/arch/powerpc/cpu/mpc5xxx/u-boot.lds
++++ b/arch/powerpc/cpu/mpc5xxx/u-boot.lds
+@@ -28,7 +28,6 @@ SECTIONS
+     _GOT2_TABLE_ = .;
+     KEEP(*(.got2))
+     KEEP(*(.got))
+-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+     _FIXUP_TABLE_ = .;
+     KEEP(*(.fixup))
+   }
+diff --git a/arch/powerpc/cpu/mpc8260/u-boot.lds b/arch/powerpc/cpu/mpc8260/u-boot.lds
+index 50cbf85..469fc29 100644
+--- a/arch/powerpc/cpu/mpc8260/u-boot.lds
++++ b/arch/powerpc/cpu/mpc8260/u-boot.lds
+@@ -27,7 +27,6 @@ SECTIONS
+     _GOT2_TABLE_ = .;
+     KEEP(*(.got2))
+     KEEP(*(.got))
+-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+     _FIXUP_TABLE_ = .;
+     KEEP(*(.fixup))
+   }
+diff --git a/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds
+index 774772b..4101eaf 100644
+--- a/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds
++++ b/arch/powerpc/cpu/mpc83xx/u-boot-spl.lds
+@@ -24,7 +24,6 @@ SECTIONS
+ 		_GOT2_TABLE_ = .;
+ 		KEEP(*(.got2))
+ 		KEEP(*(.got))
+-		PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+ 	}
+ 	__got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
+ 
+diff --git a/arch/powerpc/cpu/mpc83xx/u-boot.lds b/arch/powerpc/cpu/mpc83xx/u-boot.lds
+index 3c177fa..dbd8bbe 100644
+--- a/arch/powerpc/cpu/mpc83xx/u-boot.lds
++++ b/arch/powerpc/cpu/mpc83xx/u-boot.lds
+@@ -26,7 +26,6 @@ SECTIONS
+     _GOT2_TABLE_ = .;
+     KEEP(*(.got2))
+     KEEP(*(.got))
+-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+     _FIXUP_TABLE_ = .;
+     KEEP(*(.fixup))
+   }
+diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds b/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
+index f933b21..0399f93 100644
+--- a/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
++++ b/arch/powerpc/cpu/mpc85xx/u-boot-nand.lds
+@@ -44,7 +44,6 @@ SECTIONS
+     _GOT2_TABLE_ = .;
+     KEEP(*(.got2))
+     KEEP(*(.got))
+-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+     _FIXUP_TABLE_ = .;
+     KEEP(*(.fixup))
+   }
+diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds
+index b83c553..f044564 100644
+--- a/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds
++++ b/arch/powerpc/cpu/mpc85xx/u-boot-nand_spl.lds
+@@ -22,7 +22,6 @@ SECTIONS
+ 		_GOT2_TABLE_ = .;
+ 		KEEP(*(.got2))
+ 		KEEP(*(.got))
+-		PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+ 		_FIXUP_TABLE_ = .;
+ 		KEEP(*(.fixup))
+ 	}
+diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+index 5ae7b3e..889a4c2 100644
+--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
++++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+@@ -29,7 +29,6 @@ SECTIONS
+ 		_GOT2_TABLE_ = .;
+ 		KEEP(*(.got2))
+ 		KEEP(*(.got))
+-		PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+ 		_FIXUP_TABLE_ = .;
+ 		KEEP(*(.fixup))
+ 	}
+diff --git a/arch/powerpc/cpu/mpc85xx/u-boot.lds b/arch/powerpc/cpu/mpc85xx/u-boot.lds
+index 2cf0b25..f15eaf3 100644
+--- a/arch/powerpc/cpu/mpc85xx/u-boot.lds
++++ b/arch/powerpc/cpu/mpc85xx/u-boot.lds
+@@ -50,7 +50,6 @@ SECTIONS
+     _GOT2_TABLE_ = .;
+     KEEP(*(.got2))
+     KEEP(*(.got))
+-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+     _FIXUP_TABLE_ = .;
+     KEEP(*(.fixup))
+   }
+diff --git a/arch/powerpc/cpu/mpc86xx/u-boot.lds b/arch/powerpc/cpu/mpc86xx/u-boot.lds
+index 58467c2..6c48f40 100644
+--- a/arch/powerpc/cpu/mpc86xx/u-boot.lds
++++ b/arch/powerpc/cpu/mpc86xx/u-boot.lds
+@@ -32,7 +32,6 @@ SECTIONS
+     _GOT2_TABLE_ = .;
+     KEEP(*(.got2))
+     KEEP(*(.got))
+-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+     _FIXUP_TABLE_ = .;
+     KEEP(*(.fixup))
+   }
+diff --git a/arch/powerpc/cpu/ppc4xx/u-boot.lds b/arch/powerpc/cpu/ppc4xx/u-boot.lds
+index 1980508..55dd4e1 100644
+--- a/arch/powerpc/cpu/ppc4xx/u-boot.lds
++++ b/arch/powerpc/cpu/ppc4xx/u-boot.lds
+@@ -46,7 +46,6 @@ SECTIONS
+     _GOT2_TABLE_ = .;
+     KEEP(*(.got2))
+     KEEP(*(.got))
+-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
+     _FIXUP_TABLE_ = .;
+     KEEP(*(.fixup))
+   }
+-- 
+2.4.6
+
diff --git a/meta/recipes-bsp/u-boot/u-boot_2015.07.bb b/meta/recipes-bsp/u-boot/u-boot_2015.07.bb
new file mode 100644
index 0000000..4746c33
--- /dev/null
+++ b/meta/recipes-bsp/u-boot/u-boot_2015.07.bb
@@ -0,0 +1,14 @@
+require u-boot.inc
+
+DEPENDS += "dtc-native"
+
+# This revision corresponds to the tag "v2015.07"
+# We use the revision in order to avoid having to fetch it from the
+# repo during parse
+SRCREV = "33711bdd4a4dce942fb5ae85a68899a8357bdd94"
+
+SRC_URI += "file://0001-u-boot-mpc85xx-u-boot-.lds-remove-_GLOBAL_OFFSET_TAB.patch"
+
+PV = "v2015.07+git${SRCPV}"
+
+EXTRA_OEMAKE_append = " KCFLAGS=-fgnu89-inline"
diff --git a/meta/recipes-bsp/usbinit/usbinit.bb b/meta/recipes-bsp/usbinit/usbinit.bb
new file mode 100644
index 0000000..aba44b4
--- /dev/null
+++ b/meta/recipes-bsp/usbinit/usbinit.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Initscript for enabling USB gadget Ethernet"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
+
+PR = "r3"
+
+SRC_URI = "file://usb-gether \
+           file://COPYING.GPL"
+S = "${WORKDIR}"
+
+do_install() {
+    install -d ${D}${sysconfdir}
+    install -d ${D}${sysconfdir}/init.d
+    install usb-gether ${D}${sysconfdir}/init.d
+}
+
+inherit update-rc.d allarch
+
+INITSCRIPT_NAME = "usb-gether"
+INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
diff --git a/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL b/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/meta/recipes-bsp/usbinit/usbinit/COPYING.GPL
@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/meta/recipes-bsp/usbinit/usbinit/usb-gether b/meta/recipes-bsp/usbinit/usbinit/usb-gether
new file mode 100755
index 0000000..e80a0bb
--- /dev/null
+++ b/meta/recipes-bsp/usbinit/usbinit/usb-gether
@@ -0,0 +1,23 @@
+#! /bin/sh
+#
+# usb-ether 	Start up the gadget usb ethernet interface.
+#
+
+case "$1" in
+	start|"")
+		test "$VERBOSE" != no && echo "Initializing g_ether gadget..."
+		modprobe g_ether
+		ifup usb0
+		;;
+	stop)
+		test "$VERBOSE" != no && echo "Disabling g_ether..."
+		ifdown usb0
+		rmmod g_ether
+		;;
+	*)
+		echo "Usage: usb-ether {start|stop}" >&2
+		exit 1
+		;;
+esac
+
+exit 0
diff --git a/meta/recipes-bsp/usbutils/usbutils-008/iconv.patch b/meta/recipes-bsp/usbutils/usbutils-008/iconv.patch
new file mode 100644
index 0000000..6455567
--- /dev/null
+++ b/meta/recipes-bsp/usbutils/usbutils-008/iconv.patch
@@ -0,0 +1,41 @@
+This patch adds support for detecting iconv support using autotools
+uclibc does not have iconv implementation inside libc like glibc, therefore
+the existing checks were not sufficient, it worked for glibc but not for
+uclibc. The new patch portably detects the iconv support and adds the
+libiconv to linker cmdline
+
+This patch should be submitted upstream too
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: usbutils-008/configure.ac
+===================================================================
+--- usbutils-008.orig/configure.ac
++++ usbutils-008/configure.ac
+@@ -10,7 +10,9 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
+ 
+ AC_CHECK_HEADERS([byteswap.h])
+-AC_CHECK_FUNCS([nl_langinfo iconv])
++
++AM_GNU_GETTEXT
++AM_ICONV
+ 
+ PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.0)
+ 
+Index: usbutils-008/Makefile.am
+===================================================================
+--- usbutils-008.orig/Makefile.am
++++ usbutils-008/Makefile.am
+@@ -29,7 +29,8 @@ lsusb_CPPFLAGS = \
+ 
+ lsusb_LDADD = \
+ 	$(LIBUSB_LIBS) \
+-	$(UDEV_LIBS)
++	$(UDEV_LIBS) \
++	$(LIBICONV)
+ 
+ man_MANS = \
+ 	lsusb.8	\
diff --git a/meta/recipes-bsp/usbutils/usbutils/Fix-NULL-pointer-crash.patch b/meta/recipes-bsp/usbutils/usbutils/Fix-NULL-pointer-crash.patch
new file mode 100644
index 0000000..0efdc59
--- /dev/null
+++ b/meta/recipes-bsp/usbutils/usbutils/Fix-NULL-pointer-crash.patch
@@ -0,0 +1,28 @@
+Fix NULL pointer crash.
+
+Before use usbbuslist, we should check if it is valid.
+
+Upstream-Status: Pending
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ lsusb-t.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/lsusb-t.c b/lsusb-t.c
+index f604155..583a46a 100644
+--- a/lsusb-t.c
++++ b/lsusb-t.c
+@@ -643,6 +643,10 @@ static void sort_busses(void)
+ 	/* need to reverse sort bus numbers */
+ 	struct usbbusnode *t, *p, **pp;
+ 	int swapped;
++
++	if (!usbbuslist)
++		return;
++
+ 	do {
+ 		p = usbbuslist;
+ 		pp = &usbbuslist;
+-- 
+1.7.4.1
+
diff --git a/meta/recipes-bsp/usbutils/usbutils/iconv.patch b/meta/recipes-bsp/usbutils/usbutils/iconv.patch
new file mode 100644
index 0000000..c557334
--- /dev/null
+++ b/meta/recipes-bsp/usbutils/usbutils/iconv.patch
@@ -0,0 +1,40 @@
+This patch adds support for detecting iconv support using autotools
+uclibc does not have iconv implementation inside libc like glibc, therefore
+the existing checks were not sufficient, it worked for glibc but not for
+uclibc. The new patch portably detects the iconv support and adds the
+libiconv to linker cmdline
+
+This patch should be submitted upstream too
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: usbutils-007/configure.ac
+===================================================================
+--- usbutils-007.orig/configure.ac
++++ usbutils-007/configure.ac
+@@ -10,7 +10,9 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
+ 
+ AC_CHECK_HEADERS([byteswap.h])
+-AC_CHECK_FUNCS([nl_langinfo iconv])
++
++AM_GNU_GETTEXT
++AM_ICONV
+ 
+ AC_ARG_ENABLE(zlib,
+ 	AS_HELP_STRING(--disable-zlib,disable support for zlib))
+Index: usbutils-007/Makefile.am
+===================================================================
+--- usbutils-007.orig/Makefile.am
++++ usbutils-007/Makefile.am
+@@ -27,7 +27,7 @@ lsusb_CPPFLAGS = \
+ 	-DDATADIR=\"$(datadir)\"
+ 
+ lsusb_LDADD = \
+-	$(LIBUSB_LIBS)
++	$(LIBUSB_LIBS) $(LIBICONV)
+ 
+ if HAVE_ZLIB
+ lsusb_CPPFLAGS += -DHAVE_LIBZ
diff --git a/meta/recipes-bsp/usbutils/usbutils/usb-devices-avoid-dependency-on-bash.patch b/meta/recipes-bsp/usbutils/usbutils/usb-devices-avoid-dependency-on-bash.patch
new file mode 100644
index 0000000..a6b241f
--- /dev/null
+++ b/meta/recipes-bsp/usbutils/usbutils/usb-devices-avoid-dependency-on-bash.patch
@@ -0,0 +1,30 @@
+From 333d5fbbc03481f1aa222bd68c2609db168ae3e0 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Thu, 26 Jul 2012 10:37:32 +0100
+Subject: [PATCH] usb-devices: avoid dependency on bash
+
+By virtue of having #!/bin/bash this script declared that it requires
+bash, however manual examination, checkbashisms and tests with dash
+and busybox show that it doesn't contain any bashisms, so change the
+header to avoid the dependency.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ usb-devices |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/usb-devices b/usb-devices
+index b2052e2..14a5358 100755
+--- a/usb-devices
++++ b/usb-devices
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ # Copyright: 2009 Greg Kroah-Hartman <greg@kroah.com>
+ #            2009 Randy Dunlap <rdunlap@xenotime.net>
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-bsp/usbutils/usbutils_007.bb b/meta/recipes-bsp/usbutils/usbutils_007.bb
new file mode 100644
index 0000000..b93b2bd
--- /dev/null
+++ b/meta/recipes-bsp/usbutils/usbutils_007.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Host side USB console utilities"
+DESCRIPTION = "Contains the lsusb utility for inspecting the devices connected to the USB bus."
+HOMEPAGE = "http://www.linux-usb.org"
+SECTION = "base"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "libusb zlib virtual/libiconv"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/usb/usbutils/usbutils-${PV}.tar.gz \
+           file://usb-devices-avoid-dependency-on-bash.patch \
+           file://Fix-NULL-pointer-crash.patch \
+           file://iconv.patch \
+          "
+
+SRC_URI[md5sum] = "be6c42294be5c940f208190d3479d50c"
+SRC_URI[sha256sum] = "e65c234cadf7c81b6b1567c440e3b9b31b44f51c27df3e45741b88848d8b37d3"
+
+inherit autotools gettext pkgconfig
+
+do_install_append() {
+	# We only need the compressed copy, remove the uncompressed version
+	rm -f ${D}${datadir}/usb.ids
+}
+
+PACKAGES += "${PN}-ids"
+FILES_${PN}-dev += "${datadir}/pkgconfig"
+FILES_${PN}-ids = "${datadir}/usb*"
+
+RDEPENDS_${PN} = "${PN}-ids"
diff --git a/meta/recipes-bsp/usbutils/usbutils_008.bb b/meta/recipes-bsp/usbutils/usbutils_008.bb
new file mode 100644
index 0000000..0f2d8d4
--- /dev/null
+++ b/meta/recipes-bsp/usbutils/usbutils_008.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Host side USB console utilities"
+DESCRIPTION = "Contains the lsusb utility for inspecting the devices connected to the USB bus."
+HOMEPAGE = "http://www.linux-usb.org"
+SECTION = "base"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "libusb zlib virtual/libiconv systemd"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/usb/usbutils/usbutils-${PV}.tar.gz \
+           file://usb-devices-avoid-dependency-on-bash.patch \
+           file://Fix-NULL-pointer-crash.patch \
+           file://iconv.patch \
+          "
+
+SRC_URI[md5sum] = "cb20148c2e784577e924a7b4c560c8fb"
+SRC_URI[sha256sum] = "6d5f16c2961df37e22e492c736a3e162a8fde24480f23a40d85f79af80d3fe95"
+
+inherit autotools gettext pkgconfig distro_features_check
+# This version of usbutils relies on the udev from systemd, so unless 
+# we can decouple udev from system, we require systemd for now.
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+FILES_${PN}-dev += "${datadir}/pkgconfig"
+
+RDEPENDS_${PN} = "libudev"
+RDEPENDS_${PN}-ptest = "libboost-system libboost-thread"
diff --git a/meta/recipes-bsp/v86d/v86d/Update-x86emu-from-X.org.patch b/meta/recipes-bsp/v86d/v86d/Update-x86emu-from-X.org.patch
new file mode 100644
index 0000000..a09e2a2
--- /dev/null
+++ b/meta/recipes-bsp/v86d/v86d/Update-x86emu-from-X.org.patch
@@ -0,0 +1,21766 @@
+From 1a410ae58f28eeab32fa87626cfd5a663ba33c51 Mon Sep 17 00:00:00 2001
+From: Bernhard Walle <bernhard@bwalle.de>
+Date: Tue, 13 May 2014 23:40:56 +0200
+Subject: [PATCH 2/2] Update x86emu from X.org
+
+This commit updates the x86emu copy from X.org tarball
+(ftp://mirror.csclub.uwaterloo.ca/x.org/current/src/xserver/xorg-server-1.12.2.tar.bz2).
+
+This fixes a compatibility issue between v86d and SeaBIOS VGA BIOS where
+the leal instruction is not decoded properly. Read the
+http://thread.gmane.org/gmane.comp.emulators.qemu/271806 thread for more
+details.
+
+Upstream-Status: Backport
+
+Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
+---
+ libs/x86emu/LICENSE               |   17 -
+ libs/x86emu/debug.c               |  509 +++---
+ libs/x86emu/decode.c              | 1069 ++++++------
+ libs/x86emu/fpu.c                 |  463 +++---
+ libs/x86emu/ops.c                 | 2940 +++++++++++++++++++--------------
+ libs/x86emu/ops2.c                | 1929 +++++++++++-----------
+ libs/x86emu/prim_ops.c            | 3219 +++++++++++++++++++------------------
+ libs/x86emu/sys.c                 |  583 +++----
+ libs/x86emu/validate.c            |   52 +-
+ libs/x86emu/x86emu.h              |   75 +-
+ libs/x86emu/x86emu/debug.h        |  163 +-
+ libs/x86emu/x86emu/decode.h       |   57 +-
+ libs/x86emu/x86emu/fpu.h          |   23 +-
+ libs/x86emu/x86emu/fpu_regs.h     |   44 +-
+ libs/x86emu/x86emu/ops.h          |    6 +-
+ libs/x86emu/x86emu/prim_asm.h     |  251 ++-
+ libs/x86emu/x86emu/prim_ops.h     |  188 +--
+ libs/x86emu/x86emu/prim_x86_gcc.h |   77 +
+ libs/x86emu/x86emu/regs.h         |  101 +-
+ libs/x86emu/x86emu/types.h        |   50 +-
+ libs/x86emu/x86emu/x86emui.h      |   34 +-
+ 21 files changed, 6379 insertions(+), 5471 deletions(-)
+ delete mode 100644 libs/x86emu/LICENSE
+ create mode 100644 libs/x86emu/x86emu/prim_x86_gcc.h
+
+diff --git a/libs/x86emu/LICENSE b/libs/x86emu/LICENSE
+deleted file mode 100644
+index a3ede4a..0000000
+--- a/libs/x86emu/LICENSE
++++ /dev/null
+@@ -1,17 +0,0 @@
+-                         License information
+-                         -------------------
+-
+-The x86emu library is under a BSD style license, comaptible
+-with the XFree86 and X licenses used by XFree86. The
+-original x86emu libraries were under the GNU General Public
+-License. Due to license incompatibilities between the GPL
+-and the XFree86 license, the original authors of the code
+-decided to allow a license change. If you have submitted
+-code to the original x86emu project, and you don't agree
+-with the license change, please contact us and let you
+-know. Your code will be removed to comply with your wishes.
+-
+-If you have any questions about this, please send email to
+-x86emu@linuxlabs.com or KendallB@scitechsoft.com for
+-clarification.
+-
+diff --git a/libs/x86emu/debug.c b/libs/x86emu/debug.c
+index 6fd7f11..1a8d1d6 100644
+--- a/libs/x86emu/debug.c
++++ b/libs/x86emu/debug.c
+@@ -38,6 +38,8 @@
+ ****************************************************************************/
+ 
+ #include "x86emu/x86emui.h"
++#include <stdio.h>
++#include <string.h>
+ #ifndef NO_SYS_HEADERS
+ #include <stdarg.h>
+ #include <stdlib.h>
+@@ -47,46 +49,51 @@
+ 
+ #ifdef DEBUG
+ 
+-static void     print_encoded_bytes (u16 s, u16 o);
+-static void     print_decoded_instruction (void);
+-static int      parse_line (char *s, int *ps, int *n);
+-  
++static void print_encoded_bytes(u16 s, u16 o);
++static void print_decoded_instruction(void);
++static int parse_line(char *s, int *ps, int *n);
++
+ /* should look something like debug's output. */
+-void X86EMU_trace_regs (void)
++void
++X86EMU_trace_regs(void)
+ {
+-	if (DEBUG_TRACE()) {
+-		x86emu_dump_regs();
++    if (DEBUG_TRACE()) {
++        x86emu_dump_regs();
+     }
+-	if (DEBUG_DECODE() && ! DEBUG_DECODE_NOPRINT()) {
+-		printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip);
+-		print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip);
+-		print_decoded_instruction();
++    if (DEBUG_DECODE() && !DEBUG_DECODE_NOPRINT()) {
++        printk("%04x:%04x ", M.x86.saved_cs, M.x86.saved_ip);
++        print_encoded_bytes(M.x86.saved_cs, M.x86.saved_ip);
++        print_decoded_instruction();
+     }
+ }
+ 
+-void X86EMU_trace_xregs (void)
++void
++X86EMU_trace_xregs(void)
+ {
+-	if (DEBUG_TRACE()) {
+-		x86emu_dump_xregs();
++    if (DEBUG_TRACE()) {
++        x86emu_dump_xregs();
+     }
+ }
+ 
+-void x86emu_just_disassemble (void)
++void
++x86emu_just_disassemble(void)
+ {
+     /*
+      * This routine called if the flag DEBUG_DISASSEMBLE is set kind
+      * of a hack!
+      */
+-	printk("%04x:%04x ",M.x86.saved_cs, M.x86.saved_ip);
+-	print_encoded_bytes( M.x86.saved_cs, M.x86.saved_ip);
+-	print_decoded_instruction();
++    printk("%04x:%04x ", M.x86.saved_cs, M.x86.saved_ip);
++    print_encoded_bytes(M.x86.saved_cs, M.x86.saved_ip);
++    print_decoded_instruction();
+ }
+ 
+-static void disassemble_forward (u16 seg, u16 off, int n)
++static void
++disassemble_forward(u16 seg, u16 off, int n)
+ {
+-	X86EMU_sysEnv tregs;
+-	int i;
+-	u8 op1;
++    X86EMU_sysEnv tregs;
++    int i;
++    u8 op1;
++
+     /*
+      * hack, hack, hack.  What we do is use the exact machinery set up
+      * for execution, except that now there is an additional state
+@@ -111,17 +118,17 @@ static void disassemble_forward (u16 seg, u16 off, int n)
+      * This was done for an entirely different reason, but makes a
+      * nice way to get the system to help debug codes.
+      */
+-	tregs = M;
++    tregs = M;
+     tregs.x86.R_IP = off;
+     tregs.x86.R_CS = seg;
+-    
++
+     /* reset the decoding buffers */
+     tregs.x86.enc_str_pos = 0;
+     tregs.x86.enc_pos = 0;
+-    
++
+     /* turn on the "disassemble only, no execute" flag */
+     tregs.x86.debug |= DEBUG_DISASSEMBLE_F;
+- 
++
+     /* DUMP NEXT n instructions to screen in straight_line fashion */
+     /*
+      * This looks like the regular instruction fetch stream, except
+@@ -130,299 +137,359 @@ static void disassemble_forward (u16 seg, u16 off, int n)
+      * the instruction.  XXX --- CHECK THAT MEM IS NOT AFFECTED!!!
+      * Note the use of a copy of the register structure...
+      */
+-    for (i=0; i<n; i++) {
+-		op1 = (*sys_rdb)(((u32)M.x86.R_CS<<4) + (M.x86.R_IP++));
+-		(x86emu_optab[op1])(op1);
++    for (i = 0; i < n; i++) {
++        op1 = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
++        (x86emu_optab[op1]) (op1);
+     }
+     /* end major hack mode. */
+ }
+ 
+-void x86emu_check_ip_access (void)
++void
++x86emu_check_ip_access(void)
+ {
+     /* NULL as of now */
+ }
+ 
+-void x86emu_check_sp_access (void)
++void
++x86emu_check_sp_access(void)
+ {
+ }
+ 
+-void x86emu_check_mem_access (u32 dummy)
++void
++x86emu_check_mem_access(u32 dummy)
+ {
+-	/*  check bounds, etc */
++    /*  check bounds, etc */
+ }
+ 
+-void x86emu_check_data_access (uint dummy1, uint dummy2)
++void
++x86emu_check_data_access(uint dummy1, uint dummy2)
+ {
+-	/*  check bounds, etc */
++    /*  check bounds, etc */
+ }
+ 
+-void x86emu_inc_decoded_inst_len (int x)
++void
++x86emu_inc_decoded_inst_len(int x)
+ {
+-	M.x86.enc_pos += x;
++    M.x86.enc_pos += x;
+ }
+ 
+-void x86emu_decode_printf (char *x)
++void
++x86emu_decode_printf(const char *x)
+ {
+-	sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",x);
+-	M.x86.enc_str_pos += strlen(x);
++    sprintf(M.x86.decoded_buf + M.x86.enc_str_pos, "%s", x);
++    M.x86.enc_str_pos += strlen(x);
+ }
+ 
+-void x86emu_decode_printf2 (char *x, int y)
++void
++x86emu_decode_printf2(const char *x, int y)
+ {
+-	char temp[100];
+-	sprintf(temp,x,y);
+-	sprintf(M.x86.decoded_buf+M.x86.enc_str_pos,"%s",temp);
+-	M.x86.enc_str_pos += strlen(temp);
++    char temp[100];
++
++    snprintf(temp, sizeof(temp), x, y);
++    sprintf(M.x86.decoded_buf + M.x86.enc_str_pos, "%s", temp);
++    M.x86.enc_str_pos += strlen(temp);
+ }
+ 
+-void x86emu_end_instr (void)
++void
++x86emu_end_instr(void)
+ {
+-	M.x86.enc_str_pos = 0;
+-	M.x86.enc_pos = 0;
++    M.x86.enc_str_pos = 0;
++    M.x86.enc_pos = 0;
+ }
+ 
+-static void print_encoded_bytes (u16 s, u16 o)
++static void
++print_encoded_bytes(u16 s, u16 o)
+ {
+     int i;
+     char buf1[64];
+-	for (i=0; i< M.x86.enc_pos; i++) {
+-		sprintf(buf1+2*i,"%02x", fetch_data_byte_abs(s,o+i));
++
++    for (i = 0; i < M.x86.enc_pos; i++) {
++        sprintf(buf1 + 2 * i, "%02x", fetch_data_byte_abs(s, o + i));
+     }
+-	printk("%-20s",buf1);
++    printk("%-20s", buf1);
+ }
+ 
+-static void print_decoded_instruction (void)
++static void
++print_decoded_instruction(void)
+ {
+-	printk("%s", M.x86.decoded_buf);
++    printk("%s", M.x86.decoded_buf);
+ }
+ 
+-void x86emu_print_int_vect (u16 iv)
++void
++x86emu_print_int_vect(u16 iv)
+ {
+-	u16 seg,off;
++    u16 seg, off;
+ 
+-	if (iv > 256) return;
+-	seg   = fetch_data_word_abs(0,iv*4);
+-	off   = fetch_data_word_abs(0,iv*4+2);
+-	printk("%04x:%04x ", seg, off);
++    if (iv > 256)
++        return;
++    seg = fetch_data_word_abs(0, iv * 4);
++    off = fetch_data_word_abs(0, iv * 4 + 2);
++    printk("%04x:%04x ", seg, off);
+ }
+ 
+-void X86EMU_dump_memory (u16 seg, u16 off, u32 amt)
++void
++X86EMU_dump_memory(u16 seg, u16 off, u32 amt)
+ {
+-	u32 start = off & 0xfffffff0;
+-	u32 end  = (off+16) & 0xfffffff0;
+-	u32 i;
+-	u32 current;
+-
+-	current = start;
+-	while (end <= off + amt) {
+-		printk("%04x:%04x ", seg, start);
+-		for (i=start; i< off; i++)
+-		  printk("   ");
+-		for (       ; i< end; i++)
+-		  printk("%02x ", fetch_data_byte_abs(seg,i));
+-		printk("\n");
+-		start = end;
+-		end = start + 16;
+-	}
++    u32 start = off & 0xfffffff0;
++    u32 end = (off + 16) & 0xfffffff0;
++    u32 i;
++    u32 current;
++
++    current = start;
++    while (end <= off + amt) {
++        printk("%04x:%04x ", seg, start);
++        for (i = start; i < off; i++)
++            printk("   ");
++        for (; i < end; i++)
++            printk("%02x ", fetch_data_byte_abs(seg, i));
++        printk("\n");
++        start = end;
++        end = start + 16;
++    }
+ }
+ 
+-void x86emu_single_step (void)
++void
++x86emu_single_step(void)
+ {
+     char s[1024];
+     int ps[10];
+     int ntok;
+     int cmd;
+     int done;
+-		int segment;
++    int segment;
+     int offset;
+     static int breakpoint;
+     static int noDecode = 1;
+-    
++
+     char *p;
+ 
+-		if (DEBUG_BREAK()) {
+-				if (M.x86.saved_ip != breakpoint) {
+-						return;
+-				} else {
+- 	          M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
+-						M.x86.debug |= DEBUG_TRACE_F;
+-						M.x86.debug &= ~DEBUG_BREAK_F;
+-						print_decoded_instruction ();
+-						X86EMU_trace_regs();
+-				}
+-		}
+-    done=0;
+-	offset = M.x86.saved_ip;
++    if (DEBUG_BREAK()) {
++        if (M.x86.saved_ip != breakpoint) {
++            return;
++        }
++        else {
++            M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
++            M.x86.debug |= DEBUG_TRACE_F;
++            M.x86.debug &= ~DEBUG_BREAK_F;
++            print_decoded_instruction();
++            X86EMU_trace_regs();
++        }
++    }
++    done = 0;
++    offset = M.x86.saved_ip;
+     while (!done) {
+         printk("-");
+         p = fgets(s, 1023, stdin);
+         cmd = parse_line(s, ps, &ntok);
+-        switch(cmd) {
+-          case 'u':
+-			disassemble_forward(M.x86.saved_cs,(u16)offset,10);
++        switch (cmd) {
++        case 'u':
++            disassemble_forward(M.x86.saved_cs, (u16) offset, 10);
+             break;
+-          case 'd':  
+-							if (ntok == 2) {
+-									segment = M.x86.saved_cs;
+-									offset = ps[1];
+-									X86EMU_dump_memory(segment,(u16)offset,16);
+-									offset += 16;
+-							} else if (ntok == 3) {
+-									segment = ps[1];
+-									offset = ps[2];
+-									X86EMU_dump_memory(segment,(u16)offset,16);
+-									offset += 16;
+-							} else {
+-									segment = M.x86.saved_cs;
+-									X86EMU_dump_memory(segment,(u16)offset,16);
+-									offset += 16;
+-							}
++        case 'd':
++            if (ntok == 2) {
++                segment = M.x86.saved_cs;
++                offset = ps[1];
++                X86EMU_dump_memory(segment, (u16) offset, 16);
++                offset += 16;
++            }
++            else if (ntok == 3) {
++                segment = ps[1];
++                offset = ps[2];
++                X86EMU_dump_memory(segment, (u16) offset, 16);
++                offset += 16;
++            }
++            else {
++                segment = M.x86.saved_cs;
++                X86EMU_dump_memory(segment, (u16) offset, 16);
++                offset += 16;
++            }
+             break;
+-          case 'c':
+-			M.x86.debug ^= DEBUG_TRACECALL_F;
++        case 'c':
++            M.x86.debug ^= DEBUG_TRACECALL_F;
+             break;
+-          case 's':
+-			M.x86.debug ^= DEBUG_SVC_F | DEBUG_SYS_F | DEBUG_SYSINT_F;
++        case 's':
++            M.x86.debug ^= DEBUG_SVC_F | DEBUG_SYS_F | DEBUG_SYSINT_F;
+             break;
+-          case 'r':
+-			X86EMU_trace_regs();
++        case 'r':
++            X86EMU_trace_regs();
+             break;
+-          case 'x':
+-			X86EMU_trace_xregs();
++        case 'x':
++            X86EMU_trace_xregs();
+             break;
+-          case 'g':
++        case 'g':
+             if (ntok == 2) {
+                 breakpoint = ps[1];
+-		if (noDecode) {
+-		                M.x86.debug |= DEBUG_DECODE_NOPRINT_F;
+-		} else {
+-		                M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
+-		}
+-		M.x86.debug &= ~DEBUG_TRACE_F;
+-		M.x86.debug |= DEBUG_BREAK_F;
+-		done = 1;
++                if (noDecode) {
++                    M.x86.debug |= DEBUG_DECODE_NOPRINT_F;
++                }
++                else {
++                    M.x86.debug &= ~DEBUG_DECODE_NOPRINT_F;
++                }
++                M.x86.debug &= ~DEBUG_TRACE_F;
++                M.x86.debug |= DEBUG_BREAK_F;
++                done = 1;
+             }
+             break;
+-          case 'q':
+-          M.x86.debug |= DEBUG_EXIT;
+-          return;
+-	  case 'P':
+-	      noDecode = (noDecode)?0:1;
+-	      printk("Toggled decoding to %s\n",(noDecode)?"FALSE":"TRUE");
+-	      break;
+-          case 't':
+-	  case 0:
++        case 'q':
++            M.x86.debug |= DEBUG_EXIT;
++            return;
++        case 'P':
++            noDecode = (noDecode) ? 0 : 1;
++            printk("Toggled decoding to %s\n", (noDecode) ? "FALSE" : "TRUE");
++            break;
++        case 't':
++        case 0:
+             done = 1;
+             break;
+-        }   
++        }
+     }
+ }
+ 
+-int X86EMU_trace_on(void)
++int
++X86EMU_trace_on(void)
+ {
+-	return M.x86.debug |= DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F;
++    return M.x86.debug |= DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F;
+ }
+ 
+-int X86EMU_trace_off(void)
++int
++X86EMU_trace_off(void)
+ {
+-	return M.x86.debug &= ~(DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F);
++    return M.x86.debug &= ~(DEBUG_STEP_F | DEBUG_DECODE_F | DEBUG_TRACE_F);
+ }
+ 
+-static int parse_line (char *s, int *ps, int *n)
++static int
++parse_line(char *s, int *ps, int *n)
+ {
+     int cmd;
+ 
+     *n = 0;
+-    while(*s == ' ' || *s == '\t') s++;
++    while (*s == ' ' || *s == '\t')
++        s++;
+     ps[*n] = *s;
+     switch (*s) {
+-      case '\n':
++    case '\n':
+         *n += 1;
+         return 0;
+-      default:
++    default:
+         cmd = *s;
+         *n += 1;
+     }
+ 
+-	while (1) {
+-		while (*s != ' ' && *s != '\t' && *s != '\n')  s++;
+-		
+-		if (*s == '\n')
+-			return cmd;
+-		
+-		while(*s == ' ' || *s == '\t') s++;
+-		
+-		sscanf(s,"%x",&ps[*n]);
+-		*n += 1;
+-	}
++    while (1) {
++        while (*s != ' ' && *s != '\t' && *s != '\n')
++            s++;
++
++        if (*s == '\n')
++            return cmd;
++
++        while (*s == ' ' || *s == '\t')
++            s++;
++
++        sscanf(s, "%x", &ps[*n]);
++        *n += 1;
++    }
+ }
+ 
+-#endif /* DEBUG */
++#endif                          /* DEBUG */
+ 
+-void x86emu_dump_regs (void)
++void
++x86emu_dump_regs(void)
+ {
+-	printk("\tAX=%04x  ", M.x86.R_AX );
+-	printk("BX=%04x  ", M.x86.R_BX );
+-	printk("CX=%04x  ", M.x86.R_CX );
+-	printk("DX=%04x  ", M.x86.R_DX );
+-	printk("SP=%04x  ", M.x86.R_SP );
+-	printk("BP=%04x  ", M.x86.R_BP );
+-	printk("SI=%04x  ", M.x86.R_SI );
+-	printk("DI=%04x\n", M.x86.R_DI );
+-	printk("\tDS=%04x  ", M.x86.R_DS );
+-	printk("ES=%04x  ", M.x86.R_ES );
+-	printk("SS=%04x  ", M.x86.R_SS );
+-	printk("CS=%04x  ", M.x86.R_CS );
+-	printk("IP=%04x   ", M.x86.R_IP );
+-	if (ACCESS_FLAG(F_OF))    printk("OV ");     /* CHECKED... */
+-	else                        printk("NV ");
+-	if (ACCESS_FLAG(F_DF))    printk("DN ");
+-	else                        printk("UP ");
+-	if (ACCESS_FLAG(F_IF))    printk("EI ");
+-	else                        printk("DI ");
+-	if (ACCESS_FLAG(F_SF))    printk("NG ");
+-	else                        printk("PL ");
+-	if (ACCESS_FLAG(F_ZF))    printk("ZR ");
+-	else                        printk("NZ ");
+-	if (ACCESS_FLAG(F_AF))    printk("AC ");
+-	else                        printk("NA ");
+-	if (ACCESS_FLAG(F_PF))    printk("PE ");
+-	else                        printk("PO ");
+-	if (ACCESS_FLAG(F_CF))    printk("CY ");
+-	else                        printk("NC ");
+-	printk("\n");
++    printk("\tAX=%04x  ", M.x86.R_AX);
++    printk("BX=%04x  ", M.x86.R_BX);
++    printk("CX=%04x  ", M.x86.R_CX);
++    printk("DX=%04x  ", M.x86.R_DX);
++    printk("SP=%04x  ", M.x86.R_SP);
++    printk("BP=%04x  ", M.x86.R_BP);
++    printk("SI=%04x  ", M.x86.R_SI);
++    printk("DI=%04x\n", M.x86.R_DI);
++    printk("\tDS=%04x  ", M.x86.R_DS);
++    printk("ES=%04x  ", M.x86.R_ES);
++    printk("SS=%04x  ", M.x86.R_SS);
++    printk("CS=%04x  ", M.x86.R_CS);
++    printk("IP=%04x   ", M.x86.R_IP);
++    if (ACCESS_FLAG(F_OF))
++        printk("OV ");          /* CHECKED... */
++    else
++        printk("NV ");
++    if (ACCESS_FLAG(F_DF))
++        printk("DN ");
++    else
++        printk("UP ");
++    if (ACCESS_FLAG(F_IF))
++        printk("EI ");
++    else
++        printk("DI ");
++    if (ACCESS_FLAG(F_SF))
++        printk("NG ");
++    else
++        printk("PL ");
++    if (ACCESS_FLAG(F_ZF))
++        printk("ZR ");
++    else
++        printk("NZ ");
++    if (ACCESS_FLAG(F_AF))
++        printk("AC ");
++    else
++        printk("NA ");
++    if (ACCESS_FLAG(F_PF))
++        printk("PE ");
++    else
++        printk("PO ");
++    if (ACCESS_FLAG(F_CF))
++        printk("CY ");
++    else
++        printk("NC ");
++    printk("\n");
+ }
+ 
+-void x86emu_dump_xregs (void)
++void
++x86emu_dump_xregs(void)
+ {
+-	printk("\tEAX=%08x  ", M.x86.R_EAX );
+-	printk("EBX=%08x  ", M.x86.R_EBX );
+-	printk("ECX=%08x  ", M.x86.R_ECX );
+-	printk("EDX=%08x  \n", M.x86.R_EDX );
+-	printk("\tESP=%08x  ", M.x86.R_ESP );
+-	printk("EBP=%08x  ", M.x86.R_EBP );
+-	printk("ESI=%08x  ", M.x86.R_ESI );
+-	printk("EDI=%08x\n", M.x86.R_EDI );
+-	printk("\tDS=%04x  ", M.x86.R_DS );
+-	printk("ES=%04x  ", M.x86.R_ES );
+-	printk("SS=%04x  ", M.x86.R_SS );
+-	printk("CS=%04x  ", M.x86.R_CS );
+-	printk("EIP=%08x\n\t", M.x86.R_EIP );
+-	if (ACCESS_FLAG(F_OF))    printk("OV ");     /* CHECKED... */
+-	else                        printk("NV ");
+-	if (ACCESS_FLAG(F_DF))    printk("DN ");
+-	else                        printk("UP ");
+-	if (ACCESS_FLAG(F_IF))    printk("EI ");
+-	else                        printk("DI ");
+-	if (ACCESS_FLAG(F_SF))    printk("NG ");
+-	else                        printk("PL ");
+-	if (ACCESS_FLAG(F_ZF))    printk("ZR ");
+-	else                        printk("NZ ");
+-	if (ACCESS_FLAG(F_AF))    printk("AC ");
+-	else                        printk("NA ");
+-	if (ACCESS_FLAG(F_PF))    printk("PE ");
+-	else                        printk("PO ");
+-	if (ACCESS_FLAG(F_CF))    printk("CY ");
+-	else                        printk("NC ");
+-	printk("\n");
++    printk("\tEAX=%08x  ", M.x86.R_EAX);
++    printk("EBX=%08x  ", M.x86.R_EBX);
++    printk("ECX=%08x  ", M.x86.R_ECX);
++    printk("EDX=%08x  \n", M.x86.R_EDX);
++    printk("\tESP=%08x  ", M.x86.R_ESP);
++    printk("EBP=%08x  ", M.x86.R_EBP);
++    printk("ESI=%08x  ", M.x86.R_ESI);
++    printk("EDI=%08x\n", M.x86.R_EDI);
++    printk("\tDS=%04x  ", M.x86.R_DS);
++    printk("ES=%04x  ", M.x86.R_ES);
++    printk("SS=%04x  ", M.x86.R_SS);
++    printk("CS=%04x  ", M.x86.R_CS);
++    printk("EIP=%08x\n\t", M.x86.R_EIP);
++    if (ACCESS_FLAG(F_OF))
++        printk("OV ");          /* CHECKED... */
++    else
++        printk("NV ");
++    if (ACCESS_FLAG(F_DF))
++        printk("DN ");
++    else
++        printk("UP ");
++    if (ACCESS_FLAG(F_IF))
++        printk("EI ");
++    else
++        printk("DI ");
++    if (ACCESS_FLAG(F_SF))
++        printk("NG ");
++    else
++        printk("PL ");
++    if (ACCESS_FLAG(F_ZF))
++        printk("ZR ");
++    else
++        printk("NZ ");
++    if (ACCESS_FLAG(F_AF))
++        printk("AC ");
++    else
++        printk("NA ");
++    if (ACCESS_FLAG(F_PF))
++        printk("PE ");
++    else
++        printk("PO ");
++    if (ACCESS_FLAG(F_CF))
++        printk("CY ");
++    else
++        printk("NC ");
++    printk("\n");
+ }
+diff --git a/libs/x86emu/decode.c b/libs/x86emu/decode.c
+index 7d9a34a..12f8fb8 100644
+--- a/libs/x86emu/decode.c
++++ b/libs/x86emu/decode.c
+@@ -46,25 +46,27 @@
+ REMARKS:
+ Handles any pending asychronous interrupts.
+ ****************************************************************************/
+-static void x86emu_intr_handle(void)
++static void
++x86emu_intr_handle(void)
+ {
+-	u8	intno;
+-
+-	if (M.x86.intr & INTR_SYNCH) {
+-		intno = M.x86.intno;
+-		if (_X86EMU_intrTab[intno]) {
+-			(*_X86EMU_intrTab[intno])(intno);
+-		} else {
+-			push_word((u16)M.x86.R_FLG);
+-			CLEAR_FLAG(F_IF);
+-			CLEAR_FLAG(F_TF);
+-			push_word(M.x86.R_CS);
+-			M.x86.R_CS = mem_access_word(intno * 4 + 2);
+-			push_word(M.x86.R_IP);
+-			M.x86.R_IP = mem_access_word(intno * 4);
+-			M.x86.intr = 0;
+-		}
+-	}
++    u8 intno;
++
++    if (M.x86.intr & INTR_SYNCH) {
++        intno = M.x86.intno;
++        if (_X86EMU_intrTab[intno]) {
++            (*_X86EMU_intrTab[intno]) (intno);
++        }
++        else {
++            push_word((u16) M.x86.R_FLG);
++            CLEAR_FLAG(F_IF);
++            CLEAR_FLAG(F_TF);
++            push_word(M.x86.R_CS);
++            M.x86.R_CS = mem_access_word(intno * 4 + 2);
++            push_word(M.x86.R_IP);
++            M.x86.R_IP = mem_access_word(intno * 4);
++            M.x86.intr = 0;
++        }
++    }
+ }
+ 
+ /****************************************************************************
+@@ -75,11 +77,11 @@ REMARKS:
+ Raise the specified interrupt to be handled before the execution of the
+ next instruction.
+ ****************************************************************************/
+-void x86emu_intr_raise(
+-	u8 intrnum)
++void
++x86emu_intr_raise(u8 intrnum)
+ {
+-	M.x86.intno = intrnum;
+-	M.x86.intr |= INTR_SYNCH;
++    M.x86.intno = intrnum;
++    M.x86.intr |= INTR_SYNCH;
+ }
+ 
+ /****************************************************************************
+@@ -88,39 +90,39 @@ Main execution loop for the emulator. We return from here when the system
+ halts, which is normally caused by a stack fault when we return from the
+ original real mode call.
+ ****************************************************************************/
+-void X86EMU_exec(void)
++void
++X86EMU_exec(void)
+ {
+-	u8 op1;
+-
+-	M.x86.intr = 0;
+-	DB(x86emu_end_instr();)
+-
+-    for (;;) {
+-DB(		if (CHECK_IP_FETCH())
+-		  x86emu_check_ip_access();)
+-		/* If debugging, save the IP and CS values. */
+-		SAVE_IP_CS(M.x86.R_CS, M.x86.R_IP);
+-		INC_DECODED_INST_LEN(1);
+-		if (M.x86.intr) {
+-			if (M.x86.intr & INTR_HALTED) {
+-DB(             if (M.x86.R_SP != 0) {
+-                    printk("halted\n");
+-                    X86EMU_trace_regs();
+-                    }
+-                else {
+-                    if (M.x86.debug)
+-                        printk("Service completed successfully\n");
+-                    })
+-				return;
++    u8 op1;
++
++    M.x86.intr = 0;
++    DB(x86emu_end_instr();
++        )
++
++        for (;;) {
++        DB(if (CHECK_IP_FETCH())
++           x86emu_check_ip_access();)
++            /* If debugging, save the IP and CS values. */
++            SAVE_IP_CS(M.x86.R_CS, M.x86.R_IP);
++        INC_DECODED_INST_LEN(1);
++        if (M.x86.intr) {
++            if (M.x86.intr & INTR_HALTED) {
++                DB(if (M.x86.R_SP != 0) {
++                   printk("halted\n"); X86EMU_trace_regs();}
++                   else {
++                   if (M.x86.debug)
++                   printk("Service completed successfully\n");}
++                )
++                    return;
+             }
+-			if (((M.x86.intr & INTR_SYNCH) && (M.x86.intno == 0 || M.x86.intno == 2)) ||
+-				!ACCESS_FLAG(F_IF)) {
+-				x86emu_intr_handle();
+-			}
+-		}
+-
+-		op1 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+-		(*x86emu_optab[op1])(op1);
++            if (((M.x86.intr & INTR_SYNCH) &&
++                 (M.x86.intno == 0 || M.x86.intno == 2)) ||
++                !ACCESS_FLAG(F_IF)) {
++                x86emu_intr_handle();
++            }
++        }
++        op1 = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
++        (*x86emu_optab[op1]) (op1);
+         if (M.x86.debug & DEBUG_EXIT) {
+             M.x86.debug &= ~DEBUG_EXIT;
+             return;
+@@ -132,9 +134,10 @@ DB(             if (M.x86.R_SP != 0) {
+ REMARKS:
+ Halts the system by setting the halted system flag.
+ ****************************************************************************/
+-void X86EMU_halt_sys(void)
++void
++X86EMU_halt_sys(void)
+ {
+-	M.x86.intr |= INTR_HALTED;
++    M.x86.intr |= INTR_HALTED;
+ }
+ 
+ /****************************************************************************
+@@ -149,19 +152,17 @@ next instruction.
+ 
+ NOTE: Do not inline this function, as (*sys_rdb) is already inline!
+ ****************************************************************************/
+-void fetch_decode_modrm(
+-	int *mod,
+-	int *regh,
+-	int *regl)
++void
++fetch_decode_modrm(int *mod, int *regh, int *regl)
+ {
+-	int fetched;
+-
+-DB(	if (CHECK_IP_FETCH())
+-	  x86emu_check_ip_access();)
+-	fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+-	INC_DECODED_INST_LEN(1);
+-	*mod  = (fetched >> 6) & 0x03;
+-	*regh = (fetched >> 3) & 0x07;
++    int fetched;
++
++    DB(if (CHECK_IP_FETCH())
++       x86emu_check_ip_access();)
++        fetched = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
++    INC_DECODED_INST_LEN(1);
++    *mod = (fetched >> 6) & 0x03;
++    *regh = (fetched >> 3) & 0x07;
+     *regl = (fetched >> 0) & 0x07;
+ }
+ 
+@@ -175,15 +176,16 @@ moves the instruction pointer to the next value.
+ 
+ NOTE: Do not inline this function, as (*sys_rdb) is already inline!
+ ****************************************************************************/
+-u8 fetch_byte_imm(void)
++u8
++fetch_byte_imm(void)
+ {
+-	u8 fetched;
++    u8 fetched;
+ 
+-DB(	if (CHECK_IP_FETCH())
+-		x86emu_check_ip_access();)
+-	fetched = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
+-	INC_DECODED_INST_LEN(1);
+-	return fetched;
++    DB(if (CHECK_IP_FETCH())
++       x86emu_check_ip_access();)
++        fetched = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
++    INC_DECODED_INST_LEN(1);
++    return fetched;
+ }
+ 
+ /****************************************************************************
+@@ -196,16 +198,17 @@ moves the instruction pointer to the next value.
+ 
+ NOTE: Do not inline this function, as (*sys_rdw) is already inline!
+ ****************************************************************************/
+-u16 fetch_word_imm(void)
++u16
++fetch_word_imm(void)
+ {
+-	u16	fetched;
+-
+-DB(	if (CHECK_IP_FETCH())
+-		x86emu_check_ip_access();)
+-	fetched = (*sys_rdw)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
+-	M.x86.R_IP += 2;
+-	INC_DECODED_INST_LEN(2);
+-	return fetched;
++    u16 fetched;
++
++    DB(if (CHECK_IP_FETCH())
++       x86emu_check_ip_access();)
++        fetched = (*sys_rdw) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP));
++    M.x86.R_IP += 2;
++    INC_DECODED_INST_LEN(2);
++    return fetched;
+ }
+ 
+ /****************************************************************************
+@@ -218,16 +221,17 @@ moves the instruction pointer to the next value.
+ 
+ NOTE: Do not inline this function, as (*sys_rdw) is already inline!
+ ****************************************************************************/
+-u32 fetch_long_imm(void)
++u32
++fetch_long_imm(void)
+ {
+-	u32 fetched;
+-
+-DB(	if (CHECK_IP_FETCH())
+-	  x86emu_check_ip_access();)
+-	fetched = (*sys_rdl)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP));
+-	M.x86.R_IP += 4;
+-	INC_DECODED_INST_LEN(4);
+-	return fetched;
++    u32 fetched;
++
++    DB(if (CHECK_IP_FETCH())
++       x86emu_check_ip_access();)
++        fetched = (*sys_rdl) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP));
++    M.x86.R_IP += 4;
++    INC_DECODED_INST_LEN(4);
++    return fetched;
+ }
+ 
+ /****************************************************************************
+@@ -259,38 +263,39 @@ cpu-state-varible M.x86.mode. There are several potential states:
+ 
+ Each of the above 7 items are handled with a bit in the mode field.
+ ****************************************************************************/
+-_INLINE u32 get_data_segment(void)
++_INLINE u32
++get_data_segment(void)
+ {
+ #define	GET_SEGMENT(segment)
+-	switch (M.x86.mode & SYSMODE_SEGMASK) {
+-	  case 0:					/* default case: use ds register */
+-	  case SYSMODE_SEGOVR_DS:
+-	  case SYSMODE_SEGOVR_DS | SYSMODE_SEG_DS_SS:
+-		return  M.x86.R_DS;
+-	  case SYSMODE_SEG_DS_SS:	/* non-overridden, use ss register */
+-		return  M.x86.R_SS;
+-	  case SYSMODE_SEGOVR_CS:
+-	  case SYSMODE_SEGOVR_CS | SYSMODE_SEG_DS_SS:
+-		return  M.x86.R_CS;
+-	  case SYSMODE_SEGOVR_ES:
+-	  case SYSMODE_SEGOVR_ES | SYSMODE_SEG_DS_SS:
+-		return  M.x86.R_ES;
+-	  case SYSMODE_SEGOVR_FS:
+-	  case SYSMODE_SEGOVR_FS | SYSMODE_SEG_DS_SS:
+-		return  M.x86.R_FS;
+-	  case SYSMODE_SEGOVR_GS:
+-	  case SYSMODE_SEGOVR_GS | SYSMODE_SEG_DS_SS:
+-		return  M.x86.R_GS;
+-	  case SYSMODE_SEGOVR_SS:
+-	  case SYSMODE_SEGOVR_SS | SYSMODE_SEG_DS_SS:
+-		return  M.x86.R_SS;
+-	  default:
++    switch (M.x86.mode & SYSMODE_SEGMASK) {
++    case 0:                    /* default case: use ds register */
++    case SYSMODE_SEGOVR_DS:
++    case SYSMODE_SEGOVR_DS | SYSMODE_SEG_DS_SS:
++        return M.x86.R_DS;
++    case SYSMODE_SEG_DS_SS:    /* non-overridden, use ss register */
++        return M.x86.R_SS;
++    case SYSMODE_SEGOVR_CS:
++    case SYSMODE_SEGOVR_CS | SYSMODE_SEG_DS_SS:
++        return M.x86.R_CS;
++    case SYSMODE_SEGOVR_ES:
++    case SYSMODE_SEGOVR_ES | SYSMODE_SEG_DS_SS:
++        return M.x86.R_ES;
++    case SYSMODE_SEGOVR_FS:
++    case SYSMODE_SEGOVR_FS | SYSMODE_SEG_DS_SS:
++        return M.x86.R_FS;
++    case SYSMODE_SEGOVR_GS:
++    case SYSMODE_SEGOVR_GS | SYSMODE_SEG_DS_SS:
++        return M.x86.R_GS;
++    case SYSMODE_SEGOVR_SS:
++    case SYSMODE_SEGOVR_SS | SYSMODE_SEG_DS_SS:
++        return M.x86.R_SS;
++    default:
+ #ifdef	DEBUG
+-		printk("error: should not happen:  multiple overrides.\n");
++        printk("error: should not happen:  multiple overrides.\n");
+ #endif
+-		HALT_SYS();
+-		return 0;
+-	}
++        HALT_SYS();
++        return 0;
++    }
+ }
+ 
+ /****************************************************************************
+@@ -302,14 +307,14 @@ Byte value read from the absolute memory location.
+ 
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u8 fetch_data_byte(
+-	uint offset)
++u8
++fetch_data_byte(uint offset)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access((u16)get_data_segment(), offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+-	return (*sys_rdb)((get_data_segment() << 4) + offset);
++    return (*sys_rdb) ((get_data_segment() << 4) + offset);
+ }
+ 
+ /****************************************************************************
+@@ -321,14 +326,14 @@ Word value read from the absolute memory location.
+ 
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u16 fetch_data_word(
+-	uint offset)
++u16
++fetch_data_word(uint offset)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access((u16)get_data_segment(), offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+-	return (*sys_rdw)((get_data_segment() << 4) + offset);
++    return (*sys_rdw) ((get_data_segment() << 4) + offset);
+ }
+ 
+ /****************************************************************************
+@@ -340,14 +345,14 @@ Long value read from the absolute memory location.
+ 
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u32 fetch_data_long(
+-	uint offset)
++u32
++fetch_data_long(uint offset)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access((u16)get_data_segment(), offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+-	return (*sys_rdl)((get_data_segment() << 4) + offset);
++    return (*sys_rdl) ((get_data_segment() << 4) + offset);
+ }
+ 
+ /****************************************************************************
+@@ -360,15 +365,14 @@ Byte value read from the absolute memory location.
+ 
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u8 fetch_data_byte_abs(
+-	uint segment,
+-	uint offset)
++u8
++fetch_data_byte_abs(uint segment, uint offset)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access(segment, offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access(segment, offset);
+ #endif
+-	return (*sys_rdb)(((u32)segment << 4) + offset);
++    return (*sys_rdb) (((u32) segment << 4) + offset);
+ }
+ 
+ /****************************************************************************
+@@ -381,15 +385,14 @@ Word value read from the absolute memory location.
+ 
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u16 fetch_data_word_abs(
+-	uint segment,
+-	uint offset)
++u16
++fetch_data_word_abs(uint segment, uint offset)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access(segment, offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access(segment, offset);
+ #endif
+-	return (*sys_rdw)(((u32)segment << 4) + offset);
++    return (*sys_rdw) (((u32) segment << 4) + offset);
+ }
+ 
+ /****************************************************************************
+@@ -402,15 +405,14 @@ Long value read from the absolute memory location.
+ 
+ NOTE: Do not inline this function as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u32 fetch_data_long_abs(
+-	uint segment,
+-	uint offset)
++u32
++fetch_data_long_abs(uint segment, uint offset)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access(segment, offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access(segment, offset);
+ #endif
+-	return (*sys_rdl)(((u32)segment << 4) + offset);
++    return (*sys_rdl) (((u32) segment << 4) + offset);
+ }
+ 
+ /****************************************************************************
+@@ -424,15 +426,14 @@ the current 'default' segment, which may have been overridden.
+ 
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_byte(
+-	uint offset,
+-	u8 val)
++void
++store_data_byte(uint offset, u8 val)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access((u16)get_data_segment(), offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+-	(*sys_wrb)((get_data_segment() << 4) + offset, val);
++    (*sys_wrb) ((get_data_segment() << 4) + offset, val);
+ }
+ 
+ /****************************************************************************
+@@ -446,15 +447,14 @@ the current 'default' segment, which may have been overridden.
+ 
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_word(
+-	uint offset,
+-	u16 val)
++void
++store_data_word(uint offset, u16 val)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access((u16)get_data_segment(), offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+-	(*sys_wrw)((get_data_segment() << 4) + offset, val);
++    (*sys_wrw) ((get_data_segment() << 4) + offset, val);
+ }
+ 
+ /****************************************************************************
+@@ -468,15 +468,14 @@ the current 'default' segment, which may have been overridden.
+ 
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_long(
+-	uint offset,
+-	u32 val)
++void
++store_data_long(uint offset, u32 val)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access((u16)get_data_segment(), offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access((u16) get_data_segment(), offset);
+ #endif
+-	(*sys_wrl)((get_data_segment() << 4) + offset, val);
++    (*sys_wrl) ((get_data_segment() << 4) + offset, val);
+ }
+ 
+ /****************************************************************************
+@@ -490,16 +489,14 @@ Writes a byte value to an absolute memory location.
+ 
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_byte_abs(
+-	uint segment,
+-	uint offset,
+-	u8 val)
++void
++store_data_byte_abs(uint segment, uint offset, u8 val)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access(segment, offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access(segment, offset);
+ #endif
+-	(*sys_wrb)(((u32)segment << 4) + offset, val);
++    (*sys_wrb) (((u32) segment << 4) + offset, val);
+ }
+ 
+ /****************************************************************************
+@@ -513,16 +510,14 @@ Writes a word value to an absolute memory location.
+ 
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_word_abs(
+-	uint segment,
+-	uint offset,
+-	u16 val)
++void
++store_data_word_abs(uint segment, uint offset, u16 val)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access(segment, offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access(segment, offset);
+ #endif
+-	(*sys_wrw)(((u32)segment << 4) + offset, val);
++    (*sys_wrw) (((u32) segment << 4) + offset, val);
+ }
+ 
+ /****************************************************************************
+@@ -536,16 +531,14 @@ Writes a long value to an absolute memory location.
+ 
+ NOTE: Do not inline this function as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void store_data_long_abs(
+-	uint segment,
+-	uint offset,
+-	u32 val)
++void
++store_data_long_abs(uint segment, uint offset, u32 val)
+ {
+ #ifdef DEBUG
+-	if (CHECK_DATA_ACCESS())
+-		x86emu_check_data_access(segment, offset);
++    if (CHECK_DATA_ACCESS())
++        x86emu_check_data_access(segment, offset);
+ #endif
+-	(*sys_wrl)(((u32)segment << 4) + offset, val);
++    (*sys_wrl) (((u32) segment << 4) + offset, val);
+ }
+ 
+ /****************************************************************************
+@@ -559,37 +552,37 @@ REMARKS:
+ Return a pointer to the register given by the R/RM field of the
+ modrm byte, for byte operands. Also enables the decoding of instructions.
+ ****************************************************************************/
+-u8* decode_rm_byte_register(
+-	int reg)
++u8 *
++decode_rm_byte_register(int reg)
+ {
+-	switch (reg) {
+-      case 0:
+-		DECODE_PRINTF("AL");
+-		return &M.x86.R_AL;
+-	  case 1:
+-		DECODE_PRINTF("CL");
+-		return &M.x86.R_CL;
+-	  case 2:
+-		DECODE_PRINTF("DL");
+-		return &M.x86.R_DL;
+-	  case 3:
+-		DECODE_PRINTF("BL");
+-		return &M.x86.R_BL;
+-	  case 4:
+-		DECODE_PRINTF("AH");
+-		return &M.x86.R_AH;
+-	  case 5:
+-		DECODE_PRINTF("CH");
+-		return &M.x86.R_CH;
+-	  case 6:
+-		DECODE_PRINTF("DH");
+-		return &M.x86.R_DH;
+-	  case 7:
+-		DECODE_PRINTF("BH");
+-		return &M.x86.R_BH;
+-	}
+-	HALT_SYS();
+-	return NULL;                /* NOT REACHED OR REACHED ON ERROR */
++    switch (reg) {
++    case 0:
++        DECODE_PRINTF("AL");
++        return &M.x86.R_AL;
++    case 1:
++        DECODE_PRINTF("CL");
++        return &M.x86.R_CL;
++    case 2:
++        DECODE_PRINTF("DL");
++        return &M.x86.R_DL;
++    case 3:
++        DECODE_PRINTF("BL");
++        return &M.x86.R_BL;
++    case 4:
++        DECODE_PRINTF("AH");
++        return &M.x86.R_AH;
++    case 5:
++        DECODE_PRINTF("CH");
++        return &M.x86.R_CH;
++    case 6:
++        DECODE_PRINTF("DH");
++        return &M.x86.R_DH;
++    case 7:
++        DECODE_PRINTF("BH");
++        return &M.x86.R_BH;
++    }
++    HALT_SYS();
++    return NULL;                /* NOT REACHED OR REACHED ON ERROR */
+ }
+ 
+ /****************************************************************************
+@@ -603,36 +596,36 @@ REMARKS:
+ Return a pointer to the register given by the R/RM field of the
+ modrm byte, for word operands.  Also enables the decoding of instructions.
+ ****************************************************************************/
+-u16* decode_rm_word_register(
+-	int reg)
++u16 *
++decode_rm_word_register(int reg)
+ {
+-	switch (reg) {
+-	  case 0:
+-		DECODE_PRINTF("AX");
+-		return &M.x86.R_AX;
+-	  case 1:
+-		DECODE_PRINTF("CX");
+-		return &M.x86.R_CX;
+-	  case 2:
+-		DECODE_PRINTF("DX");
+-		return &M.x86.R_DX;
+-	  case 3:
+-		DECODE_PRINTF("BX");
+-		return &M.x86.R_BX;
+-	  case 4:
+-		DECODE_PRINTF("SP");
+-		return &M.x86.R_SP;
+-	  case 5:
+-		DECODE_PRINTF("BP");
+-		return &M.x86.R_BP;
+-	  case 6:
+-		DECODE_PRINTF("SI");
+-		return &M.x86.R_SI;
+-	  case 7:
+-		DECODE_PRINTF("DI");
+-		return &M.x86.R_DI;
+-	}
+-	HALT_SYS();
++    switch (reg) {
++    case 0:
++        DECODE_PRINTF("AX");
++        return &M.x86.R_AX;
++    case 1:
++        DECODE_PRINTF("CX");
++        return &M.x86.R_CX;
++    case 2:
++        DECODE_PRINTF("DX");
++        return &M.x86.R_DX;
++    case 3:
++        DECODE_PRINTF("BX");
++        return &M.x86.R_BX;
++    case 4:
++        DECODE_PRINTF("SP");
++        return &M.x86.R_SP;
++    case 5:
++        DECODE_PRINTF("BP");
++        return &M.x86.R_BP;
++    case 6:
++        DECODE_PRINTF("SI");
++        return &M.x86.R_SI;
++    case 7:
++        DECODE_PRINTF("DI");
++        return &M.x86.R_DI;
++    }
++    HALT_SYS();
+     return NULL;                /* NOTREACHED OR REACHED ON ERROR */
+ }
+ 
+@@ -647,36 +640,36 @@ REMARKS:
+ Return a pointer to the register given by the R/RM field of the
+ modrm byte, for dword operands.  Also enables the decoding of instructions.
+ ****************************************************************************/
+-u32* decode_rm_long_register(
+-	int reg)
++u32 *
++decode_rm_long_register(int reg)
+ {
+     switch (reg) {
+-      case 0:
+-		DECODE_PRINTF("EAX");
+-		return &M.x86.R_EAX;
+-	  case 1:
+-		DECODE_PRINTF("ECX");
+-		return &M.x86.R_ECX;
+-	  case 2:
+-		DECODE_PRINTF("EDX");
+-		return &M.x86.R_EDX;
+-	  case 3:
+-		DECODE_PRINTF("EBX");
+-		return &M.x86.R_EBX;
+-	  case 4:
+-		DECODE_PRINTF("ESP");
+-		return &M.x86.R_ESP;
+-	  case 5:
+-		DECODE_PRINTF("EBP");
+-		return &M.x86.R_EBP;
+-	  case 6:
+-		DECODE_PRINTF("ESI");
+-		return &M.x86.R_ESI;
+-	  case 7:
+-		DECODE_PRINTF("EDI");
+-		return &M.x86.R_EDI;
+-	}
+-	HALT_SYS();
++    case 0:
++        DECODE_PRINTF("EAX");
++        return &M.x86.R_EAX;
++    case 1:
++        DECODE_PRINTF("ECX");
++        return &M.x86.R_ECX;
++    case 2:
++        DECODE_PRINTF("EDX");
++        return &M.x86.R_EDX;
++    case 3:
++        DECODE_PRINTF("EBX");
++        return &M.x86.R_EBX;
++    case 4:
++        DECODE_PRINTF("ESP");
++        return &M.x86.R_ESP;
++    case 5:
++        DECODE_PRINTF("EBP");
++        return &M.x86.R_EBP;
++    case 6:
++        DECODE_PRINTF("ESI");
++        return &M.x86.R_ESI;
++    case 7:
++        DECODE_PRINTF("EDI");
++        return &M.x86.R_EDI;
++    }
++    HALT_SYS();
+     return NULL;                /* NOTREACHED OR REACHED ON ERROR */
+ }
+ 
+@@ -692,126 +685,129 @@ Return a pointer to the register given by the R/RM field of the
+ modrm byte, for word operands, modified from above for the weirdo
+ special case of segreg operands.  Also enables the decoding of instructions.
+ ****************************************************************************/
+-u16* decode_rm_seg_register(
+-	int reg)
++u16 *
++decode_rm_seg_register(int reg)
+ {
+-	switch (reg) {
+-	  case 0:
+-		DECODE_PRINTF("ES");
+-		return &M.x86.R_ES;
+-	  case 1:
+-		DECODE_PRINTF("CS");
+-		return &M.x86.R_CS;
+-	  case 2:
+-		DECODE_PRINTF("SS");
+-		return &M.x86.R_SS;
+-	  case 3:
+-		DECODE_PRINTF("DS");
+-		return &M.x86.R_DS;
+-	  case 4:
+-		DECODE_PRINTF("FS");
+-		return &M.x86.R_FS;
+-	  case 5:
+-		DECODE_PRINTF("GS");
+-		return &M.x86.R_GS;
+-	  case 6:
+-	  case 7:
+-		DECODE_PRINTF("ILLEGAL SEGREG");
+-		break;
+-	}
+-	HALT_SYS();
+-	return NULL;                /* NOT REACHED OR REACHED ON ERROR */
++    switch (reg) {
++    case 0:
++        DECODE_PRINTF("ES");
++        return &M.x86.R_ES;
++    case 1:
++        DECODE_PRINTF("CS");
++        return &M.x86.R_CS;
++    case 2:
++        DECODE_PRINTF("SS");
++        return &M.x86.R_SS;
++    case 3:
++        DECODE_PRINTF("DS");
++        return &M.x86.R_DS;
++    case 4:
++        DECODE_PRINTF("FS");
++        return &M.x86.R_FS;
++    case 5:
++        DECODE_PRINTF("GS");
++        return &M.x86.R_GS;
++    case 6:
++    case 7:
++        DECODE_PRINTF("ILLEGAL SEGREG");
++        break;
++    }
++    HALT_SYS();
++    return NULL;                /* NOT REACHED OR REACHED ON ERROR */
+ }
+ 
+ /*
+  *
+  * return offset from the SIB Byte
+  */
+-u32 decode_sib_address(int sib, int mod)
++u32
++decode_sib_address(int sib, int mod)
+ {
+     u32 base = 0, i = 0, scale = 1;
+ 
+-    switch(sib & 0x07) {
++    switch (sib & 0x07) {
+     case 0:
+-	DECODE_PRINTF("[EAX]");
+-	base = M.x86.R_EAX;
+-	break;
++        DECODE_PRINTF("[EAX]");
++        base = M.x86.R_EAX;
++        break;
+     case 1:
+-	DECODE_PRINTF("[ECX]");
+-	base = M.x86.R_ECX;
+-	break;
++        DECODE_PRINTF("[ECX]");
++        base = M.x86.R_ECX;
++        break;
+     case 2:
+-	DECODE_PRINTF("[EDX]");
+-	base = M.x86.R_EDX;
+-	break;
++        DECODE_PRINTF("[EDX]");
++        base = M.x86.R_EDX;
++        break;
+     case 3:
+-	DECODE_PRINTF("[EBX]");
+-	base = M.x86.R_EBX;
+-	break;
++        DECODE_PRINTF("[EBX]");
++        base = M.x86.R_EBX;
++        break;
+     case 4:
+-	DECODE_PRINTF("[ESP]");
+-	base = M.x86.R_ESP;
+-	M.x86.mode |= SYSMODE_SEG_DS_SS;
+-	break;
++        DECODE_PRINTF("[ESP]");
++        base = M.x86.R_ESP;
++        M.x86.mode |= SYSMODE_SEG_DS_SS;
++        break;
+     case 5:
+-	if (mod == 0) {
+-	    base = fetch_long_imm();
+-	    DECODE_PRINTF2("%08x", base);
+-	} else {
+-	    DECODE_PRINTF("[EBP]");
+-	    base = M.x86.R_ESP;
+-	    M.x86.mode |= SYSMODE_SEG_DS_SS;
+-	}
+-	break;
++        if (mod == 0) {
++            base = fetch_long_imm();
++            DECODE_PRINTF2("%08x", base);
++        }
++        else {
++            DECODE_PRINTF("[EBP]");
++            base = M.x86.R_ESP;
++            M.x86.mode |= SYSMODE_SEG_DS_SS;
++        }
++        break;
+     case 6:
+-	DECODE_PRINTF("[ESI]");
+-	base = M.x86.R_ESI;
+-	break;
++        DECODE_PRINTF("[ESI]");
++        base = M.x86.R_ESI;
++        break;
+     case 7:
+-	DECODE_PRINTF("[EDI]");
+-	base = M.x86.R_EDI;
+-	break;
++        DECODE_PRINTF("[EDI]");
++        base = M.x86.R_EDI;
++        break;
+     }
+     switch ((sib >> 3) & 0x07) {
+     case 0:
+-	DECODE_PRINTF("[EAX");
+-	i = M.x86.R_EAX;
+-	break;
++        DECODE_PRINTF("[EAX");
++        i = M.x86.R_EAX;
++        break;
+     case 1:
+-	DECODE_PRINTF("[ECX");
+-	i = M.x86.R_ECX;
+-	break;
++        DECODE_PRINTF("[ECX");
++        i = M.x86.R_ECX;
++        break;
+     case 2:
+-	DECODE_PRINTF("[EDX");
+-	i = M.x86.R_EDX;
+-	break;
++        DECODE_PRINTF("[EDX");
++        i = M.x86.R_EDX;
++        break;
+     case 3:
+-	DECODE_PRINTF("[EBX");
+-	i = M.x86.R_EBX;
+-	break;
++        DECODE_PRINTF("[EBX");
++        i = M.x86.R_EBX;
++        break;
+     case 4:
+-	i = 0;
+-	break;
++        i = 0;
++        break;
+     case 5:
+-	DECODE_PRINTF("[EBP");
+-	i = M.x86.R_EBP;
+-	break;
++        DECODE_PRINTF("[EBP");
++        i = M.x86.R_EBP;
++        break;
+     case 6:
+-	DECODE_PRINTF("[ESI");
+-	i = M.x86.R_ESI;
+-	break;
++        DECODE_PRINTF("[ESI");
++        i = M.x86.R_ESI;
++        break;
+     case 7:
+-	DECODE_PRINTF("[EDI");
+-	i = M.x86.R_EDI;
+-	break;
++        DECODE_PRINTF("[EDI");
++        i = M.x86.R_EDI;
++        break;
+     }
+     scale = 1 << ((sib >> 6) & 0x03);
+     if (((sib >> 3) & 0x07) != 4) {
+-	if (scale == 1) {
+-	    DECODE_PRINTF("]");
+-	} else {
+-	    DECODE_PRINTF2("*%d]", scale);
+-	}
++        if (scale == 1) {
++            DECODE_PRINTF("]");
++        }
++        else {
++            DECODE_PRINTF2("*%d]", scale);
++        }
+     }
+     return base + (i * scale);
+ }
+@@ -836,74 +832,75 @@ NOTE: 	The code which specifies the corresponding segment (ds vs ss)
+ 		if a SS access is needed, set this bit.  Otherwise, DS access
+ 		occurs (unless any of the segment override bits are set).
+ ****************************************************************************/
+-u32 decode_rm00_address(
+-	int rm)
++u32
++decode_rm00_address(int rm)
+ {
+     u32 offset;
+     int sib;
+ 
+     if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+         /* 32-bit addressing */
+-	switch (rm) {
+-	  case 0:
+-		DECODE_PRINTF("[EAX]");
+-		return M.x86.R_EAX;
+-	  case 1:
+-		DECODE_PRINTF("[ECX]");
+-		return M.x86.R_ECX;
+-	  case 2:
+-		DECODE_PRINTF("[EDX]");
+-		return M.x86.R_EDX;
+-	  case 3:
+-		DECODE_PRINTF("[EBX]");
+-		return M.x86.R_EBX;
+-	  case 4:
+-		sib = fetch_byte_imm();
+-		return decode_sib_address(sib, 0);
+-	  case 5:
+-		offset = fetch_long_imm();
+-		DECODE_PRINTF2("[%08x]", offset);
+-		return offset;
+-	  case 6:
+-		DECODE_PRINTF("[ESI]");
+-		return M.x86.R_ESI;
+-	  case 7:
+-		DECODE_PRINTF("[EDI]");
+-		return M.x86.R_EDI;
+-	}
+-	HALT_SYS();
+-    } else {
++        switch (rm) {
++        case 0:
++            DECODE_PRINTF("[EAX]");
++            return M.x86.R_EAX;
++        case 1:
++            DECODE_PRINTF("[ECX]");
++            return M.x86.R_ECX;
++        case 2:
++            DECODE_PRINTF("[EDX]");
++            return M.x86.R_EDX;
++        case 3:
++            DECODE_PRINTF("[EBX]");
++            return M.x86.R_EBX;
++        case 4:
++            sib = fetch_byte_imm();
++            return decode_sib_address(sib, 0);
++        case 5:
++            offset = fetch_long_imm();
++            DECODE_PRINTF2("[%08x]", offset);
++            return offset;
++        case 6:
++            DECODE_PRINTF("[ESI]");
++            return M.x86.R_ESI;
++        case 7:
++            DECODE_PRINTF("[EDI]");
++            return M.x86.R_EDI;
++        }
++        HALT_SYS();
++    }
++    else {
+         /* 16-bit addressing */
+-	switch (rm) {
+-	  case 0:
+-		DECODE_PRINTF("[BX+SI]");
++        switch (rm) {
++        case 0:
++            DECODE_PRINTF("[BX+SI]");
+             return (M.x86.R_BX + M.x86.R_SI) & 0xffff;
+-	  case 1:
+-		DECODE_PRINTF("[BX+DI]");
++        case 1:
++            DECODE_PRINTF("[BX+DI]");
+             return (M.x86.R_BX + M.x86.R_DI) & 0xffff;
+-	  case 2:
+-		DECODE_PRINTF("[BP+SI]");
+-		M.x86.mode |= SYSMODE_SEG_DS_SS;
++        case 2:
++            DECODE_PRINTF("[BP+SI]");
++            M.x86.mode |= SYSMODE_SEG_DS_SS;
+             return (M.x86.R_BP + M.x86.R_SI) & 0xffff;
+-	  case 3:
+-		DECODE_PRINTF("[BP+DI]");
+-		M.x86.mode |= SYSMODE_SEG_DS_SS;
++        case 3:
++            DECODE_PRINTF("[BP+DI]");
++            M.x86.mode |= SYSMODE_SEG_DS_SS;
+             return (M.x86.R_BP + M.x86.R_DI) & 0xffff;
+-	  case 4:
+-		DECODE_PRINTF("[SI]");
+-		return M.x86.R_SI;
+-	  case 5:
+-		DECODE_PRINTF("[DI]");
+-		return M.x86.R_DI;
+-	  case 6:
+-		offset = fetch_word_imm();
+-		DECODE_PRINTF2("[%04x]", offset);
+-		return offset;
+-	  case 7:
+-		DECODE_PRINTF("[BX]");
+-		return M.x86.R_BX;
+-	}
+-	HALT_SYS();
++        case 4:
++            DECODE_PRINTF("[SI]");
++            return M.x86.R_SI;
++        case 5:
++            DECODE_PRINTF("[DI]");
++            return M.x86.R_DI;
++        case 6:
++            offset = fetch_word_imm();
++            DECODE_PRINTF2("[%04x]", offset);
++            return offset;
++        case 7:
++            DECODE_PRINTF("[BX]");
++            return M.x86.R_BX;
++        }
++        HALT_SYS();
+     }
+     return 0;
+ }
+@@ -919,79 +916,80 @@ REMARKS:
+ Return the offset given by mod=01 addressing.  Also enables the
+ decoding of instructions.
+ ****************************************************************************/
+-u32 decode_rm01_address(
+-	int rm)
++u32
++decode_rm01_address(int rm)
+ {
+     int displacement = 0;
+     int sib;
+ 
+     /* Fetch disp8 if no SIB byte */
+     if (!((M.x86.mode & SYSMODE_PREFIX_ADDR) && (rm == 4)))
+-	displacement = (s8)fetch_byte_imm();
++        displacement = (s8) fetch_byte_imm();
+ 
+     if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+         /* 32-bit addressing */
+-	switch (rm) {
+-	  case 0:
+-		DECODE_PRINTF2("%d[EAX]", displacement);
+-		return M.x86.R_EAX + displacement;
+-	  case 1:
+-		DECODE_PRINTF2("%d[ECX]", displacement);
+-		return M.x86.R_ECX + displacement;
+-	  case 2:
+-		DECODE_PRINTF2("%d[EDX]", displacement);
+-		return M.x86.R_EDX + displacement;
+-	  case 3:
+-		DECODE_PRINTF2("%d[EBX]", displacement);
+-		return M.x86.R_EBX + displacement;
+-	  case 4:
+-		sib = fetch_byte_imm();
+-		displacement = (s8)fetch_byte_imm();
+-		DECODE_PRINTF2("%d", displacement);
+-		return decode_sib_address(sib, 1) + displacement;
+-	  case 5:
+-		DECODE_PRINTF2("%d[EBP]", displacement);
+-		return M.x86.R_EBP + displacement;
+-	  case 6:
+-		DECODE_PRINTF2("%d[ESI]", displacement);
+-		return M.x86.R_ESI + displacement;
+-	  case 7:
+-		DECODE_PRINTF2("%d[EDI]", displacement);
+-		return M.x86.R_EDI + displacement;
+-	}
+-	HALT_SYS();
+-    } else {
++        switch (rm) {
++        case 0:
++            DECODE_PRINTF2("%d[EAX]", displacement);
++            return M.x86.R_EAX + displacement;
++        case 1:
++            DECODE_PRINTF2("%d[ECX]", displacement);
++            return M.x86.R_ECX + displacement;
++        case 2:
++            DECODE_PRINTF2("%d[EDX]", displacement);
++            return M.x86.R_EDX + displacement;
++        case 3:
++            DECODE_PRINTF2("%d[EBX]", displacement);
++            return M.x86.R_EBX + displacement;
++        case 4:
++            sib = fetch_byte_imm();
++            displacement = (s8) fetch_byte_imm();
++            DECODE_PRINTF2("%d", displacement);
++            return decode_sib_address(sib, 1) + displacement;
++        case 5:
++            DECODE_PRINTF2("%d[EBP]", displacement);
++            return M.x86.R_EBP + displacement;
++        case 6:
++            DECODE_PRINTF2("%d[ESI]", displacement);
++            return M.x86.R_ESI + displacement;
++        case 7:
++            DECODE_PRINTF2("%d[EDI]", displacement);
++            return M.x86.R_EDI + displacement;
++        }
++        HALT_SYS();
++    }
++    else {
+         /* 16-bit addressing */
+-	switch (rm) {
+-	  case 0:
+-		DECODE_PRINTF2("%d[BX+SI]", displacement);
++        switch (rm) {
++        case 0:
++            DECODE_PRINTF2("%d[BX+SI]", displacement);
+             return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff;
+-	  case 1:
+-		DECODE_PRINTF2("%d[BX+DI]", displacement);
++        case 1:
++            DECODE_PRINTF2("%d[BX+DI]", displacement);
+             return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff;
+-	  case 2:
+-		DECODE_PRINTF2("%d[BP+SI]", displacement);
+-		M.x86.mode |= SYSMODE_SEG_DS_SS;
++        case 2:
++            DECODE_PRINTF2("%d[BP+SI]", displacement);
++            M.x86.mode |= SYSMODE_SEG_DS_SS;
+             return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff;
+-	  case 3:
+-		DECODE_PRINTF2("%d[BP+DI]", displacement);
+-		M.x86.mode |= SYSMODE_SEG_DS_SS;
++        case 3:
++            DECODE_PRINTF2("%d[BP+DI]", displacement);
++            M.x86.mode |= SYSMODE_SEG_DS_SS;
+             return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff;
+-	  case 4:
+-		DECODE_PRINTF2("%d[SI]", displacement);
++        case 4:
++            DECODE_PRINTF2("%d[SI]", displacement);
+             return (M.x86.R_SI + displacement) & 0xffff;
+-	  case 5:
+-		DECODE_PRINTF2("%d[DI]", displacement);
++        case 5:
++            DECODE_PRINTF2("%d[DI]", displacement);
+             return (M.x86.R_DI + displacement) & 0xffff;
+-	  case 6:
+-		DECODE_PRINTF2("%d[BP]", displacement);
+-		M.x86.mode |= SYSMODE_SEG_DS_SS;
++        case 6:
++            DECODE_PRINTF2("%d[BP]", displacement);
++            M.x86.mode |= SYSMODE_SEG_DS_SS;
+             return (M.x86.R_BP + displacement) & 0xffff;
+-	  case 7:
+-		DECODE_PRINTF2("%d[BX]", displacement);
++        case 7:
++            DECODE_PRINTF2("%d[BX]", displacement);
+             return (M.x86.R_BX + displacement) & 0xffff;
+-	}
+-	HALT_SYS();
++        }
++        HALT_SYS();
+     }
+     return 0;                   /* SHOULD NOT HAPPEN */
+ }
+@@ -1007,86 +1005,87 @@ REMARKS:
+ Return the offset given by mod=10 addressing.  Also enables the
+ decoding of instructions.
+ ****************************************************************************/
+-u32 decode_rm10_address(
+-	int rm)
++u32
++decode_rm10_address(int rm)
+ {
+     u32 displacement = 0;
+     int sib;
+ 
+     /* Fetch disp16 if 16-bit addr mode */
+     if (!(M.x86.mode & SYSMODE_PREFIX_ADDR))
+-	displacement = (u16)fetch_word_imm();
++        displacement = (u16) fetch_word_imm();
+     else {
+-	/* Fetch disp32 if no SIB byte */
+-	if (rm != 4)
+-	    displacement = (u32)fetch_long_imm();
++        /* Fetch disp32 if no SIB byte */
++        if (rm != 4)
++            displacement = (u32) fetch_long_imm();
+     }
+ 
+     if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+         /* 32-bit addressing */
+-      switch (rm) {
+-	  case 0:
+-		DECODE_PRINTF2("%08x[EAX]", displacement);
+-		return M.x86.R_EAX + displacement;
+-	  case 1:
+-		DECODE_PRINTF2("%08x[ECX]", displacement);
+-		return M.x86.R_ECX + displacement;
+-	  case 2:
+-		DECODE_PRINTF2("%08x[EDX]", displacement);
+-		M.x86.mode |= SYSMODE_SEG_DS_SS;
+-		return M.x86.R_EDX + displacement;
+-	  case 3:
+-		DECODE_PRINTF2("%08x[EBX]", displacement);
+-		return M.x86.R_EBX + displacement;
+-	  case 4:
+-		sib = fetch_byte_imm();
+-		displacement = (u32)fetch_long_imm();
+-		DECODE_PRINTF2("%08x", displacement);
+-		return decode_sib_address(sib, 2) + displacement;
+-		break;
+-	  case 5:
+-		DECODE_PRINTF2("%08x[EBP]", displacement);
+-		return M.x86.R_EBP + displacement;
+-	  case 6:
+-		DECODE_PRINTF2("%08x[ESI]", displacement);
+-		return M.x86.R_ESI + displacement;
+-	  case 7:
+-		DECODE_PRINTF2("%08x[EDI]", displacement);
+-		return M.x86.R_EDI + displacement;
+-	}
+-	HALT_SYS();
+-    } else {
++        switch (rm) {
++        case 0:
++            DECODE_PRINTF2("%08x[EAX]", displacement);
++            return M.x86.R_EAX + displacement;
++        case 1:
++            DECODE_PRINTF2("%08x[ECX]", displacement);
++            return M.x86.R_ECX + displacement;
++        case 2:
++            DECODE_PRINTF2("%08x[EDX]", displacement);
++            M.x86.mode |= SYSMODE_SEG_DS_SS;
++            return M.x86.R_EDX + displacement;
++        case 3:
++            DECODE_PRINTF2("%08x[EBX]", displacement);
++            return M.x86.R_EBX + displacement;
++        case 4:
++            sib = fetch_byte_imm();
++            displacement = (u32) fetch_long_imm();
++            DECODE_PRINTF2("%08x", displacement);
++            return decode_sib_address(sib, 2) + displacement;
++            break;
++        case 5:
++            DECODE_PRINTF2("%08x[EBP]", displacement);
++            return M.x86.R_EBP + displacement;
++        case 6:
++            DECODE_PRINTF2("%08x[ESI]", displacement);
++            return M.x86.R_ESI + displacement;
++        case 7:
++            DECODE_PRINTF2("%08x[EDI]", displacement);
++            return M.x86.R_EDI + displacement;
++        }
++        HALT_SYS();
++    }
++    else {
+         /* 16-bit addressing */
+-      switch (rm) {
+-	  case 0:
++        switch (rm) {
++        case 0:
+             DECODE_PRINTF2("%04x[BX+SI]", displacement);
+             return (M.x86.R_BX + M.x86.R_SI + displacement) & 0xffff;
+-	  case 1:
++        case 1:
+             DECODE_PRINTF2("%04x[BX+DI]", displacement);
+             return (M.x86.R_BX + M.x86.R_DI + displacement) & 0xffff;
+-	  case 2:
+-		DECODE_PRINTF2("%04x[BP+SI]", displacement);
+-		M.x86.mode |= SYSMODE_SEG_DS_SS;
++        case 2:
++            DECODE_PRINTF2("%04x[BP+SI]", displacement);
++            M.x86.mode |= SYSMODE_SEG_DS_SS;
+             return (M.x86.R_BP + M.x86.R_SI + displacement) & 0xffff;
+-	  case 3:
+-		DECODE_PRINTF2("%04x[BP+DI]", displacement);
+-		M.x86.mode |= SYSMODE_SEG_DS_SS;
++        case 3:
++            DECODE_PRINTF2("%04x[BP+DI]", displacement);
++            M.x86.mode |= SYSMODE_SEG_DS_SS;
+             return (M.x86.R_BP + M.x86.R_DI + displacement) & 0xffff;
+-	  case 4:
++        case 4:
+             DECODE_PRINTF2("%04x[SI]", displacement);
+             return (M.x86.R_SI + displacement) & 0xffff;
+-	  case 5:
++        case 5:
+             DECODE_PRINTF2("%04x[DI]", displacement);
+             return (M.x86.R_DI + displacement) & 0xffff;
+-	  case 6:
+-		DECODE_PRINTF2("%04x[BP]", displacement);
+-		M.x86.mode |= SYSMODE_SEG_DS_SS;
++        case 6:
++            DECODE_PRINTF2("%04x[BP]", displacement);
++            M.x86.mode |= SYSMODE_SEG_DS_SS;
+             return (M.x86.R_BP + displacement) & 0xffff;
+-	  case 7:
++        case 7:
+             DECODE_PRINTF2("%04x[BX]", displacement);
+             return (M.x86.R_BX + displacement) & 0xffff;
+-	}
+-	HALT_SYS();
++        }
++        HALT_SYS();
+     }
+     return 0;
+     /*NOTREACHED */
+diff --git a/libs/x86emu/fpu.c b/libs/x86emu/fpu.c
+index b72de1e..0dab05c 100644
+--- a/libs/x86emu/fpu.c
++++ b/libs/x86emu/fpu.c
+@@ -42,7 +42,8 @@
+ /*----------------------------- Implementation ----------------------------*/
+ 
+ /* opcode=0xd8 */
+-void x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("ESC D8\n");
+@@ -52,7 +53,7 @@ void x86emuOp_esc_coprocess_d8(u8 X86EMU_UNUSED(op1))
+ 
+ #ifdef DEBUG
+ 
+-static char *x86emu_fpu_op_d9_tab[] = {
++static const char *x86emu_fpu_op_d9_tab[] = {
+     "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
+     "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
+ 
+@@ -63,7 +64,7 @@ static char *x86emu_fpu_op_d9_tab[] = {
+     "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
+ };
+ 
+-static char *x86emu_fpu_op_d9_tab1[] = {
++static const char *x86emu_fpu_op_d9_tab1[] = {
+     "FLD\t", "FLD\t", "FLD\t", "FLD\t",
+     "FLD\t", "FLD\t", "FLD\t", "FLD\t",
+ 
+@@ -89,10 +90,11 @@ static char *x86emu_fpu_op_d9_tab1[] = {
+     "FRNDINT", "FSCALE", "ESC_D9", "ESC_D9",
+ };
+ 
+-#endif /* DEBUG */
++#endif                          /* DEBUG */
+ 
+ /* opcode=0xd9 */
+-void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset = 0;
+@@ -103,56 +105,58 @@ void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
+ #ifdef DEBUG
+     if (mod != 3) {
+         DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab, mod, rh, rl);
+-    } else {
++    }
++    else {
+         DECODE_PRINTF(x86emu_fpu_op_d9_tab1[(rh << 3) + rl]);
+     }
+ #endif
+     switch (mod) {
+-      case 0:
++    case 0:
+         destoffset = decode_rm00_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 1:
++    case 1:
+         destoffset = decode_rm01_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 2:
++    case 2:
+         destoffset = decode_rm10_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 3:                   /* register to register */
+-		stkelem = (u8)rl;
+-		if (rh < 4) {
+-				DECODE_PRINTF2("ST(%d)\n", stkelem);
+-		} else {
+-				DECODE_PRINTF("\n");
+-		}
++    case 3:                    /* register to register */
++        stkelem = (u8) rl;
++        if (rh < 4) {
++            DECODE_PRINTF2("ST(%d)\n", stkelem);
++        }
++        else {
++            DECODE_PRINTF("\n");
++        }
+         break;
+     }
+ #ifdef X86EMU_FPU_PRESENT
+     /* execute */
+     switch (mod) {
+-      case 3:
++    case 3:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_R_fld(X86EMU_FPU_STKTOP, stkelem);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_R_fxch(X86EMU_FPU_STKTOP, stkelem);
+             break;
+-          case 2:
++        case 2:
+             switch (rl) {
+-              case 0:
++            case 0:
+                 x86emu_fpu_R_nop();
+                 break;
+-              default:
++            default:
+                 x86emu_fpu_illegal();
+                 break;
+             }
+-          case 3:
++        case 3:
+             x86emu_fpu_R_fstp(X86EMU_FPU_STKTOP, stkelem);
+             break;
+-          case 4:
++        case 4:
+             switch (rl) {
+             case 0:
+                 x86emu_fpu_R_fchs(X86EMU_FPU_STKTOP);
+@@ -173,133 +177,133 @@ void x86emuOp_esc_coprocess_d9(u8 X86EMU_UNUSED(op1))
+             }
+             break;
+ 
+-          case 5:
++        case 5:
+             switch (rl) {
+-              case 0:
++            case 0:
+                 x86emu_fpu_R_fld1(X86EMU_FPU_STKTOP);
+                 break;
+-              case 1:
++            case 1:
+                 x86emu_fpu_R_fldl2t(X86EMU_FPU_STKTOP);
+                 break;
+-              case 2:
++            case 2:
+                 x86emu_fpu_R_fldl2e(X86EMU_FPU_STKTOP);
+                 break;
+-              case 3:
++            case 3:
+                 x86emu_fpu_R_fldpi(X86EMU_FPU_STKTOP);
+                 break;
+-              case 4:
++            case 4:
+                 x86emu_fpu_R_fldlg2(X86EMU_FPU_STKTOP);
+                 break;
+-              case 5:
++            case 5:
+                 x86emu_fpu_R_fldln2(X86EMU_FPU_STKTOP);
+                 break;
+-              case 6:
++            case 6:
+                 x86emu_fpu_R_fldz(X86EMU_FPU_STKTOP);
+                 break;
+-              default:
++            default:
+                 /* 7 */
+                 x86emu_fpu_illegal();
+                 break;
+             }
+             break;
+ 
+-          case 6:
++        case 6:
+             switch (rl) {
+-              case 0:
++            case 0:
+                 x86emu_fpu_R_f2xm1(X86EMU_FPU_STKTOP);
+                 break;
+-              case 1:
++            case 1:
+                 x86emu_fpu_R_fyl2x(X86EMU_FPU_STKTOP);
+                 break;
+-              case 2:
++            case 2:
+                 x86emu_fpu_R_fptan(X86EMU_FPU_STKTOP);
+                 break;
+-              case 3:
++            case 3:
+                 x86emu_fpu_R_fpatan(X86EMU_FPU_STKTOP);
+                 break;
+-              case 4:
++            case 4:
+                 x86emu_fpu_R_fxtract(X86EMU_FPU_STKTOP);
+                 break;
+-              case 5:
++            case 5:
+                 x86emu_fpu_illegal();
+                 break;
+-              case 6:
++            case 6:
+                 x86emu_fpu_R_decstp();
+                 break;
+-              case 7:
++            case 7:
+                 x86emu_fpu_R_incstp();
+                 break;
+             }
+             break;
+ 
+-          case 7:
++        case 7:
+             switch (rl) {
+-              case 0:
++            case 0:
+                 x86emu_fpu_R_fprem(X86EMU_FPU_STKTOP);
+                 break;
+-              case 1:
++            case 1:
+                 x86emu_fpu_R_fyl2xp1(X86EMU_FPU_STKTOP);
+                 break;
+-              case 2:
++            case 2:
+                 x86emu_fpu_R_fsqrt(X86EMU_FPU_STKTOP);
+                 break;
+-              case 3:
++            case 3:
+                 x86emu_fpu_illegal();
+                 break;
+-              case 4:
++            case 4:
+                 x86emu_fpu_R_frndint(X86EMU_FPU_STKTOP);
+                 break;
+-              case 5:
++            case 5:
+                 x86emu_fpu_R_fscale(X86EMU_FPU_STKTOP);
+                 break;
+-              case 6:
+-              case 7:
+-              default:
++            case 6:
++            case 7:
++            default:
+                 x86emu_fpu_illegal();
+                 break;
+             }
+             break;
+ 
+-          default:
++        default:
+             switch (rh) {
+-              case 0:
++            case 0:
+                 x86emu_fpu_M_fld(X86EMU_FPU_FLOAT, destoffset);
+                 break;
+-              case 1:
++            case 1:
+                 x86emu_fpu_illegal();
+                 break;
+-              case 2:
++            case 2:
+                 x86emu_fpu_M_fst(X86EMU_FPU_FLOAT, destoffset);
+                 break;
+-              case 3:
++            case 3:
+                 x86emu_fpu_M_fstp(X86EMU_FPU_FLOAT, destoffset);
+                 break;
+-              case 4:
++            case 4:
+                 x86emu_fpu_M_fldenv(X86EMU_FPU_WORD, destoffset);
+                 break;
+-              case 5:
++            case 5:
+                 x86emu_fpu_M_fldcw(X86EMU_FPU_WORD, destoffset);
+                 break;
+-              case 6:
++            case 6:
+                 x86emu_fpu_M_fstenv(X86EMU_FPU_WORD, destoffset);
+                 break;
+-              case 7:
++            case 7:
+                 x86emu_fpu_M_fstcw(X86EMU_FPU_WORD, destoffset);
+                 break;
+             }
+         }
+     }
+ #else
+-    (void)destoffset;
+-    (void)stkelem;
+-#endif /* X86EMU_FPU_PRESENT */
++    (void) destoffset;
++    (void) stkelem;
++#endif                          /* X86EMU_FPU_PRESENT */
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR_NO_TRACE();
+ }
+ 
+ #ifdef DEBUG
+ 
+-char *x86emu_fpu_op_da_tab[] = {
++static const char *x86emu_fpu_op_da_tab[] = {
+     "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
+     "FICOMP\tDWORD PTR ",
+     "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
+@@ -309,7 +313,7 @@ char *x86emu_fpu_op_da_tab[] = {
+     "FICOMP\tDWORD PTR ",
+     "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
+     "FIDIVR\tDWORD PTR ",
+-    
++
+     "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
+     "FICOMP\tDWORD PTR ",
+     "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
+@@ -319,10 +323,11 @@ char *x86emu_fpu_op_da_tab[] = {
+     "ESC_DA     ", "ESC_DA ", "ESC_DA   ", "ESC_DA ",
+ };
+ 
+-#endif /* DEBUG */
++#endif                          /* DEBUG */
+ 
+ /* opcode=0xda */
+-void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset = 0;
+@@ -332,59 +337,59 @@ void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
+     FETCH_DECODE_MODRM(mod, rh, rl);
+     DECODE_PRINTINSTR32(x86emu_fpu_op_da_tab, mod, rh, rl);
+     switch (mod) {
+-      case 0:
++    case 0:
+         destoffset = decode_rm00_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 1:
++    case 1:
+         destoffset = decode_rm01_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 2:
++    case 2:
+         destoffset = decode_rm10_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 3:           /* register to register */
+-		stkelem = (u8)rl;
++    case 3:                    /* register to register */
++        stkelem = (u8) rl;
+         DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+         break;
+     }
+ #ifdef X86EMU_FPU_PRESENT
+     switch (mod) {
+-      case 3:
++    case 3:
+         x86emu_fpu_illegal();
+         break;
+-      default:
++    default:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_M_iadd(X86EMU_FPU_SHORT, destoffset);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_M_imul(X86EMU_FPU_SHORT, destoffset);
+             break;
+-          case 2:
++        case 2:
+             x86emu_fpu_M_icom(X86EMU_FPU_SHORT, destoffset);
+             break;
+-          case 3:
++        case 3:
+             x86emu_fpu_M_icomp(X86EMU_FPU_SHORT, destoffset);
+             break;
+-          case 4:
++        case 4:
+             x86emu_fpu_M_isub(X86EMU_FPU_SHORT, destoffset);
+             break;
+-          case 5:
++        case 5:
+             x86emu_fpu_M_isubr(X86EMU_FPU_SHORT, destoffset);
+             break;
+-          case 6:
++        case 6:
+             x86emu_fpu_M_idiv(X86EMU_FPU_SHORT, destoffset);
+             break;
+-          case 7:
++        case 7:
+             x86emu_fpu_M_idivr(X86EMU_FPU_SHORT, destoffset);
+             break;
+         }
+     }
+ #else
+-    (void)destoffset;
+-    (void)stkelem;
++    (void) destoffset;
++    (void) stkelem;
+ #endif
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR_NO_TRACE();
+@@ -392,7 +397,7 @@ void x86emuOp_esc_coprocess_da(u8 X86EMU_UNUSED(op1))
+ 
+ #ifdef DEBUG
+ 
+-char *x86emu_fpu_op_db_tab[] = {
++static const char *x86emu_fpu_op_db_tab[] = {
+     "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
+     "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
+ 
+@@ -403,10 +408,11 @@ char *x86emu_fpu_op_db_tab[] = {
+     "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
+ };
+ 
+-#endif /* DEBUG */
++#endif                          /* DEBUG */
+ 
+ /* opcode=0xdb */
+-void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset = 0;
+@@ -416,104 +422,106 @@ void x86emuOp_esc_coprocess_db(u8 X86EMU_UNUSED(op1))
+ #ifdef DEBUG
+     if (mod != 3) {
+         DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab, mod, rh, rl);
+-    } else if (rh == 4) {       /* === 11 10 0 nnn */
++    }
++    else if (rh == 4) {         /* === 11 10 0 nnn */
+         switch (rl) {
+-          case 0:
++        case 0:
+             DECODE_PRINTF("FENI\n");
+             break;
+-          case 1:
++        case 1:
+             DECODE_PRINTF("FDISI\n");
+             break;
+-          case 2:
++        case 2:
+             DECODE_PRINTF("FCLEX\n");
+             break;
+-          case 3:
++        case 3:
+             DECODE_PRINTF("FINIT\n");
+             break;
+         }
+-    } else {
++    }
++    else {
+         DECODE_PRINTF2("ESC_DB %0x\n", (mod << 6) + (rh << 3) + (rl));
+     }
+-#endif /* DEBUG */
++#endif                          /* DEBUG */
+     switch (mod) {
+-      case 0:
++    case 0:
+         destoffset = decode_rm00_address(rl);
+         break;
+-      case 1:
++    case 1:
+         destoffset = decode_rm01_address(rl);
+         break;
+-      case 2:
++    case 2:
+         destoffset = decode_rm10_address(rl);
+         break;
+-      case 3:                   /* register to register */
++    case 3:                    /* register to register */
+         break;
+     }
+ #ifdef X86EMU_FPU_PRESENT
+     /* execute */
+     switch (mod) {
+-      case 3:
++    case 3:
+         switch (rh) {
+-          case 4:
++        case 4:
+             switch (rl) {
+-              case 0:
++            case 0:
+                 x86emu_fpu_R_feni();
+                 break;
+-              case 1:
++            case 1:
+                 x86emu_fpu_R_fdisi();
+                 break;
+-              case 2:
++            case 2:
+                 x86emu_fpu_R_fclex();
+                 break;
+-              case 3:
++            case 3:
+                 x86emu_fpu_R_finit();
+                 break;
+-              default:
++            default:
+                 x86emu_fpu_illegal();
+                 break;
+             }
+             break;
+-          default:
++        default:
+             x86emu_fpu_illegal();
+             break;
+         }
+         break;
+-      default:
++    default:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_M_fild(X86EMU_FPU_SHORT, destoffset);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_illegal();
+             break;
+-          case 2:
++        case 2:
+             x86emu_fpu_M_fist(X86EMU_FPU_SHORT, destoffset);
+             break;
+-          case 3:
++        case 3:
+             x86emu_fpu_M_fistp(X86EMU_FPU_SHORT, destoffset);
+             break;
+-          case 4:
++        case 4:
+             x86emu_fpu_illegal();
+             break;
+-          case 5:
++        case 5:
+             x86emu_fpu_M_fld(X86EMU_FPU_LDBL, destoffset);
+             break;
+-                      case 6:
++        case 6:
+             x86emu_fpu_illegal();
+             break;
+-          case 7:
++        case 7:
+             x86emu_fpu_M_fstp(X86EMU_FPU_LDBL, destoffset);
+             break;
+         }
+     }
+ #else
+-    (void)destoffset;
++    (void) destoffset;
+ #endif
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR_NO_TRACE();
+ }
+ 
+ #ifdef DEBUG
+-char *x86emu_fpu_op_dc_tab[] = {
++static const char *x86emu_fpu_op_dc_tab[] = {
+     "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
+     "FCOMP\tQWORD PTR ",
+     "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
+@@ -532,10 +540,11 @@ char *x86emu_fpu_op_dc_tab[] = {
+     "FADD\t", "FMUL\t", "FCOM\t", "FCOMP\t",
+     "FSUBR\t", "FSUB\t", "FDIVR\t", "FDIV\t",
+ };
+-#endif /* DEBUG */
++#endif                          /* DEBUG */
+ 
+ /* opcode=0xdc */
+-void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset = 0;
+@@ -545,85 +554,85 @@ void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
+     FETCH_DECODE_MODRM(mod, rh, rl);
+     DECODE_PRINTINSTR32(x86emu_fpu_op_dc_tab, mod, rh, rl);
+     switch (mod) {
+-      case 0:
++    case 0:
+         destoffset = decode_rm00_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 1:
++    case 1:
+         destoffset = decode_rm01_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 2:
++    case 2:
+         destoffset = decode_rm10_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 3:                   /* register to register */
+-		stkelem = (u8)rl;
++    case 3:                    /* register to register */
++        stkelem = (u8) rl;
+         DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+         break;
+     }
+ #ifdef X86EMU_FPU_PRESENT
+     /* execute */
+     switch (mod) {
+-      case 3:
++    case 3:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_R_fadd(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_R_fmul(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 2:
++        case 2:
+             x86emu_fpu_R_fcom(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 3:
++        case 3:
+             x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 4:
++        case 4:
+             x86emu_fpu_R_fsubr(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 5:
++        case 5:
+             x86emu_fpu_R_fsub(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 6:
++        case 6:
+             x86emu_fpu_R_fdivr(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 7:
++        case 7:
+             x86emu_fpu_R_fdiv(stkelem, X86EMU_FPU_STKTOP);
+             break;
+         }
+         break;
+-      default:
++    default:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_M_fadd(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_M_fmul(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+-          case 2:
++        case 2:
+             x86emu_fpu_M_fcom(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+-          case 3:
++        case 3:
+             x86emu_fpu_M_fcomp(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+-          case 4:
++        case 4:
+             x86emu_fpu_M_fsub(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+-          case 5:
++        case 5:
+             x86emu_fpu_M_fsubr(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+-          case 6:
++        case 6:
+             x86emu_fpu_M_fdiv(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+-          case 7:
++        case 7:
+             x86emu_fpu_M_fdivr(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+         }
+     }
+ #else
+-    (void)destoffset;
+-    (void)stkelem;
++    (void) destoffset;
++    (void) stkelem;
+ #endif
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR_NO_TRACE();
+@@ -631,7 +640,7 @@ void x86emuOp_esc_coprocess_dc(u8 X86EMU_UNUSED(op1))
+ 
+ #ifdef DEBUG
+ 
+-static char *x86emu_fpu_op_dd_tab[] = {
++static const char *x86emu_fpu_op_dd_tab[] = {
+     "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
+     "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
+ 
+@@ -645,10 +654,11 @@ static char *x86emu_fpu_op_dd_tab[] = {
+     "ESC_DD\t2C,", "ESC_DD\t2D,", "ESC_DD\t2E,", "ESC_DD\t2F,",
+ };
+ 
+-#endif /* DEBUG */
++#endif                          /* DEBUG */
+ 
+ /* opcode=0xdd */
+-void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset = 0;
+@@ -658,75 +668,75 @@ void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
+     FETCH_DECODE_MODRM(mod, rh, rl);
+     DECODE_PRINTINSTR32(x86emu_fpu_op_dd_tab, mod, rh, rl);
+     switch (mod) {
+-      case 0:
++    case 0:
+         destoffset = decode_rm00_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 1:
++    case 1:
+         destoffset = decode_rm01_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 2:
++    case 2:
+         destoffset = decode_rm10_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 3:                   /* register to register */
+-		stkelem = (u8)rl;
++    case 3:                    /* register to register */
++        stkelem = (u8) rl;
+         DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+         break;
+     }
+ #ifdef X86EMU_FPU_PRESENT
+     switch (mod) {
+-      case 3:
++    case 3:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_R_ffree(stkelem);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_R_fxch(stkelem);
+             break;
+-          case 2:
++        case 2:
+             x86emu_fpu_R_fst(stkelem);  /* register version */
+             break;
+-          case 3:
++        case 3:
+             x86emu_fpu_R_fstp(stkelem); /* register version */
+             break;
+-          default:
++        default:
+             x86emu_fpu_illegal();
+             break;
+         }
+         break;
+-      default:
++    default:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_M_fld(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_illegal();
+             break;
+-          case 2:
++        case 2:
+             x86emu_fpu_M_fst(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+-          case 3:
++        case 3:
+             x86emu_fpu_M_fstp(X86EMU_FPU_DOUBLE, destoffset);
+             break;
+-          case 4:
++        case 4:
+             x86emu_fpu_M_frstor(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 5:
++        case 5:
+             x86emu_fpu_illegal();
+             break;
+-          case 6:
++        case 6:
+             x86emu_fpu_M_fsave(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 7:
++        case 7:
+             x86emu_fpu_M_fstsw(X86EMU_FPU_WORD, destoffset);
+             break;
+         }
+     }
+ #else
+-    (void)destoffset;
+-    (void)stkelem;
++    (void) destoffset;
++    (void) stkelem;
+ #endif
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR_NO_TRACE();
+@@ -734,8 +744,7 @@ void x86emuOp_esc_coprocess_dd(u8 X86EMU_UNUSED(op1))
+ 
+ #ifdef DEBUG
+ 
+-static char *x86emu_fpu_op_de_tab[] =
+-{
++static const char *x86emu_fpu_op_de_tab[] = {
+     "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
+     "FICOMP\tWORD PTR ",
+     "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
+@@ -755,10 +764,11 @@ static char *x86emu_fpu_op_de_tab[] =
+     "FSUBRP\t", "FSUBP\t", "FDIVRP\t", "FDIVP\t",
+ };
+ 
+-#endif /* DEBUG */
++#endif                          /* DEBUG */
+ 
+ /* opcode=0xde */
+-void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset = 0;
+@@ -768,87 +778,87 @@ void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
+     FETCH_DECODE_MODRM(mod, rh, rl);
+     DECODE_PRINTINSTR32(x86emu_fpu_op_de_tab, mod, rh, rl);
+     switch (mod) {
+-      case 0:
++    case 0:
+         destoffset = decode_rm00_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 1:
++    case 1:
+         destoffset = decode_rm01_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 2:
++    case 2:
+         destoffset = decode_rm10_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 3:                   /* register to register */
+-		stkelem = (u8)rl;
++    case 3:                    /* register to register */
++        stkelem = (u8) rl;
+         DECODE_PRINTF2("\tST(%d),ST\n", stkelem);
+         break;
+     }
+ #ifdef X86EMU_FPU_PRESENT
+     switch (mod) {
+-      case 3:
++    case 3:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_R_faddp(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_R_fmulp(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 2:
++        case 2:
+             x86emu_fpu_R_fcomp(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 3:
++        case 3:
+             if (stkelem == 1)
+-              x86emu_fpu_R_fcompp(stkelem, X86EMU_FPU_STKTOP);
++                x86emu_fpu_R_fcompp(stkelem, X86EMU_FPU_STKTOP);
+             else
+-              x86emu_fpu_illegal();
++                x86emu_fpu_illegal();
+             break;
+-          case 4:
++        case 4:
+             x86emu_fpu_R_fsubrp(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 5:
++        case 5:
+             x86emu_fpu_R_fsubp(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 6:
++        case 6:
+             x86emu_fpu_R_fdivrp(stkelem, X86EMU_FPU_STKTOP);
+             break;
+-          case 7:
++        case 7:
+             x86emu_fpu_R_fdivp(stkelem, X86EMU_FPU_STKTOP);
+             break;
+         }
+         break;
+-      default:
++    default:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_M_fiadd(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_M_fimul(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 2:
++        case 2:
+             x86emu_fpu_M_ficom(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 3:
++        case 3:
+             x86emu_fpu_M_ficomp(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 4:
++        case 4:
+             x86emu_fpu_M_fisub(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 5:
++        case 5:
+             x86emu_fpu_M_fisubr(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 6:
++        case 6:
+             x86emu_fpu_M_fidiv(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 7:
++        case 7:
+             x86emu_fpu_M_fidivr(X86EMU_FPU_WORD, destoffset);
+             break;
+         }
+     }
+ #else
+-    (void)destoffset;
+-    (void)stkelem;
++    (void) destoffset;
++    (void) stkelem;
+ #endif
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR_NO_TRACE();
+@@ -856,7 +866,7 @@ void x86emuOp_esc_coprocess_de(u8 X86EMU_UNUSED(op1))
+ 
+ #ifdef DEBUG
+ 
+-static char *x86emu_fpu_op_df_tab[] = {
++static const char *x86emu_fpu_op_df_tab[] = {
+     /* mod == 00 */
+     "FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
+     "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
+@@ -877,10 +887,11 @@ static char *x86emu_fpu_op_df_tab[] = {
+     "ESC_DF\t3C,", "ESC_DF\t3D,", "ESC_DF\t3E,", "ESC_DF\t3F,"
+ };
+ 
+-#endif /* DEBUG */
++#endif                          /* DEBUG */
+ 
+ /* opcode=0xdf */
+-void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
++void
++x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset = 0;
+@@ -890,75 +901,75 @@ void x86emuOp_esc_coprocess_df(u8 X86EMU_UNUSED(op1))
+     FETCH_DECODE_MODRM(mod, rh, rl);
+     DECODE_PRINTINSTR32(x86emu_fpu_op_df_tab, mod, rh, rl);
+     switch (mod) {
+-      case 0:
++    case 0:
+         destoffset = decode_rm00_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 1:
++    case 1:
+         destoffset = decode_rm01_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 2:
++    case 2:
+         destoffset = decode_rm10_address(rl);
+         DECODE_PRINTF("\n");
+         break;
+-      case 3:                   /* register to register */
+-		stkelem = (u8)rl;
++    case 3:                    /* register to register */
++        stkelem = (u8) rl;
+         DECODE_PRINTF2("\tST(%d)\n", stkelem);
+         break;
+     }
+ #ifdef X86EMU_FPU_PRESENT
+     switch (mod) {
+-      case 3:
++    case 3:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_R_ffree(stkelem);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_R_fxch(stkelem);
+             break;
+-          case 2:
++        case 2:
+             x86emu_fpu_R_fst(stkelem);  /* register version */
+             break;
+-          case 3:
++        case 3:
+             x86emu_fpu_R_fstp(stkelem); /* register version */
+             break;
+-          default:
++        default:
+             x86emu_fpu_illegal();
+             break;
+         }
+         break;
+-      default:
++    default:
+         switch (rh) {
+-          case 0:
++        case 0:
+             x86emu_fpu_M_fild(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 1:
++        case 1:
+             x86emu_fpu_illegal();
+             break;
+-          case 2:
++        case 2:
+             x86emu_fpu_M_fist(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 3:
++        case 3:
+             x86emu_fpu_M_fistp(X86EMU_FPU_WORD, destoffset);
+             break;
+-          case 4:
++        case 4:
+             x86emu_fpu_M_fbld(X86EMU_FPU_BSD, destoffset);
+             break;
+-          case 5:
++        case 5:
+             x86emu_fpu_M_fild(X86EMU_FPU_LONG, destoffset);
+             break;
+-          case 6:
++        case 6:
+             x86emu_fpu_M_fbstp(X86EMU_FPU_BSD, destoffset);
+             break;
+-          case 7:
++        case 7:
+             x86emu_fpu_M_fistp(X86EMU_FPU_LONG, destoffset);
+             break;
+         }
+     }
+ #else
+-    (void)destoffset;
+-    (void)stkelem;
++    (void) destoffset;
++    (void) stkelem;
+ #endif
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR_NO_TRACE();
+diff --git a/libs/x86emu/ops.c b/libs/x86emu/ops.c
+index 4f504c9..76b8358 100644
+--- a/libs/x86emu/ops.c
++++ b/libs/x86emu/ops.c
+@@ -81,17 +81,17 @@ op1 - Instruction op code
+ REMARKS:
+ Handles illegal opcodes.
+ ****************************************************************************/
+-static void x86emuOp_illegal_op(
+-    u8 op1)
++static void
++x86emuOp_illegal_op(u8 op1)
+ {
+     START_OF_INSTR();
+     if (M.x86.R_SP != 0) {
+-    DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
+-    TRACE_REGS();
+-    printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
+-        M.x86.R_CS, M.x86.R_IP-1,op1);
+-    HALT_SYS();
+-        }
++        DECODE_PRINTF("ILLEGAL X86 OPCODE\n");
++        TRACE_REGS();
++        DB(printk("%04x:%04x: %02X ILLEGAL X86 OPCODE!\n",
++                  M.x86.R_CS, M.x86.R_IP - 1, op1));
++        HALT_SYS();
++    }
+     else {
+         /* If we get here, it means the stack pointer is back to zero
+          * so we are just returning from an emulator service call
+@@ -100,7 +100,7 @@ static void x86emuOp_illegal_op(
+          * call.
+          */
+         X86EMU_halt_sys();
+-        }
++    }
+     END_OF_INSTR();
+ }
+ 
+@@ -108,7 +108,8 @@ static void x86emuOp_illegal_op(
+ REMARKS:
+ Handles opcode 0x00
+ ****************************************************************************/
+-static void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -149,7 +150,7 @@ static void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         destval = add_byte(destval, *srcreg);
+         store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -166,7 +167,8 @@ static void x86emuOp_add_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x01
+ ****************************************************************************/
+-static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -188,7 +190,8 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = add_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -215,7 +218,8 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = add_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -242,7 +246,8 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = add_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -256,9 +261,9 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -266,8 +271,9 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = add_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -286,7 +292,8 @@ static void x86emuOp_add_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x02
+ ****************************************************************************/
+-static void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -324,7 +331,7 @@ static void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         *destreg = add_byte(*destreg, srcval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -341,7 +348,8 @@ static void x86emuOp_add_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x03
+ ****************************************************************************/
+-static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -362,7 +370,8 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = add_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -387,7 +396,8 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = add_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -412,7 +422,8 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = add_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -425,9 +436,9 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+             *destreg = add_word(*destreg, srcval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -435,8 +446,9 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = add_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -455,7 +467,8 @@ static void x86emuOp_add_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x04
+ ****************************************************************************/
+-static void x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 srcval;
+ 
+@@ -473,7 +486,8 @@ static void x86emuOp_add_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x05
+ ****************************************************************************/
+-static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -481,7 +495,8 @@ static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("ADD\tEAX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("ADD\tAX,");
+         srcval = fetch_word_imm();
+     }
+@@ -489,8 +504,9 @@ static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = add_long(M.x86.R_EAX, srcval);
+-    } else {
+-        M.x86.R_AX = add_word(M.x86.R_AX, (u16)srcval);
++    }
++    else {
++        M.x86.R_AX = add_word(M.x86.R_AX, (u16) srcval);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -500,7 +516,8 @@ static void x86emuOp_add_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x06
+ ****************************************************************************/
+-static void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("PUSH\tES\n");
+@@ -514,7 +531,8 @@ static void x86emuOp_push_ES(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x07
+ ****************************************************************************/
+-static void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("POP\tES\n");
+@@ -528,7 +546,8 @@ static void x86emuOp_pop_ES(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x08
+ ****************************************************************************/
+-static void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -569,7 +588,7 @@ static void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         destval = or_byte(destval, *srcreg);
+         store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -586,7 +605,8 @@ static void x86emuOp_or_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x09
+ ****************************************************************************/
+-static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -608,7 +628,8 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = or_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -635,7 +656,8 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = or_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -662,7 +684,8 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = or_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -676,9 +699,9 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -686,8 +709,9 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = or_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -706,7 +730,8 @@ static void x86emuOp_or_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0a
+ ****************************************************************************/
+-static void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -744,7 +769,7 @@ static void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         *destreg = or_byte(*destreg, srcval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -761,7 +786,8 @@ static void x86emuOp_or_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0b
+ ****************************************************************************/
+-static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -782,7 +808,8 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = or_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -807,7 +834,8 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = or_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -832,7 +860,8 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = or_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -845,9 +874,9 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+             *destreg = or_word(*destreg, srcval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -855,8 +884,9 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = or_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -875,7 +905,8 @@ static void x86emuOp_or_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0c
+ ****************************************************************************/
+-static void x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 srcval;
+ 
+@@ -893,7 +924,8 @@ static void x86emuOp_or_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0d
+ ****************************************************************************/
+-static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -901,7 +933,8 @@ static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("OR\tEAX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("OR\tAX,");
+         srcval = fetch_word_imm();
+     }
+@@ -909,8 +942,9 @@ static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = or_long(M.x86.R_EAX, srcval);
+-    } else {
+-        M.x86.R_AX = or_word(M.x86.R_AX, (u16)srcval);
++    }
++    else {
++        M.x86.R_AX = or_word(M.x86.R_AX, (u16) srcval);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -920,7 +954,8 @@ static void x86emuOp_or_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0e
+ ****************************************************************************/
+-static void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("PUSH\tCS\n");
+@@ -934,18 +969,21 @@ static void x86emuOp_push_CS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x0f. Escape for two-byte opcode (286 or better)
+ ****************************************************************************/
+-static void x86emuOp_two_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_two_byte(u8 X86EMU_UNUSED(op1))
+ {
+-    u8 op2 = (*sys_rdb)(((u32)M.x86.R_CS << 4) + (M.x86.R_IP++));
++    u8 op2 = (*sys_rdb) (((u32) M.x86.R_CS << 4) + (M.x86.R_IP++));
++
+     INC_DECODED_INST_LEN(1);
+-    (*x86emu_optab2[op2])(op2);
++    (*x86emu_optab2[op2]) (op2);
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x10
+ ****************************************************************************/
+-static void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -986,7 +1024,7 @@ static void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         destval = adc_byte(destval, *srcreg);
+         store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -1003,7 +1041,8 @@ static void x86emuOp_adc_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x11
+ ****************************************************************************/
+-static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -1025,7 +1064,8 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = adc_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -1052,7 +1092,8 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = adc_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -1079,7 +1120,8 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = adc_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -1093,9 +1135,9 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -1103,8 +1145,9 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = adc_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -1123,7 +1166,8 @@ static void x86emuOp_adc_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x12
+ ****************************************************************************/
+-static void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -1161,7 +1205,7 @@ static void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         *destreg = adc_byte(*destreg, srcval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -1178,7 +1222,8 @@ static void x86emuOp_adc_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x13
+ ****************************************************************************/
+-static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -1199,7 +1244,8 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = adc_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -1224,7 +1270,8 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = adc_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -1249,7 +1296,8 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = adc_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -1262,9 +1310,9 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+             *destreg = adc_word(*destreg, srcval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -1272,8 +1320,9 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = adc_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -1292,7 +1341,8 @@ static void x86emuOp_adc_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x14
+ ****************************************************************************/
+-static void x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 srcval;
+ 
+@@ -1310,7 +1360,8 @@ static void x86emuOp_adc_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x15
+ ****************************************************************************/
+-static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -1318,7 +1369,8 @@ static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("ADC\tEAX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("ADC\tAX,");
+         srcval = fetch_word_imm();
+     }
+@@ -1326,8 +1378,9 @@ static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = adc_long(M.x86.R_EAX, srcval);
+-    } else {
+-        M.x86.R_AX = adc_word(M.x86.R_AX, (u16)srcval);
++    }
++    else {
++        M.x86.R_AX = adc_word(M.x86.R_AX, (u16) srcval);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -1337,7 +1390,8 @@ static void x86emuOp_adc_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x16
+ ****************************************************************************/
+-static void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("PUSH\tSS\n");
+@@ -1351,7 +1405,8 @@ static void x86emuOp_push_SS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x17
+ ****************************************************************************/
+-static void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("POP\tSS\n");
+@@ -1365,7 +1420,8 @@ static void x86emuOp_pop_SS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x18
+ ****************************************************************************/
+-static void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -1406,7 +1462,7 @@ static void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         destval = sbb_byte(destval, *srcreg);
+         store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -1423,7 +1479,8 @@ static void x86emuOp_sbb_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x19
+ ****************************************************************************/
+-static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -1445,7 +1502,8 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = sbb_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -1472,7 +1530,8 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = sbb_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -1499,7 +1558,8 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = sbb_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -1513,9 +1573,9 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -1523,8 +1583,9 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = sbb_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -1543,7 +1604,8 @@ static void x86emuOp_sbb_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1a
+ ****************************************************************************/
+-static void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -1581,7 +1643,7 @@ static void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         *destreg = sbb_byte(*destreg, srcval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -1598,7 +1660,8 @@ static void x86emuOp_sbb_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1b
+ ****************************************************************************/
+-static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -1619,7 +1682,8 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = sbb_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -1644,7 +1708,8 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = sbb_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -1669,7 +1734,8 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = sbb_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -1682,9 +1748,9 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+             *destreg = sbb_word(*destreg, srcval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -1692,8 +1758,9 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = sbb_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -1712,7 +1779,8 @@ static void x86emuOp_sbb_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1c
+ ****************************************************************************/
+-static void x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 srcval;
+ 
+@@ -1730,7 +1798,8 @@ static void x86emuOp_sbb_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1d
+ ****************************************************************************/
+-static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -1738,7 +1807,8 @@ static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("SBB\tEAX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("SBB\tAX,");
+         srcval = fetch_word_imm();
+     }
+@@ -1746,8 +1816,9 @@ static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = sbb_long(M.x86.R_EAX, srcval);
+-    } else {
+-        M.x86.R_AX = sbb_word(M.x86.R_AX, (u16)srcval);
++    }
++    else {
++        M.x86.R_AX = sbb_word(M.x86.R_AX, (u16) srcval);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -1757,7 +1828,8 @@ static void x86emuOp_sbb_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1e
+ ****************************************************************************/
+-static void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("PUSH\tDS\n");
+@@ -1771,7 +1843,8 @@ static void x86emuOp_push_DS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x1f
+ ****************************************************************************/
+-static void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("POP\tDS\n");
+@@ -1785,7 +1858,8 @@ static void x86emuOp_pop_DS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x20
+ ****************************************************************************/
+-static void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -1830,7 +1904,7 @@ static void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         store_data_byte(destoffset, destval);
+         break;
+ 
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -1847,7 +1921,8 @@ static void x86emuOp_and_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x21
+ ****************************************************************************/
+-static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -1869,7 +1944,8 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = and_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -1896,7 +1972,8 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = and_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -1923,7 +2000,8 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = and_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -1937,9 +2015,9 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -1947,8 +2025,9 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = and_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -1967,7 +2046,8 @@ static void x86emuOp_and_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x22
+ ****************************************************************************/
+-static void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -2005,7 +2085,7 @@ static void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         *destreg = and_byte(*destreg, srcval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -2022,7 +2102,8 @@ static void x86emuOp_and_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x23
+ ****************************************************************************/
+-static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -2043,7 +2124,8 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = and_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -2069,7 +2151,8 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             *destreg = and_long(*destreg, srcval);
+             break;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -2094,7 +2177,8 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = and_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -2107,9 +2191,9 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+             *destreg = and_word(*destreg, srcval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -2117,8 +2201,9 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = and_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -2137,7 +2222,8 @@ static void x86emuOp_and_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x24
+ ****************************************************************************/
+-static void x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 srcval;
+ 
+@@ -2155,7 +2241,8 @@ static void x86emuOp_and_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x25
+ ****************************************************************************/
+-static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -2163,7 +2250,8 @@ static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("AND\tEAX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("AND\tAX,");
+         srcval = fetch_word_imm();
+     }
+@@ -2171,8 +2259,9 @@ static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = and_long(M.x86.R_EAX, srcval);
+-    } else {
+-        M.x86.R_AX = and_word(M.x86.R_AX, (u16)srcval);
++    }
++    else {
++        M.x86.R_AX = and_word(M.x86.R_AX, (u16) srcval);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -2182,7 +2271,8 @@ static void x86emuOp_and_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x26
+ ****************************************************************************/
+-static void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("ES:\n");
+@@ -2199,7 +2289,8 @@ static void x86emuOp_segovr_ES(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x27
+ ****************************************************************************/
+-static void x86emuOp_daa(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_daa(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("DAA\n");
+@@ -2213,7 +2304,8 @@ static void x86emuOp_daa(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x28
+ ****************************************************************************/
+-static void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -2254,7 +2346,7 @@ static void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         destval = sub_byte(destval, *srcreg);
+         store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -2271,7 +2363,8 @@ static void x86emuOp_sub_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x29
+ ****************************************************************************/
+-static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -2293,7 +2386,8 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = sub_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -2320,7 +2414,8 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = sub_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -2347,7 +2442,8 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = sub_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -2361,9 +2457,9 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -2371,8 +2467,9 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = sub_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -2391,7 +2488,8 @@ static void x86emuOp_sub_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2a
+ ****************************************************************************/
+-static void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -2429,7 +2527,7 @@ static void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         *destreg = sub_byte(*destreg, srcval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -2446,7 +2544,8 @@ static void x86emuOp_sub_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2b
+ ****************************************************************************/
+-static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -2467,7 +2566,8 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = sub_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -2492,7 +2592,8 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = sub_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -2517,7 +2618,8 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = sub_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -2530,9 +2632,9 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+             *destreg = sub_word(*destreg, srcval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -2540,8 +2642,9 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = sub_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -2560,7 +2663,8 @@ static void x86emuOp_sub_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2c
+ ****************************************************************************/
+-static void x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 srcval;
+ 
+@@ -2578,7 +2682,8 @@ static void x86emuOp_sub_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2d
+ ****************************************************************************/
+-static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -2586,7 +2691,8 @@ static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("SUB\tEAX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("SUB\tAX,");
+         srcval = fetch_word_imm();
+     }
+@@ -2594,8 +2700,9 @@ static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = sub_long(M.x86.R_EAX, srcval);
+-    } else {
+-        M.x86.R_AX = sub_word(M.x86.R_AX, (u16)srcval);
++    }
++    else {
++        M.x86.R_AX = sub_word(M.x86.R_AX, (u16) srcval);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -2605,7 +2712,8 @@ static void x86emuOp_sub_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2e
+ ****************************************************************************/
+-static void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("CS:\n");
+@@ -2619,7 +2727,8 @@ static void x86emuOp_segovr_CS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x2f
+ ****************************************************************************/
+-static void x86emuOp_das(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_das(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("DAS\n");
+@@ -2633,7 +2742,8 @@ static void x86emuOp_das(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x30
+ ****************************************************************************/
+-static void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -2674,7 +2784,7 @@ static void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         destval = xor_byte(destval, *srcreg);
+         store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -2691,7 +2801,8 @@ static void x86emuOp_xor_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x31
+ ****************************************************************************/
+-static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -2713,7 +2824,8 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = xor_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -2740,7 +2852,8 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = xor_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -2767,7 +2880,8 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = xor_long(destval, *srcreg);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -2781,9 +2895,9 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -2791,8 +2905,9 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = xor_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -2811,7 +2926,8 @@ static void x86emuOp_xor_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x32
+ ****************************************************************************/
+-static void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -2849,7 +2965,7 @@ static void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         *destreg = xor_byte(*destreg, srcval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -2866,7 +2982,8 @@ static void x86emuOp_xor_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x33
+ ****************************************************************************/
+-static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -2887,7 +3004,8 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = xor_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -2912,7 +3030,8 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = xor_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -2937,7 +3056,8 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = xor_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -2950,9 +3070,9 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+             *destreg = xor_word(*destreg, srcval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -2960,8 +3080,9 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = xor_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -2980,7 +3101,8 @@ static void x86emuOp_xor_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x34
+ ****************************************************************************/
+-static void x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 srcval;
+ 
+@@ -2998,7 +3120,8 @@ static void x86emuOp_xor_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x35
+ ****************************************************************************/
+-static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -3006,7 +3129,8 @@ static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("XOR\tEAX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("XOR\tAX,");
+         srcval = fetch_word_imm();
+     }
+@@ -3014,8 +3138,9 @@ static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = xor_long(M.x86.R_EAX, srcval);
+-    } else {
+-        M.x86.R_AX = xor_word(M.x86.R_AX, (u16)srcval);
++    }
++    else {
++        M.x86.R_AX = xor_word(M.x86.R_AX, (u16) srcval);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -3025,7 +3150,8 @@ static void x86emuOp_xor_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x36
+ ****************************************************************************/
+-static void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("SS:\n");
+@@ -3039,7 +3165,8 @@ static void x86emuOp_segovr_SS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x37
+ ****************************************************************************/
+-static void x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("AAA\n");
+@@ -3053,7 +3180,8 @@ static void x86emuOp_aaa(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x38
+ ****************************************************************************/
+-static void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -3091,7 +3219,7 @@ static void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         cmp_byte(destval, *srcreg);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -3108,7 +3236,8 @@ static void x86emuOp_cmp_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x39
+ ****************************************************************************/
+-static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -3129,7 +3258,8 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             cmp_long(destval, *srcreg);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -3154,7 +3284,8 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             cmp_long(destval, *srcreg);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -3179,7 +3310,8 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             cmp_long(destval, *srcreg);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -3192,9 +3324,9 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+             cmp_word(destval, *srcreg);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -3202,8 +3334,9 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             cmp_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -3222,7 +3355,8 @@ static void x86emuOp_cmp_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3a
+ ****************************************************************************/
+-static void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -3260,7 +3394,7 @@ static void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         cmp_byte(*destreg, srcval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -3277,7 +3411,8 @@ static void x86emuOp_cmp_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3b
+ ****************************************************************************/
+-static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -3298,7 +3433,8 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             cmp_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -3323,7 +3459,8 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             cmp_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -3348,7 +3485,8 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             cmp_long(*destreg, srcval);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -3361,9 +3499,9 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+             cmp_word(*destreg, srcval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -3371,8 +3509,9 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             cmp_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -3391,7 +3530,8 @@ static void x86emuOp_cmp_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3c
+ ****************************************************************************/
+-static void x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 srcval;
+ 
+@@ -3409,7 +3549,8 @@ static void x86emuOp_cmp_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3d
+ ****************************************************************************/
+-static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -3417,7 +3558,8 @@ static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("CMP\tEAX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("CMP\tAX,");
+         srcval = fetch_word_imm();
+     }
+@@ -3425,8 +3567,9 @@ static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         cmp_long(M.x86.R_EAX, srcval);
+-    } else {
+-        cmp_word(M.x86.R_AX, (u16)srcval);
++    }
++    else {
++        cmp_word(M.x86.R_AX, (u16) srcval);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -3436,7 +3579,8 @@ static void x86emuOp_cmp_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3e
+ ****************************************************************************/
+-static void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("DS:\n");
+@@ -3450,7 +3594,8 @@ static void x86emuOp_segovr_DS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x3f
+ ****************************************************************************/
+-static void x86emuOp_aas(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_aas(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("AAS\n");
+@@ -3464,18 +3609,21 @@ static void x86emuOp_aas(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x40
+ ****************************************************************************/
+-static void x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("INC\tEAX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("INC\tAX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = inc_long(M.x86.R_EAX);
+-    } else {
++    }
++    else {
+         M.x86.R_AX = inc_word(M.x86.R_AX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3486,18 +3634,21 @@ static void x86emuOp_inc_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x41
+ ****************************************************************************/
+-static void x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("INC\tECX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("INC\tCX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ECX = inc_long(M.x86.R_ECX);
+-    } else {
++    }
++    else {
+         M.x86.R_CX = inc_word(M.x86.R_CX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3508,18 +3659,21 @@ static void x86emuOp_inc_CX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x42
+ ****************************************************************************/
+-static void x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("INC\tEDX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("INC\tDX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EDX = inc_long(M.x86.R_EDX);
+-    } else {
++    }
++    else {
+         M.x86.R_DX = inc_word(M.x86.R_DX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3530,18 +3684,21 @@ static void x86emuOp_inc_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x43
+ ****************************************************************************/
+-static void x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("INC\tEBX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("INC\tBX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EBX = inc_long(M.x86.R_EBX);
+-    } else {
++    }
++    else {
+         M.x86.R_BX = inc_word(M.x86.R_BX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3552,18 +3709,21 @@ static void x86emuOp_inc_BX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x44
+ ****************************************************************************/
+-static void x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("INC\tESP\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("INC\tSP\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ESP = inc_long(M.x86.R_ESP);
+-    } else {
++    }
++    else {
+         M.x86.R_SP = inc_word(M.x86.R_SP);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3574,18 +3734,21 @@ static void x86emuOp_inc_SP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x45
+ ****************************************************************************/
+-static void x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("INC\tEBP\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("INC\tBP\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EBP = inc_long(M.x86.R_EBP);
+-    } else {
++    }
++    else {
+         M.x86.R_BP = inc_word(M.x86.R_BP);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3596,18 +3759,21 @@ static void x86emuOp_inc_BP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x46
+ ****************************************************************************/
+-static void x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("INC\tESI\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("INC\tSI\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ESI = inc_long(M.x86.R_ESI);
+-    } else {
++    }
++    else {
+         M.x86.R_SI = inc_word(M.x86.R_SI);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3618,18 +3784,21 @@ static void x86emuOp_inc_SI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x47
+ ****************************************************************************/
+-static void x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("INC\tEDI\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("INC\tDI\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EDI = inc_long(M.x86.R_EDI);
+-    } else {
++    }
++    else {
+         M.x86.R_DI = inc_word(M.x86.R_DI);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3640,18 +3809,21 @@ static void x86emuOp_inc_DI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x48
+ ****************************************************************************/
+-static void x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("DEC\tEAX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("DEC\tAX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = dec_long(M.x86.R_EAX);
+-    } else {
++    }
++    else {
+         M.x86.R_AX = dec_word(M.x86.R_AX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3662,18 +3834,21 @@ static void x86emuOp_dec_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x49
+ ****************************************************************************/
+-static void x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("DEC\tECX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("DEC\tCX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ECX = dec_long(M.x86.R_ECX);
+-    } else {
++    }
++    else {
+         M.x86.R_CX = dec_word(M.x86.R_CX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3684,18 +3859,21 @@ static void x86emuOp_dec_CX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4a
+ ****************************************************************************/
+-static void x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("DEC\tEDX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("DEC\tDX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EDX = dec_long(M.x86.R_EDX);
+-    } else {
++    }
++    else {
+         M.x86.R_DX = dec_word(M.x86.R_DX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3706,18 +3884,21 @@ static void x86emuOp_dec_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4b
+ ****************************************************************************/
+-static void x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("DEC\tEBX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("DEC\tBX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EBX = dec_long(M.x86.R_EBX);
+-    } else {
++    }
++    else {
+         M.x86.R_BX = dec_word(M.x86.R_BX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3728,18 +3909,21 @@ static void x86emuOp_dec_BX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4c
+ ****************************************************************************/
+-static void x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("DEC\tESP\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("DEC\tSP\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ESP = dec_long(M.x86.R_ESP);
+-    } else {
++    }
++    else {
+         M.x86.R_SP = dec_word(M.x86.R_SP);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3750,18 +3934,21 @@ static void x86emuOp_dec_SP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4d
+ ****************************************************************************/
+-static void x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("DEC\tEBP\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("DEC\tBP\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EBP = dec_long(M.x86.R_EBP);
+-    } else {
++    }
++    else {
+         M.x86.R_BP = dec_word(M.x86.R_BP);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3772,18 +3959,21 @@ static void x86emuOp_dec_BP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4e
+ ****************************************************************************/
+-static void x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("DEC\tESI\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("DEC\tSI\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ESI = dec_long(M.x86.R_ESI);
+-    } else {
++    }
++    else {
+         M.x86.R_SI = dec_word(M.x86.R_SI);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3794,18 +3984,21 @@ static void x86emuOp_dec_SI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x4f
+ ****************************************************************************/
+-static void x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("DEC\tEDI\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("DEC\tDI\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EDI = dec_long(M.x86.R_EDI);
+-    } else {
++    }
++    else {
+         M.x86.R_DI = dec_word(M.x86.R_DI);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3816,18 +4009,21 @@ static void x86emuOp_dec_DI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x50
+ ****************************************************************************/
+-static void x86emuOp_push_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_AX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("PUSH\tEAX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("PUSH\tAX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         push_long(M.x86.R_EAX);
+-    } else {
++    }
++    else {
+         push_word(M.x86.R_AX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3838,18 +4034,21 @@ static void x86emuOp_push_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x51
+ ****************************************************************************/
+-static void x86emuOp_push_CX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_CX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("PUSH\tECX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("PUSH\tCX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         push_long(M.x86.R_ECX);
+-    } else {
++    }
++    else {
+         push_word(M.x86.R_CX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3860,18 +4059,21 @@ static void x86emuOp_push_CX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x52
+ ****************************************************************************/
+-static void x86emuOp_push_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_DX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("PUSH\tEDX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("PUSH\tDX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         push_long(M.x86.R_EDX);
+-    } else {
++    }
++    else {
+         push_word(M.x86.R_DX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3882,18 +4084,21 @@ static void x86emuOp_push_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x53
+ ****************************************************************************/
+-static void x86emuOp_push_BX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_BX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("PUSH\tEBX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("PUSH\tBX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         push_long(M.x86.R_EBX);
+-    } else {
++    }
++    else {
+         push_word(M.x86.R_BX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3904,23 +4109,26 @@ static void x86emuOp_push_BX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x54
+ ****************************************************************************/
+-static void x86emuOp_push_SP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_SP(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("PUSH\tESP\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("PUSH\tSP\n");
+     }
+     TRACE_AND_STEP();
+-	/* Always push (E)SP, since we are emulating an i386 and above
+-	 * processor. This is necessary as some BIOS'es use this to check
+-	 * what type of processor is in the system.
+-	 */
+-	if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-		push_long(M.x86.R_ESP);
+-	} else {
+-		push_word((u16)(M.x86.R_SP));
++    /* Always push (E)SP, since we are emulating an i386 and above
++     * processor. This is necessary as some BIOS'es use this to check
++     * what type of processor is in the system.
++     */
++    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++        push_long(M.x86.R_ESP);
++    }
++    else {
++        push_word((u16) (M.x86.R_SP));
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -3930,18 +4138,21 @@ static void x86emuOp_push_SP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x55
+ ****************************************************************************/
+-static void x86emuOp_push_BP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_BP(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("PUSH\tEBP\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("PUSH\tBP\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         push_long(M.x86.R_EBP);
+-    } else {
++    }
++    else {
+         push_word(M.x86.R_BP);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3952,18 +4163,21 @@ static void x86emuOp_push_BP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x56
+ ****************************************************************************/
+-static void x86emuOp_push_SI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_SI(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("PUSH\tESI\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("PUSH\tSI\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         push_long(M.x86.R_ESI);
+-    } else {
++    }
++    else {
+         push_word(M.x86.R_SI);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3974,18 +4188,21 @@ static void x86emuOp_push_SI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x57
+ ****************************************************************************/
+-static void x86emuOp_push_DI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_DI(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("PUSH\tEDI\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("PUSH\tDI\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         push_long(M.x86.R_EDI);
+-    } else {
++    }
++    else {
+         push_word(M.x86.R_DI);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -3996,18 +4213,21 @@ static void x86emuOp_push_DI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x58
+ ****************************************************************************/
+-static void x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("POP\tEAX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("POP\tAX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = pop_long();
+-    } else {
++    }
++    else {
+         M.x86.R_AX = pop_word();
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -4018,18 +4238,21 @@ static void x86emuOp_pop_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x59
+ ****************************************************************************/
+-static void x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("POP\tECX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("POP\tCX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ECX = pop_long();
+-    } else {
++    }
++    else {
+         M.x86.R_CX = pop_word();
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -4040,18 +4263,21 @@ static void x86emuOp_pop_CX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5a
+ ****************************************************************************/
+-static void x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("POP\tEDX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("POP\tDX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EDX = pop_long();
+-    } else {
++    }
++    else {
+         M.x86.R_DX = pop_word();
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -4062,18 +4288,21 @@ static void x86emuOp_pop_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5b
+ ****************************************************************************/
+-static void x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("POP\tEBX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("POP\tBX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EBX = pop_long();
+-    } else {
++    }
++    else {
+         M.x86.R_BX = pop_word();
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -4084,18 +4313,21 @@ static void x86emuOp_pop_BX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5c
+ ****************************************************************************/
+-static void x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("POP\tESP\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("POP\tSP\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ESP = pop_long();
+-    } else {
++    }
++    else {
+         M.x86.R_SP = pop_word();
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -4106,18 +4338,21 @@ static void x86emuOp_pop_SP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5d
+ ****************************************************************************/
+-static void x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("POP\tEBP\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("POP\tBP\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EBP = pop_long();
+-    } else {
++    }
++    else {
+         M.x86.R_BP = pop_word();
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -4128,18 +4363,21 @@ static void x86emuOp_pop_BP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5e
+ ****************************************************************************/
+-static void x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("POP\tESI\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("POP\tSI\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ESI = pop_long();
+-    } else {
++    }
++    else {
+         M.x86.R_SI = pop_word();
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -4150,18 +4388,21 @@ static void x86emuOp_pop_SI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x5f
+ ****************************************************************************/
+-static void x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("POP\tEDI\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("POP\tDI\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EDI = pop_long();
+-    } else {
++    }
++    else {
+         M.x86.R_DI = pop_word();
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -4172,12 +4413,14 @@ static void x86emuOp_pop_DI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x60
+ ****************************************************************************/
+-static void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("PUSHAD\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("PUSHA\n");
+     }
+     TRACE_AND_STEP();
+@@ -4192,7 +4435,8 @@ static void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
+         push_long(M.x86.R_EBP);
+         push_long(M.x86.R_ESI);
+         push_long(M.x86.R_EDI);
+-    } else {
++    }
++    else {
+         u16 old_sp = M.x86.R_SP;
+ 
+         push_word(M.x86.R_AX);
+@@ -4212,12 +4456,14 @@ static void x86emuOp_push_all(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x61
+ ****************************************************************************/
+-static void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("POPAD\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("POPA\n");
+     }
+     TRACE_AND_STEP();
+@@ -4225,16 +4471,17 @@ static void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
+         M.x86.R_EDI = pop_long();
+         M.x86.R_ESI = pop_long();
+         M.x86.R_EBP = pop_long();
+-        M.x86.R_ESP += 4;              /* skip ESP */
++        M.x86.R_ESP += 4;       /* skip ESP */
+         M.x86.R_EBX = pop_long();
+         M.x86.R_EDX = pop_long();
+         M.x86.R_ECX = pop_long();
+         M.x86.R_EAX = pop_long();
+-    } else {
++    }
++    else {
+         M.x86.R_DI = pop_word();
+         M.x86.R_SI = pop_word();
+         M.x86.R_BP = pop_word();
+-        M.x86.R_SP += 2;               /* skip SP */
++        M.x86.R_SP += 2;        /* skip SP */
+         M.x86.R_BX = pop_word();
+         M.x86.R_DX = pop_word();
+         M.x86.R_CX = pop_word();
+@@ -4251,7 +4498,8 @@ static void x86emuOp_pop_all(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x64
+ ****************************************************************************/
+-static void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("FS:\n");
+@@ -4268,7 +4516,8 @@ static void x86emuOp_segovr_FS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x65
+ ****************************************************************************/
+-static void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("GS:\n");
+@@ -4285,7 +4534,8 @@ static void x86emuOp_segovr_GS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x66 - prefix for 32-bit register
+ ****************************************************************************/
+-static void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("DATA:\n");
+@@ -4299,7 +4549,8 @@ static void x86emuOp_prefix_data(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x67 - prefix for 32-bit address
+ ****************************************************************************/
+-static void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("ADDR:\n");
+@@ -4313,22 +4564,25 @@ static void x86emuOp_prefix_addr(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x68
+ ****************************************************************************/
+-static void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 imm;
+ 
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         imm = fetch_long_imm();
+-    } else {
++    }
++    else {
+         imm = fetch_word_imm();
+     }
+     DECODE_PRINTF2("PUSH\t%x\n", imm);
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         push_long(imm);
+-    } else {
+-        push_word((u16)imm);
++    }
++    else {
++        push_word((u16) imm);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -4338,7 +4592,8 @@ static void x86emuOp_push_word_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x69
+ ****************************************************************************/
+-static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -4351,7 +4606,7 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+             u32 srcval;
+-            u32 res_lo,res_hi;
++            u32 res_lo, res_hi;
+             s32 imm;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+@@ -4359,18 +4614,20 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+             srcoffset = decode_rm00_address(rl);
+             srcval = fetch_data_long(srcoffset);
+             imm = fetch_long_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++            imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
++            *destreg = (u32) res_lo;
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+             u32 res;
+@@ -4381,24 +4638,26 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+             srcoffset = decode_rm00_address(rl);
+             srcval = fetch_data_word(srcoffset);
+             imm = fetch_word_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            res = (s16)srcval * (s16)imm;
++            res = (s16) srcval *(s16) imm;
++
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+     case 1:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+             u32 srcval;
+-            u32 res_lo,res_hi;
++            u32 res_lo, res_hi;
+             s32 imm;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+@@ -4406,18 +4665,20 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+             srcoffset = decode_rm01_address(rl);
+             srcval = fetch_data_long(srcoffset);
+             imm = fetch_long_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++            imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
++            *destreg = (u32) res_lo;
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+             u32 res;
+@@ -4428,24 +4689,26 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+             srcoffset = decode_rm01_address(rl);
+             srcval = fetch_data_word(srcoffset);
+             imm = fetch_word_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            res = (s16)srcval * (s16)imm;
++            res = (s16) srcval *(s16) imm;
++
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+     case 2:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+             u32 srcval;
+-            u32 res_lo,res_hi;
++            u32 res_lo, res_hi;
+             s32 imm;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+@@ -4453,18 +4716,20 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+             srcoffset = decode_rm10_address(rl);
+             srcval = fetch_data_long(srcoffset);
+             imm = fetch_long_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++            imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
++            *destreg = (u32) res_lo;
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+             u32 res;
+@@ -4475,42 +4740,46 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+             srcoffset = decode_rm10_address(rl);
+             srcval = fetch_data_word(srcoffset);
+             imm = fetch_word_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            res = (s16)srcval * (s16)imm;
++            res = (s16) srcval *(s16) imm;
++
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
+-            u32 res_lo,res_hi;
++            u32 *destreg, *srcreg;
++            u32 res_lo, res_hi;
+             s32 imm;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcreg = DECODE_RM_LONG_REGISTER(rl);
+             imm = fetch_long_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
++            imul_long_direct(&res_lo, &res_hi, (s32) * srcreg, (s32) imm);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
+-            u16 *destreg,*srcreg;
++            *destreg = (u32) res_lo;
++        }
++        else {
++            u16 *destreg, *srcreg;
+             u32 res;
+             s16 imm;
+ 
+@@ -4518,16 +4787,17 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF(",");
+             srcreg = DECODE_RM_WORD_REGISTER(rl);
+             imm = fetch_word_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
+-            res = (s16)*srcreg * (s16)imm;
++            DECODE_PRINTF2(",%d\n", (s32) imm);
++            res = (s16) * srcreg * (s16) imm;
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+     }
+@@ -4539,18 +4809,20 @@ static void x86emuOp_imul_word_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6a
+ ****************************************************************************/
+-static void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     s16 imm;
+ 
+     START_OF_INSTR();
+-    imm = (s8)fetch_byte_imm();
++    imm = (s8) fetch_byte_imm();
+     DECODE_PRINTF2("PUSH\t%d\n", imm);
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-	push_long((s32)imm);
+-    } else {
+-	push_word(imm);
++        push_long((s32) imm);
++    }
++    else {
++        push_word(imm);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -4560,11 +4832,12 @@ static void x86emuOp_push_byte_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6b
+ ****************************************************************************/
+-static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+-    s8  imm;
++    s8 imm;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("IMUL\t");
+@@ -4574,25 +4847,27 @@ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+             u32 srcval;
+-            u32 res_lo,res_hi;
++            u32 res_lo, res_hi;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm00_address(rl);
+             srcval = fetch_data_long(srcoffset);
+             imm = fetch_byte_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++            imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
++            *destreg = (u32) res_lo;
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+             u32 res;
+@@ -4602,42 +4877,46 @@ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+             srcoffset = decode_rm00_address(rl);
+             srcval = fetch_data_word(srcoffset);
+             imm = fetch_byte_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            res = (s16)srcval * (s16)imm;
++            res = (s16) srcval *(s16) imm;
++
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+     case 1:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+             u32 srcval;
+-            u32 res_lo,res_hi;
++            u32 res_lo, res_hi;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm01_address(rl);
+             srcval = fetch_data_long(srcoffset);
+             imm = fetch_byte_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++            imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
++            *destreg = (u32) res_lo;
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+             u32 res;
+@@ -4647,42 +4926,46 @@ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+             srcoffset = decode_rm01_address(rl);
+             srcval = fetch_data_word(srcoffset);
+             imm = fetch_byte_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            res = (s16)srcval * (s16)imm;
++            res = (s16) srcval *(s16) imm;
++
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+     case 2:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+             u32 srcval;
+-            u32 res_lo,res_hi;
++            u32 res_lo, res_hi;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm10_address(rl);
+             srcval = fetch_data_long(srcoffset);
+             imm = fetch_byte_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)srcval,(s32)imm);
++            imul_long_direct(&res_lo, &res_hi, (s32) srcval, (s32) imm);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
++            *destreg = (u32) res_lo;
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+             u32 res;
+@@ -4692,57 +4975,62 @@ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+             srcoffset = decode_rm10_address(rl);
+             srcval = fetch_data_word(srcoffset);
+             imm = fetch_byte_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            res = (s16)srcval * (s16)imm;
++            res = (s16) srcval *(s16) imm;
++
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
+-            u32 res_lo,res_hi;
++            u32 *destreg, *srcreg;
++            u32 res_lo, res_hi;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcreg = DECODE_RM_LONG_REGISTER(rl);
+             imm = fetch_byte_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
++            DECODE_PRINTF2(",%d\n", (s32) imm);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)*srcreg,(s32)imm);
++            imul_long_direct(&res_lo, &res_hi, (s32) * srcreg, (s32) imm);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
+-            u16 *destreg,*srcreg;
++            *destreg = (u32) res_lo;
++        }
++        else {
++            u16 *destreg, *srcreg;
+             u32 res;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcreg = DECODE_RM_WORD_REGISTER(rl);
+             imm = fetch_byte_imm();
+-            DECODE_PRINTF2(",%d\n", (s32)imm);
+-            res = (s16)*srcreg * (s16)imm;
++            DECODE_PRINTF2(",%d\n", (s32) imm);
++            res = (s16) * srcreg * (s16) imm;
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+     }
+@@ -4754,7 +5042,8 @@ static void x86emuOp_imul_byte_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6c
+ ****************************************************************************/
+-static void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("INSB\n");
+@@ -4768,13 +5057,15 @@ static void x86emuOp_ins_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6d
+ ****************************************************************************/
+-static void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("INSD\n");
+         ins(4);
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("INSW\n");
+         ins(2);
+     }
+@@ -4787,7 +5078,8 @@ static void x86emuOp_ins_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6e
+ ****************************************************************************/
+-static void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("OUTSB\n");
+@@ -4801,13 +5093,15 @@ static void x86emuOp_outs_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x6f
+ ****************************************************************************/
+-static void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("OUTSD\n");
+         outs(4);
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("OUTSW\n");
+         outs(2);
+     }
+@@ -4820,7 +5114,8 @@ static void x86emuOp_outs_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x70
+ ****************************************************************************/
+-static void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -4828,8 +5123,8 @@ static void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if overflow flag is set */
+     START_OF_INSTR();
+     DECODE_PRINTF("JO\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (ACCESS_FLAG(F_OF))
+@@ -4842,7 +5137,8 @@ static void x86emuOp_jump_near_O(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x71
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -4850,8 +5146,8 @@ static void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if overflow is not set */
+     START_OF_INSTR();
+     DECODE_PRINTF("JNO\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (!ACCESS_FLAG(F_OF))
+@@ -4864,7 +5160,8 @@ static void x86emuOp_jump_near_NO(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x72
+ ****************************************************************************/
+-static void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -4872,8 +5169,8 @@ static void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if carry flag is set. */
+     START_OF_INSTR();
+     DECODE_PRINTF("JB\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (ACCESS_FLAG(F_CF))
+@@ -4886,7 +5183,8 @@ static void x86emuOp_jump_near_B(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x73
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -4894,8 +5192,8 @@ static void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if carry flag is clear. */
+     START_OF_INSTR();
+     DECODE_PRINTF("JNB\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (!ACCESS_FLAG(F_CF))
+@@ -4908,7 +5206,8 @@ static void x86emuOp_jump_near_NB(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x74
+ ****************************************************************************/
+-static void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -4916,8 +5215,8 @@ static void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if zero flag is set. */
+     START_OF_INSTR();
+     DECODE_PRINTF("JZ\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (ACCESS_FLAG(F_ZF))
+@@ -4930,7 +5229,8 @@ static void x86emuOp_jump_near_Z(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x75
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -4938,8 +5238,8 @@ static void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if zero flag is clear. */
+     START_OF_INSTR();
+     DECODE_PRINTF("JNZ\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (!ACCESS_FLAG(F_ZF))
+@@ -4952,7 +5252,8 @@ static void x86emuOp_jump_near_NZ(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x76
+ ****************************************************************************/
+-static void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -4961,8 +5262,8 @@ static void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
+        flag is set. */
+     START_OF_INSTR();
+     DECODE_PRINTF("JBE\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF))
+@@ -4975,7 +5276,8 @@ static void x86emuOp_jump_near_BE(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x77
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -4984,8 +5286,8 @@ static void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
+        flag is clear */
+     START_OF_INSTR();
+     DECODE_PRINTF("JNBE\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (!(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF)))
+@@ -4998,7 +5300,8 @@ static void x86emuOp_jump_near_NBE(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x78
+ ****************************************************************************/
+-static void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -5006,8 +5309,8 @@ static void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if sign flag is set */
+     START_OF_INSTR();
+     DECODE_PRINTF("JS\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (ACCESS_FLAG(F_SF))
+@@ -5020,7 +5323,8 @@ static void x86emuOp_jump_near_S(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x79
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -5028,8 +5332,8 @@ static void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if sign flag is clear */
+     START_OF_INSTR();
+     DECODE_PRINTF("JNS\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (!ACCESS_FLAG(F_SF))
+@@ -5042,7 +5346,8 @@ static void x86emuOp_jump_near_NS(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7a
+ ****************************************************************************/
+-static void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -5050,8 +5355,8 @@ static void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if parity flag is set (even parity) */
+     START_OF_INSTR();
+     DECODE_PRINTF("JP\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (ACCESS_FLAG(F_PF))
+@@ -5064,7 +5369,8 @@ static void x86emuOp_jump_near_P(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7b
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -5072,8 +5378,8 @@ static void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if parity flag is clear (odd parity) */
+     START_OF_INSTR();
+     DECODE_PRINTF("JNP\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (!ACCESS_FLAG(F_PF))
+@@ -5086,7 +5392,8 @@ static void x86emuOp_jump_near_NP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7c
+ ****************************************************************************/
+-static void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -5095,8 +5402,8 @@ static void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if sign flag not equal to overflow flag. */
+     START_OF_INSTR();
+     DECODE_PRINTF("JL\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     sf = ACCESS_FLAG(F_SF) != 0;
+@@ -5111,7 +5418,8 @@ static void x86emuOp_jump_near_L(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7d
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -5120,8 +5428,8 @@ static void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
+     /* jump to byte offset if sign flag not equal to overflow flag. */
+     START_OF_INSTR();
+     DECODE_PRINTF("JNL\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     sf = ACCESS_FLAG(F_SF) != 0;
+@@ -5137,7 +5445,8 @@ static void x86emuOp_jump_near_NL(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7e
+ ****************************************************************************/
+-static void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -5147,8 +5456,8 @@ static void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
+        or the zero flag is set */
+     START_OF_INSTR();
+     DECODE_PRINTF("JLE\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     sf = ACCESS_FLAG(F_SF) != 0;
+@@ -5163,7 +5472,8 @@ static void x86emuOp_jump_near_LE(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x7f
+ ****************************************************************************/
+-static void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
+ {
+     s8 offset;
+     u16 target;
+@@ -5173,8 +5483,8 @@ static void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
+        and the zero flag is clear */
+     START_OF_INSTR();
+     DECODE_PRINTF("JNLE\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + (s16)offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + (s16) offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     sf = ACCESS_FLAG(F_SF) != 0;
+@@ -5185,23 +5495,23 @@ static void x86emuOp_jump_near_NLE(u8 X86EMU_UNUSED(op1))
+     END_OF_INSTR();
+ }
+ 
+-static u8 (*opc80_byte_operation[])(u8 d, u8 s) =
+-{
+-    add_byte,           /* 00 */
+-    or_byte,            /* 01 */
+-    adc_byte,           /* 02 */
+-    sbb_byte,           /* 03 */
+-    and_byte,           /* 04 */
+-    sub_byte,           /* 05 */
+-    xor_byte,           /* 06 */
+-    cmp_byte,           /* 07 */
++static u8(*opc80_byte_operation[]) (u8 d, u8 s) = {
++    add_byte,                   /* 00 */
++        or_byte,                /* 01 */
++        adc_byte,               /* 02 */
++        sbb_byte,               /* 03 */
++        and_byte,               /* 04 */
++        sub_byte,               /* 05 */
++        xor_byte,               /* 06 */
++        cmp_byte,               /* 07 */
+ };
+ 
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x80
+ ****************************************************************************/
+-static void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg;
+@@ -5290,7 +5600,7 @@ static void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+         if (rh != 7)
+             store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         imm = fetch_byte_imm();
+@@ -5305,35 +5615,34 @@ static void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+     END_OF_INSTR();
+ }
+ 
+-static u16 (*opc81_word_operation[])(u16 d, u16 s) =
+-{
+-    add_word,           /*00 */
+-    or_word,            /*01 */
+-    adc_word,           /*02 */
+-    sbb_word,           /*03 */
+-    and_word,           /*04 */
+-    sub_word,           /*05 */
+-    xor_word,           /*06 */
+-    cmp_word,           /*07 */
++static u16(*opc81_word_operation[]) (u16 d, u16 s) = {
++    add_word,                   /*00 */
++        or_word,                /*01 */
++        adc_word,               /*02 */
++        sbb_word,               /*03 */
++        and_word,               /*04 */
++        sub_word,               /*05 */
++        xor_word,               /*06 */
++        cmp_word,               /*07 */
+ };
+ 
+-static u32 (*opc81_long_operation[])(u32 d, u32 s) =
+-{
+-    add_long,           /*00 */
+-    or_long,            /*01 */
+-    adc_long,           /*02 */
+-    sbb_long,           /*03 */
+-    and_long,           /*04 */
+-    sub_long,           /*05 */
+-    xor_long,           /*06 */
+-    cmp_long,           /*07 */
++static u32(*opc81_long_operation[]) (u32 d, u32 s) = {
++    add_long,                   /*00 */
++        or_long,                /*01 */
++        adc_long,               /*02 */
++        sbb_long,               /*03 */
++        and_long,               /*04 */
++        sub_long,               /*05 */
++        xor_long,               /*06 */
++        cmp_long,               /*07 */
+ };
+ 
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x81
+ ****************************************************************************/
+-static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -5387,7 +5696,7 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+     switch (mod) {
+     case 0:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 destval,imm;
++            u32 destval, imm;
+ 
+             DECODE_PRINTF("DWORD PTR ");
+             destoffset = decode_rm00_address(rl);
+@@ -5399,8 +5708,9 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             destval = (*opc81_long_operation[rh]) (destval, imm);
+             if (rh != 7)
+                 store_data_long(destoffset, destval);
+-        } else {
+-            u16 destval,imm;
++        }
++        else {
++            u16 destval, imm;
+ 
+             DECODE_PRINTF("WORD PTR ");
+             destoffset = decode_rm00_address(rl);
+@@ -5416,7 +5726,7 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+         break;
+     case 1:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 destval,imm;
++            u32 destval, imm;
+ 
+             DECODE_PRINTF("DWORD PTR ");
+             destoffset = decode_rm01_address(rl);
+@@ -5428,8 +5738,9 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             destval = (*opc81_long_operation[rh]) (destval, imm);
+             if (rh != 7)
+                 store_data_long(destoffset, destval);
+-        } else {
+-            u16 destval,imm;
++        }
++        else {
++            u16 destval, imm;
+ 
+             DECODE_PRINTF("WORD PTR ");
+             destoffset = decode_rm01_address(rl);
+@@ -5445,7 +5756,7 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+         break;
+     case 2:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 destval,imm;
++            u32 destval, imm;
+ 
+             DECODE_PRINTF("DWORD PTR ");
+             destoffset = decode_rm10_address(rl);
+@@ -5457,8 +5768,9 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             destval = (*opc81_long_operation[rh]) (destval, imm);
+             if (rh != 7)
+                 store_data_long(destoffset, destval);
+-        } else {
+-            u16 destval,imm;
++        }
++        else {
++            u16 destval, imm;
+ 
+             DECODE_PRINTF("WORD PTR ");
+             destoffset = decode_rm10_address(rl);
+@@ -5472,10 +5784,10 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+                 store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+-            u32 destval,imm;
++            u32 destval, imm;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -5485,9 +5797,10 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             destval = (*opc81_long_operation[rh]) (*destreg, imm);
+             if (rh != 7)
+                 *destreg = destval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+-            u16 destval,imm;
++            u16 destval, imm;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -5504,23 +5817,23 @@ static void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+     END_OF_INSTR();
+ }
+ 
+-static u8 (*opc82_byte_operation[])(u8 s, u8 d) =
+-{
+-    add_byte,           /*00 */
+-    or_byte,            /*01 *//*YYY UNUSED ???? */
+-    adc_byte,           /*02 */
+-    sbb_byte,           /*03 */
+-    and_byte,           /*04 *//*YYY UNUSED ???? */
+-    sub_byte,           /*05 */
+-    xor_byte,           /*06 *//*YYY UNUSED ???? */
+-    cmp_byte,           /*07 */
++static u8(*opc82_byte_operation[]) (u8 s, u8 d) = {
++    add_byte,                   /*00 */
++        or_byte,                /*01 *//*YYY UNUSED ???? */
++        adc_byte,               /*02 */
++        sbb_byte,               /*03 */
++        and_byte,               /*04 *//*YYY UNUSED ???? */
++        sub_byte,               /*05 */
++        xor_byte,               /*06 *//*YYY UNUSED ???? */
++        cmp_byte,               /*07 */
+ };
+ 
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x82
+ ****************************************************************************/
+-static void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg;
+@@ -5606,7 +5919,7 @@ static void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+         if (rh != 7)
+             store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         imm = fetch_byte_imm();
+         DECODE_PRINTF2(",%x\n", imm);
+@@ -5620,35 +5933,34 @@ static void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+     END_OF_INSTR();
+ }
+ 
+-static u16 (*opc83_word_operation[])(u16 s, u16 d) =
+-{
+-    add_word,           /*00 */
+-    or_word,            /*01 *//*YYY UNUSED ???? */
+-    adc_word,           /*02 */
+-    sbb_word,           /*03 */
+-    and_word,           /*04 *//*YYY UNUSED ???? */
+-    sub_word,           /*05 */
+-    xor_word,           /*06 *//*YYY UNUSED ???? */
+-    cmp_word,           /*07 */
++static u16(*opc83_word_operation[]) (u16 s, u16 d) = {
++    add_word,                   /*00 */
++        or_word,                /*01 *//*YYY UNUSED ???? */
++        adc_word,               /*02 */
++        sbb_word,               /*03 */
++        and_word,               /*04 *//*YYY UNUSED ???? */
++        sub_word,               /*05 */
++        xor_word,               /*06 *//*YYY UNUSED ???? */
++        cmp_word,               /*07 */
+ };
+ 
+-static u32 (*opc83_long_operation[])(u32 s, u32 d) =
+-{
+-    add_long,           /*00 */
+-    or_long,            /*01 *//*YYY UNUSED ???? */
+-    adc_long,           /*02 */
+-    sbb_long,           /*03 */
+-    and_long,           /*04 *//*YYY UNUSED ???? */
+-    sub_long,           /*05 */
+-    xor_long,           /*06 *//*YYY UNUSED ???? */
+-    cmp_long,           /*07 */
++static u32(*opc83_long_operation[]) (u32 s, u32 d) = {
++    add_long,                   /*00 */
++        or_long,                /*01 *//*YYY UNUSED ???? */
++        adc_long,               /*02 */
++        sbb_long,               /*03 */
++        and_long,               /*04 *//*YYY UNUSED ???? */
++        sub_long,               /*05 */
++        xor_long,               /*06 *//*YYY UNUSED ???? */
++        cmp_long,               /*07 */
+ };
+ 
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x83
+ ****************************************************************************/
+-static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -5667,7 +5979,7 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+            general, so that it is important to leave the strings
+            in the same format, even though the result is that the 
+            above test is done twice. */
+-       switch (rh) {
++        switch (rh) {
+         case 0:
+             DECODE_PRINTF("ADD\t");
+             break;
+@@ -5700,7 +6012,7 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+     switch (mod) {
+     case 0:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 destval,imm;
++            u32 destval, imm;
+ 
+             DECODE_PRINTF("DWORD PTR ");
+             destoffset = decode_rm00_address(rl);
+@@ -5711,8 +6023,9 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             destval = (*opc83_long_operation[rh]) (destval, imm);
+             if (rh != 7)
+                 store_data_long(destoffset, destval);
+-        } else {
+-            u16 destval,imm;
++        }
++        else {
++            u16 destval, imm;
+ 
+             DECODE_PRINTF("WORD PTR ");
+             destoffset = decode_rm00_address(rl);
+@@ -5727,7 +6040,7 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+         break;
+     case 1:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 destval,imm;
++            u32 destval, imm;
+ 
+             DECODE_PRINTF("DWORD PTR ");
+             destoffset = decode_rm01_address(rl);
+@@ -5738,8 +6051,9 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             destval = (*opc83_long_operation[rh]) (destval, imm);
+             if (rh != 7)
+                 store_data_long(destoffset, destval);
+-        } else {
+-            u16 destval,imm;
++        }
++        else {
++            u16 destval, imm;
+ 
+             DECODE_PRINTF("WORD PTR ");
+             destoffset = decode_rm01_address(rl);
+@@ -5754,7 +6068,7 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+         break;
+     case 2:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 destval,imm;
++            u32 destval, imm;
+ 
+             DECODE_PRINTF("DWORD PTR ");
+             destoffset = decode_rm10_address(rl);
+@@ -5765,8 +6079,9 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             destval = (*opc83_long_operation[rh]) (destval, imm);
+             if (rh != 7)
+                 store_data_long(destoffset, destval);
+-        } else {
+-            u16 destval,imm;
++        }
++        else {
++            u16 destval, imm;
+ 
+             DECODE_PRINTF("WORD PTR ");
+             destoffset = decode_rm10_address(rl);
+@@ -5779,10 +6094,10 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+                 store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+-            u32 destval,imm;
++            u32 destval, imm;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             imm = (s8) fetch_byte_imm();
+@@ -5791,9 +6106,10 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             destval = (*opc83_long_operation[rh]) (*destreg, imm);
+             if (rh != 7)
+                 *destreg = destval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+-            u16 destval,imm;
++            u16 destval, imm;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             imm = (s8) fetch_byte_imm();
+@@ -5813,7 +6129,8 @@ static void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x84
+ ****************************************************************************/
+-static void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -5851,7 +6168,7 @@ static void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         test_byte(destval, *srcreg);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -5868,7 +6185,8 @@ static void x86emuOp_test_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x85
+ ****************************************************************************/
+-static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -5889,7 +6207,8 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             test_long(destval, *srcreg);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -5914,7 +6233,8 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             test_long(destval, *srcreg);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -5939,7 +6259,8 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             test_long(destval, *srcreg);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *srcreg;
+ 
+@@ -5952,9 +6273,9 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+             test_word(destval, *srcreg);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -5962,8 +6283,9 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             test_long(*destreg, *srcreg);
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -5982,7 +6304,8 @@ static void x86emuOp_test_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x86
+ ****************************************************************************/
+-static void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -6030,7 +6353,7 @@ static void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         destval = tmp;
+         store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -6049,7 +6372,8 @@ static void x86emuOp_xchg_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x87
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -6061,7 +6385,7 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+     case 0:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *srcreg;
+-            u32 destval,tmp;
++            u32 destval, tmp;
+ 
+             destoffset = decode_rm00_address(rl);
+             DECODE_PRINTF(",");
+@@ -6073,9 +6397,10 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+             *srcreg = destval;
+             destval = tmp;
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 *srcreg;
+-            u16 destval,tmp;
++            u16 destval, tmp;
+ 
+             destoffset = decode_rm00_address(rl);
+             DECODE_PRINTF(",");
+@@ -6092,7 +6417,7 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+     case 1:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *srcreg;
+-            u32 destval,tmp;
++            u32 destval, tmp;
+ 
+             destoffset = decode_rm01_address(rl);
+             DECODE_PRINTF(",");
+@@ -6104,9 +6429,10 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+             *srcreg = destval;
+             destval = tmp;
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 *srcreg;
+-            u16 destval,tmp;
++            u16 destval, tmp;
+ 
+             destoffset = decode_rm01_address(rl);
+             DECODE_PRINTF(",");
+@@ -6123,7 +6449,7 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+     case 2:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *srcreg;
+-            u32 destval,tmp;
++            u32 destval, tmp;
+ 
+             destoffset = decode_rm10_address(rl);
+             DECODE_PRINTF(",");
+@@ -6135,9 +6461,10 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+             *srcreg = destval;
+             destval = tmp;
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 *srcreg;
+-            u16 destval,tmp;
++            u16 destval, tmp;
+ 
+             destoffset = decode_rm10_address(rl);
+             DECODE_PRINTF(",");
+@@ -6151,9 +6478,9 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+             u32 tmp;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+@@ -6164,8 +6491,9 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+             tmp = *srcreg;
+             *srcreg = *destreg;
+             *destreg = tmp;
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+             u16 tmp;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -6187,7 +6515,8 @@ static void x86emuOp_xchg_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x88
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -6221,7 +6550,7 @@ static void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         store_data_byte(destoffset, *srcreg);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rh);
+@@ -6238,7 +6567,8 @@ static void x86emuOp_mov_byte_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x89
+ ****************************************************************************/
+-static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u32 destoffset;
+@@ -6257,7 +6587,8 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             store_data_long(destoffset, *srcreg);
+-        } else {
++        }
++        else {
+             u16 *srcreg;
+ 
+             destoffset = decode_rm00_address(rl);
+@@ -6278,7 +6609,8 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             store_data_long(destoffset, *srcreg);
+-        } else {
++        }
++        else {
+             u16 *srcreg;
+ 
+             destoffset = decode_rm01_address(rl);
+@@ -6299,7 +6631,8 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             store_data_long(destoffset, *srcreg);
+-        } else {
++        }
++        else {
+             u16 *srcreg;
+ 
+             destoffset = decode_rm10_address(rl);
+@@ -6310,9 +6643,9 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, *srcreg);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
++            u32 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -6320,8 +6653,9 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = *srcreg;
+-        } else {
+-            u16 *destreg,*srcreg;
++        }
++        else {
++            u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -6340,7 +6674,8 @@ static void x86emuOp_mov_word_RM_R(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8a
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg, *srcreg;
+@@ -6378,7 +6713,7 @@ static void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         *destreg = srcval;
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_BYTE_REGISTER(rl);
+@@ -6395,7 +6730,8 @@ static void x86emuOp_mov_byte_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8b
+ ****************************************************************************/
+-static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -6416,7 +6752,8 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -6441,7 +6778,8 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -6466,7 +6804,8 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -6479,7 +6818,7 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+             *destreg = srcval;
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg, *srcreg;
+ 
+@@ -6489,7 +6828,8 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = *srcreg;
+-        } else {
++        }
++        else {
+             u16 *destreg, *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+@@ -6509,7 +6849,8 @@ static void x86emuOp_mov_word_R_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8c
+ ****************************************************************************/
+-static void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u16 *destreg, *srcreg;
+@@ -6547,7 +6888,7 @@ static void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
+         destval = *srcreg;
+         store_data_word(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_WORD_REGISTER(rl);
+         DECODE_PRINTF(",");
+         srcreg = decode_rm_seg_register(rh);
+@@ -6564,47 +6905,77 @@ static void x86emuOp_mov_word_RM_SR(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8d
+ ****************************************************************************/
+-static void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+-    u16 *srcreg;
+     uint destoffset;
+ 
+-/*
+- * TODO: Need to handle address size prefix!
+- *
+- * lea  eax,[eax+ebx*2] ??
+- */
+-    
+     START_OF_INSTR();
+     DECODE_PRINTF("LEA\t");
+     FETCH_DECODE_MODRM(mod, rh, rl);
+     switch (mod) {
+     case 0:
+-        srcreg = DECODE_RM_WORD_REGISTER(rh);
+-        DECODE_PRINTF(",");
+-        destoffset = decode_rm00_address(rl);
+-        DECODE_PRINTF("\n");
+-        TRACE_AND_STEP();
+-        *srcreg = (u16)destoffset;
++        if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
++            u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
++
++            DECODE_PRINTF(",");
++            destoffset = decode_rm00_address(rl);
++            DECODE_PRINTF("\n");
++            TRACE_AND_STEP();
++            *srcreg = (u32) destoffset;
++        }
++        else {
++            u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
++
++            DECODE_PRINTF(",");
++            destoffset = decode_rm00_address(rl);
++            DECODE_PRINTF("\n");
++            TRACE_AND_STEP();
++            *srcreg = (u16) destoffset;
++        }
+         break;
+     case 1:
+-        srcreg = DECODE_RM_WORD_REGISTER(rh);
+-        DECODE_PRINTF(",");
+-        destoffset = decode_rm01_address(rl);
+-        DECODE_PRINTF("\n");
+-        TRACE_AND_STEP();
+-        *srcreg = (u16)destoffset;
++        if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
++            u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
++
++            DECODE_PRINTF(",");
++            destoffset = decode_rm01_address(rl);
++            DECODE_PRINTF("\n");
++            TRACE_AND_STEP();
++            *srcreg = (u32) destoffset;
++        }
++        else {
++            u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
++
++            DECODE_PRINTF(",");
++            destoffset = decode_rm01_address(rl);
++            DECODE_PRINTF("\n");
++            TRACE_AND_STEP();
++            *srcreg = (u16) destoffset;
++        }
+         break;
+     case 2:
+-        srcreg = DECODE_RM_WORD_REGISTER(rh);
+-        DECODE_PRINTF(",");
+-        destoffset = decode_rm10_address(rl);
+-        DECODE_PRINTF("\n");
+-        TRACE_AND_STEP();
+-        *srcreg = (u16)destoffset;
++        if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
++            u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
++
++            DECODE_PRINTF(",");
++            destoffset = decode_rm10_address(rl);
++            DECODE_PRINTF("\n");
++            TRACE_AND_STEP();
++            *srcreg = (u32) destoffset;
++        }
++        else {
++            u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
++
++            DECODE_PRINTF(",");
++            destoffset = decode_rm10_address(rl);
++            DECODE_PRINTF("\n");
++            TRACE_AND_STEP();
++            *srcreg = (u16) destoffset;
++        }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         /* undefined.  Do nothing. */
+         break;
+     }
+@@ -6616,7 +6987,8 @@ static void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8e
+ ****************************************************************************/
+-static void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u16 *destreg, *srcreg;
+@@ -6654,7 +7026,7 @@ static void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         *destreg = srcval;
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = decode_rm_seg_register(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -6677,7 +7049,8 @@ static void x86emuOp_mov_word_SR_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x8f
+ ****************************************************************************/
+-static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -6699,7 +7072,8 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = pop_long();
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             destoffset = decode_rm00_address(rl);
+@@ -6718,7 +7092,8 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = pop_long();
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             destoffset = decode_rm01_address(rl);
+@@ -6737,7 +7112,8 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = pop_long();
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             destoffset = decode_rm10_address(rl);
+@@ -6747,7 +7123,7 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+ 
+@@ -6755,7 +7131,8 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = pop_long();
+-        } else {
++        }
++        else {
+             u16 *destreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -6773,7 +7150,8 @@ static void x86emuOp_pop_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x90
+ ****************************************************************************/
+-static void x86emuOp_nop(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_nop(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("NOP\n");
+@@ -6786,14 +7164,16 @@ static void x86emuOp_nop(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x91
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
+ {
+     u32 tmp;
+ 
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("XCHG\tEAX,ECX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("XCHG\tAX,CX\n");
+     }
+     TRACE_AND_STEP();
+@@ -6801,10 +7181,11 @@ static void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
+         tmp = M.x86.R_EAX;
+         M.x86.R_EAX = M.x86.R_ECX;
+         M.x86.R_ECX = tmp;
+-    } else {
++    }
++    else {
+         tmp = M.x86.R_AX;
+         M.x86.R_AX = M.x86.R_CX;
+-        M.x86.R_CX = (u16)tmp;
++        M.x86.R_CX = (u16) tmp;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -6814,14 +7195,16 @@ static void x86emuOp_xchg_word_AX_CX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x92
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
+ {
+     u32 tmp;
+ 
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("XCHG\tEAX,EDX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("XCHG\tAX,DX\n");
+     }
+     TRACE_AND_STEP();
+@@ -6829,10 +7212,11 @@ static void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
+         tmp = M.x86.R_EAX;
+         M.x86.R_EAX = M.x86.R_EDX;
+         M.x86.R_EDX = tmp;
+-    } else {
++    }
++    else {
+         tmp = M.x86.R_AX;
+         M.x86.R_AX = M.x86.R_DX;
+-        M.x86.R_DX = (u16)tmp;
++        M.x86.R_DX = (u16) tmp;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -6842,14 +7226,16 @@ static void x86emuOp_xchg_word_AX_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x93
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
+ {
+     u32 tmp;
+ 
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("XCHG\tEAX,EBX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("XCHG\tAX,BX\n");
+     }
+     TRACE_AND_STEP();
+@@ -6857,10 +7243,11 @@ static void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
+         tmp = M.x86.R_EAX;
+         M.x86.R_EAX = M.x86.R_EBX;
+         M.x86.R_EBX = tmp;
+-    } else {
++    }
++    else {
+         tmp = M.x86.R_AX;
+         M.x86.R_AX = M.x86.R_BX;
+-        M.x86.R_BX = (u16)tmp;
++        M.x86.R_BX = (u16) tmp;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -6870,14 +7257,16 @@ static void x86emuOp_xchg_word_AX_BX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x94
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
+ {
+     u32 tmp;
+ 
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("XCHG\tEAX,ESP\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("XCHG\tAX,SP\n");
+     }
+     TRACE_AND_STEP();
+@@ -6885,10 +7274,11 @@ static void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
+         tmp = M.x86.R_EAX;
+         M.x86.R_EAX = M.x86.R_ESP;
+         M.x86.R_ESP = tmp;
+-    } else {
++    }
++    else {
+         tmp = M.x86.R_AX;
+         M.x86.R_AX = M.x86.R_SP;
+-        M.x86.R_SP = (u16)tmp;
++        M.x86.R_SP = (u16) tmp;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -6898,14 +7288,16 @@ static void x86emuOp_xchg_word_AX_SP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x95
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
+ {
+     u32 tmp;
+ 
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("XCHG\tEAX,EBP\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("XCHG\tAX,BP\n");
+     }
+     TRACE_AND_STEP();
+@@ -6913,10 +7305,11 @@ static void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
+         tmp = M.x86.R_EAX;
+         M.x86.R_EAX = M.x86.R_EBP;
+         M.x86.R_EBP = tmp;
+-    } else {
++    }
++    else {
+         tmp = M.x86.R_AX;
+         M.x86.R_AX = M.x86.R_BP;
+-        M.x86.R_BP = (u16)tmp;
++        M.x86.R_BP = (u16) tmp;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -6926,14 +7319,16 @@ static void x86emuOp_xchg_word_AX_BP(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x96
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
+ {
+     u32 tmp;
+ 
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("XCHG\tEAX,ESI\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("XCHG\tAX,SI\n");
+     }
+     TRACE_AND_STEP();
+@@ -6941,10 +7336,11 @@ static void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
+         tmp = M.x86.R_EAX;
+         M.x86.R_EAX = M.x86.R_ESI;
+         M.x86.R_ESI = tmp;
+-    } else {
++    }
++    else {
+         tmp = M.x86.R_AX;
+         M.x86.R_AX = M.x86.R_SI;
+-        M.x86.R_SI = (u16)tmp;
++        M.x86.R_SI = (u16) tmp;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -6954,14 +7350,16 @@ static void x86emuOp_xchg_word_AX_SI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x97
+ ****************************************************************************/
+-static void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
+ {
+     u32 tmp;
+ 
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("XCHG\tEAX,EDI\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("XCHG\tAX,DI\n");
+     }
+     TRACE_AND_STEP();
+@@ -6969,10 +7367,11 @@ static void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
+         tmp = M.x86.R_EAX;
+         M.x86.R_EAX = M.x86.R_EDI;
+         M.x86.R_EDI = tmp;
+-    } else {
++    }
++    else {
+         tmp = M.x86.R_AX;
+         M.x86.R_AX = M.x86.R_DI;
+-        M.x86.R_DI = (u16)tmp;
++        M.x86.R_DI = (u16) tmp;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -6982,25 +7381,30 @@ static void x86emuOp_xchg_word_AX_DI(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x98
+ ****************************************************************************/
+-static void x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("CWDE\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("CBW\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         if (M.x86.R_AX & 0x8000) {
+             M.x86.R_EAX |= 0xffff0000;
+-        } else {
++        }
++        else {
+             M.x86.R_EAX &= 0x0000ffff;
+         }
+-    } else {
++    }
++    else {
+         if (M.x86.R_AL & 0x80) {
+             M.x86.R_AH = 0xff;
+-        } else {
++        }
++        else {
+             M.x86.R_AH = 0x0;
+         }
+     }
+@@ -7012,12 +7416,14 @@ static void x86emuOp_cbw(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x99
+ ****************************************************************************/
+-static void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("CDQ\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("CWD\n");
+     }
+     DECODE_PRINTF("CWD\n");
+@@ -7025,13 +7431,16 @@ static void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         if (M.x86.R_EAX & 0x80000000) {
+             M.x86.R_EDX = 0xffffffff;
+-        } else {
++        }
++        else {
+             M.x86.R_EDX = 0x0;
+         }
+-    } else {
++    }
++    else {
+         if (M.x86.R_AX & 0x8000) {
+             M.x86.R_DX = 0xffff;
+-        } else {
++        }
++        else {
+             M.x86.R_DX = 0x0;
+         }
+     }
+@@ -7043,17 +7452,24 @@ static void x86emuOp_cwd(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9a
+ ****************************************************************************/
+-static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
+ {
+-    u16 farseg, faroff;
++    u32 farseg, faroff;
+ 
+     START_OF_INSTR();
+-	DECODE_PRINTF("CALL\t");
+-	faroff = fetch_word_imm();
+-	farseg = fetch_word_imm();
+-	DECODE_PRINTF2("%04x:", farseg);
+-	DECODE_PRINTF2("%04x\n", faroff);
+-	CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
++    DECODE_PRINTF("CALL\t");
++    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++        faroff = fetch_long_imm();
++        farseg = fetch_word_imm();
++    }
++    else {
++        faroff = fetch_word_imm();
++        farseg = fetch_word_imm();
++    }
++    DECODE_PRINTF2("%04x:", farseg);
++    DECODE_PRINTF2("%04x\n", faroff);
++    CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, farseg, faroff, "FAR ");
+ 
+     /* XXX
+      * 
+@@ -7064,8 +7480,13 @@ static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     push_word(M.x86.R_CS);
+     M.x86.R_CS = farseg;
+-    push_word(M.x86.R_IP);
+-    M.x86.R_IP = faroff;
++    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++        push_long(M.x86.R_EIP);
++    }
++    else {
++        push_word(M.x86.R_IP);
++    }
++    M.x86.R_EIP = faroff & 0xffff;
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+@@ -7074,7 +7495,8 @@ static void x86emuOp_call_far_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9b
+ ****************************************************************************/
+-static void x86emuOp_wait(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_wait(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("WAIT");
+@@ -7088,14 +7510,16 @@ static void x86emuOp_wait(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9c
+ ****************************************************************************/
+-static void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
+ {
+     u32 flags;
+ 
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("PUSHFD\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("PUSHF\n");
+     }
+     TRACE_AND_STEP();
+@@ -7104,8 +7528,9 @@ static void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
+     flags = (M.x86.R_EFLG & F_MSK) | F_ALWAYS_ON;
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         push_long(flags);
+-    } else {
+-        push_word((u16)flags);
++    }
++    else {
++        push_word((u16) flags);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -7115,18 +7540,21 @@ static void x86emuOp_pushf_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9d
+ ****************************************************************************/
+-static void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("POPFD\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("POPF\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EFLG = pop_long();
+-    } else {
++    }
++    else {
+         M.x86.R_FLG = pop_word();
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -7137,7 +7565,8 @@ static void x86emuOp_popf_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9e
+ ****************************************************************************/
+-static void x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("SAHF\n");
+@@ -7154,12 +7583,13 @@ static void x86emuOp_sahf(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0x9f
+ ****************************************************************************/
+-static void x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("LAHF\n");
+     TRACE_AND_STEP();
+-	M.x86.R_AH = (u8)(M.x86.R_FLG & 0xff);
++    M.x86.R_AH = (u8) (M.x86.R_FLG & 0xff);
+     /*undocumented TC++ behavior??? Nope.  It's documented, but
+        you have too look real hard to notice it. */
+     M.x86.R_AH |= 0x2;
+@@ -7171,7 +7601,8 @@ static void x86emuOp_lahf(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa0
+ ****************************************************************************/
+-static void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u16 offset;
+ 
+@@ -7189,7 +7620,8 @@ static void x86emuOp_mov_AL_M_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa1
+ ****************************************************************************/
+-static void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u16 offset;
+ 
+@@ -7197,13 +7629,15 @@ static void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
+     offset = fetch_word_imm();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF2("MOV\tEAX,[%04x]\n", offset);
+-    } else {
++    }
++    else {
+         DECODE_PRINTF2("MOV\tAX,[%04x]\n", offset);
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = fetch_data_long(offset);
+-    } else {
++    }
++    else {
+         M.x86.R_AX = fetch_data_word(offset);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -7214,7 +7648,8 @@ static void x86emuOp_mov_AX_M_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa2
+ ****************************************************************************/
+-static void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u16 offset;
+ 
+@@ -7232,7 +7667,8 @@ static void x86emuOp_mov_M_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa3
+ ****************************************************************************/
+-static void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u16 offset;
+ 
+@@ -7240,13 +7676,15 @@ static void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
+     offset = fetch_word_imm();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF2("MOV\t[%04x],EAX\n", offset);
+-    } else {
++    }
++    else {
+         DECODE_PRINTF2("MOV\t[%04x],AX\n", offset);
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         store_data_long(offset, M.x86.R_EAX);
+-    } else {
++    }
++    else {
+         store_data_word(offset, M.x86.R_AX);
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -7257,15 +7695,16 @@ static void x86emuOp_mov_M_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa4
+ ****************************************************************************/
+-static void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
+ {
+-    u8  val;
++    u8 val;
+     u32 count;
+     int inc;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("MOVS\tBYTE\n");
+-    if (ACCESS_FLAG(F_DF))   /* down */
++    if (ACCESS_FLAG(F_DF))      /* down */
+         inc = -1;
+     else
+         inc = 1;
+@@ -7292,7 +7731,8 @@ static void x86emuOp_movs_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa5
+ ****************************************************************************/
+-static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+ {
+     u32 val;
+     int inc;
+@@ -7301,13 +7741,14 @@ static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("MOVS\tDWORD\n");
+-        if (ACCESS_FLAG(F_DF))      /* down */
++        if (ACCESS_FLAG(F_DF))  /* down */
+             inc = -4;
+         else
+             inc = 4;
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("MOVS\tWORD\n");
+-        if (ACCESS_FLAG(F_DF))      /* down */
++        if (ACCESS_FLAG(F_DF))  /* down */
+             inc = -2;
+         else
+             inc = 2;
+@@ -7325,9 +7766,10 @@ static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             val = fetch_data_long(M.x86.R_SI);
+             store_data_long_abs(M.x86.R_ES, M.x86.R_DI, val);
+-        } else {
++        }
++        else {
+             val = fetch_data_word(M.x86.R_SI);
+-            store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16)val);
++            store_data_word_abs(M.x86.R_ES, M.x86.R_DI, (u16) val);
+         }
+         M.x86.R_SI += inc;
+         M.x86.R_DI += inc;
+@@ -7340,7 +7782,8 @@ static void x86emuOp_movs_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa6
+ ****************************************************************************/
+-static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+ {
+     s8 val1, val2;
+     int inc;
+@@ -7348,7 +7791,7 @@ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+     START_OF_INSTR();
+     DECODE_PRINTF("CMPS\tBYTE\n");
+     TRACE_AND_STEP();
+-    if (ACCESS_FLAG(F_DF))   /* down */
++    if (ACCESS_FLAG(F_DF))      /* down */
+         inc = -1;
+     else
+         inc = 1;
+@@ -7359,7 +7802,7 @@ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+         while (M.x86.R_CX != 0) {
+             val1 = fetch_data_byte(M.x86.R_SI);
+             val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+-                     cmp_byte(val1, val2);
++            cmp_byte(val1, val2);
+             M.x86.R_CX -= 1;
+             M.x86.R_SI += inc;
+             M.x86.R_DI += inc;
+@@ -7367,7 +7810,8 @@ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+                 break;
+         }
+         M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+-    } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
++    }
++    else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+         /* REPNE  */
+         /* move them until CX is ZERO. */
+         while (M.x86.R_CX != 0) {
+@@ -7381,7 +7825,8 @@ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+                 break;          /* zero flag set means equal */
+         }
+         M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+-    } else {
++    }
++    else {
+         val1 = fetch_data_byte(M.x86.R_SI);
+         val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+         cmp_byte(val1, val2);
+@@ -7396,21 +7841,23 @@ static void x86emuOp_cmps_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa7
+ ****************************************************************************/
+-static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+ {
+-    u32 val1,val2;
++    u32 val1, val2;
+     int inc;
+ 
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("CMPS\tDWORD\n");
+-        if (ACCESS_FLAG(F_DF))   /* down */
++        if (ACCESS_FLAG(F_DF))  /* down */
+             inc = -4;
+         else
+             inc = 4;
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("CMPS\tWORD\n");
+-        if (ACCESS_FLAG(F_DF))   /* down */
++        if (ACCESS_FLAG(F_DF))  /* down */
+             inc = -2;
+         else
+             inc = 2;
+@@ -7424,10 +7871,11 @@ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+                 val1 = fetch_data_long(M.x86.R_SI);
+                 val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+                 cmp_long(val1, val2);
+-            } else {
++            }
++            else {
+                 val1 = fetch_data_word(M.x86.R_SI);
+                 val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+-                cmp_word((u16)val1, (u16)val2);
++                cmp_word((u16) val1, (u16) val2);
+             }
+             M.x86.R_CX -= 1;
+             M.x86.R_SI += inc;
+@@ -7436,7 +7884,8 @@ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+                 break;
+         }
+         M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+-    } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
++    }
++    else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+         /* REPNE  */
+         /* move them until CX is ZERO. */
+         while (M.x86.R_CX != 0) {
+@@ -7444,10 +7893,11 @@ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+                 val1 = fetch_data_long(M.x86.R_SI);
+                 val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+                 cmp_long(val1, val2);
+-            } else {
++            }
++            else {
+                 val1 = fetch_data_word(M.x86.R_SI);
+                 val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+-                cmp_word((u16)val1, (u16)val2);
++                cmp_word((u16) val1, (u16) val2);
+             }
+             M.x86.R_CX -= 1;
+             M.x86.R_SI += inc;
+@@ -7456,15 +7906,17 @@ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+                 break;          /* zero flag set means equal */
+         }
+         M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+-    } else {
++    }
++    else {
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             val1 = fetch_data_long(M.x86.R_SI);
+             val2 = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+             cmp_long(val1, val2);
+-        } else {
++        }
++        else {
+             val1 = fetch_data_word(M.x86.R_SI);
+             val2 = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+-            cmp_word((u16)val1, (u16)val2);
++            cmp_word((u16) val1, (u16) val2);
+         }
+         M.x86.R_SI += inc;
+         M.x86.R_DI += inc;
+@@ -7477,7 +7929,8 @@ static void x86emuOp_cmps_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa8
+ ****************************************************************************/
+-static void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int imm;
+ 
+@@ -7486,7 +7939,7 @@ static void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
+     imm = fetch_byte_imm();
+     DECODE_PRINTF2("%04x\n", imm);
+     TRACE_AND_STEP();
+-	test_byte(M.x86.R_AL, (u8)imm);
++    test_byte(M.x86.R_AL, (u8) imm);
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+@@ -7495,7 +7948,8 @@ static void x86emuOp_test_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xa9
+ ****************************************************************************/
+-static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -7503,7 +7957,8 @@ static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("TEST\tEAX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("TEST\tAX,");
+         srcval = fetch_word_imm();
+     }
+@@ -7511,8 +7966,9 @@ static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         test_long(M.x86.R_EAX, srcval);
+-    } else {
+-        test_word(M.x86.R_AX, (u16)srcval);
++    }
++    else {
++        test_word(M.x86.R_AX, (u16) srcval);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -7522,13 +7978,14 @@ static void x86emuOp_test_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xaa
+ ****************************************************************************/
+-static void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
+ {
+     int inc;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("STOS\tBYTE\n");
+-    if (ACCESS_FLAG(F_DF))   /* down */
++    if (ACCESS_FLAG(F_DF))      /* down */
+         inc = -1;
+     else
+         inc = 1;
+@@ -7542,7 +7999,8 @@ static void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
+             M.x86.R_DI += inc;
+         }
+         M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+-    } else {
++    }
++    else {
+         store_data_byte_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AL);
+         M.x86.R_DI += inc;
+     }
+@@ -7554,7 +8012,8 @@ static void x86emuOp_stos_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xab
+ ****************************************************************************/
+-static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+ {
+     int inc;
+     u32 count;
+@@ -7562,13 +8021,14 @@ static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("STOS\tDWORD\n");
+-        if (ACCESS_FLAG(F_DF))   /* down */
++        if (ACCESS_FLAG(F_DF))  /* down */
+             inc = -4;
+         else
+             inc = 4;
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("STOS\tWORD\n");
+-        if (ACCESS_FLAG(F_DF))   /* down */
++        if (ACCESS_FLAG(F_DF))  /* down */
+             inc = -2;
+         else
+             inc = 2;
+@@ -7585,7 +8045,8 @@ static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+     while (count--) {
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             store_data_long_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_EAX);
+-        } else {
++        }
++        else {
+             store_data_word_abs(M.x86.R_ES, M.x86.R_DI, M.x86.R_AX);
+         }
+         M.x86.R_DI += inc;
+@@ -7598,14 +8059,15 @@ static void x86emuOp_stos_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xac
+ ****************************************************************************/
+-static void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
+ {
+     int inc;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("LODS\tBYTE\n");
+     TRACE_AND_STEP();
+-    if (ACCESS_FLAG(F_DF))   /* down */
++    if (ACCESS_FLAG(F_DF))      /* down */
+         inc = -1;
+     else
+         inc = 1;
+@@ -7618,7 +8080,8 @@ static void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
+             M.x86.R_SI += inc;
+         }
+         M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+-    } else {
++    }
++    else {
+         M.x86.R_AL = fetch_data_byte(M.x86.R_SI);
+         M.x86.R_SI += inc;
+     }
+@@ -7630,7 +8093,8 @@ static void x86emuOp_lods_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xad
+ ****************************************************************************/
+-static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+ {
+     int inc;
+     u32 count;
+@@ -7638,13 +8102,14 @@ static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("LODS\tDWORD\n");
+-        if (ACCESS_FLAG(F_DF))   /* down */
++        if (ACCESS_FLAG(F_DF))  /* down */
+             inc = -4;
+         else
+             inc = 4;
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("LODS\tWORD\n");
+-        if (ACCESS_FLAG(F_DF))   /* down */
++        if (ACCESS_FLAG(F_DF))  /* down */
+             inc = -2;
+         else
+             inc = 2;
+@@ -7661,7 +8126,8 @@ static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+     while (count--) {
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             M.x86.R_EAX = fetch_data_long(M.x86.R_SI);
+-        } else {
++        }
++        else {
+             M.x86.R_AX = fetch_data_word(M.x86.R_SI);
+         }
+         M.x86.R_SI += inc;
+@@ -7674,7 +8140,8 @@ static void x86emuOp_lods_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xae
+ ****************************************************************************/
+-static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+ {
+     s8 val2;
+     int inc;
+@@ -7682,7 +8149,7 @@ static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+     START_OF_INSTR();
+     DECODE_PRINTF("SCAS\tBYTE\n");
+     TRACE_AND_STEP();
+-    if (ACCESS_FLAG(F_DF))   /* down */
++    if (ACCESS_FLAG(F_DF))      /* down */
+         inc = -1;
+     else
+         inc = 1;
+@@ -7698,7 +8165,8 @@ static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+                 break;
+         }
+         M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+-    } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
++    }
++    else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+         /* REPNE  */
+         /* move them until CX is ZERO. */
+         while (M.x86.R_CX != 0) {
+@@ -7710,7 +8178,8 @@ static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+                 break;          /* zero flag set means equal */
+         }
+         M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+-    } else {
++    }
++    else {
+         val2 = fetch_data_byte_abs(M.x86.R_ES, M.x86.R_DI);
+         cmp_byte(M.x86.R_AL, val2);
+         M.x86.R_DI += inc;
+@@ -7723,7 +8192,8 @@ static void x86emuOp_scas_byte(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xaf
+ ****************************************************************************/
+-static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+ {
+     int inc;
+     u32 val;
+@@ -7731,13 +8201,14 @@ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("SCAS\tDWORD\n");
+-        if (ACCESS_FLAG(F_DF))   /* down */
++        if (ACCESS_FLAG(F_DF))  /* down */
+             inc = -4;
+         else
+             inc = 4;
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("SCAS\tWORD\n");
+-        if (ACCESS_FLAG(F_DF))   /* down */
++        if (ACCESS_FLAG(F_DF))  /* down */
+             inc = -2;
+         else
+             inc = 2;
+@@ -7750,9 +8221,10 @@ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                 val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+                 cmp_long(M.x86.R_EAX, val);
+-            } else {
++            }
++            else {
+                 val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+-                cmp_word(M.x86.R_AX, (u16)val);
++                cmp_word(M.x86.R_AX, (u16) val);
+             }
+             M.x86.R_CX -= 1;
+             M.x86.R_DI += inc;
+@@ -7760,16 +8232,18 @@ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+                 break;
+         }
+         M.x86.mode &= ~SYSMODE_PREFIX_REPE;
+-    } else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
++    }
++    else if (M.x86.mode & SYSMODE_PREFIX_REPNE) {
+         /* REPNE  */
+         /* move them until CX is ZERO. */
+         while (M.x86.R_CX != 0) {
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                 val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+                 cmp_long(M.x86.R_EAX, val);
+-            } else {
++            }
++            else {
+                 val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+-                cmp_word(M.x86.R_AX, (u16)val);
++                cmp_word(M.x86.R_AX, (u16) val);
+             }
+             M.x86.R_CX -= 1;
+             M.x86.R_DI += inc;
+@@ -7777,13 +8251,15 @@ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+                 break;          /* zero flag set means equal */
+         }
+         M.x86.mode &= ~SYSMODE_PREFIX_REPNE;
+-    } else {
++    }
++    else {
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             val = fetch_data_long_abs(M.x86.R_ES, M.x86.R_DI);
+             cmp_long(M.x86.R_EAX, val);
+-        } else {
++        }
++        else {
+             val = fetch_data_word_abs(M.x86.R_ES, M.x86.R_DI);
+-            cmp_word(M.x86.R_AX, (u16)val);
++            cmp_word(M.x86.R_AX, (u16) val);
+         }
+         M.x86.R_DI += inc;
+     }
+@@ -7795,7 +8271,8 @@ static void x86emuOp_scas_word(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb0
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 imm;
+ 
+@@ -7813,7 +8290,8 @@ static void x86emuOp_mov_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb1
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 imm;
+ 
+@@ -7831,7 +8309,8 @@ static void x86emuOp_mov_byte_CL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb2
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 imm;
+ 
+@@ -7849,7 +8328,8 @@ static void x86emuOp_mov_byte_DL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb3
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 imm;
+ 
+@@ -7867,7 +8347,8 @@ static void x86emuOp_mov_byte_BL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb4
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 imm;
+ 
+@@ -7885,7 +8366,8 @@ static void x86emuOp_mov_byte_AH_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb5
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 imm;
+ 
+@@ -7903,7 +8385,8 @@ static void x86emuOp_mov_byte_CH_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb6
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 imm;
+ 
+@@ -7921,7 +8404,8 @@ static void x86emuOp_mov_byte_DH_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb7
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 imm;
+ 
+@@ -7939,7 +8423,8 @@ static void x86emuOp_mov_byte_BH_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb8
+ ****************************************************************************/
+-static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -7947,7 +8432,8 @@ static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("MOV\tEAX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("MOV\tAX,");
+         srcval = fetch_word_imm();
+     }
+@@ -7955,8 +8441,9 @@ static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EAX = srcval;
+-    } else {
+-        M.x86.R_AX = (u16)srcval;
++    }
++    else {
++        M.x86.R_AX = (u16) srcval;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -7966,7 +8453,8 @@ static void x86emuOp_mov_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xb9
+ ****************************************************************************/
+-static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -7974,7 +8462,8 @@ static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("MOV\tECX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("MOV\tCX,");
+         srcval = fetch_word_imm();
+     }
+@@ -7982,8 +8471,9 @@ static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ECX = srcval;
+-    } else {
+-        M.x86.R_CX = (u16)srcval;
++    }
++    else {
++        M.x86.R_CX = (u16) srcval;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -7993,7 +8483,8 @@ static void x86emuOp_mov_word_CX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xba
+ ****************************************************************************/
+-static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -8001,7 +8492,8 @@ static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("MOV\tEDX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("MOV\tDX,");
+         srcval = fetch_word_imm();
+     }
+@@ -8009,8 +8501,9 @@ static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EDX = srcval;
+-    } else {
+-        M.x86.R_DX = (u16)srcval;
++    }
++    else {
++        M.x86.R_DX = (u16) srcval;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -8020,7 +8513,8 @@ static void x86emuOp_mov_word_DX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xbb
+ ****************************************************************************/
+-static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -8028,7 +8522,8 @@ static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("MOV\tEBX,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("MOV\tBX,");
+         srcval = fetch_word_imm();
+     }
+@@ -8036,8 +8531,9 @@ static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EBX = srcval;
+-    } else {
+-        M.x86.R_BX = (u16)srcval;
++    }
++    else {
++        M.x86.R_BX = (u16) srcval;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -8047,7 +8543,8 @@ static void x86emuOp_mov_word_BX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xbc
+ ****************************************************************************/
+-static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -8055,7 +8552,8 @@ static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("MOV\tESP,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("MOV\tSP,");
+         srcval = fetch_word_imm();
+     }
+@@ -8063,8 +8561,9 @@ static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ESP = srcval;
+-    } else {
+-        M.x86.R_SP = (u16)srcval;
++    }
++    else {
++        M.x86.R_SP = (u16) srcval;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -8074,7 +8573,8 @@ static void x86emuOp_mov_word_SP_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xbd
+ ****************************************************************************/
+-static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -8082,7 +8582,8 @@ static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("MOV\tEBP,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("MOV\tBP,");
+         srcval = fetch_word_imm();
+     }
+@@ -8090,8 +8591,9 @@ static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EBP = srcval;
+-    } else {
+-        M.x86.R_BP = (u16)srcval;
++    }
++    else {
++        M.x86.R_BP = (u16) srcval;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -8101,7 +8603,8 @@ static void x86emuOp_mov_word_BP_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xbe
+ ****************************************************************************/
+-static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -8109,7 +8612,8 @@ static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("MOV\tESI,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("MOV\tSI,");
+         srcval = fetch_word_imm();
+     }
+@@ -8117,8 +8621,9 @@ static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_ESI = srcval;
+-    } else {
+-        M.x86.R_SI = (u16)srcval;
++    }
++    else {
++        M.x86.R_SI = (u16) srcval;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -8128,7 +8633,8 @@ static void x86emuOp_mov_word_SI_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xbf
+ ****************************************************************************/
+-static void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u32 srcval;
+ 
+@@ -8136,7 +8642,8 @@ static void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("MOV\tEDI,");
+         srcval = fetch_long_imm();
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("MOV\tDI,");
+         srcval = fetch_word_imm();
+     }
+@@ -8144,31 +8651,25 @@ static void x86emuOp_mov_word_DI_IMM(u8 X86EMU_UNUSED(op1))
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         M.x86.R_EDI = srcval;
+-    } else {
+-        M.x86.R_DI = (u16)srcval;
++    }
++    else {
++        M.x86.R_DI = (u16) srcval;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+ 
+ /* used by opcodes c0, d0, and d2. */
+-static u8(*opcD0_byte_operation[])(u8 d, u8 s) =
+-{
+-    rol_byte,
+-    ror_byte,
+-    rcl_byte,
+-    rcr_byte,
+-    shl_byte,
+-    shr_byte,
+-    shl_byte,           /* sal_byte === shl_byte  by definition */
+-    sar_byte,
+-};
++static u8(*opcD0_byte_operation[]) (u8 d, u8 s) = {
++    rol_byte, ror_byte, rcl_byte, rcr_byte, shl_byte, shr_byte, shl_byte,       /* sal_byte === shl_byte  by definition */
++sar_byte,};
+ 
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0xc0
+ ****************************************************************************/
+-static void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg;
+@@ -8251,7 +8752,7 @@ static void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
+         destval = (*opcD0_byte_operation[rh]) (destval, amt);
+         store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         amt = fetch_byte_imm();
+         DECODE_PRINTF2(",%x\n", amt);
+@@ -8265,36 +8766,21 @@ static void x86emuOp_opcC0_byte_RM_MEM(u8 X86EMU_UNUSED(op1))
+ }
+ 
+ /* used by opcodes c1, d1, and d3. */
+-static u16(*opcD1_word_operation[])(u16 s, u8 d) =
+-{
+-    rol_word,
+-    ror_word,
+-    rcl_word,
+-    rcr_word,
+-    shl_word,
+-    shr_word,
+-    shl_word,           /* sal_byte === shl_byte  by definition */
+-    sar_word,
+-};
++static u16(*opcD1_word_operation[]) (u16 s, u8 d) = {
++    rol_word, ror_word, rcl_word, rcr_word, shl_word, shr_word, shl_word,       /* sal_byte === shl_byte  by definition */
++sar_word,};
+ 
+ /* used by opcodes c1, d1, and d3. */
+-static u32 (*opcD1_long_operation[])(u32 s, u8 d) =
+-{
+-    rol_long,
+-    ror_long,
+-    rcl_long,
+-    rcr_long,
+-    shl_long,
+-    shr_long,
+-    shl_long,           /* sal_byte === shl_byte  by definition */
+-    sar_long,
+-};
++static u32(*opcD1_long_operation[]) (u32 s, u8 d) = {
++    rol_long, ror_long, rcl_long, rcr_long, shl_long, shr_long, shl_long,       /* sal_byte === shl_byte  by definition */
++sar_long,};
+ 
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0xc1
+ ****************************************************************************/
+-static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -8357,7 +8843,8 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = (*opcD1_long_operation[rh]) (destval, amt);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -8382,7 +8869,8 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = (*opcD1_long_operation[rh]) (destval, amt);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -8407,7 +8895,8 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = (*opcD1_long_operation[rh]) (destval, amt);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -8420,7 +8909,7 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+ 
+@@ -8429,7 +8918,8 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF2(",%x\n", amt);
+             TRACE_AND_STEP();
+             *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -8448,7 +8938,8 @@ static void x86emuOp_opcC1_word_RM_MEM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc2
+ ****************************************************************************/
+-static void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u16 imm;
+ 
+@@ -8456,8 +8947,8 @@ static void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
+     DECODE_PRINTF("RET\t");
+     imm = fetch_word_imm();
+     DECODE_PRINTF2("%x\n", imm);
+-	RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
+-	TRACE_AND_STEP();
++    RETURN_TRACE("RET", M.x86.saved_cs, M.x86.saved_ip);
++    TRACE_AND_STEP();
+     M.x86.R_IP = pop_word();
+     M.x86.R_SP += imm;
+     DECODE_CLEAR_SEGOVR();
+@@ -8468,12 +8959,13 @@ static void x86emuOp_ret_near_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc3
+ ****************************************************************************/
+-static void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("RET\n");
+-	RETURN_TRACE("RET",M.x86.saved_cs,M.x86.saved_ip);
+-	TRACE_AND_STEP();
++    RETURN_TRACE("RET", M.x86.saved_cs, M.x86.saved_ip);
++    TRACE_AND_STEP();
+     M.x86.R_IP = pop_word();
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -8483,7 +8975,8 @@ static void x86emuOp_ret_near(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc4
+ ****************************************************************************/
+-static void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rh, rl;
+     u16 *dstreg;
+@@ -8520,7 +9013,7 @@ static void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
+         *dstreg = fetch_data_word(srcoffset);
+         M.x86.R_ES = fetch_data_word(srcoffset + 2);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         /* UNDEFINED! */
+         TRACE_AND_STEP();
+     }
+@@ -8532,7 +9025,8 @@ static void x86emuOp_les_R_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc5
+ ****************************************************************************/
+-static void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rh, rl;
+     u16 *dstreg;
+@@ -8569,7 +9063,7 @@ static void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
+         *dstreg = fetch_data_word(srcoffset);
+         M.x86.R_DS = fetch_data_word(srcoffset + 2);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         /* UNDEFINED! */
+         TRACE_AND_STEP();
+     }
+@@ -8581,7 +9075,8 @@ static void x86emuOp_lds_R_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc6
+ ****************************************************************************/
+-static void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg;
+@@ -8620,7 +9115,7 @@ static void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+         TRACE_AND_STEP();
+         store_data_byte(destoffset, imm);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         imm = fetch_byte_imm();
+         DECODE_PRINTF2(",%2x\n", imm);
+@@ -8636,7 +9131,8 @@ static void x86emuOp_mov_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc7
+ ****************************************************************************/
+-static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -8659,7 +9155,8 @@ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF2(",%x\n", imm);
+             TRACE_AND_STEP();
+             store_data_long(destoffset, imm);
+-        } else {
++        }
++        else {
+             u16 imm;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -8680,7 +9177,8 @@ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF2(",%x\n", imm);
+             TRACE_AND_STEP();
+             store_data_long(destoffset, imm);
+-        } else {
++        }
++        else {
+             u16 imm;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -8701,7 +9199,8 @@ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF2(",%x\n", imm);
+             TRACE_AND_STEP();
+             store_data_long(destoffset, imm);
+-        } else {
++        }
++        else {
+             u16 imm;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -8712,19 +9211,20 @@ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, imm);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-			u32 *destreg;
+-			u32 imm;
++            u32 *destreg;
++            u32 imm;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             imm = fetch_long_imm();
+             DECODE_PRINTF2(",%x\n", imm);
+             TRACE_AND_STEP();
+             *destreg = imm;
+-        } else {
+-			u16 *destreg;
+-			u16 imm;
++        }
++        else {
++            u16 *destreg;
++            u16 imm;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             imm = fetch_word_imm();
+@@ -8742,10 +9242,11 @@ static void x86emuOp_mov_word_RM_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc8
+ ****************************************************************************/
+-static void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_enter(u8 X86EMU_UNUSED(op1))
+ {
+-    u16 local,frame_pointer;
+-    u8  nesting;
++    u16 local, frame_pointer;
++    u8 nesting;
+     int i;
+ 
+     START_OF_INSTR();
+@@ -8760,11 +9261,11 @@ static void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
+         for (i = 1; i < nesting; i++) {
+             M.x86.R_BP -= 2;
+             push_word(fetch_data_word_abs(M.x86.R_SS, M.x86.R_BP));
+-            }
+-        push_word(frame_pointer);
+         }
++        push_word(frame_pointer);
++    }
+     M.x86.R_BP = frame_pointer;
+-    M.x86.R_SP = (u16)(M.x86.R_SP - local);
++    M.x86.R_SP = (u16) (M.x86.R_SP - local);
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+@@ -8773,7 +9274,8 @@ static void x86emuOp_enter(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xc9
+ ****************************************************************************/
+-static void x86emuOp_leave(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_leave(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("LEAVE\n");
+@@ -8788,7 +9290,8 @@ static void x86emuOp_leave(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xca
+ ****************************************************************************/
+-static void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u16 imm;
+ 
+@@ -8796,8 +9299,8 @@ static void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
+     DECODE_PRINTF("RETF\t");
+     imm = fetch_word_imm();
+     DECODE_PRINTF2("%x\n", imm);
+-	RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
+-	TRACE_AND_STEP();
++    RETURN_TRACE("RETF", M.x86.saved_cs, M.x86.saved_ip);
++    TRACE_AND_STEP();
+     M.x86.R_IP = pop_word();
+     M.x86.R_CS = pop_word();
+     M.x86.R_SP += imm;
+@@ -8809,12 +9312,13 @@ static void x86emuOp_ret_far_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xcb
+ ****************************************************************************/
+-static void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("RETF\n");
+-	RETURN_TRACE("RETF",M.x86.saved_cs,M.x86.saved_ip);
+-	TRACE_AND_STEP();
++    RETURN_TRACE("RETF", M.x86.saved_cs, M.x86.saved_ip);
++    TRACE_AND_STEP();
+     M.x86.R_IP = pop_word();
+     M.x86.R_CS = pop_word();
+     DECODE_CLEAR_SEGOVR();
+@@ -8825,15 +9329,17 @@ static void x86emuOp_ret_far(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xcc
+ ****************************************************************************/
+-static void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_int3(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("INT 3\n");
+     TRACE_AND_STEP();
+     if (_X86EMU_intrTab[3]) {
+-	(*_X86EMU_intrTab[3])(3);
+-    } else {
+-        push_word((u16)M.x86.R_FLG);
++        (*_X86EMU_intrTab[3]) (3);
++    }
++    else {
++        push_word((u16) M.x86.R_FLG);
+         CLEAR_FLAG(F_IF);
+         CLEAR_FLAG(F_TF);
+         push_word(M.x86.R_CS);
+@@ -8849,7 +9355,8 @@ static void x86emuOp_int3(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xcd
+ ****************************************************************************/
+-static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 intnum;
+ 
+@@ -8859,9 +9366,10 @@ static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
+     DECODE_PRINTF2("%x\n", intnum);
+     TRACE_AND_STEP();
+     if (_X86EMU_intrTab[intnum]) {
+-	(*_X86EMU_intrTab[intnum])(intnum);
+-    } else {
+-        push_word((u16)M.x86.R_FLG);
++        (*_X86EMU_intrTab[intnum]) (intnum);
++    }
++    else {
++        push_word((u16) M.x86.R_FLG);
+         CLEAR_FLAG(F_IF);
+         CLEAR_FLAG(F_TF);
+         push_word(M.x86.R_CS);
+@@ -8877,16 +9385,18 @@ static void x86emuOp_int_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xce
+ ****************************************************************************/
+-static void x86emuOp_into(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_into(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("INTO\n");
+     TRACE_AND_STEP();
+     if (ACCESS_FLAG(F_OF)) {
+-	if (_X86EMU_intrTab[4]) {
+-	    (*_X86EMU_intrTab[4])(4);
+-        } else {
+-            push_word((u16)M.x86.R_FLG);
++        if (_X86EMU_intrTab[4]) {
++            (*_X86EMU_intrTab[4]) (4);
++        }
++        else {
++            push_word((u16) M.x86.R_FLG);
+             CLEAR_FLAG(F_IF);
+             CLEAR_FLAG(F_TF);
+             push_word(M.x86.R_CS);
+@@ -8903,7 +9413,8 @@ static void x86emuOp_into(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xcf
+ ****************************************************************************/
+-static void x86emuOp_iret(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_iret(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("IRET\n");
+@@ -8921,7 +9432,8 @@ static void x86emuOp_iret(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd0
+ ****************************************************************************/
+-static void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg;
+@@ -8999,7 +9511,7 @@ static void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
+         destval = (*opcD0_byte_operation[rh]) (destval, 1);
+         store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",1\n");
+         TRACE_AND_STEP();
+@@ -9015,7 +9527,8 @@ static void x86emuOp_opcD0_byte_RM_1(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd1
+ ****************************************************************************/
+-static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -9075,7 +9588,8 @@ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = (*opcD1_long_operation[rh]) (destval, 1);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -9098,7 +9612,8 @@ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = (*opcD1_long_operation[rh]) (destval, 1);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -9121,7 +9636,8 @@ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = (*opcD1_long_operation[rh]) (destval, 1);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             DECODE_PRINTF("BYTE PTR ");
+@@ -9133,19 +9649,20 @@ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-			u32 destval;
+-			u32 *destreg;
++            u32 destval;
++            u32 *destreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",1\n");
+             TRACE_AND_STEP();
+             destval = (*opcD1_long_operation[rh]) (*destreg, 1);
+             *destreg = destval;
+-        } else {
+-			u16 destval;
+-			u16 *destreg;
++        }
++        else {
++            u16 destval;
++            u16 *destreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",1\n");
+@@ -9163,7 +9680,8 @@ static void x86emuOp_opcD1_word_RM_1(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd2
+ ****************************************************************************/
+-static void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg;
+@@ -9243,7 +9761,7 @@ static void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
+         destval = (*opcD0_byte_operation[rh]) (destval, amt);
+         store_data_byte(destoffset, destval);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         DECODE_PRINTF(",CL\n");
+         TRACE_AND_STEP();
+@@ -9259,7 +9777,8 @@ static void x86emuOp_opcD2_byte_RM_CL(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd3
+ ****************************************************************************/
+-static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -9321,7 +9840,8 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = (*opcD1_long_operation[rh]) (destval, amt);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -9344,7 +9864,8 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = (*opcD1_long_operation[rh]) (destval, amt);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -9367,7 +9888,8 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+             TRACE_AND_STEP();
+             destval = (*opcD1_long_operation[rh]) (destval, amt);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+ 
+             DECODE_PRINTF("WORD PTR ");
+@@ -9379,7 +9901,7 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+ 
+@@ -9387,7 +9909,8 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             *destreg = (*opcD1_long_operation[rh]) (*destreg, amt);
+-        } else {
++        }
++        else {
+             u16 *destreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -9405,16 +9928,17 @@ static void x86emuOp_opcD3_word_RM_CL(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd4
+ ****************************************************************************/
+-static void x86emuOp_aam(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_aam(u8 X86EMU_UNUSED(op1))
+ {
+     u8 a;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("AAM\n");
+-    a = fetch_byte_imm();      /* this is a stupid encoding. */
++    a = fetch_byte_imm();       /* this is a stupid encoding. */
+     if (a != 10) {
+-	/* fix: add base decoding
+-	   aam_word(u8 val, int base a) */
++        /* fix: add base decoding
++           aam_word(u8 val, int base a) */
+         DECODE_PRINTF("ERROR DECODING AAM\n");
+         TRACE_REGS();
+         HALT_SYS();
+@@ -9430,7 +9954,8 @@ static void x86emuOp_aam(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd5
+ ****************************************************************************/
+-static void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_aad(u8 X86EMU_UNUSED(op1))
+ {
+     u8 a;
+ 
+@@ -9438,8 +9963,8 @@ static void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
+     DECODE_PRINTF("AAD\n");
+     a = fetch_byte_imm();
+     if (a != 10) {
+-	/* fix: add base decoding
+-	   aad_word(u16 val, int base a) */
++        /* fix: add base decoding
++           aad_word(u16 val, int base a) */
+         DECODE_PRINTF("ERROR DECODING AAM\n");
+         TRACE_REGS();
+         HALT_SYS();
+@@ -9456,14 +9981,15 @@ static void x86emuOp_aad(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xd7
+ ****************************************************************************/
+-static void x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
+ {
+     u16 addr;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("XLAT\n");
+     TRACE_AND_STEP();
+-	addr = (u16)(M.x86.R_BX + (u8)M.x86.R_AL);
++    addr = (u16) (M.x86.R_BX + (u8) M.x86.R_AL);
+     M.x86.R_AL = fetch_data_byte(addr);
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -9475,7 +10001,8 @@ static void x86emuOp_xlat(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe0
+ ****************************************************************************/
+-static void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
+ {
+     s16 ip;
+ 
+@@ -9486,7 +10013,7 @@ static void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
+     DECODE_PRINTF2("%04x\n", ip);
+     TRACE_AND_STEP();
+     M.x86.R_CX -= 1;
+-    if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF))      /* CX != 0 and !ZF */
++    if (M.x86.R_CX != 0 && !ACCESS_FLAG(F_ZF))  /* CX != 0 and !ZF */
+         M.x86.R_IP = ip;
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -9496,7 +10023,8 @@ static void x86emuOp_loopne(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe1
+ ****************************************************************************/
+-static void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_loope(u8 X86EMU_UNUSED(op1))
+ {
+     s16 ip;
+ 
+@@ -9507,7 +10035,7 @@ static void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
+     DECODE_PRINTF2("%04x\n", ip);
+     TRACE_AND_STEP();
+     M.x86.R_CX -= 1;
+-    if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF))       /* CX != 0 and ZF */
++    if (M.x86.R_CX != 0 && ACCESS_FLAG(F_ZF))   /* CX != 0 and ZF */
+         M.x86.R_IP = ip;
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -9517,7 +10045,8 @@ static void x86emuOp_loope(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe2
+ ****************************************************************************/
+-static void x86emuOp_loop(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_loop(u8 X86EMU_UNUSED(op1))
+ {
+     s16 ip;
+ 
+@@ -9538,16 +10067,17 @@ static void x86emuOp_loop(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe3
+ ****************************************************************************/
+-static void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
+ {
+     u16 target;
+-    s8  offset;
++    s8 offset;
+ 
+     /* jump to byte offset if overflow flag is set */
+     START_OF_INSTR();
+     DECODE_PRINTF("JCXZ\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     if (M.x86.R_CX == 0)
+@@ -9560,16 +10090,17 @@ static void x86emuOp_jcxz(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe4
+ ****************************************************************************/
+-static void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 port;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("IN\t");
+-	port = (u8) fetch_byte_imm();
++    port = (u8) fetch_byte_imm();
+     DECODE_PRINTF2("%x,AL\n", port);
+     TRACE_AND_STEP();
+-    M.x86.R_AL = (*sys_inb)(port);
++    M.x86.R_AL = (*sys_inb) (port);
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+@@ -9578,23 +10109,26 @@ static void x86emuOp_in_byte_AL_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe5
+ ****************************************************************************/
+-static void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u8 port;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("IN\t");
+-	port = (u8) fetch_byte_imm();
++    port = (u8) fetch_byte_imm();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF2("EAX,%x\n", port);
+-    } else {
++    }
++    else {
+         DECODE_PRINTF2("AX,%x\n", port);
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-        M.x86.R_EAX = (*sys_inl)(port);
+-    } else {
+-        M.x86.R_AX = (*sys_inw)(port);
++        M.x86.R_EAX = (*sys_inl) (port);
++    }
++    else {
++        M.x86.R_AX = (*sys_inw) (port);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -9604,16 +10138,17 @@ static void x86emuOp_in_word_AX_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe6
+ ****************************************************************************/
+-static void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
+ {
+     u8 port;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("OUT\t");
+-	port = (u8) fetch_byte_imm();
++    port = (u8) fetch_byte_imm();
+     DECODE_PRINTF2("%x,AL\n", port);
+     TRACE_AND_STEP();
+-    (*sys_outb)(port, M.x86.R_AL);
++    (*sys_outb) (port, M.x86.R_AL);
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+@@ -9622,23 +10157,26 @@ static void x86emuOp_out_byte_IMM_AL(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe7
+ ****************************************************************************/
+-static void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
+ {
+     u8 port;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("OUT\t");
+-	port = (u8) fetch_byte_imm();
++    port = (u8) fetch_byte_imm();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF2("%x,EAX\n", port);
+-    } else {
++    }
++    else {
+         DECODE_PRINTF2("%x,AX\n", port);
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-        (*sys_outl)(port, M.x86.R_EAX);
+-    } else {
+-        (*sys_outw)(port, M.x86.R_AX);
++        (*sys_outl) (port, M.x86.R_EAX);
++    }
++    else {
++        (*sys_outw) (port, M.x86.R_AX);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -9648,19 +10186,35 @@ static void x86emuOp_out_word_IMM_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe8
+ ****************************************************************************/
+-static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
+ {
+-    s16 ip;
++    s16 ip16;
++    s32 ip32;
+ 
+     START_OF_INSTR();
+-	DECODE_PRINTF("CALL\t");
+-	ip = (s16) fetch_word_imm();
+-	ip += (s16) M.x86.R_IP;    /* CHECK SIGN */
+-	DECODE_PRINTF2("%04x\n", (u16)ip);
+-	CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip, "");
++    DECODE_PRINTF("CALL\t");
++    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++        ip32 = (s32) fetch_long_imm();
++        ip32 += (s16) M.x86.R_IP;       /* CHECK SIGN */
++        DECODE_PRINTF2("%04x\n", (u16) ip32);
++        CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip32, "");
++    }
++    else {
++        ip16 = (s16) fetch_word_imm();
++        ip16 += (s16) M.x86.R_IP;       /* CHECK SIGN */
++        DECODE_PRINTF2("%04x\n", (u16) ip16);
++        CALL_TRACE(M.x86.saved_cs, M.x86.saved_ip, M.x86.R_CS, ip16, "");
++    }
+     TRACE_AND_STEP();
+-    push_word(M.x86.R_IP);
+-    M.x86.R_IP = ip;
++    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++        push_long(M.x86.R_EIP);
++        M.x86.R_EIP = ip32 & 0xffff;
++    }
++    else {
++        push_word(M.x86.R_IP);
++        M.x86.R_EIP = ip16;
++    }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+@@ -9669,17 +10223,27 @@ static void x86emuOp_call_near_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xe9
+ ****************************************************************************/
+-static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
+ {
+-    int ip;
++    u32 ip;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("JMP\t");
+-    ip = (s16)fetch_word_imm();
+-    ip += (s16)M.x86.R_IP;
+-    DECODE_PRINTF2("%04x\n", (u16)ip);
+-    TRACE_AND_STEP();
+-    M.x86.R_IP = (u16)ip;
++    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++        ip = (u32) fetch_long_imm();
++        ip += (u32) M.x86.R_EIP;
++        DECODE_PRINTF2("%08x\n", (u32) ip);
++        TRACE_AND_STEP();
++        M.x86.R_EIP = (u32) ip;
++    }
++    else {
++        ip = (s16) fetch_word_imm();
++        ip += (s16) M.x86.R_IP;
++        DECODE_PRINTF2("%04x\n", (u16) ip);
++        TRACE_AND_STEP();
++        M.x86.R_IP = (u16) ip;
++    }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+@@ -9688,18 +10252,25 @@ static void x86emuOp_jump_near_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xea
+ ****************************************************************************/
+-static void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
+ {
+-    u16 cs, ip;
++    u16 cs;
++    u32 ip;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("JMP\tFAR ");
+-    ip = fetch_word_imm();
++    if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++        ip = fetch_long_imm();
++    }
++    else {
++        ip = fetch_word_imm();
++    }
+     cs = fetch_word_imm();
+     DECODE_PRINTF2("%04x:", cs);
+     DECODE_PRINTF2("%04x\n", ip);
+     TRACE_AND_STEP();
+-    M.x86.R_IP = ip;
++    M.x86.R_EIP = ip & 0xffff;
+     M.x86.R_CS = cs;
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -9709,15 +10280,16 @@ static void x86emuOp_jump_far_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xeb
+ ****************************************************************************/
+-static void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
+ {
+     u16 target;
+     s8 offset;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("JMP\t");
+-    offset = (s8)fetch_byte_imm();
+-    target = (u16)(M.x86.R_IP + offset);
++    offset = (s8) fetch_byte_imm();
++    target = (u16) (M.x86.R_IP + offset);
+     DECODE_PRINTF2("%x\n", target);
+     TRACE_AND_STEP();
+     M.x86.R_IP = target;
+@@ -9729,12 +10301,13 @@ static void x86emuOp_jump_byte_IMM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xec
+ ****************************************************************************/
+-static void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("IN\tAL,DX\n");
+     TRACE_AND_STEP();
+-    M.x86.R_AL = (*sys_inb)(M.x86.R_DX);
++    M.x86.R_AL = (*sys_inb) (M.x86.R_DX);
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+@@ -9743,19 +10316,22 @@ static void x86emuOp_in_byte_AL_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xed
+ ****************************************************************************/
+-static void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("IN\tEAX,DX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("IN\tAX,DX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-        M.x86.R_EAX = (*sys_inl)(M.x86.R_DX);
+-    } else {
+-        M.x86.R_AX = (*sys_inw)(M.x86.R_DX);
++        M.x86.R_EAX = (*sys_inl) (M.x86.R_DX);
++    }
++    else {
++        M.x86.R_AX = (*sys_inw) (M.x86.R_DX);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -9765,12 +10341,13 @@ static void x86emuOp_in_word_AX_DX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xee
+ ****************************************************************************/
+-static void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("OUT\tDX,AL\n");
+     TRACE_AND_STEP();
+-    (*sys_outb)(M.x86.R_DX, M.x86.R_AL);
++    (*sys_outb) (M.x86.R_DX, M.x86.R_AL);
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+@@ -9779,19 +10356,22 @@ static void x86emuOp_out_byte_DX_AL(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xef
+ ****************************************************************************/
+-static void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+         DECODE_PRINTF("OUT\tDX,EAX\n");
+-    } else {
++    }
++    else {
+         DECODE_PRINTF("OUT\tDX,AX\n");
+     }
+     TRACE_AND_STEP();
+     if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-        (*sys_outl)(M.x86.R_DX, M.x86.R_EAX);
+-    } else {
+-        (*sys_outw)(M.x86.R_DX, M.x86.R_AX);
++        (*sys_outl) (M.x86.R_DX, M.x86.R_EAX);
++    }
++    else {
++        (*sys_outw) (M.x86.R_DX, M.x86.R_AX);
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -9801,7 +10381,8 @@ static void x86emuOp_out_word_DX_AX(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf0
+ ****************************************************************************/
+-static void x86emuOp_lock(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_lock(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("LOCK:\n");
+@@ -9816,7 +10397,8 @@ static void x86emuOp_lock(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf2
+ ****************************************************************************/
+-static void x86emuOp_repne(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_repne(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("REPNE\n");
+@@ -9830,7 +10412,8 @@ static void x86emuOp_repne(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf3
+ ****************************************************************************/
+-static void x86emuOp_repe(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_repe(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("REPE\n");
+@@ -9844,7 +10427,8 @@ static void x86emuOp_repe(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf4
+ ****************************************************************************/
+-static void x86emuOp_halt(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_halt(u8 X86EMU_UNUSED(op1))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("HALT\n");
+@@ -9858,7 +10442,8 @@ static void x86emuOp_halt(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf5
+ ****************************************************************************/
+-static void x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
+ {
+     /* complement the carry flag. */
+     START_OF_INSTR();
+@@ -9873,7 +10458,8 @@ static void x86emuOp_cmc(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf6
+ ****************************************************************************/
+-static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     u8 *destreg;
+@@ -9885,9 +10471,9 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+     START_OF_INSTR();
+     FETCH_DECODE_MODRM(mod, rh, rl);
+     switch (mod) {
+-    case 0:                     /* mod=00 */
++    case 0:                    /* mod=00 */
+         switch (rh) {
+-        case 0:         /* test byte imm */
++        case 0:                /* test byte imm */
+             DECODE_PRINTF("TEST\tBYTE PTR ");
+             destoffset = decode_rm00_address(rl);
+             DECODE_PRINTF(",");
+@@ -9953,9 +10539,9 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+             break;
+         }
+         break;                  /* end mod==00 */
+-    case 1:                     /* mod=01 */
++    case 1:                    /* mod=01 */
+         switch (rh) {
+-        case 0:         /* test byte imm */
++        case 0:                /* test byte imm */
+             DECODE_PRINTF("TEST\tBYTE PTR ");
+             destoffset = decode_rm01_address(rl);
+             DECODE_PRINTF(",");
+@@ -10021,9 +10607,9 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+             break;
+         }
+         break;                  /* end mod==01 */
+-    case 2:                     /* mod=10 */
++    case 2:                    /* mod=10 */
+         switch (rh) {
+-        case 0:         /* test byte imm */
++        case 0:                /* test byte imm */
+             DECODE_PRINTF("TEST\tBYTE PTR ");
+             destoffset = decode_rm10_address(rl);
+             DECODE_PRINTF(",");
+@@ -10089,9 +10675,9 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+             break;
+         }
+         break;                  /* end mod==10 */
+-    case 3:                     /* mod=11 */
++    case 3:                    /* mod=11 */
+         switch (rh) {
+-        case 0:         /* test byte imm */
++        case 0:                /* test byte imm */
+             DECODE_PRINTF("TEST\t");
+             destreg = DECODE_RM_BYTE_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -10123,7 +10709,7 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+             destreg = DECODE_RM_BYTE_REGISTER(rl);
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+-            mul_byte(*destreg);      /*!!!  */
++            mul_byte(*destreg); /*!!!  */
+             break;
+         case 5:
+             DECODE_PRINTF("IMUL\t");
+@@ -10157,7 +10743,8 @@ static void x86emuOp_opcF6_byte_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf7
+ ****************************************************************************/
+-static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -10167,11 +10754,11 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+     START_OF_INSTR();
+     FETCH_DECODE_MODRM(mod, rh, rl);
+     switch (mod) {
+-    case 0:                     /* mod=00 */
++    case 0:                    /* mod=00 */
+         switch (rh) {
+-        case 0:         /* test word imm */
++        case 0:                /* test word imm */
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-                u32 destval,srcval;
++                u32 destval, srcval;
+ 
+                 DECODE_PRINTF("TEST\tDWORD PTR ");
+                 destoffset = decode_rm00_address(rl);
+@@ -10181,8 +10768,9 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 test_long(destval, srcval);
+-            } else {
+-                u16 destval,srcval;
++            }
++            else {
++                u16 destval, srcval;
+ 
+                 DECODE_PRINTF("TEST\tWORD PTR ");
+                 destoffset = decode_rm00_address(rl);
+@@ -10209,7 +10797,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = not_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("NOT\tWORD PTR ");
+@@ -10232,7 +10821,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = neg_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("NEG\tWORD PTR ");
+@@ -10254,7 +10844,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 mul_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("MUL\tWORD PTR ");
+@@ -10275,7 +10866,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 imul_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("IMUL\tWORD PTR ");
+@@ -10296,7 +10888,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 div_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("DIV\tWORD PTR ");
+@@ -10317,7 +10910,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 idiv_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("IDIV\tWORD PTR ");
+@@ -10330,11 +10924,11 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+             break;
+         }
+         break;                  /* end mod==00 */
+-    case 1:                     /* mod=01 */
++    case 1:                    /* mod=01 */
+         switch (rh) {
+-        case 0:         /* test word imm */
++        case 0:                /* test word imm */
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-                u32 destval,srcval;
++                u32 destval, srcval;
+ 
+                 DECODE_PRINTF("TEST\tDWORD PTR ");
+                 destoffset = decode_rm01_address(rl);
+@@ -10344,8 +10938,9 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 test_long(destval, srcval);
+-            } else {
+-                u16 destval,srcval;
++            }
++            else {
++                u16 destval, srcval;
+ 
+                 DECODE_PRINTF("TEST\tWORD PTR ");
+                 destoffset = decode_rm01_address(rl);
+@@ -10372,7 +10967,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = not_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("NOT\tWORD PTR ");
+@@ -10395,7 +10991,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = neg_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("NEG\tWORD PTR ");
+@@ -10417,7 +11014,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 mul_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("MUL\tWORD PTR ");
+@@ -10438,7 +11036,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 imul_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("IMUL\tWORD PTR ");
+@@ -10459,7 +11058,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 div_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("DIV\tWORD PTR ");
+@@ -10480,7 +11080,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 idiv_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("IDIV\tWORD PTR ");
+@@ -10493,11 +11094,11 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+             break;
+         }
+         break;                  /* end mod==01 */
+-    case 2:                     /* mod=10 */
++    case 2:                    /* mod=10 */
+         switch (rh) {
+-        case 0:         /* test word imm */
++        case 0:                /* test word imm */
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-                u32 destval,srcval;
++                u32 destval, srcval;
+ 
+                 DECODE_PRINTF("TEST\tDWORD PTR ");
+                 destoffset = decode_rm10_address(rl);
+@@ -10507,8 +11108,9 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 test_long(destval, srcval);
+-            } else {
+-                u16 destval,srcval;
++            }
++            else {
++                u16 destval, srcval;
+ 
+                 DECODE_PRINTF("TEST\tWORD PTR ");
+                 destoffset = decode_rm10_address(rl);
+@@ -10535,7 +11137,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = not_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("NOT\tWORD PTR ");
+@@ -10558,7 +11161,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = neg_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("NEG\tWORD PTR ");
+@@ -10580,7 +11184,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 mul_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("MUL\tWORD PTR ");
+@@ -10601,7 +11206,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 imul_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("IMUL\tWORD PTR ");
+@@ -10622,7 +11228,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 div_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("DIV\tWORD PTR ");
+@@ -10643,7 +11250,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 idiv_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 DECODE_PRINTF("IDIV\tWORD PTR ");
+@@ -10656,9 +11264,9 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+             break;
+         }
+         break;                  /* end mod==10 */
+-    case 3:                     /* mod=11 */
++    case 3:                    /* mod=11 */
+         switch (rh) {
+-        case 0:         /* test word imm */
++        case 0:                /* test word imm */
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                 u32 *destreg;
+                 u32 srcval;
+@@ -10670,7 +11278,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 DECODE_PRINTF2("%x\n", srcval);
+                 TRACE_AND_STEP();
+                 test_long(*destreg, srcval);
+-            } else {
++            }
++            else {
+                 u16 *destreg;
+                 u16 srcval;
+ 
+@@ -10696,7 +11305,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 DECODE_PRINTF("\n");
+                 TRACE_AND_STEP();
+                 *destreg = not_long(*destreg);
+-            } else {
++            }
++            else {
+                 u16 *destreg;
+ 
+                 DECODE_PRINTF("NOT\t");
+@@ -10715,7 +11325,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 DECODE_PRINTF("\n");
+                 TRACE_AND_STEP();
+                 *destreg = neg_long(*destreg);
+-            } else {
++            }
++            else {
+                 u16 *destreg;
+ 
+                 DECODE_PRINTF("NEG\t");
+@@ -10733,15 +11344,16 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 destreg = DECODE_RM_LONG_REGISTER(rl);
+                 DECODE_PRINTF("\n");
+                 TRACE_AND_STEP();
+-                mul_long(*destreg);      /*!!!  */
+-            } else {
++                mul_long(*destreg);     /*!!!  */
++            }
++            else {
+                 u16 *destreg;
+ 
+                 DECODE_PRINTF("MUL\t");
+                 destreg = DECODE_RM_WORD_REGISTER(rl);
+                 DECODE_PRINTF("\n");
+                 TRACE_AND_STEP();
+-                mul_word(*destreg);      /*!!!  */
++                mul_word(*destreg);     /*!!!  */
+             }
+             break;
+         case 5:
+@@ -10753,7 +11365,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 DECODE_PRINTF("\n");
+                 TRACE_AND_STEP();
+                 imul_long(*destreg);
+-            } else {
++            }
++            else {
+                 u16 *destreg;
+ 
+                 DECODE_PRINTF("IMUL\t");
+@@ -10772,7 +11385,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 DECODE_PRINTF("\n");
+                 TRACE_AND_STEP();
+                 div_long(*destreg);
+-            } else {
++            }
++            else {
+                 u16 *destreg;
+ 
+                 DECODE_PRINTF("DIV\t");
+@@ -10791,7 +11405,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+                 DECODE_PRINTF("\n");
+                 TRACE_AND_STEP();
+                 idiv_long(*destreg);
+-            } else {
++            }
++            else {
+                 u16 *destreg;
+ 
+                 DECODE_PRINTF("IDIV\t");
+@@ -10812,7 +11427,8 @@ static void x86emuOp_opcF7_word_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf8
+ ****************************************************************************/
+-static void x86emuOp_clc(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_clc(u8 X86EMU_UNUSED(op1))
+ {
+     /* clear the carry flag. */
+     START_OF_INSTR();
+@@ -10827,7 +11443,8 @@ static void x86emuOp_clc(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xf9
+ ****************************************************************************/
+-static void x86emuOp_stc(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_stc(u8 X86EMU_UNUSED(op1))
+ {
+     /* set the carry flag. */
+     START_OF_INSTR();
+@@ -10842,7 +11459,8 @@ static void x86emuOp_stc(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xfa
+ ****************************************************************************/
+-static void x86emuOp_cli(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cli(u8 X86EMU_UNUSED(op1))
+ {
+     /* clear interrupts. */
+     START_OF_INSTR();
+@@ -10857,7 +11475,8 @@ static void x86emuOp_cli(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xfb
+ ****************************************************************************/
+-static void x86emuOp_sti(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_sti(u8 X86EMU_UNUSED(op1))
+ {
+     /* enable  interrupts. */
+     START_OF_INSTR();
+@@ -10872,7 +11491,8 @@ static void x86emuOp_sti(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xfc
+ ****************************************************************************/
+-static void x86emuOp_cld(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_cld(u8 X86EMU_UNUSED(op1))
+ {
+     /* clear interrupts. */
+     START_OF_INSTR();
+@@ -10887,7 +11507,8 @@ static void x86emuOp_cld(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xfd
+ ****************************************************************************/
+-static void x86emuOp_std(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_std(u8 X86EMU_UNUSED(op1))
+ {
+     /* clear interrupts. */
+     START_OF_INSTR();
+@@ -10902,7 +11523,8 @@ static void x86emuOp_std(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xfe
+ ****************************************************************************/
+-static void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rh, rl;
+     u8 destval;
+@@ -10944,13 +11566,13 @@ static void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
+         destoffset = decode_rm00_address(rl);
+         DECODE_PRINTF("\n");
+         switch (rh) {
+-        case 0:         /* inc word ptr ... */
++        case 0:                /* inc word ptr ... */
+             destval = fetch_data_byte(destoffset);
+             TRACE_AND_STEP();
+             destval = inc_byte(destval);
+             store_data_byte(destoffset, destval);
+             break;
+-        case 1:         /* dec word ptr ... */
++        case 1:                /* dec word ptr ... */
+             destval = fetch_data_byte(destoffset);
+             TRACE_AND_STEP();
+             destval = dec_byte(destval);
+@@ -11019,12 +11641,13 @@ static void x86emuOp_opcFE_byte_RM(u8 X86EMU_UNUSED(op1))
+ REMARKS:
+ Handles opcode 0xff
+ ****************************************************************************/
+-static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
++static void
++x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ {
+     int mod, rh, rl;
+     uint destoffset = 0;
+-	u16 *destreg;
+-	u16 destval,destval2;
++    u16 *destreg;
++    u16 destval, destval2;
+ 
+     /* Yet another special case instruction. */
+     START_OF_INSTR();
+@@ -11040,14 +11663,16 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+         case 0:
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                 DECODE_PRINTF("INC\tDWORD PTR ");
+-            } else {
++            }
++            else {
+                 DECODE_PRINTF("INC\tWORD PTR ");
+             }
+             break;
+         case 1:
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                 DECODE_PRINTF("DEC\tDWORD PTR ");
+-            } else {
++            }
++            else {
+                 DECODE_PRINTF("DEC\tWORD PTR ");
+             }
+             break;
+@@ -11078,7 +11703,7 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+         destoffset = decode_rm00_address(rl);
+         DECODE_PRINTF("\n");
+         switch (rh) {
+-        case 0:         /* inc word ptr ... */
++        case 0:                /* inc word ptr ... */
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                 u32 destval;
+ 
+@@ -11086,7 +11711,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = inc_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 destval = fetch_data_word(destoffset);
+@@ -11095,7 +11721,7 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 store_data_word(destoffset, destval);
+             }
+             break;
+-        case 1:         /* dec word ptr ... */
++        case 1:                /* dec word ptr ... */
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                 u32 destval;
+ 
+@@ -11103,7 +11729,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = dec_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 destval = fetch_data_word(destoffset);
+@@ -11112,13 +11739,13 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 store_data_word(destoffset, destval);
+             }
+             break;
+-        case 2:         /* call word ptr ... */
++        case 2:                /* call word ptr ... */
+             destval = fetch_data_word(destoffset);
+             TRACE_AND_STEP();
+             push_word(M.x86.R_IP);
+             M.x86.R_IP = destval;
+             break;
+-        case 3:         /* call far ptr ... */
++        case 3:                /* call far ptr ... */
+             destval = fetch_data_word(destoffset);
+             destval2 = fetch_data_word(destoffset + 2);
+             TRACE_AND_STEP();
+@@ -11127,26 +11754,27 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+             push_word(M.x86.R_IP);
+             M.x86.R_IP = destval;
+             break;
+-        case 4:         /* jmp word ptr ... */
++        case 4:                /* jmp word ptr ... */
+             destval = fetch_data_word(destoffset);
+             TRACE_AND_STEP();
+             M.x86.R_IP = destval;
+             break;
+-        case 5:         /* jmp far ptr ... */
++        case 5:                /* jmp far ptr ... */
+             destval = fetch_data_word(destoffset);
+             destval2 = fetch_data_word(destoffset + 2);
+             TRACE_AND_STEP();
+             M.x86.R_IP = destval;
+             M.x86.R_CS = destval2;
+             break;
+-        case 6:         /*  push word ptr ... */
++        case 6:                /*  push word ptr ... */
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                 u32 destval;
+ 
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 push_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 destval = fetch_data_word(destoffset);
+@@ -11168,7 +11796,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = inc_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 destval = fetch_data_word(destoffset);
+@@ -11185,7 +11814,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = dec_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 destval = fetch_data_word(destoffset);
+@@ -11194,13 +11824,13 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 store_data_word(destoffset, destval);
+             }
+             break;
+-        case 2:         /* call word ptr ... */
++        case 2:                /* call word ptr ... */
+             destval = fetch_data_word(destoffset);
+             TRACE_AND_STEP();
+             push_word(M.x86.R_IP);
+             M.x86.R_IP = destval;
+             break;
+-        case 3:         /* call far ptr ... */
++        case 3:                /* call far ptr ... */
+             destval = fetch_data_word(destoffset);
+             destval2 = fetch_data_word(destoffset + 2);
+             TRACE_AND_STEP();
+@@ -11209,26 +11839,27 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+             push_word(M.x86.R_IP);
+             M.x86.R_IP = destval;
+             break;
+-        case 4:         /* jmp word ptr ... */
++        case 4:                /* jmp word ptr ... */
+             destval = fetch_data_word(destoffset);
+             TRACE_AND_STEP();
+             M.x86.R_IP = destval;
+             break;
+-        case 5:         /* jmp far ptr ... */
++        case 5:                /* jmp far ptr ... */
+             destval = fetch_data_word(destoffset);
+             destval2 = fetch_data_word(destoffset + 2);
+             TRACE_AND_STEP();
+             M.x86.R_IP = destval;
+             M.x86.R_CS = destval2;
+             break;
+-        case 6:         /*  push word ptr ... */
++        case 6:                /*  push word ptr ... */
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                 u32 destval;
+ 
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 push_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 destval = fetch_data_word(destoffset);
+@@ -11250,7 +11881,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = inc_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 destval = fetch_data_word(destoffset);
+@@ -11267,7 +11899,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 TRACE_AND_STEP();
+                 destval = dec_long(destval);
+                 store_data_long(destoffset, destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 destval = fetch_data_word(destoffset);
+@@ -11276,13 +11909,13 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 store_data_word(destoffset, destval);
+             }
+             break;
+-        case 2:         /* call word ptr ... */
++        case 2:                /* call word ptr ... */
+             destval = fetch_data_word(destoffset);
+             TRACE_AND_STEP();
+             push_word(M.x86.R_IP);
+             M.x86.R_IP = destval;
+             break;
+-        case 3:         /* call far ptr ... */
++        case 3:                /* call far ptr ... */
+             destval = fetch_data_word(destoffset);
+             destval2 = fetch_data_word(destoffset + 2);
+             TRACE_AND_STEP();
+@@ -11291,26 +11924,27 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+             push_word(M.x86.R_IP);
+             M.x86.R_IP = destval;
+             break;
+-        case 4:         /* jmp word ptr ... */
++        case 4:                /* jmp word ptr ... */
+             destval = fetch_data_word(destoffset);
+             TRACE_AND_STEP();
+             M.x86.R_IP = destval;
+             break;
+-        case 5:         /* jmp far ptr ... */
++        case 5:                /* jmp far ptr ... */
+             destval = fetch_data_word(destoffset);
+             destval2 = fetch_data_word(destoffset + 2);
+             TRACE_AND_STEP();
+             M.x86.R_IP = destval;
+             M.x86.R_CS = destval2;
+             break;
+-        case 6:         /*  push word ptr ... */
++        case 6:                /*  push word ptr ... */
+             if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+                 u32 destval;
+ 
+                 destval = fetch_data_long(destoffset);
+                 TRACE_AND_STEP();
+                 push_long(destval);
+-            } else {
++            }
++            else {
+                 u16 destval;
+ 
+                 destval = fetch_data_word(destoffset);
+@@ -11330,7 +11964,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 DECODE_PRINTF("\n");
+                 TRACE_AND_STEP();
+                 *destreg = inc_long(*destreg);
+-            } else {
++            }
++            else {
+                 u16 *destreg;
+ 
+                 destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -11347,7 +11982,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 DECODE_PRINTF("\n");
+                 TRACE_AND_STEP();
+                 *destreg = dec_long(*destreg);
+-            } else {
++            }
++            else {
+                 u16 *destreg;
+ 
+                 destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -11356,26 +11992,26 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 *destreg = dec_word(*destreg);
+             }
+             break;
+-        case 2:         /* call word ptr ... */
++        case 2:                /* call word ptr ... */
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             push_word(M.x86.R_IP);
+             M.x86.R_IP = *destreg;
+             break;
+-        case 3:         /* jmp far ptr ... */
++        case 3:                /* jmp far ptr ... */
+             DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
+             TRACE_AND_STEP();
+             HALT_SYS();
+             break;
+ 
+-        case 4:         /* jmp  ... */
++        case 4:                /* jmp  ... */
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             M.x86.R_IP = (u16) (*destreg);
+             break;
+-        case 5:         /* jmp far ptr ... */
++        case 5:                /* jmp far ptr ... */
+             DECODE_PRINTF("OPERATION UNDEFINED 0XFF \n");
+             TRACE_AND_STEP();
+             HALT_SYS();
+@@ -11388,7 +12024,8 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+                 DECODE_PRINTF("\n");
+                 TRACE_AND_STEP();
+                 push_long(*destreg);
+-            } else {
++            }
++            else {
+                 u16 *destreg;
+ 
+                 destreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -11407,8 +12044,7 @@ static void x86emuOp_opcFF_word_RM(u8 X86EMU_UNUSED(op1))
+ /***************************************************************************
+  * Single byte operation code table:
+  **************************************************************************/
+-void (*x86emu_optab[256])(u8) =
+-{
++void (*x86emu_optab[256]) (u8) = {
+ /*  0x00 */ x86emuOp_add_byte_RM_R,
+ /*  0x01 */ x86emuOp_add_word_RM_R,
+ /*  0x02 */ x86emuOp_add_byte_R_RM,
+@@ -11417,7 +12053,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x05 */ x86emuOp_add_word_AX_IMM,
+ /*  0x06 */ x86emuOp_push_ES,
+ /*  0x07 */ x86emuOp_pop_ES,
+-
+ /*  0x08 */ x86emuOp_or_byte_RM_R,
+ /*  0x09 */ x86emuOp_or_word_RM_R,
+ /*  0x0a */ x86emuOp_or_byte_R_RM,
+@@ -11426,7 +12061,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x0d */ x86emuOp_or_word_AX_IMM,
+ /*  0x0e */ x86emuOp_push_CS,
+ /*  0x0f */ x86emuOp_two_byte,
+-
+ /*  0x10 */ x86emuOp_adc_byte_RM_R,
+ /*  0x11 */ x86emuOp_adc_word_RM_R,
+ /*  0x12 */ x86emuOp_adc_byte_R_RM,
+@@ -11435,7 +12069,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x15 */ x86emuOp_adc_word_AX_IMM,
+ /*  0x16 */ x86emuOp_push_SS,
+ /*  0x17 */ x86emuOp_pop_SS,
+-
+ /*  0x18 */ x86emuOp_sbb_byte_RM_R,
+ /*  0x19 */ x86emuOp_sbb_word_RM_R,
+ /*  0x1a */ x86emuOp_sbb_byte_R_RM,
+@@ -11444,7 +12077,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x1d */ x86emuOp_sbb_word_AX_IMM,
+ /*  0x1e */ x86emuOp_push_DS,
+ /*  0x1f */ x86emuOp_pop_DS,
+-
+ /*  0x20 */ x86emuOp_and_byte_RM_R,
+ /*  0x21 */ x86emuOp_and_word_RM_R,
+ /*  0x22 */ x86emuOp_and_byte_R_RM,
+@@ -11453,7 +12085,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x25 */ x86emuOp_and_word_AX_IMM,
+ /*  0x26 */ x86emuOp_segovr_ES,
+ /*  0x27 */ x86emuOp_daa,
+-
+ /*  0x28 */ x86emuOp_sub_byte_RM_R,
+ /*  0x29 */ x86emuOp_sub_word_RM_R,
+ /*  0x2a */ x86emuOp_sub_byte_R_RM,
+@@ -11462,7 +12093,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x2d */ x86emuOp_sub_word_AX_IMM,
+ /*  0x2e */ x86emuOp_segovr_CS,
+ /*  0x2f */ x86emuOp_das,
+-
+ /*  0x30 */ x86emuOp_xor_byte_RM_R,
+ /*  0x31 */ x86emuOp_xor_word_RM_R,
+ /*  0x32 */ x86emuOp_xor_byte_R_RM,
+@@ -11471,7 +12101,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x35 */ x86emuOp_xor_word_AX_IMM,
+ /*  0x36 */ x86emuOp_segovr_SS,
+ /*  0x37 */ x86emuOp_aaa,
+-
+ /*  0x38 */ x86emuOp_cmp_byte_RM_R,
+ /*  0x39 */ x86emuOp_cmp_word_RM_R,
+ /*  0x3a */ x86emuOp_cmp_byte_R_RM,
+@@ -11480,7 +12109,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x3d */ x86emuOp_cmp_word_AX_IMM,
+ /*  0x3e */ x86emuOp_segovr_DS,
+ /*  0x3f */ x86emuOp_aas,
+-
+ /*  0x40 */ x86emuOp_inc_AX,
+ /*  0x41 */ x86emuOp_inc_CX,
+ /*  0x42 */ x86emuOp_inc_DX,
+@@ -11489,7 +12117,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x45 */ x86emuOp_inc_BP,
+ /*  0x46 */ x86emuOp_inc_SI,
+ /*  0x47 */ x86emuOp_inc_DI,
+-
+ /*  0x48 */ x86emuOp_dec_AX,
+ /*  0x49 */ x86emuOp_dec_CX,
+ /*  0x4a */ x86emuOp_dec_DX,
+@@ -11498,7 +12125,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x4d */ x86emuOp_dec_BP,
+ /*  0x4e */ x86emuOp_dec_SI,
+ /*  0x4f */ x86emuOp_dec_DI,
+-
+ /*  0x50 */ x86emuOp_push_AX,
+ /*  0x51 */ x86emuOp_push_CX,
+ /*  0x52 */ x86emuOp_push_DX,
+@@ -11507,7 +12133,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x55 */ x86emuOp_push_BP,
+ /*  0x56 */ x86emuOp_push_SI,
+ /*  0x57 */ x86emuOp_push_DI,
+-
+ /*  0x58 */ x86emuOp_pop_AX,
+ /*  0x59 */ x86emuOp_pop_CX,
+ /*  0x5a */ x86emuOp_pop_DX,
+@@ -11516,16 +12141,16 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x5d */ x86emuOp_pop_BP,
+ /*  0x5e */ x86emuOp_pop_SI,
+ /*  0x5f */ x86emuOp_pop_DI,
+-
+ /*  0x60 */ x86emuOp_push_all,
+ /*  0x61 */ x86emuOp_pop_all,
+-/*  0x62 */ x86emuOp_illegal_op,   /* bound */
+-/*  0x63 */ x86emuOp_illegal_op,   /* arpl */
++                                                /*  0x62 */ x86emuOp_illegal_op,
++                                                /* bound */
++                                                /*  0x63 */ x86emuOp_illegal_op,
++                                                /* arpl */
+ /*  0x64 */ x86emuOp_segovr_FS,
+ /*  0x65 */ x86emuOp_segovr_GS,
+ /*  0x66 */ x86emuOp_prefix_data,
+ /*  0x67 */ x86emuOp_prefix_addr,
+-
+ /*  0x68 */ x86emuOp_push_word_IMM,
+ /*  0x69 */ x86emuOp_imul_word_IMM,
+ /*  0x6a */ x86emuOp_push_byte_IMM,
+@@ -11534,7 +12159,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x6d */ x86emuOp_ins_word,
+ /*  0x6e */ x86emuOp_outs_byte,
+ /*  0x6f */ x86emuOp_outs_word,
+-
+ /*  0x70 */ x86emuOp_jump_near_O,
+ /*  0x71 */ x86emuOp_jump_near_NO,
+ /*  0x72 */ x86emuOp_jump_near_B,
+@@ -11543,7 +12167,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x75 */ x86emuOp_jump_near_NZ,
+ /*  0x76 */ x86emuOp_jump_near_BE,
+ /*  0x77 */ x86emuOp_jump_near_NBE,
+-
+ /*  0x78 */ x86emuOp_jump_near_S,
+ /*  0x79 */ x86emuOp_jump_near_NS,
+ /*  0x7a */ x86emuOp_jump_near_P,
+@@ -11552,7 +12175,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x7d */ x86emuOp_jump_near_NL,
+ /*  0x7e */ x86emuOp_jump_near_LE,
+ /*  0x7f */ x86emuOp_jump_near_NLE,
+-
+ /*  0x80 */ x86emuOp_opc80_byte_RM_IMM,
+ /*  0x81 */ x86emuOp_opc81_word_RM_IMM,
+ /*  0x82 */ x86emuOp_opc82_byte_RM_IMM,
+@@ -11561,7 +12183,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x85 */ x86emuOp_test_word_RM_R,
+ /*  0x86 */ x86emuOp_xchg_byte_RM_R,
+ /*  0x87 */ x86emuOp_xchg_word_RM_R,
+-
+ /*  0x88 */ x86emuOp_mov_byte_RM_R,
+ /*  0x89 */ x86emuOp_mov_word_RM_R,
+ /*  0x8a */ x86emuOp_mov_byte_R_RM,
+@@ -11570,7 +12191,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x8d */ x86emuOp_lea_word_R_M,
+ /*  0x8e */ x86emuOp_mov_word_SR_RM,
+ /*  0x8f */ x86emuOp_pop_RM,
+-
+ /*  0x90 */ x86emuOp_nop,
+ /*  0x91 */ x86emuOp_xchg_word_AX_CX,
+ /*  0x92 */ x86emuOp_xchg_word_AX_DX,
+@@ -11579,7 +12199,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x95 */ x86emuOp_xchg_word_AX_BP,
+ /*  0x96 */ x86emuOp_xchg_word_AX_SI,
+ /*  0x97 */ x86emuOp_xchg_word_AX_DI,
+-
+ /*  0x98 */ x86emuOp_cbw,
+ /*  0x99 */ x86emuOp_cwd,
+ /*  0x9a */ x86emuOp_call_far_IMM,
+@@ -11588,7 +12207,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0x9d */ x86emuOp_popf_word,
+ /*  0x9e */ x86emuOp_sahf,
+ /*  0x9f */ x86emuOp_lahf,
+-
+ /*  0xa0 */ x86emuOp_mov_AL_M_IMM,
+ /*  0xa1 */ x86emuOp_mov_AX_M_IMM,
+ /*  0xa2 */ x86emuOp_mov_M_AL_IMM,
+@@ -11605,8 +12223,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0xad */ x86emuOp_lods_word,
+ /*  0xac */ x86emuOp_scas_byte,
+ /*  0xad */ x86emuOp_scas_word,
+-
+-
+ /*  0xb0 */ x86emuOp_mov_byte_AL_IMM,
+ /*  0xb1 */ x86emuOp_mov_byte_CL_IMM,
+ /*  0xb2 */ x86emuOp_mov_byte_DL_IMM,
+@@ -11615,7 +12231,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0xb5 */ x86emuOp_mov_byte_CH_IMM,
+ /*  0xb6 */ x86emuOp_mov_byte_DH_IMM,
+ /*  0xb7 */ x86emuOp_mov_byte_BH_IMM,
+-
+ /*  0xb8 */ x86emuOp_mov_word_AX_IMM,
+ /*  0xb9 */ x86emuOp_mov_word_CX_IMM,
+ /*  0xba */ x86emuOp_mov_word_DX_IMM,
+@@ -11624,7 +12239,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0xbd */ x86emuOp_mov_word_BP_IMM,
+ /*  0xbe */ x86emuOp_mov_word_SI_IMM,
+ /*  0xbf */ x86emuOp_mov_word_DI_IMM,
+-
+ /*  0xc0 */ x86emuOp_opcC0_byte_RM_MEM,
+ /*  0xc1 */ x86emuOp_opcC1_word_RM_MEM,
+ /*  0xc2 */ x86emuOp_ret_near_IMM,
+@@ -11641,14 +12255,14 @@ void (*x86emu_optab[256])(u8) =
+ /*  0xcd */ x86emuOp_int_IMM,
+ /*  0xce */ x86emuOp_into,
+ /*  0xcf */ x86emuOp_iret,
+-
+ /*  0xd0 */ x86emuOp_opcD0_byte_RM_1,
+ /*  0xd1 */ x86emuOp_opcD1_word_RM_1,
+ /*  0xd2 */ x86emuOp_opcD2_byte_RM_CL,
+ /*  0xd3 */ x86emuOp_opcD3_word_RM_CL,
+ /*  0xd4 */ x86emuOp_aam,
+ /*  0xd5 */ x86emuOp_aad,
+-/*  0xd6 */ x86emuOp_illegal_op,   /* Undocumented SETALC instruction */
++                                                /*  0xd6 */ x86emuOp_illegal_op,
++                                                /* Undocumented SETALC instruction */
+ /*  0xd7 */ x86emuOp_xlat,
+ /*  0xd8 */ x86emuOp_esc_coprocess_d8,
+ /*  0xd9 */ x86emuOp_esc_coprocess_d9,
+@@ -11658,7 +12272,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0xdd */ x86emuOp_esc_coprocess_dd,
+ /*  0xde */ x86emuOp_esc_coprocess_de,
+ /*  0xdf */ x86emuOp_esc_coprocess_df,
+-
+ /*  0xe0 */ x86emuOp_loopne,
+ /*  0xe1 */ x86emuOp_loope,
+ /*  0xe2 */ x86emuOp_loop,
+@@ -11667,7 +12280,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0xe5 */ x86emuOp_in_word_AX_IMM,
+ /*  0xe6 */ x86emuOp_out_byte_IMM_AL,
+ /*  0xe7 */ x86emuOp_out_word_IMM_AX,
+-
+ /*  0xe8 */ x86emuOp_call_near_IMM,
+ /*  0xe9 */ x86emuOp_jump_near_IMM,
+ /*  0xea */ x86emuOp_jump_far_IMM,
+@@ -11676,7 +12288,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0xed */ x86emuOp_in_word_AX_DX,
+ /*  0xee */ x86emuOp_out_byte_DX_AL,
+ /*  0xef */ x86emuOp_out_word_DX_AX,
+-
+ /*  0xf0 */ x86emuOp_lock,
+ /*  0xf1 */ x86emuOp_illegal_op,
+ /*  0xf2 */ x86emuOp_repne,
+@@ -11685,7 +12296,6 @@ void (*x86emu_optab[256])(u8) =
+ /*  0xf5 */ x86emuOp_cmc,
+ /*  0xf6 */ x86emuOp_opcF6_byte_RM,
+ /*  0xf7 */ x86emuOp_opcF7_word_RM,
+-
+ /*  0xf8 */ x86emuOp_clc,
+ /*  0xf9 */ x86emuOp_stc,
+ /*  0xfa */ x86emuOp_cli,
+diff --git a/libs/x86emu/ops2.c b/libs/x86emu/ops2.c
+index 06b7f56..5ed2bf6 100644
+--- a/libs/x86emu/ops2.c
++++ b/libs/x86emu/ops2.c
+@@ -55,16 +55,14 @@ op1 - Instruction op code
+ REMARKS:
+ Handles illegal opcodes.
+ ****************************************************************************/
+-static void x86emuOp2_illegal_op(
+-	u8 op2)
++static void
++x86emuOp2_illegal_op(u8 op2)
+ {
+-	int mod, rl, rh;
+-	START_OF_INSTR();
+-	FETCH_DECODE_MODRM(mod, rh, rl);
+-	DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
+-	TRACE_REGS();
+-	printk("%04x:%04x: %02X /%d ILLEGAL EXTENDED X86 OPCODE! (mod=%d rl=%d)\n",
+-		M.x86.R_CS, M.x86.R_IP-2,op2, rh, mod, rl);
++    START_OF_INSTR();
++    DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
++    TRACE_REGS();
++    printk("%04x:%04x: %02X ILLEGAL EXTENDED X86 OPCODE!\n",
++           M.x86.R_CS, M.x86.R_IP - 2, op2);
+     HALT_SYS();
+     END_OF_INSTR();
+ }
+@@ -73,55 +71,10 @@ static void x86emuOp2_illegal_op(
+ 
+ /****************************************************************************
+ REMARKS:
+-Handles opcode 0x0f,0x01
+-****************************************************************************/
+-static void x86emuOp2_group_g(u8 X86EMU_UNUSED(op2))
+-{
+-	int mod, rl, rh;
+-	u16 *destreg;
+-	uint destoffset;
+-
+-	START_OF_INSTR();
+-	FETCH_DECODE_MODRM(mod, rh, rl);
+-	switch (rh) {
+-		case 4: // SMSW (Store Machine Status Word)
+-			// Decode the mod byte to find the addressing
+-			// Always returns 0x10 (initial value as per intel manual volume 3, figure 8-1
+-			switch (mod) {
+-				case 0:
+-					destoffset = decode_rm00_address(rl);
+-					store_data_word(destoffset, 0x10);
+-					break;
+-				case 1:
+-					destoffset = decode_rm01_address(rl);
+-					store_data_word(destoffset, 0x10);
+-					break;
+-				case 2:
+-					destoffset = decode_rm10_address(rl);
+-					store_data_word(destoffset, 0x10);
+-					break;
+-				case 3:
+-					destreg = DECODE_RM_WORD_REGISTER(rl);
+-					*destreg = 0x10;
+-					break;
+-			}
+-			break;
+-		default:
+-			DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE IN 0F 01\n");
+-			TRACE_REGS();
+-			printk("%04x:%04x: 0F %02X /%d ILLEGAL EXTENDED X86 OPCODE! (mod=%d rl=%d)\n",
+-				M.x86.R_CS, M.x86.R_IP-2,op2, rh, mod, rl);
+-			HALT_SYS();
+-			break;
+-	}
+-	END_OF_INSTR();
+-}
+-
+-/****************************************************************************
+-REMARKS:
+ Handles opcode 0x0f,0x31
+ ****************************************************************************/
+-static void x86emuOp2_rdtsc(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_rdtsc(u8 X86EMU_UNUSED(op2))
+ {
+ #ifdef __HAS_LONG_LONG__
+     static u64 counter = 0;
+@@ -155,90 +108,91 @@ static void x86emuOp2_rdtsc(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0x80-0x8F
+ ****************************************************************************/
+-static void x86emuOp2_long_jump(u8 op2)
++static void
++x86emuOp2_long_jump(u8 op2)
+ {
+     s32 target;
+-    char *name = 0;
++    const char *name = NULL;
+     int cond = 0;
+ 
+     /* conditional jump to word offset. */
+     START_OF_INSTR();
+     switch (op2) {
+-      case 0x80:
++    case 0x80:
+         name = "JO\t";
+-        cond =  ACCESS_FLAG(F_OF);
++        cond = ACCESS_FLAG(F_OF);
+         break;
+-      case 0x81:
++    case 0x81:
+         name = "JNO\t";
+         cond = !ACCESS_FLAG(F_OF);
+         break;
+-      case 0x82:
++    case 0x82:
+         name = "JB\t";
+         cond = ACCESS_FLAG(F_CF);
+         break;
+-      case 0x83:
++    case 0x83:
+         name = "JNB\t";
+         cond = !ACCESS_FLAG(F_CF);
+         break;
+-      case 0x84:
++    case 0x84:
+         name = "JZ\t";
+         cond = ACCESS_FLAG(F_ZF);
+         break;
+-      case 0x85:
++    case 0x85:
+         name = "JNZ\t";
+         cond = !ACCESS_FLAG(F_ZF);
+         break;
+-      case 0x86:
++    case 0x86:
+         name = "JBE\t";
+         cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
+         break;
+-      case 0x87:
++    case 0x87:
+         name = "JNBE\t";
+         cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
+         break;
+-      case 0x88:
++    case 0x88:
+         name = "JS\t";
+         cond = ACCESS_FLAG(F_SF);
+         break;
+-      case 0x89:
++    case 0x89:
+         name = "JNS\t";
+         cond = !ACCESS_FLAG(F_SF);
+         break;
+-      case 0x8a:
++    case 0x8a:
+         name = "JP\t";
+         cond = ACCESS_FLAG(F_PF);
+         break;
+-      case 0x8b:
++    case 0x8b:
+         name = "JNP\t";
+         cond = !ACCESS_FLAG(F_PF);
+         break;
+-      case 0x8c:
++    case 0x8c:
+         name = "JL\t";
+         cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+         break;
+-      case 0x8d:
++    case 0x8d:
+         name = "JNL\t";
+         cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)));
+         break;
+-      case 0x8e:
++    case 0x8e:
+         name = "JLE\t";
+         cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+                 ACCESS_FLAG(F_ZF));
+         break;
+-      case 0x8f:
++    case 0x8f:
+         name = "JNLE\t";
+         cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+                  ACCESS_FLAG(F_ZF));
+         break;
+     }
+     DECODE_PRINTF(name);
+-    (void)name;
++    (void) name;
+     target = (s16) fetch_word_imm();
+     target += (s16) M.x86.R_IP;
+     DECODE_PRINTF2("%04x\n", target);
+     TRACE_AND_STEP();
+     if (cond)
+-        M.x86.R_IP = (u16)target;
++        M.x86.R_IP = (u16) target;
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+ }
+@@ -247,85 +201,86 @@ static void x86emuOp2_long_jump(u8 op2)
+ REMARKS:
+ Handles opcode 0x0f,0x90-0x9F
+ ****************************************************************************/
+-static void x86emuOp2_set_byte(u8 op2)
++static void
++x86emuOp2_set_byte(u8 op2)
+ {
+     int mod, rl, rh;
+     uint destoffset;
+-    u8  *destreg;
+-    char *name = 0;
++    u8 *destreg;
++    const char *name = NULL;
+     int cond = 0;
+ 
+     START_OF_INSTR();
+     switch (op2) {
+-      case 0x90:
++    case 0x90:
+         name = "SETO\t";
+-        cond =  ACCESS_FLAG(F_OF);
++        cond = ACCESS_FLAG(F_OF);
+         break;
+-      case 0x91:
++    case 0x91:
+         name = "SETNO\t";
+         cond = !ACCESS_FLAG(F_OF);
+         break;
+-      case 0x92:
++    case 0x92:
+         name = "SETB\t";
+         cond = ACCESS_FLAG(F_CF);
+         break;
+-      case 0x93:
++    case 0x93:
+         name = "SETNB\t";
+         cond = !ACCESS_FLAG(F_CF);
+         break;
+-      case 0x94:
++    case 0x94:
+         name = "SETZ\t";
+         cond = ACCESS_FLAG(F_ZF);
+         break;
+-      case 0x95:
++    case 0x95:
+         name = "SETNZ\t";
+         cond = !ACCESS_FLAG(F_ZF);
+         break;
+-      case 0x96:
++    case 0x96:
+         name = "SETBE\t";
+         cond = ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF);
+         break;
+-      case 0x97:
++    case 0x97:
+         name = "SETNBE\t";
+         cond = !(ACCESS_FLAG(F_CF) || ACCESS_FLAG(F_ZF));
+         break;
+-      case 0x98:
++    case 0x98:
+         name = "SETS\t";
+         cond = ACCESS_FLAG(F_SF);
+         break;
+-      case 0x99:
++    case 0x99:
+         name = "SETNS\t";
+         cond = !ACCESS_FLAG(F_SF);
+         break;
+-      case 0x9a:
++    case 0x9a:
+         name = "SETP\t";
+         cond = ACCESS_FLAG(F_PF);
+         break;
+-      case 0x9b:
++    case 0x9b:
+         name = "SETNP\t";
+         cond = !ACCESS_FLAG(F_PF);
+         break;
+-      case 0x9c:
++    case 0x9c:
+         name = "SETL\t";
+         cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+         break;
+-      case 0x9d:
++    case 0x9d:
+         name = "SETNL\t";
+         cond = xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF));
+         break;
+-      case 0x9e:
++    case 0x9e:
+         name = "SETLE\t";
+         cond = (xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+                 ACCESS_FLAG(F_ZF));
+         break;
+-      case 0x9f:
++    case 0x9f:
+         name = "SETNLE\t";
+         cond = !(xorl(ACCESS_FLAG(F_SF), ACCESS_FLAG(F_OF)) ||
+                  ACCESS_FLAG(F_ZF));
+         break;
+     }
+     DECODE_PRINTF(name);
+-    (void)name;
++    (void) name;
+     FETCH_DECODE_MODRM(mod, rh, rl);
+     switch (mod) {
+     case 0:
+@@ -343,7 +298,7 @@ static void x86emuOp2_set_byte(u8 op2)
+         TRACE_AND_STEP();
+         store_data_byte(destoffset, cond ? 0x01 : 0x00);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_BYTE_REGISTER(rl);
+         TRACE_AND_STEP();
+         *destreg = cond ? 0x01 : 0x00;
+@@ -357,7 +312,8 @@ static void x86emuOp2_set_byte(u8 op2)
+ REMARKS:
+ Handles opcode 0x0f,0xa0
+ ****************************************************************************/
+-static void x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("PUSH\tFS\n");
+@@ -371,7 +327,8 @@ static void x86emuOp2_push_FS(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa1
+ ****************************************************************************/
+-static void x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("POP\tFS\n");
+@@ -385,7 +342,8 @@ static void x86emuOp2_pop_FS(u8 X86EMU_UNUSED(op2))
+ REMARKS: CPUID takes EAX/ECX as inputs, writes EAX/EBX/ECX/EDX as output
+ Handles opcode 0x0f,0xa2
+ ****************************************************************************/
+-static void x86emuOp2_cpuid(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_cpuid(u8 X86EMU_UNUSED(op2))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("CPUID\n");
+@@ -399,11 +357,12 @@ static void x86emuOp2_cpuid(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa3
+ ****************************************************************************/
+-static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+-    int bit,disp;
++    int bit, disp;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("BT\t");
+@@ -419,10 +378,11 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+-            disp = (s16)*shiftreg >> 5;
+-            srcval = fetch_data_long(srcoffset+disp);
+-            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+-        } else {
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
++            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
++        }
++        else {
+             u16 srcval;
+             u16 *shiftreg;
+ 
+@@ -431,9 +391,9 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0xF;
+-            disp = (s16)*shiftreg >> 4;
+-            srcval = fetch_data_word(srcoffset+disp);
+-            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
+         }
+         break;
+     case 1:
+@@ -446,10 +406,11 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+-            disp = (s16)*shiftreg >> 5;
+-            srcval = fetch_data_long(srcoffset+disp);
+-            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+-        } else {
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
++            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
++        }
++        else {
+             u16 srcval;
+             u16 *shiftreg;
+ 
+@@ -458,9 +419,9 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0xF;
+-            disp = (s16)*shiftreg >> 4;
+-            srcval = fetch_data_word(srcoffset+disp);
+-            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
+         }
+         break;
+     case 2:
+@@ -473,10 +434,11 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+-            disp = (s16)*shiftreg >> 5;
+-            srcval = fetch_data_long(srcoffset+disp);
+-            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
+-        } else {
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
++            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
++        }
++        else {
+             u16 srcval;
+             u16 *shiftreg;
+ 
+@@ -485,30 +447,31 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0xF;
+-            disp = (s16)*shiftreg >> 4;
+-            srcval = fetch_data_word(srcoffset+disp);
+-            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit),F_CF);
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            CONDITIONAL_SET_FLAG(srcval & (0x1 << bit), F_CF);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *srcreg,*shiftreg;
++            u32 *srcreg, *shiftreg;
+ 
+             srcreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+-            CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
+-        } else {
+-            u16 *srcreg,*shiftreg;
++            CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit), F_CF);
++        }
++        else {
++            u16 *srcreg, *shiftreg;
+ 
+             srcreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0xF;
+-            CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit),F_CF);
++            CONDITIONAL_SET_FLAG(*srcreg & (0x1 << bit), F_CF);
+         }
+         break;
+     }
+@@ -520,11 +483,12 @@ static void x86emuOp2_bt_R(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa4
+ ****************************************************************************/
+-static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+-	u8 shift;
++    u8 shift;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("SHLD\t");
+@@ -543,9 +507,10 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shld_long(destval,*shiftreg,shift);
++            destval = shld_long(destval, *shiftreg, shift);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -557,7 +522,7 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shld_word(destval,*shiftreg,shift);
++            destval = shld_word(destval, *shiftreg, shift);
+             store_data_word(destoffset, destval);
+         }
+         break;
+@@ -574,9 +539,10 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shld_long(destval,*shiftreg,shift);
++            destval = shld_long(destval, *shiftreg, shift);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -588,7 +554,7 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shld_word(destval,*shiftreg,shift);
++            destval = shld_word(destval, *shiftreg, shift);
+             store_data_word(destoffset, destval);
+         }
+         break;
+@@ -605,9 +571,10 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shld_long(destval,*shiftreg,shift);
++            destval = shld_long(destval, *shiftreg, shift);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -619,13 +586,13 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shld_word(destval,*shiftreg,shift);
++            destval = shld_word(destval, *shiftreg, shift);
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*shiftreg;
++            u32 *destreg, *shiftreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -634,9 +601,10 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+             shift = fetch_byte_imm();
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+-            *destreg = shld_long(*destreg,*shiftreg,shift);
+-        } else {
+-            u16 *destreg,*shiftreg;
++            *destreg = shld_long(*destreg, *shiftreg, shift);
++        }
++        else {
++            u16 *destreg, *shiftreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -645,7 +613,7 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+             shift = fetch_byte_imm();
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+-            *destreg = shld_word(*destreg,*shiftreg,shift);
++            *destreg = shld_word(*destreg, *shiftreg, shift);
+         }
+         break;
+     }
+@@ -657,7 +625,8 @@ static void x86emuOp2_shld_IMM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa5
+ ****************************************************************************/
+-static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -677,9 +646,10 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shld_long(destval,*shiftreg,M.x86.R_CL);
++            destval = shld_long(destval, *shiftreg, M.x86.R_CL);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -689,7 +659,7 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shld_word(destval,*shiftreg,M.x86.R_CL);
++            destval = shld_word(destval, *shiftreg, M.x86.R_CL);
+             store_data_word(destoffset, destval);
+         }
+         break;
+@@ -704,9 +674,10 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shld_long(destval,*shiftreg,M.x86.R_CL);
++            destval = shld_long(destval, *shiftreg, M.x86.R_CL);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -716,7 +687,7 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shld_word(destval,*shiftreg,M.x86.R_CL);
++            destval = shld_word(destval, *shiftreg, M.x86.R_CL);
+             store_data_word(destoffset, destval);
+         }
+         break;
+@@ -731,9 +702,10 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shld_long(destval,*shiftreg,M.x86.R_CL);
++            destval = shld_long(destval, *shiftreg, M.x86.R_CL);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -743,29 +715,30 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shld_word(destval,*shiftreg,M.x86.R_CL);
++            destval = shld_word(destval, *shiftreg, M.x86.R_CL);
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*shiftreg;
++            u32 *destreg, *shiftreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+-            *destreg = shld_long(*destreg,*shiftreg,M.x86.R_CL);
+-        } else {
+-            u16 *destreg,*shiftreg;
++            *destreg = shld_long(*destreg, *shiftreg, M.x86.R_CL);
++        }
++        else {
++            u16 *destreg, *shiftreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+-            *destreg = shld_word(*destreg,*shiftreg,M.x86.R_CL);
++            *destreg = shld_word(*destreg, *shiftreg, M.x86.R_CL);
+         }
+         break;
+     }
+@@ -777,7 +750,8 @@ static void x86emuOp2_shld_CL(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa8
+ ****************************************************************************/
+-static void x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("PUSH\tGS\n");
+@@ -791,7 +765,8 @@ static void x86emuOp2_push_GS(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xa9
+ ****************************************************************************/
+-static void x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("POP\tGS\n");
+@@ -805,11 +780,12 @@ static void x86emuOp2_pop_GS(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xab
+ ****************************************************************************/
+-static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+-    int bit,disp;
++    int bit, disp;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("BTS\t");
+@@ -817,7 +793,7 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+     switch (mod) {
+     case 0:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 srcval,mask;
++            u32 srcval, mask;
+             u32 *shiftreg;
+ 
+             srcoffset = decode_rm00_address(rl);
+@@ -825,13 +801,14 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+-            disp = (s16)*shiftreg >> 5;
+-            srcval = fetch_data_long(srcoffset+disp);
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
+             mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-            store_data_long(srcoffset+disp, srcval | mask);
+-        } else {
+-            u16 srcval,mask;
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_long(srcoffset + disp, srcval | mask);
++        }
++        else {
++            u16 srcval, mask;
+             u16 *shiftreg;
+ 
+             srcoffset = decode_rm00_address(rl);
+@@ -839,16 +816,16 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0xF;
+-            disp = (s16)*shiftreg >> 4;
+-            srcval = fetch_data_word(srcoffset+disp);
+-			mask = (u16)(0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-            store_data_word(srcoffset+disp, srcval | mask);
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_word(srcoffset + disp, srcval | mask);
+         }
+         break;
+     case 1:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 srcval,mask;
++            u32 srcval, mask;
+             u32 *shiftreg;
+ 
+             srcoffset = decode_rm01_address(rl);
+@@ -856,13 +833,14 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+-            disp = (s16)*shiftreg >> 5;
+-            srcval = fetch_data_long(srcoffset+disp);
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
+             mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-            store_data_long(srcoffset+disp, srcval | mask);
+-        } else {
+-            u16 srcval,mask;
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_long(srcoffset + disp, srcval | mask);
++        }
++        else {
++            u16 srcval, mask;
+             u16 *shiftreg;
+ 
+             srcoffset = decode_rm01_address(rl);
+@@ -870,16 +848,16 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0xF;
+-            disp = (s16)*shiftreg >> 4;
+-            srcval = fetch_data_word(srcoffset+disp);
+-			mask = (u16)(0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-            store_data_word(srcoffset+disp, srcval | mask);
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_word(srcoffset + disp, srcval | mask);
+         }
+         break;
+     case 2:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 srcval,mask;
++            u32 srcval, mask;
+             u32 *shiftreg;
+ 
+             srcoffset = decode_rm10_address(rl);
+@@ -887,51 +865,53 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+-            disp = (s16)*shiftreg >> 5;
+-            srcval = fetch_data_long(srcoffset+disp);
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
+             mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-            store_data_long(srcoffset+disp, srcval | mask);
+-        } else {
+-            u16 srcval,mask;
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_long(srcoffset + disp, srcval | mask);
++        }
++        else {
++            u16 srcval, mask;
+             u16 *shiftreg;
+ 
+-			srcoffset = decode_rm10_address(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_WORD_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0xF;
+-			disp = (s16)*shiftreg >> 4;
+-			srcval = fetch_data_word(srcoffset+disp);
+-			mask = (u16)(0x1 << bit);
+-			CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-			store_data_word(srcoffset+disp, srcval | mask);
+-		}
+-		break;
+-	case 3:                     /* register to register */
+-		if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-			u32 *srcreg,*shiftreg;
+-			u32 mask;
+-
+-			srcreg = DECODE_RM_LONG_REGISTER(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_LONG_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0x1F;
+-			mask = (0x1 << bit);
+-			CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+-			*srcreg |= mask;
+-		} else {
+-			u16 *srcreg,*shiftreg;
+-			u16 mask;
+-
+-			srcreg = DECODE_RM_WORD_REGISTER(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_WORD_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0xF;
+-			mask = (u16)(0x1 << bit);
+-            CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
++            srcoffset = decode_rm10_address(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0xF;
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_word(srcoffset + disp, srcval | mask);
++        }
++        break;
++    case 3:                    /* register to register */
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 *srcreg, *shiftreg;
++            u32 mask;
++
++            srcreg = DECODE_RM_LONG_REGISTER(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0x1F;
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++            *srcreg |= mask;
++        }
++        else {
++            u16 *srcreg, *shiftreg;
++            u16 mask;
++
++            srcreg = DECODE_RM_WORD_REGISTER(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0xF;
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
+             *srcreg |= mask;
+         }
+         break;
+@@ -944,11 +924,12 @@ static void x86emuOp2_bts_R(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xac
+ ****************************************************************************/
+-static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+-	u8 shift;
++    u8 shift;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("SHLD\t");
+@@ -967,9 +948,10 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shrd_long(destval,*shiftreg,shift);
++            destval = shrd_long(destval, *shiftreg, shift);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -981,7 +963,7 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shrd_word(destval,*shiftreg,shift);
++            destval = shrd_word(destval, *shiftreg, shift);
+             store_data_word(destoffset, destval);
+         }
+         break;
+@@ -998,9 +980,10 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shrd_long(destval,*shiftreg,shift);
++            destval = shrd_long(destval, *shiftreg, shift);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -1012,7 +995,7 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shrd_word(destval,*shiftreg,shift);
++            destval = shrd_word(destval, *shiftreg, shift);
+             store_data_word(destoffset, destval);
+         }
+         break;
+@@ -1029,9 +1012,10 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shrd_long(destval,*shiftreg,shift);
++            destval = shrd_long(destval, *shiftreg, shift);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -1043,13 +1027,13 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shrd_word(destval,*shiftreg,shift);
++            destval = shrd_word(destval, *shiftreg, shift);
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*shiftreg;
++            u32 *destreg, *shiftreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -1058,9 +1042,10 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+             shift = fetch_byte_imm();
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+-            *destreg = shrd_long(*destreg,*shiftreg,shift);
+-        } else {
+-            u16 *destreg,*shiftreg;
++            *destreg = shrd_long(*destreg, *shiftreg, shift);
++        }
++        else {
++            u16 *destreg, *shiftreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+@@ -1069,7 +1054,7 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+             shift = fetch_byte_imm();
+             DECODE_PRINTF2("%d\n", shift);
+             TRACE_AND_STEP();
+-            *destreg = shrd_word(*destreg,*shiftreg,shift);
++            *destreg = shrd_word(*destreg, *shiftreg, shift);
+         }
+         break;
+     }
+@@ -1081,7 +1066,8 @@ static void x86emuOp2_shrd_IMM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xad
+ ****************************************************************************/
+-static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint destoffset;
+@@ -1101,9 +1087,10 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
++            destval = shrd_long(destval, *shiftreg, M.x86.R_CL);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -1113,7 +1100,7 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
++            destval = shrd_word(destval, *shiftreg, M.x86.R_CL);
+             store_data_word(destoffset, destval);
+         }
+         break;
+@@ -1128,9 +1115,10 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
++            destval = shrd_long(destval, *shiftreg, M.x86.R_CL);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -1140,7 +1128,7 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
++            destval = shrd_word(destval, *shiftreg, M.x86.R_CL);
+             store_data_word(destoffset, destval);
+         }
+         break;
+@@ -1155,9 +1143,10 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_long(destoffset);
+-            destval = shrd_long(destval,*shiftreg,M.x86.R_CL);
++            destval = shrd_long(destval, *shiftreg, M.x86.R_CL);
+             store_data_long(destoffset, destval);
+-        } else {
++        }
++        else {
+             u16 destval;
+             u16 *shiftreg;
+ 
+@@ -1167,29 +1156,30 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+             destval = fetch_data_word(destoffset);
+-            destval = shrd_word(destval,*shiftreg,M.x86.R_CL);
++            destval = shrd_word(destval, *shiftreg, M.x86.R_CL);
+             store_data_word(destoffset, destval);
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*shiftreg;
++            u32 *destreg, *shiftreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+-            *destreg = shrd_long(*destreg,*shiftreg,M.x86.R_CL);
+-        } else {
+-            u16 *destreg,*shiftreg;
++            *destreg = shrd_long(*destreg, *shiftreg, M.x86.R_CL);
++        }
++        else {
++            u16 *destreg, *shiftreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",CL\n");
+             TRACE_AND_STEP();
+-            *destreg = shrd_word(*destreg,*shiftreg,M.x86.R_CL);
++            *destreg = shrd_word(*destreg, *shiftreg, M.x86.R_CL);
+         }
+         break;
+     }
+@@ -1201,7 +1191,8 @@ static void x86emuOp2_shrd_CL(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xaf
+ ****************************************************************************/
+-static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -1214,23 +1205,25 @@ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+             u32 srcval;
+-            u32 res_lo,res_hi;
++            u32 res_lo, res_hi;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm00_address(rl);
+             srcval = fetch_data_long(srcoffset);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
++            imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) srcval);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
++            *destreg = (u32) res_lo;
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+             u32 res;
+@@ -1240,38 +1233,41 @@ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+             srcoffset = decode_rm00_address(rl);
+             srcval = fetch_data_word(srcoffset);
+             TRACE_AND_STEP();
+-            res = (s16)*destreg * (s16)srcval;
++            res = (s16) * destreg * (s16) srcval;
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+     case 1:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+             u32 srcval;
+-            u32 res_lo,res_hi;
++            u32 res_lo, res_hi;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm01_address(rl);
+             srcval = fetch_data_long(srcoffset);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
++            imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) srcval);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
++            *destreg = (u32) res_lo;
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+             u32 res;
+@@ -1281,38 +1277,41 @@ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+             srcoffset = decode_rm01_address(rl);
+             srcval = fetch_data_word(srcoffset);
+             TRACE_AND_STEP();
+-            res = (s16)*destreg * (s16)srcval;
++            res = (s16) * destreg * (s16) srcval;
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+     case 2:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+             u32 srcval;
+-            u32 res_lo,res_hi;
++            u32 res_lo, res_hi;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm10_address(rl);
+             srcval = fetch_data_long(srcoffset);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)srcval);
++            imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) srcval);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
++            *destreg = (u32) res_lo;
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+             u32 res;
+@@ -1322,51 +1321,55 @@ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+             srcoffset = decode_rm10_address(rl);
+             srcval = fetch_data_word(srcoffset);
+             TRACE_AND_STEP();
+-            res = (s16)*destreg * (s16)srcval;
++            res = (s16) * destreg * (s16) srcval;
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 *destreg,*srcreg;
+-            u32 res_lo,res_hi;
++            u32 *destreg, *srcreg;
++            u32 res_lo, res_hi;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcreg = DECODE_RM_LONG_REGISTER(rl);
+             TRACE_AND_STEP();
+-            imul_long_direct(&res_lo,&res_hi,(s32)*destreg,(s32)*srcreg);
++            imul_long_direct(&res_lo, &res_hi, (s32) * destreg, (s32) * srcreg);
+             if (res_hi != 0) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u32)res_lo;
+-        } else {
+-            u16 *destreg,*srcreg;
++            *destreg = (u32) res_lo;
++        }
++        else {
++            u16 *destreg, *srcreg;
+             u32 res;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcreg = DECODE_RM_WORD_REGISTER(rl);
+-            res = (s16)*destreg * (s16)*srcreg;
++            res = (s16) * destreg * (s16) * srcreg;
+             if (res > 0xFFFF) {
+                 SET_FLAG(F_CF);
+                 SET_FLAG(F_OF);
+-            } else {
++            }
++            else {
+                 CLEAR_FLAG(F_CF);
+                 CLEAR_FLAG(F_OF);
+             }
+-            *destreg = (u16)res;
++            *destreg = (u16) res;
+         }
+         break;
+     }
+@@ -1378,9 +1381,10 @@ static void x86emuOp2_imul_R_RM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xb2
+ ****************************************************************************/
+-static void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
+ {
+-	int mod, rh, rl;
++    int mod, rh, rl;
+     u16 *dstreg;
+     uint srcoffset;
+ 
+@@ -1415,7 +1419,7 @@ static void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
+         *dstreg = fetch_data_word(srcoffset);
+         M.x86.R_SS = fetch_data_word(srcoffset + 2);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         /* UNDEFINED! */
+         TRACE_AND_STEP();
+     }
+@@ -1427,148 +1431,154 @@ static void x86emuOp2_lss_R_IMM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xb3
+ ****************************************************************************/
+-static void x86emuOp2_btr_R(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_btr_R(u8 X86EMU_UNUSED(op2))
+ {
+-	int mod, rl, rh;
+-	uint srcoffset;
+-	int bit,disp;
+-
+-	START_OF_INSTR();
+-	DECODE_PRINTF("BTR\t");
+-	FETCH_DECODE_MODRM(mod, rh, rl);
+-	switch (mod) {
+-	case 0:
+-		if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-			u32 srcval,mask;
+-			u32 *shiftreg;
+-
+-			srcoffset = decode_rm00_address(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_LONG_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0x1F;
+-			disp = (s16)*shiftreg >> 5;
+-			srcval = fetch_data_long(srcoffset+disp);
+-			mask = (0x1 << bit);
+-			CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-			store_data_long(srcoffset+disp, srcval & ~mask);
+-		} else {
+-			u16 srcval,mask;
+-			u16 *shiftreg;
+-
+-			srcoffset = decode_rm00_address(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_WORD_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0xF;
+-			disp = (s16)*shiftreg >> 4;
+-			srcval = fetch_data_word(srcoffset+disp);
+-			mask = (u16)(0x1 << bit);
+-			CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-			store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
+-		}
+-		break;
+-	case 1:
+-		if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-			u32 srcval,mask;
+-			u32 *shiftreg;
+-
+-			srcoffset = decode_rm01_address(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_LONG_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0x1F;
+-			disp = (s16)*shiftreg >> 5;
+-			srcval = fetch_data_long(srcoffset+disp);
+-			mask = (0x1 << bit);
+-			CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-			store_data_long(srcoffset+disp, srcval & ~mask);
+-		} else {
+-			u16 srcval,mask;
+-			u16 *shiftreg;
+-
+-			srcoffset = decode_rm01_address(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_WORD_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0xF;
+-			disp = (s16)*shiftreg >> 4;
+-			srcval = fetch_data_word(srcoffset+disp);
+-			mask = (u16)(0x1 << bit);
+-			CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-			store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
+-		}
+-		break;
+-	case 2:
+-		if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-			u32 srcval,mask;
+-			u32 *shiftreg;
+-
+-			srcoffset = decode_rm10_address(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_LONG_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0x1F;
+-			disp = (s16)*shiftreg >> 5;
+-			srcval = fetch_data_long(srcoffset+disp);
+-			mask = (0x1 << bit);
+-			CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-			store_data_long(srcoffset+disp, srcval & ~mask);
+-		} else {
+-			u16 srcval,mask;
+-			u16 *shiftreg;
+-
+-			srcoffset = decode_rm10_address(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_WORD_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0xF;
+-			disp = (s16)*shiftreg >> 4;
+-			srcval = fetch_data_word(srcoffset+disp);
+-			mask = (u16)(0x1 << bit);
+-			CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-			store_data_word(srcoffset+disp, (u16)(srcval & ~mask));
+-		}
+-		break;
+-	case 3:                     /* register to register */
+-		if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-			u32 *srcreg,*shiftreg;
+-			u32 mask;
+-
+-			srcreg = DECODE_RM_LONG_REGISTER(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_LONG_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0x1F;
+-			mask = (0x1 << bit);
+-			CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+-			*srcreg &= ~mask;
+-		} else {
+-			u16 *srcreg,*shiftreg;
+-			u16 mask;
+-
+-			srcreg = DECODE_RM_WORD_REGISTER(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_WORD_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0xF;
+-			mask = (u16)(0x1 << bit);
+-			CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+-			*srcreg &= ~mask;
+-		}
+-		break;
+-	}
+-	DECODE_CLEAR_SEGOVR();
+-	END_OF_INSTR();
++    int mod, rl, rh;
++    uint srcoffset;
++    int bit, disp;
++
++    START_OF_INSTR();
++    DECODE_PRINTF("BTR\t");
++    FETCH_DECODE_MODRM(mod, rh, rl);
++    switch (mod) {
++    case 0:
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, mask;
++            u32 *shiftreg;
++
++            srcoffset = decode_rm00_address(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0x1F;
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_long(srcoffset + disp, srcval & ~mask);
++        }
++        else {
++            u16 srcval, mask;
++            u16 *shiftreg;
++
++            srcoffset = decode_rm00_address(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0xF;
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_word(srcoffset + disp, (u16) (srcval & ~mask));
++        }
++        break;
++    case 1:
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, mask;
++            u32 *shiftreg;
++
++            srcoffset = decode_rm01_address(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0x1F;
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_long(srcoffset + disp, srcval & ~mask);
++        }
++        else {
++            u16 srcval, mask;
++            u16 *shiftreg;
++
++            srcoffset = decode_rm01_address(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0xF;
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_word(srcoffset + disp, (u16) (srcval & ~mask));
++        }
++        break;
++    case 2:
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, mask;
++            u32 *shiftreg;
++
++            srcoffset = decode_rm10_address(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0x1F;
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_long(srcoffset + disp, srcval & ~mask);
++        }
++        else {
++            u16 srcval, mask;
++            u16 *shiftreg;
++
++            srcoffset = decode_rm10_address(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0xF;
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_word(srcoffset + disp, (u16) (srcval & ~mask));
++        }
++        break;
++    case 3:                    /* register to register */
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 *srcreg, *shiftreg;
++            u32 mask;
++
++            srcreg = DECODE_RM_LONG_REGISTER(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0x1F;
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++            *srcreg &= ~mask;
++        }
++        else {
++            u16 *srcreg, *shiftreg;
++            u16 mask;
++
++            srcreg = DECODE_RM_WORD_REGISTER(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0xF;
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++            *srcreg &= ~mask;
++        }
++        break;
++    }
++    DECODE_CLEAR_SEGOVR();
++    END_OF_INSTR();
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Handles opcode 0x0f,0xb4
+ ****************************************************************************/
+-static void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
+ {
+-	int mod, rh, rl;
++    int mod, rh, rl;
+     u16 *dstreg;
+     uint srcoffset;
+ 
+@@ -1603,7 +1613,7 @@ static void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
+         *dstreg = fetch_data_word(srcoffset);
+         M.x86.R_FS = fetch_data_word(srcoffset + 2);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         /* UNDEFINED! */
+         TRACE_AND_STEP();
+     }
+@@ -1615,9 +1625,10 @@ static void x86emuOp2_lfs_R_IMM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xb5
+ ****************************************************************************/
+-static void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
+ {
+-	int mod, rh, rl;
++    int mod, rh, rl;
+     u16 *dstreg;
+     uint srcoffset;
+ 
+@@ -1652,7 +1663,7 @@ static void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
+         *dstreg = fetch_data_word(srcoffset);
+         M.x86.R_GS = fetch_data_word(srcoffset + 2);
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         /* UNDEFINED! */
+         TRACE_AND_STEP();
+     }
+@@ -1664,7 +1675,8 @@ static void x86emuOp2_lgs_R_IMM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xb6
+ ****************************************************************************/
+-static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -1685,7 +1697,8 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -1710,7 +1723,8 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -1735,7 +1749,8 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+@@ -1748,10 +1763,10 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+             *destreg = srcval;
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+-            u8  *srcreg;
++            u8 *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -1759,9 +1774,10 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = *srcreg;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+-            u8  *srcreg;
++            u8 *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+@@ -1780,7 +1796,8 @@ static void x86emuOp2_movzx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xb7
+ ****************************************************************************/
+-static void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -1819,7 +1836,7 @@ static void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
+         TRACE_AND_STEP();
+         *destreg = srcval;
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_LONG_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_WORD_REGISTER(rl);
+@@ -1836,7 +1853,8 @@ static void x86emuOp2_movzx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xba
+ ****************************************************************************/
+-static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -1846,23 +1864,23 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+     FETCH_DECODE_MODRM(mod, rh, rl);
+     switch (rh) {
+     case 4:
+-	DECODE_PRINTF("BT\t");
+-	break;
++        DECODE_PRINTF("BT\t");
++        break;
+     case 5:
+-	DECODE_PRINTF("BTS\t");
+-	break;
++        DECODE_PRINTF("BTS\t");
++        break;
+     case 6:
+-	DECODE_PRINTF("BTR\t");
+-	break;
++        DECODE_PRINTF("BTR\t");
++        break;
+     case 7:
+-	DECODE_PRINTF("BTC\t");
+-	break;
++        DECODE_PRINTF("BTC\t");
++        break;
+     default:
+-	DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
+-	TRACE_REGS();
+-	printk("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n",
+-		M.x86.R_CS, M.x86.R_IP-3,op2, (mod<<6)|(rh<<3)|rl);
+-	HALT_SYS();
++        DECODE_PRINTF("ILLEGAL EXTENDED X86 OPCODE\n");
++        TRACE_REGS();
++        printk("%04x:%04x: %02X%02X ILLEGAL EXTENDED X86 OPCODE EXTENSION!\n",
++               M.x86.R_CS, M.x86.R_IP - 3, op2, (mod << 6) | (rh << 3) | rl);
++        HALT_SYS();
+     }
+     switch (mod) {
+     case 0:
+@@ -1876,22 +1894,23 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+             TRACE_AND_STEP();
+             bit = shift & 0x1F;
+             srcval = fetch_data_long(srcoffset);
+-	    mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-	    switch (rh) {
+-	    case 5:
+-		store_data_long(srcoffset, srcval | mask);
+-		break;
+-	    case 6:
+-		store_data_long(srcoffset, srcval & ~mask);
+-		break;
+-	    case 7:
+-		store_data_long(srcoffset, srcval ^ mask);
+-		break;
+-	    default:
+-		break;
+-	    }
+-        } else {
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            switch (rh) {
++            case 5:
++                store_data_long(srcoffset, srcval | mask);
++                break;
++            case 6:
++                store_data_long(srcoffset, srcval & ~mask);
++                break;
++            case 7:
++                store_data_long(srcoffset, srcval ^ mask);
++                break;
++            default:
++                break;
++            }
++        }
++        else {
+             u16 srcval, mask;
+             u8 shift;
+ 
+@@ -1901,21 +1920,21 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+             TRACE_AND_STEP();
+             bit = shift & 0xF;
+             srcval = fetch_data_word(srcoffset);
+-	    mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-	    switch (rh) {
+-	    case 5:
+-		store_data_word(srcoffset, srcval | mask);
+-		break;
+-	    case 6:
+-		store_data_word(srcoffset, srcval & ~mask);
+-		break;
+-	    case 7:
+-		store_data_word(srcoffset, srcval ^ mask);
+-		break;
+-	    default:
+-		break;
+-	    }
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            switch (rh) {
++            case 5:
++                store_data_word(srcoffset, srcval | mask);
++                break;
++            case 6:
++                store_data_word(srcoffset, srcval & ~mask);
++                break;
++            case 7:
++                store_data_word(srcoffset, srcval ^ mask);
++                break;
++            default:
++                break;
++            }
+         }
+         break;
+     case 1:
+@@ -1929,22 +1948,23 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+             TRACE_AND_STEP();
+             bit = shift & 0x1F;
+             srcval = fetch_data_long(srcoffset);
+-	    mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-	    switch (rh) {
+-	    case 5:
+-		store_data_long(srcoffset, srcval | mask);
+-		break;
+-	    case 6:
+-		store_data_long(srcoffset, srcval & ~mask);
+-		break;
+-	    case 7:
+-		store_data_long(srcoffset, srcval ^ mask);
+-		break;
+-	    default:
+-		break;
+-	    }
+-        } else {
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            switch (rh) {
++            case 5:
++                store_data_long(srcoffset, srcval | mask);
++                break;
++            case 6:
++                store_data_long(srcoffset, srcval & ~mask);
++                break;
++            case 7:
++                store_data_long(srcoffset, srcval ^ mask);
++                break;
++            default:
++                break;
++            }
++        }
++        else {
+             u16 srcval, mask;
+             u8 shift;
+ 
+@@ -1954,21 +1974,21 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+             TRACE_AND_STEP();
+             bit = shift & 0xF;
+             srcval = fetch_data_word(srcoffset);
+-	    mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-	    switch (rh) {
+-	    case 5:
+-		store_data_word(srcoffset, srcval | mask);
+-		break;
+-	    case 6:
+-		store_data_word(srcoffset, srcval & ~mask);
+-		break;
+-	    case 7:
+-		store_data_word(srcoffset, srcval ^ mask);
+-		break;
+-	    default:
+-		break;
+-	    }
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            switch (rh) {
++            case 5:
++                store_data_word(srcoffset, srcval | mask);
++                break;
++            case 6:
++                store_data_word(srcoffset, srcval & ~mask);
++                break;
++            case 7:
++                store_data_word(srcoffset, srcval ^ mask);
++                break;
++            default:
++                break;
++            }
+         }
+         break;
+     case 2:
+@@ -1982,22 +2002,23 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+             TRACE_AND_STEP();
+             bit = shift & 0x1F;
+             srcval = fetch_data_long(srcoffset);
+-	    mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-	    switch (rh) {
+-	    case 5:
+-		store_data_long(srcoffset, srcval | mask);
+-		break;
+-	    case 6:
+-		store_data_long(srcoffset, srcval & ~mask);
+-		break;
+-	    case 7:
+-		store_data_long(srcoffset, srcval ^ mask);
+-		break;
+-	    default:
+-		break;
+-	    }
+-        } else {
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            switch (rh) {
++            case 5:
++                store_data_long(srcoffset, srcval | mask);
++                break;
++            case 6:
++                store_data_long(srcoffset, srcval & ~mask);
++                break;
++            case 7:
++                store_data_long(srcoffset, srcval ^ mask);
++                break;
++            default:
++                break;
++            }
++        }
++        else {
+             u16 srcval, mask;
+             u8 shift;
+ 
+@@ -2007,74 +2028,75 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+             TRACE_AND_STEP();
+             bit = shift & 0xF;
+             srcval = fetch_data_word(srcoffset);
+-	    mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-	    switch (rh) {
+-	    case 5:
+-		store_data_word(srcoffset, srcval | mask);
+-		break;
+-	    case 6:
+-		store_data_word(srcoffset, srcval & ~mask);
+-		break;
+-	    case 7:
+-		store_data_word(srcoffset, srcval ^ mask);
+-		break;
+-	    default:
+-		break;
+-	    }
+-        }
+-        break;
+-    case 3:                     /* register to register */
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            switch (rh) {
++            case 5:
++                store_data_word(srcoffset, srcval | mask);
++                break;
++            case 6:
++                store_data_word(srcoffset, srcval & ~mask);
++                break;
++            case 7:
++                store_data_word(srcoffset, srcval ^ mask);
++                break;
++            default:
++                break;
++            }
++        }
++        break;
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *srcreg;
+-	    u32 mask;
+-	    u8 shift;
++            u32 mask;
++            u8 shift;
+ 
+             srcreg = DECODE_RM_LONG_REGISTER(rl);
+             DECODE_PRINTF(",");
+             shift = fetch_byte_imm();
+             TRACE_AND_STEP();
+             bit = shift & 0x1F;
+-	    mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+-	    switch (rh) {
+-	    case 5:
+-		*srcreg |= mask;
+-		break;
+-	    case 6:
+-		*srcreg &= ~mask;
+-		break;
+-	    case 7:
+-		*srcreg ^= mask;
+-		break;
+-	    default:
+-		break;
+-	    }
+-        } else {
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++            switch (rh) {
++            case 5:
++                *srcreg |= mask;
++                break;
++            case 6:
++                *srcreg &= ~mask;
++                break;
++            case 7:
++                *srcreg ^= mask;
++                break;
++            default:
++                break;
++            }
++        }
++        else {
+             u16 *srcreg;
+-	    u16 mask;
+-	    u8 shift;
++            u16 mask;
++            u8 shift;
+ 
+             srcreg = DECODE_RM_WORD_REGISTER(rl);
+             DECODE_PRINTF(",");
+             shift = fetch_byte_imm();
+             TRACE_AND_STEP();
+             bit = shift & 0xF;
+-	    mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+-	    switch (rh) {
+-	    case 5:
+-		*srcreg |= mask;
+-		break;
+-	    case 6:
+-		*srcreg &= ~mask;
+-		break;
+-	    case 7:
+-		*srcreg ^= mask;
+-		break;
+-	    default:
+-		break;
+-	    }
++            mask = (0x1 << bit);
++            CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++            switch (rh) {
++            case 5:
++                *srcreg |= mask;
++                break;
++            case 6:
++                *srcreg &= ~mask;
++                break;
++            case 7:
++                *srcreg ^= mask;
++                break;
++            default:
++                break;
++            }
+         }
+         break;
+     }
+@@ -2086,11 +2108,12 @@ static void x86emuOp2_btX_I(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xbb
+ ****************************************************************************/
+-static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+-    int bit,disp;
++    int bit, disp;
+ 
+     START_OF_INSTR();
+     DECODE_PRINTF("BTC\t");
+@@ -2098,7 +2121,7 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+     switch (mod) {
+     case 0:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 srcval,mask;
++            u32 srcval, mask;
+             u32 *shiftreg;
+ 
+             srcoffset = decode_rm00_address(rl);
+@@ -2106,13 +2129,14 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+-            disp = (s16)*shiftreg >> 5;
+-            srcval = fetch_data_long(srcoffset+disp);
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
+             mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-            store_data_long(srcoffset+disp, srcval ^ mask);
+-        } else {
+-            u16 srcval,mask;
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_long(srcoffset + disp, srcval ^ mask);
++        }
++        else {
++            u16 srcval, mask;
+             u16 *shiftreg;
+ 
+             srcoffset = decode_rm00_address(rl);
+@@ -2120,16 +2144,16 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0xF;
+-            disp = (s16)*shiftreg >> 4;
+-            srcval = fetch_data_word(srcoffset+disp);
+-			mask = (u16)(0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-			store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_word(srcoffset + disp, (u16) (srcval ^ mask));
+         }
+         break;
+     case 1:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 srcval,mask;
++            u32 srcval, mask;
+             u32 *shiftreg;
+ 
+             srcoffset = decode_rm01_address(rl);
+@@ -2137,13 +2161,14 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+-            disp = (s16)*shiftreg >> 5;
+-            srcval = fetch_data_long(srcoffset+disp);
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
+             mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-            store_data_long(srcoffset+disp, srcval ^ mask);
+-        } else {
+-            u16 srcval,mask;
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_long(srcoffset + disp, srcval ^ mask);
++        }
++        else {
++            u16 srcval, mask;
+             u16 *shiftreg;
+ 
+             srcoffset = decode_rm01_address(rl);
+@@ -2151,16 +2176,16 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0xF;
+-            disp = (s16)*shiftreg >> 4;
+-            srcval = fetch_data_word(srcoffset+disp);
+-			mask = (u16)(0x1 << bit);
+-			CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-			store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_word(srcoffset + disp, (u16) (srcval ^ mask));
+         }
+         break;
+     case 2:
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-            u32 srcval,mask;
++            u32 srcval, mask;
+             u32 *shiftreg;
+ 
+             srcoffset = decode_rm10_address(rl);
+@@ -2168,13 +2193,14 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_LONG_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+-            disp = (s16)*shiftreg >> 5;
+-            srcval = fetch_data_long(srcoffset+disp);
++            disp = (s16) * shiftreg >> 5;
++            srcval = fetch_data_long(srcoffset + disp);
+             mask = (0x1 << bit);
+-            CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-            store_data_long(srcoffset+disp, srcval ^ mask);
+-        } else {
+-            u16 srcval,mask;
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_long(srcoffset + disp, srcval ^ mask);
++        }
++        else {
++            u16 srcval, mask;
+             u16 *shiftreg;
+ 
+             srcoffset = decode_rm10_address(rl);
+@@ -2182,16 +2208,16 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+             shiftreg = DECODE_RM_WORD_REGISTER(rh);
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0xF;
+-            disp = (s16)*shiftreg >> 4;
+-            srcval = fetch_data_word(srcoffset+disp);
+-			mask = (u16)(0x1 << bit);
+-			CONDITIONAL_SET_FLAG(srcval & mask,F_CF);
+-			store_data_word(srcoffset+disp, (u16)(srcval ^ mask));
++            disp = (s16) * shiftreg >> 4;
++            srcval = fetch_data_word(srcoffset + disp);
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(srcval & mask, F_CF);
++            store_data_word(srcoffset + disp, (u16) (srcval ^ mask));
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-			u32 *srcreg,*shiftreg;
++            u32 *srcreg, *shiftreg;
+             u32 mask;
+ 
+             srcreg = DECODE_RM_LONG_REGISTER(rl);
+@@ -2200,19 +2226,20 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+             TRACE_AND_STEP();
+             bit = *shiftreg & 0x1F;
+             mask = (0x1 << bit);
+-			CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
+-			*srcreg ^= mask;
+-		} else {
+-			u16 *srcreg,*shiftreg;
+-			u16 mask;
+-
+-			srcreg = DECODE_RM_WORD_REGISTER(rl);
+-			DECODE_PRINTF(",");
+-			shiftreg = DECODE_RM_WORD_REGISTER(rh);
+-			TRACE_AND_STEP();
+-			bit = *shiftreg & 0xF;
+-			mask = (u16)(0x1 << bit);
+-            CONDITIONAL_SET_FLAG(*srcreg & mask,F_CF);
++            CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
++            *srcreg ^= mask;
++        }
++        else {
++            u16 *srcreg, *shiftreg;
++            u16 mask;
++
++            srcreg = DECODE_RM_WORD_REGISTER(rl);
++            DECODE_PRINTF(",");
++            shiftreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            bit = *shiftreg & 0xF;
++            mask = (u16) (0x1 << bit);
++            CONDITIONAL_SET_FLAG(*srcreg & mask, F_CF);
+             *srcreg ^= mask;
+         }
+         break;
+@@ -2225,7 +2252,8 @@ static void x86emuOp2_btc_R(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xbc
+ ****************************************************************************/
+-static void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -2233,105 +2261,117 @@ static void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
+     START_OF_INSTR();
+     DECODE_PRINTF("BSF\t");
+     FETCH_DECODE_MODRM(mod, rh, rl);
+-    switch(mod) {
++    switch (mod) {
+     case 0:
+-	if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-	    u32 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm00_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_LONG_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_long(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+-		if ((srcval >> *dstreg) & 1) break;
+-	} else {
+-	    u16 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm00_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_WORD_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_word(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+-		if ((srcval >> *dstreg) & 1) break;
+-	}
+-	break;
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, *dstreg;
++
++            srcoffset = decode_rm00_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_long(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 0; *dstreg < 32; (*dstreg)++)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        else {
++            u16 srcval, *dstreg;
++
++            srcoffset = decode_rm00_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_word(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 0; *dstreg < 16; (*dstreg)++)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        break;
+     case 1:
+-	if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-	    u32 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm01_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_LONG_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_long(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+-		if ((srcval >> *dstreg) & 1) break;
+-	} else {
+-	    u16 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm01_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_WORD_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_word(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+-		if ((srcval >> *dstreg) & 1) break;
+-	}
+-	break;
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, *dstreg;
++
++            srcoffset = decode_rm01_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_long(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 0; *dstreg < 32; (*dstreg)++)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        else {
++            u16 srcval, *dstreg;
++
++            srcoffset = decode_rm01_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_word(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 0; *dstreg < 16; (*dstreg)++)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        break;
+     case 2:
+-	if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-	    u32 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm10_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_LONG_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_long(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+-		if ((srcval >> *dstreg) & 1) break;
+-	} else {
+-	    u16 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm10_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_WORD_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_word(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+-		if ((srcval >> *dstreg) & 1) break;
+-	}
+-	break;
+-    case 3:				/* register to register */
+-	if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-	    u32 srcval, *dstreg;
+-
+-	    srcval = *DECODE_RM_LONG_REGISTER(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_LONG_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 0; *dstreg < 32; (*dstreg)++)
+-		if ((srcval >> *dstreg) & 1) break;
+-	} else {
+-	    u16 srcval, *dstreg;
+-
+-	    srcval = *DECODE_RM_WORD_REGISTER(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_WORD_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 0; *dstreg < 16; (*dstreg)++)
+-		if ((srcval >> *dstreg) & 1) break;
+-	}
+-	break;
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, *dstreg;
++
++            srcoffset = decode_rm10_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_long(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 0; *dstreg < 32; (*dstreg)++)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        else {
++            u16 srcval, *dstreg;
++
++            srcoffset = decode_rm10_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_word(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 0; *dstreg < 16; (*dstreg)++)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        break;
++    case 3:                    /* register to register */
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, *dstreg;
++
++            srcval = *DECODE_RM_LONG_REGISTER(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 0; *dstreg < 32; (*dstreg)++)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        else {
++            u16 srcval, *dstreg;
++
++            srcval = *DECODE_RM_WORD_REGISTER(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 0; *dstreg < 16; (*dstreg)++)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        break;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -2341,7 +2381,8 @@ static void x86emuOp2_bsf(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xbd
+ ****************************************************************************/
+-static void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -2349,105 +2390,117 @@ static void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
+     START_OF_INSTR();
+     DECODE_PRINTF("BSR\t");
+     FETCH_DECODE_MODRM(mod, rh, rl);
+-    switch(mod) {
++    switch (mod) {
+     case 0:
+-	if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-	    u32 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm00_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_LONG_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_long(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+-		if ((srcval >> *dstreg) & 1) break;
+-	} else {
+-	    u16 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm00_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_WORD_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_word(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+-		if ((srcval >> *dstreg) & 1) break;
+-	}
+-	break;
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, *dstreg;
++
++            srcoffset = decode_rm00_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_long(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 31; *dstreg > 0; (*dstreg)--)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        else {
++            u16 srcval, *dstreg;
++
++            srcoffset = decode_rm00_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_word(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 15; *dstreg > 0; (*dstreg)--)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        break;
+     case 1:
+-	if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-	    u32 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm01_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_LONG_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_long(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+-		if ((srcval >> *dstreg) & 1) break;
+-	} else {
+-	    u16 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm01_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_WORD_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_word(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+-		if ((srcval >> *dstreg) & 1) break;
+-	}
+-	break;
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, *dstreg;
++
++            srcoffset = decode_rm01_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_long(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 31; *dstreg > 0; (*dstreg)--)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        else {
++            u16 srcval, *dstreg;
++
++            srcoffset = decode_rm01_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_word(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 15; *dstreg > 0; (*dstreg)--)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        break;
+     case 2:
+-	if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-	    u32 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm10_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_LONG_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_long(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+-		if ((srcval >> *dstreg) & 1) break;
+-	} else {
+-	    u16 srcval, *dstreg;
+-
+-	    srcoffset = decode_rm10_address(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_WORD_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    srcval = fetch_data_word(srcoffset);
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+-		if ((srcval >> *dstreg) & 1) break;
+-	}
+-	break;
+-    case 3:				/* register to register */
+-	if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-	    u32 srcval, *dstreg;
+-
+-	    srcval = *DECODE_RM_LONG_REGISTER(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_LONG_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 31; *dstreg > 0; (*dstreg)--)
+-		if ((srcval >> *dstreg) & 1) break;
+-	} else {
+-	    u16 srcval, *dstreg;
+-
+-	    srcval = *DECODE_RM_WORD_REGISTER(rl);
+-	    DECODE_PRINTF(",");
+-	    dstreg = DECODE_RM_WORD_REGISTER(rh);
+-	    TRACE_AND_STEP();
+-	    CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
+-	    for(*dstreg = 15; *dstreg > 0; (*dstreg)--)
+-		if ((srcval >> *dstreg) & 1) break;
+-	}
+-	break;
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, *dstreg;
++
++            srcoffset = decode_rm10_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_long(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 31; *dstreg > 0; (*dstreg)--)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        else {
++            u16 srcval, *dstreg;
++
++            srcoffset = decode_rm10_address(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            srcval = fetch_data_word(srcoffset);
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 15; *dstreg > 0; (*dstreg)--)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        break;
++    case 3:                    /* register to register */
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            u32 srcval, *dstreg;
++
++            srcval = *DECODE_RM_LONG_REGISTER(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_LONG_REGISTER(rh);
++            TRACE_AND_STEP();
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 31; *dstreg > 0; (*dstreg)--)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        else {
++            u16 srcval, *dstreg;
++
++            srcval = *DECODE_RM_WORD_REGISTER(rl);
++            DECODE_PRINTF(",");
++            dstreg = DECODE_RM_WORD_REGISTER(rh);
++            TRACE_AND_STEP();
++            CONDITIONAL_SET_FLAG(srcval == 0, F_ZF);
++            for (*dstreg = 15; *dstreg > 0; (*dstreg)--)
++                if ((srcval >> *dstreg) & 1)
++                    break;
++        }
++        break;
+     }
+     DECODE_CLEAR_SEGOVR();
+     END_OF_INSTR();
+@@ -2457,7 +2510,8 @@ static void x86emuOp2_bsr(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xbe
+ ****************************************************************************/
+-static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -2474,18 +2528,19 @@ static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm00_address(rl);
+-            srcval = (s32)((s8)fetch_data_byte(srcoffset));
++            srcval = (s32) ((s8) fetch_data_byte(srcoffset));
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm00_address(rl);
+-            srcval = (s16)((s8)fetch_data_byte(srcoffset));
++            srcval = (s16) ((s8) fetch_data_byte(srcoffset));
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+@@ -2499,18 +2554,19 @@ static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm01_address(rl);
+-            srcval = (s32)((s8)fetch_data_byte(srcoffset));
++            srcval = (s32) ((s8) fetch_data_byte(srcoffset));
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm01_address(rl);
+-            srcval = (s16)((s8)fetch_data_byte(srcoffset));
++            srcval = (s16) ((s8) fetch_data_byte(srcoffset));
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+@@ -2524,44 +2580,46 @@ static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm10_address(rl);
+-            srcval = (s32)((s8)fetch_data_byte(srcoffset));
++            srcval = (s32) ((s8) fetch_data_byte(srcoffset));
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+-        } else {
++        }
++        else {
+             u16 *destreg;
+             u16 srcval;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcoffset = decode_rm10_address(rl);
+-            srcval = (s16)((s8)fetch_data_byte(srcoffset));
++            srcval = (s16) ((s8) fetch_data_byte(srcoffset));
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+             *destreg = srcval;
+         }
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+             u32 *destreg;
+-            u8  *srcreg;
++            u8 *srcreg;
+ 
+             destreg = DECODE_RM_LONG_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcreg = DECODE_RM_BYTE_REGISTER(rl);
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+-            *destreg = (s32)((s8)*srcreg);
+-        } else {
++            *destreg = (s32) ((s8) * srcreg);
++        }
++        else {
+             u16 *destreg;
+-            u8  *srcreg;
++            u8 *srcreg;
+ 
+             destreg = DECODE_RM_WORD_REGISTER(rh);
+             DECODE_PRINTF(",");
+             srcreg = DECODE_RM_BYTE_REGISTER(rl);
+             DECODE_PRINTF("\n");
+             TRACE_AND_STEP();
+-            *destreg = (s16)((s8)*srcreg);
++            *destreg = (s16) ((s8) * srcreg);
+         }
+         break;
+     }
+@@ -2573,7 +2631,8 @@ static void x86emuOp2_movsx_byte_R_RM(u8 X86EMU_UNUSED(op2))
+ REMARKS:
+ Handles opcode 0x0f,0xbf
+ ****************************************************************************/
+-static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ {
+     int mod, rl, rh;
+     uint srcoffset;
+@@ -2589,7 +2648,7 @@ static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+         destreg = DECODE_RM_LONG_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcoffset = decode_rm00_address(rl);
+-        srcval = (s32)((s16)fetch_data_word(srcoffset));
++        srcval = (s32) ((s16) fetch_data_word(srcoffset));
+         DECODE_PRINTF("\n");
+         TRACE_AND_STEP();
+         *destreg = srcval;
+@@ -2598,7 +2657,7 @@ static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+         destreg = DECODE_RM_LONG_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcoffset = decode_rm01_address(rl);
+-        srcval = (s32)((s16)fetch_data_word(srcoffset));
++        srcval = (s32) ((s16) fetch_data_word(srcoffset));
+         DECODE_PRINTF("\n");
+         TRACE_AND_STEP();
+         *destreg = srcval;
+@@ -2607,18 +2666,18 @@ static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+         destreg = DECODE_RM_LONG_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcoffset = decode_rm10_address(rl);
+-        srcval = (s32)((s16)fetch_data_word(srcoffset));
++        srcval = (s32) ((s16) fetch_data_word(srcoffset));
+         DECODE_PRINTF("\n");
+         TRACE_AND_STEP();
+         *destreg = srcval;
+         break;
+-    case 3:                     /* register to register */
++    case 3:                    /* register to register */
+         destreg = DECODE_RM_LONG_REGISTER(rh);
+         DECODE_PRINTF(",");
+         srcreg = DECODE_RM_WORD_REGISTER(rl);
+         DECODE_PRINTF("\n");
+         TRACE_AND_STEP();
+-        *destreg = (s32)((s16)*srcreg);
++        *destreg = (s32) ((s16) * srcreg);
+         break;
+     }
+     DECODE_CLEAR_SEGOVR();
+@@ -2626,40 +2685,41 @@ static void x86emuOp2_movsx_word_R_RM(u8 X86EMU_UNUSED(op2))
+ }
+ 
+ /* Handles opcodes 0xc8-0xcf */
+-static void x86emuOp2_bswap(u8 X86EMU_UNUSED(op2))
++static void
++x86emuOp2_bswap(u8 X86EMU_UNUSED(op2))
+ {
+     START_OF_INSTR();
+     DECODE_PRINTF("BSWAP\n");
+     TRACE_AND_STEP();
+ 
+     switch (op2) {
+-	case 0xc8:
+-	    M.x86.R_EAX = bswap_32(M.x86.R_EAX);
+-	    break;
+-	case 0xc9:
+-	    M.x86.R_ECX = bswap_32(M.x86.R_ECX);
+-	    break;
+-	case 0xca:
+-	    M.x86.R_EDX = bswap_32(M.x86.R_EDX);
+-	    break;
+-	case 0xcb:
+-	    M.x86.R_EBX = bswap_32(M.x86.R_EBX);
+-	    break;
+-	case 0xcc:
+-	    M.x86.R_ESP = bswap_32(M.x86.R_ESP);
+-	    break;
+-	case 0xcd:
+-	    M.x86.R_EBP = bswap_32(M.x86.R_EBP);
+-	    break;
+-	case 0xce:
+-	    M.x86.R_ESI = bswap_32(M.x86.R_ESI);
+-	    break;
+-	case 0xcf:
+-	    M.x86.R_EDI = bswap_32(M.x86.R_EDI);
+-	    break;
+-	default:
+-	    /* can't happen */
+-	    break;
++    case 0xc8:
++        M.x86.R_EAX = bswap_32(M.x86.R_EAX);
++        break;
++    case 0xc9:
++        M.x86.R_ECX = bswap_32(M.x86.R_ECX);
++        break;
++    case 0xca:
++        M.x86.R_EDX = bswap_32(M.x86.R_EDX);
++        break;
++    case 0xcb:
++        M.x86.R_EBX = bswap_32(M.x86.R_EBX);
++        break;
++    case 0xcc:
++        M.x86.R_ESP = bswap_32(M.x86.R_ESP);
++        break;
++    case 0xcd:
++        M.x86.R_EBP = bswap_32(M.x86.R_EBP);
++        break;
++    case 0xce:
++        M.x86.R_ESI = bswap_32(M.x86.R_ESI);
++        break;
++    case 0xcf:
++        M.x86.R_EDI = bswap_32(M.x86.R_EDI);
++        break;
++    default:
++        /* can't happen */
++        break;
+     }
+ 
+     DECODE_CLEAR_SEGOVR();
+@@ -2669,25 +2729,32 @@ static void x86emuOp2_bswap(u8 X86EMU_UNUSED(op2))
+ /***************************************************************************
+  * Double byte operation code table:
+  **************************************************************************/
+-void (*x86emu_optab2[256])(u8) =
+-{
+-/*  0x00 */ x86emuOp2_illegal_op,  /* Group F (ring 0 PM)      */
+-/*  0x01 */ x86emuOp2_group_g,     /* Group G (ring 0 PM)      */
+-/*  0x02 */ x86emuOp2_illegal_op,  /* lar (ring 0 PM)          */
+-/*  0x03 */ x86emuOp2_illegal_op,  /* lsl (ring 0 PM)          */
++void (*x86emu_optab2[256]) (u8) = {
++                                        /*  0x00 */ x86emuOp2_illegal_op,
++                                        /* Group F (ring 0 PM)      */
++                                                /*  0x01 */ x86emuOp2_illegal_op,
++                                                /* Group G (ring 0 PM)      */
++                                                /*  0x02 */ x86emuOp2_illegal_op,
++                                                /* lar (ring 0 PM)          */
++                                                /*  0x03 */ x86emuOp2_illegal_op,
++                                                /* lsl (ring 0 PM)          */
+ /*  0x04 */ x86emuOp2_illegal_op,
+-/*  0x05 */ x86emuOp2_illegal_op,  /* loadall (undocumented)   */
+-/*  0x06 */ x86emuOp2_illegal_op,  /* clts (ring 0 PM)         */
+-/*  0x07 */ x86emuOp2_illegal_op,  /* loadall (undocumented)   */
+-/*  0x08 */ x86emuOp2_illegal_op,  /* invd (ring 0 PM)         */
+-/*  0x09 */ x86emuOp2_illegal_op,  /* wbinvd (ring 0 PM)       */
++                                                /*  0x05 */ x86emuOp2_illegal_op,
++                                                /* loadall (undocumented)   */
++                                                /*  0x06 */ x86emuOp2_illegal_op,
++                                                /* clts (ring 0 PM)         */
++                                                /*  0x07 */ x86emuOp2_illegal_op,
++                                                /* loadall (undocumented)   */
++                                                /*  0x08 */ x86emuOp2_illegal_op,
++                                                /* invd (ring 0 PM)         */
++                                                /*  0x09 */ x86emuOp2_illegal_op,
++                                                /* wbinvd (ring 0 PM)       */
+ /*  0x0a */ x86emuOp2_illegal_op,
+ /*  0x0b */ x86emuOp2_illegal_op,
+ /*  0x0c */ x86emuOp2_illegal_op,
+ /*  0x0d */ x86emuOp2_illegal_op,
+ /*  0x0e */ x86emuOp2_illegal_op,
+ /*  0x0f */ x86emuOp2_illegal_op,
+-
+ /*  0x10 */ x86emuOp2_illegal_op,
+ /*  0x11 */ x86emuOp2_illegal_op,
+ /*  0x12 */ x86emuOp2_illegal_op,
+@@ -2704,14 +2771,19 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0x1d */ x86emuOp2_illegal_op,
+ /*  0x1e */ x86emuOp2_illegal_op,
+ /*  0x1f */ x86emuOp2_illegal_op,
+-
+-/*  0x20 */ x86emuOp2_illegal_op,  /* mov reg32,creg (ring 0 PM) */
+-/*  0x21 */ x86emuOp2_illegal_op,  /* mov reg32,dreg (ring 0 PM) */
+-/*  0x22 */ x86emuOp2_illegal_op,  /* mov creg,reg32 (ring 0 PM) */
+-/*  0x23 */ x86emuOp2_illegal_op,  /* mov dreg,reg32 (ring 0 PM) */
+-/*  0x24 */ x86emuOp2_illegal_op,  /* mov reg32,treg (ring 0 PM) */
++                                                /*  0x20 */ x86emuOp2_illegal_op,
++                                                /* mov reg32,creg (ring 0 PM) */
++                                                /*  0x21 */ x86emuOp2_illegal_op,
++                                                /* mov reg32,dreg (ring 0 PM) */
++                                                /*  0x22 */ x86emuOp2_illegal_op,
++                                                /* mov creg,reg32 (ring 0 PM) */
++                                                /*  0x23 */ x86emuOp2_illegal_op,
++                                                /* mov dreg,reg32 (ring 0 PM) */
++                                                /*  0x24 */ x86emuOp2_illegal_op,
++                                                /* mov reg32,treg (ring 0 PM) */
+ /*  0x25 */ x86emuOp2_illegal_op,
+-/*  0x26 */ x86emuOp2_illegal_op,  /* mov treg,reg32 (ring 0 PM) */
++                                                /*  0x26 */ x86emuOp2_illegal_op,
++                                                /* mov treg,reg32 (ring 0 PM) */
+ /*  0x27 */ x86emuOp2_illegal_op,
+ /*  0x28 */ x86emuOp2_illegal_op,
+ /*  0x29 */ x86emuOp2_illegal_op,
+@@ -2721,7 +2793,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0x2d */ x86emuOp2_illegal_op,
+ /*  0x2e */ x86emuOp2_illegal_op,
+ /*  0x2f */ x86emuOp2_illegal_op,
+-
+ /*  0x30 */ x86emuOp2_illegal_op,
+ /*  0x31 */ x86emuOp2_rdtsc,
+ /*  0x32 */ x86emuOp2_illegal_op,
+@@ -2738,7 +2809,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0x3d */ x86emuOp2_illegal_op,
+ /*  0x3e */ x86emuOp2_illegal_op,
+ /*  0x3f */ x86emuOp2_illegal_op,
+-
+ /*  0x40 */ x86emuOp2_illegal_op,
+ /*  0x41 */ x86emuOp2_illegal_op,
+ /*  0x42 */ x86emuOp2_illegal_op,
+@@ -2755,7 +2825,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0x4d */ x86emuOp2_illegal_op,
+ /*  0x4e */ x86emuOp2_illegal_op,
+ /*  0x4f */ x86emuOp2_illegal_op,
+-
+ /*  0x50 */ x86emuOp2_illegal_op,
+ /*  0x51 */ x86emuOp2_illegal_op,
+ /*  0x52 */ x86emuOp2_illegal_op,
+@@ -2772,7 +2841,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0x5d */ x86emuOp2_illegal_op,
+ /*  0x5e */ x86emuOp2_illegal_op,
+ /*  0x5f */ x86emuOp2_illegal_op,
+-
+ /*  0x60 */ x86emuOp2_illegal_op,
+ /*  0x61 */ x86emuOp2_illegal_op,
+ /*  0x62 */ x86emuOp2_illegal_op,
+@@ -2789,7 +2857,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0x6d */ x86emuOp2_illegal_op,
+ /*  0x6e */ x86emuOp2_illegal_op,
+ /*  0x6f */ x86emuOp2_illegal_op,
+-
+ /*  0x70 */ x86emuOp2_illegal_op,
+ /*  0x71 */ x86emuOp2_illegal_op,
+ /*  0x72 */ x86emuOp2_illegal_op,
+@@ -2806,7 +2873,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0x7d */ x86emuOp2_illegal_op,
+ /*  0x7e */ x86emuOp2_illegal_op,
+ /*  0x7f */ x86emuOp2_illegal_op,
+-
+ /*  0x80 */ x86emuOp2_long_jump,
+ /*  0x81 */ x86emuOp2_long_jump,
+ /*  0x82 */ x86emuOp2_long_jump,
+@@ -2823,7 +2889,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0x8d */ x86emuOp2_long_jump,
+ /*  0x8e */ x86emuOp2_long_jump,
+ /*  0x8f */ x86emuOp2_long_jump,
+-
+ /*  0x90 */ x86emuOp2_set_byte,
+ /*  0x91 */ x86emuOp2_set_byte,
+ /*  0x92 */ x86emuOp2_set_byte,
+@@ -2840,7 +2905,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0x9d */ x86emuOp2_set_byte,
+ /*  0x9e */ x86emuOp2_set_byte,
+ /*  0x9f */ x86emuOp2_set_byte,
+-
+ /*  0xa0 */ x86emuOp2_push_FS,
+ /*  0xa1 */ x86emuOp2_pop_FS,
+ /*  0xa2 */ x86emuOp2_cpuid,
+@@ -2857,9 +2921,10 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0xad */ x86emuOp2_shrd_CL,
+ /*  0xae */ x86emuOp2_illegal_op,
+ /*  0xaf */ x86emuOp2_imul_R_RM,
+-
+-/*  0xb0 */ x86emuOp2_illegal_op,  /* TODO: cmpxchg */
+-/*  0xb1 */ x86emuOp2_illegal_op,  /* TODO: cmpxchg */
++                                                /*  0xb0 */ x86emuOp2_illegal_op,
++                                                /* TODO: cmpxchg */
++                                                /*  0xb1 */ x86emuOp2_illegal_op,
++                                                /* TODO: cmpxchg */
+ /*  0xb2 */ x86emuOp2_lss_R_IMM,
+ /*  0xb3 */ x86emuOp2_btr_R,
+ /*  0xb4 */ x86emuOp2_lfs_R_IMM,
+@@ -2874,9 +2939,10 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0xbd */ x86emuOp2_bsr,
+ /*  0xbe */ x86emuOp2_movsx_byte_R_RM,
+ /*  0xbf */ x86emuOp2_movsx_word_R_RM,
+-
+-/*  0xc0 */ x86emuOp2_illegal_op,  /* TODO: xadd */
+-/*  0xc1 */ x86emuOp2_illegal_op,  /* TODO: xadd */
++                                                /*  0xc0 */ x86emuOp2_illegal_op,
++                                                /* TODO: xadd */
++                                                /*  0xc1 */ x86emuOp2_illegal_op,
++                                                /* TODO: xadd */
+ /*  0xc2 */ x86emuOp2_illegal_op,
+ /*  0xc3 */ x86emuOp2_illegal_op,
+ /*  0xc4 */ x86emuOp2_illegal_op,
+@@ -2891,7 +2957,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0xcd */ x86emuOp2_bswap,
+ /*  0xce */ x86emuOp2_bswap,
+ /*  0xcf */ x86emuOp2_bswap,
+-
+ /*  0xd0 */ x86emuOp2_illegal_op,
+ /*  0xd1 */ x86emuOp2_illegal_op,
+ /*  0xd2 */ x86emuOp2_illegal_op,
+@@ -2908,7 +2973,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0xdd */ x86emuOp2_illegal_op,
+ /*  0xde */ x86emuOp2_illegal_op,
+ /*  0xdf */ x86emuOp2_illegal_op,
+-
+ /*  0xe0 */ x86emuOp2_illegal_op,
+ /*  0xe1 */ x86emuOp2_illegal_op,
+ /*  0xe2 */ x86emuOp2_illegal_op,
+@@ -2925,7 +2989,6 @@ void (*x86emu_optab2[256])(u8) =
+ /*  0xed */ x86emuOp2_illegal_op,
+ /*  0xee */ x86emuOp2_illegal_op,
+ /*  0xef */ x86emuOp2_illegal_op,
+-
+ /*  0xf0 */ x86emuOp2_illegal_op,
+ /*  0xf1 */ x86emuOp2_illegal_op,
+ /*  0xf2 */ x86emuOp2_illegal_op,
+diff --git a/libs/x86emu/prim_ops.c b/libs/x86emu/prim_ops.c
+index ff17c3f..24f76b4 100644
+--- a/libs/x86emu/prim_ops.c
++++ b/libs/x86emu/prim_ops.c
+@@ -102,18 +102,23 @@
+ #define	PRIM_OPS_NO_REDEFINE_ASM
+ #include "x86emu/x86emui.h"
+ 
++#if defined(__GNUC__)
++#if defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__amd64__)
++#include "x86emu/prim_x86_gcc.h"
++#endif
++#endif
++
+ /*------------------------- Global Variables ------------------------------*/
+ 
+-static u32 x86emu_parity_tab[8] =
+-{
+-	0x96696996,
+-	0x69969669,
+-	0x69969669,
+-	0x96696996,
+-	0x69969669,
+-	0x96696996,
+-	0x96696996,
+-	0x69969669,
++static u32 x86emu_parity_tab[8] = {
++    0x96696996,
++    0x69969669,
++    0x69969669,
++    0x96696996,
++    0x69969669,
++    0x96696996,
++    0x96696996,
++    0x69969669,
+ };
+ 
+ #define PARITY(x)   (((x86emu_parity_tab[(x) / 32] >> ((x) % 32)) & 1) == 0)
+@@ -125,88 +130,96 @@ static u32 x86emu_parity_tab[8] =
+ REMARKS:
+ Implements the AAA instruction and side effects.
+ ****************************************************************************/
+-u16 aaa_word(u16 d)
++u16
++aaa_word(u16 d)
+ {
+-	u16	res;
+-	if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
+-		d += 0x6;
+-		d += 0x100;
+-		SET_FLAG(F_AF);
+-		SET_FLAG(F_CF);
+-	} else {
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_AF);
+-	}
+-	res = (u16)(d & 0xFF0F);
+-	CLEAR_FLAG(F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-	return res;
++    u16 res;
++
++    if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
++        d += 0x6;
++        d += 0x100;
++        SET_FLAG(F_AF);
++        SET_FLAG(F_CF);
++    }
++    else {
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_AF);
++    }
++    res = (u16) (d & 0xFF0F);
++    CLEAR_FLAG(F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the AAA instruction and side effects.
+ ****************************************************************************/
+-u16 aas_word(u16 d)
++u16
++aas_word(u16 d)
+ {
+-	u16	res;
+-	if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
+-		d -= 0x6;
+-		d -= 0x100;
+-		SET_FLAG(F_AF);
+-		SET_FLAG(F_CF);
+-	} else {
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_AF);
+-	}
+-	res = (u16)(d & 0xFF0F);
+-	CLEAR_FLAG(F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-	return res;
++    u16 res;
++
++    if ((d & 0xf) > 0x9 || ACCESS_FLAG(F_AF)) {
++        d -= 0x6;
++        d -= 0x100;
++        SET_FLAG(F_AF);
++        SET_FLAG(F_CF);
++    }
++    else {
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_AF);
++    }
++    res = (u16) (d & 0xFF0F);
++    CLEAR_FLAG(F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the AAD instruction and side effects.
+ ****************************************************************************/
+-u16 aad_word(u16 d)
++u16
++aad_word(u16 d)
+ {
+-	u16 l;
+-	u8 hb, lb;
++    u16 l;
++    u8 hb, lb;
+ 
+-	hb = (u8)((d >> 8) & 0xff);
+-	lb = (u8)((d & 0xff));
+-	l = (u16)((lb + 10 * hb) & 0xFF);
++    hb = (u8) ((d >> 8) & 0xff);
++    lb = (u8) ((d & 0xff));
++    l = (u16) ((lb + 10 * hb) & 0xFF);
+ 
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	CLEAR_FLAG(F_OF);
+-	CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(l == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
+-	return l;
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    CLEAR_FLAG(F_OF);
++    CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(l == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
++    return l;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the AAM instruction and side effects.
+ ****************************************************************************/
+-u16 aam_word(u8 d)
++u16
++aam_word(u8 d)
+ {
+     u16 h, l;
+ 
+-	h = (u16)(d / 10);
+-	l = (u16)(d % 10);
+-	l |= (u16)(h << 8);
++    h = (u16) (d / 10);
++    l = (u16) (d % 10);
++    l |= (u16) (h << 8);
+ 
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	CLEAR_FLAG(F_OF);
+-	CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(l == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    CLEAR_FLAG(F_OF);
++    CONDITIONAL_SET_FLAG(l & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(l == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(l & 0xff), F_PF);
+     return l;
+ }
+ 
+@@ -214,155 +227,161 @@ u16 aam_word(u8 d)
+ REMARKS:
+ Implements the ADC instruction and side effects.
+ ****************************************************************************/
+-u8 adc_byte(u8 d, u8 s)
++u8
++adc_byte(u8 d, u8 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 cc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 cc;
+ 
+-	if (ACCESS_FLAG(F_CF))
+-		res = 1 + d + s;
+-	else
+-		res = d + s;
++    if (ACCESS_FLAG(F_CF))
++        res = 1 + d + s;
++    else
++        res = d + s;
+ 
+-	CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
+-	CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
++    CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the carry chain  SEE NOTE AT TOP. */
+-	cc = (s & d) | ((~res) & (s | d));
+-	CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
+-	CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+-	return (u8)res;
++    /* calculate the carry chain  SEE NOTE AT TOP. */
++    cc = (s & d) | ((~res) & (s | d));
++    CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
++    CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ADC instruction and side effects.
+ ****************************************************************************/
+-u16 adc_word(u16 d, u16 s)
++u16
++adc_word(u16 d, u16 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 cc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 cc;
+ 
+-	if (ACCESS_FLAG(F_CF))
+-		res = 1 + d + s;
+-	else
+-		res = d + s;
++    if (ACCESS_FLAG(F_CF))
++        res = 1 + d + s;
++    else
++        res = d + s;
+ 
+-	CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
+-	CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
++    CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the carry chain  SEE NOTE AT TOP. */
+-	cc = (s & d) | ((~res) & (s | d));
+-	CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
+-	CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+-	return (u16)res;
++    /* calculate the carry chain  SEE NOTE AT TOP. */
++    cc = (s & d) | ((~res) & (s | d));
++    CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
++    CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ADC instruction and side effects.
+ ****************************************************************************/
+-u32 adc_long(u32 d, u32 s)
++u32
++adc_long(u32 d, u32 s)
+ {
+-	register u32 lo;	/* all operands in native machine order */
+-	register u32 hi;
+-	register u32 res;
+-	register u32 cc;
++    register u32 lo;            /* all operands in native machine order */
++    register u32 hi;
++    register u32 res;
++    register u32 cc;
+ 
+-	if (ACCESS_FLAG(F_CF)) {
+-		lo = 1 + (d & 0xFFFF) + (s & 0xFFFF);
+-		res = 1 + d + s;
+-		}
+-	else {
+-		lo = (d & 0xFFFF) + (s & 0xFFFF);
+-		res = d + s;
+-		}
+-	hi = (lo >> 16) + (d >> 16) + (s >> 16);
++    if (ACCESS_FLAG(F_CF)) {
++        lo = 1 + (d & 0xFFFF) + (s & 0xFFFF);
++        res = 1 + d + s;
++    }
++    else {
++        lo = (d & 0xFFFF) + (s & 0xFFFF);
++        res = d + s;
++    }
++    hi = (lo >> 16) + (d >> 16) + (s >> 16);
+ 
+-	CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
+-	CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
++    CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the carry chain  SEE NOTE AT TOP. */
+-	cc = (s & d) | ((~res) & (s | d));
+-	CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
+-	CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+-	return res;
++    /* calculate the carry chain  SEE NOTE AT TOP. */
++    cc = (s & d) | ((~res) & (s | d));
++    CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
++    CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ADD instruction and side effects.
+ ****************************************************************************/
+-u8 add_byte(u8 d, u8 s)
++u8
++add_byte(u8 d, u8 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 cc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 cc;
+ 
+-	res = d + s;
+-	CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
+-	CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    res = d + s;
++    CONDITIONAL_SET_FLAG(res & 0x100, F_CF);
++    CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the carry chain  SEE NOTE AT TOP. */
+-	cc = (s & d) | ((~res) & (s | d));
+-	CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
+-	CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+-	return (u8)res;
++    /* calculate the carry chain  SEE NOTE AT TOP. */
++    cc = (s & d) | ((~res) & (s | d));
++    CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
++    CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ADD instruction and side effects.
+ ****************************************************************************/
+-u16 add_word(u16 d, u16 s)
++u16
++add_word(u16 d, u16 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 cc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 cc;
+ 
+-	res = d + s;
+-	CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
+-	CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    res = d + s;
++    CONDITIONAL_SET_FLAG(res & 0x10000, F_CF);
++    CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the carry chain  SEE NOTE AT TOP. */
+-	cc = (s & d) | ((~res) & (s | d));
+-	CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
+-	CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+-	return (u16)res;
++    /* calculate the carry chain  SEE NOTE AT TOP. */
++    cc = (s & d) | ((~res) & (s | d));
++    CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
++    CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ADD instruction and side effects.
+ ****************************************************************************/
+-u32 add_long(u32 d, u32 s)
++u32
++add_long(u32 d, u32 s)
+ {
+-	register u32 lo;	/* all operands in native machine order */
+-	register u32 hi;
+-	register u32 res;
+-	register u32 cc;
++    register u32 lo;            /* all operands in native machine order */
++    register u32 hi;
++    register u32 res;
++    register u32 cc;
+ 
+-	lo = (d & 0xFFFF) + (s & 0xFFFF);
+-	res = d + s;
+-	hi = (lo >> 16) + (d >> 16) + (s >> 16);
++    lo = (d & 0xFFFF) + (s & 0xFFFF);
++    res = d + s;
++    hi = (lo >> 16) + (d >> 16) + (s >> 16);
+ 
+-	CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
+-	CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CONDITIONAL_SET_FLAG(hi & 0x10000, F_CF);
++    CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+     /* calculate the carry chain  SEE NOTE AT TOP. */
+     cc = (s & d) | ((~res) & (s | d));
+-	CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
+-	CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++    CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
++    CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+ 
+     return res;
+ }
+@@ -371,39 +390,41 @@ u32 add_long(u32 d, u32 s)
+ REMARKS:
+ Implements the AND instruction and side effects.
+ ****************************************************************************/
+-u8 and_byte(u8 d, u8 s)
++u8
++and_byte(u8 d, u8 s)
+ {
+-	register u8 res;    /* all operands in native machine order */
++    register u8 res;            /* all operands in native machine order */
+ 
+-	res = d & s;
++    res = d & s;
+ 
+-	/* set the flags  */
+-	CLEAR_FLAG(F_OF);
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+-	return res;
++    /* set the flags  */
++    CLEAR_FLAG(F_OF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the AND instruction and side effects.
+ ****************************************************************************/
+-u16 and_word(u16 d, u16 s)
++u16
++and_word(u16 d, u16 s)
+ {
+-    register u16 res;   /* all operands in native machine order */
++    register u16 res;           /* all operands in native machine order */
+ 
+     res = d & s;
+ 
+     /* set the flags  */
+-	CLEAR_FLAG(F_OF);
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CLEAR_FLAG(F_OF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+     return res;
+ }
+ 
+@@ -411,433 +432,456 @@ u16 and_word(u16 d, u16 s)
+ REMARKS:
+ Implements the AND instruction and side effects.
+ ****************************************************************************/
+-u32 and_long(u32 d, u32 s)
++u32
++and_long(u32 d, u32 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+ 
+-	res = d & s;
++    res = d & s;
+ 
+-	/* set the flags  */
+-	CLEAR_FLAG(F_OF);
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-	return res;
++    /* set the flags  */
++    CLEAR_FLAG(F_OF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the CMP instruction and side effects.
+ ****************************************************************************/
+-u8 cmp_byte(u8 d, u8 s)
++u8
++cmp_byte(u8 d, u8 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 bc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 bc;
+ 
+-	res = d - s;
+-	CLEAR_FLAG(F_CF);
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    res = d - s;
++    CLEAR_FLAG(F_CF);
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the borrow chain.  See note at top */
+-	bc = (res & (~d | s)) | (~d & s);
+-	CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return d;
++    /* calculate the borrow chain.  See note at top */
++    bc = (res & (~d | s)) | (~d & s);
++    CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return d;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the CMP instruction and side effects.
+ ****************************************************************************/
+-u16 cmp_word(u16 d, u16 s)
++u16
++cmp_word(u16 d, u16 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 bc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 bc;
+ 
+-	res = d - s;
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    res = d - s;
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the borrow chain.  See note at top */
++    /* calculate the borrow chain.  See note at top */
+     bc = (res & (~d | s)) | (~d & s);
+-	CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return d;
++    CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return d;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the CMP instruction and side effects.
+ ****************************************************************************/
+-u32 cmp_long(u32 d, u32 s)
++u32
++cmp_long(u32 d, u32 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 bc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 bc;
+ 
+-	res = d - s;
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    res = d - s;
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the borrow chain.  See note at top */
+-	bc = (res & (~d | s)) | (~d & s);
+-	CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return d;
++    /* calculate the borrow chain.  See note at top */
++    bc = (res & (~d | s)) | (~d & s);
++    CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return d;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the DAA instruction and side effects.
+ ****************************************************************************/
+-u8 daa_byte(u8 d)
++u8
++daa_byte(u8 d)
+ {
+-	u32 res = d;
+-	if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
+-		res += 6;
+-		SET_FLAG(F_AF);
+-	}
+-	if (res > 0x9F || ACCESS_FLAG(F_CF)) {
+-		res += 0x60;
+-		SET_FLAG(F_CF);
+-	}
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xFF) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-	return (u8)res;
++    u32 res = d;
++
++    if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
++        res += 6;
++        SET_FLAG(F_AF);
++    }
++    if (res > 0x9F || ACCESS_FLAG(F_CF)) {
++        res += 0x60;
++        SET_FLAG(F_CF);
++    }
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xFF) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the DAS instruction and side effects.
+ ****************************************************************************/
+-u8 das_byte(u8 d)
++u8
++das_byte(u8 d)
+ {
+-	if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
+-		d -= 6;
+-		SET_FLAG(F_AF);
+-	}
+-	if (d > 0x9F || ACCESS_FLAG(F_CF)) {
+-		d -= 0x60;
+-		SET_FLAG(F_CF);
+-	}
+-	CONDITIONAL_SET_FLAG(d & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(d == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(d & 0xff), F_PF);
+-	return d;
++    if ((d & 0xf) > 9 || ACCESS_FLAG(F_AF)) {
++        d -= 6;
++        SET_FLAG(F_AF);
++    }
++    if (d > 0x9F || ACCESS_FLAG(F_CF)) {
++        d -= 0x60;
++        SET_FLAG(F_CF);
++    }
++    CONDITIONAL_SET_FLAG(d & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(d == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(d & 0xff), F_PF);
++    return d;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the DEC instruction and side effects.
+ ****************************************************************************/
+-u8 dec_byte(u8 d)
++u8
++dec_byte(u8 d)
+ {
+-    register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+     register u32 bc;
+ 
+     res = d - 1;
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the borrow chain.  See note at top */
+-	/* based on sub_byte, uses s==1.  */
+-	bc = (res & (~d | 1)) | (~d & 1);
+-	/* carry flag unchanged */
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return (u8)res;
++    /* calculate the borrow chain.  See note at top */
++    /* based on sub_byte, uses s==1.  */
++    bc = (res & (~d | 1)) | (~d & 1);
++    /* carry flag unchanged */
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the DEC instruction and side effects.
+ ****************************************************************************/
+-u16 dec_word(u16 d)
++u16
++dec_word(u16 d)
+ {
+-    register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+     register u32 bc;
+ 
+     res = d - 1;
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+     /* calculate the borrow chain.  See note at top */
+     /* based on the sub_byte routine, with s==1 */
+     bc = (res & (~d | 1)) | (~d & 1);
+     /* carry flag unchanged */
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return (u16)res;
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the DEC instruction and side effects.
+ ****************************************************************************/
+-u32 dec_long(u32 d)
++u32
++dec_long(u32 d)
+ {
+-    register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+     register u32 bc;
+ 
+     res = d - 1;
+ 
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+     /* calculate the borrow chain.  See note at top */
+-	bc = (res & (~d | 1)) | (~d & 1);
+-	/* carry flag unchanged */
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return res;
++    bc = (res & (~d | 1)) | (~d & 1);
++    /* carry flag unchanged */
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the INC instruction and side effects.
+ ****************************************************************************/
+-u8 inc_byte(u8 d)
++u8
++inc_byte(u8 d)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 cc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 cc;
+ 
+-	res = d + 1;
+-	CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    res = d + 1;
++    CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the carry chain  SEE NOTE AT TOP. */
+-	cc = ((1 & d) | (~res)) & (1 | d);
+-	CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
+-	CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+-	return (u8)res;
++    /* calculate the carry chain  SEE NOTE AT TOP. */
++    cc = ((1 & d) | (~res)) & (1 | d);
++    CONDITIONAL_SET_FLAG(XOR2(cc >> 6), F_OF);
++    CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the INC instruction and side effects.
+ ****************************************************************************/
+-u16 inc_word(u16 d)
++u16
++inc_word(u16 d)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 cc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 cc;
+ 
+-	res = d + 1;
+-	CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    res = d + 1;
++    CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the carry chain  SEE NOTE AT TOP. */
+-	cc = (1 & d) | ((~res) & (1 | d));
+-	CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
+-	CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+-	return (u16)res;
++    /* calculate the carry chain  SEE NOTE AT TOP. */
++    cc = (1 & d) | ((~res) & (1 | d));
++    CONDITIONAL_SET_FLAG(XOR2(cc >> 14), F_OF);
++    CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the INC instruction and side effects.
+ ****************************************************************************/
+-u32 inc_long(u32 d)
++u32
++inc_long(u32 d)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 cc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 cc;
+ 
+-	res = d + 1;
+-	CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    res = d + 1;
++    CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the carry chain  SEE NOTE AT TOP. */
+-	cc = (1 & d) | ((~res) & (1 | d));
+-	CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
+-	CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
+-	return res;
++    /* calculate the carry chain  SEE NOTE AT TOP. */
++    cc = (1 & d) | ((~res) & (1 | d));
++    CONDITIONAL_SET_FLAG(XOR2(cc >> 30), F_OF);
++    CONDITIONAL_SET_FLAG(cc & 0x8, F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u8 or_byte(u8 d, u8 s)
++u8
++or_byte(u8 d, u8 s)
+ {
+-	register u8 res;    /* all operands in native machine order */
++    register u8 res;            /* all operands in native machine order */
+ 
+-	res = d | s;
+-	CLEAR_FLAG(F_OF);
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+-	return res;
++    res = d | s;
++    CLEAR_FLAG(F_OF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u16 or_word(u16 d, u16 s)
++u16
++or_word(u16 d, u16 s)
+ {
+-	register u16 res;   /* all operands in native machine order */
++    register u16 res;           /* all operands in native machine order */
+ 
+-	res = d | s;
+-	/* set the carry flag to be bit 8 */
+-	CLEAR_FLAG(F_OF);
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-	return res;
++    res = d | s;
++    /* set the carry flag to be bit 8 */
++    CLEAR_FLAG(F_OF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u32 or_long(u32 d, u32 s)
++u32
++or_long(u32 d, u32 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+ 
+-	res = d | s;
++    res = d | s;
+ 
+-	/* set the carry flag to be bit 8 */
+-	CLEAR_FLAG(F_OF);
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-	return res;
++    /* set the carry flag to be bit 8 */
++    CLEAR_FLAG(F_OF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u8 neg_byte(u8 s)
++u8
++neg_byte(u8 s)
+ {
+     register u8 res;
+     register u8 bc;
+ 
+-	CONDITIONAL_SET_FLAG(s != 0, F_CF);
+-	res = (u8)-s;
+-	CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+-	/* calculate the borrow chain --- modified such that d=0.
+-	   substitutiing d=0 into     bc= res&(~d|s)|(~d&s);
+-	   (the one used for sub) and simplifying, since ~d=0xff...,
+-	   ~d|s == 0xffff..., and res&0xfff... == res.  Similarly
+-	   ~d&s == s.  So the simplified result is: */
+-	bc = res | s;
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return res;
++    CONDITIONAL_SET_FLAG(s != 0, F_CF);
++    res = (u8) - s;
++    CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
++    /* calculate the borrow chain --- modified such that d=0.
++       substitutiing d=0 into     bc= res&(~d|s)|(~d&s);
++       (the one used for sub) and simplifying, since ~d=0xff...,
++       ~d|s == 0xffff..., and res&0xfff... == res.  Similarly
++       ~d&s == s.  So the simplified result is: */
++    bc = res | s;
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u16 neg_word(u16 s)
+-{
+-	register u16 res;
+-	register u16 bc;
+-
+-	CONDITIONAL_SET_FLAG(s != 0, F_CF);
+-	res = (u16)-s;
+-	CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-
+-	/* calculate the borrow chain --- modified such that d=0.
+-	   substitutiing d=0 into     bc= res&(~d|s)|(~d&s);
+-	   (the one used for sub) and simplifying, since ~d=0xff...,
+-	   ~d|s == 0xffff..., and res&0xfff... == res.  Similarly
+-	   ~d&s == s.  So the simplified result is: */
+-	bc = res | s;
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return res;
++u16
++neg_word(u16 s)
++{
++    register u16 res;
++    register u16 bc;
++
++    CONDITIONAL_SET_FLAG(s != 0, F_CF);
++    res = (u16) - s;
++    CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++
++    /* calculate the borrow chain --- modified such that d=0.
++       substitutiing d=0 into     bc= res&(~d|s)|(~d&s);
++       (the one used for sub) and simplifying, since ~d=0xff...,
++       ~d|s == 0xffff..., and res&0xfff... == res.  Similarly
++       ~d&s == s.  So the simplified result is: */
++    bc = res | s;
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the OR instruction and side effects.
+ ****************************************************************************/
+-u32 neg_long(u32 s)
++u32
++neg_long(u32 s)
+ {
+-	register u32 res;
+-	register u32 bc;
+-
+-	CONDITIONAL_SET_FLAG(s != 0, F_CF);
+-	res = (u32)-s;
+-	CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    register u32 res;
++    register u32 bc;
+ 
+-	/* calculate the borrow chain --- modified such that d=0.
+-	   substitutiing d=0 into     bc= res&(~d|s)|(~d&s);
+-	   (the one used for sub) and simplifying, since ~d=0xff...,
+-	   ~d|s == 0xffff..., and res&0xfff... == res.  Similarly
+-	   ~d&s == s.  So the simplified result is: */
+-	bc = res | s;
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return res;
++    CONDITIONAL_SET_FLAG(s != 0, F_CF);
++    res = (u32) - s;
++    CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++
++    /* calculate the borrow chain --- modified such that d=0.
++       substitutiing d=0 into     bc= res&(~d|s)|(~d&s);
++       (the one used for sub) and simplifying, since ~d=0xff...,
++       ~d|s == 0xffff..., and res&0xfff... == res.  Similarly
++       ~d&s == s.  So the simplified result is: */
++    bc = res | s;
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the NOT instruction and side effects.
+ ****************************************************************************/
+-u8 not_byte(u8 s)
++u8
++not_byte(u8 s)
+ {
+-	return ~s;
++    return ~s;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the NOT instruction and side effects.
+ ****************************************************************************/
+-u16 not_word(u16 s)
++u16
++not_word(u16 s)
+ {
+-	return ~s;
++    return ~s;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the NOT instruction and side effects.
+ ****************************************************************************/
+-u32 not_long(u32 s)
++u32
++not_long(u32 s)
+ {
+-	return ~s;
++    return ~s;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the RCL instruction and side effects.
+ ****************************************************************************/
+-u8 rcl_byte(u8 d, u8 s)
++u8
++rcl_byte(u8 d, u8 s)
+ {
+     register unsigned int res, cnt, mask, cf;
+ 
+     /* s is the rotate distance.  It varies from 0 - 8. */
+-	/* have
++    /* have
+ 
+        CF  B_7 B_6 B_5 B_4 B_3 B_2 B_1 B_0 
+ 
+@@ -861,9 +905,9 @@ u8 rcl_byte(u8 d, u8 s)
+        2) B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_0
+        3) B_(n-1) <- cf
+        4) B_(n-2) .. B_0 <-  b_7 .. b_(8-(n-1))
+-	 */
+-	res = d;
+-	if ((cnt = s % 9) != 0) {
++     */
++    res = d;
++    if ((cnt = s % 9) != 0) {
+         /* extract the new CARRY FLAG. */
+         /* CF <-  b_(8-n)             */
+         cf = (d >> (8 - cnt)) & 0x1;
+@@ -872,7 +916,7 @@ u8 rcl_byte(u8 d, u8 s)
+            into the range B_7 .. B_cnt */
+         /* B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_0  */
+         /* note that the right hand side done by the mask */
+-		res = (d << cnt) & 0xff;
++        res = (d << cnt) & 0xff;
+ 
+         /* now the high stuff which rotated around 
+            into the positions B_cnt-2 .. B_0 */
+@@ -884,81 +928,81 @@ u8 rcl_byte(u8 d, u8 s)
+         res |= (d >> (9 - cnt)) & mask;
+ 
+         /* if the carry flag was set, or it in.  */
+-		if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
++        if (ACCESS_FLAG(F_CF)) {        /* carry flag is set */
+             /*  B_(n-1) <- cf */
+             res |= 1 << (cnt - 1);
+         }
+         /* set the new carry flag, based on the variable "cf" */
+-		CONDITIONAL_SET_FLAG(cf, F_CF);
++        CONDITIONAL_SET_FLAG(cf, F_CF);
+         /* OVERFLOW is set *IFF* cnt==1, then it is the 
+            xor of CF and the most significant bit.  Blecck. */
+         /* parenthesized this expression since it appears to
+            be causing OF to be misset */
+-        CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 6) & 0x2)),
+-							 F_OF);
++        CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 6) & 0x2)), F_OF);
+ 
+     }
+-	return (u8)res;
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the RCL instruction and side effects.
+ ****************************************************************************/
+-u16 rcl_word(u16 d, u8 s)
++u16
++rcl_word(u16 d, u8 s)
+ {
+-	register unsigned int res, cnt, mask, cf;
++    register unsigned int res, cnt, mask, cf;
+ 
+-	res = d;
+-	if ((cnt = s % 17) != 0) {
+-		cf = (d >> (16 - cnt)) & 0x1;
+-		res = (d << cnt) & 0xffff;
+-		mask = (1 << (cnt - 1)) - 1;
+-		res |= (d >> (17 - cnt)) & mask;
+-		if (ACCESS_FLAG(F_CF)) {
+-			res |= 1 << (cnt - 1);
+-		}
+-		CONDITIONAL_SET_FLAG(cf, F_CF);
+-		CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)),
+-							 F_OF);
+-	}
+-	return (u16)res;
++    res = d;
++    if ((cnt = s % 17) != 0) {
++        cf = (d >> (16 - cnt)) & 0x1;
++        res = (d << cnt) & 0xffff;
++        mask = (1 << (cnt - 1)) - 1;
++        res |= (d >> (17 - cnt)) & mask;
++        if (ACCESS_FLAG(F_CF)) {
++            res |= 1 << (cnt - 1);
++        }
++        CONDITIONAL_SET_FLAG(cf, F_CF);
++        CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 14) & 0x2)), F_OF);
++    }
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the RCL instruction and side effects.
+ ****************************************************************************/
+-u32 rcl_long(u32 d, u8 s)
++u32
++rcl_long(u32 d, u8 s)
+ {
+-	register u32 res, cnt, mask, cf;
++    register u32 res, cnt, mask, cf;
+ 
+-	res = d;
+-	if ((cnt = s % 33) != 0) {
+-		cf = (d >> (32 - cnt)) & 0x1;
+-		res = (d << cnt) & 0xffffffff;
+-		mask = (1 << (cnt - 1)) - 1;
+-		res |= (d >> (33 - cnt)) & mask;
+-		if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
+-			res |= 1 << (cnt - 1);
+-		}
+-		CONDITIONAL_SET_FLAG(cf, F_CF);
+-		CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 30) & 0x2)),
+-							 F_OF);
+-	}
+-	return res;
++    res = d;
++    if ((cnt = s % 33) != 0) {
++        cf = (d >> (32 - cnt)) & 0x1;
++        res = (d << cnt) & 0xffffffff;
++        mask = (1 << (cnt - 1)) - 1;
++        res |= (d >> (33 - cnt)) & mask;
++        if (ACCESS_FLAG(F_CF)) {        /* carry flag is set */
++            res |= 1 << (cnt - 1);
++        }
++        CONDITIONAL_SET_FLAG(cf, F_CF);
++        CONDITIONAL_SET_FLAG(cnt == 1 && XOR2(cf + ((res >> 30) & 0x2)), F_OF);
++    }
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the RCR instruction and side effects.
+ ****************************************************************************/
+-u8 rcr_byte(u8 d, u8 s)
++u8
++rcr_byte(u8 d, u8 s)
+ {
+-	u32	res, cnt;
+-	u32	mask, cf, ocf = 0;
++    u32 res, cnt;
++    u32 mask, cf, ocf = 0;
+ 
+-	/* rotate right through carry */
++    /* rotate right through carry */
+     /* 
+        s is the rotate distance.  It varies from 0 - 8.
+        d is the byte object rotated.  
+@@ -979,9 +1023,9 @@ u8 rcr_byte(u8 d, u8 s)
+        2) B_(8-(n+1)) .. B_(0)  <-  b_(7) .. b_(n)
+        3) B_(8-n) <- cf
+        4) B_(7) .. B_(8-(n-1)) <-  b_(n-2) .. b_(0)
+-	 */
+-	res = d;
+-	if ((cnt = s % 9) != 0) {
++     */
++    res = d;
++    if ((cnt = s % 9) != 0) {
+         /* extract the new CARRY FLAG. */
+         /* CF <-  b_(n-1)              */
+         if (cnt == 1) {
+@@ -990,11 +1034,12 @@ u8 rcr_byte(u8 d, u8 s)
+                0 if flag not set
+                non-zero if flag is set.
+                doing access_flag(..) != 0 casts that into either 
+-			   0..1 in any representation of the flags register
++               0..1 in any representation of the flags register
+                (i.e. packed bit array or unpacked.)
+              */
+-			ocf = ACCESS_FLAG(F_CF) != 0;
+-        } else
++            ocf = ACCESS_FLAG(F_CF) != 0;
++        }
++        else
+             cf = (d >> (cnt - 1)) & 0x1;
+ 
+         /* B_(8-(n+1)) .. B_(0)  <-  b_(7) .. b_n  */
+@@ -1016,93 +1061,95 @@ u8 rcr_byte(u8 d, u8 s)
+         res |= (d << (9 - cnt));
+ 
+         /* if the carry flag was set, or it in.  */
+-		if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
++        if (ACCESS_FLAG(F_CF)) {        /* carry flag is set */
+             /*  B_(8-n) <- cf */
+             res |= 1 << (8 - cnt);
+         }
+         /* set the new carry flag, based on the variable "cf" */
+-		CONDITIONAL_SET_FLAG(cf, F_CF);
++        CONDITIONAL_SET_FLAG(cf, F_CF);
+         /* OVERFLOW is set *IFF* cnt==1, then it is the 
+            xor of CF and the most significant bit.  Blecck. */
+         /* parenthesized... */
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 6) & 0x2)),
+-								 F_OF);
+-		}
+-	}
+-	return (u8)res;
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 6) & 0x2)), F_OF);
++        }
++    }
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the RCR instruction and side effects.
+ ****************************************************************************/
+-u16 rcr_word(u16 d, u8 s)
++u16
++rcr_word(u16 d, u8 s)
+ {
+-	u32 res, cnt;
+-	u32	mask, cf, ocf = 0;
++    u32 res, cnt;
++    u32 mask, cf, ocf = 0;
+ 
+-	/* rotate right through carry */
+-	res = d;
+-	if ((cnt = s % 17) != 0) {
+-		if (cnt == 1) {
+-			cf = d & 0x1;
+-			ocf = ACCESS_FLAG(F_CF) != 0;
+-		} else
+-			cf = (d >> (cnt - 1)) & 0x1;
+-		mask = (1 << (16 - cnt)) - 1;
+-		res = (d >> cnt) & mask;
+-		res |= (d << (17 - cnt));
+-		if (ACCESS_FLAG(F_CF)) {
+-			res |= 1 << (16 - cnt);
+-		}
+-		CONDITIONAL_SET_FLAG(cf, F_CF);
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 14) & 0x2)),
+-								 F_OF);
+-		}
+-	}
+-	return (u16)res;
++    /* rotate right through carry */
++    res = d;
++    if ((cnt = s % 17) != 0) {
++        if (cnt == 1) {
++            cf = d & 0x1;
++            ocf = ACCESS_FLAG(F_CF) != 0;
++        }
++        else
++            cf = (d >> (cnt - 1)) & 0x1;
++        mask = (1 << (16 - cnt)) - 1;
++        res = (d >> cnt) & mask;
++        res |= (d << (17 - cnt));
++        if (ACCESS_FLAG(F_CF)) {
++            res |= 1 << (16 - cnt);
++        }
++        CONDITIONAL_SET_FLAG(cf, F_CF);
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 14) & 0x2)), F_OF);
++        }
++    }
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the RCR instruction and side effects.
+ ****************************************************************************/
+-u32 rcr_long(u32 d, u8 s)
+-{
+-	u32 res, cnt;
+-	u32 mask, cf, ocf = 0;
+-
+-	/* rotate right through carry */
+-	res = d;
+-	if ((cnt = s % 33) != 0) {
+-		if (cnt == 1) {
+-			cf = d & 0x1;
+-			ocf = ACCESS_FLAG(F_CF) != 0;
+-		} else
+-			cf = (d >> (cnt - 1)) & 0x1;
+-		mask = (1 << (32 - cnt)) - 1;
+-		res = (d >> cnt) & mask;
+-		if (cnt != 1)
+-			res |= (d << (33 - cnt));
+-		if (ACCESS_FLAG(F_CF)) {     /* carry flag is set */
+-			res |= 1 << (32 - cnt);
+-		}
+-		CONDITIONAL_SET_FLAG(cf, F_CF);
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 30) & 0x2)),
+-								 F_OF);
+-		}
+-	}
+-	return res;
++u32
++rcr_long(u32 d, u8 s)
++{
++    u32 res, cnt;
++    u32 mask, cf, ocf = 0;
++
++    /* rotate right through carry */
++    res = d;
++    if ((cnt = s % 33) != 0) {
++        if (cnt == 1) {
++            cf = d & 0x1;
++            ocf = ACCESS_FLAG(F_CF) != 0;
++        }
++        else
++            cf = (d >> (cnt - 1)) & 0x1;
++        mask = (1 << (32 - cnt)) - 1;
++        res = (d >> cnt) & mask;
++        if (cnt != 1)
++            res |= (d << (33 - cnt));
++        if (ACCESS_FLAG(F_CF)) {        /* carry flag is set */
++            res |= 1 << (32 - cnt);
++        }
++        CONDITIONAL_SET_FLAG(cf, F_CF);
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG(XOR2(ocf + ((d >> 30) & 0x2)), F_OF);
++        }
++    }
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ROL instruction and side effects.
+ ****************************************************************************/
+-u8 rol_byte(u8 d, u8 s)
++u8
++rol_byte(u8 d, u8 s)
+ {
+     register unsigned int res, cnt, mask;
+ 
+@@ -1121,87 +1168,90 @@ u8 rol_byte(u8 d, u8 s)
+        IF n > 0 
+        1) B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_(0)
+        2) B_(n-1) .. B_(0) <-  b_(7) .. b_(8-n)
+-	 */
++     */
+     res = d;
+-	if ((cnt = s % 8) != 0) {
+-		/* B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_(0) */
+-		res = (d << cnt);
++    if ((cnt = s % 8) != 0) {
++        /* B_(7) .. B_(n)  <-  b_(8-(n+1)) .. b_(0) */
++        res = (d << cnt);
+ 
+-		/* B_(n-1) .. B_(0) <-  b_(7) .. b_(8-n) */
+-		mask = (1 << cnt) - 1;
+-		res |= (d >> (8 - cnt)) & mask;
++        /* B_(n-1) .. B_(0) <-  b_(7) .. b_(8-n) */
++        mask = (1 << cnt) - 1;
++        res |= (d >> (8 - cnt)) & mask;
+ 
+-		/* set the new carry flag, Note that it is the low order
+-		   bit of the result!!!                               */
+-		CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+-		/* OVERFLOW is set *IFF* s==1, then it is the
+-		   xor of CF and the most significant bit.  Blecck. */
+-		CONDITIONAL_SET_FLAG(s == 1 &&
+-							 XOR2((res & 0x1) + ((res >> 6) & 0x2)),
+-							 F_OF);
+-	} if (s != 0) {
+-		/* set the new carry flag, Note that it is the low order
+-		   bit of the result!!!                               */
+-		CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+-	}
+-	return (u8)res;
++        /* set the new carry flag, Note that it is the low order
++           bit of the result!!!                               */
++        CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++        /* OVERFLOW is set *IFF* s==1, then it is the
++           xor of CF and the most significant bit.  Blecck. */
++        CONDITIONAL_SET_FLAG(s == 1 &&
++                             XOR2((res & 0x1) + ((res >> 6) & 0x2)), F_OF);
++    }
++    if (s != 0) {
++        /* set the new carry flag, Note that it is the low order
++           bit of the result!!!                               */
++        CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++    }
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ROL instruction and side effects.
+ ****************************************************************************/
+-u16 rol_word(u16 d, u8 s)
++u16
++rol_word(u16 d, u8 s)
+ {
+     register unsigned int res, cnt, mask;
+ 
+-	res = d;
+-	if ((cnt = s % 16) != 0) {
+-		res = (d << cnt);
+-		mask = (1 << cnt) - 1;
+-		res |= (d >> (16 - cnt)) & mask;
+-		CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+-		CONDITIONAL_SET_FLAG(s == 1 &&
+-							 XOR2((res & 0x1) + ((res >> 14) & 0x2)),
+-							 F_OF);
+-	} if (s != 0) {
+-		/* set the new carry flag, Note that it is the low order
+-		   bit of the result!!!                               */
+-		CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+-	}
+-	return (u16)res;
++    res = d;
++    if ((cnt = s % 16) != 0) {
++        res = (d << cnt);
++        mask = (1 << cnt) - 1;
++        res |= (d >> (16 - cnt)) & mask;
++        CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++        CONDITIONAL_SET_FLAG(s == 1 &&
++                             XOR2((res & 0x1) + ((res >> 14) & 0x2)), F_OF);
++    }
++    if (s != 0) {
++        /* set the new carry flag, Note that it is the low order
++           bit of the result!!!                               */
++        CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++    }
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ROL instruction and side effects.
+ ****************************************************************************/
+-u32 rol_long(u32 d, u8 s)
++u32
++rol_long(u32 d, u8 s)
+ {
+     register u32 res, cnt, mask;
+ 
+-	res = d;
+-	if ((cnt = s % 32) != 0) {
+-		res = (d << cnt);
+-		mask = (1 << cnt) - 1;
+-		res |= (d >> (32 - cnt)) & mask;
+-		CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+-		CONDITIONAL_SET_FLAG(s == 1 &&
+-							 XOR2((res & 0x1) + ((res >> 30) & 0x2)),
+-							 F_OF);
+-	} if (s != 0) {
+-		/* set the new carry flag, Note that it is the low order
+-		   bit of the result!!!                               */
+-		CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
+-	}
+-	return res;
++    res = d;
++    if ((cnt = s % 32) != 0) {
++        res = (d << cnt);
++        mask = (1 << cnt) - 1;
++        res |= (d >> (32 - cnt)) & mask;
++        CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++        CONDITIONAL_SET_FLAG(s == 1 &&
++                             XOR2((res & 0x1) + ((res >> 30) & 0x2)), F_OF);
++    }
++    if (s != 0) {
++        /* set the new carry flag, Note that it is the low order
++           bit of the result!!!                               */
++        CONDITIONAL_SET_FLAG(res & 0x1, F_CF);
++    }
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ROR instruction and side effects.
+ ****************************************************************************/
+-u8 ror_byte(u8 d, u8 s)
++u8
++ror_byte(u8 d, u8 s)
+ {
+     register unsigned int res, cnt, mask;
+ 
+@@ -1219,9 +1269,9 @@ u8 ror_byte(u8 d, u8 s)
+        IF n > 0 
+        1) B_(8-(n+1)) .. B_(0)  <-  b_(7) .. b_(n)
+        2) B_(7) .. B_(8-n) <-  b_(n-1) .. b_(0)
+-	 */
+-	res = d;
+-	if ((cnt = s % 8) != 0) {           /* not a typo, do nada if cnt==0 */
++     */
++    res = d;
++    if ((cnt = s % 8) != 0) {   /* not a typo, do nada if cnt==0 */
+         /* B_(7) .. B_(8-n) <-  b_(n-1) .. b_(0) */
+         res = (d << (8 - cnt));
+ 
+@@ -1231,291 +1281,317 @@ u8 ror_byte(u8 d, u8 s)
+ 
+         /* set the new carry flag, Note that it is the low order 
+            bit of the result!!!                               */
+-		CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
+-		/* OVERFLOW is set *IFF* s==1, then it is the
++        CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
++        /* OVERFLOW is set *IFF* s==1, then it is the
+            xor of the two most significant bits.  Blecck. */
+-		CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF);
+-	} else if (s != 0) {
+-		/* set the new carry flag, Note that it is the low order
+-		   bit of the result!!!                               */
+-		CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
+-	}
+-	return (u8)res;
++        CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 6), F_OF);
++    }
++    else if (s != 0) {
++        /* set the new carry flag, Note that it is the low order
++           bit of the result!!!                               */
++        CONDITIONAL_SET_FLAG(res & 0x80, F_CF);
++    }
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ROR instruction and side effects.
+ ****************************************************************************/
+-u16 ror_word(u16 d, u8 s)
++u16
++ror_word(u16 d, u8 s)
+ {
+     register unsigned int res, cnt, mask;
+ 
+-	res = d;
+-	if ((cnt = s % 16) != 0) {
+-		res = (d << (16 - cnt));
+-		mask = (1 << (16 - cnt)) - 1;
+-		res |= (d >> (cnt)) & mask;
+-		CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
+-		CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF);
+-	} else if (s != 0) {
+-		/* set the new carry flag, Note that it is the low order
+-		   bit of the result!!!                               */
+-		CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
+-	}
+-	return (u16)res;
++    res = d;
++    if ((cnt = s % 16) != 0) {
++        res = (d << (16 - cnt));
++        mask = (1 << (16 - cnt)) - 1;
++        res |= (d >> (cnt)) & mask;
++        CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
++        CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 14), F_OF);
++    }
++    else if (s != 0) {
++        /* set the new carry flag, Note that it is the low order
++           bit of the result!!!                               */
++        CONDITIONAL_SET_FLAG(res & 0x8000, F_CF);
++    }
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the ROR instruction and side effects.
+ ****************************************************************************/
+-u32 ror_long(u32 d, u8 s)
++u32
++ror_long(u32 d, u8 s)
+ {
+-	register u32 res, cnt, mask;
++    register u32 res, cnt, mask;
+ 
+-	res = d;
+-	if ((cnt = s % 32) != 0) {
+-		res = (d << (32 - cnt));
+-		mask = (1 << (32 - cnt)) - 1;
+-		res |= (d >> (cnt)) & mask;
+-		CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
+-		CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF);
+-	} else if (s != 0) {
+-		/* set the new carry flag, Note that it is the low order
+-		   bit of the result!!!                               */
+-		CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
+-	}
+-	return res;
++    res = d;
++    if ((cnt = s % 32) != 0) {
++        res = (d << (32 - cnt));
++        mask = (1 << (32 - cnt)) - 1;
++        res |= (d >> (cnt)) & mask;
++        CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
++        CONDITIONAL_SET_FLAG(s == 1 && XOR2(res >> 30), F_OF);
++    }
++    else if (s != 0) {
++        /* set the new carry flag, Note that it is the low order
++           bit of the result!!!                               */
++        CONDITIONAL_SET_FLAG(res & 0x80000000, F_CF);
++    }
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SHL instruction and side effects.
+ ****************************************************************************/
+-u8 shl_byte(u8 d, u8 s)
++u8
++shl_byte(u8 d, u8 s)
+ {
+-	unsigned int cnt, res, cf;
+-
+-	if (s < 8) {
+-		cnt = s % 8;
++    unsigned int cnt, res, cf;
+ 
+-		/* last bit shifted out goes into carry flag */
+-		if (cnt > 0) {
+-			res = d << cnt;
+-			cf = d & (1 << (8 - cnt));
+-			CONDITIONAL_SET_FLAG(cf, F_CF);
+-			CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-			CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-			CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-		} else {
+-			res = (u8) d;
+-		}
++    if (s < 8) {
++        cnt = s % 8;
++
++        /* last bit shifted out goes into carry flag */
++        if (cnt > 0) {
++            res = d << cnt;
++            cf = d & (1 << (8 - cnt));
++            CONDITIONAL_SET_FLAG(cf, F_CF);
++            CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++            CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++            CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        }
++        else {
++            res = (u8) d;
++        }
+ 
+-		if (cnt == 1) {
+-			/* Needs simplification. */
+-			CONDITIONAL_SET_FLAG(
+-									(((res & 0x80) == 0x80) ^
+-									 (ACCESS_FLAG(F_CF) != 0)),
+-			/* was (M.x86.R_FLG&F_CF)==F_CF)), */
+-									F_OF);
+-		} else {
+-			CLEAR_FLAG(F_OF);
+-		}
+-	} else {
+-		res = 0;
+-		CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80, F_CF);
+-		CLEAR_FLAG(F_OF);
+-		CLEAR_FLAG(F_SF);
+-		SET_FLAG(F_PF);
+-		SET_FLAG(F_ZF);
++        if (cnt == 1) {
++            /* Needs simplification. */
++            CONDITIONAL_SET_FLAG((((res & 0x80) == 0x80) ^
++                                  (ACCESS_FLAG(F_CF) != 0)),
++                                 /* was (M.x86.R_FLG&F_CF)==F_CF)), */
++                                 F_OF);
++        }
++        else {
++            CLEAR_FLAG(F_OF);
++        }
+     }
+-	return (u8)res;
++    else {
++        res = 0;
++        CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80, F_CF);
++        CLEAR_FLAG(F_OF);
++        CLEAR_FLAG(F_SF);
++        SET_FLAG(F_PF);
++        SET_FLAG(F_ZF);
++    }
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SHL instruction and side effects.
+ ****************************************************************************/
+-u16 shl_word(u16 d, u8 s)
++u16
++shl_word(u16 d, u8 s)
+ {
+     unsigned int cnt, res, cf;
+ 
+-	if (s < 16) {
+-		cnt = s % 16;
+-		if (cnt > 0) {
+-			res = d << cnt;
+-			cf = d & (1 << (16 - cnt));
+-			CONDITIONAL_SET_FLAG(cf, F_CF);
+-			CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-			CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-			CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-		} else {
+-			res = (u16) d;
+-		}
+-
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG(
+-									(((res & 0x8000) == 0x8000) ^
+-									 (ACCESS_FLAG(F_CF) != 0)),
+-									F_OF);
+-        } else {
+-			CLEAR_FLAG(F_OF);
+-        }
+-    } else {
+-		res = 0;
+-		CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
+-		CLEAR_FLAG(F_OF);
+-		CLEAR_FLAG(F_SF);
+-		SET_FLAG(F_PF);
+-		SET_FLAG(F_ZF);
+-	}
+-	return (u16)res;
++    if (s < 16) {
++        cnt = s % 16;
++        if (cnt > 0) {
++            res = d << cnt;
++            cf = d & (1 << (16 - cnt));
++            CONDITIONAL_SET_FLAG(cf, F_CF);
++            CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++            CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++            CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        }
++        else {
++            res = (u16) d;
++        }
++
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^
++                                  (ACCESS_FLAG(F_CF) != 0)), F_OF);
++        }
++        else {
++            CLEAR_FLAG(F_OF);
++        }
++    }
++    else {
++        res = 0;
++        CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x8000, F_CF);
++        CLEAR_FLAG(F_OF);
++        CLEAR_FLAG(F_SF);
++        SET_FLAG(F_PF);
++        SET_FLAG(F_ZF);
++    }
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SHL instruction and side effects.
+ ****************************************************************************/
+-u32 shl_long(u32 d, u8 s)
+-{
+-	unsigned int cnt, res, cf;
+-
+-	if (s < 32) {
+-		cnt = s % 32;
+-		if (cnt > 0) {
+-			res = d << cnt;
+-			cf = d & (1 << (32 - cnt));
+-			CONDITIONAL_SET_FLAG(cf, F_CF);
+-			CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-			CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-			CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-		} else {
+-			res = d;
+-		}
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
+-								  (ACCESS_FLAG(F_CF) != 0)), F_OF);
+-		} else {
+-			CLEAR_FLAG(F_OF);
+-		}
+-	} else {
+-		res = 0;
+-		CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
+-		CLEAR_FLAG(F_OF);
+-		CLEAR_FLAG(F_SF);
+-		SET_FLAG(F_PF);
+-		SET_FLAG(F_ZF);
+-	}
+-	return res;
++u32
++shl_long(u32 d, u8 s)
++{
++    unsigned int cnt, res, cf;
++
++    if (s < 32) {
++        cnt = s % 32;
++        if (cnt > 0) {
++            res = d << cnt;
++            cf = d & (1 << (32 - cnt));
++            CONDITIONAL_SET_FLAG(cf, F_CF);
++            CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++            CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++            CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        }
++        else {
++            res = d;
++        }
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
++                                  (ACCESS_FLAG(F_CF) != 0)), F_OF);
++        }
++        else {
++            CLEAR_FLAG(F_OF);
++        }
++    }
++    else {
++        res = 0;
++        CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80000000, F_CF);
++        CLEAR_FLAG(F_OF);
++        CLEAR_FLAG(F_SF);
++        SET_FLAG(F_PF);
++        SET_FLAG(F_ZF);
++    }
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SHR instruction and side effects.
+ ****************************************************************************/
+-u8 shr_byte(u8 d, u8 s)
+-{
+-	unsigned int cnt, res, cf;
+-
+-	if (s < 8) {
+-		cnt = s % 8;
+-		if (cnt > 0) {
+-			cf = d & (1 << (cnt - 1));
+-			res = d >> cnt;
+-			CONDITIONAL_SET_FLAG(cf, F_CF);
+-			CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-			CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-			CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-		} else {
+-			res = (u8) d;
+-		}
+-
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG(XOR2(res >> 6), F_OF);
+-		} else {
+-			CLEAR_FLAG(F_OF);
+-		}
+-	} else {
+-		res = 0;
+-		CONDITIONAL_SET_FLAG((d >> (s-1)) & 0x1, F_CF);
+-		CLEAR_FLAG(F_OF);
+-		CLEAR_FLAG(F_SF);
+-		SET_FLAG(F_PF);
+-		SET_FLAG(F_ZF);
+-	}
+-	return (u8)res;
++u8
++shr_byte(u8 d, u8 s)
++{
++    unsigned int cnt, res, cf;
++
++    if (s < 8) {
++        cnt = s % 8;
++        if (cnt > 0) {
++            cf = d & (1 << (cnt - 1));
++            res = d >> cnt;
++            CONDITIONAL_SET_FLAG(cf, F_CF);
++            CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++            CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++            CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        }
++        else {
++            res = (u8) d;
++        }
++
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG(XOR2(res >> 6), F_OF);
++        }
++        else {
++            CLEAR_FLAG(F_OF);
++        }
++    }
++    else {
++        res = 0;
++        CONDITIONAL_SET_FLAG((d >> (s - 1)) & 0x1, F_CF);
++        CLEAR_FLAG(F_OF);
++        CLEAR_FLAG(F_SF);
++        SET_FLAG(F_PF);
++        SET_FLAG(F_ZF);
++    }
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SHR instruction and side effects.
+ ****************************************************************************/
+-u16 shr_word(u16 d, u8 s)
++u16
++shr_word(u16 d, u8 s)
+ {
+-	unsigned int cnt, res, cf;
++    unsigned int cnt, res, cf;
+ 
+-	if (s < 16) {
+-		cnt = s % 16;
+-		if (cnt > 0) {
+-			cf = d & (1 << (cnt - 1));
+-			res = d >> cnt;
+-			CONDITIONAL_SET_FLAG(cf, F_CF);
+-			CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-			CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-			CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-		} else {
+-			res = d;
+-		}
++    if (s < 16) {
++        cnt = s % 16;
++        if (cnt > 0) {
++            cf = d & (1 << (cnt - 1));
++            res = d >> cnt;
++            CONDITIONAL_SET_FLAG(cf, F_CF);
++            CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++            CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++            CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        }
++        else {
++            res = d;
++        }
+ 
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+-        } else {
+-			CLEAR_FLAG(F_OF);
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+         }
+-	} else {
+-		res = 0;
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_OF);
+-		SET_FLAG(F_ZF);
+-		CLEAR_FLAG(F_SF);
+-		CLEAR_FLAG(F_PF);
++        else {
++            CLEAR_FLAG(F_OF);
++        }
++    }
++    else {
++        res = 0;
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_OF);
++        SET_FLAG(F_ZF);
++        CLEAR_FLAG(F_SF);
++        CLEAR_FLAG(F_PF);
+     }
+-	return (u16)res;
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SHR instruction and side effects.
+ ****************************************************************************/
+-u32 shr_long(u32 d, u8 s)
++u32
++shr_long(u32 d, u8 s)
+ {
+-	unsigned int cnt, res, cf;
++    unsigned int cnt, res, cf;
+ 
+-	if (s < 32) {
+-		cnt = s % 32;
+-		if (cnt > 0) {
+-			cf = d & (1 << (cnt - 1));
+-			res = d >> cnt;
+-			CONDITIONAL_SET_FLAG(cf, F_CF);
+-			CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-			CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-			CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-        } else {
++    if (s < 32) {
++        cnt = s % 32;
++        if (cnt > 0) {
++            cf = d & (1 << (cnt - 1));
++            res = d >> cnt;
++            CONDITIONAL_SET_FLAG(cf, F_CF);
++            CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++            CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++            CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        }
++        else {
+             res = d;
+         }
+         if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
+-        } else {
+-			CLEAR_FLAG(F_OF);
++            CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
++        }
++        else {
++            CLEAR_FLAG(F_OF);
+         }
+-    } else {
++    }
++    else {
+         res = 0;
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_OF);
+-		SET_FLAG(F_ZF);
+-		CLEAR_FLAG(F_SF);
+-		CLEAR_FLAG(F_PF);
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_OF);
++        SET_FLAG(F_ZF);
++        CLEAR_FLAG(F_SF);
++        CLEAR_FLAG(F_PF);
+     }
+     return res;
+ }
+@@ -1524,592 +1600,634 @@ u32 shr_long(u32 d, u8 s)
+ REMARKS:
+ Implements the SAR instruction and side effects.
+ ****************************************************************************/
+-u8 sar_byte(u8 d, u8 s)
++u8
++sar_byte(u8 d, u8 s)
+ {
+-	unsigned int cnt, res, cf, mask, sf;
++    unsigned int cnt, res, cf, mask, sf;
+ 
+-	res = d;
+-	sf = d & 0x80;
++    res = d;
++    sf = d & 0x80;
+     cnt = s % 8;
+-	if (cnt > 0 && cnt < 8) {
+-		mask = (1 << (8 - cnt)) - 1;
+-		cf = d & (1 << (cnt - 1));
+-		res = (d >> cnt) & mask;
+-		CONDITIONAL_SET_FLAG(cf, F_CF);
+-		if (sf) {
+-			res |= ~mask;
+-		}
+-		CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-		CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-		CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-    } else if (cnt >= 8) {
++    if (cnt > 0 && cnt < 8) {
++        mask = (1 << (8 - cnt)) - 1;
++        cf = d & (1 << (cnt - 1));
++        res = (d >> cnt) & mask;
++        CONDITIONAL_SET_FLAG(cf, F_CF);
++        if (sf) {
++            res |= ~mask;
++        }
++        CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++        CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    }
++    else if (cnt >= 8) {
+         if (sf) {
+             res = 0xff;
+-			SET_FLAG(F_CF);
+-			CLEAR_FLAG(F_ZF);
+-			SET_FLAG(F_SF);
+-			SET_FLAG(F_PF);
+-		} else {
+-			res = 0;
+-			CLEAR_FLAG(F_CF);
+-			SET_FLAG(F_ZF);
+-			CLEAR_FLAG(F_SF);
+-			CLEAR_FLAG(F_PF);
+-		}
+-	}
+-	return (u8)res;
++            SET_FLAG(F_CF);
++            CLEAR_FLAG(F_ZF);
++            SET_FLAG(F_SF);
++            SET_FLAG(F_PF);
++        }
++        else {
++            res = 0;
++            CLEAR_FLAG(F_CF);
++            SET_FLAG(F_ZF);
++            CLEAR_FLAG(F_SF);
++            CLEAR_FLAG(F_PF);
++        }
++    }
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SAR instruction and side effects.
+ ****************************************************************************/
+-u16 sar_word(u16 d, u8 s)
++u16
++sar_word(u16 d, u8 s)
+ {
+     unsigned int cnt, res, cf, mask, sf;
+ 
+     sf = d & 0x8000;
+     cnt = s % 16;
+-	res = d;
+-	if (cnt > 0 && cnt < 16) {
++    res = d;
++    if (cnt > 0 && cnt < 16) {
+         mask = (1 << (16 - cnt)) - 1;
+         cf = d & (1 << (cnt - 1));
+         res = (d >> cnt) & mask;
+-		CONDITIONAL_SET_FLAG(cf, F_CF);
++        CONDITIONAL_SET_FLAG(cf, F_CF);
+         if (sf) {
+             res |= ~mask;
+         }
+-		CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-		CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-		CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-    } else if (cnt >= 16) {
++        CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++        CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++        CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    }
++    else if (cnt >= 16) {
+         if (sf) {
+             res = 0xffff;
+-			SET_FLAG(F_CF);
+-			CLEAR_FLAG(F_ZF);
+-			SET_FLAG(F_SF);
+-			SET_FLAG(F_PF);
+-        } else {
++            SET_FLAG(F_CF);
++            CLEAR_FLAG(F_ZF);
++            SET_FLAG(F_SF);
++            SET_FLAG(F_PF);
++        }
++        else {
+             res = 0;
+-			CLEAR_FLAG(F_CF);
+-			SET_FLAG(F_ZF);
+-			CLEAR_FLAG(F_SF);
+-			CLEAR_FLAG(F_PF);
++            CLEAR_FLAG(F_CF);
++            SET_FLAG(F_ZF);
++            CLEAR_FLAG(F_SF);
++            CLEAR_FLAG(F_PF);
+         }
+     }
+-	return (u16)res;
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SAR instruction and side effects.
+ ****************************************************************************/
+-u32 sar_long(u32 d, u8 s)
++u32
++sar_long(u32 d, u8 s)
+ {
+     u32 cnt, res, cf, mask, sf;
+ 
+     sf = d & 0x80000000;
+     cnt = s % 32;
+-	res = d;
+-	if (cnt > 0 && cnt < 32) {
++    res = d;
++    if (cnt > 0 && cnt < 32) {
+         mask = (1 << (32 - cnt)) - 1;
+-		cf = d & (1 << (cnt - 1));
++        cf = d & (1 << (cnt - 1));
+         res = (d >> cnt) & mask;
+-		CONDITIONAL_SET_FLAG(cf, F_CF);
++        CONDITIONAL_SET_FLAG(cf, F_CF);
+         if (sf) {
+             res |= ~mask;
+         }
+-		CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-		CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-		CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-    } else if (cnt >= 32) {
++        CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++        CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++        CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    }
++    else if (cnt >= 32) {
+         if (sf) {
+             res = 0xffffffff;
+-			SET_FLAG(F_CF);
+-			CLEAR_FLAG(F_ZF);
+-			SET_FLAG(F_SF);
+-			SET_FLAG(F_PF);
+-		} else {
+-			res = 0;
+-			CLEAR_FLAG(F_CF);
+-			SET_FLAG(F_ZF);
+-			CLEAR_FLAG(F_SF);
+-			CLEAR_FLAG(F_PF);
+-		}
+-	}
+-	return res;
++            SET_FLAG(F_CF);
++            CLEAR_FLAG(F_ZF);
++            SET_FLAG(F_SF);
++            SET_FLAG(F_PF);
++        }
++        else {
++            res = 0;
++            CLEAR_FLAG(F_CF);
++            SET_FLAG(F_ZF);
++            CLEAR_FLAG(F_SF);
++            CLEAR_FLAG(F_PF);
++        }
++    }
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SHLD instruction and side effects.
+ ****************************************************************************/
+-u16 shld_word (u16 d, u16 fill, u8 s)
+-{
+-	unsigned int cnt, res, cf;
+-
+-	if (s < 16) {
+-		cnt = s % 16;
+-		if (cnt > 0) {
+-			res = (d << cnt) | (fill >> (16-cnt));
+-			cf = d & (1 << (16 - cnt));
+-			CONDITIONAL_SET_FLAG(cf, F_CF);
+-			CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-			CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-			CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-		} else {
+-			res = d;
+-		}
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^
+-								  (ACCESS_FLAG(F_CF) != 0)), F_OF);
+-		} else {
+-			CLEAR_FLAG(F_OF);
+-		}
+-	} else {
+-		res = 0;
+-		CONDITIONAL_SET_FLAG((d << (s-1)) & 0x8000, F_CF);
+-		CLEAR_FLAG(F_OF);
+-		CLEAR_FLAG(F_SF);
+-		SET_FLAG(F_PF);
+-		SET_FLAG(F_ZF);
+-	}
+-	return (u16)res;
++u16
++shld_word(u16 d, u16 fill, u8 s)
++{
++    unsigned int cnt, res, cf;
++
++    if (s < 16) {
++        cnt = s % 16;
++        if (cnt > 0) {
++            res = (d << cnt) | (fill >> (16 - cnt));
++            cf = d & (1 << (16 - cnt));
++            CONDITIONAL_SET_FLAG(cf, F_CF);
++            CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++            CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++            CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        }
++        else {
++            res = d;
++        }
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG((((res & 0x8000) == 0x8000) ^
++                                  (ACCESS_FLAG(F_CF) != 0)), F_OF);
++        }
++        else {
++            CLEAR_FLAG(F_OF);
++        }
++    }
++    else {
++        res = 0;
++        CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x8000, F_CF);
++        CLEAR_FLAG(F_OF);
++        CLEAR_FLAG(F_SF);
++        SET_FLAG(F_PF);
++        SET_FLAG(F_ZF);
++    }
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SHLD instruction and side effects.
+ ****************************************************************************/
+-u32 shld_long (u32 d, u32 fill, u8 s)
+-{
+-	unsigned int cnt, res, cf;
+-
+-	if (s < 32) {
+-		cnt = s % 32;
+-		if (cnt > 0) {
+-			res = (d << cnt) | (fill >> (32-cnt));
+-			cf = d & (1 << (32 - cnt));
+-			CONDITIONAL_SET_FLAG(cf, F_CF);
+-			CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-			CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-			CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-		} else {
+-			res = d;
+-		}
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
+-								  (ACCESS_FLAG(F_CF) != 0)), F_OF);
+-		} else {
+-			CLEAR_FLAG(F_OF);
+-		}
+-	} else {
+-		res = 0;
+-		CONDITIONAL_SET_FLAG((d << (s-1)) & 0x80000000, F_CF);
+-		CLEAR_FLAG(F_OF);
+-		CLEAR_FLAG(F_SF);
+-		SET_FLAG(F_PF);
+-		SET_FLAG(F_ZF);
+-	}
+-	return res;
++u32
++shld_long(u32 d, u32 fill, u8 s)
++{
++    unsigned int cnt, res, cf;
++
++    if (s < 32) {
++        cnt = s % 32;
++        if (cnt > 0) {
++            res = (d << cnt) | (fill >> (32 - cnt));
++            cf = d & (1 << (32 - cnt));
++            CONDITIONAL_SET_FLAG(cf, F_CF);
++            CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++            CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++            CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        }
++        else {
++            res = d;
++        }
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG((((res & 0x80000000) == 0x80000000) ^
++                                  (ACCESS_FLAG(F_CF) != 0)), F_OF);
++        }
++        else {
++            CLEAR_FLAG(F_OF);
++        }
++    }
++    else {
++        res = 0;
++        CONDITIONAL_SET_FLAG((d << (s - 1)) & 0x80000000, F_CF);
++        CLEAR_FLAG(F_OF);
++        CLEAR_FLAG(F_SF);
++        SET_FLAG(F_PF);
++        SET_FLAG(F_ZF);
++    }
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SHRD instruction and side effects.
+ ****************************************************************************/
+-u16 shrd_word (u16 d, u16 fill, u8 s)
++u16
++shrd_word(u16 d, u16 fill, u8 s)
+ {
+-	unsigned int cnt, res, cf;
++    unsigned int cnt, res, cf;
+ 
+-	if (s < 16) {
+-		cnt = s % 16;
+-		if (cnt > 0) {
+-			cf = d & (1 << (cnt - 1));
+-			res = (d >> cnt) | (fill << (16 - cnt));
+-			CONDITIONAL_SET_FLAG(cf, F_CF);
+-			CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-			CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-			CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-		} else {
+-			res = d;
+-		}
++    if (s < 16) {
++        cnt = s % 16;
++        if (cnt > 0) {
++            cf = d & (1 << (cnt - 1));
++            res = (d >> cnt) | (fill << (16 - cnt));
++            CONDITIONAL_SET_FLAG(cf, F_CF);
++            CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++            CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++            CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        }
++        else {
++            res = d;
++        }
+ 
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
+-        } else {
+-			CLEAR_FLAG(F_OF);
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG(XOR2(res >> 14), F_OF);
++        }
++        else {
++            CLEAR_FLAG(F_OF);
+         }
+-	} else {
+-		res = 0;
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_OF);
+-		SET_FLAG(F_ZF);
+-		CLEAR_FLAG(F_SF);
+-		CLEAR_FLAG(F_PF);
+     }
+-	return (u16)res;
++    else {
++        res = 0;
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_OF);
++        SET_FLAG(F_ZF);
++        CLEAR_FLAG(F_SF);
++        CLEAR_FLAG(F_PF);
++    }
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SHRD instruction and side effects.
+ ****************************************************************************/
+-u32 shrd_long (u32 d, u32 fill, u8 s)
++u32
++shrd_long(u32 d, u32 fill, u8 s)
+ {
+-	unsigned int cnt, res, cf;
++    unsigned int cnt, res, cf;
+ 
+-	if (s < 32) {
+-		cnt = s % 32;
+-		if (cnt > 0) {
+-			cf = d & (1 << (cnt - 1));
+-			res = (d >> cnt) | (fill << (32 - cnt));
+-			CONDITIONAL_SET_FLAG(cf, F_CF);
+-			CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-			CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-			CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-		} else {
+-			res = d;
+-		}
+-		if (cnt == 1) {
+-			CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
+-        } else {
+-			CLEAR_FLAG(F_OF);
++    if (s < 32) {
++        cnt = s % 32;
++        if (cnt > 0) {
++            cf = d & (1 << (cnt - 1));
++            res = (d >> cnt) | (fill << (32 - cnt));
++            CONDITIONAL_SET_FLAG(cf, F_CF);
++            CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++            CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++            CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++        }
++        else {
++            res = d;
++        }
++        if (cnt == 1) {
++            CONDITIONAL_SET_FLAG(XOR2(res >> 30), F_OF);
++        }
++        else {
++            CLEAR_FLAG(F_OF);
+         }
+-	} else {
+-		res = 0;
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_OF);
+-		SET_FLAG(F_ZF);
+-		CLEAR_FLAG(F_SF);
+-		CLEAR_FLAG(F_PF);
+     }
+-	return res;
++    else {
++        res = 0;
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_OF);
++        SET_FLAG(F_ZF);
++        CLEAR_FLAG(F_SF);
++        CLEAR_FLAG(F_PF);
++    }
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SBB instruction and side effects.
+ ****************************************************************************/
+-u8 sbb_byte(u8 d, u8 s)
++u8
++sbb_byte(u8 d, u8 s)
+ {
+-    register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+     register u32 bc;
+ 
+-	if (ACCESS_FLAG(F_CF))
+-		res = d - s - 1;
+-	else
+-		res = d - s;
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    if (ACCESS_FLAG(F_CF))
++        res = d - s - 1;
++    else
++        res = d - s;
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the borrow chain.  See note at top */
+-	bc = (res & (~d | s)) | (~d & s);
+-	CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return (u8)res;
++    /* calculate the borrow chain.  See note at top */
++    bc = (res & (~d | s)) | (~d & s);
++    CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SBB instruction and side effects.
+ ****************************************************************************/
+-u16 sbb_word(u16 d, u16 s)
++u16
++sbb_word(u16 d, u16 s)
+ {
+-    register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+     register u32 bc;
+ 
+-	if (ACCESS_FLAG(F_CF))
++    if (ACCESS_FLAG(F_CF))
+         res = d - s - 1;
+     else
+         res = d - s;
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the borrow chain.  See note at top */
+-	bc = (res & (~d | s)) | (~d & s);
+-	CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return (u16)res;
++    /* calculate the borrow chain.  See note at top */
++    bc = (res & (~d | s)) | (~d & s);
++    CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SBB instruction and side effects.
+ ****************************************************************************/
+-u32 sbb_long(u32 d, u32 s)
++u32
++sbb_long(u32 d, u32 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 bc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 bc;
+ 
+-	if (ACCESS_FLAG(F_CF))
++    if (ACCESS_FLAG(F_CF))
+         res = d - s - 1;
+     else
+         res = d - s;
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the borrow chain.  See note at top */
+-	bc = (res & (~d | s)) | (~d & s);
+-	CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return res;
++    /* calculate the borrow chain.  See note at top */
++    bc = (res & (~d | s)) | (~d & s);
++    CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SUB instruction and side effects.
+ ****************************************************************************/
+-u8 sub_byte(u8 d, u8 s)
++u8
++sub_byte(u8 d, u8 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 bc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 bc;
+ 
+-	res = d - s;
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    res = d - s;
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the borrow chain.  See note at top */
+-	bc = (res & (~d | s)) | (~d & s);
+-	CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return (u8)res;
++    /* calculate the borrow chain.  See note at top */
++    bc = (res & (~d | s)) | (~d & s);
++    CONDITIONAL_SET_FLAG(bc & 0x80, F_CF);
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 6), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return (u8) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SUB instruction and side effects.
+ ****************************************************************************/
+-u16 sub_word(u16 d, u16 s)
++u16
++sub_word(u16 d, u16 s)
+ {
+-    register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+     register u32 bc;
+ 
+     res = d - s;
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the borrow chain.  See note at top */
+-	bc = (res & (~d | s)) | (~d & s);
+-	CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return (u16)res;
++    /* calculate the borrow chain.  See note at top */
++    bc = (res & (~d | s)) | (~d & s);
++    CONDITIONAL_SET_FLAG(bc & 0x8000, F_CF);
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 14), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return (u16) res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the SUB instruction and side effects.
+ ****************************************************************************/
+-u32 sub_long(u32 d, u32 s)
++u32
++sub_long(u32 d, u32 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
+-	register u32 bc;
++    register u32 res;           /* all operands in native machine order */
++    register u32 bc;
+ 
+-	res = d - s;
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    res = d - s;
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG((res & 0xffffffff) == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+ 
+-	/* calculate the borrow chain.  See note at top */
+-	bc = (res & (~d | s)) | (~d & s);
+-	CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
+-	CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
+-	CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
+-	return res;
++    /* calculate the borrow chain.  See note at top */
++    bc = (res & (~d | s)) | (~d & s);
++    CONDITIONAL_SET_FLAG(bc & 0x80000000, F_CF);
++    CONDITIONAL_SET_FLAG(XOR2(bc >> 30), F_OF);
++    CONDITIONAL_SET_FLAG(bc & 0x8, F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the TEST instruction and side effects.
+ ****************************************************************************/
+-void test_byte(u8 d, u8 s)
++void
++test_byte(u8 d, u8 s)
+ {
+-    register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+ 
+     res = d & s;
+ 
+-	CLEAR_FLAG(F_OF);
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CLEAR_FLAG(F_OF);
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+     /* AF == dont care */
+-	CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_CF);
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the TEST instruction and side effects.
+ ****************************************************************************/
+-void test_word(u16 d, u16 s)
++void
++test_word(u16 d, u16 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+ 
+-	res = d & s;
++    res = d & s;
+ 
+-	CLEAR_FLAG(F_OF);
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-	/* AF == dont care */
+-	CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_OF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    /* AF == dont care */
++    CLEAR_FLAG(F_CF);
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the TEST instruction and side effects.
+ ****************************************************************************/
+-void test_long(u32 d, u32 s)
++void
++test_long(u32 d, u32 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+ 
+-	res = d & s;
++    res = d & s;
+ 
+-	CLEAR_FLAG(F_OF);
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-	/* AF == dont care */
+-	CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_OF);
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    /* AF == dont care */
++    CLEAR_FLAG(F_CF);
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the XOR instruction and side effects.
+ ****************************************************************************/
+-u8 xor_byte(u8 d, u8 s)
++u8
++xor_byte(u8 d, u8 s)
+ {
+-	register u8 res;    /* all operands in native machine order */
++    register u8 res;            /* all operands in native machine order */
+ 
+-	res = d ^ s;
+-	CLEAR_FLAG(F_OF);
+-	CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	return res;
++    res = d ^ s;
++    CLEAR_FLAG(F_OF);
++    CONDITIONAL_SET_FLAG(res & 0x80, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res), F_PF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the XOR instruction and side effects.
+ ****************************************************************************/
+-u16 xor_word(u16 d, u16 s)
++u16
++xor_word(u16 d, u16 s)
+ {
+-	register u16 res;   /* all operands in native machine order */
++    register u16 res;           /* all operands in native machine order */
+ 
+-	res = d ^ s;
+-	CLEAR_FLAG(F_OF);
+-	CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	return res;
++    res = d ^ s;
++    CLEAR_FLAG(F_OF);
++    CONDITIONAL_SET_FLAG(res & 0x8000, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the XOR instruction and side effects.
+ ****************************************************************************/
+-u32 xor_long(u32 d, u32 s)
++u32
++xor_long(u32 d, u32 s)
+ {
+-	register u32 res;   /* all operands in native machine order */
++    register u32 res;           /* all operands in native machine order */
+ 
+-	res = d ^ s;
+-	CLEAR_FLAG(F_OF);
+-	CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
+-	CONDITIONAL_SET_FLAG(res == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	return res;
++    res = d ^ s;
++    CLEAR_FLAG(F_OF);
++    CONDITIONAL_SET_FLAG(res & 0x80000000, F_SF);
++    CONDITIONAL_SET_FLAG(res == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(res & 0xff), F_PF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    return res;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the IMUL instruction and side effects.
+ ****************************************************************************/
+-void imul_byte(u8 s)
++void
++imul_byte(u8 s)
+ {
+-	s16 res = (s16)((s8)M.x86.R_AL * (s8)s);
++    s16 res = (s16) ((s8) M.x86.R_AL * (s8) s);
+ 
+-	M.x86.R_AX = res;
+-	if (((M.x86.R_AL & 0x80) == 0 && M.x86.R_AH == 0x00) ||
+-		((M.x86.R_AL & 0x80) != 0 && M.x86.R_AH == 0xFF)) {
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_OF);
+-	} else {
+-		SET_FLAG(F_CF);
+-		SET_FLAG(F_OF);
+-	}
++    M.x86.R_AX = res;
++    if (((M.x86.R_AL & 0x80) == 0 && M.x86.R_AH == 0x00) ||
++        ((M.x86.R_AL & 0x80) != 0 && M.x86.R_AH == 0xFF)) {
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_OF);
++    }
++    else {
++        SET_FLAG(F_CF);
++        SET_FLAG(F_OF);
++    }
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the IMUL instruction and side effects.
+ ****************************************************************************/
+-void imul_word(u16 s)
++void
++imul_word(u16 s)
+ {
+-	s32 res = (s16)M.x86.R_AX * (s16)s;
++    s32 res = (s16) M.x86.R_AX * (s16) s;
+ 
+-	M.x86.R_AX = (u16)res;
+-	M.x86.R_DX = (u16)(res >> 16);
+-	if (((M.x86.R_AX & 0x8000) == 0 && M.x86.R_DX == 0x00) ||
+-		((M.x86.R_AX & 0x8000) != 0 && M.x86.R_DX == 0xFF)) {
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_OF);
+-	} else {
+-		SET_FLAG(F_CF);
+-		SET_FLAG(F_OF);
+-	}
++    M.x86.R_AX = (u16) res;
++    M.x86.R_DX = (u16) (res >> 16);
++    if (((M.x86.R_AX & 0x8000) == 0 && M.x86.R_DX == 0x00) ||
++        ((M.x86.R_AX & 0x8000) != 0 && M.x86.R_DX == 0xFF)) {
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_OF);
++    }
++    else {
++        SET_FLAG(F_CF);
++        SET_FLAG(F_OF);
++    }
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the IMUL instruction and side effects.
+ ****************************************************************************/
+-void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
++void
++imul_long_direct(u32 * res_lo, u32 * res_hi, u32 d, u32 s)
+ {
+ #ifdef	__HAS_LONG_LONG__
+-	s64 res = (s32)d * (s32)s;
++    s64 res = (s64) (s32) d * (s32) s;
+ 
+-	*res_lo = (u32)res;
+-	*res_hi = (u32)(res >> 32);
++    *res_lo = (u32) res;
++    *res_hi = (u32) (res >> 32);
+ #else
+-	u32	d_lo,d_hi,d_sign;
+-	u32	s_lo,s_hi,s_sign;
+-	u32	rlo_lo,rlo_hi,rhi_lo;
+-
+-	if ((d_sign = d & 0x80000000) != 0)
+-		d = -d;
+-	d_lo = d & 0xFFFF;
+-	d_hi = d >> 16;
+-	if ((s_sign = s & 0x80000000) != 0)
+-		s = -s;
+-	s_lo = s & 0xFFFF;
+-	s_hi = s >> 16;
+-	rlo_lo = d_lo * s_lo;
+-	rlo_hi = (d_hi * s_lo + d_lo * s_hi) + (rlo_lo >> 16);
+-	rhi_lo = d_hi * s_hi + (rlo_hi >> 16);
+-	*res_lo = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
+-	*res_hi = rhi_lo;
+-	if (d_sign != s_sign) {
+-		d = ~*res_lo;
+-		s = (((d & 0xFFFF) + 1) >> 16) + (d >> 16);
+-		*res_lo = ~*res_lo+1;
+-		*res_hi = ~*res_hi+(s >> 16);
+-		}
++    u32 d_lo, d_hi, d_sign;
++    u32 s_lo, s_hi, s_sign;
++    u32 rlo_lo, rlo_hi, rhi_lo;
++
++    if ((d_sign = d & 0x80000000) != 0)
++        d = -d;
++    d_lo = d & 0xFFFF;
++    d_hi = d >> 16;
++    if ((s_sign = s & 0x80000000) != 0)
++        s = -s;
++    s_lo = s & 0xFFFF;
++    s_hi = s >> 16;
++    rlo_lo = d_lo * s_lo;
++    rlo_hi = (d_hi * s_lo + d_lo * s_hi) + (rlo_lo >> 16);
++    rhi_lo = d_hi * s_hi + (rlo_hi >> 16);
++    *res_lo = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
++    *res_hi = rhi_lo;
++    if (d_sign != s_sign) {
++        d = ~*res_lo;
++        s = (((d & 0xFFFF) + 1) >> 16) + (d >> 16);
++        *res_lo = ~*res_lo + 1;
++        *res_hi = ~*res_hi + (s >> 16);
++    }
+ #endif
+ }
+ 
+@@ -2117,53 +2235,59 @@ void imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s)
+ REMARKS:
+ Implements the IMUL instruction and side effects.
+ ****************************************************************************/
+-void imul_long(u32 s)
++void
++imul_long(u32 s)
+ {
+-	imul_long_direct(&M.x86.R_EAX,&M.x86.R_EDX,M.x86.R_EAX,s);
+-	if (((M.x86.R_EAX & 0x80000000) == 0 && M.x86.R_EDX == 0x00) ||
+-		((M.x86.R_EAX & 0x80000000) != 0 && M.x86.R_EDX == 0xFF)) {
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_OF);
+-	} else {
+-		SET_FLAG(F_CF);
+-		SET_FLAG(F_OF);
+-	}
++    imul_long_direct(&M.x86.R_EAX, &M.x86.R_EDX, M.x86.R_EAX, s);
++    if (((M.x86.R_EAX & 0x80000000) == 0 && M.x86.R_EDX == 0x00) ||
++        ((M.x86.R_EAX & 0x80000000) != 0 && M.x86.R_EDX == 0xFF)) {
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_OF);
++    }
++    else {
++        SET_FLAG(F_CF);
++        SET_FLAG(F_OF);
++    }
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the MUL instruction and side effects.
+ ****************************************************************************/
+-void mul_byte(u8 s)
++void
++mul_byte(u8 s)
+ {
+-	u16 res = (u16)(M.x86.R_AL * s);
++    u16 res = (u16) (M.x86.R_AL * s);
+ 
+-	M.x86.R_AX = res;
+-	if (M.x86.R_AH == 0) {
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_OF);
+-	} else {
+-		SET_FLAG(F_CF);
+-		SET_FLAG(F_OF);
+-	}
++    M.x86.R_AX = res;
++    if (M.x86.R_AH == 0) {
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_OF);
++    }
++    else {
++        SET_FLAG(F_CF);
++        SET_FLAG(F_OF);
++    }
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the MUL instruction and side effects.
+ ****************************************************************************/
+-void mul_word(u16 s)
++void
++mul_word(u16 s)
+ {
+-	u32 res = M.x86.R_AX * s;
++    u32 res = M.x86.R_AX * s;
+ 
+-	M.x86.R_AX = (u16)res;
+-	M.x86.R_DX = (u16)(res >> 16);
+-	if (M.x86.R_DX == 0) {
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_OF);
+-    } else {
+-		SET_FLAG(F_CF);
+-		SET_FLAG(F_OF);
++    M.x86.R_AX = (u16) res;
++    M.x86.R_DX = (u16) (res >> 16);
++    if (M.x86.R_DX == 0) {
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_OF);
++    }
++    else {
++        SET_FLAG(F_CF);
++        SET_FLAG(F_OF);
+     }
+ }
+ 
+@@ -2171,36 +2295,38 @@ void mul_word(u16 s)
+ REMARKS:
+ Implements the MUL instruction and side effects.
+ ****************************************************************************/
+-void mul_long(u32 s)
++void
++mul_long(u32 s)
+ {
+ #ifdef	__HAS_LONG_LONG__
+-	u64 res = (u32)M.x86.R_EAX * (u32)s;
++    u64 res = (u64) M.x86.R_EAX * s;
+ 
+-	M.x86.R_EAX = (u32)res;
+-	M.x86.R_EDX = (u32)(res >> 32);
++    M.x86.R_EAX = (u32) res;
++    M.x86.R_EDX = (u32) (res >> 32);
+ #else
+-	u32	a,a_lo,a_hi;
+-	u32	s_lo,s_hi;
+-	u32	rlo_lo,rlo_hi,rhi_lo;
+-
+-	a = M.x86.R_EAX;
+-	a_lo = a & 0xFFFF;
+-	a_hi = a >> 16;
+-	s_lo = s & 0xFFFF;
+-	s_hi = s >> 16;
+-	rlo_lo = a_lo * s_lo;
+-	rlo_hi = (a_hi * s_lo + a_lo * s_hi) + (rlo_lo >> 16);
+-	rhi_lo = a_hi * s_hi + (rlo_hi >> 16);
+-	M.x86.R_EAX = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
+-	M.x86.R_EDX = rhi_lo;
++    u32 a, a_lo, a_hi;
++    u32 s_lo, s_hi;
++    u32 rlo_lo, rlo_hi, rhi_lo;
++
++    a = M.x86.R_EAX;
++    a_lo = a & 0xFFFF;
++    a_hi = a >> 16;
++    s_lo = s & 0xFFFF;
++    s_hi = s >> 16;
++    rlo_lo = a_lo * s_lo;
++    rlo_hi = (a_hi * s_lo + a_lo * s_hi) + (rlo_lo >> 16);
++    rhi_lo = a_hi * s_hi + (rlo_hi >> 16);
++    M.x86.R_EAX = (rlo_hi << 16) | (rlo_lo & 0xFFFF);
++    M.x86.R_EDX = rhi_lo;
+ #endif
+ 
+-	if (M.x86.R_EDX == 0) {
+-		CLEAR_FLAG(F_CF);
+-		CLEAR_FLAG(F_OF);
+-	} else {
+-		SET_FLAG(F_CF);
+-		SET_FLAG(F_OF);
++    if (M.x86.R_EDX == 0) {
++        CLEAR_FLAG(F_CF);
++        CLEAR_FLAG(F_OF);
++    }
++    else {
++        SET_FLAG(F_CF);
++        SET_FLAG(F_OF);
+     }
+ }
+ 
+@@ -2208,309 +2334,319 @@ void mul_long(u32 s)
+ REMARKS:
+ Implements the IDIV instruction and side effects.
+ ****************************************************************************/
+-void idiv_byte(u8 s)
++void
++idiv_byte(u8 s)
+ {
+     s32 dvd, div, mod;
+ 
+-	dvd = (s16)M.x86.R_AX;
+-	if (s == 0) {
+-		x86emu_intr_raise(0);
++    dvd = (s16) M.x86.R_AX;
++    if (s == 0) {
++        x86emu_intr_raise(0);
++        return;
++    }
++    div = dvd / (s8) s;
++    mod = dvd % (s8) s;
++    if (abs(div) > 0x7f) {
++        x86emu_intr_raise(0);
+         return;
+-	}
+-	div = dvd / (s8)s;
+-	mod = dvd % (s8)s;
+-	if (abs(div) > 0x7f) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
+-	M.x86.R_AL = (s8) div;
+-	M.x86.R_AH = (s8) mod;
++    }
++    M.x86.R_AL = (s8) div;
++    M.x86.R_AH = (s8) mod;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the IDIV instruction and side effects.
+ ****************************************************************************/
+-void idiv_word(u16 s)
++void
++idiv_word(u16 s)
+ {
+-	s32 dvd, div, mod;
++    s32 dvd, div, mod;
+ 
+-	dvd = (((s32)M.x86.R_DX) << 16) | M.x86.R_AX;
+-	if (s == 0) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
+-	div = dvd / (s16)s;
+-	mod = dvd % (s16)s;
+-	if (abs(div) > 0x7fff) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_SF);
+-	CONDITIONAL_SET_FLAG(div == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
++    dvd = (((s32) M.x86.R_DX) << 16) | M.x86.R_AX;
++    if (s == 0) {
++        x86emu_intr_raise(0);
++        return;
++    }
++    div = dvd / (s16) s;
++    mod = dvd % (s16) s;
++    if (abs(div) > 0x7fff) {
++        x86emu_intr_raise(0);
++        return;
++    }
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_SF);
++    CONDITIONAL_SET_FLAG(div == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+ 
+-	M.x86.R_AX = (u16)div;
+-	M.x86.R_DX = (u16)mod;
++    M.x86.R_AX = (u16) div;
++    M.x86.R_DX = (u16) mod;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the IDIV instruction and side effects.
+ ****************************************************************************/
+-void idiv_long(u32 s)
++void
++idiv_long(u32 s)
+ {
+ #ifdef	__HAS_LONG_LONG__
+-	s64 dvd, div, mod;
+-
+-	dvd = (((s64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
+-	if (s == 0) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
+-	div = dvd / (s32)s;
+-	mod = dvd % (s32)s;
+-	if (abs(div) > 0x7fffffff) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
++    s64 dvd, div, mod;
++
++    dvd = (((s64) M.x86.R_EDX) << 32) | M.x86.R_EAX;
++    if (s == 0) {
++        x86emu_intr_raise(0);
++        return;
++    }
++    div = dvd / (s32) s;
++    mod = dvd % (s32) s;
++    if (abs(div) > 0x7fffffff) {
++        x86emu_intr_raise(0);
++        return;
++    }
+ #else
+-	s32 div = 0, mod;
+-	s32 h_dvd = M.x86.R_EDX;
+-	u32 l_dvd = M.x86.R_EAX;
+-	u32 abs_s = s & 0x7FFFFFFF;
+-	u32 abs_h_dvd = h_dvd & 0x7FFFFFFF;
+-	u32 h_s = abs_s >> 1;
+-	u32 l_s = abs_s << 31;
+-	int counter = 31;
+-	int carry;
+-
+-	if (s == 0) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
+-	do {
+-		div <<= 1;
+-		carry = (l_dvd >= l_s) ? 0 : 1;
+-		
+-		if (abs_h_dvd < (h_s + carry)) {
+-			h_s >>= 1;
+-			l_s = abs_s << (--counter);
+-			continue;
+-		} else {
+-			abs_h_dvd -= (h_s + carry);
+-			l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
+-				: (l_dvd - l_s);
+-			h_s >>= 1;
+-			l_s = abs_s << (--counter);
+-			div |= 1;
+-			continue;
+-		}
+-		
+-	} while (counter > -1);
+-	/* overflow */
+-	if (abs_h_dvd || (l_dvd > abs_s)) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
+-	/* sign */
+-	div |= ((h_dvd & 0x10000000) ^ (s & 0x10000000));
+-	mod = l_dvd;
++    s32 div = 0, mod;
++    s32 h_dvd = M.x86.R_EDX;
++    u32 l_dvd = M.x86.R_EAX;
++    u32 abs_s = s & 0x7FFFFFFF;
++    u32 abs_h_dvd = h_dvd & 0x7FFFFFFF;
++    u32 h_s = abs_s >> 1;
++    u32 l_s = abs_s << 31;
++    int counter = 31;
++    int carry;
++
++    if (s == 0) {
++        x86emu_intr_raise(0);
++        return;
++    }
++    do {
++        div <<= 1;
++        carry = (l_dvd >= l_s) ? 0 : 1;
++
++        if (abs_h_dvd < (h_s + carry)) {
++            h_s >>= 1;
++            l_s = abs_s << (--counter);
++            continue;
++        }
++        else {
++            abs_h_dvd -= (h_s + carry);
++            l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
++                : (l_dvd - l_s);
++            h_s >>= 1;
++            l_s = abs_s << (--counter);
++            div |= 1;
++            continue;
++        }
++
++    } while (counter > -1);
++    /* overflow */
++    if (abs_h_dvd || (l_dvd > abs_s)) {
++        x86emu_intr_raise(0);
++        return;
++    }
++    /* sign */
++    div |= ((h_dvd & 0x10000000) ^ (s & 0x10000000));
++    mod = l_dvd;
+ 
+ #endif
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	CLEAR_FLAG(F_SF);
+-	SET_FLAG(F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    CLEAR_FLAG(F_SF);
++    SET_FLAG(F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+ 
+-	M.x86.R_EAX = (u32)div;
+-	M.x86.R_EDX = (u32)mod;
++    M.x86.R_EAX = (u32) div;
++    M.x86.R_EDX = (u32) mod;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the DIV instruction and side effects.
+ ****************************************************************************/
+-void div_byte(u8 s)
++void
++div_byte(u8 s)
+ {
+-	u32 dvd, div, mod;
++    u32 dvd, div, mod;
+ 
+-	dvd = M.x86.R_AX;
++    dvd = M.x86.R_AX;
+     if (s == 0) {
+-		x86emu_intr_raise(0);
++        x86emu_intr_raise(0);
+         return;
+     }
+-	div = dvd / (u8)s;
+-	mod = dvd % (u8)s;
+-	if (abs(div) > 0xff) {
+-		x86emu_intr_raise(0);
++    div = dvd / (u8) s;
++    mod = dvd % (u8) s;
++    if (abs(div) > 0xff) {
++        x86emu_intr_raise(0);
+         return;
+-	}
+-	M.x86.R_AL = (u8)div;
+-	M.x86.R_AH = (u8)mod;
++    }
++    M.x86.R_AL = (u8) div;
++    M.x86.R_AH = (u8) mod;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the DIV instruction and side effects.
+ ****************************************************************************/
+-void div_word(u16 s)
++void
++div_word(u16 s)
+ {
+-	u32 dvd, div, mod;
++    u32 dvd, div, mod;
+ 
+-	dvd = (((u32)M.x86.R_DX) << 16) | M.x86.R_AX;
+-	if (s == 0) {
+-		x86emu_intr_raise(0);
++    dvd = (((u32) M.x86.R_DX) << 16) | M.x86.R_AX;
++    if (s == 0) {
++        x86emu_intr_raise(0);
++        return;
++    }
++    div = dvd / (u16) s;
++    mod = dvd % (u16) s;
++    if (abs(div) > 0xffff) {
++        x86emu_intr_raise(0);
+         return;
+     }
+-	div = dvd / (u16)s;
+-	mod = dvd % (u16)s;
+-	if (abs(div) > 0xffff) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_SF);
+-	CONDITIONAL_SET_FLAG(div == 0, F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_SF);
++    CONDITIONAL_SET_FLAG(div == 0, F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+ 
+-	M.x86.R_AX = (u16)div;
+-	M.x86.R_DX = (u16)mod;
++    M.x86.R_AX = (u16) div;
++    M.x86.R_DX = (u16) mod;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the DIV instruction and side effects.
+ ****************************************************************************/
+-void div_long(u32 s)
++void
++div_long(u32 s)
+ {
+ #ifdef	__HAS_LONG_LONG__
+-	u64 dvd, div, mod;
+-
+-	dvd = (((u64)M.x86.R_EDX) << 32) | M.x86.R_EAX;
+-	if (s == 0) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
+-	div = dvd / (u32)s;
+-	mod = dvd % (u32)s;
+-	if (abs(div) > 0xffffffff) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
++    u64 dvd, div, mod;
++
++    dvd = (((u64) M.x86.R_EDX) << 32) | M.x86.R_EAX;
++    if (s == 0) {
++        x86emu_intr_raise(0);
++        return;
++    }
++    div = dvd / (u32) s;
++    mod = dvd % (u32) s;
++    if (abs(div) > 0xffffffff) {
++        x86emu_intr_raise(0);
++        return;
++    }
+ #else
+-	s32 div = 0, mod;
+-	s32 h_dvd = M.x86.R_EDX;
+-	u32 l_dvd = M.x86.R_EAX;
+-
+-	u32 h_s = s;
+-	u32 l_s = 0;
+-	int counter = 32;
+-	int carry;
+-		
+-	if (s == 0) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
+-	do {
+-		div <<= 1;
+-		carry = (l_dvd >= l_s) ? 0 : 1;
+-		
+-		if (h_dvd < (h_s + carry)) {
+-			h_s >>= 1;
+-			l_s = s << (--counter);
+-			continue;
+-		} else {
+-			h_dvd -= (h_s + carry);
+-			l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
+-				: (l_dvd - l_s);
+-			h_s >>= 1;
+-			l_s = s << (--counter);
+-			div |= 1;
+-			continue;
+-		}
+-		
+-	} while (counter > -1);
+-	/* overflow */
+-	if (h_dvd || (l_dvd > s)) {
+-		x86emu_intr_raise(0);
+-		return;
+-	}
+-	mod = l_dvd;
++    s32 div = 0, mod;
++    s32 h_dvd = M.x86.R_EDX;
++    u32 l_dvd = M.x86.R_EAX;
++
++    u32 h_s = s;
++    u32 l_s = 0;
++    int counter = 32;
++    int carry;
++
++    if (s == 0) {
++        x86emu_intr_raise(0);
++        return;
++    }
++    do {
++        div <<= 1;
++        carry = (l_dvd >= l_s) ? 0 : 1;
++
++        if (h_dvd < (h_s + carry)) {
++            h_s >>= 1;
++            l_s = s << (--counter);
++            continue;
++        }
++        else {
++            h_dvd -= (h_s + carry);
++            l_dvd = carry ? ((0xFFFFFFFF - l_s) + l_dvd + 1)
++                : (l_dvd - l_s);
++            h_s >>= 1;
++            l_s = s << (--counter);
++            div |= 1;
++            continue;
++        }
++
++    } while (counter > -1);
++    /* overflow */
++    if (h_dvd || (l_dvd > s)) {
++        x86emu_intr_raise(0);
++        return;
++    }
++    mod = l_dvd;
+ #endif
+-	CLEAR_FLAG(F_CF);
+-	CLEAR_FLAG(F_AF);
+-	CLEAR_FLAG(F_SF);
+-	SET_FLAG(F_ZF);
+-	CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
++    CLEAR_FLAG(F_CF);
++    CLEAR_FLAG(F_AF);
++    CLEAR_FLAG(F_SF);
++    SET_FLAG(F_ZF);
++    CONDITIONAL_SET_FLAG(PARITY(mod & 0xff), F_PF);
+ 
+-	M.x86.R_EAX = (u32)div;
+-	M.x86.R_EDX = (u32)mod;
++    M.x86.R_EAX = (u32) div;
++    M.x86.R_EDX = (u32) mod;
+ }
+ 
+ /****************************************************************************
+ REMARKS:
+ Implements the IN string instruction and side effects.
+ ****************************************************************************/
+-void ins(int size)
++void
++ins(int size)
+ {
+-	int inc = size;
++    int inc = size;
+ 
+-	if (ACCESS_FLAG(F_DF)) {
+-		inc = -size;
+-	}
+-	if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
++    if (ACCESS_FLAG(F_DF)) {
++        inc = -size;
++    }
++    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+         /* dont care whether REPE or REPNE */
+         /* in until CX is ZERO. */
+-		u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
+-					 M.x86.R_ECX : M.x86.R_CX);
++        u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
++                     M.x86.R_ECX : M.x86.R_CX);
+         switch (size) {
+-          case 1:
++        case 1:
+             while (count--) {
+-				store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
+-									(*sys_inb)(M.x86.R_DX));
+-				M.x86.R_DI += inc;
++                store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
++                                    (*sys_inb) (M.x86.R_DX));
++                M.x86.R_DI += inc;
+             }
+             break;
+ 
+-          case 2:
++        case 2:
+             while (count--) {
+-				store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
+-									(*sys_inw)(M.x86.R_DX));
+-				M.x86.R_DI += inc;
++                store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
++                                    (*sys_inw) (M.x86.R_DX));
++                M.x86.R_DI += inc;
+             }
+             break;
+-          case 4:
++        case 4:
+             while (count--) {
+-				store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
+-									(*sys_inl)(M.x86.R_DX));
+-				M.x86.R_DI += inc;
++                store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
++                                    (*sys_inl) (M.x86.R_DX));
++                M.x86.R_DI += inc;
++                break;
+             }
+-            break;
+         }
+-		M.x86.R_CX = 0;
+-		if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-			M.x86.R_ECX = 0;
++        M.x86.R_CX = 0;
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            M.x86.R_ECX = 0;
+         }
+-		M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+-    } else {
++        M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
++    }
++    else {
+         switch (size) {
+-          case 1:
+-			store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
+-								(*sys_inb)(M.x86.R_DX));
++        case 1:
++            store_data_byte_abs(M.x86.R_ES, M.x86.R_DI,
++                                (*sys_inb) (M.x86.R_DX));
+             break;
+-          case 2:
+-			store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
+-								(*sys_inw)(M.x86.R_DX));
++        case 2:
++            store_data_word_abs(M.x86.R_ES, M.x86.R_DI,
++                                (*sys_inw) (M.x86.R_DX));
+             break;
+-          case 4:
+-			store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
+-								(*sys_inl)(M.x86.R_DX));
++        case 4:
++            store_data_long_abs(M.x86.R_ES, M.x86.R_DI,
++                                (*sys_inl) (M.x86.R_DX));
+             break;
+         }
+-		M.x86.R_DI += inc;
++        M.x86.R_DI += inc;
+     }
+ }
+ 
+@@ -2518,63 +2654,65 @@ void ins(int size)
+ REMARKS:
+ Implements the OUT string instruction and side effects.
+ ****************************************************************************/
+-void outs(int size)
++void
++outs(int size)
+ {
+     int inc = size;
+ 
+-	if (ACCESS_FLAG(F_DF)) {
++    if (ACCESS_FLAG(F_DF)) {
+         inc = -size;
+     }
+-	if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
++    if (M.x86.mode & (SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE)) {
+         /* dont care whether REPE or REPNE */
+         /* out until CX is ZERO. */
+-		u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
+-					 M.x86.R_ECX : M.x86.R_CX);
++        u32 count = ((M.x86.mode & SYSMODE_PREFIX_DATA) ?
++                     M.x86.R_ECX : M.x86.R_CX);
+         switch (size) {
+-          case 1:
++        case 1:
+             while (count--) {
+-				(*sys_outb)(M.x86.R_DX,
+-						 fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
+-				M.x86.R_SI += inc;
++                (*sys_outb) (M.x86.R_DX,
++                             fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
++                M.x86.R_SI += inc;
+             }
+             break;
+ 
+-          case 2:
++        case 2:
+             while (count--) {
+-				(*sys_outw)(M.x86.R_DX,
+-						 fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
+-				M.x86.R_SI += inc;
++                (*sys_outw) (M.x86.R_DX,
++                             fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
++                M.x86.R_SI += inc;
+             }
+             break;
+-          case 4:
++        case 4:
+             while (count--) {
+-				(*sys_outl)(M.x86.R_DX,
+-						 fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
+-				M.x86.R_SI += inc;
++                (*sys_outl) (M.x86.R_DX,
++                             fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
++                M.x86.R_SI += inc;
++                break;
+             }
+-            break;
+         }
+-		M.x86.R_CX = 0;
+-		if (M.x86.mode & SYSMODE_PREFIX_DATA) {
+-			M.x86.R_ECX = 0;
++        M.x86.R_CX = 0;
++        if (M.x86.mode & SYSMODE_PREFIX_DATA) {
++            M.x86.R_ECX = 0;
+         }
+-		M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
+-    } else {
++        M.x86.mode &= ~(SYSMODE_PREFIX_REPE | SYSMODE_PREFIX_REPNE);
++    }
++    else {
+         switch (size) {
+-          case 1:
+-			(*sys_outb)(M.x86.R_DX,
+-					 fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
++        case 1:
++            (*sys_outb) (M.x86.R_DX,
++                         fetch_data_byte_abs(M.x86.R_ES, M.x86.R_SI));
+             break;
+-          case 2:
+-			(*sys_outw)(M.x86.R_DX,
+-					 fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
++        case 2:
++            (*sys_outw) (M.x86.R_DX,
++                         fetch_data_word_abs(M.x86.R_ES, M.x86.R_SI));
+             break;
+-          case 4:
+-			(*sys_outl)(M.x86.R_DX,
+-					 fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
++        case 4:
++            (*sys_outl) (M.x86.R_DX,
++                         fetch_data_long_abs(M.x86.R_ES, M.x86.R_SI));
+             break;
+         }
+-		M.x86.R_SI += inc;
++        M.x86.R_SI += inc;
+     }
+ }
+ 
+@@ -2585,11 +2723,12 @@ addr	- Address to fetch word from
+ REMARKS:
+ Fetches a word from emulator memory using an absolute address.
+ ****************************************************************************/
+-u16 mem_access_word(int addr)
++u16
++mem_access_word(int addr)
+ {
+-DB(	if (CHECK_MEM_ACCESS())
+-	  x86emu_check_mem_access(addr);)
+-	return (*sys_rdw)(addr);
++    DB(if (CHECK_MEM_ACCESS())
++       x86emu_check_mem_access(addr);)
++        return (*sys_rdw) (addr);
+ }
+ 
+ /****************************************************************************
+@@ -2598,12 +2737,13 @@ Pushes a word onto the stack.
+ 
+ NOTE: Do not inline this, as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void push_word(u16 w)
++void
++push_word(u16 w)
+ {
+-DB(	if (CHECK_SP_ACCESS())
+-	  x86emu_check_sp_access();)
+-	M.x86.R_SP -= 2;
+-	(*sys_wrw)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP, w);
++    DB(if (CHECK_SP_ACCESS())
++       x86emu_check_sp_access();)
++        M.x86.R_SP -= 2;
++    (*sys_wrw) (((u32) M.x86.R_SS << 4) + M.x86.R_SP, w);
+ }
+ 
+ /****************************************************************************
+@@ -2612,12 +2752,13 @@ Pushes a long onto the stack.
+ 
+ NOTE: Do not inline this, as (*sys_wrX) is already inline!
+ ****************************************************************************/
+-void push_long(u32 w)
++void
++push_long(u32 w)
+ {
+-DB(	if (CHECK_SP_ACCESS())
+-	  x86emu_check_sp_access();)
+-	M.x86.R_SP -= 4;
+-	(*sys_wrl)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP, w);
++    DB(if (CHECK_SP_ACCESS())
++       x86emu_check_sp_access();)
++        M.x86.R_SP -= 4;
++    (*sys_wrl) (((u32) M.x86.R_SS << 4) + M.x86.R_SP, w);
+ }
+ 
+ /****************************************************************************
+@@ -2626,15 +2767,16 @@ Pops a word from the stack.
+ 
+ NOTE: Do not inline this, as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u16 pop_word(void)
++u16
++pop_word(void)
+ {
+-	register u16 res;
++    register u16 res;
+ 
+-DB(	if (CHECK_SP_ACCESS())
+-	  x86emu_check_sp_access();)
+-	res = (*sys_rdw)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP);
+-	M.x86.R_SP += 2;
+-	return res;
++    DB(if (CHECK_SP_ACCESS())
++       x86emu_check_sp_access();)
++        res = (*sys_rdw) (((u32) M.x86.R_SS << 4) + M.x86.R_SP);
++    M.x86.R_SP += 2;
++    return res;
+ }
+ 
+ /****************************************************************************
+@@ -2643,14 +2785,15 @@ Pops a long from the stack.
+ 
+ NOTE: Do not inline this, as (*sys_rdX) is already inline!
+ ****************************************************************************/
+-u32 pop_long(void)
++u32
++pop_long(void)
+ {
+     register u32 res;
+ 
+-DB(	if (CHECK_SP_ACCESS())
+-	  x86emu_check_sp_access();)
+-	res = (*sys_rdl)(((u32)M.x86.R_SS << 4)  + M.x86.R_SP);
+-	M.x86.R_SP += 4;
++    DB(if (CHECK_SP_ACCESS())
++       x86emu_check_sp_access();)
++        res = (*sys_rdl) (((u32) M.x86.R_SS << 4) + M.x86.R_SP);
++    M.x86.R_SP += 4;
+     return res;
+ }
+ 
+@@ -2658,45 +2801,59 @@ DB(	if (CHECK_SP_ACCESS())
+ REMARKS:
+ CPUID takes EAX/ECX as inputs, writes EAX/EBX/ECX/EDX as output
+ ****************************************************************************/
+-void cpuid (void)
+-{
+-	u32 feature = M.x86.R_EAX;
+-
+-	switch (feature) {
+-	case 0:
+-		/* Regardless if we have real data from the hardware, the emulator
+-		 * will only support upto feature 1, which we set in register EAX.
+-		 * Registers EBX:EDX:ECX contain a string identifying the CPU.
+-		 */
+-		M.x86.R_EAX = 1;
+-		/* EBX:EDX:ECX = "GenuineIntel" */
+-		M.x86.R_EBX = 0x756e6547;
+-		M.x86.R_EDX = 0x49656e69;
+-		M.x86.R_ECX = 0x6c65746e;
+-		break;
+-	case 1:
+-		/* If we don't have x86 compatible hardware, we return values from an
+-		 * Intel 486dx4; which was one of the first processors to have CPUID.
+-		 */
+-		M.x86.R_EAX = 0x00000480;
+-		M.x86.R_EBX = 0x00000000;
+-		M.x86.R_ECX = 0x00000000;
+-		M.x86.R_EDX = 0x00000002;	/* VME */
+-		/* In the case that we have hardware CPUID instruction, we make sure
+-		 * that the features reported are limited to TSC and VME.
+-		 */
+-		M.x86.R_EDX &= 0x00000012;
+-		break;
+-	default:
+-		/* Finally, we don't support any additional features.  Most CPUs
+-		 * return all zeros when queried for invalid or unsupported feature
+-		 * numbers.
+-		 */
+-		M.x86.R_EAX = 0;
+-		M.x86.R_EBX = 0;
+-		M.x86.R_ECX = 0;
+-		M.x86.R_EDX = 0;
+-		break;
+-	}
+-}
++void
++cpuid(void)
++{
++    u32 feature = M.x86.R_EAX;
+ 
++#ifdef X86EMU_HAS_HW_CPUID
++    /* If the platform allows it, we will base our values on the real
++     * results from the CPUID instruction.  We limit support to the
++     * first two features, and the results of those are sanitized.
++     */
++    if (feature <= 1)
++        hw_cpuid(&M.x86.R_EAX, &M.x86.R_EBX, &M.x86.R_ECX, &M.x86.R_EDX);
++#endif
++
++    switch (feature) {
++    case 0:
++        /* Regardless if we have real data from the hardware, the emulator
++         * will only support upto feature 1, which we set in register EAX.
++         * Registers EBX:EDX:ECX contain a string identifying the CPU.
++         */
++        M.x86.R_EAX = 1;
++#ifndef X86EMU_HAS_HW_CPUID
++        /* EBX:EDX:ECX = "GenuineIntel" */
++        M.x86.R_EBX = 0x756e6547;
++        M.x86.R_EDX = 0x49656e69;
++        M.x86.R_ECX = 0x6c65746e;
++#endif
++        break;
++    case 1:
++#ifndef X86EMU_HAS_HW_CPUID
++        /* If we don't have x86 compatible hardware, we return values from an
++         * Intel 486dx4; which was one of the first processors to have CPUID.
++         */
++        M.x86.R_EAX = 0x00000480;
++        M.x86.R_EBX = 0x00000000;
++        M.x86.R_ECX = 0x00000000;
++        M.x86.R_EDX = 0x00000002;       /* VME */
++#else
++        /* In the case that we have hardware CPUID instruction, we make sure
++         * that the features reported are limited to TSC and VME.
++         */
++        M.x86.R_EDX &= 0x00000012;
++#endif
++        break;
++    default:
++        /* Finally, we don't support any additional features.  Most CPUs
++         * return all zeros when queried for invalid or unsupported feature
++         * numbers.
++         */
++        M.x86.R_EAX = 0;
++        M.x86.R_EBX = 0;
++        M.x86.R_ECX = 0;
++        M.x86.R_EDX = 0;
++        break;
++    }
++}
+diff --git a/libs/x86emu/sys.c b/libs/x86emu/sys.c
+index 4d90ea3..c514dde 100644
+--- a/libs/x86emu/sys.c
++++ b/libs/x86emu/sys.c
+@@ -47,223 +47,133 @@
+ #include "x86emu/prim_ops.h"
+ #ifndef NO_SYS_HEADERS
+ #include <string.h>
+-#endif                                                                                           
+-/*------------------------- Global Variables ------------------------------*/
++#endif
+ 
+-X86EMU_sysEnv		_X86EMU_env;		/* Global emulator machine state */
+-X86EMU_intrFuncs	_X86EMU_intrTab[256];
++#ifdef __GNUC__
+ 
+-/*----------------------------- Implementation ----------------------------*/
+-#if defined(__alpha__) || defined(__alpha)
+-/* to cope with broken egcs-1.1.2 :-(((( */
+-
+-#define ALPHA_UALOADS
+-/*
+- * inline functions to do unaligned accesses
+- * from linux/include/asm-alpha/unaligned.h
+- */
+-
+-/*
+- * EGCS 1.1 knows about arbitrary unaligned loads.  Define some
+- * packed structures to talk about such things with.
+- */
+-
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+-struct __una_u64 { unsigned long  x __attribute__((packed)); };
+-struct __una_u32 { unsigned int   x __attribute__((packed)); };
+-struct __una_u16 { unsigned short x __attribute__((packed)); };
+-#endif
++/* Define some packed structures to use with unaligned accesses */
++
++struct __una_u64 {
++    u64 x __attribute__ ((packed));
++};
++struct __una_u32 {
++    u32 x __attribute__ ((packed));
++};
++struct __una_u16 {
++    u16 x __attribute__ ((packed));
++};
++
++/* Elemental unaligned loads */
+ 
+-static __inline__ unsigned long ldq_u(unsigned long * r11)
++static __inline__ u64
++ldq_u(u64 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+-	const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
+-	return ptr->x;
+-#else
+-	unsigned long r1,r2;
+-	__asm__("ldq_u %0,%3\n\t"
+-		"ldq_u %1,%4\n\t"
+-		"extql %0,%2,%0\n\t"
+-		"extqh %1,%2,%1"
+-		:"=&r" (r1), "=&r" (r2)
+-		:"r" (r11),
+-		 "m" (*r11),
+-		 "m" (*(const unsigned long *)(7+(char *) r11)));
+-	return r1 | r2;
+-#endif
++    const struct __una_u64 *ptr = (const struct __una_u64 *) p;
++
++    return ptr->x;
+ }
+ 
+-static __inline__ unsigned long ldl_u(unsigned int * r11)
++static __inline__ u32
++ldl_u(u32 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+-	const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
+-	return ptr->x;
+-#else
+-	unsigned long r1,r2;
+-	__asm__("ldq_u %0,%3\n\t"
+-		"ldq_u %1,%4\n\t"
+-		"extll %0,%2,%0\n\t"
+-		"extlh %1,%2,%1"
+-		:"=&r" (r1), "=&r" (r2)
+-		:"r" (r11),
+-		 "m" (*r11),
+-		 "m" (*(const unsigned long *)(3+(char *) r11)));
+-	return r1 | r2;
+-#endif
++    const struct __una_u32 *ptr = (const struct __una_u32 *) p;
++
++    return ptr->x;
+ }
+ 
+-static __inline__ unsigned long ldw_u(unsigned short * r11)
++static __inline__ u16
++ldw_u(u16 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+-	const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
+-	return ptr->x;
+-#else
+-	unsigned long r1,r2;
+-	__asm__("ldq_u %0,%3\n\t"
+-		"ldq_u %1,%4\n\t"
+-		"extwl %0,%2,%0\n\t"
+-		"extwh %1,%2,%1"
+-		:"=&r" (r1), "=&r" (r2)
+-		:"r" (r11),
+-		 "m" (*r11),
+-		 "m" (*(const unsigned long *)(1+(char *) r11)));
+-	return r1 | r2;
+-#endif
++    const struct __una_u16 *ptr = (const struct __una_u16 *) p;
++
++    return ptr->x;
+ }
+ 
+-/*
+- * Elemental unaligned stores 
+- */
++/* Elemental unaligned stores */
+ 
+-static __inline__ void stq_u(unsigned long r5, unsigned long * r11)
++static __inline__ void
++stq_u(u64 val, u64 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+-	struct __una_u64 *ptr = (struct __una_u64 *) r11;
+-	ptr->x = r5;
+-#else
+-	unsigned long r1,r2,r3,r4;
+-
+-	__asm__("ldq_u %3,%1\n\t"
+-		"ldq_u %2,%0\n\t"
+-		"insqh %6,%7,%5\n\t"
+-		"insql %6,%7,%4\n\t"
+-		"mskqh %3,%7,%3\n\t"
+-		"mskql %2,%7,%2\n\t"
+-		"bis %3,%5,%3\n\t"
+-		"bis %2,%4,%2\n\t"
+-		"stq_u %3,%1\n\t"
+-		"stq_u %2,%0"
+-		:"=m" (*r11),
+-		 "=m" (*(unsigned long *)(7+(char *) r11)),
+-		 "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+-		:"r" (r5), "r" (r11));
+-#endif
++    struct __una_u64 *ptr = (struct __una_u64 *) p;
++
++    ptr->x = val;
+ }
+ 
+-static __inline__ void stl_u(unsigned long r5, unsigned int * r11)
++static __inline__ void
++stl_u(u32 val, u32 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+-	struct __una_u32 *ptr = (struct __una_u32 *) r11;
+-	ptr->x = r5;
+-#else
+-	unsigned long r1,r2,r3,r4;
+-
+-	__asm__("ldq_u %3,%1\n\t"
+-		"ldq_u %2,%0\n\t"
+-		"inslh %6,%7,%5\n\t"
+-		"insll %6,%7,%4\n\t"
+-		"msklh %3,%7,%3\n\t"
+-		"mskll %2,%7,%2\n\t"
+-		"bis %3,%5,%3\n\t"
+-		"bis %2,%4,%2\n\t"
+-		"stq_u %3,%1\n\t"
+-		"stq_u %2,%0"
+-		:"=m" (*r11),
+-		 "=m" (*(unsigned long *)(3+(char *) r11)),
+-		 "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+-		:"r" (r5), "r" (r11));
+-#endif
++    struct __una_u32 *ptr = (struct __una_u32 *) p;
++
++    ptr->x = val;
+ }
+ 
+-static __inline__ void stw_u(unsigned long r5, unsigned short * r11)
++static __inline__ void
++stw_u(u16 val, u16 * p)
+ {
+-#if defined(__GNUC__) && ((__GNUC__ > 2) || (__GNUC_MINOR__ >= 91))
+-	struct __una_u16 *ptr = (struct __una_u16 *) r11;
+-	ptr->x = r5;
+-#else
+-	unsigned long r1,r2,r3,r4;
+-
+-	__asm__("ldq_u %3,%1\n\t"
+-		"ldq_u %2,%0\n\t"
+-		"inswh %6,%7,%5\n\t"
+-		"inswl %6,%7,%4\n\t"
+-		"mskwh %3,%7,%3\n\t"
+-		"mskwl %2,%7,%2\n\t"
+-		"bis %3,%5,%3\n\t"
+-		"bis %2,%4,%2\n\t"
+-		"stq_u %3,%1\n\t"
+-		"stq_u %2,%0"
+-		:"=m" (*r11),
+-		 "=m" (*(unsigned long *)(1+(char *) r11)),
+-		 "=&r" (r1), "=&r" (r2), "=&r" (r3), "=&r" (r4)
+-		:"r" (r5), "r" (r11));
+-#endif
++    struct __una_u16 *ptr = (struct __una_u16 *) p;
++
++    ptr->x = val;
+ }
++#else                           /* !__GNUC__ */
+ 
+-#elif defined(__GNUC__) && ((__GNUC__ < 3)) && \
+-             (defined (__ia64__) || defined (ia64__))
+-#define IA64_UALOADS
+-/*
+- * EGCS 1.1 knows about arbitrary unaligned loads.  Define some
+- * packed structures to talk about such things with.
+- */
+-struct __una_u64 { unsigned long  x __attribute__((packed)); };
+-struct __una_u32 { unsigned int   x __attribute__((packed)); };
+-struct __una_u16 { unsigned short x __attribute__((packed)); };
+-
+-static __inline__ unsigned long
+-__uldq (const unsigned long * r11)
++static __inline__ u64
++ldq_u(u64 * p)
+ {
+-    const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
+-    return ptr->x;
++    u64 ret;
++
++    memmove(&ret, p, sizeof(*p));
++    return ret;
+ }
+ 
+-static __inline__ unsigned long
+-uldl (const unsigned int * r11)
++static __inline__ u32
++ldl_u(u32 * p)
+ {
+-    const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
+-    return ptr->x;
++    u32 ret;
++
++    memmove(&ret, p, sizeof(*p));
++    return ret;
+ }
+ 
+-static __inline__ unsigned long
+-uldw (const unsigned short * r11)
++static __inline__ u16
++ldw_u(u16 * p)
+ {
+-    const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
+-    return ptr->x;
++    u16 ret;
++
++    memmove(&ret, p, sizeof(*p));
++    return ret;
+ }
+ 
+ static __inline__ void
+-ustq (unsigned long r5, unsigned long * r11)
++stq_u(u64 val, u64 * p)
+ {
+-    struct __una_u64 *ptr = (struct __una_u64 *) r11;
+-    ptr->x = r5;
++    u64 tmp = val;
++
++    memmove(p, &tmp, sizeof(*p));
+ }
+ 
+ static __inline__ void
+-ustl (unsigned long r5, unsigned int * r11)
++stl_u(u32 val, u32 * p)
+ {
+-    struct __una_u32 *ptr = (struct __una_u32 *) r11;
+-    ptr->x = r5;
++    u32 tmp = val;
++
++    memmove(p, &tmp, sizeof(*p));
+ }
+ 
+ static __inline__ void
+-ustw (unsigned long r5, unsigned short * r11)
++stw_u(u16 val, u16 * p)
+ {
+-    struct __una_u16 *ptr = (struct __una_u16 *) r11;
+-    ptr->x = r5;
++    u16 tmp = val;
++
++    memmove(p, &tmp, sizeof(*p));
+ }
+ 
+-#endif
++#endif                          /* __GNUC__ */
++/*------------------------- Global Variables ------------------------------*/
++
++X86EMU_sysEnv _X86EMU_env;      /* Global emulator machine state */
++X86EMU_intrFuncs _X86EMU_intrTab[256];
++
++/*----------------------------- Implementation ----------------------------*/
+ 
+ /****************************************************************************
+ PARAMETERS:
+@@ -275,19 +185,20 @@ Byte value read from emulator memory.
+ REMARKS:
+ Reads a byte value from the emulator memory. 
+ ****************************************************************************/
+-u8 X86API rdb(
+-    u32 addr)
++u8 X86API
++rdb(u32 addr)
+ {
+-	u8 val;
+-
+-	if (addr > M.mem_size - 1) {
+-		DB(printk("mem_read: address %#lx out of range!\n", addr);)
+-		HALT_SYS();
+-		}
+-	val = *(u8*)(M.mem_base + addr);
+-DB(	if (DEBUG_MEM_TRACE())
+-		printk("%#08x 1 -> %#x\n", addr, val);)
+-	return val;
++    u8 val;
++
++    if (addr > M.mem_size - 1) {
++        DB(printk("mem_read: address %#lx out of range!\n", addr);
++            )
++            HALT_SYS();
++    }
++    val = *(u8 *) (M.mem_base + addr);
++    DB(if (DEBUG_MEM_TRACE())
++       printk("%#08x 1 -> %#x\n", addr, val);)
++        return val;
+ }
+ 
+ /****************************************************************************
+@@ -300,32 +211,27 @@ Word value read from emulator memory.
+ REMARKS:
+ Reads a word value from the emulator memory.
+ ****************************************************************************/
+-u16 X86API rdw(
+-	u32 addr)
++u16 X86API
++rdw(u32 addr)
+ {
+-	u16 val = 0;
++    u16 val = 0;
+ 
+-	if (addr > M.mem_size - 2) {
+-		DB(printk("mem_read: address %#lx out of range!\n", addr);)
+-		HALT_SYS();
+-		}
++    if (addr > M.mem_size - 2) {
++        DB(printk("mem_read: address %#lx out of range!\n", addr);
++            )
++            HALT_SYS();
++    }
+ #ifdef __BIG_ENDIAN__
+-	if (addr & 0x1) {
+-		val = (*(u8*)(M.mem_base + addr) |
+-			  (*(u8*)(M.mem_base + addr + 1) << 8));
+-		}
+-	else
+-#endif
+-#if defined(ALPHA_UALOADS)
+-		val = ldw_u((u16*)(M.mem_base + addr));
+-#elif  defined(IA64_UALOADS)
+-      val = uldw((u16*)(M.mem_base + addr));
+-#else
+-		val = *(u16*)(M.mem_base + addr);
++    if (addr & 0x1) {
++        val = (*(u8 *) (M.mem_base + addr) |
++               (*(u8 *) (M.mem_base + addr + 1) << 8));
++    }
++    else
+ #endif
+-		DB(	if (DEBUG_MEM_TRACE())
+-		printk("%#08x 2 -> %#x\n", addr, val);)
+-    return val;
++        val = ldw_u((u16 *) (M.mem_base + addr));
++    DB(if (DEBUG_MEM_TRACE())
++       printk("%#08x 2 -> %#x\n", addr, val);)
++        return val;
+ }
+ 
+ /****************************************************************************
+@@ -337,34 +243,29 @@ Long value read from emulator memory.
+ REMARKS:
+ Reads a long value from the emulator memory. 
+ ****************************************************************************/
+-u32 X86API rdl(
+-	u32 addr)
++u32 X86API
++rdl(u32 addr)
+ {
+-	u32 val = 0;
++    u32 val = 0;
+ 
+-	if (addr > M.mem_size - 4) {
+-		DB(printk("mem_read: address %#lx out of range!\n", addr);)
+-		HALT_SYS();
+-		}
++    if (addr > M.mem_size - 4) {
++        DB(printk("mem_read: address %#lx out of range!\n", addr);
++            )
++            HALT_SYS();
++    }
+ #ifdef __BIG_ENDIAN__
+-	if (addr & 0x3) {
+-		val = (*(u8*)(M.mem_base + addr + 0) |
+-			  (*(u8*)(M.mem_base + addr + 1) << 8) |
+-			  (*(u8*)(M.mem_base + addr + 2) << 16) |
+-			  (*(u8*)(M.mem_base + addr + 3) << 24));
+-		}
+-	else
+-#endif
+-#if defined(ALPHA_UALOADS)
+-		val = ldl_u((u32*)(M.mem_base + addr));
+-#elif  defined(IA64_UALOADS)
+-        val = uldl((u32*)(M.mem_base + addr));
+-#else
+-		val = *(u32*)(M.mem_base + addr);
++    if (addr & 0x3) {
++        val = (*(u8 *) (M.mem_base + addr + 0) |
++               (*(u8 *) (M.mem_base + addr + 1) << 8) |
++               (*(u8 *) (M.mem_base + addr + 2) << 16) |
++               (*(u8 *) (M.mem_base + addr + 3) << 24));
++    }
++    else
+ #endif
+-DB(	if (DEBUG_MEM_TRACE())
+-		printk("%#08x 4 -> %#x\n", addr, val);)
+-	return val;
++        val = ldl_u((u32 *) (M.mem_base + addr));
++    DB(if (DEBUG_MEM_TRACE())
++       printk("%#08x 4 -> %#x\n", addr, val);)
++        return val;
+ }
+ 
+ /****************************************************************************
+@@ -375,17 +276,17 @@ val		- Value to store
+ REMARKS:
+ Writes a byte value to emulator memory.
+ ****************************************************************************/
+-void X86API wrb(
+-	u32 addr,
+-	u8 val)
++void X86API
++wrb(u32 addr, u8 val)
+ {
+-DB(	if (DEBUG_MEM_TRACE())
+-		printk("%#08x 1 <- %#x\n", addr, val);)
+-    if (addr > M.mem_size - 1) {
+-		DB(printk("mem_write: address %#lx out of range!\n", addr);)
+-		HALT_SYS();
+-		}
+-	*(u8*)(M.mem_base + addr) = val;
++    DB(if (DEBUG_MEM_TRACE())
++       printk("%#08x 1 <- %#x\n", addr, val);)
++        if (addr > M.mem_size - 1) {
++            DB(printk("mem_write: address %#lx out of range!\n", addr);
++                )
++                HALT_SYS();
++        }
++    *(u8 *) (M.mem_base + addr) = val;
+ }
+ 
+ /****************************************************************************
+@@ -396,30 +297,24 @@ val		- Value to store
+ REMARKS:
+ Writes a word value to emulator memory.
+ ****************************************************************************/
+-void X86API wrw(
+-	u32 addr,
+-	u16 val)
++void X86API
++wrw(u32 addr, u16 val)
+ {
+-DB(	if (DEBUG_MEM_TRACE())
+-		printk("%#08x 2 <- %#x\n", addr, val);)
+-	if (addr > M.mem_size - 2) {
+-		DB(printk("mem_write: address %#lx out of range!\n", addr);)
+-		HALT_SYS();
+-		}
++    DB(if (DEBUG_MEM_TRACE())
++       printk("%#08x 2 <- %#x\n", addr, val);)
++        if (addr > M.mem_size - 2) {
++            DB(printk("mem_write: address %#lx out of range!\n", addr);
++                )
++                HALT_SYS();
++        }
+ #ifdef __BIG_ENDIAN__
+-	if (addr & 0x1) {
+-		*(u8*)(M.mem_base + addr + 0) = (val >> 0) & 0xff;
+-		*(u8*)(M.mem_base + addr + 1) = (val >> 8) & 0xff;
+-		}
+-	else
+-#endif
+-#if defined(ALPHA_UALOADS)
+-	 stw_u(val,(u16*)(M.mem_base + addr));
+-#elif defined(IA64_UALOADS)
+-     ustw(val,(u16*)(M.mem_base + addr));
+-#else
+-	 *(u16*)(M.mem_base + addr) = val;
++    if (addr & 0x1) {
++        *(u8 *) (M.mem_base + addr + 0) = (val >> 0) & 0xff;
++        *(u8 *) (M.mem_base + addr + 1) = (val >> 8) & 0xff;
++    }
++    else
+ #endif
++        stw_u(val, (u16 *) (M.mem_base + addr));
+ }
+ 
+ /****************************************************************************
+@@ -430,32 +325,26 @@ val		- Value to store
+ REMARKS:
+ Writes a long value to emulator memory. 
+ ****************************************************************************/
+-void X86API wrl(
+-	u32 addr,
+-	u32 val)
++void X86API
++wrl(u32 addr, u32 val)
+ {
+-DB(	if (DEBUG_MEM_TRACE())
+-		printk("%#08x 4 <- %#x\n", addr, val);)
+-	if (addr > M.mem_size - 4) {
+-		DB(printk("mem_write: address %#lx out of range!\n", addr);)
+-		HALT_SYS();
+-		}
++    DB(if (DEBUG_MEM_TRACE())
++       printk("%#08x 4 <- %#x\n", addr, val);)
++        if (addr > M.mem_size - 4) {
++            DB(printk("mem_write: address %#lx out of range!\n", addr);
++                )
++                HALT_SYS();
++        }
+ #ifdef __BIG_ENDIAN__
+-	if (addr & 0x1) {
+-		*(u8*)(M.mem_base + addr + 0) = (val >>  0) & 0xff;
+-		*(u8*)(M.mem_base + addr + 1) = (val >>  8) & 0xff;
+-		*(u8*)(M.mem_base + addr + 2) = (val >> 16) & 0xff;
+-		*(u8*)(M.mem_base + addr + 3) = (val >> 24) & 0xff;
+-		}
+-	else
+-#endif
+-#if defined(ALPHA_UALOADS)
+-	 stl_u(val,(u32*)(M.mem_base + addr));
+-#elif defined(IA64_UALOADS)
+-     ustl(val,(u32*)(M.mem_base + addr));
+-#else
+-	 *(u32*)(M.mem_base + addr) = val;
++    if (addr & 0x1) {
++        *(u8 *) (M.mem_base + addr + 0) = (val >> 0) & 0xff;
++        *(u8 *) (M.mem_base + addr + 1) = (val >> 8) & 0xff;
++        *(u8 *) (M.mem_base + addr + 2) = (val >> 16) & 0xff;
++        *(u8 *) (M.mem_base + addr + 3) = (val >> 24) & 0xff;
++    }
++    else
+ #endif
++        stl_u(val, (u32 *) (M.mem_base + addr));
+ }
+ 
+ /****************************************************************************
+@@ -466,12 +355,12 @@ RETURN:
+ REMARKS:
+ Default PIO byte read function. Doesn't perform real inb.
+ ****************************************************************************/
+-static u8 X86API p_inb(
+-	X86EMU_pioAddr addr)
++static u8 X86API
++p_inb(X86EMU_pioAddr addr)
+ {
+-DB(	if (DEBUG_IO_TRACE())
+-		printk("inb %#04x \n", addr);)
+-	return 0;
++    DB(if (DEBUG_IO_TRACE())
++       printk("inb %#04x \n", addr);)
++        return 0;
+ }
+ 
+ /****************************************************************************
+@@ -482,12 +371,12 @@ RETURN:
+ REMARKS:
+ Default PIO word read function. Doesn't perform real inw.
+ ****************************************************************************/
+-static u16 X86API p_inw(
+-	X86EMU_pioAddr addr)
++static u16 X86API
++p_inw(X86EMU_pioAddr addr)
+ {
+-DB(	if (DEBUG_IO_TRACE())
+-		printk("inw %#04x \n", addr);)
+-	return 0;
++    DB(if (DEBUG_IO_TRACE())
++       printk("inw %#04x \n", addr);)
++        return 0;
+ }
+ 
+ /****************************************************************************
+@@ -498,12 +387,12 @@ RETURN:
+ REMARKS:
+ Default PIO long read function. Doesn't perform real inl.
+ ****************************************************************************/
+-static u32 X86API p_inl(
+-	X86EMU_pioAddr addr)
++static u32 X86API
++p_inl(X86EMU_pioAddr addr)
+ {
+-DB(	if (DEBUG_IO_TRACE())
+-		printk("inl %#04x \n", addr);)
+-	return 0;
++    DB(if (DEBUG_IO_TRACE())
++       printk("inl %#04x \n", addr);)
++        return 0;
+ }
+ 
+ /****************************************************************************
+@@ -513,13 +402,12 @@ val     - Value to store
+ REMARKS:
+ Default PIO byte write function. Doesn't perform real outb.
+ ****************************************************************************/
+-static void X86API p_outb(
+-	X86EMU_pioAddr addr,
+-	u8 val)
++static void X86API
++p_outb(X86EMU_pioAddr addr, u8 val)
+ {
+-DB(	if (DEBUG_IO_TRACE())
+-		printk("outb %#02x -> %#04x \n", val, addr);)
+-    return;
++    DB(if (DEBUG_IO_TRACE())
++       printk("outb %#02x -> %#04x \n", val, addr);)
++        return;
+ }
+ 
+ /****************************************************************************
+@@ -529,13 +417,12 @@ val     - Value to store
+ REMARKS:
+ Default PIO word write function. Doesn't perform real outw.
+ ****************************************************************************/
+-static void X86API p_outw(
+-	X86EMU_pioAddr addr,
+-	u16 val)
++static void X86API
++p_outw(X86EMU_pioAddr addr, u16 val)
+ {
+-DB(	if (DEBUG_IO_TRACE())
+-		printk("outw %#04x -> %#04x \n", val, addr);)
+-	return;
++    DB(if (DEBUG_IO_TRACE())
++       printk("outw %#04x -> %#04x \n", val, addr);)
++        return;
+ }
+ 
+ /****************************************************************************
+@@ -545,29 +432,29 @@ val     - Value to store
+ REMARKS:
+ Default PIO ;ong write function. Doesn't perform real outl.
+ ****************************************************************************/
+-static void X86API p_outl(
+-	X86EMU_pioAddr addr,
+-	u32 val)
++static void X86API
++p_outl(X86EMU_pioAddr addr, u32 val)
+ {
+-DB(	if (DEBUG_IO_TRACE())
+-		printk("outl %#08x -> %#04x \n", val, addr);)
+-    return;
++    DB(if (DEBUG_IO_TRACE())
++       printk("outl %#08x -> %#04x \n", val, addr);)
++        return;
+ }
+ 
+ /*------------------------- Global Variables ------------------------------*/
+ 
+-u8  	(X86APIP sys_rdb)(u32 addr) 			            = rdb;
+-u16 	(X86APIP sys_rdw)(u32 addr) 			            = rdw;
+-u32 	(X86APIP sys_rdl)(u32 addr) 			            = rdl;
+-void 	(X86APIP sys_wrb)(u32 addr,u8 val) 		            = wrb;
+-void 	(X86APIP sys_wrw)(u32 addr,u16 val) 	            = wrw;
+-void 	(X86APIP sys_wrl)(u32 addr,u32 val) 	            = wrl;
+-u8  	(X86APIP sys_inb)(X86EMU_pioAddr addr)	            = p_inb;
+-u16 	(X86APIP sys_inw)(X86EMU_pioAddr addr)	            = p_inw;
+-u32 	(X86APIP sys_inl)(X86EMU_pioAddr addr)              = p_inl;
+-void 	(X86APIP sys_outb)(X86EMU_pioAddr addr, u8 val) 	= p_outb;
+-void 	(X86APIP sys_outw)(X86EMU_pioAddr addr, u16 val)	= p_outw;
+-void 	(X86APIP sys_outl)(X86EMU_pioAddr addr, u32 val)	= p_outl;
++u8(X86APIP sys_rdb) (u32 addr) = rdb;
++u16(X86APIP sys_rdw) (u32 addr) = rdw;
++u32(X86APIP sys_rdl) (u32 addr) = rdl;
++void (X86APIP sys_wrb) (u32 addr, u8 val) = wrb;
++void (X86APIP sys_wrw) (u32 addr, u16 val) = wrw;
++void (X86APIP sys_wrl) (u32 addr, u32 val) = wrl;
++
++u8(X86APIP sys_inb) (X86EMU_pioAddr addr) = p_inb;
++u16(X86APIP sys_inw) (X86EMU_pioAddr addr) = p_inw;
++u32(X86APIP sys_inl) (X86EMU_pioAddr addr) = p_inl;
++void (X86APIP sys_outb) (X86EMU_pioAddr addr, u8 val) = p_outb;
++void (X86APIP sys_outw) (X86EMU_pioAddr addr, u16 val) = p_outw;
++void (X86APIP sys_outl) (X86EMU_pioAddr addr, u32 val) = p_outl;
+ 
+ /*----------------------------- Setup -------------------------------------*/
+ 
+@@ -580,8 +467,8 @@ This function is used to set the pointers to functions which access
+ memory space, allowing the user application to override these functions
+ and hook them out as necessary for their application.
+ ****************************************************************************/
+-void X86EMU_setupMemFuncs(
+-	X86EMU_memFuncs *funcs)
++void
++X86EMU_setupMemFuncs(X86EMU_memFuncs * funcs)
+ {
+     sys_rdb = funcs->rdb;
+     sys_rdw = funcs->rdw;
+@@ -600,8 +487,8 @@ This function is used to set the pointers to functions which access
+ I/O space, allowing the user application to override these functions
+ and hook them out as necessary for their application.
+ ****************************************************************************/
+-void X86EMU_setupPioFuncs(
+-	X86EMU_pioFuncs *funcs)
++void
++X86EMU_setupPioFuncs(X86EMU_pioFuncs * funcs)
+ {
+     sys_inb = funcs->inb;
+     sys_inw = funcs->inw;
+@@ -624,17 +511,17 @@ in the emulator via the interrupt vector table. This allows the application
+ to get control when the code being emulated executes specific software
+ interrupts.
+ ****************************************************************************/
+-void X86EMU_setupIntrFuncs(
+-	X86EMU_intrFuncs funcs[])
++void
++X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[])
+ {
+     int i;
+-    
+-	for (i=0; i < 256; i++)
+-		_X86EMU_intrTab[i] = NULL;
+-	if (funcs) {
+-		for (i = 0; i < 256; i++)
+-			_X86EMU_intrTab[i] = funcs[i];
+-		}
++
++    for (i = 0; i < 256; i++)
++        _X86EMU_intrTab[i] = NULL;
++    if (funcs) {
++        for (i = 0; i < 256; i++)
++            _X86EMU_intrTab[i] = funcs[i];
++    }
+ }
+ 
+ /****************************************************************************
+@@ -649,15 +536,15 @@ so that the code in the emulator will continue processing the software
+ interrupt as per normal. This essentially allows system code to actively
+ hook and handle certain software interrupts as necessary.
+ ****************************************************************************/
+-void X86EMU_prepareForInt(
+-	int num)
++void
++X86EMU_prepareForInt(int num)
+ {
+-    push_word((u16)M.x86.R_FLG);
++    push_word((u16) M.x86.R_FLG);
+     CLEAR_FLAG(F_IF);
+     CLEAR_FLAG(F_TF);
+     push_word(M.x86.R_CS);
+     M.x86.R_CS = mem_access_word(num * 4 + 2);
+     push_word(M.x86.R_IP);
+     M.x86.R_IP = mem_access_word(num * 4);
+-	M.x86.intr = 0;
++    M.x86.intr = 0;
+ }
+diff --git a/libs/x86emu/validate.c b/libs/x86emu/validate.c
+index 239f6c1..4c36e1d 100644
+--- a/libs/x86emu/validate.c
++++ b/libs/x86emu/validate.c
+@@ -591,58 +591,62 @@
+         printk("passed\n");                                                 \
+ }
+ 
+-void printk(const char *fmt, ...)
++void
++printk(const char *fmt, ...)
+ {
+     va_list argptr;
++
+     va_start(argptr, fmt);
+     vfprintf(stdout, fmt, argptr);
+     fflush(stdout);
+     va_end(argptr);
+ }
+ 
+-char * print_flags(char *buf,ulong flags)
++char *
++print_flags(char *buf, ulong flags)
+ {
+     char *separator = "";
+ 
+     buf[0] = 0;
+     if (flags & F_CF) {
+-        strcat(buf,separator);
+-        strcat(buf,"CF");
++        strcat(buf, separator);
++        strcat(buf, "CF");
+         separator = ",";
+-        }
++    }
+     if (flags & F_PF) {
+-        strcat(buf,separator);
+-        strcat(buf,"PF");
++        strcat(buf, separator);
++        strcat(buf, "PF");
+         separator = ",";
+-        }
++    }
+     if (flags & F_AF) {
+-        strcat(buf,separator);
+-        strcat(buf,"AF");
++        strcat(buf, separator);
++        strcat(buf, "AF");
+         separator = ",";
+-        }
++    }
+     if (flags & F_ZF) {
+-        strcat(buf,separator);
+-        strcat(buf,"ZF");
++        strcat(buf, separator);
++        strcat(buf, "ZF");
+         separator = ",";
+-        }
++    }
+     if (flags & F_SF) {
+-        strcat(buf,separator);
+-        strcat(buf,"SF");
++        strcat(buf, separator);
++        strcat(buf, "SF");
+         separator = ",";
+-        }
++    }
+     if (flags & F_OF) {
+-        strcat(buf,separator);
+-        strcat(buf,"OF");
++        strcat(buf, separator);
++        strcat(buf, "OF");
+         separator = ",";
+-        }
++    }
+     if (separator[0] == 0)
+-        strcpy(buf,"None");
++        strcpy(buf, "None");
+     return buf;
+ }
+ 
+-int main(int argc)
++int
++main(int argc)
+ {
+-    ulong   def_flags;
++    ulong def_flags;
+     int trace = false;
+ 
+     if (argc > 1)
+@@ -673,7 +677,7 @@ int main(int argc)
+     VAL_LONG_LONG_BINARY(cmp_long);
+ 
+     VAL_BYTE_UNARY(daa_byte);
+-    VAL_BYTE_UNARY(das_byte);   // Fails for 0x9A (out of range anyway)
++    VAL_BYTE_UNARY(das_byte);   /* Fails for 0x9A (out of range anyway) */
+ 
+     VAL_BYTE_UNARY(dec_byte);
+     VAL_WORD_UNARY(dec_word);
+diff --git a/libs/x86emu/x86emu.h b/libs/x86emu/x86emu.h
+index 795e2d6..501dd91 100644
+--- a/libs/x86emu/x86emu.h
++++ b/libs/x86emu/x86emu.h
+@@ -56,7 +56,7 @@ typedef int X86EMU_pioAddr;
+ /*---------------------- Macros and type definitions ----------------------*/
+ 
+ #ifdef PACK
+-# pragma	PACK   /* Don't pack structs with function pointers! */
++#pragma	PACK                    /* Don't pack structs with function pointers! */
+ #endif
+ 
+ /****************************************************************************
+@@ -81,13 +81,13 @@ outw    - Function to write a word to an I/O port
+ outl    - Function to write a dword to an I/O port
+ ****************************************************************************/
+ typedef struct {
+-	u8  	(X86APIP inb)(X86EMU_pioAddr addr);
+-	u16 	(X86APIP inw)(X86EMU_pioAddr addr);
+-	u32 	(X86APIP inl)(X86EMU_pioAddr addr);
+-	void 	(X86APIP outb)(X86EMU_pioAddr addr, u8 val);
+-	void 	(X86APIP outw)(X86EMU_pioAddr addr, u16 val);
+-	void 	(X86APIP outl)(X86EMU_pioAddr addr, u32 val);
+-	} X86EMU_pioFuncs;
++    u8(X86APIP inb) (X86EMU_pioAddr addr);
++    u16(X86APIP inw) (X86EMU_pioAddr addr);
++    u32(X86APIP inl) (X86EMU_pioAddr addr);
++    void (X86APIP outb) (X86EMU_pioAddr addr, u8 val);
++    void (X86APIP outw) (X86EMU_pioAddr addr, u16 val);
++    void (X86APIP outl) (X86EMU_pioAddr addr, u32 val);
++} X86EMU_pioFuncs;
+ 
+ /****************************************************************************
+ REMARKS:
+@@ -112,13 +112,13 @@ wrw    	- Function to write a word to an address
+ wrl    	- Function to write a dword to an address
+ ****************************************************************************/
+ typedef struct {
+-	u8  	(X86APIP rdb)(u32 addr);
+-	u16 	(X86APIP rdw)(u32 addr);
+-	u32 	(X86APIP rdl)(u32 addr);
+-	void 	(X86APIP wrb)(u32 addr, u8 val);
+-	void 	(X86APIP wrw)(u32 addr, u16 val);
+-	void	(X86APIP wrl)(u32 addr, u32 val);
+-	} X86EMU_memFuncs;
++    u8(X86APIP rdb) (u32 addr);
++    u16(X86APIP rdw) (u32 addr);
++    u32(X86APIP rdl) (u32 addr);
++    void (X86APIP wrb) (u32 addr, u8 val);
++    void (X86APIP wrw) (u32 addr, u16 val);
++    void (X86APIP wrl) (u32 addr, u32 val);
++} X86EMU_memFuncs;
+ 
+ /****************************************************************************
+   Here are the default memory read and write
+@@ -132,29 +132,29 @@ extern void X86API wrw(u32 addr, u16 val);
+ extern void X86API wrl(u32 addr, u32 val);
+ 
+ #ifdef END_PACK
+-# pragma	END_PACK
++#pragma	END_PACK
+ #endif
+ 
+ /*--------------------- type definitions -----------------------------------*/
+ 
+-typedef void (X86APIP X86EMU_intrFuncs)(int num);
++typedef void (X86APIP X86EMU_intrFuncs) (int num);
+ extern X86EMU_intrFuncs _X86EMU_intrTab[256];
+ 
+ /*-------------------------- Function Prototypes --------------------------*/
+ 
+ #ifdef  __cplusplus
+-extern "C" {            			/* Use "C" linkage when in C++ mode */
++extern "C" {                    /* Use "C" linkage when in C++ mode */
+ #endif
+ 
+-void 	X86EMU_setupMemFuncs(X86EMU_memFuncs *funcs);
+-void 	X86EMU_setupPioFuncs(X86EMU_pioFuncs *funcs);
+-void 	X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]);
+-void 	X86EMU_prepareForInt(int num);
++    void X86EMU_setupMemFuncs(X86EMU_memFuncs * funcs);
++    void X86EMU_setupPioFuncs(X86EMU_pioFuncs * funcs);
++    void X86EMU_setupIntrFuncs(X86EMU_intrFuncs funcs[]);
++    void X86EMU_prepareForInt(int num);
+ 
+ /* decode.c */
+ 
+-void 	X86EMU_exec(void);
+-void 	X86EMU_halt_sys(void);
++    void X86EMU_exec(void);
++    void X86EMU_halt_sys(void);
+ 
+ #ifdef	DEBUG
+ #define	HALT_SYS()	\
+@@ -166,8 +166,8 @@ void 	X86EMU_halt_sys(void);
+ 
+ /* Debug options */
+ 
+-#define DEBUG_DECODE_F          0x000001 /* print decoded instruction  */
+-#define DEBUG_TRACE_F           0x000002 /* dump regs before/after execution */
++#define DEBUG_DECODE_F          0x000001        /* print decoded instruction  */
++#define DEBUG_TRACE_F           0x000002        /* dump regs before/after execution */
+ #define DEBUG_STEP_F            0x000004
+ #define DEBUG_DISASSEMBLE_F     0x000008
+ #define DEBUG_BREAK_F           0x000010
+@@ -175,24 +175,23 @@ void 	X86EMU_halt_sys(void);
+ #define DEBUG_SAVE_IP_CS_F      0x000040
+ #define DEBUG_FS_F              0x000080
+ #define DEBUG_PROC_F            0x000100
+-#define DEBUG_SYSINT_F          0x000200 /* bios system interrupts. */
++#define DEBUG_SYSINT_F          0x000200        /* bios system interrupts. */
+ #define DEBUG_TRACECALL_F       0x000400
+ #define DEBUG_INSTRUMENT_F      0x000800
+-#define DEBUG_MEM_TRACE_F       0x001000 
+-#define DEBUG_IO_TRACE_F        0x002000 
++#define DEBUG_MEM_TRACE_F       0x001000
++#define DEBUG_IO_TRACE_F        0x002000
+ #define DEBUG_TRACECALL_REGS_F  0x004000
+-#define DEBUG_DECODE_NOPRINT_F  0x008000 
++#define DEBUG_DECODE_NOPRINT_F  0x008000
+ #define DEBUG_EXIT              0x010000
+ #define DEBUG_SYS_F             (DEBUG_SVC_F|DEBUG_FS_F|DEBUG_PROC_F)
+ 
+-void 	X86EMU_trace_regs(void);
+-void 	X86EMU_trace_xregs(void);
+-void 	X86EMU_dump_memory(u16 seg, u16 off, u32 amt);
+-int 	X86EMU_trace_on(void);
+-int 	X86EMU_trace_off(void);
++    void X86EMU_trace_regs(void);
++    void X86EMU_trace_xregs(void);
++    void X86EMU_dump_memory(u16 seg, u16 off, u32 amt);
++    int X86EMU_trace_on(void);
++    int X86EMU_trace_off(void);
+ 
+ #ifdef  __cplusplus
+-}                       			/* End of "C" linkage for C++   	*/
++}                               /* End of "C" linkage for C++           */
+ #endif
+-
+-#endif /* __X86EMU_X86EMU_H */
++#endif                          /* __X86EMU_X86EMU_H */
+diff --git a/libs/x86emu/x86emu/debug.h b/libs/x86emu/x86emu/debug.h
+index 47aacb6..385b804 100644
+--- a/libs/x86emu/x86emu/debug.h
++++ b/libs/x86emu/x86emu/debug.h
+@@ -45,65 +45,65 @@
+ 
+ #define CHECK_IP_FETCH_F                0x1
+ #define CHECK_SP_ACCESS_F               0x2
+-#define CHECK_MEM_ACCESS_F              0x4 /*using regular linear pointer */
+-#define CHECK_DATA_ACCESS_F             0x8 /*using segment:offset*/
++#define CHECK_MEM_ACCESS_F              0x4     /*using regular linear pointer */
++#define CHECK_DATA_ACCESS_F             0x8     /*using segment:offset */
+ 
+ #ifdef DEBUG
+-# define CHECK_IP_FETCH()              	(M.x86.check & CHECK_IP_FETCH_F)
+-# define CHECK_SP_ACCESS()             	(M.x86.check & CHECK_SP_ACCESS_F)
+-# define CHECK_MEM_ACCESS()            	(M.x86.check & CHECK_MEM_ACCESS_F)
+-# define CHECK_DATA_ACCESS()           	(M.x86.check & CHECK_DATA_ACCESS_F)
++#define CHECK_IP_FETCH()              	(M.x86.check & CHECK_IP_FETCH_F)
++#define CHECK_SP_ACCESS()             	(M.x86.check & CHECK_SP_ACCESS_F)
++#define CHECK_MEM_ACCESS()            	(M.x86.check & CHECK_MEM_ACCESS_F)
++#define CHECK_DATA_ACCESS()           	(M.x86.check & CHECK_DATA_ACCESS_F)
+ #else
+-# define CHECK_IP_FETCH()
+-# define CHECK_SP_ACCESS()
+-# define CHECK_MEM_ACCESS()
+-# define CHECK_DATA_ACCESS()
++#define CHECK_IP_FETCH()
++#define CHECK_SP_ACCESS()
++#define CHECK_MEM_ACCESS()
++#define CHECK_DATA_ACCESS()
+ #endif
+ 
+ #ifdef DEBUG
+-# define DEBUG_INSTRUMENT()    	(M.x86.debug & DEBUG_INSTRUMENT_F)
+-# define DEBUG_DECODE()        	(M.x86.debug & DEBUG_DECODE_F)
+-# define DEBUG_TRACE()         	(M.x86.debug & DEBUG_TRACE_F)
+-# define DEBUG_STEP()          	(M.x86.debug & DEBUG_STEP_F)
+-# define DEBUG_DISASSEMBLE()   	(M.x86.debug & DEBUG_DISASSEMBLE_F)
+-# define DEBUG_BREAK()         	(M.x86.debug & DEBUG_BREAK_F)
+-# define DEBUG_SVC()           	(M.x86.debug & DEBUG_SVC_F)
+-# define DEBUG_SAVE_IP_CS()     (M.x86.debug & DEBUG_SAVE_IP_CS_F)
+-
+-# define DEBUG_FS()            	(M.x86.debug & DEBUG_FS_F)
+-# define DEBUG_PROC()          	(M.x86.debug & DEBUG_PROC_F)
+-# define DEBUG_SYSINT()        	(M.x86.debug & DEBUG_SYSINT_F)
+-# define DEBUG_TRACECALL()     	(M.x86.debug & DEBUG_TRACECALL_F)
+-# define DEBUG_TRACECALLREGS() 	(M.x86.debug & DEBUG_TRACECALL_REGS_F)
+-# define DEBUG_SYS()           	(M.x86.debug & DEBUG_SYS_F)
+-# define DEBUG_MEM_TRACE()     	(M.x86.debug & DEBUG_MEM_TRACE_F)
+-# define DEBUG_IO_TRACE()      	(M.x86.debug & DEBUG_IO_TRACE_F)
+-# define DEBUG_DECODE_NOPRINT() (M.x86.debug & DEBUG_DECODE_NOPRINT_F)
++#define DEBUG_INSTRUMENT()    	(M.x86.debug & DEBUG_INSTRUMENT_F)
++#define DEBUG_DECODE()        	(M.x86.debug & DEBUG_DECODE_F)
++#define DEBUG_TRACE()         	(M.x86.debug & DEBUG_TRACE_F)
++#define DEBUG_STEP()          	(M.x86.debug & DEBUG_STEP_F)
++#define DEBUG_DISASSEMBLE()   	(M.x86.debug & DEBUG_DISASSEMBLE_F)
++#define DEBUG_BREAK()         	(M.x86.debug & DEBUG_BREAK_F)
++#define DEBUG_SVC()           	(M.x86.debug & DEBUG_SVC_F)
++#define DEBUG_SAVE_IP_CS()     (M.x86.debug & DEBUG_SAVE_IP_CS_F)
++
++#define DEBUG_FS()            	(M.x86.debug & DEBUG_FS_F)
++#define DEBUG_PROC()          	(M.x86.debug & DEBUG_PROC_F)
++#define DEBUG_SYSINT()        	(M.x86.debug & DEBUG_SYSINT_F)
++#define DEBUG_TRACECALL()     	(M.x86.debug & DEBUG_TRACECALL_F)
++#define DEBUG_TRACECALLREGS() 	(M.x86.debug & DEBUG_TRACECALL_REGS_F)
++#define DEBUG_SYS()           	(M.x86.debug & DEBUG_SYS_F)
++#define DEBUG_MEM_TRACE()     	(M.x86.debug & DEBUG_MEM_TRACE_F)
++#define DEBUG_IO_TRACE()      	(M.x86.debug & DEBUG_IO_TRACE_F)
++#define DEBUG_DECODE_NOPRINT() (M.x86.debug & DEBUG_DECODE_NOPRINT_F)
+ #else
+-# define DEBUG_INSTRUMENT()    	0
+-# define DEBUG_DECODE()        	0
+-# define DEBUG_TRACE()         	0
+-# define DEBUG_STEP()          	0
+-# define DEBUG_DISASSEMBLE()   	0
+-# define DEBUG_BREAK()         	0
+-# define DEBUG_SVC()           	0
+-# define DEBUG_SAVE_IP_CS()     0
+-# define DEBUG_FS()            	0
+-# define DEBUG_PROC()          	0
+-# define DEBUG_SYSINT()        	0
+-# define DEBUG_TRACECALL()     	0
+-# define DEBUG_TRACECALLREGS() 	0
+-# define DEBUG_SYS()           	0
+-# define DEBUG_MEM_TRACE()     	0
+-# define DEBUG_IO_TRACE()      	0
+-# define DEBUG_DECODE_NOPRINT() 0
++#define DEBUG_INSTRUMENT()    	0
++#define DEBUG_DECODE()        	0
++#define DEBUG_TRACE()         	0
++#define DEBUG_STEP()          	0
++#define DEBUG_DISASSEMBLE()   	0
++#define DEBUG_BREAK()         	0
++#define DEBUG_SVC()           	0
++#define DEBUG_SAVE_IP_CS()     0
++#define DEBUG_FS()            	0
++#define DEBUG_PROC()          	0
++#define DEBUG_SYSINT()        	0
++#define DEBUG_TRACECALL()     	0
++#define DEBUG_TRACECALLREGS() 	0
++#define DEBUG_SYS()           	0
++#define DEBUG_MEM_TRACE()     	0
++#define DEBUG_IO_TRACE()      	0
++#define DEBUG_DECODE_NOPRINT() 0
+ #endif
+ 
+ #ifdef DEBUG
+ 
+-# define DECODE_PRINTF(x)     	if (DEBUG_DECODE()) \
++#define DECODE_PRINTF(x)     	if (DEBUG_DECODE()) \
+ 									x86emu_decode_printf(x)
+-# define DECODE_PRINTF2(x,y)  	if (DEBUG_DECODE()) \
++#define DECODE_PRINTF2(x,y)  	if (DEBUG_DECODE()) \
+ 									x86emu_decode_printf2(x,y)
+ 
+ /*
+@@ -123,10 +123,10 @@
+ 		M.x86.saved_ip = y;                          			\
+ 	}
+ #else
+-# define INC_DECODED_INST_LEN(x)
+-# define DECODE_PRINTF(x)
+-# define DECODE_PRINTF2(x,y)
+-# define SAVE_IP_CS(x,y)
++#define INC_DECODED_INST_LEN(x)
++#define DECODE_PRINTF(x)
++#define DECODE_PRINTF2(x,y)
++#define SAVE_IP_CS(x,y)
+ #endif
+ 
+ #ifdef DEBUG
+@@ -137,13 +137,13 @@
+ 	}                                                   	\
+ 	if (DEBUG_TRACE() || DEBUG_DECODE()) X86EMU_trace_regs()
+ #else
+-# define TRACE_REGS()
++#define TRACE_REGS()
+ #endif
+ 
+ #ifdef DEBUG
+-# define SINGLE_STEP()		if (DEBUG_STEP()) x86emu_single_step()
++#define SINGLE_STEP()		if (DEBUG_STEP()) x86emu_single_step()
+ #else
+-# define SINGLE_STEP()
++#define SINGLE_STEP()
+ #endif
+ 
+ #define TRACE_AND_STEP()	\
+@@ -151,29 +151,29 @@
+ 	SINGLE_STEP()
+ 
+ #ifdef DEBUG
+-# define START_OF_INSTR()
+-# define END_OF_INSTR()		EndOfTheInstructionProcedure: x86emu_end_instr();
+-# define END_OF_INSTR_NO_TRACE()	x86emu_end_instr();
++#define START_OF_INSTR()
++#define END_OF_INSTR()		EndOfTheInstructionProcedure: x86emu_end_instr();
++#define END_OF_INSTR_NO_TRACE()	x86emu_end_instr();
+ #else
+-# define START_OF_INSTR()
+-# define END_OF_INSTR()
+-# define END_OF_INSTR_NO_TRACE()
++#define START_OF_INSTR()
++#define END_OF_INSTR()
++#define END_OF_INSTR_NO_TRACE()
+ #endif
+ 
+ #ifdef DEBUG
+-# define  CALL_TRACE(u,v,w,x,s)                                 \
++#define  CALL_TRACE(u,v,w,x,s)                                 \
+ 	if (DEBUG_TRACECALLREGS())									\
+ 		x86emu_dump_regs();                                     \
+ 	if (DEBUG_TRACECALL())                                     	\
+ 		printk("%04x:%04x: CALL %s%04x:%04x\n", u , v, s, w, x);
+-# define RETURN_TRACE(n,u,v)                                    \
++#define RETURN_TRACE(n,u,v)                                    \
+ 	if (DEBUG_TRACECALLREGS())									\
+ 		x86emu_dump_regs();                                     \
+ 	if (DEBUG_TRACECALL())                                     	\
+ 		printk("%04x:%04x: %s\n",u,v,n);
+ #else
+-# define CALL_TRACE(u,v,w,x,s)
+-# define RETURN_TRACE(n,u,v)
++#define CALL_TRACE(u,v,w,x,s)
++#define RETURN_TRACE(n,u,v)
+ #endif
+ 
+ #ifdef DEBUG
+@@ -185,26 +185,25 @@
+ /*-------------------------- Function Prototypes --------------------------*/
+ 
+ #ifdef  __cplusplus
+-extern "C" {            			/* Use "C" linkage when in C++ mode */
++extern "C" {                    /* Use "C" linkage when in C++ mode */
+ #endif
+ 
+-extern void x86emu_inc_decoded_inst_len (int x);
+-extern void x86emu_decode_printf (char *x);
+-extern void x86emu_decode_printf2 (char *x, int y);
+-extern void x86emu_just_disassemble (void);
+-extern void x86emu_single_step (void);
+-extern void x86emu_end_instr (void);
+-extern void x86emu_dump_regs (void);
+-extern void x86emu_dump_xregs (void);
+-extern void x86emu_print_int_vect (u16 iv);
+-extern void x86emu_instrument_instruction (void);
+-extern void x86emu_check_ip_access (void);
+-extern void x86emu_check_sp_access (void);
+-extern void x86emu_check_mem_access (u32 p);
+-extern void x86emu_check_data_access (uint s, uint o);
++    extern void x86emu_inc_decoded_inst_len(int x);
++    extern void x86emu_decode_printf(const char *x);
++    extern void x86emu_decode_printf2(const char *x, int y);
++    extern void x86emu_just_disassemble(void);
++    extern void x86emu_single_step(void);
++    extern void x86emu_end_instr(void);
++    extern void x86emu_dump_regs(void);
++    extern void x86emu_dump_xregs(void);
++    extern void x86emu_print_int_vect(u16 iv);
++    extern void x86emu_instrument_instruction(void);
++    extern void x86emu_check_ip_access(void);
++    extern void x86emu_check_sp_access(void);
++    extern void x86emu_check_mem_access(u32 p);
++    extern void x86emu_check_data_access(uint s, uint o);
+ 
+ #ifdef  __cplusplus
+-}                       			/* End of "C" linkage for C++   	*/
++}                               /* End of "C" linkage for C++           */
+ #endif
+-
+-#endif /* __X86EMU_DEBUG_H */
++#endif                          /* __X86EMU_DEBUG_H */
+diff --git a/libs/x86emu/x86emu/decode.h b/libs/x86emu/x86emu/decode.h
+index 61cd4dc..49a1f7b 100644
+--- a/libs/x86emu/x86emu/decode.h
++++ b/libs/x86emu/x86emu/decode.h
+@@ -52,37 +52,36 @@
+ /*-------------------------- Function Prototypes --------------------------*/
+ 
+ #ifdef  __cplusplus
+-extern "C" {            			/* Use "C" linkage when in C++ mode */
++extern "C" {                    /* Use "C" linkage when in C++ mode */
+ #endif
+ 
+-void 	x86emu_intr_raise (u8 type);
+-void    fetch_decode_modrm (int *mod,int *regh,int *regl);
+-u8      fetch_byte_imm (void);
+-u16     fetch_word_imm (void);
+-u32     fetch_long_imm (void);
+-u8      fetch_data_byte (uint offset);
+-u8      fetch_data_byte_abs (uint segment, uint offset);
+-u16     fetch_data_word (uint offset);
+-u16     fetch_data_word_abs (uint segment, uint offset);
+-u32     fetch_data_long (uint offset);
+-u32     fetch_data_long_abs (uint segment, uint offset);
+-void    store_data_byte (uint offset, u8 val);
+-void    store_data_byte_abs (uint segment, uint offset, u8 val);
+-void    store_data_word (uint offset, u16 val);
+-void    store_data_word_abs (uint segment, uint offset, u16 val);
+-void    store_data_long (uint offset, u32 val);
+-void    store_data_long_abs (uint segment, uint offset, u32 val);
+-u8* 	decode_rm_byte_register(int reg);
+-u16* 	decode_rm_word_register(int reg);
+-u32* 	decode_rm_long_register(int reg);
+-u16* 	decode_rm_seg_register(int reg);
+-u32	decode_rm00_address(int rm);
+-u32	decode_rm01_address(int rm);
+-u32	decode_rm10_address(int rm);
+-u32	decode_sib_address(int sib, int mod);
++    void x86emu_intr_raise(u8 type);
++    void fetch_decode_modrm(int *mod, int *regh, int *regl);
++    u8 fetch_byte_imm(void);
++    u16 fetch_word_imm(void);
++    u32 fetch_long_imm(void);
++    u8 fetch_data_byte(uint offset);
++    u8 fetch_data_byte_abs(uint segment, uint offset);
++    u16 fetch_data_word(uint offset);
++    u16 fetch_data_word_abs(uint segment, uint offset);
++    u32 fetch_data_long(uint offset);
++    u32 fetch_data_long_abs(uint segment, uint offset);
++    void store_data_byte(uint offset, u8 val);
++    void store_data_byte_abs(uint segment, uint offset, u8 val);
++    void store_data_word(uint offset, u16 val);
++    void store_data_word_abs(uint segment, uint offset, u16 val);
++    void store_data_long(uint offset, u32 val);
++    void store_data_long_abs(uint segment, uint offset, u32 val);
++    u8 *decode_rm_byte_register(int reg);
++    u16 *decode_rm_word_register(int reg);
++    u32 *decode_rm_long_register(int reg);
++    u16 *decode_rm_seg_register(int reg);
++    u32 decode_rm00_address(int rm);
++    u32 decode_rm01_address(int rm);
++    u32 decode_rm10_address(int rm);
++    u32 decode_sib_address(int sib, int mod);
+ 
+ #ifdef  __cplusplus
+-}                       			/* End of "C" linkage for C++   	*/
++}                               /* End of "C" linkage for C++           */
+ #endif
+-
+-#endif /* __X86EMU_DECODE_H */
++#endif                          /* __X86EMU_DECODE_H */
+diff --git a/libs/x86emu/x86emu/fpu.h b/libs/x86emu/x86emu/fpu.h
+index 5fb2714..1c11498 100644
+--- a/libs/x86emu/x86emu/fpu.h
++++ b/libs/x86emu/x86emu/fpu.h
+@@ -40,22 +40,21 @@
+ #define __X86EMU_FPU_H
+ 
+ #ifdef  __cplusplus
+-extern "C" {            			/* Use "C" linkage when in C++ mode */
++extern "C" {                    /* Use "C" linkage when in C++ mode */
+ #endif
+ 
+ /* these have to be defined, whether 8087 support compiled in or not. */
+ 
+-extern void x86emuOp_esc_coprocess_d8 (u8 op1);
+-extern void x86emuOp_esc_coprocess_d9 (u8 op1);
+-extern void x86emuOp_esc_coprocess_da (u8 op1);
+-extern void x86emuOp_esc_coprocess_db (u8 op1);
+-extern void x86emuOp_esc_coprocess_dc (u8 op1);
+-extern void x86emuOp_esc_coprocess_dd (u8 op1);
+-extern void x86emuOp_esc_coprocess_de (u8 op1);
+-extern void x86emuOp_esc_coprocess_df (u8 op1);
++    extern void x86emuOp_esc_coprocess_d8(u8 op1);
++    extern void x86emuOp_esc_coprocess_d9(u8 op1);
++    extern void x86emuOp_esc_coprocess_da(u8 op1);
++    extern void x86emuOp_esc_coprocess_db(u8 op1);
++    extern void x86emuOp_esc_coprocess_dc(u8 op1);
++    extern void x86emuOp_esc_coprocess_dd(u8 op1);
++    extern void x86emuOp_esc_coprocess_de(u8 op1);
++    extern void x86emuOp_esc_coprocess_df(u8 op1);
+ 
+ #ifdef  __cplusplus
+-}                       			/* End of "C" linkage for C++   	*/
++}                               /* End of "C" linkage for C++           */
+ #endif
+-
+-#endif /* __X86EMU_FPU_H */
++#endif                          /* __X86EMU_FPU_H */
+diff --git a/libs/x86emu/x86emu/fpu_regs.h b/libs/x86emu/x86emu/fpu_regs.h
+index e59b807..5a780e6 100644
+--- a/libs/x86emu/x86emu/fpu_regs.h
++++ b/libs/x86emu/x86emu/fpu_regs.h
+@@ -42,23 +42,23 @@
+ #ifdef X86_FPU_SUPPORT
+ 
+ #ifdef PACK
+-# pragma PACK
++#pragma PACK
+ #endif
+ 
+ /* Basic 8087 register can hold any of the following values: */
+ 
+ union x86_fpu_reg_u {
+-    s8                  tenbytes[10];
+-    double              dval;
+-    float               fval;
+-    s16                 sval;
+-    s32                 lval;
+-	};
++    s8 tenbytes[10];
++    double dval;
++    float fval;
++    s16 sval;
++    s32 lval;
++};
+ 
+ struct x86_fpu_reg {
+-	union x86_fpu_reg_u reg;
+-	char                tag;
+-	};
++    union x86_fpu_reg_u reg;
++    char tag;
++};
+ 
+ /*
+  * Since we are not going to worry about the problems of aliasing
+@@ -83,14 +83,14 @@ struct x86_fpu_reg {
+ #define  X86_FPU_STKTOP  0
+ 
+ struct x86_fpu_registers {
+-    struct x86_fpu_reg  x86_fpu_stack[8];
+-    int                 x86_fpu_flags;
+-    int                 x86_fpu_config;         /* rounding modes, etc. */
+-    short               x86_fpu_tos, x86_fpu_bos;
+-	};
++    struct x86_fpu_reg x86_fpu_stack[8];
++    int x86_fpu_flags;
++    int x86_fpu_config;         /* rounding modes, etc. */
++    short x86_fpu_tos, x86_fpu_bos;
++};
+ 
+ #ifdef END_PACK
+-# pragma END_PACK
++#pragma END_PACK
+ #endif
+ 
+ /*
+@@ -104,16 +104,16 @@ struct x86_fpu_registers {
+  * instructions.
+  */
+ 
+-#endif /* X86_FPU_SUPPORT */
++#endif                          /* X86_FPU_SUPPORT */
+ 
+ #ifdef DEBUG
+-# define DECODE_PRINTINSTR32(t,mod,rh,rl)     	\
++#define DECODE_PRINTINSTR32(t,mod,rh,rl)     	\
+ 	DECODE_PRINTF(t[(mod<<3)+(rh)]);
+-# define DECODE_PRINTINSTR256(t,mod,rh,rl)    	\
++#define DECODE_PRINTINSTR256(t,mod,rh,rl)    	\
+ 	DECODE_PRINTF(t[(mod<<6)+(rh<<3)+(rl)]);
+ #else
+-# define DECODE_PRINTINSTR32(t,mod,rh,rl)
+-# define DECODE_PRINTINSTR256(t,mod,rh,rl)
++#define DECODE_PRINTINSTR32(t,mod,rh,rl)
++#define DECODE_PRINTINSTR256(t,mod,rh,rl)
+ #endif
+ 
+-#endif /* __X86EMU_FPU_REGS_H */
++#endif                          /* __X86EMU_FPU_REGS_H */
+diff --git a/libs/x86emu/x86emu/ops.h b/libs/x86emu/x86emu/ops.h
+index 65ea676..1bc07a4 100644
+--- a/libs/x86emu/x86emu/ops.h
++++ b/libs/x86emu/x86emu/ops.h
+@@ -39,7 +39,7 @@
+ #ifndef __X86EMU_OPS_H
+ #define __X86EMU_OPS_H
+ 
+-extern void (*x86emu_optab[0x100])(u8 op1);
+-extern void (*x86emu_optab2[0x100])(u8 op2);
++extern void (*x86emu_optab[0x100]) (u8 op1);
++extern void (*x86emu_optab2[0x100]) (u8 op2);
+ 
+-#endif /* __X86EMU_OPS_H */
++#endif                          /* __X86EMU_OPS_H */
+diff --git a/libs/x86emu/x86emu/prim_asm.h b/libs/x86emu/x86emu/prim_asm.h
+index e023cf8..aca132b 100644
+--- a/libs/x86emu/x86emu/prim_asm.h
++++ b/libs/x86emu/x86emu/prim_asm.h
+@@ -49,14 +49,16 @@
+ #define	__HAVE_INLINE_ASSEMBLER__
+ #endif
+ 
+-u32		get_flags_asm(void);
++u32 get_flags_asm(void);
++
+ #pragma aux get_flags_asm =			\
+ 	"pushf"                         \
+ 	"pop	eax"                  	\
+ 	value [eax]                     \
+ 	modify exact [eax];
+ 
+-u16     aaa_word_asm(u32 *flags,u16 d);
++u16 aaa_word_asm(u32 * flags, u16 d);
++
+ #pragma aux aaa_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -67,7 +69,8 @@ u16     aaa_word_asm(u32 *flags,u16 d);
+ 	value [ax]                      \
+ 	modify exact [ax];
+ 
+-u16     aas_word_asm(u32 *flags,u16 d);
++u16 aas_word_asm(u32 * flags, u16 d);
++
+ #pragma aux aas_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -78,7 +81,8 @@ u16     aas_word_asm(u32 *flags,u16 d);
+ 	value [ax]                      \
+ 	modify exact [ax];
+ 
+-u16     aad_word_asm(u32 *flags,u16 d);
++u16 aad_word_asm(u32 * flags, u16 d);
++
+ #pragma aux aad_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -89,7 +93,8 @@ u16     aad_word_asm(u32 *flags,u16 d);
+ 	value [ax]                      \
+ 	modify exact [ax];
+ 
+-u16     aam_word_asm(u32 *flags,u8 d);
++u16 aam_word_asm(u32 * flags, u8 d);
++
+ #pragma aux aam_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -100,7 +105,8 @@ u16     aam_word_asm(u32 *flags,u8 d);
+ 	value [ax]                      \
+ 	modify exact [ax];
+ 
+-u8      adc_byte_asm(u32 *flags,u8 d, u8 s);
++u8 adc_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux adc_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -111,7 +117,8 @@ u8      adc_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al bl];
+ 
+-u16     adc_word_asm(u32 *flags,u16 d, u16 s);
++u16 adc_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux adc_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -122,7 +129,8 @@ u16     adc_word_asm(u32 *flags,u16 d, u16 s);
+ 	value [ax]                      \
+ 	modify exact [ax bx];
+ 
+-u32     adc_long_asm(u32 *flags,u32 d, u32 s);
++u32 adc_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux adc_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -133,7 +141,8 @@ u32     adc_long_asm(u32 *flags,u32 d, u32 s);
+ 	value [eax]                     \
+ 	modify exact [eax ebx];
+ 
+-u8      add_byte_asm(u32 *flags,u8 d, u8 s);
++u8 add_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux add_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -144,7 +153,8 @@ u8      add_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al bl];
+ 
+-u16     add_word_asm(u32 *flags,u16 d, u16 s);
++u16 add_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux add_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -155,7 +165,8 @@ u16     add_word_asm(u32 *flags,u16 d, u16 s);
+ 	value [ax]                      \
+ 	modify exact [ax bx];
+ 
+-u32     add_long_asm(u32 *flags,u32 d, u32 s);
++u32 add_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux add_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -166,7 +177,8 @@ u32     add_long_asm(u32 *flags,u32 d, u32 s);
+ 	value [eax]                     \
+ 	modify exact [eax ebx];
+ 
+-u8      and_byte_asm(u32 *flags,u8 d, u8 s);
++u8 and_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux and_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -177,7 +189,8 @@ u8      and_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al bl];
+ 
+-u16     and_word_asm(u32 *flags,u16 d, u16 s);
++u16 and_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux and_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -188,7 +201,8 @@ u16     and_word_asm(u32 *flags,u16 d, u16 s);
+ 	value [ax]                      \
+ 	modify exact [ax bx];
+ 
+-u32     and_long_asm(u32 *flags,u32 d, u32 s);
++u32 and_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux and_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -199,7 +213,8 @@ u32     and_long_asm(u32 *flags,u32 d, u32 s);
+ 	value [eax]                     \
+ 	modify exact [eax ebx];
+ 
+-u8      cmp_byte_asm(u32 *flags,u8 d, u8 s);
++u8 cmp_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux cmp_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -210,7 +225,8 @@ u8      cmp_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al bl];
+ 
+-u16     cmp_word_asm(u32 *flags,u16 d, u16 s);
++u16 cmp_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux cmp_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -221,7 +237,8 @@ u16     cmp_word_asm(u32 *flags,u16 d, u16 s);
+ 	value [ax]                      \
+ 	modify exact [ax bx];
+ 
+-u32     cmp_long_asm(u32 *flags,u32 d, u32 s);
++u32 cmp_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux cmp_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -232,7 +249,8 @@ u32     cmp_long_asm(u32 *flags,u32 d, u32 s);
+ 	value [eax]                     \
+ 	modify exact [eax ebx];
+ 
+-u8      daa_byte_asm(u32 *flags,u8 d);
++u8 daa_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux daa_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -243,7 +261,8 @@ u8      daa_byte_asm(u32 *flags,u8 d);
+ 	value [al]                      \
+ 	modify exact [al];
+ 
+-u8      das_byte_asm(u32 *flags,u8 d);
++u8 das_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux das_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -254,7 +273,8 @@ u8      das_byte_asm(u32 *flags,u8 d);
+ 	value [al]                      \
+ 	modify exact [al];
+ 
+-u8      dec_byte_asm(u32 *flags,u8 d);
++u8 dec_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux dec_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -265,7 +285,8 @@ u8      dec_byte_asm(u32 *flags,u8 d);
+ 	value [al]                      \
+ 	modify exact [al];
+ 
+-u16     dec_word_asm(u32 *flags,u16 d);
++u16 dec_word_asm(u32 * flags, u16 d);
++
+ #pragma aux dec_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -276,7 +297,8 @@ u16     dec_word_asm(u32 *flags,u16 d);
+ 	value [ax]                      \
+ 	modify exact [ax];
+ 
+-u32     dec_long_asm(u32 *flags,u32 d);
++u32 dec_long_asm(u32 * flags, u32 d);
++
+ #pragma aux dec_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -287,7 +309,8 @@ u32     dec_long_asm(u32 *flags,u32 d);
+ 	value [eax]                     \
+ 	modify exact [eax];
+ 
+-u8      inc_byte_asm(u32 *flags,u8 d);
++u8 inc_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux inc_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -298,7 +321,8 @@ u8      inc_byte_asm(u32 *flags,u8 d);
+ 	value [al]                      \
+ 	modify exact [al];
+ 
+-u16     inc_word_asm(u32 *flags,u16 d);
++u16 inc_word_asm(u32 * flags, u16 d);
++
+ #pragma aux inc_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -309,7 +333,8 @@ u16     inc_word_asm(u32 *flags,u16 d);
+ 	value [ax]                      \
+ 	modify exact [ax];
+ 
+-u32     inc_long_asm(u32 *flags,u32 d);
++u32 inc_long_asm(u32 * flags, u32 d);
++
+ #pragma aux inc_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -320,7 +345,8 @@ u32     inc_long_asm(u32 *flags,u32 d);
+ 	value [eax]                     \
+ 	modify exact [eax];
+ 
+-u8      or_byte_asm(u32 *flags,u8 d, u8 s);
++u8 or_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux or_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -331,7 +357,8 @@ u8      or_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al bl];
+ 
+-u16     or_word_asm(u32 *flags,u16 d, u16 s);
++u16 or_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux or_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -342,7 +369,8 @@ u16     or_word_asm(u32 *flags,u16 d, u16 s);
+ 	value [ax]                      \
+ 	modify exact [ax bx];
+ 
+-u32     or_long_asm(u32 *flags,u32 d, u32 s);
++u32 or_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux or_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -353,7 +381,8 @@ u32     or_long_asm(u32 *flags,u32 d, u32 s);
+ 	value [eax]                     \
+ 	modify exact [eax ebx];
+ 
+-u8      neg_byte_asm(u32 *flags,u8 d);
++u8 neg_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux neg_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -364,7 +393,8 @@ u8      neg_byte_asm(u32 *flags,u8 d);
+ 	value [al]                      \
+ 	modify exact [al];
+ 
+-u16     neg_word_asm(u32 *flags,u16 d);
++u16 neg_word_asm(u32 * flags, u16 d);
++
+ #pragma aux neg_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -375,7 +405,8 @@ u16     neg_word_asm(u32 *flags,u16 d);
+ 	value [ax]                      \
+ 	modify exact [ax];
+ 
+-u32     neg_long_asm(u32 *flags,u32 d);
++u32 neg_long_asm(u32 * flags, u32 d);
++
+ #pragma aux neg_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -386,7 +417,8 @@ u32     neg_long_asm(u32 *flags,u32 d);
+ 	value [eax]                     \
+ 	modify exact [eax];
+ 
+-u8      not_byte_asm(u32 *flags,u8 d);
++u8 not_byte_asm(u32 * flags, u8 d);
++
+ #pragma aux not_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -397,7 +429,8 @@ u8      not_byte_asm(u32 *flags,u8 d);
+ 	value [al]                      \
+ 	modify exact [al];
+ 
+-u16     not_word_asm(u32 *flags,u16 d);
++u16 not_word_asm(u32 * flags, u16 d);
++
+ #pragma aux not_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -408,7 +441,8 @@ u16     not_word_asm(u32 *flags,u16 d);
+ 	value [ax]                      \
+ 	modify exact [ax];
+ 
+-u32     not_long_asm(u32 *flags,u32 d);
++u32 not_long_asm(u32 * flags, u32 d);
++
+ #pragma aux not_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -419,7 +453,8 @@ u32     not_long_asm(u32 *flags,u32 d);
+ 	value [eax]                     \
+ 	modify exact [eax];
+ 
+-u8      rcl_byte_asm(u32 *flags,u8 d, u8 s);
++u8 rcl_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux rcl_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -430,7 +465,8 @@ u8      rcl_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al cl];
+ 
+-u16     rcl_word_asm(u32 *flags,u16 d, u8 s);
++u16 rcl_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux rcl_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -441,7 +477,8 @@ u16     rcl_word_asm(u32 *flags,u16 d, u8 s);
+ 	value [ax]                      \
+ 	modify exact [ax cl];
+ 
+-u32     rcl_long_asm(u32 *flags,u32 d, u8 s);
++u32 rcl_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux rcl_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -452,7 +489,8 @@ u32     rcl_long_asm(u32 *flags,u32 d, u8 s);
+ 	value [eax]                     \
+ 	modify exact [eax cl];
+ 
+-u8      rcr_byte_asm(u32 *flags,u8 d, u8 s);
++u8 rcr_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux rcr_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -463,7 +501,8 @@ u8      rcr_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al cl];
+ 
+-u16     rcr_word_asm(u32 *flags,u16 d, u8 s);
++u16 rcr_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux rcr_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -474,7 +513,8 @@ u16     rcr_word_asm(u32 *flags,u16 d, u8 s);
+ 	value [ax]                      \
+ 	modify exact [ax cl];
+ 
+-u32     rcr_long_asm(u32 *flags,u32 d, u8 s);
++u32 rcr_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux rcr_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -485,7 +525,8 @@ u32     rcr_long_asm(u32 *flags,u32 d, u8 s);
+ 	value [eax]                     \
+ 	modify exact [eax cl];
+ 
+-u8      rol_byte_asm(u32 *flags,u8 d, u8 s);
++u8 rol_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux rol_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -496,7 +537,8 @@ u8      rol_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al cl];
+ 
+-u16     rol_word_asm(u32 *flags,u16 d, u8 s);
++u16 rol_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux rol_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -507,7 +549,8 @@ u16     rol_word_asm(u32 *flags,u16 d, u8 s);
+ 	value [ax]                      \
+ 	modify exact [ax cl];
+ 
+-u32     rol_long_asm(u32 *flags,u32 d, u8 s);
++u32 rol_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux rol_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -518,7 +561,8 @@ u32     rol_long_asm(u32 *flags,u32 d, u8 s);
+ 	value [eax]                     \
+ 	modify exact [eax cl];
+ 
+-u8      ror_byte_asm(u32 *flags,u8 d, u8 s);
++u8 ror_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux ror_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -529,7 +573,8 @@ u8      ror_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al cl];
+ 
+-u16     ror_word_asm(u32 *flags,u16 d, u8 s);
++u16 ror_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux ror_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -540,7 +585,8 @@ u16     ror_word_asm(u32 *flags,u16 d, u8 s);
+ 	value [ax]                      \
+ 	modify exact [ax cl];
+ 
+-u32     ror_long_asm(u32 *flags,u32 d, u8 s);
++u32 ror_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux ror_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -551,7 +597,8 @@ u32     ror_long_asm(u32 *flags,u32 d, u8 s);
+ 	value [eax]                     \
+ 	modify exact [eax cl];
+ 
+-u8      shl_byte_asm(u32 *flags,u8 d, u8 s);
++u8 shl_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux shl_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -562,7 +609,8 @@ u8      shl_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al cl];
+ 
+-u16     shl_word_asm(u32 *flags,u16 d, u8 s);
++u16 shl_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux shl_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -573,7 +621,8 @@ u16     shl_word_asm(u32 *flags,u16 d, u8 s);
+ 	value [ax]                      \
+ 	modify exact [ax cl];
+ 
+-u32     shl_long_asm(u32 *flags,u32 d, u8 s);
++u32 shl_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux shl_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -584,7 +633,8 @@ u32     shl_long_asm(u32 *flags,u32 d, u8 s);
+ 	value [eax]                     \
+ 	modify exact [eax cl];
+ 
+-u8      shr_byte_asm(u32 *flags,u8 d, u8 s);
++u8 shr_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux shr_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -595,7 +645,8 @@ u8      shr_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al cl];
+ 
+-u16     shr_word_asm(u32 *flags,u16 d, u8 s);
++u16 shr_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux shr_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -606,7 +657,8 @@ u16     shr_word_asm(u32 *flags,u16 d, u8 s);
+ 	value [ax]                      \
+ 	modify exact [ax cl];
+ 
+-u32     shr_long_asm(u32 *flags,u32 d, u8 s);
++u32 shr_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux shr_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -617,7 +669,8 @@ u32     shr_long_asm(u32 *flags,u32 d, u8 s);
+ 	value [eax]                     \
+ 	modify exact [eax cl];
+ 
+-u8      sar_byte_asm(u32 *flags,u8 d, u8 s);
++u8 sar_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux sar_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -628,7 +681,8 @@ u8      sar_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al cl];
+ 
+-u16     sar_word_asm(u32 *flags,u16 d, u8 s);
++u16 sar_word_asm(u32 * flags, u16 d, u8 s);
++
+ #pragma aux sar_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -639,7 +693,8 @@ u16     sar_word_asm(u32 *flags,u16 d, u8 s);
+ 	value [ax]                      \
+ 	modify exact [ax cl];
+ 
+-u32     sar_long_asm(u32 *flags,u32 d, u8 s);
++u32 sar_long_asm(u32 * flags, u32 d, u8 s);
++
+ #pragma aux sar_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -650,7 +705,8 @@ u32     sar_long_asm(u32 *flags,u32 d, u8 s);
+ 	value [eax]                     \
+ 	modify exact [eax cl];
+ 
+-u16		shld_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
++u16 shld_word_asm(u32 * flags, u16 d, u16 fill, u8 s);
++
+ #pragma aux shld_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -661,7 +717,8 @@ u16		shld_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
+ 	value [ax]                      \
+ 	modify exact [ax dx cl];
+ 
+-u32     shld_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
++u32 shld_long_asm(u32 * flags, u32 d, u32 fill, u8 s);
++
+ #pragma aux shld_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -672,7 +729,8 @@ u32     shld_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
+ 	value [eax]                     \
+ 	modify exact [eax edx cl];
+ 
+-u16		shrd_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
++u16 shrd_word_asm(u32 * flags, u16 d, u16 fill, u8 s);
++
+ #pragma aux shrd_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -683,7 +741,8 @@ u16		shrd_word_asm(u32 *flags,u16 d, u16 fill, u8 s);
+ 	value [ax]                      \
+ 	modify exact [ax dx cl];
+ 
+-u32     shrd_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
++u32 shrd_long_asm(u32 * flags, u32 d, u32 fill, u8 s);
++
+ #pragma aux shrd_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -694,7 +753,8 @@ u32     shrd_long_asm(u32 *flags,u32 d, u32 fill, u8 s);
+ 	value [eax]                     \
+ 	modify exact [eax edx cl];
+ 
+-u8      sbb_byte_asm(u32 *flags,u8 d, u8 s);
++u8 sbb_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux sbb_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -705,7 +765,8 @@ u8      sbb_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al bl];
+ 
+-u16     sbb_word_asm(u32 *flags,u16 d, u16 s);
++u16 sbb_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux sbb_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -716,7 +777,8 @@ u16     sbb_word_asm(u32 *flags,u16 d, u16 s);
+ 	value [ax]                      \
+ 	modify exact [ax bx];
+ 
+-u32     sbb_long_asm(u32 *flags,u32 d, u32 s);
++u32 sbb_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux sbb_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -727,7 +789,8 @@ u32     sbb_long_asm(u32 *flags,u32 d, u32 s);
+ 	value [eax]                     \
+ 	modify exact [eax ebx];
+ 
+-u8      sub_byte_asm(u32 *flags,u8 d, u8 s);
++u8 sub_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux sub_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -738,7 +801,8 @@ u8      sub_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al bl];
+ 
+-u16     sub_word_asm(u32 *flags,u16 d, u16 s);
++u16 sub_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux sub_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -749,7 +813,8 @@ u16     sub_word_asm(u32 *flags,u16 d, u16 s);
+ 	value [ax]                      \
+ 	modify exact [ax bx];
+ 
+-u32     sub_long_asm(u32 *flags,u32 d, u32 s);
++u32 sub_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux sub_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -760,7 +825,8 @@ u32     sub_long_asm(u32 *flags,u32 d, u32 s);
+ 	value [eax]                     \
+ 	modify exact [eax ebx];
+ 
+-void	test_byte_asm(u32 *flags,u8 d, u8 s);
++void test_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux test_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -770,7 +836,8 @@ void	test_byte_asm(u32 *flags,u8 d, u8 s);
+ 	parm [edi] [al] [bl]            \
+ 	modify exact [al bl];
+ 
+-void	test_word_asm(u32 *flags,u16 d, u16 s);
++void test_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux test_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -780,7 +847,8 @@ void	test_word_asm(u32 *flags,u16 d, u16 s);
+ 	parm [edi] [ax] [bx]            \
+ 	modify exact [ax bx];
+ 
+-void	test_long_asm(u32 *flags,u32 d, u32 s);
++void test_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux test_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -790,7 +858,8 @@ void	test_long_asm(u32 *flags,u32 d, u32 s);
+ 	parm [edi] [eax] [ebx]          \
+ 	modify exact [eax ebx];
+ 
+-u8      xor_byte_asm(u32 *flags,u8 d, u8 s);
++u8 xor_byte_asm(u32 * flags, u8 d, u8 s);
++
+ #pragma aux xor_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -801,7 +870,8 @@ u8      xor_byte_asm(u32 *flags,u8 d, u8 s);
+ 	value [al]                      \
+ 	modify exact [al bl];
+ 
+-u16     xor_word_asm(u32 *flags,u16 d, u16 s);
++u16 xor_word_asm(u32 * flags, u16 d, u16 s);
++
+ #pragma aux xor_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -812,7 +882,8 @@ u16     xor_word_asm(u32 *flags,u16 d, u16 s);
+ 	value [ax]                      \
+ 	modify exact [ax bx];
+ 
+-u32     xor_long_asm(u32 *flags,u32 d, u32 s);
++u32 xor_long_asm(u32 * flags, u32 d, u32 s);
++
+ #pragma aux xor_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -823,7 +894,8 @@ u32     xor_long_asm(u32 *flags,u32 d, u32 s);
+ 	value [eax]                     \
+ 	modify exact [eax ebx];
+ 
+-void    imul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
++void imul_byte_asm(u32 * flags, u16 * ax, u8 d, u8 s);
++
+ #pragma aux imul_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -834,7 +906,8 @@ void    imul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
+ 	parm [edi] [esi] [al] [bl]      \
+ 	modify exact [esi ax bl];
+ 
+-void    imul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
++void imul_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 d, u16 s);
++
+ #pragma aux imul_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -846,7 +919,8 @@ void    imul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
+ 	parm [edi] [esi] [ecx] [ax] [bx]\
+ 	modify exact [esi edi ax bx dx];
+ 
+-void    imul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
++void imul_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 d, u32 s);
++
+ #pragma aux imul_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -858,7 +932,8 @@ void    imul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
+ 	parm [edi] [esi] [ecx] [eax] [ebx] \
+ 	modify exact [esi edi eax ebx edx];
+ 
+-void    mul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
++void mul_byte_asm(u32 * flags, u16 * ax, u8 d, u8 s);
++
+ #pragma aux mul_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -869,7 +944,8 @@ void    mul_byte_asm(u32 *flags,u16 *ax,u8 d,u8 s);
+ 	parm [edi] [esi] [al] [bl]      \
+ 	modify exact [esi ax bl];
+ 
+-void    mul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
++void mul_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 d, u16 s);
++
+ #pragma aux mul_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -881,7 +957,8 @@ void    mul_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 d,u16 s);
+ 	parm [edi] [esi] [ecx] [ax] [bx]\
+ 	modify exact [esi edi ax bx dx];
+ 
+-void    mul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
++void mul_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 d, u32 s);
++
+ #pragma aux mul_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -893,7 +970,8 @@ void    mul_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 d,u32 s);
+ 	parm [edi] [esi] [ecx] [eax] [ebx] \
+ 	modify exact [esi edi eax ebx edx];
+ 
+-void	idiv_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
++void idiv_byte_asm(u32 * flags, u8 * al, u8 * ah, u16 d, u8 s);
++
+ #pragma aux idiv_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -905,7 +983,8 @@ void	idiv_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
+ 	parm [edi] [esi] [ecx] [ax] [bl]\
+ 	modify exact [esi edi ax bl];
+ 
+-void	idiv_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
++void idiv_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 dlo, u16 dhi, u16 s);
++
+ #pragma aux idiv_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -917,7 +996,8 @@ void	idiv_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
+ 	parm [edi] [esi] [ecx] [ax] [dx] [bx]\
+ 	modify exact [esi edi ax dx bx];
+ 
+-void	idiv_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
++void idiv_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 dlo, u32 dhi, u32 s);
++
+ #pragma aux idiv_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -929,7 +1009,8 @@ void	idiv_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
+ 	parm [edi] [esi] [ecx] [eax] [edx] [ebx]\
+ 	modify exact [esi edi eax edx ebx];
+ 
+-void	div_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
++void div_byte_asm(u32 * flags, u8 * al, u8 * ah, u16 d, u8 s);
++
+ #pragma aux div_byte_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -941,7 +1022,8 @@ void	div_byte_asm(u32 *flags,u8 *al,u8 *ah,u16 d,u8 s);
+ 	parm [edi] [esi] [ecx] [ax] [bl]\
+ 	modify exact [esi edi ax bl];
+ 
+-void	div_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
++void div_word_asm(u32 * flags, u16 * ax, u16 * dx, u16 dlo, u16 dhi, u16 s);
++
+ #pragma aux div_word_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -953,7 +1035,8 @@ void	div_word_asm(u32 *flags,u16 *ax,u16 *dx,u16 dlo,u16 dhi,u16 s);
+ 	parm [edi] [esi] [ecx] [ax] [dx] [bx]\
+ 	modify exact [esi edi ax dx bx];
+ 
+-void	div_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
++void div_long_asm(u32 * flags, u32 * eax, u32 * edx, u32 dlo, u32 dhi, u32 s);
++
+ #pragma aux div_long_asm =			\
+ 	"push	[edi]"            		\
+ 	"popf"                         	\
+@@ -967,4 +1050,4 @@ void	div_long_asm(u32 *flags,u32 *eax,u32 *edx,u32 dlo,u32 dhi,u32 s);
+ 
+ #endif
+ 
+-#endif /* __X86EMU_PRIM_ASM_H */
++#endif                          /* __X86EMU_PRIM_ASM_H */
+diff --git a/libs/x86emu/x86emu/prim_ops.h b/libs/x86emu/x86emu/prim_ops.h
+index bea8357..0f0e78d 100644
+--- a/libs/x86emu/x86emu/prim_ops.h
++++ b/libs/x86emu/x86emu/prim_ops.h
+@@ -40,102 +40,102 @@
+ #define __X86EMU_PRIM_OPS_H
+ 
+ #ifdef  __cplusplus
+-extern "C" {            			/* Use "C" linkage when in C++ mode */
++extern "C" {                    /* Use "C" linkage when in C++ mode */
+ #endif
+ 
+-u16     aaa_word (u16 d);
+-u16     aas_word (u16 d);
+-u16     aad_word (u16 d);
+-u16     aam_word (u8 d);
+-u8      adc_byte (u8 d, u8 s);
+-u16     adc_word (u16 d, u16 s);
+-u32     adc_long (u32 d, u32 s);
+-u8      add_byte (u8 d, u8 s);
+-u16     add_word (u16 d, u16 s);
+-u32     add_long (u32 d, u32 s);
+-u8      and_byte (u8 d, u8 s);
+-u16     and_word (u16 d, u16 s);
+-u32     and_long (u32 d, u32 s);
+-u8      cmp_byte (u8 d, u8 s);
+-u16     cmp_word (u16 d, u16 s);
+-u32     cmp_long (u32 d, u32 s);
+-u8      daa_byte (u8 d);
+-u8      das_byte (u8 d);
+-u8      dec_byte (u8 d);
+-u16     dec_word (u16 d);
+-u32     dec_long (u32 d);
+-u8      inc_byte (u8 d);
+-u16     inc_word (u16 d);
+-u32     inc_long (u32 d);
+-u8      or_byte (u8 d, u8 s);
+-u16     or_word (u16 d, u16 s);
+-u32     or_long (u32 d, u32 s);
+-u8      neg_byte (u8 s);
+-u16     neg_word (u16 s);
+-u32     neg_long (u32 s);
+-u8      not_byte (u8 s);
+-u16     not_word (u16 s);
+-u32     not_long (u32 s);
+-u8      rcl_byte (u8 d, u8 s);
+-u16     rcl_word (u16 d, u8 s);
+-u32     rcl_long (u32 d, u8 s);
+-u8      rcr_byte (u8 d, u8 s);
+-u16     rcr_word (u16 d, u8 s);
+-u32     rcr_long (u32 d, u8 s);
+-u8      rol_byte (u8 d, u8 s);
+-u16     rol_word (u16 d, u8 s);
+-u32     rol_long (u32 d, u8 s);
+-u8      ror_byte (u8 d, u8 s);
+-u16     ror_word (u16 d, u8 s);
+-u32     ror_long (u32 d, u8 s);
+-u8      shl_byte (u8 d, u8 s);
+-u16     shl_word (u16 d, u8 s);
+-u32     shl_long (u32 d, u8 s);
+-u8      shr_byte (u8 d, u8 s);
+-u16     shr_word (u16 d, u8 s);
+-u32     shr_long (u32 d, u8 s);
+-u8      sar_byte (u8 d, u8 s);
+-u16     sar_word (u16 d, u8 s);
+-u32     sar_long (u32 d, u8 s);
+-u16     shld_word (u16 d, u16 fill, u8 s);
+-u32     shld_long (u32 d, u32 fill, u8 s);
+-u16     shrd_word (u16 d, u16 fill, u8 s);
+-u32     shrd_long (u32 d, u32 fill, u8 s);
+-u8      sbb_byte (u8 d, u8 s);
+-u16     sbb_word (u16 d, u16 s);
+-u32     sbb_long (u32 d, u32 s);
+-u8      sub_byte (u8 d, u8 s);
+-u16     sub_word (u16 d, u16 s);
+-u32     sub_long (u32 d, u32 s);
+-void    test_byte (u8 d, u8 s);
+-void    test_word (u16 d, u16 s);
+-void    test_long (u32 d, u32 s);
+-u8      xor_byte (u8 d, u8 s);
+-u16     xor_word (u16 d, u16 s);
+-u32     xor_long (u32 d, u32 s);
+-void    imul_byte (u8 s);
+-void    imul_word (u16 s);
+-void    imul_long (u32 s);
+-void 	imul_long_direct(u32 *res_lo, u32* res_hi,u32 d, u32 s);
+-void    mul_byte (u8 s);
+-void    mul_word (u16 s);
+-void    mul_long (u32 s);
+-void    idiv_byte (u8 s);
+-void    idiv_word (u16 s);
+-void    idiv_long (u32 s);
+-void    div_byte (u8 s);
+-void    div_word (u16 s);
+-void    div_long (u32 s);
+-void    ins (int size);
+-void    outs (int size);
+-u16     mem_access_word (int addr);
+-void    push_word (u16 w);
+-void    push_long (u32 w);
+-u16     pop_word (void);
+-u32		pop_long (void);
++    u16 aaa_word(u16 d);
++    u16 aas_word(u16 d);
++    u16 aad_word(u16 d);
++    u16 aam_word(u8 d);
++    u8 adc_byte(u8 d, u8 s);
++    u16 adc_word(u16 d, u16 s);
++    u32 adc_long(u32 d, u32 s);
++    u8 add_byte(u8 d, u8 s);
++    u16 add_word(u16 d, u16 s);
++    u32 add_long(u32 d, u32 s);
++    u8 and_byte(u8 d, u8 s);
++    u16 and_word(u16 d, u16 s);
++    u32 and_long(u32 d, u32 s);
++    u8 cmp_byte(u8 d, u8 s);
++    u16 cmp_word(u16 d, u16 s);
++    u32 cmp_long(u32 d, u32 s);
++    u8 daa_byte(u8 d);
++    u8 das_byte(u8 d);
++    u8 dec_byte(u8 d);
++    u16 dec_word(u16 d);
++    u32 dec_long(u32 d);
++    u8 inc_byte(u8 d);
++    u16 inc_word(u16 d);
++    u32 inc_long(u32 d);
++    u8 or_byte(u8 d, u8 s);
++    u16 or_word(u16 d, u16 s);
++    u32 or_long(u32 d, u32 s);
++    u8 neg_byte(u8 s);
++    u16 neg_word(u16 s);
++    u32 neg_long(u32 s);
++    u8 not_byte(u8 s);
++    u16 not_word(u16 s);
++    u32 not_long(u32 s);
++    u8 rcl_byte(u8 d, u8 s);
++    u16 rcl_word(u16 d, u8 s);
++    u32 rcl_long(u32 d, u8 s);
++    u8 rcr_byte(u8 d, u8 s);
++    u16 rcr_word(u16 d, u8 s);
++    u32 rcr_long(u32 d, u8 s);
++    u8 rol_byte(u8 d, u8 s);
++    u16 rol_word(u16 d, u8 s);
++    u32 rol_long(u32 d, u8 s);
++    u8 ror_byte(u8 d, u8 s);
++    u16 ror_word(u16 d, u8 s);
++    u32 ror_long(u32 d, u8 s);
++    u8 shl_byte(u8 d, u8 s);
++    u16 shl_word(u16 d, u8 s);
++    u32 shl_long(u32 d, u8 s);
++    u8 shr_byte(u8 d, u8 s);
++    u16 shr_word(u16 d, u8 s);
++    u32 shr_long(u32 d, u8 s);
++    u8 sar_byte(u8 d, u8 s);
++    u16 sar_word(u16 d, u8 s);
++    u32 sar_long(u32 d, u8 s);
++    u16 shld_word(u16 d, u16 fill, u8 s);
++    u32 shld_long(u32 d, u32 fill, u8 s);
++    u16 shrd_word(u16 d, u16 fill, u8 s);
++    u32 shrd_long(u32 d, u32 fill, u8 s);
++    u8 sbb_byte(u8 d, u8 s);
++    u16 sbb_word(u16 d, u16 s);
++    u32 sbb_long(u32 d, u32 s);
++    u8 sub_byte(u8 d, u8 s);
++    u16 sub_word(u16 d, u16 s);
++    u32 sub_long(u32 d, u32 s);
++    void test_byte(u8 d, u8 s);
++    void test_word(u16 d, u16 s);
++    void test_long(u32 d, u32 s);
++    u8 xor_byte(u8 d, u8 s);
++    u16 xor_word(u16 d, u16 s);
++    u32 xor_long(u32 d, u32 s);
++    void imul_byte(u8 s);
++    void imul_word(u16 s);
++    void imul_long(u32 s);
++    void imul_long_direct(u32 * res_lo, u32 * res_hi, u32 d, u32 s);
++    void mul_byte(u8 s);
++    void mul_word(u16 s);
++    void mul_long(u32 s);
++    void idiv_byte(u8 s);
++    void idiv_word(u16 s);
++    void idiv_long(u32 s);
++    void div_byte(u8 s);
++    void div_word(u16 s);
++    void div_long(u32 s);
++    void ins(int size);
++    void outs(int size);
++    u16 mem_access_word(int addr);
++    void push_word(u16 w);
++    void push_long(u32 w);
++    u16 pop_word(void);
++    u32 pop_long(void);
++    void cpuid(void);
+ 
+ #ifdef  __cplusplus
+-}                       			/* End of "C" linkage for C++   	*/
++}                               /* End of "C" linkage for C++           */
+ #endif
+-
+-#endif /* __X86EMU_PRIM_OPS_H */
++#endif                          /* __X86EMU_PRIM_OPS_H */
+diff --git a/libs/x86emu/x86emu/prim_x86_gcc.h b/libs/x86emu/x86emu/prim_x86_gcc.h
+new file mode 100644
+index 0000000..646ec9d
+--- /dev/null
++++ b/libs/x86emu/x86emu/prim_x86_gcc.h
+@@ -0,0 +1,77 @@
++/****************************************************************************
++*
++* Inline helpers for x86emu
++*
++* Copyright (C) 2008 Bart Trojanowski, Symbio Technologies, LLC
++*
++*  ========================================================================
++*
++*  Permission to use, copy, modify, distribute, and sell this software and
++*  its documentation for any purpose is hereby granted without fee,
++*  provided that the above copyright notice appear in all copies and that
++*  both that copyright notice and this permission notice appear in
++*  supporting documentation, and that the name of the authors not be used
++*  in advertising or publicity pertaining to distribution of the software
++*  without specific, written prior permission.  The authors makes no
++*  representations about the suitability of this software for any purpose.
++*  It is provided "as is" without express or implied warranty.
++*
++*  THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
++*  INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
++*  EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
++*  CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
++*  USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
++*  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
++*  PERFORMANCE OF THIS SOFTWARE.
++*
++*  ========================================================================
++*
++* Language:     GNU C
++* Environment:  GCC on i386 or x86-64
++* Developer:    Bart Trojanowski
++*
++* Description:  This file defines a few x86 macros that can be used by the
++*               emulator to execute native instructions.
++*
++*               For PIC vs non-PIC code refer to:
++*               http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well
++*
++****************************************************************************/
++#ifndef __X86EMU_PRIM_X86_GCC_H
++#define __X86EMU_PRIM_X86_GCC_H
++
++#include "x86emu/types.h"
++
++#if !defined(__GNUC__) || !(defined (__i386__) || defined(__i386) || defined(__AMD64__) || defined(__amd64__))
++#error This file is intended to be used by gcc on i386 or x86-64 system
++#endif
++
++#if defined(__PIC__) && defined(__i386__)
++
++#define X86EMU_HAS_HW_CPUID 1
++static inline void
++hw_cpuid(u32 * a, u32 * b, u32 * c, u32 * d)
++{
++    __asm__ __volatile__("pushl %%ebx      \n\t"
++                         "cpuid            \n\t"
++                         "movl %%ebx, %1   \n\t"
++                         "popl %%ebx       \n\t":"=a"(*a), "=r"(*b),
++                         "=c"(*c), "=d"(*d)
++                         :"a"(*a), "c"(*c)
++                         :"cc");
++}
++
++#else                           /* ! (__PIC__ && __i386__) */
++
++#define x86EMU_HAS_HW_CPUID 1
++static inline void
++hw_cpuid(u32 * a, u32 * b, u32 * c, u32 * d)
++{
++    __asm__ __volatile__("cpuid":"=a"(*a), "=b"(*b), "=c"(*c), "=d"(*d)
++                         :"a"(*a), "c"(*c)
++                         :"cc");
++}
++
++#endif                          /* __PIC__ && __i386__ */
++
++#endif                          /* __X86EMU_PRIM_X86_GCC_H */
+diff --git a/libs/x86emu/x86emu/regs.h b/libs/x86emu/x86emu/regs.h
+index 52cf8e4..6bd0611 100644
+--- a/libs/x86emu/x86emu/regs.h
++++ b/libs/x86emu/x86emu/regs.h
+@@ -42,7 +42,7 @@
+ /*---------------------- Macros and type definitions ----------------------*/
+ 
+ #ifdef PACK
+-# pragma PACK
++#pragma PACK
+ #endif
+ 
+ /*
+@@ -64,48 +64,48 @@
+ 
+ typedef struct {
+     u32 e_reg;
+-	} I32_reg_t;
++} I32_reg_t;
+ 
+ typedef struct {
+-	u16 filler0, x_reg;
+-	} I16_reg_t;
++    u16 filler0, x_reg;
++} I16_reg_t;
+ 
+ typedef struct {
+-	u8 filler0, filler1, h_reg, l_reg;
+-	} I8_reg_t;
++    u8 filler0, filler1, h_reg, l_reg;
++} I8_reg_t;
+ 
+-#else /* !__BIG_ENDIAN__ */
++#else                           /* !__BIG_ENDIAN__ */
+ 
+ typedef struct {
+     u32 e_reg;
+-	} I32_reg_t;
++} I32_reg_t;
+ 
+ typedef struct {
+-	u16 x_reg;
+-	} I16_reg_t;
++    u16 x_reg;
++} I16_reg_t;
+ 
+ typedef struct {
+-	u8 l_reg, h_reg;
+-	} I8_reg_t;
++    u8 l_reg, h_reg;
++} I8_reg_t;
+ 
+-#endif /* BIG_ENDIAN */
++#endif                          /* BIG_ENDIAN */
+ 
+ typedef union {
+-	I32_reg_t   I32_reg;
+-	I16_reg_t   I16_reg;
+-	I8_reg_t    I8_reg;
+-	} i386_general_register;
++    I32_reg_t I32_reg;
++    I16_reg_t I16_reg;
++    I8_reg_t I8_reg;
++} i386_general_register;
+ 
+ struct i386_general_regs {
+-	i386_general_register A, B, C, D;
+-	};
++    i386_general_register A, B, C, D;
++};
+ 
+ typedef struct i386_general_regs Gen_reg_t;
+ 
+ struct i386_special_regs {
+-	i386_general_register SP, BP, SI, DI, IP;
+-	u32 FLAGS;
+-	};
++    i386_general_register SP, BP, SI, DI, IP;
++    u32 FLAGS;
++};
+ 
+ /*  
+  * Segment registers here represent the 16 bit quantities
+@@ -114,7 +114,7 @@ struct i386_special_regs {
+ 
+ struct i386_segment_regs {
+     u16 CS, DS, SS, ES, FS, GS;
+-	};
++};
+ 
+ /* 8 bit registers */
+ #define R_AH  gen.A.I8_reg.h_reg
+@@ -258,9 +258,9 @@ struct i386_segment_regs {
+ #define  INTR_HALTED          0x4
+ 
+ typedef struct {
+-    struct i386_general_regs    gen;
+-    struct i386_special_regs    spc;
+-    struct i386_segment_regs    seg;
++    struct i386_general_regs gen;
++    struct i386_special_regs spc;
++    struct i386_segment_regs seg;
+     /*
+      * MODE contains information on:
+      *  REPE prefix             2 bits  repe,repne
+@@ -273,21 +273,21 @@ typedef struct {
+      *  Extern interrupt        1 bits
+      *  Halted                  1 bits
+      */
+-    u32                         mode;
+-    volatile int                intr;   /* mask of pending interrupts */
+-	int                         debug;
++    u32 mode;
++    volatile int intr;          /* mask of pending interrupts */
++    int debug;
+ #ifdef DEBUG
+-	int                         check;
+-    u16                         saved_ip;
+-    u16                         saved_cs;
+-    int                         enc_pos;
+-    int                         enc_str_pos;
+-    char                        decode_buf[32]; /* encoded byte stream  */
+-    char                        decoded_buf[256]; /* disassembled strings */
++    int check;
++    u16 saved_ip;
++    u16 saved_cs;
++    int enc_pos;
++    int enc_str_pos;
++    char decode_buf[32];        /* encoded byte stream  */
++    char decoded_buf[256];      /* disassembled strings */
+ #endif
+-    u8                          intno;
+-    u8                          __pad[3];
+-	} X86EMU_regs;
++    u8 intno;
++    u8 __pad[3];
++} X86EMU_regs;
+ 
+ /****************************************************************************
+ REMARKS:
+@@ -300,20 +300,20 @@ private			- private data pointer
+ x86			- X86 registers
+ ****************************************************************************/
+ typedef struct {
+-	unsigned long	mem_base;
+-	unsigned long	mem_size;
+-	void*        	private;
+-	X86EMU_regs		x86;
+-	} X86EMU_sysEnv;
++    unsigned long mem_base;
++    unsigned long mem_size;
++    void *private;
++    X86EMU_regs x86;
++} X86EMU_sysEnv;
+ 
+ #ifdef END_PACK
+-# pragma END_PACK
++#pragma END_PACK
+ #endif
+ 
+ /*----------------------------- Global Variables --------------------------*/
+ 
+ #ifdef  __cplusplus
+-extern "C" {            			/* Use "C" linkage when in C++ mode */
++extern "C" {                    /* Use "C" linkage when in C++ mode */
+ #endif
+ 
+ /* Global emulator machine state.
+@@ -321,17 +321,16 @@ extern "C" {            			/* Use "C" linkage when in C++ mode */
+  * We keep it global to avoid pointer dereferences in the code for speed.
+  */
+ 
+-extern    X86EMU_sysEnv	_X86EMU_env;
++    extern X86EMU_sysEnv _X86EMU_env;
+ #define   M             _X86EMU_env
+ 
+ /*-------------------------- Function Prototypes --------------------------*/
+ 
+ /* Function to log information at runtime */
+ 
+-void	printk(const char *fmt, ...);
++    void printk(const char *fmt, ...);
+ 
+ #ifdef  __cplusplus
+-}                       			/* End of "C" linkage for C++   	*/
++}                               /* End of "C" linkage for C++           */
+ #endif
+-
+-#endif /* __X86EMU_REGS_H */
++#endif                          /* __X86EMU_REGS_H */
+diff --git a/libs/x86emu/x86emu/types.h b/libs/x86emu/x86emu/types.h
+index c0c09c1..5a6ef01 100644
+--- a/libs/x86emu/x86emu/types.h
++++ b/libs/x86emu/x86emu/types.h
+@@ -36,7 +36,6 @@
+ *
+ ****************************************************************************/
+ 
+-
+ #ifndef __X86EMU_TYPES_H
+ #define __X86EMU_TYPES_H
+ 
+@@ -61,46 +60,21 @@
+ 
+ /*---------------------- Macros and type definitions ----------------------*/
+ 
+-/* Currently only for Linux/32bit */
+-#undef  __HAS_LONG_LONG__
+-#if defined(__GNUC__) && !defined(NO_LONG_LONG)
+-#define __HAS_LONG_LONG__
+-#endif
++#include <stdint.h>
+ 
+-/* Taken from Xmd.h */
+-#undef NUM32
+-#if defined (_LP64) || \
+-    defined(__alpha) || defined(__alpha__) || \
+-    defined(__ia64__) || defined(ia64) || \
+-    defined(__sparc64__) || \
+-    defined(__s390x__) || \
+-    (defined(__hppa__) && defined(__LP64)) || \
+-    defined(__amd64__) || defined(amd64) || \
+-    (defined(__sgi) && (_MIPS_SZLONG == 64))
+-#define NUM32 int
+-#else
+-#define NUM32 long
+-#endif
++typedef uint8_t u8;
++typedef uint16_t u16;
++typedef uint32_t u32;
++typedef uint64_t u64;
+ 
+-typedef unsigned char 		u8;
+-typedef unsigned short 		u16;
+-typedef unsigned NUM32 		u32;
+-#ifdef __HAS_LONG_LONG__
+-typedef unsigned long long 	u64;
+-#endif
++typedef int8_t s8;
++typedef int16_t s16;
++typedef int32_t s32;
++typedef int64_t s64;
+ 
+-typedef char 				s8;
+-typedef short 				s16;
+-typedef NUM32 				s32;
+-#ifdef __HAS_LONG_LONG__
+-typedef long long 			s64;
+-#endif
+-
+-typedef unsigned int			uint;
+-typedef int 				sint;
++typedef unsigned int uint;
++typedef int sint;
+ 
+ typedef u16 X86EMU_pioAddr;
+ 
+-#undef NUM32
+-
+-#endif	/* __X86EMU_TYPES_H */
++#endif                          /* __X86EMU_TYPES_H */
+diff --git a/libs/x86emu/x86emu/x86emui.h b/libs/x86emu/x86emu/x86emui.h
+index 112ee36..f11dc10 100644
+--- a/libs/x86emu/x86emu/x86emui.h
++++ b/libs/x86emu/x86emu/x86emui.h
+@@ -38,7 +38,6 @@
+ *
+ ****************************************************************************/
+ 
+-
+ #ifndef __X86EMU_X86EMUI_H
+ #define __X86EMU_X86EMUI_H
+ 
+@@ -74,29 +73,28 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#endif                                                                                           
++#endif
+ /*--------------------------- Inline Functions ----------------------------*/
+ 
+ #ifdef  __cplusplus
+-extern "C" {            			/* Use "C" linkage when in C++ mode */
++extern "C" {                    /* Use "C" linkage when in C++ mode */
+ #endif
+ 
+-extern u8  	(X86APIP sys_rdb)(u32 addr);
+-extern u16 	(X86APIP sys_rdw)(u32 addr);
+-extern u32 	(X86APIP sys_rdl)(u32 addr);
+-extern void (X86APIP sys_wrb)(u32 addr,u8 val);
+-extern void (X86APIP sys_wrw)(u32 addr,u16 val);
+-extern void (X86APIP sys_wrl)(u32 addr,u32 val);
++    extern u8(X86APIP sys_rdb) (u32 addr);
++    extern u16(X86APIP sys_rdw) (u32 addr);
++    extern u32(X86APIP sys_rdl) (u32 addr);
++    extern void (X86APIP sys_wrb) (u32 addr, u8 val);
++    extern void (X86APIP sys_wrw) (u32 addr, u16 val);
++    extern void (X86APIP sys_wrl) (u32 addr, u32 val);
+ 
+-extern u8  	(X86APIP sys_inb)(X86EMU_pioAddr addr);
+-extern u16 	(X86APIP sys_inw)(X86EMU_pioAddr addr);
+-extern u32 	(X86APIP sys_inl)(X86EMU_pioAddr addr);
+-extern void (X86APIP sys_outb)(X86EMU_pioAddr addr,u8 val);
+-extern void (X86APIP sys_outw)(X86EMU_pioAddr addr,u16 val);
+-extern void	(X86APIP sys_outl)(X86EMU_pioAddr addr,u32 val);
++    extern u8(X86APIP sys_inb) (X86EMU_pioAddr addr);
++    extern u16(X86APIP sys_inw) (X86EMU_pioAddr addr);
++    extern u32(X86APIP sys_inl) (X86EMU_pioAddr addr);
++    extern void (X86APIP sys_outb) (X86EMU_pioAddr addr, u8 val);
++    extern void (X86APIP sys_outw) (X86EMU_pioAddr addr, u16 val);
++    extern void (X86APIP sys_outl) (X86EMU_pioAddr addr, u32 val);
+ 
+ #ifdef  __cplusplus
+-}                       			/* End of "C" linkage for C++   	*/
++}                               /* End of "C" linkage for C++           */
+ #endif
+-
+-#endif /* __X86EMU_X86EMUI_H */
++#endif                          /* __X86EMU_X86EMUI_H */
+-- 
+1.9.1
+
diff --git a/meta/recipes-bsp/v86d/v86d/ar-from-env.patch b/meta/recipes-bsp/v86d/v86d/ar-from-env.patch
new file mode 100644
index 0000000..1dcbc71
--- /dev/null
+++ b/meta/recipes-bsp/v86d/v86d/ar-from-env.patch
@@ -0,0 +1,33 @@
+Fix cross link using host-cross ar
+
+If building on 32bit host and creating 64bit libraries, the target
+package builds should not invoke the 32bit hosts's ar.  Specifically
+you will get an error message like:
+
+x86_64-linux-gcc  -m64 --sysroot=/opt/qemux86-64/tmp/sysroots/qemux86-64 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Llibs/x86emu v86_x86emu.o v86_mem.o v86_common.o  v86.o -lx86emu -o v86d
+libs/x86emu/libx86emu.a: could not read symbols: Archive has no index; run ranlib to add one
+collect2: error: ld returned 1 exit status
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Pending
+
+---
+ libs/x86emu/Makefile |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/libs/x86emu/Makefile
++++ b/libs/x86emu/Makefile
+@@ -1,7 +1,11 @@
+ OBJS = decode.o fpu.o ops.o ops2.o prim_ops.o sys.o
+ 
++ifeq ($(AR),)
++	AR = ar
++endif
++
+ libx86emu.a: $(OBJS)
+-	ar rv $@ $+
++	$(AR) rv $@ $+
+ 
+ %.o: %.c
+ 	$(CC) -c $(CFLAGS) -o $@ $<
diff --git a/meta/recipes-bsp/v86d/v86d/fbsetup b/meta/recipes-bsp/v86d/v86d/fbsetup
new file mode 100755
index 0000000..2a409cc
--- /dev/null
+++ b/meta/recipes-bsp/v86d/v86d/fbsetup
@@ -0,0 +1,3 @@
+#!/bin/sh 
+
+/sbin/modprobe uvesafb
diff --git a/meta/recipes-bsp/v86d/v86d/uvesafb.conf b/meta/recipes-bsp/v86d/v86d/uvesafb.conf
new file mode 100644
index 0000000..4378975
--- /dev/null
+++ b/meta/recipes-bsp/v86d/v86d/uvesafb.conf
@@ -0,0 +1,2 @@
+# Load uvesafb.ko at boot
+uvesafb
diff --git a/meta/recipes-bsp/v86d/v86d_0.1.10.bb b/meta/recipes-bsp/v86d/v86d_0.1.10.bb
new file mode 100644
index 0000000..f502072
--- /dev/null
+++ b/meta/recipes-bsp/v86d/v86d_0.1.10.bb
@@ -0,0 +1,69 @@
+SUMMARY = "User support binary for the uvesafb kernel module"
+HOMEPAGE = "http://dev.gentoo.org/~spock/projects/uvesafb/"
+
+# the copyright info is at the bottom of README, expect break
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://README;md5=94ac1971e4f2309dc322d598e7b1f7dd"
+
+DEPENDS = "virtual/kernel"
+RRECOMMENDS_${PN} = "kernel-module-uvesafb"
+PR = "r2"
+
+SRC_URI = "http://distfiles.gentoo.org/distfiles/${BP}.tar.bz2 \
+           file://Update-x86emu-from-X.org.patch \
+           file://fbsetup \
+           file://uvesafb.conf \
+           file://ar-from-env.patch"
+
+SRC_URI[md5sum] = "51c792ba7b874ad8c43f0d3da4cfabe0"
+SRC_URI[sha256sum] = "634964ae18ef68c8493add2ce150e3b4502badeb0d9194b4bd81241d25e6735c"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+INITSCRIPT_NAME = "fbsetup"
+INITSCRIPT_PARAMS = "start 0 S ."
+
+do_configure () {
+	./configure --with-x86emu
+}
+
+do_compile () {
+	KDIR="${STAGING_DIR_HOST}/usr" make
+}
+
+do_install () {
+	install -d ${D}${base_sbindir}
+	install v86d ${D}${base_sbindir}/
+
+        # Only install fbsetup script if 'sysvinit' is in DISTRO_FEATURES
+        if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+            install -d ${D}${sysconfdir}/init.d/
+            install -m 0755 ${WORKDIR}/fbsetup ${D}${sysconfdir}/init.d/fbsetup
+        fi
+
+        # Install systemd related configuration file
+        if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+            install -d ${D}${sysconfdir}/modules-load.d
+            install -m 0644 ${WORKDIR}/uvesafb.conf ${D}${sysconfdir}/modules-load.d
+        fi
+}
+
+# As the recipe doesn't inherit systemd.bbclass, we need to set this variable
+# manually to avoid unnecessary postinst/preinst generated.
+python __anonymous() {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+inherit update-rc.d
+
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask fbsetup.service
+	fi
+}
diff --git a/meta/recipes-connectivity/avahi/avahi-ui_0.6.31.bb b/meta/recipes-connectivity/avahi/avahi-ui_0.6.31.bb
new file mode 100644
index 0000000..eea4d70
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/avahi-ui_0.6.31.bb
@@ -0,0 +1,72 @@
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \
+                    file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \
+                    file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \
+                    file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf"
+
+require avahi.inc
+
+inherit python-dir pythonnative
+
+PACKAGECONFIG ??= "python"
+PACKAGECONFIG[python] = "--enable-python,--disable-python,python-native python"
+
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "2f22745b8f7368ad5a0a3fddac343f2d"
+SRC_URI[sha256sum] = "8372719b24e2dd75de6f59bb1315e600db4fd092805bd1201ed0cb651a2dab48"
+
+DEPENDS += "avahi gtk+ libglade"
+
+AVAHI_GTK = "--enable-gtk --disable-gtk3"
+
+S = "${WORKDIR}/avahi-${PV}"
+
+PACKAGES = "${PN} ${PN}-utils ${PN}-dbg ${PN}-dev ${PN}-staticdev ${PN}-doc python-avahi avahi-discover avahi-discover-standalone"
+
+FILES_${PN} = "${libdir}/libavahi-ui*.so.*"
+FILES_${PN}-dbg += "${libdir}/.debug/libavah-ui*"
+FILES_${PN}-dev += "${libdir}/libavahi-ui${SOLIBSDEV}"
+FILES_${PN}-staticdev += "${libdir}/libavahi-ui.a"
+
+FILES_${PN}-utils = "${bindir}/b* ${datadir}/applications/b*"
+
+FILES_python-avahi = "${PYTHON_SITEPACKAGES_DIR}/avahi ${PYTHON_SITEPACKAGES_DIR}/avahi_discover"
+FILES_avahi-discover = "${bindir}/avahi-discover \
+                        ${datadir}/applications/avahi-discover.desktop \
+                        ${datadir}/avahi/interfaces/avahi-discover*"
+FILES_avahi-discover-standalone = "${bindir}/avahi-discover-standalone \
+                                   ${datadir}/avahi/interfaces/avahi-discover.glade"
+
+RDEPENDS_avahi-discover = "python-avahi python-pygtk"
+RDEPENDS_python-avahi = "python-core python-dbus"
+
+
+do_install_append () {
+	rm ${D}${sysconfdir} -rf
+	rm ${D}${base_libdir} -rf
+	rm ${D}${systemd_unitdir} -rf
+	# The ${systemd_unitdir} is /lib/systemd, so we need rmdir /lib,
+	# but not ${base_libdir} here. And the /lib may not exist
+	# whithout systemd.
+	[ ! -d ${D}/lib ] || rmdir ${D}/lib --ignore-fail-on-non-empty
+	rm ${D}${bindir}/avahi-b*
+	rm ${D}${bindir}/avahi-p*
+	rm ${D}${bindir}/avahi-r*
+	rm ${D}${bindir}/avahi-s*
+	rm ${D}${includedir}/avahi-c* -rf
+	rm ${D}${includedir}/avahi-g* -rf
+	rm ${D}${libdir}/libavahi-c*
+	rm ${D}${libdir}/libavahi-g*
+	rm ${D}${libdir}/pkgconfig/avahi-c*
+	rm ${D}${libdir}/pkgconfig/avahi-g*
+	rm ${D}${sbindir} -rf
+	rm ${D}${datadir}/avahi/a*
+	rm ${D}${datadir}/avahi/s*
+	rm ${D}${datadir}/locale/ -rf
+	rm ${D}${datadir}/dbus* -rf
+	rm ${D}${mandir}/man1/a*
+	rm ${D}${mandir}/man5 -rf
+	rm ${D}${mandir}/man8 -rf
+}
+
diff --git a/meta/recipes-connectivity/avahi/avahi.inc b/meta/recipes-connectivity/avahi/avahi.inc
new file mode 100644
index 0000000..825197d
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/avahi.inc
@@ -0,0 +1,158 @@
+SUMMARY = "Avahi IPv4LL network address configuration daemon"
+DESCRIPTION = 'Avahi is a fully LGPL framework for Multicast DNS Service Discovery. It \
+allows programs to publish and discover services and hosts running on a local network \
+with no specific configuration. This tool implements IPv4LL, "Dynamic Configuration of \
+IPv4 Link-Local Addresses" (IETF RFC3927), a protocol for automatic IP address \
+configuration from the link-local 169.254.0.0/16 range without the need for a central \
+server.'
+AUTHOR = "Lennart Poettering <lennart@poettering.net>"
+HOMEPAGE = "http://avahi.org"
+BUGTRACKER = "http://avahi.org/report"
+SECTION = "network"
+
+# major part is under LGPLv2.1+, but several .dtd, .xsl, initscripts and
+# python scripts are under GPLv2+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+
+INC_PR = "r11"
+
+DEPENDS = "expat libcap libdaemon dbus glib-2.0"
+
+SRC_URI = "http://avahi.org/download/avahi-${PV}.tar.gz \
+          file://00avahi-autoipd \
+          file://99avahi-autoipd \
+          file://initscript.patch \
+          file://avahi_fix_install_issue.patch \
+          file://fix_for_automake_1.12.x.patch \
+          file://out-of-tree.patch \
+          file://0001-avahi-fix-avahi-status-command-error-prompt.patch \
+          file://reuseport-check.patch \
+          "
+
+USERADD_PACKAGES = "avahi-daemon avahi-autoipd"
+USERADD_PARAM_avahi-daemon = "--system --home /var/run/avahi-daemon \
+                              --no-create-home --shell /bin/false \
+                              --user-group avahi"
+
+USERADD_PARAM_avahi-autoipd = "--system --home /var/run/avahi-autoipd \
+                              --no-create-home --shell /bin/false \
+                              --user-group \
+                              -c \"Avahi autoip daemon\" \
+                              avahi-autoipd"
+
+inherit autotools pkgconfig update-rc.d gettext useradd
+
+EXTRA_OECONF = "--disable-introspection \
+             --with-avahi-priv-access-group=adm \
+             --disable-stack-protector \
+             --disable-gdbm \
+             --disable-mono \
+             --disable-monodoc \
+             --disable-qt3 \
+             --disable-qt4 \
+             --disable-python \
+             --disable-doxygen-doc \
+             ${EXTRA_OECONF_SYSVINIT} \
+             ${EXTRA_OECONF_SYSTEMD} \
+             ${AVAHI_GTK} \
+           "
+
+# The distro choice determines what init scripts are installed
+EXTRA_OECONF_SYSVINIT = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','--with-distro=debian','--with-distro=none',d)}"
+EXTRA_OECONF_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES','systemd','--with-systemdsystemunitdir=${systemd_unitdir}/system/','--without-systemdsystemunitdir',d)}"
+
+AVAHI_GTK ?= "--disable-gtk --disable-gtk3"
+
+LDFLAGS_append_libc-uclibc = " -lintl"
+LDFLAGS_append_uclinux-uclibc = " -lintl"
+
+do_configure_prepend() {
+    sed 's:AM_CHECK_PYMOD:echo "no pymod" #AM_CHECK_PYMOD:g' -i ${S}/configure.ac
+}
+
+
+PACKAGES =+ "avahi-daemon libavahi-common libavahi-core libavahi-client avahi-dnsconfd libavahi-glib libavahi-ui avahi-autoipd avahi-utils"
+
+# As avahi doesn't put any files into PN, clear the files list to avoid problems
+# if extra libraries appear.
+FILES_${PN} = ""
+FILES_avahi-autoipd = "${sbindir}/avahi-autoipd \
+                       ${sysconfdir}/avahi/avahi-autoipd.action \
+                       ${sysconfdir}/dhcp/*/avahi-autoipd \
+                       ${sysconfdir}/udhcpc.d/00avahi-autoipd \
+                       ${sysconfdir}/udhcpc.d/99avahi-autoipd"
+FILES_libavahi-common = "${libdir}/libavahi-common.so.*"
+FILES_libavahi-core = "${libdir}/libavahi-core.so.*"
+FILES_avahi-daemon = "${sbindir}/avahi-daemon \
+                      ${sysconfdir}/avahi/avahi-daemon.conf \
+                      ${sysconfdir}/avahi/hosts \
+                      ${sysconfdir}/avahi/services \
+                      ${sysconfdir}/dbus-1 \
+                      ${sysconfdir}/init.d/avahi-daemon \
+                      ${datadir}/avahi/introspection/*.introspect \
+                      ${datadir}/avahi/avahi-service.dtd \
+                      ${datadir}/avahi/service-types \
+                      ${datadir}/dbus-1/system-services"
+FILES_libavahi-client = "${libdir}/libavahi-client.so.*"
+FILES_libavahi-ui = "${libdir}/libavahi-ui.so.*"
+FILES_avahi-dnsconfd = "${sbindir}/avahi-dnsconfd \
+                        ${sysconfdir}/avahi/avahi-dnsconfd.action \
+                        ${sysconfdir}/init.d/avahi-dnsconfd"
+FILES_libavahi-glib = "${libdir}/libavahi-glib.so.*"
+FILES_libavahi-gobject = "${libdir}/libavahi-gobject.so.*"
+FILES_avahi-utils = "${bindir}/avahi-*"
+
+RDEPENDS_${PN}-dev = "avahi-daemon (= ${EXTENDPKGV}) libavahi-core (= ${EXTENDPKGV}) libavahi-client (= ${EXTENDPKGV})"
+
+# uclibc has no nss
+RRECOMMENDS_avahi-daemon_append_libc-glibc = " libnss-mdns"
+RRECOMMENDS_${PN}_append_libc-glibc = " libnss-mdns"
+
+RRECOMMENDS_avahi-dev = "expat-dev libcap-dev libdaemon-dev dbus-dev glib-2.0-dev update-rc.d-dev"
+RRECOMMENDS_avahi-dev_append_libc-glibc = " gettext-dev"
+
+RRECOMMENDS_avahi-dev[nodeprrecs] = "1"
+
+CONFFILES_avahi-daemon = "${sysconfdir}/avahi/avahi-daemon.conf"
+
+INITSCRIPT_PACKAGES = "avahi-daemon avahi-dnsconfd"
+INITSCRIPT_NAME_avahi-daemon = "avahi-daemon"
+INITSCRIPT_PARAMS_avahi-daemon = "defaults 21 19"
+INITSCRIPT_NAME_avahi-dnsconfd = "avahi-dnsconfd"
+INITSCRIPT_PARAMS_avahi-dnsconfd = "defaults 22 19"
+
+do_install() {
+	autotools_do_install
+
+	# don't install /var/run when populating rootfs. Do it through volatile
+	# /var/run of current version is empty, so just remove it.
+	# if /var/run become non-empty in the future, need to install it via volatile
+	rm -rf ${D}${localstatedir}/run
+	rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
+	rm -rf ${D}${datadir}/dbus-1/interfaces
+	rmdir --ignore-fail-on-non-empty ${D}${datadir}/dbus-1
+	rm -rf ${D}${libdir}/avahi
+
+	install -d ${D}${sysconfdir}/udhcpc.d
+	install ${WORKDIR}/00avahi-autoipd ${D}${sysconfdir}/udhcpc.d
+	install ${WORKDIR}/99avahi-autoipd ${D}${sysconfdir}/udhcpc.d
+}
+
+# At the time the postinst runs, dbus might not be setup so only restart if running 
+# Don't exit early, because update-rc.d needs to run subsequently.
+
+pkg_postinst_avahi-daemon () {
+if [ -z "$D" ]; then
+	killall -q -HUP dbus-daemon || true
+fi
+}
+
+pkg_postrm_avahi-daemon () {
+	deluser avahi || true
+	delgroup avahi || true
+}
+
+pkg_postrm_avahi-autoipd () {
+	deluser avahi-autoipd || true
+	delgroup avahi-autoipd || true
+}
diff --git a/meta/recipes-connectivity/avahi/avahi_0.6.31.bb b/meta/recipes-connectivity/avahi/avahi_0.6.31.bb
new file mode 100644
index 0000000..5d796a2
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/avahi_0.6.31.bb
@@ -0,0 +1,22 @@
+require avahi.inc
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}-daemon ${PN}-dnsconfd"
+SYSTEMD_SERVICE_${PN}-daemon = "avahi-daemon.service"
+SYSTEMD_SERVICE_${PN}-dnsconfd = "avahi-dnsconfd.service"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://avahi-common/address.h;endline=25;md5=b1d1d2cda1c07eb848ea7d6215712d9d \
+                    file://avahi-core/dns.h;endline=23;md5=6fe82590b81aa0ddea5095b548e2fdcb \
+                    file://avahi-daemon/main.c;endline=21;md5=9ee77368c5407af77caaef1b07285969 \
+                    file://avahi-client/client.h;endline=23;md5=f4ac741a25c4f434039ba3e18c8674cf"
+
+PR = "${INC_PR}.1"
+
+SRC_URI[md5sum] = "2f22745b8f7368ad5a0a3fddac343f2d"
+SRC_URI[sha256sum] = "8372719b24e2dd75de6f59bb1315e600db4fd092805bd1201ed0cb651a2dab48"
+
+DEPENDS += "intltool-native"
+
+PACKAGES =+ "libavahi-gobject"
diff --git a/meta/recipes-connectivity/avahi/files/0001-avahi-fix-avahi-status-command-error-prompt.patch b/meta/recipes-connectivity/avahi/files/0001-avahi-fix-avahi-status-command-error-prompt.patch
new file mode 100644
index 0000000..7590df7
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/0001-avahi-fix-avahi-status-command-error-prompt.patch
@@ -0,0 +1,52 @@
+From f774ac25f436a782ccccc4dbe68378a684596799 Mon Sep 17 00:00:00 2001
+From: Lu Chong <Chong.Lu@windriver.com>
+Date: Thu, 7 Nov 2013 14:36:28 +0800
+Subject: [PATCH] avahi: fix avahi status command error prompt
+
+service --status-all command will display wrong status for avahi-daemon.
+This commit fix this error prompt and make service display right status
+for avahi-daemon.
+
+Upstream-Status: Pending
+
+Signed-off-by: Lu Chong <Chong.Lu@windriver.com>
+---
+ initscript/debian/avahi-daemon.in |   14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+diff --git a/initscript/debian/avahi-daemon.in b/initscript/debian/avahi-daemon.in
+index 4793b46..49ec358 100755
+--- a/initscript/debian/avahi-daemon.in
++++ b/initscript/debian/avahi-daemon.in
+@@ -153,7 +153,15 @@ d_reload() {
+ #       Function that check the status of the daemon/service.
+ #
+ d_status() {
+-    $DAEMON -c && echo "$DESC is running" || echo "$DESC is not running"
++    $DAEMON -c
++    status=$?
++    if [ $status = 0 ]; then
++        echo "$DESC is running"
++        return 0
++    else
++        echo "$DESC is not running"
++        return 3
++    fi
+ }
+ 
+ case "$1" in
+@@ -182,9 +190,9 @@ case "$1" in
+         d_status
+ 	;;
+     *)
+-        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|reload}" >&2
++        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|reload|status}" >&2
+         exit 1
+         ;;
+ esac
+ 
+-exit 0
++exit $?
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/avahi/files/00avahi-autoipd b/meta/recipes-connectivity/avahi/files/00avahi-autoipd
new file mode 100644
index 0000000..a0ab814
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/00avahi-autoipd
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+case "$1" in
+
+	deconfig|renew|bound)
+		/usr/sbin/avahi-autoipd -k $interface 2> /dev/null
+		;;
+esac
diff --git a/meta/recipes-connectivity/avahi/files/99avahi-autoipd b/meta/recipes-connectivity/avahi/files/99avahi-autoipd
new file mode 100644
index 0000000..234cdaa
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/99avahi-autoipd
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+case "$1" in
+
+	leasefail)
+		/usr/sbin/avahi-autoipd -wD $interface 2> /dev/null
+		;;
+esac
diff --git a/meta/recipes-connectivity/avahi/files/avahi_fix_install_issue.patch b/meta/recipes-connectivity/avahi/files/avahi_fix_install_issue.patch
new file mode 100644
index 0000000..32f20ec
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/avahi_fix_install_issue.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+
+Fixes this install issue
+#| /bin/sh: line 0: cd: /srv/home/nitin/builds/build-gcc47/tmp/work/i586-poky-linux/avahi-0.6.31-r3.0/image//usr/bin: No such file or directory
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/03
+
+Index: avahi-0.6.31/avahi-utils/Makefile.am
+===================================================================
+--- avahi-0.6.31.orig/avahi-utils/Makefile.am
++++ avahi-0.6.31/avahi-utils/Makefile.am
+@@ -54,6 +54,7 @@ avahi_set_host_name_CFLAGS = $(AM_CFLAGS
+ avahi_set_host_name_LDADD = $(AM_LDADD) ../avahi-client/libavahi-client.la ../avahi-common/libavahi-common.la
+ 
+ install-exec-local:
++	$(MKDIR_P) $(DESTDIR)/$(bindir) && \
+ 	cd $(DESTDIR)/$(bindir) && \
+ 		rm -f avahi-resolve-host-name avahi-resolve-address avahi-browse-domains avahi-publish-address avahi-publish-service && \
+ 		$(LN_S) avahi-resolve avahi-resolve-host-name && \
+Index: avahi-0.6.31/avahi-utils/Makefile.in
+===================================================================
+--- avahi-0.6.31.orig/avahi-utils/Makefile.in
++++ avahi-0.6.31/avahi-utils/Makefile.in
+@@ -906,6 +906,7 @@ uninstall-am: uninstall-binPROGRAMS
+ 
+ 
+ @HAVE_DBUS_TRUE@install-exec-local:
++@HAVE_DBUS_TRUE@	$(MKDIR_P) $(DESTDIR)/$(bindir) && \
+ @HAVE_DBUS_TRUE@	cd $(DESTDIR)/$(bindir) && \
+ @HAVE_DBUS_TRUE@		rm -f avahi-resolve-host-name avahi-resolve-address avahi-browse-domains avahi-publish-address avahi-publish-service && \
+ @HAVE_DBUS_TRUE@		$(LN_S) avahi-resolve avahi-resolve-host-name && \
diff --git a/meta/recipes-connectivity/avahi/files/fix_for_automake_1.12.x.patch b/meta/recipes-connectivity/avahi/files/fix_for_automake_1.12.x.patch
new file mode 100644
index 0000000..0fc4c29
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/fix_for_automake_1.12.x.patch
@@ -0,0 +1,34 @@
+Upstream-Status: Pending
+
+autoamke 1.12.x has depricated use of mkdir_p , and recommends use of MKDIR_P
+instead. Fixed the automake files accordingly to avoid warning-errors.
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/07/09
+
+
+Index: avahi-0.6.31/avahi-daemon/Makefile.am
+===================================================================
+--- avahi-0.6.31.orig/avahi-daemon/Makefile.am
++++ avahi-0.6.31/avahi-daemon/Makefile.am
+@@ -169,7 +169,7 @@ xmllint:
+ 	done
+ 
+ install-data-local:
+-	test -z "$(localstatedir)/run" || $(mkdir_p) "$(DESTDIR)$(localstatedir)/run"
++	test -z "$(localstatedir)/run" || $(MKDIR_P) "$(DESTDIR)$(localstatedir)/run"
+ 
+ update-systemd:
+ 	curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
+Index: avahi-0.6.31/avahi-autoipd/Makefile.am
+===================================================================
+--- avahi-0.6.31.orig/avahi-autoipd/Makefile.am
++++ avahi-0.6.31/avahi-autoipd/Makefile.am
+@@ -76,7 +76,7 @@ dhcliententerdir = $(sysconfdir)/dhcp/dh
+ dhclientexitdir = $(sysconfdir)/dhcp/dhclient-exit-hooks.d
+ 
+ install-exec-hook: dhclient-exit-hook dhclient-enter-hook
+-	$(mkdir_p) $(DESTDIR)$(dhcliententerdir) $(DESTDIR)$(dhclientexitdir)
++	$(MKDIR_P) $(DESTDIR)$(dhcliententerdir) $(DESTDIR)$(dhclientexitdir)
+ 	$(INSTALL) dhclient-enter-hook $(DESTDIR)$(dhcliententerdir)/avahi-autoipd
+ 	$(INSTALL) dhclient-exit-hook $(DESTDIR)$(dhclientexitdir)/avahi-autoipd
+ 
diff --git a/meta/recipes-connectivity/avahi/files/initscript.patch b/meta/recipes-connectivity/avahi/files/initscript.patch
new file mode 100644
index 0000000..193889e
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/initscript.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Pending
+
+diff --git a/initscript/debian/avahi-daemon.in b/initscript/debian/avahi-daemon.in
+index 30a2c2f..b5848a8 100755
+--- a/initscript/debian/avahi-daemon.in
++++ b/initscript/debian/avahi-daemon.in
+@@ -1,2 +1,14 @@
+ #!/bin/sh
+-
++### BEGIN INIT INFO
++# Provides:          avahi
++# Required-Start:    $remote_fs dbus
++# Required-Stop:     $remote_fs dbus
++# Should-Start:	     $syslog
++# Should-Stop:       $syslog
++# Default-Start:     2 3 4 5
++# Default-Stop:      0 1 6
++# Short-Description: Avahi mDNS/DNS-SD Daemon
++# Description:       Zeroconf daemon for configuring your network 
++#                    automatically
++### END INIT INFO
++#
+diff --git a/initscript/debian/avahi-dnsconfd.in b/initscript/debian/avahi-dnsconfd.in
+index ac34804..f95c340 100755
+--- a/initscript/debian/avahi-dnsconfd.in
++++ b/initscript/debian/avahi-dnsconfd.in
+@@ -1,1 +1,14 @@
+ #!/bin/sh
++### BEGIN INIT INFO
++# Provides:          avahi-dnsconfd
++# Required-Start:    $remote_fs avahi
++# Required-Stop:     $remote_fs avahi
++# Should-Start:	     $syslog
++# Should-Stop:       $syslog
++# Default-Start:     2 3 4 5
++# Default-Stop:      0 1 6
++# Short-Description: Avahi mDNS/DNS-SD DNS configuration
++# Description:       Zeroconf daemon for configuring your network 
++#                    automatically
++### END INIT INFO
++#
diff --git a/meta/recipes-connectivity/avahi/files/out-of-tree.patch b/meta/recipes-connectivity/avahi/files/out-of-tree.patch
new file mode 100644
index 0000000..43476cd
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/out-of-tree.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From a62dc95d75691ea4aefa86d8bbe54c62afd78ff6 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 17 Sep 2013 12:27:36 +0100
+Subject: [PATCH] build-sys: fix out-of-tree builds without xmltoman
+
+If manpages are enabled but xmltoman isn't present, out-of-tree builds fail
+because it checks inside the build directory for the pre-generated manpages.
+
+Fix this by using $srcdir when looking for files inside the source directory.
+---
+ configure.ac |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9debce2..047c7ae 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1021,7 +1021,7 @@ if test x$manpages = xyes ; then
+     fi
+ 
+     if test x$have_xmltoman = xno -o x$xmltoman = xno; then
+-        if ! test -e man/avahi-daemon.8 ; then
++        if ! test -e $srcdir/man/avahi-daemon.8 ; then
+             AC_MSG_ERROR([*** xmltoman was not found or was disabled, it is required to build the manpages as they have not been pre-built, install xmltoman, pass --disable-manpages or dont pass --disable-xmltoman])
+             exit 1
+         fi
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-connectivity/avahi/files/reuseport-check.patch b/meta/recipes-connectivity/avahi/files/reuseport-check.patch
new file mode 100644
index 0000000..bb81c2c
--- /dev/null
+++ b/meta/recipes-connectivity/avahi/files/reuseport-check.patch
@@ -0,0 +1,30 @@
+Fix avahi-daemon when running on kernel < 3.9 (patch taken from Ubuntu).
+
+Upstream-Status: Pending (unmaintained upstream)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Description: SO_REUSEPORT may not exist in running kernel
+ When userspace defines SO_REUSEPORT we will attempt to enable socket
+ port number reuse.  However if the running kernel does not support
+ this call it will fail preventing daemon startup.  If this call is
+ present but fails ENOPROTOOPT then we know that actually the kernel
+ does not support it and we should continue as if we did not have the
+ call at all.  (LP: #1228204)
+ .
+ This patch could be removed from the debian package after jessie release.
+Author: Andy Whitcroft <apw@canonical.com>
+
+Index: avahi-0.6.31/avahi-core/socket.c
+===================================================================
+--- avahi-0.6.31.orig/avahi-core/socket.c	2013-09-20 16:36:50.000000000 +0100
++++ avahi-0.6.31/avahi-core/socket.c	2013-09-20 16:38:23.781863644 +0100
+@@ -177,7 +177,8 @@
+     yes = 1;
+     if (setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &yes, sizeof(yes)) < 0) {
+         avahi_log_warn("SO_REUSEPORT failed: %s", strerror(errno));
+-        return -1;
++        if (errno != ENOPROTOOPT)
++            return -1;
+     }
+ #endif
+ 
diff --git a/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch b/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch
new file mode 100644
index 0000000..cb5251d
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/0001-build-use-pkg-config-to-find-libxml2.patch
@@ -0,0 +1,42 @@
+xml2-config is disabled, so change the configure script to use pkgconfig to find
+libxml2.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ configure.in | 18 +++---------------
+ 1 file changed, 3 insertions(+), 15 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index d566e1c..c9ef3a6 100644
+--- a/configure.in
++++ b/configure.in
+@@ -2102,21 +2102,9 @@ case "$use_libxml2" in
+ 		DST_LIBXML2_INC=""
+ 		;;
+ 	auto|yes)
+-		case X`(xml2-config --version) 2>/dev/null` in
+-		X2.[[6789]].*)
+-			libxml2_libs=`xml2-config --libs`
+-			libxml2_cflags=`xml2-config --cflags`
+-			;;
+-		*)
+-			libxml2_libs=
+-			libxml2_cflags=
+-			;;
+-		esac
+-		;;
+-	*)
+-		if test -f "$use_libxml2/bin/xml2-config" ; then
+-			libxml2_libs=`$use_libxml2/bin/xml2-config --libs`
+-			libxml2_cflags=`$use_libxml2/bin/xml2-config --cflags`
++		if pkg-config --exists libxml-2.0 ; then
++			libxml2_libs=`pkg-config libxml-2.0 --libs`
++			libxml2_cflags=`pkg-config libxml-2.0 --cflags`
+ 		fi
+ 		;;
+ esac
+-- 
+2.1.4
+
diff --git a/meta/recipes-connectivity/bind/bind/0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch b/meta/recipes-connectivity/bind/bind/0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch
new file mode 100644
index 0000000..1215093
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+Subject: gen.c: extend DIRNAMESIZE from 256 to 512
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ lib/dns/gen.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/dns/gen.c b/lib/dns/gen.c
+index 7a7dafb..51a0435 100644
+--- a/lib/dns/gen.c
++++ b/lib/dns/gen.c
+@@ -148,7 +148,7 @@ static const char copyright[] =
+ #define TYPECLASSBUF (TYPECLASSLEN + 1)
+ #define TYPECLASSFMT "%" STR(TYPECLASSLEN) "[-0-9a-z]_%d"
+ #define ATTRIBUTESIZE 256
+-#define DIRNAMESIZE 256
++#define DIRNAMESIZE 512
+ 
+ static struct cc {
+ 	struct cc *next;
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch b/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch
new file mode 100644
index 0000000..096d5d8
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/bind-confgen-build-unix.o-once.patch
@@ -0,0 +1,44 @@
+From 9b40619ff6fddfef2758ba797789f8487f412df3 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 16 Feb 2015 00:50:01 -0800
+Subject: [PATCH] confgen: don't build unix.o twice
+
+Fixed:
+unix/os.o: file not recognized: File truncated
+collect2: error: ld returned 1 exit status
+
+This is because os.o was built twice:
+* The implicity rule (depends on unix/os.o)
+* The "make all" in unix subdir (depends on unix/os.o)
+
+Depend on subdirs which is unix only rather than unix/os.o will fix the
+problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ bin/confgen/Makefile.in |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/bin/confgen/Makefile.in b/bin/confgen/Makefile.in
+index 8b3e5aa..4868a24 100644
+--- a/bin/confgen/Makefile.in
++++ b/bin/confgen/Makefile.in
+@@ -74,11 +74,11 @@ rndc-confgen.@O@: rndc-confgen.c
+ ddns-confgen.@O@: ddns-confgen.c
+ 	${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} -c ${srcdir}/ddns-confgen.c
+ 
+-rndc-confgen@EXEEXT@: rndc-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS} ${CONFDEPLIBS} 
++rndc-confgen@EXEEXT@: rndc-confgen.@O@ util.@O@ keygen.@O@ ${CONFDEPLIBS} $(SUBDIRS)
+ 	export BASEOBJS="rndc-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS}"; \
+ 	${FINALBUILDCMD}
+ 
+-ddns-confgen@EXEEXT@: ddns-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS} ${CONFDEPLIBS} 
++ddns-confgen@EXEEXT@: ddns-confgen.@O@ util.@O@ keygen.@O@ ${CONFDEPLIBS} $(SUBDIRS)
+ 	export BASEOBJS="ddns-confgen.@O@ util.@O@ keygen.@O@ ${UOBJS}"; \
+ 	${FINALBUILDCMD}
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/bind/bind/bind-ensure-searching-for-json-headers-searches-sysr.patch b/meta/recipes-connectivity/bind/bind/bind-ensure-searching-for-json-headers-searches-sysr.patch
new file mode 100644
index 0000000..13df3bb
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/bind-ensure-searching-for-json-headers-searches-sysr.patch
@@ -0,0 +1,49 @@
+From 9473d29843579802e96b0293a3e953fed93de82c Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Tue, 9 Jun 2015 11:22:00 -0400
+Subject: [PATCH] bind: ensure searching for json headers searches sysroot
+
+Bind can fail configure by detecting headers w/o libs[1], or
+it can fail the host contamination check as per below:
+
+ERROR: This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
+Rerun configure task after fixing this. The path was 'build/tmp/work/core2-64-poky-linux/bind/9.10.2-r1/build'
+ERROR: Function failed: do_qa_configure
+ERROR: Logfile of failure stored in: build/tmp/work/core2-64-poky-linux/bind/9.10.2-r1/temp/log.do_configure.5242
+ERROR: Task 5 (meta/recipes-connectivity/bind/bind_9.10.2.bb, do_configure) failed with exit code '1'
+NOTE: Tasks Summary: Attempted 773 tasks of which 768 didn't need to be rerun and 1 failed.
+No currently running tasks (773 of 781)
+
+Summary: 1 task failed:
+  /meta/recipes-connectivity/bind/bind_9.10.2.bb, do_configure
+
+One way to fix it would be to unconditionally disable json in bind
+configure[2] but here we fix it by using the path to where we would
+put the header if we had json in the sysroot, in case someone wants
+to make use of the combination some day.
+
+[1] https://trac.macports.org/ticket/45305
+[2] https://trac.macports.org/changeset/126406
+
+Upstream-Status: Inappropriate [OE Specific]
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index c9ef3a601343..17a1f613e9ac 100644
+--- a/configure.in
++++ b/configure.in
+@@ -2139,7 +2139,7 @@ case "$use_libjson" in
+ 		libjson_libs=""
+ 		;;
+ 	auto|yes)
+-		for d in /usr /usr/local /opt/local
++		for d in "${STAGING_INCDIR}"
+ 		do
+ 			if test -f "${d}/include/json/json.h"
+ 			then
+-- 
+2.4.2
+
diff --git a/meta/recipes-connectivity/bind/bind/bind9 b/meta/recipes-connectivity/bind/bind/bind9
new file mode 100644
index 0000000..968679f
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/bind9
@@ -0,0 +1,2 @@
+# startup options for the server
+OPTIONS="-u bind"
diff --git a/meta/recipes-connectivity/bind/bind/conf.patch b/meta/recipes-connectivity/bind/bind/conf.patch
new file mode 100644
index 0000000..aad345f
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/conf.patch
@@ -0,0 +1,330 @@
+Upstream-Status: Inappropriate [configuration]
+
+the patch is imported from openembedded project
+
+11/30/2010 - Qing He <qing.he@intel.com>
+
+diff -urN bind-9.3.1.orig/conf/db.0 bind-9.3.1/conf/db.0
+--- bind-9.3.1.orig/conf/db.0	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.0	2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,12 @@
++;
++; BIND reverse data file for broadcast zone
++;
++$TTL	604800
++@	IN	SOA	localhost. root.localhost. (
++			      1		; Serial
++			 604800		; Refresh
++			  86400		; Retry
++			2419200		; Expire
++			 604800 )	; Negative Cache TTL
++;
++@	IN	NS	localhost.
+diff -urN bind-9.3.1.orig/conf/db.127 bind-9.3.1/conf/db.127
+--- bind-9.3.1.orig/conf/db.127	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.127	2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,13 @@
++;
++; BIND reverse data file for local loopback interface
++;
++$TTL	604800
++@	IN	SOA	localhost. root.localhost. (
++			      1		; Serial
++			 604800		; Refresh
++			  86400		; Retry
++			2419200		; Expire
++			 604800 )	; Negative Cache TTL
++;
++@	IN	NS	localhost.
++1.0.0	IN	PTR	localhost.
+diff -urN bind-9.3.1.orig/conf/db.empty bind-9.3.1/conf/db.empty
+--- bind-9.3.1.orig/conf/db.empty	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.empty	2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,14 @@
++; BIND reverse data file for empty rfc1918 zone
++;
++; DO NOT EDIT THIS FILE - it is used for multiple zones.
++; Instead, copy it, edit named.conf, and use that copy.
++;
++$TTL	86400
++@	IN	SOA	localhost. root.localhost. (
++			      1		; Serial
++			 604800		; Refresh
++			  86400		; Retry
++			2419200		; Expire
++			  86400 )	; Negative Cache TTL
++;
++@	IN	NS	localhost.
+diff -urN bind-9.3.1.orig/conf/db.255 bind-9.3.1/conf/db.255
+--- bind-9.3.1.orig/conf/db.255	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.255	2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,12 @@
++;
++; BIND reserve data file for broadcast zone
++;
++$TTL	604800
++@	IN	SOA	localhost. root.localhost. (
++			      1		; Serial
++			 604800		; Refresh
++			  86400		; Retry
++			2419200		; Expire
++			 604800 )	; Negative Cache TTL
++;
++@	IN	NS	localhost.
+diff -urN bind-9.3.1.orig/conf/db.local bind-9.3.1/conf/db.local
+--- bind-9.3.1.orig/conf/db.local	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.local	2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,13 @@
++;
++; BIND data file for local loopback interface
++;
++$TTL	604800
++@	IN	SOA	localhost. root.localhost. (
++			      1		; Serial
++			 604800		; Refresh
++			  86400		; Retry
++			2419200		; Expire
++			 604800 )	; Negative Cache TTL
++;
++@	IN	NS	localhost.
++@	IN	A	127.0.0.1
+diff -urN bind-9.3.1.orig/conf/db.root bind-9.3.1/conf/db.root
+--- bind-9.3.1.orig/conf/db.root	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/db.root	2005-07-10 22:14:00.000000000 +0200
+@@ -0,0 +1,45 @@
++
++; <<>> DiG 9.2.3 <<>> ns . @a.root-servers.net.
++;; global options:  printcmd
++;; Got answer:
++;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18944
++;; flags: qr aa rd; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 13
++
++;; QUESTION SECTION:
++;.				IN	NS
++
++;; ANSWER SECTION:
++.			518400	IN	NS	A.ROOT-SERVERS.NET.
++.			518400	IN	NS	B.ROOT-SERVERS.NET.
++.			518400	IN	NS	C.ROOT-SERVERS.NET.
++.			518400	IN	NS	D.ROOT-SERVERS.NET.
++.			518400	IN	NS	E.ROOT-SERVERS.NET.
++.			518400	IN	NS	F.ROOT-SERVERS.NET.
++.			518400	IN	NS	G.ROOT-SERVERS.NET.
++.			518400	IN	NS	H.ROOT-SERVERS.NET.
++.			518400	IN	NS	I.ROOT-SERVERS.NET.
++.			518400	IN	NS	J.ROOT-SERVERS.NET.
++.			518400	IN	NS	K.ROOT-SERVERS.NET.
++.			518400	IN	NS	L.ROOT-SERVERS.NET.
++.			518400	IN	NS	M.ROOT-SERVERS.NET.
++
++;; ADDITIONAL SECTION:
++A.ROOT-SERVERS.NET.	3600000	IN	A	198.41.0.4
++B.ROOT-SERVERS.NET.	3600000	IN	A	192.228.79.201
++C.ROOT-SERVERS.NET.	3600000	IN	A	192.33.4.12
++D.ROOT-SERVERS.NET.	3600000	IN	A	128.8.10.90
++E.ROOT-SERVERS.NET.	3600000	IN	A	192.203.230.10
++F.ROOT-SERVERS.NET.	3600000	IN	A	192.5.5.241
++G.ROOT-SERVERS.NET.	3600000	IN	A	192.112.36.4
++H.ROOT-SERVERS.NET.	3600000	IN	A	128.63.2.53
++I.ROOT-SERVERS.NET.	3600000	IN	A	192.36.148.17
++J.ROOT-SERVERS.NET.	3600000	IN	A	192.58.128.30
++K.ROOT-SERVERS.NET.	3600000	IN	A	193.0.14.129
++L.ROOT-SERVERS.NET.	3600000	IN	A	198.32.64.12
++M.ROOT-SERVERS.NET.	3600000	IN	A	202.12.27.33
++
++;; Query time: 81 msec
++;; SERVER: 198.41.0.4#53(a.root-servers.net.)
++;; WHEN: Sun Feb  1 11:27:14 2004
++;; MSG SIZE  rcvd: 436
++
+diff -urN bind-9.3.1.orig/conf/named.conf bind-9.3.1/conf/named.conf
+--- bind-9.3.1.orig/conf/named.conf	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/named.conf	2005-07-10 22:33:46.000000000 +0200
+@@ -0,0 +1,49 @@
++// This is the primary configuration file for the BIND DNS server named.
++//
++// If you are just adding zones, please do that in /etc/bind/named.conf.local
++
++include "/etc/bind/named.conf.options";
++
++// prime the server with knowledge of the root servers
++zone "." {
++	type hint;
++	file "/etc/bind/db.root";
++};
++
++// be authoritative for the localhost forward and reverse zones, and for
++// broadcast zones as per RFC 1912
++
++zone "localhost" {
++	type master;
++	file "/etc/bind/db.local";
++};
++
++zone "127.in-addr.arpa" {
++	type master;
++	file "/etc/bind/db.127";
++};
++
++zone "0.in-addr.arpa" {
++	type master;
++	file "/etc/bind/db.0";
++};
++
++zone "255.in-addr.arpa" {
++	type master;
++	file "/etc/bind/db.255";
++};
++
++// zone "com" { type delegation-only; };
++// zone "net" { type delegation-only; };
++
++// From the release notes:
++//  Because many of our users are uncomfortable receiving undelegated answers
++//  from root or top level domains, other than a few for whom that behaviour
++//  has been trusted and expected for quite some length of time, we have now
++//  introduced the "root-delegations-only" feature which applies delegation-only
++//  logic to all top level domains, and to the root domain.  An exception list
++//  should be specified, including "MUSEUM" and "DE", and any other top level
++//  domains from whom undelegated responses are expected and trusted.
++// root-delegation-only exclude { "DE"; "MUSEUM"; };
++
++include "/etc/bind/named.conf.local";
+diff -urN bind-9.3.1.orig/conf/named.conf.local bind-9.3.1/conf/named.conf.local
+--- bind-9.3.1.orig/conf/named.conf.local	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/named.conf.local	2005-07-10 22:14:06.000000000 +0200
+@@ -0,0 +1,8 @@
++//
++// Do any local configuration here
++//
++
++// Consider adding the 1918 zones here, if they are not used in your
++// organization
++//include "/etc/bind/zones.rfc1918";
++
+diff -urN bind-9.3.1.orig/conf/named.conf.options bind-9.3.1/conf/named.conf.options
+--- bind-9.3.1.orig/conf/named.conf.options	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/named.conf.options	2005-07-10 22:14:06.000000000 +0200
+@@ -0,0 +1,24 @@
++options {
++	directory "/var/cache/bind";
++
++	// If there is a firewall between you and nameservers you want
++	// to talk to, you might need to uncomment the query-source
++	// directive below.  Previous versions of BIND always asked
++	// questions using port 53, but BIND 8.1 and later use an unprivileged
++	// port by default.
++
++	// query-source address * port 53;
++
++	// If your ISP provided one or more IP addresses for stable 
++	// nameservers, you probably want to use them as forwarders.  
++	// Uncomment the following block, and insert the addresses replacing 
++	// the all-0's placeholder.
++
++	// forwarders {
++	// 	0.0.0.0;
++	// };
++
++	auth-nxdomain no;    # conform to RFC1035
++
++};
++
+diff -urN bind-9.3.1.orig/conf/zones.rfc1918 bind-9.3.1/conf/zones.rfc1918
+--- bind-9.3.1.orig/conf/zones.rfc1918	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/conf/zones.rfc1918	2005-07-10 22:14:10.000000000 +0200
+@@ -0,0 +1,20 @@
++zone "10.in-addr.arpa"      { type master; file "/etc/bind/db.empty"; };
++ 
++zone "16.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "17.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "18.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "19.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "20.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "21.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "22.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "23.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "24.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "25.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "26.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "27.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "28.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "29.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "30.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++zone "31.172.in-addr.arpa"  { type master; file "/etc/bind/db.empty"; };
++
++zone "168.192.in-addr.arpa" { type master; file "/etc/bind/db.empty"; };
+diff -urN bind-9.3.1.orig/init.d bind-9.3.1/init.d
+--- bind-9.3.1.orig/init.d	1970-01-01 01:00:00.000000000 +0100
++++ bind-9.3.1/init.d	2005-07-10 23:09:58.000000000 +0200
+@@ -0,0 +1,70 @@
++#!/bin/sh
++
++PATH=/sbin:/bin:/usr/sbin:/usr/bin
++
++# for a chrooted server: "-u bind -t /var/lib/named"
++# Don't modify this line, change or create /etc/default/bind9.
++OPTIONS=""
++
++test -f /etc/default/bind9 && . /etc/default/bind9
++
++test -x /usr/sbin/rndc || exit 0
++
++case "$1" in
++    start)
++	echo -n "Starting domain name service: named"
++
++	modprobe capability >/dev/null 2>&1 || true
++	if [ ! -f /etc/bind/rndc.key ]; then
++	    /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
++	    chmod 0640 /etc/bind/rndc.key
++	fi
++	if [ -f /var/run/named/named.pid ]; then
++	    ps `cat /var/run/named/named.pid` > /dev/null && exit 1
++	fi
++
++	# dirs under /var/run can go away on reboots.
++	mkdir -p /var/run/named
++	mkdir -p /var/cache/bind
++	chmod 775 /var/run/named
++	chown root:bind /var/run/named >/dev/null 2>&1 || true
++
++	if [ ! -x /usr/sbin/named ]; then
++	    echo "named binary missing - not starting"
++	    exit 1
++	fi
++	if start-stop-daemon --start --quiet --exec /usr/sbin/named \
++		--pidfile /var/run/named/named.pid -- $OPTIONS; then
++	    if [ -x /sbin/resolvconf ] ; then
++		echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo
++	    fi
++	fi
++	echo "."	
++    ;;
++
++    stop)
++	echo -n "Stopping domain name service: named"
++	if [ -x /sbin/resolvconf ]; then
++	    /sbin/resolvconf -d lo
++	fi
++	/usr/sbin/rndc stop >/dev/null 2>&1
++	echo "."	
++    ;;
++
++    reload)
++	/usr/sbin/rndc reload
++    ;;
++
++    restart|force-reload)
++	$0 stop
++	sleep 2
++	$0 start
++    ;;
++    
++    *)
++	echo "Usage: /etc/init.d/bind {start|stop|reload|restart|force-reload}" >&2
++	exit 1
++    ;;
++esac
++
++exit 0
diff --git a/meta/recipes-connectivity/bind/bind/dont-test-on-host.patch b/meta/recipes-connectivity/bind/bind/dont-test-on-host.patch
new file mode 100644
index 0000000..6989d6d
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/dont-test-on-host.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Signed-off-by Saul Wold <sgw@linux.intel.com>
+
+Index: bind-9.9.5/bin/Makefile.in
+===================================================================
+--- bind-9.9.5.orig/bin/Makefile.in
++++ bind-9.9.5/bin/Makefile.in
+@@ -19,7 +19,7 @@ srcdir =	@srcdir@
+ VPATH =		@srcdir@
+ top_srcdir =	@top_srcdir@
+ 
+-SUBDIRS =	named rndc dig delv dnssec tools tests nsupdate \
++SUBDIRS =	named rndc dig delv dnssec tools nsupdate \
+ 		check confgen @PYTHON_TOOLS@ @PKCS11_TOOLS@
+ TARGETS =
+ 
diff --git a/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh b/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh
new file mode 100644
index 0000000..db20127
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/generate-rndc-key.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ ! -s /etc/bind/rndc.key ]; then
+    echo -n "Generating /etc/bind/rndc.key:"
+    /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
+    chmod 0640 /etc/bind/rndc.key
+fi
diff --git a/meta/recipes-connectivity/bind/bind/init.d-add-support-for-read-only-rootfs.patch b/meta/recipes-connectivity/bind/bind/init.d-add-support-for-read-only-rootfs.patch
new file mode 100644
index 0000000..11db95e
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/init.d-add-support-for-read-only-rootfs.patch
@@ -0,0 +1,65 @@
+Subject: init.d: add support for read-only rootfs
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ init.d |   40 ++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 40 insertions(+)
+
+diff --git a/init.d b/init.d
+index 0111ed4..24677c8 100644
+--- a/init.d
++++ b/init.d
+@@ -6,8 +6,48 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ # Don't modify this line, change or create /etc/default/bind9.
+ OPTIONS=""
+ 
++test -f /etc/default/rcS && . /etc/default/rcS
+ test -f /etc/default/bind9 && . /etc/default/bind9
+ 
++# This function is here because it's possible that /var and / are on different partitions.
++is_on_read_only_partition () {
++    DIRECTORY=$1
++    dir=`readlink -f $DIRECTORY`
++    while true; do
++	if [ ! -d "$dir" ]; then
++	    echo "ERROR: $dir is not a directory"
++	    exit 1
++	else
++	    for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \
++		END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do
++		[ "$flag" = "FOUND" ] && partition="read-write"
++		[ "$flag" = "ro" ] && { partition="read-only"; break; }
++	    done
++	    if [ "$dir" = "/" -o -n "$partition" ]; then
++		break
++	    else
++		dir=`dirname $dir`
++	    fi
++	fi
++    done
++    [ "$partition" = "read-only" ] && echo "yes" || echo "no"
++}
++
++bind_mount () {
++    olddir=$1
++    newdir=$2
++    mkdir -p $olddir
++    cp -a $newdir/* $olddir
++    mount --bind $olddir $newdir
++}
++
++# Deal with read-only rootfs
++if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
++    [ "$VERBOSE" != "no" ] && echo "WARN: start bind service in read-only rootfs"
++    [ `is_on_read_only_partition /etc/bind` = "yes" ] && bind_mount /var/volatile/bind/etc /etc/bind
++    [ `is_on_read_only_partition /var/named` = "yes" ] && bind_mount /var/volatile/bind/named /var/named
++fi
++
+ test -x /usr/sbin/rndc || exit 0
+ 
+ case "$1" in
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/bind/bind/make-etc-initd-bind-stop-work.patch b/meta/recipes-connectivity/bind/bind/make-etc-initd-bind-stop-work.patch
new file mode 100644
index 0000000..146f3e3
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/make-etc-initd-bind-stop-work.patch
@@ -0,0 +1,42 @@
+bind: make "/etc/init.d/bind stop" work
+
+Upstream-Status: Inappropriate [configuration]
+
+Add some configurations, make rndc command be able to controls
+the named daemon.
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ conf/named.conf |    5 +++++
+ conf/rndc.conf  |    5 +++++
+ 2 files changed, 10 insertions(+), 0 deletions(-)
+ create mode 100644 conf/rndc.conf
+
+diff --git a/conf/named.conf b/conf/named.conf
+index 95829cf..c8899e7 100644
+--- a/conf/named.conf
++++ b/conf/named.conf
+@@ -47,3 +47,8 @@ zone "255.in-addr.arpa" {
+ // root-delegation-only exclude { "DE"; "MUSEUM"; };
+ 
+ include "/etc/bind/named.conf.local";
++include "/etc/bind/rndc.key" ;
++controls {
++	inet 127.0.0.1 allow { localhost; }
++	keys { rndc-key; };
++};
+diff --git a/conf/rndc.conf b/conf/rndc.conf
+new file mode 100644
+index 0000000..a0b481d
+--- /dev/null
++++ b/conf/rndc.conf
+@@ -0,0 +1,5 @@
++include "/etc/bind/rndc.key";
++options {
++	default-server  localhost;
++	default-key     rndc-key;
++};
+
+-- 
+1.7.5.4
+
diff --git a/meta/recipes-connectivity/bind/bind/mips1-not-support-opcode.diff b/meta/recipes-connectivity/bind/bind/mips1-not-support-opcode.diff
new file mode 100644
index 0000000..2930796
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/mips1-not-support-opcode.diff
@@ -0,0 +1,104 @@
+bind: port a patch to fix a build failure
+
+mips1 does not support ll and sc instructions, and lead to below error, now
+we port a patch from debian to fix it
+[http://security.debian.org/debian-security/pool/updates/main/b/bind9/bind9_9.8.4.dfsg.P1-6+nmu2+deb7u1.diff.gz]
+
+| {standard input}: Assembler messages:
+| {standard input}:47: Error: Opcode not supported on this processor: mips1 (mips1) `ll $3,0($6)'
+| {standard input}:50: Error: Opcode not supported on this processor: mips1 (mips1) `sc $3,0($6)'
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+--- bind9-9.8.4.dfsg.P1.orig/lib/isc/mips/include/isc/atomic.h
++++ bind9-9.8.4.dfsg.P1/lib/isc/mips/include/isc/atomic.h
+@@ -31,18 +31,20 @@
+ isc_atomic_xadd(isc_int32_t *p, int val) {
+ 	isc_int32_t orig;
+ 
+-	/* add is a cheat, since MIPS has no mov instruction */
+-	__asm__ volatile (
+-	    "1:"
+-	    "ll $3, %1\n"
+-	    "add %0, $0, $3\n"
+-	    "add $3, $3, %2\n"
+-	    "sc $3, %1\n"
+-	    "beq $3, 0, 1b"
+-	    : "=&r"(orig)
+-	    : "m"(*p), "r"(val)
+-	    : "memory", "$3"
+-		);
++	__asm__ __volatile__ (
++	"	.set	push		\n"
++	"	.set	mips2		\n"
++	"	.set	noreorder	\n"
++	"	.set	noat		\n"
++	"1:	ll	$1, %1		\n"
++	"	addu	%0, $1, %2	\n"
++	"	sc	%0, %1		\n"
++	"	beqz	%0, 1b		\n"
++	"	move	%0, $1		\n"
++	"	.set	pop		\n"
++	: "=&r" (orig), "+R" (*p)
++	: "r" (val)
++	: "memory");
+ 
+ 	return (orig);
+ }
+@@ -52,16 +54,7 @@
+  */
+ static inline void
+ isc_atomic_store(isc_int32_t *p, isc_int32_t val) {
+-	__asm__ volatile (
+-	    "1:"
+-	    "ll $3, %0\n"
+-	    "add $3, $0, %1\n"
+-	    "sc $3, %0\n"
+-	    "beq $3, 0, 1b"
+-	    :
+-	    : "m"(*p), "r"(val)
+-	    : "memory", "$3"
+-		);
++	*p = val;
+ }
+ 
+ /*
+@@ -72,20 +65,23 @@
+ static inline isc_int32_t
+ isc_atomic_cmpxchg(isc_int32_t *p, int cmpval, int val) {
+ 	isc_int32_t orig;
++	isc_int32_t tmp;
+ 
+-	__asm__ volatile(
+-	    "1:"
+-	    "ll $3, %1\n"
+-	    "add %0, $0, $3\n"
+-	    "bne $3, %2, 2f\n"
+-	    "add $3, $0, %3\n"
+-	    "sc $3, %1\n"
+-	    "beq $3, 0, 1b\n"
+-	    "2:"
+-	    : "=&r"(orig)
+-	    : "m"(*p), "r"(cmpval), "r"(val)
+-	    : "memory", "$3"
+-		);
++	__asm__ __volatile__ (
++	"	.set	push		\n"
++	"	.set	mips2		\n"
++	"	.set	noreorder	\n"
++	"	.set	noat		\n"
++	"1:	ll	$1, %1		\n"
++	"	bne	$1, %3, 2f	\n"
++	"	move	%2, %4		\n"
++	"	sc	%2, %1		\n"
++	"	beqz	%2, 1b		\n"
++	"2:	move	%0, $1		\n"
++	"	.set	pop		\n"
++	: "=&r"(orig), "+R" (*p), "=r" (tmp)
++	: "r"(cmpval), "r"(val)
++	: "memory");
+ 
+ 	return (orig);
+ }
diff --git a/meta/recipes-connectivity/bind/bind/named.service b/meta/recipes-connectivity/bind/bind/named.service
new file mode 100644
index 0000000..cda56ef
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind/named.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=Berkeley Internet Name Domain (DNS)
+Wants=nss-lookup.target
+Before=nss-lookup.target
+After=network.target
+
+[Service]
+Type=forking
+EnvironmentFile=-/etc/default/bind9
+PIDFile=/run/named/named.pid
+
+ExecStartPre=@SBINDIR@/generate-rndc-key.sh
+ExecStart=@SBINDIR@/named $OPTIONS
+
+ExecReload=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc reload > /dev/null 2>&1 || @BASE_BINDIR@/kill -HUP $MAINPID'
+
+ExecStop=@BASE_BINDIR@/sh -c '@SBINDIR@/rndc stop > /dev/null 2>&1 || @BASE_BINDIR@/kill -TERM $MAINPID'
+
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/bind/bind_9.10.2-P4.bb b/meta/recipes-connectivity/bind/bind_9.10.2-P4.bb
new file mode 100644
index 0000000..efae289
--- /dev/null
+++ b/meta/recipes-connectivity/bind/bind_9.10.2-P4.bb
@@ -0,0 +1,102 @@
+SUMMARY = "ISC Internet Domain Name Server"
+HOMEPAGE = "http://www.isc.org/sw/bind/"
+SECTION = "console/network"
+
+LICENSE = "ISC & BSD"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=0a95f52a0ab6c5f52dedc9a45e7abb3f"
+
+DEPENDS = "openssl libcap"
+
+SRC_URI = "ftp://ftp.isc.org/isc/bind9/${PV}/${BPN}-${PV}.tar.gz \
+           file://conf.patch \
+           file://make-etc-initd-bind-stop-work.patch \
+           file://mips1-not-support-opcode.diff \
+           file://dont-test-on-host.patch \
+           file://generate-rndc-key.sh \
+           file://named.service \
+           file://bind9 \
+           file://init.d-add-support-for-read-only-rootfs.patch \
+           file://bind-confgen-build-unix.o-once.patch \
+           file://0001-build-use-pkg-config-to-find-libxml2.patch \
+           file://bind-ensure-searching-for-json-headers-searches-sysr.patch \
+           file://0001-gen.c-extend-DIRNAMESIZE-from-256-to-512.patch \
+           "
+
+SRC_URI[md5sum] = "8b1f5064837756c938eadc1537dec5c7"
+SRC_URI[sha256sum] = "c00b21ec1def212957f28efe9d10aac52d6ec515e84fbf2c42143f5d71429cb8"
+
+ENABLE_IPV6 = "--enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)}"
+EXTRA_OECONF = " ${ENABLE_IPV6} --with-randomdev=/dev/random --disable-threads \
+                 --disable-devpoll --disable-epoll --with-gost=no \
+                 --with-gssapi=no --with-ecdsa=yes \
+                 --sysconfdir=${sysconfdir}/bind \
+                 --with-openssl=${STAGING_LIBDIR}/.. \
+               "
+inherit autotools update-rc.d systemd useradd pkgconfig
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[httpstats] = "--with-libxml2,--without-libxml2,libxml2"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home /var/cache/bind --no-create-home \
+                       --user-group bind"
+
+INITSCRIPT_NAME = "bind"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "named.service"
+
+PARALLEL_MAKE = ""
+
+RDEPENDS_${PN} = "python-core"
+RDEPENDS_${PN}-dev = ""
+
+PACKAGE_BEFORE_PN += "${PN}-utils"
+FILES_${PN}-utils = "${bindir}/host ${bindir}/dig"
+FILES_${PN}-dev += "${bindir}/isc-config.h"
+FILES_${PN} += "${sbindir}/generate-rndc-key.sh"
+
+do_install_prepend() {
+	# clean host path in isc-config.sh before the hardlink created
+	# by "make install":
+	#   bind9-config -> isc-config.sh
+	sed -i -e "s,${STAGING_LIBDIR},${libdir}," ${B}/isc-config.sh
+}
+
+do_install_append() {
+	rm "${D}${bindir}/nslookup"
+	rm "${D}${mandir}/man1/nslookup.1"
+	rmdir "${D}${localstatedir}/run"
+	rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
+	install -d "${D}${localstatedir}/cache/bind"
+	install -d "${D}${sysconfdir}/bind"
+	install -d "${D}${sysconfdir}/init.d"
+	install -m 644 ${S}/conf/* "${D}${sysconfdir}/bind/"
+	install -m 755 "${S}/init.d" "${D}${sysconfdir}/init.d/bind"
+	sed -i -e '1s,#!.*python,#! /usr/bin/env python,' ${D}${sbindir}/dnssec-coverage ${D}${sbindir}/dnssec-checkds
+
+	# Install systemd related files
+	install -d ${D}${localstatedir}/cache/bind
+	install -d ${D}${sbindir}
+	install -m 755 ${WORKDIR}/generate-rndc-key.sh ${D}${sbindir}
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/named.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+	       -e 's,@SBINDIR@,${sbindir},g' \
+	       ${D}${systemd_unitdir}/system/named.service
+
+	install -d ${D}${sysconfdir}/default
+	install -m 0644 ${WORKDIR}/bind9 ${D}${sysconfdir}/default
+}
+
+CONFFILES_${PN} = " \
+	${sysconfdir}/bind/named.conf \
+	${sysconfdir}/bind/named.conf.local \
+	${sysconfdir}/bind/named.conf.options \
+	${sysconfdir}/bind/db.0 \
+	${sysconfdir}/bind/db.127 \
+	${sysconfdir}/bind/db.empty \
+	${sysconfdir}/bind/db.local \
+	${sysconfdir}/bind/db.root \
+	"
+
diff --git a/meta/recipes-connectivity/bluez5/bluez5.inc b/meta/recipes-connectivity/bluez5/bluez5.inc
new file mode 100644
index 0000000..039c443
--- /dev/null
+++ b/meta/recipes-connectivity/bluez5/bluez5.inc
@@ -0,0 +1,105 @@
+SUMMARY = "Linux Bluetooth Stack Userland V5"
+DESCRIPTION = "Linux Bluetooth stack V5 userland components.  These include a system configurations, daemons, tools and system libraries."
+HOMEPAGE = "http://www.bluez.org"
+SECTION = "libs"
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+                    file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
+                    file://src/main.c;beginline=1;endline=24;md5=9bc54b93cd7e17bf03f52513f39f926e"
+DEPENDS = "udev libusb dbus-glib glib-2.0 libcheck readline"
+PROVIDES += "bluez-hcidump"
+RPROVIDES_${PN} += "bluez-hcidump"
+
+RCONFLICTS_${PN} = "bluez4"
+
+PACKAGECONFIG ??= "obex-profiles"
+PACKAGECONFIG[obex-profiles] = "--enable-obex,--disable-obex,libical"
+PACKAGECONFIG[experimental] = "--enable-experimental,--disable-experimental,"
+
+SRC_URI = "\
+    ${KERNELORG_MIRROR}/linux/bluetooth/bluez-${PV}.tar.xz \
+    file://bluetooth.conf \
+"
+S = "${WORKDIR}/bluez-${PV}"
+
+inherit autotools-brokensep pkgconfig systemd
+
+EXTRA_OECONF = "\
+  --enable-tools \
+  --disable-cups \
+  --enable-test \
+  --enable-datafiles \
+  ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-systemd', '--disable-systemd', d)} \
+  --enable-library \
+"
+
+# bluez5 builds a large number of useful utilities but does not
+# install them.  Specify which ones we want put into ${PN}-noinst-tools.
+NOINST_TOOLS_READLINE ??= ""
+NOINST_TOOLS_EXPERIMENTAL ??= ""
+NOINST_TOOLS = " \
+    ${NOINST_TOOLS_READLINE} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'experimental', '${NOINST_TOOLS_EXPERIMENTAL}', '', d)} \
+"
+
+do_install_append() {
+	install -d ${D}${sysconfdir}/bluetooth/
+	if [ -f ${S}/profiles/audio/audio.conf ]; then
+	    install -m 0644 ${S}/profiles/audio/audio.conf ${D}/${sysconfdir}/bluetooth/
+	fi
+	if [ -f ${S}/profiles/network/network.conf ]; then
+	    install -m 0644 ${S}/profiles/network/network.conf ${D}/${sysconfdir}/bluetooth/
+	fi
+	if [ -f ${S}/profiles/input/input.conf ]; then
+	    install -m 0644 ${S}/profiles/input/input.conf ${D}/${sysconfdir}/bluetooth/
+	fi
+	# at_console doesn't really work with the current state of OE, so punch some more holes so people can actually use BT
+	install -m 0644 ${WORKDIR}/bluetooth.conf ${D}/${sysconfdir}/dbus-1/system.d/
+
+	# Install desired tools that upstream leaves in build area
+        for f in ${NOINST_TOOLS} ; do
+	    install -m 755 ${B}/$f ${D}/${bindir}
+	done
+}
+
+ALLOW_EMPTY_libasound-module-bluez = "1"
+PACKAGES =+ "libasound-module-bluez ${PN}-testtools ${PN}-obex ${PN}-noinst-tools"
+
+FILES_libasound-module-bluez = "${libdir}/alsa-lib/lib*.so ${datadir}/alsa"
+FILES_${PN} += "${libdir}/bluetooth/plugins/*.so ${base_libdir}/udev/ ${nonarch_base_libdir}/udev/ ${systemd_unitdir}/ ${datadir}/dbus-1"
+FILES_${PN}-dev += "\
+  ${libdir}/bluetooth/plugins/*.la \
+  ${libdir}/alsa-lib/*.la \
+"
+
+FILES_${PN}-obex = "${libexecdir}/bluetooth/obexd \
+                    ${exec_prefix}/lib/systemd/user/obex.service \
+                    ${datadir}/dbus-1/services/org.bluez.obex.service \
+                   "
+SYSTEMD_SERVICE_${PN}-obex = "obex.service"
+
+FILES_${PN}-testtools = "${libdir}/bluez/test/*"
+
+def get_noinst_tools_paths (d, bb, tools):
+    s = list()
+    bindir = d.getVar("bindir", True)
+    for bdp in tools.split():
+        f = os.path.basename(bdp)
+        s.append("%s/%s" % (bindir, f))
+    return "\n".join(s)
+
+FILES_${PN}-noinst-tools = "${@get_noinst_tools_paths(d, bb, d.getVar('NOINST_TOOLS', True))}"
+
+FILES_${PN}-dbg += "\
+  ${libexecdir}/bluetooth/.debug \
+  ${libdir}/bluetooth/plugins/.debug \
+  ${libdir}/*/.debug \
+  */udev/.debug \
+  */*/udev/.debug \
+  "
+
+RDEPENDS_${PN}-testtools += "python python-dbus python-pygobject"
+
+SYSTEMD_SERVICE_${PN} = "bluetooth.service"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-connectivity/bluez5/bluez5/bluetooth.conf b/meta/recipes-connectivity/bluez5/bluez5/bluetooth.conf
new file mode 100644
index 0000000..26845bb
--- /dev/null
+++ b/meta/recipes-connectivity/bluez5/bluez5/bluetooth.conf
@@ -0,0 +1,17 @@
+<!-- This configuration file specifies the required security policies
+     for Bluetooth core daemon to work. -->
+
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+  <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+  <policy context="default">
+    <allow own="org.bluez"/>
+    <allow send_destination="org.bluez"/>
+    <allow send_interface="org.bluez.Agent1"/>
+    <allow send_type="method_call"/>
+  </policy>
+
+</busconfig>
diff --git a/meta/recipes-connectivity/bluez5/bluez5_5.33.bb b/meta/recipes-connectivity/bluez5/bluez5_5.33.bb
new file mode 100644
index 0000000..23c7397
--- /dev/null
+++ b/meta/recipes-connectivity/bluez5/bluez5_5.33.bb
@@ -0,0 +1,52 @@
+require bluez5.inc
+SRC_URI[md5sum] = "78782dc33d9a8b6344c4cc1af70c8a98"
+SRC_URI[sha256sum] = "1801807a13506678cbfeb15c6a4b89ecb5739efe1067eb464da6641d731436d3"
+
+# noinst programs in Makefile.tools that are conditional on READLINE
+# support
+NOINST_TOOLS_READLINE ?= " \
+    attrib/gatttool \
+    tools/obex-client-tool \
+    tools/obex-server-tool \
+    tools/bluetooth-player \
+    tools/obexctl \
+"
+
+# noinst programs in Makefile.tools that are conditional on EXPERIMENTAL
+# support
+NOINST_TOOLS_EXPERIMENTAL ?= " \
+    emulator/btvirt \
+    emulator/b1ee \
+    emulator/hfp \
+    tools/3dsp \
+    tools/mgmt-tester \
+    tools/gap-tester \
+    tools/l2cap-tester \
+    tools/sco-tester \
+    tools/smp-tester \
+    tools/hci-tester \
+    tools/rfcomm-tester \
+    tools/bdaddr \
+    tools/avinfo \
+    tools/avtest \
+    tools/scotest \
+    tools/amptest \
+    tools/hwdb \
+    tools/hcieventmask \
+    tools/hcisecfilter \
+    tools/btmgmt \
+    tools/btinfo \
+    tools/btattach \
+    tools/btsnoop \
+    tools/btproxy \
+    tools/btiotest \
+    tools/mcaptest \
+    tools/cltest \
+    tools/oobtest \
+    tools/seq2bseq \
+    tools/ibeacon \
+    tools/btgatt-client \
+    tools/btgatt-server \
+    tools/gatt-service \
+    profiles/iap/iapd \
+"
diff --git a/meta/recipes-connectivity/connman/connman-conf.bb b/meta/recipes-connectivity/connman/connman-conf.bb
new file mode 100644
index 0000000..bd4c28d
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Connman config to setup wired interface on qemu machines"
+DESCRIPTION = "This is the ConnMan configuration to set up a Wired \
+network interface for a qemu machine."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+SRC_URI_append_qemuall = " file://wired.config \
+                           file://wired-setup \
+"
+PR = "r2"
+
+S = "${WORKDIR}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} = "${localstatedir}/* ${libdir}/*"
+
+do_install() {
+    #Configure Wired network interface in case of qemu* machines
+    if test -e ${WORKDIR}/wired.config && test -e ${WORKDIR}/wired-setup; then
+        install -d ${D}${localstatedir}/lib/connman
+        install -m 0644 ${WORKDIR}/wired.config ${D}${localstatedir}/lib/connman
+        install -d ${D}${libdir}/connman
+        install -m 0755 ${WORKDIR}/wired-setup ${D}${libdir}/connman
+    fi
+}
diff --git a/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
new file mode 100644
index 0000000..c46899e
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+CONFIGF=/var/lib/connman/wired.config
+
+# Extract wired network config from /proc/cmdline
+NET_CONF=`cat /proc/cmdline |sed -ne 's/^.*ip=\([^ ]*\):\([^ ]*\):\([^ ]*\):\([^ ]*\).*$/\1\/\4\/\3/p'`
+
+# Check if eth0 is already set via kernel cmdline
+if [ "x$NET_CONF" = "x" ]; then
+	# Wired interface is not configured via kernel cmdline
+	# Remove connman config file template
+	rm -f ${CONFIGF}
+else
+	# Setup a connman config accordingly
+	sed -i -e "s|^IPv4 =.*|IPv4 = ${NET_CONF}|" ${CONFIGF}
+fi
diff --git a/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config
new file mode 100644
index 0000000..42998ce
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config
@@ -0,0 +1,9 @@
+[global]
+Name = Wired
+Description = Wired network configuration
+
+[service_ethernet]
+Type = ethernet
+IPv4 =
+MAC = 52:54:00:12:34:56
+Nameservers = 8.8.8.8
diff --git a/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch b/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch
new file mode 100644
index 0000000..7957500
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-gnome/0001-Removed-icon-from-connman-gnome-about-applet.patch
@@ -0,0 +1,35 @@
+From 5907a23ad2f49702960a33f9e2039552673eabc7 Mon Sep 17 00:00:00 2001
+From: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+Date: Mon, 17 Dec 2012 14:01:18 +0200
+Subject: [PATCH] Removed icon from connman-gnome "about" applet
+
+The connman-gnome "about" applet showed a picture that
+can not be displayed. There is no designated picture
+in connman-gnome to be used in the about section, so
+it was removed.
+
+[OE-Core #2509]
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+---
+ applet/main.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/applet/main.c b/applet/main.c
+index f12d371..c7b3c7f 100644
+--- a/applet/main.c
++++ b/applet/main.c
+@@ -212,7 +212,7 @@ static void about_callback(GtkWidget *item, gpointer user_data)
+ 			"comments", _("A connection manager for the GNOME desktop"),
+ 			"authors", authors,
+ 			"translator-credits", _("translator-credits"),
+-			"logo-icon-name", "network-wireless", NULL);
++			NULL);
+ }
+ 
+ static void settings_callback(GtkWidget *item, gpointer user_data)
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch b/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch
new file mode 100644
index 0000000..f4049fa
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-gnome/connman-gnome-fix-dbus-interface-name.patch
@@ -0,0 +1,187 @@
+connman-gnome: fix dbus interface name
+
+This patch resolves following error:
+
+"connman-dbus.xml": "connman" is not a valid D-Bus interface name
+
+https://502552.bugs.gentoo.org/attachment.cgi?id=380652
+
+Upstream-Status: Backport
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ common/connman-client.c | 24 ++++++++++++------------
+ common/connman-client.h |  4 ++--
+ common/connman-dbus.c   |  6 +++---
+ common/connman-dbus.xml |  2 +-
+ 4 files changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/common/connman-client.c b/common/connman-client.c
+index c55e25c..9d818b2 100644
+--- a/common/connman-client.c
++++ b/common/connman-client.c
+@@ -289,7 +289,7 @@ gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device,
+ 
+ 	g_value_init(&value, DBUS_TYPE_G_DICTIONARY);
+ 	g_value_set_boxed(&value, ipv4);
+-	ret = connman_set_property(proxy, "IPv4.Configuration", &value, NULL);
++	ret = net_connman_set_property(proxy, "IPv4.Configuration", &value, NULL);
+ 
+ 	g_object_unref(proxy);
+ 
+@@ -317,7 +317,7 @@ void connman_client_set_powered(ConnmanClient *client, const gchar *device,
+ 	g_value_set_boolean(&value, powered);
+ 
+ 	error = NULL;
+-	connman_set_property(proxy, "Powered", &value, &error);
++	net_connman_set_property(proxy, "Powered", &value, &error);
+ 	if( error )
+ 		fprintf (stderr, "error: %s\n", error->message);
+ 
+@@ -325,7 +325,7 @@ void connman_client_set_powered(ConnmanClient *client, const gchar *device,
+ }
+ 
+ void connman_client_scan(ConnmanClient *client, const gchar *device,
+-						connman_scan_reply callback, gpointer user_data)
++						net_connman_scan_reply callback, gpointer user_data)
+ {
+ 	ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
+ 	DBusGProxy *proxy;
+@@ -339,7 +339,7 @@ void connman_client_scan(ConnmanClient *client, const gchar *device,
+ 	if (proxy == NULL)
+ 		return;
+ 
+-	connman_scan_async(proxy, callback, user_data);
++	net_connman_scan_async(proxy, callback, user_data);
+ 
+ 	g_object_unref(proxy);
+ }
+@@ -353,7 +353,7 @@ gboolean connman_client_get_offline_status(ConnmanClient *client)
+ 
+ 	DBG("client %p", client);
+ 
+-	ret = connman_get_properties(priv->manager, &hash, NULL);
++	ret = net_connman_get_properties(priv->manager, &hash, NULL);
+ 
+ 	if (ret == FALSE)
+ 		goto done;
+@@ -375,7 +375,7 @@ void connman_client_set_offlinemode(ConnmanClient *client, gboolean status)
+ 	g_value_init(&value, G_TYPE_BOOLEAN);
+ 	g_value_set_boolean(&value, status);
+ 
+-	connman_set_property(priv->manager, "OfflineMode", &value, NULL);
++	net_connman_set_property(priv->manager, "OfflineMode", &value, NULL);
+ }
+ 
+ static gboolean network_disconnect(GtkTreeModel *model, GtkTreePath *path,
+@@ -398,7 +398,7 @@ static gboolean network_disconnect(GtkTreeModel *model, GtkTreePath *path,
+ 		return TRUE;
+ 
+ 	if (type == CONNMAN_TYPE_WIFI)
+-		connman_disconnect(proxy, NULL);
++		net_connman_disconnect(proxy, NULL);
+ 
+ 	g_object_unref(proxy);
+ 
+@@ -422,13 +422,13 @@ void connman_client_connect(ConnmanClient *client, const gchar *network)
+ 	if (proxy == NULL)
+ 		return;
+ 
+-	connman_connect(proxy, NULL);
++	net_connman_connect(proxy, NULL);
+ 
+ 	g_object_unref(proxy);
+ }
+ 
+ void connman_client_connect_async(ConnmanClient *client, const gchar *network,
+-		connman_connect_reply callback, gpointer userdata)
++		net_connman_connect_reply callback, gpointer userdata)
+ {
+ 	ConnmanClientPrivate *priv = CONNMAN_CLIENT_GET_PRIVATE(client);
+ 	DBusGProxy *proxy;
+@@ -446,7 +446,7 @@ void connman_client_connect_async(ConnmanClient *client, const gchar *network,
+ 	if (proxy == NULL)
+ 		goto done;
+ 
+-	connman_connect_async(proxy, callback, userdata);
++	net_connman_connect_async(proxy, callback, userdata);
+ 
+ done:
+ 	return;
+@@ -476,7 +476,7 @@ void connman_client_disconnect(ConnmanClient *client, const gchar *network)
+ 	if (proxy == NULL)
+ 		return;
+ 
+-	connman_disconnect(proxy, NULL);
++	net_connman_disconnect(proxy, NULL);
+ 
+ 	g_object_unref(proxy);
+ }
+@@ -532,7 +532,7 @@ void connman_client_remove(ConnmanClient *client, const gchar *network)
+ 	if (proxy == NULL)
+ 		return;
+ 
+-	connman_remove(proxy, NULL);
++	net_connman_remove(proxy, NULL);
+ 
+ 	g_object_unref(proxy);
+ }
+diff --git a/common/connman-client.h b/common/connman-client.h
+index 9e2e6d5..98241de 100644
+--- a/common/connman-client.h
++++ b/common/connman-client.h
+@@ -70,13 +70,13 @@ void connman_client_set_powered(ConnmanClient *client, const gchar *device,
+ gboolean connman_client_set_ipv4(ConnmanClient *client, const gchar *device,
+ 				struct ipv4_config *ipv4_config);
+ void connman_client_scan(ConnmanClient *client, const gchar *device,
+-							connman_scan_reply callback, gpointer user_data);
++							net_connman_scan_reply callback, gpointer user_data);
+ 
+ void connman_client_connect(ConnmanClient *client, const gchar *network);
+ void connman_client_disconnect(ConnmanClient *client, const gchar *network);
+ gchar *connman_client_get_security(ConnmanClient *client, const gchar *network);
+ void connman_client_connect_async(ConnmanClient *client, const gchar *network,
+-				connman_connect_reply callback, gpointer userdata);
++				net_connman_connect_reply callback, gpointer userdata);
+ void connman_client_set_remember(ConnmanClient *client, const gchar *network,
+ 							gboolean remember);
+ 
+diff --git a/common/connman-dbus.c b/common/connman-dbus.c
+index b82b3e1..543eb43 100644
+--- a/common/connman-dbus.c
++++ b/common/connman-dbus.c
+@@ -655,15 +655,15 @@ DBusGProxy *connman_dbus_create_manager(DBusGConnection *conn,
+ 
+ 	DBG("getting manager properties");
+ 
+-	connman_get_properties_async(proxy, manager_properties, store);
++	net_connman_get_properties_async(proxy, manager_properties, store);
+ 
+ 	DBG("getting technologies");
+ 
+-	connman_get_technologies_async(proxy, manager_technologies, store);
++	net_connman_get_technologies_async(proxy, manager_technologies, store);
+ 
+ 	DBG("getting services");
+ 
+-	connman_get_services_async(proxy, manager_services, store);
++	net_connman_get_services_async(proxy, manager_services, store);
+ 
+ 	return proxy;
+ }
+diff --git a/common/connman-dbus.xml b/common/connman-dbus.xml
+index 56b9582..0199d52 100644
+--- a/common/connman-dbus.xml
++++ b/common/connman-dbus.xml
+@@ -1,7 +1,7 @@
+ <?xml version="1.0" encoding="UTF-8" ?>
+ 
+ <node name="/">
+-  <interface name="connman">
++  <interface name="net.connman">
+     <method name="GetProperties">
+       <arg type="a{sv}" direction="out"/>
+     </method>
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png b/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png
new file mode 100644
index 0000000..33247c1
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-01.png
Binary files differ
diff --git a/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png b/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png
new file mode 100644
index 0000000..a94fb95
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-02.png
Binary files differ
diff --git a/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png b/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png
new file mode 100644
index 0000000..b5eb405
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-03.png
Binary files differ
diff --git a/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png b/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png
new file mode 100644
index 0000000..be54419
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-04.png
Binary files differ
diff --git a/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png b/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png
new file mode 100644
index 0000000..1c40ac9
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-gnome/images/connman-signal-05.png
Binary files differ
diff --git a/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch b/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch
new file mode 100644
index 0000000..0421cda
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-gnome/null_check_for_ipv4_config.patch
@@ -0,0 +1,36 @@
+In networks that don't have a DHCP server configured, ipv4 address
+allocation fails and the ipv4 structure doesn't get populated. When
+the GUI is trying to read the ipv4_config.method field to see whether
+it contains "dhcp" string, a segmentation fault is generated.
+
+Ethernet manual configuration behavior remains unchanged after this fix.
+
+Upstream-Status: Pending
+
+Signed-off-by: Emilia Ciobanu <emilia.maria.silvia.ciobanu@intel.com>
+Index: git/properties/ethernet.c
+===================================================================
+--- git.orig/properties/ethernet.c
++++ git/properties/ethernet.c
+@@ -194,7 +194,7 @@ void add_ethernet_service(GtkWidget *mai
+
+ 	data->button = button;
+
+-	if (g_str_equal(ipv4_config.method, "dhcp") == TRUE)
++	if (!ipv4_config.method || g_str_equal(ipv4_config.method, "dhcp") == TRUE)
+ 		update_ethernet_ipv4(data, CONNMAN_POLICY_DHCP);
+ 	else
+ 		update_ethernet_ipv4(data, CONNMAN_POLICY_MANUAL);
+Index: git/properties/wifi.c
+===================================================================
+--- git.orig/properties/wifi.c
++++ git/properties/wifi.c
+@@ -230,7 +230,7 @@ static void wifi_ipconfig(GtkWidget *tab
+
+ 	data->ipv4_config = ipv4_config;
+
+-	if (g_str_equal(ipv4_config.method, "dhcp") == TRUE)
++	if (!ipv4_config.method || g_str_equal(ipv4_config.method, "dhcp") == TRUE)
+ 		update_wifi_ipv4(data, CONNMAN_POLICY_DHCP);
+ 	else
+ 		update_wifi_ipv4(data, CONNMAN_POLICY_MANUAL);
diff --git a/meta/recipes-connectivity/connman/connman-gnome_0.7.bb b/meta/recipes-connectivity/connman/connman-gnome_0.7.bb
new file mode 100644
index 0000000..f5575d2
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman-gnome_0.7.bb
@@ -0,0 +1,28 @@
+SUMMARY = "GTK+ frontend for the ConnMan network connection manager"
+HOMEPAGE = "http://connman.net/"
+SECTION = "libs/network"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+                    file://properties/main.c;beginline=1;endline=20;md5=50c77c81871308b033ab7a1504626afb \
+                    file://common/connman-dbus.c;beginline=1;endline=20;md5=de6b485c0e717a0236402d220187717a"
+
+DEPENDS = "gtk+ dbus-glib intltool-native"
+
+# 0.7 tag
+SRCREV = "cf3c325b23dae843c5499a113591cfbc98acb143"
+SRC_URI = "git://github.com/connectivity/connman-gnome.git \
+           file://0001-Removed-icon-from-connman-gnome-about-applet.patch \
+           file://null_check_for_ipv4_config.patch \
+           file://images/* \
+           file://connman-gnome-fix-dbus-interface-name.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep gtk-icon-cache pkgconfig
+
+RDEPENDS_${PN} = "connman"
+
+do_install_append() {
+    install -m 0644 ${WORKDIR}/images/* ${D}/usr/share/icons/hicolor/22x22/apps/
+}
diff --git a/meta/recipes-connectivity/connman/connman.inc b/meta/recipes-connectivity/connman/connman.inc
new file mode 100644
index 0000000..17dc4b9
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman.inc
@@ -0,0 +1,211 @@
+SUMMARY = "A daemon for managing internet connections within embedded devices"
+DESCRIPTION = "The ConnMan project provides a daemon for managing \
+internet connections within embedded devices running the Linux \
+operating system.  The Connection Manager is designed to be slim and \
+to use as few resources as possible, so it can be easily integrated. \
+It is a fully modular system that can be extended, through plug-ins, \
+to support all kinds of wired or wireless technologies. Also, \
+configuration methods, like DHCP and domain name resolving, are \
+implemented using plug-ins."
+HOMEPAGE = "http://connman.net/"
+BUGTRACKER = "https://01.org/jira/browse/CM"
+LICENSE  = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+                    file://src/main.c;beginline=1;endline=20;md5=486a279a6ab0c8d152bcda3a5b5edc36"
+
+inherit autotools pkgconfig systemd update-rc.d bluetooth
+
+DEPENDS  = "dbus glib-2.0 ppp iptables"
+
+INC_PR = "r20"
+
+EXTRA_OECONF += "\
+    ac_cv_path_WPASUPPLICANT=${sbindir}/wpa_supplicant \
+    ac_cv_path_PPPD=${sbindir}/pppd \
+    --enable-debug \
+    --enable-loopback \
+    --enable-ethernet \
+    --enable-tools \
+    --enable-test \
+    --disable-polkit \
+    --enable-client \
+"
+
+PACKAGECONFIG ??= "wispr \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd','systemd', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'wifi','wifi', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', '3g','3g', '', d)} \
+"
+
+# If you want ConnMan to support VPN, add following statement into
+# local.conf or distro config
+# PACKAGECONFIG_append_pn-connman = " openvpn vpnc l2tp pptp"
+
+PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/,--with-systemdunitdir="
+PACKAGECONFIG[wifi] = "--enable-wifi, --disable-wifi, wpa-supplicant, wpa-supplicant"
+PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, ${BLUEZ}, ${BLUEZ}"
+PACKAGECONFIG[3g] = "--enable-ofono, --disable-ofono, ofono, ofono"
+PACKAGECONFIG[tist] = "--enable-tist,--disable-tist,"
+PACKAGECONFIG[openvpn] = "--enable-openvpn --with-openvpn=${sbindir}/openvpn,--disable-openvpn,,openvpn"
+PACKAGECONFIG[vpnc] = "--enable-vpnc --with-vpnc=${sbindir}/vpnc,--disable-vpnc,,vpnc"
+PACKAGECONFIG[l2tp] = "--enable-l2tp --with-l2tp=${sbindir}/xl2tpd,--disable-l2tp,,xl2tpd"
+PACKAGECONFIG[pptp] = "--enable-pptp --with-pptp=${sbindir}/pptp,--disable-pptp,,pptp-linux"
+# WISPr support for logging into hotspots, requires TLS
+PACKAGECONFIG[wispr] = "--enable-wispr,--disable-wispr,gnutls,"
+
+INITSCRIPT_NAME = "connman"
+INITSCRIPT_PARAMS = "start 05 5 2 3 . stop 22 0 1 6 ."
+
+python __anonymous () {
+    systemd_packages = "${PN}"
+    pkgconfig = d.getVar('PACKAGECONFIG', True)
+    if ('openvpn' or 'vpnc' or 'l2tp' or 'pptp') in pkgconfig.split():
+        systemd_packages += " ${PN}-vpn"
+    d.setVar('SYSTEMD_PACKAGES', systemd_packages)
+}
+
+SYSTEMD_SERVICE_${PN} = "connman.service"
+SYSTEMD_SERVICE_${PN}-vpn = "connman-vpn.service"
+SYSTEMD_WIRED_SETUP = "ExecStartPre=-${libdir}/connman/wired-setup"
+
+# This allows *everyone* to access ConnMan over DBus, without any access
+# control.  Really the at_console flag should work, which would mean that
+# both this and the xuser patch can be dropped.
+do_compile_append() {
+	sed -i -e s:deny:allow:g ${S}/src/connman-dbus.conf
+	sed -i -e s:deny:allow:g ${S}/vpn/vpn-dbus.conf
+
+	sed -i "s#ExecStart=#${SYSTEMD_WIRED_SETUP}\nExecStart=#" ${B}/src/connman.service
+}
+
+do_install_append() {
+	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+		install -d ${D}${sysconfdir}/init.d
+		install -m 0755 ${WORKDIR}/connman ${D}${sysconfdir}/init.d/connman
+		sed -i s%@LIBDIR@%${libdir}% ${D}${sysconfdir}/init.d/connman
+	fi
+
+	install -d ${D}${bindir}
+	install -m 0755 ${B}/tools/*-test ${D}${bindir}
+	if [ -e ${B}/tools/wispr ]; then
+		install -m 0755 ${B}/tools/wispr ${D}${bindir}
+	fi
+	install -m 0755 ${B}/client/connmanctl ${D}${bindir}
+
+	# We don't need to package an empty directory
+	rmdir --ignore-fail-on-non-empty ${D}${libdir}/connman/scripts
+
+	# Automake 1.12 won't install empty directories, but we need the
+	# plugins directory to be present for ownership
+	mkdir -p ${D}${libdir}/connman/plugins
+}
+
+# These used to be plugins, but now they are core
+RPROVIDES_${PN} = "\
+	connman-plugin-loopback \
+	connman-plugin-ethernet \
+	${@bb.utils.contains('PACKAGECONFIG', 'bluetooth','connman-plugin-bluetooth', '', d)} \
+	${@bb.utils.contains('PACKAGECONFIG', 'wifi','connman-plugin-wifi', '', d)} \
+	${@bb.utils.contains('PACKAGECONFIG', '3g','connman-plugin-ofono', '', d)} \
+	"
+
+RDEPENDS_${PN} = "\
+	dbus \
+	${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)} \
+	"
+
+PACKAGES_DYNAMIC += "^${PN}-plugin-.*"
+
+def add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, add_insane_skip):
+    plugintype = pkg.split( '-' )[-1]
+    if plugintype in depmap:
+        rdepends = map(lambda x: multilib_prefix + x, \
+                       depmap[plugintype].split())
+        d.setVar("RDEPENDS_%s" % pkg, " ".join(rdepends))
+    if add_insane_skip:
+        d.appendVar("INSANE_SKIP_%s" % pkg, "dev-so")
+
+python populate_packages_prepend() {
+    depmap = dict(pppd="ppp")
+    multilib_prefix = (d.getVar("MLPREFIX", True) or "")
+
+    hook = lambda file,pkg,x,y,z: \
+        add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, False)
+    plugin_dir = d.expand('${libdir}/connman/plugins/')
+    plugin_name = d.expand('${PN}-plugin-%s')
+    do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, \
+        '${PN} plugin for %s', extra_depends='', hook=hook, prepend=True )
+
+    hook = lambda file,pkg,x,y,z: \
+        add_rdepends(bb, d, file, pkg, depmap, multilib_prefix, True)
+    plugin_dir = d.expand('${libdir}/connman/plugins-vpn/')
+    plugin_name = d.expand('${PN}-plugin-vpn-%s')
+    do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, \
+        '${PN} VPN plugin for %s', extra_depends='', hook=hook, prepend=True )
+}
+
+PACKAGES =+ "${PN}-tools ${PN}-tests ${PN}-client"
+
+FILES_${PN}-tools = "${bindir}/wispr"
+
+FILES_${PN}-tests = "${bindir}/*-test ${libdir}/${BPN}/test/*"
+RDEPENDS_${PN}-tests = "python-dbus python-pygobject python-textutils python-subprocess python-fcntl python-netclient"
+
+FILES_${PN}-client = "${bindir}/connmanctl"
+
+FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \
+            ${libdir}/connman/plugins \
+            ${sysconfdir} ${sharedstatedir} ${localstatedir} \
+            ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \
+            ${datadir}/dbus-1/system-services/*"
+
+FILES_${PN}-dbg += "${libdir}/connman/*/.debug"
+
+FILES_${PN}-dev += "${libdir}/connman/*/*.la"
+
+PACKAGES =+ "${PN}-vpn"
+
+SUMMARY_${PN}-vpn = "A daemon for managing VPN connections within embedded devices"
+DESCRIPTION_${PN}-vpn = "The ConnMan VPN provides a daemon for \
+managing VPN connections within embedded devices running the Linux \
+operating system.  The connman-vpnd handles all the VPN connections \
+and starts/stops VPN client processes when necessary. The connman-vpnd \
+provides a DBus API for managing VPN connections. All the different \
+VPN technogies are implemented using plug-ins."
+FILES_${PN}-vpn += "${sbindir}/connman-vpnd \
+                    ${sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf \
+                    ${datadir}/dbus-1/system-services/net.connman.vpn.service \
+                    ${systemd_unitdir}/system/connman-vpn.service"
+
+SUMMARY_${PN}-plugin-vpn-openvpn = "An OpenVPN plugin for ConnMan VPN"
+DESCRIPTION_${PN}-plugin-vpn-openvpn = "The ConnMan OpenVPN plugin uses openvpn client \
+to create a VPN connection to OpenVPN server."
+FILES_${PN}-plugin-vpn-openvpn += "${libdir}/connman/scripts/openvpn-script \
+                                   ${libdir}/connman/plugins-vpn/openvpn.so"
+RDEPENDS_${PN}-plugin-vpn-openvpn += "${PN}-vpn"
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','openvpn','${PN}-plugin-vpn-openvpn', '', d)}"
+
+SUMMARY_${PN}-plugin-vpn-vpnc = "A vpnc plugin for ConnMan VPN"
+DESCRIPTION_${PN}-plugin-vpn-vpnc = "The ConnMan vpnc plugin uses vpnc client \
+to create a VPN connection to Cisco3000 VPN Concentrator."
+FILES_${PN}-plugin-vpn-vpnc += "${libdir}/connman/scripts/openconnect-script \
+                                ${libdir}/connman/plugins-vpn/vpnc.so"
+RDEPENDS_${PN}-plugin-vpn-vpnc += "${PN}-vpn"
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','vpnc','${PN}-plugin-vpn-vpnc', '', d)}"
+
+SUMMARY_${PN}-plugin-vpn-l2tp = "A L2TP plugin for ConnMan VPN"
+DESCRIPTION_${PN}-plugin-vpn-l2tp = "The ConnMan L2TP plugin uses xl2tpd daemon \
+to create a VPN connection to L2TP server."
+FILES_${PN}-plugin-vpn-l2tp += "${libdir}/connman/scripts/libppp-plugin.so* \
+                                ${libdir}/connman/plugins-vpn/l2tp.so"
+RDEPENDS_${PN}-plugin-vpn-l2tp += "${PN}-vpn"
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','l2tp','${PN}-plugin-vpn-l2tp', '', d)}"
+
+SUMMARY_${PN}-plugin-vpn-pptp = "A PPTP plugin for ConnMan VPN"
+DESCRIPTION_${PN}-plugin-vpn-pptp = "The ConnMan PPTP plugin uses pptp-linux client \
+to create a VPN connection to PPTP server."
+FILES_${PN}-plugin-vpn-pptp += "${libdir}/connman/scripts/libppp-plugin.so* \
+                                ${libdir}/connman/plugins-vpn/pptp.so"
+RDEPENDS_${PN}-plugin-vpn-pptp += "${PN}-vpn"
+RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG','pptp','${PN}-plugin-vpn-pptp', '', d)}"
diff --git a/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch b/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch
new file mode 100644
index 0000000..e6f03e6
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch
@@ -0,0 +1,35 @@
+From 4ddaf78dad5a9ee4a0658235f71b75132192123e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 7 Apr 2012 18:52:12 -0700
+Subject: [PATCH] plugin.h: Change visibility to default for debug symbols
+
+gold refuses to link in undefined weak symbols which
+have hidden visibility
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+Upstream-Status: Pending
+---
+ include/plugin.h |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/plugin.h b/include/plugin.h
+index 692a4e5..a9361c3 100644
+--- a/include/plugin.h
++++ b/include/plugin.h
+@@ -89,9 +89,9 @@ struct connman_plugin_desc {
+ #else
+ #define CONNMAN_PLUGIN_DEFINE(name, description, version, priority, init, exit) \
+ 		extern struct connman_debug_desc __start___debug[] \
+-				__attribute__ ((weak, visibility("hidden"))); \
++				__attribute__ ((weak, visibility("default"))); \
+ 		extern struct connman_debug_desc __stop___debug[] \
+-				__attribute__ ((weak, visibility("hidden"))); \
++				__attribute__ ((weak, visibility("default"))); \
+ 		extern struct connman_plugin_desc connman_plugin_desc \
+ 				__attribute__ ((visibility("default"))); \
+ 		struct connman_plugin_desc connman_plugin_desc = { \
+-- 
+1.7.5.4
+
diff --git a/meta/recipes-connectivity/connman/connman/add_xuser_dbus_permission.patch b/meta/recipes-connectivity/connman/connman/add_xuser_dbus_permission.patch
new file mode 100644
index 0000000..707b3ca
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/add_xuser_dbus_permission.patch
@@ -0,0 +1,21 @@
+Because Poky doesn't support at_console we need to special-case the session
+user.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/src/connman-dbus.conf b/src/connman-dbus.conf
+index 98a773e..466809c 100644
+--- a/src/connman-dbus.conf
++++ b/src/connman-dbus.conf
+@@ -8,6 +8,9 @@
+         <allow send_interface="net.connman.Counter"/>
+         <allow send_interface="net.connman.Notification"/>
+     </policy>
++    <policy user="xuser">
++        <allow send_destination="net.connman"/>
++    </policy>
+     <policy at_console="true">
+         <allow send_destination="net.connman"/>
+     </policy>
diff --git a/meta/recipes-connectivity/connman/connman/connman b/meta/recipes-connectivity/connman/connman/connman
new file mode 100644
index 0000000..bf7a94a
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman/connman
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/connmand
+PIDFILE=/var/run/connmand.pid
+DESC="Connection Manager"
+
+if [ -f /etc/default/connman ] ; then
+	. /etc/default/connman
+fi
+
+set -e
+
+nfsroot=0
+
+exec 9<&0 < /proc/mounts
+while read dev mtpt fstype rest; do
+	if test $mtpt = "/" ; then
+		case $fstype in
+		    nfs | nfs4)
+			nfsroot=1
+			break
+			;;
+		    *)
+			;;
+		esac
+	fi
+done
+
+do_start() {
+	EXTRA_PARAM=""
+	if test $nfsroot -eq 1 ; then
+	    NET_DEVS=`cat /proc/net/dev | sed -ne 's/^\([a-zA-Z0-9 ]*\):.*$/\1/p'`
+	    NET_ADDR=`cat /proc/cmdline | sed -ne 's/^.*ip=\([^ :]*\).*$/\1/p'`
+
+	    if [ ! -z "$NET_ADDR" ]; then
+		if [ "$NET_ADDR" = dhcp ]; then
+		    ethn=`ifconfig | grep "^eth" | sed -e "s/\(eth[0-9]\)\(.*\)/\1/"`
+		    if [ ! -z "$ethn" ]; then
+			EXTRA_PARAM="-I $ethn"
+		    fi
+		else
+		    for i in $NET_DEVS; do
+			ADDR=`ifconfig $i | sed 's/addr://g' | sed -ne 's/^.*inet \([0-9.]*\) .*$/\1/p'`
+			if [ "$NET_ADDR" = "$ADDR" ]; then
+			    EXTRA_PARAM="-I $i"
+			    break
+			fi
+		    done
+		fi
+	    fi
+	fi
+	if [ -f @LIBDIR@/connman/wired-setup ] ; then
+		. @LIBDIR@/connman/wired-setup
+	fi
+	$DAEMON $EXTRA_PARAM
+}
+
+do_stop() {
+	start-stop-daemon --stop --name connmand --quiet
+}
+
+case "$1" in
+  start)
+	echo "Starting $DESC"
+	do_start
+	;;
+  stop)
+	echo "Stopping $DESC"
+	do_stop
+	;;
+  restart|force-reload)
+	echo "Restarting $DESC"
+	do_stop
+	sleep 1
+	do_start
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-connectivity/connman/connman_1.30.bb b/meta/recipes-connectivity/connman/connman_1.30.bb
new file mode 100644
index 0000000..8c47353
--- /dev/null
+++ b/meta/recipes-connectivity/connman/connman_1.30.bb
@@ -0,0 +1,12 @@
+require connman.inc
+
+SRC_URI  = "${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
+            file://0001-plugin.h-Change-visibility-to-default-for-debug-symb.patch \
+            file://add_xuser_dbus_permission.patch \
+            file://connman \
+            "
+SRC_URI[md5sum] = "4a3efdbd6796922db9c6f66da57887fa"
+SRC_URI[sha256sum] = "5c5e464bacc9c27ed4e7269fb9b5059f07947f5be26433b59212133663ffa991"
+
+RRECOMMENDS_${PN} = "connman-conf"
+
diff --git a/meta/recipes-connectivity/dhcp/dhcp.inc b/meta/recipes-connectivity/dhcp/dhcp.inc
new file mode 100644
index 0000000..d883a8d
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp.inc
@@ -0,0 +1,115 @@
+SECTION = "console/network"
+SUMMARY = "Internet Software Consortium DHCP package"
+DESCRIPTION = "DHCP (Dynamic Host Configuration Protocol) is a protocol \
+which allows individual devices on an IP network to get their own \
+network configuration information from a server.  DHCP helps make it \
+easier to administer devices."
+
+HOMEPAGE = "http://www.isc.org/"
+
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=4;md5=c5c64d696107f84b56fe337d14da1753"
+
+DEPENDS = "openssl bind"
+
+SRC_URI = "ftp://ftp.isc.org/isc/dhcp/${PV}/dhcp-${PV}.tar.gz \
+           file://define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch \
+           file://init-relay file://default-relay \
+           file://init-server file://default-server \
+           file://dhclient.conf file://dhcpd.conf \
+           file://dhcpd.service file://dhcrelay.service \
+           file://dhcpd6.service "
+
+inherit autotools systemd
+
+SYSTEMD_PACKAGES = "${PN}-server ${PN}-relay"
+SYSTEMD_SERVICE_${PN}-server = "dhcpd.service dhcpd6.service"
+SYSTEMD_AUTO_ENABLE_${PN}-server = "disable"
+
+SYSTEMD_SERVICE_${PN}-relay = "dhcrelay.service"
+SYSTEMD_AUTO_ENABLE_${PN}-relay = "disable"
+
+TARGET_CFLAGS += "-D_GNU_SOURCE"
+EXTRA_OECONF = "--with-srv-lease-file=${localstatedir}/lib/dhcp/dhcpd.leases \
+                --with-srv6-lease-file=${localstatedir}/lib/dhcp/dhcpd6.leases \
+                --with-cli-lease-file=${localstatedir}/lib/dhcp/dhclient.leases \
+                --with-cli6-lease-file=${localstatedir}/lib/dhcp/dhclient6.leases \
+                --with-libbind=${STAGING_LIBDIR}/ \
+               "
+
+do_install_append () {
+	install -d ${D}${sysconfdir}/init.d
+	install -d ${D}${sysconfdir}/default
+	install -d ${D}${sysconfdir}/dhcp
+	install -m 0755 ${WORKDIR}/init-relay ${D}${sysconfdir}/init.d/dhcp-relay
+	install -m 0644 ${WORKDIR}/default-relay ${D}${sysconfdir}/default/dhcp-relay
+	install -m 0755 ${WORKDIR}/init-server ${D}${sysconfdir}/init.d/dhcp-server
+	install -m 0644 ${WORKDIR}/default-server ${D}${sysconfdir}/default/dhcp-server
+
+	rm -f ${D}${sysconfdir}/dhclient.conf*
+	rm -f ${D}${sysconfdir}/dhcpd.conf*
+	install -m 0644 ${WORKDIR}/dhclient.conf ${D}${sysconfdir}/dhcp/dhclient.conf
+	install -m 0644 ${WORKDIR}/dhcpd.conf ${D}${sysconfdir}/dhcp/dhcpd.conf
+
+	install -d ${D}${base_sbindir}/
+	if [ "${sbindir}" != "${base_sbindir}" ]; then
+		mv ${D}${sbindir}/dhclient ${D}${base_sbindir}/
+	fi
+	install -m 0755 ${S}/client/scripts/linux ${D}${base_sbindir}/dhclient-script
+
+	# Install systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dhcpd.service ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dhcpd6.service ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dhcrelay.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service ${D}${systemd_unitdir}/system/dhcrelay.service
+	sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
+	sed -i -e 's,@base_bindir@,${base_bindir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
+	sed -i -e 's,@localstatedir@,${localstatedir},g' ${D}${systemd_unitdir}/system/dhcpd*.service
+}
+
+PACKAGES += "dhcp-server dhcp-server-config dhcp-client dhcp-relay dhcp-omshell"
+
+FILES_${PN} = ""
+RDEPENDS_${PN}-dev = ""
+RDEPENDS_${PN}-staticdev = ""
+
+FILES_${PN}-server = "${sbindir}/dhcpd ${sysconfdir}/init.d/dhcp-server"
+RRECOMMENDS_${PN}-server = "dhcp-server-config"
+
+FILES_${PN}-server-config = "${sysconfdir}/default/dhcp-server ${sysconfdir}/dhcp/dhcpd.conf"
+
+FILES_${PN}-relay = "${sbindir}/dhcrelay ${sysconfdir}/init.d/dhcp-relay ${sysconfdir}/default/dhcp-relay"
+
+FILES_${PN}-client = "${base_sbindir}/dhclient ${base_sbindir}/dhclient-script ${sysconfdir}/dhcp/dhclient.conf"
+RDEPENDS_${PN}-client = "bash"
+
+FILES_${PN}-omshell = "${bindir}/omshell"
+
+pkg_postinst_dhcp-server() {
+    mkdir -p $D/${localstatedir}/lib/dhcp
+    touch $D/${localstatedir}/lib/dhcp/dhcpd.leases
+    touch $D/${localstatedir}/lib/dhcp/dhcpd6.leases
+}
+
+pkg_postinst_dhcp-client() {
+    mkdir -p $D/${localstatedir}/lib/dhcp
+}
+
+pkg_postrm_dhcp-server() {
+    rm -f $D/${localstatedir}/lib/dhcp/dhcpd.leases
+    rm -f $D/${localstatedir}/lib/dhcp/dhcpd6.leases
+
+    if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
+        echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
+    fi
+}
+
+pkg_postrm_dhcp-client() {
+    rm -f $D/${localstatedir}/lib/dhcp/dhclient.leases
+    rm -f $D/${localstatedir}/lib/dhcp/dhclient6.leases
+
+    if ! rmdir $D/${localstatedir}/lib/dhcp 2>/dev/null; then
+        echo "Not removing ${localstatedir}/lib/dhcp as it is non-empty."
+    fi
+}
diff --git a/meta/recipes-connectivity/dhcp/dhcp/define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch b/meta/recipes-connectivity/dhcp/dhcp/define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch
new file mode 100644
index 0000000..12d3c9b
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/define-macro-_PATH_DHCPD_CONF-and-_PATH_DHCLIENT_CON.patch
@@ -0,0 +1,26 @@
+define macro _PATH_DHCPD_CONF and _PATH_DHCLIENT_CONF
+
+Upstream-Status: inappropriate <oe specific>
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ includes/site.h | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/includes/site.h b/includes/site.h
+index d87b309..17bc40d 100644
+--- a/includes/site.h
++++ b/includes/site.h
+@@ -139,7 +139,8 @@
+ /* Define this if you want the dhcpd.conf file to go somewhere other than
+    the default location.   By default, it goes in /etc/dhcpd.conf. */
+ 
+-/* #define _PATH_DHCPD_CONF	"/etc/dhcpd.conf" */
++#define _PATH_DHCPD_CONF	"/etc/dhcp/dhcpd.conf"
++#define _PATH_DHCLIENT_CONF	"/etc/dhcp/dhclient.conf"
+ 
+ /* Network API definitions.   You do not need to choose one of these - if
+    you don't choose, one will be chosen for you in your system's config
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch b/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
new file mode 100644
index 0000000..47ea555
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/dhclient-script-drop-resolv.conf.dhclient.patch
@@ -0,0 +1,70 @@
+dhcp-client: fix invoke dhclient-script failed on Read-only file system
+
+In read-only file system, '/etc' is on the readonly partition,
+and '/etc/resolv.conf' is symlinked to a separate writable
+partition.
+
+In this situation, we should use shell variable to instead of
+temp files '/etc/resolv.conf.dhclient' and '/etc/resolv.conf.dhclient6'.
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/scripts/linux | 20 +++++++++-----------
+ 1 file changed, 9 insertions(+), 11 deletions(-)
+
+diff --git a/client/scripts/linux b/client/scripts/linux
+--- a/client/scripts/linux
++++ b/client/scripts/linux
+@@ -27,27 +27,25 @@ ip=/sbin/ip
+ 
+ make_resolv_conf() {
+   if [ x"$new_domain_name_servers" != x ]; then
+-    cat /dev/null > /etc/resolv.conf.dhclient
+-    chmod 644 /etc/resolv.conf.dhclient
++    resolv_conf=""
+     if [ x"$new_domain_search" != x ]; then
+-      echo search $new_domain_search >> /etc/resolv.conf.dhclient
++      resolv_conf="search ${new_domain_search}\n"
+     elif [ x"$new_domain_name" != x ]; then
+       # Note that the DHCP 'Domain Name Option' is really just a domain
+       # name, and that this practice of using the domain name option as
+       # a search path is both nonstandard and deprecated.
+-      echo search $new_domain_name >> /etc/resolv.conf.dhclient
++      resolv_conf="search ${new_domain_name}\n"
+     fi
+     for nameserver in $new_domain_name_servers; do
+-      echo nameserver $nameserver >>/etc/resolv.conf.dhclient
++      resolv_conf="${resolv_conf}nameserver ${nameserver}\n"
+     done
+ 
+-    mv /etc/resolv.conf.dhclient /etc/resolv.conf
++    echo -e "${resolv_conf}" > /etc/resolv.conf
+   elif [ "x${new_dhcp6_name_servers}" != x ] ; then
+-    cat /dev/null > /etc/resolv.conf.dhclient6
+-    chmod 644 /etc/resolv.conf.dhclient6
++    resolv_conf=""
+ 
+     if [ "x${new_dhcp6_domain_search}" != x ] ; then
+-      echo search ${new_dhcp6_domain_search} >> /etc/resolv.conf.dhclient6
++      resolv_conf="search ${new_dhcp6_domain_search}\n"
+     fi
+     shopt -s nocasematch 
+     for nameserver in ${new_dhcp6_name_servers} ; do
+@@ -59,11 +57,11 @@ make_resolv_conf() {
+       else
+ 	zone_id=
+       fi
+-      echo nameserver ${nameserver}$zone_id >> /etc/resolv.conf.dhclient6
++      resolv_conf="${resolv_conf}nameserver ${nameserver}$zone_id\n"
+     done
+     shopt -u nocasematch 
+ 
+-    mv /etc/resolv.conf.dhclient6 /etc/resolv.conf
++    echo -e "${resolv_conf}" > /etc/resolv.conf
+   fi
+ }
+ 
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch b/meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch
new file mode 100644
index 0000000..b4a666d
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/dhcp-3.0.3-dhclient-dbus.patch
@@ -0,0 +1,86 @@
+Upstream-Status: Inappropriate [distribution]
+
+--- client/scripts/bsdos
++++ client/scripts/bsdos
+@@ -47,6 +47,11 @@
+     . /etc/dhcp/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 
+--- client/scripts/freebsd
++++ client/scripts/freebsd
+@@ -57,6 +57,11 @@
+     . /etc/dhcp/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 
+--- client/scripts/linux
++++ client/scripts/linux
+@@ -69,6 +69,11 @@
+     . /etc/dhcp/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 
+--- client/scripts/netbsd
++++ client/scripts/netbsd
+@@ -47,6 +47,11 @@
+     . /etc/dhcp/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 
+--- client/scripts/openbsd
++++ client/scripts/openbsd
+@@ -47,6 +47,11 @@
+     . /etc/dhcp/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 
+--- client/scripts/solaris
++++ client/scripts/solaris
+@@ -47,6 +47,11 @@
+     . /etc/dhcp/dhclient-exit-hooks
+   fi
+ # probably should do something with exit status of the local script
++  if [ x$dhc_dbus != x -a $exit_status -eq 0 ]; then
++    dbus-send --system --dest=com.redhat.dhcp \
++      --type=method_call /com/redhat/dhcp/$interface com.redhat.dhcp.set \
++      'string:'"`env | grep -Ev '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`"
++  fi
+   exit $exit_status
+ }
+ 
diff --git a/meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch b/meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch
new file mode 100644
index 0000000..a291fda
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/fix-external-bind.patch
@@ -0,0 +1,112 @@
+Upstream-Status: Pending
+
+11/30/2010
+--with-libbind=PATH is available but not used by Makefile,
+this patch is to allow building with external bind
+
+Signed-off-by: Qing He <qing.he@intel.com>
+
+Index: dhcp-4.3.0/Makefile.am
+===================================================================
+--- dhcp-4.3.0.orig/Makefile.am
++++ dhcp-4.3.0/Makefile.am
+@@ -25,7 +25,7 @@ EXTRA_DIST = RELNOTES LICENSE \
+ 	     bind/Makefile bind/bind.tar.gz bind/version.tmp \
+ 	     common/tests/Atffile server/tests/Atffile
+ 
+-SUBDIRS = bind includes tests common dst omapip client dhcpctl relay server
++SUBDIRS = includes tests common dst omapip client dhcpctl relay server
+ 
+ nobase_include_HEADERS = dhcpctl/dhcpctl.h
+ 
+Index: dhcp-4.3.0/client/Makefile.am
+===================================================================
+--- dhcp-4.3.0.orig/client/Makefile.am
++++ dhcp-4.3.0/client/Makefile.am
+@@ -4,8 +4,8 @@ dhclient_SOURCES = clparse.c dhclient.c
+ 		   scripts/bsdos scripts/freebsd scripts/linux scripts/macos \
+ 		   scripts/netbsd scripts/nextstep scripts/openbsd \
+ 		   scripts/solaris scripts/openwrt
+-dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a ../bind/lib/libirs.a \
+-		 ../bind/lib/libdns.a ../bind/lib/libisccfg.a ../bind/lib/libisc.a
++dhclient_LDADD = ../common/libdhcp.a ../omapip/libomapi.a $(libbind)/libirs.a \
++		 $(libbind)/libdns.a $(libbind)/libisccfg.a $(libbind)/libisc.a
+ man_MANS = dhclient.8 dhclient-script.8 dhclient.conf.5 dhclient.leases.5
+ EXTRA_DIST = $(man_MANS)
+ 
+Index: dhcp-4.3.0/configure.ac
+===================================================================
+--- dhcp-4.3.0.orig/configure.ac
++++ dhcp-4.3.0/configure.ac
+@@ -566,6 +566,7 @@ no)
+ 	libbind="$use_libbind"
+ 	;;
+ esac
++AC_SUBST([libbind])
+ 
+ # OpenLDAP support.
+ AC_ARG_WITH(ldap,
+Index: dhcp-4.3.0/dhcpctl/Makefile.am
+===================================================================
+--- dhcp-4.3.0.orig/dhcpctl/Makefile.am
++++ dhcp-4.3.0/dhcpctl/Makefile.am
+@@ -6,12 +6,12 @@ EXTRA_DIST = $(man_MANS)
+ 
+ omshell_SOURCES = omshell.c
+ omshell_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
+-	        ../bind/lib/libirs.a ../bind/lib/libdns.a \
+-	        ../bind/lib/libisccfg.a ../bind/lib/libisc.a
++	        $(libbind)/libirs.a $(libbind)/libdns.a \
++	        $(libbind)/libisccfg.a $(libbind)/libisc.a
+ 
+ libdhcpctl_a_SOURCES = dhcpctl.c callback.c remote.c
+ 
+ cltest_SOURCES = cltest.c
+ cltest_LDADD = libdhcpctl.a ../common/libdhcp.a ../omapip/libomapi.a \
+-	       ../bind/lib/libirs.a ../bind/lib/libdns.a \
+-               ../bind/lib/libisccfg.a ../bind/lib/libisc.a
++	       $(libbind)/libirs.a $(libbind)/libdns.a \
++               $(libbind)/libisccfg.a $(libbind)/libisc.a
+Index: dhcp-4.3.0/omapip/Makefile.am
+===================================================================
+--- dhcp-4.3.0.orig/omapip/Makefile.am
++++ dhcp-4.3.0/omapip/Makefile.am
+@@ -10,6 +10,6 @@ man_MANS = omapi.3
+ EXTRA_DIST = $(man_MANS)
+ 
+ svtest_SOURCES = test.c
+-svtest_LDADD = libomapi.a ../bind/lib/libirs.a ../bind/lib/libdns.a \
+-		../bind/lib/libisccfg.a ../bind/lib/libisc.a
++svtest_LDADD = libomapi.a $(libbind)/libirs.a $(libbind)/libdns.a \
++		$(libbind)/libisccfg.a $(libbind)/libisc.a
+ 
+Index: dhcp-4.3.0/relay/Makefile.am
+===================================================================
+--- dhcp-4.3.0.orig/relay/Makefile.am
++++ dhcp-4.3.0/relay/Makefile.am
+@@ -3,8 +3,8 @@ AM_CPPFLAGS = -DLOCALSTATEDIR='"@localst
+ sbin_PROGRAMS = dhcrelay
+ dhcrelay_SOURCES = dhcrelay.c
+ dhcrelay_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
+-		 ../bind/lib/libirs.a ../bind/lib/libdns.a \
+-		 ../bind/lib/libisccfg.a ../bind/lib/libisc.a
++		 $(libbind)/libirs.a $(libbind)/libdns.a \
++		 $(libbind)/libisccfg.a $(libbind)/libisc.a
+ man_MANS = dhcrelay.8
+ EXTRA_DIST = $(man_MANS)
+ 
+Index: dhcp-4.3.0/server/Makefile.am
+===================================================================
+--- dhcp-4.3.0.orig/server/Makefile.am
++++ dhcp-4.3.0/server/Makefile.am
+@@ -14,8 +14,8 @@ dhcpd_SOURCES = dhcpd.c dhcp.c bootp.c c
+ 
+ dhcpd_CFLAGS = $(LDAP_CFLAGS)
+ dhcpd_LDADD = ../common/libdhcp.a ../omapip/libomapi.a \
+-	      ../dhcpctl/libdhcpctl.a ../bind/lib/libirs.a \
+-	      ../bind/lib/libdns.a ../bind/lib/libisccfg.a ../bind/lib/libisc.a
++	      ../dhcpctl/libdhcpctl.a $(libbind)/libirs.a \
++	      $(libbind)/libdns.a $(libbind)/libisccfg.a $(libbind)/libisc.a
+ 
+ man_MANS = dhcpd.8 dhcpd.conf.5 dhcpd.leases.5
+ EXTRA_DIST = $(man_MANS)
diff --git a/meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch b/meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch
new file mode 100644
index 0000000..14e75a3
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/fixsepbuild.patch
@@ -0,0 +1,108 @@
+Fix out of tree builds
+
+Upstream-Status: Pending
+
+RP 2013/03/21
+
+Rebase to 4.3.1
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ client/Makefile.am  | 6 ++++--
+ common/Makefile.am  | 2 +-
+ dhcpctl/Makefile.am | 2 ++
+ dst/Makefile.am     | 2 +-
+ omapip/Makefile.am  | 2 ++
+ relay/Makefile.am   | 2 +-
+ server/Makefile.am  | 2 +-
+ 7 files changed, 12 insertions(+), 6 deletions(-)
+
+diff --git a/client/Makefile.am b/client/Makefile.am
+index 8411960..1740f72 100644
+--- a/client/Makefile.am
++++ b/client/Makefile.am
+@@ -4,6 +4,8 @@
+ # production code. Sadly, we are not there yet.
+ SUBDIRS = . tests
+ 
++AM_CPPFLAGS = -I$(top_srcdir)/includes
++
+ dist_sysconf_DATA = dhclient.conf.example
+ sbin_PROGRAMS = dhclient
+ dhclient_SOURCES = clparse.c dhclient.c dhc6.c \
+@@ -17,8 +19,8 @@ EXTRA_DIST = $(man_MANS)
+ 
+ dhclient.o: dhclient.c
+ 	$(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
+-		   -DLOCALSTATEDIR='"$(localstatedir)"' -c dhclient.c
++		   -DLOCALSTATEDIR='"$(localstatedir)"' -c $(srcdir)/dhclient.c
+ 
+ dhc6.o: dhc6.c
+ 	$(COMPILE) -DCLIENT_PATH='"PATH=$(sbindir):/sbin:/bin:/usr/sbin:/usr/bin"' \
+-		   -DLOCALSTATEDIR='"$(localstatedir)"' -c dhc6.c
++		   -DLOCALSTATEDIR='"$(localstatedir)"' -c $(srcdir)/dhc6.c
+diff --git a/common/Makefile.am b/common/Makefile.am
+index eddef05..5ce045f 100644
+--- a/common/Makefile.am
++++ b/common/Makefile.am
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
++AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"'
+ AM_CFLAGS = $(LDAP_CFLAGS)
+ 
+ noinst_LIBRARIES = libdhcp.a
+diff --git a/dhcpctl/Makefile.am b/dhcpctl/Makefile.am
+index 2987a53..cd72d75 100644
+--- a/dhcpctl/Makefile.am
++++ b/dhcpctl/Makefile.am
+@@ -1,3 +1,5 @@
++AM_CPPFLAGS = -I$(top_srcdir)/includes -I$(top_srcdir)
++
+ bin_PROGRAMS = omshell
+ lib_LIBRARIES = libdhcpctl.a
+ noinst_PROGRAMS = cltest
+diff --git a/dst/Makefile.am b/dst/Makefile.am
+index 8937fe8..a14798b 100644
+--- a/dst/Makefile.am
++++ b/dst/Makefile.am
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = -DMINIRES_LIB -DHMAC_MD5
++AM_CPPFLAGS = -DMINIRES_LIB -DHMAC_MD5 -I$(top_srcdir)/includes
+ 
+ lib_LIBRARIES = libdst.a
+ 
+diff --git a/omapip/Makefile.am b/omapip/Makefile.am
+index 5074479..9c0fab3 100644
+--- a/omapip/Makefile.am
++++ b/omapip/Makefile.am
+@@ -1,3 +1,5 @@
++AM_CPPFLAGS = -I$(top_srcdir)/includes
++
+ lib_LIBRARIES = libomapi.a
+ noinst_PROGRAMS = svtest
+ 
+diff --git a/relay/Makefile.am b/relay/Makefile.am
+index ec72a31..f842071 100644
+--- a/relay/Makefile.am
++++ b/relay/Makefile.am
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"'
++AM_CPPFLAGS = -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
+ 
+ sbin_PROGRAMS = dhcrelay
+ dhcrelay_SOURCES = dhcrelay.c
+diff --git a/server/Makefile.am b/server/Makefile.am
+index a446f0b..d0b873a 100644
+--- a/server/Makefile.am
++++ b/server/Makefile.am
+@@ -4,7 +4,7 @@
+ # production code. Sadly, we are not there yet.
+ SUBDIRS = . tests
+ 
+-AM_CPPFLAGS = -I.. -DLOCALSTATEDIR='"@localstatedir@"'
++AM_CPPFLAGS = -I$(top_srcdir) -DLOCALSTATEDIR='"@localstatedir@"' -I$(top_srcdir)/includes
+ 
+ dist_sysconf_DATA = dhcpd.conf.example
+ sbin_PROGRAMS = dhcpd
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch b/meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch
new file mode 100644
index 0000000..57e10b0
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/link-with-lcrypto.patch
@@ -0,0 +1,25 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+Date:   Thu Feb 2 23:59:11 2012 +0200
+
+From 4.2.0 final release, -lcrypto check was removed and we compile static libraries
+from bind that are linked to libcrypto. This is why i added a patch in order to add
+-lcrypto to LIBS.
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+Upstream-Status: Pending
+
+Index: dhcp-4.2.3-P2-r0/dhcp-4.2.3-P2/configure.ac
+===================================================================
+--- dhcp-4.2.3-P2.orig/configure.ac	2012-02-02 18:04:20.843023196 +0200
++++ dhcp-4.2.3-P2/configure.ac	2012-02-02 17:58:16.000000000 +0200
+@@ -456,6 +456,10 @@
+ # Look for optional headers.
+ AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
+ 
++# find an MD5 library
++AC_SEARCH_LIBS(MD5_Init, [crypto])
++AC_SEARCH_LIBS(MD5Init, [crypto])
++
+ # Solaris needs some libraries for functions
+ AC_SEARCH_LIBS(socket, [socket])
+ AC_SEARCH_LIBS(inet_ntoa, [nsl])
diff --git a/meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch b/meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch
new file mode 100644
index 0000000..61dd6a7
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp/replace-ifconfig-route.patch
@@ -0,0 +1,176 @@
+Found this patch here:
+https://lists.isc.org/pipermail/dhcp-users/2011-January/012910.html
+
+and made some adjustments/updates to make it work with this version.
+Wasn't able to find that why this patch was not accepted by ISC DHCP developers.
+
+Upstream-Status: Pending
+
+Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
+
+--- dhcp-4.2.5-P1/client/scripts/linux.orig	2013-09-04 12:22:55.000000000 +0500
++++ dhcp-4.2.5-P1/client/scripts/linux	2013-09-04 12:52:19.068761518 +0500
+@@ -103,17 +103,11 @@
+ if [ x$old_broadcast_address != x ]; then
+   old_broadcast_arg="broadcast $old_broadcast_address"
+ fi
+-if [ x$new_subnet_mask != x ]; then
+-  new_subnet_arg="netmask $new_subnet_mask"
+-fi
+-if [ x$old_subnet_mask != x ]; then
+-  old_subnet_arg="netmask $old_subnet_mask"
+-fi
+-if [ x$alias_subnet_mask != x ]; then
+-  alias_subnet_arg="netmask $alias_subnet_mask"
++if [ -n "$new_subnet_mask" ]; then
++    new_mask="/$new_subnet_mask"
+ fi
+-if [ x$new_interface_mtu != x ]; then
+-  mtu_arg="mtu $new_interface_mtu"
++if [ -n "$alias_subnet_mask" ]; then
++    alias_mask="/$alias_subnet_mask"
+ fi
+ if [ x$IF_METRIC != x ]; then
+   metric_arg="metric $IF_METRIC"
+@@ -127,9 +121,9 @@
+ if [ x$reason = xPREINIT ]; then
+   if [ x$alias_ip_address != x ]; then
+     # Bring down alias interface. Its routes will disappear too.
+-    ifconfig $interface:0- inet 0
++    ${ip} -4 addr flush dev ${interface} label ${interface}:0
+   fi
+-  ifconfig $interface 0 up
++  ${ip} link set dev ${interface} up
+ 
+   # We need to give the kernel some time to get the interface up.
+   sleep 1
+@@ -156,25 +150,30 @@
+   if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
+ 		[ x$alias_ip_address != x$old_ip_address ]; then
+     # Possible new alias. Remove old alias.
+-    ifconfig $interface:0- inet 0
++    ${ip} -4 addr flush dev ${interface} label ${interface}:0
+   fi
+   if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+     # IP address changed. Bringing down the interface will delete all routes,
+     # and clear the ARP cache.
+-    ifconfig $interface inet 0 down
++    ${ip} -4 addr flush dev ${interface} label ${interface}
+ 
+   fi
+   if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
+      [ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
+ 
+-    ifconfig $interface inet $new_ip_address $new_subnet_arg \
+-					$new_broadcast_arg $mtu_arg
++    ${ip} -4 addr add ${new_ip_address}${new_mask} ${new_broadcast_arg} \
++                dev ${interface} label ${interface}
++    if [ -n "$new_interface_mtu" ]; then
++      # set MTU
++      ${ip} link set dev ${interface} mtu ${new_interface_mtu}
++    fi
+     # Add a network route to the computed network address.
+     for router in $new_routers; do
+       if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+-	route add -host $router dev $interface
++        ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
+       fi
+-      route add default gw $router $metric_arg dev $interface
++      ${ip} -4 route add default via ${router} dev ${interface} \
++        ${metric_arg} >/dev/null 2>&1
+     done
+   else
+     # we haven't changed the address, have we changed other options           
+@@ -182,21 +181,23 @@
+     if [ x$new_routers != x ] && [ x$new_routers != x$old_routers ] ; then
+       # if we've changed routers delete the old and add the new.
+       for router in $old_routers; do
+-        route del default gw $router
++        ${ip} -4 route delete default via ${router}
+       done
+       for router in $new_routers; do
+         if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+-	  route add -host $router dev $interface
+-	fi
+-	route add default gw $router $metric_arg dev $interface
++	      ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
++	    fi
++        ${ip} -4 route add default via ${router} dev ${interface} \
++          ${metric_arg} >/dev/null 2>&1
+       done
+     fi
+   fi
+   if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
+    then
+-    ifconfig $interface:0- inet 0
+-    ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+-    route add -host $alias_ip_address $interface:0
++    ${ip} -4 addr flush dev ${interface} label ${interface}:0
++    ${ip} -4 addr add ${alias_ip_address}${alias_mask} \
++        dev ${interface} label ${interface}:0
++    ${ip} -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
+   fi
+   make_resolv_conf
+   exit_with_hooks 0
+@@ -206,42 +207,49 @@
+    || [ x$reason = xSTOP ]; then
+   if [ x$alias_ip_address != x ]; then
+     # Turn off alias interface.
+-    ifconfig $interface:0- inet 0
++    ${ip} -4 addr flush dev ${interface} label ${interface}:0
+   fi
+   if [ x$old_ip_address != x ]; then
+     # Shut down interface, which will delete routes and clear arp cache.
+-    ifconfig $interface inet 0 down
++    ${ip} -4 addr flush dev ${interface} label ${interface}
+   fi
+   if [ x$alias_ip_address != x ]; then
+-    ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+-    route add -host $alias_ip_address $interface:0
++    ${ip} -4 addr add ${alias_ip_address}${alias_network_arg} \
++        dev ${interface} label ${interface}:0
++    ${ip} -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
+   fi
+   exit_with_hooks 0
+ fi
+ 
+ if [ x$reason = xTIMEOUT ]; then
+   if [ x$alias_ip_address != x ]; then
+-    ifconfig $interface:0- inet 0
++    ${ip} -4 addr flush dev ${interface} label ${interface}:0
++  fi
++  ${ip} -4 addr add ${new_ip_address}${new_mask} ${new_broadcast_arg} \
++            dev ${interface} label ${interface}
++  if [ -n "$new_interface_mtu" ]; then
++    # set MTU
++    ip link set dev ${interface} mtu ${new_interface_mtu}
+   fi
+-  ifconfig $interface inet $new_ip_address $new_subnet_arg \
+-					$new_broadcast_arg $mtu_arg
+   set $new_routers
+   if ping -q -c 1 $1; then
+     if [ x$new_ip_address != x$alias_ip_address ] && \
+ 			[ x$alias_ip_address != x ]; then
+-      ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
+-      route add -host $alias_ip_address dev $interface:0
++      ${ip} -4 addr add ${alias_ip_address}${alias_mask} \
++            dev ${interface} label ${interface}:0
++      ${ip} -4 route add ${alias_ip_address} dev ${interface} >/dev/null 2>&1
+     fi
+     for router in $new_routers; do
+       if [ "x$new_subnet_mask" = "x255.255.255.255" ] ; then
+-	route add -host $router dev $interface
++	    ${ip} -4 route add ${router} dev $interface >/dev/null 2>&1
+       fi
+-      route add default gw $router $metric_arg dev $interface
++      ${ip} -4 route add default via ${router} dev ${interface} \
++        ${metric_arg} >/dev/null 2>&1
+     done
+     make_resolv_conf
+     exit_with_hooks 0
+   fi
+-  ifconfig $interface inet 0 down
++  ${ip} -4 addr flush dev ${interface}
+   exit_with_hooks 1
+ fi
+ 
diff --git a/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb b/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb
new file mode 100644
index 0000000..b4a05fc
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/dhcp_4.3.2.bb
@@ -0,0 +1,12 @@
+require dhcp.inc
+
+SRC_URI += "file://dhcp-3.0.3-dhclient-dbus.patch;striplevel=0 \
+            file://fix-external-bind.patch \
+            file://link-with-lcrypto.patch \
+            file://fixsepbuild.patch \
+            file://dhclient-script-drop-resolv.conf.dhclient.patch \
+            file://replace-ifconfig-route.patch \
+           "
+
+SRC_URI[md5sum] = "5a284875dd2c12ddd388416d69156a67"
+SRC_URI[sha256sum] = "6246c9b358759f6cdcc45104caaf76e732a211dbbbbf64a21f499c8db1298165"
diff --git a/meta/recipes-connectivity/dhcp/files/default-relay b/meta/recipes-connectivity/dhcp/files/default-relay
new file mode 100644
index 0000000..7961f01
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/default-relay
@@ -0,0 +1,12 @@
+# Defaults for dhcp-relay initscript
+# sourced by /etc/init.d/dhcp-relay
+
+# What servers should the DHCP relay forward requests to?
+# e.g: SERVERS="192.168.0.1"
+SERVERS=""
+
+# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
+INTERFACES=""
+
+# Additional options that are passed to the DHCP relay daemon?
+OPTIONS=""
diff --git a/meta/recipes-connectivity/dhcp/files/default-server b/meta/recipes-connectivity/dhcp/files/default-server
new file mode 100644
index 0000000..0385d16
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/default-server
@@ -0,0 +1,7 @@
+# Defaults for dhcp initscript
+# sourced by /etc/init.d/dhcp-server
+# installed at /etc/default/dhcp-server by the maintainer scripts
+
+# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
+#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
+INTERFACES=""
diff --git a/meta/recipes-connectivity/dhcp/files/dhclient.conf b/meta/recipes-connectivity/dhcp/files/dhclient.conf
new file mode 100644
index 0000000..0e6dcf9
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhclient.conf
@@ -0,0 +1,50 @@
+# Configuration file for /sbin/dhclient, which is included in Debian's
+#	dhcp3-client package.
+#
+# This is a sample configuration file for dhclient. See dhclient.conf's
+#	man page for more information about the syntax of this file
+#	and a more comprehensive list of the parameters understood by
+#	dhclient.
+#
+# Normally, if the DHCP server provides reasonable information and does
+#	not leave anything out (like the domain name, for example), then
+#	few changes must be made to this file, if any.
+#
+
+#send host-name "andare.fugue.com";
+#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
+#send dhcp-lease-time 3600;
+#supersede domain-name "fugue.com home.vix.com";
+#prepend domain-name-servers 127.0.0.1;
+request subnet-mask, broadcast-address, time-offset, routers,
+	domain-name, domain-name-servers, host-name,
+	netbios-name-servers, netbios-scope;
+#require subnet-mask, domain-name-servers;
+#timeout 60;
+#retry 60;
+#reboot 10;
+#select-timeout 5;
+#initial-interval 2;
+#script "/etc/dhcp3/dhclient-script";
+#media "-link0 -link1 -link2", "link0 link1";
+#reject 192.33.137.209;
+
+#alias {
+#  interface "eth0";
+#  fixed-address 192.5.5.213;
+#  option subnet-mask 255.255.255.255;
+#}
+
+#lease {
+#  interface "eth0";
+#  fixed-address 192.33.137.200;
+#  medium "link0 link1";
+#  option host-name "andare.swiftmedia.com";
+#  option subnet-mask 255.255.255.0;
+#  option broadcast-address 192.33.137.255;
+#  option routers 192.33.137.250;
+#  option domain-name-servers 127.0.0.1;
+#  renew 2 2000/1/12 00:00:01;
+#  rebind 2 2000/1/12 00:00:01;
+#  expire 2 2000/1/12 00:00:01;
+#}
diff --git a/meta/recipes-connectivity/dhcp/files/dhcpd.conf b/meta/recipes-connectivity/dhcp/files/dhcpd.conf
new file mode 100644
index 0000000..0001c0f
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhcpd.conf
@@ -0,0 +1,108 @@
+#
+# Sample configuration file for ISC dhcpd for Debian
+#
+# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
+#
+
+# The ddns-updates-style parameter controls whether or not the server will
+# attempt to do a DNS update when a lease is confirmed. We default to the
+# behavior of the version 2 packages ('none', since DHCP v2 didn't
+# have support for DDNS.)
+ddns-update-style none;
+
+# option definitions common to all supported networks...
+option domain-name "example.org";
+option domain-name-servers ns1.example.org, ns2.example.org;
+
+default-lease-time 600;
+max-lease-time 7200;
+
+# If this DHCP server is the official DHCP server for the local
+# network, the authoritative directive should be uncommented.
+#authoritative;
+
+# Use this to send dhcp log messages to a different log file (you also
+# have to hack syslog.conf to complete the redirection).
+log-facility local7;
+
+# No service will be given on this subnet, but declaring it helps the 
+# DHCP server to understand the network topology.
+
+#subnet 10.152.187.0 netmask 255.255.255.0 {
+#}
+
+# This is a very basic subnet declaration.
+
+#subnet 10.254.239.0 netmask 255.255.255.224 {
+#  range 10.254.239.10 10.254.239.20;
+#  option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
+#}
+
+# This declaration allows BOOTP clients to get dynamic addresses,
+# which we don't really recommend.
+
+#subnet 10.254.239.32 netmask 255.255.255.224 {
+#  range dynamic-bootp 10.254.239.40 10.254.239.60;
+#  option broadcast-address 10.254.239.31;
+#  option routers rtr-239-32-1.example.org;
+#}
+
+# A slightly different configuration for an internal subnet.
+#subnet 10.5.5.0 netmask 255.255.255.224 {
+#  range 10.5.5.26 10.5.5.30;
+#  option domain-name-servers ns1.internal.example.org;
+#  option domain-name "internal.example.org";
+#  option routers 10.5.5.1;
+#  option broadcast-address 10.5.5.31;
+#  default-lease-time 600;
+#  max-lease-time 7200;
+#}
+
+# Hosts which require special configuration options can be listed in
+# host statements.   If no address is specified, the address will be
+# allocated dynamically (if possible), but the host-specific information
+# will still come from the host declaration.
+
+#host passacaglia {
+#  hardware ethernet 0:0:c0:5d:bd:95;
+#  filename "vmunix.passacaglia";
+#  server-name "toccata.fugue.com";
+#}
+
+# Fixed IP addresses can also be specified for hosts.   These addresses
+# should not also be listed as being available for dynamic assignment.
+# Hosts for which fixed IP addresses have been specified can boot using
+# BOOTP or DHCP.   Hosts for which no fixed address is specified can only
+# be booted with DHCP, unless there is an address range on the subnet
+# to which a BOOTP client is connected which has the dynamic-bootp flag
+# set.
+#host fantasia {
+#  hardware ethernet 08:00:07:26:c0:a5;
+#  fixed-address fantasia.fugue.com;
+#}
+
+# You can declare a class of clients and then do address allocation
+# based on that.   The example below shows a case where all clients
+# in a certain class get addresses on the 10.17.224/24 subnet, and all
+# other clients get addresses on the 10.0.29/24 subnet.
+
+#class "foo" {
+#  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
+#}
+
+#shared-network 224-29 {
+#  subnet 10.17.224.0 netmask 255.255.255.0 {
+#    option routers rtr-224.example.org;
+#  }
+#  subnet 10.0.29.0 netmask 255.255.255.0 {
+#    option routers rtr-29.example.org;
+#  }
+#  pool {
+#    allow members of "foo";
+#    range 10.17.224.10 10.17.224.250;
+#  }
+#  pool {
+#    deny members of "foo";
+#    range 10.0.29.10 10.0.29.230;
+#  }
+#}
diff --git a/meta/recipes-connectivity/dhcp/files/dhcpd.service b/meta/recipes-connectivity/dhcp/files/dhcpd.service
new file mode 100644
index 0000000..ae4f93e
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhcpd.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=DHCPv4 Server Daemon
+Documentation=man:dhcpd(8) man:dhcpd.conf(5)
+After=network.target
+After=time-sync.target
+
+[Service]
+PIDFile=@localstatedir@/run/dhcpd.pid
+EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcp-server
+ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd.leases
+ExecStart=@SBINDIR@/dhcpd -f -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf @localstatedir@/run/dhcpd.pid $DHCPDARGS -q $INTERFACES
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/dhcp/files/dhcpd6.service b/meta/recipes-connectivity/dhcp/files/dhcpd6.service
new file mode 100644
index 0000000..ca96abb
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhcpd6.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=DHCPv6 Server Daemon
+Documentation=man:dhcpd(8) man:dhcpd.conf(5)
+After=network.target
+After=time-sync.target
+
+[Service]
+PIDFile=@localstatedir@/run/dhcpd6.pid
+EnvironmentFile=@SYSCONFDIR@/default/dhcp-server
+EnvironmentFile=-@SYSCONFDIR@/sysconfig/dhcpd6
+ExecStartPre=@base_bindir@/touch @localstatedir@/lib/dhcp/dhcpd6.leases
+ExecStart=@SBINDIR@/dhcpd -f -6 -cf @SYSCONFDIR@/dhcp/dhcpd.conf -pf @localstatedir@/run/dhcpd6.pid $DHCPDARGS -q $INTERFACES
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/dhcp/files/dhcrelay.service b/meta/recipes-connectivity/dhcp/files/dhcrelay.service
new file mode 100644
index 0000000..a2d8189
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/dhcrelay.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=DHCP Relay Agent Daemon
+After=network.target
+
+[Service]
+ExecStart=@SBINDIR@/dhcrelay -d --no-pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/dhcp/files/init-relay b/meta/recipes-connectivity/dhcp/files/init-relay
new file mode 100644
index 0000000..019a7e8
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/init-relay
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $Id: dhcp3-relay,v 1.1 2004/04/16 15:41:08 ml Exp $
+#
+
+# It is not safe to start if we don't have a default configuration...
+if [ ! -f /etc/default/dhcp-relay ]; then
+	echo "/etc/default/dhcp-relay does not exist! - Aborting..."
+	echo "create this file to fix the problem."
+	exit 1
+fi
+
+# Read init script configuration (interfaces the daemon should listen on
+# and the DHCP server we should forward requests to.)
+. /etc/default/dhcp-relay
+
+# Build command line for interfaces (will be passed to dhrelay below.)
+IFCMD=""
+if test "$INTERFACES" != ""; then
+	for I in $INTERFACES; do
+		IFCMD=${IFCMD}"-i "${I}" "
+	done
+fi
+
+DHCRELAYPID=/var/run/dhcrelay.pid
+
+case "$1" in
+	start)
+		start-stop-daemon -S -x /usr/sbin/dhcrelay -- -q $OPTIONS $IFCMD $SERVERS
+		;;
+	stop)
+		start-stop-daemon -K -x /usr/sbin/dhcrelay
+		;;
+	restart | force-reload)
+		$0 stop
+		sleep 2
+		$0 start
+		;;
+	*)
+		echo "Usage: /etc/init.d/dhcp-relay {start|stop|restart|force-reload}"
+		exit 1 
+esac
+
+exit 0
diff --git a/meta/recipes-connectivity/dhcp/files/init-server b/meta/recipes-connectivity/dhcp/files/init-server
new file mode 100644
index 0000000..34c2085
--- /dev/null
+++ b/meta/recipes-connectivity/dhcp/files/init-server
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $Id: dhcp3-server.init.d,v 1.4 2003/07/13 19:12:41 mdz Exp $
+#
+
+test -f /usr/sbin/dhcpd || exit 0
+
+# It is not safe to start if we don't have a default configuration...
+if [ ! -f /etc/default/dhcp-server ]; then
+	echo "/etc/default/dhcp-server does not exist! - Aborting..."
+	exit 0
+fi
+
+# Read init script configuration (so far only interfaces the daemon
+# should listen on.)
+. /etc/default/dhcp-server
+
+case "$1" in
+	start)
+		echo -n "Starting DHCP server: "
+		test -d /var/lib/dhcp/ || mkdir -p /var/lib/dhcp/
+		test -f /var/lib/dhcp/dhcpd.leases || touch /var/lib/dhcp/dhcpd.leases	
+		start-stop-daemon -S -x /usr/sbin/dhcpd -- -q $INTERFACES
+		echo "."
+		;;
+	stop)
+		echo -n "Stopping DHCP server: dhcpd3"
+		start-stop-daemon -K -x /usr/sbin/dhcpd
+		echo "."
+		;;
+	restart | force-reload)
+		$0 stop
+		sleep 2
+		$0 start
+		if [ "$?" != "0" ]; then
+			exit 1
+		fi
+		;;
+	*)
+		echo "Usage: /etc/init.d/dhcp-server {start|stop|restart|force-reload}"
+		exit 1 
+esac
+
+exit 0
diff --git a/meta/recipes-connectivity/iproute2/iproute2.inc b/meta/recipes-connectivity/iproute2/iproute2.inc
new file mode 100644
index 0000000..a53a4e6
--- /dev/null
+++ b/meta/recipes-connectivity/iproute2/iproute2.inc
@@ -0,0 +1,38 @@
+SUMMARY = "TCP / IP networking and traffic control utilities"
+DESCRIPTION = "Iproute2 is a collection of utilities for controlling \
+TCP / IP networking and traffic control in Linux.  Of the utilities ip \
+and tc are the most important.  ip controls IPv4 and IPv6 \
+configuration and tc stands for traffic control."
+HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+                    file://ip/ip.c;beginline=3;endline=8;md5=689d691d0410a4b64d3899f8d6e31817"
+
+DEPENDS = "flex-native bison-native iptables elfutils"
+
+inherit update-alternatives
+
+EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"
+
+do_install () {
+    oe_runmake DESTDIR=${D} install
+    mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2
+    install -d ${D}${datadir}
+    mv ${D}/share/* ${D}${datadir}/ || true
+    rm ${D}/share -rf || true
+}
+
+# The .so files in iproute2-tc are modules, not traditional libraries
+INSANE_SKIP_${PN}-tc = "dev-so"
+
+PACKAGES =+ "${PN}-tc"
+FILES_${PN}-tc = "${base_sbindir}/tc* \
+                  ${libdir}/tc/*.so"
+
+FILES_${PN}-dbg += "${libdir}/tc/.debug"
+
+ALTERNATIVE_${PN} = "ip"
+ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
+ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch b/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
new file mode 100644
index 0000000..39c7d40
--- /dev/null
+++ b/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
@@ -0,0 +1,64 @@
+Subject: [PATCH] iproute2: de-bash scripts
+
+de-bash these two scripts to make iproute2 not depend on bash.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ ip/ifcfg |   15 ++++++++-------
+ ip/rtpr  |    2 +-
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/ip/ifcfg b/ip/ifcfg
+index 083d9df..60bcf1f 100644
+--- a/ip/ifcfg
++++ b/ip/ifcfg
+@@ -1,12 +1,13 @@
+-#! /bin/bash
++#! /bin/sh
+ 
+ CheckForwarding () {
+-  local sbase fwd
++  local sbase fwd forwarding
+   sbase=/proc/sys/net/ipv4/conf
+   fwd=0
+   if [ -d $sbase ]; then
+     for dir in $sbase/*/forwarding; do
+-      fwd=$[$fwd + `cat $dir`]
++      forwarding=`cat $dir`
++      fwd=$(($fwd+$forwarding))
+     done
+   else
+     fwd=2
+@@ -127,12 +128,12 @@ fi
+ arping -q -A -c 1 -I $dev $ipaddr
+ noarp=$?
+ ( sleep 2 ;
+-  arping -q -U -c 1 -I $dev $ipaddr ) >& /dev/null </dev/null &
++  arping -q -U -c 1 -I $dev $ipaddr ) > /dev/null 2>&1 </dev/null &
+ 
+-ip route add unreachable 224.0.0.0/24 >& /dev/null
+-ip route add unreachable 255.255.255.255 >& /dev/null
++ip route add unreachable 224.0.0.0/24 > /dev/null 2>&1
++ip route add unreachable 255.255.255.255 > /dev/null 2>&1
+ if [ `ip link ls $dev | grep -c MULTICAST` -ge 1 ]; then
+-  ip route add 224.0.0.0/4 dev $dev scope global >& /dev/null
++  ip route add 224.0.0.0/4 dev $dev scope global > /dev/null 2>&1
+ fi
+ 
+ if [ $fwd -eq 0 ]; then
+diff --git a/ip/rtpr b/ip/rtpr
+index c3629fd..674198d 100644
+--- a/ip/rtpr
++++ b/ip/rtpr
+@@ -1,4 +1,4 @@
+-#! /bin/bash
++#! /bin/sh
+ 
+ exec tr "[\\\\]" "[
+ ]"
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch b/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch
new file mode 100644
index 0000000..866609c
--- /dev/null
+++ b/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch
@@ -0,0 +1,32 @@
+From 85b0589b4843c03e8e6fd9416d71ea449a73c5c0 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Thu, 3 Nov 2011 10:46:16 +0100
+Subject: [PATCH] make configure cross compile safe
+
+According to Kevin Tian:
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+
+Index: iproute2-3.7.0/configure
+===================================================================
+--- iproute2-3.7.0.orig/configure
++++ iproute2-3.7.0/configure
+@@ -2,6 +2,7 @@
+ # This is not an autconf generated configure
+ #
+ INCLUDE=${1:-"$PWD/include"}
++SYSROOT=$1
+ 
+ # Make a temp directory in build tree.
+ TMPDIR=$(mktemp -d config.XXXXXX)
+@@ -158,7 +159,7 @@ check_ipt_lib_dir()
+ 		return
+ 	fi
+ 
+-	for dir in /lib /usr/lib /usr/local/lib
++	for dir in $SYSROOT/lib $SYSROOT/usr/lib $SYSROOT/usr/local/lib
+ 	do
+ 		for file in $dir/{xtables,iptables}/lib*t_*so ; do
+ 			if [ -f $file ]; then
diff --git a/meta/recipes-connectivity/iproute2/iproute2_4.1.1.bb b/meta/recipes-connectivity/iproute2/iproute2_4.1.1.bb
new file mode 100644
index 0000000..10db0ba
--- /dev/null
+++ b/meta/recipes-connectivity/iproute2/iproute2_4.1.1.bb
@@ -0,0 +1,12 @@
+require iproute2.inc
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \
+           file://configure-cross.patch \
+           file://0001-iproute2-de-bash-scripts.patch \
+          "
+SRC_URI[md5sum] = "39290cb3a55d38dd8d10e19a3094109f"
+SRC_URI[sha256sum] = "73077a989efb934450bd655cbd9aaddaa747cb696c64d0c9a3323768a6a8e66f"
+
+# CFLAGS are computed in Makefile and reference CCOPTS
+#
+EXTRA_OEMAKE_append = " CCOPTS='${CFLAGS}'"
diff --git a/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init b/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init
new file mode 100755
index 0000000..6f29e9c
--- /dev/null
+++ b/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/init
@@ -0,0 +1,78 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          irda
+# Required-Start:    $network $remote_fs
+# Required-Stop:     $network $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Infrared port support
+### END INIT INFO
+
+NAME="irattach"
+test -x "$IRDA_DAEMON" || IRDA_DAEMON=/usr/sbin/irattach
+test -z "$IRATTACH_PID" && IRATTACH_PID=/var/run/irattach.pid
+
+# Source function library.
+. /etc/init.d/functions
+
+module_id() {
+        awk 'BEGIN { FS=": " } /Hardware/ { print $2 } ' </proc/cpuinfo
+}
+
+if [ ! -f /etc/sysconfig/irda ]; then
+    case `module_id` in
+	"HP iPAQ H2200" | "HP iPAQ HX4700" | "HTC Universal")
+	    IRDA=yes
+	    DEVICE=/dev/ttyS2
+	    DONGLE=
+	    DISCOVERY=
+	    ;;
+	*)
+	    IRDA=yes
+	    DEVICE=/dev/ttyS1
+	    DONGLE=
+	    DISCOVERY=
+	    ;;
+    esac
+else
+    . /etc/sysconfig/irda
+fi
+
+# Check that irda is up.
+[ ${IRDA} = "no" ] && exit 0
+
+[ -f /usr/sbin/irattach ] || exit 0
+
+ARGS=
+if [ $DONGLE ]; then
+	ARGS="$ARGS -d $DONGLE"
+fi
+if [ "$DISCOVERY" = "yes" ];then
+	ARGS="$ARGS -s"
+fi
+
+case "$1" in
+  start)
+	echo -n "Starting IrDA: $NAME"
+	start-stop-daemon --start --quiet --exec "$IRDA_DAEMON" ${DEVICE} ${ARGS} --pidfile "$IRATTACH_PID"
+	sleep 1
+	[ -f /var/run/irattach.pid ] && echo " done" || echo " fail"
+	;;
+  stop)
+	echo "Stopping IrDA: $NAME"
+	start-stop-daemon --stop --quiet --exec "$IRDA_DAEMON" --pidfile "$IRATTACH_PID"
+	;;
+  restart|force-reload)
+	$0 stop
+	$0 start
+	;;
+  status)
+	status irattach
+	exit $?
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+	exit 1
+	;;
+esac
diff --git a/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch b/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch
new file mode 100644
index 0000000..e95fe35
--- /dev/null
+++ b/meta/recipes-connectivity/irda-utils/irda-utils-0.9.18/ldflags.patch
@@ -0,0 +1,75 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- irda-utils-0.9.18.orig/findchip/Makefile
++++ irda-utils-0.9.18/findchip/Makefile
+@@ -65,5 +65,5 @@ install: findchip
+
+ gfindchip: gfindchip.c
+	$(prn_cc)
+-	$(ECMD))$(CC) $(CFLAGS) `gtk-config --cflags`  $< -o $@ `gtk-config --libs`
++	$(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) `gtk-config --cflags`  $< -o $@ `gtk-config --libs`
+
+--- irda-utils-0.9.18.orig/irattach/Makefile
++++ irda-utils-0.9.18/irattach/Makefile
+@@ -49,13 +49,13 @@ all: $(TARGETS)
+
+ irattach: irattach.o util.o
+	$(prn_cc_o)
+-	$(ECMD)$(CC) $(CFLAGS) irattach.o util.o -o $@
++	$(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) irattach.o util.o -o $@
+
+
+
+ dongle_attach: dongle_attach.o
+	$(prn_cc_o)
+-	$(ECMD)$(CC) $(CFLAGS) dongle_attach.o -o $@
++	$(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) dongle_attach.o -o $@
+
+
+ install: $(TARGETS)
+--- irda-utils-0.9.18.orig/irdadump/Makefile
++++ irda-utils-0.9.18/irdadump/Makefile
+@@ -40,7 +40,7 @@ lib_irdadump.a: $(LIBIRDADUMP_OBJS)
+
+ irdadump: $(IRDADUMP_OBJS) $(LIBIRDADUMP_TARGET)
+	$(prn_cc_o)
+-	$(ECMD)$(CC) $(CFLAGS) `pkg-config --libs glib-2.0` -o  $(IRDADUMP_TARGET) $< $(LIBIRDADUMP_TARGET)
++	$(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) `pkg-config --libs glib-2.0` -o  $(IRDADUMP_TARGET) $< $(LIBIRDADUMP_TARGET)
+
+
+ .c.o:
+--- irda-utils-0.9.18.orig/irdaping/Makefile
++++ irda-utils-0.9.18/irdaping/Makefile
+@@ -56,7 +56,7 @@ all: $(TARGETS)
+
+ irdaping: $(OBJS)
+	$(prn_cc_o)
+-	$(ECMD)$(CC) $(CFLAGS) $(OBJS) -o $@
++	$(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
+
+
+ .c.o:
+--- irda-utils-0.9.18.orig/irnetd/Makefile
++++ irda-utils-0.9.18/irnetd/Makefile
+@@ -50,7 +50,7 @@ all: $(TARGETS)
+
+ irnetd: $(OBJS)
+	$(prn_cc_o)
+-	$(ECMD)$(CC) $(CFLAGS) $(OBJS) -o $@
++	$(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
+
+
+ install: irnetd
+--- irda-utils-0.9.18.orig/psion/Makefile
++++ irda-utils-0.9.18/psion/Makefile
+@@ -25,4 +25,4 @@ install: $(PSION_TARGETS)
+ CFLAGS += -g -I../include -Wall -Wstrict-prototypes $(RPM_OPT_FLAGS)
+ irpsion5:
+	$(prn_cc_o)
+-	$(ECMD)$(CC) $(CFLAGS) $(PSION_SRC) -o $@
+\ No newline at end of file
++	$(ECMD)$(CC) $(CFLAGS) $(LDFLAGS) $(PSION_SRC) -o $@
+\ No newline at end of file
diff --git a/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb b/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb
new file mode 100644
index 0000000..8ac3b18
--- /dev/null
+++ b/meta/recipes-connectivity/irda-utils/irda-utils_0.9.18.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Common files for IrDA"
+DESCRIPTION = "Provides common files needed to use IrDA. \
+IrDA allows communication over Infrared with other devices \
+such as phones and laptops."
+HOMEPAGE = "http://irda.sourceforge.net/"
+BUGTRACKER = "irda-users@lists.sourceforge.net"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://irdadump/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://smcinit/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+                    file://man/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://irdadump/irdadump.c;beginline=1;endline=24;md5=d78b9dce3cd78c2220250c9c7a2be178"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/irda/irda-utils-${PV}.tar.gz \
+           file://ldflags.patch \
+           file://init"
+
+SRC_URI[md5sum] = "84dc12aa4c3f61fccb8d8919bf4079bb"
+SRC_URI[sha256sum] = "61980551e46b2eaa9e17ad31cbc1a638074611fc33bff34163d10c7a67a9fdc6"
+
+inherit update-rc.d
+
+EXTRA_OEMAKE = "\
+    'CC=${CC}' \
+    'LD=${LD}' \
+    'CFLAGS=${CFLAGS}' \
+    'LDFLAGS=${LDFLAGS}' \
+    'SYS_INCLUDES=' \
+    'V=1' \
+"
+
+INITSCRIPT_NAME = "irattach"
+INITSCRIPT_PARAMS = "defaults 20"
+
+TARGETS ??= "irattach irdaping"
+do_compile () {
+	for t in ${TARGETS}; do
+		oe_runmake -C $t
+	done
+}
+
+do_install () {
+	install -d ${D}${sbindir}
+	for t in ${TARGETS}; do
+		oe_runmake -C $t ROOT="${D}" install
+	done
+
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+}
diff --git a/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch b/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch
new file mode 100644
index 0000000..a0a77b2
--- /dev/null
+++ b/meta/recipes-connectivity/iw/iw/0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch
@@ -0,0 +1,43 @@
+From 5310abba864cfe3a8b65af130729447604190b29 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 29 Nov 2011 17:03:27 +0100
+Subject: [PATCH] iw: version.sh: don't use git describe for versioning
+
+It will detect top-level git repositories like the Angstrom setup-scripts and break.
+
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ version.sh | 16 +---------------
+ 1 file changed, 1 insertion(+), 15 deletions(-)
+
+diff --git a/version.sh b/version.sh
+index 11d124b..5d423c4 100755
+--- a/version.sh
++++ b/version.sh
+@@ -3,21 +3,7 @@
+ VERSION="3.15"
+ OUT="$1"
+ 
+-if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
+-	git update-index --refresh --unmerged > /dev/null
+-	descr=$(git describe)
+-
+-	# on git builds check that the version number above
+-	# is correct...
+-	[ "${descr%%-*}" = "v$VERSION" ] || exit 2
+-
+-	v="${descr#v}"
+-	if git diff-index --name-only HEAD | read dummy ; then
+-		v="$v"-dirty
+-	fi
+-else
+-	v="$VERSION"
+-fi
++v="$VERSION"
+ 
+ echo '#include "iw.h"' > "$OUT"
+ echo "const char iw_version[] = \"$v\";" >> "$OUT"
+-- 
+1.7.7.3
diff --git a/meta/recipes-connectivity/iw/iw/separate-objdir.patch b/meta/recipes-connectivity/iw/iw/separate-objdir.patch
new file mode 100644
index 0000000..883f8b2
--- /dev/null
+++ b/meta/recipes-connectivity/iw/iw/separate-objdir.patch
@@ -0,0 +1,57 @@
+From 9e27fc2e1b3dc8c36ef6a502edffc3a3d84d9dd9 Mon Sep 17 00:00:00 2001
+From: Christopher Larson <chris_larson@mentor.com>
+Date: Wed, 26 Aug 2015 17:23:48 -0700
+Subject: [PATCH] Support separation of SRCDIR and OBJDIR
+
+Typical use of VPATH to locate the sources.
+
+Upstream-Status: Pending
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+---
+ Makefile   | 7 +++++--
+ version.sh | 2 +-
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 548591a..da8d33a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,5 +1,8 @@
+ MAKEFLAGS += --no-print-directory
+ 
++SRCDIR ?= $(dir $(lastword $(MAKEFILE_LIST)))
++OBJDIR ?= $(PWD)
++VPATH = $(SRCDIR)
+ PREFIX ?= /usr
+ SBINDIR ?= $(PREFIX)/sbin
+ MANDIR ?= $(PREFIX)/share/man
+@@ -95,11 +98,11 @@ VERSION_OBJS := $(filter-out version.o, $(OBJS))
+ version.c: version.sh $(patsubst %.o,%.c,$(VERSION_OBJS)) nl80211.h iw.h Makefile \
+ 		$(wildcard .git/index .git/refs/tags)
+ 	@$(NQ) ' GEN ' $@
+-	$(Q)./version.sh $@
++	$(Q)cd $(SRCDIR) && ./version.sh $(OBJDIR)/$@
+ 
+ %.o: %.c iw.h nl80211.h
+ 	@$(NQ) ' CC  ' $@
+-	$(Q)$(CC) $(CFLAGS) -c -o $@ $<
++	$(Q)$(CC) -I$(SRCDIR) $(CFLAGS) -c -o $@ $<
+ 
+ ifeq ($(IW_ANDROID_BUILD),)
+ iw:	$(OBJS)
+diff --git a/version.sh b/version.sh
+index 5354383..fa954cf 100755
+--- a/version.sh
++++ b/version.sh
+@@ -5,5 +5,5 @@ OUT="$1"
+ 
+ v="$VERSION"
+ 
+-echo '#include "iw.h"' > "$OUT"
++echo '#include <iw.h>' > "$OUT"
+ echo "const char iw_version[] = \"$v\";" >> "$OUT"
+-- 
+2.2.1
+
diff --git a/meta/recipes-connectivity/iw/iw_4.1.bb b/meta/recipes-connectivity/iw/iw_4.1.bb
new file mode 100644
index 0000000..fafb0e3
--- /dev/null
+++ b/meta/recipes-connectivity/iw/iw_4.1.bb
@@ -0,0 +1,33 @@
+SUMMARY = "nl80211 based CLI configuration utility for wireless devices"
+DESCRIPTION = "iw is a new nl80211 based CLI configuration utility for \
+wireless devices. It supports almost all new drivers that have been added \
+to the kernel recently. "
+HOMEPAGE = "http://wireless.kernel.org/en/users/Documentation/iw"
+SECTION = "base"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=878618a5c4af25e9b93ef0be1a93f774"
+
+DEPENDS = "libnl"
+
+SRC_URI = "http://www.kernel.org/pub/software/network/iw/${BP}.tar.gz \
+           file://0001-iw-version.sh-don-t-use-git-describe-for-versioning.patch \
+           file://separate-objdir.patch \
+"
+
+SRC_URI[md5sum] = "68c282285c71c956069957e9ca10a6a7"
+SRC_URI[sha256sum] = "14bfc627b37f7f607e4ffa63a70ded15fa2ea85177f703cb17d7fe36f9c8f33d"
+
+inherit pkgconfig
+
+EXTRA_OEMAKE = "\
+    -f '${S}/Makefile' \
+    \
+    'PREFIX=${prefix}' \
+    'SBINDIR=${sbindir}' \
+    'MANDIR=${mandir}' \
+"
+B = "${WORKDIR}/build"
+
+do_install() {
+    oe_runmake 'DESTDIR=${D}' install
+}
diff --git a/meta/recipes-connectivity/libnss-mdns/libnss-mdns_0.10.bb b/meta/recipes-connectivity/libnss-mdns/libnss-mdns_0.10.bb
new file mode 100644
index 0000000..0b936ef
--- /dev/null
+++ b/meta/recipes-connectivity/libnss-mdns/libnss-mdns_0.10.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Name Service Switch module for Multicast DNS (zeroconf) name resolution"
+HOMEPAGE = "http://0pointer.de/lennart/projects/nss-mdns/"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+DEPENDS = "avahi"
+PR = "r7"
+
+SRC_URI = "http://0pointer.de/lennart/projects/nss-mdns/nss-mdns-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "03938f17646efbb50aa70ba5f99f51d7"
+SRC_URI[sha256sum] = "1e683c2e7c3921814706d62fbbd3e9cbf493a75fa00255e0e715508d8134fa6d"
+
+S = "${WORKDIR}/nss-mdns-${PV}"
+
+inherit autotools
+
+EXTRA_OECONF = "--libdir=${base_libdir} --disable-lynx --enable-avahi"
+
+# suppress warning, but don't bother with autonamer
+LEAD_SONAME = "libnss_mdns.so"
+DEBIANNAME_${PN} = "libnss-mdns"
+
+RDEPENDS_${PN} = "avahi-daemon"
+
+pkg_postinst_${PN} () {
+	sed -e '/^hosts:/s/\s*\<mdns\>//' \
+		-e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 mdns4_minimal [NOTFOUND=return]\3\4 mdns\5/' \
+		-i $D${sysconfdir}/nsswitch.conf
+}
+
+pkg_prerm_${PN} () {
+	sed -e '/^hosts:/s/\s*\<mdns\>//' \
+		-e '/^hosts:/s/\s*mdns4_minimal\s\+\[NOTFOUND=return\]//' \
+		-i $D${sysconfdir}/nsswitch.conf
+}
diff --git a/meta/recipes-connectivity/libpcap/libpcap.inc b/meta/recipes-connectivity/libpcap/libpcap.inc
new file mode 100644
index 0000000..0873c24
--- /dev/null
+++ b/meta/recipes-connectivity/libpcap/libpcap.inc
@@ -0,0 +1,40 @@
+SUMMARY = "Interface for user-level network packet capture"
+DESCRIPTION = "Libpcap provides a portable framework for low-level network \
+monitoring.  Libpcap can provide network statistics collection, \
+security monitoring and network debugging."
+HOMEPAGE = "http://www.tcpdump.org/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=53067&atid=469577"
+SECTION = "libs/network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867 \
+                    file://pcap.h;beginline=1;endline=32;md5=39af3510e011f34b8872f120b1dc31d2"
+DEPENDS = "flex-native bison-native"
+
+INC_PR = "r5"
+
+SRC_URI = "http://www.tcpdump.org/release/${BP}.tar.gz"
+
+BINCONFIG = "${bindir}/pcap-config"
+
+inherit autotools binconfig-disabled pkgconfig bluetooth
+
+EXTRA_OECONF = "--with-pcap=linux"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)}"
+PACKAGECONFIG[bluez4] = "--enable-bluetooth,--disable-bluetooth,bluez4"
+# Add a dummy PACKAGECONFIG for bluez5 since it is not supported by libpcap.
+PACKAGECONFIG[bluez5] = ",,"
+PACKAGECONFIG[canusb] = "--enable-canusb,--enable-canusb=no,libusb"
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+PACKAGECONFIG[libnl] = "--with-libnl,--without-libnl,libnl"
+
+CPPFLAGS_prepend = "-I${S} "
+CFLAGS_prepend = "-I${S} "
+CXXFLAGS_prepend = "-I${S} "
+
+do_configure_prepend () {
+    if [ ! -e ${S}/acinclude.m4 ]; then
+        cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+    fi
+    sed -i -e's,^V_RPATH_OPT=.*$,V_RPATH_OPT=,' ${S}/pcap-config.in
+}
diff --git a/meta/recipes-connectivity/libpcap/libpcap/aclocal.patch b/meta/recipes-connectivity/libpcap/libpcap/aclocal.patch
new file mode 100644
index 0000000..2151982
--- /dev/null
+++ b/meta/recipes-connectivity/libpcap/libpcap/aclocal.patch
@@ -0,0 +1,167 @@
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN libpcap-1.1.1-orig/aclocal.m4 libpcap-1.1.1/aclocal.m4
+--- libpcap-1.1.1-orig/aclocal.m4	2010-06-29 10:46:32.815117569 +0800
++++ libpcap-1.1.1/aclocal.m4	2010-06-29 10:49:17.150149949 +0800
+@@ -37,7 +37,7 @@
+ dnl AC_LBL_C_INIT.  Now, we run AC_LBL_C_INIT_BEFORE_CC, AC_PROG_CC,
+ dnl and AC_LBL_C_INIT at the top level.
+ dnl
+-AC_DEFUN(AC_LBL_C_INIT_BEFORE_CC,
++AC_DEFUN([AC_LBL_C_INIT_BEFORE_CC],
+ [
+     AC_BEFORE([$0], [AC_LBL_C_INIT])
+     AC_BEFORE([$0], [AC_PROG_CC])
+@@ -90,7 +90,7 @@
+ dnl     LDFLAGS
+ dnl     LBL_CFLAGS
+ dnl
+-AC_DEFUN(AC_LBL_C_INIT,
++AC_DEFUN([AC_LBL_C_INIT],
+ [
+     AC_BEFORE([$0], [AC_LBL_FIXINCLUDES])
+     AC_BEFORE([$0], [AC_LBL_DEVEL])
+@@ -217,7 +217,7 @@
+ dnl	V_SONAME_OPT
+ dnl	V_RPATH_OPT
+ dnl
+-AC_DEFUN(AC_LBL_SHLIBS_INIT,
++AC_DEFUN([AC_LBL_SHLIBS_INIT],
+     [AC_PREREQ(2.50)
+     if test "$GCC" = yes ; then
+ 	    #
+@@ -361,7 +361,7 @@
+ # Make sure we use the V_CCOPT flags, because some of those might
+ # disable inlining.
+ #
+-AC_DEFUN(AC_LBL_C_INLINE,
++AC_DEFUN([AC_LBL_C_INLINE],
+     [AC_MSG_CHECKING(for inline)
+     save_CFLAGS="$CFLAGS"
+     CFLAGS="$V_CCOPT"
+@@ -407,7 +407,7 @@
+ dnl
+ dnl	AC_LBL_FIXINCLUDES
+ dnl
+-AC_DEFUN(AC_LBL_FIXINCLUDES,
++AC_DEFUN([AC_LBL_FIXINCLUDES],
+     [if test "$GCC" = yes ; then
+ 	    AC_MSG_CHECKING(for ANSI ioctl definitions)
+ 	    AC_CACHE_VAL(ac_cv_lbl_gcc_fixincludes,
+@@ -453,7 +453,7 @@
+ dnl	$2 (yacc appended)
+ dnl	$3 (optional flex and bison -P prefix)
+ dnl
+-AC_DEFUN(AC_LBL_LEX_AND_YACC,
++AC_DEFUN([AC_LBL_LEX_AND_YACC],
+     [AC_ARG_WITH(flex, [  --without-flex          don't use flex])
+     AC_ARG_WITH(bison, [  --without-bison         don't use bison])
+     if test "$with_flex" = no ; then
+@@ -506,7 +506,7 @@
+ dnl
+ dnl	DECLWAITSTATUS (defined)
+ dnl
+-AC_DEFUN(AC_LBL_UNION_WAIT,
++AC_DEFUN([AC_LBL_UNION_WAIT],
+     [AC_MSG_CHECKING(if union wait is used)
+     AC_CACHE_VAL(ac_cv_lbl_union_wait,
+ 	AC_TRY_COMPILE([
+@@ -535,7 +535,7 @@
+ dnl
+ dnl	HAVE_SOCKADDR_SA_LEN (defined)
+ dnl
+-AC_DEFUN(AC_LBL_SOCKADDR_SA_LEN,
++AC_DEFUN([AC_LBL_SOCKADDR_SA_LEN],
+     [AC_MSG_CHECKING(if sockaddr struct has the sa_len member)
+     AC_CACHE_VAL(ac_cv_lbl_sockaddr_has_sa_len,
+ 	AC_TRY_COMPILE([
+@@ -560,7 +560,7 @@
+ dnl
+ dnl	HAVE_SOCKADDR_STORAGE (defined)
+ dnl
+-AC_DEFUN(AC_LBL_SOCKADDR_STORAGE,
++AC_DEFUN([AC_LBL_SOCKADDR_STORAGE],
+     [AC_MSG_CHECKING(if sockaddr_storage struct exists)
+     AC_CACHE_VAL(ac_cv_lbl_has_sockaddr_storage,
+ 	AC_TRY_COMPILE([
+@@ -593,7 +593,7 @@
+ dnl won't be using code that would use that member, or we wouldn't
+ dnl compile in any case).
+ dnl
+-AC_DEFUN(AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1,
++AC_DEFUN([AC_LBL_HP_PPA_INFO_T_DL_MODULE_ID_1],
+     [AC_MSG_CHECKING(if dl_hp_ppa_info_t struct has dl_module_id_1 member)
+     AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1,
+ 	AC_TRY_COMPILE([
+@@ -619,7 +619,7 @@
+ dnl
+ dnl	ac_cv_lbl_have_run_path (yes or no)
+ dnl
+-AC_DEFUN(AC_LBL_HAVE_RUN_PATH,
++AC_DEFUN([AC_LBL_HAVE_RUN_PATH],
+     [AC_MSG_CHECKING(for ${CC-cc} -R)
+     AC_CACHE_VAL(ac_cv_lbl_have_run_path,
+ 	[echo 'main(){}' > conftest.c
+@@ -644,7 +644,7 @@
+ dnl
+ dnl	LBL_ALIGN (DEFINED)
+ dnl
+-AC_DEFUN(AC_LBL_UNALIGNED_ACCESS,
++AC_DEFUN([AC_LBL_UNALIGNED_ACCESS],
+     [AC_MSG_CHECKING(if unaligned accesses fail)
+     AC_CACHE_VAL(ac_cv_lbl_unaligned_fail,
+ 	[case "$host_cpu" in
+@@ -749,7 +749,7 @@
+ dnl	HAVE_OS_PROTO_H (defined)
+ dnl	os-proto.h (symlinked)
+ dnl
+-AC_DEFUN(AC_LBL_DEVEL,
++AC_DEFUN([AC_LBL_DEVEL],
+     [rm -f os-proto.h
+     if test "${LBL_CFLAGS+set}" = set; then
+ 	    $1="$$1 ${LBL_CFLAGS}"
+@@ -886,7 +886,7 @@
+ dnl statically and happen to have a libresolv.a lying around (and no
+ dnl libnsl.a).
+ dnl
+-AC_DEFUN(AC_LBL_LIBRARY_NET, [
++AC_DEFUN([AC_LBL_LIBRARY_NET], [
+     # Most operating systems have gethostbyname() in the default searched
+     # libraries (i.e. libc):
+     # Some OSes (eg. Solaris) place it in libnsl
+@@ -909,7 +909,7 @@
+ dnl Test for __attribute__
+ dnl
+ 
+-AC_DEFUN(AC_C___ATTRIBUTE__, [
++AC_DEFUN([AC_C___ATTRIBUTE__], [
+ AC_MSG_CHECKING(for __attribute__)
+ AC_CACHE_VAL(ac_cv___attribute__, [
+ AC_COMPILE_IFELSE(
+@@ -947,7 +947,7 @@
+ dnl
+ dnl -Scott Barron
+ dnl
+-AC_DEFUN(AC_LBL_TPACKET_STATS,
++AC_DEFUN([AC_LBL_TPACKET_STATS],
+    [AC_MSG_CHECKING(if if_packet.h has tpacket_stats defined)
+    AC_CACHE_VAL(ac_cv_lbl_tpacket_stats,
+    AC_TRY_COMPILE([
+@@ -976,7 +976,7 @@
+ dnl doesn't have that member (which is OK, as either we won't be using
+ dnl code that would use that member, or we wouldn't compile in any case).
+ dnl
+-AC_DEFUN(AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI,
++AC_DEFUN([AC_LBL_LINUX_TPACKET_AUXDATA_TP_VLAN_TCI],
+     [AC_MSG_CHECKING(if tpacket_auxdata struct has tp_vlan_tci member)
+     AC_CACHE_VAL(ac_cv_lbl_dl_hp_ppa_info_t_has_dl_module_id_1,
+ 	AC_TRY_COMPILE([
+@@ -1003,7 +1003,7 @@
+ dnl 
+ dnl 	HAVE_DLPI_PASSIVE (defined)
+ dnl
+-AC_DEFUN(AC_LBL_DL_PASSIVE_REQ_T,
++AC_DEFUN([AC_LBL_DL_PASSIVE_REQ_T],
+         [AC_MSG_CHECKING(if dl_passive_req_t struct exists)
+        AC_CACHE_VAL(ac_cv_lbl_has_dl_passive_req_t,
+                 AC_TRY_COMPILE([
diff --git a/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch b/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
new file mode 100644
index 0000000..b861513
--- /dev/null
+++ b/meta/recipes-connectivity/libpcap/libpcap/libpcap-pkgconfig-support.patch
@@ -0,0 +1,71 @@
+From 8887132e85892a72a84ca3878e60f254ad2ce939 Mon Sep 17 00:00:00 2001
+From: Joe MacDonald <joe_macdonald@mentor.com>
+Date: Tue, 24 Feb 2015 15:56:06 -0500
+Subject: [PATCH] libpcap: pkgconfig support
+
+Adding basic structure to support pkg-config.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
+---
+ Makefile.in   |  5 +++++
+ configure.in  |  1 +
+ libpcap.pc.in | 10 ++++++++++
+ 3 files changed, 16 insertions(+)
+ create mode 100644 libpcap.pc.in
+
+diff --git a/Makefile.in b/Makefile.in
+index 1c2d745..1f25faf 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -60,6 +60,10 @@ V_RPATH_OPT = @V_RPATH_OPT@
+ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
+ PROG=libpcap
+ 
++# pkgconfig support
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = libpcap.pc
++
+ # Standard CFLAGS
+ FULL_CFLAGS = $(CCOPT) $(INCLS) $(DEFS) $(CFLAGS)
+ 
+@@ -275,6 +279,7 @@ EXTRA_DIST = \
+ 	lbl/os-solaris2.h \
+ 	lbl/os-sunos4.h \
+ 	lbl/os-ultrix4.h \
++	libpcap.pc \
+ 	missing/snprintf.c \
+ 	mkdep \
+ 	msdos/bin2c.c \
+diff --git a/configure.in b/configure.in
+index 8f5c86b..fb51b35 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1700,6 +1700,7 @@ esac
+ AC_PROG_INSTALL
+ 
+ AC_CONFIG_HEADER(config.h)
++AC_CONFIG_FILES([libpcap.pc])
+ 
+ AC_OUTPUT_COMMANDS([if test -f .devel; then
+ 	echo timestamp > stamp-h
+diff --git a/libpcap.pc.in b/libpcap.pc.in
+new file mode 100644
+index 0000000..4f78ad8
+--- /dev/null
++++ b/libpcap.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: libpcap
++Description: System-independent interface for user-level packet capture.
++Version: @VERSION@
++Libs: -L${libdir} -lpcap
++Cflags: -I${includedir}
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/libpcap/libpcap_1.6.2.bb b/meta/recipes-connectivity/libpcap/libpcap_1.6.2.bb
new file mode 100644
index 0000000..611543e
--- /dev/null
+++ b/meta/recipes-connectivity/libpcap/libpcap_1.6.2.bb
@@ -0,0 +1,26 @@
+require libpcap.inc
+
+SRC_URI += "file://aclocal.patch \
+            file://libpcap-pkgconfig-support.patch \
+           "
+SRC_URI[md5sum] = "5f14191c1a684a75532c739c2c4059fa"
+SRC_URI[sha256sum] = "5db3e2998f1eeba2c76da55da5d474248fe19c44f49e15cac8a796a2c7e19690"
+
+#
+# make install doesn't cover the shared lib
+# make install-shared is just broken (no symlinks)
+#
+
+do_configure_prepend () {
+    #remove hardcoded references to /usr/include
+    sed 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i ${S}/configure.in
+}
+
+do_install_prepend () {
+    install -d ${D}${libdir}
+    install -d ${D}${bindir}
+    oe_runmake install-shared DESTDIR=${D}
+    oe_libinstall -a -so libpcap ${D}${libdir}
+    sed "s|@VERSION@|${PV}|" -i ${B}/libpcap.pc
+    install -D -m 0644 libpcap.pc ${D}${libdir}/pkgconfig/libpcap.pc
+}
diff --git a/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb b/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb
new file mode 100644
index 0000000..31cf2bb
--- /dev/null
+++ b/meta/recipes-connectivity/mobile-broadband-provider-info/mobile-broadband-provider-info_git.bb
@@ -0,0 +1,12 @@
+SUMMARY = "Mobile Broadband Service Provider Database"
+SECTION = "network"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=87964579b2a8ece4bc6744d2dc9a8b04"
+SRCREV = "d06ebd314a7cdd087d38e4966c19de42c8c55246"
+PV = "20140618+gitr${SRCPV}"
+PE = "1"
+
+SRC_URI = "git://git.gnome.org/mobile-broadband-provider-info"
+S = "${WORKDIR}/git"
+
+inherit autotools
diff --git a/meta/recipes-connectivity/neard/neard/Makefile.am-do-not-ship-version.h.patch b/meta/recipes-connectivity/neard/neard/Makefile.am-do-not-ship-version.h.patch
new file mode 100644
index 0000000..16875e0
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard/Makefile.am-do-not-ship-version.h.patch
@@ -0,0 +1,36 @@
+From bfd32d68cfc9f1e31dab88e07446d1c02bc80b5e Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 12 Feb 2015 00:39:29 -0800
+Subject: [PATCH] Makefile.am: do not ship version.h
+
+The HEADERS' name has been changed to pkginclude_HEADERS, so use
+nodist_pkginclude_HEADERS, otherwise version.h would be shipped.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.am |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 3334790..69cd58f 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -10,11 +10,11 @@ pkginclude_HEADERS = include/types.h include/log.h include/plugin.h \
+ 			include/tlv.h include/setting.h include/device.h \
+ 			include/nfc_copy.h include/snep.h
+ 
+-nodist_include_HEADERS = include/version.h
++nodist_pkginclude_HEADERS = include/version.h
+ 
+ noinst_HEADERS = include/dbus.h
+ 
+-local_headers = $(foreach file,$(pkginclude_HEADERS) $(nodist_include_HEADERS) \
++local_headers = $(foreach file,$(pkginclude_HEADERS) $(nodist_pkginclude_HEADERS) \
+ 			$(noinst_HEADERS), include/near/$(notdir $(file)))
+ 
+ gdbus_sources = gdbus/gdbus.h gdbus/mainloop.c gdbus/watch.c \
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch b/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch
new file mode 100644
index 0000000..4660676
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch
@@ -0,0 +1,33 @@
+From 43acc56d5506c7e318f717fb3634bc16e3438913 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 15 Jan 2015 18:12:07 -0800
+Subject: [PATCH] Makefile.am: fix parallel issue
+
+There might be no src dir if src/builtin.h runs earlier, create it to
+fix the race issue:
+
+src/genbuiltin nfctype1 nfctype2 nfctype3 nfctype4 p2p > src/builtin.h
+/bin/sh: src/builtin.h: No such file or directory
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.am |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index 3241311..a43eaa2 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -164,6 +164,7 @@ MAINTAINERCLEANFILES = Makefile.in \
+ src/plugin.$(OBJEXT): src/builtin.h
+ 
+ src/builtin.h: src/genbuiltin $(builtin_sources)
++	$(AM_V_at)$(MKDIR_P) src
+ 	$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
+ 
+ $(src_neard_OBJECTS) \
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/neard/neard/neard.in b/meta/recipes-connectivity/neard/neard/neard.in
new file mode 100644
index 0000000..a47d4d9
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard/neard.in
@@ -0,0 +1,54 @@
+#!/bin/sh
+#
+# start/stop neard daemon.
+
+### BEGIN INIT INFO
+# Provides:          neard
+# Required-Start:    $network
+# Required-Stop:     $network
+# Default-Start:     S 2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: NFC daemon
+# Description:       neard is a daemon used to enable NFC features
+### END INIT INFO
+
+DAEMON=@installpath@/neard
+PIDFILE=/var/run/neard.pid
+DESC="Linux NFC daemon"
+
+if [ -f /etc/default/neard ] ; then
+	. /etc/default/neard
+fi
+
+set -e
+
+do_start() {
+	$DAEMON
+}
+
+do_stop() {
+	start-stop-daemon --stop --name neard --quiet
+}
+
+case "$1" in
+  start)
+	echo "Starting $DESC"
+	do_start
+	;;
+  stop)
+	echo "Stopping $DESC"
+	do_stop
+	;;
+  restart|force-reload)
+	echo "Restarting $DESC"
+	do_stop
+	sleep 1
+	do_start
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-connectivity/neard/neard_0.15.bb b/meta/recipes-connectivity/neard/neard_0.15.bb
new file mode 100644
index 0000000..8adf70c
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard_0.15.bb
@@ -0,0 +1,61 @@
+SUMMARY = "Linux NFC daemon"
+DESCRIPTION = "A daemon for the Linux Near Field Communication stack"
+HOMEPAGE = "http://01.org/linux-nfc"
+LICENSE = "GPLv2"
+
+DEPENDS = "dbus glib-2.0 libnl"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/network/nfc/${BP}.tar.xz \
+           file://neard.in \
+           file://Makefile.am-fix-parallel-issue.patch \
+           file://Makefile.am-do-not-ship-version.h.patch \
+          "
+SRC_URI[md5sum] = "b746ce62eeef88e8de90765e00a75a1c"
+SRC_URI[sha256sum] = "651f6513d32cdaf8a426255d03aff38a6620a89b0567ec2b36606c6330a93353"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ file://src/near.h;beginline=1;endline=20;md5=358e4deefef251a4761e1ffacc965d13 \
+ "
+
+inherit autotools pkgconfig systemd update-rc.d bluetooth
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+
+PACKAGECONFIG[systemd] = "--enable-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/ --with-systemduserunitdir=${systemd_unitdir}/user/,--disable-systemd"
+
+EXTRA_OECONF += "--enable-tools"
+
+# This would copy neard start-stop shell and test scripts
+do_install_append() {
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+		install -d ${D}${sysconfdir}/init.d/
+		sed "s:@installpath@:${libexecdir}/nfc:" ${WORKDIR}/neard.in \
+		  > ${D}${sysconfdir}/init.d/neard
+		chmod 0755 ${D}${sysconfdir}/init.d/neard
+	fi
+
+	# Install the tests for neard-tests
+	install -d ${D}${libdir}/neard
+	install -m 0755 ${S}/test/* ${D}${libdir}/${BPN}/
+	install -m 0755 ${B}/tools/nfctool/nfctool ${D}${libdir}/${BPN}/
+}
+
+PACKAGES =+ "${PN}-tests"
+
+FILES_${PN}-tests = "${libdir}/${BPN}/*-test"
+FILES_${PN}-dbg += "${libdir}/${BPN}/*/.debug"
+
+RDEPENDS_${PN} = "dbus python python-dbus python-pygobject"
+
+# Bluez & Wifi are not mandatory except for handover
+RRECOMMENDS_${PN} = "\
+                     ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
+                     ${@bb.utils.contains('DISTRO_FEATURES', 'wifi','wpa-supplicant', '', d)} \
+                    "
+
+RDEPENDS_${PN}-tests = "python python-dbus python-pygobject"
+
+INITSCRIPT_NAME = "neard"
+INITSCRIPT_PARAMS = "defaults 64"
+
+SYSTEMD_SERVICE_${PN} = "neard.service"
diff --git a/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch b/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch
new file mode 100644
index 0000000..8500229
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/files/nfs-utils-debianize-start-statd.patch
@@ -0,0 +1,41 @@
+[PATCH] nfs-utils: debianize start-statd
+
+Upstream-Status: Pending
+
+make start-statd command to use nfscommon configure, too.
+
+Signed-off-by: Henrik Riomar <henrik.riomar@ericsson.com>
+Signed-off-by: Li Wang <li.wang@windriver.com>
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ utils/statd/start-statd | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/utils/statd/start-statd b/utils/statd/start-statd
+index ec9383b..3969b8c 100755
+--- a/utils/statd/start-statd
++++ b/utils/statd/start-statd
+@@ -6,6 +6,13 @@
+ # site.
+ PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+ 
++# Read config
++DEFAULTFILE=/etc/default/nfs-common
++NEED_IDMAPD=
++if [ -f $DEFAULTFILE ]; then
++    . $DEFAULTFILE
++fi
++
+ # First try systemd if it's installed.
+ if systemctl --help >/dev/null 2>&1; then
+     # Quit only if the call worked.
+@@ -13,4 +20,4 @@ if systemctl --help >/dev/null 2>&1; then
+ fi
+ 
+ # Fall back to launching it ourselves.
+-exec rpc.statd --no-notify
++exec rpc.statd --no-notify $STATDOPTS
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/nfs-utils/libnfsidmap/0001-include-sys-types.h-for-getting-u_-typedefs.patch b/meta/recipes-connectivity/nfs-utils/libnfsidmap/0001-include-sys-types.h-for-getting-u_-typedefs.patch
new file mode 100644
index 0000000..4ac5290
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/libnfsidmap/0001-include-sys-types.h-for-getting-u_-typedefs.patch
@@ -0,0 +1,27 @@
+From a5e95a42e7bceddc9ecad06694c1a0588f4bafc8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 14 Apr 2015 07:22:47 -0700
+Subject: [PATCH] include sys/types.h for getting u_* typedefs
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ cfg.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cfg.h b/cfg.h
+index d4d4cab..fe49e8f 100644
+--- a/cfg.h
++++ b/cfg.h
+@@ -33,6 +33,7 @@
+ #ifndef _CONF_H_
+ #define _CONF_H_
+ 
++#include <sys/types.h>
+ #include "queue.h"
+ 
+ struct conf_list_node {
+-- 
+2.1.4
+
diff --git a/meta/recipes-connectivity/nfs-utils/libnfsidmap/Set_nobody_user_group.patch b/meta/recipes-connectivity/nfs-utils/libnfsidmap/Set_nobody_user_group.patch
new file mode 100644
index 0000000..4633da9
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/libnfsidmap/Set_nobody_user_group.patch
@@ -0,0 +1,18 @@
+Set nobody user and group
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+--- a/idmapd.conf
++++ b/idmapd.conf
+@@ -17,8 +17,8 @@
+ 
+ [Mapping]
+ 
+-#Nobody-User = nobody
+-#Nobody-Group = nobody
++Nobody-User = nobody
++Nobody-Group = nogroup
+ 
+ [Translation]
+ 
diff --git a/meta/recipes-connectivity/nfs-utils/libnfsidmap/fix-ac-prereq.patch b/meta/recipes-connectivity/nfs-utils/libnfsidmap/fix-ac-prereq.patch
new file mode 100644
index 0000000..d81c7c5
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/libnfsidmap/fix-ac-prereq.patch
@@ -0,0 +1,13 @@
+Upstream-Status: Inappropriate [configuration]
+
+--- a/configure.in
++++ b/configure.in
+@@ -1,7 +1,7 @@
+ #                                               -*- Autoconf -*-
+ # Process this file with autoconf to produce a configure script.
+ 
+-AC_PREREQ([2.68])
++AC_PREREQ([2.65])
+ AC_INIT([libnfsidmap],[0.25],[linux-nfs@vger.kernel.org])
+ AC_CONFIG_SRCDIR([nfsidmap.h])
+ AC_CONFIG_MACRO_DIR([m4])
diff --git a/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb b/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb
new file mode 100644
index 0000000..5b578e9
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb
@@ -0,0 +1,25 @@
+SUMMARY = "NFS id mapping library"
+HOMEPAGE = "http://www.citi.umich.edu/projects/nfsv4/linux/"
+SECTION = "libs"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d9c6a2a0ca6017fda7cd905ed2739b37"
+
+SRC_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${BPN}-${PV}.tar.gz \
+           file://fix-ac-prereq.patch \
+           file://Set_nobody_user_group.patch \
+           file://0001-include-sys-types.h-for-getting-u_-typedefs.patch \
+          "
+
+SRC_URI[md5sum] = "2ac4893c92716add1a1447ae01df77ab"
+SRC_URI[sha256sum] = "656d245d84400e1030f8f40a5a27da76370690c4a932baf249110f047fe7efcf"
+
+inherit autotools
+
+EXTRA_OECONF = "--disable-ldap"
+
+do_install_append () {
+	install -d ${D}${sysconfdir}/
+	install -m 0644 ${WORKDIR}/${BPN}-${PV}/idmapd.conf ${D}${sysconfdir}/idmapd.conf
+}
+
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch
new file mode 100644
index 0000000..7025fb5
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-configure-Allow-to-explicitly-disable-nfsidmap.patch
@@ -0,0 +1,43 @@
+From 9b84cff305866abd150cf1a4c6e7e5ebf8a7eb3a Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 15 Nov 2013 23:21:35 +0100
+Subject: [PATCH] configure: Allow to explicitly disable nfsidmap
+
+* keyutils availability is autodetected and builds aren't reproducible
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure.ac | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index bf433d6..28a8f62 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -69,6 +69,12 @@ AC_ARG_ENABLE(nfsv4,
+ 	AC_SUBST(enable_nfsv4)
+ 	AM_CONDITIONAL(CONFIG_NFSV4, [test "$enable_nfsv4" = "yes"])
+ 
++AC_ARG_ENABLE(nfsidmap,
++        [AC_HELP_STRING([--enable-nfsidmap],
++                        [enable support for NFSv4 idmapper @<:@default=yes@:>@])],
++        enable_nfsidmap=$enableval,
++        enable_nfsidmap=yes)
++
+ AC_ARG_ENABLE(nfsv41,
+ 	[AC_HELP_STRING([--enable-nfsv41],
+                         [enable support for NFSv41 @<:@default=yes@:>@])],
+@@ -296,7 +302,7 @@ fi
+ 
+ dnl enable nfsidmap when its support by libnfsidmap
+ AM_CONDITIONAL(CONFIG_NFSDCLTRACK, [test "$enable_nfsdcltrack" = "yes" ])
+-AM_CONDITIONAL(CONFIG_NFSIDMAP, [test "$ac_cv_header_keyutils_h$ac_cv_lib_nfsidmap_nfs4_owner_to_uid" = "yesyes"])
++AM_CONDITIONAL(CONFIG_NFSIDMAP, [test "$enable_nfsidmap$ac_cv_header_keyutils_h$ac_cv_lib_nfsidmap_nfs4_owner_to_uid" = "yesyesyes"])
+ 
+ 
+ if test "$knfsd_cv_glibc2" = no; then
+-- 
+1.8.4.3
+
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
new file mode 100644
index 0000000..613ddc0
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-mountd.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=NFS Mount Daemon
+After=rpcbind.service nfs-server.service
+Requires=rpcbind.service nfs-server.service
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
+ExecStart=@SBINDIR@/rpc.mountd -F $MOUNTD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
new file mode 100644
index 0000000..147d7a7
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-server.service
@@ -0,0 +1,18 @@
+[Unit]
+Description=NFS Server
+Requires=rpcbind.service nfs-mountd.service
+After=rpcbind.service
+
+[Service]
+Type=oneshot
+EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
+ExecStartPre=@SBINDIR@/exportfs -r
+ExecStart=@SBINDIR@/rpc.nfsd $NFSD_OPTS $NFSD_COUNT
+ExecStop=@SBINDIR@/rpc.nfsd 0
+ExecStopPost=@SBINDIR@/exportfs -f
+ExecReload=@SBINDIR@/exportfs -r
+StandardError=syslog
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
new file mode 100644
index 0000000..746dacf
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-statd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=NFS file locking service
+After=rpcbind.service
+Requires=rpcbind.service
+Before=remote-fs-pre.target
+
+[Service]
+EnvironmentFile=-@SYSCONFDIR@/nfs-utils.conf
+ExecStart=@SBINDIR@/rpc.statd -F $STATD_OPTS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch
new file mode 100644
index 0000000..d8f8181
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-1.2.3-sm-notify-res_init.patch
@@ -0,0 +1,36 @@
+Fixes errors like
+sm-notify[1070]: DNS resolution of a.b.c.d..com failed; retrying later
+This error will occur anytime sm-notify is run before the network if fully up,
+which is happening more and more with parallel startup systems.
+The res_init() call is simple, safe, quick, and a patch to use it should be
+able to go upstream.  Presumably the whole reason sm-notify tries several
+times is to wait for possible changes to the network configuration, but without
+calling res_init() it will never be aware of those changes
+
+Backported drom Fedora
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+
+diff -up nfs-utils-1.2.3/utils/statd/sm-notify.c.orig nfs-utils-1.2.3/utils/statd/sm-notify.c
+--- nfs-utils-1.2.3/utils/statd/sm-notify.c.orig	2010-09-28 08:24:16.000000000 -0400
++++ nfs-utils-1.2.3/utils/statd/sm-notify.c	2010-10-15 16:44:43.487119601 -0400
+@@ -28,6 +28,9 @@
+ #include <netdb.h>
+ #include <errno.h>
+ #include <grp.h>
++#include <netinet/in.h>
++#include <arpa/nameser.h>
++#include <resolv.h>
+ 
+ #include "sockaddr.h"
+ #include "xlog.h"
+@@ -84,6 +87,7 @@ smn_lookup(const char *name)
+ 	};
+ 	int error;
+ 
++	res_init();
+ 	error = getaddrinfo(name, NULL, &hint, &ai);
+ 	if (error != 0) {
+ 		xlog(D_GENERAL, "getaddrinfo(3): %s", gai_strerror(error));
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch
new file mode 100644
index 0000000..993f1e5
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch
@@ -0,0 +1,42 @@
+nfs-utils: Do not pass CFLAGS to gcc while building
+
+Do not pass CFLAGS/LDFLAGS to gcc while building, The needed flags has
+been passed by xxx_CFLAGS=$(CFLAGS_FOR_BUILD).
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ tools/locktest/Makefile.am |    2 ++
+ tools/rpcgen/Makefile.am   |    2 ++
+ 2 files changed, 4 insertions(+)
+
+diff --git a/tools/locktest/Makefile.am b/tools/locktest/Makefile.am
+index 3156815..1729fd1 100644
+--- a/tools/locktest/Makefile.am
++++ b/tools/locktest/Makefile.am
+@@ -1,6 +1,8 @@
+ ## Process this file with automake to produce Makefile.in
+ 
+ CC=$(CC_FOR_BUILD)
++CFLAGS=
++LDFLAGS=
+ LIBTOOL = @LIBTOOL@ --tag=CC
+ 
+ noinst_PROGRAMS = testlk
+diff --git a/tools/rpcgen/Makefile.am b/tools/rpcgen/Makefile.am
+index 8a9ec89..8bacdaa 100644
+--- a/tools/rpcgen/Makefile.am
++++ b/tools/rpcgen/Makefile.am
+@@ -1,6 +1,8 @@
+ ## Process this file with automake to produce Makefile.in
+ 
+ CC=$(CC_FOR_BUILD)
++CFLAGS=
++LDFLAGS=
+ LIBTOOL = @LIBTOOL@ --tag=CC
+ 
+ noinst_PROGRAMS = rpcgen
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf
new file mode 100644
index 0000000..a1007a7
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils.conf
@@ -0,0 +1,35 @@
+# Parameters to be passed to nfs-utils (clients & server) service files.
+#
+
+# Options to pass to rpc.nfsd.
+NFSD_OPTS=""
+
+# Number of servers to start up; the default is 8 servers.
+NFSD_COUNT=""
+
+# Where to mount nfsd filesystem; the default is "/proc/fs/nfsd".
+PROCNFSD_MOUNTPOINT=""
+
+# Options used to mount nfsd filesystem; the default is "rw,nodev,noexec,nosuid".
+PROCNFSD_MOUNTOPTS=""
+
+# Options for rpc.mountd.
+# If you have a port-based firewall, you might want to set up
+# a fixed port here using the --port option.
+MOUNTD_OPTS=""
+
+# Parameters to be passed to nfs-common (nfs clients & server) init script.
+#
+
+# If you do not set values for the NEED_ options, they will be attempted
+# autodetected; this should be sufficient for most people. Valid alternatives
+# for the NEED_ options are "yes" and "no".
+
+# Do you want to start the statd daemon? It is not needed for NFSv4.
+NEED_STATD=""
+
+# Options to pass to rpc.statd.
+# N.B. statd normally runs on both client and server, and run-time
+# options should be specified accordingly.
+# STATD_OPTS="-p 32765 -o 32766"
+STATD_OPTS=""
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
new file mode 100644
index 0000000..992267d
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfscommon
@@ -0,0 +1,63 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          nfs-common
+# Required-Start:    $portmap hwclock
+# Required-Stop:     $portmap hwclock
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: NFS support for both client and server
+# Description:       NFS is a popular protocol for file sharing across
+#                    TCP/IP networks. This service provides various
+#                    support functions for NFS mounts.
+### END INIT INFO
+#
+# Startup script for nfs-utils
+#
+#
+# Location of executables:
+
+# Source function library.
+. /etc/init.d/functions
+
+test -x "$NFS_STATD" || NFS_STATD=/usr/sbin/rpc.statd
+test -z "$STATD_PID" && STATD_PID=/var/run/rpc.statd.pid
+#
+# The default state directory is /var/lib/nfs
+test -n "$NFS_STATEDIR" || NFS_STATEDIR=/var/lib/nfs
+#
+#----------------------------------------------------------------------
+# Startup and shutdown functions.
+#  Actual startup/shutdown is at the end of this file.
+
+start_statd(){
+	echo -n "starting statd: "
+	start-stop-daemon --start --exec "$NFS_STATD" --pidfile "$STATD_PID"
+	echo done
+}
+stop_statd(){
+	echo -n 'stopping statd: '
+	start-stop-daemon --stop --quiet --signal 1 --pidfile "$STATD_PID"
+	echo done
+}
+#----------------------------------------------------------------------
+#
+# supported options:
+#  start
+#  stop
+#  restart: stops and starts mountd
+#FIXME: need to create the /var/lib/nfs/... directories
+case "$1" in
+  start)
+	start_statd;;
+  stop)
+	stop_statd;;
+  status)
+	status $NFS_STATD
+	exit $?;;
+  restart)
+	$0 stop
+	$0 start;;
+  *)
+	echo "Usage: $0 {start|stop|status|restart}"
+	exit 1;;
+esac
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
new file mode 100644
index 0000000..7ed93a5
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/nfsserver
@@ -0,0 +1,130 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          nfs-kernel-server
+# Required-Start:    $remote_fs nfs-common $portmap hwclock
+# Required-Stop:     $remote_fs nfs-common $portmap hwclock
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Kernel NFS server support
+# Description:       NFS is a popular protocol for file sharing across
+#                    TCP/IP networks. This service provides NFS server
+#                    functionality, which is configured via the
+#                    /etc/exports file.
+### END INIT INFO
+#
+# Startup script for nfs-utils
+#
+# Source function library.
+. /etc/init.d/functions
+#
+# The environment variable NFS_SERVERS may be set in /etc/default/nfsd
+# Other control variables may be overridden here too
+test -r /etc/default/nfsd && . /etc/default/nfsd
+#
+# Location of executables:
+test -x "$NFS_MOUNTD" || NFS_MOUNTD=/usr/sbin/rpc.mountd
+test -x "$NFS_NFSD" || NFS_NFSD=/usr/sbin/rpc.nfsd
+#
+# The user mode program must also exist (it just starts the kernel
+# threads using the kernel module code).
+test -x "$NFS_MOUNTD" || exit 0
+test -x "$NFS_NFSD" || exit 0
+#
+# Default is 8 threads, value is settable between 1 and the truely
+# ridiculous 99
+test "$NFS_SERVERS" != "" && test "$NFS_SERVERS" -gt 0 && test "$NFS_SERVERS" -lt 100 || NFS_SERVERS=8
+#
+#----------------------------------------------------------------------
+# Startup and shutdown functions.
+#  Actual startup/shutdown is at the end of this file.
+#mountd
+start_mountd(){
+	echo -n 'starting mountd: '
+	start-stop-daemon --start --exec "$NFS_MOUNTD" -- "-f /etc/exports $@"
+	echo done
+}
+stop_mountd(){
+	echo -n 'stopping mountd: '
+	start-stop-daemon --stop --quiet --exec "$NFS_MOUNTD"
+	echo done
+}
+#
+#nfsd
+start_nfsd(){
+        modprobe -q nfsd
+	grep -q nfsd /proc/filesystems || {
+		echo NFS daemon support not enabled in kernel
+		exit 1
+        }
+	grep -q nfsd /proc/mounts || mount -t nfsd nfsd /proc/fs/nfsd
+	grep -q nfsd /proc/mounts || {
+		echo nfsd filesystem could not be mounted at /proc/fs/nfsd
+		exit 1
+        }
+
+	echo -n "starting $1 nfsd kernel threads: "
+	start-stop-daemon --start --exec "$NFS_NFSD" -- "$@"
+	echo done
+}
+delay_nfsd(){
+	for delay in 0 1 2 3 4 5 6 7 8 9 
+	do
+		if pidof nfsd >/dev/null
+		then
+			echo -n .
+			sleep 1
+		else
+			return 0
+		fi
+	done
+	return 1
+}
+stop_nfsd(){
+	# WARNING: this kills any process with the executable
+	# name 'nfsd'.
+	echo -n 'stopping nfsd: '
+	start-stop-daemon --stop --quiet --signal 1 --name nfsd
+	if delay_nfsd || {
+		echo failed
+		echo ' using signal 9: '
+		start-stop-daemon --stop --quiet --signal 9 --name nfsd
+		delay_nfsd
+	}
+	then
+		echo done
+	else
+		echo failed
+	fi
+}
+
+#----------------------------------------------------------------------
+#
+# supported options:
+#  start
+#  stop
+#  reload: reloads the exports file
+#  restart: stops and starts mountd
+#FIXME: need to create the /var/lib/nfs/... directories
+case "$1" in
+  start)
+	exportfs -r
+	start_nfsd "$NFS_SERVERS"
+	start_mountd
+	test -r /etc/exports && exportfs -a;;
+  stop)	exportfs -ua
+	stop_mountd
+	stop_nfsd;;
+  status)
+	status /usr/sbin/rpc.mountd
+	RETVAL=$?
+	status nfsd
+	rval=$?
+	[ $RETVAL -eq 0 ] && exit $rval
+	exit $RETVAL;;
+  reload)	test -r /etc/exports && exportfs -r;;
+  restart)
+	$0 stop
+	$0 start;;
+  *)	echo "Usage: $0 {start|stop|status|reload|restart}"
+	exit 1;;
+esac
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
new file mode 100644
index 0000000..630801b
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/proc-fs-nfsd.mount
@@ -0,0 +1,8 @@
+[Unit]
+Description=NFSD configuration filesystem
+After=systemd-modules-load.service
+
+[Mount]
+What=nfsd
+Where=/proc/fs/nfsd
+Type=nfsd
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
new file mode 100644
index 0000000..42101de
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
@@ -0,0 +1,141 @@
+SUMMARY = "userspace utilities for kernel nfs"
+DESCRIPTION = "The nfs-utils package provides a daemon for the kernel \
+NFS server and related tools."
+HOMEPAGE = "http://nfs.sourceforge.net/"
+SECTION = "console/network"
+
+LICENSE = "MIT & GPLv2+ & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
+
+# util-linux for libblkid
+DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3"
+RDEPENDS_${PN}-client = "rpcbind bash"
+RDEPENDS_${PN} = "${PN}-client bash"
+RRECOMMENDS_${PN} = "kernel-module-nfsd"
+
+inherit useradd
+
+USERADD_PACKAGES = "${PN}-client"
+USERADD_PARAM_${PN}-client = "--system  --home-dir /var/lib/nfs \
+			      --shell /bin/false --user-group rpcuser"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.xz \
+           file://0001-configure-Allow-to-explicitly-disable-nfsidmap.patch \
+           file://nfs-utils-1.2.3-sm-notify-res_init.patch \
+           file://nfsserver \
+           file://nfscommon \
+           file://nfs-utils.conf \
+           file://nfs-server.service \
+           file://nfs-mountd.service \
+           file://nfs-statd.service \
+           file://proc-fs-nfsd.mount \
+           file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
+           file://nfs-utils-debianize-start-statd.patch \
+"
+
+SRC_URI[md5sum] = "8de676b9ff34b8f9addc1d0800fabdf8"
+SRC_URI[sha256sum] = "ff79d70b7b58b2c8f9b798c58721127e82bb96022adc04a5c4cb251630e696b8"
+
+# Only kernel-module-nfsd is required here (but can be built-in)  - the nfsd module will
+# pull in the remainder of the dependencies.
+
+INITSCRIPT_PACKAGES = "${PN} ${PN}-client"
+INITSCRIPT_NAME = "nfsserver"
+INITSCRIPT_PARAMS = "defaults"
+INITSCRIPT_NAME_${PN}-client = "nfscommon"
+INITSCRIPT_PARAMS_${PN}-client = "defaults 19 21"
+
+inherit autotools-brokensep update-rc.d systemd pkgconfig
+
+SYSTEMD_SERVICE_${PN} = "nfs-server.service nfs-mountd.service"
+SYSTEMD_SERVICE_${PN}-client = "nfs-statd.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+# --enable-uuid is need for cross-compiling
+EXTRA_OECONF = "--with-statduser=rpcuser \
+                --enable-mountconfig \
+                --enable-libmount-mount \
+                --disable-nfsv41 \
+                --enable-uuid \
+                --disable-gss \
+                --disable-tirpc \
+                --disable-nfsdcltrack \
+                --with-statdpath=/var/lib/nfs/statd \
+               "
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
+PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
+
+INHIBIT_AUTO_STAGE = "1"
+
+PACKAGES =+ "${PN}-client ${PN}-stats"
+
+CONFFILES_${PN}-client += "${localstatedir}/lib/nfs/etab \
+			   ${localstatedir}/lib/nfs/rmtab \
+			   ${localstatedir}/lib/nfs/xtab \
+			   ${localstatedir}/lib/nfs/statd/state \
+			   ${sysconfdir}/nfsmount.conf"
+
+FILES_${PN}-client = "${base_sbindir}/*mount.nfs* ${sbindir}/*statd \
+		      ${sbindir}/rpc.idmapd ${sbindir}/sm-notify \
+		      ${sbindir}/showmount ${sbindir}/nfsstat \
+		      ${localstatedir}/lib/nfs \
+		      ${sysconfdir}/nfs-utils.conf \
+		      ${sysconfdir}/nfsmount.conf \
+		      ${sysconfdir}/init.d/nfscommon \
+		      ${systemd_unitdir}/system/nfs-statd.service"
+FILES_${PN}-stats = "${sbindir}/mountstats ${sbindir}/nfsiostat"
+RDEPENDS_${PN}-stats = "python"
+
+FILES_${PN} += "${systemd_unitdir}"
+
+do_configure_prepend() {
+        sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
+            ${S}/utils/mount/Makefile.am
+
+        sed -i -e 's,sbindir = /sbin,sbindir = ${base_sbindir},g' \
+            ${S}/utils/osd_login/Makefile.am
+}
+
+# Make clean needed because the package comes with
+# precompiled 64-bit objects that break the build
+do_compile_prepend() {
+	make clean
+}
+
+do_install_append () {
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/nfsserver ${D}${sysconfdir}/init.d/nfsserver
+	install -m 0755 ${WORKDIR}/nfscommon ${D}${sysconfdir}/init.d/nfscommon
+
+	install -m 0755 ${WORKDIR}/nfs-utils.conf ${D}${sysconfdir}
+	install -m 0755 ${S}/utils/mount/nfsmount.conf ${D}${sysconfdir}
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/nfs-server.service ${D}${systemd_unitdir}/system/
+	install -m 0644 ${WORKDIR}/nfs-mountd.service ${D}${systemd_unitdir}/system/
+	install -m 0644 ${WORKDIR}/nfs-statd.service ${D}${systemd_unitdir}/system/
+	sed -i -e 's,@SBINDIR@,${sbindir},g' \
+		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
+		${D}${systemd_unitdir}/system/*.service
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+	    install -d ${D}${sysconfdir}/modules-load.d
+	    echo "nfsd" > ${D}${sysconfdir}/modules-load.d/nfsd.conf
+	    install -m 0644 ${WORKDIR}/proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/
+	    install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
+	    ln -sf ../proc-fs-nfsd.mount ${D}${systemd_unitdir}/system/sysinit.target.wants/proc-fs-nfsd.mount
+	fi
+
+	# kernel code as of 3.8 hard-codes this path as a default
+	install -d ${D}/var/lib/nfs/v4recovery
+
+	# chown the directories and files
+	chown -R rpcuser:rpcuser ${D}${localstatedir}/lib/nfs/statd
+	chmod 0644 ${D}${localstatedir}/lib/nfs/statd/state
+
+	# the following are built by CC_FOR_BUILD
+	rm -f ${D}${sbindir}/rpcdebug
+	rm -f ${D}${sbindir}/rpcgen
+	rm -f ${D}${sbindir}/locktest
+}
diff --git a/meta/recipes-connectivity/ofono/ofono.inc b/meta/recipes-connectivity/ofono/ofono.inc
new file mode 100644
index 0000000..c415a39
--- /dev/null
+++ b/meta/recipes-connectivity/ofono/ofono.inc
@@ -0,0 +1,37 @@
+HOMEPAGE = "http://www.ofono.org"
+SUMMARY  = "open source telephony"
+DESCRIPTION = "oFono is a stack for mobile telephony devices on Linux. oFono supports speaking to telephony devices through specific drivers, or with generic AT commands."
+LICENSE  = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+                    file://src/ofono.h;beginline=1;endline=20;md5=3ce17d5978ef3445def265b98899c2ee"
+
+inherit autotools pkgconfig update-rc.d systemd bluetooth
+
+DEPENDS  = "dbus glib-2.0 udev mobile-broadband-provider-info"
+
+INITSCRIPT_NAME = "ofono"
+INITSCRIPT_PARAMS = "defaults 22"
+
+PACKAGECONFIG ??= "\
+    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+    "
+PACKAGECONFIG[systemd] = "--with-systemdunitdir=${systemd_unitdir}/system/,--with-systemdunitdir="
+PACKAGECONFIG[bluez] = "--enable-bluetooth, --disable-bluetooth, ${BLUEZ}"
+
+EXTRA_OECONF += "--enable-test"
+
+SYSTEMD_SERVICE_${PN} = "ofono.service"
+
+do_install_append() {
+  install -d ${D}${sysconfdir}/init.d/
+  install -m 0755 ${WORKDIR}/ofono ${D}${sysconfdir}/init.d/ofono
+}
+
+PACKAGES =+ "${PN}-tests"
+
+RDEPENDS_${PN} += "dbus"
+
+FILES_${PN} += "${base_libdir}/udev ${systemd_unitdir}"
+FILES_${PN}-tests = "${libdir}/${BPN}/test"
+RDEPENDS_${PN}-tests = "python python-pygobject python-dbus"
diff --git a/meta/recipes-connectivity/ofono/ofono/0001-backtrace-Disable-for-non-glibc-C-libraries.patch b/meta/recipes-connectivity/ofono/ofono/0001-backtrace-Disable-for-non-glibc-C-libraries.patch
new file mode 100644
index 0000000..306b6da
--- /dev/null
+++ b/meta/recipes-connectivity/ofono/ofono/0001-backtrace-Disable-for-non-glibc-C-libraries.patch
@@ -0,0 +1,40 @@
+From 2d729af0897d7d72b83d111876febf9e0eec1a68 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 3 Apr 2015 20:50:56 -0700
+Subject: [PATCH] backtrace: Disable for non-glibc C libraries
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+---
+ src/log.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/log.c b/src/log.c
+index febc874..9db4ae7 100644
+--- a/src/log.c
++++ b/src/log.c
+@@ -30,7 +30,9 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <syslog.h>
++#ifdef __GLIBC__
+ #include <execinfo.h>
++#endif
+ #include <dlfcn.h>
+ 
+ #include "ofono.h"
+@@ -219,8 +221,9 @@ static void signal_handler(int signo)
+ {
+ 	ofono_error("Aborting (signal %d) [%s]", signo, program_exec);
+ 
++#ifdef __GLIBC__
+ 	print_backtrace(2);
+-
++#endif
+ 	exit(EXIT_FAILURE);
+ }
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-connectivity/ofono/ofono/Revert-test-Convert-to-Python-3.patch b/meta/recipes-connectivity/ofono/ofono/Revert-test-Convert-to-Python-3.patch
new file mode 100644
index 0000000..5f8ca77
--- /dev/null
+++ b/meta/recipes-connectivity/ofono/ofono/Revert-test-Convert-to-Python-3.patch
@@ -0,0 +1,1270 @@
+Upstream-Status: Inappropriate [configuration]
+
+From 572fc23f6efd65a2ef9e6c957b2506108738672b Mon Sep 17 00:00:00 2001
+From: Cristian Iorga <cristian.iorga@intel.com>
+Date: Mon, 25 Aug 2014 16:59:39 +0300
+Subject: [PATCH] Revert "test: Convert to Python 3"
+
+This reverts commit c027ab9fbc1a8e8c9e76bcd123df1ad7696307c2.
+---
+ test/activate-context          |  2 +-
+ test/answer-calls              |  2 +-
+ test/backtrace                 |  2 +-
+ test/cancel-ussd               |  2 +-
+ test/cdma-connman-disable      |  2 +-
+ test/cdma-connman-enable       |  2 +-
+ test/cdma-dial-number          |  2 +-
+ test/cdma-hangup               |  2 +-
+ test/cdma-list-call            |  2 +-
+ test/cdma-set-credentials      |  2 +-
+ test/change-pin                |  2 +-
+ test/create-internet-context   |  2 +-
+ test/create-mms-context        |  2 +-
+ test/create-multiparty         |  2 +-
+ test/deactivate-all            |  2 +-
+ test/deactivate-context        |  2 +-
+ test/dial-number               |  2 +-
+ test/disable-call-forwarding   |  2 +-
+ test/disable-gprs              |  2 +-
+ test/disable-modem             |  2 +-
+ test/display-icon              |  2 +-
+ test/enable-cbs                |  2 +-
+ test/enable-gprs               |  2 +-
+ test/enable-modem              |  2 +-
+ test/enter-pin                 |  2 +-
+ test/get-icon                  |  2 +-
+ test/get-operators             |  2 +-
+ test/get-tech-preference       |  2 +-
+ test/hangup-active             |  2 +-
+ test/hangup-all                |  2 +-
+ test/hangup-call               |  2 +-
+ test/hangup-multiparty         |  2 +-
+ test/hold-and-answer           |  2 +-
+ test/initiate-ussd             |  4 ++--
+ test/list-calls                |  2 +-
+ test/list-contexts             |  2 +-
+ test/list-messages             |  2 +-
+ test/list-modems               |  2 +-
+ test/list-operators            |  2 +-
+ test/lock-pin                  |  2 +-
+ test/lockdown-modem            |  2 +-
+ test/monitor-ofono             |  4 ++--
+ test/offline-modem             |  2 +-
+ test/online-modem              |  2 +-
+ test/private-chat              |  2 +-
+ test/process-context-settings  |  2 +-
+ test/receive-sms               |  2 +-
+ test/reject-calls              |  2 +-
+ test/release-and-answer        |  2 +-
+ test/release-and-swap          |  2 +-
+ test/remove-contexts           |  2 +-
+ test/reset-pin                 |  2 +-
+ test/scan-for-operators        |  2 +-
+ test/send-sms                  |  2 +-
+ test/send-ussd                 |  4 ++--
+ test/send-vcal                 |  2 +-
+ test/send-vcard                |  2 +-
+ test/set-call-forwarding       |  2 +-
+ test/set-cbs-topics            |  2 +-
+ test/set-context-property      |  2 +-
+ test/set-fast-dormancy         |  2 +-
+ test/set-gsm-band              |  2 +-
+ test/set-mic-volume            |  2 +-
+ test/set-mms-details           |  2 +-
+ test/set-msisdn                |  2 +-
+ test/set-roaming-allowed       |  2 +-
+ test/set-speaker-volume        |  2 +-
+ test/set-tech-preference       |  2 +-
+ test/set-tty                   |  2 +-
+ test/set-umts-band             |  2 +-
+ test/set-use-sms-reports       |  2 +-
+ test/swap-calls                |  2 +-
+ test/test-advice-of-charge     |  2 +-
+ test/test-call-barring         |  2 +-
+ test/test-call-forwarding      |  2 +-
+ test/test-call-settings        |  2 +-
+ test/test-cbs                  |  4 ++--
+ test/test-gnss                 |  4 ++--
+ test/test-message-waiting      |  2 +-
+ test/test-modem                |  2 +-
+ test/test-network-registration |  2 +-
+ test/test-phonebook            |  2 +-
+ test/test-push-notification    |  2 +-
+ test/test-smart-messaging      |  2 +-
+ test/test-sms                  | 18 +++++++++---------
+ test/test-ss                   |  2 +-
+ test/test-ss-control-cb        |  2 +-
+ test/test-ss-control-cf        |  2 +-
+ test/test-ss-control-cs        |  2 +-
+ test/test-stk-menu             | 34 +++++++++++++++++-----------------
+ test/unlock-pin                |  2 +-
+ 94 files changed, 124 insertions(+), 124 deletions(-)
+
+diff --git a/test/activate-context b/test/activate-context
+index e4fc702..4241396 100755
+--- a/test/activate-context
++++ b/test/activate-context
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/answer-calls b/test/answer-calls
+index daa794b..45ff08f 100755
+--- a/test/answer-calls
++++ b/test/answer-calls
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ 
+diff --git a/test/backtrace b/test/backtrace
+index 03c7632..c624709 100755
+--- a/test/backtrace
++++ b/test/backtrace
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import os
+ import re
+diff --git a/test/cancel-ussd b/test/cancel-ussd
+index e7559ba..1797f26 100755
+--- a/test/cancel-ussd
++++ b/test/cancel-ussd
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/cdma-connman-disable b/test/cdma-connman-disable
+index 3adc14d..0ddc0cd 100755
+--- a/test/cdma-connman-disable
++++ b/test/cdma-connman-disable
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/cdma-connman-enable b/test/cdma-connman-enable
+index ac16a2d..a3cca01 100755
+--- a/test/cdma-connman-enable
++++ b/test/cdma-connman-enable
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/cdma-dial-number b/test/cdma-dial-number
+index 683431e..9cdfb24 100755
+--- a/test/cdma-dial-number
++++ b/test/cdma-dial-number
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/cdma-hangup b/test/cdma-hangup
+index 41ffa60..493ece4 100755
+--- a/test/cdma-hangup
++++ b/test/cdma-hangup
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/cdma-list-call b/test/cdma-list-call
+index b132353..5d36a69 100755
+--- a/test/cdma-list-call
++++ b/test/cdma-list-call
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ 
+diff --git a/test/cdma-set-credentials b/test/cdma-set-credentials
+index a60c86e..a286b0e 100755
+--- a/test/cdma-set-credentials
++++ b/test/cdma-set-credentials
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/change-pin b/test/change-pin
+index 301c6ce..000ce53 100755
+--- a/test/change-pin
++++ b/test/change-pin
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/create-internet-context b/test/create-internet-context
+index 1089053..efd0998 100755
+--- a/test/create-internet-context
++++ b/test/create-internet-context
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/create-mms-context b/test/create-mms-context
+index 598336f..e5be08d 100755
+--- a/test/create-mms-context
++++ b/test/create-mms-context
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/create-multiparty b/test/create-multiparty
+index 1b76010..97047c3 100755
+--- a/test/create-multiparty
++++ b/test/create-multiparty
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/deactivate-all b/test/deactivate-all
+index 5aa8587..427009e 100755
+--- a/test/deactivate-all
++++ b/test/deactivate-all
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/deactivate-context b/test/deactivate-context
+index 5c86a71..df47d2e 100755
+--- a/test/deactivate-context
++++ b/test/deactivate-context
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/dial-number b/test/dial-number
+index fe5adad..ee674d9 100755
+--- a/test/dial-number
++++ b/test/dial-number
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/disable-call-forwarding b/test/disable-call-forwarding
+index 811e4fa..3609816 100755
+--- a/test/disable-call-forwarding
++++ b/test/disable-call-forwarding
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ from gi.repository import GLib
+diff --git a/test/disable-gprs b/test/disable-gprs
+index 61ce216..c6c40a5 100755
+--- a/test/disable-gprs
++++ b/test/disable-gprs
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/disable-modem b/test/disable-modem
+index 6fba857..ca8c8d8 100755
+--- a/test/disable-modem
++++ b/test/disable-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/display-icon b/test/display-icon
+index ac40818..753d14d 100755
+--- a/test/display-icon
++++ b/test/display-icon
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/enable-cbs b/test/enable-cbs
+index 4a8bf66..c08bf2b 100755
+--- a/test/enable-cbs
++++ b/test/enable-cbs
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/enable-gprs b/test/enable-gprs
+index 68d5ef0..8664891 100755
+--- a/test/enable-gprs
++++ b/test/enable-gprs
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/enable-modem b/test/enable-modem
+index fc5958a..dfaaaa8 100755
+--- a/test/enable-modem
++++ b/test/enable-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/enter-pin b/test/enter-pin
+index 9556363..c6ee669 100755
+--- a/test/enter-pin
++++ b/test/enter-pin
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/get-icon b/test/get-icon
+index 5569a33..fdaaee7 100755
+--- a/test/get-icon
++++ b/test/get-icon
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/get-operators b/test/get-operators
+index 0f35c80..62354c5 100755
+--- a/test/get-operators
++++ b/test/get-operators
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/get-tech-preference b/test/get-tech-preference
+index 7ba6365..77d20d0 100755
+--- a/test/get-tech-preference
++++ b/test/get-tech-preference
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus, sys
+ 
+diff --git a/test/hangup-active b/test/hangup-active
+index 82e0eb0..5af62ab 100755
+--- a/test/hangup-active
++++ b/test/hangup-active
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/hangup-all b/test/hangup-all
+index 3a0138d..32933db 100755
+--- a/test/hangup-all
++++ b/test/hangup-all
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/hangup-call b/test/hangup-call
+index 5a2de20..447020c 100755
+--- a/test/hangup-call
++++ b/test/hangup-call
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/hangup-multiparty b/test/hangup-multiparty
+index 24751c3..48fe342 100755
+--- a/test/hangup-multiparty
++++ b/test/hangup-multiparty
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/hold-and-answer b/test/hold-and-answer
+index da3be57..2c47e27 100755
+--- a/test/hold-and-answer
++++ b/test/hold-and-answer
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/initiate-ussd b/test/initiate-ussd
+index faf50d0..d7022f1 100755
+--- a/test/initiate-ussd
++++ b/test/initiate-ussd
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+@@ -45,7 +45,7 @@ if state == "idle":
+ print("State: %s" % (state))
+ 
+ while state == "user-response":
+-	response = input("Enter response: ")
++	response = raw_input("Enter response: ")
+ 
+ 	result = ussd.Respond(response, timeout=100)
+ 
+diff --git a/test/list-calls b/test/list-calls
+index f3ee991..08668c6 100755
+--- a/test/list-calls
++++ b/test/list-calls
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ 
+diff --git a/test/list-contexts b/test/list-contexts
+index 78278ca..f0d4094 100755
+--- a/test/list-contexts
++++ b/test/list-contexts
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ 
+diff --git a/test/list-messages b/test/list-messages
+index 9f5bce3..cfccbea 100755
+--- a/test/list-messages
++++ b/test/list-messages
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ 
+diff --git a/test/list-modems b/test/list-modems
+index b9f510a..ed66124 100755
+--- a/test/list-modems
++++ b/test/list-modems
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ 
+diff --git a/test/list-operators b/test/list-operators
+index 064c4e3..349bf41 100755
+--- a/test/list-operators
++++ b/test/list-operators
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/lock-pin b/test/lock-pin
+index 96ea9c2..5579735 100755
+--- a/test/lock-pin
++++ b/test/lock-pin
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/lockdown-modem b/test/lockdown-modem
+index 4e04205..781abb6 100755
+--- a/test/lockdown-modem
++++ b/test/lockdown-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/monitor-ofono b/test/monitor-ofono
+index 8830757..bd31617 100755
+--- a/test/monitor-ofono
++++ b/test/monitor-ofono
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+@@ -6,7 +6,7 @@ import dbus
+ import dbus.mainloop.glib
+ 
+ _dbus2py = {
+-	dbus.String : str,
++	dbus.String : unicode,
+ 	dbus.UInt32 : int,
+ 	dbus.Int32 : int,
+ 	dbus.Int16 : int,
+diff --git a/test/offline-modem b/test/offline-modem
+index e8c043a..ea1f522 100755
+--- a/test/offline-modem
++++ b/test/offline-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus, sys
+ 
+diff --git a/test/online-modem b/test/online-modem
+index 029c4a5..310ed7d 100755
+--- a/test/online-modem
++++ b/test/online-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus, sys
+ 
+diff --git a/test/private-chat b/test/private-chat
+index e7e5406..ef2ef6c 100755
+--- a/test/private-chat
++++ b/test/private-chat
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/process-context-settings b/test/process-context-settings
+index 8a3ecfa..0f058b2 100755
+--- a/test/process-context-settings
++++ b/test/process-context-settings
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import os
+ import dbus
+diff --git a/test/receive-sms b/test/receive-sms
+index a0c6915..c23eb14 100755
+--- a/test/receive-sms
++++ b/test/receive-sms
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+diff --git a/test/reject-calls b/test/reject-calls
+index 71b243e..9edf1ff 100755
+--- a/test/reject-calls
++++ b/test/reject-calls
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ 
+diff --git a/test/release-and-answer b/test/release-and-answer
+index dec8e17..25fd818 100755
+--- a/test/release-and-answer
++++ b/test/release-and-answer
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/release-and-swap b/test/release-and-swap
+index cb8c84e..7b3569f 100755
+--- a/test/release-and-swap
++++ b/test/release-and-swap
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/remove-contexts b/test/remove-contexts
+index b54184e..c5082cb 100755
+--- a/test/remove-contexts
++++ b/test/remove-contexts
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ 
+diff --git a/test/reset-pin b/test/reset-pin
+index 3fbd126..b429254 100755
+--- a/test/reset-pin
++++ b/test/reset-pin
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/scan-for-operators b/test/scan-for-operators
+index b4fc05e..749c710 100755
+--- a/test/scan-for-operators
++++ b/test/scan-for-operators
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/send-sms b/test/send-sms
+index 98808aa..e06444d 100755
+--- a/test/send-sms
++++ b/test/send-sms
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/send-ussd b/test/send-ussd
+index a20e098..e585883 100755
+--- a/test/send-ussd
++++ b/test/send-ussd
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+@@ -46,7 +46,7 @@ if state == "idle":
+ print("State: %s" % (state))
+ 
+ while state == "user-response":
+-	response = input("Enter response: ")
++	response = raw_input("Enter response: ")
+ 
+ 	print(ussd.Respond(response, timeout=100))
+ 
+diff --git a/test/send-vcal b/test/send-vcal
+index 566daef..7f8272b 100755
+--- a/test/send-vcal
++++ b/test/send-vcal
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/send-vcard b/test/send-vcard
+index 4dedf51..250b36f 100755
+--- a/test/send-vcard
++++ b/test/send-vcard
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/set-call-forwarding b/test/set-call-forwarding
+index 49d1ce0..9fd358b 100755
+--- a/test/set-call-forwarding
++++ b/test/set-call-forwarding
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ from gi.repository import GLib
+diff --git a/test/set-cbs-topics b/test/set-cbs-topics
+index db95e16..78d6d44 100755
+--- a/test/set-cbs-topics
++++ b/test/set-cbs-topics
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/set-context-property b/test/set-context-property
+index 5ff7a67..64a6fb8 100755
+--- a/test/set-context-property
++++ b/test/set-context-property
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/set-fast-dormancy b/test/set-fast-dormancy
+index ef77bcd..7bf7715 100755
+--- a/test/set-fast-dormancy
++++ b/test/set-fast-dormancy
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/set-gsm-band b/test/set-gsm-band
+index b37bcb5..3c17c10 100755
+--- a/test/set-gsm-band
++++ b/test/set-gsm-band
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/set-mic-volume b/test/set-mic-volume
+index cd6c73f..e0bff49 100755
+--- a/test/set-mic-volume
++++ b/test/set-mic-volume
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/set-mms-details b/test/set-mms-details
+index 6ee59fa..d2d0838 100755
+--- a/test/set-mms-details
++++ b/test/set-mms-details
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/set-msisdn b/test/set-msisdn
+index b5fe819..01f284d 100755
+--- a/test/set-msisdn
++++ b/test/set-msisdn
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/set-roaming-allowed b/test/set-roaming-allowed
+index 698c8b6..9e3e058 100755
+--- a/test/set-roaming-allowed
++++ b/test/set-roaming-allowed
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/set-speaker-volume b/test/set-speaker-volume
+index 6d4e301..7962f39 100755
+--- a/test/set-speaker-volume
++++ b/test/set-speaker-volume
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/set-tech-preference b/test/set-tech-preference
+index b549abc..2666cbd 100755
+--- a/test/set-tech-preference
++++ b/test/set-tech-preference
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/set-tty b/test/set-tty
+index eed1fba..53d6b99 100755
+--- a/test/set-tty
++++ b/test/set-tty
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/set-umts-band b/test/set-umts-band
+index 0bae5c4..c1e6448 100755
+--- a/test/set-umts-band
++++ b/test/set-umts-band
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/set-use-sms-reports b/test/set-use-sms-reports
+index 288d4e1..a4efe4f 100755
+--- a/test/set-use-sms-reports
++++ b/test/set-use-sms-reports
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+diff --git a/test/swap-calls b/test/swap-calls
+index 018a8d3..eeb257b 100755
+--- a/test/swap-calls
++++ b/test/swap-calls
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/test-advice-of-charge b/test/test-advice-of-charge
+index 6e87e61..0f1f57f 100755
+--- a/test/test-advice-of-charge
++++ b/test/test-advice-of-charge
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ import sys
+diff --git a/test/test-call-barring b/test/test-call-barring
+index eedb69f..be4ab57 100755
+--- a/test/test-call-barring
++++ b/test/test-call-barring
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ import sys
+diff --git a/test/test-call-forwarding b/test/test-call-forwarding
+index 5db84d7..01a7294 100755
+--- a/test/test-call-forwarding
++++ b/test/test-call-forwarding
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+diff --git a/test/test-call-settings b/test/test-call-settings
+index 435594c..5d7ee49 100755
+--- a/test/test-call-settings
++++ b/test/test-call-settings
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+diff --git a/test/test-cbs b/test/test-cbs
+index a5cec06..13cdd80 100755
+--- a/test/test-cbs
++++ b/test/test-cbs
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import dbus.mainloop.glib
+@@ -78,7 +78,7 @@ def set_topics(cbs):
+ 	invalidData = False;
+ 	index = 0
+ 
+-	topics = input('Enter the topic ID(s) you want to register to: ')
++	topics = raw_input('Enter the topic ID(s) you want to register to: ')
+ 
+ 	while index < len(topics):
+ 		if topics[index] == ',' or topics[index] == '-':
+diff --git a/test/test-gnss b/test/test-gnss
+index 6ae64db..aa0b160 100755
+--- a/test/test-gnss
++++ b/test/test-gnss
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ import sys
+@@ -40,7 +40,7 @@ def print_menu():
+ def stdin_handler(channel, condition, gnss, path):
+ 	in_key = os.read(channel.unix_get_fd(), 160).rstrip().decode('UTF-8')
+ 	if in_key == '0':
+-		xml = input('type the element and press enter: ')
++		xml = raw_input('type the element and press enter: ')
+ 		try:
+ 			gnss.SendPositioningElement(dbus.String(xml))
+ 			print("ok")
+diff --git a/test/test-message-waiting b/test/test-message-waiting
+index 432862e..b93fbf3 100755
+--- a/test/test-message-waiting
++++ b/test/test-message-waiting
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ import sys
+diff --git a/test/test-modem b/test/test-modem
+index aa38b1f..29dbf14 100755
+--- a/test/test-modem
++++ b/test/test-modem
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+diff --git a/test/test-network-registration b/test/test-network-registration
+index 68b4347..c5ad586 100755
+--- a/test/test-network-registration
++++ b/test/test-network-registration
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ import sys
+diff --git a/test/test-phonebook b/test/test-phonebook
+index 42646d3..116fd4f 100755
+--- a/test/test-phonebook
++++ b/test/test-phonebook
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus, sys
+ 
+diff --git a/test/test-push-notification b/test/test-push-notification
+index d972ad3..ecc6afb 100755
+--- a/test/test-push-notification
++++ b/test/test-push-notification
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+diff --git a/test/test-smart-messaging b/test/test-smart-messaging
+index f22efd2..188ac1e 100755
+--- a/test/test-smart-messaging
++++ b/test/test-smart-messaging
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+diff --git a/test/test-sms b/test/test-sms
+index 30ac651..49935e1 100755
+--- a/test/test-sms
++++ b/test/test-sms
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ # -*- coding: utf-8 -*-
+ 
+ from gi.repository import GLib
+@@ -132,7 +132,7 @@ def stdin_handler(channel, condition, sms, value, number):
+ 		lock = "on"
+ 		if in_key == '0':
+ 			print_send_sms_menu()
+-			sms_type = input('Select SMS type: ')
++			sms_type = raw_input('Select SMS type: ')
+ 
+ 			if sms_type == '1':
+ 				message_send(sms, number, value)
+@@ -150,49 +150,49 @@ def stdin_handler(channel, condition, sms, value, number):
+ 
+ 		elif in_key == '1':
+ 			message_delivery_report(sms, 1)
+-			send_msg = input('Send test message[y/n]?: ')
++			send_msg = raw_input('Send test message[y/n]?: ')
+ 			if send_msg == 'y':
+ 				message_send(sms, number, ("(1)" + value +
+ 						": UseDeliveryReports[TRUE]"))
+ 
+ 		elif in_key == '2':
+ 			message_delivery_report(sms, 0)
+-			send_msg = input('Send test message[y/n]?: ')
++			send_msg = raw_input('Send test message[y/n]?: ')
+ 			if send_msg == 'y':
+ 				message_send(sms, number, ("(2) " + value +
+ 						": UseDeliveryReports[FALSE]"))
+ 
+ 		elif in_key == '3':
+ 			message_service_center_address(sms, SCA)
+-			send_msg = input('Send test message[y/n]?: ')
++			send_msg = raw_input('Send test message[y/n]?: ')
+ 			if send_msg == 'y':
+ 				message_send(sms, number, ("(3) " + value +
+ 						": ServiceCenterAddress"))
+ 
+ 		elif in_key == '4':
+ 			message_bearer(sms, "ps-only")
+-			send_msg = input('Send test message[y/n]?: ')
++			send_msg = raw_input('Send test message[y/n]?: ')
+ 			if send_msg == 'y':
+ 				message_send(sms, number, ("(4) " + value +
+ 						": Bearer[ps-only]"))
+ 
+ 		elif in_key == '5':
+ 			message_bearer(sms, "cs-only")
+-			send_msg = input('Send test message[y/n]?: ')
++			send_msg = raw_input('Send test message[y/n]?: ')
+ 			if send_msg == 'y':
+ 				message_send(sms, number, ("(5) " + value +
+ 						": Bearer[cs-only]"))
+ 
+ 		elif in_key == '6':
+ 			message_bearer(sms, "ps-preferred")
+-			send_msg = input('Send test message[y/n]?: ')
++			send_msg = raw_input('Send test message[y/n]?: ')
+ 			if send_msg == 'y':
+ 				message_send(sms, number, ("(6) " + value +
+ 						": Bearer[ps-preferred]"))
+ 
+ 		elif in_key == '7':
+ 			message_bearer(sms, "cs-preferred")
+-			send_msg = input('Send test message[y/n]?: ')
++			send_msg = raw_input('Send test message[y/n]?: ')
+ 			if send_msg == 'y':
+ 				message_send(sms,number, ("(7) " + value +
+ 						": Bearer[cs-preferred]"))
+diff --git a/test/test-ss b/test/test-ss
+index 4cd8732..2c80806 100755
+--- a/test/test-ss
++++ b/test/test-ss
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import sys
+ import dbus
+diff --git a/test/test-ss-control-cb b/test/test-ss-control-cb
+index ddae6d3..86bac9b 100755
+--- a/test/test-ss-control-cb
++++ b/test/test-ss-control-cb
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+diff --git a/test/test-ss-control-cf b/test/test-ss-control-cf
+index 095eb5d..d30bf4f 100755
+--- a/test/test-ss-control-cf
++++ b/test/test-ss-control-cf
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+diff --git a/test/test-ss-control-cs b/test/test-ss-control-cs
+index 8180474..e0ed1d1 100755
+--- a/test/test-ss-control-cs
++++ b/test/test-ss-control-cs
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+diff --git a/test/test-stk-menu b/test/test-stk-menu
+index 0cf8fa2..ac0a5bd 100755
+--- a/test/test-stk-menu
++++ b/test/test-stk-menu
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ from gi.repository import GLib
+ 
+@@ -58,7 +58,7 @@ class StkAgent(dbus.service.Object):
+ 			index += 1
+ 
+ 		print("\nDefault: %d" % (default))
+-		select = input("Enter Selection (t, b):")
++		select = raw_input("Enter Selection (t, b):")
+ 
+ 		if select == 'b':
+ 			raise GoBack("User wishes to go back")
+@@ -75,7 +75,7 @@ class StkAgent(dbus.service.Object):
+ 		print("DisplayText (%s)" % (title))
+ 		print("Icon: (%d)" % (int(icon)))
+ 		print("Urgent: (%d)" % (urgent))
+-		key = input("Press return to clear ('t' terminates, "
++		key = raw_input("Press return to clear ('t' terminates, "
+ 						"'b' goes back, 'n' busy, "
+ 						"'w' return and wait):")
+ 
+@@ -108,7 +108,7 @@ class StkAgent(dbus.service.Object):
+ 		print("Hide typing: (%s)" % (hide_typing))
+ 		print("Enter characters, min: %d, max: %d:" % (min_chars,
+ 								max_chars))
+-		userin = input("")
++		userin = raw_input("")
+ 
+ 		return userin
+ 
+@@ -122,7 +122,7 @@ class StkAgent(dbus.service.Object):
+ 		print("Hide typing: (%s)" % (hide_typing))
+ 		print("Enter digits, min: %d, max: %d:" % (min_chars,
+ 								max_chars))
+-		userin = input("'t' terminates, 'b' goes back:")
++		userin = raw_input("'t' terminates, 'b' goes back:")
+ 
+ 		if userin == 'b':
+ 			raise GoBack("User wishes to go back")
+@@ -136,7 +136,7 @@ class StkAgent(dbus.service.Object):
+ 	def RequestKey(self, title, icon):
+ 		print("Title: (%s)" % (title))
+ 		print("Icon: (%d)" % (int(icon)))
+-		key = input("Enter Key (t, b):")
++		key = raw_input("Enter Key (t, b):")
+ 
+ 		if key == 'b':
+ 			raise GoBack("User wishes to go back")
+@@ -150,7 +150,7 @@ class StkAgent(dbus.service.Object):
+ 	def RequestDigit(self, title, icon):
+ 		print("Title: (%s)" % (title))
+ 		print("Icon: (%d)" % (int(icon)))
+-		key = input("Enter Digit (t, b):")
++		key = raw_input("Enter Digit (t, b):")
+ 
+ 		if key == 'b':
+ 			raise GoBack("User wishes to go back")
+@@ -164,7 +164,7 @@ class StkAgent(dbus.service.Object):
+ 	def RequestQuickDigit(self, title, icon):
+ 		print("Title: (%s)" % (title))
+ 		print("Icon: (%d)" % (int(icon)))
+-		key = input("Quick digit (0-9, *, #, t, b):")
++		key = raw_input("Quick digit (0-9, *, #, t, b):")
+ 
+ 		if key == 'b':
+ 			raise GoBack("User wishes to go back")
+@@ -178,7 +178,7 @@ class StkAgent(dbus.service.Object):
+ 	def RequestConfirmation(self, title, icon):
+ 		print("Title: (%s)" % (title))
+ 		print("Icon: (%d)" % (int(icon)))
+-		key = input("Enter Confirmation (t, b, y, n):")
++		key = raw_input("Enter Confirmation (t, b, y, n):")
+ 
+ 		if key == 'b':
+ 			raise GoBack("User wishes to go back")
+@@ -194,7 +194,7 @@ class StkAgent(dbus.service.Object):
+ 	def ConfirmCallSetup(self, info, icon):
+ 		print("Information: (%s)" % (info))
+ 		print("Icon: (%d)" % (int(icon)))
+-		key = input("Enter Confirmation (t, y, n):")
++		key = raw_input("Enter Confirmation (t, y, n):")
+ 
+ 		if key == 't':
+ 			raise EndSession("User wishes to terminate session")
+@@ -209,7 +209,7 @@ class StkAgent(dbus.service.Object):
+ 		print("Information: (%s)" % (info))
+ 		print("Icon: (%d)" % (int(icon)))
+ 		print("URL (%s)" % (url))
+-		key = input("Enter Confirmation (y, n):")
++		key = raw_input("Enter Confirmation (y, n):")
+ 
+ 		if key == 'y':
+ 			return True
+@@ -232,7 +232,7 @@ class StkAgent(dbus.service.Object):
+ 		signal.alarm(5)
+ 
+ 		try:
+-			key = input("Press return to end before end of"
++			key = raw_input("Press return to end before end of"
+ 							 " single tone (t):")
+ 			signal.alarm(0)
+ 
+@@ -250,7 +250,7 @@ class StkAgent(dbus.service.Object):
+ 		print("LoopTone: %s" % (tone))
+ 		print("Text: %s" % (text))
+ 		print("Icon: %d" % (int(icon)))
+-		key = input("Press return to end before timeout "
++		key = raw_input("Press return to end before timeout "
+ 				"('t' terminates, 'w' return and wait):")
+ 
+ 		if key == 'w':
+@@ -279,7 +279,7 @@ class StkAgent(dbus.service.Object):
+ 	def DisplayAction(self, text, icon):
+ 		print("Text: (%s)" % (text))
+ 		print("Icon: (%d)" % (int(icon)))
+-		key = input("Press 't' to terminate the session ")
++		key = raw_input("Press 't' to terminate the session ")
+ 
+ 		if key == 't':
+ 			raise EndSession("User wishes to terminate session")
+@@ -289,7 +289,7 @@ class StkAgent(dbus.service.Object):
+ 	def ConfirmOpenChannel(self, info, icon):
+ 		print("Open channel confirmation: (%s)" % (info))
+ 		print("Icon: (%d)" % (int(icon)))
+-		key = input("Enter Confirmation (t, y, n):")
++		key = raw_input("Enter Confirmation (t, y, n):")
+ 
+ 		if key == 't':
+ 			raise EndSession("User wishes to terminate session")
+@@ -299,7 +299,7 @@ class StkAgent(dbus.service.Object):
+ 			return False
+ 
+ _dbus2py = {
+-	dbus.String : str,
++	dbus.String : unicode,
+ 	dbus.UInt32 : int,
+ 	dbus.Int32 : int,
+ 	dbus.Int16 : int,
+@@ -396,7 +396,7 @@ if __name__ == '__main__':
+ 		except:
+ 			pass
+ 
+-		select = int(input("Enter Selection: "))
++		select = int(raw_input("Enter Selection: "))
+ 		stk.SelectItem(select, path)
+ 	elif mode == 'agent':
+ 		path = "/test/agent"
+diff --git a/test/unlock-pin b/test/unlock-pin
+index 61f4765..10b6626 100755
+--- a/test/unlock-pin
++++ b/test/unlock-pin
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python3
++#!/usr/bin/python
+ 
+ import dbus
+ import sys
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/ofono/ofono/ofono b/meta/recipes-connectivity/ofono/ofono/ofono
new file mode 100644
index 0000000..cc99709
--- /dev/null
+++ b/meta/recipes-connectivity/ofono/ofono/ofono
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/ofonod
+PIDFILE=/var/run/ofonod.pid
+DESC="Telephony daemon"
+
+if [ -f /etc/default/ofono ] ; then
+	. /etc/default/ofono
+fi
+
+set -e
+
+do_start() {
+	$DAEMON
+}
+
+do_stop() {
+	start-stop-daemon --stop --name ofonod --quiet
+}
+
+case "$1" in
+  start)
+	echo "Starting $DESC"
+	do_start
+	;;
+  stop)
+	echo "Stopping $DESC"
+	do_stop
+	;;
+  restart|force-reload)
+	echo "Restarting $DESC"
+	do_stop
+	sleep 1
+	do_start
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-connectivity/ofono/ofono_1.16.bb b/meta/recipes-connectivity/ofono/ofono_1.16.bb
new file mode 100644
index 0000000..fbf13e5
--- /dev/null
+++ b/meta/recipes-connectivity/ofono/ofono_1.16.bb
@@ -0,0 +1,12 @@
+require ofono.inc
+
+SRC_URI  = "\
+  ${KERNELORG_MIRROR}/linux/network/${BPN}/${BP}.tar.xz \
+  file://ofono \
+  file://Revert-test-Convert-to-Python-3.patch \
+  file://0001-backtrace-Disable-for-non-glibc-C-libraries.patch \
+"
+SRC_URI[md5sum] = "c31b5b55a1d68354bff771d3edf02829"
+SRC_URI[sha256sum] = "403b98dadece8bc804c0bd16b96d3db5a3bb0f84af64b3d67924da2d1a754b07"
+
+CFLAGS_append_libc-uclibc = " -D_GNU_SOURCE"
diff --git a/meta/recipes-connectivity/ofono/ofono_git.bb b/meta/recipes-connectivity/ofono/ofono_git.bb
new file mode 100644
index 0000000..beafb77
--- /dev/null
+++ b/meta/recipes-connectivity/ofono/ofono_git.bb
@@ -0,0 +1,14 @@
+require ofono.inc
+
+S	 = "${WORKDIR}/git"
+SRCREV = "14544d5996836f628613c2ce544380ee6fc8f514"
+PV	 = "0.12-git${SRCPV}"
+PR = "r5"
+
+SRC_URI  = "git://git.kernel.org/pub/scm/network/ofono/ofono.git \
+	    file://ofono"
+
+do_configure_prepend () {
+  ${S}/bootstrap
+}
+
diff --git a/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch b/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch
new file mode 100644
index 0000000..adc25c6
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/add-test-support-for-busybox.patch
@@ -0,0 +1,69 @@
+Adjust test cases to work with busybox.
+
+- Replace dd parameter "obs" with "bs".
+- Replace "head -<num>" with "head -n <num>".
+
+Signed-off-by: Maxin B. John <maxin.john@enea.com>
+Upstream-Status: Pending
+
+Index: openssh-6.8p1/regress/cipher-speed.sh
+===================================================================
+--- openssh-6.8p1.orig/regress/cipher-speed.sh
++++ openssh-6.8p1/regress/cipher-speed.sh
+@@ -17,7 +17,7 @@ for c in `${SSH} -Q cipher`; do n=0; for
+ 		printf "%-60s" "$c/$m:"
+ 		( ${SSH} -o 'compression no' \
+ 			-F $OBJ/ssh_proxy -2 -m $m -c $c somehost \
+-			exec sh -c \'"dd of=/dev/null obs=32k"\' \
++			exec sh -c \'"dd of=/dev/null bs=32k"\' \
+ 		< ${DATA} ) 2>&1 | getbytes
+ 
+ 		if [ $? -ne 0 ]; then
+@@ -42,7 +42,7 @@ for c in $ciphers; do
+ 		printf "%-60s" "$c:"
+ 		( ${SSH} -o 'compression no' \
+ 			-F $OBJ/ssh_proxy -1 -c $c somehost \
+-			exec sh -c \'"dd of=/dev/null obs=32k"\' \
++			exec sh -c \'"dd of=/dev/null bs=32k"\' \
+ 		< ${DATA} ) 2>&1 | getbytes
+ 		if [ $? -ne 0 ]; then
+ 			fail "ssh -1 failed with cipher $c"
+Index: openssh-6.8p1/regress/transfer.sh
+===================================================================
+--- openssh-6.8p1.orig/regress/transfer.sh
++++ openssh-6.8p1/regress/transfer.sh
+@@ -15,7 +15,7 @@ for p in ${SSH_PROTOCOLS}; do
+ 	for s in 10 100 1k 32k 64k 128k 256k; do
+ 		trace "proto $p dd-size ${s}"
+ 		rm -f ${COPY}
+-		dd if=$DATA obs=${s} 2> /dev/null | \
++		dd if=$DATA bs=${s} 2> /dev/null | \
+ 			${SSH} -q -$p -F $OBJ/ssh_proxy somehost "cat > ${COPY}"
+ 		if [ $? -ne 0 ]; then
+ 			fail "ssh cat $DATA failed"
+Index: openssh-6.8p1/regress/yes-head.sh
+===================================================================
+--- openssh-6.8p1.orig/regress/yes-head.sh
++++ openssh-6.8p1/regress/yes-head.sh
+@@ -4,7 +4,7 @@
+ tid="yes pipe head"
+ 
+ for p in ${SSH_PROTOCOLS}; do
+-	lines=`${SSH} -$p -F $OBJ/ssh_proxy thishost 'sh -c "while true;do echo yes;done | _POSIX2_VERSION=199209 head -2000"' | (sleep 3 ; wc -l)`
++	lines=`${SSH} -$p -F $OBJ/ssh_proxy thishost 'sh -c "while true;do echo yes;done | _POSIX2_VERSION=199209 head -n 2000"' | (sleep 3 ; wc -l)`
+ 	if [ $? -ne 0 ]; then
+ 		fail "yes|head test failed"
+ 		lines = 0;
+Index: openssh-6.8p1/regress/key-options.sh
+===================================================================
+--- openssh-6.8p1.orig/regress/key-options.sh
++++ openssh-6.8p1/regress/key-options.sh
+@@ -54,7 +54,7 @@ for p in ${SSH_PROTOCOLS}; do
+ 	fi
+ 
+ 	sed 's/.*/from="'"$f"'" &/' $origkeys >$authkeys
+-	from=`head -1 $authkeys | cut -f1 -d ' '`
++	from=`head -n 1 $authkeys | cut -f1 -d ' '`
+ 	verbose "key option proto $p $from"
+ 	r=`${SSH} -$p -q -F $OBJ/ssh_proxy somehost 'echo true'`
+ 	if [ "$r" = "true" ]; then
diff --git a/meta/recipes-connectivity/openssh/openssh/init b/meta/recipes-connectivity/openssh/openssh/init
new file mode 100644
index 0000000..70d4a34
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/init
@@ -0,0 +1,115 @@
+#! /bin/sh
+set -e
+
+PIDFILE=/var/run/sshd.pid
+
+# source function library
+. /etc/init.d/functions
+
+# /etc/init.d/ssh: start and stop the OpenBSD "secure shell" daemon
+
+test -x /usr/sbin/sshd || exit 0
+( /usr/sbin/sshd -\? 2>&1 | grep -q OpenSSH ) 2>/dev/null || exit 0
+
+# /etc/default/ssh may set SYSCONFDIR and SSHD_OPTS
+if test -f /etc/default/ssh; then
+    . /etc/default/ssh
+fi
+
+[ -z "$SYSCONFDIR" ] && SYSCONFDIR=/etc/ssh
+mkdir -p $SYSCONFDIR
+
+HOST_KEY_RSA=$SYSCONFDIR/ssh_host_rsa_key
+HOST_KEY_DSA=$SYSCONFDIR/ssh_host_dsa_key
+HOST_KEY_ECDSA=$SYSCONFDIR/ssh_host_ecdsa_key
+HOST_KEY_ED25519=$SYSCONFDIR/ssh_host_ed25519_key
+
+check_for_no_start() {
+    # forget it if we're trying to start, and /etc/ssh/sshd_not_to_be_run exists
+    if [ -e $SYSCONFDIR/sshd_not_to_be_run ]; then
+	echo "OpenBSD Secure Shell server not in use ($SYSCONFDIR/sshd_not_to_be_run)"
+	exit 0
+    fi
+}
+
+check_privsep_dir() {
+    # Create the PrivSep empty dir if necessary
+    if [ ! -d /var/run/sshd ]; then
+	mkdir /var/run/sshd
+	chmod 0755 /var/run/sshd
+    fi
+}
+
+check_config() {
+	/usr/sbin/sshd -t || exit 1
+}
+
+check_keys() {
+	# create keys if necessary
+	if [ ! -f $HOST_KEY_RSA ]; then
+		echo "  generating ssh RSA key..."
+		ssh-keygen -q -f $HOST_KEY_RSA -N '' -t rsa
+	fi
+	if [ ! -f $HOST_KEY_ECDSA ]; then
+		echo "  generating ssh ECDSA key..."
+		ssh-keygen -q -f $HOST_KEY_ECDSA -N '' -t ecdsa
+	fi
+	if [ ! -f $HOST_KEY_DSA ]; then
+		echo "  generating ssh DSA key..."
+		ssh-keygen -q -f $HOST_KEY_DSA -N '' -t dsa
+	fi
+	if [ ! -f $HOST_KEY_ED25519 ]; then
+		echo "  generating ssh ED25519 key..."
+		ssh-keygen -q -f $HOST_KEY_ED25519 -N '' -t ed25519
+	fi
+}
+
+export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
+
+case "$1" in
+  start)
+	check_for_no_start
+	echo "Starting OpenBSD Secure Shell server: sshd"
+	check_keys
+	check_privsep_dir
+	start-stop-daemon -S -p $PIDFILE -x /usr/sbin/sshd -- $SSHD_OPTS
+        echo "done."
+	;;
+  stop)
+        echo -n "Stopping OpenBSD Secure Shell server: sshd"
+	start-stop-daemon -K -p $PIDFILE -x /usr/sbin/sshd
+        echo "."
+	;;
+
+  reload|force-reload)
+	check_for_no_start
+	check_keys
+	check_config
+        echo -n "Reloading OpenBSD Secure Shell server's configuration"
+	start-stop-daemon -K -p $PIDFILE -s 1 -x /usr/sbin/sshd
+	echo "."
+	;;
+
+  restart)
+  	check_keys
+	check_config
+        echo -n "Restarting OpenBSD Secure Shell server: sshd"
+	start-stop-daemon -K -p $PIDFILE --oknodo -x /usr/sbin/sshd
+	check_for_no_start
+	check_privsep_dir
+	sleep 2
+	start-stop-daemon -S -p $PIDFILE -x /usr/sbin/sshd -- $SSHD_OPTS
+	echo "."
+	;;
+
+  status)
+	status /usr/sbin/sshd
+	exit $?
+  ;;
+
+  *)
+	echo "Usage: /etc/init.d/ssh {start|stop|status|reload|force-reload|restart}"
+	exit 1
+esac
+
+exit 0
diff --git a/meta/recipes-connectivity/openssh/openssh/run-ptest b/meta/recipes-connectivity/openssh/openssh/run-ptest
new file mode 100755
index 0000000..564c0c8
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+export TEST_SHELL=sh
+
+cd regress
+make -k .OBJDIR=`pwd` .CURDIR=`pwd` SUDO="sudo" tests \
+        | sed -e 's/^skipped/SKIP: /g' -e 's/^ok /PASS: /g' -e 's/^failed/FAIL: /g'
diff --git a/meta/recipes-connectivity/openssh/openssh/ssh_config b/meta/recipes-connectivity/openssh/openssh/ssh_config
new file mode 100644
index 0000000..9e91915
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/ssh_config
@@ -0,0 +1,48 @@
+#	$OpenBSD: ssh_config,v 1.28 2013/09/16 11:35:43 sthen Exp $
+
+# This is the ssh client system-wide configuration file.  See
+# ssh_config(5) for more information.  This file provides defaults for
+# users, and the values can be changed in per-user configuration files
+# or on the command line.
+
+# Configuration data is parsed as follows:
+#  1. command line options
+#  2. user-specific file
+#  3. system-wide file
+# Any configuration value is only changed the first time it is set.
+# Thus, host-specific definitions should be at the beginning of the
+# configuration file, and defaults at the end.
+
+# Site-wide defaults for some commonly used options.  For a comprehensive
+# list of available options, their meanings and defaults, please see the
+# ssh_config(5) man page.
+
+Host *
+  ForwardAgent yes
+  ForwardX11 yes
+#   RhostsRSAAuthentication no
+#   RSAAuthentication yes
+#   PasswordAuthentication yes
+#   HostbasedAuthentication no
+#   GSSAPIAuthentication no
+#   GSSAPIDelegateCredentials no
+#   BatchMode no
+#   CheckHostIP yes
+#   AddressFamily any
+#   ConnectTimeout 0
+#   StrictHostKeyChecking ask
+#   IdentityFile ~/.ssh/identity
+#   IdentityFile ~/.ssh/id_rsa
+#   IdentityFile ~/.ssh/id_dsa
+#   Port 22
+#   Protocol 2,1
+#   Cipher 3des
+#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
+#   MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
+#   EscapeChar ~
+#   Tunnel no
+#   TunnelDevice any:any
+#   PermitLocalCommand no
+#   VisualHostKey no
+#   ProxyCommand ssh -q -W %h:%p gateway.example.com
+#   RekeyLimit 1G 1h
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd b/meta/recipes-connectivity/openssh/openssh/sshd
new file mode 100644
index 0000000..4882e58
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshd
@@ -0,0 +1,10 @@
+#%PAM-1.0
+
+auth       include      common-auth
+account    required     pam_nologin.so
+account    include      common-account
+password   include      common-password
+session    optional     pam_keyinit.so force revoke
+session    include      common-session
+session    required     pam_loginuid.so
+
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd.socket b/meta/recipes-connectivity/openssh/openssh/sshd.socket
new file mode 100644
index 0000000..12c39b2
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshd.socket
@@ -0,0 +1,10 @@
+[Unit]
+Conflicts=sshd.service
+
+[Socket]
+ExecStartPre=@BASE_BINDIR@/mkdir -p /var/run/sshd
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd@.service b/meta/recipes-connectivity/openssh/openssh/sshd@.service
new file mode 100644
index 0000000..bb2d68e
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshd@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenSSH Per-Connection Daemon
+Wants=sshdgenkeys.service
+After=sshdgenkeys.service
+
+[Service]
+ExecStart=-@SBINDIR@/sshd -i
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+StandardInput=socket
+StandardError=syslog
+KillMode=process
diff --git a/meta/recipes-connectivity/openssh/openssh/sshd_config b/meta/recipes-connectivity/openssh/openssh/sshd_config
new file mode 100644
index 0000000..d48bd2b
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshd_config
@@ -0,0 +1,133 @@
+#	$OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
+
+# This is the sshd server system-wide configuration file.  See
+# sshd_config(5) for more information.
+
+# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented.  Uncommented options change a
+# default value.
+
+#Port 22
+#AddressFamily any
+#ListenAddress 0.0.0.0
+#ListenAddress ::
+
+# The default requires explicit activation of protocol 1
+Protocol 2
+
+# HostKey for protocol version 1
+#HostKey /etc/ssh/ssh_host_key
+# HostKeys for protocol version 2
+#HostKey /etc/ssh/ssh_host_rsa_key
+#HostKey /etc/ssh/ssh_host_dsa_key
+#HostKey /etc/ssh/ssh_host_ecdsa_key
+#HostKey /etc/ssh/ssh_host_ed25519_key
+
+# Lifetime and size of ephemeral version 1 server key
+#KeyRegenerationInterval 1h
+#ServerKeyBits 1024
+
+# Ciphers and keying
+#RekeyLimit default none
+
+# Logging
+# obsoletes QuietMode and FascistLogging
+#SyslogFacility AUTH
+#LogLevel INFO
+
+# Authentication:
+
+#LoginGraceTime 2m
+#PermitRootLogin yes
+#StrictModes yes
+#MaxAuthTries 6
+#MaxSessions 10
+
+#RSAAuthentication yes
+#PubkeyAuthentication yes
+
+# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
+# but this is overridden so installations will only check .ssh/authorized_keys
+AuthorizedKeysFile .ssh/authorized_keys
+
+#AuthorizedPrincipalsFile none
+
+#AuthorizedKeysCommand none
+#AuthorizedKeysCommandUser nobody
+
+# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
+#RhostsRSAAuthentication no
+# similar for protocol version 2
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# RhostsRSAAuthentication and HostbasedAuthentication
+#IgnoreUserKnownHosts no
+# Don't read the user's ~/.rhosts and ~/.shosts files
+#IgnoreRhosts yes
+
+# To disable tunneled clear text passwords, change to no here!
+#PasswordAuthentication yes
+#PermitEmptyPasswords no
+
+# Change to no to disable s/key passwords
+ChallengeResponseAuthentication no
+
+# Kerberos options
+#KerberosAuthentication no
+#KerberosOrLocalPasswd yes
+#KerberosTicketCleanup yes
+#KerberosGetAFSToken no
+
+# GSSAPI options
+#GSSAPIAuthentication no
+#GSSAPICleanupCredentials yes
+
+# Set this to 'yes' to enable PAM authentication, account processing,
+# and session processing. If this is enabled, PAM authentication will
+# be allowed through the ChallengeResponseAuthentication and
+# PasswordAuthentication.  Depending on your PAM configuration,
+# PAM authentication via ChallengeResponseAuthentication may bypass
+# the setting of "PermitRootLogin without-password".
+# If you just want the PAM account and session checks to run without
+# PAM authentication, then enable this but set PasswordAuthentication
+# and ChallengeResponseAuthentication to 'no'.
+#UsePAM no
+
+#AllowAgentForwarding yes
+#AllowTcpForwarding yes
+#GatewayPorts no
+#X11Forwarding no
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PermitTTY yes
+#PrintMotd yes
+#PrintLastLog yes
+#TCPKeepAlive yes
+#UseLogin no
+UsePrivilegeSeparation sandbox # Default for new installations.
+#PermitUserEnvironment no
+Compression no
+ClientAliveInterval 15
+ClientAliveCountMax 4
+#UseDNS yes
+#PidFile /var/run/sshd.pid
+#MaxStartups 10:30:100
+#PermitTunnel no
+#ChrootDirectory none
+#VersionAddendum none
+
+# no default banner path
+#Banner none
+
+# override default of no subsystems
+Subsystem	sftp	/usr/libexec/sftp-server
+
+# Example of overriding settings on a per-user basis
+#Match User anoncvs
+#	X11Forwarding no
+#	AllowTcpForwarding no
+#	PermitTTY no
+#	ForceCommand cvs server
diff --git a/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service b/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
new file mode 100644
index 0000000..d65086f
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/sshdgenkeys.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=OpenSSH Key Generation
+ConditionPathExists=|!/etc/ssh/ssh_host_rsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_dsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_ecdsa_key
+ConditionPathExists=|!/etc/ssh/ssh_host_ed25519_key
+
+[Service]
+ExecStart=@BINDIR@/ssh-keygen -A
+Type=oneshot
+RemainAfterExit=yes
diff --git a/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd b/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd
new file mode 100644
index 0000000..a0d2af3
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh/volatiles.99_sshd
@@ -0,0 +1,2 @@
+d root root 0755 /var/run/sshd none
+f root root 0644 /var/log/lastlog none
diff --git a/meta/recipes-connectivity/openssh/openssh_7.1p1.bb b/meta/recipes-connectivity/openssh/openssh_7.1p1.bb
new file mode 100644
index 0000000..eeeb4b4
--- /dev/null
+++ b/meta/recipes-connectivity/openssh/openssh_7.1p1.bb
@@ -0,0 +1,154 @@
+SUMMARY = "Secure rlogin/rsh/rcp/telnet replacement"
+DESCRIPTION = "Secure rlogin/rsh/rcp/telnet replacement (OpenSSH) \
+Ssh (Secure Shell) is a program for logging into a remote machine \
+and for executing commands on a remote machine."
+HOMEPAGE = "http://openssh.org"
+SECTION = "console/network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=e326045657e842541d3f35aada442507"
+
+DEPENDS = "zlib openssl"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+SRC_URI = "ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${PV}.tar.gz \
+           file://sshd_config \
+           file://ssh_config \
+           file://init \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+           file://sshd.socket \
+           file://sshd@.service \
+           file://sshdgenkeys.service \
+           file://volatiles.99_sshd \
+           file://add-test-support-for-busybox.patch \
+           file://run-ptest"
+
+PAM_SRC_URI = "file://sshd"
+
+SRC_URI[md5sum] = "8709736bc8a8c253bc4eeb4829888ca5"
+SRC_URI[sha256sum] = "fc0a6d2d1d063d5c66dffd952493d0cda256cad204f681de0f84ef85b2ad8428"
+
+inherit useradd update-rc.d update-alternatives systemd
+
+USERADD_PACKAGES = "${PN}-sshd"
+USERADD_PARAM_${PN}-sshd = "--system --no-create-home --home-dir /var/run/sshd --shell /bin/false --user-group sshd"
+INITSCRIPT_PACKAGES = "${PN}-sshd"
+INITSCRIPT_NAME_${PN}-sshd = "sshd"
+INITSCRIPT_PARAMS_${PN}-sshd = "defaults 9"
+
+SYSTEMD_PACKAGES = "${PN}-sshd"
+SYSTEMD_SERVICE_${PN}-sshd = "sshd.socket"
+
+inherit autotools-brokensep ptest
+
+# LFS support:
+CFLAGS += "-D__FILE_OFFSET_BITS=64"
+
+# login path is hardcoded in sshd
+EXTRA_OECONF = "'LOGIN_PROGRAM=${base_bindir}/login' \
+                ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
+                --without-zlib-version-check \
+                --with-privsep-path=/var/run/sshd \
+                --sysconfdir=${sysconfdir}/ssh \
+                --with-xauth=/usr/bin/xauth \
+                --disable-strip \
+                "
+
+# Since we do not depend on libbsd, we do not want configure to use it
+# just because it finds libutil.h.  But, specifying --disable-libutil
+# causes compile errors, so...
+CACHED_CONFIGUREVARS += "ac_cv_header_bsd_libutil_h=no ac_cv_header_libutil_h=no"
+
+# passwd path is hardcoded in sshd
+CACHED_CONFIGUREVARS += "ac_cv_path_PATH_PASSWD_PROG=${bindir}/passwd"
+
+# We don't want to depend on libblockfile
+CACHED_CONFIGUREVARS += "ac_cv_header_maillock_h=no"
+
+# This is a workaround for uclibc because including stdio.h
+# pulls in pthreads.h and causes conflicts in function prototypes.
+# This results in compilation failure, so unless this is fixed,
+# disable pam for uclibc.
+EXTRA_OECONF_append_libc-uclibc=" --without-pam"
+
+do_configure_prepend () {
+	export LD="${CC}"
+	install -m 0644 ${WORKDIR}/sshd_config ${B}/
+	install -m 0644 ${WORKDIR}/ssh_config ${B}/
+	if [ ! -e acinclude.m4 -a -e aclocal.m4 ]; then
+		cp aclocal.m4 acinclude.m4
+	fi
+}
+
+do_compile_ptest() {
+        # skip regress/unittests/ binaries: this will silently skip
+        # unittests in run-ptests which is good because they are so slow.
+        oe_runmake regress/modpipe regress/setuid-allowed regress/netcat
+}
+
+do_install_append () {
+	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+		install -D -m 0755 ${WORKDIR}/sshd ${D}${sysconfdir}/pam.d/sshd
+		sed -i -e 's:#UsePAM no:UsePAM yes:' ${WORKDIR}/sshd_config ${D}${sysconfdir}/ssh/sshd_config
+	fi
+
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/sshd
+	rm -f ${D}${bindir}/slogin ${D}${datadir}/Ssh.bin
+	rmdir ${D}${localstatedir}/run/sshd ${D}${localstatedir}/run ${D}${localstatedir}
+	install -d ${D}/${sysconfdir}/default/volatiles
+	install -m 644 ${WORKDIR}/volatiles.99_sshd ${D}/${sysconfdir}/default/volatiles/99_sshd
+	install -m 0755 ${S}/contrib/ssh-copy-id ${D}${bindir}
+
+	# Create config files for read-only rootfs
+	install -d ${D}${sysconfdir}/ssh
+	install -m 644 ${D}${sysconfdir}/ssh/sshd_config ${D}${sysconfdir}/ssh/sshd_config_readonly
+	sed -i '/HostKey/d' ${D}${sysconfdir}/ssh/sshd_config_readonly
+	echo "HostKey /var/run/ssh/ssh_host_rsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+	echo "HostKey /var/run/ssh/ssh_host_dsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+	echo "HostKey /var/run/ssh/ssh_host_ecdsa_key" >> ${D}${sysconfdir}/ssh/sshd_config_readonly
+
+	install -d ${D}${systemd_unitdir}/system
+	install -c -m 0644 ${WORKDIR}/sshd.socket ${D}${systemd_unitdir}/system
+	install -c -m 0644 ${WORKDIR}/sshd@.service ${D}${systemd_unitdir}/system
+	install -c -m 0644 ${WORKDIR}/sshdgenkeys.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+		-e 's,@SBINDIR@,${sbindir},g' \
+		-e 's,@BINDIR@,${bindir},g' \
+		${D}${systemd_unitdir}/system/sshd.socket ${D}${systemd_unitdir}/system/*.service
+}
+
+do_install_ptest () {
+	sed -i -e "s|^SFTPSERVER=.*|SFTPSERVER=${libdir}/${PN}/sftp-server|" regress/test-exec.sh
+	cp -r regress ${D}${PTEST_PATH}
+}
+
+ALLOW_EMPTY_${PN} = "1"
+
+PACKAGES =+ "${PN}-keygen ${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-sftp ${PN}-misc ${PN}-sftp-server"
+FILES_${PN}-scp = "${bindir}/scp.${BPN}"
+FILES_${PN}-ssh = "${bindir}/ssh.${BPN} ${sysconfdir}/ssh/ssh_config"
+FILES_${PN}-sshd = "${sbindir}/sshd ${sysconfdir}/init.d/sshd ${systemd_unitdir}/system"
+FILES_${PN}-sshd += "${sysconfdir}/ssh/moduli ${sysconfdir}/ssh/sshd_config ${sysconfdir}/ssh/sshd_config_readonly ${sysconfdir}/default/volatiles/99_sshd ${sysconfdir}/pam.d/sshd"
+FILES_${PN}-sftp = "${bindir}/sftp"
+FILES_${PN}-sftp-server = "${libexecdir}/sftp-server"
+FILES_${PN}-misc = "${bindir}/ssh* ${libexecdir}/ssh*"
+FILES_${PN}-keygen = "${bindir}/ssh-keygen"
+
+RDEPENDS_${PN} += "${PN}-scp ${PN}-ssh ${PN}-sshd ${PN}-keygen"
+RDEPENDS_${PN}-sshd += "${PN}-keygen ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-keyinit pam-plugin-loginuid', '', d)}"
+RDEPENDS_${PN}-ptest += "${PN}-sftp ${PN}-misc ${PN}-sftp-server make"
+
+RPROVIDES_${PN}-ssh = "ssh"
+RPROVIDES_${PN}-sshd = "sshd"
+
+RCONFLICTS_${PN} = "dropbear"
+RCONFLICTS_${PN}-sshd = "dropbear"
+RCONFLICTS_${PN}-keygen = "ssh-keygen"
+
+CONFFILES_${PN}-sshd = "${sysconfdir}/ssh/sshd_config"
+CONFFILES_${PN}-ssh = "${sysconfdir}/ssh/ssh_config"
+
+ALTERNATIVE_PRIORITY = "90"
+ALTERNATIVE_${PN}-scp = "scp"
+ALTERNATIVE_${PN}-ssh = "ssh"
+
diff --git a/meta/recipes-connectivity/openssl/openssl.inc b/meta/recipes-connectivity/openssl/openssl.inc
new file mode 100644
index 0000000..53dcfd9
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl.inc
@@ -0,0 +1,214 @@
+SUMMARY = "Secure Socket Layer"
+DESCRIPTION = "Secure Socket Layer (SSL) binary and related cryptographic tools."
+HOMEPAGE = "http://www.openssl.org/"
+BUGTRACKER = "http://www.openssl.org/news/vulnerabilities.html"
+SECTION = "libs/network"
+
+# "openssl | SSLeay" dual license
+LICENSE = "openssl"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8"
+
+DEPENDS = "perl-native-runtime"
+DEPENDS_append_class-target = " openssl-native"
+
+SRC_URI = "http://www.openssl.org/source/openssl-${PV}.tar.gz \
+          "
+S = "${WORKDIR}/openssl-${PV}"
+
+PACKAGECONFIG[perl] = ",,,"
+
+AR_append = " r"
+# Avoid binaries being marked as requiring an executable stack since it 
+# doesn't(which causes and this causes issues with SELinux
+CFLAG = "${@base_conditional('SITEINFO_ENDIANNESS', 'le', '-DL_ENDIAN', '-DB_ENDIAN', d)} \
+	-DTERMIO ${CFLAGS} -Wall -Wa,--noexecstack"
+
+# -02 does not work on mipsel: ssh hangs when it tries to read /dev/urandom
+CFLAG_mtx-1 := "${@'${CFLAG}'.replace('-O2', '')}"
+CFLAG_mtx-2 := "${@'${CFLAG}'.replace('-O2', '')}"
+
+export DIRS = "crypto ssl apps"
+export EX_LIBS = "-lgcc -ldl"
+export AS = "${CC} -c"
+
+inherit pkgconfig siteinfo multilib_header ptest
+
+PACKAGES =+ "libcrypto libssl ${PN}-misc openssl-conf"
+FILES_libcrypto = "${base_libdir}/libcrypto${SOLIBS}"
+FILES_libssl = "${libdir}/libssl.so.*"
+FILES_${PN} =+ " ${libdir}/ssl/*"
+FILES_${PN}-misc = "${libdir}/ssl/misc ${bindir}/c_rehash"
+RDEPENDS_${PN}-misc = "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}"
+FILES_${PN}-dev += "${base_libdir}/libcrypto${SOLIBSDEV}"
+
+# Add the openssl.cnf file to the openssl-conf package.  Make the libcrypto
+# package RRECOMMENDS on this package.  This will enable the configuration
+# file to be installed for both the base openssl package and the libcrypto
+# package since the base openssl package depends on the libcrypto package.
+FILES_openssl-conf = "${libdir}/ssl/openssl.cnf"
+CONFFILES_openssl-conf = "${libdir}/ssl/openssl.cnf"
+RRECOMMENDS_libcrypto += "openssl-conf"
+RDEPENDS_${PN}-ptest += "${PN}-misc make perl perl-module-filehandle bc"
+
+# Remove this to enable SSLv3. SSLv3 is defaulted to disabled due to the POODLE
+# vulnerability
+EXTRA_OECONF = " -no-ssl3"
+
+do_configure_prepend_darwin () {
+	sed -i -e '/version-script=openssl\.ld/d' Configure
+}
+
+do_configure () {
+	cd util
+	perl perlpath.pl ${STAGING_BINDIR_NATIVE}
+	cd ..
+	ln -sf apps/openssl.pod crypto/crypto.pod ssl/ssl.pod doc/
+
+	os=${HOST_OS}
+	case $os in
+	linux-uclibc |\
+	linux-uclibceabi |\
+	linux-gnueabi |\
+	linux-uclibcspe |\
+	linux-gnuspe |\
+	linux-musl*)
+		os=linux
+		;;
+		*)
+		;;
+	esac
+	target="$os-${HOST_ARCH}"
+	case $target in
+	linux-arm)
+		target=linux-armv4
+		;;
+	linux-armeb)
+		target=linux-elf-armeb
+		;;
+	linux-aarch64*)
+		target=linux-generic64
+		;;
+	linux-sh3)
+		target=debian-sh3
+		;;
+	linux-sh4)
+		target=debian-sh4
+		;;
+	linux-i486)
+		target=debian-i386-i486
+		;;
+	linux-i586 | linux-viac3)
+		target=debian-i386-i586
+		;;
+	linux-i686)
+		target=debian-i386-i686/cmov
+		;;
+	linux-gnux32-x86_64)
+		target=linux-x32
+		;;
+	linux-gnu64-x86_64)
+		target=linux-x86_64
+		;;
+	linux-mips)
+		target=debian-mips
+		;;
+	linux-mipsel)
+		target=debian-mipsel
+		;;
+        linux-*-mips64)
+               target=linux-mips
+                ;;
+	linux-microblaze*)
+		target=linux-generic32
+		;;
+	linux-powerpc)
+		target=linux-ppc
+		;;
+	linux-powerpc64)
+		target=linux-ppc64
+		;;
+	linux-supersparc)
+		target=linux-sparcv8
+		;;
+	linux-sparc)
+		target=linux-sparcv8
+		;;
+	darwin-i386)
+		target=darwin-i386-cc
+		;;
+	esac
+	# inject machine-specific flags
+	sed -i -e "s|^\(\"$target\",\s*\"[^:]\+\):\([^:]\+\)|\1:${CFLAG}|g" Configure
+        useprefix=${prefix}
+        if [ "x$useprefix" = "x" ]; then
+                useprefix=/
+        fi        
+	perl ./Configure ${EXTRA_OECONF} shared --prefix=$useprefix --openssldir=${libdir}/ssl --libdir=`basename ${libdir}` $target
+}
+
+do_compile_prepend_class-target () {
+    sed -i 's/\((OPENSSL=\)".*"/\1"openssl"/' Makefile
+}
+
+do_compile () {
+	oe_runmake
+}
+
+do_compile_ptest () {
+	oe_runmake buildtest
+}
+
+do_install () {
+	# Create ${D}/${prefix} to fix parallel issues
+	mkdir -p ${D}/${prefix}/
+
+	oe_runmake INSTALL_PREFIX="${D}" MANDIR="${mandir}" install
+
+	oe_libinstall -so libcrypto ${D}${libdir}
+	oe_libinstall -so libssl ${D}${libdir}
+
+	# Moving libcrypto to /lib
+	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+		mkdir -p ${D}/${base_libdir}/
+		mv ${D}${libdir}/libcrypto* ${D}${base_libdir}/
+		sed -i s#libdir=\$\{exec_prefix\}\/lib#libdir=${base_libdir}# ${D}/${libdir}/pkgconfig/libcrypto.pc
+	fi
+
+	install -d ${D}${includedir}
+	cp --dereference -R include/openssl ${D}${includedir}
+
+	oe_multilib_header openssl/opensslconf.h
+	if [ "${@bb.utils.contains('PACKAGECONFIG', 'perl', 'perl', '', d)}" = "perl" ]; then
+		install -m 0755 ${S}/tools/c_rehash ${D}${bindir}
+		sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${bindir}/c_rehash
+		sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/CA.pl
+		sed -i -e '1s,.*,#!${bindir}/env perl,' ${D}${libdir}/ssl/misc/tsget
+		# The c_rehash utility isn't installed by the normal installation process.
+	else
+		rm -f ${D}${bindir}/c_rehash
+		rm -f ${D}${libdir}/ssl/misc/CA.pl ${D}${libdir}/ssl/misc/tsget
+	fi
+}
+
+do_install_ptest () {
+	cp -r Makefile test ${D}${PTEST_PATH}
+	cp -r certs ${D}${PTEST_PATH}
+	mkdir -p ${D}${PTEST_PATH}/apps
+	ln -sf /usr/lib/ssl/misc/CA.sh  ${D}${PTEST_PATH}/apps
+	ln -sf /usr/lib/ssl/openssl.cnf ${D}${PTEST_PATH}/apps
+	ln -sf /usr/bin/openssl         ${D}${PTEST_PATH}/apps
+	cp apps/server2.pem             ${D}${PTEST_PATH}/apps
+	mkdir -p ${D}${PTEST_PATH}/util
+	install util/opensslwrap.sh    ${D}${PTEST_PATH}/util
+	install util/shlib_wrap.sh     ${D}${PTEST_PATH}/util
+}
+
+do_install_append_class-native() {
+	create_wrapper ${D}${bindir}/openssl \
+	    OPENSSL_CONF=${libdir}/ssl/openssl.cnf \
+	    SSL_CERT_DIR=${libdir}/ssl/certs \
+	    SSL_CERT_FILE=${libdir}/ssl/cert.pem \
+	    OPENSSL_ENGINES=${libdir}/ssl/engines
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch b/meta/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch
new file mode 100644
index 0000000..249446a
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/Makefiles-ptest.patch
@@ -0,0 +1,77 @@
+Add 'buildtest' and 'runtest' targets to Makefile, to build and run tests
+cross-compiled.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Signed-off-by: Maxin B. John <maxin.john@enea.com>
+Upstream-Status: Pending
+---
+Index: openssl-1.0.2/Makefile.org
+===================================================================
+--- openssl-1.0.2.orig/Makefile.org
++++ openssl-1.0.2/Makefile.org
+@@ -451,8 +451,16 @@ rehash.time: certs apps
+ test:   tests
+ 
+ tests: rehash
++	$(MAKE) buildtest
++	$(MAKE) runtest
++
++buildtest:
++	@(cd test && \
++	$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf exe apps);
++
++runtest:
+ 	@(cd test && echo "testing..." && \
+-	$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
++	$(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf alltests );
+ 	OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
+ 
+ report:
+Index: openssl-1.0.2/test/Makefile
+===================================================================
+--- openssl-1.0.2.orig/test/Makefile
++++ openssl-1.0.2/test/Makefile
+@@ -137,7 +137,7 @@ tests:	exe apps $(TESTS)
+ apps:
+ 	@(cd ..; $(MAKE) DIRS=apps all)
+ 
+-alltests: \
++all-tests= \
+ 	test_des test_idea test_sha test_md4 test_md5 test_hmac \
+ 	test_md2 test_mdc2 test_wp \
+ 	test_rmd test_rc2 test_rc4 test_rc5 test_bf test_cast test_aes \
+@@ -148,6 +148,11 @@ alltests: \
+ 	test_jpake test_srp test_cms test_ocsp test_v3name test_heartbeat \
+ 	test_constant_time
+ 
++alltests:
++	@(for i in $(all-tests); do \
++	( $(MAKE) $$i && echo "PASS: $$i" ) || echo "FAIL: $$i"; \
++	done)
++
+ test_evp: $(EVPTEST)$(EXE_EXT) evptests.txt
+ 	../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt
+ 
+@@ -213,7 +218,7 @@ test_x509: ../apps/openssl$(EXE_EXT) tx5
+ 	echo test second x509v3 certificate
+ 	sh ./tx509 v3-cert2.pem 2>/dev/null
+ 
+-test_rsa: $(RSATEST)$(EXE_EXT) ../apps/openssl$(EXE_EXT) trsa testrsa.pem
++test_rsa: ../apps/openssl$(EXE_EXT) trsa testrsa.pem
+ 	@sh ./trsa 2>/dev/null
+ 	../util/shlib_wrap.sh ./$(RSATEST)
+ 
+@@ -313,11 +318,11 @@ test_tsa: ../apps/openssl$(EXE_EXT) test
+ 	  sh ./testtsa; \
+ 	fi
+ 
+-test_ige: $(IGETEST)$(EXE_EXT)
++test_ige:
+ 	@echo "Test IGE mode"
+ 	../util/shlib_wrap.sh ./$(IGETEST)
+ 
+-test_jpake: $(JPAKETEST)$(EXE_EXT)
++test_jpake:
+ 	@echo "Test JPAKE"
+ 	../util/shlib_wrap.sh ./$(JPAKETEST)
+ 
diff --git a/meta/recipes-connectivity/openssl/openssl/configure-targets.patch b/meta/recipes-connectivity/openssl/openssl/configure-targets.patch
new file mode 100644
index 0000000..691e74a
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/configure-targets.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+The number of colons are important :)
+
+
+---
+ Configure |   16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+Index: openssl-1.0.2a/Configure
+===================================================================
+--- openssl-1.0.2a.orig/Configure
++++ openssl-1.0.2a/Configure
+@@ -443,6 +443,23 @@ my %table=(
+ "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
+ "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}",
+ 
++ 
++# Linux on ARM
++"linux-elf-arm","$ENV{'CC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-elf-armeb","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-gnueabi-arm","$ENV{'CC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-gnueabi-armeb","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-uclibceabi-arm","$ENV{'CC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-uclibceabi-armeb","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++
++"linux-avr32","$ENV{'CC'}:-O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).",
++
++#### Linux on MIPS/MIPS64
++"linux-mips","$ENV{'CC'}:-DB_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-mips64","$ENV{'CC'}:-DB_ENDIAN -mabi=64 -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-mips64el","$ENV{'CC'}:-DL_ENDIAN -mabi=64 -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"linux-mipsel","$ENV{'CC'}:-DL_ENDIAN -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++
+ # Android: linux-* but without pointers to headers and libs.
+ "android","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+ "android-x86","gcc:-mandroid -I\$(ANDROID_DEV)/include -B\$(ANDROID_DEV)/lib -O3 -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:".eval{my $asm=${x86_elf_asm};$asm=~s/:elf/:android/;$asm}.":dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
diff --git a/meta/recipes-connectivity/openssl/openssl/crypto_use_bigint_in_x86-64_perl.patch b/meta/recipes-connectivity/openssl/openssl/crypto_use_bigint_in_x86-64_perl.patch
new file mode 100644
index 0000000..c397af2
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/crypto_use_bigint_in_x86-64_perl.patch
@@ -0,0 +1,35 @@
+Upsteram Status: Backport
+
+When building on x32 systems where the default type is 32bit, make sure
+we can transparently represent 64bit integers.  Otherwise we end up with
+build errors like:
+/usr/bin/perl asm/ghash-x86_64.pl elf > ghash-x86_64.s
+Integer overflow in hexadecimal number at asm/../../perlasm/x86_64-xlate.pl line 201, <> line 890.
+...
+ghash-x86_64.s: Assembler messages:
+ghash-x86_64.s:890: Error: junk '.15473355479995e+19' after expression
+
+We don't enable this globally as there are some cases where we'd get
+32bit values interpreted as unsigned when we need them as signed.
+
+Reported-by: Bertrand Jacquin <bertrand@jacquin.bzh>
+URL: https://bugs.gentoo.org/542618
+
+Signed-off-By: Armin Kuster <akuster@mvista.com>
+
+Index: openssl-1.0.2a/crypto/perlasm/x86_64-xlate.pl
+===================================================================
+--- openssl-1.0.2a.orig/crypto/perlasm/x86_64-xlate.pl
++++ openssl-1.0.2a/crypto/perlasm/x86_64-xlate.pl
+@@ -194,7 +194,10 @@ my %globals;
+     }
+     sub out {
+     	my $self = shift;
+-
++	# When building on x32 ABIs, the expanded hex value might be too
++	# big to fit into 32bits. Enable transparent 64bit support here
++	# so we can safely print it out.
++	use bigint;
+ 	if ($gas) {
+ 	    # Solaris /usr/ccs/bin/as can't handle multiplications
+ 	    # in $self->{value}
diff --git a/meta/recipes-connectivity/openssl/openssl/debian/c_rehash-compat.patch b/meta/recipes-connectivity/openssl/openssl/debian/c_rehash-compat.patch
new file mode 100644
index 0000000..68e54d5
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian/c_rehash-compat.patch
@@ -0,0 +1,71 @@
+From 83f318d68bbdab1ca898c94576a838cc97df4700 Mon Sep 17 00:00:00 2001
+From: Ludwig Nussel <ludwig.nussel@suse.de>
+Date: Wed, 21 Apr 2010 15:52:10 +0200
+Subject: [PATCH] also create old hash for compatibility
+
+Upstream-Status: Backport [debian]
+
+diff --git a/tools/c_rehash.in b/tools/c_rehash.in
+index b086ff9..b777d79 100644
+--- a/tools/c_rehash.in
++++ b/tools/c_rehash.in
+@@ -8,8 +8,6 @@ my $prefix;
+ 
+ my $openssl = $ENV{OPENSSL} || "openssl";
+ my $pwd;
+-my $x509hash = "-subject_hash";
+-my $crlhash = "-hash";
+ my $verbose = 0;
+ my $symlink_exists=eval {symlink("",""); 1};
+ my $removelinks = 1;
+@@ -18,10 +16,7 @@ my $removelinks = 1;
+ while ( $ARGV[0] =~ /^-/ ) {
+     my $flag = shift @ARGV;
+     last if ( $flag eq '--');
+-    if ( $flag eq '-old') {
+-	    $x509hash = "-subject_hash_old";
+-	    $crlhash = "-hash_old";
+-    } elsif ( $flag eq '-h') {
++    if ( $flag eq '-h') {
+ 	    help();
+     } elsif ( $flag eq '-n' ) {
+ 	    $removelinks = 0;
+@@ -113,7 +108,9 @@ sub hash_dir {
+ 			next;
+ 		}
+ 		link_hash_cert($fname) if($cert);
++		link_hash_cert_old($fname) if($cert);
+ 		link_hash_crl($fname) if($crl);
++		link_hash_crl_old($fname) if($crl);
+ 	}
+ }
+ 
+@@ -146,6 +143,7 @@ sub check_file {
+ 
+ sub link_hash_cert {
+ 		my $fname = $_[0];
++		my $x509hash = $_[1] || '-subject_hash';
+ 		$fname =~ s/'/'\\''/g;
+ 		my ($hash, $fprint) = `"$openssl" x509 $x509hash -fingerprint -noout -in "$fname"`;
+ 		chomp $hash;
+@@ -176,11 +174,21 @@ sub link_hash_cert {
+ 		$hashlist{$hash} = $fprint;
+ }
+ 
++sub link_hash_cert_old {
++		link_hash_cert($_[0], '-subject_hash_old');
++}
++
++sub link_hash_crl_old {
++		link_hash_crl($_[0], '-hash_old');
++}
++
++
+ # Same as above except for a CRL. CRL links are of the form <hash>.r<n>
+ 
+ sub link_hash_crl {
+ 		my $fname = $_[0];
++		my $crlhash = $_[1] || "-hash";
+ 		$fname =~ s/'/'\\''/g;
+ 		my ($hash, $fprint) = `"$openssl" crl $crlhash -fingerprint -noout -in '$fname'`;
+ 		chomp $hash;
diff --git a/meta/recipes-connectivity/openssl/openssl/debian/ca.patch b/meta/recipes-connectivity/openssl/openssl/debian/ca.patch
new file mode 100644
index 0000000..aba4d42
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian/ca.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-0.9.8m/apps/CA.pl.in
+===================================================================
+--- openssl-0.9.8m.orig/apps/CA.pl.in	2006-04-28 00:28:51.000000000 +0000
++++ openssl-0.9.8m/apps/CA.pl.in	2010-02-27 00:36:51.000000000 +0000
+@@ -65,6 +65,7 @@
+ foreach (@ARGV) {
+ 	if ( /^(-\?|-h|-help)$/ ) {
+ 	    print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
++	    print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
+ 	    exit 0;
+ 	} elsif (/^-newcert$/) {
+ 	    # create a certificate
+@@ -165,6 +166,7 @@
+ 	} else {
+ 	    print STDERR "Unknown arg $_\n";
+ 	    print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
++	    print STDERR "usage: CA -signcert certfile keyfile|-newcert|-newreq|-newca|-sign|-verify\n";
+ 	    exit 1;
+ 	}
+ }
diff --git a/meta/recipes-connectivity/openssl/openssl/debian/debian-targets.patch b/meta/recipes-connectivity/openssl/openssl/debian/debian-targets.patch
new file mode 100644
index 0000000..39d4328
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian/debian-targets.patch
@@ -0,0 +1,73 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.2/Configure
+===================================================================
+--- openssl-1.0.2.orig/Configure
++++ openssl-1.0.2/Configure
+@@ -107,6 +107,10 @@ my $gcc_devteam_warn = "-Wall -pedantic
+ 
+ my $clang_disabled_warnings = "-Wno-language-extension-token -Wno-extended-offsetof -Wno-padded -Wno-shorten-64-to-32 -Wno-format-nonliteral -Wno-missing-noreturn -Wno-unused-parameter -Wno-sign-conversion -Wno-unreachable-code -Wno-conversion -Wno-documentation -Wno-missing-variable-declarations -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-missing-variable-declarations -Wno-missing-field-initializers -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-conditional-uninitialized -Wno-switch-enum";
+ 
++# There are no separate CFLAGS/CPPFLAGS/LDFLAGS, set everything in CFLAGS
++my $debian_cflags = `dpkg-buildflags --get CFLAGS` . `dpkg-buildflags --get CPPFLAGS` . `dpkg-buildflags --get LDFLAGS` . "-Wa,--noexecstack -Wall";
++$debian_cflags =~ s/\n/ /g;
++
+ my $strict_warnings = 0;
+ 
+ my $x86_gcc_des="DES_PTR DES_RISC1 DES_UNROLL";
+@@ -343,6 +347,55 @@ my %table=(
+ "osf1-alpha-cc",  "cc:-std1 -tune host -O4 -readonly_strings::(unknown):::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared:::.so",
+ "tru64-alpha-cc", "cc:-std1 -tune host -fast -readonly_strings::-pthread:::SIXTY_FOUR_BIT_LONG RC4_CHUNK:${alpha_asm}:dlfcn:alpha-osf1-shared::-msym:.so",
+ 
++# Debian GNU/* (various architectures)
++"debian-alpha","gcc:-DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-alpha-ev4","gcc:-DTERMIO ${debian_cflags} -mcpu=ev4::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-alpha-ev5","gcc:-DTERMIO ${debian_cflags} -mcpu=ev5::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_RISC1 DES_UNROLL:${alpha_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-arm64","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-armel","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-armhf","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-amd64", "gcc:-m64 -DL_ENDIAN -DTERMIO ${debian_cflags} -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::",
++"debian-avr32", "gcc:-DB_ENDIAN -DTERMIO ${debian_cflags} -fomit-frame-pointer::-D_REENTRANT::-ldl:BN_LLONG_BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-kfreebsd-amd64","gcc:-m64 -DL_ENDIAN -DTERMIOS ${debian_cflags} -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-kfreebsd-i386","gcc:-DL_ENDIAN -DTERMIOS ${debian_cflags} -march=i486::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-hppa","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-hurd-i386","gcc:-DL_ENDIAN -DTERMIOS -O3 -Wa,--noexecstack -g -mtune=i486 -Wall::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-ia64","gcc:-DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386-i486","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags} -march=i486::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386-i586","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags} -march=i586::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-i386-i686/cmov","gcc:-DL_ENDIAN -DTERMIO ${debian_cflags} -march=i686::-D_REENTRANT::-ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-m68k","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG MD2_CHAR RC4_INDEX:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mips",   "gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mipsel",   "gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mipsn32",   "mips64-linux-gnuabin32-gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mipsn32el",   "mips64el-linux-gnuabin32-gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mips64",   "mips64-linux-gnuabi64-gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-mips64el",   "mips64el-linux-gnuabi64-gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-netbsd-i386",	"gcc:-DL_ENDIAN -DTERMIOS ${debian_cflags} -m486::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-netbsd-m68k",	"gcc:-DB_ENDIAN -DTERMIOS ${debian_cflags}::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-netbsd-sparc",	"gcc:-DB_ENDIAN -DTERMIOS ${debian_cflags} -mv8::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-openbsd-alpha","gcc:-DTERMIOS ${debian_cflags}::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-openbsd-i386",  "gcc:-DL_ENDIAN -DTERMIOS ${debian_cflags} -m486::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_asm}:a.out:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-openbsd-mips","gcc:-DL_ENDIAN ${debian_cflags}::(unknown)::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-or1k", "gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG DES_RISC1:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-powerpc","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-powerpcspe","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc32_asm}:linux32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-ppc64","gcc:-m64 -DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-ppc64el","gcc:-m64 -DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_RISC1 DES_UNROLL:${ppc64_asm}:linux64le:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-s390","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", 
++"debian-s390x","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh3",   "gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh4",   "gcc:-DL_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh3eb",   "gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sh4eb",   "gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-m32r","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags}::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc-v8","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags} -mcpu=v8 -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv8_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc-v9","gcc:-DB_ENDIAN -DTERMIO ${debian_cflags} -mcpu=v9 -Wa,-Av8plus -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-sparc64","gcc:-m64 -DB_ENDIAN -DTERMIO ${debian_cflags} -DULTRASPARC -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
++"debian-x32","gcc:-mx32 -DL_ENDIAN -DTERMIO ${debian_cflags} -DMD32_REG_T=int::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-mx32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::x32",
++
+ ####
+ #### Variety of LINUX:-)
+ ####
diff --git a/meta/recipes-connectivity/openssl/openssl/debian/man-dir.patch b/meta/recipes-connectivity/openssl/openssl/debian/man-dir.patch
new file mode 100644
index 0000000..4085e3b
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian/man-dir.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.0c/Makefile.org
+===================================================================
+--- openssl-1.0.0c.orig/Makefile.org	2010-12-12 16:11:27.000000000 +0100
++++ openssl-1.0.0c/Makefile.org	2010-12-12 16:11:37.000000000 +0100
+@@ -131,7 +131,7 @@
+ 
+ MAKEFILE= Makefile
+ 
+-MANDIR=$(OPENSSLDIR)/man
++MANDIR=/usr/share/man
+ MAN1=1
+ MAN3=3
+ MANSUFFIX=
diff --git a/meta/recipes-connectivity/openssl/openssl/debian/man-section.patch b/meta/recipes-connectivity/openssl/openssl/debian/man-section.patch
new file mode 100644
index 0000000..21c1d1a
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian/man-section.patch
@@ -0,0 +1,34 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.0c/Makefile.org
+===================================================================
+--- openssl-1.0.0c.orig/Makefile.org	2010-12-12 16:11:37.000000000 +0100
++++ openssl-1.0.0c/Makefile.org	2010-12-12 16:13:28.000000000 +0100
+@@ -160,7 +160,8 @@
+ MANDIR=/usr/share/man
+ MAN1=1
+ MAN3=3
+-MANSUFFIX=
++MANSUFFIX=ssl
++MANSECTION=SSL
+ HTMLSUFFIX=html
+ HTMLDIR=$(OPENSSLDIR)/html
+ SHELL=/bin/sh
+@@ -651,7 +652,7 @@
+ 		echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
+ 		(cd `$(PERL) util/dirname.pl $$i`; \
+ 		sh -c "$$pod2man \
+-			--section=$$sec --center=OpenSSL \
++			--section=$${sec}$(MANSECTION) --center=OpenSSL \
+ 			--release=$(VERSION) `basename $$i`") \
+ 			>  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
+ 		$(PERL) util/extract-names.pl < $$i | \
+@@ -668,7 +669,7 @@
+ 		echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
+ 		(cd `$(PERL) util/dirname.pl $$i`; \
+ 		sh -c "$$pod2man \
+-			--section=$$sec --center=OpenSSL \
++			--section=$${sec}$(MANSECTION) --center=OpenSSL \
+ 			--release=$(VERSION) `basename $$i`") \
+ 			>  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
+ 		$(PERL) util/extract-names.pl < $$i | \
diff --git a/meta/recipes-connectivity/openssl/openssl/debian/no-rpath.patch b/meta/recipes-connectivity/openssl/openssl/debian/no-rpath.patch
new file mode 100644
index 0000000..1ccb3b8
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian/no-rpath.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.0c/Makefile.shared
+===================================================================
+--- openssl-1.0.0c.orig/Makefile.shared	2010-08-21 13:36:49.000000000 +0200
++++ openssl-1.0.0c/Makefile.shared	2010-12-12 16:13:36.000000000 +0100
+@@ -153,7 +153,7 @@
+ 	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+ 	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
+ 
+-DO_GNU_APP=LDFLAGS="$(CFLAGS) -Wl,-rpath,$(LIBRPATH)"
++DO_GNU_APP=LDFLAGS="$(CFLAGS)"
+ 
+ #This is rather special.  It's a special target with which one can link
+ #applications without bothering with any features that have anything to
diff --git a/meta/recipes-connectivity/openssl/openssl/debian/no-symbolic.patch b/meta/recipes-connectivity/openssl/openssl/debian/no-symbolic.patch
new file mode 100644
index 0000000..cc4408a
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian/no-symbolic.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.0c/Makefile.shared
+===================================================================
+--- openssl-1.0.0c.orig/Makefile.shared	2010-12-12 16:13:36.000000000 +0100
++++ openssl-1.0.0c/Makefile.shared	2010-12-12 16:13:44.000000000 +0100
+@@ -151,7 +151,7 @@
+ 	SHLIB_SUFFIX=; \
+ 	ALLSYMSFLAGS='-Wl,--whole-archive'; \
+ 	NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \
+-	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-Bsymbolic -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
++	SHAREDFLAGS="$(CFLAGS) $(SHARED_LDFLAGS) -shared -Wl,-soname=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX"
+ 
+ DO_GNU_APP=LDFLAGS="$(CFLAGS)"
+ 
diff --git a/meta/recipes-connectivity/openssl/openssl/debian/pic.patch b/meta/recipes-connectivity/openssl/openssl/debian/pic.patch
new file mode 100644
index 0000000..bfda388
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian/pic.patch
@@ -0,0 +1,177 @@
+Upstream-Status: Backport [debian]
+
+Index: openssl-1.0.1c/crypto/des/asm/desboth.pl
+===================================================================
+--- openssl-1.0.1c.orig/crypto/des/asm/desboth.pl	2001-10-24 23:20:56.000000000 +0200
++++ openssl-1.0.1c/crypto/des/asm/desboth.pl	2012-07-29 14:15:26.000000000 +0200
+@@ -16,6 +16,11 @@
+ 
+ 	&push("edi");
+ 
++	&call   (&label("pic_point0"));
++	&set_label("pic_point0");
++	&blindpop("ebp");
++	&add    ("ebp", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
++
+ 	&comment("");
+ 	&comment("Load the data words");
+ 	&mov($L,&DWP(0,"ebx","",0));
+@@ -47,15 +52,21 @@
+ 	&mov(&swtmp(2),	(DWC(($enc)?"1":"0")));
+ 	&mov(&swtmp(1),	"eax");
+ 	&mov(&swtmp(0),	"ebx");
+-	&call("DES_encrypt2");
++	&exch("ebx", "ebp");
++	&call("DES_encrypt2\@PLT");
++	&exch("ebx", "ebp");
+ 	&mov(&swtmp(2),	(DWC(($enc)?"0":"1")));
+ 	&mov(&swtmp(1),	"edi");
+ 	&mov(&swtmp(0),	"ebx");
+-	&call("DES_encrypt2");
++	&exch("ebx", "ebp");
++	&call("DES_encrypt2\@PLT");
++	&exch("ebx", "ebp");
+ 	&mov(&swtmp(2),	(DWC(($enc)?"1":"0")));
+ 	&mov(&swtmp(1),	"esi");
+ 	&mov(&swtmp(0),	"ebx");
+-	&call("DES_encrypt2");
++	&exch("ebx", "ebp");
++	&call("DES_encrypt2\@PLT");
++	&exch("ebx", "ebp");
+ 
+ 	&stack_pop(3);
+ 	&mov($L,&DWP(0,"ebx","",0));
+Index: openssl-1.0.1c/crypto/perlasm/cbc.pl
+===================================================================
+--- openssl-1.0.1c.orig/crypto/perlasm/cbc.pl	2011-07-13 08:22:46.000000000 +0200
++++ openssl-1.0.1c/crypto/perlasm/cbc.pl	2012-07-29 14:15:26.000000000 +0200
+@@ -122,7 +122,11 @@
+ 	&mov(&DWP($data_off,"esp","",0),	"eax");	# put in array for call
+ 	&mov(&DWP($data_off+4,"esp","",0),	"ebx");	#
+ 
+-	&call($enc_func);
++	&call	(&label("pic_point0"));
++	&set_label("pic_point0");
++	&blindpop("ebx");
++	&add	("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point0") . "]");
++	&call("$enc_func\@PLT");
+ 
+ 	&mov("eax",	&DWP($data_off,"esp","",0));
+ 	&mov("ebx",	&DWP($data_off+4,"esp","",0));
+@@ -185,7 +189,11 @@
+ 	&mov(&DWP($data_off,"esp","",0),	"eax");	# put in array for call
+ 	&mov(&DWP($data_off+4,"esp","",0),	"ebx");	#
+ 
+-	&call($enc_func);
++	&call	(&label("pic_point1"));
++	&set_label("pic_point1");
++	&blindpop("ebx");
++	&add	("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point1") . "]");
++	&call("$enc_func\@PLT");
+ 
+ 	&mov("eax",	&DWP($data_off,"esp","",0));
+ 	&mov("ebx",	&DWP($data_off+4,"esp","",0));
+@@ -218,7 +226,11 @@
+ 	&mov(&DWP($data_off,"esp","",0),	"eax");	# put back
+ 	&mov(&DWP($data_off+4,"esp","",0),	"ebx");	#
+ 
+-	&call($dec_func);
++	&call	(&label("pic_point2"));
++	&set_label("pic_point2");
++	&blindpop("ebx");
++	&add	("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point2") . "]");
++	&call("$dec_func\@PLT");
+ 
+ 	&mov("eax",	&DWP($data_off,"esp","",0));	# get return
+ 	&mov("ebx",	&DWP($data_off+4,"esp","",0));	#
+@@ -261,7 +273,11 @@
+ 	&mov(&DWP($data_off,"esp","",0),	"eax");	# put back
+ 	&mov(&DWP($data_off+4,"esp","",0),	"ebx");	#
+ 
+-	&call($dec_func);
++	&call	(&label("pic_point3"));
++	&set_label("pic_point3");
++	&blindpop("ebx");
++	&add	("ebx", "\$_GLOBAL_OFFSET_TABLE_+[.-" . &label("pic_point3") . "]");
++	&call("$dec_func\@PLT");
+ 
+ 	&mov("eax",	&DWP($data_off,"esp","",0));	# get return
+ 	&mov("ebx",	&DWP($data_off+4,"esp","",0));	#
+Index: openssl-1.0.1c/crypto/perlasm/x86gas.pl
+===================================================================
+--- openssl-1.0.1c.orig/crypto/perlasm/x86gas.pl	2011-12-09 20:16:35.000000000 +0100
++++ openssl-1.0.1c/crypto/perlasm/x86gas.pl	2012-07-29 14:15:26.000000000 +0200
+@@ -161,6 +161,7 @@
+ 	if ($::macosx)	{ push (@out,"$tmp,2\n"); }
+ 	elsif ($::elf)	{ push (@out,"$tmp,4\n"); }
+ 	else		{ push (@out,"$tmp\n"); }
++	if ($::elf)	{ push (@out,".hidden\tOPENSSL_ia32cap_P\n"); }
+     }
+     push(@out,$initseg) if ($initseg);
+ }
+@@ -218,8 +219,23 @@
+     elsif ($::elf)
+     {	$initseg.=<<___;
+ .section	.init
++___
++        if ($::pic)
++	{   $initseg.=<<___;
++	pushl	%ebx
++	call	.pic_point0
++.pic_point0:
++	popl	%ebx
++	addl	\$_GLOBAL_OFFSET_TABLE_+[.-.pic_point0],%ebx
++	call	$f\@PLT
++	popl	%ebx
++___
++	}
++	else
++	{   $initseg.=<<___;
+ 	call	$f
+ ___
++	}
+     }
+     elsif ($::coff)
+     {   $initseg.=<<___;	# applies to both Cygwin and Mingw
+Index: openssl-1.0.1c/crypto/x86cpuid.pl
+===================================================================
+--- openssl-1.0.1c.orig/crypto/x86cpuid.pl	2012-02-28 15:20:34.000000000 +0100
++++ openssl-1.0.1c/crypto/x86cpuid.pl	2012-07-29 14:15:26.000000000 +0200
+@@ -8,6 +8,8 @@
+ 
+ for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
+ 
++push(@out, ".hidden OPENSSL_ia32cap_P\n");
++
+ &function_begin("OPENSSL_ia32_cpuid");
+ 	&xor	("edx","edx");
+ 	&pushf	();
+@@ -139,9 +141,7 @@
+ &set_label("nocpuid");
+ &function_end("OPENSSL_ia32_cpuid");
+ 
+-&external_label("OPENSSL_ia32cap_P");
+-
+-&function_begin_B("OPENSSL_rdtsc","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
++&function_begin_B("OPENSSL_rdtsc");
+ 	&xor	("eax","eax");
+ 	&xor	("edx","edx");
+ 	&picmeup("ecx","OPENSSL_ia32cap_P");
+@@ -155,7 +155,7 @@
+ # This works in Ring 0 only [read DJGPP+MS-DOS+privileged DPMI host],
+ # but it's safe to call it on any [supported] 32-bit platform...
+ # Just check for [non-]zero return value...
+-&function_begin_B("OPENSSL_instrument_halt","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
++&function_begin_B("OPENSSL_instrument_halt");
+ 	&picmeup("ecx","OPENSSL_ia32cap_P");
+ 	&bt	(&DWP(0,"ecx"),4);
+ 	&jnc	(&label("nohalt"));	# no TSC
+@@ -222,7 +222,7 @@
+ 	&ret	();
+ &function_end_B("OPENSSL_far_spin");
+ 
+-&function_begin_B("OPENSSL_wipe_cpu","EXTRN\t_OPENSSL_ia32cap_P:DWORD");
++&function_begin_B("OPENSSL_wipe_cpu");
+ 	&xor	("eax","eax");
+ 	&xor	("edx","edx");
+ 	&picmeup("ecx","OPENSSL_ia32cap_P");
diff --git a/meta/recipes-connectivity/openssl/openssl/debian/version-script.patch b/meta/recipes-connectivity/openssl/openssl/debian/version-script.patch
new file mode 100644
index 0000000..a249180
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian/version-script.patch
@@ -0,0 +1,4663 @@
+Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/Configure
+===================================================================
+--- openssl-1.0.2~beta1.obsolete.0.0498436515490575.orig/Configure	2014-02-24 21:02:30.000000000 +0100
++++ openssl-1.0.2~beta1.obsolete.0.0498436515490575/Configure	2014-02-24 21:02:30.000000000 +0100
+@@ -1651,6 +1651,8 @@
+ 		}
+ 	}
+ 
++$shared_ldflag .= " -Wl,--version-script=openssl.ld";
++
+ open(IN,'<Makefile.org') || die "unable to read Makefile.org:$!\n";
+ unlink("$Makefile.new") || die "unable to remove old $Makefile.new:$!\n" if -e "$Makefile.new";
+ open(OUT,">$Makefile.new") || die "unable to create $Makefile.new:$!\n";
+Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/openssl.ld
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ openssl-1.0.2~beta1.obsolete.0.0498436515490575/openssl.ld	2014-02-24 22:19:08.601827266 +0100
+@@ -0,0 +1,4615 @@
++OPENSSL_1.0.0 {
++	global:
++		BIO_f_ssl;
++		BIO_new_buffer_ssl_connect;
++		BIO_new_ssl;
++		BIO_new_ssl_connect;
++		BIO_proxy_ssl_copy_session_id;
++		BIO_ssl_copy_session_id;
++		BIO_ssl_shutdown;
++		d2i_SSL_SESSION;
++		DTLSv1_client_method;
++		DTLSv1_method;
++		DTLSv1_server_method;
++		ERR_load_SSL_strings;
++		i2d_SSL_SESSION;
++		kssl_build_principal_2;
++		kssl_cget_tkt;
++		kssl_check_authent;
++		kssl_ctx_free;
++		kssl_ctx_new;
++		kssl_ctx_setkey;
++		kssl_ctx_setprinc;
++		kssl_ctx_setstring;
++		kssl_ctx_show;
++		kssl_err_set;
++		kssl_krb5_free_data_contents;
++		kssl_sget_tkt;
++		kssl_skip_confound;
++		kssl_validate_times;
++		PEM_read_bio_SSL_SESSION;
++		PEM_read_SSL_SESSION;
++		PEM_write_bio_SSL_SESSION;
++		PEM_write_SSL_SESSION;
++		SSL_accept;
++		SSL_add_client_CA;
++		SSL_add_dir_cert_subjects_to_stack;
++		SSL_add_dir_cert_subjs_to_stk;
++		SSL_add_file_cert_subjects_to_stack;
++		SSL_add_file_cert_subjs_to_stk;
++		SSL_alert_desc_string;
++		SSL_alert_desc_string_long;
++		SSL_alert_type_string;
++		SSL_alert_type_string_long;
++		SSL_callback_ctrl;
++		SSL_check_private_key;
++		SSL_CIPHER_description;
++		SSL_CIPHER_get_bits;
++		SSL_CIPHER_get_name;
++		SSL_CIPHER_get_version;
++		SSL_clear;
++		SSL_COMP_add_compression_method;
++		SSL_COMP_get_compression_methods;
++		SSL_COMP_get_compress_methods;
++		SSL_COMP_get_name;
++		SSL_connect;
++		SSL_copy_session_id;
++		SSL_ctrl;
++		SSL_CTX_add_client_CA;
++		SSL_CTX_add_session;
++		SSL_CTX_callback_ctrl;
++		SSL_CTX_check_private_key;
++		SSL_CTX_ctrl;
++		SSL_CTX_flush_sessions;
++		SSL_CTX_free;
++		SSL_CTX_get_cert_store;
++		SSL_CTX_get_client_CA_list;
++		SSL_CTX_get_client_cert_cb;
++		SSL_CTX_get_ex_data;
++		SSL_CTX_get_ex_new_index;
++		SSL_CTX_get_info_callback;
++		SSL_CTX_get_quiet_shutdown;
++		SSL_CTX_get_timeout;
++		SSL_CTX_get_verify_callback;
++		SSL_CTX_get_verify_depth;
++		SSL_CTX_get_verify_mode;
++		SSL_CTX_load_verify_locations;
++		SSL_CTX_new;
++		SSL_CTX_remove_session;
++		SSL_CTX_sess_get_get_cb;
++		SSL_CTX_sess_get_new_cb;
++		SSL_CTX_sess_get_remove_cb;
++		SSL_CTX_sessions;
++		SSL_CTX_sess_set_get_cb;
++		SSL_CTX_sess_set_new_cb;
++		SSL_CTX_sess_set_remove_cb;
++		SSL_CTX_set1_param;
++		SSL_CTX_set_cert_store;
++		SSL_CTX_set_cert_verify_callback;
++		SSL_CTX_set_cert_verify_cb;
++		SSL_CTX_set_cipher_list;
++		SSL_CTX_set_client_CA_list;
++		SSL_CTX_set_client_cert_cb;
++		SSL_CTX_set_client_cert_engine;
++		SSL_CTX_set_cookie_generate_cb;
++		SSL_CTX_set_cookie_verify_cb;
++		SSL_CTX_set_default_passwd_cb;
++		SSL_CTX_set_default_passwd_cb_userdata;
++		SSL_CTX_set_default_verify_paths;
++		SSL_CTX_set_def_passwd_cb_ud;
++		SSL_CTX_set_def_verify_paths;
++		SSL_CTX_set_ex_data;
++		SSL_CTX_set_generate_session_id;
++		SSL_CTX_set_info_callback;
++		SSL_CTX_set_msg_callback;
++		SSL_CTX_set_psk_client_callback;
++		SSL_CTX_set_psk_server_callback;
++		SSL_CTX_set_purpose;
++		SSL_CTX_set_quiet_shutdown;
++		SSL_CTX_set_session_id_context;
++		SSL_CTX_set_ssl_version;
++		SSL_CTX_set_timeout;
++		SSL_CTX_set_tmp_dh_callback;
++		SSL_CTX_set_tmp_ecdh_callback;
++		SSL_CTX_set_tmp_rsa_callback;
++		SSL_CTX_set_trust;
++		SSL_CTX_set_verify;
++		SSL_CTX_set_verify_depth;
++		SSL_CTX_use_cert_chain_file;
++		SSL_CTX_use_certificate;
++		SSL_CTX_use_certificate_ASN1;
++		SSL_CTX_use_certificate_chain_file;
++		SSL_CTX_use_certificate_file;
++		SSL_CTX_use_PrivateKey;
++		SSL_CTX_use_PrivateKey_ASN1;
++		SSL_CTX_use_PrivateKey_file;
++		SSL_CTX_use_psk_identity_hint;
++		SSL_CTX_use_RSAPrivateKey;
++		SSL_CTX_use_RSAPrivateKey_ASN1;
++		SSL_CTX_use_RSAPrivateKey_file;
++		SSL_do_handshake;
++		SSL_dup;
++		SSL_dup_CA_list;
++		SSLeay_add_ssl_algorithms;
++		SSL_free;
++		SSL_get1_session;
++		SSL_get_certificate;
++		SSL_get_cipher_list;
++		SSL_get_ciphers;
++		SSL_get_client_CA_list;
++		SSL_get_current_cipher;
++		SSL_get_current_compression;
++		SSL_get_current_expansion;
++		SSL_get_default_timeout;
++		SSL_get_error;
++		SSL_get_ex_data;
++		SSL_get_ex_data_X509_STORE_CTX_idx;
++		SSL_get_ex_d_X509_STORE_CTX_idx;
++		SSL_get_ex_new_index;
++		SSL_get_fd;
++		SSL_get_finished;
++		SSL_get_info_callback;
++		SSL_get_peer_cert_chain;
++		SSL_get_peer_certificate;
++		SSL_get_peer_finished;
++		SSL_get_privatekey;
++		SSL_get_psk_identity;
++		SSL_get_psk_identity_hint;
++		SSL_get_quiet_shutdown;
++		SSL_get_rbio;
++		SSL_get_read_ahead;
++		SSL_get_rfd;
++		SSL_get_servername;
++		SSL_get_servername_type;
++		SSL_get_session;
++		SSL_get_shared_ciphers;
++		SSL_get_shutdown;
++		SSL_get_SSL_CTX;
++		SSL_get_ssl_method;
++		SSL_get_verify_callback;
++		SSL_get_verify_depth;
++		SSL_get_verify_mode;
++		SSL_get_verify_result;
++		SSL_get_version;
++		SSL_get_wbio;
++		SSL_get_wfd;
++		SSL_has_matching_session_id;
++		SSL_library_init;
++		SSL_load_client_CA_file;
++		SSL_load_error_strings;
++		SSL_new;
++		SSL_peek;
++		SSL_pending;
++		SSL_read;
++		SSL_renegotiate;
++		SSL_renegotiate_pending;
++		SSL_rstate_string;
++		SSL_rstate_string_long;
++		SSL_SESSION_cmp;
++		SSL_SESSION_free;
++		SSL_SESSION_get_ex_data;
++		SSL_SESSION_get_ex_new_index;
++		SSL_SESSION_get_id;
++		SSL_SESSION_get_time;
++		SSL_SESSION_get_timeout;
++		SSL_SESSION_hash;
++		SSL_SESSION_new;
++		SSL_SESSION_print;
++		SSL_SESSION_print_fp;
++		SSL_SESSION_set_ex_data;
++		SSL_SESSION_set_time;
++		SSL_SESSION_set_timeout;
++		SSL_set1_param;
++		SSL_set_accept_state;
++		SSL_set_bio;
++		SSL_set_cipher_list;
++		SSL_set_client_CA_list;
++		SSL_set_connect_state;
++		SSL_set_ex_data;
++		SSL_set_fd;
++		SSL_set_generate_session_id;
++		SSL_set_info_callback;
++		SSL_set_msg_callback;
++		SSL_set_psk_client_callback;
++		SSL_set_psk_server_callback;
++		SSL_set_purpose;
++		SSL_set_quiet_shutdown;
++		SSL_set_read_ahead;
++		SSL_set_rfd;
++		SSL_set_session;
++		SSL_set_session_id_context;
++		SSL_set_session_secret_cb;
++		SSL_set_session_ticket_ext;
++		SSL_set_session_ticket_ext_cb;
++		SSL_set_shutdown;
++		SSL_set_SSL_CTX;
++		SSL_set_ssl_method;
++		SSL_set_tmp_dh_callback;
++		SSL_set_tmp_ecdh_callback;
++		SSL_set_tmp_rsa_callback;
++		SSL_set_trust;
++		SSL_set_verify;
++		SSL_set_verify_depth;
++		SSL_set_verify_result;
++		SSL_set_wfd;
++		SSL_shutdown;
++		SSL_state;
++		SSL_state_string;
++		SSL_state_string_long;
++		SSL_use_certificate;
++		SSL_use_certificate_ASN1;
++		SSL_use_certificate_file;
++		SSL_use_PrivateKey;
++		SSL_use_PrivateKey_ASN1;
++		SSL_use_PrivateKey_file;
++		SSL_use_psk_identity_hint;
++		SSL_use_RSAPrivateKey;
++		SSL_use_RSAPrivateKey_ASN1;
++		SSL_use_RSAPrivateKey_file;
++		SSLv23_client_method;
++		SSLv23_method;
++		SSLv23_server_method;
++		SSLv2_client_method;
++		SSLv2_method;
++		SSLv2_server_method;
++		SSLv3_client_method;
++		SSLv3_method;
++		SSLv3_server_method;
++		SSL_version;
++		SSL_want;
++		SSL_write;
++		TLSv1_client_method;
++		TLSv1_method;
++		TLSv1_server_method;
++
++
++		SSLeay;
++		SSLeay_version;
++		ASN1_BIT_STRING_asn1_meth;
++		ASN1_HEADER_free;
++		ASN1_HEADER_new;
++		ASN1_IA5STRING_asn1_meth;
++		ASN1_INTEGER_get;
++		ASN1_INTEGER_set;
++		ASN1_INTEGER_to_BN;
++		ASN1_OBJECT_create;
++		ASN1_OBJECT_free;
++		ASN1_OBJECT_new;
++		ASN1_PRINTABLE_type;
++		ASN1_STRING_cmp;
++		ASN1_STRING_dup;
++		ASN1_STRING_free;
++		ASN1_STRING_new;
++		ASN1_STRING_print;
++		ASN1_STRING_set;
++		ASN1_STRING_type_new;
++		ASN1_TYPE_free;
++		ASN1_TYPE_new;
++		ASN1_UNIVERSALSTRING_to_string;
++		ASN1_UTCTIME_check;
++		ASN1_UTCTIME_print;
++		ASN1_UTCTIME_set;
++		ASN1_check_infinite_end;
++		ASN1_d2i_bio;
++		ASN1_d2i_fp;
++		ASN1_digest;
++		ASN1_dup;
++		ASN1_get_object;
++		ASN1_i2d_bio;
++		ASN1_i2d_fp;
++		ASN1_object_size;
++		ASN1_parse;
++		ASN1_put_object;
++		ASN1_sign;
++		ASN1_verify;
++		BF_cbc_encrypt;
++		BF_cfb64_encrypt;
++		BF_ecb_encrypt;
++		BF_encrypt;
++		BF_ofb64_encrypt;
++		BF_options;
++		BF_set_key;
++		BIO_CONNECT_free;
++		BIO_CONNECT_new;
++		BIO_accept;
++		BIO_ctrl;
++		BIO_int_ctrl;
++		BIO_debug_callback;
++		BIO_dump;
++		BIO_dup_chain;
++		BIO_f_base64;
++		BIO_f_buffer;
++		BIO_f_cipher;
++		BIO_f_md;
++		BIO_f_null;
++		BIO_f_proxy_server;
++		BIO_fd_non_fatal_error;
++		BIO_fd_should_retry;
++		BIO_find_type;
++		BIO_free;
++		BIO_free_all;
++		BIO_get_accept_socket;
++		BIO_get_filter_bio;
++		BIO_get_host_ip;
++		BIO_get_port;
++		BIO_get_retry_BIO;
++		BIO_get_retry_reason;
++		BIO_gethostbyname;
++		BIO_gets;
++		BIO_new;
++		BIO_new_accept;
++		BIO_new_connect;
++		BIO_new_fd;
++		BIO_new_file;
++		BIO_new_fp;
++		BIO_new_socket;
++		BIO_pop;
++		BIO_printf;
++		BIO_push;
++		BIO_puts;
++		BIO_read;
++		BIO_s_accept;
++		BIO_s_connect;
++		BIO_s_fd;
++		BIO_s_file;
++		BIO_s_mem;
++		BIO_s_null;
++		BIO_s_proxy_client;
++		BIO_s_socket;
++		BIO_set;
++		BIO_set_cipher;
++		BIO_set_tcp_ndelay;
++		BIO_sock_cleanup;
++		BIO_sock_error;
++		BIO_sock_init;
++		BIO_sock_non_fatal_error;
++		BIO_sock_should_retry;
++		BIO_socket_ioctl;
++		BIO_write;
++		BN_CTX_free;
++		BN_CTX_new;
++		BN_MONT_CTX_free;
++		BN_MONT_CTX_new;
++		BN_MONT_CTX_set;
++		BN_add;
++		BN_add_word;
++		BN_hex2bn;
++		BN_bin2bn;
++		BN_bn2hex;
++		BN_bn2bin;
++		BN_clear;
++		BN_clear_bit;
++		BN_clear_free;
++		BN_cmp;
++		BN_copy;
++		BN_div;
++		BN_div_word;
++		BN_dup;
++		BN_free;
++		BN_from_montgomery;
++		BN_gcd;
++		BN_generate_prime;
++		BN_get_word;
++		BN_is_bit_set;
++		BN_is_prime;
++		BN_lshift;
++		BN_lshift1;
++		BN_mask_bits;
++		BN_mod;
++		BN_mod_exp;
++		BN_mod_exp_mont;
++		BN_mod_exp_simple;
++		BN_mod_inverse;
++		BN_mod_mul;
++		BN_mod_mul_montgomery;
++		BN_mod_word;
++		BN_mul;
++		BN_new;
++		BN_num_bits;
++		BN_num_bits_word;
++		BN_options;
++		BN_print;
++		BN_print_fp;
++		BN_rand;
++		BN_reciprocal;
++		BN_rshift;
++		BN_rshift1;
++		BN_set_bit;
++		BN_set_word;
++		BN_sqr;
++		BN_sub;
++		BN_to_ASN1_INTEGER;
++		BN_ucmp;
++		BN_value_one;
++		BUF_MEM_free;
++		BUF_MEM_grow;
++		BUF_MEM_new;
++		BUF_strdup;
++		CONF_free;
++		CONF_get_number;
++		CONF_get_section;
++		CONF_get_string;
++		CONF_load;
++		CRYPTO_add_lock;
++		CRYPTO_dbg_free;
++		CRYPTO_dbg_malloc;
++		CRYPTO_dbg_realloc;
++		CRYPTO_dbg_remalloc;
++		CRYPTO_free;
++		CRYPTO_get_add_lock_callback;
++		CRYPTO_get_id_callback;
++		CRYPTO_get_lock_name;
++		CRYPTO_get_locking_callback;
++		CRYPTO_get_mem_functions;
++		CRYPTO_lock;
++		CRYPTO_malloc;
++		CRYPTO_mem_ctrl;
++		CRYPTO_mem_leaks;
++		CRYPTO_mem_leaks_cb;
++		CRYPTO_mem_leaks_fp;
++		CRYPTO_realloc;
++		CRYPTO_remalloc;
++		CRYPTO_set_add_lock_callback;
++		CRYPTO_set_id_callback;
++		CRYPTO_set_locking_callback;
++		CRYPTO_set_mem_functions;
++		CRYPTO_thread_id;
++		DH_check;
++		DH_compute_key;
++		DH_free;
++		DH_generate_key;
++		DH_generate_parameters;
++		DH_new;
++		DH_size;
++		DHparams_print;
++		DHparams_print_fp;
++		DSA_free;
++		DSA_generate_key;
++		DSA_generate_parameters;
++		DSA_is_prime;
++		DSA_new;
++		DSA_print;
++		DSA_print_fp;
++		DSA_sign;
++		DSA_sign_setup;
++		DSA_size;
++		DSA_verify;
++		DSAparams_print;
++		DSAparams_print_fp;
++		ERR_clear_error;
++		ERR_error_string;
++		ERR_free_strings;
++		ERR_func_error_string;
++		ERR_get_err_state_table;
++		ERR_get_error;
++		ERR_get_error_line;
++		ERR_get_state;
++		ERR_get_string_table;
++		ERR_lib_error_string;
++		ERR_load_ASN1_strings;
++		ERR_load_BIO_strings;
++		ERR_load_BN_strings;
++		ERR_load_BUF_strings;
++		ERR_load_CONF_strings;
++		ERR_load_DH_strings;
++		ERR_load_DSA_strings;
++		ERR_load_ERR_strings;
++		ERR_load_EVP_strings;
++		ERR_load_OBJ_strings;
++		ERR_load_PEM_strings;
++		ERR_load_PROXY_strings;
++		ERR_load_RSA_strings;
++		ERR_load_X509_strings;
++		ERR_load_crypto_strings;
++		ERR_load_strings;
++		ERR_peek_error;
++		ERR_peek_error_line;
++		ERR_print_errors;
++		ERR_print_errors_fp;
++		ERR_put_error;
++		ERR_reason_error_string;
++		ERR_remove_state;
++		EVP_BytesToKey;
++		EVP_CIPHER_CTX_cleanup;
++		EVP_CipherFinal;
++		EVP_CipherInit;
++		EVP_CipherUpdate;
++		EVP_DecodeBlock;
++		EVP_DecodeFinal;
++		EVP_DecodeInit;
++		EVP_DecodeUpdate;
++		EVP_DecryptFinal;
++		EVP_DecryptInit;
++		EVP_DecryptUpdate;
++		EVP_DigestFinal;
++		EVP_DigestInit;
++		EVP_DigestUpdate;
++		EVP_EncodeBlock;
++		EVP_EncodeFinal;
++		EVP_EncodeInit;
++		EVP_EncodeUpdate;
++		EVP_EncryptFinal;
++		EVP_EncryptInit;
++		EVP_EncryptUpdate;
++		EVP_OpenFinal;
++		EVP_OpenInit;
++		EVP_PKEY_assign;
++		EVP_PKEY_copy_parameters;
++		EVP_PKEY_free;
++		EVP_PKEY_missing_parameters;
++		EVP_PKEY_new;
++		EVP_PKEY_save_parameters;
++		EVP_PKEY_size;
++		EVP_PKEY_type;
++		EVP_SealFinal;
++		EVP_SealInit;
++		EVP_SignFinal;
++		EVP_VerifyFinal;
++		EVP_add_alias;
++		EVP_add_cipher;
++		EVP_add_digest;
++		EVP_bf_cbc;
++		EVP_bf_cfb64;
++		EVP_bf_ecb;
++		EVP_bf_ofb;
++		EVP_cleanup;
++		EVP_des_cbc;
++		EVP_des_cfb64;
++		EVP_des_ecb;
++		EVP_des_ede;
++		EVP_des_ede3;
++		EVP_des_ede3_cbc;
++		EVP_des_ede3_cfb64;
++		EVP_des_ede3_ofb;
++		EVP_des_ede_cbc;
++		EVP_des_ede_cfb64;
++		EVP_des_ede_ofb;
++		EVP_des_ofb;
++		EVP_desx_cbc;
++		EVP_dss;
++		EVP_dss1;
++		EVP_enc_null;
++		EVP_get_cipherbyname;
++		EVP_get_digestbyname;
++		EVP_get_pw_prompt;
++		EVP_idea_cbc;
++		EVP_idea_cfb64;
++		EVP_idea_ecb;
++		EVP_idea_ofb;
++		EVP_md2;
++		EVP_md5;
++		EVP_md_null;
++		EVP_rc2_cbc;
++		EVP_rc2_cfb64;
++		EVP_rc2_ecb;
++		EVP_rc2_ofb;
++		EVP_rc4;
++		EVP_read_pw_string;
++		EVP_set_pw_prompt;
++		EVP_sha;
++		EVP_sha1;
++		MD2;
++		MD2_Final;
++		MD2_Init;
++		MD2_Update;
++		MD2_options;
++		MD5;
++		MD5_Final;
++		MD5_Init;
++		MD5_Update;
++		MDC2;
++		MDC2_Final;
++		MDC2_Init;
++		MDC2_Update;
++		NETSCAPE_SPKAC_free;
++		NETSCAPE_SPKAC_new;
++		NETSCAPE_SPKI_free;
++		NETSCAPE_SPKI_new;
++		NETSCAPE_SPKI_sign;
++		NETSCAPE_SPKI_verify;
++		OBJ_add_object;
++		OBJ_bsearch;
++		OBJ_cleanup;
++		OBJ_cmp;
++		OBJ_create;
++		OBJ_dup;
++		OBJ_ln2nid;
++		OBJ_new_nid;
++		OBJ_nid2ln;
++		OBJ_nid2obj;
++		OBJ_nid2sn;
++		OBJ_obj2nid;
++		OBJ_sn2nid;
++		OBJ_txt2nid;
++		PEM_ASN1_read;
++		PEM_ASN1_read_bio;
++		PEM_ASN1_write;
++		PEM_ASN1_write_bio;
++		PEM_SealFinal;
++		PEM_SealInit;
++		PEM_SealUpdate;
++		PEM_SignFinal;
++		PEM_SignInit;
++		PEM_SignUpdate;
++		PEM_X509_INFO_read;
++		PEM_X509_INFO_read_bio;
++		PEM_X509_INFO_write_bio;
++		PEM_dek_info;
++		PEM_do_header;
++		PEM_get_EVP_CIPHER_INFO;
++		PEM_proc_type;
++		PEM_read;
++		PEM_read_DHparams;
++		PEM_read_DSAPrivateKey;
++		PEM_read_DSAparams;
++		PEM_read_PKCS7;
++		PEM_read_PrivateKey;
++		PEM_read_RSAPrivateKey;
++		PEM_read_X509;
++		PEM_read_X509_CRL;
++		PEM_read_X509_REQ;
++		PEM_read_bio;
++		PEM_read_bio_DHparams;
++		PEM_read_bio_DSAPrivateKey;
++		PEM_read_bio_DSAparams;
++		PEM_read_bio_PKCS7;
++		PEM_read_bio_PrivateKey;
++		PEM_read_bio_RSAPrivateKey;
++		PEM_read_bio_X509;
++		PEM_read_bio_X509_CRL;
++		PEM_read_bio_X509_REQ;
++		PEM_write;
++		PEM_write_DHparams;
++		PEM_write_DSAPrivateKey;
++		PEM_write_DSAparams;
++		PEM_write_PKCS7;
++		PEM_write_PrivateKey;
++		PEM_write_RSAPrivateKey;
++		PEM_write_X509;
++		PEM_write_X509_CRL;
++		PEM_write_X509_REQ;
++		PEM_write_bio;
++		PEM_write_bio_DHparams;
++		PEM_write_bio_DSAPrivateKey;
++		PEM_write_bio_DSAparams;
++		PEM_write_bio_PKCS7;
++		PEM_write_bio_PrivateKey;
++		PEM_write_bio_RSAPrivateKey;
++		PEM_write_bio_X509;
++		PEM_write_bio_X509_CRL;
++		PEM_write_bio_X509_REQ;
++		PKCS7_DIGEST_free;
++		PKCS7_DIGEST_new;
++		PKCS7_ENCRYPT_free;
++		PKCS7_ENCRYPT_new;
++		PKCS7_ENC_CONTENT_free;
++		PKCS7_ENC_CONTENT_new;
++		PKCS7_ENVELOPE_free;
++		PKCS7_ENVELOPE_new;
++		PKCS7_ISSUER_AND_SERIAL_digest;
++		PKCS7_ISSUER_AND_SERIAL_free;
++		PKCS7_ISSUER_AND_SERIAL_new;
++		PKCS7_RECIP_INFO_free;
++		PKCS7_RECIP_INFO_new;
++		PKCS7_SIGNED_free;
++		PKCS7_SIGNED_new;
++		PKCS7_SIGNER_INFO_free;
++		PKCS7_SIGNER_INFO_new;
++		PKCS7_SIGN_ENVELOPE_free;
++		PKCS7_SIGN_ENVELOPE_new;
++		PKCS7_dup;
++		PKCS7_free;
++		PKCS7_new;
++		PROXY_ENTRY_add_noproxy;
++		PROXY_ENTRY_clear_noproxy;
++		PROXY_ENTRY_free;
++		PROXY_ENTRY_get_noproxy;
++		PROXY_ENTRY_new;
++		PROXY_ENTRY_set_server;
++		PROXY_add_noproxy;
++		PROXY_add_server;
++		PROXY_check_by_host;
++		PROXY_check_url;
++		PROXY_clear_noproxy;
++		PROXY_free;
++		PROXY_get_noproxy;
++		PROXY_get_proxies;
++		PROXY_get_proxy_entry;
++		PROXY_load_conf;
++		PROXY_new;
++		PROXY_print;
++		RAND_bytes;
++		RAND_cleanup;
++		RAND_file_name;
++		RAND_load_file;
++		RAND_screen;
++		RAND_seed;
++		RAND_write_file;
++		RC2_cbc_encrypt;
++		RC2_cfb64_encrypt;
++		RC2_ecb_encrypt;
++		RC2_encrypt;
++		RC2_ofb64_encrypt;
++		RC2_set_key;
++		RC4;
++		RC4_options;
++		RC4_set_key;
++		RSAPrivateKey_asn1_meth;
++		RSAPrivateKey_dup;
++		RSAPublicKey_dup;
++		RSA_PKCS1_SSLeay;
++		RSA_free;
++		RSA_generate_key;
++		RSA_new;
++		RSA_new_method;
++		RSA_print;
++		RSA_print_fp;
++		RSA_private_decrypt;
++		RSA_private_encrypt;
++		RSA_public_decrypt;
++		RSA_public_encrypt;
++		RSA_set_default_method;
++		RSA_sign;
++		RSA_sign_ASN1_OCTET_STRING;
++		RSA_size;
++		RSA_verify;
++		RSA_verify_ASN1_OCTET_STRING;
++		SHA;
++		SHA1;
++		SHA1_Final;
++		SHA1_Init;
++		SHA1_Update;
++		SHA_Final;
++		SHA_Init;
++		SHA_Update;
++		OpenSSL_add_all_algorithms;
++		OpenSSL_add_all_ciphers;
++		OpenSSL_add_all_digests;
++		TXT_DB_create_index;
++		TXT_DB_free;
++		TXT_DB_get_by_index;
++		TXT_DB_insert;
++		TXT_DB_read;
++		TXT_DB_write;
++		X509_ALGOR_free;
++		X509_ALGOR_new;
++		X509_ATTRIBUTE_free;
++		X509_ATTRIBUTE_new;
++		X509_CINF_free;
++		X509_CINF_new;
++		X509_CRL_INFO_free;
++		X509_CRL_INFO_new;
++		X509_CRL_add_ext;
++		X509_CRL_cmp;
++		X509_CRL_delete_ext;
++		X509_CRL_dup;
++		X509_CRL_free;
++		X509_CRL_get_ext;
++		X509_CRL_get_ext_by_NID;
++		X509_CRL_get_ext_by_OBJ;
++		X509_CRL_get_ext_by_critical;
++		X509_CRL_get_ext_count;
++		X509_CRL_new;
++		X509_CRL_sign;
++		X509_CRL_verify;
++		X509_EXTENSION_create_by_NID;
++		X509_EXTENSION_create_by_OBJ;
++		X509_EXTENSION_dup;
++		X509_EXTENSION_free;
++		X509_EXTENSION_get_critical;
++		X509_EXTENSION_get_data;
++		X509_EXTENSION_get_object;
++		X509_EXTENSION_new;
++		X509_EXTENSION_set_critical;
++		X509_EXTENSION_set_data;
++		X509_EXTENSION_set_object;
++		X509_INFO_free;
++		X509_INFO_new;
++		X509_LOOKUP_by_alias;
++		X509_LOOKUP_by_fingerprint;
++		X509_LOOKUP_by_issuer_serial;
++		X509_LOOKUP_by_subject;
++		X509_LOOKUP_ctrl;
++		X509_LOOKUP_file;
++		X509_LOOKUP_free;
++		X509_LOOKUP_hash_dir;
++		X509_LOOKUP_init;
++		X509_LOOKUP_new;
++		X509_LOOKUP_shutdown;
++		X509_NAME_ENTRY_create_by_NID;
++		X509_NAME_ENTRY_create_by_OBJ;
++		X509_NAME_ENTRY_dup;
++		X509_NAME_ENTRY_free;
++		X509_NAME_ENTRY_get_data;
++		X509_NAME_ENTRY_get_object;
++		X509_NAME_ENTRY_new;
++		X509_NAME_ENTRY_set_data;
++		X509_NAME_ENTRY_set_object;
++		X509_NAME_add_entry;
++		X509_NAME_cmp;
++		X509_NAME_delete_entry;
++		X509_NAME_digest;
++		X509_NAME_dup;
++		X509_NAME_entry_count;
++		X509_NAME_free;
++		X509_NAME_get_entry;
++		X509_NAME_get_index_by_NID;
++		X509_NAME_get_index_by_OBJ;
++		X509_NAME_get_text_by_NID;
++		X509_NAME_get_text_by_OBJ;
++		X509_NAME_hash;
++		X509_NAME_new;
++		X509_NAME_oneline;
++		X509_NAME_print;
++		X509_NAME_set;
++		X509_OBJECT_free_contents;
++		X509_OBJECT_retrieve_by_subject;
++		X509_OBJECT_up_ref_count;
++		X509_PKEY_free;
++		X509_PKEY_new;
++		X509_PUBKEY_free;
++		X509_PUBKEY_get;
++		X509_PUBKEY_new;
++		X509_PUBKEY_set;
++		X509_REQ_INFO_free;
++		X509_REQ_INFO_new;
++		X509_REQ_dup;
++		X509_REQ_free;
++		X509_REQ_get_pubkey;
++		X509_REQ_new;
++		X509_REQ_print;
++		X509_REQ_print_fp;
++		X509_REQ_set_pubkey;
++		X509_REQ_set_subject_name;
++		X509_REQ_set_version;
++		X509_REQ_sign;
++		X509_REQ_to_X509;
++		X509_REQ_verify;
++		X509_REVOKED_add_ext;
++		X509_REVOKED_delete_ext;
++		X509_REVOKED_free;
++		X509_REVOKED_get_ext;
++		X509_REVOKED_get_ext_by_NID;
++		X509_REVOKED_get_ext_by_OBJ;
++		X509_REVOKED_get_ext_by_critical;
++		X509_REVOKED_get_ext_by_critic;
++		X509_REVOKED_get_ext_count;
++		X509_REVOKED_new;
++		X509_SIG_free;
++		X509_SIG_new;
++		X509_STORE_CTX_cleanup;
++		X509_STORE_CTX_init;
++		X509_STORE_add_cert;
++		X509_STORE_add_lookup;
++		X509_STORE_free;
++		X509_STORE_get_by_subject;
++		X509_STORE_load_locations;
++		X509_STORE_new;
++		X509_STORE_set_default_paths;
++		X509_VAL_free;
++		X509_VAL_new;
++		X509_add_ext;
++		X509_asn1_meth;
++		X509_certificate_type;
++		X509_check_private_key;
++		X509_cmp_current_time;
++		X509_delete_ext;
++		X509_digest;
++		X509_dup;
++		X509_free;
++		X509_get_default_cert_area;
++		X509_get_default_cert_dir;
++		X509_get_default_cert_dir_env;
++		X509_get_default_cert_file;
++		X509_get_default_cert_file_env;
++		X509_get_default_private_dir;
++		X509_get_ext;
++		X509_get_ext_by_NID;
++		X509_get_ext_by_OBJ;
++		X509_get_ext_by_critical;
++		X509_get_ext_count;
++		X509_get_issuer_name;
++		X509_get_pubkey;
++		X509_get_pubkey_parameters;
++		X509_get_serialNumber;
++		X509_get_subject_name;
++		X509_gmtime_adj;
++		X509_issuer_and_serial_cmp;
++		X509_issuer_and_serial_hash;
++		X509_issuer_name_cmp;
++		X509_issuer_name_hash;
++		X509_load_cert_file;
++		X509_new;
++		X509_print;
++		X509_print_fp;
++		X509_set_issuer_name;
++		X509_set_notAfter;
++		X509_set_notBefore;
++		X509_set_pubkey;
++		X509_set_serialNumber;
++		X509_set_subject_name;
++		X509_set_version;
++		X509_sign;
++		X509_subject_name_cmp;
++		X509_subject_name_hash;
++		X509_to_X509_REQ;
++		X509_verify;
++		X509_verify_cert;
++		X509_verify_cert_error_string;
++		X509v3_add_ext;
++		X509v3_add_extension;
++		X509v3_add_netscape_extensions;
++		X509v3_add_standard_extensions;
++		X509v3_cleanup_extensions;
++		X509v3_data_type_by_NID;
++		X509v3_data_type_by_OBJ;
++		X509v3_delete_ext;
++		X509v3_get_ext;
++		X509v3_get_ext_by_NID;
++		X509v3_get_ext_by_OBJ;
++		X509v3_get_ext_by_critical;
++		X509v3_get_ext_count;
++		X509v3_pack_string;
++		X509v3_pack_type_by_NID;
++		X509v3_pack_type_by_OBJ;
++		X509v3_unpack_string;
++		_des_crypt;
++		a2d_ASN1_OBJECT;
++		a2i_ASN1_INTEGER;
++		a2i_ASN1_STRING;
++		asn1_Finish;
++		asn1_GetSequence;
++		bn_div_words;
++		bn_expand2;
++		bn_mul_add_words;
++		bn_mul_words;
++		BN_uadd;
++		BN_usub;
++		bn_sqr_words;
++		_ossl_old_crypt;
++		d2i_ASN1_BIT_STRING;
++		d2i_ASN1_BOOLEAN;
++		d2i_ASN1_HEADER;
++		d2i_ASN1_IA5STRING;
++		d2i_ASN1_INTEGER;
++		d2i_ASN1_OBJECT;
++		d2i_ASN1_OCTET_STRING;
++		d2i_ASN1_PRINTABLE;
++		d2i_ASN1_PRINTABLESTRING;
++		d2i_ASN1_SET;
++		d2i_ASN1_T61STRING;
++		d2i_ASN1_TYPE;
++		d2i_ASN1_UTCTIME;
++		d2i_ASN1_bytes;
++		d2i_ASN1_type_bytes;
++		d2i_DHparams;
++		d2i_DSAPrivateKey;
++		d2i_DSAPrivateKey_bio;
++		d2i_DSAPrivateKey_fp;
++		d2i_DSAPublicKey;
++		d2i_DSAparams;
++		d2i_NETSCAPE_SPKAC;
++		d2i_NETSCAPE_SPKI;
++		d2i_Netscape_RSA;
++		d2i_PKCS7;
++		d2i_PKCS7_DIGEST;
++		d2i_PKCS7_ENCRYPT;
++		d2i_PKCS7_ENC_CONTENT;
++		d2i_PKCS7_ENVELOPE;
++		d2i_PKCS7_ISSUER_AND_SERIAL;
++		d2i_PKCS7_RECIP_INFO;
++		d2i_PKCS7_SIGNED;
++		d2i_PKCS7_SIGNER_INFO;
++		d2i_PKCS7_SIGN_ENVELOPE;
++		d2i_PKCS7_bio;
++		d2i_PKCS7_fp;
++		d2i_PrivateKey;
++		d2i_PublicKey;
++		d2i_RSAPrivateKey;
++		d2i_RSAPrivateKey_bio;
++		d2i_RSAPrivateKey_fp;
++		d2i_RSAPublicKey;
++		d2i_X509;
++		d2i_X509_ALGOR;
++		d2i_X509_ATTRIBUTE;
++		d2i_X509_CINF;
++		d2i_X509_CRL;
++		d2i_X509_CRL_INFO;
++		d2i_X509_CRL_bio;
++		d2i_X509_CRL_fp;
++		d2i_X509_EXTENSION;
++		d2i_X509_NAME;
++		d2i_X509_NAME_ENTRY;
++		d2i_X509_PKEY;
++		d2i_X509_PUBKEY;
++		d2i_X509_REQ;
++		d2i_X509_REQ_INFO;
++		d2i_X509_REQ_bio;
++		d2i_X509_REQ_fp;
++		d2i_X509_REVOKED;
++		d2i_X509_SIG;
++		d2i_X509_VAL;
++		d2i_X509_bio;
++		d2i_X509_fp;
++		DES_cbc_cksum;
++		DES_cbc_encrypt;
++		DES_cblock_print_file;
++		DES_cfb64_encrypt;
++		DES_cfb_encrypt;
++		DES_decrypt3;
++		DES_ecb3_encrypt;
++		DES_ecb_encrypt;
++		DES_ede3_cbc_encrypt;
++		DES_ede3_cfb64_encrypt;
++		DES_ede3_ofb64_encrypt;
++		DES_enc_read;
++		DES_enc_write;
++		DES_encrypt1;
++		DES_encrypt2;
++		DES_encrypt3;
++		DES_fcrypt;
++		DES_is_weak_key;
++		DES_key_sched;
++		DES_ncbc_encrypt;
++		DES_ofb64_encrypt;
++		DES_ofb_encrypt;
++		DES_options;
++		DES_pcbc_encrypt;
++		DES_quad_cksum;
++		DES_random_key;
++		_ossl_old_des_random_seed;
++		_ossl_old_des_read_2passwords;
++		_ossl_old_des_read_password;
++		_ossl_old_des_read_pw;
++		_ossl_old_des_read_pw_string;
++		DES_set_key;
++		DES_set_odd_parity;
++		DES_string_to_2keys;
++		DES_string_to_key;
++		DES_xcbc_encrypt;
++		DES_xwhite_in2out;
++		fcrypt_body;
++		i2a_ASN1_INTEGER;
++		i2a_ASN1_OBJECT;
++		i2a_ASN1_STRING;
++		i2d_ASN1_BIT_STRING;
++		i2d_ASN1_BOOLEAN;
++		i2d_ASN1_HEADER;
++		i2d_ASN1_IA5STRING;
++		i2d_ASN1_INTEGER;
++		i2d_ASN1_OBJECT;
++		i2d_ASN1_OCTET_STRING;
++		i2d_ASN1_PRINTABLE;
++		i2d_ASN1_SET;
++		i2d_ASN1_TYPE;
++		i2d_ASN1_UTCTIME;
++		i2d_ASN1_bytes;
++		i2d_DHparams;
++		i2d_DSAPrivateKey;
++		i2d_DSAPrivateKey_bio;
++		i2d_DSAPrivateKey_fp;
++		i2d_DSAPublicKey;
++		i2d_DSAparams;
++		i2d_NETSCAPE_SPKAC;
++		i2d_NETSCAPE_SPKI;
++		i2d_Netscape_RSA;
++		i2d_PKCS7;
++		i2d_PKCS7_DIGEST;
++		i2d_PKCS7_ENCRYPT;
++		i2d_PKCS7_ENC_CONTENT;
++		i2d_PKCS7_ENVELOPE;
++		i2d_PKCS7_ISSUER_AND_SERIAL;
++		i2d_PKCS7_RECIP_INFO;
++		i2d_PKCS7_SIGNED;
++		i2d_PKCS7_SIGNER_INFO;
++		i2d_PKCS7_SIGN_ENVELOPE;
++		i2d_PKCS7_bio;
++		i2d_PKCS7_fp;
++		i2d_PrivateKey;
++		i2d_PublicKey;
++		i2d_RSAPrivateKey;
++		i2d_RSAPrivateKey_bio;
++		i2d_RSAPrivateKey_fp;
++		i2d_RSAPublicKey;
++		i2d_X509;
++		i2d_X509_ALGOR;
++		i2d_X509_ATTRIBUTE;
++		i2d_X509_CINF;
++		i2d_X509_CRL;
++		i2d_X509_CRL_INFO;
++		i2d_X509_CRL_bio;
++		i2d_X509_CRL_fp;
++		i2d_X509_EXTENSION;
++		i2d_X509_NAME;
++		i2d_X509_NAME_ENTRY;
++		i2d_X509_PKEY;
++		i2d_X509_PUBKEY;
++		i2d_X509_REQ;
++		i2d_X509_REQ_INFO;
++		i2d_X509_REQ_bio;
++		i2d_X509_REQ_fp;
++		i2d_X509_REVOKED;
++		i2d_X509_SIG;
++		i2d_X509_VAL;
++		i2d_X509_bio;
++		i2d_X509_fp;
++		idea_cbc_encrypt;
++		idea_cfb64_encrypt;
++		idea_ecb_encrypt;
++		idea_encrypt;
++		idea_ofb64_encrypt;
++		idea_options;
++		idea_set_decrypt_key;
++		idea_set_encrypt_key;
++		lh_delete;
++		lh_doall;
++		lh_doall_arg;
++		lh_free;
++		lh_insert;
++		lh_new;
++		lh_node_stats;
++		lh_node_stats_bio;
++		lh_node_usage_stats;
++		lh_node_usage_stats_bio;
++		lh_retrieve;
++		lh_stats;
++		lh_stats_bio;
++		lh_strhash;
++		sk_delete;
++		sk_delete_ptr;
++		sk_dup;
++		sk_find;
++		sk_free;
++		sk_insert;
++		sk_new;
++		sk_pop;
++		sk_pop_free;
++		sk_push;
++		sk_set_cmp_func;
++		sk_shift;
++		sk_unshift;
++		sk_zero;
++		BIO_f_nbio_test;
++		ASN1_TYPE_get;
++		ASN1_TYPE_set;
++		PKCS7_content_free;
++		ERR_load_PKCS7_strings;
++		X509_find_by_issuer_and_serial;
++		X509_find_by_subject;
++		PKCS7_ctrl;
++		PKCS7_set_type;
++		PKCS7_set_content;
++		PKCS7_SIGNER_INFO_set;
++		PKCS7_add_signer;
++		PKCS7_add_certificate;
++		PKCS7_add_crl;
++		PKCS7_content_new;
++		PKCS7_dataSign;
++		PKCS7_dataVerify;
++		PKCS7_dataInit;
++		PKCS7_add_signature;
++		PKCS7_cert_from_signer_info;
++		PKCS7_get_signer_info;
++		EVP_delete_alias;
++		EVP_mdc2;
++		PEM_read_bio_RSAPublicKey;
++		PEM_write_bio_RSAPublicKey;
++		d2i_RSAPublicKey_bio;
++		i2d_RSAPublicKey_bio;
++		PEM_read_RSAPublicKey;
++		PEM_write_RSAPublicKey;
++		d2i_RSAPublicKey_fp;
++		i2d_RSAPublicKey_fp;
++		BIO_copy_next_retry;
++		RSA_flags;
++		X509_STORE_add_crl;
++		X509_load_crl_file;
++		EVP_rc2_40_cbc;
++		EVP_rc4_40;
++		EVP_CIPHER_CTX_init;
++		HMAC;
++		HMAC_Init;
++		HMAC_Update;
++		HMAC_Final;
++		ERR_get_next_error_library;
++		EVP_PKEY_cmp_parameters;
++		HMAC_cleanup;
++		BIO_ptr_ctrl;
++		BIO_new_file_internal;
++		BIO_new_fp_internal;
++		BIO_s_file_internal;
++		BN_BLINDING_convert;
++		BN_BLINDING_invert;
++		BN_BLINDING_update;
++		RSA_blinding_on;
++		RSA_blinding_off;
++		i2t_ASN1_OBJECT;
++		BN_BLINDING_new;
++		BN_BLINDING_free;
++		EVP_cast5_cbc;
++		EVP_cast5_cfb64;
++		EVP_cast5_ecb;
++		EVP_cast5_ofb;
++		BF_decrypt;
++		CAST_set_key;
++		CAST_encrypt;
++		CAST_decrypt;
++		CAST_ecb_encrypt;
++		CAST_cbc_encrypt;
++		CAST_cfb64_encrypt;
++		CAST_ofb64_encrypt;
++		RC2_decrypt;
++		OBJ_create_objects;
++		BN_exp;
++		BN_mul_word;
++		BN_sub_word;
++		BN_dec2bn;
++		BN_bn2dec;
++		BIO_ghbn_ctrl;
++		CRYPTO_free_ex_data;
++		CRYPTO_get_ex_data;
++		CRYPTO_set_ex_data;
++		ERR_load_CRYPTO_strings;
++		ERR_load_CRYPTOlib_strings;
++		EVP_PKEY_bits;
++		MD5_Transform;
++		SHA1_Transform;
++		SHA_Transform;
++		X509_STORE_CTX_get_chain;
++		X509_STORE_CTX_get_current_cert;
++		X509_STORE_CTX_get_error;
++		X509_STORE_CTX_get_error_depth;
++		X509_STORE_CTX_get_ex_data;
++		X509_STORE_CTX_set_cert;
++		X509_STORE_CTX_set_chain;
++		X509_STORE_CTX_set_error;
++		X509_STORE_CTX_set_ex_data;
++		CRYPTO_dup_ex_data;
++		CRYPTO_get_new_lockid;
++		CRYPTO_new_ex_data;
++		RSA_set_ex_data;
++		RSA_get_ex_data;
++		RSA_get_ex_new_index;
++		RSA_padding_add_PKCS1_type_1;
++		RSA_padding_add_PKCS1_type_2;
++		RSA_padding_add_SSLv23;
++		RSA_padding_add_none;
++		RSA_padding_check_PKCS1_type_1;
++		RSA_padding_check_PKCS1_type_2;
++		RSA_padding_check_SSLv23;
++		RSA_padding_check_none;
++		bn_add_words;
++		d2i_Netscape_RSA_2;
++		CRYPTO_get_ex_new_index;
++		RIPEMD160_Init;
++		RIPEMD160_Update;
++		RIPEMD160_Final;
++		RIPEMD160;
++		RIPEMD160_Transform;
++		RC5_32_set_key;
++		RC5_32_ecb_encrypt;
++		RC5_32_encrypt;
++		RC5_32_decrypt;
++		RC5_32_cbc_encrypt;
++		RC5_32_cfb64_encrypt;
++		RC5_32_ofb64_encrypt;
++		BN_bn2mpi;
++		BN_mpi2bn;
++		ASN1_BIT_STRING_get_bit;
++		ASN1_BIT_STRING_set_bit;
++		BIO_get_ex_data;
++		BIO_get_ex_new_index;
++		BIO_set_ex_data;
++		X509v3_get_key_usage;
++		X509v3_set_key_usage;
++		a2i_X509v3_key_usage;
++		i2a_X509v3_key_usage;
++		EVP_PKEY_decrypt;
++		EVP_PKEY_encrypt;
++		PKCS7_RECIP_INFO_set;
++		PKCS7_add_recipient;
++		PKCS7_add_recipient_info;
++		PKCS7_set_cipher;
++		ASN1_TYPE_get_int_octetstring;
++		ASN1_TYPE_get_octetstring;
++		ASN1_TYPE_set_int_octetstring;
++		ASN1_TYPE_set_octetstring;
++		ASN1_UTCTIME_set_string;
++		ERR_add_error_data;
++		ERR_set_error_data;
++		EVP_CIPHER_asn1_to_param;
++		EVP_CIPHER_param_to_asn1;
++		EVP_CIPHER_get_asn1_iv;
++		EVP_CIPHER_set_asn1_iv;
++		EVP_rc5_32_12_16_cbc;
++		EVP_rc5_32_12_16_cfb64;
++		EVP_rc5_32_12_16_ecb;
++		EVP_rc5_32_12_16_ofb;
++		asn1_add_error;
++		d2i_ASN1_BMPSTRING;
++		i2d_ASN1_BMPSTRING;
++		BIO_f_ber;
++		BN_init;
++		COMP_CTX_new;
++		COMP_CTX_free;
++		COMP_CTX_compress_block;
++		COMP_CTX_expand_block;
++		X509_STORE_CTX_get_ex_new_index;
++		OBJ_NAME_add;
++		BIO_socket_nbio;
++		EVP_rc2_64_cbc;
++		OBJ_NAME_cleanup;
++		OBJ_NAME_get;
++		OBJ_NAME_init;
++		OBJ_NAME_new_index;
++		OBJ_NAME_remove;
++		BN_MONT_CTX_copy;
++		BIO_new_socks4a_connect;
++		BIO_s_socks4a_connect;
++		PROXY_set_connect_mode;
++		RAND_SSLeay;
++		RAND_set_rand_method;
++		RSA_memory_lock;
++		bn_sub_words;
++		bn_mul_normal;
++		bn_mul_comba8;
++		bn_mul_comba4;
++		bn_sqr_normal;
++		bn_sqr_comba8;
++		bn_sqr_comba4;
++		bn_cmp_words;
++		bn_mul_recursive;
++		bn_mul_part_recursive;
++		bn_sqr_recursive;
++		bn_mul_low_normal;
++		BN_RECP_CTX_init;
++		BN_RECP_CTX_new;
++		BN_RECP_CTX_free;
++		BN_RECP_CTX_set;
++		BN_mod_mul_reciprocal;
++		BN_mod_exp_recp;
++		BN_div_recp;
++		BN_CTX_init;
++		BN_MONT_CTX_init;
++		RAND_get_rand_method;
++		PKCS7_add_attribute;
++		PKCS7_add_signed_attribute;
++		PKCS7_digest_from_attributes;
++		PKCS7_get_attribute;
++		PKCS7_get_issuer_and_serial;
++		PKCS7_get_signed_attribute;
++		COMP_compress_block;
++		COMP_expand_block;
++		COMP_rle;
++		COMP_zlib;
++		ms_time_diff;
++		ms_time_new;
++		ms_time_free;
++		ms_time_cmp;
++		ms_time_get;
++		PKCS7_set_attributes;
++		PKCS7_set_signed_attributes;
++		X509_ATTRIBUTE_create;
++		X509_ATTRIBUTE_dup;
++		ASN1_GENERALIZEDTIME_check;
++		ASN1_GENERALIZEDTIME_print;
++		ASN1_GENERALIZEDTIME_set;
++		ASN1_GENERALIZEDTIME_set_string;
++		ASN1_TIME_print;
++		BASIC_CONSTRAINTS_free;
++		BASIC_CONSTRAINTS_new;
++		ERR_load_X509V3_strings;
++		NETSCAPE_CERT_SEQUENCE_free;
++		NETSCAPE_CERT_SEQUENCE_new;
++		OBJ_txt2obj;
++		PEM_read_NETSCAPE_CERT_SEQUENCE;
++		PEM_read_NS_CERT_SEQ;
++		PEM_read_bio_NETSCAPE_CERT_SEQUENCE;
++		PEM_read_bio_NS_CERT_SEQ;
++		PEM_write_NETSCAPE_CERT_SEQUENCE;
++		PEM_write_NS_CERT_SEQ;
++		PEM_write_bio_NETSCAPE_CERT_SEQUENCE;
++		PEM_write_bio_NS_CERT_SEQ;
++		X509V3_EXT_add;
++		X509V3_EXT_add_alias;
++		X509V3_EXT_add_conf;
++		X509V3_EXT_cleanup;
++		X509V3_EXT_conf;
++		X509V3_EXT_conf_nid;
++		X509V3_EXT_get;
++		X509V3_EXT_get_nid;
++		X509V3_EXT_print;
++		X509V3_EXT_print_fp;
++		X509V3_add_standard_extensions;
++		X509V3_add_value;
++		X509V3_add_value_bool;
++		X509V3_add_value_int;
++		X509V3_conf_free;
++		X509V3_get_value_bool;
++		X509V3_get_value_int;
++		X509V3_parse_list;
++		d2i_ASN1_GENERALIZEDTIME;
++		d2i_ASN1_TIME;
++		d2i_BASIC_CONSTRAINTS;
++		d2i_NETSCAPE_CERT_SEQUENCE;
++		d2i_ext_ku;
++		ext_ku_free;
++		ext_ku_new;
++		i2d_ASN1_GENERALIZEDTIME;
++		i2d_ASN1_TIME;
++		i2d_BASIC_CONSTRAINTS;
++		i2d_NETSCAPE_CERT_SEQUENCE;
++		i2d_ext_ku;
++		EVP_MD_CTX_copy;
++		i2d_ASN1_ENUMERATED;
++		d2i_ASN1_ENUMERATED;
++		ASN1_ENUMERATED_set;
++		ASN1_ENUMERATED_get;
++		BN_to_ASN1_ENUMERATED;
++		ASN1_ENUMERATED_to_BN;
++		i2a_ASN1_ENUMERATED;
++		a2i_ASN1_ENUMERATED;
++		i2d_GENERAL_NAME;
++		d2i_GENERAL_NAME;
++		GENERAL_NAME_new;
++		GENERAL_NAME_free;
++		GENERAL_NAMES_new;
++		GENERAL_NAMES_free;
++		d2i_GENERAL_NAMES;
++		i2d_GENERAL_NAMES;
++		i2v_GENERAL_NAMES;
++		i2s_ASN1_OCTET_STRING;
++		s2i_ASN1_OCTET_STRING;
++		X509V3_EXT_check_conf;
++		hex_to_string;
++		string_to_hex;
++		DES_ede3_cbcm_encrypt;
++		RSA_padding_add_PKCS1_OAEP;
++		RSA_padding_check_PKCS1_OAEP;
++		X509_CRL_print_fp;
++		X509_CRL_print;
++		i2v_GENERAL_NAME;
++		v2i_GENERAL_NAME;
++		i2d_PKEY_USAGE_PERIOD;
++		d2i_PKEY_USAGE_PERIOD;
++		PKEY_USAGE_PERIOD_new;
++		PKEY_USAGE_PERIOD_free;
++		v2i_GENERAL_NAMES;
++		i2s_ASN1_INTEGER;
++		X509V3_EXT_d2i;
++		name_cmp;
++		str_dup;
++		i2s_ASN1_ENUMERATED;
++		i2s_ASN1_ENUMERATED_TABLE;
++		BIO_s_log;
++		BIO_f_reliable;
++		PKCS7_dataFinal;
++		PKCS7_dataDecode;
++		X509V3_EXT_CRL_add_conf;
++		BN_set_params;
++		BN_get_params;
++		BIO_get_ex_num;
++		BIO_set_ex_free_func;
++		EVP_ripemd160;
++		ASN1_TIME_set;
++		i2d_AUTHORITY_KEYID;
++		d2i_AUTHORITY_KEYID;
++		AUTHORITY_KEYID_new;
++		AUTHORITY_KEYID_free;
++		ASN1_seq_unpack;
++		ASN1_seq_pack;
++		ASN1_unpack_string;
++		ASN1_pack_string;
++		PKCS12_pack_safebag;
++		PKCS12_MAKE_KEYBAG;
++		PKCS8_encrypt;
++		PKCS12_MAKE_SHKEYBAG;
++		PKCS12_pack_p7data;
++		PKCS12_pack_p7encdata;
++		PKCS12_add_localkeyid;
++		PKCS12_add_friendlyname_asc;
++		PKCS12_add_friendlyname_uni;
++		PKCS12_get_friendlyname;
++		PKCS12_pbe_crypt;
++		PKCS12_decrypt_d2i;
++		PKCS12_i2d_encrypt;
++		PKCS12_init;
++		PKCS12_key_gen_asc;
++		PKCS12_key_gen_uni;
++		PKCS12_gen_mac;
++		PKCS12_verify_mac;
++		PKCS12_set_mac;
++		PKCS12_setup_mac;
++		OPENSSL_asc2uni;
++		OPENSSL_uni2asc;
++		i2d_PKCS12_BAGS;
++		PKCS12_BAGS_new;
++		d2i_PKCS12_BAGS;
++		PKCS12_BAGS_free;
++		i2d_PKCS12;
++		d2i_PKCS12;
++		PKCS12_new;
++		PKCS12_free;
++		i2d_PKCS12_MAC_DATA;
++		PKCS12_MAC_DATA_new;
++		d2i_PKCS12_MAC_DATA;
++		PKCS12_MAC_DATA_free;
++		i2d_PKCS12_SAFEBAG;
++		PKCS12_SAFEBAG_new;
++		d2i_PKCS12_SAFEBAG;
++		PKCS12_SAFEBAG_free;
++		ERR_load_PKCS12_strings;
++		PKCS12_PBE_add;
++		PKCS8_add_keyusage;
++		PKCS12_get_attr_gen;
++		PKCS12_parse;
++		PKCS12_create;
++		i2d_PKCS12_bio;
++		i2d_PKCS12_fp;
++		d2i_PKCS12_bio;
++		d2i_PKCS12_fp;
++		i2d_PBEPARAM;
++		PBEPARAM_new;
++		d2i_PBEPARAM;
++		PBEPARAM_free;
++		i2d_PKCS8_PRIV_KEY_INFO;
++		PKCS8_PRIV_KEY_INFO_new;
++		d2i_PKCS8_PRIV_KEY_INFO;
++		PKCS8_PRIV_KEY_INFO_free;
++		EVP_PKCS82PKEY;
++		EVP_PKEY2PKCS8;
++		PKCS8_set_broken;
++		EVP_PBE_ALGOR_CipherInit;
++		EVP_PBE_alg_add;
++		PKCS5_pbe_set;
++		EVP_PBE_cleanup;
++		i2d_SXNET;
++		d2i_SXNET;
++		SXNET_new;
++		SXNET_free;
++		i2d_SXNETID;
++		d2i_SXNETID;
++		SXNETID_new;
++		SXNETID_free;
++		DSA_SIG_new;
++		DSA_SIG_free;
++		DSA_do_sign;
++		DSA_do_verify;
++		d2i_DSA_SIG;
++		i2d_DSA_SIG;
++		i2d_ASN1_VISIBLESTRING;
++		d2i_ASN1_VISIBLESTRING;
++		i2d_ASN1_UTF8STRING;
++		d2i_ASN1_UTF8STRING;
++		i2d_DIRECTORYSTRING;
++		d2i_DIRECTORYSTRING;
++		i2d_DISPLAYTEXT;
++		d2i_DISPLAYTEXT;
++		d2i_ASN1_SET_OF_X509;
++		i2d_ASN1_SET_OF_X509;
++		i2d_PBKDF2PARAM;
++		PBKDF2PARAM_new;
++		d2i_PBKDF2PARAM;
++		PBKDF2PARAM_free;
++		i2d_PBE2PARAM;
++		PBE2PARAM_new;
++		d2i_PBE2PARAM;
++		PBE2PARAM_free;
++		d2i_ASN1_SET_OF_GENERAL_NAME;
++		i2d_ASN1_SET_OF_GENERAL_NAME;
++		d2i_ASN1_SET_OF_SXNETID;
++		i2d_ASN1_SET_OF_SXNETID;
++		d2i_ASN1_SET_OF_POLICYQUALINFO;
++		i2d_ASN1_SET_OF_POLICYQUALINFO;
++		d2i_ASN1_SET_OF_POLICYINFO;
++		i2d_ASN1_SET_OF_POLICYINFO;
++		SXNET_add_id_asc;
++		SXNET_add_id_ulong;
++		SXNET_add_id_INTEGER;
++		SXNET_get_id_asc;
++		SXNET_get_id_ulong;
++		SXNET_get_id_INTEGER;
++		X509V3_set_conf_lhash;
++		i2d_CERTIFICATEPOLICIES;
++		CERTIFICATEPOLICIES_new;
++		CERTIFICATEPOLICIES_free;
++		d2i_CERTIFICATEPOLICIES;
++		i2d_POLICYINFO;
++		POLICYINFO_new;
++		d2i_POLICYINFO;
++		POLICYINFO_free;
++		i2d_POLICYQUALINFO;
++		POLICYQUALINFO_new;
++		d2i_POLICYQUALINFO;
++		POLICYQUALINFO_free;
++		i2d_USERNOTICE;
++		USERNOTICE_new;
++		d2i_USERNOTICE;
++		USERNOTICE_free;
++		i2d_NOTICEREF;
++		NOTICEREF_new;
++		d2i_NOTICEREF;
++		NOTICEREF_free;
++		X509V3_get_string;
++		X509V3_get_section;
++		X509V3_string_free;
++		X509V3_section_free;
++		X509V3_set_ctx;
++		s2i_ASN1_INTEGER;
++		CRYPTO_set_locked_mem_functions;
++		CRYPTO_get_locked_mem_functions;
++		CRYPTO_malloc_locked;
++		CRYPTO_free_locked;
++		BN_mod_exp2_mont;
++		ERR_get_error_line_data;
++		ERR_peek_error_line_data;
++		PKCS12_PBE_keyivgen;
++		X509_ALGOR_dup;
++		d2i_ASN1_SET_OF_DIST_POINT;
++		i2d_ASN1_SET_OF_DIST_POINT;
++		i2d_CRL_DIST_POINTS;
++		CRL_DIST_POINTS_new;
++		CRL_DIST_POINTS_free;
++		d2i_CRL_DIST_POINTS;
++		i2d_DIST_POINT;
++		DIST_POINT_new;
++		d2i_DIST_POINT;
++		DIST_POINT_free;
++		i2d_DIST_POINT_NAME;
++		DIST_POINT_NAME_new;
++		DIST_POINT_NAME_free;
++		d2i_DIST_POINT_NAME;
++		X509V3_add_value_uchar;
++		d2i_ASN1_SET_OF_X509_ATTRIBUTE;
++		i2d_ASN1_SET_OF_ASN1_TYPE;
++		d2i_ASN1_SET_OF_X509_EXTENSION;
++		d2i_ASN1_SET_OF_X509_NAME_ENTRY;
++		d2i_ASN1_SET_OF_ASN1_TYPE;
++		i2d_ASN1_SET_OF_X509_ATTRIBUTE;
++		i2d_ASN1_SET_OF_X509_EXTENSION;
++		i2d_ASN1_SET_OF_X509_NAME_ENTRY;
++		X509V3_EXT_i2d;
++		X509V3_EXT_val_prn;
++		X509V3_EXT_add_list;
++		EVP_CIPHER_type;
++		EVP_PBE_CipherInit;
++		X509V3_add_value_bool_nf;
++		d2i_ASN1_UINTEGER;
++		sk_value;
++		sk_num;
++		sk_set;
++		i2d_ASN1_SET_OF_X509_REVOKED;
++		sk_sort;
++		d2i_ASN1_SET_OF_X509_REVOKED;
++		i2d_ASN1_SET_OF_X509_ALGOR;
++		i2d_ASN1_SET_OF_X509_CRL;
++		d2i_ASN1_SET_OF_X509_ALGOR;
++		d2i_ASN1_SET_OF_X509_CRL;
++		i2d_ASN1_SET_OF_PKCS7_SIGNER_INFO;
++		i2d_ASN1_SET_OF_PKCS7_RECIP_INFO;
++		d2i_ASN1_SET_OF_PKCS7_SIGNER_INFO;
++		d2i_ASN1_SET_OF_PKCS7_RECIP_INFO;
++		PKCS5_PBE_add;
++		PEM_write_bio_PKCS8;
++		i2d_PKCS8_fp;
++		PEM_read_bio_PKCS8_PRIV_KEY_INFO;
++		PEM_read_bio_P8_PRIV_KEY_INFO;
++		d2i_PKCS8_bio;
++		d2i_PKCS8_PRIV_KEY_INFO_fp;
++		PEM_write_bio_PKCS8_PRIV_KEY_INFO;
++		PEM_write_bio_P8_PRIV_KEY_INFO;
++		PEM_read_PKCS8;
++		d2i_PKCS8_PRIV_KEY_INFO_bio;
++		d2i_PKCS8_fp;
++		PEM_write_PKCS8;
++		PEM_read_PKCS8_PRIV_KEY_INFO;
++		PEM_read_P8_PRIV_KEY_INFO;
++		PEM_read_bio_PKCS8;
++		PEM_write_PKCS8_PRIV_KEY_INFO;
++		PEM_write_P8_PRIV_KEY_INFO;
++		PKCS5_PBE_keyivgen;
++		i2d_PKCS8_bio;
++		i2d_PKCS8_PRIV_KEY_INFO_fp;
++		i2d_PKCS8_PRIV_KEY_INFO_bio;
++		BIO_s_bio;
++		PKCS5_pbe2_set;
++		PKCS5_PBKDF2_HMAC_SHA1;
++		PKCS5_v2_PBE_keyivgen;
++		PEM_write_bio_PKCS8PrivateKey;
++		PEM_write_PKCS8PrivateKey;
++		BIO_ctrl_get_read_request;
++		BIO_ctrl_pending;
++		BIO_ctrl_wpending;
++		BIO_new_bio_pair;
++		BIO_ctrl_get_write_guarantee;
++		CRYPTO_num_locks;
++		CONF_load_bio;
++		CONF_load_fp;
++		i2d_ASN1_SET_OF_ASN1_OBJECT;
++		d2i_ASN1_SET_OF_ASN1_OBJECT;
++		PKCS7_signatureVerify;
++		RSA_set_method;
++		RSA_get_method;
++		RSA_get_default_method;
++		RSA_check_key;
++		OBJ_obj2txt;
++		DSA_dup_DH;
++		X509_REQ_get_extensions;
++		X509_REQ_set_extension_nids;
++		BIO_nwrite;
++		X509_REQ_extension_nid;
++		BIO_nread;
++		X509_REQ_get_extension_nids;
++		BIO_nwrite0;
++		X509_REQ_add_extensions_nid;
++		BIO_nread0;
++		X509_REQ_add_extensions;
++		BIO_new_mem_buf;
++		DH_set_ex_data;
++		DH_set_method;
++		DSA_OpenSSL;
++		DH_get_ex_data;
++		DH_get_ex_new_index;
++		DSA_new_method;
++		DH_new_method;
++		DH_OpenSSL;
++		DSA_get_ex_new_index;
++		DH_get_default_method;
++		DSA_set_ex_data;
++		DH_set_default_method;
++		DSA_get_ex_data;
++		X509V3_EXT_REQ_add_conf;
++		NETSCAPE_SPKI_print;
++		NETSCAPE_SPKI_set_pubkey;
++		NETSCAPE_SPKI_b64_encode;
++		NETSCAPE_SPKI_get_pubkey;
++		NETSCAPE_SPKI_b64_decode;
++		UTF8_putc;
++		UTF8_getc;
++		RSA_null_method;
++		ASN1_tag2str;
++		BIO_ctrl_reset_read_request;
++		DISPLAYTEXT_new;
++		ASN1_GENERALIZEDTIME_free;
++		X509_REVOKED_get_ext_d2i;
++		X509_set_ex_data;
++		X509_reject_set_bit_asc;
++		X509_NAME_add_entry_by_txt;
++		X509_NAME_add_entry_by_NID;
++		X509_PURPOSE_get0;
++		PEM_read_X509_AUX;
++		d2i_AUTHORITY_INFO_ACCESS;
++		PEM_write_PUBKEY;
++		ACCESS_DESCRIPTION_new;
++		X509_CERT_AUX_free;
++		d2i_ACCESS_DESCRIPTION;
++		X509_trust_clear;
++		X509_TRUST_add;
++		ASN1_VISIBLESTRING_new;
++		X509_alias_set1;
++		ASN1_PRINTABLESTRING_free;
++		EVP_PKEY_get1_DSA;
++		ASN1_BMPSTRING_new;
++		ASN1_mbstring_copy;
++		ASN1_UTF8STRING_new;
++		DSA_get_default_method;
++		i2d_ASN1_SET_OF_ACCESS_DESCRIPTION;
++		ASN1_T61STRING_free;
++		DSA_set_method;
++		X509_get_ex_data;
++		ASN1_STRING_type;
++		X509_PURPOSE_get_by_sname;
++		ASN1_TIME_free;
++		ASN1_OCTET_STRING_cmp;
++		ASN1_BIT_STRING_new;
++		X509_get_ext_d2i;
++		PEM_read_bio_X509_AUX;
++		ASN1_STRING_set_default_mask_asc;
++		ASN1_STRING_set_def_mask_asc;
++		PEM_write_bio_RSA_PUBKEY;
++		ASN1_INTEGER_cmp;
++		d2i_RSA_PUBKEY_fp;
++		X509_trust_set_bit_asc;
++		PEM_write_bio_DSA_PUBKEY;
++		X509_STORE_CTX_free;
++		EVP_PKEY_set1_DSA;
++		i2d_DSA_PUBKEY_fp;
++		X509_load_cert_crl_file;
++		ASN1_TIME_new;
++		i2d_RSA_PUBKEY;
++		X509_STORE_CTX_purpose_inherit;
++		PEM_read_RSA_PUBKEY;
++		d2i_X509_AUX;
++		i2d_DSA_PUBKEY;
++		X509_CERT_AUX_print;
++		PEM_read_DSA_PUBKEY;
++		i2d_RSA_PUBKEY_bio;
++		ASN1_BIT_STRING_num_asc;
++		i2d_PUBKEY;
++		ASN1_UTCTIME_free;
++		DSA_set_default_method;
++		X509_PURPOSE_get_by_id;
++		ACCESS_DESCRIPTION_free;
++		PEM_read_bio_PUBKEY;
++		ASN1_STRING_set_by_NID;
++		X509_PURPOSE_get_id;
++		DISPLAYTEXT_free;
++		OTHERNAME_new;
++		X509_CERT_AUX_new;
++		X509_TRUST_cleanup;
++		X509_NAME_add_entry_by_OBJ;
++		X509_CRL_get_ext_d2i;
++		X509_PURPOSE_get0_name;
++		PEM_read_PUBKEY;
++		i2d_DSA_PUBKEY_bio;
++		i2d_OTHERNAME;
++		ASN1_OCTET_STRING_free;
++		ASN1_BIT_STRING_set_asc;
++		X509_get_ex_new_index;
++		ASN1_STRING_TABLE_cleanup;
++		X509_TRUST_get_by_id;
++		X509_PURPOSE_get_trust;
++		ASN1_STRING_length;
++		d2i_ASN1_SET_OF_ACCESS_DESCRIPTION;
++		ASN1_PRINTABLESTRING_new;
++		X509V3_get_d2i;
++		ASN1_ENUMERATED_free;
++		i2d_X509_CERT_AUX;
++		X509_STORE_CTX_set_trust;
++		ASN1_STRING_set_default_mask;
++		X509_STORE_CTX_new;
++		EVP_PKEY_get1_RSA;
++		DIRECTORYSTRING_free;
++		PEM_write_X509_AUX;
++		ASN1_OCTET_STRING_set;
++		d2i_DSA_PUBKEY_fp;
++		d2i_RSA_PUBKEY;
++		X509_TRUST_get0_name;
++		X509_TRUST_get0;
++		AUTHORITY_INFO_ACCESS_free;
++		ASN1_IA5STRING_new;
++		d2i_DSA_PUBKEY;
++		X509_check_purpose;
++		ASN1_ENUMERATED_new;
++		d2i_RSA_PUBKEY_bio;
++		d2i_PUBKEY;
++		X509_TRUST_get_trust;
++		X509_TRUST_get_flags;
++		ASN1_BMPSTRING_free;
++		ASN1_T61STRING_new;
++		ASN1_UTCTIME_new;
++		i2d_AUTHORITY_INFO_ACCESS;
++		EVP_PKEY_set1_RSA;
++		X509_STORE_CTX_set_purpose;
++		ASN1_IA5STRING_free;
++		PEM_write_bio_X509_AUX;
++		X509_PURPOSE_get_count;
++		CRYPTO_add_info;
++		X509_NAME_ENTRY_create_by_txt;
++		ASN1_STRING_get_default_mask;
++		X509_alias_get0;
++		ASN1_STRING_data;
++		i2d_ACCESS_DESCRIPTION;
++		X509_trust_set_bit;
++		ASN1_BIT_STRING_free;
++		PEM_read_bio_RSA_PUBKEY;
++		X509_add1_reject_object;
++		X509_check_trust;
++		PEM_read_bio_DSA_PUBKEY;
++		X509_PURPOSE_add;
++		ASN1_STRING_TABLE_get;
++		ASN1_UTF8STRING_free;
++		d2i_DSA_PUBKEY_bio;
++		PEM_write_RSA_PUBKEY;
++		d2i_OTHERNAME;
++		X509_reject_set_bit;
++		PEM_write_DSA_PUBKEY;
++		X509_PURPOSE_get0_sname;
++		EVP_PKEY_set1_DH;
++		ASN1_OCTET_STRING_dup;
++		ASN1_BIT_STRING_set;
++		X509_TRUST_get_count;
++		ASN1_INTEGER_free;
++		OTHERNAME_free;
++		i2d_RSA_PUBKEY_fp;
++		ASN1_INTEGER_dup;
++		d2i_X509_CERT_AUX;
++		PEM_write_bio_PUBKEY;
++		ASN1_VISIBLESTRING_free;
++		X509_PURPOSE_cleanup;
++		ASN1_mbstring_ncopy;
++		ASN1_GENERALIZEDTIME_new;
++		EVP_PKEY_get1_DH;
++		ASN1_OCTET_STRING_new;
++		ASN1_INTEGER_new;
++		i2d_X509_AUX;
++		ASN1_BIT_STRING_name_print;
++		X509_cmp;
++		ASN1_STRING_length_set;
++		DIRECTORYSTRING_new;
++		X509_add1_trust_object;
++		PKCS12_newpass;
++		SMIME_write_PKCS7;
++		SMIME_read_PKCS7;
++		DES_set_key_checked;
++		PKCS7_verify;
++		PKCS7_encrypt;
++		DES_set_key_unchecked;
++		SMIME_crlf_copy;
++		i2d_ASN1_PRINTABLESTRING;
++		PKCS7_get0_signers;
++		PKCS7_decrypt;
++		SMIME_text;
++		PKCS7_simple_smimecap;
++		PKCS7_get_smimecap;
++		PKCS7_sign;
++		PKCS7_add_attrib_smimecap;
++		CRYPTO_dbg_set_options;
++		CRYPTO_remove_all_info;
++		CRYPTO_get_mem_debug_functions;
++		CRYPTO_is_mem_check_on;
++		CRYPTO_set_mem_debug_functions;
++		CRYPTO_pop_info;
++		CRYPTO_push_info_;
++		CRYPTO_set_mem_debug_options;
++		PEM_write_PKCS8PrivateKey_nid;
++		PEM_write_bio_PKCS8PrivateKey_nid;
++		PEM_write_bio_PKCS8PrivKey_nid;
++		d2i_PKCS8PrivateKey_bio;
++		ASN1_NULL_free;
++		d2i_ASN1_NULL;
++		ASN1_NULL_new;
++		i2d_PKCS8PrivateKey_bio;
++		i2d_PKCS8PrivateKey_fp;
++		i2d_ASN1_NULL;
++		i2d_PKCS8PrivateKey_nid_fp;
++		d2i_PKCS8PrivateKey_fp;
++		i2d_PKCS8PrivateKey_nid_bio;
++		i2d_PKCS8PrivateKeyInfo_fp;
++		i2d_PKCS8PrivateKeyInfo_bio;
++		PEM_cb;
++		i2d_PrivateKey_fp;
++		d2i_PrivateKey_bio;
++		d2i_PrivateKey_fp;
++		i2d_PrivateKey_bio;
++		X509_reject_clear;
++		X509_TRUST_set_default;
++		d2i_AutoPrivateKey;
++		X509_ATTRIBUTE_get0_type;
++		X509_ATTRIBUTE_set1_data;
++		X509at_get_attr;
++		X509at_get_attr_count;
++		X509_ATTRIBUTE_create_by_NID;
++		X509_ATTRIBUTE_set1_object;
++		X509_ATTRIBUTE_count;
++		X509_ATTRIBUTE_create_by_OBJ;
++		X509_ATTRIBUTE_get0_object;
++		X509at_get_attr_by_NID;
++		X509at_add1_attr;
++		X509_ATTRIBUTE_get0_data;
++		X509at_delete_attr;
++		X509at_get_attr_by_OBJ;
++		RAND_add;
++		BIO_number_written;
++		BIO_number_read;
++		X509_STORE_CTX_get1_chain;
++		ERR_load_RAND_strings;
++		RAND_pseudo_bytes;
++		X509_REQ_get_attr_by_NID;
++		X509_REQ_get_attr;
++		X509_REQ_add1_attr_by_NID;
++		X509_REQ_get_attr_by_OBJ;
++		X509at_add1_attr_by_NID;
++		X509_REQ_add1_attr_by_OBJ;
++		X509_REQ_get_attr_count;
++		X509_REQ_add1_attr;
++		X509_REQ_delete_attr;
++		X509at_add1_attr_by_OBJ;
++		X509_REQ_add1_attr_by_txt;
++		X509_ATTRIBUTE_create_by_txt;
++		X509at_add1_attr_by_txt;
++		BN_pseudo_rand;
++		BN_is_prime_fasttest;
++		BN_CTX_end;
++		BN_CTX_start;
++		BN_CTX_get;
++		EVP_PKEY2PKCS8_broken;
++		ASN1_STRING_TABLE_add;
++		CRYPTO_dbg_get_options;
++		AUTHORITY_INFO_ACCESS_new;
++		CRYPTO_get_mem_debug_options;
++		DES_crypt;
++		PEM_write_bio_X509_REQ_NEW;
++		PEM_write_X509_REQ_NEW;
++		BIO_callback_ctrl;
++		RAND_egd;
++		RAND_status;
++		bn_dump1;
++		DES_check_key_parity;
++		lh_num_items;
++		RAND_event;
++		DSO_new;
++		DSO_new_method;
++		DSO_free;
++		DSO_flags;
++		DSO_up;
++		DSO_set_default_method;
++		DSO_get_default_method;
++		DSO_get_method;
++		DSO_set_method;
++		DSO_load;
++		DSO_bind_var;
++		DSO_METHOD_null;
++		DSO_METHOD_openssl;
++		DSO_METHOD_dlfcn;
++		DSO_METHOD_win32;
++		ERR_load_DSO_strings;
++		DSO_METHOD_dl;
++		NCONF_load;
++		NCONF_load_fp;
++		NCONF_new;
++		NCONF_get_string;
++		NCONF_free;
++		NCONF_get_number;
++		CONF_dump_fp;
++		NCONF_load_bio;
++		NCONF_dump_fp;
++		NCONF_get_section;
++		NCONF_dump_bio;
++		CONF_dump_bio;
++		NCONF_free_data;
++		CONF_set_default_method;
++		ERR_error_string_n;
++		BIO_snprintf;
++		DSO_ctrl;
++		i2d_ASN1_SET_OF_ASN1_INTEGER;
++		i2d_ASN1_SET_OF_PKCS12_SAFEBAG;
++		i2d_ASN1_SET_OF_PKCS7;
++		BIO_vfree;
++		d2i_ASN1_SET_OF_ASN1_INTEGER;
++		d2i_ASN1_SET_OF_PKCS12_SAFEBAG;
++		ASN1_UTCTIME_get;
++		X509_REQ_digest;
++		X509_CRL_digest;
++		d2i_ASN1_SET_OF_PKCS7;
++		EVP_CIPHER_CTX_set_key_length;
++		EVP_CIPHER_CTX_ctrl;
++		BN_mod_exp_mont_word;
++		RAND_egd_bytes;
++		X509_REQ_get1_email;
++		X509_get1_email;
++		X509_email_free;
++		i2d_RSA_NET;
++		d2i_RSA_NET_2;
++		d2i_RSA_NET;
++		DSO_bind_func;
++		CRYPTO_get_new_dynlockid;
++		sk_new_null;
++		CRYPTO_set_dynlock_destroy_callback;
++		CRYPTO_set_dynlock_destroy_cb;
++		CRYPTO_destroy_dynlockid;
++		CRYPTO_set_dynlock_size;
++		CRYPTO_set_dynlock_create_callback;
++		CRYPTO_set_dynlock_create_cb;
++		CRYPTO_set_dynlock_lock_callback;
++		CRYPTO_set_dynlock_lock_cb;
++		CRYPTO_get_dynlock_lock_callback;
++		CRYPTO_get_dynlock_lock_cb;
++		CRYPTO_get_dynlock_destroy_callback;
++		CRYPTO_get_dynlock_destroy_cb;
++		CRYPTO_get_dynlock_value;
++		CRYPTO_get_dynlock_create_callback;
++		CRYPTO_get_dynlock_create_cb;
++		c2i_ASN1_BIT_STRING;
++		i2c_ASN1_BIT_STRING;
++		RAND_poll;
++		c2i_ASN1_INTEGER;
++		i2c_ASN1_INTEGER;
++		BIO_dump_indent;
++		ASN1_parse_dump;
++		c2i_ASN1_OBJECT;
++		X509_NAME_print_ex_fp;
++		ASN1_STRING_print_ex_fp;
++		X509_NAME_print_ex;
++		ASN1_STRING_print_ex;
++		MD4;
++		MD4_Transform;
++		MD4_Final;
++		MD4_Update;
++		MD4_Init;
++		EVP_md4;
++		i2d_PUBKEY_bio;
++		i2d_PUBKEY_fp;
++		d2i_PUBKEY_bio;
++		ASN1_STRING_to_UTF8;
++		BIO_vprintf;
++		BIO_vsnprintf;
++		d2i_PUBKEY_fp;
++		X509_cmp_time;
++		X509_STORE_CTX_set_time;
++		X509_STORE_CTX_get1_issuer;
++		X509_OBJECT_retrieve_match;
++		X509_OBJECT_idx_by_subject;
++		X509_STORE_CTX_set_flags;
++		X509_STORE_CTX_trusted_stack;
++		X509_time_adj;
++		X509_check_issued;
++		ASN1_UTCTIME_cmp_time_t;
++		DES_set_weak_key_flag;
++		DES_check_key;
++		DES_rw_mode;
++		RSA_PKCS1_RSAref;
++		X509_keyid_set1;
++		BIO_next;
++		DSO_METHOD_vms;
++		BIO_f_linebuffer;
++		BN_bntest_rand;
++		OPENSSL_issetugid;
++		BN_rand_range;
++		ERR_load_ENGINE_strings;
++		ENGINE_set_DSA;
++		ENGINE_get_finish_function;
++		ENGINE_get_default_RSA;
++		ENGINE_get_BN_mod_exp;
++		DSA_get_default_openssl_method;
++		ENGINE_set_DH;
++		ENGINE_set_def_BN_mod_exp_crt;
++		ENGINE_set_default_BN_mod_exp_crt;
++		ENGINE_init;
++		DH_get_default_openssl_method;
++		RSA_set_default_openssl_method;
++		ENGINE_finish;
++		ENGINE_load_public_key;
++		ENGINE_get_DH;
++		ENGINE_ctrl;
++		ENGINE_get_init_function;
++		ENGINE_set_init_function;
++		ENGINE_set_default_DSA;
++		ENGINE_get_name;
++		ENGINE_get_last;
++		ENGINE_get_prev;
++		ENGINE_get_default_DH;
++		ENGINE_get_RSA;
++		ENGINE_set_default;
++		ENGINE_get_RAND;
++		ENGINE_get_first;
++		ENGINE_by_id;
++		ENGINE_set_finish_function;
++		ENGINE_get_def_BN_mod_exp_crt;
++		ENGINE_get_default_BN_mod_exp_crt;
++		RSA_get_default_openssl_method;
++		ENGINE_set_RSA;
++		ENGINE_load_private_key;
++		ENGINE_set_default_RAND;
++		ENGINE_set_BN_mod_exp;
++		ENGINE_remove;
++		ENGINE_free;
++		ENGINE_get_BN_mod_exp_crt;
++		ENGINE_get_next;
++		ENGINE_set_name;
++		ENGINE_get_default_DSA;
++		ENGINE_set_default_BN_mod_exp;
++		ENGINE_set_default_RSA;
++		ENGINE_get_default_RAND;
++		ENGINE_get_default_BN_mod_exp;
++		ENGINE_set_RAND;
++		ENGINE_set_id;
++		ENGINE_set_BN_mod_exp_crt;
++		ENGINE_set_default_DH;
++		ENGINE_new;
++		ENGINE_get_id;
++		DSA_set_default_openssl_method;
++		ENGINE_add;
++		DH_set_default_openssl_method;
++		ENGINE_get_DSA;
++		ENGINE_get_ctrl_function;
++		ENGINE_set_ctrl_function;
++		BN_pseudo_rand_range;
++		X509_STORE_CTX_set_verify_cb;
++		ERR_load_COMP_strings;
++		PKCS12_item_decrypt_d2i;
++		ASN1_UTF8STRING_it;
++		ENGINE_unregister_ciphers;
++		ENGINE_get_ciphers;
++		d2i_OCSP_BASICRESP;
++		KRB5_CHECKSUM_it;
++		EC_POINT_add;
++		ASN1_item_ex_i2d;
++		OCSP_CERTID_it;
++		d2i_OCSP_RESPBYTES;
++		X509V3_add1_i2d;
++		PKCS7_ENVELOPE_it;
++		UI_add_input_boolean;
++		ENGINE_unregister_RSA;
++		X509V3_EXT_nconf;
++		ASN1_GENERALSTRING_free;
++		d2i_OCSP_CERTSTATUS;
++		X509_REVOKED_set_serialNumber;
++		X509_print_ex;
++		OCSP_ONEREQ_get1_ext_d2i;
++		ENGINE_register_all_RAND;
++		ENGINE_load_dynamic;
++		PBKDF2PARAM_it;
++		EXTENDED_KEY_USAGE_new;
++		EC_GROUP_clear_free;
++		OCSP_sendreq_bio;
++		ASN1_item_digest;
++		OCSP_BASICRESP_delete_ext;
++		OCSP_SIGNATURE_it;
++		X509_CRL_it;
++		OCSP_BASICRESP_add_ext;
++		KRB5_ENCKEY_it;
++		UI_method_set_closer;
++		X509_STORE_set_purpose;
++		i2d_ASN1_GENERALSTRING;
++		OCSP_response_status;
++		i2d_OCSP_SERVICELOC;
++		ENGINE_get_digest_engine;
++		EC_GROUP_set_curve_GFp;
++		OCSP_REQUEST_get_ext_by_OBJ;
++		_ossl_old_des_random_key;
++		ASN1_T61STRING_it;
++		EC_GROUP_method_of;
++		i2d_KRB5_APREQ;
++		_ossl_old_des_encrypt;
++		ASN1_PRINTABLE_new;
++		HMAC_Init_ex;
++		d2i_KRB5_AUTHENT;
++		OCSP_archive_cutoff_new;
++		EC_POINT_set_Jprojective_coordinates_GFp;
++		EC_POINT_set_Jproj_coords_GFp;
++		_ossl_old_des_is_weak_key;
++		OCSP_BASICRESP_get_ext_by_OBJ;
++		EC_POINT_oct2point;
++		OCSP_SINGLERESP_get_ext_count;
++		UI_ctrl;
++		_shadow_DES_rw_mode;
++		asn1_do_adb;
++		ASN1_template_i2d;
++		ENGINE_register_DH;
++		UI_construct_prompt;
++		X509_STORE_set_trust;
++		UI_dup_input_string;
++		d2i_KRB5_APREQ;
++		EVP_MD_CTX_copy_ex;
++		OCSP_request_is_signed;
++		i2d_OCSP_REQINFO;
++		KRB5_ENCKEY_free;
++		OCSP_resp_get0;
++		GENERAL_NAME_it;
++		ASN1_GENERALIZEDTIME_it;
++		X509_STORE_set_flags;
++		EC_POINT_set_compressed_coordinates_GFp;
++		EC_POINT_set_compr_coords_GFp;
++		OCSP_response_status_str;
++		d2i_OCSP_REVOKEDINFO;
++		OCSP_basic_add1_cert;
++		ERR_get_implementation;
++		EVP_CipherFinal_ex;
++		OCSP_CERTSTATUS_new;
++		CRYPTO_cleanup_all_ex_data;
++		OCSP_resp_find;
++		BN_nnmod;
++		X509_CRL_sort;
++		X509_REVOKED_set_revocationDate;
++		ENGINE_register_RAND;
++		OCSP_SERVICELOC_new;
++		EC_POINT_set_affine_coordinates_GFp;
++		EC_POINT_set_affine_coords_GFp;
++		_ossl_old_des_options;
++		SXNET_it;
++		UI_dup_input_boolean;
++		PKCS12_add_CSPName_asc;
++		EC_POINT_is_at_infinity;
++		ENGINE_load_cryptodev;
++		DSO_convert_filename;
++		POLICYQUALINFO_it;
++		ENGINE_register_ciphers;
++		BN_mod_lshift_quick;
++		DSO_set_filename;
++		ASN1_item_free;
++		KRB5_TKTBODY_free;
++		AUTHORITY_KEYID_it;
++		KRB5_APREQBODY_new;
++		X509V3_EXT_REQ_add_nconf;
++		ENGINE_ctrl_cmd_string;
++		i2d_OCSP_RESPDATA;
++		EVP_MD_CTX_init;
++		EXTENDED_KEY_USAGE_free;
++		PKCS7_ATTR_SIGN_it;
++		UI_add_error_string;
++		KRB5_CHECKSUM_free;
++		OCSP_REQUEST_get_ext;
++		ENGINE_load_ubsec;
++		ENGINE_register_all_digests;
++		PKEY_USAGE_PERIOD_it;
++		PKCS12_unpack_authsafes;
++		ASN1_item_unpack;
++		NETSCAPE_SPKAC_it;
++		X509_REVOKED_it;
++		ASN1_STRING_encode;
++		EVP_aes_128_ecb;
++		KRB5_AUTHENT_free;
++		OCSP_BASICRESP_get_ext_by_critical;
++		OCSP_BASICRESP_get_ext_by_crit;
++		OCSP_cert_status_str;
++		d2i_OCSP_REQUEST;
++		UI_dup_info_string;
++		_ossl_old_des_xwhite_in2out;
++		PKCS12_it;
++		OCSP_SINGLERESP_get_ext_by_critical;
++		OCSP_SINGLERESP_get_ext_by_crit;
++		OCSP_CERTSTATUS_free;
++		_ossl_old_des_crypt;
++		ASN1_item_i2d;
++		EVP_DecryptFinal_ex;
++		ENGINE_load_openssl;
++		ENGINE_get_cmd_defns;
++		ENGINE_set_load_privkey_function;
++		ENGINE_set_load_privkey_fn;
++		EVP_EncryptFinal_ex;
++		ENGINE_set_default_digests;
++		X509_get0_pubkey_bitstr;
++		asn1_ex_i2c;
++		ENGINE_register_RSA;
++		ENGINE_unregister_DSA;
++		_ossl_old_des_key_sched;
++		X509_EXTENSION_it;
++		i2d_KRB5_AUTHENT;
++		SXNETID_it;
++		d2i_OCSP_SINGLERESP;
++		EDIPARTYNAME_new;
++		PKCS12_certbag2x509;
++		_ossl_old_des_ofb64_encrypt;
++		d2i_EXTENDED_KEY_USAGE;
++		ERR_print_errors_cb;
++		ENGINE_set_ciphers;
++		d2i_KRB5_APREQBODY;
++		UI_method_get_flusher;
++		X509_PUBKEY_it;
++		_ossl_old_des_enc_read;
++		PKCS7_ENCRYPT_it;
++		i2d_OCSP_RESPONSE;
++		EC_GROUP_get_cofactor;
++		PKCS12_unpack_p7data;
++		d2i_KRB5_AUTHDATA;
++		OCSP_copy_nonce;
++		KRB5_AUTHDATA_new;
++		OCSP_RESPDATA_new;
++		EC_GFp_mont_method;
++		OCSP_REVOKEDINFO_free;
++		UI_get_ex_data;
++		KRB5_APREQBODY_free;
++		EC_GROUP_get0_generator;
++		UI_get_default_method;
++		X509V3_set_nconf;
++		PKCS12_item_i2d_encrypt;
++		X509_add1_ext_i2d;
++		PKCS7_SIGNER_INFO_it;
++		KRB5_PRINCNAME_new;
++		PKCS12_SAFEBAG_it;
++		EC_GROUP_get_order;
++		d2i_OCSP_RESPID;
++		OCSP_request_verify;
++		NCONF_get_number_e;
++		_ossl_old_des_decrypt3;
++		X509_signature_print;
++		OCSP_SINGLERESP_free;
++		ENGINE_load_builtin_engines;
++		i2d_OCSP_ONEREQ;
++		OCSP_REQUEST_add_ext;
++		OCSP_RESPBYTES_new;
++		EVP_MD_CTX_create;
++		OCSP_resp_find_status;
++		X509_ALGOR_it;
++		ASN1_TIME_it;
++		OCSP_request_set1_name;
++		OCSP_ONEREQ_get_ext_count;
++		UI_get0_result;
++		PKCS12_AUTHSAFES_it;
++		EVP_aes_256_ecb;
++		PKCS12_pack_authsafes;
++		ASN1_IA5STRING_it;
++		UI_get_input_flags;
++		EC_GROUP_set_generator;
++		_ossl_old_des_string_to_2keys;
++		OCSP_CERTID_free;
++		X509_CERT_AUX_it;
++		CERTIFICATEPOLICIES_it;
++		_ossl_old_des_ede3_cbc_encrypt;
++		RAND_set_rand_engine;
++		DSO_get_loaded_filename;
++		X509_ATTRIBUTE_it;
++		OCSP_ONEREQ_get_ext_by_NID;
++		PKCS12_decrypt_skey;
++		KRB5_AUTHENT_it;
++		UI_dup_error_string;
++		RSAPublicKey_it;
++		i2d_OCSP_REQUEST;
++		PKCS12_x509crl2certbag;
++		OCSP_SERVICELOC_it;
++		ASN1_item_sign;
++		X509_CRL_set_issuer_name;
++		OBJ_NAME_do_all_sorted;
++		i2d_OCSP_BASICRESP;
++		i2d_OCSP_RESPBYTES;
++		PKCS12_unpack_p7encdata;
++		HMAC_CTX_init;
++		ENGINE_get_digest;
++		OCSP_RESPONSE_print;
++		KRB5_TKTBODY_it;
++		ACCESS_DESCRIPTION_it;
++		PKCS7_ISSUER_AND_SERIAL_it;
++		PBE2PARAM_it;
++		PKCS12_certbag2x509crl;
++		PKCS7_SIGNED_it;
++		ENGINE_get_cipher;
++		i2d_OCSP_CRLID;
++		OCSP_SINGLERESP_new;
++		ENGINE_cmd_is_executable;
++		RSA_up_ref;
++		ASN1_GENERALSTRING_it;
++		ENGINE_register_DSA;
++		X509V3_EXT_add_nconf_sk;
++		ENGINE_set_load_pubkey_function;
++		PKCS8_decrypt;
++		PEM_bytes_read_bio;
++		DIRECTORYSTRING_it;
++		d2i_OCSP_CRLID;
++		EC_POINT_is_on_curve;
++		CRYPTO_set_locked_mem_ex_functions;
++		CRYPTO_set_locked_mem_ex_funcs;
++		d2i_KRB5_CHECKSUM;
++		ASN1_item_dup;
++		X509_it;
++		BN_mod_add;
++		KRB5_AUTHDATA_free;
++		_ossl_old_des_cbc_cksum;
++		ASN1_item_verify;
++		CRYPTO_set_mem_ex_functions;
++		EC_POINT_get_Jprojective_coordinates_GFp;
++		EC_POINT_get_Jproj_coords_GFp;
++		ZLONG_it;
++		CRYPTO_get_locked_mem_ex_functions;
++		CRYPTO_get_locked_mem_ex_funcs;
++		ASN1_TIME_check;
++		UI_get0_user_data;
++		HMAC_CTX_cleanup;
++		DSA_up_ref;
++		_ossl_old_des_ede3_cfb64_encrypt;
++		_ossl_odes_ede3_cfb64_encrypt;
++		ASN1_BMPSTRING_it;
++		ASN1_tag2bit;
++		UI_method_set_flusher;
++		X509_ocspid_print;
++		KRB5_ENCDATA_it;
++		ENGINE_get_load_pubkey_function;
++		UI_add_user_data;
++		OCSP_REQUEST_delete_ext;
++		UI_get_method;
++		OCSP_ONEREQ_free;
++		ASN1_PRINTABLESTRING_it;
++		X509_CRL_set_nextUpdate;
++		OCSP_REQUEST_it;
++		OCSP_BASICRESP_it;
++		AES_ecb_encrypt;
++		BN_mod_sqr;
++		NETSCAPE_CERT_SEQUENCE_it;
++		GENERAL_NAMES_it;
++		AUTHORITY_INFO_ACCESS_it;
++		ASN1_FBOOLEAN_it;
++		UI_set_ex_data;
++		_ossl_old_des_string_to_key;
++		ENGINE_register_all_RSA;
++		d2i_KRB5_PRINCNAME;
++		OCSP_RESPBYTES_it;
++		X509_CINF_it;
++		ENGINE_unregister_digests;
++		d2i_EDIPARTYNAME;
++		d2i_OCSP_SERVICELOC;
++		ENGINE_get_digests;
++		_ossl_old_des_set_odd_parity;
++		OCSP_RESPDATA_free;
++		d2i_KRB5_TICKET;
++		OTHERNAME_it;
++		EVP_MD_CTX_cleanup;
++		d2i_ASN1_GENERALSTRING;
++		X509_CRL_set_version;
++		BN_mod_sub;
++		OCSP_SINGLERESP_get_ext_by_NID;
++		ENGINE_get_ex_new_index;
++		OCSP_REQUEST_free;
++		OCSP_REQUEST_add1_ext_i2d;
++		X509_VAL_it;
++		EC_POINTs_make_affine;
++		EC_POINT_mul;
++		X509V3_EXT_add_nconf;
++		X509_TRUST_set;
++		X509_CRL_add1_ext_i2d;
++		_ossl_old_des_fcrypt;
++		DISPLAYTEXT_it;
++		X509_CRL_set_lastUpdate;
++		OCSP_BASICRESP_free;
++		OCSP_BASICRESP_add1_ext_i2d;
++		d2i_KRB5_AUTHENTBODY;
++		CRYPTO_set_ex_data_implementation;
++		CRYPTO_set_ex_data_impl;
++		KRB5_ENCDATA_new;
++		DSO_up_ref;
++		OCSP_crl_reason_str;
++		UI_get0_result_string;
++		ASN1_GENERALSTRING_new;
++		X509_SIG_it;
++		ERR_set_implementation;
++		ERR_load_EC_strings;
++		UI_get0_action_string;
++		OCSP_ONEREQ_get_ext;
++		EC_POINT_method_of;
++		i2d_KRB5_APREQBODY;
++		_ossl_old_des_ecb3_encrypt;
++		CRYPTO_get_mem_ex_functions;
++		ENGINE_get_ex_data;
++		UI_destroy_method;
++		ASN1_item_i2d_bio;
++		OCSP_ONEREQ_get_ext_by_OBJ;
++		ASN1_primitive_new;
++		ASN1_PRINTABLE_it;
++		EVP_aes_192_ecb;
++		OCSP_SIGNATURE_new;
++		LONG_it;
++		ASN1_VISIBLESTRING_it;
++		OCSP_SINGLERESP_add1_ext_i2d;
++		d2i_OCSP_CERTID;
++		ASN1_item_d2i_fp;
++		CRL_DIST_POINTS_it;
++		GENERAL_NAME_print;
++		OCSP_SINGLERESP_delete_ext;
++		PKCS12_SAFEBAGS_it;
++		d2i_OCSP_SIGNATURE;
++		OCSP_request_add1_nonce;
++		ENGINE_set_cmd_defns;
++		OCSP_SERVICELOC_free;
++		EC_GROUP_free;
++		ASN1_BIT_STRING_it;
++		X509_REQ_it;
++		_ossl_old_des_cbc_encrypt;
++		ERR_unload_strings;
++		PKCS7_SIGN_ENVELOPE_it;
++		EDIPARTYNAME_free;
++		OCSP_REQINFO_free;
++		EC_GROUP_new_curve_GFp;
++		OCSP_REQUEST_get1_ext_d2i;
++		PKCS12_item_pack_safebag;
++		asn1_ex_c2i;
++		ENGINE_register_digests;
++		i2d_OCSP_REVOKEDINFO;
++		asn1_enc_restore;
++		UI_free;
++		UI_new_method;
++		EVP_EncryptInit_ex;
++		X509_pubkey_digest;
++		EC_POINT_invert;
++		OCSP_basic_sign;
++		i2d_OCSP_RESPID;
++		OCSP_check_nonce;
++		ENGINE_ctrl_cmd;
++		d2i_KRB5_ENCKEY;
++		OCSP_parse_url;
++		OCSP_SINGLERESP_get_ext;
++		OCSP_CRLID_free;
++		OCSP_BASICRESP_get1_ext_d2i;
++		RSAPrivateKey_it;
++		ENGINE_register_all_DH;
++		i2d_EDIPARTYNAME;
++		EC_POINT_get_affine_coordinates_GFp;
++		EC_POINT_get_affine_coords_GFp;
++		OCSP_CRLID_new;
++		ENGINE_get_flags;
++		OCSP_ONEREQ_it;
++		UI_process;
++		ASN1_INTEGER_it;
++		EVP_CipherInit_ex;
++		UI_get_string_type;
++		ENGINE_unregister_DH;
++		ENGINE_register_all_DSA;
++		OCSP_ONEREQ_get_ext_by_critical;
++		bn_dup_expand;
++		OCSP_cert_id_new;
++		BASIC_CONSTRAINTS_it;
++		BN_mod_add_quick;
++		EC_POINT_new;
++		EVP_MD_CTX_destroy;
++		OCSP_RESPBYTES_free;
++		EVP_aes_128_cbc;
++		OCSP_SINGLERESP_get1_ext_d2i;
++		EC_POINT_free;
++		DH_up_ref;
++		X509_NAME_ENTRY_it;
++		UI_get_ex_new_index;
++		BN_mod_sub_quick;
++		OCSP_ONEREQ_add_ext;
++		OCSP_request_sign;
++		EVP_DigestFinal_ex;
++		ENGINE_set_digests;
++		OCSP_id_issuer_cmp;
++		OBJ_NAME_do_all;
++		EC_POINTs_mul;
++		ENGINE_register_complete;
++		X509V3_EXT_nconf_nid;
++		ASN1_SEQUENCE_it;
++		UI_set_default_method;
++		RAND_query_egd_bytes;
++		UI_method_get_writer;
++		UI_OpenSSL;
++		PEM_def_callback;
++		ENGINE_cleanup;
++		DIST_POINT_it;
++		OCSP_SINGLERESP_it;
++		d2i_KRB5_TKTBODY;
++		EC_POINT_cmp;
++		OCSP_REVOKEDINFO_new;
++		i2d_OCSP_CERTSTATUS;
++		OCSP_basic_add1_nonce;
++		ASN1_item_ex_d2i;
++		BN_mod_lshift1_quick;
++		UI_set_method;
++		OCSP_id_get0_info;
++		BN_mod_sqrt;
++		EC_GROUP_copy;
++		KRB5_ENCDATA_free;
++		_ossl_old_des_cfb_encrypt;
++		OCSP_SINGLERESP_get_ext_by_OBJ;
++		OCSP_cert_to_id;
++		OCSP_RESPID_new;
++		OCSP_RESPDATA_it;
++		d2i_OCSP_RESPDATA;
++		ENGINE_register_all_complete;
++		OCSP_check_validity;
++		PKCS12_BAGS_it;
++		OCSP_url_svcloc_new;
++		ASN1_template_free;
++		OCSP_SINGLERESP_add_ext;
++		KRB5_AUTHENTBODY_it;
++		X509_supported_extension;
++		i2d_KRB5_AUTHDATA;
++		UI_method_get_opener;
++		ENGINE_set_ex_data;
++		OCSP_REQUEST_print;
++		CBIGNUM_it;
++		KRB5_TICKET_new;
++		KRB5_APREQ_new;
++		EC_GROUP_get_curve_GFp;
++		KRB5_ENCKEY_new;
++		ASN1_template_d2i;
++		_ossl_old_des_quad_cksum;
++		OCSP_single_get0_status;
++		BN_swap;
++		POLICYINFO_it;
++		ENGINE_set_destroy_function;
++		asn1_enc_free;
++		OCSP_RESPID_it;
++		EC_GROUP_new;
++		EVP_aes_256_cbc;
++		i2d_KRB5_PRINCNAME;
++		_ossl_old_des_encrypt2;
++		_ossl_old_des_encrypt3;
++		PKCS8_PRIV_KEY_INFO_it;
++		OCSP_REQINFO_it;
++		PBEPARAM_it;
++		KRB5_AUTHENTBODY_new;
++		X509_CRL_add0_revoked;
++		EDIPARTYNAME_it;
++		NETSCAPE_SPKI_it;
++		UI_get0_test_string;
++		ENGINE_get_cipher_engine;
++		ENGINE_register_all_ciphers;
++		EC_POINT_copy;
++		BN_kronecker;
++		_ossl_old_des_ede3_ofb64_encrypt;
++		_ossl_odes_ede3_ofb64_encrypt;
++		UI_method_get_reader;
++		OCSP_BASICRESP_get_ext_count;
++		ASN1_ENUMERATED_it;
++		UI_set_result;
++		i2d_KRB5_TICKET;
++		X509_print_ex_fp;
++		EVP_CIPHER_CTX_set_padding;
++		d2i_OCSP_RESPONSE;
++		ASN1_UTCTIME_it;
++		_ossl_old_des_enc_write;
++		OCSP_RESPONSE_new;
++		AES_set_encrypt_key;
++		OCSP_resp_count;
++		KRB5_CHECKSUM_new;
++		ENGINE_load_cswift;
++		OCSP_onereq_get0_id;
++		ENGINE_set_default_ciphers;
++		NOTICEREF_it;
++		X509V3_EXT_CRL_add_nconf;
++		OCSP_REVOKEDINFO_it;
++		AES_encrypt;
++		OCSP_REQUEST_new;
++		ASN1_ANY_it;
++		CRYPTO_ex_data_new_class;
++		_ossl_old_des_ncbc_encrypt;
++		i2d_KRB5_TKTBODY;
++		EC_POINT_clear_free;
++		AES_decrypt;
++		asn1_enc_init;
++		UI_get_result_maxsize;
++		OCSP_CERTID_new;
++		ENGINE_unregister_RAND;
++		UI_method_get_closer;
++		d2i_KRB5_ENCDATA;
++		OCSP_request_onereq_count;
++		OCSP_basic_verify;
++		KRB5_AUTHENTBODY_free;
++		ASN1_item_d2i;
++		ASN1_primitive_free;
++		i2d_EXTENDED_KEY_USAGE;
++		i2d_OCSP_SIGNATURE;
++		asn1_enc_save;
++		ENGINE_load_nuron;
++		_ossl_old_des_pcbc_encrypt;
++		PKCS12_MAC_DATA_it;
++		OCSP_accept_responses_new;
++		asn1_do_lock;
++		PKCS7_ATTR_VERIFY_it;
++		KRB5_APREQBODY_it;
++		i2d_OCSP_SINGLERESP;
++		ASN1_item_ex_new;
++		UI_add_verify_string;
++		_ossl_old_des_set_key;
++		KRB5_PRINCNAME_it;
++		EVP_DecryptInit_ex;
++		i2d_OCSP_CERTID;
++		ASN1_item_d2i_bio;
++		EC_POINT_dbl;
++		asn1_get_choice_selector;
++		i2d_KRB5_CHECKSUM;
++		ENGINE_set_table_flags;
++		AES_options;
++		ENGINE_load_chil;
++		OCSP_id_cmp;
++		OCSP_BASICRESP_new;
++		OCSP_REQUEST_get_ext_by_NID;
++		KRB5_APREQ_it;
++		ENGINE_get_destroy_function;
++		CONF_set_nconf;
++		ASN1_PRINTABLE_free;
++		OCSP_BASICRESP_get_ext_by_NID;
++		DIST_POINT_NAME_it;
++		X509V3_extensions_print;
++		_ossl_old_des_cfb64_encrypt;
++		X509_REVOKED_add1_ext_i2d;
++		_ossl_old_des_ofb_encrypt;
++		KRB5_TKTBODY_new;
++		ASN1_OCTET_STRING_it;
++		ERR_load_UI_strings;
++		i2d_KRB5_ENCKEY;
++		ASN1_template_new;
++		OCSP_SIGNATURE_free;
++		ASN1_item_i2d_fp;
++		KRB5_PRINCNAME_free;
++		PKCS7_RECIP_INFO_it;
++		EXTENDED_KEY_USAGE_it;
++		EC_GFp_simple_method;
++		EC_GROUP_precompute_mult;
++		OCSP_request_onereq_get0;
++		UI_method_set_writer;
++		KRB5_AUTHENT_new;
++		X509_CRL_INFO_it;
++		DSO_set_name_converter;
++		AES_set_decrypt_key;
++		PKCS7_DIGEST_it;
++		PKCS12_x5092certbag;
++		EVP_DigestInit_ex;
++		i2a_ACCESS_DESCRIPTION;
++		OCSP_RESPONSE_it;
++		PKCS7_ENC_CONTENT_it;
++		OCSP_request_add0_id;
++		EC_POINT_make_affine;
++		DSO_get_filename;
++		OCSP_CERTSTATUS_it;
++		OCSP_request_add1_cert;
++		UI_get0_output_string;
++		UI_dup_verify_string;
++		BN_mod_lshift;
++		KRB5_AUTHDATA_it;
++		asn1_set_choice_selector;
++		OCSP_basic_add1_status;
++		OCSP_RESPID_free;
++		asn1_get_field_ptr;
++		UI_add_input_string;
++		OCSP_CRLID_it;
++		i2d_KRB5_AUTHENTBODY;
++		OCSP_REQUEST_get_ext_count;
++		ENGINE_load_atalla;
++		X509_NAME_it;
++		USERNOTICE_it;
++		OCSP_REQINFO_new;
++		OCSP_BASICRESP_get_ext;
++		CRYPTO_get_ex_data_implementation;
++		CRYPTO_get_ex_data_impl;
++		ASN1_item_pack;
++		i2d_KRB5_ENCDATA;
++		X509_PURPOSE_set;
++		X509_REQ_INFO_it;
++		UI_method_set_opener;
++		ASN1_item_ex_free;
++		ASN1_BOOLEAN_it;
++		ENGINE_get_table_flags;
++		UI_create_method;
++		OCSP_ONEREQ_add1_ext_i2d;
++		_shadow_DES_check_key;
++		d2i_OCSP_REQINFO;
++		UI_add_info_string;
++		UI_get_result_minsize;
++		ASN1_NULL_it;
++		BN_mod_lshift1;
++		d2i_OCSP_ONEREQ;
++		OCSP_ONEREQ_new;
++		KRB5_TICKET_it;
++		EVP_aes_192_cbc;
++		KRB5_TICKET_free;
++		UI_new;
++		OCSP_response_create;
++		_ossl_old_des_xcbc_encrypt;
++		PKCS7_it;
++		OCSP_REQUEST_get_ext_by_critical;
++		OCSP_REQUEST_get_ext_by_crit;
++		ENGINE_set_flags;
++		_ossl_old_des_ecb_encrypt;
++		OCSP_response_get1_basic;
++		EVP_Digest;
++		OCSP_ONEREQ_delete_ext;
++		ASN1_TBOOLEAN_it;
++		ASN1_item_new;
++		ASN1_TIME_to_generalizedtime;
++		BIGNUM_it;
++		AES_cbc_encrypt;
++		ENGINE_get_load_privkey_function;
++		ENGINE_get_load_privkey_fn;
++		OCSP_RESPONSE_free;
++		UI_method_set_reader;
++		i2d_ASN1_T61STRING;
++		EC_POINT_set_to_infinity;
++		ERR_load_OCSP_strings;
++		EC_POINT_point2oct;
++		KRB5_APREQ_free;
++		ASN1_OBJECT_it;
++		OCSP_crlID_new;
++		OCSP_crlID2_new;
++		CONF_modules_load_file;
++		CONF_imodule_set_usr_data;
++		ENGINE_set_default_string;
++		CONF_module_get_usr_data;
++		ASN1_add_oid_module;
++		CONF_modules_finish;
++		OPENSSL_config;
++		CONF_modules_unload;
++		CONF_imodule_get_value;
++		CONF_module_set_usr_data;
++		CONF_parse_list;
++		CONF_module_add;
++		CONF_get1_default_config_file;
++		CONF_imodule_get_flags;
++		CONF_imodule_get_module;
++		CONF_modules_load;
++		CONF_imodule_get_name;
++		ERR_peek_top_error;
++		CONF_imodule_get_usr_data;
++		CONF_imodule_set_flags;
++		ENGINE_add_conf_module;
++		ERR_peek_last_error_line;
++		ERR_peek_last_error_line_data;
++		ERR_peek_last_error;
++		DES_read_2passwords;
++		DES_read_password;
++		UI_UTIL_read_pw;
++		UI_UTIL_read_pw_string;
++		ENGINE_load_aep;
++		ENGINE_load_sureware;
++		OPENSSL_add_all_algorithms_noconf;
++		OPENSSL_add_all_algo_noconf;
++		OPENSSL_add_all_algorithms_conf;
++		OPENSSL_add_all_algo_conf;
++		OPENSSL_load_builtin_modules;
++		AES_ofb128_encrypt;
++		AES_ctr128_encrypt;
++		AES_cfb128_encrypt;
++		ENGINE_load_4758cca;
++		_ossl_096_des_random_seed;
++		EVP_aes_256_ofb;
++		EVP_aes_192_ofb;
++		EVP_aes_128_cfb128;
++		EVP_aes_256_cfb128;
++		EVP_aes_128_ofb;
++		EVP_aes_192_cfb128;
++		CONF_modules_free;
++		NCONF_default;
++		OPENSSL_no_config;
++		NCONF_WIN32;
++		ASN1_UNIVERSALSTRING_new;
++		EVP_des_ede_ecb;
++		i2d_ASN1_UNIVERSALSTRING;
++		ASN1_UNIVERSALSTRING_free;
++		ASN1_UNIVERSALSTRING_it;
++		d2i_ASN1_UNIVERSALSTRING;
++		EVP_des_ede3_ecb;
++		X509_REQ_print_ex;
++		ENGINE_up_ref;
++		BUF_MEM_grow_clean;
++		CRYPTO_realloc_clean;
++		BUF_strlcat;
++		BIO_indent;
++		BUF_strlcpy;
++		OpenSSLDie;
++		OPENSSL_cleanse;
++		ENGINE_setup_bsd_cryptodev;
++		ERR_release_err_state_table;
++		EVP_aes_128_cfb8;
++		FIPS_corrupt_rsa;
++		FIPS_selftest_des;
++		EVP_aes_128_cfb1;
++		EVP_aes_192_cfb8;
++		FIPS_mode_set;
++		FIPS_selftest_dsa;
++		EVP_aes_256_cfb8;
++		FIPS_allow_md5;
++		DES_ede3_cfb_encrypt;
++		EVP_des_ede3_cfb8;
++		FIPS_rand_seeded;
++		AES_cfbr_encrypt_block;
++		AES_cfb8_encrypt;
++		FIPS_rand_seed;
++		FIPS_corrupt_des;
++		EVP_aes_192_cfb1;
++		FIPS_selftest_aes;
++		FIPS_set_prng_key;
++		EVP_des_cfb8;
++		FIPS_corrupt_dsa;
++		FIPS_test_mode;
++		FIPS_rand_method;
++		EVP_aes_256_cfb1;
++		ERR_load_FIPS_strings;
++		FIPS_corrupt_aes;
++		FIPS_selftest_sha1;
++		FIPS_selftest_rsa;
++		FIPS_corrupt_sha1;
++		EVP_des_cfb1;
++		FIPS_dsa_check;
++		AES_cfb1_encrypt;
++		EVP_des_ede3_cfb1;
++		FIPS_rand_check;
++		FIPS_md5_allowed;
++		FIPS_mode;
++		FIPS_selftest_failed;
++		sk_is_sorted;
++		X509_check_ca;
++		HMAC_CTX_set_flags;
++		d2i_PROXY_CERT_INFO_EXTENSION;
++		PROXY_POLICY_it;
++		i2d_PROXY_POLICY;
++		i2d_PROXY_CERT_INFO_EXTENSION;
++		d2i_PROXY_POLICY;
++		PROXY_CERT_INFO_EXTENSION_new;
++		PROXY_CERT_INFO_EXTENSION_free;
++		PROXY_CERT_INFO_EXTENSION_it;
++		PROXY_POLICY_free;
++		PROXY_POLICY_new;
++		BN_MONT_CTX_set_locked;
++		FIPS_selftest_rng;
++		EVP_sha384;
++		EVP_sha512;
++		EVP_sha224;
++		EVP_sha256;
++		FIPS_selftest_hmac;
++		FIPS_corrupt_rng;
++		BN_mod_exp_mont_consttime;
++		RSA_X931_hash_id;
++		RSA_padding_check_X931;
++		RSA_verify_PKCS1_PSS;
++		RSA_padding_add_X931;
++		RSA_padding_add_PKCS1_PSS;
++		PKCS1_MGF1;
++		BN_X931_generate_Xpq;
++		RSA_X931_generate_key;
++		BN_X931_derive_prime;
++		BN_X931_generate_prime;
++		RSA_X931_derive;
++		BIO_new_dgram;
++		BN_get0_nist_prime_384;
++		ERR_set_mark;
++		X509_STORE_CTX_set0_crls;
++		ENGINE_set_STORE;
++		ENGINE_register_ECDSA;
++		STORE_meth_set_list_start_fn;
++		STORE_method_set_list_start_function;
++		BN_BLINDING_invert_ex;
++		NAME_CONSTRAINTS_free;
++		STORE_ATTR_INFO_set_number;
++		BN_BLINDING_get_thread_id;
++		X509_STORE_CTX_set0_param;
++		POLICY_MAPPING_it;
++		STORE_parse_attrs_start;
++		POLICY_CONSTRAINTS_free;
++		EVP_PKEY_add1_attr_by_NID;
++		BN_nist_mod_192;
++		EC_GROUP_get_trinomial_basis;
++		STORE_set_method;
++		GENERAL_SUBTREE_free;
++		NAME_CONSTRAINTS_it;
++		ECDH_get_default_method;
++		PKCS12_add_safe;
++		EC_KEY_new_by_curve_name;
++		STORE_meth_get_update_store_fn;
++		STORE_method_get_update_store_function;
++		ENGINE_register_ECDH;
++		SHA512_Update;
++		i2d_ECPrivateKey;
++		BN_get0_nist_prime_192;
++		STORE_modify_certificate;
++		EC_POINT_set_affine_coordinates_GF2m;
++		EC_POINT_set_affine_coords_GF2m;
++		BN_GF2m_mod_exp_arr;
++		STORE_ATTR_INFO_modify_number;
++		X509_keyid_get0;
++		ENGINE_load_gmp;
++		pitem_new;
++		BN_GF2m_mod_mul_arr;
++		STORE_list_public_key_endp;
++		o2i_ECPublicKey;
++		EC_KEY_copy;
++		BIO_dump_fp;
++		X509_policy_node_get0_parent;
++		EC_GROUP_check_discriminant;
++		i2o_ECPublicKey;
++		EC_KEY_precompute_mult;
++		a2i_IPADDRESS;
++		STORE_meth_set_initialise_fn;
++		STORE_method_set_initialise_function;
++		X509_STORE_CTX_set_depth;
++		X509_VERIFY_PARAM_inherit;
++		EC_POINT_point2bn;
++		STORE_ATTR_INFO_set_dn;
++		X509_policy_tree_get0_policies;
++		EC_GROUP_new_curve_GF2m;
++		STORE_destroy_method;
++		ENGINE_unregister_STORE;
++		EVP_PKEY_get1_EC_KEY;
++		STORE_ATTR_INFO_get0_number;
++		ENGINE_get_default_ECDH;
++		EC_KEY_get_conv_form;
++		ASN1_OCTET_STRING_NDEF_it;
++		STORE_delete_public_key;
++		STORE_get_public_key;
++		STORE_modify_arbitrary;
++		ENGINE_get_static_state;
++		pqueue_iterator;
++		ECDSA_SIG_new;
++		OPENSSL_DIR_end;
++		BN_GF2m_mod_sqr;
++		EC_POINT_bn2point;
++		X509_VERIFY_PARAM_set_depth;
++		EC_KEY_set_asn1_flag;
++		STORE_get_method;
++		EC_KEY_get_key_method_data;
++		ECDSA_sign_ex;
++		STORE_parse_attrs_end;
++		EC_GROUP_get_point_conversion_form;
++		EC_GROUP_get_point_conv_form;
++		STORE_method_set_store_function;
++		STORE_ATTR_INFO_in;
++		PEM_read_bio_ECPKParameters;
++		EC_GROUP_get_pentanomial_basis;
++		EVP_PKEY_add1_attr_by_txt;
++		BN_BLINDING_set_flags;
++		X509_VERIFY_PARAM_set1_policies;
++		X509_VERIFY_PARAM_set1_name;
++		X509_VERIFY_PARAM_set_purpose;
++		STORE_get_number;
++		ECDSA_sign_setup;
++		BN_GF2m_mod_solve_quad_arr;
++		EC_KEY_up_ref;
++		POLICY_MAPPING_free;
++		BN_GF2m_mod_div;
++		X509_VERIFY_PARAM_set_flags;
++		EC_KEY_free;
++		STORE_meth_set_list_next_fn;
++		STORE_method_set_list_next_function;
++		PEM_write_bio_ECPrivateKey;
++		d2i_EC_PUBKEY;
++		STORE_meth_get_generate_fn;
++		STORE_method_get_generate_function;
++		STORE_meth_set_list_end_fn;
++		STORE_method_set_list_end_function;
++		pqueue_print;
++		EC_GROUP_have_precompute_mult;
++		EC_KEY_print_fp;
++		BN_GF2m_mod_arr;
++		PEM_write_bio_X509_CERT_PAIR;
++		EVP_PKEY_cmp;
++		X509_policy_level_node_count;
++		STORE_new_engine;
++		STORE_list_public_key_start;
++		X509_VERIFY_PARAM_new;
++		ECDH_get_ex_data;
++		EVP_PKEY_get_attr;
++		ECDSA_do_sign;
++		ENGINE_unregister_ECDH;
++		ECDH_OpenSSL;
++		EC_KEY_set_conv_form;
++		EC_POINT_dup;
++		GENERAL_SUBTREE_new;
++		STORE_list_crl_endp;
++		EC_get_builtin_curves;
++		X509_policy_node_get0_qualifiers;
++		X509_pcy_node_get0_qualifiers;
++		STORE_list_crl_end;
++		EVP_PKEY_set1_EC_KEY;
++		BN_GF2m_mod_sqrt_arr;
++		i2d_ECPrivateKey_bio;
++		ECPKParameters_print_fp;
++		pqueue_find;
++		ECDSA_SIG_free;
++		PEM_write_bio_ECPKParameters;
++		STORE_method_set_ctrl_function;
++		STORE_list_public_key_end;
++		EC_KEY_set_private_key;
++		pqueue_peek;
++		STORE_get_arbitrary;
++		STORE_store_crl;
++		X509_policy_node_get0_policy;
++		PKCS12_add_safes;
++		BN_BLINDING_convert_ex;
++		X509_policy_tree_free;
++		OPENSSL_ia32cap_loc;
++		BN_GF2m_poly2arr;
++		STORE_ctrl;
++		STORE_ATTR_INFO_compare;
++		BN_get0_nist_prime_224;
++		i2d_ECParameters;
++		i2d_ECPKParameters;
++		BN_GENCB_call;
++		d2i_ECPKParameters;
++		STORE_meth_set_generate_fn;
++		STORE_method_set_generate_function;
++		ENGINE_set_ECDH;
++		NAME_CONSTRAINTS_new;
++		SHA256_Init;
++		EC_KEY_get0_public_key;
++		PEM_write_bio_EC_PUBKEY;
++		STORE_ATTR_INFO_set_cstr;
++		STORE_list_crl_next;
++		STORE_ATTR_INFO_in_range;
++		ECParameters_print;
++		STORE_meth_set_delete_fn;
++		STORE_method_set_delete_function;
++		STORE_list_certificate_next;
++		ASN1_generate_nconf;
++		BUF_memdup;
++		BN_GF2m_mod_mul;
++		STORE_meth_get_list_next_fn;
++		STORE_method_get_list_next_function;
++		STORE_ATTR_INFO_get0_dn;
++		STORE_list_private_key_next;
++		EC_GROUP_set_seed;
++		X509_VERIFY_PARAM_set_trust;
++		STORE_ATTR_INFO_free;
++		STORE_get_private_key;
++		EVP_PKEY_get_attr_count;
++		STORE_ATTR_INFO_new;
++		EC_GROUP_get_curve_GF2m;
++		STORE_meth_set_revoke_fn;
++		STORE_method_set_revoke_function;
++		STORE_store_number;
++		BN_is_prime_ex;
++		STORE_revoke_public_key;
++		X509_STORE_CTX_get0_param;
++		STORE_delete_arbitrary;
++		PEM_read_X509_CERT_PAIR;
++		X509_STORE_set_depth;
++		ECDSA_get_ex_data;
++		SHA224;
++		BIO_dump_indent_fp;
++		EC_KEY_set_group;
++		BUF_strndup;
++		STORE_list_certificate_start;
++		BN_GF2m_mod;
++		X509_REQ_check_private_key;
++		EC_GROUP_get_seed_len;
++		ERR_load_STORE_strings;
++		PEM_read_bio_EC_PUBKEY;
++		STORE_list_private_key_end;
++		i2d_EC_PUBKEY;
++		ECDSA_get_default_method;
++		ASN1_put_eoc;
++		X509_STORE_CTX_get_explicit_policy;
++		X509_STORE_CTX_get_expl_policy;
++		X509_VERIFY_PARAM_table_cleanup;
++		STORE_modify_private_key;
++		X509_VERIFY_PARAM_free;
++		EC_METHOD_get_field_type;
++		EC_GFp_nist_method;
++		STORE_meth_set_modify_fn;
++		STORE_method_set_modify_function;
++		STORE_parse_attrs_next;
++		ENGINE_load_padlock;
++		EC_GROUP_set_curve_name;
++		X509_CERT_PAIR_it;
++		STORE_meth_get_revoke_fn;
++		STORE_method_get_revoke_function;
++		STORE_method_set_get_function;
++		STORE_modify_number;
++		STORE_method_get_store_function;
++		STORE_store_private_key;
++		BN_GF2m_mod_sqr_arr;
++		RSA_setup_blinding;
++		BIO_s_datagram;
++		STORE_Memory;
++		sk_find_ex;
++		EC_GROUP_set_curve_GF2m;
++		ENGINE_set_default_ECDSA;
++		POLICY_CONSTRAINTS_new;
++		BN_GF2m_mod_sqrt;
++		ECDH_set_default_method;
++		EC_KEY_generate_key;
++		SHA384_Update;
++		BN_GF2m_arr2poly;
++		STORE_method_get_get_function;
++		STORE_meth_set_cleanup_fn;
++		STORE_method_set_cleanup_function;
++		EC_GROUP_check;
++		d2i_ECPrivateKey_bio;
++		EC_KEY_insert_key_method_data;
++		STORE_meth_get_lock_store_fn;
++		STORE_method_get_lock_store_function;
++		X509_VERIFY_PARAM_get_depth;
++		SHA224_Final;
++		STORE_meth_set_update_store_fn;
++		STORE_method_set_update_store_function;
++		SHA224_Update;
++		d2i_ECPrivateKey;
++		ASN1_item_ndef_i2d;
++		STORE_delete_private_key;
++		ERR_pop_to_mark;
++		ENGINE_register_all_STORE;
++		X509_policy_level_get0_node;
++		i2d_PKCS7_NDEF;
++		EC_GROUP_get_degree;
++		ASN1_generate_v3;
++		STORE_ATTR_INFO_modify_cstr;
++		X509_policy_tree_level_count;
++		BN_GF2m_add;
++		EC_KEY_get0_group;
++		STORE_generate_crl;
++		STORE_store_public_key;
++		X509_CERT_PAIR_free;
++		STORE_revoke_private_key;
++		BN_nist_mod_224;
++		SHA512_Final;
++		STORE_ATTR_INFO_modify_dn;
++		STORE_meth_get_initialise_fn;
++		STORE_method_get_initialise_function;
++		STORE_delete_number;
++		i2d_EC_PUBKEY_bio;
++		BIO_dgram_non_fatal_error;
++		EC_GROUP_get_asn1_flag;
++		STORE_ATTR_INFO_in_ex;
++		STORE_list_crl_start;
++		ECDH_get_ex_new_index;
++		STORE_meth_get_modify_fn;
++		STORE_method_get_modify_function;
++		v2i_ASN1_BIT_STRING;
++		STORE_store_certificate;
++		OBJ_bsearch_ex;
++		X509_STORE_CTX_set_default;
++		STORE_ATTR_INFO_set_sha1str;
++		BN_GF2m_mod_inv;
++		BN_GF2m_mod_exp;
++		STORE_modify_public_key;
++		STORE_meth_get_list_start_fn;
++		STORE_method_get_list_start_function;
++		EC_GROUP_get0_seed;
++		STORE_store_arbitrary;
++		STORE_meth_set_unlock_store_fn;
++		STORE_method_set_unlock_store_function;
++		BN_GF2m_mod_div_arr;
++		ENGINE_set_ECDSA;
++		STORE_create_method;
++		ECPKParameters_print;
++		EC_KEY_get0_private_key;
++		PEM_write_EC_PUBKEY;
++		X509_VERIFY_PARAM_set1;
++		ECDH_set_method;
++		v2i_GENERAL_NAME_ex;
++		ECDH_set_ex_data;
++		STORE_generate_key;
++		BN_nist_mod_521;
++		X509_policy_tree_get0_level;
++		EC_GROUP_set_point_conversion_form;
++		EC_GROUP_set_point_conv_form;
++		PEM_read_EC_PUBKEY;
++		i2d_ECDSA_SIG;
++		ECDSA_OpenSSL;
++		STORE_delete_crl;
++		EC_KEY_get_enc_flags;
++		ASN1_const_check_infinite_end;
++		EVP_PKEY_delete_attr;
++		ECDSA_set_default_method;
++		EC_POINT_set_compressed_coordinates_GF2m;
++		EC_POINT_set_compr_coords_GF2m;
++		EC_GROUP_cmp;
++		STORE_revoke_certificate;
++		BN_get0_nist_prime_256;
++		STORE_meth_get_delete_fn;
++		STORE_method_get_delete_function;
++		SHA224_Init;
++		PEM_read_ECPrivateKey;
++		SHA512_Init;
++		STORE_parse_attrs_endp;
++		BN_set_negative;
++		ERR_load_ECDSA_strings;
++		EC_GROUP_get_basis_type;
++		STORE_list_public_key_next;
++		i2v_ASN1_BIT_STRING;
++		STORE_OBJECT_free;
++		BN_nist_mod_384;
++		i2d_X509_CERT_PAIR;
++		PEM_write_ECPKParameters;
++		ECDH_compute_key;
++		STORE_ATTR_INFO_get0_sha1str;
++		ENGINE_register_all_ECDH;
++		pqueue_pop;
++		STORE_ATTR_INFO_get0_cstr;
++		POLICY_CONSTRAINTS_it;
++		STORE_get_ex_new_index;
++		EVP_PKEY_get_attr_by_OBJ;
++		X509_VERIFY_PARAM_add0_policy;
++		BN_GF2m_mod_solve_quad;
++		SHA256;
++		i2d_ECPrivateKey_fp;
++		X509_policy_tree_get0_user_policies;
++		X509_pcy_tree_get0_usr_policies;
++		OPENSSL_DIR_read;
++		ENGINE_register_all_ECDSA;
++		X509_VERIFY_PARAM_lookup;
++		EC_POINT_get_affine_coordinates_GF2m;
++		EC_POINT_get_affine_coords_GF2m;
++		EC_GROUP_dup;
++		ENGINE_get_default_ECDSA;
++		EC_KEY_new;
++		SHA256_Transform;
++		EC_KEY_set_enc_flags;
++		ECDSA_verify;
++		EC_POINT_point2hex;
++		ENGINE_get_STORE;
++		SHA512;
++		STORE_get_certificate;
++		ECDSA_do_sign_ex;
++		ECDSA_do_verify;
++		d2i_ECPrivateKey_fp;
++		STORE_delete_certificate;
++		SHA512_Transform;
++		X509_STORE_set1_param;
++		STORE_method_get_ctrl_function;
++		STORE_free;
++		PEM_write_ECPrivateKey;
++		STORE_meth_get_unlock_store_fn;
++		STORE_method_get_unlock_store_function;
++		STORE_get_ex_data;
++		EC_KEY_set_public_key;
++		PEM_read_ECPKParameters;
++		X509_CERT_PAIR_new;
++		ENGINE_register_STORE;
++		RSA_generate_key_ex;
++		DSA_generate_parameters_ex;
++		ECParameters_print_fp;
++		X509V3_NAME_from_section;
++		EVP_PKEY_add1_attr;
++		STORE_modify_crl;
++		STORE_list_private_key_start;
++		POLICY_MAPPINGS_it;
++		GENERAL_SUBTREE_it;
++		EC_GROUP_get_curve_name;
++		PEM_write_X509_CERT_PAIR;
++		BIO_dump_indent_cb;
++		d2i_X509_CERT_PAIR;
++		STORE_list_private_key_endp;
++		asn1_const_Finish;
++		i2d_EC_PUBKEY_fp;
++		BN_nist_mod_256;
++		X509_VERIFY_PARAM_add0_table;
++		pqueue_free;
++		BN_BLINDING_create_param;
++		ECDSA_size;
++		d2i_EC_PUBKEY_bio;
++		BN_get0_nist_prime_521;
++		STORE_ATTR_INFO_modify_sha1str;
++		BN_generate_prime_ex;
++		EC_GROUP_new_by_curve_name;
++		SHA256_Final;
++		DH_generate_parameters_ex;
++		PEM_read_bio_ECPrivateKey;
++		STORE_meth_get_cleanup_fn;
++		STORE_method_get_cleanup_function;
++		ENGINE_get_ECDH;
++		d2i_ECDSA_SIG;
++		BN_is_prime_fasttest_ex;
++		ECDSA_sign;
++		X509_policy_check;
++		EVP_PKEY_get_attr_by_NID;
++		STORE_set_ex_data;
++		ENGINE_get_ECDSA;
++		EVP_ecdsa;
++		BN_BLINDING_get_flags;
++		PKCS12_add_cert;
++		STORE_OBJECT_new;
++		ERR_load_ECDH_strings;
++		EC_KEY_dup;
++		EVP_CIPHER_CTX_rand_key;
++		ECDSA_set_method;
++		a2i_IPADDRESS_NC;
++		d2i_ECParameters;
++		STORE_list_certificate_end;
++		STORE_get_crl;
++		X509_POLICY_NODE_print;
++		SHA384_Init;
++		EC_GF2m_simple_method;
++		ECDSA_set_ex_data;
++		SHA384_Final;
++		PKCS7_set_digest;
++		EC_KEY_print;
++		STORE_meth_set_lock_store_fn;
++		STORE_method_set_lock_store_function;
++		ECDSA_get_ex_new_index;
++		SHA384;
++		POLICY_MAPPING_new;
++		STORE_list_certificate_endp;
++		X509_STORE_CTX_get0_policy_tree;
++		EC_GROUP_set_asn1_flag;
++		EC_KEY_check_key;
++		d2i_EC_PUBKEY_fp;
++		PKCS7_set0_type_other;
++		PEM_read_bio_X509_CERT_PAIR;
++		pqueue_next;
++		STORE_meth_get_list_end_fn;
++		STORE_method_get_list_end_function;
++		EVP_PKEY_add1_attr_by_OBJ;
++		X509_VERIFY_PARAM_set_time;
++		pqueue_new;
++		ENGINE_set_default_ECDH;
++		STORE_new_method;
++		PKCS12_add_key;
++		DSO_merge;
++		EC_POINT_hex2point;
++		BIO_dump_cb;
++		SHA256_Update;
++		pqueue_insert;
++		pitem_free;
++		BN_GF2m_mod_inv_arr;
++		ENGINE_unregister_ECDSA;
++		BN_BLINDING_set_thread_id;
++		get_rfc3526_prime_8192;
++		X509_VERIFY_PARAM_clear_flags;
++		get_rfc2409_prime_1024;
++		DH_check_pub_key;
++		get_rfc3526_prime_2048;
++		get_rfc3526_prime_6144;
++		get_rfc3526_prime_1536;
++		get_rfc3526_prime_3072;
++		get_rfc3526_prime_4096;
++		get_rfc2409_prime_768;
++		X509_VERIFY_PARAM_get_flags;
++		EVP_CIPHER_CTX_new;
++		EVP_CIPHER_CTX_free;
++		Camellia_cbc_encrypt;
++		Camellia_cfb128_encrypt;
++		Camellia_cfb1_encrypt;
++		Camellia_cfb8_encrypt;
++		Camellia_ctr128_encrypt;
++		Camellia_cfbr_encrypt_block;
++		Camellia_decrypt;
++		Camellia_ecb_encrypt;
++		Camellia_encrypt;
++		Camellia_ofb128_encrypt;
++		Camellia_set_key;
++		EVP_camellia_128_cbc;
++		EVP_camellia_128_cfb128;
++		EVP_camellia_128_cfb1;
++		EVP_camellia_128_cfb8;
++		EVP_camellia_128_ecb;
++		EVP_camellia_128_ofb;
++		EVP_camellia_192_cbc;
++		EVP_camellia_192_cfb128;
++		EVP_camellia_192_cfb1;
++		EVP_camellia_192_cfb8;
++		EVP_camellia_192_ecb;
++		EVP_camellia_192_ofb;
++		EVP_camellia_256_cbc;
++		EVP_camellia_256_cfb128;
++		EVP_camellia_256_cfb1;
++		EVP_camellia_256_cfb8;
++		EVP_camellia_256_ecb;
++		EVP_camellia_256_ofb;
++		a2i_ipadd;
++		ASIdentifiers_free;
++		i2d_ASIdOrRange;
++		EVP_CIPHER_block_size;
++		v3_asid_is_canonical;
++		IPAddressChoice_free;
++		EVP_CIPHER_CTX_set_app_data;
++		BIO_set_callback_arg;
++		v3_addr_add_prefix;
++		IPAddressOrRange_it;
++		BIO_set_flags;
++		ASIdentifiers_it;
++		v3_addr_get_range;
++		BIO_method_type;
++		v3_addr_inherits;
++		IPAddressChoice_it;
++		AES_ige_encrypt;
++		v3_addr_add_range;
++		EVP_CIPHER_CTX_nid;
++		d2i_ASRange;
++		v3_addr_add_inherit;
++		v3_asid_add_id_or_range;
++		v3_addr_validate_resource_set;
++		EVP_CIPHER_iv_length;
++		EVP_MD_type;
++		v3_asid_canonize;
++		IPAddressRange_free;
++		v3_asid_add_inherit;
++		EVP_CIPHER_CTX_key_length;
++		IPAddressRange_new;
++		ASIdOrRange_new;
++		EVP_MD_size;
++		EVP_MD_CTX_test_flags;
++		BIO_clear_flags;
++		i2d_ASRange;
++		IPAddressRange_it;
++		IPAddressChoice_new;
++		ASIdentifierChoice_new;
++		ASRange_free;
++		EVP_MD_pkey_type;
++		EVP_MD_CTX_clear_flags;
++		IPAddressFamily_free;
++		i2d_IPAddressFamily;
++		IPAddressOrRange_new;
++		EVP_CIPHER_flags;
++		v3_asid_validate_resource_set;
++		d2i_IPAddressRange;
++		AES_bi_ige_encrypt;
++		BIO_get_callback;
++		IPAddressOrRange_free;
++		v3_addr_subset;
++		d2i_IPAddressFamily;
++		v3_asid_subset;
++		BIO_test_flags;
++		i2d_ASIdentifierChoice;
++		ASRange_it;
++		d2i_ASIdentifiers;
++		ASRange_new;
++		d2i_IPAddressChoice;
++		v3_addr_get_afi;
++		EVP_CIPHER_key_length;
++		EVP_Cipher;
++		i2d_IPAddressOrRange;
++		ASIdOrRange_it;
++		EVP_CIPHER_nid;
++		i2d_IPAddressChoice;
++		EVP_CIPHER_CTX_block_size;
++		ASIdentifiers_new;
++		v3_addr_validate_path;
++		IPAddressFamily_new;
++		EVP_MD_CTX_set_flags;
++		v3_addr_is_canonical;
++		i2d_IPAddressRange;
++		IPAddressFamily_it;
++		v3_asid_inherits;
++		EVP_CIPHER_CTX_cipher;
++		EVP_CIPHER_CTX_get_app_data;
++		EVP_MD_block_size;
++		EVP_CIPHER_CTX_flags;
++		v3_asid_validate_path;
++		d2i_IPAddressOrRange;
++		v3_addr_canonize;
++		ASIdentifierChoice_it;
++		EVP_MD_CTX_md;
++		d2i_ASIdentifierChoice;
++		BIO_method_name;
++		EVP_CIPHER_CTX_iv_length;
++		ASIdOrRange_free;
++		ASIdentifierChoice_free;
++		BIO_get_callback_arg;
++		BIO_set_callback;
++		d2i_ASIdOrRange;
++		i2d_ASIdentifiers;
++		SEED_decrypt;
++		SEED_encrypt;
++		SEED_cbc_encrypt;
++		EVP_seed_ofb;
++		SEED_cfb128_encrypt;
++		SEED_ofb128_encrypt;
++		EVP_seed_cbc;
++		SEED_ecb_encrypt;
++		EVP_seed_ecb;
++		SEED_set_key;
++		EVP_seed_cfb128;
++		X509_EXTENSIONS_it;
++		X509_get1_ocsp;
++		OCSP_REQ_CTX_free;
++		i2d_X509_EXTENSIONS;
++		OCSP_sendreq_nbio;
++		OCSP_sendreq_new;
++		d2i_X509_EXTENSIONS;
++		X509_ALGORS_it;
++		X509_ALGOR_get0;
++		X509_ALGOR_set0;
++		AES_unwrap_key;
++		AES_wrap_key;
++		X509at_get0_data_by_OBJ;
++		ASN1_TYPE_set1;
++		ASN1_STRING_set0;
++		i2d_X509_ALGORS;
++		BIO_f_zlib;
++		COMP_zlib_cleanup;
++		d2i_X509_ALGORS;
++		CMS_ReceiptRequest_free;
++		PEM_write_CMS;
++		CMS_add0_CertificateChoices;
++		CMS_unsigned_add1_attr_by_OBJ;
++		ERR_load_CMS_strings;
++		CMS_sign_receipt;
++		i2d_CMS_ContentInfo;
++		CMS_signed_delete_attr;
++		d2i_CMS_bio;
++		CMS_unsigned_get_attr_by_NID;
++		CMS_verify;
++		SMIME_read_CMS;
++		CMS_decrypt_set1_key;
++		CMS_SignerInfo_get0_algs;
++		CMS_add1_cert;
++		CMS_set_detached;
++		CMS_encrypt;
++		CMS_EnvelopedData_create;
++		CMS_uncompress;
++		CMS_add0_crl;
++		CMS_SignerInfo_verify_content;
++		CMS_unsigned_get0_data_by_OBJ;
++		PEM_write_bio_CMS;
++		CMS_unsigned_get_attr;
++		CMS_RecipientInfo_ktri_cert_cmp;
++		CMS_RecipientInfo_ktri_get0_algs;
++		CMS_RecipInfo_ktri_get0_algs;
++		CMS_ContentInfo_free;
++		CMS_final;
++		CMS_add_simple_smimecap;
++		CMS_SignerInfo_verify;
++		CMS_data;
++		CMS_ContentInfo_it;
++		d2i_CMS_ReceiptRequest;
++		CMS_compress;
++		CMS_digest_create;
++		CMS_SignerInfo_cert_cmp;
++		CMS_SignerInfo_sign;
++		CMS_data_create;
++		i2d_CMS_bio;
++		CMS_EncryptedData_set1_key;
++		CMS_decrypt;
++		int_smime_write_ASN1;
++		CMS_unsigned_delete_attr;
++		CMS_unsigned_get_attr_count;
++		CMS_add_smimecap;
++		PEM_read_CMS;
++		CMS_signed_get_attr_by_OBJ;
++		d2i_CMS_ContentInfo;
++		CMS_add_standard_smimecap;
++		CMS_ContentInfo_new;
++		CMS_RecipientInfo_type;
++		CMS_get0_type;
++		CMS_is_detached;
++		CMS_sign;
++		CMS_signed_add1_attr;
++		CMS_unsigned_get_attr_by_OBJ;
++		SMIME_write_CMS;
++		CMS_EncryptedData_decrypt;
++		CMS_get0_RecipientInfos;
++		CMS_add0_RevocationInfoChoice;
++		CMS_decrypt_set1_pkey;
++		CMS_SignerInfo_set1_signer_cert;
++		CMS_get0_signers;
++		CMS_ReceiptRequest_get0_values;
++		CMS_signed_get0_data_by_OBJ;
++		CMS_get0_SignerInfos;
++		CMS_add0_cert;
++		CMS_EncryptedData_encrypt;
++		CMS_digest_verify;
++		CMS_set1_signers_certs;
++		CMS_signed_get_attr;
++		CMS_RecipientInfo_set0_key;
++		CMS_SignedData_init;
++		CMS_RecipientInfo_kekri_get0_id;
++		CMS_verify_receipt;
++		CMS_ReceiptRequest_it;
++		PEM_read_bio_CMS;
++		CMS_get1_crls;
++		CMS_add0_recipient_key;
++		SMIME_read_ASN1;
++		CMS_ReceiptRequest_new;
++		CMS_get0_content;
++		CMS_get1_ReceiptRequest;
++		CMS_signed_add1_attr_by_OBJ;
++		CMS_RecipientInfo_kekri_id_cmp;
++		CMS_add1_ReceiptRequest;
++		CMS_SignerInfo_get0_signer_id;
++		CMS_unsigned_add1_attr_by_NID;
++		CMS_unsigned_add1_attr;
++		CMS_signed_get_attr_by_NID;
++		CMS_get1_certs;
++		CMS_signed_add1_attr_by_NID;
++		CMS_unsigned_add1_attr_by_txt;
++		CMS_dataFinal;
++		CMS_RecipientInfo_ktri_get0_signer_id;
++		CMS_RecipInfo_ktri_get0_sigr_id;
++		i2d_CMS_ReceiptRequest;
++		CMS_add1_recipient_cert;
++		CMS_dataInit;
++		CMS_signed_add1_attr_by_txt;
++		CMS_RecipientInfo_decrypt;
++		CMS_signed_get_attr_count;
++		CMS_get0_eContentType;
++		CMS_set1_eContentType;
++		CMS_ReceiptRequest_create0;
++		CMS_add1_signer;
++		CMS_RecipientInfo_set0_pkey;
++		ENGINE_set_load_ssl_client_cert_function;
++		ENGINE_set_ld_ssl_clnt_cert_fn;
++		ENGINE_get_ssl_client_cert_function;
++		ENGINE_get_ssl_client_cert_fn;
++		ENGINE_load_ssl_client_cert;
++		ENGINE_load_capi;
++		OPENSSL_isservice;
++		FIPS_dsa_sig_decode;
++		EVP_CIPHER_CTX_clear_flags;
++		FIPS_rand_status;
++		FIPS_rand_set_key;
++		CRYPTO_set_mem_info_functions;
++		RSA_X931_generate_key_ex;
++		int_ERR_set_state_func;
++		int_EVP_MD_set_engine_callbacks;
++		int_CRYPTO_set_do_dynlock_callback;
++		FIPS_rng_stick;
++		EVP_CIPHER_CTX_set_flags;
++		BN_X931_generate_prime_ex;
++		FIPS_selftest_check;
++		FIPS_rand_set_dt;
++		CRYPTO_dbg_pop_info;
++		FIPS_dsa_free;
++		RSA_X931_derive_ex;
++		FIPS_rsa_new;
++		FIPS_rand_bytes;
++		fips_cipher_test;
++		EVP_CIPHER_CTX_test_flags;
++		CRYPTO_malloc_debug_init;
++		CRYPTO_dbg_push_info;
++		FIPS_corrupt_rsa_keygen;
++		FIPS_dh_new;
++		FIPS_corrupt_dsa_keygen;
++		FIPS_dh_free;
++		fips_pkey_signature_test;
++		EVP_add_alg_module;
++		int_RAND_init_engine_callbacks;
++		int_EVP_CIPHER_set_engine_callbacks;
++		int_EVP_MD_init_engine_callbacks;
++		FIPS_rand_test_mode;
++		FIPS_rand_reset;
++		FIPS_dsa_new;
++		int_RAND_set_callbacks;
++		BN_X931_derive_prime_ex;
++		int_ERR_lib_init;
++		int_EVP_CIPHER_init_engine_callbacks;
++		FIPS_rsa_free;
++		FIPS_dsa_sig_encode;
++		CRYPTO_dbg_remove_all_info;
++		OPENSSL_init;
++		CRYPTO_strdup;
++		JPAKE_STEP3A_process;
++		JPAKE_STEP1_release;
++		JPAKE_get_shared_key;
++		JPAKE_STEP3B_init;
++		JPAKE_STEP1_generate;
++		JPAKE_STEP1_init;
++		JPAKE_STEP3B_process;
++		JPAKE_STEP2_generate;
++		JPAKE_CTX_new;
++		JPAKE_CTX_free;
++		JPAKE_STEP3B_release;
++		JPAKE_STEP3A_release;
++		JPAKE_STEP2_process;
++		JPAKE_STEP3B_generate;
++		JPAKE_STEP1_process;
++		JPAKE_STEP3A_generate;
++		JPAKE_STEP2_release;
++		JPAKE_STEP3A_init;
++		ERR_load_JPAKE_strings;
++		JPAKE_STEP2_init;
++		pqueue_size;
++		i2d_TS_ACCURACY;
++		i2d_TS_MSG_IMPRINT_fp;
++		i2d_TS_MSG_IMPRINT;
++		EVP_PKEY_print_public;
++		EVP_PKEY_CTX_new;
++		i2d_TS_TST_INFO;
++		EVP_PKEY_asn1_find;
++		DSO_METHOD_beos;
++		TS_CONF_load_cert;
++		TS_REQ_get_ext;
++		EVP_PKEY_sign_init;
++		ASN1_item_print;
++		TS_TST_INFO_set_nonce;
++		TS_RESP_dup;
++		ENGINE_register_pkey_meths;
++		EVP_PKEY_asn1_add0;
++		PKCS7_add0_attrib_signing_time;
++		i2d_TS_TST_INFO_fp;
++		BIO_asn1_get_prefix;
++		TS_TST_INFO_set_time;
++		EVP_PKEY_meth_set_decrypt;
++		EVP_PKEY_set_type_str;
++		EVP_PKEY_CTX_get_keygen_info;
++		TS_REQ_set_policy_id;
++		d2i_TS_RESP_fp;
++		ENGINE_get_pkey_asn1_meth_engine;
++		ENGINE_get_pkey_asn1_meth_eng;
++		WHIRLPOOL_Init;
++		TS_RESP_set_status_info;
++		EVP_PKEY_keygen;
++		EVP_DigestSignInit;
++		TS_ACCURACY_set_millis;
++		TS_REQ_dup;
++		GENERAL_NAME_dup;
++		ASN1_SEQUENCE_ANY_it;
++		WHIRLPOOL;
++		X509_STORE_get1_crls;
++		ENGINE_get_pkey_asn1_meth;
++		EVP_PKEY_asn1_new;
++		BIO_new_NDEF;
++		ENGINE_get_pkey_meth;
++		TS_MSG_IMPRINT_set_algo;
++		i2d_TS_TST_INFO_bio;
++		TS_TST_INFO_set_ordering;
++		TS_TST_INFO_get_ext_by_OBJ;
++		CRYPTO_THREADID_set_pointer;
++		TS_CONF_get_tsa_section;
++		SMIME_write_ASN1;
++		TS_RESP_CTX_set_signer_key;
++		EVP_PKEY_encrypt_old;
++		EVP_PKEY_encrypt_init;
++		CRYPTO_THREADID_cpy;
++		ASN1_PCTX_get_cert_flags;
++		i2d_ESS_SIGNING_CERT;
++		TS_CONF_load_key;
++		i2d_ASN1_SEQUENCE_ANY;
++		d2i_TS_MSG_IMPRINT_bio;
++		EVP_PKEY_asn1_set_public;
++		b2i_PublicKey_bio;
++		BIO_asn1_set_prefix;
++		EVP_PKEY_new_mac_key;
++		BIO_new_CMS;
++		CRYPTO_THREADID_cmp;
++		TS_REQ_ext_free;
++		EVP_PKEY_asn1_set_free;
++		EVP_PKEY_get0_asn1;
++		d2i_NETSCAPE_X509;
++		EVP_PKEY_verify_recover_init;
++		EVP_PKEY_CTX_set_data;
++		EVP_PKEY_keygen_init;
++		TS_RESP_CTX_set_status_info;
++		TS_MSG_IMPRINT_get_algo;
++		TS_REQ_print_bio;
++		EVP_PKEY_CTX_ctrl_str;
++		EVP_PKEY_get_default_digest_nid;
++		PEM_write_bio_PKCS7_stream;
++		TS_MSG_IMPRINT_print_bio;
++		BN_asc2bn;
++		TS_REQ_get_policy_id;
++		ENGINE_set_default_pkey_asn1_meths;
++		ENGINE_set_def_pkey_asn1_meths;
++		d2i_TS_ACCURACY;
++		DSO_global_lookup;
++		TS_CONF_set_tsa_name;
++		i2d_ASN1_SET_ANY;
++		ENGINE_load_gost;
++		WHIRLPOOL_BitUpdate;
++		ASN1_PCTX_get_flags;
++		TS_TST_INFO_get_ext_by_NID;
++		TS_RESP_new;
++		ESS_CERT_ID_dup;
++		TS_STATUS_INFO_dup;
++		TS_REQ_delete_ext;
++		EVP_DigestVerifyFinal;
++		EVP_PKEY_print_params;
++		i2d_CMS_bio_stream;
++		TS_REQ_get_msg_imprint;
++		OBJ_find_sigid_by_algs;
++		TS_TST_INFO_get_serial;
++		TS_REQ_get_nonce;
++		X509_PUBKEY_set0_param;
++		EVP_PKEY_CTX_set0_keygen_info;
++		DIST_POINT_set_dpname;
++		i2d_ISSUING_DIST_POINT;
++		ASN1_SET_ANY_it;
++		EVP_PKEY_CTX_get_data;
++		TS_STATUS_INFO_print_bio;
++		EVP_PKEY_derive_init;
++		d2i_TS_TST_INFO;
++		EVP_PKEY_asn1_add_alias;
++		d2i_TS_RESP_bio;
++		OTHERNAME_cmp;
++		GENERAL_NAME_set0_value;
++		PKCS7_RECIP_INFO_get0_alg;
++		TS_RESP_CTX_new;
++		TS_RESP_set_tst_info;
++		PKCS7_final;
++		EVP_PKEY_base_id;
++		TS_RESP_CTX_set_signer_cert;
++		TS_REQ_set_msg_imprint;
++		EVP_PKEY_CTX_ctrl;
++		TS_CONF_set_digests;
++		d2i_TS_MSG_IMPRINT;
++		EVP_PKEY_meth_set_ctrl;
++		TS_REQ_get_ext_by_NID;
++		PKCS5_pbe_set0_algor;
++		BN_BLINDING_thread_id;
++		TS_ACCURACY_new;
++		X509_CRL_METHOD_free;
++		ASN1_PCTX_get_nm_flags;
++		EVP_PKEY_meth_set_sign;
++		CRYPTO_THREADID_current;
++		EVP_PKEY_decrypt_init;
++		NETSCAPE_X509_free;
++		i2b_PVK_bio;
++		EVP_PKEY_print_private;
++		GENERAL_NAME_get0_value;
++		b2i_PVK_bio;
++		ASN1_UTCTIME_adj;
++		TS_TST_INFO_new;
++		EVP_MD_do_all_sorted;
++		TS_CONF_set_default_engine;
++		TS_ACCURACY_set_seconds;
++		TS_TST_INFO_get_time;
++		PKCS8_pkey_get0;
++		EVP_PKEY_asn1_get0;
++		OBJ_add_sigid;
++		PKCS7_SIGNER_INFO_sign;
++		EVP_PKEY_paramgen_init;
++		EVP_PKEY_sign;
++		OBJ_sigid_free;
++		EVP_PKEY_meth_set_init;
++		d2i_ESS_ISSUER_SERIAL;
++		ISSUING_DIST_POINT_new;
++		ASN1_TIME_adj;
++		TS_OBJ_print_bio;
++		EVP_PKEY_meth_set_verify_recover;
++		EVP_PKEY_meth_set_vrfy_recover;
++		TS_RESP_get_status_info;
++		CMS_stream;
++		EVP_PKEY_CTX_set_cb;
++		PKCS7_to_TS_TST_INFO;
++		ASN1_PCTX_get_oid_flags;
++		TS_TST_INFO_add_ext;
++		EVP_PKEY_meth_set_derive;
++		i2d_TS_RESP_fp;
++		i2d_TS_MSG_IMPRINT_bio;
++		TS_RESP_CTX_set_accuracy;
++		TS_REQ_set_nonce;
++		ESS_CERT_ID_new;
++		ENGINE_pkey_asn1_find_str;
++		TS_REQ_get_ext_count;
++		BUF_reverse;
++		TS_TST_INFO_print_bio;
++		d2i_ISSUING_DIST_POINT;
++		ENGINE_get_pkey_meths;
++		i2b_PrivateKey_bio;
++		i2d_TS_RESP;
++		b2i_PublicKey;
++		TS_VERIFY_CTX_cleanup;
++		TS_STATUS_INFO_free;
++		TS_RESP_verify_token;
++		OBJ_bsearch_ex_;
++		ASN1_bn_print;
++		EVP_PKEY_asn1_get_count;
++		ENGINE_register_pkey_asn1_meths;
++		ASN1_PCTX_set_nm_flags;
++		EVP_DigestVerifyInit;
++		ENGINE_set_default_pkey_meths;
++		TS_TST_INFO_get_policy_id;
++		TS_REQ_get_cert_req;
++		X509_CRL_set_meth_data;
++		PKCS8_pkey_set0;
++		ASN1_STRING_copy;
++		d2i_TS_TST_INFO_fp;
++		X509_CRL_match;
++		EVP_PKEY_asn1_set_private;
++		TS_TST_INFO_get_ext_d2i;
++		TS_RESP_CTX_add_policy;
++		d2i_TS_RESP;
++		TS_CONF_load_certs;
++		TS_TST_INFO_get_msg_imprint;
++		ERR_load_TS_strings;
++		TS_TST_INFO_get_version;
++		EVP_PKEY_CTX_dup;
++		EVP_PKEY_meth_set_verify;
++		i2b_PublicKey_bio;
++		TS_CONF_set_certs;
++		EVP_PKEY_asn1_get0_info;
++		TS_VERIFY_CTX_free;
++		TS_REQ_get_ext_by_critical;
++		TS_RESP_CTX_set_serial_cb;
++		X509_CRL_get_meth_data;
++		TS_RESP_CTX_set_time_cb;
++		TS_MSG_IMPRINT_get_msg;
++		TS_TST_INFO_ext_free;
++		TS_REQ_get_version;
++		TS_REQ_add_ext;
++		EVP_PKEY_CTX_set_app_data;
++		OBJ_bsearch_;
++		EVP_PKEY_meth_set_verifyctx;
++		i2d_PKCS7_bio_stream;
++		CRYPTO_THREADID_set_numeric;
++		PKCS7_sign_add_signer;
++		d2i_TS_TST_INFO_bio;
++		TS_TST_INFO_get_ordering;
++		TS_RESP_print_bio;
++		TS_TST_INFO_get_exts;
++		HMAC_CTX_copy;
++		PKCS5_pbe2_set_iv;
++		ENGINE_get_pkey_asn1_meths;
++		b2i_PrivateKey;
++		EVP_PKEY_CTX_get_app_data;
++		TS_REQ_set_cert_req;
++		CRYPTO_THREADID_set_callback;
++		TS_CONF_set_serial;
++		TS_TST_INFO_free;
++		d2i_TS_REQ_fp;
++		TS_RESP_verify_response;
++		i2d_ESS_ISSUER_SERIAL;
++		TS_ACCURACY_get_seconds;
++		EVP_CIPHER_do_all;
++		b2i_PrivateKey_bio;
++		OCSP_CERTID_dup;
++		X509_PUBKEY_get0_param;
++		TS_MSG_IMPRINT_dup;
++		PKCS7_print_ctx;
++		i2d_TS_REQ_bio;
++		EVP_whirlpool;
++		EVP_PKEY_asn1_set_param;
++		EVP_PKEY_meth_set_encrypt;
++		ASN1_PCTX_set_flags;
++		i2d_ESS_CERT_ID;
++		TS_VERIFY_CTX_new;
++		TS_RESP_CTX_set_extension_cb;
++		ENGINE_register_all_pkey_meths;
++		TS_RESP_CTX_set_status_info_cond;
++		TS_RESP_CTX_set_stat_info_cond;
++		EVP_PKEY_verify;
++		WHIRLPOOL_Final;
++		X509_CRL_METHOD_new;
++		EVP_DigestSignFinal;
++		TS_RESP_CTX_set_def_policy;
++		NETSCAPE_X509_it;
++		TS_RESP_create_response;
++		PKCS7_SIGNER_INFO_get0_algs;
++		TS_TST_INFO_get_nonce;
++		EVP_PKEY_decrypt_old;
++		TS_TST_INFO_set_policy_id;
++		TS_CONF_set_ess_cert_id_chain;
++		EVP_PKEY_CTX_get0_pkey;
++		d2i_TS_REQ;
++		EVP_PKEY_asn1_find_str;
++		BIO_f_asn1;
++		ESS_SIGNING_CERT_new;
++		EVP_PBE_find;
++		X509_CRL_get0_by_cert;
++		EVP_PKEY_derive;
++		i2d_TS_REQ;
++		TS_TST_INFO_delete_ext;
++		ESS_ISSUER_SERIAL_free;
++		ASN1_PCTX_set_str_flags;
++		ENGINE_get_pkey_asn1_meth_str;
++		TS_CONF_set_signer_key;
++		TS_ACCURACY_get_millis;
++		TS_RESP_get_token;
++		TS_ACCURACY_dup;
++		ENGINE_register_all_pkey_asn1_meths;
++		ENGINE_reg_all_pkey_asn1_meths;
++		X509_CRL_set_default_method;
++		CRYPTO_THREADID_hash;
++		CMS_ContentInfo_print_ctx;
++		TS_RESP_free;
++		ISSUING_DIST_POINT_free;
++		ESS_ISSUER_SERIAL_new;
++		CMS_add1_crl;
++		PKCS7_add1_attrib_digest;
++		TS_RESP_CTX_add_md;
++		TS_TST_INFO_dup;
++		ENGINE_set_pkey_asn1_meths;
++		PEM_write_bio_Parameters;
++		TS_TST_INFO_get_accuracy;
++		X509_CRL_get0_by_serial;
++		TS_TST_INFO_set_version;
++		TS_RESP_CTX_get_tst_info;
++		TS_RESP_verify_signature;
++		CRYPTO_THREADID_get_callback;
++		TS_TST_INFO_get_tsa;
++		TS_STATUS_INFO_new;
++		EVP_PKEY_CTX_get_cb;
++		TS_REQ_get_ext_d2i;
++		GENERAL_NAME_set0_othername;
++		TS_TST_INFO_get_ext_count;
++		TS_RESP_CTX_get_request;
++		i2d_NETSCAPE_X509;
++		ENGINE_get_pkey_meth_engine;
++		EVP_PKEY_meth_set_signctx;
++		EVP_PKEY_asn1_copy;
++		ASN1_TYPE_cmp;
++		EVP_CIPHER_do_all_sorted;
++		EVP_PKEY_CTX_free;
++		ISSUING_DIST_POINT_it;
++		d2i_TS_MSG_IMPRINT_fp;
++		X509_STORE_get1_certs;
++		EVP_PKEY_CTX_get_operation;
++		d2i_ESS_SIGNING_CERT;
++		TS_CONF_set_ordering;
++		EVP_PBE_alg_add_type;
++		TS_REQ_set_version;
++		EVP_PKEY_get0;
++		BIO_asn1_set_suffix;
++		i2d_TS_STATUS_INFO;
++		EVP_MD_do_all;
++		TS_TST_INFO_set_accuracy;
++		PKCS7_add_attrib_content_type;
++		ERR_remove_thread_state;
++		EVP_PKEY_meth_add0;
++		TS_TST_INFO_set_tsa;
++		EVP_PKEY_meth_new;
++		WHIRLPOOL_Update;
++		TS_CONF_set_accuracy;
++		ASN1_PCTX_set_oid_flags;
++		ESS_SIGNING_CERT_dup;
++		d2i_TS_REQ_bio;
++		X509_time_adj_ex;
++		TS_RESP_CTX_add_flags;
++		d2i_TS_STATUS_INFO;
++		TS_MSG_IMPRINT_set_msg;
++		BIO_asn1_get_suffix;
++		TS_REQ_free;
++		EVP_PKEY_meth_free;
++		TS_REQ_get_exts;
++		TS_RESP_CTX_set_clock_precision_digits;
++		TS_RESP_CTX_set_clk_prec_digits;
++		TS_RESP_CTX_add_failure_info;
++		i2d_TS_RESP_bio;
++		EVP_PKEY_CTX_get0_peerkey;
++		PEM_write_bio_CMS_stream;
++		TS_REQ_new;
++		TS_MSG_IMPRINT_new;
++		EVP_PKEY_meth_find;
++		EVP_PKEY_id;
++		TS_TST_INFO_set_serial;
++		a2i_GENERAL_NAME;
++		TS_CONF_set_crypto_device;
++		EVP_PKEY_verify_init;
++		TS_CONF_set_policies;
++		ASN1_PCTX_new;
++		ESS_CERT_ID_free;
++		ENGINE_unregister_pkey_meths;
++		TS_MSG_IMPRINT_free;
++		TS_VERIFY_CTX_init;
++		PKCS7_stream;
++		TS_RESP_CTX_set_certs;
++		TS_CONF_set_def_policy;
++		ASN1_GENERALIZEDTIME_adj;
++		NETSCAPE_X509_new;
++		TS_ACCURACY_free;
++		TS_RESP_get_tst_info;
++		EVP_PKEY_derive_set_peer;
++		PEM_read_bio_Parameters;
++		TS_CONF_set_clock_precision_digits;
++		TS_CONF_set_clk_prec_digits;
++		ESS_ISSUER_SERIAL_dup;
++		TS_ACCURACY_get_micros;
++		ASN1_PCTX_get_str_flags;
++		NAME_CONSTRAINTS_check;
++		ASN1_BIT_STRING_check;
++		X509_check_akid;
++		ENGINE_unregister_pkey_asn1_meths;
++		ENGINE_unreg_pkey_asn1_meths;
++		ASN1_PCTX_free;
++		PEM_write_bio_ASN1_stream;
++		i2d_ASN1_bio_stream;
++		TS_X509_ALGOR_print_bio;
++		EVP_PKEY_meth_set_cleanup;
++		EVP_PKEY_asn1_free;
++		ESS_SIGNING_CERT_free;
++		TS_TST_INFO_set_msg_imprint;
++		GENERAL_NAME_cmp;
++		d2i_ASN1_SET_ANY;
++		ENGINE_set_pkey_meths;
++		i2d_TS_REQ_fp;
++		d2i_ASN1_SEQUENCE_ANY;
++		GENERAL_NAME_get0_otherName;
++		d2i_ESS_CERT_ID;
++		OBJ_find_sigid_algs;
++		EVP_PKEY_meth_set_keygen;
++		PKCS5_PBKDF2_HMAC;
++		EVP_PKEY_paramgen;
++		EVP_PKEY_meth_set_paramgen;
++		BIO_new_PKCS7;
++		EVP_PKEY_verify_recover;
++		TS_ext_print_bio;
++		TS_ASN1_INTEGER_print_bio;
++		check_defer;
++		DSO_pathbyaddr;
++		EVP_PKEY_set_type;
++		TS_ACCURACY_set_micros;
++		TS_REQ_to_TS_VERIFY_CTX;
++		EVP_PKEY_meth_set_copy;
++		ASN1_PCTX_set_cert_flags;
++		TS_TST_INFO_get_ext;
++		EVP_PKEY_asn1_set_ctrl;
++		TS_TST_INFO_get_ext_by_critical;
++		EVP_PKEY_CTX_new_id;
++		TS_REQ_get_ext_by_OBJ;
++		TS_CONF_set_signer_cert;
++		X509_NAME_hash_old;
++		ASN1_TIME_set_string;
++		EVP_MD_flags;
++		TS_RESP_CTX_free;
++		DSAparams_dup;
++		DHparams_dup;
++		OCSP_REQ_CTX_add1_header;
++		OCSP_REQ_CTX_set1_req;
++		X509_STORE_set_verify_cb;
++		X509_STORE_CTX_get0_current_crl;
++		X509_STORE_CTX_get0_parent_ctx;
++		X509_STORE_CTX_get0_current_issuer;
++		X509_STORE_CTX_get0_cur_issuer;
++		X509_issuer_name_hash_old;
++		X509_subject_name_hash_old;
++		EVP_CIPHER_CTX_copy;
++		UI_method_get_prompt_constructor;
++		UI_method_get_prompt_constructr;
++		UI_method_set_prompt_constructor;
++		UI_method_set_prompt_constructr;
++		EVP_read_pw_string_min;
++		CRYPTO_cts128_encrypt;
++		CRYPTO_cts128_decrypt_block;
++		CRYPTO_cfb128_1_encrypt;
++		CRYPTO_cbc128_encrypt;
++		CRYPTO_ctr128_encrypt;
++		CRYPTO_ofb128_encrypt;
++		CRYPTO_cts128_decrypt;
++		CRYPTO_cts128_encrypt_block;
++		CRYPTO_cbc128_decrypt;
++		CRYPTO_cfb128_encrypt;
++		CRYPTO_cfb128_8_encrypt;
++
++	local:
++		*;
++};
++
++
++OPENSSL_1.0.1 {
++	global:
++		SSL_renegotiate_abbreviated;
++		TLSv1_1_method;
++		TLSv1_1_client_method;
++		TLSv1_1_server_method;
++		SSL_CTX_set_srp_client_pwd_callback;
++		SSL_CTX_set_srp_client_pwd_cb;
++		SSL_get_srp_g;
++		SSL_CTX_set_srp_username_callback;
++		SSL_CTX_set_srp_un_cb;
++		SSL_get_srp_userinfo;
++		SSL_set_srp_server_param;
++		SSL_set_srp_server_param_pw;
++		SSL_get_srp_N;
++		SSL_get_srp_username;
++		SSL_CTX_set_srp_password;
++		SSL_CTX_set_srp_strength;
++		SSL_CTX_set_srp_verify_param_callback;
++		SSL_CTX_set_srp_vfy_param_cb;
++		SSL_CTX_set_srp_cb_arg;
++		SSL_CTX_set_srp_username;
++		SSL_CTX_SRP_CTX_init;
++		SSL_SRP_CTX_init;
++		SRP_Calc_A_param;
++		SRP_generate_server_master_secret;
++		SRP_gen_server_master_secret;
++		SSL_CTX_SRP_CTX_free;
++		SRP_generate_client_master_secret;
++		SRP_gen_client_master_secret;
++		SSL_srp_server_param_with_username;
++		SSL_srp_server_param_with_un;
++		SSL_SRP_CTX_free;
++		SSL_set_debug;
++		SSL_SESSION_get0_peer;
++		TLSv1_2_client_method;
++		SSL_SESSION_set1_id_context;
++		TLSv1_2_server_method;
++		SSL_cache_hit;
++		SSL_get0_kssl_ctx;
++		SSL_set0_kssl_ctx;
++		SSL_set_state;
++		SSL_CIPHER_get_id;
++		TLSv1_2_method;
++		kssl_ctx_get0_client_princ;
++		SSL_export_keying_material;
++		SSL_set_tlsext_use_srtp;
++		SSL_CTX_set_next_protos_advertised_cb;
++		SSL_CTX_set_next_protos_adv_cb;
++		SSL_get0_next_proto_negotiated;
++		SSL_get_selected_srtp_profile;
++		SSL_CTX_set_tlsext_use_srtp;
++		SSL_select_next_proto;
++		SSL_get_srtp_profiles;
++		SSL_CTX_set_next_proto_select_cb;
++		SSL_CTX_set_next_proto_sel_cb;
++		SSL_SESSION_get_compress_id;
++
++		SRP_VBASE_get_by_user;
++		SRP_Calc_server_key;
++		SRP_create_verifier;
++		SRP_create_verifier_BN;
++		SRP_Calc_u;
++		SRP_VBASE_free;
++		SRP_Calc_client_key;
++		SRP_get_default_gN;
++		SRP_Calc_x;
++		SRP_Calc_B;
++		SRP_VBASE_new;
++		SRP_check_known_gN_param;
++		SRP_Calc_A;
++		SRP_Verify_A_mod_N;
++		SRP_VBASE_init;
++		SRP_Verify_B_mod_N;
++		EC_KEY_set_public_key_affine_coordinates;
++		EC_KEY_set_pub_key_aff_coords;
++		EVP_aes_192_ctr;
++		EVP_PKEY_meth_get0_info;
++		EVP_PKEY_meth_copy;
++		ERR_add_error_vdata;
++		EVP_aes_128_ctr;
++		EVP_aes_256_ctr;
++		EC_GFp_nistp224_method;
++		EC_KEY_get_flags;
++		RSA_padding_add_PKCS1_PSS_mgf1;
++		EVP_aes_128_xts;
++		EVP_aes_256_xts;
++		EVP_aes_128_gcm;
++		EC_KEY_clear_flags;
++		EC_KEY_set_flags;
++		EVP_aes_256_ccm;
++		RSA_verify_PKCS1_PSS_mgf1;
++		EVP_aes_128_ccm;
++		EVP_aes_192_gcm;
++		X509_ALGOR_set_md;
++		RAND_init_fips;
++		EVP_aes_256_gcm;
++		EVP_aes_192_ccm;
++		CMAC_CTX_copy;
++		CMAC_CTX_free;
++		CMAC_CTX_get0_cipher_ctx;
++		CMAC_CTX_cleanup;
++		CMAC_Init;
++		CMAC_Update;
++		CMAC_resume;
++		CMAC_CTX_new;
++		CMAC_Final;
++		CRYPTO_ctr128_encrypt_ctr32;
++		CRYPTO_gcm128_release;
++		CRYPTO_ccm128_decrypt_ccm64;
++		CRYPTO_ccm128_encrypt;
++		CRYPTO_gcm128_encrypt;
++		CRYPTO_xts128_encrypt;
++		EVP_rc4_hmac_md5;
++		CRYPTO_nistcts128_decrypt_block;
++		CRYPTO_gcm128_setiv;
++		CRYPTO_nistcts128_encrypt;
++		EVP_aes_128_cbc_hmac_sha1;
++		CRYPTO_gcm128_tag;
++		CRYPTO_ccm128_encrypt_ccm64;
++		ENGINE_load_rdrand;
++		CRYPTO_ccm128_setiv;
++		CRYPTO_nistcts128_encrypt_block;
++		CRYPTO_gcm128_aad;
++		CRYPTO_ccm128_init;
++		CRYPTO_nistcts128_decrypt;
++		CRYPTO_gcm128_new;
++		CRYPTO_ccm128_tag;
++		CRYPTO_ccm128_decrypt;
++		CRYPTO_ccm128_aad;
++		CRYPTO_gcm128_init;
++		CRYPTO_gcm128_decrypt;
++		ENGINE_load_rsax;
++		CRYPTO_gcm128_decrypt_ctr32;
++		CRYPTO_gcm128_encrypt_ctr32;
++		CRYPTO_gcm128_finish;
++		EVP_aes_256_cbc_hmac_sha1;
++		PKCS5_pbkdf2_set;
++		CMS_add0_recipient_password;
++		CMS_decrypt_set1_password;
++		CMS_RecipientInfo_set0_password;
++		RAND_set_fips_drbg_type;
++		X509_REQ_sign_ctx;
++		RSA_PSS_PARAMS_new;
++		X509_CRL_sign_ctx;
++		X509_signature_dump;
++		d2i_RSA_PSS_PARAMS;
++		RSA_PSS_PARAMS_it;
++		RSA_PSS_PARAMS_free;
++		X509_sign_ctx;
++		i2d_RSA_PSS_PARAMS;
++		ASN1_item_sign_ctx;
++		EC_GFp_nistp521_method;
++		EC_GFp_nistp256_method;
++		OPENSSL_stderr;
++		OPENSSL_cpuid_setup;
++		OPENSSL_showfatal;
++		BIO_new_dgram_sctp;
++		BIO_dgram_sctp_msg_waiting;
++		BIO_dgram_sctp_wait_for_dry;
++		BIO_s_datagram_sctp;
++		BIO_dgram_is_sctp;
++		BIO_dgram_sctp_notification_cb;
++} OPENSSL_1.0.0;
++
++OPENSSL_1.0.1d {
++	global:
++		CRYPTO_memcmp;
++} OPENSSL_1.0.1;
++
++OPENSSL_1.0.2 {
++	global:
++		SSL_CTX_set_alpn_protos;
++		SSL_set_alpn_protos;
++		SSL_CTX_set_alpn_select_cb;
++		SSL_get0_alpn_selected;
++		SSL_CTX_set_custom_cli_ext;
++		SSL_CTX_set_custom_srv_ext;
++		SSL_CTX_set_srv_supp_data;
++		SSL_CTX_set_cli_supp_data;
++		SSL_set_cert_cb;
++		SSL_CTX_use_serverinfo;
++		SSL_CTX_use_serverinfo_file;
++		SSL_CTX_set_cert_cb;
++		SSL_CTX_get0_param;
++		SSL_get0_param;
++		SSL_certs_clear;
++		DTLSv1_2_method;
++		DTLSv1_2_server_method;
++		DTLSv1_2_client_method;
++		DTLS_method;
++		DTLS_server_method;
++		DTLS_client_method;
++		SSL_CTX_get_ssl_method;
++		SSL_CTX_get0_certificate;
++		SSL_CTX_get0_privatekey;
++		SSL_COMP_set0_compression_methods;
++		SSL_COMP_free_compression_methods;
++		SSL_CIPHER_find;
++		SSL_is_server;
++		SSL_CONF_CTX_new;
++		SSL_CONF_CTX_finish;
++		SSL_CONF_CTX_free;
++		SSL_CONF_CTX_set_flags;
++		SSL_CONF_CTX_clear_flags;
++		SSL_CONF_CTX_set1_prefix;
++		SSL_CONF_CTX_set_ssl;
++		SSL_CONF_CTX_set_ssl_ctx;
++		SSL_CONF_cmd;
++		SSL_CONF_cmd_argv;
++		SSL_CONF_cmd_value_type;
++		SSL_trace;
++		SSL_CIPHER_standard_name;
++		SSL_get_tlsa_record_byname;
++		ASN1_TIME_diff;
++		BIO_hex_string;
++		CMS_RecipientInfo_get0_pkey_ctx;
++		CMS_RecipientInfo_encrypt;
++		CMS_SignerInfo_get0_pkey_ctx;
++		CMS_SignerInfo_get0_md_ctx;
++		CMS_SignerInfo_get0_signature;
++		CMS_RecipientInfo_kari_get0_alg;
++		CMS_RecipientInfo_kari_get0_reks;
++		CMS_RecipientInfo_kari_get0_orig_id;
++		CMS_RecipientInfo_kari_orig_id_cmp;
++		CMS_RecipientEncryptedKey_get0_id;
++		CMS_RecipientEncryptedKey_cert_cmp;
++		CMS_RecipientInfo_kari_set0_pkey;
++		CMS_RecipientInfo_kari_get0_ctx;
++		CMS_RecipientInfo_kari_decrypt;
++		CMS_SharedInfo_encode;
++		DH_compute_key_padded;
++		d2i_DHxparams;
++		i2d_DHxparams;
++		DH_get_1024_160;
++		DH_get_2048_224;
++		DH_get_2048_256;
++		DH_KDF_X9_42;
++		ECDH_KDF_X9_62;
++		ECDSA_METHOD_new;
++		ECDSA_METHOD_free;
++		ECDSA_METHOD_set_app_data;
++		ECDSA_METHOD_get_app_data;
++		ECDSA_METHOD_set_sign;
++		ECDSA_METHOD_set_sign_setup;
++		ECDSA_METHOD_set_verify;
++		ECDSA_METHOD_set_flags;
++		ECDSA_METHOD_set_name;
++		EVP_des_ede3_wrap;
++		EVP_aes_128_wrap;
++		EVP_aes_192_wrap;
++		EVP_aes_256_wrap;
++		EVP_aes_128_cbc_hmac_sha256;
++		EVP_aes_256_cbc_hmac_sha256;
++		CRYPTO_128_wrap;
++		CRYPTO_128_unwrap;
++		OCSP_REQ_CTX_nbio;
++		OCSP_REQ_CTX_new;
++		OCSP_set_max_response_length;
++		OCSP_REQ_CTX_i2d;
++		OCSP_REQ_CTX_nbio_d2i;
++		OCSP_REQ_CTX_get0_mem_bio;
++		OCSP_REQ_CTX_http;
++		RSA_padding_add_PKCS1_OAEP_mgf1;
++		RSA_padding_check_PKCS1_OAEP_mgf1;
++		RSA_OAEP_PARAMS_free;
++		RSA_OAEP_PARAMS_it;
++		RSA_OAEP_PARAMS_new;
++		SSL_get_sigalgs;
++		SSL_get_shared_sigalgs;
++		SSL_check_chain;
++		X509_chain_up_ref;
++		X509_http_nbio;
++		X509_CRL_http_nbio;
++		X509_REVOKED_dup;
++		i2d_re_X509_tbs;
++		X509_get0_signature;
++		X509_get_signature_nid;
++		X509_CRL_diff;
++		X509_chain_check_suiteb;
++		X509_CRL_check_suiteb;
++		X509_check_host;
++		X509_check_email;
++		X509_check_ip;
++		X509_check_ip_asc;
++		X509_STORE_set_lookup_crls_cb;
++		X509_STORE_CTX_get0_store;
++		X509_VERIFY_PARAM_set1_host;
++		X509_VERIFY_PARAM_add1_host;
++		X509_VERIFY_PARAM_set_hostflags;
++		X509_VERIFY_PARAM_get0_peername;
++		X509_VERIFY_PARAM_set1_email;
++		X509_VERIFY_PARAM_set1_ip;
++		X509_VERIFY_PARAM_set1_ip_asc;
++		X509_VERIFY_PARAM_get0_name;
++		X509_VERIFY_PARAM_get_count;
++		X509_VERIFY_PARAM_get0;
++		X509V3_EXT_free;
++		EC_GROUP_get_mont_data;
++		EC_curve_nid2nist;
++		EC_curve_nist2nid;
++		PEM_write_bio_DHxparams;
++		PEM_write_DHxparams;
++		SSL_CTX_add_client_custom_ext;
++		SSL_CTX_add_server_custom_ext;
++		SSL_extension_supported;
++		BUF_strnlen;
++		sk_deep_copy;
++		SSL_test_functions;
++} OPENSSL_1.0.1d;
++
+Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/engines/openssl.ld
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ openssl-1.0.2~beta1.obsolete.0.0498436515490575/engines/openssl.ld	2014-02-24 21:02:30.000000000 +0100
+@@ -0,0 +1,10 @@
++OPENSSL_1.0.0 {
++	global:
++		bind_engine;
++		v_check;
++		OPENSSL_init;
++		OPENSSL_finish;
++	local:
++		*;
++};
++
+Index: openssl-1.0.2~beta1.obsolete.0.0498436515490575/engines/ccgost/openssl.ld
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ openssl-1.0.2~beta1.obsolete.0.0498436515490575/engines/ccgost/openssl.ld	2014-02-24 21:02:30.000000000 +0100
+@@ -0,0 +1,10 @@
++OPENSSL_1.0.0 {
++	global:
++		bind_engine;
++		v_check;
++		OPENSSL_init;
++		OPENSSL_finish;
++	local:
++		*;
++};
++
diff --git a/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_digicert_malaysia.patch b/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_digicert_malaysia.patch
new file mode 100644
index 0000000..c43bcd1
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_digicert_malaysia.patch
@@ -0,0 +1,29 @@
+From: Raphael Geissert <geissert@debian.org>
+Description: make X509_verify_cert indicate that any certificate whose
+ name contains "Digicert Sdn. Bhd." (from Malaysia) is revoked.
+Forwarded: not-needed
+Origin: vendor
+Last-Update: 2011-11-05
+
+Upstream-Status: Backport [debian]
+
+
+Index: openssl-1.0.2~beta1/crypto/x509/x509_vfy.c
+===================================================================
+--- openssl-1.0.2~beta1.orig/crypto/x509/x509_vfy.c	2014-02-25 00:16:12.488028844 +0100
++++ openssl-1.0.2~beta1/crypto/x509/x509_vfy.c	2014-02-25 00:16:12.484028929 +0100
+@@ -964,10 +964,11 @@
+ 	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
+ 		{
+ 		x = sk_X509_value(ctx->chain, i);
+-		/* Mark DigiNotar certificates as revoked, no matter
+-		 * where in the chain they are.
++		/* Mark certificates containing the following names as
++		 * revoked, no matter where in the chain they are.
+ 		 */
+-		if (x->name && strstr(x->name, "DigiNotar"))
++		if (x->name && (strstr(x->name, "DigiNotar") ||
++			strstr(x->name, "Digicert Sdn. Bhd.")))
+ 			{
+ 			ctx->error = X509_V_ERR_CERT_REVOKED;
+ 			ctx->error_depth = i;
diff --git a/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_diginotar.patch b/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_diginotar.patch
new file mode 100644
index 0000000..0c1a0b6
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/debian1.0.2/block_diginotar.patch
@@ -0,0 +1,67 @@
+From: Raphael Geissert <geissert@debian.org>
+Description: make X509_verify_cert indicate that any certificate whose
+ name contains "DigiNotar" is revoked.
+Forwarded: not-needed
+Origin: vendor
+Last-Update: 2011-09-08
+Bug: http://bugs.debian.org/639744
+Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
+Reviewed-by: Dr Stephen N Henson <shenson@drh-consultancy.co.uk>
+
+This is not meant as final patch.  
+ 
+Upstream-Status: Backport [debian]
+
+
+Index: openssl-1.0.2/crypto/x509/x509_vfy.c
+===================================================================
+--- openssl-1.0.2.orig/crypto/x509/x509_vfy.c
++++ openssl-1.0.2/crypto/x509/x509_vfy.c
+@@ -119,6 +119,7 @@ static int check_trust(X509_STORE_CTX *c
+ static int check_revocation(X509_STORE_CTX *ctx);
+ static int check_cert(X509_STORE_CTX *ctx);
+ static int check_policy(X509_STORE_CTX *ctx);
++static int check_ca_blacklist(X509_STORE_CTX *ctx);
+ 
+ static int get_crl_score(X509_STORE_CTX *ctx, X509 **pissuer,
+                          unsigned int *preasons, X509_CRL *crl, X509 *x);
+@@ -438,6 +439,9 @@ int X509_verify_cert(X509_STORE_CTX *ctx
+     if (!ok)
+         goto end;
+ 
++	ok = check_ca_blacklist(ctx);
++	if(!ok) goto end;
++
+ #ifndef OPENSSL_NO_RFC3779
+     /* RFC 3779 path validation, now that CRL check has been done */
+     ok = v3_asid_validate_path(ctx);
+@@ -938,6 +942,29 @@ static int check_crl_time(X509_STORE_CTX
+     return 1;
+ }
+ 
++static int check_ca_blacklist(X509_STORE_CTX *ctx)
++	{
++	X509 *x;
++	int i;
++	/* Check all certificates against the blacklist */
++	for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--)
++		{
++		x = sk_X509_value(ctx->chain, i);
++		/* Mark DigiNotar certificates as revoked, no matter
++		 * where in the chain they are.
++		 */
++		if (x->name && strstr(x->name, "DigiNotar"))
++			{
++			ctx->error = X509_V_ERR_CERT_REVOKED;
++			ctx->error_depth = i;
++			ctx->current_cert = x;
++			if (!ctx->verify_cb(0,ctx))
++				return 0;
++			}
++		}
++	return 1;
++	}
++
+ static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl,
+                       X509 **pissuer, int *pscore, unsigned int *preasons,
+                       STACK_OF(X509_CRL) *crls)
diff --git a/meta/recipes-connectivity/openssl/openssl/engines-install-in-libdir-ssl.patch b/meta/recipes-connectivity/openssl/openssl/engines-install-in-libdir-ssl.patch
new file mode 100644
index 0000000..a574648
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/engines-install-in-libdir-ssl.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Inappropriate [configuration]
+
+
+Index: openssl-1.0.2/engines/Makefile
+===================================================================
+--- openssl-1.0.2.orig/engines/Makefile
++++ openssl-1.0.2/engines/Makefile
+@@ -107,13 +107,13 @@ install:
+ 	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
+ 	@if [ -n "$(SHARED_LIBS)" ]; then \
+ 		set -e; \
+-		$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines; \
++		$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines; \
+ 		for l in $(LIBNAMES); do \
+ 			( echo installing $$l; \
+ 			  pfx=lib; \
+ 			  if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
+ 				sfx=".so"; \
+-				cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
++				cp cyg$$l.dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx.new; \
+ 			  else \
+ 				case "$(CFLAGS)" in \
+ 				*DSO_BEOS*)	sfx=".so";;	\
+@@ -122,10 +122,10 @@ install:
+ 				*DSO_WIN32*)	sfx="eay32.dll"; pfx=;;	\
+ 				*)		sfx=".bad";;	\
+ 				esac; \
+-				cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
++				cp $$pfx$$l$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx.new; \
+ 			  fi; \
+-			  chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new; \
+-			  mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$$pfx$$l$$sfx ); \
++			  chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx.new; \
++			  mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$$pfx$$l$$sfx ); \
+ 		done; \
+ 	fi
+ 	@target=install; $(RECURSIVE_MAKE)
+Index: openssl-1.0.2/engines/ccgost/Makefile
+===================================================================
+--- openssl-1.0.2.orig/engines/ccgost/Makefile
++++ openssl-1.0.2/engines/ccgost/Makefile
+@@ -47,7 +47,7 @@ install:
+ 		pfx=lib; \
+ 		if expr "$(PLATFORM)" : "Cygwin" >/dev/null; then \
+ 			sfx=".so"; \
+-			cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
++			cp cyg$(LIBNAME).dll $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$${pfx}$(LIBNAME)$$sfx.new; \
+ 		else \
+ 			case "$(CFLAGS)" in \
+ 			*DSO_BEOS*) sfx=".so";; \
+@@ -56,10 +56,10 @@ install:
+ 			*DSO_WIN32*) sfx="eay32.dll"; pfx=;; \
+ 			*) sfx=".bad";; \
+ 			esac; \
+-			cp $${pfx}$(LIBNAME)$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
++			cp $${pfx}$(LIBNAME)$$sfx $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$${pfx}$(LIBNAME)$$sfx.new; \
+ 		fi; \
+-		chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new; \
+-		mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines/$${pfx}$(LIBNAME)$$sfx; \
++		chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$${pfx}$(LIBNAME)$$sfx.new; \
++		mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$${pfx}$(LIBNAME)$$sfx.new $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/ssl/engines/$${pfx}$(LIBNAME)$$sfx; \
+ 	fi
+ 
+ links:
diff --git a/meta/recipes-connectivity/openssl/openssl/find.pl b/meta/recipes-connectivity/openssl/openssl/find.pl
new file mode 100644
index 0000000..8e1b42c
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/find.pl
@@ -0,0 +1,54 @@
+warn "Legacy library @{[(caller(0))[6]]} will be removed from the Perl core distribution in the next major release. Please install it from the CPAN distribution Perl4::CoreLibs. It is being used at @{[(caller)[1]]}, line @{[(caller)[2]]}.\n";
+
+# This library is deprecated and unmaintained. It is included for
+# compatibility with Perl 4 scripts which may use it, but it will be
+# removed in a future version of Perl. Please use the File::Find module
+# instead.
+
+# Usage:
+#	require "find.pl";
+#
+#	&find('/foo','/bar');
+#
+#	sub wanted { ... }
+#		where wanted does whatever you want.  $dir contains the
+#		current directory name, and $_ the current filename within
+#		that directory.  $name contains "$dir/$_".  You are cd'ed
+#		to $dir when the function is called.  The function may
+#		set $prune to prune the tree.
+#
+# For example,
+#
+#   find / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune
+#
+# corresponds to this
+#
+#	sub wanted {
+#	    /^\.nfs.*$/ &&
+#	    (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) &&
+#	    int(-M _) > 7 &&
+#	    unlink($_)
+#	    ||
+#	    ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) &&
+#	    $dev < 0 &&
+#	    ($prune = 1);
+#	}
+#
+# Set the variable $dont_use_nlink if you're using AFS, since AFS cheats.
+
+use File::Find ();
+
+*name		= *File::Find::name;
+*prune		= *File::Find::prune;
+*dir		= *File::Find::dir;
+*topdir		= *File::Find::topdir;
+*topdev		= *File::Find::topdev;
+*topino		= *File::Find::topino;
+*topmode	= *File::Find::topmode;
+*topnlink	= *File::Find::topnlink;
+
+sub find {
+    &File::Find::find(\&wanted, @_);
+}
+
+1;
diff --git a/meta/recipes-connectivity/openssl/openssl/fix-cipher-des-ede3-cfb1.patch b/meta/recipes-connectivity/openssl/openssl/fix-cipher-des-ede3-cfb1.patch
new file mode 100644
index 0000000..06d1ea6
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/fix-cipher-des-ede3-cfb1.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Submitted
+
+This patch adds the fix for one of the ciphers used in openssl, namely
+the cipher des-ede3-cfb1. Complete bug log and patch is present here:
+http://rt.openssl.org/Ticket/Display.html?id=2867
+
+Signed-Off-By: Muhammad Shakeel <muhammad_shakeel@mentor.com>
+
+Index: openssl-1.0.2/crypto/evp/e_des3.c
+===================================================================
+--- openssl-1.0.2.orig/crypto/evp/e_des3.c
++++ openssl-1.0.2/crypto/evp/e_des3.c
+@@ -211,7 +211,7 @@ static int des_ede3_cfb1_cipher(EVP_CIPH
+     size_t n;
+     unsigned char c[1], d[1];
+ 
+-    for (n = 0; n < inl; ++n) {
++    for (n = 0; n * 8 < inl; ++n) {
+         c[0] = (in[n / 8] & (1 << (7 - n % 8))) ? 0x80 : 0;
+         DES_ede3_cfb_encrypt(c, d, 1, 1,
+                              &data(ctx)->ks1, &data(ctx)->ks2,
diff --git a/meta/recipes-connectivity/openssl/openssl/oe-ldflags.patch b/meta/recipes-connectivity/openssl/openssl/oe-ldflags.patch
new file mode 100644
index 0000000..292e13d
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/oe-ldflags.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Inappropriate [open-embedded]
+
+Index: openssl-1.0.0/Makefile.shared
+===================================================================
+--- openssl-1.0.0.orig/Makefile.shared
++++ openssl-1.0.0/Makefile.shared
+@@ -92,7 +92,7 @@
+ LINK_APP=	\
+   ( $(SET_X);   \
+     LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
+-    LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$${LDFLAGS:-$(CFLAGS)}"; \
++    LDCMD="$${LDCMD:-$(CC)}"; LDFLAGS="$(OE_LDFLAGS) $${LDFLAGS:-$(CFLAGS)}"; \
+     LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
+     LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+     LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
+@@ -102,7 +102,7 @@
+   ( $(SET_X);   \
+     LIBDEPS="$${LIBDEPS:-$(LIBDEPS)}"; \
+     SHAREDCMD="$${SHAREDCMD:-$(CC)}"; \
+-    SHAREDFLAGS="$${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
++    SHAREDFLAGS="$(OE_LDFLAGS) $${SHAREDFLAGS:-$(CFLAGS) $(SHARED_LDFLAGS)}"; \
+     LIBPATH=`for x in $$LIBDEPS; do echo $$x; done | sed -e 's/^ *-L//;t' -e d | uniq`; \
+     LIBPATH=`echo $$LIBPATH | sed -e 's/ /:/g'`; \
+     LD_LIBRARY_PATH=$$LIBPATH:$$LD_LIBRARY_PATH \
diff --git a/meta/recipes-connectivity/openssl/openssl/openssl-1.0.2a-x32-asm.patch b/meta/recipes-connectivity/openssl/openssl/openssl-1.0.2a-x32-asm.patch
new file mode 100644
index 0000000..1e5bfa1
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/openssl-1.0.2a-x32-asm.patch
@@ -0,0 +1,46 @@
+https://rt.openssl.org/Ticket/Display.html?id=3759&user=guest&pass=guest
+
+From 6257d59b3a68d2feb9d64317a1c556dc3813ee61 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sat, 21 Mar 2015 06:01:25 -0400
+Subject: [PATCH] crypto: use bigint in x86-64 perl
+
+Upstream-Status: Pending
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+
+When building on x32 systems where the default type is 32bit, make sure
+we can transparently represent 64bit integers.  Otherwise we end up with
+build errors like:
+/usr/bin/perl asm/ghash-x86_64.pl elf > ghash-x86_64.s
+Integer overflow in hexadecimal number at asm/../../perlasm/x86_64-xlate.pl line 201, <> line 890.
+...
+ghash-x86_64.s: Assembler messages:
+ghash-x86_64.s:890: Error: junk '.15473355479995e+19' after expression
+
+We don't enable this globally as there are some cases where we'd get
+32bit values interpreted as unsigned when we need them as signed.
+
+Reported-by: Bertrand Jacquin <bertrand@jacquin.bzh>
+URL: https://bugs.gentoo.org/542618
+---
+ crypto/perlasm/x86_64-xlate.pl | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
+index aae8288..0bf9774 100755
+--- a/crypto/perlasm/x86_64-xlate.pl
++++ b/crypto/perlasm/x86_64-xlate.pl
+@@ -195,6 +195,10 @@ my %globals;
+     sub out {
+     	my $self = shift;
+ 
++	# When building on x32 ABIs, the expanded hex value might be too
++	# big to fit into 32bits.  Enable transparent 64bit support here
++	# so we can safely print it out.
++	use bigint;
+ 	if ($gas) {
+ 	    # Solaris /usr/ccs/bin/as can't handle multiplications
+ 	    # in $self->{value}
+-- 
+2.3.3
+
diff --git a/meta/recipes-connectivity/openssl/openssl/openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch b/meta/recipes-connectivity/openssl/openssl/openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch
new file mode 100644
index 0000000..cebc8cf
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch
@@ -0,0 +1,23 @@
+openssl: avoid NULL pointer dereference in EVP_DigestInit_ex()
+
+We should avoid accessing the type pointer if it's NULL,
+this could happen if ctx->digest is not NULL.
+
+Upstream-Status: Submitted
+http://www.mail-archive.com/openssl-dev@openssl.org/msg32860.html
+
+Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
+---
+Index: openssl-1.0.2/crypto/evp/digest.c
+===================================================================
+--- openssl-1.0.2.orig/crypto/evp/digest.c
++++ openssl-1.0.2/crypto/evp/digest.c
+@@ -208,7 +208,7 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, c
+         return 0;
+     }
+ #endif
+-    if (ctx->digest != type) {
++    if (type && (ctx->digest != type)) {
+         if (ctx->digest && ctx->digest->ctx_size)
+             OPENSSL_free(ctx->md_data);
+         ctx->digest = type;
diff --git a/meta/recipes-connectivity/openssl/openssl/openssl-fix-des.pod-error.patch b/meta/recipes-connectivity/openssl/openssl/openssl-fix-des.pod-error.patch
new file mode 100644
index 0000000..de49729
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/openssl-fix-des.pod-error.patch
@@ -0,0 +1,19 @@
+openssl: Fix pod2man des.pod error on Ubuntu 12.04
+
+This is a formatting fix, '=back' is required before
+'=head1' on Ubuntu 12.04.
+
+Upstream-Status: Pending
+Signed-off-by: Baogen Shang <baogen.shang@windriver.com>
+diff -urpN a_origin/des.pod b_modify/des.pod
+--- a_origin/crypto/des/des.pod	2013-08-15 15:02:56.211674589 +0800
++++ b_modify/crypto/des/des.pod	2013-08-15 15:04:14.439674580 +0800
+@@ -181,6 +181,8 @@ the uuencoded file to embed in the begin
+ output.  If there is no name specified after the B<-u>, the name text.des
+ will be embedded in the header.
+ 
++=back
++
+ =head1 SEE ALSO
+ 
+ ps(1),
diff --git a/meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch b/meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch
new file mode 100644
index 0000000..cbce32c
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/openssl_fix_for_x32.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Pending
+
+Received from H J Liu @ Intel
+Make the assembly syntax compatible with x32 gcc. Othewise x32 gcc throws errors.
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/07/13
+
+ported the patch to the 1.0.0e version
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/01
+Index: openssl-1.0.2/crypto/bn/bn.h
+===================================================================
+--- openssl-1.0.2.orig/crypto/bn/bn.h
++++ openssl-1.0.2/crypto/bn/bn.h
+@@ -173,6 +173,13 @@ extern "C" {
+ #  endif
+ # endif
+ 
++/* Address type.  */
++#ifdef _WIN64
++#define BN_ADDR unsigned long long
++#else
++#define BN_ADDR unsigned long
++#endif
++
+ /*
+  * assuming long is 64bit - this is the DEC Alpha unsigned long long is only
+  * 64 bits :-(, don't define BN_LLONG for the DEC Alpha
+Index: openssl-1.0.2/crypto/bn/bn_exp.c
+===================================================================
+--- openssl-1.0.2.orig/crypto/bn/bn_exp.c
++++ openssl-1.0.2/crypto/bn/bn_exp.c
+@@ -638,7 +638,7 @@ static int MOD_EXP_CTIME_COPY_FROM_PREBU
+  * multiple.
+  */
+ #define MOD_EXP_CTIME_ALIGN(x_) \
+-        ((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
++	((unsigned char*)(x_) + (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - (((BN_ADDR)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK))))
+ 
+ /*
+  * This variant of BN_mod_exp_mont() uses fixed windows and the special
diff --git a/meta/recipes-connectivity/openssl/openssl/ptest-deps.patch b/meta/recipes-connectivity/openssl/openssl/ptest-deps.patch
new file mode 100644
index 0000000..ef6d179
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/ptest-deps.patch
@@ -0,0 +1,34 @@
+Remove Makefile dependencies for test targets
+
+These are probably here because the executables aren't always built for
+other platforms (e.g. Windows); however we can safely assume they'll
+always be there. None of the other test targets have such dependencies
+and if we don't remove them, make tries to rebuild the executables and
+fails during run-ptest.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Index: openssl-1.0.2/test/Makefile
+===================================================================
+--- openssl-1.0.2.orig/test/Makefile
++++ openssl-1.0.2/test/Makefile
+@@ -330,7 +330,7 @@ test_cms: ../apps/openssl$(EXE_EXT) cms-
+ 	@echo "CMS consistency test"
+ 	$(PERL) cms-test.pl
+ 
+-test_srp: $(SRPTEST)$(EXE_EXT)
++test_srp:
+ 	@echo "Test SRP"
+ 	../util/shlib_wrap.sh ./srptest
+ 
+@@ -342,7 +342,7 @@ test_v3name: $(V3NAMETEST)$(EXE_EXT)
+ 	@echo "Test X509v3_check_*"
+ 	../util/shlib_wrap.sh ./$(V3NAMETEST)
+ 
+-test_heartbeat: $(HEARTBEATTEST)$(EXE_EXT)
++test_heartbeat:
+ 	../util/shlib_wrap.sh ./$(HEARTBEATTEST)
+ 
+ test_constant_time: $(CONSTTIMETEST)$(EXE_EXT)
diff --git a/meta/recipes-connectivity/openssl/openssl/run-ptest b/meta/recipes-connectivity/openssl/openssl/run-ptest
new file mode 100755
index 0000000..3b20fce
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest
diff --git a/meta/recipes-connectivity/openssl/openssl/shared-libs.patch b/meta/recipes-connectivity/openssl/openssl/shared-libs.patch
new file mode 100644
index 0000000..a7ca0a3
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl/shared-libs.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: openssl-1.0.1e/crypto/Makefile
+===================================================================
+--- openssl-1.0.1e.orig/crypto/Makefile
++++ openssl-1.0.1e/crypto/Makefile
+@@ -108,7 +108,7 @@ $(LIB):	$(LIBOBJ)
+ 
+ shared: buildinf.h lib subdirs
+ 	if [ -n "$(SHARED_LIBS)" ]; then \
+-		(cd ..; $(MAKE) $(SHARED_LIB)); \
++		(cd ..; $(MAKE) -e $(SHARED_LIB)); \
+ 	fi
+ 
+ libs:
+Index: openssl-1.0.1e/Makefile.org
+===================================================================
+--- openssl-1.0.1e.orig/Makefile.org
++++ openssl-1.0.1e/Makefile.org
+@@ -310,7 +310,7 @@ libcrypto$(SHLIB_EXT): libcrypto.a fips_
+ 
+ libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
+ 	@if [ "$(SHLIB_TARGET)" != "" ]; then \
+-		$(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
++		$(MAKE) -e SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
+ 	else \
+ 		echo "There's no support for shared libraries on this platform" >&2; \
+ 		exit 1; \
+Index: openssl-1.0.1e/ssl/Makefile
+===================================================================
+--- openssl-1.0.1e.orig/ssl/Makefile
++++ openssl-1.0.1e/ssl/Makefile
+@@ -62,7 +62,7 @@ lib:	$(LIBOBJ)
+ 
+ shared: lib
+ 	if [ -n "$(SHARED_LIBS)" ]; then \
+-		(cd ..; $(MAKE) $(SHARED_LIB)); \
++		(cd ..; $(MAKE) -e $(SHARED_LIB)); \
+ 	fi
+ 
+ files:
diff --git a/meta/recipes-connectivity/openssl/openssl_1.0.2d.bb b/meta/recipes-connectivity/openssl/openssl_1.0.2d.bb
new file mode 100644
index 0000000..32d8dce
--- /dev/null
+++ b/meta/recipes-connectivity/openssl/openssl_1.0.2d.bb
@@ -0,0 +1,57 @@
+require openssl.inc
+
+# For target side versions of openssl enable support for OCF Linux driver
+# if they are available.
+DEPENDS += "cryptodev-linux"
+
+CFLAG += "-DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f9a8f968107345e0b75aa8c2ecaa7ec8"
+
+export DIRS = "crypto ssl apps engines"
+export OE_LDFLAGS="${LDFLAGS}"
+
+SRC_URI += "file://configure-targets.patch \
+            file://shared-libs.patch \
+            file://oe-ldflags.patch \
+            file://engines-install-in-libdir-ssl.patch \
+            file://debian1.0.2/block_diginotar.patch \
+            file://debian1.0.2/block_digicert_malaysia.patch \
+            file://debian/ca.patch \
+            file://debian/c_rehash-compat.patch \
+            file://debian/debian-targets.patch \
+            file://debian/man-dir.patch \
+            file://debian/man-section.patch \
+            file://debian/no-rpath.patch \
+            file://debian/no-symbolic.patch \
+            file://debian/pic.patch \
+            file://debian/version-script.patch \
+            file://openssl_fix_for_x32.patch \
+            file://fix-cipher-des-ede3-cfb1.patch \
+            file://openssl-avoid-NULL-pointer-dereference-in-EVP_DigestInit_ex.patch \
+            file://find.pl \
+            file://openssl-fix-des.pod-error.patch \
+            file://Makefiles-ptest.patch \
+            file://ptest-deps.patch \
+            file://run-ptest \
+            file://crypto_use_bigint_in_x86-64_perl.patch \
+            file://openssl-1.0.2a-x32-asm.patch \
+           "
+
+SRC_URI[md5sum] = "38dd619b2e77cbac69b99f52a053d25a"
+SRC_URI[sha256sum] = "671c36487785628a703374c652ad2cebea45fa920ae5681515df25d9f2c9a8c8"
+
+PACKAGES =+ " \
+	${PN}-engines \
+	${PN}-engines-dbg \
+	"
+
+FILES_${PN}-engines = "${libdir}/ssl/engines/*.so ${libdir}/engines"
+FILES_${PN}-engines-dbg = "${libdir}/ssl/engines/.debug"
+
+PARALLEL_MAKE = ""
+PARALLEL_MAKEINST = ""
+
+do_configure_prepend() {
+  cp ${WORKDIR}/find.pl ${S}/util/find.pl
+}
diff --git a/meta/recipes-connectivity/portmap/portmap.inc b/meta/recipes-connectivity/portmap/portmap.inc
new file mode 100644
index 0000000..338af33
--- /dev/null
+++ b/meta/recipes-connectivity/portmap/portmap.inc
@@ -0,0 +1,17 @@
+SUMMARY = "RPC program number mapper"
+HOMEPAGE = "http://neil.brown.name/portmap/"
+SECTION = "console/network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://portmap.c;beginline=2;endline=31;md5=51ff67e66ec84b2009b017b1f94afbf4 \
+                    file://from_local.c;beginline=9;endline=35;md5=1bec938a2268b8b423c58801ace3adc1"
+
+INITSCRIPT_NAME = "portmap"
+INITSCRIPT_PARAMS = "start 10 2 3 4 5 . stop 32 0 1 6 ."
+
+inherit update-rc.d systemd
+
+SYSTEMD_SERVICE_${PN} = "portmap.service"
+
+PACKAGES =+ "portmap-utils"
+FILES_portmap-utils = "${base_sbindir}/pmap_set ${base_sbindir}/pmap_dump"
+FILES_${PN}-doc += "${docdir}"
diff --git a/meta/recipes-connectivity/portmap/portmap/destdir-no-strip.patch b/meta/recipes-connectivity/portmap/portmap/destdir-no-strip.patch
new file mode 100644
index 0000000..2fbf784
--- /dev/null
+++ b/meta/recipes-connectivity/portmap/portmap/destdir-no-strip.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Backport
+
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 13 May 2007 21:15:12 +0000 (-0400)
+Subject: respect DESTDIR and dont use -s with install
+X-Git-Url: http://neil.brown.name/git?p=portmap;a=commitdiff_plain;h=603c59b978c04df2354f68d4a2dc676a758ff46d
+
+respect DESTDIR and dont use -s with install
+
+$(DESTDIR) is the standard for installing into other trees, not $(BASEDIR) ...
+so I've converted the Makefile to use that.  I've also left in $(BASEDIR) as a
+default to support old installs; not sure if you'd just cut it.
+
+Stripping should be left to the person to handle, not automatically done by
+the install step.  Also, `install -s` always calls `strip` which is
+wrong/undesired in cross-compiling scenarios.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Signed-off-by: Neil Brown <neilb@suse.de>
+---
+
+diff --git a/Makefile b/Makefile
+index 9e9a4b4..5343428 100644
+--- a/Makefile
++++ b/Makefile
+@@ -135,13 +135,14 @@ from_local: CPPFLAGS += -DTEST
+ portmap.man : portmap.8
+ 	sed $(MAN_SED) < portmap.8 > portmap.man
+ 
++DESTDIR = $(BASEDIR)
+ install: all
+-	install -o root -g root -m 0755 -s portmap ${BASEDIR}/sbin
+-	install -o root -g root -m 0755 -s pmap_dump ${BASEDIR}/sbin
+-	install -o root -g root -m 0755 -s pmap_set ${BASEDIR}/sbin
+-	install -o root -g root -m 0644 portmap.man ${BASEDIR}/usr/share/man/man8/portmap.8
+-	install -o root -g root -m 0644 pmap_dump.8 ${BASEDIR}/usr/share/man/man8
+-	install -o root -g root -m 0644 pmap_set.8 ${BASEDIR}/usr/share/man/man8
++	install -o root -g root -m 0755 portmap $(DESTDIR)/sbin
++	install -o root -g root -m 0755 pmap_dump $(DESTDIR)/sbin
++	install -o root -g root -m 0755 pmap_set $(DESTDIR)/sbin
++	install -o root -g root -m 0644 portmap.man $(DESTDIR)/usr/share/man/man8/portmap.8
++	install -o root -g root -m 0644 pmap_dump.8 $(DESTDIR)/usr/share/man/man8
++	install -o root -g root -m 0644 pmap_set.8 $(DESTDIR)/usr/share/man/man8
+ 
+ clean:
+ 	rm -f *.o portmap pmap_dump pmap_set from_local \
diff --git a/meta/recipes-connectivity/portmap/portmap/portmap.init b/meta/recipes-connectivity/portmap/portmap/portmap.init
new file mode 100755
index 0000000..621aa17
--- /dev/null
+++ b/meta/recipes-connectivity/portmap/portmap/portmap.init
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides:          portmap
+# Required-Start:    $network
+# Required-Stop:     $network
+# Default-Start:     S 2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: The RPC portmapper
+# Description:       Portmap is a server that converts RPC (Remote
+#                    Procedure Call) program numbers into DARPA
+#                    protocol port numbers. It must be running in
+#                    order to make RPC calls. Services that use
+#                    RPC include NFS and NIS.
+### END INIT INFO
+
+test -f /sbin/portmap || exit 0
+
+case "$1" in
+    start)
+	echo "Starting portmap daemon..."
+        start-stop-daemon --start --quiet --exec /sbin/portmap
+
+	if [ -f /var/run/portmap.upgrade-state ]; then
+          echo "Restoring old RPC service information..."
+          sleep 1 # needs a short pause or pmap_set won't work. :(
+	  pmap_set </var/run/portmap.upgrade-state
+	  rm -f /var/run/portmap.upgrade-state
+          echo "done."
+        fi
+
+	;;
+    stop)
+        echo "Stopping portmap daemon..."
+        start-stop-daemon --stop --quiet --exec /sbin/portmap
+	;;
+    reload)
+	;;
+    force-reload)
+        $0 restart
+	;;
+    restart)
+	# pmap_dump and pmap_set may be in a different package and not installed...
+	if [ -f /sbin/pmap_dump -a -f /sbin/pmap_set ]; then
+		do_state=1
+	else
+		do_state=0
+	fi
+	[ $do_state -eq 1 ] && pmap_dump >/var/run/portmap.state
+        $0 stop
+        $0 start
+	if [ $do_state -eq 1 ]; then
+	  if [ ! -f /var/run/portmap.upgrade-state ]; then
+            sleep 1
+	    pmap_set </var/run/portmap.state
+	  fi
+	  rm -f /var/run/portmap.state
+	fi
+	;;
+    *)
+	echo "Usage: /etc/init.d/portmap {start|stop|reload|restart}"
+	exit 1
+	;;
+esac
+
+exit 0
+
diff --git a/meta/recipes-connectivity/portmap/portmap/portmap.service b/meta/recipes-connectivity/portmap/portmap/portmap.service
new file mode 100644
index 0000000..7ef9d7b
--- /dev/null
+++ b/meta/recipes-connectivity/portmap/portmap/portmap.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=The RPC portmapper
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=@BASE_SBINDIR@/portmap
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/portmap/portmap/tcpd-config.patch b/meta/recipes-connectivity/portmap/portmap/tcpd-config.patch
new file mode 100644
index 0000000..2f25058
--- /dev/null
+++ b/meta/recipes-connectivity/portmap/portmap/tcpd-config.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Backport
+
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Sun, 13 May 2007 21:17:32 +0000 (-0400)
+Subject: fix building with tcpd support disabled
+X-Git-Url: http://neil.brown.name/git?p=portmap;a=commitdiff_plain;h=7847207aed1b44faf077eed14a9ac9c68244eba5
+
+fix building with tcpd support disabled
+
+Make sure pmap_check.c only includes tcpd.h when HOSTS_ACCESS is defined.
+
+Signed-off-by: Timothy Redaelli <drizzt@gentoo.org>
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+Signed-off-by: Neil Brown <neilb@suse.de>
+---
+
+diff --git a/pmap_check.c b/pmap_check.c
+index 84f2c12..443a822 100644
+--- a/pmap_check.c
++++ b/pmap_check.c
+@@ -44,7 +44,9 @@
+ #include <netinet/in.h>
+ #include <rpc/rpcent.h>
+ #endif
++#ifdef HOSTS_ACCESS
+ #include <tcpd.h>
++#endif
+ #include <arpa/inet.h>
+ #include <grp.h>
+ 
diff --git a/meta/recipes-connectivity/portmap/portmap_6.0.bb b/meta/recipes-connectivity/portmap/portmap_6.0.bb
new file mode 100644
index 0000000..e727fe3
--- /dev/null
+++ b/meta/recipes-connectivity/portmap/portmap_6.0.bb
@@ -0,0 +1,31 @@
+require portmap.inc
+
+PR = "r9"
+
+SRC_URI = "http://www.sourcefiles.org/Networking/Tools/Miscellanenous/portmap-6.0.tgz \
+           file://destdir-no-strip.patch \
+           file://tcpd-config.patch \
+           file://portmap.init \
+           file://portmap.service"
+
+SRC_URI[md5sum] = "ac108ab68bf0f34477f8317791aaf1ff"
+SRC_URI[sha256sum] = "02c820d39f3e6e729d1bea3287a2d8a6c684f1006fb9612f97dcad4a281d41de"
+
+S = "${WORKDIR}/${BPN}_${PV}/"
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers"
+
+CPPFLAGS += "-DFACILITY=LOG_DAEMON -DENABLE_DNS -DHOSTS_ACCESS"
+CFLAGS += "-Wall -Wstrict-prototypes -fPIC"
+EXTRA_OEMAKE += "'NO_TCP_WRAPPER=${@bb.utils.contains('PACKAGECONFIG', 'tcp-wrappers', '', '1', d)}'"
+
+do_install() {
+    install -d ${D}${mandir}/man8/ ${D}${base_sbindir} ${D}${sysconfdir}/init.d
+    install -m 0755 ${WORKDIR}/portmap.init ${D}${sysconfdir}/init.d/portmap
+    oe_runmake install DESTDIR=${D}
+
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/portmap.service ${D}${systemd_unitdir}/system
+    sed -i -e 's,@BASE_SBINDIR@,${base_sbindir},g' ${D}${systemd_unitdir}/system/portmap.service
+}
diff --git a/meta/recipes-connectivity/ppp-dialin/files/host-peer b/meta/recipes-connectivity/ppp-dialin/files/host-peer
new file mode 100644
index 0000000..e7e2e11
--- /dev/null
+++ b/meta/recipes-connectivity/ppp-dialin/files/host-peer
@@ -0,0 +1,11 @@
+-detach
+defaultroute
+nocrtscts
+lock
+noauth
+lcp-echo-interval 5
+lcp-echo-failure 3
+usepeerdns
+115200
+local
+asyncmap 0
diff --git a/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin b/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin
new file mode 100644
index 0000000..ea27713
--- /dev/null
+++ b/meta/recipes-connectivity/ppp-dialin/files/ppp-dialin
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/sbin/pppd call host
diff --git a/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb b/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb
new file mode 100644
index 0000000..51a76b4
--- /dev/null
+++ b/meta/recipes-connectivity/ppp-dialin/ppp-dialin_0.1.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Enables PPP dial-in through a serial connection"
+SECTION = "console/network"
+DEPENDS = "ppp"
+RDEPENDS_${PN} = "ppp"
+PR = "r8"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://host-peer \
+           file://ppp-dialin"
+
+inherit allarch useradd
+
+S = "${WORKDIR}"
+
+do_install() {
+	install -d ${D}${sysconfdir}/ppp/peers
+	install -m 0644 ${WORKDIR}/host-peer ${D}${sysconfdir}/ppp/peers/host
+
+	install -d ${D}${sbindir}
+	install -m 0755 ${WORKDIR}/ppp-dialin ${D}${sbindir}
+}
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --home /dev/null \
+                       --no-create-home --shell ${sbindir}/ppp-dialin \
+                       --no-user-group --gid nogroup ppp"
diff --git a/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch b/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch
new file mode 100644
index 0000000..8aa2d2e
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/0001-ppp-Fix-compilation-errors-in-Makefile.patch
@@ -0,0 +1,75 @@
+From ba0f6058d1f25b2b60fc31ab2656bf12a71ffdab Mon Sep 17 00:00:00 2001
+From: Lu Chong <Chong.Lu@windriver.com>
+Date: Tue, 5 Nov 2013 17:32:56 +0800
+Subject: [PATCH] ppp: Fix compilation errors in Makefile
+
+This patch fixes below issues:
+
+1. Make can't exit while compilation error occurs in subdir for plugins building.
+
+2. If build ppp with newer kernel (3.10.10), it will pick 'if_pppox.h' from sysroot-dir and
+   'if_pppol2tp.h' from its own source dir, this cause below build errors:
+
+        bitbake_build/tmp/sysroots/intel-x86-64/usr/include/linux/if_pppox.h:84:26:
+        error: field 'pppol2tp' has incomplete type
+          struct pppol2tpin6_addr pppol2tp;
+                                  ^
+        bitbake_build/tmp/sysroots/intel-x86-64/usr/include/linux/if_pppox.h:99:28:
+        error: field 'pppol2tp' has incomplete type
+          struct pppol2tpv3in6_addr pppol2tp;
+                                    ^
+
+The 'sysroot-dir/if_pppox.h' enabled ipv6 support but the 'source-dir/if_pppol2tp.h' lost
+related structure definitions, we should use both header files from sysroots to fix this
+build failure.
+
+Upstream-Status: Pending
+
+Signed-off-by: Lu Chong <Chong.Lu@windriver.com>
+---
+ pppd/plugins/Makefile.linux          |    2 +-
+ pppd/plugins/pppol2tp/Makefile.linux |    2 +-
+ pppd/plugins/rp-pppoe/Makefile.linux |    2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/pppd/plugins/Makefile.linux b/pppd/plugins/Makefile.linux
+index 0a7ec7b..2a2c15a 100644
+--- a/pppd/plugins/Makefile.linux
++++ b/pppd/plugins/Makefile.linux
+@@ -20,7 +20,7 @@ include .depend
+ endif
+ 
+ all:	$(PLUGINS)
+-	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all; done
++	for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit 1; done
+ 
+ %.so: %.c
+ 	$(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^
+diff --git a/pppd/plugins/pppol2tp/Makefile.linux b/pppd/plugins/pppol2tp/Makefile.linux
+index 19eff67..feb2f52 100644
+--- a/pppd/plugins/pppol2tp/Makefile.linux
++++ b/pppd/plugins/pppol2tp/Makefile.linux
+@@ -1,6 +1,6 @@
+ #CC	= gcc
+ COPTS	= -O2 -g
+-CFLAGS	= $(COPTS) -I. -I../.. -I../../../include -fPIC
++CFLAGS	= $(COPTS) -I. -I../.. -fPIC
+ LDFLAGS	= -shared
+ INSTALL	= install
+ 
+diff --git a/pppd/plugins/rp-pppoe/Makefile.linux b/pppd/plugins/rp-pppoe/Makefile.linux
+index f078991..15b9118 100644
+--- a/pppd/plugins/rp-pppoe/Makefile.linux
++++ b/pppd/plugins/rp-pppoe/Makefile.linux
+@@ -26,7 +26,7 @@ INSTALL	= install
+ RP_VERSION=3.8p
+ 
+ COPTS=-O2 -g
+-CFLAGS=$(COPTS) -I../../../include '-DRP_VERSION="$(RP_VERSION)"'
++CFLAGS=$(COPTS) '-DRP_VERSION="$(RP_VERSION)"'
+ all: rp-pppoe.so pppoe-discovery
+ 
+ pppoe-discovery: pppoe-discovery.o debug.o
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/ppp/ppp/08setupdns b/meta/recipes-connectivity/ppp/ppp/08setupdns
new file mode 100644
index 0000000..998219d
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/08setupdns
@@ -0,0 +1,12 @@
+#!/bin/sh
+ACTUALCONF=/var/run/resolv.conf
+PPPCONF=/var/run/ppp/resolv.conf
+if [ -f $PPPCONF ] ; then
+	if [ -f $ACTUALCONF ] ; then
+		if [ ! -h $ACTUALCONF -o ! "`readlink $ACTUALCONF 2>&1`" = "$PPPCONF" ] ; then
+			mv $ACTUALCONF $ACTUALCONF.ppporig
+		fi
+	fi
+
+	ln -sf $PPPCONF $ACTUALCONF
+fi
diff --git a/meta/recipes-connectivity/ppp/ppp/92removedns b/meta/recipes-connectivity/ppp/ppp/92removedns
new file mode 100644
index 0000000..2eadec6
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/92removedns
@@ -0,0 +1,5 @@
+#!/bin/sh
+ACTUALCONF=/var/run/resolv.conf
+if [ -f $ACTUALCONF.ppporig ] ; then
+	mv $ACTUALCONF.ppporig $ACTUALCONF
+fi
diff --git a/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch b/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch
new file mode 100644
index 0000000..db4dbc2
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/cifdefroute.patch
@@ -0,0 +1,292 @@
+This patch comes from OpenEmbedded.
+The original patch is from Debian / SuSE to implement replacedefaultroute
+Rebased it to fit ppp-2.4.5. Dongxiao Xu <dongxiao.xu@intel.com>
+
+Upstream-Status: Inappropriate [debian/suse patches]
+
+diff -urN ppp-2.4.5-orig/pppd/ipcp.c ppp-2.4.5/pppd/ipcp.c
+--- ppp-2.4.5-orig/pppd/ipcp.c	2010-06-30 15:51:12.050166398 +0800
++++ ppp-2.4.5/pppd/ipcp.c	2010-06-30 16:40:00.478716855 +0800
+@@ -198,6 +198,16 @@
+       "disable defaultroute option", OPT_ALIAS | OPT_A2CLR,
+       &ipcp_wantoptions[0].default_route },
+ 
++#ifdef __linux__
++    { "replacedefaultroute", o_bool,
++                               &ipcp_wantoptions[0].replace_default_route,
++      "Replace default route", 1
++    },
++    { "noreplacedefaultroute", o_bool,
++                               &ipcp_allowoptions[0].replace_default_route,
++      "Never replace default route", OPT_A2COPY,
++                               &ipcp_wantoptions[0].replace_default_route },
++#endif
+     { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp,
+       "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp },
+     { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp,
+@@ -271,7 +281,7 @@
+     ip_active_pkt
+ };
+ 
+-static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t));
++static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool));
+ static void ipcp_script __P((char *, int));	/* Run an up/down script */
+ static void ipcp_script_done __P((void *));
+ 
+@@ -1742,7 +1752,12 @@
+     if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE))
+ 	return 0;
+     if (wo->default_route)
++#ifndef __linux__
+ 	if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr))
++#else
++	if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr,
++                                            wo->replace_default_route))
++#endif
+ 	    default_route_set[u] = 1;
+     if (wo->proxy_arp)
+ 	if (sifproxyarp(u, wo->hisaddr))
+@@ -1830,7 +1845,8 @@
+      */
+     if (demand) {
+ 	if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) {
+-	    ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr);
++	    ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr, 
++				      wo->replace_default_route);
+ 	    if (go->ouraddr != wo->ouraddr) {
+ 		warn("Local IP address changed to %I", go->ouraddr);
+ 		script_setenv("OLDIPLOCAL", ip_ntoa(wo->ouraddr), 0);
+@@ -1855,7 +1871,12 @@
+ 
+ 	    /* assign a default route through the interface if required */
+ 	    if (ipcp_wantoptions[f->unit].default_route) 
++#ifndef __linux__
+ 		if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
++#else
++		if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
++					     wo->replace_default_route))
++#endif
+ 		    default_route_set[f->unit] = 1;
+ 
+ 	    /* Make a proxy ARP entry if requested. */
+@@ -1905,7 +1926,12 @@
+ 
+ 	/* assign a default route through the interface if required */
+ 	if (ipcp_wantoptions[f->unit].default_route) 
++#ifndef __linux__
+ 	    if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr))
++#else
++	    if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr,
++					 wo->replace_default_route))
++#endif
+ 		default_route_set[f->unit] = 1;
+ 
+ 	/* Make a proxy ARP entry if requested. */
+@@ -1983,7 +2009,7 @@
+ 	sifnpmode(f->unit, PPP_IP, NPMODE_DROP);
+ 	sifdown(f->unit);
+ 	ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr,
+-			 ipcp_hisoptions[f->unit].hisaddr);
++			 ipcp_hisoptions[f->unit].hisaddr, 0);
+     }
+ 
+     /* Execute the ip-down script */
+@@ -1999,12 +2025,21 @@
+  * proxy arp entries, etc.
+  */
+ static void
+-ipcp_clear_addrs(unit, ouraddr, hisaddr)
++ipcp_clear_addrs(unit, ouraddr, hisaddr, replacedefaultroute)
+     int unit;
+     u_int32_t ouraddr;  /* local address */
+     u_int32_t hisaddr;  /* remote address */
++    bool replacedefaultroute;
+ {
+-    if (proxy_arp_set[unit]) {
++    /* If replacedefaultroute, sifdefaultroute will be called soon
++     * with replacedefaultroute set and that will overwrite the current
++     * default route. This is the case only when doing demand, otherwise
++     * during demand, this cifdefaultroute would restore the old default
++     * route which is not what we want in this case. In the non-demand
++     * case, we'll delete the default route and restore the old if there
++     * is one saved by an sifdefaultroute with replacedefaultroute.
++     */
++    if (!replacedefaultroute && default_route_set[unit]) {
+ 	cifproxyarp(unit, hisaddr);
+ 	proxy_arp_set[unit] = 0;
+     }
+diff -urN ppp-2.4.5-orig/pppd/ipcp.h ppp-2.4.5/pppd/ipcp.h
+--- ppp-2.4.5-orig/pppd/ipcp.h	2010-06-30 15:51:12.043682063 +0800
++++ ppp-2.4.5/pppd/ipcp.h	2010-06-30 16:40:49.586203129 +0800
+@@ -70,6 +70,7 @@
+     bool old_addrs;		/* Use old (IP-Addresses) option? */
+     bool req_addr;		/* Ask peer to send IP address? */
+     bool default_route;		/* Assign default route through interface? */
++    bool replace_default_route; /* Replace default route through interface? */
+     bool proxy_arp;		/* Make proxy ARP entry for peer? */
+     bool neg_vj;		/* Van Jacobson Compression? */
+     bool old_vj;		/* use old (short) form of VJ option? */
+diff -urN ppp-2.4.5-orig/pppd/pppd.8 ppp-2.4.5/pppd/pppd.8
+--- ppp-2.4.5-orig/pppd/pppd.8	2010-06-30 15:51:12.043682063 +0800
++++ ppp-2.4.5/pppd/pppd.8	2010-06-30 16:42:47.102413859 +0800
+@@ -121,6 +121,13 @@
+ This entry is removed when the PPP connection is broken.  This option
+ is privileged if the \fInodefaultroute\fR option has been specified.
+ .TP
++.B replacedefaultroute
++This option is a flag to the defaultroute option. If defaultroute is
++set and this flag is also set, pppd replaces an existing default route
++with the new default route.
++
++
++.TP
+ .B disconnect \fIscript
+ Execute the command specified by \fIscript\fR, by passing it to a
+ shell, after
+@@ -717,7 +724,12 @@
+ .TP
+ .B nodefaultroute
+ Disable the \fIdefaultroute\fR option.  The system administrator who
+-wishes to prevent users from creating default routes with pppd
++wishes to prevent users from adding a default route with pppd
++can do so by placing this option in the /etc/ppp/options file.
++.TP
++.B noreplacedefaultroute
++Disable the \fIreplacedefaultroute\fR option. The system administrator who
++wishes to prevent users from replacing a default route with pppd
+ can do so by placing this option in the /etc/ppp/options file.
+ .TP
+ .B nodeflate
+diff -urN ppp-2.4.5-orig/pppd/pppd.h ppp-2.4.5/pppd/pppd.h
+--- ppp-2.4.5-orig/pppd/pppd.h	2010-06-30 15:51:12.050166398 +0800
++++ ppp-2.4.5/pppd/pppd.h	2010-06-30 16:43:36.514148327 +0800
+@@ -643,7 +643,11 @@
+ int  cif6addr __P((int, eui64_t, eui64_t));
+ 				/* Remove an IPv6 address from i/f */
+ #endif
++#ifndef __linux__
+ int  sifdefaultroute __P((int, u_int32_t, u_int32_t));
++#else
++int  sifdefaultroute __P((int, u_int32_t, u_int32_t, bool replace_default_rt));
++#endif
+ 				/* Create default route through i/f */
+ int  cifdefaultroute __P((int, u_int32_t, u_int32_t));
+ 				/* Delete default route through i/f */
+diff -urN ppp-2.4.5-orig/pppd/sys-linux.c ppp-2.4.5/pppd/sys-linux.c
+--- ppp-2.4.5-orig/pppd/sys-linux.c	2010-06-30 15:51:12.050166398 +0800
++++ ppp-2.4.5/pppd/sys-linux.c	2010-06-30 16:54:00.362716231 +0800
+@@ -206,6 +206,8 @@
+ 
+ static int	if_is_up;	/* Interface has been marked up */
+ static int	have_default_route;	/* Gateway for default route added */
++static struct rtentry old_def_rt;       /* Old default route */
++static int       default_rt_repl_rest;  /* replace and restore old default rt */
+ static u_int32_t proxy_arp_addr;	/* Addr for proxy arp entry added */
+ static char proxy_arp_dev[16];		/* Device for proxy arp entry */
+ static u_int32_t our_old_addr;		/* for detecting address changes */
+@@ -1537,6 +1539,9 @@
+ 	p = NULL;
+     }
+ 
++    SET_SA_FAMILY (rt->rt_dst,     AF_INET);
++    SET_SA_FAMILY (rt->rt_gateway, AF_INET);
++
+     SIN_ADDR(rt->rt_dst) = strtoul(cols[route_dest_col], NULL, 16);
+     SIN_ADDR(rt->rt_gateway) = strtoul(cols[route_gw_col], NULL, 16);
+     SIN_ADDR(rt->rt_genmask) = strtoul(cols[route_mask_col], NULL, 16);
+@@ -1606,20 +1611,51 @@
+ /********************************************************************
+  *
+  * sifdefaultroute - assign a default route through the address given.
+- */
+-
+-int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway)
+-{
+-    struct rtentry rt;
+-
+-    if (defaultroute_exists(&rt) && strcmp(rt.rt_dev, ifname) != 0) {
+-	if (rt.rt_flags & RTF_GATEWAY)
+-	    error("not replacing existing default route via %I",
+-		  SIN_ADDR(rt.rt_gateway));
+-	else
+-	    error("not replacing existing default route through %s",
+-		  rt.rt_dev);
+-	return 0;
++ *
++ * If the global default_rt_repl_rest flag is set, then this function
++ * already replaced the original system defaultroute with some other
++ * route and it should just replace the current defaultroute with
++ * another one, without saving the current route. Use: demand mode,
++ * when pppd sets first a defaultroute it it's temporary ppp0 addresses
++ * and then changes the temporary addresses to the addresses for the real
++ * ppp connection when it has come up.
++ */
++
++int sifdefaultroute (int unit, u_int32_t ouraddr, u_int32_t gateway, bool replace)
++{
++    struct rtentry rt, tmp_rt;
++    struct rtentry *del_rt = NULL;
++
++    if (default_rt_repl_rest) {
++	/* We have already reclaced the original defaultroute, if we
++         * are called again, we will delete the current default route
++         * and set the new default route in this function.  
++         * - this is normally only the case the doing demand: */
++	if (defaultroute_exists( &tmp_rt ))
++		del_rt = &tmp_rt;
++    } else if ( defaultroute_exists( &old_def_rt                ) &&
++	                     strcmp(  old_def_rt.rt_dev, ifname ) != 0) {
++	/* We did not yet replace an existing default route, let's
++	 * check if we should save and replace a default route:
++         */
++	u_int32_t old_gateway = SIN_ADDR(old_def_rt.rt_gateway);
++	if (old_gateway != gateway) {
++	    if (!replace) {
++	        error("not replacing default route to %s [%I]",
++			old_def_rt.rt_dev, old_gateway);
++		return 0;
++	    } else {
++		// we need to copy rt_dev because we need it permanent too:
++		char * tmp_dev = malloc(strlen(old_def_rt.rt_dev)+1);
++		strcpy(tmp_dev, old_def_rt.rt_dev);
++		old_def_rt.rt_dev = tmp_dev;
++
++		notice("replacing old default route to %s [%I]",
++			old_def_rt.rt_dev, old_gateway);
++	        default_rt_repl_rest = 1;
++		del_rt = &old_def_rt;
++	    }
++	}
+     }
+ 
+     memset (&rt, 0, sizeof (rt));
+@@ -1638,6 +1674,12 @@
+ 	    error("default route ioctl(SIOCADDRT): %m");
+ 	return 0;
+     }
++    if (default_rt_repl_rest && del_rt)
++        if (ioctl(sock_fd, SIOCDELRT, del_rt) < 0) {
++	    if ( ! ok_error ( errno ))
++	        error("del old default route ioctl(SIOCDELRT): %m(%d)", errno);
++	    return 0;
++        }
+ 
+     have_default_route = 1;
+     return 1;
+@@ -1673,6 +1715,16 @@
+ 	    return 0;
+ 	}
+     }
++    if (default_rt_repl_rest) {
++	notice("restoring old default route to %s [%I]",
++			old_def_rt.rt_dev, SIN_ADDR(old_def_rt.rt_gateway));
++        if (ioctl(sock_fd, SIOCADDRT, &old_def_rt) < 0) {
++	    if ( ! ok_error ( errno ))
++	        error("restore default route ioctl(SIOCADDRT): %m(%d)", errno);
++	    return 0;
++        }
++        default_rt_repl_rest = 0;
++    }
+ 
+     return 1;
+ }
diff --git a/meta/recipes-connectivity/ppp/ppp/copts.patch b/meta/recipes-connectivity/ppp/ppp/copts.patch
new file mode 100644
index 0000000..53ff06e
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/copts.patch
@@ -0,0 +1,21 @@
+ppp: use build system CFLAGS when compiling
+
+Upstream-Status: Pending
+
+Override the hard-coded COPTS make variables with
+CFLAGS.  Add COPTS into one Makefile that did not
+use it.
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/pppd/plugins/radius/Makefile.linux
++++ b/pppd/plugins/radius/Makefile.linux
+@@ -12,7 +12,7 @@ VERSION = $(shell awk -F '"' '/VERSION/ 
+ INSTALL	= install
+ 
+ PLUGIN=radius.so radattr.so radrealms.so
+-CFLAGS=-I. -I../.. -I../../../include -O2 -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
++CFLAGS=-I. -I../.. -I../../../include $(COPTS) -fPIC -DRC_LOG_FACILITY=LOG_DAEMON
+ 
+ # Uncomment the next line to include support for Microsoft's
+ # MS-CHAP authentication protocol.
diff --git a/meta/recipes-connectivity/ppp/ppp/fix-CVE-2015-3310.patch b/meta/recipes-connectivity/ppp/ppp/fix-CVE-2015-3310.patch
new file mode 100644
index 0000000..c9edb30
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/fix-CVE-2015-3310.patch
@@ -0,0 +1,29 @@
+ppp: Buffer overflow in radius plugin
+
+From: https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;bug=782450
+
+Upstream-Status: Backport
+
+On systems with more than 65535 processes running, pppd aborts when
+sending a "start" accounting message to the RADIUS server because of a
+buffer overflow in rc_mksid.
+
+The process id is used in rc_mksid to generate a pseudo-unique string,
+assuming that the hex representation of the pid will be at most 4
+characters (FFFF). __sprintf_chk(), used when compiling with
+optimization levels greater than 0 and FORTIFY_SOURCE, detects the
+buffer overflow and makes pppd crash.
+
+The following patch fixes the problem.
+
+--- ppp-2.4.6.orig/pppd/plugins/radius/util.c
++++ ppp-2.4.6/pppd/plugins/radius/util.c
+@@ -77,7 +77,7 @@ rc_mksid (void)
+   static unsigned short int cnt = 0;
+   sprintf (buf, "%08lX%04X%02hX",
+ 	   (unsigned long int) time (NULL),
+-	   (unsigned int) getpid (),
++	   (unsigned int) getpid () % 65535,
+ 	   cnt & 0xFF);
+   cnt++;
+   return buf;
diff --git a/meta/recipes-connectivity/ppp/ppp/init b/meta/recipes-connectivity/ppp/ppp/init
new file mode 100755
index 0000000..0c01360
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/init
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+#   /etc/init.d/ppp: start or stop PPP link.
+#
+# If you want PPP started on boot time (most dialup systems won't need it)
+# rename the /etc/ppp/no_ppp_on_boot file to /etc/ppp/ppp_on_boot, and
+# follow the instructions in the comments in that file.
+
+# Source function library.
+. /etc/init.d/functions
+
+test -x /usr/sbin/pppd -a -f /etc/ppp/ppp_on_boot || exit 0
+if [ -x /etc/ppp/ppp_on_boot ]; then RUNFILE=1; fi
+
+case "$1" in
+  start)
+      echo -n "Starting up PPP link: pppd"
+      if [ "$RUNFILE" = "1" ]; then
+        /etc/ppp/ppp_on_boot
+      else
+        pppd call provider
+      fi
+      echo "."
+    ;;
+  stop)
+      echo -n "Shutting down PPP link: pppd"
+      if [ "$RUNFILE" = "1" ]; then
+        poff
+      else
+        poff provider
+      fi
+      echo "."
+    ;;
+  status)
+    status /usr/sbin/pppd;
+    exit $?
+    ;;
+  restart|force-reload)
+    echo -n "Restarting PPP link: pppd"
+    if [ "$RUNFILE" = "1" ]; then      
+      poff
+      sleep 5
+      /etc/ppp/ppp_on_boot
+    else                  
+      poff provider
+      sleep 5
+      pppd call provider
+    fi
+    echo "."
+    ;;
+  *)
+      echo "Usage: /etc/init.d/ppp {start|stop|status|restart|force-reload}"
+      exit 1
+    ;;
+esac
+
+exit 0
diff --git a/meta/recipes-connectivity/ppp/ppp/ip-down b/meta/recipes-connectivity/ppp/ppp/ip-down
new file mode 100755
index 0000000..06d3548
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/ip-down
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# $Id: ip-down,v 1.2 1998/02/10 21:21:55 phil Exp $
+#
+# This script is run by the pppd _after_ the link is brought down.
+# It uses run-parts to run scripts in /etc/ppp/ip-down.d, so to delete
+# routes, unset IP addresses etc. you should create script(s) there.
+#
+# Be aware that other packages may include /etc/ppp/ip-down.d scripts (named
+# after that package), so choose local script names with that in mind.
+#
+# This script is called with the following arguments:
+#    Arg  Name                          Example
+#    $1   Interface name                ppp0
+#    $2   The tty                       ttyS1
+#    $3   The link speed                38400
+#    $4   Local IP number               12.34.56.78
+#    $5   Peer  IP number               12.34.56.99
+#    $6   Optional ``ipparam'' value    foo
+
+# The  environment is cleared before executing this script
+# so the path must be reset
+PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
+export PATH
+# These variables are for the use of the scripts run by run-parts
+PPP_IFACE="$1"
+PPP_TTY="$2"
+PPP_SPEED="$3"
+PPP_LOCAL="$4"
+PPP_REMOTE="$5"
+PPP_IPPARAM="$6"
+export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
+
+# as an additional convenience, $PPP_TTYNAME is set to the tty name,
+# stripped of /dev/ (if present) for easier matching.
+PPP_TTYNAME=`/usr/bin/basename "$2"`
+export PPP_TTYNAME 
+
+# Main Script starts here
+
+run-parts /etc/ppp/ip-down.d
+
+# last line
diff --git a/meta/recipes-connectivity/ppp/ppp/ip-up b/meta/recipes-connectivity/ppp/ppp/ip-up
new file mode 100755
index 0000000..fc2fae9
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/ip-up
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# $Id: ip-up,v 1.2 1998/02/10 21:25:34 phil Exp $
+#
+# This script is run by the pppd after the link is established.
+# It uses run-parts to run scripts in /etc/ppp/ip-up.d, so to add routes,
+# set IP address, run the mailq etc. you should create script(s) there.
+#
+# Be aware that other packages may include /etc/ppp/ip-up.d scripts (named
+# after that package), so choose local script names with that in mind.
+#
+# This script is called with the following arguments:
+#    Arg  Name                          Example
+#    $1   Interface name                ppp0
+#    $2   The tty                       ttyS1
+#    $3   The link speed                38400
+#    $4   Local IP number               12.34.56.78
+#    $5   Peer  IP number               12.34.56.99
+#    $6   Optional ``ipparam'' value    foo
+
+# The  environment is cleared before executing this script
+# so the path must be reset
+PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
+export PATH
+# These variables are for the use of the scripts run by run-parts
+PPP_IFACE="$1"
+PPP_TTY="$2"
+PPP_SPEED="$3"
+PPP_LOCAL="$4"
+PPP_REMOTE="$5"
+PPP_IPPARAM="$6"
+export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
+
+
+# as an additional convenience, $PPP_TTYNAME is set to the tty name,
+# stripped of /dev/ (if present) for easier matching.
+PPP_TTYNAME=`/usr/bin/basename "$2"`
+export PPP_TTYNAME 
+
+# Main Script starts here
+
+run-parts /etc/ppp/ip-up.d
+
+# last line
diff --git a/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch b/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch
new file mode 100644
index 0000000..d59717e
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/makefile-remove-hard-usr-reference.patch
@@ -0,0 +1,37 @@
+The patch comes from OpenEmbedded.
+Rebased for ppp-2.4.5. Dongxiao Xu <dongxiao.xu@intel.com>
+
+Updated from OE-Classic to include the pcap hunk.
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+Upstream-Status: Inappropriate [configuration]
+
+diff -urN ppp-2.4.5-orig/pppd/Makefile.linux ppp-2.4.5/pppd/Makefile.linux
+--- ppp-2.4.5-orig/pppd/Makefile.linux	2010-06-30 15:51:12.043682063 +0800
++++ ppp-2.4.5/pppd/Makefile.linux	2010-06-30 17:08:21.806363042 +0800
+@@ -117,10 +117,10 @@
+ #LIBS     += -lshadow $(LIBS)
+ endif
+ 
+-ifneq ($(wildcard /usr/include/crypt.h),)
++#ifneq ($(wildcard /usr/include/crypt.h),)
+ CFLAGS  += -DHAVE_CRYPT_H=1
+ LIBS	+= -lcrypt
+-endif
++#endif
+ 
+ ifdef NEEDDES
+ ifndef USE_CRYPT
+@@ -169,10 +169,10 @@
+ endif
+ 
+ ifdef FILTER
+-ifneq ($(wildcard /usr/include/pcap-bpf.h),)
++#ifneq ($(wildcard /usr/include/pcap-bpf.h),)
+ LIBS    += -lpcap
+ CFLAGS  += -DPPP_FILTER
+-endif
++#endif
+ endif
+ 
+ ifdef HAVE_INET6
diff --git a/meta/recipes-connectivity/ppp/ppp/makefile.patch b/meta/recipes-connectivity/ppp/ppp/makefile.patch
new file mode 100644
index 0000000..2d09baf
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/makefile.patch
@@ -0,0 +1,95 @@
+The patch comes from OpenEmbedded
+Rebased for ppp-2.4.5. Dongxiao Xu <dongxiao.xu@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN ppp-2.4.5-orig/chat/Makefile.linux ppp-2.4.5/chat/Makefile.linux
+--- ppp-2.4.5-orig/chat/Makefile.linux	2010-06-30 15:51:12.050166398 +0800
++++ ppp-2.4.5/chat/Makefile.linux	2010-06-30 15:51:30.450118446 +0800
+@@ -25,7 +25,7 @@
+ 
+ install: chat
+ 	mkdir -p $(BINDIR) $(MANDIR)
+-	$(INSTALL) -s -c chat $(BINDIR)
++	$(INSTALL) -c chat $(BINDIR)
+ 	$(INSTALL) -c -m 644 chat.8 $(MANDIR)
+ 
+ clean:
+diff -ruN ppp-2.4.5-orig/pppd/Makefile.linux ppp-2.4.5/pppd/Makefile.linux
+--- ppp-2.4.5-orig/pppd/Makefile.linux	2010-06-30 15:51:12.043682063 +0800
++++ ppp-2.4.5/pppd/Makefile.linux	2010-06-30 15:52:11.214170607 +0800
+@@ -99,7 +99,7 @@
+ CFLAGS	+= -DUSE_SRP -DOPENSSL -I/usr/local/ssl/include
+ LIBS	+= -lsrp -L/usr/local/ssl/lib -lcrypto
+ TARGETS	+= srp-entry
+-EXTRAINSTALL = $(INSTALL) -s -c -m 555 srp-entry $(BINDIR)/srp-entry
++EXTRAINSTALL = $(INSTALL) -c -m 555 srp-entry $(BINDIR)/srp-entry
+ MANPAGES += srp-entry.8
+ EXTRACLEAN += srp-entry.o
+ NEEDDES=y
+@@ -200,7 +200,7 @@
+ install: pppd
+ 	mkdir -p $(BINDIR) $(MANDIR)
+ 	$(EXTRAINSTALL)
+-	$(INSTALL) -s -c -m 555 pppd $(BINDIR)/pppd
++	$(INSTALL) -c -m 555 pppd $(BINDIR)/pppd
+ 	if chgrp pppusers $(BINDIR)/pppd 2>/dev/null; then \
+ 	  chmod o-rx,u+s $(BINDIR)/pppd; fi
+ 	$(INSTALL) -c -m 444 pppd.8 $(MANDIR)
+diff -ruN ppp-2.4.5-orig/pppd/plugins/radius/Makefile.linux ppp-2.4.5/pppd/plugins/radius/Makefile.linux
+--- ppp-2.4.5-orig/pppd/plugins/radius/Makefile.linux	2010-06-30 15:51:12.047676187 +0800
++++ ppp-2.4.5/pppd/plugins/radius/Makefile.linux	2010-06-30 15:53:47.750182267 +0800
+@@ -36,11 +36,11 @@
+ 
+ install: all
+ 	$(INSTALL) -d -m 755 $(LIBDIR)
+-	$(INSTALL) -s -c -m 755 radius.so $(LIBDIR)
+-	$(INSTALL) -s -c -m 755 radattr.so $(LIBDIR)
+-	$(INSTALL) -s -c -m 755 radrealms.so $(LIBDIR)
+-	$(INSTALL) -c -m 444 pppd-radius.8 $(MANDIR)
+-	$(INSTALL) -c -m 444 pppd-radattr.8 $(MANDIR)
++	$(INSTALL) -c -m 755 radius.so $(LIBDIR)
++	$(INSTALL) -c -m 755 radattr.so $(LIBDIR)
++	$(INSTALL) -c -m 755 radrealms.so $(LIBDIR)
++	$(INSTALL) -m 444 pppd-radius.8 $(MANDIR)
++	$(INSTALL) -m 444 pppd-radattr.8 $(MANDIR)
+ 
+ radius.so: radius.o libradiusclient.a
+ 	$(CC) -o radius.so -shared radius.o libradiusclient.a
+diff -ruN ppp-2.4.5-orig/pppd/plugins/rp-pppoe/Makefile.linux ppp-2.4.5/pppd/plugins/rp-pppoe/Makefile.linux
+--- ppp-2.4.5-orig/pppd/plugins/rp-pppoe/Makefile.linux	2010-06-30 15:51:12.047676187 +0800
++++ ppp-2.4.5/pppd/plugins/rp-pppoe/Makefile.linux	2010-06-30 15:53:15.454486877 +0800
+@@ -43,9 +43,9 @@
+ 
+ install: all
+ 	$(INSTALL) -d -m 755 $(LIBDIR)
+-	$(INSTALL) -s -c -m 4550 rp-pppoe.so $(LIBDIR)
++	$(INSTALL) -c -m 4550 rp-pppoe.so $(LIBDIR)
+ 	$(INSTALL) -d -m 755 $(BINDIR)
+-	$(INSTALL) -s -c -m 555 pppoe-discovery $(BINDIR)
++	$(INSTALL) -c -m 555 pppoe-discovery $(BINDIR)
+ 
+ clean:
+ 	rm -f *.o *.so pppoe-discovery
+diff -ruN ppp-2.4.5-orig/pppdump/Makefile.linux ppp-2.4.5/pppdump/Makefile.linux
+--- ppp-2.4.5-orig/pppdump/Makefile.linux	2010-06-30 15:51:12.058183383 +0800
++++ ppp-2.4.5/pppdump/Makefile.linux	2010-06-30 15:52:25.762183537 +0800
+@@ -17,5 +17,5 @@
+ 
+ install:
+ 	mkdir -p $(BINDIR) $(MANDIR)
+-	$(INSTALL) -s -c pppdump $(BINDIR)
++	$(INSTALL) -c pppdump $(BINDIR)
+ 	$(INSTALL) -c -m 444 pppdump.8 $(MANDIR)
+diff -ruN ppp-2.4.5-orig/pppstats/Makefile.linux ppp-2.4.5/pppstats/Makefile.linux
+--- ppp-2.4.5-orig/pppstats/Makefile.linux	2010-06-30 15:51:12.058183383 +0800
++++ ppp-2.4.5/pppstats/Makefile.linux	2010-06-30 15:52:42.486341081 +0800
+@@ -22,7 +22,7 @@
+ 
+ install: pppstats
+ 	-mkdir -p $(MANDIR)
+-	$(INSTALL) -s -c pppstats $(BINDIR)
++	$(INSTALL) -c pppstats $(BINDIR)
+ 	$(INSTALL) -c -m 444 pppstats.8 $(MANDIR)
+ 
+ pppstats: $(PPPSTATSRCS)
diff --git a/meta/recipes-connectivity/ppp/ppp/pap b/meta/recipes-connectivity/ppp/ppp/pap
new file mode 100644
index 0000000..093c326
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/pap
@@ -0,0 +1,22 @@
+# You can use this script unmodified to connect to sites which allow
+# authentication via PAP, CHAP and similar protocols.
+# This script can be shared among different pppd peer configurations.
+# To use it, add something like this to your /etc/ppp/peers/ file:
+#
+# connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T PHONE-NUMBER"
+# user YOUR-USERNAME-IN-PAP-SECRETS
+# noauth
+
+# Uncomment the following line to see the connect speed.
+# It will be logged to stderr or to the file specified with the -r chat option.
+#REPORT		CONNECT
+
+ABORT		BUSY
+ABORT		VOICE
+ABORT		"NO CARRIER"
+ABORT		"NO DIALTONE"
+ABORT		"NO DIAL TONE"
+""		ATZ
+OK		ATDT\T
+CONNECT		""
+
diff --git a/meta/recipes-connectivity/ppp/ppp/poff b/meta/recipes-connectivity/ppp/ppp/poff
new file mode 100644
index 0000000..0521a94
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/poff
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Lets see how many pppds are running....
+set -- `cat /var/run/ppp*.pid 2>/dev/null`
+
+case $# in
+  0) # pppd only creates a pid file once ppp is up, so let's try killing pppd
+     # on the assumption that we've not got that far yet.
+     killall pppd
+     ;;
+  1) # If only one was running then it can be killed (apparently killall
+     # caused problems for some, so lets try killing the pid from the file)
+     kill $1
+     ;;
+  *) # More than one! Aieehh.. Dont know which one to kill.
+     echo "More than one pppd running. None stopped"
+     exit 1
+     ;;
+esac
+
+if [ -r /var/run/ppp-quick ]
+then
+    rm -f /var/run/ppp-quick
+fi
+
+exit 0
diff --git a/meta/recipes-connectivity/ppp/ppp/pon b/meta/recipes-connectivity/ppp/ppp/pon
new file mode 100644
index 0000000..91c0595
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/pon
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ "$1" = "quick" ]
+then
+    touch /var/run/ppp-quick
+    shift
+fi
+
+/usr/sbin/pppd call ${1:-provider}
diff --git a/meta/recipes-connectivity/ppp/ppp/ppp@.service b/meta/recipes-connectivity/ppp/ppp/ppp@.service
new file mode 100644
index 0000000..2bf0b5e
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/ppp@.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=PPP link to %I
+Before=network.target
+
+[Service]
+ExecStart=@SBINDIR@/pppd call %I nodetach nolog
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/ppp/ppp/ppp_on_boot b/meta/recipes-connectivity/ppp/ppp/ppp_on_boot
new file mode 100644
index 0000000..9793761
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/ppp_on_boot
@@ -0,0 +1,21 @@
+###!/bin/sh
+#
+#   Rename this file to ppp_on_boot and pppd will be fired up as
+#   soon as the system comes up, connecting to `provider'.
+#
+#   If you also make this file executable, and replace the first line
+#   with just "#!/bin/sh", the commands below will be executed instead.
+#
+
+# The location of the ppp daemon itself (shouldn't need to be changed)
+PPPD=/usr/sbin/pppd
+
+# The default provider to connect to
+$PPPD call provider
+
+# Additional connections, which would just use settings from
+# /etc/ppp/options.<tty>
+#$PPPD ttyS0
+#$PPPD ttyS1
+#$PPPD ttyS2
+#$PPPD ttyS3
diff --git a/meta/recipes-connectivity/ppp/ppp/pppd-resolv-varrun.patch b/meta/recipes-connectivity/ppp/ppp/pppd-resolv-varrun.patch
new file mode 100644
index 0000000..a72414f
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/pppd-resolv-varrun.patch
@@ -0,0 +1,45 @@
+The patch comes from OpenEmbedded
+Rebased for ppp-2.4.5. Dongxiao Xu <dongxiao.xu@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+
+diff -ruN ppp-2.4.5-orig/pppd/ipcp.c ppp-2.4.5/pppd/ipcp.c
+--- ppp-2.4.5-orig/pppd/ipcp.c	2010-06-30 15:51:12.050166398 +0800
++++ ppp-2.4.5/pppd/ipcp.c	2010-06-30 17:02:33.930393283 +0800
+@@ -55,6 +55,8 @@
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
++#include <sys/stat.h>
++#include <unistd.h>
+ 
+ #include "pppd.h"
+ #include "fsm.h"
+@@ -2095,6 +2097,14 @@
+     u_int32_t peerdns1, peerdns2;
+ {
+     FILE *f;
++    struct stat dirinfo;
++
++    if(stat(_PATH_OUTDIR, &dirinfo)) {
++        if(mkdir(_PATH_OUTDIR, 0775)) {
++            error("Failed to create directory %s: %m", _PATH_OUTDIR);
++            return;
++        }
++    }
+ 
+     f = fopen(_PATH_RESOLV, "w");
+     if (f == NULL) {
+diff -ruN ppp-2.4.5-orig/pppd/pathnames.h ppp-2.4.5/pppd/pathnames.h
+--- ppp-2.4.5-orig/pppd/pathnames.h	2010-06-30 15:51:12.043682063 +0800
++++ ppp-2.4.5/pppd/pathnames.h	2010-06-30 17:03:20.594371055 +0800
+@@ -30,7 +30,8 @@
+ #define _PATH_TTYOPT	 _ROOT_PATH "/etc/ppp/options."
+ #define _PATH_CONNERRS	 _ROOT_PATH "/etc/ppp/connect-errors"
+ #define _PATH_PEERFILES	 _ROOT_PATH "/etc/ppp/peers/"
+-#define _PATH_RESOLV	 _ROOT_PATH "/etc/ppp/resolv.conf"
++#define _PATH_OUTDIR	_ROOT_PATH _PATH_VARRUN "/ppp"
++#define _PATH_RESOLV	_PATH_OUTDIR "/resolv.conf"
+ 
+ #define _PATH_USEROPT	 ".ppprc"
+ #define	_PATH_PSEUDONYM	 ".ppp_pseudonym"
diff --git a/meta/recipes-connectivity/ppp/ppp/provider b/meta/recipes-connectivity/ppp/ppp/provider
new file mode 100644
index 0000000..e74d71a
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp/provider
@@ -0,0 +1,35 @@
+# example configuration for a dialup connection authenticated with PAP or CHAP
+#
+# This is the default configuration used by pon(1) and poff(1).
+# See the manual page pppd(8) for information on all the options.
+
+# MUST CHANGE: replace myusername@realm with the PPP login name given to
+# your by your provider.
+# There should be a matching entry with the password in /etc/ppp/pap-secrets
+# and/or /etc/ppp/chap-secrets.
+user "myusername@realm"
+
+# MUST CHANGE: replace ******** with the phone number of your provider.
+# The /etc/chatscripts/pap chat script may be modified to change the
+# modem initialization string.
+connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T ********"
+
+# Serial device to which the modem is connected.
+/dev/modem
+
+# Speed of the serial line.
+115200
+
+# Assumes that your IP address is allocated dynamically by the ISP.
+noipdefault
+# Try to get the name server addresses from the ISP.
+usepeerdns
+# Use this connection as the default route.
+defaultroute
+
+# Makes pppd "dial again" when the connection is lost.
+persist
+
+# Do not ask the remote to authenticate.
+noauth
+
diff --git a/meta/recipes-connectivity/ppp/ppp_2.4.7.bb b/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
new file mode 100644
index 0000000..adc38e1
--- /dev/null
+++ b/meta/recipes-connectivity/ppp/ppp_2.4.7.bb
@@ -0,0 +1,97 @@
+SUMMARY = "Point-to-Point Protocol (PPP) support"
+DESCRIPTION = "ppp (Paul's PPP Package) is an open source package which implements \
+the Point-to-Point Protocol (PPP) on Linux and Solaris systems."
+SECTION = "console/network"
+HOMEPAGE = "http://samba.org/ppp/"
+BUGTRACKER = "http://ppp.samba.org/cgi-bin/ppp-bugs"
+DEPENDS = "libpcap"
+LICENSE = "BSD & GPLv2+ & LGPLv2+ & PD"
+LIC_FILES_CHKSUM = "file://pppd/ccp.c;beginline=1;endline=29;md5=e2c43fe6e81ff77d87dc9c290a424dea \
+                    file://pppd/plugins/passprompt.c;beginline=1;endline=10;md5=3bcbcdbf0e369c9a3e0b8c8275b065d8 \
+                    file://pppd/tdb.c;beginline=1;endline=27;md5=4ca3a9991b011038d085d6675ae7c4e6 \
+                    file://chat/chat.c;beginline=1;endline=15;md5=0d374b8545ee5c62d7aff1acbd38add2"
+
+SRC_URI = "http://ppp.samba.org/ftp/ppp/ppp-${PV}.tar.gz \
+           file://makefile.patch \
+           file://cifdefroute.patch \
+           file://pppd-resolv-varrun.patch \
+           file://makefile-remove-hard-usr-reference.patch \
+           file://pon \
+           file://poff \
+           file://init \
+           file://ip-up \
+           file://ip-down \
+           file://08setupdns \
+           file://92removedns \
+           file://copts.patch \
+           file://pap \
+           file://ppp_on_boot \
+           file://provider \
+           file://0001-ppp-Fix-compilation-errors-in-Makefile.patch \
+           file://ppp@.service \
+           file://fix-CVE-2015-3310.patch \
+"
+
+SRC_URI[md5sum] = "78818f40e6d33a1d1de68a1551f6595a"
+SRC_URI[sha256sum] = "02e0a3dd3e4799e33103f70ec7df75348c8540966ee7c948e4ed8a42bbccfb30"
+
+inherit autotools-brokensep systemd
+
+TARGET_CC_ARCH += " ${LDFLAGS}"
+EXTRA_OEMAKE = "STRIPPROG=${STRIP} MANDIR=${D}${datadir}/man/man8 INCDIR=${D}${includedir} LIBDIR=${D}${libdir}/pppd/${PV} BINDIR=${D}${sbindir}"
+EXTRA_OECONF = "--disable-strip"
+
+# Package Makefile computes CFLAGS, referencing COPTS.
+# Typically hard-coded to '-O2 -g' in the Makefile's.
+#
+EXTRA_OEMAKE += ' COPTS="${CFLAGS} -I${S}/include"'
+
+do_configure () {
+	oe_runconf
+}
+
+do_install_append () {
+	make install-etcppp ETCDIR=${D}/${sysconfdir}/ppp
+	mkdir -p ${D}${bindir}/ ${D}${sysconfdir}/init.d
+	mkdir -p ${D}${sysconfdir}/ppp/ip-up.d/
+	mkdir -p ${D}${sysconfdir}/ppp/ip-down.d/
+	install -m 0755 ${WORKDIR}/pon ${D}${bindir}/pon
+	install -m 0755 ${WORKDIR}/poff ${D}${bindir}/poff
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/ppp
+	install -m 0755 ${WORKDIR}/ip-up ${D}${sysconfdir}/ppp/
+	install -m 0755 ${WORKDIR}/ip-down ${D}${sysconfdir}/ppp/
+	install -m 0755 ${WORKDIR}/08setupdns ${D}${sysconfdir}/ppp/ip-up.d/
+	install -m 0755 ${WORKDIR}/92removedns ${D}${sysconfdir}/ppp/ip-down.d/
+	mkdir -p ${D}${sysconfdir}/chatscripts
+	mkdir -p ${D}${sysconfdir}/ppp/peers
+	install -m 0755 ${WORKDIR}/pap ${D}${sysconfdir}/chatscripts
+	install -m 0755 ${WORKDIR}/ppp_on_boot ${D}${sysconfdir}/ppp/ppp_on_boot
+	install -m 0755 ${WORKDIR}/provider ${D}${sysconfdir}/ppp/peers/provider
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/ppp@.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' \
+	       ${D}${systemd_unitdir}/system/ppp@.service
+	rm -rf ${D}/${mandir}/man8/man8
+	chmod u+s ${D}${sbindir}/pppd
+}
+
+CONFFILES_${PN} = "${sysconfdir}/ppp/pap-secrets ${sysconfdir}/ppp/chap-secrets ${sysconfdir}/ppp/options"
+PACKAGES =+ "${PN}-oa ${PN}-oe ${PN}-radius ${PN}-winbind ${PN}-minconn ${PN}-password ${PN}-l2tp ${PN}-tools"
+FILES_${PN}        = "${sysconfdir} ${bindir} ${sbindir}/chat ${sbindir}/pppd ${systemd_unitdir}/system/ppp@.service"
+FILES_${PN}-dbg += "${libdir}/pppd/${PV}/.debug"
+FILES_${PN}-oa       = "${libdir}/pppd/${PV}/pppoatm.so"
+FILES_${PN}-oe       = "${sbindir}/pppoe-discovery ${libdir}/pppd/${PV}/rp-pppoe.so"
+FILES_${PN}-radius   = "${libdir}/pppd/${PV}/radius.so ${libdir}/pppd/${PV}/radattr.so ${libdir}/pppd/${PV}/radrealms.so"
+FILES_${PN}-winbind  = "${libdir}/pppd/${PV}/winbind.so"
+FILES_${PN}-minconn  = "${libdir}/pppd/${PV}/minconn.so"
+FILES_${PN}-password = "${libdir}/pppd/${PV}/pass*.so"
+FILES_${PN}-l2tp     = "${libdir}/pppd/${PV}/*l2tp.so"
+FILES_${PN}-tools    = "${sbindir}/pppstats ${sbindir}/pppdump"
+SUMMARY_${PN}-oa       = "Plugin for PPP for PPP-over-ATM support"
+SUMMARY_${PN}-oe       = "Plugin for PPP for PPP-over-Ethernet support"
+SUMMARY_${PN}-radius   = "Plugin for PPP for RADIUS support"
+SUMMARY_${PN}-winbind  = "Plugin for PPP to authenticate against Samba or Windows"
+SUMMARY_${PN}-minconn  = "Plugin for PPP to set a delay before the idle timeout applies"
+SUMMARY_${PN}-password = "Plugin for PPP to get passwords via a pipe"
+SUMMARY_${PN}-l2tp     = "Plugin for PPP for l2tp support"
+SUMMARY_${PN}-tools    = "Additional tools for the PPP package"
diff --git a/meta/recipes-connectivity/resolvconf/resolvconf/99_resolvconf b/meta/recipes-connectivity/resolvconf/resolvconf/99_resolvconf
new file mode 100644
index 0000000..3790d77
--- /dev/null
+++ b/meta/recipes-connectivity/resolvconf/resolvconf/99_resolvconf
@@ -0,0 +1,4 @@
+d root root 0755 /var/run/resolvconf/interface none
+f root root 0644 /etc/resolvconf/run/resolv.conf none
+f root root 0644 /etc/resolvconf/run/enable-updates none
+l root root 0644 /etc/resolv.conf /etc/resolvconf/run/resolv.conf
diff --git a/meta/recipes-connectivity/resolvconf/resolvconf/fix-path-for-busybox.patch b/meta/recipes-connectivity/resolvconf/resolvconf/fix-path-for-busybox.patch
new file mode 100644
index 0000000..1aead07
--- /dev/null
+++ b/meta/recipes-connectivity/resolvconf/resolvconf/fix-path-for-busybox.patch
@@ -0,0 +1,20 @@
+
+busybox installs readlink into /usr/bin, so ensure /usr/bin
+is in the path.
+
+Upstream-Status: Submitted
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: resolvconf-1.76/etc/resolvconf/update.d/libc
+===================================================================
+--- resolvconf-1.76.orig/etc/resolvconf/update.d/libc
++++ resolvconf-1.76/etc/resolvconf/update.d/libc
+@@ -16,7 +16,7 @@
+ #
+ 
+ set -e
+-PATH=/sbin:/bin
++PATH=/sbin:/bin:/usr/bin
+ 
+ [ -x /lib/resolvconf/list-records ] || exit 1
+ 
diff --git a/meta/recipes-connectivity/resolvconf/resolvconf_1.77.bb b/meta/recipes-connectivity/resolvconf/resolvconf_1.77.bb
new file mode 100644
index 0000000..916b9f2
--- /dev/null
+++ b/meta/recipes-connectivity/resolvconf/resolvconf_1.77.bb
@@ -0,0 +1,63 @@
+SUMMARY = "name server information handler"
+DESCRIPTION = "Resolvconf is a framework for keeping track of the system's \
+information about currently available nameservers. It sets \
+itself up as the intermediary between programs that supply \
+nameserver information and programs that need nameserver \
+information."
+SECTION = "console/network"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
+AUTHOR = "Thomas Hood"
+HOMEPAGE = "http://packages.debian.org/resolvconf"
+RDEPENDS_${PN} = "bash"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20150511T214718Z/pool/main/r/${BPN}/${BPN}_${PV}.tar.xz \
+           file://fix-path-for-busybox.patch \
+           file://99_resolvconf \
+          "
+
+SRC_URI[md5sum] = "7362d766e47bfc253500f42b30330d9f"
+SRC_URI[sha256sum] = "5a6e21e8ba6822a5f93075c8c8fe7977e34780ba551af51930d0b31fdd99ab56"
+
+inherit allarch
+
+do_compile () {
+	:
+}
+
+do_install () {
+	install -d ${D}${sysconfdir}/default/volatiles
+	install -m 0644 ${WORKDIR}/99_resolvconf ${D}${sysconfdir}/default/volatiles
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		install -d ${D}${sysconfdir}/tmpfiles.d
+		echo "d /run/${BPN}/interface - - - -" \
+		     > ${D}${sysconfdir}/tmpfiles.d/resolvconf.conf
+	fi
+	install -d ${D}${base_libdir}/${BPN}
+	install -d ${D}${sysconfdir}/${BPN}
+	ln -snf ${localstatedir}/run/${BPN} ${D}${sysconfdir}/${BPN}/run
+	install -d ${D}${sysconfdir} ${D}${base_sbindir}
+	install -d ${D}${mandir}/man8 ${D}${docdir}/${P}
+	cp -pPR etc/* ${D}${sysconfdir}/
+	chown -R root:root ${D}${sysconfdir}/
+	install -m 0755 bin/resolvconf ${D}${base_sbindir}/
+	install -m 0755 bin/list-records ${D}${base_libdir}/${BPN}
+	install -d ${D}/${sysconfdir}/network/if-up.d
+	install -m 0755 debian/resolvconf.000resolvconf.if-up ${D}/${sysconfdir}/network/if-up.d/000resolvconf
+	install -d ${D}/${sysconfdir}/network/if-down.d
+	install -m 0755 debian/resolvconf.resolvconf.if-down ${D}/${sysconfdir}/network/if-down.d/resolvconf
+	install -m 0644 README ${D}${docdir}/${P}/
+	install -m 0644 man/resolvconf.8 ${D}${mandir}/man8/
+}
+
+pkg_postinst_${PN} () {
+	if [ -z "$D" ]; then
+		if command -v systemd-tmpfiles >/dev/null; then
+			systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/resolvconf.conf
+		elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+			${sysconfdir}/init.d/populate-volatile.sh update
+		fi
+	fi
+}
+
+FILES_${PN} += "${base_libdir}/${BPN}"
diff --git a/meta/recipes-connectivity/socat/socat/Makefile.in-fix-for-parallel-build.patch b/meta/recipes-connectivity/socat/socat/Makefile.in-fix-for-parallel-build.patch
new file mode 100644
index 0000000..aa4db65
--- /dev/null
+++ b/meta/recipes-connectivity/socat/socat/Makefile.in-fix-for-parallel-build.patch
@@ -0,0 +1,35 @@
+From c6f0080b55679b6e8b5d332d6e05fdcbda1e4064 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 4 May 2015 00:58:47 -0700
+Subject: [PATCH] Makefile.in: fix for parallel build
+
+Fixed:
+vsnprintf_r.o: file not recognized: File truncated
+collect2: error: ld returned 3 exit status
+Makefile:122: recipe for target 'filan' failed
+
+Let filan depend on vsnprintf_r.o and snprinterr.o to fix the issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index f2a6edb..88b784b 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -118,7 +118,7 @@ PROCAN_OBJS=procan_main.o procan.o procan-cdefs.o hostan.o error.o sycls.o sysut
+ procan: $(PROCAN_OBJS)
+ 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(PROCAN_OBJS) $(CLIBS)
+ 
+-filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o
++filan: filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o vsnprintf_r.o snprinterr.o
+ 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ filan_main.o filan.o fdname.o error.o sycls.o sysutils.o utils.o vsnprintf_r.o snprinterr.o $(CLIBS)
+ 
+ libxio.a: $(XIOOBJS) $(UTLOBJS)
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/socat/socat_1.7.3.0.bb b/meta/recipes-connectivity/socat/socat_1.7.3.0.bb
new file mode 100644
index 0000000..b58e0a7
--- /dev/null
+++ b/meta/recipes-connectivity/socat/socat_1.7.3.0.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Multipurpose relay for bidirectional data transfer"
+DESCRIPTION = "Socat is a relay for bidirectional data \
+transfer between two independent data channels."
+HOMEPAGE = "http://www.dest-unreach.org/socat/"
+
+SECTION = "console/network"
+
+DEPENDS = "openssl readline"
+
+LICENSE = "GPL-2.0+-with-OpenSSL-exception"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://README;beginline=257;endline=287;md5=338c05eadd013872abb1d6e198e10a3f"
+
+
+SRC_URI = "http://www.dest-unreach.org/socat/download/socat-${PV}.tar.bz2 \
+           file://Makefile.in-fix-for-parallel-build.patch \
+"
+
+SRC_URI[md5sum] = "b607edb65bc6c57f4a43f06247504274"
+SRC_URI[sha256sum] = "0767e850c0329b9fdf711c6cd468565cbbb28786ba1a8a1cbd5531d4016b3e04"
+
+inherit autotools
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+EXTRA_OECONF += "ac_cv_have_z_modifier=yes sc_cv_sys_crdly_shift=9 \
+        sc_cv_sys_tabdly_shift=11 sc_cv_sys_csize_shift=4 \
+        ac_cv_ispeed_offset=13 \
+        ac_cv_header_bsd_libutil_h=no \
+"
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+
+do_install_prepend () {
+    mkdir -p ${D}${bindir}
+    install -d ${D}${bindir} ${D}${mandir}/man1
+}
diff --git a/meta/recipes-connectivity/wireless-tools/wireless-tools/avoid_strip.patch b/meta/recipes-connectivity/wireless-tools/wireless-tools/avoid_strip.patch
new file mode 100644
index 0000000..f34e243
--- /dev/null
+++ b/meta/recipes-connectivity/wireless-tools/wireless-tools/avoid_strip.patch
@@ -0,0 +1,21 @@
+wireless_tools: Avoid stripping iwmulticall
+
+Upstream-Status: Inappropriate [other]
+  The removed code was from upstream.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur wireless_tools.29.orig/Makefile wireless_tools.29/Makefile
+--- wireless_tools.29.orig/Makefile	2011-06-18 11:35:12.183907453 -0500
++++ wireless_tools.29/Makefile	2011-06-18 11:38:09.995907985 -0500
+@@ -135,9 +135,8 @@
+ 
+ macaddr: macaddr.o $(IWLIB)
+ 
+-# Always do symbol stripping here
+ iwmulticall: iwmulticall.o
+-	$(CC) $(LDFLAGS) -Wl,-s $(XCFLAGS) -o $@ $^ $(LIBS)
++	$(CC) $(LDFLAGS) $(STRIPFLAGS) $(XCFLAGS) -o $@ $^ $(LIBS)
+ 
+ # It's a kind of magic...
+ wireless.h:
diff --git a/meta/recipes-connectivity/wireless-tools/wireless-tools/ldflags.patch b/meta/recipes-connectivity/wireless-tools/wireless-tools/ldflags.patch
new file mode 100644
index 0000000..6c0d8cb
--- /dev/null
+++ b/meta/recipes-connectivity/wireless-tools/wireless-tools/ldflags.patch
@@ -0,0 +1,22 @@
+wireless-tools: Remove QA warning: No GNU_HASH in the elf binary
+
+Upstream-Status: Inappropriate [other]
+  Useful within bitbake environment only.
+
+Signed-off-by: Muhammad Shakeel <muhammad_shakeel@mentor.com>
+
+---
+ Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- wireless_tools.29.orig/Makefile
++++ wireless_tools.29/Makefile
+@@ -144,7 +144,7 @@ wireless.h:
+ 
+ # Compilation of the dynamic library
+ $(DYNAMIC): $(OBJS:.o=.so)
+-	$(CC) -shared -o $@ -Wl,-soname,$@ $(STRIPFLAGS) $(LIBS) -lc $^
++	$(CC) -shared -o $@ -Wl,-soname,$@ $(LDFLAGS) $(STRIPFLAGS) $(LIBS) -lc $^
+ 
+ # Compilation of the static library
+ $(STATIC): $(OBJS:.o=.so)
diff --git a/meta/recipes-connectivity/wireless-tools/wireless-tools/man.patch b/meta/recipes-connectivity/wireless-tools/wireless-tools/man.patch
new file mode 100644
index 0000000..6a757da
--- /dev/null
+++ b/meta/recipes-connectivity/wireless-tools/wireless-tools/man.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: wireless_tools.30/Makefile
+===================================================================
+--- wireless_tools.30.orig/Makefile	2014-02-01 00:21:04.148463382 -0800
++++ wireless_tools.30/Makefile	2014-02-01 00:23:35.448072279 -0800
+@@ -76,7 +76,7 @@
+ INSTALL_DIR= $(PREFIX)/sbin
+ INSTALL_LIB= $(PREFIX)/lib
+ INSTALL_INC= $(PREFIX)/include
+-INSTALL_MAN= $(PREFIX)/man
++INSTALL_MAN= $(PREFIX)/share/man
+ 
+ # Various commands
+ RM = rm -f
diff --git a/meta/recipes-connectivity/wireless-tools/wireless-tools/remove.ldconfig.call.patch b/meta/recipes-connectivity/wireless-tools/wireless-tools/remove.ldconfig.call.patch
new file mode 100644
index 0000000..3a22c3f
--- /dev/null
+++ b/meta/recipes-connectivity/wireless-tools/wireless-tools/remove.ldconfig.call.patch
@@ -0,0 +1,19 @@
+When /etc/ld.so.cache is writeable by user running bitbake then it creates invalid cache 
+(in my case libstdc++.so cannot be found after building zlib(-native) and I have to call 
+touch */libstdc++.so && /sbin/ldconfig to fix it.
+
+So remove ldconfig call from make install-libs
+
+Upstream-Status: Inappropriate [disable feature]
+
+diff -uNr wireless_tools.29.orig/Makefile wireless_tools.29/Makefile
+--- wireless_tools.29.orig/Makefile	2007-09-18 01:56:46.000000000 +0200
++++ wireless_tools.29/Makefile	2012-02-15 20:46:41.780763514 +0100
+@@ -163,7 +163,6 @@
+ 	install -m 755 $(DYNAMIC) $(INSTALL_LIB)
+ 	ln -sfn $(DYNAMIC) $(INSTALL_LIB)/$(DYNAMIC_LINK)
+ 	@echo "*** Don't forget to add $(INSTALL_LIB) to /etc/ld.so.conf, and run ldconfig as root. ***"
+-	@$(LDCONFIG) || echo "*** Could not run ldconfig ! ***"
+ 
+ # Install the static library
+ install-static:: $(STATIC)
diff --git a/meta/recipes-connectivity/wireless-tools/wireless-tools/wireless-tools.if-pre-up b/meta/recipes-connectivity/wireless-tools/wireless-tools/wireless-tools.if-pre-up
new file mode 100755
index 0000000..2518a5c
--- /dev/null
+++ b/meta/recipes-connectivity/wireless-tools/wireless-tools/wireless-tools.if-pre-up
@@ -0,0 +1,122 @@
+#!/bin/sh
+
+case "$METHOD" in loopback) exit 0 ;; esac
+
+IWCONFIG=/sbin/iwconfig
+IWPRIV=/sbin/iwpriv
+
+if [ ! -x $IWCONFIG ]; then
+  exit 0
+fi
+
+# Detect and do nothing for linux-wlan-ng interfaces;
+# which are configured by thier own if-pre-up script.
+if [ -n "$IF_WIRELESS_TYPE" -a "$IF_WIRELESS_TYPE" = "wlan-ng" ]; then
+  exit 0
+fi
+
+if [ -n "$IF_NEEDS_RESET" ]; then
+  $IWPRIV "$IFACE" reset 1
+  sleep 1
+fi
+
+if [ -n "$IF_NEEDS_FIRMWARE" ]; then
+  $IF_NEEDS_FIRMWARE "$IFACE"
+fi
+
+if [ -n "$IF_WIRELESS_SENS" ]; then
+  $IWCONFIG "$IFACE" sens $IF_WIRELESS_SENS
+fi
+
+if [ -n "$IF_WIRELESS_RATE" ]; then
+  $IWCONFIG "$IFACE" rate $IF_WIRELESS_RATE
+fi
+
+if [ -n "$IF_WIRELESS_RTS" ]; then
+  $IWCONFIG "$IFACE" rts $IF_WIRELESS_RTS
+fi
+
+if [ -n "$IF_WIRELESS_FRAG" ]; then
+  $IWCONFIG "$IFACE" frag $IF_WIRELESS_FRAG
+fi
+
+if [ -n "$IF_WIRELESS_POWER" ]; then
+  $IWCONFIG "$IFACE" power $IF_WIRELESS_POWER
+fi
+
+if [ -n "$IF_WIRELESS_POWERPERIOD" ]; then
+  $IWCONFIG "$IFACE" power period $IF_WIRELESS_POWERPERIOD
+fi
+
+if [ -n "$IF_WIRELESS_POWERTIMEOUT" ]; then
+  $IWCONFIG "$IFACE" power timeout $IF_WIRELESS_POWERTIMEOUT
+fi
+
+if [ -n "$IF_WIRELESS_TXPOWER" ]; then
+  $IWCONFIG "$IFACE" txpower $IF_WIRELESS_TXPOWER
+fi
+
+if [ -n "$IF_WIRELESS_RETRY" ]; then
+  $IWCONFIG "$IFACE" retry $IF_WIRELESS_RETRY
+fi
+
+if [ -n "$IF_WIRELESS_NICK" ]; then
+  $IWCONFIG "$IFACE" nick "$IF_WIRELESS_NICK"
+fi
+
+if [ -n "$IF_WIRELESS_NWID" ]; then
+  $IWCONFIG "$IFACE" nwid "$IF_WIRELESS_NWID"
+fi
+
+if [ -n "$IF_WIRELESS_ENC" ]; then
+  eval $IWCONFIG "$IFACE" enc $IF_WIRELESS_ENC
+fi
+
+if [ -n "$IF_WIRELESS_KEY" ]; then
+  eval $IWCONFIG "$IFACE" key $IF_WIRELESS_KEY
+fi
+
+if [ -n "$IF_WIRELESS_KEY1" ]; then
+  $IWCONFIG "$IFACE" key [1] "$IF_WIRELESS_KEY1"
+fi
+
+if [ -n "$IF_WIRELESS_KEY2" ]; then
+  $IWCONFIG "$IFACE" key [2] "$IF_WIRELESS_KEY2"
+fi
+
+if [ -n "$IF_WIRELESS_KEY3" ]; then
+  $IWCONFIG "$IFACE" key [3] "$IF_WIRELESS_KEY3"
+fi
+
+if [ -n "$IF_WIRELESS_KEY4" ]; then
+  $IWCONFIG "$IFACE" key [4] "$IF_WIRELESS_KEY4"
+fi
+
+if [ -n "$IF_WIRELESS_DEFAULTKEY" ]; then
+  $IWCONFIG "$IFACE" key ["$IF_WIRELESS_DEFAULTKEY"]
+fi
+
+if [ -n "$IF_WIRELESS_KEYMODE" ]; then
+  $IWCONFIG "$IFACE" key "$IF_WIRELESS_KEYMODE"
+fi
+
+if [ -n "$IF_WIRELESS_MODE" ]; then
+  $IWCONFIG "$IFACE" mode $IF_WIRELESS_MODE
+fi
+
+if [ -n "$IF_WIRELESS_FREQ" ]; then
+  $IWCONFIG "$IFACE" freq $IF_WIRELESS_FREQ
+fi
+
+if [ -n "$IF_WIRELESS_CHANNEL" ]; then
+  $IWCONFIG "$IFACE" channel $IF_WIRELESS_CHANNEL
+fi
+
+if [ -n "$IF_WIRELESS_ESSID" ]; then
+  $IWCONFIG "$IFACE" essid "$IF_WIRELESS_ESSID"
+fi
+
+if [ -n "$IF_WIRELESS_COMMIT" ]; then
+  $IWCONFIG "$IFACE" commit
+fi
+
diff --git a/meta/recipes-connectivity/wireless-tools/wireless-tools/zzz-wireless.if-pre-up b/meta/recipes-connectivity/wireless-tools/wireless-tools/zzz-wireless.if-pre-up
new file mode 100644
index 0000000..4c8e95b
--- /dev/null
+++ b/meta/recipes-connectivity/wireless-tools/wireless-tools/zzz-wireless.if-pre-up
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# /etc/network/if-pre-up.d/zzz-wireless
+# by Stefan Tomanek (stefan@pico.ruhr.de)
+
+
+IWCONFIG=/sbin/iwconfig
+IFCONFIG=/sbin/ifconfig
+GREP=/bin/grep
+LOGGER=/usr/bin/logger
+SLEEP=/bin/sleep
+
+# How long do we wait for association?
+RETRIES=15
+SLEEPTIME=1
+
+# Only sleep if we use DHCP (add others methods seperated by spaces)
+ONLY_FOR="static dhcp"
+
+if [ -z "$IF_WIRELESS_TYPE" ] && echo "$ONLY_FOR" | grep -q "$METHOD" ; then
+	$IFCONFIG $IFACE up
+	$LOGGER Checking for WLAN association...
+	while ( [ $RETRIES -gt 0 ] && ($IWCONFIG "$IFACE" | $GREP -q "Access Point: Not-Associated") ); do
+		$LOGGER No association yet, $RETRIES retries until timeout
+		RETRIES=$(($RETRIES-1))
+		$SLEEP $SLEEPTIME
+	done
+	
+	if [ $RETRIES -eq 0 ]; then
+		$LOGGER Timeout waiting for association, continuing anyway...
+	else
+		$LOGGER Found association!
+	fi
+fi
diff --git a/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb b/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb
new file mode 100644
index 0000000..26ecdf3
--- /dev/null
+++ b/meta/recipes-connectivity/wireless-tools/wireless-tools_30.pre9.bb
@@ -0,0 +1,56 @@
+SUMMARY = "Tools for the Linux Standard Wireless Extension Subsystem"
+HOMEPAGE = "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html"
+LICENSE = "GPLv2 & (LGPLv2.1 | MPL-1.1 | BSD)"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+			file://iwconfig.c;beginline=1;endline=12;md5=cf710eb1795c376eb10ea4ff04649caf \
+			file://iwevent.c;beginline=59;endline=72;md5=d66a10026d4394f0a5b1c5587bce4537 \
+			file://sample_enc.c;beginline=1;endline=4;md5=838372be07874260b566bae2f6ed33b6"
+SECTION = "base"
+PE = "1"
+
+SRC_URI = "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools.${PV}.tar.gz \
+           file://wireless-tools.if-pre-up \
+           file://zzz-wireless.if-pre-up \
+           file://remove.ldconfig.call.patch \
+           file://man.patch \
+           file://avoid_strip.patch \
+           file://ldflags.patch \
+          "
+SRC_URI[md5sum] = "ca91ba7c7eff9bfff6926b1a34a4697d"
+SRC_URI[sha256sum] = "abd9c5c98abf1fdd11892ac2f8a56737544fe101e1be27c6241a564948f34c63"
+
+S = "${WORKDIR}/wireless_tools.30"
+
+CFLAGS =+ "-I${S}"
+EXTRA_OEMAKE = "-e 'BUILD_SHARED=y' \
+		'INSTALL_DIR=${D}${base_sbindir}' \
+		'INSTALL_LIB=${D}${libdir}' \
+		'INSTALL_INC=${D}${includedir}' \
+		'INSTALL_MAN=${D}${mandir}'"
+
+do_compile() {
+	oe_runmake all libiw.a
+}
+
+do_install() {
+	oe_runmake PREFIX=${D} install-iwmulticall install-dynamic install-man install-hdr
+	install -d ${D}${sbindir}
+	install -m 0755 ifrename ${D}${sbindir}/ifrename
+	# Disabled by RP - 20/8/08 - We don't seem to need/use these
+	#install -d ${D}${sysconfdir}/network/if-pre-up.d
+	#install ${WORKDIR}/wireless-tools.if-pre-up ${D}${sysconfdir}/network/if-pre-up.d/wireless-tools
+	#install ${WORKDIR}/zzz-wireless.if-pre-up ${D}${sysconfdir}/network/if-pre-up.d/zzz-wireless
+}
+
+PACKAGES = "libiw-dbg ifrename-dbg ${PN}-dbg \
+libiw libiw-dev libiw-doc ifrename-doc ifrename ${PN} ${PN}-doc"
+
+FILES_libiw-dbg = "${libdir}/.debug/*.so.*"
+FILES_ifrename-dbg = "${sbindir}/.debug/ifrename"
+FILES_libiw = "${libdir}/*.so.*"
+FILES_libiw-dev = "${libdir}/*.a ${libdir}/*.so ${includedir}"
+FILES_libiw-doc = "${mandir}/man7"
+FILES_ifrename = "${sbindir}/ifrename"
+FILES_ifrename-doc = "${mandir}/man8/ifrename.8 ${mandir}/man5/iftab.5"
+FILES_${PN} = "${bindir} ${sbindir}/iw* ${base_sbindir} ${base_bindir} ${sysconfdir}/network"
+FILES_${PN}-doc = "${mandir}"
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch
new file mode 100644
index 0000000..882674f
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch
@@ -0,0 +1,45 @@
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+From ef566a4d4f74022e1fdb0a2addfe81e6de9f4aae Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Wed, 29 Apr 2015 02:21:53 +0300
+Subject: [PATCH] AP WMM: Fix integer underflow in WMM Action frame parser
+
+The length of the WMM Action frame was not properly validated and the
+length of the information elements (int left) could end up being
+negative. This would result in reading significantly past the stack
+buffer while parsing the IEs in ieee802_11_parse_elems() and while doing
+so, resulting in segmentation fault.
+
+This can result in an invalid frame being used for a denial of service
+attack (hostapd process killed) against an AP with a driver that uses
+hostapd for management frame processing (e.g., all mac80211-based
+drivers).
+
+Thanks to Kostya Kortchinsky of Google security team for discovering and
+reporting this issue.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/ap/wmm.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/src/ap/wmm.c b/src/ap/wmm.c
+index 6d4177c..314e244 100644
+--- a/src/ap/wmm.c
++++ b/src/ap/wmm.c
+@@ -274,6 +274,9 @@ void hostapd_wmm_action(struct hostapd_data *hapd,
+ 		return;
+ 	}
+ 
++	if (left < 0)
++		return; /* not a valid WMM Action frame */
++
+ 	/* extract the tspec info element */
+ 	if (ieee802_11_parse_elems(pos, left, &elems, 1) == ParseFailed) {
+ 		hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch
new file mode 100644
index 0000000..a2bafc8
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch
@@ -0,0 +1,77 @@
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+From dd2f043c9c43d156494e33d7ce22db96e6ef42c7 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Fri, 1 May 2015 16:37:45 +0300
+Subject: [PATCH 1/5] EAP-pwd peer: Fix payload length validation for Commit
+ and Confirm
+
+The length of the received Commit and Confirm message payloads was not
+checked before reading them. This could result in a buffer read
+overflow when processing an invalid message.
+
+Fix this by verifying that the payload is of expected length before
+processing it. In addition, enforce correct state transition sequence to
+make sure there is no unexpected behavior if receiving a Commit/Confirm
+message before the previous exchanges have been completed.
+
+Thanks to Kostya Kortchinsky of Google security team for discovering and
+reporting this issue.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/eap_peer/eap_pwd.c | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c
+index f2b0926..a629437 100644
+--- a/src/eap_peer/eap_pwd.c
++++ b/src/eap_peer/eap_pwd.c
+@@ -355,6 +355,23 @@ eap_pwd_perform_commit_exchange(struct eap_sm *sm, struct eap_pwd_data *data,
+ 	BIGNUM *mask = NULL, *x = NULL, *y = NULL, *cofactor = NULL;
+ 	u16 offset;
+ 	u8 *ptr, *scalar = NULL, *element = NULL;
++	size_t prime_len, order_len;
++
++	if (data->state != PWD_Commit_Req) {
++		ret->ignore = TRUE;
++		goto fin;
++	}
++
++	prime_len = BN_num_bytes(data->grp->prime);
++	order_len = BN_num_bytes(data->grp->order);
++
++	if (payload_len != 2 * prime_len + order_len) {
++		wpa_printf(MSG_INFO,
++			   "EAP-pwd: Unexpected Commit payload length %u (expected %u)",
++			   (unsigned int) payload_len,
++			   (unsigned int) (2 * prime_len + order_len));
++		goto fin;
++	}
+ 
+ 	if (((data->private_value = BN_new()) == NULL) ||
+ 	    ((data->my_element = EC_POINT_new(data->grp->group)) == NULL) ||
+@@ -554,6 +571,18 @@ eap_pwd_perform_confirm_exchange(struct eap_sm *sm, struct eap_pwd_data *data,
+ 	u8 conf[SHA256_MAC_LEN], *cruft = NULL, *ptr;
+ 	int offset;
+ 
++	if (data->state != PWD_Confirm_Req) {
++		ret->ignore = TRUE;
++		goto fin;
++	}
++
++	if (payload_len != SHA256_MAC_LEN) {
++		wpa_printf(MSG_INFO,
++			   "EAP-pwd: Unexpected Confirm payload length %u (expected %u)",
++			   (unsigned int) payload_len, SHA256_MAC_LEN);
++		goto fin;
++	}
++
+ 	/*
+ 	 * first build up the ciphersuite which is group | random_function |
+ 	 *	prf
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch
new file mode 100644
index 0000000..e108a93
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch
@@ -0,0 +1,47 @@
+From 9ed4eee345f85e3025c33c6e20aa25696e341ccd Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <jouni@qca.qualcomm.com>
+Date: Tue, 7 Apr 2015 11:32:11 +0300
+Subject: [PATCH] P2P: Validate SSID element length before copying it
+ (CVE-2015-1863)
+
+This fixes a possible memcpy overflow for P2P dev->oper_ssid in
+p2p_add_device(). The length provided by the peer device (0..255 bytes)
+was used without proper bounds checking and that could have resulted in
+arbitrary data of up to 223 bytes being written beyond the end of the
+dev->oper_ssid[] array (of which about 150 bytes would be beyond the
+heap allocation) when processing a corrupted management frame for P2P
+peer discovery purposes.
+
+This could result in corrupted state in heap, unexpected program
+behavior due to corrupted P2P peer device information, denial of service
+due to process crash, exposure of memory contents during GO Negotiation,
+and potentially arbitrary code execution.
+
+Thanks to Google security team for reporting this issue and smart
+hardware research group of Alibaba security team for discovering it.
+
+Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
+
+Upstream-Status: Backport
+
+Signed-off-by: Yue Tao <yue.tao@windriver.com>
+
+---
+ src/p2p/p2p.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c
+index f584fae..a45fe73 100644
+--- a/src/p2p/p2p.c
++++ b/src/p2p/p2p.c
+@@ -778,6 +778,7 @@ int p2p_add_device(struct p2p_data *p2p, const u8 *addr, int freq,
+ 	if (os_memcmp(addr, p2p_dev_addr, ETH_ALEN) != 0)
+ 		os_memcpy(dev->interface_addr, addr, ETH_ALEN);
+ 	if (msg.ssid &&
++	    msg.ssid[1] <= sizeof(dev->oper_ssid) &&
+ 	    (msg.ssid[1] != P2P_WILDCARD_SSID_LEN ||
+ 	     os_memcmp(msg.ssid + 2, P2P_WILDCARD_SSID, P2P_WILDCARD_SSID_LEN)
+ 	     != 0)) {
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
new file mode 100644
index 0000000..2568ea1
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch
@@ -0,0 +1,53 @@
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+From 5acd23f4581da58683f3cf5e36cb71bbe4070bd7 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Tue, 28 Apr 2015 17:08:33 +0300
+Subject: [PATCH] WPS: Fix HTTP chunked transfer encoding parser
+
+strtoul() return value may end up overflowing the int h->chunk_size and
+resulting in a negative value to be stored as the chunk_size. This could
+result in the following memcpy operation using a very large length
+argument which would result in a buffer overflow and segmentation fault.
+
+This could have been used to cause a denial service by any device that
+has been authorized for network access (either wireless or wired). This
+would affect both the WPS UPnP functionality in a WPS AP (hostapd with
+upnp_iface parameter set in the configuration) and WPS ER
+(wpa_supplicant with WPS_ER_START control interface command used).
+
+Validate the parsed chunk length value to avoid this. In addition to
+rejecting negative values, we can also reject chunk size that would be
+larger than the maximum configured body length.
+
+Thanks to Kostya Kortchinsky of Google security team for discovering and
+reporting this issue.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/wps/httpread.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/wps/httpread.c b/src/wps/httpread.c
+index 2f08f37..d2855e3 100644
+--- a/src/wps/httpread.c
++++ b/src/wps/httpread.c
+@@ -533,6 +533,13 @@ static void httpread_read_handler(int sd, void *eloop_ctx, void *sock_ctx)
+ 					if (!isxdigit(*cbp))
+ 						goto bad;
+ 					h->chunk_size = strtoul(cbp, NULL, 16);
++					if (h->chunk_size < 0 ||
++					    h->chunk_size > h->max_bytes) {
++						wpa_printf(MSG_DEBUG,
++							   "httpread: Invalid chunk size %d",
++							   h->chunk_size);
++						goto bad;
++					}
+ 					/* throw away chunk header
+ 					 * so we have only real data
+ 					 */
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch
new file mode 100644
index 0000000..c477c2f
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch
@@ -0,0 +1,70 @@
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+From e28a58be26184c2a23f80b410e0997ef1bd5d578 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Fri, 1 May 2015 16:40:44 +0300
+Subject: [PATCH 2/5] EAP-pwd server: Fix payload length validation for Commit
+ and Confirm
+
+The length of the received Commit and Confirm message payloads was not
+checked before reading them. This could result in a buffer read
+overflow when processing an invalid message.
+
+Fix this by verifying that the payload is of expected length before
+processing it. In addition, enforce correct state transition sequence to
+make sure there is no unexpected behavior if receiving a Commit/Confirm
+message before the previous exchanges have been completed.
+
+Thanks to Kostya Kortchinsky of Google security team for discovering and
+reporting this issue.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/eap_server/eap_server_pwd.c | 19 +++++++++++++++++++
+ 1 file changed, 19 insertions(+)
+
+diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c
+index 66bd5d2..3189105 100644
+--- a/src/eap_server/eap_server_pwd.c
++++ b/src/eap_server/eap_server_pwd.c
+@@ -656,9 +656,21 @@ eap_pwd_process_commit_resp(struct eap_sm *sm, struct eap_pwd_data *data,
+ 	BIGNUM *x = NULL, *y = NULL, *cofactor = NULL;
+ 	EC_POINT *K = NULL, *point = NULL;
+ 	int res = 0;
++	size_t prime_len, order_len;
+ 
+ 	wpa_printf(MSG_DEBUG, "EAP-pwd: Received commit response");
+ 
++	prime_len = BN_num_bytes(data->grp->prime);
++	order_len = BN_num_bytes(data->grp->order);
++
++	if (payload_len != 2 * prime_len + order_len) {
++		wpa_printf(MSG_INFO,
++			   "EAP-pwd: Unexpected Commit payload length %u (expected %u)",
++			   (unsigned int) payload_len,
++			   (unsigned int) (2 * prime_len + order_len));
++		goto fin;
++	}
++
+ 	if (((data->peer_scalar = BN_new()) == NULL) ||
+ 	    ((data->k = BN_new()) == NULL) ||
+ 	    ((cofactor = BN_new()) == NULL) ||
+@@ -774,6 +786,13 @@ eap_pwd_process_confirm_resp(struct eap_sm *sm, struct eap_pwd_data *data,
+ 	u8 conf[SHA256_MAC_LEN], *cruft = NULL, *ptr;
+ 	int offset;
+ 
++	if (payload_len != SHA256_MAC_LEN) {
++		wpa_printf(MSG_INFO,
++			   "EAP-pwd: Unexpected Confirm payload length %u (expected %u)",
++			   (unsigned int) payload_len, SHA256_MAC_LEN);
++		goto fin;
++	}
++
+ 	/* build up the ciphersuite: group | random_function | prf */
+ 	grp = htons(data->group_num);
+ 	ptr = (u8 *) &cs;
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch
new file mode 100644
index 0000000..e46ce43
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch
@@ -0,0 +1,56 @@
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+From 477c74395acd0123340457ba6f15ab345d42016e Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Sat, 2 May 2015 19:23:04 +0300
+Subject: [PATCH 3/5] EAP-pwd peer: Fix Total-Length parsing for fragment
+ reassembly
+
+The remaining number of bytes in the message could be smaller than the
+Total-Length field size, so the length needs to be explicitly checked
+prior to reading the field and decrementing the len variable. This could
+have resulted in the remaining length becoming negative and interpreted
+as a huge positive integer.
+
+In addition, check that there is no already started fragment in progress
+before allocating a new buffer for reassembling fragments. This avoid a
+potential memory leak when processing invalid message.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/eap_peer/eap_pwd.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c
+index a629437..1d2079b 100644
+--- a/src/eap_peer/eap_pwd.c
++++ b/src/eap_peer/eap_pwd.c
+@@ -866,11 +866,23 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret,
+ 	 * if it's the first fragment there'll be a length field
+ 	 */
+ 	if (EAP_PWD_GET_LENGTH_BIT(lm_exch)) {
++		if (len < 2) {
++			wpa_printf(MSG_DEBUG,
++				   "EAP-pwd: Frame too short to contain Total-Length field");
++			ret->ignore = TRUE;
++			return NULL;
++		}
+ 		tot_len = WPA_GET_BE16(pos);
+ 		wpa_printf(MSG_DEBUG, "EAP-pwd: Incoming fragments whose "
+ 			   "total length = %d", tot_len);
+ 		if (tot_len > 15000)
+ 			return NULL;
++		if (data->inbuf) {
++			wpa_printf(MSG_DEBUG,
++				   "EAP-pwd: Unexpected new fragment start when previous fragment is still in use");
++			ret->ignore = TRUE;
++			return NULL;
++		}
+ 		data->inbuf = wpabuf_alloc(tot_len);
+ 		if (data->inbuf == NULL) {
+ 			wpa_printf(MSG_INFO, "Out of memory to buffer "
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch
new file mode 100644
index 0000000..a4c02b4
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+From 3035cc2894e08319b905bd6561e8bddc8c2db9fa Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Sat, 2 May 2015 19:26:06 +0300
+Subject: [PATCH 4/5] EAP-pwd server: Fix Total-Length parsing for fragment
+ reassembly
+
+The remaining number of bytes in the message could be smaller than the
+Total-Length field size, so the length needs to be explicitly checked
+prior to reading the field and decrementing the len variable. This could
+have resulted in the remaining length becoming negative and interpreted
+as a huge positive integer.
+
+In addition, check that there is no already started fragment in progress
+before allocating a new buffer for reassembling fragments. This avoid a
+potential memory leak when processing invalid message.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/eap_server/eap_server_pwd.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/eap_server/eap_server_pwd.c b/src/eap_server/eap_server_pwd.c
+index 3189105..2bfc3c2 100644
+--- a/src/eap_server/eap_server_pwd.c
++++ b/src/eap_server/eap_server_pwd.c
+@@ -942,11 +942,21 @@ static void eap_pwd_process(struct eap_sm *sm, void *priv,
+ 	 * the first fragment has a total length
+ 	 */
+ 	if (EAP_PWD_GET_LENGTH_BIT(lm_exch)) {
++		if (len < 2) {
++			wpa_printf(MSG_DEBUG,
++				   "EAP-pwd: Frame too short to contain Total-Length field");
++			return;
++		}
+ 		tot_len = WPA_GET_BE16(pos);
+ 		wpa_printf(MSG_DEBUG, "EAP-pwd: Incoming fragments, total "
+ 			   "length = %d", tot_len);
+ 		if (tot_len > 15000)
+ 			return;
++		if (data->inbuf) {
++			wpa_printf(MSG_DEBUG,
++				   "EAP-pwd: Unexpected new fragment start when previous fragment is still in use");
++			return;
++		}
+ 		data->inbuf = wpabuf_alloc(tot_len);
+ 		if (data->inbuf == NULL) {
+ 			wpa_printf(MSG_INFO, "EAP-pwd: Out of memory to "
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch
new file mode 100644
index 0000000..4073600
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Backport
+
+Signed-off-by: Fan Xin <fan.xin@jp.fujitsu.com>
+
+From 28a069a545b06b99eb55ad53f63f2c99e65a98f6 Mon Sep 17 00:00:00 2001
+From: Jouni Malinen <j@w1.fi>
+Date: Sat, 2 May 2015 19:26:28 +0300
+Subject: [PATCH 5/5] EAP-pwd peer: Fix asymmetric fragmentation behavior
+
+The L (Length) and M (More) flags needs to be cleared before deciding
+whether the locally generated response requires fragmentation. This
+fixes an issue where these flags from the server could have been invalid
+for the following message. In some cases, this could have resulted in
+triggering the wpabuf security check that would terminate the process
+due to invalid buffer allocation.
+
+Signed-off-by: Jouni Malinen <j@w1.fi>
+---
+ src/eap_peer/eap_pwd.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/eap_peer/eap_pwd.c b/src/eap_peer/eap_pwd.c
+index 1d2079b..e58b13a 100644
+--- a/src/eap_peer/eap_pwd.c
++++ b/src/eap_peer/eap_pwd.c
+@@ -968,6 +968,7 @@ eap_pwd_process(struct eap_sm *sm, void *priv, struct eap_method_ret *ret,
+ 	/*
+ 	 * we have output! Do we need to fragment it?
+ 	 */
++	lm_exch = EAP_PWD_GET_EXCHANGE(lm_exch);
+ 	len = wpabuf_len(data->outbuf);
+ 	if ((len + EAP_PWD_HDR_SIZE) > data->mtu) {
+ 		resp = eap_msg_alloc(EAP_VENDOR_IETF, EAP_TYPE_PWD, data->mtu,
+-- 
+1.9.1
+
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/99_wpa_supplicant b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/99_wpa_supplicant
new file mode 100644
index 0000000..6ff4dd8
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/99_wpa_supplicant
@@ -0,0 +1 @@
+d root root 0700 /var/run/wpa_supplicant none
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig
new file mode 100644
index 0000000..f04e398
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/defconfig
@@ -0,0 +1,552 @@
+# Example wpa_supplicant build time configuration
+#
+# This file lists the configuration options that are used when building the
+# hostapd binary. All lines starting with # are ignored. Configuration option
+# lines must be commented out complete, if they are not to be included, i.e.,
+# just setting VARIABLE=n is not disabling that variable.
+#
+# This file is included in Makefile, so variables like CFLAGS and LIBS can also
+# be modified from here. In most cases, these lines should use += in order not
+# to override previous values of the variables.
+
+
+# Uncomment following two lines and fix the paths if you have installed OpenSSL
+# or GnuTLS in non-default location
+#CFLAGS += -I/usr/local/openssl/include
+#LIBS += -L/usr/local/openssl/lib
+
+# Some Red Hat versions seem to include kerberos header files from OpenSSL, but
+# the kerberos files are not in the default include path. Following line can be
+# used to fix build issues on such systems (krb5.h not found).
+#CFLAGS += -I/usr/include/kerberos
+
+# Example configuration for various cross-compilation platforms
+
+#### sveasoft (e.g., for Linksys WRT54G) ######################################
+#CC=mipsel-uclibc-gcc
+#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
+#CFLAGS += -Os
+#CPPFLAGS += -I../src/include -I../../src/router/openssl/include
+#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl
+###############################################################################
+
+#### openwrt (e.g., for Linksys WRT54G) #######################################
+#CC=mipsel-uclibc-gcc
+#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc
+#CFLAGS += -Os
+#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \
+#	-I../WRT54GS/release/src/include
+#LIBS = -lssl
+###############################################################################
+
+
+# Driver interface for Host AP driver
+CONFIG_DRIVER_HOSTAP=y
+
+# Driver interface for Agere driver
+#CONFIG_DRIVER_HERMES=y
+# Change include directories to match with the local setup
+#CFLAGS += -I../../hcf -I../../include -I../../include/hcf
+#CFLAGS += -I../../include/wireless
+
+# Driver interface for madwifi driver
+# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
+#CONFIG_DRIVER_MADWIFI=y
+# Set include directory to the madwifi source tree
+#CFLAGS += -I../../madwifi
+
+# Driver interface for ndiswrapper
+# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
+#CONFIG_DRIVER_NDISWRAPPER=y
+
+# Driver interface for Atmel driver
+# CONFIG_DRIVER_ATMEL=y
+
+# Driver interface for old Broadcom driver
+# Please note that the newer Broadcom driver ("hybrid Linux driver") supports
+# Linux wireless extensions and does not need (or even work) with the old
+# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver.
+#CONFIG_DRIVER_BROADCOM=y
+# Example path for wlioctl.h; change to match your configuration
+#CFLAGS += -I/opt/WRT54GS/release/src/include
+
+# Driver interface for Intel ipw2100/2200 driver
+# Deprecated; use CONFIG_DRIVER_WEXT=y instead.
+#CONFIG_DRIVER_IPW=y
+
+# Driver interface for Ralink driver
+#CONFIG_DRIVER_RALINK=y
+
+# Driver interface for generic Linux wireless extensions
+# Note: WEXT is deprecated in the current Linux kernel version and no new
+# functionality is added to it. nl80211-based interface is the new
+# replacement for WEXT and its use allows wpa_supplicant to properly control
+# the driver to improve existing functionality like roaming and to support new
+# functionality.
+CONFIG_DRIVER_WEXT=y
+
+# Driver interface for Linux drivers using the nl80211 kernel interface
+CONFIG_DRIVER_NL80211=y
+
+# driver_nl80211.c requires libnl. If you are compiling it yourself
+# you may need to point hostapd to your version of libnl.
+#
+#CFLAGS += -I$<path to libnl include files>
+#LIBS += -L$<path to libnl library files>
+
+# Use libnl v2.0 (or 3.0) libraries.
+#CONFIG_LIBNL20=y
+
+# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored)
+CONFIG_LIBNL32=y
+
+
+# Driver interface for FreeBSD net80211 layer (e.g., Atheros driver)
+#CONFIG_DRIVER_BSD=y
+#CFLAGS += -I/usr/local/include
+#LIBS += -L/usr/local/lib
+#LIBS_p += -L/usr/local/lib
+#LIBS_c += -L/usr/local/lib
+
+# Driver interface for Windows NDIS
+#CONFIG_DRIVER_NDIS=y
+#CFLAGS += -I/usr/include/w32api/ddk
+#LIBS += -L/usr/local/lib
+# For native build using mingw
+#CONFIG_NATIVE_WINDOWS=y
+# Additional directories for cross-compilation on Linux host for mingw target
+#CFLAGS += -I/opt/mingw/mingw32/include/ddk
+#LIBS += -L/opt/mingw/mingw32/lib
+#CC=mingw32-gcc
+# By default, driver_ndis uses WinPcap for low-level operations. This can be
+# replaced with the following option which replaces WinPcap calls with NDISUIO.
+# However, this requires that WZC is disabled (net stop wzcsvc) before starting
+# wpa_supplicant.
+# CONFIG_USE_NDISUIO=y
+
+# Driver interface for development testing
+#CONFIG_DRIVER_TEST=y
+
+# Driver interface for wired Ethernet drivers
+CONFIG_DRIVER_WIRED=y
+
+# Driver interface for the Broadcom RoboSwitch family
+#CONFIG_DRIVER_ROBOSWITCH=y
+
+# Driver interface for no driver (e.g., WPS ER only)
+#CONFIG_DRIVER_NONE=y
+
+# Enable IEEE 802.1X Supplicant (automatically included if any EAP method is
+# included)
+CONFIG_IEEE8021X_EAPOL=y
+
+# EAP-MD5
+CONFIG_EAP_MD5=y
+
+# EAP-MSCHAPv2
+CONFIG_EAP_MSCHAPV2=y
+
+# EAP-TLS
+CONFIG_EAP_TLS=y
+
+# EAL-PEAP
+CONFIG_EAP_PEAP=y
+
+# EAP-TTLS
+CONFIG_EAP_TTLS=y
+
+# EAP-FAST
+# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed
+# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g.,
+# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions.
+#CONFIG_EAP_FAST=y
+
+# EAP-GTC
+CONFIG_EAP_GTC=y
+
+# EAP-OTP
+CONFIG_EAP_OTP=y
+
+# EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
+#CONFIG_EAP_SIM=y
+
+# EAP-PSK (experimental; this is _not_ needed for WPA-PSK)
+#CONFIG_EAP_PSK=y
+
+# EAP-pwd (secure authentication using only a password)
+#CONFIG_EAP_PWD=y
+
+# EAP-PAX
+#CONFIG_EAP_PAX=y
+
+# LEAP
+CONFIG_EAP_LEAP=y
+
+# EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
+#CONFIG_EAP_AKA=y
+
+# EAP-AKA' (enable CONFIG_PCSC, if EAP-AKA' is used).
+# This requires CONFIG_EAP_AKA to be enabled, too.
+#CONFIG_EAP_AKA_PRIME=y
+
+# Enable USIM simulator (Milenage) for EAP-AKA
+#CONFIG_USIM_SIMULATOR=y
+
+# EAP-SAKE
+#CONFIG_EAP_SAKE=y
+
+# EAP-GPSK
+#CONFIG_EAP_GPSK=y
+# Include support for optional SHA256 cipher suite in EAP-GPSK
+#CONFIG_EAP_GPSK_SHA256=y
+
+# EAP-TNC and related Trusted Network Connect support (experimental)
+#CONFIG_EAP_TNC=y
+
+# Wi-Fi Protected Setup (WPS)
+CONFIG_WPS=y
+# Enable WSC 2.0 support
+#CONFIG_WPS2=y
+# Enable WPS external registrar functionality
+#CONFIG_WPS_ER=y
+# Disable credentials for an open network by default when acting as a WPS
+# registrar.
+#CONFIG_WPS_REG_DISABLE_OPEN=y
+# Enable WPS support with NFC config method
+#CONFIG_WPS_NFC=y
+
+# EAP-IKEv2
+#CONFIG_EAP_IKEV2=y
+
+# EAP-EKE
+#CONFIG_EAP_EKE=y
+
+# PKCS#12 (PFX) support (used to read private key and certificate file from
+# a file that usually has extension .p12 or .pfx)
+CONFIG_PKCS12=y
+
+# Smartcard support (i.e., private key on a smartcard), e.g., with openssl
+# engine.
+CONFIG_SMARTCARD=y
+
+# PC/SC interface for smartcards (USIM, GSM SIM)
+# Enable this if EAP-SIM or EAP-AKA is included
+#CONFIG_PCSC=y
+
+# Support HT overrides (disable HT/HT40, mask MCS rates, etc.)
+#CONFIG_HT_OVERRIDES=y
+
+# Support VHT overrides (disable VHT, mask MCS rates, etc.)
+#CONFIG_VHT_OVERRIDES=y
+
+# Development testing
+#CONFIG_EAPOL_TEST=y
+
+# Select control interface backend for external programs, e.g, wpa_cli:
+# unix = UNIX domain sockets (default for Linux/*BSD)
+# udp = UDP sockets using localhost (127.0.0.1)
+# named_pipe = Windows Named Pipe (default for Windows)
+# udp-remote = UDP sockets with remote access (only for tests systems/purpose)
+# y = use default (backwards compatibility)
+# If this option is commented out, control interface is not included in the
+# build.
+CONFIG_CTRL_IFACE=y
+
+# Include support for GNU Readline and History Libraries in wpa_cli.
+# When building a wpa_cli binary for distribution, please note that these
+# libraries are licensed under GPL and as such, BSD license may not apply for
+# the resulting binary.
+#CONFIG_READLINE=y
+
+# Include internal line edit mode in wpa_cli. This can be used as a replacement
+# for GNU Readline to provide limited command line editing and history support.
+#CONFIG_WPA_CLI_EDIT=y
+
+# Remove debugging code that is printing out debug message to stdout.
+# This can be used to reduce the size of the wpa_supplicant considerably
+# if debugging code is not needed. The size reduction can be around 35%
+# (e.g., 90 kB).
+#CONFIG_NO_STDOUT_DEBUG=y
+
+# Remove WPA support, e.g., for wired-only IEEE 802.1X supplicant, to save
+# 35-50 kB in code size.
+#CONFIG_NO_WPA=y
+
+# Remove IEEE 802.11i/WPA-Personal ASCII passphrase support
+# This option can be used to reduce code size by removing support for
+# converting ASCII passphrases into PSK. If this functionality is removed, the
+# PSK can only be configured as the 64-octet hexstring (e.g., from
+# wpa_passphrase). This saves about 0.5 kB in code size.
+#CONFIG_NO_WPA_PASSPHRASE=y
+
+# Disable scan result processing (ap_mode=1) to save code size by about 1 kB.
+# This can be used if ap_scan=1 mode is never enabled.
+#CONFIG_NO_SCAN_PROCESSING=y
+
+# Select configuration backend:
+# file = text file (e.g., wpa_supplicant.conf; note: the configuration file
+#	path is given on command line, not here; this option is just used to
+#	select the backend that allows configuration files to be used)
+# winreg = Windows registry (see win_example.reg for an example)
+CONFIG_BACKEND=file
+
+# Remove configuration write functionality (i.e., to allow the configuration
+# file to be updated based on runtime configuration changes). The runtime
+# configuration can still be changed, the changes are just not going to be
+# persistent over restarts. This option can be used to reduce code size by
+# about 3.5 kB.
+#CONFIG_NO_CONFIG_WRITE=y
+
+# Remove support for configuration blobs to reduce code size by about 1.5 kB.
+#CONFIG_NO_CONFIG_BLOBS=y
+
+# Select program entry point implementation:
+# main = UNIX/POSIX like main() function (default)
+# main_winsvc = Windows service (read parameters from registry)
+# main_none = Very basic example (development use only)
+#CONFIG_MAIN=main
+
+# Select wrapper for operatins system and C library specific functions
+# unix = UNIX/POSIX like systems (default)
+# win32 = Windows systems
+# none = Empty template
+#CONFIG_OS=unix
+
+# Select event loop implementation
+# eloop = select() loop (default)
+# eloop_win = Windows events and WaitForMultipleObject() loop
+#CONFIG_ELOOP=eloop
+
+# Should we use poll instead of select? Select is used by default.
+#CONFIG_ELOOP_POLL=y
+
+# Select layer 2 packet implementation
+# linux = Linux packet socket (default)
+# pcap = libpcap/libdnet/WinPcap
+# freebsd = FreeBSD libpcap
+# winpcap = WinPcap with receive thread
+# ndis = Windows NDISUIO (note: requires CONFIG_USE_NDISUIO=y)
+# none = Empty template
+#CONFIG_L2_PACKET=linux
+
+# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS)
+CONFIG_PEERKEY=y
+
+# IEEE 802.11w (management frame protection), also known as PMF
+# Driver support is also needed for IEEE 802.11w.
+#CONFIG_IEEE80211W=y
+
+# Select TLS implementation
+# openssl = OpenSSL (default)
+# gnutls = GnuTLS
+# internal = Internal TLSv1 implementation (experimental)
+# none = Empty template
+#CONFIG_TLS=openssl
+
+# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1)
+# can be enabled to get a stronger construction of messages when block ciphers
+# are used. It should be noted that some existing TLS v1.0 -based
+# implementation may not be compatible with TLS v1.1 message (ClientHello is
+# sent prior to negotiating which version will be used)
+#CONFIG_TLSV11=y
+
+# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2)
+# can be enabled to enable use of stronger crypto algorithms. It should be
+# noted that some existing TLS v1.0 -based implementation may not be compatible
+# with TLS v1.2 message (ClientHello is sent prior to negotiating which version
+# will be used)
+#CONFIG_TLSV12=y
+
+# If CONFIG_TLS=internal is used, additional library and include paths are
+# needed for LibTomMath. Alternatively, an integrated, minimal version of
+# LibTomMath can be used. See beginning of libtommath.c for details on benefits
+# and drawbacks of this option.
+#CONFIG_INTERNAL_LIBTOMMATH=y
+#ifndef CONFIG_INTERNAL_LIBTOMMATH
+#LTM_PATH=/usr/src/libtommath-0.39
+#CFLAGS += -I$(LTM_PATH)
+#LIBS += -L$(LTM_PATH)
+#LIBS_p += -L$(LTM_PATH)
+#endif
+# At the cost of about 4 kB of additional binary size, the internal LibTomMath
+# can be configured to include faster routines for exptmod, sqr, and div to
+# speed up DH and RSA calculation considerably
+#CONFIG_INTERNAL_LIBTOMMATH_FAST=y
+
+# Include NDIS event processing through WMI into wpa_supplicant/wpasvc.
+# This is only for Windows builds and requires WMI-related header files and
+# WbemUuid.Lib from Platform SDK even when building with MinGW.
+#CONFIG_NDIS_EVENTS_INTEGRATED=y
+#PLATFORMSDKLIB="/opt/Program Files/Microsoft Platform SDK/Lib"
+
+# Add support for old DBus control interface
+# (fi.epitest.hostap.WPASupplicant)
+#CONFIG_CTRL_IFACE_DBUS=y
+
+# Add support for new DBus control interface
+# (fi.w1.hostap.wpa_supplicant1)
+CONFIG_CTRL_IFACE_DBUS_NEW=y
+
+# Add introspection support for new DBus control interface
+#CONFIG_CTRL_IFACE_DBUS_INTRO=y
+
+# Add support for loading EAP methods dynamically as shared libraries.
+# When this option is enabled, each EAP method can be either included
+# statically (CONFIG_EAP_<method>=y) or dynamically (CONFIG_EAP_<method>=dyn).
+# Dynamic EAP methods are build as shared objects (eap_*.so) and they need to
+# be loaded in the beginning of the wpa_supplicant configuration file
+# (see load_dynamic_eap parameter in the example file) before being used in
+# the network blocks.
+#
+# Note that some shared parts of EAP methods are included in the main program
+# and in order to be able to use dynamic EAP methods using these parts, the
+# main program must have been build with the EAP method enabled (=y or =dyn).
+# This means that EAP-TLS/PEAP/TTLS/FAST cannot be added as dynamic libraries
+# unless at least one of them was included in the main build to force inclusion
+# of the shared code. Similarly, at least one of EAP-SIM/AKA must be included
+# in the main build to be able to load these methods dynamically.
+#
+# Please also note that using dynamic libraries will increase the total binary
+# size. Thus, it may not be the best option for targets that have limited
+# amount of memory/flash.
+#CONFIG_DYNAMIC_EAP_METHODS=y
+
+# IEEE Std 802.11r-2008 (Fast BSS Transition)
+#CONFIG_IEEE80211R=y
+
+# Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt)
+#CONFIG_DEBUG_FILE=y
+
+# Send debug messages to syslog instead of stdout
+#CONFIG_DEBUG_SYSLOG=y
+# Set syslog facility for debug messages
+#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
+
+# Add support for sending all debug messages (regardless of debug verbosity)
+# to the Linux kernel tracing facility. This helps debug the entire stack by
+# making it easy to record everything happening from the driver up into the
+# same file, e.g., using trace-cmd.
+#CONFIG_DEBUG_LINUX_TRACING=y
+
+# Enable privilege separation (see README 'Privilege separation' for details)
+#CONFIG_PRIVSEP=y
+
+# Enable mitigation against certain attacks against TKIP by delaying Michael
+# MIC error reports by a random amount of time between 0 and 60 seconds
+#CONFIG_DELAYED_MIC_ERROR_REPORT=y
+
+# Enable tracing code for developer debugging
+# This tracks use of memory allocations and other registrations and reports
+# incorrect use with a backtrace of call (or allocation) location.
+#CONFIG_WPA_TRACE=y
+# For BSD, uncomment these.
+#LIBS += -lexecinfo
+#LIBS_p += -lexecinfo
+#LIBS_c += -lexecinfo
+
+# Use libbfd to get more details for developer debugging
+# This enables use of libbfd to get more detailed symbols for the backtraces
+# generated by CONFIG_WPA_TRACE=y.
+#CONFIG_WPA_TRACE_BFD=y
+# For BSD, uncomment these.
+#LIBS += -lbfd -liberty -lz
+#LIBS_p += -lbfd -liberty -lz
+#LIBS_c += -lbfd -liberty -lz
+
+CONFIG_TLS = %ssl%
+CONFIG_CTRL_IFACE_DBUS=y
+CONFIG_CTRL_IFACE_DBUS_NEW=y
+
+# wpa_supplicant depends on strong random number generation being available
+# from the operating system. os_get_random() function is used to fetch random
+# data when needed, e.g., for key generation. On Linux and BSD systems, this
+# works by reading /dev/urandom. It should be noted that the OS entropy pool
+# needs to be properly initialized before wpa_supplicant is started. This is
+# important especially on embedded devices that do not have a hardware random
+# number generator and may by default start up with minimal entropy available
+# for random number generation.
+#
+# As a safety net, wpa_supplicant is by default trying to internally collect
+# additional entropy for generating random data to mix in with the data fetched
+# from the OS. This by itself is not considered to be very strong, but it may
+# help in cases where the system pool is not initialized properly. However, it
+# is very strongly recommended that the system pool is initialized with enough
+# entropy either by using hardware assisted random number generator or by
+# storing state over device reboots.
+#
+# wpa_supplicant can be configured to maintain its own entropy store over
+# restarts to enhance random number generation. This is not perfect, but it is
+# much more secure than using the same sequence of random numbers after every
+# reboot. This can be enabled with -e<entropy file> command line option. The
+# specified file needs to be readable and writable by wpa_supplicant.
+#
+# If the os_get_random() is known to provide strong random data (e.g., on
+# Linux/BSD, the board in question is known to have reliable source of random
+# data from /dev/urandom), the internal wpa_supplicant random pool can be
+# disabled. This will save some in binary size and CPU use. However, this
+# should only be considered for builds that are known to be used on devices
+# that meet the requirements described above.
+#CONFIG_NO_RANDOM_POOL=y
+
+# IEEE 802.11n (High Throughput) support (mainly for AP mode)
+#CONFIG_IEEE80211N=y
+
+# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode)
+# (depends on CONFIG_IEEE80211N)
+#CONFIG_IEEE80211AC=y
+
+# Wireless Network Management (IEEE Std 802.11v-2011)
+# Note: This is experimental and not complete implementation.
+#CONFIG_WNM=y
+
+# Interworking (IEEE 802.11u)
+# This can be used to enable functionality to improve interworking with
+# external networks (GAS/ANQP to learn more about the networks and network
+# selection based on available credentials).
+#CONFIG_INTERWORKING=y
+
+# Hotspot 2.0
+#CONFIG_HS20=y
+
+# Disable roaming in wpa_supplicant
+#CONFIG_NO_ROAMING=y
+
+# AP mode operations with wpa_supplicant
+# This can be used for controlling AP mode operations with wpa_supplicant. It
+# should be noted that this is mainly aimed at simple cases like
+# WPA2-Personal while more complex configurations like WPA2-Enterprise with an
+# external RADIUS server can be supported with hostapd.
+CONFIG_AP=y
+
+CONFIG_BGSCAN_SIMPLE=y
+
+# P2P (Wi-Fi Direct)
+# This can be used to enable P2P support in wpa_supplicant. See README-P2P for
+# more information on P2P operations.
+#CONFIG_P2P=y
+
+# Enable TDLS support
+#CONFIG_TDLS=y
+
+# Wi-Fi Direct
+# This can be used to enable Wi-Fi Direct extensions for P2P using an external
+# program to control the additional information exchanges in the messages.
+#CONFIG_WIFI_DISPLAY=y
+
+# Autoscan
+# This can be used to enable automatic scan support in wpa_supplicant.
+# See wpa_supplicant.conf for more information on autoscan usage.
+#
+# Enabling directly a module will enable autoscan support.
+# For exponential module:
+CONFIG_AUTOSCAN_EXPONENTIAL=y
+# For periodic module:
+#CONFIG_AUTOSCAN_PERIODIC=y
+
+# Password (and passphrase, etc.) backend for external storage
+# These optional mechanisms can be used to add support for storing passwords
+# and other secrets in external (to wpa_supplicant) location. This allows, for
+# example, operating system specific key storage to be used
+#
+# External password backend for testing purposes (developer use)
+#CONFIG_EXT_PASSWORD_TEST=y
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh
new file mode 100644
index 0000000..5c9e5d3
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa-supplicant.sh
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+
+WPA_SUP_BIN="/usr/sbin/wpa_supplicant"
+WPA_SUP_PNAME="wpa_supplicant"
+WPA_SUP_PIDFILE="/var/run/wpa_supplicant.$IFACE.pid"
+WPA_SUP_OPTIONS="-B -P $WPA_SUP_PIDFILE -i $IFACE"
+
+VERBOSITY=0
+
+
+if [ -s "$IF_WPA_CONF" ]; then
+	WPA_SUP_CONF="-c $IF_WPA_CONF"
+else
+	exit 0
+fi
+
+if [ ! -x "$WPA_SUP_BIN" ]; then
+	
+	if [ "$VERBOSITY" = "1" ]; then
+		echo "$WPA_SUP_PNAME: binaries not executable or missing from $WPA_SUP_BIN"
+	fi
+	
+	exit 1
+fi
+
+if [ "$MODE" = "start" ] ; then
+	# driver type of interface, defaults to wext when undefined
+	if [ -s "/etc/wpa_supplicant/driver.$IFACE" ]; then
+		IF_WPA_DRIVER=$(cat "/etc/wpa_supplicant/driver.$IFACE")
+	elif [ -z "$IF_WPA_DRIVER" ]; then
+		
+		if [ "$VERBOSITY" = "1" ]; then
+			echo "$WPA_SUP_PNAME: wpa-driver not provided, using \"wext\""
+		fi
+		
+		IF_WPA_DRIVER="wext"
+	fi
+	
+	# if we have passed the criteria, start wpa_supplicant
+	if [ -n "$WPA_SUP_CONF" ]; then
+		
+		if [ "$VERBOSITY" = "1" ]; then
+			echo "$WPA_SUP_PNAME: $WPA_SUP_BIN $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER"
+		fi
+		
+		start-stop-daemon --start --quiet \
+			--name $WPA_SUP_PNAME --startas $WPA_SUP_BIN --pidfile $WPA_SUP_PIDFILE \
+			--  $WPA_SUP_OPTIONS $WPA_SUP_CONF -D $IF_WPA_DRIVER
+	fi
+
+	# if the interface socket exists, then wpa_supplicant was invoked successfully
+	if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
+	
+		if [ "$VERBOSITY" = "1" ]; then
+			echo "$WPA_SUP_PNAME: ctrl_interface socket located at $WPA_COMMON_CTRL_IFACE/$IFACE"
+		fi
+
+		exit 0
+		
+	fi
+	
+elif [ "$MODE" = "stop" ]; then
+
+	if [ -f "$WPA_SUP_PIDFILE" ]; then
+		
+		if [ "$VERBOSITY" = "1" ]; then
+			echo "$WPA_SUP_PNAME: terminating $WPA_SUP_PNAME daemon"
+		fi
+		
+		start-stop-daemon --stop --quiet \
+			--name $WPA_SUP_PNAME --pidfile	$WPA_SUP_PIDFILE
+			
+		if [ -S "$WPA_COMMON_CTRL_IFACE/$IFACE" ]; then
+			rm -f $WPA_COMMON_CTRL_IFACE/$IFACE
+		fi
+			
+		if [ -f "$WPA_SUP_PIDFILE" ]; then
+			rm -f $WPA_SUP_PIDFILE
+		fi
+	fi
+
+fi
+
+exit 0
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf
new file mode 100644
index 0000000..68258f5
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf
@@ -0,0 +1,690 @@
+##### Example wpa_supplicant configuration file ###############################
+#
+# This file describes configuration file format and lists all available option.
+# Please also take a look at simpler configuration examples in 'examples'
+# subdirectory.
+#
+# Empty lines and lines starting with # are ignored
+
+# NOTE! This file may contain password information and should probably be made
+# readable only by root user on multiuser systems.
+
+# Note: All file paths in this configuration file should use full (absolute,
+# not relative to working directory) path in order to allow working directory
+# to be changed. This can happen if wpa_supplicant is run in the background.
+
+# Whether to allow wpa_supplicant to update (overwrite) configuration
+#
+# This option can be used to allow wpa_supplicant to overwrite configuration
+# file whenever configuration is changed (e.g., new network block is added with
+# wpa_cli or wpa_gui, or a password is changed). This is required for
+# wpa_cli/wpa_gui to be able to store the configuration changes permanently.
+# Please note that overwriting configuration file will remove the comments from
+# it.
+#update_config=1
+
+# global configuration (shared by all network blocks)
+#
+# Parameters for the control interface. If this is specified, wpa_supplicant
+# will open a control interface that is available for external programs to
+# manage wpa_supplicant. The meaning of this string depends on which control
+# interface mechanism is used. For all cases, the existence of this parameter
+# in configuration is used to determine whether the control interface is
+# enabled.
+#
+# For UNIX domain sockets (default on Linux and BSD): This is a directory that
+# will be created for UNIX domain sockets for listening to requests from
+# external programs (CLI/GUI, etc.) for status information and configuration.
+# The socket file will be named based on the interface name, so multiple
+# wpa_supplicant processes can be run at the same time if more than one
+# interface is used.
+# /var/run/wpa_supplicant is the recommended directory for sockets and by
+# default, wpa_cli will use it when trying to connect with wpa_supplicant.
+#
+# Access control for the control interface can be configured by setting the
+# directory to allow only members of a group to use sockets. This way, it is
+# possible to run wpa_supplicant as root (since it needs to change network
+# configuration and open raw sockets) and still allow GUI/CLI components to be
+# run as non-root users. However, since the control interface can be used to
+# change the network configuration, this access needs to be protected in many
+# cases. By default, wpa_supplicant is configured to use gid 0 (root). If you
+# want to allow non-root users to use the control interface, add a new group
+# and change this value to match with that group. Add users that should have
+# control interface access to this group. If this variable is commented out or
+# not included in the configuration file, group will not be changed from the
+# value it got by default when the directory or socket was created.
+#
+# When configuring both the directory and group, use following format:
+# DIR=/var/run/wpa_supplicant GROUP=wheel
+# DIR=/var/run/wpa_supplicant GROUP=0
+# (group can be either group name or gid)
+#
+# For UDP connections (default on Windows): The value will be ignored. This
+# variable is just used to select that the control interface is to be created.
+# The value can be set to, e.g., udp (ctrl_interface=udp)
+#
+# For Windows Named Pipe: This value can be used to set the security descriptor
+# for controlling access to the control interface. Security descriptor can be
+# set using Security Descriptor String Format (see http://msdn.microsoft.com/
+# library/default.asp?url=/library/en-us/secauthz/security/
+# security_descriptor_string_format.asp). The descriptor string needs to be
+# prefixed with SDDL=. For example, ctrl_interface=SDDL=D: would set an empty
+# DACL (which will reject all connections). See README-Windows.txt for more
+# information about SDDL string format.
+#
+ctrl_interface=/var/run/wpa_supplicant
+
+# IEEE 802.1X/EAPOL version
+# wpa_supplicant is implemented based on IEEE Std 802.1X-2004 which defines
+# EAPOL version 2. However, there are many APs that do not handle the new
+# version number correctly (they seem to drop the frames completely). In order
+# to make wpa_supplicant interoperate with these APs, the version number is set
+# to 1 by default. This configuration value can be used to set it to the new
+# version (2).
+eapol_version=1
+
+# AP scanning/selection
+# By default, wpa_supplicant requests driver to perform AP scanning and then
+# uses the scan results to select a suitable AP. Another alternative is to
+# allow the driver to take care of AP scanning and selection and use
+# wpa_supplicant just to process EAPOL frames based on IEEE 802.11 association
+# information from the driver.
+# 1: wpa_supplicant initiates scanning and AP selection
+# 0: driver takes care of scanning, AP selection, and IEEE 802.11 association
+#    parameters (e.g., WPA IE generation); this mode can also be used with
+#    non-WPA drivers when using IEEE 802.1X mode; do not try to associate with
+#    APs (i.e., external program needs to control association). This mode must
+#    also be used when using wired Ethernet drivers.
+# 2: like 0, but associate with APs using security policy and SSID (but not
+#    BSSID); this can be used, e.g., with ndiswrapper and NDIS drivers to
+#    enable operation with hidden SSIDs and optimized roaming; in this mode,
+#    the network blocks in the configuration file are tried one by one until
+#    the driver reports successful association; each network block should have
+#    explicit security policy (i.e., only one option in the lists) for
+#    key_mgmt, pairwise, group, proto variables
+ap_scan=1
+
+# EAP fast re-authentication
+# By default, fast re-authentication is enabled for all EAP methods that
+# support it. This variable can be used to disable fast re-authentication.
+# Normally, there is no need to disable this.
+fast_reauth=1
+
+# OpenSSL Engine support
+# These options can be used to load OpenSSL engines.
+# The two engines that are supported currently are shown below:
+# They are both from the opensc project (http://www.opensc.org/)
+# By default no engines are loaded.
+# make the opensc engine available
+#opensc_engine_path=/usr/lib/opensc/engine_opensc.so
+# make the pkcs11 engine available
+#pkcs11_engine_path=/usr/lib/opensc/engine_pkcs11.so
+# configure the path to the pkcs11 module required by the pkcs11 engine
+#pkcs11_module_path=/usr/lib/pkcs11/opensc-pkcs11.so
+
+# Dynamic EAP methods
+# If EAP methods were built dynamically as shared object files, they need to be
+# loaded here before being used in the network blocks. By default, EAP methods
+# are included statically in the build, so these lines are not needed
+#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_tls.so
+#load_dynamic_eap=/usr/lib/wpa_supplicant/eap_md5.so
+
+# Driver interface parameters
+# This field can be used to configure arbitrary driver interace parameters. The
+# format is specific to the selected driver interface. This field is not used
+# in most cases.
+#driver_param="field=value"
+
+# Maximum lifetime for PMKSA in seconds; default 43200
+#dot11RSNAConfigPMKLifetime=43200
+# Threshold for reauthentication (percentage of PMK lifetime); default 70
+#dot11RSNAConfigPMKReauthThreshold=70
+# Timeout for security association negotiation in seconds; default 60
+#dot11RSNAConfigSATimeout=60
+
+# network block
+#
+# Each network (usually AP's sharing the same SSID) is configured as a separate
+# block in this configuration file. The network blocks are in preference order
+# (the first match is used).
+#
+# network block fields:
+#
+# disabled:
+#	0 = this network can be used (default)
+#	1 = this network block is disabled (can be enabled through ctrl_iface,
+#	    e.g., with wpa_cli or wpa_gui)
+#
+# id_str: Network identifier string for external scripts. This value is passed
+#	to external action script through wpa_cli as WPA_ID_STR environment
+#	variable to make it easier to do network specific configuration.
+#
+# ssid: SSID (mandatory); either as an ASCII string with double quotation or
+#	as hex string; network name
+#
+# scan_ssid:
+#	0 = do not scan this SSID with specific Probe Request frames (default)
+#	1 = scan with SSID-specific Probe Request frames (this can be used to
+#	    find APs that do not accept broadcast SSID or use multiple SSIDs;
+#	    this will add latency to scanning, so enable this only when needed)
+#
+# bssid: BSSID (optional); if set, this network block is used only when
+#	associating with the AP using the configured BSSID
+#
+# priority: priority group (integer)
+# By default, all networks will get same priority group (0). If some of the
+# networks are more desirable, this field can be used to change the order in
+# which wpa_supplicant goes through the networks when selecting a BSS. The
+# priority groups will be iterated in decreasing priority (i.e., the larger the
+# priority value, the sooner the network is matched against the scan results).
+# Within each priority group, networks will be selected based on security
+# policy, signal strength, etc.
+# Please note that AP scanning with scan_ssid=1 and ap_scan=2 mode are not
+# using this priority to select the order for scanning. Instead, they try the
+# networks in the order that used in the configuration file.
+#
+# mode: IEEE 802.11 operation mode
+# 0 = infrastructure (Managed) mode, i.e., associate with an AP (default)
+# 1 = IBSS (ad-hoc, peer-to-peer)
+# Note: IBSS can only be used with key_mgmt NONE (plaintext and static WEP)
+# and key_mgmt=WPA-NONE (fixed group key TKIP/CCMP). In addition, ap_scan has
+# to be set to 2 for IBSS. WPA-None requires following network block options:
+# proto=WPA, key_mgmt=WPA-NONE, pairwise=NONE, group=TKIP (or CCMP, but not
+# both), and psk must also be set.
+#
+# proto: list of accepted protocols
+# WPA = WPA/IEEE 802.11i/D3.0
+# RSN = WPA2/IEEE 802.11i (also WPA2 can be used as an alias for RSN)
+# If not set, this defaults to: WPA RSN
+#
+# key_mgmt: list of accepted authenticated key management protocols
+# WPA-PSK = WPA pre-shared key (this requires 'psk' field)
+# WPA-EAP = WPA using EAP authentication (this can use an external
+#	program, e.g., Xsupplicant, for IEEE 802.1X EAP Authentication
+# IEEE8021X = IEEE 802.1X using EAP authentication and (optionally) dynamically
+#	generated WEP keys
+# NONE = WPA is not used; plaintext or static WEP could be used
+# If not set, this defaults to: WPA-PSK WPA-EAP
+#
+# auth_alg: list of allowed IEEE 802.11 authentication algorithms
+# OPEN = Open System authentication (required for WPA/WPA2)
+# SHARED = Shared Key authentication (requires static WEP keys)
+# LEAP = LEAP/Network EAP (only used with LEAP)
+# If not set, automatic selection is used (Open System with LEAP enabled if
+# LEAP is allowed as one of the EAP methods).
+#
+# pairwise: list of accepted pairwise (unicast) ciphers for WPA
+# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
+# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
+# NONE = Use only Group Keys (deprecated, should not be included if APs support
+#	pairwise keys)
+# If not set, this defaults to: CCMP TKIP
+#
+# group: list of accepted group (broadcast/multicast) ciphers for WPA
+# CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
+# TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
+# WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key
+# WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key [IEEE 802.11]
+# If not set, this defaults to: CCMP TKIP WEP104 WEP40
+#
+# psk: WPA preshared key; 256-bit pre-shared key
+# The key used in WPA-PSK mode can be entered either as 64 hex-digits, i.e.,
+# 32 bytes or as an ASCII passphrase (in which case, the real PSK will be
+# generated using the passphrase and SSID). ASCII passphrase must be between
+# 8 and 63 characters (inclusive).
+# This field is not needed, if WPA-EAP is used.
+# Note: Separate tool, wpa_passphrase, can be used to generate 256-bit keys
+# from ASCII passphrase. This process uses lot of CPU and wpa_supplicant
+# startup and reconfiguration time can be optimized by generating the PSK only
+# only when the passphrase or SSID has actually changed.
+#
+# eapol_flags: IEEE 802.1X/EAPOL options (bit field)
+# Dynamic WEP key required for non-WPA mode
+# bit0 (1): require dynamically generated unicast WEP key
+# bit1 (2): require dynamically generated broadcast WEP key
+# 	(3 = require both keys; default)
+# Note: When using wired authentication, eapol_flags must be set to 0 for the
+# authentication to be completed successfully.
+#
+# proactive_key_caching:
+# Enable/disable opportunistic PMKSA caching for WPA2.
+# 0 = disabled (default)
+# 1 = enabled
+#
+# wep_key0..3: Static WEP key (ASCII in double quotation, e.g. "abcde" or
+# hex without quotation, e.g., 0102030405)
+# wep_tx_keyidx: Default WEP key index (TX) (0..3)
+#
+# peerkey: Whether PeerKey negotiation for direct links (IEEE 802.11e DLS) is
+# allowed. This is only used with RSN/WPA2.
+# 0 = disabled (default)
+# 1 = enabled
+#peerkey=1
+#
+# Following fields are only used with internal EAP implementation.
+# eap: space-separated list of accepted EAP methods
+#	MD5 = EAP-MD5 (unsecure and does not generate keying material ->
+#			cannot be used with WPA; to be used as a Phase 2 method
+#			with EAP-PEAP or EAP-TTLS)
+#       MSCHAPV2 = EAP-MSCHAPv2 (cannot be used separately with WPA; to be used
+#		as a Phase 2 method with EAP-PEAP or EAP-TTLS)
+#       OTP = EAP-OTP (cannot be used separately with WPA; to be used
+#		as a Phase 2 method with EAP-PEAP or EAP-TTLS)
+#       GTC = EAP-GTC (cannot be used separately with WPA; to be used
+#		as a Phase 2 method with EAP-PEAP or EAP-TTLS)
+#	TLS = EAP-TLS (client and server certificate)
+#	PEAP = EAP-PEAP (with tunnelled EAP authentication)
+#	TTLS = EAP-TTLS (with tunnelled EAP or PAP/CHAP/MSCHAP/MSCHAPV2
+#			 authentication)
+#	If not set, all compiled in methods are allowed.
+#
+# identity: Identity string for EAP
+# anonymous_identity: Anonymous identity string for EAP (to be used as the
+#	unencrypted identity with EAP types that support different tunnelled
+#	identity, e.g., EAP-TTLS)
+# password: Password string for EAP
+# ca_cert: File path to CA certificate file (PEM/DER). This file can have one
+#	or more trusted CA certificates. If ca_cert and ca_path are not
+#	included, server certificate will not be verified. This is insecure and
+#	a trusted CA certificate should always be configured when using
+#	EAP-TLS/TTLS/PEAP. Full path should be used since working directory may
+#	change when wpa_supplicant is run in the background.
+#	On Windows, trusted CA certificates can be loaded from the system
+#	certificate store by setting this to cert_store://<name>, e.g.,
+#	ca_cert="cert_store://CA" or ca_cert="cert_store://ROOT".
+#	Note that when running wpa_supplicant as an application, the user
+#	certificate store (My user account) is used, whereas computer store
+#	(Computer account) is used when running wpasvc as a service.
+# ca_path: Directory path for CA certificate files (PEM). This path may
+#	contain multiple CA certificates in OpenSSL format. Common use for this
+#	is to point to system trusted CA list which is often installed into
+#	directory like /etc/ssl/certs. If configured, these certificates are
+#	added to the list of trusted CAs. ca_cert may also be included in that
+#	case, but it is not required.
+# client_cert: File path to client certificate file (PEM/DER)
+#	Full path should be used since working directory may change when
+#	wpa_supplicant is run in the background.
+#	Alternatively, a named configuration blob can be used by setting this
+#	to blob://<blob name>.
+# private_key: File path to client private key file (PEM/DER/PFX)
+#	When PKCS#12/PFX file (.p12/.pfx) is used, client_cert should be
+#	commented out. Both the private key and certificate will be read from
+#	the PKCS#12 file in this case. Full path should be used since working
+#	directory may change when wpa_supplicant is run in the background.
+#	Windows certificate store can be used by leaving client_cert out and
+#	configuring private_key in one of the following formats:
+#	cert://substring_to_match
+#	hash://certificate_thumbprint_in_hex
+#	for example: private_key="hash://63093aa9c47f56ae88334c7b65a4"
+#	Note that when running wpa_supplicant as an application, the user
+#	certificate store (My user account) is used, whereas computer store
+#	(Computer account) is used when running wpasvc as a service.
+#	Alternatively, a named configuration blob can be used by setting this
+#	to blob://<blob name>.
+# private_key_passwd: Password for private key file (if left out, this will be
+#	asked through control interface)
+# dh_file: File path to DH/DSA parameters file (in PEM format)
+#	This is an optional configuration file for setting parameters for an
+#	ephemeral DH key exchange. In most cases, the default RSA
+#	authentication does not use this configuration. However, it is possible
+#	setup RSA to use ephemeral DH key exchange. In addition, ciphers with
+#	DSA keys always use ephemeral DH keys. This can be used to achieve
+#	forward secrecy. If the file is in DSA parameters format, it will be
+#	automatically converted into DH params.
+# subject_match: Substring to be matched against the subject of the
+#	authentication server certificate. If this string is set, the server
+#	sertificate is only accepted if it contains this string in the subject.
+#	The subject string is in following format:
+#	/C=US/ST=CA/L=San Francisco/CN=Test AS/emailAddress=as@example.com
+# altsubject_match: Semicolon separated string of entries to be matched against
+#	the alternative subject name of the authentication server certificate.
+#	If this string is set, the server sertificate is only accepted if it
+#	contains one of the entries in an alternative subject name extension.
+#	altSubjectName string is in following format: TYPE:VALUE
+#	Example: EMAIL:server@example.com
+#	Example: DNS:server.example.com;DNS:server2.example.com
+#	Following types are supported: EMAIL, DNS, URI
+# phase1: Phase1 (outer authentication, i.e., TLS tunnel) parameters
+#	(string with field-value pairs, e.g., "peapver=0" or
+#	"peapver=1 peaplabel=1")
+#	'peapver' can be used to force which PEAP version (0 or 1) is used.
+#	'peaplabel=1' can be used to force new label, "client PEAP encryption",
+#	to be used during key derivation when PEAPv1 or newer. Most existing
+#	PEAPv1 implementation seem to be using the old label, "client EAP
+#	encryption", and wpa_supplicant is now using that as the default value.
+#	Some servers, e.g., Radiator, may require peaplabel=1 configuration to
+#	interoperate with PEAPv1; see eap_testing.txt for more details.
+#	'peap_outer_success=0' can be used to terminate PEAP authentication on
+#	tunneled EAP-Success. This is required with some RADIUS servers that
+#	implement draft-josefsson-pppext-eap-tls-eap-05.txt (e.g.,
+#	Lucent NavisRadius v4.4.0 with PEAP in "IETF Draft 5" mode)
+#	include_tls_length=1 can be used to force wpa_supplicant to include
+#	TLS Message Length field in all TLS messages even if they are not
+#	fragmented.
+#	sim_min_num_chal=3 can be used to configure EAP-SIM to require three
+#	challenges (by default, it accepts 2 or 3)
+# phase2: Phase2 (inner authentication with TLS tunnel) parameters
+#	(string with field-value pairs, e.g., "auth=MSCHAPV2" for EAP-PEAP or
+#	"autheap=MSCHAPV2 autheap=MD5" for EAP-TTLS)
+# Following certificate/private key fields are used in inner Phase2
+# authentication when using EAP-TTLS or EAP-PEAP.
+# ca_cert2: File path to CA certificate file. This file can have one or more
+#	trusted CA certificates. If ca_cert2 and ca_path2 are not included,
+#	server certificate will not be verified. This is insecure and a trusted
+#	CA certificate should always be configured.
+# ca_path2: Directory path for CA certificate files (PEM)
+# client_cert2: File path to client certificate file
+# private_key2: File path to client private key file
+# private_key2_passwd: Password for private key file
+# dh_file2: File path to DH/DSA parameters file (in PEM format)
+# subject_match2: Substring to be matched against the subject of the
+#	authentication server certificate.
+# altsubject_match2: Substring to be matched against the alternative subject
+#	name of the authentication server certificate.
+#
+# fragment_size: Maximum EAP fragment size in bytes (default 1398).
+#	This value limits the fragment size for EAP methods that support
+#	fragmentation (e.g., EAP-TLS and EAP-PEAP). This value should be set
+#	small enough to make the EAP messages fit in MTU of the network
+#	interface used for EAPOL. The default value is suitable for most
+#	cases.
+#
+# EAP-PSK variables:
+# eappsk: 16-byte (128-bit, 32 hex digits) pre-shared key in hex format
+# nai: user NAI
+#
+# EAP-PAX variables:
+# eappsk: 16-byte (128-bit, 32 hex digits) pre-shared key in hex format
+#
+# EAP-SAKE variables:
+# eappsk: 32-byte (256-bit, 64 hex digits) pre-shared key in hex format
+#	(this is concatenation of Root-Secret-A and Root-Secret-B)
+# nai: user NAI (PEERID)
+#
+# EAP-GPSK variables:
+# eappsk: Pre-shared key in hex format (at least 128 bits, i.e., 32 hex digits)
+# nai: user NAI (ID_Client)
+#
+# EAP-FAST variables:
+# pac_file: File path for the PAC entries. wpa_supplicant will need to be able
+#	to create this file and write updates to it when PAC is being
+#	provisioned or refreshed. Full path to the file should be used since
+#	working directory may change when wpa_supplicant is run in the
+#	background. Alternatively, a named configuration blob can be used by
+#	setting this to blob://<blob name>
+# phase1: fast_provisioning=1 option enables in-line provisioning of EAP-FAST
+#	credentials (PAC)
+#
+# wpa_supplicant supports number of "EAP workarounds" to work around
+# interoperability issues with incorrectly behaving authentication servers.
+# These are enabled by default because some of the issues are present in large
+# number of authentication servers. Strict EAP conformance mode can be
+# configured by disabling workarounds with eap_workaround=0.
+
+# Example blocks:
+
+# Simple case: WPA-PSK, PSK as an ASCII passphrase, allow all valid ciphers
+network={
+	ssid="simple"
+	psk="very secret passphrase"
+	priority=5
+}
+
+# Same as previous, but request SSID-specific scanning (for APs that reject
+# broadcast SSID)
+network={
+	ssid="second ssid"
+	scan_ssid=1
+	psk="very secret passphrase"
+	priority=2
+}
+
+# Only WPA-PSK is used. Any valid cipher combination is accepted.
+network={
+	ssid="example"
+	proto=WPA
+	key_mgmt=WPA-PSK
+	pairwise=CCMP TKIP
+	group=CCMP TKIP WEP104 WEP40
+	psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
+	priority=2
+}
+
+# Only WPA-EAP is used. Both CCMP and TKIP is accepted. An AP that used WEP104
+# or WEP40 as the group cipher will not be accepted.
+network={
+	ssid="example"
+	proto=RSN
+	key_mgmt=WPA-EAP
+	pairwise=CCMP TKIP
+	group=CCMP TKIP
+	eap=TLS
+	identity="user@example.com"
+	ca_cert="/etc/cert/ca.pem"
+	client_cert="/etc/cert/user.pem"
+	private_key="/etc/cert/user.prv"
+	private_key_passwd="password"
+	priority=1
+}
+
+# EAP-PEAP/MSCHAPv2 configuration for RADIUS servers that use the new peaplabel
+# (e.g., Radiator)
+network={
+	ssid="example"
+	key_mgmt=WPA-EAP
+	eap=PEAP
+	identity="user@example.com"
+	password="foobar"
+	ca_cert="/etc/cert/ca.pem"
+	phase1="peaplabel=1"
+	phase2="auth=MSCHAPV2"
+	priority=10
+}
+
+# EAP-TTLS/EAP-MD5-Challenge configuration with anonymous identity for the
+# unencrypted use. Real identity is sent only within an encrypted TLS tunnel.
+network={
+	ssid="example"
+	key_mgmt=WPA-EAP
+	eap=TTLS
+	identity="user@example.com"
+	anonymous_identity="anonymous@example.com"
+	password="foobar"
+	ca_cert="/etc/cert/ca.pem"
+	priority=2
+}
+
+# EAP-TTLS/MSCHAPv2 configuration with anonymous identity for the unencrypted
+# use. Real identity is sent only within an encrypted TLS tunnel.
+network={
+	ssid="example"
+	key_mgmt=WPA-EAP
+	eap=TTLS
+	identity="user@example.com"
+	anonymous_identity="anonymous@example.com"
+	password="foobar"
+	ca_cert="/etc/cert/ca.pem"
+	phase2="auth=MSCHAPV2"
+}
+
+# WPA-EAP, EAP-TTLS with different CA certificate used for outer and inner
+# authentication.
+network={
+	ssid="example"
+	key_mgmt=WPA-EAP
+	eap=TTLS
+	# Phase1 / outer authentication
+	anonymous_identity="anonymous@example.com"
+	ca_cert="/etc/cert/ca.pem"
+	# Phase 2 / inner authentication
+	phase2="autheap=TLS"
+	ca_cert2="/etc/cert/ca2.pem"
+	client_cert2="/etc/cer/user.pem"
+	private_key2="/etc/cer/user.prv"
+	private_key2_passwd="password"
+	priority=2
+}
+
+# Both WPA-PSK and WPA-EAP is accepted. Only CCMP is accepted as pairwise and
+# group cipher.
+network={
+	ssid="example"
+	bssid=00:11:22:33:44:55
+	proto=WPA RSN
+	key_mgmt=WPA-PSK WPA-EAP
+	pairwise=CCMP
+	group=CCMP
+	psk=06b4be19da289f475aa46a33cb793029d4ab3db7a23ee92382eb0106c72ac7bb
+}
+
+# Special characters in SSID, so use hex string. Default to WPA-PSK, WPA-EAP
+# and all valid ciphers.
+network={
+	ssid=00010203
+	psk=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
+}
+
+
+# IEEE 802.1X/EAPOL with dynamically generated WEP keys (i.e., no WPA) using
+# EAP-TLS for authentication and key generation; require both unicast and
+# broadcast WEP keys.
+network={
+	ssid="1x-test"
+	key_mgmt=IEEE8021X
+	eap=TLS
+	identity="user@example.com"
+	ca_cert="/etc/cert/ca.pem"
+	client_cert="/etc/cert/user.pem"
+	private_key="/etc/cert/user.prv"
+	private_key_passwd="password"
+	eapol_flags=3
+}
+
+
+# LEAP with dynamic WEP keys
+network={
+	ssid="leap-example"
+	key_mgmt=IEEE8021X
+	eap=LEAP
+	identity="user"
+	password="foobar"
+}
+
+# Plaintext connection (no WPA, no IEEE 802.1X)
+network={
+	ssid="plaintext-test"
+	key_mgmt=NONE
+}
+
+
+# Shared WEP key connection (no WPA, no IEEE 802.1X)
+network={
+	ssid="static-wep-test"
+	key_mgmt=NONE
+	wep_key0="abcde"
+	wep_key1=0102030405
+	wep_key2="1234567890123"
+	wep_tx_keyidx=0
+	priority=5
+}
+
+
+# Shared WEP key connection (no WPA, no IEEE 802.1X) using Shared Key
+# IEEE 802.11 authentication
+network={
+	ssid="static-wep-test2"
+	key_mgmt=NONE
+	wep_key0="abcde"
+	wep_key1=0102030405
+	wep_key2="1234567890123"
+	wep_tx_keyidx=0
+	priority=5
+	auth_alg=SHARED
+}
+
+
+# IBSS/ad-hoc network with WPA-None/TKIP.
+network={
+	ssid="test adhoc"
+	mode=1
+	proto=WPA
+	key_mgmt=WPA-NONE
+	pairwise=NONE
+	group=TKIP
+	psk="secret passphrase"
+}
+
+
+# Catch all example that allows more or less all configuration modes
+network={
+	ssid="example"
+	scan_ssid=1
+	key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
+	pairwise=CCMP TKIP
+	group=CCMP TKIP WEP104 WEP40
+	psk="very secret passphrase"
+	eap=TTLS PEAP TLS
+	identity="user@example.com"
+	password="foobar"
+	ca_cert="/etc/cert/ca.pem"
+	client_cert="/etc/cert/user.pem"
+	private_key="/etc/cert/user.prv"
+	private_key_passwd="password"
+	phase1="peaplabel=0"
+}
+
+# Example of EAP-TLS with smartcard (openssl engine)
+network={
+	ssid="example"
+	key_mgmt=WPA-EAP
+	eap=TLS
+	proto=RSN
+	pairwise=CCMP TKIP
+	group=CCMP TKIP
+	identity="user@example.com"
+	ca_cert="/etc/cert/ca.pem"
+	client_cert="/etc/cert/user.pem"
+
+	engine=1
+
+	# The engine configured here must be available. Look at
+	# OpenSSL engine support in the global section.
+	# The key available through the engine must be the private key
+	# matching the client certificate configured above.
+
+	# use the opensc engine
+	#engine_id="opensc"
+	#key_id="45"
+
+	# use the pkcs11 engine
+	engine_id="pkcs11"
+	key_id="id_45"
+
+	# Optional PIN configuration; this can be left out and PIN will be
+	# asked through the control interface
+	pin="1234"
+}
+
+# Example configuration showing how to use an inlined blob as a CA certificate
+# data instead of using external file
+network={
+	ssid="example"
+	key_mgmt=WPA-EAP
+	eap=TTLS
+	identity="user@example.com"
+	anonymous_identity="anonymous@example.com"
+	password="foobar"
+	ca_cert="blob://exampleblob"
+	priority=20
+}
+
+blob-base64-exampleblob={
+SGVsbG8gV29ybGQhCg==
+}
+
+
+# Wildcard match for SSID (plaintext APs only). This example select any
+# open AP regardless of its SSID.
+network={
+	key_mgmt=NONE
+}
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane
new file mode 100644
index 0000000..c91ffe0
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant/wpa_supplicant.conf-sane
@@ -0,0 +1,7 @@
+ctrl_interface=/var/run/wpa_supplicant
+ctrl_interface_group=0
+update_config=1
+
+network={
+        key_mgmt=NONE
+}
diff --git a/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.4.bb b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.4.bb
new file mode 100644
index 0000000..a124cf2
--- /dev/null
+++ b/meta/recipes-connectivity/wpa-supplicant/wpa-supplicant_2.4.bb
@@ -0,0 +1,116 @@
+SUMMARY = "Client for Wi-Fi Protected Access (WPA)"
+HOMEPAGE = "http://hostap.epitest.fi/wpa_supplicant/"
+BUGTRACKER = "http://hostap.epitest.fi/bugz/"
+SECTION = "network"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=36b27801447e0662ee0138d17fe93880 \
+                    file://README;beginline=1;endline=56;md5=7f393579f8b109fe91f3b9765d26c7d3 \
+                    file://wpa_supplicant/wpa_supplicant.c;beginline=1;endline=12;md5=3430fda79f2ba1dd545f0b3c4d6e4d24 "
+DEPENDS = "dbus libnl libgcrypt"
+RRECOMMENDS_${PN} = "wpa-supplicant-passphrase wpa-supplicant-cli"
+
+PACKAGECONFIG ??= "gnutls"
+PACKAGECONFIG[gnutls] = ",,gnutls"
+PACKAGECONFIG[openssl] = ",,openssl"
+
+inherit systemd
+
+SYSTEMD_SERVICE_${PN} = "wpa_supplicant.service wpa_supplicant-nl80211@.service wpa_supplicant-wired@.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
+SRC_URI = "http://hostap.epitest.fi/releases/wpa_supplicant-${PV}.tar.gz \
+           file://defconfig \
+           file://wpa-supplicant.sh \
+           file://wpa_supplicant.conf \
+           file://wpa_supplicant.conf-sane \
+           file://99_wpa_supplicant \
+           file://0001-AP-WMM-Fix-integer-underflow-in-WMM-Action-frame-par.patch \
+           file://0001-P2P-Validate-SSID-element-length-before-copying-it-C.patch \
+           file://0001-WPS-Fix-HTTP-chunked-transfer-encoding-parser.patch \
+           file://0001-EAP-pwd-peer-Fix-payload-length-validation-for-Commi.patch \
+           file://0002-EAP-pwd-server-Fix-payload-length-validation-for-Com.patch \
+           file://0003-EAP-pwd-peer-Fix-Total-Length-parsing-for-fragment-r.patch \
+           file://0004-EAP-pwd-server-Fix-Total-Length-parsing-for-fragment.patch \
+           file://0005-EAP-pwd-peer-Fix-asymmetric-fragmentation-behavior.patch \
+          "
+SRC_URI[md5sum] = "f0037dbe03897dcaf2ad2722e659095d"
+SRC_URI[sha256sum] = "058dc832c096139a059e6df814080f50251a8d313c21b13364c54a1e70109122"
+
+S = "${WORKDIR}/wpa_supplicant-${PV}"
+
+PACKAGES_prepend = "wpa-supplicant-passphrase wpa-supplicant-cli "
+FILES_wpa-supplicant-passphrase = "${bindir}/wpa_passphrase"
+FILES_wpa-supplicant-cli = "${sbindir}/wpa_cli"
+FILES_${PN} += "${datadir}/dbus-1/system-services/*"
+CONFFILES_${PN} += "${sysconfdir}/wpa_supplicant.conf"
+
+do_configure () {
+	${MAKE} -C wpa_supplicant clean
+	install -m 0755 ${WORKDIR}/defconfig wpa_supplicant/.config
+	echo "CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
+	echo "DRV_CFLAGS +=\"-I${STAGING_INCDIR}/libnl3\"" >> wpa_supplicant/.config
+	
+	if echo "${PACKAGECONFIG}" | grep -qw "openssl"; then
+        	ssl=openssl
+	elif echo "${PACKAGECONFIG}" | grep -qw "gnutls"; then
+        	ssl=gnutls
+	fi
+	if [ -n "$ssl" ]; then
+        	sed -i "s/%ssl%/$ssl/" wpa_supplicant/.config
+	fi
+
+	# For rebuild
+	rm -f wpa_supplicant/*.d wpa_supplicant/dbus/*.d
+}
+
+export EXTRA_CFLAGS = "${CFLAGS}"
+export BINDIR = "${sbindir}"
+
+do_compile () {
+	unset CFLAGS CPPFLAGS CXXFLAGS
+	sed -e "s:CFLAGS\ =.*:& \$(EXTRA_CFLAGS):g" -i ${S}/src/lib.rules
+	oe_runmake -C wpa_supplicant
+}
+
+do_install () {
+	install -d ${D}${sbindir}
+	install -m 755 wpa_supplicant/wpa_supplicant ${D}${sbindir}
+	install -m 755 wpa_supplicant/wpa_cli        ${D}${sbindir}
+
+	install -d ${D}${bindir}
+	install -m 755 wpa_supplicant/wpa_passphrase ${D}${bindir}
+
+	install -d ${D}${docdir}/wpa_supplicant
+	install -m 644 wpa_supplicant/README ${WORKDIR}/wpa_supplicant.conf ${D}${docdir}/wpa_supplicant
+
+	install -d ${D}${sysconfdir}
+	install -m 600 ${WORKDIR}/wpa_supplicant.conf-sane ${D}${sysconfdir}/wpa_supplicant.conf
+
+	install -d ${D}${sysconfdir}/network/if-pre-up.d/
+	install -d ${D}${sysconfdir}/network/if-post-down.d/
+	install -d ${D}${sysconfdir}/network/if-down.d/
+	install -m 755 ${WORKDIR}/wpa-supplicant.sh ${D}${sysconfdir}/network/if-pre-up.d/wpa-supplicant
+	cd ${D}${sysconfdir}/network/ && \
+	ln -sf ../if-pre-up.d/wpa-supplicant if-post-down.d/wpa-supplicant
+
+	install -d ${D}/${sysconfdir}/dbus-1/system.d
+	install -m 644 ${S}/wpa_supplicant/dbus/dbus-wpa_supplicant.conf ${D}/${sysconfdir}/dbus-1/system.d
+	install -d ${D}/${datadir}/dbus-1/system-services
+	install -m 644 ${S}/wpa_supplicant/dbus/*.service ${D}/${datadir}/dbus-1/system-services
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		install -d ${D}/${systemd_unitdir}/system
+		install -m 644 ${S}/wpa_supplicant/systemd/*.service ${D}/${systemd_unitdir}/system
+	fi
+
+	install -d ${D}/etc/default/volatiles
+	install -m 0644 ${WORKDIR}/99_wpa_supplicant ${D}/etc/default/volatiles
+}
+
+pkg_postinst_wpa-supplicant () {
+	# If we're offline, we don't need to do this.
+	if [ "x$D" = "x" ]; then
+		killall -q -HUP dbus-daemon || true
+	fi
+
+}
diff --git a/meta/recipes-core/base-files/base-files/filesystems b/meta/recipes-core/base-files/base-files/filesystems
new file mode 100644
index 0000000..7e6c41c
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/filesystems
@@ -0,0 +1,8 @@
+ext4
+ext3
+ext2
+vfat
+fat
+btrfs
+minix
+*
diff --git a/meta/recipes-core/base-files/base-files/fstab b/meta/recipes-core/base-files/base-files/fstab
new file mode 100644
index 0000000..d79a016
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/fstab
@@ -0,0 +1,11 @@
+# stock fstab - you probably want to override this with a machine specific one
+
+/dev/root            /                    auto       defaults              1  1
+proc                 /proc                proc       defaults              0  0
+devpts               /dev/pts             devpts     mode=0620,gid=5       0  0
+tmpfs                /run                 tmpfs      mode=0755,nodev,nosuid,strictatime 0  0
+tmpfs                /var/volatile        tmpfs      defaults              0  0
+
+# uncomment this if your device has a SD/MMC/Transflash slot
+#/dev/mmcblk0p1       /media/card          auto       defaults,sync,noauto  0  0
+
diff --git a/meta/recipes-core/base-files/base-files/host.conf b/meta/recipes-core/base-files/base-files/host.conf
new file mode 100644
index 0000000..1a8c1e1
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/host.conf
@@ -0,0 +1,2 @@
+order hosts,bind
+multi on
diff --git a/meta/recipes-core/base-files/base-files/inputrc b/meta/recipes-core/base-files/base-files/inputrc
new file mode 100644
index 0000000..b5c4c8a
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/inputrc
@@ -0,0 +1,61 @@
+# /etc/inputrc - global inputrc for libreadline
+# See readline(3readline) and `info rluserman' for more information.
+
+# Be 8 bit clean.
+set input-meta on
+set output-meta on
+
+# To allow the use of 8bit-characters like the german umlauts, comment out
+# the line below. However this makes the meta key not work as a meta key,
+# which is annoying to those which don't need to type in 8-bit characters.
+
+# set convert-meta off
+
+# try to enable the application keypad when it is called.  Some systems
+# need this to enable the arrow keys.
+# set enable-keypad on
+
+# see /usr/share/doc/bash/inputrc.arrows for other codes of arrow keys
+
+# do not bell on tab-completion 
+# set bell-style none 
+
+# some defaults / modifications for the emacs mode
+$if mode=emacs
+
+# allow the use of the Home/End keys
+# "\e[1~": beginning-of-line
+# "\e[4~": end-of-line
+
+# allow the use of the Delete/Insert keys
+# "\e[3~": delete-char
+# "\e[2~": quoted-insert
+
+# mappings for "page up" and "page down" to step to the beginning/end 
+# of the history
+# "\e[5~": beginning-of-history
+# "\e[6~": end-of-history
+
+# alternate mappings for "page up" and "page down" to search the history
+# "\e[5~": history-search-backward
+# "\e[6~": history-search-forward
+
+# # mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
+# "\e[5C": forward-word
+# "\e[5D": backward-word
+# "\e\e[C": forward-word
+# "\e\e[D": backward-word
+
+# $if term=rxvt
+# "\e[8~": end-of-line
+# $endif
+
+# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
+# "\eOH": beginning-of-line
+# "\eOF": end-of-line
+
+# for freebsd console
+# "\e[H": beginning-of-line
+# "\e[F": end-of-line
+
+$endif
diff --git a/meta/recipes-core/base-files/base-files/issue b/meta/recipes-core/base-files/base-files/issue
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/issue
diff --git a/meta/recipes-core/base-files/base-files/issue.net b/meta/recipes-core/base-files/base-files/issue.net
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/issue.net
diff --git a/meta/recipes-core/base-files/base-files/licenses/GPL-2 b/meta/recipes-core/base-files/base-files/licenses/GPL-2
new file mode 100644
index 0000000..d60c31a
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/licenses/GPL-2
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/meta/recipes-core/base-files/base-files/motd b/meta/recipes-core/base-files/base-files/motd
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/motd
diff --git a/meta/recipes-core/base-files/base-files/nsswitch.conf b/meta/recipes-core/base-files/base-files/nsswitch.conf
new file mode 100644
index 0000000..06f03d2
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/nsswitch.conf
@@ -0,0 +1,19 @@
+# /etc/nsswitch.conf
+#
+# Example configuration of GNU Name Service Switch functionality.
+# If you have the `glibc-doc' and `info' packages installed, try:
+# `info libc "Name Service Switch"' for information about this file.
+
+passwd:         compat
+group:          compat
+shadow:         compat
+
+hosts:          files dns
+networks:       files
+
+protocols:      db files
+services:       db files
+ethers:         db files
+rpc:            db files
+
+netgroup:       nis
diff --git a/meta/recipes-core/base-files/base-files/profile b/meta/recipes-core/base-files/base-files/profile
new file mode 100644
index 0000000..53c2680
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/profile
@@ -0,0 +1,36 @@
+# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
+# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
+
+PATH="/usr/local/bin:/usr/bin:/bin"
+EDITOR="vi"			# needed for packages like cron, git-commit
+test -z "$TERM" && TERM="vt100"	# Basic terminal capab. For screen etc.
+
+if [ ! -e /etc/localtime -a ! -e /etc/TZ ]; then
+	TZ="UTC"		# Time Zone. Look at http://theory.uwinnipeg.ca/gnu/glibc/libc_303.html 
+				# for an explanation of how to set this to your local timezone.
+	export TZ
+fi
+
+if [ "$HOME" = "ROOTHOME" ]; then
+   PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
+fi
+if [ "$PS1" ]; then
+# works for bash and ash (no other shells known to be in use here)
+   PS1='\u@\h:\w\$ '
+fi
+
+if [ -d /etc/profile.d ]; then
+  for i in /etc/profile.d/* ; do
+    . $i
+  done
+  unset i
+fi
+
+if [ -x /usr/bin/resize ];then
+  /usr/bin/resize >/dev/null
+fi
+
+export PATH PS1 OPIEDIR QPEDIR QTDIR EDITOR TERM
+
+umask 022
+
diff --git a/meta/recipes-core/base-files/base-files/rotation b/meta/recipes-core/base-files/base-files/rotation
new file mode 100644
index 0000000..c227083
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/rotation
@@ -0,0 +1 @@
+0
\ No newline at end of file
diff --git a/meta/recipes-core/base-files/base-files/share/dot.bashrc b/meta/recipes-core/base-files/base-files/share/dot.bashrc
new file mode 100644
index 0000000..4be6368
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/share/dot.bashrc
@@ -0,0 +1,16 @@
+# ~/.bashrc: executed by bash(1) for non-login shells.
+
+export PS1='\h:\w\$ '
+umask 022
+
+# You may uncomment the following lines if you want `ls' to be colorized:
+# export LS_OPTIONS='--color=auto'
+# eval `dircolors`
+# alias ls='ls $LS_OPTIONS'
+# alias ll='ls $LS_OPTIONS -l'
+# alias l='ls $LS_OPTIONS -lA'
+#
+# Some more alias to avoid making mistakes:
+# alias rm='rm -i'
+# alias cp='cp -i'
+# alias mv='mv -i'
diff --git a/meta/recipes-core/base-files/base-files/share/dot.profile b/meta/recipes-core/base-files/base-files/share/dot.profile
new file mode 100644
index 0000000..979793e
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/share/dot.profile
@@ -0,0 +1,10 @@
+# ~/.profile: executed by Bourne-compatible login shells.
+
+if [ -f ~/.bashrc ]; then
+  . ~/.bashrc
+fi
+
+# path set by /etc/profile
+# export PATH
+
+mesg n
diff --git a/meta/recipes-core/base-files/base-files/shells b/meta/recipes-core/base-files/base-files/shells
new file mode 100644
index 0000000..3f63987
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/shells
@@ -0,0 +1,2 @@
+# /etc/shells: valid login shells
+/bin/sh
diff --git a/meta/recipes-core/base-files/base-files/usbd b/meta/recipes-core/base-files/base-files/usbd
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files/usbd
diff --git a/meta/recipes-core/base-files/base-files_3.0.14.bb b/meta/recipes-core/base-files/base-files_3.0.14.bb
new file mode 100644
index 0000000..e16fe72
--- /dev/null
+++ b/meta/recipes-core/base-files/base-files_3.0.14.bb
@@ -0,0 +1,178 @@
+SUMMARY = "Miscellaneous files for the base system"
+DESCRIPTION = "The base-files package creates the basic system directory structure and provides a small set of key configuration files for the system."
+SECTION = "base"
+PR = "r89"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://licenses/GPL-2;md5=94d55d512a9ba36caa9b7df079bae19f"
+# Removed all license related tasks in this recipe as license.bbclass 
+# now deals with this. In order to get accurate licensing on to the image:
+# Set COPY_LIC_MANIFEST to just copy just the license.manifest to the image
+# For the manifest and the license text for each package:
+# Set COPY_LIC_MANIFEST and COPY_LIC_DIRS
+
+SRC_URI = "file://rotation \
+           file://nsswitch.conf \
+           file://motd \
+           file://inputrc \
+           file://host.conf \
+           file://profile \
+           file://shells \
+           file://fstab \
+           file://filesystems \
+           file://issue.net \
+           file://issue \
+           file://usbd \
+           file://share/dot.bashrc \
+           file://share/dot.profile \
+           file://licenses/GPL-2 \
+           "
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+docdir_append = "/${P}"
+dirs1777 = "/tmp ${localstatedir}/volatile/tmp"
+dirs2775 = ""
+dirs755 = "/bin /boot /dev ${sysconfdir} ${sysconfdir}/default \
+           ${sysconfdir}/skel /lib /mnt /proc ${ROOT_HOME} /run /sbin \
+           ${prefix} ${bindir} ${docdir} /usr/games ${includedir} \
+           ${libdir} ${sbindir} ${datadir} \
+           ${datadir}/common-licenses ${datadir}/dict ${infodir} \
+           ${mandir} ${datadir}/misc ${localstatedir} \
+           ${localstatedir}/backups ${localstatedir}/lib \
+           /sys ${localstatedir}/lib/misc ${localstatedir}/spool \
+           ${localstatedir}/volatile \
+           ${localstatedir}/volatile/log \
+           /home ${prefix}/src ${localstatedir}/local \
+           /media"
+
+dirs755-lsb = "/srv  \
+               ${prefix}/local ${prefix}/local/bin ${prefix}/local/games \
+               ${prefix}/local/include ${prefix}/local/lib ${prefix}/local/sbin \
+               ${prefix}/local/share ${prefix}/local/src \
+               ${prefix}/lib/locale"
+dirs2775-lsb = "/var/mail"
+
+volatiles = "log tmp"
+conffiles = "${sysconfdir}/debian_version ${sysconfdir}/host.conf \
+             ${sysconfdir}/inputrc ${sysconfdir}/issue /${sysconfdir}/issue.net \
+             ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile \
+             ${sysconfdir}/default"
+
+# By default the hostname is the machine name. If the hostname is unset then a
+# /etc/hostname file isn't written, suitable for environments with dynamic
+# hostnames.
+#
+# The hostname can be changed outside of this recipe by using
+# hostname_pn-base-files = "my-host-name".
+hostname = "${MACHINE}"
+
+BASEFILESISSUEINSTALL ?= "do_install_basefilesissue"
+
+# In previous versions of base-files, /run was a softlink to /var/run and the
+# directory was located in /var/volatlie/run.  Also, /var/lock was a softlink
+# to /var/volatile/lock which is where the real directory was located.  Now,
+# /run and /run/lock are the real directories.  If we are upgrading, we may
+# need to remove the symbolic links first before we create the directories.
+# Otherwise the directory creation will fail and we will have circular symbolic
+# links.
+# 
+pkg_preinst_${PN} () {
+    #!/bin/sh -e
+    if [ x"$D" = "x" ]; then
+        if [ -h "/var/lock" ]; then
+            # Remove the symbolic link
+            rm -f /var/lock
+        fi
+
+        if [ -h "/run" ]; then
+            # Remove the symbolic link
+            rm -f /run
+        fi
+    fi     
+}
+
+do_install () {
+	for d in ${dirs755}; do
+		install -m 0755 -d ${D}$d
+	done
+	for d in ${dirs1777}; do
+		install -m 1777 -d ${D}$d
+	done
+	for d in ${dirs2775}; do
+		install -m 2775 -d ${D}$d
+	done
+	for d in ${volatiles}; do
+		ln -sf volatile/$d ${D}${localstatedir}/$d
+	done
+
+	ln -snf ../run ${D}${localstatedir}/run
+	ln -snf ../run/lock ${D}${localstatedir}/lock
+
+	${BASEFILESISSUEINSTALL}
+
+	rotation=`cat ${WORKDIR}/rotation`
+	if [ "$rotation" != "0" ]; then
+ 		install -m 0644 ${WORKDIR}/rotation ${D}${sysconfdir}/rotation
+	fi
+
+	install -m 0644 ${WORKDIR}/fstab ${D}${sysconfdir}/fstab
+	install -m 0644 ${WORKDIR}/filesystems ${D}${sysconfdir}/filesystems
+	install -m 0644 ${WORKDIR}/usbd ${D}${sysconfdir}/default/usbd
+	install -m 0644 ${WORKDIR}/profile ${D}${sysconfdir}/profile
+	sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}${sysconfdir}/profile
+	install -m 0644 ${WORKDIR}/shells ${D}${sysconfdir}/shells
+	install -m 0755 ${WORKDIR}/share/dot.profile ${D}${sysconfdir}/skel/.profile
+	install -m 0755 ${WORKDIR}/share/dot.bashrc ${D}${sysconfdir}/skel/.bashrc
+	install -m 0644 ${WORKDIR}/inputrc ${D}${sysconfdir}/inputrc
+	install -m 0644 ${WORKDIR}/nsswitch.conf ${D}${sysconfdir}/nsswitch.conf
+	install -m 0644 ${WORKDIR}/host.conf ${D}${sysconfdir}/host.conf
+	install -m 0644 ${WORKDIR}/motd ${D}${sysconfdir}/motd
+
+	if [ "/usr/bin" != "${bindir}" ]; then
+		sed -i "s,/usr/bin/resize,${bindir}/resize," ${D}${sysconfdir}/profile
+	fi
+
+	ln -sf /proc/mounts ${D}${sysconfdir}/mtab
+}
+
+DISTRO_VERSION[vardepsexclude] += "DATE"
+do_install_basefilesissue () {
+	if [ "${hostname}" ]; then
+		echo ${hostname} > ${D}${sysconfdir}/hostname
+	fi
+
+	install -m 644 ${WORKDIR}/issue*  ${D}${sysconfdir}
+        if [ -n "${DISTRO_NAME}" ]; then
+		printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue
+		printf "${DISTRO_NAME} " >> ${D}${sysconfdir}/issue.net
+		if [ -n "${DISTRO_VERSION}" ]; then
+			printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue
+			printf "${DISTRO_VERSION} " >> ${D}${sysconfdir}/issue.net
+		fi
+		printf "\\\n \\\l\n" >> ${D}${sysconfdir}/issue
+		echo >> ${D}${sysconfdir}/issue
+		echo "%h"    >> ${D}${sysconfdir}/issue.net
+		echo >> ${D}${sysconfdir}/issue.net
+ 	fi
+}
+
+do_install_append_linuxstdbase() {
+	for d in ${dirs755-lsb}; do
+                install -m 0755 -d ${D}$d
+        done
+
+	for d in ${dirs2775-lsb}; do
+                install -m 2775 -d ${D}$d
+        done
+}
+
+PACKAGES = "${PN}-doc ${PN} ${PN}-dev ${PN}-dbg"
+FILES_${PN} = "/"
+FILES_${PN}-doc = "${docdir} ${datadir}/common-licenses"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+CONFFILES_${PN} = "${sysconfdir}/fstab ${@['', '${sysconfdir}/hostname'][(d.getVar('hostname', True) != '')]} ${sysconfdir}/shells"
+CONFFILES_${PN} += "${sysconfdir}/motd ${sysconfdir}/nsswitch.conf ${sysconfdir}/profile"
+
diff --git a/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch b/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch
new file mode 100644
index 0000000..5f357d8
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/add_shutdown.patch
@@ -0,0 +1,19 @@
+
+We need to have a shutdown group to allow the shutdown icon
+to work correctly. Any users that want to use shutdown like
+the xuser should be added to this group.
+
+Upstream-Status: Inappropriate [Embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Index: base-passwd-3.5.26/group.master
+===================================================================
+--- base-passwd-3.5.26.orig/group.master
++++ base-passwd-3.5.26/group.master
+@@ -36,5 +36,6 @@ sasl:*:45:
+ plugdev:*:46:
+ staff:*:50:
+ games:*:60:
++shutdown:*:70:
+ users:*:100:
+ nogroup:*:65534:
diff --git a/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch b/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch
new file mode 100644
index 0000000..14c08b7
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/disable-docs.patch
@@ -0,0 +1,24 @@
+Disable documentation for now as it uses tools currently not supported
+by OE-Core. It uses sgmltools and po4a.
+
+Upstream-Status: Inappropriate [OE-Core specific]
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: base-passwd-3.5.28/Makefile.in
+===================================================================
+--- base-passwd-3.5.28.orig/Makefile.in
++++ base-passwd-3.5.28/Makefile.in
+@@ -25,13 +25,10 @@ gen_configure	= config.cache config.stat
+ 		  confdefhs.h config.h Makefile
+ 
+ all: update-passwd
+-	$(MAKE) -C doc all
+-	$(MAKE) -C man all
+ 
+ install: all
+ 	mkdir -p $(DESTDIR)$(sbindir)
+ 	$(INSTALL) update-passwd $(DESTDIR)$(sbindir)/
+-	$(MAKE) -C man install
+ 
+ update-passwd.o: version.h
+ 
diff --git a/meta/recipes-core/base-passwd/base-passwd/input.patch b/meta/recipes-core/base-passwd/base-passwd/input.patch
new file mode 100644
index 0000000..3abbcad
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/input.patch
@@ -0,0 +1,22 @@
+Add an input group for the /dev/input/* devices.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Darren Hart <dvhart@linux.intel.com>
+
+---
+ group.master |    1 +
+ 1 file changed, 1 insertion(+)
+
+Index: base-passwd-3.5.26/group.master
+===================================================================
+--- base-passwd-3.5.26.orig/group.master
++++ base-passwd-3.5.26/group.master
+@@ -12,6 +12,7 @@ uucp:*:10:
+ man:*:12:
+ proxy:*:13:
+ kmem:*:15:
++input:*:19:
+ dialout:*:20:
+ fax:*:21:
+ voice:*:22:
diff --git a/meta/recipes-core/base-passwd/base-passwd/nobash.patch b/meta/recipes-core/base-passwd/base-passwd/nobash.patch
new file mode 100644
index 0000000..b5a6922
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/nobash.patch
@@ -0,0 +1,15 @@
+use /bin/sh instead of /bin/bash, since the latter may not be included in
+some images such as minimal
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- base-passwd/passwd.master~nobash
++++ base-passwd/passwd.master
+@@ -1,4 +1,4 @@
+-root:*:0:0:root:/root:/bin/bash
++root:*:0:0:root:/root:/bin/sh
+ daemon:*:1:1:daemon:/usr/sbin:/bin/sh
+ bin:*:2:2:bin:/bin:/bin/sh
+ sys:*:3:3:sys:/dev:/bin/sh
diff --git a/meta/recipes-core/base-passwd/base-passwd/noshadow.patch b/meta/recipes-core/base-passwd/base-passwd/noshadow.patch
new file mode 100644
index 0000000..e27bf7d
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd/noshadow.patch
@@ -0,0 +1,14 @@
+remove "*" for root since we don't have a /etc/shadow so far.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- base-passwd/passwd.master~nobash
++++ base-passwd/passwd.master
+@@ -1,4 +1,4 @@
+-root:*:0:0:root:/root:/bin/sh
++root::0:0:root:/root:/bin/sh
+ daemon:*:1:1:daemon:/usr/sbin:/bin/sh
+ bin:*:2:2:bin:/bin:/bin/sh
+ sys:*:3:3:sys:/dev:/bin/sh
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
new file mode 100644
index 0000000..ac9bd81
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -0,0 +1,104 @@
+SUMMARY = "Base system master password/group files"
+DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group).  The update-passwd tool is also provided to keep the system databases synchronized with these master files."
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+
+RECIPE_NO_UPDATE_REASON = "Version 3.5.38 requires cdebconf for update-passwd utility"
+
+SRC_URI = "https://launchpad.net/debian/+archive/primary/+files/${BPN}_${PV}.tar.gz \
+           file://add_shutdown.patch \
+           file://nobash.patch \
+           file://noshadow.patch \
+           file://input.patch \
+           file://disable-docs.patch \
+          "
+
+SRC_URI[md5sum] = "6beccac48083fe8ae5048acd062e5421"
+SRC_URI[sha256sum] = "f0b66388b2c8e49c15692439d2bee63bcdd4bbbf7a782c7f64accc55986b6a36"
+
+inherit autotools
+
+SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst"
+
+do_install () {
+	install -d -m 755 ${D}${sbindir}
+	install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/
+	install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8
+	install -p -m 644 ${S}/man/update-passwd.8 ${D}${mandir}/man8/
+	install -p -m 644 ${S}/man/update-passwd.pl.8 \
+		${D}${mandir}/pl/man8/update-passwd.8
+	gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/*
+	install -d -m 755 ${D}${datadir}/base-passwd
+	install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/
+	sed -i 's#:/root:#:${ROOT_HOME}:#' ${D}${datadir}/base-passwd/passwd.master
+	install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/
+
+	install -d -m 755 ${D}${docdir}/${BPN}
+	install -p -m 644 ${S}/debian/changelog ${D}${docdir}/${BPN}/
+	gzip -9 ${D}${docdir}/${BPN}/*
+	install -p -m 644 ${S}/README ${D}${docdir}/${BPN}/
+	install -p -m 644 ${S}/debian/copyright ${D}${docdir}/${BPN}/
+}
+
+base_passwd_sstate_postinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+		# Staging does not copy ${sysconfdir} files into the
+		# target sysroot, so we need to do so manually. We
+		# put these files in the target sysroot so they can
+		# be used by recipes which use custom user/group
+		# permissions.
+		# Install passwd.master and group.master to sysconfdir and mv
+		# them to make sure they are atomically install.
+		install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
+		for i in passwd group; do
+			install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/$i.master \
+				${STAGING_DIR_TARGET}${sysconfdir}/
+			mv ${STAGING_DIR_TARGET}${sysconfdir}/$i.master ${STAGING_DIR_TARGET}${sysconfdir}/$i
+		done
+	fi
+}
+
+python populate_packages_prepend() {
+    # Add in the preinst function for ${PN}
+    # We have to do this here as prior to this, passwd/group.master
+    # would be unavailable. We need to create these files at preinst
+    # time before the files from the package may be available, hence
+    # storing the data from the files in the preinst directly.
+
+    f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r')
+    passwd = "".join(f.readlines())
+    f.close()
+    f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r')
+    group = "".join(f.readlines())
+    f.close()
+
+    preinst = """#!/bin/sh
+mkdir -p $D${sysconfdir}
+if [ ! -e $D${sysconfdir}/passwd ]; then
+\tcat << 'EOF' > $D${sysconfdir}/passwd
+""" + passwd + """EOF
+fi
+if [ ! -e $D${sysconfdir}/group ]; then
+\tcat << 'EOF' > $D${sysconfdir}/group
+""" + group + """EOF
+fi
+"""
+    d.setVar('pkg_preinst_${PN}', preinst)
+}
+
+addtask do_package after do_populate_sysroot
+
+ALLOW_EMPTY_${PN} = "1"
+
+PACKAGES =+ "${PN}-update"
+FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}"
+
+pkg_postinst_${PN}-update () {
+#!/bin/sh
+if [ -n "$D" ]; then
+	exit 0
+fi
+${sbindir}/update-passwd
+}
diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
new file mode 100644
index 0000000..ed8f9fe
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -0,0 +1,416 @@
+SUMMARY = "Tiny versions of many common UNIX utilities in a single small executable"
+DESCRIPTION = "BusyBox combines tiny versions of many common UNIX utilities into a single small executable. It provides minimalist replacements for most of the utilities you usually find in GNU fileutils, shellutils, etc. The utilities in BusyBox generally have fewer options than their full-featured GNU cousins; however, the options that are included provide the expected functionality and behave very much like their GNU counterparts. BusyBox provides a fairly complete POSIX environment for any small or embedded system."
+HOMEPAGE = "http://www.busybox.net"
+BUGTRACKER = "https://bugs.busybox.net/"
+
+DEPENDS += "kern-tools-native"
+
+# bzip2 applet in busybox is based on lightly-modified bzip2 source
+# the GPL is version 2 only
+LICENSE = "GPLv2 & bzip2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb"
+
+SECTION = "base"
+
+# Whether to split the suid apps into a seperate binary
+BUSYBOX_SPLIT_SUID ?= "1"
+
+export EXTRA_CFLAGS = "${CFLAGS}"
+export EXTRA_LDFLAGS = "${LDFLAGS}"
+export EXTRA_OEMAKE += "'LD=${CCLD}'"
+
+PACKAGES =+ "${PN}-httpd ${PN}-udhcpd ${PN}-udhcpc ${PN}-syslog ${PN}-mdev ${PN}-hwclock"
+
+FILES_${PN}-httpd = "${sysconfdir}/init.d/busybox-httpd /srv/www"
+FILES_${PN}-syslog = "${sysconfdir}/init.d/syslog* ${sysconfdir}/syslog-startup.conf* ${sysconfdir}/syslog.conf* ${systemd_unitdir}/system/syslog.service ${sysconfdir}/default/busybox-syslog"
+FILES_${PN}-mdev = "${sysconfdir}/init.d/mdev ${sysconfdir}/mdev.conf ${sysconfdir}/mdev/*"
+FILES_${PN}-udhcpd = "${sysconfdir}/init.d/busybox-udhcpd"
+FILES_${PN}-udhcpc = "${sysconfdir}/udhcpc.d ${datadir}/udhcpc"
+FILES_${PN}-hwclock = "${sysconfdir}/init.d/hwclock.sh"
+
+INITSCRIPT_PACKAGES = "${PN}-httpd ${PN}-syslog ${PN}-udhcpd ${PN}-mdev ${PN}-hwclock"
+
+INITSCRIPT_NAME_${PN}-httpd = "busybox-httpd"
+INITSCRIPT_NAME_${PN}-hwclock = "hwclock.sh"
+INITSCRIPT_NAME_${PN}-mdev = "mdev"
+INITSCRIPT_PARAMS_${PN}-mdev = "start 03 S ."
+INITSCRIPT_NAME_${PN}-syslog = "syslog"
+INITSCRIPT_NAME_${PN}-udhcpd = "busybox-udhcpd" 
+
+SYSTEMD_PACKAGES = "${PN}-syslog"
+SYSTEMD_SERVICE_${PN}-syslog = "busybox-syslog.service"
+
+CONFFILES_${PN}-syslog = "${sysconfdir}/syslog-startup.conf.${BPN}"
+CONFFILES_${PN}-mdev = "${sysconfdir}/mdev.conf"
+
+RRECOMMENDS_${PN} = "${PN}-syslog ${PN}-udhcpc"
+
+inherit cml1 systemd update-rc.d ptest
+
+# internal helper
+def busybox_cfg(feature, tokens, cnf, rem):
+	if type(tokens) == type(""):
+		tokens = [tokens]
+	rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
+	if feature:
+		cnf.extend([token + '=y' for token in tokens])
+	else:
+		cnf.extend(['# ' + token + ' is not set' for token in tokens])
+
+# Map distro features to config settings
+def features_to_busybox_settings(d):
+	cnf, rem = ([], [])
+	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IPV6', cnf, rem)
+	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_LFS', cnf, rem)
+	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'largefile', True, False, d), 'CONFIG_FDISK_SUPPORT_LARGE_DISKS', cnf, rem)
+	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'nls', True, False, d), 'CONFIG_LOCALE_SUPPORT', cnf, rem)
+	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv4', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
+	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d), 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
+	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'wifi', True, False, d), 'CONFIG_RFKILL', cnf, rem)
+	busybox_cfg(bb.utils.contains('DISTRO_FEATURES', 'bluetooth', True, False, d), 'CONFIG_RFKILL', cnf, rem)
+	return "\n".join(cnf), "\n".join(rem)
+
+# X, Y = ${@features_to_uclibc_settings(d)}
+# unfortunately doesn't seem to work with bitbake, workaround:
+def features_to_busybox_conf(d):
+	cnf, rem = features_to_busybox_settings(d)
+	return cnf
+def features_to_busybox_del(d):
+	cnf, rem = features_to_busybox_settings(d)
+	return rem
+
+configmangle = '/CROSS_COMPILER_PREFIX/d; \
+		/CONFIG_EXTRA_CFLAGS/d; \
+		'
+OE_FEATURES := "${@features_to_busybox_conf(d)}"
+OE_DEL      := "${@features_to_busybox_del(d)}"
+DO_IPv4 := "${@bb.utils.contains('DISTRO_FEATURES', 'ipv4', 1, 0, d)}"
+DO_IPv6 := "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 1, 0, d)}"
+
+python () {
+  if "${OE_DEL}":
+    d.setVar('configmangle_append', "${OE_DEL}" + "\n")
+  if "${OE_FEATURES}":
+    d.setVar('configmangle_append',
+                   "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
+                   ("\\n".join((d.expand("${OE_FEATURES}").split("\n")))))
+  d.setVar('configmangle_append',
+                 "/^### CROSS$/a\\\n%s\n" %
+                  ("\\n".join(["CONFIG_CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"",
+			       "CONFIG_EXTRA_CFLAGS=\"${CFLAGS}\" \"${HOST_CC_ARCH}\""
+                        ])
+                  ))
+}
+
+do_prepare_config () {
+	sed -e 's#@DATADIR@#${datadir}#g' \
+		< ${WORKDIR}/defconfig > ${S}/.config
+	sed -i -e '/CONFIG_STATIC/d' .config
+	echo "# CONFIG_STATIC is not set" >> .config
+	for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \
+		${S}/.config
+	sed -i -e '${configmangle}' ${S}/.config
+	if test ${DO_IPv4} -eq 0 && test ${DO_IPv6} -eq 0; then
+	  # disable networking applets
+	  mv ${S}/.config ${S}/.config.oe-tmp
+	  awk 'BEGIN{net=0}
+	  /^# Networking Utilities/{net=1}
+	  /^#$/{if(net){net=net+1}}
+	  {if(net==2&&$0 !~ /^#/&&$1){print("# "$1" is not set")}else{print}}' \
+		  ${S}/.config.oe-tmp > ${S}/.config
+	fi
+	sed -i 's/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"/CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -b"/' ${S}/.config
+}
+
+# returns all the elements from the src uri that are .cfg files
+def find_cfgs(d):
+    sources=src_patches(d, True)
+    sources_list=[]
+    for s in sources:
+        if s.endswith('.cfg'):
+            sources_list.append(s)
+
+    return sources_list
+
+do_configure () {
+	do_prepare_config
+	merge_config.sh -m .config ${@" ".join(find_cfgs(d))}
+	cml1_do_configure
+}
+
+do_compile() {
+	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+	if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
+	# split the .config into two parts, and make two busybox binaries
+		cp .config .config.orig
+		oe_runmake busybox.cfg.suid
+		oe_runmake busybox.cfg.nosuid
+		for i in `cat busybox.cfg.suid busybox.cfg.nosuid`; do
+			echo "# $i is not set" >> .config.disable.apps
+		done
+		merge_config.sh -m .config.orig .config.disable.apps
+		cp .config .config.nonapps
+		for s in suid nosuid; do
+			cat busybox.cfg.$s | while read item; do
+				grep -w "$item" .config.orig
+			done > .config.app.$s
+			merge_config.sh -m .config.nonapps .config.app.$s
+			oe_runmake busybox_unstripped
+			mv busybox_unstripped busybox.$s
+			oe_runmake busybox.links
+			mv busybox.links busybox.links.$s
+		done
+		# copy .config.orig back to .config, because the install process may check this file
+		cp .config.orig .config
+		# cleanup
+		rm .config.orig .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps
+	else
+		oe_runmake busybox_unstripped
+		cp busybox_unstripped busybox
+		oe_runmake busybox.links
+	fi
+}
+
+do_install () {
+	if [ "${prefix}" != "/usr" ]; then
+		sed -i "s:^/usr/:${prefix}/:" busybox.links*
+	fi
+	if [ "${base_sbindir}" != "/sbin" ]; then
+		sed -i "s:^/sbin/:${base_sbindir}/:" busybox.links*
+	fi
+	if [ "${base_bindir}" != "/bin" ]; then
+		sed -i "s:^/bin/:${base_bindir}/:" busybox.links*
+	fi
+
+	install -d ${D}${sysconfdir}/init.d
+
+	if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${B}/.config; then
+		# Install /bin/busybox, and the /bin/sh link so the postinst script
+		# can run. Let update-alternatives handle the rest.
+		install -d ${D}${base_bindir}
+		if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then
+			install -m 4755 ${B}/busybox.suid ${D}${base_bindir}
+			install -m 0755 ${B}/busybox.nosuid ${D}${base_bindir}
+			install -m 0644 ${S}/busybox.links.suid ${D}${sysconfdir}
+			install -m 0644 ${S}/busybox.links.nosuid ${D}${sysconfdir}
+			if grep -q "CONFIG_FEATURE_SH_IS_ASH=y" ${B}/.config; then
+				ln -sf busybox.nosuid ${D}${base_bindir}/sh
+			fi
+			# Keep a default busybox for people who want to invoke busybox directly.
+			# This is also useful for the on device upgrade. Because we want
+			# to use the busybox command in postinst.
+			ln -sf busybox.nosuid ${D}${base_bindir}/busybox
+		else
+			if grep -q "CONFIG_FEATURE_SUID=y" ${B}/.config; then
+				install -m 4755 ${B}/busybox ${D}${base_bindir}
+			else
+				install -m 0755 ${B}/busybox ${D}${base_bindir}
+			fi
+			install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
+			if grep -q "CONFIG_FEATURE_SH_IS_ASH=y" ${B}/.config; then
+				ln -sf busybox ${D}${base_bindir}/sh
+			fi
+			# We make this symlink here to eliminate the error when upgrading together
+			# with busybox-syslog. Without this symlink, the opkg may think of the
+			# busybox.nosuid as obsolete and remove it, resulting in dead links like
+			# /bin/sed -> /bin/busybox.nosuid. This will make upgrading busybox-syslog fail.
+			# This symlink will be safely deleted in postinst, thus no negative effect.
+			ln -sf busybox ${D}${base_bindir}/busybox.nosuid
+		fi
+	else
+		install -d ${D}${base_bindir} ${D}${base_sbindir}
+		install -d ${D}${libdir} ${D}${bindir} ${D}${sbindir}
+		cat busybox.links | while read FILE; do
+			NAME=`basename "$FILE"`
+			install -m 0755 "0_lib/$NAME" "${D}$FILE.${BPN}"
+		done
+		# add suid bit where needed
+		for i in `grep -E "APPLET.*BB_SUID_((MAYBE|REQUIRE))" include/applets.h | grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do
+			find ${D} -name $i.${BPN} -exec chmod a+s {} \;
+		done
+		install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV}
+		ln -sf sh.${BPN} ${D}${base_bindir}/sh
+		ln -sf ln.${BPN} ${D}${base_bindir}/ln
+		ln -sf test.${BPN} ${D}${bindir}/test
+		if [ -f ${D}/linuxrc.${BPN} ]; then
+			mv ${D}/linuxrc.${BPN} ${D}/linuxrc
+		fi
+		install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
+	fi
+
+	if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
+		install -m 0755 ${WORKDIR}/syslog ${D}${sysconfdir}/init.d/syslog.${BPN}
+		install -m 644 ${WORKDIR}/syslog-startup.conf ${D}${sysconfdir}/syslog-startup.conf.${BPN}
+		install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf.${BPN}
+	fi
+	if grep "CONFIG_CROND=y" ${B}/.config; then
+		install -m 0755 ${WORKDIR}/busybox-cron ${D}${sysconfdir}/init.d/
+	fi
+	if grep "CONFIG_HTTPD=y" ${B}/.config; then
+		install -m 0755 ${WORKDIR}/busybox-httpd ${D}${sysconfdir}/init.d/
+		install -d ${D}/srv/www
+	fi
+	if grep "CONFIG_UDHCPD=y" ${B}/.config; then
+		install -m 0755 ${WORKDIR}/busybox-udhcpd ${D}${sysconfdir}/init.d/
+	fi
+	if grep "CONFIG_HWCLOCK=y" ${B}/.config; then
+		install -m 0755 ${WORKDIR}/hwclock.sh ${D}${sysconfdir}/init.d/
+	fi
+	if grep "CONFIG_UDHCPC=y" ${B}/.config; then
+		install -d ${D}${sysconfdir}/udhcpc.d
+		install -d ${D}${datadir}/udhcpc
+                install -m 0755 ${WORKDIR}/simple.script ${D}${sysconfdir}/udhcpc.d/50default
+		install -m 0755 ${WORKDIR}/default.script ${D}${datadir}/udhcpc/default.script
+	fi
+	if grep "CONFIG_INETD=y" ${B}/.config; then
+		install -m 0755 ${WORKDIR}/inetd ${D}${sysconfdir}/init.d/inetd.${BPN}
+		sed -i "s:/usr/sbin/:${sbindir}/:" ${D}${sysconfdir}/init.d/inetd.${BPN}
+		install -m 0644 ${WORKDIR}/inetd.conf ${D}${sysconfdir}/
+	fi
+        if grep "CONFIG_MDEV=y" ${B}/.config; then
+               install -m 0755 ${WORKDIR}/mdev ${D}${sysconfdir}/init.d/mdev
+               if grep "CONFIG_FEATURE_MDEV_CONF=y" ${B}/.config; then
+                       install -m 644 ${WORKDIR}/mdev.conf ${D}${sysconfdir}/mdev.conf
+                       install -d ${D}${sysconfdir}/mdev
+                       install -m 0755 ${WORKDIR}/find-touchscreen.sh ${D}${sysconfdir}/mdev
+                       install -m 0755 ${WORKDIR}/mdev-mount.sh ${D}${sysconfdir}/mdev
+               fi
+	fi
+
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
+            install -d ${D}${systemd_unitdir}/system
+            sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-syslog.service.in \
+		> ${D}${systemd_unitdir}/system/busybox-syslog.service
+            if [ -f ${WORKDIR}/busybox-syslog.default ] ; then
+		install -d ${D}${sysconfdir}/default
+		install -m 0644 ${WORKDIR}/busybox-syslog.default ${D}${sysconfdir}/default/busybox-syslog
+            fi
+            ln -sf /dev/null ${D}${systemd_unitdir}/system/syslog.service
+        fi
+        if grep -q "CONFIG_KLOGD=y" ${B}/.config; then
+            install -d ${D}${systemd_unitdir}/system
+            sed 's,@base_sbindir@,${base_sbindir},g' < ${WORKDIR}/busybox-klogd.service.in \
+		> ${D}${systemd_unitdir}/system/busybox-klogd.service
+        fi
+    fi
+
+    # Remove the sysvinit specific configuration file for systemd systems to avoid confusion
+    if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'false', 'true', d)}; then
+	rm -f ${D}${sysconfdir}/syslog-startup.conf.${BPN}
+    fi
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "50"
+
+ALTERNATIVE_${PN}-syslog += "syslog-conf"
+ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
+
+python () {
+    if bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        pn = d.getVar('PN', True)
+        d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-init')
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-init', '%s/init.d/syslog' % (d.getVar('sysconfdir', True)))
+        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-init', '%s/init.d/syslog.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
+        d.appendVar('ALTERNATIVE_%s-syslog' % (pn), ' syslog-startup-conf')
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', 'syslog-startup-conf', '%s/syslog-startup.conf' % (d.getVar('sysconfdir', True)))
+        d.setVarFlag('ALTERNATIVE_TARGET', 'syslog-startup-conf', '%s/syslog-startup.conf.%s' % (d.getVar('sysconfdir', True), d.getVar('BPN', True)))
+}
+
+python do_package_prepend () {
+    # We need to load the full set of busybox provides from the /etc/busybox.links
+    # Use this to see the update-alternatives with the right information
+
+    dvar = d.getVar('D', True)
+    pn = d.getVar('PN', True)
+    def set_alternative_vars(links, target):
+        f = open('%s%s' % (dvar, links), 'r')
+        for alt_link_name in f:
+            alt_link_name = alt_link_name.strip()
+            alt_name = os.path.basename(alt_link_name)
+            # Match coreutils
+            if alt_name == '[':
+                alt_name = 'lbracket'
+            d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name)
+            d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
+            if os.path.exists('%s%s' % (dvar, target)):
+                d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
+        f.close()
+        return
+
+    if os.path.exists('%s/etc/busybox.links' % (dvar)):
+        set_alternative_vars("${sysconfdir}/busybox.links", "${base_bindir}/busybox")
+    else:
+        set_alternative_vars("${sysconfdir}/busybox.links.nosuid", "${base_bindir}/busybox.nosuid")
+        set_alternative_vars("${sysconfdir}/busybox.links.suid", "${base_bindir}/busybox.suid")
+}
+
+pkg_postinst_${PN} () {
+	# This part of code is dedicated to the on target upgrade problem.
+	# It's known that if we don't make appropriate symlinks before update-alternatives calls,
+	# there will be errors indicating missing commands such as 'sed'.
+	# These symlinks will later be updated by update-alternatives calls.
+	test -n 2 > /dev/null || alias test='busybox test'
+	if test "x$D" = "x"; then
+		# Remove busybox.nosuid if it's a symlink, because this situation indicates
+		# that we're installing or upgrading to a one-binary busybox.
+		if test -h ${base_bindir}/busybox.nosuid; then
+			rm -f ${base_bindir}/busybox.nosuid
+		fi
+		for suffix in "" ".nosuid" ".suid"; do
+			if test -e ${sysconfdir}/busybox.links$suffix; then
+				while read link; do
+					if test ! -e "$link"; then
+						case "$link" in
+							/*/*/*)
+								to="../..${base_bindir}/busybox$suffix"
+								;;
+							/bin/*)
+								to="busybox$suffix"
+								;;
+							/*/*)
+								to="..${base_bindir}/busybox$suffix"
+								;;
+						esac
+						# we can use busybox here because even if we are using splitted busybox
+						# we've made a symlink from /bin/busybox to /bin/busybox.nosuid.
+						busybox rm -f $link
+						busybox ln -s $to $link
+					fi
+				done < ${sysconfdir}/busybox.links$suffix
+			fi
+		done
+	fi
+}
+
+pkg_prerm_${PN} () {
+	# This is so you can make busybox commit suicide - removing busybox with no other packages
+	# providing its files, this will make update-alternatives work, but the update-rc.d part
+	# for syslog, httpd and/or udhcpd will fail if there is no other package providing sh
+	tmpdir=`mktemp -d /tmp/busyboxrm-XXXXXX`
+	ln -s ${base_bindir}/busybox $tmpdir/[
+	ln -s ${base_bindir}/busybox $tmpdir/test
+	ln -s ${base_bindir}/busybox $tmpdir/head
+	ln -s ${base_bindir}/busybox $tmpdir/sh
+	ln -s ${base_bindir}/busybox $tmpdir/basename
+	ln -s ${base_bindir}/busybox $tmpdir/echo
+	ln -s ${base_bindir}/busybox $tmpdir/mv
+	ln -s ${base_bindir}/busybox $tmpdir/ln
+	ln -s ${base_bindir}/busybox $tmpdir/dirname
+	ln -s ${base_bindir}/busybox $tmpdir/rm
+	ln -s ${base_bindir}/busybox $tmpdir/sed
+	ln -s ${base_bindir}/busybox $tmpdir/sort
+	ln -s ${base_bindir}/busybox $tmpdir/grep
+	export PATH=$PATH:$tmpdir
+}
+
+pkg_prerm_${PN}-syslog () {
+	# remove syslog
+	if test "x$D" = "x"; then
+		if test "$1" = "upgrade" -o "$1" = "remove"; then
+			${sysconfdir}/init.d/syslog stop
+		fi
+	fi
+}
diff --git a/meta/recipes-core/busybox/busybox/0001-chown-fix-help-text.patch b/meta/recipes-core/busybox/busybox/0001-chown-fix-help-text.patch
new file mode 100644
index 0000000..4299799
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-chown-fix-help-text.patch
@@ -0,0 +1,34 @@
+From d291c2fdd5cb8616605c67ecbfb04274fa094242 Mon Sep 17 00:00:00 2001
+From: Junling Zheng <zhengjunling@huawei.com>
+Date: Sun, 7 Jun 2015 02:32:23 +0200
+Subject: [PATCH] chown: fix help text
+
+Derived from:
+http://git.busybox.net/busybox/commit/?id=d291c2fdd5cb8616605c67ecbfb04274fa094242.
+
+Only when DESKTOP is enabled, chown has -L, -H and -P options.
+
+Upstream-Status: Backport
+
+Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+ coreutils/chown.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/coreutils/chown.c b/coreutils/chown.c
+index cb07bbc..679c0d8 100644
+--- a/coreutils/chown.c
++++ b/coreutils/chown.c
+@@ -11,7 +11,7 @@
+ /* http://www.opengroup.org/onlinepubs/007904975/utilities/chown.html */
+ 
+ //usage:#define chown_trivial_usage
+-//usage:       "[-RhLHP"IF_DESKTOP("cvf")"]... OWNER[<.|:>[GROUP]] FILE..."
++//usage:       "[-Rh"IF_DESKTOP("LHPcvf")"]... OWNER[<.|:>[GROUP]] FILE..."
+ //usage:#define chown_full_usage "\n\n"
+ //usage:       "Change the owner and/or group of each FILE to OWNER and/or GROUP\n"
+ //usage:     "\n	-R	Recurse"
+-- 
+1.8.3.4
+
diff --git a/meta/recipes-core/busybox/busybox/0001-ifconfig-fix-double-free-fatal-error-in-INET_sprint.patch b/meta/recipes-core/busybox/busybox/0001-ifconfig-fix-double-free-fatal-error-in-INET_sprint.patch
new file mode 100644
index 0000000..2d729b1
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/0001-ifconfig-fix-double-free-fatal-error-in-INET_sprint.patch
@@ -0,0 +1,67 @@
+From a97777889328157bb7d06ec618bad16712a9c345 Mon Sep 17 00:00:00 2001
+From: Denys Vlasenko <vda.linux@googlemail.com>
+Date: Tue, 3 Feb 2015 12:11:30 +0100
+Subject: [PATCH] ifconfig: fix double free fatal error in INET_sprint
+
+Derived from:
+http://git.busybox.net/busybox/commit/?id=a97777889328157bb7d06ec618bad16712a9c345.
+
+While INET_sprint or INET6_sprint is called circularly by keeping
+ifconfiging, sap->sa_family would be cleaned by other parallel processes
+such as dhclient sometimes, and then there would be a double free error
+like the following:
+
+  *** glibc detected *** ifconfig: double free or corruption (fasttop): 0x000a6008 ***
+  ======= Backtrace: =========
+  /lib/libc.so.6(+0x6bc84)[0x40133c84]
+  /lib/libc.so.6(cfree+0x94)[0x40138684]
+  ifconfig[0x1c460]
+  ifconfig[0x1c6a0]
+  ifconfig[0x1ccf4]
+  ifconfig[0x187c8]
+  ifconfig[0xd544]
+  ifconfig[0xd5dc]
+  ifconfig[0xdca8]
+  /lib/libc.so.6(__libc_start_main+0x110)[0x400df258]
+  ======= Memory map: ========
+  00008000-0009c000 r-xp 00000000 1f:05 444328     /bin/busybox
+  000a3000-000a4000 rw-p 00093000 1f:05 444328     /bin/busybox
+
+This patch moved free() two lines down to address this problem.
+
+Upstream-Status: Backport
+
+Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
+---
+ networking/interface.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/networking/interface.c b/networking/interface.c
+index bf7d2b1..b0572d0 100644
+--- a/networking/interface.c
++++ b/networking/interface.c
+@@ -91,9 +91,9 @@ static const char* FAST_FUNC INET_sprint(struct sockaddr *sap, int numeric)
+ {
+ 	static char *buff; /* defaults to NULL */
+ 
+-	free(buff);
+ 	if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+ 		return "[NONE SET]";
++	free(buff);
+ 	buff = INET_rresolve((struct sockaddr_in *) sap, numeric, 0xffffff00);
+ 	return buff;
+ }
+@@ -173,9 +173,9 @@ static const char* FAST_FUNC INET6_sprint(struct sockaddr *sap, int numeric)
+ {
+ 	static char *buff;
+ 
+-	free(buff);
+ 	if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
+ 		return "[NONE SET]";
++	free(buff);
+ 	buff = INET6_rresolve((struct sockaddr_in6 *) sap, numeric);
+ 	return buff;
+ }
+-- 
+1.8.3.4
+
diff --git a/meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch b/meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch
new file mode 100644
index 0000000..de2dbcc
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/busybox-appletlib-dependency.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Pending
+
+# copy commit message from OE as the patch comment:
+#    commit 98c24291aa165f53423c27ae033831ce0b3bb676
+#    Author: Roman I Khimov <khimov@altell.ru>
+#    Date:   Thu Mar 26 23:03:58 2009 +0000
+#
+#    busybox: update appletlib dependency patch
+#    
+#    Previous version still failed from time to time on clean-start builds
+#    with 4 bitbake threads and '-j16'. Building busybox as sole target worked
+#    well.
+#    
+#    The reason is that previous version introduced a race between applets make
+#    processes spawned from top-level Makefile and from libbb Makefile.
+#    
+#    Fix it with high-level dependency that doesn't create races.
+#    
+#    Signed-off-by: Koen Kooi <koen@openembedded.org>
+#
+# above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06
+
+Index: busybox-1.13.2/Makefile
+===================================================================
+--- busybox-1.13.2.orig/Makefile	2009-03-19 15:44:37.419270265 +0300
++++ busybox-1.13.2/Makefile	2009-03-19 15:45:57.737521296 +0300
+@@ -471,6 +471,10 @@
+ 		util-linux/ \
+ 		util-linux/volume_id/ \
+ 
++# Lib interdeps
++# libbb uses headers generated in applets
++libbb: applets
++
+ endif # KBUILD_EXTMOD
+ 
+ ifeq ($(dot-config),1)
diff --git a/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch b/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch
new file mode 100644
index 0000000..bda8685
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/busybox-cross-menuconfig.patch
@@ -0,0 +1,71 @@
+From: Jason Wessel <jason.wessel@windriver.com>
+Date: Sun, 3 Mar 2013 12:31:40 -0600
+Subject: [PATCH] menuconfig,check-lxdiaglog.sh: Allow specification of ncurses location
+
+Upstream-Status: Submitted
+
+[ based on: https://lkml.org/lkml/2013/3/3/103 ]
+
+This patch syncs up with the way the menuconfig ncurses / curses
+is detected and the HOST_EXTRACFLAGS works in the Linux kernel
+and it allows the menuconfig to work with a sysroot version
+of the curses libraries.
+
+---
+
+In some cross build environments such as the Yocto Project build
+environment it provides an ncurses library that is compiled
+differently than the host's version.  This causes display corruption
+problems when the host's curses includes are used instead of the
+includes from the provided compiler are overridden.  There is a second
+case where there is no curses libraries at all on the host system and
+menuconfig will just fail entirely.
+
+The solution is simply to allow an override variable in
+check-lxdialog.sh for environments such as the Yocto Project.  Adding
+a CROSS_CURSES_LIB and CROSS_CURSES_INC solves the issue and allowing
+compiling and linking against the right headers and libraries.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+cc: Michal Marek <mmarek@suse.cz>
+cc: linux-kbuild@vger.kernel.org
+---
+ scripts/kconfig/lxdialog/Makefile          |    2 +-
+ scripts/kconfig/lxdialog/check-lxdialog.sh |    8 ++++++++
+ 2 files changed, 9 insertions(+), 1 deletion(-)
+
+--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
++++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
+@@ -4,6 +4,10 @@
+ # What library to link
+ ldflags()
+ {
++	if [ x"$CROSS_CURSES_LIB" != x ]; then
++		echo "$CROSS_CURSES_LIB"
++		exit
++	fi
+ 	for ext in so a dylib ; do
+ 		for lib in ncursesw ncurses curses ; do
+ 			$cc -print-file-name=lib${lib}.${ext} | grep -q /
+@@ -19,6 +23,10 @@ ldflags()
+ # Where is ncurses.h?
+ ccflags()
+ {
++	if [ x"$CROSS_CURSES_INC" != x ]; then
++		echo "$CROSS_CURSES_INC"
++		exit
++	fi
+ 	if [ -f /usr/include/ncursesw/ncurses.h ]; then
+ 		echo '-I/usr/include/ncursesw -DCURSES_LOC="<ncurses.h>"'
+ 	elif [ -f /usr/include/ncursesw/curses.h ]; then
+--- a/scripts/kconfig/lxdialog/Makefile
++++ b/scripts/kconfig/lxdialog/Makefile
+@@ -5,7 +5,7 @@ check-lxdialog  := $(srctree)/$(src)/che
+ 
+ # Use reursively expanded variables so we do not call gcc unless
+ # we really need to do so. (Do not call gcc as part of make mrproper)
+-HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
++HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
+ HOST_LOADLIBES   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
+ 
+ HOST_EXTRACFLAGS += -DLOCALE
diff --git a/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
new file mode 100644
index 0000000..4c9ce3b
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/busybox-udhcpc-no_deconfig.patch
@@ -0,0 +1,137 @@
+From 53626cd06a3ef05ed847daea802ef0aa9661caa7 Mon Sep 17 00:00:00 2001
+From: Anders Darander <anders@chargestorm.se>
+Date: Thu, 3 Nov 2011 08:51:31 +0100
+Subject: [PATCH] busybox-udhcpc-no_deconfig.patch
+
+Upstream-Status: Pending
+
+Add a new option -D to the udhcpc client that allows for
+dhcp renewal to occur without having to down the interface
+in the process.
+
+Signed-off-by: Greg Moffatt <greg.moffatt@windriver.com>
+
+Updated to latest Busybox 1.17.3
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Updated to Busybox 1.18.4
+option spec is changed
+
+Signed-off-by: Qing He <qing.he@intel.com>
+
+Updated to Busybox 1.19.3
+
+Signed-off-by: Anders Darander <anders@chargestorm.se>
+
+Fixed options -b, -a and -P.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+---
+ networking/udhcp/dhcpc.c |   29 +++++++++++++++++++++--------
+ 1 files changed, 21 insertions(+), 8 deletions(-)
+
+Index: busybox-1.20.2/networking/udhcp/dhcpc.c
+===================================================================
+--- busybox-1.20.2.orig/networking/udhcp/dhcpc.c
++++ busybox-1.20.2/networking/udhcp/dhcpc.c
+@@ -29,6 +29,9 @@
+ #include <netpacket/packet.h>
+ #include <linux/filter.h>
+ 
++/* option whether to down the interface when reconfiguring */
++static int allow_deconfig = 1;
++
+ /* "struct client_config_t client_config" is in bb_common_bufsiz1 */
+ 
+ 
+@@ -81,8 +84,9 @@ enum {
+ 	OPT_x = 1 << 18,
+ 	OPT_f = 1 << 19,
+ 	OPT_B = 1 << 20,
++	OPT_D = 1 << 21,
+ /* The rest has variable bit positions, need to be clever */
+-	OPTBIT_B = 20,
++	OPTBIT_D = 21,
+ 	USE_FOR_MMU(             OPTBIT_b,)
+ 	IF_FEATURE_UDHCPC_ARPING(OPTBIT_a,)
+ 	IF_FEATURE_UDHCP_PORT(   OPTBIT_P,)
+@@ -1040,7 +1044,8 @@ static void perform_renew(void)
+ 		state = RENEW_REQUESTED;
+ 		break;
+ 	case RENEW_REQUESTED: /* impatient are we? fine, square 1 */
+-		udhcp_run_script(NULL, "deconfig");
++		if (allow_deconfig)
++			udhcp_run_script(NULL, "deconfig");
+ 	case REQUESTING:
+ 	case RELEASED:
+ 		change_listen_mode(LISTEN_RAW);
+@@ -1064,7 +1069,8 @@ static void perform_release(uint32_t ser
+ 		bb_info_msg("Unicasting a release of %s to %s",
+ 				inet_ntoa(temp_addr), buffer);
+ 		send_release(server_addr, requested_ip); /* unicast */
+-		udhcp_run_script(NULL, "deconfig");
++		if (allow_deconfig)
++			udhcp_run_script(NULL, "deconfig");
+ 	}
+ 	bb_info_msg("Entering released state");
+ 
+@@ -1215,7 +1221,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ 	/* O,x: list; -T,-t,-A take numeric param */
+ 	opt_complementary = "O::x::T+:t+:A+" IF_UDHCP_VERBOSE(":vv") ;
+ 	IF_LONG_OPTS(applet_long_options = udhcpc_longopts;)
+-	opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fB"
++	opt = getopt32(argv, "CV:H:h:F:i:np:qRr:s:T:t:SA:O:ox:fBD"
+ 		USE_FOR_MMU("b")
+ 		IF_FEATURE_UDHCPC_ARPING("a")
+ 		IF_FEATURE_UDHCP_PORT("P:")
+@@ -1316,6 +1322,9 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ 		logmode |= LOGMODE_SYSLOG;
+ 	}
+ 
++	if (opt & OPT_D)
++		allow_deconfig = 0;
++
+ 	/* Make sure fd 0,1,2 are open */
+ 	bb_sanitize_stdio();
+ 	/* Equivalent of doing a fflush after every \n */
+@@ -1330,7 +1339,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ 	srand(monotonic_us());
+ 
+ 	state = INIT_SELECTING;
+-	udhcp_run_script(NULL, "deconfig");
++	if (allow_deconfig)
++		udhcp_run_script(NULL, "deconfig");
+ 	change_listen_mode(LISTEN_RAW);
+ 	packet_num = 0;
+ 	timeout = 0;
+@@ -1484,7 +1494,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ 				}
+ 				/* Timed out, enter init state */
+ 				bb_info_msg("Lease lost, entering init state");
+-				udhcp_run_script(NULL, "deconfig");
++				if (allow_deconfig)
++					udhcp_run_script(NULL, "deconfig");
+ 				state = INIT_SELECTING;
+ 				client_config.first_secs = 0; /* make secs field count from 0 */
+ 				/*timeout = 0; - already is */
+@@ -1667,7 +1678,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ 						send_decline(/*xid,*/ server_addr, packet.yiaddr);
+ 
+ 						if (state != REQUESTING)
+-							udhcp_run_script(NULL, "deconfig");
++							if (allow_deconfig)
++								udhcp_run_script(NULL, "deconfig");
+ 						change_listen_mode(LISTEN_RAW);
+ 						state = INIT_SELECTING;
+ 						client_config.first_secs = 0; /* make secs field count from 0 */
+@@ -1711,7 +1723,8 @@ int udhcpc_main(int argc UNUSED_PARAM, c
+ 				bb_info_msg("Received DHCP NAK");
+ 				udhcp_run_script(&packet, "nak");
+ 				if (state != REQUESTING)
+-					udhcp_run_script(NULL, "deconfig");
++					if (allow_deconfig)
++						udhcp_run_script(NULL, "deconfig");
+ 				change_listen_mode(LISTEN_RAW);
+ 				sleep(3); /* avoid excessive network traffic */
+ 				state = INIT_SELECTING;
diff --git a/meta/recipes-core/busybox/busybox/defconfig b/meta/recipes-core/busybox/busybox/defconfig
new file mode 100644
index 0000000..4f5df9e
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/defconfig
@@ -0,0 +1,1054 @@
+#
+# Automatically generated make config: don't edit
+# Busybox version: 1.23.2
+# Thu Jul 30 11:00:00 2015
+#
+CONFIG_HAVE_DOT_CONFIG=y
+
+#
+# Busybox Settings
+#
+
+#
+# General Configuration
+#
+# CONFIG_DESKTOP is not set
+# CONFIG_EXTRA_COMPAT is not set
+# CONFIG_INCLUDE_SUSv2 is not set
+# CONFIG_USE_PORTABLE_CODE is not set
+CONFIG_PLATFORM_LINUX=y
+CONFIG_FEATURE_BUFFERS_USE_MALLOC=y
+# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set
+# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set
+CONFIG_SHOW_USAGE=y
+# CONFIG_FEATURE_VERBOSE_USAGE is not set
+CONFIG_FEATURE_COMPRESS_USAGE=y
+# CONFIG_FEATURE_INSTALLER is not set
+# CONFIG_INSTALL_NO_USR is not set
+# CONFIG_LOCALE_SUPPORT is not set
+# CONFIG_UNICODE_SUPPORT is not set
+# CONFIG_UNICODE_USING_LOCALE is not set
+# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set
+CONFIG_SUBST_WCHAR=0
+CONFIG_LAST_SUPPORTED_WCHAR=0
+# CONFIG_UNICODE_COMBINING_WCHARS is not set
+# CONFIG_UNICODE_WIDE_WCHARS is not set
+# CONFIG_UNICODE_BIDI_SUPPORT is not set
+# CONFIG_UNICODE_NEUTRAL_TABLE is not set
+# CONFIG_UNICODE_PRESERVE_BROKEN is not set
+# CONFIG_PAM is not set
+CONFIG_FEATURE_USE_SENDFILE=y
+CONFIG_LONG_OPTS=y
+CONFIG_FEATURE_DEVPTS=y
+# CONFIG_FEATURE_CLEAN_UP is not set
+CONFIG_FEATURE_UTMP=y
+# CONFIG_FEATURE_WTMP is not set
+CONFIG_FEATURE_PIDFILE=y
+CONFIG_PID_FILE_PATH="/var/run"
+CONFIG_FEATURE_SUID=y
+CONFIG_FEATURE_SUID_CONFIG=y
+CONFIG_FEATURE_SUID_CONFIG_QUIET=y
+# CONFIG_SELINUX is not set
+# CONFIG_FEATURE_PREFER_APPLETS is not set
+CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe"
+CONFIG_FEATURE_SYSLOG=y
+CONFIG_FEATURE_HAVE_RPC=y
+
+#
+# Build Options
+#
+# CONFIG_STATIC is not set
+# CONFIG_PIE is not set
+# CONFIG_NOMMU is not set
+# CONFIG_BUILD_LIBBUSYBOX is not set
+# CONFIG_FEATURE_INDIVIDUAL is not set
+# CONFIG_FEATURE_SHARED_BUSYBOX is not set
+CONFIG_LFS=y
+# CONFIG_CROSS_COMPILER_PREFIX is not set
+CONFIG_SYSROOT=""
+# CONFIG_EXTRA_CFLAGS is not set
+CONFIG_EXTRA_LDFLAGS=""
+CONFIG_EXTRA_LDLIBS=""
+
+#
+# Debugging Options
+#
+# CONFIG_DEBUG is not set
+# CONFIG_DEBUG_PESSIMIZE is not set
+# CONFIG_UNIT_TEST is not set
+# CONFIG_WERROR is not set
+CONFIG_NO_DEBUG_LIB=y
+# CONFIG_DMALLOC is not set
+# CONFIG_EFENCE is not set
+
+#
+# Installation Options ("make install" behavior)
+#
+CONFIG_INSTALL_APPLET_SYMLINKS=y
+# CONFIG_INSTALL_APPLET_HARDLINKS is not set
+# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set
+# CONFIG_INSTALL_APPLET_DONT is not set
+# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set
+# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set
+# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set
+CONFIG_PREFIX="./_install"
+
+#
+# Busybox Library Tuning
+#
+CONFIG_FEATURE_SYSTEMD=y
+CONFIG_FEATURE_RTMINMAX=y
+CONFIG_PASSWORD_MINLEN=6
+CONFIG_MD5_SMALL=1
+CONFIG_SHA3_SMALL=1
+CONFIG_FEATURE_FAST_TOP=y
+# CONFIG_FEATURE_ETC_NETWORKS is not set
+CONFIG_FEATURE_USE_TERMIOS=y
+CONFIG_FEATURE_EDITING=y
+CONFIG_FEATURE_EDITING_MAX_LEN=1024
+# CONFIG_FEATURE_EDITING_VI is not set
+CONFIG_FEATURE_EDITING_HISTORY=15
+CONFIG_FEATURE_EDITING_SAVEHISTORY=y
+# CONFIG_FEATURE_EDITING_SAVE_ON_EXIT is not set
+# CONFIG_FEATURE_REVERSE_SEARCH is not set
+CONFIG_FEATURE_TAB_COMPLETION=y
+CONFIG_FEATURE_USERNAME_COMPLETION=y
+CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
+# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set
+CONFIG_FEATURE_NON_POSIX_CP=y
+# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set
+CONFIG_FEATURE_COPYBUF_KB=4
+CONFIG_FEATURE_SKIP_ROOTFS=y
+CONFIG_MONOTONIC_SYSCALL=y
+CONFIG_IOCTL_HEX2STR_ERROR=y
+CONFIG_FEATURE_HWIB=y
+
+#
+# Applets
+#
+
+#
+# Archival Utilities
+#
+CONFIG_FEATURE_SEAMLESS_XZ=y
+CONFIG_FEATURE_SEAMLESS_LZMA=y
+CONFIG_FEATURE_SEAMLESS_BZ2=y
+CONFIG_FEATURE_SEAMLESS_GZ=y
+CONFIG_FEATURE_SEAMLESS_Z=y
+CONFIG_AR=y
+# CONFIG_FEATURE_AR_LONG_FILENAMES is not set
+# CONFIG_FEATURE_AR_CREATE is not set
+# CONFIG_UNCOMPRESS is not set
+CONFIG_GUNZIP=y
+CONFIG_BUNZIP2=y
+# CONFIG_UNLZMA is not set
+# CONFIG_FEATURE_LZMA_FAST is not set
+# CONFIG_LZMA is not set
+# CONFIG_UNXZ is not set
+# CONFIG_XZ is not set
+# CONFIG_BZIP2 is not set
+CONFIG_CPIO=y
+# CONFIG_FEATURE_CPIO_O is not set
+# CONFIG_FEATURE_CPIO_P is not set
+# CONFIG_DPKG is not set
+# CONFIG_DPKG_DEB is not set
+# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set
+CONFIG_GZIP=y
+# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set
+CONFIG_GZIP_FAST=0
+# CONFIG_LZOP is not set
+# CONFIG_LZOP_COMPR_HIGH is not set
+# CONFIG_RPM is not set
+# CONFIG_RPM2CPIO is not set
+CONFIG_TAR=y
+CONFIG_FEATURE_TAR_CREATE=y
+CONFIG_FEATURE_TAR_AUTODETECT=y
+CONFIG_FEATURE_TAR_FROM=y
+CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
+# CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set
+CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
+# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set
+# CONFIG_FEATURE_TAR_TO_COMMAND is not set
+# CONFIG_FEATURE_TAR_UNAME_GNAME is not set
+CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y
+# CONFIG_FEATURE_TAR_SELINUX is not set
+CONFIG_UNZIP=y
+
+#
+# Coreutils
+#
+CONFIG_BASENAME=y
+CONFIG_CAT=y
+CONFIG_DATE=y
+# CONFIG_FEATURE_DATE_ISOFMT is not set
+# CONFIG_FEATURE_DATE_NANO is not set
+CONFIG_FEATURE_DATE_COMPAT=y
+# CONFIG_HOSTID is not set
+CONFIG_ID=y
+CONFIG_GROUPS=y
+CONFIG_SHUF=y
+CONFIG_TEST=y
+CONFIG_FEATURE_TEST_64=y
+CONFIG_TOUCH=y
+CONFIG_FEATURE_TOUCH_NODEREF=y
+CONFIG_FEATURE_TOUCH_SUSV3=y
+CONFIG_TR=y
+CONFIG_FEATURE_TR_CLASSES=y
+# CONFIG_FEATURE_TR_EQUIV is not set
+CONFIG_UNLINK=y
+# CONFIG_BASE64 is not set
+CONFIG_WHO=y
+CONFIG_USERS=y
+# CONFIG_CAL is not set
+# CONFIG_CATV is not set
+CONFIG_CHGRP=y
+CONFIG_CHMOD=y
+CONFIG_CHOWN=y
+# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set
+CONFIG_CHROOT=y
+# CONFIG_CKSUM is not set
+# CONFIG_COMM is not set
+CONFIG_CP=y
+# CONFIG_FEATURE_CP_LONG_OPTIONS is not set
+CONFIG_CUT=y
+CONFIG_DD=y
+CONFIG_FEATURE_DD_SIGNAL_HANDLING=y
+# CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set
+# CONFIG_FEATURE_DD_IBS_OBS is not set
+CONFIG_DF=y
+# CONFIG_FEATURE_DF_FANCY is not set
+CONFIG_DIRNAME=y
+# CONFIG_DOS2UNIX is not set
+# CONFIG_UNIX2DOS is not set
+CONFIG_DU=y
+CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y
+CONFIG_ECHO=y
+CONFIG_FEATURE_FANCY_ECHO=y
+CONFIG_ENV=y
+CONFIG_FEATURE_ENV_LONG_OPTIONS=y
+# CONFIG_EXPAND is not set
+# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set
+CONFIG_EXPR=y
+CONFIG_EXPR_MATH_SUPPORT_64=y
+CONFIG_FALSE=y
+# CONFIG_FOLD is not set
+# CONFIG_FSYNC is not set
+CONFIG_HEAD=y
+# CONFIG_FEATURE_FANCY_HEAD is not set
+# CONFIG_INSTALL is not set
+# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set
+CONFIG_LN=y
+CONFIG_LOGNAME=y
+CONFIG_LS=y
+CONFIG_FEATURE_LS_FILETYPES=y
+CONFIG_FEATURE_LS_FOLLOWLINKS=y
+CONFIG_FEATURE_LS_RECURSIVE=y
+CONFIG_FEATURE_LS_SORTFILES=y
+CONFIG_FEATURE_LS_TIMESTAMPS=y
+CONFIG_FEATURE_LS_USERNAME=y
+CONFIG_FEATURE_LS_COLOR=y
+# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set
+CONFIG_MD5SUM=y
+CONFIG_MKDIR=y
+CONFIG_FEATURE_MKDIR_LONG_OPTIONS=y
+CONFIG_MKFIFO=y
+CONFIG_MKNOD=y
+CONFIG_MV=y
+# CONFIG_FEATURE_MV_LONG_OPTIONS is not set
+# CONFIG_NICE is not set
+CONFIG_NOHUP=y
+CONFIG_OD=y
+# CONFIG_PRINTENV is not set
+CONFIG_PRINTF=y
+CONFIG_PWD=y
+CONFIG_READLINK=y
+CONFIG_FEATURE_READLINK_FOLLOW=y
+CONFIG_REALPATH=y
+CONFIG_RM=y
+CONFIG_RMDIR=y
+# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set
+CONFIG_SEQ=y
+# CONFIG_SHA1SUM is not set
+# CONFIG_SHA256SUM is not set
+# CONFIG_SHA512SUM is not set
+# CONFIG_SHA3SUM is not set
+CONFIG_SLEEP=y
+CONFIG_FEATURE_FANCY_SLEEP=y
+# CONFIG_FEATURE_FLOAT_SLEEP is not set
+CONFIG_SORT=y
+CONFIG_FEATURE_SORT_BIG=y
+# CONFIG_SPLIT is not set
+# CONFIG_FEATURE_SPLIT_FANCY is not set
+CONFIG_STAT=y
+CONFIG_FEATURE_STAT_FORMAT=y
+CONFIG_STTY=y
+# CONFIG_SUM is not set
+CONFIG_SYNC=y
+# CONFIG_TAC is not set
+CONFIG_TAIL=y
+CONFIG_FEATURE_FANCY_TAIL=y
+CONFIG_TEE=y
+# CONFIG_FEATURE_TEE_USE_BLOCK_IO is not set
+CONFIG_TRUE=y
+CONFIG_TTY=y
+CONFIG_UNAME=y
+# CONFIG_UNEXPAND is not set
+# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set
+CONFIG_UNIQ=y
+CONFIG_USLEEP=y
+# CONFIG_UUDECODE is not set
+# CONFIG_UUENCODE is not set
+CONFIG_WC=y
+# CONFIG_FEATURE_WC_LARGE is not set
+CONFIG_WHOAMI=y
+CONFIG_YES=y
+
+#
+# Common options
+#
+CONFIG_FEATURE_VERBOSE=y
+
+#
+# Common options for cp and mv
+#
+# CONFIG_FEATURE_PRESERVE_HARDLINKS is not set
+
+#
+# Common options for ls, more and telnet
+#
+CONFIG_FEATURE_AUTOWIDTH=y
+
+#
+# Common options for df, du, ls
+#
+CONFIG_FEATURE_HUMAN_READABLE=y
+
+#
+# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum
+#
+CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y
+
+#
+# Console Utilities
+#
+CONFIG_CHVT=y
+# CONFIG_FGCONSOLE is not set
+CONFIG_CLEAR=y
+CONFIG_DEALLOCVT=y
+CONFIG_DUMPKMAP=y
+# CONFIG_KBD_MODE is not set
+CONFIG_LOADFONT=y
+CONFIG_LOADKMAP=y
+CONFIG_OPENVT=y
+CONFIG_RESET=y
+# CONFIG_RESIZE is not set
+# CONFIG_FEATURE_RESIZE_PRINT is not set
+CONFIG_SETCONSOLE=y
+# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set
+# CONFIG_SETFONT is not set
+# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set
+CONFIG_DEFAULT_SETFONT_DIR=""
+# CONFIG_SETKEYCODES is not set
+# CONFIG_SETLOGCONS is not set
+# CONFIG_SHOWKEY is not set
+
+#
+# Common options for loadfont and setfont
+#
+# CONFIG_FEATURE_LOADFONT_PSF2 is not set
+# CONFIG_FEATURE_LOADFONT_RAW is not set
+
+#
+# Debian Utilities
+#
+CONFIG_MKTEMP=y
+# CONFIG_PIPE_PROGRESS is not set
+CONFIG_RUN_PARTS=y
+CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS=y
+# CONFIG_FEATURE_RUN_PARTS_FANCY is not set
+CONFIG_START_STOP_DAEMON=y
+CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y
+CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS=y
+CONFIG_WHICH=y
+
+#
+# Editors
+#
+CONFIG_AWK=y
+CONFIG_FEATURE_AWK_LIBM=y
+CONFIG_FEATURE_AWK_GNU_EXTENSIONS=y
+CONFIG_CMP=y
+CONFIG_DIFF=y
+# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set
+CONFIG_FEATURE_DIFF_DIR=y
+# CONFIG_ED is not set
+CONFIG_PATCH=y
+CONFIG_SED=y
+CONFIG_VI=y
+CONFIG_FEATURE_VI_MAX_LEN=1024
+CONFIG_FEATURE_VI_8BIT=y
+CONFIG_FEATURE_VI_COLON=y
+CONFIG_FEATURE_VI_YANKMARK=y
+CONFIG_FEATURE_VI_SEARCH=y
+# CONFIG_FEATURE_VI_REGEX_SEARCH is not set
+CONFIG_FEATURE_VI_USE_SIGNALS=y
+# CONFIG_FEATURE_VI_DOT_CMD is not set
+# CONFIG_FEATURE_VI_READONLY is not set
+# CONFIG_FEATURE_VI_SETOPTS is not set
+# CONFIG_FEATURE_VI_SET is not set
+CONFIG_FEATURE_VI_WIN_RESIZE=y
+# CONFIG_FEATURE_VI_ASK_TERMINAL is not set
+CONFIG_FEATURE_VI_UNDO=y
+CONFIG_FEATURE_VI_UNDO_QUEUE=y
+CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=256
+CONFIG_FEATURE_ALLOW_EXEC=y
+
+#
+# Finding Utilities
+#
+CONFIG_FIND=y
+CONFIG_FEATURE_FIND_PRINT0=y
+CONFIG_FEATURE_FIND_MTIME=y
+CONFIG_FEATURE_FIND_MMIN=y
+CONFIG_FEATURE_FIND_PERM=y
+CONFIG_FEATURE_FIND_TYPE=y
+CONFIG_FEATURE_FIND_XDEV=y
+CONFIG_FEATURE_FIND_MAXDEPTH=y
+CONFIG_FEATURE_FIND_NEWER=y
+# CONFIG_FEATURE_FIND_INUM is not set
+CONFIG_FEATURE_FIND_EXEC=y
+CONFIG_FEATURE_FIND_EXEC_PLUS=y
+CONFIG_FEATURE_FIND_USER=y
+CONFIG_FEATURE_FIND_GROUP=y
+CONFIG_FEATURE_FIND_NOT=y
+CONFIG_FEATURE_FIND_DEPTH=y
+CONFIG_FEATURE_FIND_PAREN=y
+CONFIG_FEATURE_FIND_SIZE=y
+CONFIG_FEATURE_FIND_PRUNE=y
+# CONFIG_FEATURE_FIND_DELETE is not set
+CONFIG_FEATURE_FIND_PATH=y
+CONFIG_FEATURE_FIND_REGEX=y
+# CONFIG_FEATURE_FIND_CONTEXT is not set
+# CONFIG_FEATURE_FIND_LINKS is not set
+CONFIG_GREP=y
+CONFIG_FEATURE_GREP_EGREP_ALIAS=y
+CONFIG_FEATURE_GREP_FGREP_ALIAS=y
+CONFIG_FEATURE_GREP_CONTEXT=y
+CONFIG_XARGS=y
+# CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_QUOTES is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT is not set
+# CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM is not set
+CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y
+
+#
+# Init Utilities
+#
+# CONFIG_BOOTCHARTD is not set
+# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set
+# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set
+CONFIG_HALT=y
+# CONFIG_FEATURE_CALL_TELINIT is not set
+CONFIG_TELINIT_PATH=""
+# CONFIG_INIT is not set
+# CONFIG_FEATURE_USE_INITTAB is not set
+# CONFIG_FEATURE_KILL_REMOVED is not set
+CONFIG_FEATURE_KILL_DELAY=0
+# CONFIG_FEATURE_INIT_SCTTY is not set
+# CONFIG_FEATURE_INIT_SYSLOG is not set
+# CONFIG_FEATURE_EXTRA_QUIET is not set
+# CONFIG_FEATURE_INIT_COREDUMPS is not set
+# CONFIG_FEATURE_INITRD is not set
+CONFIG_INIT_TERMINAL_TYPE=""
+CONFIG_MESG=y
+# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP is not set
+
+#
+# Login/Password Management Utilities
+#
+# CONFIG_ADD_SHELL is not set
+# CONFIG_REMOVE_SHELL is not set
+# CONFIG_FEATURE_SHADOWPASSWDS is not set
+# CONFIG_USE_BB_PWD_GRP is not set
+# CONFIG_USE_BB_SHADOW is not set
+CONFIG_USE_BB_CRYPT=y
+# CONFIG_USE_BB_CRYPT_SHA is not set
+# CONFIG_ADDUSER is not set
+# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set
+# CONFIG_FEATURE_CHECK_NAMES is not set
+CONFIG_LAST_ID=60000
+CONFIG_FIRST_SYSTEM_ID=100
+CONFIG_LAST_SYSTEM_ID=999
+# CONFIG_ADDGROUP is not set
+# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set
+# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set
+# CONFIG_DELUSER is not set
+# CONFIG_DELGROUP is not set
+# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set
+# CONFIG_GETTY is not set
+# CONFIG_LOGIN is not set
+# CONFIG_LOGIN_SESSION_AS_CHILD is not set
+# CONFIG_LOGIN_SCRIPTS is not set
+# CONFIG_FEATURE_NOLOGIN is not set
+# CONFIG_FEATURE_SECURETTY is not set
+# CONFIG_PASSWD is not set
+# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set
+# CONFIG_CRYPTPW is not set
+# CONFIG_CHPASSWD is not set
+CONFIG_FEATURE_DEFAULT_PASSWD_ALGO=""
+# CONFIG_SU is not set
+# CONFIG_FEATURE_SU_SYSLOG is not set
+# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set
+# CONFIG_SULOGIN is not set
+# CONFIG_VLOCK is not set
+
+#
+# Linux Ext2 FS Progs
+#
+CONFIG_CHATTR=y
+CONFIG_FSCK=y
+# CONFIG_LSATTR is not set
+# CONFIG_TUNE2FS is not set
+
+#
+# Linux Module Utilities
+#
+# CONFIG_MODINFO is not set
+# CONFIG_MODPROBE_SMALL is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set
+# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set
+CONFIG_INSMOD=y
+CONFIG_RMMOD=y
+CONFIG_LSMOD=y
+# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set
+CONFIG_MODPROBE=y
+# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set
+CONFIG_DEPMOD=y
+
+#
+# Options common to multiple modutils
+#
+# CONFIG_FEATURE_2_4_MODULES is not set
+# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set
+# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set
+# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set
+# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set
+# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set
+CONFIG_FEATURE_CHECK_TAINTED_MODULE=y
+CONFIG_FEATURE_MODUTILS_ALIAS=y
+CONFIG_FEATURE_MODUTILS_SYMBOLS=y
+CONFIG_DEFAULT_MODULES_DIR="/lib/modules"
+CONFIG_DEFAULT_DEPMOD_FILE="modules.dep"
+
+#
+# Linux System Utilities
+#
+# CONFIG_BLOCKDEV is not set
+# CONFIG_FATATTR is not set
+CONFIG_FSTRIM=y
+# CONFIG_MDEV is not set
+# CONFIG_FEATURE_MDEV_CONF is not set
+# CONFIG_FEATURE_MDEV_RENAME is not set
+# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set
+# CONFIG_FEATURE_MDEV_EXEC is not set
+# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set
+# CONFIG_REV is not set
+# CONFIG_ACPID is not set
+# CONFIG_FEATURE_ACPID_COMPAT is not set
+# CONFIG_BLKID is not set
+# CONFIG_FEATURE_BLKID_TYPE is not set
+CONFIG_DMESG=y
+CONFIG_FEATURE_DMESG_PRETTY=y
+CONFIG_FBSET=y
+CONFIG_FEATURE_FBSET_FANCY=y
+CONFIG_FEATURE_FBSET_READMODE=y
+# CONFIG_FDFLUSH is not set
+# CONFIG_FDFORMAT is not set
+CONFIG_FDISK=y
+# CONFIG_FDISK_SUPPORT_LARGE_DISKS is not set
+CONFIG_FEATURE_FDISK_WRITABLE=y
+# CONFIG_FEATURE_AIX_LABEL is not set
+# CONFIG_FEATURE_SGI_LABEL is not set
+# CONFIG_FEATURE_SUN_LABEL is not set
+# CONFIG_FEATURE_OSF_LABEL is not set
+# CONFIG_FEATURE_GPT_LABEL is not set
+# CONFIG_FEATURE_FDISK_ADVANCED is not set
+# CONFIG_FINDFS is not set
+CONFIG_FLOCK=y
+# CONFIG_FREERAMDISK is not set
+# CONFIG_FSCK_MINIX is not set
+# CONFIG_MKFS_EXT2 is not set
+# CONFIG_MKFS_MINIX is not set
+# CONFIG_FEATURE_MINIX2 is not set
+# CONFIG_MKFS_REISER is not set
+# CONFIG_MKFS_VFAT is not set
+# CONFIG_GETOPT is not set
+# CONFIG_FEATURE_GETOPT_LONG is not set
+CONFIG_HEXDUMP=y
+# CONFIG_FEATURE_HEXDUMP_REVERSE is not set
+# CONFIG_HD is not set
+CONFIG_HWCLOCK=y
+CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS=y
+CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS=y
+# CONFIG_IPCRM is not set
+# CONFIG_IPCS is not set
+CONFIG_LOSETUP=y
+# CONFIG_LSPCI is not set
+# CONFIG_LSUSB is not set
+CONFIG_MKSWAP=y
+# CONFIG_FEATURE_MKSWAP_UUID is not set
+CONFIG_MORE=y
+CONFIG_MOUNT=y
+# CONFIG_FEATURE_MOUNT_FAKE is not set
+# CONFIG_FEATURE_MOUNT_VERBOSE is not set
+# CONFIG_FEATURE_MOUNT_HELPERS is not set
+# CONFIG_FEATURE_MOUNT_LABEL is not set
+CONFIG_FEATURE_MOUNT_NFS=y
+# CONFIG_FEATURE_MOUNT_CIFS is not set
+CONFIG_FEATURE_MOUNT_FLAGS=y
+CONFIG_FEATURE_MOUNT_FSTAB=y
+CONFIG_PIVOT_ROOT=y
+CONFIG_RDATE=y
+# CONFIG_RDEV is not set
+# CONFIG_READPROFILE is not set
+# CONFIG_RTCWAKE is not set
+# CONFIG_SCRIPT is not set
+# CONFIG_SCRIPTREPLAY is not set
+# CONFIG_SETARCH is not set
+CONFIG_SWAPONOFF=y
+CONFIG_FEATURE_SWAPON_DISCARD=y
+CONFIG_FEATURE_SWAPON_PRI=y
+CONFIG_SWITCH_ROOT=y
+CONFIG_UMOUNT=y
+CONFIG_FEATURE_UMOUNT_ALL=y
+
+#
+# Common options for mount/umount
+#
+CONFIG_FEATURE_MOUNT_LOOP=y
+CONFIG_FEATURE_MOUNT_LOOP_CREATE=y
+# CONFIG_FEATURE_MTAB_SUPPORT is not set
+# CONFIG_VOLUMEID is not set
+# CONFIG_FEATURE_VOLUMEID_BTRFS is not set
+# CONFIG_FEATURE_VOLUMEID_CRAMFS is not set
+# CONFIG_FEATURE_VOLUMEID_EXFAT is not set
+# CONFIG_FEATURE_VOLUMEID_EXT is not set
+# CONFIG_FEATURE_VOLUMEID_F2FS is not set
+# CONFIG_FEATURE_VOLUMEID_FAT is not set
+# CONFIG_FEATURE_VOLUMEID_HFS is not set
+# CONFIG_FEATURE_VOLUMEID_ISO9660 is not set
+# CONFIG_FEATURE_VOLUMEID_JFS is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXRAID is not set
+# CONFIG_FEATURE_VOLUMEID_LINUXSWAP is not set
+# CONFIG_FEATURE_VOLUMEID_LUKS is not set
+# CONFIG_FEATURE_VOLUMEID_NILFS is not set
+# CONFIG_FEATURE_VOLUMEID_NTFS is not set
+# CONFIG_FEATURE_VOLUMEID_OCFS2 is not set
+# CONFIG_FEATURE_VOLUMEID_REISERFS is not set
+# CONFIG_FEATURE_VOLUMEID_ROMFS is not set
+# CONFIG_FEATURE_VOLUMEID_SQUASHFS is not set
+# CONFIG_FEATURE_VOLUMEID_SYSV is not set
+# CONFIG_FEATURE_VOLUMEID_UDF is not set
+# CONFIG_FEATURE_VOLUMEID_XFS is not set
+
+#
+# Miscellaneous Utilities
+#
+# CONFIG_CONSPY is not set
+# CONFIG_CROND is not set
+# CONFIG_FEATURE_CROND_D is not set
+# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set
+CONFIG_FEATURE_CROND_DIR=""
+CONFIG_LESS=y
+CONFIG_FEATURE_LESS_MAXLINES=9999999
+CONFIG_FEATURE_LESS_BRACKETS=y
+CONFIG_FEATURE_LESS_FLAGS=y
+# CONFIG_FEATURE_LESS_MARKS is not set
+# CONFIG_FEATURE_LESS_REGEXP is not set
+# CONFIG_FEATURE_LESS_WINCH is not set
+# CONFIG_FEATURE_LESS_ASK_TERMINAL is not set
+# CONFIG_FEATURE_LESS_DASHCMD is not set
+# CONFIG_FEATURE_LESS_LINENUMS is not set
+# CONFIG_NANDWRITE is not set
+# CONFIG_NANDDUMP is not set
+CONFIG_RFKILL=y
+# CONFIG_SETSERIAL is not set
+# CONFIG_TASKSET is not set
+# CONFIG_FEATURE_TASKSET_FANCY is not set
+# CONFIG_UBIATTACH is not set
+# CONFIG_UBIDETACH is not set
+# CONFIG_UBIMKVOL is not set
+# CONFIG_UBIRMVOL is not set
+# CONFIG_UBIRSVOL is not set
+# CONFIG_UBIUPDATEVOL is not set
+# CONFIG_WALL is not set
+# CONFIG_ADJTIMEX is not set
+# CONFIG_BBCONFIG is not set
+# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set
+# CONFIG_BEEP is not set
+CONFIG_FEATURE_BEEP_FREQ=0
+CONFIG_FEATURE_BEEP_LENGTH_MS=0
+# CONFIG_CHAT is not set
+# CONFIG_FEATURE_CHAT_NOFAIL is not set
+# CONFIG_FEATURE_CHAT_TTY_HIFI is not set
+# CONFIG_FEATURE_CHAT_IMPLICIT_CR is not set
+# CONFIG_FEATURE_CHAT_SWALLOW_OPTS is not set
+# CONFIG_FEATURE_CHAT_SEND_ESCAPES is not set
+# CONFIG_FEATURE_CHAT_VAR_ABORT_LEN is not set
+# CONFIG_FEATURE_CHAT_CLR_ABORT is not set
+# CONFIG_CHRT is not set
+# CONFIG_CRONTAB is not set
+CONFIG_DC=y
+# CONFIG_FEATURE_DC_LIBM is not set
+# CONFIG_DEVFSD is not set
+# CONFIG_DEVFSD_MODLOAD is not set
+# CONFIG_DEVFSD_FG_NP is not set
+# CONFIG_DEVFSD_VERBOSE is not set
+# CONFIG_FEATURE_DEVFS is not set
+# CONFIG_DEVMEM is not set
+# CONFIG_EJECT is not set
+# CONFIG_FEATURE_EJECT_SCSI is not set
+# CONFIG_FBSPLASH is not set
+# CONFIG_FLASHCP is not set
+# CONFIG_FLASH_LOCK is not set
+# CONFIG_FLASH_UNLOCK is not set
+# CONFIG_FLASH_ERASEALL is not set
+# CONFIG_IONICE is not set
+# CONFIG_INOTIFYD is not set
+# CONFIG_LAST is not set
+# CONFIG_FEATURE_LAST_SMALL is not set
+# CONFIG_FEATURE_LAST_FANCY is not set
+# CONFIG_HDPARM is not set
+# CONFIG_FEATURE_HDPARM_GET_IDENTITY is not set
+# CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set
+# CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set
+# CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA is not set
+# CONFIG_MAKEDEVS is not set
+# CONFIG_FEATURE_MAKEDEVS_LEAF is not set
+# CONFIG_FEATURE_MAKEDEVS_TABLE is not set
+# CONFIG_MAN is not set
+CONFIG_MICROCOM=y
+# CONFIG_MOUNTPOINT is not set
+# CONFIG_MT is not set
+# CONFIG_RAIDAUTORUN is not set
+# CONFIG_READAHEAD is not set
+# CONFIG_RUNLEVEL is not set
+# CONFIG_RX is not set
+# CONFIG_SETSID is not set
+CONFIG_STRINGS=y
+CONFIG_TIME=y
+# CONFIG_TIMEOUT is not set
+# CONFIG_TTYSIZE is not set
+# CONFIG_VOLNAME is not set
+# CONFIG_WATCHDOG is not set
+
+#
+# Networking Utilities
+#
+# CONFIG_NAMEIF is not set
+# CONFIG_FEATURE_NAMEIF_EXTENDED is not set
+# CONFIG_NBDCLIENT is not set
+CONFIG_NC=y
+# CONFIG_NC_SERVER is not set
+# CONFIG_NC_EXTRA is not set
+# CONFIG_NC_110_COMPAT is not set
+CONFIG_PING=y
+CONFIG_PING6=y
+CONFIG_FEATURE_FANCY_PING=y
+# CONFIG_WHOIS is not set
+CONFIG_FEATURE_IPV6=y
+# CONFIG_FEATURE_UNIX_LOCAL is not set
+CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
+# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
+# CONFIG_ARP is not set
+# CONFIG_ARPING is not set
+# CONFIG_BRCTL is not set
+# CONFIG_FEATURE_BRCTL_FANCY is not set
+# CONFIG_FEATURE_BRCTL_SHOW is not set
+# CONFIG_DNSD is not set
+# CONFIG_ETHER_WAKE is not set
+# CONFIG_FAKEIDENTD is not set
+# CONFIG_FTPD is not set
+# CONFIG_FEATURE_FTP_WRITE is not set
+# CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set
+# CONFIG_FEATURE_FTP_AUTHENTICATION is not set
+# CONFIG_FTPGET is not set
+# CONFIG_FTPPUT is not set
+# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set
+CONFIG_HOSTNAME=y
+# CONFIG_HTTPD is not set
+# CONFIG_FEATURE_HTTPD_RANGES is not set
+# CONFIG_FEATURE_HTTPD_SETUID is not set
+# CONFIG_FEATURE_HTTPD_BASIC_AUTH is not set
+# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set
+# CONFIG_FEATURE_HTTPD_CGI is not set
+# CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set
+# CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set
+# CONFIG_FEATURE_HTTPD_ENCODE_URL_STR is not set
+# CONFIG_FEATURE_HTTPD_ERROR_PAGES is not set
+# CONFIG_FEATURE_HTTPD_PROXY is not set
+# CONFIG_FEATURE_HTTPD_GZIP is not set
+CONFIG_IFCONFIG=y
+CONFIG_FEATURE_IFCONFIG_STATUS=y
+# CONFIG_FEATURE_IFCONFIG_SLIP is not set
+# CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set
+CONFIG_FEATURE_IFCONFIG_HW=y
+# CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS is not set
+# CONFIG_IFENSLAVE is not set
+# CONFIG_IFPLUGD is not set
+CONFIG_IFUPDOWN=y
+CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate"
+# CONFIG_FEATURE_IFUPDOWN_IP is not set
+# CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN is not set
+CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN=y
+CONFIG_FEATURE_IFUPDOWN_IPV4=y
+CONFIG_FEATURE_IFUPDOWN_IPV6=y
+CONFIG_FEATURE_IFUPDOWN_MAPPING=y
+CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP=y
+# CONFIG_INETD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set
+# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set
+# CONFIG_FEATURE_INETD_RPC is not set
+CONFIG_IP=y
+CONFIG_FEATURE_IP_ADDRESS=y
+CONFIG_FEATURE_IP_LINK=y
+CONFIG_FEATURE_IP_ROUTE=y
+CONFIG_FEATURE_IP_TUNNEL=y
+# CONFIG_FEATURE_IP_RULE is not set
+# CONFIG_FEATURE_IP_SHORT_FORMS is not set
+# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set
+# CONFIG_IPADDR is not set
+# CONFIG_IPLINK is not set
+# CONFIG_IPROUTE is not set
+# CONFIG_IPTUNNEL is not set
+# CONFIG_IPRULE is not set
+# CONFIG_IPCALC is not set
+# CONFIG_FEATURE_IPCALC_FANCY is not set
+# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set
+CONFIG_NETSTAT=y
+# CONFIG_FEATURE_NETSTAT_WIDE is not set
+# CONFIG_FEATURE_NETSTAT_PRG is not set
+CONFIG_NSLOOKUP=y
+# CONFIG_NTPD is not set
+# CONFIG_FEATURE_NTPD_SERVER is not set
+# CONFIG_FEATURE_NTPD_CONF is not set
+# CONFIG_PSCAN is not set
+CONFIG_ROUTE=y
+# CONFIG_SLATTACH is not set
+# CONFIG_TCPSVD is not set
+CONFIG_TELNET=y
+# CONFIG_FEATURE_TELNET_TTYPE is not set
+CONFIG_FEATURE_TELNET_AUTOLOGIN=y
+# CONFIG_TELNETD is not set
+# CONFIG_FEATURE_TELNETD_STANDALONE is not set
+# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set
+CONFIG_TFTP=y
+# CONFIG_TFTPD is not set
+
+#
+# Common options for tftp/tftpd
+#
+CONFIG_FEATURE_TFTP_GET=y
+CONFIG_FEATURE_TFTP_PUT=y
+# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set
+# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set
+# CONFIG_TFTP_DEBUG is not set
+CONFIG_TRACEROUTE=y
+# CONFIG_TRACEROUTE6 is not set
+# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set
+# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set
+# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set
+# CONFIG_TUNCTL is not set
+# CONFIG_FEATURE_TUNCTL_UG is not set
+# CONFIG_UDHCPC6 is not set
+CONFIG_UDHCPD=y
+# CONFIG_DHCPRELAY is not set
+CONFIG_DUMPLEASES=y
+# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set
+# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set
+CONFIG_DHCPD_LEASES_FILE="/var/lib/misc/udhcpd.leases"
+CONFIG_UDHCPC=y
+CONFIG_FEATURE_UDHCPC_ARPING=y
+CONFIG_FEATURE_UDHCPC_SANITIZEOPT=y
+# CONFIG_FEATURE_UDHCP_PORT is not set
+CONFIG_UDHCP_DEBUG=0
+# CONFIG_FEATURE_UDHCP_RFC3397 is not set
+# CONFIG_FEATURE_UDHCP_8021Q is not set
+CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script"
+CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
+CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n"
+# CONFIG_UDPSVD is not set
+# CONFIG_VCONFIG is not set
+CONFIG_WGET=y
+CONFIG_FEATURE_WGET_STATUSBAR=y
+CONFIG_FEATURE_WGET_AUTHENTICATION=y
+CONFIG_FEATURE_WGET_LONG_OPTIONS=y
+CONFIG_FEATURE_WGET_TIMEOUT=y
+# CONFIG_ZCIP is not set
+
+#
+# Print Utilities
+#
+# CONFIG_LPD is not set
+# CONFIG_LPR is not set
+# CONFIG_LPQ is not set
+
+#
+# Mail Utilities
+#
+# CONFIG_MAKEMIME is not set
+CONFIG_FEATURE_MIME_CHARSET=""
+# CONFIG_POPMAILDIR is not set
+# CONFIG_FEATURE_POPMAILDIR_DELIVERY is not set
+# CONFIG_REFORMIME is not set
+# CONFIG_FEATURE_REFORMIME_COMPAT is not set
+# CONFIG_SENDMAIL is not set
+
+#
+# Process Utilities
+#
+# CONFIG_IOSTAT is not set
+# CONFIG_LSOF is not set
+# CONFIG_MPSTAT is not set
+# CONFIG_NMETER is not set
+# CONFIG_PMAP is not set
+# CONFIG_POWERTOP is not set
+# CONFIG_PSTREE is not set
+# CONFIG_PWDX is not set
+# CONFIG_SMEMCAP is not set
+CONFIG_TOP=y
+CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y
+CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y
+# CONFIG_FEATURE_TOP_SMP_CPU is not set
+# CONFIG_FEATURE_TOP_DECIMALS is not set
+# CONFIG_FEATURE_TOP_SMP_PROCESS is not set
+# CONFIG_FEATURE_TOPMEM is not set
+CONFIG_UPTIME=y
+# CONFIG_FEATURE_UPTIME_UTMP_SUPPORT is not set
+CONFIG_FREE=y
+CONFIG_FUSER=y
+CONFIG_KILL=y
+CONFIG_KILLALL=y
+# CONFIG_KILLALL5 is not set
+# CONFIG_PGREP is not set
+CONFIG_PIDOF=y
+# CONFIG_FEATURE_PIDOF_SINGLE is not set
+# CONFIG_FEATURE_PIDOF_OMIT is not set
+# CONFIG_PKILL is not set
+CONFIG_PS=y
+CONFIG_FEATURE_PS_WIDE=y
+CONFIG_FEATURE_PS_LONG=y
+# CONFIG_FEATURE_PS_TIME is not set
+# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set
+# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set
+CONFIG_RENICE=y
+CONFIG_BB_SYSCTL=y
+# CONFIG_FEATURE_SHOW_THREADS is not set
+CONFIG_WATCH=y
+
+#
+# Runit Utilities
+#
+# CONFIG_RUNSV is not set
+# CONFIG_RUNSVDIR is not set
+# CONFIG_FEATURE_RUNSVDIR_LOG is not set
+# CONFIG_SV is not set
+CONFIG_SV_DEFAULT_SERVICE_DIR=""
+# CONFIG_SVLOGD is not set
+# CONFIG_CHPST is not set
+# CONFIG_SETUIDGID is not set
+# CONFIG_ENVUIDGID is not set
+# CONFIG_ENVDIR is not set
+# CONFIG_SOFTLIMIT is not set
+# CONFIG_CHCON is not set
+# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set
+# CONFIG_GETENFORCE is not set
+# CONFIG_GETSEBOOL is not set
+# CONFIG_LOAD_POLICY is not set
+# CONFIG_MATCHPATHCON is not set
+# CONFIG_RESTORECON is not set
+# CONFIG_RUNCON is not set
+# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set
+# CONFIG_SELINUXENABLED is not set
+# CONFIG_SETENFORCE is not set
+# CONFIG_SETFILES is not set
+# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set
+# CONFIG_SETSEBOOL is not set
+# CONFIG_SESTATUS is not set
+
+#
+# Shells
+#
+CONFIG_ASH=y
+CONFIG_ASH_BASH_COMPAT=y
+# CONFIG_ASH_IDLE_TIMEOUT is not set
+CONFIG_ASH_JOB_CONTROL=y
+CONFIG_ASH_ALIAS=y
+CONFIG_ASH_GETOPTS=y
+CONFIG_ASH_BUILTIN_ECHO=y
+CONFIG_ASH_BUILTIN_PRINTF=y
+CONFIG_ASH_BUILTIN_TEST=y
+CONFIG_ASH_HELP=y
+# CONFIG_ASH_CMDCMD is not set
+# CONFIG_ASH_MAIL is not set
+CONFIG_ASH_OPTIMIZE_FOR_SIZE=y
+# CONFIG_ASH_RANDOM_SUPPORT is not set
+CONFIG_ASH_EXPAND_PRMT=y
+# CONFIG_CTTYHACK is not set
+# CONFIG_HUSH is not set
+# CONFIG_HUSH_BASH_COMPAT is not set
+# CONFIG_HUSH_BRACE_EXPANSION is not set
+# CONFIG_HUSH_HELP is not set
+# CONFIG_HUSH_INTERACTIVE is not set
+# CONFIG_HUSH_SAVEHISTORY is not set
+# CONFIG_HUSH_JOB is not set
+# CONFIG_HUSH_TICK is not set
+# CONFIG_HUSH_IF is not set
+# CONFIG_HUSH_LOOPS is not set
+# CONFIG_HUSH_CASE is not set
+# CONFIG_HUSH_FUNCTIONS is not set
+# CONFIG_HUSH_LOCAL is not set
+# CONFIG_HUSH_RANDOM_SUPPORT is not set
+# CONFIG_HUSH_EXPORT_N is not set
+# CONFIG_HUSH_MODE_X is not set
+# CONFIG_MSH is not set
+CONFIG_FEATURE_SH_IS_ASH=y
+# CONFIG_FEATURE_SH_IS_HUSH is not set
+# CONFIG_FEATURE_SH_IS_NONE is not set
+# CONFIG_FEATURE_BASH_IS_ASH is not set
+# CONFIG_FEATURE_BASH_IS_HUSH is not set
+CONFIG_FEATURE_BASH_IS_NONE=y
+CONFIG_SH_MATH_SUPPORT=y
+# CONFIG_SH_MATH_SUPPORT_64 is not set
+CONFIG_FEATURE_SH_EXTRA_QUIET=y
+# CONFIG_FEATURE_SH_STANDALONE is not set
+# CONFIG_FEATURE_SH_NOFORK is not set
+CONFIG_FEATURE_SH_HISTFILESIZE=y
+
+#
+# System Logging Utilities
+#
+CONFIG_SYSLOGD=y
+CONFIG_FEATURE_ROTATE_LOGFILE=y
+CONFIG_FEATURE_REMOTE_LOG=y
+CONFIG_FEATURE_SYSLOGD_DUP=y
+CONFIG_FEATURE_SYSLOGD_CFG=y
+CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=256
+CONFIG_FEATURE_IPC_SYSLOG=y
+CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=64
+CONFIG_LOGREAD=y
+CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING=y
+CONFIG_FEATURE_KMSG_SYSLOG=y
+CONFIG_KLOGD=y
+
+#
+# klogd should not be used together with syslog to kernel printk buffer
+#
+CONFIG_FEATURE_KLOGD_KLOGCTL=y
+CONFIG_LOGGER=y
diff --git a/meta/recipes-core/busybox/busybox/fail_on_no_media.patch b/meta/recipes-core/busybox/busybox/fail_on_no_media.patch
new file mode 100644
index 0000000..6745f16
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/fail_on_no_media.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Pending
+
+The current behaviour of busybox is to try all fstype when automounting
+even when no media exists.  The util-linux mount command bails when no
+media exists, so change the behaviour of busybox to do the same.
+
+It could also be argued that the KERN_INFO message from btrfs could be
+removed, but that would be harder to accomplish.
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: busybox-1.20.2/util-linux/mount.c
+===================================================================
+--- busybox-1.20.2.orig/util-linux/mount.c
++++ busybox-1.20.2/util-linux/mount.c
+@@ -598,7 +598,13 @@ static int mount_it_now(struct mntent *m
+ 				break;
+ 			errno = errno_save;
+ 		}
+-
++		/*
++		 * Break if there is no media, no point retrying for all
++		 * fs types since there is no media available
++		 */
++		if (rc == -1 && errno == ENOMEDIUM) {
++			bb_perror_msg_and_die("mounting %s on %s failed", mp->mnt_fsname, mp->mnt_dir);
++		}
+ 		if (!rc || (vfsflags & MS_RDONLY) || (errno != EACCES && errno != EROFS))
+ 			break;
+ 		if (!(vfsflags & MS_SILENT))
diff --git a/meta/recipes-core/busybox/busybox/get_header_tar.patch b/meta/recipes-core/busybox/busybox/get_header_tar.patch
new file mode 100644
index 0000000..0e528ff
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/get_header_tar.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+# copy commit message from OE as the patch comment:
+#    commit 5a0e1d473ca7aca5ffefffe9a2ec44ae7a1f35bc
+#    Author: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
+#    Date:   Wed Feb 11 22:40:21 2009 +0100
+#
+#    busybox: fix tar problem with filenames that are exactly 100 bytes
+#
+# above comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-06
+
+--- busybox-1.13.2/archival/libarchive/get_header_tar.c.orig	2008-11-09 18:28:02.000000000 +0100
++++ busybox-1.13.2/archival/libarchive/get_header_tar.c	2009-02-11 22:34:52.000000000 +0100
+@@ -252,6 +252,8 @@
+ 			file_header->name = concat_path_file(tar.prefix, tar.name);
+ 		} else
+ 			file_header->name = xstrdup(tar.name);
++		if (strlen(file_header->name) > 100) 
++			file_header->name[100] = 0;
+ 	}
+ 
+ 	/* Set bits 12-15 of the files mode */
diff --git a/meta/recipes-core/busybox/busybox/getopts.cfg b/meta/recipes-core/busybox/busybox/getopts.cfg
new file mode 100644
index 0000000..8db0a4a
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/getopts.cfg
@@ -0,0 +1,3 @@
+CONFIG_GETOPT=y
+CONFIG_LONG_OPTS=y
+CONFIG_FEATURE_GETOPT_LONG=y
diff --git a/meta/recipes-core/busybox/busybox/login-utilities.cfg b/meta/recipes-core/busybox/busybox/login-utilities.cfg
new file mode 100644
index 0000000..cc9b2db
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/login-utilities.cfg
@@ -0,0 +1,13 @@
+CONFIG_FEATURE_SHADOWPASSWDS=y
+CONFIG_ADDUSER=y
+CONFIG_FEATURE_ADDUSER_LONG_OPTIONS=y
+CONFIG_ADDGROUP=y
+CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS=y
+CONFIG_DELUSER=y
+CONFIG_DELGROUP=y
+CONFIG_GETTY=y
+CONFIG_LOGIN=y
+CONFIG_PASSWD=y
+CONFIG_SU=y
+CONFIG_SULOGIN=y
+CONFIG_VLOCK=y
diff --git a/meta/recipes-core/busybox/busybox/mount-via-label.cfg b/meta/recipes-core/busybox/busybox/mount-via-label.cfg
new file mode 100644
index 0000000..2fe7ab2
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/mount-via-label.cfg
@@ -0,0 +1,9 @@
+CONFIG_BLKID=y
+CONFIG_FEATURE_BLKID_TYPE=y
+CONFIG_FEATURE_MOUNT_LABEL=y
+CONFIG_VOLUMEID=y
+CONFIG_FEATURE_VOLUMEID_BTRFS=y
+CONFIG_FEATURE_VOLUMEID_EXT=y
+CONFIG_FEATURE_VOLUMEID_F2FS=y
+CONFIG_FEATURE_VOLUMEID_FAT=y
+CONFIG_FEATURE_VOLUMEID_SQUASHFS=y
diff --git a/meta/recipes-core/busybox/busybox/recognize_connmand.patch b/meta/recipes-core/busybox/busybox/recognize_connmand.patch
new file mode 100644
index 0000000..f42c74c
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/recognize_connmand.patch
@@ -0,0 +1,21 @@
+This adds connmand to the list of know dhcp clients
+
+Upstream-Status: Inappropriate [OE-Core]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: busybox-1.22.1/networking/ifupdown.c
+===================================================================
+--- busybox-1.22.1.orig/networking/ifupdown.c
++++ busybox-1.22.1/networking/ifupdown.c
+@@ -521,6 +521,10 @@ struct dhcp_client_t {
+ };
+ 
+ static const struct dhcp_client_t ext_dhcp_clients[] = {
++	{ "connmand",
++		"true",
++		"true",
++	},
+ 	{ "dhcpcd",
+ 		"dhcpcd[[ -h %hostname%]][[ -i %vendor%]][[ -I %client%]][[ -l %leasetime%]] %iface%",
+ 		"dhcpcd -k %iface%",
diff --git a/meta/recipes-core/busybox/busybox/sha1sum.cfg b/meta/recipes-core/busybox/busybox/sha1sum.cfg
new file mode 100644
index 0000000..20e72d9
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/sha1sum.cfg
@@ -0,0 +1 @@
+CONFIG_SHA1SUM=y
diff --git a/meta/recipes-core/busybox/busybox/sha256sum.cfg b/meta/recipes-core/busybox/busybox/sha256sum.cfg
new file mode 100644
index 0000000..ce652ae
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox/sha256sum.cfg
@@ -0,0 +1 @@
+CONFIG_SHA256SUM=y
diff --git a/meta/recipes-core/busybox/busybox_1.23.2.bb b/meta/recipes-core/busybox/busybox_1.23.2.bb
new file mode 100644
index 0000000..e4d9f97
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox_1.23.2.bb
@@ -0,0 +1,50 @@
+require busybox.inc
+
+SRC_URI = "http://www.busybox.net/downloads/busybox-${PV}.tar.bz2;name=tarball \
+           file://get_header_tar.patch \
+           file://busybox-appletlib-dependency.patch \
+           file://busybox-udhcpc-no_deconfig.patch \
+           file://find-touchscreen.sh \
+           file://busybox-cron \
+           file://busybox-httpd \
+           file://busybox-udhcpd \
+           file://default.script \
+           file://simple.script \
+           file://hwclock.sh \
+           file://mount.busybox \
+           file://syslog \
+           file://syslog-startup.conf \
+           file://syslog.conf \
+           file://busybox-syslog.default \
+           file://mdev \
+           file://mdev.conf \
+           file://mdev-mount.sh \
+           file://umount.busybox \
+           file://defconfig \
+           file://busybox-syslog.service.in \
+           file://busybox-klogd.service.in \
+           file://fail_on_no_media.patch \
+           file://run-ptest \
+           file://inetd.conf \
+           file://inetd \
+           file://login-utilities.cfg \
+           file://recognize_connmand.patch \
+           file://busybox-cross-menuconfig.patch \
+           file://0001-ifconfig-fix-double-free-fatal-error-in-INET_sprint.patch \
+           file://0001-chown-fix-help-text.patch \
+           file://mount-via-label.cfg \
+           file://sha1sum.cfg \
+           file://sha256sum.cfg \
+           file://getopts.cfg \
+"
+
+SRC_URI[tarball.md5sum] = "7925683d7dd105aabe9b6b618d48cc73"
+SRC_URI[tarball.sha256sum] = "05a6f9e21aad8c098e388ae77de7b2361941afa7157ef74216703395b14e319a"
+
+EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
+
+do_install_ptest () {
+        cp -r ${B}/testsuite ${D}${PTEST_PATH}/
+        cp ${B}/.config      ${D}${PTEST_PATH}/
+        ln -s /bin/busybox   ${D}${PTEST_PATH}/busybox
+}
diff --git a/meta/recipes-core/busybox/busybox_git.bb b/meta/recipes-core/busybox/busybox_git.bb
new file mode 100644
index 0000000..ade72f4
--- /dev/null
+++ b/meta/recipes-core/busybox/busybox_git.bb
@@ -0,0 +1,54 @@
+require busybox.inc
+
+SRCREV = "be947c4d97c0dacb703a6f24dd813ff6dd3a33b6"
+# Lookout for PV bump too when SRCREV is changed
+PV = "1.23.2+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://busybox.net/busybox.git \
+           file://get_header_tar.patch \
+           file://busybox-appletlib-dependency.patch \
+           file://busybox-udhcpc-no_deconfig.patch \
+           file://find-touchscreen.sh \
+           file://busybox-cron \
+           file://busybox-httpd \
+           file://busybox-udhcpd \
+           file://default.script \
+           file://simple.script \
+           file://hwclock.sh \
+           file://mount.busybox \
+           file://syslog \
+           file://syslog-startup.conf \
+           file://syslog.conf \
+           file://busybox-syslog.default \
+           file://mdev \
+           file://mdev.conf \
+           file://mdev-mount.sh \
+           file://umount.busybox \
+           file://defconfig \
+           file://busybox-syslog.service.in \
+           file://busybox-klogd.service.in \
+           file://fail_on_no_media.patch \
+           file://run-ptest \
+           file://inetd.conf \
+           file://inetd \
+           file://login-utilities.cfg \
+           file://recognize_connmand.patch \
+           file://busybox-cross-menuconfig.patch \
+           file://0001-ifconfig-fix-double-free-fatal-error-in-INET_sprint.patch \
+           file://0001-chown-fix-help-text.patch \
+           file://mount-via-label.cfg \
+           file://sha1sum.cfg \
+           file://sha256sum.cfg \
+"
+
+EXTRA_OEMAKE += "V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"
+
+do_install_ptest () {
+        cp -r ${B}/testsuite ${D}${PTEST_PATH}/
+        cp ${B}/.config      ${D}${PTEST_PATH}/
+        ln -s /bin/busybox   ${D}${PTEST_PATH}/busybox
+}
+
+DEFAULT_PREFERENCE = "-1"
diff --git a/meta/recipes-core/busybox/files/busybox-cron b/meta/recipes-core/busybox/files/busybox-cron
new file mode 100755
index 0000000..f0e6b15
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-cron
@@ -0,0 +1,39 @@
+#!/bin/sh
+DAEMON=/usr/sbin/crond
+NAME=crond
+DESC="Busybox Periodic Command Scheduler"
+ARGS="-c /etc/cron/crontabs"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+    start)
+        echo -n "starting $DESC: $NAME... "
+	start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+	echo "done."
+	;;
+    stop)
+        echo -n "stopping $DESC: $NAME... "
+	start-stop-daemon -K -n $NAME
+	echo "done."
+	;;
+    restart)
+        echo -n "restarting $DESC: $NAME... "
+ 	$0 stop
+	$0 start
+	echo "done."
+	;;
+    reload)
+    	echo -n "reloading $DESC: $NAME... "
+    	killall -HUP $(basename ${DAEMON})
+	echo "done."
+	;;
+    *)
+	echo "Usage: $0 {start|stop|restart|reload}"
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/busybox/files/busybox-httpd b/meta/recipes-core/busybox/files/busybox-httpd
new file mode 100755
index 0000000..c8348e5
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-httpd
@@ -0,0 +1,44 @@
+#!/bin/sh
+DAEMON=/usr/sbin/httpd
+NAME=httpd
+DESC="Busybox HTTP Daemon"
+HTTPROOT="/srv/www"
+ARGS="-h $HTTPROOT"
+
+test -f $DAEMON || exit 0
+
+set -e
+
+case "$1" in
+    start)
+        echo -n "starting $DESC: $NAME... "
+	if [ ! -d $HTTPROOT ]; then
+		echo "$HTTPROOT is missing."
+		exit 1
+	fi
+	start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+	echo "done."
+	;;
+    stop)
+        echo -n "stopping $DESC: $NAME... "
+	start-stop-daemon -K -n $NAME
+	echo "done."
+	;;
+    restart)
+        echo "restarting $DESC: $NAME... "
+ 	$0 stop
+	$0 start
+	echo "done."
+	;;
+    reload)
+    	echo -n "reloading $DESC: $NAME... "
+    	killall -HUP $(basename ${DAEMON})
+	echo "done."
+	;;
+    *)
+	echo "Usage: $0 {start|stop|restart|reload}"
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/busybox/files/busybox-klogd.service.in b/meta/recipes-core/busybox/files/busybox-klogd.service.in
new file mode 100644
index 0000000..d7c7755
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-klogd.service.in
@@ -0,0 +1,8 @@
+[Unit]
+Description=Kernel Logging Service
+
+[Service]
+ExecStart=@base_sbindir@/klogd -n
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-core/busybox/files/busybox-syslog.default b/meta/recipes-core/busybox/files/busybox-syslog.default
new file mode 100644
index 0000000..e516caf
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-syslog.default
@@ -0,0 +1,25 @@
+OPTIONS="-C"
+# The above option means syslogd will log to 16K shm circular buffer.
+# You could use `logread' to read it.
+
+# All available options are:
+# -O FILE       :      Log to FILE (default:/var/log/messages)
+# -l N          :      Log only messages more urgent than prio N (1-8)
+# -S            :      Smaller output
+# -s SIZE       :      Max size (KB) before rotation (default:200KB, 0=off)
+# -b N          :      N rotated logs to keep (default:1, max=99, 0=purge)
+# -R HOST[:PORT]:      Log to HOST:PORT (default PORT:514)
+# -L            :      Log locally and via network
+# -D            :      Drop duplicates
+# -C[size_kb]   :      Log to shared mem buffer (use logread to read it)
+# -f FILE       :      Use FILE as config (default:/etc/syslog.conf)
+# -m MIN        :      Minutes between mark lines (default:20, 0=off)
+# -K            :      Log to kernel printk buffer (use dmesg to read it)
+
+# Example 1:
+# Log to local file /var/log/mylog
+# OPTIONS="-O /var/log/mylog"
+#
+# Example 2:
+# Log to remote host
+# OPTIONS="-R 192.168.1.1:601"
diff --git a/meta/recipes-core/busybox/files/busybox-syslog.service.in b/meta/recipes-core/busybox/files/busybox-syslog.service.in
new file mode 100644
index 0000000..2e04321
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-syslog.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=System Logging Service
+Wants=busybox-klogd.service
+
+[Service]
+EnvironmentFile=-/etc/default/busybox-syslog
+ExecStart=@base_sbindir@/syslogd -n $OPTIONS
+Sockets=syslog.socket
+
+[Install]
+WantedBy=multi-user.target
+Also=busybox-klogd.service
+Alias=syslog.service
diff --git a/meta/recipes-core/busybox/files/busybox-udhcpd b/meta/recipes-core/busybox/files/busybox-udhcpd
new file mode 100755
index 0000000..c43903e
--- /dev/null
+++ b/meta/recipes-core/busybox/files/busybox-udhcpd
@@ -0,0 +1,43 @@
+#!/bin/sh
+DAEMON=/usr/sbin/udhcpd
+NAME=udhcpd
+DESC="Busybox UDHCP Server"
+ARGS="/etc/udhcpd.conf"
+
+test -f $DAEMON || exit 1
+
+set -e
+
+case "$1" in
+    start)
+        echo -n "starting $DESC: $NAME... "
+	if [ ! -f /etc/udhcpd.conf ]; then
+		echo "error: /etc/udhcpd.conf is missing."
+		exit 1
+	fi
+	/sbin/start-stop-daemon -S -b -n $NAME -a $DAEMON -- $ARGS
+	echo "done."
+	;;
+    stop)
+        echo -n "stopping $DESC: $NAME... "
+	/sbin/start-stop-daemon -K -n $NAME
+	echo "done."
+	;;
+    restart)
+        echo "restarting $DESC: $NAME... "
+ 	$0 stop
+	$0 start
+	echo "done."
+	;;
+    reload)
+    	echo -n "reloading $DESC: $NAME... "
+    	killall -HUP $(basename ${DAEMON})
+	echo "done."
+	;;
+    *)
+	echo "Usage: $0 {start|stop|restart|reload}"
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/busybox/files/default.script b/meta/recipes-core/busybox/files/default.script
new file mode 100644
index 0000000..f2ac987
--- /dev/null
+++ b/meta/recipes-core/busybox/files/default.script
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+exec run-parts -a "$1" /etc/udhcpc.d
+
diff --git a/meta/recipes-core/busybox/files/find-touchscreen.sh b/meta/recipes-core/busybox/files/find-touchscreen.sh
new file mode 100644
index 0000000..52c5e7a
--- /dev/null
+++ b/meta/recipes-core/busybox/files/find-touchscreen.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if grep -q "input:.*-e0.*,3,.*a0,1,\|ads7846" /sys/class/$MDEV/device/modalias ; then
+	ln -sf /dev/$MDEV /dev/input/touchscreen0
+fi
+
diff --git a/meta/recipes-core/busybox/files/hwclock.sh b/meta/recipes-core/busybox/files/hwclock.sh
new file mode 100644
index 0000000..be5f94d
--- /dev/null
+++ b/meta/recipes-core/busybox/files/hwclock.sh
@@ -0,0 +1,83 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          hwclock
+# Required-Start:    
+# Required-Stop:     $local_fs
+# Default-Start:     S
+# Default-Stop:      0 6
+# Short-Description: Set system clock
+# Description:       Set system clock to hardware clock, according to the UTC
+#                    setting in /etc/default/rcS (see also rcS(5)).
+### END INIT INFO
+#
+# WARNING:      If your hardware clock is not in UTC/GMT, this script
+#               must know the local time zone. This information is
+#               stored in /etc/localtime. This might be a problem if
+#               your /etc/localtime is a symlink to something in
+#               /usr/share/zoneinfo AND /usr isn't in the root
+#               partition! The workaround is to define TZ either
+#               in /etc/default/rcS, or in the proper place below.
+
+[ ! -x /sbin/hwclock ] && exit 0
+
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+[ "$UTC" = "yes" ] && tz="--utc" || tz="--localtime"
+case "$1" in
+        start)
+                if [ "$VERBOSE" != no ]
+                then
+                        echo "System time was `date`."
+                        echo "Setting the System Clock using the Hardware Clock as reference..."
+                fi
+
+		if [ "$HWCLOCKACCESS" != no ]
+		then
+			if [ -z "$TZ" ]
+			then
+	                   hwclock $tz --hctosys
+			else
+			   TZ="$TZ" hwclock $tz --hctosys
+			fi
+		fi
+
+                if [ "$VERBOSE" != no ]
+                then
+                        echo "System Clock set. System local time is now `date`."
+                fi
+                ;;
+        stop|restart|reload|force-reload)
+		#
+		# Updates the Hardware Clock with the System Clock time.
+		# This will *override* any changes made to the Hardware Clock.
+		#
+		# WARNING: If you disable this, any changes to the system
+		#          clock will not be carried across reboots.
+		#
+		if [ "$VERBOSE" != no ]
+		then
+			echo "Saving the System Clock time to the Hardware Clock..."
+		fi
+		if [ "$HWCLOCKACCESS" != no ]
+		then
+			hwclock $tz --systohc
+		fi
+		if [ "$VERBOSE" != no ]
+		then
+			echo "Hardware Clock updated to `date`."
+		fi
+                exit 0
+                ;;
+	show)
+		if [ "$HWCLOCKACCESS" != no ]
+		then
+			hwclock $tz --show
+		fi
+		;;
+        *)
+                echo "Usage: hwclock.sh {start|stop|show|reload|restart}" >&2
+		echo "       start sets kernel (system) clock from hardware (RTC) clock" >&2
+		echo "       stop and reload set hardware (RTC) clock from kernel (system) clock" >&2
+                exit 1
+                ;;
+esac
diff --git a/meta/recipes-core/busybox/files/inetd b/meta/recipes-core/busybox/files/inetd
new file mode 100644
index 0000000..cf50bcd
--- /dev/null
+++ b/meta/recipes-core/busybox/files/inetd
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# start/stop inetd super server.
+
+if ! [ -x /usr/sbin/inetd ]; then
+	exit 0
+fi
+
+case "$1" in
+    start)
+	echo -n "Starting internet superserver:"
+	echo -n " inetd" ; start-stop-daemon -S -x /usr/sbin/inetd > /dev/null
+	echo "."
+	;;
+    stop)
+	echo -n "Stopping internet superserver:"
+	echo -n " inetd" ; start-stop-daemon -K -x /usr/sbin/inetd > /dev/null
+	echo "."
+	;;
+    restart)
+	echo -n "Restarting internet superserver:"
+	echo -n " inetd "
+	killall -HUP inetd
+	echo "."
+	;;
+    *)
+	echo "Usage: /etc/init.d/inetd {start|stop|restart}"
+	exit 1
+	;;
+esac
+
+exit 0
+
diff --git a/meta/recipes-core/busybox/files/inetd.conf b/meta/recipes-core/busybox/files/inetd.conf
new file mode 100644
index 0000000..b02fe85
--- /dev/null
+++ b/meta/recipes-core/busybox/files/inetd.conf
@@ -0,0 +1,20 @@
+# /etc/inetd.conf:  see inetd(8) for further informations.
+#
+# Internet server configuration database
+#
+# If you want to disable an entry so it isn't touched during
+# package updates just comment it out with a single '#' character.
+#
+# <service_name> <sock_type> <proto> <flags> <user> <server_path> <args>
+#
+#:INTERNAL: Internal services
+#echo		stream	tcp	nowait	root	internal
+#echo		dgram	udp	wait	root	internal
+#chargen	stream	tcp	nowait	root	internal
+#chargen	dgram	udp	wait	root	internal
+#discard		stream	tcp	nowait	root	internal
+#discard		dgram	udp	wait	root	internal
+#daytime		stream	tcp	nowait	root	internal
+#daytime	dgram	udp	wait	root	internal
+#time		stream	tcp	nowait	root	internal
+#time		dgram	udp	wait	root	internal
diff --git a/meta/recipes-core/busybox/files/mdev b/meta/recipes-core/busybox/files/mdev
new file mode 100755
index 0000000..9625247
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mdev
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+mount -t tmpfs tmpfs /dev  -o size=64k,mode=0755
+mkdir /dev/pts /dev/shm
+chmod 777 /dev/shm
+mount -t devpts devpts /dev/pts
+touch /dev/mdev.seq
+echo "/sbin/mdev" > /proc/sys/kernel/hotplug
+mdev -s
+
+#
+# We might have mounted something over /dev, see if /dev/initctl is there.
+#
+if test ! -p /dev/initctl
+then
+        rm -f /dev/initctl
+        mknod -m 600 /dev/initctl p
+fi
+
diff --git a/meta/recipes-core/busybox/files/mdev-mount.sh b/meta/recipes-core/busybox/files/mdev-mount.sh
new file mode 100644
index 0000000..d5d66d6
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mdev-mount.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+MDEV_AUTOMOUNT=y
+MDEV_AUTOMOUNT_ROOT=/run/media
+[ -f /etc/default/mdev ] && . /etc/default/mdev
+if [ "${MDEV_AUTOMOUNT}" = "n" ] ; then
+	exit 0
+fi
+
+case "$ACTION" in
+	add|"")
+		ACTION="add"
+		# check if already mounted
+		if grep -q "^/dev/${MDEV} " /proc/mounts ; then
+			# Already mounted
+			exit 0
+		fi
+		DEVBASE=`expr substr $MDEV 1 3`
+		if [ "${DEVBASE}" == "mmc" ] ; then
+			DEVBASE=`expr substr $MDEV 1 7`
+		fi
+		# check for "please don't mount it" file
+		if [ -f "/dev/nomount.${DEVBASE}" ] ; then
+			# blocked
+			exit 0
+		fi
+		# check for full-disk partition
+		if [ "${DEVBASE}" == "${MDEV}" ] ; then
+			if [ -d /sys/block/${DEVBASE}/${DEVBASE}*1 ] ; then
+				# Partition detected, just quit
+				exit 0
+			fi
+			if [ ! -f /sys/block/${DEVBASE}/size ] ; then
+				# No size at all
+				exit 0
+			fi
+			if [ `cat /sys/block/${DEVBASE}/size` == 0 ] ; then
+				# empty device, bail out
+				exit 0
+			fi
+		fi
+		# first allow fstab to determine the mountpoint
+		if ! mount /dev/$MDEV > /dev/null 2>&1
+		then
+			MOUNTPOINT="${MDEV_AUTOMOUNT_ROOT}/$MDEV"
+			mkdir "$MOUNTPOINT"
+			mount -t auto /dev/$MDEV "$MOUNTPOINT"
+		fi
+		;;
+	remove)
+		MOUNTPOINT=`grep "^/dev/$MDEV\s" /proc/mounts | cut -d' ' -f 2`
+		if [ ! -z "$MOUNTPOINT" ]
+		then
+			umount "$MOUNTPOINT"
+			rmdir "$MOUNTPOINT"
+		else
+			umount /dev/$MDEV
+		fi
+		;;
+	*)
+		# Unexpected keyword
+		exit 1
+		;;
+esac
diff --git a/meta/recipes-core/busybox/files/mdev.conf b/meta/recipes-core/busybox/files/mdev.conf
new file mode 100644
index 0000000..17e93da
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mdev.conf
@@ -0,0 +1,42 @@
+$MODALIAS=.* 0:0 660 @modprobe "$MODALIAS"
+
+console 0:0 0600 
+cpu_dma_latency 0:0 0660 
+fb0:0 44 0660 
+full 0:0 0666 
+initctl 0:0 0600 
+ircomm[0-9].* 0:20 0660 
+kmem 0:15 0640 
+kmsg 0:0 0660 
+log 0:0 0666 
+loop[0-9].* 0:6 0640 
+mem 0:15 0640 
+network_latency 0:0 0660 
+network_throughput 0:0 0660 
+null 0:0 0666 
+port 0:15 0640 
+ptmx 0:5 0666 
+ram[0-9].* 0:6 0640 
+random 0:0 0666 
+sda 0:6 0640 
+tty 0:5 0666 
+tty.* 0:0 0620 
+urandom 0:0 0666 
+usbdev.* 0:0 0660 */etc/mdev/usb.sh
+vcs.* 0:5 0660 
+zero 0:0 0666 
+ 
+snd/pcm.* 0:0 0660
+snd/control.* 0:0 0660
+snd/timer 0:0 0660
+snd/seq 0:0 0660
+snd/mini.* 0:00 0660
+
+input/event.* 0:0 0660 @/etc/mdev/find-touchscreen.sh
+input/mice 0:0 0660
+input/mouse.* 0:0 0660
+
+tun[0-9]* 0:0 0660 =net/
+
+[hs]d[a-z][0-9]? 0:0 660 */etc/mdev/mdev-mount.sh
+mmcblk[0-9].* 0:0 660 */etc/mdev/mdev-mount.sh
diff --git a/meta/recipes-core/busybox/files/mount.busybox b/meta/recipes-core/busybox/files/mount.busybox
new file mode 100755
index 0000000..fef945b
--- /dev/null
+++ b/meta/recipes-core/busybox/files/mount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox mount $@
diff --git a/meta/recipes-core/busybox/files/run-ptest b/meta/recipes-core/busybox/files/run-ptest
new file mode 100644
index 0000000..3608a8e
--- /dev/null
+++ b/meta/recipes-core/busybox/files/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+current_dir=$(readlink -f $0)
+export bindir=$(dirname $current_dir)
+
+cd testsuite || exit 1
+./runtest -v | sed -r 's/^(SKIPPED|UNTESTED):/SKIP:/'
diff --git a/meta/recipes-core/busybox/files/simple.script b/meta/recipes-core/busybox/files/simple.script
new file mode 100644
index 0000000..22168b0
--- /dev/null
+++ b/meta/recipes-core/busybox/files/simple.script
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+# udhcpc script edited by Tim Riker <Tim@Rikers.org>
+
+[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1
+
+RESOLV_CONF="/etc/resolv.conf"
+[ -n "$subnet" ] && NETMASK="netmask $subnet"
+
+# return 0 if root is mounted on a network filesystem
+root_is_nfs() {
+	sed -n 's/^[^ ]* \([^ ]*\) \([^ ]*\) .*$/\1 \2/p' /proc/mounts |
+	grep -q "^/ \(nfs\|smbfs\|ncp\|coda\)$"
+}
+
+have_bin_ip=0
+if [ -x /sbin/ip ]; then
+  have_bin_ip=1
+  BROADCAST="broadcast +"
+fi
+
+[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
+
+case "$1" in
+	deconfig)
+		if [ -x /sbin/resolvconf ]; then
+			/sbin/resolvconf -d "${interface}.udhcpc"
+		fi
+		if ! root_is_nfs ; then
+                        if [ $have_bin_ip -eq 1 ]; then
+                                ip addr flush dev $interface
+                                ip link set dev $interface up
+                        else
+                                /sbin/ifconfig $interface 0.0.0.0
+                        fi
+		fi
+		;;
+
+	renew|bound)
+                if [ $have_bin_ip -eq 1 ]; then
+                        ip addr add dev $interface local $ip/$mask $BROADCAST
+                else
+                        /sbin/ifconfig $interface $ip $BROADCAST $NETMASK
+                fi
+
+		if [ -n "$router" ] ; then
+			if ! root_is_nfs ; then
+                                if [ $have_bin_ip -eq 1 ]; then
+                                        while ip route del default dev $interface 2>/dev/null ; do
+                                                :
+                                        done
+                                else
+                                        while route del default gw 0.0.0.0 dev $interface 2>/dev/null ; do
+                                                :
+                                        done
+                                fi
+			fi
+
+			metric=10
+			for i in $router ; do
+                                if [ $have_bin_ip -eq 1 ]; then
+                                        ip route add default via $i metric $metric
+                                else
+                                        route add default gw $i dev $interface metric $metric 2>/dev/null
+                                fi
+                                metric=$(($metric + 1))
+			done
+		fi
+
+		# Update resolver configuration file
+		R=""
+		[ -n "$domain" ] && R="domain $domain
+"
+		for i in $dns; do
+			echo "$0: Adding DNS $i"
+			R="${R}nameserver $i
+"
+		done
+
+		if [ -x /sbin/resolvconf ]; then
+			echo -n "$R" | /sbin/resolvconf -a "${interface}.udhcpc"
+		else
+			echo -n "$R" > "$RESOLV_CONF"
+		fi
+		;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/busybox/files/syslog b/meta/recipes-core/busybox/files/syslog
new file mode 100644
index 0000000..89c4d12
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog
@@ -0,0 +1,77 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:             sysklogd
+# Required-Start:       $remote_fs $time
+# Required-Stop:        $remote_fs $time
+# Default-Start:        2 3 4 5
+# Default-Stop:         0 1 6
+# Short-Description:    System logger
+### END INIT INFO
+
+set -e
+
+if [ -f /etc/syslog-startup.conf ]; then
+	. /etc/syslog-startup.conf
+	LOG_LOCAL=0
+	LOG_REMOTE=0
+	for D in $DESTINATION; do
+		if [ "$D" = "buffer" ]; then
+			SYSLOG_ARGS="$SYSLOG_ARGS -C$BUFFERSIZE"
+			LOG_LOCAL=1
+		elif [ "$D" = "file" ]; then
+			if [ -n "$LOGFILE" ]; then
+				SYSLOG_ARGS="$SYSLOG_ARGS -O $LOGFILE"
+			fi
+			if [ -n "$ROTATESIZE" ]; then
+				SYSLOG_ARGS="$SYSLOG_ARGS -s $ROTATESIZE"
+			fi
+			if [ -n "$ROTATEGENS" ]; then
+				SYSLOG_ARGS="$SYSLOG_ARGS -b $ROTATEGENS"
+			fi
+			LOG_LOCAL=1
+		elif [ "$D" = "remote" ]; then
+			SYSLOG_ARGS="$SYSLOG_ARGS -R $REMOTE"
+			LOG_REMOTE=1
+		fi
+	done
+	if [ "$LOG_LOCAL" = "1" -a "$LOG_REMOTE" = "1" ]; then
+		SYSLOG_ARGS="$SYSLOG_ARGS -L"
+	fi
+	if [ "$REDUCE" = "yes" ]; then
+		SYSLOG_ARGS="$SYSLOG_ARGS -S"
+	fi
+	if [ "$DROPDUPLICATES" = "yes" ]; then
+	    SYSLOG_ARGS="$SYSLOG_ARGS -D"
+	fi
+	if [ -n "$LOGLEVEL" ]; then
+	    SYSLOG_ARGS="$SYSLOG_ARGS -l $LOGLEVEL"
+	fi
+else
+	# default: log to 16K shm circular buffer
+	SYSLOG_ARGS="-C"
+fi
+
+case "$1" in
+  start)
+	echo -n "Starting syslogd/klogd: "
+	start-stop-daemon -S -b -n syslogd -a /sbin/syslogd -- -n $SYSLOG_ARGS
+	start-stop-daemon -S -b -n klogd -a /sbin/klogd -- -n
+	echo "done"
+	;;
+  stop)
+	echo -n "Stopping syslogd/klogd: "
+	start-stop-daemon -K -n syslogd
+	start-stop-daemon -K -n klogd
+	echo "done"
+	;;
+  restart)
+  	$0 stop
+	$0 start
+	;;
+  *)
+	echo "Usage: syslog { start | stop | restart }" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/busybox/files/syslog-startup.conf b/meta/recipes-core/busybox/files/syslog-startup.conf
new file mode 100644
index 0000000..fda450a
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog-startup.conf
@@ -0,0 +1,13 @@
+# This configuration file is used by the busybox syslog init script,
+# /etc/init.d/syslog[.busybox] to set syslog configuration at start time.
+
+DESTINATION=file		# log destinations (buffer file remote)
+LOGFILE=/var/log/messages	# where to log (file)
+REMOTE=loghost:514		# where to log (syslog remote)
+REDUCE=no			# reduce-size logging
+DROPDUPLICATES=no		# whether to drop duplicate log entries
+#ROTATESIZE=0			# rotate log if grown beyond X [kByte]
+#ROTATEGENS=3			# keep X generations of rotated logs
+BUFFERSIZE=64			# size of circular buffer [kByte]
+FOREGROUND=no			# run in foreground (don't use!)
+#LOGLEVEL=5			# local log level (between 1 and 8)
diff --git a/meta/recipes-core/busybox/files/syslog.conf b/meta/recipes-core/busybox/files/syslog.conf
new file mode 100644
index 0000000..75bb630
--- /dev/null
+++ b/meta/recipes-core/busybox/files/syslog.conf
@@ -0,0 +1 @@
+#  /etc/syslog.conf	Configuration file for busybox's syslogd utility
diff --git a/meta/recipes-core/busybox/files/umount.busybox b/meta/recipes-core/busybox/files/umount.busybox
new file mode 100755
index 0000000..f373162
--- /dev/null
+++ b/meta/recipes-core/busybox/files/umount.busybox
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec /bin/busybox umount $@
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars b/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars
new file mode 100644
index 0000000..32692ab
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/Makevars
@@ -0,0 +1,41 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS =
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch
new file mode 100644
index 0000000..c287014
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/codepage.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- console-tools-0.3.2/contrib/codepage.c~codepage
++++ console-tools-0.3.2/contrib/codepage.c
+@@ -229,7 +229,7 @@
+ 	  return 0;
+ 
+         fprintf(stderr, "\
+-Warning: CP format is a hack!\n
++Warning: CP format is a hack!\n\
+          The files produced may or may not be usable!\n");
+ 
+ 	sprintf(outfile, "%d.cp", CPEntryHeader.codepage);
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch
new file mode 100644
index 0000000..c93f511
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/compile.patch
@@ -0,0 +1,12 @@
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/kbdtools/showkey.c~compile	1999-08-25 17:20:08.000000000 -0400
++++ console-tools-0.3.2/kbdtools/showkey.c	2004-05-09 03:03:23.000000000 -0400
+@@ -264,7 +264,6 @@
+ 	  break;
+ 	case cmd_keymap:
+ 	  printf(")\n");
+-	default:
+ 	}
+     }
+ 
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch
new file mode 100644
index 0000000..15c100c
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/configure.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/configure.in~configure
++++ console-tools-0.3.2/configure.in
+@@ -2,13 +2,14 @@
+ dnl Process this file with autoconf to produce a configure script.
+ 
+ # Initialize
+-AC_INIT(kbdtools/loadkeys.y)
++AC_INIT
++AC_CONFIG_SRCDIR([kbdtools/loadkeys.y])
+ 
+ define(ct_unicodedata_default,/usr/share/unidata/UnicodeData-2.txt)
+ ct_localdatadir_default=/usr/local/share     # iff --enable-localdatadir without specific dir
+ 
+ #AC_CONFIG_AUX_DIR(autoconf)
+-AC_CANONICAL_SYSTEM
++AC_CANONICAL_TARGET([])
+ AM_INIT_AUTOMAKE(console-tools, 0.3.2)
+ 
+ # Defaults
+@@ -25,7 +26,6 @@
+ # i18n stuff
+ ALL_LINGUAS="cs de ru ga fr"
+ AM_GNU_GETTEXT
+-AC_OUTPUT_COMMANDS([sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
+ 
+ AC_DEFINE_UNQUOTED(LOCALEDIR, "/usr/share/locale")
+ 
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch
new file mode 100644
index 0000000..be61eb8
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/fix-libconsole-linking.patch
@@ -0,0 +1,56 @@
+Fix the following error detected with i586-pokymllib32-linux-gcc (the
+multilib x86-64 lib32 compiler):
+    ../lib/ctutils/.libs/libctutils.so: undefined reference to `get_kernel_sfm'
+    collect2: error: ld returned 1 exit status
+
+It seems that libctutils.so (the library that uses get_kernel_sfm) must
+be stated before libconsole.so (the library that exports the function) when
+using multilib gcc
+
+Upstream-Status: Pending
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: console-tools-0.3.2/fontfiletools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/fontfiletools/Makefile.am
++++ console-tools-0.3.2/fontfiletools/Makefile.am
+@@ -10,5 +10,5 @@ EXTRA_DIST = fonts2virfont.c virfont.h
+ 
+ # libconsole is needed by ctutils
+ LDADD = ../lib/ctlocal/libctlocal.a ../lib/cfont/libcfont.la \
+-	../lib/console/libconsole.la \
+-	../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
++	../lib/ctutils/libctutils.la \
++	../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+Index: console-tools-0.3.2/vttools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/vttools/Makefile.am
++++ console-tools-0.3.2/vttools/Makefile.am
+@@ -7,9 +7,9 @@ bin_PROGRAMS = chvt deallocvt writevt fg
+ 	vcstime vt-is-UTF8 openvt @RESIZECONS@
+ EXTRA_PROGRAMS = resizecons
+ 
+-LDADD = ../lib/ctlocal/libctlocal.a ../lib/console/libconsole.la \
++LDADD = ../lib/ctlocal/libctlocal.a ../lib/ctutils/libctutils.la \
+ 	../lib/cfont/libcfont.la \
+-	../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
++	../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+ 
+ vcstime_LDADD = ../lib/ctlocal/libctlocal.a
+ screendump_LDADD = ../lib/ctlocal/libctlocal.a
+Index: console-tools-0.3.2/kbdtools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/kbdtools/Makefile.am
++++ console-tools-0.3.2/kbdtools/Makefile.am
+@@ -15,9 +15,9 @@ EXTRA_PROGRAMS = getkeycodes setkeycodes
+ loadkeys_SOURCES = loadkeys.y analyze.l
+ 
+ YFLAGS = -d
+-LDADD = ../lib/ctlocal/libctlocal.a ../lib/console/libconsole.la \
++LDADD = ../lib/ctlocal/libctlocal.a ../lib/ctutils/libctutils.la \
+ 	../lib/cfont/libcfont.la \
+-	../lib/ctutils/libctutils.la ../lib/generic/libctgeneric.la
++	../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+ 
+ loadkeys_LDADD = $(LDADD) @LEXLIB@
+ 
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch
new file mode 100644
index 0000000..f370be8
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/kbdrate.patch
@@ -0,0 +1,75 @@
+Patch from Matthias Goebl <oe@m.goebl.net>
+Added via OE bugtracker: bug #478
+
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/kbdtools/kbd_mode.c.orig
++++ console-tools-0.3.2/kbdtools/kbd_mode.c
+@@ -29,11 +29,16 @@
+   OPT("-u --unicode  ", _("UTF-8 mode (UNICODE)"));
+   OPT("-s --scancode ", _("scancode mode (RAW)"));
+   OPT("   --mode={8bit,keycode,unicode,scancode} ", _("set mode"));
++  OPT("-r --rate=RATE ", _("set repeat rate (default: 33)"));
++  OPT("-d --delay=DELAY ", _("set repeat delay (default: 250)"));
+ 
+   OPT("-h --help     ", HELPDESC);
+   OPT("-V --version  ", VERSIONDESC);
+ }
+ 
++int rate=-1;
++int delay=-1;
++
+ static int parse_cmdline (int argc, char *argv[])
+ {
+     int mode = -1;
+@@ -46,11 +51,13 @@
+       { "mode"     , required_argument, NULL, 'm' },
+       { "scancode" , no_argument, NULL, 's' },
+       { "unicode"  , no_argument, NULL, 'u' },
++      { "rate"     , required_argument, NULL, 'r' },
++      { "delay"    , required_argument, NULL, 'd' },
+       { NULL, 0, NULL, 0 }
+     };
+     int c;
+ 
+-    while ( (c = getopt_long (argc, argv, "Vhaksu", long_opts, NULL)) != EOF) 
++    while ( (c = getopt_long (argc, argv, "Vhaksur:d:", long_opts, NULL)) != EOF) 
+       switch (c) {
+       case 'h':
+ 	usage ();
+@@ -58,6 +65,14 @@
+       case 'V':
+ 	version ();
+ 	exit(0);
++      case 'r':
++	rate = atoi(optarg);
++	mode = -2;
++	break;
++      case 'd':
++	delay = atoi(optarg);
++	mode = -2;
++	break;
+       case 'a':
+ 	mode = K_XLATE;
+ 	break;
+@@ -129,6 +144,20 @@
+       exit(0);
+     }
+   
++  if ( rate != -1 || delay != -1 )
++    {
++    struct kbd_repeat kbd_rep;
++    kbd_rep.delay = delay;
++    kbd_rep.period = rate;
++    if (ioctl(fd, KDKBDREP, &kbd_rep))
++      {
++	fprintf(stderr, progname);
++	perror(_(": error setting keyboard repeat mode\n"));
++	exit(1);
++      }
++    if(mode==-2) exit(0);
++    }
++  
+   if (ioctl(fd, KDSKBMODE, mode))
+     {
+       fprintf(stderr, progname);
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4 b/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4
new file mode 100644
index 0000000..18d47a9
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/lcmessage.m4
@@ -0,0 +1,24 @@
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file can be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU General Public
+# License or the GNU Library General Public License but which still want
+# to provide support for the GNU gettext functionality.
+# Please note that the actual code of the GNU gettext library is covered
+# by the GNU Library General Public License, and the rest of the GNU
+# gettext package package is covered by the GNU General Public License.
+# They are *not* in the public domain.
+
+# serial 2
+
+AC_DEFUN([AM_LC_MESSAGES],
+  [if test $ac_cv_header_locale_h = yes; then
+    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+    if test $am_cv_val_LC_MESSAGES = yes; then
+      AC_DEFINE(HAVE_LC_MESSAGES, 1,
+        [Define if your <locale.h> file defines LC_MESSAGES.])
+    fi
+  fi])
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch
new file mode 100644
index 0000000..a6735a5
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/no-dep-on-libfl.patch
@@ -0,0 +1,19 @@
+No reason to link with libfl since 'loadkeys' implements
+its own yywrap()/yylex() functions.
+
+Upstream-Status: Pending
+Signed-off-by: Jacob Kroon <jacob.kroon@mikrodidakt.se>
+
+Index: console-tools-0.3.2/kbdtools/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/kbdtools/Makefile.am
++++ console-tools-0.3.2/kbdtools/Makefile.am
+@@ -19,8 +19,6 @@ LDADD = ../lib/ctlocal/libctlocal.a ../l
+ 	../lib/cfont/libcfont.la \
+ 	../lib/console/libconsole.la ../lib/generic/libctgeneric.la
+ 
+-loadkeys_LDADD = $(LDADD) @LEXLIB@
+-
+ bin_SCRIPTS = mk_modmap
+ 
+ noinst_HEADERS = loadkeys.h
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch
new file mode 100644
index 0000000..2ed6092
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/nodocs.patch
@@ -0,0 +1,22 @@
+The docs need tools we don't have to build so disable them.
+
+Also remove intl since the Makefile doesn't work with 3.82 and we
+don't want to build libintl anyway.
+
+Upstream-Status: Inappropriate [configuration]
+RP 2012/10/17
+
+Index: console-tools-0.3.2/Makefile.am
+===================================================================
+--- console-tools-0.3.2.orig/Makefile.am	1999-04-15 01:33:24.000000000 +0000
++++ console-tools-0.3.2/Makefile.am	2012-10-17 11:48:14.107069145 +0000
+@@ -1,7 +1,7 @@
+ # -*- makefile -*-
+ AUTOMAKE_OPTIONS = foreign
+ 
+-SUBDIRS = lib fontfiletools vttools kbdtools screenfonttools contrib doc \
+-	compat include examples po intl
++SUBDIRS = lib fontfiletools vttools kbdtools screenfonttools contrib \
++	compat include examples po
+ 
+ EXTRA_DIST = BUGS RELEASE CREDITS COPYING.kbd local-scripts/* debian/* *.lsm
diff --git a/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch b/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch
new file mode 100644
index 0000000..0c95068
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools-0.3.2/uclibc-fileno.patch
@@ -0,0 +1,49 @@
+Fixing the locale issues isn't enough, console-tools also does a couple of
+other pretty stupid things (like FILE *f; f->_fileno instead of fileno(f)),
+
+Upstream-Status: Pending
+
+--- console-tools-0.3.2/lib/cfont/fontstruct.c.ark	2005-05-22 19:12:38.000000000 +0000
++++ console-tools-0.3.2/lib/cfont/fontstruct.c	2005-05-22 19:13:23.000000000 +0000
+@@ -50,8 +50,7 @@
+    * get filesize
+    */
+   
+-  /* FIXME: should not use _fileno ! */
+-  if (fstat(fontfile->_fileno, &stbuf) == -1)
++  if (fstat(fileno(fontfile), &stbuf) == -1)
+     goto rsf_return_error;
+   
+   if (S_ISREG(stbuf.st_mode))
+@@ -211,8 +210,7 @@
+    * get filesize
+    */
+   
+-  /* FIXME: should not use _fileno ! */
+-  if (fstat(fontfile->_fileno, &stbuf) == -1)
++  if (fstat(fileno(fontfile), &stbuf) == -1)
+     goto rfg_return_error;
+   
+   if (S_ISREG(stbuf.st_mode))
+--- console-tools-0.3.2/lib/console/acm.c.ark	2005-05-22 19:17:15.000000000 +0000
++++ console-tools-0.3.2/lib/console/acm.c	2005-05-22 19:17:23.000000000 +0000
+@@ -30,7 +30,7 @@
+   lct_boolean parse_failed = False;
+   lct_boolean is_unicode;
+ 
+-  if (fstat(fp->_fileno, &stbuf)) 
++  if (fstat(fileno(fp), &stbuf)) 
+     perror(_("Cannot stat ACM file")), exit(1);
+ 
+   /* first try a wg15-charmap (glibc) file format */
+--- console-tools-0.3.2/include/lct/local.h.ark	2005-05-22 19:08:54.000000000 +0000
++++ console-tools-0.3.2/include/lct/local.h	2005-05-22 19:09:12.000000000 +0000
+@@ -8,7 +8,7 @@
+ #include <locale.h>
+ 
+ 
+-#ifdef HAVE_LOCALE_H
++#if defined(HAVE_LOCALE_H) && defined(HAVE_LIBINTL_H)
+ # include <libintl.h>
+ # define _(String) gettext (String)
+ # ifdef gettext_noop
diff --git a/meta/recipes-core/console-tools/console-tools_0.3.2.bb b/meta/recipes-core/console-tools/console-tools_0.3.2.bb
new file mode 100644
index 0000000..c60a5a0
--- /dev/null
+++ b/meta/recipes-core/console-tools/console-tools_0.3.2.bb
@@ -0,0 +1,37 @@
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING.kbd;md5=9b2d91511d3d80d4d20ac6e6b0137fe9"
+SUMMARY = "Allows you to set-up and manipulate the Linux console"
+DESCRIPTION = "Provides tools that enable the set-up and manipulation of the linux console and console-font files."
+PR = "r8"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lct/console-tools-${PV}.tar.gz \
+           file://codepage.patch \
+           file://configure.patch \
+           file://compile.patch \
+           file://kbdrate.patch \
+           file://uclibc-fileno.patch \
+           file://nodocs.patch \
+           file://fix-libconsole-linking.patch \
+           file://no-dep-on-libfl.patch \
+           file://lcmessage.m4 \
+           file://Makevars"
+
+SRC_URI[md5sum] = "bf21564fc38b3af853ef724babddbacd"
+SRC_URI[sha256sum] = "eea6b441672dacd251079fc85ed322e196282e0e66c16303ec64c3a2b1c126c2"
+
+do_configure_prepend () {
+	mkdir -p ${S}/m4
+	cp ${WORKDIR}/lcmessage.m4 ${S}/m4/
+	rm -f ${S}/acinclude.m4
+	cp ${WORKDIR}/Makevars ${S}/po/
+}
+
+inherit autotools gettext update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+bindir_progs = "chvt deallocvt fgconsole openvt"
+ALTERNATIVE_${PN} = "${bindir_progs}"
+
+RDEPENDS_${PN} = "bash"
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch
new file mode 100644
index 0000000..5452b46
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-6.9-cp-i-u.patch
@@ -0,0 +1,120 @@
+Upstream-Status: Inappropriate [legacy version]
+
+This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
+
+The package is stated as being Licensed as GPLv2+.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+----
+
+When "cp -i --update old new" would do nothing because "new" is
+newer than "old", cp would nonetheless prompt for whether it is
+ok to overwrite "new".  Then, regardless of the response (because
+of the --update option), cp would do nothing.
+
+The following patch eliminates the unnecessary prompt in that case.
+
+diff --git a/src/copy.c b/src/copy.c
+index b7bf73b..0e549d2 100644
+--- a/src/copy.c
++++ b/src/copy.c
+@@ -1210,6 +1210,30 @@ copy_internal (char const *src_name, char const *dst_name,
+ 	      return false;
+ 	    }
+
++	  if (!S_ISDIR (src_mode) && x->update)
++	    {
++	      /* When preserving time stamps (but not moving within a file
++		 system), don't worry if the destination time stamp is
++		 less than the source merely because of time stamp
++		 truncation.  */
++	      int options = ((x->preserve_timestamps
++			      && ! (x->move_mode
++				    && dst_sb.st_dev == src_sb.st_dev))
++			     ? UTIMECMP_TRUNCATE_SOURCE
++			     : 0);
++
++	      if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
++		{
++		  /* We're using --update and the destination is not older
++		     than the source, so do not copy or move.  Pretend the
++		     rename succeeded, so the caller (if it's mv) doesn't
++		     end up removing the source file.  */
++		  if (rename_succeeded)
++		    *rename_succeeded = true;
++		  return true;
++		}
++	    }
++
+ 	  /* When there is an existing destination file, we may end up
+ 	     returning early, and hence not copying/moving the file.
+ 	     This may be due to an interactive `negative' reply to the
+@@ -1302,30 +1326,6 @@ copy_internal (char const *src_name, char const *dst_name,
+ 		      return false;
+ 		    }
+ 		}
+-
+-	      if (x->update)
+-		{
+-		  /* When preserving time stamps (but not moving within a file
+-		     system), don't worry if the destination time stamp is
+-		     less than the source merely because of time stamp
+-		     truncation.  */
+-		  int options = ((x->preserve_timestamps
+-				  && ! (x->move_mode
+-					&& dst_sb.st_dev == src_sb.st_dev))
+-				 ? UTIMECMP_TRUNCATE_SOURCE
+-				 : 0);
+-
+-		  if (0 <= utimecmp (dst_name, &dst_sb, &src_sb, options))
+-		    {
+-		      /* We're using --update and the destination is not older
+-			 than the source, so do not copy or move.  Pretend the
+-			 rename succeeded, so the caller (if it's mv) doesn't
+-			 end up removing the source file.  */
+-		      if (rename_succeeded)
+-			*rename_succeeded = true;
+-		      return true;
+-		    }
+-		}
+ 	    }
+
+ 	  if (x->move_mode)
+diff --git a/tests/mv/update b/tests/mv/update
+index 0c06024..6c3d149 100755
+--- a/tests/mv/update
++++ b/tests/mv/update
+@@ -1,7 +1,7 @@
+ #!/bin/sh
+ # make sure --update works as advertised
+
+-# Copyright (C) 2001, 2004, 2006 Free Software Foundation, Inc.
++# Copyright (C) 2001, 2004, 2006-2007 Free Software Foundation, Inc.
+
+ # This program is free software; you can redistribute it and/or modify
+ # it under the terms of the GNU General Public License as published by
+@@ -46,11 +46,16 @@ fi
+
+ fail=0
+
+-for cp_or_mv in cp mv; do
+-  # This is a no-op.
+-  $cp_or_mv --update old new || fail=1
+-  case "`cat new`" in new) ;; *) fail=1 ;; esac
+-  case "`cat old`" in old) ;; *) fail=1 ;; esac
++for interactive in '' -i; do
++  for cp_or_mv in cp mv; do
++    # This is a no-op, with no prompt.
++    # With coreutils-6.9 and earlier, using --update with -i would
++    # mistakenly elicit a prompt.
++    $cp_or_mv $interactive --update old new < /dev/null > out 2>&1 || fail=1
++    test -s out && fail=1
++    case "`cat new`" in new) ;; *) fail=1 ;; esac
++    case "`cat old`" in old) ;; *) fail=1 ;; esac
++  done
+ done
+
+ # This will actually perform the rename.
+--
+1.5.3.rc1.16.g9d6f
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch
new file mode 100644
index 0000000..8273d78
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-build-with-acl.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Fix the following issue so that coreutils can build with ACL:
+
+configure: WARNING: libacl development library was not found or not usable.
+configure: WARNING: GNU coreutils will be built without ACL support.
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ m4/acl.m4 |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/m4/acl.m4 b/m4/acl.m4
+index d6a448a..a9d4836 100644
+--- a/m4/acl.m4
++++ b/m4/acl.m4
+@@ -159,7 +159,7 @@ AC_DEFUN([gl_ACL_GET_FILE],
+           ]])],
+        [gl_cv_func_working_acl_get_file=yes],
+        [gl_cv_func_working_acl_get_file=no],
+-       [gl_cv_func_working_acl_get_file=cross-compiling])])
++       [gl_cv_func_working_acl_get_file=yes])])
+ 
+   AS_IF([test $gl_cv_func_working_acl_get_file = yes], [$1], [$2])
+ ])
+-- 
+1.7.7
+
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
new file mode 100644
index 0000000..88f61fa
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-install.patch
@@ -0,0 +1,101 @@
+Upstream-Status: Inappropriate [legacy version]
+
+The install command doesn't over write the dangling symlink, for
+example:
+
+$ install fileA /tmp/fileA
+
+If /tmp/fileA is a dangling symlink, there would be an error:
+
+install: cannot create regular file '/tmp/fileA': File exists
+
+This is because of the following code in copy.c:
+
+  if (!new_dst)
+    {
+      if (XSTAT (x, dst_name, &dst_sb) != 0)
+        {
+          if (errno != ENOENT)
+            {
+              error (0, errno, _("cannot stat %s"), quote (dst_name));
+              return false;
+            }
+          else
+            {
+              new_dst = true;
+            }
+        }
+
+XSTAT() use stat() for dst_name(the dangling symlink /tmp/fileA) when
+install.c invokes it, and stat will set errno to ENOENT, and then
+new_dst will be set to true which means that /tmp/fileA doesn't exist,
+then we will create /tmp/fileA without remove it first, so the error
+comes.
+
+This is fixed in a way which adds the member cmd_install in
+struct cp_options to make sure my change only affected to the install
+command and use lstat to fix the problem.
+    
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+---
+ src/copy.c    |   10 +++++++++-
+ src/copy.h    |    3 +++
+ src/install.c |    1 +
+ 3 files changed, 13 insertions(+), 1 deletions(-)
+
+diff --git a/src/copy.c b/src/copy.c
+--- a/src/copy.c
++++ b/src/copy.c
+@@ -1029,6 +1029,7 @@ copy_internal (char const *src_name, char const *dst_name,
+   bool delayed_ok;
+   bool copied_as_regular = false;
+   bool preserve_metadata;
++  int dst_stat_result;
+ 
+   if (x->move_mode && rename_succeeded)
+     *rename_succeeded = false;
+@@ -1069,7 +1070,14 @@ copy_internal (char const *src_name, char const *dst_name,
+ 
+   if (!new_dst)
+     {
+-      if (XSTAT (x, dst_name, &dst_sb) != 0)
++      if ( x->cmd_install && ( x->backup_type == no_backups))
++        dst_stat_result = lstat (dst_name, &dst_sb);
++      else
++        {
++          dst_stat_result = XSTAT (x, dst_name, &dst_sb);
++        }
++
++      if (dst_stat_result != 0)
+ 	{
+ 	  if (errno != ENOENT)
+ 	    {
+diff --git a/src/copy.h b/src/copy.h
+--- a/src/copy.h
++++ b/src/copy.h
+@@ -114,6 +114,9 @@ struct cp_options
+      If that fails, then resort to copying.  */
+   bool move_mode;
+ 
++  /* For the install command */
++  bool cmd_install;
++
+   /* Whether this process has appropriate privileges to chown a file
+      whose owner is not the effective user ID.  */
+   bool chown_privileges;
+diff --git a/src/install.c b/src/install.c
+--- a/src/install.c
++++ b/src/install.c
+@@ -149,6 +149,7 @@ cp_option_init (struct cp_options *x)
+   x->hard_link = false;
+   x->interactive = I_UNSPECIFIED;
+   x->move_mode = false;
++  x->cmd_install = true;
+   x->chown_privileges = chown_privileges ();
+   x->one_file_system = false;
+   x->preserve_ownership = false;
+-- 
+1.7.0.1
+
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch
new file mode 100644
index 0000000..3ae5a2f
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-fix-texinfo.patch
@@ -0,0 +1,375 @@
+From 170be4023bbf9e9698a709e03265945588ac8e01 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 26 Nov 2013 00:21:50 +0800
+Subject: [PATCH] doc/coreutils.texi: Use '@item' instead of '@itemx'
+
+Use '@item' instead of '@itemx' in several places, as Texinfo 5 refuses
+to process an '@itemx' that is not preceded by an '@item'.  Ensure that
+node extended names in menus and sectioning are consistent, and that
+ordering and presence of nodes in menus and in the actual text are
+consistent as well.
+
+Upstream-Status: Backport [From: coreutils.7620.n7.nabble.com, bug#11828]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ doc/coreutils.texi | 82 +++++++++++++++++++++++++++---------------------------
+ 1 file changed, 41 insertions(+), 41 deletions(-)
+
+diff --git a/doc/coreutils.texi b/doc/coreutils.texi
+index 588147f..2dae3fe 100644
+--- a/doc/coreutils.texi
++++ b/doc/coreutils.texi
+@@ -555,7 +555,7 @@ symbolic link to a directory.  @xref{Target directory}.
+ @end macro
+ 
+ @macro optSi
+-@itemx --si
++@item --si
+ @opindex --si
+ @cindex SI output
+ Append an SI-style abbreviation to each size, such as @samp{M} for
+@@ -578,7 +578,7 @@ Use the @option{--si} option if you prefer powers of 1000.
+ @end macro
+ 
+ @macro optStripTrailingSlashes
+-@itemx @w{@kbd{--strip-trailing-slashes}}
++@item @w{@kbd{--strip-trailing-slashes}}
+ @opindex --strip-trailing-slashes
+ @cindex stripping trailing slashes
+ Remove any trailing slashes from each @var{source} argument.
+@@ -2496,7 +2496,7 @@ by 1048576.
+ However, if @var{n} starts with a @samp{-},
+ print all but the last @var{n} bytes of each file.
+ 
+-@itemx -n @var{n}
++@item -n @var{n}
+ @itemx --lines=@var{n}
+ @opindex -n
+ @opindex --lines
+@@ -2633,7 +2633,7 @@ This option is the same as @option{--follow=name --retry}.  That is, tail
+ will attempt to reopen a file when it is removed.  Should this fail, tail
+ will keep trying until it becomes accessible again.
+ 
+-@itemx --retry
++@item --retry
+ @opindex --retry
+ This option is useful mainly when following by name (i.e., with
+ @option{--follow=name}).
+@@ -2641,7 +2641,7 @@ Without this option, when tail encounters a file that doesn't
+ exist or is otherwise inaccessible, it reports that fact and
+ never checks it again.
+ 
+-@itemx --sleep-interval=@var{number}
++@item --sleep-interval=@var{number}
+ @opindex --sleep-interval
+ Change the number of seconds to wait between iterations (the default is 1.0).
+ During one iteration, every specified file is checked to see if it has
+@@ -2651,7 +2651,7 @@ Historical implementations of @command{tail} have required that
+ an arbitrary floating point number (using a period before any
+ fractional digits).
+ 
+-@itemx --pid=@var{pid}
++@item --pid=@var{pid}
+ @opindex --pid
+ When following by name or by descriptor, you may specify the process ID,
+ @var{pid}, of the sole writer of all @var{file} arguments.  Then, shortly
+@@ -2674,7 +2674,7 @@ terminate until long after the real writer has terminated.
+ Note that @option{--pid} cannot be supported on some systems; @command{tail}
+ will print a warning if this is the case.
+ 
+-@itemx --max-unchanged-stats=@var{n}
++@item --max-unchanged-stats=@var{n}
+ @opindex --max-unchanged-stats
+ When tailing a file by name, if there have been @var{n} (default
+ n=@value{DEFAULT_MAX_N_UNCHANGED_STATS_BETWEEN_OPENS}) consecutive
+@@ -2686,7 +2686,7 @@ number of seconds between when tail prints the last pre-rotation lines
+ and when it prints the lines that have accumulated in the new log file.
+ This option is meaningful only when following by name.
+ 
+-@itemx -n @var{n}
++@item -n @var{n}
+ @itemx --lines=@var{n}
+ @opindex -n
+ @opindex --lines
+@@ -2817,7 +2817,7 @@ option.
+ @opindex --numeric-suffixes
+ Use digits in suffixes rather than lower-case letters.
+ 
+-@itemx --verbose
++@item --verbose
+ @opindex --verbose
+ Write a diagnostic to standard error just before each output file is opened.
+ 
+@@ -3055,7 +3055,7 @@ Print only the newline counts.
+ @opindex --max-line-length
+ Print only the maximum line lengths.
+ 
+-@itemx --files0-from=@var{FILE}
++@item --files0-from=@var{FILE}
+ @opindex --files0-from=@var{FILE}
+ @cindex including files from @command{du}
+ Rather than processing files named on the command line, process those
+@@ -3250,7 +3250,7 @@ an MD5 checksum inconsistent with the associated file, or if no valid
+ line is found, @command{md5sum} exits with nonzero status.  Otherwise,
+ it exits successfully.
+ 
+-@itemx --status
++@item --status
+ @opindex --status
+ @cindex verifying MD5 checksums
+ This option is useful only when verifying checksums.
+@@ -5837,7 +5837,7 @@ command line unless the @option{--dereference-command-line} (@option{-H}),
+ If a command line argument specifies a symbolic link, show information
+ for the file the link references rather than for the link itself.
+ 
+-@itemx --dereference-command-line-symlink-to-dir
++@item --dereference-command-line-symlink-to-dir
+ @opindex --dereference-command-line-symlink-to-dir
+ @cindex symbolic links, dereferencing
+ Do not dereference symbolic links, with one exception:
+@@ -7015,15 +7015,15 @@ If specified, the @var{attribute_list} must be a comma-separated list
+ of one or more of the following strings:
+ 
+ @table @samp
+-@itemx mode
++@item mode
+ Preserve the file mode bits and access control lists.
+-@itemx ownership
++@item ownership
+ Preserve the owner and group.  On most modern systems,
+ only users with appropriate privileges may change the owner of a file,
+ and ordinary users
+ may preserve the group ownership of a file only if they happen to be
+ a member of the desired group.
+-@itemx timestamps
++@item timestamps
+ Preserve the times of last access and last modification, when possible.
+ In general, it is not possible to preserve these attributes
+ when the affected file is a symbolic link.
+@@ -7031,12 +7031,12 @@ However, FreeBSD now provides the @code{lutimes} function, which makes
+ it possibile even for symbolic links.  However, this implementation does
+ not yet take advantage of that.
+ @c FIXME: once we provide lutimes support, update the above.
+-@itemx links
++@item links
+ Preserve in the destination files
+ any links between corresponding source files.
+ @c Give examples illustrating how hard links are preserved.
+ @c Also, show how soft links map to hard links with -L and -H.
+-@itemx all
++@item all
+ Preserve all file attributes.
+ Equivalent to specifying all of the above.
+ @end table
+@@ -7049,12 +7049,12 @@ mode bits of the corresponding source file, minus the bits set in the
+ umask and minus the set-user-ID and set-group-ID bits.
+ @xref{File permissions}.
+ 
+-@itemx @w{@kbd{--no-preserve}=@var{attribute_list}}
++@item @w{@kbd{--no-preserve}=@var{attribute_list}}
+ @cindex file information, preserving
+ Do not preserve the specified attributes.  The @var{attribute_list}
+ has the same form as for @option{--preserve}.
+ 
+-@itemx --parents
++@item --parents
+ @opindex --parents
+ @cindex parent directories and @command{cp}
+ Form the name of each destination file by appending to the target
+@@ -7070,7 +7070,7 @@ cp --parents a/b/c existing_dir
+ copies the file @file{a/b/c} to @file{existing_dir/a/b/c}, creating
+ any missing intermediate directories.
+ 
+-@itemx @w{@kbd{--reply}=@var{how}}
++@item @w{@kbd{--reply}=@var{how}}
+ @opindex --reply
+ @cindex interactivity
+ @c FIXME: remove in 2008
+@@ -7742,7 +7742,7 @@ Prompt whether to overwrite each existing destination file, regardless
+ of its permissions.
+ If the response is not affirmative, the file is skipped.
+ 
+-@itemx @w{@kbd{--reply}=@var{how}}
++@item @w{@kbd{--reply}=@var{how}}
+ @opindex --reply
+ @cindex interactivity
+ @c FIXME: remove in 2008
+@@ -7847,7 +7847,7 @@ files are named or if a recursive removal is requested.  Ignore any
+ previous @option{--force} (@option{-f}) option.  Equivalent to
+ @option{--interactive=once}.
+ 
+-@itemx --interactive [=@var{when}]
++@item --interactive [=@var{when}]
+ @opindex --interactive
+ Specify when to issue an interactive prompt.  @var{when} may be
+ omitted, or one of:
+@@ -7866,7 +7866,7 @@ removal is requested.  Equivalent to @option{-I}.
+ Specifying @option{--interactive} and no @var{when} is equivalent to
+ @option{--interactive=always}.
+ 
+-@itemx --one-file-system
++@item --one-file-system
+ @opindex --one-file-system
+ @cindex one file system, restricting @command{rm} to
+ When removing a hierarchy recursively, skip any directory that is on a
+@@ -7884,7 +7884,7 @@ warn about and skip directories on other file systems.
+ Of course, this will not save your @file{/home} if it and your
+ chroot happen to be on the same file system.
+ 
+-@itemx --preserve-root
++@item --preserve-root
+ @opindex --preserve-root
+ @cindex root directory, disallow recursive destruction
+ Fail upon any attempt to remove the root directory, @file{/},
+@@ -7892,7 +7892,7 @@ when used with the @option{--recursive} option.
+ This is the default behavior.
+ @xref{Treating / specially}.
+ 
+-@itemx --no-preserve-root
++@item --no-preserve-root
+ @opindex --no-preserve-root
+ @cindex root directory, allow recursive destruction
+ Do not treat @file{/} specially when removing recursively.
+@@ -8874,7 +8874,7 @@ actually changes.
+ Do not print error messages about files whose ownership cannot be
+ changed.
+ 
+-@itemx @w{@kbd{--from}=@var{old-owner}}
++@item @w{@kbd{--from}=@var{old-owner}}
+ @opindex --from
+ @cindex symbolic links, changing owner
+ Change a @var{file}'s ownership only if it has current attributes specified
+@@ -8928,14 +8928,14 @@ is a symbolic link.
+ By default, no diagnostic is issued for symbolic links encountered
+ during a recursive traversal, but see @option{--verbose}.
+ 
+-@itemx --preserve-root
++@item --preserve-root
+ @opindex --preserve-root
+ @cindex root directory, disallow recursive modification
+ Fail upon any attempt to recursively change the root directory, @file{/}.
+ Without @option{--recursive}, this option has no effect.
+ @xref{Treating / specially}.
+ 
+-@itemx --no-preserve-root
++@item --no-preserve-root
+ @opindex --no-preserve-root
+ @cindex root directory, allow recursive modification
+ Cancel the effect of any preceding @option{--preserve-root} option.
+@@ -9054,14 +9054,14 @@ is a symbolic link.
+ By default, no diagnostic is issued for symbolic links encountered
+ during a recursive traversal, but see @option{--verbose}.
+ 
+-@itemx --preserve-root
++@item --preserve-root
+ @opindex --preserve-root
+ @cindex root directory, disallow recursive modification
+ Fail upon any attempt to recursively change the root directory, @file{/}.
+ Without @option{--recursive}, this option has no effect.
+ @xref{Treating / specially}.
+ 
+-@itemx --no-preserve-root
++@item --no-preserve-root
+ @opindex --no-preserve-root
+ @cindex root directory, allow recursive modification
+ Cancel the effect of any preceding @option{--preserve-root} option.
+@@ -9175,14 +9175,14 @@ actually changes.
+ Do not print error messages about files whose permissions cannot be
+ changed.
+ 
+-@itemx --preserve-root
++@item --preserve-root
+ @opindex --preserve-root
+ @cindex root directory, disallow recursive modification
+ Fail upon any attempt to recursively change the root directory, @file{/}.
+ Without @option{--recursive}, this option has no effect.
+ @xref{Treating / specially}.
+ 
+-@itemx --no-preserve-root
++@item --no-preserve-root
+ @opindex --no-preserve-root
+ @cindex root directory, allow recursive modification
+ Cancel the effect of any preceding @option{--preserve-root} option.
+@@ -9603,7 +9603,7 @@ The program accepts the following options.  Also see @ref{Common options}.
+ @opindex --all
+ Show counts for all files, not just directories.
+ 
+-@itemx --apparent-size
++@item --apparent-size
+ @opindex --apparent-size
+ Print apparent sizes, rather than disk usage.  The apparent size of a
+ file is the number of bytes reported by @code{wc -c} on regular files,
+@@ -9654,7 +9654,7 @@ Does not affect other symbolic links.  This is helpful for finding
+ out the disk usage of directories, such as @file{/usr/tmp}, which
+ are often symbolic links.
+ 
+-@itemx --files0-from=@var{FILE}
++@item --files0-from=@var{FILE}
+ @opindex --files0-from=@var{FILE}
+ @cindex including files from @command{du}
+ Rather than processing files named on the command line, process those
+@@ -9733,7 +9733,7 @@ Output a null byte at the end of each line, rather than a newline.
+ This option enables other programs to parse the output of @command{du}
+ even when that output would contain file names with embedded newlines.
+ 
+-@itemx --si
++@item --si
+ @opindex --si
+ @cindex SI output
+ Append an SI-style abbreviation to each size, such as @samp{MB} for
+@@ -9754,13 +9754,13 @@ Display only a total for each argument.
+ Report the size of each directory separately, not including the sizes
+ of subdirectories.
+ 
+-@itemx --time
++@item --time
+ @opindex --time
+ @cindex last modified dates, displaying in @command{du}
+ Show time of the most recent modification of any file in the directory,
+ or any of its subdirectories.
+ 
+-@itemx --time=ctime
++@item --time=ctime
+ @itemx --time=status
+ @itemx --time=use
+ @opindex --time
+@@ -9770,7 +9770,7 @@ or any of its subdirectories.
+ Show the most recent status change time (the @samp{ctime} in the inode) of
+ any file in the directory, instead of the modification time.
+ 
+-@itemx --time=atime
++@item --time=atime
+ @itemx --time=access
+ @opindex --time
+ @opindex atime@r{, show the most recent}
+@@ -9911,7 +9911,7 @@ $ stat --format=%d:%i / /usr
+ 2057:2
+ @end example
+ 
+-@itemx --printf=@var{format}
++@item --printf=@var{format}
+ @opindex --printf=@var{format}
+ @cindex output format
+ Use @var{format} rather than the default format.
+@@ -12240,7 +12240,7 @@ Overrides all other options.
+ @opindex -s
+ Ignored; for compatibility with other versions of @command{who}.
+ 
+-@itemx -u
++@item -u
+ @opindex -u
+ @cindex idle time
+ After the login time, print the number of hours and minutes that the
+@@ -12254,7 +12254,7 @@ user has been idle.  @samp{.} means the user was active in the last minute.
+ List only the entries that correspond to processes via which the
+ system is waiting for a user to login.  The user name is always @samp{LOGIN}.
+ 
+-@itemx --lookup
++@item --lookup
+ @opindex --lookup
+ Attempt to canonicalize hostnames found in utmp through a DNS lookup.  This
+ is not the default because it can cause significant delays on systems with
+-- 
+1.8.3.1
+
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch
new file mode 100644
index 0000000..6537223
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-i18n.patch
@@ -0,0 +1,4051 @@
+Upstream-Status: Inappropriate [legacy version]
+
+This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
+
+The package is stated as being Licensed as GPLv2+.
+
+The comment indicates that the purpose is lin18nux/lsb compliance.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- /dev/null	2007-03-01 09:16:39.219409909 +0000
++++ coreutils-6.8+/tests/sort/sort-mb-tests	2007-03-01 15:08:24.000000000 +0000
+@@ -0,0 +1,58 @@
++#! /bin/sh
++case $# in
++  0) xx='../../src/sort';;
++  *) xx="$1";;
++esac
++test "$VERBOSE" && echo=echo || echo=:
++$echo testing program: $xx
++errors=0
++test "$srcdir" || srcdir=.
++test "$VERBOSE" && $xx --version 2> /dev/null
++
++export LC_ALL=en_US.UTF-8
++locale -k LC_CTYPE 2>&1 | grep -q charmap.*UTF-8 || exit 77
++errors=0
++
++$xx -t @ -k2 -n mb1.I > mb1.O
++code=$?
++if test $code != 0; then
++  $echo "Test mb1 failed: $xx return code $code differs from expected value 0" 1>&2
++  errors=`expr $errors + 1`
++else
++  cmp mb1.O $srcdir/mb1.X > /dev/null 2>&1
++  case $? in
++    0) if test "$VERBOSE"; then $echo "passed mb1"; fi;;
++    1) $echo "Test mb1 failed: files mb1.O and $srcdir/mb1.X differ" 1>&2
++       (diff -c mb1.O $srcdir/mb1.X) 2> /dev/null
++       errors=`expr $errors + 1`;;
++    2) $echo "Test mb1 may have failed." 1>&2
++       $echo The command "cmp mb1.O $srcdir/mb1.X" failed. 1>&2
++       errors=`expr $errors + 1`;;
++  esac
++fi
++
++$xx -t @ -k4 -n mb2.I > mb2.O
++code=$?
++if test $code != 0; then
++  $echo "Test mb2 failed: $xx return code $code differs from expected value 0" 1>&2
++  errors=`expr $errors + 1`
++else
++  cmp mb2.O $srcdir/mb2.X > /dev/null 2>&1
++  case $? in
++    0) if test "$VERBOSE"; then $echo "passed mb2"; fi;;
++    1) $echo "Test mb2 failed: files mb2.O and $srcdir/mb2.X differ" 1>&2
++       (diff -c mb2.O $srcdir/mb2.X) 2> /dev/null
++       errors=`expr $errors + 1`;;
++    2) $echo "Test mb2 may have failed." 1>&2
++       $echo The command "cmp mb2.O $srcdir/mb2.X" failed. 1>&2
++       errors=`expr $errors + 1`;;
++  esac
++fi
++
++if test $errors = 0; then
++  $echo Passed all 113 tests. 1>&2
++else
++  $echo Failed $errors tests. 1>&2
++fi
++test $errors = 0 || errors=1
++exit $errors
+--- /dev/null	2007-03-01 09:16:39.219409909 +0000
++++ coreutils-6.8+/tests/sort/mb2.I	2007-03-01 15:08:24.000000000 +0000
+@@ -0,0 +1,4 @@
++Apple@AA10@@20
++Banana@AA5@@30
++Citrus@AA20@@5
++Cherry@AA30@@10
+--- /dev/null	2007-03-01 09:16:39.219409909 +0000
++++ coreutils-6.8+/tests/sort/mb2.X	2007-03-01 15:08:24.000000000 +0000
+@@ -0,0 +1,4 @@
++Citrus@AA20@@5
++Cherry@AA30@@10
++Apple@AA10@@20
++Banana@AA5@@30
+--- /dev/null	2007-03-01 09:16:39.219409909 +0000
++++ coreutils-6.8+/tests/sort/mb1.I	2007-03-01 15:08:24.000000000 +0000
+@@ -0,0 +1,4 @@
++Apple@10
++Banana@5
++Citrus@20
++Cherry@30
+--- /dev/null	2007-03-01 09:16:39.219409909 +0000
++++ coreutils-6.8+/tests/sort/mb1.X	2007-03-01 15:08:24.000000000 +0000
+@@ -0,0 +1,4 @@
++Banana@5
++Apple@10
++Citrus@20
++Cherry@30
+--- coreutils-6.8+/tests/sort/Makefile.am.i18n	2007-01-24 07:47:37.000000000 +0000
++++ coreutils-6.8+/tests/sort/Makefile.am	2007-03-01 15:09:59.000000000 +0000
+@@ -66,15 +66,17 @@
+ bigfield.O bigfield.E
+ ##test-files-end
+ 
+-EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen)
+-noinst_SCRIPTS = $x-tests
++run_gen += mb1.0 mb2.0
++
++EXTRA_DIST = Test.pm $x-tests $(explicit) $(maint_gen) mb1.I mb1.X mb2.I mb2.X
++noinst_SCRIPTS = $x-tests # $x-mb-tests
+ TESTS_ENVIRONMENT = \
+   CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst \
+   PATH="$(VG_PATH_PREFIX)`pwd`/../../src$(PATH_SEPARATOR)$$PATH"
+ 
+ editpl = sed -e 's,@''PERL''@,$(PERL),g' -e 's,@''srcdir''@,$(srcdir),g'
+ 
+-TESTS = $x-tests
++TESTS = $x-tests $x-mb-tests
+ 
+ mk_script = $(srcdir)/../mk-script
+ $(srcdir)/$x-tests: $(mk_script) Test.pm Makefile.am
+--- coreutils-6.8+/lib/linebuffer.h.i18n	2005-05-14 07:44:24.000000000 +0100
++++ coreutils-6.8+/lib/linebuffer.h	2007-03-01 15:08:24.000000000 +0000
+@@ -22,6 +22,11 @@
+ 
+ # include <stdio.h>
+ 
++/* Get mbstate_t.  */
++# if HAVE_WCHAR_H
++#  include <wchar.h>
++# endif
++
+ /* A `struct linebuffer' holds a line of text. */
+ 
+ struct linebuffer
+@@ -29,6 +34,9 @@
+   size_t size;			/* Allocated. */
+   size_t length;		/* Used. */
+   char *buffer;
++# if HAVE_WCHAR_H
++  mbstate_t state;
++# endif
+ };
+ 
+ /* Initialize linebuffer LINEBUFFER for use. */
+--- coreutils-6.8+/src/expand.c.i18n	2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/expand.c	2007-03-01 15:08:24.000000000 +0000
+@@ -38,11 +38,28 @@
+ #include <stdio.h>
+ #include <getopt.h>
+ #include <sys/types.h>
++
++/* Get mbstate_t, mbrtowc(), wcwidth(). */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
+ #include "system.h"
+ #include "error.h"
+ #include "quote.h"
+ #include "xstrndup.h"
+ 
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++   installation; work around this configuration error.  */
++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
++# define MB_LEN_MAX 16
++#endif
++
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ /* The official name of this program (e.g., no `g' prefix).  */
+ #define PROGRAM_NAME "expand"
+ 
+@@ -183,6 +200,7 @@
+ 	      stops = num_start + len - 1;
+ 	    }
+ 	}
++
+       else
+ 	{
+ 	  error (0, 0, _("tab size contains invalid character(s): %s"),
+@@ -365,6 +383,142 @@
+     }
+ }
+ 
++#if HAVE_MBRTOWC
++static void
++expand_multibyte (void)
++{
++  FILE *fp;			/* Input strem. */
++  mbstate_t i_state;		/* Current shift state of the input stream. */
++  mbstate_t i_state_bak;	/* Back up the I_STATE. */
++  mbstate_t o_state;		/* Current shift state of the output stream. */
++  char buf[MB_LEN_MAX + BUFSIZ];  /* For spooling a read byte sequence. */
++  char *bufpos;			/* Next read position of BUF. */
++  size_t buflen = 0;		/* The length of the byte sequence in buf. */
++  wchar_t wc;			/* A gotten wide character. */
++  size_t mblength;		/* The byte size of a multibyte character
++				   which shows as same character as WC. */
++  int tab_index = 0;		/* Index in `tab_list' of next tabstop. */
++  int column = 0;		/* Column on screen of the next char. */
++  int next_tab_column;		/* Column the next tab stop is on. */
++  int convert = 1;		/* If nonzero, perform translations. */
++
++  fp = next_file ((FILE *) NULL);
++  if (fp == NULL)
++    return;
++
++  memset (&o_state, '\0', sizeof(mbstate_t));
++  memset (&i_state, '\0', sizeof(mbstate_t));
++
++  for (;;)
++    {
++      /* Refill the buffer BUF. */
++      if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
++	{
++	  memmove (buf, bufpos, buflen);
++	  buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
++	  bufpos = buf;
++	}
++
++      /* No character is left in BUF. */
++      if (buflen < 1)
++	{
++	  fp = next_file (fp);
++
++	  if (fp == NULL)
++	    break;		/* No more files. */
++	  else
++	    {
++	      memset (&i_state, '\0', sizeof(mbstate_t));
++	      continue;
++	    }
++	}
++
++      /* Get a wide character. */
++      i_state_bak = i_state;
++      mblength = mbrtowc (&wc, bufpos, buflen, &i_state);
++
++      switch (mblength)
++	{
++	case (size_t)-1:	/* illegal byte sequence. */
++	case (size_t)-2:
++	  mblength = 1;
++	  i_state = i_state_bak;
++	  if (convert)
++	    {
++	      ++column;
++	      if (convert_entire_line == 0)
++		convert = 0;
++	    }
++	  putchar (*bufpos);
++	  break;
++
++	case 0:		/* null. */
++	  mblength = 1;
++	  if (convert && convert_entire_line == 0)
++	    convert = 0;
++	  putchar ('\0');
++	  break;
++
++	default:
++	  if (wc == L'\n')   /* LF. */
++	    {
++	      tab_index = 0;
++	      column = 0;
++	      convert = 1;
++	      putchar ('\n');
++	    }
++	  else if (wc == L'\t' && convert)	/* Tab. */
++	    {
++	      if (tab_size == 0)
++		{
++		  /* Do not let tab_index == first_free_tab;
++		     stop when it is 1 less. */
++		  while (tab_index < first_free_tab - 1
++		      && column >= tab_list[tab_index])
++		    tab_index++;
++		  next_tab_column = tab_list[tab_index];
++		  if (tab_index < first_free_tab - 1)
++		    tab_index++;
++		  if (column >= next_tab_column)
++		    next_tab_column = column + 1;
++		}
++	      else
++		next_tab_column = column + tab_size - column % tab_size;
++
++	      while (column < next_tab_column)
++		{
++		  putchar (' ');
++		  ++column;
++		}
++	    }
++	  else  /* Others. */
++	    {
++	      if (convert)
++		{
++		  if (wc == L'\b')
++		    {
++		      if (column > 0)
++			--column;
++		    }
++		  else
++		    {
++		      int width;		/* The width of WC. */
++
++		      width = wcwidth (wc);
++		      column += (width > 0) ? width : 0;
++		      if (convert_entire_line == 0)
++			convert = 0;
++		    }
++		}
++	      fwrite (bufpos, sizeof(char), mblength, stdout);
++	    }
++	}
++      buflen -= mblength;
++      bufpos += mblength;
++    }
++}
++#endif
++
+ int
+ main (int argc, char **argv)
+ {
+@@ -429,7 +583,12 @@
+ 
+   file_list = (optind < argc ? &argv[optind] : stdin_argv);
+ 
+-  expand ();
++#if HAVE_MBRTOWC
++  if (MB_CUR_MAX > 1)
++    expand_multibyte ();
++  else
++#endif
++    expand ();
+ 
+   if (have_read_stdin && fclose (stdin) != 0)
+     error (EXIT_FAILURE, errno, "-");
+--- coreutils-6.8+/src/join.c.i18n	2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/join.c	2007-03-01 15:08:24.000000000 +0000
+@@ -23,16 +23,30 @@
+ #include <sys/types.h>
+ #include <getopt.h>
+ 
++/* Get mbstate_t, mbrtowc(), mbrtowc(), wcwidth().  */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
++/* Get iswblank(), towupper.  */
++#if HAVE_WCTYPE_H
++# include <wctype.h>
++#endif
++
+ #include "system.h"
+ #include "error.h"
+ #include "hard-locale.h"
+ #include "linebuffer.h"
+-#include "memcasecmp.h"
+ #include "quote.h"
+ #include "stdio--.h"
+ #include "xmemcoll.h"
+ #include "xstrtol.h"
+ 
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ /* The official name of this program (e.g., no `g' prefix).  */
+ #define PROGRAM_NAME "join"
+ 
+@@ -104,10 +118,12 @@
+ /* Last element in `outlist', where a new element can be added.  */
+ static struct outlist *outlist_end = &outlist_head;
+ 
+-/* Tab character separating fields.  If negative, fields are separated
+-   by any nonempty string of blanks, otherwise by exactly one
+-   tab character whose value (when cast to unsigned char) equals TAB.  */
+-static int tab = -1;
++/* Tab character separating fields.  If NULL, fields are separated
++   by any nonempty string of blanks.  */
++static char *tab = NULL;
++
++/* The number of bytes used for tab. */
++static size_t tablen = 0;
+ 
+ static struct option const longopts[] =
+ {
+@@ -190,6 +206,8 @@
+ 
+ /* Fill in the `fields' structure in LINE.  */
+ 
++/* Fill in the `fields' structure in LINE.  */
++
+ static void
+ xfields (struct line *line)
+ {
+@@ -199,10 +217,11 @@
+   if (ptr == lim)
+     return;
+ 
+-  if (0 <= tab)
++  if (tab != NULL)
+     {
++      unsigned char t = tab[0];
+       char *sep;
+-      for (; (sep = memchr (ptr, tab, lim - ptr)) != NULL; ptr = sep + 1)
++      for (; (sep = memchr (ptr, t, lim - ptr)) != NULL; ptr = sep + 1)
+ 	extract_field (line, ptr, sep - ptr);
+     }
+   else
+@@ -229,6 +248,148 @@
+   extract_field (line, ptr, lim - ptr);
+ }
+ 
++#if HAVE_MBRTOWC
++static void
++xfields_multibyte (struct line *line)
++{
++  char *ptr = line->buf.buffer;
++  char const *lim = ptr + line->buf.length - 1;
++  wchar_t wc = 0;
++  size_t mblength = 1;
++  mbstate_t state, state_bak;
++
++  memset (&state, 0, sizeof (mbstate_t));
++
++  if (ptr == lim)
++    return;
++
++  if (tab != NULL)
++    {
++      unsigned char t = tab[0];
++      char *sep = ptr;
++      for (; ptr < lim; ptr = sep + mblength)
++	{
++	  sep = ptr;
++	  while (sep < lim)
++	    {
++	      state_bak = state;
++	      mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
++
++	      if (mblength == (size_t)-1 || mblength == (size_t)-2)
++		{
++		  mblength = 1;
++		  state = state_bak;
++		}
++	      mblength = (mblength < 1) ? 1 : mblength;
++
++	      if (mblength == tablen && !memcmp (sep, tab, mblength))
++		break;
++	      else
++		{
++		  sep += mblength;
++		  continue;
++		}
++	    }
++
++	  if (sep == lim)
++	    break;
++
++	  extract_field (line, ptr, sep - ptr);
++	}
++    }
++  else
++    {
++      /* Skip leading blanks before the first field.  */
++      while(ptr < lim)
++      {
++        state_bak = state;
++        mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
++
++        if (mblength == (size_t)-1 || mblength == (size_t)-2)
++          {
++            mblength = 1;
++            state = state_bak;
++            break;
++          }
++        mblength = (mblength < 1) ? 1 : mblength;
++
++        if (!iswblank(wc))
++          break;
++        ptr += mblength;
++      }
++
++      do
++	{
++	  char *sep;
++	  state_bak = state;
++	  mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
++	  if (mblength == (size_t)-1 || mblength == (size_t)-2)
++	    {
++	      mblength = 1;
++	      state = state_bak;
++	      break;
++	    }
++	  mblength = (mblength < 1) ? 1 : mblength;
++
++	  sep = ptr + mblength;
++	  while (sep != lim)
++	    {
++	      state_bak = state;
++	      mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
++	      if (mblength == (size_t)-1 || mblength == (size_t)-2)
++		{
++		  mblength = 1;
++		  state = state_bak;
++		  break;
++		}
++	      mblength = (mblength < 1) ? 1 : mblength;
++
++	      if (iswblank (wc))
++		break;
++
++	      sep += mblength;
++	    }
++
++	  extract_field (line, ptr, sep - ptr);
++	  if (sep == lim)
++	    return;
++
++	  state_bak = state;
++	  mblength = mbrtowc (&wc, sep, lim - sep + 1, &state);
++	  if (mblength == (size_t)-1 || mblength == (size_t)-2)
++	    {
++	      mblength = 1;
++	      state = state_bak;
++	      break;
++	    }
++	  mblength = (mblength < 1) ? 1 : mblength;
++
++	  ptr = sep + mblength;
++	  while (ptr != lim)
++	    {
++	      state_bak = state;
++	      mblength = mbrtowc (&wc, ptr, lim - ptr + 1, &state);
++	      if (mblength == (size_t)-1 || mblength == (size_t)-2)
++		{
++		  mblength = 1;
++		  state = state_bak;
++		  break;
++		}
++	      mblength = (mblength < 1) ? 1 : mblength;
++
++	      if (!iswblank (wc))
++		break;
++
++	      ptr += mblength;
++	    }
++	}
++      while (ptr != lim);
++    }
++
++  extract_field (line, ptr, lim - ptr);
++}
++#endif
++
+ /* Read a line from FP into LINE and split it into fields.
+    Return true if successful.  */
+ 
+@@ -249,6 +410,11 @@
+   line->nfields_allocated = 0;
+   line->nfields = 0;
+   line->fields = NULL;
++#if HAVE_MBRTOWC
++  if (MB_CUR_MAX > 1)
++    xfields_multibyte (line);
++  else
++#endif
+   xfields (line);
+   return true;
+ }
+@@ -303,56 +469,114 @@
+ keycmp (struct line const *line1, struct line const *line2)
+ {
+   /* Start of field to compare in each file.  */
+-  char *beg1;
+-  char *beg2;
+-
+-  size_t len1;
+-  size_t len2;		/* Length of fields to compare.  */
++  char *beg[2];
++  char *copy[2];
++  size_t len[2];	/* Length of fields to compare.  */
+   int diff;
++  int i, j;
+ 
+   if (join_field_1 < line1->nfields)
+     {
+-      beg1 = line1->fields[join_field_1].beg;
+-      len1 = line1->fields[join_field_1].len;
++      beg[0] = line1->fields[join_field_1].beg;
++      len[0] = line1->fields[join_field_1].len;
+     }
+   else
+     {
+-      beg1 = NULL;
+-      len1 = 0;
++      beg[0] = NULL;
++      len[0] = 0;
+     }
+ 
+   if (join_field_2 < line2->nfields)
+     {
+-      beg2 = line2->fields[join_field_2].beg;
+-      len2 = line2->fields[join_field_2].len;
++      beg[1] = line2->fields[join_field_2].beg;
++      len[1] = line2->fields[join_field_2].len;
+     }
+   else
+     {
+-      beg2 = NULL;
+-      len2 = 0;
++      beg[1] = NULL;
++      len[1] = 0;
+     }
+ 
+-  if (len1 == 0)
+-    return len2 == 0 ? 0 : -1;
+-  if (len2 == 0)
++  if (len[0] == 0)
++    return len[1] == 0 ? 0 : -1;
++  if (len[1] == 0)
+     return 1;
+ 
+   if (ignore_case)
+     {
+-      /* FIXME: ignore_case does not work with NLS (in particular,
+-         with multibyte chars).  */
+-      diff = memcasecmp (beg1, beg2, MIN (len1, len2));
++#ifdef HAVE_MBRTOWC
++      if (MB_CUR_MAX > 1)
++      {
++        size_t mblength;
++        wchar_t wc, uwc;
++        mbstate_t state, state_bak;
++
++        memset (&state, '\0', sizeof (mbstate_t));
++
++        for (i = 0; i < 2; i++)
++          {
++            copy[i] = alloca (len[i] + 1);
++
++            for (j = 0; j < MIN (len[0], len[1]);)
++              {
++                state_bak = state;
++                mblength = mbrtowc (&wc, beg[i] + j, len[i] - j, &state);
++
++                switch (mblength)
++                  {
++                  case (size_t) -1:
++                  case (size_t) -2:
++                    state = state_bak;
++                    /* Fall through */
++                  case 0:
++                    mblength = 1;
++                    break;
++
++                  default:
++                    uwc = towupper (wc);
++
++                    if (uwc != wc)
++                      {
++                        mbstate_t state_wc;
++
++                        memset (&state_wc, '\0', sizeof (mbstate_t));
++                        wcrtomb (copy[i] + j, uwc, &state_wc);
++                      }
++                    else
++                      memcpy (copy[i] + j, beg[i] + j, mblength);
++                  }
++                j += mblength;
++              }
++            copy[i][j] = '\0';
++          }
++      }
++      else
++#endif
++      {
++        for (i = 0; i < 2; i++)
++          {
++            copy[i] = alloca (len[i] + 1);
++
++            for (j = 0; j < MIN (len[0], len[1]); j++)
++              copy[i][j] = toupper (beg[i][j]);
++
++            copy[i][j] = '\0';
++          }
++      }
+     }
+   else
+     {
+-      if (hard_LC_COLLATE)
+-	return xmemcoll (beg1, len1, beg2, len2);
+-      diff = memcmp (beg1, beg2, MIN (len1, len2));
++      copy[0] = (unsigned char *) beg[0];
++      copy[1] = (unsigned char *) beg[1];
+     }
+ 
++  if (hard_LC_COLLATE)
++    return xmemcoll ((char *) copy[0], len[0], (char *) copy[1], len[1]);
++  diff = memcmp (copy[0], copy[1], MIN (len[0], len[1]));
++
+   if (diff)
+     return diff;
+-  return len1 < len2 ? -1 : len1 != len2;
++  return len[0] - len[1];
+ }
+ 
+ /* Print field N of LINE if it exists and is nonempty, otherwise
+@@ -377,11 +601,18 @@
+ 
+ /* Print the join of LINE1 and LINE2.  */
+ 
++#define PUT_TAB_CHAR							\
++  do									\
++    {									\
++      (tab != NULL) ?							\
++	fwrite(tab, sizeof(char), tablen, stdout) : putchar (' ');	\
++    }									\
++  while (0)								
++
+ static void
+ prjoin (struct line const *line1, struct line const *line2)
+ {
+   const struct outlist *outlist;
+-  char output_separator = tab < 0 ? ' ' : tab;
+ 
+   outlist = outlist_head.next;
+   if (outlist)
+@@ -397,12 +628,12 @@
+ 	  if (o->file == 0)
+ 	    {
+ 	      if (line1 == &uni_blank)
+-	        {
++		{
+ 		  line = line2;
+ 		  field = join_field_2;
+ 		}
+ 	      else
+-	        {
++		{
+ 		  line = line1;
+ 		  field = join_field_1;
+ 		}
+@@ -416,7 +647,7 @@
+ 	  o = o->next;
+ 	  if (o == NULL)
+ 	    break;
+-	  putchar (output_separator);
++	  PUT_TAB_CHAR;
+ 	}
+       putchar ('\n');
+     }
+@@ -434,23 +665,23 @@
+       prfield (join_field_1, line1);
+       for (i = 0; i < join_field_1 && i < line1->nfields; ++i)
+ 	{
+-	  putchar (output_separator);
++	  PUT_TAB_CHAR;
+ 	  prfield (i, line1);
+ 	}
+       for (i = join_field_1 + 1; i < line1->nfields; ++i)
+ 	{
+-	  putchar (output_separator);
++	  PUT_TAB_CHAR;
+ 	  prfield (i, line1);
+ 	}
+ 
+       for (i = 0; i < join_field_2 && i < line2->nfields; ++i)
+ 	{
+-	  putchar (output_separator);
++	  PUT_TAB_CHAR;
+ 	  prfield (i, line2);
+ 	}
+       for (i = join_field_2 + 1; i < line2->nfields; ++i)
+ 	{
+-	  putchar (output_separator);
++	  PUT_TAB_CHAR;
+ 	  prfield (i, line2);
+ 	}
+       putchar ('\n');
+@@ -859,20 +1090,41 @@
+ 
+ 	case 't':
+ 	  {
+-	    unsigned char newtab = optarg[0];
+-	    if (! newtab)
++	    char *newtab;
++	    size_t newtablen;
++	    if (! optarg[0])
+ 	      error (EXIT_FAILURE, 0, _("empty tab"));
+-	    if (optarg[1])
++	    newtab = xstrdup (optarg);
++#if HAVE_MBRTOWC
++	    if (MB_CUR_MAX > 1)
++	      {
++		mbstate_t state;
++
++		memset (&state, 0, sizeof (mbstate_t));
++		newtablen = mbrtowc (NULL, newtab,
++				     strnlen (newtab, MB_LEN_MAX),
++				     &state);
++		if (newtablen == (size_t) 0
++		    || newtablen == (size_t) -1
++		    || newtablen == (size_t) -2)
++		  newtablen = 1;
++	      }
++	    else
++#endif
++	      newtablen = 1;
++		
++	    if (newtablen == 1 && newtab[1])
++	      {
++		if (STREQ (newtab, "\\0"))
++		  newtab[0] = '\0';
++	      }
++	    if (tab != NULL && strcmp (tab, newtab))
+ 	      {
+-		if (STREQ (optarg, "\\0"))
+-		  newtab = '\0';
+-		else
+-		  error (EXIT_FAILURE, 0, _("multi-character tab %s"),
+-			 quote (optarg));
++		free (newtab);
++		error (EXIT_FAILURE, 0, _("incompatible tabs"));
+ 	      }
+-	    if (0 <= tab && tab != newtab)
+-	      error (EXIT_FAILURE, 0, _("incompatible tabs"));
+ 	    tab = newtab;
++	    tablen = newtablen;
+ 	  }
+ 	  break;
+ 
+--- coreutils-6.8+/src/uniq.c.i18n	2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/uniq.c	2007-03-01 15:08:24.000000000 +0000
+@@ -23,6 +23,16 @@
+ #include <getopt.h>
+ #include <sys/types.h>
+ 
++/* Get mbstate_t, mbrtowc(). */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
++/* Get isw* functions. */
++#if HAVE_WCTYPE_H
++# include <wctype.h>
++#endif
++
+ #include "system.h"
+ #include "argmatch.h"
+ #include "linebuffer.h"
+@@ -32,7 +42,19 @@
+ #include "quote.h"
+ #include "xmemcoll.h"
+ #include "xstrtol.h"
+-#include "memcasecmp.h"
++#include "xmemcoll.h"
++
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++   installation; work around this configuration error.  */
++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
++# define MB_LEN_MAX 16
++#endif
++
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ 
+ /* The official name of this program (e.g., no `g' prefix).  */
+ #define PROGRAM_NAME "uniq"
+@@ -109,6 +131,10 @@
+ /* Select whether/how to delimit groups of duplicate lines.  */
+ static enum delimit_method delimit_groups;
+ 
++/* Function pointers. */
++static char *
++(*find_field) (struct linebuffer *line);
++
+ static struct option const longopts[] =
+ {
+   {"count", no_argument, NULL, 'c'},
+@@ -198,7 +224,7 @@
+    return a pointer to the beginning of the line's field to be compared. */
+ 
+ static char *
+-find_field (const struct linebuffer *line)
++find_field_uni (struct linebuffer *line)
+ {
+   size_t count;
+   char *lp = line->buffer;
+@@ -219,6 +245,83 @@
+   return lp + i;
+ }
+ 
++#if HAVE_MBRTOWC
++
++# define MBCHAR_TO_WCHAR(WC, MBLENGTH, LP, POS, SIZE, STATEP, CONVFAIL)  \
++  do									\
++    {									\
++      mbstate_t state_bak;						\
++									\
++      CONVFAIL = 0;							\
++      state_bak = *STATEP;						\
++									\
++      MBLENGTH = mbrtowc (&WC, LP + POS, SIZE - POS, STATEP);		\
++									\
++      switch (MBLENGTH)							\
++	{								\
++	case (size_t)-2:						\
++	case (size_t)-1:						\
++	  *STATEP = state_bak;						\
++	  CONVFAIL++;							\
++	  /* Fall through */						\
++	case 0:								\
++	  MBLENGTH = 1;							\
++	}								\
++    }									\
++  while (0)
++
++static char *
++find_field_multi (struct linebuffer *line)
++{
++  size_t count;
++  char *lp = line->buffer;
++  size_t size = line->length - 1;
++  size_t pos;
++  size_t mblength;
++  wchar_t wc;
++  mbstate_t *statep;
++  int convfail;
++
++  pos = 0;
++  statep = &(line->state);
++
++  /* skip fields. */
++  for (count = 0; count < skip_fields && pos < size; count++)
++    {
++      while (pos < size)
++	{
++	  MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
++ 
++	  if (convfail || !iswblank (wc))
++	    {
++	      pos += mblength;
++	      break;
++	    }
++	  pos += mblength;
++	}
++
++      while (pos < size)
++	{
++	  MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
++
++	  if (!convfail && iswblank (wc))
++	    break;
++
++	  pos += mblength;
++	}
++    }
++
++  /* skip fields. */
++  for (count = 0; count < skip_chars && pos < size; count++)
++    {
++      MBCHAR_TO_WCHAR (wc, mblength, lp, pos, size, statep, convfail);
++      pos += mblength;
++    }
++
++  return lp + pos;
++}
++#endif
++
+ /* Return false if two strings OLD and NEW match, true if not.
+    OLD and NEW point not to the beginnings of the lines
+    but rather to the beginnings of the fields to compare.
+@@ -227,6 +330,8 @@
+ static bool
+ different (char *old, char *new, size_t oldlen, size_t newlen)
+ {
++  char *copy_old, *copy_new;
++
+   if (check_chars < oldlen)
+     oldlen = check_chars;
+   if (check_chars < newlen)
+@@ -234,14 +339,92 @@
+ 
+   if (ignore_case)
+     {
+-      /* FIXME: This should invoke strcoll somehow.  */
+-      return oldlen != newlen || memcasecmp (old, new, oldlen);
++      size_t i;
++
++      copy_old = alloca (oldlen + 1);
++      copy_new = alloca (oldlen + 1);
++
++      for (i = 0; i < oldlen; i++)
++	{
++	  copy_old[i] = toupper (old[i]);
++	  copy_new[i] = toupper (new[i]);
++	}
+     }
+-  else if (hard_LC_COLLATE)
+-    return xmemcoll (old, oldlen, new, newlen) != 0;
+   else
+-    return oldlen != newlen || memcmp (old, new, oldlen);
++    {
++      copy_old = (char *)old;
++      copy_new = (char *)new;
++    }
++
++  return xmemcoll (copy_old, oldlen, copy_new, newlen);
++}
++
++#if HAVE_MBRTOWC
++static int
++different_multi (const char *old, const char *new, size_t oldlen, size_t newlen, mbstate_t oldstate, mbstate_t newstate)
++{
++  size_t i, j, chars;
++  const char *str[2];
++  char *copy[2];
++  size_t len[2];
++  mbstate_t state[2];
++  size_t mblength;
++  wchar_t wc, uwc;
++  mbstate_t state_bak;
++
++  str[0] = old;
++  str[1] = new;
++  len[0] = oldlen;
++  len[1] = newlen;
++  state[0] = oldstate;
++  state[1] = newstate;
++
++  for (i = 0; i < 2; i++)
++    {
++      copy[i] = alloca (len[i] + 1);
++
++      for (j = 0, chars = 0; j < len[i] && chars < check_chars; chars++)
++	{
++	  state_bak = state[i];
++	  mblength = mbrtowc (&wc, str[i] + j, len[i] - j, &(state[i]));
++
++	  switch (mblength)
++	    {
++	    case (size_t)-1:
++	    case (size_t)-2:
++	      state[i] = state_bak;
++	      /* Fall through */
++	    case 0:
++	      mblength = 1;
++	      break;
++
++	    default:
++	      if (ignore_case)
++		{
++		  uwc = towupper (wc);
++
++		  if (uwc != wc)
++		    {
++		      mbstate_t state_wc;
++
++		      memset (&state_wc, '\0', sizeof(mbstate_t));
++		      wcrtomb (copy[i] + j, uwc, &state_wc);
++		    }
++		  else
++		    memcpy (copy[i] + j, str[i] + j, mblength);
++		}
++	      else
++		memcpy (copy[i] + j, str[i] + j, mblength);
++	    }
++	  j += mblength;
++	}
++      copy[i][j] = '\0';
++      len[i] = j;
++    }
++
++  return xmemcoll (copy[0], len[0], copy[1], len[1]);
+ }
++#endif
+ 
+ /* Output the line in linebuffer LINE to standard output
+    provided that the switches say it should be output.
+@@ -295,15 +478,43 @@
+     {
+       char *prevfield IF_LINT (= NULL);
+       size_t prevlen IF_LINT (= 0);
++#if HAVE_MBRTOWC
++      mbstate_t prevstate;
++
++      memset (&prevstate, '\0', sizeof (mbstate_t));
++#endif
+ 
+       while (!feof (stdin))
+ 	{
+ 	  char *thisfield;
+ 	  size_t thislen;
++#if HAVE_MBRTOWC
++	  mbstate_t thisstate;
++#endif
++
+ 	  if (readlinebuffer (thisline, stdin) == 0)
+ 	    break;
+ 	  thisfield = find_field (thisline);
+ 	  thislen = thisline->length - 1 - (thisfield - thisline->buffer);
++#if HAVE_MBRTOWC
++	  if (MB_CUR_MAX > 1)
++            {
++            thisstate = thisline->state;
++
++            if (prevline->length == 0 || different_multi
++              (thisfield, prevfield, thislen, prevlen, thisstate, prevstate))
++              {
++                fwrite (thisline->buffer, sizeof (char),
++                        thisline->length, stdout);
++
++                SWAP_LINES (prevline, thisline);
++                prevfield = thisfield;
++                prevlen = thislen;
++                prevstate = thisstate;
++              }
++          }
++	else
++#endif
+ 	  if (prevline->length == 0
+ 	      || different (thisfield, prevfield, thislen, prevlen))
+ 	    {
+@@ -322,17 +533,26 @@
+       size_t prevlen;
+       uintmax_t match_count = 0;
+       bool first_delimiter = true;
++#if HAVE_MBRTOWC
++      mbstate_t prevstate;
++#endif
+ 
+       if (readlinebuffer (prevline, stdin) == 0)
+ 	goto closefiles;
+       prevfield = find_field (prevline);
+       prevlen = prevline->length - 1 - (prevfield - prevline->buffer);
++#if HAVE_MBRTOWC
++      prevstate = prevline->state;
++#endif
+ 
+       while (!feof (stdin))
+ 	{
+ 	  bool match;
+ 	  char *thisfield;
+ 	  size_t thislen;
++#if HAVE_MBRTOWC
++	  mbstate_t thisstate;
++#endif
+ 	  if (readlinebuffer (thisline, stdin) == 0)
+ 	    {
+ 	      if (ferror (stdin))
+@@ -341,6 +561,15 @@
+ 	    }
+ 	  thisfield = find_field (thisline);
+ 	  thislen = thisline->length - 1 - (thisfield - thisline->buffer);
++#if HAVE_MBRTOWC
++	  if (MB_CUR_MAX > 1)
++	    {
++              thisstate = thisline->state;
++              match = !different_multi (thisfield, prevfield,
++                                thislen, prevlen, thisstate, prevstate);
++            }
++	  else
++#endif
+ 	  match = !different (thisfield, prevfield, thislen, prevlen);
+ 	  match_count += match;
+ 
+@@ -373,6 +602,9 @@
+ 	      SWAP_LINES (prevline, thisline);
+ 	      prevfield = thisfield;
+ 	      prevlen = thislen;
++#if HAVE_MBRTOWC
++	      prevstate = thisstate;
++#endif
+ 	      if (!match)
+ 		match_count = 0;
+ 	    }
+@@ -417,6 +649,19 @@
+ 
+   atexit (close_stdout);
+ 
++#if HAVE_MBRTOWC
++  if (MB_CUR_MAX > 1)
++    {
++      find_field = find_field_multi;
++    }
++  else
++#endif
++    {
++      find_field = find_field_uni;
++    }
++
++
++
+   skip_chars = 0;
+   skip_fields = 0;
+   check_chars = SIZE_MAX;
+--- coreutils-6.8+/src/fold.c.i18n	2007-02-23 12:01:47.000000000 +0000
++++ coreutils-6.8+/src/fold.c	2007-03-01 15:08:24.000000000 +0000
+@@ -23,11 +23,33 @@
+ #include <getopt.h>
+ #include <sys/types.h>
+ 
++/* Get mbstate_t, mbrtowc(), wcwidth().  */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
++/* Get iswprint(), iswblank(), wcwidth().  */
++#if HAVE_WCTYPE_H
++# include <wctype.h>
++#endif
++
+ #include "system.h"
+ #include "error.h"
+ #include "quote.h"
+ #include "xstrtol.h"
+ 
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++      installation; work around this configuration error.  */
++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
++# undef MB_LEN_MAX
++# define MB_LEN_MAX 16
++#endif
++
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ #define TAB_WIDTH 8
+ 
+ /* The official name of this program (e.g., no `g' prefix).  */
+@@ -35,23 +57,44 @@
+ 
+ #define AUTHORS "David MacKenzie"
+ 
++#define FATAL_ERROR(Message)                                            \
++  do                                                                    \
++    {                                                                   \
++      error (0, 0, (Message));                                          \
++      usage (2);                                                        \
++    }                                                                   \
++  while (0)
++
++enum operating_mode
++{
++  /* Fold texts by columns that are at the given positions. */
++  column_mode,
++
++  /* Fold texts by bytes that are at the given positions. */
++  byte_mode,
++
++  /* Fold texts by characters that are at the given positions. */
++  character_mode,
++};
++
+ /* The name this program was run with. */
+ char *program_name;
+ 
++/* The argument shows current mode. (Default: column_mode) */
++static enum operating_mode operating_mode;
++
+ /* If nonzero, try to break on whitespace. */
+ static bool break_spaces;
+ 
+-/* If nonzero, count bytes, not column positions. */
+-static bool count_bytes;
+-
+ /* If nonzero, at least one of the files we read was standard input. */
+ static bool have_read_stdin;
+ 
+-static char const shortopts[] = "bsw:0::1::2::3::4::5::6::7::8::9::";
++static char const shortopts[] = "bcsw:0::1::2::3::4::5::6::7::8::9::";
+ 
+ static struct option const longopts[] =
+ {
+   {"bytes", no_argument, NULL, 'b'},
++  {"characters", no_argument, NULL, 'c'},
+   {"spaces", no_argument, NULL, 's'},
+   {"width", required_argument, NULL, 'w'},
+   {GETOPT_HELP_OPTION_DECL},
+@@ -81,6 +124,7 @@
+ "), stdout);
+       fputs (_("\
+   -b, --bytes         count bytes rather than columns\n\
++  -c, --characters    count characters rather than columns\n\
+   -s, --spaces        break at spaces\n\
+   -w, --width=WIDTH   use WIDTH columns instead of 80\n\
+ "), stdout);
+@@ -98,7 +142,7 @@
+ static size_t
+ adjust_column (size_t column, char c)
+ {
+-  if (!count_bytes)
++  if (operating_mode != byte_mode)
+     {
+       if (c == '\b')
+ 	{
+@@ -121,30 +165,14 @@
+    to stdout, with maximum line length WIDTH.
+    Return true if successful.  */
+ 
+-static bool
+-fold_file (char const *filename, size_t width)
++static void
++fold_text (FILE *istream, size_t width, int *saved_errno)
+ {
+-  FILE *istream;
+   int c;
+   size_t column = 0;		/* Screen column where next char will go. */
+   size_t offset_out = 0;	/* Index in `line_out' for next char. */
+   static char *line_out = NULL;
+   static size_t allocated_out = 0;
+-  int saved_errno;
+-
+-  if (STREQ (filename, "-"))
+-    {
+-      istream = stdin;
+-      have_read_stdin = true;
+-    }
+-  else
+-    istream = fopen (filename, "r");
+-
+-  if (istream == NULL)
+-    {
+-      error (0, errno, "%s", filename);
+-      return false;
+-    }
+ 
+   while ((c = getc (istream)) != EOF)
+     {
+@@ -172,6 +200,15 @@
+ 	      bool found_blank = false;
+ 	      size_t logical_end = offset_out;
+ 
++	      /* If LINE_OUT has no wide character,
++		 put a new wide character in LINE_OUT
++		 if column is bigger than width. */
++	      if (offset_out == 0)
++		{
++		  line_out[offset_out++] = c;
++		  continue;
++		}
++
+ 	      /* Look for the last blank. */
+ 	      while (logical_end)
+ 		{
+@@ -218,11 +255,225 @@
+       line_out[offset_out++] = c;
+     }
+ 
+-  saved_errno = errno;
++  *saved_errno = errno;
++
++  if (offset_out)
++    fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
++
++  free(line_out);
++}
++
++#if HAVE_MBRTOWC
++static void
++fold_multibyte_text (FILE *istream, size_t width, int *saved_errno)
++{
++  char buf[MB_LEN_MAX + BUFSIZ];  /* For spooling a read byte sequence. */
++  size_t buflen = 0;	/* The length of the byte sequence in buf. */
++  char *bufpos;         /* Next read position of BUF. */
++  wint_t wc;		/* A gotten wide character. */
++  size_t mblength;	/* The byte size of a multibyte character which shows
++			   as same character as WC. */
++  mbstate_t state, state_bak;	/* State of the stream. */
++  int convfail;		/* 1, when conversion is failed. Otherwise 0. */
++
++  char *line_out = NULL;
++  size_t offset_out = 0;	/* Index in `line_out' for next char. */
++  size_t allocated_out = 0;
++
++  int increment;
++  size_t column = 0;
++
++  size_t last_blank_pos;
++  size_t last_blank_column;
++  int is_blank_seen;
++  int last_blank_increment;
++  int is_bs_following_last_blank;
++  size_t bs_following_last_blank_num;
++  int is_cr_after_last_blank;
++
++#define CLEAR_FLAGS				\
++   do						\
++     {						\
++	last_blank_pos = 0;			\
++	last_blank_column = 0;			\
++	is_blank_seen = 0;			\
++	is_bs_following_last_blank = 0;		\
++	bs_following_last_blank_num = 0;	\
++	is_cr_after_last_blank = 0;		\
++     }						\
++   while (0)
++
++#define START_NEW_LINE			\
++   do					\
++     {					\
++      putchar ('\n');			\
++      column = 0;			\
++      offset_out = 0;			\
++      CLEAR_FLAGS;			\
++    }					\
++   while (0)
++
++  CLEAR_FLAGS;
++  memset (&state, '\0', sizeof(mbstate_t));
++
++  for (;; bufpos += mblength, buflen -= mblength)
++    {
++      if (buflen < MB_LEN_MAX && !feof (istream) && !ferror (istream))
++	{
++	  memmove (buf, bufpos, buflen);
++	  buflen += fread (buf + buflen, sizeof(char), BUFSIZ, istream);
++	  bufpos = buf;
++	}
++
++      if (buflen < 1)
++	break;
++
++      /* Get a wide character. */
++      convfail = 0;
++      state_bak = state;
++      mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &state);
++
++      switch (mblength)
++	{
++	case (size_t)-1:
++	case (size_t)-2:
++	  convfail++;
++	  state = state_bak;
++	  /* Fall through. */
++
++	case 0:
++	  mblength = 1;
++	  break;
++	}
++
++rescan:
++      if (operating_mode == byte_mode)			/* byte mode */
++	increment = mblength;
++      else if (operating_mode == character_mode)	/* character mode */
++	increment = 1;
++      else						/* column mode */
++	{
++	  if (convfail)
++	    increment = 1;
++	  else
++	    {
++	      switch (wc)
++		{
++		case L'\n':
++		  fwrite (line_out, sizeof(char), offset_out, stdout);
++		  START_NEW_LINE;
++		  continue;
++		  
++		case L'\b':
++		  increment = (column > 0) ? -1 : 0;
++		  break;
++
++		case L'\r':
++		  increment = -1 * column;
++		  break;
++
++		case L'\t':
++		  increment = 8 - column % 8;
++		  break;
++
++		default:
++		  increment = wcwidth (wc);
++		  increment = (increment < 0) ? 0 : increment;
++		}
++	    }
++	}
++
++      if (column + increment > width && break_spaces && last_blank_pos)
++	{
++	  fwrite (line_out, sizeof(char), last_blank_pos, stdout);
++	  putchar ('\n');
++
++	  offset_out = offset_out - last_blank_pos;
++	  column = column - last_blank_column + ((is_cr_after_last_blank)
++	      ? last_blank_increment : bs_following_last_blank_num);
++	  memmove (line_out, line_out + last_blank_pos, offset_out);
++	  CLEAR_FLAGS;
++	  goto rescan;
++	}
++
++      if (column + increment > width && column != 0)
++	{
++	  fwrite (line_out, sizeof(char), offset_out, stdout);
++	  START_NEW_LINE;
++	  goto rescan;
++	}
++
++      if (allocated_out < offset_out + mblength)
++	{
++	  allocated_out += 1024;
++	  line_out = xrealloc (line_out, allocated_out);
++	}
++
++      memcpy (line_out + offset_out, bufpos, mblength);
++      offset_out += mblength;
++      column += increment;
++
++      if (is_blank_seen && !convfail && wc == L'\r')
++	is_cr_after_last_blank = 1;
++
++      if (is_bs_following_last_blank && !convfail && wc == L'\b')
++	++bs_following_last_blank_num;
++      else
++	is_bs_following_last_blank = 0;
++
++      if (break_spaces && !convfail && iswblank (wc))
++	{
++	  last_blank_pos = offset_out;
++	  last_blank_column = column;
++	  is_blank_seen = 1;
++	  last_blank_increment = increment;
++	  is_bs_following_last_blank = 1;
++	  bs_following_last_blank_num = 0;
++	  is_cr_after_last_blank = 0;
++	}
++    }
++
++  *saved_errno = errno;
+ 
+   if (offset_out)
+     fwrite (line_out, sizeof (char), (size_t) offset_out, stdout);
+ 
++  free(line_out);
++}
++#endif
++
++/* Fold file FILENAME, or standard input if FILENAME is "-",
++   to stdout, with maximum line length WIDTH.
++   Return 0 if successful, 1 if an error occurs. */
++
++static bool
++fold_file (char *filename, size_t width)
++{
++  FILE *istream;
++  int saved_errno;
++
++  if (STREQ (filename, "-"))
++    {
++      istream = stdin;
++      have_read_stdin = 1;
++    }
++  else
++    istream = fopen (filename, "r");
++
++  if (istream == NULL)
++    {
++      error (0, errno, "%s", filename);
++      return 1;
++    }
++
++  /* Define how ISTREAM is being folded. */
++#if HAVE_MBRTOWC
++  if (MB_CUR_MAX > 1)
++    fold_multibyte_text (istream, width, &saved_errno);
++  else
++#endif
++    fold_text (istream, width, &saved_errno);
++
+   if (ferror (istream))
+     {
+       error (0, saved_errno, "%s", filename);
+@@ -255,7 +506,8 @@
+ 
+   atexit (close_stdout);
+ 
+-  break_spaces = count_bytes = have_read_stdin = false;
++  operating_mode = column_mode;
++  break_spaces = have_read_stdin = false;
+ 
+   while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
+     {
+@@ -264,7 +516,15 @@
+       switch (optc)
+ 	{
+ 	case 'b':		/* Count bytes rather than columns. */
+-	  count_bytes = true;
++	  if (operating_mode != column_mode)
++	    FATAL_ERROR (_("only one way of folding may be specified"));
++	  operating_mode = byte_mode;
++	  break;
++
++	case 'c':
++	  if (operating_mode != column_mode)
++	    FATAL_ERROR (_("only one way of folding may be specified"));
++	  operating_mode = character_mode;
+ 	  break;
+ 
+ 	case 's':		/* Break at word boundaries. */
+--- coreutils-6.8+/src/sort.c.i18n	2007-02-24 11:23:23.000000000 +0000
++++ coreutils-6.8+/src/sort.c	2007-03-01 15:10:57.000000000 +0000
+@@ -23,10 +23,19 @@
+ 
+ #include <config.h>
+ 
++#include <assert.h>
+ #include <getopt.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <signal.h>
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++/* Get isw* functions. */
++#if HAVE_WCTYPE_H
++# include <wctype.h>
++#endif
++
+ #include "system.h"
+ #include "argmatch.h"
+ #include "error.h"
+@@ -116,14 +125,38 @@
+ /* Thousands separator; if -1, then there isn't one.  */
+ static int thousands_sep;
+ 
++static int force_general_numcompare = 0;
++
+ /* Nonzero if the corresponding locales are hard.  */
+ static bool hard_LC_COLLATE;
+-#if HAVE_NL_LANGINFO
++#if HAVE_LANGINFO_CODESET
+ static bool hard_LC_TIME;
+ #endif
+ 
+ #define NONZERO(x) ((x) != 0)
+ 
++/* get a multibyte character's byte length. */
++#define GET_BYTELEN_OF_CHAR(LIM, PTR, MBLENGTH, STATE)			\
++  do									\
++    {									\
++      wchar_t wc;							\
++      mbstate_t state_bak;						\
++									\
++      state_bak = STATE;						\
++      mblength = mbrtowc (&wc, PTR, LIM - PTR, &STATE);			\
++									\
++      switch (MBLENGTH)							\
++	{								\
++	case (size_t)-1:						\
++	case (size_t)-2:						\
++	  STATE = state_bak;						\
++		/* Fall through. */					\
++	case 0:								\
++	  MBLENGTH = 1;							\
++      }									\
++    }									\
++  while (0)
++
+ /* The kind of blanks for '-b' to skip in various options. */
+ enum blanktype { bl_start, bl_end, bl_both };
+ 
+@@ -261,13 +294,11 @@
+    they were read if all keys compare equal.  */
+ static bool stable;
+ 
+-/* If TAB has this value, blanks separate fields.  */
+-enum { TAB_DEFAULT = CHAR_MAX + 1 };
+-
+-/* Tab character separating fields.  If TAB_DEFAULT, then fields are
++/* Tab character separating fields.  If tab_length is 0, then fields are
+    separated by the empty string between a non-blank character and a blank
+    character. */
+-static int tab = TAB_DEFAULT;
++static char tab[MB_LEN_MAX + 1];
++static size_t tab_length = 0;
+ 
+ /* Flag to remove consecutive duplicate lines from the output.
+    Only the last of a sequence of equal lines will be output. */
+@@ -639,6 +670,44 @@
+     update_proc (pid);
+ }
+ 
++/* Function pointers. */
++static void
++(*inittables) (void);
++static char *
++(*begfield) (const struct line*, const struct keyfield *);
++static char *
++(*limfield) (const struct line*, const struct keyfield *);
++static int
++(*getmonth) (char const *, size_t);
++static int
++(*keycompare) (const struct line *, const struct line *);
++static int
++(*numcompare) (const char *, const char *);
++
++/* Test for white space multibyte character.
++   Set LENGTH the byte length of investigated multibyte character. */
++#if HAVE_MBRTOWC
++static int
++ismbblank (const char *str, size_t len, size_t *length)
++{
++  size_t mblength;
++  wchar_t wc;
++  mbstate_t state;
++
++  memset (&state, '\0', sizeof(mbstate_t));
++  mblength = mbrtowc (&wc, str, len, &state);
++
++  if (mblength == (size_t)-1 || mblength == (size_t)-2)
++    {
++      *length = 1;
++      return 0;
++    }
++
++  *length = (mblength < 1) ? 1 : mblength;
++  return iswblank (wc);
++}
++#endif
++
+ /* Clean up any remaining temporary files.  */
+ 
+ static void
+@@ -978,7 +1047,7 @@
+   free (node);
+ }
+ 
+-#if HAVE_NL_LANGINFO
++#if HAVE_LANGINFO_CODESET
+ 
+ static int
+ struct_month_cmp (const void *m1, const void *m2)
+@@ -993,7 +1062,7 @@
+ /* Initialize the character class tables. */
+ 
+ static void
+-inittables (void)
++inittables_uni (void)
+ {
+   size_t i;
+ 
+@@ -1005,7 +1074,7 @@
+       fold_toupper[i] = toupper (i);
+     }
+ 
+-#if HAVE_NL_LANGINFO
++#if HAVE_LANGINFO_CODESET
+   /* If we're not in the "C" locale, read different names for months.  */
+   if (hard_LC_TIME)
+     {
+@@ -1031,6 +1100,64 @@
+ #endif
+ }
+ 
++#if HAVE_MBRTOWC
++static void
++inittables_mb (void)
++{
++  int i, j, k, l;
++  char *name, *s;
++  size_t s_len, mblength;
++  char mbc[MB_LEN_MAX];
++  wchar_t wc, pwc;
++  mbstate_t state_mb, state_wc;
++
++  for (i = 0; i < MONTHS_PER_YEAR; i++)
++    {
++      s = (char *) nl_langinfo (ABMON_1 + i);
++      s_len = strlen (s);
++      monthtab[i].name = name = (char *) xmalloc (s_len + 1);
++      monthtab[i].val = i + 1;
++
++      memset (&state_mb, '\0', sizeof (mbstate_t));
++      memset (&state_wc, '\0', sizeof (mbstate_t));
++
++      for (j = 0; j < s_len;)
++	{
++	  if (!ismbblank (s + j, s_len - j, &mblength))
++	    break;
++	  j += mblength;
++	}
++
++      for (k = 0; j < s_len;)
++	{
++	  mblength = mbrtowc (&wc, (s + j), (s_len - j), &state_mb);
++	  assert (mblength != (size_t)-1 && mblength != (size_t)-2);
++	  if (mblength == 0)
++	    break;
++
++	  pwc = towupper (wc);
++	  if (pwc == wc)
++	    {
++	      memcpy (mbc, s + j, mblength);
++	      j += mblength;
++	    }
++	  else
++	    {
++	      j += mblength;
++	      mblength = wcrtomb (mbc, pwc, &state_wc);
++	      assert (mblength != (size_t)0 && mblength != (size_t)-1);
++	    }
++
++	  for (l = 0; l < mblength; l++)
++	    name[k++] = mbc[l];
++	}
++      name[k] = '\0';
++    }
++  qsort ((void *) monthtab, MONTHS_PER_YEAR,
++      sizeof (struct month), struct_month_cmp);
++}
++#endif
++
+ /* Specify the amount of main memory to use when sorting.  */
+ static void
+ specify_sort_size (char const *s)
+@@ -1241,7 +1368,7 @@
+    by KEY in LINE. */
+ 
+ static char *
+-begfield (const struct line *line, const struct keyfield *key)
++begfield_uni (const struct line *line, const struct keyfield *key)
+ {
+   char *ptr = line->text, *lim = ptr + line->length - 1;
+   size_t sword = key->sword;
+@@ -1251,10 +1378,10 @@
+   /* The leading field separator itself is included in a field when -t
+      is absent.  */
+ 
+-  if (tab != TAB_DEFAULT)
++  if (tab_length)
+     while (ptr < lim && sword--)
+       {
+-	while (ptr < lim && *ptr != tab)
++	while (ptr < lim && *ptr != tab[0])
+ 	  ++ptr;
+ 	if (ptr < lim)
+ 	  ++ptr;
+@@ -1282,11 +1409,70 @@
+   return ptr;
+ }
+ 
++#if HAVE_MBRTOWC
++static char *
++begfield_mb (const struct line *line, const struct keyfield *key)
++{
++  int i;
++  char *ptr = line->text, *lim = ptr + line->length - 1;
++  size_t sword = key->sword;
++  size_t schar = key->schar;
++  size_t mblength;
++  mbstate_t state;
++
++  memset (&state, '\0', sizeof(mbstate_t));
++
++  if (tab_length)
++    while (ptr < lim && sword--)
++      {
++	while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
++	  {
++	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++	    ptr += mblength;
++	  }
++	if (ptr < lim)
++	  {
++	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++	    ptr += mblength;
++	  }
++      }
++  else
++    while (ptr < lim && sword--)
++      {
++	while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
++	  ptr += mblength;
++	if (ptr < lim)
++	  {
++	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++	    ptr += mblength;
++	  }
++	while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
++	  ptr += mblength;
++      }
++
++  if (key->skipsblanks)
++    while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
++      ptr += mblength;
++
++  for (i = 0; i < schar; i++)
++    {
++      GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++
++      if (ptr + mblength > lim)
++	break;
++      else
++	ptr += mblength;
++    }
++
++  return ptr;
++}
++#endif
++
+ /* Return the limit of (a pointer to the first character after) the field
+    in LINE specified by KEY. */
+ 
+ static char *
+-limfield (const struct line *line, const struct keyfield *key)
++limfield_uni (const struct line *line, const struct keyfield *key)
+ {
+   char *ptr = line->text, *lim = ptr + line->length - 1;
+   size_t eword = key->eword, echar = key->echar;
+@@ -1299,10 +1485,10 @@
+      `beginning' is the first character following the delimiting TAB.
+      Otherwise, leave PTR pointing at the first `blank' character after
+      the preceding field.  */
+-  if (tab != TAB_DEFAULT)
++  if (tab_length)
+     while (ptr < lim && eword--)
+       {
+-	while (ptr < lim && *ptr != tab)
++	while (ptr < lim && *ptr != tab[0])
+ 	  ++ptr;
+ 	if (ptr < lim && (eword | echar))
+ 	  ++ptr;
+@@ -1348,10 +1534,10 @@
+      */
+ 
+   /* Make LIM point to the end of (one byte past) the current field.  */
+-  if (tab != TAB_DEFAULT)
++  if (tab_length)
+     {
+       char *newlim;
+-      newlim = memchr (ptr, tab, lim - ptr);
++      newlim = memchr (ptr, tab[0], lim - ptr);
+       if (newlim)
+ 	lim = newlim;
+     }
+@@ -1384,6 +1570,107 @@
+   return ptr;
+ }
+ 
++#if HAVE_MBRTOWC
++static char *
++limfield_mb (const struct line *line, const struct keyfield *key)
++{
++  char *ptr = line->text, *lim = ptr + line->length - 1;
++  size_t eword = key->eword, echar = key->echar;
++  int i;
++  size_t mblength;
++  mbstate_t state;
++
++  memset (&state, '\0', sizeof(mbstate_t));
++
++  if (tab_length)
++    while (ptr < lim && eword--)
++      {
++	while (ptr < lim && memcmp (ptr, tab, tab_length) != 0)
++	  {
++	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++	    ptr += mblength;
++	  }
++	if (ptr < lim && (eword | echar))
++	  {
++	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++	    ptr += mblength;
++	  }
++      }
++  else
++    while (ptr < lim && eword--)
++      {
++	while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
++	  ptr += mblength;
++	if (ptr < lim)
++	  {
++	    GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++	    ptr += mblength;
++	  }
++	while (ptr < lim && !ismbblank (ptr, lim - ptr, &mblength))
++	  ptr += mblength;
++      }
++
++
++# ifdef POSIX_UNSPECIFIED
++  /* Make LIM point to the end of (one byte past) the current field.  */
++  if (tab_length)
++    {
++      char *newlim, *p;
++
++      newlim = NULL;
++      for (p = ptr; p < lim;)
++ 	{
++	  if (memcmp (p, tab, tab_length) == 0)
++	    {
++	      newlim = p;
++	      break;
++	    }
++
++	  GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++	  p += mblength;
++	}
++    }
++  else
++    {
++      char *newlim;
++      newlim = ptr;
++
++      while (newlim < lim && ismbblank (newlim, lim - newlim, &mblength))
++	newlim += mblength;
++      if (ptr < lim)
++	{
++	  GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++	  ptr += mblength;
++	}
++      while (newlim < lim && !ismbblank (newlim, lim - newlim, &mblength))
++	newlim += mblength;
++      lim = newlim;
++    }
++# endif
++
++  /* If we're skipping leading blanks, don't start counting characters
++   *      until after skipping past any leading blanks.  */
++  if (key->skipsblanks)
++    while (ptr < lim && ismbblank (ptr, lim - ptr, &mblength))
++      ptr += mblength;
++
++  memset (&state, '\0', sizeof(mbstate_t));
++
++  /* Advance PTR by ECHAR (if possible), but no further than LIM.  */
++  for (i = 0; i < echar; i++)
++    {
++      GET_BYTELEN_OF_CHAR (lim, ptr, mblength, state);
++
++      if (ptr + mblength > lim)
++	break;
++      else
++	ptr += mblength;
++    }
++
++  return ptr;
++}
++#endif
++
+ /* Fill BUF reading from FP, moving buf->left bytes from the end
+    of buf->buf to the beginning first.  If EOF is reached and the
+    file wasn't terminated by a newline, supply one.  Set up BUF's line
+@@ -1466,8 +1753,24 @@
+ 		  else
+ 		    {
+ 		      if (key->skipsblanks)
+-			while (blanks[to_uchar (*line_start)])
+-			  line_start++;
++			{
++#if HAVE_MBRTOWC
++			  if (MB_CUR_MAX > 1)
++			    {
++			      size_t mblength;
++			      mbstate_t state;
++			      memset (&state, '\0', sizeof(mbstate_t));
++			      while (line_start < line->keylim &&
++				     ismbblank (line_start,
++						line->keylim - line_start,
++						&mblength))
++				line_start += mblength;
++			    }
++			  else
++#endif
++			  while (blanks[to_uchar (*line_start)])
++			    line_start++;
++			}
+ 		      line->keybeg = line_start;
+ 		    }
+ 		}
+@@ -1500,7 +1803,7 @@
+    hideously fast. */
+ 
+ static int
+-numcompare (const char *a, const char *b)
++numcompare_uni (const char *a, const char *b)
+ {
+   while (blanks[to_uchar (*a)])
+     a++;
+@@ -1510,6 +1813,25 @@
+   return strnumcmp (a, b, decimal_point, thousands_sep);
+ }
+ 
++#if HAVE_MBRTOWC
++static int
++numcompare_mb (const char *a, const char *b)
++{
++  size_t mblength, len;
++  len = strlen (a); /* okay for UTF-8 */
++  while (*a && ismbblank (a, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
++    {
++      a += mblength;
++      len -= mblength;
++    }
++  len = strlen (b); /* okay for UTF-8 */
++  while (*b && ismbblank (b, len > MB_CUR_MAX ? MB_CUR_MAX : len, &mblength))
++    b += mblength;
++
++  return strnumcmp (a, b, decimal_point, thousands_sep);
++}
++#endif /* HAV_EMBRTOWC */
++
+ static int
+ general_numcompare (const char *sa, const char *sb)
+ {
+@@ -1543,7 +1865,7 @@
+    Return 0 if the name in S is not recognized.  */
+ 
+ static int
+-getmonth (char const *month, size_t len)
++getmonth_uni (char const *month, size_t len)
+ {
+   size_t lo = 0;
+   size_t hi = MONTHS_PER_YEAR;
+@@ -1698,11 +2020,79 @@
+   return diff;
+ }
+ 
++#if HAVE_MBRTOWC
++static int
++getmonth_mb (const char *s, size_t len)
++{
++  char *month;
++  register size_t i;
++  register int lo = 0, hi = MONTHS_PER_YEAR, result;
++  char *tmp;
++  size_t wclength, mblength;
++  const char **pp;
++  const wchar_t **wpp;
++  wchar_t *month_wcs;
++  mbstate_t state;
++
++  while (len > 0 && ismbblank (s, len, &mblength))
++    {
++      s += mblength;
++      len -= mblength;
++    }
++
++  if (len == 0)
++    return 0;
++
++  month = (char *) alloca (len + 1);
++
++  tmp = (char *) alloca (len + 1);
++  memcpy (tmp, s, len);
++  tmp[len] = '\0';
++  pp = (const char **)&tmp;
++  month_wcs = (wchar_t *) alloca ((len + 1) * sizeof (wchar_t));
++  memset (&state, '\0', sizeof(mbstate_t));
++
++  wclength = mbsrtowcs (month_wcs, pp, len + 1, &state);
++  assert (wclength != (size_t)-1 && *pp == NULL);
++
++  for (i = 0; i < wclength; i++)
++    {
++      month_wcs[i] = towupper(month_wcs[i]);
++      if (iswblank (month_wcs[i]))
++	{
++	  month_wcs[i] = L'\0';
++	  break;
++	}
++    }
++
++  wpp = (const wchar_t **)&month_wcs;
++
++  mblength = wcsrtombs (month, wpp, len + 1, &state);
++  assert (mblength != (-1) && *wpp == NULL);
++
++  do
++    {
++      int ix = (lo + hi) / 2;
++
++      if (strncmp (month, monthtab[ix].name, strlen (monthtab[ix].name)) < 0)
++	hi = ix;
++      else
++	lo = ix;
++    }
++  while (hi - lo > 1);
++
++  result = (!strncmp (month, monthtab[lo].name, strlen (monthtab[lo].name))
++      ? monthtab[lo].val : 0);
++
++  return result;
++}
++#endif
++
+ /* Compare two lines A and B trying every key in sequence until there
+    are no more keys or a difference is found. */
+ 
+ static int
+-keycompare (const struct line *a, const struct line *b)
++keycompare_uni (const struct line *a, const struct line *b)
+ {
+   struct keyfield const *key = keylist;
+ 
+@@ -1875,6 +2265,179 @@
+   return key->reverse ? -diff : diff;
+ }
+ 
++#if HAVE_MBRTOWC
++static int
++keycompare_mb (const struct line *a, const struct line *b)
++{
++  struct keyfield *key = keylist;
++
++  /* For the first iteration only, the key positions have been
++     precomputed for us. */
++  char *texta = a->keybeg;
++  char *textb = b->keybeg;
++  char *lima = a->keylim;
++  char *limb = b->keylim;
++
++  size_t mblength_a, mblength_b;
++  wchar_t wc_a, wc_b;
++  mbstate_t state_a, state_b;
++
++  int diff;
++
++  memset (&state_a, '\0', sizeof(mbstate_t));
++  memset (&state_b, '\0', sizeof(mbstate_t));
++
++  for (;;)
++    {
++      unsigned char *translate = (unsigned char *) key->translate;
++      bool const *ignore = key->ignore;
++
++      /* Find the lengths. */
++      size_t lena = lima <= texta ? 0 : lima - texta;
++      size_t lenb = limb <= textb ? 0 : limb - textb;
++
++      /* Actually compare the fields. */
++      if (key->random)
++        diff = compare_random (texta, lena, textb, lenb);
++      else if (key->numeric | key->general_numeric)
++	{
++	  char savea = *lima, saveb = *limb;
++
++	  *lima = *limb = '\0';
++	  if (force_general_numcompare)
++	    diff = general_numcompare (texta, textb);
++	  else
++	    diff = ((key->numeric ? numcompare : general_numcompare)
++		(texta, textb));
++	  *lima = savea, *limb = saveb;
++	}
++      else if (key->month)
++	diff = getmonth (texta, lena) - getmonth (textb, lenb);
++      else
++	{
++	  if (ignore || translate)
++	    {
++	      char *copy_a = (char *) alloca (lena + 1 + lenb + 1);
++	      char *copy_b = copy_a + lena + 1;
++	      size_t new_len_a, new_len_b;
++	      size_t i, j;
++
++	      /* Ignore and/or translate chars before comparing.  */
++# define IGNORE_CHARS(NEW_LEN, LEN, TEXT, COPY, WC, MBLENGTH, STATE)	\
++  do									\
++    {									\
++      wchar_t uwc;							\
++      char mbc[MB_LEN_MAX];						\
++      mbstate_t state_wc;						\
++									\
++      for (NEW_LEN = i = 0; i < LEN;)					\
++	{								\
++	  mbstate_t state_bak;						\
++									\
++	  state_bak = STATE;						\
++	  MBLENGTH = mbrtowc (&WC, TEXT + i, LEN - i, &STATE);		\
++									\
++	  if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1		\
++	      || MBLENGTH == 0)						\
++	    {								\
++	      if (MBLENGTH == (size_t)-2 || MBLENGTH == (size_t)-1)	\
++		STATE = state_bak;					\
++	      if (!ignore)						\
++		COPY[NEW_LEN++] = TEXT[i++];				\
++	      continue;							\
++	    }								\
++									\
++	  if (ignore)							\
++	    {								\
++	      if ((ignore == nonprinting && !iswprint (WC))		\
++		   || (ignore == nondictionary				\
++		       && !iswalnum (WC) && !iswblank (WC)))		\
++		{							\
++		  i += MBLENGTH;					\
++		  continue;						\
++		}							\
++	    }								\
++									\
++	  if (translate)						\
++	    {								\
++									\
++	      uwc = towupper(WC);					\
++	      if (WC == uwc)						\
++		{							\
++		  memcpy (mbc, TEXT + i, MBLENGTH);			\
++		  i += MBLENGTH;					\
++		}							\
++	      else							\
++		{							\
++		  i += MBLENGTH;					\
++		  WC = uwc;						\
++		  memset (&state_wc, '\0', sizeof (mbstate_t));		\
++									\
++		  MBLENGTH = wcrtomb (mbc, WC, &state_wc);		\
++		  assert (MBLENGTH != (size_t)-1 && MBLENGTH != 0);	\
++		}							\
++									\
++	      for (j = 0; j < MBLENGTH; j++)				\
++		COPY[NEW_LEN++] = mbc[j];				\
++	    }								\
++	  else								\
++	    for (j = 0; j < MBLENGTH; j++)				\
++	      COPY[NEW_LEN++] = TEXT[i++];				\
++	}								\
++      COPY[NEW_LEN] = '\0';						\
++    }									\
++  while (0)
++	      IGNORE_CHARS (new_len_a, lena, texta, copy_a,
++			    wc_a, mblength_a, state_a);
++	      IGNORE_CHARS (new_len_b, lenb, textb, copy_b,
++			    wc_b, mblength_b, state_b);
++	      diff = xmemcoll (copy_a, new_len_a, copy_b, new_len_b);
++	    }
++	  else if (lena == 0)
++	    diff = - NONZERO (lenb);
++	  else if (lenb == 0)
++	    goto greater;
++	  else
++	    diff = xmemcoll (texta, lena, textb, lenb);
++	}
++
++      if (diff)
++	goto not_equal;
++
++      key = key->next;
++      if (! key)
++	break;
++
++      /* Find the beginning and limit of the next field.  */
++      if (key->eword != -1)
++	lima = limfield (a, key), limb = limfield (b, key);
++      else
++	lima = a->text + a->length - 1, limb = b->text + b->length - 1;
++
++      if (key->sword != -1)
++	texta = begfield (a, key), textb = begfield (b, key);
++      else
++	{
++	  texta = a->text, textb = b->text;
++	  if (key->skipsblanks)
++	    {
++	      while (texta < lima && ismbblank (texta, lima - texta, &mblength_a))
++		texta += mblength_a;
++	      while (textb < limb && ismbblank (textb, limb - textb, &mblength_b))
++		textb += mblength_b;
++	    }
++	}
++    }
++
++  return 0;
++
++greater:
++  diff = 1;
++not_equal:
++  return key->reverse ? -diff : diff;
++}
++#endif
++
+ /* Compare two lines A and B, returning negative, zero, or positive
+    depending on whether A compares less than, equal to, or greater than B. */
+
+@@ -2744,7 +3305,7 @@
+   initialize_exit_failure (SORT_FAILURE);
+ 
+   hard_LC_COLLATE = hard_locale (LC_COLLATE);
+-#if HAVE_NL_LANGINFO
++#if HAVE_LANGINFO_CODESET
+   hard_LC_TIME = hard_locale (LC_TIME);
+ #endif
+ 
+@@ -2765,6 +3326,27 @@
+       thousands_sep = -1;
+   }
+ 
++#if HAVE_MBRTOWC
++  if (MB_CUR_MAX > 1)
++    {
++      inittables = inittables_mb;
++      begfield = begfield_mb;
++      limfield = limfield_mb;
++      getmonth = getmonth_mb;
++      keycompare = keycompare_mb;
++      numcompare = numcompare_mb;
++    }
++  else
++#endif
++    {
++      inittables = inittables_uni;
++      begfield = begfield_uni;
++      limfield = limfield_uni;
++      getmonth = getmonth_uni;
++      keycompare = keycompare_uni;
++      numcompare = numcompare_uni;
++    }
++
+   have_read_stdin = false;
+   inittables ();
+ 
+@@ -3015,13 +3597,35 @@
+ 
+ 	case 't':
+ 	  {
+-	    char newtab = optarg[0];
+-	    if (! newtab)
++	    char newtab[MB_LEN_MAX + 1];
++	    size_t newtab_length = 1;
++	    strncpy (newtab, optarg, MB_LEN_MAX);
++	    if (! newtab[0])
+ 	      error (SORT_FAILURE, 0, _("empty tab"));
+-	    if (optarg[1])
++#if HAVE_MBRTOWC
++	    if (MB_CUR_MAX > 1)
++	      {
++		wchar_t wc;
++		mbstate_t state;
++		size_t i;
++
++		memset (&state, '\0', sizeof (mbstate_t));
++		newtab_length = mbrtowc (&wc, newtab, strnlen (newtab,
++							       MB_LEN_MAX),
++					 &state);
++		switch (newtab_length)
++		  {
++		  case (size_t) -1:
++		  case (size_t) -2:
++		  case 0:
++		    newtab_length = 1;
++		  }
++	      }
++#endif
++	    if (newtab_length == 1 && optarg[1])
+ 	      {
+ 		if (STREQ (optarg, "\\0"))
+-		  newtab = '\0';
++		  newtab[0] = '\0';
+ 		else
+ 		  {
+ 		    /* Provoke with `sort -txx'.  Complain about
+@@ -3032,9 +3636,12 @@
+ 			   quote (optarg));
+ 		  }
+ 	      }
+-	    if (tab != TAB_DEFAULT && tab != newtab)
++	    if (tab_length
++		&& (tab_length != newtab_length
++		    || memcmp (tab, newtab, tab_length) != 0))
+ 	      error (SORT_FAILURE, 0, _("incompatible tabs"));
+-	    tab = newtab;
++	    memcpy (tab, newtab, newtab_length);
++	    tab_length = newtab_length;
+ 	  }
+ 	  break;
+ 
+--- coreutils-6.8+/src/unexpand.c.i18n	2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/unexpand.c	2007-03-01 15:08:24.000000000 +0000
+@@ -39,11 +39,28 @@
+ #include <stdio.h>
+ #include <getopt.h>
+ #include <sys/types.h>
++
++/* Get mbstate_t, mbrtowc(), wcwidth(). */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
+ #include "system.h"
+ #include "error.h"
+ #include "quote.h"
+ #include "xstrndup.h"
+ 
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++      installation; work around this configuration error.  */
++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
++# define MB_LEN_MAX 16
++#endif
++
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ /* The official name of this program (e.g., no `g' prefix).  */
+ #define PROGRAM_NAME "unexpand"
+ 
+@@ -110,6 +127,208 @@
+   {NULL, 0, NULL, 0}
+ };
+ 
++static FILE *next_file (FILE *fp);
++
++#if HAVE_MBRTOWC
++static void
++unexpand_multibyte (void)
++{
++  FILE *fp;			/* Input stream. */
++  mbstate_t i_state;		/* Current shift state of the input stream. */
++  mbstate_t i_state_bak;	/* Back up the I_STATE. */
++  mbstate_t o_state;		/* Current shift state of the output stream. */
++  char buf[MB_LEN_MAX + BUFSIZ];  /* For spooling a read byte sequence. */
++  char *bufpos;			/* Next read position of BUF. */
++  size_t buflen = 0;		/* The length of the byte sequence in buf. */
++  wint_t wc;			/* A gotten wide character. */
++  size_t mblength;		/* The byte size of a multibyte character
++				   which shows as same character as WC. */
++
++  /* Index in `tab_list' of next tabstop: */
++  int tab_index = 0;		/* For calculating width of pending tabs. */
++  int print_tab_index = 0;	/* For printing as many tabs as possible. */
++  unsigned int column = 0;	/* Column on screen of next char. */
++  int next_tab_column;		/* Column the next tab stop is on. */
++  int convert = 1;		/* If nonzero, perform translations. */
++  unsigned int pending = 0;	/* Pending columns of blanks. */
++
++  fp = next_file ((FILE *) NULL);
++  if (fp == NULL)
++    return;
++
++  memset (&o_state, '\0', sizeof(mbstate_t));
++  memset (&i_state, '\0', sizeof(mbstate_t));
++
++  for (;;)
++    {
++      if (buflen < MB_LEN_MAX && !feof(fp) && !ferror(fp))
++	{
++	  memmove (buf, bufpos, buflen);
++	  buflen += fread (buf + buflen, sizeof(char), BUFSIZ, fp);
++	  bufpos = buf;
++	}
++
++      /* Get a wide character. */
++      if (buflen < 1)
++	{
++	  mblength = 1;
++	  wc = WEOF;
++	}
++      else
++	{
++	  i_state_bak = i_state;
++	  mblength = mbrtowc ((wchar_t *)&wc, bufpos, buflen, &i_state);
++	}
++
++      if (mblength == (size_t)-1 || mblength == (size_t)-2)
++	{
++	  i_state = i_state_bak;
++	  wc = L'\0';
++	}
++
++      if (wc == L' ' && convert && column < INT_MAX)
++	{
++	  ++pending;
++	  ++column;
++	}
++      else if (wc == L'\t' && convert)
++	{
++	  if (tab_size == 0)
++	    {
++	      /* Do not let tab_index == first_free_tab;
++		 stop when it is 1 less. */
++	      while (tab_index < first_free_tab - 1
++		  && column >= tab_list[tab_index])
++		tab_index++;
++	      next_tab_column = tab_list[tab_index];
++	      if (tab_index < first_free_tab - 1)
++		tab_index++;
++	      if (column >= next_tab_column)
++		{
++		  convert = 0;	/* Ran out of tab stops. */
++		  goto flush_pend_mb;
++		}
++	    }
++	  else
++	    {
++	      next_tab_column = column + tab_size - column % tab_size;
++	    }
++	  pending += next_tab_column - column;
++	  column = next_tab_column;
++	}
++      else
++	{
++flush_pend_mb:
++	  /* Flush pending spaces.  Print as many tabs as possible,
++	     then print the rest as spaces. */
++	  if (pending == 1)
++	    {
++	      putchar (' ');
++	      pending = 0;
++	    }
++	  column -= pending;
++	  while (pending > 0)
++	    {
++	      if (tab_size == 0)
++		{
++		  /* Do not let print_tab_index == first_free_tab;
++		     stop when it is 1 less. */
++		  while (print_tab_index < first_free_tab - 1
++		      && column >= tab_list[print_tab_index])
++		    print_tab_index++;
++		  next_tab_column = tab_list[print_tab_index];
++		  if (print_tab_index < first_free_tab - 1)
++		    print_tab_index++;
++		}
++	      else
++		{
++		  next_tab_column =
++		    column + tab_size - column % tab_size;
++		}
++	      if (next_tab_column - column <= pending)
++		{
++		  putchar ('\t');
++		  pending -= next_tab_column - column;
++		  column = next_tab_column;
++		}
++	      else
++		{
++		  --print_tab_index;
++		  column += pending;
++		  while (pending != 0)
++		    {
++		      putchar (' ');
++		      pending--;
++		    }
++		}
++	    }
++
++	  if (wc == WEOF)
++	    {
++	      fp = next_file (fp);
++	      if (fp == NULL)
++		break;          /* No more files. */
++	      else
++		{
++		  memset (&i_state, '\0', sizeof(mbstate_t));
++		  continue;
++		}
++	    }
++
++	  if (mblength == (size_t)-1 || mblength == (size_t)-2)
++	    {
++	      if (convert)
++		{
++		  ++column;
++		  if (convert_entire_line == 0)
++		    convert = 0;
++		}
++	      mblength = 1;
++	      putchar (buf[0]);
++	    }
++	  else if (mblength == 0)
++	    {
++	      if (convert && convert_entire_line == 0)
++		convert = 0;
++	      mblength = 1;
++	      putchar ('\0');
++	    }
++	  else
++	    {
++	      if (convert)
++		{
++		  if (wc == L'\b')
++		    {
++		      if (column > 0)
++			--column;
++		    }
++		  else
++		    {
++		      int width;            /* The width of WC. */
++
++		      width = wcwidth (wc);
++		      column += (width > 0) ? width : 0;
++		      if (convert_entire_line == 0)
++			convert = 0;
++		    }
++		}
++
++	      if (wc == L'\n')
++		{
++		  tab_index = print_tab_index = 0;
++		  column = pending = 0;
++		  convert = 1;
++		}
++	      fwrite (bufpos, sizeof(char), mblength, stdout);
++	    }
++	}
++      buflen -= mblength;
++      bufpos += mblength;
++    }
++}
++#endif
++
++
+ void
+ usage (int status)
+ {
+@@ -531,7 +750,12 @@
+ 
+   file_list = (optind < argc ? &argv[optind] : stdin_argv);
+ 
+-  unexpand ();
++#if HAVE_MBRTOWC
++  if (MB_CUR_MAX > 1)
++    unexpand_multibyte ();
++  else
++#endif
++    unexpand ();
+ 
+   if (have_read_stdin && fclose (stdin) != 0)
+     error (EXIT_FAILURE, errno, "-");
+--- coreutils-6.8+/src/pr.c.i18n	2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/pr.c	2007-03-01 15:08:24.000000000 +0000
+@@ -313,6 +313,32 @@
+ 
+ #include <getopt.h>
+ #include <sys/types.h>
++
++/* Get MB_LEN_MAX.  */
++#include <limits.h>
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++   installation; work around this configuration error.  */
++#if !defined MB_LEN_MAX || MB_LEN_MAX == 1
++# define MB_LEN_MAX 16
++#endif
++
++/* Get MB_CUR_MAX.  */
++#include <stdlib.h>
++
++/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
++/* Get mbstate_t, mbrtowc(), wcwidth().  */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
++
++/* Get iswprint(). -- for wcwidth().  */
++#if HAVE_WCTYPE_H
++# include <wctype.h>
++#endif
++#if !defined iswprint && !HAVE_ISWPRINT
++# define iswprint(wc) 1
++#endif
++
+ #include "system.h"
+ #include "error.h"
+ #include "hard-locale.h"
+@@ -324,6 +350,18 @@
+ #include "strftime.h"
+ #include "xstrtol.h"
+ 
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
++#ifndef HAVE_DECL_WCWIDTH
++"this configure-time declaration test was not run"
++#endif
++#if !HAVE_DECL_WCWIDTH
++extern int wcwidth ();
++#endif
++
+ /* The official name of this program (e.g., no `g' prefix).  */
+ #define PROGRAM_NAME "pr"
+ 
+@@ -416,7 +454,20 @@
+ 
+ #define NULLCOL (COLUMN *)0
+ 
+-static int char_to_clump (char c);
++/* Funtion pointers to switch functions for single byte locale or for
++   multibyte locale. If multibyte functions do not exist in your sysytem,
++   these pointers always point the function for single byte locale. */
++static void (*print_char) (char c);
++static int (*char_to_clump) (char c);
++
++/* Functions for single byte locale. */
++static void print_char_single (char c);
++static int char_to_clump_single (char c);
++
++/* Functions for multibyte locale. */
++static void print_char_multi (char c);
++static int char_to_clump_multi (char c);
++
+ static bool read_line (COLUMN *p);
+ static bool print_page (void);
+ static bool print_stored (COLUMN *p);
+@@ -426,6 +477,7 @@
+ static void pad_across_to (int position);
+ static void add_line_number (COLUMN *p);
+ static void getoptarg (char *arg, char switch_char, char *character,
++		       int *character_length, int *character_width,
+ 		       int *number);
+ void usage (int status);
+ static void print_files (int number_of_files, char **av);
+@@ -440,7 +492,6 @@
+ static void pad_down (int lines);
+ static void read_rest_of_line (COLUMN *p);
+ static void skip_read (COLUMN *p, int column_number);
+-static void print_char (char c);
+ static void cleanup (void);
+ static void print_sep_string (void);
+ static void separator_string (const char *optarg_S);
+@@ -455,7 +506,7 @@
+    we store the leftmost columns contiguously in buff.
+    To print a line from buff, get the index of the first character
+    from line_vector[i], and print up to line_vector[i + 1]. */
+-static char *buff;
++static unsigned char *buff;
+ 
+ /* Index of the position in buff where the next character
+    will be stored. */
+@@ -559,7 +610,7 @@
+ static bool untabify_input = false;
+ 
+ /* (-e) The input tab character. */
+-static char input_tab_char = '\t';
++static char input_tab_char[MB_LEN_MAX] = "\t";
+ 
+ /* (-e) Tabstops are at chars_per_tab, 2*chars_per_tab, 3*chars_per_tab, ...
+    where the leftmost column is 1. */
+@@ -569,7 +620,10 @@
+ static bool tabify_output = false;
+ 
+ /* (-i) The output tab character. */
+-static char output_tab_char = '\t';
++static char output_tab_char[MB_LEN_MAX] = "\t";
++
++/* (-i) The byte length of output tab character. */
++static int output_tab_char_length = 1;
+ 
+ /* (-i) The width of the output tab. */
+ static int chars_per_output_tab = 8;
+@@ -643,7 +697,13 @@
+ static bool numbered_lines = false;
+ 
+ /* (-n) Character which follows each line number. */
+-static char number_separator = '\t';
++static char number_separator[MB_LEN_MAX] = "\t";
++
++/* (-n) The byte length of the character which follows each line number. */
++static int number_separator_length = 1;
++
++/* (-n) The character width of the character which follows each line number. */
++static int number_separator_width = 0;
+ 
+ /* (-n) line counting starts with 1st line of input file (not with 1st
+    line of 1st page printed). */
+@@ -696,6 +756,7 @@
+    -a|COLUMN|-m is a `space' and with the -J option a `tab'. */
+ static char *col_sep_string = "";
+ static int col_sep_length = 0;
++static int col_sep_width = 0;
+ static char *column_separator = " ";
+ static char *line_separator = "\t";
+ 
+@@ -852,6 +913,13 @@
+   col_sep_length = (int) strlen (optarg_S);
+   col_sep_string = xmalloc (col_sep_length + 1);
+   strcpy (col_sep_string, optarg_S);
++
++#if HAVE_MBRTOWC
++  if (MB_CUR_MAX > 1)
++    col_sep_width = mbswidth (col_sep_string, 0);
++  else
++#endif
++    col_sep_width = col_sep_length;
+ }
+ 
+ int
+@@ -877,6 +945,21 @@
+ 
+   atexit (close_stdout);
+ 
++/* Define which functions are used, the ones for single byte locale or the ones
++   for multibyte locale. */
++#if HAVE_MBRTOWC
++  if (MB_CUR_MAX > 1)
++    {
++      print_char = print_char_multi;
++      char_to_clump = char_to_clump_multi;
++    }
++  else
++#endif
++    {
++      print_char = print_char_single;
++      char_to_clump = char_to_clump_single;
++    }
++
+   n_files = 0;
+   file_names = (argc > 1
+ 		? xmalloc ((argc - 1) * sizeof (char *))
+@@ -949,8 +1032,12 @@
+ 	  break;
+ 	case 'e':
+ 	  if (optarg)
+-	    getoptarg (optarg, 'e', &input_tab_char,
+-		       &chars_per_input_tab);
++	    {
++	      int dummy_length, dummy_width;
++
++	      getoptarg (optarg, 'e', input_tab_char, &dummy_length,
++			 &dummy_width, &chars_per_input_tab);
++	    }
+ 	  /* Could check tab width > 0. */
+ 	  untabify_input = true;
+ 	  break;
+@@ -963,8 +1050,12 @@
+ 	  break;
+ 	case 'i':
+ 	  if (optarg)
+-	    getoptarg (optarg, 'i', &output_tab_char,
+-		       &chars_per_output_tab);
++	    {
++	      int dummy_width;
++
++	      getoptarg (optarg, 'i', output_tab_char, &output_tab_char_length,
++			 &dummy_width, &chars_per_output_tab);
++	    }
+ 	  /* Could check tab width > 0. */
+ 	  tabify_output = true;
+ 	  break;
+@@ -991,8 +1082,8 @@
+ 	case 'n':
+ 	  numbered_lines = true;
+ 	  if (optarg)
+-	    getoptarg (optarg, 'n', &number_separator,
+-		       &chars_per_number);
++	    getoptarg (optarg, 'n', number_separator, &number_separator_length,
++		       &number_separator_width, &chars_per_number);
+ 	  break;
+ 	case 'N':
+ 	  skip_count = false;
+@@ -1031,7 +1122,7 @@
+ 	  old_s = false;
+ 	  /* Reset an additional input of -s, -S dominates -s */
+ 	  col_sep_string = "";
+-	  col_sep_length = 0;
++	  col_sep_length = col_sep_width = 0;
+ 	  use_col_separator = true;
+ 	  if (optarg)
+ 	    separator_string (optarg);
+@@ -1188,10 +1279,45 @@
+    a number. */
+ 
+ static void
+-getoptarg (char *arg, char switch_char, char *character, int *number)
++getoptarg (char *arg, char switch_char, char *character, int *character_length,
++	   int *character_width, int *number)
+ {
+   if (!ISDIGIT (*arg))
+-    *character = *arg++;
++    {
++#ifdef HAVE_MBRTOWC
++      if (MB_CUR_MAX > 1)	/* for multibyte locale. */
++	{
++	  wchar_t wc;
++	  size_t mblength;
++	  int width;
++	  mbstate_t state = {'\0'};
++
++	  mblength = mbrtowc (&wc, arg, strnlen(arg, MB_LEN_MAX), &state);
++
++	  if (mblength == (size_t)-1 || mblength == (size_t)-2)
++	    {
++	      *character_length = 1;
++	      *character_width = 1;
++	    }
++	  else
++	    {
++	      *character_length = (mblength < 1) ? 1 : mblength;
++	      width = wcwidth (wc);
++	      *character_width = (width < 0) ? 0 : width;
++	    }
++
++	  strncpy (character, arg, *character_length);
++	  arg += *character_length;
++	}
++      else			/* for single byte locale. */
++#endif
++	{
++	  *character = *arg++;
++	  *character_length = 1;
++	  *character_width = 1;
++	}
++    }
++
+   if (*arg)
+     {
+       long int tmp_long;
+@@ -1256,7 +1382,7 @@
+ 	  else
+ 	    col_sep_string = column_separator;
+ 
+-	  col_sep_length = 1;
++	  col_sep_length = col_sep_width = 1;
+ 	  use_col_separator = true;
+ 	}
+       /* It's rather pointless to define a TAB separator with column
+@@ -1288,11 +1414,11 @@
+ 	     TAB_WIDTH (chars_per_input_tab, chars_per_number);   */
+ 
+       /* Estimate chars_per_text without any margin and keep it constant. */
+-      if (number_separator == '\t')
++      if (number_separator[0] == '\t')
+ 	number_width = chars_per_number +
+ 	  TAB_WIDTH (chars_per_default_tab, chars_per_number);
+       else
+-	number_width = chars_per_number + 1;
++	number_width = chars_per_number + number_separator_width;
+ 
+       /* The number is part of the column width unless we are
+ 	 printing files in parallel. */
+@@ -1307,7 +1433,7 @@
+     }
+ 
+   chars_per_column = (chars_per_line - chars_used_by_number -
+-		     (columns - 1) * col_sep_length) / columns;
++		     (columns - 1) * col_sep_width) / columns;
+ 
+   if (chars_per_column < 1)
+     error (EXIT_FAILURE, 0, _("page width too narrow"));
+@@ -1432,7 +1558,7 @@
+ 
+   /* Enlarge p->start_position of first column to use the same form of
+      padding_not_printed with all columns. */
+-  h = h + col_sep_length;
++  h = h + col_sep_width;
+ 
+   /* This loop takes care of all but the rightmost column. */
+ 
+@@ -1466,7 +1592,7 @@
+ 	}
+       else
+ 	{
+-	  h = h_next + col_sep_length;
++	  h = h_next + col_sep_width;
+ 	  h_next = h + chars_per_column;
+ 	}
+     }
+@@ -1756,9 +1882,9 @@
+ align_column (COLUMN *p)
+ {
+   padding_not_printed = p->start_position;
+-  if (padding_not_printed - col_sep_length > 0)
++  if (padding_not_printed - col_sep_width > 0)
+     {
+-      pad_across_to (padding_not_printed - col_sep_length);
++      pad_across_to (padding_not_printed - col_sep_width);
+       padding_not_printed = ANYWHERE;
+     }
+ 
+@@ -2029,13 +2155,13 @@
+       /* May be too generous. */
+       buff = X2REALLOC (buff, &buff_allocated);
+     }
+-  buff[buff_current++] = c;
++  buff[buff_current++] = (unsigned char) c;
+ }
+ 
+ static void
+ add_line_number (COLUMN *p)
+ {
+-  int i;
++  int i, j;
+   char *s;
+   int left_cut;
+ 
+@@ -2058,22 +2184,24 @@
+       /* Tabification is assumed for multiple columns, also for n-separators,
+ 	 but `default n-separator = TAB' hasn't been given priority over
+ 	 equal column_width also specified by POSIX. */
+-      if (number_separator == '\t')
++      if (number_separator[0] == '\t')
+         {
+           i = number_width - chars_per_number;
+           while (i-- > 0)
+ 	    (p->char_func) (' ');
+         }
+       else
+-        (p->char_func) (number_separator);
++	for (j = 0; j < number_separator_length; j++)
++	  (p->char_func) (number_separator[j]);
+     }
+   else
+     /* To comply with POSIX, we avoid any expansion of default TAB
+        separator with a single column output. No column_width requirement
+        has to be considered. */
+     {
+-      (p->char_func) (number_separator);
+-      if (number_separator == '\t')
++      for (j = 0; j < number_separator_length; j++)
++	(p->char_func) (number_separator[j]);
++      if (number_separator[0] == '\t')
+         output_position = POS_AFTER_TAB (chars_per_output_tab,
+ 			  output_position);
+     }
+@@ -2234,7 +2362,7 @@
+   while (goal - h_old > 1
+ 	 && (h_new = POS_AFTER_TAB (chars_per_output_tab, h_old)) <= goal)
+     {
+-      putchar (output_tab_char);
++      fwrite (output_tab_char, sizeof(char), output_tab_char_length, stdout);
+       h_old = h_new;
+     }
+   while (++h_old <= goal)
+@@ -2254,6 +2382,7 @@
+ {
+   char *s;
+   int l = col_sep_length;
++  int not_space_flag;
+ 
+   s = col_sep_string;
+ 
+@@ -2267,6 +2396,7 @@
+     {
+       for (; separators_not_printed > 0; --separators_not_printed)
+ 	{
++	  not_space_flag = 0;
+ 	  while (l-- > 0)
+ 	    {
+ 	      /* 3 types of sep_strings: spaces only, spaces and chars,
+@@ -2280,12 +2410,15 @@
+ 		}
+ 	      else
+ 		{
++		  not_space_flag = 1;
+ 		  if (spaces_not_printed > 0)
+ 		    print_white_space ();
+ 		  putchar (*s++);
+-		  ++output_position;
+ 		}
+ 	    }
++	  if (not_space_flag)
++	    output_position += col_sep_width;
++
+           /* sep_string ends with some spaces */
+ 	  if (spaces_not_printed > 0)
+ 	    print_white_space ();
+@@ -2313,7 +2446,7 @@
+    required number of tabs and spaces. */
+ 
+ static void
+-print_char (char c)
++print_char_single (char c)
+ {
+   if (tabify_output)
+     {
+@@ -2337,6 +2470,74 @@
+   putchar (c);
+ }
+ 
++#ifdef HAVE_MBRTOWC
++static void
++print_char_multi (char c)
++{
++  static size_t mbc_pos = 0;
++  static char mbc[MB_LEN_MAX] = {'\0'};
++  static mbstate_t state = {'\0'};
++  mbstate_t state_bak;
++  wchar_t wc;
++  size_t mblength;
++  int width;
++
++  if (tabify_output)
++    {
++      state_bak = state;
++      mbc[mbc_pos++] = c;
++      mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
++
++      while (mbc_pos > 0)
++	{
++	  switch (mblength)
++	    {
++	    case (size_t)-2:
++	      state = state_bak;
++	      return;
++
++	    case (size_t)-1:
++	      state = state_bak;
++	      ++output_position;
++	      putchar (mbc[0]);
++	      memmove (mbc, mbc + 1, MB_CUR_MAX - 1);
++	      --mbc_pos;
++	      break;
++
++	    case 0:
++	      mblength = 1;
++
++	    default:
++	      if (wc == L' ')
++		{
++		  memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
++		  --mbc_pos;
++		  ++spaces_not_printed;
++		  return;
++		}
++	      else if (spaces_not_printed > 0)
++		print_white_space ();
++
++	      /* Nonprintables are assumed to have width 0, except L'\b'. */
++	      if ((width = wcwidth (wc)) < 1)
++		{
++		  if (wc == L'\b')
++		    --output_position;
++		}
++	      else
++		output_position += width;
++
++	      fwrite (mbc, sizeof(char), mblength, stdout);
++	      memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
++	      mbc_pos -= mblength;
++	    }
++	}
++      return;
++    }
++  putchar (c);
++}
++#endif
++
+ /* Skip to page PAGE before printing.
+    PAGE may be larger than total number of pages. */
+ 
+@@ -2517,9 +2718,9 @@
+ 	  align_empty_cols = false;
+ 	}
+ 
+-      if (padding_not_printed - col_sep_length > 0)
++      if (padding_not_printed - col_sep_width > 0)
+ 	{
+-	  pad_across_to (padding_not_printed - col_sep_length);
++	  pad_across_to (padding_not_printed - col_sep_width);
+ 	  padding_not_printed = ANYWHERE;
+ 	}
+ 
+@@ -2620,9 +2821,9 @@
+ 	}
+     }
+ 
+-  if (padding_not_printed - col_sep_length > 0)
++  if (padding_not_printed - col_sep_width > 0)
+     {
+-      pad_across_to (padding_not_printed - col_sep_length);
++      pad_across_to (padding_not_printed - col_sep_width);
+       padding_not_printed = ANYWHERE;
+     }
+ 
+@@ -2635,8 +2836,8 @@
+   if (spaces_not_printed == 0)
+     {
+       output_position = p->start_position + end_vector[line];
+-      if (p->start_position - col_sep_length == chars_per_margin)
+-	output_position -= col_sep_length;
++      if (p->start_position - col_sep_width == chars_per_margin)
++	output_position -= col_sep_width;
+     }
+ 
+   return true;
+@@ -2655,7 +2856,7 @@
+    number of characters is 1.) */
+ 
+ static int
+-char_to_clump (char c)
++char_to_clump_single (char c)
+ {
+   unsigned char uc = c;
+   char *s = clump_buff;
+@@ -2665,10 +2866,10 @@
+   int chars;
+   int chars_per_c = 8;
+ 
+-  if (c == input_tab_char)
++  if (c == input_tab_char[0])
+     chars_per_c = chars_per_input_tab;
+ 
+-  if (c == input_tab_char || c == '\t')
++  if (c == input_tab_char[0] || c == '\t')
+     {
+       width = TAB_WIDTH (chars_per_c, input_position);
+ 
+@@ -2739,6 +2940,154 @@
+   return chars;
+ }
+ 
++#ifdef HAVE_MBRTOWC
++static int
++char_to_clump_multi (char c)
++{
++  static size_t mbc_pos = 0;
++  static char mbc[MB_LEN_MAX] = {'\0'};
++  static mbstate_t state = {'\0'};
++  mbstate_t state_bak;
++  wchar_t wc;
++  size_t mblength;
++  int wc_width;
++  register char *s = clump_buff;
++  register int i, j;
++  char esc_buff[4];
++  int width;
++  int chars;
++  int chars_per_c = 8;
++
++  state_bak = state;
++  mbc[mbc_pos++] = c;
++  mblength = mbrtowc (&wc, mbc, mbc_pos, &state);
++
++  width = 0;
++  chars = 0;
++  while (mbc_pos > 0)
++    {
++      switch (mblength)
++	{
++	case (size_t)-2:
++	  state = state_bak;
++	  return 0;
++
++	case (size_t)-1:
++	  state = state_bak;
++	  mblength = 1;
++
++	  if (use_esc_sequence || use_cntrl_prefix)
++	    {
++	      width = +4;
++	      chars = +4;
++	      *s++ = '\\';
++	      sprintf (esc_buff, "%03o", mbc[0]);
++	      for (i = 0; i <= 2; ++i)
++		*s++ = (int) esc_buff[i];
++	    }
++	  else
++	    {
++	      width += 1;
++	      chars += 1;
++	      *s++ = mbc[0];
++	    }
++	  break;
++
++	case 0:
++	  mblength = 1;
++		/* Fall through */
++
++	default:
++	  if (memcmp (mbc, input_tab_char, mblength) == 0)
++	    chars_per_c = chars_per_input_tab;
++
++	  if (memcmp (mbc, input_tab_char, mblength) == 0 || c == '\t')
++	    {
++	      int  width_inc;
++
++	      width_inc = TAB_WIDTH (chars_per_c, input_position);
++	      width += width_inc;
++
++	      if (untabify_input)
++		{
++		  for (i = width_inc; i; --i)
++		    *s++ = ' ';
++		  chars += width_inc;
++		}
++	      else
++		{
++		  for (i = 0; i <  mblength; i++)
++		    *s++ = mbc[i];
++		  chars += mblength;
++		}
++	    }
++	  else if ((wc_width = wcwidth (wc)) < 1)
++	    {
++	      if (use_esc_sequence)
++		{
++		  for (i = 0; i < mblength; i++)
++		    {
++		      width += 4;
++		      chars += 4;
++		      *s++ = '\\';
++		      sprintf (esc_buff, "%03o", c);
++		      for (j = 0; j <= 2; ++j)
++			*s++ = (int) esc_buff[j];
++		    }
++		}
++	      else if (use_cntrl_prefix)
++		{
++		  if (wc < 0200)
++		    {
++		      width += 2;
++		      chars += 2;
++		      *s++ = '^';
++		      *s++ = wc ^ 0100;
++		    }
++		  else
++		    {
++		      for (i = 0; i < mblength; i++)
++			{
++			  width += 4;
++			  chars += 4;
++			  *s++ = '\\';
++			  sprintf (esc_buff, "%03o", c);
++			  for (j = 0; j <= 2; ++j)
++			    *s++ = (int) esc_buff[j];
++			}
++		    }
++		}
++	      else if (wc == L'\b')
++		{
++		  width += -1;
++		  chars += 1;
++		  *s++ = c;
++		}
++	      else
++		{
++		  width += 0;
++		  chars += mblength;
++		  for (i = 0; i < mblength; i++)
++		    *s++ = mbc[i];
++		}
++	    }
++	  else
++	    {
++	      width += wc_width;
++	      chars += mblength;
++	      for (i = 0; i < mblength; i++)
++		*s++ = mbc[i];
++	    }
++	}
++      memmove (mbc, mbc + mblength, MB_CUR_MAX - mblength);
++      mbc_pos -= mblength;
++    }
++
++  input_position += width;
++  return chars;
++}
++#endif
++
+ /* We've just printed some files and need to clean up things before
+    looking for more options and printing the next batch of files.
+ 
+--- coreutils-6.8+/src/cut.c.i18n	2007-01-14 15:41:28.000000000 +0000
++++ coreutils-6.8+/src/cut.c	2007-03-01 15:08:24.000000000 +0000
+@@ -29,6 +29,11 @@
+ #include <assert.h>
+ #include <getopt.h>
+ #include <sys/types.h>
++
++/* Get mbstate_t, mbrtowc().  */
++#if HAVE_WCHAR_H
++# include <wchar.h>
++#endif
+ #include "system.h"
+ 
+ #include "error.h"
+@@ -37,6 +42,18 @@
+ #include "quote.h"
+ #include "xstrndup.h"
+ 
++/* MB_LEN_MAX is incorrectly defined to be 1 in at least one GCC
++   installation; work around this configuration error.	*/
++#if !defined MB_LEN_MAX || MB_LEN_MAX < 2
++# undef MB_LEN_MAX
++# define MB_LEN_MAX 16
++#endif
++
++/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t.  */
++#if HAVE_MBRTOWC && defined mbstate_t
++# define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0)
++#endif
++
+ /* The official name of this program (e.g., no `g' prefix).  */
+ #define PROGRAM_NAME "cut"
+ 
+@@ -67,6 +84,52 @@
+     }							\
+   while (0)
+ 
++/* Refill the buffer BUF to get a multibyte character. */
++#define REFILL_BUFFER(BUF, BUFPOS, BUFLEN, STREAM)			\
++  do									\
++    {									\
++      if (BUFLEN < MB_LEN_MAX && !feof (STREAM) && !ferror (STREAM))	\
++	{								\
++	  memmove (BUF, BUFPOS, BUFLEN);				\
++	  BUFLEN += fread (BUF + BUFLEN, sizeof(char), BUFSIZ, STREAM); \
++	  BUFPOS = BUF;							\
++	}								\
++    }									\
++  while (0)
++
++/* Get wide character on BUFPOS. BUFPOS is not included after that.
++   If byte sequence is not valid as a character, CONVFAIL is 1. Otherwise 0. */ 
++#define GET_NEXT_WC_FROM_BUFFER(WC, BUFPOS, BUFLEN, MBLENGTH, STATE, CONVFAIL) \
++  do									\
++    {									\
++      mbstate_t state_bak;						\
++									\
++      if (BUFLEN < 1)							\
++	{								\
++	  WC = WEOF;							\
++	  break;							\
++	}								\
++									\
++      /* Get a wide character. */					\
++      CONVFAIL = 0;							\
++      state_bak = STATE;						\
++      MBLENGTH = mbrtowc ((wchar_t *)&WC, BUFPOS, BUFLEN, &STATE);	\
++									\
++      switch (MBLENGTH)							\
++	{								\
++	case (size_t)-1:						\
++	case (size_t)-2:						\
++	  CONVFAIL++;							\
++	  STATE = state_bak;						\
++	  /* Fall througn. */						\
++									\
++	case 0:								\
++	  MBLENGTH = 1;							\
++	  break;							\
++	}								\
++    }									\
++  while (0)
++
+ struct range_pair
+   {
+     size_t lo;
+@@ -85,7 +148,7 @@
+ /* The number of bytes allocated for FIELD_1_BUFFER.  */
+ static size_t field_1_bufsize;
+ 
+-/* The largest field or byte index used as an endpoint of a closed
++/* The largest byte, character or field index used as an endpoint of a closed
+    or degenerate range specification;  this doesn't include the starting
+    index of right-open-ended ranges.  For example, with either range spec
+    `2-5,9-', `2-3,5,9-' this variable would be set to 5.  */
+@@ -97,10 +160,11 @@
+ 
+ /* This is a bit vector.
+    In byte mode, which bytes to output.
++   In character mode, which characters to output.
+    In field mode, which DELIM-separated fields to output.
+-   Both bytes and fields are numbered starting with 1,
++   Bytes, characters and fields are numbered starting with 1,
+    so the zeroth bit of this array is unused.
+-   A field or byte K has been selected if
++   A byte, character or field K has been selected if
+    (K <= MAX_RANGE_ENDPOINT and is_printable_field(K))
+     || (EOL_RANGE_START > 0 && K >= EOL_RANGE_START).  */
+ static unsigned char *printable_field;
+@@ -109,9 +173,12 @@
+   {
+     undefined_mode,
+ 
+-    /* Output characters that are in the given bytes. */
++    /* Output bytes that are at the given positions. */
+     byte_mode,
+ 
++    /* Output characters that are at the given positions. */
++    character_mode,
++
+     /* Output the given delimeter-separated fields. */
+     field_mode
+   };
+@@ -121,6 +188,13 @@
+ 
+ static enum operating_mode operating_mode;
+ 
++/* If nonzero, when in byte mode, don't split multibyte characters.  */
++static int byte_mode_character_aware;
++
++/* If nonzero, the function for single byte locale is work
++   if this program runs on multibyte locale. */
++static int force_singlebyte_mode;
++
+ /* If true do not output lines containing no delimeter characters.
+    Otherwise, all such lines are printed.  This option is valid only
+    with field mode.  */
+@@ -132,6 +206,9 @@
+ 
+ /* The delimeter character for field mode. */
+ static unsigned char delim;
++#if HAVE_WCHAR_H
++static wchar_t wcdelim;
++#endif
+ 
+ /* True if the --output-delimiter=STRING option was specified.  */
+ static bool output_delimiter_specified;
+@@ -205,7 +282,7 @@
+   -f, --fields=LIST       select only these fields;  also print any line\n\
+                             that contains no delimiter character, unless\n\
+                             the -s option is specified\n\
+-  -n                      (ignored)\n\
++  -n                      with -b: don't split multibyte characters\n\
+ "), stdout);
+       fputs (_("\
+       --complement        complement the set of selected bytes, characters\n\
+@@ -362,7 +439,7 @@
+ 	  in_digits = false;
+ 	  /* Starting a range. */
+ 	  if (dash_found)
+-	    FATAL_ERROR (_("invalid byte or field list"));
++	    FATAL_ERROR (_("invalid byte, character or field list"));
+ 	  dash_found = true;
+ 	  fieldstr++;
+ 
+@@ -387,14 +464,16 @@
+ 	      if (value == 0)
+ 		{
+ 		  /* `n-'.  From `initial' to end of line. */
+-		  eol_range_start = initial;
++		  if (eol_range_start == 0 ||
++		      (eol_range_start != 0 && eol_range_start > initial))
++		    eol_range_start = initial;
+ 		  field_found = true;
+ 		}
+ 	      else
+ 		{
+ 		  /* `m-n' or `-n' (1-n). */
+ 		  if (value < initial)
+-		    FATAL_ERROR (_("invalid byte or field list"));
++		    FATAL_ERROR (_("invalid byte, character or field list"));
+ 
+ 		  /* Is there already a range going to end of line? */
+ 		  if (eol_range_start != 0)
+@@ -467,6 +546,9 @@
+ 	      if (operating_mode == byte_mode)
+ 		error (0, 0,
+ 		       _("byte offset %s is too large"), quote (bad_num));
++	      else if (operating_mode == character_mode)
++		error (0, 0,
++		       _("character offset %s is too large"), quote (bad_num));
+ 	      else
+ 		error (0, 0,
+ 		       _("field number %s is too large"), quote (bad_num));
+@@ -477,7 +559,7 @@
+ 	  fieldstr++;
+ 	}
+       else
+-	FATAL_ERROR (_("invalid byte or field list"));
++	FATAL_ERROR (_("invalid byte, character or field list"));
+     }
+ 
+   max_range_endpoint = 0;
+@@ -570,6 +652,63 @@
+     }
+ }
+ 
++#if HAVE_MBRTOWC
++/* This function is in use for the following case.
++
++   1. Read from the stream STREAM, printing to standard output any selected
++   characters. 
++
++   2. Read from stream STREAM, printing to standard output any selected bytes,
++   without splitting multibyte characters.  */
++ 
++static void
++cut_characters_or_cut_bytes_no_split (FILE *stream)
++{
++  int idx;		/* number of bytes or characters in the line so far. */
++  char buf[MB_LEN_MAX + BUFSIZ];  /* For spooling a read byte sequence. */
++  char *bufpos;		/* Next read position of BUF. */
++  size_t buflen;	/* The length of the byte sequence in buf. */
++  wint_t wc;		/* A gotten wide character. */
++  size_t mblength;	/* The byte size of a multibyte character which shows
++			   as same character as WC. */
++  mbstate_t state;	/* State of the stream. */
++  int convfail;		/* 1, when conversion is failed. Otherwise 0. */
++
++  idx = 0;
++  buflen = 0;
++  bufpos = buf;
++  memset (&state, '\0', sizeof(mbstate_t));
++
++  while (1)
++    {
++      REFILL_BUFFER (buf, bufpos, buflen, stream);
++
++      GET_NEXT_WC_FROM_BUFFER (wc, bufpos, buflen, mblength, state, convfail);
++
++      if (wc == WEOF)
++	{
++	  if (idx > 0)
++	    putchar ('\n');
++	  break;
++	}
++      else if (wc == L'\n')
++	{
++	  putchar ('\n');
++	  idx = 0;
++	}
++      else
++	{
++	  idx += (operating_mode == byte_mode) ? mblength : 1;
++	  if (print_kth (idx, NULL))
++	    fwrite (bufpos, mblength, sizeof(char), stdout);
++	}
++
++      buflen -= mblength;
++      bufpos += mblength;
++    }
++}
++#endif
++		   
+ /* Read from stream STREAM, printing to standard output any selected fields.  */
+ 
+ static void
+@@ -692,13 +831,192 @@
+     }
+ }
+ 
++#if HAVE_MBRTOWC
++static void
++cut_fields_mb (FILE *stream)
++{
++  int c;
++  unsigned int field_idx;
++  int found_any_selected_field;
++  int buffer_first_field;
++  int empty_input;
++  char buf[MB_LEN_MAX + BUFSIZ];  /* For spooling a read byte sequence. */
++  char *bufpos;		/* Next read position of BUF. */
++  size_t buflen;	/* The length of the byte sequence in buf. */
++  wint_t wc = 0;	/* A gotten wide character. */
++  size_t mblength;	/* The byte size of a multibyte character which shows
++			   as same character as WC. */
++  mbstate_t state;	/* State of the stream. */
++  int convfail;		/* 1, when conversion is failed. Otherwise 0. */
++
++  found_any_selected_field = 0;
++  field_idx = 1;
++  bufpos = buf;
++  buflen = 0;
++  memset (&state, '\0', sizeof(mbstate_t));
++
++  c = getc (stream);
++  empty_input = (c == EOF);
++  if (c != EOF)
++    ungetc (c, stream);
++  else
++    wc = WEOF;
++
++  /* To support the semantics of the -s flag, we may have to buffer
++     all of the first field to determine whether it is `delimited.'
++     But that is unnecessary if all non-delimited lines must be printed
++     and the first field has been selected, or if non-delimited lines
++     must be suppressed and the first field has *not* been selected.
++     That is because a non-delimited line has exactly one field.  */
++  buffer_first_field = (suppress_non_delimited ^ !print_kth (1, NULL));
++
++  while (1)
++    {
++      if (field_idx == 1 && buffer_first_field)
++	{
++	  int len = 0;
++
++	  while (1)
++	    {
++	      REFILL_BUFFER (buf, bufpos, buflen, stream);
++
++	      GET_NEXT_WC_FROM_BUFFER
++		(wc, bufpos, buflen, mblength, state, convfail);
++
++	      if (wc == WEOF)
++		break;
++
++	      field_1_buffer = xrealloc (field_1_buffer, len + mblength);
++	      memcpy (field_1_buffer + len, bufpos, mblength);
++	      len += mblength;
++	      buflen -= mblength;
++	      bufpos += mblength;
++
++	      if (!convfail && (wc == L'\n' || wc == wcdelim))
++		break;
++	    }
++
++	  if (wc == WEOF)
++	    break;
++
++	  /* If the first field extends to the end of line (it is not
++	     delimited) and we are printing all non-delimited lines,
++	     print this one.  */
++	  if (convfail || (!convfail && wc != wcdelim))
++	    {
++	      if (suppress_non_delimited)
++		{
++		  /* Empty.	*/
++		}
++	      else
++		{
++		  fwrite (field_1_buffer, sizeof (char), len, stdout);
++		  /* Make sure the output line is newline terminated.  */
++		  if (convfail || (!convfail && wc != L'\n'))
++		    putchar ('\n');
++		}
++	      continue;
++	    }
++
++	  if (print_kth (1, NULL))
++	    {
++	      /* Print the field, but not the trailing delimiter.  */
++	      fwrite (field_1_buffer, sizeof (char), len - 1, stdout);
++	      found_any_selected_field = 1;
++	    }
++	  ++field_idx;
++	}
++
++      if (wc != WEOF)
++	{
++	  if (print_kth (field_idx, NULL))
++	    {
++	      if (found_any_selected_field)
++		{
++		  fwrite (output_delimiter_string, sizeof (char),
++			  output_delimiter_length, stdout);
++		}
++	      found_any_selected_field = 1;
++	    }
++
++	  while (1)
++	    {
++	      REFILL_BUFFER (buf, bufpos, buflen, stream);
++
++	      GET_NEXT_WC_FROM_BUFFER
++		(wc, bufpos, buflen, mblength, state, convfail);
++
++	      if (wc == WEOF)
++		break;
++	      else if (!convfail && (wc == wcdelim || wc == L'\n'))
++		{
++		  buflen -= mblength;
++		  bufpos += mblength;
++		  break;
++		}
++
++	      if (print_kth (field_idx, NULL))
++		fwrite (bufpos, mblength, sizeof(char), stdout);
++
++	      buflen -= mblength;
++	      bufpos += mblength;
++	    }
++	}
++
++      if ((!convfail || wc == L'\n') && buflen < 1)
++	wc = WEOF;
++
++      if (!convfail && wc == wcdelim)
++	++field_idx;
++      else if (wc == WEOF || (!convfail && wc == L'\n'))
++	{
++	  if (found_any_selected_field
++	      || (!empty_input && !(suppress_non_delimited && field_idx == 1)))
++	    putchar ('\n');
++	  if (wc == WEOF)
++	    break;
++	  field_idx = 1;
++	  found_any_selected_field = 0;
++	}
++    }
++}
++#endif
++
+ static void
+ cut_stream (FILE *stream)
+ {
+-  if (operating_mode == byte_mode)
+-    cut_bytes (stream);
++#if HAVE_MBRTOWC
++  if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
++    {
++      switch (operating_mode)
++	{
++	case byte_mode:
++	  if (byte_mode_character_aware)
++	    cut_characters_or_cut_bytes_no_split (stream);
++	  else
++	    cut_bytes (stream);
++	  break;
++
++	case character_mode:
++	  cut_characters_or_cut_bytes_no_split (stream);
++	  break;
++
++	case field_mode:
++	  cut_fields_mb (stream);
++	  break;
++
++	default:
++	  abort ();
++	}
++    }
+   else
+-    cut_fields (stream);
++#endif
++    {
++      if (operating_mode == field_mode)
++	cut_fields (stream);
++      else
++	cut_bytes (stream);
++    }
+ }
+ 
+ /* Process file FILE to standard output.
+@@ -748,6 +1066,8 @@
+   bool ok;
+   bool delim_specified = false;
+   char *spec_list_string IF_LINT(= NULL);
++  char mbdelim[MB_LEN_MAX + 1];
++  size_t delimlen = 0;
+ 
+   initialize_main (&argc, &argv);
+   program_name = argv[0];
+@@ -770,7 +1090,6 @@
+       switch (optc)
+ 	{
+ 	case 'b':
+-	case 'c':
+ 	  /* Build the byte list. */
+ 	  if (operating_mode != undefined_mode)
+ 	    FATAL_ERROR (_("only one type of list may be specified"));
+@@ -778,6 +1097,14 @@
+ 	  spec_list_string = optarg;
+ 	  break;
+ 
++	case 'c':
++	  /* Build the character list. */
++	  if (operating_mode != undefined_mode)
++	    FATAL_ERROR (_("only one type of list may be specified"));
++	  operating_mode = character_mode;
++	  spec_list_string = optarg;
++	  break;
++
+ 	case 'f':
+ 	  /* Build the field list. */
+ 	  if (operating_mode != undefined_mode)
+@@ -789,10 +1116,35 @@
+ 	case 'd':
+ 	  /* New delimiter. */
+ 	  /* Interpret -d '' to mean `use the NUL byte as the delimiter.'  */
+-	  if (optarg[0] != '\0' && optarg[1] != '\0')
+-	    FATAL_ERROR (_("the delimiter must be a single character"));
+-	  delim = optarg[0];
+-	  delim_specified = true;
++#if HAVE_MBRTOWC
++	    {
++	      if(MB_CUR_MAX > 1)
++		{
++		  mbstate_t state;
++
++		  memset (&state, '\0', sizeof(mbstate_t));
++		  delimlen = mbrtowc (&wcdelim, optarg, strnlen(optarg, MB_LEN_MAX), &state);
++
++		  if (delimlen == (size_t)-1 || delimlen == (size_t)-2)
++		    ++force_singlebyte_mode;
++		  else
++		    {
++		      delimlen = (delimlen < 1) ? 1 : delimlen;
++		      if (wcdelim != L'\0' && *(optarg + delimlen) != '\0')
++			FATAL_ERROR (_("the delimiter must be a single character"));
++		      memcpy (mbdelim, optarg, delimlen);
++		    }
++		}
++
++	      if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
++#endif
++		{
++		  if (optarg[0] != '\0' && optarg[1] != '\0')
++		    FATAL_ERROR (_("the delimiter must be a single character"));
++		  delim = (unsigned char) optarg[0];
++		}
++	    delim_specified = true;
++	  }
+ 	  break;
+ 
+ 	case OUTPUT_DELIMITER_OPTION:
+@@ -805,6 +1157,7 @@
+ 	  break;
+ 
+ 	case 'n':
++	  byte_mode_character_aware = 1;
+ 	  break;
+ 
+ 	case 's':
+@@ -827,7 +1180,7 @@
+   if (operating_mode == undefined_mode)
+     FATAL_ERROR (_("you must specify a list of bytes, characters, or fields"));
+ 
+-  if (delim != '\0' && operating_mode != field_mode)
++  if (delim_specified && operating_mode != field_mode)
+     FATAL_ERROR (_("an input delimiter may be specified only\
+  when operating on fields"));
+ 
+@@ -854,15 +1207,34 @@
+     }
+ 
+   if (!delim_specified)
+-    delim = '\t';
++    {
++      delim = '\t';
++#ifdef HAVE_MBRTOWC
++      wcdelim = L'\t';
++      mbdelim[0] = '\t';
++      mbdelim[1] = '\0';
++      delimlen = 1;
++#endif
++    }
+ 
+   if (output_delimiter_string == NULL)
+     {
+-      static char dummy[2];
+-      dummy[0] = delim;
+-      dummy[1] = '\0';
+-      output_delimiter_string = dummy;
+-      output_delimiter_length = 1;
++#ifdef HAVE_MBRTOWC
++      if (MB_CUR_MAX > 1 && !force_singlebyte_mode)
++	{
++	  output_delimiter_string = xstrdup(mbdelim);
++	  output_delimiter_length = delimlen;
++	}
++
++      if (MB_CUR_MAX <= 1 || force_singlebyte_mode)
++#endif
++	{
++	  static char dummy[2]; 
++	  dummy[0] = delim;
++	  dummy[1] = '\0';
++	  output_delimiter_string = dummy;
++	  output_delimiter_length = 1;
++	}
+     }
+ 
+   if (optind == argc)
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch
new file mode 100644
index 0000000..aba8742
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-ls-x.patch
@@ -0,0 +1,117 @@
+Upstream-Status: Inappropriate [legacy version]
+
+This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
+
+The package is stated as being Licensed as GPLv2+.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- coreutils-6.9/src/ls.c.ls-x	2007-06-13 14:27:36.000000000 +0100
++++ coreutils-6.9/src/ls.c	2007-06-13 14:28:42.000000000 +0100
+@@ -4151,16 +4151,16 @@
+   size_t pos = 0;
+   size_t cols = calculate_columns (false);
+   struct column_info const *line_fmt = &column_info[cols - 1];
+-  size_t name_length = length_of_file_name_and_frills (cwd_file);
++  struct fileinfo const *f = sorted_file[0];
++  size_t name_length = length_of_file_name_and_frills (f);
+   size_t max_name_length = line_fmt->col_arr[0];
+ 
+   /* Print first entry.  */
+-  print_file_name_and_frills (cwd_file);
++  print_file_name_and_frills (f);
+ 
+   /* Now the rest.  */
+   for (filesno = 1; filesno < cwd_n_used; ++filesno)
+     {
+-      struct fileinfo const *f;
+       size_t col = filesno % cols;
+ 
+       if (col == 0)
+--- coreutils-6.9/tests/ls/Makefile.am.ls-x	2007-03-18 21:36:43.000000000 +0000
++++ coreutils-6.9/tests/ls/Makefile.am	2007-06-13 14:28:42.000000000 +0100
+@@ -24,7 +24,7 @@
+   stat-dtype \
+   inode dangle file-type recursive dired infloop \
+   rt-1 time-1 symlink-slash follow-slink no-arg m-option \
+-  stat-vs-dirent
++  stat-vs-dirent x-option
+ 
+ EXTRA_DIST = $(TESTS)
+ TESTS_ENVIRONMENT = \
+--- /dev/null	2007-06-13 08:43:51.993263382 +0100
++++ coreutils-6.9/tests/ls/x-option	2007-06-13 14:28:42.000000000 +0100
+@@ -0,0 +1,59 @@
++#!/bin/sh
++# Exercise the -x option.
++
++# Copyright (C) 2007 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301, USA.
++
++if test "$VERBOSE" = yes; then
++  set -x
++  ls --version
++fi
++
++. $srcdir/../envvar-check
++. $srcdir/../lang-default
++
++pwd=`pwd`
++t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
++trap 'status=$?; cd "$pwd" && chmod -R u+rwx $t0 && rm -rf $t0 && exit $status' 0
++trap '(exit $?); exit $?' 1 2 13 15
++
++framework_failure=0
++mkdir -p $tmp || framework_failure=1
++cd $tmp || framework_failure=1
++mkdir subdir || framework_failure=1
++touch subdir/b || framework_failure=1
++touch subdir/a || framework_failure=1
++
++if test $framework_failure = 1; then
++  echo "$0: failure in testing framework" 1>&2
++  (exit 1); exit 1
++fi
++
++fail=0
++
++# Coreutils 6.8 and 6.9 would output this in the wrong order.
++ls -x subdir > out || fail=1
++ls -rx subdir >> out || fail=1
++cat <<\EOF > exp || fail=1
++a  b
++b  a
++EOF
++
++cmp out exp || fail=1
++test $fail = 1 && diff out exp 2> /dev/null
++
++(exit $fail); exit $fail
+--- coreutils-6.9/NEWS.ls-x	2007-03-22 21:19:45.000000000 +0000
++++ coreutils-6.9/NEWS	2007-06-13 14:28:42.000000000 +0100
+@@ -13,6 +13,11 @@
+   Using pr -m -s (i.e. merging files, with TAB as the output separator)
+   no longer inserts extraneous spaces between output columns.
+ 
++** Bug fixes
++
++  ls -x DIR would sometimes output the wrong string in place of the
++  first entry.  [introduced in coreutils-6.8]
++
+ 
+ * Noteworthy changes in release 6.8 (2007-02-24) [not-unstable]
+ 
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch
new file mode 100644
index 0000000..58074c0
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils-overflow.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [legacy version]
+
+This patch was imported from the Fedora Core 8 coreutils-6.9-9 package.
+
+The package is stated as being Licensed as GPLv2+.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- coreutils-5.2.1/src/who.c.overflow	2005-05-25 09:59:06.000000000 +0100
++++ coreutils-5.2.1/src/who.c	2005-05-25 10:00:31.000000000 +0100
+@@ -75,7 +75,7 @@
+ # define NEW_TIME 0
+ #endif
+ 
+-#define IDLESTR_LEN 6
++#define IDLESTR_LEN 10
+ 
+ #if HAVE_STRUCT_XTMP_UT_PID
+ # define PIDSTR_DECL_AND_INIT(Var, Utmp_ent) \
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch b/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..02730db
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/coreutils_fix_for_automake-1.12.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.ac:40: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:138: gl_CHECK_ALL_TYPES is expanded from...
+| /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-linux/coreutils-native-6.9-r2/coreutils-6.9/m4/jm-macros.m4:24: coreutils_MACROS is expanded from...
+| configure.ac:40: the top level
+| autom4te: m4 failed with exit status: 1
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: coreutils-6.9/m4/jm-macros.m4
+===================================================================
+--- coreutils-6.9.orig/m4/jm-macros.m4
++++ coreutils-6.9/m4/jm-macros.m4
+@@ -142,11 +142,6 @@ AC_DEFUN([gl_CHECK_ALL_TYPES],
+   dnl whether functions and headers are available, whether they work, etc.
+   AC_REQUIRE([AC_SYS_LARGEFILE])
+ 
+-  dnl This test must precede tests of compiler characteristics like
+-  dnl that for the inline keyword, since it may change the degree to
+-  dnl which the compiler supports such features.
+-  AC_REQUIRE([AM_C_PROTOTYPES])
+-
+   dnl Checks for typedefs, structures, and compiler characteristics.
+   AC_REQUIRE([AC_C_BIGENDIAN])
+   AC_REQUIRE([AC_C_VOLATILE])
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch b/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
new file mode 100644
index 0000000..e0d600a
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/fix_for_manpage_building.patch
@@ -0,0 +1,85 @@
+Upstream-Status: Inappropriate [legacy version]
+
+Use native coreutils binaries to build manpages in cross environment.
+This avoids man page build issues like this:
+
+| Making all in man
+| make[1]: Entering directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
+| Updating man page cut.1
+| Updating man page dir.1
+| Updating man page expand.1
+| Updating man page fold.1
+| Updating man page install.1
+| Updating man page join.1
+| Updating man page pr.1
+| Updating man page ls.1
+| Updating man page sort.1
+| Updating man page unexpand.1
+| Updating man page uniq.1
+| Updating man page who.1
+| Updating man page vdir.1
+| help2man: can't get `--help' info from dir.td/dir
+| help2man: can't get `--help' info from cut.td/cut
+| make[1]: *** [dir.1] Error 126
+| make[1]: *** Waiting for unfinished jobs....
+| help2man: can't get `--help' info from fold.td/fold
+| help2man: can't get `--help' info from install.td/install
+| help2man: can't get `--help' info from expand.td/expand
+| help2man: can't get `--help' info from join.td/join
+| make[1]: *** [cut.1] Error 126
+| make[1]: *** [fold.1] Error 126
+| make[1]: *** [install.1] Error 126
+| help2man: can't get `--help' info from sort.td/sort
+| make[1]: *** [expand.1] Error 126
+| help2man: can't get `--help' info from pr.td/pr
+| make[1]: *** [join.1] Error 126
+| help2man: can't get `--help' info from ls.td/ls
+| help2man: can't get `--help' info from unexpand.td/unexpand
+| help2man: can't get `--help' info from uniq.td/uniq
+| help2man: can't get `--help' info from who.td/who
+| make[1]: *** [sort.1] Error 126
+| make[1]: *** [pr.1] Error 126
+| help2man: can't get `--help' info from vdir.td/vdir
+| make[1]: *** [ls.1] Error 126
+| make[1]: *** [uniq.1] Error 126
+| make[1]: *** [unexpand.1] Error 126
+| make[1]: *** [who.1] Error 126
+| make[1]: *** [vdir.1] Error 126
+| make[1]: Leaving directory `/build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/coreutils-6.9/man'
+| make: *** [all-recursive] Error 1
+| FATAL: oe_runmake failed
+| ERROR: Function 'do_compile' failed (see /build_disk/poky_build/build1/tmp/work/i586-poky-linux/coreutils-6.9-r0/temp/log.do_compile.12780 for further information)
+NOTE: package coreutils-6.9-r0: task do_compile: Failed
+ERROR: Task 8 (/home/nitin/prj/poky.git/meta/recipes-core/coreutils/coreutils_6.9.bb, do_compile) failed with exit code '1'
+
+
+This patch is made for gplv2 coreutils the recipe
+Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/03/17
+
+Index: man/Makefile.am
+===================================================================
+--- a/man.orig/Makefile.am
++++ b/man/Makefile.am
+@@ -167,7 +167,7 @@ mapped_name = `echo $*|sed 's/install/gi
+ 	            $(PERL) -- $(srcdir)/help2man		\
+ 	             --source='$(PACKAGE_STRING)'		\
+ 	             --include=$(srcdir)/$*.x			\
+-	             --output=$t/$@ $t/$*;			\
++	             --output=$t/$@ $*;			\
+ 	       }						\
+ 	    && sed 's|$*\.td/||g' $t/$@ > $@			\
+ 	    && chmod a-w $@					\
+Index: man/Makefile.in
+===================================================================
+--- a/man.orig/Makefile.in
++++ b/man/Makefile.in
+@@ -865,7 +865,7 @@ yes.1:		$(common_dep)	$(srcdir)/yes.x		.
+ 	            $(PERL) -- $(srcdir)/help2man		\
+ 	             --source='$(PACKAGE_STRING)'		\
+ 	             --include=$(srcdir)/$*.x			\
+-	             --output=$t/$@ $t/$*;			\
++	             --output=$t/$@ $*;			\
+ 	       }						\
+ 	    && sed 's|$*\.td/||g' $t/$@ > $@			\
+ 	    && chmod a-w $@					\
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch b/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
new file mode 100644
index 0000000..5ca590b
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/futimens.patch
@@ -0,0 +1,63 @@
+Upstream-Status: Inappropriate [legacy version]
+
+# coreutils uses gnulib which conflicts with newer libc header on futimens
+# this patch simply renames coreutils futimes to avoid confliction
+#
+# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
+# (this patch is licensed under GPLv2)
+
+diff --git a/lib/utimens.c b/lib/utimens.c
+index 71bc510..ae870b8 100644
+--- a/lib/utimens.c
++++ b/lib/utimens.c
+@@ -75,7 +75,7 @@ struct utimbuf
+    Return 0 on success, -1 (setting errno) on failure.  */
+ 
+ int
+-futimens (int fd ATTRIBUTE_UNUSED,
++futimens_coreutils (int fd ATTRIBUTE_UNUSED,
+ 	  char const *file, struct timespec const timespec[2])
+ {
+   /* Some Linux-based NFS clients are buggy, and mishandle time stamps
+@@ -185,5 +185,5 @@ futimens (int fd ATTRIBUTE_UNUSED,
+ int
+ utimens (char const *file, struct timespec const timespec[2])
+ {
+-  return futimens (-1, file, timespec);
++  return futimens_coreutils (-1, file, timespec);
+ }
+diff --git a/lib/utimens.h b/lib/utimens.h
+index 0097aaa..13fc45a 100644
+--- a/lib/utimens.h
++++ b/lib/utimens.h
+@@ -1,3 +1,3 @@
+ #include <time.h>
+-int futimens (int, char const *, struct timespec const [2]);
++int futimens_coreutils (int, char const *, struct timespec const [2]);
+ int utimens (char const *, struct timespec const [2]);
+diff --git a/src/copy.c b/src/copy.c
+index 4bdb75c..04634f1 100644
+--- a/src/copy.c
++++ b/src/copy.c
+@@ -518,7 +518,7 @@ copy_reg (char const *src_name, char const *dst_name,
+       timespec[0] = get_stat_atime (src_sb);
+       timespec[1] = get_stat_mtime (src_sb);
+ 
+-      if (futimens (dest_desc, dst_name, timespec) != 0)
++      if (futimens_coreutils (dest_desc, dst_name, timespec) != 0)
+ 	{
+ 	  error (0, errno, _("preserving times for %s"), quote (dst_name));
+ 	  if (x->require_preserve)
+diff --git a/src/touch.c b/src/touch.c
+index a79c26d..6ef317d 100644
+--- a/src/touch.c
++++ b/src/touch.c
+@@ -182,7 +182,7 @@ touch (const char *file)
+       t = timespec;
+     }
+ 
+-  ok = (futimens (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
++  ok = (futimens_coreutils (fd, (fd == STDOUT_FILENO ? NULL : file), t) == 0);
+ 
+   if (fd == STDIN_FILENO)
+     {
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch b/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
new file mode 100644
index 0000000..8f35552
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/gnulib_m4.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Inappropriate [legacy version]
+
+# remove the line to cause recursive inclusion error from autoreconf, sicne
+# newer autoconf has included this definition. Simply rename it here.
+#
+# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
+# (this patch is licensed under GPLv2)
+
+diff --git a/extensions.m4 b/extensions.m4
+index 143a9e5..f6558f1 100644
+--- a/m4/extensions.m4
++++ b/m4/extensions.m4
+@@ -16,7 +16,7 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
++AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS_DUMMY],
+ [
+   AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+   AC_BEFORE([$0], [AC_RUN_IFELSE])
diff --git a/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch b/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
new file mode 100644
index 0000000..c42cb9c
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-6.9/man-touch.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Inappropriate [legacy version]
+
+# man page for 'touch' is generated differently from others. All other utilities
+# are provided static man source files, while for 'touch' it requires help2man
+# to invoke "touch --help" and then convert the output into the manual. Since touch
+# is with target format which can't be invoked on build system, disable building
+# 'touch' man page here.
+#
+# Signed-off-by Kevin Tian <kevin.tian@intel.com>, 2010-08-18
+# (this patch is licensed under GPLv2)
+
+diff --git a/man/Makefile.am b/man/Makefile.am
+index 32df9d1..37b09e3 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -27,7 +27,7 @@ dist_man_MANS = \
+   paste.1 pathchk.1 pr.1 printenv.1 printf.1 ptx.1 pwd.1 readlink.1 \
+   rm.1 rmdir.1 seq.1 sha1sum.1 sha224sum.1 sha256sum.1 sha384sum.1 sha512sum.1 \
+   shred.1 shuf.1 sleep.1 sort.1 split.1 stat.1 \
+-  su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 touch.1 tr.1 true.1 tsort.1 \
++  su.1 sum.1 sync.1 tac.1 tail.1 tee.1 test.1 tr.1 true.1 tsort.1 \
+   tty.1 unexpand.1 uniq.1 unlink.1 vdir.1 wc.1 \
+   whoami.1 yes.1 $(MAN)
+ optional_mans = \
diff --git a/meta/recipes-core/coreutils/coreutils-8.24/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-core/coreutils/coreutils-8.24/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..ba1a4ba
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-8.24/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/coreutils/coreutils-8.24/fix-selinux-flask.patch b/meta/recipes-core/coreutils/coreutils-8.24/fix-selinux-flask.patch
new file mode 100644
index 0000000..9d1ae55
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-8.24/fix-selinux-flask.patch
@@ -0,0 +1,39 @@
+From a1d360509fa3a4aff57eedcd528cc0347a87531d Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 16 Sep 2014 01:59:08 -0700
+Subject: [PATCH] gnulib-comp.m4: selinux/flask.h should respect to
+ with_selinux
+
+Fixed when build with meta-selinux even when --without-selinux:
+runcon.c:49:28: fatal error: selinux/flask.h: No such file or directory
+ # include <selinux/flask.h>
+                            ^
+compilation terminated.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ m4/gnulib-comp.m4 |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
+index 472d3a0..5f09734 100644
+--- a/m4/gnulib-comp.m4
++++ b/m4/gnulib-comp.m4
+@@ -1730,11 +1730,11 @@ AC_DEFUN([gl_INIT],
+     AC_LIBOBJ([select])
+   fi
+   gl_SYS_SELECT_MODULE_INDICATOR([select])
+-  AC_CHECK_HEADERS([selinux/flask.h])
+   AC_LIBOBJ([selinux-at])
+   gl_HEADERS_SELINUX_SELINUX_H
+   gl_HEADERS_SELINUX_CONTEXT_H
+   if test "$with_selinux" != no && test "$ac_cv_header_selinux_selinux_h" = yes; then
++    AC_CHECK_HEADERS([selinux/flask.h])
+     AC_LIBOBJ([getfilecon])
+   fi
+   gl_SERVENT
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-core/coreutils/coreutils-8.24/man-decouple-manpages-from-build.patch b/meta/recipes-core/coreutils/coreutils-8.24/man-decouple-manpages-from-build.patch
new file mode 100644
index 0000000..3c896a1
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-8.24/man-decouple-manpages-from-build.patch
@@ -0,0 +1,27 @@
+From b4d258629f090066783c3b4c91b40f63b9d0a296 Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Sun, 8 Feb 2015 16:51:57 -0500
+Subject: [PATCH] man: decouple manpages from build
+
+The use of "help2man" doesn't work at all for cross compile, in
+addition to the extra requirement of perl it adds.
+
+Just decouple the manpages from the build in order to pave the way for
+importing prebuilt manpages that can be used in a cross build situation.
+
+Upstream-Status: Inappropriate [upstream doesn't care about x-compile case.]
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index fb4af27..7576b2c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -214,5 +214,4 @@ AM_CPPFLAGS = -Ilib -I$(top_srcdir)/lib -Isrc -I$(top_srcdir)/src
+ include $(top_srcdir)/lib/local.mk
+ include $(top_srcdir)/src/local.mk
+ include $(top_srcdir)/doc/local.mk
+-include $(top_srcdir)/man/local.mk
+ include $(top_srcdir)/tests/local.mk
+-- 
+2.2.2
+
diff --git a/meta/recipes-core/coreutils/coreutils-8.24/remove-usr-local-lib-from-m4.patch b/meta/recipes-core/coreutils/coreutils-8.24/remove-usr-local-lib-from-m4.patch
new file mode 100644
index 0000000..2ef8a54
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-8.24/remove-usr-local-lib-from-m4.patch
@@ -0,0 +1,31 @@
+We have problem using hardcoded directories like /usr/local here
+which will be checked for cross builds. This is a special case which
+is valid for AIX only. We do not have AIX as one of our supported
+build host or target. Therefore we get rid of the hardcoded paths
+and make life easier for cross compilation process.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [Upstream does care for AIX while we may not]
+
+Index: coreutils-8.14/m4/getloadavg.m4
+===================================================================
+--- coreutils-8.14.orig/m4/getloadavg.m4	2011-09-19 08:09:24.000000000 -0700
++++ coreutils-8.14/m4/getloadavg.m4	2011-10-19 21:42:00.385533357 -0700
+@@ -41,16 +41,6 @@
+        [LIBS="-lutil $LIBS" gl_func_getloadavg_done=yes])
+    fi
+ 
+-   if test $gl_func_getloadavg_done = no; then
+-     # There is a commonly available library for RS/6000 AIX.
+-     # Since it is not a standard part of AIX, it might be installed locally.
+-     gl_getloadavg_LIBS=$LIBS
+-     LIBS="-L/usr/local/lib $LIBS"
+-     AC_CHECK_LIB([getloadavg], [getloadavg],
+-                  [LIBS="-lgetloadavg $LIBS" gl_func_getloadavg_done=yes],
+-                  [LIBS=$gl_getloadavg_LIBS])
+-   fi
+-
+    # Set up the replacement function if necessary.
+    if test $gl_func_getloadavg_done = no; then
+      HAVE_GETLOADAVG=0
diff --git a/meta/recipes-core/coreutils/coreutils_6.9.bb b/meta/recipes-core/coreutils/coreutils_6.9.bb
new file mode 100644
index 0000000..4ff1d50
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils_6.9.bb
@@ -0,0 +1,102 @@
+SUMMARY = "The basic file, shell and text manipulation utilities"
+DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
+manipulation utilities. These are the core utilities which are expected to exist on \
+every system."
+
+HOMEPAGE = "http://www.gnu.org/software/coreutils/"
+BUGTRACKER = "http://debbugs.gnu.org/coreutils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+                    file://src/ls.c;beginline=4;endline=16;md5=15ed60f67b1db5fedd5dbc37cf8a9543"
+PR = "r5"
+
+inherit autotools gettext texinfo
+
+SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.bz2 \
+           file://gnulib_m4.patch \
+           file://futimens.patch \
+           file://coreutils-ls-x.patch \
+           file://coreutils-6.9-cp-i-u.patch \
+           file://coreutils-i18n.patch \
+           file://coreutils-overflow.patch \
+           file://coreutils-fix-install.patch \
+           file://man-touch.patch \
+           file://coreutils_fix_for_automake-1.12.patch \
+           file://coreutils-build-with-acl.patch \
+           file://coreutils-fix-texinfo.patch \
+           file://fix_for_manpage_building.patch \
+           "
+
+SRC_URI[md5sum] = "c9607d8495f16e98906e7ed2d9751a06"
+SRC_URI[sha256sum] = "89c2895ad157de50e53298b22d91db116ee4e1dd3fdf4019260254e2e31497b0"
+
+EXTRA_OECONF += "ac_cv_func_getgroups_works=yes \
+                 ac_cv_func_strcoll_works=yes"
+
+# acl is not a default feature
+#
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
+
+# with, without, depends, rdepends
+#
+PACKAGECONFIG[acl] = "ac_cv_header_sys_acl_h=yes,ac_cv_header_sys_acl_h=no,acl,"
+
+
+# [ gets a special treatment and is not included in this
+bindir_progs = "base64 basename cksum comm csplit cut dir dircolors dirname du \
+                env expand expr factor fmt fold groups head hostid id install \
+                join link logname md5sum mkfifo nice nl nohup od paste pathchk \
+                pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \
+                sha384sum sha512sum shred shuf sort split sum tac tail tee test \
+                tr tsort tty unexpand uniq unlink users vdir wc who whoami yes uptime"
+
+# hostname gets a special treatment and is not included in this
+base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
+                     mknod mv pwd rm rmdir sleep stty sync touch true uname hostname stat"
+
+sbindir_progs= "chroot"
+
+# Let aclocal use the relative path for the m4 file rather than the
+# absolute since coreutils has a lot of m4 files, otherwise there might
+# be an "Argument list too long" error when it is built in a long/deep
+# directory.
+acpaths = "-I ./m4"
+
+do_install() {
+	autotools_do_install
+
+	install -d ${D}${base_bindir}
+	[ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
+
+	install -d ${D}${sbindir}
+	[ "${bindir}" != "${sbindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i; done
+
+	# [ requires special handling because [.coreutils will cause the sed stuff
+	# in update-alternatives to fail, therefore use lbracket - the name used
+	# for the actual source file.
+	mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
+
+	# Newer versions of coreutils do not include su, to mimic this behavior
+	# we simply remove it.
+	rm -f ${D}${bindir}/su
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs}"
+
+ALTERNATIVE_PRIORITY[uptime] = "10"
+ALTERNATIVE_PRIORITY[hostname] = "10"
+
+ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
+ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
+
+python __anonymous() {
+	for prog in d.getVar('base_bindir_progs', True).split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+
+	for prog in d.getVar('sbindir_progs', True).split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog))
+}
diff --git a/meta/recipes-core/coreutils/coreutils_8.24.bb b/meta/recipes-core/coreutils/coreutils_8.24.bb
new file mode 100644
index 0000000..034ebcd
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils_8.24.bb
@@ -0,0 +1,127 @@
+SUMMARY = "The basic file, shell and text manipulation utilities"
+DESCRIPTION = "The GNU Core Utilities provide the basic file, shell and text \
+manipulation utilities. These are the core utilities which are expected to exist on \
+every system."
+HOMEPAGE = "http://www.gnu.org/software/coreutils/"
+BUGTRACKER = "http://debbugs.gnu.org/coreutils"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+                    file://src/ls.c;beginline=5;endline=16;md5=38b79785ca88537b75871782a2a3c6b8"
+DEPENDS = "gmp libcap"
+DEPENDS_class-native = ""
+
+inherit autotools gettext texinfo
+
+SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz;name=tarball \
+           http://distfiles.gentoo.org/distfiles/${BP}-man.tar.xz;name=manpages \
+           file://man-decouple-manpages-from-build.patch \
+           file://remove-usr-local-lib-from-m4.patch \
+           file://fix-selinux-flask.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+          "
+
+SRC_URI[tarball.md5sum] = "40efdbce865d2458d8da0a9dcee7c16c"
+SRC_URI[tarball.sha256sum] = "a2d75286a4b9ef3a13039c2da3868a61be4ee9f17d8ae380a35a97e506972170"
+SRC_URI[manpages.md5sum] = "728a91a5c1095a33cffb9959bb891963"
+SRC_URI[manpages.sha256sum] = "cf0333b5f134a331e0b46e2ddf90666f8bdc3281c1ca2c7ccbb75b437589ce37"
+
+EXTRA_OECONF_class-native = "--without-gmp"
+EXTRA_OECONF_class-target = "--enable-install-program=arch --libexecdir=${libdir}"
+
+# acl is not a default feature
+#
+PACKAGECONFIG_class-target ??= "${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)}"
+PACKAGECONFIG_class-native ??= ""
+
+# with, without, depends, rdepends
+#
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+
+# [ df mktemp base64 gets a special treatment and is not included in this
+bindir_progs = "arch basename chcon cksum comm csplit cut dir dircolors dirname du \
+                env expand expr factor fmt fold groups head hostid id install \
+                join link logname md5sum mkfifo nice nl nohup nproc od paste pathchk \
+                pinky pr printenv printf ptx readlink realpath runcon seq sha1sum sha224sum sha256sum \
+                sha384sum sha512sum shred shuf sort split stdbuf sum tac tail tee test timeout\
+                tr truncate tsort tty unexpand uniq unlink uptime users vdir wc who whoami yes"
+
+# hostname gets a special treatment and is not included in this
+base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \
+                     mknod mv pwd rm rmdir sleep stty sync touch true uname stat"
+
+sbindir_progs= "chroot"
+
+# Let aclocal use the relative path for the m4 file rather than the
+# absolute since coreutils has a lot of m4 files, otherwise there might
+# be an "Argument list too long" error when it is built in a long/deep
+# directory.
+acpaths = "-I ./m4"
+
+# Deal with a separate builddir failure if src doesn't exist when creating version.c/version.h
+do_compile_prepend () {
+	mkdir -p ${B}/src
+}
+
+do_install_append() {
+	for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done
+
+	install -d ${D}${base_bindir}
+	[ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done
+
+	install -d ${D}${sbindir}
+	[ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done
+
+	# [ requires special handling because [.coreutils will cause the sed stuff
+	# in update-alternatives to fail, therefore use lbracket - the name used
+	# for the actual source file.
+	mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN}
+
+	# prebuilt man pages
+	install -d ${D}/${mandir}/man1
+	install -t ${D}/${mandir}/man1 ${S}/man/*.1
+	# prebuilt man pages don't do a separate man page for [ vs test.
+	# see comment above r.e. sed and update-alternatives
+	cp -a ${D}${mandir}/man1/test.1 ${D}${mandir}/man1/lbracket.1.${BPN}
+}
+
+do_install_append_class-native(){
+	# remove groups to fix conflict with shadow-native
+	rm -f ${D}${STAGING_BINDIR_NATIVE}/groups
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df"
+ALTERNATIVE_${PN}-doc = "base64.1 mktemp.1 df.1 lbracket.1 groups.1 kill.1 uptime.1 stat.1"
+
+ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64"
+ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}"
+ALTERNATIVE_LINK_NAME[base64.1] = "${mandir}/man1/base64.1"
+
+ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
+ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}"
+ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
+
+ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df"
+ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}"
+ALTERNATIVE_LINK_NAME[df.1] = "${mandir}/man1/df.1"
+
+ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/["
+ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}"
+ALTERNATIVE_LINK_NAME[lbracket.1] = "${mandir}/man1/lbracket.1"
+
+ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
+ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
+ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+python __anonymous() {
+	for prog in d.getVar('base_bindir_progs', True).split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+
+	for prog in d.getVar('sbindir_progs', True).split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog))
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/dbus-wait/dbus-wait_git.bb b/meta/recipes-core/dbus-wait/dbus-wait_git.bb
new file mode 100644
index 0000000..691dc86
--- /dev/null
+++ b/meta/recipes-core/dbus-wait/dbus-wait_git.bb
@@ -0,0 +1,17 @@
+SUMMARY = "A simple tool to wait for a specific signal over DBus"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/dbus-wait"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "dbus"
+
+SRCREV = "6cc6077a36fe2648a5f993fe7c16c9632f946517"
+PV = "0.1+git${SRCPV}"
+PR = "r2"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-core/dbus/dbus-glib.inc b/meta/recipes-core/dbus/dbus-glib.inc
new file mode 100644
index 0000000..abd0132
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib.inc
@@ -0,0 +1,43 @@
+SUMMARY = "High level language (GLib) binding for D-Bus"
+DESCRIPTION = "GLib bindings for the D-Bus message bus that integrate \
+the D-Bus library with the GLib thread abstraction and main loop."
+HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cf5b3a2f7083750d504333114e738656 \
+                    file://dbus/dbus-glib.h;beginline=7;endline=21;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+SECTION = "base"
+
+DEPENDS = "expat glib-2.0 virtual/libintl dbus-glib-native dbus"
+DEPENDS_class-native = "glib-2.0-native dbus-native"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus-glib/dbus-glib-${PV}.tar.gz \
+           file://no-examples.patch \
+           file://test-install-makefile.patch \
+"
+
+inherit autotools pkgconfig gettext
+
+#default disable regression tests, some unit test code in non testing code
+#PACKAGECONFIG_pn-${PN} = "tests" enable regression tests local.conf
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[tests] = "--enable-tests,,,"
+
+EXTRA_OECONF = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml \
+                --with-dbus-binding-tool=${STAGING_BINDIR_NATIVE}/dbus-binding-tool"
+EXTRA_OECONF_class-native = "--with-introspect-xml=${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml"
+
+PACKAGES += "${PN}-bash-completion ${PN}-tests-dbg ${PN}-tests"
+
+FILES_${PN} = "${libdir}/lib*${SOLIBS}"
+FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d/dbus-bash-completion.sh \
+   ${libexecdir}/dbus-bash-completion-helper"
+FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
+FILES_${PN}-dev += "${bindir}/dbus-binding-tool"
+
+RDEPENDS_${PN}-tests += "dbus-x11"
+FILES_${PN}-tests = "${datadir}/${BPN}/tests"
+FILES_${PN}-tests-dbg = "${datadir}/${BPN}/tests/.debug/* \
+                         ${datadir}/${BPN}/tests/core/.debug/* \
+                         ${datadir}/${BPN}/tests/interfaces/.debug/*"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/dbus/dbus-glib/no-examples.patch b/meta/recipes-core/dbus/dbus-glib/no-examples.patch
new file mode 100644
index 0000000..fbb4967
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib/no-examples.patch
@@ -0,0 +1,15 @@
+Disable compiling examples
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Kevin Tian <kevin.tian@intel.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- dbus-glib-0.70/dbus/Makefile.am.orig	2006-07-23 16:04:43.000000000 +0200
++++ dbus-glib-0.70/dbus/Makefile.am	2006-07-23 16:04:52.000000000 +0200
+@@ -1,4 +1,4 @@
+-SUBDIRS = . examples
++SUBDIRS = .
+ 
+ INCLUDES=-I$(top_srcdir) $(DBUS_CFLAGS) $(DBUS_GLIB_CFLAGS) $(DBUS_GLIB_TOOL_CFLAGS) -DDBUS_COMPILATION=1 -DDBUS_LOCALEDIR=\"$(prefix)/@DATADIRNAME@/locale\" 
+ 
diff --git a/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch b/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch
new file mode 100644
index 0000000..027c82b
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib/test-install-makefile.patch
@@ -0,0 +1,57 @@
+Change Makefile.am to install regression tests for test package purpose.
+
+Upstream-Status: Inappropriate [test not install is for purpose from upstream]
+
+Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ test/Makefile.am            | 3 ++-
+ test/core/Makefile.am       | 3 ++-
+ test/interfaces/Makefile.am | 3 ++-
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/test/Makefile.am b/test/Makefile.am
+index 379c8c3..6580927 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -48,7 +48,8 @@ TESTS = \
+ 	$(test_scripts) \
+ 	$(NULL)
+ 
+-noinst_PROGRAMS = \
++testdir = $(datadir)/@PACKAGE@/tests
++test_PROGRAMS = \
+ 	$(test_programs) \
+ 	$(test_related_programs) \
+ 	$(NULL)
+diff --git a/test/core/Makefile.am b/test/core/Makefile.am
+index e4bceb4..54b077d 100644
+--- a/test/core/Makefile.am
++++ b/test/core/Makefile.am
+@@ -64,7 +64,8 @@ endif
+ 
+ ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
+ ## build even when not doing "make check"
+-noinst_PROGRAMS = \
++testdir = $(datadir)/@PACKAGE@/tests/core
++test_PROGRAMS = \
+ 	test-dbus-glib \
+ 	test-error-mapping \
+ 	test-service-glib \
+diff --git a/test/interfaces/Makefile.am b/test/interfaces/Makefile.am
+index a94d08d..707dcac 100644
+--- a/test/interfaces/Makefile.am
++++ b/test/interfaces/Makefile.am
+@@ -57,7 +57,8 @@ if DBUS_BUILD_TESTS
+ 
+ ## we use noinst_PROGRAMS not check_PROGRAMS for TESTS so that we
+ ## build even when not doing "make check"
+-noinst_PROGRAMS = test-service test-client
++testdir = $(datadir)/@PACKAGE@/tests/interfaces
++test_PROGRAMS = test-service test-client
+ 
+ test_service_SOURCES = \
+ 	test-interfaces.c \
+-- 
+1.9.1
+
diff --git a/meta/recipes-core/dbus/dbus-glib_0.104.bb b/meta/recipes-core/dbus/dbus-glib_0.104.bb
new file mode 100644
index 0000000..c1263c0
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-glib_0.104.bb
@@ -0,0 +1,4 @@
+require dbus-glib.inc
+
+SRC_URI[md5sum] = "5497d2070709cf796f1878c75a72a039"
+SRC_URI[sha256sum] = "bfc1f1a82bfc3ec3ecafe04d0e87bab7e999f50dce4f4a34d0b89caf6bd821f6"
diff --git a/meta/recipes-core/dbus/dbus-test_1.8.20.bb b/meta/recipes-core/dbus/dbus-test_1.8.20.bb
new file mode 100644
index 0000000..704070b
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus-test_1.8.20.bb
@@ -0,0 +1,61 @@
+SUMMARY = "D-Bus test package (for D-bus functionality testing only)"
+HOMEPAGE = "http://dbus.freedesktop.org"
+SECTION = "base"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
+                    file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+
+DEPENDS = "python-pygobject dbus dbus-glib"
+
+RDEPENDS_${PN} += "make"
+RDEPENDS_${PN}-dev = ""
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+           file://tmpdir.patch \
+           file://dbus-1.init  \
+           file://run-ptest \
+           file://python-config.patch \
+           file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+           "
+
+SRC_URI[md5sum] = "b49890bbabedab3a1c3f4f73c7ff8b2b"
+SRC_URI[sha256sum] = "5c4fbf4c64621c96e871da91d2b729a5b00536e116d3c4612a469d924b1b703a"
+
+S="${WORKDIR}/dbus-${PV}"
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/dbus:"
+
+inherit autotools pkgconfig gettext ptest
+
+EXTRA_OECONF_X = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '--with-x', '--without-x', d)}"
+EXTRA_OECONF_X_class-native = "--without-x"
+
+EXTRA_OECONF = "--enable-tests \
+                --enable-modular-tests \
+                --enable-installed-tests \
+                --enable-checks \
+                --enable-asserts \
+                --enable-verbose-mode \
+                --disable-xml-docs \
+                --disable-doxygen-docs \
+                --disable-libaudit \
+                --disable-systemd \
+                --without-systemdsystemunitdir \
+                --with-dbus-test-dir=${PTEST_PATH} \
+                ${EXTRA_OECONF_X}"
+
+do_install() {
+    :
+}
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/test
+	case1="shell printf refs syslog"
+	for i in ${case1}; do install ${B}/test/test-$i ${D}${PTEST_PATH}/test; done
+	case2="marshal syntax corrupt dbus-daemon dbus-daemon-eavesdrop loopback relay"
+	for i in ${case2}; do install ${B}/test/.libs/test-$i ${D}${PTEST_PATH}/test; done
+	case3="bus bus-system bus-launch-helper"
+	for i in ${case3}; do install ${B}/bus/test-$i ${D}${PTEST_PATH}/test; done
+	install ${B}/dbus/test-dbus ${D}${PTEST_PATH}/test
+	cp -r ${B}/test/data ${D}${PTEST_PATH}/test
+}
+RDEPENDS_${PN}-ptest += "bash"
diff --git a/meta/recipes-core/dbus/dbus.inc b/meta/recipes-core/dbus/dbus.inc
new file mode 100644
index 0000000..3971081
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus.inc
@@ -0,0 +1,170 @@
+SUMMARY = "D-Bus message bus"
+DESCRIPTION = "D-Bus is a message bus system, a simple way for applications to talk to one another. In addition to interprocess communication, D-Bus helps coordinate process lifecycle; it makes it simple and reliable to code a \"single instance\" application or daemon, and to launch applications and daemons on demand when their services are needed."
+HOMEPAGE = "http://dbus.freedesktop.org"
+SECTION = "base"
+LICENSE = "AFL-2 | GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10dded3b58148f3f1fd804b26354af3e \
+                    file://dbus/dbus.h;beginline=6;endline=20;md5=7755c9d7abccd5dbd25a6a974538bb3c"
+DEPENDS = "expat virtual/libintl"
+RDEPENDS_dbus_class-native = ""
+RDEPENDS_dbus_class-nativesdk = ""
+PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${PN}-ptest', '', d)}"
+ALLOW_EMPTY_dbus-ptest = "1"
+RDEPENDS_dbus-ptest_class-target = "dbus-test-ptest"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus/dbus-${PV}.tar.gz \
+           file://tmpdir.patch \
+           file://dbus-1.init \
+           file://os-test.patch \
+           file://clear-guid_from_server-if-send_negotiate_unix_f.patch \
+"
+
+inherit useradd autotools pkgconfig gettext update-rc.d
+
+INITSCRIPT_NAME = "dbus-1"
+INITSCRIPT_PARAMS = "start 02 5 3 2 . stop 20 0 1 6 ."
+
+python __anonymous() {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "-r netdev"
+USERADD_PARAM_${PN} = "--system --home ${localstatedir}/lib/dbus \
+                       --no-create-home --shell /bin/false \
+                       --user-group messagebus"
+
+CONFFILES_${PN} = "${sysconfdir}/dbus-1/system.conf ${sysconfdir}/dbus-1/session.conf"
+
+DEBIANNAME_${PN} = "dbus-1"
+
+PACKAGES =+ "${PN}-lib"
+
+OLDPKGNAME = "dbus-x11"
+OLDPKGNAME_class-nativesdk = ""
+
+# for compatibility
+RPROVIDES_${PN} = "${OLDPKGNAME}"
+RREPLACES_${PN} += "${OLDPKGNAME}"
+
+FILES_${PN} = "${bindir}/dbus-daemon* \
+               ${bindir}/dbus-uuidgen \
+               ${bindir}/dbus-cleanup-sockets \
+               ${bindir}/dbus-send \
+               ${bindir}/dbus-monitor \
+               ${bindir}/dbus-launch \
+               ${bindir}/dbus-run-session \
+               ${libexecdir}/dbus* \
+               ${sysconfdir} \
+               ${localstatedir} \
+               ${datadir}/dbus-1/services \
+               ${datadir}/dbus-1/system-services \
+               ${systemd_unitdir}/system/"
+FILES_${PN}-lib = "${libdir}/lib*.so.*"
+RRECOMMENDS_${PN}-lib = "${PN}"
+FILES_${PN}-dev += "${libdir}/dbus-1.0/include ${bindir}/dbus-glib-tool"
+
+pkg_postinst_dbus() {
+	# If both systemd and sysvinit are enabled, mask the dbus-1 init script
+        if ${@bb.utils.contains('DISTRO_FEATURES','systemd sysvinit','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask dbus-1.service
+	fi
+
+	if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
+		/etc/init.d/populate-volatile.sh update
+	fi
+}
+
+EXTRA_OECONF = "--disable-tests \
+                --disable-xml-docs \
+                --disable-doxygen-docs \
+                --disable-libaudit \
+                --disable-systemd \
+                --without-dbus-glib"
+
+EXTRA_OECONF_append_class-native = " --disable-selinux"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+
+# Would like to --enable-systemd but that's a circular build-dependency between
+# systemd<->dbus
+PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir"
+PACKAGECONFIG[x11] = "--with-x --enable-x11-autolaunch,--without-x --disable-x11-autolaunch, virtual/libx11 libsm"
+
+do_install() {
+	autotools_do_install
+
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+		install -d ${D}${sysconfdir}/init.d
+		sed 's:@bindir@:${bindir}:' < ${WORKDIR}/dbus-1.init >${WORKDIR}/dbus-1.init.sh
+		install -m 0755 ${WORKDIR}/dbus-1.init.sh ${D}${sysconfdir}/init.d/dbus-1
+	fi
+
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		for i in dbus.target.wants sockets.target.wants multi-user.target.wants; do \
+			install -d ${D}${systemd_unitdir}/system/$i; done
+		install -m 0644 ${B}/bus/dbus.service ${B}/bus/dbus.socket ${D}${systemd_unitdir}/system/
+		cd ${D}${systemd_unitdir}/system/dbus.target.wants/
+		ln -fs ../dbus.socket ${D}${systemd_unitdir}/system/dbus.target.wants/dbus.socket
+		ln -fs ../dbus.socket ${D}${systemd_unitdir}/system/sockets.target.wants/dbus.socket
+		ln -fs ../dbus.service ${D}${systemd_unitdir}/system/multi-user.target.wants/dbus.service
+	fi
+
+	install -d ${D}${sysconfdir}/default/volatiles
+	echo "d messagebus messagebus 0755 ${localstatedir}/run/dbus none" \
+	     > ${D}${sysconfdir}/default/volatiles/99_dbus
+
+
+	mkdir -p ${D}${localstatedir}/lib/dbus
+
+	chown messagebus:messagebus ${D}${localstatedir}/lib/dbus
+
+	chown root:messagebus ${D}${libexecdir}/dbus-daemon-launch-helper
+	chmod 4755 ${D}${libexecdir}/dbus-daemon-launch-helper
+
+	# Remove Red Hat initscript
+	rm -rf ${D}${sysconfdir}/rc.d
+
+	# Remove empty testexec directory as we don't build tests
+	rm -rf ${D}${libdir}/dbus-1.0/test
+
+	# Remove /var/run as it is created on startup
+	rm -rf ${D}${localstatedir}/run
+}
+
+do_install_class-native() {
+	autotools_do_install
+
+	# for dbus-glib-native introspection generation
+	install -d ${D}${STAGING_DATADIR_NATIVE}/dbus/
+	# N.B. is below install actually required?
+	install -m 0644 bus/session.conf ${D}${STAGING_DATADIR_NATIVE}/dbus/session.conf
+
+	# dbus-glib-native and dbus-glib need this xml file
+	./bus/dbus-daemon --introspect > ${D}${STAGING_DATADIR_NATIVE}/dbus/dbus-bus-introspect.xml
+	
+	# dbus-launch has no X support so lets not install it in case the host
+	# has a more featured and useful version
+	rm -f ${D}${bindir}/dbus-launch
+}
+
+do_install_class-nativesdk() {
+	autotools_do_install
+
+	# dbus-launch has no X support so lets not install it in case the host
+	# has a more featured and useful version
+	rm -f ${D}${bindir}/dbus-launch
+
+	# Remove /var/run to avoid QA error
+	rm -rf ${D}${localstatedir}/run
+}
+BBCLASSEXTEND = "native nativesdk"
+
+INSANE_SKIP_${PN}-ptest += "build-deps"
diff --git a/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch b/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch
new file mode 100644
index 0000000..6bb6d9c
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/clear-guid_from_server-if-send_negotiate_unix_f.patch
@@ -0,0 +1,104 @@
+From b8f84bd39485d3977625c9a8b8e8cff5d23be56f Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Thu, 27 Feb 2014 09:05:02 +0800
+Subject: [PATCH] dbus: clear guid_from_server if send_negotiate_unix_fd
+ failed
+
+Upstream-Status: Submitted
+
+bus-test dispatch test failed with below information:
+    ./bus/bus-test: Running message dispatch test
+    Activating service name='org.freedesktop.DBus.TestSuiteEchoService'
+    Successfully activated service 'org.freedesktop.DBus.TestSuiteEchoService'
+    6363: assertion failed "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0" file "dbus-auth.c" line 1545 function process_ok
+      ./bus/bus-test(_dbus_print_backtrace+0x29) [0x80cb969]
+      ./bus/bus-test(_dbus_abort+0x14) [0x80cfb44]
+      ./bus/bus-test(_dbus_real_assert+0x53) [0x80b52c3]
+      ./bus/bus-test() [0x80e24da]
+      ./bus/bus-test(_dbus_auth_do_work+0x388) [0x80e3848]
+      ./bus/bus-test() [0x80aea49]
+      ./bus/bus-test() [0x80affde]
+      ./bus/bus-test(_dbus_transport_handle_watch+0xb1) [0x80ad841]
+      ./bus/bus-test(_dbus_connection_handle_watch+0x104) [0x8089174]
+      ./bus/bus-test(dbus_watch_handle+0xd8) [0x80b15e8]
+      ./bus/bus-test(_dbus_loop_iterate+0x4a9) [0x80d1509]
+      ./bus/bus-test(bus_test_run_clients_loop+0x5d) [0x808129d]
+      ./bus/bus-test() [0x806cab0]
+      ./bus/bus-test() [0x806e0ca]
+      ./bus/bus-test() [0x806da6f]
+      ./bus/bus-test(_dbus_test_oom_handling+0x18c) [0x80b5c8c]
+      ./bus/bus-test() [0x806f723]
+      ./bus/bus-test(bus_dispatch_test+0x3c) [0x8071aac]
+      ./bus/bus-test(main+0x1b7) [0x805acc7]
+      /lib/libc.so.6(__libc_start_main+0xf3) [0x45f919b3]
+      ./bus/bus-test() [0x805ae39]
+
+The stack is below:
+    #0  0xffffe425 in __kernel_vsyscall ()
+    #1  0x45fa62d6 in raise () from /lib/libc.so.6
+    #2  0x45fa9653 in abort () from /lib/libc.so.6
+    #3  0x080cfb65 in _dbus_abort () at dbus-sysdeps.c:94
+    #4  0x080b52c3 in _dbus_real_assert (condition=0,
+        condition_text=condition_text@entry=0x8117a38 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0",
+        file=file@entry=0x8117273 "dbus-auth.c", line=line@entry=1545,
+        func=func@entry=0x8117f8e <__FUNCTION__.3492> "process_ok")
+        data=0x8157290) at dbus-connection.c:1515
+    #0  0x00000033fee353e9 in raise () from /lib64/libc.so.6
+    #1  0x00000033fee38508 in abort () from /lib64/libc.so.6
+    #2  0x000000000047d585 in _dbus_abort () at dbus-sysdeps.c:94
+    #3  0x0000000000466486 in _dbus_real_assert (condition=<optimized out>,
+        condition_text=condition_text@entry=0x4c2988 "_dbus_string_get_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server) == 0",
+        file=file@entry=0x4c21a5 "dbus-auth.c", line=line@entry=1546,
+        func=func@entry=0x4c2fce <__FUNCTION__.3845> "process_ok")
+        at dbus-internals.c:931
+    #4  0x000000000048d424 in process_ok (args_from_ok=0x7fffffffe480,
+        auth=0x6ff340) at dbus-auth.c:1546
+    #5  handle_client_state_waiting_for_data (auth=0x6ff340,
+        command=<optimized out>, args=0x7fffffffe480) at dbus-auth.c:1996
+    #6  0x000000000048e789 in process_command (auth=0x6ff340) at dbus-auth.c:2208
+    #7  _dbus_auth_do_work (auth=0x6ff340) at dbus-auth.c:2458
+    #8  0x000000000046091d in do_authentication (
+        transport=transport@entry=0x6ffaa0, do_reading=do_reading@entry=1,
+        do_writing=do_writing@entry=0,
+        auth_completed=auth_completed@entry=0x7fffffffe55c)
+        at dbus-transport-socket.c:442
+    #9  0x0000000000461d08 in socket_handle_watch (transport=0x6ffaa0,
+        watch=0x6f4190, flags=1) at dbus-transport-socket.c:921
+    #10 0x000000000045fa3a in _dbus_transport_handle_watch (transport=0x6ffaa0,
+
+Once send_negotiate_unix_fd failed, this failure will happen, since
+auth->guid_from_server has been set to some value before
+send_negotiate_unix_fd. send_negotiate_unix_fd failure will lead to
+this auth be handled by process_ok again, but this auth->guid_from_server
+is not zero.
+
+So we should clear auth->guid_from_server if send_negotiate_unix_fd failed
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ dbus/dbus-auth.c |    9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/dbus/dbus-auth.c b/dbus/dbus-auth.c
+index d2c37a7..37b45c6 100644
+--- a/dbus/dbus-auth.c
++++ b/dbus/dbus-auth.c
+@@ -1571,8 +1571,13 @@ process_ok(DBusAuth *auth,
+   _dbus_verbose ("Got GUID '%s' from the server\n",
+                  _dbus_string_get_const_data (& DBUS_AUTH_CLIENT (auth)->guid_from_server));
+ 
+-  if (auth->unix_fd_possible)
+-    return send_negotiate_unix_fd(auth);
++  if (auth->unix_fd_possible) {
++     if (!send_negotiate_unix_fd(auth)) {
++         _dbus_string_set_length (& DBUS_AUTH_CLIENT (auth)->guid_from_server, 0);
++         return FALSE;
++     }
++     return TRUE;
++  }
+ 
+   _dbus_verbose("Not negotiating unix fd passing, since not possible\n");
+   return send_begin (auth);
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-core/dbus/dbus/dbus-1.init b/meta/recipes-core/dbus/dbus/dbus-1.init
new file mode 100644
index 0000000..42c8629
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/dbus-1.init
@@ -0,0 +1,123 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          dbus
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      1
+# Short-Description: D-Bus systemwide message bus
+# Description:       D-Bus is a simple interprocess messaging system, used
+#                    for sending messages between applications.
+### END INIT INFO
+#
+# -*- coding: utf-8 -*-
+# Debian init.d script for D-BUS
+# Copyright © 2003 Colin Walters <walters@debian.org>
+
+# set -e
+
+# Source function library.
+. /etc/init.d/functions
+
+DAEMON=@bindir@/dbus-daemon
+NAME=dbus
+DAEMONUSER=messagebus           # must match /etc/dbus-1/system.conf
+PIDFILE=/var/run/messagebus.pid # must match /etc/dbus-1/system.conf
+UUIDDIR=/var/lib/dbus
+DESC="system message bus"
+EVENTDIR=/etc/dbus-1/event.d
+
+test -x $DAEMON || exit 0
+
+# Source defaults file; edit that file to configure this script.
+ENABLED=1
+PARAMS=""
+if [ -e /etc/default/dbus ]; then
+  . /etc/default/dbus
+fi
+
+test "$ENABLED" != "0" || exit 0
+
+start_it_up()
+{
+  mkdir -p "`dirname $PIDFILE`"
+  if [ -e $PIDFILE ]; then
+    PIDDIR=/proc/$(cat $PIDFILE)
+    if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${DAEMON}" ]; then 
+      echo "$DESC already started; not starting."
+    else
+      echo "Removing stale PID file $PIDFILE."
+      rm -f $PIDFILE
+    fi
+  fi
+
+  if [ ! -d $UUIDDIR ]; then
+    mkdir -p $UUIDDIR
+    chown $DAEMONUSER $UUIDDIR
+    chgrp $DAEMONUSER $UUIDDIR
+  fi
+ 
+  dbus-uuidgen --ensure  
+
+  echo -n "Starting $DESC: "
+  start-stop-daemon -o --start --quiet --pidfile $PIDFILE \
+    --user $DAEMONUSER --exec $DAEMON -- --system $PARAMS
+  echo "$NAME."
+  if [ -d $EVENTDIR ]; then
+      run-parts --arg=start $EVENTDIR
+  fi
+}
+
+shut_it_down()
+{
+  if [ -d $EVENTDIR ]; then
+      # TODO: --reverse when busybox supports it
+      run-parts --arg=stop $EVENTDIR
+  fi
+  echo -n "Stopping $DESC: "
+  start-stop-daemon -o --stop  --quiet --pidfile $PIDFILE \
+    --user $DAEMONUSER
+  # We no longer include these arguments so that start-stop-daemon
+  # can do its job even given that we may have been upgraded.
+  # We rely on the pidfile being sanely managed
+  # --exec $DAEMON -- --system $PARAMS
+  echo "$NAME."
+  rm -f $PIDFILE
+}
+
+reload_it()
+{
+  echo -n "Reloading $DESC config: "
+  dbus-send --print-reply --system --type=method_call \
+            --dest=org.freedesktop.DBus \
+            / org.freedesktop.DBus.ReloadConfig > /dev/null
+  # hopefully this is enough time for dbus to reload it's config file.
+  echo "done."
+}
+
+case "$1" in
+  start)
+    start_it_up
+  ;;
+  stop)
+    shut_it_down
+  ;;
+  status)
+    status $DAEMON
+    exit $?
+  ;;
+  reload|force-reload)
+    reload_it
+  ;;
+  restart)
+    shut_it_down
+    sleep 1
+    start_it_up
+  ;;
+  *)
+    echo "Usage: /etc/init.d/$NAME {start|stop|status|restart|reload|force-reload}" >&2
+    exit 1
+  ;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/dbus/dbus/os-test.patch b/meta/recipes-core/dbus/dbus/os-test.patch
new file mode 100644
index 0000000..54c257f
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/os-test.patch
@@ -0,0 +1,35 @@
+dbus: remove build host test in configure script
+
+The dbus build tests the build host to detect what initscript
+environment it expects.  Remove the test and set it to "redhat"
+unconditionally as the oe-core initscript has a redhat-style pid file
+path.
+
+Signed-off-by: Andy Ross <andy.ross@windriver.com>
+Upstream-Status: Inappropriate [embedded]
+
+diff -u a/configure.ac b/configure.ac
+--- a/configure.ac	2012-08-28 11:23:43.040609874 -0700
++++ b/configure.ac	2012-08-28 11:54:25.602913945 -0700
+@@ -1348,19 +1348,8 @@
+ AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
+ AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
+ 
+-#### Check our operating system
+-operating_system=unknown
+-if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
+-   operating_system=redhat
+-fi
+-
+-if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
+-   operating_system=slackware
+-fi
+-
+-if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
+-   operating_system=cygwin
+-fi
++#### Build host test removed from upstream code, openembedded initscript is redhat-like:
++operating_system=redhat
+ 
+ #### Sort out init scripts
+ 
diff --git a/meta/recipes-core/dbus/dbus/python-config.patch b/meta/recipes-core/dbus/dbus/python-config.patch
new file mode 100644
index 0000000..2944002
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/python-config.patch
@@ -0,0 +1,25 @@
+When building the dbus-ptest package, we have to enable python.  However
+checking if the host-system python has the necessary library isn't useful.
+
+Disable the python module check for cross compiling.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- dbus-1.6.8/configure.ac.orig	2013-07-11 14:15:58.834554799 -0500
++++ dbus-1.6.8/configure.ac	2013-07-11 14:14:40.969554848 -0500
+@@ -257,13 +257,6 @@
+   # full test coverage is required, Python is a hard dependency
+   AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygobject])
+   AM_PATH_PYTHON([2.6])
+-  AC_MSG_CHECKING([for Python modules for full test coverage])
+-  if "$PYTHON" -c "import dbus, gobject, dbus.mainloop.glib"; then
+-    AC_MSG_RESULT([yes])
+-  else
+-    AC_MSG_RESULT([no])
+-    AC_MSG_ERROR([cannot import dbus, gobject, dbus.mainloop.glib Python modules])
+-  fi
+ else
+   # --enable-tests not given: do not abort if Python is missing
+   AM_PATH_PYTHON([2.6], [], [:])
diff --git a/meta/recipes-core/dbus/dbus/run-ptest b/meta/recipes-core/dbus/dbus/run-ptest
new file mode 100755
index 0000000..c72d083
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+output() {
+  if [ $? -eq 0 ]
+    then echo "PASS: $i"
+    else echo "FAIL: $i"
+  fi
+}
+
+for i in `ls test/test-*`; do ./$i ./test/data DBUS_TEST_HOMEDIR=./test >/dev/null; output; done
diff --git a/meta/recipes-core/dbus/dbus/tmpdir.patch b/meta/recipes-core/dbus/dbus/tmpdir.patch
new file mode 100644
index 0000000..bf086e1
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus/tmpdir.patch
@@ -0,0 +1,44 @@
+From 5105fedd7fa13dadd2d0d864fb77873b83b79a4b Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Thu, 23 Jun 2011 13:52:09 +0200
+Subject: [PATCH] buildsys: hardcode socketdir to /tmp
+
+the TMPDIR env var isn't always pointing to the right target path
+
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+
+Original comment:
+
+	avoid to check tmp dir at build time. instead uses hard coded /tmp here
+	comment added by Kevin Tian <kevin.tian@intel.com>
+---
+ configure.ac |   11 +----------
+ 1 files changed, 1 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 408054b..6d26180 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1483,16 +1483,7 @@ AC_SUBST(TEST_LAUNCH_HELPER_BINARY)
+ AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY, "$TEST_LAUNCH_HELPER_BINARY",
+                    [Full path to the launch helper test program in the builddir])
+ 
+-#### Find socket directories
+-if ! test -z "$TMPDIR" ; then
+-   DEFAULT_SOCKET_DIR=$TMPDIR
+-elif ! test -z "$TEMP" ; then
+-   DEFAULT_SOCKET_DIR=$TEMP
+-elif ! test -z "$TMP" ; then
+-   DEFAULT_SOCKET_DIR=$TMP
+-else
+-   DEFAULT_SOCKET_DIR=/tmp
+-fi
++DEFAULT_SOCKET_DIR=/tmp
+ 
+ DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
+ 
+-- 
+1.6.6.1
+
diff --git a/meta/recipes-core/dbus/dbus_1.8.20.bb b/meta/recipes-core/dbus/dbus_1.8.20.bb
new file mode 100644
index 0000000..a8f2094
--- /dev/null
+++ b/meta/recipes-core/dbus/dbus_1.8.20.bb
@@ -0,0 +1,4 @@
+include dbus.inc
+
+SRC_URI[md5sum] = "b49890bbabedab3a1c3f4f73c7ff8b2b"
+SRC_URI[sha256sum] = "5c4fbf4c64621c96e871da91d2b729a5b00536e116d3c4612a469d924b1b703a"
diff --git a/meta/recipes-core/dropbear/dropbear.inc b/meta/recipes-core/dropbear/dropbear.inc
new file mode 100644
index 0000000..a2c736e
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear.inc
@@ -0,0 +1,106 @@
+SUMMARY = "A lightweight SSH and SCP implementation"
+HOMEPAGE = "http://matt.ucc.asn.au/dropbear/dropbear.html"
+SECTION = "console/network"
+
+# some files are from other projects and have others license terms:
+#   public domain, OpenSSH 3.5p1, OpenSSH3.6.1p2, PuTTY
+LICENSE = "MIT & BSD-3-Clause & BSD-2-Clause & PD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a5ec40cafba26fc4396d0b550f824e01"
+
+DEPENDS = "zlib"
+RPROVIDES_${PN} = "ssh sshd" 
+
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+SRC_URI = "http://matt.ucc.asn.au/dropbear/releases/dropbear-${PV}.tar.bz2 \
+           file://0001-urandom-xauth-changes-to-options.h.patch \
+           file://0003-configure.patch \
+           file://0004-fix-2kb-keys.patch \
+           file://0007-dropbear-fix-for-x32-abi.patch \
+           file://init \
+           file://dropbearkey.service \
+           file://dropbear@.service \
+           file://dropbear.socket \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} "
+
+PAM_SRC_URI = "file://0005-dropbear-enable-pam.patch \
+               file://0006-dropbear-configuration-file.patch \
+               file://dropbear"
+
+PAM_PLUGINS = "libpam-runtime \
+	pam-plugin-deny \
+	pam-plugin-permit \
+	pam-plugin-unix \
+	"
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)}"
+
+inherit autotools update-rc.d systemd
+
+INITSCRIPT_NAME = "dropbear"
+INITSCRIPT_PARAMS = "defaults 10"
+
+SYSTEMD_SERVICE_${PN} = "dropbear.socket"
+
+CFLAGS_prepend = " -I. "
+LD = "${CC}"
+
+SBINCOMMANDS = "dropbear dropbearkey dropbearconvert"
+BINCOMMANDS = "dbclient ssh scp"
+EXTRA_OEMAKE = 'MULTI=1 SCPPROGRESS=1 PROGRAMS="${SBINCOMMANDS} ${BINCOMMANDS}"'
+EXTRA_OECONF += "\
+ ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
+CFLAGS += "-DSFTPSERVER_PATH=\\"${libdir}/openssh/sftp-server\\""
+
+do_install() {
+	install -d ${D}${sysconfdir} \
+		${D}${sysconfdir}/init.d \
+		${D}${sysconfdir}/default \
+		${D}${sysconfdir}/dropbear \
+		${D}${bindir} \
+		${D}${sbindir} \
+		${D}${localstatedir}
+
+	install -m 0755 dropbearmulti ${D}${sbindir}/
+	ln -s ${sbindir}/dropbearmulti ${D}${bindir}/dbclient
+	
+	for i in ${SBINCOMMANDS}
+	do
+		ln -s ./dropbearmulti ${D}${sbindir}/$i
+	done
+	sed -e 's,/etc,${sysconfdir},g' \
+		-e 's,/usr/sbin,${sbindir},g' \
+		-e 's,/var,${localstatedir},g' \
+		-e 's,/usr/bin,${bindir},g' \
+		-e 's,/usr,${prefix},g' ${WORKDIR}/init > ${D}${sysconfdir}/init.d/dropbear
+	chmod 755 ${D}${sysconfdir}/init.d/dropbear
+	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+		install -d ${D}${sysconfdir}/pam.d
+		install -m 0644 ${WORKDIR}/dropbear  ${D}${sysconfdir}/pam.d/
+	fi
+
+	# deal with systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dropbearkey.service ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dropbear@.service ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/dropbear.socket ${D}${systemd_unitdir}/system
+	sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+		-e 's,@BINDIR@,${bindir},g' \
+		-e 's,@SBINDIR@,${sbindir},g' \
+		${D}${systemd_unitdir}/system/dropbear.socket ${D}${systemd_unitdir}/system/*.service
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "20"
+ALTERNATIVE_${PN} = "scp ssh"
+
+ALTERNATIVE_TARGET = "${sbindir}/dropbearmulti"
+
+pkg_postrm_append_${PN} () {
+  if [ -f "${sysconfdir}/dropbear/dropbear_rsa_host_key" ]; then
+        rm ${sysconfdir}/dropbear/dropbear_rsa_host_key
+  fi
+  if [ -f "${sysconfdir}/dropbear/dropbear_dss_host_key" ]; then
+        rm ${sysconfdir}/dropbear/dropbear_dss_host_key
+  fi
+}
diff --git a/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
new file mode 100644
index 0000000..dc9d578
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0001-urandom-xauth-changes-to-options.h.patch
@@ -0,0 +1,23 @@
+Subject: [PATCH 1/6] urandom-xauth-changes-to-options.h
+
+Upstream-Status: Inappropriate [configuration]
+---
+ options.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/options.h b/options.h
+index 7d06322..71a21c2 100644
+--- a/options.h
++++ b/options.h
+@@ -247,7 +247,7 @@ much traffic. */
+ /* The command to invoke for xauth when using X11 forwarding.
+  * "-q" for quiet */
+ #ifndef XAUTH_COMMAND
+-#define XAUTH_COMMAND "/usr/bin/xauth -q"
++#define XAUTH_COMMAND "xauth -q"
+ #endif
+ 
+ /* if you want to enable running an sftp server (such as the one included with
+-- 
+1.7.11.7
+
diff --git a/meta/recipes-core/dropbear/dropbear/0003-configure.patch b/meta/recipes-core/dropbear/dropbear/0003-configure.patch
new file mode 100644
index 0000000..c53ab01
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0003-configure.patch
@@ -0,0 +1,42 @@
+From c5f5c5054c1b15539dccf866e2c3faba7ed68456 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>
+Date: Thu, 25 Apr 2013 00:27:25 +0200
+Subject: [PATCH 3/6] configure: add a variable to allow openpty check to be cached
+
+Upstream-Status: Pending
+
+---
+ configure.ac | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 05461f3..9c16d90 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -166,15 +166,20 @@ AC_ARG_ENABLE(openpty,
+ 			AC_MSG_NOTICE(Not using openpty)
+ 		else
+ 			AC_MSG_NOTICE(Using openpty if available)
+-			AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)])
++			AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
+ 		fi
+ 	],
+ 	[
+ 		AC_MSG_NOTICE(Using openpty if available)
+-		AC_SEARCH_LIBS(openpty, util, [AC_DEFINE(HAVE_OPENPTY)])
++		AC_SEARCH_LIBS(openpty, util, [dropbear_cv_func_have_openpty=yes])
+ 	]
+ )
+-		
++
++if test "x$dropbear_cv_func_have_openpty" = "xyes"; then
++	AC_DEFINE(HAVE_OPENPTY,,Have openpty() function)
++	no_ptc_check=yes
++	no_ptmx_check=yes
++fi
+ 
+ AC_ARG_ENABLE(syslog,
+ 	[  --disable-syslog        Don't include syslog support],
+-- 
+1.7.11.7
+
diff --git a/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch b/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch
new file mode 100644
index 0000000..7539d20
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0004-fix-2kb-keys.patch
@@ -0,0 +1,22 @@
+Subject: [PATCH 4/6] fix 2kb keys
+
+Upstream-Status: Inappropriate [configuration]
+---
+ kex.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kex.h b/kex.h
+index 72430e9..375c677 100644
+--- a/kex.h
++++ b/kex.h
+@@ -67,6 +67,6 @@ struct KEXState {
+ };
+ 
+ 
+-#define MAX_KEXHASHBUF 2000
++#define MAX_KEXHASHBUF 3000
+ 
+ #endif /* _KEX_H_ */
+-- 
+1.7.11.7
+
diff --git a/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
new file mode 100644
index 0000000..c408c57
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0005-dropbear-enable-pam.patch
@@ -0,0 +1,28 @@
+Subject: [PATCH 5/6] dropbear enable pam
+
+dropbear: We need modify file option.h besides enabling pam in \
+configure if we want dropbear to support pam.
+
+Upstream-Status: Pending
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+---
+ options.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: dropbear-2013.62/options.h
+===================================================================
+--- dropbear-2013.62.orig/options.h	2014-01-14 21:53:02.803262009 +0000
++++ dropbear-2013.62/options.h	2014-01-14 21:53:56.119263462 +0000
+@@ -192,9 +192,9 @@
+  * PAM challenge/response.
+  * You can't enable both PASSWORD and PAM. */
+ 
+-#define ENABLE_SVR_PASSWORD_AUTH
++/*#define ENABLE_SVR_PASSWORD_AUTH*/
+ /* PAM requires ./configure --enable-pam */
+-/*#define ENABLE_SVR_PAM_AUTH */
++#define ENABLE_SVR_PAM_AUTH
+ #define ENABLE_SVR_PUBKEY_AUTH
+ 
+ /* Whether to take public key options in 
diff --git a/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
new file mode 100644
index 0000000..fa4c8d0
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0006-dropbear-configuration-file.patch
@@ -0,0 +1,22 @@
+Subject: [PATCH 6/6] dropbear configuration file
+
+dropbear: Change the path ("/etc/pam.d/sshd" as default) to find a pam configuration file \
+to "/etc/pam.d/dropbear for dropbear when enabling pam supporting"
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Maxin B. John <maxin.john@enea.com>
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+---
+diff -Naur dropbear-2013.60-orig/svr-authpam.c dropbear-2013.60/svr-authpam.c
+--- dropbear-2013.60-orig/svr-authpam.c	2013-10-16 16:34:53.000000000 +0200
++++ dropbear-2013.60/svr-authpam.c	2013-10-21 17:04:04.969416055 +0200
+@@ -211,7 +211,7 @@
+ 	userData.passwd = password;
+ 
+ 	/* Init pam */
+-	if ((rc = pam_start("sshd", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
++	if ((rc = pam_start("dropbear", NULL, &pamConv, &pamHandlep)) != PAM_SUCCESS) {
+ 		dropbear_log(LOG_WARNING, "pam_start() failed, rc=%d, %s", 
+ 				rc, pam_strerror(pamHandlep, rc));
+ 		goto cleanup;
diff --git a/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch b/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch
new file mode 100644
index 0000000..b450121
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/0007-dropbear-fix-for-x32-abi.patch
@@ -0,0 +1,140 @@
+Upstream-Status: Pending
+
+The dropbearkey utility built in x32 abi format, when generating ssh
+keys, was getting lost in the infinite loop.
+
+This patch fixes the issue by fixing types of variables and
+parameters of functions used in the code, which were getting
+undesired size, when compiled with the x32 abi toolchain.
+
+2013/05/23
+Received this fix from H J Lu.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+# HG changeset patch
+# User H.J. Lu <hjl.tools@gmail.com>
+# Date 1369344079 25200
+# Node ID a10a1c46b857cc8a3923c3bb6d1504aa25b6052f
+# Parent  e76614145aea67f66e4a4257685c771efba21aa1
+Typdef mp_digit to unsigned long long for MP_64BIT
+
+When GCC is used with MP_64BIT, we should typedef mp_digit to unsigned
+long long instead of unsigned long since for x32, unsigned long is
+32-bit and unsigned long long is 64-bit and it is safe to use unsigned
+long long for 64-bit integer with GCC.
+
+diff -r e76614145aea -r a10a1c46b857 libtommath/tommath.h
+--- a/libtommath/tommath.h	Thu Apr 18 22:57:47 2013 +0800
++++ b/libtommath/tommath.h	Thu May 23 14:21:19 2013 -0700
+@@ -73,7 +73,7 @@
+    typedef signed long long   long64;
+ #endif
+
+-   typedef unsigned long      mp_digit;
++   typedef unsigned long long mp_digit;
+    typedef unsigned long      mp_word __attribute__ ((mode(TI)));
+
+    #define DIGIT_BIT          60
+# HG changeset patch
+# User H.J. Lu <hjl.tools@gmail.com>
+# Date 1369344241 25200
+# Node ID c7555a4cb7ded3a88409ba85f4027baa7af5f536
+# Parent  a10a1c46b857cc8a3923c3bb6d1504aa25b6052f
+Cast to mp_digit when updating *rho
+
+There is
+
+int
+mp_montgomery_setup (mp_int * n, mp_digit * rho)
+
+We should cast to mp_digit instead of unsigned long when updating
+*rho since mp_digit may be unsigned long long and unsigned long long
+may be different from unsigned long, like in x32.
+
+diff -r a10a1c46b857 -r c7555a4cb7de libtommath/bn_mp_montgomery_setup.c
+--- a/libtommath/bn_mp_montgomery_setup.c	Thu May 23 14:21:19 2013 -0700
++++ b/libtommath/bn_mp_montgomery_setup.c	Thu May 23 14:24:01 2013 -0700
+@@ -48,7 +48,7 @@
+ #endif
+
+   /* rho = -1/m mod b */
+-  *rho = (unsigned long)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK;
++  *rho = (mp_digit)(((mp_word)1 << ((mp_word) DIGIT_BIT)) - x) & MP_MASK;
+
+   return MP_OKAY;
+ }
+# HG changeset patch
+# User H.J. Lu <hjl.tools@gmail.com>
+# Date 1369344541 25200
+# Node ID 7c656e7071a6412688b2f30a529a9afac6c7bf5a
+# Parent  c7555a4cb7ded3a88409ba85f4027baa7af5f536
+Define LTC_FAST_TYPE to unsigned long long for __x86_64__
+
+We should define LTC_FAST_TYPE to unsigned long long instead of unsigned
+long if __x86_64__ to support x32 where unsigned long long is 64-bit
+and unsigned long is 32-bit.
+
+diff -r c7555a4cb7de -r 7c656e7071a6 libtomcrypt/src/headers/tomcrypt_cfg.h
+--- a/libtomcrypt/src/headers/tomcrypt_cfg.h	Thu May 23 14:24:01 2013 -0700
++++ b/libtomcrypt/src/headers/tomcrypt_cfg.h	Thu May 23 14:29:01 2013 -0700
+@@ -74,7 +74,7 @@
+    #define ENDIAN_LITTLE
+    #define ENDIAN_64BITWORD
+    #define LTC_FAST
+-   #define LTC_FAST_TYPE    unsigned long
++   #define LTC_FAST_TYPE    unsigned long long
+ #endif
+
+ /* detect PPC32 */
+# HG changeset patch
+# User H.J. Lu <hjl.tools@gmail.com>
+# Date 1369344730 25200
+# Node ID a7d4690158fae4ede2c4e5b56233e83730bf38ee
+# Parent  7c656e7071a6412688b2f30a529a9afac6c7bf5a
+Use unsigned long long aas unsigned 64-bit integer for x86-64 GCC
+
+We should use unsigned long long instead of unsigned long as unsigned
+64-bit integer for x86-64 GCC to support x32 where unsigned long is
+32-bit.
+
+diff -r 7c656e7071a6 -r a7d4690158fa libtomcrypt/src/headers/tomcrypt_macros.h
+--- a/libtomcrypt/src/headers/tomcrypt_macros.h	Thu May 23 14:29:01 2013 -0700
++++ b/libtomcrypt/src/headers/tomcrypt_macros.h	Thu May 23 14:32:10 2013 -0700
+@@ -343,7 +343,7 @@
+ /* 64-bit Rotates */
+ #if !defined(__STRICT_ANSI__) && defined(__GNUC__) && defined(__x86_64__) && !defined(LTC_NO_ASM)
+
+-static inline unsigned long ROL64(unsigned long word, int i)
++static inline unsigned long long ROL64(unsigned long long word, int i)
+ {
+    asm("rolq %%cl,%0"
+       :"=r" (word)
+@@ -351,7 +351,7 @@
+    return word;
+ }
+
+-static inline unsigned long ROR64(unsigned long word, int i)
++static inline unsigned long long ROR64(unsigned long long word, int i)
+ {
+    asm("rorq %%cl,%0"
+       :"=r" (word)
+@@ -361,7 +361,7 @@
+
+ #ifndef LTC_NO_ROLC
+
+-static inline unsigned long ROL64c(unsigned long word, const int i)
++static inline unsigned long long ROL64c(unsigned long long word, const int i)
+ {
+    asm("rolq %2,%0"
+       :"=r" (word)
+@@ -369,7 +369,7 @@
+    return word;
+ }
+
+-static inline unsigned long ROR64c(unsigned long word, const int i)
++static inline unsigned long long ROR64c(unsigned long long word, const int i)
+ {
+    asm("rorq %2,%0"
+       :"=r" (word)
+
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear b/meta/recipes-core/dropbear/dropbear/dropbear
new file mode 100644
index 0000000..47e787f
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear
@@ -0,0 +1,4 @@
+#%PAM-1.0
+
+auth     include  common-auth
+account  include  common-account
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear.socket b/meta/recipes-core/dropbear/dropbear/dropbear.socket
new file mode 100644
index 0000000..e5c61b7
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear.socket
@@ -0,0 +1,10 @@
+[Unit]
+Conflicts=dropbear.service
+
+[Socket]
+ListenStream=22
+Accept=yes
+
+[Install]
+WantedBy=sockets.target
+Also=dropbearkey.service
diff --git a/meta/recipes-core/dropbear/dropbear/dropbear@.service b/meta/recipes-core/dropbear/dropbear/dropbear@.service
new file mode 100644
index 0000000..6fe9942
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbear@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=SSH Per-Connection Server
+Wants=dropbearkey.service
+After=syslog.target dropbearkey.service
+
+[Service]
+EnvironmentFile=-/etc/default/dropbear
+ExecStart=-@SBINDIR@/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key $DROPBEAR_EXTRA_ARGS
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+StandardInput=socket
+KillMode=process
diff --git a/meta/recipes-core/dropbear/dropbear/dropbearkey.service b/meta/recipes-core/dropbear/dropbear/dropbearkey.service
new file mode 100644
index 0000000..ccc21d5
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/dropbearkey.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=SSH Key Generation
+ConditionPathExists=|!/etc/dropbear/dropbear_rsa_host_key
+
+[Service]
+Type=oneshot
+ExecStart=@SBINDIR@/dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
+RemainAfterExit=yes
diff --git a/meta/recipes-core/dropbear/dropbear/init b/meta/recipes-core/dropbear/dropbear/init
new file mode 100755
index 0000000..e8fed3f
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear/init
@@ -0,0 +1,113 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:		sshd
+# Required-Start:	$remote_fs $syslog $networking
+# Required-Stop:	$remote_fs $syslog
+# Default-Start:	2 3 4 5
+# Default-Stop:		1
+# Short-Description:	Dropbear Secure Shell server
+### END INIT INFO
+#
+# Do not configure this file. Edit /etc/default/dropbear instead!
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/dropbear
+NAME=dropbear
+DESC="Dropbear SSH server"
+PIDFILE=/var/run/dropbear.pid
+
+DROPBEAR_PORT=22
+DROPBEAR_EXTRA_ARGS=
+NO_START=0
+
+set -e
+
+test ! -r /etc/default/dropbear || . /etc/default/dropbear
+test "$NO_START" = "0" || exit 0
+test -x "$DAEMON" || exit 0
+test ! -h /var/service/dropbear || exit 0
+
+readonly_rootfs=0
+for flag in `awk '{ if ($2 == "/") { split($4,FLAGS,",") } }; END { for (f in FLAGS) print FLAGS[f] }' </proc/mounts`; do
+  case $flag in
+   ro)
+     readonly_rootfs=1
+     ;;
+  esac
+done
+
+if [ $readonly_rootfs = "1" ]; then
+  mkdir -p /var/lib/dropbear
+  DROPBEAR_RSAKEY_DEFAULT="/var/lib/dropbear/dropbear_rsa_host_key"
+  DROPBEAR_DSSKEY_DEFAULT="/var/lib/dropbear/dropbear_dss_host_key"
+else
+  DROPBEAR_RSAKEY_DEFAULT="/etc/dropbear/dropbear_rsa_host_key"
+  DROPBEAR_DSSKEY_DEFAULT="/etc/dropbear/dropbear_dss_host_key"
+fi
+
+test -z "$DROPBEAR_BANNER" || \
+  DROPBEAR_EXTRA_ARGS="$DROPBEAR_EXTRA_ARGS -b $DROPBEAR_BANNER"
+test -n "$DROPBEAR_RSAKEY" || \
+  DROPBEAR_RSAKEY=$DROPBEAR_RSAKEY_DEFAULT
+test -n "$DROPBEAR_DSSKEY" || \
+  DROPBEAR_DSSKEY=$DROPBEAR_DSSKEY_DEFAULT
+test -n "$DROPBEAR_KEYTYPES" || \
+  DROPBEAR_KEYTYPES="rsa"
+
+gen_keys() {
+for t in $DROPBEAR_KEYTYPES; do
+  case $t in
+    rsa)
+        if [ -f "$DROPBEAR_RSAKEY" -a ! -s "$DROPBEAR_RSAKEY" ]; then
+                rm $DROPBEAR_RSAKEY || true
+        fi
+        test -f $DROPBEAR_RSAKEY || dropbearkey -t rsa -f $DROPBEAR_RSAKEY
+	;;
+    dsa)
+        if [ -f "$DROPBEAR_DSSKEY" -a ! -s "$DROPBEAR_DSSKEY" ]; then
+                rm $DROPBEAR_DSSKEY || true
+        fi
+        test -f $DROPBEAR_DSSKEY || dropbearkey -t dss -f $DROPBEAR_DSSKEY
+	;;
+  esac
+done
+}
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	gen_keys
+	KEY_ARGS=""
+	test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
+	test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
+	start-stop-daemon -S -p $PIDFILE \
+	  -x "$DAEMON" -- $KEY_ARGS \
+	    -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+	start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
+	echo "$NAME."
+	;;
+  restart|force-reload)
+	echo -n "Restarting $DESC: "
+	start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
+	sleep 1
+	KEY_ARGS=""
+	test -f $DROPBEAR_DSSKEY && KEY_ARGS="$KEY_ARGS -d $DROPBEAR_DSSKEY"
+	test -f $DROPBEAR_RSAKEY && KEY_ARGS="$KEY_ARGS -r $DROPBEAR_RSAKEY"
+	start-stop-daemon -S -p $PIDFILE \
+	  -x "$DAEMON" -- $KEY_ARGS \
+	    -p "$DROPBEAR_PORT" $DROPBEAR_EXTRA_ARGS
+	echo "$NAME."
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/dropbear/dropbear_2015.68.bb b/meta/recipes-core/dropbear/dropbear_2015.68.bb
new file mode 100644
index 0000000..1b749d7
--- /dev/null
+++ b/meta/recipes-core/dropbear/dropbear_2015.68.bb
@@ -0,0 +1,4 @@
+require dropbear.inc
+
+SRC_URI[md5sum] = "7664ac10f7cc2301c530eb80c756fc5d"
+SRC_URI[sha256sum] = "55ea7c1e904ffe4b1cdbe1addca8291a2533d7d285fd22ac33608e9502a62446"
diff --git a/meta/recipes-core/expat/expat-2.1.0/autotools.patch b/meta/recipes-core/expat/expat-2.1.0/autotools.patch
new file mode 100644
index 0000000..0e59969
--- /dev/null
+++ b/meta/recipes-core/expat/expat-2.1.0/autotools.patch
@@ -0,0 +1,24 @@
+Avoid using expat's m4 files
+
+Upstream-Status: Inappropriate [Other]
+Workaround specific to our build system.
+
+Signed-off-by: Kevin Tian <kevin.tian@intel.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Updated to apply over expat 2.1.0
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+diff -Nurd expat-2.1.0/configure.in expat-2.1.0/configure.in
+--- expat-2.1.0/configure.in	2012-03-04 01:45:53.000000000 +0200
++++ expat-2.1.0/configure.in	2012-05-10 21:04:44.000000000 +0300
+@@ -51,8 +51,6 @@
+ 
+ AC_CONFIG_HEADER(expat_config.h)
+ 
+-sinclude(conftools/ac_c_bigendian_cross.m4)
+-
+ AC_LIBTOOL_WIN32_DLL
+ AC_PROG_LIBTOOL
+ 
diff --git a/meta/recipes-core/expat/expat.inc b/meta/recipes-core/expat/expat.inc
new file mode 100644
index 0000000..6dfafe9
--- /dev/null
+++ b/meta/recipes-core/expat/expat.inc
@@ -0,0 +1,20 @@
+SUMMARY = "A stream-oriented XML parser library"
+DESCRIPTION = "Expat is an XML parser library written in C. It is a stream-oriented parser in which an application registers handlers for things the parser might find in the XML document (like start tags)"
+HOMEPAGE = "http://expat.sourceforge.net/"
+SECTION = "libs"
+LICENSE = "MIT"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/expat/expat-${PV}.tar.gz \
+           file://autotools.patch"
+
+inherit autotools lib_package gzipnative
+
+# This package uses an archive format known to have issue with some
+# versions of gzip
+do_unpack[depends] += "gzip-native:do_populate_sysroot"
+
+do_configure_prepend () {
+	rm -f ${S}/conftools/libtool.m4
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/expat/expat_2.1.0.bb b/meta/recipes-core/expat/expat_2.1.0.bb
new file mode 100644
index 0000000..b958742
--- /dev/null
+++ b/meta/recipes-core/expat/expat_2.1.0.bb
@@ -0,0 +1,5 @@
+require expat.inc
+LIC_FILES_CHKSUM = "file://COPYING;md5=1b71f681713d1256e1c23b0890920874"
+
+SRC_URI[md5sum] = "dd7dab7a5fea97d2a6a43f511449b7cd"
+SRC_URI[sha256sum] = "823705472f816df21c8f6aa026dd162b280806838bb55b3432b0fb1fcca7eb86"
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch b/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch
new file mode 100644
index 0000000..e4c5f15
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/disable_java.patch
@@ -0,0 +1,39 @@
+
+# Pulled from OpenEmbedded
+# 
+# Commented by: Saul Wold <saul.wold@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gettext-0.16.1/gettext-tools/configure.ac
+===================================================================
+--- gettext-0.16.1.orig/gettext-tools/configure.ac	2006-11-27 09:02:01.000000000 -0800
++++ gettext-0.16.1/gettext-tools/configure.ac	2011-03-16 16:55:36.111396557 -0700
+@@ -36,27 +36,15 @@
+ gt_JAVA_CHOICE
+ 
+ gt_GCJ
+-if test -n "$HAVE_GCJ" && test "$JAVA_CHOICE" = yes; then
+-  BUILDJAVAEXE=yes
+-else
+   BUILDJAVAEXE=no
+-fi
+ AC_SUBST(BUILDJAVAEXE)
+ 
+ gt_JAVAEXEC
+ gt_JAVACOMP([1.3])
+ AC_CHECK_PROG(JAR, jar, jar)
+-if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
+-  BUILDJAVA=yes
+-else
+   BUILDJAVA=no
+-fi
+ AC_SUBST(BUILDJAVA)
+-if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then
+-  TESTJAVA=yes
+-else
+   TESTJAVA=no
+-fi
+ AC_SUBST(TESTJAVA)
+ 
+ gt_CSHARPCOMP
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch b/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch
new file mode 100644
index 0000000..7293f5b
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/fix_aclocal_version.patch
@@ -0,0 +1,110 @@
+
+This patch updates the required version number from 2.61 to the 
+current 2.65 version of aclocal, this will need to be updated 
+when we update aclocal
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by Saul Wold <sgw@linux.intel.com>
+
+Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4	2011-03-17 02:24:36.391519775 -0700
++++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4	2011-03-17 02:24:45.569526073 -0700
+@@ -148,7 +148,7 @@
+   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+   dnl Autoconf >= 2.61 supports dots in --with options.
+-  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
++  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.65]),[-1],[translit([$1],[.],[_])],[$1])])
+   dnl By default, look in $includedir and $libdir.
+   use_additional=yes
+   AC_LIB_WITH_FINAL_PREFIX([
+Index: gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathly/aclocal.m4	2011-03-17 02:24:36.391519775 -0700
++++ gettext-0.16.1/autoconf-lib-link/tests/rpathly/aclocal.m4	2011-03-17 02:24:45.570526904 -0700
+@@ -11,8 +11,8 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+ 
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
+-[m4_fatal([this file was generated for autoconf 2.61.
++m4_if(m4_PACKAGE_VERSION, [2.65],,
++[m4_fatal([this file was generated for autoconf 2.65.
+ You have another version of autoconf.  If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+ 
+Index: gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathx/aclocal.m4	2011-03-17 02:24:36.391519775 -0700
++++ gettext-0.16.1/autoconf-lib-link/tests/rpathx/aclocal.m4	2011-03-17 02:24:45.572525773 -0700
+@@ -11,8 +11,8 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+ 
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
+-[m4_fatal([this file was generated for autoconf 2.61.
++m4_if(m4_PACKAGE_VERSION, [2.65],,
++[m4_fatal([this file was generated for autoconf 2.65.
+ You have another version of autoconf.  If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+ 
+Index: gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathy/aclocal.m4	2011-03-17 02:24:36.391519775 -0700
++++ gettext-0.16.1/autoconf-lib-link/tests/rpathy/aclocal.m4	2011-03-17 02:24:45.578394916 -0700
+@@ -11,7 +11,7 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+ 
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
++m4_if(m4_PACKAGE_VERSION, [2.65],,
+ [m4_fatal([this file was generated for autoconf 2.61.
+ You have another version of autoconf.  If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+Index: gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/tests/rpathz/aclocal.m4	2011-03-17 02:24:36.391519775 -0700
++++ gettext-0.16.1/autoconf-lib-link/tests/rpathz/aclocal.m4	2011-03-17 02:24:45.586395416 -0700
+@@ -11,8 +11,8 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+ 
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
+-[m4_fatal([this file was generated for autoconf 2.61.
++m4_if(m4_PACKAGE_VERSION, [2.65],,
++[m4_fatal([this file was generated for autoconf 2.65.
+ You have another version of autoconf.  If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+ 
+Index: gettext-0.16.1/gettext-tools/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/gettext-tools/aclocal.m4	2006-11-27 09:34:32.000000000 -0800
++++ gettext-0.16.1/gettext-tools/aclocal.m4	2011-03-17 02:27:01.135682807 -0700
+@@ -11,8 +11,8 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+ 
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
+-[m4_fatal([this file was generated for autoconf 2.61.
++m4_if(m4_PACKAGE_VERSION, [2.65],,
++[m4_fatal([this file was generated for autoconf 2.65.
+ You have another version of autoconf.  If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+ 
+Index: gettext-0.16.1/gettext-tools/examples/aclocal.m4
+===================================================================
+--- gettext-0.16.1.orig/gettext-tools/examples/aclocal.m4	2006-11-27 09:16:23.000000000 -0800
++++ gettext-0.16.1/gettext-tools/examples/aclocal.m4	2011-03-17 02:26:52.589396683 -0700
+@@ -11,8 +11,8 @@
+ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ # PARTICULAR PURPOSE.
+ 
+-m4_if(m4_PACKAGE_VERSION, [2.61],,
+-[m4_fatal([this file was generated for autoconf 2.61.
++m4_if(m4_PACKAGE_VERSION, [2.65],,
++[m4_fatal([this file was generated for autoconf 2.65.
+ You have another version of autoconf.  If you want to use that,
+ you should regenerate the build system entirely.], [63])])
+ 
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch b/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch
new file mode 100644
index 0000000..0686149
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/fix_gnu_source_circular.patch
@@ -0,0 +1,348 @@
+
+This patch removes the circular dependency on AC_GNU_SOURCE in
+AC_USE_SYSTEM_EXTENSIONS.
+
+Thanks to Mark Hatle for the timely pointers and fixes.
+
+Upstream-Status: Inappropriate [licensing]
+
+Signed-off-by Saul Wold <sgw@linux.intel.com>
+
+diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4 gettext.patched/gettext-runtime/gnulib-m4/extensions.m4
+--- gettext-0.16.1/gettext-runtime/gnulib-m4/extensions.m4	2006-11-27 09:14:38.000000000 -0800
++++ gettext.patched/gettext-runtime/gnulib-m4/extensions.m4	2011-03-16 23:54:01.711923448 -0700
+@@ -16,43 +16,47 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+-  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+-  AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+-  AC_REQUIRE([AC_GNU_SOURCE])
+-  AC_REQUIRE([AC_AIX])
+-  AC_REQUIRE([AC_MINIX])
+-
+-  AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris.  */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+-  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+-    [ac_cv_safe_to_define___extensions__],
+-    [AC_COMPILE_IFELSE(
+-       [AC_LANG_PROGRAM([
+-#	  define __EXTENSIONS__ 1
+-	  AC_INCLUDES_DEFAULT])],
+-       [ac_cv_safe_to_define___extensions__=yes],
+-       [ac_cv_safe_to_define___extensions__=no])])
+-  test $ac_cv_safe_to_define___extensions__ = yes &&
+-    AC_DEFINE([__EXTENSIONS__])
+-  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+-  AC_DEFINE([_TANDEM_SOURCE])
+-])
++#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
++#[
++#  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
++#  AC_BEFORE([$0], [AC_RUN_IFELSE])
++#
++#  AC_REQUIRE([AC_GNU_SOURCE])
++#  AC_REQUIRE([AC_AIX])
++#  AC_REQUIRE([AC_MINIX])
++#
++#  AH_VERBATIM([__EXTENSIONS__],
++#[/* Enable extensions on Solaris.  */
++##ifndef __EXTENSIONS__
++## undef __EXTENSIONS__
++##endif
++##ifndef _POSIX_PTHREAD_SEMANTICS
++## undef _POSIX_PTHREAD_SEMANTICS
++##endif
++##ifndef _TANDEM_SOURCE
++## undef _TANDEM_SOURCE
++##endif])
++#  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
++#    [ac_cv_safe_to_define___extensions__],
++#    [AC_COMPILE_IFELSE(
++#       [AC_LANG_PROGRAM([
++##	  define __EXTENSIONS__ 1
++#	  AC_INCLUDES_DEFAULT])],
++#       [ac_cv_safe_to_define___extensions__=yes],
++#       [ac_cv_safe_to_define___extensions__=no])])
++#  test $ac_cv_safe_to_define___extensions__ = yes &&
++#    AC_DEFINE([__EXTENSIONS__])
++#  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
++#  AC_DEFINE([_TANDEM_SOURCE])
++#])
+ 
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+ AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+-  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
++[
++   AC_REQUIRE([AC_GNU_SOURCE])
++
++   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
++])
+diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4
+--- gettext-0.16.1/gettext-runtime/gnulib-m4/gnulib-comp.m4	2006-11-27 09:33:19.000000000 -0800
++++ gettext.patched/gettext-runtime/gnulib-m4/gnulib-comp.m4	2011-03-16 23:50:17.471531838 -0700
+@@ -25,7 +25,7 @@
+   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+   AC_REQUIRE([AC_PROG_RANLIB])
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+ ])
+ 
+diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4 gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4
+--- gettext-0.16.1/gettext-runtime/gnulib-m4/mbchar.m4	2006-11-27 09:14:38.000000000 -0800
++++ gettext.patched/gettext-runtime/gnulib-m4/mbchar.m4	2011-03-16 23:50:10.814396529 -0700
+@@ -9,7 +9,7 @@
+ 
+ AC_DEFUN([gl_MBCHAR],
+ [
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+   dnl The following line is that so the user can test HAVE_WCHAR_H
+   dnl before #include "mbchar.h".
+   AC_CHECK_HEADERS_ONCE([wchar.h])
+diff -ru gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4 gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4
+--- gettext-0.16.1/gettext-runtime/gnulib-m4/wcwidth.m4	2006-11-27 09:14:38.000000000 -0800
++++ gettext.patched/gettext-runtime/gnulib-m4/wcwidth.m4	2011-03-16 23:50:08.357396247 -0700
+@@ -7,7 +7,7 @@
+ AC_DEFUN([gl_FUNC_WCWIDTH],
+ [
+   dnl Persuade glibc <wchar.h> to declare wcwidth().
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+ 
+   AC_REQUIRE([AC_C_INLINE])
+   AC_REQUIRE([gt_TYPE_WCHAR_T])
+diff -ru gettext-0.16.1/gettext-runtime/m4/lock.m4 gettext.patched/gettext-runtime/m4/lock.m4
+--- gettext-0.16.1/gettext-runtime/m4/lock.m4	2006-10-24 13:59:59.000000000 -0700
++++ gettext.patched/gettext-runtime/m4/lock.m4	2011-03-16 23:50:04.355891676 -0700
+@@ -35,7 +35,7 @@
+   AC_BEFORE([$0], [gl_ARGP])dnl
+ 
+   AC_REQUIRE([AC_CANONICAL_HOST])
+-  AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
++  dnl AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
+   dnl Check for multithreading.
+   AC_ARG_ENABLE(threads,
+ AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4 gettext.patched/gettext-tools/gnulib-m4/extensions.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/extensions.m4	2006-11-27 09:14:54.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/extensions.m4	2011-03-16 23:53:28.487671266 -0700
+@@ -16,43 +16,47 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+-  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+-  AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+-  AC_REQUIRE([AC_GNU_SOURCE])
+-  AC_REQUIRE([AC_AIX])
+-  AC_REQUIRE([AC_MINIX])
+-
+-  AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris.  */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+-  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+-    [ac_cv_safe_to_define___extensions__],
+-    [AC_COMPILE_IFELSE(
+-       [AC_LANG_PROGRAM([
+-#	  define __EXTENSIONS__ 1
+-	  AC_INCLUDES_DEFAULT])],
+-       [ac_cv_safe_to_define___extensions__=yes],
+-       [ac_cv_safe_to_define___extensions__=no])])
+-  test $ac_cv_safe_to_define___extensions__ = yes &&
+-    AC_DEFINE([__EXTENSIONS__])
+-  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+-  AC_DEFINE([_TANDEM_SOURCE])
+-])
++#AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
++#[
++#  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
++#  AC_BEFORE([$0], [AC_RUN_IFELSE])
++#
++#  AC_REQUIRE([AC_GNU_SOURCE])
++#  AC_REQUIRE([AC_AIX])
++#  AC_REQUIRE([AC_MINIX])
++#
++#  AH_VERBATIM([__EXTENSIONS__],
++#[/* Enable extensions on Solaris.  */
++##ifndef __EXTENSIONS__
++## undef __EXTENSIONS__
++##endif
++##ifndef _POSIX_PTHREAD_SEMANTICS
++## undef _POSIX_PTHREAD_SEMANTICS
++##endif
++##ifndef _TANDEM_SOURCE
++## undef _TANDEM_SOURCE
++##endif])
++#  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
++#    [ac_cv_safe_to_define___extensions__],
++#    [AC_COMPILE_IFELSE(
++#       [AC_LANG_PROGRAM([
++##	  define __EXTENSIONS__ 1
++#	  AC_INCLUDES_DEFAULT])],
++#       [ac_cv_safe_to_define___extensions__=yes],
++#       [ac_cv_safe_to_define___extensions__=no])])
++#  test $ac_cv_safe_to_define___extensions__ = yes &&
++#    AC_DEFINE([__EXTENSIONS__])
++#  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
++#  AC_DEFINE([_TANDEM_SOURCE])
++#])
+ 
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+ AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+-  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
++[
++   AC_REQUIRE([AC_GNU_SOURCE])
++
++   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
++])
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4 gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/fnmatch.m4	2006-11-27 09:14:54.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/fnmatch.m4	2011-03-16 23:52:06.477463671 -0700
+@@ -91,7 +91,7 @@
+ AC_DEFUN([gl_FUNC_FNMATCH_GNU],
+ [
+   dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+ 
+   FNMATCH_H=
+   _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4 gettext.patched/gettext-tools/gnulib-m4/getdelim.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/getdelim.m4	2006-11-27 09:14:54.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/getdelim.m4	2011-03-16 23:52:22.871674845 -0700
+@@ -12,7 +12,7 @@
+ [
+ 
+   dnl Persuade glibc <stdio.h> to declare getdelim().
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+ 
+   AC_REPLACE_FUNCS(getdelim)
+   AC_CHECK_DECLS_ONCE(getdelim)
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4 gettext.patched/gettext-tools/gnulib-m4/getline.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/getline.m4	2006-11-27 09:14:54.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/getline.m4	2011-03-16 23:51:49.829971108 -0700
+@@ -16,7 +16,7 @@
+ AC_DEFUN([gl_FUNC_GETLINE],
+ [
+   dnl Persuade glibc <stdio.h> to declare getline().
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+ 
+   AC_CHECK_DECLS([getline])
+ 
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/gnulib-comp.m4	2006-11-27 09:33:36.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/gnulib-comp.m4	2011-03-16 23:52:18.970450488 -0700
+@@ -25,7 +25,7 @@
+   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+   AC_REQUIRE([AC_PROG_RANLIB])
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+   AC_REQUIRE([gl_LOCK_EARLY])
+ ])
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4 gettext.patched/gettext-tools/gnulib-m4/mbchar.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/mbchar.m4	2006-11-27 09:14:55.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/mbchar.m4	2011-03-16 23:51:40.844410216 -0700
+@@ -9,7 +9,7 @@
+ 
+ AC_DEFUN([gl_MBCHAR],
+ [
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+   dnl The following line is that so the user can test HAVE_WCHAR_H
+   dnl before #include "mbchar.h".
+   AC_CHECK_HEADERS_ONCE([wchar.h])
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/stpcpy.m4	2006-11-27 09:14:55.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/stpcpy.m4	2011-03-16 23:52:14.691396045 -0700
+@@ -7,7 +7,7 @@
+ AC_DEFUN([gl_FUNC_STPCPY],
+ [
+   dnl Persuade glibc <string.h> to declare stpcpy().
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+ 
+   AC_REPLACE_FUNCS(stpcpy)
+   if test $ac_cv_func_stpcpy = no; then
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4 gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/stpncpy.m4	2006-11-27 09:14:55.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/stpncpy.m4	2011-03-16 23:52:10.356641459 -0700
+@@ -7,7 +7,7 @@
+ AC_DEFUN([gl_FUNC_STPNCPY],
+ [
+   dnl Persuade glibc <string.h> to declare stpncpy().
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+ 
+   dnl Both glibc and AIX (4.3.3, 5.1) have an stpncpy() function
+   dnl declared in <string.h>. Its side effects are the same as those
+diff -ru gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4 gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4
+--- gettext-0.16.1/gettext-tools/gnulib-m4/wcwidth.m4	2006-11-27 09:14:55.000000000 -0800
++++ gettext.patched/gettext-tools/gnulib-m4/wcwidth.m4	2011-03-16 23:51:08.260324221 -0700
+@@ -7,7 +7,7 @@
+ AC_DEFUN([gl_FUNC_WCWIDTH],
+ [
+   dnl Persuade glibc <wchar.h> to declare wcwidth().
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+ 
+   AC_REQUIRE([AC_C_INLINE])
+   AC_REQUIRE([gt_TYPE_WCHAR_T])
+diff -ru gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4 gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4
+--- gettext-0.16.1/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4	2006-11-27 09:33:45.000000000 -0800
++++ gettext.patched/gettext-tools/libgettextpo/gnulib-m4/gnulib-comp.m4	2011-03-16 23:51:02.036061317 -0700
+@@ -25,7 +25,7 @@
+   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+   AC_REQUIRE([AC_PROG_RANLIB])
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+   AC_REQUIRE([gl_LOCK_EARLY])
+ ])
+diff -ru gettext-0.16.1/gettext-tools/m4/regex.m4 gettext.patched/gettext-tools/m4/regex.m4
+--- gettext-0.16.1/gettext-tools/m4/regex.m4	2006-11-27 09:02:05.000000000 -0800
++++ gettext.patched/gettext-tools/m4/regex.m4	2011-03-16 23:50:53.533477195 -0700
+@@ -116,7 +116,7 @@
+   dnl to get them.
+ 
+   dnl Persuade glibc <string.h> to declare mempcpy().
+-  AC_REQUIRE([AC_GNU_SOURCE])
++  dnl AC_REQUIRE([AC_GNU_SOURCE])
+ 
+   AC_REQUIRE([AC_C_RESTRICT])
+   AC_REQUIRE([AC_FUNC_ALLOCA])
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch b/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch
new file mode 100644
index 0000000..072fe5f
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/gettext-autoconf-lib-link-no-L.patch
@@ -0,0 +1,19 @@
+
+# Pulled from OpenEmbedded
+# 
+# Commented by: Saul Wold <saul.wold@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+--- gettext-0.17/autoconf-lib-link/m4/lib-link.m4~	2009-04-17 15:12:30.000000000 -0700
++++ gettext-0.17/autoconf-lib-link/m4/lib-link.m4	2009-04-17 15:37:39.000000000 -0700
+@@ -267,6 +267,9 @@
+               fi
+             fi
+           fi
++          dnl Just let the compiler find the library, the compiler and user are smarter then this script
++          dnl when cross compiling and working with a relocated install.
++          found_dir=""
+           if test "X$found_dir" = "X"; then
+             for x in $LDFLAGS $LTLIB[]NAME; do
+               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch b/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch
new file mode 100644
index 0000000..f09e450
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/gettext-vpath.patch
@@ -0,0 +1,20 @@
+
+# Pulled from OpenEmbedded
+# 
+# Commented by: Saul Wold <saul.wold@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gettext-0.16.1/gettext-runtime/intl/Makefile.in
+===================================================================
+--- gettext-0.16.1.orig/gettext-runtime/intl/Makefile.in	2006-11-27 09:02:00.000000000 -0800
++++ gettext-0.16.1/gettext-runtime/intl/Makefile.in	2011-03-16 16:04:49.175419930 -0700
+@@ -35,7 +35,7 @@
+ #    'make' does the wrong thing if GNU gettext was configured with
+ #    "./configure --srcdir=`pwd`", namely it gets confused by the .lo and .la
+ #    files it finds in srcdir = ../../gettext-runtime/intl.
+-VPATH = $(srcdir)
++#VPATH = $(srcdir)
+ 
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch b/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch
new file mode 100644
index 0000000..4da8dd4
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/hardcode_macro_version.patch
@@ -0,0 +1,51 @@
+
+This patch hardcodes in version 0.17 for the GETTEXT_MACRO_VERSION,
+the version check is only part of 0.17 and will not affect any 0.16.1
+operations
+
+Upstream-Status: Inappropriate [licensing]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: gettext-0.16.1/gettext-runtime/m4/po.m4
+===================================================================
+--- gettext-0.16.1.orig/gettext-runtime/m4/po.m4	2011-03-17 02:24:28.953520231 -0700
++++ gettext-0.16.1/gettext-runtime/m4/po.m4	2011-03-17 02:28:25.455396862 -0700
+@@ -27,6 +27,9 @@
+   AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+   AC_REQUIRE([AM_NLS])dnl
+ 
++  dnl Hardcode the MACRO_VERSION to 0.17 for gnutls
++  AC_SUBST([GETTEXT_MACRO_VERSION], [0.17])
++
+   dnl Perform the following tests also if --disable-nls has been given,
+   dnl because they are needed for "make dist" to work.
+ 
+Index: gettext-0.16.1/gettext-runtime/po/Makefile.in.in
+===================================================================
+--- gettext-0.16.1.orig/gettext-runtime/po/Makefile.in.in	2011-03-17 02:24:28.953520231 -0700
++++ gettext-0.16.1/gettext-runtime/po/Makefile.in.in	2011-03-17 02:28:07.574395144 -0700
+@@ -10,6 +10,9 @@
+ #
+ # Origin: gettext-0.16
+ 
++# Hardcode this value for gnutls building against gplv2 code
++GETTEXT_MACRO_VERSION = 0.17
++
+ PACKAGE = @PACKAGE@
+ VERSION = @VERSION@
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+Index: gettext-0.16.1/gettext-tools/po/Makefile.in.in
+===================================================================
+--- gettext-0.16.1.orig/gettext-tools/po/Makefile.in.in	2011-03-17 02:24:28.953520231 -0700
++++ gettext-0.16.1/gettext-tools/po/Makefile.in.in	2011-03-17 02:28:07.574395144 -0700
+@@ -10,6 +10,9 @@
+ #
+ # Origin: gettext-0.16
+ 
++# Hardcode this value for gnutls building against gplv2 code
++GETTEXT_MACRO_VERSION = 0.17
++
+ PACKAGE = @PACKAGE@
+ VERSION = @VERSION@
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
diff --git a/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch b/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch
new file mode 100644
index 0000000..d921069
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.16.1/linklib_from_0.17.patch
@@ -0,0 +1,720 @@
+
+# Pulled from OpenEmbedded
+# 
+# Commented by: Saul Wold <saul.wold@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/m4/lib-link.m4	2006-11-27 09:01:58.000000000 -0800
++++ gettext-0.16.1/autoconf-lib-link/m4/lib-link.m4	2011-03-17 00:36:08.710836720 -0700
+@@ -6,12 +6,14 @@
+ 
+ dnl From Bruno Haible.
+ 
+-AC_PREREQ(2.50)
++AC_PREREQ(2.54)
+ 
+ dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+ dnl the libraries corresponding to explicit and implicit dependencies.
+ dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+ dnl augments the CPPFLAGS variable.
++dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
++dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+ AC_DEFUN([AC_LIB_LINKFLAGS],
+ [
+   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+@@ -24,13 +26,16 @@
+     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
++    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
+   ])
+   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
++  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
+   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+   AC_SUBST([LIB]NAME)
+   AC_SUBST([LTLIB]NAME)
++  AC_SUBST([LIB]NAME[_PREFIX])
+   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+   dnl results of this search when this library appears as a dependency.
+   HAVE_LIB[]NAME=yes
+@@ -46,6 +51,8 @@
+ dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+ dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+ dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
++dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
++dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+ [
+   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+@@ -82,17 +89,24 @@
+     CPPFLAGS="$ac_save_CPPFLAGS"
+     LIB[]NAME=
+     LTLIB[]NAME=
++    LIB[]NAME[]_PREFIX=
++
+   fi
+   AC_SUBST([HAVE_LIB]NAME)
+   AC_SUBST([LIB]NAME)
+   AC_SUBST([LTLIB]NAME)
++  AC_SUBST([LIB]NAME[_PREFIX])
+   undefine([Name])
+   undefine([NAME])
+ ])
+ 
+ dnl Determine the platform dependent parameters needed to use rpath:
+-dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
+-dnl hardcode_direct, hardcode_minus_L.
++dnl   acl_libext,
++dnl   acl_shlibext,
++dnl   acl_hardcode_libdir_flag_spec,
++dnl   acl_hardcode_libdir_separator,
++dnl   acl_hardcode_direct,
++dnl   acl_hardcode_minus_L.
+ AC_DEFUN([AC_LIB_RPATH],
+ [
+   dnl Tell automake >= 1.10 to complain if config.rpath is missing.
+@@ -109,12 +123,14 @@
+     acl_cv_rpath=done
+   ])
+   wl="$acl_cv_wl"
+-  libext="$acl_cv_libext"
+-  shlibext="$acl_cv_shlibext"
+-  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+-  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+-  hardcode_direct="$acl_cv_hardcode_direct"
+-  hardcode_minus_L="$acl_cv_hardcode_minus_L"
++  acl_libext="$acl_cv_libext"
++  acl_shlibext="$acl_cv_shlibext"
++  acl_libname_spec="$acl_cv_libname_spec"
++  acl_library_names_spec="$acl_cv_library_names_spec"
++  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
++  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
++  acl_hardcode_direct="$acl_cv_hardcode_direct"
++  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+   dnl Determine whether the user wants rpath handling at all.
+   AC_ARG_ENABLE(rpath,
+     [  --disable-rpath         do not hardcode runtime library paths],
+@@ -124,20 +140,24 @@
+ dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+ dnl the libraries corresponding to explicit and implicit dependencies.
+ dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
++dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
++dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+ [
+   AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++  dnl Autoconf >= 2.61 supports dots in --with options.
++  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
+   dnl By default, look in $includedir and $libdir.
+   use_additional=yes
+   AC_LIB_WITH_FINAL_PREFIX([
+     eval additional_includedir=\"$includedir\"
+     eval additional_libdir=\"$libdir\"
+   ])
+-  AC_LIB_ARG_WITH([lib$1-prefix],
+-[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
+-  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
++  AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
++[  --with-lib]N_A_M_E[-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
++  --without-lib]N_A_M_E[-prefix     don't search for lib$1 in includedir and libdir],
+ [
+     if test "X$withval" = "Xno"; then
+       use_additional=no
+@@ -158,6 +178,7 @@
+   LIB[]NAME=
+   LTLIB[]NAME=
+   INC[]NAME=
++  LIB[]NAME[]_PREFIX=
+   rpathdirs=
+   ltrpathdirs=
+   names_already_handled=
+@@ -197,27 +218,53 @@
+           found_la=
+           found_so=
+           found_a=
++          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
++          if test -n "$acl_shlibext"; then
++            shrext=".$acl_shlibext"             # typically: shrext=.so
++          else
++            shrext=
++          fi
+           if test $use_additional = yes; then
+-            if test -n "$shlibext" \
+-               && { test -f "$additional_libdir/lib$name.$shlibext" \
+-                    || { test "$shlibext" = dll \
+-                         && test -f "$additional_libdir/lib$name.dll.a"; }; }; then
+-              found_dir="$additional_libdir"
+-              if test -f "$additional_libdir/lib$name.$shlibext"; then
+-                found_so="$additional_libdir/lib$name.$shlibext"
++            dir="$additional_libdir"
++            dnl The same code as in the loop below:
++            dnl First look for a shared library.
++            if test -n "$acl_shlibext"; then
++              if test -f "$dir/$libname$shrext"; then
++                found_dir="$dir"
++                found_so="$dir/$libname$shrext"
+               else
+-                found_so="$additional_libdir/lib$name.dll.a"
++                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
++                  ver=`(cd "$dir" && \
++                        for f in "$libname$shrext".*; do echo "$f"; done \
++                        | sed -e "s,^$libname$shrext\\\\.,," \
++                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
++                        | sed 1q ) 2>/dev/null`
++                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
++                    found_dir="$dir"
++                    found_so="$dir/$libname$shrext.$ver"
++                  fi
++                else
++                  eval library_names=\"$acl_library_names_spec\"
++                  for f in $library_names; do
++                    if test -f "$dir/$f"; then
++                      found_dir="$dir"
++                      found_so="$dir/$f"
++                      break
++                    fi
++                  done
++                fi
+               fi
+-              if test -f "$additional_libdir/lib$name.la"; then
+-                found_la="$additional_libdir/lib$name.la"
++            fi
++            dnl Then look for a static library.
++            if test "X$found_dir" = "X"; then
++              if test -f "$dir/$libname.$acl_libext"; then
++                found_dir="$dir"
++                found_a="$dir/$libname.$acl_libext"
+               fi
+-            else
+-              if test -f "$additional_libdir/lib$name.$libext"; then
+-                found_dir="$additional_libdir"
+-                found_a="$additional_libdir/lib$name.$libext"
+-                if test -f "$additional_libdir/lib$name.la"; then
+-                  found_la="$additional_libdir/lib$name.la"
+-                fi
++            fi
++            if test "X$found_dir" != "X"; then
++              if test -f "$dir/$libname.la"; then
++                found_la="$dir/$libname.la"
+               fi
+             fi
+           fi
+@@ -227,26 +274,44 @@
+               case "$x" in
+                 -L*)
+                   dir=`echo "X$x" | sed -e 's/^X-L//'`
+-                  if test -n "$shlibext" \
+-                     && { test -f "$dir/lib$name.$shlibext" \
+-                          || { test "$shlibext" = dll \
+-                               && test -f "$dir/lib$name.dll.a"; }; }; then
+-                    found_dir="$dir"
+-                    if test -f "$dir/lib$name.$shlibext"; then
+-                      found_so="$dir/lib$name.$shlibext"
++                  dnl First look for a shared library.
++                  if test -n "$acl_shlibext"; then
++                    if test -f "$dir/$libname$shrext"; then
++                      found_dir="$dir"
++                      found_so="$dir/$libname$shrext"
+                     else
+-                      found_so="$dir/lib$name.dll.a"
+-                    fi
+-                    if test -f "$dir/lib$name.la"; then
+-                      found_la="$dir/lib$name.la"
++                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
++                        ver=`(cd "$dir" && \
++                              for f in "$libname$shrext".*; do echo "$f"; done \
++                              | sed -e "s,^$libname$shrext\\\\.,," \
++                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
++                              | sed 1q ) 2>/dev/null`
++                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
++                          found_dir="$dir"
++                          found_so="$dir/$libname$shrext.$ver"
++                        fi
++                      else
++                        eval library_names=\"$acl_library_names_spec\"
++                        for f in $library_names; do
++                          if test -f "$dir/$f"; then
++                            found_dir="$dir"
++                            found_so="$dir/$f"
++                            break
++                          fi
++                        done
++                      fi
+                     fi
+-                  else
+-                    if test -f "$dir/lib$name.$libext"; then
++                  fi
++                  dnl Then look for a static library.
++                  if test "X$found_dir" = "X"; then
++                    if test -f "$dir/$libname.$acl_libext"; then
+                       found_dir="$dir"
+-                      found_a="$dir/lib$name.$libext"
+-                      if test -f "$dir/lib$name.la"; then
+-                        found_la="$dir/lib$name.la"
+-                      fi
++                      found_a="$dir/$libname.$acl_libext"
++                    fi
++                  fi
++                  if test "X$found_dir" != "X"; then
++                    if test -f "$dir/$libname.la"; then
++                      found_la="$dir/$libname.la"
+                     fi
+                   fi
+                   ;;
+@@ -282,12 +347,12 @@
+                   ltrpathdirs="$ltrpathdirs $found_dir"
+                 fi
+                 dnl The hardcoding into $LIBNAME is system dependent.
+-                if test "$hardcode_direct" = yes; then
++                if test "$acl_hardcode_direct" = yes; then
+                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+                   dnl resulting binary.
+                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                 else
+-                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
++                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+                     dnl Use an explicit option to hardcode DIR into the resulting
+                     dnl binary.
+                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+@@ -318,13 +383,13 @@
+                     if test -z "$haveit"; then
+                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+                     fi
+-                    if test "$hardcode_minus_L" != no; then
++                    if test "$acl_hardcode_minus_L" != no; then
+                       dnl FIXME: Not sure whether we should use
+                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                       dnl here.
+                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                     else
+-                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
++                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
+                       dnl here, because this doesn't fit in flags passed to the
+                       dnl compiler. So give up. No hardcoding. This affects only
+                       dnl very old systems.
+@@ -512,18 +577,18 @@
+     done
+   done
+   if test "X$rpathdirs" != "X"; then
+-    if test -n "$hardcode_libdir_separator"; then
++    if test -n "$acl_hardcode_libdir_separator"; then
+       dnl Weird platform: only the last -rpath option counts, the user must
+       dnl pass all path elements in one option. We can arrange that for a
+       dnl single library, but not when more than one $LIBNAMEs are used.
+       alldirs=
+       for found_dir in $rpathdirs; do
+-        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
++        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+       done
+-      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
++      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
+       acl_save_libdir="$libdir"
+       libdir="$alldirs"
+-      eval flag=\"$hardcode_libdir_flag_spec\"
++      eval flag=\"$acl_hardcode_libdir_flag_spec\"
+       libdir="$acl_save_libdir"
+       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+     else
+@@ -531,7 +596,7 @@
+       for found_dir in $rpathdirs; do
+         acl_save_libdir="$libdir"
+         libdir="$found_dir"
+-        eval flag=\"$hardcode_libdir_flag_spec\"
++        eval flag=\"$acl_hardcode_libdir_flag_spec\"
+         libdir="$acl_save_libdir"
+         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+       done
+@@ -642,3 +707,79 @@
+   fi
+   AC_SUBST([$1])
+ ])
++
++dnl For those cases where a variable contains several -L and -l options
++dnl referring to unknown libraries and directories, this macro determines the
++dnl necessary additional linker options for the runtime path.
++dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
++dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
++dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
++dnl otherwise linking without libtool is assumed.
++AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
++[
++  AC_REQUIRE([AC_LIB_RPATH])
++  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
++  $1=
++  if test "$enable_rpath" != no; then
++    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
++      dnl Use an explicit option to hardcode directories into the resulting
++      dnl binary.
++      rpathdirs=
++      next=
++      for opt in $2; do
++        if test -n "$next"; then
++          dir="$next"
++          dnl No need to hardcode the standard /usr/lib.
++          if test "X$dir" != "X/usr/$acl_libdirstem"; then
++            rpathdirs="$rpathdirs $dir"
++          fi
++          next=
++        else
++          case $opt in
++            -L) next=yes ;;
++            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
++                 dnl No need to hardcode the standard /usr/lib.
++                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
++                   rpathdirs="$rpathdirs $dir"
++                 fi
++                 next= ;;
++            *) next= ;;
++          esac
++        fi
++      done
++      if test "X$rpathdirs" != "X"; then
++        if test -n ""$3""; then
++          dnl libtool is used for linking. Use -R options.
++          for dir in $rpathdirs; do
++            $1="${$1}${$1:+ }-R$dir"
++          done
++        else
++          dnl The linker is used for linking directly.
++          if test -n "$acl_hardcode_libdir_separator"; then
++            dnl Weird platform: only the last -rpath option counts, the user
++            dnl must pass all path elements in one option.
++            alldirs=
++            for dir in $rpathdirs; do
++              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
++            done
++            acl_save_libdir="$libdir"
++            libdir="$alldirs"
++            eval flag=\"$acl_hardcode_libdir_flag_spec\"
++            libdir="$acl_save_libdir"
++            $1="$flag"
++          else
++            dnl The -rpath options are cumulative.
++            for dir in $rpathdirs; do
++              acl_save_libdir="$libdir"
++              libdir="$dir"
++              eval flag=\"$acl_hardcode_libdir_flag_spec\"
++              libdir="$acl_save_libdir"
++              $1="${$1}${$1:+ }$flag"
++            done
++          fi
++        fi
++      fi
++    fi
++  fi
++  AC_SUBST([$1])
++])
+Index: gettext-0.16.1/autoconf-lib-link/config.rpath
+===================================================================
+--- gettext-0.16.1.orig/autoconf-lib-link/config.rpath	2006-11-27 09:01:58.000000000 -0800
++++ gettext-0.16.1/autoconf-lib-link/config.rpath	2011-03-17 00:33:23.336539490 -0700
+@@ -2,7 +2,7 @@
+ # Output a system dependent set of variables, describing how to set the
+ # run time search path of shared libraries in an executable.
+ #
+-#   Copyright 1996-2006 Free Software Foundation, Inc.
++#   Copyright 1996-2007 Free Software Foundation, Inc.
+ #   Taken from GNU libtool, 2001
+ #   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+ #
+@@ -47,6 +47,18 @@
+ done
+ cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+ 
++# Code taken from libtool.m4's _LT_CC_BASENAME.
++
++for cc_temp in $CC""; do
++  case $cc_temp in
++    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
++    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
++    \-*) ;;
++    *) break;;
++  esac
++done
++cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
++
+ # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+ 
+ wl=
+@@ -64,7 +76,14 @@
+           ;;
+       esac
+       ;;
+-    mingw* | pw32* | os2*)
++    darwin*)
++      case $cc_basename in
++        xlc*)
++          wl='-Wl,'
++          ;;
++      esac
++      ;;
++    mingw* | cygwin* | pw32* | os2*)
+       ;;
+     hpux9* | hpux10* | hpux11*)
+       wl='-Wl,'
+@@ -74,7 +93,7 @@
+       ;;
+     newsos6)
+       ;;
+-    linux*)
++    linux* | k*bsd*-gnu)
+       case $cc_basename in
+         icc* | ecc*)
+           wl='-Wl,'
+@@ -100,7 +119,7 @@
+     osf3* | osf4* | osf5*)
+       wl='-Wl,'
+       ;;
+-    sco3.2v5*)
++    rdos*)
+       ;;
+     solaris*)
+       wl='-Wl,'
+@@ -108,11 +127,14 @@
+     sunos4*)
+       wl='-Qoption ld '
+       ;;
+-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
++    sysv4 | sysv4.2uw2* | sysv4.3*)
+       wl='-Wl,'
+       ;;
+     sysv4*MP*)
+       ;;
++    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
++      wl='-Wl,'
++      ;;
+     unicos*)
+       wl='-Wl,'
+       ;;
+@@ -141,6 +163,10 @@
+     # we just hope/assume this is gcc and not c89 (= MSVC++)
+     with_gnu_ld=yes
+     ;;
++  interix*)
++    # we just hope/assume this is gcc and not c89 (= MSVC++)
++    with_gnu_ld=yes
++    ;;
+   openbsd*)
+     with_gnu_ld=no
+     ;;
+@@ -189,11 +215,11 @@
+         ld_shlibs=no
+       fi
+       ;;
+-    interix3*)
++    interix[3-9]*)
+       hardcode_direct=no
+       hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+       ;;
+-    linux*)
++    gnu* | linux* | k*bsd*-gnu)
+       if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+         :
+       else
+@@ -280,7 +306,7 @@
+             strings "$collect2name" | grep resolve_lib_name >/dev/null
+           then
+             # We have reworked collect2
+-            hardcode_direct=yes
++            :
+           else
+             # We have old collect2
+             hardcode_direct=unsupported
+@@ -359,7 +385,7 @@
+       hardcode_direct=yes
+       hardcode_minus_L=yes
+       ;;
+-    freebsd* | kfreebsd*-gnu | dragonfly*)
++    freebsd* | dragonfly*)
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       ;;
+@@ -412,18 +438,22 @@
+       hardcode_libdir_separator=:
+       ;;
+     openbsd*)
+-      hardcode_direct=yes
+-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+-        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
++      if test -f /usr/libexec/ld.so; then
++        hardcode_direct=yes
++        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
++          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
++        else
++          case "$host_os" in
++            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
++              hardcode_libdir_flag_spec='-R$libdir'
++              ;;
++            *)
++              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
++              ;;
++          esac
++        fi
+       else
+-        case "$host_os" in
+-          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+-            hardcode_libdir_flag_spec='-R$libdir'
+-            ;;
+-          *)
+-            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+-            ;;
+-        esac
++        ld_shlibs=no
+       fi
+       ;;
+     os2*)
+@@ -471,7 +501,7 @@
+         ld_shlibs=yes
+       fi
+       ;;
+-    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
++    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* |sco3.2v5.0.[024]*)
+       ;;
+     sysv5* | sco3.2v5* | sco5v6*)
+       hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+@@ -488,33 +518,51 @@
+ 
+ # Check dynamic linker characteristics
+ # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
++# Unlike libtool.m4, here we don't care about _all_ names of the library, but
++# only about the one the linker finds when passed -lNAME. This is the last
++# element of library_names_spec in libtool.m4, or possibly two of them if the
++# linker has special search rules.
++library_names_spec=      # the last element of library_names_spec in libtool.m4
+ libname_spec='lib$name'
+ case "$host_os" in
+   aix3*)
++    library_names_spec='$libname.a'
+     ;;
+   aix4* | aix5*)
++    library_names_spec='$libname$shrext'
+     ;;
+   amigaos*)
++    library_names_spec='$libname.a'
+     ;;
+   beos*)
++    library_names_spec='$libname$shrext'
+     ;;
+   bsdi[45]*)
++    library_names_spec='$libname$shrext'
+     ;;
+   cygwin* | mingw* | pw32*)
+     shrext=.dll
++    library_names_spec='$libname.dll.a $libname.lib'
+     ;;
+   darwin* | rhapsody*)
+     shrext=.dylib
++    library_names_spec='$libname$shrext'
+     ;;
+   dgux*)
++    library_names_spec='$libname$shrext'
+     ;;
+   freebsd1*)
+     ;;
+-  kfreebsd*-gnu)
+-    ;;
+   freebsd* | dragonfly*)
++    case "$host_os" in
++      freebsd[123]*)
++        library_names_spec='$libname$shrext$versuffix' ;;
++      *)
++        library_names_spec='$libname$shrext' ;;
++    esac
+     ;;
+   gnu*)
++    library_names_spec='$libname$shrext'
+     ;;
+   hpux9* | hpux10* | hpux11*)
+     case $host_cpu in
+@@ -528,10 +576,13 @@
+         shrext=.sl
+         ;;
+     esac
++    library_names_spec='$libname$shrext'
+     ;;
+-  interix3*)
++  interix[3-9]*)
++    library_names_spec='$libname$shrext'
+     ;;
+   irix5* | irix6* | nonstopux*)
++    library_names_spec='$libname$shrext'
+     case "$host_os" in
+       irix5* | nonstopux*)
+         libsuff= shlibsuff=
+@@ -548,33 +599,46 @@
+     ;;
+   linux*oldld* | linux*aout* | linux*coff*)
+     ;;
+-  linux*)
++  linux* | k*bsd*-gnu)
++    library_names_spec='$libname$shrext'
+     ;;
+   knetbsd*-gnu)
++    library_names_spec='$libname$shrext'
+     ;;
+   netbsd*)
++    library_names_spec='$libname$shrext'
+     ;;
+   newsos6)
++    library_names_spec='$libname$shrext'
+     ;;
+   nto-qnx*)
++    library_names_spec='$libname$shrext'
+     ;;
+   openbsd*)
++    library_names_spec='$libname$shrext$versuffix'
+     ;;
+   os2*)
+     libname_spec='$name'
+     shrext=.dll
++    library_names_spec='$libname.a'
+     ;;
+   osf3* | osf4* | osf5*)
++    library_names_spec='$libname$shrext'
+     ;;
+   solaris*)
++    library_names_spec='$libname$shrext'
+     ;;
+   sunos4*)
++    library_names_spec='$libname$shrext$versuffix'
+     ;;
+   sysv4 | sysv4.3*)
++    library_names_spec='$libname$shrext'
+     ;;
+   sysv4*MP*)
++    library_names_spec='$libname$shrext'
+     ;;
+   sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
++    library_names_spec='$libname$shrext'
+     ;;
+   uts4*)
+     ;;
+@@ -583,6 +647,8 @@
+ sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+ escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+ shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
++escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
++escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+ escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+ 
+ LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+@@ -596,6 +662,12 @@
+ # Shared library suffix (normally "so").
+ shlibext="$shlibext"
+ 
++# Format of library name prefix.
++libname_spec="$escaped_libname_spec"
++
++# Library names that the linker finds when passed -lNAME.
++library_names_spec="$escaped_library_names_spec"
++
+ # Flag to hardcode \$libdir into a binary during linking.
+ # This must work even if \$libdir does not exist.
+ hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
diff --git a/meta/recipes-core/gettext/gettext-0.19.4/parallel.patch b/meta/recipes-core/gettext/gettext-0.19.4/parallel.patch
new file mode 100644
index 0000000..c8e2c94
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-0.19.4/parallel.patch
@@ -0,0 +1,23 @@
+instal libgettextlib.a before removing it
+
+In a multiple job build, Makefile can simultaneously
+be installing and removing libgettextlib.a.  We serialize
+the operations.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/gettext-tools/gnulib-lib/Makefile.am
++++ b/gettext-tools/gnulib-lib/Makefile.am
+@@ -57,6 +57,10 @@ endif
+ # Rules generated and collected by gnulib-tool.
+ include Makefile.gnulib
+ 
++# defined in Makefile.gnulib but missing this dependency
++#
++install-exec-clean: install-libLTLIBRARIES
++
+ # Which classes to export from the shared library.
+ MOOPPFLAGS += --dllexport=styled_ostream
+ 
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.19.4/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch b/meta/recipes-core/gettext/gettext-minimal-0.19.4/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch
new file mode 100644
index 0000000..29ef2a5
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.19.4/0001-PATCH-Disable-the-test-to-convert-euc-jp.patch
@@ -0,0 +1,38 @@
+[PATCH] Disable the test to convert euc-jp
+
+Remove the test "Test against HP-UX 11.11 bug:
+No converter from EUC-JP to UTF-8 is provided"
+since we don't support HP-UX and if the euc-jp is not
+installed on the host, the dependence will be built without
+iconv support and will cause guile-native building fail.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ iconv.m4 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/iconv.m4 b/iconv.m4
+index 4e37363..35f54bd 100644
+--- a/iconv.m4
++++ b/iconv.m4
+@@ -165,6 +165,7 @@ AC_DEFUN([AM_ICONV_LINK],
+       }
+   }
+ #endif
++#if 0
+   /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+      provided.  */
+   if (/* Try standardized names.  */
+@@ -176,6 +177,7 @@ AC_DEFUN([AM_ICONV_LINK],
+       /* Try HP-UX names.  */
+       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+     result |= 16;
++#endif
+   return result;
+ ]])],
+           [am_cv_func_iconv_works=yes], ,
+-- 
+2.0.1
+
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.19.4/COPYING b/meta/recipes-core/gettext/gettext-minimal-0.19.4/COPYING
new file mode 100644
index 0000000..8d11d1d
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.19.4/COPYING
@@ -0,0 +1,4 @@
+dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.19.4/Makefile.in.in b/meta/recipes-core/gettext/gettext-minimal-0.19.4/Makefile.in.in
new file mode 100644
index 0000000..8906ba0
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.19.4/Makefile.in.in
@@ -0,0 +1,465 @@
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# This file can be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
+#
+# Origin: gettext-0.19
+GETTEXT_MACRO_VERSION = 0.19
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+
+SED = @SED@
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+MKDIR_P = @MKDIR_P@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
+POFILESDEPS_yes = $(POFILESDEPS_)
+POFILESDEPS_no =
+POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
+
+DISTFILESDEPS_ = update-po
+DISTFILESDEPS_yes = $(DISTFILESDEPS_)
+DISTFILESDEPS_no =
+DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+
+.po.mo:
+	@echo "$(MSGFMT) -c -o $@ $<"; \
+	$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+	@lang=`echo $* | sed -e 's,.*/,,'`; \
+	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+	echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
+	cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+	sed -e '/^#/d' $< > t-$@
+	mv t-$@ $@
+
+
+all: all-@USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# Ensure that the gettext macros and this Makefile.in.in are in sync.
+CHECK_MACRO_VERSION = \
+	test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
+	  || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
+	       exit 1; \
+	     }
+
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+	@$(CHECK_MACRO_VERSION)
+	test ! -f $(srcdir)/$(DOMAIN).pot || \
+	  test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+	@test ! -f $(srcdir)/$(DOMAIN).pot || { \
+	  echo "touch stamp-po" && \
+	  echo timestamp > stamp-poT && \
+	  mv stamp-poT stamp-po; \
+	}
+
+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+# The determination of whether the package xyz is a GNU one is based on the
+# heuristic whether some file in the top level directory mentions "GNU xyz".
+# If GNU 'find' is available, we avoid grepping through monster files.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+	package_gnu="$(PACKAGE_GNU)"; \
+	test -n "$$package_gnu" || { \
+	  if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
+		 LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \
+			       -size -10000000c -exec grep 'GNU @PACKAGE@' \
+			       /dev/null '{}' ';' 2>/dev/null; \
+	       else \
+		 LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
+	       fi; \
+	     } | grep -v 'libtool:' >/dev/null; then \
+	     package_gnu=yes; \
+	   else \
+	     package_gnu=no; \
+	   fi; \
+	}; \
+	if test "$$package_gnu" = "yes"; then \
+	  package_prefix='GNU '; \
+	else \
+	  package_prefix=''; \
+	fi; \
+	if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
+	  msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
+	else \
+	  msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
+	fi; \
+	case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+	  '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
+	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+	      --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+	      --files-from=$(srcdir)/POTFILES.in \
+	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
+	      --msgid-bugs-address="$$msgid_bugs_address" \
+	    ;; \
+	  *) \
+	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+	      --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+	      --files-from=$(srcdir)/POTFILES.in \
+	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
+	      --package-name="$${package_prefix}@PACKAGE@" \
+	      --package-version='@VERSION@' \
+	      --msgid-bugs-address="$$msgid_bugs_address" \
+	    ;; \
+	esac
+	test ! -f $(DOMAIN).po || { \
+	  if test -f $(srcdir)/$(DOMAIN).pot; then \
+	    sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+	    sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+	    if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+	    else \
+	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+	      mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+	    fi; \
+	  else \
+	    mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+	  fi; \
+	}
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+	$(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(POFILESDEPS)
+	@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+	if test -f "$(srcdir)/$${lang}.po"; then \
+	  test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \
+	  test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+	  echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+	  cd $(srcdir) \
+	    && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+	           '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+	             $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
+	           *) \
+	             $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+	         esac; \
+	       }; \
+	else \
+	  $(MAKE) $${lang}.po-create; \
+	fi
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+	if test "$(PACKAGE)" = "gettext-tools"; then \
+	  $(MKDIR_P) $(DESTDIR)$(gettextsrcdir); \
+	  for file in $(DISTFILES.common) Makevars.template; do \
+	    $(INSTALL_DATA) $(srcdir)/$$file \
+			    $(DESTDIR)$(gettextsrcdir)/$$file; \
+	  done; \
+	  for file in Makevars; do \
+	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+	  done; \
+	else \
+	  : ; \
+	fi
+install-data-no: all
+install-data-yes: all
+	@catalogs='$(CATALOGS)'; \
+	for cat in $$catalogs; do \
+	  cat=`basename $$cat`; \
+	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+	  dir=$(localedir)/$$lang/LC_MESSAGES; \
+	  $(MKDIR_P) $(DESTDIR)$$dir; \
+	  if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+	  $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+	  echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+	    if test -n "$$lc"; then \
+	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+	         for file in *; do \
+	           if test -f $$file; then \
+	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+	           fi; \
+	         done); \
+	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+	      else \
+	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+	          :; \
+	        else \
+	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+	        fi; \
+	      fi; \
+	      rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+	      ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+	      ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+	      cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+	      echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+	    fi; \
+	  done; \
+	done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
+	if test "$(PACKAGE)" = "gettext-tools"; then \
+	  $(MKDIR_P) $(DESTDIR)$(gettextsrcdir); \
+	else \
+	  : ; \
+	fi
+installdirs-data-no:
+installdirs-data-yes:
+	@catalogs='$(CATALOGS)'; \
+	for cat in $$catalogs; do \
+	  cat=`basename $$cat`; \
+	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+	  dir=$(localedir)/$$lang/LC_MESSAGES; \
+	  $(MKDIR_P) $(DESTDIR)$$dir; \
+	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+	    if test -n "$$lc"; then \
+	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+	         for file in *; do \
+	           if test -f $$file; then \
+	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+	           fi; \
+	         done); \
+	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+	      else \
+	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+	          :; \
+	        else \
+	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+	        fi; \
+	      fi; \
+	    fi; \
+	  done; \
+	done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall: uninstall-exec uninstall-data
+uninstall-exec:
+uninstall-data: uninstall-data-@USE_NLS@
+	if test "$(PACKAGE)" = "gettext-tools"; then \
+	  for file in $(DISTFILES.common) Makevars.template; do \
+	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+	  done; \
+	else \
+	  : ; \
+	fi
+uninstall-data-no:
+uninstall-data-yes:
+	catalogs='$(CATALOGS)'; \
+	for cat in $$catalogs; do \
+	  cat=`basename $$cat`; \
+	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+	  for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+	    rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+	  done; \
+	done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+	rm -f remove-potcdate.sed
+	rm -f stamp-poT
+	rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+	rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+	rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+	rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+	test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
+	@$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: stamp-po $(DISTFILES)
+	dists="$(DISTFILES)"; \
+	if test "$(PACKAGE)" = "gettext-tools"; then \
+	  dists="$$dists Makevars.template"; \
+	fi; \
+	if test -f $(srcdir)/$(DOMAIN).pot; then \
+	  dists="$$dists $(DOMAIN).pot stamp-po"; \
+	fi; \
+	if test -f $(srcdir)/ChangeLog; then \
+	  dists="$$dists ChangeLog"; \
+	fi; \
+	for i in 0 1 2 3 4 5 6 7 8 9; do \
+	  if test -f $(srcdir)/ChangeLog.$$i; then \
+	    dists="$$dists ChangeLog.$$i"; \
+	  fi; \
+	done; \
+	if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+	for file in $$dists; do \
+	  if test -f $$file; then \
+	    cp -p $$file $(distdir) || exit 1; \
+	  else \
+	    cp -p $(srcdir)/$$file $(distdir) || exit 1; \
+	  fi; \
+	done
+
+update-po: Makefile
+	$(MAKE) $(DOMAIN).pot-update
+	test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
+	$(MAKE) update-gmo
+
+# General rule for creating PO files.
+
+.nop.po-create:
+	@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+	echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+	exit 1
+
+# General rule for updating PO files.
+
+.nop.po-update:
+	@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
+	if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
+	tmpdir=`pwd`; \
+	echo "$$lang:"; \
+	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+	echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+	cd $(srcdir); \
+	if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+	       '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+	         $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+	       *) \
+	         $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+	     esac; \
+	   }; then \
+	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+	    rm -f $$tmpdir/$$lang.new.po; \
+	  else \
+	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+	      :; \
+	    else \
+	      echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+	      exit 1; \
+	    fi; \
+	  fi; \
+	else \
+	  echo "msgmerge for $$lang.po failed!" 1>&2; \
+	  rm -f $$tmpdir/$$lang.new.po; \
+	fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+	@:
+
+# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
+# because execution permission bits may not work on the current file system.
+# Use @SHELL@, which is the shell determined by autoconf for the use by its
+# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+	cd $(top_builddir) \
+	  && @SHELL@ ./config.status $(subdir)/$@.in po-directories
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.19.4/aclocal.tgz b/meta/recipes-core/gettext/gettext-minimal-0.19.4/aclocal.tgz
new file mode 100644
index 0000000..b04ba55
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.19.4/aclocal.tgz
Binary files differ
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.19.4/config.rpath b/meta/recipes-core/gettext/gettext-minimal-0.19.4/config.rpath
new file mode 100755
index 0000000..b625621
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.19.4/config.rpath
@@ -0,0 +1,684 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+#   Copyright 1996-2014 Free Software Foundation, Inc.
+#   Taken from GNU libtool, 2001
+#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+#   This file is free software; the Free Software Foundation gives
+#   unlimited permission to copy and/or distribute it, with or without
+#   modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+#   than 256 bytes, otherwise the compiler driver will dump core. The only
+#   known workaround is to choose shorter directory names for the build
+#   directory and/or the installation directory.
+
+# All known linkers require a '.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's _LT_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+  wl='-Wl,'
+else
+  case "$host_os" in
+    aix*)
+      wl='-Wl,'
+      ;;
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      ;;
+    hpux9* | hpux10* | hpux11*)
+      wl='-Wl,'
+      ;;
+    irix5* | irix6* | nonstopux*)
+      wl='-Wl,'
+      ;;
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+        ecc*)
+          wl='-Wl,'
+          ;;
+        icc* | ifort*)
+          wl='-Wl,'
+          ;;
+        lf95*)
+          wl='-Wl,'
+          ;;
+        nagfor*)
+          wl='-Wl,-Wl,,'
+          ;;
+        pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+          wl='-Wl,'
+          ;;
+        ccc*)
+          wl='-Wl,'
+          ;;
+        xl* | bgxl* | bgf* | mpixl*)
+          wl='-Wl,'
+          ;;
+        como)
+          wl='-lopt='
+          ;;
+        *)
+          case `$CC -V 2>&1 | sed 5q` in
+            *Sun\ F* | *Sun*Fortran*)
+              wl=
+              ;;
+            *Sun\ C*)
+              wl='-Wl,'
+              ;;
+          esac
+          ;;
+      esac
+      ;;
+    newsos6)
+      ;;
+    *nto* | *qnx*)
+      ;;
+    osf3* | osf4* | osf5*)
+      wl='-Wl,'
+      ;;
+    rdos*)
+      ;;
+    solaris*)
+      case $cc_basename in
+        f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+          wl='-Qoption ld '
+          ;;
+        *)
+          wl='-Wl,'
+          ;;
+      esac
+      ;;
+    sunos4*)
+      wl='-Qoption ld '
+      ;;
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      wl='-Wl,'
+      ;;
+    sysv4*MP*)
+      ;;
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      wl='-Wl,'
+      ;;
+    unicos*)
+      wl='-Wl,'
+      ;;
+    uts4*)
+      ;;
+  esac
+fi
+
+# Code taken from libtool.m4's _LT_LINKER_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+  # Set some defaults for GNU ld with shared library support. These
+  # are reset later if shared libraries are not supported. Putting them
+  # here allows them to be overridden if necessary.
+  # Unlike libtool, we use -rpath here, not --rpath, since the documented
+  # option of GNU ld is called -rpath, not --rpath.
+  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+  case "$host_os" in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+        ld_shlibs=no
+      fi
+      ;;
+    amigaos*)
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
+      ;;
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    cygwin* | mingw* | pw32* | cegcc*)
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    haiku*)
+      ;;
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      ;;
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    netbsd*)
+      ;;
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+        ld_shlibs=no
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+          ld_shlibs=no
+          ;;
+        *)
+          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+          else
+            ld_shlibs=no
+          fi
+          ;;
+      esac
+      ;;
+    sunos4*)
+      hardcode_direct=yes
+      ;;
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+  esac
+  if test "$ld_shlibs" = no; then
+    hardcode_libdir_flag_spec=
+  fi
+else
+  case "$host_os" in
+    aix3*)
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes; then
+        # Neither direct hardcoding nor static linking is supported with a
+        # broken collect2.
+        hardcode_direct=unsupported
+      fi
+      ;;
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+        # On IA64, the linker does run time linking by default, so we don't
+        # have to do anything special.
+        aix_use_runtimelinking=no
+      else
+        aix_use_runtimelinking=no
+        # Test if we are trying to use run time linking or normal
+        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+        # need to do runtime linking.
+        case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+          for ld_flag in $LDFLAGS; do
+            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+              aix_use_runtimelinking=yes
+              break
+            fi
+          done
+          ;;
+        esac
+      fi
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      if test "$GCC" = yes; then
+        case $host_os in aix4.[012]|aix4.[012].*)
+          collect2name=`${CC} -print-prog-name=collect2`
+          if test -f "$collect2name" && \
+            strings "$collect2name" | grep resolve_lib_name >/dev/null
+          then
+            # We have reworked collect2
+            :
+          else
+            # We have old collect2
+            hardcode_direct=unsupported
+            hardcode_minus_L=yes
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_libdir_separator=
+          fi
+          ;;
+        esac
+      fi
+      # Begin _LT_AC_SYS_LIBPATH_AIX.
+      echo 'int main () { return 0; }' > conftest.c
+      ${CC} ${LDFLAGS} conftest.c -o conftest
+      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      if test -z "$aix_libpath"; then
+        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      fi
+      if test -z "$aix_libpath"; then
+        aix_libpath="/usr/lib:/lib"
+      fi
+      rm -f conftest.c conftest
+      # End _LT_AC_SYS_LIBPATH_AIX.
+      if test "$aix_use_runtimelinking" = yes; then
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+      else
+        if test "$host_cpu" = ia64; then
+          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+        else
+          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        fi
+      fi
+      ;;
+    amigaos*)
+      case "$host_cpu" in
+        powerpc)
+          ;;
+        m68k)
+          hardcode_libdir_flag_spec='-L$libdir'
+          hardcode_minus_L=yes
+          ;;
+      esac
+      ;;
+    bsdi[45]*)
+      ;;
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      libext=lib
+      ;;
+    darwin* | rhapsody*)
+      hardcode_direct=no
+      if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    dgux*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    freebsd2.[01]*)
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    freebsd* | dragonfly*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    hpux9*)
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      ;;
+    hpux10*)
+      if test "$with_gnu_ld" = no; then
+        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator=:
+        hardcode_direct=yes
+        # hardcode_minus_L: Not really in the search PATH,
+        # but as the default location of the library.
+        hardcode_minus_L=yes
+      fi
+      ;;
+    hpux11*)
+      if test "$with_gnu_ld" = no; then
+        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator=:
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct=no
+            ;;
+          *)
+            hardcode_direct=yes
+            # hardcode_minus_L: Not really in the search PATH,
+            # but as the default location of the library.
+            hardcode_minus_L=yes
+            ;;
+        esac
+      fi
+      ;;
+    irix5* | irix6* | nonstopux*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    netbsd*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    newsos6)
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    *nto* | *qnx*)
+      ;;
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+        hardcode_direct=yes
+        if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+          hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+        else
+          case "$host_os" in
+            openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+              hardcode_libdir_flag_spec='-R$libdir'
+              ;;
+            *)
+              hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+              ;;
+          esac
+        fi
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      ;;
+    osf3*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    osf4* | osf5*)
+      if test "$GCC" = yes; then
+        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+        # Both cc and cxx compiler support -rpath directly
+        hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+    solaris*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      ;;
+    sunos4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    sysv4)
+      case $host_vendor in
+        sni)
+          hardcode_direct=yes # is this really true???
+          ;;
+        siemens)
+          hardcode_direct=no
+          ;;
+        motorola)
+          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+          ;;
+      esac
+      ;;
+    sysv4.3*)
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+        ld_shlibs=yes
+      fi
+      ;;
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      ;;
+    sysv5* | sco3.2v5* | sco5v6*)
+      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator=':'
+      ;;
+    uts4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    *)
+      ld_shlibs=no
+      ;;
+  esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec=      # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+  aix3*)
+    library_names_spec='$libname.a'
+    ;;
+  aix[4-9]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  amigaos*)
+    case "$host_cpu" in
+      powerpc*)
+        library_names_spec='$libname$shrext' ;;
+      m68k)
+        library_names_spec='$libname.a' ;;
+    esac
+    ;;
+  beos*)
+    library_names_spec='$libname$shrext'
+    ;;
+  bsdi[45]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  cygwin* | mingw* | pw32* | cegcc*)
+    shrext=.dll
+    library_names_spec='$libname.dll.a $libname.lib'
+    ;;
+  darwin* | rhapsody*)
+    shrext=.dylib
+    library_names_spec='$libname$shrext'
+    ;;
+  dgux*)
+    library_names_spec='$libname$shrext'
+    ;;
+  freebsd[23].*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  freebsd* | dragonfly*)
+    library_names_spec='$libname$shrext'
+    ;;
+  gnu*)
+    library_names_spec='$libname$shrext'
+    ;;
+  haiku*)
+    library_names_spec='$libname$shrext'
+    ;;
+  hpux9* | hpux10* | hpux11*)
+    case $host_cpu in
+      ia64*)
+        shrext=.so
+        ;;
+      hppa*64*)
+        shrext=.sl
+        ;;
+      *)
+        shrext=.sl
+        ;;
+    esac
+    library_names_spec='$libname$shrext'
+    ;;
+  interix[3-9]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  irix5* | irix6* | nonstopux*)
+    library_names_spec='$libname$shrext'
+    case "$host_os" in
+      irix5* | nonstopux*)
+        libsuff= shlibsuff=
+        ;;
+      *)
+        case $LD in
+          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+          *) libsuff= shlibsuff= ;;
+        esac
+        ;;
+    esac
+    ;;
+  linux*oldld* | linux*aout* | linux*coff*)
+    ;;
+  linux* | k*bsd*-gnu | kopensolaris*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  knetbsd*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  netbsd*)
+    library_names_spec='$libname$shrext'
+    ;;
+  newsos6)
+    library_names_spec='$libname$shrext'
+    ;;
+  *nto* | *qnx*)
+    library_names_spec='$libname$shrext'
+    ;;
+  openbsd*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  os2*)
+    libname_spec='$name'
+    shrext=.dll
+    library_names_spec='$libname.a'
+    ;;
+  osf3* | osf4* | osf5*)
+    library_names_spec='$libname$shrext'
+    ;;
+  rdos*)
+    ;;
+  solaris*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sunos4*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  sysv4 | sysv4.3*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sysv4*MP*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+    library_names_spec='$libname$shrext'
+    ;;
+  tpf*)
+    library_names_spec='$libname$shrext'
+    ;;
+  uts4*)
+    library_names_spec='$libname$shrext'
+    ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/meta/recipes-core/gettext/gettext-minimal-0.19.4/remove-potcdate.sin b/meta/recipes-core/gettext/gettext-minimal-0.19.4/remove-potcdate.sin
new file mode 100644
index 0000000..2436c49
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-0.19.4/remove-potcdate.sin
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/meta/recipes-core/gettext/gettext-minimal-native_0.19.4.bb b/meta/recipes-core/gettext/gettext-minimal-native_0.19.4.bb
new file mode 100644
index 0000000..1d4a443
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext-minimal-native_0.19.4.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Minimal gettext for supporting native autoconf/automake"
+DESCRIPTION = "Contains the m4 macros sufficient to support building \
+autoconf/automake. This provides a significant build time speedup by \
+the removal of gettext-native from most dependency chains (now only \
+needed for gettext for the target)."
+SRC_URI = "file://aclocal.tgz \
+           file://config.rpath \
+           file://Makefile.in.in \
+           file://remove-potcdate.sin \
+           file://COPYING \
+           file://0001-PATCH-Disable-the-test-to-convert-euc-jp.patch \
+"
+
+INHIBIT_DEFAULT_DEPS = "1"
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+LICENSE = "FSF-Unlimited"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1b20675cd5158442f6007d022f46b35b"
+
+inherit native
+
+
+S = "${WORKDIR}"
+
+do_install () {
+	install -d ${D}${datadir}/aclocal/
+	cp ${WORKDIR}/*.m4 ${D}${datadir}/aclocal/
+	install -d ${D}${datadir}/gettext/po/
+	cp ${WORKDIR}/config.rpath ${D}${datadir}/gettext/
+	cp ${WORKDIR}/Makefile.in.in ${D}${datadir}/gettext/po/
+	cp ${WORKDIR}/remove-potcdate.sin ${D}${datadir}/gettext/po/
+}
diff --git a/meta/recipes-core/gettext/gettext_0.16.1.bb b/meta/recipes-core/gettext/gettext_0.16.1.bb
new file mode 100644
index 0000000..f9f7a7f
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext_0.16.1.bb
@@ -0,0 +1,107 @@
+SUMMARY = "Utilities and libraries for producing multi-lingual messages"
+DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
+HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html"
+SECTION = "libs"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9ea3144f04c41cd2eada5d3f472e6ea5"
+
+PR = "r6"
+DEPENDS = "virtual/libiconv"
+DEPENDS_class-native = ""
+PROVIDES = "virtual/libintl virtual/gettext"
+PROVIDES_class-native = ""
+
+SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
+           file://gettext-vpath.patch \
+           file://linklib_from_0.17.patch \
+	   file://gettext-autoconf-lib-link-no-L.patch \
+           file://disable_java.patch \
+           file://fix_aclocal_version.patch \
+           file://fix_gnu_source_circular.patch \
+           file://hardcode_macro_version.patch \
+          "
+
+LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread "
+
+SRC_URI[md5sum] = "3d9ad24301c6d6b17ec30704a13fe127"
+SRC_URI[sha256sum] = "0bf850d1a079fb5a61f0a47b1a9efd35eb44032255375e1cedb0253bc27b376d"
+
+PARALLEL_MAKE = ""
+
+inherit autotools texinfo
+
+EXTRA_OECONF += "--without-lisp --disable-csharp --disable-openmp --without-emacs"
+acpaths = '-I ${S}/autoconf-lib-link/m4/ \
+           -I ${S}/gettext-runtime/m4 \
+           -I ${S}/gettext-tools/m4'
+
+do_configure_prepend() {
+	rm -f ${S}/config/m4/libtool.m4
+}
+
+# these lack the .x behind the .so, but shouldn't be in the -dev package
+# Otherwise you get the following results:
+# 7.4M    glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
+# 25M     uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
+# because gettext depends on gettext-dev, which pulls in more -dev packages:
+# 15228   KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk
+# 1300    KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk
+# 140     KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk
+# 4       KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk
+
+PACKAGES =+ "libgettextlib libgettextsrc"
+FILES_libgettextlib = "${libdir}/libgettextlib-*.so*"
+FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*"
+
+PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-staticdev gettext-runtime-doc"
+
+FILES_${PN} += "${libdir}/${BPN}/*"
+
+FILES_gettext-runtime = "${bindir}/gettext \
+                         ${bindir}/ngettext \
+                         ${bindir}/envsubst \
+                         ${bindir}/gettext.sh \
+                         ${libdir}/libasprintf${SODEV} \
+                         ${libdir}/GNU.Gettext.dll \
+                        "
+FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \
+                                             ${libdir}/charset.alias \
+                                           "
+FILES_gettext-runtime-staticdev += "${libdir}/libasprintf.a"
+FILES_gettext-runtime-dev += "${includedir}/autosprintf.h \
+                              ${libdir}/libasprintf${SOLIBDEV}"
+FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \
+                                                 ${includedir}/libintl.h \
+                                               "
+FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
+                             ${mandir}/man1/ngettext.* \
+                             ${mandir}/man1/envsubst.* \
+                             ${mandir}/man1/.* \
+                             ${mandir}/man3/* \
+                             ${docdir}/gettext/gettext.* \
+                             ${docdir}/gettext/ngettext.* \
+                             ${docdir}/gettext/envsubst.* \
+                             ${docdir}/gettext/*.3.html \
+                             ${datadir}/gettext/ABOUT-NLS \
+                             ${docdir}/gettext/csharpdoc/* \
+                             ${docdir}/libasprintf/autosprintf.html \
+                             ${infodir}/autosprintf.info \
+                            "
+
+
+do_install_append() {
+	rm -f ${D}${libdir}/preloadable_libintl.so
+}
+
+# Anyone inheriting gettext will have both gettext-native and gettext
+# available, and we don't want to use older macros from the target gettext in
+# a non-gplv3 build, so kill them and let dependent recipes rely on
+# gettext-native.
+
+SYSROOT_PREPROCESS_FUNCS += "remove_sysroot_m4_macros"
+
+remove_sysroot_m4_macros () {
+    rm -r "${SYSROOT_DESTDIR}${datadir}/aclocal"
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/gettext/gettext_0.19.4.bb b/meta/recipes-core/gettext/gettext_0.19.4.bb
new file mode 100644
index 0000000..cebf6c7
--- /dev/null
+++ b/meta/recipes-core/gettext/gettext_0.19.4.bb
@@ -0,0 +1,106 @@
+SUMMARY = "Utilities and libraries for producing multi-lingual messages"
+DESCRIPTION = "GNU gettext is a set of tools that provides a framework to help other programs produce multi-lingual messages. These tools include a set of conventions about how programs should be written to support message catalogs, a directory and file naming organization for the message catalogs themselves, a runtime library supporting the retrieval of translated messages, and a few stand-alone programs to massage in various ways the sets of translatable and already translated strings."
+HOMEPAGE = "http://www.gnu.org/software/gettext/gettext.html"
+SECTION = "libs"
+LICENSE = "GPLv3+ & LGPL-2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS = "gettext-native virtual/libiconv expat"
+DEPENDS_class-native = "gettext-minimal-native"
+PROVIDES = "virtual/libintl virtual/gettext"
+PROVIDES_class-native = "virtual/gettext-native"
+RCONFLICTS_${PN} = "proxy-libintl"
+SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \
+	   file://parallel.patch \
+          "
+
+PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_LIBDIR}/..,--disable-curses,ncurses,"
+
+LDFLAGS_prepend_libc-uclibc = " -lrt -lpthread "
+
+SRC_URI[md5sum] = "d3511af1e604a3478900d2c2b4a4a48e"
+SRC_URI[sha256sum] = "8ac9f1ed1a5f8c4e656a2f37f5ba6b9ee04c4df79a575e876b0b6946aa417f3f"
+
+inherit autotools texinfo
+
+EXTRA_OECONF += "--without-lispdir \
+                 --disable-csharp \
+                 --disable-libasprintf \
+                 --disable-java \
+                 --disable-native-java \
+                 --disable-openmp \
+                 --disable-acl \
+                 --with-included-glib \
+                 --without-emacs \
+                 --without-cvs \
+                 --without-git \
+                 --with-included-libxml \
+                 --with-included-libcroco \
+                 --with-included-libunistring \
+                "
+
+acpaths = '-I ${S}/gettext-runtime/m4 \
+           -I ${S}/gettext-tools/m4'
+
+
+# these lack the .x behind the .so, but shouldn't be in the -dev package
+# Otherwise you get the following results:
+# 7.4M    glibc/images/ep93xx/Angstrom-console-image-glibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
+# 25M     uclibc/images/ep93xx/Angstrom-console-image-uclibc-ipk-2008.1-test-20080104-ep93xx.rootfs.tar.gz
+# because gettext depends on gettext-dev, which pulls in more -dev packages:
+# 15228   KiB /ep93xx/libstdc++-dev_4.2.2-r2_ep93xx.ipk
+# 1300    KiB /ep93xx/uclibc-dev_0.9.29-r8_ep93xx.ipk
+# 140     KiB /armv4t/gettext-dev_0.14.1-r6_armv4t.ipk
+# 4       KiB /ep93xx/libgcc-s-dev_4.2.2-r2_ep93xx.ipk
+
+PACKAGES =+ "libgettextlib libgettextsrc"
+FILES_libgettextlib = "${libdir}/libgettextlib-*.so*"
+FILES_libgettextsrc = "${libdir}/libgettextsrc-*.so*"
+
+PACKAGES =+ "gettext-runtime gettext-runtime-dev gettext-runtime-doc"
+
+FILES_${PN} += "${libdir}/${BPN}/*"
+
+FILES_gettext-runtime = "${bindir}/gettext \
+                         ${bindir}/ngettext \
+                         ${bindir}/envsubst \
+                         ${bindir}/gettext.sh \
+                         ${libdir}/libasprintf.so* \
+                         ${libdir}/GNU.Gettext.dll \
+                        "
+FILES_gettext-runtime_append_libc-uclibc = " ${libdir}/libintl.so.* \
+                                             ${libdir}/charset.alias \
+                                           "
+FILES_gettext-runtime-dev += "${libdir}/libasprintf.a \
+                      ${includedir}/autosprintf.h \
+                     "
+FILES_gettext-runtime-dev_append_libc-uclibc = " ${libdir}/libintl.so \
+                                                 ${includedir}/libintl.h \
+                                               "
+FILES_gettext-runtime-doc = "${mandir}/man1/gettext.* \
+                             ${mandir}/man1/ngettext.* \
+                             ${mandir}/man1/envsubst.* \
+                             ${mandir}/man1/.* \
+                             ${mandir}/man3/* \
+                             ${docdir}/gettext/gettext.* \
+                             ${docdir}/gettext/ngettext.* \
+                             ${docdir}/gettext/envsubst.* \
+                             ${docdir}/gettext/*.3.html \
+                             ${datadir}/gettext/ABOUT-NLS \
+                             ${docdir}/gettext/csharpdoc/* \
+                             ${docdir}/libasprintf/autosprintf.html \
+                             ${infodir}/autosprintf.info \
+                            "
+
+do_install_append() {
+    rm -f ${D}${libdir}/preloadable_libintl.so
+}
+
+do_install_append_class-native () {
+	rm ${D}${datadir}/aclocal/*
+	rm ${D}${datadir}/gettext/config.rpath
+	rm ${D}${datadir}/gettext/po/Makefile.in.in
+	rm ${D}${datadir}/gettext/po/remove-potcdate.sin
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch
new file mode 100644
index 0000000..41a190e
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch
@@ -0,0 +1,36 @@
+From 41534253b6b61ed4769eb6a3966698a50ee73b71 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Fri, 12 Jun 2015 17:08:46 +0300
+Subject: [PATCH] Remove the warning about deprecated paths in schemas
+
+Some schemas in gsettings-desktop-schemas (such as proxy and locale)
+are still using deprecated paths, as of 3.16.1. This causes warning
+messages, and meta/lib/oe/rootfs.py complaints about them.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ gio/glib-compile-schemas.c | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
+index e42949b..ec79d7c 100644
+--- a/gio/glib-compile-schemas.c
++++ b/gio/glib-compile-schemas.c
+@@ -1202,12 +1202,6 @@ parse_state_start_schema (ParseState  *state,
+       return;
+     }
+ 
+-  if (path && (g_str_has_prefix (path, "/apps/") ||
+-               g_str_has_prefix (path, "/desktop/") ||
+-               g_str_has_prefix (path, "/system/")))
+-    g_printerr ("warning: Schema '%s' has path '%s'.  Paths starting with "
+-                "'/apps/', '/desktop/' or '/system/' are deprecated.\n", id, path);
+-
+   state->schema_state = schema_state_new (path, gettext_domain,
+                                           extends, extends_name, list_of);
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch
new file mode 100644
index 0000000..0be3631
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch
@@ -0,0 +1,31 @@
+commit 9b38d507ec37b3d7d4df6095fa7ed16b47d399f7
+Author: Drew Moseley <drew_moseley@mentor.com>
+Date:   Sat Mar 29 21:10:43 2014 -0400
+
+    configure.ac: Do not use readlink when cross compiling.
+
+    Do not use readlink to set ABS_GLIB_RUNTIME_LIBDIR when cross
+    compiling.  Doing so causes host paths to potentially pollute
+    the target.
+
+    Note that in this case the path is not converted to absolute if
+    it contains any ".." references so it's not completely correct.
+
+    Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=727575]
+    Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+
+diff -rub glib-2.38.2.orig/configure.ac glib-2.38.2/configure.ac
+--- glib-2.38.2.orig/configure.ac	2014-04-03 20:17:13.035567143 -0400
++++ glib-2.38.2/configure.ac	2014-04-03 20:19:07.071566057 -0400
+@@ -275,7 +275,11 @@
+            [],
+ 	   [with_runtime_libdir=""])
+ GLIB_RUNTIME_LIBDIR="$with_runtime_libdir"
++AS_IF([ test $cross_compiling = yes ], [
++ABS_GLIB_RUNTIME_LIBDIR="$libdir/$with_runtime_libdir"
++], [
+ ABS_GLIB_RUNTIME_LIBDIR="`readlink -m $libdir/$with_runtime_libdir`"
++])
+ AC_SUBST(GLIB_RUNTIME_LIBDIR)
+ AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR)
+ AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"])
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch b/meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch
new file mode 100644
index 0000000..3aac35a
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/add-march-i486-into-CFLAGS-automatically.patch
@@ -0,0 +1,39 @@
+From 55253b55b9c65f3e0efbbe03cbab2a4c4014a16b Mon Sep 17 00:00:00 2001
+From: Song.Li <Song.Li@windriver.com>
+Date: Thu, 5 Jul 2012 15:09:41 +0800
+Subject: [PATCH] add -march=i486 into CFLAGS automatically
+
+Upstream-Status: Inappropriate [configuration]
+
+glib configure will check if current gcc need -march=i486,
+when gcc need -march=i486 but CFLAGS don't have,
+glib configure will abort and advise the user to add -march=i486 or later.
+This will break the build process,it's not good for automatic build system.
+so change this to adding -march=i485 automatically when it is needed.
+---
+ configure.ac |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+Index: glib-2.36.0/configure.ac
+===================================================================
+--- glib-2.36.0.orig/configure.ac
++++ glib-2.36.0/configure.ac
+@@ -2378,7 +2378,7 @@ dnl
+ dnl Note that the atomic ops are only available with GCC on x86 when
+ dnl using -march=i486 or higher.  If we detect that the atomic ops are
+ dnl not available but would be available given the right flags, we want
+-dnl to abort and advise the user to fix their CFLAGS.  It's better to do
++dnl to add -march=i486 automatically to fix their CFLAGS.  It's better to do
+ dnl that then to silently fall back on emulated atomic ops just because
+ dnl the user had the wrong build environment.
+
+@@ -2401,7 +2401,8 @@ AC_CACHE_CHECK([for lock-free atomic int
+         AC_TRY_COMPILE([],
+                        [volatile int atomic = 2;\
+                         __sync_bool_compare_and_swap (&atomic, 2, 3);],
+-                       [AC_MSG_ERROR([GLib must be build with -march=i486 or later.])],
++                       [AC_MSG_WARN([GLib must be build with -march=i486 or later.])
++                       SAVE_CFLAGS="${SAVE_CFLAGS} -march=i486"],
+                        [])
+         CFLAGS="${SAVE_CFLAGS}"
+       fi
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch b/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch
new file mode 100644
index 0000000..3d0c008
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch
@@ -0,0 +1,39 @@
+From c53e94a520b573aa0dcf12903e9563fe8badc34c Mon Sep 17 00:00:00 2001
+From: Marius Avram <marius.avram@intel.com>
+Date: Wed, 27 Aug 2014 12:10:41 +0300
+Subject: [PATCH] Allow /run/media/sdX drive mount if username root
+
+In case that the username logged in the system is root
+the drives are directly mounted in /run/media/sdX and
+not /run/media/<username>/sdX as the function
+g_unix_mount_guess_should_display() expects.
+
+Without this change USB stick mounts are not accesible from
+graphical applications such as the File Manager (pcmanfm).
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marius Avram <marius.avram@intel.com>
+---
+ gio/gunixmounts.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
+index 4999354..f6c1472 100644
+--- a/gio/gunixmounts.c
++++ b/gio/gunixmounts.c
+@@ -2136,6 +2136,11 @@ g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry)
+           mount_path[sizeof ("/run/media/") - 1 + user_name_len] == '/')
+         is_in_runtime_dir = TRUE;
+ 
++      /* Allow no username in path in /run/media if current user is root */
++      if (strcmp(user_name, "root") == 0 &&
++          strncmp (mount_path, "/run/media/", sizeof("run/media")) == 0)
++        is_in_runtime_dir = TRUE;
++
+       if (is_in_runtime_dir || g_str_has_prefix (mount_path, "/media/"))
+         {
+           char *path;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch b/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch
new file mode 100644
index 0000000..1d69a3f
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/configure-libtool.patch
@@ -0,0 +1,60 @@
+From 1c5718648d49e795efee91c220a2bf9386c184f2 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sat, 28 Apr 2012 18:24:50 +0200
+Subject: [PATCH] configure: use $host_alias-libtool instead of libtool
+ directly
+
+Poky renames libtool to $host_alias-libtool.
+./$host_alias-libtool isn't created until after configure runs with
+libtool >= 2.2.2
+so we can't call # it at this point. We can safely assume a version is
+available
+from PATH though
+
+Rebased to glib-2.27.3 by Dongxiao Xu <dongxiao.xu@intel.com>
+Rebased to glib-2.32.1 by Martin Jansa <Martin.Jansa@gmail.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure.ac |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a6478c6..9a93d60 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1470,7 +1470,7 @@ if test x"$glib_native_win32" = xyes; then
+   G_MODULE_LDFLAGS=
+ else
+   export SED
+-  G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++  G_MODULE_LDFLAGS=`(./$host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ fi
+ dnl G_MODULE_IMPL= don't reset, so cmd-line can override
+ G_MODULE_NEED_USCORE=0
+@@ -1535,9 +1535,9 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMPL_DL"; then
+ 	LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
+ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
+ 	echo "void glib_plugin_test(void) { }" > plugin.c
+-	${SHELL} ./libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
++	${SHELL} ./$host_alias-libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
+ 		${CPPFLAGS} -c -o plugin.lo plugin.c >/dev/null 2>&1
+-	${SHELL} ./libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
++	${SHELL} ./$host_alias-libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
+ 		${LDFLAGS} -module -o plugin.la -export-dynamic \
+ 		-shrext ".o" -avoid-version plugin.lo \
+ 		-rpath /dont/care >/dev/null 2>&1
+@@ -1614,7 +1614,7 @@ fi
+ 
+ AC_MSG_CHECKING(for the suffix of module shared libraries)
+ export SED
+-shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
++shrext_cmds=`./$host_alias-libtool --config | grep '^shrext_cmds='`
+ eval $shrext_cmds
+ module=yes eval std_shrext=$shrext_cmds
+ # chop the initial dot
+-- 
+1.7.8.6
+
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch b/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch
new file mode 100644
index 0000000..1571112
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/fix-conflicting-rand.patch
@@ -0,0 +1,35 @@
+Rename 'rand' variable to avoid conflict.
+
+Upstream-Status: pending
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+
+diff -u glib-2.34.3/tests/refcount/signals.c~ glib-2.34.3/tests/refcount/signals.c
+--- glib-2.34.3/tests/refcount/signals.c	2012-11-26 17:52:48.000000000 +0100
++++ glib-2.34.3/tests/refcount/signals.c	2013-02-08 14:24:10.052477546 +0100
+@@ -9,7 +9,7 @@
+ #define MY_IS_TEST_CLASS(tclass)   (G_TYPE_CHECK_CLASS_TYPE ((tclass), G_TYPE_TEST))
+ #define MY_TEST_GET_CLASS(test)    (G_TYPE_INSTANCE_GET_CLASS ((test), G_TYPE_TEST, GTestClass))
+ 
+-static GRand *rand;
++static GRand *grand;
+ 
+ typedef struct _GTest GTest;
+ typedef struct _GTestClass GTestClass;
+@@ -84,7 +84,7 @@
+       NULL
+     };
+ 
+-    rand = g_rand_new();
++    grand = g_rand_new();
+ 
+     test_type = g_type_register_static (G_TYPE_OBJECT, "GTest",
+         &test_info, 0);
+@@ -218,7 +218,7 @@
+ static void
+ my_test_do_prop (GTest * test)
+ {
+-  test->value = g_rand_int (rand);
++  test->value = g_rand_int (grand);
+   g_object_notify (G_OBJECT (test), "test-prop");
+ }
+ 
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch b/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch
new file mode 100644
index 0000000..9759d11
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/glib-2.0-configure-readlink.patch
@@ -0,0 +1,29 @@
+configure.ac: change readlink -f to -m
+
+Change "readlink -f" to "readlink -m" since $libdir/$with_runtime_libdir
+may not exist.
+
+This patch should go to the upstream, I will send it sooner.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -271,7 +271,7 @@ AC_ARG_WITH(runtime-libdir,
+            [],
+ 	   [with_runtime_libdir=""])
+ GLIB_RUNTIME_LIBDIR="$with_runtime_libdir"
+-ABS_GLIB_RUNTIME_LIBDIR="`readlink -f $libdir/$with_runtime_libdir`"
++ABS_GLIB_RUNTIME_LIBDIR="`readlink -m $libdir/$with_runtime_libdir`"
+ AC_SUBST(GLIB_RUNTIME_LIBDIR)
+ AC_SUBST(ABS_GLIB_RUNTIME_LIBDIR)
+ AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"])
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch b/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch
new file mode 100644
index 0000000..ee43511
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/glib-gettextize-dir.patch
@@ -0,0 +1,24 @@
+# an very old patch cherry-picked in every glib-2.0 patch directory. The earliest container
+# for it is 2.6.5 in OE. The earliest commit for it is c8e5702127e507e82e6f68a4b8c546803accea9d
+# in OE side which ports from previous bitkeeper SCM. In OE side it's only used til 2.12.4.
+#
+# keep it since it's always cleaner to not hardcode destination path. Use @datadir@ is more
+# portable here. mark for upstream
+#
+# by Kevin Tian <kevin.tian@intel.com>, 06/25/2010
+# Rebased by Dongxiao Xu <dongxiao.xu@intel.com>, 11/16/2010
+
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN glib-2.27.3-orig/glib-gettextize.in glib-2.27.3/glib-gettextize.in
+--- glib-2.27.3-orig/glib-gettextize.in	2009-04-01 07:04:20.000000000 +0800
++++ glib-2.27.3/glib-gettextize.in	2010-11-16 12:55:06.874605916 +0800
+@@ -52,7 +52,7 @@
+ datadir=@datadir@
+ datarootdir=@datarootdir@
+ 
+-gettext_dir=$prefix/share/glib-2.0/gettext
++gettext_dir=@datadir@/glib-2.0/gettext
+ 
+ while test $# -gt 0; do
+   case "$1" in
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch b/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch
new file mode 100644
index 0000000..f3be027
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/ptest-paths.patch
@@ -0,0 +1,30 @@
+Instead of writing the temporary mapping files in the mappedfile test to the
+user runtime directory, write them to $TMP.  The runtime directory may not
+currently exist if the test is executed on a non-desktop system and the test
+doesn't attempt to create the directory structure.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/glib/tests/mappedfile.c b/glib/tests/mappedfile.c
+index 40e0e60..27a24be 100644
+--- a/glib/tests/mappedfile.c
++++ b/glib/tests/mappedfile.c
+@@ -81,7 +81,7 @@ test_writable (void)
+   const gchar *new = "abcdefghijklmnopqrstuvxyz";
+   gchar *tmp_copy_path;
+ 
+-  tmp_copy_path = g_build_filename (g_get_user_runtime_dir (), "glib-test-4096-random-bytes", NULL);
++  tmp_copy_path = g_build_filename (g_get_tmp_dir (), "glib-test-4096-random-bytes", NULL);
+ 
+   g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error);
+   g_assert_no_error (error);
+@@ -125,7 +125,7 @@ test_writable_fd (void)
+   int fd;
+   gchar *tmp_copy_path;
+ 
+-  tmp_copy_path = g_build_filename (g_get_user_runtime_dir (), "glib-test-4096-random-bytes", NULL);
++  tmp_copy_path = g_build_filename (g_get_tmp_dir (), "glib-test-4096-random-bytes", NULL);
+ 
+   g_file_get_contents (g_test_get_filename (G_TEST_DIST, "4096-random-bytes", NULL), &contents, &len, &error);
+   g_assert_no_error (error);
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/run-ptest b/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
new file mode 100644
index 0000000..130ae09
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/run-ptest
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+gnome-desktop-testing-runner glib
diff --git a/meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch b/meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch
new file mode 100644
index 0000000..2a154fd
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/uclibc.patch
@@ -0,0 +1,20 @@
+Fix DATADIRNAME on uclibc/Linux
+
+translation files are always installed under PREFIX/share/locale in uclibc
+based systems therefore lets set DATADIRNAME to "share".
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: glib-2.38.2/m4macros/glib-gettext.m4
+===================================================================
+--- glib-2.38.2.orig/m4macros/glib-gettext.m4	2013-11-07 07:29:13.000000000 -0800
++++ glib-2.38.2/m4macros/glib-gettext.m4	2014-03-15 14:51:54.712135644 -0700
+@@ -239,7 +239,7 @@
+ 	      [CATOBJEXT=.mo
+                DATADIRNAME=lib])
+ 	    ;;
+-	    *-*-openbsd*)
++	    *-*-openbsd* | *-*-linux-uclibc*)
+ 	    CATOBJEXT=.mo
+             DATADIRNAME=share
+ 	    ;;
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.44.1.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.44.1.bb
new file mode 100644
index 0000000..1e3d36a
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.44.1.bb
@@ -0,0 +1,23 @@
+require glib.inc
+
+PE = "1"
+
+SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
+           file://configure-libtool.patch \
+           file://fix-conflicting-rand.patch \
+           file://add-march-i486-into-CFLAGS-automatically.patch \
+           file://glib-2.0-configure-readlink.patch \
+           file://run-ptest \
+           file://ptest-paths.patch \
+           file://uclibc.patch \
+           file://0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch \
+           file://allow-run-media-sdX-drive-mount-if-username-root.patch \
+	   file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \
+          "
+
+SRC_URI_append_class-native = " file://glib-gettextize-dir.patch"
+
+SRC_URI[md5sum] = "83efba4722a9674b97437d1d99af79db"
+SRC_URI[sha256sum] = "8811deacaf8a503d0a9b701777ea079ca6a4277be10e3d730d2112735d5eca07"
diff --git a/meta/recipes-core/glib-2.0/glib.inc b/meta/recipes-core/glib-2.0/glib.inc
new file mode 100644
index 0000000..072f790
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib.inc
@@ -0,0 +1,104 @@
+SUMMARY = "A general-purpose utility library"
+DESCRIPTION = "GLib is a general-purpose utility library, which provides many useful data types, macros, type conversions, string utilities, file utilities, a main loop abstraction, and so on."
+HOMEPAGE = "https://developer.gnome.org/glib/"
+
+# pcre is under BSD;
+# docs/reference/COPYING is with a 'public domai'-like license!
+LICENSE = "LGPLv2+ & BSD & PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+                    file://glib/glib.h;beginline=4;endline=17;md5=b4f0f4a399c19e5ebb20c31b79d6bc32 \
+                    file://gmodule/COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+                    file://gmodule/gmodule.h;beginline=4;endline=17;md5=b4f0f4a399c19e5ebb20c31b79d6bc32 \
+                    file://glib/pcre/COPYING;md5=266ebc3ff74ee9ce6fad65577667c0f4 \
+                    file://glib/pcre/pcre.h;beginline=11;endline=35;md5=de27f2bf633d20a2b7af0b1983423283 \
+                    file://docs/reference/COPYING;md5=f51a5100c17af6bae00735cd791e1fcc"
+BUGTRACKER = "http://bugzilla.gnome.org"
+SECTION = "libs"
+
+BBCLASSEXTEND = "native nativesdk"
+
+DEPENDS = "glib-2.0-native virtual/libiconv libffi zlib"
+DEPENDS_append_class-target = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', ' dbus', '', d)}"
+DEPENDS_class-native = "pkgconfig-native gettext-native libffi-native zlib-native"
+DEPENDS_class-nativesdk = "nativesdk-libtool nativesdk-gettext nativesdk-libffi nativesdk-zlib ${BPN}-native"
+
+PACKAGES =+ "${PN}-utils ${PN}-bash-completion ${PN}-codegen"
+
+LEAD_SONAME = "libglib-2.0.*"
+FILES_${PN}-utils = "${bindir}/* ${datadir}/glib-2.0/gettext"
+
+inherit autotools gettext gtk-doc pkgconfig ptest-gnome
+
+S = "${WORKDIR}/glib-${PV}"
+
+CORECONF = "--disable-dtrace --disable-fam --disable-libelf --disable-systemtap --disable-man"
+
+PRINTF = "--enable-included-printf=no"
+PRINTF_darwin = "--enable-included-printf=yes"
+PRINTF_mingw32 = "--enable-included-printf=yes"
+EXTRA_OECONF = "${PRINTF} ${CORECONF}"
+EXTRA_OECONF_class-native = "${CORECONF} --disable-selinux"
+EXTRA_OECONF_append_libc-uclibc = " --with-libiconv=gnu"
+
+do_configure_prepend() {
+	sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
+}
+
+FILES_${PN} = "${libdir}/lib*${SOLIBS} ${libdir}/gio ${datadir}/glib-2.0/schemas \
+               ${datadir}/glib-2.0/gettext/mkinstalldirs ${datadir}/glib-2.0/gettext/po/Makefile.in.in"
+FILES_${PN}-dev += "${libdir}/glib-2.0/include \
+                    ${libdir}/gio/modules/lib*${SOLIBSDEV} \
+                    ${libdir}/gio/modules/*.la"
+FILES_${PN}-dbg += "${datadir}/glib-2.0/gdb ${datadir}/gdb \
+                    ${libdir}/gio/modules/.debug \
+                    ${libdir}/glib-2.0/installed-tests/glib/.debug"
+FILES_${PN}-codegen = "${datadir}/glib-2.0/codegen/*.py"
+FILES_${PN}-bash-completion = "${sysconfdir}/bash_completion.d \
+                               ${datadir}/bash-completion"
+
+ARM_INSTRUCTION_SET = "arm"
+USE_NLS = "yes"
+
+do_install_append () {
+	if [ -f ${D}${bindir}/gtester-report ]; then
+		sed ${D}${bindir}/gtester-report -i -e '1s|^#!.*|#!/usr/bin/env python|'
+	fi
+
+	# Remove some unpackaged files
+	rm -f ${D}${datadir}/glib-2.0/codegen/*.pyc
+	rm -f ${D}${datadir}/glib-2.0/codegen/*.pyo
+
+	# Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
+	# for target as /usr/bin/perl, so fix it to /usr/bin/perl.
+	if [ -f ${D}${bindir}/glib-mkenums ]; then
+		sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/glib-mkenums
+	fi
+}
+
+RDEPENDS_${PN}-ptest += "\
+            gnome-desktop-testing \
+            tzdata \
+            tzdata-americas \
+            tzdata-asia \
+            tzdata-europe \
+            tzdata-posix \
+            python-pygobject \
+            python-dbus \
+            shared-mime-info \
+           "
+
+RDEPENDS_${PN}-ptest_append_libc-glibc = "\
+            glibc-gconv-utf-16 \
+            glibc-charmap-utf-8 \
+            glibc-gconv-cp1255 \
+            glibc-charmap-cp1255 \
+            glibc-gconv-utf-32 \
+            glibc-gconv-utf-7 \
+            glibc-gconv-euc-jp \
+            glibc-gconv-iso8859-1 \
+            glibc-gconv-iso8859-15 \
+            glibc-charmap-invariant \
+            glibc-localedata-translit-cjk-variants \
+           "
+
+INSANE_SKIP_${PN}-ptest += "libdir"
diff --git a/meta/recipes-core/glib-networking/glib-networking_2.44.0.bb b/meta/recipes-core/glib-networking/glib-networking_2.44.0.bb
new file mode 100644
index 0000000..4f91b76
--- /dev/null
+++ b/meta/recipes-core/glib-networking/glib-networking_2.44.0.bb
@@ -0,0 +1,30 @@
+SUMMARY = "GLib networking extensions"
+DESCRIPTION = "glib-networking contains the implementations of certain GLib networking features that cannot be implemented directly in GLib itself because of their dependencies."
+HOMEPAGE = "http://git.gnome.org/browse/glib-networking/"
+BUGTRACKER = "http://bugzilla.gnome.org"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+SECTION = "libs"
+DEPENDS = "glib-2.0 intltool-native"
+
+SRC_URI[archive.md5sum] = "6989b20cf3b26dd5ae272e04a9acb0b3"
+SRC_URI[archive.sha256sum] = "8f8a340d3ba99bfdef38b653da929652ea6640e27969d29f7ac51fbbe11a4346"
+
+PACKAGECONFIG ??= "ca-certificates gnutls"
+
+# No explicit dependency as it works without ca-certificates installed
+PACKAGECONFIG[ca-certificates] = "--with-ca-certificates=${sysconfdir}/ssl/certs/ca-certificates.crt,--without-ca-certificates"
+PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
+PACKAGECONFIG[libproxy] = "--with-libproxy,--without-libproxy,libproxy"
+PACKAGECONFIG[pkcs11] = "--with-pkcs11,--without-pkcs11,p11-kit"
+
+EXTRA_OECONF = "--without-gnome-proxy"
+
+inherit gnomebase gettext
+
+FILES_${PN} += "${libdir}/gio/modules/libgio*.so ${datadir}/dbus-1/services/"
+FILES_${PN}-dbg += "${libdir}/gio/modules/.debug/"
+FILES_${PN}-dev += "${libdir}/gio/modules/libgio*.la"
+FILES_${PN}-staticdev += "${libdir}/gio/modules/libgio*.a"
diff --git a/meta/recipes-core/glibc/cross-localedef-native/fix_for_centos_5.8.patch b/meta/recipes-core/glibc/cross-localedef-native/fix_for_centos_5.8.patch
new file mode 100644
index 0000000..186a480
--- /dev/null
+++ b/meta/recipes-core/glibc/cross-localedef-native/fix_for_centos_5.8.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Inappropriate [other]
+
+This is a hack to fix building the locale bits on an older
+CentOs 5.X machine
+
+Index: git/locale/programs/config.h
+===================================================================
+--- git/locale/programs/config.h
++++ git.orig/locale/programs/config.h
+@@ -19,6 +19,8 @@
+ #ifndef _LD_CONFIG_H
+ #define _LD_CONFIG_H	1
+ 
++#define DUMMY_LOCALE_T
++
+ /* Use the internal textdomain used for libc messages.  */
+ #define PACKAGE _libc_intl_domainname
+ #ifndef VERSION
diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.22.bb b/meta/recipes-core/glibc/cross-localedef-native_2.22.bb
new file mode 100644
index 0000000..2153ece
--- /dev/null
+++ b/meta/recipes-core/glibc/cross-localedef-native_2.22.bb
@@ -0,0 +1,59 @@
+SUMMARY = "Cross locale generation tool for glibc"
+HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
+SECTION = "libs"
+LICENSE = "LGPL-2.1"
+
+LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
+      file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+      file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+      file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+
+inherit native
+inherit autotools
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:${FILE_DIRNAME}/glibc:"
+
+BRANCH ?= "release/${PV}/master"
+GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
+
+SRC_URI = "${GLIBC_GIT_URI};branch=${BRANCH};name=glibc \
+           git://github.com/kraj/localedef;branch=master;name=localedef;destsuffix=git/localedef \
+           file://fix_for_centos_5.8.patch \
+           ${EGLIBCPATCHES} \
+"
+EGLIBCPATCHES = "\
+           file://0017-timezone-re-written-tzselect-as-posix-sh.patch \
+           file://0018-eglibc-Cross-building-and-testing-instructions.patch \
+           file://0019-eglibc-Bring-Eglibc-option-group-infrastructure-to-g.patch \
+           file://0020-eglibc-Help-bootstrap-cross-toolchain.patch \
+           file://0021-eglibc-cherry-picked-from-http-www.eglibc.org-archiv.patch \
+           file://0022-eglibc-Clear-cache-lines-on-ppc8xx.patch \
+           file://0023-eglibc-Resolve-__fpscr_values-on-SH4.patch \
+           file://0024-eglibc-Forward-port-eglibc-options-groups-support.patch \
+           file://0025-eglibc-Install-PIC-archives.patch \
+           file://0026-eglibc-dl_debug_mask-is-controlled-by-__OPTION_EGLIB.patch \
+           file://0027-eglibc-use-option-groups-Conditionally-exclude-c-tes.patch \
+"
+
+SRCREV_glibc ?= "a34d1c6afc86521d6ad17662a3b5362d8481514c"
+SRCREV_localedef ?= "c833367348d39dad7ba018990bfdaffaec8e9ed3"
+
+# Makes for a rather long rev (22 characters), but...
+#
+SRCREV_FORMAT = "glibc_localedef"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = "--with-glibc=${S}"
+CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'"
+
+do_configure () {
+	${S}/localedef/configure ${EXTRA_OECONF}
+}
+
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef
+}
diff --git a/meta/recipes-core/glibc/glibc-collateral.inc b/meta/recipes-core/glibc/glibc-collateral.inc
new file mode 100644
index 0000000..60655eb
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-collateral.inc
@@ -0,0 +1,22 @@
+INHIBIT_DEFAULT_DEPS = "1"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM ?= "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
+                     file://${COMMON_LICENSE_DIR}/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780"
+HOMEPAGE = "http://www.gnu.org/software/libc/index.html"
+
+# This needs to match with glibc.inc, otherwise glibc-scripts and glibc-locale
+# will fail to find main glibc, for details see
+# http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100679.html
+ARM_INSTRUCTION_SET = "arm"
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install[depends] += "virtual/${MLPREFIX}libc:do_populate_sysroot"
+
+COMPATIBLE_HOST_libc-musl_class-target = "null"
+COMPATIBLE_HOST_libc-uclibc_class-target = "null"
+
diff --git a/meta/recipes-core/glibc/glibc-common.inc b/meta/recipes-core/glibc/glibc-common.inc
new file mode 100644
index 0000000..bba1568
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-common.inc
@@ -0,0 +1,9 @@
+SUMMARY = "GLIBC (GNU C Library)"
+DESCRIPTION = "The GNU C Library is used as the system C library in most systems with the Linux kernel."
+HOMEPAGE = "http://www.gnu.org/software/libc/libc.html"
+SECTION = "libs"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM ?= "file://LICENSES;md5=07a394b26e0902b9ffdec03765209770 \
+      file://COPYING;md5=393a5ca445f6965873eca0259a17f833 \
+      file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+      file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff "
diff --git a/meta/recipes-core/glibc/glibc-initial.inc b/meta/recipes-core/glibc/glibc-initial.inc
new file mode 100644
index 0000000..3500848
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-initial.inc
@@ -0,0 +1,76 @@
+DEPENDS = "linux-libc-headers virtual/${TARGET_PREFIX}gcc-initial libgcc-initial"
+PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
+
+PACKAGES = ""
+PACKAGES_DYNAMIC = ""
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
+
+do_configure () {
+	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+	find ${S} -name "configure" | xargs touch
+	${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
+		--prefix=/usr \
+		--without-cvs --disable-sanity-checks \
+		--with-headers=${STAGING_DIR_TARGET}${includedir} \
+		--with-kconfig=${STAGING_BINDIR_NATIVE} \
+		--enable-hacker-mode --enable-addons
+}
+
+do_compile () {
+	:
+}
+
+do_install () {
+	oe_runmake cross-compiling=yes install_root=${D} \
+	includedir='${includedir}' prefix='${prefix}' \
+	install-bootstrap-headers=yes install-headers
+
+	oe_runmake csu/subdir_lib
+	mkdir -p ${D}${libdir}/
+	install -m 644 csu/crt[1in].o ${D}${libdir}
+
+	# Two headers -- stubs.h and features.h -- aren't installed by install-headers,
+	# so do them by hand.  We can tolerate an empty stubs.h for the moment.
+	# See e.g. http://gcc.gnu.org/ml/gcc/2002-01/msg00900.html
+	mkdir -p ${D}${includedir}/gnu/
+	touch ${D}${includedir}/gnu/stubs.h
+	cp ${S}/include/features.h ${D}${includedir}/features.h
+
+	if [ -e ${B}/bits/stdio_lim.h ]; then
+		cp ${B}/bits/stdio_lim.h  ${D}${includedir}/bits/
+	fi
+	# add links to linux-libc-headers: final glibc build need this.
+	for t in linux asm asm-generic; do
+		ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
+	done
+}
+
+do_install_locale() {
+	:
+}
+
+do_siteconfig () {
+	:
+}
+
+SSTATEPOSTINSTFUNCS += "glibcinitial_sstate_postinst"
+glibcinitial_sstate_postinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+		# Recreate the symlinks to ensure they point to the correct location
+		for t in linux asm asm-generic; do
+			rm -f ${STAGING_DIR_TCBOOTSTRAP}${includedir}/$t
+			ln -s ${STAGING_DIR_TARGET}${includedir}/$t ${STAGING_DIR_TCBOOTSTRAP}${includedir}/
+		done
+	fi
+}
+
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
+
+# We don't install any scripts so there is nothing to evacuate
+do_evacuate_scripts () {
+	:
+}
diff --git a/meta/recipes-core/glibc/glibc-initial_2.22.bb b/meta/recipes-core/glibc/glibc-initial_2.22.bb
new file mode 100644
index 0000000..8ab01dc
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-initial_2.22.bb
@@ -0,0 +1,11 @@
+require glibc_${PV}.bb
+require glibc-initial.inc
+
+DEPENDS += "kconfig-frontends-native"
+
+# main glibc recipes muck with TARGET_CPPFLAGS to point into
+# final target sysroot but we
+# are not there when building glibc-initial
+# so reset it here
+
+TARGET_CPPFLAGS = ""
diff --git a/meta/recipes-core/glibc/glibc-ld.inc b/meta/recipes-core/glibc/glibc-ld.inc
new file mode 100644
index 0000000..962d666
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-ld.inc
@@ -0,0 +1,56 @@
+def ld_append_if_tune_exists(d, infos, dict):
+    tune = d.getVar("DEFAULTTUNE", True) or ""
+    libdir = d.getVar("base_libdir", True) or ""
+    if tune in dict:
+        infos['ldconfig'].add('{"' + libdir + '/' + dict[tune][0] + '",' + dict[tune][1] + ' }')
+        infos['lddrewrite'].add(libdir+'/'+dict[tune][0])
+
+def glibc_dl_info(d):
+    ld_info_all = {
+        "mips": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mipsel": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64el-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64el": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64el-nf-n32": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "mips64el-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "powerpc": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "powerpc-nf": ["ld.so.1", "FLAG_ELF_LIBC6"],
+        "powerpc64": ["ld64.so.1", "FLAG_ELF_LIBC6"],
+        "powerpc64-nf": ["ld64.so.1", "FLAG_ELF_LIBC6"],
+        "core2-32": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+        "core2-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
+        "x86": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+        "x86-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
+        "i586": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+        "corei7-32": ["ld-linux.so.2", "FLAG_ELF_LIBC6"],
+        "corei7-64": ["ld-linux-x86-64.so.2", "FLAG_ELF_LIBC6"],
+    }
+
+    infos = {'ldconfig':set(), 'lddrewrite':set()}
+    ld_append_if_tune_exists(d, infos, ld_info_all)
+
+    #DEFAULTTUNE_MULTILIB_ORIGINAL
+    original_tune=d.getVar("DEFAULTTUNE_MULTILIB_ORIGINAL",True)
+    if original_tune:
+        localdata = bb.data.createCopy(d)
+        localdata.setVar("DEFAULTTUNE", original_tune)
+        ld_append_if_tune_exists(localdata, infos, ld_info_all)
+
+    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+    for item in variants.split():
+        localdata = bb.data.createCopy(d)
+        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+        localdata.setVar("OVERRIDES", overrides)
+        bb.data.update_data(localdata)
+        ld_append_if_tune_exists(localdata, infos, ld_info_all)
+    infos['ldconfig'] = ','.join(infos['ldconfig'])
+    infos['lddrewrite'] = ' '.join(infos['lddrewrite'])
+    return infos
+
+EGLIBC_KNOWN_INTERPRETER_NAMES = "${@glibc_dl_info(d)['ldconfig']}"
+RTLDLIST = "${@glibc_dl_info(d)['lddrewrite']}"
diff --git a/meta/recipes-core/glibc/glibc-locale.inc b/meta/recipes-core/glibc/glibc-locale.inc
new file mode 100644
index 0000000..df6d073
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-locale.inc
@@ -0,0 +1,96 @@
+include glibc-collateral.inc
+
+SUMMARY = "Locale data from glibc"
+
+BPN = "glibc"
+LOCALEBASEPN = "${MLPREFIX}glibc"
+
+# glibc-collateral.inc inhibits all default deps, but do_package needs objcopy
+# ERROR: objcopy failed with exit code 127 (cmd was 'i586-webos-linux-objcopy' --only-keep-debug 'glibc-locale/2.17-r0/package/usr/lib/gconv/IBM1166.so' 'glibc-locale/2.17-r0/package/usr/lib/gconv/.debug/IBM1166.so')
+# ERROR: Function failed: split_and_strip_files
+BINUTILSDEP = "virtual/${MLPREFIX}${TARGET_PREFIX}binutils:do_populate_sysroot"
+BINUTILSDEP_class-nativesdk = "virtual/${TARGET_PREFIX}binutils-crosssdk:do_populate_sysroot"
+do_package[depends] += "${BINUTILSDEP}"
+
+# Binary locales are generated at build time if ENABLE_BINARY_LOCALE_GENERATION
+# is set. The idea is to avoid running localedef on the target (at first boot)
+# to decrease initial boot time and avoid localedef being killed by the OOM
+# killer which used to effectively break i18n on machines with < 128MB RAM.
+
+# default to disabled 
+ENABLE_BINARY_LOCALE_GENERATION ?= "0"
+ENABLE_BINARY_LOCALE_GENERATION_pn-nativesdk-glibc-locale = "0"
+
+#enable locale generation on these arches
+# BINARY_LOCALE_ARCHES is a space separated list of regular expressions
+BINARY_LOCALE_ARCHES ?= "arm.* aarch64 i[3-6]86 x86_64 powerpc mips mips64"
+
+# set "1" to use cross-localedef for locale generation
+# set "0" for qemu emulation of native localedef for locale generation
+LOCALE_GENERATION_WITH_CROSS-LOCALEDEF = "1"
+
+PROVIDES = "virtual/libc-locale"
+
+PACKAGES = "localedef ${PN}-dbg"
+
+PACKAGES_DYNAMIC = "^locale-base-.* \
+                    ^glibc-gconv-.* ^glibc-charmap-.* ^glibc-localedata-.* ^glibc-binary-localedata-.* \
+                    ^glibc-gconv-.*  ^glibc-charmap-.*  ^glibc-localedata-.*  ^glibc-binary-localedata-.* \
+                    ^${MLPREFIX}glibc-gconv$"
+
+# Create a glibc-binaries package
+ALLOW_EMPTY_${BPN}-binaries = "1"
+PACKAGES += "${BPN}-binaries"
+RRECOMMENDS_${BPN}-binaries =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-binary") != -1])}"
+
+# Create a glibc-charmaps package
+ALLOW_EMPTY_${BPN}-charmaps = "1"
+PACKAGES += "${BPN}-charmaps"
+RRECOMMENDS_${BPN}-charmaps =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-charmap") != -1])}"
+
+# Create a glibc-gconvs package
+ALLOW_EMPTY_${BPN}-gconvs = "1"
+PACKAGES += "${BPN}-gconvs"
+RRECOMMENDS_${BPN}-gconvs =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-gconv") != -1])}"
+
+# Create a glibc-localedatas package
+ALLOW_EMPTY_${BPN}-localedatas = "1"
+PACKAGES += "${BPN}-localedatas"
+RRECOMMENDS_${BPN}-localedatas =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("glibc-localedata") != -1])}"
+
+DESCRIPTION_localedef = "glibc: compile locale definition files"
+
+# glibc-gconv is dynamically added into PACKAGES, thus
+# FILES_glibc-gconv will not be automatically extended in multilib.
+# Explicitly add ${MLPREFIX} for FILES_glibc-gconv.
+FILES_${MLPREFIX}glibc-gconv = "${libdir}/gconv/*"
+FILES_${PN}-dbg += "${libdir}/gconv/.debug/*"
+FILES_localedef = "${bindir}/localedef"
+
+LOCALETREESRC = "${STAGING_INCDIR}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}"
+
+do_install () {
+	mkdir -p ${D}${bindir} ${D}${datadir} ${D}${libdir}
+	if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then
+		cp -fpPR ${LOCALETREESRC}/${bindir}/* ${D}${bindir}
+	fi
+	if [ -n "$(ls ${LOCALETREESRC}/${localedir})" ]; then
+		mkdir -p ${D}${localedir}
+		cp -fpPR ${LOCALETREESRC}/${localedir}/* ${D}${localedir}
+	fi
+	if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then
+		cp -fpPR ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir}
+	fi
+	if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then
+		cp -fpPR ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir}
+	fi
+	if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then
+		cp -fpPR ${LOCALETREESRC}/${datadir}/locale ${D}${datadir}
+	fi
+	chown root.root -R ${D}
+	cp -fpPR ${LOCALETREESRC}/SUPPORTED ${WORKDIR}
+}
+
+inherit libc-package
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-core/glibc/glibc-locale_2.22.bb b/meta/recipes-core/glibc/glibc-locale_2.22.bb
new file mode 100644
index 0000000..f7702e0
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-locale_2.22.bb
@@ -0,0 +1 @@
+require glibc-locale.inc
diff --git a/meta/recipes-core/glibc/glibc-mtrace.inc b/meta/recipes-core/glibc/glibc-mtrace.inc
new file mode 100644
index 0000000..e12b079
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-mtrace.inc
@@ -0,0 +1,13 @@
+include glibc-collateral.inc
+
+SUMMARY = "mtrace utility provided by glibc"
+DESCRIPTION = "mtrace utility provided by glibc"
+RDEPENDS_${PN} = "perl"
+RPROVIDES_${PN} = "libc-mtrace"
+
+SRC = "${STAGING_INCDIR}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
+
+do_install() {
+	install -d -m 0755 ${D}${bindir}
+	install -m 0755 ${SRC}/mtrace ${D}${bindir}/
+}
diff --git a/meta/recipes-core/glibc/glibc-mtrace_2.22.bb b/meta/recipes-core/glibc/glibc-mtrace_2.22.bb
new file mode 100644
index 0000000..0b69bad
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-mtrace_2.22.bb
@@ -0,0 +1 @@
+require glibc-mtrace.inc
diff --git a/meta/recipes-core/glibc/glibc-options.inc b/meta/recipes-core/glibc/glibc-options.inc
new file mode 100644
index 0000000..9fd27f3
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-options.inc
@@ -0,0 +1,162 @@
+def glibc_cfg(feature, tokens, cnf):
+    if type(tokens) == type(""):
+        tokens = [tokens]
+    if feature:
+        cnf.extend([token + '=y' for token in tokens])
+    else:
+        for token in tokens:
+            cnf.extend([token + '=n'])
+            if token == 'OPTION_EGLIBC_NSSWITCH':
+                cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG=\"${S}/nss/nsswitch.conf\""])
+                cnf.extend(["OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS=\"${S}/nss/fixed-nsswitch.functions\""])
+
+# Map distro features to glibc options settings
+def features_to_glibc_settings(d):
+    cnf = ([])
+
+    ipv4 = bb.utils.contains('DISTRO_FEATURES', 'ipv4', True, False, d)
+    ipv6 = bb.utils.contains('DISTRO_FEATURES', 'ipv6', True, False, d)
+    libc_backtrace = bb.utils.contains('DISTRO_FEATURES', 'libc-backtrace', True, False, d) 
+    libc_big_macros = bb.utils.contains('DISTRO_FEATURES', 'libc-big-macros', True, False, d)
+    libc_bsd = bb.utils.contains('DISTRO_FEATURES', 'libc-bsd', True, False, d)
+    libc_cxx_tests = bb.utils.contains('DISTRO_FEATURES', 'libc-cxx-tests', True, False, d)
+    libc_catgets = bb.utils.contains('DISTRO_FEATURES', 'libc-catgets', True, False, d)
+    libc_charsets = bb.utils.contains('DISTRO_FEATURES', 'libc-charsets', True, False, d)
+    libc_crypt = bb.utils.contains('DISTRO_FEATURES', 'libc-crypt', True, False, d)
+    libc_crypt_ufc = bb.utils.contains('DISTRO_FEATURES', 'libc-crypt-ufc', True, False, d)
+    libc_db_aliases = bb.utils.contains('DISTRO_FEATURES', 'libc-db-aliases', True, False, d)
+    libc_envz = bb.utils.contains('DISTRO_FEATURES', 'libc-envz', True, False, d)
+    libc_fcvt = bb.utils.contains('DISTRO_FEATURES', 'libc-fcvt', True, False, d)
+    libc_fmtmsg = bb.utils.contains('DISTRO_FEATURES', 'libc-fmtmsg', True, False, d)
+    libc_fstab = bb.utils.contains('DISTRO_FEATURES', 'libc-fstab', True, False, d)
+    libc_ftraverse = bb.utils.contains('DISTRO_FEATURES', 'libc-ftraverse', True, False, d)
+    libc_getlogin = bb.utils.contains('DISTRO_FEATURES', 'libc-getlogin', True, False, d)
+    libc_idn = bb.utils.contains('DISTRO_FEATURES', 'libc-idn', True, False, d)
+    libc_inet_anl = bb.utils.contains('DISTRO_FEATURES', 'libc-inet-anl', True, False, d)
+    libc_libm = bb.utils.contains('DISTRO_FEATURES', 'libc-libm', True, False, d)
+    libc_locales = bb.utils.contains('DISTRO_FEATURES', 'libc-locales', True, False, d)
+    libc_locale_code = bb.utils.contains('DISTRO_FEATURES', 'libc-locale-code', True, False, d)
+    libc_memusage = bb.utils.contains('DISTRO_FEATURES', 'libc-memusage', True, False, d)
+    libc_nis = bb.utils.contains('DISTRO_FEATURES', 'libc-nis', True, False, d)
+    libc_nsswitch = bb.utils.contains('DISTRO_FEATURES', 'libc-nsswitch', True, False, d)
+    libc_rcmd = bb.utils.contains('DISTRO_FEATURES', 'libc-rcmd', True, False, d)
+    libc_rtld_debug = bb.utils.contains('DISTRO_FEATURES', 'libc-rtld-debug', True, False, d)
+    libc_spawn = bb.utils.contains('DISTRO_FEATURES', 'libc-spawn', True, False, d)
+    libc_streams = bb.utils.contains('DISTRO_FEATURES', 'libc-streams', True, False, d)
+    libc_sunrpc = bb.utils.contains('DISTRO_FEATURES', 'libc-sunrpc', True, False, d)
+    libc_utmp = bb.utils.contains('DISTRO_FEATURES', 'libc-utmp', True, False, d)
+    libc_utmpx = bb.utils.contains('DISTRO_FEATURES', 'libc-utmpx', True, False, d)
+    libc_wordexp = bb.utils.contains('DISTRO_FEATURES', 'libc-wordexp', True, False, d)
+    libc_posix_clang_wchar = bb.utils.contains('DISTRO_FEATURES', 'libc-posix-clang-wchar', True, False, d)
+    libc_posix_regexp = bb.utils.contains('DISTRO_FEATURES', 'libc-posix-regexp', True, False, d)
+    libc_posix_regexp_glibc = bb.utils.contains('DISTRO_FEATURES', 'libc-posix-regexp-glibc', True, False, d)
+    libc_posix_wchar_io = bb.utils.contains('DISTRO_FEATURES', 'libc-posix-wchar-io', True, False, d)
+
+    # arrange the dependencies among glibc configuable options according to file option-groups.def from glibc source code
+    new_dep = True
+    while new_dep:
+        new_dep = False
+
+        if ipv6 and not ipv4:
+            new_dep = True
+            ipv4 = True
+
+        if ipv4 and not libc_nsswitch:
+            new_dep = True
+            libc_nsswitch = True
+
+        if libc_cxx_tests:
+            if not libc_posix_wchar_io:
+                new_dep = True
+                libc_posix_wchar_io = True
+            if not libc_libm:
+                new_dep = True
+                libc_libm = True
+
+        if libc_catgets and not libc_locale_code:
+            new_dep = True
+            libc_locale_code = True
+
+        if libc_crypt_ufc and not libc_crypt:
+            new_dep = True
+            libc_crypt = True
+
+        if libc_getlogin and not libc_utmp:
+            new_dep = True
+            libc_utmp = True
+
+        if libc_inet_anl and not ipv4:
+            new_dep = True
+            ipv4 = True
+
+        if libc_locale_code and not libc_posix_clang_wchar:
+            new_dep = True
+            libc_posix_clang_wchar = True
+
+        if libc_nis:
+            if not ipv4:
+                new_dep = True
+                ipv4 = True
+            if not libc_sunrpc:
+                new_dep = True
+                libc_sunrpc = True
+
+        if libc_rcmd and not ipv4:
+            new_dep = True
+            ipv4 = True
+
+        if libc_sunrpc and not ipv4:
+            new_dep = True
+            ipv4 = True
+
+        if libc_utmpx and not libc_utmp:
+            new_dep = True
+            libc_utmp = True
+
+        if libc_posix_regexp_glibc and not libc_posix_regexp:
+            new_dep = True
+            libc_posix_regexp = True
+
+        if libc_posix_wchar_io and not libc_posix_clang_wchar:
+            new_dep = True
+            libc_posix_clang_wchar = True
+
+    glibc_cfg(ipv6, 'OPTION_EGLIBC_ADVANCED_INET6', cnf)
+    glibc_cfg(libc_backtrace, 'OPTION_EGLIBC_BACKTRACE', cnf)
+    glibc_cfg(libc_big_macros, 'OPTION_EGLIBC_BIG_MACROS', cnf)
+    glibc_cfg(libc_bsd, 'OPTION_EGLIBC_BSD', cnf)
+    glibc_cfg(libc_cxx_tests, 'OPTION_EGLIBC_CXX_TESTS', cnf)
+    glibc_cfg(libc_catgets, 'OPTION_EGLIBC_CATGETS', cnf)
+    glibc_cfg(libc_charsets, 'OPTION_EGLIBC_CHARSETS', cnf)
+    glibc_cfg(libc_crypt, 'OPTION_EGLIBC_CRYPT', cnf)
+    glibc_cfg(libc_crypt_ufc, 'OPTION_EGLIBC_CRYPT_UFC', cnf)
+    glibc_cfg(libc_db_aliases, 'OPTION_EGLIBC_DB_ALIASES', cnf)
+    glibc_cfg(libc_envz, 'OPTION_EGLIBC_ENVZ', cnf)
+    glibc_cfg(libc_fcvt, 'OPTION_EGLIBC_FCVT', cnf)
+    glibc_cfg(libc_fmtmsg, 'OPTION_EGLIBC_FMTMSG', cnf)
+    glibc_cfg(libc_fstab, 'OPTION_EGLIBC_FSTAB', cnf)
+    glibc_cfg(libc_ftraverse, 'OPTION_EGLIBC_FTRAVERSE', cnf)
+    glibc_cfg(libc_getlogin, 'OPTION_EGLIBC_GETLOGIN', cnf)
+    glibc_cfg(libc_idn, 'OPTION_EGLIBC_IDN', cnf)
+    glibc_cfg(ipv4, 'OPTION_EGLIBC_INET', cnf)
+    glibc_cfg(libc_inet_anl, 'OPTION_EGLIBC_INET_ANL', cnf)
+    glibc_cfg(libc_libm, 'OPTION_EGLIBC_LIBM', cnf)
+    glibc_cfg(libc_locales, 'OPTION_EGLIBC_LOCALES', cnf)
+    glibc_cfg(libc_locale_code, 'OPTION_EGLIBC_LOCALE_CODE', cnf)
+    glibc_cfg(libc_memusage, 'OPTION_EGLIBC_MEMUSAGE', cnf)
+    glibc_cfg(libc_nis, 'OPTION_EGLIBC_NIS', cnf)
+    glibc_cfg(libc_nsswitch, 'OPTION_EGLIBC_NSSWITCH', cnf)
+    glibc_cfg(libc_rcmd, 'OPTION_EGLIBC_RCMD', cnf)
+    glibc_cfg(libc_rtld_debug, 'OPTION_EGLIBC_RTLD_DEBUG', cnf)
+    glibc_cfg(libc_spawn, 'OPTION_EGLIBC_SPAWN', cnf)
+    glibc_cfg(libc_streams, 'OPTION_EGLIBC_STREAMS', cnf)
+    glibc_cfg(libc_sunrpc, 'OPTION_EGLIBC_SUNRPC', cnf)
+    glibc_cfg(libc_utmp, 'OPTION_EGLIBC_UTMP', cnf)
+    glibc_cfg(libc_utmpx, 'OPTION_EGLIBC_UTMPX', cnf)
+    glibc_cfg(libc_wordexp, 'OPTION_EGLIBC_WORDEXP', cnf)
+    glibc_cfg(libc_posix_clang_wchar, 'OPTION_POSIX_C_LANG_WIDE_CHAR', cnf)
+    glibc_cfg(libc_posix_regexp, 'OPTION_POSIX_REGEXP', cnf)
+    glibc_cfg(libc_posix_regexp_glibc, 'OPTION_POSIX_REGEXP_GLIBC', cnf)
+    glibc_cfg(libc_posix_wchar_io, 'OPTION_POSIX_WIDE_CHAR_DEVICE_IO', cnf)
+
+    return "\n".join(cnf)
diff --git a/meta/recipes-core/glibc/glibc-package.inc b/meta/recipes-core/glibc/glibc-package.inc
new file mode 100644
index 0000000..5f60368
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-package.inc
@@ -0,0 +1,214 @@
+#
+# For now, we will skip building of a gcc package if it is a uclibc one
+# and our build is not a uclibc one, and we skip a glibc one if our build
+# is a uclibc build.
+#
+# See the note in gcc/gcc_3.4.0.oe
+#
+
+python __anonymous () {
+    import bb, re
+    uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS', True)) != None)
+    if uc_os:
+        raise bb.parse.SkipPackage("incompatible with target %s" %
+                                   d.getVar('TARGET_OS', True))
+}
+
+# Set this to zero if you don't want ldconfig in the output package
+USE_LDCONFIG ?= "1"
+
+INHIBIT_SYSROOT_STRIP = "1"
+
+PACKAGES = "${PN}-dbg catchsegv sln nscd ldd tzcode ${PN}-utils glibc-thread-db ${PN}-pic libcidn libmemusage libsegfault ${PN}-pcprofile libsotruss ${PN} glibc-extra-nss ${PN}-dev ${PN}-staticdev ${PN}-doc"
+
+# The ld.so in this glibc supports the GNU_HASH
+RPROVIDES_${PN} = "eglibc rtld(GNU_HASH)"
+RPROVIDES_${PN}-utils = "eglibc-utils"
+RPROVIDES_${PN}-mtrace = "eglibc-mtrace libc-mtrace"
+RPROVIDES_${PN}-pic = "eglibc-pic"
+RPROVIDES_${PN}-dev = "eglibc-dev libc6-dev virtual-libc-dev"
+RPROVIDES_${PN}-staticdev = "eglibc-staticdev"
+RPROVIDES_${PN}-doc = "eglibc-doc"
+RPROVIDES_glibc-extra-nss = "eglibc-extra-nss"
+RPROVIDES_glibc-thread-db = "eglibc-thread-db"
+RPROVIDES_${PN}-pcprofile = "eglibc-pcprofile"
+RPROVIDES_${PN}-dbg = "eglibc-dbg"
+libc_baselibs = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so ${base_libdir}/libc.so.* ${base_libdir}/libc-*.so ${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so ${base_libdir}/libmvec-*.so ${base_libdir}/ld*.so.* ${base_libdir}/ld-*.so ${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so ${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so ${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so ${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so ${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so ${base_libdir}/libnss_files*.so.* ${base_libdir}/libnss_files-*.so ${base_libdir}/libnss_compat*.so.* ${base_libdir}/libnss_compat-*.so ${base_libdir}/libnss_dns*.so.* ${base_libdir}/libnss_dns-*.so ${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so ${base_libdir}/libanl*.so.* ${base_libdir}/libanl-*.so ${base_libdir}/libBrokenLocale*.so.* ${base_libdir}/libBrokenLocale-*.so"
+libc_baselibs_append_aarch64 = " /lib/ld-linux-aarch64*.so.1"
+INSANE_SKIP_${PN}_append_aarch64 = " libdir"
+
+FILES_${PN} = "${libc_baselibs} ${libexecdir}/* ${@base_conditional('USE_LDCONFIG', '1', '${base_sbindir}/ldconfig ${sysconfdir}/ld.so.conf', '', d)}"
+FILES_ldd = "${bindir}/ldd"
+FILES_libsegfault = "${base_libdir}/libSegFault*"
+FILES_libcidn = "${base_libdir}/libcidn-*.so ${base_libdir}/libcidn.so.*"
+FILES_libmemusage = "${base_libdir}/libmemusage.so"
+FILES_glibc-extra-nss = "${base_libdir}/libnss_*-*.so ${base_libdir}/libnss_*.so.*"
+FILES_sln = "${base_sbindir}/sln"
+FILES_${PN}-pic = "${libdir}/*_pic.a ${libdir}/*_pic.map ${libdir}/libc_pic/*.o"
+FILES_libsotruss = "${libdir}/audit/sotruss-lib.so"
+FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-dev += "${bindir}/rpcgen ${libdir}/*_nonshared.a ${base_libdir}/*_nonshared.a ${base_libdir}/*.o ${datadir}/aclocal"
+FILES_${PN}-staticdev += "${libdir}/*.a ${base_libdir}/*.a"
+FILES_nscd = "${sbindir}/nscd* ${sysconfdir}/init.d/nscd ${systemd_unitdir}/system/nscd* ${sysconfdir}/tmpfiles.d/nscd.conf \
+              ${sysconfdir}/nscd.conf ${sysconfdir}/default/volatiles/98_nscd ${localstatedir}/db/nscd"
+FILES_${PN}-mtrace = "${bindir}/mtrace"
+FILES_tzcode = "${bindir}/tzselect ${sbindir}/zic ${sbindir}/zdump"
+FILES_${PN}-utils = "${bindir}/* ${sbindir}/*"
+FILES_${PN}-dbg += "${libexecdir}/*/.debug ${libdir}/audit/.debug"
+FILES_catchsegv = "${bindir}/catchsegv"
+RDEPENDS_catchsegv = "libsegfault"
+FILES_${PN}-pcprofile = "${base_libdir}/libpcprofile.so"
+FILES_glibc-thread-db = "${base_libdir}/libthread_db.so.* ${base_libdir}/libthread_db-*.so"
+RPROVIDES_${PN}-dev += "libc-dev"
+RPROVIDES_${PN}-staticdev += "libc-staticdev"
+
+SUMMARY_sln = "The static ln"
+DESCRIPTION_sln = "Similar to the 'ln' utility, but statically linked.  sln is useful to make symbolic links to dynamic libraries if the dynamic linking system, for some reason, is not functional."
+SUMMARY_nscd = "Name service cache daemon"
+DESCRIPTION_nscd = "nscd, name service cache daemon, caches name service lookups for the passwd, group and hosts information.  It can damatically improvide performance with remote, such as NIS or NIS+, name services."
+SUMMARY_glibc-extra-nss = "hesiod, NIS and NIS+ nss libraries"
+DESCRIPTION_glibc-extra-nss = "glibc: nis, nisplus and hesiod search services."
+SUMMARY_ldd = "print shared library dependencies"
+DESCRIPTION_ldd = "${bindir}/ldd prints shared library dependencies for each program or shared library specified on the command line."
+SUMMARY_${PN}-utils = "Miscellaneous utilities provided by glibc"
+DESCRIPTION_${PN}-utils = "Miscellaneous utilities including getconf, iconv, locale, gencat, rpcgen, ..."
+DESCRIPTION_libsotruss = "Library to support sotruss which traces calls through PLTs"
+DESCRIPTION_tzcode = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
+
+inherit libc-common multilib_header
+
+do_install_append () {
+	rm -f ${D}${sysconfdir}/localtime
+	rm -rf ${D}${localstatedir}
+
+	# remove empty glibc dir
+	if [ -d ${D}${libdir}/glibc -a ! -e ${D}${libdir}/glibc/pt_chown ]; then
+		rmdir ${D}${libdir}/glibc
+	fi
+	oe_multilib_header bits/syscall.h
+
+	if [ -f ${D}${bindir}/mtrace ]; then
+		sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' -e '2s,exec.*perl,exec ${USRBINPATH}/env perl,' ${D}${bindir}/mtrace
+	fi
+	rm -rf ${D}${includedir}/rpcsvc/rquota*
+	# Info dir listing isn't interesting at this point so remove it if it exists.
+	if [ -e "${D}${infodir}/dir" ]; then
+		rm -f ${D}${infodir}/dir
+	fi
+
+	if [ "${USE_LDCONFIG}" != "1" ]; then
+		# We won't ship these files (see FILES above) so let's not install them
+		rm -f ${D}${sysconfdir}/ld.so.conf
+		rm -f ${D}${base_sbindir}/ldconfig
+		# This directory will be empty now so remove it too.
+		# But check whether it exists first, since it won't for glibc-initial.
+		if [ -d ${D}${sysconfdir} ]; then
+			rmdir ${D}${sysconfdir}
+		fi
+	fi
+
+	if echo ${PN}|grep -q "glibc-initial"; then
+		return
+	fi
+
+	install -d ${D}${sysconfdir}/init.d
+	install -d ${D}${localstatedir}/db/nscd
+	install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd
+	install -m 0755 ${S}/nscd/nscd.conf ${D}${sysconfdir}/nscd.conf
+	sed -i "s%daemon%start-stop-daemon --start --exec%g" ${D}${sysconfdir}/init.d/nscd
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_unitdir}/system/
+
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		install -d ${D}${sysconfdir}/tmpfiles.d
+		echo "d /run/nscd 755 root root -" \
+			> ${D}${sysconfdir}/tmpfiles.d/nscd.conf
+	else
+		install -d ${D}${sysconfdir}/default/volatiles
+		echo "d root root 0755 /var/run/nscd none" \
+			> ${D}${sysconfdir}/default/volatiles/98_nscd
+	fi
+}
+
+do_install_append_aarch64 () {
+	if [ "${base_libdir}" != "/lib" ] ; then
+		# The aarch64 ABI says the dynamic linker -must- be /lib/ld-linux-aarch64[_be].so.1
+		install -d ${D}/lib
+		if [ -e ${D}${base_libdir}/ld-linux-aarch64.so.1 ]; then
+			ln -s ${@base_path_relative('/lib', '${base_libdir}')}/ld-linux-aarch64.so.1 \
+				${D}/lib/ld-linux-aarch64.so.1
+		elif [ -e ${D}${base_libdir}/ld-linux-aarch64_be.so.1 ]; then
+			ln -s ${@base_path_relative('/lib', '${base_libdir}')}/ld-linux-aarch64_be.so.1 \
+				${D}/lib/ld-linux-aarch64_be.so.1
+		fi
+	fi
+}
+
+do_install_locale () {
+	dest=${D}/${includedir}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}
+	install -d ${dest}${base_libdir} ${dest}${bindir} ${dest}${libdir} ${dest}${datadir}
+	if [ "${base_libdir}" != "${libdir}" ]; then
+		cp -fpPR ${D}${base_libdir}/* ${dest}${base_libdir}
+	fi
+	if [ -e ${D}${bindir}/localedef ]; then
+		mv -f ${D}${bindir}/localedef ${dest}${bindir}
+	fi
+	if [ -e ${D}${libdir}/gconv ]; then
+		mv -f ${D}${libdir}/gconv ${dest}${libdir}
+	fi
+	if [ -e ${D}${exec_prefix}/lib ]; then
+		cp -fpPR ${D}${exec_prefix}/lib ${dest}${exec_prefix}
+	fi
+	if [ -e ${D}${datadir}/i18n ]; then
+		mv ${D}${datadir}/i18n ${dest}${datadir}
+	fi
+	cp -fpPR ${D}${datadir}/* ${dest}${datadir}
+	rm -rf ${D}${datadir}/locale/
+	cp -fpPR ${WORKDIR}/SUPPORTED ${dest}
+}
+
+addtask do_install_locale after do_install before do_populate_sysroot do_package
+
+bashscripts = "mtrace sotruss xtrace"
+
+do_evacuate_scripts () {
+	target=${D}${includedir}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}
+	mkdir -p $target
+	for i in ${bashscripts}; do
+		if [ -f ${D}${bindir}/$i ]; then
+			cp ${D}${bindir}/$i $target/
+		fi
+	done
+}
+
+addtask evacuate_scripts after do_install before do_populate_sysroot do_package
+
+PACKAGE_PREPROCESS_FUNCS += "glibc_package_preprocess"
+
+glibc_package_preprocess () {
+	rm -rf ${PKGD}/${includedir}/glibc-locale-internal-${MULTIMACH_TARGET_SYS}
+	rm -rf ${PKGD}/${includedir}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}
+	for i in ${bashscripts}; do
+	    rm -f ${PKGD}${bindir}/$i
+	done
+	rm -rf ${PKGD}/${localedir}
+	if [ "${libdir}" != "${exec_prefix}/lib" ]; then
+		# This dir only exists to hold locales
+		rm -rf ${PKGD}${exec_prefix}/lib
+	fi
+}
+
+pkg_postinst_nscd () {
+	if [ -z "$D" ]; then
+		if command -v systemd-tmpfiles >/dev/null; then
+			systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/nscd.conf
+		elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then
+			${sysconfdir}/init.d/populate-volatile.sh update
+		fi
+	fi
+}
+CONFFILES_nscd="${sysconfdir}/nscd.conf"
+
+SYSTEMD_PACKAGES = "nscd"
+SYSTEMD_SERVICE_nscd = "nscd.service"
diff --git a/meta/recipes-core/glibc/glibc-scripts.inc b/meta/recipes-core/glibc/glibc-scripts.inc
new file mode 100644
index 0000000..3a06773
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-scripts.inc
@@ -0,0 +1,16 @@
+include glibc-collateral.inc
+
+SUMMARY = "utility scripts provided by glibc"
+DESCRIPTION = "utility scripts provided by glibc"
+RDEPENDS_${PN} = "bash glibc-mtrace"
+
+SRC = "${STAGING_INCDIR}/glibc-scripts-internal-${MULTIMACH_TARGET_SYS}"
+
+bashscripts = "sotruss xtrace"
+
+do_install() {
+	install -d -m 0755 ${D}${bindir}
+	for i in ${bashscripts}; do
+		install -m 0755 ${SRC}/$i ${D}${bindir}/
+	done
+}
diff --git a/meta/recipes-core/glibc/glibc-scripts_2.22.bb b/meta/recipes-core/glibc/glibc-scripts_2.22.bb
new file mode 100644
index 0000000..5a89bd8
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-scripts_2.22.bb
@@ -0,0 +1 @@
+require glibc-scripts.inc
diff --git a/meta/recipes-core/glibc/glibc-testing.inc b/meta/recipes-core/glibc/glibc-testing.inc
new file mode 100644
index 0000000..a9bbf37
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc-testing.inc
@@ -0,0 +1,96 @@
+do_compile_append () {
+	# now generate script to drive testing
+	echo "#!/usr/bin/env sh" >${B}/${HOST_PREFIX}testglibc
+	set >> ${B}/${HOST_PREFIX}testglibc
+	# prune out the unneeded vars
+	sed -i -e "/^BASH/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^USER/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^OPT/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^DIRSTACK/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^EUID/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^FUNCNAME/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^GROUPS/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^HOST/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^HOME/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^IFS/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^LC_ALL/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^LOGNAME/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^MACHTYPE/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^OSTYPE/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^PIPE/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^SHELL/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^'/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^UID/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^TERM/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^PATCH_GET/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^PKG_/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^POSIXLY_/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^PPID/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^PS4/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^Q/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^SHLVL/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^STAGING/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${HOST_PREFIX}testglibc
+	sed -i -e "/^PSEUDO/d" ${B}/${HOST_PREFIX}testglibc
+
+	# point to real sysroot not the toolchain bootstrap sysroot
+	sed -i -e "s/\-tcbootstrap//g" ${B}/${HOST_PREFIX}testglibc
+
+	# use the final cross-gcc to test since some tests need libstdc++
+	sed -i -e "s/^PATH=.*\.gcc-cross-initial\:/PATH=/g" ${B}/${HOST_PREFIX}testglibc
+
+	# append execution part script
+cat >> ${B}/${HOST_PREFIX}testglibc << STOP
+target="\$1"
+if [ "x\$target" = "x" ]
+then
+	echo "Please specify the target machine and remote user in form of user@target"
+	exit 1;
+fi
+ssh \$target ls \$PWD\  2>&1 > /dev/null
+if [ "x\$?" != "x0" ]
+then
+	echo "Failed connecting to \$target it could be because of:"
+	echo "1. You dont have passwordless ssh setup to access \$target"
+	echo "2. NFS share on \$target is not mounted or if mounted then not matching the build tree layout."
+	echo "   The tree should be accessible at same location on build host and target"
+	echo "   You can add nfs-client to IMAGE_FEATURES to get the nfs client on target"
+	echo "3. nfs server on build host is not running."
+	echo "   Please make sure that you have 'no_root_squash' added in /etc/exports if you want"
+	echo "   to test as root user on target (usually its recommended to create a non"
+	echo "   root user."
+	echo "   As a sanity check make sure that target can read/write to the glibc build tree"
+	echo "   Please refer to ${S}/EGLIBC.cross-testing for further instructions on setup"
+	exit 1
+fi
+	echo "# we test using cross compiler from real sysroot therefore override the" > ${B}/configparms
+	echo "# definitions that come from ${B}/config.make" >> ${B}/configparms
+	fgrep tcbootstrap ${B}/config.make > ${B}/configparms
+	sed -i -e "s/\-tcbootstrap//g" ${B}/configparms
+
+# g++ uses flag -nostdinc, so the locations of system include headers must be explicitly specified
+# If the locations are not already specified in config.make, then we provide the following locations:
+#    <sysroot>/usr/include/c++/<g++ version>
+#    <sysroot>/usr/include/c++/<g++ version>/<machine>
+
+cxxincludes=\`cat ${B}/config.make | gawk '\$1 == "c++-sysincludes"' | gawk -F"=" '{print \$2}' | sed "s/[ \t]\?//g"\`
+
+if [ -z "\$cxxincludes" ]; then
+  sysroot=\`cat ${B}/configparms | sed -n "/CXX/p" | sed -e "s/^.*--sysroot=//"\`
+  cxx=\`cat ${B}/configparms | gawk '\$1 ~ /^CXX/' | gawk -F"=" '{print \$2}' | gawk '{print \$1}'\`
+  cxxmachine=\`\$cxx -dumpmachine\`
+  cxxversion=\`\$cxx -dumpversion\`
+  # pass the new value of c++-sysincludes via configparms
+  echo "# c++-sysincludes added:" >> ${B}/configparms
+  echo "c++-sysincludes = -isystem \$sysroot/usr/include/c++/\$cxxversion -isystem \$sysroot/usr/include/c++/\$cxxversion/\$cxxmachine" >> ${B}/configparms
+fi
+
+wrapper="${S}/scripts/cross-test-ssh.sh \$target"
+localedef="${STAGING_BINDIR_NATIVE}/cross-localedef --little-endian --uint32-align=4"
+make tests-clean
+make cross-localedef="\$localedef" cross-test-wrapper="\$wrapper" -k check
+rm -rf ${B}/configparms
+STOP
+
+	chmod +x ${B}/${HOST_PREFIX}testglibc
+}
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
new file mode 100644
index 0000000..17fa2d5
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -0,0 +1,105 @@
+require glibc-common.inc
+require glibc-ld.inc
+require glibc-testing.inc
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
+
+# glibc can't be built without optimization, if someone tries to compile an
+# entire image as -O0, we override it with -O2 here and give a note about it.
+def get_optimization(d):
+    selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
+    if bb.utils.contains("SELECTED_OPTIMIZATION", "-O2", "x", "", d) == "x":
+        return selected_optimization
+    elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O", "x", "", d) == "x":
+        bb.note("glibc can't be built with -O, -O -Wno-error will be used instead.")
+        return selected_optimization.replace("-O", "-O -Wno-error")
+    elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
+        bb.note("glibc can't be built with -O0, -O2 will be used instead.")
+        return selected_optimization.replace("-O0", "-O2")
+    elif bb.utils.contains("SELECTED_OPTIMIZATION", "-Os", "x", "", d) == "x":
+        bb.note("glibc can't be built with -Os, -Os -Wno-error will be used instead.")
+        return selected_optimization.replace("-Os", "-Os -Wno-error")
+    elif bb.utils.contains("SELECTED_OPTIMIZATION", "-O1", "x", "", d) == "x":
+        bb.note("glibc can't be built with -O1, -O1 -Wno-error will be used instead.")
+        return selected_optimization.replace("-O1", "-O1 -Wno-error")
+    return selected_optimization
+
+SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
+
+# siteconfig.bbclass runs configure which needs a working compiler
+# For the compiler to work we need a working libc yet libc isn't
+# in the sysroots directory at this point. This means the libc.so
+# linker script won't work as the --sysroot setting isn't correct.
+# Here we create a hacked up libc linker script and pass in the right
+# flags to let configure work. Ugly.
+EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'"
+siteconfig_do_siteconfig_gencache_prepend = " \
+	mkdir -p ${WORKDIR}/site_config_libc; \
+	cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
+	sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
+"
+
+# nptl needs unwind support in gcc, which can't be built without glibc.
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial libgcc-initial linux-libc-headers virtual/${TARGET_PREFIX}libc-initial"
+# nptl needs libgcc but dlopens it, so our shlibs code doesn't detect this
+#RDEPENDS_${PN} += "${@['','libgcc']['nptl' in '${GLIBC_ADDONS}']}"
+PROVIDES = "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
+PROVIDES += "virtual/libintl virtual/libiconv"
+inherit autotools texinfo distro_features_check systemd
+require glibc-options.inc
+
+# The main purpose of setting this variable is to prevent users from accidently
+# overriding DISTRO_FEATRUES, causing obscure build failures because of lack
+# of libc functions.
+REQUIRED_DISTRO_FEATURES = "${DISTRO_FEATURES_LIBC}"
+
+LEAD_SONAME = "libc.so"
+
+CACHED_CONFIGUREVARS += " \
+  ac_cv_path_BASH_SHELL=${base_bindir}/bash \
+  libc_cv_slibdir=${base_libdir} \
+  libc_cv_rootsbindir=${base_sbindir} \
+  libc_cv_localedir=${localedir} \
+  libc_cv_ssp=no \
+"
+
+GLIBC_EXTRA_OECONF ?= ""
+GLIBC_EXTRA_OECONF_class-nativesdk = ""
+INHIBIT_DEFAULT_DEPS = "1"
+
+# This needs to match with glibc-collateral.inc, otherwise glibc-scripts and glibc-locale
+# will fail to find main glibc, for details see
+# http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100679.html
+ARM_INSTRUCTION_SET = "arm"
+
+# glibc uses PARALLELMFLAGS variable to pass parallel build info so transfer
+# PARALLEL_MAKE into PARALLELMFLAGS and empty out PARALLEL_MAKE
+EGLIBCPARALLELISM := "PARALLELMFLAGS="${PARALLEL_MAKE}""
+EXTRA_OEMAKE[vardepsexclude] += "EGLIBCPARALLELISM"
+EXTRA_OEMAKE += "${EGLIBCPARALLELISM}"
+PARALLEL_MAKE = ""
+
+# glibc make-syscalls.sh has a number of issues with /bin/dash and
+# it's output which make calls via the SHELL also has issues, so
+# ensure make uses /bin/bash
+EXTRA_OEMAKE += "SHELL=/bin/bash"
+
+OE_FEATURES = "${@features_to_glibc_settings(d)}"
+do_configure_prepend() {
+	sed -e "s#@BASH@#/bin/sh#" -i ${S}/elf/ldd.bash.in
+	echo '${OE_FEATURES}' > ${B}/option-groups.config
+}
+
+do_configure_append() {
+	yes '' | oe_runmake config
+
+	# Remove quotation marks from OPTION_EGLIBC_NSSWITCH_FIXED_*. This will
+	# avoid install error.
+	sed -i 's/^OPTION_EGLIBC_NSSWITCH_FIXED_\(.*\)="\(.*\)"$/OPTION_EGLIBC_NSSWITCH_FIXED_\1=\2/' option-groups.config
+}
+
+GLIBC_ADDONS ?= "nptl,libidn"
diff --git a/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch b/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
new file mode 100644
index 0000000..3d66348
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch
@@ -0,0 +1,70 @@
+From 0876fea1b5b26da84f298714a2e23ba696607dba Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:48:24 +0000
+Subject: [PATCH 01/27] nativesdk-glibc: Look for host system ld.so.cache as
+ well
+
+Upstream-Status: Inappropriate [embedded specific]
+
+The default lib search path order is:
+
+  1) LD_LIBRARY_PATH
+  2) RPATH from the binary
+  3) ld.so.cache
+  4) default search paths embedded in the linker
+
+For nativesdk binaries which are being used alongside binaries on a host system, we
+need the search paths to firstly search the shipped nativesdk libs but then also
+cover the host system. For example we want the host system's libGL and this may be
+in a non-standard location like /usr/lib/mesa. The only place the location is know
+about is in the ld.so.cache of the host system.
+
+Since nativesdk has a simple structure and doesn't need to use a cache itself, we
+repurpose the cache for use as a last resort in finding host system binaries. This
+means we need to switch the order of 3 and 4 above to make this work effectively.
+
+RP 14/10/2010
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/dl-load.c | 17 ++++++++---------
+ 1 file changed, 8 insertions(+), 9 deletions(-)
+
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index 0c052e4..f45085a 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -2040,7 +2040,14 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 	fd = open_path (name, namelen, mode,
+ 			&loader->l_runpath_dirs, &realname, &fb, loader,
+ 			LA_SER_RUNPATH, &found_other_class);
+-
++      /* try the default path.  */
++      if (fd == -1
++	  && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
++	   || __builtin_expect (!(l->l_flags_1 & DF_1_NODEFLIB), 1))
++	 && rtld_search_dirs.dirs != (void *) -1)
++	fd = open_path (name, namelen, mode & __RTLD_SECURE, &rtld_search_dirs,
++			&realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
++      /* Finally try ld.so.cache */
+ #ifdef USE_LDCONFIG
+       if (fd == -1
+ 	  && (__glibc_likely ((mode & __RTLD_SECURE) == 0)
+@@ -2099,14 +2106,6 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 	}
+ #endif
+ 
+-      /* Finally, try the default path.  */
+-      if (fd == -1
+-	  && ((l = loader ?: GL(dl_ns)[nsid]._ns_loaded) == NULL
+-	      || __glibc_likely (!(l->l_flags_1 & DF_1_NODEFLIB)))
+-	  && rtld_search_dirs.dirs != (void *) -1)
+-	fd = open_path (name, namelen, mode, &rtld_search_dirs,
+-			&realname, &fb, l, LA_SER_DEFAULT, &found_other_class);
+-
+       /* Add another newline when we are tracing the library loading.  */
+       if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
+ 	_dl_debug_printf ("\n");
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch b/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
new file mode 100644
index 0000000..b568fc6
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch
@@ -0,0 +1,50 @@
+From 086b65d9aacffc47fcd8df68818a476a5ae76fa1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:50:00 +0000
+Subject: [PATCH 02/27] nativesdk-glibc: Fix buffer overrun with a relocated
+ SDK
+
+When ld-linux-*.so.2 is relocated to a path that is longer than the
+original fixed location, the dynamic loader will crash in open_path
+because it implicitly assumes that max_dirnamelen is a fixed size that
+never changes.
+
+The allocated buffer will not be large enough to contain the directory
+path string which is larger than the fixed location provided at build
+time.
+
+Upstream-Status: Inappropriate [OE SDK specific]
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/dl-load.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index f45085a..f1eb5ed 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -1765,7 +1765,19 @@ open_path (const char *name, size_t namelen, int mode,
+        given on the command line when rtld is run directly.  */
+     return -1;
+ 
++  do
++    {
++      struct r_search_path_elem *this_dir = *dirs;
++      if (this_dir->dirnamelen > max_dirnamelen)
++	{
++	  max_dirnamelen = this_dir->dirnamelen;
++	}
++    }
++  while (*++dirs != NULL);
++
+   buf = alloca (max_dirnamelen + max_capstrlen + namelen);
++
++  dirs = sps->dirs;
+   do
+     {
+       struct r_search_path_elem *this_dir = *dirs;
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch b/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
new file mode 100644
index 0000000..a681a64
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch
@@ -0,0 +1,126 @@
+From fd595a5ec885bcb4c14417daa21c2e61c5b72e42 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:51:38 +0000
+Subject: [PATCH 03/27] nativesdk-glibc: Raise the size of arrays containing dl
+ paths
+
+This patch puts the dynamic loader path in the binaries, SYSTEM_DIRS strings
+and lengths as well as ld.so.cache path in the dynamic loader to specific
+sections in memory. The sections that contain paths have been allocated a 4096
+byte section, which is the maximum path length in linux. This will allow the
+relocating script to parse the ELF binary, detect the section and easily replace
+the strings in a certain path.
+
+Upstream-Status: Inappropriate [SDK specific]
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/dl-cache.c             | 4 ++++
+ elf/dl-load.c              | 4 ++--
+ elf/interp.c               | 2 +-
+ elf/ldconfig.c             | 3 +++
+ elf/rtld.c                 | 5 +++--
+ sysdeps/generic/dl-cache.h | 4 ----
+ 6 files changed, 13 insertions(+), 9 deletions(-)
+
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index dec49bc..862f1d8 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -132,6 +132,10 @@ do									      \
+ while (0)
+ 
+ 
++const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache"))) =
++		SYSCONFDIR "/ld.so.cache";
++
++
+ int
+ internal_function
+ _dl_cache_libcmp (const char *p1, const char *p2)
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index f1eb5ed..f664f50 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -104,8 +104,8 @@ static size_t max_capstrlen attribute_relro;
+ /* Get the generated information about the trusted directories.  */
+ #include "trusted-dirs.h"
+ 
+-static const char system_dirs[] = SYSTEM_DIRS;
+-static const size_t system_dirs_len[] =
++static const char system_dirs[4096] __attribute__ ((section (".sysdirs"))) = SYSTEM_DIRS;
++volatile static const size_t system_dirs_len[] __attribute__ ((section (".sysdirslen"))) =
+ {
+   SYSTEM_DIRS_LEN
+ };
+diff --git a/elf/interp.c b/elf/interp.c
+index 422ea95e..6d61a36 100644
+--- a/elf/interp.c
++++ b/elf/interp.c
+@@ -18,5 +18,5 @@
+ 
+ #include <runtime-linker.h>
+ 
+-const char __invoke_dynamic_linker__[] __attribute__ ((section (".interp")))
++const char __invoke_dynamic_linker__[4096] __attribute__ ((section (".interp")))
+   = RUNTIME_LINKER;
+diff --git a/elf/ldconfig.c b/elf/ldconfig.c
+index f54ec22..0e78a83 100644
+--- a/elf/ldconfig.c
++++ b/elf/ldconfig.c
+@@ -167,6 +167,9 @@ static struct argp argp =
+   options, parse_opt, NULL, doc, NULL, more_help, NULL
+ };
+ 
++
++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
++
+ /* Check if string corresponds to an important hardware capability or
+    a platform.  */
+ static int
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 69873c2..6d3add7 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -99,6 +99,7 @@ uintptr_t __pointer_chk_guard_local
+ strong_alias (__pointer_chk_guard_local, __pointer_chk_guard)
+ #endif
+ 
++extern const char LD_SO_CACHE[4096] __attribute__ ((section (".ldsocache")));
+ 
+ /* List of auditing DSOs.  */
+ static struct audit_list
+@@ -877,12 +878,12 @@ of this helper program; chances are you did not intend to run this program.\n\
+   --list                list all dependencies and how they are resolved\n\
+   --verify              verify that given object really is a dynamically linked\n\
+ 			object we can handle\n\
+-  --inhibit-cache       Do not use " LD_SO_CACHE "\n\
++  --inhibit-cache       Do not use %s\n\
+   --library-path PATH   use given PATH instead of content of the environment\n\
+ 			variable LD_LIBRARY_PATH\n\
+   --inhibit-rpath LIST  ignore RUNPATH and RPATH information in object names\n\
+ 			in LIST\n\
+-  --audit LIST          use objects named in LIST as auditors\n");
++  --audit LIST          use objects named in LIST as auditors\n", LD_SO_CACHE);
+ 
+       ++_dl_skip_args;
+       --_dl_argc;
+diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
+index 4b49869..1800d03 100644
+--- a/sysdeps/generic/dl-cache.h
++++ b/sysdeps/generic/dl-cache.h
+@@ -27,10 +27,6 @@
+   ((flags) == 1 || (flags) == _DL_CACHE_DEFAULT_ID)
+ #endif
+ 
+-#ifndef LD_SO_CACHE
+-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
+-#endif
+-
+ #ifndef add_system_dir
+ # define add_system_dir(dir) add_dir (dir)
+ #endif
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0004-Backport-https-sourceware.org-ml-libc-ports-2007-12-.patch b/meta/recipes-core/glibc/glibc/0004-Backport-https-sourceware.org-ml-libc-ports-2007-12-.patch
new file mode 100644
index 0000000..7487503
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0004-Backport-https-sourceware.org-ml-libc-ports-2007-12-.patch
@@ -0,0 +1,34 @@
+From 2560b564b5674bf2990e5607f6342c1647a5dc4f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 8 Mar 2015 04:01:01 +0000
+Subject: [PATCH 04/27] Backport
+ https://sourceware.org/ml/libc-ports/2007-12/msg00000.html
+
+Upstream-Status: Pending
+
+2007-12-03  Kristian Van Der Vliet  <vanders@liqwyd.com>
+
+        * bits/stdio-lock.h (_IO_acquire_lock_clear_flags2): Define
+
+Signed-off-by: Kristian Van Der Vliet <vanders@liqwyd.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ bits/stdio-lock.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/bits/stdio-lock.h b/bits/stdio-lock.h
+index 0c5bb65..66304a6 100644
+--- a/bits/stdio-lock.h
++++ b/bits/stdio-lock.h
+@@ -49,6 +49,8 @@ __libc_lock_define_recursive (typedef, _IO_lock_t)
+   _IO_cleanup_region_start ((void (*) (void *)) _IO_funlockfile, (_fp));      \
+   _IO_flockfile (_fp)
+ 
++# define _IO_acquire_lock_clear_flags2(_fp) _IO_acquire_lock (_fp)
++
+ # define _IO_release_lock(_fp) \
+   _IO_funlockfile (_fp);						      \
+   _IO_cleanup_region_end (0)
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch b/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
new file mode 100644
index 0000000..8d3f859
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch
@@ -0,0 +1,1584 @@
+From aa0cd82892f32e58602143c697ef0524696a6428 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:01:50 +0000
+Subject: [PATCH 05/27] fsl e500/e5500/e6500/603e fsqrt implementation
+
+Upstream-Status: Pending
+Signed-off-by: Edmar Wienskoski <edmar@freescale.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c        | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c       | 101 ++++++++++++++++
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c      | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c     | 101 ++++++++++++++++
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c       | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c      | 101 ++++++++++++++++
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c       | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c      | 101 ++++++++++++++++
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c       | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c      | 101 ++++++++++++++++
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c       | 134 +++++++++++++++++++++
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c      | 101 ++++++++++++++++
+ .../sysv/linux/powerpc/powerpc32/603e/fpu/Implies  |   1 +
+ .../linux/powerpc/powerpc32/e300c3/fpu/Implies     |   2 +
+ .../linux/powerpc/powerpc32/e500mc/fpu/Implies     |   1 +
+ .../sysv/linux/powerpc/powerpc32/e5500/fpu/Implies |   1 +
+ .../sysv/linux/powerpc/powerpc32/e6500/fpu/Implies |   1 +
+ .../sysv/linux/powerpc/powerpc64/e5500/fpu/Implies |   1 +
+ .../sysv/linux/powerpc/powerpc64/e6500/fpu/Implies |   1 +
+ 19 files changed, 1418 insertions(+)
+ create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+ create mode 100644 sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
+ create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
+
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+new file mode 100644
+index 0000000..71e516d
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the actual square root and half of its reciprocal
++   simultaneously.  */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++     double b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++      double y, g, h, d, r;
++      ieee_double_shape_type u;
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          u.value = b;
++
++          relax_fenv_state ();
++
++          __asm__ ("frsqrte %[estimate], %[x]\n"
++                   : [estimate] "=f" (y) : [x] "f" (b));
++
++          /* Following Muller et al, page 168, equation 5.20.
++
++             h goes to 1/(2*sqrt(b))
++             g goes to sqrt(b).
++
++             We need three iterations to get within 1ulp.  */
++
++          /* Indicate that these can be performed prior to the branch.  GCC
++             insists on sinking them below the branch, however; it seems like
++             they'd be better before the branch so that we can cover any latency
++             from storing the argument and loading its high word.  Oh well.  */
++
++          g = b * y;
++          h = 0.5 * y;
++
++          /* Handle small numbers by scaling.  */
++          if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++            return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_)                                               \
++          ({ double __r;                                                \
++          __asm__ ("fmadd %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++#define FNMSUB(a_, c_, b_)                                          \
++          ({ double __r;                                                \
++          __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          /* g is now +/- 1ulp, or exactly equal to, the square root of b.  */
++
++          /* Final refinement.  */
++          d = FNMSUB (g, g, b);
++
++          fesetenv_register (fe);
++          return FMADD (d, h, g);
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000..26fa067
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the reciprocal square root and use that to compute the actual
++   square root.  */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++     float b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++#define FMSUB(a_, c_, b_)                                               \
++      ({ double __r;                                                    \
++        __asm__ ("fmsub %[r], %[a], %[c], %[b]\n"                       \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++#define FNMSUB(a_, c_, b_)                                              \
++      ({ double __r;                                                    \
++        __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                      \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          double y, x;
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          relax_fenv_state ();
++
++          /* Compute y = 1.5 * b - b.  Uses fewer constants than y = 0.5 * b.  */
++          y = FMSUB (threehalf, b, b);
++
++          /* Initial estimate.  */
++          __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++          /* Iterate.  x_{n+1} = x_n * (1.5 - y * (x_n * x_n)).  */
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++
++          /* All done.  */
++          fesetenv_register (fe);
++          return x * b;
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+new file mode 100644
+index 0000000..71e516d
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the actual square root and half of its reciprocal
++   simultaneously.  */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++     double b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++      double y, g, h, d, r;
++      ieee_double_shape_type u;
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          u.value = b;
++
++          relax_fenv_state ();
++
++          __asm__ ("frsqrte %[estimate], %[x]\n"
++                   : [estimate] "=f" (y) : [x] "f" (b));
++
++          /* Following Muller et al, page 168, equation 5.20.
++
++             h goes to 1/(2*sqrt(b))
++             g goes to sqrt(b).
++
++             We need three iterations to get within 1ulp.  */
++
++          /* Indicate that these can be performed prior to the branch.  GCC
++             insists on sinking them below the branch, however; it seems like
++             they'd be better before the branch so that we can cover any latency
++             from storing the argument and loading its high word.  Oh well.  */
++
++          g = b * y;
++          h = 0.5 * y;
++
++          /* Handle small numbers by scaling.  */
++          if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++            return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_)                                               \
++          ({ double __r;                                                \
++          __asm__ ("fmadd %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++#define FNMSUB(a_, c_, b_)                                          \
++          ({ double __r;                                                \
++          __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          /* g is now +/- 1ulp, or exactly equal to, the square root of b.  */
++
++          /* Final refinement.  */
++          d = FNMSUB (g, g, b);
++
++          fesetenv_register (fe);
++          return FMADD (d, h, g);
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000..26fa067
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the reciprocal square root and use that to compute the actual
++   square root.  */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++     float b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++#define FMSUB(a_, c_, b_)                                               \
++      ({ double __r;                                                    \
++        __asm__ ("fmsub %[r], %[a], %[c], %[b]\n"                       \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++#define FNMSUB(a_, c_, b_)                                              \
++      ({ double __r;                                                    \
++        __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                      \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          double y, x;
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          relax_fenv_state ();
++
++          /* Compute y = 1.5 * b - b.  Uses fewer constants than y = 0.5 * b.  */
++          y = FMSUB (threehalf, b, b);
++
++          /* Initial estimate.  */
++          __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++          /* Iterate.  x_{n+1} = x_n * (1.5 - y * (x_n * x_n)).  */
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++
++          /* All done.  */
++          fesetenv_register (fe);
++          return x * b;
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000..71e516d
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the actual square root and half of its reciprocal
++   simultaneously.  */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++     double b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++      double y, g, h, d, r;
++      ieee_double_shape_type u;
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          u.value = b;
++
++          relax_fenv_state ();
++
++          __asm__ ("frsqrte %[estimate], %[x]\n"
++                   : [estimate] "=f" (y) : [x] "f" (b));
++
++          /* Following Muller et al, page 168, equation 5.20.
++
++             h goes to 1/(2*sqrt(b))
++             g goes to sqrt(b).
++
++             We need three iterations to get within 1ulp.  */
++
++          /* Indicate that these can be performed prior to the branch.  GCC
++             insists on sinking them below the branch, however; it seems like
++             they'd be better before the branch so that we can cover any latency
++             from storing the argument and loading its high word.  Oh well.  */
++
++          g = b * y;
++          h = 0.5 * y;
++
++          /* Handle small numbers by scaling.  */
++          if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++            return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_)                                               \
++          ({ double __r;                                                \
++          __asm__ ("fmadd %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++#define FNMSUB(a_, c_, b_)                                          \
++          ({ double __r;                                                \
++          __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          /* g is now +/- 1ulp, or exactly equal to, the square root of b.  */
++
++          /* Final refinement.  */
++          d = FNMSUB (g, g, b);
++
++          fesetenv_register (fe);
++          return FMADD (d, h, g);
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000..26fa067
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the reciprocal square root and use that to compute the actual
++   square root.  */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++     float b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++#define FMSUB(a_, c_, b_)                                               \
++      ({ double __r;                                                    \
++        __asm__ ("fmsub %[r], %[a], %[c], %[b]\n"                       \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++#define FNMSUB(a_, c_, b_)                                              \
++      ({ double __r;                                                    \
++        __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                      \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          double y, x;
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          relax_fenv_state ();
++
++          /* Compute y = 1.5 * b - b.  Uses fewer constants than y = 0.5 * b.  */
++          y = FMSUB (threehalf, b, b);
++
++          /* Initial estimate.  */
++          __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++          /* Iterate.  x_{n+1} = x_n * (1.5 - y * (x_n * x_n)).  */
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++
++          /* All done.  */
++          fesetenv_register (fe);
++          return x * b;
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000..71e516d
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the actual square root and half of its reciprocal
++   simultaneously.  */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++     double b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++      double y, g, h, d, r;
++      ieee_double_shape_type u;
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          u.value = b;
++
++          relax_fenv_state ();
++
++          __asm__ ("frsqrte %[estimate], %[x]\n"
++                   : [estimate] "=f" (y) : [x] "f" (b));
++
++          /* Following Muller et al, page 168, equation 5.20.
++
++             h goes to 1/(2*sqrt(b))
++             g goes to sqrt(b).
++
++             We need three iterations to get within 1ulp.  */
++
++          /* Indicate that these can be performed prior to the branch.  GCC
++             insists on sinking them below the branch, however; it seems like
++             they'd be better before the branch so that we can cover any latency
++             from storing the argument and loading its high word.  Oh well.  */
++
++          g = b * y;
++          h = 0.5 * y;
++
++          /* Handle small numbers by scaling.  */
++          if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++            return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_)                                               \
++          ({ double __r;                                                \
++          __asm__ ("fmadd %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++#define FNMSUB(a_, c_, b_)                                          \
++          ({ double __r;                                                \
++          __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          /* g is now +/- 1ulp, or exactly equal to, the square root of b.  */
++
++          /* Final refinement.  */
++          d = FNMSUB (g, g, b);
++
++          fesetenv_register (fe);
++          return FMADD (d, h, g);
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000..26fa067
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the reciprocal square root and use that to compute the actual
++   square root.  */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++     float b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++#define FMSUB(a_, c_, b_)                                               \
++      ({ double __r;                                                    \
++        __asm__ ("fmsub %[r], %[a], %[c], %[b]\n"                       \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++#define FNMSUB(a_, c_, b_)                                              \
++      ({ double __r;                                                    \
++        __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                      \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          double y, x;
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          relax_fenv_state ();
++
++          /* Compute y = 1.5 * b - b.  Uses fewer constants than y = 0.5 * b.  */
++          y = FMSUB (threehalf, b, b);
++
++          /* Initial estimate.  */
++          __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++          /* Iterate.  x_{n+1} = x_n * (1.5 - y * (x_n * x_n)).  */
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++
++          /* All done.  */
++          fesetenv_register (fe);
++          return x * b;
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000..71e516d
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the actual square root and half of its reciprocal
++   simultaneously.  */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++     double b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++      double y, g, h, d, r;
++      ieee_double_shape_type u;
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          u.value = b;
++
++          relax_fenv_state ();
++
++          __asm__ ("frsqrte %[estimate], %[x]\n"
++                   : [estimate] "=f" (y) : [x] "f" (b));
++
++          /* Following Muller et al, page 168, equation 5.20.
++
++             h goes to 1/(2*sqrt(b))
++             g goes to sqrt(b).
++
++             We need three iterations to get within 1ulp.  */
++
++          /* Indicate that these can be performed prior to the branch.  GCC
++             insists on sinking them below the branch, however; it seems like
++             they'd be better before the branch so that we can cover any latency
++             from storing the argument and loading its high word.  Oh well.  */
++
++          g = b * y;
++          h = 0.5 * y;
++
++          /* Handle small numbers by scaling.  */
++          if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++            return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_)                                               \
++          ({ double __r;                                                \
++          __asm__ ("fmadd %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++#define FNMSUB(a_, c_, b_)                                          \
++          ({ double __r;                                                \
++          __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          /* g is now +/- 1ulp, or exactly equal to, the square root of b.  */
++
++          /* Final refinement.  */
++          d = FNMSUB (g, g, b);
++
++          fesetenv_register (fe);
++          return FMADD (d, h, g);
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000..26fa067
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the reciprocal square root and use that to compute the actual
++   square root.  */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++     float b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++#define FMSUB(a_, c_, b_)                                               \
++      ({ double __r;                                                    \
++        __asm__ ("fmsub %[r], %[a], %[c], %[b]\n"                       \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++#define FNMSUB(a_, c_, b_)                                              \
++      ({ double __r;                                                    \
++        __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                      \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          double y, x;
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          relax_fenv_state ();
++
++          /* Compute y = 1.5 * b - b.  Uses fewer constants than y = 0.5 * b.  */
++          y = FMSUB (threehalf, b, b);
++
++          /* Initial estimate.  */
++          __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++          /* Iterate.  x_{n+1} = x_n * (1.5 - y * (x_n * x_n)).  */
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++
++          /* All done.  */
++          fesetenv_register (fe);
++          return x * b;
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_washf (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+new file mode 100644
+index 0000000..71e516d
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+@@ -0,0 +1,134 @@
++/* Double-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float two108 = 3.245185536584267269e+32;
++static const float twom54 = 5.551115123125782702e-17;
++static const float half = 0.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the actual square root and half of its reciprocal
++   simultaneously.  */
++
++#ifdef __STDC__
++double
++__ieee754_sqrt (double b)
++#else
++double
++__ieee754_sqrt (b)
++     double b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++      double y, g, h, d, r;
++      ieee_double_shape_type u;
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          u.value = b;
++
++          relax_fenv_state ();
++
++          __asm__ ("frsqrte %[estimate], %[x]\n"
++                   : [estimate] "=f" (y) : [x] "f" (b));
++
++          /* Following Muller et al, page 168, equation 5.20.
++
++             h goes to 1/(2*sqrt(b))
++             g goes to sqrt(b).
++
++             We need three iterations to get within 1ulp.  */
++
++          /* Indicate that these can be performed prior to the branch.  GCC
++             insists on sinking them below the branch, however; it seems like
++             they'd be better before the branch so that we can cover any latency
++             from storing the argument and loading its high word.  Oh well.  */
++
++          g = b * y;
++          h = 0.5 * y;
++
++          /* Handle small numbers by scaling.  */
++          if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
++            return __ieee754_sqrt (b * two108) * twom54;
++
++#define FMADD(a_, c_, b_)                                               \
++          ({ double __r;                                                \
++          __asm__ ("fmadd %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++#define FNMSUB(a_, c_, b_)                                          \
++          ({ double __r;                                                \
++          __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                     \
++                   : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++          __r;})
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          r = FNMSUB (g, h, half);
++          g = FMADD (g, r, g);
++          h = FMADD (h, r, h);
++
++          /* g is now +/- 1ulp, or exactly equal to, the square root of b.  */
++
++          /* Final refinement.  */
++          d = FNMSUB (g, g, b);
++
++          fesetenv_register (fe);
++          return FMADD (d, h, g);
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_wash (b);
++}
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+new file mode 100644
+index 0000000..26fa067
+--- /dev/null
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+@@ -0,0 +1,101 @@
++/* Single-precision floating point square root.
++   Copyright (C) 2010 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <math.h>
++#include <math_private.h>
++#include <fenv_libc.h>
++#include <inttypes.h>
++
++#include <sysdep.h>
++#include <ldsodefs.h>
++
++static const ieee_float_shape_type a_nan = {.word = 0x7fc00000 };
++static const ieee_float_shape_type a_inf = {.word = 0x7f800000 };
++static const float threehalf = 1.5;
++
++/* The method is based on the descriptions in:
++
++   _The Handbook of Floating-Pointer Arithmetic_ by Muller et al., chapter 5;
++   _IA-64 and Elementary Functions: Speed and Precision_ by Markstein, chapter 9
++
++   We find the reciprocal square root and use that to compute the actual
++   square root.  */
++
++#ifdef __STDC__
++float
++__ieee754_sqrtf (float b)
++#else
++float
++__ieee754_sqrtf (b)
++     float b;
++#endif
++{
++  if (__builtin_expect (b > 0, 1))
++    {
++#define FMSUB(a_, c_, b_)                                               \
++      ({ double __r;                                                    \
++        __asm__ ("fmsub %[r], %[a], %[c], %[b]\n"                       \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++#define FNMSUB(a_, c_, b_)                                              \
++      ({ double __r;                                                    \
++        __asm__ ("fnmsub %[r], %[a], %[c], %[b]\n"                      \
++                 : [r] "=f" (__r) : [a] "f" (a_), [c] "f" (c_), [b] "f" (b_)); \
++        __r;})
++
++      if (__builtin_expect (b != a_inf.value, 1))
++        {
++          double y, x;
++          fenv_t fe;
++
++          fe = fegetenv_register ();
++
++          relax_fenv_state ();
++
++          /* Compute y = 1.5 * b - b.  Uses fewer constants than y = 0.5 * b.  */
++          y = FMSUB (threehalf, b, b);
++
++          /* Initial estimate.  */
++          __asm__ ("frsqrte %[x], %[b]\n" : [x] "=f" (x) : [b] "f" (b));
++
++          /* Iterate.  x_{n+1} = x_n * (1.5 - y * (x_n * x_n)).  */
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++          x = x * FNMSUB (y, x * x, threehalf);
++
++          /* All done.  */
++          fesetenv_register (fe);
++          return x * b;
++        }
++    }
++  else if (b < 0)
++    {
++      /* For some reason, some PowerPC32 processors don't implement
++         FE_INVALID_SQRT.  */
++#ifdef FE_INVALID_SQRT
++      feraiseexcept (FE_INVALID_SQRT);
++
++      fenv_union_t u = { .fenv = fegetenv_register () };
++      if ((u.l & FE_INVALID) == 0)
++#endif
++	feraiseexcept (FE_INVALID);
++      b = a_nan.value;
++    }
++  return f_washf (b);
++}
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
+new file mode 100644
+index 0000000..b103b4d
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/603e/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/603e/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
+new file mode 100644
+index 0000000..64db17f
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e300c3/fpu/Implies
+@@ -0,0 +1,2 @@
++# e300c3 is a variant of 603e so use the same optimizations for sqrt
++powerpc/powerpc32/603e/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
+new file mode 100644
+index 0000000..7eac5fc
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e500mc/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/e500mc/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
+new file mode 100644
+index 0000000..264b2a7
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e5500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/e5500/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
+new file mode 100644
+index 0000000..a259344
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/e6500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc32/e6500/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
+new file mode 100644
+index 0000000..a7bc854
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e5500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc64/e5500/fpu
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
+new file mode 100644
+index 0000000..04ff8cc
+--- /dev/null
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/e6500/fpu/Implies
+@@ -0,0 +1 @@
++powerpc/powerpc64/e6500/fpu
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch b/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
new file mode 100644
index 0000000..65c227f
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch
@@ -0,0 +1,33 @@
+From 5ec1bc5172851278231ce940b68b35ce9cbf8500 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:11:22 +0000
+Subject: [PATCH 06/27] readlib: Add OECORE_KNOWN_INTERPRETER_NAMES to known
+ names
+
+This bolts in a hook for OE to pass its own version of interpreter
+names into glibc especially for multilib case, where it differs from any
+other distros
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ elf/readlib.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/elf/readlib.c b/elf/readlib.c
+index 7fd5b8a..2f5da9f 100644
+--- a/elf/readlib.c
++++ b/elf/readlib.c
+@@ -51,6 +51,7 @@ static struct known_names interpreters[] =
+ #ifdef SYSDEP_KNOWN_INTERPRETER_NAMES
+   SYSDEP_KNOWN_INTERPRETER_NAMES
+ #endif
++  OECORE_KNOWN_INTERPRETER_NAMES
+ };
+ 
+ static struct known_names known_libs[] =
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch b/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
new file mode 100644
index 0000000..aec8fbe
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch
@@ -0,0 +1,208 @@
+From ea98b1a12b5f779fd79478ff930a79ef60387851 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:15:07 +0000
+Subject: [PATCH 07/27] ppc/sqrt: Fix undefined reference to `__sqrt_finite'
+
+on ppc fixes the errors like below
+| ./.libs/libpulsecore-1.1.so: undefined reference to `__sqrt_finite'
+| collect2: ld returned 1 exit status
+
+Upstream-Status: Pending
+
+ChangeLog
+
+2012-01-06  Khem Raj  <raj.khem@gmail.com>
+
+        * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c: Add __*_finite alias.
+        Remove cruft.
+        * sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c: Ditto.
+        * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c: Ditto.
+        * sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c: Ditto.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c    | 7 +------
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c   | 7 +------
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c  | 1 +
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 1 +
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c   | 1 +
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c  | 1 +
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c   | 1 +
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c  | 1 +
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c   | 7 +------
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c  | 7 +------
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c   | 1 +
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c  | 1 +
+ 12 files changed, 12 insertions(+), 24 deletions(-)
+
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+index 71e516d..1795fd6 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+@@ -39,14 +39,8 @@ static const float half = 0.5;
+    We find the actual square root and half of its reciprocal
+    simultaneously.  */
+ 
+-#ifdef __STDC__
+ double
+ __ieee754_sqrt (double b)
+-#else
+-double
+-__ieee754_sqrt (b)
+-     double b;
+-#endif
+ {
+   if (__builtin_expect (b > 0, 1))
+     {
+@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
+     }
+   return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+index 26fa067..a917f31 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
+    We find the reciprocal square root and use that to compute the actual
+    square root.  */
+ 
+-#ifdef __STDC__
+ float
+ __ieee754_sqrtf (float b)
+-#else
+-float
+-__ieee754_sqrtf (b)
+-     float b;
+-#endif
+ {
+   if (__builtin_expect (b > 0, 1))
+     {
+@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
+     }
+   return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+index 71e516d..fc4a749 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+     }
+   return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+index 26fa067..9d17512 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+     }
+   return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+index 71e516d..fc4a749 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+     }
+   return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+index 26fa067..9d17512 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+     }
+   return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+index 71e516d..fc4a749 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+     }
+   return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+index 26fa067..9d17512 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+     }
+   return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+index 71e516d..1795fd6 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+@@ -39,14 +39,8 @@ static const float half = 0.5;
+    We find the actual square root and half of its reciprocal
+    simultaneously.  */
+ 
+-#ifdef __STDC__
+ double
+ __ieee754_sqrt (double b)
+-#else
+-double
+-__ieee754_sqrt (b)
+-     double b;
+-#endif
+ {
+   if (__builtin_expect (b > 0, 1))
+     {
+@@ -132,3 +126,4 @@ __ieee754_sqrt (b)
+     }
+   return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+index 26fa067..a917f31 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+@@ -37,14 +37,8 @@ static const float threehalf = 1.5;
+    We find the reciprocal square root and use that to compute the actual
+    square root.  */
+ 
+-#ifdef __STDC__
+ float
+ __ieee754_sqrtf (float b)
+-#else
+-float
+-__ieee754_sqrtf (b)
+-     float b;
+-#endif
+ {
+   if (__builtin_expect (b > 0, 1))
+     {
+@@ -99,3 +93,4 @@ __ieee754_sqrtf (b)
+     }
+   return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+index 71e516d..fc4a749 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+@@ -132,3 +132,4 @@ __ieee754_sqrt (b)
+     }
+   return f_wash (b);
+ }
++strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+index 26fa067..9d17512 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+@@ -99,3 +99,4 @@ __ieee754_sqrtf (b)
+     }
+   return f_washf (b);
+ }
++strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
new file mode 100644
index 0000000..b3fa931
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
@@ -0,0 +1,387 @@
+From 2456ea44aeeedae87edb522f77a7969d636399b0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:16:38 +0000
+Subject: [PATCH 08/27] __ieee754_sqrt{,f} are now inline functions and call
+ out __slow versions
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c    | 12 ++++++++++--
+ sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c   |  8 +++++++-
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c  | 14 +++++++++++---
+ sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c | 12 ++++++++++--
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c   | 14 +++++++++++---
+ sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c  | 12 ++++++++++--
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c   |  8 ++++++++
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c  |  8 ++++++++
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c   | 12 ++++++++++--
+ sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c  |  9 ++++++++-
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c   | 14 +++++++++++---
+ sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c  | 12 ++++++++++--
+ 12 files changed, 114 insertions(+), 21 deletions(-)
+
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+index 1795fd6..daa83f3 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrt.c
+@@ -40,7 +40,7 @@ static const float half = 0.5;
+    simultaneously.  */
+ 
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ {
+   if (__builtin_expect (b > 0, 1))
+     {
+@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
+ 
+           /* Handle small numbers by scaling.  */
+           if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+-            return __ieee754_sqrt (b * two108) * twom54;
++            return __slow_ieee754_sqrt (b * two108) * twom54;
+ 
+ #define FMADD(a_, c_, b_)                                               \
+           ({ double __r;                                                \
+@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
+     }
+   return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++   return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+index a917f31..b812cf1 100644
+--- a/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/603e/fpu/e_sqrtf.c
+@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
+    square root.  */
+ 
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ {
+   if (__builtin_expect (b > 0, 1))
+     {
+@@ -93,4 +93,10 @@ __ieee754_sqrtf (float b)
+     }
+   return f_washf (b);
+ }
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++  return __slow_ieee754_sqrtf (x);
++}
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+index fc4a749..7038a70 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+ 
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+      double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+ 
+           /* Handle small numbers by scaling.  */
+           if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+-            return __ieee754_sqrt (b * two108) * twom54;
++            return __slow_ieee754_sqrt (b * two108) * twom54;
+ 
+ #define FMADD(a_, c_, b_)                                               \
+           ({ double __r;                                                \
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+     }
+   return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++   return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+index 9d17512..10de1f0 100644
+--- a/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e500mc/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+ 
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+      float b;
+ #endif
+ {
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+     }
+   return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++  return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+index fc4a749..7038a70 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+ 
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+      double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+ 
+           /* Handle small numbers by scaling.  */
+           if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+-            return __ieee754_sqrt (b * two108) * twom54;
++            return __slow_ieee754_sqrt (b * two108) * twom54;
+ 
+ #define FMADD(a_, c_, b_)                                               \
+           ({ double __r;                                                \
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+     }
+   return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++   return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+index 9d17512..10de1f0 100644
+--- a/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e5500/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+ 
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+      float b;
+ #endif
+ {
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+     }
+   return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++  return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+index fc4a749..1c34244 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+     }
+   return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++   return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+index 9d17512..8126535 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+     }
+   return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++  return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+index 1795fd6..13a8197 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrt.c
+@@ -40,7 +40,7 @@ static const float half = 0.5;
+    simultaneously.  */
+ 
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ {
+   if (__builtin_expect (b > 0, 1))
+     {
+@@ -77,7 +77,7 @@ __ieee754_sqrt (double b)
+ 
+           /* Handle small numbers by scaling.  */
+           if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+-            return __ieee754_sqrt (b * two108) * twom54;
++            return __slow_ieee754_sqrt (b * two108) * twom54;
+ 
+ #define FMADD(a_, c_, b_)                                               \
+           ({ double __r;                                                \
+@@ -126,4 +126,12 @@ __ieee754_sqrt (double b)
+     }
+   return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++  return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+index a917f31..fae2d81 100644
+--- a/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e5500/fpu/e_sqrtf.c
+@@ -38,7 +38,7 @@ static const float threehalf = 1.5;
+    square root.  */
+ 
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ {
+   if (__builtin_expect (b > 0, 1))
+     {
+@@ -93,4 +93,11 @@ __ieee754_sqrtf (float b)
+     }
+   return f_washf (b);
+ }
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++  return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+index fc4a749..7038a70 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+ 
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+      double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+ 
+           /* Handle small numbers by scaling.  */
+           if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+-            return __ieee754_sqrt (b * two108) * twom54;
++            return __slow_ieee754_sqrt (b * two108) * twom54;
+ 
+ #define FMADD(a_, c_, b_)                                               \
+           ({ double __r;                                                \
+@@ -132,4 +132,12 @@ __ieee754_sqrt (b)
+     }
+   return f_wash (b);
+ }
++
++#undef __ieee754_sqrt
++double
++__ieee754_sqrt (double x)
++{
++   return __slow_ieee754_sqrt (x);
++}
++
+ strong_alias (__ieee754_sqrt, __sqrt_finite)
+diff --git a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+index 9d17512..10de1f0 100644
+--- a/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc64/e6500/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+ 
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+      float b;
+ #endif
+ {
+@@ -99,4 +99,12 @@ __ieee754_sqrtf (b)
+     }
+   return f_washf (b);
+ }
++
++#undef __ieee754_sqrtf
++float
++__ieee754_sqrtf (float x)
++{
++  return __slow_ieee754_sqrtf (x);
++}
++
+ strong_alias (__ieee754_sqrtf, __sqrtf_finite)
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch b/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
new file mode 100644
index 0000000..1f54759
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch
@@ -0,0 +1,62 @@
+From acf7a028817e71eb99d785037659abd4d120ffe2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:20:09 +0000
+Subject: [PATCH 09/27] Quote from bug 1443 which explains what the patch does
+ :
+
+  We build some random program and link it with -lust.  When we run it,
+  it dies with a SIGSEGV before reaching main().
+
+  Libust.so depends on liburcu-bp.so from the usermode-rcu package.
+  Although libust.so is not prelinked, liburcu-bp.so IS prelinked; this
+  is critical.
+
+  Libust.so uses a TLS / __thread variable that is defined in liburcu-
+  bp.so.  There are special ARM-specific relocation types that allow two
+  shared libraries to share thread-specific data.  This is critical too.
+
+  One more critical issue: although liburcu-bp.so is prelinked, we can't
+  load it at its prelinked address, because we also link against
+  librt.so, and librt.so uses that address.
+
+  The dynamic linker is forced to relink liburcu-bp.so at a different
+  address.  In the course of relinking, it processes the special ARM
+  relocation record mentioned above.  The prelinker has already filled
+  in the information, which is a short offset into a table of thread-
+  specific data that is allocated per-thread for each library that uses
+  TLS.  Because the normal behavior of a relocation is to add the symbol
+  value to an addend stored at the address being relocated, we end up
+  adding the short offset to itself, doubling it.
+
+  Now we have an awkward situation.  The libust.so library doesn't know
+  about the addend, so its TLS data for this element is correct.  The
+  liburcu-bp.so library has a different offset for the element.  When we
+  go to initialize the element for the first time in liburcu-bp.so, we
+  write the address of the result at the doubled (broken) offset.
+  Later, when we refer to the address from libust.so, we check the value
+  at the correct offset, but it's NULL, so we eat hot SIGSEGV.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/arm/dl-machine.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/arm/dl-machine.h b/sysdeps/arm/dl-machine.h
+index 6fb20bd..8805537 100644
+--- a/sysdeps/arm/dl-machine.h
++++ b/sysdeps/arm/dl-machine.h
+@@ -499,7 +499,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
+ 
+ 	case R_ARM_TLS_DTPOFF32:
+ 	  if (sym != NULL)
+-	    *reloc_addr += sym->st_value;
++	    *reloc_addr = sym->st_value;
+ 	  break;
+ 
+ 	case R_ARM_TLS_TPOFF32:
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch b/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
new file mode 100644
index 0000000..d71e576
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch
@@ -0,0 +1,36 @@
+From 017322ee28c1579ce6c81904842aaada9c82403c Mon Sep 17 00:00:00 2001
+From: Ting Liu <b28495@freescale.com>
+Date: Wed, 19 Dec 2012 04:39:57 -0600
+Subject: [PATCH 10/27] eglibc: run libm-err-tab.pl with specific dirs in ${S}
+
+libm-err-tab.pl will parse all the files named "libm-test-ulps"
+in the given dir recursively. To avoid parsing the one in
+${S}/.pc/ (it does exist after eglibc adds aarch64 support,
+${S}/.pc/aarch64-0001-glibc-fsf-v1-eaf6f205.patch/ports/sysdeps/
+aarch64/libm-test-ulps), run libm-err-tab.pl with specific dirs
+in ${S}.
+
+Upstream-Status: inappropriate [OE specific]
+
+Signed-off-by: Ting Liu <b28495@freescale.com>
+---
+ manual/Makefile | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/manual/Makefile b/manual/Makefile
+index 5382208..6b701b0 100644
+--- a/manual/Makefile
++++ b/manual/Makefile
+@@ -105,7 +105,8 @@ $(objpfx)libm-err.texi: $(objpfx)stamp-libm-err
+ $(objpfx)stamp-libm-err: libm-err-tab.pl $(wildcard $(foreach dir,$(sysdirs),\
+ 						     $(dir)/libm-test-ulps))
+ 	pwd=`pwd`; \
+-	$(PERL) $< $$pwd/.. > $(objpfx)libm-err-tmp
++	$(PERL) $< $$pwd/../ports > $(objpfx)libm-err-tmp
++	$(PERL) $< $$pwd/../sysdeps >> $(objpfx)libm-err-tmp
+ 	$(move-if-change) $(objpfx)libm-err-tmp $(objpfx)libm-err.texi
+ 	touch $@
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch b/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
new file mode 100644
index 0000000..07a112b
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch
@@ -0,0 +1,61 @@
+From 1be45f870ebbb0259bea5250a6d2c2fbcb33409d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:24:46 +0000
+Subject: [PATCH 11/27] __ieee754_sqrt{,f} are now inline functions and call
+ out __slow versions
+
+Upstream-Status: Pending
+
+Signed-off-by: chunrong guo <B40290@freescale.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c  | 6 +++---
+ sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c | 4 ++--
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+index 1c34244..7038a70 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrt.c
+@@ -41,10 +41,10 @@ static const float half = 0.5;
+ 
+ #ifdef __STDC__
+ double
+-__ieee754_sqrt (double b)
++__slow_ieee754_sqrt (double b)
+ #else
+ double
+-__ieee754_sqrt (b)
++__slow_ieee754_sqrt (b)
+      double b;
+ #endif
+ {
+@@ -83,7 +83,7 @@ __ieee754_sqrt (b)
+ 
+           /* Handle small numbers by scaling.  */
+           if (__builtin_expect ((u.parts.msw & 0x7ff00000) <= 0x02000000, 0))
+-            return __ieee754_sqrt (b * two108) * twom54;
++            return __slow_ieee754_sqrt (b * two108) * twom54;
+ 
+ #define FMADD(a_, c_, b_)                                               \
+           ({ double __r;                                                \
+diff --git a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+index 8126535..10de1f0 100644
+--- a/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
++++ b/sysdeps/powerpc/powerpc32/e6500/fpu/e_sqrtf.c
+@@ -39,10 +39,10 @@ static const float threehalf = 1.5;
+ 
+ #ifdef __STDC__
+ float
+-__ieee754_sqrtf (float b)
++__slow_ieee754_sqrtf (float b)
+ #else
+ float
+-__ieee754_sqrtf (b)
++__slow_ieee754_sqrtf (b)
+      float b;
+ #endif
+ {
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch b/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch
new file mode 100644
index 0000000..2677913
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0012-Make-ld-version-output-matching-grok-gold-s-output.patch
@@ -0,0 +1,44 @@
+From 49471ab1f90e392da9520eea831ce8731be9fc8b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:25:45 +0000
+Subject: [PATCH 12/27] Make ld --version output matching grok gold's output
+
+adapted from from upstream branch roland/gold-vs-libc
+
+Upstream-Status: Backport
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure    | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 45cc7cb..7d7299a 100755
+--- a/configure
++++ b/configure
+@@ -4709,7 +4709,7 @@ else
+   # Found it, now check the version.
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $LD" >&5
+ $as_echo_n "checking version of $LD... " >&6; }
+-  ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
++  ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU [Bbinutilsd][^.]* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
+   case $ac_prog_version in
+     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+     2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
+diff --git a/configure.ac b/configure.ac
+index 7e9383a..a467a69 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -941,7 +941,7 @@ AC_CHECK_PROG_VER(AS, $AS, --version,
+ 		  [2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
+ 		  AS=: critic_missing="$critic_missing as")
+ AC_CHECK_PROG_VER(LD, $LD, --version,
+-		  [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
++		  [GNU [Bbinutilsd][^.]* \([0-9][0-9]*\.[0-9.]*\)],
+ 		  [2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
+ 		  LD=: critic_missing="$critic_missing ld")
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch b/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
new file mode 100644
index 0000000..c1fda9d
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch
@@ -0,0 +1,42 @@
+From b55e49b199c46a278ab66b6b1e3eab483b913197 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:27:10 +0000
+Subject: [PATCH 13/27] sysdeps/gnu/configure.ac: handle correctly
+ $libc_cv_rootsbindir
+
+Upstream-Status:Pending
+
+Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/gnu/configure    | 2 +-
+ sysdeps/gnu/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/gnu/configure b/sysdeps/gnu/configure
+index 9239297..c5ed3ca 100644
+--- a/sysdeps/gnu/configure
++++ b/sysdeps/gnu/configure
+@@ -32,6 +32,6 @@ case "$prefix" in
+   else
+     libc_cv_localstatedir=$localstatedir
+    fi
+-  libc_cv_rootsbindir=/sbin
++  test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin
+   ;;
+ esac
+diff --git a/sysdeps/gnu/configure.ac b/sysdeps/gnu/configure.ac
+index 634fe4d..3db1697 100644
+--- a/sysdeps/gnu/configure.ac
++++ b/sysdeps/gnu/configure.ac
+@@ -21,6 +21,6 @@ case "$prefix" in
+   else
+     libc_cv_localstatedir=$localstatedir
+    fi
+-  libc_cv_rootsbindir=/sbin
++  test -n "$libc_cv_rootsbindir" || libc_cv_rootsbindir=/sbin
+   ;;
+ esac
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch b/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch
new file mode 100644
index 0000000..0ba5d2f
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0014-Add-unused-attribute.patch
@@ -0,0 +1,34 @@
+From 0229d6c9c0e7721773118d5ae1d172c269bc9826 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:28:41 +0000
+Subject: [PATCH 14/27] Add unused attribute
+
+Helps in avoiding gcc warning when header is is included in
+a source file which does not use both functions
+
+        * iconv/gconv_charset.h (strip):
+        Add unused attribute.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ iconv/gconv_charset.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/iconv/gconv_charset.h b/iconv/gconv_charset.h
+index 80290bc..7890a8e 100644
+--- a/iconv/gconv_charset.h
++++ b/iconv/gconv_charset.h
+@@ -21,7 +21,7 @@
+ #include <locale.h>
+ 
+ 
+-static void
++static void __attribute__ ((unused))
+ strip (char *wp, const char *s)
+ {
+   int slash_count = 0;
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0015-When-disabling-SSE-also-make-sure-that-fpmath-is-not.patch b/meta/recipes-core/glibc/glibc/0015-When-disabling-SSE-also-make-sure-that-fpmath-is-not.patch
new file mode 100644
index 0000000..4b261ca
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0015-When-disabling-SSE-also-make-sure-that-fpmath-is-not.patch
@@ -0,0 +1,32 @@
+From f058c884dd26d10c94550ca5252ed6576614d659 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 19 Feb 2015 03:23:45 +0000
+Subject: [PATCH 15/27] When disabling SSE also make sure that fpmath is not
+ set to use SSE as well
+
+This fixes errors when we inject sse options through CFLAGS and now
+that we have -Werror turned on by default this warning turns to become
+error on x86
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ sysdeps/x86/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
+index 19f5eca..827ea71 100644
+--- a/sysdeps/x86/Makefile
++++ b/sysdeps/x86/Makefile
+@@ -1,6 +1,6 @@
+ ifeq ($(subdir),elf)
+ CFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
+-		   -mno-sse -mno-mmx)
++		   -mno-sse -mno-mmx -mfpmath=387)
+ 
+ tests-special += $(objpfx)tst-ld-sse-use.out
+ $(objpfx)tst-ld-sse-use.out: ../sysdeps/x86/tst-ld-sse-use.sh $(objpfx)ld.so
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0016-yes-within-the-path-sets-wrong-config-variables.patch b/meta/recipes-core/glibc/glibc/0016-yes-within-the-path-sets-wrong-config-variables.patch
new file mode 100644
index 0000000..089e8b1
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0016-yes-within-the-path-sets-wrong-config-variables.patch
@@ -0,0 +1,263 @@
+From 70199fe59c38b621ab4121d7a55719b2b29b36de Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:31:06 +0000
+Subject: [PATCH 16/27] 'yes' within the path sets wrong config variables
+
+It seems that the 'AC_EGREP_CPP(yes...' example is quite popular
+but being such a short word to grep it is likely to produce
+false-positive matches with the path it is configured into.
+
+The change is to use a more elaborated string to grep for.
+
+Upstream-Status: Submitted [libc-alpha@sourceware.org]
+
+Signed-off-by: Benjamin Esquivel <benjamin.esquivel@linux.intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/aarch64/configure                              | 4 ++--
+ sysdeps/aarch64/configure.ac                           | 4 ++--
+ sysdeps/arm/configure                                  | 4 ++--
+ sysdeps/arm/configure.ac                               | 4 ++--
+ sysdeps/mips/configure                                 | 4 ++--
+ sysdeps/mips/configure.ac                              | 4 ++--
+ sysdeps/nios2/configure                                | 4 ++--
+ sysdeps/nios2/configure.ac                             | 4 ++--
+ sysdeps/unix/sysv/linux/mips/configure                 | 4 ++--
+ sysdeps/unix/sysv/linux/mips/configure.ac              | 4 ++--
+ sysdeps/unix/sysv/linux/powerpc/powerpc64/configure    | 8 ++++----
+ sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac | 8 ++++----
+ 12 files changed, 28 insertions(+), 28 deletions(-)
+
+diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
+index 5bd355a..3bc5537 100644
+--- a/sysdeps/aarch64/configure
++++ b/sysdeps/aarch64/configure
+@@ -148,12 +148,12 @@ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #ifdef __AARCH64EB__
+-                      yes
++                      is_aarch64_be
+                      #endif
+ 
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "yes" >/dev/null 2>&1; then :
++  $EGREP "is_aarch64_be" >/dev/null 2>&1; then :
+   libc_cv_aarch64_be=yes
+ else
+   libc_cv_aarch64_be=no
+diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
+index 7851dd4..6e92381 100644
+--- a/sysdeps/aarch64/configure.ac
++++ b/sysdeps/aarch64/configure.ac
+@@ -10,8 +10,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+ # the dynamic linker via %ifdef.
+ AC_CACHE_CHECK([for big endian],
+   [libc_cv_aarch64_be],
+-  [AC_EGREP_CPP(yes,[#ifdef __AARCH64EB__
+-                      yes
++  [AC_EGREP_CPP(is_aarch64_be,[#ifdef __AARCH64EB__
++                      is_aarch64_be
+                      #endif
+   ], libc_cv_aarch64_be=yes, libc_cv_aarch64_be=no)])
+ if test $libc_cv_aarch64_be = yes; then
+diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure
+index 158116b..5eaf54e 100644
+--- a/sysdeps/arm/configure
++++ b/sysdeps/arm/configure
+@@ -151,12 +151,12 @@ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #ifdef __ARM_PCS_VFP
+-		      yes
++		      use_arm_pcs_vfp
+ 		     #endif
+ 
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "yes" >/dev/null 2>&1; then :
++  $EGREP "use_arm_pcs_vfp" >/dev/null 2>&1; then :
+   libc_cv_arm_pcs_vfp=yes
+ else
+   libc_cv_arm_pcs_vfp=no
+diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac
+index 859c92a..2f4a6e2 100644
+--- a/sysdeps/arm/configure.ac
++++ b/sysdeps/arm/configure.ac
+@@ -15,8 +15,8 @@ AC_DEFINE(PI_STATIC_AND_HIDDEN)
+ # the dynamic linker via %ifdef.
+ AC_CACHE_CHECK([whether the compiler is using the ARM hard-float ABI],
+   [libc_cv_arm_pcs_vfp],
+-  [AC_EGREP_CPP(yes,[#ifdef __ARM_PCS_VFP
+-		      yes
++  [AC_EGREP_CPP(use_arm_pcs_vfp,[#ifdef __ARM_PCS_VFP
++		      use_arm_pcs_vfp
+ 		     #endif
+   ], libc_cv_arm_pcs_vfp=yes, libc_cv_arm_pcs_vfp=no)])
+ if test $libc_cv_arm_pcs_vfp = yes; then
+diff --git a/sysdeps/mips/configure b/sysdeps/mips/configure
+index 4e13248..f14af95 100644
+--- a/sysdeps/mips/configure
++++ b/sysdeps/mips/configure
+@@ -143,11 +143,11 @@ else
+ /* end confdefs.h.  */
+ dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "yes" >/dev/null 2>&1; then :
++  $EGREP "use_mips_nan2008" >/dev/null 2>&1; then :
+   libc_cv_mips_nan2008=yes
+ else
+   libc_cv_mips_nan2008=no
+diff --git a/sysdeps/mips/configure.ac b/sysdeps/mips/configure.ac
+index bcbdaff..ad3057f 100644
+--- a/sysdeps/mips/configure.ac
++++ b/sysdeps/mips/configure.ac
+@@ -6,9 +6,9 @@ dnl position independent way.
+ dnl AC_DEFINE(PI_STATIC_AND_HIDDEN)
+ 
+ AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
+-  libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
++  libc_cv_mips_nan2008, [AC_EGREP_CPP(use_mips_nan2008, [dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)])
+ if test x$libc_cv_mips_nan2008 = xyes; then
+   AC_DEFINE(HAVE_MIPS_NAN2008)
+diff --git a/sysdeps/nios2/configure b/sysdeps/nios2/configure
+index 14c8a3a..dde3814 100644
+--- a/sysdeps/nios2/configure
++++ b/sysdeps/nios2/configure
+@@ -142,12 +142,12 @@ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #ifdef __nios2_big_endian__
+-                      yes
++                      is_nios2_be
+                      #endif
+ 
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "yes" >/dev/null 2>&1; then :
++  $EGREP "is_nios2_be" >/dev/null 2>&1; then :
+   libc_cv_nios2_be=yes
+ else
+   libc_cv_nios2_be=no
+diff --git a/sysdeps/nios2/configure.ac b/sysdeps/nios2/configure.ac
+index f05f438..dc86399 100644
+--- a/sysdeps/nios2/configure.ac
++++ b/sysdeps/nios2/configure.ac
+@@ -4,8 +4,8 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+ # Nios II big endian is not yet supported.
+ AC_CACHE_CHECK([for big endian],
+   [libc_cv_nios2_be],
+-  [AC_EGREP_CPP(yes,[#ifdef __nios2_big_endian__
+-                      yes
++  [AC_EGREP_CPP(is_nios2_be,[#ifdef __nios2_big_endian__
++                      is_nios2_be
+                      #endif
+   ], libc_cv_nios2_be=yes, libc_cv_nios2_be=no)])
+ if test $libc_cv_nios2_be = yes; then
+diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure
+index 83f8b13..2b6cbee 100644
+--- a/sysdeps/unix/sysv/linux/mips/configure
++++ b/sysdeps/unix/sysv/linux/mips/configure
+@@ -387,11 +387,11 @@ else
+ /* end confdefs.h.  */
+ dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "yes" >/dev/null 2>&1; then :
++  $EGREP "use_mips_nan2008" >/dev/null 2>&1; then :
+   libc_cv_mips_nan2008=yes
+ else
+   libc_cv_mips_nan2008=no
+diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac
+index 5039ec9..1035f76 100644
+--- a/sysdeps/unix/sysv/linux/mips/configure.ac
++++ b/sysdeps/unix/sysv/linux/mips/configure.ac
+@@ -98,9 +98,9 @@ AC_COMPILE_IFELSE(
+ LIBC_CONFIG_VAR([mips-mode-switch],[${libc_mips_mode_switch}])
+ 
+ AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding],
+-  libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl
++  libc_cv_mips_nan2008, [AC_EGREP_CPP(use_mips_nan2008, [dnl
+ #ifdef __mips_nan2008
+-yes
++use_mips_nan2008
+ #endif], libc_cv_mips_nan2008=yes, libc_cv_mips_nan2008=no)])
+ 
+ libc_mips_nan=
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
+index 70bb18a..ffd9e3e 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
+@@ -155,12 +155,12 @@ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #if _CALL_ELF == 2
+-                      yes
++                      use_ppc_elfv2_abi
+                      #endif
+ 
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "yes" >/dev/null 2>&1; then :
++  $EGREP "use_ppc_elfv2_abi" >/dev/null 2>&1; then :
+   libc_cv_ppc64_elfv2_abi=yes
+ else
+   libc_cv_ppc64_elfv2_abi=no
+@@ -188,12 +188,12 @@ else
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #ifdef _CALL_ELF
+-                         yes
++                         is_def_call_elf
+                        #endif
+ 
+ _ACEOF
+ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+-  $EGREP "yes" >/dev/null 2>&1; then :
++  $EGREP "is_def_call_elf" >/dev/null 2>&1; then :
+   libc_cv_ppc64_def_call_elf=yes
+ else
+   libc_cv_ppc64_def_call_elf=no
+diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
+index 0822915..9a32fdd 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
++++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
+@@ -6,8 +6,8 @@ LIBC_SLIBDIR_RTLDDIR([lib64], [lib64])
+ # Define default-abi according to compiler flags.
+ AC_CACHE_CHECK([whether the compiler is using the PowerPC64 ELFv2 ABI],
+   [libc_cv_ppc64_elfv2_abi],
+-  [AC_EGREP_CPP(yes,[#if _CALL_ELF == 2
+-                      yes
++  [AC_EGREP_CPP(use_ppc_elfv2_abi,[#if _CALL_ELF == 2
++                      use_ppc_elfv2_abi
+                      #endif
+   ], libc_cv_ppc64_elfv2_abi=yes, libc_cv_ppc64_elfv2_abi=no)])
+ if test $libc_cv_ppc64_elfv2_abi = yes; then
+@@ -19,8 +19,8 @@ else
+   # Compiler that do not support ELFv2 ABI does not define _CALL_ELF
+   AC_CACHE_CHECK([whether the compiler defines _CALL_ELF],
+     [libc_cv_ppc64_def_call_elf],
+-    [AC_EGREP_CPP(yes,[#ifdef _CALL_ELF
+-                         yes
++    [AC_EGREP_CPP(is_def_call_elf,[#ifdef _CALL_ELF
++                         is_def_call_elf
+                        #endif
+     ], libc_cv_ppc64_def_call_elf=yes, libc_cv_ppc64_def_call_elf=no)])
+   if test $libc_cv_ppc64_def_call_elf = no; then
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0017-timezone-re-written-tzselect-as-posix-sh.patch b/meta/recipes-core/glibc/glibc/0017-timezone-re-written-tzselect-as-posix-sh.patch
new file mode 100644
index 0000000..0ce8230
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0017-timezone-re-written-tzselect-as-posix-sh.patch
@@ -0,0 +1,45 @@
+From c90306107fbbe2979012917e87747ce78c82ab88 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:33:03 +0000
+Subject: [PATCH 17/27] timezone: re-written tzselect as posix sh
+
+To avoid the bash dependency.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ timezone/Makefile     | 2 +-
+ timezone/tzselect.ksh | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/timezone/Makefile b/timezone/Makefile
+index 24c93c6..886b06e 100644
+--- a/timezone/Makefile
++++ b/timezone/Makefile
+@@ -126,7 +126,7 @@ $(testdata)/XT%: testdata/XT%
+ 	cp $< $@
+ 
+ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
+-	sed -e 's|/bin/bash|$(BASH)|' \
++	sed -e 's|/bin/bash|/bin/sh|' \
+ 	    -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
+ 	    -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
+ 	    -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
+diff --git a/timezone/tzselect.ksh b/timezone/tzselect.ksh
+index 9d70691..25f45a8 100755
+--- a/timezone/tzselect.ksh
++++ b/timezone/tzselect.ksh
+@@ -35,7 +35,7 @@ REPORT_BUGS_TO=tz@iana.org
+ 
+ # Specify default values for environment variables if they are unset.
+ : ${AWK=awk}
+-: ${TZDIR=`pwd`}
++: ${TZDIR=$(pwd)}
+ 
+ # Check for awk Posix compliance.
+ ($AWK -v x=y 'BEGIN { exit 123 }') </dev/null >/dev/null 2>&1
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch b/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
new file mode 100644
index 0000000..8eacbc0
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0018-eglibc-Cross-building-and-testing-instructions.patch
@@ -0,0 +1,619 @@
+From eff048074ac7b5258bb615e5a5b221daa19b18ae Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:42:58 +0000
+Subject: [PATCH 18/27] eglibc: Cross building and testing instructions
+
+Ported from eglibc
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ GLIBC.cross-building | 383 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ GLIBC.cross-testing  | 205 +++++++++++++++++++++++++++
+ 2 files changed, 588 insertions(+)
+ create mode 100644 GLIBC.cross-building
+ create mode 100644 GLIBC.cross-testing
+
+diff --git a/GLIBC.cross-building b/GLIBC.cross-building
+new file mode 100644
+index 0000000..e6e0da1
+--- /dev/null
++++ b/GLIBC.cross-building
+@@ -0,0 +1,383 @@
++                                                        -*- mode: text -*-
++
++                        Cross-Compiling GLIBC
++                  Jim Blandy <jimb@codesourcery.com>
++
++
++Introduction
++
++Most GNU tools have a simple build procedure: you run their
++'configure' script, and then you run 'make'.  Unfortunately, the
++process of cross-compiling the GNU C library is quite a bit more
++involved:
++
++1) Build a cross-compiler, with certain facilities disabled.
++
++2) Configure the C library using the compiler you built in step 1).
++   Build a few of the C run-time object files, but not the rest of the
++   library.  Install the library's header files and the run-time
++   object files, and create a dummy libc.so.
++
++3) Build a second cross-compiler, using the header files and object
++   files you installed in step 2.
++
++4) Configure, build, and install a fresh C library, using the compiler
++   built in step 3.
++
++5) Build a third cross-compiler, based on the C library built in step 4.
++
++The reason for this complexity is that, although GCC and the GNU C
++library are distributed separately, they are not actually independent
++of each other: GCC requires the C library's headers and some object
++files to compile its own libraries, while the C library depends on
++GCC's libraries.  GLIBC includes features and bug fixes to the stock
++GNU C library that simplify this process, but the fundamental
++interdependency stands.
++
++In this document, we explain how to cross-compile an GLIBC/GCC pair
++from source.  Our intended audience is developers who are already
++familiar with the GNU toolchain and comfortable working with
++cross-development tools.  While we do present a worked example to
++accompany the explanation, for clarity's sake we do not cover many of
++the options available to cross-toolchain users.
++
++
++Preparation
++
++GLIBC requires recent versions of the GNU binutils, GCC, and the
++Linux kernel.  The web page <http://www.eglibc.org/prerequisites>
++documents the current requirements, and lists patches needed for
++certain target architectures.  As of this writing, these build
++instructions have been tested with binutils 2.22.51, GCC 4.6.2,
++and Linux 3.1.
++
++First, let's set some variables, to simplify later commands.  We'll
++build GLIBC and GCC for an ARM target, known to the Linux kernel
++as 'arm', and we'll do the build on an Intel x86_64 Linux box:
++
++    $ build=x86_64-pc-linux-gnu
++    $ host=$build
++    $ target=arm-none-linux-gnueabi
++    $ linux_arch=arm
++
++We're using the aforementioned versions of Binutils, GCC, and Linux:
++
++    $ binutilsv=binutils-2.22.51
++    $ gccv=gcc-4.6.2
++    $ linuxv=linux-3.1
++
++We're carrying out the entire process under '~/cross-build', which
++contains unpacked source trees for binutils, gcc, and linux kernel,
++along with GLIBC svn trunk (which can be checked-out with
++'svn co http://www.eglibc.org/svn/trunk eglibc'):
++
++    $ top=$HOME/cross-build/$target
++    $ src=$HOME/cross-build/src
++    $ ls $src
++    binutils-2.22.51  glibc  gcc-4.6.2  linux-3.1
++
++We're going to place our build directories in a subdirectory 'obj',
++we'll install the cross-development toolchain in 'tools', and we'll
++place our sysroot (containing files to be installed on the target
++system) in 'sysroot':
++
++    $ obj=$top/obj
++    $ tools=$top/tools
++    $ sysroot=$top/sysroot
++
++
++Binutils
++
++Configuring and building binutils for the target is straightforward:
++
++    $ mkdir -p $obj/binutils
++    $ cd $obj/binutils
++    $ $src/$binutilsv/configure \
++    >     --target=$target \
++    >     --prefix=$tools \
++    >     --with-sysroot=$sysroot
++    $ make
++    $ make install
++
++
++The First GCC
++
++For our work, we need a cross-compiler targeting an ARM Linux
++system.  However, that configuration includes the shared library
++'libgcc_s.so', which is compiled against the GLIBC headers (which we
++haven't installed yet) and linked against 'libc.so' (which we haven't
++built yet).
++
++Fortunately, there are configuration options for GCC which tell it not
++to build 'libgcc_s.so'.  The '--without-headers' option is supposed to
++take care of this, but its implementation is incomplete, so you must
++also configure with the '--with-newlib' option.  While '--with-newlib'
++appears to mean "Use the Newlib C library", its effect is to tell the
++GCC build machinery, "Don't assume there is a C library available."
++
++We also need to disable some of the libraries that would normally be
++built along with GCC, and specify that only the compiler for the C
++language is needed.
++
++So, we create a build directory, configure, make, and install.
++
++    $ mkdir -p $obj/gcc1
++    $ cd $obj/gcc1
++    $ $src/$gccv/configure \
++    >     --target=$target \
++    >     --prefix=$tools \
++    >     --without-headers --with-newlib \
++    >     --disable-shared --disable-threads --disable-libssp \
++    >     --disable-libgomp --disable-libmudflap --disable-libquadmath \
++    >     --disable-decimal-float --disable-libffi \
++    >     --enable-languages=c
++    $ PATH=$tools/bin:$PATH make
++    $ PATH=$tools/bin:$PATH make install
++
++
++Linux Kernel Headers
++
++To configure GLIBC, we also need Linux kernel headers in place.
++Fortunately, the Linux makefiles have a target that installs them for
++us.  Since the process does modify the source tree a bit, we make a
++copy first:
++
++    $ cp -r $src/$linuxv $obj/linux
++    $ cd $obj/linux
++
++Now we're ready to install the headers into the sysroot:
++
++    $ PATH=$tools/bin:$PATH \
++    > make headers_install \
++    >      ARCH=$linux_arch CROSS_COMPILE=$target- \
++    >      INSTALL_HDR_PATH=$sysroot/usr
++
++
++GLIBC Headers and Preliminary Objects
++
++Using the cross-compiler we've just built, we can now configure GLIBC
++well enough to install the headers and build the object files that the
++full cross-compiler will need:
++
++    $ mkdir -p $obj/glibc-headers
++    $ cd $obj/glibc-headers
++    $ BUILD_CC=gcc \
++    > CC=$tools/bin/$target-gcc \
++    > CXX=$tools/bin/$target-g++ \
++    > AR=$tools/bin/$target-ar \
++    > RANLIB=$tools/bin/$target-ranlib \
++    > $src/glibc/libc/configure \
++    >     --prefix=/usr \
++    >     --with-headers=$sysroot/usr/include \
++    >     --build=$build \
++    >     --host=$target \
++    >     --disable-profile --without-gd --without-cvs \
++    >     --enable-add-ons=nptl,libidn,../ports
++
++The option '--prefix=/usr' may look strange, but you should never
++configure GLIBC with a prefix other than '/usr': in various places,
++GLIBC's build system checks whether the prefix is '/usr', and does
++special handling only if that is the case.  Unless you use this
++prefix, you will get a sysroot that does not use the standard Linux
++directory layouts and cannot be used as a basis for the root
++filesystem on your target system compatibly with normal GLIBC
++installations.
++
++The '--with-headers' option tells GLIBC where the Linux headers have
++been installed.
++
++The '--enable-add-ons=nptl,libidn,../ports' option tells GLIBC to look
++for the listed glibc add-ons. Most notably the ports add-on (located
++just above the libc sources in the GLIBC svn tree) is required to
++support ARM targets.
++
++We can now use the 'install-headers' makefile target to install the
++headers:
++
++    $ make install-headers install_root=$sysroot \
++    >                      install-bootstrap-headers=yes
++
++The 'install_root' variable indicates where the files should actually
++be installed; its value is treated as the parent of the '--prefix'
++directory we passed to the configure script, so the headers will go in
++'$sysroot/usr/include'.  The 'install-bootstrap-headers' variable
++requests special handling for certain tricky header files.
++
++Next, there are a few object files needed to link shared libraries,
++which we build and install by hand:
++
++    $ mkdir -p $sysroot/usr/lib
++    $ make csu/subdir_lib
++    $ cp csu/crt1.o csu/crti.o csu/crtn.o $sysroot/usr/lib
++
++Finally, 'libgcc_s.so' requires a 'libc.so' to link against.  However,
++since we will never actually execute its code, it doesn't matter what
++it contains.  So, treating '/dev/null' as a C source file, we produce
++a dummy 'libc.so' in one step:
++
++    $ $tools/bin/$target-gcc -nostdlib -nostartfiles -shared -x c /dev/null \
++    >                        -o $sysroot/usr/lib/libc.so
++
++
++The Second GCC
++
++With the GLIBC headers and selected object files installed, we can
++now build a GCC that is capable of compiling GLIBC.  We configure,
++build, and install the second GCC, again building only the C compiler,
++and avoiding libraries we won't use:
++
++    $ mkdir -p $obj/gcc2
++    $ cd $obj/gcc2
++    $ $src/$gccv/configure \
++    >     --target=$target \
++    >     --prefix=$tools \
++    >     --with-sysroot=$sysroot \
++    >     --disable-libssp --disable-libgomp --disable-libmudflap \
++    >     --disable-libffi --disable-libquadmath \
++    >     --enable-languages=c
++    $ PATH=$tools/bin:$PATH make
++    $ PATH=$tools/bin:$PATH make install
++
++
++GLIBC, Complete
++
++With the second compiler built and installed, we're now ready for the
++full GLIBC build:
++
++    $ mkdir -p $obj/glibc
++    $ cd $obj/glibc
++    $ BUILD_CC=gcc \
++    > CC=$tools/bin/$target-gcc \
++    > CXX=$tools/bin/$target-g++ \
++    > AR=$tools/bin/$target-ar \
++    > RANLIB=$tools/bin/$target-ranlib \
++    > $src/glibc/libc/configure \
++    >     --prefix=/usr \
++    >     --with-headers=$sysroot/usr/include \
++    >     --with-kconfig=$obj/linux/scripts/kconfig \
++    >     --build=$build \
++    >     --host=$target \
++    >     --disable-profile --without-gd --without-cvs \
++    >     --enable-add-ons=nptl,libidn,../ports
++
++Note the additional '--with-kconfig' option. This tells GLIBC where to
++find the host config tools used by the kernel 'make config' and 'make
++menuconfig'.  These tools can be re-used by GLIBC for its own 'make
++*config' support, which will create 'option-groups.config' for you.
++But first make sure those tools have been built by running some
++dummy 'make *config' calls in the kernel directory:
++
++    $ cd $obj/linux
++    $ PATH=$tools/bin:$PATH make config \
++    >      ARCH=$linux_arch CROSS_COMPILE=$target- \
++    $ PATH=$tools/bin:$PATH make menuconfig \
++    >      ARCH=$linux_arch CROSS_COMPILE=$target- \
++
++Now we can configure and build the full GLIBC:
++
++    $ cd $obj/glibc
++    $ PATH=$tools/bin:$PATH make defconfig
++    $ PATH=$tools/bin:$PATH make menuconfig
++    $ PATH=$tools/bin:$PATH make
++    $ PATH=$tools/bin:$PATH make install install_root=$sysroot
++
++At this point, we have a complete GLIBC installation in '$sysroot',
++with header files, library files, and most of the C runtime startup
++files in place.
++
++
++The Third GCC
++
++Finally, we recompile GCC against this full installation, enabling
++whatever languages and libraries we would like to use:
++
++    $ mkdir -p $obj/gcc3
++    $ cd $obj/gcc3
++    $ $src/$gccv/configure \
++    >     --target=$target \
++    >     --prefix=$tools \
++    >     --with-sysroot=$sysroot \
++    >     --enable-__cxa_atexit \
++    >     --disable-libssp --disable-libgomp --disable-libmudflap \
++    >     --enable-languages=c,c++
++    $ PATH=$tools/bin:$PATH make
++    $ PATH=$tools/bin:$PATH make install
++
++The '--enable-__cxa_atexit' option tells GCC what sort of C++
++destructor support to expect from the C library; it's required with
++GLIBC.
++
++And since GCC's installation process isn't designed to help construct
++sysroot trees, we must manually copy certain libraries into place in
++the sysroot.
++
++    $ cp -d $tools/$target/lib/libgcc_s.so* $sysroot/lib
++    $ cp -d $tools/$target/lib/libstdc++.so* $sysroot/usr/lib
++
++
++Trying Things Out
++
++At this point, '$tools' contains a cross toolchain ready to use
++the GLIBC installation in '$sysroot':
++
++    $ cat > hello.c <<EOF
++    > #include <stdio.h>
++    > int
++    > main (int argc, char **argv)
++    > {
++    >   puts ("Hello, world!");
++    >   return 0;
++    > }
++    > EOF
++    $ $tools/bin/$target-gcc -Wall hello.c -o hello
++    $ cat > c++-hello.cc <<EOF
++    > #include <iostream>
++    > int
++    > main (int argc, char **argv)
++    > {
++    >   std::cout << "Hello, C++ world!" << std::endl;
++    >   return 0;
++    > }
++    > EOF
++    $ $tools/bin/$target-g++ -Wall c++-hello.cc -o c++-hello
++
++
++We can use 'readelf' to verify that these are indeed executables for
++our target, using our dynamic linker:
++
++    $ $tools/bin/$target-readelf -hl hello
++    ELF Header:
++    ...
++      Type:                              EXEC (Executable file)
++      Machine:                           ARM
++
++    ...
++    Program Headers:
++      Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
++      PHDR           0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4
++      INTERP         0x000134 0x00008134 0x00008134 0x00013 0x00013 R   0x1
++          [Requesting program interpreter: /lib/ld-linux.so.3]
++      LOAD           0x000000 0x00008000 0x00008000 0x0042c 0x0042c R E 0x8000
++    ...
++
++Looking at the dynamic section of the installed 'libgcc_s.so', we see
++that the 'NEEDED' entry for the C library does include the '.6'
++suffix, indicating that was linked against our fully build GLIBC, and
++not our dummy 'libc.so':
++
++    $ $tools/bin/$target-readelf -d $sysroot/lib/libgcc_s.so.1
++    Dynamic section at offset 0x1083c contains 24 entries:
++      Tag        Type                         Name/Value
++     0x00000001 (NEEDED)                     Shared library: [libc.so.6]
++     0x0000000e (SONAME)                     Library soname: [libgcc_s.so.1]
++    ...
++
++
++And on the target machine, we can run our programs:
++
++    $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \
++    > ./hello
++    Hello, world!
++    $ $sysroot/lib/ld.so.1 --library-path $sysroot/lib:$sysroot/usr/lib \
++    > ./c++-hello
++    Hello, C++ world!
+diff --git a/GLIBC.cross-testing b/GLIBC.cross-testing
+new file mode 100644
+index 0000000..b67b468
+--- /dev/null
++++ b/GLIBC.cross-testing
+@@ -0,0 +1,205 @@
++                                                        -*- mode: text -*-
++
++                      Cross-Testing With GLIBC
++                  Jim Blandy <jimb@codesourcery.com>
++
++
++Introduction
++
++Developers writing software for embedded systems often use a desktop
++or other similarly capable computer for development, but need to run
++tests on the embedded system, or perhaps on a simulator.  When
++configured for cross-compilation, the stock GNU C library simply
++disables running tests altogether: the command 'make tests' builds
++test programs, but does not run them.  GLIBC, however, provides
++facilities for compiling tests and generating data files on the build
++system, but running the test programs themselves on a remote system or
++simulator.
++
++
++Test environment requirements
++
++The test environment must meet certain conditions for GLIBC's
++cross-testing facilities to work:
++
++- Shared filesystems.  The 'build' system, on which you configure and
++  compile GLIBC, and the 'host' system, on which you intend to run
++  GLIBC, must share a filesystem containing the GLIBC build and
++  source trees.  Files must appear at the same paths on both systems.
++
++- Remote-shell like invocation.  There must be a way to run a program
++  on the host system from the build system, passing it properly quoted
++  command-line arguments, setting environment variables, and
++  inheriting the caller's standard input and output.
++
++
++Usage
++
++To use GLIBC's cross-testing support, provide values for the
++following Make variables when you invoke 'make':
++
++- cross-test-wrapper
++
++  This should be the name of the cross-testing wrapper command, along
++  with any arguments.
++
++- cross-localedef
++
++  This should be the name of a cross-capable localedef program, like
++  that included in the GLIBC 'localedef' module, along with any
++  arguments needed.
++
++These are each explained in detail below.
++
++
++The Cross-Testing Wrapper
++
++To run test programs reliably, the stock GNU C library takes care to
++ensure that test programs use the newly compiled dynamic linker and
++shared libraries, and never the host system's installed libraries.  To
++accomplish this, it runs the tests by explicitly invoking the dynamic
++linker from the build tree, passing it a list of build tree
++directories to search for shared libraries, followed by the name of
++the executable to run and its arguments.
++
++For example, where one might normally run a test program like this:
++
++    $ ./tst-foo arg1 arg2
++
++the GNU C library might run that program like this:
++
++    $ $objdir/elf/ld-linux.so.3 --library-path $objdir \
++      ./tst-foo arg1 arg2
++
++(where $objdir is the path to the top of the build tree, and the
++trailing backslash indicates a continuation of the command).  In other
++words, each test program invocation is 'wrapped up' inside an explicit
++invocation of the dynamic linker, which must itself execute the test
++program, having loaded shared libraries from the appropriate
++directories.
++
++To support cross-testing, GLIBC allows the developer to optionally
++set the 'cross-test-wrapper' Make variable to another wrapper command,
++to which it passes the entire dynamic linker invocation shown above as
++arguments.  For example, if the developer supplies a wrapper of
++'my-wrapper hostname', then GLIBC would run the test above as
++follows:
++
++    $ my-wrapper hostname \
++      $objdir/elf/ld-linux.so.3 --library-path $objdir \
++      ./tst-foo arg1 arg2
++
++The 'my-wrapper' command is responsible for executing the command
++given on the host system.
++
++Since tests are run in varying directories, the wrapper should either
++be in your command search path, or 'cross-test-wrapper' should give an
++absolute path for the wrapper.
++
++The wrapper must meet several requirements:
++
++- It must preserve the current directory.  As explained above, the
++  build directory tree must be visible on both the build and host
++  systems, at the same path.  The test wrapper must ensure that the
++  current directory it inherits is also inherited by the dynamic
++  linker (and thus the test program itself).
++
++- It must preserve environment variables' values.  Many GLIBC tests
++  set environment variables for test runs; in native testing, it
++  invokes programs like this:
++
++    $ GCONV_PATH=$objdir/iconvdata \
++      $objdir/elf/ld-linux.so.3 --library-path $objdir \
++      ./tst-foo arg1 arg2
++
++  With the cross-testing wrapper, that invocation becomes:
++
++    $ GCONV_PATH=$objdir/iconvdata \
++      my-wrapper hostname \
++      $objdir/elf/ld-linux.so.3 --library-path $objdir \
++      ./tst-foo arg1 arg2
++
++  Here, 'my-wrapper' must ensure that the value it sees for
++  'GCONV_PATH' will be seen by the dynamic linker, and thus 'tst-foo'
++  itself.  (The wrapper supplied with GLIBC simply preserves the
++  values of *all* enviroment variables, with a fixed set of
++  exceptions.)
++
++  If your wrapper is a shell script, take care to correctly propagate
++  environment variables whose values contain spaces and shell
++  metacharacters.
++
++- It must pass the command's arguments, unmodified.  The arguments
++  seen by the test program should be exactly those seen by the wrapper
++  (after whatever arguments are given to the wrapper itself).  The
++  GLIBC test framework performs all needed shell word splitting and
++  expansion (wildcard expansion, parameter substitution, and so on)
++  before invoking the wrapper; further expansion may break the tests.
++
++
++The 'cross-test-ssh.sh' script
++
++If you want to use 'ssh' (or something sufficiently similar) to run
++test programs on your host system, GLIBC includes a shell script,
++'scripts/cross-test-ssh.sh', which you can use as your wrapper
++command.  This script takes care of setting the test command's current
++directory, propagating environment variable values, and carrying
++command-line arguments, all across an 'ssh' connection.  You may even
++supply an alternative to 'ssh' on the command line, if needed.
++
++For more details, pass 'cross-test-ssh.sh' the '--help' option.
++
++
++The Cross-Compiling Locale Definition Command
++
++Some GLIBC tests rely on locales generated especially for the test
++process.  In a native configuration, these tests simply run the
++'localedef' command built by the normal GLIBC build process,
++'locale/localedef', to process and install their locales.  However, in
++a cross-compiling configuration, this 'localedef' is built for the
++host system, not the build system, and since it requires quite a bit
++of memory to run (we have seen it fail on systems with 64MiB of
++memory), it may not be practical to run it on the host system.
++
++If set, GLIBC uses the 'cross-localedef' Make variable as the command
++to run on the build system to process and install locales.  The
++localedef program built from the GLIBC 'localedef' module is
++suitable.
++
++The value of 'cross-localedef' may also include command-line arguments
++to be passed to the program; if you are using GLIBC's 'localedef',
++you may include endianness and 'uint32_t' alignment arguments here.
++
++
++Example
++
++In developing GLIBC's cross-testing facility, we invoked 'make' with
++the following script:
++
++    #!/bin/sh
++
++    srcdir=...
++    test_hostname=...
++    localedefdir=...
++    cross_gxx=...-g++
++
++    wrapper="$srcdir/scripts/cross-test-ssh.sh $test_hostname"
++    localedef="$localedefdir/localedef --little-endian --uint32-align=4"
++
++    make cross-test-wrapper="$wrapper" \
++         cross-localedef="$localedef" \
++         CXX="$cross_gxx" \
++         "$@"
++
++
++Other Cross-Testing Concerns
++
++Here are notes on some other issues which you may encounter in running
++the GLIBC tests in a cross-compiling environment:
++
++- Some tests require a C++ cross-compiler; you should set the 'CXX'
++  Make variable to the name of an appropriate cross-compiler.
++
++- Some tests require access to libstdc++.so.6 and libgcc_s.so.1; we
++  simply place copies of these libraries in the top GLIBC build
++  directory.
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0019-eglibc-Bring-Eglibc-option-group-infrastructure-to-g.patch b/meta/recipes-core/glibc/glibc/0019-eglibc-Bring-Eglibc-option-group-infrastructure-to-g.patch
new file mode 100644
index 0000000..dcb80f9
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0019-eglibc-Bring-Eglibc-option-group-infrastructure-to-g.patch
@@ -0,0 +1,1436 @@
+From aa7c5fe86d04584a9aed4dc40ba856c65a1ef9c4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:45:18 +0000
+Subject: [PATCH 19/27] eglibc: Bring Eglibc option group infrastructure to
+ glibc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ EGLIBC.option-groups              | 122 ++++++
+ Makefile                          |   1 +
+ config.make.in                    |   2 +
+ configure                         |  13 +
+ configure.ac                      |  10 +
+ option-groups.def                 | 868 ++++++++++++++++++++++++++++++++++++++
+ option-groups.defaults            |  47 +++
+ option-groups.mak                 |  41 ++
+ options-config/Makefile           |  55 +++
+ options-config/config-postproc.pl |  58 +++
+ options-config/config-preproc.pl  |   8 +
+ scripts/option-groups.awk         |  63 +++
+ 12 files changed, 1288 insertions(+)
+ create mode 100644 EGLIBC.option-groups
+ create mode 100644 option-groups.def
+ create mode 100644 option-groups.defaults
+ create mode 100644 option-groups.mak
+ create mode 100644 options-config/Makefile
+ create mode 100644 options-config/config-postproc.pl
+ create mode 100644 options-config/config-preproc.pl
+ create mode 100644 scripts/option-groups.awk
+
+diff --git a/EGLIBC.option-groups b/EGLIBC.option-groups
+new file mode 100644
+index 0000000..6a50b8d
+--- /dev/null
++++ b/EGLIBC.option-groups
+@@ -0,0 +1,122 @@
++                                                        -*- mode: text -*-
++
++              The EGLIBC Component Configuration System
++                  Jim Blandy <jimb@codesourcery.com>
++
++Introduction
++
++The GNU C library (GLIBC) provides a broad range of functionality,
++ranging from internationalization support to transcendental
++mathematical functions.  Its website boasts that "nearly all known and
++useful functions from any other C library are available."  This
++exhaustive approach has been one of GLIBC's strengths on desktop and
++server systems, but it has also given GLIBC a large footprint, both in
++memory and on disk, making it a challenge to use in embedded systems
++with limited resources.
++
++The Embedded GNU C library (EGLIBC) is a variant of the GNU C library
++designed to work well on embedded systems.  In particular, EGLIBC's
++component configuration system allows embedded developers to build
++customized versions of the library that include only the features
++their application uses, reducing its space requirements.
++
++EGLIBC's component configuration system categorizes the library's
++functions into "option groups", and allows you to include or exclude
++option groups individually.  Some option groups depend on others;
++EGLIBC tracks these relationships, and ensures that the selected
++configuration yields a functioning library.
++
++
++Consistent and Predictable Behavior
++
++A flexible configuration system is a mixed blessing: if the options
++offered are poorly designed, it can be hard to see which choices will
++have the desired effects, and choices with obscure consequences can
++make debugging difficult.  EGLIBC's configuration follows some general
++principles to reduce these risks:
++
++- EGLIBC has a single default configuration for each target
++  architecture.
++
++- In the default configuration, all option groups are enabled, and
++  EGLIBC is upwardly API- and ABI-compatible with GLIBC.
++
++- As much as possible, configurations only affect what functions are
++  present, not how they behave.  If the system works with an option
++  group disabled, it will still work with it enabled.
++
++- As much as possible, configurations only select option groups ---
++  they do not describe characteristics of the target architecture.
++
++These rules mean that you have a simple debugging strategy available
++if you suspect that your EGLIBC configuration might be the source of a
++problem: fall back to the default configuration, re-test, and then
++disable option groups one by one, until the problem reappears.
++
++
++The Option Groups
++
++To see the current full list of implemented option groups, refer to the
++file 'option-groups.def' at the top of the source tree, or run
++'make menuconfig' from the top-level build directory.
++
++The POSIX.1-2001 specification includes a suggested partition of all
++the functions in the POSIX C API into option groups: math functions
++like 'sin' and 'cos'; networking functions like 'socket' and
++'connect'; and so on.  EGLIBC could use this partitioning as the basis
++for future option groups.
++
++
++Implementation
++
++The EGLIBC component configuration system resembles the approach used
++by the Linux kernel to select device drivers, network protocols, and
++other features.  A file named 'option-groups.config' in the top-level
++build directory contains assignments to Make variables, each of which
++enables or disables a particular option group.  If the variable's
++value is set to 'y', then the option group is enabled; if it set to
++anything else, the option group is omitted.  The file
++'option-groups.defaults', at the top of the source tree, establishes
++default values for all variables; all option groups are enabled by
++default.
++
++For example, the following 'option-groups.config' would omit locale
++data, but include mathematical functions, and everything else:
++
++   OPTION_EGLIBC_LOCALES = n
++   OPTION_EGLIBC_LIBM = y
++
++Like the Linux kernel, EGLIBC supports a similar set of '*config' make
++targets to make it easier to create 'option-groups.config', with all
++dependencies between option groups automatically satisfied.  Run
++'make help' to see the list of supported make config targets.  For
++example, 'make menuconfig' will update the current config utilising a
++menu based program.
++
++The option group names and their type (boolean, int, hex, string), help
++description, and dependencies with other option groups, are described by
++'option-groups.def' at the top of the source tree, analogous to the
++'Kconfig' files in the Linux kernel.
++
++In general, each option group variable controls whether a given set of
++object files in EGLIBC is compiled and included in the final
++libraries, or omitted from the build.
++
++Each subdirectory's Makefile categorizes its routines, libraries, and
++executables by option group.  For example, EGLIBC's 'math/Makefile'
++places the 'libm' library in the OPTION_EGLIBC_LIBM group as follows:
++
++   extra-libs-$(OPTION_EGLIBC_LIBM) := libm
++
++Finally, common code in 'Makerules' cites the value of the variable
++'extra-libs-y', selecting only those libraries that belong to enabled
++option groups to be built.
++
++
++Current Status and Future Directions
++
++The EGLIBC component configuration system described here is still
++under development.
++
++We have used the system to subset some portions of EGLIBC's
++Index: libc/configure.ac
+diff --git a/Makefile b/Makefile
+index 658ccfa..f906391 100644
+--- a/Makefile
++++ b/Makefile
+@@ -24,6 +24,7 @@ endif
+ 
+ include Makeconfig
+ 
++include options-config/Makefile
+ 
+ # This is the default target; it makes everything except the tests.
+ .PHONY: all
+diff --git a/config.make.in b/config.make.in
+index a9f5696..294f8d1 100644
+--- a/config.make.in
++++ b/config.make.in
+@@ -47,6 +47,8 @@ c++-sysincludes = @CXX_SYSINCLUDES@
+ all-warnings = @all_warnings@
+ enable-werror = @enable_werror@
+ 
++kconfig_tools = @KCONFIG_TOOLS@
++
+ have-z-combreloc = @libc_cv_z_combreloc@
+ have-z-execstack = @libc_cv_z_execstack@
+ have-Bgroup = @libc_cv_Bgroup@
+diff --git a/configure b/configure
+index 7d7299a..4116404 100755
+--- a/configure
++++ b/configure
+@@ -641,6 +641,7 @@ INSTALL_INFO
+ PERL
+ BASH_SHELL
+ libc_cv_gcc_static_libgcc
++KCONFIG_TOOLS
+ CXX_SYSINCLUDES
+ SYSINCLUDES
+ AUTOCONF
+@@ -755,6 +756,7 @@ with_fp
+ with_binutils
+ with_selinux
+ with_headers
++with_kconfig
+ with_default_link
+ enable_sanity_checks
+ enable_shared
+@@ -1459,6 +1461,9 @@ Optional Packages:
+   --with-selinux          if building with SELinux support
+   --with-headers=PATH     location of system headers to use (for example
+                           /usr/src/linux/include) [default=compiler default]
++  --with-kconfig=PATH     location of kconfig tools to use (from Linux kernel
++                          builds) to re-use for configuring EGLIBC option
++                          groups
+   --with-default-link     do not use explicit linker scripts
+   --with-cpu=CPU          select code for CPU variant
+ 
+@@ -3517,6 +3522,14 @@ fi
+ 
+ 
+ 
++# Check whether --with-kconfig was given.
++if test "${with_kconfig+set}" = set; then
++  withval=$with_kconfig; KCONFIG_TOOLS=$withval
++else
++  KCONFIG_TOOLS=''
++fi
++
++
+ 
+ # Check whether --with-default-link was given.
+ if test "${with_default_link+set}" = set; then :
+diff --git a/configure.ac b/configure.ac
+index a467a69..fc0ed4d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -136,6 +136,16 @@ AC_ARG_WITH([headers],
+ 	    [sysheaders=''])
+ AC_SUBST(sysheaders)
+ 
++AC_ARG_WITH([kconfig],
++	    AC_HELP_STRING([--with-kconfig=PATH],
++			   [location of kconfig tools to use (from Linux
++			    kernel builds) to re-use for configuring EGLIBC
++			    option groups]),
++	    [KCONFIG_TOOLS=$withval],
++	    [KCONFIG_TOOLS=''])
++AC_SUBST(KCONFIG_TOOLS)
++
++
+ AC_SUBST(use_default_link)
+ AC_ARG_WITH([default-link],
+ 	    AC_HELP_STRING([--with-default-link],
+diff --git a/option-groups.def b/option-groups.def
+new file mode 100644
+index 0000000..6aebd94
+--- /dev/null
++++ b/option-groups.def
+@@ -0,0 +1,868 @@
++# This file documents the option groups EGLIBC currently supports, in
++# a format akin to the Linux Kconfig system's.  The syntax may change
++# over time.
++#
++# An entry of the form:
++#
++#   config GROUP_NAME
++#       bool "one-line explanation of what this option group controls"
++#       help
++#           Multi-line help explaining the option group's meaning in
++#           some detail, terminated by indentation level.
++#
++# defines an option group whose variable is GROUP_NAME, with
++# meaningful values 'y' (enabled) and 'n' (disabled).  The
++# documentation is formatted to be consumed by some sort of
++# interactive configuration interface, but EGLIBC doesn't have such an
++# interface yet.
++#
++# An option may have a 'depends on' line, indicating which other options
++# must also be enabled if this option is.  At present, EGLIBC doesn't
++# check that these dependencies are satisfied.
++#
++# Option group variables get their default values from the file
++# 'option-groups.defaults', in the top directory of the EGLIBC source
++# tree.  By default, all EGLIBC option groups are enabled --- their
++# variables are set to 'y'.
++#
++# After including 'option-groups.defaults', the EGLIBC make machinery
++# includes the file 'option-groups.config' from the top of the build
++# tree, if it is present.  Developers can place assignments to option
++# group variables in that file to override the defaults.  For example,
++# to disable an option group, place a line of the form:
++#
++#    OPTION_GROUP_NAME = n
++#
++# in 'option-groups.config' at the top of your build tree.  To
++# explicitly enable an option group, you may also write:
++#
++#    OPTION_GROUP_NAME = y
++#
++# although this simply reestablishes the value already set by
++# 'option-groups.defaults'.
++
++config EGLIBC_ADVANCED_INET6
++   bool "IPv6 Advanced Sockets API support (RFC3542)"
++   depends on EGLIBC_INET
++   help
++       This option group includes the functions specified by RFC 3542,
++       "Advanced Sockets Application Program Interface (API) for
++       IPv6".
++
++       This option group includes the following functions:
++
++         inet6_opt_append
++         inet6_opt_find
++         inet6_opt_finish
++         inet6_opt_get_val
++         inet6_opt_init
++         inet6_option_alloc
++         inet6_option_append
++         inet6_option_find
++         inet6_option_init
++         inet6_option_next
++         inet6_option_space
++         inet6_opt_next
++         inet6_opt_set_val
++         inet6_rth_add
++         inet6_rth_getaddr
++         inet6_rth_init
++         inet6_rth_reverse
++         inet6_rth_segments
++         inet6_rth_space
++
++config EGLIBC_BACKTRACE
++   bool "Functions for producing backtraces"
++   help
++       This option group includes functions for producing a list of
++       the function calls that are currently active in a thread, from
++       within the thread itself.  These functions are often used
++       within signal handlers, to produce diagnostic output.
++
++       This option group includes the following functions:
++
++         backtrace
++         backtrace_symbols
++         backtrace_symbols_fd
++
++config EGLIBC_BIG_MACROS
++   bool "Use extensive inline code"
++   help
++       This option group specifies whether certain pieces of code
++       should be inlined to achieve maximum speed.  If this option
++       group is not selected, function calls will be used instead,
++       hence reducing the library footprint.
++
++config EGLIBC_BSD
++   bool "BSD-specific functions, and their compatibility stubs"
++   help
++       This option group includes functions specific to BSD kernels.
++       A number of these functions have stub versions that are also
++       included in libraries built for non-BSD systems for
++       compatibility.
++
++       This option group includes the following functions:
++
++         chflags
++         fchflags
++         lchmod
++         revoke
++         setlogin
++
++config EGLIBC_CXX_TESTS
++   bool "Tests that link against the standard C++ library."
++   depends on POSIX_WIDE_CHAR_DEVICE_IO && EGLIBC_LIBM
++   help
++       This option group does not include any C library functions;
++       instead, it controls which EGLIBC tests an ordinary 'make
++       tests' runs.  With this group disabled, tests that would
++       normally link against the standard C++ library are not
++       run.
++
++       The standard C++ library depends on the math library 'libm' and
++       the wide character I/O functions included in EGLIBC.  So those
++       option groups must be enabled if this test is enabled.
++
++config EGLIBC_CATGETS
++   bool "Functions for accessing message catalogs"
++   depends on EGLIBC_LOCALE_CODE
++   help
++       This option group includes functions for accessing message
++       catalogs: catopen, catclose, and catgets.
++
++       This option group depends on the EGLIBC_LOCALE_CODE
++       option group.
++
++config EGLIBC_CHARSETS
++   bool "iconv/gconv character set conversion libraries"
++   help
++       This option group includes support for character sets other
++       than ASCII (ANSI_X3.4-1968) and Unicode and ISO-10646 in their
++       various encodings.  This affects both the character sets
++       supported by the wide and multibyte character functions, and
++       those supported by the 'iconv' functions.
++
++       With this option group disabled, EGLIBC supports only the
++       following character sets:
++
++          ANSI_X3.4         - ASCII
++          ANSI_X3.4-1968
++          ANSI_X3.4-1986
++          ASCII
++          CP367
++          CSASCII
++          IBM367
++          ISO-IR-6
++          ISO646-US
++          ISO_646.IRV:1991
++          OSF00010020
++          US
++          US-ASCII
++
++          10646-1:1993      - ISO 10646, in big-endian UCS4 form
++          10646-1:1993/UCS4
++          CSUCS4
++          ISO-10646
++          ISO-10646/UCS4
++          OSF00010104
++          OSF00010105
++          OSF00010106
++          UCS-4
++          UCS-4BE
++          UCS4
++
++          UCS-4LE           - ISO 10646, in little-endian UCS4 form
++
++          ISO-10646/UTF-8   - ISO 10646, in UTF-8 form
++          ISO-10646/UTF8
++          ISO-IR-193
++          OSF05010001
++          UTF-8
++          UTF8
++
++          ISO-10646/UCS2    - ISO 10646, in target-endian UCS2 form
++          OSF00010100
++          OSF00010101
++          OSF00010102
++          UCS-2
++          UCS2
++
++          UCS-2BE           - ISO 10646, in big-endian UCS2 form
++          UNICODEBIG
++
++          UCS-2LE           - ISO 10646, in little-endian UCS2 form
++          UNICODELITTLE
++
++          WCHAR_T           - EGLIBC's internal form (target-endian,
++                              32-bit ISO 10646)
++
++config EGLIBC_CRYPT
++   bool "Encryption library"
++   help
++       This option group includes the `libcrypt' library which
++       provides functions for one-way encryption.  Supported
++       encryption algorithms include MD5, SHA-256, SHA-512 and DES.
++
++config EGLIBC_CRYPT_UFC
++   bool "Ultra fast `crypt' implementation"
++   depends on EGLIBC_CRYPT
++   help
++       This option group provides ultra fast DES-based implementation of
++       the `crypt' function.  When this option group is disabled,
++       (a) the library will not provide the setkey[_r] and encrypt[_r]
++       functions and (b) the crypt[_r] function will return NULL and set the
++       errno to ENOSYS if /salt/ passed does not correspond to either MD5,
++       SHA-256 or SHA-512 algorithm.
++
++config EGLIBC_DB_ALIASES
++   bool "Functions for accessing the mail aliases database"
++   help
++       This option group includues functions for looking up mail
++       aliases in '/etc/aliases' or using nsswitch.  It includes the
++       following functions:
++
++         endaliasent
++         getaliasbyname
++         getaliasbyname_r
++         getaliasent
++         getaliasent_r
++         setaliasent
++
++       When this option group is disabled, the NSS service libraries
++       also lack support for querying their mail alias tables.
++
++config EGLIBC_ENVZ
++   bool "Functions for handling envz-style environment vectors."
++   help
++       This option group contains functions for creating and operating
++       on envz vectors.  An "envz vector" is a vector of strings in a
++       contiguous block of memory, where each element is a name-value
++       pair, and elements are separated from their neighbors by null
++       characters.
++
++       This option group includes the following functions:
++
++        envz_add        envz_merge
++        envz_entry      envz_remove
++        envz_get        envz_strip
++
++config EGLIBC_FCVT
++   bool "Functions for converting floating-point numbers to strings"
++   help
++       This option group includes functions for converting
++       floating-point numbers to strings.
++
++       This option group includes the following functions:
++
++         ecvt           qecvt
++	 ecvt_r		qecvt_r
++         fcvt		qfcvt
++	 fcvt_r		qfcvt_r
++         gcvt		qgcvt
++
++config EGLIBC_FMTMSG
++   bool "Functions for formatting messages"
++   help
++       This option group includes the following functions:
++
++         addseverity    fmtmsg
++
++config EGLIBC_FSTAB
++   bool "Access functions for 'fstab'"
++   help
++       This option group includes functions for reading the mount
++       point specification table, '/etc/fstab'.  These functions are
++       not included in the POSIX standard, which provides the
++       'getmntent' family of functions instead.
++
++       This option group includes the following functions:
++
++         endfsent       getfsspec
++         getfsent       setfsent
++         getfsfile
++
++config EGLIBC_FTRAVERSE
++   bool "Functions for traversing file hierarchies"
++   help
++       This option group includes functions for traversing file
++       UNIX file hierachies.
++
++       This option group includes the following functions:
++
++         fts_open       ftw
++	 fts_read	nftw
++         fts_children	ftw64
++	 fts_set	nftw64
++         fts_close
++
++config EGLIBC_GETLOGIN
++   bool "The getlogin function"
++   depends on EGLIBC_UTMP
++   help
++       This function group includes the 'getlogin' and 'getlogin_r'
++       functions, which return the user name associated by the login
++       activity with the current process's controlling terminal.
++
++       With this option group disabled, the 'glob' function will not
++       fall back on 'getlogin' to find the user's login name for tilde
++       expansion when the 'HOME' environment variable is not set.
++
++config EGLIBC_IDN
++   bool "International domain names support"
++   help
++       This option group includes the `libcidn' library which
++       provides support for international domain names.
++
++config EGLIBC_INET
++   bool "Networking support"
++   help
++       This option group includes networking-specific functions and
++       data.  With EGLIBC_INET disabled, the EGLIBC
++       installation and API changes as follows:
++
++       - The following libraries are not installed:
++
++         libnsl
++         libnss_compat
++         libnss_dns
++         libnss_hesiod
++         libnss_nis
++         libnss_nisplus
++         libresolv
++
++       - The following functions and variables are omitted from libc:
++
++         authdes_create           hstrerror              svc_fdset
++         authdes_getucred         htonl                  svc_getreq
++         authdes_pk_create        htons                  svc_getreq_common
++         authnone_create          if_freenameindex       svc_getreq_poll
++         authunix_create          if_indextoname         svc_getreqset
++         authunix_create_default  if_nameindex           svc_max_pollfd
++         bindresvport             if_nametoindex         svc_pollfd
++         callrpc                  in6addr_any            svcraw_create
++         cbc_crypt                in6addr_loopback       svc_register
++         clnt_broadcast           inet6_opt_append       svc_run
++         clnt_create              inet6_opt_find         svc_sendreply
++         clnt_pcreateerror        inet6_opt_finish       svctcp_create
++         clnt_perrno              inet6_opt_get_val      svcudp_bufcreate
++         clnt_perror              inet6_opt_init         svcudp_create
++         clntraw_create           inet6_option_alloc     svcudp_enablecache
++         clnt_spcreateerror       inet6_option_append    svcunix_create
++         clnt_sperrno             inet6_option_find      svcunixfd_create
++         clnt_sperror             inet6_option_init      svc_unregister
++         clnttcp_create           inet6_option_next      user2netname
++         clntudp_bufcreate        inet6_option_space     xdecrypt
++         clntudp_create           inet6_opt_next         xdr_accepted_reply
++         clntunix_create          inet6_opt_set_val      xdr_array
++         des_setparity            inet6_rth_add          xdr_authdes_cred
++         ecb_crypt                inet6_rth_getaddr      xdr_authdes_verf
++         endaliasent              inet6_rth_init         xdr_authunix_parms
++         endhostent               inet6_rth_reverse      xdr_bool
++         endnetent                inet6_rth_segments     xdr_bytes
++         endnetgrent              inet6_rth_space        xdr_callhdr
++         endprotoent              inet_addr              xdr_callmsg
++         endrpcent                inet_aton              xdr_char
++         endservent               inet_lnaof             xdr_cryptkeyarg
++         ether_aton               inet_makeaddr          xdr_cryptkeyarg2
++         ether_aton_r             inet_netof             xdr_cryptkeyres
++         ether_hostton            inet_network           xdr_des_block
++         ether_line               inet_nsap_addr         xdr_double
++         ether_ntoa               inet_nsap_ntoa         xdr_enum
++         ether_ntoa_r             inet_ntoa              xdr_float
++         ether_ntohost            inet_ntop              xdr_free
++         freeaddrinfo             inet_pton              xdr_getcredres
++         freeifaddrs              innetgr                xdr_hyper
++         gai_strerror             iruserok               xdr_int
++         getaddrinfo              iruserok_af            xdr_int16_t
++         getaliasbyname           key_decryptsession     xdr_int32_t
++         getaliasbyname_r         key_decryptsession_pk  xdr_int64_t
++         getaliasent              key_encryptsession     xdr_int8_t
++         getaliasent_r            key_encryptsession_pk  xdr_keybuf
++         gethostbyaddr            key_gendes             xdr_key_netstarg
++         gethostbyaddr_r          key_get_conv           xdr_key_netstres
++         gethostbyname            key_secretkey_is_set   xdr_keystatus
++         gethostbyname2           key_setnet             xdr_long
++         gethostbyname2_r         key_setsecret          xdr_longlong_t
++         gethostbyname_r          netname2host           xdrmem_create
++         gethostent               netname2user           xdr_netnamestr
++         gethostent_r             ntohl                  xdr_netobj
++         getifaddrs               ntohs                  xdr_opaque
++         getipv4sourcefilter      passwd2des             xdr_opaque_auth
++         get_myaddress            pmap_getmaps           xdr_pmap
++         getnameinfo              pmap_getport           xdr_pmaplist
++         getnetbyaddr             pmap_rmtcall           xdr_pointer
++         getnetbyaddr_r           pmap_set               xdr_quad_t
++         getnetbyname             pmap_unset             xdrrec_create
++         getnetbyname_r           rcmd                   xdrrec_endofrecord
++         getnetent                rcmd_af                xdrrec_eof
++         getnetent_r              registerrpc            xdrrec_skiprecord
++         getnetgrent              res_init               xdr_reference
++         getnetgrent_r            rexec                  xdr_rejected_reply
++         getnetname               rexec_af               xdr_replymsg
++         getprotobyname           rexecoptions           xdr_rmtcall_args
++         getprotobyname_r         rpc_createerr          xdr_rmtcallres
++         getprotobynumber         rresvport              xdr_short
++         getprotobynumber_r       rresvport_af           xdr_sizeof
++         getprotoent              rtime                  xdrstdio_create
++         getprotoent_r            ruserok                xdr_string
++         getpublickey             ruserok_af             xdr_u_char
++         getrpcbyname             ruserpass              xdr_u_hyper
++         getrpcbyname_r           setaliasent            xdr_u_int
++         getrpcbynumber           sethostent             xdr_uint16_t
++         getrpcbynumber_r         setipv4sourcefilter    xdr_uint32_t
++         getrpcent                setnetent              xdr_uint64_t
++         getrpcent_r              setnetgrent            xdr_uint8_t
++         getrpcport               setprotoent            xdr_u_long
++         getsecretkey             setrpcent              xdr_u_longlong_t
++         getservbyname            setservent             xdr_union
++         getservbyname_r          setsourcefilter        xdr_unixcred
++         getservbyport            svcauthdes_stats       xdr_u_quad_t
++         getservbyport_r          svcerr_auth            xdr_u_short
++         getservent               svcerr_decode          xdr_vector
++         getservent_r             svcerr_noproc          xdr_void
++         getsourcefilter          svcerr_noprog          xdr_wrapstring
++         h_errlist                svcerr_progvers        xencrypt
++         h_errno                  svcerr_systemerr       xprt_register
++         herror                   svcerr_weakauth        xprt_unregister
++         h_nerr                   svc_exit
++         host2netname             svcfd_create
++
++       - The rpcgen, nscd, and rpcinfo commands are not installed.
++
++       - The 'rpc' file (a text file listing RPC services) is not installed.
++
++       Socket-related system calls do not fall in this option group,
++       because many are also used for other inter-process
++       communication mechanisms.  For example, the 'syslog' routines
++       use Unix-domain sockets to communicate with the syslog daemon;
++       syslog is valuable in non-networked contexts.
++
++config EGLIBC_INET_ANL
++   bool "Asynchronous name lookup"
++   depends on EGLIBC_INET
++   help
++       This option group includes the `libanl' library which
++       provides support for asynchronous name lookup.
++
++config EGLIBC_LIBM
++   bool "libm (math library)"
++   help
++       This option group includes the 'libm' library, containing
++       mathematical functions.  If this option group is omitted, then
++       an EGLIBC installation does not include shared or unshared versions
++       of the math library.
++
++       Note that this does not remove all floating-point related
++       functionality from EGLIBC; for example, 'printf' and 'scanf'
++       can still print and read floating-point values with this option
++       group disabled.
++
++       Note that the ISO Standard C++ library 'libstdc++' depends on
++       EGLIBC's math library 'libm'.  If you disable this option
++       group, you will not be able to build 'libstdc++' against the
++       resulting EGLIBC installation.
++
++config EGLIBC_LOCALES
++   bool "Locale definitions"
++   help
++       This option group includes all locale definitions other than
++       that for the "C" locale.  If this option group is omitted, then
++       only the "C" locale is supported.
++
++
++config EGLIBC_LOCALE_CODE
++   bool "Locale functions"
++   depends on POSIX_C_LANG_WIDE_CHAR
++   help
++       This option group includes locale support functions, programs,
++       and libraries.  With EGLIBC_LOCALE_CODE disabled,
++       EGLIBC supports only the 'C' locale (also known as 'POSIX'),
++       and ignores the settings of the 'LANG' and 'LC_*' environment
++       variables.
++
++       With EGLIBC_LOCALE_CODE disabled, the following
++       functions are omitted from libc:
++
++         duplocale   localeconv  nl_langinfo    rpmatch  strfmon_l
++         freelocale  newlocale   nl_langinfo_l  strfmon  uselocale
++
++       Furthermore, only the LC_CTYPE and LC_TIME categories of the
++       standard "C" locale are available.
++
++       The EGLIBC_CATGETS option group depends on this option group.
++
++
++config EGLIBC_MEMUSAGE
++   bool "Memory profiling library"
++   help
++       This option group includes the `libmemusage' library and
++       the `memusage' and `memusagestat' utilities.
++       These components provide memory profiling functions.
++
++config EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
++   int "Memory profiling library buffer size"
++   depends on EGLIBC_MEMUSAGE
++   default "32768"
++   help
++       Libmemusage library buffers the profiling data in memory
++       before writing it out to disk.  By default, the library
++       allocates 1.5M buffer, which can be substantial for some
++       systems.  EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE option
++       allows to change the default buffer size.  It specifies
++       the number of entries the buffer should have.
++       On most architectures one buffer entry amounts to 48 bytes,
++       so setting this option to the value of 512 will reduce the size of
++       the memory buffer to 24K.
++
++config EGLIBC_NIS
++   bool "Support for NIS, NIS+, and the special 'compat' services."
++   depends on EGLIBC_INET && EGLIBC_SUNRPC
++   help
++       This option group includes the NIS, NIS+, and 'compat' Name
++       Service Switch service libraries.  When it is disabled, those
++       services libraries are not installed; you should remove any
++       references to them from your 'nsswitch.conf' file.
++
++       This option group depends on the EGLIBC_INET option
++       group; you must enable that to enable this option group.
++
++config EGLIBC_NSSWITCH
++   bool "Name service switch (nsswitch) support"
++   help
++       This option group includes support for the 'nsswitch' facility.
++       With this option group enabled, all EGLIBC functions for
++       accessing various system databases (passwords and groups;
++       networking; aliases; public keys; and so on) consult the
++       '/etc/nsswitch.conf' configuration file to decide how to handle
++       queries.
++
++       With this option group disabled, EGLIBC uses a fixed list of
++       services to satisfy queries on each database, as requested by
++       configuration files specified when EGLIBC is built.  Your
++       'option-groups.config' file must set the following two
++       variables:
++
++config EGLIBC_NSSWITCH_FIXED_CONFIG
++   string "Nsswitch fixed config filename"
++   depends on !EGLIBC_NSSWITCH
++   default ""
++   help
++          Set this to the name of a file whose contents observe the
++          same syntax as an ordinary '/etc/nsswitch.conf' file.  The
++          EGLIBC build process parses this file just as EGLIBC would
++          at run time if EGLIBC_NSSWITCH were enabled, and
++          produces a C library that uses the nsswitch service
++          libraries to search for database entries as this file
++          specifies, instead of consulting '/etc/nsswitch.conf' at run
++          time.
++
++          This should be an absolute filename.  The EGLIBC build
++          process may use it from several different working
++          directories.  It may include references to Makefile
++          variables like 'common-objpfx' (the top of the build tree,
++          with a trailing slash), or '..' (the top of the source tree,
++          with a trailing slash).
++
++          The EGLIBC source tree includes a sample configuration file
++          named 'nss/fixed-nsswitch.conf'; for simple configurations,
++          you will probably want to delete references to databases not
++          needed on your system.
++
++config EGLIBC_NSSWITCH_FIXED_FUNCTIONS
++   string "Nsswitch fixed functions filename"
++   depends on !EGLIBC_NSSWITCH
++   default ""
++   help
++          The EGLIBC build process uses this file to decide which
++          functions to make available from which service libraries.
++          The file 'nss/fixed-nsswitch.functions' serves as a sample
++          configuration file for this setting, and explains its syntax
++          and meaning in more detail.
++
++          This should be an absolute file name.  The EGLIBC build
++          process may use it from several different working
++          directories.  It may include references to Makefile
++          variables like 'common-objpfx' (the top of the build tree,
++          with a trailing slash), or '..' (the top of the source tree,
++          with a trailing slash).
++
++          Be sure to mention each function in each service you wish to
++          use.  If you do not mention a service's function here, the
++          EGLIBC database access functions will not find it, even if
++          it is listed in the EGLIBC_NSSWITCH_FIXED_CONFIG
++          file.
++
++          In this arrangement, EGLIBC will not use the 'dlopen' and
++          'dlsym' functions to find database access functions.  Instead,
++          libc hard-codes references to the service libraries' database
++          access functions.  You must explicitly link your program
++          against the name service libraries (those whose names start
++          with 'libnss_', in the sysroot's '/lib' directory) whose
++          functions you intend to use.  This arrangement helps
++          system-wide static analysis tools decide which functions a
++          system actually uses.
++
++          Note that some nsswitch service libraries require other option
++          groups to be enabled; for example, the EGLIBC_INET
++          option group must be enabled to use the 'libnss_dns.so.2'
++          service library, which uses the Domain Name System network
++          protocol to answer queries.
++
++config EGLIBC_RCMD
++   bool "Support for 'rcmd' and related library functions"
++   depends on EGLIBC_INET
++   help
++      This option group includes functions for running commands on
++      remote machines via the 'rsh' protocol, and doing authentication
++      related to those functions.  This also includes functions that
++      use the 'rexec' protocol.
++
++      This option group includes the following functions:
++
++        rcmd            ruserok
++        rcmd_af         ruserok_af
++        rexec           iruserok
++        rexec_af        iruserok_af
++        rresvport       ruserpass
++        rresvport_af
++
++config EGLIBC_RTLD_DEBUG
++   bool "Runtime linker debug print outs"
++   help
++      This option group enables debug output of the runtime linker
++      which is activated via LD_DEBUG and LD_TRACE_PRELINKING
++      environment variables.  Disabling this option group yields
++      a smaller runtime linker binary.
++      BEWARE: Disabling this option group is likely to break
++      the `ldd' utility which may also be used by the prelinker.
++      In particular, the `--unused' ldd option will not work correctly.
++
++config EGLIBC_SPAWN
++   bool "Support for POSIX posix_spawn functions"
++   help
++      This option group includes the POSIX functions for executing
++      programs in child processes without using 'fork' or 'vfork'.
++
++      This option group includes the following functions:
++
++        posix_spawn
++        posix_spawnattr_destroy
++        posix_spawnattr_getflags
++        posix_spawnattr_getpgroup
++        posix_spawnattr_getschedparam
++        posix_spawnattr_getschedpolicy
++        posix_spawnattr_getsigdefault
++        posix_spawnattr_getsigmask
++        posix_spawnattr_init
++        posix_spawnattr_setflags
++        posix_spawnattr_setpgroup
++        posix_spawnattr_setschedparam
++        posix_spawnattr_setschedpolicy
++        posix_spawnattr_setsigdefault
++        posix_spawnattr_setsigmask
++        posix_spawn_file_actions_addclose
++        posix_spawn_file_actions_adddup2
++        posix_spawn_file_actions_addopen
++        posix_spawn_file_actions_destroy
++        posix_spawn_file_actions_init
++        posix_spawnp
++
++      This option group also provides the ability for the iconv,
++      localedef, and locale programs to operate transparently on
++      compressed charset definitions.  When this option group is
++      disabled, those programs will only operate on uncompressed
++      charmap files.
++
++config EGLIBC_STREAMS
++   bool "Support for accessing STREAMS."
++   help
++      This option group includes functions for reading and writing
++      messages to and from STREAMS.  The STREAMS interface provides a
++      uniform mechanism for implementing networking services and other
++      character-based I/O.  (STREAMS are not to be confused with
++      <stdio.h> FILE objects, also called 'streams'.)
++
++      This option group includes the following functions:
++
++        getmsg          putpmsg
++        getpmsg         fattach
++        isastream       fdetach
++        putmsg
++
++config EGLIBC_SUNRPC
++   bool "Support for the Sun 'RPC' protocol."
++   depends on EGLIBC_INET
++   help
++      This option group includes support for the Sun RPC protocols,
++      including the 'rpcgen' and 'rpcinfo' programs.
++
++config EGLIBC_UTMP
++    bool "Older access functions for 'utmp' login records"
++    help
++       This option group includes the older 'utent' family of
++       functions for accessing user login records in the 'utmp' file.
++       POSIX omits these functions in favor of the 'utxent' family,
++       and they are obsolete on systems other than Linux.
++
++       This option group includes the following functions:
++
++         endutent
++         getutent
++         getutent_r
++         getutid
++         getutid_r
++         getutline
++         getutline_r
++         logwtmp
++         pututline
++         setutent
++         updwtmp
++         utmpname
++
++       This option group includes the following libraries:
++
++         libutil.so (and libutil.a)
++
++config EGLIBC_UTMPX
++    bool "POSIX access functions for 'utmp' login records"
++    depends on EGLIBC_UTMP
++    help
++       This option group includes the POSIX functions for reading and
++       writing user login records in the 'utmp' file (usually
++       '/var/run/utmp').  The POSIX functions operate on 'struct
++       utmpx' structures, as opposed to the family of older 'utent'
++       functions, which operate on 'struct utmp' structures.
++
++       This option group includes the following functions:
++
++         endutxent
++         getutmp
++         getutmpx
++         getutxent
++         getutxid
++         getutxline
++         pututxline
++         setutxent
++         updwtmpx
++         utmpxname
++
++config EGLIBC_WORDEXP
++    bool "Shell-style word expansion"
++    help
++        This option group includes the 'wordexp' function for
++        performing word expansion in the manner of the shell, and the
++        accompanying 'wordfree' function.
++
++config POSIX_C_LANG_WIDE_CHAR
++    bool "ISO C library wide character functions, excluding I/O"
++    help
++        This option group includes the functions defined by the ISO C
++        standard for working with wide and multibyte characters in
++        memory.  Functions for reading and writing wide and multibyte
++        characters from and to files call in the
++        POSIX_WIDE_CHAR_DEVICE_IO option group.
++
++        This option group includes the following functions:
++
++          btowc         mbsinit       wcscspn       wcstoll
++          iswalnum      mbsrtowcs     wcsftime      wcstombs
++          iswalpha      mbstowcs      wcslen        wcstoul
++          iswblank      mbtowc        wcsncat       wcstoull
++          iswcntrl      swprintf      wcsncmp       wcstoumax
++          iswctype      swscanf       wcsncpy       wcsxfrm
++          iswdigit      towctrans     wcspbrk       wctob
++          iswgraph      towlower      wcsrchr       wctomb
++          iswlower      towupper      wcsrtombs     wctrans
++          iswprint      vswprintf     wcsspn        wctype
++          iswpunct      vswscanf      wcsstr        wmemchr
++          iswspace      wcrtomb       wcstod        wmemcmp
++          iswupper      wcscat        wcstof        wmemcpy
++          iswxdigit     wcschr        wcstoimax     wmemmove
++          mblen         wcscmp        wcstok        wmemset
++          mbrlen        wcscoll       wcstol
++          mbrtowc       wcscpy        wcstold
++
++config POSIX_REGEXP
++    bool "Regular expressions"
++    help
++        This option group includes the POSIX regular expression
++        functions, and the associated non-POSIX extensions and
++        compatibility functions.
++
++        With POSIX_REGEXP disabled, the following functions are
++        omitted from libc:
++
++          re_comp                 re_max_failures         regcomp
++          re_compile_fastmap      re_search               regerror
++          re_compile_pattern      re_search_2             regexec
++          re_exec                 re_set_registers        regfree
++          re_match                re_set_syntax           rpmatch
++          re_match_2              re_syntax_options
++
++        Furthermore, the compatibility regexp interface defined in the
++        <regexp.h> header file, 'compile', 'step', and 'advance', is
++        omitted.
++
++config POSIX_REGEXP_GLIBC
++    bool "Regular expressions from GLIBC"
++    depends on POSIX_REGEXP
++    help
++	This option group specifies which regular expression
++        library to use.  The choice is between regex
++        implementation from GLIBC and regex implementation from
++        libiberty.  The GLIBC variant is fully POSIX conformant and
++        optimized for speed; regex from libiberty is more than twice
++        as small while still is enough for most practical purposes.
++
++config POSIX_WIDE_CHAR_DEVICE_IO
++    bool "Input and output functions for wide characters"
++    depends on POSIX_C_LANG_WIDE_CHAR
++    help
++        This option group includes functions for reading and writing
++        wide characters to and from <stdio.h> streams.
++
++        This option group includes the following functions:
++
++          fgetwc        fwprintf      putwchar      vwscanf
++          fgetws        fwscanf       ungetwc       wprintf
++          fputwc        getwc         vfwprintf     wscanf
++          fputws        getwchar      vfwscanf
++          fwide         putwc         vwprintf
++
++        This option group further includes the following unlocked
++        variants of the above functions:
++
++          fgetwc_unlocked           getwc_unlocked
++          fgetws_unlocked           getwchar_unlocked
++          fputwc_unlocked           putwc_unlocked
++          fputws_unlocked           putwchar_unlocked
++
++        Note that the GNU standard C++ library, 'libstdc++.so', uses
++        some of these functions; you will not be able to link or run
++        C++ programs if you disable this option group.
++
++        This option group also affects the behavior of the following
++        functions:
++
++          fdopen
++          fopen
++          fopen64
++          freopen
++          freopen64
++
++        These functions all take an OPENTYPE parameter which may
++        contain a string of the form ",ccs=CHARSET", indicating that
++        the underlying file uses the character set named CHARSET.
++        This produces a wide-oriented stream, which is only useful
++        when the functions included in this option group are present.
++        If the user attempts to open a file specifying a character set
++        in the OPENTYPE parameter, and EGLIBC was built with this
++        option group disabled, the function returns NULL, and sets
++        errno to EINVAL.
++
++
++# This helps Emacs users browse this file using the page motion commands
++# and commands like 'pages-directory'.
++# Local Variables:
++# page-delimiter: "^config\\s-"
++# End:
+diff --git a/option-groups.defaults b/option-groups.defaults
+new file mode 100644
+index 0000000..8141201
+--- /dev/null
++++ b/option-groups.defaults
+@@ -0,0 +1,47 @@
++# This file sets default values for all option group variables
++# mentioned in option-groups.def; see that file for a description of
++# each option group.
++#
++# Subdirectory makefiles include this file before including the user's
++# settings from option-groups.config at the top of the build tree;
++# that file need only refer to those options whose default settings
++# are to be changed.
++#
++# By default, all option groups are enabled.
++OPTION_EGLIBC_ADVANCED_INET6 = y
++OPTION_EGLIBC_BACKTRACE = y
++OPTION_EGLIBC_BIG_MACROS = y
++OPTION_EGLIBC_BSD = y
++OPTION_EGLIBC_CXX_TESTS = y
++OPTION_EGLIBC_CATGETS = y
++OPTION_EGLIBC_CHARSETS = y
++OPTION_EGLIBC_CRYPT = y
++OPTION_EGLIBC_CRYPT_UFC = y
++OPTION_EGLIBC_DB_ALIASES = y
++OPTION_EGLIBC_ENVZ = y
++OPTION_EGLIBC_FCVT = y
++OPTION_EGLIBC_FMTMSG = y
++OPTION_EGLIBC_FSTAB = y
++OPTION_EGLIBC_FTRAVERSE = y
++OPTION_EGLIBC_GETLOGIN = y
++OPTION_EGLIBC_IDN = y
++OPTION_EGLIBC_INET = y
++OPTION_EGLIBC_INET_ANL = y
++OPTION_EGLIBC_LIBM = y
++OPTION_EGLIBC_LOCALES = y
++OPTION_EGLIBC_LOCALE_CODE = y
++OPTION_EGLIBC_MEMUSAGE = y
++OPTION_EGLIBC_NIS = y
++OPTION_EGLIBC_NSSWITCH = y
++OPTION_EGLIBC_RCMD = y
++OPTION_EGLIBC_RTLD_DEBUG = y
++OPTION_EGLIBC_SPAWN = y
++OPTION_EGLIBC_STREAMS = y
++OPTION_EGLIBC_SUNRPC = y
++OPTION_EGLIBC_UTMP = y
++OPTION_EGLIBC_UTMPX = y
++OPTION_EGLIBC_WORDEXP = y
++OPTION_POSIX_C_LANG_WIDE_CHAR = y
++OPTION_POSIX_REGEXP = y
++OPTION_POSIX_REGEXP_GLIBC = y
++OPTION_POSIX_WIDE_CHAR_DEVICE_IO = y
+diff --git a/option-groups.mak b/option-groups.mak
+new file mode 100644
+index 0000000..f83e0c1
+--- /dev/null
++++ b/option-groups.mak
+@@ -0,0 +1,41 @@
++# Setup file for subdirectory Makefiles that define EGLIBC option groups.
++
++# EGLIBC shouldn't need to override this.  However, the
++# cross-build-friendly localedef includes this makefile to get option
++# group variable definitions; it uses a single build tree for all the
++# multilibs, and needs to be able to specify a different option group
++# configuration file for each multilib.
++option_group_config_file ?= $(objdir)/option-groups.config
++
++# Read the default settings for all options.
++# We're included before ../Rules, so we can't assume $(..) is set.
++include $(firstword $(..) ../)option-groups.defaults
++
++# Read the developer's option group selections, overriding the
++# defaults from option-groups.defaults.
++-include $(option_group_config_file)
++
++# $(call option-disabled, VAR) is 'y' if VAR is not 'y', or 'n' otherwise.
++# VAR should be a variable name, not a variable reference; this is
++# less general, but more terse for the intended use.
++# You can use it to add a file to a list if an option group is
++# disabled, like this:
++#   routines-$(call option-disabled, OPTION_POSIX_C_LANG_WIDE_CHAR) += ...
++define option-disabled
++$(firstword $(subst y,n,$(filter y,$($(strip $(1))))) y)
++endef
++
++# Establish 'routines-y', etc. as simply-expanded variables.
++aux-y	       	    :=
++extra-libs-others-y :=
++extra-libs-y   	    :=
++extra-objs-y   	    :=
++install-bin-y  	    :=
++install-others-y    :=
++install-sbin-y 	    :=
++others-y       	    :=
++others-pie-y   	    :=
++routines-y     	    :=
++test-srcs-y    	    :=
++tests-y        	    :=
++xtests-y       	    :=
+diff --git a/options-config/Makefile b/options-config/Makefile
+new file mode 100644
+index 0000000..db00708
+--- /dev/null
++++ b/options-config/Makefile
+@@ -0,0 +1,55 @@
++# ===========================================================================
++# EGLIBC option-groups configuration targets
++# These targets are included from top-level makefile
++
++ifneq ($(kconfig_tools),)
++ifneq (no,$(PERL))
++
++ocdir := options-config
++
++OconfigDefaults     := option-groups.defaults
++OconfigDefaults_tmp := $(common-objpfx).tmp.defconfig
++OconfigDef          := option-groups.def
++Oconfig             := $(common-objpfx)option-groups.config
++Oconfig_tmp         := $(common-objpfx).tmp.config
++
++conf  := $(kconfig_tools)/conf
++mconf := $(kconfig_tools)/mconf
++
++preproc  := $(PERL) $(ocdir)/config-preproc.pl
++postproc := $(PERL) $(ocdir)/config-postproc.pl
++
++PHONY += defconfig config menuconfig
++
++defconfig: $(conf) $(OconfigDefaults) $(OconfigDef)
++	rm -f $(OconfigDefaults_tmp)
++	rm -f $(Oconfig_tmp)
++	$(preproc) $(OconfigDefaults) > $(OconfigDefaults_tmp)
++	KCONFIG_CONFIG=$(Oconfig_tmp) $< --defconfig=$(OconfigDefaults_tmp) \
++				$(OconfigDef)
++	$(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig)
++	rm $(Oconfig_tmp)
++	rm $(OconfigDefaults_tmp)
++
++config: $(conf) $(OconfigDefaults) $(OconfigDef)
++	rm -f $(Oconfig_tmp)
++	$(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp)
++	KCONFIG_CONFIG=$(Oconfig_tmp) $< --oldaskconfig $(OconfigDef)
++	$(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig)
++	rm $(Oconfig_tmp)
++
++menuconfig: $(mconf) $(OconfigDefaults) $(OconfigDef)
++	rm -f $(Oconfig_tmp)
++	$(preproc) $(wildcard $(Oconfig)) > $(Oconfig_tmp)
++	KCONFIG_CONFIG=$(Oconfig_tmp) $< $(OconfigDef)
++	$(postproc) $(OconfigDefaults) $(Oconfig_tmp) > $(Oconfig)
++	rm $(Oconfig_tmp)
++
++# Help text used by make help
++help:
++	@echo  '  defconfig	  - New config with default from default config'
++	@echo  '  config	  - Update current config utilising a line-oriented program'
++	@echo  '  menuconfig	  - Update current config utilising a menu based program'
++
++endif
++endif
+diff --git a/options-config/config-postproc.pl b/options-config/config-postproc.pl
+new file mode 100644
+index 0000000..4dd1c63
+--- /dev/null
++++ b/options-config/config-postproc.pl
+@@ -0,0 +1,58 @@
++#!/usr/bin/perl
++
++$usage = "usage: $0 <default config file> <config file>\n";
++
++die "$usage" unless @ARGV;
++$defaults = shift @ARGV;
++die "$usage" unless @ARGV;
++die "Could not open $ARGV[0]" unless -T $ARGV[0];
++
++sub yank {
++    @option = grep(!($_ =~ /$_[0]\s*=/), @option);
++}
++
++open(DEFAULTS, $defaults) || die "Could not open $defaults\n";
++
++# get the full list of available options using the default config file
++$i = 0;
++while (<DEFAULTS>) {
++    if (/^\s*OPTION_(\w+\s*=.*$)/) {
++	$option[$i++] = $1;
++    }
++}
++
++# now go through the config file, making the necessary changes
++while (<>) {
++    if (/Linux Kernel Configuration/) {
++	# change title
++	s/Linux Kernel/Option Groups/;
++	print;
++    } elsif (/^\s*CONFIG_(\w+)\s*=/) {
++	# this is an explicit option set line, change CONFIG_ to OPTION_
++	# before printing and remove this option from option list
++	$opt = $1;
++	yank($opt);
++	s/CONFIG_/OPTION_/g;
++	print;
++    } elsif (/^\s*#\s+CONFIG_(\w+) is not set/) {
++	# this is a comment line for an unset boolean option, change CONFIG_
++	# to OPTION_, remove this option from option list, and convert to
++	# explicit OPTION_FOO=n
++	$opt = $1;
++	yank($opt);
++	s/CONFIG_/OPTION_/g;
++	print "OPTION_$opt=n\n";
++    } else {
++	print;
++    }
++}
++
++# any boolean options left in @options, are options that were not mentioned in
++# the config file, and implicitly that means the option must be set =n,
++# so do that here.
++foreach $opt (@option) {
++    if ($opt =~ /=\s*[yn]/) {
++	$opt =~ s/=\s*[yn]/=n/;
++	print "OPTION_$opt\n";
++    }
++}
+diff --git a/options-config/config-preproc.pl b/options-config/config-preproc.pl
+new file mode 100644
+index 0000000..b83bb85
+--- /dev/null
++++ b/options-config/config-preproc.pl
+@@ -0,0 +1,8 @@
++#!/usr/bin/perl
++
++if (@ARGV) {
++    while (<>) {
++	s/OPTION_/CONFIG_/g;
++	print;
++    }
++}
+diff --git a/scripts/option-groups.awk b/scripts/option-groups.awk
+new file mode 100644
+index 0000000..533af0c
+--- /dev/null
++++ b/scripts/option-groups.awk
+@@ -0,0 +1,63 @@
++# option-groups.awk --- generate option group header file
++# Given input files containing makefile-style assignments to variables,
++# print out a header file that #defines an appropriate preprocessor
++# symbol for each variable left set to 'y'.
++
++BEGIN { FS="=" }
++
++# Trim spaces.
++{ gsub (/[[:blank:]]/, "") }
++
++# Skip comments.
++/^#/ { next }
++
++# Process assignments.
++NF == 2 {
++    vars[$1] = $2
++}
++
++# Print final values.
++END {
++    print "/* This file is automatically generated by scripts/option-groups.awk"
++    print "   in the EGLIBC source tree."
++    print ""
++    print "   It defines macros that indicate which EGLIBC option groups were"
++    print "   configured in 'option-groups.config' when this C library was"
++    print "   built.  For each option group named OPTION_foo, it #defines"
++    print "   __OPTION_foo to be 1 if the group is enabled, or #defines that"
++    print "   symbol to be 0 if the group is disabled.  */"
++    print ""
++    print "#ifndef __GNU_OPTION_GROUPS_H"
++    print "#define __GNU_OPTION_GROUPS_H"
++    print ""
++
++    # Produce a sorted list of variable names.
++    i=0
++    for (var in vars)
++        names[i++] = var
++    n = asort (names)
++
++    for (i = 1; i <= n; i++)
++    {
++        var = names[i]
++        if (var ~ /^OPTION_/)
++        {
++            if (vars[var] == "y")
++                print "#define __" var " 1"
++            else if (vars[var] == "n")
++                print "#define __" var " 0"
++	    else if (vars[var] ~ /^[0-9]+/ ||
++		     vars[var] ~ /^0x[0-9aAbBcCdDeEfF]+/ ||
++		     vars[var] ~ /^\"/)
++		 print "#define __" var " " vars[var]
++	    else
++		print "/* #undef __" var " */"
++            # Ignore variables that don't have boolean, int, hex, or
++	    # string values. Ideally, this would be driven by the types
++	    # given in option-groups.def.
++        }
++    }
++
++    print ""
++    print "#endif /* __GNU_OPTION_GROUPS_H */"
++}
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0020-eglibc-Help-bootstrap-cross-toolchain.patch b/meta/recipes-core/glibc/glibc/0020-eglibc-Help-bootstrap-cross-toolchain.patch
new file mode 100644
index 0000000..df93094
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0020-eglibc-Help-bootstrap-cross-toolchain.patch
@@ -0,0 +1,100 @@
+From 8fe0d29488b376011cdaaa462d557ffc0b31fb63 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:49:28 +0000
+Subject: [PATCH 20/27] eglibc: Help bootstrap cross toolchain
+
+Taken from EGLIBC, r1484 + r1525
+
+        2007-02-20  Jim Blandy  <jimb@codesourcery.com>
+
+                * Makefile (install-headers): Preserve old behavior: depend on
+                $(inst_includedir)/gnu/stubs.h only if install-bootstrap-headers
+                is set; otherwise, place gnu/stubs.h on the 'install-others' list.
+
+        2007-02-16  Jim Blandy  <jimb@codesourcery.com>
+
+                * Makefile: Amend make install-headers to install everything
+                necessary for building a cross-compiler.  Install gnu/stubs.h as
+                part of 'install-headers', not 'install-others'.
+                If install-bootstrap-headers is 'yes', install a dummy copy of
+                gnu/stubs.h, instead of computing the real thing.
+                * include/stubs-bootstrap.h: New file.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile                  | 22 +++++++++++++++++++++-
+ include/stubs-bootstrap.h | 12 ++++++++++++
+ 2 files changed, 33 insertions(+), 1 deletion(-)
+ create mode 100644 include/stubs-bootstrap.h
+
+diff --git a/Makefile b/Makefile
+index f906391..e4e149e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -69,9 +69,18 @@ subdir-dirs = include
+ vpath %.h $(subdir-dirs)
+ 
+ # What to install.
+-install-others = $(inst_includedir)/gnu/stubs.h
+ install-bin-script =
+ 
++# If we're bootstrapping, install a dummy gnu/stubs.h along with the
++# other headers, so 'make install-headers' produces a useable include
++# tree.  Otherwise, install gnu/stubs.h later, after the rest of the
++# build is done.
++ifeq ($(install-bootstrap-headers),yes)
++install-headers: $(inst_includedir)/gnu/stubs.h
++else
++install-others = $(inst_includedir)/gnu/stubs.h
++endif
++
+ ifeq (yes,$(build-shared))
+ headers += gnu/lib-names.h
+ endif
+@@ -151,6 +160,16 @@ others: $(common-objpfx)testrun.sh
+ 
+ subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)$(dir)/stubs)
+ 
++# gnu/stubs.h depends (via the subdir 'stubs' targets) on all the .o
++# files in EGLIBC.  For bootstrapping a GCC/EGLIBC pair, an empty
++# gnu/stubs.h is good enough.
++ifeq ($(install-bootstrap-headers),yes)
++$(inst_includedir)/gnu/stubs.h: include/stubs-bootstrap.h $(+force)
++	$(make-target-directory)
++	$(INSTALL_DATA) $< $@
++
++installed-stubs =
++else
+ ifndef abi-variants
+ installed-stubs = $(inst_includedir)/gnu/stubs.h
+ else
+@@ -177,6 +196,7 @@ $(inst_includedir)/gnu/stubs.h: $(+force)
+ 
+ install-others-nosubdir: $(installed-stubs)
+ endif
++endif
+ 
+ 
+ # Since stubs.h is never needed when building the library, we simplify the
+diff --git a/include/stubs-bootstrap.h b/include/stubs-bootstrap.h
+new file mode 100644
+index 0000000..1d2b669
+--- /dev/null
++++ b/include/stubs-bootstrap.h
+@@ -0,0 +1,12 @@
++/* Placeholder stubs.h file for bootstrapping.
++
++   When bootstrapping a GCC/EGLIBC pair, GCC requires that the EGLIBC
++   headers be installed, but we can't fully build EGLIBC without that
++   GCC.  So we run the command:
++
++      make install-headers install-bootstrap-headers=yes
++
++   to install the headers GCC needs, but avoid building certain
++   difficult headers.  The <gnu/stubs.h> header depends, via the
++   EGLIBC subdir 'stubs' make targets, on every .o file in EGLIBC, but
++   an empty stubs.h like this will do fine for GCC.  */
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0021-eglibc-cherry-picked-from-http-www.eglibc.org-archiv.patch b/meta/recipes-core/glibc/glibc/0021-eglibc-cherry-picked-from-http-www.eglibc.org-archiv.patch
new file mode 100644
index 0000000..38bb8a1
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0021-eglibc-cherry-picked-from-http-www.eglibc.org-archiv.patch
@@ -0,0 +1,64 @@
+From fe2ae4f877928dd6bff5bac3f15bce4b50d2bd12 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:51:16 +0000
+Subject: [PATCH 21/27] eglibc: cherry-picked from
+ http://www.eglibc.org/archives/patches/msg00772.html
+
+It hasn't yet been merged into glibc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ resolv/res_libc.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/resolv/res_libc.c b/resolv/res_libc.c
+index ee3fa21..29e2340 100644
+--- a/resolv/res_libc.c
++++ b/resolv/res_libc.c
+@@ -22,12 +22,13 @@
+ #include <arpa/nameser.h>
+ #include <resolv.h>
+ #include <bits/libc-lock.h>
+-
++#include <sys/stat.h>
+ 
+ /* The following bit is copied from res_data.c (where it is #ifdef'ed
+    out) since res_init() should go into libc.so but the rest of that
+    file should not.  */
+ 
++__libc_lock_define_initialized (static, lock);
+ extern unsigned long long int __res_initstamp attribute_hidden;
+ /* We have atomic increment operations on 64-bit platforms.  */
+ #if __WORDSIZE == 64
+@@ -35,7 +36,6 @@ extern unsigned long long int __res_initstamp attribute_hidden;
+ # define atomicincunlock(lock) (void) 0
+ # define atomicinc(var) catomic_increment (&(var))
+ #else
+-__libc_lock_define_initialized (static, lock);
+ # define atomicinclock(lock) __libc_lock_lock (lock)
+ # define atomicincunlock(lock) __libc_lock_unlock (lock)
+ # define atomicinc(var) ++var
+@@ -94,7 +94,18 @@ res_init(void) {
+ int
+ __res_maybe_init (res_state resp, int preinit)
+ {
++	static time_t last_mtime;
++	struct stat statbuf;
++	int ret;
++
+ 	if (resp->options & RES_INIT) {
++		ret = stat (_PATH_RESCONF, &statbuf);
++		__libc_lock_lock (lock);
++		if ((ret == 0) && (last_mtime != statbuf.st_mtime)) {
++			last_mtime = statbuf.st_mtime;
++			atomicinc (__res_initstamp);
++		}
++		__libc_lock_unlock (lock);
+ 		if (__res_initstamp != resp->_u._ext.initstamp) {
+ 			if (resp->nscount > 0)
+ 				__res_iclose (resp, true);
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0022-eglibc-Clear-cache-lines-on-ppc8xx.patch b/meta/recipes-core/glibc/glibc/0022-eglibc-Clear-cache-lines-on-ppc8xx.patch
new file mode 100644
index 0000000..8a4c9c3
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0022-eglibc-Clear-cache-lines-on-ppc8xx.patch
@@ -0,0 +1,81 @@
+From be7273225698074347a71de58006977bb304d7f7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:53:47 +0000
+Subject: [PATCH 22/27] eglibc: Clear cache lines on ppc8xx
+
+2007-06-13  Nathan Sidwell  <nathan@codesourcery.com>
+            Mark Shinwell  <shinwell@codesourcery.com>
+
+        * sysdeps/unix/sysv/linux/powerpc/libc-start.c
+        (__libc_start_main): Detect 8xx parts and clear
+        __cache_line_size if detected.
+        * sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+        (DL_PLATFORM_AUXV): Likewise.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c  | 14 +++++++++++++-
+ sysdeps/unix/sysv/linux/powerpc/libc-start.c | 15 ++++++++++++++-
+ 2 files changed, 27 insertions(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+index c2504ff..d50f1cb 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
++++ b/sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
+@@ -24,9 +24,21 @@ int __cache_line_size attribute_hidden;
+ /* Scan the Aux Vector for the "Data Cache Block Size" entry.  If found
+    verify that the static extern __cache_line_size is defined by checking
+    for not NULL.  If it is defined then assign the cache block size
+-   value to __cache_line_size.  */
++   value to __cache_line_size.  This is used by memset to
++   optimize setting to zero.  We have to detect 8xx processors, which
++   have buggy dcbz implementations that cannot report page faults
++   correctly.  That requires reading SPR, which is a privileged
++   operation.  Fortunately 2.2.18 and later emulates PowerPC mfspr
++   reads from the PVR register.   */
+ #define DL_PLATFORM_AUXV						      \
+       case AT_DCACHEBSIZE:						      \
++	if (__LINUX_KERNEL_VERSION >= 0x020218)				      \
++	  {								      \
++	    unsigned pvr = 0;						      \
++	    asm ("mfspr %0, 287" : "=r" (pvr));				      \
++	    if ((pvr & 0xffff0000) == 0x00500000)			      \
++	      break;							      \
++	  }								      \
+ 	__cache_line_size = av->a_un.a_val;				      \
+ 	break;
+ 
+diff --git a/sysdeps/unix/sysv/linux/powerpc/libc-start.c b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+index a9364c7..a3ed1d4 100644
+--- a/sysdeps/unix/sysv/linux/powerpc/libc-start.c
++++ b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
+@@ -68,11 +68,24 @@ __libc_start_main (int argc, char **argv,
+       rtld_fini = NULL;
+     }
+ 
+-  /* Initialize the __cache_line_size variable from the aux vector.  */
++  /* Initialize the __cache_line_size variable from the aux vector.
++     This is used by memset to optimize setting to zero.  We have to
++     detect 8xx processors, which have buggy dcbz implementations that
++     cannot report page faults correctly.  That requires reading SPR,
++     which is a privileged operation.  Fortunately 2.2.18 and later
++     emulates PowerPC mfspr reads from the PVR register.  */
+   for (ElfW (auxv_t) * av = auxvec; av->a_type != AT_NULL; ++av)
+     switch (av->a_type)
+       {
+       case AT_DCACHEBSIZE:
++	if (__LINUX_KERNEL_VERSION >= 0x020218)
++	  {
++	    unsigned pvr = 0;
++
++	    asm ("mfspr %0, 287" : "=r" (pvr) :);
++	    if ((pvr & 0xffff0000) == 0x00500000)
++	      break;
++	  }
+ 	__cache_line_size = av->a_un.a_val;
+ 	break;
+       }
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0023-eglibc-Resolve-__fpscr_values-on-SH4.patch b/meta/recipes-core/glibc/glibc/0023-eglibc-Resolve-__fpscr_values-on-SH4.patch
new file mode 100644
index 0000000..9f3d753
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0023-eglibc-Resolve-__fpscr_values-on-SH4.patch
@@ -0,0 +1,56 @@
+From 718e7e5db1c8b073adb9a79ec6f167238c2d8bda Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:55:53 +0000
+Subject: [PATCH 23/27] eglibc: Resolve __fpscr_values on SH4
+
+2010-09-29  Nobuhiro Iwamatsu  <iwamatsu@nigauri.org>
+            Andrew Stubbs  <ams@codesourcery.com>
+
+        Resolve SH's __fpscr_values to symbol in libc.so.
+
+        * sysdeps/sh/sh4/fpu/fpu_control.h: Add C++ __set_fpscr prototype.
+        * sysdeps/unix/sysv/linux/sh/Versions (GLIBC_2.2): Add __fpscr_values.
+        * sysdeps/unix/sysv/linux/sh/sysdep.S (___fpscr_values): New constant.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sysdeps/unix/sysv/linux/sh/Versions |  1 +
+ sysdeps/unix/sysv/linux/sh/sysdep.S | 11 +++++++++++
+ 2 files changed, 12 insertions(+)
+
+diff --git a/sysdeps/unix/sysv/linux/sh/Versions b/sysdeps/unix/sysv/linux/sh/Versions
+index e0938c4..ca1d7da 100644
+--- a/sysdeps/unix/sysv/linux/sh/Versions
++++ b/sysdeps/unix/sysv/linux/sh/Versions
+@@ -2,6 +2,7 @@ libc {
+   GLIBC_2.2 {
+     # functions used in other libraries
+     __xstat64; __fxstat64; __lxstat64;
++    __fpscr_values;
+ 
+     # a*
+     alphasort64;
+diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.S b/sysdeps/unix/sysv/linux/sh/sysdep.S
+index a02b7e2..b9be326 100644
+--- a/sysdeps/unix/sysv/linux/sh/sysdep.S
++++ b/sysdeps/unix/sysv/linux/sh/sysdep.S
+@@ -30,3 +30,14 @@ ENTRY (__syscall_error)
+ 
+ #define __syscall_error __syscall_error_1
+ #include <sysdeps/unix/sh/sysdep.S>
++
++       .data
++       .align 3
++       .globl ___fpscr_values
++       .type ___fpscr_values, @object
++       .size ___fpscr_values, 8
++___fpscr_values:
++       .long 0
++       .long 0x80000
++weak_alias (___fpscr_values, __fpscr_values)
++
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-eglibc-options-groups-support.patch b/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-eglibc-options-groups-support.patch
new file mode 100644
index 0000000..0514e28
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0024-eglibc-Forward-port-eglibc-options-groups-support.patch
@@ -0,0 +1,16842 @@
+From 2a5d7bcf0ff791c95ee1388772408a1bf4454694 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:33:49 +0000
+Subject: [PATCH 24/27] eglibc: Forward port eglibc options groups support
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makeconfig                              |   20 +-
+ Makerules                               |   19 +
+ argp/Makefile                           |    2 +
+ argp/argp-fmtstream.c                   |   25 +-
+ argp/argp-help.c                        |   13 +-
+ argp/argp-namefrob.h                    |    2 +
+ catgets/Makefile                        |   17 +-
+ crypt/Makefile                          |   20 +-
+ crypt/crypt-entry.c                     |   13 +
+ crypt/crypt_common.c                    |   42 +
+ crypt/crypt_util.c                      |   18 -
+ csu/Makefile                            |    2 +
+ debug/Makefile                          |   41 +-
+ debug/segfault.c                        |   11 +-
+ debug/tst-chk1.c                        |    7 +
+ dlfcn/Makefile                          |    7 +-
+ elf/dl-support.c                        |    3 +
+ elf/rtld.c                              |   17 +-
+ extra-lib.mk                            |    6 +-
+ grp/Makefile                            |    5 +
+ hesiod/Makefile                         |    6 +-
+ iconv/Makefile                          |    7 +
+ iconv/gconv_db.c                        |    3 +
+ iconv/gconv_trans.c                     |    7 +
+ iconv/iconv_prog.c                      |    8 +
+ iconvdata/Makefile                      |   27 +-
+ include/netdb.h                         |    4 +
+ inet/Makefile                           |   22 +-
+ intl/Makefile                           |    3 +-
+ intl/dcigettext.c                       |   39 +-
+ io/Makefile                             |   18 +-
+ libidn/Makefile                         |    5 +-
+ libidn/toutf8.c                         |   11 +-
+ libio/Makefile                          |   66 +-
+ libio/__fpurge.c                        |    2 +-
+ libio/fileops.c                         |   10 +-
+ libio/iofwide.c                         |   26 +
+ libio/ioseekoff.c                       |    2 +-
+ libio/ioseekpos.c                       |    2 +-
+ libio/iosetbuffer.c                     |    4 +
+ libio/libioP.h                          |   18 +-
+ libio/wdummyfileops.c                   |  161 +
+ locale/C-ctype.c                        |   20 +
+ locale/Makefile                         |   41 +-
+ locale/catnames.c                       |   48 +
+ locale/dummy-setlocale.c                |   33 +
+ locale/localeinfo.h                     |    2 +-
+ locale/programs/charmap-dir.c           |    6 +
+ locale/programs/ld-collate.c            |   17 +-
+ locale/programs/ld-ctype.c              |   27 +-
+ locale/programs/ld-messages.c           |    5 +
+ locale/programs/ld-time.c               |   31 +-
+ locale/programs/linereader.c            |    2 +-
+ locale/programs/localedef.c             |    8 +
+ locale/programs/locfile.c               |    5 +-
+ locale/programs/locfile.h               |   59 +-
+ locale/setlocale.c                      |   30 -
+ locale/xlocale.c                        |   37 +
+ localedata/Makefile                     |   35 +-
+ login/Makefile                          |   17 +-
+ malloc/Makefile                         |   10 +-
+ malloc/memusage.c                       |    7 +-
+ malloc/memusage.sh                      |    2 +-
+ math/Makefile                           |    6 +-
+ misc/Makefile                           |   25 +-
+ misc/err.c                              |   11 +
+ misc/error.c                            |    5 +
+ misc/tst-efgcvt.c                       |    2 +-
+ nis/Makefile                            |   31 +-
+ nptl/Makefile                           |   28 +-
+ nptl/pthread_create.c                   |    5 +
+ nscd/Makefile                           |   33 +-
+ nscd/nis_hash.c                         |    3 +
+ nss/Makefile                            |   67 +-
+ nss/fixed-nsswitch.conf                 |   22 +
+ nss/fixed-nsswitch.functions            |  121 +
+ nss/gen-fixed-nsswitch.c                |  803 +++
+ nss/getent.c                            |   46 +-
+ nss/getnssent_r.c                       |    9 +-
+ nss/nsswitch.c                          |  109 +-
+ nss/nsswitch.h                          |   18 +-
+ posix/Makefile                          |   94 +-
+ posix/bug-regex1.c                      |    3 +
+ posix/bug-regex6.c                      |    8 +-
+ posix/fnmatch.c                         |    6 +-
+ posix/fnmatch_loop.c                    |   23 +-
+ posix/glob.c                            |   15 +-
+ posix/regcomp.c                         |   98 +-
+ posix/regex.h                           |   11 +
+ posix/regex_internal.c                  |   45 +-
+ posix/regex_internal.h                  |   23 +-
+ posix/regexec-compat.c                  |   39 +
+ posix/regexec.c                         |   71 +-
+ posix/xregex.c                          | 8215 +++++++++++++++++++++++++++++++
+ pwd/Makefile                            |    2 +
+ resolv/Makefile                         |   21 +-
+ stdio-common/Makefile                   |   35 +-
+ stdio-common/_i18n_number.h             |   13 +
+ stdio-common/fxprintf.c                 |    5 +
+ stdio-common/printf_fp.c                |   22 +
+ stdio-common/printf_fphex.c             |   13 +
+ stdio-common/printf_size.c              |    8 +
+ stdio-common/scanf14.c                  |    3 +
+ stdio-common/tst-popen.c                |    3 +
+ stdio-common/tst-sprintf.c              |    4 +-
+ stdio-common/tstdiomisc.c               |    5 +
+ stdio-common/vfprintf.c                 |   31 +-
+ stdio-common/vfscanf.c                  |   53 +-
+ stdlib/Makefile                         |   34 +-
+ stdlib/strtod_l.c                       |   13 +
+ stdlib/tst-strtod.c                     |    5 +
+ streams/Makefile                        |    5 +-
+ string/Makefile                         |   14 +-
+ string/strcoll_l.c                      |    5 +
+ string/strerror_l.c                     |    5 +
+ string/strxfrm_l.c                      |    5 +
+ string/test-strcmp.c                    |   28 -
+ string/tst-strxfrm.c                    |    3 +
+ string/tst-strxfrm2.c                   |    3 +
+ sunrpc/Makefile                         |   44 +-
+ sysdeps/arm/Makefile                    |    5 +-
+ sysdeps/generic/ldsodefs.h              |    8 +
+ sysdeps/gnu/Makefile                    |    3 +-
+ sysdeps/ieee754/ldbl-opt/Makefile       |   27 +-
+ sysdeps/ieee754/ldbl-opt/nldbl-compat.c |   40 +-
+ sysdeps/ieee754/ldbl-opt/nldbl-compat.h |   24 +-
+ sysdeps/nptl/Makefile                   |    3 +
+ sysdeps/nptl/bits/libc-lock.h           |   45 +
+ sysdeps/nptl/bits/libc-lockP.h          |   50 +-
+ sysdeps/nptl/small-macros-fns.c         |   72 +
+ sysdeps/unix/sysv/linux/gethostid.c     |    6 +
+ sysdeps/unix/sysv/linux/libc_fatal.c    |    3 +
+ time/Makefile                           |   18 +-
+ time/strftime_l.c                       |   12 +-
+ time/strptime_l.c                       |   14 +-
+ timezone/Makefile                       |    2 +-
+ wcsmbs/Makefile                         |   27 +-
+ wcsmbs/wcsmbsload.c                     |   13 +
+ wctype/Makefile                         |   14 +-
+ 139 files changed, 11363 insertions(+), 583 deletions(-)
+ create mode 100644 crypt/crypt_common.c
+ create mode 100644 libio/wdummyfileops.c
+ create mode 100644 locale/catnames.c
+ create mode 100644 locale/dummy-setlocale.c
+ create mode 100644 nscd/nis_hash.c
+ create mode 100644 nss/fixed-nsswitch.conf
+ create mode 100644 nss/fixed-nsswitch.functions
+ create mode 100644 nss/gen-fixed-nsswitch.c
+ create mode 100644 posix/regexec-compat.c
+ create mode 100644 posix/xregex.c
+ create mode 100644 sysdeps/nptl/small-macros-fns.c
+
+diff --git a/Makeconfig b/Makeconfig
+index f136b88..52dae8f 100644
+--- a/Makeconfig
++++ b/Makeconfig
+@@ -609,7 +609,7 @@ elf-objpfx = $(common-objpfx)elf/
+ # and run on the build system, causes that program with those
+ # arguments to be run on the host for which the library is built.
+ ifndef test-wrapper
+-test-wrapper =
++test-wrapper = $(cross-test-wrapper)
+ endif
+ # Likewise, but the name of the program is preceded by
+ # <variable>=<value> assignments for environment variables.
+@@ -1089,6 +1089,24 @@ libm = $(common-objpfx)math/libm.a
+ libmvec = $(common-objpfx)mathvec/libmvec.a
+ endif
+ 
++# Generate a header file that #defines preprocessor symbols indicating
++# which option groups are enabled.  Note that the option-groups.config file
++# may not exist at all.
++before-compile += $(common-objpfx)gnu/option-groups.h
++common-generated += gnu/option-groups.h gnu/option-groups.stmp
++headers += gnu/option-groups.h
++$(common-objpfx)gnu/option-groups.h: $(common-objpfx)gnu/option-groups.stmp; @:
++$(common-objpfx)gnu/option-groups.stmp:					\
++		$(..)scripts/option-groups.awk				\
++		$(..)option-groups.defaults				\
++		$(wildcard $(common-objpfx)option-groups.config)
++	$(make-target-directory)
++	@rm -f ${@:stmp=T} $@
++	LC_ALL=C $(AWK) -f $^ > ${@:stmp=T}
++	$(move-if-change) ${@:stmp=T} ${@:stmp=h}
++	touch $@
++
++
+ # These are the subdirectories containing the library source.  The order
+ # is more or less arbitrary.  The sorting step will take care of the
+ # dependencies.
+diff --git a/Makerules b/Makerules
+index f9ca3f5..1dd41aa 100644
+--- a/Makerules
++++ b/Makerules
+@@ -456,6 +456,25 @@ define sed-remove-objpfx
+ endef
+ endif
+ 
++# Include targets in the selected option groups.
++aux                  += $(aux-y)
++extra-libs           += $(extra-libs-y)
++extra-libs-others    += $(extra-libs-others-y)
++extra-objs           += $(extra-objs-y)
++install-bin          += $(install-bin-y)
++install-others       += $(install-others-y)
++install-sbin         += $(install-sbin-y)
++modules              += $(modules-y)
++others               += $(others-y)
++others-pie           += $(others-pie-y)
++routines             += $(routines-y)
++static-only-routines += $(static-only-routines-y)
++sysdep_routines      += $(sysdep_routines-y)
++test-srcs            += $(test-srcs-y)
++tests                += $(tests-y)
++xtests               += $(xtests-y)
++
++
+ # Modify the list of routines we build for different targets
+ 
+ ifeq (yes,$(build-shared))
+diff --git a/argp/Makefile b/argp/Makefile
+index 1a87629..f7c1e40 100644
+--- a/argp/Makefile
++++ b/argp/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Makefile for argp.
+ #
++include ../option-groups.mak
++
+ subdir	:= argp
+ 
+ include ../Makeconfig
+diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c
+index 2b845e0..c344e7b 100644
+--- a/argp/argp-fmtstream.c
++++ b/argp/argp-fmtstream.c
+@@ -42,6 +42,7 @@
+ #ifdef _LIBC
+ # include <wchar.h>
+ # include <libio/libioP.h>
++# include <gnu/option-groups.h>
+ # define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
+ #endif
+ 
+@@ -100,7 +101,11 @@ __argp_fmtstream_free (argp_fmtstream_t fs)
+   __argp_fmtstream_update (fs);
+   if (fs->p > fs->buf)
+     {
++#ifdef _LIBC
+       __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
++#else
++      fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
++#endif
+     }
+   free (fs->buf);
+   free (fs);
+@@ -145,9 +150,17 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
+ 	      size_t i;
+ 	      for (i = 0; i < pad; i++)
+ 		{
++#ifdef _LIBC
+ 		  if (_IO_fwide (fs->stream, 0) > 0)
+-		    putwc_unlocked (L' ', fs->stream);
++                    {
++#if ! _LIBC || __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
++                      putwc_unlocked (L' ', fs->stream);
++#else
++                      abort ();
++#endif
++                    }
+ 		  else
++#endif
+ 		    putc_unlocked (' ', fs->stream);
+ 		}
+ 	    }
+@@ -308,9 +321,17 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
+ 	      *nl++ = ' ';
+ 	  else
+ 	    for (i = 0; i < fs->wmargin; ++i)
++#ifdef _LIBC
+ 	      if (_IO_fwide (fs->stream, 0) > 0)
+-		putwc_unlocked (L' ', fs->stream);
++                {
++#ifdef OPTION_POSIX_WIDE_CHAR_DEVICE_IO
++                  putwc_unlocked (L' ', fs->stream);
++#else
++                  abort ();
++#endif
++                }
+ 	      else
++#endif
+ 		putc_unlocked (' ', fs->stream);
+ 
+ 	  /* Copy the tail of the original buffer into the current buffer
+diff --git a/argp/argp-help.c b/argp/argp-help.c
+index b055e45..6b3c4c1 100644
+--- a/argp/argp-help.c
++++ b/argp/argp-help.c
+@@ -51,6 +51,7 @@ char *alloca ();
+ #ifdef _LIBC
+ # include <../libio/libioP.h>
+ # include <wchar.h>
++# include <gnu/option-groups.h>
+ #endif
+ 
+ #ifndef _
+@@ -1702,7 +1703,7 @@ char *__argp_basename (char *name)
+ }
+ 
+ char *
+-__argp_short_program_name (void)
++(__argp_short_program_name) (void)
+ {
+ # if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+   return program_invocation_short_name;
+@@ -1873,9 +1874,17 @@ __argp_failure (const struct argp_state *state, int status, int errnum,
+ #endif
+ 	    }
+ 
++#ifdef _LIBC
+ 	  if (_IO_fwide (stream, 0) > 0)
+-	    putwc_unlocked (L'\n', stream);
++            {
++#if ! _LIBC || __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
++              putwc_unlocked (L'\n', stream);
++#else
++              abort ();
++#endif
++            }
+ 	  else
++#endif
+ 	    putc_unlocked ('\n', stream);
+ 
+ #if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
+diff --git a/argp/argp-namefrob.h b/argp/argp-namefrob.h
+index f67c58f..e2002dc 100644
+--- a/argp/argp-namefrob.h
++++ b/argp/argp-namefrob.h
+@@ -76,10 +76,12 @@
+ #undef __argp_fmtstream_wmargin
+ #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
+ 
++#if 0
+ #include "mempcpy.h"
+ #include "strcase.h"
+ #include "strchrnul.h"
+ #include "strndup.h"
++#endif
+ 
+ /* normal libc functions we call */
+ #undef __flockfile
+diff --git a/catgets/Makefile b/catgets/Makefile
+index 4624a88..05714fd 100644
+--- a/catgets/Makefile
++++ b/catgets/Makefile
+@@ -22,20 +22,23 @@ subdir	:= catgets
+ 
+ include ../Makeconfig
+ 
++include ../option-groups.mak
++
+ headers		= nl_types.h
+-routines	= catgets open_catalog
+-others		= gencat
+-install-bin	= gencat
+-extra-objs	= $(gencat-modules:=.o)
++routines-$(OPTION_EGLIBC_CATGETS)    := catgets open_catalog
++others-$(OPTION_EGLIBC_CATGETS)      := gencat
++install-bin-$(OPTION_EGLIBC_CATGETS) := gencat
++extra-objs-$(OPTION_EGLIBC_CATGETS)  := $(gencat-modules:=.o)
+ 
+-tests = tst-catgets
+-test-srcs = test-gencat
++tests-$(OPTION_EGLIBC_CATGETS)       := tst-catgets
++test-srcs-$(OPTION_EGLIBC_CATGETS)   := test-gencat
+ 
++ifeq (y,$(OPTION_EGLIBC_CATGETS))
+ ifeq ($(run-built-tests),yes)
+ tests-special += $(objpfx)de/libc.cat $(objpfx)test1.cat $(objpfx)test2.cat \
+ 		 $(objpfx)sample.SJIS.cat $(objpfx)test-gencat.out
+ endif
+-
++endif
+ gencat-modules	= xmalloc
+ 
+ # To find xmalloc.c
+diff --git a/crypt/Makefile b/crypt/Makefile
+index 34c4dd7..7c18c88 100644
+--- a/crypt/Makefile
++++ b/crypt/Makefile
+@@ -18,21 +18,25 @@
+ #
+ #	Sub-makefile for crypt() portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= crypt
+ 
+ include ../Makeconfig
+ 
+ headers := crypt.h
+ 
+-extra-libs := libcrypt
+-extra-libs-others := $(extra-libs)
++extra-libs-$(OPTION_EGLIBC_CRYPT) := libcrypt
++extra-libs-others-y := $(extra-libs-y)
+ 
+-libcrypt-routines := crypt-entry md5-crypt sha256-crypt sha512-crypt crypt \
+-		     crypt_util
++libcrypt-routines :=crypt-entry  md5-crypt sha256-crypt sha512-crypt crypt_common
++libcrypt-routines-$(OPTION_EGLIBC_CRYPT_UFC) := crypt crypt_util
++libcrypt-routines += $(libcrypt-routines-y)
+ 
+-tests := cert md5c-test sha256c-test sha512c-test badsalttest
++tests-$(OPTION_EGLIBC_CRYPT) := md5c-test sha256c-test sha512c-test badsalttest
++tests-$(OPTION_EGLIBC_CRYPT_UFC) += cert
+ 
+-ifeq ($(crypt-in-libc),yes)
++ifeq ($(crypt-in-libc)$(OPTION_EGLIBC_CRYPT),yesy)
+ routines += $(libcrypt-routines)
+ endif
+ 
+@@ -44,7 +48,7 @@ LDLIBS-crypt.so = -lfreebl3
+ else
+ libcrypt-routines += md5 sha256 sha512
+ 
+-tests += md5test sha256test sha512test
++tests-$(OPTION_EGLIBC_CRYPT) += md5test sha256test sha512test
+ 
+ # The test md5test-giant uses up to 400 MB of RSS and runs on a fast
+ # machine over a minute.
+@@ -64,8 +68,10 @@ $(objpfx)sha256test: $(patsubst %, $(objpfx)%.o,$(sha256-routines))
+ $(objpfx)sha512test: $(patsubst %, $(objpfx)%.o,$(sha512-routines))
+ endif
+ 
++ifeq ($(OPTION_EGLIBC_CRYPT),y)
+ ifeq (yes,$(build-shared))
+ $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.so
+ else
+ $(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.a
+ endif
++endif # eglibc: OPTION_EGLIBC_CRYPT
+diff --git a/crypt/crypt-entry.c b/crypt/crypt-entry.c
+index 7e655ba..6ae5c2b 100644
+--- a/crypt/crypt-entry.c
++++ b/crypt/crypt-entry.c
+@@ -27,6 +27,7 @@
+ #include <stdio.h>
+ #endif
+ #include <string.h>
++#include <gnu/option-groups.h>
+ #include <errno.h>
+ #include <fips-private.h>
+ 
+@@ -76,9 +77,11 @@ __crypt_r (key, salt, data)
+      const char *salt;
+      struct crypt_data * __restrict data;
+ {
++#if __OPTION_EGLIBC_CRYPT_UFC
+   ufc_long res[4];
+   char ktab[9];
+   ufc_long xx = 25; /* to cope with GCC long long compiler bugs */
++#endif /*__OPTION_EGLIBC_CRYPT_UFC*/
+ 
+ #ifdef _LIBC
+   /* Try to find out whether we have to use MD5 encryption replacement.  */
+@@ -105,6 +108,7 @@ __crypt_r (key, salt, data)
+ 			     sizeof (struct crypt_data));
+ #endif
+ 
++#if __OPTION_EGLIBC_CRYPT_UFC
+   /*
+    * Hack DES tables according to salt
+    */
+@@ -144,6 +148,10 @@ __crypt_r (key, salt, data)
+    */
+   _ufc_output_conversion_r (res[0], res[1], salt, data);
+   return data->crypt_3_buf;
++#else /* __OPTION_EGLIBC_CRYPT_UFC */
++  __set_errno (ENOSYS);
++  return NULL;
++#endif /* __OPTION_EGLIBC_CRYPT_UFC */
+ }
+ weak_alias (__crypt_r, crypt_r)
+ 
+@@ -168,7 +176,12 @@ crypt (key, salt)
+     return __sha512_crypt (key, salt);
+ #endif
+ 
++#if __OPTION_EGLIBC_CRYPT_UFC
+   return __crypt_r (key, salt, &_ufc_foobar);
++#else /* __OPTION_EGLIBC_CRYPT_UFC */
++  __set_errno (ENOSYS);
++  return NULL;
++#endif /* __OPTION_EGLIBC_CRYPT_UFC */
+ }
+ 
+ 
+diff --git a/crypt/crypt_common.c b/crypt/crypt_common.c
+new file mode 100644
+index 0000000..cce6a31
+--- /dev/null
++++ b/crypt/crypt_common.c
+@@ -0,0 +1,42 @@
++/*
++ * crypt: crypt(3) implementation
++ *
++ * Copyright (C) 1991-2014 Free Software Foundation, Inc.
++ *
++ * This library is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU Lesser General Public
++ * License as published by the Free Software Foundation; either
++ * version 2.1 of the License, or (at your option) any later version.
++ *
++ * This library is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * Lesser General Public License for more details.
++ *
++ * You should have received a copy of the GNU Lesser General Public
++ * License along with this library; see the file COPYING.LIB.  If not,
++ * see <http://www.gnu.org/licenses/>.
++ *
++ * General Support routines
++ *
++ */
++
++#include "crypt-private.h"
++
++/* Table with characters for base64 transformation.  */
++static const char b64t[64] =
++"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
++
++void
++__b64_from_24bit (char **cp, int *buflen,
++		  unsigned int b2, unsigned int b1, unsigned int b0,
++		  int n)
++{
++  unsigned int w = (b2 << 16) | (b1 << 8) | b0;
++  while (n-- > 0 && (*buflen) > 0)
++    {
++      *(*cp)++ = b64t[w & 0x3f];
++      --(*buflen);
++      w >>= 6;
++    }
++}
+diff --git a/crypt/crypt_util.c b/crypt/crypt_util.c
+index 1597885..9297974 100644
+--- a/crypt/crypt_util.c
++++ b/crypt/crypt_util.c
+@@ -242,10 +242,6 @@ static ufc_long eperm32tab[4][256][2];
+  */
+ static ufc_long efp[16][64][2];
+ 
+-/* Table with characters for base64 transformation.  */
+-static const char b64t[64] =
+-"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+-
+ /*
+  * For use by the old, non-reentrant routines
+  * (crypt/encrypt/setkey)
+@@ -949,17 +945,3 @@ setkey(__key)
+ {
+   __setkey_r(__key, &_ufc_foobar);
+ }
+-
+-void
+-__b64_from_24bit (char **cp, int *buflen,
+-		  unsigned int b2, unsigned int b1, unsigned int b0,
+-		  int n)
+-{
+-  unsigned int w = (b2 << 16) | (b1 << 8) | b0;
+-  while (n-- > 0 && (*buflen) > 0)
+-    {
+-      *(*cp)++ = b64t[w & 0x3f];
+-      --(*buflen);
+-      w >>= 6;
+-    }
+-}
+diff --git a/csu/Makefile b/csu/Makefile
+index 9f0855a..b1c3363 100644
+--- a/csu/Makefile
++++ b/csu/Makefile
+@@ -22,6 +22,8 @@
+ # crtn.o, special "initializer" and "finalizer" files used in the link
+ # to make the .init and .fini sections work right.
+ 
++include ../option-groups.mak
++
+ subdir := csu
+ 
+ include ../Makeconfig
+diff --git a/debug/Makefile b/debug/Makefile
+index 9ff357b..d23d97d 100644
+--- a/debug/Makefile
++++ b/debug/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Sub-makefile for debug portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= debug
+ 
+ include ../Makeconfig
+@@ -27,7 +29,7 @@ headers	:= execinfo.h
+ # Note that ptsname_r_chk and getlogin_r are not here, but in
+ # login/Makefile instead.  If that subdir is omitted from the
+ # build, its _FORTIFY_SOURCE support will be too.
+-routines  = backtrace backtracesyms backtracesymsfd noophooks \
++routines  = noophooks \
+ 	    memcpy_chk memmove_chk mempcpy_chk memset_chk stpcpy_chk \
+ 	    strcat_chk strcpy_chk strncat_chk strncpy_chk stpncpy_chk \
+ 	    sprintf_chk vsprintf_chk snprintf_chk vsnprintf_chk \
+@@ -36,20 +38,27 @@ routines  = backtrace backtracesyms backtracesymsfd noophooks \
+ 	    read_chk pread_chk pread64_chk recv_chk recvfrom_chk \
+ 	    readlink_chk readlinkat_chk getwd_chk getcwd_chk \
+ 	    realpath_chk fread_chk fread_u_chk \
+-	    wctomb_chk wcscpy_chk wmemcpy_chk wmemmove_chk wmempcpy_chk \
+-	    wcpcpy_chk wcsncpy_chk wcscat_chk wcsncat_chk wmemset_chk \
+-	    wcpncpy_chk \
+-	    swprintf_chk vswprintf_chk wprintf_chk fwprintf_chk \
+-	    vwprintf_chk vfwprintf_chk fgetws_chk fgetws_u_chk \
+ 	    confstr_chk getgroups_chk ttyname_r_chk \
+-	    gethostname_chk getdomainname_chk wcrtomb_chk mbsnrtowcs_chk \
+-	    wcsnrtombs_chk mbsrtowcs_chk wcsrtombs_chk mbstowcs_chk \
+-	    wcstombs_chk asprintf_chk vasprintf_chk dprintf_chk \
++	    gethostname_chk getdomainname_chk \
++	    asprintf_chk vasprintf_chk dprintf_chk \
+ 	    vdprintf_chk obprintf_chk \
+ 	    longjmp_chk ____longjmp_chk \
+ 	    fdelt_chk poll_chk ppoll_chk \
+ 	    stack_chk_fail fortify_fail \
+ 	    $(static-only-routines)
++routines-$(OPTION_EGLIBC_BACKTRACE) += backtrace backtracesyms backtracesymsfd
++routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO)			\
++	 += wprintf_chk fwprintf_chk				\
++	    vwprintf_chk vfwprintf_chk fgetws_chk fgetws_u_chk
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR)				\
++	 += wctomb_chk wcscpy_chk wmemcpy_chk wmemmove_chk wmempcpy_chk	\
++	    wcpcpy_chk wcsncpy_chk wcscat_chk wcsncat_chk wmemset_chk	\
++	    wcpncpy_chk							\
++	    swprintf_chk vswprintf_chk					\
++	    wcrtomb_chk mbsnrtowcs_chk					\
++	    wcsnrtombs_chk mbsrtowcs_chk wcsrtombs_chk mbstowcs_chk	\
++	    wcstombs_chk
++
+ static-only-routines := warning-nop stack_chk_fail_local
+ 
+ CFLAGS-backtrace.c = -fno-omit-frame-pointer
+@@ -131,11 +140,15 @@ LDFLAGS-tst-backtrace4 = -rdynamic
+ LDFLAGS-tst-backtrace5 = -rdynamic
+ LDFLAGS-tst-backtrace6 = -rdynamic
+ 
+-tests = backtrace-tst tst-longjmp_chk tst-chk1 tst-chk2 tst-chk3 \
+-	tst-lfschk1 tst-lfschk2 tst-lfschk3 test-strcpy_chk test-stpcpy_chk \
+-	tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6 \
+-	tst-longjmp_chk2 tst-backtrace2 tst-backtrace3 tst-backtrace4 \
+-	tst-backtrace5 tst-backtrace6
++tests = tst-longjmp_chk test-strcpy_chk test-stpcpy_chk tst-longjmp_chk2
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++      += tst-chk1 tst-chk2 tst-chk3 tst-lfschk1 tst-lfschk2 tst-lfschk3
++tests-$(OPTION_EGLIBC_BACKTRACE) \
++      += backtrace-tst tst-backtrace2 tst-backtrace3 tst-backtrace4 \
++         tst-backtrace5 tst-backtrace6
++ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_EGLIBC_CXX_TESTS))
++tests += tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6
++endif
+ 
+ ifeq (,$(CXX))
+ tests-unsupported = tst-chk4 tst-chk5 tst-chk6 \
+diff --git a/debug/segfault.c b/debug/segfault.c
+index 3459a2a..ee9a146 100644
+--- a/debug/segfault.c
++++ b/debug/segfault.c
+@@ -30,6 +30,7 @@
+ #include <unistd.h>
+ #include <_itoa.h>
+ #include <ldsodefs.h>
++#include <gnu/option-groups.h>
+ 
+ /* This file defines macros to access the content of the sigcontext element
+    passed up by the signal handler.  */
+@@ -68,11 +69,13 @@ write_strsignal (int fd, int signal)
+ static void
+ catch_segfault (int signal, SIGCONTEXT ctx)
+ {
+-  int fd, cnt, i;
+-  void **arr;
++  int fd;
+   struct sigaction sa;
++#if __OPTION_EGLIBC_BACKTRACE
++  int cnt, i;
++  void **arr;
+   uintptr_t pc;
+-
++#endif
+   /* This is the name of the file we are writing to.  If none is given
+      or we cannot write to this file write to stderr.  */
+   fd = 2;
+@@ -91,6 +94,7 @@ catch_segfault (int signal, SIGCONTEXT ctx)
+   REGISTER_DUMP;
+ #endif
+ 
++#if __OPTION_EGLIBC_BACKTRACE
+   WRITE_STRING ("\nBacktrace:\n");
+ 
+   /* Get the backtrace.  */
+@@ -113,6 +117,7 @@ catch_segfault (int signal, SIGCONTEXT ctx)
+ 
+   /* Now generate nicely formatted output.  */
+   __backtrace_symbols_fd (arr + i, cnt - i, fd);
++#endif
+ 
+ #ifdef HAVE_PROC_SELF
+   /* Now the link map.  */
+diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c
+index 53559e6..362d92a 100644
+--- a/debug/tst-chk1.c
++++ b/debug/tst-chk1.c
+@@ -31,6 +31,7 @@
+ #include <sys/select.h>
+ #include <sys/socket.h>
+ #include <sys/un.h>
++#include <gnu/option-groups.h>
+ 
+ 
+ #define obstack_chunk_alloc malloc
+@@ -307,6 +308,7 @@ do_test (void)
+   snprintf (buf + 8, l0 + 3, "%d", num2);
+   CHK_FAIL_END
+ 
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+   CHK_FAIL_START
+   swprintf (wbuf + 8, 3, L"%d", num1);
+   CHK_FAIL_END
+@@ -314,6 +316,7 @@ do_test (void)
+   CHK_FAIL_START
+   swprintf (wbuf + 8, l0 + 3, L"%d", num1);
+   CHK_FAIL_END
++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
+ # endif
+ 
+   memcpy (buf, str1 + 2, l0 + 9);
+@@ -381,6 +384,7 @@ do_test (void)
+   CHK_FAIL_END
+ #endif
+ 
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+ 
+   /* These ops can be done without runtime checking of object size.  */
+   wmemcpy (wbuf, L"abcdefghij", 10);
+@@ -605,6 +609,7 @@ do_test (void)
+   CHK_FAIL_END
+ #endif
+ 
++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
+ 
+   /* Now checks for %n protection.  */
+ 
+@@ -1192,6 +1197,7 @@ do_test (void)
+ # endif
+ #endif
+ 
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+   if (setlocale (LC_ALL, "de_DE.UTF-8") != NULL)
+     {
+       assert (MB_CUR_MAX <= 10);
+@@ -1348,6 +1354,7 @@ do_test (void)
+       puts ("cannot set locale");
+       ret = 1;
+     }
++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
+ 
+   int fd = posix_openpt (O_RDWR);
+   if (fd != -1)
+diff --git a/dlfcn/Makefile b/dlfcn/Makefile
+index 759780d..3827607 100644
+--- a/dlfcn/Makefile
++++ b/dlfcn/Makefile
+@@ -15,6 +15,8 @@
+ # License along with the GNU C Library; if not, see
+ # <http://www.gnu.org/licenses/>.
+ 
++include ../option-groups.mak
++
+ subdir		:= dlfcn
+ 
+ include ../Makeconfig
+@@ -36,8 +38,11 @@ endif
+ ifeq (yes,$(build-shared))
+ tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
+ 	bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \
+-	bug-atexit3 tstatexit bug-dl-leaf tst-rec-dlopen
++	tstatexit bug-dl-leaf tst-rec-dlopen
+ endif
++
++tests-$(OPTION_EGLIBC_CXX_TESTS) += bug-atexit3
++
+ modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \
+ 		defaultmod2 errmsg1mod modatexit modcxaatexit \
+ 		bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \
+diff --git a/elf/dl-support.c b/elf/dl-support.c
+index 4d036f1..c15f405 100644
+--- a/elf/dl-support.c
++++ b/elf/dl-support.c
+@@ -19,6 +19,7 @@
+ /* This file defines some things that for the dynamic linker are defined in
+    rtld.c and dl-sysdep.c in ways appropriate to bootstrap dynamic linking.  */
+ 
++#include <gnu/option-groups.h>
+ #include <errno.h>
+ #include <libintl.h>
+ #include <stdlib.h>
+@@ -42,7 +43,9 @@ char **_dl_argv = &__progname;	/* This is checked for some error messages.  */
+ const char *_dl_platform;
+ size_t _dl_platformlen;
+ 
++#if __OPTION_EGLIBC_RTLD_DEBUG
+ int _dl_debug_mask;
++#endif
+ int _dl_lazy;
+ ElfW(Addr) _dl_use_load_bias = -2;
+ int _dl_dynamic_weak;
+diff --git a/elf/rtld.c b/elf/rtld.c
+index 6d3add7..fc3a2db 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -16,6 +16,7 @@
+    License along with the GNU C Library; if not, see
+    <http://www.gnu.org/licenses/>.  */
+ 
++#include <gnu/option-groups.h>
+ #include <errno.h>
+ #include <dlfcn.h>
+ #include <fcntl.h>
+@@ -2201,6 +2202,7 @@ print_missing_version (int errcode __attribute__ ((unused)),
+ 		    objname, errstring);
+ }
+ 
++#if __OPTION_EGLIBC_RTLD_DEBUG
+ /* Nonzero if any of the debugging options is enabled.  */
+ static int any_debug attribute_relro;
+ 
+@@ -2310,6 +2312,7 @@ a filename can be specified using the LD_DEBUG_OUTPUT environment variable.\n");
+       _exit (0);
+     }
+ }
++#endif /* __OPTION_EGLIBC_RTLD_DEBUG */
+ 
+ static void
+ process_dl_audit (char *str)
+@@ -2349,8 +2352,9 @@ process_envvars (enum mode *modep)
+   char **runp = _environ;
+   char *envline;
+   enum mode mode = normal;
++#if __OPTION_EGLIBC_RTLD_DEBUG
+   char *debug_output = NULL;
+-
++#endif
+   /* This is the default place for profiling data file.  */
+   GLRO(dl_profile_output)
+     = &"/var/tmp\0/var/profile"[__libc_enable_secure ? 9 : 0];
+@@ -2377,12 +2381,14 @@ process_envvars (enum mode *modep)
+ 	  break;
+ 
+ 	case 5:
++#if __OPTION_EGLIBC_RTLD_DEBUG
+ 	  /* Debugging of the dynamic linker?  */
+ 	  if (memcmp (envline, "DEBUG", 5) == 0)
+ 	    {
+ 	      process_dl_debug (&envline[6]);
+ 	      break;
+ 	    }
++#endif
+ 	  if (memcmp (envline, "AUDIT", 5) == 0)
+ 	    process_dl_audit (&envline[6]);
+ 	  break;
+@@ -2448,13 +2454,14 @@ process_envvars (enum mode *modep)
+ 	      break;
+ 	    }
+ 
++#if __OPTION_EGLIBC_RTLD_DEBUG
+ 	  /* Where to place the profiling data file.  */
+ 	  if (memcmp (envline, "DEBUG_OUTPUT", 12) == 0)
+ 	    {
+ 	      debug_output = &envline[13];
+ 	      break;
+ 	    }
+-
++#endif
+ 	  if (!__libc_enable_secure
+ 	      && memcmp (envline, "DYNAMIC_WEAK", 12) == 0)
+ 	    GLRO(dl_dynamic_weak) = 1;
+@@ -2491,7 +2498,9 @@ process_envvars (enum mode *modep)
+ 	    {
+ 	      mode = trace;
+ 	      GLRO(dl_verbose) = 1;
++#if __OPTION_EGLIBC_RTLD_DEBUG
+ 	      GLRO(dl_debug_mask) |= DL_DEBUG_PRELINK;
++#endif
+ 	      GLRO(dl_trace_prelink) = &envline[17];
+ 	    }
+ 	  break;
+@@ -2538,12 +2547,15 @@ process_envvars (enum mode *modep)
+       if (__access ("/etc/suid-debug", F_OK) != 0)
+ 	{
+ 	  unsetenv ("MALLOC_CHECK_");
++#if __OPTION_EGLIBC_RTLD_DEBUG
+ 	  GLRO(dl_debug_mask) = 0;
++#endif
+ 	}
+ 
+       if (mode != normal)
+ 	_exit (5);
+     }
++#if __OPTION_EGLIBC_RTLD_DEBUG
+   /* If we have to run the dynamic linker in debugging mode and the
+      LD_DEBUG_OUTPUT environment variable is given, we write the debug
+      messages to this file.  */
+@@ -2568,6 +2580,7 @@ process_envvars (enum mode *modep)
+ 	/* We use standard output if opening the file failed.  */
+ 	GLRO(dl_debug_fd) = STDOUT_FILENO;
+     }
++#endif /* __OPTION_EGLIBC_RTLD_DEBUG */
+ }
+ 
+ 
+diff --git a/extra-lib.mk b/extra-lib.mk
+index b10748d..d71a06f 100644
+--- a/extra-lib.mk
++++ b/extra-lib.mk
+@@ -25,7 +25,9 @@ install-lib := $(install-lib)
+ extra-objs := $(extra-objs)
+ 
+ # The modules that go in $(lib).
+-all-$(lib)-routines := $($(lib)-routines) $($(lib)-sysdep_routines)
++all-$(lib)-routines := $($(lib)-routines)		\
++	               $($(lib)-routines-y)		\
++		       $($(lib)-sysdep_routines)
+ 
+ # Add each flavor of library to the lists of things to build and install.
+ install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o)))
+@@ -101,7 +103,7 @@ endif
+ endif
+ 
+ # This will define `libof-ROUTINE := LIB' for each of the routines.
+-cpp-srcs-left := $($(lib)-routines) $($(lib)-sysdep_routines)
++cpp-srcs-left := $(all-$(lib)-routines)
+ ifneq (,$(cpp-srcs-left))
+ include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+ endif
+diff --git a/grp/Makefile b/grp/Makefile
+index c63b552..7486f32 100644
+--- a/grp/Makefile
++++ b/grp/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Sub-makefile for grp portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= grp
+ 
+ include ../Makeconfig
+@@ -29,6 +31,9 @@ routines := fgetgrent initgroups setgroups \
+ 	    getgrent_r getgrgid_r getgrnam_r fgetgrent_r
+ 
+ tests := testgrp
++ifneq (y,$(OPTION_EGLIBC_NSSWITCH))
++LDLIBS-testgrp += $(shell cat $(common-objpfx)nss/fixed-nsswitch-libs)
++endif
+ 
+ ifeq (yes,$(build-shared))
+ test-srcs :=  tst_fgetgrent
+diff --git a/hesiod/Makefile b/hesiod/Makefile
+index ac0bc01..38263b4 100644
+--- a/hesiod/Makefile
++++ b/hesiod/Makefile
+@@ -18,12 +18,14 @@
+ #
+ #	Sub-makefile for hesiod portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= hesiod
+ 
+ include ../Makeconfig
+ 
+-extra-libs := libnss_hesiod
+-extra-libs-others = $(extra-libs)
++extra-libs-$(OPTION_EGLIBC_INET) += libnss_hesiod
++extra-libs-others-y += $(extra-libs-y)
+ 
+ subdir-dirs = nss_hesiod
+ vpath %.c nss_hesiod
+diff --git a/iconv/Makefile b/iconv/Makefile
+index 0d55eda..a1847c6 100644
+--- a/iconv/Makefile
++++ b/iconv/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Makefile for iconv.
+ #
++include ../option-groups.mak
++
+ subdir	:= iconv
+ 
+ include ../Makeconfig
+@@ -39,6 +41,11 @@ CFLAGS-iconv_charmap.c = -I../locale/programs
+ CFLAGS-dummy-repertoire.c = -I../locale/programs
+ CFLAGS-charmap.c = -DCHARMAP_PATH='"$(i18ndir)/charmaps"' \
+ 		   -DDEFAULT_CHARMAP=null_pointer -DNEED_NULL_POINTER
++
++ifneq (y,$(OPTION_EGLIBC_SPAWN))
++CFLAGS-charmap-dir.c += -DNO_UNCOMPRESS
++endif
++
+ CFLAGS-linereader.c = -DNO_TRANSLITERATION
+ CFLAGS-simple-hash.c = -I../locale
+ 
+diff --git a/iconv/gconv_db.c b/iconv/gconv_db.c
+index ce46216..ea18964 100644
+--- a/iconv/gconv_db.c
++++ b/iconv/gconv_db.c
+@@ -25,6 +25,7 @@
+ #include <sys/param.h>
+ #include <bits/libc-lock.h>
+ #include <locale/localeinfo.h>
++#include <gnu/option-groups.h>
+ 
+ #include <dlfcn.h>
+ #include <gconv_int.h>
+@@ -828,9 +829,11 @@ free_modules_db (struct gconv_module *node)
+ /* Free all resources if necessary.  */
+ libc_freeres_fn (free_mem)
+ {
++#if __OPTION_EGLIBC_LOCALE_CODE
+   /* First free locale memory.  This needs to be done before freeing derivations,
+      as ctype cleanup functions dereference steps arrays which we free below.  */
+   _nl_locale_subfreeres ();
++#endif
+ 
+   /* finddomain.c has similar problem.  */
+   extern void _nl_finddomain_subfreeres (void) attribute_hidden;
+diff --git a/iconv/gconv_trans.c b/iconv/gconv_trans.c
+index 5d5d4d7..a7d3072 100644
+--- a/iconv/gconv_trans.c
++++ b/iconv/gconv_trans.c
+@@ -23,6 +23,7 @@
+ #include <stdint.h>
+ #include <string.h>
+ #include <stdlib.h>
++#include <gnu/option-groups.h>
+ 
+ #include <bits/libc-lock.h>
+ #include "gconv_int.h"
+@@ -38,15 +39,19 @@ __gconv_transliterate (struct __gconv_step *step,
+ 		       unsigned char **outbufstart, size_t *irreversible)
+ {
+   /* Find out about the locale's transliteration.  */
++#if __OPTION_EGLIBC_LOCALE_CODE
+   uint_fast32_t size;
+   const uint32_t *from_idx;
+   const uint32_t *from_tbl;
+   const uint32_t *to_idx;
+   const uint32_t *to_tbl;
++#endif
+   const uint32_t *winbuf;
+   const uint32_t *winbufend;
++#if __OPTION_EGLIBC_LOCALE_CODE
+   uint_fast32_t low;
+   uint_fast32_t high;
++#endif
+ 
+   /* The input buffer.  There are actually 4-byte values.  */
+   winbuf = (const uint32_t *) *inbufp;
+@@ -58,6 +63,7 @@ __gconv_transliterate (struct __gconv_step *step,
+     PTR_DEMANGLE (fct);
+ #endif
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+   /* If there is no transliteration information in the locale don't do
+      anything and return the error.  */
+   size = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_TAB_SIZE);
+@@ -193,6 +199,7 @@ __gconv_transliterate (struct __gconv_step *step,
+              sorted.  */
+ 	  break;
+     }
++#endif
+ 
+   /* One last chance: use the default replacement.  */
+   if (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN) != 0)
+diff --git a/iconv/iconv_prog.c b/iconv/iconv_prog.c
+index e249bce..403ece5 100644
+--- a/iconv/iconv_prog.c
++++ b/iconv/iconv_prog.c
+@@ -35,6 +35,7 @@
+ #ifdef _POSIX_MAPPED_FILES
+ # include <sys/mman.h>
+ #endif
++#include <gnu/option-groups.h>
+ #include <charmap.h>
+ #include <gconv_int.h>
+ #include "iconv_prog.h"
+@@ -221,10 +222,17 @@ main (int argc, char *argv[])
+ 	      bool to_wrong =
+ 		(iconv_open (to_code, "UTF-8") == (iconv_t) -1
+ 		 && errno == EINVAL);
++#if __OPTION_EGLIBC_LOCALE_CODE
+ 	      const char *from_pretty =
+ 		(from_code[0] ? from_code : nl_langinfo (CODESET));
+ 	      const char *to_pretty =
+ 		(orig_to_code[0] ? orig_to_code : nl_langinfo (CODESET));
++#else
++	      const char *from_pretty =
++		(from_code[0] ? from_code : "ANSI_X3.4-1968");
++	      const char *to_pretty =
++                 (orig_to_code[0] ? orig_to_code : "ANSI_X3.4-1968");
++#endif
+ 
+ 	      if (from_wrong)
+ 		{
+diff --git a/iconvdata/Makefile b/iconvdata/Makefile
+index a3d1d09..0832708 100644
+--- a/iconvdata/Makefile
++++ b/iconvdata/Makefile
+@@ -18,12 +18,15 @@
+ #
+ #	Makefile for iconv data and code.
+ #
++include ../option-groups.mak
++
+ subdir	:= iconvdata
+ 
+ include ../Makeconfig
+ 
+ # Names of all the shared objects which implement the transformations.
+-modules	:= ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5		 \
++modules-$(OPTION_EGLIBC_CHARSETS)					 \
++	:= ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5		 \
+ 	   ISO8859-6 ISO8859-7 ISO8859-8 ISO8859-9 ISO8859-10		 \
+ 	   ISO8859-11 ISO8859-13 ISO8859-14 ISO8859-15 ISO8859-16	 \
+ 	   T.61 ISO_6937 SJIS KOI-8 HP-ROMAN8 HP-ROMAN9 EBCDIC-AT-DE	 \
+@@ -63,11 +66,13 @@ modules	:= ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5		 \
+ 	   MAC-CENTRALEUROPE KOI8-RU ISO8859-9E				 \
+ 	   CP770 CP771 CP772 CP773 CP774
+ 
+-modules.so := $(addsuffix .so, $(modules))
++modules.so := $(addsuffix .so, $(modules-y))
+ 
+ ifeq (yes,$(build-shared))
+ tests = bug-iconv1 bug-iconv2 tst-loading tst-e2big tst-iconv4 bug-iconv4 \
+-	tst-iconv6 bug-iconv5 bug-iconv6 tst-iconv7 bug-iconv8 bug-iconv9
++	tst-iconv6 bug-iconv5 bug-iconv8 bug-iconv9
++tests-$(OPTION_EGLIBC_LOCALE_CODE) += bug-iconv6 tst-iconv7
++
+ ifeq ($(have-thread-library),yes)
+ tests += bug-iconv3
+ endif
+@@ -127,13 +132,13 @@ ifeq (yes,$(build-shared))
+ # Rule to generate the shared objects.
+ charmaps = ../localedata/charmaps
+ -include $(objpfx)iconv-rules
+-extra-modules-left := $(modules)
++extra-modules-left := $(modules-y)
+ include extra-module.mk
+ 
+ 
+ extra-objs	+= $(modules.so)
+-install-others	= $(addprefix $(inst_gconvdir)/, $(modules.so))	\
+-		  $(inst_gconvdir)/gconv-modules
++install-others-y += $(addprefix $(inst_gconvdir)/, $(modules.so))
++install-others-$(OPTION_EGLIBC_CHARSETS) += $(inst_gconvdir)/gconv-modules
+ 
+ # We can build the conversion tables for numerous charsets automatically.
+ 
+@@ -201,7 +206,7 @@ before-compile += $(addprefix $(objpfx),$(generated-modules:=.h))
+ ifndef avoid-generated
+ $(objpfx)iconv-rules: Makefile
+ 	$(make-target-directory)
+-	{ echo $(filter-out lib%, $(modules)); \
++	{ echo $(filter-out lib%, $(modules-y)); \
+ 	  echo 8bit $(gen-8bit-modules); \
+ 	  echo 8bit-gap $(gen-8bit-gap-modules); } | \
+ 	LC_ALL=C \
+@@ -245,7 +250,7 @@ $(addprefix $(inst_gconvdir)/, $(modules.so)): \
+ 	$(do-install-program)
+ $(inst_gconvdir)/gconv-modules: gconv-modules $(+force)
+ 	$(do-install)
+-ifeq (no,$(cross-compiling))
++# eglibc: ifeq (no,$(cross-compiling))
+ # Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
+ # if this libc has more gconv modules than the previously installed one.
+ 	if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
+@@ -254,9 +259,9 @@ ifeq (no,$(cross-compiling))
+ 	   $(common-objpfx)iconv/iconvconfig \
+ 	     $(addprefix --prefix=,$(install_root)); \
+ 	fi
+-else
+-	@echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
+-endif
++# eglibc: else
++# eglibc:	@echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
++# eglibc: endif
+ 
+ endif # build-shared = yes
+ 
+diff --git a/include/netdb.h b/include/netdb.h
+index e1f051d..f6d15aa 100644
+--- a/include/netdb.h
++++ b/include/netdb.h
+@@ -232,6 +232,10 @@ extern enum nss_status _nss_ ## service ## _gethostbyname2_r		      \
+ 		       (const char *name, int af, struct hostent *host,	      \
+ 			char *buffer, size_t buflen, int *errnop,	      \
+ 			int *h_errnop);					      \
++extern enum nss_status _nss_ ## service ## _gethostbyname3_r		      \
++		       (const char *name, int af, struct hostent *result,     \
++			char *buffer, size_t buflen, int *errnop,	      \
++			int *h_errnop, int32_t *ttlp, char **canonp);         \
+ extern enum nss_status _nss_ ## service ## _gethostbyname_r		      \
+ 		       (const char *name, struct hostent *host, char *buffer, \
+ 			size_t buflen, int *errnop, int *h_errnop);	      \
+diff --git a/inet/Makefile b/inet/Makefile
+index f1d871f..7cb1709 100644
+--- a/inet/Makefile
++++ b/inet/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Sub-makefile for inet portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= inet
+ 
+ include ../Makeconfig
+@@ -27,7 +29,8 @@ headers	:= netinet/ether.h netinet/in.h netinet/in_systm.h \
+ 	   netinet/tcp.h netinet/ip.h $(wildcard arpa/*.h protocols/*.h) \
+ 	   aliases.h ifaddrs.h netinet/ip6.h netinet/icmp6.h bits/in.h
+ 
+-routines := htonl htons		\
++routines-$(OPTION_EGLIBC_INET) \
++	 += htonl htons \
+ 	    inet_lnaof inet_mkadr	\
+ 	    inet_netof inet_ntoa inet_net herrno herrno-loc \
+ 	    gethstbyad gethstbyad_r gethstbynm gethstbynm2 gethstbynm2_r \
+@@ -39,18 +42,23 @@ routines := htonl htons		\
+ 	    getservent_r	\
+ 	    ether_aton ether_aton_r ether_hton ether_line \
+ 	    ether_ntoa ether_ntoa_r ether_ntoh \
+-	    rcmd rexec ruserpass \
+ 	    getnetgrent_r getnetgrent \
+-	    getaliasent_r getaliasent getaliasname getaliasname_r \
+-	    in6_addr getnameinfo if_index ifaddrs inet6_option \
++	    in6_addr getnameinfo if_index ifaddrs \
+ 	    getipv4sourcefilter setipv4sourcefilter \
+-	    getsourcefilter setsourcefilter inet6_opt inet6_rth
++	    getsourcefilter setsourcefilter
++routines-$(OPTION_EGLIBC_RCMD) \
++	 += rcmd rexec ruserpass
++routines-$(OPTION_EGLIBC_DB_ALIASES) \
++	 += getaliasent_r getaliasent getaliasname getaliasname_r
++routines-$(OPTION_EGLIBC_ADVANCED_INET6) \
++	 += inet6_option inet6_opt inet6_rth
+ 
+-aux := check_pf check_native ifreq
++aux-$(OPTION_EGLIBC_INET) += check_pf check_native ifreq
+ 
+ tests := htontest test_ifindex tst-ntoa tst-ether_aton tst-network \
+-	 tst-gethnm test-ifaddrs bug-if1 test-inet6_opt tst-ether_line \
++	 tst-gethnm test-ifaddrs bug-if1 tst-ether_line \
+ 	 tst-getni1 tst-getni2 tst-inet6_rth tst-checks
++tests-$(OPTION_EGLIBC_ADVANCED_INET6) += test-inet6_opt
+ 
+ include ../Rules
+ 
+diff --git a/intl/Makefile b/intl/Makefile
+index 9ecf8fe..587bc0d 100644
+--- a/intl/Makefile
++++ b/intl/Makefile
+@@ -16,6 +16,7 @@
+ # <http://www.gnu.org/licenses/>.
+ 
+ # Makefile for intl subdirectory: message handling code from GNU gettext.
++include ../option-groups.mak
+ 
+ subdir = intl
+ 
+@@ -48,7 +49,7 @@ endif
+ $(objpfx)plural.o: plural.c
+ 
+ ifeq ($(run-built-tests),yes)
+-ifeq (yes,$(build-shared))
++ifeq (yyyes,$(OPTION_EGLIBC_LOCALES)$(OPTION_EGLIBC_LOCALE_CODE)$(build-shared))
+ ifneq ($(strip $(MSGFMT)),:)
+ tests-special += $(objpfx)tst-translit.out $(objpfx)tst-gettext.out \
+ 		 $(objpfx)tst-gettext2.out $(objpfx)tst-codeset.out \
+diff --git a/intl/dcigettext.c b/intl/dcigettext.c
+index 8a3f091..e271648 100644
+--- a/intl/dcigettext.c
++++ b/intl/dcigettext.c
+@@ -100,11 +100,15 @@ extern int errno;
+ # include "libgnuintl.h"
+ #endif
+ #include "hash-string.h"
++#ifdef _LIBC
++# include <gnu/option-groups.h>
++#endif
+ 
+ /* Handle multi-threaded applications.  */
+ #ifdef _LIBC
+ # include <bits/libc-lock.h>
+ # define gl_rwlock_define_initialized __libc_rwlock_define_initialized
++# define gl_rwlock_define __libc_rwlock_define
+ # define gl_rwlock_rdlock __libc_rwlock_rdlock
+ # define gl_rwlock_wrlock __libc_rwlock_wrlock
+ # define gl_rwlock_unlock __libc_rwlock_unlock
+@@ -523,8 +527,10 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
+   saved_errno = errno;
+ 
+ #ifdef _LIBC
+-  __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
+-  __libc_rwlock_rdlock (__libc_setlocale_lock);
++# if __OPTION_EGLIBC_LOCALE_CODE
++  gl_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
++  gl_rwlock_rdlock (__libc_setlocale_lock);
++# endif
+ #endif
+ 
+   gl_rwlock_rdlock (_nl_state_lock);
+@@ -550,7 +556,11 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
+ #ifdef HAVE_PER_THREAD_LOCALE
+ # ifndef IN_LIBGLOCALE
+ #  ifdef _LIBC
+-  localename = strdupa (__current_locale_name (category));
++#   if __OPTION_EGLIBC_LOCALE_CODE
++      localename = strdupa (__current_locale_name (category));
++#   else
++      localename = "C";
++#   endif
+ #  else
+   categoryname = category_to_name (category);
+ #   define CATEGORYNAME_INITIALIZED
+@@ -581,10 +591,12 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
+       else
+ 	retval = (char *) (*foundp)->translation;
+ 
+-      gl_rwlock_unlock (_nl_state_lock);
+ # ifdef _LIBC
+-      __libc_rwlock_unlock (__libc_setlocale_lock);
++#  if __OPTION_EGLIBC_LOCALE_CODE
++      gl_rwlock_unlock (__libc_setlocale_lock);
++#  endif
+ # endif
++      gl_rwlock_unlock (_nl_state_lock);
+       __set_errno (saved_errno);
+       return retval;
+     }
+@@ -838,10 +850,13 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
+ 	      if (plural)
+ 		retval = plural_lookup (domain, n, retval, retlen);
+ 
+-	      gl_rwlock_unlock (_nl_state_lock);
+ #ifdef _LIBC
+-	      __libc_rwlock_unlock (__libc_setlocale_lock);
++# if __OPTION_EGLIBC_LOCALE_CODE
++
++	      gl_rwlock_unlock (__libc_setlocale_lock);
++# endif
+ #endif
++	      gl_rwlock_unlock (_nl_state_lock);
+ 	      return retval;
+ 	    }
+ 	}
+@@ -850,10 +865,12 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
+  return_untranslated:
+   /* Return the untranslated MSGID.  */
+   FREE_BLOCKS (block_list);
+-  gl_rwlock_unlock (_nl_state_lock);
+ #ifdef _LIBC
+-  __libc_rwlock_unlock (__libc_setlocale_lock);
++# if __OPTION_EGLIBC_LOCALE_CODE
++   gl_rwlock_unlock (__libc_setlocale_lock);
++# endif
+ #endif
++  gl_rwlock_unlock (_nl_state_lock);
+ #ifndef _LIBC
+   if (!ENABLE_SECURE)
+     {
+@@ -1550,7 +1567,11 @@ guess_category_value (int category, const char *categoryname)
+      `LC_xxx', and `LANG'.  On some systems this can be done by the
+      `setlocale' function itself.  */
+ # ifdef _LIBC
++#  if __OPTION_EGLIBC_LOCALE_CODE
+   locale = __current_locale_name (category);
++#  else
++  locale = "C";
++#  endif
+ # else
+   locale_defaulted = 0;
+ #  if HAVE_USELOCALE
+diff --git a/io/Makefile b/io/Makefile
+index 613dce0..697439e 100644
+--- a/io/Makefile
++++ b/io/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Sub-makefile for I/O portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= io
+ 
+ include ../Makeconfig
+@@ -36,7 +38,7 @@ routines :=								\
+ 	fxstatat fxstatat64						\
+ 	statfs fstatfs statfs64 fstatfs64				\
+ 	statvfs fstatvfs statvfs64 fstatvfs64				\
+-	umask chmod fchmod lchmod fchmodat				\
++	umask chmod fchmod fchmodat					\
+ 	mkdir mkdirat							\
+ 	open open_2 open64 open64_2 openat openat_2 openat64 openat64_2	\
+ 	read write lseek lseek64 access euidaccess faccessat		\
+@@ -49,11 +51,13 @@ routines :=								\
+ 	ttyname ttyname_r isatty					\
+ 	link linkat symlink symlinkat readlink readlinkat		\
+ 	unlink unlinkat rmdir						\
+-	ftw ftw64 fts poll ppoll					\
++	poll ppoll							\
+ 	posix_fadvise posix_fadvise64					\
+ 	posix_fallocate posix_fallocate64				\
+ 	sendfile sendfile64 \
+ 	utimensat futimens
++routines-$(OPTION_EGLIBC_BSD) += lchmod
++routines-$(OPTION_EGLIBC_FTRAVERSE) += ftw ftw64 fts
+ 
+ aux := have_o_cloexec
+ 
+@@ -64,18 +68,22 @@ static-only-routines = stat fstat lstat stat64 fstat64 lstat64	\
+ 		       fstatat fstatat64 mknod mknodat
+ 
+ others		:= pwd
+-test-srcs	:= ftwtest
++test-srcs-$(OPTION_EGLIBC_FTRAVERSE) := ftwtest
+ tests		:= test-utime test-stat test-stat2 test-lfs tst-getcwd \
+-		   tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 tst-statvfs \
++		   tst-fcntl tst-statvfs \
+ 		   tst-openat tst-unlinkat tst-fstatat tst-futimesat \
+ 		   tst-renameat tst-fchownat tst-fchmodat tst-faccessat \
+ 		   tst-symlinkat tst-linkat tst-readlinkat tst-mkdirat \
+-		   tst-mknodat tst-mkfifoat tst-ttyname_r bug-ftw5 \
++		   tst-mknodat tst-mkfifoat tst-ttyname_r \
+ 		   tst-posix_fallocate
++tests-$(OPTION_EGLIBC_FTRAVERSE) += bug-ftw1 bug-ftw2 bug-ftw3 bug-ftw4 \
++				    bug-ftw5
+ 
+ ifeq ($(run-built-tests),yes)
++ifeq (y,$(OPTION_EGLIBC_FTRAVERSE))
+ tests-special += $(objpfx)ftwtest.out
+ endif
++endif
+ 
+ include ../Rules
+ 
+diff --git a/libidn/Makefile b/libidn/Makefile
+index 940fa52..43aad0c 100644
+--- a/libidn/Makefile
++++ b/libidn/Makefile
+@@ -16,6 +16,7 @@
+ # <http://www.gnu.org/licenses/>.
+ 
+ # Makefile for libidn subdirectory of GNU C Library.
++include ../option-groups.mak
+ 
+ subdir	:= libidn
+ 
+@@ -23,8 +24,8 @@ include ../Makeconfig
+ 
+ routines = idn-stub
+ 
+-extra-libs		= libcidn
+-extra-libs-others	= $(extra-libs)
++extra-libs-$(OPTION_EGLIBC_IDN) = libcidn
++extra-libs-others-y = $(extra-libs-y)
+ 
+ libcidn-routines := punycode toutf8 nfkc stringprep rfc3454 profiles idna \
+ 		    iconvme
+diff --git a/libidn/toutf8.c b/libidn/toutf8.c
+index c7e67ca..62df478 100644
+--- a/libidn/toutf8.c
++++ b/libidn/toutf8.c
+@@ -33,6 +33,11 @@
+ /* Get strlen. */
+ #include <string.h>
+ 
++/* Get __OPTION_EGLIBC_LOCALE_CODE.  */
++#ifdef _LIBC
++# include <gnu/option-groups.h>
++#endif
++
+ /* Get iconv_string. */
+ #include "iconvme.h"
+ 
+@@ -47,7 +52,11 @@
+ #endif
+ 
+ #ifdef _LIBC
+-# define stringprep_locale_charset() nl_langinfo (CODESET)
++# if __OPTION_EGLIBC_LOCALE_CODE
++#  define stringprep_locale_charset() nl_langinfo (CODESET)
++# else
++#  define stringprep_locale_charset() "ANSI_X3.4-1968"
++# endif
+ #else
+ /**
+  * stringprep_locale_charset - return charset used in current locale
+diff --git a/libio/Makefile b/libio/Makefile
+index 7b3bcf9..27c9186 100644
+--- a/libio/Makefile
++++ b/libio/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Specific makefile for libio.
+ #
++include ../option-groups.mak
++
+ subdir	:= libio
+ 
+ include ../Makeconfig
+@@ -27,16 +29,13 @@ headers	:= stdio.h libio.h _G_config.h bits/stdio.h bits/stdio-lock.h \
+ 
+ routines	:=							      \
+ 	filedoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen      \
+-	iofopncook iofputs iofread iofsetpos ioftell wfiledoalloc	      \
++	iofopncook iofputs iofread iofsetpos ioftell			      \
+ 	iofwrite iogetdelim iogetline iogets iopadn iopopen ioputs	      \
+ 	ioseekoff ioseekpos iosetbuffer iosetvbuf ioungetc		      \
+ 	iovsprintf iovsscanf						      \
+ 	iofgetpos64 iofopen64 iofsetpos64				      \
+-	fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \
+-	iofputws iofputws_u iogetwline iowpadn ioungetwc putwc putwc_u	      \
+-	putwchar putwchar_u putchar putchar_u fwprintf swprintf vwprintf      \
+-	wprintf wscanf fwscanf vwscanf vswprintf iovswscanf swscanf wgenops   \
+-	wstrops wfileops iofwide fwide wmemstream			      \
++	putchar putchar_u						      \
++	iofwide								      \
+ 									      \
+ 	clearerr feof ferror fileno fputc freopen fseek getc getchar	      \
+ 	memstream pclose putc putchar rewind setbuf setlinebuf vasprintf      \
+@@ -48,24 +47,49 @@ routines	:=							      \
+ 									      \
+ 	libc_fatal fmemopen oldfmemopen
+ 
+-tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc   \
+-	tst_wprintf2 tst-widetext test-fmemopen tst-ext tst-ext2 \
+-	tst-fgetws tst-ungetwc1 tst-ungetwc2 tst-swscanf tst-sscanf	      \
+-	tst-mmap-setvbuf bug-ungetwc1 bug-ungetwc2 tst-atime tst-eof          \
+-	tst-freopen bug-rewind bug-rewind2 bug-ungetc bug-fseek \
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) +=				      \
++	wfiledoalloc                                                          \
++	iowpadn                                                               \
++	swprintf                                                              \
++	vswprintf iovswscanf swscanf wgenops                                  \
++	wstrops wfileops wmemstream
++routines-$(call option-disabled, OPTION_POSIX_C_LANG_WIDE_CHAR) +=	      \
++	wdummyfileops
++routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) +=				      \
++	fputwc fputwc_u getwc getwc_u getwchar getwchar_u iofgetws iofgetws_u \
++	iofputws iofputws_u iogetwline ioungetwc putwc putwc_u                \
++	putwchar putwchar_u fwprintf vwprintf                                 \
++	wprintf wscanf fwscanf vwscanf                                        \
++	fwide
++
++tests = test-fmemopen tst-ext tst-ext2 \
++	tst-mmap-setvbuf tst-atime tst-eof \
++	tst-freopen bug-ungetc bug-fseek \
+ 	tst-mmap-eofsync tst-mmap-fflushsync bug-mmap-fflush \
+-	tst-mmap2-eofsync tst-mmap-offend bug-fopena+ bug-wfflush \
+-	bug-ungetc2 bug-ftell bug-ungetc3 bug-ungetc4 tst-fopenloc2 \
++	tst-mmap2-eofsync tst-mmap-offend bug-fopena+ \
++	bug-ungetc2 bug-ungetc3 bug-ungetc4 \
+ 	tst-memstream1 tst-memstream2 \
+-	tst-wmemstream1 tst-wmemstream2 \
+-	bug-memstream1 bug-wmemstream1 \
+-	tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \
+-	tst-fwrite-error tst-ftell-partial-wide tst-ftell-active-handler \
+-	tst-ftell-append tst-fputws
++	bug-memstream1 tst-popen1 tst-fwrite-error \
++	tst-ftell-active-handler tst-ftell-append
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++	+= tst-swscanf tst-fgetws tst-setvbuf1 \
++	tst-ungetwc1 tst-ungetwc2 bug-ftell bug-ungetwc2 \
++	tst-widetext tst-fputws
++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
++	+= bug-rewind bug-rewind2 bug-ungetwc1 \
++	bug-wfflush bug-wmemstream1 tst-fopenloc2 \
++	tst_getwc \
++	tst_putwc tst_wprintf tst_wprintf2 tst_wscanf \
++	tst-fgetwc bug-wsetpos tst-fseek tst-ftell-partial-wide
++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++	+= tst_swprintf tst_swscanf \
++	tst-sscanf \
++	tst-wmemstream1 tst-wmemstream2
++
+ ifeq (yes,$(build-shared))
+ # Add test-fopenloc only if shared library is enabled since it depends on
+ # shared localedata objects.
+-tests += tst-fopenloc
++tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-fopenloc
+ endif
+ test-srcs = test-freopen
+ 
+@@ -164,13 +188,17 @@ shared-only-routines = oldiofopen oldiofdopen oldiofclose oldfileops	\
+ 		       oldiofsetpos64
+ 
+ ifeq ($(run-built-tests),yes)
++ifeq (y,$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO))
+ tests-special += $(objpfx)test-freopen.out
++endif
++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
+ ifeq (yes,$(build-shared))
+ # Run tst-fopenloc-cmp.out and tst-openloc-mem.out only if shared
+ # library is enabled since they depend on tst-fopenloc.out.
+ tests-special += $(objpfx)tst-fopenloc-cmp.out $(objpfx)tst-fopenloc-mem.out
+ endif
+ endif
++endif
+ 
+ include ../Rules
+ 
+diff --git a/libio/__fpurge.c b/libio/__fpurge.c
+index 065cf61..e32a3e9 100644
+--- a/libio/__fpurge.c
++++ b/libio/__fpurge.c
+@@ -21,7 +21,7 @@
+ void
+ __fpurge (FILE *fp)
+ {
+-  if (fp->_mode > 0)
++  if (_IO_is_wide (fp))
+     {
+       /* Wide-char stream.  */
+       if (_IO_in_backup (fp))
+diff --git a/libio/fileops.c b/libio/fileops.c
+index cbcd6f5..19e43c2 100644
+--- a/libio/fileops.c
++++ b/libio/fileops.c
+@@ -39,6 +39,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <unistd.h>
++#include <gnu/option-groups.h>
+ #include <stdlib.h>
+ #if _LIBC
+ # include "../wcsmbs/wcsmbsload.h"
+@@ -173,7 +174,7 @@ _IO_new_file_close_it (_IO_FILE *fp)
+ 
+   /* Free buffer. */
+ #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+-  if (fp->_mode > 0)
++  if (_IO_is_wide (fp))
+     {
+       if (_IO_have_wbackup (fp))
+ 	_IO_free_wbackup_area (fp);
+@@ -348,6 +349,7 @@ _IO_new_file_fopen (_IO_FILE *fp, const char *filename, const char *mode,
+       cs = strstr (last_recognized + 1, ",ccs=");
+       if (cs != NULL)
+ 	{
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ 	  /* Yep.  Load the appropriate conversions and set the orientation
+ 	     to wide.  */
+ 	  struct gconv_fcts fcts;
+@@ -418,6 +420,12 @@ _IO_new_file_fopen (_IO_FILE *fp, const char *filename, const char *mode,
+ 
+ 	  /* Set the mode now.  */
+ 	  result->_mode = 1;
++#else
++          /* Treat this as if we couldn't find the given character set.  */
++          (void) _IO_file_close_it (fp);
++          __set_errno (EINVAL);
++          return NULL;
++#endif
+ 	}
+     }
+ 
+diff --git a/libio/iofwide.c b/libio/iofwide.c
+index 0c175d1..3e9f52b 100644
+--- a/libio/iofwide.c
++++ b/libio/iofwide.c
+@@ -26,6 +26,7 @@
+ 
+ #include <libioP.h>
+ #ifdef _LIBC
++# include <gnu/option-groups.h>
+ # include <dlfcn.h>
+ # include <wchar.h>
+ #endif
+@@ -43,6 +44,8 @@
+ #endif
+ 
+ 
++#if ! defined _LIBC || __OPTION_POSIX_C_LANG_WIDE_CHAR
++
+ /* Prototypes of libio's codecvt functions.  */
+ static enum __codecvt_result do_out (struct _IO_codecvt *codecvt,
+ 				     __mbstate_t *statep,
+@@ -499,3 +502,26 @@ do_max_length (struct _IO_codecvt *codecvt)
+   return MB_CUR_MAX;
+ #endif
+ }
++
++#else
++/* OPTION_POSIX_C_LANG_WIDE_CHAR is disabled.  */
++
++#undef _IO_fwide
++int
++_IO_fwide (fp, mode)
++     _IO_FILE *fp;
++     int mode;
++{
++  /* Die helpfully if the user tries to create a wide stream; I
++     disbelieve that most users check the return value from
++     'fwide (fp, 1)'.  */
++  assert (mode <= 0);
++
++  /* We can only make streams byte-oriented, which is trivial.  */
++  if (mode < 0)
++    fp->_mode = -1;
++
++  return fp->_mode;
++}
++
++#endif
+diff --git a/libio/ioseekoff.c b/libio/ioseekoff.c
+index 11765cf..15d6230 100644
+--- a/libio/ioseekoff.c
++++ b/libio/ioseekoff.c
+@@ -60,7 +60,7 @@ _IO_seekoff_unlocked (fp, offset, dir, mode)
+ 	  else
+ 	    abort ();
+ 	}
+-      if (_IO_fwide (fp, 0) < 0)
++      if (! _IO_is_wide (fp))
+ 	_IO_free_backup_area (fp);
+       else
+ 	_IO_free_wbackup_area (fp);
+diff --git a/libio/ioseekpos.c b/libio/ioseekpos.c
+index a7652a1..6938b68 100644
+--- a/libio/ioseekpos.c
++++ b/libio/ioseekpos.c
+@@ -35,7 +35,7 @@ _IO_seekpos_unlocked (fp, pos, mode)
+   /* If we have a backup buffer, get rid of it, since the __seekoff
+      callback may not know to do the right thing about it.
+      This may be over-kill, but it'll do for now. TODO */
+-  if (_IO_fwide (fp, 0) <= 0)
++  if (! _IO_is_wide (fp))
+     {
+       if (_IO_have_backup (fp))
+ 	_IO_free_backup_area (fp);
+diff --git a/libio/iosetbuffer.c b/libio/iosetbuffer.c
+index 0a41c10..3d99fa0 100644
+--- a/libio/iosetbuffer.c
++++ b/libio/iosetbuffer.c
+@@ -24,6 +24,8 @@
+    This exception applies to code released by its copyright holders
+    in files containing the exception.  */
+ 
++#include <gnu/option-groups.h>
++
+ #include "libioP.h"
+ 
+ void
+@@ -38,9 +40,11 @@ _IO_setbuffer (fp, buf, size)
+   if (!buf)
+     size = 0;
+   (void) _IO_SETBUF (fp, buf, size);
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+   if (_IO_vtable_offset (fp) == 0 && fp->_mode == 0 && _IO_CHECK_WIDE (fp))
+     /* We also have to set the buffer using the wide char function.  */
+     (void) _IO_WSETBUF (fp, buf, size);
++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
+   _IO_release_lock (fp);
+ }
+ libc_hidden_def (_IO_setbuffer)
+diff --git a/libio/libioP.h b/libio/libioP.h
+index 0f16e2d..d2626d6 100644
+--- a/libio/libioP.h
++++ b/libio/libioP.h
+@@ -44,6 +44,10 @@
+ /*# include <comthread.h>*/
+ #endif
+ 
++#if defined _LIBC
++# include <gnu/option-groups.h>
++#endif
++
+ #include <math_ldbl_opt.h>
+ 
+ #include "iolibio.h"
+@@ -523,8 +527,20 @@ extern void _IO_old_init (_IO_FILE *fp, int flags) __THROW;
+ 
+ 
+ #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
++
++/* _IO_is_wide (fp) is roughly equivalent to '_IO_fwide (fp, 0) > 0',
++   except that when OPTION_POSIX_C_LANG_WIDE_CHAR is disabled, it
++   expands to a constant, allowing the compiler to realize that it can
++   eliminate code that references wide stream handling functions.
++   This, in turn, allows us to omit them.  */
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
++# define _IO_is_wide(_f) ((_f)->_mode > 0)
++#else
++# define _IO_is_wide(_f) (0)
++#endif
++
+ # define _IO_do_flush(_f) \
+-  ((_f)->_mode <= 0							      \
++  (! _IO_is_wide (_f)                                                         \
+    ? _IO_do_write(_f, (_f)->_IO_write_base,				      \
+ 		  (_f)->_IO_write_ptr-(_f)->_IO_write_base)		      \
+    : _IO_wdo_write(_f, (_f)->_wide_data->_IO_write_base,		      \
+diff --git a/libio/wdummyfileops.c b/libio/wdummyfileops.c
+new file mode 100644
+index 0000000..c0150b8
+--- /dev/null
++++ b/libio/wdummyfileops.c
+@@ -0,0 +1,161 @@
++/* Copyright (C) 2007 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.
++
++   As a special exception, if you link the code in this file with
++   files compiled with a GNU compiler to produce an executable,
++   that does not cause the resulting executable to be covered by
++   the GNU Lesser General Public License.  This exception does not
++   however invalidate any other reasons why the executable file
++   might be covered by the GNU Lesser General Public License.
++   This exception applies to code released by its copyright holders
++   in files containing the exception.  */
++
++#include <assert.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <libioP.h>
++
++static void __THROW __attribute__ ((__noreturn__))
++_IO_wfile_wide_char_support_disabled (void)
++{
++  static const char errstr[]
++    = ("The application tried to use wide character I/O, but libc.so"
++       " was compiled\n"
++       "with the OPTION_POSIX_C_LANG_WIDE_CHAR option group disabled.\n");
++  __libc_write (STDERR_FILENO, errstr, sizeof (errstr) - 1);
++  abort ();
++}
++
++static void
++_IO_wfile_disabled_void_int (_IO_FILE *fp, int x)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static int
++_IO_wfile_disabled_int_int (_IO_FILE *fp, int x)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static int
++_IO_wfile_disabled_int_none (_IO_FILE *fp)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static _IO_size_t
++_IO_wfile_disabled_xsputn (_IO_FILE *fp, const void *data, _IO_size_t n)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static _IO_size_t
++_IO_wfile_disabled_xsgetn (_IO_FILE *fp, void *data, _IO_size_t n)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static _IO_off64_t
++_IO_wfile_disabled_seekoff (_IO_FILE *fp, _IO_off64_t off, int dir, int mode)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static _IO_off64_t
++_IO_wfile_disabled_seekpos (_IO_FILE *fp, _IO_off64_t pos, int flags)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static _IO_FILE *
++_IO_wfile_disabled_setbuf (_IO_FILE *fp, char *buffer, _IO_ssize_t length)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static _IO_ssize_t
++_IO_wfile_disabled_read (_IO_FILE *fp, void *buffer, _IO_ssize_t length)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static _IO_ssize_t
++_IO_wfile_disabled_write (_IO_FILE *fp, const void *buffer, _IO_ssize_t length)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static _IO_off64_t
++_IO_wfile_disabled_seek (_IO_FILE *fp, _IO_off64_t offset, int mode)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static int
++_IO_wfile_disabled_close (_IO_FILE *fp)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static int
++_IO_wfile_disabled_stat (_IO_FILE *fp, void *buf)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static int
++_IO_wfile_disabled_showmanyc (_IO_FILE *fp)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static void
++_IO_wfile_disabled_imbue (_IO_FILE *fp, void *locale)
++{
++  _IO_wfile_wide_char_support_disabled ();
++}
++
++static const struct _IO_jump_t _IO_wfile_jumps_disabled =
++{
++  JUMP_INIT_DUMMY,
++  JUMP_INIT(finish, _IO_wfile_disabled_void_int),
++  JUMP_INIT(overflow, _IO_wfile_disabled_int_int),
++  JUMP_INIT(underflow, _IO_wfile_disabled_int_none),
++  JUMP_INIT(uflow, _IO_wfile_disabled_int_none),
++  JUMP_INIT(pbackfail, _IO_wfile_disabled_int_int),
++  JUMP_INIT(xsputn, _IO_wfile_disabled_xsputn),
++  JUMP_INIT(xsgetn, _IO_wfile_disabled_xsgetn),
++  JUMP_INIT(seekoff, _IO_wfile_disabled_seekoff),
++  JUMP_INIT(seekpos, _IO_wfile_disabled_seekpos),
++  JUMP_INIT(setbuf, _IO_wfile_disabled_setbuf),
++  JUMP_INIT(sync, _IO_wfile_disabled_int_none),
++  JUMP_INIT(doallocate, _IO_wfile_disabled_int_none),
++  JUMP_INIT(read, _IO_wfile_disabled_read),
++  JUMP_INIT(write, _IO_wfile_disabled_write),
++  JUMP_INIT(seek, _IO_wfile_disabled_seek),
++  JUMP_INIT(close, _IO_wfile_disabled_close),
++  JUMP_INIT(stat, _IO_wfile_disabled_stat),
++  JUMP_INIT(showmanyc, _IO_wfile_disabled_showmanyc),
++  JUMP_INIT(imbue, _IO_wfile_disabled_imbue)
++};
++
++strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps)
++libc_hidden_data_def (_IO_wfile_jumps)
++strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps_mmap)
++strong_alias (_IO_wfile_jumps_disabled, _IO_wfile_jumps_maybe_mmap)
+diff --git a/locale/C-ctype.c b/locale/C-ctype.c
+index aa5f19f..06be081 100644
+--- a/locale/C-ctype.c
++++ b/locale/C-ctype.c
+@@ -19,8 +19,11 @@
+ #include "localeinfo.h"
+ #include <endian.h>
+ #include <stdint.h>
++#include <gnu/option-groups.h>
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+ #include "C-translit.h"
++#endif
+ 
+ /* This table's entries are taken from POSIX.2 Table 2-6
+    ``LC_CTYPE Category Definition in the POSIX Locale''.
+@@ -634,6 +637,7 @@ const struct __locale_data _nl_C_LC_CTYPE attribute_hidden =
+     { .word = L'7' },
+     { .word = L'8' },
+     { .word = L'9' },
++#if __OPTION_EGLIBC_LOCALE_CODE
+     /* _NL_CTYPE_TRANSLIT_TAB_SIZE */
+     { .word = NTRANSLIT },
+     /* _NL_CTYPE_TRANSLIT_FROM_IDX */
+@@ -644,6 +648,22 @@ const struct __locale_data _nl_C_LC_CTYPE attribute_hidden =
+     { .wstr = translit_to_idx },
+     /* _NL_CTYPE_TRANSLIT_TO_TBL */
+     { .wstr = (uint32_t *) translit_to_tbl },
++#else
++    /* If the locale code isn't enabled, we don't have the
++       transliteration code in iconv/gconv_trans.c anyway, so there's
++       no need for the transliteration tables here.  We'll fall back
++       on the default missing replacement, '?'.  */
++    /* _NL_CTYPE_TRANSLIT_TAB_SIZE */
++    { .word = 0 },
++    /* _NL_CTYPE_TRANSLIT_FROM_IDX */
++    { .wstr = NULL },
++    /* _NL_CTYPE_TRANSLIT_FROM_TBL */
++    { .wstr = NULL },
++    /* _NL_CTYPE_TRANSLIT_TO_IDX */
++    { .wstr = NULL },
++    /* _NL_CTYPE_TRANSLIT_TO_TBL */
++    { .wstr = NULL },
++#endif
+     /* _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN */
+     { .word = 1 },
+     /* _NL_CTYPE_TRANSLIT_DEFAULT_MISSING */
+diff --git a/locale/Makefile b/locale/Makefile
+index f1b4343..599a1a9 100644
+--- a/locale/Makefile
++++ b/locale/Makefile
+@@ -18,27 +18,43 @@
+ #
+ #	Makefile for locales.
+ #
++include ../option-groups.mak
++
+ subdir	:= locale
+ 
+ include ../Makeconfig
+ 
+ headers		= locale.h bits/locale.h langinfo.h xlocale.h
+-routines	= setlocale findlocale loadlocale loadarchive \
+-		  localeconv nl_langinfo nl_langinfo_l mb_cur_max \
+-		  newlocale duplocale freelocale uselocale
+-tests		= tst-C-locale tst-locname tst-duplocale
++# catnames is needed by OPTION_EGLIBC_LOCALE_CODE and by the 'intl' code.
++# If we put the latter in an option group, too, we can omit catnames
++# when both option groups are disabled.  libstdc++-v3 needs mb_cur_max.
++routines-y      := catnames mb_cur_max
++routines-$(OPTION_EGLIBC_LOCALE_CODE) \
++		+= setlocale findlocale loadlocale loadarchive \
++		   localeconv nl_langinfo nl_langinfo_l \
++		   newlocale duplocale freelocale uselocale
++ifneq (y,$(OPTION_EGLIBC_LOCALE_CODE))
++routines-y	+= dummy-setlocale
++endif
++tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-C-locale tst-locname tst-duplocale
+ categories	= ctype messages monetary numeric time paper name \
+ 		  address telephone measurement identification collate
+-aux		= $(categories:%=lc-%) $(categories:%=C-%) SYS_libc C_name \
+-		  xlocale localename global-locale coll-lookup
+-others		= localedef locale
++# C-messages belongs in an intl option group.
++aux-y		:= C-ctype C-time \
++		   SYS_libc C_name xlocale global-locale coll-lookup
++aux-$(OPTION_EGLIBC_LOCALE_CODE) \
++		+= $(filter-out $(aux-y), \
++	                        $(categories:%=lc-%) $(categories:%=C-%)) \
++	           localename
++others-$(OPTION_EGLIBC_LOCALE_CODE) = localedef locale
+ #others-static	= localedef locale
+-install-bin	= localedef locale
+-extra-objs	= $(localedef-modules:=.o) $(localedef-aux:=.o) \
++install-bin	= $(others-y)
++extra-objs-$(OPTION_EGLIBC_LOCALE_CODE) \
++		= $(localedef-modules:=.o) $(localedef-aux:=.o) \
+ 		  $(locale-modules:=.o) $(lib-modules:=.o)
+ 
+-extra-libs	= libBrokenLocale
+-extra-libs-others = $(extra-libs)
++extra-libs-$(OPTION_EGLIBC_LOCALE_CODE) = libBrokenLocale
++extra-libs-others = $(extra-libs-y)
+ 
+ libBrokenLocale-routines = broken_cur_max
+ 
+@@ -93,6 +109,9 @@ CPPFLAGS-locale-programs = -DLOCALE_PATH='$(localepath)' \
+ CFLAGS-charmap.c = -Wno-write-strings -Wno-char-subscripts
+ CFLAGS-locfile.c = -Wno-write-strings -Wno-char-subscripts
+ CFLAGS-charmap-dir.c = -Wno-write-strings
++ifneq (y,$(OPTION_EGLIBC_SPAWN))
++CFLAGS-charmap-dir.c += -DNO_UNCOMPRESS
++endif
+ 
+ # Set libof-* for each routine.
+ cpp-srcs-left := $(localedef-modules) $(localedef-aux) $(locale-modules) \
+diff --git a/locale/catnames.c b/locale/catnames.c
+new file mode 100644
+index 0000000..9fad357
+--- /dev/null
++++ b/locale/catnames.c
+@@ -0,0 +1,48 @@
++/* Copyright (C) 2006  Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include "localeinfo.h"
++
++/* Define an array of category names (also the environment variable names).  */
++const union catnamestr_t _nl_category_names attribute_hidden =
++  {
++    {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++      category_name,
++#include "categories.def"
++#undef DEFINE_CATEGORY
++    }
++  };
++
++const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden =
++  {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++    [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)),
++#include "categories.def"
++#undef DEFINE_CATEGORY
++  };
++
++/* An array of their lengths, for convenience.  */
++const uint8_t _nl_category_name_sizes[] attribute_hidden =
++  {
++#define DEFINE_CATEGORY(category, category_name, items, a) \
++    [category] = sizeof (category_name) - 1,
++#include "categories.def"
++#undef	DEFINE_CATEGORY
++    [LC_ALL] = sizeof ("LC_ALL") - 1
++  };
+diff --git a/locale/dummy-setlocale.c b/locale/dummy-setlocale.c
+new file mode 100644
+index 0000000..219964a
+--- /dev/null
++++ b/locale/dummy-setlocale.c
+@@ -0,0 +1,33 @@
++/* Copyright (C) 2006  Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <string.h>
++#include <locale.h>
++
++char *
++setlocale (int category, const char *locale)
++{
++  if (! locale
++      || locale[0] == '\0'
++      || strcmp (locale, "C") == 0
++      || strcmp (locale, "POSIX") == 0)
++    return (char *) "C";
++  else
++    return NULL;
++}
++libc_hidden_def (setlocale)
+diff --git a/locale/localeinfo.h b/locale/localeinfo.h
+index bdab9fe..a7516c0 100644
+--- a/locale/localeinfo.h
++++ b/locale/localeinfo.h
+@@ -232,7 +232,7 @@ __libc_tsd_define (extern, __locale_t, LOCALE)
+    unused.  We can manage this playing some tricks with weak references.
+    But with thread-local locale settings, it becomes quite ungainly unless
+    we can use __thread variables.  So only in that case do we attempt this.  */
+-#ifndef SHARED
++#if !defined SHARED && !defined IN_GLIBC_LOCALEDEF
+ # include <tls.h>
+ # define NL_CURRENT_INDIRECT	1
+ #endif
+diff --git a/locale/programs/charmap-dir.c b/locale/programs/charmap-dir.c
+index cf7adea..ef3b811 100644
+--- a/locale/programs/charmap-dir.c
++++ b/locale/programs/charmap-dir.c
+@@ -19,7 +19,9 @@
+ #include <error.h>
+ #include <fcntl.h>
+ #include <libintl.h>
++#ifndef NO_UNCOMPRESS
+ #include <spawn.h>
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -156,6 +158,7 @@ charmap_closedir (CHARMAP_DIR *cdir)
+   return closedir (dir);
+ }
+ 
++#ifndef NO_UNCOMPRESS
+ /* Creates a subprocess decompressing the given pathname, and returns
+    a stream reading its output (the decompressed data).  */
+ static
+@@ -204,6 +207,7 @@ fopen_uncompressed (const char *pathname, const char *compressor)
+     }
+   return NULL;
+ }
++#endif
+ 
+ /* Opens a charmap for reading, given its name (not an alias name).  */
+ FILE *
+@@ -226,6 +230,7 @@ charmap_open (const char *directory, const char *name)
+   if (stream != NULL)
+     return stream;
+ 
++#ifndef NO_UNCOMPRESS
+   memcpy (p, ".gz", 4);
+   stream = fopen_uncompressed (pathname, "gzip");
+   if (stream != NULL)
+@@ -235,6 +240,7 @@ charmap_open (const char *directory, const char *name)
+   stream = fopen_uncompressed (pathname, "bzip2");
+   if (stream != NULL)
+     return stream;
++#endif
+ 
+   return NULL;
+ }
+diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
+index a39a94f..16e9039 100644
+--- a/locale/programs/ld-collate.c
++++ b/locale/programs/ld-collate.c
+@@ -351,7 +351,7 @@ new_element (struct locale_collate_t *collate, const char *mbs, size_t mbslen,
+     }
+   if (wcs != NULL)
+     {
+-      size_t nwcs = wcslen ((wchar_t *) wcs);
++      size_t nwcs = wcslen_uint32 (wcs);
+       uint32_t zero = 0;
+       /* Handle <U0000> as a single character.  */
+       if (nwcs == 0)
+@@ -1777,8 +1777,7 @@ symbol `%s' has the same encoding as"), (*eptr)->name);
+ 
+ 	      if ((*eptr)->nwcs == runp->nwcs)
+ 		{
+-		  int c = wmemcmp ((wchar_t *) (*eptr)->wcs,
+-				   (wchar_t *) runp->wcs, runp->nwcs);
++		  int c = wmemcmp_uint32 ((*eptr)->wcs, runp->wcs, runp->nwcs);
+ 
+ 		  if (c == 0)
+ 		    {
+@@ -2011,9 +2010,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
+ 	     one consecutive entry.  */
+ 	  if (runp->wcnext != NULL
+ 	      && runp->nwcs == runp->wcnext->nwcs
+-	      && wmemcmp ((wchar_t *) runp->wcs,
+-			  (wchar_t *)runp->wcnext->wcs,
+-			  runp->nwcs - 1) == 0
++	      && wmemcmp_uint32 (runp->wcs,
++				 runp->wcnext->wcs,
++				 runp->nwcs - 1) == 0
+ 	      && (runp->wcs[runp->nwcs - 1]
+ 		  == runp->wcnext->wcs[runp->nwcs - 1] + 1))
+ 	    {
+@@ -2037,9 +2036,9 @@ add_to_tablewc (uint32_t ch, struct element_t *runp)
+ 		runp = runp->wcnext;
+ 	      while (runp->wcnext != NULL
+ 		     && runp->nwcs == runp->wcnext->nwcs
+-		     && wmemcmp ((wchar_t *) runp->wcs,
+-				 (wchar_t *)runp->wcnext->wcs,
+-				 runp->nwcs - 1) == 0
++		     && wmemcmp_uint32 (runp->wcs,
++					runp->wcnext->wcs,
++					runp->nwcs - 1) == 0
+ 		     && (runp->wcs[runp->nwcs - 1]
+ 			 == runp->wcnext->wcs[runp->nwcs - 1] + 1));
+ 
+diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
+index 3f464ef..b7b6b51 100644
+--- a/locale/programs/ld-ctype.c
++++ b/locale/programs/ld-ctype.c
+@@ -926,7 +926,7 @@ ctype_output (struct localedef_t *locale, const struct charmap_t *charmap,
+   allocate_arrays (ctype, charmap, ctype->repertoire);
+ 
+   default_missing_len = (ctype->default_missing
+-			 ? wcslen ((wchar_t *) ctype->default_missing)
++			 ? wcslen_uint32 (ctype->default_missing)
+ 			 : 0);
+ 
+   init_locale_data (&file, nelems);
+@@ -1937,7 +1937,7 @@ read_translit_entry (struct linereader *ldfile, struct locale_ctype_t *ctype,
+ 	    ignore = 1;
+ 	  else
+ 	    /* This value is usable.  */
+-	    obstack_grow (ob, to_wstr, wcslen ((wchar_t *) to_wstr) * 4);
++	    obstack_grow (ob, to_wstr, wcslen_uint32 (to_wstr) * 4);
+ 
+ 	  first = 0;
+ 	}
+@@ -2471,8 +2471,8 @@ with character code range values one must use the absolute ellipsis `...'"));
+ 	    }
+ 
+ 	handle_tok_digit:
+-	  class_bit = _ISwdigit;
+-	  class256_bit = _ISdigit;
++	  class_bit = BITw (tok_digit);
++	  class256_bit = BIT (tok_digit);
+ 	  handle_digits = 1;
+ 	  goto read_charclass;
+ 
+@@ -3929,8 +3929,7 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
+ 
+ 	  while (idx < number)
+ 	    {
+-	      int res = wcscmp ((const wchar_t *) sorted[idx]->from,
+-				(const wchar_t *) runp->from);
++	      int res = wcscmp_uint32 (sorted[idx]->from, runp->from);
+ 	      if (res == 0)
+ 		{
+ 		  replace = 1;
+@@ -3967,11 +3966,11 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
+       for (size_t cnt = 0; cnt < number; ++cnt)
+ 	{
+ 	  struct translit_to_t *srunp;
+-	  from_len += wcslen ((const wchar_t *) sorted[cnt]->from) + 1;
++	  from_len += wcslen_uint32 (sorted[cnt]->from) + 1;
+ 	  srunp = sorted[cnt]->to;
+ 	  while (srunp != NULL)
+ 	    {
+-	      to_len += wcslen ((const wchar_t *) srunp->str) + 1;
++	      to_len += wcslen_uint32 (srunp->str) + 1;
+ 	      srunp = srunp->next;
+ 	    }
+ 	  /* Plus one for the extra NUL character marking the end of
+@@ -3995,18 +3994,18 @@ allocate_arrays (struct locale_ctype_t *ctype, const struct charmap_t *charmap,
+ 	  ctype->translit_from_idx[cnt] = from_len;
+ 	  ctype->translit_to_idx[cnt] = to_len;
+ 
+-	  len = wcslen ((const wchar_t *) sorted[cnt]->from) + 1;
+-	  wmemcpy ((wchar_t *) &ctype->translit_from_tbl[from_len],
+-		   (const wchar_t *) sorted[cnt]->from, len);
++	  len = wcslen_uint32 (sorted[cnt]->from) + 1;
++	  wmemcpy_uint32 (&ctype->translit_from_tbl[from_len],
++			  sorted[cnt]->from, len);
+ 	  from_len += len;
+ 
+ 	  ctype->translit_to_idx[cnt] = to_len;
+ 	  srunp = sorted[cnt]->to;
+ 	  while (srunp != NULL)
+ 	    {
+-	      len = wcslen ((const wchar_t *) srunp->str) + 1;
+-	      wmemcpy ((wchar_t *) &ctype->translit_to_tbl[to_len],
+-		       (const wchar_t *) srunp->str, len);
++	      len = wcslen_uint32 (srunp->str) + 1;
++	      wmemcpy_uint32 (&ctype->translit_to_tbl[to_len],
++			      srunp->str, len);
+ 	      to_len += len;
+ 	      srunp = srunp->next;
+ 	    }
+diff --git a/locale/programs/ld-messages.c b/locale/programs/ld-messages.c
+index ec1a80b..736eed8 100644
+--- a/locale/programs/ld-messages.c
++++ b/locale/programs/ld-messages.c
+@@ -25,6 +25,7 @@
+ #include <string.h>
+ #include <stdint.h>
+ #include <sys/uio.h>
++#include <gnu/option-groups.h>
+ 
+ #include <assert.h>
+ 
+@@ -124,6 +125,7 @@ No definition for %s category found"), "LC_MESSAGES"));
+     }
+   else
+     {
++#if __OPTION_POSIX_REGEXP
+       int result;
+       regex_t re;
+ 
+@@ -140,6 +142,7 @@ No definition for %s category found"), "LC_MESSAGES"));
+ 	}
+       else if (result != 0)
+ 	regfree (&re);
++#endif
+     }
+ 
+   if (messages->noexpr == NULL)
+@@ -158,6 +161,7 @@ No definition for %s category found"), "LC_MESSAGES"));
+     }
+   else
+     {
++#if __OPTION_POSIX_REGEXP
+       int result;
+       regex_t re;
+ 
+@@ -174,6 +178,7 @@ No definition for %s category found"), "LC_MESSAGES"));
+ 	}
+       else if (result != 0)
+ 	regfree (&re);
++#endif
+     }
+ }
+ 
+diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c
+index db490c6..75dc505 100644
+--- a/locale/programs/ld-time.c
++++ b/locale/programs/ld-time.c
+@@ -215,8 +215,10 @@ No definition for %s category found"), "LC_TIME"));
+ 	}
+       else
+ 	{
++	  static const uint32_t wt_fmt_ampm[]
++	    = { '%','I',':','%','M',':','%','S',' ','%','p',0 };
+ 	  time->t_fmt_ampm = "%I:%M:%S %p";
+-	  time->wt_fmt_ampm = (const uint32_t *) L"%I:%M:%S %p";
++	  time->wt_fmt_ampm = wt_fmt_ampm;
+ 	}
+     }
+ 
+@@ -226,7 +228,7 @@ No definition for %s category found"), "LC_TIME"));
+       const int days_per_month[12] = { 31, 29, 31, 30, 31, 30,
+ 				       31, 31, 30, 31 ,30, 31 };
+       size_t idx;
+-      wchar_t *wstr;
++      uint32_t *wstr;
+ 
+       time->era_entries =
+ 	(struct era_data *) xmalloc (time->num_era
+@@ -464,18 +466,18 @@ No definition for %s category found"), "LC_TIME"));
+ 	    }
+ 
+ 	  /* Now generate the wide character name and format.  */
+-	  wstr = wcschr ((wchar_t *) time->wera[idx], L':');/* end direction */
+-	  wstr = wstr ? wcschr (wstr + 1, L':') : NULL;	/* end offset */
+-	  wstr = wstr ? wcschr (wstr + 1, L':') : NULL;	/* end start */
+-	  wstr = wstr ? wcschr (wstr + 1, L':') : NULL;	/* end end */
++	  wstr = wcschr_uint32 (time->wera[idx], L':'); /* end direction */
++	  wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end offset */
++	  wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end start */
++	  wstr = wstr ? wcschr_uint32 (wstr + 1, L':') : NULL; /* end end */
+ 	  if (wstr != NULL)
+ 	    {
+-	      time->era_entries[idx].wname = (uint32_t *) wstr + 1;
+-	      wstr = wcschr (wstr + 1, L':');	/* end name */
++	      time->era_entries[idx].wname = wstr + 1;
++	      wstr = wcschr_uint32 (wstr + 1, L':'); /* end name */
+ 	      if (wstr != NULL)
+ 		{
+ 		  *wstr = L'\0';
+-		  time->era_entries[idx].wformat = (uint32_t *) wstr + 1;
++		  time->era_entries[idx].wformat = wstr + 1;
+ 		}
+ 	      else
+ 		time->era_entries[idx].wname =
+@@ -530,7 +532,16 @@ No definition for %s category found"), "LC_TIME"));
+   if (time->date_fmt == NULL)
+     time->date_fmt = "%a %b %e %H:%M:%S %Z %Y";
+   if (time->wdate_fmt == NULL)
+-    time->wdate_fmt = (const uint32_t *) L"%a %b %e %H:%M:%S %Z %Y";
++    {
++      static const uint32_t wdate_fmt[] =
++	{ '%','a',' ',
++	  '%','b',' ',
++	  '%','e',' ',
++	  '%','H',':','%','M',':','%','S',' ',
++	  '%','Z',' ',
++	  '%','Y',0 };
++      time->wdate_fmt = wdate_fmt;
++    }
+ }
+ 
+ 
+diff --git a/locale/programs/linereader.c b/locale/programs/linereader.c
+index 2e05130..653b68c 100644
+--- a/locale/programs/linereader.c
++++ b/locale/programs/linereader.c
+@@ -595,7 +595,7 @@ get_string (struct linereader *lr, const struct charmap_t *charmap,
+ {
+   int return_widestr = lr->return_widestr;
+   char *buf;
+-  wchar_t *buf2 = NULL;
++  uint32_t *buf2 = NULL;
+   size_t bufact;
+   size_t bufmax = 56;
+ 
+diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
+index 2a0f2aa..583d233 100644
+--- a/locale/programs/localedef.c
++++ b/locale/programs/localedef.c
+@@ -114,6 +114,7 @@ void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+ #define OPT_LIST_ARCHIVE 309
+ #define OPT_LITTLE_ENDIAN 400
+ #define OPT_BIG_ENDIAN 401
++#define OPT_UINT32_ALIGN 402
+ 
+ /* Definitions of arguments for argp functions.  */
+ static const struct argp_option options[] =
+@@ -150,6 +151,8 @@ static const struct argp_option options[] =
+     N_("Generate little-endian output") },
+   { "big-endian", OPT_BIG_ENDIAN, NULL, 0,
+     N_("Generate big-endian output") },
++  { "uint32-align", OPT_UINT32_ALIGN, "ALIGNMENT", 0,
++    N_("Set the target's uint32_t alignment in bytes (default 4)") },
+   { NULL, 0, NULL, 0, NULL }
+ };
+ 
+@@ -239,12 +242,14 @@ main (int argc, char *argv[])
+      ctype locale.  (P1003.2 4.35.5.2)  */
+   setlocale (LC_CTYPE, "POSIX");
+ 
++#ifndef NO_SYSCONF
+   /* Look whether the system really allows locale definitions.  POSIX
+      defines error code 3 for this situation so I think it must be
+      a fatal error (see P1003.2 4.35.8).  */
+   if (sysconf (_SC_2_LOCALEDEF) < 0)
+     WITH_CUR_LOCALE (error (3, 0, _("\
+ FATAL: system does not define `_POSIX2_LOCALEDEF'")));
++#endif
+ 
+   /* Process charmap file.  */
+   charmap = charmap_read (charmap_file, verbose, 1, be_quiet, 1);
+@@ -338,6 +343,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
+     case OPT_BIG_ENDIAN:
+       set_big_endian (true);
+       break;
++    case OPT_UINT32_ALIGN:
++      uint32_align_mask = strtol (arg, NULL, 0) - 1;
++      break;
+     case 'c':
+       force_output = 1;
+       break;
+diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
+index 33da52e..f790c4c 100644
+--- a/locale/programs/locfile.c
++++ b/locale/programs/locfile.c
+@@ -544,6 +544,9 @@ compare_files (const char *filename1, const char *filename2, size_t size,
+    machine running localedef.  */
+ bool swap_endianness_p;
+ 
++/* The target's value of __align__(uint32_t) - 1.  */
++unsigned int uint32_align_mask = 3;
++
+ /* When called outside a start_locale_structure/end_locale_structure
+    or start_locale_prelude/end_locale_prelude block, record that the
+    next byte in FILE's obstack will be the first byte of a new element.
+@@ -621,7 +624,7 @@ add_locale_string (struct locale_file *file, const char *string)
+ void
+ add_locale_wstring (struct locale_file *file, const uint32_t *string)
+ {
+-  add_locale_uint32_array (file, string, wcslen ((const wchar_t *) string) + 1);
++  add_locale_uint32_array (file, string, wcslen_uint32 (string) + 1);
+ }
+ 
+ /* Record that FILE's next element is the 32-bit integer VALUE.  */
+diff --git a/locale/programs/locfile.h b/locale/programs/locfile.h
+index 6fc441b..118b171 100644
+--- a/locale/programs/locfile.h
++++ b/locale/programs/locfile.h
+@@ -71,6 +71,8 @@ extern void write_all_categories (struct localedef_t *definitions,
+ 
+ extern bool swap_endianness_p;
+ 
++extern unsigned int uint32_align_mask;
++
+ /* Change the output to be big-endian if BIG_ENDIAN is true and
+    little-endian otherwise.  */
+ static inline void
+@@ -89,7 +91,8 @@ maybe_swap_uint32 (uint32_t value)
+ }
+ 
+ /* Likewise, but munge an array of N uint32_ts starting at ARRAY.  */
+-static inline void
++static void
++__attribute__ ((unused))
+ maybe_swap_uint32_array (uint32_t *array, size_t n)
+ {
+   if (swap_endianness_p)
+@@ -99,7 +102,8 @@ maybe_swap_uint32_array (uint32_t *array, size_t n)
+ 
+ /* Like maybe_swap_uint32_array, but the array of N elements is at
+    the end of OBSTACK's current object.  */
+-static inline void
++static void
++__attribute__ ((unused))
+ maybe_swap_uint32_obstack (struct obstack *obstack, size_t n)
+ {
+   maybe_swap_uint32_array ((uint32_t *) obstack_next_free (obstack) - n, n);
+@@ -276,4 +280,55 @@ extern void identification_output (struct localedef_t *locale,
+ 				   const struct charmap_t *charmap,
+ 				   const char *output_path);
+ 
++static size_t wcslen_uint32 (const uint32_t *str) __attribute__ ((unused));
++static uint32_t * wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
++static uint32_t * wcschr_uint32 (const uint32_t *s, uint32_t ch) __attribute__ ((unused));
++static int wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2) __attribute__ ((unused));
++static int wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n) __attribute__ ((unused));
++
++static size_t
++wcslen_uint32 (const uint32_t *str)
++{
++  size_t len = 0;
++  while (str[len] != 0)
++    len++;
++  return len;
++}
++
++static  int
++wmemcmp_uint32 (const uint32_t *s1, const uint32_t *s2, size_t n)
++{
++  while (n-- != 0)
++    {
++      int diff = *s1++ - *s2++;
++      if (diff != 0)
++	return diff;
++    }
++  return 0;
++}
++
++static int
++wcscmp_uint32 (const uint32_t *s1, const uint32_t *s2)
++{
++  while (*s1 != 0 && *s1 == *s2)
++    s1++, s2++;
++  return *s1 - *s2;
++}
++
++static uint32_t *
++wmemcpy_uint32 (uint32_t *s1, const uint32_t *s2, size_t n)
++{
++  return memcpy (s1, s2, n * sizeof (uint32_t));
++}
++
++static uint32_t *
++wcschr_uint32 (const uint32_t *s, uint32_t ch)
++{
++  do
++    if (*s == ch)
++      return (uint32_t *) s;
++  while (*s++ != 0);
++  return 0;
++}
++
+ #endif /* locfile.h */
+diff --git a/locale/setlocale.c b/locale/setlocale.c
+index fa9cb3a..8eee284 100644
+--- a/locale/setlocale.c
++++ b/locale/setlocale.c
+@@ -64,36 +64,6 @@ static char *const _nl_current_used[] =
+ #endif
+ 
+ 
+-/* Define an array of category names (also the environment variable names).  */
+-const union catnamestr_t _nl_category_names attribute_hidden =
+-  {
+-    {
+-#define DEFINE_CATEGORY(category, category_name, items, a) \
+-      category_name,
+-#include "categories.def"
+-#undef DEFINE_CATEGORY
+-    }
+-  };
+-
+-const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden =
+-  {
+-#define DEFINE_CATEGORY(category, category_name, items, a) \
+-    [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)),
+-#include "categories.def"
+-#undef DEFINE_CATEGORY
+-  };
+-
+-/* An array of their lengths, for convenience.  */
+-const uint8_t _nl_category_name_sizes[] attribute_hidden =
+-  {
+-#define DEFINE_CATEGORY(category, category_name, items, a) \
+-    [category] = sizeof (category_name) - 1,
+-#include "categories.def"
+-#undef	DEFINE_CATEGORY
+-    [LC_ALL] = sizeof ("LC_ALL") - 1
+-  };
+-
+-
+ #ifdef NL_CURRENT_INDIRECT
+ # define WEAK_POSTLOAD(postload) weak_extern (postload)
+ #else
+diff --git a/locale/xlocale.c b/locale/xlocale.c
+index fec4564..f00269c 100644
+--- a/locale/xlocale.c
++++ b/locale/xlocale.c
+@@ -18,6 +18,7 @@
+    <http://www.gnu.org/licenses/>.  */
+ 
+ #include <locale.h>
++#include <gnu/option-groups.h>
+ #include "localeinfo.h"
+ 
+ #define DEFINE_CATEGORY(category, category_name, items, a) \
+@@ -25,6 +26,19 @@ extern struct __locale_data _nl_C_##category;
+ #include "categories.def"
+ #undef	DEFINE_CATEGORY
+ 
++/* If the locale support code isn't enabled, don't generate strong
++   reference to the C locale_data structures here; let the Makefile
++   decide which ones to include.  (In the static linking case, the
++   strong reference to the 'class', 'toupper', and 'tolower' tables
++   will cause C-ctype.o to be brought in, as it should be, even when
++   the reference to _nl_C_LC_CTYPE will be weak.)  */
++#if ! __OPTION_EGLIBC_LOCALE_CODE
++# define DEFINE_CATEGORY(category, category_name, items, a) \
++  weak_extern (_nl_C_##category)
++# include "categories.def"
++# undef	DEFINE_CATEGORY
++#endif
++
+ /* Defined in locale/C-ctype.c.  */
+ extern const char _nl_C_LC_CTYPE_class[] attribute_hidden;
+ extern const char _nl_C_LC_CTYPE_toupper[] attribute_hidden;
+@@ -52,3 +66,26 @@ const struct __locale_struct _nl_C_locobj attribute_hidden =
+     .__ctype_tolower = (const int *) _nl_C_LC_CTYPE_tolower + 128,
+     .__ctype_toupper = (const int *) _nl_C_LC_CTYPE_toupper + 128
+   };
++
++
++#if ! __OPTION_EGLIBC_LOCALE_CODE
++/* When locale code is enabled, these are each defined in the
++   appropriate lc-CATEGORY.c file, so that static links (when __thread
++   is supported) bring in only those lc-CATEGORY.o files for
++   categories the program actually uses; look for NL_CURRENT_INDIRECT
++   in localeinfo.h.
++
++   When locale code is disabled, the _nl_C_CATEGORY objects are the
++   only possible referents.  At the moment, there isn't a way to get
++   __OPTION_EGLIBC_LOCALE_CODE defined in every compilation unit that
++   #includes localeinfo.h, so we can't just turn off
++   NL_CURRENT_INDIRECT.  So we'll define the _nl_current_CATEGORY
++   pointers here.  */
++#if defined (NL_CURRENT_INDIRECT)
++#define DEFINE_CATEGORY(category, category_name, items, a)      \
++  __thread struct __locale_data * const *_nl_current_##category   \
++  attribute_hidden = &_nl_C_locobj.__locales[category];
++#include "categories.def"
++#undef DEFINE_CATEGORY
++#endif
++#endif /* __OPTION_EGLIBC_LOCALE_CODE */
+diff --git a/localedata/Makefile b/localedata/Makefile
+index ebf6ac9..1870753 100644
+--- a/localedata/Makefile
++++ b/localedata/Makefile
+@@ -21,12 +21,22 @@ subdir := localedata
+ 
+ include ../Makeconfig
+ 
+-# List with all available character set descriptions.
+-charmaps := $(wildcard charmaps/[A-I]*) $(wildcard charmaps/[J-Z]*)
++include ../option-groups.mak
+ 
+ # List with all available character set descriptions.
+-locales := $(wildcard locales/*)
+-
++all-charmaps := $(wildcard charmaps/[A-I]*) $(wildcard charmaps/[J-Z]*)
++
++all-locales := $(wildcard locales/*)
++
++# If the EGLIBC_LOCALES option group is not enabled, trim the
++# list of charmap and locale source files.
++ifeq ($(OPTION_EGLIBC_LOCALES),y)
++charmaps := $(all-charmaps)
++locales  := $(all-locales)
++else
++charmaps :=
++locales  := locales/POSIX
++endif
+ 
+ subdir-dirs = tests-mbwc
+ vpath %.c tests-mbwc
+@@ -71,14 +81,20 @@ locale_test_suite := tst_iswalnum tst_iswalpha tst_iswcntrl            \
+ 		     tst_wcsxfrm tst_wctob tst_wctomb tst_wctrans      \
+ 		     tst_wctype tst_wcwidth
+ 
+-tests = $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
++# Since these tests build their own locale files, they're not
++# dependent on the OPTION_EGLIBC_LOCALES option group.  But they do
++# need the locale functions to be present.
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++     += $(locale_test_suite) tst-digits tst-setlocale bug-iconv-trans \
+ 	tst-leaks tst-mbswcs1 tst-mbswcs2 tst-mbswcs3 tst-mbswcs4 tst-mbswcs5 \
+ 	tst-mbswcs6 tst-xlocale1 tst-xlocale2 bug-usesetlocale \
+ 	tst-strfmon1 tst-sscanf bug-setlocale1 tst-setlocale2 tst-setlocale3 \
+ 	tst-wctype
++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
+ tests-static = bug-setlocale1-static
+ tests += $(tests-static)
+-ifeq (yes,$(build-shared))
++endif
++ifeq (yesy,$(build-shared)$(OPTION_EGLIBC_LOCALE_CODE))
+ ifneq (no,$(PERL))
+ tests-special += $(objpfx)mtrace-tst-leaks.out
+ endif
+@@ -95,6 +111,7 @@ tests: $(objdir)/iconvdata/gconv-modules
+ tests-static += tst-langinfo-static
+ 
+ ifeq ($(run-built-tests),yes)
++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
+ tests-special += $(objpfx)sort-test.out $(objpfx)tst-fmon.out \
+ 		 $(objpfx)tst-locale.out $(objpfx)tst-rpmatch.out \
+ 		 $(objpfx)tst-trans.out $(objpfx)tst-ctype.out \
+@@ -109,6 +126,7 @@ LOCALES := de_DE.ISO-8859-1 de_DE.UTF-8 en_US.ANSI_X3.4-1968 \
+ 	   tr_TR.ISO-8859-9 en_GB.UTF-8 uk_UA.UTF-8
+ include ../gen-locales.mk
+ endif
++endif
+ 
+ include ../Rules
+ 
+@@ -191,6 +209,11 @@ endif
+ 
+ include SUPPORTED
+ 
++# Only install locale data if OPTION_EGLIBC_LOCALES is selected.
++ifneq ($(OPTION_EGLIBC_LOCALES),y)
++SUPPORTED-LOCALES :=
++endif
++
+ INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+ 
+ # Sometimes the whole collection of locale files should be installed.
+diff --git a/login/Makefile b/login/Makefile
+index 0f4bb22..4036ddb 100644
+--- a/login/Makefile
++++ b/login/Makefile
+@@ -18,6 +18,7 @@
+ #
+ #	Sub-makefile for login portion of the library.
+ #
++include ../option-groups.mak
+ 
+ subdir	:= login
+ 
+@@ -25,14 +26,16 @@ include ../Makeconfig
+ 
+ headers	:= utmp.h bits/utmp.h lastlog.h pty.h
+ 
+-routines := getlogin getlogin_r setlogin getlogin_r_chk \
+-	    getutent getutent_r getutid getutline getutid_r getutline_r \
+-	    utmp_file utmpname updwtmp getpt grantpt unlockpt ptsname \
+-	    ptsname_r_chk
++routines := getpt grantpt unlockpt ptsname ptsname_r_chk
++routines-$(OPTION_EGLIBC_UTMP) \
++	 += getutent getutent_r getutid getutline getutid_r getutline_r \
++	    utmp_file utmpname updwtmp
++routines-$(OPTION_EGLIBC_GETLOGIN) += getlogin getlogin_r getlogin_r_chk
++routines-$(OPTION_EGLIBC_BSD) += setlogin
+ 
+ CFLAGS-grantpt.c = -DLIBEXECDIR='"$(libexecdir)"'
+ 
+-others = utmpdump
++others-$(OPTION_EGLIBC_UTMP) += utmpdump
+ 
+ ifeq (yes,$(build-pt-chown))
+ others += pt_chown
+@@ -46,8 +49,8 @@ vpath %.c programs
+ tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin
+ 
+ # Build the -lutil library with these extra functions.
+-extra-libs      := libutil
+-extra-libs-others := $(extra-libs)
++extra-libs-$(OPTION_EGLIBC_UTMP) := libutil
++extra-libs-others := $(extra-libs-y)
+ 
+ libutil-routines:= login login_tty logout logwtmp openpty forkpty
+ 
+diff --git a/malloc/Makefile b/malloc/Makefile
+index 67ed293..272ca4d 100644
+--- a/malloc/Makefile
++++ b/malloc/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Makefile for malloc routines
+ #
++include ../option-groups.mak
++
+ subdir	:= malloc
+ 
+ include ../Makeconfig
+@@ -39,9 +41,15 @@ install-lib := libmcheck.a
+ non-lib.a := libmcheck.a
+ 
+ # Additional library.
++ifeq ($(OPTION_EGLIBC_MEMUSAGE),y)
+ extra-libs = libmemusage
+ extra-libs-others = $(extra-libs)
+ 
++ifdef OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
++CPPFLAGS-memusage += -D__OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE=$(OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE)
++endif
++endif
++
+ libmemusage-routines = memusage
+ libmemusage-inhibit-o = $(filter-out .os,$(object-suffixes))
+ 
+@@ -71,7 +79,7 @@ endif
+ # Unless we get a test for the availability of libgd which also works
+ # for cross-compiling we disable the memusagestat generation in this
+ # situation.
+-ifneq ($(cross-compiling),yes)
++ifeq ($(cross-compiling)$(OPTION_EGLIBC_MEMUSAGE),noy)
+ # If the gd library is available we build the `memusagestat' program.
+ ifneq ($(LIBGD),no)
+ others: $(objpfx)memusage
+diff --git a/malloc/memusage.c b/malloc/memusage.c
+index a57ba8e..732ba9d 100644
+--- a/malloc/memusage.c
++++ b/malloc/memusage.c
+@@ -33,6 +33,7 @@
+ #include <stdint.h>
+ #include <sys/mman.h>
+ #include <sys/time.h>
++#include <gnu/option-groups.h>
+ 
+ #include <memusage.h>
+ 
+@@ -93,7 +94,11 @@ static __thread uintptr_t start_sp;
+ #define peak_stack      peak_use[1]
+ #define peak_total      peak_use[2]
+ 
+-#define DEFAULT_BUFFER_SIZE     32768
++#ifndef __OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
++# define DEFAULT_BUFFER_SIZE	32768
++#else
++# define DEFAULT_BUFFER_SIZE	__OPTION_EGLIBC_MEMUSAGE_DEFAULT_BUFFER_SIZE
++#endif
+ static size_t buffer_size;
+ 
+ static int fd = -1;
+diff --git a/malloc/memusage.sh b/malloc/memusage.sh
+index 8ab8cc2..d18f446 100755
+--- a/malloc/memusage.sh
++++ b/malloc/memusage.sh
+@@ -35,7 +35,7 @@ do_missing_arg() {
+ 
+ # Print help message
+ do_help() {
+-  echo $"Usage: memusage [OPTION]... PROGRAM [PROGRAMOPTION]...
++  printf $"Usage: memusage [OPTION]... PROGRAM [PROGRAMOPTION]...
+ Profile memory usage of PROGRAM.
+ 
+    -n,--progname=NAME     Name of the program file to profile
+diff --git a/math/Makefile b/math/Makefile
+index 6388bae..ed1c511 100644
+--- a/math/Makefile
++++ b/math/Makefile
+@@ -21,6 +21,8 @@ subdir		:= math
+ 
+ include ../Makeconfig
+ 
++include ../option-groups.mak
++
+ # Installed header files.
+ headers		:= math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
+ 		   bits/huge_valf.h bits/huge_vall.h bits/inf.h bits/nan.h \
+@@ -34,8 +36,8 @@ aux		:= setfpucw fpu_control
+ 
+ # Build the -lm library.
+ 
+-extra-libs	:= libm
+-extra-libs-others = $(extra-libs)
++extra-libs-$(OPTION_EGLIBC_LIBM) := libm
++extra-libs-others-$(OPTION_EGLIBC_LIBM) = $(extra-libs-$(OPTION_EGLIBC_LIBM))
+ 
+ libm-support = s_lib_version s_matherr s_signgam			\
+ 	       fclrexcpt fgetexcptflg fraiseexcpt fsetexcptflg		\
+diff --git a/misc/Makefile b/misc/Makefile
+index aecb0da..e6b7c23 100644
+--- a/misc/Makefile
++++ b/misc/Makefile
+@@ -19,6 +19,10 @@
+ #	Sub-makefile for misc portion of the library.
+ #
+ 
++# Some system-dependent implementations of these functions use option
++# groups (see sysdeps/unix/sysv/linux/Makefile, for example).
++include ../option-groups.mak
++
+ subdir	:= misc
+ 
+ include ../Makeconfig
+@@ -46,40 +50,47 @@ routines := brk sbrk sstk ioctl \
+ 	    select pselect \
+ 	    acct chroot fsync sync fdatasync syncfs reboot \
+ 	    gethostid sethostid \
+-	    revoke vhangup \
++	    vhangup \
+ 	    swapon swapoff mktemp mkstemp mkstemp64 mkdtemp \
+ 	    mkostemp mkostemp64 mkstemps mkstemps64 mkostemps mkostemps64 \
+ 	    ualarm usleep \
+ 	    gtty stty \
+ 	    ptrace \
+-	    fstab mntent mntent_r \
++	    mntent mntent_r \
+ 	    utimes lutimes futimes futimesat \
+ 	    truncate ftruncate truncate64 ftruncate64 \
+-	    chflags fchflags \
+ 	    insremque getttyent getusershell getpass ttyslot \
+ 	    syslog syscall daemon \
+ 	    mmap mmap64 munmap mprotect msync madvise mincore remap_file_pages\
+ 	    mlock munlock mlockall munlockall \
+-	    efgcvt efgcvt_r qefgcvt qefgcvt_r \
+ 	    hsearch hsearch_r tsearch lsearch \
+ 	    err error ustat \
+-	    getsysstats dirname regexp \
++	    getsysstats dirname \
+ 	    getloadavg getclktck \
+ 	    fgetxattr flistxattr fremovexattr fsetxattr getxattr \
+ 	    listxattr lgetxattr llistxattr lremovexattr lsetxattr \
+ 	    removexattr setxattr getauxval ifunc-impl-list
+ 
++routines-$(OPTION_POSIX_REGEXP) += regexp
++routines-$(OPTION_EGLIBC_FSTAB) += fstab
++routines-$(OPTION_EGLIBC_BSD) += chflags fchflags revoke
++routines-$(OPTION_EGLIBC_FCVT) += efgcvt efgcvt_r qefgcvt qefgcvt_r
++
+ generated += tst-error1.mtrace tst-error1-mem.out
+ 
+ aux := init-misc
+ install-lib := libg.a
+ gpl2lgpl := error.c error.h
+ 
+-tests := tst-dirname tst-tsearch tst-fdset tst-efgcvt tst-mntent tst-hsearch \
+-	 tst-error1 tst-pselect tst-insremque tst-mntent2 bug-hsearch1
++tests := tst-dirname tst-tsearch tst-fdset tst-mntent tst-hsearch \
++	 tst-pselect tst-insremque tst-mntent2 bug-hsearch1
++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += tst-error1
++tests-$(OPTION_EGLIBC_FCVT) += tst-efgcvt
+ ifeq ($(run-built-tests),yes)
++ifeq (y,$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO))
+ tests-special += $(objpfx)tst-error1-mem.out
+ endif
++endif
+ 
+ CFLAGS-select.c = -fexceptions -fasynchronous-unwind-tables
+ CFLAGS-tsearch.c = $(uses-callbacks)
+diff --git a/misc/err.c b/misc/err.c
+index 7b98157..efce8d5 100644
+--- a/misc/err.c
++++ b/misc/err.c
+@@ -22,6 +22,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <stdio.h>
++#include <gnu/option-groups.h>
+ 
+ #include <wchar.h>
+ #define flockfile(s) _IO_flockfile (s)
+@@ -37,6 +38,7 @@ extern char *__progname;
+   va_end (ap);								      \
+ }
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ static void
+ convert_and_print (const char *format, __gnuc_va_list ap)
+ {
+@@ -81,6 +83,7 @@ convert_and_print (const char *format, __gnuc_va_list ap)
+ 
+   __vfwprintf (stderr, wformat, ap);
+ }
++#endif
+ 
+ void
+ vwarnx (const char *format, __gnuc_va_list ap)
+@@ -88,9 +91,13 @@ vwarnx (const char *format, __gnuc_va_list ap)
+   flockfile (stderr);
+   if (_IO_fwide (stderr, 0) > 0)
+     {
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+       __fwprintf (stderr, L"%s: ", __progname);
+       convert_and_print (format, ap);
+       putwc_unlocked (L'\n', stderr);
++#else
++      abort ();
++#endif
+     }
+   else
+     {
+@@ -111,6 +118,7 @@ vwarn (const char *format, __gnuc_va_list ap)
+   flockfile (stderr);
+   if (_IO_fwide (stderr, 0) > 0)
+     {
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+       __fwprintf (stderr, L"%s: ", __progname);
+       if (format)
+ 	{
+@@ -119,6 +127,9 @@ vwarn (const char *format, __gnuc_va_list ap)
+ 	}
+       __set_errno (error);
+       __fwprintf (stderr, L"%m\n");
++#else
++      abort ();
++#endif
+     }
+   else
+     {
+diff --git a/misc/error.c b/misc/error.c
+index aaa120d..d6cbc82 100644
+--- a/misc/error.c
++++ b/misc/error.c
+@@ -35,6 +35,7 @@
+ #endif
+ 
+ #ifdef _LIBC
++# include <gnu/option-groups.h>
+ # include <libintl.h>
+ # include <stdbool.h>
+ # include <stdint.h>
+@@ -205,6 +206,7 @@ error_tail (int status, int errnum, const char *message, va_list args)
+ #if _LIBC
+   if (_IO_fwide (stderr, 0) > 0)
+     {
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+       size_t len = strlen (message) + 1;
+       wchar_t *wmessage = NULL;
+       mbstate_t st;
+@@ -265,6 +267,9 @@ error_tail (int status, int errnum, const char *message, va_list args)
+ 
+       if (use_malloc)
+ 	free (wmessage);
++#else
++      abort ();
++#endif
+     }
+   else
+ #endif
+diff --git a/misc/tst-efgcvt.c b/misc/tst-efgcvt.c
+index 5083fec..79ed36c 100644
+--- a/misc/tst-efgcvt.c
++++ b/misc/tst-efgcvt.c
+@@ -59,7 +59,7 @@ static testcase ecvt_tests[] =
+   { 123.01, -4, 3, "" },
+   { 126.71, -4, 3, "" },
+   { 0.0, 4, 1, "0000" },
+-#if DBL_MANT_DIG == 53
++#if DBL_MANT_DIG == 53 && !(defined __powerpc__ && defined __NO_FPRS__ && !defined _SOFT_FLOAT && !defined _SOFT_DOUBLE)
+   { 0x1p-1074, 3, -323, "494" },
+   { -0x1p-1074, 3, -323, "494" },
+ #endif
+diff --git a/nis/Makefile b/nis/Makefile
+index 037e674..c967850 100644
+--- a/nis/Makefile
++++ b/nis/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Makefile for NIS/NIS+ part.
+ #
++include ../option-groups.mak
++
+ subdir	:= nis
+ 
+ include ../Makeconfig
+@@ -30,19 +32,26 @@ endif
+ 
+ # These are the databases available for the nis (and perhaps later nisplus)
+ # service.  This must be a superset of the services in nss.
+-databases		= proto service hosts network grp pwd rpc ethers \
+-			  spwd netgrp alias publickey
++databases-y		:= proto service hosts network grp pwd rpc ethers \
++			   spwd netgrp publickey
++databases-$(OPTION_EGLIBC_DB_ALIASES) += alias
+ 
+ # Specify rules for the nss_* modules.
+-services		:= nis nisplus compat
++# The 'compat' module includes nis support, and the 'nss' directory
++# includes a bare-bones "files" library, so we'll include 'compat' in
++# OPTION_EGLIBC_NIS.
++services-y		:=
++services-$(OPTION_EGLIBC_NIS) += nis nisplus compat
++
++extra-libs-$(OPTION_EGLIBC_NIS) += libnsl
++extra-libs-y		+= $(services-y:%=libnss_%)
+ 
+-extra-libs		= libnsl $(services:%=libnss_%)
+ # These libraries will be built in the `others' pass rather than
+ # the `lib' pass, because they depend on libc.so being built already.
+-extra-libs-others	= $(extra-libs)
++extra-libs-others-y	+= $(extra-libs-y)
+ 
+ # The sources are found in the appropriate subdir.
+-subdir-dirs = $(services:%=nss_%)
++subdir-dirs = $(services-y:%=nss_%)
+ vpath %.c $(subdir-dirs)
+ 
+ libnsl-routines = yp_xdr ypclnt ypupdate_xdr \
+@@ -60,11 +69,11 @@ libnsl-routines = yp_xdr ypclnt ypupdate_xdr \
+ libnss_compat-routines	:= $(addprefix compat-,grp pwd spwd initgroups)
+ libnss_compat-inhibit-o	= $(filter-out .os,$(object-suffixes))
+ 
+-libnss_nis-routines	:= $(addprefix nis-,$(databases)) nis-initgroups \
++libnss_nis-routines	:= $(addprefix nis-,$(databases-y)) nis-initgroups \
+ 			   nss-nis
+ libnss_nis-inhibit-o	= $(filter-out .os,$(object-suffixes))
+ 
+-libnss_nisplus-routines	:= $(addprefix nisplus-,$(databases)) nisplus-parser \
++libnss_nisplus-routines	:= $(addprefix nisplus-,$(databases-y)) nisplus-parser \
+ 			   nss-nisplus nisplus-initgroups
+ libnss_nisplus-inhibit-o = $(filter-out .os,$(object-suffixes))
+ 
+@@ -80,12 +89,12 @@ libnsl-libc = $(common-objpfx)linkobj/libc.so
+ # Target-specific variable setting to link objects using deprecated
+ # RPC interfaces with the version of libc.so that makes them available
+ # for new links:
+-$(services:%=$(objpfx)libnss_%.so) $(objpfx)libnsl.so: \
++$(services-y:%=$(objpfx)libnss_%.so) $(objpfx)libnsl.so: \
+   libc-for-link = $(libnsl-libc)
+ 
+ 
+ ifeq ($(build-shared),yes)
+-$(others:%=$(objpfx)%): $(objpfx)libnsl.so$(libnsl.so-version)
++$(others-y:%=$(objpfx)%): $(objpfx)libnsl.so$(libnsl.so-version)
+ else
+-$(others:%=$(objpfx)%): $(objpfx)libnsl.a
++$(others-y:%=$(objpfx)%): $(objpfx)libnsl.a
+ endif
+diff --git a/nptl/Makefile b/nptl/Makefile
+index aaca0a4..596ca3c 100644
+--- a/nptl/Makefile
++++ b/nptl/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Sub-makefile for NPTL portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= nptl
+ 
+ include ../Makeconfig
+@@ -118,7 +120,7 @@ libpthread-routines = nptl-init vars events version pt-interp \
+ 		      pt-raise pt-system \
+ 		      flockfile ftrylockfile funlockfile \
+ 		      sigaction \
+-		      herrno res pt-allocrtsig \
++		      pt-allocrtsig \
+ 		      pthread_kill_other_threads \
+ 		      pthread_getaffinity pthread_setaffinity \
+ 		      pthread_attr_getaffinity pthread_attr_setaffinity \
+@@ -138,8 +140,10 @@ libpthread-routines = nptl-init vars events version pt-interp \
+ #		      pthread_setgid pthread_setegid pthread_setregid \
+ #		      pthread_setresgid
+ 
++libpthread-routines-$(OPTION_EGLIBC_INET) := herrno res
+ libpthread-shared-only-routines = version pt-interp pt-allocrtsig \
+ 				  unwind-forcedunwind
++
+ libpthread-static-only-routines = pthread_atfork
+ 
+ # Since cancellation handling is in large parts handled using exceptions
+@@ -220,7 +224,7 @@ tests = tst-typesizes \
+ 	tst-mutexpi1 tst-mutexpi2 tst-mutexpi3 tst-mutexpi4 tst-mutexpi5 \
+ 	tst-mutexpi5a tst-mutexpi6 tst-mutexpi7 tst-mutexpi7a tst-mutexpi8 \
+ 	tst-mutexpi9 \
+-	tst-spin1 tst-spin2 tst-spin3 tst-spin4 \
++	tst-spin1 tst-spin2 tst-spin3 \
+ 	tst-cond1 tst-cond2 tst-cond3 tst-cond4 tst-cond5 tst-cond6 tst-cond7 \
+ 	tst-cond8 tst-cond9 tst-cond10 tst-cond11 tst-cond12 tst-cond13 \
+ 	tst-cond14 tst-cond15 tst-cond16 tst-cond17 tst-cond18 tst-cond19 \
+@@ -256,14 +260,14 @@ tests = tst-typesizes \
+ 	tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \
+ 	tst-cancel11 tst-cancel12 tst-cancel13 tst-cancel14 tst-cancel15 \
+ 	tst-cancel16 tst-cancel17 tst-cancel18 tst-cancel19 tst-cancel20 \
+-	tst-cancel21 tst-cancel22 tst-cancel23 tst-cancel24 tst-cancel25 \
++	tst-cancel21 tst-cancel22 tst-cancel23 tst-cancel25 \
+ 	tst-cancel-self tst-cancel-self-cancelstate \
+ 	tst-cancel-self-canceltype tst-cancel-self-testcancel \
+ 	tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \
+ 	tst-flock1 tst-flock2 \
+ 	tst-signal1 tst-signal2 tst-signal3 tst-signal4 tst-signal5 \
+ 	tst-signal6 tst-signal7 \
+-	tst-exec1 tst-exec2 tst-exec3 tst-exec4 \
++	tst-exec2 tst-exec3 tst-exec4 \
+ 	tst-exit1 tst-exit2 tst-exit3 \
+ 	tst-stdio1 tst-stdio2 \
+ 	tst-stack1 tst-stack2 tst-stack3 tst-stack4 tst-pthread-getattr \
+@@ -271,13 +275,12 @@ tests = tst-typesizes \
+ 	tst-unload \
+ 	tst-dlsym1 \
+ 	tst-sysconf \
+-	tst-locale1 tst-locale2 \
++	tst-locale2 \
+ 	tst-umask1 \
+ 	tst-popen1 \
+ 	tst-clock1 \
+ 	tst-context1 \
+ 	tst-sched1 \
+-	tst-backtrace1 \
+ 	tst-abstime \
+ 	tst-vfork1 tst-vfork2 tst-vfork1x tst-vfork2x \
+ 	tst-getpid3 \
+@@ -288,9 +291,16 @@ xtests = tst-setuid1 tst-setuid1-static tst-setuid2 \
+ 	tst-mutexpp1 tst-mutexpp6 tst-mutexpp10
+ test-srcs = tst-oddstacklimit
+ 
+-# Test expected to fail on most targets (except x86_64) due to bug
+-# 18435 - pthread_once hangs when init routine throws an exception.
+-test-xfail-tst-once5 = yes
++# This test uses the posix_spawn functions.
++tests-$(OPTION_EGLIBC_SPAWN) += tst-exec1
++
++# This test uses the 'backtrace' functions.
++tests-$(OPTION_EGLIBC_BACKTRACE) += tst-backtrace1
++
++# This test is written in C++.
++tests-$(OPTION_EGLIBC_CXX_TESTS) += tst-cancel24
++
++tests-$(OPTION_EGLIBC_LOCALE_CODE) += tst-locale1
+ 
+ # Files which must not be linked with libpthread.
+ tests-nolibpthread = tst-unload
+diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
+index d10f4ea..14257ce 100644
+--- a/nptl/pthread_create.c
++++ b/nptl/pthread_create.c
+@@ -33,6 +33,7 @@
+ #include <default-sched.h>
+ #include <futex-internal.h>
+ 
++#include <gnu/option-groups.h>
+ #include <shlib-compat.h>
+ 
+ #include <stap-probe.h>
+@@ -262,8 +263,10 @@ START_THREAD_DEFN
+   THREAD_SETMEM (pd, cpuclock_offset, now);
+ #endif
+ 
++#if __OPTION_EGLIBC_INET
+   /* Initialize resolver state pointer.  */
+   __resp = &pd->res;
++#endif
+ 
+   /* Initialize pointers to locale data.  */
+   __ctype_init ();
+@@ -346,8 +349,10 @@ START_THREAD_DEFN
+   /* Run the destructor for the thread-local data.  */
+   __nptl_deallocate_tsd ();
+ 
++#if __OPTION_EGLIBC_INET
+   /* Clean up any state libc stored in thread-local variables.  */
+   __libc_thread_freeres ();
++#endif
+ 
+   /* If this is the last thread we terminate the process now.  We
+      do not notify the debugger, it might just irritate it if there
+diff --git a/nscd/Makefile b/nscd/Makefile
+index ede941d..f4f3f8d 100644
+--- a/nscd/Makefile
++++ b/nscd/Makefile
+@@ -18,14 +18,17 @@
+ #
+ #	Sub-makefile for nscd portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= nscd
+ 
+ include ../Makeconfig
+ 
+ ifneq ($(use-nscd),no)
+-routines := nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \
++routines-$(OPTION_EGLIBC_INET) += \
++	     nscd_getpw_r nscd_getgr_r nscd_gethst_r nscd_getai \
+ 	    nscd_initgroups nscd_getserv_r nscd_netgroup
+-aux	:= nscd_helper
++aux-$(OPTION_EGLIBC_INET) += nscd_helper
+ endif
+ 
+ # To find xmalloc.c
+@@ -37,14 +40,18 @@ nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \
+ 		dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \
+ 		xmalloc xstrdup aicache initgrcache gai res_hconf \
+ 		netgroupcache
+-
++ifneq (y,$(OPTION_EGLIBC_NIS))
++# If we haven't build libnsl.so, then we'll need to include our
++# own copy of nis_hash.
++nscd-modules += nis_hash
++endif
+ ifeq ($(build-nscd)$(have-thread-library),yesyes)
+ 
+-others += nscd
+-others-pie += nscd
+-install-sbin := nscd
++others-$(OPTION_EGLIBC_INET) += nscd
++others-pie-$(OPTION_EGLIBC_INET) += nscd
++install-sbin-$(OPTION_EGLIBC_INET) += nscd
+ 
+-extra-objs = $(nscd-modules:=.o)
++extra-objs-$(OPTION_EGLIBC_INET) += $(nscd-modules:=.o)
+ 
+ endif
+ 
+@@ -100,7 +107,15 @@ include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+ $(objpfx)nscd: $(nscd-modules:%=$(objpfx)%.o)
+ 
+ ifeq ($(build-shared),yes)
+-$(objpfx)nscd: $(shared-thread-library) $(common-objpfx)nis/libnsl.so
++$(objpfx)nscd: $(shared-thread-library)
++else
++$(objpfx)nscd: $(static-thread-library)
++endif
++
++ifeq (y,$(OPTION_EGLIBC_NIS))
++ifeq ($(build-shared),yes)
++$(objpfx)nscd: $(common-objpfx)nis/libnsl.so
+ else
+-$(objpfx)nscd: $(static-thread-library) $(common-objpfx)nis/libnsl.a
++$(objpfx)nscd: $(common-objpfx)nis/libnsl.a
++endif
+ endif
+diff --git a/nscd/nis_hash.c b/nscd/nis_hash.c
+new file mode 100644
+index 0000000..d244c41
+--- /dev/null
++++ b/nscd/nis_hash.c
+@@ -0,0 +1,3 @@
++/* If OPTION_EGLIBC_NIS is disabled, nscd can't get this from libnsl.so;
++   we need our own copy.  */
++#include "../nis/nis_hash.c"
+diff --git a/nss/Makefile b/nss/Makefile
+index 65ab7b5..19f0aef 100644
+--- a/nss/Makefile
++++ b/nss/Makefile
+@@ -18,28 +18,35 @@
+ #
+ #	Makefile for name service switch.
+ #
++include ../option-groups.mak
++
+ subdir	:= nss
+ 
+ include ../Makeconfig
+ 
+ headers			:= nss.h
+ 
+-# This is the trivial part which goes into libc itself.
+-routines		= nsswitch getnssent getnssent_r digits_dots \
+-			  $(addsuffix -lookup,$(databases))
+-
+ # These are the databases that go through nss dispatch.
+ # Caution: if you add a database here, you must add its real name
+ # in databases.def, too.
+-databases		= proto service hosts network grp pwd ethers \
+-			  spwd netgrp alias sgrp
++databases-y		= grp pwd spwd sgrp
++databases-$(OPTION_EGLIBC_INET) \
++			+= proto service hosts network ethers \
++			   netgrp
++databases-$(OPTION_EGLIBC_DB_ALIASES) += alias
++
++routines-$(OPTION_EGLIBC_INET) += digits_dots
+ 
+ ifneq (,$(filter sunrpc,$(subdirs)))
+-databases		+= key rpc
++databases-$(OPTION_EGLIBC_INET)	+= key rpc
+ have-sunrpc		:= 1
+ else
+ have-sunrpc		:= 0
+ endif
++# This is the trivial part which goes into libc itself.
++routines-y		+= nsswitch getnssent getnssent_r \
++			  $(addsuffix -lookup,$(databases-y))
++
+ CPPFLAGS-getent.c	= -DHAVE_SUNRPC=$(have-sunrpc)
+ 
+ others                  := getent makedb
+@@ -47,8 +54,9 @@ install-bin             := getent makedb
+ makedb-modules = xmalloc hash-string
+ extra-objs		+= $(makedb-modules:=.o)
+ 
+-tests			= test-netdb tst-nss-test1 test-digits-dots tst-nss-getpwent
+-xtests			= bug-erange
++tests			= tst-nss-test1 tst-nss-getpwent
++tests-$(OPTION_EGLIBC_INET)	+= test-netdb test-digits-dots
++xtests-$(OPTION_EGLIBC_INET)	+= bug-erange
+ 
+ # Specify rules for the nss_* modules.  We have some services.
+ services		:= files db
+@@ -63,7 +71,7 @@ subdir-dirs = $(services:%=nss_%)
+ vpath %.c $(subdir-dirs) ../locale/programs ../intl
+ 
+ 
+-libnss_files-routines	:= $(addprefix files-,$(databases)) \
++libnss_files-routines	:= $(addprefix files-,$(databases-y)) \
+ 			   files-initgroups files-have_o_cloexec files-init
+ 
+ libnss_db-dbs		:= $(addprefix db-,\
+@@ -86,6 +94,45 @@ tests-static		= tst-nss-static
+ tests			+= $(tests-static)
+ endif
+ 
++ifneq ($(OPTION_EGLIBC_NSSWITCH),y)
++
++ifndef OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG
++$(error OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG variable left unset)
++endif
++
++ifndef OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS
++$(error OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS variable left unset)
++endif
++
++ifeq (,$(wildcard $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG)))
++$(warning OPTION_EGLIBC_NSSWITCH is disabled, but fixed config file)
++$(error does not exist: $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG))
++endif
++
++ifeq (,$(wildcard $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)))
++$(warning OPTION_EGLIBC_NSSWITCH is disabled, but fixed functions file)
++$(error does not exist: $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS))
++endif
++
++before-compile := $(objpfx)fixed-nsswitch.h
++generated := fixed-nsswitch.h
++$(objpfx)fixed-nsswitch.h $(objfpx)fixed-nsswitch-libs:	\
++    $(objpfx)gen-fixed-nsswitch				\
++    $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG)
++	$< $(objpfx)fixed-nsswitch.h			\
++	   $(objpfx)fixed-nsswitch-libs			\
++	   $(OPTION_EGLIBC_NSSWITCH_FIXED_CONFIG)
++
++$(objpfx)gen-fixed-nsswitch: gen-fixed-nsswitch.c	\
++    $(common-objpfx)option-groups.config		\
++    $(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)
++	$(native-compile)
++gen-fixed-nsswitch-CFLAGS =						\
++	-g3 -O -Wall							\
++	-I $(objpfx)							\
++	-DFIXED_FUNCTIONS='"$(OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS)"'
++endif
++
+ include ../Rules
+ 
+ ifeq (yes,$(have-selinux))
+diff --git a/nss/fixed-nsswitch.conf b/nss/fixed-nsswitch.conf
+new file mode 100644
+index 0000000..91bb675
+--- /dev/null
++++ b/nss/fixed-nsswitch.conf
+@@ -0,0 +1,22 @@
++# /etc/nsswitch.conf
++#
++# Example configuration for fixed name service.
++# See the description of OPTION_EGLIBC_NSSWITCH in option-groups.def
++# for details.
++#
++
++aliases:        files
++
++passwd:         files
++group:          files
++shadow:         files
++
++hosts:          files dns
++networks:       files dns
++
++protocols:      files
++services:       files
++ethers:         files
++rpc:            files
++
++netgroup:       files
+diff --git a/nss/fixed-nsswitch.functions b/nss/fixed-nsswitch.functions
+new file mode 100644
+index 0000000..2f3fa83
+--- /dev/null
++++ b/nss/fixed-nsswitch.functions
+@@ -0,0 +1,121 @@
++/* List of functions defined for fixed NSS in GNU C Library.
++   Copyright (C) 1996, 1997, 1998, 2005 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++/* When OPTION_EGLIBC_NSSWITCH is disabled (see option-groups.def),
++   EGLIBC does not use the 'dlopen' and 'dlsym' functions to look for
++   database query functions in the individual name service libraries.
++   Instead, it uses a set of functions chosen at compile time, as
++   directed by the OPTION_EGLIBC_NSSWITCH_FIXED_FUNCTIONS file.  This
++   file is a sample of what you might use there.
++
++   This file is C source code; it should only contain invocations of
++   the following macros:
++
++   - DEFINE_ENT (DATABASE, SERVICE, X)
++
++     Declare the 'setXent', 'getXent_r', and 'endXent' functions that
++     query DATABASE using the service library 'libnss_SERVICE.so.2'.
++     DATABASE should be the full name of the database as it appears in
++     'nsswitch.conf', like 'passwd' or 'aliases'.
++
++     (The non-reentrant 'getXent' functions are implemented in terms
++     of the reentrant 'getXent_r' functions, so there is no need to
++     refer to them explicitly here.)
++
++   - DEFINE_GETBY (DATABASE, SERVICE, X, KEY)
++
++     Declare the 'getXbyKEY_r' functions that query DATABASE using
++     SERVICE.  DATABASE and SERVICE are as described above.
++
++     (The non-reentrant 'getXbyKEY' functions are implemented in terms
++     of the reentrant 'getXbyKEY_r' functions, so there is no need to
++     refer to them explicitly here.)
++
++     Use the special key 'name3' for the service library function that
++     implements the 'getaddrinfo' function.
++
++   - DEFINE_GET (DATABASE, SERVICE, QUERY)
++
++     Declare the 'getQUERY_r' functions that query DATABASE using
++     SERVICE.  This is used for functions like 'getpwnam'.
++
++     (The non-reentrant 'getQUERY' functions are implemented in terms
++     of the reentrant 'getQUERY_r' functions, so there is no need to
++     refer to them explicitly here.)
++
++   This sample file only includes functions that consult the files in
++   '/etc', and the Domain Name System (DNS).  */
++
++/* aliases */
++DEFINE_ENT (aliases, files, alias)
++DEFINE_GETBY (aliases, files, alias, name)
++
++/* ethers */
++DEFINE_ENT (ethers, files, ether)
++
++/* group */
++DEFINE_ENT (group, files, gr)
++DEFINE_GET (group, files, grgid)
++DEFINE_GET (group, files, grnam)
++
++/* hosts */
++DEFINE_ENT (hosts, files, host)
++DEFINE_GETBY (hosts, files, host, addr)
++DEFINE_GETBY (hosts, files, host, name)
++DEFINE_GETBY (hosts, files, host, name2)
++DEFINE_GET (hosts, files, hostton)
++DEFINE_GET (hosts, files, ntohost)
++DEFINE_GETBY (hosts, dns, host, addr)
++DEFINE_GETBY (hosts, dns, host, name)
++DEFINE_GETBY (hosts, dns, host, name2)
++DEFINE_GETBY (hosts, dns, host, name3)
++
++/* netgroup */
++DEFINE_ENT (netgroup, files, netgr)
++
++/* networks */
++DEFINE_ENT (networks, files, net)
++DEFINE_GETBY (networks, files, net, name)
++DEFINE_GETBY (networks, files, net, addr)
++DEFINE_GETBY (networks, dns, net, name)
++DEFINE_GETBY (networks, dns, net, addr)
++
++/* protocols */
++DEFINE_ENT (protocols, files, proto)
++DEFINE_GETBY (protocols, files, proto, name)
++DEFINE_GETBY (protocols, files, proto, number)
++
++/* passwd */
++DEFINE_ENT (passwd, files, pw)
++DEFINE_GET (passwd, files, pwnam)
++DEFINE_GET (passwd, files, pwuid)
++
++/* rpc */
++DEFINE_ENT (rpc, files, rpc)
++DEFINE_GETBY (rpc, files, rpc, name)
++DEFINE_GETBY (rpc, files, rpc, number)
++
++/* services */
++DEFINE_ENT (services, files, serv)
++DEFINE_GETBY (services, files, serv, name)
++DEFINE_GETBY (services, files, serv, port)
++
++/* shadow */
++DEFINE_ENT (shadow, files, sp)
++DEFINE_GET (shadow, files, spnam)
+diff --git a/nss/gen-fixed-nsswitch.c b/nss/gen-fixed-nsswitch.c
+new file mode 100644
+index 0000000..6e1c98c
+--- /dev/null
++++ b/nss/gen-fixed-nsswitch.c
+@@ -0,0 +1,803 @@
++/* gen-fixed-nsswitch.c --- generate fixed name service data structures
++   Copyright (C) 1996-1999, 2001-2006, 2007 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#define _GNU_SOURCE
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <errno.h>
++#include <string.h>
++#include <stdarg.h>
++#include <assert.h>
++#include <ctype.h>
++
++#include "gnu/lib-names.h"
++#include "nss.h"
++
++/* Provide a fallback definition to allow this file to be compiled outside
++   libc.  */
++#ifndef internal_function
++# define internal_function
++#endif
++
++
++/* Simple utilities.  */
++
++void __attribute__ ((noreturn))
++error (const char *message)
++{
++  fprintf (stderr, "%s\n", message);
++  exit (1);
++}
++
++
++void *
++check_alloc (void *p)
++{
++  if (p)
++    return p;
++  else
++    error ("out of memory");
++}
++
++void *
++xmalloc (size_t size)
++{
++  return check_alloc (malloc (size));
++}
++
++
++/* Format ARGS according to FORMAT, and return the result as a
++   malloc'ed string.  */
++char *
++saprintf (const char *format, ...)
++{
++  va_list args;
++  size_t len;
++  char *buf;
++
++  va_start (args, format);
++  len = vsnprintf (NULL, 0, format, args);
++  va_end (args);
++
++  buf = xmalloc (len + 1);
++  va_start (args, format);
++  assert (len == vsnprintf (buf, len + 1, format, args));
++  va_end (args);
++
++  return buf;
++}
++
++
++
++/* Data structures representing the configuration file in memory.  */
++
++/* These are copied from nsswitch.h.
++
++   We could simply #include that file, but this program runs on the
++   build machine and links against the build machine's libraries,
++   whereas that header is meant for use by target code; it uses
++   'libc_hidden_proto', 'internal_function', and related hair.  Since
++   we've copied the parsing code, we might as well copy the data
++   structure definitions as well.  */
++
++/* Actions performed after lookup finished.  */
++typedef enum
++{
++  NSS_ACTION_CONTINUE,
++  NSS_ACTION_RETURN
++} lookup_actions;
++
++
++typedef struct service_library
++{
++  /* Name of service (`files', `dns', `nis', ...).  */
++  const char *name;
++  /* Pointer to the loaded shared library.  */
++  void *lib_handle;
++  /* And the link to the next entry.  */
++  struct service_library *next;
++} service_library;
++
++
++/* For mapping a function name to a function pointer.  It is known in
++   nsswitch.c:nss_lookup_function that a string pointer for the lookup key
++   is the first member.  */
++typedef struct
++{
++  const char *fct_name;
++  void *fct_ptr;
++} known_function;
++
++
++typedef struct service_user
++{
++  /* And the link to the next entry.  */
++  struct service_user *next;
++  /* Action according to result.  */
++  lookup_actions actions[5];
++  /* Link to the underlying library object.  */
++  service_library *library;
++  /* Collection of known functions.
++
++     With OPTION_EGLIBC_NSSWITCH enabled, this is the root of a
++     'tsearch'-style tree.
++
++     With OPTION_EGLIBC_NSSWITCH disabled, this is an array of
++     pointers to known_function structures, NULL-terminated.  */
++  union
++  {
++    void *tree;
++    const known_function **array;
++  } known;
++  /* Name of the service (`files', `dns', `nis', ...).  */
++  const char *name;
++} service_user;
++
++/* To access the action based on the status value use this macro.  */
++#define nss_next_action(ni, status) ((ni)->actions[2 + status])
++
++
++typedef struct name_database_entry
++{
++  /* And the link to the next entry.  */
++  struct name_database_entry *next;
++  /* List of service to be used.  */
++  service_user *service;
++  /* Name of the database.  */
++  const char *name;
++} name_database_entry;
++
++
++typedef struct name_database
++{
++  /* List of all known databases.  */
++  name_database_entry *entry;
++  /* List of libraries with service implementation.  */
++  service_library *library;
++} name_database;
++
++
++
++/* Gathering the contents of the FIXED_FUNCTIONS file.  */
++
++/* It should be possible to generate this list automatically by
++   looking at the services and databases used in the nsswitch.conf
++   file, and having a hard-coded set of queries supported on each
++   database.  */
++
++/* We #include the FIXED_FUNCTIONS file several times to build an
++   array of function structures holding its data.  */
++enum function_kind {
++  fk_end = 0,                   /* Last entry.  */
++  fk_setent,                    /* Like setpwent.  */
++  fk_getent,                    /* Like getpwent.  */
++  fk_endent,                    /* Like endpwent.  */
++  fk_getby,                     /* Like gethostbyname.  */
++  fk_get                        /* Like getpwnam.  */
++};
++
++
++struct function {
++  /* What kind of function this is.  */
++  enum function_kind kind;
++
++  /* The database and service of the function being hardwired in.  */
++  char *database, *service;
++
++  /* The kind of entry being queried, for 'fk_setent', 'fk_getent',
++     'fk_endent', and 'fk_getby' functions.  */
++  char *entry;
++
++  /* The key, for 'fk_getby' entries.  */
++  char *key;
++
++  /* The value and key, for 'fk_get' entries.  */
++  char *value_and_key;
++};
++
++
++const struct function functions[] =
++  {
++
++#define DEFINE_ENT(database, service, entry)    \
++    { fk_setent, #database, #service, #entry }, \
++    { fk_getent, #database, #service, #entry }, \
++    { fk_endent, #database, #service, #entry },
++#define DEFINE_GETBY(database, service, entry, key)   \
++    { fk_getby, #database, #service, #entry, #key },
++#define DEFINE_GET(database, service, value_and_key)     \
++    { fk_get, #database, #service, NULL, NULL, #value_and_key },
++
++#include FIXED_FUNCTIONS
++
++#undef DEFINE_ENT
++#undef DEFINE_GETBY
++#undef DEFINE_GET
++
++    { fk_end }
++  };
++
++
++/* Parsing the config file.  Functions copied from nsswitch.c.  */
++
++#define __strchrnul strchrnul
++#define __getline getline
++#define __strncasecmp strncasecmp
++
++/* Prototypes for the local functions.  */
++static name_database *nss_parse_file (const char *fname) internal_function;
++static name_database_entry *nss_getline (char *line) internal_function;
++static service_user *nss_parse_service_list (const char *line)
++     internal_function;
++
++static name_database *
++internal_function
++nss_parse_file (const char *fname)
++{
++  FILE *fp;
++  name_database *result;
++  name_database_entry *last;
++  char *line;
++  size_t len;
++
++  /* Open the configuration file.  */
++  fp = fopen (fname, "rc");
++  if (fp == NULL)
++    return NULL;
++
++  // /* No threads use this stream.  */
++  // __fsetlocking (fp, FSETLOCKING_BYCALLER);
++
++  result = (name_database *) xmalloc (sizeof (name_database));
++
++  result->entry = NULL;
++  result->library = NULL;
++  last = NULL;
++  line = NULL;
++  len = 0;
++  do
++    {
++      name_database_entry *this;
++      ssize_t n;
++
++      n = __getline (&line, &len, fp);
++      if (n < 0)
++	break;
++      if (line[n - 1] == '\n')
++	line[n - 1] = '\0';
++
++      /* Because the file format does not know any form of quoting we
++	 can search forward for the next '#' character and if found
++	 make it terminating the line.  */
++      *__strchrnul (line, '#') = '\0';
++
++      /* If the line is blank it is ignored.  */
++      if (line[0] == '\0')
++	continue;
++
++      /* Each line completely specifies the actions for a database.  */
++      this = nss_getline (line);
++      if (this != NULL)
++	{
++	  if (last != NULL)
++	    last->next = this;
++	  else
++	    result->entry = this;
++
++	  last = this;
++	}
++    }
++  while (!feof_unlocked (fp));
++
++  /* Free the buffer.  */
++  free (line);
++  /* Close configuration file.  */
++  fclose (fp);
++
++  return result;
++}
++
++
++/* Read the source names:
++	`( <source> ( "[" "!"? (<status> "=" <action> )+ "]" )? )*'
++   */
++static service_user *
++internal_function
++nss_parse_service_list (const char *line)
++{
++  service_user *result = NULL, **nextp = &result;
++
++  while (1)
++    {
++      service_user *new_service;
++      const char *name;
++
++      while (isspace (line[0]))
++	++line;
++      if (line[0] == '\0')
++	/* No source specified.  */
++	return result;
++
++      /* Read <source> identifier.  */
++      name = line;
++      while (line[0] != '\0' && !isspace (line[0]) && line[0] != '[')
++	++line;
++      if (name == line)
++	return result;
++
++
++      new_service = (service_user *) xmalloc (sizeof (*new_service));
++      new_service->name = (char *) xmalloc (line - name + 1);
++
++      *((char *) __mempcpy ((char *) new_service->name, name, line - name))
++        = '\0';
++
++      /* Set default actions.  */
++      new_service->actions[2 + NSS_STATUS_TRYAGAIN] = NSS_ACTION_CONTINUE;
++      new_service->actions[2 + NSS_STATUS_UNAVAIL] = NSS_ACTION_CONTINUE;
++      new_service->actions[2 + NSS_STATUS_NOTFOUND] = NSS_ACTION_CONTINUE;
++      new_service->actions[2 + NSS_STATUS_SUCCESS] = NSS_ACTION_RETURN;
++      new_service->actions[2 + NSS_STATUS_RETURN] = NSS_ACTION_RETURN;
++      new_service->library = NULL;
++      new_service->known.tree = NULL;
++      new_service->next = NULL;
++
++      while (isspace (line[0]))
++	++line;
++
++      if (line[0] == '[')
++	{
++	  /* Read criterions.  */
++	  do
++	    ++line;
++	  while (line[0] != '\0' && isspace (line[0]));
++
++	  do
++	    {
++	      int not;
++	      enum nss_status status;
++	      lookup_actions action;
++
++	      /* Grok ! before name to mean all statii but that one.  */
++	      not = line[0] == '!';
++	      if (not)
++		++line;
++
++	      /* Read status name.  */
++	      name = line;
++	      while (line[0] != '\0' && !isspace (line[0]) && line[0] != '='
++		     && line[0] != ']')
++		++line;
++
++	      /* Compare with known statii.  */
++	      if (line - name == 7)
++		{
++		  if (__strncasecmp (name, "SUCCESS", 7) == 0)
++		    status = NSS_STATUS_SUCCESS;
++		  else if (__strncasecmp (name, "UNAVAIL", 7) == 0)
++		    status = NSS_STATUS_UNAVAIL;
++		  else
++		    return result;
++		}
++	      else if (line - name == 8)
++		{
++		  if (__strncasecmp (name, "NOTFOUND", 8) == 0)
++		    status = NSS_STATUS_NOTFOUND;
++		  else if (__strncasecmp (name, "TRYAGAIN", 8) == 0)
++		    status = NSS_STATUS_TRYAGAIN;
++		  else
++		    return result;
++		}
++	      else
++		return result;
++
++	      while (isspace (line[0]))
++		++line;
++	      if (line[0] != '=')
++		return result;
++	      do
++		++line;
++	      while (isspace (line[0]));
++
++	      name = line;
++	      while (line[0] != '\0' && !isspace (line[0]) && line[0] != '='
++		     && line[0] != ']')
++		++line;
++
++	      if (line - name == 6 && __strncasecmp (name, "RETURN", 6) == 0)
++		action = NSS_ACTION_RETURN;
++	      else if (line - name == 8
++		       && __strncasecmp (name, "CONTINUE", 8) == 0)
++		action = NSS_ACTION_CONTINUE;
++	      else
++		return result;
++
++	      if (not)
++		{
++		  /* Save the current action setting for this status,
++		     set them all to the given action, and reset this one.  */
++		  const lookup_actions save = new_service->actions[2 + status];
++		  new_service->actions[2 + NSS_STATUS_TRYAGAIN] = action;
++		  new_service->actions[2 + NSS_STATUS_UNAVAIL] = action;
++		  new_service->actions[2 + NSS_STATUS_NOTFOUND] = action;
++		  new_service->actions[2 + NSS_STATUS_SUCCESS] = action;
++		  new_service->actions[2 + status] = save;
++		}
++	      else
++		new_service->actions[2 + status] = action;
++
++	      /* Skip white spaces.  */
++	      while (isspace (line[0]))
++		++line;
++	    }
++	  while (line[0] != ']');
++
++	  /* Skip the ']'.  */
++	  ++line;
++	}
++
++      *nextp = new_service;
++      nextp = &new_service->next;
++    }
++}
++
++static name_database_entry *
++internal_function
++nss_getline (char *line)
++{
++  const char *name;
++  name_database_entry *result;
++  size_t len;
++
++  /* Ignore leading white spaces.  ATTENTION: this is different from
++     what is implemented in Solaris.  The Solaris man page says a line
++     beginning with a white space character is ignored.  We regard
++     this as just another misfeature in Solaris.  */
++  while (isspace (line[0]))
++    ++line;
++
++  /* Recognize `<database> ":"'.  */
++  name = line;
++  while (line[0] != '\0' && !isspace (line[0]) && line[0] != ':')
++    ++line;
++  if (line[0] == '\0' || name == line)
++    /* Syntax error.  */
++    return NULL;
++  *line++ = '\0';
++
++  len = strlen (name) + 1;
++
++  result = (name_database_entry *) xmalloc (sizeof (*result));
++  result->name = (char *) xmalloc (len);
++
++  /* Save the database name.  */
++  memcpy ((char *) result->name, name, len);
++
++  /* Parse the list of services.  */
++  result->service = nss_parse_service_list (line);
++
++  result->next = NULL;
++  return result;
++}
++
++
++
++/* Generating code for statically initialized nsswitch structures.  */
++
++
++/* Return the service-neutral suffix of the name of the service
++   library function referred to by the function F.  The result is
++   allocated with malloc.  */
++char *
++known_function_suffix (const struct function *f)
++{
++  switch (f->kind)
++    {
++    case fk_setent:
++      return saprintf ("set%sent", f->entry);
++
++    case fk_getent:
++      return saprintf ("get%sent_r", f->entry);
++
++    case fk_endent:
++      return saprintf ("end%sent", f->entry);
++
++    case fk_getby:
++      return saprintf ("get%sby%s_r", f->entry, f->key);
++
++    case fk_get:
++      return saprintf ("get%s_r", f->value_and_key);
++
++    default:
++      abort ();
++    }
++}
++
++
++/* Return the name of the service library function referred to by the
++   function F.  The result is allocated with malloc.  */
++char *
++known_function_name (const struct function *f)
++{
++  return saprintf ("_nss_%s_%s", f->service, known_function_suffix (f));
++}
++
++
++/* Write initialized known_function structures to OUT for
++   all the functions we'll use.  */
++void
++generate_known_functions (FILE *out)
++{
++  int i;
++
++  /* First, generate weak references to the functions.  The service
++     libraries depend on libc, and if these references weren't weak,
++     we'd be making libc depend circularly on the service
++     libraries.  */
++  for (i = 0; functions[i].kind; i++)
++    {
++      char *name = known_function_name (&functions[i]);
++      fprintf (out, "typeof (%s) %s __attribute__ ((weak));\n",
++               name, name);
++    }
++  fputs ("\n", out);
++
++  /* Then, a table mapping names to functions.  */
++  fputs ("static const known_function fixed_known_functions[] = {\n",
++         out);
++  for (i = 0; functions[i].kind; i++)
++    {
++      const struct function *f = &functions[i];
++      char *suffix = known_function_suffix (f);
++
++      fprintf (out, "  /* %2d */ { \"%s\", _nss_%s_%s },\n",
++               i, suffix, f->service, suffix);
++    }
++  fputs ("};\n", out);
++  fputs ("\n", out);
++}
++
++
++/* Print code to OUT for an initialized array of pointers to the
++   'known_function' structures needed for USER, which is for
++   DATABASE.  Return its name, allocated with malloc.  */
++char *
++generate_known_function_list (FILE *out,
++                              const name_database_entry *database,
++                              const service_user *user)
++{
++  char *list_name = saprintf ("fixed_%s_%s_known_funcs",
++                              database->name, user->name);
++  fprintf (out, "static const known_function *%s[] = {\n",
++           list_name);
++  int i;
++  for (i = 0; functions[i].kind; i++)
++    if (strcmp (functions[i].database, database->name) == 0
++        && strcmp (functions[i].service, user->name) == 0)
++      fprintf (out, "  &fixed_known_functions[%d], /* %s */\n",
++               i, known_function_name (&functions[i]));
++  fputs ("  NULL\n", out);
++  fputs ("};\n", out);
++  fputs ("\n", out);
++
++  return list_name;
++}
++
++
++/* Return the name of the status value STATUS, as a statically
++   allocated string.  */
++const char *
++lookup_status_name (enum nss_status status)
++{
++  switch (status)
++    {
++    case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN";
++    case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL";
++    case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND";
++    case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS";
++    case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN";
++    default: abort ();
++    };
++}
++
++
++/* Return the name of ACTION as a statically allocated string.  */
++const char *
++lookup_action_name (lookup_actions action)
++{
++  switch (action)
++    {
++    case NSS_ACTION_CONTINUE: return "NSS_ACTION_CONTINUE";
++    case NSS_ACTION_RETURN: return "NSS_ACTION_RETURN";
++    default: abort ();
++    }
++}
++
++
++/* Print code to OUT for the list of service_user structures starting
++   with USER, which are all for DATABASE.  Return the name of the
++   first structure in that list, or zero if USER is NULL.  */
++char *
++generate_service_user_list (FILE *out,
++                            name_database_entry *database,
++                            service_user *user)
++{
++  if (user)
++    {
++      /* Generate the tail of the list.  */
++      char *next_name = generate_service_user_list (out, database, user->next);
++      /* Generate our known function list.  */
++      char *known_function_list_name =
++        generate_known_function_list (out, database, user);
++
++      char *name = saprintf ("fixed_%s_%s_user", database->name, user->name);
++
++      fprintf (out, "static const service_user %s = {\n", name);
++      if (next_name)
++        fprintf (out, "  (service_user *) &%s,\n", next_name);
++      else
++        fprintf (out, "  NULL, /* no next entry */\n");
++      fputs ("  {\n", out);
++      int i;
++      for (i = 0; i < sizeof (user->actions) / sizeof (user->actions[0]); i++)
++        fprintf (out, "    %s, /* %s */\n",
++                 lookup_action_name (user->actions[i]),
++                 lookup_status_name (i - 2));
++      fputs ("  },\n", out);
++      fprintf (out, "  NULL,  /* we never need the service library */\n");
++      fprintf (out, "  { .array = %s },\n", known_function_list_name);
++      fprintf (out, "  \"%s\"\n", user->name);
++      fputs ("};\n", out);
++      fputs ("\n", out);
++
++      return name;
++    }
++  else
++    return NULL;
++}
++
++
++/* Print code to OUT for the list of name_database_entry structures
++   starting with DATABASE.  Return the name of the first structure
++   in that list, or zero if DATABASE is NULL.  */
++char *
++generate_name_database_entries (FILE *out, name_database_entry *database)
++{
++  if (database)
++    {
++      char *next_name = generate_name_database_entries (out, database->next);
++      char *service_user_name
++        = generate_service_user_list (out, database, database->service);
++      char *name = saprintf ("fixed_%s_name_database", database->name);
++
++      fprintf (out, "static const name_database_entry %s = {\n", name);
++
++      if (next_name)
++        fprintf (out, "  (name_database_entry *) &%s,\n", next_name);
++      else
++        fprintf (out, "  NULL,\n");
++
++      if (service_user_name)
++        fprintf (out, "  (service_user *) &%s,\n", service_user_name);
++      else
++        fprintf (out, "  NULL,\n");
++
++      fprintf (out, "  \"%s\"\n", database->name);
++      fprintf (out, "};\n");
++      fputs ("\n", out);
++
++      return name;
++    }
++  else
++    return NULL;
++}
++
++
++void
++generate_name_database (FILE *out, name_database *service_table)
++{
++  /* Produce a linked list of the known name_database_entry
++     structures.  */
++  char *entries = generate_name_database_entries (out, service_table->entry);
++
++  /* Now produce the main structure that points to them all.  */
++  fprintf (out, "static const name_database fixed_name_database = {\n");
++  if (entries)
++    fprintf (out, "  (name_database_entry *) &%s,\n", entries);
++  else
++    fprintf (out, "  NULL,\n");
++  fputs ("  NULL /* we don't need the libraries */\n"
++         "};\n",
++         out);
++}
++
++
++
++/* Generating the list of service libraries we generate references to.  */
++
++/* String with revision number of the shared object files.  */
++static const char *const nss_shlib_revision = LIBNSS_FILES_SO + 15;
++
++void
++generate_service_lib_list (FILE *out, name_database *service_table)
++{
++  int i, j;
++  int printed_any = 0;
++
++  for (i = 0; functions[i].kind; i++)
++    {
++      /* Mention each service library only once.  */
++      for (j = 0; j < i; j++)
++        if (strcmp (functions[i].service, functions[j].service) == 0)
++          break;
++
++      if (j >= i)
++        {
++          if (printed_any)
++            putc (' ', out);
++          fprintf (out, "-lnss_%s",
++                   functions[i].service,
++                   nss_shlib_revision);
++          printed_any = 1;
++        }
++    }
++}
++
++
++/* Main.  */
++
++int
++main (int argc, char **argv)
++{
++  if (argc != 4)
++    {
++      fprintf (stderr, "usage: gen-fixed-nsswitch HEADER SERVLIBS CONFIG\n");
++      exit (1);
++    }
++
++  name_database *service_table = nss_parse_file (argv[3]);
++
++  FILE *header = fopen (argv[1], "w");
++  if (! header)
++    {
++      fprintf (stderr,
++               "gen-fixed-nsswitch: couldn't open output file %s: %s\n",
++               argv[1], strerror (errno));
++      exit (1);
++    }
++  fputs ("/* Generated by nss/gen-fixed-nsswitch.c.  */\n", header);
++  fputs ("\n", header);
++  generate_known_functions (header);
++  generate_name_database (header, service_table);
++  fclose (header);
++
++  FILE *service_lib_list = fopen (argv[2], "w");
++  if (! service_lib_list)
++    {
++      fprintf (stderr,
++               "gen-fixed-nsswitch: couldn't open output file %s: %s\n",
++               argv[2], strerror (errno));
++      exit (1);
++    }
++  generate_service_lib_list (service_lib_list, service_table);
++  fclose (service_lib_list);
++
++  return 0;
++}
+diff --git a/nss/getent.c b/nss/getent.c
+index 34df848..674c8ee 100644
+--- a/nss/getent.c
++++ b/nss/getent.c
+@@ -39,6 +39,7 @@
+ #include <netinet/ether.h>
+ #include <netinet/in.h>
+ #include <sys/socket.h>
++#include <gnu/option-groups.h>
+ 
+ /* Get libc version number.  */
+ #include <version.h>
+@@ -91,6 +92,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
+   fprintf (stream, gettext ("Written by %s.\n"), "Thorsten Kukuk");
+ }
+ 
++#if __OPTION_EGLIBC_DB_ALIASES
+ /* This is for aliases */
+ static void
+ print_aliases (struct aliasent *alias)
+@@ -135,7 +137,9 @@ aliases_keys (int number, char *key[])
+ 
+   return result;
+ }
++#endif /* __OPTION_EGLIBC_DB_ALIASES */
+ 
++#if __OPTION_EGLIBC_INET
+ /* This is for ethers */
+ static int
+ ethers_keys (int number, char *key[])
+@@ -179,6 +183,7 @@ ethers_keys (int number, char *key[])
+ 
+   return result;
+ }
++#endif /* __OPTION_EGLIBC_INET */
+ 
+ /* This is for group */
+ static void
+@@ -301,6 +306,7 @@ gshadow_keys (int number, char *key[])
+   return result;
+ }
+ 
++#if __OPTION_EGLIBC_INET
+ /* This is for hosts */
+ static void
+ print_hosts (struct hostent *host)
+@@ -598,6 +604,7 @@ networks_keys (int number, char *key[])
+ 
+   return result;
+ }
++#endif /* __OPTION_EGLIBC_INET */
+ 
+ /* Now is all for passwd */
+ static void
+@@ -650,6 +657,7 @@ passwd_keys (int number, char *key[])
+   return result;
+ }
+ 
++#if __OPTION_EGLIBC_INET
+ /* This is for protocols */
+ static void
+ print_protocols (struct protoent *proto)
+@@ -807,6 +815,7 @@ services_keys (int number, char *key[])
+ 
+   return result;
+ }
++#endif /* __OPTION_EGLIBC_INET */
+ 
+ /* This is for shadow */
+ static void
+@@ -873,23 +882,36 @@ struct
+   } databases[] =
+   {
+ #define D(name) { #name, name ## _keys },
+-D(ahosts)
+-D(ahostsv4)
+-D(ahostsv6)
+-D(aliases)
+-D(ethers)
++
++#if __OPTION_EGLIBC_INET
++# define DN(name) D(name)
++#else
++# define DN(name)
++#endif
++
++#if __OPTION_EGLIBC_DB_ALIASES
++# define DA(name) D(name)
++#else
++# define DA(name)
++#endif
++
++DN(ahosts)
++DN(ahostsv4)
++DN(ahostsv6)
++DA(aliases)
++DN(ethers)
+ D(group)
+ D(gshadow)
+-D(hosts)
+-D(initgroups)
+-D(netgroup)
+-D(networks)
++DN(hosts)
++DN(initgroups)
++DN(netgroup)
++DN(networks)
+ D(passwd)
+-D(protocols)
++DN(protocols)
+ #if HAVE_SUNRPC
+-D(rpc)
++DN(rpc)
+ #endif
+-D(services)
++DN(services)
+ D(shadow)
+ #undef D
+     { NULL, NULL }
+diff --git a/nss/getnssent_r.c b/nss/getnssent_r.c
+index f5b9036..f09f7fe 100644
+--- a/nss/getnssent_r.c
++++ b/nss/getnssent_r.c
+@@ -16,6 +16,7 @@
+    <http://www.gnu.org/licenses/>.  */
+ 
+ #include <errno.h>
++#include <gnu/option-groups.h>
+ #include <netdb.h>
+ #include "nsswitch.h"
+ 
+@@ -59,11 +60,13 @@ __nss_setent (const char *func_name, db_lookup_function lookup_fct,
+   } fct;
+   int no_more;
+ 
++#if __OPTION_EGLIBC_INET
+   if (res && __res_maybe_init (&_res, 0) == -1)
+     {
+       __set_h_errno (NETDB_INTERNAL);
+       return;
+     }
++#endif /* __OPTION_EGLIBC_INET */
+ 
+   /* Cycle through the services and run their `setXXent' functions until
+      we find an available service.  */
+@@ -101,11 +104,13 @@ __nss_endent (const char *func_name, db_lookup_function lookup_fct,
+   } fct;
+   int no_more;
+ 
++#if __OPTION_EGLIBC_INET
+   if (res && __res_maybe_init (&_res, 0) == -1)
+     {
+       __set_h_errno (NETDB_INTERNAL);
+       return;
+     }
++#endif /* __OPTION_EGLIBC_INET */
+ 
+   /* Cycle through all the services and run their endXXent functions.  */
+   no_more = setup (func_name, lookup_fct, &fct.ptr, nip, startp, 1);
+@@ -141,12 +146,14 @@ __nss_getent_r (const char *getent_func_name,
+   int no_more;
+   enum nss_status status;
+ 
++#if __OPTION_EGLIBC_INET
+   if (res && __res_maybe_init (&_res, 0) == -1)
+     {
+       *h_errnop = NETDB_INTERNAL;
+       *result = NULL;
+       return errno;
+     }
++#endif /* __OPTION_EGLIBC_INET */
+ 
+   /* Initialize status to return if no more functions are found.  */
+   status = NSS_STATUS_NOTFOUND;
+@@ -161,7 +168,7 @@ __nss_getent_r (const char *getent_func_name,
+       int is_last_nip = *nip == *last_nip;
+ 
+       status = DL_CALL_FCT (fct.f,
+-			    (resbuf, buffer, buflen, &errno, &h_errno));
++			    (resbuf, buffer, buflen, &errno, h_errnop));
+ 
+       /* The status is NSS_STATUS_TRYAGAIN and errno is ERANGE the
+ 	 provided buffer is too small.  In this case we should give
+diff --git a/nss/nsswitch.c b/nss/nsswitch.c
+index 9712623..c81e207 100644
+--- a/nss/nsswitch.c
++++ b/nss/nsswitch.c
+@@ -26,6 +26,7 @@
+ #include <stdio_ext.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <gnu/option-groups.h>
+ 
+ #include <aliases.h>
+ #include <grp.h>
+@@ -41,6 +42,15 @@
+ #include "../nscd/nscd_proto.h"
+ #include <sysdep.h>
+ 
++/* When OPTION_EGLIBC_NSSWITCH is disabled, we use fixed tables of
++   databases and services, generated at library build time.  Thus:
++   - We can't reconfigure individual databases, so we don't need a
++     name-to-database map.
++   - We never add databases or service libraries, or look up functions
++     at runtime, so there's no need for a lock to protect our tables.
++   See ../option-groups.def for the details.  */
++#if __OPTION_EGLIBC_NSSWITCH
++
+ /* Prototypes for the local functions.  */
+ static name_database *nss_parse_file (const char *fname) internal_function;
+ static name_database_entry *nss_getline (char *line) internal_function;
+@@ -79,6 +89,9 @@ bool __nss_database_custom[NSS_DBSIDX_max];
+ 
+ __libc_lock_define_initialized (static, lock)
+ 
++#define lock_nsswitch __libc_lock_lock (lock)
++#define unlock_nsswitch __libc_lock_unlock (lock)
++
+ #if !defined DO_STATIC_NSS || defined SHARED
+ /* String with revision number of the shared object files.  */
+ static const char *const __nss_shlib_revision = LIBNSS_FILES_SO + 15;
+@@ -93,6 +106,20 @@ static name_database *service_table;
+    __libc_freeres.  */
+ static name_database_entry *defconfig_entries;
+ 
++#else /* __OPTION_EGLIBC_NSSWITCH */
++
++/* Bring in the statically initialized service table we generated at
++   build time.  */
++#include "fixed-nsswitch.h"
++
++const static name_database *service_table = &fixed_name_database;
++
++/* Nothing ever changes, so there's no need to lock anything.  */
++#define lock_nsswitch (0)
++#define unlock_nsswitch (0)
++
++#endif /* __OPTION_EGLIBC_NSSWITCH */
++
+ 
+ #ifdef USE_NSCD
+ /* Nonzero if this is the nscd process.  */
+@@ -109,20 +136,22 @@ __nss_database_lookup (const char *database, const char *alternate_name,
+ 		       const char *defconfig, service_user **ni)
+ {
+   /* Prevent multiple threads to change the service table.  */
+-  __libc_lock_lock (lock);
++  lock_nsswitch;
+ 
+   /* Reconsider database variable in case some other thread called
+      `__nss_configure_lookup' while we waited for the lock.  */
+   if (*ni != NULL)
+     {
+-      __libc_lock_unlock (lock);
++      unlock_nsswitch;
+       return 0;
+     }
+ 
++#if __OPTION_EGLIBC_NSSWITCH
+   /* Are we initialized yet?  */
+   if (service_table == NULL)
+     /* Read config file.  */
+     service_table = nss_parse_file (_PATH_NSSWITCH_CONF);
++#endif
+ 
+   /* Test whether configuration data is available.  */
+   if (service_table != NULL)
+@@ -144,6 +173,7 @@ __nss_database_lookup (const char *database, const char *alternate_name,
+ 	    *ni = entry->service;
+     }
+ 
++#if __OPTION_EGLIBC_NSSWITCH
+   /* No configuration data is available, either because nsswitch.conf
+      doesn't exist or because it doesn't have a line for this database.
+ 
+@@ -166,13 +196,23 @@ __nss_database_lookup (const char *database, const char *alternate_name,
+ 	    {
+ 	      entry->next = defconfig_entries;
+ 	      entry->service = *ni;
+-	      entry->name[0] = '\0';
++	      entry->name = "";
+ 	      defconfig_entries = entry;
+ 	    }
+ 	}
+     }
++#else
++  /* Without the dynamic behavior, we can't process defconfig.  The
++     databases the user specified at library build time are all you
++     get.  */
++  if (*ni == NULL)
++    {
++      unlock_nsswitch;
++      return -1;
++    }
++#endif
+ 
+-  __libc_lock_unlock (lock);
++  unlock_nsswitch;
+ 
+   return *ni != NULL ? 0 : -1;
+ }
+@@ -252,6 +292,7 @@ __nss_next2 (service_user **ni, const char *fct_name, const char *fct2_name,
+ libc_hidden_def (__nss_next2)
+ 
+ 
++#if __OPTION_EGLIBC_NSSWITCH
+ int
+ attribute_compat_text_section
+ __nss_next (service_user **ni, const char *fct_name, void **fctp, int status,
+@@ -300,13 +341,13 @@ __nss_configure_lookup (const char *dbname, const char *service_line)
+     }
+ 
+   /* Prevent multiple threads to change the service table.  */
+-  __libc_lock_lock (lock);
++  lock_nsswitch;
+ 
+   /* Install new rules.  */
+   *databases[cnt].dbp = new_db;
+   __nss_database_custom[cnt] = true;
+ 
+-  __libc_lock_unlock (lock);
++  unlock_nsswitch;
+ 
+   return 0;
+ }
+@@ -402,7 +443,7 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
+   void **found, *result;
+ 
+   /* We now modify global data.  Protect it.  */
+-  __libc_lock_lock (lock);
++  lock_nsswitch;
+ 
+   /* Search the tree of functions previously requested.  Data in the
+      tree are `known_function' structures, whose first member is a
+@@ -413,7 +454,7 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
+      enough to a pointer to our structure to use as a lookup key that
+      will be passed to `known_compare' (above).  */
+ 
+-  found = __tsearch (&fct_name, &ni->known, &known_compare);
++  found = __tsearch (&fct_name, &ni->known.tree, &known_compare);
+   if (found == NULL)
+     /* This means out-of-memory.  */
+     result = NULL;
+@@ -440,7 +481,7 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
+ #endif
+ 	  /* Oops.  We can't instantiate this node properly.
+ 	     Remove it from the tree.  */
+-	  __tdelete (&fct_name, &ni->known, &known_compare);
++	  __tdelete (&fct_name, &ni->known.tree, &known_compare);
+ 	  free (known);
+ 	  result = NULL;
+ 	}
+@@ -520,13 +561,43 @@ __nss_lookup_function (service_user *ni, const char *fct_name)
+     }
+ 
+   /* Remove the lock.  */
+-  __libc_lock_unlock (lock);
++  unlock_nsswitch;
+ 
+   return result;
+ }
+ libc_hidden_def (__nss_lookup_function)
+ 
+ 
++#else /* below if ! __OPTION_EGLIBC_NSSWITCH */
++
++
++int
++__nss_configure_lookup (const char *dbname, const char *service_line)
++{
++  /* We can't dynamically configure lookup without
++     OPTION_EGLIBC_NSSWITCH.  */
++  __set_errno (EINVAL);
++  return -1;
++}
++
++
++void *
++__nss_lookup_function (service_user *ni, const char *fct_name)
++{
++  int i;
++  const known_function **known = ni->known.array;
++
++  for (i = 0; known[i]; i++)
++    if (strcmp (fct_name, known[i]->fct_name) == 0)
++      return known[i]->fct_ptr;
++
++  return NULL;
++}
++libc_hidden_def (__nss_lookup_function)
++#endif
++
++
++#if __OPTION_EGLIBC_NSSWITCH
+ static name_database *
+ internal_function
+ nss_parse_file (const char *fname)
+@@ -632,8 +703,10 @@ nss_parse_service_list (const char *line)
+ 					     + (line - name + 1));
+       if (new_service == NULL)
+ 	return result;
++      new_service->name = (char *) (new_service + 1);
+ 
+-      *((char *) __mempcpy (new_service->name, name, line - name)) = '\0';
++      *((char *) __mempcpy ((char *) new_service->name, name, line - name))
++        = '\0';
+ 
+       /* Set default actions.  */
+       new_service->actions[2 + NSS_STATUS_TRYAGAIN] = NSS_ACTION_CONTINUE;
+@@ -642,7 +715,7 @@ nss_parse_service_list (const char *line)
+       new_service->actions[2 + NSS_STATUS_SUCCESS] = NSS_ACTION_RETURN;
+       new_service->actions[2 + NSS_STATUS_RETURN] = NSS_ACTION_RETURN;
+       new_service->library = NULL;
+-      new_service->known = NULL;
++      new_service->known.tree = NULL;
+       new_service->next = NULL;
+ 
+       while (isspace (line[0]))
+@@ -778,9 +851,10 @@ nss_getline (char *line)
+   result = (name_database_entry *) malloc (sizeof (name_database_entry) + len);
+   if (result == NULL)
+     return NULL;
++  result->name = (char *) (result + 1);
+ 
+   /* Save the database name.  */
+-  memcpy (result->name, name, len);
++  memcpy ((char *) result->name, name, len);
+ 
+   /* Parse the list of services.  */
+   result->service = nss_parse_service_list (line);
+@@ -816,6 +890,7 @@ nss_new_service (name_database *database, const char *name)
+   return *currentp;
+ }
+ #endif
++#endif /* __OPTION_EGLIBC_NSSWITCH */
+ 
+ 
+ #if defined SHARED && defined USE_NSCD
+@@ -834,6 +909,7 @@ nss_load_all_libraries (const char *service, const char *def)
+ }
+ 
+ 
++#if __OPTION_EGLIBC_INET
+ /* Called by nscd and nscd alone.  */
+ void
+ __nss_disable_nscd (void (*cb) (size_t, struct traced_file *))
+@@ -857,8 +933,10 @@ __nss_disable_nscd (void (*cb) (size_t, struct traced_file *))
+   __nss_not_use_nscd_services = -1;
+   __nss_not_use_nscd_netgroup = -1;
+ }
++#endif /* __OPTION_EGLIBC_INET */
+ #endif
+ 
++#if __OPTION_EGLIBC_NSSWITCH
+ static void
+ free_database_entries (name_database_entry *entry)
+ {
+@@ -871,8 +949,8 @@ free_database_entries (name_database_entry *entry)
+ 	{
+ 	  service_user *olds = service;
+ 
+-	  if (service->known != NULL)
+-	    __tdestroy (service->known, free);
++	  if (service->known.tree != NULL)
++	    __tdestroy (service->known.tree, free);
+ 
+ 	  service = service->next;
+ 	  free (olds);
+@@ -926,3 +1004,4 @@ libc_freeres_fn (free_mem)
+ 
+   free (top);
+ }
++#endif /* __OPTION_EGLIBC_NSSWITCH */
+diff --git a/nss/nsswitch.h b/nss/nsswitch.h
+index a5318fa..1730977 100644
+--- a/nss/nsswitch.h
++++ b/nss/nsswitch.h
+@@ -65,10 +65,20 @@ typedef struct service_user
+   lookup_actions actions[5];
+   /* Link to the underlying library object.  */
+   service_library *library;
+-  /* Collection of known functions.  */
+-  void *known;
++  /* Collection of known functions.
++
++     With OPTION_EGLIBC_NSSWITCH enabled, this is the root of a
++     'tsearch'-style tree.
++
++     With OPTION_EGLIBC_NSSWITCH disabled, this is an array of
++     pointers to known_function structures, NULL-terminated.  */
++  union
++  {
++    void *tree;
++    const known_function **array;
++  } known;
+   /* Name of the service (`files', `dns', `nis', ...).  */
+-  char name[0];
++  const char *name;
+ } service_user;
+ 
+ /* To access the action based on the status value use this macro.  */
+@@ -82,7 +92,7 @@ typedef struct name_database_entry
+   /* List of service to be used.  */
+   service_user *service;
+   /* Name of the database.  */
+-  char name[0];
++  const char *name;
+ } name_database_entry;
+ 
+ 
+diff --git a/posix/Makefile b/posix/Makefile
+index 15e8818..609ed03 100644
+--- a/posix/Makefile
++++ b/posix/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Sub-makefile for POSIX portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= posix
+ 
+ include ../Makeconfig
+@@ -43,13 +45,24 @@ routines :=								      \
+ 	getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid	      \
+ 	getresuid getresgid setresuid setresgid				      \
+ 	pathconf sysconf fpathconf					      \
+-	glob glob64 fnmatch regex					      \
++	glob glob64 fnmatch						      \
+ 	confstr								      \
+ 	getopt getopt1 getopt_init					      \
+ 	sched_setp sched_getp sched_sets sched_gets sched_yield sched_primax  \
+ 	sched_primin sched_rr_gi sched_getaffinity sched_setaffinity	      \
+-	getaddrinfo gai_strerror wordexp				      \
+ 	pread pwrite pread64 pwrite64					      \
++	posix_madvise							      \
++	get_child_max sched_cpucount sched_cpualloc sched_cpufree
++
++routines-$(OPTION_EGLIBC_INET) += getaddrinfo gai_strerror
++
++ifeq (y,$(OPTION_POSIX_REGEXP_GLIBC))
++routines-$(OPTION_POSIX_REGEXP) += regex
++else
++routines-$(OPTION_POSIX_REGEXP) += xregex
++endif
++
++routines-$(OPTION_EGLIBC_SPAWN) +=					      \
+ 	spawn_faction_init spawn_faction_destroy spawn_faction_addclose	      \
+ 	spawn_faction_addopen spawn_faction_adddup2			      \
+ 	spawnattr_init spawnattr_destroy				      \
+@@ -61,37 +74,54 @@ routines :=								      \
+ 	posix_madvise							      \
+ 	get_child_max sched_cpucount sched_cpualloc sched_cpufree
+ 
++routines-$(OPTION_EGLIBC_WORDEXP) += wordexp
++
+ aux		:= init-posix environ
+-tests		:= tstgetopt testfnm runtests runptests	     \
++tests		:= tstgetopt testfnm runtests \
+ 		   tst-preadwrite tst-preadwrite64 test-vfork regexbug1 \
+-		   tst-mmap tst-getaddrinfo tst-truncate \
+-		   tst-truncate64 tst-fork tst-fnmatch tst-regexloc tst-dir \
+-		   tst-chmod bug-regex1 bug-regex2 bug-regex3 bug-regex4 \
+-		   tst-gnuglob tst-regex bug-regex5 bug-regex6 bug-regex7 \
+-		   bug-regex8 bug-regex9 bug-regex10 bug-regex11 bug-regex12 \
+-		   bug-regex13 bug-regex14 bug-regex15 bug-regex16 \
+-		   bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
+-		   bug-regex21 bug-regex22 bug-regex23 bug-regex24 \
+-		   bug-regex25 bug-regex26 bug-regex27 bug-regex28 \
++		   tst-mmap tst-truncate \
++		   tst-truncate64 tst-fork tst-dir \
++		   tst-chmod bug-regex2 bug-regex3 bug-regex4 \
++		   tst-gnuglob bug-regex6 bug-regex7 \
++		   bug-regex8 bug-regex9 bug-regex10 bug-regex12 \
++		   bug-regex14 bug-regex15 \
++		   bug-regex21 bug-regex24 \
++		   bug-regex27 bug-regex28 \
+ 		   bug-regex29 bug-regex30 bug-regex31 bug-regex32 \
+-		   bug-regex33 tst-nice tst-nanosleep tst-regex2 \
+-		   transbug tst-rxspencer tst-pcre tst-boost \
+-		   bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
+-		   tst-getaddrinfo2 bug-glob1 bug-glob2 bug-glob3 tst-sysconf \
++		   tst-nice tst-nanosleep \
++		   transbug \
++		   tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
++		   bug-glob1 bug-glob2 bug-glob3 tst-sysconf \
+ 		   tst-execvp1 tst-execvp2 tst-execlp1 tst-execlp2 \
+ 		   tst-execv1 tst-execv2 tst-execl1 tst-execl2 \
+ 		   tst-execve1 tst-execve2 tst-execle1 tst-execle2 \
+-		   tst-execvp3 tst-execvp4 tst-rfc3484 tst-rfc3484-2 \
+-		   tst-rfc3484-3 \
+-		   tst-getaddrinfo3 tst-fnmatch2 tst-cpucount tst-cpuset \
++		   tst-execvp3 tst-execvp4 \
++		   tst-fnmatch2 tst-cpucount tst-cpuset \
+ 		   bug-getopt1 bug-getopt2 bug-getopt3 bug-getopt4 \
+ 		   bug-getopt5 tst-getopt_long1 bug-regex34 bug-regex35 \
+ 		   tst-pathconf tst-getaddrinfo4 tst-rxspencer-no-utf8 \
+ 		   tst-fnmatch3 bug-regex36 tst-getaddrinfo5
+-xtests		:= bug-ga2
++
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++		+= tst-fnmatch tst-regexloc bug-regex1 bug-regex5 \
++		   bug-regex23 bug-regex25 bug-regex32 bug-regex33
++tests-$(OPTION_EGLIBC_INET) \
++		+= tst-getaddrinfo bug-ga1 tst-getaddrinfo2 \
++		   tst-rfc3484 tst-rfc3484-2 tst-rfc3484-3 tst-getaddrinfo3
++tests-$(OPTION_POSIX_REGEXP_GLIBC) \
++		+= runptests bug-regex11 bug-regex13 bug-regex16 \
++		   tst-regex2 tst-rxspencer tst-pcre tst-boost
++ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_POSIX_REGEXP_GLIBC))
++tests		+= tst-regex bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
++		   bug-regex22 bug-regex26
++endif
++xtests-$(OPTION_EGLIBC_INET) += bug-ga2
++
+ ifeq (yes,$(build-shared))
+ test-srcs	:= globtest
+-tests           += wordexp-test tst-exec tst-spawn
++tests		+= tst-exec
++tests-$(OPTION_EGLIBC_SPAWN) += tst-spawn
++tests-$(OPTION_EGLIBC_WORDEXP) += wordexp-test
+ endif
+ tests-static	= tst-exec-static tst-spawn-static
+ tests		+= $(tests-static)
+@@ -117,7 +147,10 @@ generated += $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
+ 
+ ifeq ($(run-built-tests),yes)
+ ifeq (yes,$(build-shared))
+-tests-special += $(objpfx)globtest.out $(objpfx)wordexp-tst.out
++tests-special += $(objpfx)globtest.out
++ifeq (y,$(OPTION_EGLIBC_WORDEXP))
++tests-special += $(objpfx)wordexp-tst.out
++endif
+ endif
+ endif
+ 
+@@ -125,12 +158,16 @@ endif
+ # XXX Please note that for now we ignore the result of this test.
+ tests-special += $(objpfx)annexc.out
+ ifeq ($(run-built-tests),yes)
+-tests-special += $(objpfx)bug-regex2-mem.out $(objpfx)bug-regex14-mem.out \
++tests-special += $(objpfx)bug-regex2-mem.out \
+ 		 $(objpfx)bug-regex21-mem.out $(objpfx)bug-regex31-mem.out \
+-		 $(objpfx)tst-rxspencer-no-utf8-mem.out $(objpfx)tst-pcre-mem.out \
+-		 $(objpfx)tst-boost-mem.out $(objpfx)tst-getconf.out \
++		 $(objpfx)tst-getconf.out \
+ 		 $(objpfx)bug-glob2-mem.out $(objpfx)tst-vfork3-mem.out \
+ 		 $(objpfx)tst-fnmatch-mem.out $(objpfx)bug-regex36-mem.out
++ifeq (y,$(OPTION_POSIX_REGEXP_GLIBC))
++tests-special += $(objpfx)bug-regex14-mem.out $(objpfx)tst-rxspencer-no-utf8-mem.out \
++  		 $(objpfx)tst-pcre-mem.out $(objpfx)tst-boost-mem.out
++endif
++
+ xtests-special += $(objpfx)bug-ga2-mem.out
+ endif
+ 
+@@ -143,6 +180,8 @@ $(objpfx)globtest.out: globtest.sh $(objpfx)globtest
+ 	$(SHELL) $< $(common-objpfx) '$(test-via-rtld-prefix)' \
+ 		'$(test-program-prefix)' '$(test-wrapper-env)'; \
+ 	$(evaluate-test)
++LDLIBS-globtest += $(shell cat $(common-objpfx)nss/fixed-nsswitch-libs)
++
+ $(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test
+ 	$(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \
+ 		 '$(run-program-env)' '$(test-program-prefix-after-env)'; \
+@@ -205,7 +244,10 @@ tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir);
+ tst-chmod-ARGS = $(objdir)
+ tst-vfork3-ARGS = --test-dir=$(objpfx)
+ 
+-tst-rxspencer-ARGS = --utf8 rxspencer/tests
++tst-rxspencer-ARGS = rxspencer/tests
++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
++tst-rxspencer-ARGS += --utf8
++endif
+ tst-rxspencer-no-utf8-ARGS = rxspencer/tests
+ tst-pcre-ARGS = PCRE.tests
+ tst-boost-ARGS = BOOST.tests
+diff --git a/posix/bug-regex1.c b/posix/bug-regex1.c
+index 38eb543..17cd1a0 100644
+--- a/posix/bug-regex1.c
++++ b/posix/bug-regex1.c
+@@ -4,6 +4,7 @@
+ #include <string.h>
+ #include <regex.h>
+ #include <wchar.h>
++#include <gnu/option-groups.h>
+ 
+ int
+ main (void)
+@@ -17,7 +18,9 @@ main (void)
+   memset (&regex, '\0', sizeof (regex));
+ 
+   setlocale (LC_ALL, "de_DE.ISO-8859-1");
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+   fwide (stdout, -1);
++#endif
+ 
+   re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_DEBUG);
+ 
+diff --git a/posix/bug-regex6.c b/posix/bug-regex6.c
+index efcc890..3b270c7 100644
+--- a/posix/bug-regex6.c
++++ b/posix/bug-regex6.c
+@@ -22,6 +22,7 @@
+ #include <string.h>
+ #include <sys/types.h>
+ #include <regex.h>
++#include <gnu/option-groups.h>
+ 
+ 
+ int
+@@ -30,7 +31,12 @@ main (int argc, char *argv[])
+   regex_t re;
+   regmatch_t mat[10];
+   int i, j, ret = 0;
+-  const char *locales[] = { "C", "de_DE.UTF-8" };
++  const char *locales[] = {
++    "C",
++#if __OPTION_EGLIBC_LOCALE_CODE
++    "de_DE.UTF-8"
++#endif
++  };
+   const char *string = "http://www.regex.com/pattern/matching.html#intro";
+   regmatch_t expect[10] = {
+     { 0, 48 }, { 0, 5 }, { 0, 4 }, { 5, 20 }, { 7, 20 }, { 20, 42 },
+diff --git a/posix/fnmatch.c b/posix/fnmatch.c
+index fd85efa..01cc9fe 100644
+--- a/posix/fnmatch.c
++++ b/posix/fnmatch.c
+@@ -30,6 +30,10 @@
+ #include <ctype.h>
+ #include <string.h>
+ 
++#if defined _LIBC
++# include <gnu/option-groups.h>
++#endif
++
+ #if defined STDC_HEADERS || defined _LIBC
+ # include <stdlib.h>
+ #endif
+@@ -131,7 +135,7 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
+ #   define ISWCTYPE(WC, WT)	iswctype (WC, WT)
+ #  endif
+ 
+-#  if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS) || _LIBC
++#  if (HAVE_MBSTATE_T && HAVE_MBSRTOWCS && _LIBC && __OPTION_EGLIBC_LOCALE_CODE)
+ /* In this case we are implementing the multibyte character handling.  */
+ #   define HANDLE_MULTIBYTE	1
+ #  endif
+diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
+index f46c9df..74e1754 100644
+--- a/posix/fnmatch_loop.c
++++ b/posix/fnmatch_loop.c
+@@ -15,6 +15,8 @@
+    License along with the GNU C Library; if not, see
+    <http://www.gnu.org/licenses/>.  */
+ 
++#include <gnu/option-groups.h>
++
+ #include <stdint.h>
+ 
+ struct STRUCT
+@@ -54,10 +56,15 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
+   const char *collseq = (const char *)
+     _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC);
+ # else
++#  if __OPTION_EGLIBC_LOCALE_CODE
+   const UCHAR *collseq = (const UCHAR *)
+     _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQMB);
+-# endif
+-#endif
++#   define COLLSEQ_BYTE_LOOKUP(ix) (collseq[(ix)])
++#  else
++#   define COLLSEQ_BYTE_LOOKUP(ix) (ix)
++#  endif /* __OPTION_EGLIBC_LOCALE_CODE */
++# endif /* WIDE_CHAR_VERSION */
++#endif /* _LIBC */
+ 
+   while ((c = *p++) != L('\0'))
+     {
+@@ -277,7 +284,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
+ 		    /* Leave room for the null.  */
+ 		    CHAR str[CHAR_CLASS_MAX_LENGTH + 1];
+ 		    size_t c1 = 0;
+-#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
++#if defined _LIBC ? __OPTION_POSIX_C_LANG_WIDE_CHAR : (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
+ 		    wctype_t wt;
+ #endif
+ 		    const CHAR *startp = p;
+@@ -307,7 +314,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
+ 		      }
+ 		    str[c1] = L('\0');
+ 
+-#if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
++#if defined _LIBC ? __OPTION_POSIX_C_LANG_WIDE_CHAR : (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H)
+ 		    wt = IS_CHAR_CLASS (str);
+ 		    if (wt == 0)
+ 		      /* Invalid character class name.  */
+@@ -680,8 +687,10 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
+ 			else
+ 			  lcollseq = __collseq_table_lookup (collseq, cold);
+ # else
+-			fcollseq = collseq[fn];
+-			lcollseq = is_seqval ? cold : collseq[(UCHAR) cold];
++			fcollseq = COLLSEQ_BYTE_LOOKUP (fn);
++			lcollseq = (is_seqval
++                                    ? cold
++                                    : COLLSEQ_BYTE_LOOKUP ((UCHAR) cold));
+ # endif
+ 
+ 			is_seqval = 0;
+@@ -857,7 +866,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
+ 				    goto matched;
+ 				  }
+ # else
+-				hcollseq = collseq[cend];
++				hcollseq = COLLSEQ_BYTE_LOOKUP (cend);
+ # endif
+ 			      }
+ 
+diff --git a/posix/glob.c b/posix/glob.c
+index d65e55d..1ac00a1 100644
+--- a/posix/glob.c
++++ b/posix/glob.c
+@@ -25,6 +25,9 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <stddef.h>
++#ifdef _LIBC
++# include <gnu/option-groups.h>
++#endif
+ 
+ /* Outcomment the following line for production quality code.  */
+ /* #define NDEBUG 1 */
+@@ -607,6 +610,7 @@ glob (pattern, flags, errfunc, pglob)
+ 	  if (home_dir == NULL || home_dir[0] == '\0')
+ 	    home_dir = "c:/users/default"; /* poor default */
+ #  else
++#   if ! _LIBC || __OPTION_EGLIBC_GETLOGIN
+ 	  if (home_dir == NULL || home_dir[0] == '\0')
+ 	    {
+ 	      int success;
+@@ -623,19 +627,19 @@ glob (pattern, flags, errfunc, pglob)
+ 	      if (success)
+ 		{
+ 		  struct passwd *p;
+-#   if defined HAVE_GETPWNAM_R || defined _LIBC
++#    if defined HAVE_GETPWNAM_R || defined _LIBC
+ 		  long int pwbuflen = GETPW_R_SIZE_MAX ();
+ 		  char *pwtmpbuf;
+ 		  struct passwd pwbuf;
+ 		  int malloc_pwtmpbuf = 0;
+ 		  int save = errno;
+ 
+-#    ifndef _LIBC
++#     ifndef _LIBC
+ 		  if (pwbuflen == -1)
+ 		    /* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.
+ 		       Try a moderate value.  */
+ 		    pwbuflen = 1024;
+-#    endif
++#     endif
+ 		  if (__libc_use_alloca (alloca_used + pwbuflen))
+ 		    pwtmpbuf = alloca_account (pwbuflen, alloca_used);
+ 		  else
+@@ -682,9 +686,9 @@ glob (pattern, flags, errfunc, pglob)
+ 			}
+ 		      __set_errno (save);
+ 		    }
+-#   else
++#    else
+ 		  p = getpwnam (name);
+-#   endif
++#    endif
+ 		  if (p != NULL)
+ 		    {
+ 		      if (!malloc_pwtmpbuf)
+@@ -713,6 +717,7 @@ glob (pattern, flags, errfunc, pglob)
+ 		    }
+ 		}
+ 	    }
++#   endif /* ! _LIBC || __OPTION_EGLIBC_GETLOGIN */
+ 	  if (home_dir == NULL || home_dir[0] == '\0')
+ 	    {
+ 	      if (flags & GLOB_TILDE_CHECK)
+diff --git a/posix/regcomp.c b/posix/regcomp.c
+index bf8aa16..6a41251 100644
+--- a/posix/regcomp.c
++++ b/posix/regcomp.c
+@@ -18,6 +18,7 @@
+    <http://www.gnu.org/licenses/>.  */
+ 
+ #include <stdint.h>
++#include <gnu/option-groups.h>
+ 
+ #ifdef _LIBC
+ # include <locale/weight.h>
+@@ -309,7 +310,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
+ {
+   re_dfa_t *dfa = (re_dfa_t *) bufp->buffer;
+   int node_cnt;
+-  int icase = (dfa->mb_cur_max == 1 && (bufp->syntax & RE_ICASE));
++  int icase = (dfa_mb_cur_max (dfa) == 1 && (bufp->syntax & RE_ICASE));
+   for (node_cnt = 0; node_cnt < init_state->nodes.nelem; ++node_cnt)
+     {
+       int node = init_state->nodes.elems[node_cnt];
+@@ -319,9 +320,9 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
+ 	{
+ 	  re_set_fastmap (fastmap, icase, dfa->nodes[node].opr.c);
+ #ifdef RE_ENABLE_I18N
+-	  if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
++	  if ((bufp->syntax & RE_ICASE) && dfa_mb_cur_max (dfa) > 1)
+ 	    {
+-	      unsigned char *buf = alloca (dfa->mb_cur_max), *p;
++	      unsigned char *buf = alloca (dfa_mb_cur_max (dfa)), *p;
+ 	      wchar_t wc;
+ 	      mbstate_t state;
+ 
+@@ -352,7 +353,11 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
+ 		  re_set_fastmap (fastmap, icase, ch);
+ 	    }
+ 	}
+-#ifdef RE_ENABLE_I18N
++
++      /* When OPTION_EGLIBC_LOCALE_CODE is disabled, the current
++         locale is always C, which has no rules and no multi-byte
++         characters.  */
++#if defined RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE
+       else if (type == COMPLEX_BRACKET)
+ 	{
+ 	  re_charset_t *cset = dfa->nodes[node].opr.mbcset;
+@@ -380,7 +385,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
+ 	     i.e. where we would not find an invalid sequence.  This only
+ 	     applies to multibyte character sets; for single byte character
+ 	     sets, the SIMPLE_BRACKET again suffices.  */
+-	  if (dfa->mb_cur_max > 1
++	  if (dfa_mb_cur_max (dfa) > 1
+ 	      && (cset->nchar_classes || cset->non_match || cset->nranges
+ # ifdef _LIBC
+ 		  || cset->nequiv_classes
+@@ -408,7 +413,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
+ 		  memset (&state, '\0', sizeof (state));
+ 		  if (__wcrtomb (buf, cset->mbchars[i], &state) != (size_t) -1)
+ 		    re_set_fastmap (fastmap, icase, *(unsigned char *) buf);
+-		  if ((bufp->syntax & RE_ICASE) && dfa->mb_cur_max > 1)
++		  if ((bufp->syntax & RE_ICASE) && dfa_mb_cur_max (dfa) > 1)
+ 		    {
+ 		      if (__wcrtomb (buf, __towlower (cset->mbchars[i]), &state)
+ 			  != (size_t) -1)
+@@ -417,7 +422,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
+ 		}
+ 	    }
+ 	}
+-#endif /* RE_ENABLE_I18N */
++#endif /* RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE */
+       else if (type == OP_PERIOD
+ #ifdef RE_ENABLE_I18N
+ 	       || type == OP_UTF8_PERIOD
+@@ -860,11 +865,15 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
+ 
+   dfa->mb_cur_max = MB_CUR_MAX;
+ #ifdef _LIBC
+-  if (dfa->mb_cur_max == 6
++  if (dfa_mb_cur_max (dfa) == 6
+       && strcmp (_NL_CURRENT (LC_CTYPE, _NL_CTYPE_CODESET_NAME), "UTF-8") == 0)
+     dfa->is_utf8 = 1;
++# if __OPTION_EGLIBC_LOCALE_CODE
+   dfa->map_notascii = (_NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_MAP_TO_NONASCII)
+ 		       != 0);
++# else
++  dfa->map_notascii = 0;
++# endif
+ #else
+ # ifdef HAVE_LANGINFO_CODESET
+   codeset_name = nl_langinfo (CODESET);
+@@ -890,7 +899,7 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
+ #endif
+ 
+ #ifdef RE_ENABLE_I18N
+-  if (dfa->mb_cur_max > 1)
++  if (dfa_mb_cur_max (dfa) > 1)
+     {
+       if (dfa->is_utf8)
+ 	dfa->sb_char = (re_bitset_ptr_t) utf8_sb_map;
+@@ -1788,7 +1797,7 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
+   token->word_char = 0;
+ #ifdef RE_ENABLE_I18N
+   token->mb_partial = 0;
+-  if (input->mb_cur_max > 1 &&
++  if (string_mb_cur_max (input) > 1 &&
+       !re_string_first_byte (input, re_string_cur_idx (input)))
+     {
+       token->type = CHARACTER;
+@@ -1809,7 +1818,7 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
+       token->opr.c = c2;
+       token->type = CHARACTER;
+ #ifdef RE_ENABLE_I18N
+-      if (input->mb_cur_max > 1)
++      if (string_mb_cur_max (input) > 1)
+ 	{
+ 	  wint_t wc = re_string_wchar_at (input,
+ 					  re_string_cur_idx (input) + 1);
+@@ -1923,7 +1932,7 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
+ 
+   token->type = CHARACTER;
+ #ifdef RE_ENABLE_I18N
+-  if (input->mb_cur_max > 1)
++  if (string_mb_cur_max (input) > 1)
+     {
+       wint_t wc = re_string_wchar_at (input, re_string_cur_idx (input));
+       token->word_char = IS_WIDE_WORD_CHAR (wc) != 0;
+@@ -2023,7 +2032,7 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
+   token->opr.c = c;
+ 
+ #ifdef RE_ENABLE_I18N
+-  if (input->mb_cur_max > 1 &&
++  if (string_mb_cur_max (input) > 1 &&
+       !re_string_first_byte (input, re_string_cur_idx (input)))
+     {
+       token->type = CHARACTER;
+@@ -2246,7 +2255,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
+ 	  return NULL;
+ 	}
+ #ifdef RE_ENABLE_I18N
+-      if (dfa->mb_cur_max > 1)
++      if (dfa_mb_cur_max (dfa) > 1)
+ 	{
+ 	  while (!re_string_eoi (regexp)
+ 		 && !re_string_first_byte (regexp, re_string_cur_idx (regexp)))
+@@ -2384,7 +2393,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
+ 	  *err = REG_ESPACE;
+ 	  return NULL;
+ 	}
+-      if (dfa->mb_cur_max > 1)
++      if (dfa_mb_cur_max (dfa) > 1)
+ 	dfa->has_mb_node = 1;
+       break;
+     case OP_WORD:
+@@ -2690,7 +2699,7 @@ build_range_exp (bitset_t sbcset, bracket_elem_t *start_elem,
+        However, for !_LIBC we have no collation elements: if the
+        character set is single byte, the single byte character set
+        that we build below suffices.  parse_bracket_exp passes
+-       no MBCSET if dfa->mb_cur_max == 1.  */
++       no MBCSET if dfa_mb_cur_max (dfa) == 1.  */
+     if (mbcset)
+       {
+ 	/* Check the space of the arrays.  */
+@@ -2786,7 +2795,13 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ 		   reg_syntax_t syntax, reg_errcode_t *err)
+ {
+ #ifdef _LIBC
++#if __OPTION_EGLIBC_LOCALE_CODE
+   const unsigned char *collseqmb;
++# define COLLSEQMB_LOOKUP(ix) (collseqmb[(ix)])
++#else
++# define COLLSEQMB_LOOKUP(ix) (ix)
++#endif
++
+   const char *collseqwc;
+   uint32_t nrules;
+   int32_t table_size;
+@@ -2834,18 +2849,20 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ 	  if (MB_CUR_MAX == 1)
+ 	  */
+ 	  if (nrules == 0)
+-	    return collseqmb[br_elem->opr.ch];
++	    return COLLSEQMB_LOOKUP (br_elem->opr.ch);
+ 	  else
+ 	    {
+ 	      wint_t wc = __btowc (br_elem->opr.ch);
+ 	      return __collseq_table_lookup (collseqwc, wc);
+ 	    }
+ 	}
++#if __OPTION_EGLIBC_LOCALE_CODE
+       else if (br_elem->type == MB_CHAR)
+ 	{
+ 	  if (nrules != 0)
+ 	    return __collseq_table_lookup (collseqwc, br_elem->opr.wch);
+ 	}
++#endif
+       else if (br_elem->type == COLL_SYM)
+ 	{
+ 	  size_t sym_name_len = strlen ((char *) br_elem->opr.name);
+@@ -2876,11 +2893,11 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ 		{
+ 		  /* No valid character.  Match it as a single byte
+ 		     character.  */
+-		  return collseqmb[br_elem->opr.name[0]];
++		  return COLLSEQMB_LOOKUP (br_elem->opr.name[0]);
+ 		}
+ 	    }
+ 	  else if (sym_name_len == 1)
+-	    return collseqmb[br_elem->opr.name[0]];
++	    return COLLSEQMB_LOOKUP (br_elem->opr.name[0]);
+ 	}
+       return UINT_MAX;
+     }
+@@ -2920,7 +2937,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ 	 However, if we have no collation elements, and the character set
+ 	 is single byte, the single byte character set that we
+ 	 build below suffices. */
+-      if (nrules > 0 || dfa->mb_cur_max > 1)
++      if (nrules > 0 || dfa_mb_cur_max (dfa) > 1)
+ 	{
+ 	  /* Check the space of the arrays.  */
+ 	  if (BE (*range_alloc == mbcset->nranges, 0))
+@@ -2957,7 +2974,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ 	  if (MB_CUR_MAX == 1)
+ 	  */
+ 	  if (nrules == 0)
+-	    ch_collseq = collseqmb[ch];
++	    ch_collseq = COLLSEQMB_LOOKUP (ch);
+ 	  else
+ 	    ch_collseq = __collseq_table_lookup (collseqwc, __btowc (ch));
+ 	  if (start_collseq <= ch_collseq && ch_collseq <= end_collseq)
+@@ -3035,7 +3052,10 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+   re_bitset_ptr_t sbcset;
+ #ifdef RE_ENABLE_I18N
+   re_charset_t *mbcset;
+-  int coll_sym_alloc = 0, range_alloc = 0, mbchar_alloc = 0;
++  int coll_sym_alloc = 0, range_alloc = 0;
++#if __OPTION_EGLIBC_LOCALE_CODE
++  int mbchar_alloc = 0;
++#endif
+   int equiv_class_alloc = 0, char_class_alloc = 0;
+ #endif /* not RE_ENABLE_I18N */
+   int non_match = 0;
+@@ -3043,9 +3063,15 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+   int token_len;
+   int first_round = 1;
+ #ifdef _LIBC
++#if __OPTION_EGLIBC_LOCALE_CODE
+   collseqmb = (const unsigned char *)
+     _NL_CURRENT (LC_COLLATE, _NL_COLLATE_COLLSEQMB);
+   nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
++#else
++  /* This is true when OPTION_EGLIBC_LOCALE_CODE is disabled, but the
++     compiler can't figure that out.  */
++  nrules = 0;
++#endif
+   if (nrules)
+     {
+       /*
+@@ -3175,7 +3201,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ #else
+ # ifdef RE_ENABLE_I18N
+ 	  *err = build_range_exp (sbcset,
+-				  dfa->mb_cur_max > 1 ? mbcset : NULL,
++				  dfa_mb_cur_max (dfa) > 1 ? mbcset : NULL,
+ 				  &range_alloc, &start_elem, &end_elem);
+ # else
+ 	  *err = build_range_exp (sbcset, &start_elem, &end_elem);
+@@ -3191,7 +3217,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ 	    case SB_CHAR:
+ 	      bitset_set (sbcset, start_elem.opr.ch);
+ 	      break;
+-#ifdef RE_ENABLE_I18N
++#if defined RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE
+ 	    case MB_CHAR:
+ 	      /* Check whether the array has enough space.  */
+ 	      if (BE (mbchar_alloc == mbcset->nmbchars, 0))
+@@ -3209,7 +3235,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ 		}
+ 	      mbcset->mbchars[mbcset->nmbchars++] = start_elem.opr.wch;
+ 	      break;
+-#endif /* RE_ENABLE_I18N */
++#endif /* RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE */
+ 	    case EQUIV_CLASS:
+ 	      *err = build_equiv_class (sbcset,
+ #ifdef RE_ENABLE_I18N
+@@ -3259,11 +3285,11 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
+ 
+ #ifdef RE_ENABLE_I18N
+   /* Ensure only single byte characters are set.  */
+-  if (dfa->mb_cur_max > 1)
++  if (dfa_mb_cur_max (dfa) > 1)
+     bitset_mask (sbcset, dfa->sb_char);
+ 
+   if (mbcset->nmbchars || mbcset->ncoll_syms || mbcset->nequiv_classes
+-      || mbcset->nranges || (dfa->mb_cur_max > 1 && (mbcset->nchar_classes
++      || mbcset->nranges || (dfa_mb_cur_max (dfa) > 1 && (mbcset->nchar_classes
+ 						     || mbcset->non_match)))
+     {
+       bin_tree_t *mbc_tree;
+@@ -3332,7 +3358,7 @@ parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
+ 		       re_token_t *token, int token_len, re_dfa_t *dfa,
+ 		       reg_syntax_t syntax, int accept_hyphen)
+ {
+-#ifdef RE_ENABLE_I18N
++#if defined RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE
+   int cur_char_size;
+   cur_char_size = re_string_char_size_at (regexp, re_string_cur_idx (regexp));
+   if (cur_char_size > 1)
+@@ -3342,7 +3368,7 @@ parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
+       re_string_skip_bytes (regexp, cur_char_size);
+       return REG_NOERROR;
+     }
+-#endif /* RE_ENABLE_I18N */
++#endif /* RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE */
+   re_string_skip_bytes (regexp, token_len); /* Skip a token.  */
+   if (token->type == OP_OPEN_COLL_ELEM || token->type == OP_OPEN_CHAR_CLASS
+       || token->type == OP_OPEN_EQUIV_CLASS)
+@@ -3422,7 +3448,9 @@ build_equiv_class (bitset_t sbcset, re_charset_t *mbcset,
+ build_equiv_class (bitset_t sbcset, const unsigned char *name)
+ #endif /* not RE_ENABLE_I18N */
+ {
+-#ifdef _LIBC
++  /* When __OPTION_EGLIBC_LOCALE_CODE is disabled, only the C locale
++     is supported; it has no collation rules.  */
++#if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE
+   uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+   if (nrules != 0)
+     {
+@@ -3492,7 +3520,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
+       mbcset->equiv_classes[mbcset->nequiv_classes++] = idx1;
+     }
+   else
+-#endif /* _LIBC */
++#endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */
+     {
+       if (BE (strlen ((const char *) name) != 1, 0))
+ 	return REG_ECOLLATE;
+@@ -3526,7 +3554,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
+       && (strcmp (name, "upper") == 0 || strcmp (name, "lower") == 0))
+     name = "alpha";
+ 
+-#ifdef RE_ENABLE_I18N
++#if defined RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE
+   /* Check the space of the arrays.  */
+   if (BE (*char_class_alloc == mbcset->nchar_classes, 0))
+     {
+@@ -3542,7 +3570,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
+       *char_class_alloc = new_char_class_alloc;
+     }
+   mbcset->char_classes[mbcset->nchar_classes++] = __wctype (name);
+-#endif /* RE_ENABLE_I18N */
++#endif /* RE_ENABLE_I18N && __OPTION_EGLIBC_LOCALE_CODE */
+ 
+ #define BUILD_CHARCLASS_LOOP(ctype_func)	\
+   do {						\
+@@ -3653,7 +3681,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
+ 
+ #ifdef RE_ENABLE_I18N
+   /* Ensure only single byte characters are set.  */
+-  if (dfa->mb_cur_max > 1)
++  if (dfa_mb_cur_max (dfa) > 1)
+     bitset_mask (sbcset, dfa->sb_char);
+ #endif
+ 
+@@ -3665,7 +3693,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
+     goto build_word_op_espace;
+ 
+ #ifdef RE_ENABLE_I18N
+-  if (dfa->mb_cur_max > 1)
++  if (dfa_mb_cur_max (dfa) > 1)
+     {
+       bin_tree_t *mbc_tree;
+       /* Build a tree for complex bracket.  */
+diff --git a/posix/regex.h b/posix/regex.h
+index 5b1981e..2941f94 100644
+--- a/posix/regex.h
++++ b/posix/regex.h
+@@ -21,6 +21,7 @@
+ #define _REGEX_H 1
+ 
+ #include <sys/types.h>
++#include <gnu/option-groups.h>
+ 
+ /* Allow the use in C++ code.  */
+ #ifdef __cplusplus
+@@ -156,6 +157,8 @@ typedef unsigned long int reg_syntax_t;
+    treated as 'a\{1'.  */
+ # define RE_INVALID_INTERVAL_ORD (RE_DEBUG << 1)
+ 
++/* EGLIBC: Old regex implementation does not support these.  */
++# if __OPTION_POSIX_REGEXP_GLIBC
+ /* If this bit is set, then ignore case when matching.
+    If not set, then case is significant.  */
+ # define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
+@@ -172,6 +175,7 @@ typedef unsigned long int reg_syntax_t;
+ /* If this bit is set, then no_sub will be set to 1 during
+    re_compile_pattern.  */
+ # define RE_NO_SUB (RE_CONTEXT_INVALID_DUP << 1)
++# endif /* __OPTION_POSIX_REGEXP_GLIBC */
+ #endif
+ 
+ /* This global variable defines the particular regexp syntax to use (for
+@@ -231,8 +235,13 @@ extern reg_syntax_t re_syntax_options;
+   (RE_CHAR_CLASSES | RE_DOT_NEWLINE      | RE_DOT_NOT_NULL		\
+    | RE_INTERVALS  | RE_NO_EMPTY_RANGES)
+ 
++#if __OPTION_POSIX_REGEXP_GLIBC
+ #define RE_SYNTAX_POSIX_BASIC						\
+   (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM | RE_CONTEXT_INVALID_DUP)
++#else
++#define RE_SYNTAX_POSIX_BASIC						\
++  (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
++#endif
+ 
+ /* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+    RE_LIMITED_OPS, i.e., \? \+ \| are not recognized.  Actually, this
+@@ -298,9 +307,11 @@ extern reg_syntax_t re_syntax_options;
+ /* Like REG_NOTBOL, except for the end-of-line.  */
+ #define REG_NOTEOL (1 << 1)
+ 
++#if __OPTION_POSIX_REGEXP_GLIBC
+ /* Use PMATCH[0] to delimit the start and end of the search in the
+    buffer.  */
+ #define REG_STARTEND (1 << 2)
++#endif
+ 
+ 
+ /* If any error codes are removed, changed, or added, update the
+diff --git a/posix/regex_internal.c b/posix/regex_internal.c
+index 8597d7e..d53b2a8 100644
+--- a/posix/regex_internal.c
++++ b/posix/regex_internal.c
+@@ -43,8 +43,8 @@ re_string_allocate (re_string_t *pstr, const char *str, int len, int init_len,
+   int init_buf_len;
+ 
+   /* Ensure at least one character fits into the buffers.  */
+-  if (init_len < dfa->mb_cur_max)
+-    init_len = dfa->mb_cur_max;
++  if (init_len < dfa_mb_cur_max (dfa))
++    init_len = dfa_mb_cur_max (dfa);
+   init_buf_len = (len + 1 < init_len) ? len + 1: init_len;
+   re_string_construct_common (str, len, pstr, trans, icase, dfa);
+ 
+@@ -55,7 +55,7 @@ re_string_allocate (re_string_t *pstr, const char *str, int len, int init_len,
+   pstr->word_char = dfa->word_char;
+   pstr->word_ops_used = dfa->word_ops_used;
+   pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str;
+-  pstr->valid_len = (pstr->mbs_allocated || dfa->mb_cur_max > 1) ? 0 : len;
++  pstr->valid_len = (pstr->mbs_allocated || dfa_mb_cur_max (dfa) > 1) ? 0 : len;
+   pstr->valid_raw_len = pstr->valid_len;
+   return REG_NOERROR;
+ }
+@@ -82,7 +82,7 @@ re_string_construct (re_string_t *pstr, const char *str, int len,
+   if (icase)
+     {
+ #ifdef RE_ENABLE_I18N
+-      if (dfa->mb_cur_max > 1)
++      if (dfa_mb_cur_max (dfa) > 1)
+ 	{
+ 	  while (1)
+ 	    {
+@@ -91,7 +91,7 @@ re_string_construct (re_string_t *pstr, const char *str, int len,
+ 		return ret;
+ 	      if (pstr->valid_raw_len >= len)
+ 		break;
+-	      if (pstr->bufs_len > pstr->valid_len + dfa->mb_cur_max)
++	      if (pstr->bufs_len > pstr->valid_len + dfa_mb_cur_max (dfa))
+ 		break;
+ 	      ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2);
+ 	      if (BE (ret != REG_NOERROR, 0))
+@@ -105,7 +105,7 @@ re_string_construct (re_string_t *pstr, const char *str, int len,
+   else
+     {
+ #ifdef RE_ENABLE_I18N
+-      if (dfa->mb_cur_max > 1)
++      if (dfa_mb_cur_max (dfa) > 1)
+ 	build_wcs_buffer (pstr);
+       else
+ #endif /* RE_ENABLE_I18N  */
+@@ -130,7 +130,7 @@ internal_function __attribute_warn_unused_result__
+ re_string_realloc_buffers (re_string_t *pstr, int new_buf_len)
+ {
+ #ifdef RE_ENABLE_I18N
+-  if (pstr->mb_cur_max > 1)
++  if (string_mb_cur_max (pstr) > 1)
+     {
+       wint_t *new_wcs;
+ 
+@@ -177,7 +177,7 @@ re_string_construct_common (const char *str, int len, re_string_t *pstr,
+   pstr->trans = trans;
+   pstr->icase = icase ? 1 : 0;
+   pstr->mbs_allocated = (trans != NULL || icase);
+-  pstr->mb_cur_max = dfa->mb_cur_max;
++  pstr->mb_cur_max = dfa_mb_cur_max (dfa);
+   pstr->is_utf8 = dfa->is_utf8;
+   pstr->map_notascii = dfa->map_notascii;
+   pstr->stop = pstr->len;
+@@ -203,7 +203,7 @@ build_wcs_buffer (re_string_t *pstr)
+ {
+ #ifdef _LIBC
+   unsigned char buf[MB_LEN_MAX];
+-  assert (MB_LEN_MAX >= pstr->mb_cur_max);
++  assert (MB_LEN_MAX >= string_mb_cur_max (pstr));
+ #else
+   unsigned char buf[64];
+ #endif
+@@ -226,7 +226,7 @@ build_wcs_buffer (re_string_t *pstr)
+ 	{
+ 	  int i, ch;
+ 
+-	  for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i)
++	  for (i = 0; i < string_mb_cur_max (pstr) && i < remain_len; ++i)
+ 	    {
+ 	      ch = pstr->raw_mbs [pstr->raw_mbs_idx + byte_idx + i];
+ 	      buf[i] = pstr->mbs[byte_idx + i] = pstr->trans[ch];
+@@ -275,7 +275,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
+   size_t mbclen;
+ #ifdef _LIBC
+   char buf[MB_LEN_MAX];
+-  assert (MB_LEN_MAX >= pstr->mb_cur_max);
++  assert (MB_LEN_MAX >= string_mb_cur_max (pstr));
+ #else
+   char buf[64];
+ #endif
+@@ -369,7 +369,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
+ 	  {
+ 	    int i, ch;
+ 
+-	    for (i = 0; i < pstr->mb_cur_max && i < remain_len; ++i)
++	    for (i = 0; i < string_mb_cur_max (pstr) && i < remain_len; ++i)
+ 	      {
+ 		ch = pstr->raw_mbs [pstr->raw_mbs_idx + src_idx + i];
+ 		buf[i] = pstr->trans[ch];
+@@ -567,8 +567,9 @@ re_string_translate_buffer (re_string_t *pstr)
+ }
+ 
+ /* This function re-construct the buffers.
+-   Concretely, convert to wide character in case of pstr->mb_cur_max > 1,
+-   convert to upper case in case of REG_ICASE, apply translation.  */
++   Concretely, convert to wide character in case of
++   string_mb_cur_max (pstr) > 1, convert to upper case in case of
++   REG_ICASE, apply translation.  */
+ 
+ static reg_errcode_t
+ internal_function __attribute_warn_unused_result__
+@@ -579,7 +580,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
+     {
+       /* Reset buffer.  */
+ #ifdef RE_ENABLE_I18N
+-      if (pstr->mb_cur_max > 1)
++      if (string_mb_cur_max (pstr) > 1)
+ 	memset (&pstr->cur_state, '\0', sizeof (mbstate_t));
+ #endif /* RE_ENABLE_I18N */
+       pstr->len = pstr->raw_len;
+@@ -670,7 +671,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
+ 	      pstr->tip_context = re_string_context_at (pstr, offset - 1,
+ 							eflags);
+ #ifdef RE_ENABLE_I18N
+-	      if (pstr->mb_cur_max > 1)
++	      if (string_mb_cur_max (pstr) > 1)
+ 		memmove (pstr->wcs, pstr->wcs + offset,
+ 			 (pstr->valid_len - offset) * sizeof (wint_t));
+ #endif /* RE_ENABLE_I18N */
+@@ -699,7 +700,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
+ #endif
+ 	  pstr->valid_len = 0;
+ #ifdef RE_ENABLE_I18N
+-	  if (pstr->mb_cur_max > 1)
++	  if (string_mb_cur_max (pstr) > 1)
+ 	    {
+ 	      int wcs_idx;
+ 	      wint_t wc = WEOF;
+@@ -711,7 +712,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
+ 		  /* Special case UTF-8.  Multi-byte chars start with any
+ 		     byte other than 0x80 - 0xbf.  */
+ 		  raw = pstr->raw_mbs + pstr->raw_mbs_idx;
+-		  end = raw + (offset - pstr->mb_cur_max);
++		  end = raw + (offset - string_mb_cur_max (pstr));
+ 		  if (end < pstr->raw_mbs)
+ 		    end = pstr->raw_mbs;
+ 		  p = raw + offset - 1;
+@@ -803,7 +804,7 @@ re_string_reconstruct (re_string_t *pstr, int idx, int eflags)
+ 
+   /* Then build the buffers.  */
+ #ifdef RE_ENABLE_I18N
+-  if (pstr->mb_cur_max > 1)
++  if (string_mb_cur_max (pstr) > 1)
+     {
+       if (pstr->icase)
+ 	{
+@@ -841,7 +842,7 @@ re_string_peek_byte_case (const re_string_t *pstr, int idx)
+     return re_string_peek_byte (pstr, idx);
+ 
+ #ifdef RE_ENABLE_I18N
+-  if (pstr->mb_cur_max > 1
++  if (string_mb_cur_max (pstr) > 1
+       && ! re_string_is_single_byte_char (pstr, pstr->cur_idx + idx))
+     return re_string_peek_byte (pstr, idx);
+ #endif
+@@ -930,7 +931,7 @@ re_string_context_at (const re_string_t *input, int idx, int eflags)
+     return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF
+ 	    : CONTEXT_NEWLINE | CONTEXT_ENDBUF);
+ #ifdef RE_ENABLE_I18N
+-  if (input->mb_cur_max > 1)
++  if (string_mb_cur_max (input) > 1)
+     {
+       wint_t wc;
+       int wc_idx = idx;
+@@ -1444,7 +1445,7 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
+   dfa->nodes[dfa->nodes_len].constraint = 0;
+ #ifdef RE_ENABLE_I18N
+   dfa->nodes[dfa->nodes_len].accept_mb =
+-    (type == OP_PERIOD && dfa->mb_cur_max > 1) || type == COMPLEX_BRACKET;
++    (type == OP_PERIOD && dfa_mb_cur_max (dfa) > 1) || type == COMPLEX_BRACKET;
+ #endif
+   dfa->nexts[dfa->nodes_len] = -1;
+   re_node_set_init_empty (dfa->edests + dfa->nodes_len);
+diff --git a/posix/regex_internal.h b/posix/regex_internal.h
+index 154e969..c43909a 100644
+--- a/posix/regex_internal.h
++++ b/posix/regex_internal.h
+@@ -26,6 +26,10 @@
+ #include <stdlib.h>
+ #include <string.h>
+ 
++#if defined _LIBC
++# include <gnu/option-groups.h>
++#endif
++
+ #if defined HAVE_LANGINFO_H || defined HAVE_LANGINFO_CODESET || defined _LIBC
+ # include <langinfo.h>
+ #endif
+@@ -369,6 +373,13 @@ struct re_string_t
+ };
+ typedef struct re_string_t re_string_t;
+ 
++/* When OPTION_EGLIBC_LOCALE_CODE is disabled, this is always 1;
++   help the compiler make use of that fact.  */
++#if __OPTION_EGLIBC_LOCALE_CODE
++# define string_mb_cur_max(str) ((str)->mb_cur_max + 0)
++#else
++# define string_mb_cur_max(str) (1)
++#endif
+ 
+ struct re_dfa_t;
+ typedef struct re_dfa_t re_dfa_t;
+@@ -654,6 +665,14 @@ struct re_dfa_t
+   __libc_lock_define (, lock)
+ };
+ 
++/* When OPTION_EGLIBC_LOCALE_CODE is disabled, this is always 1;
++   help the compiler make use of that fact.  */
++#if __OPTION_EGLIBC_LOCALE_CODE
++# define dfa_mb_cur_max(dfa) ((dfa)->mb_cur_max + 0)
++#else
++# define dfa_mb_cur_max(dfa) (1)
++#endif
++
+ #define re_node_set_init_empty(set) memset (set, '\0', sizeof (re_node_set))
+ #define re_node_set_remove(set,id) \
+   (re_node_set_remove_at (set, re_node_set_contains (set, id) - 1))
+@@ -714,7 +733,7 @@ internal_function __attribute__ ((pure, unused))
+ re_string_char_size_at (const re_string_t *pstr, int idx)
+ {
+   int byte_idx;
+-  if (pstr->mb_cur_max == 1)
++  if (string_mb_cur_max (pstr) == 1)
+     return 1;
+   for (byte_idx = 1; idx + byte_idx < pstr->valid_len; ++byte_idx)
+     if (pstr->wcs[idx + byte_idx] != WEOF)
+@@ -726,7 +745,7 @@ static wint_t
+ internal_function __attribute__ ((pure, unused))
+ re_string_wchar_at (const re_string_t *pstr, int idx)
+ {
+-  if (pstr->mb_cur_max == 1)
++  if (string_mb_cur_max (pstr) == 1)
+     return (wint_t) pstr->mbs[idx];
+   return (wint_t) pstr->wcs[idx];
+ }
+diff --git a/posix/regexec-compat.c b/posix/regexec-compat.c
+new file mode 100644
+index 0000000..0f9b7c7
+--- /dev/null
++++ b/posix/regexec-compat.c
+@@ -0,0 +1,39 @@
++/* Extended regular expression matching and search library.
++   Copyright (C) 2008 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifdef _LIBC
++# include <shlib-compat.h>
++versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
++
++# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
++__typeof__ (__regexec) __compat_regexec;
++
++int
++attribute_compat_text_section
++__compat_regexec (const regex_t *__restrict preg,
++		  const char *__restrict string, size_t nmatch,
++		  regmatch_t pmatch[], int eflags)
++{
++  return regexec (preg, string, nmatch, pmatch,
++		  eflags & (REG_NOTBOL | REG_NOTEOL));
++}
++compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0);
++# endif
++#endif
+diff --git a/posix/regexec.c b/posix/regexec.c
+index 70cd606..e3b49e4 100644
+--- a/posix/regexec.c
++++ b/posix/regexec.c
+@@ -18,6 +18,7 @@
+    <http://www.gnu.org/licenses/>.  */
+ 
+ #include <stdint.h>
++#include <gnu/option-groups.h>
+ 
+ static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
+ 				     int n) internal_function;
+@@ -186,11 +187,11 @@ static int build_trtable (const re_dfa_t *dfa,
+ static int check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ 				    const re_string_t *input, int idx)
+      internal_function;
+-# ifdef _LIBC
++# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE
+ static unsigned int find_collation_sequence_value (const unsigned char *mbs,
+ 						   size_t name_len)
+      internal_function;
+-# endif /* _LIBC */
++# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */
+ #endif /* RE_ENABLE_I18N */
+ static int group_nodes_into_DFAstates (const re_dfa_t *dfa,
+ 				       const re_dfastate_t *state,
+@@ -255,25 +256,9 @@ regexec (preg, string, nmatch, pmatch, eflags)
+   return err != REG_NOERROR;
+ }
+ 
+-#ifdef _LIBC
+-# include <shlib-compat.h>
+-versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
+-
+-# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
+-__typeof__ (__regexec) __compat_regexec;
+-
+-int
+-attribute_compat_text_section
+-__compat_regexec (const regex_t *__restrict preg,
+-		  const char *__restrict string, size_t nmatch,
+-		  regmatch_t pmatch[], int eflags)
+-{
+-  return regexec (preg, string, nmatch, pmatch,
+-		  eflags & (REG_NOTBOL | REG_NOTEOL));
+-}
+-compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0);
+-# endif
+-#endif
++/* EGLIBC: The code that used to be here was move to a separate file
++   so that it can be shared with xregex.c.  */
++#include "regexec-compat.c"
+ 
+ /* Entry points for GNU code.  */
+ 
+@@ -728,7 +713,7 @@ re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
+   incr = (range < 0) ? -1 : 1;
+   left_lim = (range < 0) ? start + range : start;
+   right_lim = (range < 0) ? start : start + range;
+-  sb = dfa->mb_cur_max == 1;
++  sb = dfa_mb_cur_max (dfa) == 1;
+   match_kind =
+     (fastmap
+      ? ((sb || !(preg->syntax & RE_ICASE || t) ? 4 : 0)
+@@ -3448,7 +3433,7 @@ out_free:
+ 	  if (BE (dest_states_word[i] == NULL && err != REG_NOERROR, 0))
+ 	    goto out_free;
+ 
+-	  if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1)
++	  if (dest_states[i] != dest_states_word[i] && dfa_mb_cur_max (dfa) > 1)
+ 	    need_word_trtable = 1;
+ 
+ 	  dest_states_nl[i] = re_acquire_state_context (&err, dfa, &follows,
+@@ -3590,7 +3575,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
+       else if (type == OP_PERIOD)
+ 	{
+ #ifdef RE_ENABLE_I18N
+-	  if (dfa->mb_cur_max > 1)
++	  if (dfa_mb_cur_max (dfa) > 1)
+ 	    bitset_merge (accepts, dfa->sb_char);
+ 	  else
+ #endif
+@@ -3641,7 +3626,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
+ 		  continue;
+ 		}
+ #ifdef RE_ENABLE_I18N
+-	      if (dfa->mb_cur_max > 1)
++	      if (dfa_mb_cur_max (dfa) > 1)
+ 		for (j = 0; j < BITSET_WORDS; ++j)
+ 		  any_set |= (accepts[j] &= (dfa->word_char[j] | ~dfa->sb_char[j]));
+ 	      else
+@@ -3660,7 +3645,7 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
+ 		  continue;
+ 		}
+ #ifdef RE_ENABLE_I18N
+-	      if (dfa->mb_cur_max > 1)
++	      if (dfa_mb_cur_max (dfa) > 1)
+ 		for (j = 0; j < BITSET_WORDS; ++j)
+ 		  any_set |= (accepts[j] &= ~(dfa->word_char[j] & dfa->sb_char[j]));
+ 	      else
+@@ -3836,12 +3821,6 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+   if (node->type == COMPLEX_BRACKET)
+     {
+       const re_charset_t *cset = node->opr.mbcset;
+-# ifdef _LIBC
+-      const unsigned char *pin
+-	= ((const unsigned char *) re_string_get_buffer (input) + str_idx);
+-      int j;
+-      uint32_t nrules;
+-# endif /* _LIBC */
+       int match_len = 0;
+       wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars)
+ 		    ? re_string_wchar_at (input, str_idx) : 0);
+@@ -3853,6 +3832,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ 	    match_len = char_len;
+ 	    goto check_node_accept_bytes_match;
+ 	  }
++#if __OPTION_EGLIBC_LOCALE_CODE
+       /* match with character_class?  */
+       for (i = 0; i < cset->nchar_classes; ++i)
+ 	{
+@@ -3863,14 +3843,22 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ 	      goto check_node_accept_bytes_match;
+ 	    }
+ 	}
++#endif
++
++      /* When __OPTION_EGLIBC_LOCALE_CODE is disabled, only the C
++         locale is supported; it has no collation rules.  */
++# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE
++      const unsigned char *pin
++	= ((const unsigned char *) re_string_get_buffer (input) + str_idx);
++      int j;
++      uint32_t nrules;
+ 
+-# ifdef _LIBC
+       nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
+       if (nrules != 0)
+ 	{
+ 	  unsigned int in_collseq = 0;
+ 	  const int32_t *table, *indirect;
+-	  const unsigned char *weights, *extra;
++	  const unsigned char *weights, *extra = NULL;
+ 	  const char *collseqwc;
+ 
+ 	  /* match with collating_symbol?  */
+@@ -3955,8 +3943,12 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ 	    }
+ 	}
+       else
+-# endif /* _LIBC */
++# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */
+ 	{
++          /* In the _LIBC version, if OPTION_EGLIBC_LOCALE_CODE is
++             disabled, there can be no multibyte range endpoints, and
++             cset->nranges is always zero.  */
++#if __OPTION_EGLIBC_LOCALE_CODE
+ 	  /* match with range expression?  */
+ #if __GNUC__ >= 2
+ 	  wchar_t cmp_buf[] = {L'\0', L'\0', wc, L'\0', L'\0', L'\0'};
+@@ -3975,6 +3967,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+ 		  goto check_node_accept_bytes_match;
+ 		}
+ 	    }
++#endif /* __OPTION_EGLIBC_LOCALE_CODE */
+ 	}
+     check_node_accept_bytes_match:
+       if (!cset->non_match)
+@@ -3990,7 +3983,7 @@ check_node_accept_bytes (const re_dfa_t *dfa, int node_idx,
+   return 0;
+ }
+ 
+-# ifdef _LIBC
++# if defined _LIBC && __OPTION_EGLIBC_LOCALE_CODE
+ static unsigned int
+ internal_function
+ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
+@@ -4048,7 +4041,7 @@ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
+       return UINT_MAX;
+     }
+ }
+-# endif /* _LIBC */
++# endif /* _LIBC && __OPTION_EGLIBC_LOCALE_CODE */
+ #endif /* RE_ENABLE_I18N */
+ 
+ /* Check whether the node accepts the byte which is IDX-th
+@@ -4139,7 +4132,7 @@ extend_buffers (re_match_context_t *mctx, int min_len)
+   if (pstr->icase)
+     {
+ #ifdef RE_ENABLE_I18N
+-      if (pstr->mb_cur_max > 1)
++      if (string_mb_cur_max (pstr) > 1)
+ 	{
+ 	  ret = build_wcs_upper_buffer (pstr);
+ 	  if (BE (ret != REG_NOERROR, 0))
+@@ -4152,7 +4145,7 @@ extend_buffers (re_match_context_t *mctx, int min_len)
+   else
+     {
+ #ifdef RE_ENABLE_I18N
+-      if (pstr->mb_cur_max > 1)
++      if (string_mb_cur_max (pstr) > 1)
+ 	build_wcs_buffer (pstr);
+       else
+ #endif /* RE_ENABLE_I18N  */
+diff --git a/posix/xregex.c b/posix/xregex.c
+new file mode 100644
+index 0000000..d3f7ace
+--- /dev/null
++++ b/posix/xregex.c
+@@ -0,0 +1,8215 @@
++/* Extended regular expression matching and search library,
++   version 0.12.
++   (Implements POSIX draft P1003.2/D11.2, except for some of the
++   internationalization features.)
++
++   Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
++   2002, 2005 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++   02110-1301 USA.  */
++
++/* AIX requires this to be the first thing in the file. */
++#if defined _AIX && !defined __GNUC__ && !defined REGEX_MALLOC
++  #pragma alloca
++#endif
++
++#undef	_GNU_SOURCE
++#define _GNU_SOURCE
++
++#ifndef INSIDE_RECURSION
++# ifdef HAVE_CONFIG_H
++#  include <config.h>
++# endif
++#endif
++
++/*#include <ansidecl.h>*/
++
++
++#ifndef INSIDE_RECURSION
++
++# if defined STDC_HEADERS && !defined emacs
++#  include <stddef.h>
++# else
++/* We need this for `regex.h', and perhaps for the Emacs include files.  */
++#  include <sys/types.h>
++# endif
++
++# if (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_BTOWC)
++#  define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
++# else
++#  define WIDE_CHAR_SUPPORT 0
++# endif
++/* For platform which support the ISO C amendement 1 functionality we
++   support user defined character classes.  */
++# if WIDE_CHAR_SUPPORT
++/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
++#  include <wchar.h>
++#  include <wctype.h>
++# endif
++
++# ifdef _LIBC
++/* We have to keep the namespace clean.  */
++#  define regfree(preg) __regfree (preg)
++#  define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef)
++#  define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags)
++#  define regerror(errcode, preg, errbuf, errbuf_size) \
++	__regerror(errcode, preg, errbuf, errbuf_size)
++#  define re_set_registers(bu, re, nu, st, en) \
++	__re_set_registers (bu, re, nu, st, en)
++#  define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \
++	__re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
++#  define re_match(bufp, string, size, pos, regs) \
++	__re_match (bufp, string, size, pos, regs)
++#  define re_search(bufp, string, size, startpos, range, regs) \
++	__re_search (bufp, string, size, startpos, range, regs)
++#  define re_compile_pattern(pattern, length, bufp) \
++	__re_compile_pattern (pattern, length, bufp)
++#  define re_set_syntax(syntax) __re_set_syntax (syntax)
++#  define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \
++	__re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop)
++#  define re_compile_fastmap(bufp) __re_compile_fastmap (bufp)
++
++#  define btowc __btowc
++
++/* We are also using some library internals.  */
++#  include <locale/localeinfo.h>
++#  include <locale/elem-hash.h>
++#  include <langinfo.h>
++#  include <locale/coll-lookup.h>
++# endif
++
++/* This is for other GNU distributions with internationalized messages.  */
++# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
++#  include <libintl.h>
++#  ifdef _LIBC
++#   undef gettext
++#   define gettext(msgid) __dcgettext ("libc", msgid, LC_MESSAGES)
++#  endif
++# else
++#  define gettext(msgid) (msgid)
++# endif
++
++# ifndef gettext_noop
++/* This define is so xgettext can find the internationalizable
++   strings.  */
++#  define gettext_noop(String) String
++# endif
++
++/* The `emacs' switch turns on certain matching commands
++   that make sense only in Emacs. */
++# ifdef emacs
++
++#  include "lisp.h"
++#  include "buffer.h"
++#  include "syntax.h"
++
++# else  /* not emacs */
++
++/* If we are not linking with Emacs proper,
++   we can't use the relocating allocator
++   even if config.h says that we can.  */
++#  undef REL_ALLOC
++
++#  if defined STDC_HEADERS || defined _LIBC
++#   include <stdlib.h>
++#  else
++char *malloc ();
++char *realloc ();
++#  endif
++
++/* When used in Emacs's lib-src, we need to get bzero and bcopy somehow.
++   If nothing else has been done, use the method below.  */
++#  ifdef INHIBIT_STRING_HEADER
++#   if !(defined HAVE_BZERO && defined HAVE_BCOPY)
++#    if !defined bzero && !defined bcopy
++#     undef INHIBIT_STRING_HEADER
++#    endif
++#   endif
++#  endif
++
++/* This is the normal way of making sure we have a bcopy and a bzero.
++   This is used in most programs--a few other programs avoid this
++   by defining INHIBIT_STRING_HEADER.  */
++#  ifndef INHIBIT_STRING_HEADER
++#   if defined HAVE_STRING_H || defined STDC_HEADERS || defined _LIBC
++#    include <string.h>
++#    ifndef bzero
++#     ifndef _LIBC
++#      define bzero(s, n)	(memset (s, '\0', n), (s))
++#     else
++#      define bzero(s, n)	__bzero (s, n)
++#     endif
++#    endif
++#   else
++#    include <strings.h>
++#    ifndef memcmp
++#     define memcmp(s1, s2, n)	bcmp (s1, s2, n)
++#    endif
++#    ifndef memcpy
++#     define memcpy(d, s, n)	(bcopy (s, d, n), (d))
++#    endif
++#   endif
++#  endif
++
++/* Define the syntax stuff for \<, \>, etc.  */
++
++/* This must be nonzero for the wordchar and notwordchar pattern
++   commands in re_match_2.  */
++#  ifndef Sword
++#   define Sword 1
++#  endif
++
++#  ifdef SWITCH_ENUM_BUG
++#   define SWITCH_ENUM_CAST(x) ((int)(x))
++#  else
++#   define SWITCH_ENUM_CAST(x) (x)
++#  endif
++
++# endif /* not emacs */
++
++# if defined _LIBC || HAVE_LIMITS_H
++#  include <limits.h>
++# endif
++
++# ifndef MB_LEN_MAX
++#  define MB_LEN_MAX 1
++# endif
++
++/* Get the interface, including the syntax bits.  */
++# include "regex.h"
++
++/* isalpha etc. are used for the character classes.  */
++# include <ctype.h>
++
++/* Jim Meyering writes:
++
++   "... Some ctype macros are valid only for character codes that
++   isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
++   using /bin/cc or gcc but without giving an ansi option).  So, all
++   ctype uses should be through macros like ISPRINT...  If
++   STDC_HEADERS is defined, then autoconf has verified that the ctype
++   macros don't need to be guarded with references to isascii. ...
++   Defining isascii to 1 should let any compiler worth its salt
++   eliminate the && through constant folding."
++   Solaris defines some of these symbols so we must undefine them first.  */
++
++# undef ISASCII
++# if defined STDC_HEADERS || (!defined isascii && !defined HAVE_ISASCII)
++#  define ISASCII(c) 1
++# else
++#  define ISASCII(c) isascii(c)
++# endif
++
++# ifdef isblank
++#  define ISBLANK(c) (ISASCII (c) && isblank (c))
++# else
++#  define ISBLANK(c) ((c) == ' ' || (c) == '\t')
++# endif
++# ifdef isgraph
++#  define ISGRAPH(c) (ISASCII (c) && isgraph (c))
++# else
++#  define ISGRAPH(c) (ISASCII (c) && isprint (c) && !isspace (c))
++# endif
++
++# undef ISPRINT
++# define ISPRINT(c) (ISASCII (c) && isprint (c))
++# define ISDIGIT(c) (ISASCII (c) && isdigit (c))
++# define ISALNUM(c) (ISASCII (c) && isalnum (c))
++# define ISALPHA(c) (ISASCII (c) && isalpha (c))
++# define ISCNTRL(c) (ISASCII (c) && iscntrl (c))
++# define ISLOWER(c) (ISASCII (c) && islower (c))
++# define ISPUNCT(c) (ISASCII (c) && ispunct (c))
++# define ISSPACE(c) (ISASCII (c) && isspace (c))
++# define ISUPPER(c) (ISASCII (c) && isupper (c))
++# define ISXDIGIT(c) (ISASCII (c) && isxdigit (c))
++
++# ifdef _tolower
++#  define TOLOWER(c) _tolower(c)
++# else
++#  define TOLOWER(c) tolower(c)
++# endif
++
++# ifndef NULL
++#  define NULL (void *)0
++# endif
++
++/* We remove any previous definition of `SIGN_EXTEND_CHAR',
++   since ours (we hope) works properly with all combinations of
++   machines, compilers, `char' and `unsigned char' argument types.
++   (Per Bothner suggested the basic approach.)  */
++# undef SIGN_EXTEND_CHAR
++# if __STDC__
++#  define SIGN_EXTEND_CHAR(c) ((signed char) (c))
++# else  /* not __STDC__ */
++/* As in Harbison and Steele.  */
++#  define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
++# endif
++
++# ifndef emacs
++/* How many characters in the character set.  */
++#  define CHAR_SET_SIZE 256
++
++#  ifdef SYNTAX_TABLE
++
++extern char *re_syntax_table;
++
++#  else /* not SYNTAX_TABLE */
++
++static char re_syntax_table[CHAR_SET_SIZE];
++
++static void init_syntax_once (void);
++
++static void
++init_syntax_once (void)
++{
++   register int c;
++   static int done = 0;
++
++   if (done)
++     return;
++   bzero (re_syntax_table, sizeof re_syntax_table);
++
++   for (c = 0; c < CHAR_SET_SIZE; ++c)
++     if (ISALNUM (c))
++	re_syntax_table[c] = Sword;
++
++   re_syntax_table['_'] = Sword;
++
++   done = 1;
++}
++
++#  endif /* not SYNTAX_TABLE */
++
++#  define SYNTAX(c) re_syntax_table[(unsigned char) (c)]
++
++# endif /* emacs */
++
++/* Integer type for pointers.  */
++# if !defined _LIBC && !defined HAVE_UINTPTR_T
++typedef unsigned long int uintptr_t;
++# endif
++
++/* Should we use malloc or alloca?  If REGEX_MALLOC is not defined, we
++   use `alloca' instead of `malloc'.  This is because using malloc in
++   re_search* or re_match* could cause memory leaks when C-g is used in
++   Emacs; also, malloc is slower and causes storage fragmentation.  On
++   the other hand, malloc is more portable, and easier to debug.
++
++   Because we sometimes use alloca, some routines have to be macros,
++   not functions -- `alloca'-allocated space disappears at the end of the
++   function it is called in.  */
++
++# ifdef REGEX_MALLOC
++
++#  define REGEX_ALLOCATE malloc
++#  define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
++#  define REGEX_FREE free
++
++# else /* not REGEX_MALLOC  */
++
++/* Emacs already defines alloca, sometimes.  */
++#  ifndef alloca
++
++/* Make alloca work the best possible way.  */
++#   ifdef __GNUC__
++#    define alloca __builtin_alloca
++#   else /* not __GNUC__ */
++#    if HAVE_ALLOCA_H
++#     include <alloca.h>
++#    endif /* HAVE_ALLOCA_H */
++#   endif /* not __GNUC__ */
++
++#  endif /* not alloca */
++
++#  define REGEX_ALLOCATE alloca
++
++/* Assumes a `char *destination' variable.  */
++#  define REGEX_REALLOCATE(source, osize, nsize)			\
++  (destination = (char *) alloca (nsize),				\
++   memcpy (destination, source, osize))
++
++/* No need to do anything to free, after alloca.  */
++#  define REGEX_FREE(arg) ((void)0) /* Do nothing!  But inhibit gcc warning.  */
++
++# endif /* not REGEX_MALLOC */
++
++/* Define how to allocate the failure stack.  */
++
++# if defined REL_ALLOC && defined REGEX_MALLOC
++
++#  define REGEX_ALLOCATE_STACK(size)				\
++  r_alloc (&failure_stack_ptr, (size))
++#  define REGEX_REALLOCATE_STACK(source, osize, nsize)		\
++  r_re_alloc (&failure_stack_ptr, (nsize))
++#  define REGEX_FREE_STACK(ptr)					\
++  r_alloc_free (&failure_stack_ptr)
++
++# else /* not using relocating allocator */
++
++#  ifdef REGEX_MALLOC
++
++#   define REGEX_ALLOCATE_STACK malloc
++#   define REGEX_REALLOCATE_STACK(source, osize, nsize) realloc (source, nsize)
++#   define REGEX_FREE_STACK free
++
++#  else /* not REGEX_MALLOC */
++
++#   define REGEX_ALLOCATE_STACK alloca
++
++#   define REGEX_REALLOCATE_STACK(source, osize, nsize)			\
++   REGEX_REALLOCATE (source, osize, nsize)
++/* No need to explicitly free anything.  */
++#   define REGEX_FREE_STACK(arg)
++
++#  endif /* not REGEX_MALLOC */
++# endif /* not using relocating allocator */
++
++
++/* True if `size1' is non-NULL and PTR is pointing anywhere inside
++   `string1' or just past its end.  This works if PTR is NULL, which is
++   a good thing.  */
++# define FIRST_STRING_P(ptr) 					\
++  (size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
++
++/* (Re)Allocate N items of type T using malloc, or fail.  */
++# define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
++# define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
++# define RETALLOC_IF(addr, n, t) \
++  if (addr) RETALLOC((addr), (n), t); else (addr) = TALLOC ((n), t)
++# define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
++
++# define BYTEWIDTH 8 /* In bits.  */
++
++# define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
++
++# undef MAX
++# undef MIN
++# define MAX(a, b) ((a) > (b) ? (a) : (b))
++# define MIN(a, b) ((a) < (b) ? (a) : (b))
++
++typedef char boolean;
++# define false 0
++# define true 1
++
++static reg_errcode_t byte_regex_compile (const char *pattern, size_t size,
++                                         reg_syntax_t syntax,
++                                         struct re_pattern_buffer *bufp);
++
++static int byte_re_match_2_internal (struct re_pattern_buffer *bufp,
++                                     const char *string1, int size1,
++                                     const char *string2, int size2,
++                                     int pos,
++                                     struct re_registers *regs,
++                                     int stop);
++static int byte_re_search_2 (struct re_pattern_buffer *bufp,
++                             const char *string1, int size1,
++                             const char *string2, int size2,
++                             int startpos, int range,
++                             struct re_registers *regs, int stop);
++static int byte_re_compile_fastmap (struct re_pattern_buffer *bufp);
++
++#ifdef MBS_SUPPORT
++static reg_errcode_t wcs_regex_compile (const char *pattern, size_t size,
++                                        reg_syntax_t syntax,
++                                        struct re_pattern_buffer *bufp);
++
++
++static int wcs_re_match_2_internal (struct re_pattern_buffer *bufp,
++                                    const char *cstring1, int csize1,
++                                    const char *cstring2, int csize2,
++                                    int pos,
++                                    struct re_registers *regs,
++                                    int stop,
++                                    wchar_t *string1, int size1,
++                                    wchar_t *string2, int size2,
++                                    int *mbs_offset1, int *mbs_offset2);
++static int wcs_re_search_2 (struct re_pattern_buffer *bufp,
++                            const char *string1, int size1,
++                            const char *string2, int size2,
++                            int startpos, int range,
++                            struct re_registers *regs, int stop);
++static int wcs_re_compile_fastmap (struct re_pattern_buffer *bufp);
++#endif
++
++/* These are the command codes that appear in compiled regular
++   expressions.  Some opcodes are followed by argument bytes.  A
++   command code can specify any interpretation whatsoever for its
++   arguments.  Zero bytes may appear in the compiled regular expression.  */
++
++typedef enum
++{
++  no_op = 0,
++
++  /* Succeed right away--no more backtracking.  */
++  succeed,
++
++        /* Followed by one byte giving n, then by n literal bytes.  */
++  exactn,
++
++# ifdef MBS_SUPPORT
++	/* Same as exactn, but contains binary data.  */
++  exactn_bin,
++# endif
++
++        /* Matches any (more or less) character.  */
++  anychar,
++
++        /* Matches any one char belonging to specified set.  First
++           following byte is number of bitmap bytes.  Then come bytes
++           for a bitmap saying which chars are in.  Bits in each byte
++           are ordered low-bit-first.  A character is in the set if its
++           bit is 1.  A character too large to have a bit in the map is
++           automatically not in the set.  */
++        /* ifdef MBS_SUPPORT, following element is length of character
++	   classes, length of collating symbols, length of equivalence
++	   classes, length of character ranges, and length of characters.
++	   Next, character class element, collating symbols elements,
++	   equivalence class elements, range elements, and character
++	   elements follow.
++	   See regex_compile function.  */
++  charset,
++
++        /* Same parameters as charset, but match any character that is
++           not one of those specified.  */
++  charset_not,
++
++        /* Start remembering the text that is matched, for storing in a
++           register.  Followed by one byte with the register number, in
++           the range 0 to one less than the pattern buffer's re_nsub
++           field.  Then followed by one byte with the number of groups
++           inner to this one.  (This last has to be part of the
++           start_memory only because we need it in the on_failure_jump
++           of re_match_2.)  */
++  start_memory,
++
++        /* Stop remembering the text that is matched and store it in a
++           memory register.  Followed by one byte with the register
++           number, in the range 0 to one less than `re_nsub' in the
++           pattern buffer, and one byte with the number of inner groups,
++           just like `start_memory'.  (We need the number of inner
++           groups here because we don't have any easy way of finding the
++           corresponding start_memory when we're at a stop_memory.)  */
++  stop_memory,
++
++        /* Match a duplicate of something remembered. Followed by one
++           byte containing the register number.  */
++  duplicate,
++
++        /* Fail unless at beginning of line.  */
++  begline,
++
++        /* Fail unless at end of line.  */
++  endline,
++
++        /* Succeeds if at beginning of buffer (if emacs) or at beginning
++           of string to be matched (if not).  */
++  begbuf,
++
++        /* Analogously, for end of buffer/string.  */
++  endbuf,
++
++        /* Followed by two byte relative address to which to jump.  */
++  jump,
++
++	/* Same as jump, but marks the end of an alternative.  */
++  jump_past_alt,
++
++        /* Followed by two-byte relative address of place to resume at
++           in case of failure.  */
++        /* ifdef MBS_SUPPORT, the size of address is 1.  */
++  on_failure_jump,
++
++        /* Like on_failure_jump, but pushes a placeholder instead of the
++           current string position when executed.  */
++  on_failure_keep_string_jump,
++
++        /* Throw away latest failure point and then jump to following
++           two-byte relative address.  */
++        /* ifdef MBS_SUPPORT, the size of address is 1.  */
++  pop_failure_jump,
++
++        /* Change to pop_failure_jump if know won't have to backtrack to
++           match; otherwise change to jump.  This is used to jump
++           back to the beginning of a repeat.  If what follows this jump
++           clearly won't match what the repeat does, such that we can be
++           sure that there is no use backtracking out of repetitions
++           already matched, then we change it to a pop_failure_jump.
++           Followed by two-byte address.  */
++        /* ifdef MBS_SUPPORT, the size of address is 1.  */
++  maybe_pop_jump,
++
++        /* Jump to following two-byte address, and push a dummy failure
++           point. This failure point will be thrown away if an attempt
++           is made to use it for a failure.  A `+' construct makes this
++           before the first repeat.  Also used as an intermediary kind
++           of jump when compiling an alternative.  */
++        /* ifdef MBS_SUPPORT, the size of address is 1.  */
++  dummy_failure_jump,
++
++	/* Push a dummy failure point and continue.  Used at the end of
++	   alternatives.  */
++  push_dummy_failure,
++
++        /* Followed by two-byte relative address and two-byte number n.
++           After matching N times, jump to the address upon failure.  */
++        /* ifdef MBS_SUPPORT, the size of address is 1.  */
++  succeed_n,
++
++        /* Followed by two-byte relative address, and two-byte number n.
++           Jump to the address N times, then fail.  */
++        /* ifdef MBS_SUPPORT, the size of address is 1.  */
++  jump_n,
++
++        /* Set the following two-byte relative address to the
++           subsequent two-byte number.  The address *includes* the two
++           bytes of number.  */
++        /* ifdef MBS_SUPPORT, the size of address is 1.  */
++  set_number_at,
++
++  wordchar,	/* Matches any word-constituent character.  */
++  notwordchar,	/* Matches any char that is not a word-constituent.  */
++
++  wordbeg,	/* Succeeds if at word beginning.  */
++  wordend,	/* Succeeds if at word end.  */
++
++  wordbound,	/* Succeeds if at a word boundary.  */
++  notwordbound	/* Succeeds if not at a word boundary.  */
++
++# ifdef emacs
++  ,before_dot,	/* Succeeds if before point.  */
++  at_dot,	/* Succeeds if at point.  */
++  after_dot,	/* Succeeds if after point.  */
++
++	/* Matches any character whose syntax is specified.  Followed by
++           a byte which contains a syntax code, e.g., Sword.  */
++  syntaxspec,
++
++	/* Matches any character whose syntax is not that specified.  */
++  notsyntaxspec
++# endif /* emacs */
++} re_opcode_t;
++#endif /* not INSIDE_RECURSION */
++
++
++#ifdef BYTE
++# define CHAR_T char
++# define UCHAR_T unsigned char
++# define COMPILED_BUFFER_VAR bufp->buffer
++# define OFFSET_ADDRESS_SIZE 2
++# define PREFIX(name) byte_##name
++# define ARG_PREFIX(name) name
++# define PUT_CHAR(c) putchar (c)
++# include <locale/weight.h>
++# define FINDIDX findidx
++#else
++# ifdef WCHAR
++#  define CHAR_T wchar_t
++#  define UCHAR_T wchar_t
++#  define COMPILED_BUFFER_VAR wc_buffer
++#  define OFFSET_ADDRESS_SIZE 1 /* the size which STORE_NUMBER macro use */
++#  define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_T)+1)
++#  define PREFIX(name) wcs_##name
++#  define ARG_PREFIX(name) c##name
++/* Should we use wide stream??  */
++#  define PUT_CHAR(c) printf ("%C", c);
++#  define TRUE 1
++#  define FALSE 0
++#  define findidx findidxwc
++#  include <locale/weightwc.h>
++#  undef findidx
++#  define FINDIDX findidxwc
++# else
++#  ifdef MBS_SUPPORT
++#   define WCHAR
++#   define INSIDE_RECURSION
++#   include "xregex.c"
++#   undef INSIDE_RECURSION
++#  endif
++#  define BYTE
++#  define INSIDE_RECURSION
++#  include "xregex.c"
++#  undef INSIDE_RECURSION
++# endif
++#endif
++
++#ifdef INSIDE_RECURSION
++/* Common operations on the compiled pattern.  */
++
++/* Store NUMBER in two contiguous bytes starting at DESTINATION.  */
++/* ifdef MBS_SUPPORT, we store NUMBER in 1 element.  */
++
++# ifdef WCHAR
++#  define STORE_NUMBER(destination, number)				\
++  do {									\
++    *(destination) = (UCHAR_T)(number);				\
++  } while (0)
++# else /* BYTE */
++#  define STORE_NUMBER(destination, number)				\
++  do {									\
++    (destination)[0] = (number) & 0377;					\
++    (destination)[1] = (number) >> 8;					\
++  } while (0)
++# endif /* WCHAR */
++
++/* Same as STORE_NUMBER, except increment DESTINATION to
++   the byte after where the number is stored.  Therefore, DESTINATION
++   must be an lvalue.  */
++/* ifdef MBS_SUPPORT, we store NUMBER in 1 element.  */
++
++# define STORE_NUMBER_AND_INCR(destination, number)			\
++  do {									\
++    STORE_NUMBER (destination, number);					\
++    (destination) += OFFSET_ADDRESS_SIZE;				\
++  } while (0)
++
++/* Put into DESTINATION a number stored in two contiguous bytes starting
++   at SOURCE.  */
++/* ifdef MBS_SUPPORT, we store NUMBER in 1 element.  */
++
++# ifdef WCHAR
++#  define EXTRACT_NUMBER(destination, source)				\
++  do {									\
++    (destination) = *(source);						\
++  } while (0)
++# else /* BYTE */
++#  define EXTRACT_NUMBER(destination, source)				\
++  do {									\
++    (destination) = *(source) & 0377;					\
++    (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8;		\
++  } while (0)
++# endif
++
++# ifdef DEBUG
++static void PREFIX(extract_number) (int *dest, UCHAR_T *source);
++static void
++PREFIX(extract_number) (int *dest, UCHAR_T *source)
++{
++#  ifdef WCHAR
++  *dest = *source;
++#  else /* BYTE */
++  int temp = SIGN_EXTEND_CHAR (*(source + 1));
++  *dest = *source & 0377;
++  *dest += temp << 8;
++#  endif
++}
++
++#  ifndef EXTRACT_MACROS /* To debug the macros.  */
++#   undef EXTRACT_NUMBER
++#   define EXTRACT_NUMBER(dest, src) PREFIX(extract_number) (&dest, src)
++#  endif /* not EXTRACT_MACROS */
++
++# endif /* DEBUG */
++
++/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number.
++   SOURCE must be an lvalue.  */
++
++# define EXTRACT_NUMBER_AND_INCR(destination, source)			\
++  do {									\
++    EXTRACT_NUMBER (destination, source);				\
++    (source) += OFFSET_ADDRESS_SIZE; 					\
++  } while (0)
++
++# ifdef DEBUG
++static void PREFIX(extract_number_and_incr) (int *destination,
++                                             UCHAR_T **source);
++static void
++PREFIX(extract_number_and_incr) (int *destination, UCHAR_T **source)
++{
++  PREFIX(extract_number) (destination, *source);
++  *source += OFFSET_ADDRESS_SIZE;
++}
++
++#  ifndef EXTRACT_MACROS
++#   undef EXTRACT_NUMBER_AND_INCR
++#   define EXTRACT_NUMBER_AND_INCR(dest, src) \
++  PREFIX(extract_number_and_incr) (&dest, &src)
++#  endif /* not EXTRACT_MACROS */
++
++# endif /* DEBUG */
++
++
++
++/* If DEBUG is defined, Regex prints many voluminous messages about what
++   it is doing (if the variable `debug' is nonzero).  If linked with the
++   main program in `iregex.c', you can enter patterns and strings
++   interactively.  And if linked with the main program in `main.c' and
++   the other test files, you can run the already-written tests.  */
++
++# ifdef DEBUG
++
++#  ifndef DEFINED_ONCE
++
++/* We use standard I/O for debugging.  */
++#   include <stdio.h>
++
++/* It is useful to test things that ``must'' be true when debugging.  */
++#   include <assert.h>
++
++static int debug;
++
++#   define DEBUG_STATEMENT(e) e
++#   define DEBUG_PRINT1(x) if (debug) printf (x)
++#   define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
++#   define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
++#   define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
++#  endif /* not DEFINED_ONCE */
++
++#  define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) 			\
++  if (debug) PREFIX(print_partial_compiled_pattern) (s, e)
++#  define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)		\
++  if (debug) PREFIX(print_double_string) (w, s1, sz1, s2, sz2)
++
++
++/* Print the fastmap in human-readable form.  */
++
++#  ifndef DEFINED_ONCE
++void
++print_fastmap (char *fastmap)
++{
++  unsigned was_a_range = 0;
++  unsigned i = 0;
++
++  while (i < (1 << BYTEWIDTH))
++    {
++      if (fastmap[i++])
++	{
++	  was_a_range = 0;
++          putchar (i - 1);
++          while (i < (1 << BYTEWIDTH)  &&  fastmap[i])
++            {
++              was_a_range = 1;
++              i++;
++            }
++	  if (was_a_range)
++            {
++              printf ("-");
++              putchar (i - 1);
++            }
++        }
++    }
++  putchar ('\n');
++}
++#  endif /* not DEFINED_ONCE */
++
++
++/* Print a compiled pattern string in human-readable form, starting at
++   the START pointer into it and ending just before the pointer END.  */
++
++void
++PREFIX(print_partial_compiled_pattern) (UCHAR_T *start, UCHAR_T *end)
++{
++  int mcnt, mcnt2;
++  UCHAR_T *p1;
++  UCHAR_T *p = start;
++  UCHAR_T *pend = end;
++
++  if (start == NULL)
++    {
++      printf ("(null)\n");
++      return;
++    }
++
++  /* Loop over pattern commands.  */
++  while (p < pend)
++    {
++#  ifdef _LIBC
++      printf ("%td:\t", p - start);
++#  else
++      printf ("%ld:\t", (long int) (p - start));
++#  endif
++
++      switch ((re_opcode_t) *p++)
++	{
++        case no_op:
++          printf ("/no_op");
++          break;
++
++	case exactn:
++	  mcnt = *p++;
++          printf ("/exactn/%d", mcnt);
++          do
++	    {
++              putchar ('/');
++	      PUT_CHAR (*p++);
++            }
++          while (--mcnt);
++          break;
++
++#  ifdef MBS_SUPPORT
++	case exactn_bin:
++	  mcnt = *p++;
++	  printf ("/exactn_bin/%d", mcnt);
++          do
++	    {
++	      printf("/%lx", (long int) *p++);
++            }
++          while (--mcnt);
++          break;
++#  endif /* MBS_SUPPORT */
++
++	case start_memory:
++          mcnt = *p++;
++          printf ("/start_memory/%d/%ld", mcnt, (long int) *p++);
++          break;
++
++	case stop_memory:
++          mcnt = *p++;
++	  printf ("/stop_memory/%d/%ld", mcnt, (long int) *p++);
++          break;
++
++	case duplicate:
++	  printf ("/duplicate/%ld", (long int) *p++);
++	  break;
++
++	case anychar:
++	  printf ("/anychar");
++	  break;
++
++	case charset:
++        case charset_not:
++          {
++#  ifdef WCHAR
++	    int i, length;
++	    wchar_t *workp = p;
++	    printf ("/charset [%s",
++	            (re_opcode_t) *(workp - 1) == charset_not ? "^" : "");
++	    p += 5;
++	    length = *workp++; /* the length of char_classes */
++	    for (i=0 ; i<length ; i++)
++	      printf("[:%lx:]", (long int) *p++);
++	    length = *workp++; /* the length of collating_symbol */
++	    for (i=0 ; i<length ;)
++	      {
++		printf("[.");
++		while(*p != 0)
++		  PUT_CHAR((i++,*p++));
++		i++,p++;
++		printf(".]");
++	      }
++	    length = *workp++; /* the length of equivalence_class */
++	    for (i=0 ; i<length ;)
++	      {
++		printf("[=");
++		while(*p != 0)
++		  PUT_CHAR((i++,*p++));
++		i++,p++;
++		printf("=]");
++	      }
++	    length = *workp++; /* the length of char_range */
++	    for (i=0 ; i<length ; i++)
++	      {
++		wchar_t range_start = *p++;
++		wchar_t range_end = *p++;
++		printf("%C-%C", range_start, range_end);
++	      }
++	    length = *workp++; /* the length of char */
++	    for (i=0 ; i<length ; i++)
++	      printf("%C", *p++);
++	    putchar (']');
++#  else
++            register int c, last = -100;
++	    register int in_range = 0;
++
++	    printf ("/charset [%s",
++	            (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
++
++            assert (p + *p < pend);
++
++            for (c = 0; c < 256; c++)
++	      if (c / 8 < *p
++		  && (p[1 + (c/8)] & (1 << (c % 8))))
++		{
++		  /* Are we starting a range?  */
++		  if (last + 1 == c && ! in_range)
++		    {
++		      putchar ('-');
++		      in_range = 1;
++		    }
++		  /* Have we broken a range?  */
++		  else if (last + 1 != c && in_range)
++              {
++		      putchar (last);
++		      in_range = 0;
++		    }
++
++		  if (! in_range)
++		    putchar (c);
++
++		  last = c;
++              }
++
++	    if (in_range)
++	      putchar (last);
++
++	    putchar (']');
++
++	    p += 1 + *p;
++#  endif /* WCHAR */
++	  }
++	  break;
++
++	case begline:
++	  printf ("/begline");
++          break;
++
++	case endline:
++          printf ("/endline");
++          break;
++
++	case on_failure_jump:
++          PREFIX(extract_number_and_incr) (&mcnt, &p);
++#  ifdef _LIBC
++  	  printf ("/on_failure_jump to %td", p + mcnt - start);
++#  else
++  	  printf ("/on_failure_jump to %ld", (long int) (p + mcnt - start));
++#  endif
++          break;
++
++	case on_failure_keep_string_jump:
++          PREFIX(extract_number_and_incr) (&mcnt, &p);
++#  ifdef _LIBC
++  	  printf ("/on_failure_keep_string_jump to %td", p + mcnt - start);
++#  else
++  	  printf ("/on_failure_keep_string_jump to %ld",
++		  (long int) (p + mcnt - start));
++#  endif
++          break;
++
++	case dummy_failure_jump:
++          PREFIX(extract_number_and_incr) (&mcnt, &p);
++#  ifdef _LIBC
++  	  printf ("/dummy_failure_jump to %td", p + mcnt - start);
++#  else
++  	  printf ("/dummy_failure_jump to %ld", (long int) (p + mcnt - start));
++#  endif
++          break;
++
++	case push_dummy_failure:
++          printf ("/push_dummy_failure");
++          break;
++
++        case maybe_pop_jump:
++          PREFIX(extract_number_and_incr) (&mcnt, &p);
++#  ifdef _LIBC
++  	  printf ("/maybe_pop_jump to %td", p + mcnt - start);
++#  else
++  	  printf ("/maybe_pop_jump to %ld", (long int) (p + mcnt - start));
++#  endif
++	  break;
++
++        case pop_failure_jump:
++	  PREFIX(extract_number_and_incr) (&mcnt, &p);
++#  ifdef _LIBC
++  	  printf ("/pop_failure_jump to %td", p + mcnt - start);
++#  else
++  	  printf ("/pop_failure_jump to %ld", (long int) (p + mcnt - start));
++#  endif
++	  break;
++
++        case jump_past_alt:
++	  PREFIX(extract_number_and_incr) (&mcnt, &p);
++#  ifdef _LIBC
++  	  printf ("/jump_past_alt to %td", p + mcnt - start);
++#  else
++  	  printf ("/jump_past_alt to %ld", (long int) (p + mcnt - start));
++#  endif
++	  break;
++
++        case jump:
++	  PREFIX(extract_number_and_incr) (&mcnt, &p);
++#  ifdef _LIBC
++  	  printf ("/jump to %td", p + mcnt - start);
++#  else
++  	  printf ("/jump to %ld", (long int) (p + mcnt - start));
++#  endif
++	  break;
++
++        case succeed_n:
++          PREFIX(extract_number_and_incr) (&mcnt, &p);
++	  p1 = p + mcnt;
++          PREFIX(extract_number_and_incr) (&mcnt2, &p);
++#  ifdef _LIBC
++	  printf ("/succeed_n to %td, %d times", p1 - start, mcnt2);
++#  else
++	  printf ("/succeed_n to %ld, %d times",
++		  (long int) (p1 - start), mcnt2);
++#  endif
++          break;
++
++        case jump_n:
++          PREFIX(extract_number_and_incr) (&mcnt, &p);
++	  p1 = p + mcnt;
++          PREFIX(extract_number_and_incr) (&mcnt2, &p);
++	  printf ("/jump_n to %d, %d times", p1 - start, mcnt2);
++          break;
++
++        case set_number_at:
++          PREFIX(extract_number_and_incr) (&mcnt, &p);
++	  p1 = p + mcnt;
++          PREFIX(extract_number_and_incr) (&mcnt2, &p);
++#  ifdef _LIBC
++	  printf ("/set_number_at location %td to %d", p1 - start, mcnt2);
++#  else
++	  printf ("/set_number_at location %ld to %d",
++		  (long int) (p1 - start), mcnt2);
++#  endif
++          break;
++
++        case wordbound:
++	  printf ("/wordbound");
++	  break;
++
++	case notwordbound:
++	  printf ("/notwordbound");
++          break;
++
++	case wordbeg:
++	  printf ("/wordbeg");
++	  break;
++
++	case wordend:
++	  printf ("/wordend");
++	  break;
++
++#  ifdef emacs
++	case before_dot:
++	  printf ("/before_dot");
++          break;
++
++	case at_dot:
++	  printf ("/at_dot");
++          break;
++
++	case after_dot:
++	  printf ("/after_dot");
++          break;
++
++	case syntaxspec:
++          printf ("/syntaxspec");
++	  mcnt = *p++;
++	  printf ("/%d", mcnt);
++          break;
++
++	case notsyntaxspec:
++          printf ("/notsyntaxspec");
++	  mcnt = *p++;
++	  printf ("/%d", mcnt);
++	  break;
++#  endif /* emacs */
++
++	case wordchar:
++	  printf ("/wordchar");
++          break;
++
++	case notwordchar:
++	  printf ("/notwordchar");
++          break;
++
++	case begbuf:
++	  printf ("/begbuf");
++          break;
++
++	case endbuf:
++	  printf ("/endbuf");
++          break;
++
++        default:
++          printf ("?%ld", (long int) *(p-1));
++	}
++
++      putchar ('\n');
++    }
++
++#  ifdef _LIBC
++  printf ("%td:\tend of pattern.\n", p - start);
++#  else
++  printf ("%ld:\tend of pattern.\n", (long int) (p - start));
++#  endif
++}
++
++
++void
++PREFIX(print_compiled_pattern) (struct re_pattern_buffer *bufp)
++{
++  UCHAR_T *buffer = (UCHAR_T*) bufp->buffer;
++
++  PREFIX(print_partial_compiled_pattern) (buffer, buffer
++				  + bufp->used / sizeof(UCHAR_T));
++  printf ("%ld bytes used/%ld bytes allocated.\n",
++	  bufp->used, bufp->allocated);
++
++  if (bufp->fastmap_accurate && bufp->fastmap)
++    {
++      printf ("fastmap: ");
++      print_fastmap (bufp->fastmap);
++    }
++
++#  ifdef _LIBC
++  printf ("re_nsub: %Zd\t", bufp->re_nsub);
++#  else
++  printf ("re_nsub: %ld\t", (long int) bufp->re_nsub);
++#  endif
++  printf ("regs_alloc: %d\t", bufp->regs_allocated);
++  printf ("can_be_null: %d\t", bufp->can_be_null);
++  printf ("newline_anchor: %d\n", bufp->newline_anchor);
++  printf ("no_sub: %d\t", bufp->no_sub);
++  printf ("not_bol: %d\t", bufp->not_bol);
++  printf ("not_eol: %d\t", bufp->not_eol);
++  printf ("syntax: %lx\n", bufp->syntax);
++  /* Perhaps we should print the translate table?  */
++}
++
++
++void
++PREFIX(print_double_string) (const CHAR_T *where, const CHAR_T *string1,
++                             int size1, const CHAR_T *string2, int size2)
++{
++  int this_char;
++
++  if (where == NULL)
++    printf ("(null)");
++  else
++    {
++      int cnt;
++
++      if (FIRST_STRING_P (where))
++        {
++          for (this_char = where - string1; this_char < size1; this_char++)
++	    PUT_CHAR (string1[this_char]);
++
++          where = string2;
++        }
++
++      cnt = 0;
++      for (this_char = where - string2; this_char < size2; this_char++)
++	{
++	  PUT_CHAR (string2[this_char]);
++	  if (++cnt > 100)
++	    {
++	      fputs ("...", stdout);
++	      break;
++	    }
++	}
++    }
++}
++
++#  ifndef DEFINED_ONCE
++void
++printchar (int c)
++{
++  putc (c, stderr);
++}
++#  endif
++
++# else /* not DEBUG */
++
++#  ifndef DEFINED_ONCE
++#   undef assert
++#   define assert(e)
++
++#   define DEBUG_STATEMENT(e)
++#   define DEBUG_PRINT1(x)
++#   define DEBUG_PRINT2(x1, x2)
++#   define DEBUG_PRINT3(x1, x2, x3)
++#   define DEBUG_PRINT4(x1, x2, x3, x4)
++#  endif /* not DEFINED_ONCE */
++#  define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
++#  define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
++
++# endif /* not DEBUG */
++
++
++
++# ifdef WCHAR
++/* This  convert a multibyte string to a wide character string.
++   And write their correspondances to offset_buffer(see below)
++   and write whether each wchar_t is binary data to is_binary.
++   This assume invalid multibyte sequences as binary data.
++   We assume offset_buffer and is_binary is already allocated
++   enough space.  */
++
++static size_t convert_mbs_to_wcs (CHAR_T *dest, const unsigned char* src,
++				  size_t len, int *offset_buffer,
++				  char *is_binary);
++static size_t
++convert_mbs_to_wcs (CHAR_T *dest, const unsigned char*src, size_t len,
++                    int *offset_buffer, char *is_binary)
++     /* It hold correspondances between src(char string) and
++	dest(wchar_t string) for optimization.
++	e.g. src  = "xxxyzz"
++             dest = {'X', 'Y', 'Z'}
++	      (each "xxx", "y" and "zz" represent one multibyte character
++	       corresponding to 'X', 'Y' and 'Z'.)
++	  offset_buffer = {0, 0+3("xxx"), 0+3+1("y"), 0+3+1+2("zz")}
++	  	        = {0, 3, 4, 6}
++     */
++{
++  wchar_t *pdest = dest;
++  const unsigned char *psrc = src;
++  size_t wc_count = 0;
++
++  mbstate_t mbs;
++  int i, consumed;
++  size_t mb_remain = len;
++  size_t mb_count = 0;
++
++  /* Initialize the conversion state.  */
++  memset (&mbs, 0, sizeof (mbstate_t));
++
++  offset_buffer[0] = 0;
++  for( ; mb_remain > 0 ; ++wc_count, ++pdest, mb_remain -= consumed,
++	 psrc += consumed)
++    {
++#ifdef _LIBC
++      consumed = __mbrtowc (pdest, psrc, mb_remain, &mbs);
++#else
++      consumed = mbrtowc (pdest, psrc, mb_remain, &mbs);
++#endif
++
++      if (consumed <= 0)
++	/* failed to convert. maybe src contains binary data.
++	   So we consume 1 byte manualy.  */
++	{
++	  *pdest = *psrc;
++	  consumed = 1;
++	  is_binary[wc_count] = TRUE;
++	}
++      else
++	is_binary[wc_count] = FALSE;
++      /* In sjis encoding, we use yen sign as escape character in
++	 place of reverse solidus. So we convert 0x5c(yen sign in
++	 sjis) to not 0xa5(yen sign in UCS2) but 0x5c(reverse
++	 solidus in UCS2).  */
++      if (consumed == 1 && (int) *psrc == 0x5c && (int) *pdest == 0xa5)
++	*pdest = (wchar_t) *psrc;
++
++      offset_buffer[wc_count + 1] = mb_count += consumed;
++    }
++
++  /* Fill remain of the buffer with sentinel.  */
++  for (i = wc_count + 1 ; i <= len ; i++)
++    offset_buffer[i] = mb_count + 1;
++
++  return wc_count;
++}
++
++# endif /* WCHAR */
++
++#else /* not INSIDE_RECURSION */
++
++/* Set by `re_set_syntax' to the current regexp syntax to recognize.  Can
++   also be assigned to arbitrarily: each pattern buffer stores its own
++   syntax, so it can be changed between regex compilations.  */
++/* This has no initializer because initialized variables in Emacs
++   become read-only after dumping.  */
++reg_syntax_t re_syntax_options;
++
++
++/* Specify the precise syntax of regexps for compilation.  This provides
++   for compatibility for various utilities which historically have
++   different, incompatible syntaxes.
++
++   The argument SYNTAX is a bit mask comprised of the various bits
++   defined in regex.h.  We return the old syntax.  */
++
++reg_syntax_t
++re_set_syntax (reg_syntax_t syntax)
++{
++  reg_syntax_t ret = re_syntax_options;
++
++  re_syntax_options = syntax;
++# ifdef DEBUG
++  if (syntax & RE_DEBUG)
++    debug = 1;
++  else if (debug) /* was on but now is not */
++    debug = 0;
++# endif /* DEBUG */
++  return ret;
++}
++# ifdef _LIBC
++weak_alias (__re_set_syntax, re_set_syntax)
++# endif
++
++/* This table gives an error message for each of the error codes listed
++   in regex.h.  Obviously the order here has to be same as there.
++   POSIX doesn't require that we do anything for REG_NOERROR,
++   but why not be nice?  */
++
++static const char *re_error_msgid[] =
++  {
++    gettext_noop ("Success"),	/* REG_NOERROR */
++    gettext_noop ("No match"),	/* REG_NOMATCH */
++    gettext_noop ("Invalid regular expression"), /* REG_BADPAT */
++    gettext_noop ("Invalid collation character"), /* REG_ECOLLATE */
++    gettext_noop ("Invalid character class name"), /* REG_ECTYPE */
++    gettext_noop ("Trailing backslash"), /* REG_EESCAPE */
++    gettext_noop ("Invalid back reference"), /* REG_ESUBREG */
++    gettext_noop ("Unmatched [ or [^"),	/* REG_EBRACK */
++    gettext_noop ("Unmatched ( or \\("), /* REG_EPAREN */
++    gettext_noop ("Unmatched \\{"), /* REG_EBRACE */
++    gettext_noop ("Invalid content of \\{\\}"), /* REG_BADBR */
++    gettext_noop ("Invalid range end"),	/* REG_ERANGE */
++    gettext_noop ("Memory exhausted"), /* REG_ESPACE */
++    gettext_noop ("Invalid preceding regular expression"), /* REG_BADRPT */
++    gettext_noop ("Premature end of regular expression"), /* REG_EEND */
++    gettext_noop ("Regular expression too big"), /* REG_ESIZE */
++    gettext_noop ("Unmatched ) or \\)") /* REG_ERPAREN */
++  };
++
++#endif /* INSIDE_RECURSION */
++
++#ifndef DEFINED_ONCE
++/* Avoiding alloca during matching, to placate r_alloc.  */
++
++/* Define MATCH_MAY_ALLOCATE unless we need to make sure that the
++   searching and matching functions should not call alloca.  On some
++   systems, alloca is implemented in terms of malloc, and if we're
++   using the relocating allocator routines, then malloc could cause a
++   relocation, which might (if the strings being searched are in the
++   ralloc heap) shift the data out from underneath the regexp
++   routines.
++
++   Here's another reason to avoid allocation: Emacs
++   processes input from X in a signal handler; processing X input may
++   call malloc; if input arrives while a matching routine is calling
++   malloc, then we're scrod.  But Emacs can't just block input while
++   calling matching routines; then we don't notice interrupts when
++   they come in.  So, Emacs blocks input around all regexp calls
++   except the matching calls, which it leaves unprotected, in the
++   faith that they will not malloc.  */
++
++/* Normally, this is fine.  */
++# define MATCH_MAY_ALLOCATE
++
++/* When using GNU C, we are not REALLY using the C alloca, no matter
++   what config.h may say.  So don't take precautions for it.  */
++# ifdef __GNUC__
++#  undef C_ALLOCA
++# endif
++
++/* The match routines may not allocate if (1) they would do it with malloc
++   and (2) it's not safe for them to use malloc.
++   Note that if REL_ALLOC is defined, matching would not use malloc for the
++   failure stack, but we would still use it for the register vectors;
++   so REL_ALLOC should not affect this.  */
++# if (defined C_ALLOCA || defined REGEX_MALLOC) && defined emacs
++#  undef MATCH_MAY_ALLOCATE
++# endif
++#endif /* not DEFINED_ONCE */
++
++#ifdef INSIDE_RECURSION
++/* Failure stack declarations and macros; both re_compile_fastmap and
++   re_match_2 use a failure stack.  These have to be macros because of
++   REGEX_ALLOCATE_STACK.  */
++
++
++/* Number of failure points for which to initially allocate space
++   when matching.  If this number is exceeded, we allocate more
++   space, so it is not a hard limit.  */
++# ifndef INIT_FAILURE_ALLOC
++#  define INIT_FAILURE_ALLOC 5
++# endif
++
++/* Roughly the maximum number of failure points on the stack.  Would be
++   exactly that if always used MAX_FAILURE_ITEMS items each time we failed.
++   This is a variable only so users of regex can assign to it; we never
++   change it ourselves.  */
++
++
++# ifndef DEFINED_ONCE
++
++#  ifdef INT_IS_16BIT
++#   define RE_M_F_TYPE long int
++#  else
++#   define RE_M_F_TYPE int
++#  endif /* INT_IS_16BIT */
++
++#  ifdef MATCH_MAY_ALLOCATE
++/* 4400 was enough to cause a crash on Alpha OSF/1,
++   whose default stack limit is 2mb.  */
++#   define RE_M_F_DEFAULT 4000
++#  else
++#   define RE_M_F_DEFAULT 2000
++#  endif /* MATCH_MAY_ALLOCATE */
++
++#  include <shlib-compat.h>
++
++#  if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3)
++link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.")
++RE_M_F_TYPE re_max_failures = RE_M_F_DEFAULT;
++#  else
++RE_M_F_TYPE re_max_failures attribute_hidden = RE_M_F_DEFAULT;
++#  endif /* SHLIB_COMPAT */
++
++#  undef RE_M_F_TYPE
++#  undef RE_M_F_DEFAULT
++
++# endif /* DEFINED_ONCE */
++
++# ifdef INT_IS_16BIT
++
++union PREFIX(fail_stack_elt)
++{
++  UCHAR_T *pointer;
++  long int integer;
++};
++
++typedef union PREFIX(fail_stack_elt) PREFIX(fail_stack_elt_t);
++
++typedef struct
++{
++  PREFIX(fail_stack_elt_t) *stack;
++  unsigned long int size;
++  unsigned long int avail;		/* Offset of next open position.  */
++} PREFIX(fail_stack_type);
++
++# else /* not INT_IS_16BIT */
++
++union PREFIX(fail_stack_elt)
++{
++  UCHAR_T *pointer;
++  int integer;
++};
++
++typedef union PREFIX(fail_stack_elt) PREFIX(fail_stack_elt_t);
++
++typedef struct
++{
++  PREFIX(fail_stack_elt_t) *stack;
++  unsigned size;
++  unsigned avail;			/* Offset of next open position.  */
++} PREFIX(fail_stack_type);
++
++# endif /* INT_IS_16BIT */
++
++# ifndef DEFINED_ONCE
++#  define FAIL_STACK_EMPTY()     (fail_stack.avail == 0)
++#  define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0)
++#  define FAIL_STACK_FULL()      (fail_stack.avail == fail_stack.size)
++# endif
++
++
++/* Define macros to initialize and free the failure stack.
++   Do `return -2' if the alloc fails.  */
++
++# ifdef MATCH_MAY_ALLOCATE
++#  define INIT_FAIL_STACK()						\
++  do {									\
++    fail_stack.stack = (PREFIX(fail_stack_elt_t) *)		\
++      REGEX_ALLOCATE_STACK (INIT_FAILURE_ALLOC * sizeof (PREFIX(fail_stack_elt_t))); \
++									\
++    if (fail_stack.stack == NULL)				\
++      return -2;							\
++									\
++    fail_stack.size = INIT_FAILURE_ALLOC;			\
++    fail_stack.avail = 0;					\
++  } while (0)
++
++#  define RESET_FAIL_STACK()  REGEX_FREE_STACK (fail_stack.stack)
++# else
++#  define INIT_FAIL_STACK()						\
++  do {									\
++    fail_stack.avail = 0;					\
++  } while (0)
++
++#  define RESET_FAIL_STACK()
++# endif
++
++
++/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
++
++   Return 1 if succeeds, and 0 if either ran out of memory
++   allocating space for it or it was already too large.
++
++   REGEX_REALLOCATE_STACK requires `destination' be declared.   */
++
++# define DOUBLE_FAIL_STACK(fail_stack)					\
++  ((fail_stack).size > (unsigned) (re_max_failures * MAX_FAILURE_ITEMS)	\
++   ? 0									\
++   : ((fail_stack).stack = (PREFIX(fail_stack_elt_t) *)			\
++        REGEX_REALLOCATE_STACK ((fail_stack).stack, 			\
++          (fail_stack).size * sizeof (PREFIX(fail_stack_elt_t)),	\
++          ((fail_stack).size << 1) * sizeof (PREFIX(fail_stack_elt_t))),\
++									\
++      (fail_stack).stack == NULL					\
++      ? 0								\
++      : ((fail_stack).size <<= 1, 					\
++         1)))
++
++
++/* Push pointer POINTER on FAIL_STACK.
++   Return 1 if was able to do so and 0 if ran out of memory allocating
++   space to do so.  */
++# define PUSH_PATTERN_OP(POINTER, FAIL_STACK)				\
++  ((FAIL_STACK_FULL ()							\
++    && !DOUBLE_FAIL_STACK (FAIL_STACK))					\
++   ? 0									\
++   : ((FAIL_STACK).stack[(FAIL_STACK).avail++].pointer = POINTER,	\
++      1))
++
++/* Push a pointer value onto the failure stack.
++   Assumes the variable `fail_stack'.  Probably should only
++   be called from within `PUSH_FAILURE_POINT'.  */
++# define PUSH_FAILURE_POINTER(item)					\
++  fail_stack.stack[fail_stack.avail++].pointer = (UCHAR_T *) (item)
++
++/* This pushes an integer-valued item onto the failure stack.
++   Assumes the variable `fail_stack'.  Probably should only
++   be called from within `PUSH_FAILURE_POINT'.  */
++# define PUSH_FAILURE_INT(item)					\
++  fail_stack.stack[fail_stack.avail++].integer = (item)
++
++/* Push a fail_stack_elt_t value onto the failure stack.
++   Assumes the variable `fail_stack'.  Probably should only
++   be called from within `PUSH_FAILURE_POINT'.  */
++# define PUSH_FAILURE_ELT(item)					\
++  fail_stack.stack[fail_stack.avail++] =  (item)
++
++/* These three POP... operations complement the three PUSH... operations.
++   All assume that `fail_stack' is nonempty.  */
++# define POP_FAILURE_POINTER() fail_stack.stack[--fail_stack.avail].pointer
++# define POP_FAILURE_INT() fail_stack.stack[--fail_stack.avail].integer
++# define POP_FAILURE_ELT() fail_stack.stack[--fail_stack.avail]
++
++/* Used to omit pushing failure point id's when we're not debugging.  */
++# ifdef DEBUG
++#  define DEBUG_PUSH PUSH_FAILURE_INT
++#  define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_INT ()
++# else
++#  define DEBUG_PUSH(item)
++#  define DEBUG_POP(item_addr)
++# endif
++
++
++/* Push the information about the state we will need
++   if we ever fail back to it.
++
++   Requires variables fail_stack, regstart, regend, reg_info, and
++   num_regs_pushed be declared.  DOUBLE_FAIL_STACK requires `destination'
++   be declared.
++
++   Does `return FAILURE_CODE' if runs out of memory.  */
++
++# define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code)	\
++  do {									\
++    char *destination;							\
++    /* Must be int, so when we don't save any registers, the arithmetic	\
++       of 0 + -1 isn't done as unsigned.  */				\
++    /* Can't be int, since there is not a shred of a guarantee that int	\
++       is wide enough to hold a value of something to which pointer can	\
++       be assigned */							\
++    active_reg_t this_reg;						\
++    									\
++    DEBUG_STATEMENT (failure_id++);					\
++    DEBUG_STATEMENT (nfailure_points_pushed++);				\
++    DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id);		\
++    DEBUG_PRINT2 ("  Before push, next avail: %d\n", (fail_stack).avail);\
++    DEBUG_PRINT2 ("                     size: %d\n", (fail_stack).size);\
++									\
++    DEBUG_PRINT2 ("  slots needed: %ld\n", NUM_FAILURE_ITEMS);		\
++    DEBUG_PRINT2 ("     available: %d\n", REMAINING_AVAIL_SLOTS);	\
++									\
++    /* Ensure we have enough space allocated for what we will push.  */	\
++    while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS)			\
++      {									\
++        if (!DOUBLE_FAIL_STACK (fail_stack))				\
++          return failure_code;						\
++									\
++        DEBUG_PRINT2 ("\n  Doubled stack; size now: %d\n",		\
++		       (fail_stack).size);				\
++        DEBUG_PRINT2 ("  slots available: %d\n", REMAINING_AVAIL_SLOTS);\
++      }									\
++									\
++    /* Push the info, starting with the registers.  */			\
++    DEBUG_PRINT1 ("\n");						\
++									\
++    if (1)								\
++      for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
++	   this_reg++)							\
++	{								\
++	  DEBUG_PRINT2 ("  Pushing reg: %lu\n", this_reg);		\
++	  DEBUG_STATEMENT (num_regs_pushed++);				\
++									\
++	  DEBUG_PRINT2 ("    start: %p\n", regstart[this_reg]);		\
++	  PUSH_FAILURE_POINTER (regstart[this_reg]);			\
++									\
++	  DEBUG_PRINT2 ("    end: %p\n", regend[this_reg]);		\
++	  PUSH_FAILURE_POINTER (regend[this_reg]);			\
++									\
++	  DEBUG_PRINT2 ("    info: %p\n      ",				\
++			reg_info[this_reg].word.pointer);		\
++	  DEBUG_PRINT2 (" match_null=%d",				\
++			REG_MATCH_NULL_STRING_P (reg_info[this_reg]));	\
++	  DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg]));	\
++	  DEBUG_PRINT2 (" matched_something=%d",			\
++			MATCHED_SOMETHING (reg_info[this_reg]));	\
++	  DEBUG_PRINT2 (" ever_matched=%d",				\
++			EVER_MATCHED_SOMETHING (reg_info[this_reg]));	\
++	  DEBUG_PRINT1 ("\n");						\
++	  PUSH_FAILURE_ELT (reg_info[this_reg].word);			\
++	}								\
++									\
++    DEBUG_PRINT2 ("  Pushing  low active reg: %ld\n", lowest_active_reg);\
++    PUSH_FAILURE_INT (lowest_active_reg);				\
++									\
++    DEBUG_PRINT2 ("  Pushing high active reg: %ld\n", highest_active_reg);\
++    PUSH_FAILURE_INT (highest_active_reg);				\
++									\
++    DEBUG_PRINT2 ("  Pushing pattern %p:\n", pattern_place);		\
++    DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend);		\
++    PUSH_FAILURE_POINTER (pattern_place);				\
++									\
++    DEBUG_PRINT2 ("  Pushing string %p: `", string_place);		\
++    DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2,   \
++				 size2);				\
++    DEBUG_PRINT1 ("'\n");						\
++    PUSH_FAILURE_POINTER (string_place);				\
++									\
++    DEBUG_PRINT2 ("  Pushing failure id: %u\n", failure_id);		\
++    DEBUG_PUSH (failure_id);						\
++  } while (0)
++
++# ifndef DEFINED_ONCE
++/* This is the number of items that are pushed and popped on the stack
++   for each register.  */
++#  define NUM_REG_ITEMS  3
++
++/* Individual items aside from the registers.  */
++#  ifdef DEBUG
++#   define NUM_NONREG_ITEMS 5 /* Includes failure point id.  */
++#  else
++#   define NUM_NONREG_ITEMS 4
++#  endif
++
++/* We push at most this many items on the stack.  */
++/* We used to use (num_regs - 1), which is the number of registers
++   this regexp will save; but that was changed to 5
++   to avoid stack overflow for a regexp with lots of parens.  */
++#  define MAX_FAILURE_ITEMS (5 * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
++
++/* We actually push this many items.  */
++#  define NUM_FAILURE_ITEMS				\
++  (((0							\
++     ? 0 : highest_active_reg - lowest_active_reg + 1)	\
++    * NUM_REG_ITEMS)					\
++   + NUM_NONREG_ITEMS)
++
++/* How many items can still be added to the stack without overflowing it.  */
++#  define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail)
++# endif /* not DEFINED_ONCE */
++
++
++/* Pops what PUSH_FAIL_STACK pushes.
++
++   We restore into the parameters, all of which should be lvalues:
++     STR -- the saved data position.
++     PAT -- the saved pattern position.
++     LOW_REG, HIGH_REG -- the highest and lowest active registers.
++     REGSTART, REGEND -- arrays of string positions.
++     REG_INFO -- array of information about each subexpression.
++
++   Also assumes the variables `fail_stack' and (if debugging), `bufp',
++   `pend', `string1', `size1', `string2', and `size2'.  */
++# define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
++{									\
++  DEBUG_STATEMENT (unsigned failure_id;)				\
++  active_reg_t this_reg;						\
++  const UCHAR_T *string_temp;						\
++									\
++  assert (!FAIL_STACK_EMPTY ());					\
++									\
++  /* Remove failure points and point to how many regs pushed.  */	\
++  DEBUG_PRINT1 ("POP_FAILURE_POINT:\n");				\
++  DEBUG_PRINT2 ("  Before pop, next avail: %d\n", fail_stack.avail);	\
++  DEBUG_PRINT2 ("                    size: %d\n", fail_stack.size);	\
++									\
++  assert (fail_stack.avail >= NUM_NONREG_ITEMS);			\
++									\
++  DEBUG_POP (&failure_id);						\
++  DEBUG_PRINT2 ("  Popping failure id: %u\n", failure_id);		\
++									\
++  /* If the saved string location is NULL, it came from an		\
++     on_failure_keep_string_jump opcode, and we want to throw away the	\
++     saved NULL, thus retaining our current position in the string.  */	\
++  string_temp = POP_FAILURE_POINTER ();					\
++  if (string_temp != NULL)						\
++    str = (const CHAR_T *) string_temp;					\
++									\
++  DEBUG_PRINT2 ("  Popping string %p: `", str);				\
++  DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2);	\
++  DEBUG_PRINT1 ("'\n");							\
++									\
++  pat = (UCHAR_T *) POP_FAILURE_POINTER ();				\
++  DEBUG_PRINT2 ("  Popping pattern %p:\n", pat);			\
++  DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend);			\
++									\
++  /* Restore register info.  */						\
++  high_reg = (active_reg_t) POP_FAILURE_INT ();				\
++  DEBUG_PRINT2 ("  Popping high active reg: %ld\n", high_reg);		\
++									\
++  low_reg = (active_reg_t) POP_FAILURE_INT ();				\
++  DEBUG_PRINT2 ("  Popping  low active reg: %ld\n", low_reg);		\
++									\
++  if (1)								\
++    for (this_reg = high_reg; this_reg >= low_reg; this_reg--)		\
++      {									\
++	DEBUG_PRINT2 ("    Popping reg: %ld\n", this_reg);		\
++									\
++	reg_info[this_reg].word = POP_FAILURE_ELT ();			\
++	DEBUG_PRINT2 ("      info: %p\n",				\
++		      reg_info[this_reg].word.pointer);			\
++									\
++	regend[this_reg] = (const CHAR_T *) POP_FAILURE_POINTER ();	\
++	DEBUG_PRINT2 ("      end: %p\n", regend[this_reg]);		\
++									\
++	regstart[this_reg] = (const CHAR_T *) POP_FAILURE_POINTER ();	\
++	DEBUG_PRINT2 ("      start: %p\n", regstart[this_reg]);		\
++      }									\
++  else									\
++    {									\
++      for (this_reg = highest_active_reg; this_reg > high_reg; this_reg--) \
++	{								\
++	  reg_info[this_reg].word.integer = 0;				\
++	  regend[this_reg] = 0;						\
++	  regstart[this_reg] = 0;					\
++	}								\
++      highest_active_reg = high_reg;					\
++    }									\
++									\
++  set_regs_matched_done = 0;						\
++  DEBUG_STATEMENT (nfailure_points_popped++);				\
++} /* POP_FAILURE_POINT */
++
++/* Structure for per-register (a.k.a. per-group) information.
++   Other register information, such as the
++   starting and ending positions (which are addresses), and the list of
++   inner groups (which is a bits list) are maintained in separate
++   variables.
++
++   We are making a (strictly speaking) nonportable assumption here: that
++   the compiler will pack our bit fields into something that fits into
++   the type of `word', i.e., is something that fits into one item on the
++   failure stack.  */
++
++
++/* Declarations and macros for re_match_2.  */
++
++typedef union
++{
++  PREFIX(fail_stack_elt_t) word;
++  struct
++  {
++      /* This field is one if this group can match the empty string,
++         zero if not.  If not yet determined,  `MATCH_NULL_UNSET_VALUE'.  */
++# define MATCH_NULL_UNSET_VALUE 3
++    unsigned match_null_string_p : 2;
++    unsigned is_active : 1;
++    unsigned matched_something : 1;
++    unsigned ever_matched_something : 1;
++  } bits;
++} PREFIX(register_info_type);
++
++# ifndef DEFINED_ONCE
++#  define REG_MATCH_NULL_STRING_P(R)  ((R).bits.match_null_string_p)
++#  define IS_ACTIVE(R)  ((R).bits.is_active)
++#  define MATCHED_SOMETHING(R)  ((R).bits.matched_something)
++#  define EVER_MATCHED_SOMETHING(R)  ((R).bits.ever_matched_something)
++
++
++/* Call this when have matched a real character; it sets `matched' flags
++   for the subexpressions which we are currently inside.  Also records
++   that those subexprs have matched.  */
++#  define SET_REGS_MATCHED()						\
++  do									\
++    {									\
++      if (!set_regs_matched_done)					\
++	{								\
++	  active_reg_t r;						\
++	  set_regs_matched_done = 1;					\
++	  for (r = lowest_active_reg; r <= highest_active_reg; r++)	\
++	    {								\
++	      MATCHED_SOMETHING (reg_info[r])				\
++		= EVER_MATCHED_SOMETHING (reg_info[r])			\
++		= 1;							\
++	    }								\
++	}								\
++    }									\
++  while (0)
++# endif /* not DEFINED_ONCE */
++
++/* Registers are set to a sentinel when they haven't yet matched.  */
++static CHAR_T PREFIX(reg_unset_dummy);
++# define REG_UNSET_VALUE (&PREFIX(reg_unset_dummy))
++# define REG_UNSET(e) ((e) == REG_UNSET_VALUE)
++
++/* Subroutine declarations and macros for regex_compile.  */
++static void PREFIX(store_op1) (re_opcode_t op, UCHAR_T *loc, int arg);
++static void PREFIX(store_op2) (re_opcode_t op, UCHAR_T *loc,
++                               int arg1, int arg2);
++static void PREFIX(insert_op1) (re_opcode_t op, UCHAR_T *loc,
++                                int arg, UCHAR_T *end);
++static void PREFIX(insert_op2) (re_opcode_t op, UCHAR_T *loc,
++                                int arg1, int arg2, UCHAR_T *end);
++static boolean PREFIX(at_begline_loc_p) (const CHAR_T *pattern,
++                                         const CHAR_T *p,
++                                         reg_syntax_t syntax);
++static boolean PREFIX(at_endline_loc_p) (const CHAR_T *p,
++                                         const CHAR_T *pend,
++                                         reg_syntax_t syntax);
++# ifdef WCHAR
++static reg_errcode_t wcs_compile_range (CHAR_T range_start,
++                                        const CHAR_T **p_ptr,
++                                        const CHAR_T *pend,
++                                        char *translate,
++                                        reg_syntax_t syntax,
++                                        UCHAR_T *b,
++                                        CHAR_T *char_set);
++static void insert_space (int num, CHAR_T *loc, CHAR_T *end);
++# else /* BYTE */
++static reg_errcode_t byte_compile_range (unsigned int range_start,
++                                         const char **p_ptr,
++                                         const char *pend,
++                                         RE_TRANSLATE_TYPE translate,
++                                         reg_syntax_t syntax,
++                                         unsigned char *b);
++# endif /* WCHAR */
++
++/* Fetch the next character in the uncompiled pattern---translating it
++   if necessary.  Also cast from a signed character in the constant
++   string passed to us by the user to an unsigned char that we can use
++   as an array index (in, e.g., `translate').  */
++/* ifdef MBS_SUPPORT, we translate only if character <= 0xff,
++   because it is impossible to allocate 4GB array for some encodings
++   which have 4 byte character_set like UCS4.  */
++# ifndef PATFETCH
++#  ifdef WCHAR
++#   define PATFETCH(c)							\
++  do {if (p == pend) return REG_EEND;					\
++    c = (UCHAR_T) *p++;							\
++    if (translate && (c <= 0xff)) c = (UCHAR_T) translate[c];		\
++  } while (0)
++#  else /* BYTE */
++#   define PATFETCH(c)							\
++  do {if (p == pend) return REG_EEND;					\
++    c = (unsigned char) *p++;						\
++    if (translate) c = (unsigned char) translate[c];			\
++  } while (0)
++#  endif /* WCHAR */
++# endif
++
++/* Fetch the next character in the uncompiled pattern, with no
++   translation.  */
++# define PATFETCH_RAW(c)						\
++  do {if (p == pend) return REG_EEND;					\
++    c = (UCHAR_T) *p++; 	       					\
++  } while (0)
++
++/* Go backwards one character in the pattern.  */
++# define PATUNFETCH p--
++
++
++/* If `translate' is non-null, return translate[D], else just D.  We
++   cast the subscript to translate because some data is declared as
++   `char *', to avoid warnings when a string constant is passed.  But
++   when we use a character as a subscript we must make it unsigned.  */
++/* ifdef MBS_SUPPORT, we translate only if character <= 0xff,
++   because it is impossible to allocate 4GB array for some encodings
++   which have 4 byte character_set like UCS4.  */
++
++# ifndef TRANSLATE
++#  ifdef WCHAR
++#   define TRANSLATE(d) \
++  ((translate && ((UCHAR_T) (d)) <= 0xff) \
++   ? (char) translate[(unsigned char) (d)] : (d))
++# else /* BYTE */
++#   define TRANSLATE(d) \
++  (translate ? (char) translate[(unsigned char) (d)] : (char) (d))
++#  endif /* WCHAR */
++# endif
++
++
++/* Macros for outputting the compiled pattern into `buffer'.  */
++
++/* If the buffer isn't allocated when it comes in, use this.  */
++# define INIT_BUF_SIZE  (32 * sizeof(UCHAR_T))
++
++/* Make sure we have at least N more bytes of space in buffer.  */
++# ifdef WCHAR
++#  define GET_BUFFER_SPACE(n)						\
++    while (((unsigned long)b - (unsigned long)COMPILED_BUFFER_VAR	\
++            + (n)*sizeof(CHAR_T)) > bufp->allocated)			\
++      EXTEND_BUFFER ()
++# else /* BYTE */
++#  define GET_BUFFER_SPACE(n)						\
++    while ((unsigned long) (b - bufp->buffer + (n)) > bufp->allocated)	\
++      EXTEND_BUFFER ()
++# endif /* WCHAR */
++
++/* Make sure we have one more byte of buffer space and then add C to it.  */
++# define BUF_PUSH(c)							\
++  do {									\
++    GET_BUFFER_SPACE (1);						\
++    *b++ = (UCHAR_T) (c);						\
++  } while (0)
++
++
++/* Ensure we have two more bytes of buffer space and then append C1 and C2.  */
++# define BUF_PUSH_2(c1, c2)						\
++  do {									\
++    GET_BUFFER_SPACE (2);						\
++    *b++ = (UCHAR_T) (c1);						\
++    *b++ = (UCHAR_T) (c2);						\
++  } while (0)
++
++
++/* As with BUF_PUSH_2, except for three bytes.  */
++# define BUF_PUSH_3(c1, c2, c3)						\
++  do {									\
++    GET_BUFFER_SPACE (3);						\
++    *b++ = (UCHAR_T) (c1);						\
++    *b++ = (UCHAR_T) (c2);						\
++    *b++ = (UCHAR_T) (c3);						\
++  } while (0)
++
++/* Store a jump with opcode OP at LOC to location TO.  We store a
++   relative address offset by the three bytes the jump itself occupies.  */
++# define STORE_JUMP(op, loc, to) \
++ PREFIX(store_op1) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)))
++
++/* Likewise, for a two-argument jump.  */
++# define STORE_JUMP2(op, loc, to, arg) \
++  PREFIX(store_op2) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), arg)
++
++/* Like `STORE_JUMP', but for inserting.  Assume `b' is the buffer end.  */
++# define INSERT_JUMP(op, loc, to) \
++  PREFIX(insert_op1) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)), b)
++
++/* Like `STORE_JUMP2', but for inserting.  Assume `b' is the buffer end.  */
++# define INSERT_JUMP2(op, loc, to, arg) \
++  PREFIX(insert_op2) (op, loc, (int) ((to) - (loc) - (1 + OFFSET_ADDRESS_SIZE)),\
++	      arg, b)
++
++/* This is not an arbitrary limit: the arguments which represent offsets
++   into the pattern are two bytes long.  So if 2^16 bytes turns out to
++   be too small, many things would have to change.  */
++/* Any other compiler which, like MSC, has allocation limit below 2^16
++   bytes will have to use approach similar to what was done below for
++   MSC and drop MAX_BUF_SIZE a bit.  Otherwise you may end up
++   reallocating to 0 bytes.  Such thing is not going to work too well.
++   You have been warned!!  */
++# ifndef DEFINED_ONCE
++#  if defined _MSC_VER  && !defined WIN32
++/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes.
++   The REALLOC define eliminates a flurry of conversion warnings,
++   but is not required. */
++#   define MAX_BUF_SIZE  65500L
++#   define REALLOC(p,s) realloc ((p), (size_t) (s))
++#  else
++#   define MAX_BUF_SIZE (1L << 16)
++#   define REALLOC(p,s) realloc ((p), (s))
++#  endif
++
++/* Extend the buffer by twice its current size via realloc and
++   reset the pointers that pointed into the old block to point to the
++   correct places in the new one.  If extending the buffer results in it
++   being larger than MAX_BUF_SIZE, then flag memory exhausted.  */
++#  ifndef __BOUNDED_POINTERS__
++#    define __BOUNDED_POINTERS__ 0
++#  endif
++#  if __BOUNDED_POINTERS__
++#   define SET_HIGH_BOUND(P) (__ptrhigh (P) = __ptrlow (P) + bufp->allocated)
++#   define MOVE_BUFFER_POINTER(P) \
++  (__ptrlow (P) += incr, SET_HIGH_BOUND (P), __ptrvalue (P) += incr)
++#   define ELSE_EXTEND_BUFFER_HIGH_BOUND	\
++  else						\
++    {						\
++      SET_HIGH_BOUND (b);			\
++      SET_HIGH_BOUND (begalt);			\
++      if (fixup_alt_jump)			\
++	SET_HIGH_BOUND (fixup_alt_jump);	\
++      if (laststart)				\
++	SET_HIGH_BOUND (laststart);		\
++      if (pending_exact)			\
++	SET_HIGH_BOUND (pending_exact);		\
++    }
++#  else
++#   define MOVE_BUFFER_POINTER(P) (P) += incr
++#   define ELSE_EXTEND_BUFFER_HIGH_BOUND
++#  endif
++# endif /* not DEFINED_ONCE */
++
++# ifdef WCHAR
++#  define EXTEND_BUFFER()						\
++  do {									\
++    UCHAR_T *old_buffer = COMPILED_BUFFER_VAR;				\
++    int wchar_count;							\
++    if (bufp->allocated + sizeof(UCHAR_T) > MAX_BUF_SIZE)		\
++      return REG_ESIZE;							\
++    bufp->allocated <<= 1;						\
++    if (bufp->allocated > MAX_BUF_SIZE)					\
++      bufp->allocated = MAX_BUF_SIZE;					\
++    /* How many characters the new buffer can have?  */			\
++    wchar_count = bufp->allocated / sizeof(UCHAR_T);			\
++    if (wchar_count == 0) wchar_count = 1;				\
++    /* Truncate the buffer to CHAR_T align.  */			\
++    bufp->allocated = wchar_count * sizeof(UCHAR_T);			\
++    RETALLOC (COMPILED_BUFFER_VAR, wchar_count, UCHAR_T);		\
++    bufp->buffer = (char*)COMPILED_BUFFER_VAR;				\
++    if (COMPILED_BUFFER_VAR == NULL)					\
++      return REG_ESPACE;						\
++    /* If the buffer moved, move all the pointers into it.  */		\
++    if (old_buffer != COMPILED_BUFFER_VAR)				\
++      {									\
++	int incr = COMPILED_BUFFER_VAR - old_buffer;			\
++	MOVE_BUFFER_POINTER (b);					\
++	MOVE_BUFFER_POINTER (begalt);					\
++	if (fixup_alt_jump)						\
++	  MOVE_BUFFER_POINTER (fixup_alt_jump);				\
++	if (laststart)							\
++	  MOVE_BUFFER_POINTER (laststart);				\
++	if (pending_exact)						\
++	  MOVE_BUFFER_POINTER (pending_exact);				\
++      }									\
++    ELSE_EXTEND_BUFFER_HIGH_BOUND					\
++  } while (0)
++# else /* BYTE */
++#  define EXTEND_BUFFER()						\
++  do {									\
++    UCHAR_T *old_buffer = COMPILED_BUFFER_VAR;				\
++    if (bufp->allocated == MAX_BUF_SIZE)				\
++      return REG_ESIZE;							\
++    bufp->allocated <<= 1;						\
++    if (bufp->allocated > MAX_BUF_SIZE)					\
++      bufp->allocated = MAX_BUF_SIZE;					\
++    bufp->buffer = (UCHAR_T *) REALLOC (COMPILED_BUFFER_VAR,		\
++						bufp->allocated);	\
++    if (COMPILED_BUFFER_VAR == NULL)					\
++      return REG_ESPACE;						\
++    /* If the buffer moved, move all the pointers into it.  */		\
++    if (old_buffer != COMPILED_BUFFER_VAR)				\
++      {									\
++	int incr = COMPILED_BUFFER_VAR - old_buffer;			\
++	MOVE_BUFFER_POINTER (b);					\
++	MOVE_BUFFER_POINTER (begalt);					\
++	if (fixup_alt_jump)						\
++	  MOVE_BUFFER_POINTER (fixup_alt_jump);				\
++	if (laststart)							\
++	  MOVE_BUFFER_POINTER (laststart);				\
++	if (pending_exact)						\
++	  MOVE_BUFFER_POINTER (pending_exact);				\
++      }									\
++    ELSE_EXTEND_BUFFER_HIGH_BOUND					\
++  } while (0)
++# endif /* WCHAR */
++
++# ifndef DEFINED_ONCE
++/* Since we have one byte reserved for the register number argument to
++   {start,stop}_memory, the maximum number of groups we can report
++   things about is what fits in that byte.  */
++#  define MAX_REGNUM 255
++
++/* But patterns can have more than `MAX_REGNUM' registers.  We just
++   ignore the excess.  */
++typedef unsigned regnum_t;
++
++
++/* Macros for the compile stack.  */
++
++/* Since offsets can go either forwards or backwards, this type needs to
++   be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1.  */
++/* int may be not enough when sizeof(int) == 2.  */
++typedef long pattern_offset_t;
++
++typedef struct
++{
++  pattern_offset_t begalt_offset;
++  pattern_offset_t fixup_alt_jump;
++  pattern_offset_t inner_group_offset;
++  pattern_offset_t laststart_offset;
++  regnum_t regnum;
++} compile_stack_elt_t;
++
++
++typedef struct
++{
++  compile_stack_elt_t *stack;
++  unsigned size;
++  unsigned avail;			/* Offset of next open position.  */
++} compile_stack_type;
++
++
++#  define INIT_COMPILE_STACK_SIZE 32
++
++#  define COMPILE_STACK_EMPTY  (compile_stack.avail == 0)
++#  define COMPILE_STACK_FULL  (compile_stack.avail == compile_stack.size)
++
++/* The next available element.  */
++#  define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail])
++
++# endif /* not DEFINED_ONCE */
++
++/* Set the bit for character C in a list.  */
++# ifndef DEFINED_ONCE
++#  define SET_LIST_BIT(c)                               \
++  (b[((unsigned char) (c)) / BYTEWIDTH]               \
++   |= 1 << (((unsigned char) c) % BYTEWIDTH))
++# endif /* DEFINED_ONCE */
++
++/* Get the next unsigned number in the uncompiled pattern.  */
++# define GET_UNSIGNED_NUMBER(num) \
++  {									\
++    while (p != pend)							\
++      {									\
++	PATFETCH (c);							\
++	if (c < '0' || c > '9')						\
++	  break;							\
++	if (num <= RE_DUP_MAX)						\
++	  {								\
++	    if (num < 0)						\
++	      num = 0;							\
++	    num = num * 10 + c - '0';					\
++	  }								\
++      }									\
++  }
++
++# ifndef DEFINED_ONCE
++#  if WIDE_CHAR_SUPPORT
++/* The GNU C library provides support for user-defined character classes
++   and the functions from ISO C amendement 1.  */
++#   ifdef CHARCLASS_NAME_MAX
++#    define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX
++#   else
++/* This shouldn't happen but some implementation might still have this
++   problem.  Use a reasonable default value.  */
++#    define CHAR_CLASS_MAX_LENGTH 256
++#   endif
++
++#   ifdef _LIBC
++#    define IS_CHAR_CLASS(string) __wctype (string)
++#   else
++#    define IS_CHAR_CLASS(string) wctype (string)
++#   endif
++#  else
++#   define CHAR_CLASS_MAX_LENGTH  6 /* Namely, `xdigit'.  */
++
++#   define IS_CHAR_CLASS(string)					\
++   (STREQ (string, "alpha") || STREQ (string, "upper")			\
++    || STREQ (string, "lower") || STREQ (string, "digit")		\
++    || STREQ (string, "alnum") || STREQ (string, "xdigit")		\
++    || STREQ (string, "space") || STREQ (string, "print")		\
++    || STREQ (string, "punct") || STREQ (string, "graph")		\
++    || STREQ (string, "cntrl") || STREQ (string, "blank"))
++#  endif
++# endif /* DEFINED_ONCE */
++
++# ifndef MATCH_MAY_ALLOCATE
++
++/* If we cannot allocate large objects within re_match_2_internal,
++   we make the fail stack and register vectors global.
++   The fail stack, we grow to the maximum size when a regexp
++   is compiled.
++   The register vectors, we adjust in size each time we
++   compile a regexp, according to the number of registers it needs.  */
++
++static PREFIX(fail_stack_type) fail_stack;
++
++/* Size with which the following vectors are currently allocated.
++   That is so we can make them bigger as needed,
++   but never make them smaller.  */
++#  ifdef DEFINED_ONCE
++static int regs_allocated_size;
++
++static const char **     regstart, **     regend;
++static const char ** old_regstart, ** old_regend;
++static const char **best_regstart, **best_regend;
++static const char **reg_dummy;
++#  endif /* DEFINED_ONCE */
++
++static PREFIX(register_info_type) *PREFIX(reg_info);
++static PREFIX(register_info_type) *PREFIX(reg_info_dummy);
++
++/* Make the register vectors big enough for NUM_REGS registers,
++   but don't make them smaller.  */
++
++static void
++PREFIX(regex_grow_registers) (int num_regs)
++{
++  if (num_regs > regs_allocated_size)
++    {
++      RETALLOC_IF (regstart,	 num_regs, const char *);
++      RETALLOC_IF (regend,	 num_regs, const char *);
++      RETALLOC_IF (old_regstart, num_regs, const char *);
++      RETALLOC_IF (old_regend,	 num_regs, const char *);
++      RETALLOC_IF (best_regstart, num_regs, const char *);
++      RETALLOC_IF (best_regend,	 num_regs, const char *);
++      RETALLOC_IF (PREFIX(reg_info), num_regs, PREFIX(register_info_type));
++      RETALLOC_IF (reg_dummy,	 num_regs, const char *);
++      RETALLOC_IF (PREFIX(reg_info_dummy), num_regs, PREFIX(register_info_type));
++
++      regs_allocated_size = num_regs;
++    }
++}
++
++# endif /* not MATCH_MAY_ALLOCATE */
++
++# ifndef DEFINED_ONCE
++static boolean group_in_compile_stack (compile_stack_type compile_stack,
++                                       regnum_t regnum);
++# endif /* not DEFINED_ONCE */
++
++/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
++   Returns one of error codes defined in `regex.h', or zero for success.
++
++   Assumes the `allocated' (and perhaps `buffer') and `translate'
++   fields are set in BUFP on entry.
++
++   If it succeeds, results are put in BUFP (if it returns an error, the
++   contents of BUFP are undefined):
++     `buffer' is the compiled pattern;
++     `syntax' is set to SYNTAX;
++     `used' is set to the length of the compiled pattern;
++     `fastmap_accurate' is zero;
++     `re_nsub' is the number of subexpressions in PATTERN;
++     `not_bol' and `not_eol' are zero;
++
++   The `fastmap' and `newline_anchor' fields are neither
++   examined nor set.  */
++
++/* Return, freeing storage we allocated.  */
++# ifdef WCHAR
++#  define FREE_STACK_RETURN(value)		\
++  return (free(pattern), free(mbs_offset), free(is_binary), free (compile_stack.stack), value)
++# else
++#  define FREE_STACK_RETURN(value)		\
++  return (free (compile_stack.stack), value)
++# endif /* WCHAR */
++
++static reg_errcode_t
++PREFIX(regex_compile) (const char *ARG_PREFIX(pattern),
++                       size_t ARG_PREFIX(size), reg_syntax_t syntax,
++                       struct re_pattern_buffer *bufp)
++{
++  /* We fetch characters from PATTERN here.  Even though PATTERN is
++     `char *' (i.e., signed), we declare these variables as unsigned, so
++     they can be reliably used as array indices.  */
++  register UCHAR_T c, c1;
++
++#ifdef WCHAR
++  /* A temporary space to keep wchar_t pattern and compiled pattern.  */
++  CHAR_T *pattern, *COMPILED_BUFFER_VAR;
++  size_t size;
++  /* offset buffer for optimization. See convert_mbs_to_wc.  */
++  int *mbs_offset = NULL;
++  /* It hold whether each wchar_t is binary data or not.  */
++  char *is_binary = NULL;
++  /* A flag whether exactn is handling binary data or not.  */
++  char is_exactn_bin = FALSE;
++#endif /* WCHAR */
++
++  /* A random temporary spot in PATTERN.  */
++  const CHAR_T *p1;
++
++  /* Points to the end of the buffer, where we should append.  */
++  register UCHAR_T *b;
++
++  /* Keeps track of unclosed groups.  */
++  compile_stack_type compile_stack;
++
++  /* Points to the current (ending) position in the pattern.  */
++#ifdef WCHAR
++  const CHAR_T *p;
++  const CHAR_T *pend;
++#else /* BYTE */
++  const CHAR_T *p = pattern;
++  const CHAR_T *pend = pattern + size;
++#endif /* WCHAR */
++
++  /* How to translate the characters in the pattern.  */
++  RE_TRANSLATE_TYPE translate = bufp->translate;
++
++  /* Address of the count-byte of the most recently inserted `exactn'
++     command.  This makes it possible to tell if a new exact-match
++     character can be added to that command or if the character requires
++     a new `exactn' command.  */
++  UCHAR_T *pending_exact = 0;
++
++  /* Address of start of the most recently finished expression.
++     This tells, e.g., postfix * where to find the start of its
++     operand.  Reset at the beginning of groups and alternatives.  */
++  UCHAR_T *laststart = 0;
++
++  /* Address of beginning of regexp, or inside of last group.  */
++  UCHAR_T *begalt;
++
++  /* Address of the place where a forward jump should go to the end of
++     the containing expression.  Each alternative of an `or' -- except the
++     last -- ends with a forward jump of this sort.  */
++  UCHAR_T *fixup_alt_jump = 0;
++
++  /* Counts open-groups as they are encountered.  Remembered for the
++     matching close-group on the compile stack, so the same register
++     number is put in the stop_memory as the start_memory.  */
++  regnum_t regnum = 0;
++
++#ifdef WCHAR
++  /* Initialize the wchar_t PATTERN and offset_buffer.  */
++  p = pend = pattern = TALLOC(csize + 1, CHAR_T);
++  mbs_offset = TALLOC(csize + 1, int);
++  is_binary = TALLOC(csize + 1, char);
++  if (pattern == NULL || mbs_offset == NULL || is_binary == NULL)
++    {
++      free(pattern);
++      free(mbs_offset);
++      free(is_binary);
++      return REG_ESPACE;
++    }
++  pattern[csize] = L'\0';	/* sentinel */
++  size = convert_mbs_to_wcs(pattern, cpattern, csize, mbs_offset, is_binary);
++  pend = p + size;
++  if (size < 0)
++    {
++      free(pattern);
++      free(mbs_offset);
++      free(is_binary);
++      return REG_BADPAT;
++    }
++#endif
++
++#ifdef DEBUG
++  DEBUG_PRINT1 ("\nCompiling pattern: ");
++  if (debug)
++    {
++      unsigned debug_count;
++
++      for (debug_count = 0; debug_count < size; debug_count++)
++        PUT_CHAR (pattern[debug_count]);
++      putchar ('\n');
++    }
++#endif /* DEBUG */
++
++  /* Initialize the compile stack.  */
++  compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
++  if (compile_stack.stack == NULL)
++    {
++#ifdef WCHAR
++      free(pattern);
++      free(mbs_offset);
++      free(is_binary);
++#endif
++      return REG_ESPACE;
++    }
++
++  compile_stack.size = INIT_COMPILE_STACK_SIZE;
++  compile_stack.avail = 0;
++
++  /* Initialize the pattern buffer.  */
++  bufp->syntax = syntax;
++  bufp->fastmap_accurate = 0;
++  bufp->not_bol = bufp->not_eol = 0;
++
++  /* Set `used' to zero, so that if we return an error, the pattern
++     printer (for debugging) will think there's no pattern.  We reset it
++     at the end.  */
++  bufp->used = 0;
++
++  /* Always count groups, whether or not bufp->no_sub is set.  */
++  bufp->re_nsub = 0;
++
++#if !defined emacs && !defined SYNTAX_TABLE
++  /* Initialize the syntax table.  */
++   init_syntax_once ();
++#endif
++
++  if (bufp->allocated == 0)
++    {
++      if (bufp->buffer)
++	{ /* If zero allocated, but buffer is non-null, try to realloc
++             enough space.  This loses if buffer's address is bogus, but
++             that is the user's responsibility.  */
++#ifdef WCHAR
++	  /* Free bufp->buffer and allocate an array for wchar_t pattern
++	     buffer.  */
++          free(bufp->buffer);
++          COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE/sizeof(UCHAR_T),
++					UCHAR_T);
++#else
++          RETALLOC (COMPILED_BUFFER_VAR, INIT_BUF_SIZE, UCHAR_T);
++#endif /* WCHAR */
++        }
++      else
++        { /* Caller did not allocate a buffer.  Do it for them.  */
++          COMPILED_BUFFER_VAR = TALLOC (INIT_BUF_SIZE / sizeof(UCHAR_T),
++					UCHAR_T);
++        }
++
++      if (!COMPILED_BUFFER_VAR) FREE_STACK_RETURN (REG_ESPACE);
++#ifdef WCHAR
++      bufp->buffer = (char*)COMPILED_BUFFER_VAR;
++#endif /* WCHAR */
++      bufp->allocated = INIT_BUF_SIZE;
++    }
++#ifdef WCHAR
++  else
++    COMPILED_BUFFER_VAR = (UCHAR_T*) bufp->buffer;
++#endif
++
++  begalt = b = COMPILED_BUFFER_VAR;
++
++  /* Loop through the uncompiled pattern until we're at the end.  */
++  while (p != pend)
++    {
++      PATFETCH (c);
++
++      switch (c)
++        {
++        case '^':
++          {
++            if (   /* If at start of pattern, it's an operator.  */
++                   p == pattern + 1
++                   /* If context independent, it's an operator.  */
++                || syntax & RE_CONTEXT_INDEP_ANCHORS
++                   /* Otherwise, depends on what's come before.  */
++                || PREFIX(at_begline_loc_p) (pattern, p, syntax))
++              BUF_PUSH (begline);
++            else
++              goto normal_char;
++          }
++          break;
++
++
++        case '$':
++          {
++            if (   /* If at end of pattern, it's an operator.  */
++                   p == pend
++                   /* If context independent, it's an operator.  */
++                || syntax & RE_CONTEXT_INDEP_ANCHORS
++                   /* Otherwise, depends on what's next.  */
++                || PREFIX(at_endline_loc_p) (p, pend, syntax))
++               BUF_PUSH (endline);
++             else
++               goto normal_char;
++           }
++           break;
++
++
++	case '+':
++        case '?':
++          if ((syntax & RE_BK_PLUS_QM)
++              || (syntax & RE_LIMITED_OPS))
++            goto normal_char;
++        handle_plus:
++        case '*':
++          /* If there is no previous pattern... */
++          if (!laststart)
++            {
++              if (syntax & RE_CONTEXT_INVALID_OPS)
++                FREE_STACK_RETURN (REG_BADRPT);
++              else if (!(syntax & RE_CONTEXT_INDEP_OPS))
++                goto normal_char;
++            }
++
++          {
++            /* Are we optimizing this jump?  */
++            boolean keep_string_p = false;
++
++            /* 1 means zero (many) matches is allowed.  */
++            char zero_times_ok = 0, many_times_ok = 0;
++
++            /* If there is a sequence of repetition chars, collapse it
++               down to just one (the right one).  We can't combine
++               interval operators with these because of, e.g., `a{2}*',
++               which should only match an even number of `a's.  */
++
++            for (;;)
++              {
++                zero_times_ok |= c != '+';
++                many_times_ok |= c != '?';
++
++                if (p == pend)
++                  break;
++
++                PATFETCH (c);
++
++                if (c == '*'
++                    || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')))
++                  ;
++
++                else if (syntax & RE_BK_PLUS_QM  &&  c == '\\')
++                  {
++                    if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
++
++                    PATFETCH (c1);
++                    if (!(c1 == '+' || c1 == '?'))
++                      {
++                        PATUNFETCH;
++                        PATUNFETCH;
++                        break;
++                      }
++
++                    c = c1;
++                  }
++                else
++                  {
++                    PATUNFETCH;
++                    break;
++                  }
++
++                /* If we get here, we found another repeat character.  */
++               }
++
++            /* Star, etc. applied to an empty pattern is equivalent
++               to an empty pattern.  */
++            if (!laststart)
++              break;
++
++            /* Now we know whether or not zero matches is allowed
++               and also whether or not two or more matches is allowed.  */
++            if (many_times_ok)
++              { /* More than one repetition is allowed, so put in at the
++                   end a backward relative jump from `b' to before the next
++                   jump we're going to put in below (which jumps from
++                   laststart to after this jump).
++
++                   But if we are at the `*' in the exact sequence `.*\n',
++                   insert an unconditional jump backwards to the .,
++                   instead of the beginning of the loop.  This way we only
++                   push a failure point once, instead of every time
++                   through the loop.  */
++                assert (p - 1 > pattern);
++
++                /* Allocate the space for the jump.  */
++                GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
++
++                /* We know we are not at the first character of the pattern,
++                   because laststart was nonzero.  And we've already
++                   incremented `p', by the way, to be the character after
++                   the `*'.  Do we have to do something analogous here
++                   for null bytes, because of RE_DOT_NOT_NULL?  */
++                if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
++		    && zero_times_ok
++                    && p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
++                    && !(syntax & RE_DOT_NEWLINE))
++                  { /* We have .*\n.  */
++                    STORE_JUMP (jump, b, laststart);
++                    keep_string_p = true;
++                  }
++                else
++                  /* Anything else.  */
++                  STORE_JUMP (maybe_pop_jump, b, laststart -
++			      (1 + OFFSET_ADDRESS_SIZE));
++
++                /* We've added more stuff to the buffer.  */
++                b += 1 + OFFSET_ADDRESS_SIZE;
++              }
++
++            /* On failure, jump from laststart to b + 3, which will be the
++               end of the buffer after this jump is inserted.  */
++	    /* ifdef WCHAR, 'b + 1 + OFFSET_ADDRESS_SIZE' instead of
++	       'b + 3'.  */
++            GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
++            INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump
++                                       : on_failure_jump,
++                         laststart, b + 1 + OFFSET_ADDRESS_SIZE);
++            pending_exact = 0;
++            b += 1 + OFFSET_ADDRESS_SIZE;
++
++            if (!zero_times_ok)
++              {
++                /* At least one repetition is required, so insert a
++                   `dummy_failure_jump' before the initial
++                   `on_failure_jump' instruction of the loop. This
++                   effects a skip over that instruction the first time
++                   we hit that loop.  */
++                GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
++                INSERT_JUMP (dummy_failure_jump, laststart, laststart +
++			     2 + 2 * OFFSET_ADDRESS_SIZE);
++                b += 1 + OFFSET_ADDRESS_SIZE;
++              }
++            }
++	  break;
++
++
++	case '.':
++          laststart = b;
++          BUF_PUSH (anychar);
++          break;
++
++
++        case '[':
++          {
++            boolean had_char_class = false;
++#ifdef WCHAR
++	    CHAR_T range_start = 0xffffffff;
++#else
++	    unsigned int range_start = 0xffffffff;
++#endif
++            if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++#ifdef WCHAR
++	    /* We assume a charset(_not) structure as a wchar_t array.
++	       charset[0] = (re_opcode_t) charset(_not)
++               charset[1] = l (= length of char_classes)
++               charset[2] = m (= length of collating_symbols)
++               charset[3] = n (= length of equivalence_classes)
++	       charset[4] = o (= length of char_ranges)
++	       charset[5] = p (= length of chars)
++
++               charset[6] = char_class (wctype_t)
++               charset[6+CHAR_CLASS_SIZE] = char_class (wctype_t)
++                         ...
++               charset[l+5]  = char_class (wctype_t)
++
++               charset[l+6]  = collating_symbol (wchar_t)
++                            ...
++               charset[l+m+5]  = collating_symbol (wchar_t)
++					ifdef _LIBC we use the index if
++					_NL_COLLATE_SYMB_EXTRAMB instead of
++					wchar_t string.
++
++               charset[l+m+6]  = equivalence_classes (wchar_t)
++                              ...
++               charset[l+m+n+5]  = equivalence_classes (wchar_t)
++					ifdef _LIBC we use the index in
++					_NL_COLLATE_WEIGHT instead of
++					wchar_t string.
++
++	       charset[l+m+n+6] = range_start
++	       charset[l+m+n+7] = range_end
++	                       ...
++	       charset[l+m+n+2o+4] = range_start
++	       charset[l+m+n+2o+5] = range_end
++					ifdef _LIBC we use the value looked up
++					in _NL_COLLATE_COLLSEQ instead of
++					wchar_t character.
++
++	       charset[l+m+n+2o+6] = char
++	                          ...
++	       charset[l+m+n+2o+p+5] = char
++
++	     */
++
++	    /* We need at least 6 spaces: the opcode, the length of
++               char_classes, the length of collating_symbols, the length of
++               equivalence_classes, the length of char_ranges, the length of
++               chars.  */
++	    GET_BUFFER_SPACE (6);
++
++	    /* Save b as laststart. And We use laststart as the pointer
++	       to the first element of the charset here.
++	       In other words, laststart[i] indicates charset[i].  */
++            laststart = b;
++
++            /* We test `*p == '^' twice, instead of using an if
++               statement, so we only need one BUF_PUSH.  */
++            BUF_PUSH (*p == '^' ? charset_not : charset);
++            if (*p == '^')
++              p++;
++
++            /* Push the length of char_classes, the length of
++               collating_symbols, the length of equivalence_classes, the
++               length of char_ranges and the length of chars.  */
++            BUF_PUSH_3 (0, 0, 0);
++            BUF_PUSH_2 (0, 0);
++
++            /* Remember the first position in the bracket expression.  */
++            p1 = p;
++
++            /* charset_not matches newline according to a syntax bit.  */
++            if ((re_opcode_t) b[-6] == charset_not
++                && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
++	      {
++		BUF_PUSH('\n');
++		laststart[5]++; /* Update the length of characters  */
++	      }
++
++            /* Read in characters and ranges, setting map bits.  */
++            for (;;)
++              {
++                if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++                PATFETCH (c);
++
++                /* \ might escape characters inside [...] and [^...].  */
++                if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
++                  {
++                    if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
++
++                    PATFETCH (c1);
++		    BUF_PUSH(c1);
++		    laststart[5]++; /* Update the length of chars  */
++		    range_start = c1;
++                    continue;
++                  }
++
++                /* Could be the end of the bracket expression.  If it's
++                   not (i.e., when the bracket expression is `[]' so
++                   far), the ']' character bit gets set way below.  */
++                if (c == ']' && p != p1 + 1)
++                  break;
++
++                /* Look ahead to see if it's a range when the last thing
++                   was a character class.  */
++                if (had_char_class && c == '-' && *p != ']')
++                  FREE_STACK_RETURN (REG_ERANGE);
++
++                /* Look ahead to see if it's a range when the last thing
++                   was a character: if this is a hyphen not at the
++                   beginning or the end of a list, then it's the range
++                   operator.  */
++                if (c == '-'
++                    && !(p - 2 >= pattern && p[-2] == '[')
++                    && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
++                    && *p != ']')
++                  {
++                    reg_errcode_t ret;
++		    /* Allocate the space for range_start and range_end.  */
++		    GET_BUFFER_SPACE (2);
++		    /* Update the pointer to indicate end of buffer.  */
++                    b += 2;
++                    ret = wcs_compile_range (range_start, &p, pend, translate,
++                                         syntax, b, laststart);
++                    if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
++                    range_start = 0xffffffff;
++                  }
++                else if (p[0] == '-' && p[1] != ']')
++                  { /* This handles ranges made up of characters only.  */
++                    reg_errcode_t ret;
++
++		    /* Move past the `-'.  */
++                    PATFETCH (c1);
++		    /* Allocate the space for range_start and range_end.  */
++		    GET_BUFFER_SPACE (2);
++		    /* Update the pointer to indicate end of buffer.  */
++                    b += 2;
++                    ret = wcs_compile_range (c, &p, pend, translate, syntax, b,
++                                         laststart);
++                    if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
++		    range_start = 0xffffffff;
++                  }
++
++                /* See if we're at the beginning of a possible character
++                   class.  */
++                else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
++                  { /* Leave room for the null.  */
++                    char str[CHAR_CLASS_MAX_LENGTH + 1];
++
++                    PATFETCH (c);
++                    c1 = 0;
++
++                    /* If pattern is `[[:'.  */
++                    if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++                    for (;;)
++                      {
++                        PATFETCH (c);
++                        if ((c == ':' && *p == ']') || p == pend)
++                          break;
++			if (c1 < CHAR_CLASS_MAX_LENGTH)
++			  str[c1++] = c;
++			else
++			  /* This is in any case an invalid class name.  */
++			  str[0] = '\0';
++                      }
++                    str[c1] = '\0';
++
++                    /* If isn't a word bracketed by `[:' and `:]':
++                       undo the ending character, the letters, and leave
++                       the leading `:' and `[' (but store them as character).  */
++                    if (c == ':' && *p == ']')
++                      {
++			wctype_t wt;
++			uintptr_t alignedp;
++
++			/* Query the character class as wctype_t.  */
++			wt = IS_CHAR_CLASS (str);
++			if (wt == 0)
++			  FREE_STACK_RETURN (REG_ECTYPE);
++
++                        /* Throw away the ] at the end of the character
++                           class.  */
++                        PATFETCH (c);
++
++                        if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++			/* Allocate the space for character class.  */
++                        GET_BUFFER_SPACE(CHAR_CLASS_SIZE);
++			/* Update the pointer to indicate end of buffer.  */
++                        b += CHAR_CLASS_SIZE;
++			/* Move data which follow character classes
++			    not to violate the data.  */
++                        insert_space(CHAR_CLASS_SIZE,
++				     laststart + 6 + laststart[1],
++				     b - 1);
++			alignedp = ((uintptr_t)(laststart + 6 + laststart[1])
++				    + __alignof__(wctype_t) - 1)
++			  	    & ~(uintptr_t)(__alignof__(wctype_t) - 1);
++			/* Store the character class.  */
++                        *((wctype_t*)alignedp) = wt;
++                        /* Update length of char_classes */
++                        laststart[1] += CHAR_CLASS_SIZE;
++
++                        had_char_class = true;
++                      }
++                    else
++                      {
++                        c1++;
++                        while (c1--)
++                          PATUNFETCH;
++                        BUF_PUSH ('[');
++                        BUF_PUSH (':');
++                        laststart[5] += 2; /* Update the length of characters  */
++			range_start = ':';
++                        had_char_class = false;
++                      }
++                  }
++                else if (syntax & RE_CHAR_CLASSES && c == '[' && (*p == '='
++							  || *p == '.'))
++		  {
++		    CHAR_T str[128];	/* Should be large enough.  */
++		    CHAR_T delim = *p; /* '=' or '.'  */
++# ifdef _LIBC
++		    uint32_t nrules =
++		      _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
++# endif
++		    PATFETCH (c);
++		    c1 = 0;
++
++		    /* If pattern is `[[=' or '[[.'.  */
++		    if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++		    for (;;)
++		      {
++			PATFETCH (c);
++			if ((c == delim && *p == ']') || p == pend)
++			  break;
++			if (c1 < sizeof (str) - 1)
++			  str[c1++] = c;
++			else
++			  /* This is in any case an invalid class name.  */
++			  str[0] = '\0';
++                      }
++		    str[c1] = '\0';
++
++		    if (c == delim && *p == ']' && str[0] != '\0')
++		      {
++                        unsigned int i, offset;
++			/* If we have no collation data we use the default
++			   collation in which each character is in a class
++			   by itself.  It also means that ASCII is the
++			   character set and therefore we cannot have character
++			   with more than one byte in the multibyte
++			   representation.  */
++
++                        /* If not defined _LIBC, we push the name and
++			   `\0' for the sake of matching performance.  */
++			int datasize = c1 + 1;
++
++# ifdef _LIBC
++			int32_t idx = 0;
++			if (nrules == 0)
++# endif
++			  {
++			    if (c1 != 1)
++			      FREE_STACK_RETURN (REG_ECOLLATE);
++			  }
++# ifdef _LIBC
++			else
++			  {
++			    const int32_t *table;
++			    const int32_t *weights;
++			    const int32_t *extra;
++			    const int32_t *indirect;
++			    wint_t *cp;
++
++			    if(delim == '=')
++			      {
++				/* We push the index for equivalence class.  */
++				cp = (wint_t*)str;
++
++				table = (const int32_t *)
++				  _NL_CURRENT (LC_COLLATE,
++					       _NL_COLLATE_TABLEWC);
++				weights = (const int32_t *)
++				  _NL_CURRENT (LC_COLLATE,
++					       _NL_COLLATE_WEIGHTWC);
++				extra = (const wint_t *)
++				  _NL_CURRENT (LC_COLLATE,
++					       _NL_COLLATE_EXTRAWC);
++				indirect = (const int32_t *)
++				  _NL_CURRENT (LC_COLLATE,
++					       _NL_COLLATE_INDIRECTWC);
++
++				idx = FINDIDX (table, indirect, extra, &cp, 1);
++				if (idx == 0 || cp < (wint_t*) str + c1)
++				  /* This is no valid character.  */
++				  FREE_STACK_RETURN (REG_ECOLLATE);
++
++				str[0] = (wchar_t)idx;
++			      }
++			    else /* delim == '.' */
++			      {
++				/* We push collation sequence value
++				   for collating symbol.  */
++				int32_t table_size;
++				const int32_t *symb_table;
++				const unsigned char *extra;
++				int32_t idx;
++				int32_t elem;
++				int32_t second;
++				int32_t hash;
++				char char_str[c1];
++
++				/* We have to convert the name to a single-byte
++				   string.  This is possible since the names
++				   consist of ASCII characters and the internal
++				   representation is UCS4.  */
++				for (i = 0; i < c1; ++i)
++				  char_str[i] = str[i];
++
++				table_size =
++				  _NL_CURRENT_WORD (LC_COLLATE,
++						    _NL_COLLATE_SYMB_HASH_SIZEMB);
++				symb_table = (const int32_t *)
++				  _NL_CURRENT (LC_COLLATE,
++					       _NL_COLLATE_SYMB_TABLEMB);
++				extra = (const unsigned char *)
++				  _NL_CURRENT (LC_COLLATE,
++					       _NL_COLLATE_SYMB_EXTRAMB);
++
++				/* Locate the character in the hashing table.  */
++				hash = elem_hash (char_str, c1);
++
++				idx = 0;
++				elem = hash % table_size;
++				second = hash % (table_size - 2);
++				while (symb_table[2 * elem] != 0)
++				  {
++				    /* First compare the hashing value.  */
++				    if (symb_table[2 * elem] == hash
++					&& c1 == extra[symb_table[2 * elem + 1]]
++					&& memcmp (char_str,
++						   &extra[symb_table[2 * elem + 1]
++							 + 1], c1) == 0)
++				      {
++					/* Yep, this is the entry.  */
++					idx = symb_table[2 * elem + 1];
++					idx += 1 + extra[idx];
++					break;
++				      }
++
++				    /* Next entry.  */
++				    elem += second;
++				  }
++
++				if (symb_table[2 * elem] != 0)
++				  {
++				    /* Compute the index of the byte sequence
++				       in the table.  */
++				    idx += 1 + extra[idx];
++				    /* Adjust for the alignment.  */
++				    idx = (idx + 3) & ~3;
++
++				    str[0] = (wchar_t) idx + 4;
++				  }
++				else if (symb_table[2 * elem] == 0 && c1 == 1)
++				  {
++				    /* No valid character.  Match it as a
++				       single byte character.  */
++				    had_char_class = false;
++				    BUF_PUSH(str[0]);
++				    /* Update the length of characters  */
++				    laststart[5]++;
++				    range_start = str[0];
++
++				    /* Throw away the ] at the end of the
++				       collating symbol.  */
++				    PATFETCH (c);
++				    /* exit from the switch block.  */
++				    continue;
++				  }
++				else
++				  FREE_STACK_RETURN (REG_ECOLLATE);
++			      }
++			    datasize = 1;
++			  }
++# endif
++                        /* Throw away the ] at the end of the equivalence
++                           class (or collating symbol).  */
++                        PATFETCH (c);
++
++			/* Allocate the space for the equivalence class
++			   (or collating symbol) (and '\0' if needed).  */
++                        GET_BUFFER_SPACE(datasize);
++			/* Update the pointer to indicate end of buffer.  */
++                        b += datasize;
++
++			if (delim == '=')
++			  { /* equivalence class  */
++			    /* Calculate the offset of char_ranges,
++			       which is next to equivalence_classes.  */
++			    offset = laststart[1] + laststart[2]
++			      + laststart[3] +6;
++			    /* Insert space.  */
++			    insert_space(datasize, laststart + offset, b - 1);
++
++			    /* Write the equivalence_class and \0.  */
++			    for (i = 0 ; i < datasize ; i++)
++			      laststart[offset + i] = str[i];
++
++			    /* Update the length of equivalence_classes.  */
++			    laststart[3] += datasize;
++			    had_char_class = true;
++			  }
++			else /* delim == '.' */
++			  { /* collating symbol  */
++			    /* Calculate the offset of the equivalence_classes,
++			       which is next to collating_symbols.  */
++			    offset = laststart[1] + laststart[2] + 6;
++			    /* Insert space and write the collationg_symbol
++			       and \0.  */
++			    insert_space(datasize, laststart + offset, b-1);
++			    for (i = 0 ; i < datasize ; i++)
++			      laststart[offset + i] = str[i];
++
++			    /* In re_match_2_internal if range_start < -1, we
++			       assume -range_start is the offset of the
++			       collating symbol which is specified as
++			       the character of the range start.  So we assign
++			       -(laststart[1] + laststart[2] + 6) to
++			       range_start.  */
++			    range_start = -(laststart[1] + laststart[2] + 6);
++			    /* Update the length of collating_symbol.  */
++			    laststart[2] += datasize;
++			    had_char_class = false;
++			  }
++		      }
++                    else
++                      {
++                        c1++;
++                        while (c1--)
++                          PATUNFETCH;
++                        BUF_PUSH ('[');
++                        BUF_PUSH (delim);
++                        laststart[5] += 2; /* Update the length of characters  */
++			range_start = delim;
++                        had_char_class = false;
++                      }
++		  }
++                else
++                  {
++                    had_char_class = false;
++		    BUF_PUSH(c);
++		    laststart[5]++;  /* Update the length of characters  */
++		    range_start = c;
++                  }
++	      }
++
++#else /* BYTE */
++            /* Ensure that we have enough space to push a charset: the
++               opcode, the length count, and the bitset; 34 bytes in all.  */
++	    GET_BUFFER_SPACE (34);
++
++            laststart = b;
++
++            /* We test `*p == '^' twice, instead of using an if
++               statement, so we only need one BUF_PUSH.  */
++            BUF_PUSH (*p == '^' ? charset_not : charset);
++            if (*p == '^')
++              p++;
++
++            /* Remember the first position in the bracket expression.  */
++            p1 = p;
++
++            /* Push the number of bytes in the bitmap.  */
++            BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
++
++            /* Clear the whole map.  */
++            bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
++
++            /* charset_not matches newline according to a syntax bit.  */
++            if ((re_opcode_t) b[-2] == charset_not
++                && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
++              SET_LIST_BIT ('\n');
++
++            /* Read in characters and ranges, setting map bits.  */
++            for (;;)
++              {
++                if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++                PATFETCH (c);
++
++                /* \ might escape characters inside [...] and [^...].  */
++                if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
++                  {
++                    if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
++
++                    PATFETCH (c1);
++                    SET_LIST_BIT (c1);
++		    range_start = c1;
++                    continue;
++                  }
++
++                /* Could be the end of the bracket expression.  If it's
++                   not (i.e., when the bracket expression is `[]' so
++                   far), the ']' character bit gets set way below.  */
++                if (c == ']' && p != p1 + 1)
++                  break;
++
++                /* Look ahead to see if it's a range when the last thing
++                   was a character class.  */
++                if (had_char_class && c == '-' && *p != ']')
++                  FREE_STACK_RETURN (REG_ERANGE);
++
++                /* Look ahead to see if it's a range when the last thing
++                   was a character: if this is a hyphen not at the
++                   beginning or the end of a list, then it's the range
++                   operator.  */
++                if (c == '-'
++                    && !(p - 2 >= pattern && p[-2] == '[')
++                    && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
++                    && *p != ']')
++                  {
++                    reg_errcode_t ret
++                      = byte_compile_range (range_start, &p, pend, translate,
++					    syntax, b);
++                    if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
++		    range_start = 0xffffffff;
++                  }
++
++                else if (p[0] == '-' && p[1] != ']')
++                  { /* This handles ranges made up of characters only.  */
++                    reg_errcode_t ret;
++
++		    /* Move past the `-'.  */
++                    PATFETCH (c1);
++
++                    ret = byte_compile_range (c, &p, pend, translate, syntax, b);
++                    if (ret != REG_NOERROR) FREE_STACK_RETURN (ret);
++		    range_start = 0xffffffff;
++                  }
++
++                /* See if we're at the beginning of a possible character
++                   class.  */
++
++                else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
++                  { /* Leave room for the null.  */
++                    char str[CHAR_CLASS_MAX_LENGTH + 1];
++
++                    PATFETCH (c);
++                    c1 = 0;
++
++                    /* If pattern is `[[:'.  */
++                    if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++                    for (;;)
++                      {
++                        PATFETCH (c);
++                        if ((c == ':' && *p == ']') || p == pend)
++                          break;
++			if (((int) c1) < CHAR_CLASS_MAX_LENGTH)
++			  str[c1++] = c;
++			else
++			  /* This is in any case an invalid class name.  */
++			  str[0] = '\0';
++                      }
++                    str[c1] = '\0';
++
++                    /* If isn't a word bracketed by `[:' and `:]':
++                       undo the ending character, the letters, and leave
++                       the leading `:' and `[' (but set bits for them).  */
++                    if (c == ':' && *p == ']')
++                      {
++# if WIDE_CHAR_SUPPORT
++                        boolean is_lower = STREQ (str, "lower");
++                        boolean is_upper = STREQ (str, "upper");
++			wctype_t wt;
++                        int ch;
++
++			wt = IS_CHAR_CLASS (str);
++			if (wt == 0)
++			  FREE_STACK_RETURN (REG_ECTYPE);
++
++                        /* Throw away the ] at the end of the character
++                           class.  */
++                        PATFETCH (c);
++
++                        if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++                        for (ch = 0; ch < 1 << BYTEWIDTH; ++ch)
++			  {
++#  ifdef _LIBC
++			    if (__iswctype (__btowc (ch), wt))
++			      SET_LIST_BIT (ch);
++#  else
++			    if (iswctype (btowc (ch), wt))
++			      SET_LIST_BIT (ch);
++#  endif
++
++			    if (translate && (is_upper || is_lower)
++				&& (ISUPPER (ch) || ISLOWER (ch)))
++			      SET_LIST_BIT (ch);
++			  }
++
++                        had_char_class = true;
++# else
++                        int ch;
++                        boolean is_alnum = STREQ (str, "alnum");
++                        boolean is_alpha = STREQ (str, "alpha");
++                        boolean is_blank = STREQ (str, "blank");
++                        boolean is_cntrl = STREQ (str, "cntrl");
++                        boolean is_digit = STREQ (str, "digit");
++                        boolean is_graph = STREQ (str, "graph");
++                        boolean is_lower = STREQ (str, "lower");
++                        boolean is_print = STREQ (str, "print");
++                        boolean is_punct = STREQ (str, "punct");
++                        boolean is_space = STREQ (str, "space");
++                        boolean is_upper = STREQ (str, "upper");
++                        boolean is_xdigit = STREQ (str, "xdigit");
++
++                        if (!IS_CHAR_CLASS (str))
++			  FREE_STACK_RETURN (REG_ECTYPE);
++
++                        /* Throw away the ] at the end of the character
++                           class.  */
++                        PATFETCH (c);
++
++                        if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++                        for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
++                          {
++			    /* This was split into 3 if's to
++			       avoid an arbitrary limit in some compiler.  */
++                            if (   (is_alnum  && ISALNUM (ch))
++                                || (is_alpha  && ISALPHA (ch))
++                                || (is_blank  && ISBLANK (ch))
++                                || (is_cntrl  && ISCNTRL (ch)))
++			      SET_LIST_BIT (ch);
++			    if (   (is_digit  && ISDIGIT (ch))
++                                || (is_graph  && ISGRAPH (ch))
++                                || (is_lower  && ISLOWER (ch))
++                                || (is_print  && ISPRINT (ch)))
++			      SET_LIST_BIT (ch);
++			    if (   (is_punct  && ISPUNCT (ch))
++                                || (is_space  && ISSPACE (ch))
++                                || (is_upper  && ISUPPER (ch))
++                                || (is_xdigit && ISXDIGIT (ch)))
++			      SET_LIST_BIT (ch);
++			    if (   translate && (is_upper || is_lower)
++				&& (ISUPPER (ch) || ISLOWER (ch)))
++			      SET_LIST_BIT (ch);
++                          }
++                        had_char_class = true;
++# endif	/* libc || wctype.h */
++                      }
++                    else
++                      {
++                        c1++;
++                        while (c1--)
++                          PATUNFETCH;
++                        SET_LIST_BIT ('[');
++                        SET_LIST_BIT (':');
++			range_start = ':';
++                        had_char_class = false;
++                      }
++                  }
++                else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '=')
++		  {
++		    unsigned char str[MB_LEN_MAX + 1];
++# ifdef _LIBC
++		    uint32_t nrules =
++		      _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
++# endif
++
++		    PATFETCH (c);
++		    c1 = 0;
++
++		    /* If pattern is `[[='.  */
++		    if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++		    for (;;)
++		      {
++			PATFETCH (c);
++			if ((c == '=' && *p == ']') || p == pend)
++			  break;
++			if (c1 < MB_LEN_MAX)
++			  str[c1++] = c;
++			else
++			  /* This is in any case an invalid class name.  */
++			  str[0] = '\0';
++                      }
++		    str[c1] = '\0';
++
++		    if (c == '=' && *p == ']' && str[0] != '\0')
++		      {
++			/* If we have no collation data we use the default
++			   collation in which each character is in a class
++			   by itself.  It also means that ASCII is the
++			   character set and therefore we cannot have character
++			   with more than one byte in the multibyte
++			   representation.  */
++# ifdef _LIBC
++			if (nrules == 0)
++# endif
++			  {
++			    if (c1 != 1)
++			      FREE_STACK_RETURN (REG_ECOLLATE);
++
++			    /* Throw away the ] at the end of the equivalence
++			       class.  */
++			    PATFETCH (c);
++
++			    /* Set the bit for the character.  */
++			    SET_LIST_BIT (str[0]);
++			  }
++# ifdef _LIBC
++			else
++			  {
++			    /* Try to match the byte sequence in `str' against
++			       those known to the collate implementation.
++			       First find out whether the bytes in `str' are
++			       actually from exactly one character.  */
++			    const int32_t *table;
++			    const unsigned char *weights;
++			    const unsigned char *extra;
++			    const int32_t *indirect;
++			    int32_t idx;
++			    const unsigned char *cp = str;
++			    int ch;
++
++			    table = (const int32_t *)
++			      _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEMB);
++			    weights = (const unsigned char *)
++			      _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTMB);
++			    extra = (const unsigned char *)
++			      _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAMB);
++			    indirect = (const int32_t *)
++			      _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
++			    idx = FINDIDX (table, indirect, extra, &cp, 1);
++			    if (idx == 0 || cp < str + c1)
++			      /* This is no valid character.  */
++			      FREE_STACK_RETURN (REG_ECOLLATE);
++
++			    /* Throw away the ] at the end of the equivalence
++			       class.  */
++			    PATFETCH (c);
++
++			    /* Now we have to go throught the whole table
++			       and find all characters which have the same
++			       first level weight.
++
++			       XXX Note that this is not entirely correct.
++			       we would have to match multibyte sequences
++			       but this is not possible with the current
++			       implementation.  */
++			    for (ch = 1; ch < 256; ++ch)
++			      /* XXX This test would have to be changed if we
++				 would allow matching multibyte sequences.  */
++			      if (table[ch] > 0)
++				{
++				  int32_t idx2 = table[ch];
++				  size_t len = weights[idx2];
++
++				  /* Test whether the lenghts match.  */
++				  if (weights[idx] == len)
++				    {
++				      /* They do.  New compare the bytes of
++					 the weight.  */
++				      size_t cnt = 0;
++
++				      while (cnt < len
++					     && (weights[idx + 1 + cnt]
++						 == weights[idx2 + 1 + cnt]))
++					++cnt;
++
++				      if (cnt == len)
++					/* They match.  Mark the character as
++					   acceptable.  */
++					SET_LIST_BIT (ch);
++				    }
++				}
++			  }
++# endif
++			had_char_class = true;
++		      }
++                    else
++                      {
++                        c1++;
++                        while (c1--)
++                          PATUNFETCH;
++                        SET_LIST_BIT ('[');
++                        SET_LIST_BIT ('=');
++			range_start = '=';
++                        had_char_class = false;
++                      }
++		  }
++                else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == '.')
++		  {
++		    unsigned char str[128];	/* Should be large enough.  */
++# ifdef _LIBC
++		    uint32_t nrules =
++		      _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
++# endif
++
++		    PATFETCH (c);
++		    c1 = 0;
++
++		    /* If pattern is `[[.'.  */
++		    if (p == pend) FREE_STACK_RETURN (REG_EBRACK);
++
++		    for (;;)
++		      {
++			PATFETCH (c);
++			if ((c == '.' && *p == ']') || p == pend)
++			  break;
++			if (c1 < sizeof (str))
++			  str[c1++] = c;
++			else
++			  /* This is in any case an invalid class name.  */
++			  str[0] = '\0';
++                      }
++		    str[c1] = '\0';
++
++		    if (c == '.' && *p == ']' && str[0] != '\0')
++		      {
++			/* If we have no collation data we use the default
++			   collation in which each character is the name
++			   for its own class which contains only the one
++			   character.  It also means that ASCII is the
++			   character set and therefore we cannot have character
++			   with more than one byte in the multibyte
++			   representation.  */
++# ifdef _LIBC
++			if (nrules == 0)
++# endif
++			  {
++			    if (c1 != 1)
++			      FREE_STACK_RETURN (REG_ECOLLATE);
++
++			    /* Throw away the ] at the end of the equivalence
++			       class.  */
++			    PATFETCH (c);
++
++			    /* Set the bit for the character.  */
++			    SET_LIST_BIT (str[0]);
++			    range_start = ((const unsigned char *) str)[0];
++			  }
++# ifdef _LIBC
++			else
++			  {
++			    /* Try to match the byte sequence in `str' against
++			       those known to the collate implementation.
++			       First find out whether the bytes in `str' are
++			       actually from exactly one character.  */
++			    int32_t table_size;
++			    const int32_t *symb_table;
++			    const unsigned char *extra;
++			    int32_t idx;
++			    int32_t elem;
++			    int32_t second;
++			    int32_t hash;
++
++			    table_size =
++			      _NL_CURRENT_WORD (LC_COLLATE,
++						_NL_COLLATE_SYMB_HASH_SIZEMB);
++			    symb_table = (const int32_t *)
++			      _NL_CURRENT (LC_COLLATE,
++					   _NL_COLLATE_SYMB_TABLEMB);
++			    extra = (const unsigned char *)
++			      _NL_CURRENT (LC_COLLATE,
++					   _NL_COLLATE_SYMB_EXTRAMB);
++
++			    /* Locate the character in the hashing table.  */
++			    hash = elem_hash ((const char *) str, c1);
++
++			    idx = 0;
++			    elem = hash % table_size;
++			    second = hash % (table_size - 2);
++			    while (symb_table[2 * elem] != 0)
++			      {
++				/* First compare the hashing value.  */
++				if (symb_table[2 * elem] == hash
++				    && c1 == extra[symb_table[2 * elem + 1]]
++				    && memcmp (str,
++					       &extra[symb_table[2 * elem + 1]
++						     + 1],
++					       c1) == 0)
++				  {
++				    /* Yep, this is the entry.  */
++				    idx = symb_table[2 * elem + 1];
++				    idx += 1 + extra[idx];
++				    break;
++				  }
++
++				/* Next entry.  */
++				elem += second;
++			      }
++
++			    if (symb_table[2 * elem] == 0)
++			      /* This is no valid character.  */
++			      FREE_STACK_RETURN (REG_ECOLLATE);
++
++			    /* Throw away the ] at the end of the equivalence
++			       class.  */
++			    PATFETCH (c);
++
++			    /* Now add the multibyte character(s) we found
++			       to the accept list.
++
++			       XXX Note that this is not entirely correct.
++			       we would have to match multibyte sequences
++			       but this is not possible with the current
++			       implementation.  Also, we have to match
++			       collating symbols, which expand to more than
++			       one file, as a whole and not allow the
++			       individual bytes.  */
++			    c1 = extra[idx++];
++			    if (c1 == 1)
++			      range_start = extra[idx];
++			    while (c1-- > 0)
++			      {
++				SET_LIST_BIT (extra[idx]);
++				++idx;
++			      }
++			  }
++# endif
++			had_char_class = false;
++		      }
++                    else
++                      {
++                        c1++;
++                        while (c1--)
++                          PATUNFETCH;
++                        SET_LIST_BIT ('[');
++                        SET_LIST_BIT ('.');
++			range_start = '.';
++                        had_char_class = false;
++                      }
++		  }
++                else
++                  {
++                    had_char_class = false;
++                    SET_LIST_BIT (c);
++		    range_start = c;
++                  }
++              }
++
++            /* Discard any (non)matching list bytes that are all 0 at the
++               end of the map.  Decrease the map-length byte too.  */
++            while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
++              b[-1]--;
++            b += b[-1];
++#endif /* WCHAR */
++          }
++          break;
++
++
++	case '(':
++          if (syntax & RE_NO_BK_PARENS)
++            goto handle_open;
++          else
++            goto normal_char;
++
++
++        case ')':
++          if (syntax & RE_NO_BK_PARENS)
++            goto handle_close;
++          else
++            goto normal_char;
++
++
++        case '\n':
++          if (syntax & RE_NEWLINE_ALT)
++            goto handle_alt;
++          else
++            goto normal_char;
++
++
++	case '|':
++          if (syntax & RE_NO_BK_VBAR)
++            goto handle_alt;
++          else
++            goto normal_char;
++
++
++        case '{':
++           if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
++             goto handle_interval;
++           else
++             goto normal_char;
++
++
++        case '\\':
++          if (p == pend) FREE_STACK_RETURN (REG_EESCAPE);
++
++          /* Do not translate the character after the \, so that we can
++             distinguish, e.g., \B from \b, even if we normally would
++             translate, e.g., B to b.  */
++          PATFETCH_RAW (c);
++
++          switch (c)
++            {
++            case '(':
++              if (syntax & RE_NO_BK_PARENS)
++                goto normal_backslash;
++
++            handle_open:
++              bufp->re_nsub++;
++              regnum++;
++
++              if (COMPILE_STACK_FULL)
++                {
++                  RETALLOC (compile_stack.stack, compile_stack.size << 1,
++                            compile_stack_elt_t);
++                  if (compile_stack.stack == NULL) return REG_ESPACE;
++
++                  compile_stack.size <<= 1;
++                }
++
++              /* These are the values to restore when we hit end of this
++                 group.  They are all relative offsets, so that if the
++                 whole pattern moves because of realloc, they will still
++                 be valid.  */
++              COMPILE_STACK_TOP.begalt_offset = begalt - COMPILED_BUFFER_VAR;
++              COMPILE_STACK_TOP.fixup_alt_jump
++                = fixup_alt_jump ? fixup_alt_jump - COMPILED_BUFFER_VAR + 1 : 0;
++              COMPILE_STACK_TOP.laststart_offset = b - COMPILED_BUFFER_VAR;
++              COMPILE_STACK_TOP.regnum = regnum;
++
++              /* We will eventually replace the 0 with the number of
++                 groups inner to this one.  But do not push a
++                 start_memory for groups beyond the last one we can
++                 represent in the compiled pattern.  */
++              if (regnum <= MAX_REGNUM)
++                {
++                  COMPILE_STACK_TOP.inner_group_offset = b
++		    - COMPILED_BUFFER_VAR + 2;
++                  BUF_PUSH_3 (start_memory, regnum, 0);
++                }
++
++              compile_stack.avail++;
++
++              fixup_alt_jump = 0;
++              laststart = 0;
++              begalt = b;
++	      /* If we've reached MAX_REGNUM groups, then this open
++		 won't actually generate any code, so we'll have to
++		 clear pending_exact explicitly.  */
++	      pending_exact = 0;
++              break;
++
++
++            case ')':
++              if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
++
++              if (COMPILE_STACK_EMPTY)
++		{
++		  if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
++		    goto normal_backslash;
++		  else
++		    FREE_STACK_RETURN (REG_ERPAREN);
++		}
++
++            handle_close:
++              if (fixup_alt_jump)
++                { /* Push a dummy failure point at the end of the
++                     alternative for a possible future
++                     `pop_failure_jump' to pop.  See comments at
++                     `push_dummy_failure' in `re_match_2'.  */
++                  BUF_PUSH (push_dummy_failure);
++
++                  /* We allocated space for this jump when we assigned
++                     to `fixup_alt_jump', in the `handle_alt' case below.  */
++                  STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
++                }
++
++              /* See similar code for backslashed left paren above.  */
++              if (COMPILE_STACK_EMPTY)
++		{
++		  if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
++		    goto normal_char;
++		  else
++		    FREE_STACK_RETURN (REG_ERPAREN);
++		}
++
++              /* Since we just checked for an empty stack above, this
++                 ``can't happen''.  */
++              assert (compile_stack.avail != 0);
++              {
++                /* We don't just want to restore into `regnum', because
++                   later groups should continue to be numbered higher,
++                   as in `(ab)c(de)' -- the second group is #2.  */
++                regnum_t this_group_regnum;
++
++                compile_stack.avail--;
++                begalt = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.begalt_offset;
++                fixup_alt_jump
++                  = COMPILE_STACK_TOP.fixup_alt_jump
++                    ? COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.fixup_alt_jump - 1
++                    : 0;
++                laststart = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.laststart_offset;
++                this_group_regnum = COMPILE_STACK_TOP.regnum;
++		/* If we've reached MAX_REGNUM groups, then this open
++		   won't actually generate any code, so we'll have to
++		   clear pending_exact explicitly.  */
++		pending_exact = 0;
++
++                /* We're at the end of the group, so now we know how many
++                   groups were inside this one.  */
++                if (this_group_regnum <= MAX_REGNUM)
++                  {
++		    UCHAR_T *inner_group_loc
++                      = COMPILED_BUFFER_VAR + COMPILE_STACK_TOP.inner_group_offset;
++
++                    *inner_group_loc = regnum - this_group_regnum;
++                    BUF_PUSH_3 (stop_memory, this_group_regnum,
++                                regnum - this_group_regnum);
++                  }
++              }
++              break;
++
++
++            case '|':					/* `\|'.  */
++              if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
++                goto normal_backslash;
++            handle_alt:
++              if (syntax & RE_LIMITED_OPS)
++                goto normal_char;
++
++              /* Insert before the previous alternative a jump which
++                 jumps to this alternative if the former fails.  */
++              GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
++              INSERT_JUMP (on_failure_jump, begalt,
++			   b + 2 + 2 * OFFSET_ADDRESS_SIZE);
++              pending_exact = 0;
++              b += 1 + OFFSET_ADDRESS_SIZE;
++
++              /* The alternative before this one has a jump after it
++                 which gets executed if it gets matched.  Adjust that
++                 jump so it will jump to this alternative's analogous
++                 jump (put in below, which in turn will jump to the next
++                 (if any) alternative's such jump, etc.).  The last such
++                 jump jumps to the correct final destination.  A picture:
++                          _____ _____
++                          |   | |   |
++                          |   v |   v
++                         a | b   | c
++
++                 If we are at `b', then fixup_alt_jump right now points to a
++                 three-byte space after `a'.  We'll put in the jump, set
++                 fixup_alt_jump to right after `b', and leave behind three
++                 bytes which we'll fill in when we get to after `c'.  */
++
++              if (fixup_alt_jump)
++                STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
++
++              /* Mark and leave space for a jump after this alternative,
++                 to be filled in later either by next alternative or
++                 when know we're at the end of a series of alternatives.  */
++              fixup_alt_jump = b;
++              GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
++              b += 1 + OFFSET_ADDRESS_SIZE;
++
++              laststart = 0;
++              begalt = b;
++              break;
++
++
++            case '{':
++              /* If \{ is a literal.  */
++              if (!(syntax & RE_INTERVALS)
++                     /* If we're at `\{' and it's not the open-interval
++                        operator.  */
++		  || (syntax & RE_NO_BK_BRACES))
++                goto normal_backslash;
++
++            handle_interval:
++              {
++                /* If got here, then the syntax allows intervals.  */
++
++                /* At least (most) this many matches must be made.  */
++                int lower_bound = -1, upper_bound = -1;
++
++		/* Place in the uncompiled pattern (i.e., just after
++		   the '{') to go back to if the interval is invalid.  */
++		const CHAR_T *beg_interval = p;
++
++                if (p == pend)
++		  goto invalid_interval;
++
++                GET_UNSIGNED_NUMBER (lower_bound);
++
++                if (c == ',')
++                  {
++                    GET_UNSIGNED_NUMBER (upper_bound);
++		    if (upper_bound < 0)
++		      upper_bound = RE_DUP_MAX;
++                  }
++                else
++                  /* Interval such as `{1}' => match exactly once. */
++                  upper_bound = lower_bound;
++
++                if (! (0 <= lower_bound && lower_bound <= upper_bound))
++		  goto invalid_interval;
++
++                if (!(syntax & RE_NO_BK_BRACES))
++                  {
++		    if (c != '\\' || p == pend)
++		      goto invalid_interval;
++                    PATFETCH (c);
++                  }
++
++                if (c != '}')
++		  goto invalid_interval;
++
++                /* If it's invalid to have no preceding re.  */
++                if (!laststart)
++                  {
++		    if (syntax & RE_CONTEXT_INVALID_OPS
++			&& !(syntax & RE_INVALID_INTERVAL_ORD))
++                      FREE_STACK_RETURN (REG_BADRPT);
++                    else if (syntax & RE_CONTEXT_INDEP_OPS)
++                      laststart = b;
++                    else
++                      goto unfetch_interval;
++                  }
++
++                /* We just parsed a valid interval.  */
++
++                if (RE_DUP_MAX < upper_bound)
++		  FREE_STACK_RETURN (REG_BADBR);
++
++                /* If the upper bound is zero, don't want to succeed at
++                   all; jump from `laststart' to `b + 3', which will be
++		   the end of the buffer after we insert the jump.  */
++		/* ifdef WCHAR, 'b + 1 + OFFSET_ADDRESS_SIZE'
++		   instead of 'b + 3'.  */
++                 if (upper_bound == 0)
++                   {
++                     GET_BUFFER_SPACE (1 + OFFSET_ADDRESS_SIZE);
++                     INSERT_JUMP (jump, laststart, b + 1
++				  + OFFSET_ADDRESS_SIZE);
++                     b += 1 + OFFSET_ADDRESS_SIZE;
++                   }
++
++                 /* Otherwise, we have a nontrivial interval.  When
++                    we're all done, the pattern will look like:
++                      set_number_at <jump count> <upper bound>
++                      set_number_at <succeed_n count> <lower bound>
++                      succeed_n <after jump addr> <succeed_n count>
++                      <body of loop>
++                      jump_n <succeed_n addr> <jump count>
++                    (The upper bound and `jump_n' are omitted if
++                    `upper_bound' is 1, though.)  */
++                 else
++                   { /* If the upper bound is > 1, we need to insert
++                        more at the end of the loop.  */
++                     unsigned nbytes = 2 + 4 * OFFSET_ADDRESS_SIZE +
++		       (upper_bound > 1) * (2 + 4 * OFFSET_ADDRESS_SIZE);
++
++                     GET_BUFFER_SPACE (nbytes);
++
++                     /* Initialize lower bound of the `succeed_n', even
++                        though it will be set during matching by its
++                        attendant `set_number_at' (inserted next),
++                        because `re_compile_fastmap' needs to know.
++                        Jump to the `jump_n' we might insert below.  */
++                     INSERT_JUMP2 (succeed_n, laststart,
++                                   b + 1 + 2 * OFFSET_ADDRESS_SIZE
++				   + (upper_bound > 1) * (1 + 2 * OFFSET_ADDRESS_SIZE)
++				   , lower_bound);
++                     b += 1 + 2 * OFFSET_ADDRESS_SIZE;
++
++                     /* Code to initialize the lower bound.  Insert
++                        before the `succeed_n'.  The `5' is the last two
++                        bytes of this `set_number_at', plus 3 bytes of
++                        the following `succeed_n'.  */
++		     /* ifdef WCHAR, The '1+2*OFFSET_ADDRESS_SIZE'
++			is the 'set_number_at', plus '1+OFFSET_ADDRESS_SIZE'
++			of the following `succeed_n'.  */
++                     PREFIX(insert_op2) (set_number_at, laststart, 1
++				 + 2 * OFFSET_ADDRESS_SIZE, lower_bound, b);
++                     b += 1 + 2 * OFFSET_ADDRESS_SIZE;
++
++                     if (upper_bound > 1)
++                       { /* More than one repetition is allowed, so
++                            append a backward jump to the `succeed_n'
++                            that starts this interval.
++
++                            When we've reached this during matching,
++                            we'll have matched the interval once, so
++                            jump back only `upper_bound - 1' times.  */
++                         STORE_JUMP2 (jump_n, b, laststart
++				      + 2 * OFFSET_ADDRESS_SIZE + 1,
++                                      upper_bound - 1);
++                         b += 1 + 2 * OFFSET_ADDRESS_SIZE;
++
++                         /* The location we want to set is the second
++                            parameter of the `jump_n'; that is `b-2' as
++                            an absolute address.  `laststart' will be
++                            the `set_number_at' we're about to insert;
++                            `laststart+3' the number to set, the source
++                            for the relative address.  But we are
++                            inserting into the middle of the pattern --
++                            so everything is getting moved up by 5.
++                            Conclusion: (b - 2) - (laststart + 3) + 5,
++                            i.e., b - laststart.
++
++                            We insert this at the beginning of the loop
++                            so that if we fail during matching, we'll
++                            reinitialize the bounds.  */
++                         PREFIX(insert_op2) (set_number_at, laststart,
++					     b - laststart,
++					     upper_bound - 1, b);
++                         b += 1 + 2 * OFFSET_ADDRESS_SIZE;
++                       }
++                   }
++                pending_exact = 0;
++		break;
++
++	      invalid_interval:
++		if (!(syntax & RE_INVALID_INTERVAL_ORD))
++		  FREE_STACK_RETURN (p == pend ? REG_EBRACE : REG_BADBR);
++	      unfetch_interval:
++		/* Match the characters as literals.  */
++		p = beg_interval;
++		c = '{';
++		if (syntax & RE_NO_BK_BRACES)
++		  goto normal_char;
++		else
++		  goto normal_backslash;
++	      }
++
++#ifdef emacs
++            /* There is no way to specify the before_dot and after_dot
++               operators.  rms says this is ok.  --karl  */
++            case '=':
++              BUF_PUSH (at_dot);
++              break;
++
++            case 's':
++              laststart = b;
++              PATFETCH (c);
++              BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
++              break;
++
++            case 'S':
++              laststart = b;
++              PATFETCH (c);
++              BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]);
++              break;
++#endif /* emacs */
++
++
++            case 'w':
++	      if (syntax & RE_NO_GNU_OPS)
++		goto normal_char;
++              laststart = b;
++              BUF_PUSH (wordchar);
++              break;
++
++
++            case 'W':
++	      if (syntax & RE_NO_GNU_OPS)
++		goto normal_char;
++              laststart = b;
++              BUF_PUSH (notwordchar);
++              break;
++
++
++            case '<':
++	      if (syntax & RE_NO_GNU_OPS)
++		goto normal_char;
++              BUF_PUSH (wordbeg);
++              break;
++
++            case '>':
++	      if (syntax & RE_NO_GNU_OPS)
++		goto normal_char;
++              BUF_PUSH (wordend);
++              break;
++
++            case 'b':
++	      if (syntax & RE_NO_GNU_OPS)
++		goto normal_char;
++              BUF_PUSH (wordbound);
++              break;
++
++            case 'B':
++	      if (syntax & RE_NO_GNU_OPS)
++		goto normal_char;
++              BUF_PUSH (notwordbound);
++              break;
++
++            case '`':
++	      if (syntax & RE_NO_GNU_OPS)
++		goto normal_char;
++              BUF_PUSH (begbuf);
++              break;
++
++            case '\'':
++	      if (syntax & RE_NO_GNU_OPS)
++		goto normal_char;
++              BUF_PUSH (endbuf);
++              break;
++
++            case '1': case '2': case '3': case '4': case '5':
++            case '6': case '7': case '8': case '9':
++              if (syntax & RE_NO_BK_REFS)
++                goto normal_char;
++
++              c1 = c - '0';
++
++              if (c1 > regnum)
++                FREE_STACK_RETURN (REG_ESUBREG);
++
++              /* Can't back reference to a subexpression if inside of it.  */
++              if (group_in_compile_stack (compile_stack, (regnum_t) c1))
++                goto normal_char;
++
++              laststart = b;
++              BUF_PUSH_2 (duplicate, c1);
++              break;
++
++
++            case '+':
++            case '?':
++              if (syntax & RE_BK_PLUS_QM)
++                goto handle_plus;
++              else
++                goto normal_backslash;
++
++            default:
++            normal_backslash:
++              /* You might think it would be useful for \ to mean
++                 not to translate; but if we don't translate it
++                 it will never match anything.  */
++              c = TRANSLATE (c);
++              goto normal_char;
++            }
++          break;
++
++
++	default:
++        /* Expects the character in `c'.  */
++	normal_char:
++	      /* If no exactn currently being built.  */
++          if (!pending_exact
++#ifdef WCHAR
++	      /* If last exactn handle binary(or character) and
++		 new exactn handle character(or binary).  */
++	      || is_exactn_bin != is_binary[p - 1 - pattern]
++#endif /* WCHAR */
++
++              /* If last exactn not at current position.  */
++              || pending_exact + *pending_exact + 1 != b
++
++              /* We have only one byte following the exactn for the count.  */
++	      || *pending_exact == (1 << BYTEWIDTH) - 1
++
++              /* If followed by a repetition operator.  */
++              || *p == '*' || *p == '^'
++	      || ((syntax & RE_BK_PLUS_QM)
++		  ? *p == '\\' && (p[1] == '+' || p[1] == '?')
++		  : (*p == '+' || *p == '?'))
++	      || ((syntax & RE_INTERVALS)
++                  && ((syntax & RE_NO_BK_BRACES)
++		      ? *p == '{'
++                      : (p[0] == '\\' && p[1] == '{'))))
++	    {
++	      /* Start building a new exactn.  */
++
++              laststart = b;
++
++#ifdef WCHAR
++	      /* Is this exactn binary data or character? */
++	      is_exactn_bin = is_binary[p - 1 - pattern];
++	      if (is_exactn_bin)
++		  BUF_PUSH_2 (exactn_bin, 0);
++	      else
++		  BUF_PUSH_2 (exactn, 0);
++#else
++	      BUF_PUSH_2 (exactn, 0);
++#endif /* WCHAR */
++	      pending_exact = b - 1;
++            }
++
++	  BUF_PUSH (c);
++          (*pending_exact)++;
++	  break;
++        } /* switch (c) */
++    } /* while p != pend */
++
++
++  /* Through the pattern now.  */
++
++  if (fixup_alt_jump)
++    STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
++
++  if (!COMPILE_STACK_EMPTY)
++    FREE_STACK_RETURN (REG_EPAREN);
++
++  /* If we don't want backtracking, force success
++     the first time we reach the end of the compiled pattern.  */
++  if (syntax & RE_NO_POSIX_BACKTRACKING)
++    BUF_PUSH (succeed);
++
++#ifdef WCHAR
++  free (pattern);
++  free (mbs_offset);
++  free (is_binary);
++#endif
++  free (compile_stack.stack);
++
++  /* We have succeeded; set the length of the buffer.  */
++#ifdef WCHAR
++  bufp->used = (uintptr_t) b - (uintptr_t) COMPILED_BUFFER_VAR;
++#else
++  bufp->used = b - bufp->buffer;
++#endif
++
++#ifdef DEBUG
++  if (debug)
++    {
++      DEBUG_PRINT1 ("\nCompiled pattern: \n");
++      PREFIX(print_compiled_pattern) (bufp);
++    }
++#endif /* DEBUG */
++
++#ifndef MATCH_MAY_ALLOCATE
++  /* Initialize the failure stack to the largest possible stack.  This
++     isn't necessary unless we're trying to avoid calling alloca in
++     the search and match routines.  */
++  {
++    int num_regs = bufp->re_nsub + 1;
++
++    /* Since DOUBLE_FAIL_STACK refuses to double only if the current size
++       is strictly greater than re_max_failures, the largest possible stack
++       is 2 * re_max_failures failure points.  */
++    if (fail_stack.size < (2 * re_max_failures * MAX_FAILURE_ITEMS))
++      {
++	fail_stack.size = (2 * re_max_failures * MAX_FAILURE_ITEMS);
++
++# ifdef emacs
++	if (! fail_stack.stack)
++	  fail_stack.stack
++	    = (PREFIX(fail_stack_elt_t) *) xmalloc (fail_stack.size
++				    * sizeof (PREFIX(fail_stack_elt_t)));
++	else
++	  fail_stack.stack
++	    = (PREFIX(fail_stack_elt_t) *) xrealloc (fail_stack.stack,
++				     (fail_stack.size
++				      * sizeof (PREFIX(fail_stack_elt_t))));
++# else /* not emacs */
++	if (! fail_stack.stack)
++	  fail_stack.stack
++	    = (PREFIX(fail_stack_elt_t) *) malloc (fail_stack.size
++				   * sizeof (PREFIX(fail_stack_elt_t)));
++	else
++	  fail_stack.stack
++	    = (PREFIX(fail_stack_elt_t) *) realloc (fail_stack.stack,
++					    (fail_stack.size
++				     * sizeof (PREFIX(fail_stack_elt_t))));
++# endif /* not emacs */
++      }
++
++   PREFIX(regex_grow_registers) (num_regs);
++  }
++#endif /* not MATCH_MAY_ALLOCATE */
++
++  return REG_NOERROR;
++} /* regex_compile */
++
++/* Subroutines for `regex_compile'.  */
++
++/* Store OP at LOC followed by two-byte integer parameter ARG.  */
++/* ifdef WCHAR, integer parameter is 1 wchar_t.  */
++
++static void
++PREFIX(store_op1) (re_opcode_t op, UCHAR_T *loc, int arg)
++{
++  *loc = (UCHAR_T) op;
++  STORE_NUMBER (loc + 1, arg);
++}
++
++
++/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2.  */
++/* ifdef WCHAR, integer parameter is 1 wchar_t.  */
++
++static void
++PREFIX(store_op2) (re_opcode_t op, UCHAR_T *loc, int arg1, int arg2)
++{
++  *loc = (UCHAR_T) op;
++  STORE_NUMBER (loc + 1, arg1);
++  STORE_NUMBER (loc + 1 + OFFSET_ADDRESS_SIZE, arg2);
++}
++
++
++/* Copy the bytes from LOC to END to open up three bytes of space at LOC
++   for OP followed by two-byte integer parameter ARG.  */
++/* ifdef WCHAR, integer parameter is 1 wchar_t.  */
++
++static void
++PREFIX(insert_op1) (re_opcode_t op, UCHAR_T *loc, int arg, UCHAR_T *end)
++{
++  register UCHAR_T *pfrom = end;
++  register UCHAR_T *pto = end + 1 + OFFSET_ADDRESS_SIZE;
++
++  while (pfrom != loc)
++    *--pto = *--pfrom;
++
++  PREFIX(store_op1) (op, loc, arg);
++}
++
++
++/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2.  */
++/* ifdef WCHAR, integer parameter is 1 wchar_t.  */
++
++static void
++PREFIX(insert_op2) (re_opcode_t op, UCHAR_T *loc, int arg1,
++                    int arg2, UCHAR_T *end)
++{
++  register UCHAR_T *pfrom = end;
++  register UCHAR_T *pto = end + 1 + 2 * OFFSET_ADDRESS_SIZE;
++
++  while (pfrom != loc)
++    *--pto = *--pfrom;
++
++  PREFIX(store_op2) (op, loc, arg1, arg2);
++}
++
++
++/* P points to just after a ^ in PATTERN.  Return true if that ^ comes
++   after an alternative or a begin-subexpression.  We assume there is at
++   least one character before the ^.  */
++
++static boolean
++PREFIX(at_begline_loc_p) (const CHAR_T *pattern, const CHAR_T *p,
++                          reg_syntax_t syntax)
++{
++  const CHAR_T *prev = p - 2;
++  boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
++
++  return
++       /* After a subexpression?  */
++       (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
++       /* After an alternative?  */
++    || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
++}
++
++
++/* The dual of at_begline_loc_p.  This one is for $.  We assume there is
++   at least one character after the $, i.e., `P < PEND'.  */
++
++static boolean
++PREFIX(at_endline_loc_p) (const CHAR_T *p, const CHAR_T *pend,
++                          reg_syntax_t syntax)
++{
++  const CHAR_T *next = p;
++  boolean next_backslash = *next == '\\';
++  const CHAR_T *next_next = p + 1 < pend ? p + 1 : 0;
++
++  return
++       /* Before a subexpression?  */
++       (syntax & RE_NO_BK_PARENS ? *next == ')'
++        : next_backslash && next_next && *next_next == ')')
++       /* Before an alternative?  */
++    || (syntax & RE_NO_BK_VBAR ? *next == '|'
++        : next_backslash && next_next && *next_next == '|');
++}
++
++#else /* not INSIDE_RECURSION */
++
++/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
++   false if it's not.  */
++
++static boolean
++group_in_compile_stack (compile_stack_type compile_stack, regnum_t regnum)
++{
++  int this_element;
++
++  for (this_element = compile_stack.avail - 1;
++       this_element >= 0;
++       this_element--)
++    if (compile_stack.stack[this_element].regnum == regnum)
++      return true;
++
++  return false;
++}
++#endif /* not INSIDE_RECURSION */
++
++#ifdef INSIDE_RECURSION
++
++#ifdef WCHAR
++/* This insert space, which size is "num", into the pattern at "loc".
++   "end" must point the end of the allocated buffer.  */
++static void
++insert_space (int num, CHAR_T *loc, CHAR_T *end)
++{
++  register CHAR_T *pto = end;
++  register CHAR_T *pfrom = end - num;
++
++  while (pfrom >= loc)
++    *pto-- = *pfrom--;
++}
++#endif /* WCHAR */
++
++#ifdef WCHAR
++static reg_errcode_t
++wcs_compile_range (CHAR_T range_start_char, const CHAR_T **p_ptr,
++                   const CHAR_T *pend, RE_TRANSLATE_TYPE translate,
++                   reg_syntax_t syntax, CHAR_T *b, CHAR_T *char_set)
++{
++  const CHAR_T *p = *p_ptr;
++  CHAR_T range_start, range_end;
++  reg_errcode_t ret;
++# ifdef _LIBC
++  uint32_t nrules;
++  uint32_t start_val, end_val;
++# endif
++  if (p == pend)
++    return REG_ERANGE;
++
++# ifdef _LIBC
++  nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
++  if (nrules != 0)
++    {
++      const char *collseq = (const char *) _NL_CURRENT(LC_COLLATE,
++						       _NL_COLLATE_COLLSEQWC);
++      const unsigned char *extra = (const unsigned char *)
++	_NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB);
++
++      if (range_start_char < -1)
++	{
++	  /* range_start is a collating symbol.  */
++	  int32_t *wextra;
++	  /* Retreive the index and get collation sequence value.  */
++	  wextra = (int32_t*)(extra + char_set[-range_start_char]);
++	  start_val = wextra[1 + *wextra];
++	}
++      else
++	start_val = collseq_table_lookup(collseq, TRANSLATE(range_start_char));
++
++      end_val = collseq_table_lookup (collseq, TRANSLATE (p[0]));
++
++      /* Report an error if the range is empty and the syntax prohibits
++	 this.  */
++      ret = ((syntax & RE_NO_EMPTY_RANGES)
++	     && (start_val > end_val))? REG_ERANGE : REG_NOERROR;
++
++      /* Insert space to the end of the char_ranges.  */
++      insert_space(2, b - char_set[5] - 2, b - 1);
++      *(b - char_set[5] - 2) = (wchar_t)start_val;
++      *(b - char_set[5] - 1) = (wchar_t)end_val;
++      char_set[4]++; /* ranges_index */
++    }
++  else
++# endif
++    {
++      range_start = (range_start_char >= 0)? TRANSLATE (range_start_char):
++	range_start_char;
++      range_end = TRANSLATE (p[0]);
++      /* Report an error if the range is empty and the syntax prohibits
++	 this.  */
++      ret = ((syntax & RE_NO_EMPTY_RANGES)
++	     && (range_start > range_end))? REG_ERANGE : REG_NOERROR;
++
++      /* Insert space to the end of the char_ranges.  */
++      insert_space(2, b - char_set[5] - 2, b - 1);
++      *(b - char_set[5] - 2) = range_start;
++      *(b - char_set[5] - 1) = range_end;
++      char_set[4]++; /* ranges_index */
++    }
++  /* Have to increment the pointer into the pattern string, so the
++     caller isn't still at the ending character.  */
++  (*p_ptr)++;
++
++  return ret;
++}
++#else /* BYTE */
++/* Read the ending character of a range (in a bracket expression) from the
++   uncompiled pattern *P_PTR (which ends at PEND).  We assume the
++   starting character is in `P[-2]'.  (`P[-1]' is the character `-'.)
++   Then we set the translation of all bits between the starting and
++   ending characters (inclusive) in the compiled pattern B.
++
++   Return an error code.
++
++   We use these short variable names so we can use the same macros as
++   `regex_compile' itself.  */
++
++static reg_errcode_t
++byte_compile_range (unsigned int range_start_char, const char **p_ptr,
++                    const char *pend, RE_TRANSLATE_TYPE translate,
++                    reg_syntax_t syntax, unsigned char *b)
++{
++  unsigned this_char;
++  const char *p = *p_ptr;
++  reg_errcode_t ret;
++# if _LIBC
++  const unsigned char *collseq;
++  unsigned int start_colseq;
++  unsigned int end_colseq;
++# else
++  unsigned end_char;
++# endif
++
++  if (p == pend)
++    return REG_ERANGE;
++
++  /* Have to increment the pointer into the pattern string, so the
++     caller isn't still at the ending character.  */
++  (*p_ptr)++;
++
++  /* Report an error if the range is empty and the syntax prohibits this.  */
++  ret = syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
++
++# if _LIBC
++  collseq = (const unsigned char *) _NL_CURRENT (LC_COLLATE,
++						 _NL_COLLATE_COLLSEQMB);
++
++  start_colseq = collseq[(unsigned char) TRANSLATE (range_start_char)];
++  end_colseq = collseq[(unsigned char) TRANSLATE (p[0])];
++  for (this_char = 0; this_char <= (unsigned char) -1; ++this_char)
++    {
++      unsigned int this_colseq = collseq[(unsigned char) TRANSLATE (this_char)];
++
++      if (start_colseq <= this_colseq && this_colseq <= end_colseq)
++	{
++	  SET_LIST_BIT (TRANSLATE (this_char));
++	  ret = REG_NOERROR;
++	}
++    }
++# else
++  /* Here we see why `this_char' has to be larger than an `unsigned
++     char' -- we would otherwise go into an infinite loop, since all
++     characters <= 0xff.  */
++  range_start_char = TRANSLATE (range_start_char);
++  /* TRANSLATE(p[0]) is casted to char (not unsigned char) in TRANSLATE,
++     and some compilers cast it to int implicitly, so following for_loop
++     may fall to (almost) infinite loop.
++     e.g. If translate[p[0]] = 0xff, end_char may equals to 0xffffffff.
++     To avoid this, we cast p[0] to unsigned int and truncate it.  */
++  end_char = ((unsigned)TRANSLATE(p[0]) & ((1 << BYTEWIDTH) - 1));
++
++  for (this_char = range_start_char; this_char <= end_char; ++this_char)
++    {
++      SET_LIST_BIT (TRANSLATE (this_char));
++      ret = REG_NOERROR;
++    }
++# endif
++
++  return ret;
++}
++#endif /* WCHAR */
++
++/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
++   BUFP.  A fastmap records which of the (1 << BYTEWIDTH) possible
++   characters can start a string that matches the pattern.  This fastmap
++   is used by re_search to skip quickly over impossible starting points.
++
++   The caller must supply the address of a (1 << BYTEWIDTH)-byte data
++   area as BUFP->fastmap.
++
++   We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
++   the pattern buffer.
++
++   Returns 0 if we succeed, -2 if an internal error.   */
++
++#ifdef WCHAR
++/* local function for re_compile_fastmap.
++   truncate wchar_t character to char.  */
++static unsigned char truncate_wchar (CHAR_T c);
++
++static unsigned char
++truncate_wchar (CHAR_T c)
++{
++  unsigned char buf[MB_CUR_MAX];
++  mbstate_t state;
++  int retval;
++  memset (&state, '\0', sizeof (state));
++# ifdef _LIBC
++  retval = __wcrtomb (buf, c, &state);
++# else
++  retval = wcrtomb (buf, c, &state);
++# endif
++  return retval > 0 ? buf[0] : (unsigned char) c;
++}
++#endif /* WCHAR */
++
++static int
++PREFIX(re_compile_fastmap) (struct re_pattern_buffer *bufp)
++{
++  int j, k;
++#ifdef MATCH_MAY_ALLOCATE
++  PREFIX(fail_stack_type) fail_stack;
++#endif
++#ifndef REGEX_MALLOC
++  char *destination;
++#endif
++
++  register char *fastmap = bufp->fastmap;
++
++#ifdef WCHAR
++  /* We need to cast pattern to (wchar_t*), because we casted this compiled
++     pattern to (char*) in regex_compile.  */
++  UCHAR_T *pattern = (UCHAR_T*)bufp->buffer;
++  register UCHAR_T *pend = (UCHAR_T*) (bufp->buffer + bufp->used);
++#else /* BYTE */
++  UCHAR_T *pattern = bufp->buffer;
++  register UCHAR_T *pend = pattern + bufp->used;
++#endif /* WCHAR */
++  UCHAR_T *p = pattern;
++
++#ifdef REL_ALLOC
++  /* This holds the pointer to the failure stack, when
++     it is allocated relocatably.  */
++  fail_stack_elt_t *failure_stack_ptr;
++#endif
++
++  /* Assume that each path through the pattern can be null until
++     proven otherwise.  We set this false at the bottom of switch
++     statement, to which we get only if a particular path doesn't
++     match the empty string.  */
++  boolean path_can_be_null = true;
++
++  /* We aren't doing a `succeed_n' to begin with.  */
++  boolean succeed_n_p = false;
++
++  assert (fastmap != NULL && p != NULL);
++
++  INIT_FAIL_STACK ();
++  bzero (fastmap, 1 << BYTEWIDTH);  /* Assume nothing's valid.  */
++  bufp->fastmap_accurate = 1;	    /* It will be when we're done.  */
++  bufp->can_be_null = 0;
++
++  while (1)
++    {
++      if (p == pend || *p == (UCHAR_T) succeed)
++	{
++	  /* We have reached the (effective) end of pattern.  */
++	  if (!FAIL_STACK_EMPTY ())
++	    {
++	      bufp->can_be_null |= path_can_be_null;
++
++	      /* Reset for next path.  */
++	      path_can_be_null = true;
++
++	      p = fail_stack.stack[--fail_stack.avail].pointer;
++
++	      continue;
++	    }
++	  else
++	    break;
++	}
++
++      /* We should never be about to go beyond the end of the pattern.  */
++      assert (p < pend);
++
++      switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
++	{
++
++        /* I guess the idea here is to simply not bother with a fastmap
++           if a backreference is used, since it's too hard to figure out
++           the fastmap for the corresponding group.  Setting
++           `can_be_null' stops `re_search_2' from using the fastmap, so
++           that is all we do.  */
++	case duplicate:
++	  bufp->can_be_null = 1;
++          goto done;
++
++
++      /* Following are the cases which match a character.  These end
++         with `break'.  */
++
++#ifdef WCHAR
++	case exactn:
++          fastmap[truncate_wchar(p[1])] = 1;
++	  break;
++#else /* BYTE */
++	case exactn:
++          fastmap[p[1]] = 1;
++	  break;
++#endif /* WCHAR */
++#ifdef MBS_SUPPORT
++	case exactn_bin:
++	  fastmap[p[1]] = 1;
++	  break;
++#endif
++
++#ifdef WCHAR
++        /* It is hard to distinguish fastmap from (multi byte) characters
++           which depends on current locale.  */
++        case charset:
++	case charset_not:
++	case wordchar:
++	case notwordchar:
++          bufp->can_be_null = 1;
++          goto done;
++#else /* BYTE */
++        case charset:
++          for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
++	    if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
++              fastmap[j] = 1;
++	  break;
++
++
++	case charset_not:
++	  /* Chars beyond end of map must be allowed.  */
++	  for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
++            fastmap[j] = 1;
++
++	  for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
++	    if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
++              fastmap[j] = 1;
++          break;
++
++
++	case wordchar:
++	  for (j = 0; j < (1 << BYTEWIDTH); j++)
++	    if (SYNTAX (j) == Sword)
++	      fastmap[j] = 1;
++	  break;
++
++
++	case notwordchar:
++	  for (j = 0; j < (1 << BYTEWIDTH); j++)
++	    if (SYNTAX (j) != Sword)
++	      fastmap[j] = 1;
++	  break;
++#endif /* WCHAR */
++
++        case anychar:
++	  {
++	    int fastmap_newline = fastmap['\n'];
++
++	    /* `.' matches anything ...  */
++	    for (j = 0; j < (1 << BYTEWIDTH); j++)
++	      fastmap[j] = 1;
++
++	    /* ... except perhaps newline.  */
++	    if (!(bufp->syntax & RE_DOT_NEWLINE))
++	      fastmap['\n'] = fastmap_newline;
++
++	    /* Return if we have already set `can_be_null'; if we have,
++	       then the fastmap is irrelevant.  Something's wrong here.  */
++	    else if (bufp->can_be_null)
++	      goto done;
++
++	    /* Otherwise, have to check alternative paths.  */
++	    break;
++	  }
++
++#ifdef emacs
++        case syntaxspec:
++	  k = *p++;
++	  for (j = 0; j < (1 << BYTEWIDTH); j++)
++	    if (SYNTAX (j) == (enum syntaxcode) k)
++	      fastmap[j] = 1;
++	  break;
++
++
++	case notsyntaxspec:
++	  k = *p++;
++	  for (j = 0; j < (1 << BYTEWIDTH); j++)
++	    if (SYNTAX (j) != (enum syntaxcode) k)
++	      fastmap[j] = 1;
++	  break;
++
++
++      /* All cases after this match the empty string.  These end with
++         `continue'.  */
++
++
++	case before_dot:
++	case at_dot:
++	case after_dot:
++          continue;
++#endif /* emacs */
++
++
++        case no_op:
++        case begline:
++        case endline:
++	case begbuf:
++	case endbuf:
++	case wordbound:
++	case notwordbound:
++	case wordbeg:
++	case wordend:
++        case push_dummy_failure:
++          continue;
++
++
++	case jump_n:
++        case pop_failure_jump:
++	case maybe_pop_jump:
++	case jump:
++        case jump_past_alt:
++	case dummy_failure_jump:
++          EXTRACT_NUMBER_AND_INCR (j, p);
++	  p += j;
++	  if (j > 0)
++	    continue;
++
++          /* Jump backward implies we just went through the body of a
++             loop and matched nothing.  Opcode jumped to should be
++             `on_failure_jump' or `succeed_n'.  Just treat it like an
++             ordinary jump.  For a * loop, it has pushed its failure
++             point already; if so, discard that as redundant.  */
++          if ((re_opcode_t) *p != on_failure_jump
++	      && (re_opcode_t) *p != succeed_n)
++	    continue;
++
++          p++;
++          EXTRACT_NUMBER_AND_INCR (j, p);
++          p += j;
++
++          /* If what's on the stack is where we are now, pop it.  */
++          if (!FAIL_STACK_EMPTY ()
++	      && fail_stack.stack[fail_stack.avail - 1].pointer == p)
++            fail_stack.avail--;
++
++          continue;
++
++
++        case on_failure_jump:
++        case on_failure_keep_string_jump:
++	handle_on_failure_jump:
++          EXTRACT_NUMBER_AND_INCR (j, p);
++
++          /* For some patterns, e.g., `(a?)?', `p+j' here points to the
++             end of the pattern.  We don't want to push such a point,
++             since when we restore it above, entering the switch will
++             increment `p' past the end of the pattern.  We don't need
++             to push such a point since we obviously won't find any more
++             fastmap entries beyond `pend'.  Such a pattern can match
++             the null string, though.  */
++          if (p + j < pend)
++            {
++              if (!PUSH_PATTERN_OP (p + j, fail_stack))
++		{
++		  RESET_FAIL_STACK ();
++		  return -2;
++		}
++            }
++          else
++            bufp->can_be_null = 1;
++
++          if (succeed_n_p)
++            {
++              EXTRACT_NUMBER_AND_INCR (k, p);	/* Skip the n.  */
++              succeed_n_p = false;
++	    }
++
++          continue;
++
++
++	case succeed_n:
++          /* Get to the number of times to succeed.  */
++          p += OFFSET_ADDRESS_SIZE;
++
++          /* Increment p past the n for when k != 0.  */
++          EXTRACT_NUMBER_AND_INCR (k, p);
++          if (k == 0)
++	    {
++              p -= 2 * OFFSET_ADDRESS_SIZE;
++  	      succeed_n_p = true;  /* Spaghetti code alert.  */
++              goto handle_on_failure_jump;
++            }
++          continue;
++
++
++	case set_number_at:
++          p += 2 * OFFSET_ADDRESS_SIZE;
++          continue;
++
++
++	case start_memory:
++        case stop_memory:
++	  p += 2;
++	  continue;
++
++
++	default:
++          abort (); /* We have listed all the cases.  */
++        } /* switch *p++ */
++
++      /* Getting here means we have found the possible starting
++         characters for one path of the pattern -- and that the empty
++         string does not match.  We need not follow this path further.
++         Instead, look at the next alternative (remembered on the
++         stack), or quit if no more.  The test at the top of the loop
++         does these things.  */
++      path_can_be_null = false;
++      p = pend;
++    } /* while p */
++
++  /* Set `can_be_null' for the last path (also the first path, if the
++     pattern is empty).  */
++  bufp->can_be_null |= path_can_be_null;
++
++ done:
++  RESET_FAIL_STACK ();
++  return 0;
++}
++
++#else /* not INSIDE_RECURSION */
++
++int
++re_compile_fastmap (struct re_pattern_buffer *bufp)
++{
++# ifdef MBS_SUPPORT
++  if (MB_CUR_MAX != 1)
++    return wcs_re_compile_fastmap(bufp);
++  else
++# endif
++    return byte_re_compile_fastmap(bufp);
++} /* re_compile_fastmap */
++#ifdef _LIBC
++weak_alias (__re_compile_fastmap, re_compile_fastmap)
++#endif
++
++
++/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
++   ENDS.  Subsequent matches using PATTERN_BUFFER and REGS will use
++   this memory for recording register information.  STARTS and ENDS
++   must be allocated using the malloc library routine, and must each
++   be at least NUM_REGS * sizeof (regoff_t) bytes long.
++
++   If NUM_REGS == 0, then subsequent matches should allocate their own
++   register data.
++
++   Unless this function is called, the first search or match using
++   PATTERN_BUFFER will allocate its own register data, without
++   freeing the old data.  */
++
++void
++re_set_registers (struct re_pattern_buffer *bufp,
++                  struct re_registers *regs, unsigned num_regs,
++                  regoff_t *starts, regoff_t *ends)
++{
++  if (num_regs)
++    {
++      bufp->regs_allocated = REGS_REALLOCATE;
++      regs->num_regs = num_regs;
++      regs->start = starts;
++      regs->end = ends;
++    }
++  else
++    {
++      bufp->regs_allocated = REGS_UNALLOCATED;
++      regs->num_regs = 0;
++      regs->start = regs->end = (regoff_t *) 0;
++    }
++}
++#ifdef _LIBC
++weak_alias (__re_set_registers, re_set_registers)
++#endif
++
++/* Searching routines.  */
++
++/* Like re_search_2, below, but only one string is specified, and
++   doesn't let you say where to stop matching.  */
++
++int
++re_search (struct re_pattern_buffer *bufp, const char *string, int size,
++           int startpos, int range, struct re_registers *regs)
++{
++  return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
++		      regs, size);
++}
++#ifdef _LIBC
++weak_alias (__re_search, re_search)
++#endif
++
++
++/* Using the compiled pattern in BUFP->buffer, first tries to match the
++   virtual concatenation of STRING1 and STRING2, starting first at index
++   STARTPOS, then at STARTPOS + 1, and so on.
++
++   STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
++
++   RANGE is how far to scan while trying to match.  RANGE = 0 means try
++   only at STARTPOS; in general, the last start tried is STARTPOS +
++   RANGE.
++
++   In REGS, return the indices of the virtual concatenation of STRING1
++   and STRING2 that matched the entire BUFP->buffer and its contained
++   subexpressions.
++
++   Do not consider matching one past the index STOP in the virtual
++   concatenation of STRING1 and STRING2.
++
++   We return either the position in the strings at which the match was
++   found, -1 if no match, or -2 if error (such as failure
++   stack overflow).  */
++
++int
++re_search_2 (struct re_pattern_buffer *bufp, const char *string1, int size1,
++             const char *string2, int size2, int startpos, int range,
++             struct re_registers *regs, int stop)
++{
++# ifdef MBS_SUPPORT
++  if (MB_CUR_MAX != 1)
++    return wcs_re_search_2 (bufp, string1, size1, string2, size2, startpos,
++			    range, regs, stop);
++  else
++# endif
++    return byte_re_search_2 (bufp, string1, size1, string2, size2, startpos,
++			     range, regs, stop);
++} /* re_search_2 */
++#ifdef _LIBC
++weak_alias (__re_search_2, re_search_2)
++#endif
++
++#endif /* not INSIDE_RECURSION */
++
++#ifdef INSIDE_RECURSION
++
++#ifdef MATCH_MAY_ALLOCATE
++# define FREE_VAR(var) if (var) REGEX_FREE (var); var = NULL
++#else
++# define FREE_VAR(var) if (var) free (var); var = NULL
++#endif
++
++#ifdef WCHAR
++# define MAX_ALLOCA_SIZE	2000
++
++# define FREE_WCS_BUFFERS() \
++  do {									      \
++    if (size1 > MAX_ALLOCA_SIZE)					      \
++      {									      \
++	free (wcs_string1);						      \
++	free (mbs_offset1);						      \
++      }									      \
++    else								      \
++      {									      \
++	FREE_VAR (wcs_string1);						      \
++	FREE_VAR (mbs_offset1);						      \
++      }									      \
++    if (size2 > MAX_ALLOCA_SIZE) 					      \
++      {									      \
++	free (wcs_string2);						      \
++	free (mbs_offset2);						      \
++      }									      \
++    else								      \
++      {									      \
++	FREE_VAR (wcs_string2);						      \
++	FREE_VAR (mbs_offset2);						      \
++      }									      \
++  } while (0)
++
++#endif
++
++
++static int
++PREFIX(re_search_2) (struct re_pattern_buffer *bufp, const char *string1,
++                     int size1, const char *string2, int size2,
++                     int startpos, int range,
++                     struct re_registers *regs, int stop)
++{
++  int val;
++  register char *fastmap = bufp->fastmap;
++  register RE_TRANSLATE_TYPE translate = bufp->translate;
++  int total_size = size1 + size2;
++  int endpos = startpos + range;
++#ifdef WCHAR
++  /* We need wchar_t* buffers correspond to cstring1, cstring2.  */
++  wchar_t *wcs_string1 = NULL, *wcs_string2 = NULL;
++  /* We need the size of wchar_t buffers correspond to csize1, csize2.  */
++  int wcs_size1 = 0, wcs_size2 = 0;
++  /* offset buffer for optimizatoin. See convert_mbs_to_wc.  */
++  int *mbs_offset1 = NULL, *mbs_offset2 = NULL;
++  /* They hold whether each wchar_t is binary data or not.  */
++  char *is_binary = NULL;
++#endif /* WCHAR */
++
++  /* Check for out-of-range STARTPOS.  */
++  if (startpos < 0 || startpos > total_size)
++    return -1;
++
++  /* Fix up RANGE if it might eventually take us outside
++     the virtual concatenation of STRING1 and STRING2.
++     Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE.  */
++  if (endpos < 0)
++    range = 0 - startpos;
++  else if (endpos > total_size)
++    range = total_size - startpos;
++
++  /* If the search isn't to be a backwards one, don't waste time in a
++     search for a pattern that must be anchored.  */
++  if (bufp->used > 0 && range > 0
++      && ((re_opcode_t) bufp->buffer[0] == begbuf
++	  /* `begline' is like `begbuf' if it cannot match at newlines.  */
++	  || ((re_opcode_t) bufp->buffer[0] == begline
++	      && !bufp->newline_anchor)))
++    {
++      if (startpos > 0)
++	return -1;
++      else
++	range = 1;
++    }
++
++#ifdef emacs
++  /* In a forward search for something that starts with \=.
++     don't keep searching past point.  */
++  if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot && range > 0)
++    {
++      range = PT - startpos;
++      if (range <= 0)
++	return -1;
++    }
++#endif /* emacs */
++
++  /* Update the fastmap now if not correct already.  */
++  if (fastmap && !bufp->fastmap_accurate)
++    if (re_compile_fastmap (bufp) == -2)
++      return -2;
++
++#ifdef WCHAR
++  /* Allocate wchar_t array for wcs_string1 and wcs_string2 and
++     fill them with converted string.  */
++  if (size1 != 0)
++    {
++      if (size1 > MAX_ALLOCA_SIZE)
++	{
++	  wcs_string1 = TALLOC (size1 + 1, CHAR_T);
++	  mbs_offset1 = TALLOC (size1 + 1, int);
++	  is_binary = TALLOC (size1 + 1, char);
++	}
++      else
++	{
++	  wcs_string1 = REGEX_TALLOC (size1 + 1, CHAR_T);
++	  mbs_offset1 = REGEX_TALLOC (size1 + 1, int);
++	  is_binary = REGEX_TALLOC (size1 + 1, char);
++	}
++      if (!wcs_string1 || !mbs_offset1 || !is_binary)
++	{
++	  if (size1 > MAX_ALLOCA_SIZE)
++	    {
++	      free (wcs_string1);
++	      free (mbs_offset1);
++	      free (is_binary);
++	    }
++	  else
++	    {
++	      FREE_VAR (wcs_string1);
++	      FREE_VAR (mbs_offset1);
++	      FREE_VAR (is_binary);
++	    }
++	  return -2;
++	}
++      wcs_size1 = convert_mbs_to_wcs(wcs_string1, string1, size1,
++				     mbs_offset1, is_binary);
++      wcs_string1[wcs_size1] = L'\0'; /* for a sentinel  */
++      if (size1 > MAX_ALLOCA_SIZE)
++	free (is_binary);
++      else
++	FREE_VAR (is_binary);
++    }
++  if (size2 != 0)
++    {
++      if (size2 > MAX_ALLOCA_SIZE)
++	{
++	  wcs_string2 = TALLOC (size2 + 1, CHAR_T);
++	  mbs_offset2 = TALLOC (size2 + 1, int);
++	  is_binary = TALLOC (size2 + 1, char);
++	}
++      else
++	{
++	  wcs_string2 = REGEX_TALLOC (size2 + 1, CHAR_T);
++	  mbs_offset2 = REGEX_TALLOC (size2 + 1, int);
++	  is_binary = REGEX_TALLOC (size2 + 1, char);
++	}
++      if (!wcs_string2 || !mbs_offset2 || !is_binary)
++	{
++	  FREE_WCS_BUFFERS ();
++	  if (size2 > MAX_ALLOCA_SIZE)
++	    free (is_binary);
++	  else
++	    FREE_VAR (is_binary);
++	  return -2;
++	}
++      wcs_size2 = convert_mbs_to_wcs(wcs_string2, string2, size2,
++				     mbs_offset2, is_binary);
++      wcs_string2[wcs_size2] = L'\0'; /* for a sentinel  */
++      if (size2 > MAX_ALLOCA_SIZE)
++	free (is_binary);
++      else
++	FREE_VAR (is_binary);
++    }
++#endif /* WCHAR */
++
++
++  /* Loop through the string, looking for a place to start matching.  */
++  for (;;)
++    {
++      /* If a fastmap is supplied, skip quickly over characters that
++         cannot be the start of a match.  If the pattern can match the
++         null string, however, we don't need to skip characters; we want
++         the first null string.  */
++      if (fastmap && startpos < total_size && !bufp->can_be_null)
++	{
++	  if (range > 0)	/* Searching forwards.  */
++	    {
++	      register const char *d;
++	      register int lim = 0;
++	      int irange = range;
++
++              if (startpos < size1 && startpos + range >= size1)
++                lim = range - (size1 - startpos);
++
++	      d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
++
++              /* Written out as an if-else to avoid testing `translate'
++                 inside the loop.  */
++	      if (translate)
++                while (range > lim
++                       && !fastmap[(unsigned char)
++				   translate[(unsigned char) *d++]])
++                  range--;
++	      else
++                while (range > lim && !fastmap[(unsigned char) *d++])
++                  range--;
++
++	      startpos += irange - range;
++	    }
++	  else				/* Searching backwards.  */
++	    {
++	      register CHAR_T c = (size1 == 0 || startpos >= size1
++				      ? string2[startpos - size1]
++				      : string1[startpos]);
++
++	      if (!fastmap[(unsigned char) TRANSLATE (c)])
++		goto advance;
++	    }
++	}
++
++      /* If can't match the null string, and that's all we have left, fail.  */
++      if (range >= 0 && startpos == total_size && fastmap
++          && !bufp->can_be_null)
++       {
++#ifdef WCHAR
++         FREE_WCS_BUFFERS ();
++#endif
++         return -1;
++       }
++
++#ifdef WCHAR
++      val = wcs_re_match_2_internal (bufp, string1, size1, string2,
++				     size2, startpos, regs, stop,
++				     wcs_string1, wcs_size1,
++				     wcs_string2, wcs_size2,
++				     mbs_offset1, mbs_offset2);
++#else /* BYTE */
++      val = byte_re_match_2_internal (bufp, string1, size1, string2,
++				      size2, startpos, regs, stop);
++#endif /* BYTE */
++
++#ifndef REGEX_MALLOC
++# ifdef C_ALLOCA
++      alloca (0);
++# endif
++#endif
++
++      if (val >= 0)
++	{
++#ifdef WCHAR
++	  FREE_WCS_BUFFERS ();
++#endif
++	  return startpos;
++	}
++
++      if (val == -2)
++	{
++#ifdef WCHAR
++	  FREE_WCS_BUFFERS ();
++#endif
++	  return -2;
++	}
++
++    advance:
++      if (!range)
++        break;
++      else if (range > 0)
++        {
++          range--;
++          startpos++;
++        }
++      else
++        {
++          range++;
++          startpos--;
++        }
++    }
++#ifdef WCHAR
++  FREE_WCS_BUFFERS ();
++#endif
++  return -1;
++}
++
++#ifdef WCHAR
++/* This converts PTR, a pointer into one of the search wchar_t strings
++   `string1' and `string2' into an multibyte string offset from the
++   beginning of that string. We use mbs_offset to optimize.
++   See convert_mbs_to_wcs.  */
++# define POINTER_TO_OFFSET(ptr)						\
++  (FIRST_STRING_P (ptr)							\
++   ? ((regoff_t)(mbs_offset1 != NULL? mbs_offset1[(ptr)-string1] : 0))	\
++   : ((regoff_t)((mbs_offset2 != NULL? mbs_offset2[(ptr)-string2] : 0)	\
++		 + csize1)))
++#else /* BYTE */
++/* This converts PTR, a pointer into one of the search strings `string1'
++   and `string2' into an offset from the beginning of that string.  */
++# define POINTER_TO_OFFSET(ptr)			\
++  (FIRST_STRING_P (ptr)				\
++   ? ((regoff_t) ((ptr) - string1))		\
++   : ((regoff_t) ((ptr) - string2 + size1)))
++#endif /* WCHAR */
++
++/* Macros for dealing with the split strings in re_match_2.  */
++
++#define MATCHING_IN_FIRST_STRING  (dend == end_match_1)
++
++/* Call before fetching a character with *d.  This switches over to
++   string2 if necessary.  */
++#define PREFETCH()							\
++  while (d == dend)						    	\
++    {									\
++      /* End of string2 => fail.  */					\
++      if (dend == end_match_2) 						\
++        goto fail;							\
++      /* End of string1 => advance to string2.  */ 			\
++      d = string2;						        \
++      dend = end_match_2;						\
++    }
++
++/* Test if at very beginning or at very end of the virtual concatenation
++   of `string1' and `string2'.  If only one string, it's `string2'.  */
++#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
++#define AT_STRINGS_END(d) ((d) == end2)
++
++
++/* Test if D points to a character which is word-constituent.  We have
++   two special cases to check for: if past the end of string1, look at
++   the first character in string2; and if before the beginning of
++   string2, look at the last character in string1.  */
++#ifdef WCHAR
++/* Use internationalized API instead of SYNTAX.  */
++# define WORDCHAR_P(d)							\
++  (iswalnum ((wint_t)((d) == end1 ? *string2				\
++           : (d) == string2 - 1 ? *(end1 - 1) : *(d))) != 0		\
++   || ((d) == end1 ? *string2						\
++       : (d) == string2 - 1 ? *(end1 - 1) : *(d)) == L'_')
++#else /* BYTE */
++# define WORDCHAR_P(d)							\
++  (SYNTAX ((d) == end1 ? *string2					\
++           : (d) == string2 - 1 ? *(end1 - 1) : *(d))			\
++   == Sword)
++#endif /* WCHAR */
++
++/* Disabled due to a compiler bug -- see comment at case wordbound */
++#if 0
++/* Test if the character before D and the one at D differ with respect
++   to being word-constituent.  */
++#define AT_WORD_BOUNDARY(d)						\
++  (AT_STRINGS_BEG (d) || AT_STRINGS_END (d)				\
++   || WORDCHAR_P (d - 1) != WORDCHAR_P (d))
++#endif
++
++/* Free everything we malloc.  */
++#ifdef MATCH_MAY_ALLOCATE
++# ifdef WCHAR
++#  define FREE_VARIABLES()						\
++  do {									\
++    REGEX_FREE_STACK (fail_stack.stack);				\
++    FREE_VAR (regstart);						\
++    FREE_VAR (regend);							\
++    FREE_VAR (old_regstart);						\
++    FREE_VAR (old_regend);						\
++    FREE_VAR (best_regstart);						\
++    FREE_VAR (best_regend);						\
++    FREE_VAR (reg_info);						\
++    FREE_VAR (reg_dummy);						\
++    FREE_VAR (reg_info_dummy);						\
++    if (!cant_free_wcs_buf)						\
++      {									\
++        FREE_VAR (string1);						\
++        FREE_VAR (string2);						\
++        FREE_VAR (mbs_offset1);						\
++        FREE_VAR (mbs_offset2);						\
++      }									\
++  } while (0)
++# else /* BYTE */
++#  define FREE_VARIABLES()						\
++  do {									\
++    REGEX_FREE_STACK (fail_stack.stack);				\
++    FREE_VAR (regstart);						\
++    FREE_VAR (regend);							\
++    FREE_VAR (old_regstart);						\
++    FREE_VAR (old_regend);						\
++    FREE_VAR (best_regstart);						\
++    FREE_VAR (best_regend);						\
++    FREE_VAR (reg_info);						\
++    FREE_VAR (reg_dummy);						\
++    FREE_VAR (reg_info_dummy);						\
++  } while (0)
++# endif /* WCHAR */
++#else
++# ifdef WCHAR
++#  define FREE_VARIABLES()						\
++  do {									\
++    if (!cant_free_wcs_buf)						\
++      {									\
++        FREE_VAR (string1);						\
++        FREE_VAR (string2);						\
++        FREE_VAR (mbs_offset1);						\
++        FREE_VAR (mbs_offset2);						\
++      }									\
++  } while (0)
++# else /* BYTE */
++#  define FREE_VARIABLES() ((void)0) /* Do nothing!  But inhibit gcc warning. */
++# endif /* WCHAR */
++#endif /* not MATCH_MAY_ALLOCATE */
++
++/* These values must meet several constraints.  They must not be valid
++   register values; since we have a limit of 255 registers (because
++   we use only one byte in the pattern for the register number), we can
++   use numbers larger than 255.  They must differ by 1, because of
++   NUM_FAILURE_ITEMS above.  And the value for the lowest register must
++   be larger than the value for the highest register, so we do not try
++   to actually save any registers when none are active.  */
++#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH)
++#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1)
++
++#else /* not INSIDE_RECURSION */
++/* Matching routines.  */
++
++#ifndef emacs   /* Emacs never uses this.  */
++/* re_match is like re_match_2 except it takes only a single string.  */
++
++int
++re_match (struct re_pattern_buffer *bufp, const char *string,
++          int size, int pos, struct re_registers *regs)
++{
++  int result;
++# ifdef MBS_SUPPORT
++  if (MB_CUR_MAX != 1)
++    result = wcs_re_match_2_internal (bufp, NULL, 0, string, size,
++				      pos, regs, size,
++				      NULL, 0, NULL, 0, NULL, NULL);
++  else
++# endif
++    result = byte_re_match_2_internal (bufp, NULL, 0, string, size,
++				  pos, regs, size);
++# ifndef REGEX_MALLOC
++#  ifdef C_ALLOCA
++  alloca (0);
++#  endif
++# endif
++  return result;
++}
++# ifdef _LIBC
++weak_alias (__re_match, re_match)
++# endif
++#endif /* not emacs */
++
++#endif /* not INSIDE_RECURSION */
++
++#ifdef INSIDE_RECURSION
++static boolean PREFIX(group_match_null_string_p) (UCHAR_T **p,
++                                                  UCHAR_T *end,
++					PREFIX(register_info_type) *reg_info);
++static boolean PREFIX(alt_match_null_string_p) (UCHAR_T *p,
++                                                UCHAR_T *end,
++					PREFIX(register_info_type) *reg_info);
++static boolean PREFIX(common_op_match_null_string_p) (UCHAR_T **p,
++                                                      UCHAR_T *end,
++					PREFIX(register_info_type) *reg_info);
++static int PREFIX(bcmp_translate) (const CHAR_T *s1, const CHAR_T *s2,
++                                   register int len,
++				   RE_TRANSLATE_TYPE translate);
++#else /* not INSIDE_RECURSION */
++
++/* re_match_2 matches the compiled pattern in BUFP against the
++   the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
++   and SIZE2, respectively).  We start matching at POS, and stop
++   matching at STOP.
++
++   If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
++   store offsets for the substring each group matched in REGS.  See the
++   documentation for exactly how many groups we fill.
++
++   We return -1 if no match, -2 if an internal error (such as the
++   failure stack overflowing).  Otherwise, we return the length of the
++   matched substring.  */
++
++int
++re_match_2 (struct re_pattern_buffer *bufp, const char *string1, int size1,
++            const char *string2, int size2, int pos,
++            struct re_registers *regs, int stop)
++{
++  int result;
++# ifdef MBS_SUPPORT
++  if (MB_CUR_MAX != 1)
++    result = wcs_re_match_2_internal (bufp, string1, size1, string2, size2,
++				      pos, regs, stop,
++				      NULL, 0, NULL, 0, NULL, NULL);
++  else
++# endif
++    result = byte_re_match_2_internal (bufp, string1, size1, string2, size2,
++				  pos, regs, stop);
++
++#ifndef REGEX_MALLOC
++# ifdef C_ALLOCA
++  alloca (0);
++# endif
++#endif
++  return result;
++}
++#ifdef _LIBC
++weak_alias (__re_match_2, re_match_2)
++#endif
++
++#endif /* not INSIDE_RECURSION */
++
++#ifdef INSIDE_RECURSION
++
++#ifdef WCHAR
++static int count_mbs_length (int *, int);
++
++/* This check the substring (from 0, to length) of the multibyte string,
++   to which offset_buffer correspond. And count how many wchar_t_characters
++   the substring occupy. We use offset_buffer to optimization.
++   See convert_mbs_to_wcs.  */
++
++static int
++count_mbs_length(int *offset_buffer, int length)
++{
++  int upper, lower;
++
++  /* Check whether the size is valid.  */
++  if (length < 0)
++    return -1;
++
++  if (offset_buffer == NULL)
++    return 0;
++
++  /* If there are no multibyte character, offset_buffer[i] == i.
++   Optmize for this case.  */
++  if (offset_buffer[length] == length)
++    return length;
++
++  /* Set up upper with length. (because for all i, offset_buffer[i] >= i)  */
++  upper = length;
++  lower = 0;
++
++  while (true)
++    {
++      int middle = (lower + upper) / 2;
++      if (middle == lower || middle == upper)
++	break;
++      if (offset_buffer[middle] > length)
++	upper = middle;
++      else if (offset_buffer[middle] < length)
++	lower = middle;
++      else
++	return middle;
++    }
++
++  return -1;
++}
++#endif /* WCHAR */
++
++/* This is a separate function so that we can force an alloca cleanup
++   afterwards.  */
++#ifdef WCHAR
++static int
++wcs_re_match_2_internal (struct re_pattern_buffer *bufp,
++                         const char *cstring1, int csize1,
++                         const char *cstring2, int csize2,
++                         int pos,
++			 struct re_registers *regs,
++                         int stop,
++     /* string1 == string2 == NULL means string1/2, size1/2 and
++	mbs_offset1/2 need seting up in this function.  */
++     /* We need wchar_t* buffers correspond to cstring1, cstring2.  */
++                         wchar_t *string1, int size1,
++                         wchar_t *string2, int size2,
++     /* offset buffer for optimizatoin. See convert_mbs_to_wc.  */
++			 int *mbs_offset1, int *mbs_offset2)
++#else /* BYTE */
++static int
++byte_re_match_2_internal (struct re_pattern_buffer *bufp,
++                          const char *string1, int size1,
++                          const char *string2, int size2,
++                          int pos,
++			  struct re_registers *regs, int stop)
++#endif /* BYTE */
++{
++  /* General temporaries.  */
++  int mcnt;
++  UCHAR_T *p1;
++#ifdef WCHAR
++  /* They hold whether each wchar_t is binary data or not.  */
++  char *is_binary = NULL;
++  /* If true, we can't free string1/2, mbs_offset1/2.  */
++  int cant_free_wcs_buf = 1;
++#endif /* WCHAR */
++
++  /* Just past the end of the corresponding string.  */
++  const CHAR_T *end1, *end2;
++
++  /* Pointers into string1 and string2, just past the last characters in
++     each to consider matching.  */
++  const CHAR_T *end_match_1, *end_match_2;
++
++  /* Where we are in the data, and the end of the current string.  */
++  const CHAR_T *d, *dend;
++
++  /* Where we are in the pattern, and the end of the pattern.  */
++#ifdef WCHAR
++  UCHAR_T *pattern, *p;
++  register UCHAR_T *pend;
++#else /* BYTE */
++  UCHAR_T *p = bufp->buffer;
++  register UCHAR_T *pend = p + bufp->used;
++#endif /* WCHAR */
++
++  /* Mark the opcode just after a start_memory, so we can test for an
++     empty subpattern when we get to the stop_memory.  */
++  UCHAR_T *just_past_start_mem = 0;
++
++  /* We use this to map every character in the string.  */
++  RE_TRANSLATE_TYPE translate = bufp->translate;
++
++  /* Failure point stack.  Each place that can handle a failure further
++     down the line pushes a failure point on this stack.  It consists of
++     restart, regend, and reg_info for all registers corresponding to
++     the subexpressions we're currently inside, plus the number of such
++     registers, and, finally, two char *'s.  The first char * is where
++     to resume scanning the pattern; the second one is where to resume
++     scanning the strings.  If the latter is zero, the failure point is
++     a ``dummy''; if a failure happens and the failure point is a dummy,
++     it gets discarded and the next next one is tried.  */
++#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global.  */
++  PREFIX(fail_stack_type) fail_stack;
++#endif
++#ifdef DEBUG
++  static unsigned failure_id;
++  unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
++#endif
++
++#ifdef REL_ALLOC
++  /* This holds the pointer to the failure stack, when
++     it is allocated relocatably.  */
++  fail_stack_elt_t *failure_stack_ptr;
++#endif
++
++  /* We fill all the registers internally, independent of what we
++     return, for use in backreferences.  The number here includes
++     an element for register zero.  */
++  size_t num_regs = bufp->re_nsub + 1;
++
++  /* The currently active registers.  */
++  active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG;
++  active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG;
++
++  /* Information on the contents of registers. These are pointers into
++     the input strings; they record just what was matched (on this
++     attempt) by a subexpression part of the pattern, that is, the
++     regnum-th regstart pointer points to where in the pattern we began
++     matching and the regnum-th regend points to right after where we
++     stopped matching the regnum-th subexpression.  (The zeroth register
++     keeps track of what the whole pattern matches.)  */
++#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global.  */
++  const CHAR_T **regstart, **regend;
++#endif
++
++  /* If a group that's operated upon by a repetition operator fails to
++     match anything, then the register for its start will need to be
++     restored because it will have been set to wherever in the string we
++     are when we last see its open-group operator.  Similarly for a
++     register's end.  */
++#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global.  */
++  const CHAR_T **old_regstart, **old_regend;
++#endif
++
++  /* The is_active field of reg_info helps us keep track of which (possibly
++     nested) subexpressions we are currently in. The matched_something
++     field of reg_info[reg_num] helps us tell whether or not we have
++     matched any of the pattern so far this time through the reg_num-th
++     subexpression.  These two fields get reset each time through any
++     loop their register is in.  */
++#ifdef MATCH_MAY_ALLOCATE /* otherwise, this is global.  */
++  PREFIX(register_info_type) *reg_info;
++#endif
++
++  /* The following record the register info as found in the above
++     variables when we find a match better than any we've seen before.
++     This happens as we backtrack through the failure points, which in
++     turn happens only if we have not yet matched the entire string. */
++  unsigned best_regs_set = false;
++#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global.  */
++  const CHAR_T **best_regstart, **best_regend;
++#endif
++
++  /* Logically, this is `best_regend[0]'.  But we don't want to have to
++     allocate space for that if we're not allocating space for anything
++     else (see below).  Also, we never need info about register 0 for
++     any of the other register vectors, and it seems rather a kludge to
++     treat `best_regend' differently than the rest.  So we keep track of
++     the end of the best match so far in a separate variable.  We
++     initialize this to NULL so that when we backtrack the first time
++     and need to test it, it's not garbage.  */
++  const CHAR_T *match_end = NULL;
++
++  /* This helps SET_REGS_MATCHED avoid doing redundant work.  */
++  int set_regs_matched_done = 0;
++
++  /* Used when we pop values we don't care about.  */
++#ifdef MATCH_MAY_ALLOCATE /* otherwise, these are global.  */
++  const CHAR_T **reg_dummy;
++  PREFIX(register_info_type) *reg_info_dummy;
++#endif
++
++#ifdef DEBUG
++  /* Counts the total number of registers pushed.  */
++  unsigned num_regs_pushed = 0;
++#endif
++
++  DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
++
++  INIT_FAIL_STACK ();
++
++#ifdef MATCH_MAY_ALLOCATE
++  /* Do not bother to initialize all the register variables if there are
++     no groups in the pattern, as it takes a fair amount of time.  If
++     there are groups, we include space for register 0 (the whole
++     pattern), even though we never use it, since it simplifies the
++     array indexing.  We should fix this.  */
++  if (bufp->re_nsub)
++    {
++      regstart = REGEX_TALLOC (num_regs, const CHAR_T *);
++      regend = REGEX_TALLOC (num_regs, const CHAR_T *);
++      old_regstart = REGEX_TALLOC (num_regs, const CHAR_T *);
++      old_regend = REGEX_TALLOC (num_regs, const CHAR_T *);
++      best_regstart = REGEX_TALLOC (num_regs, const CHAR_T *);
++      best_regend = REGEX_TALLOC (num_regs, const CHAR_T *);
++      reg_info = REGEX_TALLOC (num_regs, PREFIX(register_info_type));
++      reg_dummy = REGEX_TALLOC (num_regs, const CHAR_T *);
++      reg_info_dummy = REGEX_TALLOC (num_regs, PREFIX(register_info_type));
++
++      if (!(regstart && regend && old_regstart && old_regend && reg_info
++            && best_regstart && best_regend && reg_dummy && reg_info_dummy))
++        {
++          FREE_VARIABLES ();
++          return -2;
++        }
++    }
++  else
++    {
++      /* We must initialize all our variables to NULL, so that
++         `FREE_VARIABLES' doesn't try to free them.  */
++      regstart = regend = old_regstart = old_regend = best_regstart
++        = best_regend = reg_dummy = NULL;
++      reg_info = reg_info_dummy = (PREFIX(register_info_type) *) NULL;
++    }
++#endif /* MATCH_MAY_ALLOCATE */
++
++  /* The starting position is bogus.  */
++#ifdef WCHAR
++  if (pos < 0 || pos > csize1 + csize2)
++#else /* BYTE */
++  if (pos < 0 || pos > size1 + size2)
++#endif
++    {
++      FREE_VARIABLES ();
++      return -1;
++    }
++
++#ifdef WCHAR
++  /* Allocate wchar_t array for string1 and string2 and
++     fill them with converted string.  */
++  if (string1 == NULL && string2 == NULL)
++    {
++      /* We need seting up buffers here.  */
++
++      /* We must free wcs buffers in this function.  */
++      cant_free_wcs_buf = 0;
++
++      if (csize1 != 0)
++	{
++	  string1 = REGEX_TALLOC (csize1 + 1, CHAR_T);
++	  mbs_offset1 = REGEX_TALLOC (csize1 + 1, int);
++	  is_binary = REGEX_TALLOC (csize1 + 1, char);
++	  if (!string1 || !mbs_offset1 || !is_binary)
++	    {
++	      FREE_VAR (string1);
++	      FREE_VAR (mbs_offset1);
++	      FREE_VAR (is_binary);
++	      return -2;
++	    }
++	}
++      if (csize2 != 0)
++	{
++	  string2 = REGEX_TALLOC (csize2 + 1, CHAR_T);
++	  mbs_offset2 = REGEX_TALLOC (csize2 + 1, int);
++	  is_binary = REGEX_TALLOC (csize2 + 1, char);
++	  if (!string2 || !mbs_offset2 || !is_binary)
++	    {
++	      FREE_VAR (string1);
++	      FREE_VAR (mbs_offset1);
++	      FREE_VAR (string2);
++	      FREE_VAR (mbs_offset2);
++	      FREE_VAR (is_binary);
++	      return -2;
++	    }
++	  size2 = convert_mbs_to_wcs(string2, cstring2, csize2,
++				     mbs_offset2, is_binary);
++	  string2[size2] = L'\0'; /* for a sentinel  */
++	  FREE_VAR (is_binary);
++	}
++    }
++
++  /* We need to cast pattern to (wchar_t*), because we casted this compiled
++     pattern to (char*) in regex_compile.  */
++  p = pattern = (CHAR_T*)bufp->buffer;
++  pend = (CHAR_T*)(bufp->buffer + bufp->used);
++
++#endif /* WCHAR */
++
++  /* Initialize subexpression text positions to -1 to mark ones that no
++     start_memory/stop_memory has been seen for. Also initialize the
++     register information struct.  */
++  for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
++    {
++      regstart[mcnt] = regend[mcnt]
++        = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
++
++      REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
++      IS_ACTIVE (reg_info[mcnt]) = 0;
++      MATCHED_SOMETHING (reg_info[mcnt]) = 0;
++      EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
++    }
++
++  /* We move `string1' into `string2' if the latter's empty -- but not if
++     `string1' is null.  */
++  if (size2 == 0 && string1 != NULL)
++    {
++      string2 = string1;
++      size2 = size1;
++      string1 = 0;
++      size1 = 0;
++#ifdef WCHAR
++      mbs_offset2 = mbs_offset1;
++      csize2 = csize1;
++      mbs_offset1 = NULL;
++      csize1 = 0;
++#endif
++    }
++  end1 = string1 + size1;
++  end2 = string2 + size2;
++
++  /* Compute where to stop matching, within the two strings.  */
++#ifdef WCHAR
++  if (stop <= csize1)
++    {
++      mcnt = count_mbs_length(mbs_offset1, stop);
++      end_match_1 = string1 + mcnt;
++      end_match_2 = string2;
++    }
++  else
++    {
++      if (stop > csize1 + csize2)
++	stop = csize1 + csize2;
++      end_match_1 = end1;
++      mcnt = count_mbs_length(mbs_offset2, stop-csize1);
++      end_match_2 = string2 + mcnt;
++    }
++  if (mcnt < 0)
++    { /* count_mbs_length return error.  */
++      FREE_VARIABLES ();
++      return -1;
++    }
++#else
++  if (stop <= size1)
++    {
++      end_match_1 = string1 + stop;
++      end_match_2 = string2;
++    }
++  else
++    {
++      end_match_1 = end1;
++      end_match_2 = string2 + stop - size1;
++    }
++#endif /* WCHAR */
++
++  /* `p' scans through the pattern as `d' scans through the data.
++     `dend' is the end of the input string that `d' points within.  `d'
++     is advanced into the following input string whenever necessary, but
++     this happens before fetching; therefore, at the beginning of the
++     loop, `d' can be pointing at the end of a string, but it cannot
++     equal `string2'.  */
++#ifdef WCHAR
++  if (size1 > 0 && pos <= csize1)
++    {
++      mcnt = count_mbs_length(mbs_offset1, pos);
++      d = string1 + mcnt;
++      dend = end_match_1;
++    }
++  else
++    {
++      mcnt = count_mbs_length(mbs_offset2, pos-csize1);
++      d = string2 + mcnt;
++      dend = end_match_2;
++    }
++
++  if (mcnt < 0)
++    { /* count_mbs_length return error.  */
++      FREE_VARIABLES ();
++      return -1;
++    }
++#else
++  if (size1 > 0 && pos <= size1)
++    {
++      d = string1 + pos;
++      dend = end_match_1;
++    }
++  else
++    {
++      d = string2 + pos - size1;
++      dend = end_match_2;
++    }
++#endif /* WCHAR */
++
++  DEBUG_PRINT1 ("The compiled pattern is:\n");
++  DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
++  DEBUG_PRINT1 ("The string to match is: `");
++  DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
++  DEBUG_PRINT1 ("'\n");
++
++  /* This loops over pattern commands.  It exits by returning from the
++     function if the match is complete, or it drops through if the match
++     fails at this starting point in the input data.  */
++  for (;;)
++    {
++#ifdef _LIBC
++      DEBUG_PRINT2 ("\n%p: ", p);
++#else
++      DEBUG_PRINT2 ("\n0x%x: ", p);
++#endif
++
++      if (p == pend)
++	{ /* End of pattern means we might have succeeded.  */
++          DEBUG_PRINT1 ("end of pattern ... ");
++
++	  /* If we haven't matched the entire string, and we want the
++             longest match, try backtracking.  */
++          if (d != end_match_2)
++	    {
++	      /* 1 if this match ends in the same string (string1 or string2)
++		 as the best previous match.  */
++	      boolean same_str_p = (FIRST_STRING_P (match_end)
++				    == MATCHING_IN_FIRST_STRING);
++	      /* 1 if this match is the best seen so far.  */
++	      boolean best_match_p;
++
++	      /* AIX compiler got confused when this was combined
++		 with the previous declaration.  */
++	      if (same_str_p)
++		best_match_p = d > match_end;
++	      else
++		best_match_p = !MATCHING_IN_FIRST_STRING;
++
++              DEBUG_PRINT1 ("backtracking.\n");
++
++              if (!FAIL_STACK_EMPTY ())
++                { /* More failure points to try.  */
++
++                  /* If exceeds best match so far, save it.  */
++                  if (!best_regs_set || best_match_p)
++                    {
++                      best_regs_set = true;
++                      match_end = d;
++
++                      DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
++
++                      for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
++                        {
++                          best_regstart[mcnt] = regstart[mcnt];
++                          best_regend[mcnt] = regend[mcnt];
++                        }
++                    }
++                  goto fail;
++                }
++
++              /* If no failure points, don't restore garbage.  And if
++                 last match is real best match, don't restore second
++                 best one. */
++              else if (best_regs_set && !best_match_p)
++                {
++  	        restore_best_regs:
++                  /* Restore best match.  It may happen that `dend ==
++                     end_match_1' while the restored d is in string2.
++                     For example, the pattern `x.*y.*z' against the
++                     strings `x-' and `y-z-', if the two strings are
++                     not consecutive in memory.  */
++                  DEBUG_PRINT1 ("Restoring best registers.\n");
++
++                  d = match_end;
++                  dend = ((d >= string1 && d <= end1)
++		           ? end_match_1 : end_match_2);
++
++		  for (mcnt = 1; (unsigned) mcnt < num_regs; mcnt++)
++		    {
++		      regstart[mcnt] = best_regstart[mcnt];
++		      regend[mcnt] = best_regend[mcnt];
++		    }
++                }
++            } /* d != end_match_2 */
++
++	succeed_label:
++          DEBUG_PRINT1 ("Accepting match.\n");
++          /* If caller wants register contents data back, do it.  */
++          if (regs && !bufp->no_sub)
++	    {
++	      /* Have the register data arrays been allocated?  */
++              if (bufp->regs_allocated == REGS_UNALLOCATED)
++                { /* No.  So allocate them with malloc.  We need one
++                     extra element beyond `num_regs' for the `-1' marker
++                     GNU code uses.  */
++                  regs->num_regs = MAX (RE_NREGS, num_regs + 1);
++                  regs->start = TALLOC (regs->num_regs, regoff_t);
++                  regs->end = TALLOC (regs->num_regs, regoff_t);
++                  if (regs->start == NULL || regs->end == NULL)
++		    {
++		      FREE_VARIABLES ();
++		      return -2;
++		    }
++                  bufp->regs_allocated = REGS_REALLOCATE;
++                }
++              else if (bufp->regs_allocated == REGS_REALLOCATE)
++                { /* Yes.  If we need more elements than were already
++                     allocated, reallocate them.  If we need fewer, just
++                     leave it alone.  */
++                  if (regs->num_regs < num_regs + 1)
++                    {
++                      regs->num_regs = num_regs + 1;
++                      RETALLOC (regs->start, regs->num_regs, regoff_t);
++                      RETALLOC (regs->end, regs->num_regs, regoff_t);
++                      if (regs->start == NULL || regs->end == NULL)
++			{
++			  FREE_VARIABLES ();
++			  return -2;
++			}
++                    }
++                }
++              else
++		{
++		  /* These braces fend off a "empty body in an else-statement"
++		     warning under GCC when assert expands to nothing.  */
++		  assert (bufp->regs_allocated == REGS_FIXED);
++		}
++
++              /* Convert the pointer data in `regstart' and `regend' to
++                 indices.  Register zero has to be set differently,
++                 since we haven't kept track of any info for it.  */
++              if (regs->num_regs > 0)
++                {
++                  regs->start[0] = pos;
++#ifdef WCHAR
++		  if (MATCHING_IN_FIRST_STRING)
++		    regs->end[0] = mbs_offset1 != NULL ?
++					mbs_offset1[d-string1] : 0;
++		  else
++		    regs->end[0] = csize1 + (mbs_offset2 != NULL ?
++					     mbs_offset2[d-string2] : 0);
++#else
++                  regs->end[0] = (MATCHING_IN_FIRST_STRING
++				  ? ((regoff_t) (d - string1))
++			          : ((regoff_t) (d - string2 + size1)));
++#endif /* WCHAR */
++                }
++
++              /* Go through the first `min (num_regs, regs->num_regs)'
++                 registers, since that is all we initialized.  */
++	      for (mcnt = 1; (unsigned) mcnt < MIN (num_regs, regs->num_regs);
++		   mcnt++)
++		{
++                  if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt]))
++                    regs->start[mcnt] = regs->end[mcnt] = -1;
++                  else
++                    {
++		      regs->start[mcnt]
++			= (regoff_t) POINTER_TO_OFFSET (regstart[mcnt]);
++                      regs->end[mcnt]
++			= (regoff_t) POINTER_TO_OFFSET (regend[mcnt]);
++                    }
++		}
++
++              /* If the regs structure we return has more elements than
++                 were in the pattern, set the extra elements to -1.  If
++                 we (re)allocated the registers, this is the case,
++                 because we always allocate enough to have at least one
++                 -1 at the end.  */
++              for (mcnt = num_regs; (unsigned) mcnt < regs->num_regs; mcnt++)
++                regs->start[mcnt] = regs->end[mcnt] = -1;
++	    } /* regs && !bufp->no_sub */
++
++          DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n",
++                        nfailure_points_pushed, nfailure_points_popped,
++                        nfailure_points_pushed - nfailure_points_popped);
++          DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
++
++#ifdef WCHAR
++	  if (MATCHING_IN_FIRST_STRING)
++	    mcnt = mbs_offset1 != NULL ? mbs_offset1[d-string1] : 0;
++	  else
++	    mcnt = (mbs_offset2 != NULL ? mbs_offset2[d-string2] : 0) +
++			csize1;
++          mcnt -= pos;
++#else
++          mcnt = d - pos - (MATCHING_IN_FIRST_STRING
++			    ? string1
++			    : string2 - size1);
++#endif /* WCHAR */
++
++          DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
++
++          FREE_VARIABLES ();
++          return mcnt;
++        }
++
++      /* Otherwise match next pattern command.  */
++      switch (SWITCH_ENUM_CAST ((re_opcode_t) *p++))
++	{
++        /* Ignore these.  Used to ignore the n of succeed_n's which
++           currently have n == 0.  */
++        case no_op:
++          DEBUG_PRINT1 ("EXECUTING no_op.\n");
++          break;
++
++	case succeed:
++          DEBUG_PRINT1 ("EXECUTING succeed.\n");
++	  goto succeed_label;
++
++        /* Match the next n pattern characters exactly.  The following
++           byte in the pattern defines n, and the n bytes after that
++           are the characters to match.  */
++	case exactn:
++#ifdef MBS_SUPPORT
++	case exactn_bin:
++#endif
++	  mcnt = *p++;
++          DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt);
++
++          /* This is written out as an if-else so we don't waste time
++             testing `translate' inside the loop.  */
++          if (translate)
++	    {
++	      do
++		{
++		  PREFETCH ();
++#ifdef WCHAR
++		  if (*d <= 0xff)
++		    {
++		      if ((UCHAR_T) translate[(unsigned char) *d++]
++			  != (UCHAR_T) *p++)
++			goto fail;
++		    }
++		  else
++		    {
++		      if (*d++ != (CHAR_T) *p++)
++			goto fail;
++		    }
++#else
++		  if ((UCHAR_T) translate[(unsigned char) *d++]
++		      != (UCHAR_T) *p++)
++                    goto fail;
++#endif /* WCHAR */
++		}
++	      while (--mcnt);
++	    }
++	  else
++	    {
++	      do
++		{
++		  PREFETCH ();
++		  if (*d++ != (CHAR_T) *p++) goto fail;
++		}
++	      while (--mcnt);
++	    }
++	  SET_REGS_MATCHED ();
++          break;
++
++
++        /* Match any character except possibly a newline or a null.  */
++	case anychar:
++          DEBUG_PRINT1 ("EXECUTING anychar.\n");
++
++          PREFETCH ();
++
++          if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n')
++              || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000'))
++	    goto fail;
++
++          SET_REGS_MATCHED ();
++          DEBUG_PRINT2 ("  Matched `%ld'.\n", (long int) *d);
++          d++;
++	  break;
++
++
++	case charset:
++	case charset_not:
++	  {
++	    register UCHAR_T c;
++#ifdef WCHAR
++	    unsigned int i, char_class_length, coll_symbol_length,
++              equiv_class_length, ranges_length, chars_length, length;
++	    CHAR_T *workp, *workp2, *charset_top;
++#define WORK_BUFFER_SIZE 128
++            CHAR_T str_buf[WORK_BUFFER_SIZE];
++# ifdef _LIBC
++	    uint32_t nrules;
++# endif /* _LIBC */
++#endif /* WCHAR */
++	    boolean negate = (re_opcode_t) *(p - 1) == charset_not;
++
++            DEBUG_PRINT2 ("EXECUTING charset%s.\n", negate ? "_not" : "");
++	    PREFETCH ();
++	    c = TRANSLATE (*d); /* The character to match.  */
++#ifdef WCHAR
++# ifdef _LIBC
++	    nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
++# endif /* _LIBC */
++	    charset_top = p - 1;
++	    char_class_length = *p++;
++	    coll_symbol_length = *p++;
++	    equiv_class_length = *p++;
++	    ranges_length = *p++;
++	    chars_length = *p++;
++	    /* p points charset[6], so the address of the next instruction
++	       (charset[l+m+n+2o+k+p']) equals p[l+m+n+2*o+p'],
++	       where l=length of char_classes, m=length of collating_symbol,
++	       n=equivalence_class, o=length of char_range,
++	       p'=length of character.  */
++	    workp = p;
++	    /* Update p to indicate the next instruction.  */
++	    p += char_class_length + coll_symbol_length+ equiv_class_length +
++              2*ranges_length + chars_length;
++
++            /* match with char_class?  */
++	    for (i = 0; i < char_class_length ; i += CHAR_CLASS_SIZE)
++	      {
++		wctype_t wctype;
++		uintptr_t alignedp = ((uintptr_t)workp
++				      + __alignof__(wctype_t) - 1)
++		  		      & ~(uintptr_t)(__alignof__(wctype_t) - 1);
++		wctype = *((wctype_t*)alignedp);
++		workp += CHAR_CLASS_SIZE;
++# ifdef _LIBC
++		if (__iswctype((wint_t)c, wctype))
++		  goto char_set_matched;
++# else
++		if (iswctype((wint_t)c, wctype))
++		  goto char_set_matched;
++# endif
++	      }
++
++            /* match with collating_symbol?  */
++# ifdef _LIBC
++	    if (nrules != 0)
++	      {
++		const unsigned char *extra = (const unsigned char *)
++		  _NL_CURRENT (LC_COLLATE, _NL_COLLATE_SYMB_EXTRAMB);
++
++		for (workp2 = workp + coll_symbol_length ; workp < workp2 ;
++		     workp++)
++		  {
++		    int32_t *wextra;
++		    wextra = (int32_t*)(extra + *workp++);
++		    for (i = 0; i < *wextra; ++i)
++		      if (TRANSLATE(d[i]) != wextra[1 + i])
++			break;
++
++		    if (i == *wextra)
++		      {
++			/* Update d, however d will be incremented at
++			   char_set_matched:, we decrement d here.  */
++			d += i - 1;
++			goto char_set_matched;
++		      }
++		  }
++	      }
++	    else /* (nrules == 0) */
++# endif
++	      /* If we can't look up collation data, we use wcscoll
++		 instead.  */
++	      {
++		for (workp2 = workp + coll_symbol_length ; workp < workp2 ;)
++		  {
++		    const CHAR_T *backup_d = d, *backup_dend = dend;
++# ifdef _LIBC
++		    length = __wcslen (workp);
++# else
++		    length = wcslen (workp);
++# endif
++
++		    /* If wcscoll(the collating symbol, whole string) > 0,
++		       any substring of the string never match with the
++		       collating symbol.  */
++# ifdef _LIBC
++		    if (__wcscoll (workp, d) > 0)
++# else
++		    if (wcscoll (workp, d) > 0)
++# endif
++		      {
++			workp += length + 1;
++			continue;
++		      }
++
++		    /* First, we compare the collating symbol with
++		       the first character of the string.
++		       If it don't match, we add the next character to
++		       the compare buffer in turn.  */
++		    for (i = 0 ; i < WORK_BUFFER_SIZE-1 ; i++, d++)
++		      {
++			int match;
++			if (d == dend)
++			  {
++			    if (dend == end_match_2)
++			      break;
++			    d = string2;
++			    dend = end_match_2;
++			  }
++
++			/* add next character to the compare buffer.  */
++			str_buf[i] = TRANSLATE(*d);
++			str_buf[i+1] = '\0';
++
++# ifdef _LIBC
++			match = __wcscoll (workp, str_buf);
++# else
++			match = wcscoll (workp, str_buf);
++# endif
++			if (match == 0)
++			  goto char_set_matched;
++
++			if (match < 0)
++			  /* (str_buf > workp) indicate (str_buf + X > workp),
++			     because for all X (str_buf + X > str_buf).
++			     So we don't need continue this loop.  */
++			  break;
++
++			/* Otherwise(str_buf < workp),
++			   (str_buf+next_character) may equals (workp).
++			   So we continue this loop.  */
++		      }
++		    /* not matched */
++		    d = backup_d;
++		    dend = backup_dend;
++		    workp += length + 1;
++		  }
++              }
++            /* match with equivalence_class?  */
++# ifdef _LIBC
++	    if (nrules != 0)
++	      {
++                const CHAR_T *backup_d = d, *backup_dend = dend;
++		/* Try to match the equivalence class against
++		   those known to the collate implementation.  */
++		const int32_t *table;
++		const int32_t *weights;
++		const int32_t *extra;
++		const int32_t *indirect;
++		int32_t idx, idx2;
++		wint_t *cp;
++		size_t len;
++
++		table = (const int32_t *)
++		  _NL_CURRENT (LC_COLLATE, _NL_COLLATE_TABLEWC);
++		weights = (const wint_t *)
++		  _NL_CURRENT (LC_COLLATE, _NL_COLLATE_WEIGHTWC);
++		extra = (const wint_t *)
++		  _NL_CURRENT (LC_COLLATE, _NL_COLLATE_EXTRAWC);
++		indirect = (const int32_t *)
++		  _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTWC);
++
++		/* Write 1 collating element to str_buf, and
++		   get its index.  */
++		idx2 = 0;
++
++		for (i = 0 ; idx2 == 0 && i < WORK_BUFFER_SIZE - 1; i++)
++		  {
++		    cp = (wint_t*)str_buf;
++		    if (d == dend)
++		      {
++			if (dend == end_match_2)
++			  break;
++			d = string2;
++			dend = end_match_2;
++		      }
++		    str_buf[i] = TRANSLATE(*(d+i));
++		    str_buf[i+1] = '\0'; /* sentinel */
++		    idx2 = FINDIDX (table, indirect, extra, &cp, 1);
++		  }
++
++		/* Update d, however d will be incremented at
++		   char_set_matched:, we decrement d here.  */
++		d = backup_d + ((wchar_t*)cp - (wchar_t*)str_buf - 1);
++		if (d >= dend)
++		  {
++		    if (dend == end_match_2)
++			d = dend;
++		    else
++		      {
++			d = string2;
++			dend = end_match_2;
++		      }
++		  }
++
++		len = weights[idx2];
++
++		for (workp2 = workp + equiv_class_length ; workp < workp2 ;
++		     workp++)
++		  {
++		    idx = (int32_t)*workp;
++		    /* We already checked idx != 0 in regex_compile. */
++
++		    if (idx2 != 0 && len == weights[idx])
++		      {
++			int cnt = 0;
++			while (cnt < len && (weights[idx + 1 + cnt]
++					     == weights[idx2 + 1 + cnt]))
++			  ++cnt;
++
++			if (cnt == len)
++			  goto char_set_matched;
++		      }
++		  }
++		/* not matched */
++                d = backup_d;
++                dend = backup_dend;
++	      }
++	    else /* (nrules == 0) */
++# endif
++	      /* If we can't look up collation data, we use wcscoll
++		 instead.  */
++	      {
++		for (workp2 = workp + equiv_class_length ; workp < workp2 ;)
++		  {
++		    const CHAR_T *backup_d = d, *backup_dend = dend;
++# ifdef _LIBC
++		    length = __wcslen (workp);
++# else
++		    length = wcslen (workp);
++# endif
++
++		    /* If wcscoll(the collating symbol, whole string) > 0,
++		       any substring of the string never match with the
++		       collating symbol.  */
++# ifdef _LIBC
++		    if (__wcscoll (workp, d) > 0)
++# else
++		    if (wcscoll (workp, d) > 0)
++# endif
++		      {
++			workp += length + 1;
++			break;
++		      }
++
++		    /* First, we compare the equivalence class with
++		       the first character of the string.
++		       If it don't match, we add the next character to
++		       the compare buffer in turn.  */
++		    for (i = 0 ; i < WORK_BUFFER_SIZE - 1 ; i++, d++)
++		      {
++			int match;
++			if (d == dend)
++			  {
++			    if (dend == end_match_2)
++			      break;
++			    d = string2;
++			    dend = end_match_2;
++			  }
++
++			/* add next character to the compare buffer.  */
++			str_buf[i] = TRANSLATE(*d);
++			str_buf[i+1] = '\0';
++
++# ifdef _LIBC
++			match = __wcscoll (workp, str_buf);
++# else
++			match = wcscoll (workp, str_buf);
++# endif
++
++			if (match == 0)
++			  goto char_set_matched;
++
++			if (match < 0)
++			/* (str_buf > workp) indicate (str_buf + X > workp),
++			   because for all X (str_buf + X > str_buf).
++			   So we don't need continue this loop.  */
++			  break;
++
++			/* Otherwise(str_buf < workp),
++			   (str_buf+next_character) may equals (workp).
++			   So we continue this loop.  */
++		      }
++		    /* not matched */
++		    d = backup_d;
++		    dend = backup_dend;
++		    workp += length + 1;
++		  }
++	      }
++
++            /* match with char_range?  */
++# ifdef _LIBC
++	    if (nrules != 0)
++	      {
++		uint32_t collseqval;
++		const char *collseq = (const char *)
++		  _NL_CURRENT(LC_COLLATE, _NL_COLLATE_COLLSEQWC);
++
++		collseqval = collseq_table_lookup (collseq, c);
++
++		for (; workp < p - chars_length ;)
++		  {
++		    uint32_t start_val, end_val;
++
++		    /* We already compute the collation sequence value
++		       of the characters (or collating symbols).  */
++		    start_val = (uint32_t) *workp++; /* range_start */
++		    end_val = (uint32_t) *workp++; /* range_end */
++
++		    if (start_val <= collseqval && collseqval <= end_val)
++		      goto char_set_matched;
++		  }
++	      }
++	    else
++# endif
++	      {
++		/* We set range_start_char at str_buf[0], range_end_char
++		   at str_buf[4], and compared char at str_buf[2].  */
++		str_buf[1] = 0;
++		str_buf[2] = c;
++		str_buf[3] = 0;
++		str_buf[5] = 0;
++		for (; workp < p - chars_length ;)
++		  {
++		    wchar_t *range_start_char, *range_end_char;
++
++		    /* match if (range_start_char <= c <= range_end_char).  */
++
++		    /* If range_start(or end) < 0, we assume -range_start(end)
++		       is the offset of the collating symbol which is specified
++		       as the character of the range start(end).  */
++
++		    /* range_start */
++		    if (*workp < 0)
++		      range_start_char = charset_top - (*workp++);
++		    else
++		      {
++			str_buf[0] = *workp++;
++			range_start_char = str_buf;
++		      }
++
++		    /* range_end */
++		    if (*workp < 0)
++		      range_end_char = charset_top - (*workp++);
++		    else
++		      {
++			str_buf[4] = *workp++;
++			range_end_char = str_buf + 4;
++		      }
++
++# ifdef _LIBC
++		    if (__wcscoll (range_start_char, str_buf+2) <= 0
++			&& __wcscoll (str_buf+2, range_end_char) <= 0)
++# else
++		    if (wcscoll (range_start_char, str_buf+2) <= 0
++			&& wcscoll (str_buf+2, range_end_char) <= 0)
++# endif
++		      goto char_set_matched;
++		  }
++	      }
++
++            /* match with char?  */
++	    for (; workp < p ; workp++)
++	      if (c == *workp)
++		goto char_set_matched;
++
++	    negate = !negate;
++
++	  char_set_matched:
++	    if (negate) goto fail;
++#else
++            /* Cast to `unsigned' instead of `unsigned char' in case the
++               bit list is a full 32 bytes long.  */
++	    if (c < (unsigned) (*p * BYTEWIDTH)
++		&& p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
++	      negate = !negate;
++
++	    p += 1 + *p;
++
++	    if (!negate) goto fail;
++#undef WORK_BUFFER_SIZE
++#endif /* WCHAR */
++	    SET_REGS_MATCHED ();
++            d++;
++	    break;
++	  }
++
++
++        /* The beginning of a group is represented by start_memory.
++           The arguments are the register number in the next byte, and the
++           number of groups inner to this one in the next.  The text
++           matched within the group is recorded (in the internal
++           registers data structure) under the register number.  */
++        case start_memory:
++	  DEBUG_PRINT3 ("EXECUTING start_memory %ld (%ld):\n",
++			(long int) *p, (long int) p[1]);
++
++          /* Find out if this group can match the empty string.  */
++	  p1 = p;		/* To send to group_match_null_string_p.  */
++
++          if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
++            REG_MATCH_NULL_STRING_P (reg_info[*p])
++              = PREFIX(group_match_null_string_p) (&p1, pend, reg_info);
++
++          /* Save the position in the string where we were the last time
++             we were at this open-group operator in case the group is
++             operated upon by a repetition operator, e.g., with `(a*)*b'
++             against `ab'; then we want to ignore where we are now in
++             the string in case this attempt to match fails.  */
++          old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
++                             ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
++                             : regstart[*p];
++	  DEBUG_PRINT2 ("  old_regstart: %d\n",
++			 POINTER_TO_OFFSET (old_regstart[*p]));
++
++          regstart[*p] = d;
++	  DEBUG_PRINT2 ("  regstart: %d\n", POINTER_TO_OFFSET (regstart[*p]));
++
++          IS_ACTIVE (reg_info[*p]) = 1;
++          MATCHED_SOMETHING (reg_info[*p]) = 0;
++
++	  /* Clear this whenever we change the register activity status.  */
++	  set_regs_matched_done = 0;
++
++          /* This is the new highest active register.  */
++          highest_active_reg = *p;
++
++          /* If nothing was active before, this is the new lowest active
++             register.  */
++          if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
++            lowest_active_reg = *p;
++
++          /* Move past the register number and inner group count.  */
++          p += 2;
++	  just_past_start_mem = p;
++
++          break;
++
++
++        /* The stop_memory opcode represents the end of a group.  Its
++           arguments are the same as start_memory's: the register
++           number, and the number of inner groups.  */
++	case stop_memory:
++	  DEBUG_PRINT3 ("EXECUTING stop_memory %ld (%ld):\n",
++			(long int) *p, (long int) p[1]);
++
++          /* We need to save the string position the last time we were at
++             this close-group operator in case the group is operated
++             upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
++             against `aba'; then we want to ignore where we are now in
++             the string in case this attempt to match fails.  */
++          old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
++                           ? REG_UNSET (regend[*p]) ? d : regend[*p]
++			   : regend[*p];
++	  DEBUG_PRINT2 ("      old_regend: %d\n",
++			 POINTER_TO_OFFSET (old_regend[*p]));
++
++          regend[*p] = d;
++	  DEBUG_PRINT2 ("      regend: %d\n", POINTER_TO_OFFSET (regend[*p]));
++
++          /* This register isn't active anymore.  */
++          IS_ACTIVE (reg_info[*p]) = 0;
++
++	  /* Clear this whenever we change the register activity status.  */
++	  set_regs_matched_done = 0;
++
++          /* If this was the only register active, nothing is active
++             anymore.  */
++          if (lowest_active_reg == highest_active_reg)
++            {
++              lowest_active_reg = NO_LOWEST_ACTIVE_REG;
++              highest_active_reg = NO_HIGHEST_ACTIVE_REG;
++            }
++          else
++            { /* We must scan for the new highest active register, since
++                 it isn't necessarily one less than now: consider
++                 (a(b)c(d(e)f)g).  When group 3 ends, after the f), the
++                 new highest active register is 1.  */
++              UCHAR_T r = *p - 1;
++              while (r > 0 && !IS_ACTIVE (reg_info[r]))
++                r--;
++
++              /* If we end up at register zero, that means that we saved
++                 the registers as the result of an `on_failure_jump', not
++                 a `start_memory', and we jumped to past the innermost
++                 `stop_memory'.  For example, in ((.)*) we save
++                 registers 1 and 2 as a result of the *, but when we pop
++                 back to the second ), we are at the stop_memory 1.
++                 Thus, nothing is active.  */
++	      if (r == 0)
++                {
++                  lowest_active_reg = NO_LOWEST_ACTIVE_REG;
++                  highest_active_reg = NO_HIGHEST_ACTIVE_REG;
++                }
++              else
++                highest_active_reg = r;
++            }
++
++          /* If just failed to match something this time around with a
++             group that's operated on by a repetition operator, try to
++             force exit from the ``loop'', and restore the register
++             information for this group that we had before trying this
++             last match.  */
++          if ((!MATCHED_SOMETHING (reg_info[*p])
++               || just_past_start_mem == p - 1)
++	      && (p + 2) < pend)
++            {
++              boolean is_a_jump_n = false;
++
++              p1 = p + 2;
++              mcnt = 0;
++              switch ((re_opcode_t) *p1++)
++                {
++                  case jump_n:
++		    is_a_jump_n = true;
++                  case pop_failure_jump:
++		  case maybe_pop_jump:
++		  case jump:
++		  case dummy_failure_jump:
++                    EXTRACT_NUMBER_AND_INCR (mcnt, p1);
++		    if (is_a_jump_n)
++		      p1 += OFFSET_ADDRESS_SIZE;
++                    break;
++
++                  default:
++                    /* do nothing */ ;
++                }
++	      p1 += mcnt;
++
++              /* If the next operation is a jump backwards in the pattern
++	         to an on_failure_jump right before the start_memory
++                 corresponding to this stop_memory, exit from the loop
++                 by forcing a failure after pushing on the stack the
++                 on_failure_jump's jump in the pattern, and d.  */
++              if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump
++                  && (re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == start_memory
++		  && p1[2+OFFSET_ADDRESS_SIZE] == *p)
++		{
++                  /* If this group ever matched anything, then restore
++                     what its registers were before trying this last
++                     failed match, e.g., with `(a*)*b' against `ab' for
++                     regstart[1], and, e.g., with `((a*)*(b*)*)*'
++                     against `aba' for regend[3].
++
++                     Also restore the registers for inner groups for,
++                     e.g., `((a*)(b*))*' against `aba' (register 3 would
++                     otherwise get trashed).  */
++
++                  if (EVER_MATCHED_SOMETHING (reg_info[*p]))
++		    {
++		      unsigned r;
++
++                      EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
++
++		      /* Restore this and inner groups' (if any) registers.  */
++                      for (r = *p; r < (unsigned) *p + (unsigned) *(p + 1);
++			   r++)
++                        {
++                          regstart[r] = old_regstart[r];
++
++                          /* xx why this test?  */
++                          if (old_regend[r] >= regstart[r])
++                            regend[r] = old_regend[r];
++                        }
++                    }
++		  p1++;
++                  EXTRACT_NUMBER_AND_INCR (mcnt, p1);
++                  PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
++
++                  goto fail;
++                }
++            }
++
++          /* Move past the register number and the inner group count.  */
++          p += 2;
++          break;
++
++
++	/* \<digit> has been turned into a `duplicate' command which is
++           followed by the numeric value of <digit> as the register number.  */
++        case duplicate:
++	  {
++	    register const CHAR_T *d2, *dend2;
++	    int regno = *p++;   /* Get which register to match against.  */
++	    DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno);
++
++	    /* Can't back reference a group which we've never matched.  */
++            if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
++              goto fail;
++
++            /* Where in input to try to start matching.  */
++            d2 = regstart[regno];
++
++            /* Where to stop matching; if both the place to start and
++               the place to stop matching are in the same string, then
++               set to the place to stop, otherwise, for now have to use
++               the end of the first string.  */
++
++            dend2 = ((FIRST_STRING_P (regstart[regno])
++		      == FIRST_STRING_P (regend[regno]))
++		     ? regend[regno] : end_match_1);
++	    for (;;)
++	      {
++		/* If necessary, advance to next segment in register
++                   contents.  */
++		while (d2 == dend2)
++		  {
++		    if (dend2 == end_match_2) break;
++		    if (dend2 == regend[regno]) break;
++
++                    /* End of string1 => advance to string2. */
++                    d2 = string2;
++                    dend2 = regend[regno];
++		  }
++		/* At end of register contents => success */
++		if (d2 == dend2) break;
++
++		/* If necessary, advance to next segment in data.  */
++		PREFETCH ();
++
++		/* How many characters left in this segment to match.  */
++		mcnt = dend - d;
++
++		/* Want how many consecutive characters we can match in
++                   one shot, so, if necessary, adjust the count.  */
++                if (mcnt > dend2 - d2)
++		  mcnt = dend2 - d2;
++
++		/* Compare that many; failure if mismatch, else move
++                   past them.  */
++		if (translate
++                    ? PREFIX(bcmp_translate) (d, d2, mcnt, translate)
++                    : memcmp (d, d2, mcnt*sizeof(UCHAR_T)))
++		  goto fail;
++		d += mcnt, d2 += mcnt;
++
++		/* Do this because we've match some characters.  */
++		SET_REGS_MATCHED ();
++	      }
++	  }
++	  break;
++
++
++        /* begline matches the empty string at the beginning of the string
++           (unless `not_bol' is set in `bufp'), and, if
++           `newline_anchor' is set, after newlines.  */
++	case begline:
++          DEBUG_PRINT1 ("EXECUTING begline.\n");
++
++          if (AT_STRINGS_BEG (d))
++            {
++              if (!bufp->not_bol) break;
++            }
++          else if (d[-1] == '\n' && bufp->newline_anchor)
++            {
++              break;
++            }
++          /* In all other cases, we fail.  */
++          goto fail;
++
++
++        /* endline is the dual of begline.  */
++	case endline:
++          DEBUG_PRINT1 ("EXECUTING endline.\n");
++
++          if (AT_STRINGS_END (d))
++            {
++              if (!bufp->not_eol) break;
++            }
++
++          /* We have to ``prefetch'' the next character.  */
++          else if ((d == end1 ? *string2 : *d) == '\n'
++                   && bufp->newline_anchor)
++            {
++              break;
++            }
++          goto fail;
++
++
++	/* Match at the very beginning of the data.  */
++        case begbuf:
++          DEBUG_PRINT1 ("EXECUTING begbuf.\n");
++          if (AT_STRINGS_BEG (d))
++            break;
++          goto fail;
++
++
++	/* Match at the very end of the data.  */
++        case endbuf:
++          DEBUG_PRINT1 ("EXECUTING endbuf.\n");
++	  if (AT_STRINGS_END (d))
++	    break;
++          goto fail;
++
++
++        /* on_failure_keep_string_jump is used to optimize `.*\n'.  It
++           pushes NULL as the value for the string on the stack.  Then
++           `pop_failure_point' will keep the current value for the
++           string, instead of restoring it.  To see why, consider
++           matching `foo\nbar' against `.*\n'.  The .* matches the foo;
++           then the . fails against the \n.  But the next thing we want
++           to do is match the \n against the \n; if we restored the
++           string value, we would be back at the foo.
++
++           Because this is used only in specific cases, we don't need to
++           check all the things that `on_failure_jump' does, to make
++           sure the right things get saved on the stack.  Hence we don't
++           share its code.  The only reason to push anything on the
++           stack at all is that otherwise we would have to change
++           `anychar's code to do something besides goto fail in this
++           case; that seems worse than this.  */
++        case on_failure_keep_string_jump:
++          DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
++
++          EXTRACT_NUMBER_AND_INCR (mcnt, p);
++#ifdef _LIBC
++          DEBUG_PRINT3 (" %d (to %p):\n", mcnt, p + mcnt);
++#else
++          DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
++#endif
++
++          PUSH_FAILURE_POINT (p + mcnt, NULL, -2);
++          break;
++
++
++	/* Uses of on_failure_jump:
++
++           Each alternative starts with an on_failure_jump that points
++           to the beginning of the next alternative.  Each alternative
++           except the last ends with a jump that in effect jumps past
++           the rest of the alternatives.  (They really jump to the
++           ending jump of the following alternative, because tensioning
++           these jumps is a hassle.)
++
++           Repeats start with an on_failure_jump that points past both
++           the repetition text and either the following jump or
++           pop_failure_jump back to this on_failure_jump.  */
++	case on_failure_jump:
++        on_failure:
++          DEBUG_PRINT1 ("EXECUTING on_failure_jump");
++
++          EXTRACT_NUMBER_AND_INCR (mcnt, p);
++#ifdef _LIBC
++          DEBUG_PRINT3 (" %d (to %p)", mcnt, p + mcnt);
++#else
++          DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt);
++#endif
++
++          /* If this on_failure_jump comes right before a group (i.e.,
++             the original * applied to a group), save the information
++             for that group and all inner ones, so that if we fail back
++             to this point, the group's information will be correct.
++             For example, in \(a*\)*\1, we need the preceding group,
++             and in \(zz\(a*\)b*\)\2, we need the inner group.  */
++
++          /* We can't use `p' to check ahead because we push
++             a failure point to `p + mcnt' after we do this.  */
++          p1 = p;
++
++          /* We need to skip no_op's before we look for the
++             start_memory in case this on_failure_jump is happening as
++             the result of a completed succeed_n, as in \(a\)\{1,3\}b\1
++             against aba.  */
++          while (p1 < pend && (re_opcode_t) *p1 == no_op)
++            p1++;
++
++          if (p1 < pend && (re_opcode_t) *p1 == start_memory)
++            {
++              /* We have a new highest active register now.  This will
++                 get reset at the start_memory we are about to get to,
++                 but we will have saved all the registers relevant to
++                 this repetition op, as described above.  */
++              highest_active_reg = *(p1 + 1) + *(p1 + 2);
++              if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
++                lowest_active_reg = *(p1 + 1);
++            }
++
++          DEBUG_PRINT1 (":\n");
++          PUSH_FAILURE_POINT (p + mcnt, d, -2);
++          break;
++
++
++        /* A smart repeat ends with `maybe_pop_jump'.
++	   We change it to either `pop_failure_jump' or `jump'.  */
++        case maybe_pop_jump:
++          EXTRACT_NUMBER_AND_INCR (mcnt, p);
++          DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt);
++          {
++	    register UCHAR_T *p2 = p;
++
++            /* Compare the beginning of the repeat with what in the
++               pattern follows its end. If we can establish that there
++               is nothing that they would both match, i.e., that we
++               would have to backtrack because of (as in, e.g., `a*a')
++               then we can change to pop_failure_jump, because we'll
++               never have to backtrack.
++
++               This is not true in the case of alternatives: in
++               `(a|ab)*' we do need to backtrack to the `ab' alternative
++               (e.g., if the string was `ab').  But instead of trying to
++               detect that here, the alternative has put on a dummy
++               failure point which is what we will end up popping.  */
++
++	    /* Skip over open/close-group commands.
++	       If what follows this loop is a ...+ construct,
++	       look at what begins its body, since we will have to
++	       match at least one of that.  */
++	    while (1)
++	      {
++		if (p2 + 2 < pend
++		    && ((re_opcode_t) *p2 == stop_memory
++			|| (re_opcode_t) *p2 == start_memory))
++		  p2 += 3;
++		else if (p2 + 2 + 2 * OFFSET_ADDRESS_SIZE < pend
++			 && (re_opcode_t) *p2 == dummy_failure_jump)
++		  p2 += 2 + 2 * OFFSET_ADDRESS_SIZE;
++		else
++		  break;
++	      }
++
++	    p1 = p + mcnt;
++	    /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
++	       to the `maybe_finalize_jump' of this case.  Examine what
++	       follows.  */
++
++            /* If we're at the end of the pattern, we can change.  */
++            if (p2 == pend)
++	      {
++		/* Consider what happens when matching ":\(.*\)"
++		   against ":/".  I don't really understand this code
++		   yet.  */
++  	        p[-(1+OFFSET_ADDRESS_SIZE)] = (UCHAR_T)
++		  pop_failure_jump;
++                DEBUG_PRINT1
++                  ("  End of pattern: change to `pop_failure_jump'.\n");
++              }
++
++            else if ((re_opcode_t) *p2 == exactn
++#ifdef MBS_SUPPORT
++		     || (re_opcode_t) *p2 == exactn_bin
++#endif
++		     || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
++	      {
++		register UCHAR_T c
++                  = *p2 == (UCHAR_T) endline ? '\n' : p2[2];
++
++                if (((re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == exactn
++#ifdef MBS_SUPPORT
++		     || (re_opcode_t) p1[1+OFFSET_ADDRESS_SIZE] == exactn_bin
++#endif
++		    ) && p1[3+OFFSET_ADDRESS_SIZE] != c)
++                  {
++  		    p[-(1+OFFSET_ADDRESS_SIZE)] = (UCHAR_T)
++		      pop_failure_jump;
++#ifdef WCHAR
++		      DEBUG_PRINT3 ("  %C != %C => pop_failure_jump.\n",
++				    (wint_t) c,
++				    (wint_t) p1[3+OFFSET_ADDRESS_SIZE]);
++#else
++		      DEBUG_PRINT3 ("  %c != %c => pop_failure_jump.\n",
++				    (char) c,
++				    (char) p1[3+OFFSET_ADDRESS_SIZE]);
++#endif
++                  }
++
++#ifndef WCHAR
++		else if ((re_opcode_t) p1[3] == charset
++			 || (re_opcode_t) p1[3] == charset_not)
++		  {
++		    int negate = (re_opcode_t) p1[3] == charset_not;
++
++		    if (c < (unsigned) (p1[4] * BYTEWIDTH)
++			&& p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
++		      negate = !negate;
++
++                    /* `negate' is equal to 1 if c would match, which means
++                        that we can't change to pop_failure_jump.  */
++		    if (!negate)
++                      {
++  		        p[-3] = (unsigned char) pop_failure_jump;
++                        DEBUG_PRINT1 ("  No match => pop_failure_jump.\n");
++                      }
++		  }
++#endif /* not WCHAR */
++	      }
++#ifndef WCHAR
++            else if ((re_opcode_t) *p2 == charset)
++	      {
++		/* We win if the first character of the loop is not part
++                   of the charset.  */
++                if ((re_opcode_t) p1[3] == exactn
++ 		    && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
++ 			  && (p2[2 + p1[5] / BYTEWIDTH]
++ 			      & (1 << (p1[5] % BYTEWIDTH)))))
++		  {
++		    p[-3] = (unsigned char) pop_failure_jump;
++		    DEBUG_PRINT1 ("  No match => pop_failure_jump.\n");
++                  }
++
++		else if ((re_opcode_t) p1[3] == charset_not)
++		  {
++		    int idx;
++		    /* We win if the charset_not inside the loop
++		       lists every character listed in the charset after.  */
++		    for (idx = 0; idx < (int) p2[1]; idx++)
++		      if (! (p2[2 + idx] == 0
++			     || (idx < (int) p1[4]
++				 && ((p2[2 + idx] & ~ p1[5 + idx]) == 0))))
++			break;
++
++		    if (idx == p2[1])
++                      {
++  		        p[-3] = (unsigned char) pop_failure_jump;
++                        DEBUG_PRINT1 ("  No match => pop_failure_jump.\n");
++                      }
++		  }
++		else if ((re_opcode_t) p1[3] == charset)
++		  {
++		    int idx;
++		    /* We win if the charset inside the loop
++		       has no overlap with the one after the loop.  */
++		    for (idx = 0;
++			 idx < (int) p2[1] && idx < (int) p1[4];
++			 idx++)
++		      if ((p2[2 + idx] & p1[5 + idx]) != 0)
++			break;
++
++		    if (idx == p2[1] || idx == p1[4])
++                      {
++  		        p[-3] = (unsigned char) pop_failure_jump;
++                        DEBUG_PRINT1 ("  No match => pop_failure_jump.\n");
++                      }
++		  }
++	      }
++#endif /* not WCHAR */
++	  }
++	  p -= OFFSET_ADDRESS_SIZE;	/* Point at relative address again.  */
++	  if ((re_opcode_t) p[-1] != pop_failure_jump)
++	    {
++	      p[-1] = (UCHAR_T) jump;
++              DEBUG_PRINT1 ("  Match => jump.\n");
++	      goto unconditional_jump;
++	    }
++        /* Note fall through.  */
++
++
++	/* The end of a simple repeat has a pop_failure_jump back to
++           its matching on_failure_jump, where the latter will push a
++           failure point.  The pop_failure_jump takes off failure
++           points put on by this pop_failure_jump's matching
++           on_failure_jump; we got through the pattern to here from the
++           matching on_failure_jump, so didn't fail.  */
++        case pop_failure_jump:
++          {
++            /* We need to pass separate storage for the lowest and
++               highest registers, even though we don't care about the
++               actual values.  Otherwise, we will restore only one
++               register from the stack, since lowest will == highest in
++               `pop_failure_point'.  */
++            active_reg_t dummy_low_reg, dummy_high_reg;
++            UCHAR_T *pdummy __attribute__ ((unused)) = NULL;
++            const CHAR_T *sdummy __attribute__ ((unused)) = NULL;
++
++            DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n");
++            POP_FAILURE_POINT (sdummy, pdummy,
++                               dummy_low_reg, dummy_high_reg,
++                               reg_dummy, reg_dummy, reg_info_dummy);
++          }
++	  /* Note fall through.  */
++
++	unconditional_jump:
++#ifdef _LIBC
++	  DEBUG_PRINT2 ("\n%p: ", p);
++#else
++	  DEBUG_PRINT2 ("\n0x%x: ", p);
++#endif
++          /* Note fall through.  */
++
++        /* Unconditionally jump (without popping any failure points).  */
++        case jump:
++	  EXTRACT_NUMBER_AND_INCR (mcnt, p);	/* Get the amount to jump.  */
++          DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
++	  p += mcnt;				/* Do the jump.  */
++#ifdef _LIBC
++          DEBUG_PRINT2 ("(to %p).\n", p);
++#else
++          DEBUG_PRINT2 ("(to 0x%x).\n", p);
++#endif
++	  break;
++
++
++        /* We need this opcode so we can detect where alternatives end
++           in `group_match_null_string_p' et al.  */
++        case jump_past_alt:
++          DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n");
++          goto unconditional_jump;
++
++
++        /* Normally, the on_failure_jump pushes a failure point, which
++           then gets popped at pop_failure_jump.  We will end up at
++           pop_failure_jump, also, and with a pattern of, say, `a+', we
++           are skipping over the on_failure_jump, so we have to push
++           something meaningless for pop_failure_jump to pop.  */
++        case dummy_failure_jump:
++          DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
++          /* It doesn't matter what we push for the string here.  What
++             the code at `fail' tests is the value for the pattern.  */
++          PUSH_FAILURE_POINT (NULL, NULL, -2);
++          goto unconditional_jump;
++
++
++        /* At the end of an alternative, we need to push a dummy failure
++           point in case we are followed by a `pop_failure_jump', because
++           we don't want the failure point for the alternative to be
++           popped.  For example, matching `(a|ab)*' against `aab'
++           requires that we match the `ab' alternative.  */
++        case push_dummy_failure:
++          DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
++          /* See comments just above at `dummy_failure_jump' about the
++             two zeroes.  */
++          PUSH_FAILURE_POINT (NULL, NULL, -2);
++          break;
++
++        /* Have to succeed matching what follows at least n times.
++           After that, handle like `on_failure_jump'.  */
++        case succeed_n:
++          EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE);
++          DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
++
++          assert (mcnt >= 0);
++          /* Originally, this is how many times we HAVE to succeed.  */
++          if (mcnt > 0)
++            {
++               mcnt--;
++	       p += OFFSET_ADDRESS_SIZE;
++               STORE_NUMBER_AND_INCR (p, mcnt);
++#ifdef _LIBC
++               DEBUG_PRINT3 ("  Setting %p to %d.\n", p - OFFSET_ADDRESS_SIZE
++			     , mcnt);
++#else
++               DEBUG_PRINT3 ("  Setting 0x%x to %d.\n", p - OFFSET_ADDRESS_SIZE
++			     , mcnt);
++#endif
++            }
++	  else if (mcnt == 0)
++            {
++#ifdef _LIBC
++              DEBUG_PRINT2 ("  Setting two bytes from %p to no_op.\n",
++			    p + OFFSET_ADDRESS_SIZE);
++#else
++              DEBUG_PRINT2 ("  Setting two bytes from 0x%x to no_op.\n",
++			    p + OFFSET_ADDRESS_SIZE);
++#endif /* _LIBC */
++
++#ifdef WCHAR
++	      p[1] = (UCHAR_T) no_op;
++#else
++	      p[2] = (UCHAR_T) no_op;
++              p[3] = (UCHAR_T) no_op;
++#endif /* WCHAR */
++              goto on_failure;
++            }
++          break;
++
++        case jump_n:
++          EXTRACT_NUMBER (mcnt, p + OFFSET_ADDRESS_SIZE);
++          DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
++
++          /* Originally, this is how many times we CAN jump.  */
++          if (mcnt)
++            {
++               mcnt--;
++               STORE_NUMBER (p + OFFSET_ADDRESS_SIZE, mcnt);
++
++#ifdef _LIBC
++               DEBUG_PRINT3 ("  Setting %p to %d.\n", p + OFFSET_ADDRESS_SIZE,
++			     mcnt);
++#else
++               DEBUG_PRINT3 ("  Setting 0x%x to %d.\n", p + OFFSET_ADDRESS_SIZE,
++			     mcnt);
++#endif /* _LIBC */
++	       goto unconditional_jump;
++            }
++          /* If don't have to jump any more, skip over the rest of command.  */
++	  else
++	    p += 2 * OFFSET_ADDRESS_SIZE;
++          break;
++
++	case set_number_at:
++	  {
++            DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
++
++            EXTRACT_NUMBER_AND_INCR (mcnt, p);
++            p1 = p + mcnt;
++            EXTRACT_NUMBER_AND_INCR (mcnt, p);
++#ifdef _LIBC
++            DEBUG_PRINT3 ("  Setting %p to %d.\n", p1, mcnt);
++#else
++            DEBUG_PRINT3 ("  Setting 0x%x to %d.\n", p1, mcnt);
++#endif
++	    STORE_NUMBER (p1, mcnt);
++            break;
++          }
++
++#if 0
++	/* The DEC Alpha C compiler 3.x generates incorrect code for the
++	   test  WORDCHAR_P (d - 1) != WORDCHAR_P (d)  in the expansion of
++	   AT_WORD_BOUNDARY, so this code is disabled.  Expanding the
++	   macro and introducing temporary variables works around the bug.  */
++
++	case wordbound:
++	  DEBUG_PRINT1 ("EXECUTING wordbound.\n");
++	  if (AT_WORD_BOUNDARY (d))
++	    break;
++	  goto fail;
++
++	case notwordbound:
++	  DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
++	  if (AT_WORD_BOUNDARY (d))
++	    goto fail;
++	  break;
++#else
++	case wordbound:
++	{
++	  boolean prevchar, thischar;
++
++	  DEBUG_PRINT1 ("EXECUTING wordbound.\n");
++	  if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
++	    break;
++
++	  prevchar = WORDCHAR_P (d - 1);
++	  thischar = WORDCHAR_P (d);
++	  if (prevchar != thischar)
++	    break;
++	  goto fail;
++	}
++
++      case notwordbound:
++	{
++	  boolean prevchar, thischar;
++
++	  DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
++	  if (AT_STRINGS_BEG (d) || AT_STRINGS_END (d))
++	    goto fail;
++
++	  prevchar = WORDCHAR_P (d - 1);
++	  thischar = WORDCHAR_P (d);
++	  if (prevchar != thischar)
++	    goto fail;
++	  break;
++	}
++#endif
++
++	case wordbeg:
++          DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
++	  if (!AT_STRINGS_END (d) && WORDCHAR_P (d)
++	      && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1)))
++	    break;
++          goto fail;
++
++	case wordend:
++          DEBUG_PRINT1 ("EXECUTING wordend.\n");
++	  if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1)
++              && (AT_STRINGS_END (d) || !WORDCHAR_P (d)))
++	    break;
++          goto fail;
++
++#ifdef emacs
++  	case before_dot:
++          DEBUG_PRINT1 ("EXECUTING before_dot.\n");
++ 	  if (PTR_CHAR_POS ((unsigned char *) d) >= point)
++  	    goto fail;
++  	  break;
++
++  	case at_dot:
++          DEBUG_PRINT1 ("EXECUTING at_dot.\n");
++ 	  if (PTR_CHAR_POS ((unsigned char *) d) != point)
++  	    goto fail;
++  	  break;
++
++  	case after_dot:
++          DEBUG_PRINT1 ("EXECUTING after_dot.\n");
++          if (PTR_CHAR_POS ((unsigned char *) d) <= point)
++  	    goto fail;
++  	  break;
++
++	case syntaxspec:
++          DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt);
++	  mcnt = *p++;
++	  goto matchsyntax;
++
++        case wordchar:
++          DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n");
++	  mcnt = (int) Sword;
++        matchsyntax:
++	  PREFETCH ();
++	  /* Can't use *d++ here; SYNTAX may be an unsafe macro.  */
++	  d++;
++	  if (SYNTAX (d[-1]) != (enum syntaxcode) mcnt)
++	    goto fail;
++          SET_REGS_MATCHED ();
++	  break;
++
++	case notsyntaxspec:
++          DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt);
++	  mcnt = *p++;
++	  goto matchnotsyntax;
++
++        case notwordchar:
++          DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n");
++	  mcnt = (int) Sword;
++        matchnotsyntax:
++	  PREFETCH ();
++	  /* Can't use *d++ here; SYNTAX may be an unsafe macro.  */
++	  d++;
++	  if (SYNTAX (d[-1]) == (enum syntaxcode) mcnt)
++	    goto fail;
++	  SET_REGS_MATCHED ();
++          break;
++
++#else /* not emacs */
++	case wordchar:
++          DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n");
++	  PREFETCH ();
++          if (!WORDCHAR_P (d))
++            goto fail;
++	  SET_REGS_MATCHED ();
++          d++;
++	  break;
++
++	case notwordchar:
++          DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
++	  PREFETCH ();
++	  if (WORDCHAR_P (d))
++            goto fail;
++          SET_REGS_MATCHED ();
++          d++;
++	  break;
++#endif /* not emacs */
++
++        default:
++          abort ();
++	}
++      continue;  /* Successfully executed one pattern command; keep going.  */
++
++
++    /* We goto here if a matching operation fails. */
++    fail:
++      if (!FAIL_STACK_EMPTY ())
++	{ /* A restart point is known.  Restore to that state.  */
++          DEBUG_PRINT1 ("\nFAIL:\n");
++          POP_FAILURE_POINT (d, p,
++                             lowest_active_reg, highest_active_reg,
++                             regstart, regend, reg_info);
++
++          /* If this failure point is a dummy, try the next one.  */
++          if (!p)
++	    goto fail;
++
++          /* If we failed to the end of the pattern, don't examine *p.  */
++	  assert (p <= pend);
++          if (p < pend)
++            {
++              boolean is_a_jump_n = false;
++
++              /* If failed to a backwards jump that's part of a repetition
++                 loop, need to pop this failure point and use the next one.  */
++              switch ((re_opcode_t) *p)
++                {
++                case jump_n:
++                  is_a_jump_n = true;
++                case maybe_pop_jump:
++                case pop_failure_jump:
++                case jump:
++                  p1 = p + 1;
++                  EXTRACT_NUMBER_AND_INCR (mcnt, p1);
++                  p1 += mcnt;
++
++                  if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
++                      || (!is_a_jump_n
++                          && (re_opcode_t) *p1 == on_failure_jump))
++                    goto fail;
++                  break;
++                default:
++                  /* do nothing */ ;
++                }
++            }
++
++          if (d >= string1 && d <= end1)
++	    dend = end_match_1;
++        }
++      else
++        break;   /* Matching at this starting point really fails.  */
++    } /* for (;;) */
++
++  if (best_regs_set)
++    goto restore_best_regs;
++
++  FREE_VARIABLES ();
++
++  return -1;         			/* Failure to match.  */
++} /* re_match_2 */
++
++/* Subroutine definitions for re_match_2.  */
++
++
++/* We are passed P pointing to a register number after a start_memory.
++
++   Return true if the pattern up to the corresponding stop_memory can
++   match the empty string, and false otherwise.
++
++   If we find the matching stop_memory, sets P to point to one past its number.
++   Otherwise, sets P to an undefined byte less than or equal to END.
++
++   We don't handle duplicates properly (yet).  */
++
++static boolean
++PREFIX(group_match_null_string_p) (UCHAR_T **p, UCHAR_T *end,
++                                   PREFIX(register_info_type) *reg_info)
++{
++  int mcnt;
++  /* Point to after the args to the start_memory.  */
++  UCHAR_T *p1 = *p + 2;
++
++  while (p1 < end)
++    {
++      /* Skip over opcodes that can match nothing, and return true or
++	 false, as appropriate, when we get to one that can't, or to the
++         matching stop_memory.  */
++
++      switch ((re_opcode_t) *p1)
++        {
++        /* Could be either a loop or a series of alternatives.  */
++        case on_failure_jump:
++          p1++;
++          EXTRACT_NUMBER_AND_INCR (mcnt, p1);
++
++          /* If the next operation is not a jump backwards in the
++	     pattern.  */
++
++	  if (mcnt >= 0)
++	    {
++              /* Go through the on_failure_jumps of the alternatives,
++                 seeing if any of the alternatives cannot match nothing.
++                 The last alternative starts with only a jump,
++                 whereas the rest start with on_failure_jump and end
++                 with a jump, e.g., here is the pattern for `a|b|c':
++
++                 /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
++                 /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
++                 /exactn/1/c
++
++                 So, we have to first go through the first (n-1)
++                 alternatives and then deal with the last one separately.  */
++
++
++              /* Deal with the first (n-1) alternatives, which start
++                 with an on_failure_jump (see above) that jumps to right
++                 past a jump_past_alt.  */
++
++              while ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] ==
++		     jump_past_alt)
++                {
++                  /* `mcnt' holds how many bytes long the alternative
++                     is, including the ending `jump_past_alt' and
++                     its number.  */
++
++                  if (!PREFIX(alt_match_null_string_p) (p1, p1 + mcnt -
++						(1 + OFFSET_ADDRESS_SIZE),
++						reg_info))
++                    return false;
++
++                  /* Move to right after this alternative, including the
++		     jump_past_alt.  */
++                  p1 += mcnt;
++
++                  /* Break if it's the beginning of an n-th alternative
++                     that doesn't begin with an on_failure_jump.  */
++                  if ((re_opcode_t) *p1 != on_failure_jump)
++                    break;
++
++		  /* Still have to check that it's not an n-th
++		     alternative that starts with an on_failure_jump.  */
++		  p1++;
++                  EXTRACT_NUMBER_AND_INCR (mcnt, p1);
++                  if ((re_opcode_t) p1[mcnt-(1+OFFSET_ADDRESS_SIZE)] !=
++		      jump_past_alt)
++                    {
++		      /* Get to the beginning of the n-th alternative.  */
++                      p1 -= 1 + OFFSET_ADDRESS_SIZE;
++                      break;
++                    }
++                }
++
++              /* Deal with the last alternative: go back and get number
++                 of the `jump_past_alt' just before it.  `mcnt' contains
++                 the length of the alternative.  */
++              EXTRACT_NUMBER (mcnt, p1 - OFFSET_ADDRESS_SIZE);
++
++              if (!PREFIX(alt_match_null_string_p) (p1, p1 + mcnt, reg_info))
++                return false;
++
++              p1 += mcnt;	/* Get past the n-th alternative.  */
++            } /* if mcnt > 0 */
++          break;
++
++
++        case stop_memory:
++	  assert (p1[1] == **p);
++          *p = p1 + 2;
++          return true;
++
++
++        default:
++          if (!PREFIX(common_op_match_null_string_p) (&p1, end, reg_info))
++            return false;
++        }
++    } /* while p1 < end */
++
++  return false;
++} /* group_match_null_string_p */
++
++
++/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
++   It expects P to be the first byte of a single alternative and END one
++   byte past the last. The alternative can contain groups.  */
++
++static boolean
++PREFIX(alt_match_null_string_p) (UCHAR_T *p, UCHAR_T *end,
++                                 PREFIX(register_info_type) *reg_info)
++{
++  int mcnt;
++  UCHAR_T *p1 = p;
++
++  while (p1 < end)
++    {
++      /* Skip over opcodes that can match nothing, and break when we get
++         to one that can't.  */
++
++      switch ((re_opcode_t) *p1)
++        {
++	/* It's a loop.  */
++        case on_failure_jump:
++          p1++;
++          EXTRACT_NUMBER_AND_INCR (mcnt, p1);
++          p1 += mcnt;
++          break;
++
++	default:
++          if (!PREFIX(common_op_match_null_string_p) (&p1, end, reg_info))
++            return false;
++        }
++    }  /* while p1 < end */
++
++  return true;
++} /* alt_match_null_string_p */
++
++
++/* Deals with the ops common to group_match_null_string_p and
++   alt_match_null_string_p.
++
++   Sets P to one after the op and its arguments, if any.  */
++
++static boolean
++PREFIX(common_op_match_null_string_p) (UCHAR_T **p, UCHAR_T *end,
++                                       PREFIX(register_info_type) *reg_info)
++{
++  int mcnt;
++  boolean ret;
++  int reg_no;
++  UCHAR_T *p1 = *p;
++
++  switch ((re_opcode_t) *p1++)
++    {
++    case no_op:
++    case begline:
++    case endline:
++    case begbuf:
++    case endbuf:
++    case wordbeg:
++    case wordend:
++    case wordbound:
++    case notwordbound:
++#ifdef emacs
++    case before_dot:
++    case at_dot:
++    case after_dot:
++#endif
++      break;
++
++    case start_memory:
++      reg_no = *p1;
++      assert (reg_no > 0 && reg_no <= MAX_REGNUM);
++      ret = PREFIX(group_match_null_string_p) (&p1, end, reg_info);
++
++      /* Have to set this here in case we're checking a group which
++         contains a group and a back reference to it.  */
++
++      if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE)
++        REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret;
++
++      if (!ret)
++        return false;
++      break;
++
++    /* If this is an optimized succeed_n for zero times, make the jump.  */
++    case jump:
++      EXTRACT_NUMBER_AND_INCR (mcnt, p1);
++      if (mcnt >= 0)
++        p1 += mcnt;
++      else
++        return false;
++      break;
++
++    case succeed_n:
++      /* Get to the number of times to succeed.  */
++      p1 += OFFSET_ADDRESS_SIZE;
++      EXTRACT_NUMBER_AND_INCR (mcnt, p1);
++
++      if (mcnt == 0)
++        {
++          p1 -= 2 * OFFSET_ADDRESS_SIZE;
++          EXTRACT_NUMBER_AND_INCR (mcnt, p1);
++          p1 += mcnt;
++        }
++      else
++        return false;
++      break;
++
++    case duplicate:
++      if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
++        return false;
++      break;
++
++    case set_number_at:
++      p1 += 2 * OFFSET_ADDRESS_SIZE;
++
++    default:
++      /* All other opcodes mean we cannot match the empty string.  */
++      return false;
++  }
++
++  *p = p1;
++  return true;
++} /* common_op_match_null_string_p */
++
++
++/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
++   bytes; nonzero otherwise.  */
++
++static int
++PREFIX(bcmp_translate) (const CHAR_T *s1, const CHAR_T *s2, register int len,
++                        RE_TRANSLATE_TYPE translate)
++{
++  register const UCHAR_T *p1 = (const UCHAR_T *) s1;
++  register const UCHAR_T *p2 = (const UCHAR_T *) s2;
++  while (len)
++    {
++#ifdef WCHAR
++      if (((*p1<=0xff)?translate[*p1++]:*p1++)
++	  != ((*p2<=0xff)?translate[*p2++]:*p2++))
++	return 1;
++#else /* BYTE */
++      if (translate[*p1++] != translate[*p2++]) return 1;
++#endif /* WCHAR */
++      len--;
++    }
++  return 0;
++}
++
++
++#else /* not INSIDE_RECURSION */
++
++/* Entry points for GNU code.  */
++
++/* re_compile_pattern is the GNU regular expression compiler: it
++   compiles PATTERN (of length SIZE) and puts the result in BUFP.
++   Returns 0 if the pattern was valid, otherwise an error string.
++
++   Assumes the `allocated' (and perhaps `buffer') and `translate' fields
++   are set in BUFP on entry.
++
++   We call regex_compile to do the actual compilation.  */
++
++const char *
++re_compile_pattern (const char *pattern, size_t length,
++                    struct re_pattern_buffer *bufp)
++{
++  reg_errcode_t ret;
++
++  /* GNU code is written to assume at least RE_NREGS registers will be set
++     (and at least one extra will be -1).  */
++  bufp->regs_allocated = REGS_UNALLOCATED;
++
++  /* And GNU code determines whether or not to get register information
++     by passing null for the REGS argument to re_match, etc., not by
++     setting no_sub.  */
++  bufp->no_sub = 0;
++
++  /* Match anchors at newline.  */
++  bufp->newline_anchor = 1;
++
++# ifdef MBS_SUPPORT
++  if (MB_CUR_MAX != 1)
++    ret = wcs_regex_compile (pattern, length, re_syntax_options, bufp);
++  else
++# endif
++    ret = byte_regex_compile (pattern, length, re_syntax_options, bufp);
++
++  if (!ret)
++    return NULL;
++  return gettext (re_error_msgid[(int) ret]);
++}
++#ifdef _LIBC
++weak_alias (__re_compile_pattern, re_compile_pattern)
++#endif
++
++/* Entry points compatible with 4.2 BSD regex library.  We don't define
++   them unless specifically requested.  */
++
++#if defined _REGEX_RE_COMP || defined _LIBC
++
++/* BSD has one and only one pattern buffer.  */
++static struct re_pattern_buffer re_comp_buf;
++
++char *
++#ifdef _LIBC
++/* Make these definitions weak in libc, so POSIX programs can redefine
++   these names if they don't use our functions, and still use
++   regcomp/regexec below without link errors.  */
++weak_function
++#endif
++re_comp (const char *s)
++{
++  reg_errcode_t ret;
++
++  if (!s)
++    {
++      if (!re_comp_buf.buffer)
++	return (char *) gettext ("No previous regular expression");
++      return 0;
++    }
++
++  if (!re_comp_buf.buffer)
++    {
++      re_comp_buf.buffer = (unsigned char *) malloc (200);
++      if (re_comp_buf.buffer == NULL)
++        return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
++      re_comp_buf.allocated = 200;
++
++      re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
++      if (re_comp_buf.fastmap == NULL)
++	return (char *) gettext (re_error_msgid[(int) REG_ESPACE]);
++    }
++
++  /* Since `re_exec' always passes NULL for the `regs' argument, we
++     don't need to initialize the pattern buffer fields which affect it.  */
++
++  /* Match anchors at newlines.  */
++  re_comp_buf.newline_anchor = 1;
++
++# ifdef MBS_SUPPORT
++  if (MB_CUR_MAX != 1)
++    ret = wcs_regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
++  else
++# endif
++    ret = byte_regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
++
++  if (!ret)
++    return NULL;
++
++  /* Yes, we're discarding `const' here if !HAVE_LIBINTL.  */
++  return (char *) gettext (re_error_msgid[(int) ret]);
++}
++
++
++int
++#ifdef _LIBC
++weak_function
++#endif
++re_exec (const char *s)
++{
++  const int len = strlen (s);
++  return
++    0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
++}
++
++#endif /* _REGEX_RE_COMP */
++
++/* POSIX.2 functions.  Don't define these for Emacs.  */
++
++#ifndef emacs
++
++/* regcomp takes a regular expression as a string and compiles it.
++
++   PREG is a regex_t *.  We do not expect any fields to be initialized,
++   since POSIX says we shouldn't.  Thus, we set
++
++     `buffer' to the compiled pattern;
++     `used' to the length of the compiled pattern;
++     `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
++       REG_EXTENDED bit in CFLAGS is set; otherwise, to
++       RE_SYNTAX_POSIX_BASIC;
++     `newline_anchor' to REG_NEWLINE being set in CFLAGS;
++     `fastmap' to an allocated space for the fastmap;
++     `fastmap_accurate' to zero;
++     `re_nsub' to the number of subexpressions in PATTERN.
++
++   PATTERN is the address of the pattern string.
++
++   CFLAGS is a series of bits which affect compilation.
++
++     If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
++     use POSIX basic syntax.
++
++     If REG_NEWLINE is set, then . and [^...] don't match newline.
++     Also, regexec will try a match beginning after every newline.
++
++     If REG_ICASE is set, then we considers upper- and lowercase
++     versions of letters to be equivalent when matching.
++
++     If REG_NOSUB is set, then when PREG is passed to regexec, that
++     routine will report only success or failure, and nothing about the
++     registers.
++
++   It returns 0 if it succeeds, nonzero if it doesn't.  (See regex.h for
++   the return codes and their meanings.)  */
++
++int
++regcomp (regex_t *preg, const char *pattern, int cflags)
++{
++  reg_errcode_t ret;
++  reg_syntax_t syntax
++    = (cflags & REG_EXTENDED) ?
++      RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
++
++  /* regex_compile will allocate the space for the compiled pattern.  */
++  preg->buffer = 0;
++  preg->allocated = 0;
++  preg->used = 0;
++
++  /* Try to allocate space for the fastmap.  */
++  preg->fastmap = (char *) malloc (1 << BYTEWIDTH);
++
++  if (cflags & REG_ICASE)
++    {
++      int i;
++
++      preg->translate
++	= (RE_TRANSLATE_TYPE) malloc (CHAR_SET_SIZE
++				      * sizeof (*(RE_TRANSLATE_TYPE)0));
++      if (preg->translate == NULL)
++        return (int) REG_ESPACE;
++
++      /* Map uppercase characters to corresponding lowercase ones.  */
++      for (i = 0; i < CHAR_SET_SIZE; i++)
++        preg->translate[i] = ISUPPER (i) ? TOLOWER (i) : i;
++    }
++  else
++    preg->translate = NULL;
++
++  /* If REG_NEWLINE is set, newlines are treated differently.  */
++  if (cflags & REG_NEWLINE)
++    { /* REG_NEWLINE implies neither . nor [^...] match newline.  */
++      syntax &= ~RE_DOT_NEWLINE;
++      syntax |= RE_HAT_LISTS_NOT_NEWLINE;
++      /* It also changes the matching behavior.  */
++      preg->newline_anchor = 1;
++    }
++  else
++    preg->newline_anchor = 0;
++
++  preg->no_sub = !!(cflags & REG_NOSUB);
++
++  /* POSIX says a null character in the pattern terminates it, so we
++     can use strlen here in compiling the pattern.  */
++# ifdef MBS_SUPPORT
++  if (MB_CUR_MAX != 1)
++    ret = wcs_regex_compile (pattern, strlen (pattern), syntax, preg);
++  else
++# endif
++    ret = byte_regex_compile (pattern, strlen (pattern), syntax, preg);
++
++  /* POSIX doesn't distinguish between an unmatched open-group and an
++     unmatched close-group: both are REG_EPAREN.  */
++  if (ret == REG_ERPAREN) ret = REG_EPAREN;
++
++  if (ret == REG_NOERROR && preg->fastmap)
++    {
++      /* Compute the fastmap now, since regexec cannot modify the pattern
++	 buffer.  */
++      if (re_compile_fastmap (preg) == -2)
++	{
++	  /* Some error occurred while computing the fastmap, just forget
++	     about it.  */
++	  free (preg->fastmap);
++	  preg->fastmap = NULL;
++	}
++    }
++
++  return (int) ret;
++}
++#ifdef _LIBC
++weak_alias (__regcomp, regcomp)
++#endif
++
++
++/* regexec searches for a given pattern, specified by PREG, in the
++   string STRING.
++
++   If NMATCH is zero or REG_NOSUB was set in the cflags argument to
++   `regcomp', we ignore PMATCH.  Otherwise, we assume PMATCH has at
++   least NMATCH elements, and we set them to the offsets of the
++   corresponding matched substrings.
++
++   EFLAGS specifies `execution flags' which affect matching: if
++   REG_NOTBOL is set, then ^ does not match at the beginning of the
++   string; if REG_NOTEOL is set, then $ does not match at the end.
++
++   We return 0 if we find a match and REG_NOMATCH if not.  */
++
++int
++regexec (const regex_t *preg, const char *string, size_t nmatch,
++         regmatch_t pmatch[], int eflags)
++{
++  int ret;
++  struct re_registers regs;
++  regex_t private_preg;
++  int len = strlen (string);
++  boolean want_reg_info = !preg->no_sub && nmatch > 0;
++
++  private_preg = *preg;
++
++  private_preg.not_bol = !!(eflags & REG_NOTBOL);
++  private_preg.not_eol = !!(eflags & REG_NOTEOL);
++
++  /* The user has told us exactly how many registers to return
++     information about, via `nmatch'.  We have to pass that on to the
++     matching routines.  */
++  private_preg.regs_allocated = REGS_FIXED;
++
++  if (want_reg_info)
++    {
++      regs.num_regs = nmatch;
++      regs.start = TALLOC (nmatch * 2, regoff_t);
++      if (regs.start == NULL)
++        return (int) REG_NOMATCH;
++      regs.end = regs.start + nmatch;
++    }
++
++  /* Perform the searching operation.  */
++  ret = re_search (&private_preg, string, len,
++                   /* start: */ 0, /* range: */ len,
++                   want_reg_info ? &regs : (struct re_registers *) 0);
++
++  /* Copy the register information to the POSIX structure.  */
++  if (want_reg_info)
++    {
++      if (ret >= 0)
++        {
++          unsigned r;
++
++          for (r = 0; r < nmatch; r++)
++            {
++              pmatch[r].rm_so = regs.start[r];
++              pmatch[r].rm_eo = regs.end[r];
++            }
++        }
++
++      /* If we needed the temporary register info, free the space now.  */
++      free (regs.start);
++    }
++
++  /* We want zero return to mean success, unlike `re_search'.  */
++  return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
++}
++#ifdef _LIBC
++/* EGLIBC: This is handled in regexec-compat.c.  */
++/*weak_alias (__regexec, regexec)*/
++#include "regexec-compat.c"
++#endif
++
++
++/* Returns a message corresponding to an error code, ERRCODE, returned
++   from either regcomp or regexec.   We don't use PREG here.  */
++
++size_t
++regerror (int errcode, const regex_t *preg __attribute__ ((unused)),
++          char *errbuf, size_t errbuf_size)
++{
++  const char *msg;
++  size_t msg_size;
++
++  if (errcode < 0
++      || errcode >= (int) (sizeof (re_error_msgid)
++			   / sizeof (re_error_msgid[0])))
++    /* Only error codes returned by the rest of the code should be passed
++       to this routine.  If we are given anything else, or if other regex
++       code generates an invalid error code, then the program has a bug.
++       Dump core so we can fix it.  */
++    abort ();
++
++  msg = gettext (re_error_msgid[errcode]);
++
++  msg_size = strlen (msg) + 1; /* Includes the null.  */
++
++  if (errbuf_size != 0)
++    {
++      if (msg_size > errbuf_size)
++        {
++#if defined HAVE_MEMPCPY || defined _LIBC
++	  *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
++#else
++          memcpy (errbuf, msg, errbuf_size - 1);
++          errbuf[errbuf_size - 1] = 0;
++#endif
++        }
++      else
++        memcpy (errbuf, msg, msg_size);
++    }
++
++  return msg_size;
++}
++#ifdef _LIBC
++weak_alias (__regerror, regerror)
++#endif
++
++
++/* Free dynamically allocated space used by PREG.  */
++
++void
++regfree (regex_t *preg)
++{
++  if (preg->buffer != NULL)
++    free (preg->buffer);
++  preg->buffer = NULL;
++
++  preg->allocated = 0;
++  preg->used = 0;
++
++  if (preg->fastmap != NULL)
++    free (preg->fastmap);
++  preg->fastmap = NULL;
++  preg->fastmap_accurate = 0;
++
++  if (preg->translate != NULL)
++    free (preg->translate);
++  preg->translate = NULL;
++}
++#ifdef _LIBC
++weak_alias (__regfree, regfree)
++#endif
++
++#endif /* not emacs  */
++
++#endif /* not INSIDE_RECURSION */
++
++
++#undef STORE_NUMBER
++#undef STORE_NUMBER_AND_INCR
++#undef EXTRACT_NUMBER
++#undef EXTRACT_NUMBER_AND_INCR
++
++#undef DEBUG_PRINT_COMPILED_PATTERN
++#undef DEBUG_PRINT_DOUBLE_STRING
++
++#undef INIT_FAIL_STACK
++#undef RESET_FAIL_STACK
++#undef DOUBLE_FAIL_STACK
++#undef PUSH_PATTERN_OP
++#undef PUSH_FAILURE_POINTER
++#undef PUSH_FAILURE_INT
++#undef PUSH_FAILURE_ELT
++#undef POP_FAILURE_POINTER
++#undef POP_FAILURE_INT
++#undef POP_FAILURE_ELT
++#undef DEBUG_PUSH
++#undef DEBUG_POP
++#undef PUSH_FAILURE_POINT
++#undef POP_FAILURE_POINT
++
++#undef REG_UNSET_VALUE
++#undef REG_UNSET
++
++#undef PATFETCH
++#undef PATFETCH_RAW
++#undef PATUNFETCH
++#undef TRANSLATE
++
++#undef INIT_BUF_SIZE
++#undef GET_BUFFER_SPACE
++#undef BUF_PUSH
++#undef BUF_PUSH_2
++#undef BUF_PUSH_3
++#undef STORE_JUMP
++#undef STORE_JUMP2
++#undef INSERT_JUMP
++#undef INSERT_JUMP2
++#undef EXTEND_BUFFER
++#undef GET_UNSIGNED_NUMBER
++#undef FREE_STACK_RETURN
++
++# undef POINTER_TO_OFFSET
++# undef MATCHING_IN_FRST_STRING
++# undef PREFETCH
++# undef AT_STRINGS_BEG
++# undef AT_STRINGS_END
++# undef WORDCHAR_P
++# undef FREE_VAR
++# undef FREE_VARIABLES
++# undef NO_HIGHEST_ACTIVE_REG
++# undef NO_LOWEST_ACTIVE_REG
++
++# undef CHAR_T
++# undef UCHAR_T
++# undef COMPILED_BUFFER_VAR
++# undef OFFSET_ADDRESS_SIZE
++# undef CHAR_CLASS_SIZE
++# undef PREFIX
++# undef ARG_PREFIX
++# undef PUT_CHAR
++# undef BYTE
++# undef WCHAR
++
++# define DEFINED_ONCE
+diff --git a/pwd/Makefile b/pwd/Makefile
+index 7f6de03..916d546 100644
+--- a/pwd/Makefile
++++ b/pwd/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Sub-makefile for pwd portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= pwd
+ 
+ include ../Makeconfig
+diff --git a/resolv/Makefile b/resolv/Makefile
+index 1dcb75f..2e4b630 100644
+--- a/resolv/Makefile
++++ b/resolv/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Sub-makefile for resolv portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= resolv
+ 
+ include ../Makeconfig
+@@ -27,21 +29,22 @@ headers	:= resolv.h \
+ 	   arpa/nameser.h arpa/nameser_compat.h \
+ 	   sys/bitypes.h
+ 
+-routines := herror inet_addr inet_ntop inet_pton nsap_addr res_init \
+-	    res_hconf res_libc res-state
++routines-$(OPTION_EGLIBC_INET) \
++	+= herror inet_addr inet_ntop inet_pton nsap_addr res_init \
++	   res_hconf res_libc res-state
+ 
+-tests = tst-aton tst-leaks tst-inet_ntop
+-xtests = tst-leaks2
++tests-$(OPTION_EGLIBC_INET) += tst-aton tst-leaks tst-inet_ntop
++xtests-$(OPTION_EGLIBC_INET) += tst-leaks2
+ 
+ generate := mtrace-tst-leaks.out tst-leaks.mtrace tst-leaks2.mtrace
+ 
+-extra-libs := libresolv libnss_dns
++extra-libs-$(OPTION_EGLIBC_INET) += libresolv libnss_dns
+ ifeq ($(have-thread-library),yes)
+-extra-libs += libanl
+-routines += gai_sigqueue
++extra-libs-$(OPTION_EGLIBC_INET_ANL) += libanl
++routines-$(OPTION_EGLIBC_INET) += gai_sigqueue
+ tests += tst-res_hconf_reorder
+ endif
+-extra-libs-others = $(extra-libs)
++extra-libs-others-y += $(extra-libs-y)
+ libresolv-routines := gethnamaddr res_comp res_debug	\
+ 		      res_data res_mkquery res_query res_send		\
+ 		      inet_net_ntop inet_net_pton inet_neta base64	\
+@@ -61,7 +64,7 @@ routines                += $(libnss_dns-routines) $(libresolv-routines)
+ static-only-routines    += $(libnss_dns-routines) $(libresolv-routines)
+ endif
+ 
+-ifeq (yesyes,$(build-shared)$(have-thread-library))
++ifeq (yesyesy,$(build-shared)$(have-thread-library)$(OPTION_EGLIBC_INET_ANL))
+ tests: $(objpfx)ga_test
+ endif
+ 
+diff --git a/stdio-common/Makefile b/stdio-common/Makefile
+index d0bf0e1..8655801 100644
+--- a/stdio-common/Makefile
++++ b/stdio-common/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Specific makefile for stdio-common.
+ #
++include ../option-groups.mak
++
+ subdir	:= stdio-common
+ 
+ include ../Makeconfig
+@@ -30,7 +32,7 @@ routines	:=							      \
+ 	vfprintf vprintf printf_fp reg-printf printf-prs printf_fphex	      \
+ 	reg-modifier reg-type						      \
+ 	printf_size fprintf printf snprintf sprintf asprintf dprintf	      \
+-	vfwprintf vfscanf vfwscanf					      \
++	vfscanf								      \
+ 	fscanf scanf sscanf						      \
+ 	perror psignal							      \
+ 	tmpfile tmpfile64 tmpnam tmpnam_r tempnam tempname		      \
+@@ -41,23 +43,36 @@ routines	:=							      \
+ 	isoc99_vsscanf							      \
+ 	psiginfo
+ 
+-aux	:= errlist siglist printf-parsemb printf-parsewc fxprintf
++# Ideally, _itowa and itowa-digits would be in this option group as
++# well, but it is used unconditionally by printf_fp and printf_fphex,
++# and it didn't seem straightforward to disentangle it.
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++	+= vfwprintf vfwscanf
++
++aux	:= errlist siglist printf-parsemb fxprintf
++aux-$(OPTION_POSIX_C_LANG_WIDE_CHAR) += printf-parsewc
+ 
+ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \
+ 	 temptest tst-fileno test-fwrite tst-ungetc tst-ferror \
+ 	 xbug errnobug \
+ 	 bug1 bug2 bug3 bug4 bug5 bug6 bug7 bug8 bug9 bug10 bug11 bug12 bug13 \
+-	 tfformat tiformat tllformat tstdiomisc tst-printfsz tst-wc-printf \
++	 tfformat tiformat tllformat tstdiomisc tst-printfsz \
+ 	 scanf1 scanf2 scanf3 scanf4 scanf5 scanf7 scanf8 scanf9 scanf10 \
+-	 scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf tst-sscanf \
+-	 tst-swprintf tst-fseek tst-fmemopen test-vfprintf tst-gets \
+-	 tst-perror tst-sprintf tst-rndseek tst-fdopen tst-fphex bug14 \
++	 scanf11 scanf12 tst-tmpnam tst-cookie tst-obprintf \
++	 tst-fseek tst-fmemopen tst-gets \
++	 tst-sprintf tst-rndseek tst-fdopen tst-fphex \
+ 	 tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
+-	 tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
+-	 bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
+-	 scanf16 scanf17 tst-setvbuf1 tst-grouping bug23 bug24 \
+-	 bug-vfprintf-nargs tst-long-dbl-fphex tst-fphex-wide tst-sprintf3 \
++	 tst-fwrite bug16 bug17 tst-sprintf2 bug18 \
++	 bug19 tst-popen2 scanf14 scanf15 bug21 bug22 \
++	 scanf16 scanf17 tst-setvbuf1 bug23 bug24 \
++	 bug-vfprintf-nargs tst-sprintf3 \
+ 	 bug25 tst-printf-round bug23-2 bug23-3 bug23-4 bug26 tst-fmemopen3
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++	 += tst-sscanf tst-swprintf test-vfprintf bug14 scanf13 tst-grouping
++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
++	 += tst-perror bug19a bug20 tst-long-dbl-fphex tst-fphex-wide
++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++	 += bug18a tst-swscanf tst-wc-printf
+ 
+ test-srcs = tst-unbputc tst-printf
+ 
+diff --git a/stdio-common/_i18n_number.h b/stdio-common/_i18n_number.h
+index 3c73044..ac62b3a 100644
+--- a/stdio-common/_i18n_number.h
++++ b/stdio-common/_i18n_number.h
+@@ -19,10 +19,13 @@
+ #include <stdbool.h>
+ #include <wchar.h>
+ #include <wctype.h>
++#include <gnu/option-groups.h>
+ 
+ #include "../locale/outdigits.h"
+ #include "../locale/outdigitswc.h"
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
++
+ static CHAR_T *
+ _i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
+ {
+@@ -115,3 +118,13 @@ _i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
+ 
+   return w;
+ }
++
++#else
++
++static CHAR_T *
++_i18n_number_rewrite (CHAR_T *w, CHAR_T *rear_ptr, CHAR_T *end)
++{
++  return w;
++}
++
++#endif
+diff --git a/stdio-common/fxprintf.c b/stdio-common/fxprintf.c
+index 7b2eb94..8476076 100644
+--- a/stdio-common/fxprintf.c
++++ b/stdio-common/fxprintf.c
+@@ -23,6 +23,7 @@
+ #include <wchar.h>
+ #include <string.h>
+ #include <libioP.h>
++#include <gnu/option-groups.h>
+ 
+ 
+ int
+@@ -37,6 +38,7 @@ __fxprintf (FILE *fp, const char *fmt, ...)
+   int res;
+   if (_IO_fwide (fp, 0) > 0)
+     {
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+       size_t len = strlen (fmt) + 1;
+       wchar_t wfmt[len];
+       for (size_t i = 0; i < len; ++i)
+@@ -45,6 +47,9 @@ __fxprintf (FILE *fp, const char *fmt, ...)
+ 	  wfmt[i] = fmt[i];
+ 	}
+       res = __vfwprintf (fp, wfmt, ap);
++#else
++      abort();
++#endif
+     }
+   else
+     res = _IO_vfprintf (fp, fmt, ap);
+diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
+index 3023b20..bd0df66 100644
+--- a/stdio-common/printf_fp.c
++++ b/stdio-common/printf_fp.c
+@@ -39,6 +39,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <wchar.h>
++#include <gnu/option-groups.h>
+ #include <stdbool.h>
+ #include <rounding-mode.h>
+ 
+@@ -142,6 +143,10 @@ extern mp_size_t __mpn_extract_long_double (mp_ptr res_ptr, mp_size_t size,
+ extern unsigned int __guess_grouping (unsigned int intdig_max,
+ 				      const char *grouping);
+ 
++/* Ideally, when OPTION_EGLIBC_LOCALE_CODE is disabled, this should do
++   all its work in ordinary characters, rather than doing it in wide
++   characters and then converting at the end.  But that is a challenge
++   for another day.  */
+ 
+ static wchar_t *group_number (wchar_t *buf, wchar_t *bufend,
+ 			      unsigned int intdig_no, const char *grouping,
+@@ -251,7 +256,14 @@ ___printf_fp (FILE *fp,
+   mp_limb_t cy;
+ 
+   /* Nonzero if this is output on a wide character stream.  */
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+   int wide = info->wide;
++#else
++  /* This should never be called on a wide-oriented stream when
++     OPTION_POSIX_C_LANG_WIDE_CHAR is disabled, but the compiler can't
++     be trusted to figure that out.  */
++  const int wide = 0;
++#endif
+ 
+   /* Buffer in which we produce the output.  */
+   wchar_t *wbuffer = NULL;
+@@ -261,6 +273,7 @@ ___printf_fp (FILE *fp,
+   p.expsign = 0;
+ 
+   /* Figure out the decimal point character.  */
++#if __OPTION_EGLIBC_LOCALE_CODE
+   if (info->extra == 0)
+     {
+       decimal = _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT);
+@@ -280,7 +293,13 @@ ___printf_fp (FILE *fp,
+   /* The decimal point character must not be zero.  */
+   assert (*decimal != '\0');
+   assert (decimalwc != L'\0');
++#else
++  /* Hard-code values from 'C' locale.  */
++  decimal = ".";
++  decimalwc = L'.';
++#endif
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+   if (info->group)
+     {
+       if (info->extra == 0)
+@@ -324,6 +343,9 @@ ___printf_fp (FILE *fp,
+     }
+   else
+     grouping = NULL;
++#else
++  grouping = NULL;
++#endif
+ 
+   /* Fetch the argument value.	*/
+ #ifndef __NO_LONG_DOUBLE_MATH
+diff --git a/stdio-common/printf_fphex.c b/stdio-common/printf_fphex.c
+index 6c3b5e9..f660ce0 100644
+--- a/stdio-common/printf_fphex.c
++++ b/stdio-common/printf_fphex.c
+@@ -28,6 +28,7 @@
+ #include <_itoa.h>
+ #include <_itowa.h>
+ #include <locale/localeinfo.h>
++#include <gnu/option-groups.h>
+ #include <stdbool.h>
+ #include <rounding-mode.h>
+ 
+@@ -139,10 +140,18 @@ __printf_fphex (FILE *fp,
+   int done = 0;
+ 
+   /* Nonzero if this is output on a wide character stream.  */
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+   int wide = info->wide;
++#else
++  /* This should never be called on a wide-oriented stream when
++     OPTION_POSIX_C_LANG_WIDE_CHAR is disabled, but the compiler can't
++     be trusted to figure that out.  */
++  const int wide = 0;
++#endif
+ 
+ 
+   /* Figure out the decimal point character.  */
++#if __OPTION_EGLIBC_LOCALE_CODE
+   if (info->extra == 0)
+     {
+       decimal = _NL_CURRENT (LC_NUMERIC, DECIMAL_POINT);
+@@ -156,6 +165,10 @@ __printf_fphex (FILE *fp,
+     }
+   /* The decimal point character must never be zero.  */
+   assert (*decimal != '\0' && decimalwc != L'\0');
++#else
++  decimal = ".";
++  decimalwc = L'.';
++#endif
+ 
+ 
+   /* Fetch the argument value.	*/
+diff --git a/stdio-common/printf_size.c b/stdio-common/printf_size.c
+index 7dcd58e..6fb7491 100644
+--- a/stdio-common/printf_size.c
++++ b/stdio-common/printf_size.c
+@@ -23,6 +23,7 @@
+ #include <math.h>
+ #include <printf.h>
+ #include <libioP.h>
++#include <gnu/option-groups.h>
+ 
+ 
+ /* This defines make it possible to use the same code for GNU C library and
+@@ -116,7 +117,14 @@ __printf_size (FILE *fp, const struct printf_info *info,
+ 
+   struct printf_info fp_info;
+   int done = 0;
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+   int wide = info->wide;
++#else
++  /* This should never be called on a wide-oriented stream when
++     OPTION_POSIX_C_LANG_WIDE_CHAR is disabled, but the compiler can't
++     be trusted to figure that out.  */
++  const int wide = 0;
++#endif
+   int res;
+ 
+   /* Fetch the argument value.	*/
+diff --git a/stdio-common/scanf14.c b/stdio-common/scanf14.c
+index cffccb0..6cc260a 100644
+--- a/stdio-common/scanf14.c
++++ b/stdio-common/scanf14.c
+@@ -3,6 +3,7 @@
+ #include <string.h>
+ #include <wchar.h>
+ #include <libc-internal.h>
++#include <gnu/option-groups.h>
+ 
+ #define FAIL() \
+   do {							\
+@@ -48,6 +49,7 @@ main (void)
+   /* See explanation above.  */
+   DIAG_PUSH_NEEDS_COMMENT;
+   DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wformat");
++#if __OPTION_EGLIBC_LOCALE_CODE
+   if (sscanf (" 3.25S x", "%4aS%3c", &lsp, c) != 2)
+     FAIL ();
+   else
+@@ -57,6 +59,7 @@ main (void)
+       memset (lsp, 'x', sizeof L"3.25");
+       free (lsp);
+     }
++#endif
+   if (sscanf ("4.25[0-9.] x", "%a[0-9.]%8c", &sp, c) != 2)
+     FAIL ();
+   else
+diff --git a/stdio-common/tst-popen.c b/stdio-common/tst-popen.c
+index 5def27f..7c9b91e 100644
+--- a/stdio-common/tst-popen.c
++++ b/stdio-common/tst-popen.c
+@@ -19,6 +19,7 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <wchar.h>
++#include <gnu/option-groups.h>
+ 
+ static int
+ do_test (void)
+@@ -34,12 +35,14 @@ do_test (void)
+       return 1;
+     }
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+   /* POSIX says that pipe streams are byte-oriented.  */
+   if (fwide (f, 0) >= 0)
+     {
+       puts ("popen did not return byte-oriented stream");
+       result = 1;
+     }
++#endif
+ 
+   if (getline (&line, &len, f) != 5)
+     {
+diff --git a/stdio-common/tst-sprintf.c b/stdio-common/tst-sprintf.c
+index d5284b9..f1e3d21 100644
+--- a/stdio-common/tst-sprintf.c
++++ b/stdio-common/tst-sprintf.c
+@@ -3,7 +3,7 @@
+ #include <locale.h>
+ #include <string.h>
+ #include <libc-internal.h>
+-
++#include <gnu/option-groups.h>
+ 
+ static int
+ do_test (void)
+@@ -11,12 +11,14 @@ do_test (void)
+   char buf[100];
+   int result = 0;
+ 
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+   if (sprintf (buf, "%.0ls", L"foo") != 0
+       || strlen (buf) != 0)
+     {
+       puts ("sprintf (buf, \"%.0ls\", L\"foo\") produced some output");
+       result = 1;
+     }
++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
+ 
+ #define SIZE (1024*70000)
+ #define STR(x) #x
+diff --git a/stdio-common/tstdiomisc.c b/stdio-common/tstdiomisc.c
+index 5548a71..31ed024 100644
+--- a/stdio-common/tstdiomisc.c
++++ b/stdio-common/tstdiomisc.c
+@@ -4,6 +4,7 @@
+ #include <string.h>
+ #include <wchar.h>
+ #include <libc-internal.h>
++#include <gnu/option-groups.h>
+ 
+ static int
+ t1 (void)
+@@ -134,6 +135,7 @@ F (void)
+   printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n",
+ 	  buf);
+ 
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+   swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]), L"%a %A %e %E %f %F %g %G",
+ 	    qnanval, qnanval, qnanval, qnanval,
+ 	    qnanval, qnanval, qnanval, qnanval);
+@@ -171,6 +173,7 @@ F (void)
+   result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
+   printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
+ 	  wbuf);
++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
+ 
+   lqnanval = NAN;
+ 
+@@ -215,6 +218,7 @@ F (void)
+   printf ("expected \"-inf -INF -inf -INF -inf -INF -inf -INF\", got \"%s\"\n",
+ 	  buf);
+ 
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
+   swprintf (wbuf, sizeof wbuf / sizeof (wbuf[0]),
+ 	    L"%La %LA %Le %LE %Lf %LF %Lg %LG",
+ 	    lqnanval, lqnanval, lqnanval, lqnanval,
+@@ -259,6 +263,7 @@ F (void)
+   result |= wcscmp (wbuf, L"-inf -INF -inf -INF -inf -INF -inf -INF") != 0;
+   printf ("expected L\"-inf -INF -inf -INF -inf -INF -inf -INF\", got L\"%S\"\n",
+ 	  wbuf);
++#endif /* __OPTION_POSIX_C_LANG_WIDE_CHAR */
+ 
+   return result;
+ }
+diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
+index 0592e70..f21d973 100644
+--- a/stdio-common/vfprintf.c
++++ b/stdio-common/vfprintf.c
+@@ -29,6 +29,7 @@
+ #include <_itoa.h>
+ #include <locale/localeinfo.h>
+ #include <stdio.h>
++#include <gnu/option-groups.h>
+ 
+ /* This code is shared between the standard stdio implementation found
+    in GNU C library and the libio implementation originally found in
+@@ -140,6 +141,18 @@ typedef wchar_t THOUSANDS_SEP_T;
+ # define EOF WEOF
+ #endif
+ 
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
++# define MULTIBYTE_SUPPORT (1)
++#else
++# define MULTIBYTE_SUPPORT (0)
++#endif
++
++#if __OPTION_EGLIBC_LOCALE_CODE
++# define LOCALE_SUPPORT (1)
++#else
++# define LOCALE_SUPPORT (0)
++#endif
++
+ #include "_i18n_number.h"
+ 
+ /* Include the shared code for parsing the format string.  */
+@@ -1065,8 +1078,11 @@ static const uint8_t jump_table[] =
+ # define process_string_arg(fspec) \
+     LABEL (form_character):						      \
+       /* Character.  */							      \
+-      if (is_long)							      \
+-	goto LABEL (form_wcharacter);					      \
++      if (is_long)                                                            \
++        {                                                                     \
++          assert (MULTIBYTE_SUPPORT);                                         \
++          goto LABEL (form_wcharacter);                                       \
++        }                                                                     \
+       --width;	/* Account for the character itself.  */		      \
+       if (!left)							      \
+ 	PAD (' ');							      \
+@@ -1079,6 +1095,7 @@ static const uint8_t jump_table[] =
+       break;								      \
+ 									      \
+     LABEL (form_wcharacter):						      \
++      assert (MULTIBYTE_SUPPORT);                                             \
+       {									      \
+ 	/* Wide character.  */						      \
+ 	char buf[MB_CUR_MAX];						      \
+@@ -1145,6 +1162,7 @@ static const uint8_t jump_table[] =
+ 	  }								      \
+ 	else								      \
+ 	  {								      \
++            assert (MULTIBYTE_SUPPORT);                                       \
+ 	    const wchar_t *s2 = (const wchar_t *) string;		      \
+ 	    mbstate_t mbstate;						      \
+ 									      \
+@@ -1399,7 +1417,9 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
+     LABEL (flag_quote):
+       group = 1;
+ 
+-      if (grouping == (const char *) -1)
++      if (! LOCALE_SUPPORT)
++        grouping = NULL;
++      else if (grouping == (const char *) -1)
+ 	{
+ #ifdef COMPILE_WPRINTF
+ 	  thousands_sep = _NL_CURRENT_WORD (LC_NUMERIC,
+@@ -1728,8 +1748,9 @@ printf_positional (_IO_FILE *s, const CHAR_T *format, int readonly_format,
+   size_t cnt;
+ 
+   CHAR_T *workstart = NULL;
+-
+-  if (grouping == (const char *) -1)
++  if (! LOCALE_SUPPORT)
++    grouping = NULL;
++  else if (grouping == (const char *) -1)
+     {
+ #ifdef COMPILE_WPRINTF
+       thousands_sep = _NL_CURRENT_WORD (LC_NUMERIC,
+diff --git a/stdio-common/vfscanf.c b/stdio-common/vfscanf.c
+index 0e204e7..66cc0af 100644
+--- a/stdio-common/vfscanf.c
++++ b/stdio-common/vfscanf.c
+@@ -29,6 +29,7 @@
+ #include <wctype.h>
+ #include <bits/libc-lock.h>
+ #include <locale/localeinfo.h>
++#include <gnu/option-groups.h>
+ 
+ #ifdef	__GNUC__
+ # define HAVE_LONGLONG
+@@ -133,6 +134,12 @@
+ # define WINT_T		int
+ #endif
+ 
++#if __OPTION_POSIX_C_LANG_WIDE_CHAR
++# define MULTIBYTE_SUPPORT (1)
++#else
++# define MULTIBYTE_SUPPORT (0)
++#endif
++
+ #define encode_error() do {						      \
+ 			  errval = 4;					      \
+ 			  __set_errno (EILSEQ);				      \
+@@ -316,24 +323,35 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+   ARGCHECK (s, format);
+ 
+  {
+-#ifndef COMPILE_WSCANF
++#if __OPTION_EGLIBC_LOCALE_CODE && !defined (COMPILE_WSCANF)
+    struct __locale_data *const curnumeric = loc->__locales[LC_NUMERIC];
+ #endif
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+    /* Figure out the decimal point character.  */
+-#ifdef COMPILE_WSCANF
++# ifdef COMPILE_WSCANF
+    decimal = _NL_CURRENT_WORD (LC_NUMERIC, _NL_NUMERIC_DECIMAL_POINT_WC);
+-#else
++# else
+    decimal = curnumeric->values[_NL_ITEM_INDEX (DECIMAL_POINT)].string;
+-#endif
++# endif
+    /* Figure out the thousands separator character.  */
+-#ifdef COMPILE_WSCANF
++# ifdef COMPILE_WSCANF
+    thousands = _NL_CURRENT_WORD (LC_NUMERIC, _NL_NUMERIC_THOUSANDS_SEP_WC);
+-#else
++# else
+    thousands = curnumeric->values[_NL_ITEM_INDEX (THOUSANDS_SEP)].string;
+    if (*thousands == '\0')
+      thousands = NULL;
+-#endif
++# endif
++#else /* if ! __OPTION_EGLIBC_LOCALE_CODE */
++   /* Hard-code values from the C locale.  */
++# ifdef COMPILE_WSCANF
++   decimal = L'.';
++   thousands = L'\0';
++# else
++   decimal = ".";
++   thousands = NULL;
++# endif
++#endif /* __OPTION_EGLIBC_LOCALE_CODE */
+  }
+ 
+   /* Lock the stream.  */
+@@ -385,6 +403,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+ #ifndef COMPILE_WSCANF
+       if (!isascii ((unsigned char) *f))
+ 	{
++          assert (MULTIBYTE_SUPPORT);
++
+ 	  /* Non-ASCII, may be a multibyte.  */
+ 	  int len = __mbrlen (f, strlen (f), &state);
+ 	  if (len > 0)
+@@ -830,6 +850,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+ 	    }
+ 	  /* FALLTHROUGH */
+ 	case L_('C'):
++          assert (MULTIBYTE_SUPPORT);
++
+ 	  if (width == -1)
+ 	    width = 1;
+ 
+@@ -1172,6 +1194,8 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+ 	  /* FALLTHROUGH */
+ 
+ 	case L_('S'):
++          assert (MULTIBYTE_SUPPORT);
++
+ 	  {
+ #ifndef COMPILE_WSCANF
+ 	    mbstate_t cstate;
+@@ -1419,10 +1443,17 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+ 	      const char *mbdigits[10];
+ 	      const char *mbdigits_extended[10];
+ #endif
++#if __OPTION_EGLIBC_LOCALE_CODE
+ 	      /*  "to_inpunct" is a map from ASCII digits to their
+ 		  equivalent in locale. This is defined for locales
+ 		  which use an extra digits set.  */
+ 	      wctrans_t map = __wctrans ("to_inpunct");
++#else
++              /* This will always be the case when
++                 OPTION_EGLIBC_LOCALE_CODE is disabled, but the
++                 compiler can't figure that out.  */
++              wctrans_t map = NULL;
++#endif
+ 	      int n;
+ 
+ 	      from_level = 0;
+@@ -2088,6 +2119,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+ 		--width;
+ 	    }
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+ 	  wctrans_t map;
+ 	  if (__builtin_expect ((flags & I18N) != 0, 0)
+ 	      /* Hexadecimal floats make no sense, fixing localized
+@@ -2304,6 +2336,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+ 	      ;
+ #endif
+ 	    }
++#endif /* __OPTION_EGLIBC_LOCALE_CODE */
+ 
+ 	  /* Have we read any character?  If we try to read a number
+ 	     in hexadecimal notation and we have read only the `0x'
+@@ -2343,7 +2376,10 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+ 
+ 	case L_('['):	/* Character class.  */
+ 	  if (flags & LONG)
+-	    STRING_ARG (wstr, wchar_t, 100);
++            {
++              assert (MULTIBYTE_SUPPORT);
++              STRING_ARG (wstr, wchar_t, 100);
++            }
+ 	  else
+ 	    STRING_ARG (str, char, 100);
+ 
+@@ -2417,6 +2453,7 @@ _IO_vfscanf_internal (_IO_FILE *s, const char *format, _IO_va_list argptr,
+ 	  if (flags & LONG)
+ 	    {
+ 	      size_t now = read_in;
++              assert (MULTIBYTE_SUPPORT);
+ #ifdef COMPILE_WSCANF
+ 	      if (__glibc_unlikely (inchar () == WEOF))
+ 		input_error ();
+diff --git a/stdlib/Makefile b/stdlib/Makefile
+index 402466a..7e7e304 100644
+--- a/stdlib/Makefile
++++ b/stdlib/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Makefile for stdlib routines
+ #
++include ../option-groups.mak
++
+ subdir	:= stdlib
+ 
+ include ../Makeconfig
+@@ -30,7 +32,7 @@ headers	:= stdlib.h bits/stdlib.h bits/stdlib-ldbl.h bits/stdlib-float.h      \
+ 	   alloca.h fmtmsg.h						      \
+ 	   bits/stdlib-bsearch.h
+ 
+-routines	:=							      \
++routines-y	:=							      \
+ 	atof atoi atol atoll						      \
+ 	abort								      \
+ 	bsearch qsort msort						      \
+@@ -39,7 +41,6 @@ routines	:=							      \
+ 	quick_exit at_quick_exit cxa_at_quick_exit cxa_thread_atexit_impl     \
+ 	abs labs llabs							      \
+ 	div ldiv lldiv							      \
+-	mblen mbstowcs mbtowc wcstombs wctomb				      \
+ 	random random_r rand rand_r					      \
+ 	drand48 erand48 lrand48 nrand48 mrand48 jrand48			      \
+ 	srand48 seed48 lcong48						      \
+@@ -52,9 +53,18 @@ routines	:=							      \
+ 	strtof_l strtod_l strtold_l					      \
+ 	system canonicalize						      \
+ 	a64l l64a							      \
+-	rpmatch strfmon strfmon_l getsubopt xpg_basename fmtmsg		      \
+-	strtoimax strtoumax wcstoimax wcstoumax				      \
++	getsubopt xpg_basename						      \
++	strtoimax strtoumax						      \
+ 	getcontext setcontext makecontext swapcontext
++routines-$(OPTION_EGLIBC_LOCALE_CODE) +=				      \
++	strfmon strfmon_l
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) +=				      \
++	mblen mbstowcs mbtowc wcstombs wctomb				      \
++	wcstoimax wcstoumax
++ifeq (yy,$(OPTION_EGLIBC_LOCALE_CODE)$(OPTION_POSIX_REGEXP))
++routines-y += rpmatch
++endif
++routines-$(OPTION_EGLIBC_FMTMSG) += fmtmsg
+ aux =	grouping groupingwc tens_in_limb
+ 
+ # These routines will be omitted from the libc shared object.
+@@ -62,20 +72,24 @@ aux =	grouping groupingwc tens_in_limb
+ # linked against when the shared library will be used.
+ static-only-routines = atexit at_quick_exit
+ 
+-test-srcs	:= tst-fmtmsg
+-tests		:= tst-strtol tst-strtod testmb testrand testsort testdiv   \
++test-srcs-$(OPTION_EGLIBC_FMTMSG)	:= tst-fmtmsg
++tests		:= tst-strtol tst-strtod testrand testsort testdiv	    \
+ 		   test-canon test-canon2 tst-strtoll tst-environ	    \
+ 		   tst-xpg-basename tst-random tst-random2 tst-bsearch	    \
+ 		   tst-limits tst-rand48 bug-strtod tst-setcontext          \
+-		   tst-setcontext2 test-a64l tst-qsort tst-system testmb2   \
+-		   bug-strtod2 tst-atof1 tst-atof2 tst-strtod2 tst-strtod3  \
+-		   tst-rand48-2 tst-makecontext tst-strtod4 tst-strtod5     \
++		   tst-setcontext2 test-a64l tst-qsort tst-system	    \
++		   bug-strtod2 tst-atof1 tst-atof2 tst-strtod2 		    \
++		   tst-rand48-2 tst-makecontext 			    \
+ 		   tst-qsort2 tst-makecontext2 tst-strtod6 tst-unsetenv1    \
+ 		   tst-makecontext3 bug-getcontext bug-fmtmsg1		    \
+ 		   tst-secure-getenv tst-strtod-overflow tst-strtod-round   \
+ 		   tst-tininess tst-strtod-underflow tst-tls-atexit	    \
+ 		   tst-setcontext3 tst-tls-atexit-nodelete
+ tests-static	:= tst-secure-getenv
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++		+= tst-strtod3 tst-strtod4 tst-strtod5 testmb2
++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++		+= testmb
+ 
+ modules-names	= tst-tls-atexit-lib
+ 
+@@ -116,8 +130,10 @@ CFLAGS-tst-makecontext2.c = $(stack-align-test-flags)
+ tests-special += $(objpfx)isomac.out
+ 
+ ifeq ($(run-built-tests),yes)
++ifeq (y,$(OPTION_EGLIBC_FMTMSG))
+ tests-special += $(objpfx)tst-fmtmsg.out
+ endif
++endif
+ 
+ include ../Rules
+ 
+diff --git a/stdlib/strtod_l.c b/stdlib/strtod_l.c
+index e13ab1e..63efe41 100644
+--- a/stdlib/strtod_l.c
++++ b/stdlib/strtod_l.c
+@@ -17,6 +17,7 @@
+    License along with the GNU C Library; if not, see
+    <http://www.gnu.org/licenses/>.  */
+ 
++#include <gnu/option-groups.h>
+ #include <xlocale.h>
+ 
+ extern double ____strtod_l_internal (const char *, char **, int, __locale_t);
+@@ -548,6 +549,7 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
+   /* Used in several places.  */
+   int cnt;
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+   struct __locale_data *current = loc->__locales[LC_NUMERIC];
+ 
+   if (__glibc_unlikely (group))
+@@ -586,6 +588,17 @@ ____STRTOF_INTERNAL (nptr, endptr, group, loc)
+   decimal_len = strlen (decimal);
+   assert (decimal_len > 0);
+ #endif
++#else /* if ! __OPTION_EGLIBC_LOCALE_CODE */
++  /* Hard-code values from the 'C' locale.  */
++  grouping = NULL;
++#ifdef USE_WIDE_CHAR
++  decimal = L'.';
++# define decimal_len 1
++#else
++  decimal = ".";
++  decimal_len = 1;
++#endif
++#endif /* __OPTION_EGLIBC_LOCALE_CODE */
+ 
+   /* Prepare number representation.  */
+   exponent = 0;
+diff --git a/stdlib/tst-strtod.c b/stdlib/tst-strtod.c
+index a469208..28fb423 100644
+--- a/stdlib/tst-strtod.c
++++ b/stdlib/tst-strtod.c
+@@ -23,6 +23,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <math.h>
++#include <gnu/option-groups.h>
+ 
+ struct ltest
+   {
+@@ -176,7 +177,9 @@ main (int argc, char ** argv)
+ 
+   status |= long_dbl ();
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+   status |= locale_test ();
++#endif
+ 
+   return status ? EXIT_FAILURE : EXIT_SUCCESS;
+ }
+@@ -219,6 +222,7 @@ long_dbl (void)
+   return 0;
+ }
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+ /* Perform a few tests in a locale with thousands separators.  */
+ static int
+ locale_test (void)
+@@ -276,3 +280,4 @@ locale_test (void)
+ 
+   return result;
+ }
++#endif /* __OPTION_EGLIBC_LOCALE_CODE */
+diff --git a/streams/Makefile b/streams/Makefile
+index a8a6162..ceb423f 100644
+--- a/streams/Makefile
++++ b/streams/Makefile
+@@ -18,11 +18,14 @@
+ #
+ #	Makefile for streams.
+ #
++include ../option-groups.mak
++
+ subdir	:= streams
+ 
+ include ../Makeconfig
+ 
+ headers		= stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h
+-routines	= isastream getmsg getpmsg putmsg putpmsg fattach fdetach
++routines-$(OPTION_EGLIBC_STREAMS) \
++	+= isastream getmsg getpmsg putmsg putpmsg fattach fdetach
+ 
+ include ../Rules
+diff --git a/string/Makefile b/string/Makefile
+index 8424a61..5988834 100644
+--- a/string/Makefile
++++ b/string/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Sub-makefile for string portion of library.
+ #
++include ../option-groups.mak
++
+ subdir	:= string
+ 
+ include ../Makeconfig
+@@ -39,10 +41,12 @@ routines	:= strcat strchr strcmp strcoll strcpy strcspn		\
+ 		   $(addprefix argz-,append count create ctsep next	\
+ 				     delete extract insert stringify	\
+ 				     addsep replace)			\
+-		   envz basename					\
++		   basename						\
+ 		   strcoll_l strxfrm_l string-inlines memrchr		\
+ 		   xpg-strerror strerror_l
+ 
++routines-$(OPTION_EGLIBC_ENVZ) += envz
++
+ strop-tests	:= memchr memcmp memcpy memmove mempcpy memset memccpy	\
+ 		   stpcpy stpncpy strcat strchr strcmp strcpy strcspn	\
+ 		   strlen strncmp strncpy strpbrk strrchr strspn memmem	\
+@@ -51,10 +55,12 @@ strop-tests	:= memchr memcmp memcpy memmove mempcpy memset memccpy	\
+ tests		:= tester inl-tester noinl-tester testcopy test-ffs	\
+ 		   tst-strlen stratcliff tst-svc tst-inlcall		\
+ 		   bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap	\
+-		   tst-strtok tst-strxfrm bug-strcoll1 tst-strfry	\
++		   tst-strtok tst-strfry	\
+ 		   bug-strtok1 $(addprefix test-,$(strop-tests))	\
+-		   bug-envz1 tst-strxfrm2 tst-endian tst-svc2		\
+-		   tst-strtok_r
++		   tst-strxfrm2 tst-endian tst-svc2 tst-strtok_r
++tests-$(OPTION_EGLIBC_ENVZ) += bug-envz1
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++		+= tst-strxfrm bug-strcoll1
+ 
+ xtests = tst-strcoll-overflow
+ 
+diff --git a/string/strcoll_l.c b/string/strcoll_l.c
+index 8f1225f..b36b18c 100644
+--- a/string/strcoll_l.c
++++ b/string/strcoll_l.c
+@@ -24,6 +24,7 @@
+ #include <stdint.h>
+ #include <string.h>
+ #include <sys/param.h>
++#include <gnu/option-groups.h>
+ 
+ #ifndef STRING_TYPE
+ # define STRING_TYPE char
+@@ -260,7 +261,11 @@ int
+ STRCOLL (const STRING_TYPE *s1, const STRING_TYPE *s2, __locale_t l)
+ {
+   struct __locale_data *current = l->__locales[LC_COLLATE];
++#if __OPTION_EGLIBC_LOCALE_CODE
+   uint_fast32_t nrules = current->values[_NL_ITEM_INDEX (_NL_COLLATE_NRULES)].word;
++#else
++  const uint_fast32_t nrules = 0;
++#endif
+   /* We don't assign the following values right away since it might be
+      unnecessary in case there are no rules.  */
+   const unsigned char *rulesets;
+diff --git a/string/strerror_l.c b/string/strerror_l.c
+index 2ed78b5..6584813 100644
+--- a/string/strerror_l.c
++++ b/string/strerror_l.c
+@@ -21,6 +21,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/param.h>
++#include <gnu/option-groups.h>
+ 
+ 
+ static __thread char *last_value;
+@@ -29,10 +30,14 @@ static __thread char *last_value;
+ static const char *
+ translate (const char *str, locale_t loc)
+ {
++#if __OPTION_EGLIBC_LOCALE_CODE
+   locale_t oldloc = __uselocale (loc);
+   const char *res = _(str);
+   __uselocale (oldloc);
+   return res;
++#else
++  return str;
++#endif
+ }
+ 
+ 
+diff --git a/string/strxfrm_l.c b/string/strxfrm_l.c
+index 8b61ea2..41fdc22 100644
+--- a/string/strxfrm_l.c
++++ b/string/strxfrm_l.c
+@@ -24,6 +24,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/param.h>
++#include <gnu/option-groups.h>
+ 
+ #ifndef STRING_TYPE
+ # define STRING_TYPE char
+@@ -669,7 +670,11 @@ STRXFRM (STRING_TYPE *dest, const STRING_TYPE *src, size_t n, __locale_t l)
+ {
+   locale_data_t l_data;
+   struct __locale_data *current = l->__locales[LC_COLLATE];
++#if __OPTION_EGLIBC_LOCALE_CODE
+   l_data.nrules = current->values[_NL_ITEM_INDEX (_NL_COLLATE_NRULES)].word;
++#else
++  l_data.nrules = 0;
++#endif
+ 
+   /* Handle byte comparison case.  */
+   if (l_data.nrules == 0)
+diff --git a/string/test-strcmp.c b/string/test-strcmp.c
+index dc4ba6f..a978656 100644
+--- a/string/test-strcmp.c
++++ b/string/test-strcmp.c
+@@ -329,34 +329,6 @@ check (void)
+ 		FOR_EACH_IMPL (impl, 0)
+ 		check_result (impl, s1 + i1, s2 + i2, exp_result);
+       }
+-
+-  /* Test cases where there are multiple zero bytes after the first.  */
+-
+-  for (size_t i = 0; i < 16 + 1; i++)
+-    {
+-      s1[i] = 0x00;
+-      s2[i] = 0x00;
+-    }
+-
+-  for (size_t i = 0; i < 16; i++)
+-    {
+-      int exp_result;
+-
+-      for (int val = 0x01; val < 0x100; val++)
+-	{
+-	  for (size_t j = 0; j < i; j++)
+-	    {
+-	      s1[j] = val;
+-	      s2[j] = val;
+-	    }
+-
+-	  s2[i] = val;
+-
+-	  exp_result = SIMPLE_STRCMP (s1, s2);
+-	  FOR_EACH_IMPL (impl, 0)
+-	    check_result (impl, s1, s2, exp_result);
+-	}
+-    }
+ }
+ 
+ 
+diff --git a/string/tst-strxfrm.c b/string/tst-strxfrm.c
+index f48cfc0..c3a51f9 100644
+--- a/string/tst-strxfrm.c
++++ b/string/tst-strxfrm.c
+@@ -3,6 +3,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <gnu/option-groups.h>
+ 
+ 
+ char const string[] = "";
+@@ -64,8 +65,10 @@ do_test (void)
+   int result = 0;
+ 
+   result |= test ("C");
++#if __OPTION_EGLIBC_LOCALE_CODE
+   result |= test ("en_US.ISO-8859-1");
+   result |= test ("de_DE.UTF-8");
++#endif
+ 
+   return result;
+ }
+diff --git a/string/tst-strxfrm2.c b/string/tst-strxfrm2.c
+index d5a1115..19c7f30 100644
+--- a/string/tst-strxfrm2.c
++++ b/string/tst-strxfrm2.c
+@@ -1,6 +1,7 @@
+ #include <locale.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <gnu/option-groups.h>
+ 
+ static int
+ do_test (void)
+@@ -38,6 +39,7 @@ do_test (void)
+       res = 1;
+     }
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+   if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL)
+     {
+       puts ("setlocale failed");
+@@ -75,6 +77,7 @@ do_test (void)
+ 	  res = 1;
+ 	}
+     }
++#endif
+ 
+   return res;
+ }
+diff --git a/sunrpc/Makefile b/sunrpc/Makefile
+index 60caa0a..5bc70ab 100644
+--- a/sunrpc/Makefile
++++ b/sunrpc/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Sub-makefile for sunrpc portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= sunrpc
+ 
+ include ../Makeconfig
+@@ -55,7 +57,6 @@ headers-in-tirpc = $(addprefix rpc/,auth.h auth_unix.h clnt.h pmap_clnt.h \
+ headers-not-in-tirpc = $(addprefix rpc/,key_prot.h rpc_des.h) \
+ 		       $(rpcsvc:%=rpcsvc/%) rpcsvc/bootparam.h
+ headers = rpc/netdb.h
+-install-others = $(inst_sysconfdir)/rpc
+ generated += $(rpcsvc:%.x=rpcsvc/%.h) $(rpcsvc:%.x=x%.c) $(rpcsvc:%.x=x%.stmp) \
+ 	     $(rpcsvc:%.x=rpcsvc/%.stmp) rpcgen
+ generated-dirs += rpcsvc
+@@ -65,20 +66,28 @@ headers += $(headers-in-tirpc) $(headers-not-in-tirpc)
+ endif
+ 
+ ifeq ($(build-shared),yes)
+-need-export-routines := auth_des auth_unix clnt_gen clnt_perr clnt_tcp \
++need-export-routines-$(OPTION_EGLIBC_SUNRPC) := \
++			auth_des auth_unix clnt_gen clnt_perr clnt_tcp \
+ 			clnt_udp get_myaddr key_call netname pm_getport \
+-			rpc_thread svc svc_tcp svc_udp xcrypt xdr_array xdr \
++			rpc_thread svc svc_tcp svc_udp xdr_array xdr \
+ 			xdr_intXX_t xdr_mem xdr_ref xdr_sizeof xdr_stdio \
+ 			svc_run
++need-export-routines-y += xcrypt
++need-export-routines := $(need-export-routines-y)
+ 
+-routines := auth_none authuxprot bindrsvprt clnt_raw clnt_simp \
++routines-$(OPTION_EGLIBC_SUNRPC) := \
++	    auth_none authuxprot bindrsvprt clnt_raw clnt_simp \
+ 	    rpc_dtable getrpcport pmap_clnt pm_getmaps pmap_prot pmap_prot2 \
+ 	    pmap_rmt rpc_prot rpc_common rpc_cmsg svc_auth svc_authux svc_raw \
+ 	    svc_simple xdr_float xdr_rec publickey authdes_prot \
+-	    des_crypt des_impl des_soft key_prot openchild rtime svcauth_des \
++	    key_prot openchild rtime svcauth_des \
+ 	    getrpcent getrpcbyname getrpcbynumber \
+ 	    getrpcent_r getrpcbyname_r getrpcbynumber_r \
+-	    clnt_unix svc_unix create_xid $(need-export-routines)
++	    clnt_unix svc_unix create_xid
++
++# xdecrypt is also used by nss/nss_files/files-key.c.
++routines-y += des_crypt des_impl des_soft $(need-export-routines)
++
+ ifneq ($(link-obsolete-rpc),yes)
+ # We only add the RPC for compatibility to libc.so.
+ shared-only-routines = $(routines)
+@@ -87,25 +96,28 @@ endif
+ 
+ # We do not build rpcinfo anymore.  It is not needed for a bootstrap
+ # and not wanted on complete systems.
+-# others := rpcinfo
+-# install-sbin := rpcinfo
+-install-bin := rpcgen
++# others-$(OPTION_EGLIBC_SUNRPC) += rpcinfo
++# install-sbin-$(OPTION_EGLIBC_SUNRPC) += rpcinfo
++install-bin-$(OPTION_EGLIBC_SUNRPC) += rpcgen
+ rpcgen-objs = rpc_main.o rpc_hout.o rpc_cout.o rpc_parse.o \
+ 	      rpc_scan.o rpc_util.o rpc_svcout.o rpc_clntout.o \
+ 	      rpc_tblout.o rpc_sample.o
+-extra-objs = $(rpcgen-objs) $(addprefix cross-,$(rpcgen-objs))
+-others += rpcgen
++extra-objs-$(OPTION_EGLIBC_SUNRPC) = $(rpcgen-objs) $(addprefix cross-,$(rpcgen-objs))
++others-$(OPTION_EGLIBC_SUNRPC) += rpcgen
++
++install-others-$(OPTION_EGLIBC_SUNRPC) += $(inst_sysconfdir)/rpc
+ 
+-tests = tst-xdrmem tst-xdrmem2 test-rpcent
+-xtests := tst-getmyaddr
++tests-$(OPTION_EGLIBC_SUNRPC) = tst-xdrmem tst-xdrmem2 test-rpcent
++xtests-$(OPTION_EGLIBC_SUNRPC) := tst-getmyaddr
+ 
+ ifeq ($(have-thread-library),yes)
+-xtests += thrsvc
++xtests-$(OPTION_EGLIBC_SUNRPC) += thrsvc
+ endif
+ 
+ headers += $(rpcsvc:%.x=rpcsvc/%.h)
+-extra-libs := librpcsvc
+-extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
++extra-libs-$(OPTION_EGLIBC_SUNRPC) += librpcsvc
++# Make it in `others' pass, not `lib' pass.
++extra-libs-others-y += $(extra-libs-y)
+ librpcsvc-routines = $(rpcsvc:%.x=x%)
+ librpcsvc-inhibit-o = .os # Build no shared rpcsvc library.
+ omit-deps = $(librpcsvc-routines)
+diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile
+index 17c129b..543791a 100644
+--- a/sysdeps/arm/Makefile
++++ b/sysdeps/arm/Makefile
+@@ -37,10 +37,13 @@ ifeq ($(subdir),csu)
+ # get offset to rtld_global._dl_hwcap
+ gen-as-const-headers += rtld-global-offsets.sym tlsdesc.sym
+ aeabi_constants = aeabi_lcsts aeabi_sighandlers aeabi_math
+-aeabi_routines = aeabi_assert aeabi_localeconv aeabi_errno_addr \
++aeabi_routines = aeabi_assert aeabi_errno_addr \
+ 		 aeabi_mb_cur_max aeabi_atexit aeabi_memclr aeabi_memcpy \
+ 		 aeabi_memmove aeabi_memset \
+ 		 aeabi_read_tp libc-aeabi_read_tp
++ifeq (y,$(OPTION_EGLIBC_LOCALE_CODE))
++aeabi_routines += aeabi_localeconv
++endif
+ 
+ sysdep_routines += $(aeabi_constants) $(aeabi_routines)
+ static-only-routines += $(aeabi_constants) aeabi_read_tp
+diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
+index 7a0fe8d..a3e2c0a 100644
+--- a/sysdeps/generic/ldsodefs.h
++++ b/sysdeps/generic/ldsodefs.h
+@@ -435,6 +435,12 @@ extern struct rtld_global _rtld_global __rtld_global_attribute__;
+ # undef __rtld_global_attribute__
+ #endif
+ 
++#if __OPTION_EGLIBC_RTLD_DEBUG
++# define GLRO_dl_debug_mask GLRO(dl_debug_mask)
++#else
++# define GLRO_dl_debug_mask 0
++#endif
++
+ #ifndef SHARED
+ # define GLRO(name) _##name
+ #else
+@@ -447,8 +453,10 @@ struct rtld_global_ro
+ {
+ #endif
+ 
++#if __OPTION_EGLIBC_RTLD_DEBUG
+   /* If nonzero the appropriate debug information is printed.  */
+   EXTERN int _dl_debug_mask;
++#endif
+ #define DL_DEBUG_LIBS	    (1 << 0)
+ #define DL_DEBUG_IMPCALLS   (1 << 1)
+ #define DL_DEBUG_BINDINGS   (1 << 2)
+diff --git a/sysdeps/gnu/Makefile b/sysdeps/gnu/Makefile
+index ea68037..3175cc3 100644
+--- a/sysdeps/gnu/Makefile
++++ b/sysdeps/gnu/Makefile
+@@ -59,7 +59,8 @@ $(foreach o,$(object-suffixes) $(object-suffixes:=.d),\
+ endif
+ 
+ ifeq ($(subdir),login)
+-sysdep_routines += setutxent getutxent endutxent getutxid getutxline \
++sysdep_routines-$(OPTION_EGLIBC_UTMPX) \
++		+= setutxent getutxent endutxent getutxid getutxline \
+ 		   pututxline utmpxname updwtmpx getutmpx getutmp
+ 
+ sysdep_headers += utmpx.h bits/utmpx.h
+diff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile
+index 222122d..4509357 100644
+--- a/sysdeps/ieee754/ldbl-opt/Makefile
++++ b/sysdeps/ieee754/ldbl-opt/Makefile
+@@ -11,19 +11,18 @@ libm-routines += s_nexttowardfd
+ routines += math_ldbl_opt nldbl-compat
+ 
+ extra-libs += libnldbl
+-libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
++libnldbl-calls = asprintf dprintf fprintf fscanf iovfscanf \
+ 		 obstack_printf obstack_vprintf printf scanf snprintf \
+-		 sprintf sscanf swprintf swscanf vasprintf vdprintf vfprintf \
+-		 vfscanf vfwprintf vfwscanf vprintf vscanf vsnprintf \
+-		 vsprintf vsscanf vswprintf vswscanf vwprintf vwscanf \
+-		 wprintf wscanf printf_fp printf_size \
+-		 fprintf_chk fwprintf_chk printf_chk snprintf_chk sprintf_chk \
+-		 swprintf_chk vfprintf_chk vfwprintf_chk vprintf_chk \
+-		 vsnprintf_chk vsprintf_chk vswprintf_chk vwprintf_chk \
+-		 wprintf_chk asprintf_chk vasprintf_chk dprintf_chk \
++		 sprintf sscanf vasprintf vdprintf vfprintf \
++		 vfscanf vprintf vscanf vsnprintf \
++		 vsprintf vsscanf \
++		 printf_fp printf_size \
++		 fprintf_chk printf_chk snprintf_chk sprintf_chk \
++		 vfprintf_chk vprintf_chk \
++		 vsnprintf_chk vsprintf_chk \
++		 asprintf_chk vasprintf_chk dprintf_chk \
+ 		 vdprintf_chk obstack_printf_chk obstack_vprintf_chk \
+ 		 syslog syslog_chk vsyslog vsyslog_chk \
+-		 strfmon strfmon_l \
+ 		 strtold strtold_l strtoldint wcstold wcstold_l wcstoldint \
+ 		 qecvt qfcvt qgcvt qecvt_r qfcvt_r \
+ 		 isinf isnan finite signbit scalb log2 lgamma_r ceil \
+@@ -38,9 +37,15 @@ libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \
+ 		 casinh cexp clog cproj csin csinh csqrt ctan ctanh cpow \
+ 		 cabs carg cimag creal clog10 \
+ 		 isoc99_scanf isoc99_fscanf isoc99_sscanf \
+-		 isoc99_vscanf isoc99_vfscanf isoc99_vsscanf \
++		 isoc99_vscanf isoc99_vfscanf isoc99_vsscanf
++libnldbl-calls-$(OPTION_EGLIBC_LOCALE_CODE) += strfmon strfmon_l
++libnldbl-calls-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) += fwprintf fwscanf \
++		 swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf \
++		 vwprintf vwscanf wprintf wscanf fwprintf_chk swprintf_chk \
++		 vfwprintf_chk vswprintf_chk vwprintf_chk wprintf_chk \
+ 		 isoc99_wscanf isoc99_fwscanf isoc99_swscanf \
+ 		 isoc99_vwscanf isoc99_vfwscanf isoc99_vswscanf
++libnldbl-calls += $(libnldbl-calls-y)
+ libnldbl-routines = $(libnldbl-calls:%=nldbl-%)
+ libnldbl-inhibit-o = $(object-suffixes)
+ libnldbl-static-only-routines = $(libnldbl-routines)
+diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+index 0198886..55501cd 100644
+--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
++++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c
+@@ -26,6 +26,7 @@
+ #include <locale/localeinfo.h>
+ #include <sys/syslog.h>
+ #include <bits/libc-lock.h>
++#include <gnu/option-groups.h>
+ 
+ #include "nldbl-compat.h"
+ 
+@@ -33,20 +34,14 @@ libc_hidden_proto (__nldbl_vfprintf)
+ libc_hidden_proto (__nldbl_vsscanf)
+ libc_hidden_proto (__nldbl_vsprintf)
+ libc_hidden_proto (__nldbl_vfscanf)
+-libc_hidden_proto (__nldbl_vfwscanf)
+ libc_hidden_proto (__nldbl_vdprintf)
+-libc_hidden_proto (__nldbl_vswscanf)
+-libc_hidden_proto (__nldbl_vfwprintf)
+-libc_hidden_proto (__nldbl_vswprintf)
+ libc_hidden_proto (__nldbl_vsnprintf)
+ libc_hidden_proto (__nldbl_vasprintf)
+ libc_hidden_proto (__nldbl_obstack_vprintf)
+-libc_hidden_proto (__nldbl___vfwprintf_chk)
+ libc_hidden_proto (__nldbl___vsnprintf_chk)
+ libc_hidden_proto (__nldbl___vfprintf_chk)
+ libc_hidden_proto (__nldbl___vsyslog_chk)
+ libc_hidden_proto (__nldbl___vsprintf_chk)
+-libc_hidden_proto (__nldbl___vswprintf_chk)
+ libc_hidden_proto (__nldbl___vasprintf_chk)
+ libc_hidden_proto (__nldbl___vdprintf_chk)
+ libc_hidden_proto (__nldbl___obstack_vprintf_chk)
+@@ -54,8 +49,17 @@ libc_hidden_proto (__nldbl___vstrfmon)
+ libc_hidden_proto (__nldbl___vstrfmon_l)
+ libc_hidden_proto (__nldbl___isoc99_vsscanf)
+ libc_hidden_proto (__nldbl___isoc99_vfscanf)
++
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
++libc_hidden_proto (__nldbl_vfwscanf)
++libc_hidden_proto (__nldbl_vswscanf)
++libc_hidden_proto (__nldbl_vfwprintf)
++libc_hidden_proto (__nldbl_vswprintf)
++libc_hidden_proto (__nldbl___vfwprintf_chk)
++libc_hidden_proto (__nldbl___vswprintf_chk)
+ libc_hidden_proto (__nldbl___isoc99_vswscanf)
+ libc_hidden_proto (__nldbl___isoc99_vfwscanf)
++#endif
+ 
+ static void
+ __nldbl_cleanup (void *arg)
+@@ -117,6 +121,7 @@ __nldbl_fprintf (FILE *stream, const char *fmt, ...)
+ }
+ weak_alias (__nldbl_fprintf, __nldbl__IO_fprintf)
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ int
+ attribute_compat_text_section weak_function
+ __nldbl_fwprintf (FILE *stream, const wchar_t *fmt, ...)
+@@ -130,6 +135,7 @@ __nldbl_fwprintf (FILE *stream, const wchar_t *fmt, ...)
+ 
+   return done;
+ }
++#endif
+ 
+ int
+ attribute_compat_text_section
+@@ -226,6 +232,7 @@ __nldbl_snprintf (char *s, size_t maxlen, const char *fmt, ...)
+   return done;
+ }
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ int
+ attribute_compat_text_section
+ __nldbl_swprintf (wchar_t *s, size_t n, const wchar_t *fmt, ...)
+@@ -239,6 +246,7 @@ __nldbl_swprintf (wchar_t *s, size_t n, const wchar_t *fmt, ...)
+ 
+   return done;
+ }
++#endif
+ 
+ int
+ attribute_compat_text_section weak_function
+@@ -264,6 +272,7 @@ __nldbl_vdprintf (int d, const char *fmt, va_list arg)
+ }
+ libc_hidden_def (__nldbl_vdprintf)
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ int
+ attribute_compat_text_section weak_function
+ __nldbl_vfwprintf (FILE *s, const wchar_t *fmt, va_list ap)
+@@ -275,6 +284,7 @@ __nldbl_vfwprintf (FILE *s, const wchar_t *fmt, va_list ap)
+   return res;
+ }
+ libc_hidden_def (__nldbl_vfwprintf)
++#endif
+ 
+ int
+ attribute_compat_text_section
+@@ -297,6 +307,7 @@ __nldbl_vsnprintf (char *string, size_t maxlen, const char *fmt,
+ libc_hidden_def (__nldbl_vsnprintf)
+ weak_alias (__nldbl_vsnprintf, __nldbl___vsnprintf)
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ int
+ attribute_compat_text_section weak_function
+ __nldbl_vswprintf (wchar_t *string, size_t maxlen, const wchar_t *fmt,
+@@ -330,6 +341,7 @@ __nldbl_wprintf (const wchar_t *fmt, ...)
+ 
+   return done;
+ }
++#endif
+ 
+ int
+ attribute_compat_text_section
+@@ -419,6 +431,7 @@ __nldbl_scanf (const char *fmt, ...)
+   return done;
+ }
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ int
+ attribute_compat_text_section
+ __nldbl_vfwscanf (FILE *s, const wchar_t *fmt, va_list ap)
+@@ -491,6 +504,7 @@ __nldbl_wscanf (const wchar_t *fmt, ...)
+ 
+   return done;
+ }
++#endif
+ 
+ int
+ attribute_compat_text_section
+@@ -506,6 +520,7 @@ __nldbl___fprintf_chk (FILE *stream, int flag, const char *fmt, ...)
+   return done;
+ }
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ int
+ attribute_compat_text_section
+ __nldbl___fwprintf_chk (FILE *stream, int flag, const wchar_t *fmt, ...)
+@@ -519,6 +534,7 @@ __nldbl___fwprintf_chk (FILE *stream, int flag, const wchar_t *fmt, ...)
+ 
+   return done;
+ }
++#endif
+ 
+ int
+ attribute_compat_text_section
+@@ -563,6 +579,7 @@ __nldbl___sprintf_chk (char *s, int flag, size_t slen, const char *fmt, ...)
+   return done;
+ }
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ int
+ attribute_compat_text_section
+ __nldbl___swprintf_chk (wchar_t *s, size_t n, int flag, size_t slen,
+@@ -577,6 +594,7 @@ __nldbl___swprintf_chk (wchar_t *s, size_t n, int flag, size_t slen,
+ 
+   return done;
+ }
++#endif
+ 
+ int
+ attribute_compat_text_section
+@@ -590,6 +608,7 @@ __nldbl___vfprintf_chk (FILE *s, int flag, const char *fmt, va_list ap)
+ }
+ libc_hidden_def (__nldbl___vfprintf_chk)
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ int
+ attribute_compat_text_section
+ __nldbl___vfwprintf_chk (FILE *s, int flag, const wchar_t *fmt, va_list ap)
+@@ -601,6 +620,7 @@ __nldbl___vfwprintf_chk (FILE *s, int flag, const wchar_t *fmt, va_list ap)
+   return res;
+ }
+ libc_hidden_def (__nldbl___vfwprintf_chk)
++#endif
+ 
+ int
+ attribute_compat_text_section
+@@ -635,6 +655,7 @@ __nldbl___vsprintf_chk (char *string, int flag, size_t slen, const char *fmt,
+ }
+ libc_hidden_def (__nldbl___vsprintf_chk)
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ int
+ attribute_compat_text_section
+ __nldbl___vswprintf_chk (wchar_t *string, size_t maxlen, int flag, size_t slen,
+@@ -668,6 +689,7 @@ __nldbl___wprintf_chk (int flag, const wchar_t *fmt, ...)
+ 
+   return done;
+ }
++#endif
+ 
+ int
+ attribute_compat_text_section
+@@ -775,6 +797,7 @@ __nldbl___printf_fp (FILE *fp, const struct printf_info *info,
+   return ___printf_fp (fp, &info_no_ldbl, args);
+ }
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+ ssize_t
+ attribute_compat_text_section
+ __nldbl_strfmon (char *s, size_t maxsize, const char *format, ...)
+@@ -829,6 +852,7 @@ __nldbl___vstrfmon_l (char *s, size_t maxsize, __locale_t loc,
+   return res;
+ }
+ libc_hidden_def (__nldbl___vstrfmon_l)
++#endif
+ 
+ void
+ attribute_compat_text_section
+@@ -941,6 +965,7 @@ __nldbl___isoc99_scanf (const char *fmt, ...)
+   return done;
+ }
+ 
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ int
+ attribute_compat_text_section
+ __nldbl___isoc99_vfwscanf (FILE *s, const wchar_t *fmt, va_list ap)
+@@ -1014,6 +1039,7 @@ __nldbl___isoc99_wscanf (const wchar_t *fmt, ...)
+ 
+   return done;
+ }
++#endif
+ 
+ #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_0)
+ compat_symbol (libc, __nldbl__IO_printf, _IO_printf, GLIBC_2_0);
+@@ -1057,6 +1083,7 @@ compat_symbol (libc, __nldbl_printf_size, printf_size, GLIBC_2_1);
+ compat_symbol (libc, __nldbl___strfmon_l, __strfmon_l, GLIBC_2_1);
+ #endif
+ #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_2)
++# if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
+ compat_symbol (libc, __nldbl_swprintf, swprintf, GLIBC_2_2);
+ compat_symbol (libc, __nldbl_vwprintf, vwprintf, GLIBC_2_2);
+ compat_symbol (libc, __nldbl_wprintf, wprintf, GLIBC_2_2);
+@@ -1069,6 +1096,7 @@ compat_symbol (libc, __nldbl_vfwscanf, vfwscanf, GLIBC_2_2);
+ compat_symbol (libc, __nldbl_vswscanf, vswscanf, GLIBC_2_2);
+ compat_symbol (libc, __nldbl_vwscanf, vwscanf, GLIBC_2_2);
+ compat_symbol (libc, __nldbl_wscanf, wscanf, GLIBC_2_2);
++# endif
+ #endif
+ #if LONG_DOUBLE_COMPAT(libc, GLIBC_2_3)
+ compat_symbol (libc, __nldbl_strfmon_l, strfmon_l, GLIBC_2_3);
+diff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
+index 0d2c8af..f4cea50 100644
+--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
++++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h
+@@ -30,6 +30,7 @@
+ #include <math.h>
+ #include <monetary.h>
+ #include <sys/syslog.h>
++#include <gnu/option-groups.h>
+ 
+ 
+ /* Declare the __nldbl_NAME function the wrappers call that's in libc.so.  */
+@@ -37,19 +38,15 @@
+ 
+ NLDBL_DECL (_IO_vfscanf);
+ NLDBL_DECL (vfscanf);
+-NLDBL_DECL (vfwscanf);
+ NLDBL_DECL (obstack_vprintf);
+ NLDBL_DECL (vasprintf);
+ NLDBL_DECL (dprintf);
+ NLDBL_DECL (vdprintf);
+ NLDBL_DECL (fprintf);
+ NLDBL_DECL (vfprintf);
+-NLDBL_DECL (vfwprintf);
+ NLDBL_DECL (vsnprintf);
+ NLDBL_DECL (vsprintf);
+ NLDBL_DECL (vsscanf);
+-NLDBL_DECL (vswprintf);
+-NLDBL_DECL (vswscanf);
+ NLDBL_DECL (__asprintf);
+ NLDBL_DECL (asprintf);
+ NLDBL_DECL (__printf_fp);
+@@ -66,12 +63,18 @@ NLDBL_DECL (__isoc99_sscanf);
+ NLDBL_DECL (__isoc99_vscanf);
+ NLDBL_DECL (__isoc99_vfscanf);
+ NLDBL_DECL (__isoc99_vsscanf);
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
++NLDBL_DECL (vfwscanf);
++NLDBL_DECL (vfwprintf);
++NLDBL_DECL (vswprintf);
++NLDBL_DECL (vswscanf);
+ NLDBL_DECL (__isoc99_wscanf);
+ NLDBL_DECL (__isoc99_fwscanf);
+ NLDBL_DECL (__isoc99_swscanf);
+ NLDBL_DECL (__isoc99_vwscanf);
+ NLDBL_DECL (__isoc99_vfwscanf);
+ NLDBL_DECL (__isoc99_vswscanf);
++#endif
+ 
+ /* This one does not exist in the normal interface, only
+    __nldbl___vstrfmon really exists.  */
+@@ -82,22 +85,23 @@ extern ssize_t __nldbl___vstrfmon (char *, size_t, const char *, va_list)
+    since we don't compile with _FORTIFY_SOURCE.  */
+ extern int __nldbl___vfprintf_chk (FILE *__restrict, int,
+ 				   const char *__restrict, _G_va_list);
+-extern int __nldbl___vfwprintf_chk (FILE *__restrict, int,
+-				    const wchar_t *__restrict, __gnuc_va_list);
+ extern int __nldbl___vsprintf_chk (char *__restrict, int, size_t,
+ 				   const char *__restrict, _G_va_list) __THROW;
+ extern int __nldbl___vsnprintf_chk (char *__restrict, size_t, int, size_t,
+ 				    const char *__restrict, _G_va_list)
+   __THROW;
+-extern int __nldbl___vswprintf_chk (wchar_t *__restrict, size_t, int, size_t,
+-				    const wchar_t *__restrict, __gnuc_va_list)
+-  __THROW;
+ extern int __nldbl___vasprintf_chk (char **, int, const char *, _G_va_list)
+   __THROW;
+ extern int __nldbl___vdprintf_chk (int, int, const char *, _G_va_list);
+ extern int __nldbl___obstack_vprintf_chk (struct obstack *, int, const char *,
+ 					  _G_va_list) __THROW;
+ extern void __nldbl___vsyslog_chk (int, int, const char *, va_list);
+-
++#if __OPTION_POSIX_WIDE_CHAR_DEVICE_IO
++extern int __nldbl___vfwprintf_chk (FILE *__restrict, int,
++				    const wchar_t *__restrict, __gnuc_va_list);
++extern int __nldbl___vswprintf_chk (wchar_t *__restrict, size_t, int, size_t,
++				    const wchar_t *__restrict, __gnuc_va_list)
++  __THROW;
++#endif
+ 
+ #endif /* __NLDBL_COMPAT_H */
+diff --git a/sysdeps/nptl/Makefile b/sysdeps/nptl/Makefile
+index e9339a3..782009b 100644
+--- a/sysdeps/nptl/Makefile
++++ b/sysdeps/nptl/Makefile
+@@ -18,6 +18,9 @@
+ 
+ ifeq ($(subdir),nptl)
+ libpthread-sysdep_routines += errno-loc
++ifeq ($(OPTION_EGLIBC_BIG_MACROS),n)
++sysdep_routines += small-macros-fns
++endif
+ endif
+ 
+ ifeq ($(subdir),rt)
+diff --git a/sysdeps/nptl/bits/libc-lock.h b/sysdeps/nptl/bits/libc-lock.h
+index 5599cf1..b839378 100644
+--- a/sysdeps/nptl/bits/libc-lock.h
++++ b/sysdeps/nptl/bits/libc-lock.h
+@@ -24,6 +24,14 @@
+ #include <stddef.h>
+ 
+ 
++#ifdef _LIBC
++# include <lowlevellock.h>
++# include <tls.h>
++# include <pthread-functions.h>
++# include <errno.h> /* For EBUSY.  */
++# include <gnu/option-groups.h> /* For __OPTION_EGLIBC_BIG_MACROS.  */
++#endif
++
+ /* Mutex type.  */
+ #if defined _LIBC || defined _IO_MTSAFE_IO
+ # if (!IS_IN (libc) && !IS_IN (libpthread)) || !defined _LIBC
+@@ -87,6 +95,15 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+ 
+ /* Lock the recursive named lock variable.  */
+ #if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
++# if __OPTION_EGLIBC_BIG_MACROS != 1
++/* EGLIBC: Declare wrapper function for a big macro if either
++   !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from
++   small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2).  */
++extern void __libc_lock_lock_recursive_fn (__libc_lock_recursive_t *);
++libc_hidden_proto (__libc_lock_lock_recursive_fn);
++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
++# if __OPTION_EGLIBC_BIG_MACROS
++
+ # define __libc_lock_lock_recursive(NAME) \
+   do {									      \
+     void *self = THREAD_SELF;						      \
+@@ -97,6 +114,10 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+       }									      \
+     ++(NAME).cnt;							      \
+   } while (0)
++# else
++# define __libc_lock_lock_recursive(NAME)				\
++  __libc_lock_lock_recursive_fn (&(NAME))
++# endif /* __OPTION_EGLIBC_BIG_MACROS */
+ #else
+ # define __libc_lock_lock_recursive(NAME) \
+   __libc_maybe_call (__pthread_mutex_lock, (&(NAME).mutex), 0)
+@@ -104,6 +125,14 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+ 
+ /* Try to lock the recursive named lock variable.  */
+ #if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
++# if __OPTION_EGLIBC_BIG_MACROS != 1
++/* EGLIBC: Declare wrapper function for a big macro if either
++   !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from
++   small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2).  */
++extern int __libc_lock_trylock_recursive_fn (__libc_lock_recursive_t *);
++libc_hidden_proto (__libc_lock_trylock_recursive_fn);
++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
++# if __OPTION_EGLIBC_BIG_MACROS
+ # define __libc_lock_trylock_recursive(NAME) \
+   ({									      \
+     int result = 0;							      \
+@@ -122,6 +151,10 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+       ++(NAME).cnt;							      \
+     result;								      \
+   })
++# else
++# define __libc_lock_trylock_recursive(NAME) \
++  __libc_lock_trylock_recursive_fn (&(NAME))
++# endif /* __OPTION_EGLIBC_BIG_MACROS */
+ #else
+ # define __libc_lock_trylock_recursive(NAME) \
+   __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0)
+@@ -129,6 +162,14 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+ 
+ /* Unlock the recursive named lock variable.  */
+ #if defined _LIBC && (IS_IN (libc) || IS_IN (libpthread))
++# if __OPTION_EGLIBC_BIG_MACROS != 1
++/* EGLIBC: Declare wrapper function for a big macro if either
++   !__OPTION_EGLIBC_BIG_MACROS, or we are using a back door from
++   small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2).  */
++extern void __libc_lock_unlock_recursive_fn (__libc_lock_recursive_t *);
++libc_hidden_proto (__libc_lock_unlock_recursive_fn);
++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
++# if __OPTION_EGLIBC_BIG_MACROS
+ /* We do no error checking here.  */
+ # define __libc_lock_unlock_recursive(NAME) \
+   do {									      \
+@@ -138,6 +179,10 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
+ 	lll_unlock ((NAME).lock, LLL_PRIVATE);				      \
+       }									      \
+   } while (0)
++# else
++# define __libc_lock_unlock_recursive(NAME) \
++  __libc_lock_unlock_recursive_fn (&(NAME))
++# endif /* __OPTION_EGLIBC_BIG_MACROS */
+ #else
+ # define __libc_lock_unlock_recursive(NAME) \
+   __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0)
+diff --git a/sysdeps/nptl/bits/libc-lockP.h b/sysdeps/nptl/bits/libc-lockP.h
+index f55f621..da98869 100644
+--- a/sysdeps/nptl/bits/libc-lockP.h
++++ b/sysdeps/nptl/bits/libc-lockP.h
+@@ -33,6 +33,8 @@
+ #include <lowlevellock.h>
+ #include <tls.h>
+ #include <pthread-functions.h>
++#include <errno.h> /* For EBUSY.  */
++#include <gnu/option-groups.h> /* For __OPTION_EGLIBC_BIG_MACROS.  */
+ 
+ #if IS_IN (libpthread)
+ /* This gets us the declarations of the __pthread_* internal names,
+@@ -171,10 +173,22 @@ typedef pthread_key_t __libc_key_t;
+ 
+ /* Lock the named lock variable.  */
+ #if IS_IN (libc) || IS_IN (libpthread)
+-# ifndef __libc_lock_lock
+-#  define __libc_lock_lock(NAME) \
++# if __OPTION_EGLIBC_BIG_MACROS != 1
++/* EGLIBC: Declare wrapper function for a big macro if either
++   !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from
++   small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2).  */
++extern void __libc_lock_lock_fn (__libc_lock_t *);
++libc_hidden_proto (__libc_lock_lock_fn);
++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
++# if __OPTION_EGLIBC_BIG_MACROS
++#  ifndef __libc_lock_lock
++#   define __libc_lock_lock(NAME) \
+   ({ lll_lock (NAME, LLL_PRIVATE); 0; })
+-# endif
++#  endif
++# else
++#  define __libc_lock_lock(NAME)               \
++  __libc_lock_lock_fn (&(NAME))
++# endif /* __OPTION_EGLIBC_BIG_MACROS */
+ #else
+ # undef __libc_lock_lock
+ # define __libc_lock_lock(NAME) \
+@@ -187,10 +201,22 @@ typedef pthread_key_t __libc_key_t;
+ 
+ /* Try to lock the named lock variable.  */
+ #if IS_IN (libc) || IS_IN (libpthread)
+-# ifndef __libc_lock_trylock
+-#  define __libc_lock_trylock(NAME) \
++# if __OPTION_EGLIBC_BIG_MACROS != 1
++/* EGLIBC: Declare wrapper function for a big macro if either
++   !__OPTION_EGLIBC_BIG_MACROS or we are using a back door from
++   small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2).  */
++extern int __libc_lock_trylock_fn (__libc_lock_t *);
++libc_hidden_proto (__libc_lock_trylock_fn);
++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
++# if __OPTION_EGLIBC_BIG_MACROS
++#  ifndef __libc_lock_trylock
++#   define __libc_lock_trylock(NAME) \
+   lll_trylock (NAME)
+-# endif
++#  endif
++# else
++# define __libc_lock_trylock(NAME) \
++  __libc_lock_trylock_fn (&(NAME))
++# endif /* __OPTION_EGLIBC_BIG_MACROS */
+ #else
+ # undef __libc_lock_trylock
+ # define __libc_lock_trylock(NAME) \
+@@ -206,8 +232,20 @@ typedef pthread_key_t __libc_key_t;
+ 
+ /* Unlock the named lock variable.  */
+ #if IS_IN (libc) || IS_IN (libpthread)
++# if __OPTION_EGLIBC_BIG_MACROS != 1
++/* EGLIBC: Declare wrapper function for a big macro if either
++   !__OPTION_EGLIBC_BIG_MACROS, or we are using a back door from
++   small-macros-fns.c (__OPTION_EGLIBC_BIG_MACROS == 2).  */
++extern void __libc_lock_unlock_fn (__libc_lock_t *);
++libc_hidden_proto (__libc_lock_unlock_fn);
++# endif /* __OPTION_EGLIBC_BIG_MACROS != 1 */
++# if __OPTION_EGLIBC_BIG_MACROS
+ # define __libc_lock_unlock(NAME) \
+   lll_unlock (NAME, LLL_PRIVATE)
++# else
++# define __libc_lock_unlock(NAME) \
++  __libc_lock_unlock_fn (&(NAME))
++# endif /* __OPTION_EGLIBC_BIG_MACROS */
+ #else
+ # define __libc_lock_unlock(NAME) \
+   __libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0)
+diff --git a/sysdeps/nptl/small-macros-fns.c b/sysdeps/nptl/small-macros-fns.c
+new file mode 100644
+index 0000000..f751053
+--- /dev/null
++++ b/sysdeps/nptl/small-macros-fns.c
+@@ -0,0 +1,72 @@
++/* EGLIBC: function wrappers for big macros.
++   Copyright (C) 2009 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public License as
++   published by the Free Software Foundation; either version 2.1 of the
++   License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; see the file COPYING.LIB.  If not,
++   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
++   Boston, MA 02111-1307, USA.  */
++
++#include <gnu/option-groups.h>
++
++/* Handle macros from ./bits/libc-lock.h.  */
++#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
++
++/* Get the macros for function bodies through a back door.  */
++# undef __OPTION_EGLIBC_BIG_MACROS
++# define __OPTION_EGLIBC_BIG_MACROS 2
++# include <bits/libc-lock.h>
++
++void
++__libc_lock_lock_fn (__libc_lock_t *name)
++{
++  __libc_lock_lock (*name);
++}
++libc_hidden_def (__libc_lock_lock_fn);
++
++void
++__libc_lock_lock_recursive_fn (__libc_lock_recursive_t *name)
++{
++  __libc_lock_lock_recursive (*name);
++}
++libc_hidden_def (__libc_lock_lock_recursive_fn);
++
++int
++__libc_lock_trylock_fn (__libc_lock_t *name)
++{
++  return __libc_lock_trylock (*name);
++}
++libc_hidden_def (__libc_lock_trylock_fn);
++
++int
++__libc_lock_trylock_recursive_fn (__libc_lock_recursive_t *name)
++{
++  return __libc_lock_trylock_recursive (*name);
++}
++libc_hidden_def (__libc_lock_trylock_recursive_fn);
++
++void
++__libc_lock_unlock_fn (__libc_lock_t *name)
++{
++  __libc_lock_unlock (*name);
++}
++libc_hidden_def (__libc_lock_unlock_fn);
++
++void
++__libc_lock_unlock_recursive_fn (__libc_lock_recursive_t *name)
++{
++  __libc_lock_unlock_recursive (*name);
++}
++libc_hidden_def (__libc_lock_unlock_recursive_fn);
++
++#endif /*defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)*/
+diff --git a/sysdeps/unix/sysv/linux/gethostid.c b/sysdeps/unix/sysv/linux/gethostid.c
+index 26e4692..d0a26c8 100644
+--- a/sysdeps/unix/sysv/linux/gethostid.c
++++ b/sysdeps/unix/sysv/linux/gethostid.c
+@@ -21,6 +21,7 @@
+ #include <unistd.h>
+ #include <netdb.h>
+ #include <not-cancel.h>
++#include <gnu/option-groups.h>
+ 
+ #define HOSTIDFILE "/etc/hostid"
+ 
+@@ -89,6 +90,7 @@ gethostid (void)
+ 	return id;
+     }
+ 
++#if __OPTION_EGLIBC_INET
+   /* Getting from the file was not successful.  An intelligent guess for
+      a unique number of a host is its IP address.  Return this.  */
+   if (__gethostname (hostname, MAXHOSTNAMELEN) < 0 || hostname[0] == '\0')
+@@ -115,5 +117,9 @@ gethostid (void)
+   /* For the return value to be not exactly the IP address we do some
+      bit fiddling.  */
+   return (int32_t) (in.s_addr << 16 | in.s_addr >> 16);
++#else
++  /* Return an arbitrary value.  */
++  return 0;
++#endif
+ }
+ #endif
+diff --git a/sysdeps/unix/sysv/linux/libc_fatal.c b/sysdeps/unix/sysv/linux/libc_fatal.c
+index 53a8bbb..cb110d4 100644
+--- a/sysdeps/unix/sysv/linux/libc_fatal.c
++++ b/sysdeps/unix/sysv/linux/libc_fatal.c
+@@ -23,6 +23,7 @@
+ #include <string.h>
+ #include <sys/mman.h>
+ #include <sys/uio.h>
++#include <gnu/option-groups.h>
+ 
+ static bool
+ writev_for_fatal (int fd, const struct iovec *iov, size_t niov, size_t total)
+@@ -40,6 +41,7 @@ writev_for_fatal (int fd, const struct iovec *iov, size_t niov, size_t total)
+ static void
+ backtrace_and_maps (int do_abort, bool written, int fd)
+ {
++#if __OPTION_EGLIBC_BACKTRACE
+   if (do_abort > 1 && written)
+     {
+       void *addrs[64];
+@@ -62,6 +64,7 @@ backtrace_and_maps (int do_abort, bool written, int fd)
+           close_not_cancel_no_status (fd2);
+         }
+     }
++#endif /* __OPTION_EGLIBC_BACKTRACE */
+ }
+ #define BEFORE_ABORT		backtrace_and_maps
+ 
+diff --git a/time/Makefile b/time/Makefile
+index a411f62..2d022ca 100644
+--- a/time/Makefile
++++ b/time/Makefile
+@@ -18,6 +18,8 @@
+ #
+ #	Makefile for time routines
+ #
++include ../option-groups.mak
++
+ subdir	:= time
+ 
+ include ../Makeconfig
+@@ -30,15 +32,23 @@ routines := offtime asctime clock ctime ctime_r difftime \
+ 	    tzfile getitimer setitimer			 \
+ 	    stime dysize timegm ftime			 \
+ 	    getdate strptime strptime_l			 \
+-	    strftime wcsftime strftime_l wcsftime_l	 \
++	    strftime strftime_l				 \
+ 	    timespec_get
+-aux :=	    era alt_digit lc-time-cleanup
+ 
+-tests	:= test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
+-	   tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR)                \
++	    := wcsftime wcsftime_l
++aux-$(OPTION_EGLIBC_LOCALE_CODE) += alt_digit era lc-time-cleanup
++
++tests	:= test_time clocktest tst-posixtz \
++	   tst-getdate tst-mktime tst-mktime2 tst-strftime \
+ 	   tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \
+ 	   tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime
+ 
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++	        += tst-strptime tst-ftime_l
++tests-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO) \
++	        += tst_wcsftime
++
+ include ../Rules
+ 
+ tz-cflags = -DTZDIR='"$(zonedir)"' \
+diff --git a/time/strftime_l.c b/time/strftime_l.c
+index b48ef34..bfdd618 100644
+--- a/time/strftime_l.c
++++ b/time/strftime_l.c
+@@ -35,6 +35,10 @@
+ # include "../locale/localeinfo.h"
+ #endif
+ 
++#ifdef _LIBC
++# include <gnu/option-groups.h>
++#endif
++
+ #if defined emacs && !defined HAVE_BCOPY
+ # define HAVE_MEMCPY 1
+ #endif
+@@ -882,7 +886,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
+ 	case L_('C'):
+ 	  if (modifier == L_('E'))
+ 	    {
+-#if HAVE_STRUCT_ERA_ENTRY
++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
+ 	      struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
+ 	      if (era)
+ 		{
+@@ -955,7 +959,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
+ 
+ 	  if (modifier == L_('O') && 0 <= number_value)
+ 	    {
+-#ifdef _NL_CURRENT
++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT)
+ 	      /* Get the locale specific alternate representation of
+ 		 the number NUMBER_VALUE.  If none exist NULL is returned.  */
+ 	      const CHAR_T *cp = nl_get_alt_digit (number_value
+@@ -1260,7 +1264,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
+ 	case L_('Y'):
+ 	  if (modifier == 'E')
+ 	    {
+-#if HAVE_STRUCT_ERA_ENTRY
++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
+ 	      struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
+ 	      if (era)
+ 		{
+@@ -1285,7 +1289,7 @@ __strftime_internal (s, maxsize, format, tp, tzset_called ut_argument
+ 	case L_('y'):
+ 	  if (modifier == L_('E'))
+ 	    {
+-#if HAVE_STRUCT_ERA_ENTRY
++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && HAVE_STRUCT_ERA_ENTRY
+ 	      struct era_entry *era = _nl_get_era_entry (tp HELPER_LOCALE_ARG);
+ 	      if (era)
+ 		{
+diff --git a/time/strptime_l.c b/time/strptime_l.c
+index 5640cce..784ccbc 100644
+--- a/time/strptime_l.c
++++ b/time/strptime_l.c
+@@ -29,6 +29,7 @@
+ 
+ #ifdef _LIBC
+ # define HAVE_LOCALTIME_R 0
++# include <gnu/option-groups.h>
+ # include "../locale/localeinfo.h"
+ #endif
+ 
+@@ -84,7 +85,7 @@ localtime_r (t, tp)
+     if (val < from || val > to)						      \
+       return NULL;							      \
+   } while (0)
+-#ifdef _NL_CURRENT
++#if (! _LIBC || __OPTION_EGLIBC_LOCALE_CODE) && defined (_NL_CURRENT)
+ # define get_alt_number(from, to, n) \
+   ({									      \
+      __label__ do_normal;						      \
+@@ -257,8 +258,10 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+   int cnt;
+   int cnt_longest;
+   size_t val;
++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
+   size_t num_eras;
+   struct era_entry *era = NULL;
++#endif
+   enum ptime_locale_status { not, loc, raw } decided_longest;
+   struct __strptime_state
+   {
+@@ -820,6 +823,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+ 	      s.want_xday = 1;
+ 	      break;
+ 	    case 'C':
++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
+ 	      if (s.decided != raw)
+ 		{
+ 		  if (s.era_cnt >= 0)
+@@ -856,10 +860,12 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+ 
+ 		  s.decided = raw;
+ 		}
++#endif
+ 	      /* The C locale has no era information, so use the
+ 		 normal representation.  */
+ 	      goto match_century;
+  	    case 'y':
++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
+ 	      if (s.decided != raw)
+ 		{
+ 		  get_number(0, 9999, 4);
+@@ -918,9 +924,10 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+ 
+ 		  s.decided = raw;
+ 		}
+-
++#endif
+ 	      goto match_year_in_century;
+ 	    case 'Y':
++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
+ 	      if (s.decided != raw)
+ 		{
+ 		  num_eras = _NL_CURRENT_WORD (LC_TIME,
+@@ -948,6 +955,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+ 
+ 		  s.decided = raw;
+ 		}
++#endif
+ 	      get_number (0, 9999, 4);
+ 	      tm->tm_year = val - 1900;
+ 	      s.want_century = 0;
+@@ -1118,6 +1126,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+ 	tm->tm_year = (s.century - 19) * 100;
+     }
+ 
++#if ! _LIBC || __OPTION_EGLIBC_LOCALE_CODE
+   if (s.era_cnt != -1)
+     {
+       era = _nl_select_era_entry (s.era_cnt HELPER_LOCALE_ARG);
+@@ -1132,6 +1141,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
+ 	tm->tm_year = era->start_date[0];
+     }
+   else
++#endif
+     if (s.want_era)
+       {
+ 	/* No era found but we have seen an E modifier.  Rectify some
+diff --git a/timezone/Makefile b/timezone/Makefile
+index 886b06e..f922684 100644
+--- a/timezone/Makefile
++++ b/timezone/Makefile
+@@ -127,7 +127,7 @@ $(testdata)/XT%: testdata/XT%
+ 
+ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
+ 	sed -e 's|/bin/bash|/bin/sh|' \
+-	    -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
++	    -e '/TZDIR=/s|\$$(pwd)|$(zonedir)|' \
+ 	    -e '/TZVERSION=/s|see_Makefile|"$(version)"|' \
+ 	    -e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
+ 	    -e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
+diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
+index 44a4494..db9fc24 100644
+--- a/wcsmbs/Makefile
++++ b/wcsmbs/Makefile
+@@ -18,15 +18,21 @@
+ #
+ #	Sub-makefile for wcsmbs portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= wcsmbs
+ 
+ include ../Makeconfig
+ 
+ headers	:= wchar.h bits/wchar.h bits/wchar2.h bits/wchar-ldbl.h uchar.h
+ 
+-routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
++# These functions are used by printf_fp.c, even in the plain case; see
++# comments there for OPTION_EGLIBC_LOCALE_CODE.
++routines  := wmemcpy wmemset
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++	  := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
+ 	    wcsncmp wcsncpy wcspbrk wcsrchr wcsspn wcstok wcsstr wmemchr \
+-	    wmemcmp wmemcpy wmemmove wmemset wcpcpy wcpncpy wmempcpy \
++	    wmemcmp wmemmove wcpcpy wcpncpy wmempcpy \
+ 	    btowc wctob mbsinit \
+ 	    mbrlen mbrtowc wcrtomb mbsrtowcs wcsrtombs \
+ 	    mbsnrtowcs wcsnrtombs wcsnlen wcschrnul \
+@@ -38,14 +44,21 @@ routines := wcscat wcschr wcscmp wcscpy wcscspn wcsdup wcslen wcsncat \
+ 	    wcscoll_l wcsxfrm_l \
+ 	    wcscasecmp wcsncase wcscasecmp_l wcsncase_l \
+ 	    wcsmbsload mbsrtowcs_l \
+-	    isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf \
+ 	    isoc99_swscanf isoc99_vswscanf \
+ 	    mbrtoc16 c16rtomb
+ 
+-strop-tests :=  wcscmp wcsncmp wmemcmp wcslen wcschr wcsrchr wcscpy
+-tests := tst-wcstof wcsmbs-tst1 tst-wcsnlen tst-btowc tst-mbrtowc \
+-	 tst-wcrtomb tst-wcpncpy tst-mbsrtowcs tst-wchar-h tst-mbrtowc2 \
+-	 tst-c16c32-1 wcsatcliff $(addprefix test-,$(strop-tests))
++routines-$(OPTION_POSIX_WIDE_CHAR_DEVICE_IO)                           \
++	+= isoc99_wscanf isoc99_vwscanf isoc99_fwscanf isoc99_vfwscanf
++
++strop-tests :=  wcscmp wmemcmp wmemcmp wcslen wcschr wcsrchr wcscpy
++
++tests := tst-wchar-h
++tests-$(OPTION_EGLIBC_LOCALE_CODE) \
++	+= tst-btowc tst-mbrtowc tst-mbrtowc2 tst-wcrtomb tst-c16c32-1
++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++	+= tst-wcstof wcsmbs-tst1 tst-wcsnlen \
++	tst-wcpncpy tst-mbsrtowcs \
++	wcsatcliff $(addprefix test-,$(strop-tests))
+ 
+ include ../Rules
+ 
+diff --git a/wcsmbs/wcsmbsload.c b/wcsmbs/wcsmbsload.c
+index 6bb49bc..2ab9d07 100644
+--- a/wcsmbs/wcsmbsload.c
++++ b/wcsmbs/wcsmbsload.c
+@@ -21,6 +21,7 @@
+ #include <limits.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <gnu/option-groups.h>
+ 
+ #include <locale/localeinfo.h>
+ #include <wcsmbsload.h>
+@@ -143,6 +144,7 @@ __wcsmbs_getfct (const char *to, const char *from, size_t *nstepsp)
+   })
+ 
+ 
++#if __OPTION_EGLIBC_LOCALE_CODE
+ /* Some of the functions here must not be used while setlocale is called.  */
+ __libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
+ 
+@@ -211,6 +213,17 @@ __wcsmbs_load_conv (struct __locale_data *new_category)
+ 
+   __libc_rwlock_unlock (__libc_setlocale_lock);
+ }
++#else
++void
++internal_function
++__wcsmbs_load_conv (struct __locale_data *new_category)
++{
++  /* When OPTION_EGLIBC_LOCALE_CODE is disabled, we should never reach
++     this point: there is no way to change locales, so every locale
++     passed to get_gconv_fcts should be _nl_C_LC_CTYPE.  */
++  abort ();
++}
++#endif
+ 
+ 
+ /* Clone the current conversion function set.  */
+diff --git a/wctype/Makefile b/wctype/Makefile
+index c56f07c..4e8af43 100644
+--- a/wctype/Makefile
++++ b/wctype/Makefile
+@@ -18,14 +18,20 @@
+ #
+ #	Sub-makefile for wctype portion of the library.
+ #
++include ../option-groups.mak
++
+ subdir	:= wctype
+ 
+ include ../Makeconfig
+ 
+ headers		:= wctype.h
+-routines	:= wcfuncs wctype iswctype wctrans towctrans \
+-		   wcfuncs_l wctype_l iswctype_l wctrans_l towctrans_l
+-
+-tests	:= test_wctype test_wcfuncs bug-wctypeh
++routines 	:= wctrans towctrans towctrans_l
++routines-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++		:= wcfuncs wctype iswctype \
++		   wcfuncs_l wctype_l iswctype_l wctrans_l
++
++tests	:=
++tests-$(OPTION_POSIX_C_LANG_WIDE_CHAR) \
++     += test_wctype test_wcfuncs bug-wctypeh
+ 
+ include ../Rules
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0025-eglibc-Install-PIC-archives.patch b/meta/recipes-core/glibc/glibc/0025-eglibc-Install-PIC-archives.patch
new file mode 100644
index 0000000..c359cce
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0025-eglibc-Install-PIC-archives.patch
@@ -0,0 +1,123 @@
+From 5773417fa91a18cd39fb35c9907d72af0ed9ea33 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 01:57:01 +0000
+Subject: [PATCH 25/27] eglibc: Install PIC archives
+
+Forward port from eglibc
+
+2008-02-07  Joseph Myers  <joseph@codesourcery.com>
+
+        * Makerules (install-extras, install-map): New variables.
+        (installed-libcs): Add libc_pic.a.
+        (install-lib): Include _pic.a files for versioned shared
+        libraries.
+        (install-map-nosubdir, install-extras-nosubdir): Add rules for
+        installing extra files.
+        (install-no-libc.a-nosubdir): Depend on install-map-nosubdir and
+        install-extras-nosubdir.
+
+2008-04-01  Maxim Kuvyrkov  <maxim@codesourcery.com>
+
+        * Makerules (install-lib): Don't install libpthread_pic.a.
+        (install-map): Don't install libpthread_pic.map.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makerules | 42 ++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 40 insertions(+), 2 deletions(-)
+
+diff --git a/Makerules b/Makerules
+index 1dd41aa..41778e1 100644
+--- a/Makerules
++++ b/Makerules
+@@ -713,6 +713,9 @@ ifeq ($(build-shared),yes)
+ $(common-objpfx)libc.so: $(common-objpfx)libc.map
+ endif
+ common-generated += libc.so libc_pic.os
++ifndef subdir
++install-extras := soinit.o sofini.o
++endif
+ ifdef libc.so-version
+ $(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so
+ 	$(make-link)
+@@ -955,6 +958,7 @@ endif
+ 
+ install: check-install-supported
+ 
++installed-libcs := $(installed-libcs) $(inst_libdir)/libc_pic.a
+ install: $(installed-libcs)
+ $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force)
+ 	$(make-target-directory)
+@@ -983,6 +987,22 @@ versioned := $(strip $(foreach so,$(install-lib.so),\
+ install-lib.so-versioned := $(filter $(versioned), $(install-lib.so))
+ install-lib.so-unversioned := $(filter-out $(versioned), $(install-lib.so))
+ 
++# Install the _pic.a files for versioned libraries, and corresponding
++# .map files.
++# libpthread_pic.a breaks mklibs, so don't install it and its map.
++install-lib := $(install-lib) $(install-lib.so-versioned:%.so=%_pic.a)
++install-lib := $(filter-out libpthread_pic.a,$(install-lib))
++# Despite having a soname libhurduser and libmachuser do not use symbol
++# versioning, so don't install the corresponding .map files.
++ifeq ($(build-shared),yes)
++install-map := $(patsubst %.so,%.map,\
++			$(foreach L,$(install-lib.so-versioned),$(notdir $L)))
++install-map := $(filter-out libhurduser.map libmachuser.map libpthread.map,$(install-map))
++ifndef subdir
++install-map := $(install-map) libc.map
++endif
++endif
++
+ # For versioned libraries, we install three files:
+ #	$(inst_libdir)/libfoo.so	-- for linking, symlink or ld script
+ #	$(inst_slibdir)/libfoo.so.NN	-- for loading by SONAME, symlink
+@@ -1225,9 +1245,22 @@ $(addprefix $(inst_includedir)/,$(headers-nonh)): $(inst_includedir)/%: \
+ endif	# headers-nonh
+ endif	# headers
+ 
++ifdef install-map
++$(addprefix $(inst_libdir)/,$(patsubst lib%.map,lib%_pic.map,$(install-map))): \
++  $(inst_libdir)/lib%_pic.map: $(common-objpfx)lib%.map $(+force)
++	$(do-install)
++endif
++
++ifdef install-extras
++$(addprefix $(inst_libdir)/libc_pic/,$(install-extras)): \
++  $(inst_libdir)/libc_pic/%.o: $(elf-objpfx)%.os $(+force)
++	$(do-install)
++endif
++
+ .PHONY: install-bin-nosubdir install-bin-script-nosubdir \
+ 	install-rootsbin-nosubdir install-sbin-nosubdir install-lib-nosubdir \
+-	install-data-nosubdir install-headers-nosubdir
++	install-data-nosubdir install-headers-nosubdir install-map-nosubdir \
++	install-extras-nosubdir
+ install-bin-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin))
+ install-bin-script-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin-script))
+ install-rootsbin-nosubdir: \
+@@ -1240,6 +1273,10 @@ install-data-nosubdir: $(addprefix $(inst_datadir)/,$(install-data))
+ install-headers-nosubdir: $(addprefix $(inst_includedir)/,$(headers))
+ install-others-nosubdir: $(install-others)
+ install-others-programs-nosubdir: $(install-others-programs)
++install-map-nosubdir: $(addprefix $(inst_libdir)/,\
++		       $(patsubst lib%.map,lib%_pic.map,$(install-map)))
++install-extras-nosubdir: $(addprefix $(inst_libdir)/libc_pic/,\
++		       $(install-extras))
+ 
+ # We need all the `-nosubdir' targets so that `install' in the parent
+ # doesn't depend on several things which each iterate over the subdirs.
+@@ -1249,7 +1286,8 @@ install-%:: install-%-nosubdir ;
+ 
+ .PHONY: install install-no-libc.a-nosubdir
+ install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir \
+-			    install-lib-nosubdir install-others-nosubdir
++			    install-lib-nosubdir install-others-nosubdir \
++			    install-map-nosubdir install-extras-nosubdir
+ ifeq ($(build-programs),yes)
+ install-no-libc.a-nosubdir: install-bin-nosubdir install-bin-script-nosubdir \
+ 			    install-rootsbin-nosubdir install-sbin-nosubdir \
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0026-eglibc-dl_debug_mask-is-controlled-by-__OPTION_EGLIB.patch b/meta/recipes-core/glibc/glibc/0026-eglibc-dl_debug_mask-is-controlled-by-__OPTION_EGLIB.patch
new file mode 100644
index 0000000..6b611db
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0026-eglibc-dl_debug_mask-is-controlled-by-__OPTION_EGLIB.patch
@@ -0,0 +1,556 @@
+From ba069b3107f5ad200c4ab95e69cf368e2353b00a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 18 Mar 2015 00:46:50 +0000
+Subject: [PATCH 26/27] eglibc: dl_debug_mask is controlled by
+ __OPTION_EGLIBC_RTLD_DEBUG
+
+use GLRO_dl_debug_mask
+
+Singed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ csu/libc-start.c       |  4 ++--
+ elf/dl-cache.c         |  4 ++--
+ elf/dl-close.c         |  6 +++---
+ elf/dl-conflict.c      |  2 +-
+ elf/dl-deps.c          |  6 +++---
+ elf/dl-error.c         |  2 +-
+ elf/dl-fini.c          |  4 ++--
+ elf/dl-init.c          |  4 ++--
+ elf/dl-load.c          | 16 ++++++++--------
+ elf/dl-lookup.c        | 14 +++++++-------
+ elf/dl-object.c        |  2 +-
+ elf/dl-open.c          | 10 +++++-----
+ elf/dl-reloc.c         |  2 +-
+ elf/dl-version.c       |  2 +-
+ elf/get-dynamic-info.h |  2 +-
+ elf/rtld.c             | 22 +++++++++++-----------
+ 16 files changed, 51 insertions(+), 51 deletions(-)
+
+diff --git a/csu/libc-start.c b/csu/libc-start.c
+index 0afa7c0..2151fb6 100644
+--- a/csu/libc-start.c
++++ b/csu/libc-start.c
+@@ -238,7 +238,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
+ 
+   /* Call the initializer of the program, if any.  */
+ #ifdef SHARED
+-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS, 0))
++  if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_IMPCALLS, 0))
+     GLRO(dl_debug_printf) ("\ninitialize program: %s\n\n", argv[0]);
+ #endif
+   if (init)
+@@ -261,7 +261,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
+ #endif
+ 
+ #ifdef SHARED
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_IMPCALLS))
+     GLRO(dl_debug_printf) ("\ntransferring control: %s\n\n", argv[0]);
+ #endif
+ 
+diff --git a/elf/dl-cache.c b/elf/dl-cache.c
+index 862f1d8..dab9c51 100644
+--- a/elf/dl-cache.c
++++ b/elf/dl-cache.c
+@@ -194,7 +194,7 @@ _dl_load_cache_lookup (const char *name)
+   const char *best;
+ 
+   /* Print a message if the loading of libs is traced.  */
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))
+     _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
+ 
+   if (cache == NULL)
+@@ -292,7 +292,7 @@ _dl_load_cache_lookup (const char *name)
+     }
+ 
+   /* Print our result if wanted.  */
+-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS, 0)
++  if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)
+       && best != NULL)
+     _dl_debug_printf ("  trying file=%s\n", best);
+ 
+diff --git a/elf/dl-close.c b/elf/dl-close.c
+index c897247..b1b4bd5 100644
+--- a/elf/dl-close.c
++++ b/elf/dl-close.c
+@@ -125,7 +125,7 @@ _dl_close_worker (struct link_map *map, bool force)
+ 	dl_close_state = rerun;
+ 
+       /* There are still references to this object.  Do nothing more.  */
+-      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
++      if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES))
+ 	_dl_debug_printf ("\nclosing file=%s; direct_opencount=%u\n",
+ 			  map->l_name, map->l_direct_opencount);
+ 
+@@ -269,7 +269,7 @@ _dl_close_worker (struct link_map *map, bool force)
+ 	  if (imap->l_init_called)
+ 	    {
+ 	      /* When debugging print a message first.  */
+-	      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS,
++	      if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_IMPCALLS,
+ 				    0))
+ 		_dl_debug_printf ("\ncalling fini: %s [%lu]\n\n",
+ 				  imap->l_name, nsid);
+@@ -711,7 +711,7 @@ _dl_close_worker (struct link_map *map, bool force)
+ 	  free (imap->l_reldeps);
+ 
+ 	  /* Print debugging message.  */
+-	  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
++	  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES))
+ 	    _dl_debug_printf ("\nfile=%s [%lu];  destroying link map\n",
+ 			      imap->l_name, imap->l_ns);
+ 
+diff --git a/elf/dl-conflict.c b/elf/dl-conflict.c
+index 47a946e..e6a3f21 100644
+--- a/elf/dl-conflict.c
++++ b/elf/dl-conflict.c
+@@ -32,7 +32,7 @@ _dl_resolve_conflicts (struct link_map *l, ElfW(Rela) *conflict,
+ 		       ElfW(Rela) *conflictend)
+ {
+ #if ! ELF_MACHINE_NO_RELA
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_RELOC))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_RELOC))
+     _dl_debug_printf ("\nconflict processing: %s\n", DSO_FILENAME (l->l_name));
+ 
+   {
+diff --git a/elf/dl-deps.c b/elf/dl-deps.c
+index eee146a..1a4b004 100644
+--- a/elf/dl-deps.c
++++ b/elf/dl-deps.c
+@@ -127,7 +127,7 @@ empty dynamic string token substitution"));				      \
+ 	    else							      \
+ 	      {								      \
+ 		/* This is for DT_AUXILIARY.  */			      \
+-		if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))   \
++		if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))   \
+ 		  _dl_debug_printf (N_("\
+ cannot load auxiliary `%s' because of empty dynamic string token "	      \
+ 					    "substitution\n"), __str);	      \
+@@ -303,7 +303,7 @@ _dl_map_object_deps (struct link_map *map,
+ 		args.name = name;
+ 
+ 		/* Say that we are about to load an auxiliary library.  */
+-		if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_LIBS,
++		if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS,
+ 				      0))
+ 		  _dl_debug_printf ("load auxiliary object=%s"
+ 				    " requested by file=%s\n",
+@@ -520,7 +520,7 @@ _dl_map_object_deps (struct link_map *map,
+       runp->map->l_reserved = 0;
+     }
+ 
+-  if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK, 0) != 0
++  if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_PRELINK, 0) != 0
+       && map == GL(dl_ns)[LM_ID_BASE]._ns_loaded)
+     {
+       /* If we are to compute conflicts, we have to build local scope
+diff --git a/elf/dl-error.c b/elf/dl-error.c
+index 0fc3fd8..ea82f4d 100644
+--- a/elf/dl-error.c
++++ b/elf/dl-error.c
+@@ -139,7 +139,7 @@ internal_function
+ _dl_signal_cerror (int errcode, const char *objname, const char *occation,
+ 		   const char *errstring)
+ {
+-  if (__builtin_expect (GLRO(dl_debug_mask)
++  if (__builtin_expect (GLRO_dl_debug_mask
+ 			& ~(DL_DEBUG_STATISTICS|DL_DEBUG_PRELINK), 0))
+     _dl_debug_printf ("%s: error: %s: %s (%s)\n", objname, occation,
+ 		      errstring, receiver ? "continued" : "fatal");
+diff --git a/elf/dl-fini.c b/elf/dl-fini.c
+index 6cfe651..f59f7fe 100644
+--- a/elf/dl-fini.c
++++ b/elf/dl-fini.c
+@@ -234,7 +234,7 @@ _dl_fini (void)
+ 		  || l->l_info[DT_FINI] != NULL)
+ 		{
+ 		  /* When debugging print a message first.  */
+-		  if (__builtin_expect (GLRO(dl_debug_mask)
++		  if (__builtin_expect (GLRO_dl_debug_mask
+ 					& DL_DEBUG_IMPCALLS, 0))
+ 		    _dl_debug_printf ("\ncalling fini: %s [%lu]\n\n",
+ 				      DSO_FILENAME (l->l_name),
+@@ -286,7 +286,7 @@ _dl_fini (void)
+       goto again;
+     }
+ 
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_STATISTICS))
+     _dl_debug_printf ("\nruntime linker statistics:\n"
+ 		      "           final number of relocations: %lu\n"
+ 		      "final number of relocations from cache: %lu\n",
+diff --git a/elf/dl-init.c b/elf/dl-init.c
+index 2f85731..e46e8b6 100644
+--- a/elf/dl-init.c
++++ b/elf/dl-init.c
+@@ -46,7 +46,7 @@ call_init (struct link_map *l, int argc, char **argv, char **env)
+     return;
+ 
+   /* Print a debug message if wanted.  */
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_IMPCALLS))
+     _dl_debug_printf ("\ncalling init: %s\n\n",
+ 		      DSO_FILENAME (l->l_name));
+ 
+@@ -96,7 +96,7 @@ _dl_init (struct link_map *main_map, int argc, char **argv, char **env)
+       ElfW(Addr) *addrs;
+       unsigned int cnt;
+ 
+-      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_IMPCALLS))
++      if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_IMPCALLS))
+ 	_dl_debug_printf ("\ncalling preinit: %s\n\n",
+ 			  DSO_FILENAME (main_map->l_name));
+ 
+diff --git a/elf/dl-load.c b/elf/dl-load.c
+index f664f50..8c28744 100644
+--- a/elf/dl-load.c
++++ b/elf/dl-load.c
+@@ -943,7 +943,7 @@ _dl_map_object_from_fd (const char *name, int fd, struct filebuf *fbp,
+     }
+ 
+   /* Print debugging message.  */
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES))
+     _dl_debug_printf ("file=%s [%lu];  generating link map\n", name, nsid);
+ 
+   /* This is the ELF header.  We read it in `open_verify'.  */
+@@ -1347,7 +1347,7 @@ cannot enable executable stack as shared object requires");
+ 
+   l->l_entry += l->l_addr;
+ 
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES))
+     _dl_debug_printf ("\
+   dynamic: 0x%0*lx  base: 0x%0*lx   size: 0x%0*Zx\n\
+     entry: 0x%0*lx  phdr: 0x%0*lx  phnum:   %*u\n\n",
+@@ -1789,7 +1789,7 @@ open_path (const char *name, size_t namelen, int mode,
+ 
+       /* If we are debugging the search for libraries print the path
+ 	 now if it hasn't happened now.  */
+-      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS)
++      if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS)
+ 	  && current_what != this_dir->what)
+ 	{
+ 	  current_what = this_dir->what;
+@@ -1810,7 +1810,7 @@ open_path (const char *name, size_t namelen, int mode,
+ 	     - buf);
+ 
+ 	  /* Print name we try if this is wanted.  */
+-	  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
++	  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))
+ 	    _dl_debug_printf ("  trying file=%s\n", buf);
+ 
+ 	  fd = open_verify (buf, fbp, loader, whatcode, mode,
+@@ -1955,7 +1955,7 @@ _dl_map_object (struct link_map *loader, const char *name,
+     }
+ 
+   /* Display information if we are debugging.  */
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES)
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES)
+       && loader != NULL)
+     _dl_debug_printf ((mode & __RTLD_CALLMAP) == 0
+ 		      ? "\nfile=%s [%lu];  needed by %s [%lu]\n"
+@@ -1997,7 +1997,7 @@ _dl_map_object (struct link_map *loader, const char *name,
+ 
+       size_t namelen = strlen (name) + 1;
+ 
+-      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
++      if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))
+ 	_dl_debug_printf ("find library=%s [%lu]; searching\n", name, nsid);
+ 
+       fd = -1;
+@@ -2119,7 +2119,7 @@ _dl_map_object (struct link_map *loader, const char *name,
+ #endif
+ 
+       /* Add another newline when we are tracing the library loading.  */
+-      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
++      if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))
+ 	_dl_debug_printf ("\n");
+     }
+   else
+@@ -2152,7 +2152,7 @@ _dl_map_object (struct link_map *loader, const char *name,
+   if (__glibc_unlikely (fd == -1))
+     {
+       if (trace_mode
+-	  && __glibc_likely ((GLRO(dl_debug_mask) & DL_DEBUG_PRELINK) == 0))
++	  && __glibc_likely ((GLRO_dl_debug_mask & DL_DEBUG_PRELINK) == 0))
+ 	{
+ 	  /* We haven't found an appropriate library.  But since we
+ 	     are only interested in the list of libraries this isn't
+diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
+index 11cb44b..588c3e4 100644
+--- a/elf/dl-lookup.c
++++ b/elf/dl-lookup.c
+@@ -302,7 +302,7 @@ do_lookup_unique (const char *undef_name, uint_fast32_t new_hash,
+ 	 hash table.  */
+       if (__glibc_unlikely (tab->size))
+ 	{
+-	  assert (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK);
++	  assert (GLRO_dl_debug_mask & DL_DEBUG_PRELINK);
+ 	  goto success;
+ 	}
+ #endif
+@@ -378,7 +378,7 @@ do_lookup_x (const char *undef_name, uint_fast32_t new_hash,
+ 	continue;
+ 
+       /* Print some debugging info if wanted.  */
+-      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SYMBOLS))
++      if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_SYMBOLS))
+ 	_dl_debug_printf ("symbol=%s;  lookup in file=%s [%lu]\n",
+ 			  undef_name, DSO_FILENAME (map->l_name),
+ 			  map->l_ns);
+@@ -755,7 +755,7 @@ add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
+ 	}
+ 
+       /* Display information if we are debugging.  */
+-      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
++      if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES))
+ 	_dl_debug_printf ("\
+ \nfile=%s [%lu];  needed by %s [%lu] (relocation dependency)\n\n",
+ 			  DSO_FILENAME (map->l_name),
+@@ -859,7 +859,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
+     {
+       if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK)
+ 	  && skip_map == NULL
+-	  && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED))
++	  && !(GLRO_dl_debug_mask & DL_DEBUG_UNUSED))
+ 	{
+ 	  /* We could find no value for a strong reference.  */
+ 	  const char *reference_name = undef_map ? undef_map->l_name : "";
+@@ -935,7 +935,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
+   if (__glibc_unlikely (current_value.m->l_used == 0))
+     current_value.m->l_used = 1;
+ 
+-  if (__glibc_unlikely (GLRO(dl_debug_mask)
++  if (__glibc_unlikely (GLRO_dl_debug_mask
+ 			& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK)))
+     _dl_debug_bindings (undef_name, undef_map, ref,
+ 			&current_value, version, type_class, protected);
+@@ -1000,7 +1000,7 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
+ {
+   const char *reference_name = undef_map->l_name;
+ 
+-  if (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS)
++  if (GLRO_dl_debug_mask & DL_DEBUG_BINDINGS)
+     {
+       _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'",
+ 			DSO_FILENAME (reference_name),
+@@ -1014,7 +1014,7 @@ _dl_debug_bindings (const char *undef_name, struct link_map *undef_map,
+ 	_dl_debug_printf_c ("\n");
+     }
+ #ifdef SHARED
+-  if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
++  if (GLRO_dl_debug_mask & DL_DEBUG_PRELINK)
+     {
+       int conflict = 0;
+       struct sym_val val = { NULL, NULL };
+diff --git a/elf/dl-object.c b/elf/dl-object.c
+index 1d58bbc..938a257 100644
+--- a/elf/dl-object.c
++++ b/elf/dl-object.c
+@@ -98,7 +98,7 @@ _dl_new_object (char *realname, const char *libname, int type,
+   new->l_type = type;
+   /* If we set the bit now since we know it is never used we avoid
+      dirtying the cache line later.  */
+-  if ((GLRO(dl_debug_mask) & DL_DEBUG_UNUSED) == 0)
++  if ((GLRO_dl_debug_mask & DL_DEBUG_UNUSED) == 0)
+     new->l_used = 1;
+   new->l_loader = loader;
+ #if NO_TLS_OFFSET != 0
+diff --git a/elf/dl-open.c b/elf/dl-open.c
+index 2db1c02..1288604 100644
+--- a/elf/dl-open.c
++++ b/elf/dl-open.c
+@@ -147,7 +147,7 @@ add_to_global (struct link_map *new)
+ 	  ns->_ns_main_searchlist->r_list[new_nlist++] = map;
+ 
+ 	  /* We modify the global scope.  Report this.  */
+-	  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES))
++	  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_SCOPES))
+ 	    _dl_debug_printf ("\nadd %s [%lu] to global scope\n",
+ 			      map->l_name, map->l_ns);
+ 	}
+@@ -251,7 +251,7 @@ dl_open_worker (void *a)
+   if (__glibc_unlikely (new->l_searchlist.r_list != NULL))
+     {
+       /* Let the user know about the opencount.  */
+-      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
++      if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES))
+ 	_dl_debug_printf ("opening file=%s [%lu]; direct_opencount=%u\n\n",
+ 			  new->l_name, new->l_ns, new->l_direct_opencount);
+ 
+@@ -302,7 +302,7 @@ dl_open_worker (void *a)
+   LIBC_PROBE (map_complete, 3, args->nsid, r, new);
+ 
+   /* Print scope information.  */
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_SCOPES))
+     _dl_show_scope (new, 0);
+ 
+   /* Only do lazy relocation if `LD_BIND_NOW' is not set.  */
+@@ -519,7 +519,7 @@ dl_open_worker (void *a)
+ 	}
+ 
+       /* Print scope information.  */
+-      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES))
++      if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_SCOPES))
+ 	_dl_show_scope (imap, from_scope);
+     }
+ 
+@@ -577,7 +577,7 @@ TLS generation counter wrapped!  Please report this."));
+ #endif
+ 
+   /* Let the user know about the opencount.  */
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_FILES))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_FILES))
+     _dl_debug_printf ("opening file=%s [%lu]; direct_opencount=%u\n\n",
+ 		      new->l_name, new->l_ns, new->l_direct_opencount);
+ }
+diff --git a/elf/dl-reloc.c b/elf/dl-reloc.c
+index 61252d7..4c83815 100644
+--- a/elf/dl-reloc.c
++++ b/elf/dl-reloc.c
+@@ -178,7 +178,7 @@ _dl_relocate_object (struct link_map *l, struct r_scope_elem *scope[],
+       && __builtin_expect (l->l_info[DT_BIND_NOW] != NULL, 0))
+     lazy = 0;
+ 
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_RELOC))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_RELOC))
+     _dl_debug_printf ("\nrelocation processing: %s%s\n",
+ 		      DSO_FILENAME (l->l_name), lazy ? " (lazy)" : "");
+ 
+diff --git a/elf/dl-version.c b/elf/dl-version.c
+index f6e5cd9..320628c 100644
+--- a/elf/dl-version.c
++++ b/elf/dl-version.c
+@@ -82,7 +82,7 @@ match_symbol (const char *name, Lmid_t ns, ElfW(Word) hash, const char *string,
+   int result = 0;
+ 
+   /* Display information about what we are doing while debugging.  */
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_VERSIONS))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_VERSIONS))
+     _dl_debug_printf ("\
+ checking for version `%s' in file %s [%lu] required by file %s [%lu]\n",
+ 		      string, DSO_FILENAME (map->l_name),
+diff --git a/elf/get-dynamic-info.h b/elf/get-dynamic-info.h
+index dc8359d..7774fda 100644
+--- a/elf/get-dynamic-info.h
++++ b/elf/get-dynamic-info.h
+@@ -166,7 +166,7 @@ elf_get_dynamic_info (struct link_map *l, ElfW(Dyn) *temp)
+ 	 them. Therefore to avoid breaking existing applications the
+ 	 best we can do is add a warning during debugging with the
+ 	 intent of notifying the user of the problem.  */
+-      if (__builtin_expect (GLRO(dl_debug_mask) & DL_DEBUG_FILES, 0)
++      if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_FILES, 0)
+ 	  && l->l_flags_1 & ~DT_1_SUPPORTED_MASK)
+ 	_dl_debug_printf ("\nWARNING: Unsupported flag value(s) of 0x%x in DT_FLAGS_1.\n",
+ 			  l->l_flags_1 & ~DT_1_SUPPORTED_MASK);
+diff --git a/elf/rtld.c b/elf/rtld.c
+index fc3a2db..59c4637 100644
+--- a/elf/rtld.c
++++ b/elf/rtld.c
+@@ -323,7 +323,7 @@ _dl_start_final (void *arg, struct dl_start_final_info *info)
+     }
+ #endif
+ 
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_STATISTICS))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_STATISTICS))
+     {
+ #ifndef HP_TIMING_NONAVAIL
+       print_statistics (&rtld_total_time);
+@@ -1701,7 +1701,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+ 	 after relocation.  */
+       struct link_map *l;
+ 
+-      if (GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
++      if (GLRO_dl_debug_mask & DL_DEBUG_PRELINK)
+ 	{
+ 	  struct r_scope_elem *scope = &main_map->l_searchlist;
+ 
+@@ -1731,7 +1731,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+ 		_dl_printf ("\n");
+ 	    }
+ 	}
+-      else if (GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)
++      else if (GLRO_dl_debug_mask & DL_DEBUG_UNUSED)
+ 	{
+ 	  /* Look through the dependencies of the main executable
+ 	     and determine which of them is not actually
+@@ -1839,7 +1839,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+ 		    }
+ 		}
+ 
+-	      if ((GLRO(dl_debug_mask) & DL_DEBUG_PRELINK)
++	      if ((GLRO_dl_debug_mask & DL_DEBUG_PRELINK)
+ 		  && rtld_multiple_ref)
+ 		{
+ 		  /* Mark the link map as not yet relocated again.  */
+@@ -1972,7 +1972,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+       if (r_list == r_listend && liblist == liblistend)
+ 	prelinked = true;
+ 
+-      if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_LIBS))
++      if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_LIBS))
+ 	_dl_debug_printf ("\nprelink checking: %s\n",
+ 			  prelinked ? "ok" : "failed");
+     }
+@@ -1990,7 +1990,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
+   GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
+ 
+   /* Print scope information.  */
+-  if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_SCOPES))
++  if (__glibc_unlikely (GLRO_dl_debug_mask & DL_DEBUG_SCOPES))
+     {
+       _dl_debug_printf ("\nInitial object scopes\n");
+ 
+@@ -2265,7 +2265,7 @@ process_dl_debug (const char *dl_debug)
+ 	    if (debopts[cnt].len == len
+ 		&& memcmp (dl_debug, debopts[cnt].name, len) == 0)
+ 	      {
+-		GLRO(dl_debug_mask) |= debopts[cnt].mask;
++		GLRO_dl_debug_mask |= debopts[cnt].mask;
+ 		any_debug = 1;
+ 		break;
+ 	      }
+@@ -2286,7 +2286,7 @@ warning: debug option `%s' unknown; try LD_DEBUG=help\n", copy);
+       ++dl_debug;
+     }
+ 
+-  if (GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)
++  if (GLRO_dl_debug_mask & DL_DEBUG_UNUSED)
+     {
+       /* In order to get an accurate picture of whether a particular
+ 	 DT_NEEDED entry is actually used we have to process both
+@@ -2294,7 +2294,7 @@ warning: debug option `%s' unknown; try LD_DEBUG=help\n", copy);
+       GLRO(dl_lazy) = 0;
+     }
+ 
+-  if (GLRO(dl_debug_mask) & DL_DEBUG_HELP)
++  if (GLRO_dl_debug_mask & DL_DEBUG_HELP)
+     {
+       size_t cnt;
+ 
+@@ -2499,7 +2499,7 @@ process_envvars (enum mode *modep)
+ 	      mode = trace;
+ 	      GLRO(dl_verbose) = 1;
+ #if __OPTION_EGLIBC_RTLD_DEBUG
+-	      GLRO(dl_debug_mask) |= DL_DEBUG_PRELINK;
++	      GLRO_dl_debug_mask |= DL_DEBUG_PRELINK;
+ #endif
+ 	      GLRO(dl_trace_prelink) = &envline[17];
+ 	    }
+@@ -2548,7 +2548,7 @@ process_envvars (enum mode *modep)
+ 	{
+ 	  unsetenv ("MALLOC_CHECK_");
+ #if __OPTION_EGLIBC_RTLD_DEBUG
+-	  GLRO(dl_debug_mask) = 0;
++	  GLRO_dl_debug_mask = 0;
+ #endif
+ 	}
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/0027-eglibc-use-option-groups-Conditionally-exclude-c-tes.patch b/meta/recipes-core/glibc/glibc/0027-eglibc-use-option-groups-Conditionally-exclude-c-tes.patch
new file mode 100644
index 0000000..4106167
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/0027-eglibc-use-option-groups-Conditionally-exclude-c-tes.patch
@@ -0,0 +1,145 @@
+From e98779aa56fae0346dff2d0b72acadd0eaf01891 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 27 May 2015 16:10:50 -0700
+Subject: [PATCH 27/27] eglibc-use-option-groups: Conditionally exclude c++
+ tests
+
+    Some test programs written in c++ are still included in spite of
+    "libc-cxx-tests" being omitted from DISTRO_FEATURES_LIBC.
+    All .cc programs are compiled with g++.
+    g++ automatically specifies linking against the C++ library.
+    This patch conditionally excludes the following tests as well:
+
+      bug-atexit3-lib.cc
+      tst-cancel24.cc
+      tst-cancel24-static.cc
+      tst-unique3lib.cc
+      tst-unique3lib2.cc
+      tst-unique4lib.cc
+      tst-unique3.cc
+      tst-unique4.cc
+
+    Tested with DISTRO_FEATURES_LIBC_remove = " libc-cxx-tests"
+
+    [YOCTO #7003]
+
+Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dlfcn/Makefile |  8 ++++++--
+ elf/Makefile   | 19 ++++++++++++++-----
+ nptl/Makefile  | 12 ++++++++++--
+ 3 files changed, 30 insertions(+), 9 deletions(-)
+
+diff --git a/dlfcn/Makefile b/dlfcn/Makefile
+index 3827607..920bd58 100644
+--- a/dlfcn/Makefile
++++ b/dlfcn/Makefile
+@@ -39,16 +39,20 @@ ifeq (yes,$(build-shared))
+ tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \
+ 	bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \
+ 	tstatexit bug-dl-leaf tst-rec-dlopen
+-endif
+-
+ tests-$(OPTION_EGLIBC_CXX_TESTS) += bug-atexit3
+ 
++endif
++
+ modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \
+ 		defaultmod2 errmsg1mod modatexit modcxaatexit \
+ 		bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \
+ 		bug-atexit2-lib bug-dl-leaf-lib \
+ 		bug-dl-leaf-lib-cb moddummy1 moddummy2
+ 
++ifeq (y,$(OPTION_EGLIBC_CXX_TESTS))
++modules-names += bug-atexit3-lib
++endif
++
+ failtestmod.so-no-z-defs = yes
+ glreflib2.so-no-z-defs = yes
+ errmsg1mod.so-no-z-defs = yes
+diff --git a/elf/Makefile b/elf/Makefile
+index 71a18a1..26fe3c5 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -17,6 +17,8 @@
+ 
+ # Makefile for elf subdirectory of GNU C Library.
+ 
++include ../option-groups.mak
++
+ subdir		:= elf
+ 
+ include ../Makeconfig
+@@ -145,12 +147,15 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \
+ 	 unload3 unload4 unload5 unload6 unload7 unload8 tst-global1 order2 \
+ 	 tst-audit1 tst-audit2 tst-audit8 tst-audit9 \
+ 	 tst-stackguard1 tst-addr1 tst-thrlock \
+-	 tst-unique1 tst-unique2 $(if $(CXX),tst-unique3 tst-unique4 \
+-	 tst-nodelete) \
++	 tst-unique1 tst-unique2 \
+ 	 tst-initorder tst-initorder2 tst-relsort1 tst-null-argv \
+ 	 tst-ptrguard1 tst-tlsalign tst-tlsalign-extern tst-nodelete-opened \
+ 	 tst-nodelete2
+ #	 reldep9
++ifeq (y,$(OPTION_EGLIBC_CXX_TESTS))
++tests += $(if $(CXX),tst-unique3 tst-unique4 tst-nodelete)
++endif
++
+ ifeq ($(build-hardcoded-path-in-tests),yes)
+ tests += tst-dlopen-aout
+ LDFLAGS-tst-dlopen-aout = $(no-pie-ldflag)
+@@ -209,9 +214,6 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
+ 		tst-unique1mod1 tst-unique1mod2 \
+ 		tst-unique2mod1 tst-unique2mod2 \
+ 		tst-auditmod9a tst-auditmod9b \
+-		$(if $(CXX),tst-unique3lib tst-unique3lib2 tst-unique4lib \
+-		  tst-nodelete-uniquemod tst-nodelete-rtldmod \
+-		  tst-nodelete-zmod) \
+ 		tst-initordera1 tst-initorderb1 \
+ 		tst-initordera2 tst-initorderb2 \
+ 		tst-initordera3 tst-initordera4 \
+@@ -220,6 +222,13 @@ modules-names = testobj1 testobj2 testobj3 testobj4 testobj5 testobj6 \
+ 		tst-relsort1mod1 tst-relsort1mod2 tst-array2dep \
+ 		tst-array5dep tst-null-argv-lib \
+ 		tst-tlsalign-lib tst-nodelete-opened-lib tst-nodelete2mod
++
++ifeq (y,$(OPTION_EGLIBC_CXX_TESTS))
++modules-names += $(if $(CXX),tst-unique3lib tst-unique3lib2 tst-unique4lib \
++		  tst-nodelete-uniquemod tst-nodelete-rtldmod \
++		  tst-nodelete-zmod)
++endif
++
+ ifeq (yes,$(have-protected-data))
+ modules-names += tst-protected1moda tst-protected1modb
+ tests += tst-protected1a tst-protected1b
+diff --git a/nptl/Makefile b/nptl/Makefile
+index 596ca3c..50a708b 100644
+--- a/nptl/Makefile
++++ b/nptl/Makefile
+@@ -390,12 +390,20 @@ link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
+ 		    $(common-objpfx)libc.a
+ 
+ tests-static += tst-locale1 tst-locale2 tst-stackguard1-static \
+-		tst-cancel21-static tst-cancel24-static tst-cond8-static \
++		tst-cancel21-static tst-cond8-static \
+ 		tst-mutex8-static tst-mutexpi8-static tst-sem11-static \
+ 		tst-sem12-static
+-tests += tst-stackguard1-static tst-cancel21-static tst-cancel24-static \
++
++ifeq (y,$(OPTION_EGLIBC_CXX_TESTS))
++tests-static += tst-cancel24-static
++endif
++
++tests += tst-stackguard1-static tst-cancel21-static \
+ 	 tst-cond8-static tst-mutex8-static tst-mutexpi8-static \
+ 	 tst-sem11-static tst-sem12-static
++
++tests-$(OPTION_EGLIBC_CXX_TESTS) += tst-cancel24-static
++
+ xtests-static += tst-setuid1-static
+ 
+ # These tests are linked with libc before libpthread
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/glibc/glibc/etc/ld.so.conf b/meta/recipes-core/glibc/glibc/etc/ld.so.conf
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/etc/ld.so.conf
diff --git a/meta/recipes-core/glibc/glibc/generate-supported.mk b/meta/recipes-core/glibc/glibc/generate-supported.mk
new file mode 100644
index 0000000..d2a28c2
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/generate-supported.mk
@@ -0,0 +1,11 @@
+#!/usr/bin/make
+
+include $(IN)
+
+all:
+	rm -f $(OUT)
+	touch $(OUT)
+	for locale in $(SUPPORTED-LOCALES); do \
+		[ $$locale = true ] && continue; \
+		echo $$locale | sed 's,/, ,' >> $(OUT); \
+	done
diff --git a/meta/recipes-core/glibc/glibc_2.22.bb b/meta/recipes-core/glibc/glibc_2.22.bb
new file mode 100644
index 0000000..f0e1fad
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc_2.22.bb
@@ -0,0 +1,135 @@
+require glibc.inc
+
+LIC_FILES_CHKSUM = "file://LICENSES;md5=e9a558e243b36d3209f380deb394b213 \
+      file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+      file://posix/rxspencer/COPYRIGHT;md5=dc5485bb394a13b2332ec1c785f5d83a \
+      file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS += "gperf-native kconfig-frontends-native"
+
+SRCREV ?= "a34d1c6afc86521d6ad17662a3b5362d8481514c"
+
+BRANCH ?= "release/${PV}/master"
+
+GLIBC_GIT_URI ?= "git://sourceware.org/git/glibc.git"
+
+SRC_URI = "${GLIBC_GIT_URI};branch=${BRANCH};name=glibc \
+           file://0004-Backport-https-sourceware.org-ml-libc-ports-2007-12-.patch \
+           file://0005-fsl-e500-e5500-e6500-603e-fsqrt-implementation.patch \
+           file://0006-readlib-Add-OECORE_KNOWN_INTERPRETER_NAMES-to-known-.patch \
+           file://0007-ppc-sqrt-Fix-undefined-reference-to-__sqrt_finite.patch \
+           file://0008-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
+           file://0009-Quote-from-bug-1443-which-explains-what-the-patch-do.patch \
+           file://0010-eglibc-run-libm-err-tab.pl-with-specific-dirs-in-S.patch \
+           file://0011-__ieee754_sqrt-f-are-now-inline-functions-and-call-o.patch \
+           file://0012-Make-ld-version-output-matching-grok-gold-s-output.patch \
+           file://0013-sysdeps-gnu-configure.ac-handle-correctly-libc_cv_ro.patch \
+           file://0014-Add-unused-attribute.patch \
+           file://0015-When-disabling-SSE-also-make-sure-that-fpmath-is-not.patch \
+           file://0016-yes-within-the-path-sets-wrong-config-variables.patch \
+           file://0017-timezone-re-written-tzselect-as-posix-sh.patch \
+           file://0018-eglibc-Cross-building-and-testing-instructions.patch \
+           file://0019-eglibc-Bring-Eglibc-option-group-infrastructure-to-g.patch \
+           file://0020-eglibc-Help-bootstrap-cross-toolchain.patch \
+           file://0021-eglibc-cherry-picked-from-http-www.eglibc.org-archiv.patch \
+           file://0022-eglibc-Clear-cache-lines-on-ppc8xx.patch \
+           file://0023-eglibc-Resolve-__fpscr_values-on-SH4.patch \
+           file://0024-eglibc-Forward-port-eglibc-options-groups-support.patch \
+           file://0025-eglibc-Install-PIC-archives.patch \
+           file://0026-eglibc-dl_debug_mask-is-controlled-by-__OPTION_EGLIB.patch \
+           file://0027-eglibc-use-option-groups-Conditionally-exclude-c-tes.patch \
+"
+
+SRC_URI += "\
+           file://etc/ld.so.conf \
+           file://generate-supported.mk \
+"
+
+SRC_URI_append_class-nativesdk = "\
+           file://0001-nativesdk-glibc-Look-for-host-system-ld.so.cache-as-.patch \
+           file://0002-nativesdk-glibc-Fix-buffer-overrun-with-a-relocated-.patch \
+           file://0003-nativesdk-glibc-Raise-the-size-of-arrays-containing-.patch \
+"
+
+S = "${WORKDIR}/git"
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+PACKAGES_DYNAMIC = ""
+
+# the -isystem in bitbake.conf screws up glibc do_stage
+BUILD_CPPFLAGS = "-I${STAGING_INCDIR_NATIVE}"
+TARGET_CPPFLAGS = "-I${STAGING_DIR_TARGET}${includedir}"
+
+GLIBC_BROKEN_LOCALES = " _ER _ET so_ET yn_ER sid_ET tr_TR mn_MN gez_ET gez_ER bn_BD te_IN es_CR.ISO-8859-1"
+
+#
+# We will skip parsing glibc when target system C library selection is not glibc
+# this helps in easing out parsing for non-glibc system libraries
+#
+COMPATIBLE_HOST_libc-musl_class-target = "null"
+COMPATIBLE_HOST_libc-uclibc_class-target = "null"
+
+EXTRA_OECONF = "--enable-kernel=${OLDEST_KERNEL} \
+                --without-cvs --disable-profile \
+                --disable-debug --without-gd \
+                --enable-clocale=gnu \
+                --enable-add-ons \
+                --with-headers=${STAGING_INCDIR} \
+                --without-selinux \
+                --enable-obsolete-rpc \
+                --with-kconfig=${STAGING_BINDIR_NATIVE} \
+                ${GLIBC_EXTRA_OECONF}"
+
+EXTRA_OECONF += "${@get_libc_fpu_setting(bb, d)}"
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-inet-anl', '--enable-nscd', '--disable-nscd', d)}"
+
+
+do_patch_append() {
+    bb.build.exec_func('do_fix_readlib_c', d)
+}
+
+do_fix_readlib_c () {
+	sed -i -e 's#OECORE_KNOWN_INTERPRETER_NAMES#${EGLIBC_KNOWN_INTERPRETER_NAMES}#' ${S}/elf/readlib.c
+}
+
+do_configure () {
+# override this function to avoid the autoconf/automake/aclocal/autoheader
+# calls for now
+# don't pass CPPFLAGS into configure, since it upsets the kernel-headers
+# version check and doesn't really help with anything
+        (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+        find ${S} -name "configure" | xargs touch
+        CPPFLAGS="" oe_runconf
+}
+
+rpcsvc = "bootparam_prot.x nlm_prot.x rstat.x \
+	  yppasswd.x klm_prot.x rex.x sm_inter.x mount.x \
+	  rusers.x spray.x nfs_prot.x rquota.x key_prot.x"
+
+do_compile () {
+	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
+	unset LDFLAGS
+	base_do_compile
+	(
+		cd ${S}/sunrpc/rpcsvc
+		for r in ${rpcsvc}; do
+			h=`echo $r|sed -e's,\.x$,.h,'`
+			rm -f $h
+			${B}/sunrpc/cross-rpcgen -h $r -o $h || bbwarn "${PN}: unable to generate header for $r"
+		done
+	)
+	echo "Adjust ldd script"
+	if [ -n "${RTLDLIST}" ]
+	then
+		prevrtld=`cat ${B}/elf/ldd | grep "^RTLDLIST=" | sed 's#^RTLDLIST="\?\([^"]*\)"\?$#\1#'`
+		if [ "${prevrtld}" != "${RTLDLIST}" ]
+		then
+			sed -i ${B}/elf/ldd -e "s#^RTLDLIST=.*\$#RTLDLIST=\"${prevrtld} ${RTLDLIST}\"#"
+		fi
+	fi
+
+}
+
+require glibc-package.inc
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch
new file mode 100644
index 0000000..cdfeaea
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/32and64bit.patch
@@ -0,0 +1,331 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+We run the ldconfig in the cross fashion. make the code bitsize aware so that 
+we can cross build ldconfig cache for various architectures.
+
+Richard Purdie <richard.purdie@linuxfoundation.org> 2009/05/19
+Nitin A Kamble <nitin.a.kamble@intel.com> 2009/03/29
+
+Index: ldconfig-native-2.12.1/readelflib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readelflib.c
++++ ldconfig-native-2.12.1/readelflib.c
+@@ -40,39 +40,212 @@ do								\
+ 
+ /* Returns 0 if everything is ok, != 0 in case of error.  */
+ int
+-process_elf_file (const char *file_name, const char *lib, int *flag,
++process_elf_file32 (const char *file_name, const char *lib, int *flag,
+ 		  unsigned int *osversion, char **soname, void *file_contents,
+ 		  size_t file_length)
+ {
+   int i;
+   unsigned int j;
+-  ElfW(Addr) loadaddr;
++  Elf32_Addr loadaddr;
+   unsigned int dynamic_addr;
+   size_t dynamic_size;
+   char *program_interpreter;
+ 
+-  ElfW(Ehdr) *elf_header;
+-  ElfW(Phdr) *elf_pheader, *segment;
+-  ElfW(Dyn) *dynamic_segment, *dyn_entry;
++  Elf32_Ehdr *elf_header;
++  Elf32_Phdr *elf_pheader, *segment;
++  Elf32_Dyn *dynamic_segment, *dyn_entry;
+   char *dynamic_strings;
+ 
+-  elf_header = (ElfW(Ehdr) *) file_contents;
++  elf_header = (Elf32_Ehdr *) file_contents;
+   *osversion = 0;
+ 
+-  if (elf_header->e_ident [EI_CLASS] != ElfW (CLASS))
++  if (elf_header->e_type != ET_DYN)
+     {
+-      if (opt_verbose)
++      error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
++	     elf_header->e_type);
++      return 1;
++    }
++
++  /* Get information from elf program header.  */
++  elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
++  check_ptr (elf_pheader);
++
++  /* The library is an elf library, now search for soname and
++     libc5/libc6.  */
++  *flag = FLAG_ELF;
++
++  loadaddr = -1;
++  dynamic_addr = 0;
++  dynamic_size = 0;
++  program_interpreter = NULL;
++  for (i = 0, segment = elf_pheader;
++       i < elf_header->e_phnum; i++, segment++)
++    {
++      check_ptr (segment);
++
++      switch (segment->p_type)
+ 	{
+-	  if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
+-	    error (0, 0, _("%s is a 32 bit ELF file.\n"), file_name);
+-	  else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
+-	    error (0, 0, _("%s is a 64 bit ELF file.\n"), file_name);
+-	  else
+-	    error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
++	case PT_LOAD:
++	  if (loadaddr == (Elf32_Addr) -1)
++	    loadaddr = segment->p_vaddr - segment->p_offset;
++	  break;
++
++	case PT_DYNAMIC:
++	  if (dynamic_addr)
++	    error (0, 0, _("more than one dynamic segment\n"));
++
++	  dynamic_addr = segment->p_offset;
++	  dynamic_size = segment->p_filesz;
++	  break;
++
++	case PT_INTERP:
++	  program_interpreter = (char *) (file_contents + segment->p_offset);
++	  check_ptr (program_interpreter);
++
++	  /* Check if this is enough to classify the binary.  */
++	  for (j = 0; j < sizeof (interpreters) / sizeof (interpreters [0]);
++	       ++j)
++	    if (strcmp (program_interpreter, interpreters[j].soname) == 0)
++	      {
++		*flag = interpreters[j].flag;
++		break;
++	      }
++	  break;
++
++	case PT_NOTE:
++	  if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
++	    {
++	      Elf32_Word *abi_note = (Elf32_Word *) (file_contents
++						     + segment->p_offset);
++	      Elf32_Addr size = segment->p_filesz;
++
++	      while (abi_note [0] != 4 || abi_note [1] != 16
++		     || abi_note [2] != 1
++		     || memcmp (abi_note + 3, "GNU", 4) != 0)
++		{
++#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
++		  Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
++					 + ROUND (abi_note[0])
++					 + ROUND (abi_note[1]);
++
++		  if (size - 32 < note_size || note_size == 0)
++		    {
++		      size = 0;
++		      break;
++		    }
++		  size -= note_size;
++		  abi_note = (void *) abi_note + note_size;
++		}
++
++	      if (size == 0)
++		break;
++
++	      *osversion = (abi_note [4] << 24) |
++			   ((abi_note [5] & 0xff) << 16) |
++			   ((abi_note [6] & 0xff) << 8) |
++			   (abi_note [7] & 0xff);
++	    }
++	  break;
++
++	default:
++	  break;
++	}
++
++    }
++  if (loadaddr == (Elf32_Addr) -1)
++    {
++      /* Very strange. */
++      loadaddr = 0;
++    }
++
++  /* Now we can read the dynamic sections.  */
++  if (dynamic_size == 0)
++    return 1;
++
++  dynamic_segment = (Elf32_Dyn *) (file_contents + dynamic_addr);
++  check_ptr (dynamic_segment);
++
++  /* Find the string table.  */
++  dynamic_strings = NULL;
++  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++       ++dyn_entry)
++    {
++      check_ptr (dyn_entry);
++      if (dyn_entry->d_tag == DT_STRTAB)
++	{
++	  dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
++	  check_ptr (dynamic_strings);
++	  break;
+ 	}
+-      return 1;
+     }
+ 
++  if (dynamic_strings == NULL)
++    return 1;
++
++  /* Now read the DT_NEEDED and DT_SONAME entries.  */
++  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++       ++dyn_entry)
++    {
++      if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
++	{
++	  char *name = dynamic_strings + dyn_entry->d_un.d_val;
++	  check_ptr (name);
++
++	  if (dyn_entry->d_tag == DT_NEEDED)
++	    {
++
++	      if (*flag == FLAG_ELF)
++		{
++		  /* Check if this is enough to classify the binary.  */
++		  for (j = 0;
++		       j < sizeof (known_libs) / sizeof (known_libs [0]);
++		       ++j)
++		    if (strcmp (name, known_libs [j].soname) == 0)
++		      {
++			*flag = known_libs [j].flag;
++			break;
++		      }
++		}
++	    }
++
++	  else if (dyn_entry->d_tag == DT_SONAME)
++	    *soname = xstrdup (name);
++
++	  /* Do we have everything we need?  */
++	  if (*soname && *flag != FLAG_ELF)
++	    return 0;
++	}
++    }
++
++  /* We reach this point only if the file doesn't contain a DT_SONAME
++     or if we can't classify the library.  If it doesn't have a
++     soname, return the name of the library.  */
++  if (*soname == NULL)
++    *soname = xstrdup (lib);
++
++  return 0;
++}
++
++int
++process_elf_file64 (const char *file_name, const char *lib, int *flag,
++		  unsigned int *osversion, char **soname, void *file_contents,
++		  size_t file_length)
++{
++  int i;
++  unsigned int j;
++  Elf64_Addr loadaddr;
++  unsigned int dynamic_addr;
++  size_t dynamic_size;
++  char *program_interpreter;
++
++  Elf64_Ehdr *elf_header;
++  Elf64_Phdr *elf_pheader, *segment;
++  Elf64_Dyn *dynamic_segment, *dyn_entry;
++  char *dynamic_strings;
++
++  elf_header = (Elf64_Ehdr *) file_contents;
++  *osversion = 0;
++
+   if (elf_header->e_type != ET_DYN)
+     {
+       error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
+@@ -81,7 +254,7 @@ process_elf_file (const char *file_name,
+     }
+ 
+   /* Get information from elf program header.  */
+-  elf_pheader = (ElfW(Phdr) *) (elf_header->e_phoff + file_contents);
++  elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
+   check_ptr (elf_pheader);
+ 
+   /* The library is an elf library, now search for soname and
+@@ -100,7 +273,7 @@ process_elf_file (const char *file_name,
+       switch (segment->p_type)
+ 	{
+ 	case PT_LOAD:
+-	  if (loadaddr == (ElfW(Addr)) -1)
++	  if (loadaddr == (Elf64_Addr) -1)
+ 	    loadaddr = segment->p_vaddr - segment->p_offset;
+ 	  break;
+ 
+@@ -129,16 +302,16 @@ process_elf_file (const char *file_name,
+ 	case PT_NOTE:
+ 	  if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
+ 	    {
+-	      ElfW(Word) *abi_note = (ElfW(Word) *) (file_contents
++	      Elf64_Word *abi_note = (Elf64_Word *) (file_contents
+ 						     + segment->p_offset);
+-	      ElfW(Addr) size = segment->p_filesz;
++	      Elf64_Addr size = segment->p_filesz;
+ 
+ 	      while (abi_note [0] != 4 || abi_note [1] != 16
+ 		     || abi_note [2] != 1
+ 		     || memcmp (abi_note + 3, "GNU", 4) != 0)
+ 		{
+-#define ROUND(len) (((len) + sizeof (ElfW(Word)) - 1) & -sizeof (ElfW(Word)))
+-		  ElfW(Addr) note_size = 3 * sizeof (ElfW(Word))
++#define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
++		  Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
+ 					 + ROUND (abi_note[0])
+ 					 + ROUND (abi_note[1]);
+ 
+@@ -166,7 +339,7 @@ process_elf_file (const char *file_name,
+ 	}
+ 
+     }
+-  if (loadaddr == (ElfW(Addr)) -1)
++  if (loadaddr == (Elf64_Addr) -1)
+     {
+       /* Very strange. */
+       loadaddr = 0;
+@@ -176,7 +349,7 @@ process_elf_file (const char *file_name,
+   if (dynamic_size == 0)
+     return 1;
+ 
+-  dynamic_segment = (ElfW(Dyn) *) (file_contents + dynamic_addr);
++  dynamic_segment = (Elf64_Dyn *) (file_contents + dynamic_addr);
+   check_ptr (dynamic_segment);
+ 
+   /* Find the string table.  */
+@@ -233,3 +406,33 @@ process_elf_file (const char *file_name,
+ 
+   return 0;
+ }
++/* Returns 0 if everything is ok, != 0 in case of error.  */
++int
++process_elf_file (const char *file_name, const char *lib, int *flag,
++		  unsigned int *osversion, char **soname, void *file_contents,
++		  size_t file_length)
++{
++  int i;
++  unsigned int j;
++  ElfW(Addr) loadaddr;
++  unsigned int dynamic_addr;
++  size_t dynamic_size;
++  char *program_interpreter;
++
++  ElfW(Ehdr) *elf_header;
++  ElfW(Phdr) *elf_pheader, *segment;
++  ElfW(Dyn) *dynamic_segment, *dyn_entry;
++  char *dynamic_strings;
++
++  elf_header = (ElfW(Ehdr) *) file_contents;
++  *osversion = 0;
++
++  if (elf_header->e_ident [EI_CLASS] == ELFCLASS32)
++    return process_elf_file32(file_name, lib,flag, osversion, soname, file_contents, file_length);
++  else if (elf_header->e_ident [EI_CLASS] == ELFCLASS64)
++    return process_elf_file64(file_name, lib,flag, osversion, soname, file_contents, file_length);
++  error (0, 0, _("Unknown ELFCLASS in file %s.\n"), file_name);
++  return 1;
++}
++
++
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/README b/meta/recipes-core/glibc/ldconfig-native-2.12.1/README
new file mode 100644
index 0000000..43fb983
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/README
@@ -0,0 +1,8 @@
+The files are pulled verbatim from glibc 2.5 and then patched to allow
+standalone compilation of ldconfig.
+
+Richard Purdie
+OpenedHand Ltd.
+
+Upgraded the ldconfig recipe to eglibc 2.12.1
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/03/29
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch
new file mode 100644
index 0000000..a9af110
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/add-64-bit-flag-for-ELF64-entries.patch
@@ -0,0 +1,103 @@
+From 9d62544090b08849218cd1fc52a36cdd5d90363e Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <yuanjie.huang@windriver.com>
+Date: Fri, 24 Apr 2015 03:29:31 +0000
+Subject: [PATCH] Add 64-bit flag for ELF64 entries.
+
+ldconfig-native was grepped from an old version of glibc, and its output
+lacks neccessary 64bit flag in entries.
+Due to this defect, ctypes.util.find_library() python function fails to
+detect any library due to the old file format that ldconfig-native
+creates. This fix sets architecture-dependent 64bit flags for 64-bit ELF.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ cache.c      |  4 ++++
+ ldconfig.h   |  4 ++++
+ readelflib.c | 34 ++++++++++++++++++++++++++++++++++
+ 3 files changed, 42 insertions(+)
+
+diff --git a/cache.c b/cache.c
+index a904d44..c4f5411 100644
+--- a/cache.c
++++ b/cache.c
+@@ -121,6 +121,10 @@ print_entry (const char *lib, int flag, unsigned int osversion,
+       break;
+     case FLAG_MIPS64_LIBN64:
+       fputs (",64bit", stdout);
++      break;
++    case FLAG_AARCH64_LIB64:
++      fputs (",AArch64", stdout);
++      break;
+     case 0:
+       break;
+     default:
+diff --git a/ldconfig.h b/ldconfig.h
+index fadd5ec..6a8a750 100644
+--- a/ldconfig.h
++++ b/ldconfig.h
+@@ -34,6 +34,10 @@
+ #define FLAG_POWERPC_LIB64	0x0500
+ #define FLAG_MIPS64_LIBN32	0x0600
+ #define FLAG_MIPS64_LIBN64	0x0700
++#define FLAG_X8664_LIBX32		0x0800
++#define FLAG_ARM_LIBHF			0x0900
++#define FLAG_AARCH64_LIB64		0x0a00
++#define FLAG_ARM_LIBSF			0x0b00
+ 
+ /* Name of auxiliary cache.  */
+ #define _PATH_LDCONFIG_AUX_CACHE "/var/cache/ldconfig/aux-cache"
+diff --git a/readelflib.c b/readelflib.c
+index 0bf0de3..6e87afc 100644
+--- a/readelflib.c
++++ b/readelflib.c
+@@ -28,6 +28,11 @@
+ 
+ #include "endian_extra.h"
+ 
++/* Work-around for old host that does not have AArch64 defined in elf.h. */
++#ifndef EM_AARCH64
++#define EM_AARCH64	183		/* ARM AARCH64 */
++#endif
++
+ #undef check_ptr
+ #define check_ptr(ptr)						\
+ do								\
+@@ -290,6 +295,35 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+      libc5/libc6.  */
+   *flag = FLAG_ELF;
+ 
++  /* Set flags according to information in ELF header to align with target
++     ldconfig */
++  switch (elf_header->e_machine)
++    {
++    case EM_IA_64:
++      *flag |= FLAG_IA64_LIB64;
++      break;
++    case EM_X86_64:
++      *flag |= FLAG_X8664_LIB64;
++      break;
++    case EM_S390:
++      *flag |= FLAG_S390_LIB64;
++      break;
++    case EM_PPC64:
++      *flag |= FLAG_POWERPC_LIB64;
++      break;
++    case EM_MIPS:
++    case EM_MIPS_RS3_LE:
++      *flag |= FLAG_MIPS64_LIBN64;
++      break;
++    case EM_AARCH64:
++      *flag |= FLAG_AARCH64_LIB64;
++      break;
++    default:
++      error(0, 0, "%s is a 64-bit ELF for unknown machine %lx\n",
++            file_name, (long)elf_header->e_machine);
++      break;
++    }
++
+   loadaddr = -1;
+   dynamic_addr = 0;
+   dynamic_size = 0;
+-- 
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch
new file mode 100644
index 0000000..7f8e4db
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling.patch
@@ -0,0 +1,454 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Do data input/output handling according to endien-ness of the library file. That 
+enables use of ldconfig in the cross fashion for any architecture.
+
+2011/04/04
+Richard Purdie <richard.purdie@linuxfoundation.org>
+Nitin Kamble <nitin.a.kamble@intel.com>
+
+Index: ldconfig-native-2.12.1/readelflib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readelflib.c
++++ ldconfig-native-2.12.1/readelflib.c
+@@ -38,6 +38,28 @@ do								\
+   }								\
+  while (0);
+ 
++int be;
++static uint16_t read16(uint16_t x, int be)
++{
++  if (be)
++        return be16toh(x);
++  return le16toh(x);
++}
++
++static uint32_t read32(uint32_t x, int be)
++{
++  if (be)
++        return be32toh(x);
++  return le32toh(x);
++}
++
++static uint64_t read64(uint64_t x, int be)
++{
++  if (be)
++        return be64toh(x);
++  return le64toh(x);
++}
++
+ /* Returns 0 if everything is ok, != 0 in case of error.  */
+ int
+ process_elf_file32 (const char *file_name, const char *lib, int *flag,
+@@ -59,15 +81,17 @@ process_elf_file32 (const char *file_nam
+   elf_header = (Elf32_Ehdr *) file_contents;
+   *osversion = 0;
+ 
+-  if (elf_header->e_type != ET_DYN)
++  be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
++
++  if (read16(elf_header->e_type, be) != ET_DYN)
+     {
+       error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
+-	     elf_header->e_type);
++	     read16(elf_header->e_type, be));
+       return 1;
+     }
+ 
+   /* Get information from elf program header.  */
+-  elf_pheader = (Elf32_Phdr *) (elf_header->e_phoff + file_contents);
++  elf_pheader = (Elf32_Phdr *) (read32(elf_header->e_phoff, be) + file_contents);
+   check_ptr (elf_pheader);
+ 
+   /* The library is an elf library, now search for soname and
+@@ -79,27 +103,27 @@ process_elf_file32 (const char *file_nam
+   dynamic_size = 0;
+   program_interpreter = NULL;
+   for (i = 0, segment = elf_pheader;
+-       i < elf_header->e_phnum; i++, segment++)
++       i < read16(elf_header->e_phnum, be); i++, segment++)
+     {
+       check_ptr (segment);
+ 
+-      switch (segment->p_type)
++      switch (read32(segment->p_type, be))
+ 	{
+ 	case PT_LOAD:
+ 	  if (loadaddr == (Elf32_Addr) -1)
+-	    loadaddr = segment->p_vaddr - segment->p_offset;
++	    loadaddr = read32(segment->p_vaddr, be) - read32(segment->p_offset, be);
+ 	  break;
+ 
+ 	case PT_DYNAMIC:
+ 	  if (dynamic_addr)
+ 	    error (0, 0, _("more than one dynamic segment\n"));
+ 
+-	  dynamic_addr = segment->p_offset;
+-	  dynamic_size = segment->p_filesz;
++	  dynamic_addr = read32(segment->p_offset, be);
++	  dynamic_size = read32(segment->p_filesz, be);
+ 	  break;
+ 
+ 	case PT_INTERP:
+-	  program_interpreter = (char *) (file_contents + segment->p_offset);
++	  program_interpreter = (char *) (file_contents + read32(segment->p_offset, be));
+ 	  check_ptr (program_interpreter);
+ 
+ 	  /* Check if this is enough to classify the binary.  */
+@@ -113,20 +137,20 @@ process_elf_file32 (const char *file_nam
+ 	  break;
+ 
+ 	case PT_NOTE:
+-	  if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
++	  if (!*osversion && read32(segment->p_filesz, be) >= 32 && segment->p_align >= 4)
+ 	    {
+ 	      Elf32_Word *abi_note = (Elf32_Word *) (file_contents
+-						     + segment->p_offset);
+-	      Elf32_Addr size = segment->p_filesz;
++						     + read32(segment->p_offset, be));
++	      Elf32_Addr size = read32(segment->p_filesz, be);
+ 
+-	      while (abi_note [0] != 4 || abi_note [1] != 16
+-		     || abi_note [2] != 1
++	      while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
++		     || read32(abi_note [2], be) != 1
+ 		     || memcmp (abi_note + 3, "GNU", 4) != 0)
+ 		{
+-#define ROUND(len) (((len) + sizeof (Elf32_Word)) - 1) & -sizeof (Elf32_Word)))
+-		  Elf32_Addr) note_size = 3 * sizeof (Elf32_Word))
+-					 + ROUND (abi_note[0])
+-					 + ROUND (abi_note[1]);
++#define ROUND(len) (((len) + sizeof (Elf32_Word) - 1) & -sizeof (Elf32_Word))
++		  Elf32_Addr note_size = 3 * sizeof (Elf32_Word)
++					 + ROUND (read32(abi_note[0], be))
++					 + ROUND (read32(abi_note[1], be));
+ 
+ 		  if (size - 32 < note_size || note_size == 0)
+ 		    {
+@@ -140,10 +164,10 @@ process_elf_file32 (const char *file_nam
+ 	      if (size == 0)
+ 		break;
+ 
+-	      *osversion = (abi_note [4] << 24) |
+-			   ((abi_note [5] & 0xff) << 16) |
+-			   ((abi_note [6] & 0xff) << 8) |
+-			   (abi_note [7] & 0xff);
++	      *osversion = (read32(abi_note [4], be) << 24) |
++			   ((read32(abi_note [5], be) & 0xff) << 16) |
++			   ((read32(abi_note [6], be) & 0xff) << 8) |
++			   (read32(abi_note [7], be) & 0xff);
+ 	    }
+ 	  break;
+ 
+@@ -167,13 +191,13 @@ process_elf_file32 (const char *file_nam
+ 
+   /* Find the string table.  */
+   dynamic_strings = NULL;
+-  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++  for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
+        ++dyn_entry)
+     {
+       check_ptr (dyn_entry);
+-      if (dyn_entry->d_tag == DT_STRTAB)
++      if (read32(dyn_entry->d_tag, be) == DT_STRTAB)
+ 	{
+-	  dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
++	  dynamic_strings = (char *) (file_contents + read32(dyn_entry->d_un.d_val, be) - loadaddr);
+ 	  check_ptr (dynamic_strings);
+ 	  break;
+ 	}
+@@ -183,15 +207,15 @@ process_elf_file32 (const char *file_nam
+     return 1;
+ 
+   /* Now read the DT_NEEDED and DT_SONAME entries.  */
+-  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++  for (dyn_entry = dynamic_segment; read32(dyn_entry->d_tag, be) != DT_NULL;
+        ++dyn_entry)
+     {
+-      if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
++      if (read32(dyn_entry->d_tag, be) == DT_NEEDED || read32(dyn_entry->d_tag, be) == DT_SONAME)
+ 	{
+-	  char *name = dynamic_strings + dyn_entry->d_un.d_val;
++	  char *name = dynamic_strings + read32(dyn_entry->d_un.d_val, be);
+ 	  check_ptr (name);
+ 
+-	  if (dyn_entry->d_tag == DT_NEEDED)
++	  if (read32(dyn_entry->d_tag, be) == DT_NEEDED)
+ 	    {
+ 
+ 	      if (*flag == FLAG_ELF)
+@@ -208,7 +232,7 @@ process_elf_file32 (const char *file_nam
+ 		}
+ 	    }
+ 
+-	  else if (dyn_entry->d_tag == DT_SONAME)
++	  else if (read32(dyn_entry->d_tag, be) == DT_SONAME)
+ 	    *soname = xstrdup (name);
+ 
+ 	  /* Do we have everything we need?  */
+@@ -246,15 +270,17 @@ process_elf_file64 (const char *file_nam
+   elf_header = (Elf64_Ehdr *) file_contents;
+   *osversion = 0;
+ 
+-  if (elf_header->e_type != ET_DYN)
++  be = (elf_header->e_ident[EI_DATA] == ELFDATA2MSB);
++
++  if (read16(elf_header->e_type, be) != ET_DYN)
+     {
+       error (0, 0, _("%s is not a shared object file (Type: %d).\n"), file_name,
+-	     elf_header->e_type);
++	     read16(elf_header->e_type, be));
+       return 1;
+     }
+ 
+   /* Get information from elf program header.  */
+-  elf_pheader = (Elf64_Phdr *) (elf_header->e_phoff + file_contents);
++  elf_pheader = (Elf64_Phdr *) (read64(elf_header->e_phoff, be) + file_contents);
+   check_ptr (elf_pheader);
+ 
+   /* The library is an elf library, now search for soname and
+@@ -266,27 +292,27 @@ process_elf_file64 (const char *file_nam
+   dynamic_size = 0;
+   program_interpreter = NULL;
+   for (i = 0, segment = elf_pheader;
+-       i < elf_header->e_phnum; i++, segment++)
++       i < read16(elf_header->e_phnum, be); i++, segment++)
+     {
+       check_ptr (segment);
+ 
+-      switch (segment->p_type)
++      switch (read32(segment->p_type, be))
+ 	{
+ 	case PT_LOAD:
+ 	  if (loadaddr == (Elf64_Addr) -1)
+-	    loadaddr = segment->p_vaddr - segment->p_offset;
++	    loadaddr = read64(segment->p_vaddr, be) - read64(segment->p_offset, be);
+ 	  break;
+ 
+ 	case PT_DYNAMIC:
+ 	  if (dynamic_addr)
+ 	    error (0, 0, _("more than one dynamic segment\n"));
+ 
+-	  dynamic_addr = segment->p_offset;
+-	  dynamic_size = segment->p_filesz;
++	  dynamic_addr = read64(segment->p_offset, be);
++	  dynamic_size = read32(segment->p_filesz, be);
+ 	  break;
+ 
+ 	case PT_INTERP:
+-	  program_interpreter = (char *) (file_contents + segment->p_offset);
++	  program_interpreter = (char *) (file_contents + read64(segment->p_offset, be));
+ 	  check_ptr (program_interpreter);
+ 
+ 	  /* Check if this is enough to classify the binary.  */
+@@ -300,20 +326,21 @@ process_elf_file64 (const char *file_nam
+ 	  break;
+ 
+ 	case PT_NOTE:
+-	  if (!*osversion && segment->p_filesz >= 32 && segment->p_align >= 4)
++	  if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4)
+ 	    {
+ 	      Elf64_Word *abi_note = (Elf64_Word *) (file_contents
+-						     + segment->p_offset);
+-	      Elf64_Addr size = segment->p_filesz;
++						     + read64(segment->p_offset, be));
++	      Elf64_Addr size = read32(segment->p_filesz, be);
+ 
+-	      while (abi_note [0] != 4 || abi_note [1] != 16
+-		     || abi_note [2] != 1
++	      while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
++		     || read32(abi_note [2], be) != 1
+ 		     || memcmp (abi_note + 3, "GNU", 4) != 0)
+ 		{
++#undef ROUND
+ #define ROUND(len) (((len) + sizeof (Elf64_Word) - 1) & -sizeof (Elf64_Word))
+ 		  Elf64_Addr note_size = 3 * sizeof (Elf64_Word)
+-					 + ROUND (abi_note[0])
+-					 + ROUND (abi_note[1]);
++					 + ROUND (read32(abi_note[0], be))
++					 + ROUND (read32(abi_note[1], be));
+ 
+ 		  if (size - 32 < note_size || note_size == 0)
+ 		    {
+@@ -327,10 +354,10 @@ process_elf_file64 (const char *file_nam
+ 	      if (size == 0)
+ 		break;
+ 
+-	      *osversion = (abi_note [4] << 24) |
+-			   ((abi_note [5] & 0xff) << 16) |
+-			   ((abi_note [6] & 0xff) << 8) |
+-			   (abi_note [7] & 0xff);
++	      *osversion = (read32(abi_note [4], be) << 24) |
++			   ((read32(abi_note [5], be) & 0xff) << 16) |
++			   ((read32(abi_note [6], be) & 0xff) << 8) |
++			   (read32(abi_note [7], be) & 0xff);
+ 	    }
+ 	  break;
+ 
+@@ -354,13 +381,13 @@ process_elf_file64 (const char *file_nam
+ 
+   /* Find the string table.  */
+   dynamic_strings = NULL;
+-  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++  for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
+        ++dyn_entry)
+     {
+       check_ptr (dyn_entry);
+-      if (dyn_entry->d_tag == DT_STRTAB)
++      if (read64(dyn_entry->d_tag, be) == DT_STRTAB)
+ 	{
+-	  dynamic_strings = (char *) (file_contents + dyn_entry->d_un.d_val - loadaddr);
++	  dynamic_strings = (char *) (file_contents + read64(dyn_entry->d_un.d_val, be) - loadaddr);
+ 	  check_ptr (dynamic_strings);
+ 	  break;
+ 	}
+@@ -370,15 +397,15 @@ process_elf_file64 (const char *file_nam
+     return 1;
+ 
+   /* Now read the DT_NEEDED and DT_SONAME entries.  */
+-  for (dyn_entry = dynamic_segment; dyn_entry->d_tag != DT_NULL;
++  for (dyn_entry = dynamic_segment; read64(dyn_entry->d_tag, be) != DT_NULL;
+        ++dyn_entry)
+     {
+-      if (dyn_entry->d_tag == DT_NEEDED || dyn_entry->d_tag == DT_SONAME)
++      if (read64(dyn_entry->d_tag, be) == DT_NEEDED || read64(dyn_entry->d_tag, be) == DT_SONAME)
+ 	{
+-	  char *name = dynamic_strings + dyn_entry->d_un.d_val;
++	  char *name = dynamic_strings + read64(dyn_entry->d_un.d_val, be);
+ 	  check_ptr (name);
+ 
+-	  if (dyn_entry->d_tag == DT_NEEDED)
++	  if (read64(dyn_entry->d_tag, be) == DT_NEEDED)
+ 	    {
+ 
+ 	      if (*flag == FLAG_ELF)
+@@ -395,7 +422,7 @@ process_elf_file64 (const char *file_nam
+ 		}
+ 	    }
+ 
+-	  else if (dyn_entry->d_tag == DT_SONAME)
++	  else if (read64(dyn_entry->d_tag, be) == DT_SONAME)
+ 	    *soname = xstrdup (name);
+ 
+ 	  /* Do we have everything we need?  */
+Index: ldconfig-native-2.12.1/readlib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readlib.c
++++ ldconfig-native-2.12.1/readlib.c
+@@ -169,7 +169,8 @@ process_file (const char *real_file_name
+       ret = 1;
+     }
+   /* Libraries have to be shared object files.  */
+-  else if (elf_header->e_type != ET_DYN)
++  else if ((elf_header->e_ident[EI_DATA] == ELFDATA2MSB && be16toh(elf_header->e_type) != ET_DYN) ||
++      (elf_header->e_ident[EI_DATA] == ELFDATA2LSB && le16toh(elf_header->e_type) != ET_DYN))
+     ret = 1;
+   else if (process_elf_file (file_name, lib, flag, osversion, soname,
+ 			     file_contents, statbuf.st_size))
+Index: ldconfig-native-2.12.1/cache.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/cache.c
++++ ldconfig-native-2.12.1/cache.c
+@@ -39,6 +39,29 @@
+ # define N_(msgid)  msgid
+ #define _(msg) msg
+ 
++extern int be;
++
++static uint16_t write16(uint16_t x, int be)
++{
++  if (be)
++        return htobe16(x);
++  return htole16(x);
++}
++
++static uint32_t write32(uint32_t x, int be)
++{
++  if (be)
++        return htobe32(x);
++  return htole32(x);
++}
++
++static uint64_t write64(uint64_t x, int be)
++{
++  if (be)
++        return htobe64(x);
++  return htole64(x);
++}
++
+ struct cache_entry
+ {
+   char *lib;			/* Library name.  */
+@@ -279,7 +302,12 @@ save_cache (const char *cache_name)
+   /* Number of normal cache entries.  */
+   int cache_entry_old_count = 0;
+ 
+-  for (entry = entries; entry != NULL; entry = entry->next)
++    if (be)
++      printf("saving cache in big endian encoding\n");
++    else
++      printf("saving cache in little endian encoding\n");
++
++    for (entry = entries; entry != NULL; entry = entry->next)
+     {
+       /* Account the final NULs.  */
+       total_strlen += strlen (entry->lib) + strlen (entry->path) + 2;
+@@ -310,7 +338,7 @@ save_cache (const char *cache_name)
+       memset (file_entries, '\0', sizeof (struct cache_file));
+       memcpy (file_entries->magic, CACHEMAGIC, sizeof CACHEMAGIC - 1);
+ 
+-      file_entries->nlibs = cache_entry_old_count;
++      file_entries->nlibs = write32(cache_entry_old_count, be);
+     }
+ 
+   struct cache_file_new *file_entries_new = NULL;
+@@ -330,8 +358,8 @@ save_cache (const char *cache_name)
+       memcpy (file_entries_new->version, CACHE_VERSION,
+ 	      sizeof CACHE_VERSION - 1);
+ 
+-      file_entries_new->nlibs = cache_entry_count;
+-      file_entries_new->len_strings = total_strlen;
++      file_entries_new->nlibs = write32(cache_entry_count, be);
++      file_entries_new->len_strings = write32(total_strlen, be);
+     }
+ 
+   /* Pad for alignment of cache_file_new.  */
+@@ -358,9 +386,9 @@ save_cache (const char *cache_name)
+       /* First the library.  */
+       if (opt_format != 2 && entry->hwcap == 0)
+ 	{
+-	  file_entries->libs[idx_old].flags = entry->flags;
++	  file_entries->libs[idx_old].flags = write32(entry->flags, be);
+ 	  /* XXX: Actually we can optimize here and remove duplicates.  */
+-	  file_entries->libs[idx_old].key = str_offset + pad;
++	  file_entries->libs[idx_old].key = write32(str_offset + pad, be);
+ 	}
+       if (opt_format != 0)
+ 	{
+@@ -368,10 +396,10 @@ save_cache (const char *cache_name)
+ 	     not doing so makes the code easier, the string table
+ 	     always begins at the beginning of the the new cache
+ 	     struct.  */
+-	  file_entries_new->libs[idx_new].flags = entry->flags;
+-	  file_entries_new->libs[idx_new].osversion = entry->osversion;
+-	  file_entries_new->libs[idx_new].hwcap = entry->hwcap;
+-	  file_entries_new->libs[idx_new].key = str_offset;
++	  file_entries_new->libs[idx_new].flags = write32(entry->flags, be);
++	  file_entries_new->libs[idx_new].osversion = write32(entry->osversion, be);
++	  file_entries_new->libs[idx_new].hwcap = write64(entry->hwcap, be);
++	  file_entries_new->libs[idx_new].key = write32(str_offset, be);
+ 	}
+ 
+       size_t len = strlen (entry->lib) + 1;
+@@ -379,9 +407,9 @@ save_cache (const char *cache_name)
+       str_offset += len;
+       /* Then the path.  */
+       if (opt_format != 2 && entry->hwcap == 0)
+-	file_entries->libs[idx_old].value = str_offset + pad;
++	file_entries->libs[idx_old].value = write32(str_offset + pad, be);
+       if (opt_format != 0)
+-	file_entries_new->libs[idx_new].value = str_offset;
++	file_entries_new->libs[idx_new].value = write32(str_offset, be);
+       len = strlen (entry->path) + 1;
+       str = mempcpy (str, entry->path, len);
+       str_offset += len;
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch
new file mode 100644
index 0000000..6aecfe5
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/endian-ness_handling_fix.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Fix problem during parsing of ELF headers for 64bit on big-endian.
+Some header fields were read with wrong size.
+
+2014/10/24
+Par Olsson <Par.Olsson@windriver.com>
+Shan Hai <shan.hai@windriver.com>
+
+diff --git a/readelflib.c b/readelflib.c
+index 3f5b25b..0bf0de3 100644
+--- a/readelflib.c
++++ b/readelflib.c
+@@ -261,8 +261,8 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+   int i;
+   unsigned int j;
+   Elf64_Addr loadaddr;
+-  unsigned int dynamic_addr;
+-  size_t dynamic_size;
++  Elf64_Addr dynamic_addr;
++  Elf64_Xword dynamic_size;
+   char *program_interpreter;
+ 
+   Elf64_Ehdr *elf_header;
+@@ -311,7 +311,7 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+ 	    error (0, 0, _("more than one dynamic segment\n"));
+ 
+ 	  dynamic_addr = read64(segment->p_offset, be);
+-	  dynamic_size = read32(segment->p_filesz, be);
++	  dynamic_size = read64(segment->p_filesz, be);
+ 	  break;
+ 
+ 	case PT_INTERP:
+@@ -329,11 +329,11 @@ process_elf_file64 (const char *file_name, const char *lib, int *flag,
+ 	  break;
+ 
+ 	case PT_NOTE:
+-	  if (!*osversion && read32(segment->p_filesz, be) >= 32 && read32(segment->p_align, be) >= 4)
++	  if (!*osversion && read64(segment->p_filesz, be) >= 32 && read64(segment->p_align, be) >= 4)
+ 	    {
+ 	      Elf64_Word *abi_note = (Elf64_Word *) (file_contents
+ 						     + read64(segment->p_offset, be));
+-	      Elf64_Addr size = read32(segment->p_filesz, be);
++	      Elf64_Xword size = read64(segment->p_filesz, be);
+ 
+ 	      while (read32(abi_note [0], be) != 4 || read32(abi_note [1], be) != 16
+ 		     || read32(abi_note [2], be) != 1
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch
new file mode 100644
index 0000000..a18b2c2
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/endianess-header.patch
@@ -0,0 +1,113 @@
+Upstream-Status: Inappropriate [fix poky patch]
+
+This patch fixes build issues with a previous endian-ness_handling.patch on
+distros that don't have macros referenced
+
+7/20/2011
+Matthew McClintock <msm@freescale.com>
+
+diff -purN ldconfig-native-2.12.1.orig/endian_extra.h ldconfig-native-2.12.1/endian_extra.h
+--- ldconfig-native-2.12.1.orig/endian_extra.h	1969-12-31 18:00:00.000000000 -0600
++++ ldconfig-native-2.12.1/endian_extra.h	2011-07-19 18:09:14.323048417 -0500
+@@ -0,0 +1,64 @@
++/* Copyright (C) 1992, 1996, 1997, 2000, 2008 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <endian.h>
++
++#ifndef	_ENDIAN_EXTRA_H
++#define	_ENDIAN_EXTRA_H	1
++
++/* Don't redefine these macros if they already exist */
++#ifndef htobe16
++#ifdef __USE_BSD
++/* Conversion interfaces.  */
++# include <byteswap.h>
++
++# if __BYTE_ORDER == __LITTLE_ENDIAN
++#  define htobe16(x) __bswap_16 (x)
++#  define htole16(x) (x)
++#  define be16toh(x) __bswap_16 (x)
++#  define le16toh(x) (x)
++
++#  define htobe32(x) __bswap_32 (x)
++#  define htole32(x) (x)
++#  define be32toh(x) __bswap_32 (x)
++#  define le32toh(x) (x)
++
++#  define htobe64(x) __bswap_64 (x)
++#  define htole64(x) (x)
++#  define be64toh(x) __bswap_64 (x)
++#  define le64toh(x) (x)
++# else
++#  define htobe16(x) (x)
++#  define htole16(x) __bswap_16 (x)
++#  define be16toh(x) (x)
++#  define le16toh(x) __bswap_16 (x)
++
++#  define htobe32(x) (x)
++#  define htole32(x) __bswap_32 (x)
++#  define be32toh(x) (x)
++#  define le32toh(x) __bswap_32 (x)
++
++#  define htobe64(x) (x)
++#  define htole64(x) __bswap_64 (x)
++#  define be64toh(x) (x)
++#  define le64toh(x) __bswap_64 (x)
++# endif
++#endif
++#endif
++
++#endif	/* endian_extra.h */
+diff -purN ldconfig-native-2.12.1.orig/cache.c ldconfig-native-2.12.1/cache.c
+--- ldconfig-native-2.12.1.orig/cache.c	2011-07-19 18:21:28.347041301 -0500
++++ ldconfig-native-2.12.1/cache.c	2011-07-19 18:22:54.118048064 -0500
+@@ -39,6 +39,8 @@
+ # define N_(msgid)  msgid
+ #define _(msg) msg
+ 
++#include "endian_extra.h"
++
+ extern int be;
+ 
+ static uint16_t write16(uint16_t x, int be)
+diff -purN ldconfig-native-2.12.1.orig/readelflib.c ldconfig-native-2.12.1/readelflib.c
+--- ldconfig-native-2.12.1.orig/readelflib.c	2011-07-19 18:21:28.346041593 -0500
++++ ldconfig-native-2.12.1/readelflib.c	2011-07-19 18:23:05.324059875 -0500
+@@ -25,6 +25,9 @@
+ 
+ /* check_ptr checks that a pointer is in the mmaped file and doesn't
+    point outside it.  */
++
++#include "endian_extra.h"
++
+ #undef check_ptr
+ #define check_ptr(ptr)						\
+ do								\
+diff -purN ldconfig-native-2.12.1.orig/readlib.c ldconfig-native-2.12.1/readlib.c
+--- ldconfig-native-2.12.1.orig/readlib.c	2011-07-19 18:21:28.346041593 -0500
++++ ldconfig-native-2.12.1/readlib.c	2011-07-19 18:23:23.877046210 -0500
+@@ -40,6 +40,8 @@
+ 
+ #include "ldconfig.h"
+ 
++#include "endian_extra.h"
++
+ #define _(msg) msg
+ 
+ #define Elf32_CLASS ELFCLASS32
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch
new file mode 100644
index 0000000..4e9aab9
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/flag_fix.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+The native version of ldconfig was using native definition of LD_SO (i.e. 
+ld-linux-x86-64.so.2 ) which is not correct for doing the cross ldconfig.
+This was causing libc.so on the target marked as ELF lib rather than 
+FLAG_ELF_LIBC6 in the ld.so.cache.
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/4
+
+Index: ldconfig-native-2.12.1/readlib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readlib.c
++++ ldconfig-native-2.12.1/readlib.c
+@@ -51,6 +51,10 @@ struct known_names
+   int flag;
+ };
+ 
++/* don't use host's definition of LD_SO */
++#undef LD_SO 
++#define LD_SO "ld.so.1"
++
+ static struct known_names interpreters[] =
+ {
+   { "/lib/" LD_SO, FLAG_ELF_LIBC6 },
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch
new file mode 100644
index 0000000..5ed4f6f
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+make ldconfig default to both /lib+/usr/lib, /lib32+/usr/lib32 and
+/lib64+/usr/lib64 on bi-ABI architectures.
+
+---
+ ldconfig.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff -urpN a/ldconfig.c b/ldconfig.c
+--- a/ldconfig.c
++++ b/ldconfig.c
+@@ -52,7 +52,11 @@
+ 
+ #define SYSCONFDIR "/etc"
+ #define LIBDIR "/usr/lib"
++#define LIBDIR32 "/usr/lib32"
++#define LIBDIR64 "/usr/lib64"
+ #define SLIBDIR "/lib"
++#define SLIBDIR32 "/lib32"
++#define SLIBDIR64 "/lib64"
+ # define N_(msgid)  msgid
+ #define _(msg) msg
+ 
+@@ -1373,6 +1377,12 @@ main (int argc, char **argv)
+       add_system_dir (SLIBDIR);
+       if (strcmp (SLIBDIR, LIBDIR))
+ 	add_system_dir (LIBDIR);
++      add_system_dir (SLIBDIR32);
++      if (strcmp (SLIBDIR32, LIBDIR32))
++	add_system_dir (LIBDIR32);
++      add_system_dir (SLIBDIR64);
++      if (strcmp (SLIBDIR64, LIBDIR64))
++	add_system_dir (LIBDIR64);
+     }
+ 
+   const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2 b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
new file mode 100644
index 0000000..dc1e798
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-native-2.12.1.tar.bz2
Binary files differ
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch
new file mode 100644
index 0000000..52986e6
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig.patch
@@ -0,0 +1,471 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+enable standalone building of ldconfig
+
+---
+ cache.c        |   11 +-
+ chroot_canon.c |    7 +
+ dl-cache.c     |  235 ---------------------------------------------------------
+ dl-cache.h     |    3 
+ ldconfig.c     |   27 ++++--
+ readlib.c      |    7 +
+ xstrdup.c      |   11 --
+ 7 files changed, 45 insertions(+), 256 deletions(-)
+
+Index: ldconfig-native-2.12.1/cache.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/cache.c
++++ ldconfig-native-2.12.1/cache.c
+@@ -16,6 +16,9 @@
+    along with this program; if not, write to the Free Software Foundation,
+    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+ 
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #include <errno.h>
+ #include <error.h>
+ #include <dirent.h>
+@@ -31,8 +34,10 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ 
+-#include <ldconfig.h>
+-#include <dl-cache.h>
++#include "ldconfig.h"
++#include "dl-cache.h"
++# define N_(msgid)  msgid
++#define _(msg) msg
+ 
+ struct cache_entry
+ {
+Index: ldconfig-native-2.12.1/chroot_canon.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/chroot_canon.c
++++ ldconfig-native-2.12.1/chroot_canon.c
+@@ -17,6 +17,9 @@
+    along with this program; if not, write to the Free Software Foundation,
+    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+ 
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
+@@ -27,7 +30,9 @@
+ #include <stddef.h>
+ #include <stdint.h>
+ 
+-#include <ldconfig.h>
++#include "ldconfig.h"
++
++#define __set_errno(Val) errno = (Val)
+ 
+ #ifndef PATH_MAX
+ #define PATH_MAX 1024
+Index: ldconfig-native-2.12.1/dl-cache.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/dl-cache.c
++++ ldconfig-native-2.12.1/dl-cache.c
+@@ -20,12 +20,12 @@
+ 
+ #include <assert.h>
+ #include <unistd.h>
+-#include <ldsodefs.h>
++//#include "ldsodefs.h"
+ #include <sys/mman.h>
+ #include <dl-cache.h>
+ #include <dl-procinfo.h>
+ 
+-#include <stdio-common/_itoa.h>
++//#include "_itoa.h"
+ 
+ #ifndef _DL_PLATFORMS_COUNT
+ # define _DL_PLATFORMS_COUNT 0
+@@ -39,103 +39,7 @@ static size_t cachesize;
+ /* 1 if cache_data + PTR points into the cache.  */
+ #define _dl_cache_verify_ptr(ptr) (ptr < cache_data_size)
+ 
+-#define SEARCH_CACHE(cache) \
+-/* We use binary search since the table is sorted in the cache file.	      \
+-   The first matching entry in the table is returned.			      \
+-   It is important to use the same algorithm as used while generating	      \
+-   the cache file.  */							      \
+-do									      \
+-  {									      \
+-    left = 0;								      \
+-    right = cache->nlibs - 1;						      \
+-									      \
+-    while (left <= right)						      \
+-      {									      \
+-	__typeof__ (cache->libs[0].key) key;				      \
+-									      \
+-	middle = (left + right) / 2;					      \
+-									      \
+-	key = cache->libs[middle].key;					      \
+-									      \
+-	/* Make sure string table indices are not bogus before using	      \
+-	   them.  */							      \
+-	if (! _dl_cache_verify_ptr (key))				      \
+-	  {								      \
+-	    cmpres = 1;							      \
+-	    break;							      \
+-	  }								      \
+-									      \
+-	/* Actually compare the entry with the key.  */			      \
+-	cmpres = _dl_cache_libcmp (name, cache_data + key);		      \
+-	if (__builtin_expect (cmpres == 0, 0))				      \
+-	  {								      \
+-	    /* Found it.  LEFT now marks the last entry for which we	      \
+-	       know the name is correct.  */				      \
+-	    left = middle;						      \
+-									      \
+-	    /* There might be entries with this name before the one we	      \
+-	       found.  So we have to find the beginning.  */		      \
+-	    while (middle > 0)						      \
+-	      {								      \
+-		__typeof__ (cache->libs[0].key) key;			      \
+-									      \
+-		key = cache->libs[middle - 1].key;			      \
+-		/* Make sure string table indices are not bogus before	      \
+-		   using them.  */					      \
+-		if (! _dl_cache_verify_ptr (key)			      \
+-		    /* Actually compare the entry.  */			      \
+-		    || _dl_cache_libcmp (name, cache_data + key) != 0)	      \
+-		  break;						      \
+-		--middle;						      \
+-	      }								      \
+-									      \
+-	    do								      \
+-	      {								      \
+-		int flags;						      \
+-		__typeof__ (cache->libs[0]) *lib = &cache->libs[middle];      \
+-									      \
+-		/* Only perform the name test if necessary.  */		      \
+-		if (middle > left					      \
+-		    /* We haven't seen this string so far.  Test whether the  \
+-		       index is ok and whether the name matches.  Otherwise   \
+-		       we are done.  */					      \
+-		    && (! _dl_cache_verify_ptr (lib->key)		      \
+-			|| (_dl_cache_libcmp (name, cache_data + lib->key)    \
+-			    != 0)))					      \
+-		  break;						      \
+-									      \
+-		flags = lib->flags;					      \
+-		if (_dl_cache_check_flags (flags)			      \
+-		    && _dl_cache_verify_ptr (lib->value))		      \
+-		  {							      \
+-		    if (best == NULL || flags == GLRO(dl_correct_cache_id))   \
+-		      {							      \
+-			HWCAP_CHECK;					      \
+-			best = cache_data + lib->value;			      \
+-									      \
+-			if (flags == GLRO(dl_correct_cache_id))		      \
+-			  /* We've found an exact match for the shared	      \
+-			     object and no general `ELF' release.  Stop	      \
+-			     searching.  */				      \
+-			  break;					      \
+-		      }							      \
+-		  }							      \
+-	      }								      \
+-	    while (++middle <= right);					      \
+-	    break;							      \
+-	}								      \
+-									      \
+-	if (cmpres < 0)							      \
+-	  left = middle + 1;						      \
+-	else								      \
+-	  right = middle - 1;						      \
+-      }									      \
+-  }									      \
+-while (0)
+-
+-
+ int
+-internal_function
+ _dl_cache_libcmp (const char *p1, const char *p2)
+ {
+   while (*p1 != '\0')
+@@ -172,139 +76,3 @@ _dl_cache_libcmp (const char *p1, const 
+     }
+   return *p1 - *p2;
+ }
+-
+-
+-/* Look up NAME in ld.so.cache and return the file name stored there,
+-   or null if none is found.  */
+-
+-const char *
+-internal_function
+-_dl_load_cache_lookup (const char *name)
+-{
+-  int left, right, middle;
+-  int cmpres;
+-  const char *cache_data;
+-  uint32_t cache_data_size;
+-  const char *best;
+-
+-  /* Print a message if the loading of libs is traced.  */
+-  if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0))
+-    _dl_debug_printf (" search cache=%s\n", LD_SO_CACHE);
+-
+-  if (cache == NULL)
+-    {
+-      /* Read the contents of the file.  */
+-      void *file = _dl_sysdep_read_whole_file (LD_SO_CACHE, &cachesize,
+-					       PROT_READ);
+-
+-      /* We can handle three different cache file formats here:
+-	 - the old libc5/glibc2.0/2.1 format
+-	 - the old format with the new format in it
+-	 - only the new format
+-	 The following checks if the cache contains any of these formats.  */
+-      if (file != MAP_FAILED && cachesize > sizeof *cache
+-	  && memcmp (file, CACHEMAGIC, sizeof CACHEMAGIC - 1) == 0)
+-	{
+-	  size_t offset;
+-	  /* Looks ok.  */
+-	  cache = file;
+-
+-	  /* Check for new version.  */
+-	  offset = ALIGN_CACHE (sizeof (struct cache_file)
+-				+ cache->nlibs * sizeof (struct file_entry));
+-
+-	  cache_new = (struct cache_file_new *) ((void *) cache + offset);
+-	  if (cachesize < (offset + sizeof (struct cache_file_new))
+-	      || memcmp (cache_new->magic, CACHEMAGIC_VERSION_NEW,
+-			 sizeof CACHEMAGIC_VERSION_NEW - 1) != 0)
+-	    cache_new = (void *) -1;
+-	}
+-      else if (file != MAP_FAILED && cachesize > sizeof *cache_new
+-	       && memcmp (file, CACHEMAGIC_VERSION_NEW,
+-			  sizeof CACHEMAGIC_VERSION_NEW - 1) == 0)
+-	{
+-	  cache_new = file;
+-	  cache = file;
+-	}
+-      else
+-	{
+-	  if (file != MAP_FAILED)
+-	    __munmap (file, cachesize);
+-	  cache = (void *) -1;
+-	}
+-
+-      assert (cache != NULL);
+-    }
+-
+-  if (cache == (void *) -1)
+-    /* Previously looked for the cache file and didn't find it.  */
+-    return NULL;
+-
+-  best = NULL;
+-
+-  if (cache_new != (void *) -1)
+-    {
+-      uint64_t platform;
+-
+-      /* This is where the strings start.  */
+-      cache_data = (const char *) cache_new;
+-
+-      /* Now we can compute how large the string table is.  */
+-      cache_data_size = (const char *) cache + cachesize - cache_data;
+-
+-      platform = _dl_string_platform (GLRO(dl_platform));
+-      if (platform != (uint64_t) -1)
+-	platform = 1ULL << platform;
+-
+-#define _DL_HWCAP_TLS_MASK (1LL << 63)
+-      uint64_t hwcap_exclude = ~((GLRO(dl_hwcap) & GLRO(dl_hwcap_mask))
+-				 | _DL_HWCAP_PLATFORM | _DL_HWCAP_TLS_MASK);
+-
+-      /* Only accept hwcap if it's for the right platform.  */
+-#define HWCAP_CHECK \
+-      if (lib->hwcap & hwcap_exclude)					      \
+-	continue;							      \
+-      if (GLRO(dl_osversion) && lib->osversion > GLRO(dl_osversion))	      \
+-	continue;							      \
+-      if (_DL_PLATFORMS_COUNT						      \
+-	  && (lib->hwcap & _DL_HWCAP_PLATFORM) != 0			      \
+-	  && (lib->hwcap & _DL_HWCAP_PLATFORM) != platform)		      \
+-	continue
+-      SEARCH_CACHE (cache_new);
+-    }
+-  else
+-    {
+-      /* This is where the strings start.  */
+-      cache_data = (const char *) &cache->libs[cache->nlibs];
+-
+-      /* Now we can compute how large the string table is.  */
+-      cache_data_size = (const char *) cache + cachesize - cache_data;
+-
+-#undef HWCAP_CHECK
+-#define HWCAP_CHECK do {} while (0)
+-      SEARCH_CACHE (cache);
+-    }
+-
+-  /* Print our result if wanted.  */
+-  if (__builtin_expect (GLRO_dl_debug_mask & DL_DEBUG_LIBS, 0)
+-      && best != NULL)
+-    _dl_debug_printf ("  trying file=%s\n", best);
+-
+-  return best;
+-}
+-
+-#ifndef MAP_COPY
+-/* If the system does not support MAP_COPY we cannot leave the file open
+-   all the time since this would create problems when the file is replaced.
+-   Therefore we provide this function to close the file and open it again
+-   once needed.  */
+-void
+-_dl_unload_cache (void)
+-{
+-  if (cache != NULL && cache != (struct cache_file *) -1)
+-    {
+-      __munmap (cache, cachesize);
+-      cache = NULL;
+-    }
+-}
+-#endif
+Index: ldconfig-native-2.12.1/dl-cache.h
+===================================================================
+--- ldconfig-native-2.12.1.orig/dl-cache.h
++++ ldconfig-native-2.12.1/dl-cache.h
+@@ -101,5 +101,4 @@ struct cache_file_new
+ (((addr) + __alignof__ (struct cache_file_new) -1)	\
+  & (~(__alignof__ (struct cache_file_new) - 1)))
+ 
+-extern int _dl_cache_libcmp (const char *p1, const char *p2)
+-     internal_function;
++extern int _dl_cache_libcmp (const char *p1, const char *p2);
+Index: ldconfig-native-2.12.1/ldconfig.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/ldconfig.c
++++ ldconfig-native-2.12.1/ldconfig.c
+@@ -16,6 +16,9 @@
+    along with this program; if not, write to the Free Software Foundation,
+    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+ 
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #define PROCINFO_CLASS static
+ #include <alloca.h>
+ #include <argp.h>
+@@ -39,10 +42,20 @@
+ #include <glob.h>
+ #include <libgen.h>
+ 
+-#include <ldconfig.h>
+-#include <dl-cache.h>
++#include "ldconfig.h"
++#include "dl-cache.h"
++
++#include "dl-procinfo.h"
++
++#include "argp.h"
++
++
++#define SYSCONFDIR "/etc"
++#define LIBDIR "/usr/lib"
++#define SLIBDIR "/lib"
++# define N_(msgid)  msgid
++#define _(msg) msg
+ 
+-#include <dl-procinfo.h>
+ 
+ #ifdef _DL_FIRST_PLATFORM
+ # define _DL_FIRST_EXTRA (_DL_FIRST_PLATFORM + _DL_PLATFORMS_COUNT)
+@@ -55,7 +68,7 @@
+ #endif
+ 
+ /* Get libc version number.  */
+-#include <version.h>
++#include "version.h"
+ 
+ #define PACKAGE _libc_intl_domainname
+ 
+@@ -152,8 +165,8 @@ static const struct argp_option options[
+   { NULL, 0, NULL, 0, NULL, 0 }
+ };
+ 
+-#define PROCINFO_CLASS static
+-#include <dl-procinfo.c>
++//#define PROCINFO_CLASS static
++//#include <dl-procinfo.c>
+ 
+ /* Short description of program.  */
+ static const char doc[] = N_("Configure Dynamic Linker Run Time Bindings.");
+@@ -291,6 +304,7 @@ parse_opt (int key, char *arg, struct ar
+   return 0;
+ }
+ 
++#define REPORT_BUGS_TO "mailing list : poky@yoctoproject.org"
+ /* Print bug-reporting information in the help message.  */
+ static char *
+ more_help (int key, const char *text, void *input)
+@@ -315,7 +329,7 @@ For bug reporting instructions, please s
+ static void
+ print_version (FILE *stream, struct argp_state *state)
+ {
+-  fprintf (stream, "ldconfig %s%s\n", PKGVERSION, VERSION);
++  fprintf (stream, "ldconfig (Hacked Poky Version)\n");
+   fprintf (stream, gettext ("\
+ Copyright (C) %s Free Software Foundation, Inc.\n\
+ This is free software; see the source for copying conditions.  There is NO\n\
+@@ -1233,6 +1247,7 @@ set_hwcap (void)
+     hwcap_mask = strtoul (mask, NULL, 0);
+ }
+ 
++const char _libc_intl_domainname[] = "libc";
+ 
+ int
+ main (int argc, char **argv)
+Index: ldconfig-native-2.12.1/readlib.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/readlib.c
++++ ldconfig-native-2.12.1/readlib.c
+@@ -22,6 +22,9 @@
+    development version.  Besides the simplification, it has also been
+    modified to read some other file formats.  */
+ 
++#define _LARGEFILE64_SOURCE
++#define _GNU_SOURCE
++
+ #include <a.out.h>
+ #include <elf.h>
+ #include <error.h>
+@@ -35,7 +38,9 @@
+ #include <sys/stat.h>
+ #include <gnu/lib-names.h>
+ 
+-#include <ldconfig.h>
++#include "ldconfig.h"
++
++#define _(msg) msg
+ 
+ #define Elf32_CLASS ELFCLASS32
+ #define Elf64_CLASS ELFCLASS64
+Index: ldconfig-native-2.12.1/xstrdup.c
+===================================================================
+--- ldconfig-native-2.12.1.orig/xstrdup.c
++++ ldconfig-native-2.12.1/xstrdup.c
+@@ -16,15 +16,10 @@
+    along with this program; if not, write to the Free Software Foundation,
+    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+ 
+-#ifdef HAVE_CONFIG_H
+-# include <config.h>
+-#endif
++#define _GNU_SOURCE
++
++#include <string.h>
+ 
+-#if defined STDC_HEADERS || defined HAVE_STRING_H || _LIBC
+-# include <string.h>
+-#else
+-# include <strings.h>
+-#endif
+ void *xmalloc (size_t n) __THROW;
+ char *xstrdup (char *string) __THROW;
+ 
diff --git a/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
new file mode 100644
index 0000000..27bc411
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig_aux-cache_path_fix.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Pending
+
+Coming from this bug: http://sourceware.org/bugzilla/show_bug.cgi?id=11149
+
+Nitin A Kamble <nitin.a.kamble@intel.com>2011/03/29
+
+--- ldconfig-native-2.12.1.orig/ldconfig.c	
++++ ldconfig-native-2.12.1/ldconfig.c	
+@@ -1359,14 +1359,9 @@ main (int argc, char **argv)
+ 
+   const char *aux_cache_file = _PATH_LDCONFIG_AUX_CACHE;
+   if (opt_chroot)
+-    {
+-      aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
+-      if (aux_cache_file == NULL)
+-	error (EXIT_FAILURE, errno, _("Can't open cache file %s\n"),
+-	       _PATH_LDCONFIG_AUX_CACHE);
+-    }
++    aux_cache_file = chroot_canon (opt_chroot, aux_cache_file);
+ 
+-  if (! opt_ignore_aux_cache)
++  if (! opt_ignore_aux_cache && aux_cache_file)
+     load_aux_cache (aux_cache_file);
+   else
+     init_aux_cache ();
+@@ -1376,7 +1371,8 @@ main (int argc, char **argv)
+   if (opt_build_cache)
+     {
+       save_cache (cache_file);
+-      save_aux_cache (aux_cache_file);
++      if (aux_cache_file)
++        save_aux_cache (aux_cache_file);
+     }
+ 
+   return 0;
+
diff --git a/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb b/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb
new file mode 100644
index 0000000..93c0b18
--- /dev/null
+++ b/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb
@@ -0,0 +1,34 @@
+SUMMARY = "A standalone native ldconfig build"
+
+LICENSE = "GPLv2+"
+
+LIC_FILES_CHKSUM = "file://${S}/ldconfig.c;endline=17;md5=1d15f20937c055cb5de2329a4c054399"
+
+SRC_URI = "file://ldconfig-native-2.12.1.tar.bz2 \
+           file://ldconfig.patch \
+           file://ldconfig_aux-cache_path_fix.patch \
+           file://32and64bit.patch \
+           file://endian-ness_handling.patch \
+           file://flag_fix.patch \
+           file://endianess-header.patch \
+           file://ldconfig-default-to-all-multilib-dirs.patch \
+           file://endian-ness_handling_fix.patch \
+           file://add-64-bit-flag-for-ELF64-entries.patch \
+"
+
+PR = "r2"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${P}:"
+
+inherit native
+
+S = "${WORKDIR}/${PN}-${PV}"
+
+do_compile () {
+	$CC ldconfig.c -std=gnu99 chroot_canon.c xmalloc.c xstrdup.c cache.c readlib.c  -I. dl-cache.c -o ldconfig
+}
+
+do_install () {
+	install -d ${D}/${bindir}/
+	install ldconfig ${D}/${bindir}/
+}
diff --git a/meta/recipes-core/glibc/site_config/funcs b/meta/recipes-core/glibc/site_config/funcs
new file mode 100644
index 0000000..ccc8539
--- /dev/null
+++ b/meta/recipes-core/glibc/site_config/funcs
@@ -0,0 +1,474 @@
+a64l
+abs
+access
+__adjtimex
+alarm
+alphasort
+argz_append
+__argz_count
+argz_create_sep
+argz_insert
+__argz_next
+argz_next
+__argz_stringify
+argz_stringify
+asprintf
+atexit
+atof
+atoi
+bcmp
+bcopy
+bindresvport
+bind_textdomain_codeset
+btowc
+bzero
+calloc
+canonicalize_file_name
+catgets
+cfgetospeed
+cfsetispeed
+cfsetspeed
+chmod
+chown
+chroot
+clock
+close
+closedir
+closelog
+confstr
+connect
+daemon
+dcgettext
+difftime
+dirfd
+dirname
+dngettext
+dup2
+ecvt
+endgrent
+endmntent
+endpwent
+endutent
+endutxent
+epoll_ctl
+err
+ether_hostton
+ether_ntohost
+euidaccess
+execv
+fchdir
+fchmod
+fchmodat
+fchown
+fchownat
+fcntl
+fcvt
+fdatasync
+fdopendir
+feof_unlocked
+fgets_unlocked
+fgetxattr
+finite
+flistxattr
+flock
+flockfile
+fnmatch
+fork
+fpathconf
+__fpending
+fprintf
+free
+freeaddrinfo
+freeifaddrs
+fseeko
+__fsetlocking
+fsetxattr
+fstat64
+fstat
+fstatfs
+fsync
+ftello
+ftime
+ftruncate
+funlockfile
+futimes
+futimesat
+gai_strerror
+gcvt
+getaddrinfo
+getc_unlocked
+getcwd
+getdelim
+getdomainname
+getdtablesize
+getegid
+getenv
+geteuid
+getgid
+getgrent
+getgrent_r
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getgroups
+gethostbyaddr_r
+gethostbyname2
+gethostbyname
+gethostbyname_r
+gethostent
+gethostid
+gethostname
+getifaddrs
+getline
+getloadavg
+getmntent
+getmsg
+getnameinfo
+getnetbyaddr_r
+getnetgrent_r
+getopt
+getopt_long
+getopt_long_only
+getpagesize
+getpass
+getpeername
+getpgrp
+getpid
+getppid
+getprotoent_r
+getpwent
+getpwent_r
+getpwnam
+getpwnam_r
+getpwuid
+getpwuid_r
+getresuid
+getrlimit
+getrusage
+getservbyname
+getservbyname_r
+getservbyport_r
+getservent
+getservent_r
+getspnam
+getspnam_r
+gettimeofday
+getttyent
+getttynam
+getuid
+getusershell
+getutent
+getutid
+getutline
+getutmp
+getutmpx
+getutxent
+getutxid
+getutxline
+getwd
+getxattr
+glob
+gmtime
+gmtime_r
+grantpt
+group_member
+herror
+hstrerror
+iconv
+iconv_open
+if_freenameindex
+if_indextoname
+if_nameindex
+if_nametoindex
+index
+inet_addr
+inet_aton
+inet_ntoa
+inet_ntop
+inet_pton
+initgroups
+innetgr
+iruserok
+isascii
+isatty
+isblank
+isgraph
+isinf
+isnan
+isprint
+isspace
+iswalnum
+iswcntrl
+iswctype
+iswprint
+iswspace
+iswupper
+isxdigit
+kill
+killpg
+lchown
+lckpwdf
+lgetxattr
+link
+listxattr
+llistxattr
+localtime
+localtime_r
+lockf
+lrand48
+lsearch
+lseek64
+lsetxattr
+lstat
+mallinfo
+malloc
+mblen
+mbrlen
+mbrtowc
+mbsinit
+mbsrtowcs
+mbtowc
+memalign
+memchr
+memcmp
+memcpy
+memmove
+mempcpy
+memrchr
+memset
+mkdir
+mkdirat
+mkdtemp
+mkfifo
+mknod
+mkstemp64
+mkstemp
+mktime
+mlock
+mmap
+mtrace
+munlock
+munmap
+nanosleep
+nice
+nl_langinfo
+ntp_adjtime
+ntp_gettime
+_obstack_free
+on_exit
+open64
+open
+openat
+opendir
+openlog
+pathconf
+pipe
+poll
+popen
+posix_memalign
+prctl
+pread
+printf
+__progname
+pselect
+pthread_mutex_lock
+ptsname
+putenv
+putgrent
+putpwent
+putspent
+pututline
+pututxline
+putwc
+pwrite
+qsort
+raise
+rand
+random
+rand_r
+read
+readdir
+readdir_r
+readlink
+realloc
+realpath
+re_comp
+recvmsg
+re_exec
+regcomp
+regexec
+remove
+rename
+re_search
+rmdir
+rpmatch
+rresvport_af
+ruserok
+ruserok_af
+sbrk
+scandir
+sched_setscheduler
+sched_yield
+__secure_getenv
+select
+semctl
+semget
+sendmsg
+setbuf
+setbuffer
+setegid
+setenv
+seteuid
+setgid
+setgroups
+sethostname
+setitimer
+_setjmp
+setjmp
+setlinebuf
+setlocale
+setmntent
+setpgid
+setpgrp
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setsid
+setsockopt
+settimeofday
+setuid
+setutent
+setutxent
+setvbuf
+setxattr
+sgetspent
+shmat
+shmctl
+shmdt
+shmget
+shutdown
+sigaction
+sigaddset
+sigaltstack
+sigblock
+sigemptyset
+sighold
+siginterrupt
+signal
+sigprocmask
+sigset
+sigsetmask
+sigstack
+sigsuspend
+sigvec
+snprintf
+socket
+socketpair
+sprintf
+srand48
+srand
+srandom
+sscanf
+stat
+statfs
+statvfs
+stime
+stpcpy
+strcasecmp
+strcasestr
+strchr
+strchrnul
+strcmp
+strcspn
+strdup
+strerror
+strerror_r
+strftime
+strlen
+strncasecmp
+strncmp
+strndup
+strnlen
+strpbrk
+strptime
+strrchr
+strsep
+strsignal
+strspn
+strstr
+strtod
+strtoimax
+strtok_r
+strtol
+strtoll
+strtoul
+strtoull
+strtoumax
+strverscmp
+strxfrm
+symlink
+sync
+sysconf
+sysctl
+sysinfo
+syslog
+_sys_siglist
+sys_siglist
+system
+tcgetattr
+tcgetpgrp
+tcsetattr
+tcsetpgrp
+time
+timegm
+times
+timezone
+tmpnam
+towlower
+towupper
+truncate
+tsearch
+ttyname
+tzset
+ulimit
+umask
+uname
+unlink
+unsetenv
+unshare
+updwtmp
+updwtmpx
+usleep
+ustat
+utime
+utimes
+utmpname
+utmpxname
+valloc
+vasprintf
+verrx
+vfork
+vfprintf
+vfscanf
+vhangup
+vprintf
+vsnprintf
+vsprintf
+wait3
+wait4
+waitpid
+wcrtomb
+wcscoll
+wcsdup
+wcslen
+wctob
+wctomb
+wctype
+wcwidth
+wmemchr
+wmemcpy
+wmempcpy
diff --git a/meta/recipes-core/glibc/site_config/headers b/meta/recipes-core/glibc/site_config/headers
new file mode 100644
index 0000000..609ab53
--- /dev/null
+++ b/meta/recipes-core/glibc/site_config/headers
@@ -0,0 +1,156 @@
+aio.h
+alloca.h
+argz.h
+arpa/inet.h
+arpa/nameser.h
+asm/byteorder.h
+asm/ioctls.h
+asm/page.h
+asm/types.h
+assert.h
+byteswap.h
+crypt.h
+ctype.h
+dirent.h
+dlfcn.h
+elf.h
+endian.h
+err.h
+errno.h
+execinfo.h
+fcntl.h
+features.h
+float.h
+fstab.h
+ftw.h
+getopt.h
+glob.h
+grp.h
+iconv.h
+ifaddrs.h
+inttypes.h
+langinfo.h
+lastlog.h
+libgen.h
+libintl.h
+limits.h
+linux/capability.h
+linux/fd.h
+linux/fs.h
+linux/hayesesp.h
+linux/hdreg.h
+linux/icmp.h
+linux/in6.h
+linux/joystick.h
+linux/ptrace.h
+linux/serial.h
+linux/sonypi.h
+linux/unistd.h
+linux/utsname.h
+linux/version.h
+locale.h
+malloc.h
+math.h
+mcheck.h
+memory.h
+mntent.h
+mqueue.h
+netdb.h
+net/if.h
+netinet/ether.h
+netinet/in.h
+netinet/ip6.h
+netinet/ip.h
+netinet/tcp.h
+netinet/udp.h
+netipx/ipx.h
+net/route.h
+paths.h
+poll.h
+pthread.h
+pty.h
+pwd.h
+regex.h
+resolv.h
+rpc/rpc.h
+rpc/types.h
+sched.h
+scsi/scsi.h
+search.h
+semaphore.h
+setjmp.h
+sgtty.h
+shadow.h
+signal.h
+stdarg.h
+stdbool.h
+stdc
+stddef.h
+stdint.h
+stdio.h
+stdlib.h
+string.h
+strings.h
+stropts.h
+sys/bitypes.h
+sys/cdefs.h
+sys/dir.h
+sys/epoll.h
+sysexits.h
+sys/fcntl.h
+sys/file.h
+sys/fsuid.h
+sys/ioctl.h
+sys/ipc.h
+syslog.h
+sys/mman.h
+sys/mount.h
+sys/mtio.h
+sys/param.h
+sys/poll.h
+sys/prctl.h
+sys/ptrace.h
+sys/queue.h
+sys/reg.h
+sys/resource.h
+sys/select.h
+sys/sem.h
+sys/shm.h
+sys/signal.h
+sys/socket.h
+sys/socketvar.h
+sys/soundcard.h
+sys/statfs.h
+sys/stat.h
+sys/statvfs.h
+sys/stropts.h
+sys/swap.h
+sys/sysctl.h
+sys/sysinfo.h
+sys/sysmacros.h
+sys/termios.h
+sys/timeb.h
+sys/time.h
+sys/times.h
+sys/timex.h
+sys/types.h
+sys/uio.h
+sys/un.h
+sys/unistd.h
+sys/user.h
+sys/utsname.h
+sys/vfs.h
+sys/wait.h
+termio.h
+termios.h
+time.h
+ttyent.h
+ulimit.h
+unistd.h
+ustat.h
+utime.h
+utmp.h
+utmpx.h
+values.h
+wchar.h
+wctype.h
diff --git a/meta/recipes-core/glibc/site_config/types b/meta/recipes-core/glibc/site_config/types
new file mode 100644
index 0000000..178bd85
--- /dev/null
+++ b/meta/recipes-core/glibc/site_config/types
@@ -0,0 +1,21 @@
+char
+char *
+double
+float
+int
+long
+long double
+long int
+long long
+long long int
+short
+short int
+signed char
+unsigned char
+unsigned int
+unsigned long
+unsigned long int
+unsigned long long int
+unsigned short
+unsigned short int
+void *
diff --git a/meta/recipes-core/ifupdown/files/99_network b/meta/recipes-core/ifupdown/files/99_network
new file mode 100644
index 0000000..42d5895
--- /dev/null
+++ b/meta/recipes-core/ifupdown/files/99_network
@@ -0,0 +1 @@
+d root root 0755 /run/network none
diff --git a/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch b/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch
new file mode 100644
index 0000000..8c4d953
--- /dev/null
+++ b/meta/recipes-core/ifupdown/files/defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch
@@ -0,0 +1,56 @@
+From 7af9db748974cb3a2c6ef8f9e03d7db1f9f8ee16 Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Wed, 6 Aug 2014 14:54:12 -0400
+Subject: [PATCH 1/2] defn2[c|man]: don't rely on dpkg-architecture to set arch
+
+In yocto we'll always be cross compiling, and we'll always
+be building on linux for linux (vs. *BSD, hurd, etc.)
+
+Without this the arch is not detected, but it doesn't error
+out, and hence you get useless binaries that don't know any
+arch specific methods, and the end result will be strangeness
+like the loopback device not being configured/enabled.
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+---
+ defn2c.pl   | 6 +++---
+ defn2man.pl | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/defn2c.pl b/defn2c.pl
+index c449de2f3d1c..38845e374c76 100755
+--- a/defn2c.pl
++++ b/defn2c.pl
+@@ -2,9 +2,9 @@
+ 
+ use strict;
+ 
+-my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
+-
+-$DEB_HOST_ARCH_OS =~ s/\n//;
++#my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
++#$DEB_HOST_ARCH_OS =~ s/\n//;
++my $DEB_HOST_ARCH_OS ="linux";
+ 
+ # declarations
+ my $address_family = "";
+diff --git a/defn2man.pl b/defn2man.pl
+index 6ddcfdd4fe68..c9c4dd046597 100755
+--- a/defn2man.pl
++++ b/defn2man.pl
+@@ -2,9 +2,9 @@
+ 
+ use strict;
+ 
+-my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
+-
+-$DEB_HOST_ARCH_OS =~ s/\n//;
++#my $DEB_HOST_ARCH_OS = `dpkg-architecture -qDEB_HOST_ARCH_OS`;
++#$DEB_HOST_ARCH_OS =~ s/\n//;
++my $DEB_HOST_ARCH_OS = "linux";
+ 
+ # declarations
+ my $line;
+-- 
+1.9.1
+
diff --git a/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch b/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
new file mode 100644
index 0000000..bff352e3
--- /dev/null
+++ b/meta/recipes-core/ifupdown/files/inet-6-.defn-fix-inverted-checks-for-loopback.patch
@@ -0,0 +1,103 @@
+From 74152ac74a3e1ea0f3be292aa1eeca5ad1fe69c0 Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Wed, 6 Aug 2014 15:12:11 -0400
+Subject: [PATCH 2/2] inet[6].defn: fix inverted checks for loopback
+
+Compared to the hurd link.defn for loopback, we see these
+are inverted, meaning that you would only be able to configure
+a loopback device that was _not_ named "lo" (unlikely to exist).
+
+The result was that we'd update /run/network/ifstate for "lo"
+but never actually do anything for up/down, as shown below:
+
+root@localhost:~# ifconfig -s
+Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0       1500 0   7736329      0   2016 0       5289422      0      0      0 BMRU
+lo        65536 0        18      0      0 0            18      0      0      0 LRU
+root@localhost:~# ifdown lo
+root@localhost:~# echo $?
+0
+root@localhost:~# ifconfig -s
+Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0       1500 0   7736406      0   2016 0       5289455      0      0      0 BMRU
+lo        65536 0        18      0      0 0            18      0      0      0 LRU
+root@localhost:~# ifconfig lo down
+root@localhost:~# ifconfig -s
+Iface   MTU Met   RX-OK RX-ERR RX-DRP RX-OVR    TX-OK TX-ERR TX-DRP TX-OVR Flg
+eth0       1500 0   7736474      0   2016 0       5289481      0      0      0 BMRU
+root@localhost:~#
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+---
+ inet.defn  | 12 ++++++------
+ inet6.defn |  8 ++++----
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/inet.defn b/inet.defn
+index b176ab4ed03e..5fdfb14a0e1c 100644
+--- a/inet.defn
++++ b/inet.defn
+@@ -6,10 +6,10 @@ method loopback
+     This method may be used to define the IPv4 loopback interface.
+ 
+   up
+-    ip link set dev %iface% up if (!iface_is_lo())
++    ip link set dev %iface% up if (iface_is_lo())
+ 
+   down
+-    ip link set dev %iface% down if (!iface_is_lo())
++    ip link set dev %iface% down if (iface_is_lo())
+ 
+ method static
+   description
+@@ -212,11 +212,11 @@ method loopback
+ 
+   up
+     ifconfig %iface% 127.0.0.1 up \
+-	if (!iface_is_lo())
++	if (iface_is_lo())
+ 
+   down
+     ifconfig %iface% down \
+-	if (!iface_is_lo())
++	if (iface_is_lo())
+ 
+ method static
+   description
+@@ -371,11 +371,11 @@ method loopback
+ 
+   up
+     inetutils-ifconfig --interface %iface% --address 127.0.0.1 --up \
+-	if (!iface_is_lo())
++	if (iface_is_lo())
+ 
+   down
+     inetutils-ifconfig --interface %iface% --down \
+-	if (!iface_is_lo())
++	if (iface_is_lo())
+ 
+ method static
+   description
+diff --git a/inet6.defn b/inet6.defn
+index 09325539cd01..4df64aff38cc 100644
+--- a/inet6.defn
++++ b/inet6.defn
+@@ -33,11 +33,11 @@ method loopback
+   description
+     This method may be used to define the IPv6 loopback interface.
+   up
+-    -ip link set dev %iface% up 2>/dev/null if (!iface_is_lo())
+-    -ip addr add dev %iface% ::1 2>/dev/null if (!iface_is_lo())
++    -ip link set dev %iface% up 2>/dev/null if (iface_is_lo())
++    -ip addr add dev %iface% ::1 2>/dev/null if (iface_is_lo())
+   down
+-    -ip addr del dev %iface% ::1 2>/dev/null if (!iface_is_lo())
+-    -ip link set dev %iface% down 2>/dev/null if (!iface_is_lo())
++    -ip addr del dev %iface% ::1 2>/dev/null if (iface_is_lo())
++    -ip link set dev %iface% down 2>/dev/null if (iface_is_lo())
+ 
+ method static
+   description
+-- 
+1.9.1
+
diff --git a/meta/recipes-core/ifupdown/ifupdown_0.7.48.1.bb b/meta/recipes-core/ifupdown/ifupdown_0.7.48.1.bb
new file mode 100644
index 0000000..24eb87b
--- /dev/null
+++ b/meta/recipes-core/ifupdown/ifupdown_0.7.48.1.bb
@@ -0,0 +1,54 @@
+SUMMARY = "ifupdown: basic ifup and ifdown used by initscripts"
+DESCRIPTION = "High level tools to configure network interfaces \
+This package provides the tools ifup and ifdown which may be used to \
+configure (or, respectively, deconfigure) network interfaces, based on \
+the file /etc/network/interfaces."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://archive.ubuntu.com/ubuntu/pool/main/i/ifupdown/ifupdown_0.7.48.1ubuntu5.tar.gz \
+	   file://defn2-c-man-don-t-rely-on-dpkg-architecture-to-set-a.patch \
+	   file://inet-6-.defn-fix-inverted-checks-for-loopback.patch \
+	   file://99_network \
+	  "
+
+EXTRA_OEMAKE = ""
+
+# needed so we don't get default S="${WORKDIR}/ifupdown-${PV}"
+S = "${WORKDIR}/ifupdown-${PV}ubuntu5"
+
+
+inherit update-rc.d update-alternatives
+
+do_compile () {
+	chmod a+rx *.pl *.sh
+	oe_runmake 'CC=${CC}' "CFLAGS=${CFLAGS} -Wall -W -D'IFUPDOWN_VERSION=\"${PV}\"'"
+}
+
+do_install () {
+	install -d ${D}${mandir}/man8 \
+		  ${D}${mandir}/man5 \
+		  ${D}${base_sbindir}
+
+	# If volatiles are used, then we'll also need /run/network there too.
+	install -d ${D}/etc/default/volatiles
+	install -m 0644 ${WORKDIR}/99_network ${D}/etc/default/volatiles
+
+	install -m 0755 ifup ${D}${base_sbindir}/
+	ln ${D}${base_sbindir}/ifup ${D}${base_sbindir}/ifdown
+	install -m 0644 ifup.8 ${D}${mandir}/man8
+	install -m 0644 interfaces.5 ${D}${mandir}/man5
+	cd ${D}${mandir}/man8 && ln -s ifup.8 ifdown.8
+}
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "ifup ifdown"
+
+ALTERNATIVE_LINK_NAME[ifup] = "${base_sbindir}/ifup"
+ALTERNATIVE_LINK_NAME[ifdown] = "${base_sbindir}/ifdown"
+
+INITSCRIPT_NAME = "ifup"
+INITSCRIPT_PARAMS = "start 39 S . stop 39 0 6 1 ."
+
+SRC_URI[md5sum] = "85ba375f3c6f26d34efb2a8575e77fc8"
+SRC_URI[sha256sum] = "08dce14692c07b72b583b86c4d3ace0d9dac1928925144cc3ddde15b694ebbdf"
diff --git a/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx
new file mode 100644
index 0000000..6472e87
--- /dev/null
+++ b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmx
@@ -0,0 +1,46 @@
+.encoding = "UTF-8"
+config.version = "8"
+virtualHW.version = "10"
+numvcpus = "2"
+vcpu.hotadd = "TRUE"
+memsize = "4096"
+mem.hotadd = "TRUE"
+sata0.present = "TRUE"
+sata0:0.present = "TRUE"
+sata0:0.fileName = "Yocto_Build_Appliance.vmdk"
+ethernet0.present = "TRUE"
+ethernet0.virtualDev = "e1000"
+ethernet0.wakeOnPcktRcv = "FALSE"
+ethernet0.addressType = "generated"
+usb.present = "TRUE"
+ehci.pciSlotNumber = "0"
+sound.present = "TRUE"
+sound.fileName = "-1"
+sound.autodetect = "TRUE"
+pciBridge0.present = "TRUE"
+pciBridge4.present = "TRUE"
+pciBridge4.virtualDev = "pcieRootPort"
+pciBridge4.functions = "8"
+pciBridge5.present = "TRUE"
+pciBridge5.virtualDev = "pcieRootPort"
+pciBridge5.functions = "8"
+pciBridge6.present = "TRUE"
+pciBridge6.virtualDev = "pcieRootPort"
+pciBridge6.functions = "8"
+pciBridge7.present = "TRUE"
+pciBridge7.virtualDev = "pcieRootPort"
+pciBridge7.functions = "8"
+vmci0.present = "TRUE"
+hpet0.present = "TRUE"
+usb.vbluetooth.startConnected = "TRUE"
+displayName = "Yocto Build Appliance"
+guestOS = "other3xlinux-64"
+virtualHW.productCompatibility = "hosted"
+gui.exitOnCLIHLT = "FALSE"
+powerType.powerOff = "soft"
+powerType.powerOn = "soft"
+powerType.suspend = "soft"
+powerType.reset = "soft"
+extendedConfigFile = "Yocto_Build_Appliance.vmxf"
+scsi0:0.present = "FALSE"
+floppy0.present = "FALSE"
diff --git a/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf
new file mode 100644
index 0000000..9e941ff
--- /dev/null
+++ b/meta/recipes-core/images/build-appliance-image/Yocto_Build_Appliance.vmxf
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<Foundry>
+<VM>
+<VMId type="string">52 a5 d8 cb ed 6c 85 48-cd 99 68 af cc 30 a0 98</VMId>
+<ClientMetaData>
+<clientMetaDataAttributes/>
+<HistoryEventList/></ClientMetaData>
+<vmxPathName type="string">Yocto_Build_Appliance.vmx</vmxPathName></VM></Foundry>
diff --git a/meta/recipes-core/images/build-appliance-image_12.0.1.bb b/meta/recipes-core/images/build-appliance-image_12.0.1.bb
new file mode 100644
index 0000000..0a86ba4
--- /dev/null
+++ b/meta/recipes-core/images/build-appliance-image_12.0.1.bb
@@ -0,0 +1,93 @@
+SUMMARY = "An image containing the build system itself"
+DESCRIPTION = "An image containing the build system that you can boot and run using either VMware Player or VMware Workstation."
+HOMEPAGE = "http://www.yoctoproject.org/documentation/build-appliance"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+IMAGE_INSTALL = "packagegroup-core-boot packagegroup-core-ssh-openssh packagegroup-self-hosted"
+
+IMAGE_FEATURES += "x11-base package-management splash"
+
+# Ensure there's enough space to do a core-image-sato build, with rm_work enabled
+IMAGE_ROOTFS_EXTRA_SPACE = "41943040"
+
+# Do a quiet boot with limited console messages
+APPEND += "rootfstype=ext4 quiet"
+
+DEPENDS = "zip-native"
+IMAGE_FSTYPES = "vmdk"
+
+inherit core-image
+
+SRCREV ?= "d01cd53429b1c20f01dac97f1b9b659cb9dc9812"
+SRC_URI = "git://git.yoctoproject.org/poky \
+           file://Yocto_Build_Appliance.vmx \
+           file://Yocto_Build_Appliance.vmxf \
+          "
+
+IMAGE_CMD_ext4_append () {
+	# We don't need to reserve much space for root, 0.5% is more than enough
+	tune2fs -m 0.5 ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.rootfs.ext4
+}
+
+fakeroot do_populate_poky_src () {
+	# Because fetch2's git's unpack uses -s cloneflag, the unpacked git repo
+	# will become invalid in the target.
+	rm -rf ${WORKDIR}/git/.git
+	rm -f ${WORKDIR}/git/.gitignore
+
+	cp -Rp ${WORKDIR}/git ${IMAGE_ROOTFS}/home/builder/poky
+
+	mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/conf
+	mkdir -p ${IMAGE_ROOTFS}/home/builder/poky/build/downloads
+	cp -RpL ${DL_DIR}/* ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/
+
+	# Remove the git2_* tarballs -- this is ok since we still have the git2/.
+	rm -rf ${IMAGE_ROOTFS}/home/builder/poky/build/downloads/git2_*
+
+	echo "/usr/bin" > ${IMAGE_ROOTFS}/home/builder/poky/build/pseudodone
+	echo "INHERIT += \"rm_work\"" >> ${IMAGE_ROOTFS}/home/builder/poky/build/conf/auto.conf
+	mkdir -p ${IMAGE_ROOTFS}/home/builder/pseudo
+	echo "export PSEUDO_PREFIX=/usr" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+	echo "export PSEUDO_LOCALSTATEDIR=/home/builder/pseudo" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+	echo "export PSEUDO_LIBDIR=/usr/lib/pseudo/lib64" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
+
+	chown builder.builder ${IMAGE_ROOTFS}/home/builder/pseudo
+
+	chown -R builder.builder  ${IMAGE_ROOTFS}/home/builder/poky
+
+	# Allow builder to use sudo to setup tap/tun
+	echo "builder ALL=(ALL) NOPASSWD: ALL" >> ${IMAGE_ROOTFS}/etc/sudoers
+
+	# Use Clearlooks GTK+ theme
+	mkdir -p ${IMAGE_ROOTFS}/etc/gtk-2.0
+	echo 'gtk-theme-name = "Clearlooks"' > ${IMAGE_ROOTFS}/etc/gtk-2.0/gtkrc
+}
+
+IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; "
+
+addtask rootfs after do_unpack
+
+python () {
+	# Ensure we run these usually noexec tasks
+	d.delVarFlag("do_fetch", "noexec")
+	d.delVarFlag("do_unpack", "noexec")
+}
+
+create_bundle_files () {
+	cd ${WORKDIR}
+	mkdir -p Yocto_Build_Appliance
+	cp *.vmx* Yocto_Build_Appliance
+	ln -sf ${DEPLOY_DIR_IMAGE}/${IMAGE_NAME}.vmdk Yocto_Build_Appliance/Yocto_Build_Appliance.vmdk
+	zip -r ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance-${DATETIME}.zip Yocto_Build_Appliance
+	ln -sf Yocto_Build_Appliance-${DATETIME}.zip ${DEPLOY_DIR_IMAGE}/Yocto_Build_Appliance.zip 
+}
+
+python do_bundle_files() {
+    bb.build.exec_func('create_bundle_files', d)
+}
+
+addtask bundle_files after do_vmimg before do_build
+do_bundle_files[nostamp] = "1"
diff --git a/meta/recipes-core/images/core-image-base.bb b/meta/recipes-core/images/core-image-base.bb
new file mode 100644
index 0000000..75a08cf
--- /dev/null
+++ b/meta/recipes-core/images/core-image-base.bb
@@ -0,0 +1,8 @@
+SUMMARY = "A console-only image that fully supports the target device \
+hardware."
+
+IMAGE_FEATURES += "splash"
+
+LICENSE = "MIT"
+
+inherit core-image
diff --git a/meta/recipes-core/images/core-image-minimal-dev.bb b/meta/recipes-core/images/core-image-minimal-dev.bb
new file mode 100644
index 0000000..93ead20
--- /dev/null
+++ b/meta/recipes-core/images/core-image-minimal-dev.bb
@@ -0,0 +1,7 @@
+require core-image-minimal.bb
+
+DESCRIPTION = "A small image just capable of allowing a device to boot and \
+is suitable for development work."
+
+IMAGE_FEATURES += "dev-pkgs"
+
diff --git a/meta/recipes-core/images/core-image-minimal-initramfs.bb b/meta/recipes-core/images/core-image-minimal-initramfs.bb
new file mode 100644
index 0000000..1f0fa95
--- /dev/null
+++ b/meta/recipes-core/images/core-image-minimal-initramfs.bb
@@ -0,0 +1,21 @@
+# Simple initramfs image. Mostly used for live images.
+DESCRIPTION = "Small image capable of booting a device. The kernel includes \
+the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \
+first 'init' program more efficiently."
+
+PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install initramfs-live-install-efi busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "core-image-minimal-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+
+BAD_RECOMMENDATIONS += "busybox-syslog"
diff --git a/meta/recipes-core/images/core-image-minimal-mtdutils.bb b/meta/recipes-core/images/core-image-minimal-mtdutils.bb
new file mode 100644
index 0000000..c92234c
--- /dev/null
+++ b/meta/recipes-core/images/core-image-minimal-mtdutils.bb
@@ -0,0 +1,7 @@
+require core-image-minimal.bb
+
+DESCRIPTION = "Small image capable of booting a device with support for the \
+Minimal MTD Utilities, which let the user interact with the MTD subsystem in \
+the kernel to perform operations on flash devices."
+
+IMAGE_INSTALL += "mtd-utils"
diff --git a/meta/recipes-core/images/core-image-minimal.bb b/meta/recipes-core/images/core-image-minimal.bb
new file mode 100644
index 0000000..8dd77b3
--- /dev/null
+++ b/meta/recipes-core/images/core-image-minimal.bb
@@ -0,0 +1,12 @@
+SUMMARY = "A small image just capable of allowing a device to boot."
+
+IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL}"
+
+IMAGE_LINGUAS = " "
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_ROOTFS_SIZE ?= "8192"
+IMAGE_ROOTFS_EXTRA_SPACE_append = "${@bb.utils.contains("DISTRO_FEATURES", "systemd", " + 4096", "" ,d)}"
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
new file mode 100644
index 0000000..2a8e0d1
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/copyright
@@ -0,0 +1,11 @@
+This package was created by Peter Tobias tobias@et-inf.fho-emden.de on
+Wed, 24 Aug 1994 21:33:28 +0200 and maintained by Anthony Towns
+<ajt@debian.org> until 2001.
+It is currently maintained by Marco d'Itri <md@linux.it>.
+
+Copyright 1994-2010 Peter Tobias, Anthony Towns and Marco d'Itri
+
+The programs in this package are distributed under the terms of the GNU
+General Public License, version 2 as distributed by the Free Software
+Foundation. On Debian systems, a copy of this license may be found in
+/usr/share/common-licenses/GPL-2.
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
new file mode 100644
index 0000000..fb31c63
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/init
@@ -0,0 +1,90 @@
+#!/bin/sh -e
+### BEGIN INIT INFO
+# Provides:          networking
+# Required-Start:    mountvirtfs $local_fs
+# Required-Stop:     $local_fs
+# Should-Start:      ifupdown
+# Should-Stop:       ifupdown
+# Default-Start:     S
+# Default-Stop:      0 6
+# Short-Description: Raise network interfaces.
+### END INIT INFO
+
+PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+
+[ -x /sbin/ifup ] || exit 0
+
+check_network_file_systems() {
+    [ -e /proc/mounts ] || return 0
+
+    if [ -e /etc/iscsi/iscsi.initramfs ]; then
+	echo "not deconfiguring network interfaces: iSCSI root is mounted."
+	exit 0
+    fi
+
+    exec 9<&0 < /proc/mounts
+    while read DEV MTPT FSTYPE REST; do
+	case $DEV in
+	/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
+	    echo "not deconfiguring network interfaces: network devices still mounted."
+	    exit 0
+	    ;;
+	esac
+	case $FSTYPE in
+	nfs|nfs4|smbfs|ncp|ncpfs|cifs|coda|ocfs2|gfs|pvfs|pvfs2|fuse.httpfs|fuse.curlftpfs)
+	    echo "not deconfiguring network interfaces: network file systems still mounted."
+	    exit 0
+	    ;;
+	esac
+    done
+    exec 0<&9 9<&-
+}
+
+check_network_swap() {
+    [ -e /proc/swaps ] || return 0
+
+    exec 9<&0 < /proc/swaps
+    while read DEV MTPT FSTYPE REST; do
+	case $DEV in
+	/dev/nbd*|/dev/nd[a-z]*|/dev/etherd/e*)
+	    echo "not deconfiguring network interfaces: network swap still mounted."
+	    exit 0
+	    ;;
+	esac
+    done
+    exec 0<&9 9<&-
+}
+
+case "$1" in
+start)
+	echo -n "Configuring network interfaces... "
+	sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
+	ifup -a
+	echo "done."
+	;;
+
+stop)
+	check_network_file_systems
+	check_network_swap
+
+	echo -n "Deconfiguring network interfaces... "
+	ifdown -a
+	echo "done."
+	;;
+
+force-reload|restart)
+	echo "Running $0 $1 is deprecated because it may not enable again some interfaces"
+	echo "Reconfiguring network interfaces... "
+	ifdown -a || true
+	ifup -a
+	echo "done."
+	;;
+
+*)
+	echo "Usage: /etc/init.d/networking {start|stop}"
+	exit 1
+	;;
+esac
+
+exit 0
+
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
new file mode 100644
index 0000000..0acf4cf
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces
@@ -0,0 +1,31 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+# Wireless interfaces
+iface wlan0 inet dhcp
+	wireless_mode managed
+	wireless_essid any
+	wpa-driver wext
+	wpa-conf /etc/wpa_supplicant.conf
+
+iface atml0 inet dhcp
+
+# Wired or wireless interfaces
+auto eth0
+iface eth0 inet dhcp
+iface eth1 inet dhcp
+
+# Ethernet/RNDIS gadget (g_ether)
+# ... or on host side, usbnet and random hwaddr
+iface usb0 inet static
+	address 192.168.7.2
+	netmask 255.255.255.0
+	network 192.168.7.0
+	gateway 192.168.7.1
+
+# Bluetooth networking
+iface bnep0 inet dhcp
+
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
new file mode 100644
index 0000000..750c0a9
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/nfsroot
@@ -0,0 +1,39 @@
+#! /bin/sh
+
+# In case the interface is used as nfsroot, avoid ifup, otherwise
+# nfsroot may lose response
+
+nfsroot=0
+
+if test "x$IFACE" = xlo ; then
+	exit 0
+fi
+
+exec 9<&0 < /proc/mounts
+while read dev mtpt fstype rest; do
+    if test $mtpt = "/" ; then
+        case $fstype in
+            nfs | nfs4)
+                nfsroot=1
+                nfs_addr=`echo $rest | sed -e 's/^.*addr=\([0-9.]*\).*$/\1/'`
+                break
+                ;;
+            *)
+                ;;
+        esac
+    fi
+done
+exec 0<&9 9<&-
+
+test $nfsroot -eq 0 && exit 0
+
+if [ -x /bin/ip -o -x /sbin/ip ] ; then
+    nfs_iface=`ip route get $nfs_addr | grep dev | sed -e 's/^.*dev \([-a-z0-9.]*\).*$/\1/'`
+fi
+
+if test "x$IFACE" = "x$nfs_iface" ; then
+    echo "ifup skipped for nfsroot interface $nfs_iface"
+    exit 1
+fi
+
+exit 0
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
new file mode 100644
index 0000000..1696776
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces
new file mode 100644
index 0000000..1696776
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarm64/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
new file mode 100644
index 0000000..1696776
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv6/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
new file mode 100644
index 0000000..1696776
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuarmv7/interfaces
@@ -0,0 +1,5 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
new file mode 100644
index 0000000..f62b9a8
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
new file mode 100644
index 0000000..f62b9a8
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemumips64/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
new file mode 100644
index 0000000..f62b9a8
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemuppc/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
new file mode 100644
index 0000000..f62b9a8
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemush4/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
new file mode 100644
index 0000000..f62b9a8
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86-64/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
new file mode 100644
index 0000000..f62b9a8
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/qemux86/interfaces
@@ -0,0 +1,8 @@
+# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
+ 
+# The loopback interface
+auto lo
+iface lo inet loopback
+
+
+
diff --git a/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb b/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
new file mode 100644
index 0000000..733ae41
--- /dev/null
+++ b/meta/recipes-core/init-ifupdown/init-ifupdown_1.0.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Basic TCP/IP networking init scripts and configuration files"
+DESCRIPTION = "This package provides high level tools to configure network interfaces"
+HOMEPAGE = "http://packages.debian.org/ifupdown"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
+PR = "r7"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "networking"
+INITSCRIPT_PARAMS = "start 01 2 3 4 5 . stop 80 0 6 1 ."
+
+SRC_URI = "file://copyright \
+           file://init \
+           file://interfaces \
+           file://nfsroot"
+
+S = "${WORKDIR}"
+
+do_install () {
+	install -d ${D}${sysconfdir}/init.d \
+			${D}${sysconfdir}/network/if-pre-up.d \
+			${D}${sysconfdir}/network/if-up.d \
+			${D}${sysconfdir}/network/if-down.d \
+			${D}${sysconfdir}/network/if-post-down.d
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/networking
+	install -m 0644 ${WORKDIR}/interfaces ${D}${sysconfdir}/network/interfaces
+	install -m 0755 ${WORKDIR}/nfsroot ${D}${sysconfdir}/network/if-pre-up.d
+}
+
+do_install_append_qemuall () {
+	# Disable network manager on machines that commonly do NFS booting
+	touch ${D}${sysconfdir}/network/nm-disabled-eth0
+}
+
+PACKAGE_ARCH_qemuall = "${MACHINE_ARCH}"
+RDEPENDS_${PN} = "netbase"
+RCONFLICTS_${PN} = "netbase (< 1:5.0)"
+
+CONFFILES_${PN} = "${sysconfdir}/network/interfaces"
diff --git a/meta/recipes-core/initrdscripts/files/init-boot.sh b/meta/recipes-core/initrdscripts/files/init-boot.sh
new file mode 100644
index 0000000..e82eba0
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-boot.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+mkdir /proc
+mkdir /sys
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+
+exec sh
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
new file mode 100644
index 0000000..7a0b4d4
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi-testfs.sh
@@ -0,0 +1,199 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2012, Intel Corporation.
+# All rights reserved.
+#
+# install.sh [device_name] [rootfs_name]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# We need 200 Mb for the boot partition
+boot_size=200
+
+# 50% for the second rootfs
+testfs_ratio=50
+
+found="no"
+
+echo "Searching for a hard drive..."
+for device in 'hda' 'hdb' 'sda' 'sdb' 'mmcblk0' 'mmcblk1'
+do
+    if [ -e /sys/block/${device}/removable ]; then
+        if [ "$(cat /sys/block/${device}/removable)" = "0" ]; then
+            found="yes"
+
+            while true; do
+                # Try sleeping here to avoid getting kernel messages
+                # obscuring/confusing user
+                sleep 5
+                echo "Found drive at /dev/${device}. Do you want to install this image there ? [y/n]"
+                read answer
+                if [ "$answer" = "y" ] ; then
+                    break
+                fi
+
+                if [ "$answer" = "n" ] ; then
+                    found=no
+                    break
+                fi
+
+                echo "Please answer y or n"
+            done
+        fi
+    fi
+
+    if [ "$found" = "yes" ]; then
+        break;
+    fi
+
+done
+
+if [ "$found" = "no" ]; then
+    exit 1
+fi
+
+echo "Installing image on /dev/${device}"
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount /dev/${device}* 2> /dev/null || /bin/true
+
+mkdir -p /tmp
+cat /proc/mounts > /etc/mtab
+
+disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
+
+testfs_size=$((disk_size*testfs_ratio/100))
+rootfs_size=$((disk_size-boot_size-testfs_size))
+
+rootfs_start=$((boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+testfs_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#mmcblk}" = "${device}" ]; then
+    part_prefix="p"
+    rootwait="rootwait"
+fi
+bootfs=/dev/${device}${part_prefix}1
+rootfs=/dev/${device}${part_prefix}2
+testfs=/dev/${device}${part_prefix}3
+
+echo "*****************"
+echo "Boot partition size:   $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Testfs partition size:   $testfs_size MB ($testfs)"
+echo "*****************"
+echo "Deleting partition table on /dev/${device} ..."
+dd if=/dev/zero of=/dev/${device} bs=512 count=2
+
+echo "Creating new partition table on /dev/${device} ..."
+parted /dev/${device} mklabel gpt
+
+echo "Creating boot partition on $bootfs"
+parted /dev/${device} mkpart primary 0% $boot_size
+parted /dev/${device} set 1 boot on
+
+echo "Creating rootfs partition on $rootfs"
+parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
+
+echo "Creating testfs partition on $testfs"
+parted /dev/${device} mkpart primary $testfs_start 100%
+
+parted /dev/${device} print
+
+echo "Formatting $bootfs to vfat..."
+mkfs.vfat -n "boot" $bootfs
+
+echo "Formatting $rootfs to ext3..."
+mkfs.ext3 -L "platform" $rootfs
+
+echo "Formatting $testfs to ext3..."
+mkfs.ext3 -L "testrootfs" $testfs
+
+mkdir /ssd
+mkdir /rootmnt
+mkdir /bootmnt
+
+mount $rootfs /ssd
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /rootmnt
+
+echo "Copying rootfs files..."
+cp -a /rootmnt/* /ssd
+
+touch /ssd/etc/masterimage
+
+if [ -d /ssd/etc/ ] ; then
+    # We dont want udev to mount our root device while we're booting...
+    if [ -d /ssd/etc/udev/ ] ; then
+        echo "/dev/${device}" >> /ssd/etc/udev/mount.blacklist
+    fi
+fi
+
+umount /ssd
+umount /rootmnt
+
+echo "Preparing boot partition..."
+mount $bootfs /ssd
+
+EFIDIR="/ssd/EFI/BOOT"
+mkdir -p $EFIDIR
+cp /run/media/$1/vmlinuz /ssd
+# Copy the efi loader
+cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
+
+if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
+    GRUBCFG="$EFIDIR/grub.cfg"
+    cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG
+    # Update grub config for the installed image
+    # Delete the install entry
+    sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
+    # Delete the initrd lines
+    sed -i "/initrd /d" $GRUBCFG
+    # Delete any LABEL= strings
+    sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
+    # Delete any root= strings
+    sed -i "s/ root=[^ ]*/ /" $GRUBCFG
+    # Add the root= and other standard boot options
+    sed -i "s@linux /vmlinuz *@linux /vmlinuz root=$rootfs rw $rootwait quiet @" $GRUBCFG
+fi
+
+if [ -d /run/media/$1/loader ]; then
+    GUMMIBOOT_CFGS="/ssd/loader/entries/*.conf"
+    # copy config files for gummiboot
+    cp -dr /run/media/$1/loader /ssd
+    # delete the install entry
+    rm -f /ssd/loader/entries/install.conf
+    # delete the initrd lines
+    sed -i "/initrd /d" $GUMMIBOOT_CFGS
+    # delete any LABEL= strings
+    sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS
+    # delete any root= strings
+    sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS
+    # add the root= and other standard boot options
+    sed -i "s@options *@options root=$rootfs rw $rootwait quiet @" $GUMMIBOOT_CFGS
+    # Add the test label
+    echo -ne "title test\nlinux /test-kernel\noptions root=$testfs rw $rootwait quiet\n" > /ssd/loader/entries/test.conf
+fi
+
+umount /ssd
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/meta/recipes-core/initrdscripts/files/init-install-efi.sh b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
new file mode 100644
index 0000000..a3ed74b
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-install-efi.sh
@@ -0,0 +1,250 @@
+#!/bin/sh -e
+#
+# Copyright (c) 2012, Intel Corporation.
+# All rights reserved.
+#
+# install.sh [device_name] [rootfs_name]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# We need 20 Mb for the boot partition
+boot_size=20
+
+# 5% for swap
+swap_ratio=5
+
+# Get a list of hard drives
+hdnamelist=""
+live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'`
+live_dev_name=${live_dev_name#\/dev/}
+# Only strip the digit identifier if the device is not an mmc
+case $live_dev_name in
+    mmcblk*)
+    ;;
+    *)
+        live_dev_name=${live_dev_name%%[0-9]*}
+    ;;
+esac
+
+echo "Searching for hard drives ..."
+
+for device in `ls /sys/block/`; do
+    case $device in
+        loop*)
+            # skip loop device
+            ;;
+        sr*)
+            # skip CDROM device
+            ;;
+        ram*)
+            # skip ram device
+            ;;
+        *)
+            # skip the device LiveOS is on
+            # Add valid hard drive name to the list
+            case $device in
+                $live_dev_name*)
+                # skip the device we are running from
+                ;;
+                *)
+                    hdnamelist="$hdnamelist $device"
+                ;;
+            esac
+            ;;
+    esac
+done
+
+if [ -z "${hdnamelist}" ]; then
+    echo "You need another device (besides the live device /dev/${live_dev_name}) to install the image. Installation aborted."
+    exit 1
+fi
+
+TARGET_DEVICE_NAME=""
+for hdname in $hdnamelist; do
+    # Display found hard drives and their basic info
+    echo "-------------------------------"
+    echo /dev/$hdname
+    if [ -r /sys/block/$hdname/device/vendor ]; then
+        echo -n "VENDOR="
+        cat /sys/block/$hdname/device/vendor
+    fi
+    if [ -r /sys/block/$hdname/device/model ]; then
+        echo -n "MODEL="
+        cat /sys/block/$hdname/device/model
+    fi
+    if [ -r /sys/block/$hdname/device/uevent ]; then
+        echo -n "UEVENT="
+        cat /sys/block/$hdname/device/uevent
+    fi
+    echo
+    # Get user choice
+    while true; do
+        echo -n "Do you want to install this image there? [y/n] "
+        read answer
+        if [ "$answer" = "y" -o "$answer" = "n" ]; then
+            break
+        fi
+        echo "Please answer y or n"
+    done
+    if [ "$answer" = "y" ]; then
+        TARGET_DEVICE_NAME=$hdname
+        break
+    fi
+done
+
+if [ -n "$TARGET_DEVICE_NAME" ]; then
+    echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+else
+    echo "No hard drive selected. Installation aborted."
+    exit 1
+fi
+
+device=/dev/$TARGET_DEVICE_NAME
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount ${device}* 2> /dev/null || /bin/true
+
+mkdir -p /tmp
+cat /proc/mounts > /etc/mtab
+
+disk_size=$(parted ${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
+
+swap_size=$((disk_size*swap_ratio/100))
+rootfs_size=$((disk_size-boot_size-swap_size))
+
+rootfs_start=$((boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+swap_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#mmcblk}" = "${device}" ]; then
+    part_prefix="p"
+    rootwait="rootwait"
+fi
+bootfs=${device}${part_prefix}1
+rootfs=${device}${part_prefix}2
+swap=${device}${part_prefix}3
+
+echo "*****************"
+echo "Boot partition size:   $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Swap partition size:   $swap_size MB ($swap)"
+echo "*****************"
+echo "Deleting partition table on ${device} ..."
+dd if=/dev/zero of=${device} bs=512 count=35
+
+echo "Creating new partition table on ${device} ..."
+parted ${device} mklabel gpt
+
+echo "Creating boot partition on $bootfs"
+parted ${device} mkpart boot fat32 0% $boot_size
+parted ${device} set 1 boot on
+
+echo "Creating rootfs partition on $rootfs"
+parted ${device} mkpart root ext3 $rootfs_start $rootfs_end
+
+echo "Creating swap partition on $swap"
+parted ${device} mkpart swap linux-swap $swap_start 100%
+
+parted ${device} print
+
+echo "Formatting $bootfs to vfat..."
+mkfs.vfat $bootfs
+
+echo "Formatting $rootfs to ext3..."
+mkfs.ext3 $rootfs
+
+echo "Formatting swap partition...($swap)"
+mkswap $swap
+
+mkdir /tgt_root
+mkdir /src_root
+mkdir -p /boot
+
+# Handling of the target root partition
+mount $rootfs /tgt_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
+echo "Copying rootfs files..."
+cp -a /src_root/* /tgt_root
+if [ -d /tgt_root/etc/ ] ; then
+    boot_uuid=$(blkid -o value -s UUID ${device}1)
+    swap_part_uuid=$(blkid -o value -s PARTUUID ${device}3)
+    echo "/dev/disk/by-partuuid/$swap_part_uuid                swap             swap       defaults              0  0" >> /tgt_root/etc/fstab
+    echo "UUID=$boot_uuid              /boot            vfat       defaults              1  2" >> /tgt_root/etc/fstab
+    # We dont want udev to mount our root device while we're booting...
+    if [ -d /tgt_root/etc/udev/ ] ; then
+        echo "${device}" >> /tgt_root/etc/udev/mount.blacklist
+    fi
+fi
+
+umount /src_root
+
+# Handling of the target boot partition
+mount $bootfs /boot
+echo "Preparing boot partition..."
+
+EFIDIR="/boot/EFI/BOOT"
+mkdir -p $EFIDIR
+# Copy the efi loader
+cp /run/media/$1/EFI/BOOT/*.efi $EFIDIR
+
+if [ -f /run/media/$1/EFI/BOOT/grub.cfg ]; then
+    root_part_uuid=$(blkid -o value -s PARTUUID ${device}2)
+    GRUBCFG="$EFIDIR/grub.cfg"
+    cp /run/media/$1/EFI/BOOT/grub.cfg $GRUBCFG
+    # Update grub config for the installed image
+    # Delete the install entry
+    sed -i "/menuentry 'install'/,/^}/d" $GRUBCFG
+    # Delete the initrd lines
+    sed -i "/initrd /d" $GRUBCFG
+    # Delete any LABEL= strings
+    sed -i "s/ LABEL=[^ ]*/ /" $GRUBCFG
+    # Delete any root= strings
+    sed -i "s/ root=[^ ]*/ /" $GRUBCFG
+    # Add the root= and other standard boot options
+    sed -i "s@linux /vmlinuz *@linux /vmlinuz root=PARTUUID=$root_part_uuid rw $rootwait quiet @" $GRUBCFG
+fi
+
+if [ -d /run/media/$1/loader ]; then
+    GUMMIBOOT_CFGS="/boot/loader/entries/*.conf"
+    # copy config files for gummiboot
+    cp -dr /run/media/$1/loader /boot
+    # delete the install entry
+    rm -f /boot/loader/entries/install.conf
+    # delete the initrd lines
+    sed -i "/initrd /d" $GUMMIBOOT_CFGS
+    # delete any LABEL= strings
+    sed -i "s/ LABEL=[^ ]*/ /" $GUMMIBOOT_CFGS
+    # delete any root= strings
+    sed -i "s/ root=[^ ]*/ /" $GUMMIBOOT_CFGS
+    # add the root= and other standard boot options
+    sed -i "s@options *@options root=PARTUUID=$rootuuid rw $rootwait quiet @" $GUMMIBOOT_CFGS
+fi
+
+umount /tgt_root
+
+cp /run/media/$1/vmlinuz /boot
+
+umount /boot
+
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/meta/recipes-core/initrdscripts/files/init-install-testfs.sh b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
new file mode 100644
index 0000000..ac62160
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-install-testfs.sh
@@ -0,0 +1,220 @@
+#!/bin/sh -e
+#
+# Copyright (C) 2008-2011 Intel
+#
+# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# We need 20 Mb for the boot partition
+boot_size=200
+
+# 50% for the the test partition
+testfs_ratio=50
+
+# Get a list of hard drives
+hdnamelist=""
+live_dev_name=${1%%/*}
+
+echo "Searching for hard drives ..."
+
+for device in `ls /sys/block/`; do
+    case $device in
+	loop*)
+            # skip loop device
+	    ;;
+	ram*)
+            # skip ram device
+	    ;;
+	*)
+	    # skip the device LiveOS is on
+	    # Add valid hard drive name to the list
+	    if [ $device != $live_dev_name -a -e /dev/$device ]; then
+		hdnamelist="$hdnamelist $device"
+	    fi
+	    ;;
+    esac
+done
+
+TARGET_DEVICE_NAME=""
+for hdname in $hdnamelist; do
+    # Display found hard drives and their basic info
+    echo "-------------------------------"
+    echo /dev/$hdname
+    if [ -r /sys/block/$hdname/device/vendor ]; then
+	echo -n "VENDOR="
+	cat /sys/block/$hdname/device/vendor
+    fi
+    echo -n "MODEL="
+    cat /sys/block/$hdname/device/model
+    cat /sys/block/$hdname/device/uevent
+    echo
+    # Get user choice
+    while true; do
+	echo -n "Do you want to install this image there? [y/n] "
+	read answer
+	if [ "$answer" = "y" -o "$answer" = "n" ]; then
+	    break
+	fi
+	echo "Please answer y or n"
+    done
+    if [ "$answer" = "y" ]; then
+	TARGET_DEVICE_NAME=$hdname
+	break
+    fi
+done
+
+if [ -n "$TARGET_DEVICE_NAME" ]; then
+    echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+else
+    echo "No hard drive selected. Installation aborted."
+    exit 1
+fi
+
+device=$TARGET_DEVICE_NAME
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount /dev/${device}* 2> /dev/null || /bin/true
+
+if [ ! -b /dev/loop0 ] ; then
+    mknod /dev/loop0 b 7 0
+fi
+
+mkdir -p /tmp
+if [ ! -L /etc/mtab ]; then
+	cat /proc/mounts > /etc/mtab
+fi
+
+disk_size=$(parted /dev/${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
+
+testfs_size=$((disk_size*testfs_ratio/100))
+rootfs_size=$((disk_size-boot_size-testfs_size))
+
+rootfs_start=$((boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+testfs_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#mmcblk}" = "${device}" ]; then
+	part_prefix="p"
+	rootwait="rootwait"
+fi
+bootfs=/dev/${device}${part_prefix}1
+rootfs=/dev/${device}${part_prefix}2
+testfs=/dev/${device}${part_prefix}3
+
+echo "*****************"
+echo "Boot partition size:   $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Testfs partition size: $testfs_size MB ($testfs)"
+echo "*****************"
+echo "Deleting partition table on /dev/${device} ..."
+dd if=/dev/zero of=/dev/${device} bs=512 count=2
+
+echo "Creating new partition table on /dev/${device} ..."
+parted /dev/${device} mklabel msdos
+
+echo "Creating boot partition on $bootfs"
+parted /dev/${device} mkpart primary 0% $boot_size
+
+echo "Creating rootfs partition on $rootfs"
+parted /dev/${device} mkpart primary $rootfs_start $rootfs_end
+
+echo "Creating testfs partition on $testfs"
+parted /dev/${device} mkpart primary $testfs_start 100%
+
+parted /dev/${device} print
+
+echo "Formatting $bootfs to ext3..."
+mkfs.ext3 -L "boot" $bootfs
+
+echo "Formatting $rootfs to ext3..."
+mkfs.ext3 -L "rootfs" $rootfs
+
+echo "Formatting $testfs to ext3..."
+mkfs.ext3 -L "testrootfs" $testfs
+
+mkdir /tgt_root
+mkdir /src_root
+mkdir -p /boot
+
+# Handling of the target root partition
+mount $rootfs /tgt_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
+
+echo "Copying rootfs files..."
+cp -a /src_root/* /tgt_root
+
+touch /tgt_root/etc/masterimage
+
+if [ -d /tgt_root/etc/ ] ; then
+    echo "$bootfs              /boot            ext3       defaults              1  2" >> /tgt_root/etc/fstab
+    # We dont want udev to mount our root device while we're booting...
+    if [ -d /tgt_root/etc/udev/ ] ; then
+	echo "/dev/${device}" >> /tgt_root/etc/udev/mount.blacklist
+    fi
+fi
+umount /tgt_root
+umount /src_root
+
+# Handling of the target boot partition
+mount $bootfs /boot
+echo "Preparing boot partition..."
+if [ -f /etc/grub.d/00_header ] ; then
+    echo "Preparing custom grub2 menu..."
+    GRUBCFG="/boot/grub/grub.cfg"
+    mkdir -p $(dirname $GRUBCFG)
+    cat >$GRUBCFG <<_EOF 
+serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1
+terminal_input --append  serial
+terminal_output --append serial
+set timeout_style=hidden
+set timeout=5
+menuentry "Linux" {
+    set root=(hd0,1)
+    linux /vmlinuz root=$rootfs $rootwait rw $5 $3 $4 quiet
+}
+_EOF
+    # Add the test label
+    echo -ne "\nmenuentry 'test' --hotkey x {\nlinux /test-kernel root=$testfs rw $rootwait quiet\n}\n" >> $GRUBCFG
+
+    chmod 0444 $GRUBCFG
+fi
+grub-install /dev/${device}
+echo "(hd0) /dev/${device}" > /boot/grub/device.map
+
+# If grub.cfg doesn't exist, assume GRUB 0.97 and create a menu.lst
+if [ ! -f /boot/grub/grub.cfg ] ; then
+    echo "Preparing custom grub menu..."
+    echo "default 0" > /boot/grub/menu.lst
+    echo "timeout 30" >> /boot/grub/menu.lst
+    echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst
+    echo "root  (hd0,0)" >> /boot/grub/menu.lst
+    echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
+fi
+
+cp /run/media/$1/vmlinuz /boot/
+
+umount /boot
+
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/meta/recipes-core/initrdscripts/files/init-install.sh b/meta/recipes-core/initrdscripts/files/init-install.sh
new file mode 100644
index 0000000..f9e9768
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-install.sh
@@ -0,0 +1,272 @@
+#!/bin/sh -e
+#
+# Copyright (C) 2008-2011 Intel
+#
+# install.sh [device_name] [rootfs_name] [video_mode] [vga_mode]
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# We need 20 Mb for the boot partition
+boot_size=20
+
+# 5% for the swap
+swap_ratio=5
+
+# Get a list of hard drives
+hdnamelist=""
+live_dev_name=`cat /proc/mounts | grep ${1%/} | awk '{print $1}'`
+live_dev_name=${live_dev_name#\/dev/}
+# Only strip the digit identifier if the device is not an mmc
+case $live_dev_name in
+    mmcblk*)
+    ;;
+    *)
+        live_dev_name=${live_dev_name%%[0-9]*}
+    ;;
+esac
+
+echo "Searching for hard drives ..."
+
+for device in `ls /sys/block/`; do
+    case $device in
+        loop*)
+            # skip loop device
+            ;;
+        sr*)
+            # skip CDROM device
+            ;;
+        ram*)
+            # skip ram device
+            ;;
+        *)
+            # skip the device LiveOS is on
+            # Add valid hard drive name to the list
+            case $device in
+                $live_dev_name*)
+                # skip the device we are running from
+                ;;
+                *)
+                    hdnamelist="$hdnamelist $device"
+                ;;
+            esac
+            ;;
+    esac
+done
+
+TARGET_DEVICE_NAME=""
+for hdname in $hdnamelist; do
+    # Display found hard drives and their basic info
+    echo "-------------------------------"
+    echo /dev/$hdname
+    if [ -r /sys/block/$hdname/device/vendor ]; then
+        echo -n "VENDOR="
+        cat /sys/block/$hdname/device/vendor
+    fi
+    if [ -r /sys/block/$hdname/device/model ]; then
+        echo -n "MODEL="
+        cat /sys/block/$hdname/device/model
+    fi
+    if [ -r /sys/block/$hdname/device/uevent ]; then
+        echo -n "UEVENT="
+        cat /sys/block/$hdname/device/uevent
+    fi
+    echo
+    # Get user choice
+    while true; do
+        echo -n "Do you want to install this image there? [y/n] "
+        read answer
+        if [ "$answer" = "y" -o "$answer" = "n" ]; then
+            break
+        fi
+        echo "Please answer y or n"
+    done
+    if [ "$answer" = "y" ]; then
+        TARGET_DEVICE_NAME=$hdname
+        break
+    fi
+done
+
+if [ -n "$TARGET_DEVICE_NAME" ]; then
+    echo "Installing image on /dev/$TARGET_DEVICE_NAME ..."
+else
+    echo "No hard drive selected. Installation aborted."
+    exit 1
+fi
+
+device=/dev/$TARGET_DEVICE_NAME
+
+#
+# The udev automounter can cause pain here, kill it
+#
+rm -f /etc/udev/rules.d/automount.rules
+rm -f /etc/udev/scripts/mount*
+
+#
+# Unmount anything the automounter had mounted
+#
+umount ${device}* 2> /dev/null || /bin/true
+
+if [ ! -b /dev/loop0 ] ; then
+    mknod /dev/loop0 b 7 0
+fi
+
+mkdir -p /tmp
+if [ ! -L /etc/mtab ]; then
+    cat /proc/mounts > /etc/mtab
+fi
+
+disk_size=$(parted ${device} unit mb print | grep Disk | cut -d" " -f 3 | sed -e "s/MB//")
+
+grub_version=$(grub-install -v|sed 's/.* \([0-9]\).*/\1/')
+
+if [ $grub_version -eq 0 ] ; then
+    bios_boot_size=0
+else
+    # For GRUB 2 we need separate parition to store stage2 grub image
+    # 2Mb value is chosen to align partition for best performance.
+    bios_boot_size=2
+fi
+
+swap_size=$((disk_size*swap_ratio/100))
+rootfs_size=$((disk_size-bios_boot_size-boot_size-swap_size))
+
+boot_start=$((bios_boot_size))
+rootfs_start=$((bios_boot_size+boot_size))
+rootfs_end=$((rootfs_start+rootfs_size))
+swap_start=$((rootfs_end))
+
+# MMC devices are special in a couple of ways
+# 1) they use a partition prefix character 'p'
+# 2) they are detected asynchronously (need rootwait)
+rootwait=""
+part_prefix=""
+if [ ! "${device#mmcblk}" = "${device}" ]; then
+    part_prefix="p"
+    rootwait="rootwait"
+fi
+
+if [ $grub_version -eq 0 ] ; then
+    bios_boot=''
+    bootfs=${device}${part_prefix}1
+    rootfs=${device}${part_prefix}2
+    swap=${device}${part_prefix}3
+else
+    bios_boot=${device}${part_prefix}1
+    bootfs=${device}${part_prefix}2
+    rootfs=${device}${part_prefix}3
+    swap=${device}${part_prefix}4
+fi
+
+echo "*****************"
+[ $grub_version -ne 0 ] && echo "BIOS boot partition size: $bios_boot_size MB ($bios_boot)"
+echo "Boot partition size:   $boot_size MB ($bootfs)"
+echo "Rootfs partition size: $rootfs_size MB ($rootfs)"
+echo "Swap partition size:   $swap_size MB ($swap)"
+echo "*****************"
+echo "Deleting partition table on ${device} ..."
+dd if=/dev/zero of=${device} bs=512 count=35
+
+echo "Creating new partition table on ${device} ..."
+if [ $grub_version -eq 0 ] ; then
+    parted ${device} mktable msdos
+    echo "Creating boot partition on $bootfs"
+    parted ${device} mkpart primary ext3 0% $boot_size
+else
+    parted ${device} mktable gpt
+    echo "Creating BIOS boot partition on $bios_boot"
+    parted ${device} mkpart bios_boot 0% $bios_boot_size
+    parted ${device} set 1 bios_grub on
+    echo "Creating boot partition on $bootfs"
+    parted ${device} mkpart boot ext3 $boot_start $boot_size
+fi
+
+echo "Creating rootfs partition on $rootfs"
+[ $grub_version -eq 0 ] && pname='primary' || pname='root'
+parted ${device} mkpart $pname ext3 $rootfs_start $rootfs_end
+
+echo "Creating swap partition on $swap"
+[ $grub_version -eq 0 ] && pname='primary' || pname='swap'
+parted ${device} mkpart $pname linux-swap $swap_start 100%
+
+parted ${device} print
+
+echo "Formatting $bootfs to ext3..."
+mkfs.ext3 $bootfs
+
+echo "Formatting $rootfs to ext3..."
+mkfs.ext3 $rootfs
+
+echo "Formatting swap partition...($swap)"
+mkswap $swap
+
+mkdir /tgt_root
+mkdir /src_root
+mkdir -p /boot
+
+# Handling of the target root partition
+mount $rootfs /tgt_root
+mount -o rw,loop,noatime,nodiratime /run/media/$1/$2 /src_root
+echo "Copying rootfs files..."
+cp -a /src_root/* /tgt_root
+if [ -d /tgt_root/etc/ ] ; then
+    if [ $grub_version -ne 0 ] ; then
+        boot_uuid=$(blkid -o value -s UUID ${device}2)
+        swap_part_uuid=$(blkid -o value -s PARTUUID ${device}4)
+        bootdev="UUID=$boot_uuid"
+        swapdev=/dev/disk/by-partuuid/$swap_part_uuid
+    else
+        bootdev=${device}2
+        swapdev=${device}4
+    fi
+    echo "$swapdev                swap             swap       defaults              0  0" >> /tgt_root/etc/fstab
+    echo "$bootdev              /boot            ext3       defaults              1  2" >> /tgt_root/etc/fstab
+    # We dont want udev to mount our root device while we're booting...
+    if [ -d /tgt_root/etc/udev/ ] ; then
+        echo "${device}" >> /tgt_root/etc/udev/mount.blacklist
+    fi
+fi
+umount /tgt_root
+umount /src_root
+
+# Handling of the target boot partition
+mount $bootfs /boot
+echo "Preparing boot partition..."
+if [ -f /etc/grub.d/00_header -a $grub_version -ne 0 ] ; then
+    echo "Preparing custom grub2 menu..."
+    root_part_uuid=$(blkid -o value -s PARTUUID ${device}3)
+    boot_uuid=$(blkid -o value -s UUID ${device}2)
+    GRUBCFG="/boot/grub/grub.cfg"
+    mkdir -p $(dirname $GRUBCFG)
+    cat >$GRUBCFG <<_EOF
+menuentry "Linux" {
+    search --no-floppy --fs-uuid $boot_uuid --set root
+    linux /vmlinuz root=PARTUUID=$root_part_uuid $rootwait rw $5 $3 $4 quiet
+}
+_EOF
+    chmod 0444 $GRUBCFG
+fi
+grub-install ${device}
+
+if [ $grub_version -eq 0 ] ; then
+    echo "(hd0) ${device}" > /boot/grub/device.map
+    echo "Preparing custom grub menu..."
+    echo "default 0" > /boot/grub/menu.lst
+    echo "timeout 30" >> /boot/grub/menu.lst
+    echo "title Live Boot/Install-Image" >> /boot/grub/menu.lst
+    echo "root  (hd0,0)" >> /boot/grub/menu.lst
+    echo "kernel /vmlinuz root=$rootfs rw $3 $4 quiet" >> /boot/grub/menu.lst
+fi
+
+cp /run/media/$1/vmlinuz /boot/
+
+umount /boot
+
+sync
+
+echo "Remove your installation media, and press ENTER"
+
+read enter
+
+echo "Rebooting..."
+reboot -f
diff --git a/meta/recipes-core/initrdscripts/files/init-live.sh b/meta/recipes-core/initrdscripts/files/init-live.sh
new file mode 100644
index 0000000..d852c57
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/files/init-live.sh
@@ -0,0 +1,235 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+ROOT_MOUNT="/rootfs/"
+ROOT_IMAGE="rootfs.img"
+MOUNT="/bin/mount"
+UMOUNT="/bin/umount"
+ISOLINUX=""
+
+ROOT_DISK=""
+
+# Copied from initramfs-framework. The core of this script probably should be
+# turned into initramfs-framework modules to reduce duplication.
+udev_daemon() {
+	OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
+
+	for o in $OPTIONS; do
+		if [ -x "$o" ]; then
+			echo $o
+			return 0
+		fi
+	done
+
+	return 1
+}
+
+_UDEV_DAEMON=`udev_daemon`
+
+early_setup() {
+    mkdir -p /proc
+    mkdir -p /sys
+    mount -t proc proc /proc
+    mount -t sysfs sysfs /sys
+    mount -t devtmpfs none /dev
+
+    # support modular kernel
+    modprobe isofs 2> /dev/null
+
+    mkdir -p /run
+    mkdir -p /var/run
+
+    $_UDEV_DAEMON --daemon
+    udevadm trigger --action=add
+}
+
+read_args() {
+    [ -z "$CMDLINE" ] && CMDLINE=`cat /proc/cmdline`
+    for arg in $CMDLINE; do
+        optarg=`expr "x$arg" : 'x[^=]*=\(.*\)'`
+        case $arg in
+            root=*)
+                ROOT_DEVICE=$optarg ;;
+            rootimage=*)
+                ROOT_IMAGE=$optarg ;;
+            rootfstype=*)
+                modprobe $optarg 2> /dev/null ;;
+            LABEL=*)
+                label=$optarg ;;
+            video=*)
+                video_mode=$arg ;;
+            vga=*)
+                vga_mode=$arg ;;
+            console=*)
+                if [ -z "${console_params}" ]; then
+                    console_params=$arg
+                else
+                    console_params="$console_params $arg"
+                fi ;;
+            debugshell*)
+                if [ -z "$optarg" ]; then
+                        shelltimeout=30
+                else
+                        shelltimeout=$optarg
+                fi 
+        esac
+    done
+}
+
+boot_live_root() {
+    # Watches the udev event queue, and exits if all current events are handled
+    udevadm settle --timeout=3 --quiet
+    killall "${_UDEV_DAEMON##*/}" 2>/dev/null
+
+    # Allow for identification of the real root even after boot
+    mkdir -p  ${ROOT_MOUNT}/media/realroot
+    mount -n --move "/run/media/${ROOT_DISK}" ${ROOT_MOUNT}/media/realroot
+
+    # Move the mount points of some filesystems over to
+    # the corresponding directories under the real root filesystem.
+    for dir in `awk '/\/dev.* \/run\/media/{print $2}' /proc/mounts`; do
+        mkdir -p  ${ROOT_MOUNT}/media/${dir##*/}
+        mount -n --move $dir ${ROOT_MOUNT}/media/${dir##*/}
+    done
+    mount -n --move /proc ${ROOT_MOUNT}/proc
+    mount -n --move /sys ${ROOT_MOUNT}/sys
+    mount -n --move /dev ${ROOT_MOUNT}/dev
+
+    cd $ROOT_MOUNT
+
+    # busybox switch_root supports -c option
+    exec switch_root -c /dev/console $ROOT_MOUNT /sbin/init $CMDLINE ||
+        fatal "Couldn't switch_root, dropping to shell"
+}
+
+fatal() {
+    echo $1 >$CONSOLE
+    echo >$CONSOLE
+    exec sh
+}
+
+early_setup
+
+[ -z "$CONSOLE" ] && CONSOLE="/dev/console"
+
+read_args
+
+echo "Waiting for removable media..."
+C=0
+while true
+do
+  for i in `ls /run/media 2>/dev/null`; do
+      if [ -f /run/media/$i/$ROOT_IMAGE ] ; then
+		found="yes"
+		ROOT_DISK="$i"
+		break
+	  elif [ -f /run/media/$i/isolinux/$ROOT_IMAGE ]; then
+		found="yes"
+		ISOLINUX="isolinux"
+		ROOT_DISK="$i"
+		break	
+      fi
+  done
+  if [ "$found" = "yes" ]; then
+      break;
+  fi
+  # don't wait for more than $shelltimeout seconds, if it's set
+  if [ -n "$shelltimeout" ]; then
+      echo -n " " $(( $shelltimeout - $C ))
+      if [ $C -ge $shelltimeout ]; then
+           echo "..."
+	   echo "Mounted filesystems"
+           mount | grep media
+           echo "Available block devices"
+           cat /proc/partitions
+           fatal "Cannot find $ROOT_IMAGE file in /run/media/* , dropping to a shell "
+      fi
+      C=$(( C + 1 ))
+  fi
+  sleep 1
+done
+
+# Try to mount the root image read-write and then boot it up.
+# This function distinguishes between a read-only image and a read-write image.
+# In the former case (typically an iso), it tries to make a union mount if possible.
+# In the latter case, the root image could be mounted and then directly booted up.
+mount_and_boot() {
+    mkdir $ROOT_MOUNT
+    mknod /dev/loop0 b 7 0 2>/dev/null
+
+    if ! mount -o rw,loop,noatime,nodiratime /run/media/$ROOT_DISK/$ISOLINUX/$ROOT_IMAGE $ROOT_MOUNT ; then
+	fatal "Could not mount rootfs image"
+    fi
+
+    if touch $ROOT_MOUNT/bin 2>/dev/null; then
+	# The root image is read-write, directly boot it up.
+	boot_live_root
+    fi
+
+    # determine which unification filesystem to use
+    union_fs_type=""
+    if grep -q -w "overlayfs" /proc/filesystems; then
+	union_fs_type="overlayfs"
+    elif grep -q -w "aufs" /proc/filesystems; then
+	union_fs_type="aufs"
+    else
+	union_fs_type=""
+    fi
+
+    # make a union mount if possible
+    case $union_fs_type in
+	"overlayfs")
+	    mkdir -p /rootfs.ro /rootfs.rw
+	    if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
+		rm -rf /rootfs.ro /rootfs.rw
+		fatal "Could not move rootfs mount point"
+	    else
+		mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
+		mount -t overlayfs -o "lowerdir=/rootfs.ro,upperdir=/rootfs.rw" overlayfs $ROOT_MOUNT
+		mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
+		mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
+		mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
+	    fi
+	    ;;
+	"aufs")
+	    mkdir -p /rootfs.ro /rootfs.rw
+	    if ! mount -n --move $ROOT_MOUNT /rootfs.ro; then
+		rm -rf /rootfs.ro /rootfs.rw
+		fatal "Could not move rootfs mount point"
+	    else
+		mount -t tmpfs -o rw,noatime,mode=755 tmpfs /rootfs.rw
+		mount -t aufs -o "dirs=/rootfs.rw=rw:/rootfs.ro=ro" aufs $ROOT_MOUNT
+		mkdir -p $ROOT_MOUNT/rootfs.ro $ROOT_MOUNT/rootfs.rw
+		mount --move /rootfs.ro $ROOT_MOUNT/rootfs.ro
+		mount --move /rootfs.rw $ROOT_MOUNT/rootfs.rw
+	    fi
+	    ;;
+	"")
+	    mount -t tmpfs -o rw,noatime,mode=755 tmpfs $ROOT_MOUNT/media
+	    ;;
+    esac
+
+    # boot the image
+    boot_live_root
+}
+
+case $label in
+    boot)
+	mount_and_boot
+	;;
+    install|install-efi)
+	if [ -f /run/media/$i/$ISOLINUX/$ROOT_IMAGE ] ; then
+	    ./$label.sh $i/$ISOLINUX $ROOT_IMAGE $video_mode $vga_mode $console_params
+	else
+	    fatal "Could not find $label script"
+	fi
+
+	# If we're getting here, we failed...
+	fatal "Installation image failed"
+	;;
+    *)
+	# Not sure what boot label is provided.  Try to boot to avoid locking up.
+	mount_and_boot
+	;;
+esac
diff --git a/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb
new file mode 100644
index 0000000..7ae7969
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-boot_1.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Extremely basic live image init script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-boot.sh"
+
+PR = "r2"
+
+S = "${WORKDIR}"
+
+do_install() {
+        install -m 0755 ${WORKDIR}/init-boot.sh ${D}/init
+}
+
+inherit allarch
+
+FILES_${PN} += " /init "
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/debug b/meta/recipes-core/initrdscripts/initramfs-framework/debug
new file mode 100644
index 0000000..00bfd7d
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/debug
@@ -0,0 +1,82 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+# Adds support to dynamic debugging of initramfs using bootparam in
+# following format:
+#   shell                 : starts a shell before and after each module
+#   shell=before:<module> : starts a shell before <module> is loaded and run
+#   shell=after:<module>  : starts a shell after <module> is loaded and run
+#
+#   shell-debug                 : run set -x as soon as possible
+#   shell-debug=before:<module> : run set -x before <module> is loaded and run
+#   shell-debug=after:<module>  : run set -x after <module> is loaded and run
+
+DEBUG_SHELL="false"
+
+debug_hook_handler() {
+	status=$1
+	module=$2
+
+	if [ -n "$bootparam_shell" ] && [ "$bootparam_shell" != "true" ]; then
+		shell_wanted_status=`expr $bootparam_shell : '\(.*\):.*'`
+		shell_wanted_module=`expr $bootparam_shell : '.*:\(.*\)'`
+
+		if [ "$shell_wanted_status" = "before" ]; then
+			shell_wanted_status=pre
+		else
+			shell_wanted_status=post
+		fi
+	fi
+
+	if [ "$bootparam_shell" = "true" ] ||
+		( [ "$status" = "$shell_wanted_status" ] &&
+			[ "$module" = "$shell_wanted_module" ] ); then
+		if [ "$status" = "pre" ]; then
+			status_msg="before"
+		else
+			status_msg="after"
+		fi
+
+		msg "Starting shell $status_msg $module..."
+		sh
+	fi
+
+	if [ -n "$bootparam_shell_debug" ] && [ "$bootparam_shell_debug" != "true" ]; then
+		shell_debug_wanted_status=`expr $bootparam_shell_debug : '\(.*\):.*'`
+		shell_debug_wanted_module=`expr $bootparam_shell_debug : '.*:\(.*\)'`
+
+		if [ "$shell_debug_wanted_status" = "before" ]; then
+			shell_debug_wanted_status=pre
+		else
+			shell_debug_wanted_status=post
+		fi
+	fi
+
+	if [ "$bootparam_shell_debug" = "true" ] ||
+		( [ "$status" = "$shell_debug_wanted_status" ] &&
+			[ "$module" = "$shell_debug_wanted_module" ] ); then
+		if [ "$DEBUG_SHELL" = "true" ]; then
+			return 0
+		fi
+
+		if [ "$status" = "pre" ]; then
+			status_msg="before"
+		else
+			status_msg="after"
+		fi
+
+		msg "Starting shell debugging $status_msg $module..."
+		DEBUG_SHELL="true"
+		set -x
+	fi
+}
+
+debug_enabled() {
+	return 0
+}
+
+debug_run() {
+	add_module_pre_hook "debug_hook_handler"
+	add_module_post_hook "debug_hook_handler"
+}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/e2fs b/meta/recipes-core/initrdscripts/initramfs-framework/e2fs
new file mode 100755
index 0000000..29f801a
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/e2fs
@@ -0,0 +1,28 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+e2fs_enabled() {
+	return 0
+}
+
+e2fs_run() {
+	filesystems="ext4 ext3 ext2"
+
+	# load modules
+	for fs in $filesystems; do
+		load_kernel_module $fs
+	done
+
+	for fs in $filesystems; do
+		eval "fs_options=\$bootparam_${fs}"
+		if [ -n "$fs_options" ]; then
+		    dev=`expr "$fs_options" : '\([^:]*\).*'`
+		    path=`expr "$fs_options" : '[^:]*:\([^:]*\).*'`
+
+		    info "Mounting $dev as $fs on $path as $fs..."
+			mkdir -p $path
+		    mount -t $fs $dev $path
+		fi
+	done
+}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/finish b/meta/recipes-core/initrdscripts/initramfs-framework/finish
new file mode 100755
index 0000000..e712ff0
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/finish
@@ -0,0 +1,60 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+finish_enabled() {
+	return 0
+}
+
+finish_run() {
+	if [ -n "$ROOTFS_DIR" ]; then
+		if [ -n "$bootparam_rootdelay" ]; then
+			debug "Sleeping for $rootdelay second(s) to wait root to settle..."
+			sleep $bootparam_rootdelay
+		fi
+
+		if [ -n "$bootparam_root" ]; then
+			debug "No e2fs compatible filesystem has been mounted, mounting $bootparam_root..."
+
+			if [ "`echo ${bootparam_root} | cut -c1-5`" = "UUID=" ]; then
+				root_uuid=`echo $bootparam_root | cut -c6-`
+				bootparam_root="/dev/disk/by-uuid/$root_uuid"
+			fi
+
+			if [ -e "$bootparam_root" ]; then
+				flags=""
+				if [ -n "$bootparam_ro" ]; then
+					if [  -n "$bootparam_rootflags" ]; then
+						bootparam_rootflags="$bootparam_rootflags,"
+					fi
+					bootparam_rootflags="${bootparam_rootflags}ro"
+				fi
+				if [ -n "$bootparam_rootflags" ]; then
+					flags="$flags -o$bootparam_rootflags"
+				fi
+				if [ -n "$bootparam_rootfstype" ]; then
+					flags="$flags -t$bootparam_rootfstype"
+				fi
+				mount $flags $bootparam_root $ROOTFS_DIR
+			else
+				debug "root '$bootparam_root' doesn't exist."
+			fi
+		fi
+
+		if [ ! -d $ROOTFS_DIR/dev ]; then
+			fatal "ERROR: There's no '/dev' on rootfs."
+		fi
+
+		info "Switching root to '$ROOTFS_DIR'..."
+
+		debug "Moving /dev, /proc and /sys onto rootfs..."
+		mount --move /dev $ROOTFS_DIR/dev
+		mount --move /proc $ROOTFS_DIR/proc
+		mount --move /sys $ROOTFS_DIR/sys
+
+		cd $ROOTFS_DIR
+		exec switch_root -c /dev/console $ROOTFS_DIR ${bootparam_init:-/sbin/init}
+	else
+		debug "No rootfs has been set"
+	fi
+}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/init b/meta/recipes-core/initrdscripts/initramfs-framework/init
new file mode 100755
index 0000000..9291ad5
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/init
@@ -0,0 +1,145 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+#
+# Provides the API to be used by the initramfs modules
+#
+# Modules need to provide the following functions:
+#
+# <module>_enabled : check if the module ought to run (return 1 to skip)
+# <module>_run     : do what is need
+#
+# Boot parameters are available on environment in the as:
+#
+# 'foo=value' as 'bootparam_foo=value'
+# 'foo' as 'bootparam_foo=true'
+# 'foo.bar[=value] as 'foo_bar=[value|true]'
+
+# Register a function to be called before running a module
+# The hook is called as:
+#   <function> pre <module>
+add_module_pre_hook() {
+	MODULE_PRE_HOOKS="$MODULE_PRE_HOOKS $1"
+}
+
+# Register a function to be called after running a module
+# The hook is called as:
+#   <function> post <module>
+add_module_post_hook() {
+	MODULE_POST_HOOKS="$MODULE_POST_HOOKS $1"
+}
+
+# Load kernel module
+load_kernel_module() {
+	if modprobe $1 >/dev/null 2>&1; then
+		info "Loaded module $1"
+	else
+		debug "Failed to load module $1"
+	fi
+}
+
+# Prints information
+msg() {
+	echo "$@" >/dev/console
+}
+
+# Prints information if verbose bootparam is used
+info() {
+	[ -n "$bootparam_verbose" ] && echo "$@" >/dev/console
+}
+
+# Prints information if debug bootparam is used
+debug() {
+	[ -n "$bootparam_debug" ] && echo "DEBUG: $@" >/dev/console
+}
+
+# Prints a message and start a endless loop
+fatal() {
+    echo $1 >/dev/console
+    echo >/dev/console
+
+    if [ -n "bootparam_init_fatal_sh" ]; then
+        sh
+    else
+	while [ "true" ]; do
+		sleep 3600
+	done
+    fi
+}
+
+# Variables shared amoung modules
+ROOTFS_DIR="/rootfs" # where to do the switch root
+MODULE_PRE_HOOKS=""  # functions to call before running each module
+MODULE_POST_HOOKS="" # functions to call after running each module
+MODULES_DIR=/init.d  # place to look for modules
+
+# make mount stop complaining about missing /etc/fstab
+touch /etc/fstab
+
+# initialize /proc, /sys and /var/lock
+mkdir -p /proc /sys /var/lock
+mount -t proc proc /proc
+mount -t sysfs sysfs /sys
+
+# populate bootparam environment
+for p in `cat /proc/cmdline`; do
+	opt=`echo $p | cut -d'=' -f1`
+	opt=`echo $opt | tr '.-' '__'`
+	if [ "`echo $p | cut -d'=' -f1`" = "$p" ]; then
+		eval "bootparam_${opt}=true"
+	else
+		value="`echo $p | cut -d'=' -f2-`"
+		eval "bootparam_${opt}=\"${value}\""
+	fi
+done
+
+# use /dev with devtmpfs
+if grep -q devtmpfs /proc/filesystems; then
+	mkdir -p /dev
+	mount -t devtmpfs devtmpfs /dev
+else
+	if [ ! -d /dev ]; then
+		fatal "ERROR: /dev doesn't exist and kernel doesn't has devtmpfs enabled."
+	fi
+fi
+
+mkdir $ROOTFS_DIR
+
+# Load and run modules
+for m in $MODULES_DIR/*; do
+	# Skip backup files
+	if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
+		continue
+	fi
+
+	module=`basename $m | cut -d'-' -f 2`
+	debug "Loading module $module"
+
+	# pre hooks
+	for h in $MODULE_PRE_HOOKS; do
+		debug "Calling module hook (pre): $h"
+		eval "$h pre $module"
+		debug "Finished module hook (pre): $h"
+	done
+
+	# process module
+	. $m
+
+	if ! eval "${module}_enabled"; then
+		debug "Skipping module $module"
+		continue
+	fi
+
+	debug "Running ${module}_run"
+	eval "${module}_run"
+
+	# post hooks
+	for h in $MODULE_POST_HOOKS; do
+		debug "Calling module hook (post): $h"
+		eval "$h post $module"
+		debug "Finished module hook (post): $h"
+	done
+done
+
+# Catch all
+fatal "ERROR: Initramfs failed to initialize the system."
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/mdev b/meta/recipes-core/initrdscripts/initramfs-framework/mdev
new file mode 100644
index 0000000..a5df1d7
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/mdev
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright (C) 2011 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+mdev_enabled() {
+	if [ ! -e /sbin/mdev ]; then
+		debug "/sbin/mdev doesn't exist"
+		return 1
+	fi
+
+	return 0
+}
+
+mdev_run() {
+	# setup the environment
+	mount -t tmpfs tmpfs /dev
+
+	mkdir -m 1777 /dev/shm
+
+	mkdir -m 0755 /dev/pts
+	mount -t devpts devpts /dev/pts
+
+	echo /sbin/mdev > /proc/sys/kernel/hotplug
+	mdev -s
+
+	# load modules for devices
+	find /sys -name modalias | while read m; do
+		load_kernel_module $(cat $m)
+	done
+}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/udev b/meta/recipes-core/initrdscripts/initramfs-framework/udev
new file mode 100644
index 0000000..bb462dc
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework/udev
@@ -0,0 +1,45 @@
+#!/bin/sh
+# Copyright (C) 2011, 2012 O.S. Systems Software LTDA.
+# Licensed on MIT
+
+udev_shutdown_hook_handler() {
+	status=$1
+	module=$2
+	if [ "$status" = "pre" ] && [ "$module" = "finish" ]; then
+		killall `basename $_UDEV_DAEMON` 2>/dev/null
+	fi
+}
+
+udev_daemon() {
+	OPTIONS="/sbin/udev/udevd /sbin/udevd /lib/udev/udevd /lib/systemd/systemd-udevd"
+
+	for o in $OPTIONS; do
+		if [ -x "$o" ]; then
+			echo $o
+			return 0
+		fi
+	done
+
+	return 1
+}
+
+_UDEV_DAEMON=`udev_daemon`
+
+udev_enabled() {
+	if [ -z "$_UDEV_DAEMON" ]; then
+		msg "WARNING: Cannot find the udev daemon; daemon will not be started in initramfs."
+		return 1
+	fi
+
+	return 0
+}
+
+udev_run() {
+	add_module_pre_hook "udev_shutdown_hook_handler"
+
+	mkdir -p /run
+
+	$_UDEV_DAEMON --daemon
+	udevadm trigger --action=add
+	udevadm settle
+}
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
new file mode 100644
index 0000000..6c37b9a
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-framework_1.0.bb
@@ -0,0 +1,66 @@
+SUMMARY = "Modular initramfs system"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+RDEPENDS_${PN} += "busybox"
+
+PR = "r2"
+
+inherit allarch
+
+SRC_URI = "file://init \
+           file://finish \
+           file://mdev \
+           file://udev \
+           file://e2fs \
+           file://debug"
+
+S = "${WORKDIR}"
+
+do_install() {
+    install -d ${D}/init.d
+
+    # base
+    install -m 0755 ${WORKDIR}/init ${D}/init
+    install -m 0755 ${WORKDIR}/finish ${D}/init.d/99-finish
+
+    # mdev
+    install -m 0755 ${WORKDIR}/mdev ${D}/init.d/01-mdev
+
+    # udev
+    install -m 0755 ${WORKDIR}/udev ${D}/init.d/01-udev
+
+    # e2fs
+    install -m 0755 ${WORKDIR}/e2fs ${D}/init.d/10-e2fs
+
+    # debug
+    install -m 0755 ${WORKDIR}/debug ${D}/init.d/00-debug
+
+    # Create device nodes expected by some kernels in initramfs
+    # before even executing /init.
+    install -d ${D}/dev
+    mknod -m 622 ${D}/dev/console c 5 1
+}
+
+PACKAGES = "${PN}-base \
+            initramfs-module-mdev \
+            initramfs-module-udev \
+            initramfs-module-e2fs \
+            initramfs-module-debug"
+
+FILES_${PN}-base = "/init /init.d/99-finish /dev"
+
+SUMMARY_initramfs-module-mdev = "initramfs support for mdev"
+RDEPENDS_initramfs-module-mdev = "${PN}-base"
+FILES_initramfs-module-mdev = "/init.d/01-mdev"
+
+SUMMARY_initramfs-module-udev = "initramfs support for udev"
+RDEPENDS_initramfs-module-udev = "${PN}-base udev"
+FILES_initramfs-module-udev = "/init.d/01-udev"
+
+SUMMARY_initramfs-module-e2fs = "initramfs support for ext4/ext3/ext2 filesystems"
+RDEPENDS_initramfs-module-e2fs = "${PN}-base"
+FILES_initramfs-module-e2fs = "/init.d/10-e2fs"
+
+SUMMARY_initramfs-module-debug = "initramfs dynamic debug support"
+RDEPENDS_initramfs-module-debug = "${PN}-base"
+FILES_initramfs-module-debug = "/init.d/00-debug"
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
new file mode 100644
index 0000000..57b3025
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-live-boot_1.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Live image init script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+DEPENDS = "virtual/kernel"
+RDEPENDS_${PN} = "udev udev-extraconf"
+SRC_URI = "file://init-live.sh"
+
+PR = "r12"
+
+S = "${WORKDIR}"
+
+do_install() {
+        install -m 0755 ${WORKDIR}/init-live.sh ${D}/init
+        install -d ${D}/dev
+        mknod -m 622 ${D}/dev/console c 5 1
+}
+
+FILES_${PN} += " /init /dev "
+
+# Due to kernel dependency
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb
new file mode 100644
index 0000000..c03bd2d
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-live-install-efi-testfs_1.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Live image install script for with a second rootfs/kernel option"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install-efi-testfs.sh"
+
+RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools"
+
+S = "${WORKDIR}"
+
+do_install() {
+        install -m 0755 ${WORKDIR}/init-install-efi-testfs.sh ${D}/install-efi.sh
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+FILES_${PN} = " /install-efi.sh "
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb
new file mode 100644
index 0000000..32c1fce
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-live-install-efi_1.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Live image install script for grub-efi"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install-efi.sh"
+
+PR = "r1"
+
+RDEPENDS_${PN} = "parted e2fsprogs-mke2fs dosfstools util-linux-blkid"
+
+S = "${WORKDIR}"
+
+do_install() {
+        install -m 0755 ${WORKDIR}/init-install-efi.sh ${D}/install-efi.sh
+}
+
+# While this package maybe an allarch due to it being a
+# simple script, reality is that it is Host specific based
+# on the COMPATIBLE_HOST below, which needs to take precedence
+#inherit allarch
+INHIBIT_DEFAULT_DEPS = "1"
+
+FILES_${PN} = " /install-efi.sh "
+
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb
new file mode 100644
index 0000000..937bfd4
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-live-install-testfs_1.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Live image install script with a second rootfs/kernel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install-testfs.sh"
+
+RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs"
+
+S = "${WORKDIR}"
+
+do_install() {
+        install -m 0755 ${WORKDIR}/init-install-testfs.sh ${D}/install.sh
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+FILES_${PN} = " /install.sh "
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
new file mode 100644
index 0000000..88b3b30
--- /dev/null
+++ b/meta/recipes-core/initrdscripts/initramfs-live-install_1.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Live image install script for grub"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+SRC_URI = "file://init-install.sh"
+
+PR = "r9"
+
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} = "grub parted e2fsprogs-mke2fs util-linux-blkid"
+
+do_install() {
+        install -m 0755 ${WORKDIR}/init-install.sh ${D}/install.sh
+}
+
+# While this package maybe an allarch due to it being a 
+# simple script, reality is that it is Host specific based
+# on the COMPATIBLE_HOST below, which needs to take precedence
+#inherit allarch
+INHIBIT_DEFAULT_DEPS = "1"
+
+FILES_${PN} = " /install.sh "
+
+COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch b/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch
new file mode 100644
index 0000000..1ee8181
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/GPLv2.patch
@@ -0,0 +1,347 @@
+Upstream-Status: Inappropriate [licensing]
+
+diff --git a/COPYING b/COPYING
+new file mode 100644
+index 0000000..d511905
+--- /dev/null
++++ b/COPYING
+@@ -0,0 +1,339 @@
++		    GNU GENERAL PUBLIC LICENSE
++		       Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++			    Preamble
++
++  The licenses for most software are designed to take away your
++freedom to share and change it.  By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users.  This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it.  (Some other Free Software Foundation software is covered by
++the GNU Lesser General Public License instead.)  You can apply it to
++your programs, too.
++
++  When we speak of free software, we are referring to freedom, not
++price.  Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++  To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++  For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have.  You must make sure that they, too, receive or can get the
++source code.  And you must show them these terms so they know their
++rights.
++
++  We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++  Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software.  If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++  Finally, any free program is threatened constantly by software
++patents.  We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary.  To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++  The precise terms and conditions for copying, distribution and
++modification follow.
++
++		    GNU GENERAL PUBLIC LICENSE
++   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++  0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License.  The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language.  (Hereinafter, translation is included without limitation in
++the term "modification".)  Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope.  The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++  1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++  2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++    a) You must cause the modified files to carry prominent notices
++    stating that you changed the files and the date of any change.
++
++    b) You must cause any work that you distribute or publish, that in
++    whole or in part contains or is derived from the Program or any
++    part thereof, to be licensed as a whole at no charge to all third
++    parties under the terms of this License.
++
++    c) If the modified program normally reads commands interactively
++    when run, you must cause it, when started running for such
++    interactive use in the most ordinary way, to print or display an
++    announcement including an appropriate copyright notice and a
++    notice that there is no warranty (or else, saying that you provide
++    a warranty) and that users may redistribute the program under
++    these conditions, and telling the user how to view a copy of this
++    License.  (Exception: if the Program itself is interactive but
++    does not normally print such an announcement, your work based on
++    the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole.  If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works.  But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++  3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++    a) Accompany it with the complete corresponding machine-readable
++    source code, which must be distributed under the terms of Sections
++    1 and 2 above on a medium customarily used for software interchange; or,
++
++    b) Accompany it with a written offer, valid for at least three
++    years, to give any third party, for a charge no more than your
++    cost of physically performing source distribution, a complete
++    machine-readable copy of the corresponding source code, to be
++    distributed under the terms of Sections 1 and 2 above on a medium
++    customarily used for software interchange; or,
++
++    c) Accompany it with the information you received as to the offer
++    to distribute corresponding source code.  (This alternative is
++    allowed only for noncommercial distribution and only if you
++    received the program in object code or executable form with such
++    an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it.  For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable.  However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++  4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License.  Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++  5. You are not required to accept this License, since you have not
++signed it.  However, nothing else grants you permission to modify or
++distribute the Program or its derivative works.  These actions are
++prohibited by law if you do not accept this License.  Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++  6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions.  You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++  7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License.  If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all.  For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices.  Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++  8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded.  In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++  9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time.  Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number.  If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation.  If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++  10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission.  For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this.  Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++			    NO WARRANTY
++
++  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++		     END OF TERMS AND CONDITIONS
++
++	    How to Apply These Terms to Your New Programs
++
++  If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++  To do so, attach the following notices to the program.  It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++    <one line to give the program's name and a brief idea of what it does.>
++    Copyright (C) <year>  <name of author>
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation; either version 2 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License along
++    with this program; if not, write to the Free Software Foundation, Inc.,
++    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++    Gnomovision version 69, Copyright (C) year name of author
++    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++    This is free software, and you are welcome to redistribute it
++    under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License.  Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary.  Here is a sample; alter the names:
++
++  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++  `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++  <signature of Ty Coon>, 1 April 1989
++  Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs.  If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library.  If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh b/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh
new file mode 100644
index 0000000..b577b9a
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/arm/alignment.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: alignment
+# Required-Start:    mountkernfs
+# Required-Stop:     mountkernfs
+# Default-Start:     S
+# Default-Stop:
+### END INIT INFO
+
+if [ -e /proc/cpu/alignment ]; then
+   echo "3" > /proc/cpu/alignment
+fi
+
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/banner.sh b/meta/recipes-core/initscripts/initscripts-1.0/banner.sh
new file mode 100644
index 0000000..9e2b091
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/banner.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: banner
+# Required-Start:
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+### END INIT INFO
+
+if [ ! -e /dev/tty ]; then
+    /bin/mknod -m 0666 /dev/tty c 5 0
+fi
+
+if ( > /dev/tty0 ) 2>/dev/null; then
+    vtmaster=/dev/tty0
+elif ( > /dev/vc/0 ) 2>/dev/null; then
+    vtmaster=/dev/vc/0
+elif ( > /dev/console ) 2>/dev/null; then
+    vtmaster=/dev/console
+else
+    vtmaster=/dev/null
+fi
+echo > $vtmaster
+echo "Please wait: booting..." > $vtmaster
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
new file mode 100755
index 0000000..df553bc
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh
@@ -0,0 +1,81 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          bootmisc
+# Required-Start:    $local_fs mountvirtfs
+# Required-Stop:     $local_fs
+# Default-Start:     S
+# Default-Stop:      0 6
+# Short-Description: Misc and other.
+### END INIT INFO
+
+. /etc/default/rcS
+#
+# Put a nologin file in /etc to prevent people from logging in before
+# system startup is complete.
+#
+if test "$DELAYLOGIN" = yes
+then
+  echo "System bootup in progress - please wait" > /etc/nologin
+  cp /etc/nologin /etc/nologin.boot
+fi
+
+#
+# Set pseudo-terminal access permissions.
+#
+if test -c /dev/ttyp0
+then
+	chmod 666 /dev/tty[p-za-e][0-9a-f]
+	chown root:tty /dev/tty[p-za-e][0-9a-f]
+fi
+
+#
+# Apply /proc settings if defined
+#
+SYSCTL_CONF="/etc/sysctl.conf"
+if [ -f "${SYSCTL_CONF}" ]
+then
+	if [ -x "/sbin/sysctl" ]
+	then
+		# busybox sysctl does not support -q
+		VERBOSE_REDIR="1>/dev/null"
+		if [ "${VERBOSE}" != "no" ]; then
+			VERBOSE_REDIR="1>&1"
+		fi
+		eval /sbin/sysctl -p "${SYSCTL_CONF}" $VERBOSE_REDIR
+	else
+		echo "To have ${SYSCTL_CONF} applied during boot, install package <procps>."
+	fi
+fi
+
+#
+# Update /etc/motd.
+#
+if test "$EDITMOTD" != no
+then
+	uname -a > /etc/motd.tmp
+	sed 1d /etc/motd >> /etc/motd.tmp
+	mv /etc/motd.tmp /etc/motd
+fi
+
+#
+# This is as good a place as any for a sanity check
+#
+# Set the system clock from hardware clock
+# If the timestamp is more recent than the current time,
+# use the timestamp instead.
+test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh start
+if test -e /etc/timestamp
+then
+	SYSTEMDATE=`date -u +%4Y%2m%2d%2H%2M%2S`
+	read TIMESTAMP < /etc/timestamp
+	if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then
+		# format the timestamp as date expects it (2m2d2H2M4Y.2S)
+		TS_YR=${TIMESTAMP%??????????}
+		TS_SEC=${TIMESTAMP#????????????}
+		TS_FIRST12=${TIMESTAMP%??}
+		TS_MIDDLE8=${TS_FIRST12#????}
+		date -u ${TS_MIDDLE8}${TS_YR}.${TS_SEC}
+		test -x /etc/init.d/hwclock.sh && /etc/init.d/hwclock.sh stop
+	fi
+fi
+: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
new file mode 100755
index 0000000..6286945
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/checkfs.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          checkfs
+# Required-Start:    checkroot
+# Required-Stop:     
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Check all other file systems
+### END INIT INFO
+
+. /etc/default/rcS
+
+#
+# Check the rest of the filesystems.
+#
+if test ! -f /fastboot
+then
+    if test -f /forcefsck
+    then
+        force="-f"
+    else
+        force=""
+    fi
+    if test "$FSCKFIX"  = yes
+    then
+	fix="-y"
+    else
+	fix="-a"
+    fi
+    spinner="-C"
+    case "$TERM" in
+	dumb|network|unknown|"") spinner="" ;;
+    esac
+    test "`uname -m`" = "s390" && spinner="" # This should go away
+    test "$VERBOSE" != no && echo "Checking all filesystems..."
+    fsck $spinner -R -A $fix $force
+    if test "$?" -gt 1
+    then
+      echo
+      echo "fsck failed.  Please repair manually."
+      echo
+      echo "CONTROL-D will exit from this shell and continue system startup."
+      echo
+      # Start a single user shell on the console
+      /sbin/sulogin $CONSOLE
+    fi
+fi
+rm -f /fastboot /forcefsck
+
+: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh b/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
new file mode 100755
index 0000000..dfee2af
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/checkroot.sh
@@ -0,0 +1,148 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          checkroot
+# Required-Start:    udev
+# Required-Stop:     
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Check to root file system.
+### END INIT INFO
+
+. /etc/default/rcS
+
+#
+# Set SULOGIN in /etc/default/rcS to yes if you want a sulogin to be spawned
+# from this script *before anything else* with a timeout, like SCO does.
+#
+test "$SULOGIN" = yes && sulogin -t 30 $CONSOLE
+
+#
+# Read /etc/fstab.
+#
+exec 9< /etc/fstab
+rootmode=rw
+rootopts=rw
+rootcheck=$ENABLE_ROOTFS_FSCK
+swap_on_md=no
+devfs=
+while read fs mnt type opts dump pass junk <&9
+do
+	case "$fs" in
+		""|\#*)
+			continue;
+			;;
+		/dev/md*)
+			# Swap on md device.
+			test "$type" = swap && swap_on_md=yes
+			;;
+		/dev/*)
+			;;
+		*)
+			# Might be a swapfile.
+			test "$type" = swap && swap_on_md=yes
+			;;
+	esac
+	test "$type" = devfs && devfs="$fs"
+	test "$mnt" != / && continue
+	rootopts="$opts"
+	test "$pass" = 0 -o "$pass" = "" && rootcheck=no
+	case "$opts" in
+		ro|ro,*|*,ro|*,ro,*)
+			rootmode=ro
+			;;
+	esac
+done
+exec 0>&9 9>&-
+
+# Check for conflicting configurations
+if [ "$rootmode" = "ro" -a "$ROOTFS_READ_ONLY" = "no" ] || \
+	[ "$rootmode" = "rw" -a "$ROOTFS_READ_ONLY" = "yes" ]; then
+	echo ""
+	echo "WARN: conflicting configurations in /etc/fstab and /etc/default/rcS"
+	echo "      regarding the writability of rootfs. Please fix one of them."
+	echo ""
+fi
+
+
+#
+# Activate the swap device(s) in /etc/fstab. This needs to be done
+# before fsck, since fsck can be quite memory-hungry.
+#
+test "$VERBOSE" != no && echo "Activating swap"
+swapon -a 2> /dev/null
+
+#
+# Check the root filesystem.
+#
+if test -f /fastboot || test $rootcheck = no
+then
+  test $rootcheck = yes && echo "Fast boot, no filesystem check"
+else
+  #
+  # Ensure that root is quiescent and read-only before fsck'ing.
+  #
+  mount -n -o remount,ro /
+  if test $? = 0
+  then
+    if test -f /forcefsck
+    then
+	force="-f"
+    else
+	force=""
+    fi
+    if test "$FSCKFIX" = yes
+    then
+	fix="-y"
+    else
+	fix="-a"
+    fi
+    spinner="-C"
+    case "$TERM" in
+        dumb|network|unknown|"") spinner="" ;;
+    esac
+    test `uname -m` = s390 && spinner="" # This should go away
+    test "$VERBOSE" != no && echo "Checking root filesystem..."
+    fsck $spinner $force $fix /
+    #
+    # If there was a failure, drop into single-user mode.
+    #
+    # NOTE: "failure" is defined as exiting with a return code of
+    # 2 or larger.  A return code of 1 indicates that filesystem
+    # errors were corrected but that the boot may proceed.
+    #
+    if test "$?" -gt 1
+    then
+      # Surprise! Re-directing from a HERE document (as in
+      # "cat << EOF") won't work, because the root is read-only.
+      echo
+      echo "fsck failed.  Please repair manually and reboot.  Please note"
+      echo "that the root filesystem is currently mounted read-only.  To"
+      echo "remount it read-write:"
+      echo
+      echo "   # mount -n -o remount,rw /"
+      echo
+      echo "CONTROL-D will exit from this shell and REBOOT the system."
+      echo
+      # Start a single user shell on the console
+      /sbin/sulogin $CONSOLE
+      reboot -f
+    fi
+  else
+    echo "*** ERROR!  Cannot fsck root fs because it is not mounted read-only!"
+    echo
+  fi
+fi
+
+#
+#	If the root filesystem was not marked as read-only in /etc/fstab,
+#	remount the rootfs rw but do not try to change mtab because it
+#	is on a ro fs until the remount succeeded. Then clean up old mtabs
+#	and finally write the new mtab.
+#
+mount -n -o remount,$rootmode /
+if test "$rootmode" = rw
+then
+	ln -sf /proc/mounts /dev/mtab
+fi
+
+: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/devpts b/meta/recipes-core/initscripts/initscripts-1.0/devpts
new file mode 100644
index 0000000..4a0978b
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/devpts
@@ -0,0 +1,5 @@
+# GID of the `tty' group
+TTYGRP=5
+ 
+# Set to 600 to have `mesg n' be the default
+TTYMODE=620
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh b/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh
new file mode 100755
index 0000000..c6043fb
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/devpts.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          devpts
+# Required-Start: udev
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Mount /dev/pts file systems.
+### END INIT INFO
+
+. /etc/default/devpts
+
+if grep -q devpts /proc/filesystems
+then
+	#
+	#	Create multiplexor device.
+	#
+	test -c /dev/ptmx || mknod -m 666 /dev/ptmx c 5 2
+
+	#
+	#	Mount /dev/pts if needed.
+	#
+	if ! grep -q devpts /proc/mounts
+	then
+		mkdir -p /dev/pts
+		mount -t devpts devpts /dev/pts -ogid=${TTYGRP},mode=${TTYMODE}
+	fi
+fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh b/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
new file mode 100644
index 0000000..a97b068
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/dmesg.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:             dmesg
+# Required-Start:
+# Required-Stop:
+# Default-Start:        S
+# Default-Stop:
+### END INIT INFO
+
+if [ -f /var/log/dmesg ]; then
+	if [ -f /usr/sbin/logrotate ]; then
+		logrotate -f /etc/logrotate-dmesg.conf
+	else
+		mv -f /var/log/dmesg /var/log/dmesg.old
+	fi
+fi
+dmesg -s 131072 > /var/log/dmesg
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/functions b/meta/recipes-core/initscripts/initscripts-1.0/functions
new file mode 100755
index 0000000..01ad1ed
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/functions
@@ -0,0 +1,91 @@
+# -*-Shell-script-*-
+#
+# functions     This file contains functions to be used by most or all
+#               shell scripts in the /etc/init.d directory.
+#
+
+NORMAL="\\033[0;39m"         # Standard console grey
+SUCCESS="\\033[1;32m"        # Success is green
+WARNING="\\033[1;33m"        # Warnings are yellow
+FAILURE="\\033[1;31m"        # Failures are red
+INFO="\\033[1;36m"           # Information is light cyan
+BRACKET="\\033[1;34m"        # Brackets are blue
+
+# NOTE: The pidofproc () doesn't support the process which is a script unless
+#       the pidof supports "-x" option. If you want to use it for such a
+#       process:
+#       1) If there is no "pidof -x", replace the "pidof $1" with another
+#          command like(for core-image-minimal):
+#            ps | awk '/'"$1"'/ {print $1}'
+#       Or
+#       2) If there is "pidof -x", replace "pidof" with "pidof -x".
+#
+# pidofproc - print the pid of a process
+# $1: the name of the process
+pidofproc () {
+
+	# pidof output null when no program is running, so no "2>/dev/null".
+	pid=`pidof $1`
+	status=$?
+	case $status in
+	0)
+		echo $pid
+		return 0
+		;;
+	127)
+		echo "ERROR: command pidof not found" >&2
+		exit 127
+		;;
+	*)
+		return $status
+		;;
+	esac
+}
+
+machine_id() { # return the machine ID
+	awk 'BEGIN { FS=": " } /Hardware/ \
+		{ gsub(" ", "_", $2); print tolower($2) } ' </proc/cpuinfo
+}
+
+killproc() { # kill the named process(es)
+	pid=`pidofproc $1` && kill $pid
+}
+
+status() {
+    local pid
+    if [ "$#" = 0 ]; then
+        echo "Usage: status {program}"
+        return 1
+    fi
+    pid=`pidofproc $1`
+    if [ -n "$pid" ]; then
+        echo "$1 (pid $pid) is running..."
+        return 0
+    else
+        echo "$1 is stopped"
+    fi
+    return 3
+}
+
+success() {
+    echo -n -e "${BRACKET}[${SUCCESS}  OK  ${BRACKET}]${NORMAL}"
+    return 0
+}
+
+failure() {
+    local rc=$*
+    echo -n -e "${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
+    return $rc
+}
+
+warning() {
+    local rc=$*
+    echo -n -e "${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
+    return $rc
+}
+
+passed() {
+    local rc=$*
+    echo -n -e "${BRACKET}[${SUCCESS} PASS ${BRACKET}]${NORMAL}"
+    return $rc
+}
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/halt b/meta/recipes-core/initscripts/initscripts-1.0/halt
new file mode 100755
index 0000000..a56f734
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/halt
@@ -0,0 +1,29 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          halt
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop:      0
+# Short-Description: Execute the halt command.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# See if we need to cut the power.
+if test -x /etc/init.d/ups-monitor
+then
+	/etc/init.d/ups-monitor poweroff
+fi
+
+# Don't shut down drives if we're using RAID.
+hddown="-h"
+if grep -qs '^md.*active' /proc/mdstat
+then
+	hddown=""
+fi
+
+halt SED_HALTARGS -p $hddown
+
+: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh b/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
new file mode 100755
index 0000000..95287cc1
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/hostname.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          hostname
+# Required-Start:
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Set hostname based on /etc/hostname
+### END INIT INFO
+HOSTNAME=$(/bin/hostname)
+
+hostname -b -F /etc/hostname 2> /dev/null
+if [ $? -eq 0 ]; then
+	exit
+fi
+
+# Busybox hostname doesn't support -b so we need implement it on our own
+if [ -f /etc/hostname ];then
+	hostname `cat /etc/hostname`
+elif [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" -o ! -z "`echo $HOSTNAME | sed -n '/^[0-9]*\.[0-9].*/p'`" ] ; then
+	hostname localhost
+fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf b/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf
new file mode 100644
index 0000000..6f46e42
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/logrotate-dmesg.conf
@@ -0,0 +1,9 @@
+# see "man logrotate" for details
+# rotate dmesg, and keep 5 versions.
+
+/var/log/dmesg {
+	create
+	rotate 5
+	nodateext
+}
+
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
new file mode 100755
index 0000000..94bae42
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/mountall.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          mountall
+# Required-Start:    mountvirtfs
+# Required-Stop: 
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Mount all filesystems.
+# Description:
+### END INIT INFO
+
+. /etc/default/rcS
+
+#
+# Mount local filesystems in /etc/fstab. For some reason, people
+# might want to mount "proc" several times, and mount -v complains
+# about this. So we mount "proc" filesystems without -v.
+#
+test "$VERBOSE" != no && echo "Mounting local filesystems..."
+mount -at nonfs,nosmbfs,noncpfs 2>/dev/null
+
+#
+# We might have mounted something over /dev, see if /dev/initctl is there.
+#
+if test ! -p /dev/initctl
+then
+	rm -f /dev/initctl
+	mknod -m 600 /dev/initctl p
+fi
+kill -USR1 1
+
+#
+# Execute swapon command again, in case we want to swap to
+# a file on a now mounted filesystem.
+#
+swapon -a 2> /dev/null
+
+: exit 0
+
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
new file mode 100755
index 0000000..fe6c196
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/mountnfs.sh
@@ -0,0 +1,88 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          mountnfs
+# Required-Start:    $local_fs $network $rpcbind
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+### END INIT INFO
+
+#
+#	Run in a subshell because of I/O redirection.
+#
+test -f /etc/fstab && (
+
+#
+#	Read through fstab line by line. If it is NFS, set the flag
+#	for mounting NFS filesystems. If any NFS partition is found and it
+#	not mounted with the nolock option, we start the rpcbind.
+#
+rpcbind=no
+mount_nfs=no
+mount_smb=no
+mount_ncp=no
+mount_cifs=no
+while read device mountpt fstype options
+do
+	case "$device" in
+		""|\#*)
+			continue
+			;;
+	esac
+
+	case "$options" in
+		*noauto*)
+			continue
+			;;
+	esac
+
+	if test "$fstype" = nfs
+	then
+		mount_nfs=yes
+		case "$options" in
+			*nolock*)
+				;;
+			*)
+				rpcbind=yes
+				;;
+		esac
+	fi
+	if test "$fstype" = smbfs
+	then
+		mount_smb=yes
+	fi
+	if test "$fstype" = ncpfs
+	then
+		mount_ncp=yes
+	fi
+	if test "$fstype" = cifs
+	then
+		mount_cifs=yes
+	fi
+done
+
+exec 0>&1
+
+if test "$rpcbind" = yes
+then
+	if test -x /usr/sbin/rpcbind
+	then
+		echo -n "Starting rpcbind... "
+		start-stop-daemon --start --quiet --exec /usr/sbin/rpcbind
+		sleep 2
+	fi
+fi
+
+if test "$mount_nfs" = yes || test "$mount_smb" = yes || test "$mount_ncp" = yes || test "$mount_cifs" = yes
+then
+	echo "Mounting remote filesystems..."
+	test "$mount_nfs" = yes && mount -a -t nfs
+	test "$mount_smb" = yes && mount -a -t smbfs
+	test "$mount_ncp" = yes && mount -a -t ncpfs
+	test "$mount_cifs" = yes && mount -a -t cifs
+fi
+
+) < /etc/fstab
+
+: exit 0
+
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
new file mode 100755
index 0000000..904037e
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
@@ -0,0 +1,222 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:             volatile
+# Required-Start:       $local_fs
+# Required-Stop:      $local_fs
+# Default-Start:        S
+# Default-Stop:
+# Short-Description:  Populate the volatile filesystem
+### END INIT INFO
+
+# Get ROOT_DIR
+DIRNAME=`dirname $0`
+ROOT_DIR=`echo $DIRNAME | sed -ne 's:/etc/.*::p'`
+
+[ -e ${ROOT_DIR}/etc/default/rcS ] && . ${ROOT_DIR}/etc/default/rcS
+# When running populate-volatile.sh at rootfs time, disable cache.
+[ -n "$ROOT_DIR" ] && VOLATILE_ENABLE_CACHE=no
+# If rootfs is read-only, disable cache.
+[ "$ROOTFS_READ_ONLY" = "yes" ] && VOLATILE_ENABLE_CACHE=no
+
+CFGDIR="${ROOT_DIR}/etc/default/volatiles"
+TMPROOT="${ROOT_DIR}/var/volatile/tmp"
+COREDEF="00_core"
+
+[ "${VERBOSE}" != "no" ] && echo "Populating volatile Filesystems."
+
+create_file() {
+	EXEC="
+	touch \"$1\";
+	chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
+	chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
+
+	test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
+
+	[ -e "$1" ] && {
+		[ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
+	} || {
+		if [ -z "$ROOT_DIR" ]; then
+			eval $EXEC &
+		else
+			# Creating some files at rootfs time may fail and should fail,
+			# but these failures should not be logged to make sure the do_rootfs
+			# process doesn't fail. This does no harm, as this script will
+			# run on target to set up the correct files and directories.
+			eval $EXEC > /dev/null 2>&1
+		fi
+	}
+}
+
+mk_dir() {
+	EXEC="
+	mkdir -p \"$1\";
+	chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
+	chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
+
+	test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
+	[ -e "$1" ] && {
+		[ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
+	} || {
+		if [ -z "$ROOT_DIR" ]; then
+			eval $EXEC
+		else
+			# For the same reason with create_file(), failures should
+			# not be logged.
+			eval $EXEC > /dev/null 2>&1
+		fi
+	}
+}
+
+link_file() {
+	EXEC="
+	if [ -L \"$2\" ]; then
+		[ \"\$(readlink -f \"$2\")\" != \"\$(readlink -f \"$1\")\" ] && { rm -f \"$2\"; ln -sf \"$1\" \"$2\"; };
+	elif [ -d \"$2\" ]; then
+		if awk '\$2 == \"$2\" {exit 1}' /proc/mounts; then
+			cp -a $2/* $1 2>/dev/null;
+			cp -a $2/.[!.]* $1 2>/dev/null;
+			rm -rf \"$2\";
+			ln -sf \"$1\" \"$2\";
+		fi
+	else
+		ln -sf \"$1\" \"$2\";
+	fi
+        "
+
+	test "$VOLATILE_ENABLE_CACHE" = yes && echo "	$EXEC" >> /etc/volatile.cache.build
+
+	if [ -z "$ROOT_DIR" ]; then
+		eval $EXEC &
+	else
+		# For the same reason with create_file(), failures should
+		# not be logged.
+		eval $EXEC > /dev/null 2>&1
+	fi
+}
+
+check_requirements() {
+	cleanup() {
+		rm "${TMP_INTERMED}"
+		rm "${TMP_DEFINED}"
+		rm "${TMP_COMBINED}"
+	}
+
+	CFGFILE="$1"
+	[ `basename "${CFGFILE}"` = "${COREDEF}" ] && return 0
+
+	TMP_INTERMED="${TMPROOT}/tmp.$$"
+	TMP_DEFINED="${TMPROOT}/tmpdefined.$$"
+	TMP_COMBINED="${TMPROOT}/tmpcombined.$$"
+
+	sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/passwd | sort | uniq > "${TMP_DEFINED}"
+	cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 2 > "${TMP_INTERMED}"
+	cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
+	NR_DEFINED_USERS="`cat "${TMP_DEFINED}" | wc -l`"
+	NR_COMBINED_USERS="`cat "${TMP_COMBINED}" | wc -l`"
+
+	[ "${NR_DEFINED_USERS}" -ne "${NR_COMBINED_USERS}" ] && {
+		echo "Undefined users:"
+		diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
+		cleanup
+		return 1
+	}
+
+
+	sed 's@\(^:\)*:.*@\1@' ${ROOT_DIR}/etc/group | sort | uniq > "${TMP_DEFINED}"
+	cat ${CFGFILE} | grep -v "^#" | cut -s -d " " -f 3 > "${TMP_INTERMED}"
+	cat "${TMP_DEFINED}" "${TMP_INTERMED}" | sort | uniq > "${TMP_COMBINED}"
+
+	NR_DEFINED_GROUPS="`cat "${TMP_DEFINED}" | wc -l`"
+	NR_COMBINED_GROUPS="`cat "${TMP_COMBINED}" | wc -l`"
+
+	[ "${NR_DEFINED_GROUPS}" -ne "${NR_COMBINED_GROUPS}" ] && {
+		echo "Undefined groups:"
+		diff "${TMP_DEFINED}" "${TMP_COMBINED}" | grep "^>"
+		cleanup
+		return 1
+	}
+
+	# Add checks for required directories here
+
+	cleanup
+	return 0
+}
+
+apply_cfgfile() {
+	CFGFILE="$1"
+
+	check_requirements "${CFGFILE}" || {
+		echo "Skipping ${CFGFILE}"
+		return 1
+	}
+
+	cat ${CFGFILE} | grep -v "^#" | \
+		while read LINE; do
+		eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`
+		TNAME=${ROOT_DIR}${TNAME}
+		[ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."
+
+		[ "${TTYPE}" = "l" ] && {
+			TSOURCE="$TLTARGET"
+			[ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."
+			link_file "${TSOURCE}" "${TNAME}"
+			continue
+		}
+
+		[ -L "${TNAME}" ] && {
+			[ "${VERBOSE}" != "no" ] && echo "Found link."
+			NEWNAME=`ls -l "${TNAME}" | sed -e 's/^.*-> \(.*\)$/\1/'`
+			echo ${NEWNAME} | grep -v "^/" >/dev/null && {
+				TNAME="`echo ${TNAME} | sed -e 's@\(.*\)/.*@\1@'`/${NEWNAME}"
+				[ "${VERBOSE}" != "no" ] && echo "Converted relative linktarget to absolute path -${TNAME}-."
+			} || {
+				TNAME="${NEWNAME}"
+				[ "${VERBOSE}" != "no" ] && echo "Using absolute link target -${TNAME}-."
+			}
+		}
+
+		case "${TTYPE}" in
+			"f")  [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-."
+				create_file "${TNAME}" &
+				;;
+			"d")  [ "${VERBOSE}" != "no" ] && echo "Creating directory -${TNAME}-."
+				mk_dir "${TNAME}"
+				# Add check to see if there's an entry in fstab to mount.
+				;;
+			*)    [ "${VERBOSE}" != "no" ] && echo "Invalid type -${TTYPE}-."
+				continue
+				;;
+		esac
+	done
+	return 0
+}
+
+clearcache=0
+exec 9</proc/cmdline
+while read line <&9
+do
+	case "$line" in
+		*clearcache*)  clearcache=1
+			       ;;
+		*)	       continue
+			       ;;
+	esac
+done
+exec 9>&-
+
+if test -e ${ROOT_DIR}/etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0"
+then
+	sh ${ROOT_DIR}/etc/volatile.cache
+else
+	rm -f ${ROOT_DIR}/etc/volatile.cache ${ROOT_DIR}/etc/volatile.cache.build
+	for file in `ls -1 "${CFGDIR}" | sort`; do
+		apply_cfgfile "${CFGDIR}/${file}"
+	done
+
+	[ -e ${ROOT_DIR}/etc/volatile.cache.build ] && sync && mv ${ROOT_DIR}/etc/volatile.cache.build ${ROOT_DIR}/etc/volatile.cache
+fi
+
+if [ -z "${ROOT_DIR}" ] && [ -f /etc/ld.so.cache ] && [ ! -f /var/run/ld.so.cache ]
+then
+	ln -s /etc/ld.so.cache /var/run/ld.so.cache
+fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
new file mode 100644
index 0000000..1a0328d
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/read-only-rootfs-hook.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+. /etc/default/rcS
+
+[ "$ROOTFS_READ_ONLY" = "no" ] && exit 0
+
+is_on_read_only_partition () {
+	DIRECTORY=$1
+	dir=`readlink -f $DIRECTORY`
+	while true; do
+		if [ ! -d "$dir" ]; then
+			echo "ERROR: $dir is not a directory"
+			exit 1
+		else
+			for flag in `awk -v dir=$dir '{ if ($2 == dir) { print "FOUND"; split($4,FLAGS,",") } }; \
+				END { for (f in FLAGS) print FLAGS[f] }' < /proc/mounts`; do
+				[ "$flag" = "FOUND" ] && partition="read-write"
+				[ "$flag" = "ro" ] && { partition="read-only"; break; }
+			done
+			if [ "$dir" = "/" -o -n "$partition" ]; then
+				break
+			else
+				dir=`dirname $dir`
+			fi
+		fi
+	done
+	[ "$partition" = "read-only" ] && echo "yes" || echo "no"
+}
+
+if [ "$1" = "start" ] ; then
+	if [ `is_on_read_only_partition /var/lib` = "yes" ]; then
+		grep -q "tmpfs /var/volatile" /proc/mounts || mount /var/volatile
+		mkdir -p /var/volatile/lib
+		cp -a /var/lib/* /var/volatile/lib
+		mount --bind /var/volatile/lib /var/lib
+	fi
+fi
+
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/reboot b/meta/recipes-core/initscripts/initscripts-1.0/reboot
new file mode 100755
index 0000000..087d8d5
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/reboot
@@ -0,0 +1,15 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          reboot
+# Required-Start:
+# Required-Stop:
+# Default-Start:
+# Default-Stop:      6
+# Short-Description: Execute the reboot command.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+echo -n "Rebooting... "
+reboot SED_HALTARGS
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh b/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh
new file mode 100755
index 0000000..76de341
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/rmnologin.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          rmnologin
+# Required-Start:    $remote_fs $all
+# Required-Stop: 
+# Default-Start:     2 3 4 5
+# Default-Stop:
+# Short-Description: Remove /etc/nologin at boot
+# Description:       This script removes the /etc/nologin file as the
+#                    last step in the boot process, if DELAYLOGIN=yes.
+#                    If DELAYLOGIN=no, /etc/nologin was not created by
+#                    bootmisc earlier in the boot process.
+### END INIT INFO
+
+if test -f /etc/nologin.boot
+then
+	rm -f /etc/nologin /etc/nologin.boot
+fi
+
+: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
new file mode 100644
index 0000000..b038fc5
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          save-rtc
+# Required-Start:
+# Required-Stop:     $local_fs hwclock
+# Default-Start:     S
+# Default-Stop:      0 6
+# Short-Description: Store system clock into file
+# Description:       
+### END INIT INFO
+
+# Update the timestamp
+date -u +%4Y%2m%2d%2H%2M%2S > /etc/timestamp
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/sendsigs b/meta/recipes-core/initscripts/initscripts-1.0/sendsigs
new file mode 100755
index 0000000..34e1b77
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/sendsigs
@@ -0,0 +1,21 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          sendsigs
+# Required-Start:    
+# Required-Stop:     umountnfs
+# Default-Start:
+# Default-Stop:      0 6
+# Short-Description: Kill all remaining processes.
+# Description: 
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# Kill all processes.
+echo "Sending all processes the TERM signal..."
+killall5 -15
+sleep 5
+echo "Sending all processes the KILL signal..."
+killall5 -9
+
+: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/single b/meta/recipes-core/initscripts/initscripts-1.0/single
new file mode 100755
index 0000000..da82d17
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/single
@@ -0,0 +1,24 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          single
+# Required-Start:    $local_fs $all killprocs
+# Required-Stop:
+# Default-Start:     1
+# Default-Stop:
+# Short-Description: executed by init(8) upon entering runlevel 1 (single).
+### END INIT INFO
+
+PATH="/sbin:/bin:/usr/sbin:/usr/bin"
+
+# Kill all processes.
+echo "Sending all processes the TERM signal..."
+killall5 -15
+sleep 5
+echo "Sending all processes the KILL signal..."
+killall5 -9
+
+# We start update here, since we just killed it.
+test -x /sbin/update && update
+
+echo "Entering single-user mode..."
+exec init -t1 S
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/sushell b/meta/recipes-core/initscripts/initscripts-1.0/sushell
new file mode 100644
index 0000000..c319d95
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/sushell
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+[ -z "$SUSHELL" ] && SUSHELL=/bin/sh
+
+exec $SUSHELL
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
new file mode 100644
index 0000000..0cfe76e
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/sysfs.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          mountvirtfs
+# Required-Start:
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Mount kernel virtual file systems.
+# Description:       Mount initial set of virtual filesystems the kernel
+#                    provides and that are required by everything.
+### END INIT INFO
+
+if [ -e /proc ] && ! [ -e /proc/mounts ]; then
+  mount -t proc proc /proc
+fi
+
+if [ -e /sys ] && grep -q sysfs /proc/filesystems && ! [ -e /sys/class ]; then
+  mount -t sysfs sysfs /sys
+fi
+
+if [ -e /sys/kernel/debug ] && grep -q debugfs /proc/filesystems; then
+  mount -t debugfs debugfs /sys/kernel/debug
+fi
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/umountfs b/meta/recipes-core/initscripts/initscripts-1.0/umountfs
new file mode 100755
index 0000000..61324c6
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/umountfs
@@ -0,0 +1,24 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          umountfs
+# Required-Start:
+# Required-Stop:     
+# Default-Start:
+# Default-Stop:      0 6
+# Short-Description: Turn off swap and unmount all local file systems.
+# Description:
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+echo "Deactivating swap..."
+swapoff -a
+
+# We leave /proc mounted.
+echo "Unmounting local filesystems..."
+grep -q /mnt/ram /proc/mounts && mount -o remount,ro /mnt/ram
+mount -o remount,ro /
+
+umount -f -a -r > /dev/null 2>&1
+
+: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh b/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh
new file mode 100755
index 0000000..af07540
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/umountnfs.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          umountnfs
+# Required-Start:
+# Required-Stop:     umountfs
+# Should-Stop:       $network $portmap
+# Default-Start:
+# Default-Stop:      0 6
+# Short-Description: Unmount all network filesystems
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+# Write a reboot record to /var/log/wtmp before unmounting
+halt -w
+
+echo "Unmounting remote filesystems..."
+
+test -f /etc/fstab && (
+
+#
+#	Read through fstab line by line and unount network file systems
+#
+while read device mountpt fstype options
+do
+	if test "$fstype" = nfs ||  test "$fstype" = smbfs ||  test "$fstype" = ncpfs || test "$fstype" = cifs
+	then
+		umount -f $mountpt
+	fi
+done
+) < /etc/fstab
+
+: exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/urandom b/meta/recipes-core/initscripts/initscripts-1.0/urandom
new file mode 100755
index 0000000..af1625b
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/urandom
@@ -0,0 +1,49 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          urandom
+# Required-Start:    $local_fs mountvirtfs
+# Required-Stop:     $local_fs
+# Default-Start:     S
+# Default-Stop:      0 6
+# Short-Description: Save and restore the random seed
+# Description:       Save the random seed on shutdown and restore it on boot,
+#                    to ensure that the seed isn't predicable on startup
+#                    (because the boot process is predictable)
+### END INIT INFO
+
+test -c /dev/urandom || exit 0
+
+RANDOM_SEED_FILE=/var/lib/urandom/random-seed
+
+. /etc/default/rcS
+[ -f /etc/default/urandom ] && . /etc/default/urandom
+
+case "$1" in
+	start|"")
+		test "$VERBOSE" != no && echo "Initializing random number generator..."
+		# Load and then save 512 bytes, which is the size of the entropy
+		# pool. Also load the current date, in case the seed file is
+		# empty.
+		( date +%s.%N; [ -f "$RANDOM_SEED_FILE" ] && cat "$RANDOM_SEED_FILE" ) \
+			>/dev/urandom
+		rm -f "$RANDOM_SEED_FILE"
+		umask 077
+		dd if=/dev/urandom of=$RANDOM_SEED_FILE count=1 \
+			>/dev/null 2>&1 || echo "urandom start: failed."
+		umask 022
+		;;
+	stop)
+		# Carry a random seed from shut-down to start-up;
+		# see documentation in linux/drivers/char/random.c
+		test "$VERBOSE" != no && echo "Saving random seed..."
+		umask 077
+		dd if=/dev/urandom of=$RANDOM_SEED_FILE count=1 \
+			>/dev/null 2>&1 || echo "urandom stop: failed."
+		;;
+	*)
+		echo "Usage: urandom {start|stop}" >&2
+		exit 1
+		;;
+esac
+
+exit 0
diff --git a/meta/recipes-core/initscripts/initscripts-1.0/volatiles b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
new file mode 100644
index 0000000..297245d
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles
@@ -0,0 +1,36 @@
+# This configuration file lists filesystem objects that should get verified
+# during startup and be created if missing.
+#
+# Every line must either be a comment starting with #
+# or a definition of format:
+# <type> <owner> <group> <mode> <path> <linksource>
+# where the items are separated by whitespace !
+#
+# <type> : d|f|l : (d)irectory|(f)ile|(l)ink
+#
+# A linking example:
+# l root root 0777 /var/test /tmp/testfile
+# f root root 0644 /var/test none
+#
+# Understanding links:
+# When populate-volatile is to verify/create a directory or file, it will first
+# check it's existence. If a link is found to exist in the place of the target,
+# the path of the target is replaced with the target the link points to.
+# Thus, if a link is in the place to be verified, the object will be created
+# in the place the link points to instead.
+# This explains the order of "link before object" as in the example above, where
+# a link will be created at /var/test pointing to /tmp/testfile and due to this
+# link the file defined as /var/test will actually be created as /tmp/testfile.
+d root root 1777 /run/lock none
+d root root 0755 /var/volatile/log none
+d root root 1777 /var/volatile/tmp none
+l root root 1777 /var/lock /run/lock
+l root root 0755 /var/log /var/volatile/log
+l root root 0755 /var/run /run
+l root root 1777 /var/tmp /var/volatile/tmp
+l root root 1777 /tmp /var/tmp
+d root root 0755 /var/lock/subsys none
+f root root 0664 /var/log/wtmp none
+f root root 0664 /var/run/utmp none
+l root root 0644 /etc/resolv.conf /var/run/resolv.conf
+f root root 0644 /var/run/resolv.conf none
diff --git a/meta/recipes-core/initscripts/initscripts_1.0.bb b/meta/recipes-core/initscripts/initscripts_1.0.bb
new file mode 100644
index 0000000..f90de6e
--- /dev/null
+++ b/meta/recipes-core/initscripts/initscripts_1.0.bb
@@ -0,0 +1,182 @@
+SUMMARY = "SysV init scripts"
+DESCRIPTION = "Initscripts provide the basic system startup initialization scripts for the system.  These scripts include actions such as filesystem mounting, fsck, RTC manipulation and other actions routinely performed at system startup.  In addition, the scripts are also used during system shutdown to reverse the actions performed at startup."
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+PR = "r155"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRC_URI = "file://functions \
+           file://halt \
+           file://umountfs \
+           file://devpts.sh \
+           file://devpts \
+           file://hostname.sh \
+           file://mountall.sh \
+           file://banner.sh \
+           file://bootmisc.sh \
+           file://mountnfs.sh \
+           file://reboot \
+           file://checkfs.sh \
+           file://single \
+           file://sendsigs \
+           file://urandom \
+           file://rmnologin.sh \
+           file://checkroot.sh \
+           file://umountnfs.sh \
+           file://sysfs.sh \
+           file://populate-volatile.sh \
+           file://read-only-rootfs-hook.sh \
+           file://volatiles \
+           file://save-rtc.sh \
+           file://GPLv2.patch \
+           file://dmesg.sh \
+           file://logrotate-dmesg.conf \
+           ${@bb.utils.contains('DISTRO_FEATURES','selinux','file://sushell','',d)} \
+"
+
+S = "${WORKDIR}"
+
+SRC_URI_append_arm = " file://alignment.sh"
+
+KERNEL_VERSION = ""
+
+inherit update-alternatives
+DEPENDS_append = " update-rc.d-native"
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+
+PACKAGES =+ "${PN}-functions"
+RDEPENDS_${PN} = "${PN}-functions \
+                  ${@bb.utils.contains('DISTRO_FEATURES','selinux','bash','',d)} \
+		 "
+FILES_${PN}-functions = "${sysconfdir}/init.d/functions*"
+
+ALTERNATIVE_PRIORITY_${PN}-functions = "90"
+ALTERNATIVE_${PN}-functions = "functions"
+ALTERNATIVE_LINK_NAME[functions] = "${sysconfdir}/init.d/functions"
+
+HALTARGS ?= "-d -f"
+
+do_configure() {
+	sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/halt
+	sed -i -e "s:SED_HALTARGS:${HALTARGS}:g" ${WORKDIR}/reboot
+}
+
+do_install () {
+#
+# Create directories and install device independent scripts
+#
+	install -d ${D}${sysconfdir}/init.d
+	install -d ${D}${sysconfdir}/rcS.d
+	install -d ${D}${sysconfdir}/rc0.d
+	install -d ${D}${sysconfdir}/rc1.d
+	install -d ${D}${sysconfdir}/rc2.d
+	install -d ${D}${sysconfdir}/rc3.d
+	install -d ${D}${sysconfdir}/rc4.d
+	install -d ${D}${sysconfdir}/rc5.d
+	install -d ${D}${sysconfdir}/rc6.d
+	install -d ${D}${sysconfdir}/default
+	install -d ${D}${sysconfdir}/default/volatiles
+	# Holds state information pertaining to urandom
+	install -d ${D}${localstatedir}/lib/urandom
+
+	install -m 0644    ${WORKDIR}/functions		${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/bootmisc.sh	${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/checkroot.sh	${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/halt		${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/hostname.sh	${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/mountall.sh	${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/mountnfs.sh	${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/reboot		${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/rmnologin.sh	${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/sendsigs		${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/single		${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/umountnfs.sh	${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/urandom		${D}${sysconfdir}/init.d
+	sed -i ${D}${sysconfdir}/init.d/urandom -e 's,/var/,${localstatedir}/,g;s,/etc/,${sysconfdir}/,g'
+	install -m 0755    ${WORKDIR}/devpts.sh	${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/devpts		${D}${sysconfdir}/default
+	install -m 0755    ${WORKDIR}/sysfs.sh		${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/populate-volatile.sh ${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/read-only-rootfs-hook.sh ${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/save-rtc.sh	${D}${sysconfdir}/init.d
+	install -m 0644    ${WORKDIR}/volatiles		${D}${sysconfdir}/default/volatiles/00_core
+	install -m 0755    ${WORKDIR}/dmesg.sh		${D}${sysconfdir}/init.d
+	install -m 0644    ${WORKDIR}/logrotate-dmesg.conf ${D}${sysconfdir}/
+
+	if [ "${TARGET_ARCH}" = "arm" ]; then
+		install -m 0755 ${WORKDIR}/alignment.sh	${D}${sysconfdir}/init.d
+	fi
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','selinux','true','false',d)}; then
+		install -d ${D}/${base_sbindir}
+		install -m 0755 ${WORKDIR}/sushell ${D}/${base_sbindir}
+	fi
+#
+# Install device dependent scripts
+#
+	install -m 0755 ${WORKDIR}/banner.sh	${D}${sysconfdir}/init.d/banner.sh
+	install -m 0755 ${WORKDIR}/umountfs	${D}${sysconfdir}/init.d/umountfs
+#
+# Create runlevel links
+#
+	update-rc.d -r ${D} rmnologin.sh start 99 2 3 4 5 .
+	update-rc.d -r ${D} sendsigs start 20 0 6 .
+	update-rc.d -r ${D} urandom start 30 S 0 6 .
+	update-rc.d -r ${D} umountnfs.sh start 31 0 1 6 .
+	update-rc.d -r ${D} umountfs start 40 0 6 .
+	update-rc.d -r ${D} reboot start 90 6 .
+	update-rc.d -r ${D} halt start 90 0 .
+	update-rc.d -r ${D} save-rtc.sh start 25 0 6 .
+	update-rc.d -r ${D} banner.sh start 02 S .
+	update-rc.d -r ${D} checkroot.sh start 06 S .
+	update-rc.d -r ${D} mountall.sh start 03 S .
+	update-rc.d -r ${D} hostname.sh start 39 S .
+	update-rc.d -r ${D} mountnfs.sh start 15 2 3 4 5 .
+	update-rc.d -r ${D} bootmisc.sh start 55 S .
+	update-rc.d -r ${D} sysfs.sh start 02 S .
+	update-rc.d -r ${D} populate-volatile.sh start 37 S .
+	update-rc.d -r ${D} read-only-rootfs-hook.sh start 29 S .
+	update-rc.d -r ${D} devpts.sh start 38 S .
+	if [ "${TARGET_ARCH}" = "arm" ]; then
+	        update-rc.d -r ${D} alignment.sh start 06 S .
+	fi
+	# We wish to have /var/log ready at this stage so execute this after
+	# populate-volatile.sh
+	update-rc.d -r ${D} dmesg.sh start 38 S .
+}
+
+MASKED_SCRIPTS = " \
+  banner \
+  bootmisc \
+  checkfs \
+  checkroot \
+  devpts \
+  dmesg \
+  hostname \
+  mountall \
+  mountnfs \
+  populate-volatile \
+  read-only-rootfs-hook \
+  rmnologin \
+  sysfs \
+  urandom"
+
+pkg_postinst_${PN} () {
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		for SERVICE in ${MASKED_SCRIPTS}; do
+			systemctl $OPTS mask $SERVICE.service
+		done
+	fi
+
+    # Delete any old volatile cache script, as directories may have moved
+    if [ -z "$D" ]; then
+        rm -f "/etc/volatile.cache"
+    fi
+}
+
+CONFFILES_${PN} += "${sysconfdir}/init.d/checkroot.sh"
diff --git a/meta/recipes-core/jpeg/jpeg_9a.bb b/meta/recipes-core/jpeg/jpeg_9a.bb
new file mode 100644
index 0000000..ea2e65d
--- /dev/null
+++ b/meta/recipes-core/jpeg/jpeg_9a.bb
@@ -0,0 +1,29 @@
+SUMMARY = "libjpeg is a library for handling the JPEG (JFIF) image format"
+DESCRIPTION = "libjpeg contains a library for handling the JPEG (JFIF) image format, as well as related programs for accessing the libjpeg functions."
+HOMEPAGE = "http://www.ijg.org/"
+
+LICENSE ="BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://README;md5=ea93a8a2fed10106b63bc21679edacb9"
+
+SECTION = "libs"
+
+SRC_URI = "http://www.ijg.org/files/jpegsrc.v${PV}.tar.gz \
+	  "
+
+SRC_URI[md5sum] = "3353992aecaee1805ef4109aadd433e7"
+SRC_URI[sha256sum] = "3a753ea48d917945dd54a2d97de388aa06ca2eb1066cbfdc6652036349fe05a7"
+
+inherit autotools
+
+PACKAGES =+ 		"jpeg-tools "
+DESCRIPTION_jpeg-tools = "The jpeg-tools package includes the client programs for access libjpeg functionality.  These tools allow for the compression, decompression, transformation and display of JPEG files."
+FILES_jpeg-tools = 	"${bindir}/*"
+
+BBCLASSEXTEND = "native"
+
+pkg_postinst_${PN}_linuxstdbase () {
+    if [ ! -e $D${libdir}/libjpeg.so.62 ]; then
+        JPEG=`find $D${libdir} -type f -name libjpeg.so.\*.\*.\*`
+        ln -sf `basename $JPEG` $D${libdir}/libjpeg.so.62
+    fi
+}
diff --git a/meta/recipes-core/kbd/kbd/0003-Only-inluclude-kernel-headers-with-glibc.patch b/meta/recipes-core/kbd/kbd/0003-Only-inluclude-kernel-headers-with-glibc.patch
new file mode 100644
index 0000000..8bfcb0c
--- /dev/null
+++ b/meta/recipes-core/kbd/kbd/0003-Only-inluclude-kernel-headers-with-glibc.patch
@@ -0,0 +1,29 @@
+From 3c5c7acc7ef874b919b26583d3892e21b907833f Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 20 Aug 2014 09:00:03 +0200
+Subject: [PATCH 3/4] Only inluclude kernel headers with glibc
+
+This fixes compile errors with musl libc
+
+Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+Upstream-Status: Pending
+---
+ src/resizecons.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/resizecons.c b/src/resizecons.c
+index 5f84845..691dfcc 100644
+--- a/src/resizecons.c
++++ b/src/resizecons.c
+@@ -80,7 +80,7 @@
+ #include <sys/ioctl.h>
+ #if (__GNU_LIBRARY__ >= 6)
+ #include <sys/perm.h>
+-#else
++#elif defined(__GLIBC__)
+ #include <linux/types.h>
+ #include <linux/termios.h>
+ #endif
+-- 
+2.1.0
+
diff --git a/meta/recipes-core/kbd/kbd/uclibc-stdarg.patch b/meta/recipes-core/kbd/kbd/uclibc-stdarg.patch
new file mode 100644
index 0000000..be7f324
--- /dev/null
+++ b/meta/recipes-core/kbd/kbd/uclibc-stdarg.patch
@@ -0,0 +1,36 @@
+In file included from keymap.h:5:0,
+                 from ksyms.c:6:
+./keymap/common.h:65:38: error: unknown type name 'va_list'
+                  const char *format, va_list args),
+                                      ^
+./keymap/common.h:66:3: error: expected ';', ',' or ')' before 'const'
+   const void *data);
+   ^
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: kbd-2.0.0/src/libkeymap/contextP.h
+===================================================================
+--- kbd-2.0.0.orig/src/libkeymap/contextP.h	2013-08-13 06:46:23.000000000 -0700
++++ kbd-2.0.0/src/libkeymap/contextP.h	2013-11-05 22:33:49.200528226 -0800
+@@ -2,7 +2,7 @@
+ #define LK_CONTEXTP_H
+ 
+ #include "keymap.h"
+-
++#include <stdarg.h>
+ /**
+  * @brief Copy of struct kbdiacruc.
+  */
+Index: kbd-2.0.0/src/libkeymap/keymap/common.h
+===================================================================
+--- kbd-2.0.0.orig/src/libkeymap/keymap/common.h	2013-08-13 06:46:23.000000000 -0700
++++ kbd-2.0.0/src/libkeymap/keymap/common.h	2013-11-05 22:33:59.964528438 -0800
+@@ -6,6 +6,7 @@
+  */
+ 
+ #include <keymap/context.h>
++#include <stdarg.h>
+ 
+ /** Initializes the structures necessary to read and/or parse keymap.
+  *
diff --git a/meta/recipes-core/kbd/kbd_2.0.2.bb b/meta/recipes-core/kbd/kbd_2.0.2.bb
new file mode 100644
index 0000000..136dc7a
--- /dev/null
+++ b/meta/recipes-core/kbd/kbd_2.0.2.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Keytable files and keyboard utilities"
+# everything minus console-fonts is GPLv2+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a5fcc36121d93e1f69d96a313078c8b5"
+DEPENDS = "libcheck"
+
+inherit autotools gettext ptest pkgconfig
+
+RREPLACES_${PN} = "console-tools"
+RPROVIDES_${PN} = "console-tools"
+RCONFLICTS_${PN} = "console-tools"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/${BPN}/${BP}.tar.xz \
+           file://uclibc-stdarg.patch \
+	   file://0003-Only-inluclude-kernel-headers-with-glibc.patch \
+          "
+
+SRC_URI[md5sum] = "87475eb78b1d6e6ab06686dd323ad4ba"
+SRC_URI[sha256sum] = "9dfddabf96012e329c4bebb96a21aeef7c3872f624e96e8156ba542b82aeb912"
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG[pam] = "--enable-vlock, --disable-vlock, libpam,"
+
+PACKAGES += "${PN}-consolefonts ${PN}-keymaps ${PN}-unimaps ${PN}-consoletrans"
+
+FILES_${PN}-consolefonts = "${datadir}/consolefonts"
+FILES_${PN}-consoletrans = "${datadir}/consoletrans"
+FILES_${PN}-keymaps = "${datadir}/keymaps"
+FILES_${PN}-unimaps = "${datadir}/unimaps"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "chvt deallocvt fgconsole openvt"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/libcgroup/libcgroup_0.41.bb b/meta/recipes-core/libcgroup/libcgroup_0.41.bb
new file mode 100644
index 0000000..52ba1d7
--- /dev/null
+++ b/meta/recipes-core/libcgroup/libcgroup_0.41.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Linux control group abstraction library"
+DESCRIPTION = "libcgroup is a library that abstracts the control group file system \
+in Linux. Control groups allow you to limit, account and isolate resource usage \
+(CPU, memory, disk I/O, etc.) of groups of processes."
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+inherit autotools pkgconfig
+
+DEPENDS = "bison-native flex-native ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/libcg/${BPN}/v0.41/${BPN}-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "3dea9d50b8a5b73ff0bf1cdcb210f63f"
+SRC_URI[sha256sum] = "e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51"
+
+EXTRA_OECONF = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes', '--enable-pam=no', d)}"
+
+PACKAGES =+ "cgroups-pam-plugin"
+FILES_cgroups-pam-plugin = "${base_libdir}/security/pam_cgroup.so*"
+FILES_${PN}-dbg += "${base_libdir}/security/.debug"
+FILES_${PN}-dev += "${base_libdir}/security/*.la"
+
+do_install_append() {
+	# Moving libcgroup to base_libdir
+	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+		mkdir -p ${D}/${base_libdir}/
+		mv -f ${D}${libdir}/libcgroup.so.* ${D}${base_libdir}/
+		rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'`
+		ln -sf ${rel_lib_prefix}${base_libdir}/libcgroup.so.1 ${D}${libdir}/libcgroup.so
+	fi
+	# pam modules in ${base_libdir}/security/ should be binary .so files, not symlinks.
+	if [ -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ]; then
+		mv -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ${D}${base_libdir}/security/pam_cgroup.so
+		rm -f ${D}${base_libdir}/security/pam_cgroup.so.*
+	fi
+}
diff --git a/meta/recipes-core/libxml/libxml2.inc b/meta/recipes-core/libxml/libxml2.inc
new file mode 100644
index 0000000..1c3c37d
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2.inc
@@ -0,0 +1,78 @@
+SUMMARY = "XML C Parser Library and Toolkit"
+DESCRIPTION = "The XML Parser Library allows for manipulation of XML files.  Libxml2 exports Push and Pull type parser interfaces for both XML and HTML.  It can do DTD validation at parse time, on a parsed document instance or with an arbitrary DTD.  Libxml2 includes complete XPath, XPointer and Xinclude implementations.  It also has a SAX like interface, which is designed to be compatible with Expat."
+HOMEPAGE = "http://www.xmlsoft.org/"
+BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml2"
+SECTION = "libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://Copyright;md5=2044417e2e5006b65a8b9067b683fcf1 \
+                    file://hash.c;beginline=6;endline=15;md5=96f7296605eae807670fb08947829969 \
+                    file://list.c;beginline=4;endline=13;md5=cdbfa3dee51c099edb04e39f762ee907 \
+                    file://trio.c;beginline=5;endline=14;md5=6c025753c86d958722ec76e94cae932e"
+
+DEPENDS =+ "zlib"
+
+SRC_URI = "ftp://xmlsoft.org/libxml2/libxml2-${PV}.tar.gz;name=libtar \
+           file://libxml-64bit.patch \
+           file://ansidecl.patch \
+           file://runtest.patch \
+           file://run-ptest \
+           file://libxml2-CVE-2014-0191-fix.patch \
+           file://python-sitepackages-dir.patch \
+           file://libxml-m4-use-pkgconfig.patch \
+           file://configure.ac-fix-cross-compiling-warning.patch \
+           file://0001-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch \
+          "
+
+BINCONFIG = "${bindir}/xml2-config"
+
+inherit autotools pkgconfig binconfig-disabled pythonnative ptest
+
+RDEPENDS_${PN}-ptest += "python-core"
+
+RDEPENDS_${PN}-python += "python-core"
+
+RDEPENDS_${PN}-ptest_append_libc-glibc += "glibc-gconv-ebcdic-us glibc-gconv-ibm1141"
+
+# We don't DEPEND on binutils for ansidecl.h so ensure we don't use the header
+do_configure_prepend () {
+	sed -i -e '/.*ansidecl.h.*/d' ${S}/configure.ac
+}
+
+export PYTHON_SITE_PACKAGES="${PYTHON_SITEPACKAGES_DIR}"
+
+PACKAGECONFIG ??= "python"
+
+PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python"
+# WARNING: zlib is require for RPM use
+EXTRA_OECONF = "--without-debug --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions"
+EXTRA_OECONF_class-native = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib"
+EXTRA_OECONF_class-nativesdk = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib"
+EXTRA_OECONF_linuxstdbase = "--with-debug --with-legacy --with-docbook --with-c14n --without-lzma --with-zlib"
+
+# required for pythong binding
+export HOST_SYS
+export BUILD_SYS
+export STAGING_LIBDIR
+export STAGING_INCDIR
+
+export LDFLAGS += "-ldl"
+
+python populate_packages_prepend () {
+    # autonamer would call this libxml2-2, but we don't want that
+    if d.getVar('DEBIAN_NAMES', True):
+        d.setVar('PKG_libxml2', '${MLPREFIX}libxml2')
+}
+
+PACKAGES += "${PN}-utils ${PN}-python"
+
+FILES_${PN}-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug"
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
+FILES_${PN}-dev += "${libdir}/xml2Conf.sh ${libdir}/cmake/*"
+FILES_${PN}-utils += "${bindir}/*"
+FILES_${PN}-python += "${PYTHON_SITEPACKAGES_DIR}"
+
+do_install_ptest () {
+  cp -r ${WORKDIR}/xmlconf ${D}${PTEST_PATH}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/libxml/libxml2/0001-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch b/meta/recipes-core/libxml/libxml2/0001-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch
new file mode 100644
index 0000000..96d58f9
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/0001-CVE-2015-1819-Enforce-the-reader-to-run-in-constant-.patch
@@ -0,0 +1,181 @@
+From 213f1fe0d76d30eaed6e5853057defc43e6df2c9 Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Tue, 14 Apr 2015 17:41:48 +0800
+Subject: [PATCH] CVE-2015-1819 Enforce the reader to run in constant memory
+
+One of the operation on the reader could resolve entities
+leading to the classic expansion issue. Make sure the
+buffer used for xmlreader operation is bounded.
+Introduce a new allocation type for the buffers for this effect.
+
+Upstream-Status: Backport
+
+Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ buf.c                 |   43 ++++++++++++++++++++++++++++++++++++++++++-
+ include/libxml/tree.h |    3 ++-
+ xmlreader.c           |   20 +++++++++++++++++++-
+ 3 files changed, 63 insertions(+), 3 deletions(-)
+
+diff --git a/buf.c b/buf.c
+index 6efc7b6..07922ff 100644
+--- a/buf.c
++++ b/buf.c
+@@ -27,6 +27,7 @@
+ #include <libxml/tree.h>
+ #include <libxml/globals.h>
+ #include <libxml/tree.h>
++#include <libxml/parserInternals.h> /* for XML_MAX_TEXT_LENGTH */
+ #include "buf.h"
+ 
+ #define WITH_BUFFER_COMPAT
+@@ -299,7 +300,8 @@ xmlBufSetAllocationScheme(xmlBufPtr buf,
+     if ((scheme == XML_BUFFER_ALLOC_DOUBLEIT) ||
+         (scheme == XML_BUFFER_ALLOC_EXACT) ||
+         (scheme == XML_BUFFER_ALLOC_HYBRID) ||
+-        (scheme == XML_BUFFER_ALLOC_IMMUTABLE)) {
++        (scheme == XML_BUFFER_ALLOC_IMMUTABLE) ||
++	(scheme == XML_BUFFER_ALLOC_BOUNDED)) {
+ 	buf->alloc = scheme;
+         if (buf->buffer)
+             buf->buffer->alloc = scheme;
+@@ -458,6 +460,18 @@ xmlBufGrowInternal(xmlBufPtr buf, size_t len) {
+     size = buf->use + len + 100;
+ #endif
+ 
++    if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
++        /*
++	 * Used to provide parsing limits
++	 */
++        if ((buf->use + len >= XML_MAX_TEXT_LENGTH) ||
++	    (buf->size >= XML_MAX_TEXT_LENGTH)) {
++	    xmlBufMemoryError(buf, "buffer error: text too long\n");
++	    return(0);
++	}
++	if (size >= XML_MAX_TEXT_LENGTH)
++	    size = XML_MAX_TEXT_LENGTH;
++    }
+     if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
+         size_t start_buf = buf->content - buf->contentIO;
+ 
+@@ -739,6 +753,15 @@ xmlBufResize(xmlBufPtr buf, size_t size)
+     CHECK_COMPAT(buf)
+ 
+     if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return(0);
++    if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
++        /*
++	 * Used to provide parsing limits
++	 */
++        if (size >= XML_MAX_TEXT_LENGTH) {
++	    xmlBufMemoryError(buf, "buffer error: text too long\n");
++	    return(0);
++	}
++    }
+ 
+     /* Don't resize if we don't have to */
+     if (size < buf->size)
+@@ -867,6 +890,15 @@ xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len) {
+ 
+     needSize = buf->use + len + 2;
+     if (needSize > buf->size){
++	if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
++	    /*
++	     * Used to provide parsing limits
++	     */
++	    if (needSize >= XML_MAX_TEXT_LENGTH) {
++		xmlBufMemoryError(buf, "buffer error: text too long\n");
++		return(-1);
++	    }
++	}
+         if (!xmlBufResize(buf, needSize)){
+ 	    xmlBufMemoryError(buf, "growing buffer");
+             return XML_ERR_NO_MEMORY;
+@@ -938,6 +970,15 @@ xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len) {
+     }
+     needSize = buf->use + len + 2;
+     if (needSize > buf->size){
++	if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
++	    /*
++	     * Used to provide parsing limits
++	     */
++	    if (needSize >= XML_MAX_TEXT_LENGTH) {
++		xmlBufMemoryError(buf, "buffer error: text too long\n");
++		return(-1);
++	    }
++	}
+         if (!xmlBufResize(buf, needSize)){
+ 	    xmlBufMemoryError(buf, "growing buffer");
+             return XML_ERR_NO_MEMORY;
+diff --git a/include/libxml/tree.h b/include/libxml/tree.h
+index 2f90717..4a9b3bc 100644
+--- a/include/libxml/tree.h
++++ b/include/libxml/tree.h
+@@ -76,7 +76,8 @@ typedef enum {
+     XML_BUFFER_ALLOC_EXACT,	/* grow only to the minimal size */
+     XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */
+     XML_BUFFER_ALLOC_IO,	/* special allocation scheme used for I/O */
+-    XML_BUFFER_ALLOC_HYBRID	/* exact up to a threshold, and doubleit thereafter */
++    XML_BUFFER_ALLOC_HYBRID,	/* exact up to a threshold, and doubleit thereafter */
++    XML_BUFFER_ALLOC_BOUNDED	/* limit the upper size of the buffer */
+ } xmlBufferAllocationScheme;
+ 
+ /**
+diff --git a/xmlreader.c b/xmlreader.c
+index f19e123..471e7e2 100644
+--- a/xmlreader.c
++++ b/xmlreader.c
+@@ -2091,6 +2091,9 @@ xmlNewTextReader(xmlParserInputBufferPtr input, const char *URI) {
+ 		"xmlNewTextReader : malloc failed\n");
+ 	return(NULL);
+     }
++    /* no operation on a reader should require a huge buffer */
++    xmlBufSetAllocationScheme(ret->buffer,
++			      XML_BUFFER_ALLOC_BOUNDED);
+     ret->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
+     if (ret->sax == NULL) {
+ 	xmlBufFree(ret->buffer);
+@@ -3616,6 +3619,7 @@ xmlTextReaderConstValue(xmlTextReaderPtr reader) {
+ 	    return(((xmlNsPtr) node)->href);
+         case XML_ATTRIBUTE_NODE:{
+ 	    xmlAttrPtr attr = (xmlAttrPtr) node;
++	    const xmlChar *ret;
+ 
+ 	    if ((attr->children != NULL) &&
+ 	        (attr->children->type == XML_TEXT_NODE) &&
+@@ -3629,10 +3633,21 @@ xmlTextReaderConstValue(xmlTextReaderPtr reader) {
+                                         "xmlTextReaderSetup : malloc failed\n");
+                         return (NULL);
+                     }
++		    xmlBufSetAllocationScheme(reader->buffer,
++		                              XML_BUFFER_ALLOC_BOUNDED);
+                 } else
+                     xmlBufEmpty(reader->buffer);
+ 	        xmlBufGetNodeContent(reader->buffer, node);
+-		return(xmlBufContent(reader->buffer));
++		ret = xmlBufContent(reader->buffer);
++		if (ret == NULL) {
++		    /* error on the buffer best to reallocate */
++		    xmlBufFree(reader->buffer);
++		    reader->buffer = xmlBufCreateSize(100);
++		    xmlBufSetAllocationScheme(reader->buffer,
++		                              XML_BUFFER_ALLOC_BOUNDED);
++		    ret = BAD_CAST "";
++		}
++		return(ret);
+ 	    }
+ 	    break;
+ 	}
+@@ -5131,6 +5146,9 @@ xmlTextReaderSetup(xmlTextReaderPtr reader,
+                         "xmlTextReaderSetup : malloc failed\n");
+         return (-1);
+     }
++    /* no operation on a reader should require a huge buffer */
++    xmlBufSetAllocationScheme(reader->buffer,
++			      XML_BUFFER_ALLOC_BOUNDED);
+     if (reader->sax == NULL)
+ 	reader->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
+     if (reader->sax == NULL) {
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-core/libxml/libxml2/0001-threads-Define-pthread-definitions-for-glibc-complia.patch b/meta/recipes-core/libxml/libxml2/0001-threads-Define-pthread-definitions-for-glibc-complia.patch
new file mode 100644
index 0000000..c653a81
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/0001-threads-Define-pthread-definitions-for-glibc-complia.patch
@@ -0,0 +1,32 @@
+From 6750cc564a17c812555cca587660240ccffaaed3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 4 Apr 2015 08:50:40 -0700
+Subject: [PATCH] threads: Define pthread* definitions for glibc compliant libs
+
+This code is assuming glibc but not explicitly saying it
+so lets make it so. Fixes following on musl
+
+threads.c:80:27: error: macro "pthread_equal" requires 2 arguments, but
+only 1 given
+|  extern int pthread_equal ()
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ threads.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: libxml2-2.9.2/threads.c
+===================================================================
+--- libxml2-2.9.2.orig/threads.c
++++ libxml2-2.9.2/threads.c
+@@ -47,7 +47,7 @@
+ #ifdef HAVE_PTHREAD_H
+ 
+ static int libxml_is_threaded = -1;
+-#ifdef __GNUC__
++#if defined(__GNUC__) && defined(__GLIBC__)
+ #ifdef linux
+ #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
+ extern int pthread_once (pthread_once_t *__once_control,
diff --git a/meta/recipes-core/libxml/libxml2/72a46a519ce7326d9a00f0b6a7f2a8e958cd1675.patch b/meta/recipes-core/libxml/libxml2/72a46a519ce7326d9a00f0b6a7f2a8e958cd1675.patch
new file mode 100644
index 0000000..10a8112
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/72a46a519ce7326d9a00f0b6a7f2a8e958cd1675.patch
@@ -0,0 +1,30 @@
+From 72a46a519ce7326d9a00f0b6a7f2a8e958cd1675 Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard@redhat.com>
+Date: Thu, 23 Oct 2014 11:35:36 +0800
+Subject: Fix missing entities after CVE-2014-3660 fix
+
+For https://bugzilla.gnome.org/show_bug.cgi?id=738805
+
+The fix for CVE-2014-3660 introduced a regression in some case
+where entity substitution is required and the entity is used
+first in anotther entity referenced from an attribute value
+
+Upstream-Status: Backport
+
+diff --git a/parser.c b/parser.c
+index 67c9dfd..a8d1b67 100644
+--- a/parser.c
++++ b/parser.c
+@@ -7235,7 +7235,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
+      * far more secure as the parser will only process data coming from
+      * the document entity by default.
+      */
+-    if ((ent->checked == 0) &&
++    if (((ent->checked == 0) ||
++         ((ent->children == NULL) && (ctxt->options & XML_PARSE_NOENT))) &&
+         ((ent->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY) ||
+          (ctxt->options & (XML_PARSE_NOENT | XML_PARSE_DTDVALID)))) {
+ 	unsigned long oldnbent = ctxt->nbentities;
+-- 
+cgit v0.10.1
+
diff --git a/meta/recipes-core/libxml/libxml2/ansidecl.patch b/meta/recipes-core/libxml/libxml2/ansidecl.patch
new file mode 100644
index 0000000..2452d78
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/ansidecl.patch
@@ -0,0 +1,25 @@
+Sadly cmake is broken. If it sees this reference and ansidecl is present, it will add a 
+dependency upon it, even if HAVE_ANSIDEC_H is never set.
+
+The easiest solution is to remove these lines, otherwise recipes like libzypp can have a 
+dependency on the ansidecl.h header via cmake. This can lead to odd results if the 
+header is removed (clean binutils) and then the code is recompiled.
+
+RP 2012/7/10
+
+Upstream-Status: Inappropriate [its really a cmake bug]
+
+Index: libxml2-2.8.0/include/libxml/xmlversion.h.in
+===================================================================
+--- libxml2-2.8.0.orig/include/libxml/xmlversion.h.in	2012-07-10 11:51:52.460750573 +0000
++++ libxml2-2.8.0/include/libxml/xmlversion.h.in	2012-07-10 11:52:41.436749397 +0000
+@@ -401,9 +401,6 @@
+ #endif
+ 
+ #ifdef __GNUC__
+-#ifdef HAVE_ANSIDECL_H
+-#include <ansidecl.h>
+-#endif
+ 
+ /**
+  * ATTRIBUTE_UNUSED:
diff --git a/meta/recipes-core/libxml/libxml2/configure.ac-fix-cross-compiling-warning.patch b/meta/recipes-core/libxml/libxml2/configure.ac-fix-cross-compiling-warning.patch
new file mode 100644
index 0000000..2f8079b
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/configure.ac-fix-cross-compiling-warning.patch
@@ -0,0 +1,45 @@
+configure.ac: fix cross compiling warning
+
+There is a warning while cross compiling which triggered a
+failure by do_qa_configure
+...
+|configure:12652: checking for gzread in -lz
+|configure:12677: mips-poky-linux-gcc  -meb -mabi=32 -mhard-float
+ -L/lib conftest.c -lz   >&5
+|ld: warning: library search path "/lib" is unsafe for cross-compilation
+...
+
+While do the lib checking, do not add '-L${Z_DIR}/lib' to LDFLAGS could fix it.
+
+Upstream-Status: Inappropriate [oe specific]
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9a90600..0bac8a4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -391,8 +391,6 @@ if test "$with_zlib" = "no"; then
+     echo "Disabling compression support"
+ else
+     AC_CHECK_HEADERS(zlib.h,
+-        [SAVE_LDFLAGS="${LDFLAGS}"
+-	 LDFLAGS="-L${Z_DIR}/lib"
+ 	AC_CHECK_LIB(z, gzread,[
+ 	    AC_DEFINE([HAVE_LIBZ], [1], [Have compression library])
+ 	    WITH_ZLIB=1
+@@ -406,8 +404,7 @@ else
+ 		esac]
+ 	    else
+ 		Z_LIBS="-lz"
+-	    fi])
+-	 LDFLAGS="${SAVE_LDFLAGS}"])
++	    fi]))
+ fi
+ 
+ AC_SUBST(Z_CFLAGS)
+-- 
+1.9.1
+
diff --git a/meta/recipes-core/libxml/libxml2/libxml-64bit.patch b/meta/recipes-core/libxml/libxml2/libxml-64bit.patch
new file mode 100644
index 0000000..1147017
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/libxml-64bit.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Backport [from debian: bugs.debian.org/439843]
+
+---
+ libxml.h |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- libxml2-2.6.29.orig/libxml.h
++++ libxml2-2.6.29/libxml.h
+@@ -11,10 +11,13 @@
+ 
+ #ifndef NO_LARGEFILE_SOURCE
+ #ifndef _LARGEFILE_SOURCE
+ #define _LARGEFILE_SOURCE
+ #endif
++#ifndef _LARGEFILE64_SOURCE
++#define _LARGEFILE64_SOURCE
++#endif
+ #ifndef _FILE_OFFSET_BITS
+ #define _FILE_OFFSET_BITS 64
+ #endif
+ #endif
+ 
diff --git a/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch b/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch
new file mode 100644
index 0000000..0fc8407
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/libxml-m4-use-pkgconfig.patch
@@ -0,0 +1,204 @@
+AM_PATH_XML2 uses xml-config which we disable through
+binconfig-disabled.bbclass, so port it to use pkg-config instead.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/libxml.m4 b/libxml.m4
+index 68cd824..5fa0a9b 100644
+--- a/libxml.m4
++++ b/libxml.m4
+@@ -1,188 +1,12 @@
+-# Configure paths for LIBXML2
+-# Mike Hommey 2004-06-19
+-# use CPPFLAGS instead of CFLAGS
+-# Toshio Kuratomi 2001-04-21
+-# Adapted from:
+-# Configure paths for GLIB
+-# Owen Taylor     97-11-3
+-
+ dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+ dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
+ dnl
+-AC_DEFUN([AM_PATH_XML2],[ 
+-AC_ARG_WITH(xml-prefix,
+-            [  --with-xml-prefix=PFX   Prefix where libxml is installed (optional)],
+-            xml_config_prefix="$withval", xml_config_prefix="")
+-AC_ARG_WITH(xml-exec-prefix,
+-            [  --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
+-            xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
+-AC_ARG_ENABLE(xmltest,
+-              [  --disable-xmltest       Do not try to compile and run a test LIBXML program],,
+-              enable_xmltest=yes)
+-
+-  if test x$xml_config_exec_prefix != x ; then
+-     xml_config_args="$xml_config_args"
+-     if test x${XML2_CONFIG+set} != xset ; then
+-        XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
+-     fi
+-  fi
+-  if test x$xml_config_prefix != x ; then
+-     xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
+-     if test x${XML2_CONFIG+set} != xset ; then
+-        XML2_CONFIG=$xml_config_prefix/bin/xml2-config
+-     fi
+-  fi
+-
+-  AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
+-  min_xml_version=ifelse([$1], ,2.0.0,[$1])
+-  AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
+-  no_xml=""
+-  if test "$XML2_CONFIG" = "no" ; then
+-    no_xml=yes
+-  else
+-    XML_CPPFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
+-    XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
+-    xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
+-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+-    xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
+-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+-    xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
+-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+-    if test "x$enable_xmltest" = "xyes" ; then
+-      ac_save_CPPFLAGS="$CPPFLAGS"
+-      ac_save_LIBS="$LIBS"
+-      CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
+-      LIBS="$XML_LIBS $LIBS"
+-dnl
+-dnl Now check if the installed libxml is sufficiently new.
+-dnl (Also sanity checks the results of xml2-config to some extent)
+-dnl
+-      rm -f conf.xmltest
+-      AC_TRY_RUN([
+-#include <stdlib.h>
+-#include <stdio.h>
+-#include <string.h>
+-#include <libxml/xmlversion.h>
+-
+-int 
+-main()
+-{
+-  int xml_major_version, xml_minor_version, xml_micro_version;
+-  int major, minor, micro;
+-  char *tmp_version;
+-
+-  system("touch conf.xmltest");
+-
+-  /* Capture xml2-config output via autoconf/configure variables */
+-  /* HP/UX 9 (%@#!) writes to sscanf strings */
+-  tmp_version = (char *)strdup("$min_xml_version");
+-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+-     printf("%s, bad version string from xml2-config\n", "$min_xml_version");
+-     exit(1);
+-   }
+-   free(tmp_version);
+-
+-   /* Capture the version information from the header files */
+-   tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
+-   if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
+-     printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
+-     exit(1);
+-   }
+-   free(tmp_version);
+-
+- /* Compare xml2-config output to the libxml headers */
+-  if ((xml_major_version != $xml_config_major_version) ||
+-      (xml_minor_version != $xml_config_minor_version) ||
+-      (xml_micro_version != $xml_config_micro_version))
+-    {
+-      printf("*** libxml header files (version %d.%d.%d) do not match\n",
+-         xml_major_version, xml_minor_version, xml_micro_version);
+-      printf("*** xml2-config (version %d.%d.%d)\n",
+-         $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
+-      return 1;
+-    } 
+-/* Compare the headers to the library to make sure we match */
+-  /* Less than ideal -- doesn't provide us with return value feedback, 
+-   * only exits if there's a serious mismatch between header and library.
+-   */
+-    LIBXML_TEST_VERSION;
+-
+-    /* Test that the library is greater than our minimum version */
+-    if ((xml_major_version > major) ||
+-        ((xml_major_version == major) && (xml_minor_version > minor)) ||
+-        ((xml_major_version == major) && (xml_minor_version == minor) &&
+-        (xml_micro_version >= micro)))
+-      {
+-        return 0;
+-       }
+-     else
+-      {
+-        printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
+-               xml_major_version, xml_minor_version, xml_micro_version);
+-        printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
+-           major, minor, micro);
+-        printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
+-        printf("***\n");
+-        printf("*** If you have already installed a sufficiently new version, this error\n");
+-        printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
+-        printf("*** being found. The easiest way to fix this is to remove the old version\n");
+-        printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
+-        printf("*** correct copy of xml2-config. (In this case, you will have to\n");
+-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+-        printf("*** so that the correct libraries are found at run-time))\n");
+-    }
+-  return 1;
+-}
+-],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+-       CPPFLAGS="$ac_save_CPPFLAGS"
+-       LIBS="$ac_save_LIBS"
+-     fi
+-  fi
++AC_DEFUN([AM_PATH_XML2],[
++  AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ 
+-  if test "x$no_xml" = x ; then
+-     AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
+-     ifelse([$2], , :, [$2])     
+-  else
+-     AC_MSG_RESULT(no)
+-     if test "$XML2_CONFIG" = "no" ; then
+-       echo "*** The xml2-config script installed by LIBXML could not be found"
+-       echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
+-       echo "*** your path, or set the XML2_CONFIG environment variable to the"
+-       echo "*** full path to xml2-config."
+-     else
+-       if test -f conf.xmltest ; then
+-        :
+-       else
+-          echo "*** Could not run libxml test program, checking why..."
+-          CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
+-          LIBS="$LIBS $XML_LIBS"
+-          AC_TRY_LINK([
+-#include <libxml/xmlversion.h>
+-#include <stdio.h>
+-],      [ LIBXML_TEST_VERSION; return 0;],
+-        [ echo "*** The test program compiled, but did not run. This usually means"
+-          echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
+-          echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
+-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+-          echo "*** is required on your system"
+-          echo "***"
+-          echo "*** If you have an old version installed, it is best to remove it, although"
+-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
+-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+-          echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
+-          echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
+-          echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
+-          CPPFLAGS="$ac_save_CPPFLAGS"
+-          LIBS="$ac_save_LIBS"
+-       fi
+-     fi
++  verdep=ifelse([$1], [], [], [>= $1])
++  PKG_CHECK_MODULES(XML, [libxml-2.0 $verdep], [$2], [$3])
+ 
+-     XML_CPPFLAGS=""
+-     XML_LIBS=""
+-     ifelse([$3], , :, [$3])
+-  fi
++  XML_CPPFLAGS=$XML_CFLAGS
+   AC_SUBST(XML_CPPFLAGS)
+-  AC_SUBST(XML_LIBS)
+-  rm -f conf.xmltest
+ ])
diff --git a/meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch b/meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch
new file mode 100644
index 0000000..1c05ae6
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/libxml2-CVE-2014-0191-fix.patch
@@ -0,0 +1,37 @@
+From: Daniel Veillard <veillard@redhat.com>
+Date: Tue, 22 Apr 2014 15:30:56 +0800
+Subject: Do not fetch external parameter entities
+
+Unless explicitely asked for when validating or replacing entities
+with their value. Problem pointed out by Daniel Berrange <berrange@redhat.com>
+
+Upstream-Status: Backport
+Reference: https://access.redhat.com/security/cve/CVE-2014-0191
+
+Signed-off-by: Daniel Veillard <veillard@redhat.com>
+Signed-off-by: Maxin B. John <maxin.john@enea.com>
+---
+diff -Naur libxml2-2.9.1-orig/parser.c libxml2-2.9.1/parser.c
+--- libxml2-2.9.1-orig/parser.c	2013-04-16 15:39:18.000000000 +0200
++++ libxml2-2.9.1/parser.c	2014-05-07 13:35:46.883687946 +0200
+@@ -2595,6 +2595,20 @@
+ 		    xmlCharEncoding enc;
+ 
+ 		    /*
++		     * Note: external parsed entities will not be loaded, it is
++		     * not required for a non-validating parser, unless the
++		     * option of validating, or substituting entities were
++		     * given. Doing so is far more secure as the parser will
++		     * only process data coming from the document entity by
++		     * default.
++		     */
++                    if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
++		        ((ctxt->options & XML_PARSE_NOENT) == 0) &&
++			((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
++			(ctxt->validate == 0))
++			return;
++
++		    /*
+ 		     * handle the extra spaces added before and after
+ 		     * c.f. http://www.w3.org/TR/REC-xml#as-PE
+ 		     * this is done independently.
diff --git a/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch b/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch
new file mode 100644
index 0000000..e83c832
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/python-sitepackages-dir.patch
@@ -0,0 +1,30 @@
+Allow us to pass in PYTHON_SITE_PACKAGES
+
+The python binary used when building for nativesdk doesn't give us the
+correct path here so we need to be able to specify it ourselves.
+
+Upstream-Status: Inappropriate [config]
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebase to 2.9.2
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -813,7 +813,8 @@ dnl
+ 
+ PYTHON_VERSION=
+ PYTHON_INCLUDES=
+-PYTHON_SITE_PACKAGES=
++# Allow this to be set externally
++#PYTHON_SITE_PACKAGES=
+ PYTHON_TESTS=
+ pythondir=
+ if test "$with_python" != "no" ; then
+-- 
+1.9.1
+
diff --git a/meta/recipes-core/libxml/libxml2/run-ptest b/meta/recipes-core/libxml/libxml2/run-ptest
new file mode 100644
index 0000000..473d0b6
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -k runtests
diff --git a/meta/recipes-core/libxml/libxml2/runtest.patch b/meta/recipes-core/libxml/libxml2/runtest.patch
new file mode 100644
index 0000000..397ab20
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2/runtest.patch
@@ -0,0 +1,820 @@
+Add 'install-ptest' rule.
+Print a standard result line for each test.
+
+Signed-off-by: Mihaela Sendrea <mihaela.sendrea@enea.com>
+Upstream-Status: Pending
+
+diff -uNr a/Makefile.am b/Makefile.am
+--- a/Makefile.am	2013-04-17 14:51:42.633386477 +0200
++++ b/Makefile.am	2013-04-19 14:47:51.544720568 +0200
+@@ -202,10 +202,19 @@
+ #testOOM_DEPENDENCIES = $(DEPS)
+ #testOOM_LDADD= $(LDADDS)
+ 
++install-ptest:
++	@(if [ -d .libs ] ; then cd .libs; fi; \
++	install $(noinst_PROGRAMS) $(DESTDIR))
++	cp -r $(srcdir)/test $(DESTDIR)
++	cp -r $(srcdir)/result $(DESTDIR)
++	cp -r $(srcdir)/python $(DESTDIR)
++	cp Makefile $(DESTDIR)
++	sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
++
+ runtests:
+ 	[ -d test   ] || $(LN_S) $(srcdir)/test   .
+ 	[ -d result ] || $(LN_S) $(srcdir)/result .
+-	$(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
++	./runtest$(EXEEXT) ; ./testrecurse$(EXEEXT) ; ./testapi$(EXEEXT) ; ./testchar$(EXEEXT) ; ./testdict$(EXEEXT) ; ./runxmlconf$(EXEEXT)
+ 	@(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
+ 	    $(MAKE) tests ; fi)
+ 
+diff -uNr a/runsuite.c b/runsuite.c
+--- a/runsuite.c	2013-04-12 16:17:11.462823238 +0200
++++ b/runsuite.c	2013-04-17 14:07:24.352693211 +0200
+@@ -1162,6 +1162,7 @@
+ 
+     if (logfile != NULL)
+         fclose(logfile);
++    printf("%s: runsuite\n\n", (ret == 0) ? "PASS" : "FAIL");
+     return(ret);
+ }
+ #else /* !SCHEMAS */
+diff -uNr a/runtest.c b/runtest.c
+--- a/runtest.c	2013-04-16 13:19:15.087997290 +0200
++++ b/runtest.c	2013-04-17 14:08:29.529949655 +0200
+@@ -4386,6 +4386,7 @@
+ 	    err++;
+ 	}
+     }
++    printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
+     return(err);
+ }
+ 
+@@ -4455,6 +4456,7 @@
+     xmlCleanupParser();
+     xmlMemoryDump();
+ 
++    printf("%s: runtest\n\n", (ret == 0) ? "PASS" : "FAIL");
+     return(ret);
+ }
+ 
+diff -uNr a/runxmlconf.c b/runxmlconf.c
+--- a/runxmlconf.c	2013-04-16 12:53:49.900982990 +0200
++++ b/runxmlconf.c	2013-04-17 14:09:21.111778104 +0200
+@@ -595,6 +595,7 @@
+ 
+     if (logfile != NULL)
+         fclose(logfile);
++    printf("%s: runxmlconf\n", (ret == 0) ? "PASS" : "FAIL");
+     return(ret);
+ }
+ 
+diff -uNr a/testapi.c b/testapi.c
+--- a/testapi.c	2013-04-12 16:16:57.763417659 +0200
++++ b/testapi.c	2013-04-17 14:10:28.876924881 +0200
+@@ -1245,49 +1245,91 @@
+ testlibxml2(void)
+ {
+     int test_ret = 0;
++    int ret = 0;
+ 
+-    test_ret += test_HTMLparser();
+-    test_ret += test_HTMLtree();
+-    test_ret += test_SAX2();
+-    test_ret += test_c14n();
+-    test_ret += test_catalog();
+-    test_ret += test_chvalid();
+-    test_ret += test_debugXML();
+-    test_ret += test_dict();
+-    test_ret += test_encoding();
+-    test_ret += test_entities();
+-    test_ret += test_hash();
+-    test_ret += test_list();
+-    test_ret += test_nanoftp();
+-    test_ret += test_nanohttp();
+-    test_ret += test_parser();
+-    test_ret += test_parserInternals();
+-    test_ret += test_pattern();
+-    test_ret += test_relaxng();
+-    test_ret += test_schemasInternals();
+-    test_ret += test_schematron();
+-    test_ret += test_tree();
+-    test_ret += test_uri();
+-    test_ret += test_valid();
+-    test_ret += test_xinclude();
+-    test_ret += test_xmlIO();
+-    test_ret += test_xmlautomata();
+-    test_ret += test_xmlerror();
+-    test_ret += test_xmlmodule();
+-    test_ret += test_xmlreader();
+-    test_ret += test_xmlregexp();
+-    test_ret += test_xmlsave();
+-    test_ret += test_xmlschemas();
+-    test_ret += test_xmlschemastypes();
+-    test_ret += test_xmlstring();
+-    test_ret += test_xmlunicode();
+-    test_ret += test_xmlwriter();
+-    test_ret += test_xpath();
+-    test_ret += test_xpathInternals();
+-    test_ret += test_xpointer();
++    test_ret += (ret = test_HTMLparser());
++    printf("%s: HTMLparser\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_HTMLtree());
++    printf("%s: HTMLtree\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_SAX2());
++    printf("%s: SAX2\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_c14n());
++    printf("%s: c14n\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_catalog());
++    printf("%s: catalog\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_chvalid());
++    printf("%s: chvalid\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_debugXML());
++    printf("%s: debugXML\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_dict());
++    printf("%s: dict\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_encoding());
++    printf("%s: encoding\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_entities());
++    printf("%s: entities\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_hash());
++    printf("%s: hash\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_list());
++    printf("%s: list\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_nanoftp());
++    printf("%s: nanoftp\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_nanohttp());
++    printf("%s: nanohttp\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_parser());
++    printf("%s: parser\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_parserInternals());
++    printf("%s: parserInternals\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_pattern());
++    printf("%s: pattern\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_relaxng());
++    printf("%s: relaxng\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_schemasInternals());
++    printf("%s: schemasInternals\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_schematron());
++    printf("%s: schematron\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_tree());
++    printf("%s: tree\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_uri());
++    printf("%s: uri\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_valid());
++    printf("%s: valid\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xinclude());
++    printf("%s: xinclude\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlIO());
++    printf("%s: xmlIO\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlautomata());
++    printf("%s: xmlautomata\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlerror());
++    printf("%s: xmlerror\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlmodule());
++    printf("%s: xmlmodule\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlreader());
++    printf("%s: xmlreader\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlregexp());
++    printf("%s: xmlregexp\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlsave());
++    printf("%s: xmlsave\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlschemas());
++    printf("%s: xmlschemas\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlschemastypes());
++    printf("%s: xmlschemastypes\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlstring());
++    printf("%s: xmlstring\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlunicode());
++    printf("%s: xmlunicode\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xmlwriter());
++    printf("%s: xmlwriter\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xpath());
++    printf("%s: xpath\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xpathInternals());
++    printf("%s: xpathInternals\n", (ret == 0) ? "PASS" : "FAIL");
++    test_ret += (ret = test_xpointer());
++    printf("%s: xpointer\n", (ret == 0) ? "PASS" : "FAIL");
+ 
+     printf("Total: %d functions, %d tests, %d errors\n",
+            function_tests, call_tests, test_ret);
++
++    printf("%s: testapi\n\n", (test_ret == 0) ? "PASS" : "FAIL");
+     return(test_ret);
+ }
+ 
+diff -uNr a/testchar.c b/testchar.c
+--- a/testchar.c	2013-04-17 10:50:30.250147418 +0200
++++ b/testchar.c	2013-04-18 16:11:28.455733800 +0200
+@@ -23,7 +23,7 @@
+ char document1[100] = "<doc>XXXX</doc>";
+ char document2[100] = "<doc foo='XXXX'/>";
+ 
+-static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
++static int testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
+                   int len,  char *data, int forbid1, int forbid2) {
+     int i;
+     xmlDocPtr res;
+@@ -37,33 +37,41 @@
+ 	res = xmlReadMemory(document, len, "test", NULL, 0);
+ 
+ 	if ((i == forbid1) || (i == forbid2)) {
+-	    if ((lastError == 0) || (res != NULL))
++	    if ((lastError == 0) || (res != NULL)) {
+ 	        fprintf(stderr,
+ 		    "Failed to detect invalid char for Byte 0x%02X: %c\n",
+ 		        i, i);
++		return(1);
++		}
+ 	}
+ 
+ 	else if ((i == '<') || (i == '&')) {
+-	    if ((lastError == 0) || (res != NULL))
++	    if ((lastError == 0) || (res != NULL)) {
+ 	        fprintf(stderr,
+ 		    "Failed to detect illegal char %c for Byte 0x%02X\n", i, i);
++			return(1);
++		}
+ 	}
+ 	else if (((i < 0x20) || (i >= 0x80)) &&
+ 	    (i != 0x9) && (i != 0xA) && (i != 0xD)) {
+-	    if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL))
++	    if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL)) {
+ 	        fprintf(stderr,
+ 		    "Failed to detect invalid char for Byte 0x%02X\n", i);
++			return(1);
++		}
+ 	}
+ 	else if (res == NULL) {
+ 	    fprintf(stderr,
+ 		"Failed to parse valid char for Byte 0x%02X : %c\n", i, i);
++		return(1);
+ 	}
+ 	if (res != NULL)
+ 	    xmlFreeDoc(res);
+     }
++	return(0);
+ }
+ 
+-static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
++static int testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
+                   int len,  char *data) {
+     int i, j;
+     xmlDocPtr res;
+@@ -80,10 +88,12 @@
+ 
+ 	/* if first bit of first char is set, then second bit must too */
+ 	if ((i & 0x80) && ((i & 0x40) == 0)) {
+-	    if ((lastError == 0) || (res != NULL))
++	    if ((lastError == 0) || (res != NULL)) {
+ 		fprintf(stderr,
+ 		"Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ 			i, j);
++		return(1);
++		}
+ 	}
+ 
+ 	/*
+@@ -91,10 +101,12 @@
+ 	 * bits must be 10
+ 	 */
+ 	else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
+-	    if ((lastError == 0) || (res != NULL))
++	    if ((lastError == 0) || (res != NULL)) {
+ 		fprintf(stderr,
+ 	    "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ 			i, j);
++		return(1);
++		}
+ 	}
+ 
+ 	/*
+@@ -102,10 +114,12 @@
+ 	 * than 0x80, i.e. one of bits 5 to 1 of i must be set
+ 	 */
+ 	else if ((i & 0x80) && ((i & 0x1E) == 0)) {
+-	    if ((lastError == 0) || (res != NULL))
++	    if ((lastError == 0) || (res != NULL)) {
+ 		fprintf(stderr,
+ 	    "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ 			i, j);
++		return(1);
++		}
+ 	}
+ 
+ 	/*
+@@ -113,10 +127,12 @@
+ 	 * at least 3 bytes, but we give only 2 !
+ 	 */
+ 	else if ((i & 0xE0) == 0xE0) {
+-	    if ((lastError == 0) || (res != NULL))
++	    if ((lastError == 0) || (res != NULL)) {
+ 		fprintf(stderr,
+ 	    "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
+ 			i, j);
++		return(1);
++		}
+ 	}
+ 
+ 	/*
+@@ -125,11 +141,13 @@
+ 	else if ((lastError != 0) || (res == NULL)) {
+ 	    fprintf(stderr,
+ 		"Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j);
++		return(1);
+ 	}
+ 	if (res != NULL)
+ 	    xmlFreeDoc(res);
+     }
+     }
++	return(0);
+ }
+ 
+ /**
+@@ -141,9 +159,10 @@
+  * CDATA in text or in attribute values.
+  */
+ 
+-static void testDocumentRanges(void) {
++static int testDocumentRanges(void) {
+     xmlParserCtxtPtr ctxt;
+     char *data;
++    int test_ret = 0;
+ 
+     /*
+      * Set up a parsing context using the first document as
+@@ -152,7 +171,7 @@
+     ctxt = xmlNewParserCtxt();
+     if (ctxt == NULL) {
+         fprintf(stderr, "Failed to allocate parser context\n");
+-	return;
++	return(1);
+     }
+ 
+     printf("testing 1 byte char in document: 1");
+@@ -163,7 +182,7 @@
+     data[2] = ' ';
+     data[3] = ' ';
+     /* test 1 byte injection at beginning of area */
+-    testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
++    test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
+                            data, -1, -1);
+     printf(" 2");
+     fflush(stdout);
+@@ -172,7 +191,7 @@
+     data[2] = ' ';
+     data[3] = ' ';
+     /* test 1 byte injection at end of area */
+-    testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
++    test_ret += testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
+                            data + 3, -1, -1);
+ 
+     printf(" 3");
+@@ -183,7 +202,7 @@
+     data[2] = ' ';
+     data[3] = ' ';
+     /* test 1 byte injection at beginning of area */
+-    testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
++    test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
+                            data, '\'', -1);
+     printf(" 4");
+     fflush(stdout);
+@@ -192,7 +211,7 @@
+     data[2] = ' ';
+     data[3] = ' ';
+     /* test 1 byte injection at end of area */
+-    testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
++    test_ret += testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
+                            data + 3, '\'', -1);
+     printf(" done\n");
+ 
+@@ -204,7 +223,7 @@
+     data[2] = ' ';
+     data[3] = ' ';
+     /* test 2 byte injection at beginning of area */
+-    testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
++    test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
+                            data);
+     printf(" 2");
+     fflush(stdout);
+@@ -213,7 +232,7 @@
+     data[2] = ' ';
+     data[3] = ' ';
+     /* test 2 byte injection at end of area */
+-    testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
++    test_ret += testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
+                            data + 2);
+ 
+     printf(" 3");
+@@ -224,7 +243,7 @@
+     data[2] = ' ';
+     data[3] = ' ';
+     /* test 2 byte injection at beginning of area */
+-    testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
++    test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
+                            data);
+     printf(" 4");
+     fflush(stdout);
+@@ -233,14 +252,15 @@
+     data[2] = ' ';
+     data[3] = ' ';
+     /* test 2 byte injection at end of area */
+-    testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
++    test_ret += testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
+                            data + 2);
+     printf(" done\n");
+ 
+     xmlFreeParserCtxt(ctxt);
++    return(test_ret);
+ }
+ 
+-static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
+     int i = 0;
+     int len, c;
+ 
+@@ -255,19 +275,25 @@
+         c = xmlCurrentChar(ctxt, &len);
+ 	if ((i == 0) || (i >= 0x80)) {
+ 	    /* we must see an error there */
+-	    if (lastError != XML_ERR_INVALID_CHAR)
++	    if (lastError != XML_ERR_INVALID_CHAR) {
+ 	        fprintf(stderr,
+ 		    "Failed to detect invalid char for Byte 0x%02X\n", i);
++			return(1);
++		}
+ 	} else if (i == 0xD) {
+-	    if ((c != 0xA) || (len != 1))
++	    if ((c != 0xA) || (len != 1)) {
+ 		fprintf(stderr, "Failed to convert char for Byte 0x%02X\n", i);
++		return(1);
++		}
+ 	} else if ((c != i) || (len != 1)) {
+ 	    fprintf(stderr, "Failed to parse char for Byte 0x%02X\n", i);
++		return(1);
+ 	}
+     }
++	return(0);
+ }
+ 
+-static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
+     int i, j;
+     int len, c;
+ 
+@@ -284,10 +310,12 @@
+ 
+ 	    /* if first bit of first char is set, then second bit must too */
+ 	    if ((i & 0x80) && ((i & 0x40) == 0)) {
+-		if (lastError != XML_ERR_INVALID_CHAR)
++		if (lastError != XML_ERR_INVALID_CHAR) {
+ 		    fprintf(stderr,
+ 		    "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ 		            i, j);
++			return(1);
++			}
+ 	    }
+ 
+ 	    /*
+@@ -295,10 +323,12 @@
+ 	     * bits must be 10
+ 	     */
+ 	    else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
+-		if (lastError != XML_ERR_INVALID_CHAR)
++		if (lastError != XML_ERR_INVALID_CHAR) {
+ 		    fprintf(stderr,
+ 		"Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
+ 		            i, j, c);
++			return(1);
++			}
+ 	    }
+ 
+ 	    /*
+@@ -306,10 +336,12 @@
+ 	     * than 0x80, i.e. one of bits 5 to 1 of i must be set
+ 	     */
+ 	    else if ((i & 0x80) && ((i & 0x1E) == 0)) {
+-		if (lastError != XML_ERR_INVALID_CHAR)
++		if (lastError != XML_ERR_INVALID_CHAR) {
+ 		    fprintf(stderr,
+ 		"Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
+ 		            i, j, c);
++			return(1);
++			}
+ 	    }
+ 
+ 	    /*
+@@ -317,10 +349,12 @@
+ 	     * at least 3 bytes, but we give only 2 !
+ 	     */
+ 	    else if ((i & 0xE0) == 0xE0) {
+-		if (lastError != XML_ERR_INVALID_CHAR)
++		if (lastError != XML_ERR_INVALID_CHAR) {
+ 		    fprintf(stderr,
+ 		"Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
+ 		            i, j);
++			return(1);
++			}
+ 	    }
+ 
+             /*
+@@ -329,6 +363,7 @@
+ 	    else if ((lastError != 0) || (len != 2)) {
+ 		fprintf(stderr,
+ 		    "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j);
++		return(1);
+ 	    }
+ 
+             /*
+@@ -338,12 +373,14 @@
+ 		fprintf(stderr,
+ 	"Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n",
+ 	                i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c);
++		return(1);
+ 	    }
+         }
+     }
++	return(0);
+ }
+ 
+-static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
+     int i, j, k, K;
+     int len, c;
+     unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
+@@ -368,20 +405,24 @@
+ 	 * at least 4 bytes, but we give only 3 !
+ 	 */
+ 	if ((i & 0xF0) == 0xF0) {
+-	    if (lastError != XML_ERR_INVALID_CHAR)
++	    if (lastError != XML_ERR_INVALID_CHAR) {
+ 		fprintf(stderr,
+ 	"Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ 			i, j, K, data[3]);
++		return(1);
++		}
+ 	}
+ 
+         /*
+ 	 * The second and the third bytes must start with 10
+ 	 */
+ 	else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80)) {
+-	    if (lastError != XML_ERR_INVALID_CHAR)
++	    if (lastError != XML_ERR_INVALID_CHAR) {
+ 		fprintf(stderr,
+ 	"Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ 			i, j, K);
++		return(1);
++		}
+ 	}
+ 
+ 	/*
+@@ -390,10 +431,12 @@
+ 	 * the 6th byte of data[1] must be set
+ 	 */
+ 	else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) {
+-	    if (lastError != XML_ERR_INVALID_CHAR)
++	    if (lastError != XML_ERR_INVALID_CHAR) {
+ 		fprintf(stderr,
+ 	    "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ 			i, j, K);
++		return(1);
++		}
+ 	}
+ 
+         /*
+@@ -401,10 +444,12 @@
+ 	 */
+ 	else if (((value > 0xD7FF) && (value <0xE000)) ||
+ 	         ((value > 0xFFFD) && (value <0x10000))) {
+-	    if (lastError != XML_ERR_INVALID_CHAR)
++	    if (lastError != XML_ERR_INVALID_CHAR) {
+ 		fprintf(stderr,
+ 	"Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X\n",
+ 			value, i, j, K);
++		return(1);
++		}
+ 	}
+ 
+ 	/*
+@@ -414,6 +459,7 @@
+ 	    fprintf(stderr,
+ 		"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ 		    i, j, K);
++		return(1);
+ 	}
+ 
+ 	/*
+@@ -423,13 +469,15 @@
+ 	    fprintf(stderr,
+     "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
+ 		i, j, data[2], value, c);
++		return(1);
+ 	}
+     }
+     }
+     }
++	return(0);
+ }
+ 
+-static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
++static int testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
+     int i, j, k, K, l, L;
+     int len, c;
+     unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
+@@ -458,10 +506,12 @@
+ 	 * at least 5 bytes, but we give only 4 !
+ 	 */
+ 	if ((i & 0xF8) == 0xF8) {
+-	    if (lastError != XML_ERR_INVALID_CHAR)
++	    if (lastError != XML_ERR_INVALID_CHAR) {
+ 		fprintf(stderr,
+   "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ 			i, j, K, data[3]);
++		return(1);
++		}
+ 	}
+ 
+         /*
+@@ -469,10 +519,12 @@
+ 	 */
+ 	else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) ||
+ 	         ((L & 0xC0) != 0x80)) {
+-	    if (lastError != XML_ERR_INVALID_CHAR)
++	    if (lastError != XML_ERR_INVALID_CHAR) {
+ 		fprintf(stderr,
+ 	"Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ 			i, j, K, L);
++		return(1);
++		}
+ 	}
+ 
+ 	/*
+@@ -481,10 +533,12 @@
+ 	 * the 6 or 5th byte of j must be set
+ 	 */
+ 	else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) {
+-	    if (lastError != XML_ERR_INVALID_CHAR)
++	    if (lastError != XML_ERR_INVALID_CHAR) {
+ 		fprintf(stderr,
+ 	"Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ 			i, j, K, L);
++		return(1);
++		}
+ 	}
+ 
+         /*
+@@ -493,10 +547,12 @@
+ 	else if (((value > 0xD7FF) && (value <0xE000)) ||
+ 	         ((value > 0xFFFD) && (value <0x10000)) ||
+ 		 (value > 0x10FFFF)) {
+-	    if (lastError != XML_ERR_INVALID_CHAR)
++	    if (lastError != XML_ERR_INVALID_CHAR) {
+ 		fprintf(stderr,
+ "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ 			value, i, j, K, L);
++		return(1);
++		}
+ 	}
+ 
+ 	/*
+@@ -506,6 +562,7 @@
+ 	    fprintf(stderr,
+ 		"Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ 		    i, j, K);
++		return(1);
+ 	}
+ 
+ 	/*
+@@ -515,11 +572,13 @@
+ 	    fprintf(stderr,
+     "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
+ 		i, j, data[2], value, c);
++		return(1);
+ 	}
+     }
+     }
+     }
+     }
++	return(0);
+ }
+ 
+ /**
+@@ -530,11 +589,12 @@
+  * cover the full range of UTF-8 chars accepted by XML-1.0
+  */
+ 
+-static void testCharRanges(void) {
++static int testCharRanges(void) {
+     char data[5];
+     xmlParserCtxtPtr ctxt;
+     xmlParserInputBufferPtr buf;
+     xmlParserInputPtr input;
++    int test_ret = 0;
+ 
+     memset(data, 0, 5);
+ 
+@@ -545,17 +605,19 @@
+     ctxt = xmlNewParserCtxt();
+     if (ctxt == NULL) {
+         fprintf(stderr, "Failed to allocate parser context\n");
+-	return;
++	return(1);
+     }
+     buf = xmlParserInputBufferCreateStatic(data, sizeof(data),
+                                            XML_CHAR_ENCODING_NONE);
+     if (buf == NULL) {
+         fprintf(stderr, "Failed to allocate input buffer\n");
++        test_ret = 1;
+ 	goto error;
+     }
+     input = xmlNewInputStream(ctxt);
+     if (input == NULL) {
+         xmlFreeParserInputBuffer(buf);
++        test_ret = 1;
+ 	goto error;
+     }
+     input->filename = NULL;
+@@ -567,25 +629,28 @@
+ 
+     printf("testing char range: 1");
+     fflush(stdout);
+-    testCharRangeByte1(ctxt, data);
++    test_ret += testCharRangeByte1(ctxt, data);
+     printf(" 2");
+     fflush(stdout);
+-    testCharRangeByte2(ctxt, data);
++    test_ret += testCharRangeByte2(ctxt, data);
+     printf(" 3");
+     fflush(stdout);
+-    testCharRangeByte3(ctxt, data);
++    test_ret += testCharRangeByte3(ctxt, data);
+     printf(" 4");
+     fflush(stdout);
+-    testCharRangeByte4(ctxt, data);
++    test_ret += testCharRangeByte4(ctxt, data);
+     printf(" done\n");
+     fflush(stdout);
+ 
+ error:
+     xmlFreeParserCtxt(ctxt);
++    return(test_ret);
+ }
+ 
+ int main(void) {
+ 
++    int ret = 0;
++
+     /*
+      * this initialize the library and check potential ABI mismatches
+      * between the version it was compiled for and the actual shared
+@@ -602,8 +667,9 @@
+     /*
+      * Run the tests
+      */
+-    testCharRanges();
+-    testDocumentRanges();
++    ret += testCharRanges();
++    ret += testDocumentRanges();
++    printf("%s: testchar\n\n", (ret == 0) ? "PASS" : "FAIL");
+ 
+     /*
+      * Cleanup function for the XML library.
+diff -uNr a/testdict.c b/testdict.c
+--- a/testdict.c	2013-04-16 15:08:42.971177193 +0200
++++ b/testdict.c	2013-04-18 15:59:00.699482439 +0200
+@@ -440,5 +440,6 @@
+     clean_strings();
+     xmlCleanupParser();
+     xmlMemoryDump();
++    printf("%s: testdict\n\n", (ret == 0) ? "PASS" : "FAIL");
+     return(ret);
+ }
+diff -uNr a/testlimits.c b/testlimits.c
+--- a/testlimits.c	2013-04-12 16:16:36.180354177 +0200
++++ b/testlimits.c	2013-04-17 14:03:17.203092987 +0200
+@@ -1630,5 +1630,6 @@
+     xmlCleanupParser();
+     xmlMemoryDump();
+ 
++    printf("%s: testlimits\n", (ret == 0) ? "PASS" : "FAIL");
+     return(ret);
+ }
+diff -uNr a/testrecurse.c b/testrecurse.c
+--- a/testrecurse.c	2013-04-16 13:19:49.366536295 +0200
++++ b/testrecurse.c	2013-04-17 14:06:27.367091622 +0200
+@@ -892,6 +892,7 @@
+ 	    err++;
+ 	}
+     }
++    printf("%s: %s\n", (err == 0) ? "PASS" : "FAIL", tst->desc);
+     return(err);
+ }
+ 
+@@ -961,5 +962,6 @@
+     xmlCleanupParser();
+     xmlMemoryDump();
+ 
++    printf("%s: testrecurse\n\n", (ret == 0) ? "PASS" : "FAIL");
+     return(ret);
+ }
diff --git a/meta/recipes-core/libxml/libxml2_2.9.2.bb b/meta/recipes-core/libxml/libxml2_2.9.2.bb
new file mode 100644
index 0000000..79a395c
--- /dev/null
+++ b/meta/recipes-core/libxml/libxml2_2.9.2.bb
@@ -0,0 +1,11 @@
+require libxml2.inc
+
+SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar.gz;name=testtar \
+            file://72a46a519ce7326d9a00f0b6a7f2a8e958cd1675.patch \
+	    file://0001-threads-Define-pthread-definitions-for-glibc-complia.patch \
+	   "
+
+SRC_URI[libtar.md5sum] = "9e6a9aca9d155737868b3dc5fd82f788"
+SRC_URI[libtar.sha256sum] = "5178c30b151d044aefb1b08bf54c3003a0ac55c59c866763997529d60770d5bc"
+SRC_URI[testtar.md5sum] = "ae3d1ebe000a3972afa104ca7f0e1b4a"
+SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7"
diff --git a/meta/recipes-core/meta/buildtools-tarball.bb b/meta/recipes-core/meta/buildtools-tarball.bb
new file mode 100644
index 0000000..840434c
--- /dev/null
+++ b/meta/recipes-core/meta/buildtools-tarball.bb
@@ -0,0 +1,59 @@
+DESCRIPTION = "SDK type target for building a standalone tarball containing python, chrpath, make, git and tar. The \
+               tarball can be used to run bitbake builds on systems which don't meet the usual version requirements."
+SUMMARY = "Standalone tarball for running builds on systems with inadequate software"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+TOOLCHAIN_TARGET_TASK ?= ""
+
+TOOLCHAIN_HOST_TASK ?= "\
+    nativesdk-python-core \
+    nativesdk-python-modules \
+    nativesdk-python-misc \
+    nativesdk-python-git \
+    nativesdk-python-pexpect \
+    nativesdk-ncurses-terminfo-base \
+    nativesdk-chrpath \
+    nativesdk-tar \
+    nativesdk-buildtools-perl-dummy \
+    nativesdk-git \
+    nativesdk-git-perltools \
+    nativesdk-pigz \
+    nativesdk-make \
+    nativesdk-wget \
+    nativesdk-ca-certificates \
+    "
+
+SDK_PACKAGE_ARCHS =+ "buildtools-dummy-${SDKPKGSUFFIX}"
+
+TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-buildtools-nativesdk-standalone-${DISTRO_VERSION}"
+
+SDK_TITLE = "Build tools"
+
+RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit meta
+inherit populate_sdk
+inherit toolchain-scripts
+
+create_sdk_files_append () {
+	rm -f ${SDK_OUTPUT}/${SDKPATH}/site-config-*
+	rm -f ${SDK_OUTPUT}/${SDKPATH}/environment-setup-*
+	rm -f ${SDK_OUTPUT}/${SDKPATH}/version-*
+
+	# Generate new (mini) sdk-environment-setup file
+	script=${1:-${SDK_OUTPUT}/${SDKPATH}/environment-setup-${SDK_SYS}}
+	touch $script
+	echo 'export PATH=${SDKPATHNATIVE}${bindir_nativesdk}:$PATH' >> $script
+	# In order for the self-extraction script to correctly extract and set up things,
+	# we need a 'OECORE_NATIVE_SYSROOT=xxx' line in environment setup script.
+	# However, buildtools-tarball is inherently a tool set instead of a fully functional SDK,
+	# so instead of exporting the variable, we use a comment here.
+	echo '#OECORE_NATIVE_SYSROOT="${SDKPATHNATIVE}"' >> $script
+	toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${SDK_SYS}
+
+	echo 'export GIT_SSL_CAINFO="${SDKPATHNATIVE}${sysconfdir}/ssl/certs/ca-certificates.crt"' >>$script
+}
diff --git a/meta/recipes-core/meta/meta-environment-extsdk.bb b/meta/recipes-core/meta/meta-environment-extsdk.bb
new file mode 100644
index 0000000..d9e5961
--- /dev/null
+++ b/meta/recipes-core/meta/meta-environment-extsdk.bb
@@ -0,0 +1,12 @@
+# meta-environment for extensible SDK
+
+require meta-environment.bb
+
+PN = "meta-environment-extsdk-${MACHINE}"
+
+create_sdk_files_append() {
+	local sysroot=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_TARGET', True), d.getVar('TOPDIR', True))}
+	local sdkpathnative=${SDKPATH}/${@os.path.relpath(d.getVar('STAGING_DIR_NATIVE',True), d.getVar('TOPDIR', True))}
+
+	toolchain_create_sdk_env_script '' '' $sysroot '' ${bindir_native} ${prefix_native} $sdkpathnative
+}
diff --git a/meta/recipes-core/meta/meta-environment.bb b/meta/recipes-core/meta/meta-environment.bb
new file mode 100644
index 0000000..49d45f6
--- /dev/null
+++ b/meta/recipes-core/meta/meta-environment.bb
@@ -0,0 +1,75 @@
+SUMMARY = "Package of environment files for SDK"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LICENSE = "MIT"
+PR = "r8"
+
+EXCLUDE_FROM_WORLD = "1"
+
+MODIFYTOS = "0"
+
+REAL_MULTIMACH_TARGET_SYS = "${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
+
+inherit toolchain-scripts
+TOOLCHAIN_NEED_CONFIGSITE_CACHE_append = " zlib"
+
+SDK_DIR = "${WORKDIR}/sdk"
+SDK_OUTPUT = "${SDK_DIR}/image"
+SDKTARGETSYSROOT = "${SDKPATH}/sysroots/${REAL_MULTIMACH_TARGET_SYS}"
+
+inherit cross-canadian
+
+do_generate_content[cleandirs] = "${SDK_OUTPUT}"
+do_generate_content[dirs] = "${SDK_OUTPUT}/${SDKPATH}"
+python do_generate_content() {
+    # Handle multilibs in the SDK environment, siteconfig, etc files...
+    localdata = bb.data.createCopy(d)
+
+    # make sure we only use the WORKDIR value from 'd', or it can change
+    localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
+
+    # make sure we only use the SDKTARGETSYSROOT value from 'd'
+    localdata.setVar('SDKTARGETSYSROOT', d.getVar('SDKTARGETSYSROOT', True))
+    localdata.setVar('libdir', d.getVar('target_libdir', False))
+
+    # Process DEFAULTTUNE
+    bb.build.exec_func("create_sdk_files", localdata)
+
+    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
+    for item in variants.split():
+        # Load overrides from 'd' to avoid having to reset the value...
+        overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
+        localdata.setVar("OVERRIDES", overrides)
+        localdata.setVar("MLPREFIX", item + "-")
+        bb.data.update_data(localdata)
+        bb.build.exec_func("create_sdk_files", localdata)
+}
+addtask generate_content before do_install after do_compile
+
+create_sdk_files() {
+	# Setup site file for external use
+	toolchain_create_sdk_siteconfig ${SDK_OUTPUT}/${SDKPATH}/site-config-${REAL_MULTIMACH_TARGET_SYS}
+
+	toolchain_create_sdk_env_script ${SDK_OUTPUT}/${SDKPATH}/environment-setup-${REAL_MULTIMACH_TARGET_SYS}
+
+	# Add version information
+	toolchain_create_sdk_version ${SDK_OUTPUT}/${SDKPATH}/version-${REAL_MULTIMACH_TARGET_SYS}
+}
+
+do_install() {
+    install -d ${D}/${SDKPATH}
+    install -m 0644 -t ${D}/${SDKPATH} ${SDK_OUTPUT}/${SDKPATH}/*
+}
+
+PN = "meta-environment-${MACHINE}"
+PACKAGES = "${PN}"
+FILES_${PN}= " \
+    ${SDKPATH}/* \
+    "
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_populate_sysroot[noexec] = "1"
diff --git a/meta/recipes-core/meta/meta-ide-support.bb b/meta/recipes-core/meta/meta-ide-support.bb
new file mode 100644
index 0000000..2f92912
--- /dev/null
+++ b/meta/recipes-core/meta/meta-ide-support.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Integrated Development Environment support"
+DESCRIPTION = "Meta package for ensuring the build directory contains all appropriate toolchain packages for using an IDE"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+DEPENDS = "virtual/libc gdb-cross-${TARGET_ARCH} qemu-native qemu-helper-native unfs3-native"
+PR = "r3"
+
+inherit meta toolchain-scripts
+
+do_populate_ide_support () {
+  toolchain_create_tree_env_script
+}
+
+do_populate_ide_support[nostamp] = "1"
+addtask populate_ide_support before do_build after do_install
diff --git a/meta/recipes-core/meta/meta-toolchain.bb b/meta/recipes-core/meta/meta-toolchain.bb
new file mode 100644
index 0000000..ba9fd88
--- /dev/null
+++ b/meta/recipes-core/meta/meta-toolchain.bb
@@ -0,0 +1,9 @@
+SUMMARY = "Meta package for building a installable toolchain"
+LICENSE = "MIT"
+
+PR = "r7"
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+inherit populate_sdk
diff --git a/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb b/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
new file mode 100644
index 0000000..d971c3c
--- /dev/null
+++ b/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Dummy package which ensures perl is excluded from buildtools"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+inherit nativesdk
+
+# Put it somewhere separate to ensure it's never used except when we want it
+PACKAGE_ARCH = "buildtools-dummy-${SDKPKGSUFFIX}"
+
+PERLPACKAGES = "nativesdk-perl \
+                nativesdk-perl-module-file-path"
+
+ALLOW_EMPTY_${PN} = "1"
+
+python populate_packages_prepend() {
+    d.appendVar('RPROVIDES_${PN}', '${PERLPACKAGES}')
+    d.appendVar('RCONFLICTS_${PN}', '${PERLPACKAGES}')
+}
+
diff --git a/meta/recipes-core/meta/package-index.bb b/meta/recipes-core/meta/package-index.bb
new file mode 100644
index 0000000..3c46b49
--- /dev/null
+++ b/meta/recipes-core/meta/package-index.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Rebuilds the package index"
+LICENSE = "MIT"
+
+INHIBIT_DEFAULT_DEPS = "1"
+PACKAGES = ""
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_install[noexec] = "1"
+do_package[noexec] = "1"
+do_packagedata[noexec] = "1"
+do_package_write_ipk[noexec] = "1"
+do_package_write_rpm[noexec] = "1"
+do_package_write_deb[noexec] = "1"
+do_populate_sysroot[noexec] = "1"
+
+do_package_index[nostamp] = "1"
+do_package_index[depends] += "${PACKAGEINDEXDEPS}"
+
+python do_package_index() {
+    from oe.rootfs import generate_index_files
+    generate_index_files(d)
+}
+addtask do_package_index before do_build
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-core/meta/uninative-tarball.bb b/meta/recipes-core/meta/uninative-tarball.bb
new file mode 100644
index 0000000..41f7927
--- /dev/null
+++ b/meta/recipes-core/meta/uninative-tarball.bb
@@ -0,0 +1,50 @@
+SUMMARY = "libc and patchelf tarball for use with uninative.bbclass"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+TOOLCHAIN_TARGET_TASK = ""
+
+TOOLCHAIN_HOST_TASK = "\
+    nativesdk-glibc \
+    nativesdk-patchelf \
+    "
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+TOOLCHAIN_OUTPUTNAME ?= "${BUILD_ARCH}-nativesdk-libc"
+
+RDEPENDS = "${TOOLCHAIN_HOST_TASK}"
+
+EXCLUDE_FROM_WORLD = "1"
+
+inherit meta
+inherit populate_sdk
+
+deltask install
+deltask package
+deltask packagedata
+
+SDK_DEPENDS += "patchelf-native"
+
+SDK_PACKAGING_FUNC = ""
+
+fakeroot create_sdk_files() {
+	cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
+
+	# Replace the ##DEFAULT_INSTALL_DIR## with the correct pattern.
+	# Escape special characters like '+' and '.' in the SDKPATH
+	escaped_sdkpath=$(echo ${SDKPATH}/sysroots/${SDK_SYS} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
+	sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
+}
+
+
+fakeroot tar_sdk() {
+	mkdir -p ${SDK_DEPLOY}
+	cd ${SDK_OUTPUT}/${SDKPATH}
+	mv sysroots/${SDK_SYS} ./${BUILD_SYS}
+	rm sysroots -rf
+	patchelf --set-interpreter ${@''.join('a' for n in xrange(1024))} ./${BUILD_SYS}/usr/bin/patchelf
+	mv ./${BUILD_SYS}/usr/bin/patchelf ./${BUILD_SYS}/usr/bin/patchelf-uninative
+	tar ${SDKTAROPTS} -c -j --file=${SDK_DEPLOY}/${TOOLCHAIN_OUTPUTNAME}.tar.bz2 .
+}
diff --git a/meta/recipes-core/ncurses/ncurses-5.9/config.cache b/meta/recipes-core/ncurses/ncurses-5.9/config.cache
new file mode 100644
index 0000000..6a9217d
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses-5.9/config.cache
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+cf_cv_func_nanosleep=yes
+cf_cv_func_mkstemp=yes
diff --git a/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch b/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch
new file mode 100644
index 0000000..cba89d2
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses-5.9/tic-hang.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Inappropriate [configuration]
+
+'tic' of some linux distributions (e.g. fedora 11) hang in an infinite
+loop when processing the original file.
+
+Index: ncurses-5.7/misc/terminfo.src
+===================================================================
+--- ncurses-5.7.orig/misc/terminfo.src
++++ ncurses-5.7/misc/terminfo.src
+@@ -3706,12 +3706,11 @@ konsole-xf3x|KDE console window with key
+ # The value for kbs reflects local customization rather than the settings used
+ # for XFree86 xterm.
+ konsole-xf4x|KDE console window with keyboard for XFree86 4.x xterm,
+-	kend=\EOF, khome=\EOH, use=konsole+pcfkeys,
+-	use=konsole-vt100,
+-# Konsole does not implement shifted cursor-keys.
+-konsole+pcfkeys|konsole subset of xterm+pcfkeys,
+-	kLFT@, kRIT@, kcbt=\E[Z, kind@, kri@, kDN@, kUP@, use=xterm+pcc2,
+-	use=xterm+pcf0,
++	kend=\EOF, kf1=\EOP, kf13=\EO2P, kf14=\EO2Q, kf15=\EO2R,
++	kf16=\EO2S, kf17=\E[15;2~, kf18=\E[17;2~, kf19=\E[18;2~,
++	kf2=\EOQ, kf20=\E[19;2~, kf21=\E[20;2~, kf22=\E[21;2~,
++	kf23=\E[23;2~, kf24=\E[24;2~, kf3=\EOR, kf4=\EOS,
++	khome=\EOH, use=konsole-vt100,
+ # KDE's "vt100" keyboard has no relationship to any terminal that DEC made, but
+ # it is still useful for deriving the other entries.
+ konsole-vt100|KDE console window with vt100 (sic) keyboard,
diff --git a/meta/recipes-core/ncurses/ncurses.inc b/meta/recipes-core/ncurses/ncurses.inc
new file mode 100644
index 0000000..ffd80ee
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses.inc
@@ -0,0 +1,306 @@
+SUMMARY = "The New Curses library"
+DESCRIPTION = "SVr4 and XSI-Curses compatible curses library and terminfo tools including tic, infocmp, captoinfo. Supports color, multiple highlights, forms-drawing characters, and automatic recognition of keypad and function-key sequences. Extensions include resizable windows and mouse support on both xterm and Linux console using the gpm library."
+HOMEPAGE = "http://www.gnu.org/software/ncurses/ncurses.html"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://ncurses/base/version.c;beginline=1;endline=27;md5=cbc180a8c44ca642e97c35452fab5f66"
+SECTION = "libs"
+DEPENDS = "ncurses-native"
+DEPENDS_class-native = ""
+INC_PR = "r15"
+
+BINCONFIG = "${bindir}/ncurses-config"
+
+inherit autotools binconfig-disabled multilib_header pkgconfig
+
+# Upstream has useful patches at times at ftp://invisible-island.net/ncurses/
+SRC_URI = "ftp://invisible-island.net/${BPN}/current/${BP}-${REVISION}.tgz"
+
+EXTRA_AUTORECONF = "-I m4"
+CONFIG_SITE =+ "${WORKDIR}/config.cache"
+
+# Whether to enable separate widec libraries; must be 'true' or 'false'
+#
+# TODO: remove this variable when widec is supported in every setup?
+ENABLE_WIDEC ?= "true"
+
+# _GNU_SOURCE is required for widec stuff and is detected automatically
+# for target objects.  But it must be set manually for native and sdk
+# builds.
+BUILD_CPPFLAGS += "-D_GNU_SOURCE"
+
+# natives don't generally look in base_libdir
+base_libdir_class-native = "${libdir}"
+
+# Display corruption occurs on 64 bit hosts without these settings
+# This was derrived from the upstream debian ncurses which uses
+# these settings for 32 and 64 bit hosts.
+EXCONFIG_ARGS = ""
+EXCONFIG_ARGS_class-native = " \
+		--disable-lp64 \
+		--with-chtype='long' \
+		--with-mmask-t='long'"
+EXCONFIG_ARGS_class-nativesdk = " \
+		--disable-lp64 \
+		--with-chtype='long' \
+		--with-mmask-t='long'"
+
+PACKAGES_DYNAMIC = "^${PN}-lib.*"
+
+# Fall back to the host termcap / terminfo for -nativesdk and -native
+# The reality is a work around for strange problems with things like
+# "bitbake -c menuconfig busybox" where it cannot find the terminfo
+# because the sstate had a hard coded search path.  Until this is fixed
+# another way this is deemed good enough.
+EX_TERMCAP = ""
+EX_TERMCAP_class-native = ":/etc/termcap:/usr/share/misc/termcap"
+EX_TERMCAP_class-nativesdk = ":/etc/termcap:/usr/share/misc/termcap"
+EX_TERMINFO = ""
+EX_TERMINFO_class-native = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
+EX_TERMINFO_class-nativesdk = ":/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo"
+
+# Helper function for do_configure to allow multiple configurations
+# $1 the directory to run configure in
+# $@ the arguments to pass to configure
+ncurses_configure() {
+	mkdir -p $1
+	cd $1
+	shift
+	oe_runconf \
+	        --disable-static \
+	        --without-debug \
+	        --without-ada \
+	        --without-gpm \
+	        --enable-hard-tabs \
+	        --enable-xmc-glitch \
+	        --enable-colorfgbg \
+	        --with-termpath='${sysconfdir}/termcap:${datadir}/misc/termcap${EX_TERMCAP}' \
+	        --with-terminfo-dirs='${sysconfdir}/terminfo:${datadir}/terminfo${EX_TERMINFO}' \
+	        --with-shared \
+	        --disable-big-core \
+	        --program-prefix= \
+	        --with-ticlib \
+	        --with-termlib=tinfo \
+	        --enable-sigwinch \
+	        --enable-pc-files \
+	        --disable-rpath-hack \
+		${EXCONFIG_ARGS} \
+	        --with-manpage-format=normal \
+	        "$@" || return 1
+	cd ..
+}
+
+# Override the function from the autotools class; ncurses requires a
+# patched autoconf213 to generate the configure script. This autoconf
+# is not available so that the shipped script will be used.
+do_configure() {
+        # check does not work with cross-compiling and is generally
+        # broken because it requires stdin to be pollable (which is
+        # not the case for /dev/null redirections)
+        export cf_cv_working_poll=yes
+	#Remove ${includedir} from CPPFLAGS, need for cross compile
+	sed -i 's#-I${cf_includedir}##g' ${S}/configure || die "sed CPPFLAGS"
+
+	# The --enable-pc-files requires PKG_CONFIG_LIBDIR existed
+	mkdir -p ${PKG_CONFIG_LIBDIR}
+	( cd ${S}; gnu-configize --force )
+	ncurses_configure "narrowc" || \
+		return 1
+	! ${ENABLE_WIDEC} || \
+		ncurses_configure "widec" "--enable-widec" "--without-progs"
+
+}
+
+do_compile() {
+        oe_runmake -C narrowc libs
+        oe_runmake -C narrowc/progs
+
+        ! ${ENABLE_WIDEC} || \
+            oe_runmake -C widec libs
+}
+
+# set of expected differences between narrowc and widec header
+#
+# TODO: the NCURSES_CH_T difference can cause real problems :(
+_unifdef_cleanup = " \
+  -e '\!/\* \$Id: curses.wide,v!,\!/\* \$Id: curses.tail,v!d' \
+  -e '/^#define NCURSES_CH_T /d' \
+  -e '/^#include <wchar.h>/d' \
+  -e '\!^/\* .* \*/!d' \
+"
+
+do_test[depends] = "unifdef-native:do_populate_sysroot"
+do_test[dirs] = "${S}"
+do_test() {
+        ${ENABLE_WIDEC} || return 0
+
+        # make sure that the narrow and widec header are compatible
+        # and differ only in minor details.
+        unifdef -k narrowc/include/curses.h | \
+            sed ${_unifdef_cleanup} > curses-narrowc.h
+        unifdef -k widec/include/curses.h | \
+            sed ${_unifdef_cleanup} > curses-widec.h
+
+        diff curses-narrowc.h curses-widec.h
+}
+
+# Split original _install_opts to two parts.
+# One is the options to install contents, the other is the parameters \
+# when running command "make install"
+_install_opts = "\
+  install.libs install.includes install.man \
+"
+_install_cfgs = "\
+  DESTDIR='${D}' \
+  PKG_CONFIG_LIBDIR='${libdir}/pkgconfig' \
+"
+
+do_install() {
+        # Order of installation is important; widec installs a 'curses.h'
+        # header with more definitions and must be installed last hence.
+        # Compatibility of these headers will be checked in 'do_test()'.
+        oe_runmake -C narrowc ${_install_cfgs} ${_install_opts} \
+                install.progs
+
+        # The install.data should run after install.libs, otherwise
+        # there would be a race issue in a very critical conditon, since
+        # tic will be run by install.data, and tic needs libtinfo.so
+        # which would be regenerated by install.libs.
+        oe_runmake -C narrowc ${_install_cfgs} \
+                install.data
+
+
+        ! ${ENABLE_WIDEC} || \
+            oe_runmake -C widec ${_install_cfgs} ${_install_opts}
+
+        cd narrowc
+
+        # include some basic terminfo files
+        # stolen ;) from gentoo and modified a bit
+        for x in ansi console dumb linux rxvt screen screen-256color sun vt52 vt100 vt102 vt200 vt220 xterm-color xterm-xfree86 xterm-256color
+        do
+                local termfile="$(find "${D}${datadir}/terminfo/" -name "${x}" 2>/dev/null)"
+                local basedir="$(basename $(dirname "${termfile}"))"
+
+                if [ -n "${termfile}" ]
+                then
+                        install -d ${D}${sysconfdir}/terminfo/${basedir}
+                        mv ${termfile} ${D}${sysconfdir}/terminfo/${basedir}/
+                        ln -s /etc/terminfo/${basedir}/${x} \
+                                ${D}${datadir}/terminfo/${basedir}/${x}
+                fi
+        done
+        # i think we can use xterm-color as default xterm
+        if [ -e ${D}${sysconfdir}/terminfo/x/xterm-color ]
+        then
+                ln -sf xterm-color ${D}${sysconfdir}/terminfo/x/xterm
+        fi
+
+        rm -f ${D}${libdir}/terminfo
+
+        # create linker scripts for libcurses.so and libncurses to
+        # link against -ltinfo when needed. Some builds might break
+        # else when '-Wl,--no-copy-dt-needed-entries' has been set in
+        # linker flags.
+        for i in libncurses libncursesw; do
+                f=${D}${libdir}/$i.so
+                test -h $f || continue
+                rm -f $f
+                echo '/* GNU ld script */'  >$f
+                echo "INPUT($i.so.5 AS_NEEDED(-ltinfo))" >>$f
+        done
+
+        # Make sure that libcurses is linked so that it gets -ltinfo
+        # also, this should be addressed upstream really.
+        ln -sf libncurses.so ${D}${libdir}/libcurses.so
+
+        # create libtermcap.so linker script for backward compatibility
+        f=${D}${libdir}/libtermcap.so
+        echo '/* GNU ld script */' >$f
+        echo 'INPUT(AS_NEEDED(-ltinfo))' >>$f
+
+        if [ ! -d "${D}${base_libdir}" ]; then
+            # Setting base_libdir to libdir as is done in the -native
+            # case will skip this code
+            mkdir ${D}${base_libdir}
+            mv ${D}${libdir}/libncurses.so.* ${D}${base_libdir}
+            ! ${ENABLE_WIDEC} || \
+                mv ${D}${libdir}/libncursesw.so.* ${D}${base_libdir}
+
+            mv ${D}${libdir}/libtinfo.so.* ${D}${base_libdir}
+            rm ${D}${libdir}/libtinfo.so
+
+            # Use lnr to ensure this is a relative link despite absolute paths
+            # (as we can't know the relationship between base_libdir and libdir).
+            # At some point we can rely on coreutils 8.16 which has ln -r.
+            lnr ${D}${base_libdir}/libtinfo.so.5 ${D}${libdir}/libtinfo.so
+        fi
+        if [ -d "${D}${includedir}/ncurses" ]; then
+            for f in `find ${D}${includedir}/ncurses -name "*.h"`
+            do
+	        f=`basename $f`
+	        test -e ${D}${includedir}/$f && continue
+                ln -sf ncurses/$f ${D}${includedir}/$f
+            done
+        fi
+        oe_multilib_header curses.h
+}
+
+python populate_packages_prepend () {
+    libdir = d.expand("${libdir}")
+    base_libdir = d.expand("${base_libdir}")
+    pnbase = d.expand("${PN}-lib%s")
+    do_split_packages(d, libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
+    if libdir is not base_libdir:
+        do_split_packages(d, base_libdir, '^lib(.*)\.so\..*', pnbase, 'ncurses %s library', prepend=True, extra_depends = '', allow_links=True)
+}
+
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_ncurses-tools_class-target = "clear reset"
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGES += " \
+  ${PN}-tools \
+  ${PN}-terminfo \
+  ${PN}-terminfo-base \
+"
+
+FILES_${PN} = "\
+  ${bindir}/tput \
+  ${bindir}/tset \
+  ${bindir}/ncurses5-config \
+  ${bindir}/ncursesw5-config \
+  ${datadir}/tabset \
+"
+
+# This keeps only tput/tset in ncurses
+# clear/reset are in already busybox
+FILES_${PN}-tools = "\
+  ${bindir}/tic \
+  ${bindir}/toe \
+  ${bindir}/infotocap \
+  ${bindir}/captoinfo \
+  ${bindir}/infocmp \
+  ${bindir}/clear${@['', '.${BPN\x7d']['${CLASSOVERRIDE}' == 'class-target']} \
+  ${bindir}/reset${@['', '.${BPN\x7d']['${CLASSOVERRIDE}' == 'class-target']} \
+  ${bindir}/tack \
+  ${bindir}/tabs \
+"
+
+# 'reset' is a symlink to 'tset' which is in the 'ncurses' package
+RDEPENDS_${PN}-tools = "${PN}"
+
+FILES_${PN}-terminfo = "\
+  ${datadir}/terminfo \
+"
+
+FILES_${PN}-terminfo-base = "\
+  ${sysconfdir}/terminfo \
+"
+
+RSUGGESTS_${PN}-libtinfo = "${PN}-terminfo"
+RRECOMMENDS_${PN}-libtinfo = "${PN}-terminfo-base"
diff --git a/meta/recipes-core/ncurses/ncurses_5.9.bb b/meta/recipes-core/ncurses/ncurses_5.9.bb
new file mode 100644
index 0000000..54d27a9
--- /dev/null
+++ b/meta/recipes-core/ncurses/ncurses_5.9.bb
@@ -0,0 +1,12 @@
+require ncurses.inc
+
+REVISION = "20150329"
+
+PR = "${INC_PR}.1"
+
+SRC_URI += "file://tic-hang.patch \
+            file://config.cache \
+"
+S = "${WORKDIR}/${BP}-${REVISION}"
+SRC_URI[md5sum] = "cee991d09e69e60ebedef424804c52d4"
+SRC_URI[sha256sum] = "5b64f40e4dce73e3aa83d15bd9257c6eff8790ec41150f0938bd87c0eb75828f"
diff --git a/meta/recipes-core/ncurses/site_config/headers b/meta/recipes-core/ncurses/site_config/headers
new file mode 100644
index 0000000..087b7bf
--- /dev/null
+++ b/meta/recipes-core/ncurses/site_config/headers
@@ -0,0 +1,5 @@
+curses.h
+ncurses/curses.h
+ncurses.h
+ncurses/termcap.h
+
diff --git a/meta/recipes-core/netbase/netbase/hosts b/meta/recipes-core/netbase/netbase/hosts
new file mode 100644
index 0000000..2f33245
--- /dev/null
+++ b/meta/recipes-core/netbase/netbase/hosts
@@ -0,0 +1,2 @@
+127.0.0.1	localhost.localdomain		localhost
+
diff --git a/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch b/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
new file mode 100644
index 0000000..35ce21e
--- /dev/null
+++ b/meta/recipes-core/netbase/netbase/netbase-add-rpcbind-as-an-alias-to-sunrpc.patch
@@ -0,0 +1,44 @@
+netbase: add rpcbind as an alias to sunrpc
+
+the patch comes from:
+https://bugs.archlinux.org/task/20273
+
+Upstream-Status: Pending
+
+Signed-off-by: Li Wang <li.wang@windriver.com>
+---
+ etc-rpc      |    2 +-
+ etc-services |    4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/etc-rpc b/etc-rpc
+index 1b30625..9a9a81a 100644
+--- a/etc-rpc
++++ b/etc-rpc
+@@ -1,7 +1,7 @@
+ # This file contains user readable names that can be used in place of rpc
+ # program numbers.
+ 
+-portmapper	100000	portmap sunrpc
++portmapper	100000	portmap sunrpc rpcbind
+ rstatd		100001	rstat rstat_svc rup perfmeter
+ rusersd		100002	rusers
+ nfs		100003	nfsprog
+diff --git a/etc-services b/etc-services
+index 9d64a52..a19f7c8 100644
+--- a/etc-services
++++ b/etc-services
+@@ -72,8 +72,8 @@ pop2		109/tcp		postoffice pop-2 # POP version 2
+ pop2		109/udp		pop-2
+ pop3		110/tcp		pop-3		# POP version 3
+ pop3		110/udp		pop-3
+-sunrpc		111/tcp		portmapper	# RPC 4.0 portmapper
+-sunrpc		111/udp		portmapper
++sunrpc		111/tcp		portmapper rpcbind	# RPC 4.0 portmapper
++sunrpc		111/udp		portmapper rpcbind
+ auth		113/tcp		authentication tap ident
+ sftp		115/tcp
+ uucp-path	117/tcp
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-core/netbase/netbase_5.3.bb b/meta/recipes-core/netbase/netbase_5.3.bb
new file mode 100644
index 0000000..ccd89ff
--- /dev/null
+++ b/meta/recipes-core/netbase/netbase_5.3.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Basic TCP/IP networking support"
+DESCRIPTION = "This package provides the necessary infrastructure for basic TCP/IP based networking"
+HOMEPAGE = "http://packages.debian.org/netbase"
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=3dd6192d306f582dee7687da3d8748ab"
+PE = "1"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/n/netbase/netbase_${PV}.tar.xz \
+           file://netbase-add-rpcbind-as-an-alias-to-sunrpc.patch \
+           file://hosts"
+
+SRC_URI[md5sum] = "2637a27fd3de02a278d2b5be7e6558c1"
+SRC_URI[sha256sum] = "81f6c69795044d62b8ad959cf9daf049d0545fd466c52860ad3f933b1e97b88b"
+
+do_install () {
+	install -d ${D}/${mandir}/man8 ${D}${sysconfdir}
+	install -m 0644 ${WORKDIR}/hosts ${D}${sysconfdir}/hosts
+	install -m 0644 etc-rpc ${D}${sysconfdir}/rpc
+	install -m 0644 etc-protocols ${D}${sysconfdir}/protocols
+	install -m 0644 etc-services ${D}${sysconfdir}/services
+}
+
+CONFFILES_${PN} = "${sysconfdir}/hosts"
diff --git a/meta/recipes-core/os-release/os-release.bb b/meta/recipes-core/os-release/os-release.bb
new file mode 100644
index 0000000..cc431d2
--- /dev/null
+++ b/meta/recipes-core/os-release/os-release.bb
@@ -0,0 +1,49 @@
+inherit allarch
+
+SUMMARY = "Operating system identification"
+DESCRIPTION = "The /etc/os-release file contains operating system identification data."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+
+# Other valid fields: BUILD_ID ID_LIKE ANSI_COLOR CPE_NAME
+#                     HOME_URL SUPPORT_URL BUG_REPORT_URL
+OS_RELEASE_FIELDS = "ID ID_LIKE NAME VERSION VERSION_ID PRETTY_NAME"
+
+ID = "${DISTRO}"
+NAME = "${DISTRO_NAME}"
+VERSION = "${DISTRO_VERSION}${@' (%s)' % DISTRO_CODENAME if 'DISTRO_CODENAME' in d else ''}"
+VERSION_ID = "${DISTRO_VERSION}"
+PRETTY_NAME = "${DISTRO_NAME} ${VERSION}"
+BUILD_ID ?= "${DATETIME}"
+BUILD_ID[vardepsexclude] = "DATETIME"
+
+python do_compile () {
+    import shutil
+    with open(d.expand('${B}/os-release'), 'w') as f:
+        for field in d.getVar('OS_RELEASE_FIELDS', True).split():
+            value = d.getVar(field, True)
+            if value:
+                f.write('{0}={1}\n'.format(field, value))
+    if d.getVar('RPM_SIGN_PACKAGES', True) == '1':
+        rpm_gpg_pubkey = d.getVar('RPM_GPG_PUBKEY', True)
+        os.mkdir('${B}/rpm-gpg')
+        distro_version = self.d.getVar('DISTRO_VERSION', True) or "oe.0"
+        shutil.copy2(rpm_gpg_pubkey, d.expand('${B}/rpm-gpg/RPM-GPG-KEY-%s' % distro_version))
+}
+do_compile[vardeps] += "${OS_RELEASE_FIELDS}"
+
+do_install () {
+    install -d ${D}${sysconfdir}
+    install -m 0644 os-release ${D}${sysconfdir}/
+
+    if [ -d "rpm-gpg" ]; then
+        install -d "${D}${sysconfdir}/pki"
+        cp -r "rpm-gpg" "${D}${sysconfdir}/pki/"
+    fi
+}
diff --git a/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
new file mode 100644
index 0000000..0c6a530
--- /dev/null
+++ b/meta/recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd
+#
+
+SUMMARY = "Host packages for the standalone SDK or external toolchain"
+PR = "r12"
+LICENSE = "MIT"
+
+inherit packagegroup nativesdk
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+RDEPENDS_${PN} = "\
+    nativesdk-pkgconfig \
+    nativesdk-qemu \
+    nativesdk-qemu-helper \
+    nativesdk-pseudo \
+    nativesdk-unfs3 \
+    nativesdk-opkg \
+    nativesdk-libtool \
+    nativesdk-autoconf \
+    nativesdk-automake \
+    nativesdk-shadow \
+    nativesdk-makedevs \
+    nativesdk-smartpm \
+    nativesdk-postinst-intercept \
+    "
+
+RDEPENDS_${PN}_darwin = "\
+    nativesdk-pkgconfig \
+    nativesdk-opkg \
+    nativesdk-libtool \
+    "
diff --git a/meta/recipes-core/packagegroups/packagegroup-base.bb b/meta/recipes-core/packagegroups/packagegroup-base.bb
new file mode 100644
index 0000000..9e40b28
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-base.bb
@@ -0,0 +1,369 @@
+SUMMARY = "Merge machine and distro options to create a basic machine task/package"
+LICENSE = "MIT"
+PR = "r83"
+
+#
+# packages which content depend on MACHINE_FEATURES need to be MACHINE_ARCH
+#
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+inherit bluetooth
+
+PROVIDES = "${PACKAGES}"
+PACKAGES = ' \
+            packagegroup-base \
+            packagegroup-base-extended \
+            packagegroup-distro-base \
+            packagegroup-machine-base \
+            \
+            ${@bb.utils.contains("MACHINE_FEATURES", "acpi", "packagegroup-base-acpi", "",d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "alsa", "packagegroup-base-alsa", "", d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "apm", "packagegroup-base-apm", "", d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "ext2", "packagegroup-base-ext2", "", d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "vfat", "packagegroup-base-vfat", "", d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "irda", "packagegroup-base-irda", "",d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "packagegroup-base-keyboard", "", d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "pci", "packagegroup-base-pci", "",d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "pcmcia", "packagegroup-base-pcmcia", "", d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "phone", "packagegroup-base-phone", "", d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "serial", "packagegroup-base-serial", "", d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "usbgadget", "packagegroup-base-usbgadget", "", d)} \
+            ${@bb.utils.contains("MACHINE_FEATURES", "usbhost", "packagegroup-base-usbhost", "", d)} \
+            \
+            ${@bb.utils.contains("DISTRO_FEATURES", "bluetooth", "packagegroup-base-bluetooth", "", d)} \
+            ${@bb.utils.contains("DISTRO_FEATURES", "wifi", "packagegroup-base-wifi", "", d)} \
+            ${@bb.utils.contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "", d)} \
+            ${@bb.utils.contains("DISTRO_FEATURES", "nfc", "packagegroup-base-nfc", "", d)} \
+            ${@bb.utils.contains("DISTRO_FEATURES", "cramfs", "packagegroup-base-cramfs", "", d)} \
+            ${@bb.utils.contains("DISTRO_FEATURES", "ipsec", "packagegroup-base-ipsec", "", d)} \
+            ${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "packagegroup-base-ipv6", "", d)} \
+            ${@bb.utils.contains("DISTRO_FEATURES", "nfs", "packagegroup-base-nfs", "", d)} \
+            ${@bb.utils.contains("DISTRO_FEATURES", "ppp", "packagegroup-base-ppp", "", d)} \
+            ${@bb.utils.contains("DISTRO_FEATURES", "smbfs", "packagegroup-base-smbfs", "", d)} \
+            ${@bb.utils.contains("DISTRO_FEATURES", "zeroconf", "packagegroup-base-zeroconf", "", d)} \
+            \
+            '
+
+# Override by distro if needed
+VIRTUAL-RUNTIME_keymaps ?= "keymaps"
+
+#
+# packagegroup-base contain stuff needed for base system (machine related)
+#
+RDEPENDS_packagegroup-base = "\
+    packagegroup-distro-base \
+    packagegroup-machine-base \
+    \
+    sysfsutils \
+    module-init-tools \
+    ${@bb.utils.contains('MACHINE_FEATURES', 'apm', 'packagegroup-base-apm', '',d)} \
+    ${@bb.utils.contains('MACHINE_FEATURES', 'acpi', 'packagegroup-base-acpi', '',d)} \
+    ${@bb.utils.contains('MACHINE_FEATURES', 'keyboard', 'packagegroup-base-keyboard', '',d)} \
+    ${@bb.utils.contains('MACHINE_FEATURES', 'phone', 'packagegroup-base-phone', '',d)} \
+    \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'alsa', 'packagegroup-base-alsa', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'ext2', 'packagegroup-base-ext2', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'vfat', 'packagegroup-base-vfat', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'irda', 'packagegroup-base-irda', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'pci', 'packagegroup-base-pci', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'packagegroup-base-pcmcia', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'usbgadget', 'packagegroup-base-usbgadget', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'packagegroup-base-usbhost', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'bluetooth', 'packagegroup-base-bluetooth', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'wifi', 'packagegroup-base-wifi', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'nfc', 'packagegroup-base-nfc', '',d)} \
+    \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'nfs', 'packagegroup-base-nfs', '',d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'cramfs', 'packagegroup-base-cramfs', '',d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'smbfs', 'packagegroup-base-smbfs', '',d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'packagegroup-base-ipv6', '',d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'ipsec', 'packagegroup-base-ipsec', '',d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'ppp', 'packagegroup-base-ppp', '',d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'packagegroup-base-zeroconf', '',d)} \
+    "
+
+
+RRECOMMENDS_packagegroup-base = "\
+    kernel-module-nls-utf8 \
+    kernel-module-input \
+    kernel-module-uinput \
+    kernel-module-rtc-dev \
+    kernel-module-rtc-proc \
+    kernel-module-rtc-sysfs \
+    kernel-module-unix"
+
+RDEPENDS_packagegroup-base-extended = "\
+    packagegroup-base \
+    ${ADD_WIFI} \
+    ${ADD_BT} \
+    ${ADD_3G} \
+    ${ADD_NFC} \
+    "
+
+ADD_WIFI = ""
+ADD_BT = ""
+ADD_3G = ""
+ADD_NFC = ""
+
+python __anonymous () {
+    # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them)
+    # then include packagegroup-base-wifi in packagegroup-base
+
+    distro_features = set(d.getVar("DISTRO_FEATURES", True).split())
+    machine_features= set(d.getVar("MACHINE_FEATURES", True).split())
+
+    if "bluetooth" in distro_features and not "bluetooth" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
+        d.setVar("ADD_BT", "packagegroup-base-bluetooth")
+
+    if "wifi" in distro_features and not "wifi" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
+        d.setVar("ADD_WIFI", "packagegroup-base-wifi")
+
+    if "3g" in distro_features and not "3g" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
+        d.setVar("ADD_3G", "packagegroup-base-3g")
+
+    if "nfc" in distro_features and not "nfc" in machine_features and ("usbhost" in machine_features):
+        d.setVar("ADD_NFC", "packagegroup-base-nfc")
+}
+
+#
+# packages added by distribution
+#
+SUMMARY_packagegroup-distro-base = "${DISTRO} extras"
+DEPENDS_packagegroup-distro-base = "${DISTRO_EXTRA_DEPENDS}"
+RDEPENDS_packagegroup-distro-base = "${DISTRO_EXTRA_RDEPENDS}"
+RRECOMMENDS_packagegroup-distro-base = "${DISTRO_EXTRA_RRECOMMENDS}"
+
+#
+# packages added by machine config
+#
+SUMMARY_packagegroup-machine-base = "${MACHINE} extras"
+SUMMARY_packagegroup-machine-base = "Extra packages required to fully support ${MACHINE} hardware"
+RDEPENDS_packagegroup-machine-base = "${MACHINE_EXTRA_RDEPENDS}"
+RRECOMMENDS_packagegroup-machine-base = "${MACHINE_EXTRA_RRECOMMENDS}"
+
+SUMMARY_packagegroup-base-keyboard = "Keyboard support"
+RDEPENDS_packagegroup-base-keyboard = "\
+    ${VIRTUAL-RUNTIME_keymaps}"
+
+SUMMARY_packagegroup-base-pci = "PCI bus support"
+RDEPENDS_packagegroup-base-pci = "\
+    pciutils"
+
+SUMMARY_packagegroup-base-acpi = "ACPI support"
+RDEPENDS_packagegroup-base-acpi = "\
+    acpid \
+    libacpi "
+
+SUMMARY_packagegroup-base-apm = "APM support"
+RDEPENDS_packagegroup-base-apm = "\
+    ${VIRTUAL-RUNTIME_apm} \
+    apmd"
+
+SUMMARY_packagegroup-base-ext2 = "ext2 filesystem support"
+RDEPENDS_packagegroup-base-ext2 = "\
+    hdparm \
+    e2fsprogs \
+    e2fsprogs-e2fsck \
+    e2fsprogs-mke2fs"
+
+SUMMARY_packagegroup-base-vfat = "FAT filesystem support"
+RRECOMMENDS_packagegroup-base-vfat = "\
+    kernel-module-msdos \
+    kernel-module-vfat \
+    kernel-module-nls-iso8859-1 \
+    kernel-module-nls-cp437 \
+    dosfstools"
+
+SUMMARY_packagegroup-base-alsa = "ALSA sound support"
+RDEPENDS_packagegroup-base-alsa = "\
+    alsa-utils-alsactl \
+    alsa-utils-alsamixer \
+    ${VIRTUAL-RUNTIME_alsa-state}"
+
+RRECOMMENDS_packagegroup-base-alsa = "\
+    kernel-module-snd-mixer-oss \
+    kernel-module-snd-pcm-oss"
+
+SUMMARY_packagegroup-base-pcmcia = "PC card slot support"
+RDEPENDS_packagegroup-base-pcmcia = "\
+    pcmciautils \
+    "
+
+RRECOMMENDS_packagegroup-base-pcmcia = "\
+    kernel-module-pcmcia \
+    kernel-module-airo-cs \
+    kernel-module-pcnet-cs \
+    kernel-module-serial-cs \
+    kernel-module-ide-cs \
+    kernel-module-ide-disk \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'kernel-module-hostap-cs', '',d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'kernel-module-orinoco-cs', '',d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'kernel-module-spectrum-cs', '',d)}"
+
+SUMMARY_packagegroup-base-bluetooth = "Bluetooth support"
+RDEPENDS_packagegroup-base-bluetooth = "\
+    ${BLUEZ} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'alsa', 'libasound-module-bluez', '',d)} \
+    "
+
+RRECOMMENDS_packagegroup-base-bluetooth = "\
+    kernel-module-bluetooth \
+    kernel-module-l2cap \
+    kernel-module-rfcomm \
+    kernel-module-hci-vhci \
+    kernel-module-bnep \
+    kernel-module-hidp \
+    kernel-module-hci-uart \
+    kernel-module-sco \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-hci-usb', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluetooth3c-cs', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluecard-cs', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-bluetoothuart-cs', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'kernel-module-dtl1-cs', '',d)} \
+    "
+
+SUMMARY_packagegroup-base-irda = "IrDA support"
+RDEPENDS_packagegroup-base-irda = "\
+    irda-utils"
+
+RRECOMMENDS_packagegroup-base-irda = "\
+    kernel-module-pxaficp-ir \
+    kernel-module-irda \
+    kernel-module-ircomm \
+    kernel-module-ircomm-tty \
+    kernel-module-irlan \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'ppp', 'kernel-module-irnet', '',d)} \
+    kernel-module-irport \
+    kernel-module-irtty \
+    kernel-module-irtty-sir \
+    kernel-module-sir-dev \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-ir-usb', '',d)} "
+
+SUMMARY_packagegroup-base-usbgadget = "USB gadget support"
+RRECOMMENDS_packagegroup-base-usbgadget = "\
+    kernel-module-pxa27x_udc \
+    kernel-module-gadgetfs \
+    kernel-module-g-file-storage \
+    kernel-module-g-serial \
+    kernel-module-g-ether"
+
+SUMMARY_packagegroup-base-usbhost = "USB host support"
+RDEPENDS_packagegroup-base-usbhost = "\
+    usbutils "
+
+RRECOMMENDS_packagegroup-base-usbhost = "\
+    kernel-module-uhci-hcd \
+    kernel-module-ohci-hcd \
+    kernel-module-ehci-hcd \
+    kernel-module-usbcore \
+    kernel-module-usbhid \
+    kernel-module-usbnet \
+    kernel-module-sd-mod \
+    kernel-module-scsi-mod \
+    kernel-module-usbmouse \
+    kernel-module-mousedev \
+    kernel-module-usbserial \
+    kernel-module-usb-storage "
+
+SUMMARY_packagegroup-base-ppp = "PPP dial-up protocol support"
+RDEPENDS_packagegroup-base-ppp = "\
+    ppp \
+    ppp-dialin"
+
+RRECOMMENDS_packagegroup-base-ppp = "\
+    kernel-module-ppp-async \
+    kernel-module-ppp-deflate \
+    kernel-module-ppp-generic \
+    kernel-module-ppp-mppe \
+    kernel-module-slhc"
+
+SUMMARY_packagegroup-base-ipsec = "IPSEC support"
+RDEPENDS_packagegroup-base-ipsec = "\
+    "
+
+RRECOMMENDS_packagegroup-base-ipsec = "\
+    kernel-module-ipsec"
+
+#
+# packagegroup-base-wifi contain everything needed to get WiFi working
+# WEP/WPA connection needs to be supported out-of-box
+#
+SUMMARY_packagegroup-base-wifi = "WiFi support"
+RDEPENDS_packagegroup-base-wifi = "\
+    ${VIRTUAL-RUNTIME_wireless-tools} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'pcmcia', 'hostap-utils', '',d)} \
+    ${@bb.utils.contains('COMBINED_FEATURES', 'pci', 'hostap-utils', '',d)} \
+    wpa-supplicant"
+
+RRECOMMENDS_packagegroup-base-wifi = "\
+    ${@bb.utils.contains('COMBINED_FEATURES', 'usbhost', 'kernel-module-zd1211rw', '',d)} \
+    kernel-module-ieee80211-crypt \
+    kernel-module-ieee80211-crypt-ccmp \
+    kernel-module-ieee80211-crypt-tkip \
+    kernel-module-ieee80211-crypt-wep \
+    kernel-module-ecb \
+    kernel-module-arc4 \
+    kernel-module-crypto_algapi \
+    kernel-module-cryptomgr \
+    kernel-module-michael-mic \
+    kernel-module-aes-generic \
+    kernel-module-aes"
+
+SUMMARY_packagegroup-base-nfc = "Near Field Communication support"
+RDEPENDS_packagegroup-base-nfc = "\
+    neard"
+
+RRECOMMENDS_packagegroup-base-nfc = "\
+    kernel-module-nfc"
+
+SUMMARY_packagegroup-base-3g = "Cellular data support"
+RDEPENDS_packagegroup-base-3g = "\
+    ofono"
+
+RRECOMMENDS_packagegroup-base-3g = "\
+    kernel-module-cdc-acm \
+    kernel-module-cdc-wdm"
+
+SUMMARY_packagegroup-base-smbfs = "SMB network filesystem support"
+RRECOMMENDS_packagegroup-base-smbfs = "\
+    kernel-module-cifs \
+    kernel-module-smbfs"
+
+SUMMARY_packagegroup-base-cramfs = "cramfs filesystem support"
+RRECOMMENDS_packagegroup-base-cramfs = "\
+    kernel-module-cramfs"
+
+#
+# packagegroup-base-nfs provides ONLY client support - server is in nfs-utils package
+#
+SUMMARY_packagegroup-base-nfs = "NFS network filesystem support"
+RDEPENDS_packagegroup-base-nfs = "\
+    rpcbind"
+
+RRECOMMENDS_packagegroup-base-nfs = "\
+    kernel-module-nfs "
+
+SUMMARY_packagegroup-base-zeroconf = "Zeroconf support"
+RDEPENDS_packagegroup-base-zeroconf = "\
+    avahi-daemon"
+RDEPENDS_packagegroup-base-zeroconf_append_libc-glibc = "\
+    libnss-mdns \
+    "
+
+SUMMARY_packagegroup-base-ipv6 = "IPv6 support"
+RDEPENDS_packagegroup-base-ipv6 = "\
+    "
+
+RRECOMMENDS_packagegroup-base-ipv6 = "\
+    kernel-module-ipv6 "
+
+SUMMARY_packagegroup-base-serial = "Serial port support"
+RDEPENDS_packagegroup-base-serial = "\
+    setserial \
+    lrzsz "
+
+SUMMARY_packagegroup-base-phone = "Cellular telephony (voice) support"
+RDEPENDS_packagegroup-base-phone = "\
+    ofono"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-boot.bb b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
new file mode 100644
index 0000000..09f5373
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-boot.bb
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Minimal boot requirements"
+DESCRIPTION = "The minimal set of packages required to boot the system"
+LICENSE = "MIT"
+PR = "r17"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+#
+# Set by the machine configuration with packages essential for device bootup
+#
+MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= ""
+MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= ""
+
+# Distro can override the following VIRTUAL-RUNTIME providers:
+VIRTUAL-RUNTIME_dev_manager ?= "udev"
+VIRTUAL-RUNTIME_login_manager ?= "busybox"
+VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
+VIRTUAL-RUNTIME_initscripts ?= "initscripts"
+VIRTUAL-RUNTIME_keymaps ?= "keymaps"
+
+SYSVINIT_SCRIPTS = "${@bb.utils.contains('MACHINE_FEATURES', 'rtc', 'busybox-hwclock', '', d)} \
+                    modutils-initscripts \
+                    init-ifupdown \
+                    ${VIRTUAL-RUNTIME_initscripts} \
+                   "
+
+RDEPENDS_${PN} = "\
+    base-files \
+    base-passwd \
+    busybox \
+    ${@bb.utils.contains("DISTRO_FEATURES", "sysvinit", "${SYSVINIT_SCRIPTS}", "", d)} \
+    ${@bb.utils.contains("MACHINE_FEATURES", "keyboard", "${VIRTUAL-RUNTIME_keymaps}", "", d)} \
+    netbase \
+    ${VIRTUAL-RUNTIME_login_manager} \
+    ${VIRTUAL-RUNTIME_init_manager} \
+    ${VIRTUAL-RUNTIME_dev_manager} \
+    ${VIRTUAL-RUNTIME_update-alternatives} \
+    ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}"
+
+RRECOMMENDS_${PN} = "\
+    ${MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS}"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb b/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
new file mode 100644
index 0000000..74ed247
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-buildessential.bb
@@ -0,0 +1,29 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+# Copyright (C) 2012 Red Hat, Inc.
+#
+
+SUMMARY = "Essential build dependencies"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+RDEPENDS_packagegroup-core-buildessential = "\
+    autoconf \
+    automake \
+    binutils \
+    binutils-symlinks \
+    cpp \
+    cpp-symlinks \
+    gcc \
+    gcc-symlinks \
+    g++ \
+    g++-symlinks \
+    gettext \
+    make \
+    libstdc++ \
+    libstdc++-dev \
+    libtool \
+    pkgconfig \
+    "
+
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb b/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb
new file mode 100644
index 0000000..e7b013d
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-eclipse-debug.bb
@@ -0,0 +1,10 @@
+SUMMARY = "Remote debugging tools for Eclipse integration"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "\
+    gdbserver \
+    tcf-agent \
+    openssh-sftp-server \
+    "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb b/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb
new file mode 100644
index 0000000..1882d3a
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-nfs.bb
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "NFS package groups"
+LICENSE = "MIT"
+PR = "r2"
+
+inherit packagegroup
+
+PROVIDES = "${PACKAGES}"
+PACKAGES = "${PN}-server ${PN}-client"
+
+SUMMARY_${PN}-client = "NFS client"
+RDEPENDS_${PN}-client = "nfs-utils-client"
+
+SUMMARY_${PN}-server = "NFS server"
+RDEPENDS_${PN}-server = "\
+    nfs-utils \
+    nfs-utils-client \
+    "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
new file mode 100644
index 0000000..3badd0e
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-sdk.bb
@@ -0,0 +1,83 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Software development tools"
+LICENSE = "MIT"
+PR = "r9"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+#PACKAGEFUNCS =+ 'generate_sdk_pkgs'
+
+RDEPENDS_packagegroup-core-sdk = "\
+    packagegroup-core-buildessential \
+    coreutils \
+    ccache \
+    diffutils \
+    intltool \
+    perl-module-re \
+    perl-module-text-wrap \
+    findutils \
+    quilt \
+    less \
+    ldd \
+    file \
+    tcl"
+
+SANITIZERS = "libasan-dev libubsan-dev"
+SANITIZERS_aarch64 = ""
+SANITIZERS_mips = ""
+SANITIZERS_mips64 = ""
+SANITIZERS_mips64n32 = ""
+SANITIZERS_powerpc64 = ""
+SANITIZERS_sparc = ""
+SANITIZERS_libc-musl = ""
+
+RRECOMMENDS_packagegroup-core-sdk = "\
+    libgomp \
+    libgomp-dev \
+    ${SANITIZERS}"
+
+#python generate_sdk_pkgs () {
+#    poky_pkgs = read_pkgdata('packagegroup-core', d)['PACKAGES']
+#    pkgs = d.getVar('PACKAGES', True).split()
+#    for pkg in poky_pkgs.split():
+#        newpkg = pkg.replace('packagegroup-core', 'packagegroup-core-sdk')
+#
+#        # for each of the task packages, add a corresponding sdk task
+#        pkgs.append(newpkg)
+#
+#        # for each sdk task, take the rdepends of the non-sdk task, and turn
+#        # that into rrecommends upon the -dev versions of those, not unlike
+#        # the package depchain code
+#        spkgdata = read_subpkgdata(pkg, d)
+#
+#        rdepends = explode_deps(spkgdata.get('RDEPENDS_%s' % pkg) or '')
+#        rreclist = []
+#
+#        for depend in rdepends:
+#            split_depend = depend.split(' (')
+#            name = split_depend[0].strip()
+#            if packaged('%s-dev' % name, d):
+#                rreclist.append('%s-dev' % name)
+#            else:
+#                deppkgdata = read_subpkgdata(name, d)
+#                rdepends2 = explode_deps(deppkgdata.get('RDEPENDS_%s' % name) or '')
+#                for depend in rdepends2:
+#                    split_depend = depend.split(' (')
+#                    name = split_depend[0].strip()
+#                    if packaged('%s-dev' % name, d):
+#                        rreclist.append('%s-dev' % name)
+#
+#            oldrrec = d.getVar('RRECOMMENDS_%s' % newpkg, False) or ''
+#            d.setVar('RRECOMMENDS_%s' % newpkg, oldrrec + ' ' + ' '.join(rreclist))
+#            # bb.note('RRECOMMENDS_%s = "%s"' % (newpkg, d.getVar('RRECOMMENDS_%s' % newpkg, False)))
+#
+#    # bb.note('pkgs is %s' % pkgs)
+#    d.setVar('PACKAGES', ' '.join(pkgs))
+#}
+#
+#PACKAGES_DYNAMIC += "^packagegroup-core-sdk-.*"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb b/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb
new file mode 100644
index 0000000..e99946f
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-ssh-dropbear.bb
@@ -0,0 +1,7 @@
+SUMMARY = "Dropbear SSH client/server"
+LICENSE = "MIT"
+PR = "r1"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "dropbear"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb b/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb
new file mode 100644
index 0000000..32d20e6
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-ssh-openssh.bb
@@ -0,0 +1,7 @@
+SUMMARY = "OpenSSH SSH client/server"
+LICENSE = "MIT"
+PR = "r1"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "openssh"
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb b/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb
new file mode 100644
index 0000000..37f5e43
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-standalone-sdk-target.bb
@@ -0,0 +1,13 @@
+SUMMARY = "Target packages for the standalone SDK"
+PR = "r8"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+RDEPENDS_${PN} = "\
+    libgcc \
+    libgcc-dev \
+    libstdc++ \
+    libstdc++-dev \
+    ${LIBC_DEPENDENCIES} \
+    "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb b/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb
new file mode 100644
index 0000000..82347b9
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-debug.bb
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Debugging tools"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PR = "r3"
+
+MTRACE = ""
+MTRACE_libc-glibc = "libc-mtrace"
+
+RDEPENDS_${PN} = "\
+    gdb \
+    gdbserver \
+    strace \
+    ${MTRACE} \
+    "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb b/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
new file mode 100644
index 0000000..80f5933
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-profile.bb
@@ -0,0 +1,81 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Profiling tools"
+LICENSE = "MIT"
+
+PR = "r3"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+PROFILE_TOOLS_X = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'sysprof', '', d)}"
+# sysprof doesn't support aarch64
+PROFILE_TOOLS_X_aarch64 = ""
+PROFILE_TOOLS_SYSTEMD = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-analyze', '', d)}"
+
+RRECOMMENDS_${PN} = "\
+    perf \
+    trace-cmd \
+    blktrace \
+    ${PROFILE_TOOLS_X} \
+    ${PROFILE_TOOLS_SYSTEMD} \
+    "
+
+PROFILETOOLS = "\
+    powertop \
+    latencytop \
+    "
+
+# systemtap needs elfutils which is not fully buildable on uclibc
+# hence we exclude it from uclibc based builds
+SYSTEMTAP = "systemtap"
+SYSTEMTAP_libc-uclibc = ""
+SYSTEMTAP_mips = ""
+SYSTEMTAP_mips64 = ""
+SYSTEMTAP_mips64n32 = ""
+SYSTEMTAP_aarch64 = ""
+
+# lttng-ust uses sched_getcpu() which is not there on uclibc
+# for some of the architectures it can be patched to call the
+# syscall directly but for x86_64 __NR_getcpu is a vsyscall
+# which means we can not use syscall() to call it. So we ignore
+# it for x86_64/uclibc
+
+LTTNGUST = "lttng-ust"
+LTTNGUST_libc-uclibc = ""
+LTTNGUST_aarch64 = ""
+
+LTTNGTOOLS = "lttng-tools"
+LTTNGTOOLS_aarch64 = ""
+
+LTTNGMODULES = "lttng-modules"
+LTTNGMODULES_aarch64 = ""
+
+BABELTRACE = "babeltrace"
+BABELTRACE_aarch64 = ""
+
+# valgrind does not work on mips
+
+VALGRIND = "valgrind"
+VALGRIND_libc-uclibc = ""
+VALGRIND_mips = ""
+VALGRIND_mips64 = ""
+VALGRIND_mips64n32 = ""
+VALGRIND_arm = ""
+VALGRIND_aarch64 = ""
+
+#    exmap-console
+#    exmap-server
+
+RDEPENDS_${PN} = "\
+    ${PROFILETOOLS} \
+    ${LTTNGUST} \
+    ${LTTNGTOOLS} \
+    ${LTTNGMODULES} \
+    ${BABELTRACE} \
+    ${SYSTEMTAP} \
+    ${VALGRIND} \
+    "
diff --git a/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb b/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
new file mode 100644
index 0000000..95b3988
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-core-tools-testapps.bb
@@ -0,0 +1,56 @@
+#
+# Copyright (C) 2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Testing tools/applications"
+LICENSE = "MIT"
+
+PR = "r2"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+# kexec-tools doesn't work on Mips
+KEXECTOOLS ?= "kexec"
+KEXECTOOLS_mips ?= ""
+KEXECTOOLS_mipsel ?= ""
+KEXECTOOLS_powerpc ?= ""
+KEXECTOOLS_e5500-64b ?= ""
+KEXECTOOLS_aarch64 ?= ""
+
+X11GLTOOLS = "\
+    mesa-demos \
+    piglit \
+    "
+
+3GTOOLS = "\
+    ofono-tests \
+    "
+
+X11TOOLS = "\
+    fstests \
+    gst-player-bin \
+    x11perf \
+    xrestop \
+    xwininfo \
+    xprop \
+    xvideo-tests \
+    "
+
+RDEPENDS_${PN} = "\
+    blktool \
+    tslib-calibrate \
+    tslib-tests \
+    lrzsz \
+    ${KEXECTOOLS} \
+    alsa-utils-amixer \
+    alsa-utils-aplay \
+    ltp \
+    connman-tools \
+    connman-tests \
+    connman-client \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', "${X11TOOLS}", "", d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', "${X11GLTOOLS}", "", d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', '3g', "${3GTOOLS}", "", d)} \
+    "
diff --git a/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
new file mode 100644
index 0000000..180dd96
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-cross-canadian.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Host SDK package for cross canadian toolchain"
+PN = "packagegroup-cross-canadian-${MACHINE}"
+LICENSE = "MIT"
+
+inherit cross-canadian packagegroup
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+# Use indirection to stop these being expanded prematurely
+BINUTILS = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+GCC = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+GDB = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+RDEPENDS_${PN} = "\
+    ${@all_multilib_tune_values(d, 'BINUTILS')} \
+    ${@all_multilib_tune_values(d, 'GCC')} \
+    ${@all_multilib_tune_values(d, 'GDB')} \
+    meta-environment-${MACHINE} \
+    "
diff --git a/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
new file mode 100644
index 0000000..d38be26
--- /dev/null
+++ b/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
@@ -0,0 +1,202 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Self-hosting"
+DESCRIPTION = "Packages required to run the build system"
+PR = "r13"
+LICENSE = "MIT"
+
+inherit packagegroup  distro_features_check
+# rdepends on libx11-dev
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGES = "\
+    packagegroup-self-hosted \
+    packagegroup-self-hosted-debug \
+    packagegroup-self-hosted-sdk \
+    packagegroup-self-hosted-extended \
+    packagegroup-self-hosted-graphics \
+    packagegroup-self-hosted-host-tools \
+    "
+
+RDEPENDS_packagegroup-self-hosted = "\
+    packagegroup-self-hosted-debug \
+    packagegroup-self-hosted-sdk \
+    packagegroup-self-hosted-extended \
+    packagegroup-self-hosted-graphics \
+    packagegroup-self-hosted-host-tools \
+    "
+
+RDEPENDS_packagegroup-self-hosted-host-tools = "\
+    connman \
+    connman-plugin-ethernet \
+    dhcp-client \
+    e2fsprogs \
+    e2fsprogs-e2fsck \
+    e2fsprogs-mke2fs \
+    e2fsprogs-tune2fs \
+    hdparm \
+    iptables \
+    lsb \
+    mc \
+    mc-fish \
+    mc-helpers \
+    mc-helpers-perl \
+    mc-helpers-python \
+    parted \
+    pseudo \
+    screen \
+    "
+
+RRECOMMENDS_packagegroup-self-hosted-host-tools = "\
+    kernel-module-tun \
+    kernel-module-iptable-raw \
+    kernel-module-iptable-nat \
+    kernel-module-iptable-mangle \
+    kernel-module-iptable-filter \
+	"
+
+RDEPENDS_packagegroup-self-hosted-sdk = "\
+    autoconf \
+    automake \
+    binutils \
+    binutils-symlinks \
+    ccache \
+    coreutils \
+    cpp \
+    cpp-symlinks \
+    distcc \
+    glibc-gconv-ibm850 \
+    file \
+    findutils \
+    g++ \
+    g++-symlinks \
+    gcc \
+    gcc-symlinks \
+    intltool \
+    ldd \
+    less \
+    libssp \
+    libssp-dev \
+    libssp-staticdev \
+    libstdc++ \
+    libstdc++-dev \
+    libtool \
+    make \
+    mktemp \
+    perl-module-re \
+    perl-module-text-wrap \
+    pkgconfig \
+    quilt \
+    sed \
+    "
+# glibc-utils: for rpcgen
+RDEPENDS_packagegroup-self-hosted-sdk_append_libc-glibc = "\
+    glibc-utils \
+    "
+RDEPENDS_packagegroup-self-hosted-debug = " \
+    gdb \
+    gdbserver \
+    rsync \
+    strace \
+    tcf-agent"
+
+
+RDEPENDS_packagegroup-self-hosted-extended = "\
+    bzip2 \
+    chkconfig \
+    chrpath \
+    cpio \
+    curl \
+    diffstat \
+    diffutils \
+    elfutils \
+    expat \
+    gawk \
+    gdbm \
+    gettext \
+    gettext-runtime \
+    git \
+    git-perltools \
+    grep \
+    groff \
+    gzip \
+    settings-daemon \
+    hicolor-icon-theme \
+    sato-icon-theme \
+    libaio \
+    libusb1 \
+    libxml2 \
+    lrzsz \
+    lsof \
+    lzo \
+    man \
+    man-pages \
+    mdadm \
+    minicom \
+    mtools \
+    ncurses \
+    ncurses-terminfo-base \
+    neon \
+    nfs-utils \
+    nfs-utils-client \
+    openssl \
+    openssh-sftp-server \
+    opkg \
+    opkg-utils \
+    patch \
+    perl \
+    perl-dev \
+    perl-modules \
+    perl-pod \
+    ${PTH} \
+    python \
+    python-compiler \
+    python-git \
+    python-misc \
+    python-modules \
+    python-rpm \
+    quota \
+    readline \
+    rpm \
+    setserial \
+    socat \
+    subversion \
+    sudo \
+    sysstat \
+    tar \
+    tcl \
+    texi2html \
+    texinfo \
+    unzip \
+    usbutils \
+    watchdog \
+    wget \
+    which \
+    xinetd \
+    zip \
+    zlib \
+    xz \
+    "
+
+
+RDEPENDS_packagegroup-self-hosted-graphics = "\
+    builder \
+    libgl \
+    libgl-dev \
+    libglu \
+    libglu-dev \
+    libsdl \
+    libsdl-dev \
+    libx11-dev \
+    python-pygtk \
+    gtk-theme-clearlooks \
+    xdg-utils \
+    epiphany \
+    leafpad \
+    pcmanfm \
+    vte \
+    "
+PTH = "pth"
+PTH_libc-uclibc = ""
diff --git a/meta/recipes-core/psplash/files/0001-psplash-fb-Convert-psplash_fb_plot_pixel-to-a-static.patch b/meta/recipes-core/psplash/files/0001-psplash-fb-Convert-psplash_fb_plot_pixel-to-a-static.patch
new file mode 100644
index 0000000..93b3c6b
--- /dev/null
+++ b/meta/recipes-core/psplash/files/0001-psplash-fb-Convert-psplash_fb_plot_pixel-to-a-static.patch
@@ -0,0 +1,53 @@
+From 8f5de12cc75bfaa8400adf32f30c015d8f813540 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Aug 2015 07:12:20 -0700
+Subject: [PATCH] psplash-fb: Convert psplash_fb_plot_pixel() to a static
+ inline
+
+This function is not used outside psplash-fb.c and by making it
+static inline we keep the performance and also make it portable across
+multiple compilers and gcc versions
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ psplash-fb.c | 2 +-
+ psplash-fb.h | 8 --------
+ 2 files changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/psplash-fb.c b/psplash-fb.c
+index bd9cd9d..6d235db 100644
+--- a/psplash-fb.c
++++ b/psplash-fb.c
+@@ -260,7 +260,7 @@ psplash_fb_new (int angle)
+ 
+ #define OFFSET(fb,x,y) (((y) * (fb)->stride) + ((x) * ((fb)->bpp >> 3)))
+ 
+-inline void
++static inline void
+ psplash_fb_plot_pixel (PSplashFB    *fb,
+ 		       int          x,
+ 		       int          y,
+diff --git a/psplash-fb.h b/psplash-fb.h
+index 42592ed..c6c3144 100644
+--- a/psplash-fb.h
++++ b/psplash-fb.h
+@@ -57,14 +57,6 @@ psplash_fb_destroy (PSplashFB *fb);
+ PSplashFB*
+ psplash_fb_new (int angle);
+ 
+-inline void
+-psplash_fb_plot_pixel (PSplashFB    *fb, 
+-		       int          x, 
+-		       int          y, 
+-		       uint8        red,
+-		       uint8        green,
+-		       uint8        blue);
+-
+ void
+ psplash_fb_draw_rect (PSplashFB    *fb, 
+ 		      int          x, 
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/psplash/files/psplash-init b/meta/recipes-core/psplash/files/psplash-init
new file mode 100755
index 0000000..66c85e9
--- /dev/null
+++ b/meta/recipes-core/psplash/files/psplash-init
@@ -0,0 +1,29 @@
+#!/bin/sh 
+### BEGIN INIT INFO
+# Provides:             psplash
+# Required-Start:
+# Required-Stop:
+# Default-Start:        S
+# Default-Stop:
+### END INIT INFO
+
+read CMDLINE < /proc/cmdline
+for x in $CMDLINE; do
+        case $x in
+        psplash=false)
+		echo "Boot splashscreen disabled" 
+		exit 0;
+                ;;
+        esac
+done
+
+export TMPDIR=/mnt/.psplash
+mount tmpfs -t tmpfs $TMPDIR -o,size=40k
+
+rotation=0
+if [ -e /etc/rotation ]; then
+	read rotation < /etc/rotation
+fi
+
+/usr/bin/psplash --angle $rotation &
+
diff --git a/meta/recipes-core/psplash/files/psplash-poky-img.h b/meta/recipes-core/psplash/files/psplash-poky-img.h
new file mode 100644
index 0000000..8d56aa0
--- /dev/null
+++ b/meta/recipes-core/psplash/files/psplash-poky-img.h
@@ -0,0 +1,1259 @@
+/* GdkPixbuf RGB C-Source image dump 1-byte-run-length-encoded */
+
+#define POKY_IMG_ROWSTRIDE (1920)
+#define POKY_IMG_WIDTH (640)
+#define POKY_IMG_HEIGHT (480)
+#define POKY_IMG_BYTES_PER_PIXEL (3) /* 3:RGB, 4:RGBA */
+#define POKY_IMG_RLE_PIXEL_DATA ((uint8*) \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\237\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376" \
+  "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+  "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
+  "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361" \
+  "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+  "\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377" \
+  "\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374" \
+  "\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377" \
+  "\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\223\377\377\377\363\376\377\374\3\373\375" \
+  "\372\360\366\370\353\360\363\202\347\355\357\5\346\354\356\347\355\357" \
+  "\351\356\360\360\366\370\371\373\370\363\376\377\374\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\223\377\377\377\353\376\377\374\10\356" \
+  "\363\366\324\331\333\277\304\306\252\262\272\227\237\247}\220\233p\203" \
+  "\216ew\202\212]oz\10dv\201n\201\214~\215\223\216\236\244\247\257\267" \
+  "\274\301\303\320\326\330\352\357\362\353\376\377\374\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\223\377\377\377\346\376\377\374\5\366" \
+  "\370\364\320\326\330\255\265\275\210\227\235j}\210\232]oz\5gy\204\204" \
+  "\223\231\250\260\270\314\321\324\355\362\365\346\376\377\374\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\342\376\377" \
+  "\374\5\373\375\372\327\334\337\253\263\273x\213\227^p{\243]oz\4q\204" \
+  "\217\242\252\262\320\326\330\365\372\375\342\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\337\376\377\374" \
+  "\4\371\373\370\317\324\327\225\245\253ew\202\252]oz\4bt\177\211\230\236" \
+  "\306\314\316\367\371\366\337\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\335\376\377\374\3\333\340\343\236" \
+  "\246\256fx\203\260]oz\3bt\177\225\235\245\320\326\330\335\376\377\374" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\332" \
+  "\376\377\374\3\367\371\366\276\303\305u\210\224\266]oz\3m\200\213\257" \
+  "\267\277\355\362\365\332\376\377\374\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\223\377\377\377\330\376\377\374\3\353\360\363\252\262" \
+  "\272fx\203\272]oz\3as~\230\250\256\342\347\352\330\376\377\374\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\326\376\377" \
+  "\374\3\352\357\362\236\246\256as~\276]oz\3^p{\216\236\244\341\346\351" \
+  "\326\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\324\376\377\374\3\354\361\364\246\256\266as~\302]oz\3^p" \
+  "{\227\237\247\346\354\356\324\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\322\376\377\374\3\372\374\371\265" \
+  "\276\306fx\203\306]oz\3as~\250\260\270\362\367\371\322\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\321\376" \
+  "\377\374\2\320\326\330p\203\216\312]oz\2hz\205\302\307\312\321\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\317\376\377\374\2\356\363\366\231\241\251\316]oz\2\204\223\231\345\352" \
+  "\355\317\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\316\376\377\374\2\311\316\321i{\206\320]oz\2bt\177\264" \
+  "\274\305\316\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\314\376\377\374\2\362\367\371\226\246\254\324]o" \
+  "z\2\206\225\233\353\360\363\314\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\313\376\377\374\2\334\342\344o\202" \
+  "\215\326]oz\2gy\204\315\322\325\313\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\312\376\377\374\2\302\307\312" \
+  "as~\330]oz\3^p{\254\264\274\373\375\372\311\376\377\374\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\223\377\377\377\310\376\377\374\2\372" \
+  "\374\371\236\246\256\334]oz\2\210\227\235\360\366\370\310\376\377\374" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\307" \
+  "\376\377\374\2\360\366\370\205\224\232\336]oz\2s\206\221\347\355\357" \
+  "\307\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\306\376\377\374\2\347\355\357t\207\222\340]oz\2i{\206\333" \
+  "\340\343\306\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\305\376\377\374\2\343\350\353j}\210\251]oz\7bt\177" \
+  "w\212\226\215\234\243\236\246\256\246\256\266\254\264\274\264\274\305" \
+  "\202\300\305\310\7\264\274\305\255\265\275\250\260\270\233\252\261\222" \
+  "\241\247~\215\223ew\202\251]oz\2cu\200\322\330\332\305\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\304\376" \
+  "\377\374\2\337\344\346i{\206\245]oz\5j}\210\230\240\250\270\300\311\322" \
+  "\330\332\351\356\360\220\376\377\374\5\354\361\364\326\333\335\300\305" \
+  "\310\236\246\256p\203\216\245]oz\2as~\316\323\326\304\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\303\376" \
+  "\377\374\2\335\343\345gy\204\242]oz\4ew\202\222\241\247\276\303\305\342" \
+  "\347\352\232\376\377\374\4\352\357\362\304\311\314\233\243\253j}\210" \
+  "\242]oz\2as~\313\320\322\303\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\302\376\377\374\2\341\346\351hz" \
+  "\205\240]oz\4_q|\211\230\236\307\315\317\370\372\367\240\376\377\374" \
+  "\4\373\375\372\320\326\330\231\241\251bt\177\240]oz\2as~\317\324\327" \
+  "\302\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\301\376\377\374\2\343\350\353i{\206\237]oz\3q\204\217\266" \
+  "\277\307\354\361\364\246\376\377\374\3\366\370\364\303\310\313\177\216" \
+  "\224\237]oz\2bt\177\325\332\334\301\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\300\376\377\374\2\355\362\365" \
+  "l\177\212\236]oz\3u\210\224\307\315\317\373\375\372\253\376\377\374\2" \
+  "\324\331\333\204\223\231\236]oz\2ew\202\341\346\351\300\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\277\376" \
+  "\377\374\2\365\372\375\177\216\224\235]oz\2~\215\223\315\322\325\260" \
+  "\376\377\374\2\331\336\341\211\230\236\235]oz\2l\177\212\353\360\363" \
+  "\277\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\277\376\377\374\1\214\233\242\234]oz\2i{\206\305\312\315" \
+  "\264\376\377\374\2\324\331\333q\204\217\234]oz\2u\210\224\367\371\366" \
+  "\276\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\276\376\377\374\1\257\267\277\233]oz\3^p{\242\252\262\362" \
+  "\367\371\266\376\377\374\3\372\374\371\261\271\302bt\177\233]oz\1\225" \
+  "\235\245\276\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\275\376\377\374\2\317\324\327^p{\232]oz\2w\212\226" \
+  "\335\343\345\272\376\377\374\2\351\356\360\211\230\236\233]oz\1\264\274" \
+  "\305\275\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\274\376\377\374\2\347\355\357ew\202\232]oz\2\242\252" \
+  "\262\371\373\370\225\376\377\374\10\336\367\374\262\355\370\220\343\361" \
+  "m\332\361G\317\353,\311\352(\307\350#\304\346\202\0\301\350\10\0\304" \
+  "\352(\307\350,\311\352B\314\347i\326\356\207\341\364\260\353\366\333" \
+  "\364\371\226\376\377\374\2\266\277\307as~\231]oz\2_q|\327\334\337\274" \
+  "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+  "\377\377\273\376\377\374\2\373\375\372}\220\233\231]oz\2ew\202\313\320" \
+  "\322\223\376\377\374\4\334\365\372\233\345\364M\323\357\0\304\352\222" \
+  "\25\274\344\4\0\301\350J\321\355\211\342\365\314\361\372\223\376\377" \
+  "\374\2\332\337\342m\200\213\231]oz\2l\177\212\360\366\370\273\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\273\376\377\374\1\257\267\277\231]oz\2x\213\227\347\355\357\221\376" \
+  "\377\374\3\336\367\374\206\340\363*\310\351\232\25\274\344\3#\304\346" \
+  "w\333\356\316\363\374\221\376\377\374\2\360\366\370\214\233\242\231]" \
+  "oz\1\227\237\247\273\376\377\374\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\223\377\377\377\272\376\377\374\2\335\343\345_q|\230]oz" \
+  "\2\210\227\235\364\371\374\217\376\377\374\3\370\376\377\256\350\364" \
+  "B\314\347\240\25\274\344\3*\310\351\233\345\364\367\375\377\217\376\377" \
+  "\374\2\373\375\372\242\252\262\231]oz\1\305\312\315\272\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\271\376" \
+  "\377\374\2\372\374\371w\212\226\230]oz\2\231\241\251\372\374\371\216" \
+  "\376\377\374\3\367\375\377\233\345\364(\307\350\244\25\274\344\3\0\302" \
+  "\351\206\340\363\356\373\374\217\376\377\374\1\257\267\277\230]oz\2h" \
+  "z\205\356\363\366\271\376\377\374\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\223\377\377\377\271\376\377\374\1\257\267\277\230]oz\1\246" \
+  "\256\266\217\376\377\374\2\237\350\367\0\304\352\250\25\274\344\3\0\276" \
+  "\345\207\341\364\370\376\377\216\376\377\374\2\277\304\306_q|\227]oz" \
+  "\1\231\241\251\271\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\223\377\377\377\270\376\377\374\2\346\354\356bt\177\227]oz\1" \
+  "\251\261\271\216\376\377\374\2\315\362\3731\313\354\254\25\274\344\2" \
+  "(\307\350\262\355\370\216\376\377\374\2\305\312\315^p{\227]oz\1\322\330" \
+  "\332\270\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\270\376\377\374\1\215\234\243\227]oz\1\233\252\261\215" \
+  "\376\377\374\3\367\375\377m\332\361\0\276\345\257\25\274\344\2L\322\356" \
+  "\356\373\374\215\376\377\374\1\274\301\303\227]oz\2t\207\222\373\375" \
+  "\372\267\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\267\376\377\374\1\325\332\334\227]oz\2\214\233\242\373" \
+  "\375\372\214\376\377\374\2\333\364\371,\311\352\262\25\274\344\2\0\304" \
+  "\352\301\356\366\215\376\377\374\1\252\262\272\227]oz\1\274\301\303\267" \
+  "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+  "\377\377\267\376\377\374\1v\211\225\226]oz\2\205\224\232\365\372\375" \
+  "\214\376\377\374\2\236\347\366\0\276\345\264\25\274\344\3\0\276\345\203" \
+  "\334\360\370\376\377\214\376\377\374\1\236\246\256\226]oz\2hz\205\362" \
+  "\367\371\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\266\376\377\374\1\307\315\317\226]oz\2n\201\214" \
+  "\360\366\370\214\376\377\374\1m\332\361\270\25\274\344\2I\320\354\366" \
+  "\373\376\213\376\377\374\2\373\375\372\203\222\230\226]oz\1\254\264\274" \
+  "\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\265\376\377\374\2\373\375\372s\206\221\225]oz\2as~\333\340" \
+  "\343\213\376\377\374\2\370\376\377M\323\357\272\25\274\344\2""1\313\354" \
+  "\356\373\374\213\376\377\374\2\353\360\363i{\206\225]oz\2ew\202\357\365" \
+  "\367\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\265\376\377\374\1\305\312\315\226]oz\1\265\276\306\213" \
+  "\376\377\374\2\366\373\376B\314\347\274\25\274\344\2(\307\350\336\367" \
+  "\374\213\376\377\374\2\322\330\332^p{\225]oz\1\252\262\272\265\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\265\376\377\374\1u\210\224\225]oz\1\214\233\242\213\376\377\374\2\366" \
+  "\373\376B\314\347\276\25\274\344\2#\304\346\337\370\375\213\376\377\374" \
+  "\1\253\263\273\225]oz\2fx\203\367\371\366\264\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374" \
+  "\1\322\330\332\225]oz\2i{\206\360\366\370\212\376\377\374\2\370\376\377" \
+  "I\320\354\300\25\274\344\2*\310\351\357\374\375\212\376\377\374\2\373" \
+  "\375\372~\215\223\225]oz\1\264\274\305\264\376\377\374\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374\1\210" \
+  "\227\235\225]oz\1\303\310\313\213\376\377\374\1i\326\356\302\25\274\344" \
+  "\2B\314\347\370\376\377\212\376\377\374\2\335\343\345^p{\224]oz\2m\200" \
+  "\213\373\375\372\263\376\377\374\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\223\377\377\377\263\376\377\374\2\345\352\355^p{\224]oz" \
+  "\1~\221\235\213\376\377\374\1y\336\360\304\25\274\344\1M\323\357\213" \
+  "\376\377\374\1\242\252\262\225]oz\1\315\322\325\263\376\377\374\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\263\376\377" \
+  "\374\1\252\262\272\224]oz\2_q|\341\346\351\212\376\377\374\2\274\355" \
+  "\373\0\276\345\305\25\274\344\1\220\343\361\212\376\377\374\2\360\366" \
+  "\370i{\206\224]oz\1\211\230\236\263\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\262\376\377\374\2\372\374\371" \
+  "i{\206\224]oz\1\250\260\270\212\376\377\374\2\350\371\377\0\304\352\306" \
+  "\25\274\344\2\0\276\345\316\363\374\212\376\377\374\1\303\310\313\224" \
+  "]oz\2^p{\352\357\362\262\376\377\374\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\223\377\377\377\262\376\377\374\1\315\322\325\224]o" \
+  "z\2dv\201\357\365\367\212\376\377\374\1G\317\353\240\25\274\344\3\0\302" \
+  "\351,\311\352J\321\355\203L\322\356\2B\314\347#\304\346\240\25\274\344" \
+  "\2*\310\351\367\375\377\212\376\377\374\1q\204\217\224]oz\1\257\267\277" \
+  "\262\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\262\376\377\374\1\230\240\250\224]oz\1\247\257\267\212\376" \
+  "\377\374\1\233\345\364\235\25\274\344\4*\310\351n\333\362\273\354\371" \
+  "\360\375\376\210\376\377\374\4\357\374\375\303\361\370\206\340\363/\312" \
+  "\353\235\25\274\344\1w\333\356\212\376\377\374\1\303\310\313\224]oz\1" \
+  "v\211\225\262\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\261\376\377\374\2\365\372\375dv\201\223]oz\2as~" \
+  "\353\360\363\211\376\377\374\2\356\373\374\0\302\351\232\25\274\344\3" \
+  "\0\276\345m\332\361\335\366\373\220\376\377\374\2\336\367\374(\307\350" \
+  "\232\25\274\344\2%\305\347\336\367\374\212\376\377\374\2\372\374\371" \
+  "n\201\214\224]oz\1\343\350\353\261\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\261\376\377\374\1\313\320\322" \
+  "\224]oz\1\233\252\261\212\376\377\374\1k\327\357\231\25\274\344\3\0\276" \
+  "\345\206\340\363\357\374\375\222\376\377\374\1k\327\357\232\25\274\344" \
+  "\2%\305\347\336\367\374\214\376\377\374\1\276\303\305\224]oz\1\257\267" \
+  "\277\261\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\261\376\377\374\1\226\246\254\223]oz\2^p{\347\355\357" \
+  "\211\376\377\374\2\316\363\374\0\276\345\230\25\274\344\2J\321\355\337" \
+  "\370\375\223\376\377\374\1k\327\357\232\25\274\344\2%\305\347\336\367" \
+  "\374\215\376\377\374\2\370\372\367i{\206\223]oz\1\177\216\224\261\376" \
+  "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+  "\377\261\376\377\374\1k~\211\223]oz\1\205\224\232\212\376\377\374\1J" \
+  "\321\355\227\25\274\344\2\0\276\345\257\351\365\224\376\377\374\1m\332" \
+  "\361\232\25\274\344\2%\305\347\336\367\374\217\376\377\374\1\246\256" \
+  "\266\223]oz\2^p{\356\363\366\260\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\260\376\377\374\1\335\343\345" \
+  "\224]oz\1\303\310\313\211\376\377\374\2\333\364\371\0\276\345\226\25" \
+  "\274\344\2#\304\346\316\363\374\224\376\377\374\1m\332\361\232\25\274" \
+  "\344\2%\305\347\336\367\374\220\376\377\374\1\335\343\345\224]oz\1\306" \
+  "\314\316\260\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\260\376\377\374\1\264\274\305\223]oz\2cu\200\367" \
+  "\371\366\211\376\377\374\1i\326\356\226\25\274\344\2,\311\352\347\370" \
+  "\376\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336\367\374" \
+  "\222\376\377\374\1t\207\222\223]oz\1\236\246\256\260\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\260\376" \
+  "\377\374\1\215\234\243\223]oz\1\231\241\251\211\376\377\374\2\347\370" \
+  "\376\0\276\345\225\25\274\344\2*\310\351\357\374\375\224\376\377\374" \
+  "\1m\332\361\232\25\274\344\2%\305\347\336\367\374\223\376\377\374\1\261" \
+  "\271\302\223]oz\1q\204\217\260\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\260\376\377\374\1i{\206\223]oz\1" \
+  "\317\324\327\211\376\377\374\1\207\341\364\225\25\274\344\2#\304\346" \
+  "\337\370\375\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336" \
+  "\367\374\224\376\377\374\1\351\356\360\224]oz\1\356\363\366\257\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\257\376\377\374\1\345\352\355\223]oz\2as~\370\372\367\211\376\377\374" \
+  "\1,\311\352\224\25\274\344\2\0\276\345\313\360\371\224\376\377\374\1" \
+  "m\332\361\232\25\274\344\2%\305\347\336\367\374\226\376\377\374\1q\204" \
+  "\217\223]oz\1\314\321\324\257\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\257\376\377\374\1\311\316\321\223" \
+  "]oz\1\202\221\227\211\376\377\374\1\320\365\376\225\25\274\344\1\207" \
+  "\341\364\224\376\377\374\1m\332\361\232\25\274\344\2%\305\347\336\367" \
+  "\374\214\376\377\374\2\236\347\366\237\350\367\211\376\377\374\1\236" \
+  "\246\256\223]oz\1\255\265\275\257\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\257\376\377\374\1\254\264\274" \
+  "\223]oz\1\255\265\275\211\376\377\374\1y\336\360\224\25\274\344\2/\312" \
+  "\353\370\376\377\223\376\377\374\1m\332\361\232\25\274\344\2%\305\347" \
+  "\336\367\374\214\376\377\374\3\236\347\366\0\276\345J\321\355\211\376" \
+  "\377\374\1\311\316\321\223]oz\1\215\234\243\257\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\257\376\377\374" \
+  "\1\214\233\242\223]oz\1\326\333\335\211\376\377\374\1,\311\352\224\25" \
+  "\274\344\1\312\357\370\223\376\377\374\1n\333\362\232\25\274\344\2%\305" \
+  "\347\336\367\374\214\376\377\374\5\236\347\366\0\276\345\25\274\344\0" \
+  "\276\345\367\375\377\210\376\377\374\2\356\363\366^p{\222]oz\1o\202\215" \
+  "\257\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\257\376\377\374\1o\202\215\222]oz\2as~\366\373\376\210\376" \
+  "\377\374\2\357\374\375\0\276\345\223\25\274\344\1J\321\355\223\376\377" \
+  "\374\1n\333\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374" \
+  "\2\236\347\366\0\276\345\203\25\274\344\1\274\355\373\211\376\377\374" \
+  "\1u\210\224\222]oz\2^p{\370\372\367\256\376\377\374\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\2\373\375" \
+  "\372_q|\222]oz\1u\210\224\211\376\377\374\1\261\354\367\224\25\274\344" \
+  "\1\312\357\370\222\376\377\374\1n\333\362\232\25\274\344\2%\305\347\336" \
+  "\367\374\214\376\377\374\2\236\347\366\0\276\345\204\25\274\344\1\204" \
+  "\335\361\211\376\377\374\1\230\240\250\223]oz\1\342\347\352\256\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\256\376\377\374\1\351\356\360\223]oz\1\225\235\245\211\376\377\374\1" \
+  "n\333\362\223\25\274\344\1,\311\352\222\376\377\374\1n\333\362\232\25" \
+  "\274\344\2%\305\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345" \
+  "\205\25\274\344\1B\314\347\211\376\377\374\1\257\267\277\223]oz\1\317" \
+  "\324\327\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\256\376\377\374\1\326\333\335\223]oz\1\253\263\273" \
+  "\211\376\377\374\1B\314\347\223\25\274\344\1\211\342\365\221\376\377" \
+  "\374\1n\333\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374" \
+  "\2\236\347\366\0\276\345\206\25\274\344\1\0\302\351\211\376\377\374\1" \
+  "\307\315\317\223]oz\1\276\303\305\256\376\377\374\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\306\314" \
+  "\316\223]oz\1\305\312\315\211\376\377\374\1#\304\346\223\25\274\344\1" \
+  "\337\370\375\220\376\377\374\1w\333\356\232\25\274\344\2%\305\347\336" \
+  "\367\374\214\376\377\374\2\236\347\366\0\276\345\210\25\274\344\1\356" \
+  "\373\374\210\376\377\374\1\337\344\346\223]oz\1\253\263\273\256\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\256\376\377\374\1\274\301\303\223]oz\1\333\340\343\210\376\377\374\2" \
+  "\367\375\377\0\276\345\222\25\274\344\1(\307\350\220\376\377\374\1\231" \
+  "\342\362\232\25\274\344\2%\305\347\336\367\374\214\376\377\374\2\236" \
+  "\347\366\0\276\345\211\25\274\344\1\302\357\367\210\376\377\374\2\364" \
+  "\371\374^p{\222]oz\1\236\246\256\256\376\377\374\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\257\267" \
+  "\277\223]oz\1\353\360\363\210\376\377\374\1\316\363\374\223\25\274\344" \
+  "\1\\\326\355\217\376\377\374\2\320\365\376\31\275\345\231\25\274\344" \
+  "\2%\305\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345\212\25" \
+  "\274\344\1\237\350\367\211\376\377\374\1gy\204\222]oz\1\216\236\244\256" \
+  "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+  "\377\377\256\376\377\374\1\242\252\262\223]oz\1\366\370\364\210\376\377" \
+  "\374\1\262\355\370\223\25\274\344\1\220\343\361\217\376\377\374\1J\321" \
+  "\355\231\25\274\344\2%\305\347\336\367\374\214\376\377\374\2\236\347" \
+  "\366\0\276\345\213\25\274\344\1\211\342\365\211\376\377\374\1m\200\213" \
+  "\222]oz\1\204\223\231\256\376\377\374\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\223\377\377\377\256\376\377\374\1\226\246\254\223]o" \
+  "z\211\376\377\374\1\237\350\367\223\25\274\344\1\262\355\370\216\376" \
+  "\377\374\2\350\371\377\0\276\345\230\25\274\344\2%\305\347\336\367\374" \
+  "\214\376\377\374\2\236\347\366\0\276\345\214\25\274\344\1n\333\362\211" \
+  "\376\377\374\1u\210\224\222]oz\1y\214\230\256\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374" \
+  "\1\231\241\251\222]oz\1cu\200\211\376\377\374\1\233\345\364\223\25\274" \
+  "\344\1\316\363\374\216\376\377\374\1\235\346\365\230\25\274\344\2%\305" \
+  "\347\336\367\374\214\376\377\374\2\236\347\366\0\276\345\215\25\274\344" \
+  "\1k\327\357\211\376\377\374\1\200\217\225\222]oz\1u\210\224\256\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\256\376\377\374\1\222\241\247\222]oz\1j}\210\211\376\377\374\1\220\343" \
+  "\361\223\25\274\344\1\336\367\374\216\376\377\374\1w\333\356\227\25\274" \
+  "\344\2#\304\346\336\367\374\214\376\377\374\2\236\347\366\0\276\345\216" \
+  "\25\274\344\1M\323\357\211\376\377\374\1\210\227\235\222]oz\1s\206\221" \
+  "\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\256\376\377\374\1\211\230\236\222]oz\1n\201\214\211\376" \
+  "\377\374\1\206\340\363\223\25\274\344\1\350\371\377\216\376\377\374\1" \
+  "i\326\356\226\25\274\344\2#\304\346\336\367\374\214\376\377\374\2\236" \
+  "\347\366\0\276\345\217\25\274\344\1M\323\357\211\376\377\374\1\215\234" \
+  "\243\222]oz\1m\200\213\256\376\377\374\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\223\377\377\377\256\376\377\374\1\222\241\247\222]o" \
+  "z\1l\177\212\211\376\377\374\1\207\341\364\223\25\274\344\1\336\367\374" \
+  "\216\376\377\374\1n\333\362\225\25\274\344\2#\304\346\336\367\374\214" \
+  "\376\377\374\2\235\346\365\0\276\345\220\25\274\344\1M\323\357\211\376" \
+  "\377\374\1\211\230\236\222]oz\1s\206\221\256\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377\374" \
+  "\1\231\241\251\222]oz\1ew\202\211\376\377\374\1\231\342\362\223\25\274" \
+  "\344\1\320\365\376\216\376\377\374\1\221\344\362\224\25\274\344\2#\304" \
+  "\346\336\367\374\214\376\377\374\2\235\346\365\0\276\345\221\25\274\344" \
+  "\1i\326\356\211\376\377\374\1\202\221\227\222]oz\1u\210\224\256\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\256\376\377\374\1\242\252\262\222]oz\1^p{\211\376\377\374\1\237\350" \
+  "\367\223\25\274\344\1\301\356\366\216\376\377\374\1\333\364\371\223\25" \
+  "\274\344\2#\304\346\336\367\374\214\376\377\374\2\356\373\374\0\276\345" \
+  "\222\25\274\344\1n\333\362\211\376\377\374\1w\212\226\222]oz\1\202\221" \
+  "\227\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\256\376\377\374\1\246\256\266\223]oz\1\370\372\367\210" \
+  "\376\377\374\1\260\353\366\223\25\274\344\1\233\345\364\217\376\377\374" \
+  "\1,\311\352\221\25\274\344\2#\304\346\336\367\374\215\376\377\374\1\312" \
+  "\357\370\223\25\274\344\1\204\335\361\211\376\377\374\1o\202\215\222" \
+  "]oz\1\205\224\232\256\376\377\374\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\223\377\377\377\256\376\377\374\1\252\262\272\223]oz\1\355" \
+  "\362\365\210\376\377\374\1\314\361\372\223\25\274\344\1m\332\361\217" \
+  "\376\377\374\1\273\354\371\220\25\274\344\2#\304\346\336\367\374\216" \
+  "\376\377\374\1\233\345\364\223\25\274\344\1\236\347\366\211\376\377\374" \
+  "\1i{\206\222]oz\1\211\230\236\256\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\256\376\377\374\1\266\277\307" \
+  "\223]oz\1\340\345\350\210\376\377\374\1\356\373\374\223\25\274\344\1" \
+  ",\311\352\220\376\377\374\1i\326\356\216\25\274\344\2#\304\346\336\367" \
+  "\374\217\376\377\374\1\\\326\355\223\25\274\344\1\274\355\373\210\376" \
+  "\377\374\2\372\374\371_q|\222]oz\1\226\246\254\256\376\377\374\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376\377" \
+  "\374\1\307\315\317\223]oz\1\313\320\322\211\376\377\374\1\0\302\351\222" \
+  "\25\274\344\2\0\276\345\357\374\375\217\376\377\374\2\370\376\377G\317" \
+  "\353\214\25\274\344\2(\307\350\336\367\374\220\376\377\374\1%\305\347" \
+  "\223\25\274\344\1\336\367\374\210\376\377\374\1\343\350\353\223]oz\1" \
+  "\254\264\274\256\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\223\377\377\377\256\376\377\374\1\327\334\337\223]oz\1\257\267" \
+  "\277\211\376\377\374\1B\314\347\223\25\274\344\1\237\350\367\220\376" \
+  "\377\374\3\370\376\377n\333\362\31\275\345\211\25\274\344\2J\321\355" \
+  "\356\373\374\220\376\377\374\1\315\362\373\223\25\274\344\1\0\301\350" \
+  "\211\376\377\374\1\316\323\326\223]oz\1\276\303\305\256\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\256\376" \
+  "\377\374\1\346\354\356\223]oz\1\225\245\253\211\376\377\374\1k\327\357" \
+  "\223\25\274\344\1G\317\353\222\376\377\374\3\320\365\376Z\325\354\0\301" \
+  "\350\204\25\274\344\3\0\276\345G\317\353\274\355\373\222\376\377\374" \
+  "\1w\333\356\223\25\274\344\1""3\314\355\211\376\377\374\1\264\274\305" \
+  "\223]oz\1\315\322\325\256\376\377\374\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\223\377\377\377\256\376\377\374\1\366\373\376\223]o" \
+  "z\1z\215\231\211\376\377\374\1\237\350\367\223\25\274\344\2\31\275\345" \
+  "\335\366\373\223\376\377\374\2\370\376\377\316\363\374\202\261\354\367" \
+  "\2\313\360\371\366\373\376\223\376\377\374\2\370\376\377\0\302\351\223" \
+  "\25\274\344\1n\333\362\211\376\377\374\1\230\250\256\223]oz\1\334\342" \
+  "\344\256\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\257\376\377\374\1m\200\213\222]oz\1ew\202\211\376\377" \
+  "\374\1\347\370\376\224\25\274\344\1m\332\361\254\376\377\374\1\233\345" \
+  "\364\224\25\274\344\1\261\354\367\211\376\377\374\1}\220\233\223]oz\1" \
+  "\366\370\364\256\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\223\377\377\377\257\376\377\374\1\211\230\236\223]oz\1\335\343" \
+  "\345\211\376\377\374\1%\305\347\223\25\274\344\2\0\276\345\336\367\374" \
+  "\252\376\377\374\2\367\375\377#\304\346\223\25\274\344\2\31\275\345\357" \
+  "\374\375\210\376\377\374\2\370\372\367as~\222]oz\1m\200\213\257\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\257\376\377\374\1\251\261\271\223]oz\1\264\274\305\211\376\377\374\1" \
+  "k\327\357\224\25\274\344\1L\322\356\252\376\377\374\1\206\340\363\224" \
+  "\25\274\344\1""3\314\355\211\376\377\374\1\322\330\332\223]oz\1\211\230" \
+  "\236\257\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\257\376\377\374\1\305\312\315\223]oz\1\211\230\236\211" \
+  "\376\377\374\1\301\356\366\225\25\274\344\1\262\355\370\250\376\377\374" \
+  "\2\334\365\372\0\276\345\224\25\274\344\1\220\343\361\211\376\377\374" \
+  "\1\252\262\272\223]oz\1\251\261\271\257\376\377\374\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\223\377\377\377\257\376\377\374\1\337\344" \
+  "\346\223]oz\2ew\202\373\375\372\210\376\377\374\2\370\376\377#\304\346" \
+  "\224\25\274\344\2\0\302\351\347\370\376\246\376\377\374\2\367\375\377" \
+  ",\311\352\224\25\274\344\2\0\276\345\337\370\375\211\376\377\374\1\177" \
+  "\216\224\223]oz\1\305\312\315\257\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\257\376\377\374\2\373\375\372" \
+  "dv\201\223]oz\1\331\336\341\211\376\377\374\1n\333\362\225\25\274\344" \
+  "\2B\314\347\370\376\377\245\376\377\374\1i\326\356\225\25\274\344\1B" \
+  "\314\347\211\376\377\374\2\362\367\371_q|\223]oz\1\346\354\356\257\376" \
+  "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+  "\377\260\376\377\374\1\210\227\235\223]oz\1\246\256\266\211\376\377\374" \
+  "\1\316\363\374\226\25\274\344\2M\323\357\370\376\377\243\376\377\374" \
+  "\1\206\340\363\226\25\274\344\1\256\350\364\211\376\377\374\1\301\306" \
+  "\311\223]oz\1k~\211\260\376\377\374\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\223\377\377\377\260\376\377\374\1\257\267\277\223]oz\2i" \
+  "{\206\373\375\372\211\376\377\374\1G\317\353\226\25\274\344\2\\\326\355" \
+  "\370\376\377\241\376\377\374\1\220\343\361\226\25\274\344\2\0\304\352" \
+  "\370\376\377\211\376\377\374\1\204\223\231\223]oz\1\230\240\250\260\376" \
+  "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+  "\377\260\376\377\374\1\331\336\341\224]oz\1\317\324\327\211\376\377\374" \
+  "\1\301\356\366\227\25\274\344\2J\321\355\367\375\377\237\376\377\374" \
+  "\1w\333\356\227\25\274\344\1\206\340\363\211\376\377\374\2\351\356\360" \
+  "^p{\223]oz\1\277\304\306\260\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\260\376\377\374\2\372\374\371cu" \
+  "\200\223]oz\1\222\241\247\212\376\377\374\1/\312\353\227\25\274\344\2" \
+  ",\311\352\334\365\372\234\376\377\374\2\356\373\374I\320\354\227\25\274" \
+  "\344\2\0\301\350\366\373\376\211\376\377\374\1\261\271\302\224]oz\1\343" \
+  "\350\353\260\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\261\376\377\374\1\216\236\244\223]oz\2cu\200\362" \
+  "\367\371\211\376\377\374\1\261\354\367\230\25\274\344\3\0\276\345\233" \
+  "\345\364\370\376\377\231\376\377\374\2\262\355\370\0\304\352\230\25\274" \
+  "\344\1\206\340\363\212\376\377\374\1s\206\221\223]oz\1q\204\217\261\376" \
+  "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+  "\377\261\376\377\374\1\305\312\315\224]oz\1\257\267\277\212\376\377\374" \
+  "\1B\314\347\231\25\274\344\2""1\313\354\303\361\370\226\376\377\374\2" \
+  "\334\365\372J\321\355\231\25\274\344\2#\304\346\366\373\376\211\376\377" \
+  "\374\1\315\322\325\224]oz\1\251\261\271\261\376\377\374\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\223\377\377\377\261\376\377\374\2\362" \
+  "\367\371as~\223]oz\2hz\205\370\372\367\211\376\377\374\2\334\365\372" \
+  "\0\276\345\232\25\274\344\3B\314\347\262\355\370\370\376\377\221\376" \
+  "\377\374\3\313\360\371L\322\356\0\276\345\232\25\274\344\1\256\350\364" \
+  "\212\376\377\374\1z\215\231\224]oz\1\333\340\343\261\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\262\376" \
+  "\377\374\1\207\226\234\224]oz\1\270\300\311\212\376\377\374\1w\333\356" \
+  "\234\25\274\344\4\0\304\352m\332\361\273\354\371\366\373\376\212\376" \
+  "\377\374\4\370\376\377\302\357\367y\336\360(\307\350\234\25\274\344\1" \
+  "B\314\347\212\376\377\374\1\324\331\333\224]oz\1k~\211\262\376\377\374" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\262" \
+  "\376\377\374\1\301\306\311\224]oz\2k~\211\372\374\371\211\376\377\374" \
+  "\2\366\373\376(\307\350\236\25\274\344\5\31\275\345,\311\352M\323\357" \
+  "y\336\360\211\342\365\202\233\345\364\5\220\343\361\204\335\361Z\325" \
+  "\3541\313\354\0\276\345\236\25\274\344\2\0\301\350\336\367\374\212\376" \
+  "\377\374\1\205\224\232\224]oz\1\246\256\266\262\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\262\376\377\374" \
+  "\2\367\371\366dv\201\224]oz\1\274\301\303\212\376\377\374\2\315\362\373" \
+  "\0\276\345\307\25\274\344\1\236\347\366\212\376\377\374\1\325\332\334" \
+  "\225]oz\1\341\346\351\262\376\377\374\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\223\377\377\377\263\376\377\374\1\236\246\256\224]o" \
+  "z\2fx\203\356\363\366\212\376\377\374\1\221\344\362\306\25\274\344\1" \
+  "M\323\357\212\376\377\374\2\372\374\371t\207\222\224]oz\1\177\216\224" \
+  "\263\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\263\376\377\374\1\333\340\343\225]oz\1\226\246\254\213\376" \
+  "\377\374\1L\322\356\304\25\274\344\2,\311\352\366\373\376\212\376\377" \
+  "\374\1\265\276\306\225]oz\1\302\307\312\263\376\377\374\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\223\377\377\377\264\376\377\374\1u\210" \
+  "\224\224]oz\2^p{\331\336\341\212\376\377\374\2\366\373\376/\312\353\302" \
+  "\25\274\344\2\0\302\351\336\367\374\212\376\377\374\2\353\360\363dv\201" \
+  "\224]oz\2dv\201\364\371\374\263\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\264\376\377\374\1\302\307\312\225" \
+  "]oz\2w\212\226\372\374\371\212\376\377\374\2\350\371\377%\305\347\300" \
+  "\25\274\344\2\0\301\350\314\361\372\213\376\377\374\1\227\237\247\225" \
+  "]oz\1\246\256\266\264\376\377\374\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\223\377\377\377\264\376\377\374\2\372\374\371l\177\212\225" \
+  "]oz\1\252\262\272\213\376\377\374\2\337\370\375\0\304\352\276\25\274" \
+  "\344\2\0\276\345\274\355\373\213\376\377\374\1\305\312\315\225]oz\2a" \
+  "s~\353\360\363\264\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\223\377\377\377\265\376\377\374\1\270\300\311\225]oz\2^p{\322" \
+  "\330\332\213\376\377\374\2\332\363\370#\304\346\274\25\274\344\2\0\276" \
+  "\345\273\354\371\213\376\377\374\2\343\350\353dv\201\225]oz\1\236\246" \
+  "\256\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\265\376\377\374\2\365\372\375hz\205\225]oz\2i{\206\354" \
+  "\361\364\213\376\377\374\2\337\370\375*\310\351\272\25\274\344\2\0\302" \
+  "\351\314\361\372\213\376\377\374\2\371\373\370x\213\227\225]oz\2_q|\346" \
+  "\354\356\265\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\266\376\377\374\1\261\271\302\226]oz\2\205\224\232" \
+  "\373\375\372\213\376\377\374\2\356\373\374B\314\347\270\25\274\344\2" \
+  "%\305\347\335\366\373\214\376\377\374\1\242\252\262\226]oz\1\231\241" \
+  "\251\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\266\376\377\374\2\370\372\367m\200\213\226]oz\1\242" \
+  "\252\262\214\376\377\374\2\367\375\377i\326\356\266\25\274\344\2B\314" \
+  "\347\350\371\377\214\376\377\374\1\277\304\306\226]oz\2bt\177\351\356" \
+  "\360\266\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\267\376\377\374\1\305\312\315\227]oz\1\261\271\302\215" \
+  "\376\377\374\2\250\347\371\0\301\350\262\25\274\344\3\31\275\345\206" \
+  "\340\363\370\376\377\214\376\377\374\2\316\323\326_q|\226]oz\1\251\261" \
+  "\271\267\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\270\376\377\374\1y\214\230\226]oz\2^p{\301\306\311\215" \
+  "\376\377\374\2\335\366\373/\312\353\260\25\274\344\2#\304\346\312\357" \
+  "\370\215\376\377\374\2\330\335\340cu\200\226]oz\2hz\205\366\370\364\267" \
+  "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+  "\377\377\270\376\377\374\1\332\337\342\230\222\241\247\1\353\360\363" \
+  "\215\376\377\374\3\370\376\377\231\342\362\0\301\350\254\25\274\344\3" \
+  "\0\276\345w\333\356\366\373\376\215\376\377\374\2\365\372\375\236\246" \
+  "\256\227\222\241\247\1\307\315\317\270\376\377\374\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\223\377\377\377\341\376\377\374\3\356\373" \
+  "\374i\326\356\0\276\345\251\25\274\344\2J\321\355\335\366\373\341\376" \
+  "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+  "\377\343\376\377\374\3\316\363\374Z\325\354\31\275\345\245\25\274\344" \
+  "\2G\317\353\302\357\367\343\376\377\374\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\223\377\377\377\345\376\377\374\3\336\367\374m\332\361" \
+  "\0\276\345\240\25\274\344\3\31\275\345M\323\357\316\363\374\345\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\347\376\377\374\4\366\373\376\237\350\367I\320\354\31\275\345\232\25" \
+  "\274\344\4\0\276\345B\314\347\231\342\362\356\373\374\347\376\377\374" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\352" \
+  "\376\377\374\4\356\373\374\235\346\365Z\325\354#\304\346\224\25\274\344" \
+  "\4\0\302\351L\322\356\221\344\362\336\367\374\352\376\377\374\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\356\376\377" \
+  "\374\6\336\367\374\237\350\367w\333\356M\323\357,\311\352\0\276\345\210" \
+  "\25\274\344\6\0\276\345*\310\351J\321\355n\333\362\233\345\364\320\365" \
+  "\376\356\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\364\376\377\374\10\367\375\377\356\373\374\335\366\373" \
+  "\316\363\374\315\362\373\335\366\373\350\371\377\366\373\376\364\376" \
+  "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+  "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
+  "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\223\377\377\377\375\376\377\374\202" \
+  "\370\376\377\250\376\377\374\1\367\375\377\217\376\377\374\1\367\375" \
+  "\377\237\376\377\374\1\367\375\377\230\376\377\374\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\223\377\377\377\374\376\377\374\4\237\350" \
+  "\367\0\276\345\31\275\345\203\334\360\245\376\377\374\5\316\363\374#" \
+  "\304\346\25\274\344G\317\353\367\375\377\213\376\377\374\5\335\366\373" \
+  "(\307\350\25\274\344B\314\347\366\373\376\233\376\377\374\5\356\373\374" \
+  "/\312\353\25\274\344*\310\351\337\370\375\226\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\374\376\377\374" \
+  "\1#\304\346\203\25\274\344\1\357\374\375\244\376\377\374\1i\326\356\203" \
+  "\25\274\344\1\260\353\366\213\376\377\374\1n\333\362\203\25\274\344\1" \
+  "\235\346\365\233\376\377\374\1\231\342\362\203\25\274\344\1y\336\360" \
+  "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\374\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374" \
+  "\244\376\377\374\1I\320\354\203\25\274\344\1\231\342\362\213\376\377" \
+  "\374\1M\323\357\203\25\274\344\1\206\340\363\233\376\377\374\1\206\340" \
+  "\363\203\25\274\344\1k\327\357\226\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\374\376\377\374\1\0\301\350" \
+  "\203\25\274\344\1\336\367\374\244\376\377\374\1I\320\354\203\25\274\344" \
+  "\1\231\342\362\213\376\377\374\1M\323\357\203\25\274\344\1\206\340\363" \
+  "\233\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\374\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\244\376\377" \
+  "\374\1I\320\354\203\25\274\344\1\231\342\362\213\376\377\374\1M\323\357" \
+  "\203\25\274\344\1\206\340\363\233\376\377\374\1\206\340\363\203\25\274" \
+  "\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\223\377\377\377\374\376\377\374\1\0\301\350\203\25\274\344\1" \
+  "\336\367\374\244\376\377\374\1I\320\354\203\25\274\344\1\231\342\362" \
+  "\213\376\377\374\1M\323\357\203\25\274\344\1\206\340\363\233\376\377" \
+  "\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\374\376\377" \
+  "\374\1\0\301\350\203\25\274\344\1\336\367\374\244\376\377\374\1I\320" \
+  "\354\203\25\274\344\1\231\342\362\213\376\377\374\1M\323\357\203\25\274" \
+  "\344\1\206\340\363\233\376\377\374\1\206\340\363\203\25\274\344\1k\327" \
+  "\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\232\376\377\374\7\311\316\321\211\230\236j}\210cu\200" \
+  "n\201\214\233\243\253\333\340\343\206\376\377\374\2\236\246\256dv\201" \
+  "\205]oz\4_q|k~\211\222\241\247\337\344\346\210\376\377\374\7\322\330" \
+  "\332\222\241\247l\177\212cu\200k~\211\222\241\247\322\330\332\206\376" \
+  "\377\374\2\257\267\277gy\204\205]oz\4^p{i{\206\211\230\236\325\332\334" \
+  "\210\376\377\374\10\313\360\371\\\326\355%\305\347\0\276\345\0\302\351" \
+  "G\317\353\237\350\367\370\376\377\205\376\377\374\2\235\346\365\0\304" \
+  "\352\212\25\274\344\4\0\276\345\0\304\352M\323\357\315\362\373\205\376" \
+  "\377\374\1\0\301\350\207\25\274\344\4\0\301\350B\314\347\233\345\364" \
+  "\370\376\377\207\376\377\374\7\302\357\367M\323\357#\304\346\0\276\345" \
+  "\0\304\352J\321\355\260\353\366\210\376\377\374\4\315\362\373M\323\357" \
+  "#\304\346\31\275\345\207\25\274\344\1\231\342\362\204\376\377\374\4\323" \
+  "\364\367\\\326\355%\305\347\0\276\345\207\25\274\344\1\206\340\363\205" \
+  "\376\377\374\10\334\365\372m\332\361(\307\350\0\276\345\0\302\351B\314" \
+  "\347\233\345\364\370\376\377\207\376\377\374\4\336\367\374m\332\361(" \
+  "\307\350\0\276\345\207\25\274\344\1k\327\357\226\376\377\374\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\230\376\377" \
+  "\374\2\356\363\366\202\221\227\206]oz\3^p{\247\257\267\373\375\372\203" \
+  "\376\377\374\1\327\334\337\212]oz\2_q|\303\310\313\205\376\377\374\2" \
+  "\364\371\374\222\241\247\207]oz\2\222\241\247\370\372\367\203\376\377" \
+  "\374\2\353\360\363^p{\212]oz\1\254\264\274\205\376\377\374\2\370\376" \
+  "\377m\332\361\207\25\274\344\2B\314\347\350\371\377\203\376\377\374\2" \
+  "\370\376\377\0\276\345\216\25\274\344\2\31\275\345\235\346\365\204\376" \
+  "\377\374\1\0\301\350\212\25\274\344\2B\314\347\357\374\375\204\376\377" \
+  "\374\2\367\375\377Z\325\354\207\25\274\344\2G\317\353\357\374\375\205" \
+  "\376\377\374\2\235\346\365\31\275\345\212\25\274\344\1\231\342\362\203" \
+  "\376\377\374\2\256\350\364\0\276\345\212\25\274\344\1\206\340\363\204" \
+  "\376\377\374\2\206\340\363\31\275\345\206\25\274\344\2*\310\351\335\366" \
+  "\373\205\376\377\374\2\302\357\367\0\301\350\212\25\274\344\1k\327\357" \
+  "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\227\376\377\374\2\364\371\374u\210\224\211]oz\1\242\252" \
+  "\262\203\376\377\374\1\306\314\316\213]oz\2_q|\325\332\334\203\376\377" \
+  "\374\2\373\375\372\210\227\235\211]oz\2\211\230\236\373\375\372\202\376" \
+  "\377\374\1\330\335\340\214]oz\1\304\311\314\204\376\377\374\1i\326\356" \
+  "\211\25\274\344\2*\310\351\366\373\376\202\376\377\374\1\357\374\375" \
+  "\220\25\274\344\2\0\276\345\274\355\373\203\376\377\374\1\0\301\350\213" \
+  "\25\274\344\1M\323\357\204\376\377\374\1L\322\356\211\25\274\344\2""3" \
+  "\314\355\370\376\377\203\376\377\374\2\313\360\371\0\276\345\213\25\274" \
+  "\344\1\231\342\362\202\376\377\374\2\333\364\371\0\276\345\213\25\274" \
+  "\344\1\206\340\363\203\376\377\374\1\206\340\363\211\25\274\344\2\0\304" \
+  "\352\347\370\376\203\376\377\374\2\356\373\374\0\304\352\213\25\274\344" \
+  "\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\227\376\377\374\1\251\261\271\213]oz\1\322\330\332" \
+  "\202\376\377\374\1\306\314\316\214]oz\1\200\217\225\203\376\377\374\1" \
+  "\277\304\306\213]oz\1\277\304\306\202\376\377\374\1\330\335\340\214]" \
+  "oz\2j}\210\373\375\372\202\376\377\374\1\273\354\371\213\25\274\344\1" \
+  "n\333\362\202\376\377\374\1\357\374\375\221\25\274\344\1""1\313\354\203" \
+  "\376\377\374\1\0\301\350\214\25\274\344\1\332\363\370\202\376\377\374" \
+  "\1\237\350\367\213\25\274\344\1\206\340\363\203\376\377\374\1I\320\354" \
+  "\214\25\274\344\1\231\342\362\202\376\377\374\1M\323\357\214\25\274\344" \
+  "\1\206\340\363\202\376\377\374\2\320\365\376\31\275\345\212\25\274\344" \
+  "\1L\322\356\203\376\377\374\1\203\334\360\214\25\274\344\1k\327\357\226" \
+  "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+  "\377\377\226\376\377\374\2\370\372\367cu\200\203]oz\5s\206\221\317\324" \
+  "\327\343\350\353\276\303\305ew\202\203]oz\1\210\227\235\202\376\377\374" \
+  "\1\306\314\316\203]oz\1y\214\230\203\347\355\357\2\346\354\356\264\274" \
+  "\305\203]oz\2^p{\357\365\367\202\376\377\374\1p\203\216\203]oz\5k~\211" \
+  "\307\315\317\343\350\353\306\314\316k~\211\203]oz\1p\203\216\202\376" \
+  "\377\374\1\330\335\340\203]oz\1k~\211\204\347\355\357\2\304\311\314_" \
+  "q|\203]oz\1\334\342\344\202\376\377\374\1B\314\347\203\25\274\344\5\0" \
+  "\301\350\233\345\364\333\364\371\260\353\366(\307\350\203\25\274\344" \
+  "\4\0\276\345\367\375\377\376\377\374\357\374\375\204\25\274\344\203\335" \
+  "\366\373\204\25\274\344\3\302\357\367\335\366\373\206\340\363\204\25" \
+  "\274\344\1\356\373\374\202\376\377\374\1\0\301\350\203\25\274\344\1\302" \
+  "\357\367\203\335\366\373\2\302\357\367\0\304\352\203\25\274\344\1\207" \
+  "\341\364\202\376\377\374\1,\311\352\203\25\274\344\5\0\302\351\236\347" \
+  "\366\332\363\370\256\350\364#\304\346\203\25\274\344\5\0\302\351\370" \
+  "\376\377\376\377\374\370\376\377\0\276\345\203\25\274\344\1w\333\356" \
+  "\204\335\366\373\1B\314\347\203\25\274\344\1\231\342\362\202\376\377" \
+  "\374\1\0\276\345\203\25\274\344\2m\332\361\334\365\372\203\335\366\373" \
+  "\1I\320\354\203\25\274\344\1\206\340\363\202\376\377\374\1i\326\356\203" \
+  "\25\274\344\5\0\276\345\206\340\363\323\364\367\273\354\3711\313\354" \
+  "\204\25\274\344\1\335\366\373\202\376\377\374\1,\311\352\203\25\274\344" \
+  "\2L\322\356\332\363\370\203\335\366\373\1n\333\362\203\25\274\344\1k" \
+  "\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\226\376\377\374\1\324\331\333\203]oz\2cu\200\353" \
+  "\360\363\203\376\377\374\1\307\315\317\203]oz\4as~\372\374\371\376\377" \
+  "\374\306\314\316\203]oz\1\202\221\227\205\376\377\374\1hz\205\203]oz" \
+  "\3\341\346\351\376\377\374\347\355\357\203]oz\2^p{\335\343\345\203\376" \
+  "\377\374\1\333\340\343\204]oz\3\347\355\357\376\377\374\330\335\340\203" \
+  "]oz\1m\200\213\205\376\377\374\1~\215\223\203]oz\4\313\320\322\376\377" \
+  "\374\370\376\377\31\275\345\203\25\274\344\1\256\350\364\203\376\377" \
+  "\374\2\336\367\374\0\276\345\203\25\274\344\3\274\355\373\376\377\374" \
+  "\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336\367" \
+  "\374\202\376\377\374\1\0\301\350\203\25\274\344\1\323\364\367\202\376" \
+  "\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374\1n" \
+  "\333\362\203\25\274\344\3m\332\361\376\377\374\356\373\374\204\25\274" \
+  "\344\1\274\355\373\203\376\377\374\2\323\364\367\0\276\345\203\25\274" \
+  "\344\3\315\362\373\376\377\374\335\366\373\203\25\274\344\2\0\276\345" \
+  "\370\376\377\204\376\377\374\1I\320\354\203\25\274\344\3\231\342\362" \
+  "\376\377\374\366\373\376\204\25\274\344\1\366\373\376\204\376\377\374" \
+  "\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\1%\305\347\203" \
+  "\25\274\344\1\207\341\364\203\376\377\374\2\360\375\376\0\304\352\203" \
+  "\25\274\344\1\233\345\364\202\376\377\374\1\0\301\350\203\25\274\344" \
+  "\1\323\364\367\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357" \
+  "\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\226\376\377\374\1\303\310\313\203]oz\1\204\223\231\204\376" \
+  "\377\374\2\370\372\367_q|\203]oz\3\354\361\364\376\377\374\306\314\316" \
+  "\203]oz\1\202\221\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351" \
+  "\376\377\374\326\333\335\203]oz\1n\201\214\205\376\377\374\1l\177\212" \
+  "\203]oz\3\327\334\337\376\377\374\330\335\340\203]oz\1m\200\213\205\376" \
+  "\377\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\337\370\375\203" \
+  "\25\274\344\2\31\275\345\370\376\377\204\376\377\374\1""3\314\355\203" \
+  "\25\274\344\3\236\347\366\376\377\374\357\374\375\204\25\274\344\203" \
+  "\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346" \
+  "\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274" \
+  "\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357" \
+  "\376\377\374\315\362\373\203\25\274\344\1\0\301\350\205\376\377\374\1" \
+  "*\310\351\203\25\274\344\3\261\354\367\376\377\374\316\363\374\203\25" \
+  "\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274\344\3\231" \
+  "\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377\374\1M\323" \
+  "\357\203\25\274\344\1\206\340\363\202\376\377\374\1\31\275\345\203\25" \
+  "\274\344\1\335\366\373\204\376\377\374\1M\323\357\203\25\274\344\1\203" \
+  "\334\360\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204" \
+  "\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\226" \
+  "\376\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202" \
+  "\203]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205" \
+  "\376\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327" \
+  "\203]oz\1as~\205o\202\215\1as~\203]oz\3\317\324\327\376\377\374\330\335" \
+  "\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\3\306\314" \
+  "\316\376\377\374\336\367\374\203\25\274\344\1\0\276\345\205%\305\347" \
+  "\1\0\276\345\203\25\274\344\3\231\342\362\376\377\374\357\374\375\204" \
+  "\25\274\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377" \
+  "\374\1#\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301" \
+  "\350\203\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274" \
+  "\344\3k\327\357\376\377\374\302\357\367\203\25\274\344\1\31\275\345\205" \
+  "%\305\347\1\0\276\345\203\25\274\344\3\237\350\367\376\377\374\316\363" \
+  "\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274" \
+  "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377" \
+  "\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\204\25\274" \
+  "\344\1#\304\346\204%\305\347\1\0\301\350\203\25\274\344\1w\333\356\202" \
+  "\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374" \
+  "\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\226\376\377\374" \
+  "\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202\203]oz\3" \
+  "\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205\376\377" \
+  "\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327\215]oz\3" \
+  "\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377\374" \
+  "\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367\374\215\25\274" \
+  "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\203\376\377" \
+  "\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203\25\274" \
+  "\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367" \
+  "\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357\376\377\374" \
+  "\302\357\367\215\25\274\344\3\237\350\367\376\377\374\316\363\374\203" \
+  "\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274\344\3\231" \
+  "\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377\374\1M\323" \
+  "\357\203\25\274\344\1\206\340\363\202\376\377\374\215\25\274\344\1w\333" \
+  "\356\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376" \
+  "\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\226\376" \
+  "\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374\1ew\202\203" \
+  "]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221\227\205\376" \
+  "\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317\324\327\215" \
+  "]oz\3\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377" \
+  "\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367\374\215\25" \
+  "\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\203\376" \
+  "\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203" \
+  "\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344" \
+  "\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3k\327\357\376" \
+  "\377\374\302\357\367\215\25\274\344\3\237\350\367\376\377\374\316\363" \
+  "\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354\203\25\274" \
+  "\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344\205\376\377" \
+  "\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377\374\215\25\274" \
+  "\344\1w\333\356\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367" \
+  "\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376" \
+  "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+  "\377\226\376\377\374\1\277\304\306\203]oz\1\211\230\236\205\376\377\374" \
+  "\1ew\202\203]oz\3\352\357\362\376\377\374\306\314\316\203]oz\1\202\221" \
+  "\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351\376\377\374\317" \
+  "\324\327\215]oz\3\317\324\327\376\377\374\330\335\340\203]oz\1m\200\213" \
+  "\205\376\377\374\1\202\221\227\203]oz\3\306\314\316\376\377\374\336\367" \
+  "\374\215\25\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274" \
+  "\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374\1#" \
+  "\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350\203" \
+  "\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344\3" \
+  "k\327\357\376\377\374\302\357\367\215\25\274\344\3\237\350\367\376\377" \
+  "\374\316\363\374\203\25\274\344\1\0\301\350\205\376\377\374\1I\320\354" \
+  "\203\25\274\344\3\231\342\362\376\377\374\357\374\375\204\25\274\344" \
+  "\205\376\377\374\1M\323\357\203\25\274\344\1\206\340\363\202\376\377" \
+  "\374\215\25\274\344\1w\333\356\202\376\377\374\1\0\301\350\203\25\274" \
+  "\344\1\336\367\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327" \
+  "\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\226\376\377\374\1\300\305\310\203]oz\1\211\230\236\205" \
+  "\376\377\374\1bt\177\203]oz\3\352\357\362\376\377\374\306\314\316\203" \
+  "]oz\1\202\221\227\205\376\377\374\1m\200\213\203]oz\3\341\346\351\376" \
+  "\377\374\317\324\327\203]oz\1p\203\216\211\335\343\345\3\366\370\364" \
+  "\376\377\374\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221" \
+  "\227\203]oz\3\306\314\316\376\377\374\336\367\374\203\25\274\344\1\0" \
+  "\276\345\211\314\361\372\3\350\371\377\376\377\374\357\374\375\204\25" \
+  "\274\344\203\376\377\374\204\25\274\344\1\336\367\374\202\376\377\374" \
+  "\1#\304\346\203\25\274\344\1\316\363\374\202\376\377\374\1\0\301\350" \
+  "\203\25\274\344\1\336\367\374\204\376\377\374\1w\333\356\203\25\274\344" \
+  "\3k\327\357\376\377\374\302\357\367\203\25\274\344\1\0\302\351\211\314" \
+  "\361\372\3\356\373\374\376\377\374\316\363\374\203\25\274\344\1\0\301" \
+  "\350\205\376\377\374\1I\320\354\203\25\274\344\3\231\342\362\376\377" \
+  "\374\357\374\375\204\25\274\344\205\376\377\374\1M\323\357\203\25\274" \
+  "\344\1\206\340\363\202\376\377\374\204\25\274\344\1\301\356\366\210\314" \
+  "\361\372\1\337\370\375\202\376\377\374\1\0\301\350\203\25\274\344\1\336" \
+  "\367\374\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226" \
+  "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+  "\377\377\226\376\377\374\1\314\321\324\203]oz\2l\177\212\372\374\371" \
+  "\203\376\377\374\1\333\340\343\203]oz\4^p{\366\373\376\376\377\374\306" \
+  "\314\316\203]oz\1\202\221\227\205\376\377\374\1k~\211\203]oz\3\341\346" \
+  "\351\376\377\374\320\326\330\203]oz\1t\207\222\213\376\377\374\1\330" \
+  "\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\3\306" \
+  "\314\316\376\377\374\336\367\374\203\25\274\344\1\0\276\345\213\376\377" \
+  "\374\1\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336" \
+  "\367\374\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374\202" \
+  "\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374\204\376\377\374" \
+  "\1n\333\362\203\25\274\344\3k\327\357\376\377\374\303\361\370\203\25" \
+  "\274\344\1\0\304\352\213\376\377\374\1\332\363\370\203\25\274\344\1\0" \
+  "\276\345\205\376\377\374\1I\320\354\203\25\274\344\3\231\342\362\376" \
+  "\377\374\357\374\375\204\25\274\344\1\370\376\377\204\376\377\374\1M" \
+  "\323\357\203\25\274\344\1\206\340\363\202\376\377\374\204\25\274\344" \
+  "\1\356\373\374\213\376\377\374\1\0\301\350\203\25\274\344\1\335\366\373" \
+  "\204\376\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\226\376\377\374\2\353\360\363^p{\203]oz\5\236\246\256\366\373\376\376" \
+  "\377\374\347\355\357w\212\226\203]oz\1~\215\223\202\376\377\374\1\306" \
+  "\314\316\203]oz\1\202\221\227\204\376\377\374\2\335\343\345^p{\203]o" \
+  "z\3\351\356\360\376\377\374\335\343\345\203]oz\2bt\177\343\350\353\212" \
+  "\376\377\374\1\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221" \
+  "\227\203]oz\3\306\314\316\376\377\374\356\373\374\204\25\274\344\1\274" \
+  "\355\373\212\376\377\374\1\357\374\375\204\25\274\344\203\376\377\374" \
+  "\204\25\274\344\1\336\367\374\202\376\377\374\1#\304\346\203\25\274\344" \
+  "\1\316\363\374\202\376\377\374\1\0\301\350\203\25\274\344\1\336\367\374" \
+  "\203\376\377\374\2\367\375\377/\312\353\203\25\274\344\3\204\335\361" \
+  "\376\377\374\334\365\372\203\25\274\344\2\0\276\345\314\361\372\212\376" \
+  "\377\374\1\356\373\374\204\25\274\344\1\274\355\373\204\376\377\374\1" \
+  "I\320\354\203\25\274\344\4\231\342\362\376\377\374\370\376\377\0\276" \
+  "\345\203\25\274\344\1\257\351\365\204\376\377\374\1M\323\357\203\25\274" \
+  "\344\1\206\340\363\202\376\377\374\1\0\301\350\203\25\274\344\1\233\345" \
+  "\364\213\376\377\374\1#\304\346\203\25\274\344\1\207\341\364\204\376" \
+  "\377\374\1\206\340\363\203\25\274\344\1k\327\357\226\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\227\376" \
+  "\377\374\1\211\230\236\204]oz\3cu\200p\203\216^p{\204]oz\1\277\304\306" \
+  "\202\376\377\374\1\306\314\316\203]oz\1dv\201\203~\215\223\2v\211\225" \
+  "as~\203]oz\1n\201\214\202\376\377\374\2\371\373\370dv\201\203]oz\2bt" \
+  "\177w\212\226\205~\215\223\2\203\222\230\304\311\314\202\376\377\374" \
+  "\1\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]o" \
+  "z\1\306\314\316\202\376\377\374\1(\307\350\203\25\274\344\2\0\276\345" \
+  "*\310\351\205,\311\352\2""1\313\354\207\341\364\202\376\377\374\1\357" \
+  "\374\375\204\25\274\344\203\376\377\374\204\25\274\344\1\336\367\374" \
+  "\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374\202\376\377" \
+  "\374\1\0\301\350\203\25\274\344\1*\310\351\203,\311\352\1\0\302\351\204" \
+  "\25\274\344\4\274\355\373\376\377\374\370\376\377\0\302\351\203\25\274" \
+  "\344\2\31\275\345*\310\351\205,\311\352\2B\314\347\231\342\362\203\376" \
+  "\377\374\1%\305\347\203\25\274\344\2\0\276\345*\310\351\203,\311\352" \
+  "\1\0\301\350\203\25\274\344\1\231\342\362\202\376\377\374\1/\312\353" \
+  "\203\25\274\344\2\0\276\345*\310\351\203,\311\352\1\0\301\350\203\25" \
+  "\274\344\1\206\340\363\202\376\377\374\1G\317\353\204\25\274\344\1(\307" \
+  "\350\205,\311\352\3""1\313\354w\333\356\370\376\377\202\376\377\374\1" \
+  "M\323\357\204\25\274\344\1(\307\350\203,\311\352\1\0\304\352\203\25\274" \
+  "\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\223\377\377\377\227\376\377\374\2\343\350\353ew\202\211]oz\2" \
+  "\177\216\224\373\375\372\202\376\377\374\1\306\314\316\214]oz\1\270\300" \
+  "\311\203\376\377\374\1\253\263\273\213]oz\4_q|\352\357\362\376\377\374" \
+  "\330\335\340\203]oz\1m\200\213\205\376\377\374\1\202\221\227\203]oz\1" \
+  "\306\314\316\202\376\377\374\1\233\345\364\214\25\274\344\3\301\356\366" \
+  "\376\377\374\357\374\375\204\25\274\344\203\376\377\374\204\25\274\344" \
+  "\1\336\367\374\202\376\377\374\1#\304\346\203\25\274\344\1\316\363\374" \
+  "\202\376\377\374\1\0\301\350\213\25\274\344\2,\311\352\370\376\377\202" \
+  "\376\377\374\1\206\340\363\214\25\274\344\1\316\363\374\202\376\377\374" \
+  "\1\233\345\364\214\25\274\344\1\231\342\362\202\376\377\374\1\250\347" \
+  "\371\214\25\274\344\1\206\340\363\202\376\377\374\1\273\354\371\214\25" \
+  "\274\344\1\236\347\366\202\376\377\374\2\313\360\371\0\276\345\213\25" \
+  "\274\344\1k\327\357\226\376\377\374\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\223\377\377\377\230\376\377\374\2\325\332\334gy\204\207" \
+  "]oz\2x\213\227\354\361\364\203\376\377\374\1\306\314\316\213]oz\1\225" \
+  "\235\245\204\376\377\374\2\372\374\371~\221\235\213]oz\3\333\340\343" \
+  "\376\377\374\342\347\352\203]oz\1t\207\222\205\376\377\374\1\211\230" \
+  "\236\203]oz\1\317\324\327\203\376\377\374\1M\323\357\213\25\274\344\4" \
+  "\237\350\367\376\377\374\367\375\377\0\276\345\202\25\274\344\1\0\276" \
+  "\345\203\376\377\374\1\0\301\350\203\25\274\344\1\357\374\375\202\376" \
+  "\377\374\1(\307\350\203\25\274\344\1\335\366\373\202\376\377\374\1\0" \
+  "\302\351\212\25\274\344\2\0\301\350\333\364\371\203\376\377\374\2\370" \
+  "\376\377G\317\353\213\25\274\344\1\273\354\371\203\376\377\374\1M\323" \
+  "\357\213\25\274\344\1\237\350\367\203\376\377\374\1k\327\357\213\25\274" \
+  "\344\1\231\342\362\203\376\377\374\1w\333\356\213\25\274\344\1\206\340" \
+  "\363\203\376\377\374\1\207\341\364\213\25\274\344\1n\333\362\226\376" \
+  "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+  "\377\231\376\377\374\3\351\356\360\231\241\251bt\177\203]oz\3k~\211\257" \
+  "\267\277\370\372\367\204\376\377\374\1\306\314\316\211]oz\3gy\204\261" \
+  "\271\302\373\375\372\205\376\377\374\3\371\373\370\252\262\272dv\201" \
+  "\210]oz\2x\213\227\372\374\371\202\376\377\374\4}\220\233]oz^p{\266\277" \
+  "\307\205\376\377\374\5\311\316\321_q|]ozq\204\217\370\372\367\203\376" \
+  "\377\374\3\370\376\377\211\342\365\0\301\350\210\25\274\344\2\0\304\352" \
+  "\356\373\374\202\376\377\374\1M\323\357\202\25\274\344\1m\332\361\203" \
+  "\376\377\374\1n\333\362\202\25\274\344\1L\322\356\203\376\377\374\1\206" \
+  "\340\363\202\25\274\344\2B\314\347\370\376\377\202\376\377\374\1w\333" \
+  "\356\210\25\274\344\3\0\276\345L\322\356\336\367\374\205\376\377\374" \
+  "\3\370\376\377\204\335\361\0\301\350\210\25\274\344\2(\307\350\366\373" \
+  "\376\203\376\377\374\3\370\376\377\211\342\365\0\301\350\210\25\274\344" \
+  "\2#\304\346\356\373\374\204\376\377\374\2\233\345\364\0\302\351\210\25" \
+  "\274\344\2\0\302\351\337\370\375\204\376\377\374\2\237\350\367#\304\346" \
+  "\210\25\274\344\2\0\301\350\333\364\371\204\376\377\374\2\257\351\365" \
+  "%\305\347\210\25\274\344\2\0\276\345\314\361\372\226\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\233\376" \
+  "\377\374\4\365\372\375\335\343\345\325\332\334\343\350\353\207\376\377" \
+  "\374\1\306\314\316\203]oz\1u\210\224\204\324\331\333\2\335\343\345\373" \
+  "\375\372\211\376\377\374\2\372\374\371\334\342\344\206\324\331\333\2" \
+  "\331\336\341\372\374\371\203\376\377\374\3\373\375\372\332\337\342\343" \
+  "\350\353\207\376\377\374\3\351\356\360\330\335\340\366\373\376\206\376" \
+  "\377\374\2\370\376\377\316\363\374\206\273\354\371\2\302\357\367\366" \
+  "\373\376\204\376\377\374\2\314\361\372\315\362\373\205\376\377\374\2" \
+  "\316\363\374\313\360\371\205\376\377\374\3\332\363\370\312\357\370\370" \
+  "\376\377\204\376\377\374\1\316\363\374\206\273\354\371\2\302\357\367" \
+  "\356\373\374\211\376\377\374\2\370\376\377\314\361\372\206\273\354\371" \
+  "\2\302\357\367\367\375\377\206\376\377\374\2\370\376\377\316\363\374" \
+  "\206\273\354\371\2\302\357\367\366\373\376\206\376\377\374\2\370\376" \
+  "\377\316\363\374\206\273\354\371\2\301\356\366\357\374\375\207\376\377" \
+  "\374\1\332\363\370\206\273\354\371\2\301\356\366\356\373\374\207\376" \
+  "\377\374\2\333\364\371\274\355\373\205\273\354\371\2\274\355\373\350" \
+  "\371\377\227\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\246\376\377\374\1\306\314\316\203]oz\1\202\221\227" \
+  "\377\376\377\374\306\376\377\374\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\223\377\377\377\246\376\377\374\1\306\314\316\203]oz\1\202" \
+  "\221\227\377\376\377\374\306\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\246\376\377\374\1\306\314\316\203" \
+  "]oz\1\202\221\227\377\376\377\374\306\376\377\374\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\223\377\377\377\246\376\377\374\1\306\314" \
+  "\316\203]oz\1\202\221\227\377\376\377\374\306\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\246\376\377\374" \
+  "\1\315\322\325\203]oz\1\211\230\236\377\376\377\374\306\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\246\376" \
+  "\377\374\2\360\366\370i{\206\202]oz\1\302\307\312\377\376\377\374\306" \
+  "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+  "\377\377\247\376\377\374\3\357\365\367\313\320\322\335\343\345\377\376" \
+  "\377\374\307\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361" \
+  "\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377" \
+  "\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377" \
+  "\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374" \
+  "\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223" \
+  "\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377" \
+  "\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377" \
+  "\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376\377" \
+  "\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\223\377\377\377\377\376\377\374\361\376\377\374\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\223\377\377\377\377\376\377\374\361\376" \
+  "\377\374\377\377\377\377\377\377\377\377\377\377\377\377\223\377\377" \
+  "\377\377\376\377\374\361\376\377\374\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\223\377\377\377\377\376\377\374\361\376\377\374\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\223\377\377\377\377\376" \
+  "\377\374\361\376\377\374\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" \
+  "\377\377\377\377\232\377\377\377")
+
+
diff --git a/meta/recipes-core/psplash/psplash_git.bb b/meta/recipes-core/psplash/psplash_git.bb
new file mode 100644
index 0000000..b3b6479
--- /dev/null
+++ b/meta/recipes-core/psplash/psplash_git.bb
@@ -0,0 +1,122 @@
+SUMMARY = "Userspace framebuffer boot logo based on usplash"
+DESCRIPTION = "PSplash is a userspace graphical boot splash screen for mainly embedded Linux devices supporting a 16bpp or 32bpp framebuffer. It has few dependencies (just libc), supports basic images and text and handles rotation. Its visual look is configurable by basic source changes. Also included is a 'client' command utility for sending information to psplash such as boot progress information."
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/psplash"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://psplash.h;beginline=1;endline=16;md5=840fb2356b10a85bed78dd09dc7745c6"
+
+SRCREV = "14c8f7b705de944beb4de3f296506d80871e410f"
+PV = "0.1+git${SRCPV}"
+PR = "r15"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN} \
+           file://0001-psplash-fb-Convert-psplash_fb_plot_pixel-to-a-static.patch \
+           file://psplash-init \
+           ${SPLASH_IMAGES}"
+
+SPLASH_IMAGES = "file://psplash-poky-img.h;outsuffix=default"
+
+python __anonymous() {
+    oldpkgs = d.getVar("PACKAGES", True).split()
+    splashfiles = d.getVar('SPLASH_IMAGES', True).split()
+    pkgs = []
+    localpaths = []
+    haspng = False
+    for uri in splashfiles:
+        fetcher = bb.fetch2.Fetch([uri], d)
+        flocal = os.path.basename(fetcher.localpath(uri))
+        fbase = os.path.splitext(flocal)[0]
+        outsuffix = fetcher.ud[uri].parm.get("outsuffix")
+        if not outsuffix:
+            if fbase.startswith("psplash-"):
+                outsuffix = fbase[8:]
+            else:
+                outsuffix = fbase
+            if outsuffix.endswith('-img'):
+                outsuffix = outsuffix[:-4]
+        outname = "psplash-%s" % outsuffix
+        if outname == '' or outname in oldpkgs:
+            bb.fatal("The output name '%s' derived from the URI %s is not valid, please specify the outsuffix parameter" % (outname, uri))
+        else:
+            pkgs.append(outname)
+        if flocal.endswith(".png"):
+            haspng = True
+        localpaths.append(flocal)
+
+    # Set these so that we have less work to do in do_compile and do_install_append
+    d.setVar("SPLASH_INSTALL", " ".join(pkgs))
+    d.setVar("SPLASH_LOCALPATHS", " ".join(localpaths))
+
+    if haspng:
+        d.appendVar("DEPENDS", " gdk-pixbuf-native")
+
+    d.prependVar("PACKAGES", "%s " % (" ".join(pkgs)))
+    mlprefix = d.getVar('MLPREFIX', True) or ''
+    pn = d.getVar('PN', True) or ''
+    for p in pkgs:
+        ep = '%s%s' % (mlprefix, p)
+        epsplash = '%s%s' % (mlprefix, 'psplash')
+        d.setVar("FILES_%s" % ep, "${bindir}/%s" % p)
+        d.setVar("ALTERNATIVE_%s" % ep, 'psplash')
+        d.setVarFlag("ALTERNATIVE_TARGET_%s" % ep, 'psplash', '${bindir}/%s' % p)
+        d.appendVar("RDEPENDS_%s" % ep, " %s" % pn)
+        if p == "psplash-default":
+            d.appendVar("RRECOMMENDS_%s" % pn, " %s" % ep)
+}
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig update-rc.d update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_LINK_NAME[psplash] = "${bindir}/psplash"
+
+python do_compile () {
+    import shutil
+
+    # Build a separate executable for each splash image
+    workdir = d.getVar('WORKDIR', True)
+    convertscript = "%s/make-image-header.sh" % d.getVar('S', True)
+    destfile = "%s/psplash-poky-img.h" % d.getVar('S', True)
+    localfiles = d.getVar('SPLASH_LOCALPATHS', True).split()
+    outputfiles = d.getVar('SPLASH_INSTALL', True).split()
+    for localfile, outputfile in zip(localfiles, outputfiles):
+        if localfile.endswith(".png"):
+            outp = oe.utils.getstatusoutput('%s %s POKY' % (convertscript, os.path.join(workdir, localfile)))
+            print(outp[1])
+            fbase = os.path.splitext(localfile)[0]
+            shutil.copyfile("%s-img.h" % fbase, destfile)
+        else:
+            shutil.copyfile(os.path.join(workdir, localfile), destfile)
+        # For some reason just updating the header is not enough, we have to touch the .c
+        # file in order to get it to rebuild
+        os.utime("%s/psplash.c" % d.getVar('S', True), None)
+        bb.build.exec_func("oe_runmake", d)
+        shutil.copyfile("psplash", outputfile)
+}
+
+do_install_append() {
+	install -d ${D}/mnt/.psplash/
+	install -d ${D}${sysconfdir}/init.d/
+	install -m 0755 ${WORKDIR}/psplash-init ${D}${sysconfdir}/init.d/psplash.sh
+	install -d ${D}${bindir}
+	for i in ${SPLASH_INSTALL} ; do
+		install -m 0755 $i ${D}${bindir}/$i
+	done
+	rm -f ${D}${bindir}/psplash
+}
+
+FILES_${PN} += "/mnt/.psplash"
+
+INITSCRIPT_NAME = "psplash.sh"
+INITSCRIPT_PARAMS = "start 0 S . stop 20 0 1 6 ."
+
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask psplash.service
+	fi
+}
diff --git a/meta/recipes-core/readline/files/config-dirent-symbols.patch b/meta/recipes-core/readline/files/config-dirent-symbols.patch
new file mode 100644
index 0000000..cfff03c
--- /dev/null
+++ b/meta/recipes-core/readline/files/config-dirent-symbols.patch
@@ -0,0 +1,34 @@
+Fix the names of the STRUCT_DIRENT_D symbols to match the names used by both
+configure and the source code.
+
+Upstream-Status: Submitted (http://lists.gnu.org/archive/html/bug-readline/2014-05/msg00008.html)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From e48656811550774892fd4e0f4b3c7d418422da52 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 27 May 2014 22:32:31 +0100
+Subject: [PATCH] config.h.in: fix names of STRUCT_DIRENT_D symbols
+
+---
+ config.h.in |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/config.h.in b/config.h.in
+index a67e43e..a42acc5 100644
+--- a/config.h.in
++++ b/config.h.in
+@@ -244,9 +244,9 @@
+ 
+ #undef HAVE_GETPW_DECLS
+ 
+-#undef STRUCT_DIRENT_HAS_D_INO
++#undef HAVE_STRUCT_DIRENT_D_INO
+ 
+-#undef STRUCT_DIRENT_HAS_D_FILENO
++#undef HAVE_STRUCT_DIRENT_D_FILENO
+ 
+ #undef HAVE_BSD_SIGNALS
+ 
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-core/readline/files/norpath.patch b/meta/recipes-core/readline/files/norpath.patch
new file mode 100644
index 0000000..5d71582
--- /dev/null
+++ b/meta/recipes-core/readline/files/norpath.patch
@@ -0,0 +1,21 @@
+This support script ends up hardcoding unnecessary rpaths into the libraries. We
+will search $libdir automatically so this is just wastes space. There may be some
+cases this is necessary but our use cases aren't one of them.
+
+Upstream-Status: Inappropriate
+
+RP 2012/2/23
+
+Index: readline-6.2/support/shobj-conf
+===================================================================
+--- readline-6.2.orig/support/shobj-conf	2012-02-23 11:06:37.193179379 +0000
++++ readline-6.2/support/shobj-conf	2012-02-23 11:06:50.049178918 +0000
+@@ -114,7 +114,7 @@
+ 	SHOBJ_LD='${CC}'
+ 	SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
+ 
+-	SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
++	SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+ 	SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+ 	;;
+ 
diff --git a/meta/recipes-core/readline/readline-5.2/configure-fix.patch b/meta/recipes-core/readline/readline-5.2/configure-fix.patch
new file mode 100644
index 0000000..be60a98
--- /dev/null
+++ b/meta/recipes-core/readline/readline-5.2/configure-fix.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+Without this it fails to link against libtermcap causing various missing symbols 
+issues.
+
+RP - 8/10/08
+
+Index: readline-5.2/configure.in
+===================================================================
+--- readline-5.2.orig/configure.in	2008-10-08 09:58:52.000000000 +0100
++++ readline-5.2/configure.in	2008-10-08 09:59:03.000000000 +0100
+@@ -211,10 +211,10 @@
+         AC_MSG_CHECKING(configuration for building shared libraries)
+         eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+ 
+-#	case "$SHLIB_LIBS" in
+-#	*curses*|*termcap*|*termlib*)	;;
+-#	*)			SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
+-#	esac
++	case "$SHLIB_LIBS" in
++	*curses*|*termcap*|*termlib*)	;;
++	*)			SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
++	esac
+ 	
+         AC_SUBST(SHOBJ_CC)
+         AC_SUBST(SHOBJ_CFLAGS)
diff --git a/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch b/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch
new file mode 100644
index 0000000..3166b47
--- /dev/null
+++ b/meta/recipes-core/readline/readline-5.2/fix-redundant-rpath.patch
@@ -0,0 +1,21 @@
+This support script ends up hardcoding unnecessary rpaths into the libraries. We
+will search $libdir automatically so this is just wastes space. There may be some
+cases this is necessary but our use cases aren't one of them.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: readline-5.2/support/shobj-conf
+===================================================================
+--- readline-5.2.orig/support/shobj-conf
++++ readline-5.2/support/shobj-conf
+@@ -110,7 +110,7 @@ linux*-*|gnu*-*|k*bsd*-gnu-*)
+ 	SHOBJ_LD='${CC}'
+ 	SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
+ 
+-	SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
++	SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
+ 	SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
+ 	;;
+ 
diff --git a/meta/recipes-core/readline/readline-6.3/configure-fix.patch b/meta/recipes-core/readline/readline-6.3/configure-fix.patch
new file mode 100644
index 0000000..ef3104f
--- /dev/null
+++ b/meta/recipes-core/readline/readline-6.3/configure-fix.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+Without this it fails to link against libtermcap causing various missing
+symbols issues.
+
+RP - 8/10/08
+
+Support 6.3 which uses configure.ac rather than configure.in.
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.ac | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index cea8f91..9075b8f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -218,10 +218,10 @@ if test -f ${srcdir}/support/shobj-conf; then
+         AC_MSG_CHECKING(configuration for building shared libraries)
+         eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
+ 
+-#	case "$SHLIB_LIBS" in
+-#	*curses*|*termcap*|*termlib*)	;;
+-#	*)			SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
+-#	esac
++	case "$SHLIB_LIBS" in
++	*curses*|*termcap*|*termlib*)	;;
++	*)			SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
++	esac
+ 	
+         AC_SUBST(SHOBJ_CC)
+         AC_SUBST(SHOBJ_CFLAGS)
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-core/readline/readline-6.3/readline-dispatch-multikey.patch b/meta/recipes-core/readline/readline-6.3/readline-dispatch-multikey.patch
new file mode 100644
index 0000000..54d1ac6
--- /dev/null
+++ b/meta/recipes-core/readline/readline-6.3/readline-dispatch-multikey.patch
@@ -0,0 +1,32 @@
+From 8ef852a5be72c75e17f2510bea52455f809b56ce Mon Sep 17 00:00:00 2001
+From: Chet Ramey <chet.ramey@case.edu>
+Date: Fri, 28 Mar 2014 14:07:42 -0400
+Subject: [PATCH 04/10] Readline-6.3 patch 2
+
+Fixes multi-key issue identified in this thread:
+http://lists.gnu.org/archive/html/bug-readline/2014-03/msg00010.html
+
+Upstream-Status: Backport
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ readline.c | 3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/readline.c b/readline.c
+index eb4eae3..abb29a0 100644
+--- a/readline.c
++++ b/readline.c
+@@ -744,7 +744,8 @@ _rl_dispatch_callback (cxt)
+     r = _rl_subseq_result (r, cxt->oldmap, cxt->okey, (cxt->flags & KSEQ_SUBSEQ));
+ 
+   RL_CHECK_SIGNALS ();
+-  if (r == 0)			/* success! */
++  /* We only treat values < 0 specially to simulate recursion. */
++  if (r >= 0 || (r == -1 && (cxt->flags & KSEQ_SUBSEQ) == 0))	/* success! or failure! */
+     {
+       _rl_keyseq_chain_dispose ();
+       RL_UNSETSTATE (RL_STATE_MULTIKEY);
+-- 
+1.8.3.1
+
diff --git a/meta/recipes-core/readline/readline-6.3/readline63-003 b/meta/recipes-core/readline/readline-6.3/readline63-003
new file mode 100644
index 0000000..98a9d81
--- /dev/null
+++ b/meta/recipes-core/readline/readline-6.3/readline63-003
@@ -0,0 +1,43 @@
+readline: Security Advisory - readline - CVE-2014-2524
+
+Upstream-Status: Backport
+
+Signed-off-by: Yue Tao <yue.tao@windriver.com>
+
+			   READLINE PATCH REPORT
+			   =====================
+
+Readline-Release: 6.3
+Patch-ID: readline63-003
+
+Bug-Reported-by:
+Bug-Reference-ID:
+Bug-Reference-URL:
+
+Bug-Description:
+
+There are debugging functions in the readline release that are theoretically
+exploitable as security problems.  They are not public functions, but have
+global linkage.
+
+Patch (apply with `patch -p0'):
+
+*** ../readline-6.3/util.c	2013-09-02 13:36:12.000000000 -0400
+--- util.c	2014-03-20 10:25:53.000000000 -0400
+***************
+*** 477,480 ****
+--- 479,483 ----
+  }
+  
++ #if defined (DEBUG)
+  #if defined (USE_VARARGS)
+  static FILE *_rl_tracefp;
+***************
+*** 539,542 ****
+--- 542,546 ----
+  }
+  #endif
++ #endif /* DEBUG */
+  
+  
+
diff --git a/meta/recipes-core/readline/readline.inc b/meta/recipes-core/readline/readline.inc
new file mode 100644
index 0000000..3f662c3
--- /dev/null
+++ b/meta/recipes-core/readline/readline.inc
@@ -0,0 +1,39 @@
+SUMMARY = "Library for editing typed command lines"
+DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
+command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes  \
+additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those   \
+lines, and perform csh-like history expansion on previous commands."
+SECTION = "libs"
+
+# GPLv2+ (< 6.0), GPLv3+ (>= 6.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS += "ncurses"
+
+SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive \
+           file://configure-fix.patch \
+           file://config-dirent-symbols.patch \
+           file://norpath.patch"
+
+inherit autotools texinfo
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+LEAD_SONAME = "libreadline.so"
+
+do_configure_prepend () {
+	if [ ! -e ${S}/acinclude.m4 ]; then
+		cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+	fi
+}
+
+do_install_append () {
+	# Make install doesn't properly install these
+	oe_libinstall -so -C shlib libhistory ${D}${libdir}
+	oe_libinstall -so -C shlib libreadline ${D}${libdir}
+
+	rmdir ${D}${bindir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/readline/readline_5.2.bb b/meta/recipes-core/readline/readline_5.2.bb
new file mode 100644
index 0000000..c1007a2
--- /dev/null
+++ b/meta/recipes-core/readline/readline_5.2.bb
@@ -0,0 +1,84 @@
+SUMMARY = "Library for editing typed command lines"
+DESCRIPTION = "The GNU Readline library provides a set of functions for use by applications that allow users to edit \
+command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes  \
+additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those   \
+lines, and perform csh-like history expansion on previous commands."
+SECTION = "libs"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=03b36fdd84f74b8d8189a202b980b67f"
+
+DEPENDS += "ncurses"
+
+PR = "r9"
+
+SRC_URI = "${GNU_MIRROR}/readline/${BPN}-${PV}.tar.gz;name=archive \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-001;name=patch1;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-002;name=patch2;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-003;name=patch3;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-004;name=patch4;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-005;name=patch5;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-006;name=patch6;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-007;name=patch7;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-008;name=patch8;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-009;name=patch9;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-010;name=patch10;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-011;name=patch11;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-012;name=patch12;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-013;name=patch13;apply=yes;striplevel=0 \
+           ${GNU_MIRROR}/readline/readline-5.2-patches/readline52-014;name=patch14;apply=yes;striplevel=0 \
+           file://configure-fix.patch \
+           file://config-dirent-symbols.patch \
+           file://fix-redundant-rpath.patch"
+
+SRC_URI[archive.md5sum] = "e39331f32ad14009b9ff49cc10c5e751"
+SRC_URI[archive.sha256sum] = "12e88d96aee2cd1192500356f0535540db499282ca7f76339fb4228c31249f45"
+
+SRC_URI[patch1.md5sum]    = "9d4d41622aa9b230c57f68548ce87d8f"
+SRC_URI[patch1.sha256sum] = "eac304c369154059f93049ada328739faaf40338d3cb1fb4b544c93d5ce3f8d5"
+SRC_URI[patch2.md5sum]    = "f03e512d14206e37f7d6a748b56b9476"
+SRC_URI[patch2.sha256sum] = "9deacaef25507a0c2ae0b661bf9342559b59a2954d66ea3c5f5bcd900fdfcf78"
+SRC_URI[patch3.md5sum]    = "252b42d8750f1a94b6bdf086612dceb2"
+SRC_URI[patch3.sha256sum] = "2a55d2ecb1c9b0147aeb193a6323616ab31c1c525a83b2db3a994b15594ba934"
+SRC_URI[patch4.md5sum]    = "a32333c2e603a3ed250514e91050e552"
+SRC_URI[patch4.sha256sum] = "a03b65633781efa7c3aae5d57162985e7b7a3c10acf0f2621be610e16f27e5f2"
+SRC_URI[patch5.md5sum]    = "8106796c09b789523a3a78ab69c04b6d"
+SRC_URI[patch5.sha256sum] = "06001896514148a757ea6edbbd40c4fc4331dc653847244386c37b138b150f64"
+SRC_URI[patch6.md5sum]    = "512188e2bf0837f7eca19dbf71f182ae"
+SRC_URI[patch6.sha256sum] = "dfef3e982c0adf8bb5a9b7d0468ec8f5f18138b325e28759437464de5be71013"
+SRC_URI[patch7.md5sum]    = "ac17aca62eb6fb398c9f2fe9de540aff"
+SRC_URI[patch7.sha256sum] = "775b028c7b761397ac6ae1bdfbac7e896dc3b9b3adc2f91312499180ca13bdd1"
+SRC_URI[patch8.md5sum]    = "2484c392db021905f112cf97a94dfd4c"
+SRC_URI[patch8.sha256sum] = "a21b4e0bf0530b878bad24d5be23d18a9e03a75a31ae30844dc0933bb3d77ecd"
+SRC_URI[patch9.md5sum]    = "fc6eb35d07914fae5c57d49c12483ff7"
+SRC_URI[patch9.sha256sum] = "138d5e0f0709a47a2d1621295a3dd5e3cc73b63b5cc28dab03abc4e94fe95ecf"
+SRC_URI[patch10.md5sum]    = "7a2bf3dc7ac7680b1461a5701100e91b"
+SRC_URI[patch10.sha256sum] = "83f8c1aadb86b1a2fad8821a9c6be72a8de5afd7fd9fde58a30b3b57d939693e"
+SRC_URI[patch11.md5sum]    = "ef6cef6822663470f6ac8c517c5a7ec6"
+SRC_URI[patch11.sha256sum] = "08ad3384ab0906e6fa4cc417eb8c43ff59375bcead15fd5c8e31730f0413b3d6"
+SRC_URI[patch12.md5sum]    = "e3e9f441c8111589855bc363e5640f6c"
+SRC_URI[patch12.sha256sum] = "20f0243be2299c23213492cc2c19cfd15cc528d2b566a76a2de58306bb9e4c9e"
+SRC_URI[patch13.md5sum]    = "3e2e5f543ed268a68fd1fa839faade1a"
+SRC_URI[patch13.sha256sum] = "0cc649516a5bdfa61c5e56937407570288b6972d75aa1bd060ad30ebe98144d5"
+SRC_URI[patch14.md5sum]    = "a1be30e1c6f1099bb5fcef00a2631fb8"
+SRC_URI[patch14.sha256sum] = "6f1a68320d01522ca1ea5a737124ecc8739f3dcbfea2dee21e3ccf839a21a817"
+
+inherit autotools
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+LEAD_SONAME = "libreadline.so"
+
+do_configure_prepend () {
+	if [ ! -e ${S}/acinclude.m4 ]; then
+		cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+	fi
+}
+
+do_install_append () {
+	# Make install doesn't properly install these
+	oe_libinstall -so -C shlib libhistory ${D}${libdir}
+	oe_libinstall -so -C shlib libreadline ${D}${libdir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-core/readline/readline_6.3.bb b/meta/recipes-core/readline/readline_6.3.bb
new file mode 100644
index 0000000..55964a6
--- /dev/null
+++ b/meta/recipes-core/readline/readline_6.3.bb
@@ -0,0 +1,8 @@
+require readline.inc
+
+SRC_URI += "file://readline63-003 \
+            file://readline-dispatch-multikey.patch"
+
+SRC_URI[archive.md5sum] = "33c8fb279e981274f485fd91da77e94a"
+SRC_URI[archive.sha256sum] = "56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43"
+
diff --git a/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch
new file mode 100644
index 0000000..9d828d7
--- /dev/null
+++ b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [http://sourceforge.net/tracker/?func=detail&aid=3600345&group_id=44427&atid=439544]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd sysfsutils-2.1.0/configure.ac sysfsutils-2.1.0/configure.ac
+--- sysfsutils-2.1.0/configure.ac	2006-08-07 08:08:00.000000000 +0300
++++ sysfsutils-2.1.0/configure.ac	2013-01-11 08:13:08.651550634 +0200
+@@ -2,7 +2,7 @@
+ AC_INIT(sysfsutils, 2.1.0, linux-diag-devel@lists.sourceforge.net)
+ AM_INIT_AUTOMAKE
+ AC_CONFIG_SRCDIR([config.h.in])
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ # Checks for KLIBC support (should be before AC_PROG_LIBTOOL and AC_PROG_CC)
+ AC_CHECK_KLIBC
diff --git a/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch
new file mode 100644
index 0000000..82e725e
--- /dev/null
+++ b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/separatebuild.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Pending
+
+Fix out of tree build issues so ${B} != ${S} works.
+
+RP 2013/03/18
+
+Index: sysfsutils-2.1.0/cmd/Makefile.am
+===================================================================
+--- sysfsutils-2.1.0.orig/cmd/Makefile.am	2013-03-08 08:57:27.224556508 +0000
++++ sysfsutils-2.1.0/cmd/Makefile.am	2013-03-08 08:57:27.480556502 +0000
+@@ -1,6 +1,6 @@
+ bin_PROGRAMS = systool 
+ systool_SOURCES = systool.c names.c names.h
+-INCLUDES = -I../include
++INCLUDES = -I$(srcdir)/../include
+ LDADD = ../lib/libsysfs.la
+ EXTRA_CFLAGS = @EXTRA_CFLAGS@
+ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CFLAGS)
+Index: sysfsutils-2.1.0/lib/Makefile.am
+===================================================================
+--- sysfsutils-2.1.0.orig/lib/Makefile.am	2013-03-08 08:57:27.224556508 +0000
++++ sysfsutils-2.1.0/lib/Makefile.am	2013-03-08 08:57:27.480556502 +0000
+@@ -1,7 +1,7 @@
+ lib_LTLIBRARIES = libsysfs.la
+ libsysfs_la_SOURCES = sysfs_utils.c sysfs_attr.c sysfs_class.c dlist.c \
+       sysfs_device.c sysfs_driver.c sysfs_bus.c sysfs_module.c sysfs.h
+-INCLUDES = -I../include
++INCLUDES = -I$(srcdir)/../include
+ libsysfs_la_LDFLAGS = -version-info 2:1:0
+ EXTRA_CFLAGS = @EXTRA_CLFAGS@
+ libsysfs_la_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CLFAGS)
+Index: sysfsutils-2.1.0/test/Makefile.am
+===================================================================
+--- sysfsutils-2.1.0.orig/test/Makefile.am	2013-03-08 08:57:27.224556508 +0000
++++ sysfsutils-2.1.0/test/Makefile.am	2013-03-08 09:06:48.196543326 +0000
+@@ -2,14 +2,14 @@
+ BUILT_SOURCES = test.h
+ CLEANFILES = test.h
+ test.h:
+-	./create-test
++	$(srcdir)/create-test $(srcdir)/libsysfs.conf
+ get_device_SOURCES = get_device.c
+ get_driver_SOURCES = get_driver.c
+ get_module_SOURCES = get_module.c
+ testlibsysfs_SOURCES = test.c test_attr.c test_bus.c test_class.c \
+ 		       test_device.c test_driver.c test_module.c test_utils.c \
+ 		       testout.c test-defs.h libsysfs.conf create-test
+-INCLUDES = -I../include
++INCLUDES = -I$(srcdir)/../include
+ LDADD = ../lib/libsysfs.la
+ EXTRA_CFLAGS = @EXTRA_CLFAGS@
+ AM_CFLAGS = -Wall -W -Wstrict-prototypes $(EXTRA_CLFAGS)
+Index: sysfsutils-2.1.0/test/create-test
+===================================================================
+--- sysfsutils-2.1.0.orig/test/create-test	2005-11-28 10:22:10.000000000 +0000
++++ sysfsutils-2.1.0/test/create-test	2013-03-08 09:07:03.372542838 +0000
+@@ -2,7 +2,7 @@
+ 
+ rm -f test.h
+ 
+-conf_file=./libsysfs.conf
++conf_file=$1
+ 
+ . $conf_file
+ 
diff --git a/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch
new file mode 100644
index 0000000..1a35b78
--- /dev/null
+++ b/meta/recipes-core/sysfsutils/sysfsutils-2.1.0/sysfsutils-2.0.0-class-dup.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport [from fedora core 9]
+
+This patch is from the Fedora Core 9 sysfsutils-2.1.0-3.fc9 package.
+
+It fixes a problem in the upstream package where not all devices 
+will be returned by the function.
+
+The package License indicates this is GPLv2 licensed.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -puN lib/sysfs_class.c~sysfsutils_class_dup lib/sysfs_class.c
+--- sysfsutils-2.1.0/lib/sysfs_class.c~sysfsutils_class_dup	2006-09-07 17:01:26.000000000 -0500
++++ sysfsutils-2.1.0-bjking1/lib/sysfs_class.c	2006-09-07 17:01:26.000000000 -0500
+@@ -66,7 +66,7 @@ static int cdev_name_equal(void *a, void
+ 		return 0;
+ 
+ 	if (strncmp((char *)a, ((struct sysfs_class_device *)b)->name,
+-				strlen((char *)a)) == 0)
++				SYSFS_NAME_LEN) == 0)
+ 		return 1;
+ 
+ 	return 0;
diff --git a/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb b/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
new file mode 100644
index 0000000..b9f40f4
--- /dev/null
+++ b/meta/recipes-core/sysfsutils/sysfsutils_2.1.0.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Tools for working with sysfs"
+DESCRIPTION = "Tools for working with the sysfs virtual filesystem.  The tool 'systool' can query devices by bus, class and topology."
+HOMEPAGE = "http://linux-diag.sourceforge.net/Sysfsutils.html"
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LICENSE_${PN} = "GPLv2"
+LICENSE_libsysfs = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3d06403ea54c7574a9e581c6478cc393 \
+                    file://cmd/GPL;md5=d41d4e2e1e108554e0388ea4aecd8d27 \
+                    file://lib/LGPL;md5=b75d069791103ffe1c0d6435deeff72e"
+PR = "r5"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/linux-diag/sysfsutils-${PV}.tar.gz \
+           file://sysfsutils-2.0.0-class-dup.patch \
+           file://obsolete_automake_macros.patch \
+           file://separatebuild.patch"
+
+SRC_URI[md5sum] = "14e7dcd0436d2f49aa403f67e1ef7ddc"
+SRC_URI[sha256sum] = "e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a"
+S = "${WORKDIR}/sysfsutils-${PV}"
+
+inherit autotools
+
+PACKAGES =+ "libsysfs"
+FILES_libsysfs = "${libdir}/lib*${SOLIBS}"
+FILES_libsysfs-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}"
+FILES_libsysfs-staticdev = "${libdir}/lib*.a"
+
+export libdir = "${base_libdir}"
diff --git a/meta/recipes-core/systemd/systemd-compat-units.bb b/meta/recipes-core/systemd/systemd-compat-units.bb
new file mode 100644
index 0000000..0b8ff09
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Enhances systemd compatilibity with existing SysVinit scripts"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+
+PR = "r29"
+
+DEPENDS = "systemd-systemctl-native"
+
+S = "${WORKDIR}"
+
+inherit allarch
+
+ALLOW_EMPTY_${PN} = "1"
+
+SYSTEMD_DISABLED_SYSV_SERVICES = " \
+  busybox-udhcpc \
+  hwclock \
+  networking \
+  nfsserver \
+  nfscommon \
+  syslog.busybox \
+"
+
+pkg_postinst_${PN} () {
+	cd $D${sysconfdir}/init.d
+
+	echo "Disabling the following sysv scripts: "
+
+	OPTS=""
+
+	if [ -n "$D" ]; then
+		OPTS="--root=$D"
+	fi
+
+	for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
+		if [ \( -e $i -o $i.sh \) -a ! \( -e $D${sysconfdir}/systemd/system/$i.service -o  -e $D${systemd_unitdir}/system/$i.service \) ] ; then
+			echo -n "$i: " ; systemctl ${OPTS} mask $i.service
+		fi
+	done ; echo
+}
+
+RDPEPENDS_${PN} = "systemd"
diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb
new file mode 100644
index 0000000..768b130
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Serial terminal support for systemd"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+PR = "r5"
+
+SERIAL_CONSOLE ?= "115200 ttyS0"
+
+SRC_URI = "file://serial-getty@.service"
+
+S = "${WORKDIR}"
+
+do_install() {
+	if [ ! -z "${SERIAL_CONSOLES}" ] ; then
+		default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'`
+		install -d ${D}${systemd_unitdir}/system/
+		install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
+		install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/
+		sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service
+
+		tmp="${SERIAL_CONSOLES}"
+		for entry in $tmp ; do
+			baudrate=`echo $entry | sed 's/\;.*//'`
+			ttydev=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
+			if [ "$baudrate" = "$default_baudrate" ] ; then
+				# enable the service
+				ln -sf ${systemd_unitdir}/system/serial-getty@.service \
+					${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service
+			else
+				# install custom service file for the non-default baudrate
+				install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
+				sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
+				# enable the service
+				ln -sf ${systemd_unitdir}/system/serial-getty$baudrate@.service \
+					${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service
+			fi
+		done
+	fi
+}
+
+RDEPENDS_${PN} = "systemd"
+
+# This is a machine specific file
+FILES_${PN} = "${systemd_unitdir}/system/*.service ${sysconfdir}"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# As this package is tied to systemd, only build it when we're also building systemd.
+python () {
+    if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+        raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
+}
diff --git a/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
new file mode 100644
index 0000000..182167b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
@@ -0,0 +1,37 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU Lesser General Public License as published by
+#  the Free Software Foundation; either version 2.1 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=Serial Getty on %I
+Documentation=man:agetty(8) man:systemd-getty-generator(8)
+Documentation=http://0pointer.de/blog/projects/serial-console.html
+BindsTo=dev-%i.device
+After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
+After=rc-local.service
+
+# If additional gettys are spawned during boot then we should make
+# sure that this is synchronized before getty.target, even though
+# getty.target didn't actually pull it in.
+Before=getty.target
+IgnoreOnIsolate=yes
+
+[Service]
+Environment="TERM=xterm"
+ExecStart=-/sbin/agetty -8 -L --keep-baud %I @BAUDRATE@ $TERM
+Type=idle
+Restart=always
+RestartSec=0
+UtmpIdentifier=%I
+TTYPath=/dev/%I
+TTYReset=yes
+TTYVHangup=yes
+KillMode=process
+IgnoreSIGPIPE=no
+SendSIGHUP=yes
+
+[Install]
+WantedBy=getty.target
diff --git a/meta/recipes-core/systemd/systemd-systemctl-native.bb b/meta/recipes-core/systemd/systemd-systemctl-native.bb
new file mode 100644
index 0000000..fbdc9c0
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-systemctl-native.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Wrapper for enabling systemd services"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+
+PR = "r6"
+
+inherit native
+
+SRC_URI = "file://systemctl"
+
+S = "${WORKDIR}"
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 ${WORKDIR}/systemctl ${D}${bindir}
+}
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
new file mode 100755
index 0000000..6e163bd
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,182 @@
+#!/bin/sh
+echo "Started $0 $*"
+
+ROOT=
+
+# parse command line params
+action=
+while [ $# != 0 ]; do
+	opt="$1"
+
+	case "$opt" in
+		enable)
+			shift
+
+			action="$opt"
+			services="$1"
+			cmd_args="1"
+			shift
+			;;
+		disable)
+			shift
+
+			action="$opt"
+			services="$1"
+			cmd_args="1"
+			shift
+			;;
+		mask)
+			shift
+
+			action="$opt"
+			services="$1"
+			cmd_args="1"
+			shift
+			;;
+		preset)
+			shift
+
+			action="$opt"
+			services="$1"
+			cmd_args="1"
+			shift
+			;;
+		--root=*)
+			ROOT=${opt##--root=}
+			cmd_args="0"
+			shift
+			;;
+		*)
+			if [ "$cmd_args" = "1" ]; then
+				services="$services $opt" 
+				shift
+			else
+				echo "'$opt' is an unkown option; exiting with error"
+				exit 1
+			fi
+			;;
+	esac
+done
+if [ "$action" = "preset" -a "$service_file" = "" ]; then
+	services=$(for f in `find $ROOT/etc/systemd/system $ROOT/lib/systemd/system $ROOT/usr/lib/systemd/system -type f 2>1`; do basename $f; done)
+	services="$services $opt"
+	presetall=1
+fi
+
+for service in $services; do
+	if [ "$presetall" = "1" ]; then
+		action="preset"
+	fi
+	if [ "$action" = "mask" ]; then
+		if [ ! -d $ROOT/etc/systemd/system/ ]; then
+			mkdir -p $ROOT/etc/systemd/system/
+		fi
+		cmd="ln -s /dev/null $ROOT/etc/systemd/system/$service"
+		echo "$cmd"
+		$cmd
+		exit 0
+	fi
+
+	service_base_file=`echo $service | sed 's/\(@\).*\(\.[^.]\+\)/\1\2/'`
+	if [ -z `echo $service | sed '/@/p;d'` ]; then
+		echo "Try to find location of $service..."
+		service_template=false
+	else
+		echo "Try to find location of template $service_base_file of instance $service..."
+		service_template=true
+		if [ -z `echo $service | sed 's/^.\+@\(.*\)\.[^.]\+/\1/'` ]; then
+			instance_specified=false
+		else
+			instance_specified=true
+		fi
+	fi
+
+	# find service file
+	for p in $ROOT/etc/systemd/system \
+		 $ROOT/lib/systemd/system \
+		 $ROOT/usr/lib/systemd/system; do
+		if [ -e $p/$service_base_file ]; then
+			service_file=$p/$service_base_file
+			service_file=${service_file##$ROOT}
+		fi
+	done
+	if [ -z "$service_file" ]; then
+		echo "'$service_base_file' couldn't be found; exiting with error"
+		exit 1
+	fi
+	echo "Found $service in $service_file"
+
+	# If any new unit types are added to systemd they should be added
+	# to this regular expression.
+	unit_types_re='\.\(service\|socket\|device\|mount\|automount\|swap\|target\|path\|timer\|snapshot\)$'
+	if [ "$action" = "preset" ]; then
+		action=`egrep -sh  $service $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '`
+		if [ -z "$action" ]; then
+			globalpreset=`egrep -sh  '\*'  $ROOT/etc/systemd/user-preset/*.preset | cut -f1 -d' '`
+			if [ -n "$globalpreset" ]; then
+				action="$globalpreset"
+			else
+				action="enable"
+			fi
+		fi
+	fi
+	# create the required symbolic links
+	wanted_by=$(sed '/^WantedBy[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+		        | tr ',' '\n' \
+		        | grep "$unit_types_re")
+
+	for r in $wanted_by; do
+		echo "WantedBy=$r found in $service"
+		if [ "$action" = "enable" ]; then
+			enable_service=$service
+			if [ "$service_template" = true -a "$instance_specified" = false ]; then
+				default_instance=$(sed '/^DefaultInstance[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file")
+				if [ -z $default_instance ]; then
+					echo "Template unit without instance or DefaultInstance directive, nothing to enable"
+					continue
+				else
+					echo "Found DefaultInstance $default_instance, enabling it"
+					enable_service=$(echo $service | sed "s/@/@$default_instance/")
+				fi
+			fi
+			mkdir -p $ROOT/etc/systemd/system/$r.wants
+			ln -s $service_file $ROOT/etc/systemd/system/$r.wants/$enable_service
+			echo "Enabled $enable_service for $wanted_by."
+		else
+			if [ "$service_template" = true -a "$instance_specified" = false ]; then
+				disable_service="$ROOT/etc/systemd/system/$r.wants/`echo $service | sed 's/@/@*/'`"
+			else
+				disable_service="$ROOT/etc/systemd/system/$r.wants/$service"
+			fi
+			rm -f $disable_service
+			[ -d $ROOT/etc/systemd/system/$r.wants ] && rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants
+			echo "Disabled ${disable_service##$ROOT/etc/systemd/system/$r.wants/} for $wanted_by."
+		fi
+	done
+
+	# create the required symbolic 'Alias' links
+	alias=$(sed '/^Alias[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+		        | tr ',' '\n' \
+		        | grep "$unit_types_re")
+
+	for r in $alias; do
+		if [ "$action" = "enable" ]; then
+			mkdir -p $ROOT/etc/systemd/system
+			ln -s $service_file $ROOT/etc/systemd/system/$r
+			echo "Enabled $service for $alias."
+		else
+			rm -f $ROOT/etc/systemd/system/$r
+			echo "Disabled $service for $alias."
+		fi
+	done
+
+	# call us for the other required scripts
+	also=$(sed '/^Also[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
+		   | tr ',' '\n')
+	for a in $also; do
+		echo "Also=$a found in $service"
+		if [ "$action" = "enable" ]; then
+			$0 --root=$ROOT enable $a
+		fi
+	done
+done
diff --git a/meta/recipes-core/systemd/systemd/00-create-volatile.conf b/meta/recipes-core/systemd/systemd/00-create-volatile.conf
new file mode 100644
index 0000000..87cbe1e
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/00-create-volatile.conf
@@ -0,0 +1,7 @@
+#This goes hand-in-hand with the base-files of OE-Core. The file must
+# be sorted before 'systemd.conf' becuase this attempts to create a file
+# inside /var/log.
+
+
+d		/var/volatile/log		-	-	-	-
+d		/var/volatile/tmp		1777	-	-
diff --git a/meta/recipes-core/systemd/systemd/0001-units-Prefer-getty-to-agetty-in-console-setup-system.patch b/meta/recipes-core/systemd/systemd/0001-units-Prefer-getty-to-agetty-in-console-setup-system.patch
new file mode 100644
index 0000000..b6ab5ef
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-units-Prefer-getty-to-agetty-in-console-setup-system.patch
@@ -0,0 +1,44 @@
+From 100e50604efc4032001a2de6a6b47853c0003817 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:29:15 +0000
+Subject: [PATCH 01/11] units: Prefer getty to agetty in console setup systemd
+ units
+
+Upstream-Status: Inappropriate [configuration specific]
+
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ units/getty@.service.m4        | 2 +-
+ units/serial-getty@.service.m4 | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/units/getty@.service.m4 b/units/getty@.service.m4
+index 46164ab..bdf6ec8 100644
+--- a/units/getty@.service.m4
++++ b/units/getty@.service.m4
+@@ -27,7 +27,7 @@ ConditionPathExists=/dev/tty0
+ 
+ [Service]
+ # the VT is cleared by TTYVTDisallocate
+-ExecStart=-/sbin/agetty --noclear %I $TERM
++ExecStart=-/sbin/getty -L %I $TERM
+ Type=idle
+ Restart=always
+ RestartSec=0
+diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4
+index 4522d0d..e6d499d 100644
+--- a/units/serial-getty@.service.m4
++++ b/units/serial-getty@.service.m4
+@@ -22,7 +22,7 @@ Before=getty.target
+ IgnoreOnIsolate=yes
+ 
+ [Service]
+-ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
++ExecStart=-/sbin/getty -L 115200 %I $TERM
+ Type=idle
+ Restart=always
+ UtmpIdentifier=%I
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/systemd/systemd/0003-binfmt-Don-t-install-dependency-links-at-install-tim.patch b/meta/recipes-core/systemd/systemd/0003-binfmt-Don-t-install-dependency-links-at-install-tim.patch
new file mode 100644
index 0000000..0e20fd0
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0003-binfmt-Don-t-install-dependency-links-at-install-tim.patch
@@ -0,0 +1,71 @@
+From 184a89caacfa00f07e7275bca592bd7dda1b541e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:03:44 +0000
+Subject: [PATCH 03/11] binfmt: Don't install dependency links at install time
+ for the binfmt services
+
+use [Install] blocks so that they get created when the service is enabled
+like a traditional service.
+
+The [Install] blocks were rejected upstream as they don't have a way to
+"enable"
+it on install without static symlinks which can't be disabled, only
+masked.  We
+however can do that in a postinst.
+
+Upstream-Status: Denied
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.am                             | 4 ----
+ units/proc-sys-fs-binfmt_misc.automount | 3 +++
+ units/systemd-binfmt.service.in         | 5 +++++
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+Index: git/Makefile.am
+===================================================================
+--- git.orig/Makefile.am
++++ git/Makefile.am
+@@ -4271,10 +4271,6 @@ INSTALL_DIRS += \
+ 	$(prefix)/lib/binfmt.d \
+ 	$(sysconfdir)/binfmt.d
+ 
+-SYSINIT_TARGET_WANTS += \
+-	systemd-binfmt.service \
+-	proc-sys-fs-binfmt_misc.automount
+-
+ endif
+ 
+ EXTRA_DIST += \
+Index: git/units/proc-sys-fs-binfmt_misc.automount
+===================================================================
+--- git.orig/units/proc-sys-fs-binfmt_misc.automount
++++ git/units/proc-sys-fs-binfmt_misc.automount
+@@ -16,3 +16,6 @@ ConditionPathIsReadWrite=/proc/sys/
+ 
+ [Automount]
+ Where=/proc/sys/fs/binfmt_misc
++
++[Install]
++WantedBy=sysinit.target
+Index: git/units/systemd-binfmt.service.in
+===================================================================
+--- git.orig/units/systemd-binfmt.service.in
++++ git/units/systemd-binfmt.service.in
+@@ -11,6 +11,8 @@ Documentation=man:systemd-binfmt.service
+ Documentation=https://www.kernel.org/doc/Documentation/binfmt_misc.txt
+ DefaultDependencies=no
+ Conflicts=shutdown.target
++Wants=proc-sys-fs-binfmt_misc.automount
++
+ After=proc-sys-fs-binfmt_misc.automount
+ Before=sysinit.target shutdown.target
+ ConditionPathIsReadWrite=/proc/sys/
+@@ -25,3 +27,6 @@ Type=oneshot
+ RemainAfterExit=yes
+ ExecStart=@rootlibexecdir@/systemd-binfmt
+ TimeoutSec=90s
++
++[Install]
++WantedBy=sysinit.target
diff --git a/meta/recipes-core/systemd/systemd/0004-configure-Check-for-additional-features-that-uclibc-.patch b/meta/recipes-core/systemd/systemd/0004-configure-Check-for-additional-features-that-uclibc-.patch
new file mode 100644
index 0000000..8078da9
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0004-configure-Check-for-additional-features-that-uclibc-.patch
@@ -0,0 +1,45 @@
+From 4e2e8dbf3f23ab7dca32286cc0f37bff6ac49e22 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:05:45 +0000
+Subject: [PATCH 04/11] configure: Check for additional features that uclibc
+ doesnt support
+
+This helps in supporting uclibc which does not have all features that
+glibc might have
+
+Upstream-Status: Denied [no desire for uclibc support]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -110,6 +110,24 @@ AC_PATH_PROG([UMOUNT_PATH], [umount], [/
+ 
+ AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't support --relative ***])])
+ 
++# check for few functions not implemented in uClibc
++
++AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate)
++
++# check for %ms format support - assume always no if cross compiling
++
++AC_MSG_CHECKING([whether %ms format is supported by *scanf])
++
++AC_LINK_IFELSE(
++	[AC_LANG_PROGRAM([
++	 #include <stdio.h>
++	 ],[
++	    char *buf1, *buf2, *buf3, str="1 2.3 abcde" ;
++	    int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ;
++	    return (rc==3)?0:1;])],
++	[AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])],
++	[AC_MSG_RESULT([no])])
++
+ M4_DEFINES=
+ 
+ AC_CHECK_TOOL(OBJCOPY, objcopy)
diff --git a/meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch b/meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch
new file mode 100644
index 0000000..55a0088
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch
@@ -0,0 +1,38 @@
+From a7417c2e6950d55c22c1b0d15783898b8ff229ef Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:10:37 +0000
+Subject: [PATCH 05/11] nspawn: Use execvpe only when libc supports it
+
+Upstream-Status: Denied [no desire for uclibc support]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/nspawn/nspawn.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+Index: git/src/nspawn/nspawn.c
+===================================================================
+--- git.orig/src/nspawn/nspawn.c
++++ git/src/nspawn/nspawn.c
+@@ -143,6 +143,8 @@ typedef struct CustomMount {
+         char **lower;
+ } CustomMount;
+ 
++#include "config.h"
++
+ static char *arg_directory = NULL;
+ static char *arg_template = NULL;
+ static char *arg_user = NULL;
+@@ -4238,7 +4240,12 @@ static int inner_child(
+                 a[0] = (char*) "/sbin/init";
+                 execve(a[0], a, env_use);
+         } else if (argc > optind)
++#ifdef HAVE_EXECVPE
+                 execvpe(argv[optind], argv + optind, env_use);
++#else
++                environ = env_use;
++                execvp(argv[optind], argv + optind);
++#endif /* HAVE_EXECVPE */
+         else {
+                 chdir(home ? home : "/root");
+                 execle("/bin/bash", "-bash", NULL, env_use);
diff --git a/meta/recipes-core/systemd/systemd/0006-journal-Use-posix-fallocate-only-if-available.patch b/meta/recipes-core/systemd/systemd/0006-journal-Use-posix-fallocate-only-if-available.patch
new file mode 100644
index 0000000..631dd77
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0006-journal-Use-posix-fallocate-only-if-available.patch
@@ -0,0 +1,96 @@
+From 34a61b6c9eed3fad360066fb63132ebc7e0aaaa6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:12:48 +0000
+Subject: [PATCH 06/11] journal: Use posix fallocate only if available
+
+Some architecture ports in uclibc did not support it in past
+
+Upstream-Status: Denied [no desire for uclibc support]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/journal/journal-file.c  | 16 +++++++++++++++-
+ src/journal/journald-kmsg.c | 15 ++++++++++++++-
+ 2 files changed, 29 insertions(+), 2 deletions(-)
+
+diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
+index 2845e05..9431171 100644
+--- a/src/journal/journal-file.c
++++ b/src/journal/journal-file.c
+@@ -36,6 +36,8 @@
+ #include "compress.h"
+ #include "fsprg.h"
+ 
++#include "config.h"
++
+ #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem))
+ #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem))
+ 
+@@ -354,7 +356,7 @@ static int journal_file_fstat(JournalFile *f) {
+ 
+ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) {
+         uint64_t old_size, new_size;
+-        int r;
++        int r = 0;
+ 
+         assert(f);
+ 
+@@ -418,9 +420,21 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size)
+         /* Note that the glibc fallocate() fallback is very
+            inefficient, hence we try to minimize the allocation area
+            as we can. */
++#ifdef HAVE_POSIX_FALLOCATE
+         r = posix_fallocate(f->fd, old_size, new_size - old_size);
+         if (r != 0)
+                 return -r;
++#else
++        /* Write something every 512 bytes to make sure the block is allocated */
++        uint64_t len = new_size - old_size;
++        uint64_t offset = old_size;
++        for (offset += (len-1) % 512; len > 0; offset += 512) {
++                len -= 512;
++                if (pwrite(f->fd, "", 1, offset) != 1)
++                        return -errno;
++        }
++
++#endif /* HAVE_POSIX_FALLOCATE */
+ 
+         f->header->arena_size = htole64(new_size - le64toh(f->header->header_size));
+ 
+diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
+index c4216c4..a998ed5 100644
+--- a/src/journal/journald-kmsg.c
++++ b/src/journal/journald-kmsg.c
+@@ -436,6 +436,7 @@ fail:
+ int server_open_kernel_seqnum(Server *s) {
+         _cleanup_close_ int fd;
+         uint64_t *p;
++        int r = 0;
+ 
+         assert(s);
+ 
+@@ -449,7 +450,19 @@ int server_open_kernel_seqnum(Server *s) {
+                 return 0;
+         }
+ 
+-        if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) {
++#ifdef HAVE_POSIX_FALLOCATE
++        r = posix_fallocate(fd, 0, sizeof(uint64_t));
++#else
++        /* Use good old method to write zeros into the journal file
++           perhaps very inefficient yet working. */
++        char *buf = alloca(sizeof(uint64_t));
++        off_t oldpos = lseek(fd, 0, SEEK_CUR);
++        bzero(buf, sizeof(uint64_t));
++        lseek(fd, 0, SEEK_SET);
++        r = write(fd, buf, sizeof(uint64_t));
++        lseek(fd, oldpos, SEEK_SET);
++#endif /* HAVE_POSIX_FALLOCATE */
++        if (r < 0) {
+                 log_error_errno(errno, "Failed to allocate sequential number file, ignoring: %m");
+                 return 0;
+         }
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch b/meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch
new file mode 100644
index 0000000..b8ab7c4
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch
@@ -0,0 +1,42 @@
+From f771407d3e0288ca0c06a894194d3ddad69b9a8e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:17:05 +0000
+Subject: [PATCH 07/11] util: Use mkostemp only if libc supports it
+
+Upstream-Status: Denied [no desire for uclibc support]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/util.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/src/basic/util.c b/src/basic/util.c
+index dc65280..72f4665 100644
+--- a/src/basic/util.c
++++ b/src/basic/util.c
+@@ -97,6 +97,8 @@
+ #include "def.h"
+ #include "sparse-endian.h"
+ 
++#include "config.h"
++
+ int saved_argc = 0;
+ char **saved_argv = NULL;
+ 
+@@ -6682,7 +6684,13 @@ int mkostemp_safe(char *pattern, int flags) {
+ 
+         u = umask(077);
+ 
++#ifdef HAVE_MKOSTEMP
+         fd = mkostemp(pattern, flags);
++#else
++        fd = mkstemp(pattern);
++        if (fd >= 0) fcntl(fd, F_SETFD, flags);
++#endif /* HAVE_MKOSTEMP */
++
+         if (fd < 0)
+                 return -errno;
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/systemd/systemd/0008-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch b/meta/recipes-core/systemd/systemd/0008-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
new file mode 100644
index 0000000..3f4d4de
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0008-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch
@@ -0,0 +1,46 @@
+From b45ea3bfd6635744c8a6b74d0ac701b44bb1d294 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:19:37 +0000
+Subject: [PATCH 08/11] util: bypass unimplemented _SC_PHYS_PAGES system
+ configuration API on uclibc
+
+Upstream-Status: Inappropriate [uclibc-specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/basic/util.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/src/basic/util.c b/src/basic/util.c
+index 72f4665..cbbe3b1 100644
+--- a/src/basic/util.c
++++ b/src/basic/util.c
+@@ -6793,10 +6793,25 @@ uint64_t physical_memory(void) {
+         /* We return this as uint64_t in case we are running as 32bit
+          * process on a 64bit kernel with huge amounts of memory */
+ 
++#ifdef __UCLIBC__
++        char line[128];
++        FILE *f = fopen("/proc/meminfo", "r");
++        if (f == NULL)
++                return 0;
++        while (!feof(f) && fgets(line, sizeof(line)-1, f)) {
++                if (sscanf(line, "MemTotal: %l kB", &mem) == 1) {
++                        mem *= 1024;
++                        break;
++                }
++        }
++        fclose(f);
++        return (uint64_t) mem;
++#else
+         mem = sysconf(_SC_PHYS_PAGES);
+         assert(mem > 0);
+ 
+         return (uint64_t) mem * (uint64_t) page_size();
++#endif
+ }
+ 
+ void hexdump(FILE *f, const void *p, size_t s) {
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/systemd/systemd/0009-sysv-generator-add-support-for-executing-scripts-und.patch b/meta/recipes-core/systemd/systemd/0009-sysv-generator-add-support-for-executing-scripts-und.patch
new file mode 100644
index 0000000..9ea3e83
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0009-sysv-generator-add-support-for-executing-scripts-und.patch
@@ -0,0 +1,143 @@
+From 8791b5b3934c55694872b6915a67340683ead91b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:22:52 +0000
+Subject: [PATCH 09/11] sysv-generator: add support for executing scripts under
+ /etc/rcS.d/
+
+To be compatible, all services translated from scripts under /etc/rcS.d would
+run before services translated from scripts under /etc/rcN.d.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/sysv-generator/sysv-generator.c | 50 ++++++++++++++++++++++++++++---------
+ 1 file changed, 38 insertions(+), 12 deletions(-)
+
+diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
+index bd67f32..6756cc6 100644
+--- a/src/sysv-generator/sysv-generator.c
++++ b/src/sysv-generator/sysv-generator.c
+@@ -42,7 +42,8 @@
+ 
+ typedef enum RunlevelType {
+         RUNLEVEL_UP,
+-        RUNLEVEL_DOWN
++        RUNLEVEL_DOWN,
++        RUNLEVEL_SYSINIT
+ } RunlevelType;
+ 
+ static const struct {
+@@ -57,6 +58,9 @@ static const struct {
+         { "rc4.d",  SPECIAL_MULTI_USER_TARGET, RUNLEVEL_UP },
+         { "rc5.d",  SPECIAL_GRAPHICAL_TARGET,  RUNLEVEL_UP },
+ 
++        /* Debian style rcS.d, also adopted by OE */
++        { "rcS.d",  SPECIAL_SYSINIT_TARGET,   RUNLEVEL_SYSINIT},
++
+         /* Standard SysV runlevels for shutdown */
+         { "rc0.d",  SPECIAL_POWEROFF_TARGET,  RUNLEVEL_DOWN },
+         { "rc6.d",  SPECIAL_REBOOT_TARGET,    RUNLEVEL_DOWN }
+@@ -65,7 +69,7 @@ static const struct {
+            directories in this order, and we want to make sure that
+            sysv_start_priority is known when we first load the
+            unit. And that value we only know from S links. Hence
+-           UP must be read before DOWN */
++           UP/SYSINIT must be read before DOWN */
+ };
+ 
+ typedef struct SysvStub {
+@@ -81,6 +85,8 @@ typedef struct SysvStub {
+         char **conflicts;
+         bool has_lsb;
+         bool reload;
++        bool default_dependencies;
++        bool from_rcsd;
+ } SysvStub;
+ 
+ const char *arg_dest = "/tmp";
+@@ -183,6 +189,9 @@ static int generate_unit_file(SysvStub *s) {
+                 "Description=%s\n",
+                 s->path, s->description);
+ 
++        if (!s->default_dependencies)
++                fprintf(f, "DefaultDependencies=no\n");
++
+         if (!isempty(before))
+                 fprintf(f, "Before=%s\n", before);
+         if (!isempty(after))
+@@ -704,18 +713,30 @@ static int fix_order(SysvStub *s, Hashmap *all_services) {
+                 if (s->has_lsb && other->has_lsb)
+                         continue;
+ 
+-                if (other->sysv_start_priority < s->sysv_start_priority) {
+-                        r = strv_extend(&s->after, other->name);
++                /* All scripts under /etc/rcS.d should execute before scripts under
++                 * /etc/rcN.d */
++                if (!other->from_rcsd && s->from_rcsd) {
++                        r = strv_extend(&s->before, other->name);
+                         if (r < 0)
+                                 return log_oom();
+-                }
+-                else if (other->sysv_start_priority > s->sysv_start_priority) {
+-                        r = strv_extend(&s->before, other->name);
++                } else if (other->from_rcsd && !s->from_rcsd) {
++                        r = strv_extend(&s->after, other->name);
+                         if (r < 0)
+                                 return log_oom();
+-                }
+-                else
+-                        continue;
++                } else {
++                        if (other->sysv_start_priority < s->sysv_start_priority) {
++                                r = strv_extend(&s->after, other->name);
++                                if (r < 0)
++                                        return log_oom();
++                        }
++                        else if (other->sysv_start_priority > s->sysv_start_priority) {
++                                r = strv_extend(&s->before, other->name);
++                                if (r < 0)
++                                        return log_oom();
++                        }
++                        else
++                                continue;
++                 }
+ 
+                 /* FIXME: Maybe we should compare the name here lexicographically? */
+         }
+@@ -778,6 +799,8 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
+                                 return log_oom();
+ 
+                         service->sysv_start_priority = -1;
++                        service->default_dependencies = true;
++                        service->from_rcsd = false;
+                         service->name = name;
+                         service->path = fpath;
+ 
+@@ -864,9 +887,11 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
+ 
+                                 if (de->d_name[0] == 'S')  {
+ 
+-                                        if (rcnd_table[i].type == RUNLEVEL_UP) {
++                                        if (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT) {
+                                                 service->sysv_start_priority =
+                                                         MAX(a*10 + b, service->sysv_start_priority);
++                                                service->default_dependencies = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?false:true;
++                                                service->from_rcsd = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?true:false;
+                                         }
+ 
+                                         r = set_ensure_allocated(&runlevel_services[i], NULL);
+@@ -878,7 +903,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) {
+                                                 goto finish;
+ 
+                                 } else if (de->d_name[0] == 'K' &&
+-                                           (rcnd_table[i].type == RUNLEVEL_DOWN)) {
++                                           (rcnd_table[i].type == RUNLEVEL_DOWN ||
++                                            rcnd_table[i].type == RUNLEVEL_SYSINIT)) {
+ 
+                                         r = set_ensure_allocated(&shutdown_services, NULL);
+                                         if (r < 0)
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/systemd/systemd/0010-Make-root-s-home-directory-configurable.patch b/meta/recipes-core/systemd/systemd/0010-Make-root-s-home-directory-configurable.patch
new file mode 100644
index 0000000..ed7ff5b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0010-Make-root-s-home-directory-configurable.patch
@@ -0,0 +1,181 @@
+From 3dc731c1d270e2e143de621db9bd898299fd849d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:24:49 +0000
+Subject: [PATCH 10/11] Make root's home directory configurable
+
+OpenEmbedded has a configurable home directory for root. Allow
+systemd to be built using its idea of what root's home directory
+should be.
+
+Upstream-Status: Denied
+Upstream wants to have a unified hierarchy where everyone is
+using the same root folder.
+https://github.com/systemd/systemd/issues/541
+
+Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.am                       | 2 ++
+ configure.ac                      | 7 +++++++
+ src/core/unit-printf.c            | 2 +-
+ src/nspawn/nspawn.c               | 4 ++--
+ src/basic/util.c                 | 4 ++--
+ units/console-shell.service.m4.in | 4 ++--
+ units/emergency.service.in        | 4 ++--
+ units/rescue.service.in           | 4 ++--
+ 8 files changed, 20 insertions(+), 11 deletions(-)
+
+Index: git/Makefile.am
+===================================================================
+--- git.orig/Makefile.am
++++ git/Makefile.am
+@@ -208,6 +208,7 @@ AM_CPPFLAGS = \
+ 	-DLIBDIR=\"$(libdir)\" \
+ 	-DROOTLIBDIR=\"$(rootlibdir)\" \
+ 	-DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
++	-DROOTHOMEDIR=\"$(roothomedir)\" \
+ 	-DTEST_DIR=\"$(abs_top_srcdir)/test\" \
+ 	-I $(top_srcdir)/src \
+ 	-I $(top_builddir)/src/basic \
+@@ -5615,6 +5616,7 @@ EXTRA_DIST += \
+ substitutions = \
+        '|rootlibexecdir=$(rootlibexecdir)|' \
+        '|rootbindir=$(rootbindir)|' \
++       '|roothomedir=$(roothomedir)|' \
+        '|bindir=$(bindir)|' \
+        '|SYSTEMCTL=$(rootbindir)/systemctl|' \
+        '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -1383,6 +1383,11 @@ AC_ARG_WITH([rootlibdir],
+         [with_rootlibdir=${libdir}])
+ AX_NORMALIZE_PATH([with_rootlibdir])
+ 
++AC_ARG_WITH([roothomedir],
++        AS_HELP_STRING([--with-roothomedir=DIR], [Home directory for the root user]),
++        [],
++        [with_roothomedir=/root])
++
+ AC_ARG_WITH([pamlibdir],
+         AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
+         [],
+@@ -1474,6 +1479,7 @@ AC_SUBST([pamlibdir], [$with_pamlibdir])
+ AC_SUBST([pamconfdir], [$with_pamconfdir])
+ AC_SUBST([rootprefix], [$with_rootprefix])
+ AC_SUBST([rootlibdir], [$with_rootlibdir])
++AC_SUBST([roothomedir], [$with_roothomedir])
+ 
+ AC_CONFIG_FILES([
+         Makefile
+@@ -1563,6 +1569,7 @@ AC_MSG_RESULT([
+         includedir:              ${includedir}
+         lib dir:                 ${libdir}
+         rootlib dir:             ${with_rootlibdir}
++        root home dir:           ${with_roothomedir}
+         SysV init scripts:       ${SYSTEM_SYSVINIT_PATH}
+         SysV rc?.d directories:  ${SYSTEM_SYSVRCND_PATH}
+         Build Python:            ${PYTHON}
+Index: git/src/core/unit-printf.c
+===================================================================
+--- git.orig/src/core/unit-printf.c
++++ git/src/core/unit-printf.c
+@@ -237,7 +237,7 @@ static int specifier_user_home(char spec
+                  * best of it if we can, but fail if we can't */
+ 
+                 if (!c->user || streq(c->user, "root") || streq(c->user, "0"))
+-                        n = strdup("/root");
++                        n = strdup(ROOTHOMEDIR);
+                 else
+                         return -EOPNOTSUPP;
+ 
+Index: git/src/nspawn/nspawn.c
+===================================================================
+--- git.orig/src/nspawn/nspawn.c
++++ git/src/nspawn/nspawn.c
+@@ -4176,7 +4176,7 @@ static int inner_child(
+         if (envp[n_env])
+                 n_env ++;
+ 
+-        if ((asprintf((char**)(envp + n_env++), "HOME=%s", home ? home: "/root") < 0) ||
++        if ((asprintf((char**)(envp + n_env++), "HOME=%s", home ? home: ROOTHOMEDIR) < 0) ||
+             (asprintf((char**)(envp + n_env++), "USER=%s", arg_user ? arg_user : "root") < 0) ||
+             (asprintf((char**)(envp + n_env++), "LOGNAME=%s", arg_user ? arg_user : "root") < 0))
+                 return log_oom();
+@@ -4247,7 +4247,7 @@ static int inner_child(
+                 execvp(argv[optind], argv + optind);
+ #endif /* HAVE_EXECVPE */
+         else {
+-                chdir(home ? home : "/root");
++                chdir(home ? home : ROOTHOMEDIR);
+                 execle("/bin/bash", "-bash", NULL, env_use);
+                 execle("/bin/sh", "-sh", NULL, env_use);
+         }
+Index: git/src/basic/util.c
+===================================================================
+--- git.orig/src/basic/util.c
++++ git/src/basic/util.c
+@@ -3233,7 +3233,7 @@ int get_user_creds(
+                         *gid = 0;
+ 
+                 if (home)
+-                        *home = "/root";
++                        *home = ROOTHOMEDIR;
+ 
+                 if (shell)
+                         *shell = "/bin/sh";
+@@ -4069,7 +4069,7 @@ int get_home_dir(char **_h) {
+         /* Hardcode home directory for root to avoid NSS */
+         u = getuid();
+         if (u == 0) {
+-                h = strdup("/root");
++                h = strdup(ROOTHOMEDIR);
+                 if (!h)
+                         return -ENOMEM;
+ 
+Index: git/units/console-shell.service.m4.in
+===================================================================
+--- git.orig/units/console-shell.service.m4.in
++++ git/units/console-shell.service.m4.in
+@@ -15,8 +15,8 @@ After=rc-local.service
+ Before=getty.target
+ 
+ [Service]
+-Environment=HOME=/root
+-WorkingDirectory=/root
++Environment=HOME=@roothomedir@
++WorkingDirectory=@roothomedir@
+ ExecStart=-@SULOGIN@
+ ExecStopPost=-@SYSTEMCTL@ poweroff
+ Type=idle
+Index: git/units/emergency.service.in
+===================================================================
+--- git.orig/units/emergency.service.in
++++ git/units/emergency.service.in
+@@ -14,8 +14,8 @@ Conflicts=rescue.service
+ Before=shutdown.target
+ 
+ [Service]
+-Environment=HOME=/root
+-WorkingDirectory=/root
++Environment=HOME=@roothomedir@
++WorkingDirectory=@roothomedir@
+ ExecStartPre=-/bin/plymouth --wait quit
+ ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.'
+ ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
+Index: git/units/rescue.service.in
+===================================================================
+--- git.orig/units/rescue.service.in
++++ git/units/rescue.service.in
+@@ -14,8 +14,8 @@ After=sysinit.target plymouth-start.serv
+ Before=shutdown.target
+ 
+ [Service]
+-Environment=HOME=/root
+-WorkingDirectory=/root
++Environment=HOME=@roothomedir@
++WorkingDirectory=@roothomedir@
+ ExecStartPre=-/bin/plymouth quit
+ ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.'
+ ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --job-mode=fail --no-block default"
diff --git a/meta/recipes-core/systemd/systemd/0011-systemd-user-avoid-using-system-auth.patch b/meta/recipes-core/systemd/systemd/0011-systemd-user-avoid-using-system-auth.patch
new file mode 100644
index 0000000..e562bca
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0011-systemd-user-avoid-using-system-auth.patch
@@ -0,0 +1,31 @@
+From 7e202f71785bf5a67c8a4f6b58d3585608fbfdc4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 05:26:25 +0000
+Subject: [PATCH 11/11] systemd-user: avoid using system-auth
+
+In OE, we don't provide system-auth, instead, we use common-* files.
+So modify systemd-user file to use common-* files.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/login/systemd-user | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/login/systemd-user b/src/login/systemd-user
+index 8112d74..99635af 100644
+--- a/src/login/systemd-user
++++ b/src/login/systemd-user
+@@ -2,5 +2,5 @@
+ #
+ # Used by systemd --user instances.
+ 
+-account  include system-auth
+-session  include system-auth
++account  include common-account
++session  include common-session
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/systemd/systemd/0012-implment-systemd-sysv-install-for-OE.patch b/meta/recipes-core/systemd/systemd/0012-implment-systemd-sysv-install-for-OE.patch
new file mode 100644
index 0000000..68b45a9
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0012-implment-systemd-sysv-install-for-OE.patch
@@ -0,0 +1,40 @@
+From 5f8b9f2d276c0ddbcbf5423733a23f043d688009 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 5 Sep 2015 06:31:47 +0000
+Subject: [PATCH] implment systemd-sysv-install for OE
+
+Use update-rc.d for enabling/disabling and status command
+to check the status of the sysv service
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/systemctl/systemd-sysv-install.SKELETON | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+Index: git/src/systemctl/systemd-sysv-install.SKELETON
+===================================================================
+--- git.orig/src/systemctl/systemd-sysv-install.SKELETON
++++ git/src/systemctl/systemd-sysv-install.SKELETON
+@@ -30,17 +30,17 @@ case "$1" in
+     enable)
+         # call the command to enable SysV init script $NAME here
+         # (consider optional $ROOT)
+-        echo "IMPLEMENT ME: enabling SysV init.d script $NAME"
++        update-rc.d -f $NAME defaults
+         ;;
+     disable)
+         # call the command to disable SysV init script $NAME here
+         # (consider optional $ROOT)
+-        echo "IMPLEMENT ME: disabling SysV init.d script $NAME"
++        update-rc.d -f $NAME remove
+         ;;
+     is-enabled)
+         # exit with 0 if $NAME is enabled, non-zero if it is disabled
+         # (consider optional $ROOT)
+-        echo "IMPLEMENT ME: checking SysV init.d script $NAME"
++        /etc/init.d/$NAME status
+         ;;
+     *)
+         usage ;;
diff --git a/meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch b/meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch
new file mode 100644
index 0000000..fe2ba53
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch
@@ -0,0 +1,28 @@
+From 4f0a722489154da99e7f6b3051afde984eed2f74 Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Thu, 19 Mar 2015 15:01:29 +1100
+Subject: [PATCH] Revert "rules: remove firmware loading rules"
+
+This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19.
+Userspace firmware loading support is needed for Linux < 3.7.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ rules/50-firmware.rules | 3 +++
+ 1 file changed, 3 insertions(+)
+ create mode 100644 rules/50-firmware.rules
+
+diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules
+new file mode 100644
+index 0000000..f0ae684
+--- /dev/null
++++ b/rules/50-firmware.rules
+@@ -0,0 +1,3 @@
++# do not edit this file, it will be overwritten on update
++
++SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware"
+-- 
+2.3.3
+
diff --git a/meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch b/meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch
new file mode 100644
index 0000000..6308cc7
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch
@@ -0,0 +1,364 @@
+From 7f074def4e32045353ba4336d703e17b8de7ec4e Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Thu, 19 Mar 2015 15:01:33 +1100
+Subject: [PATCH] Revert "udev: remove userspace firmware loading support"
+
+This reverts commit be2ea723b1d023b3d385d3b791ee4607cbfb20ca.
+Userspace firmware loading support is needed for Linux < 3.7.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ Makefile.am                      |  12 +++
+ README                           |   9 ++-
+ TODO                             |   1 +
+ configure.ac                     |  20 +++++
+ src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++
+ src/udev/udev-builtin.c          |   3 +
+ src/udev/udev.h                  |   6 ++
+ src/udev/udevd.c                 |  13 ++++
+ 8 files changed, 214 insertions(+), 4 deletions(-)
+ create mode 100644 src/udev/udev-builtin-firmware.c
+
+Index: git/Makefile.am
+===================================================================
+--- git.orig/Makefile.am
++++ git/Makefile.am
+@@ -3470,6 +3470,18 @@ libudev_core_la_LIBADD = \
+ 	$(BLKID_LIBS) \
+ 	$(KMOD_LIBS)
+ 
++libudev_core_la_CPPFLAGS = \
++	$(AM_CPPFLAGS) \
++	-DFIRMWARE_PATH="$(FIRMWARE_PATH)"
++
++if ENABLE_FIRMWARE
++libudev_core_la_SOURCES += \
++	src/udev/udev-builtin-firmware.c
++
++dist_udevrules_DATA += \
++	rules/50-firmware.rules
++endif
++
+ if HAVE_KMOD
+ libudev_core_la_SOURCES += \
+ 	src/udev/udev-builtin-kmod.c
+Index: git/README
+===================================================================
+--- git.orig/README
++++ git/README
+@@ -36,7 +36,8 @@ LICENSE:
+         - except src/udev/* which is (currently still) GPLv2, GPLv2+
+ 
+ REQUIREMENTS:
+-        Linux kernel >= 3.7
++        Linux kernel >= 3.0
++        Linux kernel >= 3.3 for loop device partition support features with nspawn
+         Linux kernel >= 3.8 for Smack support
+ 
+         Kernel Config Options:
+@@ -51,14 +52,14 @@ REQUIREMENTS:
+           CONFIG_PROC_FS
+           CONFIG_FHANDLE (libudev, mount and bind mount handling)
+ 
+-        udev will fail to work with the legacy sysfs layout:
++        Udev will fail to work with the legacy layout:
+           CONFIG_SYSFS_DEPRECATED=n
+ 
+         Legacy hotplug slows down the system and confuses udev:
+           CONFIG_UEVENT_HELPER_PATH=""
+ 
+-        Userspace firmware loading is not supported and should
+-        be disabled in the kernel:
++        Userspace firmware loading is deprecated, will go away, and
++        sometimes causes problems:
+           CONFIG_FW_LOADER_USER_HELPER=n
+ 
+         Some udev rules and virtualization detection relies on it:
+Index: git/TODO
+===================================================================
+--- git.orig/TODO
++++ git/TODO
+@@ -754,6 +754,7 @@ Features:
+ * ExecOnFailure=/usr/bin/foo
+ 
+ * udev:
++  - remove src/udev/udev-builtin-firmware.c (CONFIG_FW_LOADER_USER_HELPER=n)
+   - move to LGPL
+   - kill scsi_id
+   - add trigger --subsystem-match=usb/usb_device device
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -1268,6 +1268,26 @@ fi
+ AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"])
+ 
+ # ------------------------------------------------------------------------------
++AC_ARG_WITH(firmware-path,
++       AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
++          [Firmware search path (default="")]),
++       [], [with_firmware_path=""])
++OLD_IFS=$IFS
++IFS=:
++for i in $with_firmware_path; do
++       if test "x${FIRMWARE_PATH}" = "x"; then
++              FIRMWARE_PATH="\\\"${i}/\\\""
++       else
++              FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
++       fi
++done
++IFS=$OLD_IFS
++AC_SUBST(FIRMWARE_PATH)
++AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ])
++AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"])
++
++
++# ------------------------------------------------------------------------------
+ AC_ARG_ENABLE(hwdb, [AC_HELP_STRING([--disable-hwdb], [disable hardware database support])],
+        enable_hwdb=$enableval, enable_hwdb=yes)
+ AM_CONDITIONAL(ENABLE_HWDB, [test x$enable_hwdb = xyes])
+@@ -1574,6 +1594,7 @@ AC_MSG_RESULT([
+         SysV rc?.d directories:  ${SYSTEM_SYSVRCND_PATH}
+         Build Python:            ${PYTHON}
+         sphinx binary:           ${SPHINX_BUILD}
++        firmware path:           ${FIRMWARE_PATH}
+         PAM modules dir:         ${with_pamlibdir}
+         PAM configuration dir:   ${with_pamconfdir}
+         D-Bus policy dir:        ${with_dbuspolicydir}
+Index: git/src/udev/udev-builtin-firmware.c
+===================================================================
+--- /dev/null
++++ git/src/udev/udev-builtin-firmware.c
+@@ -0,0 +1,154 @@
++/*
++ * firmware - Kernel firmware loader
++ *
++ * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com>
++ * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of the
++ * License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ * General Public License for more details:*
++ */
++
++#include <unistd.h>
++#include <stdlib.h>
++#include <string.h>
++#include <stdio.h>
++#include <getopt.h>
++#include <errno.h>
++#include <stdbool.h>
++#include <sys/utsname.h>
++#include <sys/stat.h>
++
++#include "udev.h"
++
++static bool set_loading(struct udev *udev, char *loadpath, const char *state) {
++        FILE *ldfile;
++
++        ldfile = fopen(loadpath, "we");
++        if (ldfile == NULL) {
++                log_error("error: can not open '%s'", loadpath);
++                return false;
++        };
++        fprintf(ldfile, "%s\n", state);
++        fclose(ldfile);
++        return true;
++}
++
++static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) {
++        char *buf;
++        FILE *fsource = NULL, *ftarget = NULL;
++        bool ret = false;
++
++        buf = malloc(size);
++        if (buf == NULL) {
++                log_error("No memory available to load firmware file");
++                return false;
++        }
++
++        log_debug("writing '%s' (%zi) to '%s'", source, size, target);
++
++        fsource = fopen(source, "re");
++        if (fsource == NULL)
++                goto exit;
++        ftarget = fopen(target, "we");
++        if (ftarget == NULL)
++                goto exit;
++        if (fread(buf, size, 1, fsource) != 1)
++                goto exit;
++        if (fwrite(buf, size, 1, ftarget) == 1)
++                ret = true;
++exit:
++        if (ftarget != NULL)
++                fclose(ftarget);
++        if (fsource != NULL)
++                fclose(fsource);
++        free(buf);
++        return ret;
++}
++
++static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) {
++        struct udev *udev = udev_device_get_udev(dev);
++        static const char *searchpath[] = { FIRMWARE_PATH };
++        char loadpath[UTIL_PATH_SIZE];
++        char datapath[UTIL_PATH_SIZE];
++        char fwpath[UTIL_PATH_SIZE];
++        const char *firmware;
++        FILE *fwfile = NULL;
++        struct utsname kernel;
++        struct stat statbuf;
++        unsigned int i;
++        int rc = EXIT_SUCCESS;
++
++        firmware = udev_device_get_property_value(dev, "FIRMWARE");
++        if (firmware == NULL) {
++                log_error("firmware parameter missing");
++                rc = EXIT_FAILURE;
++                goto exit;
++        }
++
++        /* lookup firmware file */
++        uname(&kernel);
++        for (i = 0; i < ELEMENTSOF(searchpath); i++) {
++                strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL);
++                fwfile = fopen(fwpath, "re");
++                if (fwfile != NULL)
++                        break;
++
++                strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL);
++                fwfile = fopen(fwpath, "re");
++                if (fwfile != NULL)
++                        break;
++        }
++
++        strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL);
++
++        if (fwfile == NULL) {
++                log_debug("did not find firmware file '%s'", firmware);
++                rc = EXIT_FAILURE;
++                /*
++                 * Do not cancel the request in the initrd, the real root might have
++                 * the firmware file and the 'coldplug' run in the real root will find
++                 * this pending request and fulfill or cancel it.
++                 * */
++                if (!in_initrd())
++                        set_loading(udev, loadpath, "-1");
++                goto exit;
++        }
++
++        if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) {
++                if (!in_initrd())
++                        set_loading(udev, loadpath, "-1");
++                rc = EXIT_FAILURE;
++                goto exit;
++        }
++
++        if (!set_loading(udev, loadpath, "1"))
++                goto exit;
++
++        strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL);
++        if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) {
++                log_error("error sending firmware '%s' to device", firmware);
++                set_loading(udev, loadpath, "-1");
++                rc = EXIT_FAILURE;
++                goto exit;
++        };
++
++        set_loading(udev, loadpath, "0");
++exit:
++        if (fwfile)
++                fclose(fwfile);
++        return rc;
++}
++
++const struct udev_builtin udev_builtin_firmware = {
++        .name = "firmware",
++        .cmd = builtin_firmware,
++        .help = "kernel firmware loader",
++        .run_once = true,
++};
+Index: git/src/udev/udev-builtin.c
+===================================================================
+--- git.orig/src/udev/udev-builtin.c
++++ git/src/udev/udev-builtin.c
+@@ -30,6 +30,9 @@ static const struct udev_builtin *builti
+         [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid,
+ #endif
+         [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs,
++#ifdef HAVE_FIRMWARE
++        [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware,
++#endif
+         [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb,
+         [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id,
+         [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard,
+Index: git/src/udev/udev.h
+===================================================================
+--- git.orig/src/udev/udev.h
++++ git/src/udev/udev.h
+@@ -146,6 +146,9 @@ enum udev_builtin_cmd {
+         UDEV_BUILTIN_BLKID,
+ #endif
+         UDEV_BUILTIN_BTRFS,
++#ifdef HAVE_FIRMWARE
++        UDEV_BUILTIN_FIRMWARE,
++#endif
+         UDEV_BUILTIN_HWDB,
+         UDEV_BUILTIN_INPUT_ID,
+         UDEV_BUILTIN_KEYBOARD,
+@@ -174,6 +177,9 @@ struct udev_builtin {
+ extern const struct udev_builtin udev_builtin_blkid;
+ #endif
+ extern const struct udev_builtin udev_builtin_btrfs;
++#ifdef HAVE_FIRMWARE
++extern const struct udev_builtin udev_builtin_firmware;
++#endif
+ extern const struct udev_builtin udev_builtin_hwdb;
+ extern const struct udev_builtin udev_builtin_input_id;
+ extern const struct udev_builtin udev_builtin_keyboard;
+Index: git/src/udev/udevd.c
+===================================================================
+--- git.orig/src/udev/udevd.c
++++ git/src/udev/udevd.c
+@@ -116,6 +116,9 @@ struct event {
+         bool is_block;
+         sd_event_source *timeout_warning;
+         sd_event_source *timeout;
++#ifdef HAVE_FIRMWARE
++        bool nodelay;
++#endif
+ };
+ 
+ static inline struct event *node_to_event(struct udev_list_node *node) {
+@@ -607,6 +610,10 @@ static int event_queue_insert(Manager *m
+         event->devnum = udev_device_get_devnum(dev);
+         event->is_block = streq("block", udev_device_get_subsystem(dev));
+         event->ifindex = udev_device_get_ifindex(dev);
++#ifdef HAVE_FIRMWARE
++        if (streq(udev_device_get_subsystem(dev), "firmware"))
++                event->nodelay = true;
++#endif
+ 
+         log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev),
+              udev_device_get_action(dev), udev_device_get_subsystem(dev));
+@@ -692,6 +699,12 @@ static bool is_devpath_busy(Manager *man
+                         return true;
+                 }
+ 
++#ifdef HAVE_FIRMWARE
++                /* allow to bypass the dependency tracking */
++                if (event->nodelay)
++                        continue;
++#endif
++
+                 /* parent device event found */
+                 if (event->devpath[common] == '/') {
+                         event->delaying_seqnum = loop_event->seqnum;
diff --git a/meta/recipes-core/systemd/systemd/init b/meta/recipes-core/systemd/systemd/init
new file mode 100644
index 0000000..ea52be4
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/init
@@ -0,0 +1,104 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides:          udev
+# Required-Start:    mountvirtfs
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Start udevd, populate /dev and load drivers.
+### END INIT INFO
+
+. /etc/init.d/functions
+
+export TZ=/etc/localtime
+
+[ -d /sys/class ] || exit 1
+[ -r /proc/mounts ] || exit 1
+[ -x @UDEVD@ ] || exit 1
+[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
+[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+
+readfile () {
+   filename=$1
+   READDATA=""
+   if [ -r $filename ]; then
+       while read line; do
+           READDATA="$READDATA$line"
+       done < $filename
+   fi
+}
+
+case "$1" in
+  start)
+    export ACTION=add
+    # propagate /dev from /sys
+    echo "Starting udev"
+
+    # mount the devtmpfs on /dev, if not already done
+    LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
+            mount -n -o mode=0755 -t devtmpfs none "/dev"
+    }
+    [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
+    [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
+    mount -a -t tmpfs 2>/dev/null
+
+    # cache handling
+    if [ "$DEVCACHE" != "" ]; then
+            readfile /proc/version
+            VERSION="$READDATA"
+            readfile /proc/cmdline
+            CMDLINE="$READDATA"
+            readfile /proc/devices
+            DEVICES="$READDATA"
+            readfile /proc/atags
+            ATAGS="$READDATA"
+
+            if [ -e $DEVCACHE ]; then
+                    readfile /etc/udev/cache.data
+                    if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then
+                            (cd /; tar xf $DEVCACHE > /dev/null 2>&1)
+                            not_first_boot=1
+                            [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
+                            [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
+                    else
+                            echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
+                    fi
+            else
+                    echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
+            fi
+    fi
+
+    # make_extra_nodes
+    killproc systemd-udevd > "/dev/null" 2>&1
+
+    # trigger the sorted events
+    echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
+    @UDEVD@ -d
+
+    udevadm control --env=STARTUP=1
+    if [ "$not_first_boot" != "" ];then
+            udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus  --subsystem-nomatch=graphics	 --subsystem-nomatch=backlight --subsystem-nomatch=video4linux	--subsystem-nomatch=platform
+            (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
+    else
+            udevadm trigger --action=add
+            udevadm settle
+    fi
+    ;;
+  stop)
+    echo "Stopping udevd"
+    start-stop-daemon --stop --name systemd-udevd --quiet
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  status)
+    status systemd-udevd
+    ;;
+  *)
+    echo "Usage: $0 {start|stop|status|restart}"
+    exit 1
+esac
+exit 0
diff --git a/meta/recipes-core/systemd/systemd/qemuall_io_latency-core-device.c-Change-the-default-device-timeout-to-2.patch b/meta/recipes-core/systemd/systemd/qemuall_io_latency-core-device.c-Change-the-default-device-timeout-to-2.patch
new file mode 100644
index 0000000..c7e1711
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/qemuall_io_latency-core-device.c-Change-the-default-device-timeout-to-2.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [Specific case QEMU/AB]
+
+From 7b8c4e0a67a79a75e1bd77df3a452a5497322108 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Thu, 27 Aug 2015 17:58:26 -0500
+Subject: [PATCH] core/device.c: Change the default device timeout to 240 sec.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ src/core/device.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/core/device.c b/src/core/device.c
+index e7efcf0..4ed8f08 100644
+--- a/src/core/device.c
++++ b/src/core/device.c
+@@ -110,7 +110,7 @@ static void device_init(Unit *u) {
+          * indefinitely for plugged in devices, something which cannot
+          * happen for the other units since their operations time out
+          * anyway. */
+-        u->job_timeout = u->manager->default_timeout_start_usec;
++        u->job_timeout = (240 * USEC_PER_SEC);
+ 
+         u->ignore_on_isolate = true;
+         u->ignore_on_snapshot = true;
+-- 
+1.9.1
+
diff --git a/meta/recipes-core/systemd/systemd/run-ptest b/meta/recipes-core/systemd/systemd/run-ptest
new file mode 100644
index 0000000..a2d61c2
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+tar -C test -xJf test/sys.tar.xz
+make test/rules-test.sh.log
+make test/udev-test.pl.log
diff --git a/meta/recipes-core/systemd/systemd/touchscreen.rules b/meta/recipes-core/systemd/systemd/touchscreen.rules
new file mode 100644
index 0000000..d83fd16
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/touchscreen.rules
@@ -0,0 +1,18 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+#    For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Create a symlink to any touchscreen input device
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0"
diff --git a/meta/recipes-core/systemd/systemd_225.bb b/meta/recipes-core/systemd/systemd_225.bb
new file mode 100644
index 0000000..6ac99cd
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_225.bb
@@ -0,0 +1,415 @@
+SUMMARY = "A System and service manager"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
+
+DESCRIPTION = "systemd is a system and service manager for Linux, compatible with \
+SysV and LSB init scripts. systemd provides aggressive parallelization \
+capabilities, uses socket and D-Bus activation for starting services, \
+offers on-demand starting of daemons, keeps track of processes using \
+Linux cgroups, supports snapshotting and restoring of the system \
+state, maintains mount and automount points and implements an \
+elaborate transactional dependency-based service control logic. It can \
+work as a drop-in replacement for sysvinit."
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
+                    file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
+
+PROVIDES = "udev"
+
+PE = "1"
+
+DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup glib-2.0 qemu-native util-linux"
+
+SECTION = "base/shell"
+
+inherit useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext
+
+SRCREV = "e1439a1472c5f691733b8ef10e702beac2496a63"
+
+PV = "225+git${SRCPV}"
+
+SRC_URI = "git://github.com/systemd/systemd.git;protocol=git \
+           file://0003-binfmt-Don-t-install-dependency-links-at-install-tim.patch \
+           file://0004-configure-Check-for-additional-features-that-uclibc-.patch \
+           file://0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch \
+           file://0006-journal-Use-posix-fallocate-only-if-available.patch \
+           file://0007-util-Use-mkostemp-only-if-libc-supports-it.patch \
+           file://0008-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch \
+           file://0009-sysv-generator-add-support-for-executing-scripts-und.patch \
+           file://0010-Make-root-s-home-directory-configurable.patch \
+           file://0011-systemd-user-avoid-using-system-auth.patch \
+           file://0012-implment-systemd-sysv-install-for-OE.patch \
+           file://0014-Revert-rules-remove-firmware-loading-rules.patch \
+           file://0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch \
+           file://touchscreen.rules \
+           file://00-create-volatile.conf \
+           file://init \
+           file://run-ptest \
+          "
+SRC_URI_append_qemuall = "file://qemuall_io_latency-core-device.c-Change-the-default-device-timeout-to-2.patch"
+
+S = "${WORKDIR}/git"
+
+SRC_URI_append_libc-uclibc = "\
+            file://0001-units-Prefer-getty-to-agetty-in-console-setup-system.patch \
+           "
+LDFLAGS_append_libc-uclibc = " -lrt"
+
+GTKDOC_DOCDIR = "${S}/docs/"
+
+PACKAGECONFIG ??= "xz ldconfig \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
+                  "
+
+PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl"
+# Sign the journal for anti-tampering
+PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
+# regardless of PACKAGECONFIG, libgcrypt is always required to expand
+# the AM_PATH_LIBGCRYPT autoconf macro
+DEPENDS += "libgcrypt"
+# Compress the journal
+PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
+PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
+PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd"
+PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils"
+PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved"
+PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd"
+PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn"
+PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit"
+PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam"
+# Verify keymaps on locale change
+PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
+# Update NAT firewall rules
+PACKAGECONFIG[iptc] = "--enable-libiptc,--disable-libiptc,iptables"
+PACKAGECONFIG[ldconfig] = "--enable-ldconfig,--disable-ldconfig,,"
+PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux"
+PACKAGECONFIG[valgrind] = "ac_cv_header_valgrind_memcheck_h=yes ac_cv_header_valgrind_valgrind_h=yes ,ac_cv_header_valgrind_memcheck_h=no ac_cv_header_valgrind_valgrind_h=no ,valgrind"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_KILL=${base_bindir}/kill"
+CACHED_CONFIGUREVARS += "ac_cv_path_KMOD=${base_bindir}/kmod"
+CACHED_CONFIGUREVARS += "ac_cv_path_QUOTACHECK=${sbindir}/quotacheck"
+CACHED_CONFIGUREVARS += "ac_cv_path_QUOTAON=${sbindir}/quotaon"
+CACHED_CONFIGUREVARS += "ac_cv_path_SULOGIN=${base_sbindir}/sulogin"
+
+# Helper variables to clarify locations.  This mirrors the logic in systemd's
+# build system.
+rootprefix ?= "${base_prefix}"
+rootlibdir ?= "${base_libdir}"
+rootlibexecdir = "${rootprefix}/lib"
+
+CACHED_CONFIGUREVARS_class-target = "\
+                         ac_cv_path_MOUNT_PATH=${base_bindir}/mount \
+                         ac_cv_path_UMOUNT_PATH=${base_bindir}/umount \
+                         ac_cv_path_KMOD=${base_bindir}/kmod \
+                         ac_cv_path_KILL=${base_bindir}/kill \
+                         ac_cv_path_SULOGIN=${base_sbindir}/sulogin \
+                         ac_cv_path_KEXEC=${sbindir}/kexec \
+                         ac_cv_path_QUOTACHECK=${sbindir}/quotacheck \
+                         ac_cv_path_QUOTAON=${sbindir}/quotaon \
+			 "
+
+EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
+                 --with-rootlibdir=${rootlibdir} \
+                 --with-roothomedir=${ROOT_HOME} \
+                 --disable-coredump \
+                 --enable-split-usr \
+                 --without-python \
+                 --with-sysvrcnd-path=${sysconfdir} \
+                 --with-firmware-path=/lib/firmware \
+               "
+# uclibc does not have NSS
+EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
+
+do_configure_prepend() {
+	export NM="${HOST_PREFIX}gcc-nm"
+	export AR="${HOST_PREFIX}gcc-ar"
+	export RANLIB="${HOST_PREFIX}gcc-ranlib"
+	export KMOD="${base_bindir}/kmod"
+	if [ -d ${S}/units.pre_sed ] ; then
+		cp -r ${S}/units.pre_sed ${S}/units
+	else
+		cp -r ${S}/units ${S}/units.pre_sed
+	fi
+	sed -i '/ln --relative --help/d' ${S}/configure.ac
+	sed -i -e 's:\$(LN_S) --relative -f:lnr:g' ${S}/Makefile.am
+	sed -i -e 's:\$(LN_S) --relative:lnr:g' ${S}/Makefile.am
+}
+
+do_install() {
+	autotools_do_install
+	install -d ${D}/${base_sbindir}
+	# Provided by a separate recipe
+	rm ${D}${systemd_unitdir}/system/serial-getty* -f
+
+	# Provide support for initramfs
+	[ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
+	[ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
+
+	# Create machine-id
+	# 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable
+	touch ${D}${sysconfdir}/machine-id
+
+
+	install -d ${D}${sysconfdir}/udev/rules.d/
+	install -d ${D}${sysconfdir}/tmpfiles.d
+	install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
+
+	install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+		install -d ${D}${sysconfdir}/init.d
+		install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
+		sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
+	fi
+
+	chown root:systemd-journal ${D}/${localstatedir}/log/journal
+
+        # Delete journal README, as log can be symlinked inside volatile.
+        rm -f ${D}/${localstatedir}/log/README
+
+	# Create symlinks for systemd-update-utmp-runlevel.service
+	install -d ${D}${systemd_unitdir}/system/graphical.target.wants
+	install -d ${D}${systemd_unitdir}/system/multi-user.target.wants
+	install -d ${D}${systemd_unitdir}/system/poweroff.target.wants
+	install -d ${D}${systemd_unitdir}/system/reboot.target.wants
+	install -d ${D}${systemd_unitdir}/system/rescue.target.wants
+	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service
+	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service
+	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service
+	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service
+	ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service
+
+	# Enable journal to forward message to syslog daemon
+	sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf
+	# this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it
+	# for existence else it fails
+	if [ -s ${D}${libdir}/tmpfiles.d/systemd.conf ]; then
+		${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${libdir}/tmpfiles.d/systemd.conf', d)}
+	fi
+	install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install
+}
+
+do_install_ptest () {
+       install -d ${D}${PTEST_PATH}/test
+       cp -rf ${S}/test/* ${D}${PTEST_PATH}/test
+       install -m 0755  ${B}/test-udev ${D}${PTEST_PATH}/
+       install -d ${D}${PTEST_PATH}/build-aux
+       cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
+       cp -rf ${B}/rules ${D}${PTEST_PATH}/
+       # This directory needs to be there for udev-test.pl to work.
+       install -d ${D}${libdir}/udev/rules.d
+       cp ${B}/Makefile ${D}${PTEST_PATH}/
+       cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test
+       sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl
+       sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
+       sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile
+}
+
+python populate_packages_prepend (){
+    systemdlibdir = d.getVar("rootlibdir", True)
+    do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
+}
+PACKAGES_DYNAMIC += "^lib(udev|systemd).*"
+
+PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \
+             ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh ${PN}-xorg-xinitrc"
+
+SYSTEMD_PACKAGES = "${PN}-binfmt"
+SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} += "--system systemd-journal-gateway; --system systemd-timesync"
+GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
+
+FILES_${PN}-analyze = "${bindir}/systemd-analyze"
+
+FILES_${PN}-initramfs = "/init"
+RDEPENDS_${PN}-initramfs = "${PN}"
+
+RDEPENDS_${PN}-ptest += "perl python bash"
+FILES_${PN}-ptest += "${libdir}/udev/rules.d"
+
+FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug"
+
+FILES_${PN}-gui = "${bindir}/systemadm"
+
+FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
+                              ${systemd_unitdir}/system/systemd-vconsole-setup.service \
+                              ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
+
+RDEPENDS_${PN}-kernel-install += "bash"
+FILES_${PN}-kernel-install = "${bindir}/kernel-install \
+                              ${sysconfdir}/kernel/ \
+                              ${exec_prefix}/lib/kernel \
+                             "
+FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
+                         "
+
+FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*"
+
+FILES_${PN}-zsh = "${datadir}/zsh/site-functions"
+
+FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
+                      ${exec_prefix}/lib/binfmt.d \
+                      ${rootlibexecdir}/systemd/systemd-binfmt \
+                      ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
+                      ${systemd_unitdir}/system/systemd-binfmt.service"
+RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
+
+RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps"
+
+CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
+                ${sysconfdir}/systemd/logind.conf \
+                ${sysconfdir}/systemd/system.conf \
+                ${sysconfdir}/systemd/user.conf"
+
+FILES_${PN} = " ${base_bindir}/* \
+                ${datadir}/bash-completion \
+                ${datadir}/dbus-1/services \
+                ${datadir}/dbus-1/system-services \
+                ${datadir}/polkit-1 \
+                ${datadir}/${BPN} \
+                ${datadir}/factory \
+                ${sysconfdir}/bash_completion.d/ \
+                ${sysconfdir}/dbus-1/ \
+                ${sysconfdir}/machine-id \
+                ${sysconfdir}/modules-load.d/ \
+                ${sysconfdir}/pam.d/ \
+                ${sysconfdir}/sysctl.d/ \
+                ${sysconfdir}/systemd/ \
+                ${sysconfdir}/tmpfiles.d/ \
+                ${sysconfdir}/xdg/ \
+                ${sysconfdir}/init.d/README \
+                ${rootlibexecdir}/systemd/* \
+                ${systemd_unitdir}/* \
+                ${base_libdir}/security/*.so \
+                ${libdir}/libnss_* \
+                /cgroup \
+                ${bindir}/systemd* \
+                ${bindir}/busctl \
+                ${bindir}/localectl \
+                ${bindir}/hostnamectl \
+                ${bindir}/timedatectl \
+                ${bindir}/bootctl \
+                ${bindir}/kernel-install \
+                ${exec_prefix}/lib/tmpfiles.d/*.conf \
+                ${exec_prefix}/lib/systemd \
+                ${exec_prefix}/lib/modules-load.d \
+                ${exec_prefix}/lib/sysctl.d \
+                ${exec_prefix}/lib/sysusers.d \
+                ${localstatedir} \
+                ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \
+                ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \
+                ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \
+                ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \
+               "
+
+FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
+FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
+
+RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})"
+RDEPENDS_${PN} += "volatile-binds update-rc.d"
+
+RRECOMMENDS_${PN} += "systemd-serialgetty systemd-vconsole-setup \
+                      systemd-compat-units udev-hwdb \
+                      util-linux-agetty  util-linux-fsck e2fsprogs-e2fsck \
+                      kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
+                      os-release \
+"
+
+PACKAGES =+ "udev-dbg udev udev-hwdb"
+
+FILES_udev-dbg += "${nonarch_base_libdir}/udev/.debug"
+
+RPROVIDES_udev = "hotplug"
+
+RDEPENDS_udev-hwdb += "udev"
+
+FILES_udev += "${base_sbindir}/udevd \
+               ${rootlibexecdir}/systemd/systemd-udevd \
+               ${rootlibexecdir}/udev/accelerometer \
+               ${rootlibexecdir}/udev/ata_id \
+               ${rootlibexecdir}/udev/cdrom_id \
+               ${rootlibexecdir}/udev/collect \
+               ${rootlibexecdir}/udev/findkeyboards \
+               ${rootlibexecdir}/udev/keyboard-force-release.sh \
+               ${rootlibexecdir}/udev/keymap \
+               ${rootlibexecdir}/udev/mtd_probe \
+               ${rootlibexecdir}/udev/scsi_id \
+               ${rootlibexecdir}/udev/v4l_id \
+               ${rootlibexecdir}/udev/keymaps \
+               ${rootlibexecdir}/udev/rules.d/*.rules \
+               ${sysconfdir}/udev \
+               ${sysconfdir}/init.d/systemd-udevd \
+               ${systemd_unitdir}/system/*udev* \
+               ${systemd_unitdir}/system/*.wants/*udev* \
+               ${base_bindir}/udevadm \
+               ${datadir}/bash-completion/completions/udevadm \
+              "
+
+FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
+
+INITSCRIPT_PACKAGES = "udev"
+INITSCRIPT_NAME_udev = "systemd-udevd"
+INITSCRIPT_PARAMS_udev = "start 03 S ."
+
+python __anonymous() {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
+}
+
+# TODO:
+# u-a for runlevel and telinit
+
+ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel"
+
+ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
+ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
+ALTERNATIVE_PRIORITY[init] ?= "300"
+
+ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
+ALTERNATIVE_PRIORITY[halt] ?= "300"
+
+ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
+ALTERNATIVE_PRIORITY[reboot] ?= "300"
+
+ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
+ALTERNATIVE_PRIORITY[shutdown] ?= "300"
+
+ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
+ALTERNATIVE_PRIORITY[poweroff] ?= "300"
+
+ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
+ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
+ALTERNATIVE_PRIORITY[runlevel] ?= "300"
+
+pkg_postinst_udev-hwdb () {
+	if test -n "$D"; then
+		${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
+			--root $D
+	else
+		udevadm hwdb --update
+	fi
+}
+
+pkg_prerm_udev-hwdb () {
+	if test -n "$D"; then
+		exit 1
+	fi
+
+	rm -f ${sysconfdir}/udev/hwdb.bin
+}
+
+# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so
+# that we don't build both udev and systemd in world builds.
+python () {
+    if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+        raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
+}
diff --git a/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch
new file mode 100644
index 0000000..7b34290
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/crypt-lib.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Inappropriate [configuration]
+
+# The src Makefile was checking for libcrypt.a on the host, not in the
+# build environment.  This patch checks for $LCRYPT in the environment
+# and uses it if it's there.
+# - jdike@linux.intel.com
+
+Index: sysvinit-2.88dsf/src/Makefile
+===================================================================
+--- sysvinit-2.88dsf.orig/src/Makefile
++++ sysvinit-2.88dsf/src/Makefile
+@@ -85,9 +85,13 @@ else
+ endif
+ 
+ # Additional libs for GNU libc.
++ifneq ($(LCRYPT),)
++  SULOGINLIBS	+= $(LCRYPT)
++else
+ ifneq ($(wildcard /usr/lib*/libcrypt.a),)
+   SULOGINLIBS	+= -lcrypt
+ endif
++endif
+ 
+ all:		$(BIN) $(SBIN) $(USRBIN)
+ 
diff --git a/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch
new file mode 100644
index 0000000..6c4225a
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/install.patch
@@ -0,0 +1,83 @@
+Upstream-Status: Pending
+
+diff --git a/src/Makefile b/src/Makefile
+index e2b8028..3e11e92 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -65,7 +65,14 @@ else
+   INSTALL_DATA	= install -m 644
+ endif
+ INSTALL_DIR	= install -m 755 -d
+-MANDIR		= /usr/share/man
++
++ROOT         ?=
++base_bindir  ?= /bin
++base_sbindir ?= /sbin
++bindir       ?= /usr/bin
++sysconfdir   ?= /etc
++includedir   ?= /usr/include
++mandir       ?= /usr/share/man
+ 
+ ifeq ($(WITH_SELINUX),yes)
+   SELINUX_DEF	=  -DWITH_SELINUX
+@@ -138,39 +145,39 @@ clobber:	cleanobjs
+ distclean:	clobber
+ 
+ install:
+-		$(INSTALL_DIR) $(ROOT)/bin/ $(ROOT)/sbin/
+-		$(INSTALL_DIR) $(ROOT)/usr/bin/
++		$(INSTALL_DIR) $(ROOT)$(base_bindir)/ $(ROOT)$(base_sbindir)/
++		$(INSTALL_DIR) $(ROOT)$(bindir)/
+ 		for i in $(BIN); do \
+-			$(INSTALL_EXEC) $$i $(ROOT)/bin/ ; \
++			$(INSTALL_EXEC) $$i $(ROOT)$(base_bindir)/ ; \
+ 		done
+ 		for i in $(SBIN); do \
+-			$(INSTALL_EXEC) $$i $(ROOT)/sbin/ ; \
++			$(INSTALL_EXEC) $$i $(ROOT)$(base_sbindir)/ ; \
+ 		done
+ 		for i in $(USRBIN); do \
+-			$(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \
++			$(INSTALL_EXEC) $$i $(ROOT)$(bindir)/ ; \
+ 		done
+-		# $(INSTALL_DIR) $(ROOT)/etc/
+-		# $(INSTALL_EXEC) initscript.sample $(ROOT)/etc/
+-		ln -sf halt $(ROOT)/sbin/reboot
+-		ln -sf halt $(ROOT)/sbin/poweroff
+-		ln -sf init $(ROOT)/sbin/telinit
+-		ln -sf /sbin/killall5 $(ROOT)/bin/pidof
+-		if [ ! -f $(ROOT)/usr/bin/lastb ]; then \
+-			ln -sf last $(ROOT)/usr/bin/lastb; \
++		# $(INSTALL_DIR) $(ROOT)$(sysconfdir)/
++		# $(INSTALL_EXEC) initscript.sample $(ROOT)$(sysconfdir)/
++		ln -sf halt $(ROOT)$(base_sbindir)/reboot
++		ln -sf halt $(ROOT)$(base_sbindir)/poweroff
++		ln -sf init $(ROOT)$(base_sbindir)/telinit
++		ln -sf $(base_sbindir)/killall5 $(ROOT)$(base_bindir)/pidof
++		if [ ! -f $(ROOT)$(bindir)/lastb ]; then \
++			ln -sf last $(ROOT)$(bindir)/lastb; \
+ 		fi
+-		$(INSTALL_DIR) $(ROOT)/usr/include/
+-		$(INSTALL_DATA) initreq.h $(ROOT)/usr/include/
+-		$(INSTALL_DIR) $(ROOT)$(MANDIR)/man1/
+-		$(INSTALL_DIR) $(ROOT)$(MANDIR)/man5/
+-		$(INSTALL_DIR) $(ROOT)$(MANDIR)/man8/
++		$(INSTALL_DIR) $(ROOT)$(includedir)/
++		$(INSTALL_DATA) initreq.h $(ROOT)$(includedir)/
++		$(INSTALL_DIR) $(ROOT)$(mandir)/man1/
++		$(INSTALL_DIR) $(ROOT)$(mandir)/man5/
++		$(INSTALL_DIR) $(ROOT)$(mandir)/man8/
+ 		for i in $(MAN1); do \
+-			$(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man1/; \
++			$(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man1/; \
+ 		done
+ 		for i in $(MAN5); do \
+-			$(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man5/; \
++			$(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man5/; \
+ 		done
+ 		for i in $(MAN8); do \
+-			$(INSTALL_DATA) ../man/$$i $(ROOT)$(MANDIR)/man8/; \
++			$(INSTALL_DATA) ../man/$$i $(ROOT)$(mandir)/man8/; \
+ 		done
+ ifeq ($(ROOT),)
+ 		#
diff --git a/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch
new file mode 100644
index 0000000..5b5dfdc
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-2.88dsf/pidof-add-m-option.patch
@@ -0,0 +1,189 @@
+pidof: add -m option
+
+When used with -o, will also omit any processes that have the same
+argv[0] and argv[1] as any explicitly omitted process ids. This can be
+used to avoid multiple shell scripts concurrently calling pidof returning
+each other's pids.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=883856
+
+Upstream-Status: backport
+Imported patch from: https://bugzilla.redhat.com/attachment.cgi?id=658166
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ man/pidof.8    |  6 ++++++
+ src/killall5.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
+ 2 files changed, 65 insertions(+), 3 deletions(-)
+
+diff --git a/man/pidof.8 b/man/pidof.8
+--- a/man/pidof.8
++++ b/man/pidof.8
+@@ -24,6 +24,7 @@ pidof -- find the process ID of a running program.
+ .RB [ \-c ]
+ .RB [ \-n ]
+ .RB [ \-x ]
++.RB [ \-m ]
+ .RB [ \-o
+ .IR omitpid[,omitpid..] ]
+ .RB [ \-o
+@@ -63,6 +64,11 @@ shells running the named scripts.
+ Tells \fIpidof\fP to omit processes with that process id. The special
+ pid \fB%PPID\fP can be used to name the parent process of the \fIpidof\fP
+ program, in other words the calling shell or shell script.
++.IP -m
++When used with -o, will also omit any processes that have the same
++argv[0] and argv[1] as any explicitly omitted process ids. This can be
++used to avoid multiple shell scripts concurrently calling pidof returning
++each other's pids.
+ .SH "EXIT STATUS"
+ .TP
+ .B 0
+diff --git a/src/killall5.c b/src/killall5.c
+index 5937d98..e73885e 100644
+--- a/src/killall5.c
++++ b/src/killall5.c
+@@ -118,6 +118,7 @@ typedef struct _s_nfs
+ 
+ /* List of processes. */
+ PROC *plist;
++PROC *olist;
+ 
+ /* List of processes to omit. */
+ OMIT *omit;
+@@ -345,6 +346,20 @@ static void clear_mnt(void)
+ 	}
+ }
+ 
++static void clear_omit(void)
++{
++	OMIT *o;
++	PROC *p;
++	for (o = omit; o; o = omit) {
++		omit = omit->next;
++		free(o);
++	}
++	for (p = olist; p; p = olist) {
++		olist = olist->next;
++		free(p);
++	}
++}
++
+ /*
+  *     Check if path is ia shadow off a NFS partition.
+  */
+@@ -452,6 +467,7 @@ int readproc(int do_stat)
+ 	DIR		*dir;
+ 	FILE		*fp;
+ 	PROC		*p, *n;
++	OMIT		*o, *m;
+ 	struct dirent	*d;
+ 	struct stat	st;
+ 	char		path[PATH_MAX+1];
+@@ -624,6 +640,17 @@ int readproc(int do_stat)
+ 		p->next = plist;
+ 		plist = p;
+ 		p->pid = pid;
++		/* Could be smarter, but it's a small list. */
++		m = omit;
++		for (o = omit; m; o = m) {
++			m = o->next;
++			if (o->pid == p->pid) {
++				n = (PROC*)xmalloc(sizeof(PROC));
++				*n = *p;
++				n->next = olist;
++				olist = n;
++			}
++		}
+ 	}
+ 	closedir(dir);
+ 
+@@ -813,6 +840,26 @@ PIDQ_HEAD *pidof(char *prog)
+ 	return q;
+ }
+ 
++int matches(PROC *o, PROC *p)
++{
++	int ret = 0;
++	char *oargv1, *pargv1;
++	if ((o->argv0 && p->argv0 && !strcmp(o->argv0,p->argv0))) {
++		if (o->argv1 && p->argv1) {
++			if ((oargv1 = canonicalize_file_name(o->argv1)) == NULL)
++				oargv1 = strdup(o->argv1);
++			if ((pargv1 = canonicalize_file_name(p->argv1)) == NULL)
++				pargv1 = strdup(p->argv1);
++			if (! strcmp(oargv1, pargv1)) {
++				ret = 1;
++			}
++			free(oargv1);
++			free(pargv1);
++		}
++	}
++	return ret;
++}
++
+ /* Give usage message and exit. */
+ void usage(void)
+ {
+@@ -845,6 +892,7 @@ void nsyslog(int pri, char *fmt, ...)
+ #define PIDOF_SINGLE	0x01
+ #define PIDOF_OMIT	0x02
+ #define PIDOF_NETFS	0x04
++#define PIDOF_OMIT_OMIT_MATCHES	0x08
+ 
+ /*
+  *	Pidof functionality.
+@@ -861,6 +909,7 @@ int main_pidof(int argc, char **argv)
+ 	struct stat	st;
+ 	char		tmp[512];
+ 
++	olist = (PROC*)0;
+ 	omit = (OMIT*)0;
+ 	nlist = (NFS*)0;
+ 	opterr = 0;
+@@ -868,7 +917,7 @@ int main_pidof(int argc, char **argv)
+ 	if ((token = getenv("PIDOF_NETFS")) && (strcmp(token,"no") != 0))
+ 		flags |= PIDOF_NETFS;
+ 
+-	while ((opt = getopt(argc,argv,"hco:sxn")) != EOF) switch (opt) {
++	while ((opt = getopt(argc,argv,"hcmo:sxn")) != EOF) switch (opt) {
+ 		case '?':
+ 			nsyslog(LOG_ERR,"invalid options on command line!\n");
+ 			closelog();
+@@ -907,6 +956,9 @@ int main_pidof(int argc, char **argv)
+ 		case 'x':
+ 			scripts_too++;
+ 			break;
++		case 'm':
++			flags |= PIDOF_OMIT_OMIT_MATCHES;
++			break;
+ 		case 'n':
+ 			flags |= PIDOF_NETFS;
+ 			break;
+@@ -938,10 +990,13 @@ int main_pidof(int argc, char **argv)
+ 			pid_t spid = 0;
+ 			while ((p = get_next_from_pid_q(q))) {
+ 				if ((flags & PIDOF_OMIT) && omit) {
+-					OMIT * optr;
+-					for (optr = omit; optr; optr = optr->next) {
++					PROC * optr;
++					for (optr = olist; optr; optr = optr->next) {
+ 						if (optr->pid == p->pid)
+ 							break;
++						if (flags & PIDOF_OMIT_OMIT_MATCHES)
++							if (matches(optr, p))
++								break;
+ 					}
+ 
+ 					/*
+@@ -977,6 +1032,7 @@ int main_pidof(int argc, char **argv)
+ 	if (!first)
+ 		printf("\n");
+ 
++	clear_omit();
+ 	clear_mnt();
+ 
+ 	closelog();
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab/inittab b/meta/recipes-core/sysvinit/sysvinit-inittab/inittab
new file mode 100644
index 0000000..6abbdf4
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab/inittab
@@ -0,0 +1,30 @@
+# /etc/inittab: init(8) configuration.
+# $Id: inittab,v 1.91 2002/01/25 13:35:21 miquels Exp $
+
+# The default runlevel.
+id:5:initdefault:
+
+# Boot-time system configuration/initialization script.
+# This is run first except when booting in emergency (-b) mode.
+si::sysinit:/etc/init.d/rcS
+
+# What to do in single-user mode.
+~~:S:wait:/sbin/sulogin
+
+# /etc/init.d executes the S and K scripts upon change
+# of runlevel.
+#
+# Runlevel 0 is halt.
+# Runlevel 1 is single-user.
+# Runlevels 2-5 are multi-user.
+# Runlevel 6 is reboot.
+
+l0:0:wait:/etc/init.d/rc 0
+l1:1:wait:/etc/init.d/rc 1
+l2:2:wait:/etc/init.d/rc 2
+l3:3:wait:/etc/init.d/rc 3
+l4:4:wait:/etc/init.d/rc 4
+l5:5:wait:/etc/init.d/rc 5
+l6:6:wait:/etc/init.d/rc 6
+# Normally not reached, but fallthrough in case of emergency.
+z6:6:respawn:/sbin/sulogin
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
new file mode 100644
index 0000000..49b1326
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb
@@ -0,0 +1,83 @@
+SUMMARY = "Inittab configuration for SysVinit"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+PR = "r10"
+
+SRC_URI = "file://inittab"
+
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_compile() {
+	:
+}
+
+do_install() {
+	install -d ${D}${sysconfdir}
+    install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}/inittab
+
+    set -x
+    tmp="${SERIAL_CONSOLES}"
+    for i in $tmp
+    do
+	j=`echo ${i} | sed s/\;/\ /g`
+	label=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'`
+	echo "$label:12345:respawn:${base_sbindir}/getty -L ${j}" >> ${D}${sysconfdir}/inittab
+    done
+
+    if [ "${USE_VT}" = "1" ]; then
+        cat <<EOF >>${D}${sysconfdir}/inittab
+# ${base_sbindir}/getty invocations for the runlevels.
+#
+# The "id" field MUST be the same as the last
+# characters of the device (after "tty").
+#
+# Format:
+#  <id>:<runlevels>:<action>:<process>
+#
+
+EOF
+
+        for n in ${SYSVINIT_ENABLED_GETTYS}
+        do
+            echo "$n:12345:respawn:${base_sbindir}/getty 38400 tty$n" >> ${D}${sysconfdir}/inittab
+        done
+        echo "" >> ${D}${sysconfdir}/inittab
+    fi
+}
+
+pkg_postinst_${PN} () {
+# run this on the target
+if [ "x$D" = "x" ] && [ -e /proc/consoles ]; then
+	tmp="${SERIAL_CONSOLES_CHECK}"
+	for i in $tmp
+	do
+		j=`echo ${i} | sed s/^.*\;//g`
+		if [ -z "`grep ${j} /proc/consoles`" ]; then
+			sed -i /^.*${j}$/d /etc/inittab
+		fi
+	done
+	kill -HUP 1
+else
+	if [ "${SERIAL_CONSOLES_CHECK}" = "" ]; then
+		exit 0
+	else
+		exit 1
+	fi
+fi
+}
+
+# USE_VT and SERIAL_CONSOLES are generally defined by the MACHINE .conf.
+# Set PACKAGE_ARCH appropriately.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES_${PN} = "${sysconfdir}/inittab"
+CONFFILES_${PN} = "${sysconfdir}/inittab"
+
+USE_VT ?= "1"
+SYSVINIT_ENABLED_GETTYS ?= "1"
+
+
+
diff --git a/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch b/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch
new file mode 100644
index 0000000..f35c15c
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch
@@ -0,0 +1,52 @@
+From 36ac97bfe51797458442a6035219a504a42e703a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Aug 2015 10:56:40 -0700
+Subject: [PATCH] This fixes an issue that clang reports about mutliple output
+ files
+
+Issue is that we are passing .h file to link step as seen below.
+
+| arm-oe-linux-gnueabi-clang  -march=armv7-a -mthumb  -mfloat-abi=hard
+-mfpu=neon-vfpv4 -mtune=cortex-a7 -D__extern_always_inline=inline
+-no-integrated-as
+--sysroot=/mnt/home/kraj/work/angstrom/sources/openembedded-core/build/tmp-glibc/sysroots/raspberrypi2
+-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed  halt.o ifdown.o hddown.o
+utmp.o reboot.h   -o halt
+| clang-3.7: error: cannot specify -o when generating multiple output
+files
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/Makefile | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index e77ed5f..a6f9f40 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -103,9 +103,9 @@ all:		$(BIN) $(SBIN) $(USRBIN)
+ init:		LDLIBS += $(INITLIBS) $(STATIC)
+ init:		init.o init_utmp.o
+ 
+-halt:		halt.o ifdown.o hddown.o utmp.o reboot.h
++halt:		halt.o ifdown.o hddown.o utmp.o
+ 
+-last:		last.o oldutmp.h
++last:		last.o
+ 
+ mesg:		mesg.o
+ 
+@@ -120,7 +120,7 @@ sulogin:	sulogin.o
+ 
+ wall:		dowall.o wall.o
+ 
+-shutdown:	dowall.o shutdown.o utmp.o reboot.h
++shutdown:	dowall.o shutdown.o utmp.o
+ 
+ bootlogd:	LDLIBS += -lutil
+ bootlogd:	bootlogd.o
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/sysvinit/sysvinit/01_bootlogd b/meta/recipes-core/sysvinit/sysvinit/01_bootlogd
new file mode 100644
index 0000000..a689d92
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/01_bootlogd
@@ -0,0 +1 @@
+f root root 0644 /var/log/boot none
diff --git a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
new file mode 100755
index 0000000..df5aa43
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
@@ -0,0 +1,98 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:          bootlogd
+# Required-Start:
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:      2 3 4 5
+# Short-Description: One of the first scripts to be executed. Starts or stops
+#               the bootlogd log program. If this script is called as
+#               "stop-bootlogd", it will stop the daemon instead of
+#               starting it even when called with the "start" argument.
+#
+### END INIT INFO
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/sbin/bootlogd
+NAME=bootlogd
+DESC="Bootlog daemon"
+
+# source function library
+. /etc/init.d/functions
+
+test -f $DAEMON || exit 0
+
+[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
+
+## set -e # not needed
+
+case "$BOOTLOGD_ENABLE" in
+	[Nn]*)
+		exit 0
+		;;
+esac
+
+STOPPER=
+ACTION="$1"
+case "$0" in
+	*stop-bootlog*)
+		STOPPER=Y
+		if [ "$ACTION" = start ]
+		then
+			ACTION=stop
+		fi
+		;;
+esac
+
+case "$ACTION" in
+	start)
+		[ "${VERBOSE}" != "no" ] && echo -n "Starting $DESC: "
+		if [ -d /proc/1/. ]
+		then
+			umask 027
+			start-stop-daemon --start --quiet \
+				--exec $DAEMON -- -r -c
+		else
+			$DAEMON -r -c
+		fi
+		[ "${VERBOSE}" != "no" ] && echo "$NAME."
+		;;
+	stop)
+		# stop may get called during bootup, so let it honor
+		# rcS VERBOSE setting
+		[ "${VERBOSE}" != "no" ] && echo -n "Stopping $DESC: "
+		start-stop-daemon --stop --quiet --exec $DAEMON
+
+		if [ "$STOPPER" ] && [ "$(which savelog 2>/dev/null)" ] && \
+		   [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
+		then
+			cd /var/log
+			chgrp adm boot
+			savelog -p -c 5 boot > /dev/null 2>&1
+			mv boot.0 boot
+			mv boot~ boot.0
+		fi
+
+		[ "${VERBOSE}" != "no" ] && echo "$NAME."
+		;;
+	 restart|force-reload)
+		echo -n "Restarting $DESC: "
+		start-stop-daemon --stop --quiet --exec $DAEMON
+		sleep 1
+		start-stop-daemon --start --quiet --exec $DAEMON
+		echo "$NAME."
+		;;
+	status)
+		status $DAEMON
+		exit $?
+		;;
+	*)
+		N=${0##*/}
+		N=${N#[SK]??}
+		echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
+		exit 1
+		;;
+esac
+
+exit 0
+
diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
new file mode 100755
index 0000000..7ca41ae
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -0,0 +1,182 @@
+#!/bin/sh
+#
+# rc		This file is responsible for starting/stopping
+#		services when the runlevel changes.
+#
+#		Optimization feature:
+#		A startup script is _not_ run when the service was
+#		running in the previous runlevel and it wasn't stopped
+#		in the runlevel transition (most Debian services don't
+#		have K?? links in rc{1,2,3,4,5} )
+#
+# Author:	Miquel van Smoorenburg <miquels@cistron.nl>
+#		Bruce Perens <Bruce@Pixar.com>
+#
+# Version:	@(#)rc  2.78  07-Nov-1999  miquels@cistron.nl
+#
+
+. /etc/default/rcS
+export VERBOSE
+
+startup_progress() {
+    step=$(($step + $step_change))
+    if [ "$num_steps" != "0" ]; then
+        progress=$((($step * $progress_size / $num_steps) + $first_step))
+    else
+        progress=$progress_size
+    fi
+    #echo "PROGRESS is $progress $runlevel $first_step + ($step of $num_steps) $step_change $progress_size"
+    #if type psplash-write >/dev/null 2>&1; then
+    #    TMPDIR=/mnt/.psplash psplash-write "PROGRESS $progress" || true
+    #fi
+    if [ -e /mnt/.psplash/psplash_fifo ]; then
+        echo "PROGRESS $progress" > /mnt/.psplash/psplash_fifo
+    fi
+}
+
+
+#
+# Start script or program.
+#
+startup() {
+  # Handle verbosity
+  [ "$VERBOSE" = very ] && echo "INIT: Running $@..."
+
+  case "$1" in
+	*.sh)
+		# Source shell script for speed.
+		(
+			trap - INT QUIT TSTP
+			scriptname=$1
+			shift
+			. $scriptname
+		)
+		;;
+	*)
+		"$@"
+		;;
+  esac
+  startup_progress
+}
+
+  # Ignore CTRL-C only in this shell, so we can interrupt subprocesses.
+  trap ":" INT QUIT TSTP
+
+  # Set onlcr to avoid staircase effect.
+  stty onlcr 0>&1
+
+  # Limit stack size for startup scripts
+  [ "$STACK_SIZE" == "" ] || ulimit -S -s $STACK_SIZE
+
+  # Now find out what the current and what the previous runlevel are.
+
+  runlevel=$RUNLEVEL
+  # Get first argument. Set new runlevel to this argument.
+  [ "$1" != "" ] && runlevel=$1
+  if [ "$runlevel" = "" ]
+  then
+	echo "Usage: $0 <runlevel>" >&2
+	exit 1
+  fi
+  previous=$PREVLEVEL
+  [ "$previous" = "" ] && previous=N
+
+  export runlevel previous
+
+  # Is there an rc directory for this new runlevel?
+  if [ -d /etc/rc$runlevel.d ]
+  then
+	# Find out where in the progress bar the initramfs got to.
+	PROGRESS_STATE=0
+	#if [ -f /dev/.initramfs/progress_state ]; then
+	#    . /dev/.initramfs/progress_state
+	#fi
+
+	# Split the remaining portion of the progress bar into thirds
+	progress_size=$(((100 - $PROGRESS_STATE) / 3))
+
+	case "$runlevel" in
+		0|6)
+			# Count down from -100 to 0 and use the entire bar
+			first_step=-100
+			progress_size=100
+			step_change=1
+			;;
+	        S)
+			# Begin where the initramfs left off and use 2/3
+			# of the remaining space
+			first_step=$PROGRESS_STATE
+			progress_size=$(($progress_size * 2))
+			step_change=1
+			;;
+		*)
+			# Begin where rcS left off and use the final 1/3 of
+			# the space (by leaving progress_size unchanged)
+			first_step=$(($progress_size * 2 + $PROGRESS_STATE))
+			step_change=1
+			;;
+	esac
+
+	num_steps=0
+	for s in /etc/rc$runlevel.d/[SK]*; do
+            case "${s##/etc/rc$runlevel.d/S??}" in
+                gdm|xdm|kdm|reboot|halt)
+                    break
+                    ;;
+            esac
+            num_steps=$(($num_steps + 1))
+        done
+        step=0
+
+	# First, run the KILL scripts.
+	if [ $previous != N ]
+	then
+		for i in /etc/rc$runlevel.d/K[0-9][0-9]*
+		do
+			# Check if the script is there.
+			[ ! -f $i ] && continue
+
+			# Stop the service.
+			startup $i stop
+		done
+	fi
+
+	# Now run the START scripts for this runlevel.
+	for i in /etc/rc$runlevel.d/S*
+	do
+		[ ! -f $i ] && continue
+
+		if [ $previous != N ] && [ $previous != S ]
+		then
+			#
+			# Find start script in previous runlevel and
+			# stop script in this runlevel.
+			#
+			suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]}
+			stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix
+			previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
+			#
+			# If there is a start script in the previous level
+			# and _no_ stop script in this level, we don't
+			# have to re-start the service.
+			#
+			[ -f $previous_start ] && [ ! -f $stop ] && continue
+		fi
+		case "$runlevel" in
+			0|6)
+				startup $i stop
+				;;
+			*)
+				startup $i start
+				;;
+		esac
+	done
+  fi
+
+#Uncomment to cause psplash to exit manually, otherwise it exits when it sees a VC switch
+if [ "x$runlevel" != "xS" ] && [ ! -x /etc/rc${runlevel}.d/S??xserver-nodm ]; then
+    if type psplash-write >/dev/null 2>&1; then
+        TMPDIR=/mnt/.psplash psplash-write "QUIT" || true
+    	umount -l /mnt/.psplash
+    fi
+fi
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS b/meta/recipes-core/sysvinit/sysvinit/rcS
new file mode 100755
index 0000000..080b04f
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/rcS
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# rcS		Call all S??* scripts in /etc/rcS.d in
+#		numerical/alphabetical order.
+#
+# Version:	@(#)/etc/init.d/rcS  2.76  19-Apr-1999  miquels@cistron.nl
+#
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+runlevel=S
+prevlevel=N
+umask 022
+export PATH runlevel prevlevel
+
+#	Make sure proc is mounted
+#
+[ -d "/proc/1" ] || mount /proc
+
+#
+#	Source defaults.
+#
+. /etc/default/rcS
+
+#
+#	Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
+#
+trap ":" INT QUIT TSTP
+
+#
+#	Call all parts in order.
+#
+exec /etc/init.d/rc S
+
+
diff --git a/meta/recipes-core/sysvinit/sysvinit/rcS-default b/meta/recipes-core/sysvinit/sysvinit/rcS-default
new file mode 100644
index 0000000..709cdf6
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/rcS-default
@@ -0,0 +1,29 @@
+#
+#	Defaults for the boot scripts in /etc/rcS.d
+#
+
+# Time files in /tmp are kept in days.
+TMPTIME=0
+# Set to yes if you want sulogin to be spawned on bootup
+SULOGIN=no
+# Set to no if you want to be able to login over telnet/rlogin
+# before system startup is complete (as soon as inetd is started)
+DELAYLOGIN=no
+# Assume that the BIOS clock is set to UTC time (recommended)
+UTC=yes
+# Set VERBOSE to "no" if you would like a more quiet bootup.
+VERBOSE=no
+# Set EDITMOTD to "no" if you don't want /etc/motd to be edited automatically
+EDITMOTD=no
+# Whether to fsck root on boot
+ENABLE_ROOTFS_FSCK=no
+# Set FSCKFIX to "yes" if you want to add "-y" to the fsck at startup.
+FSCKFIX=yes
+# Set TICKADJ to the correct tick value for this specific machine
+#TICKADJ=10000
+# Enable caching in populate-volatile.sh
+VOLATILE_ENABLE_CACHE=yes
+# Indicate whether the rootfs is intended to be read-only or not.
+# Setting ROOTFS_READ_ONLY to yes and rebooting will give you a read-only rootfs.
+# Normally you should not change this value.
+ROOTFS_READ_ONLY=no
diff --git a/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
new file mode 100644
index 0000000..5dfe39e
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb
@@ -0,0 +1,108 @@
+SUMMARY = "System-V like init"
+DESCRIPTION = "This package is required to boot in most configurations.  It provides the /sbin/init program.  This is the first process started on boot, and the last process terminated before the system halts."
+HOMEPAGE = "http://savannah.nongnu.org/projects/sysvinit/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+                    file://COPYRIGHT;endline=15;md5=349c872e0066155e1818b786938876a4"
+PR = "r14"
+
+RDEPENDS_${PN} = "${PN}-inittab"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/sysvinit/sysvinit-${PV}.tar.bz2 \
+           file://install.patch \
+           file://crypt-lib.patch \
+           file://pidof-add-m-option.patch \
+           file://0001-This-fixes-an-issue-that-clang-reports-about-mutlipl.patch \
+           file://rcS-default \
+           file://rc \
+           file://rcS \
+           file://bootlogd.init \
+           file://01_bootlogd \
+"
+
+SRC_URI[md5sum] = "6eda8a97b86e0a6f59dabbf25202aa6f"
+SRC_URI[sha256sum] = "60bbc8c1e1792056e23761d22960b30bb13eccc2cabff8c7310a01f4d5df1519"
+
+S = "${WORKDIR}/sysvinit-${PV}"
+B = "${S}/src"
+
+inherit update-alternatives
+DEPENDS_append = " update-rc.d-native base-passwd"
+
+ALTERNATIVE_${PN} = "init mountpoint halt reboot runlevel shutdown poweroff last lastb mesg utmpdump wall"
+
+ALTERNATIVE_PRIORITY = "200"
+
+ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
+ALTERNATIVE_PRIORITY[init] = "50"
+
+ALTERNATIVE_LINK_NAME[mountpoint] = "${base_bindir}/mountpoint"
+ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
+ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
+ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
+ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
+ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
+
+ALTERNATIVE_${PN}-pidof = "pidof"
+ALTERNATIVE_LINK_NAME[pidof] = "${base_bindir}/pidof"
+
+ALTERNATIVE_${PN}-sulogin = "sulogin"
+ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
+
+ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 mesg.1 wall.1 sulogin.8 utmpdump.1"
+
+ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
+ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1"
+ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1"
+ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
+ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
+ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
+
+PACKAGES =+ "sysvinit-pidof sysvinit-sulogin"
+FILES_${PN} += "${base_sbindir}/* ${base_bindir}/*"
+FILES_sysvinit-pidof = "${base_bindir}/pidof.sysvinit ${base_sbindir}/killall5"
+FILES_sysvinit-sulogin = "${base_sbindir}/sulogin.sysvinit"
+
+RDEPENDS_${PN} += "sysvinit-pidof initscripts-functions"
+
+CFLAGS_prepend = "-D_GNU_SOURCE "
+export LCRYPT = "-lcrypt"
+EXTRA_OEMAKE += "'base_bindir=${base_bindir}' \
+		 'base_sbindir=${base_sbindir}' \
+		 'bindir=${bindir}' \
+		 'sbindir=${sbindir}' \
+		 'sysconfdir=${sysconfdir}' \
+		 'includedir=${includedir}' \
+		 'mandir=${mandir}'"
+
+do_install () {
+	oe_runmake 'ROOT=${D}' install
+
+	install -d ${D}${sysconfdir} \
+		   ${D}${sysconfdir}/default \
+		   ${D}${sysconfdir}/init.d
+	for level in S 0 1 2 3 4 5 6; do
+		install -d ${D}${sysconfdir}/rc$level.d
+	done
+
+	install -m 0644    ${WORKDIR}/rcS-default	${D}${sysconfdir}/default/rcS
+	install -m 0755    ${WORKDIR}/rc		${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/rcS		${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/bootlogd.init     ${D}${sysconfdir}/init.d/bootlogd
+	ln -sf bootlogd ${D}${sysconfdir}/init.d/stop-bootlogd
+
+	update-rc.d -r ${D} bootlogd start 07 S .
+	update-rc.d -r ${D} stop-bootlogd start 99 2 3 4 5 .
+
+	install -d ${D}${sysconfdir}/default/volatiles
+	install -m 0644 ${WORKDIR}/01_bootlogd ${D}${sysconfdir}/default/volatiles
+
+	chown root.shutdown ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
+	chmod o-x,u+s ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
+}
+
+python () {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        raise bb.parse.SkipPackage("'sysvinit' not in DISTRO_FEATURES")
+}
diff --git a/meta/recipes-core/uclibc/site_config/funcs b/meta/recipes-core/uclibc/site_config/funcs
new file mode 100644
index 0000000..ccc8539
--- /dev/null
+++ b/meta/recipes-core/uclibc/site_config/funcs
@@ -0,0 +1,474 @@
+a64l
+abs
+access
+__adjtimex
+alarm
+alphasort
+argz_append
+__argz_count
+argz_create_sep
+argz_insert
+__argz_next
+argz_next
+__argz_stringify
+argz_stringify
+asprintf
+atexit
+atof
+atoi
+bcmp
+bcopy
+bindresvport
+bind_textdomain_codeset
+btowc
+bzero
+calloc
+canonicalize_file_name
+catgets
+cfgetospeed
+cfsetispeed
+cfsetspeed
+chmod
+chown
+chroot
+clock
+close
+closedir
+closelog
+confstr
+connect
+daemon
+dcgettext
+difftime
+dirfd
+dirname
+dngettext
+dup2
+ecvt
+endgrent
+endmntent
+endpwent
+endutent
+endutxent
+epoll_ctl
+err
+ether_hostton
+ether_ntohost
+euidaccess
+execv
+fchdir
+fchmod
+fchmodat
+fchown
+fchownat
+fcntl
+fcvt
+fdatasync
+fdopendir
+feof_unlocked
+fgets_unlocked
+fgetxattr
+finite
+flistxattr
+flock
+flockfile
+fnmatch
+fork
+fpathconf
+__fpending
+fprintf
+free
+freeaddrinfo
+freeifaddrs
+fseeko
+__fsetlocking
+fsetxattr
+fstat64
+fstat
+fstatfs
+fsync
+ftello
+ftime
+ftruncate
+funlockfile
+futimes
+futimesat
+gai_strerror
+gcvt
+getaddrinfo
+getc_unlocked
+getcwd
+getdelim
+getdomainname
+getdtablesize
+getegid
+getenv
+geteuid
+getgid
+getgrent
+getgrent_r
+getgrgid_r
+getgrnam
+getgrnam_r
+getgrouplist
+getgroups
+gethostbyaddr_r
+gethostbyname2
+gethostbyname
+gethostbyname_r
+gethostent
+gethostid
+gethostname
+getifaddrs
+getline
+getloadavg
+getmntent
+getmsg
+getnameinfo
+getnetbyaddr_r
+getnetgrent_r
+getopt
+getopt_long
+getopt_long_only
+getpagesize
+getpass
+getpeername
+getpgrp
+getpid
+getppid
+getprotoent_r
+getpwent
+getpwent_r
+getpwnam
+getpwnam_r
+getpwuid
+getpwuid_r
+getresuid
+getrlimit
+getrusage
+getservbyname
+getservbyname_r
+getservbyport_r
+getservent
+getservent_r
+getspnam
+getspnam_r
+gettimeofday
+getttyent
+getttynam
+getuid
+getusershell
+getutent
+getutid
+getutline
+getutmp
+getutmpx
+getutxent
+getutxid
+getutxline
+getwd
+getxattr
+glob
+gmtime
+gmtime_r
+grantpt
+group_member
+herror
+hstrerror
+iconv
+iconv_open
+if_freenameindex
+if_indextoname
+if_nameindex
+if_nametoindex
+index
+inet_addr
+inet_aton
+inet_ntoa
+inet_ntop
+inet_pton
+initgroups
+innetgr
+iruserok
+isascii
+isatty
+isblank
+isgraph
+isinf
+isnan
+isprint
+isspace
+iswalnum
+iswcntrl
+iswctype
+iswprint
+iswspace
+iswupper
+isxdigit
+kill
+killpg
+lchown
+lckpwdf
+lgetxattr
+link
+listxattr
+llistxattr
+localtime
+localtime_r
+lockf
+lrand48
+lsearch
+lseek64
+lsetxattr
+lstat
+mallinfo
+malloc
+mblen
+mbrlen
+mbrtowc
+mbsinit
+mbsrtowcs
+mbtowc
+memalign
+memchr
+memcmp
+memcpy
+memmove
+mempcpy
+memrchr
+memset
+mkdir
+mkdirat
+mkdtemp
+mkfifo
+mknod
+mkstemp64
+mkstemp
+mktime
+mlock
+mmap
+mtrace
+munlock
+munmap
+nanosleep
+nice
+nl_langinfo
+ntp_adjtime
+ntp_gettime
+_obstack_free
+on_exit
+open64
+open
+openat
+opendir
+openlog
+pathconf
+pipe
+poll
+popen
+posix_memalign
+prctl
+pread
+printf
+__progname
+pselect
+pthread_mutex_lock
+ptsname
+putenv
+putgrent
+putpwent
+putspent
+pututline
+pututxline
+putwc
+pwrite
+qsort
+raise
+rand
+random
+rand_r
+read
+readdir
+readdir_r
+readlink
+realloc
+realpath
+re_comp
+recvmsg
+re_exec
+regcomp
+regexec
+remove
+rename
+re_search
+rmdir
+rpmatch
+rresvport_af
+ruserok
+ruserok_af
+sbrk
+scandir
+sched_setscheduler
+sched_yield
+__secure_getenv
+select
+semctl
+semget
+sendmsg
+setbuf
+setbuffer
+setegid
+setenv
+seteuid
+setgid
+setgroups
+sethostname
+setitimer
+_setjmp
+setjmp
+setlinebuf
+setlocale
+setmntent
+setpgid
+setpgrp
+setpriority
+setregid
+setresgid
+setresuid
+setreuid
+setrlimit
+setsid
+setsockopt
+settimeofday
+setuid
+setutent
+setutxent
+setvbuf
+setxattr
+sgetspent
+shmat
+shmctl
+shmdt
+shmget
+shutdown
+sigaction
+sigaddset
+sigaltstack
+sigblock
+sigemptyset
+sighold
+siginterrupt
+signal
+sigprocmask
+sigset
+sigsetmask
+sigstack
+sigsuspend
+sigvec
+snprintf
+socket
+socketpair
+sprintf
+srand48
+srand
+srandom
+sscanf
+stat
+statfs
+statvfs
+stime
+stpcpy
+strcasecmp
+strcasestr
+strchr
+strchrnul
+strcmp
+strcspn
+strdup
+strerror
+strerror_r
+strftime
+strlen
+strncasecmp
+strncmp
+strndup
+strnlen
+strpbrk
+strptime
+strrchr
+strsep
+strsignal
+strspn
+strstr
+strtod
+strtoimax
+strtok_r
+strtol
+strtoll
+strtoul
+strtoull
+strtoumax
+strverscmp
+strxfrm
+symlink
+sync
+sysconf
+sysctl
+sysinfo
+syslog
+_sys_siglist
+sys_siglist
+system
+tcgetattr
+tcgetpgrp
+tcsetattr
+tcsetpgrp
+time
+timegm
+times
+timezone
+tmpnam
+towlower
+towupper
+truncate
+tsearch
+ttyname
+tzset
+ulimit
+umask
+uname
+unlink
+unsetenv
+unshare
+updwtmp
+updwtmpx
+usleep
+ustat
+utime
+utimes
+utmpname
+utmpxname
+valloc
+vasprintf
+verrx
+vfork
+vfprintf
+vfscanf
+vhangup
+vprintf
+vsnprintf
+vsprintf
+wait3
+wait4
+waitpid
+wcrtomb
+wcscoll
+wcsdup
+wcslen
+wctob
+wctomb
+wctype
+wcwidth
+wmemchr
+wmemcpy
+wmempcpy
diff --git a/meta/recipes-core/uclibc/site_config/headers b/meta/recipes-core/uclibc/site_config/headers
new file mode 100644
index 0000000..609ab53
--- /dev/null
+++ b/meta/recipes-core/uclibc/site_config/headers
@@ -0,0 +1,156 @@
+aio.h
+alloca.h
+argz.h
+arpa/inet.h
+arpa/nameser.h
+asm/byteorder.h
+asm/ioctls.h
+asm/page.h
+asm/types.h
+assert.h
+byteswap.h
+crypt.h
+ctype.h
+dirent.h
+dlfcn.h
+elf.h
+endian.h
+err.h
+errno.h
+execinfo.h
+fcntl.h
+features.h
+float.h
+fstab.h
+ftw.h
+getopt.h
+glob.h
+grp.h
+iconv.h
+ifaddrs.h
+inttypes.h
+langinfo.h
+lastlog.h
+libgen.h
+libintl.h
+limits.h
+linux/capability.h
+linux/fd.h
+linux/fs.h
+linux/hayesesp.h
+linux/hdreg.h
+linux/icmp.h
+linux/in6.h
+linux/joystick.h
+linux/ptrace.h
+linux/serial.h
+linux/sonypi.h
+linux/unistd.h
+linux/utsname.h
+linux/version.h
+locale.h
+malloc.h
+math.h
+mcheck.h
+memory.h
+mntent.h
+mqueue.h
+netdb.h
+net/if.h
+netinet/ether.h
+netinet/in.h
+netinet/ip6.h
+netinet/ip.h
+netinet/tcp.h
+netinet/udp.h
+netipx/ipx.h
+net/route.h
+paths.h
+poll.h
+pthread.h
+pty.h
+pwd.h
+regex.h
+resolv.h
+rpc/rpc.h
+rpc/types.h
+sched.h
+scsi/scsi.h
+search.h
+semaphore.h
+setjmp.h
+sgtty.h
+shadow.h
+signal.h
+stdarg.h
+stdbool.h
+stdc
+stddef.h
+stdint.h
+stdio.h
+stdlib.h
+string.h
+strings.h
+stropts.h
+sys/bitypes.h
+sys/cdefs.h
+sys/dir.h
+sys/epoll.h
+sysexits.h
+sys/fcntl.h
+sys/file.h
+sys/fsuid.h
+sys/ioctl.h
+sys/ipc.h
+syslog.h
+sys/mman.h
+sys/mount.h
+sys/mtio.h
+sys/param.h
+sys/poll.h
+sys/prctl.h
+sys/ptrace.h
+sys/queue.h
+sys/reg.h
+sys/resource.h
+sys/select.h
+sys/sem.h
+sys/shm.h
+sys/signal.h
+sys/socket.h
+sys/socketvar.h
+sys/soundcard.h
+sys/statfs.h
+sys/stat.h
+sys/statvfs.h
+sys/stropts.h
+sys/swap.h
+sys/sysctl.h
+sys/sysinfo.h
+sys/sysmacros.h
+sys/termios.h
+sys/timeb.h
+sys/time.h
+sys/times.h
+sys/timex.h
+sys/types.h
+sys/uio.h
+sys/un.h
+sys/unistd.h
+sys/user.h
+sys/utsname.h
+sys/vfs.h
+sys/wait.h
+termio.h
+termios.h
+time.h
+ttyent.h
+ulimit.h
+unistd.h
+ustat.h
+utime.h
+utmp.h
+utmpx.h
+values.h
+wchar.h
+wctype.h
diff --git a/meta/recipes-core/uclibc/site_config/types b/meta/recipes-core/uclibc/site_config/types
new file mode 100644
index 0000000..178bd85
--- /dev/null
+++ b/meta/recipes-core/uclibc/site_config/types
@@ -0,0 +1,21 @@
+char
+char *
+double
+float
+int
+long
+long double
+long int
+long long
+long long int
+short
+short int
+signed char
+unsigned char
+unsigned int
+unsigned long
+unsigned long int
+unsigned long long int
+unsigned short
+unsigned short int
+void *
diff --git a/meta/recipes-core/uclibc/uclibc-config.inc b/meta/recipes-core/uclibc/uclibc-config.inc
new file mode 100644
index 0000000..8b9e41c
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-config.inc
@@ -0,0 +1,142 @@
+DEPENDS += "kern-tools-native"
+inherit cml1
+#
+# Set the ARCH environment variable for uClibc compilation.
+# Return value must match one of the architectures known to uClibc:
+# libc/sysdeps/*/*
+#
+
+valid_archs = "\
+alpha \
+arm \
+avr32 \
+bfin \
+c6x \
+cris \
+e1 \
+frv \
+h8300 \
+hppa \
+i386 \
+i960 \
+ia64 \
+m68k \
+microblaze \
+mips \
+nios \
+nios2 \
+powerpc \
+sh \
+sh64 \
+sparc \
+v850 \
+vax \
+x86_64 \
+xtensa \
+"
+def map_uclibc_arch(a, d):
+    """Return the uClibc architecture for the given TARGET_ARCH."""
+    import re
+
+    valid_archs = d.getVar('valid_archs', True).split()
+
+    if re.match('^(arm|sa110).*', a):
+        return 'arm'
+    elif re.match('^(i.86|athlon)$', a):
+        return 'i386'
+    elif re.match('^mips.*', a):
+        return 'mips'
+    elif re.match('^parisc.*', a):
+        return 'hppa'
+    elif re.match('^ppc.*', a):
+        return 'powerpc'
+    elif re.match('^s390.*', a):
+        return 's390'
+    elif re.match('^sh.*', a):
+        return 'sh'
+    elif re.match('^(sun|sparc).*', a):
+        return 'sparc'
+    elif re.match('^xtensa.*', a):
+        return 'xtensa'
+    elif a in valid_archs:
+        return a
+    else:
+        bb.error("cannot map '%s' to a uClibc architecture" % a)
+
+export UCLIBC_ARCH = "${@map_uclibc_arch(d.getVar('TARGET_ARCH', True), d)}"
+
+def map_uclibc_abi(o, d):
+    """Return the uClibc ABI for the given TARGET_OS."""
+    import re
+
+    arch = d.getVar('TARGET_ARCH', True)
+    if map_uclibc_arch(d.getVar('TARGET_ARCH', True), d) == "arm":
+        if re.match('.*eabi$', o):
+            return 'ARM_EABI'
+        else:
+            return 'ARM_OABI'
+    # FIXME: This is inaccurate! Handle o32, n32, n64
+    elif re.match('^mips.*64$', arch):
+        return 'MIPS_N64_ABI'
+    elif re.match('^mips.*', arch):
+        return 'MIPS_O32_ABI'
+    return ""
+
+export UCLIBC_ABI = "${@map_uclibc_abi(d.getVar('TARGET_OS', True), d)}"
+
+def map_uclibc_endian(a, d):
+    """Return the uClibc endianess for the given TARGET_ARCH."""
+    import re
+
+    # Always BE
+    if re.match('^(avr32|e1|frv|(parisc|hppa)|m68k|microblaze|powerpc.*|(sparc|sun).*)$', a):
+        return 'BIG'
+    # Possibly BE
+    elif re.match('^(((arm|sa110).*eb)|h8300.*eb|(parisc|hppa).*eb|mips|mips64|sh.*eb|xtensa.*eb)$', a):
+        return 'BIG'
+    return 'LITTLE'
+
+export UCLIBC_ENDIAN = "${@map_uclibc_endian(d.getVar('TARGET_ARCH', True), d)}"
+
+# internal helper
+def uclibc_cfg(feature, features, tokens, cnf, rem):
+    if type(tokens) == type(""):
+        tokens = [tokens]
+    rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
+    if type(features) == type([]) and feature in features:
+        cnf.extend([token + '=y' for token in tokens])
+    else:
+        cnf.extend(['# ' + token + ' is not set' for token in tokens])
+
+# Map distro features to config settings
+def features_to_uclibc_settings(d):
+    cnf, rem = ([], [])
+    distro_features = d.getVar('DISTRO_FEATURES', True).split()
+    uclibc_cfg('ipv4',      distro_features, 'UCLIBC_HAS_IPV4', cnf, rem)
+    uclibc_cfg('ipv6',      distro_features, 'UCLIBC_HAS_IPV6', cnf, rem)
+    uclibc_cfg('largefile', distro_features, 'UCLIBC_HAS_LFS', cnf, rem)
+    uclibc_cfg('nls',       distro_features, 'UCLIBC_HAS_LOCALE', cnf, rem)
+    uclibc_cfg('thumb-interwork', distro_features,'USE_BX', cnf, rem)
+    uclibc_cfg('xattr',     distro_features, 'UCLIBC_HAS_XATTR', cnf, rem)
+    uclibc_cfg('ssp',       distro_features, 'UCLIBC_HAS_SSP', cnf, rem)
+    uclibc_cfg('argp',       distro_features, 'UCLIBC_HAS_ARGP', cnf, rem)
+    uclibc_cfg('libc-posix-clang-wchar',  distro_features,'UCLIBC_HAS_WCHAR', cnf, rem)
+    return "\n".join(cnf), "\n".join(rem)
+# X, Y = ${@features_to_uclibc_settings(d)}
+# unfortunately doesn't seem to work with bitbake, workaround:
+def features_to_uclibc_conf(d):
+    cnf, rem = features_to_uclibc_settings(d)
+    return cnf
+def features_to_uclibc_del(d):
+    cnf, rem = features_to_uclibc_settings(d)
+    return rem
+
+# returns all the elements from the src uri that are .cfg files
+def find_cfgs(d):
+    sources=src_patches(d, True)
+    sources_list=[]
+    for s in sources:
+        if s.endswith('.cfg'):
+            sources_list.append(s)
+
+    return sources_list
diff --git a/meta/recipes-core/uclibc/uclibc-git.inc b/meta/recipes-core/uclibc/uclibc-git.inc
new file mode 100644
index 0000000..14a577f
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git.inc
@@ -0,0 +1,20 @@
+SRCREV = "ca1c74d67dd115d059a875150e10b8560a9c35a8"
+
+PV = "0.9.33+git${SRCPV}"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/uclibc-git:"
+
+SRC_URI = "git://uclibc.org/uClibc.git;branch=master \
+        file://uClibc.machine \
+        file://uClibc.distro \
+        file://obstack.cfg \
+        file://locale.cfg \
+        file://0001-Disable-lrount_tes-function.patch \
+        file://0002-Add-implementation-for-copysignl-for-ppc.patch \
+        file://0003-Add-argp-implementation.patch \
+        file://0004-Dont-support-localised-optimizations-this-helps-to-h.patch \
+        file://0005-Always-use-O2-for-compiling-fork.c.patch \
+        file://0006-ldso-limited-support-for-ORIGIN-in-rpath.patch \
+        file://0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch \
+"
+S = "${WORKDIR}/git"
diff --git a/meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch b/meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch
new file mode 100644
index 0000000..506f146
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0001-Disable-lrount_tes-function.patch
@@ -0,0 +1,37 @@
+From 14b865b3438d0df29b4969148678d8fa8943e1ef Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Aug 2015 20:49:33 -0700
+Subject: [PATCH 1/7] Disable lrount_tes() function
+
+Its not used anyway, avoids some strict compiler warnings
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ test/math/libm-test.inc | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/test/math/libm-test.inc b/test/math/libm-test.inc
+index f50b48b..6d70a95 100644
+--- a/test/math/libm-test.inc
++++ b/test/math/libm-test.inc
+@@ -3470,7 +3470,6 @@ logb_test (void)
+ }
+ 
+ 
+-#if 0
+ static void
+ lround_test (void)
+ {
+@@ -3605,7 +3604,6 @@ llround_test (void)
+ 
+   END (llround);
+ }
+-#endif
+ 
+ static void
+ modf_test (void)
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/uclibc/uclibc-git/0002-Add-implementation-for-copysignl-for-ppc.patch b/meta/recipes-core/uclibc/uclibc-git/0002-Add-implementation-for-copysignl-for-ppc.patch
new file mode 100644
index 0000000..d4275c9
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0002-Add-implementation-for-copysignl-for-ppc.patch
@@ -0,0 +1,125 @@
+From 5d362074e5975b150a35bcfa77eab1bfa4e30de7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Aug 2015 20:50:56 -0700
+Subject: [PATCH 2/7] Add implementation for copysignl for ppc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ libc/sysdeps/linux/powerpc/Makefile.arch |  2 +-
+ libc/sysdeps/linux/powerpc/copysignl.c   | 89 ++++++++++++++++++++++++++++++++
+ 2 files changed, 90 insertions(+), 1 deletion(-)
+ create mode 100644 libc/sysdeps/linux/powerpc/copysignl.c
+
+diff --git a/libc/sysdeps/linux/powerpc/Makefile.arch b/libc/sysdeps/linux/powerpc/Makefile.arch
+index 4fbcb11..7c09c87 100644
+--- a/libc/sysdeps/linux/powerpc/Makefile.arch
++++ b/libc/sysdeps/linux/powerpc/Makefile.arch
+@@ -5,7 +5,7 @@
+ # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ #
+ 
+-CSRC-y := __syscall_error.c ioctl.c
++CSRC-y := __syscall_error.c ioctl.c copysignl.c
+ 
+ SSRC-y := \
+ 	__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S brk.S \
+diff --git a/libc/sysdeps/linux/powerpc/copysignl.c b/libc/sysdeps/linux/powerpc/copysignl.c
+new file mode 100644
+index 0000000..000f653
+--- /dev/null
++++ b/libc/sysdeps/linux/powerpc/copysignl.c
+@@ -0,0 +1,89 @@
++/* s_copysignl.c -- long double version of s_copysign.c.
++ * Conversion to long double by Ulrich Drepper,
++ * Cygnus Support, drepper@cygnus.com.
++ */
++
++/*
++ * ====================================================
++ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
++ *
++ * Developed at SunPro, a Sun Microsystems, Inc. business.
++ * Permission to use, copy, modify, and distribute this
++ * software is freely granted, provided that this notice
++ * is preserved.
++ * ====================================================
++ */
++
++/*
++ * copysignl(long double x, long double y)
++ * copysignl(x,y) returns a value with the magnitude of x and
++ * with the sign bit of y.
++ */
++
++#include <endian.h>
++#include <stdint.h>
++
++#if __FLOAT_WORD_ORDER == BIG_ENDIAN
++
++typedef union
++{
++  long double value;
++  struct
++  {
++    int sign_exponent:16;
++    unsigned int empty:16;
++    uint32_t msw;
++    uint32_t lsw;
++  } parts;
++} ieee_long_double_shape_type;
++
++#endif
++
++#if __FLOAT_WORD_ORDER == LITTLE_ENDIAN
++
++typedef union
++{
++  long double value;
++  struct
++  {
++    uint32_t lsw;
++    uint32_t msw;
++    int sign_exponent:16;
++    unsigned int empty:16;
++  } parts;
++} ieee_long_double_shape_type;
++
++#endif
++
++/* Get int from the exponent of a long double.  */
++
++#define GET_LDOUBLE_EXP(exp,d)					\
++do {								\
++  ieee_long_double_shape_type ge_u;				\
++  ge_u.value = (d);						\
++  (exp) = ge_u.parts.sign_exponent;				\
++} while (0)
++
++/* Set exponent of a long double from an int.  */
++
++#define SET_LDOUBLE_EXP(d,exp)					\
++do {								\
++  ieee_long_double_shape_type se_u;				\
++  se_u.value = (d);						\
++  se_u.parts.sign_exponent = (exp);				\
++  (d) = se_u.value;						\
++} while (0)
++
++long double copysignl(long double x, long double y);
++libc_hidden_proto(copysignl);
++
++long double copysignl(long double x, long double y)
++{
++	uint32_t es1,es2;
++	GET_LDOUBLE_EXP(es1,x);
++	GET_LDOUBLE_EXP(es2,y);
++	SET_LDOUBLE_EXP(x,(es1&0x7fff)|(es2&0x8000));
++        return x;
++}
++
++libc_hidden_def(copysignl);
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/uclibc/uclibc-git/0003-Add-argp-implementation.patch b/meta/recipes-core/uclibc/uclibc-git/0003-Add-argp-implementation.patch
new file mode 100644
index 0000000..ee94483
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0003-Add-argp-implementation.patch
@@ -0,0 +1,5811 @@
+From eaae816fb22929469aa4cc3402b91b512fc69549 Mon Sep 17 00:00:00 2001
+From: Salvatore Cro <salvatore.cro@st.com>
+Date: Sun, 16 Aug 2015 20:53:37 -0700
+Subject: [PATCH 3/7] Add argp implementation
+
+Argp is an advanced support for parsing unix-style argument vectors.
+In addition to the common getopt interface, it provides automatic
+response
+to `--help' and `--version' options and use of custom parser in
+conjunction
+with argp native option parser, among others.
+Argp support is required by elfutils package and prelink.
+
+In uClibc argp functionalities has been moved from C library to
+libuargp.so
+Further the libc.so linker script contains an AS_NEEDED entry so that
+it doesn't need to link libuargp.so explicitely.
+
+Signed-off-by: Salvatore Cro <salvatore.cro@st.com>
+Signed-off-by: Filippo Arcidiacono <filippo.arcidiacono@st.com>
+Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ Makefile.in                                 |    9 +
+ Makerules                                   |    7 +-
+ Rules.mak                                   |   13 +
+ extra/Configs/Config.in                     |   17 +
+ include/argp.h                              |  566 ++++++++
+ libc/sysdeps/linux/common/bits/getopt_int.h |  136 ++
+ libc/unistd/getopt.c                        |   19 +-
+ libuargp/Makefile                           |   14 +
+ libuargp/Makefile.in                        |   73 ++
+ libuargp/argp-ba.c                          |   26 +
+ libuargp/argp-eexst.c                       |   32 +
+ libuargp/argp-fmtstream.c                   |  439 +++++++
+ libuargp/argp-fmtstream.h                   |  314 +++++
+ libuargp/argp-fs-xinl.c                     |   44 +
+ libuargp/argp-help.c                        | 1882 +++++++++++++++++++++++++++
+ libuargp/argp-parse.c                       |  949 ++++++++++++++
+ libuargp/argp-pv.c                          |   25 +
+ libuargp/argp-pvh.c                         |   32 +
+ libuargp/argp-xinl.c                        |   35 +
+ test/argp/Makefile                          |    7 +
+ test/argp/Makefile.in                       |   12 +
+ test/argp/argp-ex1.c                        |   15 +
+ test/argp/argp-ex2.c                        |   45 +
+ test/argp/argp-ex3.c                        |  153 +++
+ test/argp/argp-ex4.c                        |  167 +++
+ test/argp/argp-test.c                       |  209 +++
+ test/argp/bug-argp1.c                       |   26 +
+ test/argp/tst-argp1.c                       |  118 ++
+ test/argp/tst-argp2.c                       |  101 ++
+ 29 files changed, 5481 insertions(+), 4 deletions(-)
+ create mode 100644 include/argp.h
+ create mode 100644 libc/sysdeps/linux/common/bits/getopt_int.h
+ create mode 100644 libuargp/Makefile
+ create mode 100644 libuargp/Makefile.in
+ create mode 100644 libuargp/argp-ba.c
+ create mode 100644 libuargp/argp-eexst.c
+ create mode 100644 libuargp/argp-fmtstream.c
+ create mode 100644 libuargp/argp-fmtstream.h
+ create mode 100644 libuargp/argp-fs-xinl.c
+ create mode 100644 libuargp/argp-help.c
+ create mode 100644 libuargp/argp-parse.c
+ create mode 100644 libuargp/argp-pv.c
+ create mode 100644 libuargp/argp-pvh.c
+ create mode 100644 libuargp/argp-xinl.c
+ create mode 100644 test/argp/Makefile
+ create mode 100644 test/argp/Makefile.in
+ create mode 100644 test/argp/argp-ex1.c
+ create mode 100644 test/argp/argp-ex2.c
+ create mode 100644 test/argp/argp-ex3.c
+ create mode 100644 test/argp/argp-ex4.c
+ create mode 100644 test/argp/argp-test.c
+ create mode 100644 test/argp/bug-argp1.c
+ create mode 100644 test/argp/tst-argp1.c
+ create mode 100644 test/argp/tst-argp2.c
+
+diff --git a/Makefile.in b/Makefile.in
+index 04671a4..a450af9 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -39,6 +39,7 @@ include $(top_srcdir)libresolv/Makefile.in
+ include $(top_srcdir)libutil/Makefile.in
+ include $(top_srcdir)libpthread/Makefile.in
+ include $(top_srcdir)librt/Makefile.in
++include $(top_srcdir)libuargp/Makefile.in
+ include $(top_srcdir)libubacktrace/Makefile.in
+ 
+ # last included to catch all the objects added by others (locales/threads)
+@@ -262,6 +263,7 @@ HEADERS_RM- += sgtty.h
+ endif
+ HEADERS_RM-$(HAVE_SHARED)                    += dlfcn.h bits/dlfcn.h
+ HEADERS_RM-$(PTHREADS_DEBUG_SUPPORT)         += thread_db.h
++HEADERS_RM-$(UCLIBC_HAS_ARGP)                += argp.h
+ HEADERS_RM-$(UCLIBC_HAS_BSD_ERR)             += err.h
+ HEADERS_RM-$(UCLIBC_HAS_CRYPT)               += crypt.h
+ HEADERS_RM-$(UCLIBC_HAS_EPOLL)               += sys/epoll.h
+@@ -386,6 +388,13 @@ else
+ 	-$(INSTALL) -m 755 $(top_builddir)lib/libc.so $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/
+ endif
+ 	echo "$(UBACKTRACE_ASNEEDED)" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so
++ifeq ($(UCLIBC_HAS_ARGP),y)
++# Add the AS_NEEDED entry for libuargp.so
++	if [ -f $(top_builddir)lib/libc.so -a -f $(PREFIX)$(RUNTIME_PREFIX)$(MULTILIB_DIR)/$(SHARED_MAJORNAME) ] ; then \
++		echo "GROUP ( $(UARGP_ASNEEDED) )" >> $(PREFIX)$(DEVEL_PREFIX)$(MULTILIB_DIR)/libc.so; \
++	fi
++endif
++
+ ifeq ($(UCLIBC_HAS_THREADS),y)
+ ifneq ($(LINUXTHREADS_OLD),y)
+ ifeq ($(HARDWIRED_ABSPATH),y)
+diff --git a/Makerules b/Makerules
+index d6f7e24..e70050d 100644
+--- a/Makerules
++++ b/Makerules
+@@ -48,6 +48,7 @@ $(eval $(call add_IS_IN_lib,libresolv,$(libresolv-a-y) $(libresolv-so-y)))
+ $(eval $(call add_IS_IN_lib,librt,$(librt-a-y) $(librt-so-y)))
+ $(eval $(call add_IS_IN_lib,libutil,$(libutil-a-y) $(libutil-so-y)))
+ $(eval $(call add_IS_IN_lib,libubacktrace,$(libubacktrace-a-y) $(libubacktrace-so-y)))
++$(eval $(call add_IS_IN_lib,libuargp,$(libuargp-a-y) $(libuargp-so-y)))
+ 
+ shared_objs = $(libc-y:.o=.os) $(libc-shared-y) $(libc-nonshared-y) \
+ 	$(libcrypt-so-y) $(libdl-so-y) \
+@@ -55,12 +56,12 @@ shared_objs = $(libc-y:.o=.os) $(libc-shared-y) $(libc-nonshared-y) \
+ 	$(libpthread-so-y) $(libpthread-nonshared-y) $(libthread_db-so-y) \
+ 	$(libresolv-so-y) $(librt-so-y) \
+ 	$(ldso-y) \
+-	$(libutil-so-y) $(libubacktrace-so-y)
++	$(libutil-so-y) $(libubacktrace-so-y) $(libuargp-so-y)
+ 
+ ar_objs =  $(libc-y) $(libc-static-y) $(libcrypt-a-y) \
+ 	$(libdl-a-y) $(libintl-a-y) $(libm-a-y) $(libnsl-a-y) \
+ 	$(libpthread-a-y) $(libthread_db-a-y) \
+-	$(libresolv-a-y) $(librt-a-y) $(libutil-a-y) $(libubacktrace-a-y)
++	$(libresolv-a-y) $(librt-a-y) $(libutil-a-y) $(libubacktrace-a-y) $(libuargp-a-y)
+ ifeq ($(DOPIC),y)
+ ar_objs := $(ar_objs:.o=.os)
+ endif
+@@ -498,7 +499,7 @@ files.dep := $(libc-a-y) $(libc-so-y) $(libc-nonshared-y) \
+ 	$(librt-a-y) $(librt-so-y)  $(libresolv-a-y) $(libresolv-so-y) \
+ 	$(libcrypt-a-y) $(libcrypt-so-y) $(libutil-a-y) $(libutil-so-y) \
+ 	$(libnsl-a-y) $(libnsl-so-y) $(ldso-y) $(libdl-a-y) $(libdl-so-y) \
+-	$(libubacktrace-a-y) $(libubacktrace-so-y)
++	$(libubacktrace-a-y) $(libubacktrace-so-y) $(libuargp-so-y) $(libuargp-a-y)
+ .depends.dep := \
+ 	$(patsubst %.s,%.s.dep,$(filter %.s,$(files.dep))) \
+ 	$(patsubst %.o,%.o.dep,$(filter %.o,$(files.dep))) \
+diff --git a/Rules.mak b/Rules.mak
+index de9ffb3..a2baf58 100644
+--- a/Rules.mak
++++ b/Rules.mak
+@@ -602,6 +602,19 @@ export UBACKTRACE_ASNEEDED:=$(shell $(CC) -Wl,--help 2>/dev/null | grep -q -- --
+ else
+ export UBACKTRACE_ASNEEDED:=""
+ endif
++ifeq ($(UCLIBC_HAS_ARGP),y)
++ifeq ($(HARDWIRED_ABSPATH),y)
++# Only used in installed libc.so linker script
++UARGP_FULL_NAME := $(subst //,/,$(RUNTIME_PREFIX)$(MULTILIB_DIR)/libuargp.so.$(MAJOR_VERSION))
++else
++UARGP_FULL_NAME := libuargp.so.$(MAJOR_VERSION)
++endif
++export UARGP_ASNEEDED:=$(shell $(CC) -Wl,--help 2>/dev/null | grep -q -- --as-needed && \
++	echo "GROUP ( AS_NEEDED ( $(UARGP_FULL_NAME) ) )" || \
++	echo "GROUP ( $(UARGP_FULL_NAME) )")
++else
++export UARGP_ASNEEDED:=""
++endif
+ endif
+ 
+ # Add a bunch of extra pedantic annoyingly strict checks
+diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
+index 242e45a..b36d4c9 100644
+--- a/extra/Configs/Config.in
++++ b/extra/Configs/Config.in
+@@ -1943,6 +1943,23 @@ config UCLIBC_HAS_GNU_GETSUBOPT
+ 	  Answer Y if you want to include getsubopt().
+ 
+ 	  Most people will answer Y.
++
++config UCLIBC_HAS_ARGP
++       bool "Support argp (as standalone shared object)"
++       default n
++       help
++         Argp is an interface for parsing unix-style argument vectors. Unlike
++         the common getopt interface, it provides many advanced features in
++         addition to parsing options, such as automatic output in response to
++         `--help' and `--version' options.
++         A library can export an argp option parser, which programs can easily
++         use in conjunction with their own option parser.
++         A new shared object "libuargp" is created. The "libc.so" linker script
++         contains the AS_NEEDED entry for getting the libuargp linked automatically.
++         Argp support is needed by elfutils libdw.
++
++         Most people can safely answer N.
++
+ endmenu
+ 
+ 
+diff --git a/include/argp.h b/include/argp.h
+new file mode 100644
+index 0000000..9d53728
+--- /dev/null
++++ b/include/argp.h
+@@ -0,0 +1,566 @@
++/* Hierarchial argument parsing, layered over getopt.
++   Copyright (C) 1995-1999, 2003, 2004, 2005, 2006, 2007, 2009
++   Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.
++
++   Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
++*/
++
++#ifndef _ARGP_H
++#define _ARGP_H
++
++#include <stdio.h>
++#include <ctype.h>
++#include <limits.h>
++
++#define __need_error_t
++#include <errno.h>
++
++#ifndef __const
++# define __const const
++#endif
++
++#ifndef __THROW
++# define __THROW
++#endif
++#ifndef __NTH
++# define __NTH(fct) fct __THROW
++#endif
++
++#ifndef __attribute__
++/* This feature is available in gcc versions 2.5 and later.  */
++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__)
++#  define __attribute__(Spec) /* empty */
++# endif
++/* The __-protected variants of `format' and `printf' attributes
++   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__)
++#  define __format__ format
++#  define __printf__ printf
++# endif
++#endif
++
++/* GCC 2.95 and later have "__restrict"; C99 compilers have
++   "restrict", and "configure" may have defined "restrict".  */
++#ifndef __restrict
++# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__))
++#  if defined restrict || 199901L <= __STDC_VERSION__
++#   define __restrict restrict
++#  else
++#   define __restrict
++#  endif
++# endif
++#endif
++
++#ifndef __error_t_defined
++typedef int error_t;
++# define __error_t_defined
++#endif
++
++#ifdef  __cplusplus
++extern "C" {
++#endif
++
++/* A description of a particular option.  A pointer to an array of
++   these is passed in the OPTIONS field of an argp structure.  Each option
++   entry can correspond to one long option and/or one short option; more
++   names for the same option can be added by following an entry in an option
++   array with options having the OPTION_ALIAS flag set.  */
++struct argp_option
++{
++  /* The long option name.  For more than one name for the same option, you
++     can use following options with the OPTION_ALIAS flag set.  */
++  __const char *name;
++
++  /* What key is returned for this option.  If > 0 and printable, then it's
++     also accepted as a short option.  */
++  int key;
++
++  /* If non-NULL, this is the name of the argument associated with this
++     option, which is required unless the OPTION_ARG_OPTIONAL flag is set. */
++  __const char *arg;
++
++  /* OPTION_ flags.  */
++  int flags;
++
++  /* The doc string for this option.  If both NAME and KEY are 0, This string
++     will be printed outdented from the normal option column, making it
++     useful as a group header (it will be the first thing printed in its
++     group); in this usage, it's conventional to end the string with a `:'.  */
++  __const char *doc;
++
++  /* The group this option is in.  In a long help message, options are sorted
++     alphabetically within each group, and the groups presented in the order
++     0, 1, 2, ..., n, -m, ..., -2, -1.  Every entry in an options array with
++     if this field 0 will inherit the group number of the previous entry, or
++     zero if it's the first one, unless its a group header (NAME and KEY both
++     0), in which case, the previous entry + 1 is the default.  Automagic
++     options such as --help are put into group -1.  */
++  int group;
++};
++
++/* The argument associated with this option is optional.  */
++#define OPTION_ARG_OPTIONAL	0x1
++
++/* This option isn't displayed in any help messages.  */
++#define OPTION_HIDDEN	       	0x2
++
++/* This option is an alias for the closest previous non-alias option.  This
++   means that it will be displayed in the same help entry, and will inherit
++   fields other than NAME and KEY from the aliased option.  */
++#define OPTION_ALIAS		0x4
++
++/* This option isn't actually an option (and so should be ignored by the
++   actual option parser), but rather an arbitrary piece of documentation that
++   should be displayed in much the same manner as the options.  If this flag
++   is set, then the option NAME field is displayed unmodified (e.g., no `--'
++   prefix is added) at the left-margin (where a *short* option would normally
++   be displayed), and the documentation string in the normal place.  For
++   purposes of sorting, any leading whitespace and punctuation is ignored,
++   except that if the first non-whitespace character is not `-', this entry
++   is displayed after all options (and OPTION_DOC entries with a leading `-')
++   in the same group.  */
++#define OPTION_DOC		0x8
++
++/* This option shouldn't be included in `long' usage messages (but is still
++   included in help messages).  This is mainly intended for options that are
++   completely documented in an argp's ARGS_DOC field, in which case including
++   the option in the generic usage list would be redundant.  For instance,
++   if ARGS_DOC is "FOO BAR\n-x BLAH", and the `-x' option's purpose is to
++   distinguish these two cases, -x should probably be marked
++   OPTION_NO_USAGE.  */
++#define OPTION_NO_USAGE		0x10
++
++struct argp;			/* fwd declare this type */
++struct argp_state;		/* " */
++struct argp_child;		/* " */
++
++/* The type of a pointer to an argp parsing function.  */
++typedef error_t (*argp_parser_t) (int __key, char *__arg,
++				  struct argp_state *__state);
++
++/* What to return for unrecognized keys.  For special ARGP_KEY_ keys, such
++   returns will simply be ignored.  For user keys, this error will be turned
++   into EINVAL (if the call to argp_parse is such that errors are propagated
++   back to the user instead of exiting); returning EINVAL itself would result
++   in an immediate stop to parsing in *all* cases.  */
++#define ARGP_ERR_UNKNOWN	E2BIG /* Hurd should never need E2BIG.  XXX */
++
++/* Special values for the KEY argument to an argument parsing function.
++   ARGP_ERR_UNKNOWN should be returned if they aren't understood.
++
++   The sequence of keys to a parsing function is either (where each
++   uppercased word should be prefixed by `ARGP_KEY_' and opt is a user key):
++
++       INIT opt... NO_ARGS END SUCCESS  -- No non-option arguments at all
++   or  INIT (opt | ARG)... END SUCCESS  -- All non-option args parsed
++   or  INIT (opt | ARG)... SUCCESS      -- Some non-option arg unrecognized
++
++   The third case is where every parser returned ARGP_KEY_UNKNOWN for an
++   argument, in which case parsing stops at that argument (returning the
++   unparsed arguments to the caller of argp_parse if requested, or stopping
++   with an error message if not).
++
++   If an error occurs (either detected by argp, or because the parsing
++   function returned an error value), then the parser is called with
++   ARGP_KEY_ERROR, and no further calls are made.  */
++
++/* This is not an option at all, but rather a command line argument.  If a
++   parser receiving this key returns success, the fact is recorded, and the
++   ARGP_KEY_NO_ARGS case won't be used.  HOWEVER, if while processing the
++   argument, a parser function decrements the NEXT field of the state it's
++   passed, the option won't be considered processed; this is to allow you to
++   actually modify the argument (perhaps into an option), and have it
++   processed again.  */
++#define ARGP_KEY_ARG		0
++/* There are remaining arguments not parsed by any parser, which may be found
++   starting at (STATE->argv + STATE->next).  If success is returned, but
++   STATE->next left untouched, it's assumed that all arguments were consume,
++   otherwise, the parser should adjust STATE->next to reflect any arguments
++   consumed.  */
++#define ARGP_KEY_ARGS		0x1000006
++/* There are no more command line arguments at all.  */
++#define ARGP_KEY_END		0x1000001
++/* Because it's common to want to do some special processing if there aren't
++   any non-option args, user parsers are called with this key if they didn't
++   successfully process any non-option arguments.  Called just before
++   ARGP_KEY_END (where more general validity checks on previously parsed
++   arguments can take place).  */
++#define ARGP_KEY_NO_ARGS	0x1000002
++/* Passed in before any parsing is done.  Afterwards, the values of each
++   element of the CHILD_INPUT field, if any, in the state structure is
++   copied to each child's state to be the initial value of the INPUT field.  */
++#define ARGP_KEY_INIT		0x1000003
++/* Use after all other keys, including SUCCESS & END.  */
++#define ARGP_KEY_FINI		0x1000007
++/* Passed in when parsing has successfully been completed (even if there are
++   still arguments remaining).  */
++#define ARGP_KEY_SUCCESS	0x1000004
++/* Passed in if an error occurs.  */
++#define ARGP_KEY_ERROR		0x1000005
++
++/* An argp structure contains a set of options declarations, a function to
++   deal with parsing one, documentation string, a possible vector of child
++   argp's, and perhaps a function to filter help output.  When actually
++   parsing options, getopt is called with the union of all the argp
++   structures chained together through their CHILD pointers, with conflicts
++   being resolved in favor of the first occurrence in the chain.  */
++struct argp
++{
++  /* An array of argp_option structures, terminated by an entry with both
++     NAME and KEY having a value of 0.  */
++  __const struct argp_option *options;
++
++  /* What to do with an option from this structure.  KEY is the key
++     associated with the option, and ARG is any associated argument (NULL if
++     none was supplied).  If KEY isn't understood, ARGP_ERR_UNKNOWN should be
++     returned.  If a non-zero, non-ARGP_ERR_UNKNOWN value is returned, then
++     parsing is stopped immediately, and that value is returned from
++     argp_parse().  For special (non-user-supplied) values of KEY, see the
++     ARGP_KEY_ definitions below.  */
++  argp_parser_t parser;
++
++  /* A string describing what other arguments are wanted by this program.  It
++     is only used by argp_usage to print the `Usage:' message.  If it
++     contains newlines, the strings separated by them are considered
++     alternative usage patterns, and printed on separate lines (lines after
++     the first are prefix by `  or: ' instead of `Usage:').  */
++  __const char *args_doc;
++
++  /* If non-NULL, a string containing extra text to be printed before and
++     after the options in a long help message (separated by a vertical tab
++     `\v' character).  */
++  __const char *doc;
++
++  /* A vector of argp_children structures, terminated by a member with a 0
++     argp field, pointing to child argps should be parsed with this one.  Any
++     conflicts are resolved in favor of this argp, or early argps in the
++     CHILDREN list.  This field is useful if you use libraries that supply
++     their own argp structure, which you want to use in conjunction with your
++     own.  */
++  __const struct argp_child *children;
++
++  /* If non-zero, this should be a function to filter the output of help
++     messages.  KEY is either a key from an option, in which case TEXT is
++     that option's help text, or a special key from the ARGP_KEY_HELP_
++     defines, below, describing which other help text TEXT is.  The function
++     should return either TEXT, if it should be used as-is, a replacement
++     string, which should be malloced, and will be freed by argp, or NULL,
++     meaning `print nothing'.  The value for TEXT is *after* any translation
++     has been done, so if any of the replacement text also needs translation,
++     that should be done by the filter function.  INPUT is either the input
++     supplied to argp_parse, or NULL, if argp_help was called directly.  */
++  char *(*help_filter) (int __key, __const char *__text, void *__input);
++
++  /* If non-zero the strings used in the argp library are translated using
++     the domain described by this string.  Otherwise the currently installed
++     default domain is used.  */
++  const char *argp_domain;
++};
++
++/* Possible KEY arguments to a help filter function.  */
++#define ARGP_KEY_HELP_PRE_DOC	0x2000001 /* Help text preceeding options. */
++#define ARGP_KEY_HELP_POST_DOC	0x2000002 /* Help text following options. */
++#define ARGP_KEY_HELP_HEADER	0x2000003 /* Option header string. */
++#define ARGP_KEY_HELP_EXTRA	0x2000004 /* After all other documentation;
++					     TEXT is NULL for this key.  */
++/* Explanatory note emitted when duplicate option arguments have been
++   suppressed.  */
++#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
++#define ARGP_KEY_HELP_ARGS_DOC	0x2000006 /* Argument doc string.  */
++
++/* When an argp has a non-zero CHILDREN field, it should point to a vector of
++   argp_child structures, each of which describes a subsidiary argp.  */
++struct argp_child
++{
++  /* The child parser.  */
++  __const struct argp *argp;
++
++  /* Flags for this child.  */
++  int flags;
++
++  /* If non-zero, an optional header to be printed in help output before the
++     child options.  As a side-effect, a non-zero value forces the child
++     options to be grouped together; to achieve this effect without actually
++     printing a header string, use a value of "".  */
++  __const char *header;
++
++  /* Where to group the child options relative to the other (`consolidated')
++     options in the parent argp; the values are the same as the GROUP field
++     in argp_option structs, but all child-groupings follow parent options at
++     a particular group level.  If both this field and HEADER are zero, then
++     they aren't grouped at all, but rather merged with the parent options
++     (merging the child's grouping levels with the parents).  */
++  int group;
++};
++
++/* Parsing state.  This is provided to parsing functions called by argp,
++   which may examine and, as noted, modify fields.  */
++struct argp_state
++{
++  /* The top level ARGP being parsed.  */
++  __const struct argp *root_argp;
++
++  /* The argument vector being parsed.  May be modified.  */
++  int argc;
++  char **argv;
++
++  /* The index in ARGV of the next arg that to be parsed.  May be modified. */
++  int next;
++
++  /* The flags supplied to argp_parse.  May be modified.  */
++  unsigned flags;
++
++  /* While calling a parsing function with a key of ARGP_KEY_ARG, this is the
++     number of the current arg, starting at zero, and incremented after each
++     such call returns.  At all other times, this is the number of such
++     arguments that have been processed.  */
++  unsigned arg_num;
++
++  /* If non-zero, the index in ARGV of the first argument following a special
++     `--' argument (which prevents anything following being interpreted as an
++     option).  Only set once argument parsing has proceeded past this point. */
++  int quoted;
++
++  /* An arbitrary pointer passed in from the user.  */
++  void *input;
++  /* Values to pass to child parsers.  This vector will be the same length as
++     the number of children for the current parser.  */
++  void **child_inputs;
++
++  /* For the parser's use.  Initialized to 0.  */
++  void *hook;
++
++  /* The name used when printing messages.  This is initialized to ARGV[0],
++     or PROGRAM_INVOCATION_NAME if that is unavailable.  */
++  char *name;
++
++  /* Streams used when argp prints something.  */
++  FILE *err_stream;		/* For errors; initialized to stderr. */
++  FILE *out_stream;		/* For information; initialized to stdout. */
++
++  void *pstate;			/* Private, for use by argp.  */
++};
++
++/* Flags for argp_parse (note that the defaults are those that are
++   convenient for program command line parsing): */
++
++/* Don't ignore the first element of ARGV.  Normally (and always unless
++   ARGP_NO_ERRS is set) the first element of the argument vector is
++   skipped for option parsing purposes, as it corresponds to the program name
++   in a command line.  */
++#define ARGP_PARSE_ARGV0  0x01
++
++/* Don't print error messages for unknown options to stderr; unless this flag
++   is set, ARGP_PARSE_ARGV0 is ignored, as ARGV[0] is used as the program
++   name in the error messages.  This flag implies ARGP_NO_EXIT (on the
++   assumption that silent exiting upon errors is bad behaviour).  */
++#define ARGP_NO_ERRS	0x02
++
++/* Don't parse any non-option args.  Normally non-option args are parsed by
++   calling the parse functions with a key of ARGP_KEY_ARG, and the actual arg
++   as the value.  Since it's impossible to know which parse function wants to
++   handle it, each one is called in turn, until one returns 0 or an error
++   other than ARGP_ERR_UNKNOWN; if an argument is handled by no one, the
++   argp_parse returns prematurely (but with a return value of 0).  If all
++   args have been parsed without error, all parsing functions are called one
++   last time with a key of ARGP_KEY_END.  This flag needn't normally be set,
++   as the normal behavior is to stop parsing as soon as some argument can't
++   be handled.  */
++#define ARGP_NO_ARGS	0x04
++
++/* Parse options and arguments in the same order they occur on the command
++   line -- normally they're rearranged so that all options come first. */
++#define ARGP_IN_ORDER	0x08
++
++/* Don't provide the standard long option --help, which causes usage and
++      option help information to be output to stdout, and exit (0) called. */
++#define ARGP_NO_HELP	0x10
++
++/* Don't exit on errors (they may still result in error messages).  */
++#define ARGP_NO_EXIT	0x20
++
++/* Use the gnu getopt `long-only' rules for parsing arguments.  */
++#define ARGP_LONG_ONLY	0x40
++
++/* Turns off any message-printing/exiting options.  */
++#define ARGP_SILENT    (ARGP_NO_EXIT | ARGP_NO_ERRS | ARGP_NO_HELP)
++
++/* Parse the options strings in ARGC & ARGV according to the options in ARGP.
++   FLAGS is one of the ARGP_ flags above.  If ARG_INDEX is non-NULL, the
++   index in ARGV of the first unparsed option is returned in it.  If an
++   unknown option is present, ARGP_ERR_UNKNOWN is returned; if some parser
++   routine returned a non-zero value, it is returned; otherwise 0 is
++   returned.  This function may also call exit unless the ARGP_NO_HELP flag
++   is set.  INPUT is a pointer to a value to be passed in to the parser.  */
++extern error_t argp_parse (__const struct argp *__restrict __argp,
++			   int __argc, char **__restrict __argv,
++			   unsigned __flags, int *__restrict __arg_index,
++			   void *__restrict __input);
++
++/* Global variables.  */
++
++/* If defined or set by the user program to a non-zero value, then a default
++   option --version is added (unless the ARGP_NO_HELP flag is used), which
++   will print this string followed by a newline and exit (unless the
++   ARGP_NO_EXIT flag is used).  Overridden by ARGP_PROGRAM_VERSION_HOOK.  */
++extern __const char *argp_program_version;
++
++/* If defined or set by the user program to a non-zero value, then a default
++   option --version is added (unless the ARGP_NO_HELP flag is used), which
++   calls this function with a stream to print the version to and a pointer to
++   the current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
++   used).  This variable takes precedent over ARGP_PROGRAM_VERSION.  */
++extern void (*argp_program_version_hook) (FILE *__restrict __stream,
++					  struct argp_state *__restrict
++					  __state);
++
++/* If defined or set by the user program, it should point to string that is
++   the bug-reporting address for the program.  It will be printed by
++   argp_help if the ARGP_HELP_BUG_ADDR flag is set (as it is by various
++   standard help messages), embedded in a sentence that says something like
++   `Report bugs to ADDR.'.  */
++extern __const char *argp_program_bug_address;
++
++/* The exit status that argp will use when exiting due to a parsing error.
++   If not defined or set by the user program, this defaults to EX_USAGE from
++   <sysexits.h>.  */
++extern error_t argp_err_exit_status;
++
++/* Flags for argp_help.  */
++#define ARGP_HELP_USAGE		0x01 /* a Usage: message. */
++#define ARGP_HELP_SHORT_USAGE	0x02 /*  " but don't actually print options. */
++#define ARGP_HELP_SEE		0x04 /* a `Try ... for more help' message. */
++#define ARGP_HELP_LONG		0x08 /* a long help message. */
++#define ARGP_HELP_PRE_DOC	0x10 /* doc string preceding long help.  */
++#define ARGP_HELP_POST_DOC	0x20 /* doc string following long help.  */
++#define ARGP_HELP_DOC		(ARGP_HELP_PRE_DOC | ARGP_HELP_POST_DOC)
++#define ARGP_HELP_BUG_ADDR	0x40 /* bug report address */
++#define ARGP_HELP_LONG_ONLY	0x80 /* modify output appropriately to
++					reflect ARGP_LONG_ONLY mode.  */
++
++/* These ARGP_HELP flags are only understood by argp_state_help.  */
++#define ARGP_HELP_EXIT_ERR	0x100 /* Call exit(1) instead of returning.  */
++#define ARGP_HELP_EXIT_OK	0x200 /* Call exit(0) instead of returning.  */
++
++/* The standard thing to do after a program command line parsing error, if an
++   error message has already been printed.  */
++#define ARGP_HELP_STD_ERR \
++  (ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
++/* The standard thing to do after a program command line parsing error, if no
++   more specific error message has been printed.  */
++#define ARGP_HELP_STD_USAGE \
++  (ARGP_HELP_SHORT_USAGE | ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR)
++/* The standard thing to do in response to a --help option.  */
++#define ARGP_HELP_STD_HELP \
++  (ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG | ARGP_HELP_EXIT_OK \
++   | ARGP_HELP_DOC | ARGP_HELP_BUG_ADDR)
++
++/* Output a usage message for ARGP to STREAM.  FLAGS are from the set
++   ARGP_HELP_*.  */
++extern void argp_help (__const struct argp *__restrict __argp,
++		       FILE *__restrict __stream,
++		       unsigned __flags, char *__restrict __name);
++
++/* The following routines are intended to be called from within an argp
++   parsing routine (thus taking an argp_state structure as the first
++   argument).  They may or may not print an error message and exit, depending
++   on the flags in STATE -- in any case, the caller should be prepared for
++   them *not* to exit, and should return an appropiate error after calling
++   them.  [argp_usage & argp_error should probably be called argp_state_...,
++   but they're used often enough that they should be short]  */
++
++/* Output, if appropriate, a usage message for STATE to STREAM.  FLAGS are
++   from the set ARGP_HELP_*.  */
++extern void argp_state_help (__const struct argp_state *__restrict __state,
++			     FILE *__restrict __stream,
++			     unsigned int __flags);
++/* Possibly output the standard usage message for ARGP to stderr and exit.  */
++extern void argp_usage (__const struct argp_state *__state);
++
++/* If appropriate, print the printf string FMT and following args, preceded
++   by the program name and `:', to stderr, and followed by a `Try ... --help'
++   message, then exit (1).  */
++extern void argp_error (__const struct argp_state *__restrict __state,
++			__const char *__restrict __fmt, ...)
++     __attribute__ ((__format__ (__printf__, 2, 3)));
++/* Similar to the standard gnu error-reporting function error(), but will
++   respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
++   to STATE->err_stream.  This is useful for argument parsing code that is
++   shared between program startup (when exiting is desired) and runtime
++   option parsing (when typically an error code is returned instead).  The
++   difference between this function and argp_error is that the latter is for
++   *parsing errors*, and the former is for other problems that occur during
++   parsing but don't reflect a (syntactic) problem with the input.  */
++extern void argp_failure (__const struct argp_state *__restrict __state,
++			  int __status, int __errnum,
++			  __const char *__restrict __fmt, ...)
++     __attribute__ ((__format__ (__printf__, 4, 5)));
++/* Returns true if the option OPT is a valid short option.  */
++extern int _option_is_short (__const struct argp_option *__opt) __THROW;
++extern int __option_is_short (__const struct argp_option *__opt) __THROW;
++
++/* Returns true if the option OPT is in fact the last (unused) entry in an
++   options array.  */
++extern int _option_is_end (__const struct argp_option *__opt) __THROW;
++extern int __option_is_end (__const struct argp_option *__opt) __THROW;
++
++/* Return the input field for ARGP in the parser corresponding to STATE; used
++   by the help routines.  */
++/* We think this should not be exported */
++extern void *__argp_input (__const struct argp *__restrict __argp,
++			   __const struct argp_state *__restrict __state)
++     __THROW;
++
++#ifdef __USE_EXTERN_INLINES
++
++# ifndef ARGP_EI
++#  define ARGP_EI __extern_inline
++# endif
++
++ARGP_EI void
++argp_usage (__const struct argp_state *__state)
++{
++  argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
++}
++
++ARGP_EI int
++__NTH (__option_is_short (__const struct argp_option *__opt))
++{
++  if (__opt->flags & OPTION_DOC)
++    return 0;
++  else
++    {
++      int __key = __opt->key;
++      return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
++    }
++}
++
++ARGP_EI int
++__NTH (__option_is_end (__const struct argp_option *__opt))
++{
++  return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
++}
++#endif /* Use extern inlines.  */
++
++#ifdef  __cplusplus
++}
++#endif
++
++#endif /* argp.h */
+diff --git a/libc/sysdeps/linux/common/bits/getopt_int.h b/libc/sysdeps/linux/common/bits/getopt_int.h
+new file mode 100644
+index 0000000..291edfe
+--- /dev/null
++++ b/libc/sysdeps/linux/common/bits/getopt_int.h
+@@ -0,0 +1,136 @@
++/* Internal declarations for getopt.
++   Copyright (C) 1989-1994,1996-1999,2001,2003,2004
++   Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifndef _GETOPT_INT_H
++#define _GETOPT_INT_H  1
++
++extern int _getopt_internal (int ___argc, char *const *___argv,
++                            const char *__shortopts,
++                            const struct option *__longopts, int *__longind,
++                            int __long_only) attribute_hidden;
++
++
++/* Reentrant versions which can handle parsing multiple argument
++   vectors at the same time.  */
++
++/* For __ordering member */
++enum {
++       REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
++};
++
++/* Data type for reentrant functions.  */
++
++struct _getopt_data
++{
++  /* These have exactly the same meaning as the corresponding global
++     variables, except that they are used for the reentrant
++     versions of getopt.  */
++  int optind;
++  int opterr;
++  char *optarg;
++  smalluint optopt; /* we store characters here, a byte is enough */
++
++  /* Internal members.  */
++
++  /* True if the internal members have been initialized.  */
++  smallint __initialized;
++
++  /* Describe how to deal with options that follow non-option ARGV-elements.
++
++     If the caller did not specify anything,
++     the default is REQUIRE_ORDER if the environment variable
++     POSIXLY_CORRECT is defined, PERMUTE otherwise.
++
++     REQUIRE_ORDER means don't recognize them as options;
++     stop option processing when the first non-option is seen.
++     This is what Unix does.
++     This mode of operation is selected by either setting the environment
++     variable POSIXLY_CORRECT, or using `+' as the first character
++     of the list of option characters.
++
++     PERMUTE is the default.  We permute the contents of ARGV as we
++     scan, so that eventually all the non-options are at the end.
++     This allows options to be given in any order, even with programs
++     that were not written to expect this.
++
++     RETURN_IN_ORDER is an option available to programs that were
++     written to expect options and other ARGV-elements in any order
++     and that care about the ordering of the two.  We describe each
++     non-option ARGV-element as if it were the argument of an option
++     with character code 1.  Using `-' as the first character of the
++     list of option characters selects this mode of operation.
++
++     The special argument `--' forces an end of option-scanning regardless
++     of the value of `ordering'.  In the case of RETURN_IN_ORDER, only
++     `--' can cause `getopt' to return -1 with `optind' != ARGC.  */
++  smallint __ordering;
++
++  /* If the POSIXLY_CORRECT environment variable is set.  */
++  smallint __posixly_correct;
++
++  /* The next char to be scanned in the option-element
++     in which the last option character we returned was found.
++     This allows us to pick up the scan where we left off.
++
++     If this is zero, or a null string, it means resume the scan
++     by advancing to the next ARGV-element.  */
++  char *__nextchar;
++
++
++  /* Handle permutation of arguments.  */
++
++  /* Describe the part of ARGV that contains non-options that have
++     been skipped.  `first_nonopt' is the index in ARGV of the first
++     of them; `last_nonopt' is the index after the last of them.  */
++
++  int __first_nonopt;
++  int __last_nonopt;
++
++#if defined _LIBC && defined USE_NONOPTION_FLAGS
++  int __nonoption_flags_max_len;
++  int __nonoption_flags_len;
++# endif
++};
++
++/* The initializer is necessary to set OPTIND and OPTERR to their
++   default values and to clear the initialization flag.  */
++#define _GETOPT_DATA_INITIALIZER       { 1, 1 }
++
++#if 0 /* first is static on uClibc, the others not used */
++extern int _getopt_internal_r (int ___argc, char *const *___argv,
++                              const char *__shortopts,
++                              const struct option *__longopts, int *__longind,
++                              int __long_only, struct _getopt_data *__data);
++#endif
++#if defined __UCLIBC_HAS_GNU_GETOPT__ || defined __UCLIBC_HAS_GETOPT_LONG__
++#ifndef __need_getopt
++extern int _getopt_long_r (int ___argc, char *const *___argv,
++                          const char *__shortopts,
++                          const struct option *__longopts, int *__longind,
++                          struct _getopt_data *__data);
++
++extern int _getopt_long_only_r (int ___argc, char *const *___argv,
++                               const char *__shortopts,
++                               const struct option *__longopts,
++                               int *__longind,
++                               struct _getopt_data *__data);
++#endif
++#endif
++#endif /* getopt_int.h */
+diff --git a/libc/unistd/getopt.c b/libc/unistd/getopt.c
+index f63482b..db5e12c 100644
+--- a/libc/unistd/getopt.c
++++ b/libc/unistd/getopt.c
+@@ -105,7 +105,7 @@
+    they can distinguish the relative order of options and other arguments.  */
+ 
+ #include <getopt.h>
+-#include "getopt_int.h"
++#include <bits/getopt_int.h>
+ 
+ 
+ /* For communication from `getopt' to the caller.
+@@ -1170,6 +1170,15 @@ getopt_long (int argc, char *const *argv, const char *options,
+   return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+ }
+ 
++int
++_getopt_long_r (int argc, char *const *argv, const char *options,
++               const struct option *long_options, int *opt_index,
++               struct _getopt_data *d)
++{
++  return _getopt_internal_r (argc, argv, options, long_options, opt_index,
++                            0, d);
++}
++
+ /* Like getopt_long, but '-' as well as '--' can indicate a long option.
+    If an option that starts with '-' (not '--') doesn't match a long option,
+    but does match a short option, it is parsed as a short option
+@@ -1183,4 +1192,12 @@ getopt_long_only (int argc, char *const *argv, const char *options,
+ }
+ #endif /* __UCLIBC_HAS_GETOPT_LONG__ */
+ 
++int
++_getopt_long_only_r (int argc, char *const *argv, const char *options,
++                    const struct option *long_options, int *opt_index,
++                    struct _getopt_data *d)
++{
++  return _getopt_internal_r (argc, argv, options, long_options, opt_index, 1, d);
++}
++
+ #endif	/* Not ELIDE_CODE.  */
+diff --git a/libuargp/Makefile b/libuargp/Makefile
+new file mode 100644
+index 0000000..45acdd9
+--- /dev/null
++++ b/libuargp/Makefile
+@@ -0,0 +1,14 @@
++# Makefile for uClibc (libuargp)
++#
++# Copyright (C) 2010 STMicroelectronics Ltd
++# Author(s): Filippo Arcidiacono <filippo.arcidiacono at st.com>
++#
++# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
++#
++
++top_srcdir=../
++top_builddir=../
++include $(top_builddir)Rules.mak
++all: libs
++include Makefile.in
++include $(top_srcdir)Makerules
+diff --git a/libuargp/Makefile.in b/libuargp/Makefile.in
+new file mode 100644
+index 0000000..1498abb
+--- /dev/null
++++ b/libuargp/Makefile.in
+@@ -0,0 +1,73 @@
++# Makefile for uClibc (libuargp)
++#
++# Copyright (C) 2009, 2010  STMicroelectronics Ltd.
++# Author(s): Salvatore Cro <salvatore.cro at st.com>
++#            - First implementation, embedded into libc
++#            Filippo Arcidiacono <filippo.arcidiacono at st.com>
++#            - Reworked for stand-alone libuargp implementation
++
++# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
++#
++
++CFLAGS-libuargp := -DNOT_IN_libc -DIS_IN_libuargp $(SSP_ALL_CFLAGS)
++
++LDFLAGS-libuargp.so := $(LDFLAGS)
++
++LIBS-libuargp.so := $(LIBS)
++
++libuargp_FULL_NAME := libuargp-$(VERSION).so
++
++libuargp_DIR := $(top_srcdir)libuargp
++libuargp_OUT := $(top_builddir)libuargp
++
++libuargp_SRC-y :=
++libuargp_SRC-$(UCLIBC_HAS_ARGP) := $(addsuffix .c,$(addprefix argp-, ba \
++			eexst fmtstream fs-xinl help parse pv pvh xinl))
++
++CFLAGS-argp-xinl.c = -fgnu89-inline
++
++libuargp_SRC := $(addprefix $(libuargp_DIR)/,$(libuargp_SRC-y))
++libuargp_OBJ := $(patsubst $(libuargp_DIR)/%.c,$(libuargp_OUT)/%.o,$(libuargp_SRC))
++
++libuargp_SRCS := $(libuargp_SRC)
++libuargp_OBJS := $(libuargp_OBJ)
++
++ifeq ($(DOPIC),y)
++libuargp-a-y := $(libuargp_OBJS:.o=.os)
++else
++libuargp-a-y := $(libuargp_OBJS)
++endif
++libuargp-so-y := $(libuargp_OBJS:.o=.os)
++
++lib-a-$(UCLIBC_HAS_ARGP) += $(top_builddir)lib/libuargp.a
++lib-so-$(UCLIBC_HAS_ARGP) += $(top_builddir)lib/libuargp.so
++
++objclean-y += CLEAN_libuargp
++
++ifeq ($(DOMULTI),n)
++ifeq ($(DOPIC),y)
++$(top_builddir)lib/libuargp.so: $(top_builddir)lib/libuargp.a $(libc.depend)
++else
++$(top_builddir)lib/libuargp.so: $(libuargp_OUT)/libuargp_so.a $(libc.depend)
++endif
++	$(call link.so,$(libuargp_FULL_NAME),$(MAJOR_VERSION))
++else
++$(top_builddir)lib/libuargp.so: $(libuargp_OUT)/libuargp.oS $(libc.depend)
++	$(call linkm.so,$(libuargp_FULL_NAME),$(MAJOR_VERSION))
++endif
++
++$(libuargp_OUT)/libuargp_so.a: $(libuargp-so-y)
++	$(Q)$(RM) $@
++	$(do_ar)
++
++$(libuargp_OUT)/libuargp.oS: $(libuargp_SRCS)
++	$(Q)$(RM) $@
++	$(compile-m)
++
++$(top_builddir)lib/libuargp.a: $(libuargp-a-y)
++	$(Q)$(INSTALL) -d $(dir $@)
++	$(Q)$(RM) $@
++	$(do_ar)
++
++CLEAN_libuargp:
++	$(do_rm) $(addprefix $(libuargp_OUT)/*., o os oS a)
+diff --git a/libuargp/argp-ba.c b/libuargp/argp-ba.c
+new file mode 100644
+index 0000000..3522b02
+--- /dev/null
++++ b/libuargp/argp-ba.c
+@@ -0,0 +1,26 @@
++/* Default definition for ARGP_PROGRAM_BUG_ADDRESS.
++   Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++/* If set by the user program, it should point to string that is the
++   bug-reporting address for the program.  It will be printed by argp_help if
++   the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help
++   messages), embedded in a sentence that says something like `Report bugs to
++   ADDR.'.  */
++const char *argp_program_bug_address;
+diff --git a/libuargp/argp-eexst.c b/libuargp/argp-eexst.c
+new file mode 100644
+index 0000000..445b68d
+--- /dev/null
++++ b/libuargp/argp-eexst.c
+@@ -0,0 +1,32 @@
++/* Default definition for ARGP_ERR_EXIT_STATUS
++   Copyright (C) 1997 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <sysexits.h>
++
++#include <argp.h>
++
++/* The exit status that argp will use when exiting due to a parsing error.
++   If not defined or set by the user program, this defaults to EX_USAGE from
++   <sysexits.h>.  */
++error_t argp_err_exit_status = EX_USAGE;
+diff --git a/libuargp/argp-fmtstream.c b/libuargp/argp-fmtstream.c
+new file mode 100644
+index 0000000..75227f9
+--- /dev/null
++++ b/libuargp/argp-fmtstream.c
+@@ -0,0 +1,439 @@
++/* Word-wrapping and line-truncating streams
++   Copyright (C) 1997-1999,2001,2002,2003,2005 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.
++
++   Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
++*/
++
++/* This package emulates glibc `line_wrap_stream' semantics for systems that
++   don't have that.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <stdlib.h>
++#include <string.h>
++#include <errno.h>
++#include <stdarg.h>
++#include <ctype.h>
++
++#include "argp-fmtstream.h"
++
++#ifndef ARGP_FMTSTREAM_USE_LINEWRAP
++
++#ifndef isblank
++#define isblank(ch) ((ch)==' ' || (ch)=='\t')
++#endif
++
++#if defined _LIBC && defined USE_IN_LIBIO
++# include <wchar.h>
++# include <libio/libioP.h>
++# define __vsnprintf(s, l, f, a) _IO_vsnprintf (s, l, f, a)
++#else
++# define __vsnprintf(s, l, f, a) vsnprintf (s, l, f, a)
++#endif
++
++#define INIT_BUF_SIZE 200
++#define PRINTF_SIZE_GUESS 150
++
++/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
++   written on it with LMARGIN spaces and limits them to RMARGIN columns
++   total.  If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
++   replacing the whitespace before them with a newline and WMARGIN spaces.
++   Otherwise, chars beyond RMARGIN are simply dropped until a newline.
++   Returns NULL if there was an error.  */
++argp_fmtstream_t
++__argp_make_fmtstream (FILE *stream,
++                      size_t lmargin, size_t rmargin, ssize_t wmargin)
++{
++  argp_fmtstream_t fs;
++
++  fs = (struct argp_fmtstream *) malloc (sizeof (struct argp_fmtstream));
++  if (fs != NULL)
++    {
++      fs->stream = stream;
++
++      fs->lmargin = lmargin;
++      fs->rmargin = rmargin;
++      fs->wmargin = wmargin;
++      fs->point_col = 0;
++      fs->point_offs = 0;
++
++      fs->buf = (char *) malloc (INIT_BUF_SIZE);
++      if (! fs->buf)
++       {
++         free (fs);
++         fs = 0;
++       }
++      else
++       {
++         fs->p = fs->buf;
++         fs->end = fs->buf + INIT_BUF_SIZE;
++       }
++    }
++
++  return fs;
++}
++#if 0
++/* Not exported.  */
++#ifdef weak_alias
++weak_alias (__argp_make_fmtstream, argp_make_fmtstream)
++#endif
++#endif
++
++/* Flush FS to its stream, and free it (but don't close the stream).  */
++void
++__argp_fmtstream_free (argp_fmtstream_t fs)
++{
++  __argp_fmtstream_update (fs);
++  if (fs->p > fs->buf)
++    {
++#ifdef USE_IN_LIBIO
++      __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
++#else
++      fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
++#endif
++    }
++  free (fs->buf);
++  free (fs);
++}
++#if 0
++/* Not exported.  */
++#ifdef weak_alias
++weak_alias (__argp_fmtstream_free, argp_fmtstream_free)
++#endif
++#endif
++
++/* Process FS's buffer so that line wrapping is done from POINT_OFFS to the
++   end of its buffer.  This code is mostly from glibc stdio/linewrap.c.  */
++void
++__argp_fmtstream_update (argp_fmtstream_t fs)
++{
++  char *buf, *nl;
++  size_t len;
++
++  /* Scan the buffer for newlines.  */
++  buf = fs->buf + fs->point_offs;
++  while (buf < fs->p)
++    {
++      size_t r;
++
++      if (fs->point_col == 0 && fs->lmargin != 0)
++       {
++         /* We are starting a new line.  Print spaces to the left margin.  */
++         const size_t pad = fs->lmargin;
++         if (fs->p + pad < fs->end)
++           {
++             /* We can fit in them in the buffer by moving the
++                buffer text up and filling in the beginning.  */
++             memmove (buf + pad, buf, fs->p - buf);
++             fs->p += pad; /* Compensate for bigger buffer. */
++             memset (buf, ' ', pad); /* Fill in the spaces.  */
++             buf += pad; /* Don't bother searching them.  */
++           }
++         else
++           {
++             /* No buffer space for spaces.  Must flush.  */
++             size_t i;
++             for (i = 0; i < pad; i++)
++               {
++#ifdef USE_IN_LIBIO
++                 if (_IO_fwide (fs->stream, 0) > 0)
++                   putwc_unlocked (L' ', fs->stream);
++                 else
++#endif
++                   putc_unlocked (' ', fs->stream);
++               }
++           }
++         fs->point_col = pad;
++       }
++
++      len = fs->p - buf;
++      nl = memchr (buf, '\n', len);
++
++      if (fs->point_col < 0)
++       fs->point_col = 0;
++
++      if (!nl)
++       {
++         /* The buffer ends in a partial line.  */
++
++         if (fs->point_col + len < fs->rmargin)
++           {
++             /* The remaining buffer text is a partial line and fits
++                within the maximum line width.  Advance point for the
++                characters to be written and stop scanning.  */
++             fs->point_col += len;
++             break;
++           }
++         else
++           /* Set the end-of-line pointer for the code below to
++              the end of the buffer.  */
++           nl = fs->p;
++       }
++      else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin)
++       {
++         /* The buffer contains a full line that fits within the maximum
++            line width.  Reset point and scan the next line.  */
++         fs->point_col = 0;
++         buf = nl + 1;
++         continue;
++       }
++
++      /* This line is too long.  */
++      r = fs->rmargin - 1;
++
++      if (fs->wmargin < 0)
++       {
++         /* Truncate the line by overwriting the excess with the
++            newline and anything after it in the buffer.  */
++         if (nl < fs->p)
++           {
++             memmove (buf + (r - fs->point_col), nl, fs->p - nl);
++             fs->p -= buf + (r - fs->point_col) - nl;
++             /* Reset point for the next line and start scanning it.  */
++             fs->point_col = 0;
++             buf += r + 1; /* Skip full line plus \n. */
++           }
++         else
++           {
++             /* The buffer ends with a partial line that is beyond the
++                maximum line width.  Advance point for the characters
++                written, and discard those past the max from the buffer.  */
++             fs->point_col += len;
++             fs->p -= fs->point_col - r;
++             break;
++           }
++       }
++      else
++       {
++         /* Do word wrap.  Go to the column just past the maximum line
++            width and scan back for the beginning of the word there.
++            Then insert a line break.  */
++
++         char *p, *nextline;
++         int i;
++
++         p = buf + (r + 1 - fs->point_col);
++         while (p >= buf && !isblank (*p))
++           --p;
++         nextline = p + 1;     /* This will begin the next line.  */
++
++         if (nextline > buf)
++           {
++             /* Swallow separating blanks.  */
++             if (p >= buf)
++               do
++                 --p;
++               while (p >= buf && isblank (*p));
++             nl = p + 1;       /* The newline will replace the first blank. */
++           }
++         else
++           {
++             /* A single word that is greater than the maximum line width.
++                Oh well.  Put it on an overlong line by itself.  */
++             p = buf + (r + 1 - fs->point_col);
++             /* Find the end of the long word.  */
++             do
++               ++p;
++             while (p < nl && !isblank (*p));
++             if (p == nl)
++               {
++                 /* It already ends a line.  No fussing required.  */
++                 fs->point_col = 0;
++                 buf = nl + 1;
++                 continue;
++               }
++             /* We will move the newline to replace the first blank.  */
++             nl = p;
++             /* Swallow separating blanks.  */
++             do
++               ++p;
++             while (isblank (*p));
++             /* The next line will start here.  */
++             nextline = p;
++           }
++
++         /* Note: There are a bunch of tests below for
++            NEXTLINE == BUF + LEN + 1; this case is where NL happens to fall
++            at the end of the buffer, and NEXTLINE is in fact empty (and so
++            we need not be careful to maintain its contents).  */
++
++         if ((nextline == buf + len + 1
++              ? fs->end - nl < fs->wmargin + 1
++              : nextline - (nl + 1) < fs->wmargin)
++             && fs->p > nextline)
++           {
++             /* The margin needs more blanks than we removed.  */
++             if (fs->end - fs->p > fs->wmargin + 1)
++               /* Make some space for them.  */
++               {
++                 size_t mv = fs->p - nextline;
++                 memmove (nl + 1 + fs->wmargin, nextline, mv);
++                 nextline = nl + 1 + fs->wmargin;
++                 len = nextline + mv - buf;
++                 *nl++ = '\n';
++               }
++             else
++               /* Output the first line so we can use the space.  */
++               {
++#if defined _LIBC && defined USE_IN_LIBIO
++                 __fxprintf (fs->stream, "%.*s\n",
++                             (int) (nl - fs->buf), fs->buf);
++#else
++                 if (nl > fs->buf)
++                   fwrite_unlocked (fs->buf, 1, nl - fs->buf, fs->stream);
++                 putc_unlocked ('\n', fs->stream);
++#endif
++
++                 len += buf - fs->buf;
++                 nl = buf = fs->buf;
++               }
++           }
++         else
++           /* We can fit the newline and blanks in before
++              the next word.  */
++           *nl++ = '\n';
++
++         if (nextline - nl >= fs->wmargin
++             || (nextline == buf + len + 1 && fs->end - nextline >= fs->wmargin))
++           /* Add blanks up to the wrap margin column.  */
++           for (i = 0; i < fs->wmargin; ++i)
++             *nl++ = ' ';
++         else
++           for (i = 0; i < fs->wmargin; ++i)
++#ifdef USE_IN_LIBIO
++             if (_IO_fwide (fs->stream, 0) > 0)
++               putwc_unlocked (L' ', fs->stream);
++             else
++#endif
++               putc_unlocked (' ', fs->stream);
++
++         /* Copy the tail of the original buffer into the current buffer
++            position.  */
++         if (nl < nextline)
++           memmove (nl, nextline, buf + len - nextline);
++         len -= nextline - buf;
++
++         /* Continue the scan on the remaining lines in the buffer.  */
++         buf = nl;
++
++         /* Restore bufp to include all the remaining text.  */
++         fs->p = nl + len;
++
++         /* Reset the counter of what has been output this line.  If wmargin
++            is 0, we want to avoid the lmargin getting added, so we set
++            point_col to a magic value of -1 in that case.  */
++         fs->point_col = fs->wmargin ? fs->wmargin : -1;
++       }
++    }
++
++  /* Remember that we've scanned as far as the end of the buffer.  */
++  fs->point_offs = fs->p - fs->buf;
++}
++
++/* Ensure that FS has space for AMOUNT more bytes in its buffer, either by
++   growing the buffer, or by flushing it.  True is returned iff we succeed. */
++int
++__argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
++{
++  if ((size_t) (fs->end - fs->p) < amount)
++    {
++      ssize_t wrote;
++
++      /* Flush FS's buffer.  */
++      __argp_fmtstream_update (fs);
++
++#if defined _LIBC && defined USE_IN_LIBIO
++      __fxprintf (fs->stream, "%.*s", (int) (fs->p - fs->buf), fs->buf);
++      wrote = fs->p - fs->buf;
++#else
++      wrote = fwrite_unlocked (fs->buf, 1, fs->p - fs->buf, fs->stream);
++#endif
++      if (wrote == fs->p - fs->buf)
++       {
++         fs->p = fs->buf;
++         fs->point_offs = 0;
++       }
++      else
++       {
++         fs->p -= wrote;
++         fs->point_offs -= wrote;
++         memmove (fs->buf, fs->buf + wrote, fs->p - fs->buf);
++         return 0;
++       }
++
++      if ((size_t) (fs->end - fs->buf) < amount)
++       /* Gotta grow the buffer.  */
++       {
++         size_t old_size = fs->end - fs->buf;
++         size_t new_size = old_size + amount;
++         char *new_buf;
++
++         if (new_size < old_size || ! (new_buf = realloc (fs->buf, new_size)))
++           {
++             __set_errno (ENOMEM);
++             return 0;
++           }
++
++         fs->buf = new_buf;
++         fs->end = new_buf + new_size;
++         fs->p = fs->buf;
++       }
++    }
++
++  return 1;
++}
++
++ssize_t
++__argp_fmtstream_printf (struct argp_fmtstream *fs, const char *fmt, ...)
++{
++  int out;
++  size_t avail;
++  size_t size_guess = PRINTF_SIZE_GUESS; /* How much space to reserve. */
++
++  do
++    {
++      va_list args;
++
++      if (! __argp_fmtstream_ensure (fs, size_guess))
++       return -1;
++
++      va_start (args, fmt);
++      avail = fs->end - fs->p;
++      out = __vsnprintf (fs->p, avail, fmt, args);
++      va_end (args);
++      if ((size_t) out >= avail)
++       size_guess = out + 1;
++    }
++  while ((size_t) out >= avail);
++
++  fs->p += out;
++
++  return out;
++}
++#if 0
++/* Not exported.  */
++#ifdef weak_alias
++weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
++#endif
++#endif
++
++#endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
+diff --git a/libuargp/argp-fmtstream.h b/libuargp/argp-fmtstream.h
+new file mode 100644
+index 0000000..ca7c834
+--- /dev/null
++++ b/libuargp/argp-fmtstream.h
+@@ -0,0 +1,314 @@
++/* Word-wrapping and line-truncating streams.
++   Copyright (C) 1997 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.
++
++   Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
++*/
++
++/* This package emulates glibc `line_wrap_stream' semantics for systems that
++   don't have that.  If the system does have it, it is just a wrapper for
++   that.  This header file is only used internally while compiling argp, and
++   shouldn't be installed.  */
++
++#ifndef _ARGP_FMTSTREAM_H
++#define _ARGP_FMTSTREAM_H
++
++#include <stdio.h>
++#include <string.h>
++#include <unistd.h>
++
++#ifndef __attribute__
++/* This feature is available in gcc versions 2.5 and later.  */
++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || defined(__STRICT_ANSI__)
++#  define __attribute__(Spec) /* empty */
++# endif
++/* The __-protected variants of `format' and `printf' attributes
++   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
++# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || defined(__STRICT_ANSI__)
++#  define __format__ format
++#  define __printf__ printf
++# endif
++#endif
++
++#if 0 /* uClibc: disabled */
++#if    (_LIBC - 0 && !defined (USE_IN_LIBIO)) \
++    || (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H))
++/* line_wrap_stream is available, so use that.  */
++#define ARGP_FMTSTREAM_USE_LINEWRAP
++#endif
++#else
++/* line_wrap stream NOT available */
++# undef ARGP_FMTSTREAM_USE_LINEWRAP
++#endif
++
++#ifdef ARGP_FMTSTREAM_USE_LINEWRAP
++/* Just be a simple wrapper for line_wrap_stream; the semantics are
++   *slightly* different, as line_wrap_stream doesn't actually make a new
++   object, it just modifies the given stream (reversibly) to do
++   line-wrapping.  Since we control who uses this code, it doesn't matter.  */
++
++#include <linewrap.h>
++
++typedef FILE *argp_fmtstream_t;
++
++#define argp_make_fmtstream line_wrap_stream
++#define __argp_make_fmtstream line_wrap_stream
++#define argp_fmtstream_free line_unwrap_stream
++#define __argp_fmtstream_free line_unwrap_stream
++
++#define __argp_fmtstream_putc(fs,ch) putc(ch,fs)
++#define argp_fmtstream_putc(fs,ch) putc(ch,fs)
++#define __argp_fmtstream_puts(fs,str) fputs(str,fs)
++#define argp_fmtstream_puts(fs,str) fputs(str,fs)
++#define __argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs)
++#define argp_fmtstream_write(fs,str,len) fwrite(str,1,len,fs)
++#define __argp_fmtstream_printf fprintf
++#define argp_fmtstream_printf fprintf
++
++#define __argp_fmtstream_lmargin line_wrap_lmargin
++#define argp_fmtstream_lmargin line_wrap_lmargin
++#define __argp_fmtstream_set_lmargin line_wrap_set_lmargin
++#define argp_fmtstream_set_lmargin line_wrap_set_lmargin
++#define __argp_fmtstream_rmargin line_wrap_rmargin
++#define argp_fmtstream_rmargin line_wrap_rmargin
++#define __argp_fmtstream_set_rmargin line_wrap_set_rmargin
++#define argp_fmtstream_set_rmargin line_wrap_set_rmargin
++#define __argp_fmtstream_wmargin line_wrap_wmargin
++#define argp_fmtstream_wmargin line_wrap_wmargin
++#define __argp_fmtstream_set_wmargin line_wrap_set_wmargin
++#define argp_fmtstream_set_wmargin line_wrap_set_wmargin
++#define __argp_fmtstream_point line_wrap_point
++#define argp_fmtstream_point line_wrap_point
++
++#else /* !ARGP_FMTSTREAM_USE_LINEWRAP */
++/* Guess we have to define our own version.  */
++
++#ifndef __const
++#define __const const
++#endif
++
++struct argp_fmtstream
++{
++  FILE *stream;                        /* The stream we're outputting to.  */
++
++  size_t lmargin, rmargin;     /* Left and right margins.  */
++  ssize_t wmargin;             /* Margin to wrap to, or -1 to truncate.  */
++
++  /* Point in buffer to which we've processed for wrapping, but not output.  */
++  size_t point_offs;
++  /* Output column at POINT_OFFS, or -1 meaning 0 but don't add lmargin.  */
++  ssize_t point_col;
++
++  char *buf;                   /* Output buffer.  */
++  char *p;                     /* Current end of text in BUF. */
++  char *end;                   /* Absolute end of BUF.  */
++};
++
++typedef struct argp_fmtstream *argp_fmtstream_t;
++
++/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
++   written on it with LMARGIN spaces and limits them to RMARGIN columns
++   total.  If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
++   replacing the whitespace before them with a newline and WMARGIN spaces.
++   Otherwise, chars beyond RMARGIN are simply dropped until a newline.
++   Returns NULL if there was an error.  */
++extern argp_fmtstream_t __argp_make_fmtstream (FILE *__stream,
++                                              size_t __lmargin,
++                                              size_t __rmargin,
++                                              ssize_t __wmargin);
++extern argp_fmtstream_t argp_make_fmtstream (FILE *__stream,
++                                            size_t __lmargin,
++                                            size_t __rmargin,
++                                            ssize_t __wmargin);
++
++/* Flush __FS to its stream, and free it (but don't close the stream).  */
++extern void __argp_fmtstream_free (argp_fmtstream_t __fs);
++extern void argp_fmtstream_free (argp_fmtstream_t __fs);
++
++extern ssize_t __argp_fmtstream_printf (argp_fmtstream_t __fs,
++                                      __const char *__fmt, ...)
++     __attribute__ ((__format__ (printf, 2, 3)));
++extern ssize_t argp_fmtstream_printf (argp_fmtstream_t __fs,
++                                     __const char *__fmt, ...)
++     __attribute__ ((__format__ (printf, 2, 3)));
++
++extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
++extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
++
++extern int __argp_fmtstream_puts (argp_fmtstream_t __fs, __const char *__str);
++extern int argp_fmtstream_puts (argp_fmtstream_t __fs, __const char *__str);
++
++extern size_t __argp_fmtstream_write (argp_fmtstream_t __fs,
++                                     __const char *__str, size_t __len);
++extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
++                                   __const char *__str, size_t __len);
++
++/* Access macros for various bits of state.  */
++#define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
++#define argp_fmtstream_rmargin(__fs) ((__fs)->rmargin)
++#define argp_fmtstream_wmargin(__fs) ((__fs)->wmargin)
++#define __argp_fmtstream_lmargin argp_fmtstream_lmargin
++#define __argp_fmtstream_rmargin argp_fmtstream_rmargin
++#define __argp_fmtstream_wmargin argp_fmtstream_wmargin
++
++/* Set __FS's left margin to LMARGIN and return the old value.  */
++extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
++                                         size_t __lmargin);
++extern size_t __argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
++                                           size_t __lmargin);
++
++/* Set __FS's right margin to __RMARGIN and return the old value.  */
++extern size_t argp_fmtstream_set_rmargin (argp_fmtstream_t __fs,
++                                         size_t __rmargin);
++extern size_t __argp_fmtstream_set_rmargin (argp_fmtstream_t __fs,
++                                           size_t __rmargin);
++
++/* Set __FS's wrap margin to __WMARGIN and return the old value.  */
++extern size_t argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
++                                         size_t __wmargin);
++extern size_t __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs,
++                                           size_t __wmargin);
++
++/* Return the column number of the current output point in __FS.  */
++extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
++extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
++
++/* Internal routines.  */
++extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
++extern void __argp_fmtstream_update (argp_fmtstream_t __fs);
++extern int _argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
++extern int __argp_fmtstream_ensure (argp_fmtstream_t __fs, size_t __amount);
++
++#ifdef __OPTIMIZE__
++/* Inline versions of above routines.  */
++
++#if !_LIBC
++#define __argp_fmtstream_putc argp_fmtstream_putc
++#define __argp_fmtstream_puts argp_fmtstream_puts
++#define __argp_fmtstream_write argp_fmtstream_write
++#define __argp_fmtstream_set_lmargin argp_fmtstream_set_lmargin
++#define __argp_fmtstream_set_rmargin argp_fmtstream_set_rmargin
++#define __argp_fmtstream_set_wmargin argp_fmtstream_set_wmargin
++#define __argp_fmtstream_point argp_fmtstream_point
++#define __argp_fmtstream_update _argp_fmtstream_update
++#define __argp_fmtstream_ensure _argp_fmtstream_ensure
++#endif
++
++#ifndef ARGP_FS_EI
++#define ARGP_FS_EI __extern_inline
++#endif
++
++ARGP_FS_EI size_t
++__argp_fmtstream_write (argp_fmtstream_t __fs,
++                       __const char *__str, size_t __len)
++{
++  if (__fs->p + __len <= __fs->end || __argp_fmtstream_ensure (__fs, __len))
++    {
++      memcpy (__fs->p, __str, __len);
++      __fs->p += __len;
++      return __len;
++    }
++  else
++    return 0;
++}
++
++ARGP_FS_EI int
++__argp_fmtstream_puts (argp_fmtstream_t __fs, __const char *__str)
++{
++  size_t __len = strlen (__str);
++  if (__len)
++    {
++      size_t __wrote = __argp_fmtstream_write (__fs, __str, __len);
++      return __wrote == __len ? 0 : -1;
++    }
++  else
++    return 0;
++}
++
++ARGP_FS_EI int
++__argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch)
++{
++  if (__fs->p < __fs->end || __argp_fmtstream_ensure (__fs, 1))
++    return *__fs->p++ = __ch;
++  else
++    return EOF;
++}
++
++/* Set __FS's left margin to __LMARGIN and return the old value.  */
++ARGP_FS_EI size_t
++__argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin)
++{
++  size_t __old;
++  if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
++    __argp_fmtstream_update (__fs);
++  __old = __fs->lmargin;
++  __fs->lmargin = __lmargin;
++  return __old;
++}
++
++/* Set __FS's right margin to __RMARGIN and return the old value.  */
++ARGP_FS_EI size_t
++__argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin)
++{
++  size_t __old;
++  if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
++    __argp_fmtstream_update (__fs);
++  __old = __fs->rmargin;
++  __fs->rmargin = __rmargin;
++  return __old;
++}
++
++/* Set FS's wrap margin to __WMARGIN and return the old value.  */
++ARGP_FS_EI size_t
++__argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin)
++{
++  size_t __old;
++  if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
++    __argp_fmtstream_update (__fs);
++  __old = __fs->wmargin;
++  __fs->wmargin = __wmargin;
++  return __old;
++}
++
++/* Return the column number of the current output point in __FS.  */
++ARGP_FS_EI size_t
++__argp_fmtstream_point (argp_fmtstream_t __fs)
++{
++  if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
++    __argp_fmtstream_update (__fs);
++  return __fs->point_col >= 0 ? __fs->point_col : 0;
++}
++
++#if !_LIBC
++#undef __argp_fmtstream_putc
++#undef __argp_fmtstream_puts
++#undef __argp_fmtstream_write
++#undef __argp_fmtstream_set_lmargin
++#undef __argp_fmtstream_set_rmargin
++#undef __argp_fmtstream_set_wmargin
++#undef __argp_fmtstream_point
++#undef __argp_fmtstream_update
++#undef __argp_fmtstream_ensure
++#endif
++
++#endif /* __OPTIMIZE__ */
++
++#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
++
++#endif /* argp-fmtstream.h */
+diff --git a/libuargp/argp-fs-xinl.c b/libuargp/argp-fs-xinl.c
+new file mode 100644
+index 0000000..473cbbd
+--- /dev/null
++++ b/libuargp/argp-fs-xinl.c
+@@ -0,0 +1,44 @@
++/* Real definitions for extern inline functions in argp-fmtstream.h
++   Copyright (C) 1997, 2003, 2004 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define ARGP_FS_EI
++#undef __OPTIMIZE__
++#define __OPTIMIZE__ 1
++#include "argp-fmtstream.h"
++
++#if 0
++/* Not exported.  */
++/* Add weak aliases.  */
++#if _LIBC - 0 && !defined (ARGP_FMTSTREAM_USE_LINEWRAP) && defined (weak_alias)
++
++weak_alias (__argp_fmtstream_putc, argp_fmtstream_putc)
++weak_alias (__argp_fmtstream_puts, argp_fmtstream_puts)
++weak_alias (__argp_fmtstream_write, argp_fmtstream_write)
++weak_alias (__argp_fmtstream_set_lmargin, argp_fmtstream_set_lmargin)
++weak_alias (__argp_fmtstream_set_rmargin, argp_fmtstream_set_rmargin)
++weak_alias (__argp_fmtstream_set_wmargin, argp_fmtstream_set_wmargin)
++weak_alias (__argp_fmtstream_point, argp_fmtstream_point)
++
++#endif
++#endif
+diff --git a/libuargp/argp-help.c b/libuargp/argp-help.c
+new file mode 100644
+index 0000000..58a5e6e
+--- /dev/null
++++ b/libuargp/argp-help.c
+@@ -0,0 +1,1882 @@
++/* Hierarchial argument parsing help output
++   Copyright (C) 1995-2003, 2004, 2005, 2006, 2007
++   Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.
++
++   Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
++*/
++
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE   1
++#endif
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++/* AIX requires this to be the first thing in the file.  */
++#ifndef __GNUC__
++# if HAVE_ALLOCA_H || defined _LIBC
++#  include <alloca.h>
++# else
++#  ifdef _AIX
++#pragma alloca
++#  else
++#   ifndef alloca /* predefined by HP cc +Olibcalls */
++char *alloca ();
++#   endif
++#  endif
++# endif
++#endif
++
++#include <stddef.h>
++#include <stdlib.h>
++#include <string.h>
++#include <assert.h>
++#include <stdarg.h>
++#include <ctype.h>
++#include <limits.h>
++#ifdef _LIBC
++# include <wchar.h>
++#endif
++
++#include <features.h>
++#ifndef _
++/* This is for other GNU distributions with internationalized messages.  */
++# if (defined HAVE_LIBINTL_H || defined _LIBC) && defined __UCLIBC_HAS_GETTEXT_AWARENESS__
++#  include <libintl.h>
++#  ifdef _LIBC
++#   undef dgettext
++#   define dgettext(domain, msgid) \
++  INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
++#  endif
++# else
++#  define dgettext(domain, msgid) (msgid)
++# endif
++#endif
++
++#ifndef _LIBC
++# if HAVE_STRERROR_R
++#  if !HAVE_DECL_STRERROR_R
++char *strerror_r (int errnum, char *buf, size_t buflen);
++#  endif
++# else
++#  if !HAVE_DECL_STRERROR
++char *strerror (int errnum);
++#  endif
++# endif
++#endif
++
++#include <argp.h>
++#include "argp-fmtstream.h"
++#include <stdbool.h>
++#include <stdint.h>
++
++#ifndef SIZE_MAX
++# define SIZE_MAX ((size_t) -1)
++#endif
++
++/* User-selectable (using an environment variable) formatting parameters.
++
++   These may be specified in an environment variable called `ARGP_HELP_FMT',
++   with a contents like:  VAR1=VAL1,VAR2=VAL2,BOOLVAR2,no-BOOLVAR2
++   Where VALn must be a positive integer.  The list of variables is in the
++   UPARAM_NAMES vector, below.  */
++
++/* Default parameters.  */
++#define DUP_ARGS      0                /* True if option argument can be duplicated. */
++#define DUP_ARGS_NOTE 1                /* True to print a note about duplicate args. */
++#define SHORT_OPT_COL 2                /* column in which short options start */
++#define LONG_OPT_COL  6                /* column in which long options start */
++#define DOC_OPT_COL   2                /* column in which doc options start */
++#define OPT_DOC_COL  29                /* column in which option text starts */
++#define HEADER_COL    1                /* column in which group headers are printed */
++#define USAGE_INDENT 12                /* indentation of wrapped usage lines */
++#define RMARGIN      79                /* right margin used for wrapping */
++
++/* User-selectable (using an environment variable) formatting parameters.
++   They must all be of type `int' for the parsing code to work.  */
++struct uparams
++{
++  /* If true, arguments for an option are shown with both short and long
++     options, even when a given option has both, e.g. `-x ARG, --longx=ARG'.
++     If false, then if an option has both, the argument is only shown with
++     the long one, e.g., `-x, --longx=ARG', and a message indicating that
++     this really means both is printed below the options.  */
++  int dup_args;
++
++  /* This is true if when DUP_ARGS is false, and some duplicate arguments have
++     been suppressed, an explanatory message should be printed.  */
++  int dup_args_note;
++
++  /* Various output columns.  */
++  int short_opt_col;
++  int long_opt_col;
++  int doc_opt_col;
++  int opt_doc_col;
++  int header_col;
++  int usage_indent;
++  int rmargin;
++};
++
++/* This is a global variable, as user options are only ever read once.  */
++static struct uparams uparams = {
++  DUP_ARGS, DUP_ARGS_NOTE,
++  SHORT_OPT_COL, LONG_OPT_COL, DOC_OPT_COL, OPT_DOC_COL, HEADER_COL,
++  USAGE_INDENT, RMARGIN
++};
++
++/* A particular uparam, and what the user name is.  */
++struct uparam_name
++{
++  const char name[14];         /* User name.  */
++  bool is_bool;                        /* Whether it's `boolean'.  */
++  uint8_t uparams_offs;                /* Location of the (int) field in UPARAMS.  */
++};
++
++/* The name-field mappings we know about.  */
++static const struct uparam_name uparam_names[] =
++{
++  { "dup-args",       true, offsetof (struct uparams, dup_args) },
++  { "dup-args-note",  true, offsetof (struct uparams, dup_args_note) },
++  { "short-opt-col",  false, offsetof (struct uparams, short_opt_col) },
++  { "long-opt-col",   false, offsetof (struct uparams, long_opt_col) },
++  { "doc-opt-col",    false, offsetof (struct uparams, doc_opt_col) },
++  { "opt-doc-col",    false, offsetof (struct uparams, opt_doc_col) },
++  { "header-col",     false, offsetof (struct uparams, header_col) },
++  { "usage-indent",   false, offsetof (struct uparams, usage_indent) },
++  { "rmargin",        false, offsetof (struct uparams, rmargin) }
++};
++#define nuparam_names (sizeof (uparam_names) / sizeof (uparam_names[0]))
++
++/* Read user options from the environment, and fill in UPARAMS appropiately.  */
++static void
++fill_in_uparams (const struct argp_state *state)
++{
++  const char *var = getenv ("ARGP_HELP_FMT");
++
++#define SKIPWS(p) do { while (isspace (*p)) p++; } while (0);
++
++  if (var)
++    /* Parse var. */
++    while (*var)
++      {
++       SKIPWS (var);
++
++       if (isalpha (*var))
++         {
++           size_t var_len;
++           const struct uparam_name *un;
++           int unspec = 0, val = 0;
++           const char *arg = var;
++
++           while (isalnum (*arg) || *arg == '-' || *arg == '_')
++             arg++;
++           var_len = arg - var;
++
++           SKIPWS (arg);
++
++           if (*arg == '\0' || *arg == ',')
++             unspec = 1;
++           else if (*arg == '=')
++             {
++               arg++;
++               SKIPWS (arg);
++             }
++
++           if (unspec)
++             {
++               if (var[0] == 'n' && var[1] == 'o' && var[2] == '-')
++                 {
++                   val = 0;
++                   var += 3;
++                   var_len -= 3;
++                 }
++               else
++                 val = 1;
++             }
++           else if (isdigit (*arg))
++             {
++               val = atoi (arg);
++               while (isdigit (*arg))
++                 arg++;
++               SKIPWS (arg);
++             }
++
++           un = uparam_names;
++           size_t u;
++           for (u = 0; u < nuparam_names; ++un, ++u)
++             if (strlen (un->name) == var_len
++                 && strncmp (var, un->name, var_len) == 0)
++               {
++                 if (unspec && !un->is_bool)
++                   argp_failure (state, 0, 0,
++                                   dgettext (state == NULL ? NULL
++                                             : state->root_argp->argp_domain,
++                                             "\
++%.*s: ARGP_HELP_FMT parameter requires a value"),
++                                   (int) var_len, var);
++                 else
++                   *(int *)((char *)&uparams + un->uparams_offs) = val;
++                 break;
++               }
++           if (u == nuparam_names)
++             argp_failure (state, 0, 0,
++                             dgettext (state == NULL ? NULL
++                                       : state->root_argp->argp_domain, "\
++%.*s: Unknown ARGP_HELP_FMT parameter"),
++                             (int) var_len, var);
++
++           var = arg;
++           if (*var == ',')
++             var++;
++         }
++       else if (*var)
++         {
++           argp_failure (state, 0, 0,
++                           dgettext (state == NULL ? NULL
++                                     : state->root_argp->argp_domain,
++                                     "Garbage in ARGP_HELP_FMT: %s"), var);
++           break;
++         }
++      }
++}
++
++/* Returns true if OPT hasn't been marked invisible.  Visibility only affects
++   whether OPT is displayed or used in sorting, not option shadowing.  */
++#define ovisible(opt) (! ((opt)->flags & OPTION_HIDDEN))
++
++/* Returns true if OPT is an alias for an earlier option.  */
++#define oalias(opt) ((opt)->flags & OPTION_ALIAS)
++
++/* Returns true if OPT is an documentation-only entry.  */
++#define odoc(opt) ((opt)->flags & OPTION_DOC)
++
++/* Returns true if OPT is the end-of-list marker for a list of options.  */
++#define oend(opt) __option_is_end (opt)
++
++/* Returns true if OPT has a short option.  */
++#define oshort(opt) __option_is_short (opt)
++
++/*
++   The help format for a particular option is like:
++
++     -xARG, -yARG, --long1=ARG, --long2=ARG        Documentation...
++
++   Where ARG will be omitted if there's no argument, for this option, or
++   will be surrounded by "[" and "]" appropiately if the argument is
++   optional.  The documentation string is word-wrapped appropiately, and if
++   the list of options is long enough, it will be started on a separate line.
++   If there are no short options for a given option, the first long option is
++   indented slighly in a way that's supposed to make most long options appear
++   to be in a separate column.
++
++   For example, the following output (from ps):
++
++     -p PID, --pid=PID          List the process PID
++        --pgrp=PGRP            List processes in the process group PGRP
++     -P, -x, --no-parent        Include processes without parents
++     -Q, --all-fields           Don't elide unusable fields (normally if there's
++                               some reason ps can't print a field for any
++                               process, it's removed from the output entirely)
++     -r, --reverse, --gratuitously-long-reverse-option
++                               Reverse the order of any sort
++        --session[=SID]        Add the processes from the session SID (which
++                               defaults to the sid of the current process)
++
++    Here are some more options:
++     -f ZOT, --foonly=ZOT       Glork a foonly
++     -z, --zaza                 Snit a zar
++
++     -?, --help                 Give this help list
++        --usage                Give a short usage message
++     -V, --version              Print program version
++
++   The struct argp_option array for the above could look like:
++
++   {
++     {"pid",       'p',      "PID",  0, "List the process PID"},
++     {"pgrp",      OPT_PGRP, "PGRP", 0, "List processes in the process group PGRP"},
++     {"no-parent", 'P',              0,     0, "Include processes without parents"},
++     {0,           'x',       0,     OPTION_ALIAS},
++     {"all-fields",'Q',       0,     0, "Don't elide unusable fields (normally"
++                                        " if there's some reason ps can't"
++                                       " print a field for any process, it's"
++                                        " removed from the output entirely)" },
++     {"reverse",   'r',       0,     0, "Reverse the order of any sort"},
++     {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS},
++     {"session",   OPT_SESS,  "SID", OPTION_ARG_OPTIONAL,
++                                        "Add the processes from the session"
++                                       " SID (which defaults to the sid of"
++                                       " the current process)" },
++
++     {0,0,0,0, "Here are some more options:"},
++     {"foonly", 'f', "ZOT", 0, "Glork a foonly"},
++     {"zaza", 'z', 0, 0, "Snit a zar"},
++
++     {0}
++   }
++
++   Note that the last three options are automatically supplied by argp_parse,
++   unless you tell it not to with ARGP_NO_HELP.
++
++*/
++
++/* Returns true if CH occurs between BEG and END.  */
++static int
++find_char (char ch, char *beg, char *end)
++{
++  while (beg < end)
++    if (*beg == ch)
++      return 1;
++    else
++      beg++;
++  return 0;
++}
++
++struct hol_cluster;            /* fwd decl */
++
++struct hol_entry
++{
++  /* First option.  */
++  const struct argp_option *opt;
++  /* Number of options (including aliases).  */
++  unsigned num;
++
++  /* A pointers into the HOL's short_options field, to the first short option
++     letter for this entry.  The order of the characters following this point
++     corresponds to the order of options pointed to by OPT, and there are at
++     most NUM.  A short option recorded in a option following OPT is only
++     valid if it occurs in the right place in SHORT_OPTIONS (otherwise it's
++     probably been shadowed by some other entry).  */
++  char *short_options;
++
++  /* Entries are sorted by their group first, in the order:
++       1, 2, ..., n, 0, -m, ..., -2, -1
++     and then alphabetically within each group.  The default is 0.  */
++  int group;
++
++  /* The cluster of options this entry belongs to, or 0 if none.  */
++  struct hol_cluster *cluster;
++
++  /* The argp from which this option came.  */
++  const struct argp *argp;
++};
++
++/* A cluster of entries to reflect the argp tree structure.  */
++struct hol_cluster
++{
++  /* A descriptive header printed before options in this cluster.  */
++  const char *header;
++
++  /* Used to order clusters within the same group with the same parent,
++     according to the order in which they occurred in the parent argp's child
++     list.  */
++  int index;
++
++  /* How to sort this cluster with respect to options and other clusters at the
++     same depth (clusters always follow options in the same group).  */
++  int group;
++
++  /* The cluster to which this cluster belongs, or 0 if it's at the base
++     level.  */
++  struct hol_cluster *parent;
++
++  /* The argp from which this cluster is (eventually) derived.  */
++  const struct argp *argp;
++
++  /* The distance this cluster is from the root.  */
++  int depth;
++
++  /* Clusters in a given hol are kept in a linked list, to make freeing them
++     possible.  */
++  struct hol_cluster *next;
++};
++
++/* A list of options for help.  */
++struct hol
++{
++  /* An array of hol_entry's.  */
++  struct hol_entry *entries;
++  /* The number of entries in this hol.  If this field is zero, the others
++     are undefined.  */
++  unsigned num_entries;
++
++  /* A string containing all short options in this HOL.  Each entry contains
++     pointers into this string, so the order can't be messed with blindly.  */
++  char *short_options;
++
++  /* Clusters of entries in this hol.  */
++  struct hol_cluster *clusters;
++};
++
++/* Create a struct hol from the options in ARGP.  CLUSTER is the
++   hol_cluster in which these entries occur, or 0, if at the root.  */
++static struct hol *
++make_hol (const struct argp *argp, struct hol_cluster *cluster)
++{
++  char *so;
++  const struct argp_option *o;
++  const struct argp_option *opts = argp->options;
++  struct hol_entry *entry;
++  unsigned num_short_options = 0;
++  struct hol *hol = malloc (sizeof (struct hol));
++
++  assert (hol);
++
++  hol->num_entries = 0;
++  hol->clusters = 0;
++
++  if (opts)
++    {
++      int cur_group = 0;
++
++      /* The first option must not be an alias.  */
++      assert (! oalias (opts));
++
++      /* Calculate the space needed.  */
++      for (o = opts; ! oend (o); o++)
++       {
++         if (! oalias (o))
++           hol->num_entries++;
++         if (oshort (o))
++           num_short_options++;        /* This is an upper bound.  */
++       }
++
++      hol->entries = malloc (sizeof (struct hol_entry) * hol->num_entries);
++      hol->short_options = malloc (num_short_options + 1);
++
++      assert (hol->entries && hol->short_options);
++#if SIZE_MAX <= UINT_MAX
++      assert (hol->num_entries <= SIZE_MAX / sizeof (struct hol_entry));
++#endif
++
++      /* Fill in the entries.  */
++      so = hol->short_options;
++      for (o = opts, entry = hol->entries; ! oend (o); entry++)
++       {
++         entry->opt = o;
++         entry->num = 0;
++         entry->short_options = so;
++         entry->group = cur_group =
++           o->group
++           ? o->group
++           : ((!o->name && !o->key)
++              ? cur_group + 1
++              : cur_group);
++         entry->cluster = cluster;
++         entry->argp = argp;
++
++         do
++           {
++             entry->num++;
++             if (oshort (o) && ! find_char (o->key, hol->short_options, so))
++               /* O has a valid short option which hasn't already been used.*/
++               *so++ = o->key;
++             o++;
++           }
++         while (! oend (o) && oalias (o));
++       }
++      *so = '\0';              /* null terminated so we can find the length */
++    }
++
++  return hol;
++}
++
++/* Add a new cluster to HOL, with the given GROUP and HEADER (taken from the
++   associated argp child list entry), INDEX, and PARENT, and return a pointer
++   to it.  ARGP is the argp that this cluster results from.  */
++static struct hol_cluster *
++hol_add_cluster (struct hol *hol, int group, const char *header, int index,
++                struct hol_cluster *parent, const struct argp *argp)
++{
++  struct hol_cluster *cl = malloc (sizeof (struct hol_cluster));
++  if (cl)
++    {
++      cl->group = group;
++      cl->header = header;
++
++      cl->index = index;
++      cl->parent = parent;
++      cl->argp = argp;
++      cl->depth = parent ? parent->depth + 1 : 0;
++
++      cl->next = hol->clusters;
++      hol->clusters = cl;
++    }
++  return cl;
++}
++
++/* Free HOL and any resources it uses.  */
++static void
++hol_free (struct hol *hol)
++{
++  struct hol_cluster *cl = hol->clusters;
++
++  while (cl)
++    {
++      struct hol_cluster *next = cl->next;
++      free (cl);
++      cl = next;
++    }
++
++  if (hol->num_entries > 0)
++    {
++      free (hol->entries);
++      free (hol->short_options);
++    }
++
++  free (hol);
++}
++
++static int
++hol_entry_short_iterate (const struct hol_entry *entry,
++                        int (*func)(const struct argp_option *opt,
++                                    const struct argp_option *real,
++                                    const char *domain, void *cookie),
++                        const char *domain, void *cookie)
++{
++  unsigned nopts;
++  int val = 0;
++  const struct argp_option *opt, *real = entry->opt;
++  char *so = entry->short_options;
++
++  for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--)
++    if (oshort (opt) && *so == opt->key)
++      {
++       if (!oalias (opt))
++         real = opt;
++       if (ovisible (opt))
++         val = (*func)(opt, real, domain, cookie);
++       so++;
++      }
++
++  return val;
++}
++
++static __inline__ int
++__attribute__ ((always_inline))
++hol_entry_long_iterate (const struct hol_entry *entry,
++                       int (*func)(const struct argp_option *opt,
++                                   const struct argp_option *real,
++                                   const char *domain, void *cookie),
++                       const char *domain, void *cookie)
++{
++  unsigned nopts;
++  int val = 0;
++  const struct argp_option *opt, *real = entry->opt;
++
++  for (opt = real, nopts = entry->num; nopts > 0 && !val; opt++, nopts--)
++    if (opt->name)
++      {
++       if (!oalias (opt))
++         real = opt;
++       if (ovisible (opt))
++         val = (*func)(opt, real, domain, cookie);
++      }
++
++  return val;
++}
++
++/* Iterator that returns true for the first short option.  */
++static __inline__ int
++until_short (const struct argp_option *opt, const struct argp_option *real,
++            const char *domain, void *cookie)
++{
++  return oshort (opt) ? opt->key : 0;
++}
++
++/* Returns the first valid short option in ENTRY, or 0 if there is none.  */
++static char
++hol_entry_first_short (const struct hol_entry *entry)
++{
++  return hol_entry_short_iterate (entry, until_short,
++                                 entry->argp->argp_domain, 0);
++}
++
++/* Returns the first valid long option in ENTRY, or 0 if there is none.  */
++static const char *
++hol_entry_first_long (const struct hol_entry *entry)
++{
++  const struct argp_option *opt;
++  unsigned num;
++  for (opt = entry->opt, num = entry->num; num > 0; opt++, num--)
++    if (opt->name && ovisible (opt))
++      return opt->name;
++  return 0;
++}
++
++/* Returns the entry in HOL with the long option name NAME, or 0 if there is
++   none.  */
++static struct hol_entry *
++hol_find_entry (struct hol *hol, const char *name)
++{
++  struct hol_entry *entry = hol->entries;
++  unsigned num_entries = hol->num_entries;
++
++  while (num_entries-- > 0)
++    {
++      const struct argp_option *opt = entry->opt;
++      unsigned num_opts = entry->num;
++
++      while (num_opts-- > 0)
++       if (opt->name && ovisible (opt) && strcmp (opt->name, name) == 0)
++         return entry;
++       else
++         opt++;
++
++      entry++;
++    }
++
++  return 0;
++}
++
++/* If an entry with the long option NAME occurs in HOL, set it's special
++   sort position to GROUP.  */
++static void
++hol_set_group (struct hol *hol, const char *name, int group)
++{
++  struct hol_entry *entry = hol_find_entry (hol, name);
++  if (entry)
++    entry->group = group;
++}
++
++/* Order by group:  0, 1, 2, ..., n, -m, ..., -2, -1.
++   EQ is what to return if GROUP1 and GROUP2 are the same.  */
++static int
++group_cmp (int group1, int group2, int eq)
++{
++  if (group1 == group2)
++    return eq;
++  else if ((group1 < 0 && group2 < 0) || (group1 >= 0 && group2 >= 0))
++    return group1 - group2;
++  else
++    return group2 - group1;
++}
++
++/* Compare clusters CL1 & CL2 by the order that they should appear in
++   output.  */
++static int
++hol_cluster_cmp (const struct hol_cluster *cl1, const struct hol_cluster *cl2)
++{
++  /* If one cluster is deeper than the other, use its ancestor at the same
++     level, so that finding the common ancestor is straightforward.  */
++  while (cl1->depth > cl2->depth)
++    cl1 = cl1->parent;
++  while (cl2->depth > cl1->depth)
++    cl2 = cl2->parent;
++
++  /* Now reduce both clusters to their ancestors at the point where both have
++     a common parent; these can be directly compared.  */
++  while (cl1->parent != cl2->parent)
++    cl1 = cl1->parent, cl2 = cl2->parent;
++
++  return group_cmp (cl1->group, cl2->group, cl2->index - cl1->index);
++}
++
++/* Return the ancestor of CL that's just below the root (i.e., has a parent
++   of 0).  */
++static struct hol_cluster *
++hol_cluster_base (struct hol_cluster *cl)
++{
++  while (cl->parent)
++    cl = cl->parent;
++  return cl;
++}
++
++/* Return true if CL1 is a child of CL2.  */
++static int
++hol_cluster_is_child (const struct hol_cluster *cl1,
++                     const struct hol_cluster *cl2)
++{
++  while (cl1 && cl1 != cl2)
++    cl1 = cl1->parent;
++  return cl1 == cl2;
++}
++
++/* Given the name of a OPTION_DOC option, modifies NAME to start at the tail
++   that should be used for comparisons, and returns true iff it should be
++   treated as a non-option.  */
++static int
++canon_doc_option (const char **name)
++{
++  int non_opt;
++  /* Skip initial whitespace.  */
++  while (isspace (**name))
++    (*name)++;
++  /* Decide whether this looks like an option (leading `-') or not.  */
++  non_opt = (**name != '-');
++  /* Skip until part of name used for sorting.  */
++  while (**name && !isalnum (**name))
++    (*name)++;
++  return non_opt;
++}
++
++/* Order ENTRY1 & ENTRY2 by the order which they should appear in a help
++   listing.  */
++static int
++hol_entry_cmp (const struct hol_entry *entry1,
++              const struct hol_entry *entry2)
++{
++  /* The group numbers by which the entries should be ordered; if either is
++     in a cluster, then this is just the group within the cluster.  */
++  int group1 = entry1->group, group2 = entry2->group;
++
++  if (entry1->cluster != entry2->cluster)
++    {
++      /* The entries are not within the same cluster, so we can't compare them
++        directly, we have to use the appropiate clustering level too.  */
++      if (! entry1->cluster)
++       /* ENTRY1 is at the `base level', not in a cluster, so we have to
++          compare it's group number with that of the base cluster in which
++          ENTRY2 resides.  Note that if they're in the same group, the
++          clustered option always comes laster.  */
++       return group_cmp (group1, hol_cluster_base (entry2->cluster)->group, -1);
++      else if (! entry2->cluster)
++       /* Likewise, but ENTRY2's not in a cluster.  */
++       return group_cmp (hol_cluster_base (entry1->cluster)->group, group2, 1);
++      else
++       /* Both entries are in clusters, we can just compare the clusters.  */
++       return hol_cluster_cmp (entry1->cluster, entry2->cluster);
++    }
++  else if (group1 == group2)
++    /* The entries are both in the same cluster and group, so compare them
++       alphabetically.  */
++    {
++      int short1 = hol_entry_first_short (entry1);
++      int short2 = hol_entry_first_short (entry2);
++      int doc1 = odoc (entry1->opt);
++      int doc2 = odoc (entry2->opt);
++      const char *long1 = hol_entry_first_long (entry1);
++      const char *long2 = hol_entry_first_long (entry2);
++
++      if (doc1)
++       doc1 = long1 != NULL && canon_doc_option (&long1);
++      if (doc2)
++       doc2 = long2 != NULL && canon_doc_option (&long2);
++
++      if (doc1 != doc2)
++       /* `documentation' options always follow normal options (or
++          documentation options that *look* like normal options).  */
++       return doc1 - doc2;
++      else if (!short1 && !short2 && long1 && long2)
++       /* Only long options.  */
++       return strcasecmp (long1, long2);
++      else
++       /* Compare short/short, long/short, short/long, using the first
++          character of long options.  Entries without *any* valid
++          options (such as options with OPTION_HIDDEN set) will be put
++          first, but as they're not displayed, it doesn't matter where
++          they are.  */
++       {
++         char first1 = short1 ? short1 : long1 ? *long1 : 0;
++         char first2 = short2 ? short2 : long2 ? *long2 : 0;
++#ifdef _tolower
++         int lower_cmp = _tolower (first1) - _tolower (first2);
++#else
++         int lower_cmp = tolower (first1) - tolower (first2);
++#endif
++         /* Compare ignoring case, except when the options are both the
++            same letter, in which case lower-case always comes first.  */
++         return lower_cmp ? lower_cmp : first2 - first1;
++       }
++    }
++  else
++    /* Within the same cluster, but not the same group, so just compare
++       groups.  */
++    return group_cmp (group1, group2, 0);
++}
++
++/* Version of hol_entry_cmp with correct signature for qsort.  */
++static int
++hol_entry_qcmp (const void *entry1_v, const void *entry2_v)
++{
++  return hol_entry_cmp (entry1_v, entry2_v);
++}
++
++/* Sort HOL by group and alphabetically by option name (with short options
++   taking precedence over long).  Since the sorting is for display purposes
++   only, the shadowing of options isn't effected.  */
++static void
++hol_sort (struct hol *hol)
++{
++  if (hol->num_entries > 0)
++    qsort (hol->entries, hol->num_entries, sizeof (struct hol_entry),
++          hol_entry_qcmp);
++}
++
++/* Append MORE to HOL, destroying MORE in the process.  Options in HOL shadow
++   any in MORE with the same name.  */
++static void
++hol_append (struct hol *hol, struct hol *more)
++{
++  struct hol_cluster **cl_end = &hol->clusters;
++
++  /* Steal MORE's cluster list, and add it to the end of HOL's.  */
++  while (*cl_end)
++    cl_end = &(*cl_end)->next;
++  *cl_end = more->clusters;
++  more->clusters = 0;
++
++  /* Merge entries.  */
++  if (more->num_entries > 0)
++    {
++      if (hol->num_entries == 0)
++       {
++         hol->num_entries = more->num_entries;
++         hol->entries = more->entries;
++         hol->short_options = more->short_options;
++         more->num_entries = 0;        /* Mark MORE's fields as invalid.  */
++       }
++      else
++       /* Append the entries in MORE to those in HOL, taking care to only add
++          non-shadowed SHORT_OPTIONS values.  */
++       {
++         unsigned left;
++         char *so, *more_so;
++         struct hol_entry *e;
++         unsigned num_entries = hol->num_entries + more->num_entries;
++         struct hol_entry *entries =
++           malloc (num_entries * sizeof (struct hol_entry));
++         unsigned hol_so_len = strlen (hol->short_options);
++         char *short_options =
++           malloc (hol_so_len + strlen (more->short_options) + 1);
++
++         assert (entries && short_options);
++#if SIZE_MAX <= UINT_MAX
++         assert (num_entries <= SIZE_MAX / sizeof (struct hol_entry));
++#endif
++
++         mempcpy (mempcpy (entries, hol->entries,
++                               hol->num_entries * sizeof (struct hol_entry)),
++                    more->entries,
++                    more->num_entries * sizeof (struct hol_entry));
++
++         mempcpy (short_options, hol->short_options, hol_so_len);
++
++         /* Fix up the short options pointers from HOL.  */
++         for (e = entries, left = hol->num_entries; left > 0; e++, left--)
++           e->short_options += (short_options - hol->short_options);
++
++         /* Now add the short options from MORE, fixing up its entries
++            too.  */
++         so = short_options + hol_so_len;
++         more_so = more->short_options;
++         for (left = more->num_entries; left > 0; e++, left--)
++           {
++             int opts_left;
++             const struct argp_option *opt;
++
++             e->short_options = so;
++
++             for (opts_left = e->num, opt = e->opt; opts_left; opt++, opts_left--)
++               {
++                 int ch = *more_so;
++                 if (oshort (opt) && ch == opt->key)
++                   /* The next short option in MORE_SO, CH, is from OPT.  */
++                   {
++                     if (! find_char (ch, short_options,
++                                      short_options + hol_so_len))
++                       /* The short option CH isn't shadowed by HOL's options,
++                          so add it to the sum.  */
++                       *so++ = ch;
++                     more_so++;
++                   }
++               }
++           }
++
++         *so = '\0';
++
++         free (hol->entries);
++         free (hol->short_options);
++
++         hol->entries = entries;
++         hol->num_entries = num_entries;
++         hol->short_options = short_options;
++       }
++    }
++
++  hol_free (more);
++}
++
++/* Inserts enough spaces to make sure STREAM is at column COL.  */
++static void
++indent_to (argp_fmtstream_t stream, unsigned col)
++{
++  int needed = col - __argp_fmtstream_point (stream);
++  while (needed-- > 0)
++    __argp_fmtstream_putc (stream, ' ');
++}
++
++/* Output to STREAM either a space, or a newline if there isn't room for at
++   least ENSURE characters before the right margin.  */
++static void
++space (argp_fmtstream_t stream, size_t ensure)
++{
++  if (__argp_fmtstream_point (stream) + ensure
++      >= __argp_fmtstream_rmargin (stream))
++    __argp_fmtstream_putc (stream, '\n');
++  else
++    __argp_fmtstream_putc (stream, ' ');
++}
++
++/* If the option REAL has an argument, we print it in using the printf
++   format REQ_FMT or OPT_FMT depending on whether it's a required or
++   optional argument.  */
++static void
++arg (const struct argp_option *real, const char *req_fmt, const char *opt_fmt,
++     const char *domain, argp_fmtstream_t stream)
++{
++  if (real->arg)
++    {
++      if (real->flags & OPTION_ARG_OPTIONAL)
++       __argp_fmtstream_printf (stream, opt_fmt,
++                                dgettext (domain, real->arg));
++      else
++       __argp_fmtstream_printf (stream, req_fmt,
++                                dgettext (domain, real->arg));
++    }
++}
++
++/* Helper functions for hol_entry_help.  */
++
++/* State used during the execution of hol_help.  */
++struct hol_help_state
++{
++  /* PREV_ENTRY should contain the previous entry printed, or 0.  */
++  struct hol_entry *prev_entry;
++
++  /* If an entry is in a different group from the previous one, and SEP_GROUPS
++     is true, then a blank line will be printed before any output. */
++  int sep_groups;
++
++  /* True if a duplicate option argument was suppressed (only ever set if
++     UPARAMS.dup_args is false).  */
++  int suppressed_dup_arg;
++};
++
++/* Some state used while printing a help entry (used to communicate with
++   helper functions).  See the doc for hol_entry_help for more info, as most
++   of the fields are copied from its arguments.  */
++struct pentry_state
++{
++  const struct hol_entry *entry;
++  argp_fmtstream_t stream;
++  struct hol_help_state *hhstate;
++
++  /* True if nothing's been printed so far.  */
++  int first;
++
++  /* If non-zero, the state that was used to print this help.  */
++  const struct argp_state *state;
++};
++
++/* If a user doc filter should be applied to DOC, do so.  */
++static const char *
++filter_doc (const char *doc, int key, const struct argp *argp,
++           const struct argp_state *state)
++{
++  if (argp && argp->help_filter)
++    /* We must apply a user filter to this output.  */
++    {
++      void *input = __argp_input (argp, state);
++      return (*argp->help_filter) (key, doc, input);
++    }
++  else
++    /* No filter.  */
++    return doc;
++}
++
++/* Prints STR as a header line, with the margin lines set appropiately, and
++   notes the fact that groups should be separated with a blank line.  ARGP is
++   the argp that should dictate any user doc filtering to take place.  Note
++   that the previous wrap margin isn't restored, but the left margin is reset
++   to 0.  */
++static void
++print_header (const char *str, const struct argp *argp,
++             struct pentry_state *pest)
++{
++  const char *tstr = dgettext (argp->argp_domain, str);
++  const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_HEADER, argp, pest->state);
++
++  if (fstr)
++    {
++      if (*fstr)
++       {
++         if (pest->hhstate->prev_entry)
++           /* Precede with a blank line.  */
++           __argp_fmtstream_putc (pest->stream, '\n');
++         indent_to (pest->stream, uparams.header_col);
++         __argp_fmtstream_set_lmargin (pest->stream, uparams.header_col);
++         __argp_fmtstream_set_wmargin (pest->stream, uparams.header_col);
++         __argp_fmtstream_puts (pest->stream, fstr);
++         __argp_fmtstream_set_lmargin (pest->stream, 0);
++         __argp_fmtstream_putc (pest->stream, '\n');
++       }
++
++      pest->hhstate->sep_groups = 1; /* Separate subsequent groups. */
++    }
++
++  if (fstr != tstr)
++    free ((char *) fstr);
++}
++
++/* Inserts a comma if this isn't the first item on the line, and then makes
++   sure we're at least to column COL.  If this *is* the first item on a line,
++   prints any pending whitespace/headers that should precede this line. Also
++   clears FIRST.  */
++static void
++comma (unsigned col, struct pentry_state *pest)
++{
++  if (pest->first)
++    {
++      const struct hol_entry *pe = pest->hhstate->prev_entry;
++      const struct hol_cluster *cl = pest->entry->cluster;
++
++      if (pest->hhstate->sep_groups && pe && pest->entry->group != pe->group)
++       __argp_fmtstream_putc (pest->stream, '\n');
++
++      if (cl && cl->header && *cl->header
++         && (!pe
++             || (pe->cluster != cl
++                 && !hol_cluster_is_child (pe->cluster, cl))))
++       /* If we're changing clusters, then this must be the start of the
++          ENTRY's cluster unless that is an ancestor of the previous one
++          (in which case we had just popped into a sub-cluster for a bit).
++          If so, then print the cluster's header line.  */
++       {
++         int old_wm = __argp_fmtstream_wmargin (pest->stream);
++         print_header (cl->header, cl->argp, pest);
++         __argp_fmtstream_set_wmargin (pest->stream, old_wm);
++       }
++
++      pest->first = 0;
++    }
++  else
++    __argp_fmtstream_puts (pest->stream, ", ");
++
++  indent_to (pest->stream, col);
++}
++
++/* Print help for ENTRY to STREAM.  */
++static void
++hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
++               argp_fmtstream_t stream, struct hol_help_state *hhstate)
++{
++  unsigned num;
++  const struct argp_option *real = entry->opt, *opt;
++  char *so = entry->short_options;
++  int have_long_opt = 0;       /* We have any long options.  */
++  /* Saved margins.  */
++  int old_lm = __argp_fmtstream_set_lmargin (stream, 0);
++  int old_wm = __argp_fmtstream_wmargin (stream);
++  /* PEST is a state block holding some of our variables that we'd like to
++     share with helper functions.  */
++  struct pentry_state pest = { entry, stream, hhstate, 1, state };
++
++  if (! odoc (real))
++    for (opt = real, num = entry->num; num > 0; opt++, num--)
++      if (opt->name && ovisible (opt))
++       {
++         have_long_opt = 1;
++         break;
++       }
++
++  /* First emit short options.  */
++  __argp_fmtstream_set_wmargin (stream, uparams.short_opt_col); /* For truly bizarre cases. */
++  for (opt = real, num = entry->num; num > 0; opt++, num--)
++    if (oshort (opt) && opt->key == *so)
++      /* OPT has a valid (non shadowed) short option.  */
++      {
++       if (ovisible (opt))
++         {
++           comma (uparams.short_opt_col, &pest);
++           __argp_fmtstream_putc (stream, '-');
++           __argp_fmtstream_putc (stream, *so);
++           if (!have_long_opt || uparams.dup_args)
++             arg (real, " %s", "[%s]",
++                  state == NULL ? NULL : state->root_argp->argp_domain,
++                  stream);
++           else if (real->arg)
++             hhstate->suppressed_dup_arg = 1;
++         }
++       so++;
++      }
++
++  /* Now, long options.  */
++  if (odoc (real))
++    /* A `documentation' option.  */
++    {
++      __argp_fmtstream_set_wmargin (stream, uparams.doc_opt_col);
++      for (opt = real, num = entry->num; num > 0; opt++, num--)
++       if (opt->name && ovisible (opt))
++         {
++           comma (uparams.doc_opt_col, &pest);
++           /* Calling gettext here isn't quite right, since sorting will
++              have been done on the original; but documentation options
++              should be pretty rare anyway...  */
++           __argp_fmtstream_puts (stream,
++                                  dgettext (state == NULL ? NULL
++                                            : state->root_argp->argp_domain,
++                                            opt->name));
++         }
++    }
++  else
++    /* A real long option.  */
++    {
++      __argp_fmtstream_set_wmargin (stream, uparams.long_opt_col);
++      for (opt = real, num = entry->num; num > 0; opt++, num--)
++       if (opt->name && ovisible (opt))
++         {
++           comma (uparams.long_opt_col, &pest);
++           __argp_fmtstream_printf (stream, "--%s", opt->name);
++           arg (real, "=%s", "[=%s]",
++                state == NULL ? NULL : state->root_argp->argp_domain, stream);
++         }
++    }
++
++  /* Next, documentation strings.  */
++  __argp_fmtstream_set_lmargin (stream, 0);
++
++  if (pest.first)
++    {
++      /* Didn't print any switches, what's up?  */
++      if (!oshort (real) && !real->name)
++       /* This is a group header, print it nicely.  */
++       print_header (real->doc, entry->argp, &pest);
++      else
++       /* Just a totally shadowed option or null header; print nothing.  */
++       goto cleanup;           /* Just return, after cleaning up.  */
++    }
++  else
++    {
++      const char *tstr = real->doc ? dgettext (state == NULL ? NULL
++                                              : state->root_argp->argp_domain,
++                                              real->doc) : 0;
++      const char *fstr = filter_doc (tstr, real->key, entry->argp, state);
++      if (fstr && *fstr)
++       {
++         unsigned int col = __argp_fmtstream_point (stream);
++
++         __argp_fmtstream_set_lmargin (stream, uparams.opt_doc_col);
++         __argp_fmtstream_set_wmargin (stream, uparams.opt_doc_col);
++
++         if (col > (unsigned int) (uparams.opt_doc_col + 3))
++           __argp_fmtstream_putc (stream, '\n');
++         else if (col >= (unsigned int) uparams.opt_doc_col)
++           __argp_fmtstream_puts (stream, "   ");
++         else
++           indent_to (stream, uparams.opt_doc_col);
++
++         __argp_fmtstream_puts (stream, fstr);
++       }
++      if (fstr && fstr != tstr)
++       free ((char *) fstr);
++
++      /* Reset the left margin.  */
++      __argp_fmtstream_set_lmargin (stream, 0);
++      __argp_fmtstream_putc (stream, '\n');
++    }
++
++  hhstate->prev_entry = entry;
++
++cleanup:
++  __argp_fmtstream_set_lmargin (stream, old_lm);
++  __argp_fmtstream_set_wmargin (stream, old_wm);
++}
++
++/* Output a long help message about the options in HOL to STREAM.  */
++static void
++hol_help (struct hol *hol, const struct argp_state *state,
++         argp_fmtstream_t stream)
++{
++  unsigned num;
++  struct hol_entry *entry;
++  struct hol_help_state hhstate = { 0, 0, 0 };
++
++  for (entry = hol->entries, num = hol->num_entries; num > 0; entry++, num--)
++    hol_entry_help (entry, state, stream, &hhstate);
++
++  if (hhstate.suppressed_dup_arg && uparams.dup_args_note)
++    {
++      const char *tstr = dgettext (state == NULL ? NULL
++                                  : state->root_argp->argp_domain, "\
++Mandatory or optional arguments to long options are also mandatory or \
++optional for any corresponding short options.");
++      const char *fstr = filter_doc (tstr, ARGP_KEY_HELP_DUP_ARGS_NOTE,
++                                    state ? state->root_argp : 0, state);
++      if (fstr && *fstr)
++       {
++         __argp_fmtstream_putc (stream, '\n');
++         __argp_fmtstream_puts (stream, fstr);
++         __argp_fmtstream_putc (stream, '\n');
++       }
++      if (fstr && fstr != tstr)
++       free ((char *) fstr);
++    }
++}
++
++/* Helper functions for hol_usage.  */
++
++/* If OPT is a short option without an arg, append its key to the string
++   pointer pointer to by COOKIE, and advance the pointer.  */
++static int
++add_argless_short_opt (const struct argp_option *opt,
++                      const struct argp_option *real,
++                      const char *domain, void *cookie)
++{
++  char **snao_end = cookie;
++  if (!(opt->arg || real->arg)
++      && !((opt->flags | real->flags) & OPTION_NO_USAGE))
++    *(*snao_end)++ = opt->key;
++  return 0;
++}
++
++/* If OPT is a short option with an arg, output a usage entry for it to the
++   stream pointed at by COOKIE.  */
++static int
++usage_argful_short_opt (const struct argp_option *opt,
++                       const struct argp_option *real,
++                       const char *domain, void *cookie)
++{
++  argp_fmtstream_t stream = cookie;
++  const char *arg = opt->arg;
++  int flags = opt->flags | real->flags;
++
++  if (! arg)
++    arg = real->arg;
++
++  if (arg && !(flags & OPTION_NO_USAGE))
++    {
++      arg = dgettext (domain, arg);
++
++      if (flags & OPTION_ARG_OPTIONAL)
++       __argp_fmtstream_printf (stream, " [-%c[%s]]", opt->key, arg);
++      else
++       {
++         /* Manually do line wrapping so that it (probably) won't
++            get wrapped at the embedded space.  */
++         space (stream, 6 + strlen (arg));
++         __argp_fmtstream_printf (stream, "[-%c %s]", opt->key, arg);
++       }
++    }
++
++  return 0;
++}
++
++/* Output a usage entry for the long option opt to the stream pointed at by
++   COOKIE.  */
++static int
++usage_long_opt (const struct argp_option *opt,
++               const struct argp_option *real,
++               const char *domain, void *cookie)
++{
++  argp_fmtstream_t stream = cookie;
++  const char *arg = opt->arg;
++  int flags = opt->flags | real->flags;
++
++  if (! arg)
++    arg = real->arg;
++
++  if (! (flags & OPTION_NO_USAGE))
++    {
++      if (arg)
++       {
++         arg = dgettext (domain, arg);
++         if (flags & OPTION_ARG_OPTIONAL)
++           __argp_fmtstream_printf (stream, " [--%s[=%s]]", opt->name, arg);
++         else
++           __argp_fmtstream_printf (stream, " [--%s=%s]", opt->name, arg);
++       }
++      else
++       __argp_fmtstream_printf (stream, " [--%s]", opt->name);
++    }
++
++  return 0;
++}
++
++/* Print a short usage description for the arguments in HOL to STREAM.  */
++static void
++hol_usage (struct hol *hol, argp_fmtstream_t stream)
++{
++  if (hol->num_entries > 0)
++    {
++      unsigned nentries;
++      struct hol_entry *entry;
++      char *short_no_arg_opts = alloca (strlen (hol->short_options) + 1);
++      char *snao_end = short_no_arg_opts;
++
++      /* First we put a list of short options without arguments.  */
++      for (entry = hol->entries, nentries = hol->num_entries
++          ; nentries > 0
++          ; entry++, nentries--)
++       hol_entry_short_iterate (entry, add_argless_short_opt,
++                                entry->argp->argp_domain, &snao_end);
++      if (snao_end > short_no_arg_opts)
++       {
++         *snao_end++ = 0;
++         __argp_fmtstream_printf (stream, " [-%s]", short_no_arg_opts);
++       }
++
++      /* Now a list of short options *with* arguments.  */
++      for (entry = hol->entries, nentries = hol->num_entries
++          ; nentries > 0
++          ; entry++, nentries--)
++       hol_entry_short_iterate (entry, usage_argful_short_opt,
++                                entry->argp->argp_domain, stream);
++
++      /* Finally, a list of long options (whew!).  */
++      for (entry = hol->entries, nentries = hol->num_entries
++          ; nentries > 0
++          ; entry++, nentries--)
++       hol_entry_long_iterate (entry, usage_long_opt,
++                               entry->argp->argp_domain, stream);
++    }
++}
++
++/* Make a HOL containing all levels of options in ARGP.  CLUSTER is the
++   cluster in which ARGP's entries should be clustered, or 0.  */
++static struct hol *
++argp_hol (const struct argp *argp, struct hol_cluster *cluster)
++{
++  const struct argp_child *child = argp->children;
++  struct hol *hol = make_hol (argp, cluster);
++  if (child)
++    while (child->argp)
++      {
++       struct hol_cluster *child_cluster =
++         ((child->group || child->header)
++          /* Put CHILD->argp within its own cluster.  */
++          ? hol_add_cluster (hol, child->group, child->header,
++                             child - argp->children, cluster, argp)
++          /* Just merge it into the parent's cluster.  */
++          : cluster);
++       hol_append (hol, argp_hol (child->argp, child_cluster)) ;
++       child++;
++      }
++  return hol;
++}
++
++/* Calculate how many different levels with alternative args strings exist in
++   ARGP.  */
++static size_t
++argp_args_levels (const struct argp *argp)
++{
++  size_t levels = 0;
++  const struct argp_child *child = argp->children;
++
++  if (argp->args_doc && strchr (argp->args_doc, '\n'))
++    levels++;
++
++  if (child)
++    while (child->argp)
++      levels += argp_args_levels ((child++)->argp);
++
++  return levels;
++}
++
++/* Print all the non-option args documented in ARGP to STREAM.  Any output is
++   preceded by a space.  LEVELS is a pointer to a byte vector the length
++   returned by argp_args_levels; it should be initialized to zero, and
++   updated by this routine for the next call if ADVANCE is true.  True is
++   returned as long as there are more patterns to output.  */
++static int
++argp_args_usage (const struct argp *argp, const struct argp_state *state,
++                char **levels, int advance, argp_fmtstream_t stream)
++{
++  char *our_level = *levels;
++  int multiple = 0;
++  const struct argp_child *child = argp->children;
++  const char *tdoc = dgettext (argp->argp_domain, argp->args_doc), *nl = 0;
++  const char *fdoc = filter_doc (tdoc, ARGP_KEY_HELP_ARGS_DOC, argp, state);
++
++  if (fdoc)
++    {
++      const char *cp = fdoc;
++      nl = strchrnul (cp, '\n');
++      if (*nl != '\0')
++       /* This is a `multi-level' args doc; advance to the correct position
++          as determined by our state in LEVELS, and update LEVELS.  */
++       {
++         int i;
++         multiple = 1;
++         for (i = 0; i < *our_level; i++)
++           cp = nl + 1, nl = strchrnul (cp, '\n');
++         (*levels)++;
++       }
++
++      /* Manually do line wrapping so that it (probably) won't get wrapped at
++        any embedded spaces.  */
++      space (stream, 1 + nl - cp);
++
++      __argp_fmtstream_write (stream, cp, nl - cp);
++    }
++  if (fdoc && fdoc != tdoc)
++    free ((char *)fdoc);       /* Free user's modified doc string.  */
++
++  if (child)
++    while (child->argp)
++      advance = !argp_args_usage ((child++)->argp, state, levels, advance, stream);
++
++  if (advance && multiple)
++    {
++      /* Need to increment our level.  */
++      if (*nl)
++       /* There's more we can do here.  */
++       {
++         (*our_level)++;
++         advance = 0;          /* Our parent shouldn't advance also. */
++       }
++      else if (*our_level > 0)
++       /* We had multiple levels, but used them up; reset to zero.  */
++       *our_level = 0;
++    }
++
++  return !advance;
++}
++
++/* Print the documentation for ARGP to STREAM; if POST is false, then
++   everything preceeding a `\v' character in the documentation strings (or
++   the whole string, for those with none) is printed, otherwise, everything
++   following the `\v' character (nothing for strings without).  Each separate
++   bit of documentation is separated a blank line, and if PRE_BLANK is true,
++   then the first is as well.  If FIRST_ONLY is true, only the first
++   occurrence is output.  Returns true if anything was output.  */
++static int
++argp_doc (const struct argp *argp, const struct argp_state *state,
++         int post, int pre_blank, int first_only,
++         argp_fmtstream_t stream)
++{
++  const char *text;
++  const char *inp_text;
++  void *input = 0;
++  int anything = 0;
++  size_t inp_text_limit = 0;
++  const char *doc = dgettext (argp->argp_domain, argp->doc);
++  const struct argp_child *child = argp->children;
++
++  if (doc)
++    {
++      char *vt = strchr (doc, '\v');
++      inp_text = post ? (vt ? vt + 1 : 0) : doc;
++      inp_text_limit = (!post && vt) ? (vt - doc) : 0;
++    }
++  else
++    inp_text = 0;
++
++  if (argp->help_filter)
++    /* We have to filter the doc strings.  */
++    {
++      if (inp_text_limit)
++       /* Copy INP_TEXT so that it's nul-terminated.  */
++       inp_text = strndup (inp_text, inp_text_limit);
++      input = __argp_input (argp, state);
++      text =
++       (*argp->help_filter) (post
++                             ? ARGP_KEY_HELP_POST_DOC
++                             : ARGP_KEY_HELP_PRE_DOC,
++                             inp_text, input);
++    }
++  else
++    text = (const char *) inp_text;
++
++  if (text)
++    {
++      if (pre_blank)
++       __argp_fmtstream_putc (stream, '\n');
++
++      if (text == inp_text && inp_text_limit)
++       __argp_fmtstream_write (stream, inp_text, inp_text_limit);
++      else
++       __argp_fmtstream_puts (stream, text);
++
++      if (__argp_fmtstream_point (stream) > __argp_fmtstream_lmargin (stream))
++       __argp_fmtstream_putc (stream, '\n');
++
++      anything = 1;
++    }
++
++  if (text && text != inp_text)
++    free ((char *) text);      /* Free TEXT returned from the help filter.  */
++  if (inp_text && inp_text_limit && argp->help_filter)
++    free ((char *) inp_text);  /* We copied INP_TEXT, so free it now.  */
++
++  if (post && argp->help_filter)
++    /* Now see if we have to output a ARGP_KEY_HELP_EXTRA text.  */
++    {
++      text = (*argp->help_filter) (ARGP_KEY_HELP_EXTRA, 0, input);
++      if (text)
++       {
++         if (anything || pre_blank)
++           __argp_fmtstream_putc (stream, '\n');
++         __argp_fmtstream_puts (stream, text);
++         free ((char *) text);
++         if (__argp_fmtstream_point (stream)
++             > __argp_fmtstream_lmargin (stream))
++           __argp_fmtstream_putc (stream, '\n');
++         anything = 1;
++       }
++    }
++
++  if (child)
++    while (child->argp && !(first_only && anything))
++      anything |=
++       argp_doc ((child++)->argp, state,
++                 post, anything || pre_blank, first_only,
++                 stream);
++
++  return anything;
++}
++
++/* Output a usage message for ARGP to STREAM.  If called from
++   argp_state_help, STATE is the relevent parsing state.  FLAGS are from the
++   set ARGP_HELP_*.  NAME is what to use wherever a `program name' is
++   needed. */
++static void
++_help (const struct argp *argp, const struct argp_state *state, FILE *stream,
++       unsigned flags, char *name)
++{
++  int anything = 0;            /* Whether we've output anything.  */
++  struct hol *hol = 0;
++  argp_fmtstream_t fs;
++
++  if (! stream)
++    return;
++
++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
++  flockfile (stream);
++#endif
++
++  fill_in_uparams (state);
++
++  fs = __argp_make_fmtstream (stream, 0, uparams.rmargin, 0);
++  if (! fs)
++    {
++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
++      funlockfile (stream);
++#endif
++      return;
++    }
++
++  if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE | ARGP_HELP_LONG))
++    {
++      hol = argp_hol (argp, 0);
++
++      /* If present, these options always come last.  */
++      hol_set_group (hol, "help", -1);
++      hol_set_group (hol, "version", -1);
++
++      hol_sort (hol);
++    }
++
++  if (flags & (ARGP_HELP_USAGE | ARGP_HELP_SHORT_USAGE))
++    /* Print a short `Usage:' message.  */
++    {
++      int first_pattern = 1, more_patterns;
++      size_t num_pattern_levels = argp_args_levels (argp);
++      char *pattern_levels = alloca (num_pattern_levels);
++
++      memset (pattern_levels, 0, num_pattern_levels);
++
++      do
++       {
++         int old_lm;
++         int old_wm = __argp_fmtstream_set_wmargin (fs, uparams.usage_indent);
++         char *levels = pattern_levels;
++
++         if (first_pattern)
++           __argp_fmtstream_printf (fs, "%s %s",
++                                    dgettext (argp->argp_domain, "Usage:"),
++                                    name);
++         else
++           __argp_fmtstream_printf (fs, "%s %s",
++                                    dgettext (argp->argp_domain, "  or: "),
++                                    name);
++
++         /* We set the lmargin as well as the wmargin, because hol_usage
++            manually wraps options with newline to avoid annoying breaks.  */
++         old_lm = __argp_fmtstream_set_lmargin (fs, uparams.usage_indent);
++
++         if (flags & ARGP_HELP_SHORT_USAGE)
++           /* Just show where the options go.  */
++           {
++             if (hol->num_entries > 0)
++               __argp_fmtstream_puts (fs, dgettext (argp->argp_domain,
++                                                    " [OPTION...]"));
++           }
++         else
++           /* Actually print the options.  */
++           {
++             hol_usage (hol, fs);
++             flags |= ARGP_HELP_SHORT_USAGE; /* But only do so once.  */
++           }
++
++         more_patterns = argp_args_usage (argp, state, &levels, 1, fs);
++
++         __argp_fmtstream_set_wmargin (fs, old_wm);
++         __argp_fmtstream_set_lmargin (fs, old_lm);
++
++         __argp_fmtstream_putc (fs, '\n');
++         anything = 1;
++
++         first_pattern = 0;
++       }
++      while (more_patterns);
++    }
++
++  if (flags & ARGP_HELP_PRE_DOC)
++    anything |= argp_doc (argp, state, 0, 0, 1, fs);
++
++  if (flags & ARGP_HELP_SEE)
++    {
++      __argp_fmtstream_printf (fs, dgettext (argp->argp_domain, "\
++Try `%s --help' or `%s --usage' for more information.\n"),
++                              name, name);
++      anything = 1;
++    }
++
++  if (flags & ARGP_HELP_LONG)
++    /* Print a long, detailed help message.  */
++    {
++      /* Print info about all the options.  */
++      if (hol->num_entries > 0)
++       {
++         if (anything)
++           __argp_fmtstream_putc (fs, '\n');
++         hol_help (hol, state, fs);
++         anything = 1;
++       }
++    }
++
++  if (flags & ARGP_HELP_POST_DOC)
++    /* Print any documentation strings at the end.  */
++    anything |= argp_doc (argp, state, 1, anything, 0, fs);
++
++  if ((flags & ARGP_HELP_BUG_ADDR) && argp_program_bug_address)
++    {
++      if (anything)
++       __argp_fmtstream_putc (fs, '\n');
++      __argp_fmtstream_printf (fs, dgettext (argp->argp_domain,
++                                            "Report bugs to %s.\n"),
++                              argp_program_bug_address);
++      anything = 1;
++    }
++
++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
++  funlockfile (stream);
++#endif
++
++  if (hol)
++    hol_free (hol);
++
++  __argp_fmtstream_free (fs);
++}
++
++/* Output a usage message for ARGP to STREAM.  FLAGS are from the set
++   ARGP_HELP_*.  NAME is what to use wherever a `program name' is needed. */
++void argp_help (const struct argp *argp, FILE *stream,
++                 unsigned flags, char *name)
++{
++  _help (argp, 0, stream, flags, name);
++}
++
++char *
++__argp_short_program_name (void)
++{
++# ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
++/*
++ * uClibc provides both program_invocation_name and
++ * program_invocation_short_name
++ */
++ return (char *) program_invocation_short_name;
++# else
++  /* FIXME: What now? Miles suggests that it is better to use NULL,
++     but currently the value is passed on directly to fputs_unlocked,
++     so that requires more changes. */
++# if __GNUC__
++#  warning No reasonable value to return
++# endif /* __GNUC__ */
++  return "";
++# endif
++}
++
++/* Output, if appropriate, a usage message for STATE to STREAM.  FLAGS are
++   from the set ARGP_HELP_*.  */
++void
++argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags)
++{
++  if ((!state || ! (state->flags & ARGP_NO_ERRS)) && stream)
++    {
++      if (state && (state->flags & ARGP_LONG_ONLY))
++       flags |= ARGP_HELP_LONG_ONLY;
++
++      _help (state ? state->root_argp : 0, state, stream, flags,
++            state ? state->name : __argp_short_program_name ());
++
++      if (!state || ! (state->flags & ARGP_NO_EXIT))
++       {
++         if (flags & ARGP_HELP_EXIT_ERR)
++           exit (argp_err_exit_status);
++         if (flags & ARGP_HELP_EXIT_OK)
++           exit (0);
++       }
++  }
++}
++
++/* If appropriate, print the printf string FMT and following args, preceded
++   by the program name and `:', to stderr, and followed by a `Try ... --help'
++   message, then exit (1).  */
++void
++argp_error (const struct argp_state *state, const char *fmt, ...)
++{
++  if (!state || !(state->flags & ARGP_NO_ERRS))
++    {
++      FILE *stream = state ? state->err_stream : stderr;
++
++      if (stream)
++       {
++         va_list ap;
++
++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
++         flockfile (stream);
++#endif
++
++         va_start (ap, fmt);
++
++#if defined _LIBC && defined USE_IN_LIBIO
++         char *buf;
++
++         if (_IO_vasprintf (&buf, fmt, ap) < 0)
++           buf = NULL;
++
++         __fxprintf (stream, "%s: %s\n",
++                     state ? state->name : __argp_short_program_name (), buf);
++
++         free (buf);
++#else
++         fputs_unlocked (state ? state->name : __argp_short_program_name (),
++                         stream);
++         putc_unlocked (':', stream);
++         putc_unlocked (' ', stream);
++
++         vfprintf (stream, fmt, ap);
++
++         putc_unlocked ('\n', stream);
++#endif
++
++         argp_state_help (state, stream, ARGP_HELP_STD_ERR);
++
++         va_end (ap);
++
++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
++         funlockfile (stream);
++#endif
++       }
++    }
++}
++
++/* Similar to the standard gnu error-reporting function error(), but will
++   respect the ARGP_NO_EXIT and ARGP_NO_ERRS flags in STATE, and will print
++   to STATE->err_stream.  This is useful for argument parsing code that is
++   shared between program startup (when exiting is desired) and runtime
++   option parsing (when typically an error code is returned instead).  The
++   difference between this function and argp_error is that the latter is for
++   *parsing errors*, and the former is for other problems that occur during
++   parsing but don't reflect a (syntactic) problem with the input.  */
++void
++argp_failure (const struct argp_state *state, int status, int errnum,
++               const char *fmt, ...)
++{
++  if (!state || !(state->flags & ARGP_NO_ERRS))
++    {
++      FILE *stream = state ? state->err_stream : stderr;
++
++      if (stream)
++       {
++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
++         flockfile (stream);
++#endif
++
++#if defined _LIBC && defined USE_IN_LIBIO
++         __fxprintf (stream, "%s",
++                     state ? state->name : __argp_short_program_name ());
++#else
++         fputs_unlocked (state ? state->name : __argp_short_program_name (),
++                         stream);
++#endif
++
++         if (fmt)
++           {
++             va_list ap;
++
++             va_start (ap, fmt);
++#if defined _LIBC && defined USE_IN_LIBIO
++             char *buf;
++
++             if (_IO_vasprintf (&buf, fmt, ap) < 0)
++               buf = NULL;
++
++             __fxprintf (stream, ": %s", buf);
++
++             free (buf);
++#else
++             putc_unlocked (':', stream);
++             putc_unlocked (' ', stream);
++
++             vfprintf (stream, fmt, ap);
++#endif
++
++             va_end (ap);
++           }
++
++         if (errnum)
++           {
++#if (defined _LIBC && defined USE_IN_LIBIO) || defined HAVE_STRERROR_R
++             char buf[200];
++#endif
++#if defined _LIBC && defined USE_IN_LIBIO
++             __fxprintf (stream, ": %s",
++                         strerror_r (errnum, buf, sizeof (buf)));
++#else
++             putc_unlocked (':', stream);
++             putc_unlocked (' ', stream);
++# ifdef HAVE_STRERROR_R
++             fputs (strerror_r (errnum, buf, sizeof (buf)), stream);
++# else
++             fputs (strerror (errnum), stream);
++# endif
++#endif
++           }
++
++#ifdef USE_IN_LIBIO
++         if (_IO_fwide (stream, 0) > 0)
++           putwc_unlocked (L'\n', stream);
++         else
++#endif
++           putc_unlocked ('\n', stream);
++
++#if _LIBC || (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)
++         funlockfile (stream);
++#endif
++
++         if (status && (!state || !(state->flags & ARGP_NO_EXIT)))
++           exit (status);
++       }
++    }
++}
+diff --git a/libuargp/argp-parse.c b/libuargp/argp-parse.c
+new file mode 100644
+index 0000000..86b2b24
+--- /dev/null
++++ b/libuargp/argp-parse.c
+@@ -0,0 +1,949 @@
++/* Hierarchial argument parsing, layered over getopt
++   Copyright (C) 1995-2000, 2002, 2003, 2004 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.
++
++   Modified for uClibc by: Salvatore Cro <salvatore.cro at st.com>
++*/
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++/* AIX requires this to be the first thing in the file.  */
++#ifndef __GNUC__
++# if HAVE_ALLOCA_H || defined _LIBC
++#  include <alloca.h>
++# else
++#  ifdef _AIX
++#pragma alloca
++#  else
++#   ifndef alloca /* predefined by HP cc +Olibcalls */
++char *alloca ();
++#   endif
++#  endif
++# endif
++#endif
++
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++#include <limits.h>
++#include <getopt.h>
++#include <bits/getopt_int.h>
++
++#include <features.h>
++#ifndef _
++/* This is for other GNU distributions with internationalized messages.
++   When compiling libc, the _ macro is predefined.  */
++# if (defined HAVE_LIBINTL_H || defined _LIBC) && defined __UCLIBC_HAS_GETTEXT_AWARENESS__
++#  include <libintl.h>
++#  ifdef _LIBC
++#   undef dgettext
++#   define dgettext(domain, msgid) \
++  INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
++#  endif
++# else
++#  define dgettext(domain, msgid) (msgid)
++#  define gettext(msgid) (msgid)
++# endif
++#endif
++#ifndef N_
++# define N_(msgid) (msgid)
++#endif
++
++#include <argp.h>
++
++/* Getopt return values.  */
++#define KEY_END (-1)           /* The end of the options.  */
++#define KEY_ARG 1              /* A non-option argument.  */
++#define KEY_ERR '?'            /* An error parsing the options.  */
++
++/* The meta-argument used to prevent any further arguments being interpreted
++   as options.  */
++#define QUOTE "--"
++
++/* The number of bits we steal in a long-option value for our own use.  */
++#define GROUP_BITS CHAR_BIT
++
++/* The number of bits available for the user value.  */
++#define USER_BITS ((sizeof ((struct option *)0)->val * CHAR_BIT) - GROUP_BITS)
++#define USER_MASK ((1 << USER_BITS) - 1)
++
++/* EZ alias for ARGP_ERR_UNKNOWN.  */
++#define EBADKEY ARGP_ERR_UNKNOWN
++
++/* Default options.  */
++
++/* When argp is given the --HANG switch, _ARGP_HANG is set and argp will sleep
++   for one second intervals, decrementing _ARGP_HANG until it's zero.  Thus
++   you can force the program to continue by attaching a debugger and setting
++   it to 0 yourself.  */
++static volatile int _argp_hang;
++
++#define OPT_PROGNAME   -2
++#define OPT_USAGE      -3
++#define OPT_HANG       -4
++
++static const struct argp_option argp_default_options[] =
++{
++  {"help",       '?',          0, 0,  N_("Give this help list"), -1},
++  {"usage",      OPT_USAGE,    0, 0,  N_("Give a short usage message")},
++  {"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN, N_("Set the program name")},
++  {"HANG",       OPT_HANG,    "SECS", OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
++     N_("Hang for SECS seconds (default 3600)")},
++  {0, 0}
++};
++
++static error_t
++argp_default_parser (int key, char *arg, struct argp_state *state)
++{
++  switch (key)
++    {
++    case '?':
++      argp_state_help (state, state->out_stream, ARGP_HELP_STD_HELP);
++      break;
++    case OPT_USAGE:
++      argp_state_help (state, state->out_stream,
++                      ARGP_HELP_USAGE | ARGP_HELP_EXIT_OK);
++      break;
++
++    case OPT_PROGNAME:         /* Set the program name.  */
++#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_NAME
++      program_invocation_name = arg;
++#endif
++      /* [Note that some systems only have PROGRAM_INVOCATION_SHORT_NAME (aka
++        __PROGNAME), in which case, PROGRAM_INVOCATION_NAME is just defined
++        to be that, so we have to be a bit careful here.]  */
++
++      /* Update what we use for messages.  */
++      state->name = strrchr (arg, '/');
++      if (state->name)
++       state->name++;
++      else
++       state->name = arg;
++
++#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
++      program_invocation_short_name = state->name;
++#endif
++
++      if ((state->flags & (ARGP_PARSE_ARGV0 | ARGP_NO_ERRS))
++         == ARGP_PARSE_ARGV0)
++       /* Update what getopt uses too.  */
++       state->argv[0] = arg;
++
++      break;
++
++    case OPT_HANG:
++      _argp_hang = atoi (arg ? arg : "3600");
++      while (_argp_hang-- > 0)
++       sleep (1);
++      break;
++
++    default:
++      return EBADKEY;
++    }
++  return 0;
++}
++
++static const struct argp argp_default_argp =
++  {argp_default_options, &argp_default_parser, NULL, NULL, NULL, NULL, "libc"};
++
++
++static const struct argp_option argp_version_options[] =
++{
++  {"version",    'V',          0, 0,  N_("Print program version"), -1},
++  {0, 0}
++};
++
++static error_t
++argp_version_parser (int key, char *arg, struct argp_state *state)
++{
++  switch (key)
++    {
++    case 'V':
++      if (argp_program_version_hook)
++       (*argp_program_version_hook) (state->out_stream, state);
++      else if (argp_program_version)
++       fprintf (state->out_stream, "%s\n", argp_program_version);
++      else
++       argp_error (state, dgettext (state->root_argp->argp_domain,
++                                      "(PROGRAM ERROR) No version known!?"));
++      if (! (state->flags & ARGP_NO_EXIT))
++       exit (0);
++      break;
++    default:
++      return EBADKEY;
++    }
++  return 0;
++}
++
++static const struct argp argp_version_argp =
++  {argp_version_options, &argp_version_parser, NULL, NULL, NULL, NULL, "libc"};
++
++/* Returns the offset into the getopt long options array LONG_OPTIONS of a
++   long option with called NAME, or -1 if none is found.  Passing NULL as
++   NAME will return the number of options.  */
++static int
++find_long_option (struct option *long_options, const char *name)
++{
++  struct option *l = long_options;
++  while (l->name != NULL)
++    if (name != NULL && strcmp (l->name, name) == 0)
++      return l - long_options;
++    else
++      l++;
++  if (name == NULL)
++    return l - long_options;
++  else
++    return -1;
++}
++
++
++/* The state of a `group' during parsing.  Each group corresponds to a
++   particular argp structure from the tree of such descending from the top
++   level argp passed to argp_parse.  */
++struct group
++{
++  /* This group's parsing function.  */
++  argp_parser_t parser;
++
++  /* Which argp this group is from.  */
++  const struct argp *argp;
++
++  /* Points to the point in SHORT_OPTS corresponding to the end of the short
++     options for this group.  We use it to determine from which group a
++     particular short options is from.  */
++  char *short_end;
++
++  /* The number of non-option args sucessfully handled by this parser.  */
++  unsigned args_processed;
++
++  /* This group's parser's parent's group.  */
++  struct group *parent;
++  unsigned parent_index;       /* And the our position in the parent.   */
++
++  /* These fields are swapped into and out of the state structure when
++     calling this group's parser.  */
++  void *input, **child_inputs;
++  void *hook;
++};
++
++/* Call GROUP's parser with KEY and ARG, swapping any group-specific info
++   from STATE before calling, and back into state afterwards.  If GROUP has
++   no parser, EBADKEY is returned.  */
++static error_t
++group_parse (struct group *group, struct argp_state *state, int key, char *arg)
++{
++  if (group->parser)
++    {
++      error_t err;
++      state->hook = group->hook;
++      state->input = group->input;
++      state->child_inputs = group->child_inputs;
++      state->arg_num = group->args_processed;
++      err = (*group->parser)(key, arg, state);
++      group->hook = state->hook;
++      return err;
++    }
++  else
++    return EBADKEY;
++}
++
++struct parser
++{
++  const struct argp *argp;
++
++  /* SHORT_OPTS is the getopt short options string for the union of all the
++     groups of options.  */
++  char *short_opts;
++  /* LONG_OPTS is the array of getop long option structures for the union of
++     all the groups of options.  */
++  struct option *long_opts;
++  /* OPT_DATA is the getopt data used for the re-entrant getopt.  */
++  struct _getopt_data opt_data;
++
++  /* States of the various parsing groups.  */
++  struct group *groups;
++  /* The end of the GROUPS array.  */
++  struct group *egroup;
++  /* An vector containing storage for the CHILD_INPUTS field in all groups.  */
++  void **child_inputs;
++
++  /* True if we think using getopt is still useful; if false, then
++     remaining arguments are just passed verbatim with ARGP_KEY_ARG.  This is
++     cleared whenever getopt returns KEY_END, but may be set again if the user
++     moves the next argument pointer backwards.  */
++  int try_getopt;
++
++  /* State block supplied to parsing routines.  */
++  struct argp_state state;
++
++  /* Memory used by this parser.  */
++  void *storage;
++};
++
++/* The next usable entries in the various parser tables being filled in by
++   convert_options.  */
++struct parser_convert_state
++{
++  struct parser *parser;
++  char *short_end;
++  struct option *long_end;
++  void **child_inputs_end;
++};
++
++/* Converts all options in ARGP (which is put in GROUP) and ancestors
++   into getopt options stored in SHORT_OPTS and LONG_OPTS; SHORT_END and
++   CVT->LONG_END are the points at which new options are added.  Returns the
++   next unused group entry.  CVT holds state used during the conversion.  */
++static struct group *
++convert_options (const struct argp *argp,
++                struct group *parent, unsigned parent_index,
++                struct group *group, struct parser_convert_state *cvt)
++{
++  /* REAL is the most recent non-alias value of OPT.  */
++  const struct argp_option *real = argp->options;
++  const struct argp_child *children = argp->children;
++
++  if (real || argp->parser)
++    {
++      const struct argp_option *opt;
++
++      if (real)
++       for (opt = real; !__option_is_end (opt); opt++)
++         {
++           if (! (opt->flags & OPTION_ALIAS))
++             /* OPT isn't an alias, so we can use values from it.  */
++             real = opt;
++
++           if (! (real->flags & OPTION_DOC))
++             /* A real option (not just documentation).  */
++             {
++               if (__option_is_short (opt))
++                 /* OPT can be used as a short option.  */
++                 {
++                   *cvt->short_end++ = opt->key;
++                   if (real->arg)
++                     {
++                       *cvt->short_end++ = ':';
++                       if (real->flags & OPTION_ARG_OPTIONAL)
++                         *cvt->short_end++ = ':';
++                     }
++                   *cvt->short_end = '\0'; /* keep 0 terminated */
++                 }
++
++               if (opt->name
++                   && find_long_option (cvt->parser->long_opts, opt->name) < 0)
++                 /* OPT can be used as a long option.  */
++                 {
++                   cvt->long_end->name = opt->name;
++                   cvt->long_end->has_arg =
++                     (real->arg
++                      ? (real->flags & OPTION_ARG_OPTIONAL
++                         ? optional_argument
++                         : required_argument)
++                      : no_argument);
++                   cvt->long_end->flag = 0;
++                   /* we add a disambiguating code to all the user's
++                      values (which is removed before we actually call
++                      the function to parse the value); this means that
++                      the user loses use of the high 8 bits in all his
++                      values (the sign of the lower bits is preserved
++                      however)...  */
++                   cvt->long_end->val =
++                     ((opt->key | real->key) & USER_MASK)
++                     + (((group - cvt->parser->groups) + 1) << USER_BITS);
++
++                   /* Keep the LONG_OPTS list terminated.  */
++                   (++cvt->long_end)->name = NULL;
++                 }
++             }
++           }
++
++      group->parser = argp->parser;
++      group->argp = argp;
++      group->short_end = cvt->short_end;
++      group->args_processed = 0;
++      group->parent = parent;
++      group->parent_index = parent_index;
++      group->input = 0;
++      group->hook = 0;
++      group->child_inputs = 0;
++
++      if (children)
++       /* Assign GROUP's CHILD_INPUTS field some space from
++           CVT->child_inputs_end.*/
++       {
++         unsigned num_children = 0;
++         while (children[num_children].argp)
++           num_children++;
++         group->child_inputs = cvt->child_inputs_end;
++         cvt->child_inputs_end += num_children;
++       }
++
++      parent = group++;
++    }
++  else
++    parent = 0;
++
++  if (children)
++    {
++      unsigned index = 0;
++      while (children->argp)
++       group =
++         convert_options (children++->argp, parent, index++, group, cvt);
++    }
++
++  return group;
++}
++
++/* Find the merged set of getopt options, with keys appropiately prefixed. */
++static void
++parser_convert (struct parser *parser, const struct argp *argp, int flags)
++{
++  struct parser_convert_state cvt;
++
++  cvt.parser = parser;
++  cvt.short_end = parser->short_opts;
++  cvt.long_end = parser->long_opts;
++  cvt.child_inputs_end = parser->child_inputs;
++
++  if (flags & ARGP_IN_ORDER)
++    *cvt.short_end++ = '-';
++  else if (flags & ARGP_NO_ARGS)
++    *cvt.short_end++ = '+';
++  *cvt.short_end = '\0';
++
++  cvt.long_end->name = NULL;
++
++  parser->argp = argp;
++
++  if (argp)
++    parser->egroup = convert_options (argp, 0, 0, parser->groups, &cvt);
++  else
++    parser->egroup = parser->groups; /* No parsers at all! */
++}
++
++/* Lengths of various parser fields which we will allocated.  */
++struct parser_sizes
++{
++  size_t short_len;            /* Getopt short options string.  */
++  size_t long_len;             /* Getopt long options vector.  */
++  size_t num_groups;           /* Group structures we allocate.  */
++  size_t num_child_inputs;     /* Child input slots.  */
++};
++
++/* For ARGP, increments the NUM_GROUPS field in SZS by the total number of
++ argp structures descended from it, and the SHORT_LEN & LONG_LEN fields by
++ the maximum lengths of the resulting merged getopt short options string and
++ long-options array, respectively.  */
++static void
++calc_sizes (const struct argp *argp,  struct parser_sizes *szs)
++{
++  const struct argp_child *child = argp->children;
++  const struct argp_option *opt = argp->options;
++
++  if (opt || argp->parser)
++    {
++      szs->num_groups++;
++      if (opt)
++       {
++         int num_opts = 0;
++         while (!__option_is_end (opt++))
++           num_opts++;
++         szs->short_len += num_opts * 3; /* opt + up to 2 `:'s */
++         szs->long_len += num_opts;
++       }
++    }
++
++  if (child)
++    while (child->argp)
++      {
++       calc_sizes ((child++)->argp, szs);
++       szs->num_child_inputs++;
++      }
++}
++
++
++extern char * __argp_short_program_name (void);
++/* Initializes PARSER to parse ARGP in a manner described by FLAGS.  */
++static error_t
++parser_init (struct parser *parser, const struct argp *argp,
++            int argc, char **argv, int flags, void *input)
++{
++  error_t err = 0;
++  struct group *group;
++  struct parser_sizes szs;
++  struct _getopt_data opt_data = _GETOPT_DATA_INITIALIZER;
++
++  szs.short_len = (flags & ARGP_NO_ARGS) ? 0 : 1;
++  szs.long_len = 0;
++  szs.num_groups = 0;
++  szs.num_child_inputs = 0;
++
++  if (argp)
++    calc_sizes (argp, &szs);
++
++  /* Lengths of the various bits of storage used by PARSER.  */
++#define GLEN (szs.num_groups + 1) * sizeof (struct group)
++#define CLEN (szs.num_child_inputs * sizeof (void *))
++#define LLEN ((szs.long_len + 1) * sizeof (struct option))
++#define SLEN (szs.short_len + 1)
++
++  parser->storage = malloc (GLEN + CLEN + LLEN + SLEN);
++  if (! parser->storage)
++    return ENOMEM;
++
++  parser->groups = parser->storage;
++  parser->child_inputs = parser->storage + GLEN;
++  parser->long_opts = parser->storage + GLEN + CLEN;
++  parser->short_opts = parser->storage + GLEN + CLEN + LLEN;
++  parser->opt_data = opt_data;
++
++  memset (parser->child_inputs, 0, szs.num_child_inputs * sizeof (void *));
++  parser_convert (parser, argp, flags);
++
++  memset (&parser->state, 0, sizeof (struct argp_state));
++  parser->state.root_argp = parser->argp;
++  parser->state.argc = argc;
++  parser->state.argv = argv;
++  parser->state.flags = flags;
++  parser->state.err_stream = stderr;
++  parser->state.out_stream = stdout;
++  parser->state.next = 0;      /* Tell getopt to initialize.  */
++  parser->state.pstate = parser;
++
++  parser->try_getopt = 1;
++
++  /* Call each parser for the first time, giving it a chance to propagate
++     values to child parsers.  */
++  if (parser->groups < parser->egroup)
++    parser->groups->input = input;
++  for (group = parser->groups;
++       group < parser->egroup && (!err || err == EBADKEY);
++       group++)
++    {
++      if (group->parent)
++       /* If a child parser, get the initial input value from the parent. */
++       group->input = group->parent->child_inputs[group->parent_index];
++
++      if (!group->parser
++         && group->argp->children && group->argp->children->argp)
++       /* For the special case where no parsing function is supplied for an
++          argp, propagate its input to its first child, if any (this just
++          makes very simple wrapper argps more convenient).  */
++       group->child_inputs[0] = group->input;
++
++      err = group_parse (group, &parser->state, ARGP_KEY_INIT, 0);
++    }
++  if (err == EBADKEY)
++    err = 0;                   /* Some parser didn't understand.  */
++
++  if (err)
++    return err;
++
++  if (parser->state.flags & ARGP_NO_ERRS)
++    {
++      parser->opt_data.opterr = 0;
++      if (parser->state.flags & ARGP_PARSE_ARGV0)
++       /* getopt always skips ARGV[0], so we have to fake it out.  As long
++          as OPTERR is 0, then it shouldn't actually try to access it.  */
++       parser->state.argv--, parser->state.argc++;
++    }
++  else
++    parser->opt_data.opterr = 1;       /* Print error messages.  */
++
++  if (parser->state.argv == argv && argv[0])
++    /* There's an argv[0]; use it for messages.  */
++    {
++      char *short_name = strrchr (argv[0], '/');
++      parser->state.name = short_name ? short_name + 1 : argv[0];
++    }
++  else
++    parser->state.name = __argp_short_program_name ();
++
++  return 0;
++}
++
++/* Free any storage consumed by PARSER (but not PARSER itself).  */
++static error_t
++parser_finalize (struct parser *parser,
++                error_t err, int arg_ebadkey, int *end_index)
++{
++  struct group *group;
++
++  if (err == EBADKEY && arg_ebadkey)
++    /* Suppress errors generated by unparsed arguments.  */
++    err = 0;
++
++  if (! err)
++    {
++      if (parser->state.next == parser->state.argc)
++       /* We successfully parsed all arguments!  Call all the parsers again,
++          just a few more times... */
++       {
++         for (group = parser->groups;
++              group < parser->egroup && (!err || err==EBADKEY);
++              group++)
++           if (group->args_processed == 0)
++             err = group_parse (group, &parser->state, ARGP_KEY_NO_ARGS, 0);
++         for (group = parser->egroup - 1;
++              group >= parser->groups && (!err || err==EBADKEY);
++              group--)
++           err = group_parse (group, &parser->state, ARGP_KEY_END, 0);
++
++         if (err == EBADKEY)
++           err = 0;            /* Some parser didn't understand.  */
++
++         /* Tell the user that all arguments are parsed.  */
++         if (end_index)
++           *end_index = parser->state.next;
++       }
++      else if (end_index)
++       /* Return any remaining arguments to the user.  */
++       *end_index = parser->state.next;
++      else
++       /* No way to return the remaining arguments, they must be bogus. */
++       {
++         if (!(parser->state.flags & ARGP_NO_ERRS)
++             && parser->state.err_stream)
++           fprintf (parser->state.err_stream,
++                    dgettext (parser->argp->argp_domain,
++                              "%s: Too many arguments\n"),
++                    parser->state.name);
++         err = EBADKEY;
++       }
++    }
++
++  /* Okay, we're all done, with either an error or success; call the parsers
++     to indicate which one.  */
++
++  if (err)
++    {
++      /* Maybe print an error message.  */
++      if (err == EBADKEY)
++       /* An appropriate message describing what the error was should have
++          been printed earlier.  */
++       argp_state_help (&parser->state, parser->state.err_stream,
++                          ARGP_HELP_STD_ERR);
++
++      /* Since we didn't exit, give each parser an error indication.  */
++      for (group = parser->groups; group < parser->egroup; group++)
++       group_parse (group, &parser->state, ARGP_KEY_ERROR, 0);
++    }
++  else
++    /* Notify parsers of success, and propagate back values from parsers.  */
++    {
++      /* We pass over the groups in reverse order so that child groups are
++        given a chance to do there processing before passing back a value to
++        the parent.  */
++      for (group = parser->egroup - 1
++          ; group >= parser->groups && (!err || err == EBADKEY)
++          ; group--)
++       err = group_parse (group, &parser->state, ARGP_KEY_SUCCESS, 0);
++      if (err == EBADKEY)
++       err = 0;                /* Some parser didn't understand.  */
++    }
++
++  /* Call parsers once more, to do any final cleanup.  Errors are ignored.  */
++  for (group = parser->egroup - 1; group >= parser->groups; group--)
++    group_parse (group, &parser->state, ARGP_KEY_FINI, 0);
++
++  if (err == EBADKEY)
++    err = EINVAL;
++
++  free (parser->storage);
++
++  return err;
++}
++
++/* Call the user parsers to parse the non-option argument VAL, at the current
++   position, returning any error.  The state NEXT pointer is assumed to have
++   been adjusted (by getopt) to point after this argument; this function will
++   adjust it correctly to reflect however many args actually end up being
++   consumed.  */
++static error_t
++parser_parse_arg (struct parser *parser, char *val)
++{
++  /* Save the starting value of NEXT, first adjusting it so that the arg
++     we're parsing is again the front of the arg vector.  */
++  int index = --parser->state.next;
++  error_t err = EBADKEY;
++  struct group *group;
++  int key = 0;                 /* Which of ARGP_KEY_ARG[S] we used.  */
++
++  /* Try to parse the argument in each parser.  */
++  for (group = parser->groups
++       ; group < parser->egroup && err == EBADKEY
++       ; group++)
++    {
++      parser->state.next++;    /* For ARGP_KEY_ARG, consume the arg.  */
++      key = ARGP_KEY_ARG;
++      err = group_parse (group, &parser->state, key, val);
++
++      if (err == EBADKEY)
++       /* This parser doesn't like ARGP_KEY_ARG; try ARGP_KEY_ARGS instead. */
++       {
++         parser->state.next--; /* For ARGP_KEY_ARGS, put back the arg.  */
++         key = ARGP_KEY_ARGS;
++         err = group_parse (group, &parser->state, key, 0);
++       }
++    }
++
++  if (! err)
++    {
++      if (key == ARGP_KEY_ARGS)
++       /* The default for ARGP_KEY_ARGS is to assume that if NEXT isn't
++          changed by the user, *all* arguments should be considered
++          consumed.  */
++       parser->state.next = parser->state.argc;
++
++      if (parser->state.next > index)
++       /* Remember that we successfully processed a non-option
++          argument -- but only if the user hasn't gotten tricky and set
++          the clock back.  */
++       (--group)->args_processed += (parser->state.next - index);
++      else
++       /* The user wants to reparse some args, give getopt another try.  */
++       parser->try_getopt = 1;
++    }
++
++  return err;
++}
++
++/* Call the user parsers to parse the option OPT, with argument VAL, at the
++   current position, returning any error.  */
++static error_t
++parser_parse_opt (struct parser *parser, int opt, char *val)
++{
++  /* The group key encoded in the high bits; 0 for short opts or
++     group_number + 1 for long opts.  */
++  int group_key = opt >> USER_BITS;
++  error_t err = EBADKEY;
++
++  if (group_key == 0)
++    /* A short option.  By comparing OPT's position in SHORT_OPTS to the
++       various starting positions in each group's SHORT_END field, we can
++       determine which group OPT came from.  */
++    {
++      struct group *group;
++      char *short_index = strchr (parser->short_opts, opt);
++
++      if (short_index)
++       for (group = parser->groups; group < parser->egroup; group++)
++         if (group->short_end > short_index)
++           {
++             err = group_parse (group, &parser->state, opt,
++                                parser->opt_data.optarg);
++             break;
++           }
++    }
++  else
++    /* A long option.  We use shifts instead of masking for extracting
++       the user value in order to preserve the sign.  */
++    err =
++      group_parse (&parser->groups[group_key - 1], &parser->state,
++                  (opt << GROUP_BITS) >> GROUP_BITS,
++                  parser->opt_data.optarg);
++
++  if (err == EBADKEY)
++    /* At least currently, an option not recognized is an error in the
++       parser, because we pre-compute which parser is supposed to deal
++       with each option.  */
++    {
++      static const char bad_key_err[] =
++       N_("(PROGRAM ERROR) Option should have been recognized!?");
++      if (group_key == 0)
++       argp_error (&parser->state, "-%c: %s", opt,
++                     dgettext (parser->argp->argp_domain, bad_key_err));
++      else
++       {
++         struct option *long_opt = parser->long_opts;
++         while (long_opt->val != opt && long_opt->name)
++           long_opt++;
++         argp_error (&parser->state, "--%s: %s",
++                       long_opt->name ? long_opt->name : "???",
++                       dgettext (parser->argp->argp_domain, bad_key_err));
++       }
++    }
++
++  return err;
++}
++
++/* Parse the next argument in PARSER (as indicated by PARSER->state.next).
++   Any error from the parsers is returned, and *ARGP_EBADKEY indicates
++   whether a value of EBADKEY is due to an unrecognized argument (which is
++   generally not fatal).  */
++static error_t
++parser_parse_next (struct parser *parser, int *arg_ebadkey)
++{
++  int opt;
++  error_t err = 0;
++
++  if (parser->state.quoted && parser->state.next < parser->state.quoted)
++    /* The next argument pointer has been moved to before the quoted
++       region, so pretend we never saw the quoting `--', and give getopt
++       another chance.  If the user hasn't removed it, getopt will just
++       process it again.  */
++    parser->state.quoted = 0;
++
++  if (parser->try_getopt && !parser->state.quoted)
++    /* Give getopt a chance to parse this.  */
++    {
++      /* Put it back in OPTIND for getopt.  */
++      parser->opt_data.optind = parser->state.next;
++      /* Distinguish KEY_ERR from a real option.  */
++      parser->opt_data.optopt = KEY_END;
++      if (parser->state.flags & ARGP_LONG_ONLY)
++       opt = _getopt_long_only_r (parser->state.argc, parser->state.argv,
++                                  parser->short_opts, parser->long_opts, 0,
++                                  &parser->opt_data);
++      else
++       opt = _getopt_long_r (parser->state.argc, parser->state.argv,
++                             parser->short_opts, parser->long_opts, 0,
++                             &parser->opt_data);
++      /* And see what getopt did.  */
++      parser->state.next = parser->opt_data.optind;
++
++      if (opt == KEY_END)
++       /* Getopt says there are no more options, so stop using
++          getopt; we'll continue if necessary on our own.  */
++       {
++         parser->try_getopt = 0;
++         if (parser->state.next > 1
++             && strcmp (parser->state.argv[parser->state.next - 1], QUOTE)
++                  == 0)
++           /* Not only is this the end of the options, but it's a
++              `quoted' region, which may have args that *look* like
++              options, so we definitely shouldn't try to use getopt past
++              here, whatever happens.  */
++           parser->state.quoted = parser->state.next;
++       }
++      else if (opt == KEY_ERR && parser->opt_data.optopt != KEY_END)
++       /* KEY_ERR can have the same value as a valid user short
++          option, but in the case of a real error, getopt sets OPTOPT
++          to the offending character, which can never be KEY_END.  */
++       {
++         *arg_ebadkey = 0;
++         return EBADKEY;
++       }
++    }
++  else
++    opt = KEY_END;
++
++  if (opt == KEY_END)
++    {
++      /* We're past what getopt considers the options.  */
++      if (parser->state.next >= parser->state.argc
++         || (parser->state.flags & ARGP_NO_ARGS))
++       /* Indicate that we're done.  */
++       {
++         *arg_ebadkey = 1;
++         return EBADKEY;
++       }
++      else
++       /* A non-option arg; simulate what getopt might have done.  */
++       {
++         opt = KEY_ARG;
++         parser->opt_data.optarg = parser->state.argv[parser->state.next++];
++       }
++    }
++
++  if (opt == KEY_ARG)
++    /* A non-option argument; try each parser in turn.  */
++    err = parser_parse_arg (parser, parser->opt_data.optarg);
++  else
++    err = parser_parse_opt (parser, opt, parser->opt_data.optarg);
++
++  if (err == EBADKEY)
++    *arg_ebadkey = (opt == KEY_END || opt == KEY_ARG);
++
++  return err;
++}
++
++/* Parse the options strings in ARGC & ARGV according to the argp in ARGP.
++   FLAGS is one of the ARGP_ flags above.  If END_INDEX is non-NULL, the
++   index in ARGV of the first unparsed option is returned in it.  If an
++   unknown option is present, EINVAL is returned; if some parser routine
++   returned a non-zero value, it is returned; otherwise 0 is returned.  */
++error_t
++argp_parse (const struct argp *argp, int argc, char **argv, unsigned flags,
++             int *end_index, void *input)
++{
++  error_t err;
++  struct parser parser;
++
++  /* If true, then err == EBADKEY is a result of a non-option argument failing
++     to be parsed (which in some cases isn't actually an error).  */
++  int arg_ebadkey = 0;
++
++  if (! (flags & ARGP_NO_HELP))
++    /* Add our own options.  */
++    {
++      struct argp_child *child = alloca (4 * sizeof (struct argp_child));
++      struct argp *top_argp = alloca (sizeof (struct argp));
++
++      /* TOP_ARGP has no options, it just serves to group the user & default
++        argps.  */
++      memset (top_argp, 0, sizeof (*top_argp));
++      top_argp->children = child;
++
++      memset (child, 0, 4 * sizeof (struct argp_child));
++
++      if (argp)
++       (child++)->argp = argp;
++      (child++)->argp = &argp_default_argp;
++      if (argp_program_version || argp_program_version_hook)
++       (child++)->argp = &argp_version_argp;
++      child->argp = 0;
++
++      argp = top_argp;
++    }
++
++  /* Construct a parser for these arguments.  */
++  err = parser_init (&parser, argp, argc, argv, flags, input);
++
++  if (! err)
++    /* Parse! */
++    {
++      while (! err)
++       err = parser_parse_next (&parser, &arg_ebadkey);
++      err = parser_finalize (&parser, err, arg_ebadkey, end_index);
++    }
++
++  return err;
++}
++
++/* Return the input field for ARGP in the parser corresponding to STATE; used
++   by the help routines.  */
++void *
++__argp_input (const struct argp *argp, const struct argp_state *state)
++{
++  if (state)
++    {
++      struct group *group;
++      struct parser *parser = state->pstate;
++
++      for (group = parser->groups; group < parser->egroup; group++)
++       if (group->argp == argp)
++         return group->input;
++    }
++
++  return 0;
++}
+diff --git a/libuargp/argp-pv.c b/libuargp/argp-pv.c
+new file mode 100644
+index 0000000..f1227b5
+--- /dev/null
++++ b/libuargp/argp-pv.c
+@@ -0,0 +1,25 @@
++/* Default definition for ARGP_PROGRAM_VERSION.
++   Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++/* If set by the user program to a non-zero value, then a default option
++   --version is added (unless the ARGP_NO_HELP flag is used), which will
++   print this this string followed by a newline and exit (unless the
++   ARGP_NO_EXIT flag is used).  Overridden by ARGP_PROGRAM_VERSION_HOOK.  */
++const char *argp_program_version;
+diff --git a/libuargp/argp-pvh.c b/libuargp/argp-pvh.c
+new file mode 100644
+index 0000000..1f1d962
+--- /dev/null
++++ b/libuargp/argp-pvh.c
+@@ -0,0 +1,32 @@
++/* Default definition for ARGP_PROGRAM_VERSION_HOOK.
++   Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#include <argp.h>
++
++/* If set by the user program to a non-zero value, then a default option
++   --version is added (unless the ARGP_NO_HELP flag is used), which calls
++   this function with a stream to print the version to and a pointer to the
++   current parsing state, and then exits (unless the ARGP_NO_EXIT flag is
++   used).  This variable takes precedent over ARGP_PROGRAM_VERSION.  */
++void (*argp_program_version_hook) (FILE *stream, struct argp_state *state);
+diff --git a/libuargp/argp-xinl.c b/libuargp/argp-xinl.c
+new file mode 100644
+index 0000000..f1d3000
+--- /dev/null
++++ b/libuargp/argp-xinl.c
+@@ -0,0 +1,35 @@
++/* Real definitions for extern inline functions in argp.h
++   Copyright (C) 1997, 1998, 2004 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#if defined _LIBC || defined HAVE_FEATURES_H
++# include <features.h>
++#endif
++
++#ifndef __USE_EXTERN_INLINES
++# define __USE_EXTERN_INLINES  1
++#endif
++#define ARGP_EI
++#undef __OPTIMIZE__
++#define __OPTIMIZE__ 1
++#include <argp.h>
+diff --git a/test/argp/Makefile b/test/argp/Makefile
+new file mode 100644
+index 0000000..616fe71
+--- /dev/null
++++ b/test/argp/Makefile
+@@ -0,0 +1,7 @@
++# uClibc argp tests
++# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
++
++top_builddir=../../
++include ../Rules.mak
++-include Makefile.in
++include ../Test.mak
+diff --git a/test/argp/Makefile.in b/test/argp/Makefile.in
+new file mode 100644
+index 0000000..d81b359
+--- /dev/null
++++ b/test/argp/Makefile.in
+@@ -0,0 +1,12 @@
++# uClibc argp tests
++# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
++
++TESTS := $(addprefix argp-, ex1 ex2 ex3 ex4 test) \
++         bug-argp1 tst-argp1 tst-argp2
++
++EXTRA_LDFLAGS = -luargp
++
++OPTS_argp-ex3 = ARG1 ARG2
++OPTS_argp-ex4 = ARG1 string1 string2 string3
++OPTS_bug-argp1 = -- --help
++
+diff --git a/test/argp/argp-ex1.c b/test/argp/argp-ex1.c
+new file mode 100644
+index 0000000..7bb5f22
+--- /dev/null
++++ b/test/argp/argp-ex1.c
+@@ -0,0 +1,15 @@
++/* Argp example #1 -- a minimal program using argp */
++
++/* This is (probably) the smallest possible program that
++   uses argp.  It won't do much except give an error
++   messages and exit when there are any arguments, and print
++   a (rather pointless) messages for --help.  */
++
++#include <stdlib.h>
++#include <argp.h>
++
++int main (int argc, char **argv)
++{
++  argp_parse (0, argc, argv, 0, 0, 0);
++  exit (0);
++}
+diff --git a/test/argp/argp-ex2.c b/test/argp/argp-ex2.c
+new file mode 100644
+index 0000000..c49fbac
+--- /dev/null
++++ b/test/argp/argp-ex2.c
+@@ -0,0 +1,45 @@
++/* Argp example #2 -- a pretty minimal program using argp */
++
++/* This program doesn't use any options or arguments, but uses
++   argp to be compliant with the GNU standard command line
++   format.
++
++   In addition to making sure no arguments are given, and
++   implementing a --help option, this example will have a
++   --version option, and will put the given documentation string
++   and bug address in the --help output, as per GNU standards.
++
++   The variable ARGP contains the argument parser specification;
++   adding fields to this structure is the way most parameters are
++   passed to argp_parse (the first three fields are usually used,
++   but not in this small program).  There are also two global
++   variables that argp knows about defined here,
++   ARGP_PROGRAM_VERSION and ARGP_PROGRAM_BUG_ADDRESS (they are
++   global variables because they will almost always be constant
++   for a given program, even if it uses different argument
++   parsers for various tasks).  */
++
++#include <stdlib.h>
++#include <argp.h>
++
++const char *argp_program_version =
++  "argp-ex2 1.0";
++const char *argp_program_bug_address =
++  "<bug-gnu-utils@@gnu.org>";
++
++/* Program documentation.  */
++static char doc[] =
++  "Argp example #2 -- a pretty minimal program using argp";
++
++/* Our argument parser.  The @code{options}, @code{parser}, and
++   @code{args_doc} fields are zero because we have neither options or
++   arguments; @code{doc} and @code{argp_program_bug_address} will be
++   used in the output for @samp{--help}, and the @samp{--version}
++   option will print out @code{argp_program_version}.  */
++static struct argp argp = { 0, 0, 0, doc };
++
++int main (int argc, char **argv)
++{
++  argp_parse (&argp, argc, argv, 0, 0, 0);
++  exit (0);
++}
+diff --git a/test/argp/argp-ex3.c b/test/argp/argp-ex3.c
+new file mode 100644
+index 0000000..24d5c50
+--- /dev/null
++++ b/test/argp/argp-ex3.c
+@@ -0,0 +1,153 @@
++/* Argp example #3 -- a program with options and arguments using argp */
++
++/* This program uses the same features as example 2, and uses options and
++   arguments.
++
++   We now use the first four fields in ARGP, so here's a description of them:
++     OPTIONS  -- A pointer to a vector of struct argp_option (see below)
++     PARSER   -- A function to parse a single option, called by argp
++     ARGS_DOC -- A string describing how the non-option arguments should look
++     DOC      -- A descriptive string about this program; if it contains a
++                 vertical tab character (\v), the part after it will be
++                 printed *following* the options
++
++   The function PARSER takes the following arguments:
++     KEY  -- An integer specifying which option this is (taken
++             from the KEY field in each struct argp_option), or
++             a special key specifying something else; the only
++             special keys we use here are ARGP_KEY_ARG, meaning
++             a non-option argument, and ARGP_KEY_END, meaning
++             that all arguments have been parsed
++     ARG  -- For an option KEY, the string value of its
++             argument, or NULL if it has none
++     STATE-- A pointer to a struct argp_state, containing
++             various useful information about the parsing state; used here
++             are the INPUT field, which reflects the INPUT argument to
++             argp_parse, and the ARG_NUM field, which is the number of the
++             current non-option argument being parsed
++   It should return either 0, meaning success, ARGP_ERR_UNKNOWN, meaning the
++   given KEY wasn't recognized, or an errno value indicating some other
++   error.
++
++   Note that in this example, main uses a structure to communicate with the
++   parse_opt function, a pointer to which it passes in the INPUT argument to
++   argp_parse.  Of course, it's also possible to use global variables
++   instead, but this is somewhat more flexible.
++
++   The OPTIONS field contains a pointer to a vector of struct argp_option's;
++   that structure has the following fields (if you assign your option
++   structures using array initialization like this example, unspecified
++   fields will be defaulted to 0, and need not be specified):
++     NAME   -- The name of this option's long option (may be zero)
++     KEY    -- The KEY to pass to the PARSER function when parsing this option,
++               *and* the name of this option's short option, if it is a
++               printable ascii character
++     ARG    -- The name of this option's argument, if any
++     FLAGS  -- Flags describing this option; some of them are:
++                 OPTION_ARG_OPTIONAL -- The argument to this option is optional
++                 OPTION_ALIAS        -- This option is an alias for the
++                                        previous option
++                 OPTION_HIDDEN       -- Don't show this option in --help output
++     DOC    -- A documentation string for this option, shown in --help output
++
++   An options vector should be terminated by an option with all fields zero. */
++
++#include <stdlib.h>
++#include <argp.h>
++
++const char *argp_program_version =
++  "argp-ex3 1.0";
++const char *argp_program_bug_address =
++  "<bug-gnu-utils@@gnu.org>";
++
++/* Program documentation.  */
++static char doc[] =
++  "Argp example #3 -- a program with options and arguments using argp";
++
++/* A description of the arguments we accept.  */
++static char args_doc[] = "ARG1 ARG2";
++
++/* The options we understand.  */
++static struct argp_option options[] = {
++  {"verbose",  'v', 0,      0,  "Produce verbose output" },
++  {"quiet",    'q', 0,      0,  "Don't produce any output" },
++  {"silent",   's', 0,      OPTION_ALIAS },
++  {"output",   'o', "FILE", 0,
++   "Output to FILE instead of standard output" },
++  { 0 }
++};
++
++/* Used by @code{main} to communicate with @code{parse_opt}.  */
++struct arguments
++{
++  char *args[2];               /* @var{arg1} & @var{arg2} */
++  int silent, verbose;
++  char *output_file;
++};
++
++/* Parse a single option.  */
++static error_t
++parse_opt (int key, char *arg, struct argp_state *state)
++{
++  /* Get the @var{input} argument from @code{argp_parse}, which we
++     know is a pointer to our arguments structure.  */
++  struct arguments *arguments = state->input;
++
++  switch (key)
++    {
++    case 'q': case 's':
++      arguments->silent = 1;
++      break;
++    case 'v':
++      arguments->verbose = 1;
++      break;
++    case 'o':
++      arguments->output_file = arg;
++      break;
++
++    case ARGP_KEY_ARG:
++      if (state->arg_num >= 2)
++       /* Too many arguments.  */
++       argp_usage (state);
++
++      arguments->args[state->arg_num] = arg;
++
++      break;
++
++    case ARGP_KEY_END:
++      if (state->arg_num < 2)
++       /* Not enough arguments.  */
++       argp_usage (state);
++      break;
++
++    default:
++      return ARGP_ERR_UNKNOWN;
++    }
++  return 0;
++}
++
++/* Our argp parser.  */
++static struct argp argp = { options, parse_opt, args_doc, doc };
++
++int main (int argc, char **argv)
++{
++  struct arguments arguments;
++
++  /* Default values.  */
++  arguments.silent = 0;
++  arguments.verbose = 0;
++  arguments.output_file = "-";
++
++  /* Parse our arguments; every option seen by @code{parse_opt} will
++     be reflected in @code{arguments}.  */
++  argp_parse (&argp, argc, argv, 0, 0, &arguments);
++
++  printf ("ARG1 = %s\nARG2 = %s\nOUTPUT_FILE = %s\n"
++         "VERBOSE = %s\nSILENT = %s\n",
++         arguments.args[0], arguments.args[1],
++         arguments.output_file,
++         arguments.verbose ? "yes" : "no",
++         arguments.silent ? "yes" : "no");
++
++  exit (0);
++}
+diff --git a/test/argp/argp-ex4.c b/test/argp/argp-ex4.c
+new file mode 100644
+index 0000000..c77c7ef
+--- /dev/null
++++ b/test/argp/argp-ex4.c
+@@ -0,0 +1,167 @@
++/* Argp example #4 -- a program with somewhat more complicated options */
++
++/* This program uses the same features as example 3, but has more
++   options, and somewhat more structure in the -help output.  It
++   also shows how you can `steal' the remainder of the input
++   arguments past a certain point, for programs that accept a
++   list of items.  It also shows the special argp KEY value
++   ARGP_KEY_NO_ARGS, which is only given if no non-option
++   arguments were supplied to the program.
++
++   For structuring the help output, two features are used,
++   *headers* which are entries in the options vector with the
++   first four fields being zero, and a two part documentation
++   string (in the variable DOC), which allows documentation both
++   before and after the options; the two parts of DOC are
++   separated by a vertical-tab character ('\v', or '\013').  By
++   convention, the documentation before the options is just a
++   short string saying what the program does, and that afterwards
++   is longer, describing the behavior in more detail.  All
++   documentation strings are automatically filled for output,
++   although newlines may be included to force a line break at a
++   particular point.  All documentation strings are also passed to
++   the `gettext' function, for possible translation into the
++   current locale.  */
++
++#include <stdlib.h>
++#include <error.h>
++#include <argp.h>
++
++const char *argp_program_version =
++  "argp-ex4 1.0";
++const char *argp_program_bug_address =
++  "<bug-gnu-utils@@prep.ai.mit.edu>";
++
++/* Program documentation.  */
++static char doc[] =
++  "Argp example #4 -- a program with somewhat more complicated\
++options\
++\vThis part of the documentation comes *after* the options;\
++ note that the text is automatically filled, but it's possible\
++ to force a line-break, e.g.\n<-- here.";
++
++/* A description of the arguments we accept.  */
++static char args_doc[] = "ARG1 [STRING...]";
++
++/* Keys for options without short-options.  */
++#define OPT_ABORT  1           /* --abort */
++
++/* The options we understand.  */
++static struct argp_option options[] = {
++  {"verbose",  'v', 0,       0, "Produce verbose output" },
++  {"quiet",    'q', 0,       0, "Don't produce any output" },
++  {"silent",   's', 0,       OPTION_ALIAS },
++  {"output",   'o', "FILE",  0,
++   "Output to FILE instead of standard output" },
++
++  {0,0,0,0, "The following options should be grouped together:" },
++  {"repeat",   'r', "COUNT", OPTION_ARG_OPTIONAL,
++   "Repeat the output COUNT (default 10) times"},
++  {"abort",    OPT_ABORT, 0, 0, "Abort before showing any output"},
++
++  { 0 }
++};
++
++/* Used by @code{main} to communicate with @code{parse_opt}.  */
++struct arguments
++{
++  char *arg1;                  /* @var{arg1} */
++  char **strings;              /* [@var{string}@dots{}] */
++  int silent, verbose, abort;  /* @samp{-s}, @samp{-v}, @samp{--abort} */
++  char *output_file;           /* @var{file} arg to @samp{--output} */
++  int repeat_count;            /* @var{count} arg to @samp{--repeat} */
++};
++
++/* Parse a single option.  */
++static error_t
++parse_opt (int key, char *arg, struct argp_state *state)
++{
++  /* Get the @code{input} argument from @code{argp_parse}, which we
++     know is a pointer to our arguments structure.  */
++  struct arguments *arguments = state->input;
++
++  switch (key)
++    {
++    case 'q': case 's':
++      arguments->silent = 1;
++      break;
++    case 'v':
++      arguments->verbose = 1;
++      break;
++    case 'o':
++      arguments->output_file = arg;
++      break;
++    case 'r':
++      arguments->repeat_count = arg ? atoi (arg) : 10;
++      break;
++    case OPT_ABORT:
++      arguments->abort = 1;
++      break;
++
++    case ARGP_KEY_NO_ARGS:
++      argp_usage (state);
++
++    case ARGP_KEY_ARG:
++      /* Here we know that @code{state->arg_num == 0}, since we
++        force argument parsing to end before any more arguments can
++        get here.  */
++      arguments->arg1 = arg;
++
++      /* Now we consume all the rest of the arguments.
++        @code{state->next} is the index in @code{state->argv} of the
++        next argument to be parsed, which is the first @var{string}
++        we're interested in, so we can just use
++        @code{&state->argv[state->next]} as the value for
++        arguments->strings.
++
++        @emph{In addition}, by setting @code{state->next} to the end
++        of the arguments, we can force argp to stop parsing here and
++        return.  */
++      arguments->strings = &state->argv[state->next];
++      state->next = state->argc;
++
++      break;
++
++    default:
++      return ARGP_ERR_UNKNOWN;
++    }
++  return 0;
++}
++
++/* Our argp parser.  */
++static struct argp argp = { options, parse_opt, args_doc, doc };
++
++int main (int argc, char **argv)
++{
++  int i, j;
++  struct arguments arguments;
++
++  /* Default values.  */
++  arguments.silent = 0;
++  arguments.verbose = 0;
++  arguments.output_file = "-";
++  arguments.repeat_count = 1;
++  arguments.abort = 0;
++
++  /* Parse our arguments; every option seen by @code{parse_opt} will be
++     reflected in @code{arguments}.  */
++  argp_parse (&argp, argc, argv, 0, 0, &arguments);
++
++  if (arguments.abort)
++    error (10, 0, "ABORTED");
++
++  for (i = 0; i < arguments.repeat_count; i++)
++    {
++      printf ("ARG1 = %s\n", arguments.arg1);
++      printf ("STRINGS = ");
++      for (j = 0; arguments.strings[j]; j++)
++       printf (j == 0 ? "%s" : ", %s", arguments.strings[j]);
++      printf ("\n");
++      printf ("OUTPUT_FILE = %s\nVERBOSE = %s\nSILENT = %s\n",
++             arguments.output_file,
++             arguments.verbose ? "yes" : "no",
++             arguments.silent ? "yes" : "no");
++    }
++
++  exit (0);
++}
+diff --git a/test/argp/argp-test.c b/test/argp/argp-test.c
+new file mode 100644
+index 0000000..b3d573b
+--- /dev/null
++++ b/test/argp/argp-test.c
+@@ -0,0 +1,209 @@
++/* Test program for argp argument parser
++   Copyright (C) 1997 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Written by Miles Bader <miles at gnu.ai.mit.edu>.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#include <stdlib.h>
++#include <time.h>
++#include <string.h>
++#include <argp.h>
++
++const char *argp_program_version = "argp-test 1.0";
++
++struct argp_option sub_options[] =
++{
++  {"subopt1",       's',     0,  0, "Nested option 1"},
++  {"subopt2",       'S',     0,  0, "Nested option 2"},
++
++  { 0, 0, 0, 0, "Some more nested options:", 10},
++  {"subopt3",       'p',     0,  0, "Nested option 3"},
++
++  {"subopt4",       'q',     0,  0, "Nested option 4", 1},
++
++  {0}
++};
++
++static const char sub_args_doc[] = "STRING...\n-";
++static const char sub_doc[] = "\vThis is the doc string from the sub-arg-parser.";
++
++static error_t
++sub_parse_opt (int key, char *arg, struct argp_state *state)
++{
++  switch (key)
++    {
++    case ARGP_KEY_NO_ARGS:
++      printf ("NO SUB ARGS\n");
++      break;
++    case ARGP_KEY_ARG:
++      printf ("SUB ARG: %s\n", arg);
++      break;
++
++    case 's' : case 'S': case 'p': case 'q':
++      printf ("SUB KEY %c\n", key);
++      break;
++
++    default:
++      return ARGP_ERR_UNKNOWN;
++    }
++  return 0;
++}
++
++static char *
++sub_help_filter (int key, const char *text, void *input)
++{
++  if (key == ARGP_KEY_HELP_EXTRA)
++    return strdup ("This is some extra text from the sub parser (note that it \
++is preceded by a blank line).");
++  else
++    return (char *)text;
++}
++
++static struct argp sub_argp = {
++  sub_options, sub_parse_opt, sub_args_doc, sub_doc, 0, sub_help_filter
++};
++
++/* Structure used to communicate with the parsing functions.  */
++struct params
++{
++  unsigned foonly;             /* Value parsed for foonly.  */
++  unsigned foonly_default;     /* Default value for it.  */
++};
++
++#define OPT_PGRP 1
++#define OPT_SESS 2
++
++struct argp_option options[] =
++{
++  {"pid",       'p',     "PID", 0, "List the process PID"},
++  {"pgrp",      OPT_PGRP,"PGRP",0, "List processes in the process group PGRP"},
++  {"no-parent", 'P',    0,     0, "Include processes without parents"},
++  {0,           'x',     0,     OPTION_ALIAS},
++  {"all-fields",'Q',     0,     0, "Don't elide unusable fields (normally"
++                                  " if there's some reason ps can't"
++                                  " print a field for any process, it's"
++                                  " removed from the output entirely)" },
++  {"reverse",   'r',    0,      0, "Reverse the order of any sort"},
++  {"gratuitously-long-reverse-option", 0, 0, OPTION_ALIAS},
++  {"session",  OPT_SESS,"SID",  OPTION_ARG_OPTIONAL,
++                                  "Add the processes from the session"
++                                  " SID (which defaults to the sid of"
++                                  " the current process)" },
++
++  {0,0,0,0, "Here are some more options:"},
++  {"foonly", 'f', "ZOT", OPTION_ARG_OPTIONAL, "Glork a foonly"},
++  {"zaza", 'z', 0, 0, "Snit a zar"},
++
++  {0}
++};
++
++static const char args_doc[] = "STRING";
++static const char doc[] = "Test program for argp."
++ "\vThis doc string comes after the options."
++ "\nHey!  Some manual formatting!"
++ "\nThe current time is: %s";
++
++static void
++popt (int key, char *arg)
++{
++  char buf[10];
++  if (isprint (key))
++    sprintf (buf, "%c", key);
++  else
++    sprintf (buf, "%d", key);
++  if (arg)
++    printf ("KEY %s: %s\n", buf, arg);
++  else
++    printf ("KEY %s\n", buf);
++}
++
++static error_t
++parse_opt (int key, char *arg, struct argp_state *state)
++{
++  struct params *params = state->input;
++
++  switch (key)
++    {
++    case ARGP_KEY_NO_ARGS:
++      printf ("NO ARGS\n");
++      break;
++
++    case ARGP_KEY_ARG:
++      if (state->arg_num > 0)
++       return ARGP_ERR_UNKNOWN; /* Leave it for the sub-arg parser.  */
++      printf ("ARG: %s\n", arg);
++      break;
++
++    case 'f':
++      if (arg)
++       params->foonly = atoi (arg);
++      else
++       params->foonly = params->foonly_default;
++      popt (key, arg);
++      break;
++
++    case 'p': case 'P': case OPT_PGRP: case 'x': case 'Q':
++    case 'r': case OPT_SESS: case 'z':
++      popt (key, arg);
++      break;
++
++    default:
++      return ARGP_ERR_UNKNOWN;
++    }
++  return 0;
++}
++
++static char *
++help_filter (int key, const char *text, void *input)
++{
++  char *new_text;
++  struct params *params = input;
++
++  if (key == ARGP_KEY_HELP_POST_DOC && text)
++    {
++      time_t now = time (0);
++      asprintf (&new_text, text, ctime (&now));
++    }
++  else if (key == 'f')
++    /* Show the default for the --foonly option.  */
++    asprintf (&new_text, "%s (ZOT defaults to %x)",
++             text, params->foonly_default);
++  else
++    new_text = (char *)text;
++
++  return new_text;
++}
++
++static struct argp_child argp_children[] = { { &sub_argp }, { 0 } };
++static struct argp argp = {
++  options, parse_opt, args_doc, doc, argp_children, help_filter
++};
++
++int
++main (int argc, char **argv)
++{
++  struct params params;
++  params.foonly = 0;
++  params.foonly_default = random ();
++  argp_parse (&argp, argc, argv, 0, 0, &params);
++  printf ("After parsing: foonly = %x\n", params.foonly);
++  return 0;
++}
+diff --git a/test/argp/bug-argp1.c b/test/argp/bug-argp1.c
+new file mode 100644
+index 0000000..a28cf4b
+--- /dev/null
++++ b/test/argp/bug-argp1.c
+@@ -0,0 +1,26 @@
++#include <argp.h>
++
++
++static const struct argp_option test_options[] =
++{
++  { NULL, 'a', NULL, OPTION_DOC, NULL },
++  { NULL, 'b', NULL, OPTION_DOC, NULL },
++  { NULL, 0, NULL, 0, NULL }
++};
++
++static struct argp test_argp =
++{
++  test_options
++};
++
++
++static int
++do_test (int argc, char *argv[])
++{
++  int i;
++  argp_parse (&test_argp, argc, argv, 0, &i, NULL);
++  return 0;
++}
++
++#define TEST_FUNCTION do_test (argc, argv)
++#include "../test-skeleton.c"
+diff --git a/test/argp/tst-argp1.c b/test/argp/tst-argp1.c
+new file mode 100644
+index 0000000..827daca
+--- /dev/null
++++ b/test/argp/tst-argp1.c
+@@ -0,0 +1,118 @@
++/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Contributed by Ulrich Drepper <drepper at redhat.com>, 2002.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <argp.h>
++
++
++
++
++#define OPT_TO_THREAD          300
++#define OPT_TO_PROCESS         301
++#define OPT_SYNC_SIGNAL                302
++#define OPT_SYNC_JOIN          303
++#define OPT_TOPLEVEL           304
++
++
++static const struct argp_option test_options[] =
++  {
++    { NULL, 0, NULL, 0, "\
++This is a test for threads so we allow ther user to selection the number of \
++threads which are used at any one time.  Independently the total number of \
++rounds can be selected.  This is the total number of threads which will have \
++run when the process terminates:" },
++    { "threads", 't', "NUMBER", 0, "Number of threads used at once" },
++    { "starts", 's', "NUMBER", 0, "Total number of working threads" },
++    { "toplevel", OPT_TOPLEVEL, "NUMBER", 0,
++      "Number of toplevel threads which start the other threads; this \
++implies --sync-join" },
++
++    { NULL, 0, NULL, 0, "\
++Each thread can do one of two things: sleep or do work.  The latter is 100% \
++CPU bound.  The work load is the probability a thread does work.  All values \
++from zero to 100 (inclusive) are valid.  How often each thread repeats this \
++can be determined by the number of rounds.  The work cost determines how long \
++each work session (not sleeping) takes.  If it is zero a thread would \
++effectively nothing.  By setting the number of rounds to zero the thread \
++does no work at all and pure thread creation times can be measured." },
++    { "workload", 'w', "PERCENT", 0, "Percentage of time spent working" },
++    { "workcost", 'c', "NUMBER", 0,
++      "Factor in the cost of each round of working" },
++    { "rounds", 'r', "NUMBER", 0, "Number of rounds each thread runs" },
++
++    { NULL, 0, NULL, 0, "\
++There are a number of different methods how thread creation can be \
++synchronized.  Synchronization is necessary since the number of concurrently \
++running threads is limited." },
++    { "sync-signal", OPT_SYNC_SIGNAL, NULL, 0,
++      "Synchronize using a signal (default)" },
++    { "sync-join", OPT_SYNC_JOIN, NULL, 0, "Synchronize using pthread_join" },
++
++    { NULL, 0, NULL, 0, "\
++One parameter for each threads execution is the size of the stack.  If this \
++parameter is not used the system's default stack size is used.  If many \
++threads are used the stack size should be chosen quite small." },
++    { "stacksize", 'S', "BYTES", 0, "Size of threads stack" },
++    { "guardsize", 'g', "BYTES", 0,
++      "Size of stack guard area; must fit into the stack" },
++
++    { NULL, 0, NULL, 0, "Signal options:" },
++    { "to-thread", OPT_TO_THREAD, NULL, 0, "Send signal to main thread" },
++    { "to-process", OPT_TO_PROCESS, NULL, 0,
++      "Send signal to process (default)" },
++
++    { NULL, 0, NULL, 0, "Administrative options:" },
++    { "progress", 'p', NULL, 0, "Show signs of progress" },
++    { "timing", 'T', NULL, 0,
++      "Measure time from startup to the last thread finishing" },
++    { NULL, 0, NULL, 0, NULL }
++  };
++
++/* Prototype for option handler.  */
++static error_t parse_opt (int key, char *arg, struct argp_state *state);
++
++/* Data structure to communicate with argp functions.  */
++static struct argp argp =
++{
++  test_options, parse_opt
++};
++
++
++static int
++do_test (void)
++{
++  int argc = 2;
++  char *argv[3] = { (char *) "tst-argp1", (char *) "--help", NULL };
++  int remaining;
++
++  /* Parse and process arguments.  */
++  argp_parse (&argp, argc, argv, 0, &remaining, NULL);
++
++  return 0;
++}
++
++
++/* Handle program arguments.  */
++static error_t
++parse_opt (int key, char *arg, struct argp_state *state)
++{
++  return ARGP_ERR_UNKNOWN;
++}
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+diff --git a/test/argp/tst-argp2.c b/test/argp/tst-argp2.c
+new file mode 100644
+index 0000000..705cdca
+--- /dev/null
++++ b/test/argp/tst-argp2.c
+@@ -0,0 +1,101 @@
++/* Copyright (C) 2007 Free Software Foundation, Inc.
++   This file is part of the GNU C Library.
++   Contributed by Jakub Jelinek <jakub at redhat.com>, 2007.
++
++   The GNU C Library is free software; you can redistribute it and/or
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C 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 the GNU C Library; if not, write to the Free
++   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
++   02111-1307 USA.  */
++
++#include <argp.h>
++
++static const struct argp_option opt1[] =
++  {
++    { "opt1", '1', "NUMBER", 0, "Option 1" },
++    { NULL, 0, NULL, 0, NULL }
++  };
++
++static const struct argp_option opt2[] =
++  {
++    { "opt2", '2', "NUMBER", 0, "Option 2" },
++    { NULL, 0, NULL, 0, NULL }
++  };
++
++static const struct argp_option opt3[] =
++  {
++    { "opt3", '3', "NUMBER", 0, "Option 3" },
++    { NULL, 0, NULL, 0, NULL }
++  };
++
++static const struct argp_option opt4[] =
++  {
++    { "opt4", '4', "NUMBER", 0, "Option 4" },
++    { NULL, 0, NULL, 0, NULL }
++  };
++
++static const struct argp_option opt5[] =
++  {
++    { "opt5", '5', "NUMBER", 0, "Option 5" },
++    { NULL, 0, NULL, 0, NULL }
++  };
++
++static struct argp argp5 =
++  {
++    opt5, NULL, "args doc5", "doc5", NULL, NULL, NULL
++  };
++
++static struct argp argp4 =
++  {
++    opt4, NULL, "args doc4", "doc4", NULL, NULL, NULL
++  };
++
++static struct argp argp3 =
++  {
++    opt3, NULL, "args doc3", "doc3", NULL, NULL, NULL
++  };
++
++static struct argp_child children2[] =
++  {
++    { &argp4, 0, "child3", 3 },
++    { &argp5, 0, "child4", 4 },
++    { NULL, 0, NULL, 0 }
++  };
++
++static struct argp argp2 =
++  {
++    opt2, NULL, "args doc2", "doc2", children2, NULL, NULL
++  };
++
++static struct argp_child children1[] =
++  {
++    { &argp2, 0, "child1", 1 },
++    { &argp3, 0, "child2", 2 },
++    { NULL, 0, NULL, 0 }
++  };
++
++static struct argp argp1 =
++  {
++    opt1, NULL, "args doc1", "doc1", children1, NULL, NULL
++  };
++
++
++static int
++do_test (void)
++{
++  argp_help (&argp1, stdout, ARGP_HELP_LONG, (char *) "tst-argp2");
++  return 0;
++}
++
++
++#define TEST_FUNCTION do_test ()
++#include "../test-skeleton.c"
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/uclibc/uclibc-git/0004-Dont-support-localised-optimizations-this-helps-to-h.patch b/meta/recipes-core/uclibc/uclibc-git/0004-Dont-support-localised-optimizations-this-helps-to-h.patch
new file mode 100644
index 0000000..629e13c
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0004-Dont-support-localised-optimizations-this-helps-to-h.patch
@@ -0,0 +1,30 @@
+From 31785c544abe8b215dbb2264fb11ee7051515797 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Aug 2015 20:58:59 -0700
+Subject: [PATCH 4/7] Dont support localised optimizations this helps to have a
+ global -O level
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ libpthread/nptl/pthread_mutex_timedlock.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libpthread/nptl/pthread_mutex_timedlock.c b/libpthread/nptl/pthread_mutex_timedlock.c
+index 04187f6..f56f6c5 100644
+--- a/libpthread/nptl/pthread_mutex_timedlock.c
++++ b/libpthread/nptl/pthread_mutex_timedlock.c
+@@ -28,7 +28,9 @@
+  * error: can't find a register in class ‘GENERAL_REGS’ while reloading ‘asm’
+  */
+ int
++#ifndef  __OPTIMIZE__
+ attribute_optimize("Os")
++#endif
+ pthread_mutex_timedlock (
+      pthread_mutex_t *mutex,
+      const struct timespec *abstime)
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/uclibc/uclibc-git/0005-Always-use-O2-for-compiling-fork.c.patch b/meta/recipes-core/uclibc/uclibc-git/0005-Always-use-O2-for-compiling-fork.c.patch
new file mode 100644
index 0000000..ad9b246
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0005-Always-use-O2-for-compiling-fork.c.patch
@@ -0,0 +1,33 @@
+From 883debc22e30a947fe5858cc07ee5aebd3d07a2e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Aug 2015 20:59:56 -0700
+Subject: [PATCH 5/7] Always use -O2 for compiling fork.c
+
+When compiling in thumb mode for arm with -Os gcc gives up since it can
+not find registers to spill. So we use -O2 option for compiling fork.c
+It may be addressable in gcc.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
+index 0ea0b29..0767e9c 100644
+--- a/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
++++ b/libpthread/nptl/sysdeps/unix/sysv/linux/arm/Makefile.arch
+@@ -21,3 +21,9 @@ ASFLAGS-pt-vfork.S = -marm
+ CFLAGS-OMIT-pt-vfork.S = -mthumb
+ ASFLAGS-vfork.S = -marm
+ CFLAGS-OMIT-vfork.S = -mthumb
++
++# For arm fork.c does not compile with -Os when compiling
++# in thumb1 mode
++ifeq ($(COMPILE_IN_THUMB_MODE),y)
++CFLAGS-fork.c = -O2
++endif
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/uclibc/uclibc-git/0006-ldso-limited-support-for-ORIGIN-in-rpath.patch b/meta/recipes-core/uclibc/uclibc-git/0006-ldso-limited-support-for-ORIGIN-in-rpath.patch
new file mode 100644
index 0000000..f0d8737
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0006-ldso-limited-support-for-ORIGIN-in-rpath.patch
@@ -0,0 +1,233 @@
+From b40c129ed2d53b69463883a5422dd4a012a398f9 Mon Sep 17 00:00:00 2001
+From: Junling Zheng <zhengjunling@huawei.com>
+Date: Fri, 3 Apr 2015 05:02:27 +0000
+Subject: [PATCH 6/7] ldso: limited support for $ORIGIN in rpath
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Derived from:
+http://lists.busybox.net/pipermail/uclibc/2011-March/045003.html
+
+However, the above patch introduced '_dl_strchr' in ldso/ldso/dl-elf.c,
+and caused the following undefined referencing compiling error:
+
+  | .../libdl.a(libdl.os): In function `search_for_named_library':
+  | .../dl-elf.c:156: undefined reference to `_dl_strchr'
+  | collect2: error: ld returned 1 exit status
+
+This problem would be reproduced through compiling gdb in static mode
+using uclibc.
+
+So, add the definition of '_dl_strchr' to fix it. The '_dl_strstr' is
+added as well.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Timo Teräs <timo.teras at iki.fi>
+Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ ldso/include/dl-string.h |  2 ++
+ ldso/ldso/dl-elf.c       | 79 +++++++++++++++++++++++++-----------------------
+ ldso/ldso/ldso.c         | 18 +++++++++--
+ 3 files changed, 59 insertions(+), 40 deletions(-)
+
+diff --git a/ldso/include/dl-string.h b/ldso/include/dl-string.h
+index aacad10..14ae617 100644
+--- a/ldso/include/dl-string.h
++++ b/ldso/include/dl-string.h
+@@ -204,7 +204,9 @@ static __always_inline char * _dl_get_last_path_component(char *path)
+ # define _dl_strcat strcat
+ # define _dl_strcpy strcpy
+ # define _dl_strcmp strcmp
++# define _dl_strchr strchr
+ # define _dl_strrchr strrchr
++# define _dl_strstr strstr
+ # define _dl_memcpy memcpy
+ # define _dl_memcmp memcmp
+ # define _dl_memset memset
+diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
+index 5631905..6ab7afe 100644
+--- a/ldso/ldso/dl-elf.c
++++ b/ldso/ldso/dl-elf.c
+@@ -133,56 +133,60 @@ _dl_protect_relro (struct elf_resolve *l)
+  * in uClibc/ldso/util/ldd.c */
+ static struct elf_resolve *
+ search_for_named_library(const char *name, unsigned rflags, const char *path_list,
+-	struct dyn_elf **rpnt)
++	struct dyn_elf **rpnt, const char* origin)
+ {
+-	char *path, *path_n, *mylibname;
++	char *mylibname;
++	const char *p, *pn;
+ 	struct elf_resolve *tpnt;
+-	int done;
++	int plen;
+ 
+ 	if (path_list==NULL)
+ 		return NULL;
+ 
+-	/* We need a writable copy of this string, but we don't
+-	 * need this allocated permanently since we don't want
+-	 * to leak memory, so use alloca to put path on the stack */
+-	done = _dl_strlen(path_list);
+-	path = alloca(done + 1);
+-
+ 	/* another bit of local storage */
+ 	mylibname = alloca(2050);
+ 
+-	_dl_memcpy(path, path_list, done+1);
+-
+ 	/* Unlike ldd.c, don't bother to eliminate double //s */
+ 
+ 	/* Replace colons with zeros in path_list */
+ 	/* : at the beginning or end of path maps to CWD */
+ 	/* :: anywhere maps CWD */
+ 	/* "" maps to CWD */
+-	done = 0;
+-	path_n = path;
+-	do {
+-		if (*path == 0) {
+-			*path = ':';
+-			done = 1;
++	for (p = path_list; p != NULL; p = pn) {
++		pn = _dl_strchr(p + 1, ':');
++		if (pn != NULL) {
++			plen = pn - p;
++			pn++;
++		} else
++			plen = _dl_strlen(p);
++
++		if (plen >= 7 && _dl_memcmp(p, "$ORIGIN", 7) == 0) {
++			int olen;
++			if (rflags && plen != 7)
++				continue;
++			if (origin == NULL)
++				continue;
++			for (olen = _dl_strlen(origin) - 1; olen >= 0 && origin[olen] != '/'; olen--)
++				;
++			if (olen <= 0)
++				continue;
++			_dl_memcpy(&mylibname[0], origin, olen);
++			_dl_memcpy(&mylibname[olen], p + 7, plen - 7);
++			mylibname[olen + plen - 7] = 0;
++		} else if (plen != 0) {
++			_dl_memcpy(mylibname, p, plen);
++			mylibname[plen] = 0;
++		} else {
++			_dl_strcpy(mylibname, ".");
+ 		}
+-		if (*path == ':') {
+-			*path = 0;
+-			if (*path_n)
+-				_dl_strcpy(mylibname, path_n);
+-			else
+-				_dl_strcpy(mylibname, "."); /* Assume current dir if empty path */
+-			_dl_strcat(mylibname, "/");
+-			_dl_strcat(mylibname, name);
++		_dl_strcat(mylibname, "/");
++		_dl_strcat(mylibname, name);
+ #ifdef __LDSO_SAFE_RUNPATH__
+-			if (*mylibname == '/')
++		if (*mylibname == '/')
+ #endif
+-				if ((tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname)) != NULL)
+-					return tpnt;
+-			path_n = path+1;
+-		}
+-		path++;
+-	} while (!done);
++		if ((tpnt = _dl_load_elf_shared_library(rflags, rpnt, mylibname)) != NULL)
++			return tpnt;
++	}
+ 	return NULL;
+ }
+ 
+@@ -234,7 +238,8 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp
+ 	if (pnt) {
+ 		pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
+ 		_dl_if_debug_dprint("\tsearching RPATH='%s'\n", pnt);
+-		if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL)
++		if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt,
++						      tpnt->libname)) != NULL)
+ 			return tpnt1;
+ 	}
+ #endif
+@@ -243,7 +248,7 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp
+ 	/* Check in LD_{ELF_}LIBRARY_PATH, if specified and allowed */
+ 	if (_dl_library_path) {
+ 		_dl_if_debug_dprint("\tsearching LD_LIBRARY_PATH='%s'\n", _dl_library_path);
+-		if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt)) != NULL)
++		if ((tpnt1 = search_for_named_library(libname, rflags, _dl_library_path, rpnt, NULL)) != NULL)
+ 		{
+ 			return tpnt1;
+ 		}
+@@ -257,7 +262,7 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp
+ 	if (pnt) {
+ 		pnt += (unsigned long) tpnt->dynamic_info[DT_STRTAB];
+ 		_dl_if_debug_dprint("\tsearching RUNPATH='%s'\n", pnt);
+-		if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt)) != NULL)
++		if ((tpnt1 = search_for_named_library(libname, rflags, pnt, rpnt, NULL)) != NULL)
+ 			return tpnt1;
+ 	}
+ #endif
+@@ -291,7 +296,7 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp
+ 	/* Look for libraries wherever the shared library loader
+ 	 * was installed */
+ 	_dl_if_debug_dprint("\tsearching ldso dir='%s'\n", _dl_ldsopath);
+-	tpnt1 = search_for_named_library(libname, rflags, _dl_ldsopath, rpnt);
++	tpnt1 = search_for_named_library(libname, rflags, _dl_ldsopath, rpnt, NULL);
+ 	if (tpnt1 != NULL)
+ 		return tpnt1;
+ #endif
+@@ -304,7 +309,7 @@ struct elf_resolve *_dl_load_shared_library(unsigned rflags, struct dyn_elf **rp
+ #ifndef __LDSO_CACHE_SUPPORT__
+ 					":" UCLIBC_RUNTIME_PREFIX "usr/X11R6/lib"
+ #endif
+-					, rpnt);
++					, rpnt, NULL);
+ 	if (tpnt1 != NULL)
+ 		return tpnt1;
+ 
+diff --git a/ldso/ldso/ldso.c b/ldso/ldso/ldso.c
+index f38f9e3..3812908 100644
+--- a/ldso/ldso/ldso.c
++++ b/ldso/ldso/ldso.c
+@@ -402,6 +402,20 @@ static ptrdiff_t _dl_build_local_scope (struct elf_resolve **list,
+ 				p += _dl_build_local_scope (p, q->tpnt);
+ 	return p - list;
+ }
++ 
++static void _dl_setup_progname(const char *argv0)
++{
++	char image[PATH_MAX];
++	ssize_t s;
++
++	s = _dl_readlink("/proc/self/exe", image, sizeof(image));
++	if (s > 0 && image[0] == '/') {
++		image[s] = 0;
++		_dl_progname = _dl_strdup(image);
++	} else if (argv0) {
++		_dl_progname = argv0;
++	}
++}
+ 
+ void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
+ 			  ElfW(auxv_t) auxvt[AT_EGID + 1], char **envp, char **argv
+@@ -454,9 +468,7 @@ void *_dl_get_ready_to_run(struct elf_resolve *tpnt, DL_LOADADDR_TYPE load_addr,
+ 	 * been fixed up by now.  Still no function calls outside of this
+ 	 * library, since the dynamic resolver is not yet ready.
+ 	 */
+-	if (argv[0]) {
+-		_dl_progname = argv[0];
+-	}
++	_dl_setup_progname(argv[0]);
+ 
+ #ifdef __DSBT__
+ 	_dl_ldso_dsbt = (void *)tpnt->dynamic_info[DT_DSBT_BASE_IDX];
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/uclibc/uclibc-git/0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch b/meta/recipes-core/uclibc/uclibc-git/0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch
new file mode 100644
index 0000000..ee932c3
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/0007-nptl-atfork-Hide-pthread_atfork-in-shared-versions.patch
@@ -0,0 +1,35 @@
+From 90516af9f776f9c2835b47fc52775dcb307a85ac Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 23 Jun 2012 15:59:01 -0700
+Subject: [PATCH 7/7] nptl/atfork: Hide pthread_atfork in shared versions
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+---
+ libpthread/nptl/Makefile.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libpthread/nptl/Makefile.in b/libpthread/nptl/Makefile.in
+index 55eeba2..8cb8fa9 100644
+--- a/libpthread/nptl/Makefile.in
++++ b/libpthread/nptl/Makefile.in
+@@ -16,6 +16,7 @@ libc-shared-routines-y = forward.c libc-cancellation.c
+ libc-static-routines-y = alloca_cutoff.c libc-cancellation.c
+ libpthread-shared-only-routines-y = version.c
+ libpthread-static-only-routines-y = pthread_atfork.c
++
+ libpthread-routines- += $(notdir $(wildcard $(libpthread_DIR)/gen_*.c)) # dummy generated files
+ libpthread-routines- += allocatestack.c # dummy included by pthread_create.c
+ libpthread-routines- += pthread_mutex_getprioceiling.c pthread_mutex_setprioceiling.c # XXX: delete those or use them!
+@@ -201,7 +202,7 @@ CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables
+ CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables
+ 
+ CFLAGS-pt-system.c = -fexceptions -I$(top_srcdir)libc/stdlib
+-
++CFLAGS-pthread_atfork.c = -DNOT_IN_libc
+ #
+ # The rest of this file is uClibc specific.
+ #
+-- 
+2.1.4
+
diff --git a/meta/recipes-core/uclibc/uclibc-git/locale.cfg b/meta/recipes-core/uclibc/uclibc-git/locale.cfg
new file mode 100644
index 0000000..fc66435
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/locale.cfg
@@ -0,0 +1,3 @@
+UCLIBC_HAS_LOCALE=y
+UCLIBC_HAS_XLOCALE=y
+UCLIBC_BUILD_MINIMAL_LOCALE=y
diff --git a/meta/recipes-core/uclibc/uclibc-git/obstack.cfg b/meta/recipes-core/uclibc/uclibc-git/obstack.cfg
new file mode 100644
index 0000000..36bf9d6
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/obstack.cfg
@@ -0,0 +1 @@
+UCLIBC_HAS_OBSTACK=y
diff --git a/meta/recipes-core/uclibc/uclibc-git/uClibc.distro b/meta/recipes-core/uclibc/uclibc-git/uClibc.distro
new file mode 100644
index 0000000..6575482
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/uClibc.distro
@@ -0,0 +1,193 @@
+#
+# General Library Settings
+#
+# HAVE_NO_PIC is not set
+# DOPIC is not set
+# HAVE_NO_SHARED is not set
+# ARCH_HAS_NO_LDSO is not set
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# UCLIBC_STATIC_LDCONFIG is not set
+LDSO_RUNPATH=y
+UCLIBC_CTOR_DTOR=y
+LDSO_GNU_HASH_SUPPORT=y
+# HAS_NO_THREADS is not set
+UCLIBC_HAS_THREADS=y
+UCLIBC_HAS_THREADS_NATIVE=y
+PTHREADS_DEBUG_SUPPORT=y
+# LINUXTHREADS_OLD is not set
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+# MALLOC_SIMPLE is not set
+MALLOC_STANDARD=y
+MALLOC_GLIBC_COMPAT=y
+UCLIBC_DYNAMIC_ATEXIT=y
+COMPAT_ATEXIT=y
+UCLIBC_SUSV3_LEGACY=y
+UCLIBC_SUSV3_LEGACY_MACROS=y
+UCLIBC_SUSV4_LEGACY=y
+UCLIBC_HAS_SHADOW=y
+UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y
+UCLIBC_HAS___PROGNAME=y
+UNIX98PTY_ONLY=y
+ASSUME_DEVPTS=y
+UCLIBC_HAS_LIBUTIL=y
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Advanced Library Settings
+#
+UCLIBC_PWD_BUFFER_SIZE=256
+UCLIBC_GRP_BUFFER_SIZE=256
+
+#
+# Networking Support
+#
+UCLIBC_HAS_IPV6=y
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+UCLIBC_HAS_REENTRANT_RPC=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+
+UCLIBC_HAS_BSD_RES_CLOSE=y
+UCLIBC_HAS_LIBRESOLV_STUB=y
+UCLIBC_HAS_LIBNSL_STUB=y
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_STRING_GENERIC_OPT=y
+UCLIBC_HAS_STRING_ARCH_OPT=y
+UCLIBC_HAS_CTYPE_TABLES=y
+UCLIBC_HAS_CTYPE_SIGNED=y
+# UCLIBC_HAS_CTYPE_UNSAFE is not set
+UCLIBC_HAS_CTYPE_CHECKED=y
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+UCLIBC_HAS_WCHAR=y
+# UCLIBC_HAS_LOCALE is not set
+UCLIBC_HAS_HEXADECIMAL_FLOATS=y
+UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+UCLIBC_HAS_STDIO_BUFSIZ_256=y
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_4096 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y
+UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y
+UCLIBC_HAS_PRINTF_M_SPEC=y
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+UCLIBC_HAS_GNU_GETOPT=y
+UCLIBC_HAS_GNU_GETSUBOPT=y
+
+#
+# Big and Tall
+#
+UCLIBC_HAS_REGEX=y
+# UCLIBC_HAS_REGEX_OLD is not set
+UCLIBC_HAS_FNMATCH=y
+# UCLIBC_HAS_FNMATCH_OLD is not set
+UCLIBC_HAS_WORDEXP=y
+UCLIBC_HAS_NFTW=y
+UCLIBC_HAS_FTW=y
+UCLIBC_HAS_FTS=y
+UCLIBC_HAS_GLOB=y
+UCLIBC_HAS_GNU_GLOB=y
+
+#
+# Library Installation Options
+#
+SHARED_LIB_LOADER_PREFIX="/lib"
+RUNTIME_PREFIX="/"
+DEVEL_PREFIX="//usr"
+MULTILIB_DIR="lib"
+
+#
+# Security options
+#
+# UCLIBC_BUILD_PIE is not set
+# UCLIBC_HAS_ARC4RANDOM is not set
+# HAVE_NO_SSP is not set
+# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+UCLIBC_BUILD_NOW=y
+UCLIBC_BUILD_NOEXECSTACK=y
+
+#
+# uClibc development/debugging options
+#
+CROSS_COMPILER_PREFIX=""
+UCLIBC_EXTRA_CFLAGS=""
+# DODEBUG is not set
+# DODEBUG_PT is not set
+# DOSTRIP is not set
+# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
+# UCLIBC_MALLOC_DEBUGGING is not set
+UCLIBC_HAS_BACKTRACE=y
+WARNINGS="-Wall"
+# EXTRA_WARNINGS is not set
+# DOMULTI is not set
+# UCLIBC_MJN3_ONLY is not set
+
+# math stuff for perl
+DO_C99_MATH=y
+UCLIBC_HAS_LONG_DOUBLE_MATH=y
+UCLIBC_HAS_FENV=y
+UCLIBC_LINUX_MODULE_26=y
+# UCLIBC_LINUX_MODULE_24 is not set
+UCLIBC_LINUX_SPECIFIC=y
+UCLIBC_HAS_REALTIME=y
+UCLIBC_HAS_ADVANCED_REALTIME=y
+UCLIBC_HAS_NETWORK_SUPPORT=y
+UCLIBC_HAS_SOCKET=y
+UCLIBC_HAS_BSD_ERR=y
+UCLIBC_HAS_SYSLOG=y
+UCLIBC_HAS_CRYPT=y
+UCLIBC_HAS_CRYPT_IMPL=y
+UCLIBC_HAS_GNU_ERROR=y
+UCLIBC_HAS_PTY=y
+UCLIBC_BSD_SPECIFIC=y
+UCLIBC_HAS_EPOLL=y
+UCLIBC_HAS_FLOATS=y
+
+# The below option is needed for ARM since depending
+# upong what intruction set is chosen this will be
+# enabled. As such it is harmless and will be punted
+# by menuconfig for other arches.
+
+# COMPILE_IN_THUMB_MODE is not set
+
+# needed by systemd
+UCLIBC_HAS_UTMPX=y
+UCLIBC_LINUX_MODULE_26=y
+UCLIBC_HAS_RESOLVER_SUPPORT=y
+# needed for LTP
+UCLIBC_SUSV4_LEGACY=y
+UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y
+DO_XSI_MATH=y
+UCLIBC_SV4_DEPRECATED=y
diff --git a/meta/recipes-core/uclibc/uclibc-git/uClibc.machine b/meta/recipes-core/uclibc/uclibc-git/uClibc.machine
new file mode 100644
index 0000000..595f444
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-git/uClibc.machine
@@ -0,0 +1,14 @@
+#
+# Automatically generated make config: don't edit
+# Version: 0.9.32-git
+# Mon Jul 19 01:34:29 2010
+#
+#
+# Using ELF file format
+#
+FORCE_OPTIONS_FOR_ARCH=y
+ARCH_HAS_MMU=y
+ARCH_USE_MMU=y
+KERNEL_HEADERS="/usr/include"
+HAVE_DOT_CONFIG=y
+
diff --git a/meta/recipes-core/uclibc/uclibc-initial_git.bb b/meta/recipes-core/uclibc/uclibc-initial_git.bb
new file mode 100644
index 0000000..c937ccb
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-initial_git.bb
@@ -0,0 +1,36 @@
+SECTION = "base"
+require uclibc.inc
+require uclibc-git.inc
+
+DEPENDS = "linux-libc-headers ncurses-native virtual/${TARGET_PREFIX}gcc-initial libgcc-initial kern-tools-native"
+PROVIDES = "virtual/${TARGET_PREFIX}libc-initial"
+
+PACKAGES = ""
+PACKAGES_DYNAMIC = ""
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+
+do_install() {
+	# Install initial headers into the cross dir
+	make PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
+		install_headers install_startfiles
+
+        # add links to linux-libc-headers: final uclibc build need this.
+        for t in linux asm asm-generic; do
+                if [ -d ${D}${includedir}/$t ]; then
+                    rm -rf ${D}${includedir}/$t
+                fi
+                ln -sf ${STAGING_DIR_TARGET}${includedir}/$t ${D}${includedir}/
+        done
+
+}
+do_compile() {
+	:
+}
+
+do_siteconfig () {
+        :
+}
+
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
diff --git a/meta/recipes-core/uclibc/uclibc-package.inc b/meta/recipes-core/uclibc/uclibc-package.inc
new file mode 100644
index 0000000..c1815f9
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc-package.inc
@@ -0,0 +1,37 @@
+# Ensure the uclibc-dev package is processed before uclibc-staticdev to allow
+# *_nonshared.a libraries to be packaged in the uclibc-dev package.
+PACKAGES = "ldd uclibc-utils-dbg uclibc-utils uclibc-gconv uclibc-thread-db uclibc-argp uclibc-backtrace uclibc-libcrypt uclibc-libintl uclibc-libnsl uclibc-libresolv uclibc-libm uclibc-libdl uclibc-libutil uclibc-libpthread uclibc-librt ${PN}-dbg ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}"
+
+FILES_uclibc-libcrypt = "${base_libdir}/libcrypt*.so.* ${base_libdir}/libcrypt-*.so"
+FILES_uclibc-libintl = "${base_libdir}/libintl*.so.* ${base_libdir}/libintl-*.so"
+FILES_uclibc-libnsl = "${base_libdir}/libnsl*.so.* ${base_libdir}/libnsl-*.so"
+FILES_uclibc-libresolv = "${base_libdir}/libresolv*.so.* ${base_libdir}/libresolv-*.so"
+FILES_uclibc-libm = "${base_libdir}/libm*.so.* ${base_libdir}/libm-*.so"
+FILES_uclibc-libdl = "${base_libdir}/libdl*.so.* ${base_libdir}/libdl-*.so"
+FILES_uclibc-libutil = "${base_libdir}/libutil*.so.* ${base_libdir}/libutil-*.so"
+FILES_uclibc-libpthread = "${base_libdir}/libpthread*.so.* ${base_libdir}/libpthread-*.so"
+FILES_uclibc-librt = "${base_libdir}/librt*.so.* ${base_libdir}/librt-*.so"
+
+FILES_ldd = "${bindir}/ldd"
+FILES_uclibc-utils = "${bindir} ${sbindir}"
+FILES_uclibc-utils-dbg += "${bindir}/.debug ${sbindir}/.debug"
+FILES_uclibc-gconv = "${libdir}/gconv"
+FILES_uclibc-thread-db = "${base_libdir}/libthread_db*"
+FILES_uclibc-argp = "${base_libdir}/libuargp-*.so ${base_libdir}/libuargp*.so.*"
+FILES_uclibc-backtrace = "${base_libdir}/libubacktrace-*.so ${base_libdir}/libubacktrace*.so.*"
+
+# The last line (gdb and lib1) is for uclinux-uclibc builds
+uclibc_baselibs = "${base_libdir}/ld*.so.* ${base_libdir}/ld*.so \
+                   ${base_libdir}/libc*.so.* ${base_libdir}/libuClibc-*.so \
+                   ${libdir}/libc.gdb ${libdir}/libc ${base_libdir}/lib1.so \
+                  "
+FILES_SOLIBSDEV = "${libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-dev += "\
+        ${libdir}/lib*.so \
+        ${libdir}/*_nonshared.a \
+        ${libdir}/[S]*crt[1in].o \
+        ${libdir}/crtreloc*.o \
+        ${includedir}/*.h ${includedir}/*/*.h \
+       "
+FILES_${PN} = "${sysconfdir} ${uclibc_baselibs} /sbin/ldconfig \
+               ${libexecdir} ${datadir}/zoneinfo ${libdir}/locale"
diff --git a/meta/recipes-core/uclibc/uclibc.inc b/meta/recipes-core/uclibc/uclibc.inc
new file mode 100644
index 0000000..533aa3d
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc.inc
@@ -0,0 +1,168 @@
+SUMMARY = "C library for embedded systems"
+DESCRIPTION = "The name uClibc is an abbreviation for 'the \
+microcontroller C library'. For simplicity, uClibc is pronounced \
+'yew-see-lib-see'.  The goal of uClibc is to provide as much \
+functionality as possible in a small amount of space, and it is intended \
+primarily for embedded use. It is also highly configurable in supported \
+features, at the cost of ABI differences for different configurations. \
+uClibc has been designed from the ground up to be a C library for \
+embedded Linux.  It is NOT compatible with binaries linked against glibc."
+
+LICENSE = "LGPLv2.1+"
+SECTION = "libs"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+		    file://COPYING.LIB.boilerplate;md5=aaddeadcddeb918297e0e4afc52ce46f \
+file://${S}/test/regex/testregex.c;beginline=1;endline=31;md5=234efb227d0a40677f895e4a1e26e960"
+PR = "r9"
+
+require uclibc-config.inc
+
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
+
+# siteconfig.bbclass runs configure which needs a working compiler
+# For the compiler to work we need a working libc yet libc isn't
+# in the sysroots directory at this point. This means the libc.so
+# linker script won't work as the --sysroot setting isn't correct.
+# Here we create a hacked up libc linker script and pass in the right
+# flags to let configure work. Ugly.
+EXTRASITECONFIG = "CFLAGS='${CFLAGS} -Wl,-L${WORKDIR}/site_config_libc -L${WORKDIR}/site_config_libc -L${SYSROOT_DESTDIR}${libdir} -L${SYSROOT_DESTDIR}${base_libdir} -Wl,-L${SYSROOT_DESTDIR}${libdir} -Wl,-L${SYSROOT_DESTDIR}${base_libdir}'"
+siteconfig_do_siteconfig_gencache_prepend = " \
+mkdir -p ${WORKDIR}/site_config_libc; \
+cp ${SYSROOT_DESTDIR}${libdir}/libc.so ${WORKDIR}/site_config_libc; \
+sed -i -e 's# ${base_libdir}# ${SYSROOT_DESTDIR}${base_libdir}#g' -e 's# ${libdir}# ${SYSROOT_DESTDIR}${libdir}#g' ${WORKDIR}/site_config_libc/libc.so; \
+"
+
+# For now, we will skip building of a gcc package if it is a uclibc one
+# and our build is not a uclibc one, and we skip a glibc one if our build
+# is a uclibc build.
+COMPATIBLE_HOST = ".*-uclibc.*"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+# do_stage barfs on a CC with whitespace, therefore put the 'HOST_CC_ARCH' in
+# the CFLAGS (when building the utils).
+OEMAKE_NO_CC = "'STRIPTOOL=true' 'LD=${LD}'"
+EXTRA_OEMAKE = "${OEMAKE_NO_CC} \
+                'HOSTCC=${BUILD_CC}' \
+                'HOST_CFLAGS=${BUILD_CFLAGS}' \
+                'CC=${CC}' \
+                ARCH=${UCLIBC_ARCH}"
+
+EXTRA_OEMAKE_task_do_package = "${OEMAKE_NO_CC}"
+
+# enable verbose output:
+export V="2"
+
+# -O<n> -fno-omit-frame-pointer ends up with GCC ICE on thumb as reported
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44860
+#
+CFLAGS_arm := "${@oe_filter_out('-fno-omit-frame-pointer', '${CFLAGS}', d)}"
+UCLIBC_EXTRA_CFLAGS  := "${@oe_filter_out('(-I\S+|-i\S+)', '${CFLAGS}', d)}"
+
+do_compile_prepend () {
+  unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+  oe_runmake pregen
+}
+
+configmangle = '/^KERNEL_HEADERS/d; \
+                /^RUNTIME_PREFIX/d; \
+                /^DEVEL_PREFIX/d; \
+                /^SHARED_LIB_LOADER_PREFIX/d; \
+                /^UCLIBC_EXTRA_CFLAGS/d; \
+                s,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g; \
+                ${@["","s,.*COMPILE_IN_THUMB_MODE.*,COMPILE_IN_THUMB_MODE=y,;"][d.getVar("ARM_INSTRUCTION_SET", True) != "arm"]} \
+                ${@["","s,.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=y,;"][d.getVar("USE_NLS", True) == "yes"]} \
+                ${@["","s,.*LDSO_GNU_HASH_SUPPORT.*,# LDSO_GNU_HASH_SUPPORT is not set,;"][d.getVar("TARGET_ARCH", True) in ['mips', 'mipsel', 'mips64', 'mips64el', 'avr32']]} \
+                /^CROSS/d; \
+                /^TARGET_ARCH=/d; \
+                /^TARGET_/s,^\([^=]*\).*,# \1 is not set,g; \
+                s,^DOSTRIP.*,# DOSTRIP is not set,g; \
+                /_[EO]*ABI/d; \
+                /HAS_FPU/d; \
+                ${@["","s,.*MULTILIB_DIR.*,MULTILIB_DIR=\"${baselib}\",;"][d.getVar("baselib", True) != "lib"]} \
+               '
+OE_FEATURES := "${@features_to_uclibc_conf(d)}"
+OE_DEL      := "${@features_to_uclibc_del(d)}"
+python () {
+    if "${OE_DEL}":
+        d.setVar('configmangle_append', "${OE_DEL}" + "\n")
+
+    # by default uclibc uses mips1 ISA for o32 ABI
+    # if we use TARGET_CC_ARCH="-march=mips32" we end up 
+    # with conflicting march options to gcc. Here we
+    # ask for MIPS32 ISA to match the chosen arch
+    tune = d.getVar("DEFAULTTUNE", True)
+    if tune.startswith('mips32'):
+        import re
+        tune = re.sub('(el)*(-nf)*', '', tune)
+        d.setVar('configmangle_append',
+                 "/^### MIPS32_CHECK$/a\\\nCONFIG_MIPS_ISA_%s=y\n\n" % (tune.upper()))
+    if "${OE_FEATURES}":
+        d.setVar('configmangle_append',
+                   "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
+                   ("\\n".join((d.expand("${OE_FEATURES}").split("\n")))))
+    d.setVar('configmangle_append',
+                 "/^### CROSS$/a\\\n%s\n" %
+                  ("\\n".join(["CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"",
+                        "UCLIBC_EXTRA_CFLAGS=\"${UCLIBC_EXTRA_CFLAGS}\"",
+                         "KERNEL_HEADERS=\"${STAGING_INCDIR}\"",
+                         "RUNTIME_PREFIX=\"/\"",
+                         "DEVEL_PREFIX=\"/${prefix}\"",
+                         "SHARED_LIB_LOADER_PREFIX=\"/lib\"",
+                        ])
+                  ))
+    d.setVar('configmangle_append',
+                 "/^### TGT$/a\\\nTARGET_ARCH=\"%s\"\\nTARGET_%s=y\n" %
+                        ("${UCLIBC_ARCH}", "${UCLIBC_ARCH}"))
+    d.setVar('configmangle_append',
+    "/^### FPU$/a\\\n%s\n\n" % (["UCLIBC_HAS_FPU=y","# UCLIBC_HAS_FPU is not set"][d.getVar('TARGET_FPU', True) in [ 'soft' ]]))
+    if "${UCLIBC_ENDIAN}":
+        d.setVar('configmangle_append',
+                   "/^### ABI$/a\\\nARCH_WANTS_%s_ENDIAN=y\n\n" % ("${UCLIBC_ENDIAN}"))
+    if "${UCLIBC_ABI}":
+        d.setVar('configmangle_append',
+                   "/^### ABI$/a\\\nCONFIG_%s=y\n\n" % ("${UCLIBC_ABI}"))
+}
+
+python do_patch_append() {
+    import subprocess
+    subprocess.call("ln -sf ${STAGING_INCDIR}/linux ${S}/include/linux", shell=True)
+    subprocess.call("ln -sf ${STAGING_INCDIR}/asm ${S}/include/asm", shell=True)
+}
+
+do_configure() {
+        rm -f ${S}/.config
+
+        # OpenEmbedded splits the uClibc.config in two parts:
+        # uClibc.machine, uClibc.distro
+        echo "### uClibc.machine ###" >${S}/merged.config
+        cat ${WORKDIR}/uClibc.machine >>${S}/merged.config
+        echo "### uClibc.distro ###" >>${S}/merged.config
+        cat ${WORKDIR}/uClibc.distro >>${S}/merged.config
+        echo "### CROSS" >>${S}/merged.config
+        echo "### TGT" >>${S}/merged.config
+        echo "### MMU" >>${S}/merged.config
+        echo "### FPU" >>${S}/merged.config
+        echo "### ABI" >>${S}/merged.config
+        echo "### DISTRO FEATURES" >>${S}/merged.config
+        echo "### MIPS32_CHECK" >>${S}/merged.config
+
+        # Mangle the resulting .config depending on OE variables
+        sed -i -e '${configmangle}' ${S}/merged.config
+	cp ${S}/merged.config .config
+        merge_config.sh -r -n -m .config ${@" ".join(find_cfgs(d))}
+	cml1_do_configure
+
+}
+
+do_install() {
+	oe_runmake PREFIX=${D} install
+	rm -rf ${D}${includedir}/iconv.h
+}
+
+# build ldd, ldconfig and friends but only for full uclibc
+do_install_append_pn-uclibc () {
+        oe_runmake PREFIX=${D} "SSP_ALL_CFLAGS=${TARGET_LINK_HASH_STYLE}" -C utils utils_install
+}
+
diff --git a/meta/recipes-core/uclibc/uclibc_git.bb b/meta/recipes-core/uclibc/uclibc_git.bb
new file mode 100644
index 0000000..fd02b3d
--- /dev/null
+++ b/meta/recipes-core/uclibc/uclibc_git.bb
@@ -0,0 +1,22 @@
+require uclibc.inc
+require uclibc-package.inc
+require uclibc-git.inc
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+
+PROVIDES += "virtual/libc virtual/${TARGET_PREFIX}libc-for-gcc"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils \
+           virtual/${TARGET_PREFIX}gcc-initial \
+           virtual/${TARGET_PREFIX}libc-initial \
+           linux-libc-headers ncurses-native \
+           libgcc-initial kern-tools-native"
+
+RDEPENDS_${PN}-dev = "linux-libc-headers-dev"
+RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
+# uclibc does not really have libsegfault but then using the one from glibc is also not
+# going to work. So we pretend that we have it to make bitbake not pull other recipes
+# to satisfy this dependency for the images/tasks
+
+RPROVIDES_${PN} += "libsegfault rtld(GNU_HASH)"
diff --git a/meta/recipes-core/udev/udev-extraconf/automount.rules b/meta/recipes-core/udev/udev-extraconf/automount.rules
new file mode 100644
index 0000000..62578ea
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/automount.rules
@@ -0,0 +1,19 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+#    For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Media automounting
+SUBSYSTEM=="block", ACTION=="add"    RUN+="/etc/udev/scripts/mount.sh"
+SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
+SUBSYSTEM=="block", ACTION=="change", ENV{DISK_MEDIA_CHANGE}=="1" RUN+="/etc/udev/scripts/mount.sh"
diff --git a/meta/recipes-core/udev/udev-extraconf/autonet.rules b/meta/recipes-core/udev/udev-extraconf/autonet.rules
new file mode 100644
index 0000000..19676aa
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/autonet.rules
@@ -0,0 +1,19 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+#    For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Handle network interface setup
+SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
+SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
+
diff --git a/meta/recipes-core/udev/udev-extraconf/localextra.rules b/meta/recipes-core/udev/udev-extraconf/localextra.rules
new file mode 100644
index 0000000..3d51d3e
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/localextra.rules
@@ -0,0 +1,23 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+#    For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# The first rtc device is symlinked to /dev/rtc
+KERNEL=="rtc0", SYMLINK+="rtc"
+
+#The first framebuffer is symlinked to /dev/fb
+KERNEL=="fb0",  SYMLINK+="fb"
+
+# Make all input devices read-write to the input group
+SUBSYSTEM=="input", GROUP="input", MODE="660"
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.blacklist b/meta/recipes-core/udev/udev-extraconf/mount.blacklist
new file mode 100644
index 0000000..e493494
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/mount.blacklist
@@ -0,0 +1,5 @@
+/dev/loop
+/dev/ram
+/dev/mtdblock
+/dev/md
+/dev/dm-*
diff --git a/meta/recipes-core/udev/udev-extraconf/mount.sh b/meta/recipes-core/udev/udev-extraconf/mount.sh
new file mode 100644
index 0000000..3eea910
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/mount.sh
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# Called from udev
+#
+# Attempt to mount any added block devices and umount any removed devices
+
+
+MOUNT="/bin/mount"
+PMOUNT="/usr/bin/pmount"
+UMOUNT="/bin/umount"
+for line in `grep -v ^# /etc/udev/mount.blacklist`
+do
+	if [ ` expr match "$DEVNAME" "$line" ` -gt 0 ];
+	then
+		logger "udev/mount.sh" "[$DEVNAME] is blacklisted, ignoring"
+		exit 0
+	fi
+done
+
+automount() {	
+	name="`basename "$DEVNAME"`"
+
+	! test -d "/run/media/$name" && mkdir -p "/run/media/$name"
+	# Silent util-linux's version of mounting auto
+	if [ "x`readlink $MOUNT`" = "x/bin/mount.util-linux" ] ;
+	then
+		MOUNT="$MOUNT -o silent"
+	fi
+	
+	# If filesystem type is vfat, change the ownership group to 'disk', and
+	# grant it with  w/r/x permissions.
+	case $ID_FS_TYPE in
+	vfat|fat)
+		MOUNT="$MOUNT -o umask=007,gid=`awk -F':' '/^disk/{print $3}' /etc/group`"
+		;;
+	# TODO
+	*)
+		;;
+	esac
+
+	if ! $MOUNT -t auto $DEVNAME "/run/media/$name"
+	then
+		#logger "mount.sh/automount" "$MOUNT -t auto $DEVNAME \"/run/media/$name\" failed!"
+		rm_dir "/run/media/$name"
+	else
+		logger "mount.sh/automount" "Auto-mount of [/run/media/$name] successful"
+		touch "/tmp/.automount-$name"
+	fi
+}
+	
+rm_dir() {
+	# We do not want to rm -r populated directories
+	if test "`find "$1" | wc -l | tr -d " "`" -lt 2 -a -d "$1"
+	then
+		! test -z "$1" && rm -r "$1"
+	else
+		logger "mount.sh/automount" "Not removing non-empty directory [$1]"
+	fi
+}
+
+# No ID_FS_TYPE for cdrom device, yet it should be mounted
+name="`basename "$DEVNAME"`"
+[ -e /sys/block/$name/device/media ] && media_type=`cat /sys/block/$name/device/media`
+
+if [ "$ACTION" = "add" ] && [ -n "$DEVNAME" ] && [ -n "$ID_FS_TYPE" -o "$media_type" = "cdrom" ]; then
+	if [ -x "$PMOUNT" ]; then
+		$PMOUNT $DEVNAME 2> /dev/null
+	elif [ -x $MOUNT ]; then
+    		$MOUNT $DEVNAME 2> /dev/null
+	fi
+	
+	# If the device isn't mounted at this point, it isn't
+	# configured in fstab (note the root filesystem can show up as
+	# /dev/root in /proc/mounts, so check the device number too)
+	if expr $MAJOR "*" 256 + $MINOR != `stat -c %d /`; then
+		grep -q "^$DEVNAME " /proc/mounts || automount
+	fi
+fi
+
+
+if [ "$ACTION" = "remove" ] || [ "$ACTION" = "change" ] && [ -x "$UMOUNT" ] && [ -n "$DEVNAME" ]; then
+	for mnt in `cat /proc/mounts | grep "$DEVNAME" | cut -f 2 -d " " `
+	do
+		$UMOUNT $mnt
+	done
+	
+	# Remove empty directories from auto-mounter
+	name="`basename "$DEVNAME"`"
+	test -e "/tmp/.automount-$name" && rm_dir "/run/media/$name"
+fi
diff --git a/meta/recipes-core/udev/udev-extraconf/network.sh b/meta/recipes-core/udev/udev-extraconf/network.sh
new file mode 100644
index 0000000..3ee9271
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf/network.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+# We get two "add" events for hostap cards due to wifi0
+echo "$INTERFACE" | grep -q wifi && exit 0
+
+# udevd does clearenv(). Export shell PATH to children.
+export PATH
+
+# Check if /etc/init.d/network has been run yet to see if we are 
+# called by starting /etc/rcS.d/S03udev and not by hotplugging a device
+#
+# At this stage, network interfaces should not be brought up
+# automatically because:
+# a)	/etc/init.d/network has not been run yet (security issue)
+# b) 	/var has not been populated yet so /etc/resolv,conf points to 
+#	oblivion, making the network unusable
+#
+
+spoofp="`grep ^spoofprotect /etc/network/options`"
+if test -z "$spoofp"
+then
+	# This is the default from /etc/init.d/network
+	spoofp_val=yes
+else
+	spoofp_val=${spoofp#spoofprotect=}
+fi
+
+test "$spoofp_val" = yes && spoofp_val=1 || spoofp_val=0
+
+# I think it is safe to assume that "lo" will always be there ;)
+if test "`cat /proc/sys/net/ipv4/conf/lo/rp_filter`" != "$spoofp_val" -a -n "$spoofp_val"
+then
+	echo "$INTERFACE" >> /dev/udev_network_queue	
+	exit 0
+fi
+
+#
+# Code taken from pcmcia-cs:/etc/pcmcia/network
+#
+
+# if this interface has an entry in /etc/network/interfaces, let ifupdown
+# handle it
+if grep -q "iface \+$INTERFACE" /etc/network/interfaces; then
+  case $ACTION in
+    add)
+    	ifconfig | grep -q "^$INTERFACE" || ifup $INTERFACE
+    	;;
+    remove)
+    	ifdown $INTERFACE
+    	;;
+  esac
+  
+  exit 0
+fi
diff --git a/meta/recipes-core/udev/udev-extraconf_1.1.bb b/meta/recipes-core/udev/udev-extraconf_1.1.bb
new file mode 100644
index 0000000..6fbd925
--- /dev/null
+++ b/meta/recipes-core/udev/udev-extraconf_1.1.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Extra machine specific configuration files"
+DESCRIPTION = "Extra machine specific configuration files for udev, specifically blacklist information."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = " \
+       file://automount.rules \
+       file://mount.sh \
+       file://mount.blacklist \
+       file://autonet.rules \
+       file://network.sh \
+       file://localextra.rules \
+"
+
+S = "${WORKDIR}"
+
+
+do_install() {
+    install -d ${D}${sysconfdir}/udev/rules.d
+
+    install -m 0644 ${WORKDIR}/automount.rules     ${D}${sysconfdir}/udev/rules.d/automount.rules
+    install -m 0644 ${WORKDIR}/autonet.rules       ${D}${sysconfdir}/udev/rules.d/autonet.rules
+    install -m 0644 ${WORKDIR}/localextra.rules    ${D}${sysconfdir}/udev/rules.d/localextra.rules
+
+    install -m 0644 ${WORKDIR}/mount.blacklist     ${D}${sysconfdir}/udev/
+
+    install -d ${D}${sysconfdir}/udev/scripts/
+
+    install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh
+    install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts
+}
+
+FILES_${PN} = "${sysconfdir}/udev"
+RDEPENDS_${PN} = "udev"
+CONFFILES_${PN} = "${sysconfdir}/udev/mount.blacklist"
+
+# to replace udev-extra-rules from meta-oe
+RPROVIDES_${PN} = "udev-extra-rules"
+RREPLACES_${PN} = "udev-extra-rules"
+RCONFLICTS_${PN} = "udev-extra-rules"
diff --git a/meta/recipes-core/udev/udev.inc b/meta/recipes-core/udev/udev.inc
new file mode 100644
index 0000000..a00dad5
--- /dev/null
+++ b/meta/recipes-core/udev/udev.inc
@@ -0,0 +1,111 @@
+SUMMARY = "/dev/ and hotplug management daemon"
+DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \
+/dev/, handles hotplug events and loads drivers at boot time."
+HOMEPAGE = "http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev/udev.html"
+LICENSE = "GPLv2.0+ & LGPLv2.1+"
+LICENSE_${PN} = "GPLv2.0+"
+LICENSE_libudev = "LGPLv2.1+"
+LICENSE_libgudev = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://src/COPYING;md5=17c4e5fb495e6707ac92a3864926f979 \
+                    file://src/gudev/COPYING;md5=fb494485a7d0505308cb68e4997cc266"
+
+LDFLAGS += "-lrt"
+
+DEPENDS = "glib-2.0 libusb usbutils pciutils glib-2.0-native gperf-native libxslt-native util-linux"
+RPROVIDES_${PN} = "hotplug"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
+           file://0001-Fixing-keyboard_force_release.sh-shell-script-path.patch \
+           file://avoid-mouse-autosuspend.patch \
+           file://run.rules \
+           file://udev.rules \
+           file://devfs-udev.rules \
+           file://links.conf \
+           file://permissions.rules \
+           file://local.rules \
+           file://udev-cache \
+           file://udev-cache.default \
+           file://add-install-ptest.patch \
+           file://fix_rule-syntax-regex-ptest.patch \
+           file://run-ptest \
+           file://init"
+
+inherit autotools pkgconfig update-rc.d ptest
+RDEPENDS_${PN}-ptest += "make perl python"
+
+libexecdir = "${base_libdir}"
+EXTRA_OECONF = "--disable-introspection \
+                --with-rootlibdir=${base_libdir} \
+                --with-pci-ids-path=${datadir}/pci.ids \
+                ac_cv_file__usr_share_pci_ids=no \
+                ac_cv_file__usr_share_hwdata_pci_ids=no \
+                ac_cv_file__usr_share_misc_pci_ids=yes \
+                --sbindir=${base_sbindir} \
+                --libexecdir=${nonarch_base_libdir} \
+                --with-rootlibdir=${base_libdir} \
+                --with-rootprefix= \
+                --without-systemdsystemunitdir \
+               "
+
+PACKAGES =+ "udev-cache"
+PACKAGES =+ "libudev"
+PACKAGES =+ "libgudev"
+
+INITSCRIPT_PACKAGES = "udev udev-cache"
+INITSCRIPT_NAME_udev = "udev"
+INITSCRIPT_PARAMS_udev = "start 04 S ."
+INITSCRIPT_NAME_udev-cache = "udev-cache"
+INITSCRIPT_PARAMS_udev-cache = "start 36 S ."
+
+FILES_${PN} += "${libexecdir} ${libdir}/ConsoleKit ${nonarch_base_libdir}/udev ${bindir}/udevadm"
+RRECOMMENDS_${PN} += "udev-cache"
+
+# udev-utils has been removed as a package.  Note that udev conflicts with udev-utils so that
+# udev-utils is removed from systems on upgrade.
+RCONFLICTS_${PN} += "udev-utils"
+RREPLACES_${PN} += "udev-utils"
+
+FILES_${PN}-dbg += "${libexecdir}/.debug"
+FILES_${PN}-dbg += "${base_libdir}/udev/.debug/"
+FILES_${PN}-dbg += "${base_libdir}/udev/.debug/*"
+FILES_${PN}-dbg += "${nonarch_base_libdir}/udev/.debug/*"
+FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \
+                   ${includedir}/libudev.h ${libdir}/libudev.so ${libdir}/libudev.la \
+                   ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc \
+                   ${includedir}/gudev* ${libdir}/libgudev*.so ${libdir}/libgudev*.la \
+                   ${libdir}/libgudev*.a ${libdir}/pkgconfig/gudev*.pc"
+FILES_libudev = "${base_libdir}/libudev.so.*"
+FILES_libgudev = "${base_libdir}/libgudev*.so.* ${libdir}/libgudev*.so.*"
+FILES_udev-cache = "${sysconfdir}/init.d/udev-cache ${sysconfdir}/default/udev-cache"
+
+do_install_append () {
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev
+	install -m 0755 ${WORKDIR}/udev-cache ${D}${sysconfdir}/init.d/udev-cache
+	sed -i s%@UDEVD@%${nonarch_base_libdir}/udev/udevd% ${D}${sysconfdir}/init.d/udev
+	sed -i s%@UDEVD@%${nonarch_base_libdir}/udev/udevd% ${D}${sysconfdir}/init.d/udev-cache
+
+	install -d ${D}${sysconfdir}/default
+	install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache
+
+	touch ${D}${sysconfdir}/udev/cache.data
+
+	install -d ${D}${sysconfdir}/udev/rules.d/
+
+	install -m 0644 ${WORKDIR}/local.rules         ${D}${sysconfdir}/udev/rules.d/local.rules
+
+	# hid2hci has moved to bluez4. removed in udev as of version 169
+	rm -f ${D}${base_libdir}/udev/hid2hci
+
+	echo 'udev_run="/var/run/udev"' >> ${D}${sysconfdir}/udev/udev.conf
+}
+
+# As systemd also builds udev, skip this package if we're doing a systemd build.
+python () {
+    if bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
+        raise bb.parse.SkipPackage("'systemd' in DISTRO_FEATURES")
+}
+do_compile_ptest() {
+    oe_runmake test-udev
+}
diff --git a/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch b/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch
new file mode 100644
index 0000000..41deafa
--- /dev/null
+++ b/meta/recipes-core/udev/udev/0001-Fixing-keyboard_force_release.sh-shell-script-path.patch
@@ -0,0 +1,35 @@
+From 0f8290c943da298abd269ca60fd8375dfb219971 Mon Sep 17 00:00:00 2001
+From: Alexandru DAMIAN <alexandru.damian@intel.com>
+Date: Thu, 12 Jul 2012 12:54:48 +0300
+Subject: [PATCH] Fixing keyboard_force_release.sh shell script path
+
+With the introduction of rootprefix, the keyboard-force-release.sh.in
+was modified to be executed with @rootprefix@/bin/sh, which is wrong
+because @rootprefix@ defaults to /usr (which is correct), but the
+shell is always at /bin/sh (IEEE Std 1003.2-1992).
+
+Therefore the interpreter for shell scripts needs to be /bin/sh at all times.
+
+The upstream moved to configurable root prefix, this patch taclkes a 
+transition bug, and will not be applied upstream.
+
+Upstream-Status: Inappropriate [legacy version]
+
+Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
+---
+ src/keymap/keyboard-force-release.sh.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/keymap/keyboard-force-release.sh.in b/src/keymap/keyboard-force-release.sh.in
+index dd040ce..597a3a6 100755
+--- a/src/keymap/keyboard-force-release.sh.in
++++ b/src/keymap/keyboard-force-release.sh.in
+@@ -1,4 +1,4 @@
+-#!@rootprefix@/bin/sh -e
++#!/bin/sh -e
+ # read list of scancodes, convert hex to decimal and
+ # append to the atkbd force_release sysfs attribute
+ # $1 sysfs devpath for serioX
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-core/udev/udev/add-install-ptest.patch b/meta/recipes-core/udev/udev/add-install-ptest.patch
new file mode 100644
index 0000000..bfc2e94
--- /dev/null
+++ b/meta/recipes-core/udev/udev/add-install-ptest.patch
@@ -0,0 +1,86 @@
+Adjustements for ptest:
+
+- Add 'install-ptest' rule.
+- Print a standard result line for each test.
+- Replace the use of "tree" with "find".
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Signed-off-by: Alexandra Safta <alst@enea.com>
+Upstream-Status: Pending
+
+Add missing files for rule-syntax-check
+- Add rule-syntax-check.py
+- Add the deployed udev rules to the testdata
+
+Signed-off-by: Max Krummenacher <max.oss.09@gmail.com>
+Upstream-Status: Pending
+--- a/Makefile.am	2012-03-18 16:28:14.000000000 +0100
++++ b/Makefile.am	2013-02-18 10:03:36.531101244 +0100
+@@ -708,3 +708,18 @@
+ 	for i in src/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/libudev/; done
+ 	for i in src/gudev/docs/html/*.{html,css,png}; do rm -f $$i.sign; gpg --armor --detach-sign --output=$$i.sign $$i; done
+ 	for i in src/gudev/docs/html/*.{html,css,png}; do echo $$i; kup put $$i $$i.sign /pub/linux/utils/kernel/hotplug/gudev/; done
++
++RULES = rules/* src/accelerometer/61-accelerometer.rules \
++	 src/cdrom_id/60-cdrom_id.rules \
++	 src/keymap/95-keyboard-force-release.rules src/keymap/95-keymap.rules \
++	 src/mtd_probe/75-probe_mtd.rules src/v4l_id/60-persistent-v4l.rules
++
++install-ptest:
++	install test-udev $(DESTDIR)
++	cp Makefile $(DESTDIR)
++	sed -i -e 's|^Makefile:|_Makefile:|' $(DESTDIR)/Makefile
++	install -d $(DESTDIR)/test $(DESTDIR)/rules
++	(cd $(top_srcdir) && install $(TESTS) $(DESTDIR)/test)
++	(cd $(top_srcdir) && install test/rule-syntax-check.py $(DESTDIR)/test)
++	(cd $(top_srcdir) && install $(RULES) $(DESTDIR)/rules)
++	cp $(top_srcdir)/test/sys.tar.xz $(DESTDIR)/test/
+--- a/test/udev-test.pl	2012-03-18 16:43:36.000000000 +0100
++++ b/test/udev-test.pl	2013-02-18 10:31:29.706357321 +0100
+@@ -1459,11 +1459,13 @@
+                 print "add:         error";
+                 if ($rules->{exp_add_error}) {
+                         print " as expected\n";
++                        print "XFAIL: TEST $number: $rules->{desc}: add\n";
+                 } else {
+                         print "\n";
+-                        system("tree $udev_root");
++                        system("find $udev_root");
+                         print "\n";
+                         $error++;
++                        print "FAIL: TEST $number: $rules->{desc}: add\n";
+                         sleep(1);
+                 }
+         }
+@@ -1479,15 +1481,18 @@
+                 print "remove:      error";
+                 if ($rules->{exp_rem_error}) {
+                         print " as expected\n";
++                        print "XFAIL: TEST $number: $rules->{desc}: remove\n";
+                 } else {
+                         print "\n";
+-                        system("tree $udev_root");
++                        system("find $udev_root");
+                         print "\n";
+                         $error++;
++                        print "FAIL: TEST $number: $rules->{desc}: remove\n";
+                         sleep(1);
+                 }
+         } else {
+                 print "remove:      ok\n";
++                print "PASS: TEST $number: $rules->{desc}: remove\n";
+         }
+ 
+         print "\n";
+--- a/configure.ac      2013-11-28 09:14:02.814248826 +0100
++++ b/configure.ac      2013-11-28 09:14:34.260874296 +0100
+@@ -6,7 +6,7 @@
+        [http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html])
+ AC_CONFIG_SRCDIR([src/udevd.c])
+ AC_CONFIG_AUX_DIR([build-aux])
+-AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
++AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects serial-tests])
+ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
+ AC_CONFIG_MACRO_DIR([m4])
+
diff --git a/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch b/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch
new file mode 100644
index 0000000..2c31b33
--- /dev/null
+++ b/meta/recipes-core/udev/udev/avoid-mouse-autosuspend.patch
@@ -0,0 +1,25 @@
+Source: http://cgit.freedesktop.org/systemd/systemd/commit/rules/42-usb-hid-pm.rules?id=e0386cf2809219bbdd30895f46f1f567b56902b6
+
+Some USB ports on external hubs may be reported as "fixed". We only want
+to auto-enable this on ports that are internal to the machine, so check
+the parent state as well.
+
+Upstream-Status: backport
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2013/09/13
+
+Index: udev-182/rules/42-usb-hid-pm.rules
+===================================================================
+--- udev-182.orig/rules/42-usb-hid-pm.rules
++++ udev-182/rules/42-usb-hid-pm.rules
+@@ -46,4 +46,9 @@ ACTION=="add", SUBSYSTEM=="usb", ATTRS{i
+ ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="14dd", ATTR{idProduct}="0002", TEST=="power/control", ATTR{power/control}="auto"
+
+ # USB HID devices that are internal to the machine should also be safe to autosuspend
++# And skip it for devices which are external but say "fixed"
++ACTION=="add", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", ATTRS{removable}=="removable", GOTO="usb_hid_pm_end"
++ACTION=="add", SUBSYSTEM=="usb", SUBSYSTEMS=="usb", ATTRS{removable}=="unknown", GOTO="usb_hid_pm_end"
+ ACTION=="add", SUBSYSTEM=="usb", ATTR{bInterfaceClass}=="03", ATTRS{removable}=="fixed", TEST=="../power/control", ATTR{../power/control}="auto"
++LABEL="usb_hid_pm_end"
++
diff --git a/meta/recipes-core/udev/udev/devfs-udev.rules b/meta/recipes-core/udev/udev/devfs-udev.rules
new file mode 100644
index 0000000..0ba1ad4
--- /dev/null
+++ b/meta/recipes-core/udev/udev/devfs-udev.rules
@@ -0,0 +1,108 @@
+# The use of these rules is not recommended or supported.
+# In a world where devices can come and go at any time, the devfs scheme
+# of simple device enumeration does not help _anything_. Just forget about
+# it. Use custom rules to name your device or look at the persistent device
+# naming scheme, which is implemented for disks and add your subsystem.
+
+# ide block devices
+BUS="ide", KERNEL="hd*", PROGRAM="/etc/udev/ide-devfs.sh %k %b %n", NAME="%k", SYMLINK="%c{1} %c{2}"
+
+# md block devices
+KERNEL="md[0-9]*", NAME="md/%n"
+
+# floppy devices
+KERNEL="fd[0-9]*", NAME="floppy/%n"
+
+# tty devices
+KERNEL="tty[0-9]*",    NAME="vc/%n", SYMLINK="%k"
+KERNEL="ttyS[0-9]*",   NAME="tts/%n", SYMLINK="%k"
+KERNEL="ttyUSB[0-9]*", NAME="tts/USB%n"
+
+# vc devices
+KERNEL="vcs",        NAME="vcc/0"
+KERNEL="vcs[0-9]*",  NAME="vcc/%n"
+KERNEL="vcsa",       NAME="vcc/a0"
+KERNEL="vcsa[0-9]*", NAME="vcc/a%n"
+
+# v4l devices
+KERNEL="video[0-9]*", NAME="v4l/video%n"
+KERNEL="radio[0-9]*", NAME="v4l/radio%n"
+KERNEL="vbi[0-9]*",   NAME="v4l/vbi%n"
+KERNEL="vtx[0-9]*",   NAME="v4l/vtx%n"
+
+# dm devices (ignore them)
+KERNEL="dm-[0-9]*", NAME=""
+
+# i2c devices
+KERNEL="i2c-[0-9]*", NAME="i2c/%n", SYMLINK="%k"
+
+# loop devices
+KERNEL="loop[0-9]*", NAME="loop/%n", SYMLINK="%k"
+
+# ramdisks
+KERNEL="ram[0-9]*", NAME="rd/%n", SYMLINK="%k"
+
+# framebuffer devices
+KERNEL="fb[0-9]*", NAME="fb/%n", SYMLINK="%k"
+
+# misc
+KERNEL="rtc",     NAME="misc/%k", SYMLINK="%k"
+KERNEL="psaux",   NAME="misc/%k", SYMLINK="%k"
+KERNEL="agpgart", NAME="misc/%k", SYMLINK="%k"
+KERNEL="rtc",     NAME="misc/%k", SYMLINK="%k"
+KERNEL="psaux",   NAME="misc/%k", SYMLINK="%k"
+KERNEL="uinput",  NAME="misc/%k", SYMLINK="%k"
+
+# alsa devices
+KERNEL="controlC[0-9]*", NAME="snd/%k"
+KERNEL="hw[CD0-9]*",     NAME="snd/%k"
+KERNEL="pcm[CD0-9cp]*",  NAME="snd/%k"
+KERNEL="midi[CD0-9]*",   NAME="snd/%k"
+KERNEL="timer",          NAME="snd/%k"
+KERNEL="seq",            NAME="snd/%k"
+
+# oss devices
+KERNEL="audio*",     NAME="sound/%k", SYMLINK="%k"
+KERNEL="dmmidi",     NAME="sound/%k", SYMLINK="%k"
+KERNEL="dsp*",       NAME="sound/%k", SYMLINK="%k"
+KERNEL="midi*",      NAME="sound/%k", SYMLINK="%k"
+KERNEL="mixer*",     NAME="sound/%k", SYMLINK="%k"
+KERNEL="sequencer*", NAME="sound/%k", SYMLINK="%k"
+
+# input devices
+KERNEL="mice",   NAME="input/%k"
+KERNEL="mouse*", NAME="input/%k"
+KERNEL="event*", NAME="input/%k"
+KERNEL="js*",    NAME="input/%k"
+KERNEL="ts*",	 NAME="input/%k"
+
+# USB devices
+KERNEL="hiddev*",	NAME="usb/%k"
+KERNEL="auer*",		NAME="usb/%k"
+KERNEL="legousbtower*",	NAME="usb/%k"
+KERNEL="dabusb*",	NAME="usb/%k"
+BUS="usb", KERNEL="lp[0-9]*",	NAME="usb/%k"
+
+# netlink devices
+KERNEL="route",		NAME="netlink/%k"
+KERNEL="skip",		NAME="netlink/%k"
+KERNEL="usersock",	NAME="netlink/%k"
+KERNEL="fwmonitor",	NAME="netlink/%k"
+KERNEL="tcpdiag",	NAME="netlink/%k"
+KERNEL="nflog",		NAME="netlink/%k"
+KERNEL="xfrm",		NAME="netlink/%k"
+KERNEL="arpd",		NAME="netlink/%k"
+KERNEL="route6",	NAME="netlink/%k"
+KERNEL="ip6_fw",	NAME="netlink/%k"
+KERNEL="dnrtmsg",	NAME="netlink/%k"
+KERNEL="tap*",		NAME="netlink/%k"
+
+# CAPI devices
+KERNEL="capi",		NAME="capi20", SYMLINK="isdn/capi20"
+KERNEL="capi*",		NAME="capi/%n"
+
+# Network devices
+KERNEL="tun",		NAME="net/%k"
+
+# raw devices
+KERNEL="raw[0-9]*",     NAME="raw/%k" 
diff --git a/meta/recipes-core/udev/udev/fix_rule-syntax-regex-ptest.patch b/meta/recipes-core/udev/udev/fix_rule-syntax-regex-ptest.patch
new file mode 100644
index 0000000..593c46c
--- /dev/null
+++ b/meta/recipes-core/udev/udev/fix_rule-syntax-regex-ptest.patch
@@ -0,0 +1,58 @@
+The rule-syntax-check script fails with errors like this:
+
+Invalid line /lib/udev/rules.d/95-keymap.rules:49: ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Asus Extra Buttons", ATTR{[dmi/id]product_name}=="W3J", RUN+="keymap $name module-asus-w3j"
+('  clause:', 'ATTR{[dmi/id]product_name}=="W3J"')
+()
+
+
+Move line comment from end of rules file to its own line, the regex used to
+test correct syntax choke on it.
+
+The rule-syntax-check.py uses regex which errournessly complains on ATTR rules
+of the form ATTR{[dmi/id]board_name}=="30B7"
+Use the regex from systemd's script which allow [] characters and additional
+compare operators
+
+The Makefile passes rules-test.sh script a build host path to the testdata.
+Ignore the argument and use a relative path instead.
+
+
+Signed-off-by: Max Krummenacher <max.oss.09@gmail.com>
+Upstream-Status: Inappropriate (cross environment path)
+
+diff -Naur udev-182.orig/src/keymap/95-keymap.rules udev-182/src/keymap/95-keymap.rules
+--- udev-182.orig/src/keymap/95-keymap.rules	2012-02-07 00:01:55.154640792 +0100
++++ udev-182/src/keymap/95-keymap.rules	2015-01-24 20:58:40.156930520 +0100
+@@ -94,7 +94,8 @@
+ ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP G62 Notebook PC", RUN+="keymap $name 0xB2 www"
+ ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP ProBook*", RUN+="keymap $name 0xF8 rfkill"
+ # HP Pavillion dv6315ea has empty DMI_VENDOR
+-ATTR{[dmi/id]board_vendor}=="Quanta", ATTR{[dmi/id]board_name}=="30B7", ATTR{[dmi/id]board_version}=="65.2B", RUN+="keymap $name 0x88 media" # "quick play
++# "quick play"
++ATTR{[dmi/id]board_vendor}=="Quanta", ATTR{[dmi/id]board_name}=="30B7", ATTR{[dmi/id]board_version}=="65.2B", RUN+="keymap $name 0x88 media"
+ 
+ # Gateway clone of Acer Aspire One AOA110/AOA150
+ ENV{DMI_VENDOR}=="Gateway*", ATTR{[dmi/id]product_name}=="*AOA1*", RUN+="keymap $name acer"
+diff -Naur udev-182.orig/test/rule-syntax-check.py udev-182/test/rule-syntax-check.py
+--- udev-182.orig/test/rule-syntax-check.py	2012-02-15 20:10:12.872333342 +0100
++++ udev-182/test/rule-syntax-check.py	2015-01-24 21:08:00.496049600 +0100
+@@ -28,7 +28,7 @@
+ no_args_tests = re.compile('(ACTION|DEVPATH|KERNELS?|NAME|SYMLINK|SUBSYSTEMS?|DRIVERS?|TAG|RESULT|TEST)\s*(?:=|!)=\s*"([^"]*)"$')
+ args_tests = re.compile('(ATTRS?|ENV|TEST){([a-zA-Z0-9/_.*%-]+)}\s*(?:=|!)=\s*"([^"]*)"$')
+ no_args_assign = re.compile('(NAME|SYMLINK|OWNER|GROUP|MODE|TAG|PROGRAM|RUN|LABEL|GOTO|WAIT_FOR|OPTIONS|IMPORT)\s*(?:\+=|:=|=)\s*"([^"]*)"$')
+-args_assign = re.compile('(ATTR|ENV|IMPORT){([a-zA-Z0-9/_.*%-]+)}\s*=\s*"([^"]*)"$')
++args_assign = re.compile('(ATTR|ENV|IMPORT|RUN){([][a-zA-Z0-9/_.*%-]+)}\s*(=|==|\+=)\s*"([^"]*)"$')
+ 
+ result = 0
+ buffer = ''
+--- udev-182.orig/test/rules-test.sh	2012-01-29 01:15:46.000000000 +0100
++++ udev-182/test/rules-test.sh	2015-01-24 17:53:51.201858658 +0100
+@@ -4,7 +4,7 @@
+ # (C) 2010 Canonical Ltd.
+ # Author: Martin Pitt <martin.pitt@ubuntu.com>
+ 
+-[ -n "$srcdir" ] || srcdir=`dirname $0`/..
++srcdir=`dirname $0`/..
+ 
+ # skip if we don't have python
+ type python >/dev/null 2>&1 || {
diff --git a/meta/recipes-core/udev/udev/init b/meta/recipes-core/udev/udev/init
new file mode 100644
index 0000000..0ab028b
--- /dev/null
+++ b/meta/recipes-core/udev/udev/init
@@ -0,0 +1,142 @@
+#!/bin/sh
+
+### BEGIN INIT INFO
+# Provides:          udev
+# Required-Start:    mountvirtfs
+# Required-Stop:     
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Start udevd, populate /dev and load drivers.
+### END INIT INFO
+
+export TZ=/etc/localtime
+
+[ -d /sys/class ] || exit 1
+[ -r /proc/mounts ] || exit 1
+[ -x @UDEVD@ ] || exit 1
+SYSCONF_CACHED="/etc/udev/cache.data"
+SYSCONF_TMP="/dev/shm/udev.cache"
+DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen
+
+# A list of files which are used as a criteria to judge whether the udev cache could be reused.
+CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
+[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags"
+
+# List of files whose metadata (size/mtime/name) will be included in cached
+# system state.
+META_FILE_LIST="lib/udev/rules.d/* etc/udev/rules.d/*"
+
+# Command to compute system configuration.
+sysconf_cmd () {
+	cat -- $CMP_FILE_LIST
+	stat -c '%s %Y %n' -- $META_FILE_LIST | awk -F/ '{print $1 " " $NF;}'
+}
+
+[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
+[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+
+kill_udevd () {
+    pid=`pidof -x udevd`
+    [ -n "$pid" ] && kill $pid
+}
+
+case "$1" in
+  start)
+    export ACTION=add
+    # propagate /dev from /sys
+    echo "Starting udev"
+
+    # Check for requireed devtmpfs before trying to start udev and
+    # mount a no-existant fs.
+    if ! grep -q devtmpfs /proc/filesystems
+    then
+        echo "Missing devtmpfs, which is required for udev to run";
+        echo "Halting..."
+        halt
+    fi
+    # mount the devtmpfs on /dev, if not already done
+    LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
+            mount -n -o mode=0755 -t devtmpfs none "/dev"
+    }
+    [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
+    [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
+    # the automount rule for udev needs /tmp directory available, as /tmp is a symlink
+    # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure
+    # /var/volatile/tmp directory to be available.
+    mkdir -m 1777 -p /var/volatile/tmp
+
+    # Cache handling.
+    if [ "$DEVCACHE" != "" ]; then
+            if [ -e $DEVCACHE ]; then
+		    sysconf_cmd > "$SYSCONF_TMP"
+		    if cmp $SYSCONF_CACHED $SYSCONF_TMP >/dev/null; then
+                            tar xmf $DEVCACHE -C / -m
+                            not_first_boot=1
+                            [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
+                            [ -e $SYSCONF_TMP ] && rm -f "$SYSCONF_TMP"
+                            [ -e "$DEVCACHE_REGEN" ] && rm -f "$DEVCACHE_REGEN"
+                    else
+			    # Output detailed reason why the cached /dev is not used
+			    cat <<EOF
+udev: Not using udev cache because of changes detected in the following files:
+udev:     $CMP_FILE_LIST
+udev:     $META_FILE_LIST
+udev: The udev cache will be regenerated. To identify the detected changes,
+udev: compare the cached sysconf at   $SYSCONF_CACHED
+udev: against the current sysconf at  $SYSCONF_TMP
+EOF
+			    touch "$DEVCACHE_REGEN"
+                    fi
+	    else
+		    if [ "$ROOTFS_READ_ONLY" != "yes" ]; then
+			    # If rootfs is not read-only, it's possible that a new udev cache would be generated;
+			    # otherwise, we do not bother to read files.
+			    touch "$DEVCACHE_REGEN"
+		    fi
+            fi
+    fi
+
+    # make_extra_nodes
+    kill_udevd > "/dev/null" 2>&1
+
+    # trigger the sorted events
+    [ -e /proc/sys/kernel/hotplug ] && echo -e '\000' >/proc/sys/kernel/hotplug
+    @UDEVD@ -d
+
+    udevadm control --env=STARTUP=1
+    if [ "$not_first_boot" != "" ];then
+            if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then
+                PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform"
+            else
+                PLATFORM_BUS_NOMATCH=""
+            fi
+            udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH
+            (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
+    else
+            udevadm trigger --action=add
+            udevadm settle
+    fi
+    ;;
+  stop)
+    echo "Stopping udevd"
+    start-stop-daemon --stop --name udevd --quiet
+    ;;
+  restart)
+    $0 stop
+    sleep 1
+    $0 start
+    ;;
+  status)
+    pid=`pidof -x udevd`
+    if [ -n "$pid" ]; then
+	echo "udevd (pid $pid) is running ..."
+    else
+	echo "udevd is stopped"
+    fi
+    ;;
+  *)
+    echo "Usage: $0 {start|stop|status|restart}"
+    exit 1
+esac
+exit 0
diff --git a/meta/recipes-core/udev/udev/links.conf b/meta/recipes-core/udev/udev/links.conf
new file mode 100644
index 0000000..8fff922
--- /dev/null
+++ b/meta/recipes-core/udev/udev/links.conf
@@ -0,0 +1,21 @@
+# This file does not exist. Please do not ask the debian maintainer about it.
+# You may use it to do strange and wonderful things, at your risk.
+
+L fd		/proc/self/fd
+L stdin		/proc/self/fd/0
+L stdout	/proc/self/fd/1
+L stderr	/proc/self/fd/2
+L core		/proc/kcore
+L sndstat	/proc/asound/oss/sndstat
+L MAKEDEV	/sbin/MAKEDEV
+
+D pts
+D shm
+
+# Hic sunt leones.
+M ppp		c 108 0
+D loop
+M loop/0	b 7 0
+D net
+M net/tun	c 10 200
+
diff --git a/meta/recipes-core/udev/udev/local.rules b/meta/recipes-core/udev/udev/local.rules
new file mode 100644
index 0000000..d502cdd
--- /dev/null
+++ b/meta/recipes-core/udev/udev/local.rules
@@ -0,0 +1,19 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+#    For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Create a symlink to any touchscreen input device
+# Trigger based on input type, that the evbit (-e) has EV_SYN and EV_ABS,
+# has an EV_ABS value (-a) which is used for touchscreen type devices.
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0"
diff --git a/meta/recipes-core/udev/udev/permissions.rules b/meta/recipes-core/udev/udev/permissions.rules
new file mode 100644
index 0000000..205b733
--- /dev/null
+++ b/meta/recipes-core/udev/udev/permissions.rules
@@ -0,0 +1,131 @@
+ACTION!="add", GOTO="permissions_end"
+
+# workarounds needed to synchronize with sysfs
+# only needed for kernels < v2.6.18-rc1
+ENV{PHYSDEVPATH}!="?*", ENV{PHYSDEVBUS}=="?*",	WAIT_FOR_SYSFS="bus"
+SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*",	WAIT_FOR_SYSFS="ioerr_cnt"
+# only needed for kernels < 2.6.16
+SUBSYSTEM=="net",				WAIT_FOR_SYSFS="address"
+# only needed for kernels < 2.6.17
+SUBSYSTEM=="net", ENV{DRIVER}=="?*",		WAIT_FOR_SYSFS="device/driver"
+
+# devices needed to load the drivers providing them
+KERNEL=="tun",					OPTIONS+="ignore_remove"
+KERNEL=="ppp",					OPTIONS+="ignore_remove"
+KERNEL=="loop[0-9]*",				OPTIONS+="ignore_remove"
+
+# default permissions for block devices
+SUBSYSTEM=="block",				GROUP="disk"
+# the aacraid driver is broken and reports that disks removable (see #404927)
+SUBSYSTEM=="block", ATTRS{removable}=="1", \
+	DRIVERS!="aacraid",			GROUP="floppy"
+# all block devices on these buses are "removable"
+SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy"
+
+# IDE devices
+KERNEL=="hd[a-z]|pcd[0-9]*", 			DRIVERS=="ide-cdrom|pcd", \
+	IMPORT{program}="cdrom_id --export $tempnode"
+ENV{ID_CDROM}=="?*",				GROUP="cdrom"
+KERNEL=="ht[0-9]*", 				GROUP="tape"
+KERNEL=="nht[0-9]*", 				GROUP="tape"
+
+# SCSI devices
+KERNEL=="sr[0-9]*", IMPORT{program}="cdrom_id --export $tempnode"
+SUBSYSTEMS=="scsi", ATTRS{type}=="1",				GROUP="tape"
+SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="HP",	GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="Epson",	GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="3", ATTRS{vendor}=="EPSON",	GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="4",				GROUP="cdrom"
+SUBSYSTEMS=="scsi", ATTRS{type}=="5",				GROUP="cdrom"
+SUBSYSTEMS=="scsi", ATTRS{type}=="6",				GROUP="scanner"
+SUBSYSTEMS=="scsi", ATTRS{type}=="8",				GROUP="tape"
+
+# USB devices
+KERNEL=="legousbtower*",	MODE="0666"
+KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb",		GROUP="lp"
+
+# usbfs-like devices
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \
+				MODE="0664"
+
+# iRiver music players
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",	GROUP="plugdev", \
+	ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]"
+
+# serial devices
+SUBSYSTEM=="tty",				GROUP="dialout"
+SUBSYSTEM=="capi",				GROUP="dialout"
+SUBSYSTEM=="slamr",				GROUP="dialout"
+SUBSYSTEM=="zaptel",				GROUP="dialout"
+
+# vc devices (all members of the tty subsystem)
+KERNEL=="ptmx",			MODE="0666",	GROUP="root"
+KERNEL=="console",		MODE="0600",	GROUP="root"
+KERNEL=="tty",			MODE="0666",	GROUP="root"
+KERNEL=="tty[0-9]*",				GROUP="root"
+KERNEL=="pty*",			MODE="0666",	GROUP="tty"
+
+# video devices
+SUBSYSTEM=="video4linux",			GROUP="video"
+SUBSYSTEM=="drm",				GROUP="video"
+SUBSYSTEM=="dvb",				GROUP="video"
+SUBSYSTEM=="em8300",				GROUP="video"
+SUBSYSTEM=="graphics",				GROUP="video"
+SUBSYSTEM=="nvidia",				GROUP="video"
+
+# misc devices
+KERNEL=="random",		MODE="0666"
+KERNEL=="urandom",		MODE="0666"
+KERNEL=="mem",			MODE="0640",	GROUP="kmem"
+KERNEL=="kmem",			MODE="0640",	GROUP="kmem"
+KERNEL=="port",			MODE="0640",	GROUP="kmem"
+KERNEL=="full",			MODE="0666"
+KERNEL=="null",			MODE="0666"
+KERNEL=="zero",			MODE="0666"
+KERNEL=="inotify",		MODE="0666"
+KERNEL=="sgi_fetchop",		MODE="0666"
+KERNEL=="sonypi",		MODE="0666"
+KERNEL=="agpgart",				GROUP="video"
+KERNEL=="nvram",				GROUP="nvram"
+KERNEL=="rtc|rtc[0-9]*",			GROUP="audio"
+KERNEL=="tpm*",			MODE="0600",	OWNER="tss", GROUP="tss"
+KERNEL=="fuse",					GROUP="fuse"
+KERNEL=="kqemu",		MODE="0666"
+KERNEL=="kvm",					GROUP="kvm"
+KERNEL=="tun",			MODE="0666",
+
+KERNEL=="cdemu[0-9]*",				GROUP="cdrom"
+KERNEL=="pktcdvd[0-9]*",			GROUP="cdrom"
+KERNEL=="pktcdvd",		MODE="0644"
+
+KERNEL=="uverbs*",				GROUP="rdma"
+KERNEL=="ucm*",					GROUP="rdma"
+KERNEL=="rdma_ucm",				GROUP="rdma"
+
+# printers and parallel devices
+SUBSYSTEM=="printer",				GROUP="lp"
+SUBSYSTEM=="ppdev",				GROUP="lp"
+KERNEL=="irlpt*",				GROUP="lp"
+KERNEL=="pt[0-9]*",				GROUP="tape"
+KERNEL=="pht[0-9]*",				GROUP="tape"
+
+# sound devices
+SUBSYSTEM=="sound",				GROUP="audio"
+
+# ieee1394 devices       
+KERNEL=="raw1394",				GROUP="disk"
+KERNEL=="dv1394*",				GROUP="video"
+KERNEL=="video1394*",				GROUP="video"
+
+# input devices
+KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \
+				MODE="0664",	GROUP="video"
+KERNEL=="js[0-9]*",		MODE="0664"
+KERNEL=="lirc[0-9]*",				GROUP="video"
+
+# AOE character devices
+SUBSYSTEM=="aoe",		MODE="0220",	GROUP="disk"
+SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
+
+LABEL="permissions_end"
+
diff --git a/meta/recipes-core/udev/udev/run-ptest b/meta/recipes-core/udev/udev/run-ptest
new file mode 100644
index 0000000..0e39806
--- /dev/null
+++ b/meta/recipes-core/udev/udev/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+tar -C test/ -xJf test/sys.tar.xz
+make -k check-TESTS
+make test-sys-distclean
diff --git a/meta/recipes-core/udev/udev/run.rules b/meta/recipes-core/udev/udev/run.rules
new file mode 100644
index 0000000..75d7137
--- /dev/null
+++ b/meta/recipes-core/udev/udev/run.rules
@@ -0,0 +1,14 @@
+# debugging monitor
+RUN+="socket:/org/kernel/udev/monitor"
+
+# run a command on remove events
+ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}"
+
+# ignore the events generated by virtual consoles
+KERNEL=="ptmx",		OPTIONS+="last_rule"
+KERNEL=="console",	OPTIONS+="last_rule"
+KERNEL=="tty"	,	OPTIONS+="last_rule"
+KERNEL=="tty[0-9]*",	OPTIONS+="last_rule"
+KERNEL=="pty*",		OPTIONS+="last_rule"
+SUBSYSTEM=="vc",	OPTIONS+="last_rule"
+
diff --git a/meta/recipes-core/udev/udev/udev-cache b/meta/recipes-core/udev/udev/udev-cache
new file mode 100644
index 0000000..dcfff1c
--- /dev/null
+++ b/meta/recipes-core/udev/udev/udev-cache
@@ -0,0 +1,75 @@
+#!/bin/sh -e
+
+### BEGIN INIT INFO
+# Provides:          udev-cache
+# Required-Start:    mountall
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: cache /dev to speedup the udev next boot
+### END INIT INFO
+
+export TZ=/etc/localtime
+
+[ -r /proc/mounts ] || exit 1
+[ -x @UDEVD@ ] || exit 1
+[ -d /sys/class ] || exit 1
+
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+DEVCACHE_TMP="/dev/shm/udev-cache-tmp.tar"
+SYSCONF_CACHED="/etc/udev/cache.data"
+SYSCONF_TMP="/dev/shm/udev.cache"
+DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen
+
+# A list of files which are used as a criteria to judge whether the udev cache could be reused.
+CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices"
+[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags"
+
+# List of files whose metadata (size/mtime/name) will be included in cached
+# system state.
+META_FILE_LIST="lib/udev/rules.d/* etc/udev/rules.d/*"
+
+# Command to compute system configuration.
+sysconf_cmd () {
+	cat -- $CMP_FILE_LIST
+	stat -c '%s %Y %n' -- $META_FILE_LIST | awk -F/ '{print $1 " " $NF;}'
+}
+
+[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
+
+if [ "$ROOTFS_READ_ONLY" = "yes" ]; then
+    [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache"
+    exit 0
+fi
+
+[ "$DEVCACHE" != "" ] || exit 0
+[ "${VERBOSE}" == "no" ] || echo -n "udev-cache: checking for ${DEVCACHE_REGEN}... "
+if ! [ -e "$DEVCACHE_REGEN" ]; then
+	[ "${VERBOSE}" == "no" ] || echo "not found."
+	exit 0
+fi
+[ "${VERBOSE}" == "no" ] || echo "found."
+echo "Populating dev cache"
+
+err_cleanup () {
+        echo "udev-cache: update failed!"
+        udevadm control --start-exec-queue
+	rm -f -- "$SYSCONF_TMP" "$DEVCACHE_TMP" "$DEVCACHE" "$SYSCONF_CACHED"
+}
+
+(
+	set -e
+	trap 'err_cleanup' EXIT
+	udevadm control --stop-exec-queue
+	sysconf_cmd > "$SYSCONF_TMP"
+	find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \
+		| xargs tar cf "${DEVCACHE_TMP}"
+	gzip < "${DEVCACHE_TMP}" > "$DEVCACHE"
+	rm -f "${DEVCACHE_TMP}"
+	mv "$SYSCONF_TMP" "$SYSCONF_CACHED"
+	udevadm control --start-exec-queue
+	rm -f "$DEVCACHE_REGEN"
+	trap - EXIT
+) &
+
+exit 0
diff --git a/meta/recipes-core/udev/udev/udev-cache.default b/meta/recipes-core/udev/udev/udev-cache.default
new file mode 100644
index 0000000..a3b7326
--- /dev/null
+++ b/meta/recipes-core/udev/udev/udev-cache.default
@@ -0,0 +1,5 @@
+# Default for /etc/init.d/udev
+
+# Comment this out to disable device cache
+DEVCACHE="/etc/udev-cache.tar.gz"
+PROBE_PLATFORM_BUS="yes"
diff --git a/meta/recipes-core/udev/udev/udev.rules b/meta/recipes-core/udev/udev/udev.rules
new file mode 100644
index 0000000..a19d4a0
--- /dev/null
+++ b/meta/recipes-core/udev/udev/udev.rules
@@ -0,0 +1,116 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+#    For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# workaround for devices which do not report media changes
+SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", \
+	ENV{ID_MODEL}=="IOMEGA_ZIP*",	NAME="%k", OPTIONS+="all_partitions"
+SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTRS{media}=="floppy", \
+	OPTIONS+="all_partitions"
+
+# SCSI devices
+SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*",	NAME="scd%n", SYMLINK+="sr%n"
+
+# USB devices
+SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*",	NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*",	NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="dabusb*",		NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="hiddev*",		NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="legousbtower*",	NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*",		NAME="usb/%k"
+SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \
+	ATTRS{product}=="Palm Handheld*|Handspring Visor|palmOne Handheld", \
+					SYMLINK+="pilot"
+
+# usbfs-like devices
+SUBSYSTEM=="usb_device",	PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \
+				NAME="%c"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",	NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}"
+
+# serial devices
+KERNEL=="capi",			NAME="capi20", SYMLINK+="isdn/capi20"
+KERNEL=="capi[0-9]*",		NAME="capi/%n"
+
+# video devices
+KERNEL=="dvb*",			PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", ACTION=="add", \
+				NAME="%c"
+KERNEL=="card[0-9]*",		NAME="dri/%k"
+
+# misc devices
+KERNEL=="hw_random",		NAME="hwrng"
+KERNEL=="tun",			NAME="net/%k"
+KERNEL=="evtchn",		NAME="xen/%k"
+
+KERNEL=="cdemu[0-9]*",		NAME="cdemu/%n"
+KERNEL=="pktcdvd[0-9]*",	NAME="pktcdvd/%n"
+KERNEL=="pktcdvd",		NAME="pktcdvd/control"
+
+KERNEL=="cpu[0-9]*",		NAME="cpu/%n/cpuid"
+KERNEL=="msr[0-9]*",		NAME="cpu/%n/msr"
+KERNEL=="microcode",		NAME="cpu/microcode"
+
+KERNEL=="umad*",		NAME="infiniband/%k"
+KERNEL=="issm*",		NAME="infiniband/%k"
+KERNEL=="uverbs*",		NAME="infiniband/%k"
+KERNEL=="ucm*",			NAME="infiniband/%k"
+KERNEL=="rdma_ucm",		NAME="infiniband/%k"
+
+# ALSA devices
+KERNEL=="controlC[0-9]*",	NAME="snd/%k"
+KERNEL=="hwC[D0-9]*",		NAME="snd/%k"
+KERNEL=="pcmC[D0-9cp]*",	NAME="snd/%k"
+KERNEL=="midiC[D0-9]*",		NAME="snd/%k"
+KERNEL=="timer",		NAME="snd/%k"
+KERNEL=="seq",			NAME="snd/%k"
+
+# ieee1394 devices       
+KERNEL=="dv1394*",		NAME="dv1394/%n"
+KERNEL=="video1394*",		NAME="video1394/%n"
+
+# input devices
+KERNEL=="mice",			NAME="input/%k"
+KERNEL=="mouse[0-9]*",		NAME="input/%k"
+KERNEL=="event[0-9]*",		NAME="input/%k"
+KERNEL=="js[0-9]*",		NAME="input/%k"
+KERNEL=="ts[0-9]*",		NAME="input/%k"
+KERNEL=="uinput",		NAME="input/%k"
+
+# Zaptel
+KERNEL=="zapctl",		NAME="zap/ctl"
+KERNEL=="zaptimer",		NAME="zap/timer"
+KERNEL=="zapchannel",		NAME="zap/channel"
+KERNEL=="zappseudo",		NAME="zap/pseudo"
+KERNEL=="zap[0-9]*",		NAME="zap/%n"
+
+# AOE character devices
+SUBSYSTEM=="aoe", KERNEL=="discover",	NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="err",	NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="interfaces",	NAME="etherd/%k"
+SUBSYSTEM=="aoe", KERNEL=="revalidate",	NAME="etherd/%k"
+
+# device mapper creates its own device nodes, so ignore these
+KERNEL=="dm-[0-9]*",		OPTIONS+="ignore_device"
+KERNEL=="device-mapper",	NAME="mapper/control"
+
+KERNEL=="rfcomm[0-9]*", NAME="%k", GROUP="users", MODE="0660"
+
+# Firmware Helper
+ACTION=="add", SUBSYSTEM=="firmware", RUN+="/lib/udev/firmware.sh"
+
+# Samsung UARTS
+KERNEL=="s3c2410_serial[0-9]",   NAME="ttySAC%n"
+
+# MXC UARTs
+KERNEL=="ttymxc[0-4]",   NAME="ttymxc%n"
+
diff --git a/meta/recipes-core/udev/udev_182.bb b/meta/recipes-core/udev/udev_182.bb
new file mode 100644
index 0000000..b216352
--- /dev/null
+++ b/meta/recipes-core/udev/udev_182.bb
@@ -0,0 +1,9 @@
+include udev.inc
+
+PR = "r9"
+
+# module-init-tools from kmod_git will provide libkmod runtime
+DEPENDS += "module-init-tools"
+
+SRC_URI[md5sum] = "1b964456177fbf48023dfee7db3a708d"
+SRC_URI[sha256sum] = "7857ed19fafd8f3ca8de410194e8c7336e9eb8a20626ea8a4ba6449b017faba4"
diff --git a/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch b/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch
new file mode 100644
index 0000000..fb443ff
--- /dev/null
+++ b/meta/recipes-core/update-rc.d/update-rc.d/add-verbose.patch
@@ -0,0 +1,49 @@
+Upstream-Status: Pending
+
+--- update-rc.d/update-rc.d.org	2005-01-03 00:30:47.000000000 +0200
++++ update-rc.d/update-rc.d	2007-12-01 19:41:08.000000000 +0200
+@@ -19,6 +19,7 @@
+ notreally=0
+ force=0
+ dostart=0
++verbose=0
+ 
+ usage()
+ {
+@@ -28,6 +29,7 @@
+        update-rc.d [-n] [-r <root>] [-s] <basename> start|stop NN runlvl [runlvl] [...] .
+ 		-n: not really
+ 		-f: force
++		-v: verbose
+ 		-r: alternate root path (default is /)
+ 		-s: invoke start methods if appropriate to current runlevel
+ EOF
+@@ -69,7 +71,7 @@
+ 	lev=`echo $2 | cut -d/ -f1`
+ 	nn=`echo $2 | cut -d/ -f2`
+ 	fn="${etcd}${lev}.d/${startstop}${nn}${bn}"
+-	echo "  $fn -> ../init.d/$bn"
++	[ $verbose -eq 1 ] && echo "  $fn -> ../init.d/$bn"
+ 	if [ $notreally -eq 0 ]; then
+ 		mkdir -p `dirname $fn`
+  		ln -s ../init.d/$bn $fn
+@@ -89,7 +91,7 @@
+ 		exit 0
+ 	fi
+ 
+-	echo " Adding system startup for $initd/$bn ..."
++	echo " Adding system startup for $initd/$bn."
+ 
+ 	for i in $startlinks; do
+ 		dolink S $i
+@@ -105,6 +107,10 @@
+ 			shift
+ 			continue
+ 			;;
++		-v)	verbose=1
++			shift
++			continue
++			;;
+ 		-f)	force=1
+ 			shift
+ 			continue
diff --git a/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch b/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch
new file mode 100644
index 0000000..075171a
--- /dev/null
+++ b/meta/recipes-core/update-rc.d/update-rc.d/check-if-symlinks-are-valid.patch
@@ -0,0 +1,59 @@
+Check if symlinks are valid
+
+When using root option and $initd/$bn is a symlink, the script would fail because
+the symlink points to a path on target. For example:
+
+/path/to/target/rootfs/etc/init.d/syslog -> /etc/init.d/syslog.busybox
+
+Hence, [ -f /path/to/target/rootfs/etc/init.d/syslog ] condition would return
+false.
+
+This patch adds the posibility to check whether the file the symlink points to
+actually exists in rootfs path and then continue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> 
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+Index: git/update-rc.d
+===================================================================
+--- git.orig/update-rc.d
++++ git/update-rc.d
+@@ -147,13 +147,34 @@ fi
+ bn=$1
+ shift
+ 
++sn=$initd/$bn
++if [ -L "$sn" -a -n "$root" ]; then
++	if which readlink >/dev/null; then
++		while true; do
++			linksn="$(readlink "$sn")"
++			if [ -z "$linksn" ]; then
++				break
++			fi
++
++			sn="$linksn"
++			case "$sn" in
++				/*) sn="$root$sn" ;;
++				*)  sn="$initd/$sn" ;;
++			esac
++		done
++	else
++		echo "update-rc.d: readlink tool not present, cannot check whether \
++				$sn symlink points to a valid file." >&2
++	fi
++fi
++
+ if [ $1 != "remove" ]; then
+-	if [ ! -f "$initd/$bn" ]; then
++	if [ ! -f "$sn" ]; then
+ 		echo "update-rc.d: $initd/$bn: file does not exist" >&2
+ 		exit 1
+ 	fi
+ else
+-	if [ -f "$initd/$bn" ]; then
++	if [ -f "$sn" ]; then
+ 		if [ $force -eq 1 ]; then
+ 			echo "update-rc.d: $initd/$bn exists during rc.d purge (continuing)" >&2
+ 		else
diff --git a/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch b/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch
new file mode 100644
index 0000000..85bc234
--- /dev/null
+++ b/meta/recipes-core/update-rc.d/update-rc.d/fix-to-handle-priority-numbers-correctly.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+Fix to handle priority numbers correctly.
+Previously, if the priority number is '08' or '09', for example,
+the script cannot handle them correctly as these numbers are treated
+as octal numbers.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ update-rc.d |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/update-rc.d b/update-rc.d
+index ec50d15..c70b859 100644
+--- a/update-rc.d
++++ b/update-rc.d
+@@ -205,7 +205,7 @@ case $1 in
+ 				exit 1
+ 			fi
+ 			shift
+-			NN=`printf %02d $1`
++			NN=`printf %02d $(expr $1 + 0)`
+ 			shift
+ 			while [ "x$1" != "x." ]; do
+ 				if [ $# -eq 0 ]; then
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb b/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb
new file mode 100644
index 0000000..c15cb78
--- /dev/null
+++ b/meta/recipes-core/update-rc.d/update-rc.d_0.7.bb
@@ -0,0 +1,31 @@
+SUMMARY = "manage symlinks in /etc/rcN.d"
+DESCRIPTION = "update-rc.d is a utilities that allows the management of symlinks to the initscripts in the /etc/rcN.d directory structure."
+SECTION = "base"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://update-rc.d;beginline=5;endline=15;md5=148a48321b10eb37c1fa3ee02b940a75"
+
+PR = "r5"
+
+# Revision corresponding to tag update-rc.d_0.7
+SRCREV = "eca680ddf28d024954895f59a241a622dd575c11"
+
+SRC_URI = "git://github.com/philb/update-rc.d.git \
+           file://add-verbose.patch \
+           file://check-if-symlinks-are-valid.patch \
+           file://fix-to-handle-priority-numbers-correctly.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+inherit allarch
+
+do_compile() {
+}
+
+do_install() {
+	install -d ${D}${sbindir}
+	install -m 0755 ${S}/update-rc.d ${D}${sbindir}/update-rc.d
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-core/util-linux/util-linux.inc b/meta/recipes-core/util-linux/util-linux.inc
new file mode 100644
index 0000000..a4072bc
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux.inc
@@ -0,0 +1,268 @@
+SUMMARY = "A suite of basic system administration utilities"
+DESCRIPTION = "Util-linux includes a suite of basic system administration utilities \
+commonly found on most Linux systems.  Some of the more important utilities include \
+disk partitioning, kernel message management, filesystem creation, and system login."
+
+SECTION = "base"
+
+LICENSE = "GPLv2+ & LGPLv2.1+ & BSD"
+
+LIC_FILES_CHKSUM = "file://README.licensing;md5=1715f5ee3e01203ca1e1e0b9ee65918c \
+                    file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://Documentation/licenses/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://Documentation/licenses/COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \
+                    file://Documentation/licenses/COPYING.BSD-3;md5=58dcd8452651fc8b07d1f65ce07ca8af \
+                    file://Documentation/licenses/COPYING.UCB;md5=263860f8968d8bafa5392cab74285262 \
+                    file://libuuid/COPYING;md5=b442ffb762cf8d3e9df1b99e0bb4af70 \
+                    file://libmount/COPYING;md5=fb93f01d4361069c5616327705373b16 \
+                    file://libblkid/COPYING;md5=fb93f01d4361069c5616327705373b16"
+
+inherit autotools gettext pkgconfig systemd update-alternatives python-dir
+DEPENDS = "zlib ncurses"
+DEPENDS_append_class-native = " lzo-native"
+DEPENDS_append_class-nativesdk = " lzo-native"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/util-linux/v${MAJOR_VERSION}/util-linux-${PV}.tar.xz \
+           "
+
+PACKAGES =+ "util-linux-agetty util-linux-fdisk util-linux-cfdisk util-linux-sfdisk \
+             util-linux-swaponoff util-linux-losetup util-linux-umount \
+             util-linux-mount util-linux-readprofile util-linux-uuidd \
+             util-linux-uuidgen util-linux-lscpu util-linux-fsck util-linux-blkid \
+             util-linux-mkfs util-linux-mcookie util-linux-reset \
+             util-linux-mkfs.cramfs util-linux-fsck.cramfs util-linux-fstrim \
+             util-linux-partx ${PN}-bash-completion util-linux-hwclock \
+             util-linux-findfs util-linux-getopt util-linux-sulogin"
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount', '', d)}"
+
+PACKAGES_DYNAMIC = "^util-linux-lib.*"
+
+SHARED_EXTRA_OECONF = "--disable-use-tty-group \
+                       --disable-makeinstall-chown \
+                       --enable-kill --enable-last --enable-mesg --enable-partx \
+                       --enable-raw --enable-reset --disable-login \
+                       --disable-vipw --disable-newgrp --disable-chfn-chsh \
+                       --enable-write --enable-mount \
+                       --enable-libuuid --enable-libblkid --enable-fsck --without-udev \
+                       usrsbin_execdir='${sbindir}' \
+"
+
+EXTRA_OECONF = "${SHARED_EXTRA_OECONF} --libdir=${base_libdir}"
+
+PACKAGECONFIG_class-target ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG[pam] = "--enable-su --enable-runuser,--disable-su --disable-runuser, libpam,"
+
+# Respect the systemd feature for uuidd
+PACKAGECONFIG[systemd] = "--with-systemd --with-systemdsystemunitdir=${systemd_unitdir}/system/, --without-systemd --without-systemdsystemunitdir,systemd"
+
+# Build setpriv requires libcap-ng
+PACKAGECONFIG[libcap-ng] = "--enable-setpriv,--disable-setpriv,libcap-ng,"
+
+# Build python bindings for libmount
+PACKAGECONFIG[pylibmount] = "--with-python --enable-pylibmount,--without-python --disable-pylibmount,python"
+
+FILES_${PN}-bash-completion += "${datadir}/bash-completion"
+FILES_${PN}-doc += "${datadir}/getopt/getopt-*.*"
+
+FILES_${PN}-dev += "${libdir}/${PYTHON_DIR}/dist-packages/libmount/pylibmount.la"
+FILES_${PN}-dbg += "${libdir}/${PYTHON_DIR}/dist-packages/libmount/.debug/"
+
+FILES_util-linux-agetty = "${base_sbindir}/agetty"
+FILES_util-linux-fdisk = "${base_sbindir}/fdisk.${BPN}"
+FILES_util-linux-fstrim = "${base_sbindir}/fstrim"
+FILES_util-linux-cfdisk = "${base_sbindir}/cfdisk"
+FILES_util-linux-sfdisk = "${sbindir}/sfdisk"
+FILES_util-linux-swaponoff = "${base_sbindir}/swapon.${BPN} ${base_sbindir}/swapoff.${BPN}"
+FILES_util-linux-losetup = "${base_sbindir}/losetup.${BPN}"
+FILES_util-linux-mount = "${base_bindir}/mount.${BPN}"
+FILES_util-linux-mcookie = "${bindir}/mcookie"
+FILES_util-linux-umount = "${base_bindir}/umount.${BPN}"
+FILES_util-linux-readprofile = "${sbindir}/readprofile.${BPN}"
+FILES_util-linux-uuidgen = "${bindir}/uuidgen"
+FILES_util-linux-uuidd = "${sbindir}/uuidd"
+FILES_util-linux-reset = "${base_bindir}/reset"
+FILES_util-linux-partx = "${sbindir}/partx"
+FILES_util-linux-hwclock = "${base_sbindir}/hwclock.${BPN}"
+FILES_util-linux-findfs = "${sbindir}/findfs"
+FILES_util-linux-getopt = "${base_bindir}/getopt.${BPN}"
+
+FILES_util-linux-pylibmount = "${libdir}/${PYTHON_DIR}/dist-packages/libmount/pylibmount.so \
+                               ${libdir}/${PYTHON_DIR}/dist-packages/libmount/__init__.*"
+FILES_util-linux-lscpu = "${bindir}/lscpu"
+
+FILES_util-linux-fsck = "${base_sbindir}/fsck*"
+FILES_util-linux-mkfs = "${sbindir}/mkfs"
+
+FILES_util-linux-fsck.cramfs = "${sbindir}/fsck.cramfs"
+FILES_util-linux-mkfs.cramfs = "${sbindir}/mkfs.cramfs"
+
+FILES_util-linux-sulogin = "${base_sbindir}/sulogin*"
+
+# Util-linux' blkid replaces the e2fsprogs one
+FILES_util-linux-blkid = "${base_sbindir}/blkid*"
+RCONFLICTS_util-linux-blkid = "e2fsprogs-blkid"
+RREPLACES_util-linux-blkid = "e2fsprogs-blkid"
+
+# reset calls 'tput'
+RDEPENDS_util-linux-reset += "ncurses"
+
+RDEPENDS_${PN} = "util-linux-umount util-linux-swaponoff util-linux-losetup util-linux-sulogin"
+RRECOMMENDS_${PN} = "util-linux-fdisk util-linux-cfdisk util-linux-sfdisk util-linux-mount util-linux-readprofile util-linux-mkfs "
+
+RRECOMMENDS_${PN}_class-native = ""
+RRECOMMENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+
+RPROVIDES_${PN}-dev = "util-linux-libblkid-dev util-linux-libmount-dev util-linux-libuuid-dev"
+
+#SYSTEMD_PACKAGES = "${PN}-uuidd ${PN}-fstrim"
+SYSTEMD_SERVICE_${PN}-uuidd = "uuidd.socket uuidd.service"
+SYSTEMD_AUTO_ENABLE_${PN}-uuidd = "disable"
+SYSTEMD_SERVICE_${PN}-fstrim = "fstrim.timer fstrim.service"
+SYSTEMD_AUTO_ENABLE_${PN}-fstrim = "disable"
+
+do_compile () {
+	set -e
+	oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= 'OPT=${CFLAGS}' 
+}
+
+do_install () {
+	# with ccache the timestamps on compiled files may
+	# end up earlier than on their inputs, this allows
+	# for the resultant compilation in the install step.
+	oe_runmake ARCH=${TARGET_ARCH} CPU= CPUOPT= \
+		'OPT=${CFLAGS}' 'CC=${CC}' 'LD=${LD}' \
+		'LDFLAGS=${LDFLAGS}' 'DESTDIR=${D}' install
+
+	mkdir -p ${D}${base_bindir}
+
+        sbinprogs="agetty ctrlaltdel cfdisk vipw vigr"
+        sbinprogs_a="pivot_root hwclock mkswap mkfs.minix fsck.minix losetup swapon swapoff fdisk fsck blkid blockdev fstrim sulogin switch_root"
+        binprogs_a="dmesg getopt kill more umount mount login reset su"
+
+        if [ "${base_sbindir}" != "${sbindir}" ]; then
+        	mkdir -p ${D}${base_sbindir}
+                for p in $sbinprogs $sbinprogs_a; do
+                        if [ -f "${D}${sbindir}/$p" ]; then
+                                mv "${D}${sbindir}/$p" "${D}${base_sbindir}/$p"
+                        fi
+                done
+        fi
+
+        if [ "${base_bindir}" != "${bindir}" ]; then
+        	mkdir -p ${D}${base_bindir}
+                for p in $binprogs_a; do
+                        if [ -f "${D}${bindir}/$p" ]; then
+                                mv "${D}${bindir}/$p" "${D}${base_bindir}/$p"
+                        fi
+                done
+        fi
+
+	install -d ${D}${sysconfdir}/default/
+	echo 'MOUNTALL="-t nonfs,nosmbfs,noncpfs"' > ${D}${sysconfdir}/default/mountall
+
+	rm -f ${D}${bindir}/chkdupexe
+}
+
+# reset and nologin causes a conflict with ncurses-native and shadow-native
+do_install_append_class-native () {
+	rm -f ${D}${base_bindir}/reset
+	rm -f ${D}${base_sbindir}/nologin
+}
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}  = "dmesg kill more mkswap blockdev pivot_root switch_root"
+ALTERNATIVE_${PN} += "mkfs.minix hexdump last lastb logger mesg renice wall"
+ALTERNATIVE_${PN} += "setsid chrt flock utmpdump eject"
+
+ALTERNATIVE_LINK_NAME[dmesg] = "${base_bindir}/dmesg"
+ALTERNATIVE_LINK_NAME[kill] = "${base_bindir}/kill"
+ALTERNATIVE_LINK_NAME[more] = "${base_bindir}/more"
+ALTERNATIVE_LINK_NAME[mkswap] = "${base_sbindir}/mkswap"
+ALTERNATIVE_LINK_NAME[blockdev] = "${base_sbindir}/blockdev"
+ALTERNATIVE_LINK_NAME[pivot_root] = "${base_sbindir}/pivot_root"
+ALTERNATIVE_LINK_NAME[switch_root] = "${base_sbindir}/switch_root"
+ALTERNATIVE_LINK_NAME[mkfs.minix] = "${base_sbindir}/mkfs.minix"
+ALTERNATIVE_LINK_NAME[eject] = "${bindir}/eject"
+
+ALTERNATIVE_${PN}-doc = "mountpoint.1 last.1 lastb.1 mesg.1 wall.1 nologin.8 sulogin.8 utmpdump.1 reset.1 kill.1 libblkid.3 blkid.8 findfs.8 fsck.8 uuid.3"
+
+ALTERNATIVE_LINK_NAME[last.1] = "${mandir}/man1/last.1"
+ALTERNATIVE_LINK_NAME[lastb.1] = "${mandir}/man1/lastb.1"
+ALTERNATIVE_LINK_NAME[mesg.1] = "${mandir}/man1/mesg.1"
+ALTERNATIVE_LINK_NAME[mountpoint.1] = "${mandir}/man1/mountpoint.1"
+ALTERNATIVE_LINK_NAME[nologin.8] = "${mandir}/man8/nologin.8"
+ALTERNATIVE_LINK_NAME[reset.1] = "${mandir}/man1/reset.1"
+ALTERNATIVE_LINK_NAME[sulogin.8] = "${mandir}/man8/sulogin.8"
+ALTERNATIVE_LINK_NAME[utmpdump.1] = "${mandir}/man1/utmpdump.1"
+ALTERNATIVE_LINK_NAME[wall.1] = "${mandir}/man1/wall.1"
+ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
+ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3"
+ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8"
+ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8"
+ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
+ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3"
+
+ALTERNATIVE_util-linux-hwclock = "hwclock"
+# There seems to be problem, atleast on nslu2, with these, untill they are
+# fixed the busybox ones have higher priority
+ALTERNATIVE_PRIORITY[hwclock] = "10"
+ALTERNATIVE_LINK_NAME[hwclock] = "${base_sbindir}/hwclock"
+
+ALTERNATIVE_util-linux-fdisk = "fdisk"
+ALTERNATIVE_LINK_NAME[fdisk] = "${base_sbindir}/fdisk"
+
+ALTERNATIVE_util-linux-agetty = "getty"
+ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty"
+ALTERNATIVE_TARGET[getty] = "${base_sbindir}/agetty"
+
+ALTERNATIVE_util-linux-mount = "mount"
+ALTERNATIVE_LINK_NAME[mount] = "${base_bindir}/mount"
+
+ALTERNATIVE_util-linux-umount = "umount"
+ALTERNATIVE_LINK_NAME[umount] = "${base_bindir}/umount"
+
+ALTERNATIVE_util-linux-readprofile = "readprofile"
+ALTERNATIVE_LINK_NAME[readprofile] = "${sbindir}/readprofile"
+
+ALTERNATIVE_util-linux-losetup = "losetup"
+ALTERNATIVE_LINK_NAME[losetup] = "${base_sbindir}/losetup"
+
+ALTERNATIVE_util-linux-swaponoff = "swapoff swapon"
+ALTERNATIVE_LINK_NAME[swapoff] = "${base_sbindir}/swapoff"
+ALTERNATIVE_LINK_NAME[swapon] = "${base_sbindir}/swapon"
+
+ALTERNATIVE_util-linux-fsck = "fsck.minix fsck"
+ALTERNATIVE_LINK_NAME[fsck.minix] = "${base_sbindir}/fsck.minix"
+ALTERNATIVE_LINK_NAME[fsck] = "${base_sbindir}/fsck"
+
+ALTERNATIVE_util-linux-blkid = "blkid"
+ALTERNATIVE_LINK_NAME[blkid] = "${base_sbindir}/blkid"
+
+ALTERNATIVE_util-linux-reset = "reset"
+ALTERNATIVE_LINK_NAME[reset] = "${bindir}/reset"
+ALTERNATIVE_TARGET[reset] = "${base_bindir}/reset"
+
+ALTERNATIVE_util-linux-getopt = "getopt"
+ALTERNATIVE_LINK_NAME[getopt] = "${base_bindir}/getopt"
+
+ALTERNATIVE_util-linux-sulogin = "sulogin"
+ALTERNATIVE_LINK_NAME[sulogin] = "${base_sbindir}/sulogin"
+
+BBCLASSEXTEND = "native nativesdk"
+
+python do_package_prepend () {
+    if '--enable-su' in d.getVar('EXTRA_OECONF', True).split():
+        alt_name = "su"
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, '%s/%s' % (d.getVar('base_bindir', True), alt_name))
+        d.appendVar('ALTERNATIVE_%s' % (d.getVar('PN', True)), ' ' + alt_name)
+}
+
+python populate_packages_prepend() {
+    do_split_packages(d, '${base_libdir}', '^lib(.*)\.so\..*$',
+                      output_pattern='util-linux-lib%s',
+                      description='util-linux lib%s',
+                      extra_depends='', prepend=True, allow_links=True)
+}
diff --git a/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch b/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch
new file mode 100644
index 0000000..a5b1ff1
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/configure-sbindir.patch
@@ -0,0 +1,23 @@
+util-linux: take ${sbindir} from the environment if it is set there
+fix the test, the [ ] syntax was getting eaten by autoconf
+
+Signed-off-by: Phil Blundell <pb@pbcl.net>
+Signed-off-by: Saul Wold <sgw@linux.intel.com
+Upstream-Status: Inappropriate [configuration]
+
+Index: util-linux-2.22.1/configure.ac
+===================================================================
+--- util-linux-2.22.1.orig/configure.ac
++++ util-linux-2.22.1/configure.ac
+@@ -73,7 +73,10 @@ AC_SUBST([localstatedir])
+ usrbin_execdir='${exec_prefix}/bin'
+ AC_SUBST([usrbin_execdir])
+ 
+-usrsbin_execdir='${exec_prefix}/sbin'
++if test -z "$usrsbin_execdir" ;
++then
++   usrsbin_execdir='${exec_prefix}/sbin'
++fi
+ AC_SUBST([usrsbin_execdir])
+ 
+ case $libdir in
diff --git a/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch b/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch
new file mode 100644
index 0000000..adb271c
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/fix-parallel-build.patch
@@ -0,0 +1,35 @@
+From 774f55f9dd22c01e4041a183d8dff14811f29114 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 4 Apr 2014 17:33:04 +0800
+Subject: [PATCH] sys-utils/Makemodule.am: fix parallel build issue
+
+The rule SETARCH_MAN_LINKS is used for the files under the sys-utils
+dir, for example:
+
+echo ".so man8/setarch.8" > sys-utils/linux32.8
+
+but it depends on nothing so that the sys-utils dir may not exist, we
+can create the sys-utils dir to fix problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ sys-utils/Makemodule.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/sys-utils/Makemodule.am b/sys-utils/Makemodule.am
+index 6265282..62ead37 100644
+--- a/sys-utils/Makemodule.am
++++ b/sys-utils/Makemodule.am
+@@ -124,6 +124,7 @@ man_MANS += $(SETARCH_MAN_LINKS)
+ CLEANFILES += $(SETARCH_MAN_LINKS)
+ 
+ $(SETARCH_MAN_LINKS):
++	$(MKDIR_P) sys-utils
+ 	$(AM_V_GEN)echo ".so man8/setarch.8" > $@
+ 
+ install-exec-hook-setarch:
+-- 
+1.8.2.1
+
diff --git a/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch b/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch
new file mode 100644
index 0000000..5031a73
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/uclibc-__progname-conflict.patch
@@ -0,0 +1,32 @@
+configure should include errno.h instead of argp.h when
+checking for presence of program_invocation_short_name
+uclibc defines this to be const char* unlike util-linux-ng
+which defines this to be char* so this error goes unnoticed
+on glibc/eglibc systems.
+
+here is the error it fixes
+
+in file included from mountP.h:14:0,                                                                               
+                 from cache.c:29:                                                                                  
+/home/kraj/work/slugos/build/tmp-slugos-uclibc/sysroots/nslu2le/usr/include/errno.h:55:46: error: conflicting types for '__progname'                                                                                                  
+../../../include/c.h:118:14: note: previous declaration of '__progname' was here                                   
+make[3]: *** [cache.lo] Error 1          
+
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+
+Upstream-Status: Pending
+Index: util-linux-2.22.1/configure.ac
+===================================================================
+--- util-linux-2.22.1.orig/configure.ac
++++ util-linux-2.22.1/configure.ac
+@@ -372,7 +372,7 @@ esac
+ 
+ AC_MSG_CHECKING([whether program_invocation_short_name is defined])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+-	#include <argp.h>
++	#include <errno.h>
+ ]], [[
+ 	program_invocation_short_name = "test";
+ ]])], [
diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch b/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
new file mode 100644
index 0000000..68bf22d
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/util-linux-native-qsort.patch
@@ -0,0 +1,33 @@
+From f220d809be1baa654503bf6ff52f3630b0d7015c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 26 Mar 2014 01:30:29 +0000
+Subject: [PATCH] sun.c: use qsort() to instead of qsort_r()
+
+qsort_r() was added to glibc in version 2.8, so there is no qsort_r() on
+the host like CentOS 5.x.
+
+Upstream-Status: Inappropriate [Other]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libfdisk/src/sun.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+Index: util-linux-2.24.2/libfdisk/src/sun.c
+===================================================================
+--- util-linux-2.24.2.orig/libfdisk/src/sun.c
++++ util-linux-2.24.2/libfdisk/src/sun.c
+@@ -431,10 +431,9 @@ static int sun_verify_disklabel(struct f
+     }
+     verify_sun_starts = starts;
+ 
+-    qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
+-	  (int (*)(const void *,const void *,void *)) verify_sun_cmp,
+-	  verify_sun_starts);
+-
++    qsort(array,ARRAY_SIZE(array),sizeof(array[0]),
++         (int (*)(const void *,const void *)) verify_sun_cmp);
++ 
+     if (array[0] == -1) {
+ 	fdisk_info(cxt, _("No partitions defined."));
+ 	return 0;
diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-native.patch b/meta/recipes-core/util-linux/util-linux/util-linux-native.patch
new file mode 100644
index 0000000..1f496de
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/util-linux-native.patch
@@ -0,0 +1,57 @@
+Support older hosts with latest util-linux-native
+
+mkostemp is not defined on older machines.  So we detect this and
+provide a define that uses mkstemp instead.
+
+O_CLOEXEC is not defined on older machines.  It is however defined
+in the 'c.h' header.  Fix up the users to include 'c.h'.
+
+fdisks/fdisksunlabel.c was modified to use qsort_r, however
+this is not defined on older hosts.  Revert:
+  commit c69bbca9c1f6645097bd20fe3a21f5a99a2a0698
+  fdisk: (sun): use ask API, remove global variable
+
+Upstream-Status: Inappropriate [other]
+Patches revert upstream changes in order to support older
+machines.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ configure.ac | 1 +
+ include/c.h  | 7 +++++++
+ 2 files changed, 8 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index eb3680b..93e015f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -318,6 +318,7 @@ AC_CHECK_FUNCS([ \
+ 	llseek \
+ 	lseek64 \
+ 	mempcpy \
++	mkostemp \
+ 	nanosleep \
+ 	open_memstream \
+ 	personality \
+diff --git a/include/c.h b/include/c.h
+index e423e8b..cf33b94 100644
+--- a/include/c.h
++++ b/include/c.h
+@@ -233,6 +233,13 @@ static inline int dirfd(DIR *d)
+ #endif
+ 
+ /*
++ * mkostemp replacement
++ */
++#ifndef HAVE_MKOSTEMP
++#define mkostemp(template, flags) mkstemp(template)
++#endif
++
++/*
+  * MAXHOSTNAMELEN replacement
+  */
+ static inline size_t get_hostname_max(void)
+-- 
+1.9.1
+
diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch b/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch
new file mode 100644
index 0000000..5773d7e
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/util-linux-ng-2.16-mount_lock_path.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+The FHS indicates that /etc must be capable of being mounted R/O.
+
+The FHS also indicates that lock files belong in /var/lock, and /var must
+be R/W as soon as possible during boot.
+
+This patch moves the mtab lock file from the potentially R/O /etc, to the
+R/W /var/lock area.  This lock file is used when mounting disks and making
+other mount adjustments.  The _PATH_MOUNTED_TMP is not adjusted, as failing
+to write to this file does not cause any functional limitations.
+
+(Note, if /etc is R/O, then /etc/mtab should be a symlink to /proc/mounts)
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- util-linux-ng-2.16/include/pathnames.h.orig
++++ util-linux-ng-2.16/include/pathnames.h
+@@ -90,7 +90,7 @@
+ # endif
+ #endif
+ 
+-#define _PATH_MOUNTED_LOCK	_PATH_MOUNTED "~"
++#define _PATH_MOUNTED_LOCK	"/var/lock/mtab~"
+ #define _PATH_MOUNTED_TMP	_PATH_MOUNTED ".tmp"
+ 
+ #ifndef _PATH_DEV
diff --git a/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch b/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch
new file mode 100644
index 0000000..6717a75
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux/util-linux-ng-replace-siginterrupt.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ login-utils/login.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/login-utils/login.c b/login-utils/login.c
+index ebb76f5..38c881b 100644
+--- a/login-utils/login.c
++++ b/login-utils/login.c
+@@ -1110,6 +1110,7 @@ int main(int argc, char **argv)
+ 	char *buff;
+ 	int childArgc = 0;
+ 	int retcode;
++	struct sigaction act;
+ 
+ 	char *pwdbuf = NULL;
+ 	struct passwd *pwd = NULL, _pwd;
+@@ -1123,7 +1124,9 @@ int main(int argc, char **argv)
+ 	timeout = (unsigned int)getlogindefs_num("LOGIN_TIMEOUT", LOGIN_TIMEOUT);
+ 
+ 	signal(SIGALRM, timedout);
+-	siginterrupt(SIGALRM, 1);	/* we have to interrupt syscalls like ioctl() */
++	(void) sigaction(SIGALRM, NULL, &act);
++	act.sa_flags &= ~SA_RESTART;
++	sigaction(SIGALRM, &act, NULL);
+ 	alarm(timeout);
+ 	signal(SIGQUIT, SIG_IGN);
+ 	signal(SIGINT, SIG_IGN);
+-- 
+1.9.1
+
diff --git a/meta/recipes-core/util-linux/util-linux_2.26.2.bb b/meta/recipes-core/util-linux/util-linux_2.26.2.bb
new file mode 100644
index 0000000..fc7dc6e
--- /dev/null
+++ b/meta/recipes-core/util-linux/util-linux_2.26.2.bb
@@ -0,0 +1,30 @@
+MAJOR_VERSION = "2.26"
+require util-linux.inc
+
+# To support older hosts, we need to patch and/or revert
+# some upstream changes.  Only do this for native packages.
+OLDHOST = ""
+OLDHOST_class-native = "file://util-linux-native.patch \
+                        file://util-linux-native-qsort.patch \
+			"
+
+SRC_URI += "file://util-linux-ng-replace-siginterrupt.patch \
+            file://util-linux-ng-2.16-mount_lock_path.patch \
+            file://uclibc-__progname-conflict.patch \
+            file://configure-sbindir.patch \
+            file://fix-parallel-build.patch \
+            ${OLDHOST} \
+"
+SRC_URI[md5sum] = "9bdf368c395f1b70325d0eb22c7f48fb"
+SRC_URI[sha256sum] = "0e29bda142528a48a0a953c39ff63093651a4809042e1790fbd6aa8663fd9666"
+
+CACHED_CONFIGUREVARS += "scanf_cv_alloc_modifier=ms"
+
+EXTRA_OECONF_class-native = "${SHARED_EXTRA_OECONF} \
+                             --disable-fallocate \
+			     --disable-use-tty-group \
+"
+EXTRA_OECONF_class-nativesdk = "${SHARED_EXTRA_OECONF} \
+                                --disable-fallocate \
+				--disable-use-tty-group \
+"
diff --git a/meta/recipes-core/volatile-binds/files/COPYING.MIT b/meta/recipes-core/volatile-binds/files/COPYING.MIT
new file mode 100644
index 0000000..7e7d574
--- /dev/null
+++ b/meta/recipes-core/volatile-binds/files/COPYING.MIT
@@ -0,0 +1,17 @@
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/meta/recipes-core/volatile-binds/files/mount-copybind b/meta/recipes-core/volatile-binds/files/mount-copybind
new file mode 100755
index 0000000..2aeaf84
--- /dev/null
+++ b/meta/recipes-core/volatile-binds/files/mount-copybind
@@ -0,0 +1,34 @@
+#!/bin/sh
+#
+# Perform a bind mount, copying existing files as we do so to ensure the
+# overlaid path has the necessary content.
+
+if [ $# -lt 2 ]; then
+    echo >&2 "Usage: $0 spec mountpoint [OPTIONS]"
+    exit 1
+fi
+
+spec=$1
+mountpoint=$2
+
+if [ $# -gt 2 ]; then
+    options=$3
+else
+    options=
+fi
+
+[ -n "$options" ] && options=",$options"
+
+mkdir -p "${spec%/*}"
+if [ -d "$mountpoint" ]; then
+    if [ ! -d "$spec" ]; then
+        mkdir "$spec"
+        cp -pPR "$mountpoint"/. "$spec/"
+    fi
+elif [ -f "$mountpoint" ]; then
+    if [ ! -f "$spec" ]; then
+        cp -pP "$mountpoint" "$spec"
+    fi
+fi
+
+mount -o "bind$options" "$spec" "$mountpoint"
diff --git a/meta/recipes-core/volatile-binds/files/volatile-binds.service.in b/meta/recipes-core/volatile-binds/files/volatile-binds.service.in
new file mode 100644
index 0000000..b23355a
--- /dev/null
+++ b/meta/recipes-core/volatile-binds/files/volatile-binds.service.in
@@ -0,0 +1,19 @@
+[Unit]
+Description=Bind mount volatile @where@
+DefaultDependencies=false
+Before=local-fs.target
+RequiresMountsFor=@whatparent@ @whereparent@
+ConditionPathIsReadWrite=@whatparent@
+ConditionPathExists=@where@
+ConditionPathIsReadWrite=!@where@
+
+[Service]
+Type=oneshot
+RemainAfterExit=Yes
+StandardOutput=syslog
+TimeoutSec=0
+ExecStart=/sbin/mount-copybind @what@ @where@
+ExecStop=/bin/umount @where@
+
+[Install]
+WantedBy=local-fs.target
diff --git a/meta/recipes-core/volatile-binds/volatile-binds.bb b/meta/recipes-core/volatile-binds/volatile-binds.bb
new file mode 100644
index 0000000..fee7275
--- /dev/null
+++ b/meta/recipes-core/volatile-binds/volatile-binds.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Volatile bind mount setup and configuration for read-only-rootfs"
+DESCRIPTION = "${SUMMARY}"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING.MIT;md5=5750f3aa4ea2b00c2bf21b2b2a7b714d"
+
+SRC_URI = "\
+    file://mount-copybind \
+    file://COPYING.MIT \
+    file://volatile-binds.service.in \
+"
+
+S = "${WORKDIR}"
+
+inherit allarch systemd distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+VOLATILE_BINDS ?= "\
+    /var/volatile/lib /var/lib\n\
+"
+VOLATILE_BINDS[type] = "list"
+VOLATILE_BINDS[separator] = "\n"
+
+def volatile_systemd_services(d):
+    services = []
+    for line in oe.data.typed_value("VOLATILE_BINDS", d):
+        if not line:
+            continue
+        what, where = line.split(None, 1)
+        services.append("%s.service" % what[1:].replace("/", "-"))
+    return " ".join(services)
+
+SYSTEMD_SERVICE_${PN} = "${@volatile_systemd_services(d)}"
+
+FILES_${PN} += "${systemd_unitdir}/system/*.service"
+
+do_compile () {
+    while read spec mountpoint; do
+        if [ -z "$spec" ]; then
+            continue
+        fi
+
+        servicefile="${spec#/}"
+        servicefile="$(echo "$servicefile" | tr / -).service"
+        sed -e "s#@what@#$spec#g; s#@where@#$mountpoint#g" \
+            -e "s#@whatparent@#${spec%/*}#g; s#@whereparent@#${mountpoint%/*}#g" \
+            volatile-binds.service.in >$servicefile
+    done <<END
+${@d.getVar('VOLATILE_BINDS', True).replace("\\n", "\n")}
+END
+
+    if [ -e var-volatile-lib.service ]; then
+        # As the seed is stored under /var/lib, ensure that this service runs
+        # after the volatile /var/lib is mounted.
+        sed -i -e "/^Before=/s/\$/ systemd-random-seed.service/" \
+               -e "/^WantedBy=/s/\$/ systemd-random-seed.service/" \
+               var-volatile-lib.service
+    fi
+}
+do_compile[dirs] = "${WORKDIR}"
+
+do_install () {
+    install -d ${D}${base_sbindir}
+    install -m 0755 mount-copybind ${D}${base_sbindir}/
+
+    install -d ${D}${systemd_unitdir}/system
+    for service in ${SYSTEMD_SERVICE_volatile-binds}; do
+        install -m 0644 $service ${D}${systemd_unitdir}/system/
+    done
+}
+do_install[dirs] = "${WORKDIR}"
diff --git a/meta/recipes-core/zlib/site_config/headers b/meta/recipes-core/zlib/site_config/headers
new file mode 100644
index 0000000..5026891
--- /dev/null
+++ b/meta/recipes-core/zlib/site_config/headers
@@ -0,0 +1 @@
+zlib.h
diff --git a/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch b/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch
new file mode 100644
index 0000000..61eea82
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib-1.2.8/Makefile-runtests.patch
@@ -0,0 +1,38 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/Makefile.in b/Makefile.in
+--- a/Makefile.in	2013-06-10 13:48:14.321959162 +0200
++++ b/Makefile.in	2013-06-10 13:49:36.686476448 +0200
+@@ -83,6 +83,9 @@
+ test: all teststatic testshared
+ 
+ teststatic: static
++	@make runteststatic
++
++runteststatic:
+ 	@TMPST=tmpst_$$; \
+ 	if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
+ 	  echo '		*** zlib test OK ***'; \
+@@ -92,6 +95,9 @@
+ 	rm -f $$TMPST
+ 
+ testshared: shared
++	@make runtestshared
++
++runtestshared:
+ 	@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
+ 	LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
+ 	DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
+@@ -105,6 +111,9 @@
+ 	rm -f $$TMPSH
+ 
+ test64: all64
++	@make runtestall64
++
++runtestall64:
+ 	@TMP64=tmp64_$$; \
+ 	if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
+ 	  echo '		*** zlib 64-bit test OK ***'; \
diff --git a/meta/recipes-core/zlib/zlib-1.2.8/ldflags-tests.patch b/meta/recipes-core/zlib/zlib-1.2.8/ldflags-tests.patch
new file mode 100644
index 0000000..19c40b7
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib-1.2.8/ldflags-tests.patch
@@ -0,0 +1,45 @@
+Obey LDFLAGS for tests
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- zlib-1.2.8.orig/Makefile.in
++++ zlib-1.2.8/Makefile.in
+@@ -26,7 +26,7 @@ CFLAGS=-O
+
+ SFLAGS=-O
+ LDFLAGS=
+-TEST_LDFLAGS=-L. libz.a
++TEST_LDFLAGS=-L. $(LDFLAGS)
+ LDSHARED=$(CC)
+ CPP=$(CC) -E
+
+@@ -176,22 +176,22 @@ placebo $(SHAREDLIBV): $(PIC_OBJS) libz.
+	-@rmdir objs
+
+ example$(EXE): example.o $(STATICLIB)
+-	$(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
++	$(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ minigzip$(EXE): minigzip.o $(STATICLIB)
+-	$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
++	$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ examplesh$(EXE): example.o $(SHAREDLIBV)
+-	$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
++	$(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS) $(SHAREDLIBV)
+
+ minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
+-	$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
++	$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS) $(SHAREDLIBV)
+
+ example64$(EXE): example64.o $(STATICLIB)
+-	$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
++	$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ minigzip64$(EXE): minigzip64.o $(STATICLIB)
+-	$(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
++	$(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS) $(STATICLIB)
+
+ install-libs: $(LIBS)
+	-@if [ ! -d $(DESTDIR)$(exec_prefix)  ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
diff --git a/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch b/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch
new file mode 100644
index 0000000..403b482
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib-1.2.8/remove.ldconfig.call.patch
@@ -0,0 +1,20 @@
+
+When /etc/ld.so.cache is writeable by user running bitbake then it creates invalid cache 
+(in my case libstdc++.so cannot be found after building zlib(-native) and I have to call 
+touch */libstdc++.so && /sbin/ldconfig to fix it.
+
+So remove ldconfig call from make install-libs
+
+Upstream-Status: Inappropriate [disable feature]
+
+diff -uNr zlib-1.2.6.orig/Makefile.in zlib-1.2.6/Makefile.in
+--- zlib-1.2.6.orig/Makefile.in	2012-01-28 23:48:50.000000000 +0100
++++ zlib-1.2.6/Makefile.in	2012-02-13 15:38:20.577700723 +0100
+@@ -199,7 +199,6 @@
+ 	  rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
+ 	  ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
+ 	  ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
+-	  ($(LDCONFIG) || true)  >/dev/null 2>&1; \
+ 	fi
+ 	cp zlib.3 $(DESTDIR)$(man3dir)
+ 	chmod 644 $(DESTDIR)$(man3dir)/zlib.3
diff --git a/meta/recipes-core/zlib/zlib-1.2.8/run-ptest b/meta/recipes-core/zlib/zlib-1.2.8/run-ptest
new file mode 100644
index 0000000..884d9dc
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib-1.2.8/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runteststatic runtestshared | sed -r -e 's/^(\s+\*+ (.+?) test OK \*+)/\1\nPASS: \2/' -e 's/^(\s+\*+ (.+?) test FAILED \*+)/\1\nFAIL: \2/'
diff --git a/meta/recipes-core/zlib/zlib_1.2.8.bb b/meta/recipes-core/zlib/zlib_1.2.8.bb
new file mode 100644
index 0000000..9470adb
--- /dev/null
+++ b/meta/recipes-core/zlib/zlib_1.2.8.bb
@@ -0,0 +1,59 @@
+SUMMARY = "Zlib Compression Library"
+DESCRIPTION = "Zlib is a general-purpose, patent-free, lossless data compression \
+library which is used by many different programs."
+HOMEPAGE = "http://zlib.net/"
+SECTION = "libs"
+LICENSE = "Zlib"
+LIC_FILES_CHKSUM = "file://zlib.h;beginline=4;endline=23;md5=fde612df1e5933c428b73844a0c494fd"
+
+SRC_URI = "http://www.zlib.net/${BPN}-${PV}.tar.xz \
+           file://remove.ldconfig.call.patch \
+           file://Makefile-runtests.patch \
+           file://ldflags-tests.patch \
+           file://run-ptest \
+           "
+
+SRC_URI[md5sum] = "28f1205d8dd2001f26fec1e8c2cebe37"
+SRC_URI[sha256sum] = "831df043236df8e9a7667b9e3bb37e1fcb1220a0f163b6de2626774b9590d057"
+
+RDEPENDS_${PN}-ptest += "make"
+
+inherit ptest
+
+do_configure (){
+	./configure --prefix=${prefix} --shared --libdir=${libdir}
+}
+
+do_compile (){
+	oe_runmake
+}
+
+do_compile_ptest() {
+	oe_runmake static shared
+}
+
+do_install() {
+	oe_runmake DESTDIR=${D} install
+}
+
+do_install_ptest() {
+	install ${B}/Makefile   ${D}${PTEST_PATH}
+	install ${B}/example    ${D}${PTEST_PATH}
+	install ${B}/minigzip   ${D}${PTEST_PATH}
+	install ${B}/examplesh  ${D}${PTEST_PATH}
+	install ${B}/minigzipsh ${D}${PTEST_PATH}
+}
+
+# Move zlib shared libraries for target builds to $base_libdir so the library
+# can be used in early boot before $prefix is mounted.
+do_install_append_class-target() {
+	if [ ${base_libdir} != ${libdir} ]
+	then
+		mkdir -p ${D}/${base_libdir}
+		mv ${D}/${libdir}/libz.so.* ${D}/${base_libdir}
+		libname=`readlink ${D}/${libdir}/libz.so`
+		ln -sf ${@oe.path.relative("${libdir}", "${base_libdir}")}/$libname ${D}${libdir}/libz.so
+	fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/apt/apt-native.inc b/meta/recipes-devtools/apt/apt-native.inc
new file mode 100644
index 0000000..27cc9ff
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt-native.inc
@@ -0,0 +1,70 @@
+require apt.inc
+inherit native
+
+DEPENDS += "dpkg-native gettext-native db-native curl-native xz-native"
+PACKAGES = ""
+USE_NLS = "yes"
+
+SRC_URI += "file://db_linking_hack.patch \
+            file://0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch \
+            file://0001-remove-Wsuggest-attribute-from-CFLAGS.patch \
+            file://0001-fix-the-gcc-version-check.patch \
+"
+
+python do_install () {
+    bb.build.exec_func('do_install_base', d)
+    bb.build.exec_func('do_install_config', d)
+}
+
+python do_install_config () {
+    indir = os.path.dirname(d.getVar('FILE',1))
+    infile = file(oe.path.join(indir, 'files', 'apt.conf'), 'r')
+    data = infile.read()
+    infile.close()
+
+    data = d.expand(data)
+
+    outdir = oe.path.join(d.getVar('D', True), d.getVar('sysconfdir', True), 'apt')
+    if not os.path.exists(outdir):
+        os.makedirs(outdir)
+
+    outpath = oe.path.join(outdir, 'apt.conf.sample')
+    if not os.path.exists(outpath):
+        outfile = file(outpath, 'w')
+        outfile.write(data)
+        outfile.close()
+}
+
+do_install_base () {
+	install -d ${D}${bindir}
+	install -m 0755 bin/apt-cdrom ${D}${bindir}/
+	install -m 0755 bin/apt-get ${D}${bindir}/
+	install -m 0755 bin/apt-config ${D}${bindir}/
+	install -m 0755 bin/apt-cache ${D}${bindir}/
+	install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
+	install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+	install -m 0755 bin/apt-ftparchive ${D}${bindir}/
+
+	oe_libinstall -so -C bin libapt-private ${D}${libdir}/
+
+	oe_libinstall -so -C bin libapt-pkg$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
+	oe_libinstall -so -C bin libapt-inst$GLIBC_VER$LIBSTDCPP_VER ${D}${libdir}/
+
+	install -d ${D}${libdir}/apt/methods
+	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+
+	install -d ${D}${libdir}/dpkg/methods/apt
+	install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ 
+
+	install -d ${D}${sysconfdir}/apt
+	install -d ${D}${sysconfdir}/apt/apt.conf.d
+	install -d ${D}${sysconfdir}/apt/preferences.d
+	install -d ${D}${localstatedir}/lib/apt/lists/partial
+	install -d ${D}${localstatedir}/cache/apt/archives/partial
+
+	install -d ${D}${localstatedir}/log/apt/
+}
diff --git a/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb b/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb
new file mode 100644
index 0000000..1e660da
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt-native_1.0.10.1.bb
@@ -0,0 +1,4 @@
+require apt-native.inc
+
+SRC_URI += "file://noconfigure.patch \
+            file://no-curl.patch"
diff --git a/meta/recipes-devtools/apt/apt-package.inc b/meta/recipes-devtools/apt/apt-package.inc
new file mode 100644
index 0000000..a553aa2
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt-package.inc
@@ -0,0 +1,78 @@
+apt-manpages="doc/apt-cache.8 \
+	      doc/apt-cdrom.8 \
+	      doc/apt-config.8 \
+	      doc/apt-get.8 \
+	      doc/apt.8 \
+	      doc/apt.conf.5 \
+	      doc/apt_preferences.5 \
+	      doc/sources.list.5"
+apt-utils-manpages="doc/apt-extracttemplates.1 \
+		    doc/apt-sortpkgs.1"
+
+def get_files_apt_doc(d, bb, manpages):
+    import re
+    manpages = re.sub(r'\bdoc/(\S+)/(\S+)\.\1\.(.)\b', r'${mandir}/\1/man\3/\2.\3', manpages)
+    manpages = re.sub(r'\bdoc/(\S+)\.(.)\b', r'${mandir}/man\2/\1.\2', manpages)
+    return manpages
+
+def get_commands_apt_doc(d, bb, manpages):
+    s = list()
+    __dir_cache__ = list()
+    for m in manpages.split():
+        dest = get_files_apt_doc(d, bb, m)
+        dir = os.path.dirname(dest)
+        if not dir in __dir_cache__:
+            s.append("install -d ${D}/%s" % dir)
+            __dir_cache__.append(dir)
+        s.append("install -m 0644 %s ${D}/%s" % (m, dest))
+    return "\n".join(s)
+
+PACKAGES += "${PN}-utils ${PN}-utils-doc"
+FILES_${PN} = "${bindir}/apt-cdrom ${bindir}/apt-get \
+	       ${bindir}/apt-config ${bindir}/apt-cache \
+	       ${libdir}/apt ${libdir}/libapt*.so.* \
+	       ${localstatedir} ${sysconfdir} \
+	       ${libdir}/dpkg"
+FILES_${PN}-utils = "${bindir}/apt-sortpkgs ${bindir}/apt-extracttemplates"
+FILES_${PN}-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-manpages', True))} \
+		   ${docdir}/apt"
+FILES_${PN}-utils-doc = "${@get_files_apt_doc(d, bb, d.getVar('apt-utils-manpages', True))}"
+FILES_${PN}-dev = "${libdir}/libapt*.so ${includedir}"
+
+do_install () {
+	set -x
+	install -d ${D}${bindir}
+	install -m 0755 bin/apt-key ${D}${bindir}/
+	install -m 0755 bin/apt-cdrom ${D}${bindir}/
+	install -m 0755 bin/apt-get ${D}${bindir}/
+	install -m 0755 bin/apt-config ${D}${bindir}/
+	install -m 0755 bin/apt-cache ${D}${bindir}/
+
+	install -m 0755 bin/apt-sortpkgs ${D}${bindir}/
+	install -m 0755 bin/apt-extracttemplates ${D}${bindir}/
+
+	oe_libinstall -so -C bin libapt-pkg ${D}${libdir}
+	oe_libinstall -so -C bin libapt-inst ${D}${libdir}
+
+	install -d ${D}${libdir}/apt/methods
+	install -m 0755 bin/methods/* ${D}${libdir}/apt/methods/
+
+	install -d ${D}${libdir}/dpkg/methods/apt
+	install -m 0644 ${S}/dselect/desc.apt ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0644 ${S}/dselect/names ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/install ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/setup ${D}${libdir}/dpkg/methods/apt/ 
+	install -m 0755 ${S}/dselect/update ${D}${libdir}/dpkg/methods/apt/ 
+
+	install -d ${D}${sysconfdir}/apt
+	install -d ${D}${sysconfdir}/apt/apt.conf.d
+	install -d ${D}${sysconfdir}/apt/sources.list.d
+	install -d ${D}${sysconfdir}/apt/preferences.d
+	install -d ${D}${localstatedir}/lib/apt/lists/partial
+	install -d ${D}${localstatedir}/cache/apt/archives/partial
+	install -d ${D}${docdir}/apt/examples
+	install -m 0644 ${S}/doc/examples/* ${D}${docdir}/apt/examples/
+
+	install -d ${D}${includedir}/apt-pkg/
+	install -m 0644 include/apt-pkg/*.h ${D}${includedir}/apt-pkg/
+}
diff --git a/meta/recipes-devtools/apt/apt.inc b/meta/recipes-devtools/apt/apt.inc
new file mode 100644
index 0000000..3248b9a
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt.inc
@@ -0,0 +1,28 @@
+SUMMARY = "Advanced front-end for dpkg"
+LICENSE = "GPLv2.0+"
+SECTION = "base"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20150805T094928Z/pool/main/a/${BPN}/${BPN}_${PV}.tar.xz \
+           file://use-host.patch \
+           file://makerace.patch \
+           file://no-nls-dpkg.patch \
+           file://fix-gcc-4.6-null-not-defined.patch \
+           file://truncate-filename.patch \
+           file://nodoc.patch \
+           file://disable-configure-in-makefile.patch \
+           file://disable-test.patch \
+           "
+SRC_URI[md5sum] = "6505c4297b338adb2087ce87bbc4a276"
+SRC_URI[sha256sum] = "3fb1de9598363c416591d49e3c285458e095b035e6c06d5b944a54e15fc9b543"
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+inherit autotools gettext
+
+EXTRA_AUTORECONF = "--exclude=autopoint,autoheader"
+
+do_configure_prepend() {
+    rm -rf ${S}/buildlib/config.sub
+    rm -rf ${S}/buildlib/config.guess
+}
+
+FILES_${PN}-dbg += "${libdir}/apt/methods/.debug/"
diff --git a/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch b/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
new file mode 100644
index 0000000..d33069b
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/0001-Revert-always-run-dpkg-configure-a-at-the-end-of-our.patch
@@ -0,0 +1,378 @@
+From 106797f1c66fa578dad21fd9380bf9d576573dfd Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Fri, 22 May 2015 08:05:15 +0800
+Subject: [PATCH] Revert "always run 'dpkg --configure -a' at the end of our
+ dpkg callings"
+
+Upstream-Status: Inappropriate [embedded specific]
+
+This reverts commit a2a75ff4516f7609f4c55b42270abb8d08943c60, which
+always run 'dpkg --configure -a' at the end of our dpkg callings,
+but it does not work for cross-compile, since the rootfs dir can not
+be passed into dpkg, and lead to the below similar error:
+   -------
+   |mkdir: cannot create directory '/usr/lib/opkg': Permission denied
+   -------
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ apt-pkg/deb/dpkgpm.cc                              |  9 +--
+ test/integration/framework                         | 25 ++++----
+ test/integration/test-apt-progress-fd              | 67 +++++++++----------
+ test/integration/test-apt-progress-fd-deb822       | 18 ++----
+ test/integration/test-apt-progress-fd-error        |  2 +-
+ ...est-bug-769609-triggers-still-pending-after-run | 75 ----------------------
+ .../test-no-fds-leaked-to-maintainer-scripts       |  6 +-
+ 7 files changed, 56 insertions(+), 146 deletions(-)
+ delete mode 100755 test/integration/test-bug-769609-triggers-still-pending-after-run
+
+diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
+index b187efb..f269764 100644
+--- a/apt-pkg/deb/dpkgpm.cc
++++ b/apt-pkg/deb/dpkgpm.cc
+@@ -1049,12 +1049,6 @@ void pkgDPkgPM::BuildPackagesProgressMap()
+ 	 PackagesTotal++;
+       }
+    }
+-   /* one extra: We don't want the progress bar to reach 100%, especially not
+-      if we call dpkg --configure --pending and process a bunch of triggers
+-      while showing 100%. Also, spindown takes a while, so never reaching 100%
+-      is way more correct than reaching 100% while still doing stuff even if
+-      doing it this way is slightly bending the rules */
+-   ++PackagesTotal;
+ }
+                                                                         /*}}}*/
+ #if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
+@@ -1294,8 +1288,9 @@ bool pkgDPkgPM::GoNoABIBreak(APT::Progress::PackageManager *progress)
+ 
+    // support subpressing of triggers processing for special
+    // cases like d-i that runs the triggers handling manually
++   bool const SmartConf = (_config->Find("PackageManager::Configure", "all") != "all");
+    bool const TriggersPending = _config->FindB("DPkg::TriggersPending", false);
+-   if (_config->FindB("DPkg::ConfigurePending", true) == true)
++   if (_config->FindB("DPkg::ConfigurePending", SmartConf) == true)
+       List.push_back(Item(Item::ConfigurePending, PkgIterator()));
+ 
+    // for the progress
+diff --git a/test/integration/framework b/test/integration/framework
+index 70ad381..00672ad 100644
+--- a/test/integration/framework
++++ b/test/integration/framework
+@@ -1178,13 +1178,10 @@ testnopackage() {
+ 	fi
+ }
+ 
+-testdpkgstatus() {
+-	local STATE="$1"
+-	local NR="$2"
+-	shift 2
+-	msgtest "Test that $NR package(s) are in state $STATE with" "dpkg -l $*"
+-	local PKGS="$(dpkg -l "$@" 2>/dev/null | grep "^${STATE}" | wc -l)"
+-	if [ "$PKGS" != $NR ]; then
++testdpkginstalled() {
++	msgtest "Test for correctly installed package(s) with" "dpkg -l $*"
++	local PKGS="$(dpkg -l "$@" 2>/dev/null | grep '^i' | wc -l)"
++	if [ "$PKGS" != $# ]; then
+ 		echo >&2 $PKGS
+ 		dpkg -l "$@" | grep '^[a-z]' >&2
+ 		msgfail
+@@ -1193,12 +1190,16 @@ testdpkgstatus() {
+ 	fi
+ }
+ 
+-testdpkginstalled() {
+-	testdpkgstatus 'ii' "$#" "$@"
+-}
+-
+ testdpkgnotinstalled() {
+-	testdpkgstatus 'ii' '0' "$@"
++	msgtest "Test for correctly not-installed package(s) with" "dpkg -l $*"
++	local PKGS="$(dpkg -l "$@" 2> /dev/null | grep '^i' | wc -l)"
++	if [ "$PKGS" != 0 ]; then
++		echo
++		dpkg -l "$@" | grep '^[a-z]' >&2
++		msgfail
++	else
++		msgpass
++	fi
+ }
+ 
+ testmarkedauto() {
+diff --git a/test/integration/test-apt-progress-fd b/test/integration/test-apt-progress-fd
+index 68cc043..d72e7e7 100755
+--- a/test/integration/test-apt-progress-fd
++++ b/test/integration/test-apt-progress-fd
+@@ -19,14 +19,13 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+ 
+ # upgrade
+ exec 3> apt-progress.log
+@@ -35,14 +34,13 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+ 
+ # reinstall
+ exec 3> apt-progress.log
+@@ -51,24 +49,22 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Installing testing (amd64)
+-pmstatus:testing:16.6667:Preparing testing (amd64)
+-pmstatus:testing:33.3333:Unpacking testing (amd64)
+-pmstatus:testing:50:Preparing to configure testing (amd64)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing:50:Configuring testing (amd64)
+-pmstatus:testing:66.6667:Configuring testing (amd64)
+-pmstatus:testing:83.3333:Installed testing (amd64)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing:20:Preparing testing (amd64)
++pmstatus:testing:40:Unpacking testing (amd64)
++pmstatus:testing:60:Preparing to configure testing (amd64)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing:60:Configuring testing (amd64)
++pmstatus:testing:80:Configuring testing (amd64)
++pmstatus:testing:100:Installed testing (amd64)" cat apt-progress.log
+ 
+ # and remove
+ exec 3> apt-progress.log
+ testsuccess aptget remove testing -y -o APT::Status-Fd=3
+ testequal "pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing:0:Removing testing (amd64)
+-pmstatus:testing:25:Preparing for removal of testing (amd64)
+-pmstatus:testing:50:Removing testing (amd64)
+-pmstatus:testing:75:Removed testing (amd64)
+-pmstatus:dpkg-exec:75:Running dpkg" cat apt-progress.log
++pmstatus:testing:33.3333:Preparing for removal of testing (amd64)
++pmstatus:testing:66.6667:Removing testing (amd64)
++pmstatus:testing:100:Removed testing (amd64)" cat apt-progress.log
+ 
+ # install non-native and ensure we get proper progress info
+ exec 3> apt-progress.log
+@@ -79,13 +75,12 @@ testequal "dlstatus:1:0:Retrieving file 1 of 1
+ dlstatus:1:0:Retrieving file 1 of 1
+ pmstatus:dpkg-exec:0:Running dpkg
+ pmstatus:testing2:0:Installing testing2 (i386)
+-pmstatus:testing2:16.6667:Preparing testing2 (i386)
+-pmstatus:testing2:33.3333:Unpacking testing2 (i386)
+-pmstatus:testing2:50:Preparing to configure testing2 (i386)
+-pmstatus:dpkg-exec:50:Running dpkg
+-pmstatus:testing2:50:Configuring testing2 (i386)
+-pmstatus:testing2:66.6667:Configuring testing2 (i386)
+-pmstatus:testing2:83.3333:Installed testing2 (i386)
+-pmstatus:dpkg-exec:83.3333:Running dpkg" cat apt-progress.log
++pmstatus:testing2:20:Preparing testing2 (i386)
++pmstatus:testing2:40:Unpacking testing2 (i386)
++pmstatus:testing2:60:Preparing to configure testing2 (i386)
++pmstatus:dpkg-exec:60:Running dpkg
++pmstatus:testing2:60:Configuring testing2 (i386)
++pmstatus:testing2:80:Configuring testing2 (i386)
++pmstatus:testing2:100:Installed testing2 (i386)" cat apt-progress.log
+ 
+ rm -f apt-progress*.log
+diff --git a/test/integration/test-apt-progress-fd-deb822 b/test/integration/test-apt-progress-fd-deb822
+index badc985..9d22794 100755
+--- a/test/integration/test-apt-progress-fd-deb822
++++ b/test/integration/test-apt-progress-fd-deb822
+@@ -27,41 +27,37 @@ Message: Installing testing (amd64)
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 16.6667
++Percent: 20
+ Message: Preparing testing (amd64)
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 33.3333
++Percent: 40
+ Message: Unpacking testing (amd64)
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 50
++Percent: 60
+ Message: Preparing to configure testing (amd64)
+ 
+ Status: progress
+-Percent: 50
++Percent: 60
+ Message: Running dpkg
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 50
++Percent: 60
+ Message: Configuring testing (amd64)
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 66.6667
++Percent: 80
+ Message: Configuring testing (amd64)
+ 
+ Status: progress
+ Package: testing:amd64
+-Percent: 83.3333
++Percent: 100
+ Message: Installed testing (amd64)
+-
+-Status: progress
+-Percent: 83.3333
+-Message: Running dpkg
+ " cat apt-progress.log
+ 
+ 
+diff --git a/test/integration/test-apt-progress-fd-error b/test/integration/test-apt-progress-fd-error
+index 6323007..a47095b 100755
+--- a/test/integration/test-apt-progress-fd-error
++++ b/test/integration/test-apt-progress-fd-error
+@@ -18,7 +18,7 @@ setupaptarchive
+ exec 3> apt-progress.log
+ testfailure aptget install foo1 foo2 -y -o APT::Status-Fd=3
+ msgtest "Ensure correct error message"
+-if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:36.3636:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then
++if grep -q "aptarchive/pool/foo2_0.8.15_amd64.deb:40:trying to overwrite '/usr/bin/file-conflict', which is also in package foo1 0.8.15" apt-progress.log; then
+ 	msgpass
+ else
+ 	cat apt-progress.log
+diff --git a/test/integration/test-bug-769609-triggers-still-pending-after-run b/test/integration/test-bug-769609-triggers-still-pending-after-run
+deleted file mode 100755
+index 146fa76..0000000
+--- a/test/integration/test-bug-769609-triggers-still-pending-after-run
++++ /dev/null
+@@ -1,75 +0,0 @@
+-#!/bin/sh
+-set -e
+-
+-TESTDIR=$(readlink -f $(dirname $0))
+-. $TESTDIR/framework
+-
+-setupenvironment
+-configarchitecture 'amd64'
+-
+-msgtest 'Check if installed dpkg supports' 'noawait trigger'
+-if dpkg-checkbuilddeps -d 'dpkg (>= 1.16.1)' /dev/null; then
+-	msgpass
+-else
+-	msgskip 'dpkg version too old'
+-	exit 0
+-fi
+-configdpkgnoopchroot
+-
+-buildtriggerpackages() {
+-	local TYPE="$1"
+-	setupsimplenativepackage "triggerable-$TYPE" 'all' '1.0' 'unstable' "Depends: trigdepends-$TYPE"
+-	BUILDDIR="incoming/triggerable-${TYPE}-1.0"
+-	cat >${BUILDDIR}/debian/postinst <<EOF
+-#!/bin/sh
+-if [ "\$1" = 'triggered' ]; then
+-	ls -l /proc/self/fd/
+-fi
+-EOF
+-	echo "$TYPE /usr/share/doc" > ${BUILDDIR}/debian/triggers
+-	buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
+-	rm -rf "$BUILDDIR"
+-	buildsimplenativepackage "trigdepends-$TYPE" 'all' '1.0' 'unstable'
+-}
+-
+-#buildtriggerpackages 'interest'
+-buildtriggerpackages 'interest-noawait'
+-buildsimplenativepackage "trigstuff" 'all' '1.0' 'unstable'
+-
+-setupaptarchive
+-
+-runtests() {
+-	local TYPE="$1"
+-	msgmsg 'Working with trigger type' "$TYPE"
+-	testsuccess aptget install triggerable-$TYPE -y
+-	cp rootdir/tmp/testsuccess.output terminal.output
+-	testsuccess grep '^REWRITE ' terminal.output
+-	testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+-
+-	testsuccess aptget install trigdepends-$TYPE -y --reinstall
+-	cp rootdir/tmp/testsuccess.output terminal.output
+-	testsuccess grep '^REWRITE ' terminal.output
+-	testsuccess grep ' root root ' terminal.output
+-	testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+-
+-	testsuccess aptget install trigstuff -y
+-	cp rootdir/tmp/testsuccess.output terminal.output
+-	testsuccess grep '^REWRITE ' terminal.output
+-	testsuccess grep ' root root ' terminal.output
+-	testdpkginstalled triggerable-$TYPE trigdepends-$TYPE trigstuff
+-
+-	testsuccess aptget purge trigstuff -y
+-	cp rootdir/tmp/testsuccess.output terminal.output
+-	testsuccess grep '^REWRITE ' terminal.output
+-	testsuccess grep ' root root ' terminal.output
+-	testdpkginstalled triggerable-$TYPE trigdepends-$TYPE
+-	testdpkgnotinstalled trigstuff
+-
+-	testsuccess aptget purge trigdepends-$TYPE -y
+-	cp rootdir/tmp/testsuccess.output terminal.output
+-	testfailure grep '^REWRITE ' terminal.output
+-	testfailure grep ' root root ' terminal.output
+-	testdpkgnotinstalled triggerable-$TYPE trigdepends-$TYPE
+-}
+-#runtests 'interest'
+-runtests 'interest-noawait'
+diff --git a/test/integration/test-no-fds-leaked-to-maintainer-scripts b/test/integration/test-no-fds-leaked-to-maintainer-scripts
+index 41c0570..d3960d7 100755
+--- a/test/integration/test-no-fds-leaked-to-maintainer-scripts
++++ b/test/integration/test-no-fds-leaked-to-maintainer-scripts
+@@ -59,8 +59,7 @@ startup packages configure
+ configure $PKGNAME 1.0 <none>
+ status unpacked $PKGNAME 1.0
+ status half-configured $PKGNAME 1.0
+-status installed $PKGNAME 1.0
+-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
++status installed $PKGNAME 1.0" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+ }
+ checkinstall
+ 
+@@ -85,8 +84,7 @@ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+ status config-files $PKGNAME 1.0
+-status not-installed $PKGNAME <none>
+-startup packages configure" cut -f 3- -d' ' rootdir/var/log/dpkg.log
++status not-installed $PKGNAME <none>" cut -f 3- -d' ' rootdir/var/log/dpkg.log
+ }
+ checkpurge
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch b/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch
new file mode 100644
index 0000000..beea56d
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/0001-fix-the-gcc-version-check.patch
@@ -0,0 +1,160 @@
+From 15c6ef6a827d3681ad06e862d27ab3dfb84cb687 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Wed, 27 May 2015 14:30:28 +0800
+Subject: [PATCH] fix the gcc version check
+
+Upstream-Status: pending
+
+"GCC diagnostic push" is gcc 4.6 feature, gcc 4.4.7 on centos did not know it
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ apt-pkg/cacheset.h           |  4 ++--
+ apt-pkg/deb/debsrcrecords.cc | 12 ++++++------
+ apt-pkg/srcrecords.cc        |  4 ++--
+ apt-pkg/srcrecords.h         |  4 ++--
+ apt-pkg/vendorlist.cc        |  4 ++--
+ 5 files changed, 14 insertions(+), 14 deletions(-)
+
+diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h
+index b7229bc..8cc2917 100644
+--- a/apt-pkg/cacheset.h
++++ b/apt-pkg/cacheset.h
+@@ -119,12 +119,12 @@ public:
+ 		inline std::string FullName(bool const Pretty) const { return getPkg().FullName(Pretty); }
+ 		inline std::string FullName() const { return getPkg().FullName(); }
+ 		APT_DEPRECATED inline const char *Section() const {
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+ 	   return getPkg().Section();
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+ 		}
+diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc
+index 49a348d..4bc9dcf 100644
+--- a/apt-pkg/deb/debsrcrecords.cc
++++ b/apt-pkg/deb/debsrcrecords.cc
+@@ -126,13 +126,13 @@ bool debSrcRecordParser::Files(std::vector<pkgSrcRecords::File> &F)
+    for (std::vector<pkgSrcRecords::File2>::const_iterator f2 = F2.begin(); f2 != F2.end(); ++f2)
+    {
+       pkgSrcRecords::File2 f;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+       f.MD5Hash = f2->MD5Hash;
+       f.Size = f2->Size;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+       f.Path = f2->Path;
+@@ -190,14 +190,14 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ 	 // we have it already, store the new hash and be done
+ 	 if (file != List.end())
+ 	 {
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	// set for compatibility only, so warn users not us
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+ 	    if (checksumField == "Files")
+ 	       file->MD5Hash = hash;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+ 	    // an error here indicates that we have two different hashes for the same file
+@@ -212,7 +212,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ 	 F.FileSize = strtoull(size.c_str(), NULL, 10);
+ 	 F.Hashes.push_back(hashString);
+ 
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	// set for compatibility only, so warn users not us
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+@@ -220,7 +220,7 @@ bool debSrcRecordParser::Files2(std::vector<pkgSrcRecords::File2> &List)
+ 	 F.Size = F.FileSize;
+ 	 if (checksumField == "Files")
+ 	    F.MD5Hash = hash;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+ 
+diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
+index 3175ee7..340e796 100644
+--- a/apt-pkg/srcrecords.cc
++++ b/apt-pkg/srcrecords.cc
+@@ -160,7 +160,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
+    for (std::vector<pkgSrcRecords::File>::const_iterator f = F.begin(); f != F.end(); ++f)
+    {
+       pkgSrcRecords::File2 f2;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+@@ -168,7 +168,7 @@ bool pkgSrcRecords::Parser::Files2(std::vector<pkgSrcRecords::File2> &F2)/*{{{*/
+       f2.Size = f->Size;
+       f2.Hashes.push_back(HashString("MD5Sum", f->MD5Hash));
+       f2.FileSize = f->Size;
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+       f2.Path = f->Path;
+diff --git a/apt-pkg/srcrecords.h b/apt-pkg/srcrecords.h
+index dde22bd..91f8061 100644
+--- a/apt-pkg/srcrecords.h
++++ b/apt-pkg/srcrecords.h
+@@ -30,7 +30,7 @@ class pkgSrcRecords
+ {
+    public:
+ 
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	// ensure that con- & de-structor don't trigger this warning
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+@@ -48,7 +48,7 @@ class pkgSrcRecords
+       unsigned long long FileSize;
+       HashStringList Hashes;
+    };
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+ 
+diff --git a/apt-pkg/vendorlist.cc b/apt-pkg/vendorlist.cc
+index fb33ff1..ba1d3c3 100644
+--- a/apt-pkg/vendorlist.cc
++++ b/apt-pkg/vendorlist.cc
+@@ -11,7 +11,7 @@
+ 
+ #include <apti18n.h>
+ 
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic push
+ 	#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ #endif
+@@ -163,6 +163,6 @@ const Vendor* pkgVendorList::FindVendor(const std::vector<string> GPGVOutput)	/*
+ }
+ 									/*}}}*/
+ 
+-#if __GNUC__ >= 4
++#if __GNUC__ >= 4 + (6 >= __GNUC_MINOR__)
+ 	#pragma GCC diagnostic pop
+ #endif
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch b/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch
new file mode 100644
index 0000000..7c42ff0
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/0001-remove-Wsuggest-attribute-from-CFLAGS.patch
@@ -0,0 +1,43 @@
+From 2bff7ee06a4f96e7d326991d61fb86f8aa651d48 Mon Sep 17 00:00:00 2001
+From: Roy Li <rongqing.li@windriver.com>
+Date: Wed, 27 May 2015 09:48:45 +0800
+Subject: [PATCH] remove Wsuggest-attribute from CXXFLAGS
+
+Upstream-Status: Inappropriate
+
+Wsuggest-attribute is GCC 4.6 feature, centos6 is using GCC
+4.4.7 which unknown this flag, so remove it from CXXFLAGS
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ buildlib/environment.mak.in | 1 -
+ test/libapt/makefile        | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/buildlib/environment.mak.in b/buildlib/environment.mak.in
+index b0a8d9d..91ed011 100644
+--- a/buildlib/environment.mak.in
++++ b/buildlib/environment.mak.in
+@@ -11,7 +11,6 @@ CPPFLAGS+= @CPPFLAGS@ @DEFS@ -D_REENTRANT -D_FORTIFY_SOURCE=2
+ CXX = @CXX@
+ CXXFLAGS+= @CXXFLAGS@ -Wall -Wextra
+ CXXFLAGS+= -Wcast-align -Wlogical-op -Wredundant-decls -Wmissing-declarations -Wunsafe-loop-optimizations
+-CXXFLAGS+= -Wsuggest-attribute=pure -Wsuggest-attribute=const -Wsuggest-attribute=noreturn
+ # a bit too pedantic to be run by default
+ #CXXFLAGS+= -Wpedantic -Wno-long-long -Wno-vla -Wno-variadic-macros
+ NUM_PROCS = @NUM_PROCS@
+diff --git a/test/libapt/makefile b/test/libapt/makefile
+index 7f23ace..e805f13 100644
+--- a/test/libapt/makefile
++++ b/test/libapt/makefile
+@@ -39,7 +39,6 @@ CXXFLAGS += -pthread
+ # disable some flags for gtest again
+ CXXFLAGS+= -Wno-missing-declarations
+ CXXFLAGS+= -Wno-missing-field-initializers
+-CXXFLAGS+= -Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Wno-suggest-attribute=noreturn
+ 
+ # All Google Test headers.  Usually you shouldn't change this definition.
+ GTEST_HEADERS = /usr/include/gtest/*.h \
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch b/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch
new file mode 100644
index 0000000..7c2f64e
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/disable-configure-in-makefile.patch
@@ -0,0 +1,18 @@
+Disable configure at compilation stage
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: apt-0.9.7.7/Makefile
+===================================================================
+--- apt-0.9.7.7.orig/Makefile
++++ apt-0.9.7.7/Makefile
+@@ -33,7 +33,7 @@ veryclean: clean
+ # The startup target builds the necessary configure scripts. It should
+ # be used after a CVS checkout.
+ CONVERTED=environment.mak include/config.h include/apti18n.h build/doc/Doxyfile makefile
+-include buildlib/configure.mak
++#include buildlib/configure.mak
+ $(BUILDDIR)/include/config.h: buildlib/config.h.in
+ $(BUILDDIR)/include/apti18n.h: buildlib/apti18n.h.in
+ $(BUILDDIR)/environment.mak: buildlib/environment.mak.in
diff --git a/meta/recipes-devtools/apt/apt/disable-test.patch b/meta/recipes-devtools/apt/apt/disable-test.patch
new file mode 100644
index 0000000..676795d
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/disable-test.patch
@@ -0,0 +1,58 @@
+[PATCH] disable test
+
+Upstream-Status: Inappropriate [configuration]
+
+test needs gtest package, so not build the test dir
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ Makefile     | 7 +++----
+ configure.ac | 6 ------
+ 2 files changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5f5fb27..5070e96 100644
+--- a/Makefile
++++ b/Makefile
+@@ -9,8 +9,8 @@ endif
+ .PHONY: default
+ default: startup all
+ 
+-.PHONY: headers library clean veryclean all binary program doc test update-po
+-all headers library clean veryclean binary program doc manpages docbook test update-po startup dirs:
++.PHONY: headers library clean veryclean all binary program doc update-po
++all headers library clean veryclean binary program doc manpages docbook update-po startup dirs:
+ 	$(MAKE) -C vendor $@
+ 	$(MAKE) -C apt-pkg $@
+ 	$(MAKE) -C apt-inst $@
+@@ -21,9 +21,8 @@ all headers library clean veryclean binary program doc manpages docbook test upd
+ 	$(MAKE) -C dselect $@
+ #	$(MAKE) -C doc $@
+ 	$(MAKE) -C po $@
+-	$(MAKE) -C test $@
+ 
+-all headers library clean veryclean binary program doc manpages docbook test update-po: startup dirs
++all headers library clean veryclean binary program doc manpages docbook update-po: startup dirs
+ 
+ dirs: startup
+ 
+diff --git a/configure.ac b/configure.ac
+index 5663aaf..b0f9564 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -89,12 +89,6 @@ AC_CHECK_LIB(curl, curl_easy_init,
+      AC_MSG_ERROR([failed: I need CURL due https support]),
+ )
+ 
+-AC_LANG_PUSH([C++])
+-AC_CHECK_HEADER(gtest/gtest.h,,
+-     AC_MSG_ERROR([failed: I need gtest to build tests]),
+-)
+-AC_LANG_POP([C++])
+-
+ 
+ AC_SUBST(BDBLIB)
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch b/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch
new file mode 100644
index 0000000..801ae6d
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/fix-gcc-4.6-null-not-defined.patch
@@ -0,0 +1,12 @@
+Upstream-Status: Pending
+
+--- a/apt-pkg/contrib/weakptr.h
++++ b/apt-pkg/contrib/weakptr.h
+@@ -21,6 +21,7 @@
+ #ifndef WEAK_POINTER_H
+ #define WEAK_POINTER_H
+ 
++#include <cstdlib>
+ #include <set>
+ /**
+  * Class for objects providing support for weak pointers.
diff --git a/meta/recipes-devtools/apt/apt/makerace.patch b/meta/recipes-devtools/apt/apt/makerace.patch
new file mode 100644
index 0000000..46e3161
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/makerace.patch
@@ -0,0 +1,23 @@
+I was seeing various issues with parallel make, mainly due to to what was likely 
+partially installed headers. If you change into the source directory and
+"NOISY=1 make  ../obj/apt-pkg/sourcelist.opic" in apt-pkg, you'll see it 
+doesn't have any dependencies on the headers being installed. This patch
+fixes that so things build correctly.
+
+RP 2012/3/19
+
+Upstream-Status: Pending
+
+Index: apt-0.9.9.4/buildlib/library.mak
+===================================================================
+--- apt-0.9.9.4.orig/buildlib/library.mak	2013-07-31 15:45:07.320440575 +0300
++++ apt-0.9.9.4/buildlib/library.mak	2013-07-31 15:46:49.440440561 +0300
+@@ -61,7 +61,7 @@
+ 
+ # Compilation rules
+ vpath %.cc $(SUBDIRS)
+-$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS)
++$(OBJ)/%.opic: %.cc $(LIBRARYDEPENDS) $($(LOCAL)-HEADERS)
+ 	echo Compiling $< to $@
+ 	$(CXX) -c $(INLINEDEPFLAG) $(CPPFLAGS) $(CXXFLAGS) $(PICFLAGS) -o $@ $<
+ 	$(DoDep)
diff --git a/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch b/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch
new file mode 100644
index 0000000..a0996d4
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/no-nls-dpkg.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+--- a/apt-pkg/deb/dpkgpm.cc
++++ b/apt-pkg/deb/dpkgpm.cc
+@@ -42,6 +42,12 @@
+ #include <apti18n.h>
+ 									/*}}}*/
+ 
++#ifdef USE_NLS
++#define _dpkg(x) dgettext("dpkg", x)
++#else
++#define _dpkg(x) x
++#endif
++
+ using namespace std;
+ 
+ namespace
+@@ -1279,7 +1285,7 @@ void pkgDPkgPM::WriteApportReport(const
+    }
+ 
+    // check if its not a follow up error 
+-   const char *needle = dgettext("dpkg", "dependency problems - leaving unconfigured");
++   const char *needle = _dpkg("dependency problems - leaving unconfigured");
+    if(strstr(errormsg, needle) != NULL) {
+       std::clog << _("No apport report written because the error message indicates its a followup error from a previous failure.") << std::endl;
+       return;
diff --git a/meta/recipes-devtools/apt/apt/noconfigure.patch b/meta/recipes-devtools/apt/apt/noconfigure.patch
new file mode 100644
index 0000000..ebc6720
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/noconfigure.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+
+diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
+index 249542c..0a1911f 100644
+--- a/apt-pkg/packagemanager.cc
++++ b/apt-pkg/packagemanager.cc
+@@ -952,10 +952,12 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
+       return false;
+ 
+    if (Immediate == true) {
++#if 0
+       // Perform immedate configuration of the package. 
+          if (SmartConfigure(Pkg, Depth + 1) == false)
+             _error->Error(_("Could not perform immediate configuration on '%s'. "
+                "Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.FullName().c_str(),2);
++#endif
+    }
+    
+    return true;
+@@ -1038,6 +1040,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
+       }
+    }
+ 
++#if 0
+    // Final run through the configure phase
+    if (ConfigureAll() == false)
+       return Failed;
+@@ -1052,6 +1055,7 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall()
+ 	 return Failed;
+       }
+    }
++#endif
+ 	 
+    return Completed;
+ }
diff --git a/meta/recipes-devtools/apt/apt/nodoc.patch b/meta/recipes-devtools/apt/apt/nodoc.patch
new file mode 100644
index 0000000..449e42d
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/nodoc.patch
@@ -0,0 +1,18 @@
+Disable documentation
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: apt-0.9.7.7/Makefile
+===================================================================
+--- apt-0.9.7.7.orig/Makefile
++++ apt-0.9.7.7/Makefile
+@@ -17,7 +17,7 @@ all headers library clean veryclean bina
+ 	$(MAKE) -C cmdline $@
+ 	$(MAKE) -C ftparchive $@
+ 	$(MAKE) -C dselect $@
+-	$(MAKE) -C doc $@
++#	$(MAKE) -C doc $@
+ 	$(MAKE) -C po $@
+ 	$(MAKE) -C test $@
+ 
diff --git a/meta/recipes-devtools/apt/apt/truncate-filename.patch b/meta/recipes-devtools/apt/apt/truncate-filename.patch
new file mode 100644
index 0000000..db1c42b
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/truncate-filename.patch
@@ -0,0 +1,35 @@
+strutl.cc: the filename can't be longer than 255
+
+The URItoFileName translates the path into the filename, but the
+filename can't be longer than 255 according to
+/usr/include/linux/limits.h.
+
+Truncate it when it is longer than 240 (leave some spaces for
+".Packages" and "._Release" suffix)
+
+Upstream-Status: Pending
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ apt-pkg/contrib/strutl.cc |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
+--- a/apt-pkg/contrib/strutl.cc
++++ b/apt-pkg/contrib/strutl.cc
+@@ -399,7 +399,12 @@ string URItoFileName(const string &URI)
+    // "\x00-\x20{}|\\\\^\\[\\]<>\"\x7F-\xFF";
+    string NewURI = QuoteString(U,"\\|{}[]<>\"^~_=!@#$%^&*");
+    replace(NewURI.begin(),NewURI.end(),'/','_');
+-   return NewURI;
++
++   // Truncate from the head when it is longer than 240
++   if(NewURI.length() > 240)
++       return NewURI.substr(NewURI.length() - 240, NewURI.length() - 1);
++   else
++       return NewURI;
+ }
+ 									/*}}}*/
+ // Base64Encode - Base64 Encoding routine for short strings		/*{{{*/
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/apt/apt/use-host.patch b/meta/recipes-devtools/apt/apt/use-host.patch
new file mode 100644
index 0000000..b30fcff
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/use-host.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: apt-0.9.7.7/configure.ac
+===================================================================
+--- apt-0.9.7.7.orig/configure.ac
++++ apt-0.9.7.7/configure.ac
+@@ -112,7 +112,7 @@ dnl This is often the dpkg architecture
+ dnl First check against the full canonical canoncial-system-type in $target
+ dnl and if that fails, just look for the cpu
+ AC_MSG_CHECKING(debian architecture)
+-archset="`dpkg-architecture -qDEB_HOST_ARCH`"
++archset="`echo $host_alias|cut -d'-' -f1`"
+ if test "x$archset" = "x"; then
+    AC_MSG_ERROR([failed: use --host= or output from dpkg-architecture])
+ fi
diff --git a/meta/recipes-devtools/apt/apt_1.0.10.1.bb b/meta/recipes-devtools/apt/apt_1.0.10.1.bb
new file mode 100644
index 0000000..bf77e2a
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt_1.0.10.1.bb
@@ -0,0 +1,18 @@
+DEPENDS = "curl db"
+RDEPENDS_${PN} = "dpkg bash debianutils"
+require apt.inc
+
+require apt-package.inc
+
+PACKAGECONFIG ??= "lzma"
+PACKAGECONFIG[lzma] = "ac_cv_lib_lzma_lzma_easy_encoder=yes,ac_cv_lib_lzma_lzma_easy_encoder=no,xz"
+
+FILES_${PN} += "${bindir}/apt-key"
+apt-manpages += "doc/apt-key.8"
+
+do_install_append() {
+    #Write the correct apt-architecture to apt.conf
+    APT_CONF=${D}/etc/apt/apt.conf
+    echo 'APT::Architecture "${DPKG_ARCH}";' > ${APT_CONF}
+    oe_libinstall -so -C bin libapt-private ${D}${libdir}/
+}
diff --git a/meta/recipes-devtools/apt/files/apt.conf b/meta/recipes-devtools/apt/files/apt.conf
new file mode 100644
index 0000000..0335135
--- /dev/null
+++ b/meta/recipes-devtools/apt/files/apt.conf
@@ -0,0 +1,42 @@
+Dir "${STAGING_DIR_NATIVE}/"
+{
+   State "var/lib/apt/"
+   {
+      Lists "#APTCONF#/lists/";
+      status "#ROOTFS#/var/lib/dpkg/status";
+   };
+   Cache "var/cache/apt/"
+   {
+      Archives "archives/";
+      pkgcache "";
+      srcpkgcache "";
+   };
+   Bin "${STAGING_BINDIR_NATIVE}/"
+   {
+      methods "${STAGING_LIBDIR}/apt/methods/";
+      gzip "/bin/gzip";
+      dpkg "dpkg";
+      dpkg-source "dpkg-source";
+      dpkg-buildpackage "dpkg-buildpackage";
+      apt-get "apt-get";
+      apt-cache "apt-cache";
+   };
+   Etc "#APTCONF#"
+   {
+      Preferences "preferences";
+   };
+};
+
+APT
+{
+  Install-Recommends "true";
+  Immediate-Configure "false";
+  Architecture "i586";
+  Get
+  {
+     Assume-Yes "true";
+     Force-Yes "true"
+  };
+};
+
+DPkg::Options {"--root=#ROOTFS#";"--admindir=#ROOTFS#/var/lib/dpkg";"--force-all";"--no-debsig"};
diff --git a/meta/recipes-devtools/apt/files/db_linking_hack.patch b/meta/recipes-devtools/apt/files/db_linking_hack.patch
new file mode 100644
index 0000000..a61d4b0
--- /dev/null
+++ b/meta/recipes-devtools/apt/files/db_linking_hack.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Backport
+
+Index: apt-0.7.3/configure.ac
+===================================================================
+--- apt-0.7.3.orig/configure.ac	2007-07-01 10:38:45.000000000 +0000
++++ apt-0.7.3/configure.ac	2007-08-21 13:39:26.000000000 +0000
+@@ -67,8 +67,20 @@
+       [AC_DEFINE(HAVE_BDB)
+        BDBLIB="-ldb"
+        AC_MSG_RESULT(yes)],
+-      [BDBLIB=""
+-       AC_MSG_RESULT(no)]
++
++       LIBS="$LIBS -lpthread"
++       [AC_MSG_CHECKING(if we can link against BerkeleyDB with pthread)
++        AC_LINK_IFELSE(
++        [AC_LANG_PROGRAM(
++         [#include <db.h>],
++         [int r, s, t; db_version(&r, &s, &t);]
++        )],
++        [AC_DEFINE(HAVE_BDB)
++         BDBLIB="-ldb -lpthread"
++         AC_MSG_RESULT(yes)],
++        [BDBLIB=""
++         AC_MSG_RESULT(no)]
++      )]       
+     )]
+ )
+ 
diff --git a/meta/recipes-devtools/apt/files/environment.patch b/meta/recipes-devtools/apt/files/environment.patch
new file mode 100644
index 0000000..9a03038
--- /dev/null
+++ b/meta/recipes-devtools/apt/files/environment.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Backport
+
+Index: apt-0.6.46.2/buildlib/environment.mak.in
+===================================================================
+--- apt-0.6.46.2.orig/buildlib/environment.mak.in	2007-03-29 11:38:58.000000000 +0100
++++ apt-0.6.46.2/buildlib/environment.mak.in	2007-03-29 11:39:12.000000000 +0100
+@@ -62,7 +62,7 @@
+ 
+ # Shared library things
+ HOST_OS = @host_os@
+-ifneq ($(words $(filter linux-gnu gnu% %gnu,$(HOST_OS))),0)
++ifneq ($(words $(filter linux-gnu linux-gnueabi gnu% %gnu,$(HOST_OS))),0)
+    SONAME_MAGIC=-Wl,-soname -Wl,
+    LFLAGS_SO=
+ else
diff --git a/meta/recipes-devtools/apt/files/no-curl.patch b/meta/recipes-devtools/apt/files/no-curl.patch
new file mode 100644
index 0000000..30238fa
--- /dev/null
+++ b/meta/recipes-devtools/apt/files/no-curl.patch
@@ -0,0 +1,38 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ configure.in     |    6 ------
+ methods/makefile |    7 -------
+ 2 files changed, 13 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -86,12 +86,6 @@ AC_CHECK_HEADER(db.h,
+ 
+ LIBS="$saveLIBS"
+ 
+-AC_CHECK_LIB(curl, curl_easy_init,
+-     [AC_CHECK_HEADER(curl/curl.h,
+-        curl_ok=yes,
+-        curl_ok=no)],
+-     AC_MSG_ERROR([failed: I need CURL due https support]),
+-)
+ 
+ AC_SUBST(BDBLIB)
+ 
+--- a/methods/makefile
++++ b/methods/makefile
+@@ -51,13 +51,6 @@ LIB_MAKES = apt-pkg/makefile
+ SOURCE = http.cc http_main.cc rfc2553emu.cc connect.cc server.cc
+ include $(PROGRAM_H)
+ 
+-# The https method
+-PROGRAM=https
+-SLIBS = -lapt-pkg -lcurl $(INTLLIBS)
+-LIB_MAKES = apt-pkg/makefile
+-SOURCE = https.cc server.cc
+-include $(PROGRAM_H)
+-
+ # The ftp method
+ PROGRAM=ftp
+ SLIBS = -lapt-pkg $(SOCKETLIBS) $(INTLLIBS)
diff --git a/meta/recipes-devtools/autoconf/autoconf.inc b/meta/recipes-devtools/autoconf/autoconf.inc
new file mode 100644
index 0000000..78b77e8
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf.inc
@@ -0,0 +1,43 @@
+SUMMARY = "A GNU tool that procude shell scripts to automatically configure software"
+DESCRIPTION = "Autoconf is an extensible package of M4 macros that produce shell scripts to automatically \ 
+configure software source code packages. Autoconf creates a configuration script for a package from a template \
+file that lists the operating system features that the package can use, in the form of M4 macro calls."
+LICENSE = "GPLv3"
+HOMEPAGE = "http://www.gnu.org/software/autoconf/"
+SECTION = "devel"
+DEPENDS += "m4-native"
+DEPENDS_class-native = "m4-native gnu-config-native"
+DEPENDS_class-nativesdk = "nativesdk-m4 nativesdk-gnu-config"
+RDEPENDS_${PN} = "m4 gnu-config \
+		  perl \
+		  perl-module-carp \
+		  perl-module-constant \
+		  perl-module-errno \
+		  perl-module-exporter \
+		  perl-module-file-basename \
+		  perl-module-file-compare \
+		  perl-module-file-copy \
+		  perl-module-file-glob \
+		  perl-module-file-path \
+		  perl-module-file-stat \
+		  perl-module-getopt-long \
+		  perl-module-io-file \
+		  perl-module-posix \
+		  perl-module-data-dumper \
+		 "
+RDEPENDS_${PN}_class-native = "m4-native gnu-config-native"
+
+SRC_URI = "${GNU_MIRROR}/autoconf/autoconf-${PV}.tar.gz \
+	   file://program_prefix.patch"
+
+inherit autotools texinfo
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl"
+
+do_configure() {
+	oe_runconf
+}
+
+do_install_append() {
+    rm -rf ${D}${datadir}/emacs
+}
diff --git a/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch b/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch
new file mode 100644
index 0000000..d1bd3a2
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/autoreconf-exclude.patch
@@ -0,0 +1,139 @@
+Upstream-Status: Pending
+
+Index: autoconf-2.63/bin/autoreconf.in
+===================================================================
+--- autoconf-2.63.orig/bin/autoreconf.in	2008-12-31 17:39:01.000000000 +0000
++++ autoconf-2.63/bin/autoreconf.in	2008-12-31 17:43:38.000000000 +0000
+@@ -76,6 +76,7 @@
+   -i, --install            copy missing auxiliary files
+       --no-recursive       don't rebuild sub-packages
+   -s, --symlink            with -i, install symbolic links instead of copies
++  -x, --exclude=STEPS      steps we should not run
+   -m, --make               when applicable, re-run ./configure && make
+   -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [syntax]
+ 
+@@ -136,6 +137,13 @@
+ # Recurse into subpackages
+ my $recursive = 1;
+ 
++# Steps to exclude
++my @exclude;
++my @ex;
++
++my $uses_gettext;
++my $configure_ac;
++
+ ## ---------- ##
+ ## Routines.  ##
+ ## ---------- ##
+@@ -153,6 +161,7 @@
+ 	  'B|prepend-include=s'	 => \@prepend_include,
+ 	  'i|install'            => \$install,
+ 	  's|symlink'            => \$symlink,
++  	  'x|exclude=s'          => \@exclude,
+ 	  'm|make'               => \$run_make,
+ 	  'recursive!'           => \$recursive);
+ 
+@@ -162,6 +171,8 @@
+   parse_WARNINGS;
+   parse_warnings '--warnings', @warning;
+ 
++  @exclude = map { split /,/ } @exclude;
++
+   # Even if the user specified a configure.ac, trim to get the
+   # directory, and look for configure.ac again.  Because (i) the code
+   # is simpler, and (ii) we are still able to diagnose simultaneous
+@@ -255,6 +266,11 @@
+ {
+   my ($aclocal, $flags) = @_;
+ 
++  @ex = grep (/^aclocal$/, @exclude);
++  if ($#ex != -1) {
++    return;
++  }
++
+   # aclocal 1.8+ does all this for free.  It can be recognized by its
+   # --force support.
+   if ($aclocal_supports_force)
+@@ -368,7 +384,10 @@
+     }
+   else
+     {
+-      xsystem_hint ("autopoint is needed because this package uses Gettext", "$autopoint");
++      @ex = grep (/^autopoint$/, @exclude);
++      if ($#ex == -1) {
++        xsystem_hint ("autopoint is needed because this package uses Gettext", "$autopoint");
++      }
+     }
+ 
+ 
+@@ -532,16 +551,17 @@
+ 	{
+ 	  $libtoolize .= " --ltdl";
+ 	}
+-      xsystem_hint ("libtoolize is needed because this package uses Libtool", $libtoolize);
+-      $rerun_aclocal = 1;
++      @ex = grep (/^libtoolize$/, @exclude);
++      if ($#ex == -1) {
++        xsystem_hint ("libtoolize is needed because this package uses Libtool", $libtoolize);
++        $rerun_aclocal = 1;
++      }
+     }
+   else
+     {
+       verb "$configure_ac: not running libtoolize: --install not given";
+     }
+ 
+-
+-
+   # ------------------- #
+   # Rerunning aclocal.  #
+   # ------------------- #
+@@ -572,7 +592,10 @@
+   # latter runs the former, and (ii) autoconf is stricter than
+   # autoheader.  So all in all, autoconf should give better error
+   # messages.
+-  xsystem ($autoconf);
++  @ex = grep (/^autoconf$/, @exclude);
++  if ($#ex == -1) {
++    xsystem ("$autoconf");
++  }
+ 
+ 
+   # -------------------- #
+@@ -593,7 +616,10 @@
+     }
+   else
+     {
+-      xsystem ($autoheader);
++      @ex = grep (/^autoheader$/, @exclude);
++      if ($#ex == -1) {
++        xsystem ("$autoheader");
++      }
+     }
+ 
+ 
+@@ -610,7 +636,10 @@
+       # We should always run automake, and let it decide whether it shall
+       # update the file or not.  In fact, the effect of `$force' is already
+       # included in `$automake' via `--no-force'.
+-      xsystem ($automake);
++      @ex = grep (/^automake$/, @exclude);
++      if ($#ex == -1) {
++        xsystem ("$automake");
++      }
+     }
+ 
+ 
+@@ -634,7 +663,10 @@
+ 	    }
+ 	  else
+ 	    {
+-	      xsystem ("$make");
++              @ex = grep (/^make$/, @exclude);
++              if ($#ex == -1) {
++	        xsystem ("$make");
++              }
+ 	    }
+ 	}
+     }
diff --git a/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch b/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch
new file mode 100644
index 0000000..5ff18c2
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/autoreconf-gnuconfigize.patch
@@ -0,0 +1,38 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+Index: autoconf-2.63/bin/autoreconf.in
+===================================================================
+--- autoconf-2.63.orig/bin/autoreconf.in	2008-12-31 17:43:55.000000000 +0000
++++ autoconf-2.63/bin/autoreconf.in	2008-12-31 17:46:16.000000000 +0000
+@@ -58,7 +58,7 @@
+ $help = "Usage: $0 [OPTION]... [DIRECTORY]...
+ 
+ Run `autoconf' (and `autoheader', `aclocal', `automake', `autopoint'
+-(formerly `gettextize'), and `libtoolize' where appropriate)
++(formerly `gettextize'), `libtoolize', and `gnu-configize' where appropriate)
+ repeatedly to remake the GNU Build System files in specified
+ DIRECTORIES and their subdirectories (defaulting to `.').
+ 
+@@ -115,6 +115,7 @@
+ my $libtoolize = $ENV{'LIBTOOLIZE'} || 'libtoolize';
+ my $autopoint  = $ENV{'AUTOPOINT'}  || 'autopoint';
+ my $make       = $ENV{'MAKE'}       || 'make';
++my $gnuconfigize = $ENV{'GNUCONFIGIZE'}       || 'gnu-configize';
+ 
+ # --install -- as --add-missing in other tools.
+ my $install = 0;
+@@ -644,6 +645,10 @@
+       }
+     }
+ 
++  @ex = grep (/^gnu-configize$/, @exclude);
++  if ($#ex == -1) {
++    xsystem ("$gnuconfigize");
++  }
+ 
+   # -------------- #
+   # Running make.  #
diff --git a/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch b/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch
new file mode 100644
index 0000000..31326f0
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/autoreconf-include.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Pending
+
+Index: autoconf-2.63/bin/autoreconf.in
+===================================================================
+--- autoconf-2.63.orig/bin/autoreconf.in	2008-08-28 03:08:10.000000000 +0100
++++ autoconf-2.63/bin/autoreconf.in	2008-12-31 17:38:40.000000000 +0000
+@@ -190,6 +190,7 @@
+   $autoconf   .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include);
+   $autoheader .= join (' --include=', '', map { shell_quote ($_) } @include);
+   $autoheader .= join (' --prepend-include=', '', map { shell_quote ($_) } @prepend_include);
++  $aclocal    .= join (' -I ', '', map { shell_quote ($_) } @include);
+ 
+   # --install and --symlink;
+   if ($install)
diff --git a/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch b/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch
new file mode 100644
index 0000000..b5e8174
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/autotest-automake-result-format.patch
@@ -0,0 +1,136 @@
+From a7e722f974e2529d3e564d8d94c86cc8bdbc40e7 Mon Sep 17 00:00:00 2001
+From: Radu Patriu <radu.patriu@enea.com>
+Date: Mon, 24 Mar 2014 16:33:19 +0200
+Subject: [PATCH] autotest: new testsuite option to enable automake test
+ result format
+
+* lib/autotest/general.m4: added "--am-fmt | -A" command line
+parameter for testsuite script to enable "RESULT: testname" output;
+will be used by yocto ptest packages.
+
+Upstream-Status: Pending
+
+Signed-off-by: Radu Patriu <radu.patriu@enea.com>
+---
+ lib/autotest/general.m4 |   39 +++++++++++++++++++++++++++++----------
+ 1 file changed, 29 insertions(+), 10 deletions(-)
+
+diff --git a/lib/autotest/general.m4 b/lib/autotest/general.m4
+index 60c0352..c1f5a9b 100644
+--- a/lib/autotest/general.m4
++++ b/lib/autotest/general.m4
+@@ -412,6 +412,9 @@ at_recheck=
+ # Whether a write failure occurred
+ at_write_fail=0
+ 
++# Automake result format "result: testname"
++at_am_fmt=false
++
+ # The directory we run the suite in.  Default to . if no -C option.
+ at_dir=`pwd`
+ # An absolute reference to this testsuite script.
+@@ -530,6 +533,10 @@ do
+ 	at_check_filter_trace=at_fn_filter_trace
+ 	;;
+ 
++    --am-fmt | -A )
++	at_am_fmt=:
++	;;
++
+     [[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9]])
+ 	at_fn_validate_ranges at_option
+ 	AS_VAR_APPEND([at_groups], ["$at_option$as_nl"])
+@@ -718,10 +725,10 @@ m4_divert_push([HELP_MODES])dnl
+ cat <<_ATEOF || at_write_fail=1
+ 
+ Operation modes:
+-  -h, --help     print the help message, then exit
+-  -V, --version  print version number, then exit
+-  -c, --clean    remove all the files this test suite might create and exit
+-  -l, --list     describes all the tests, or the selected TESTS
++  -h, --help      print the help message, then exit
++  -V, --version   print version number, then exit
++  -c, --clean     remove all the files this test suite might create and exit
++  -l, --list      describes all the tests, or the selected TESTS
+ _ATEOF
+ m4_divert_pop([HELP_MODES])dnl
+ m4_wrap([m4_divert_push([HELP_TUNING_BEGIN])dnl
+@@ -747,6 +754,7 @@ Execution tuning:
+   -d, --debug    inhibit clean up and top-level logging
+ [                 default for debugging scripts]
+   -x, --trace    enable tests shell tracing
++  -A, --am-fmt   automake result format "result: testname"
+ _ATEOF
+ m4_divert_pop([HELP_TUNING_BEGIN])])dnl
+ m4_divert_push([HELP_END])dnl
+@@ -1162,7 +1170,9 @@ at_fn_group_banner ()
+     [*])          at_desc_line="$[1]: "  ;;
+   esac
+   AS_VAR_APPEND([at_desc_line], ["$[3]$[4]"])
+-  $at_quiet AS_ECHO_N(["$at_desc_line"])
++  if ! $at_am_fmt; then
++    $at_quiet AS_ECHO_N(["$at_desc_line"])
++  fi
+   echo "#                             -*- compilation -*-" >> "$at_group_log"
+ }
+ 
+@@ -1188,42 +1198,51 @@ _ATEOF
+   case $at_xfail:$at_status in
+     yes:0)
+ 	at_msg="UNEXPECTED PASS"
++	at_am_msg="XPASS"
+ 	at_res=xpass
+ 	at_errexit=$at_errexit_p
+ 	at_color=$at_red
+ 	;;
+     no:0)
+ 	at_msg="ok"
++	at_am_msg="PASS"
+ 	at_res=pass
+ 	at_errexit=false
+ 	at_color=$at_grn
+ 	;;
+     *:77)
+ 	at_msg='skipped ('`cat "$at_check_line_file"`')'
++	at_am_msg="SKIP"
+ 	at_res=skip
+ 	at_errexit=false
+ 	at_color=$at_blu
+ 	;;
+     no:* | *:99)
+ 	at_msg='FAILED ('`cat "$at_check_line_file"`')'
++	at_am_msg="FAIL"
+ 	at_res=fail
+ 	at_errexit=$at_errexit_p
+ 	at_color=$at_red
+ 	;;
+     yes:*)
+ 	at_msg='expected failure ('`cat "$at_check_line_file"`')'
++	at_am_msg="XFAIL"
+ 	at_res=xfail
+ 	at_errexit=false
+ 	at_color=$at_lgn
+ 	;;
+   esac
+   echo "$at_res" > "$at_job_dir/$at_res"
+-  # In parallel mode, output the summary line only afterwards.
+-  if test $at_jobs -ne 1 && test -n "$at_verbose"; then
+-    AS_ECHO(["$at_desc_line $at_color$at_msg$at_std"])
++  if $at_am_fmt; then
++      AS_ECHO(["$at_am_msg: $at_desc"])
+   else
+-    # Make sure there is a separator even with long titles.
+-    AS_ECHO([" $at_color$at_msg$at_std"])
++    # In parallel mode, output the summary line only afterwards.
++    if test $at_jobs -ne 1 && test -n "$at_verbose"; then
++      AS_ECHO(["$at_desc_line $at_color$at_msg$at_std"])
++    else
++      # Make sure there is a separator even with long titles.
++      AS_ECHO([" $at_color$at_msg$at_std"])
++    fi
+   fi
+   at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
+   case $at_status in
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch b/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch
new file mode 100644
index 0000000..73394d7
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/check-automake-cross-warning.patch
@@ -0,0 +1,34 @@
+Use --warning=cross only if supported by automake
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+--- a/bin/autoreconf.in
++++ b/bin/autoreconf.in
+@@ -127,6 +127,8 @@ my $aclocal_supports_warnings = 0;
+ my $automake_supports_force_missing = 0;
+ # Does automake support -Wfoo?
+ my $automake_supports_warnings = 0;
++# Does automake support --warning=cross
++my $automake_supports_cross_warning = 0;
+ 
+ my @prepend_include;
+ my @include;
+@@ -191,6 +193,7 @@ sub parse_args ()
+   $aclocal_supports_warnings = $aclocal_help =~ /--warnings/;
+   $automake_supports_force_missing = $automake_help =~ /--force-missing/;
+   $automake_supports_warnings = $automake_help =~ /--warnings/;
++  $automake_supports_cross_warning = $automake_help =~ /cross/;
+ 
+   # Dispatch autoreconf's option to the tools.
+   # --include;
+@@ -244,6 +247,8 @@ sub parse_args ()
+       $libtoolize .= ' --debug';
+     }
+   # --warnings;
++  @warning = grep { $_ ne "cross" } @warning
++    if ! $automake_supports_cross_warning;
+   if (@warning)
+     {
+       my $warn = ' --warnings=' . join (',', @warning);
diff --git a/meta/recipes-devtools/autoconf/autoconf/config_site.patch b/meta/recipes-devtools/autoconf/autoconf/config_site.patch
new file mode 100644
index 0000000..9f04440
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/config_site.patch
@@ -0,0 +1,40 @@
+Upstream-Status: Pending
+
+Poky provides a list of site files in CONFIG_SITE whereas autoconf 
+only expects one file. This patch changes autoconf to accept a list of 
+them.
+
+RP 1/2/10
+
+Updated for 2.68 version: the CONFIG_SITE var was not getting used at all
+fixed the 2.68 code 
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/05/27
+
+Index: autoconf-2.68/lib/autoconf/general.m4
+===================================================================
+--- autoconf-2.68.orig/lib/autoconf/general.m4
++++ autoconf-2.68/lib/autoconf/general.m4
+@@ -1878,7 +1878,6 @@ AU_DEFUN([AC_VALIDATE_CACHED_SYSTEM_TUPL
+ m4_define([AC_SITE_LOAD],
+ [# Prefer an explicitly selected file to automatically selected ones.
+ ac_site_file1=NONE
+-ac_site_file2=NONE
+ if test -n "$CONFIG_SITE"; then
+   # We do not want a PATH search for config.site.
+   case $CONFIG_SITE in @%:@((
+@@ -1886,14 +1885,8 @@ if test -n "$CONFIG_SITE"; then
+     */*) ac_site_file1=$CONFIG_SITE;;
+     *)   ac_site_file1=./$CONFIG_SITE;;
+   esac
+-elif test "x$prefix" != xNONE; then
+-  ac_site_file1=$prefix/share/config.site
+-  ac_site_file2=$prefix/etc/config.site
+-else
+-  ac_site_file1=$ac_default_prefix/share/config.site
+-  ac_site_file2=$ac_default_prefix/etc/config.site
+ fi
+-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
++for ac_site_file in $ac_site_file1
+ do
+   test "x$ac_site_file" = xNONE && continue
+   if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
diff --git a/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch b/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch
new file mode 100644
index 0000000..65df88f
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/fix_path_xtra.patch
@@ -0,0 +1,120 @@
+Upstream-Status: Pending
+
+We don't build xmkmf so any values returned from it are going to be wrong.
+Using any paths in /usr/ for x headers/libs is a bad idea when cross compiling.
+This patch removes them to stop any confusion.
+
+RP - 20071115
+
+Index: autoconf-2.68/lib/autoconf/libs.m4
+===================================================================
+--- autoconf-2.68.orig/lib/autoconf/libs.m4
++++ autoconf-2.68/lib/autoconf/libs.m4
+@@ -159,53 +159,6 @@ m4_popdef([AC_Lib_Name])dnl
+ # --------------------- #
+ 
+ 
+-# _AC_PATH_X_XMKMF
+-# ----------------
+-# Internal subroutine of _AC_PATH_X.
+-# Set ac_x_includes and/or ac_x_libraries.
+-m4_define([_AC_PATH_X_XMKMF],
+-[AC_ARG_VAR(XMKMF, [Path to xmkmf, Makefile generator for X Window System])dnl
+-rm -f -r conftest.dir
+-if mkdir conftest.dir; then
+-  cd conftest.dir
+-  cat >Imakefile <<'_ACEOF'
+-incroot:
+-	@echo incroot='${INCROOT}'
+-usrlibdir:
+-	@echo usrlibdir='${USRLIBDIR}'
+-libdir:
+-	@echo libdir='${LIBDIR}'
+-_ACEOF
+-  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+-    # GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+-    for ac_var in incroot usrlibdir libdir; do
+-      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+-    done
+-    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+-    for ac_extension in a so sl dylib la dll; do
+-      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+-	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+-	ac_im_usrlibdir=$ac_im_libdir; break
+-      fi
+-    done
+-    # Screen out bogus values from the imake configuration.  They are
+-    # bogus both because they are the default anyway, and because
+-    # using them would break gcc on systems where it needs fixed includes.
+-    case $ac_im_incroot in
+-	/usr/include) ac_x_includes= ;;
+-	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+-    esac
+-    case $ac_im_usrlibdir in
+-	/usr/lib | /usr/lib64 | /lib | /lib64) ;;
+-	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+-    esac
+-  fi
+-  cd ..
+-  rm -f -r conftest.dir
+-fi
+-])# _AC_PATH_X_XMKMF
+-
+-
+ # _AC_PATH_X_DIRECT
+ # -----------------
+ # Internal subroutine of _AC_PATH_X.
+@@ -213,44 +166,7 @@ fi
+ m4_define([_AC_PATH_X_DIRECT],
+ [# Standard set of common directories for X headers.
+ # Check X11 before X11Rn because it is often a symlink to the current release.
+-ac_x_header_dirs='
+-/usr/X11/include
+-/usr/X11R7/include
+-/usr/X11R6/include
+-/usr/X11R5/include
+-/usr/X11R4/include
+-
+-/usr/include/X11
+-/usr/include/X11R7
+-/usr/include/X11R6
+-/usr/include/X11R5
+-/usr/include/X11R4
+-
+-/usr/local/X11/include
+-/usr/local/X11R7/include
+-/usr/local/X11R6/include
+-/usr/local/X11R5/include
+-/usr/local/X11R4/include
+-
+-/usr/local/include/X11
+-/usr/local/include/X11R7
+-/usr/local/include/X11R6
+-/usr/local/include/X11R5
+-/usr/local/include/X11R4
+-
+-/usr/X386/include
+-/usr/x386/include
+-/usr/XFree86/include/X11
+-
+-/usr/include
+-/usr/local/include
+-/usr/unsupported/include
+-/usr/athena/include
+-/usr/local/x11r5/include
+-/usr/lpp/Xamples/include
+-
+-/usr/openwin/include
+-/usr/openwin/share/include'
++ac_x_header_dirs=''
+ 
+ if test "$ac_x_includes" = no; then
+   # Guess where to find include files, by looking for Xlib.h.
+@@ -299,7 +215,6 @@ AC_DEFUN([_AC_PATH_X],
+ [AC_CACHE_VAL(ac_cv_have_x,
+ [# One or both of the vars are not set, and there is no cached value.
+ ac_x_includes=no ac_x_libraries=no
+-_AC_PATH_X_XMKMF
+ _AC_PATH_X_DIRECT
+ case $ac_x_includes,$ac_x_libraries in #(
+   no,* | *,no | *\'*)
diff --git a/meta/recipes-devtools/autoconf/autoconf/preferbash.patch b/meta/recipes-devtools/autoconf/autoconf/preferbash.patch
new file mode 100644
index 0000000..fa76ee9
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/preferbash.patch
@@ -0,0 +1,25 @@
+This value is used to determine CONFIG_SHELL and SHELL which may get exported into
+scripts shared via sstate onto other systems.
+
+Some systems have /bin/sh -> dash and others /bin/sh -> bash. Bash is preferred 
+but sometimes we can sometimes end up exporting /bin/sh yet use bashisms.
+
+This patch puts bash first in the search results which avoids the bash/dash confusion.
+
+RP 2012/9/23
+
+Upstream-Status: Inappropriate [OE specific configuration]
+
+Index: autoconf-2.69/lib/m4sugar/m4sh.m4
+===================================================================
+--- autoconf-2.69.orig/lib/m4sugar/m4sh.m4	2012-03-07 17:35:26.000000000 +0000
++++ autoconf-2.69/lib/m4sugar/m4sh.m4	2013-09-23 16:12:38.853597515 +0000
+@@ -229,7 +229,7 @@
+     [_AS_PATH_WALK([/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH],
+       [case $as_dir in @%:@(
+ 	 /*)
+-	   for as_base in sh bash ksh sh5; do
++	   for as_base in bash sh ksh sh5; do
+ 	     # Try only shells that exist, to save several forks.
+ 	     as_shell=$as_dir/$as_base
+ 	     AS_IF([{ test -f "$as_shell" || test -f "$as_shell.exe"; } &&
diff --git a/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch b/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch
new file mode 100644
index 0000000..978a401
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/program_prefix.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- autoconf-2.57/lib/autoconf/general.m4~program_prefix
++++ autoconf-2.57/lib/autoconf/general.m4
+@@ -1676,8 +1676,9 @@
+ # The aliases save the names the user supplied, while $host etc.
+ # will get canonicalized.
+ test -n "$target_alias" &&
+-  test "$program_prefix$program_suffix$program_transform_name" = \
+-    NONENONEs,x,x, &&
++  test "$target_alias" != "$host_alias" &&
++    test "$program_prefix$program_suffix$program_transform_name" = \
++      NONENONEs,x,x, &&
+   program_prefix=${target_alias}-[]dnl
+ ])# AC_CANONICAL_TARGET
+ 
diff --git a/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch b/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch
new file mode 100644
index 0000000..55d2e2f
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf/remove-usr-local-lib-from-m4.patch
@@ -0,0 +1,29 @@
+We have problem using hardcoded directories like /usr/local here
+which will be checked for cross builds. This is a special case which
+is valid for AIX only. We do not have AIX as one of our supported
+build host or target. Therefore we get rid of the hardcoded paths
+and make life easier for cross compilation process.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [Upstream does care for AIX while we may not]
+Index: autoconf-2.68/lib/autoconf/functions.m4
+===================================================================
+--- autoconf-2.68.orig/lib/autoconf/functions.m4	2010-09-22 14:52:19.000000000 -0700
++++ autoconf-2.68/lib/autoconf/functions.m4	2011-08-03 11:57:05.822199513 -0700
+@@ -749,15 +749,6 @@ if test $ac_have_func = no; then
+     [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes])
+ fi
+ 
+-if test $ac_have_func = no; then
+-  # There is a commonly available library for RS/6000 AIX.
+-  # Since it is not a standard part of AIX, it might be installed locally.
+-  ac_getloadavg_LIBS=$LIBS
+-  LIBS="-L/usr/local/lib $LIBS"
+-  AC_CHECK_LIB(getloadavg, getloadavg,
+-	       [LIBS="-lgetloadavg $LIBS"], [LIBS=$ac_getloadavg_LIBS])
+-fi
+-
+ # Make sure it is really in the library, if we think we found it,
+ # otherwise set up the replacement function.
+ AC_CHECK_FUNCS(getloadavg, [],
diff --git a/meta/recipes-devtools/autoconf/autoconf_2.69.bb b/meta/recipes-devtools/autoconf/autoconf_2.69.bb
new file mode 100644
index 0000000..809007f
--- /dev/null
+++ b/meta/recipes-devtools/autoconf/autoconf_2.69.bb
@@ -0,0 +1,25 @@
+require autoconf.inc
+
+PR = "r11"
+
+LICENSE = "GPLv2 & GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+		    file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504"
+SRC_URI += "file://autoreconf-include.patch \
+	    file://check-automake-cross-warning.patch \
+	    file://autoreconf-exclude.patch \
+	    file://autoreconf-gnuconfigize.patch \
+            file://config_site.patch \
+            file://remove-usr-local-lib-from-m4.patch \
+            file://preferbash.patch \
+            file://autotest-automake-result-format.patch \
+           "
+
+SRC_URI[md5sum] = "82d05e03b93e45f5a39b828dc9c6c29b"
+SRC_URI[sha256sum] = "954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969"
+
+SRC_URI_append_class-native = " file://fix_path_xtra.patch"
+
+EXTRA_OECONF += "ac_cv_path_M4=m4 ac_cv_prog_TEST_EMACS=no"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/autogen/autogen-native_5.18.5.bb b/meta/recipes-devtools/autogen/autogen-native_5.18.5.bb
new file mode 100644
index 0000000..2a28512
--- /dev/null
+++ b/meta/recipes-devtools/autogen/autogen-native_5.18.5.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Automated text and program generation tool"
+DESCRIPTION = "AutoGen is a tool designed to simplify the creation and\
+ maintenance of programs that contain large amounts of repetitious text.\
+ It is especially valuable in programs that have several blocks of text\
+ that must be kept synchronized."
+HOMEPAGE = "http://www.gnu.org/software/autogen/"
+SECTION = "devel"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/autogen/rel${PV}/autogen-${PV}.tar.gz \
+           file://increase-timeout-limit.patch \
+           file://mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch \
+           file://redirect-output-dir.patch \
+"
+
+SRC_URI[md5sum] = "385d7c7dfbe60babbee261c054923a53"
+SRC_URI[sha256sum] = "7bbdb73b5518baf64c6d3739fb2ecc66d2cccda888ce5ad573abe235ab5d96ba"
+
+DEPENDS = "guile-native libtool-native libxml2-native"
+
+inherit autotools texinfo native pkgconfig
+
+# autogen-native links against libguile which may have been relocated with sstate
+# these environment variables ensure there isn't a relocation issue
+export GUILE_LOAD_PATH = "${STAGING_DATADIR_NATIVE}/guile/2.0"
+export GUILE_LOAD_COMPILED_PATH = "${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache"
+
+do_install_append () {
+	create_wrapper ${D}/${bindir}/autogen \
+		GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
+		GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
+}
diff --git a/meta/recipes-devtools/autogen/autogen/increase-timeout-limit.patch b/meta/recipes-devtools/autogen/autogen/increase-timeout-limit.patch
new file mode 100644
index 0000000..3d4c1d6
--- /dev/null
+++ b/meta/recipes-devtools/autogen/autogen/increase-timeout-limit.patch
@@ -0,0 +1,33 @@
+Subject: [PATCH] autogen: increase timeout limit for shell commands
+
+On some overloaded hosts, shell commands of autogen may can not
+finish in 5 secs. This has caused many build failures, so increase
+the timeout limit to fix this.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
+---
+ configure.ac |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0af7c18..5544f59 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -175,9 +175,9 @@ config_end_time=`date +%s 2>/dev/null`
+ time_delta=`expr ${config_end_time} - ${config_start_time} 2>/dev/null`
+ 
+ if test -z "${time_delta}"
+-then time_delta=10
+-elif test ${time_delta} -lt 5
+-then time_delta=5 ; fi
++then time_delta=60
++elif test ${time_delta} -lt 30
++then time_delta=30 ; fi
+ 
+ AG_TIMEOUT=${time_delta}
+ ]
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch b/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch
new file mode 100644
index 0000000..e56da7b
--- /dev/null
+++ b/meta/recipes-devtools/autogen/autogen/mk-tpl-config.sh-force-exit-value-to-be-0-in-subproc.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Pending
+
+mk-tpl-config.sh: force exit value to be 0 in subprocess
+
+The return value of statement list=`<subcommands>` is the exit value of the
+subcommands. So if the subcommands fails, the compilation fails. This is obviously
+not intended. In the normal case, we expect the grep command to fail as there should
+be no 'noreturn' word in the libguile files.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ autoopts/mk-tpl-config.sh |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/autoopts/mk-tpl-config.sh b/autoopts/mk-tpl-config.sh
+index 926f5ab..6b4a0fb 100755
+--- a/autoopts/mk-tpl-config.sh
++++ b/autoopts/mk-tpl-config.sh
+@@ -202,7 +202,7 @@ fix_guile() {
+ 
+     list=`set +e ; exec 2>/dev/null
+         find ${libguiledir}/libguile* -type f | \
+-            xargs grep -l -E '\<noreturn\>'`
++            xargs grep -l -E '\<noreturn\>' ; exit 0`
+ 
+     test -z "$list" && exit 0
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch b/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch
new file mode 100644
index 0000000..de126ed
--- /dev/null
+++ b/meta/recipes-devtools/autogen/autogen/redirect-output-dir.patch
@@ -0,0 +1,28 @@
+[PATCH] redirect the dir of mklibsrc-log.tx
+
+Upstream-Statue: Pending
+
+redirect mklibsrc-log.tx to builddir, not /tmp; otherwise mklibsrc-log.tx
+maybe unable to be written if other users is building autogen at the same time.
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ pkg/libopts/mklibsrc.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pkg/libopts/mklibsrc.sh b/pkg/libopts/mklibsrc.sh
+index 416b402..d612fbc 100644
+--- a/pkg/libopts/mklibsrc.sh
++++ b/pkg/libopts/mklibsrc.sh
+@@ -19,7 +19,7 @@
+ ##  with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+ set -ex
+-exec 2> /tmp/mklibsrc-log.tx
++exec 2> $top_builddir/mklibsrc-log.tx
+ 
+ top_builddir=`cd $top_builddir ; pwd`
+ top_srcdir=`cd $top_srcdir ; pwd`
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/automake/automake.inc b/meta/recipes-devtools/automake/automake.inc
new file mode 100644
index 0000000..a1debd8
--- /dev/null
+++ b/meta/recipes-devtools/automake/automake.inc
@@ -0,0 +1,18 @@
+SUMMARY = "A GNU tool for automatically generating Makefiles"
+DESCRIPTION = "Automake is a tool for automatically generating `Makefile.in' files compliant with the GNU Coding \
+Standards. Automake requires the use of Autoconf."
+LICENSE = "GPLv2"
+HOMEPAGE = "http://www.gnu.org/software/automake/"
+SECTION = "devel"
+
+SRC_URI = "${GNU_MIRROR}/automake/automake-${PV}.tar.gz"
+
+inherit autotools texinfo
+
+do_configure() {
+	oe_runconf
+}
+
+export AUTOMAKE = "${@bb.utils.which('automake', d.getVar('PATH', True))}"
+
+FILES_${PN} += "${datadir}/automake* ${datadir}/aclocal*"
diff --git a/meta/recipes-devtools/automake/automake/buildtest.patch b/meta/recipes-devtools/automake/automake/buildtest.patch
new file mode 100644
index 0000000..1dd5337
--- /dev/null
+++ b/meta/recipes-devtools/automake/automake/buildtest.patch
@@ -0,0 +1,33 @@
+Split "check-TESTS" into a buildtest and runtest target, so that they can
+be run separately.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+
+--- a/lib/am/check.am	2012-11-14 13:46:16.335475995 +0100
++++ b/lib/am/check.am	2012-08-13 18:40:12.000000000 +0200
+@@ -44,7 +44,7 @@
+ am__tty_colors = $(am__tty_colors_dummy)
+ endif !%?COLOR%
+
+-.PHONY: check-TESTS
++.PHONY: check-TESTS buildtest-TESTS runtest-TESTS
+
+ if %?PARALLEL_TESTS%
+
+@@ -465,7 +465,14 @@
+
+ else !%?PARALLEL_TESTS%
+
+-check-TESTS: $(TESTS)
++AM_RECURSIVE_TARGETS += buildtest runtest
++
++buildtest-TESTS: $(TESTS)
++
++check-TESTS: buildtest-TESTS
++	$(MAKE) $(AM_MAKEFLAGS) runtest-TESTS
++
++runtest-TESTS:
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+ ## Make sure Solaris VPATH-expands all members of this list, even
diff --git a/meta/recipes-devtools/automake/automake/py-compile-compile-only-optimized-byte-code.patch b/meta/recipes-devtools/automake/automake/py-compile-compile-only-optimized-byte-code.patch
new file mode 100644
index 0000000..f8334a7
--- /dev/null
+++ b/meta/recipes-devtools/automake/automake/py-compile-compile-only-optimized-byte-code.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+* OE-Core's python creates the same binary output
+  for both pyc and pyo, so disable the creation of
+  pyc files by automake.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+Updated for automake-1.12.6
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+diff -Nurd automake-1.12.6/lib/py-compile automake-1.12.6/lib/py-compile
+--- automake-1.12.6/lib/py-compile	2012-12-13 21:57:31.000000000 +0200
++++ automake-1.12.6/lib/py-compile	2012-12-27 19:34:01.426015140 +0200
+@@ -115,26 +115,6 @@
+     filetrans="filepath = os.path.normpath('$destdir' + os.sep + path)"
+ fi
+ 
+-$PYTHON -c "
+-import sys, os, py_compile, imp
+-
+-files = '''$files'''
+-
+-sys.stdout.write('Byte-compiling python modules...\n')
+-for file in files.split():
+-    $pathtrans
+-    $filetrans
+-    if not os.path.exists(filepath) or not (len(filepath) >= 3
+-                                            and filepath[-3:] == '.py'):
+-	    continue
+-    sys.stdout.write(file)
+-    sys.stdout.flush()
+-    if hasattr(imp, 'get_tag'):
+-        py_compile.compile(filepath, imp.cache_from_source(filepath), path)
+-    else:
+-        py_compile.compile(filepath, filepath + 'c', path)
+-sys.stdout.write('\n')" || exit $?
+-
+ # this will fail for python < 1.5, but that doesn't matter ...
+ $PYTHON -O -c "
+ import sys, os, py_compile, imp
diff --git a/meta/recipes-devtools/automake/automake/python-libdir.patch b/meta/recipes-devtools/automake/automake/python-libdir.patch
new file mode 100644
index 0000000..47541bd
--- /dev/null
+++ b/meta/recipes-devtools/automake/automake/python-libdir.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
+
+Updated for automake-1.12.6
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+diff -Nurd automake-1.12.6/m4/python.m4 automake-1.12.6/m4/python.m4
+--- automake-1.12.6/m4/python.m4	2012-12-13 22:02:25.000000000 +0200
++++ automake-1.12.6/m4/python.m4	2012-12-27 17:40:26.558164660 +0200
+@@ -91,12 +91,13 @@
+     [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`])
+   AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
+ 
+-  dnl Use the values of $prefix and $exec_prefix for the corresponding
+-  dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX.  These are made
++  dnl Use the values of $prefix, $libdir and $exec_prefix for the corresponding
++  dnl values of PYTHON_PREFIX PYTHON_LIB_PREFIX, and PYTHON_EXEC_PREFIX.  These are made
+   dnl distinct variables so they can be overridden if need be.  However,
+   dnl general consensus is that you shouldn't need this ability.
+ 
+   AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
++  AC_SUBST([PYTHON_LIB_PREFIX], ['${libdir}'])
+   AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
+ 
+   dnl At times (like when building shared libraries) you may want
+@@ -148,7 +149,8 @@
+ else:
+     from distutils import sysconfig
+     sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
+-sys.stdout.write(sitedir)"`
++sys.stdout.write(sitedir)" ||
++     echo "$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages"`
+      case $am_cv_python_pythondir in
+      $am_py_prefix*)
+        am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'`
+@@ -158,7 +160,7 @@
+        case $am_py_prefix in
+          /usr|/System*) ;;
+          *)
+-	  am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages
++	  am_cv_python_pythondir=$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages
+ 	  ;;
+        esac
+        ;;
+@@ -190,7 +192,8 @@
+ else:
+     from distutils import sysconfig
+     sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix')
+-sys.stdout.write(sitedir)"`
++sys.stdout.write(sitedir)" ||
++     echo "$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages"`
+      case $am_cv_python_pyexecdir in
+      $am_py_exec_prefix*)
+        am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'`
+@@ -200,7 +203,7 @@
+        case $am_py_exec_prefix in
+          /usr|/System*) ;;
+          *)
+-	   am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages
++	   am_cv_python_pyexecdir=$PYTHON_LIB_PREFIX/python$PYTHON_VERSION/site-packages
+ 	   ;;
+        esac
+        ;;
diff --git a/meta/recipes-devtools/automake/automake_1.15.bb b/meta/recipes-devtools/automake/automake_1.15.bb
new file mode 100644
index 0000000..c33dc22
--- /dev/null
+++ b/meta/recipes-devtools/automake/automake_1.15.bb
@@ -0,0 +1,34 @@
+require automake.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+DEPENDS_class-native = "autoconf-native"
+
+NAMEVER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+RDEPENDS_${PN} += "\
+    autoconf \
+    perl \
+    perl-module-bytes \
+    perl-module-data-dumper \
+    perl-module-strict \
+    perl-module-text-parsewords \
+    perl-module-thread-queue \
+    perl-module-threads \
+    perl-module-vars "
+
+RDEPENDS_${PN}_class-native = "autoconf-native perl-native-runtime"
+
+SRC_URI += " file://python-libdir.patch \
+            file://py-compile-compile-only-optimized-byte-code.patch \
+            file://buildtest.patch"
+
+SRC_URI[md5sum] = "716946a105ca228ab545fc37a70df3a3"
+SRC_URI[sha256sum] = "7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_PERL=${USRBINPATH}/perl"
+
+do_install_append () {
+    install -d ${D}${datadir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/binutils/binutils-2.25.1.inc b/meta/recipes-devtools/binutils/binutils-2.25.1.inc
new file mode 100644
index 0000000..f3817fa
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.25.1.inc
@@ -0,0 +1,43 @@
+LIC_FILES_CHKSUM="\
+    file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
+    file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\
+    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\
+    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\
+    file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\
+    file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
+    file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\
+    file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\
+    file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\
+    "
+
+def binutils_branch_version(d):
+    pvsplit = d.getVar('PV', True).split('.')
+    return pvsplit[0] + "_" + pvsplit[1]
+
+BINUPV = "${@binutils_branch_version(d)}"
+
+SRCREV = "2bd25930221dea4bf33c13a89c111514491440e2"
+SRC_URI = "\
+     git://sourceware.org/git/binutils-gdb.git;branch=binutils-${BINUPV}-branch;protocol=git \
+     file://0002-configure-widen-the-regexp-for-SH-architectures.patch \
+     file://0003-Point-scripts-location-to-libdir.patch \
+     file://0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch \
+     file://0005-Explicitly-link-with-libm-on-uclibc.patch \
+     file://0006-Use-libtool-2.4.patch \
+     file://0007-Add-the-armv5e-architecture-to-binutils.patch \
+     file://0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch \
+     file://0009-Upstream-Status-Inappropriate-distribution-codesourc.patch \
+     file://0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch \
+     file://0011-Change-default-emulation-for-mips64-linux.patch \
+     file://0012-Add-XLP-instructions-support.patch \
+     file://0013-Fix-an-internal-error-in-do_print_to_mapfile-seen-wi.patch \
+     file://0014-gold-arm-Skip-pic-check-for-R_ARM_REL32.patch \
+     file://0015-Fix-dynamic-list-so-that-symbols-not-in-the-list-are.patch \
+     file://binutils-octeon3.patch \
+     file://add-thunderx-support-for-gas.patch \
+     "
+S  = "${WORKDIR}/git"
+
+do_configure_prepend () {
+        rm -rf ${S}/gdb ${S}/libdecnumber ${S}/readline ${S}/sim
+}
diff --git a/meta/recipes-devtools/binutils/binutils-cross-canadian.inc b/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
new file mode 100644
index 0000000..ae14642
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
@@ -0,0 +1,29 @@
+inherit cross-canadian
+
+SUMMARY = "GNU binary utilities (cross-canadian for ${TARGET_ARCH} target)"
+PN = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+BPN = "binutils"
+
+DEPENDS = "flex-native bison-native virtual/${HOST_PREFIX}gcc-crosssdk virtual/nativesdk-libc nativesdk-zlib nativesdk-gettext nativesdk-flex"
+EXTRA_OECONF += "--with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \
+                "
+
+# We have to point binutils at a sysroot but we don't need to rebuild if this changes
+# e.g. we switch between different machines with different tunes.
+EXTRA_OECONF[vardepsexclude] = "TUNE_PKGARCH"
+
+do_install () {
+	autotools_do_install
+
+	# We're not interested in the libs or headers, these would come from the 
+	# nativesdk or target version of the binutils recipe
+	rm -rf ${D}${prefix}/${TARGET_SYS}
+	rm -f ${D}${libdir}/libbfd*
+	rm -f ${D}${libdir}/libiberty*
+	rm -f ${D}${libdir}/libopcodes*
+	rm -f ${D}${includedir}/*.h
+	
+	cross_canadian_bindirlinks
+}
+
+BBCLASSEXTEND = ""
diff --git a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.25.1.bb b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.25.1.bb
new file mode 100644
index 0000000..5dbaa03
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.25.1.bb
@@ -0,0 +1,3 @@
+require binutils.inc
+require binutils-${PV}.inc
+require binutils-cross-canadian.inc
diff --git a/meta/recipes-devtools/binutils/binutils-cross.inc b/meta/recipes-devtools/binutils/binutils-cross.inc
new file mode 100644
index 0000000..fd3d801
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross.inc
@@ -0,0 +1,30 @@
+inherit cross
+PROVIDES = "virtual/${TARGET_PREFIX}binutils"
+
+PN = "binutils-cross-${TARGET_ARCH}"
+BPN = "binutils"
+
+INHIBIT_DEFAULT_DEPS = "1"
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+EXTRA_OECONF += "--with-sysroot=${STAGING_DIR_TARGET} \
+                --disable-install-libbfd \
+                --enable-poison-system-directories \
+                "
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install
+
+	# We don't really need these, so we'll remove them...
+	rm -rf ${D}${STAGING_DIR_NATIVE}${libdir_native}/libiberty.a
+	rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}
+	rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/lib/ldscripts
+	rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/info
+	rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/locale
+	rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/man
+	rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/share || :
+	rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}/gcc-lib || :
+	rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64/gcc-lib || :
+	rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir} || :
+	rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64 || :
+	rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${prefix} || :
+}
diff --git a/meta/recipes-devtools/binutils/binutils-cross_2.25.1.bb b/meta/recipes-devtools/binutils/binutils-cross_2.25.1.bb
new file mode 100644
index 0000000..fbd1f7d
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross_2.25.1.bb
@@ -0,0 +1,3 @@
+require binutils.inc
+require binutils-${PV}.inc
+require binutils-cross.inc
diff --git a/meta/recipes-devtools/binutils/binutils-crosssdk_2.25.1.bb b/meta/recipes-devtools/binutils/binutils-crosssdk_2.25.1.bb
new file mode 100644
index 0000000..788106f
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-crosssdk_2.25.1.bb
@@ -0,0 +1,13 @@
+require binutils-cross_${PV}.bb
+
+inherit crosssdk
+
+PN = "binutils-crosssdk-${TARGET_ARCH}"
+
+PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
+
+SRC_URI += "file://0001-Generate-relocatable-SDKs.patch"
+
+do_configure_prepend () {
+	sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
+}
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc
new file mode 100644
index 0000000..a304867
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils.inc
@@ -0,0 +1,153 @@
+SUMMARY = "GNU binary utilities"
+DESCRIPTION = "The GNU Binutils are a collection of binary tools. \
+The main ones are ld (GNU Linker), and as (GNU Assembler). This \
+package also includes addition tools such as addr2line (Converts \
+addresses into filenames and line numbers), ar (utility for creating, \
+modifying and extracting archives), nm (list symbols in object \
+files), objcopy (copy and translate object files), objdump (Display \
+object information), and other tools and related libraries."
+HOMEPAGE = "http://www.gnu.org/software/binutils/"
+BUGTRACKER = "http://sourceware.org/bugzilla/"
+SECTION = "devel"
+LICENSE = "GPLv3"
+
+DEPENDS = "flex-native bison-native zlib-native gnu-config-native autoconf-native"
+
+inherit autotools gettext multilib_header texinfo
+
+FILES_${PN} = " \
+	${bindir}/${TARGET_PREFIX}* \
+	${libdir}/lib*-*.so \
+	${prefix}/${TARGET_SYS}/bin/* \
+        ${bindir}/embedspu"
+
+RPROVIDES_${PN} += "${PN}-symlinks"
+
+FILES_${PN}-dev = " \
+	${includedir} \
+	${libdir}/*.la \
+	${libdir}/libbfd.so \
+	${libdir}/libopcodes.so"
+
+# Rather than duplicating multiple entries for these, make one
+# list and reuse it.
+
+USE_ALTERNATIVES_FOR = " \
+	addr2line \
+	ar \
+	as \
+	c++filt \
+	elfedit \
+	gprof \
+	ld \
+	ld.bfd \
+	ld.gold dwp \
+	nm \
+	objcopy \
+	objdump \
+	ranlib \
+	readelf \
+	size \
+	strings \
+	strip \
+"
+
+python do_package_prepend() {
+    make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or ""
+    prefix = d.getVar("TARGET_PREFIX", True)
+    bindir = d.getVar("bindir", True)
+    for alt in make_alts.split():
+        d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt)
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt)
+}
+
+# FILES_${PN}-dbg = "${prefix}/${TARGET_SYS}/bin/.debug ${prefix}/${libdir}/.debug"
+
+B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
+
+EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
+                --disable-werror \
+                --enable-plugins \
+                ${LDGOLD} \
+                ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
+
+LDGOLD_class-native = ""
+LDGOLD_class-crosssdk = ""
+LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default', d)}"
+
+# This is necessary due to a bug in the binutils Makefiles
+# EXTRA_OEMAKE = "configure-build-libiberty all"
+
+export AR = "${HOST_PREFIX}ar"
+export AS = "${HOST_PREFIX}as"
+export LD = "${HOST_PREFIX}ld"
+export NM = "${HOST_PREFIX}nm"
+export RANLIB = "${HOST_PREFIX}ranlib"
+export OBJCOPY = "${HOST_PREFIX}objcopy"
+export OBJDUMP = "${HOST_PREFIX}objdump"
+
+export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
+export AS_FOR_TARGET = "${TARGET_PREFIX}as"
+export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
+export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
+export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
+
+export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
+export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
+
+# autotools.bbclass sets the _FOR_BUILD variables, but for some reason we need
+# to unset LD_LIBRARY_PATH.
+export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
+
+MULTIARCH := "${@bb.utils.contains("DISTRO_FEATURES", "multiarch", "yes", "no", d)}"
+do_configure[vardeps] += "MULTIARCH"
+do_configure () {
+	(cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
+	oe_runconf
+#
+# must prime config.cache to ensure the build of libiberty
+#
+	mkdir -p ${B}/build-${BUILD_SYS}
+	for i in ${CONFIG_SITE}; do
+		cat $i >> ${B}/build-${BUILD_SYS}/config.cache || true
+	done
+}
+
+do_install () {
+	autotools_do_install
+
+	# We don't really need these, so we'll remove them...
+	rm -rf ${D}${libdir}/ldscripts
+
+	# Fix the /usr/${TARGET_SYS}/bin/* links
+	for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
+		rm -f $l
+		ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
+			| tr -s / \
+			| sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
+	done
+
+	# Install the libiberty header
+	install -d ${D}${includedir}
+	install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
+	install -m 644 ${S}/include/libiberty.h ${D}${includedir}
+
+	cd ${D}${bindir}
+
+	# Symlinks for ease of running these on the native target
+	for p in ${TARGET_PREFIX}* ; do
+		ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,`
+	done
+
+	for alt in ${USE_ALTERNATIVES_FOR}; do
+		rm -f ${D}${bindir}/$alt
+	done
+
+	oe_multilib_header bfd.h
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}"
diff --git a/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch b/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch
new file mode 100644
index 0000000..1e80c1f
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0001-Generate-relocatable-SDKs.patch
@@ -0,0 +1,62 @@
+From f71ecf251f84b4bbc9b7a832d5cd4a8bae95d83b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:58:54 +0000
+Subject: [PATCH 01/13] Generate relocatable SDKs
+
+This patch will modify the ELF linker scripts so that the crosssdk
+linker will generate binaries with a 4096 bytes PT_INTERP section. When the binaries
+will be relocated, at SDK install time, the interpreter path can be easily
+changed by the relocating script.
+
+Upstream-Status: Inappropriate [SDK specific]
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/genscripts.sh      | 3 +++
+ ld/scripttempl/elf.sc | 4 ++--
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/ld/genscripts.sh b/ld/genscripts.sh
+index 499607a..075dd04 100755
+--- a/ld/genscripts.sh
++++ b/ld/genscripts.sh
+@@ -277,6 +277,7 @@ DATA_ALIGNMENT_u="${DATA_ALIGNMENT_u-${DATA_ALIGNMENT_r}}"
+ LD_FLAG=r
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_r}
+ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
++PARTIAL_LINKING=" "
+ ( echo "/* Script for ld -r: link without relocation */"
+   . ${CUSTOMIZER_SCRIPT}
+   . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+@@ -285,10 +286,12 @@ DEFAULT_DATA_ALIGNMENT="ALIGN(${SEGMENT_SIZE})"
+ LD_FLAG=u
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_u}
+ CONSTRUCTING=" "
++PARTIAL_LINKING=" "
+ ( echo "/* Script for ld -Ur: link w/out relocation, do create constructors */"
+   . ${CUSTOMIZER_SCRIPT}
+   . ${srcdir}/scripttempl/${SCRIPT_NAME}.sc
+ ) | sed -e '/^ *$/d;s/[ 	]*$//' > ldscripts/${EMULATION_NAME}.xu
++unset PARTIAL_LINKING
+ 
+ LD_FLAG=
+ DATA_ALIGNMENT=${DATA_ALIGNMENT_}
+diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc
+index 4368fd9..9f01e8c 100644
+--- a/ld/scripttempl/elf.sc
++++ b/ld/scripttempl/elf.sc
+@@ -131,8 +131,8 @@ if test -n "${COMMONPAGESIZE}"; then
+   DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
+   DATA_SEGMENT_RELRO_END=". = DATA_SEGMENT_RELRO_END (${SEPARATE_GOTPLT-0}, .);"
+ fi
+-if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}"; then
+-  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp) }"
++if test -z "${INITIAL_READONLY_SECTIONS}${CREATE_SHLIB}${PARTIAL_LINKING}"; then
++  INITIAL_READONLY_SECTIONS=".interp       ${RELOCATING-0} : { *(.interp); . = 0x1000; }"
+ fi
+ if test -z "$PLT"; then
+   IPLT=".iplt         ${RELOCATING-0} : { *(.iplt) }"
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch b/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch
new file mode 100644
index 0000000..34e21d1
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0002-configure-widen-the-regexp-for-SH-architectures.patch
@@ -0,0 +1,56 @@
+From dfbcfb0d71765b337e63562299a943043928d2d2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:07:33 +0000
+Subject: [PATCH 02/13] configure: widen the regexp for SH architectures
+
+gprof needs to know about uclibc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure       | 4 ++--
+ gprof/configure | 5 +++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 87677bc..e9f2f13 100755
+--- a/configure
++++ b/configure
+@@ -3341,7 +3341,7 @@ case "${target}" in
+     ;;
+   s390-*-* | s390x-*-*)
+     ;;
+-  sh-*-* | sh[34]*-*-*)
++  sh*-*-* | sh[34]*-*-*)
+     ;;
+   sh64-*-* | sh5*-*-*)
+     ;;
+@@ -3812,7 +3812,7 @@ case "${target}" in
+   or1k*-*-*)
+     noconfigdirs="$noconfigdirs gdb"
+     ;;
+-  sh-*-* | sh64-*-*)
++  sh*-*-* | sh64-*-*)
+     case "${target}" in
+       sh*-*-elf)
+          ;;
+diff --git a/gprof/configure b/gprof/configure
+index b09c8fb..79961c5 100755
+--- a/gprof/configure
++++ b/gprof/configure
+@@ -5869,6 +5869,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
++linux-uclibc*)
++  lt_cv_deplibs_check_method=pass_all
++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++  ;;
++
+ netbsd*)
+   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch b/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch
new file mode 100644
index 0000000..f5ce767
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0003-Point-scripts-location-to-libdir.patch
@@ -0,0 +1,42 @@
+From dfb1412da67bbfe3e993d107d0b5e392f44141ab Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:09:58 +0000
+Subject: [PATCH 03/13] Point scripts location to libdir
+
+Upstream-Status: Inappropriate [debian patch]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/Makefile.am | 2 +-
+ ld/Makefile.in | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ld/Makefile.am b/ld/Makefile.am
+index 9575f1f..84df0bf 100644
+--- a/ld/Makefile.am
++++ b/ld/Makefile.am
+@@ -54,7 +54,7 @@ endif
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ 
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+diff --git a/ld/Makefile.in b/ld/Makefile.in
+index 9f56ca1..272860f 100644
+--- a/ld/Makefile.in
++++ b/ld/Makefile.in
+@@ -388,7 +388,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ INCDIR = $(BASEDIR)/include
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch b/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
new file mode 100644
index 0000000..e3cd2a4
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0004-Only-generate-an-RPATH-entry-if-LD_RUN_PATH-is-not-e.patch
@@ -0,0 +1,41 @@
+From 3126608b8c95a792ade56cf62a531d935d391c50 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:27:17 +0000
+Subject: [PATCH 04/13] Only generate an RPATH entry if LD_RUN_PATH is not
+ empty
+
+for cases where -rpath isn't specified. debian (#151024)
+
+Upstream-Status: Pending
+
+Signed-off-by: Chris Chimelis <chris@debian.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/emultempl/elf32.em | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
+index 36dee8e..07bea52 100644
+--- a/ld/emultempl/elf32.em
++++ b/ld/emultempl/elf32.em
+@@ -1198,6 +1198,8 @@ fragment <<EOF
+ 	      && command_line.rpath == NULL)
+ 	    {
+ 	      lib_path = (const char *) getenv ("LD_RUN_PATH");
++	      if ((lib_path) && (strlen (lib_path) == 0))
++		  lib_path = NULL;
+ 	      if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
+ 						      force))
+ 		break;
+@@ -1461,6 +1463,8 @@ gld${EMULATION_NAME}_before_allocation (void)
+   rpath = command_line.rpath;
+   if (rpath == NULL)
+     rpath = (const char *) getenv ("LD_RUN_PATH");
++  if ((rpath) && (strlen (rpath) == 0))
++    rpath = NULL;
+ 
+   for (abfd = link_info.input_bfds; abfd; abfd = abfd->link.next)
+     if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch b/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch
new file mode 100644
index 0000000..9bbd93e
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0005-Explicitly-link-with-libm-on-uclibc.patch
@@ -0,0 +1,52 @@
+From f1703bcc7a5c507e471e2630b5a2de129100315a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:32:49 +0000
+Subject: [PATCH 05/13] Explicitly link with libm on uclibc
+
+Description:
+
+We do not need to have the libtool patch anymore for binutils after
+libtool has been updated upstream it include support for it. However
+for building gas natively on uclibc systems we have to link it with
+-lm so that it picks up missing symbols.
+
+/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o):
+In function `floatformat_from_double':
+floatformat.c:(.text+0x1ec): undefined reference to `frexp'
+floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
+/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o):
+In function `floatformat_to_double':
+floatformat.c:(.text+0x38a): undefined reference to `ldexp'
+floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
+floatformat.c:(.text+0x43e): undefined reference to `ldexp'
+floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
+collect2: ld returned 1 exit status
+make[4]: *** [as-new] Error 1
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gas/configure.tgt | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gas/configure.tgt b/gas/configure.tgt
+index 9abc768..1d92f55 100644
+--- a/gas/configure.tgt
++++ b/gas/configure.tgt
+@@ -477,6 +477,12 @@ case ${generic_target} in
+   *-*-netware)				fmt=elf em=netware ;;
+ esac
+ 
++case ${generic_target} in
++  arm-*-*uclibc*)
++    need_libm=yes
++    ;;
++esac
++
+ case ${cpu_type} in
+   aarch64 | alpha | arm | i386 | ia64 | microblaze | mips | ns32k | or1k | or1knd | pdp11 | ppc | sparc | z80 | z8k)
+     bfd_gas=yes
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch b/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch
new file mode 100644
index 0000000..62967ef
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0006-Use-libtool-2.4.patch
@@ -0,0 +1,19361 @@
+From 03eb9b4fe583e88a22fd8c25b43fbd9bafe21af6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:34:41 +0000
+Subject: [PATCH 06/13] Use libtool 2.4
+
+So we can get libtool sysroot support
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ bfd/configure        | 1320 +++++++++++++++++------
+ bfd/configure.ac     |    2 +-
+ binutils/configure   | 1318 +++++++++++++++++------
+ configure            |    2 +-
+ gas/configure        | 1318 +++++++++++++++++------
+ gprof/configure      | 1323 +++++++++++++++++------
+ ld/configure         | 1701 +++++++++++++++++++++--------
+ libtool.m4           | 1086 +++++++++++++------
+ ltmain.sh            | 2925 +++++++++++++++++++++++++++++++++-----------------
+ ltoptions.m4         |    2 +-
+ ltversion.m4         |   12 +-
+ lt~obsolete.m4       |    2 +-
+ opcodes/configure    | 1320 +++++++++++++++++------
+ opcodes/configure.ac |    2 +-
+ 14 files changed, 8952 insertions(+), 3381 deletions(-)
+
+diff --git a/bfd/configure b/bfd/configure
+index 85e6b82..3d3dd88 100755
+--- a/bfd/configure
++++ b/bfd/configure
+@@ -668,6 +668,9 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
++ac_ct_AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -780,6 +783,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1456,6 +1460,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+   --with-mmap             try using mmap for BFD input files if available
+   --with-separate-debug-dir=DIR
+                           Look for global separate debug info in DIR
+@@ -5386,8 +5392,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -5427,7 +5433,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -6113,8 +6119,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -6163,6 +6169,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -6179,6 +6259,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6347,7 +6432,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -6501,6 +6587,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6516,9 +6617,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6534,7 +6788,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6554,11 +6808,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6574,7 +6832,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6593,6 +6851,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6604,16 +6866,72 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
+ 
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
+ 
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
+ 
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
+ 
+ 
+ 
+@@ -6955,8 +7273,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6992,6 +7310,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -7033,6 +7352,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -7044,7 +7375,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -7070,8 +7401,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -7081,8 +7412,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -7119,6 +7450,16 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
+ 
+ 
+ 
+@@ -7140,6 +7481,45 @@ fi
+ 
+ 
+ 
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
++
++
++
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+   enableval=$enable_libtool_lock;
+@@ -7346,6 +7726,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -7909,6 +8406,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -8073,7 +8572,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -8162,7 +8662,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8460,8 +8960,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8627,6 +9125,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8689,7 +9193,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -8746,13 +9250,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8813,6 +9321,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -9163,7 +9676,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -9211,7 +9725,7 @@ _LT_EOF
+       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ 	 && test "$tmp_diet" = no
+       then
+-	tmp_addflag=
++	tmp_addflag=' $pic_flag'
+ 	tmp_sharedflag='-shared'
+ 	case $cc_basename,$host_cpu in
+         pgcc*)				# Portland Group C compiler
+@@ -9262,12 +9776,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -9281,8 +9795,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -9300,8 +9814,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9347,8 +9861,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9478,7 +9992,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9491,22 +10011,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9518,7 +10045,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9531,22 +10064,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9591,20 +10131,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9665,7 +10248,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9673,7 +10256,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9689,7 +10272,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -9713,10 +10296,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -9795,23 +10378,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9896,7 +10492,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -9915,9 +10511,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -10493,8 +11089,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10527,13 +11124,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10625,7 +11280,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -11465,10 +12120,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11571,10 +12226,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -15163,7 +15818,7 @@ SHARED_LDFLAGS=
+ if test "$enable_shared" = "yes"; then
+   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+   if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+   fi
+ 
+ # More hacks to build DLLs on Windows.
+@@ -16780,13 +17435,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -16801,14 +17463,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -16841,12 +17506,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -16901,8 +17566,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -16912,12 +17582,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -16933,7 +17605,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -16969,6 +17640,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -17748,7 +18420,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -17851,19 +18524,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -17893,6 +18589,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -17902,6 +18604,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -18016,12 +18721,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -18108,9 +18813,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -18126,6 +18828,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -18158,210 +18863,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+diff --git a/bfd/configure.ac b/bfd/configure.ac
+index ba98e39..88063cf 100644
+--- a/bfd/configure.ac
++++ b/bfd/configure.ac
+@@ -564,7 +564,7 @@ changequote(,)dnl
+   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+ changequote([,])dnl
+   if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+   fi
+ 
+ # More hacks to build DLLs on Windows.
+diff --git a/binutils/configure b/binutils/configure
+index be4b81c..6606a5f 100755
+--- a/binutils/configure
++++ b/binutils/configure
+@@ -655,8 +655,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -767,6 +770,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1439,6 +1443,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+   --with-zlib             include zlib support (auto/yes/no) default=auto
+   --with-gnu-ld           assume the C compiler uses GNU ld default=no
+   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
+@@ -5153,8 +5159,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -5194,7 +5200,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5880,8 +5886,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -5930,6 +5936,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5946,6 +6026,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6114,7 +6199,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -6268,6 +6354,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6283,9 +6384,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6301,7 +6555,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6321,11 +6575,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6341,7 +6599,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6360,6 +6618,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6371,16 +6633,72 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
+ 
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
+ 
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
+ 
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
+ 
+ 
+ 
+@@ -6722,8 +7040,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6759,6 +7077,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -6800,6 +7119,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6811,7 +7142,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -6837,8 +7168,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6848,8 +7179,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -6886,6 +7217,20 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
++
+ 
+ 
+ 
+@@ -6905,6 +7250,41 @@ fi
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
++
+ 
+ 
+ # Check whether --enable-libtool-lock was given.
+@@ -7113,6 +7493,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -7676,6 +8173,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7871,7 +8370,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -7960,7 +8460,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8258,8 +8758,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8425,6 +8923,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8487,7 +8991,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -8544,13 +9048,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8611,6 +9119,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8961,7 +9474,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -9009,7 +9523,7 @@ _LT_EOF
+       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ 	 && test "$tmp_diet" = no
+       then
+-	tmp_addflag=
++	tmp_addflag=' $pic_flag'
+ 	tmp_sharedflag='-shared'
+ 	case $cc_basename,$host_cpu in
+         pgcc*)				# Portland Group C compiler
+@@ -9060,12 +9574,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -9079,8 +9593,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -9098,8 +9612,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9145,8 +9659,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9276,7 +9790,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9289,22 +9809,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9316,7 +9843,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9329,22 +9862,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9389,20 +9929,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9463,7 +10046,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9471,7 +10054,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9487,7 +10070,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -9511,10 +10094,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -9593,23 +10176,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9694,7 +10290,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -9713,9 +10309,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -10291,8 +10887,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10325,13 +10922,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10423,7 +11078,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -11263,10 +11918,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11369,10 +12024,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -15373,13 +16028,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -15394,14 +16056,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -15434,12 +16099,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -15494,8 +16159,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -15505,12 +16175,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -15526,7 +16198,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -15562,6 +16233,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -16319,7 +16991,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -16422,19 +17095,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -16464,6 +17160,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -16473,6 +17175,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -16587,12 +17292,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -16679,9 +17384,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -16697,6 +17399,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -16729,210 +17434,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+diff --git a/configure b/configure
+index e9f2f13..cbccb18 100755
+--- a/configure
++++ b/configure
+@@ -8041,7 +8041,7 @@ case " $build_configdirs " in
+     # For an installed makeinfo, we require it to be from texinfo 4.7 or
+     # higher, else we use the "missing" dummy.
+     if ${MAKEINFO} --version \
+-       | egrep 'texinfo[^0-9]*(4\.([7-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
++       | egrep 'texinfo[^0-9]*([1-3][0-9]|4.[4-9]|4.[1-9][0-9]+|[5-9])' >/dev/null 2>&1; then
+       :
+     else
+       MAKEINFO="$MISSING makeinfo"
+diff --git a/gas/configure b/gas/configure
+index e9ba550..074886f 100755
+--- a/gas/configure
++++ b/gas/configure
+@@ -645,8 +645,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -757,6 +760,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1422,6 +1426,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+   --with-zlib             include zlib support (auto/yes/no) default=auto
+ 
+ Some influential environment variables:
+@@ -4901,8 +4907,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -4942,7 +4948,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5628,8 +5634,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -5678,6 +5684,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5694,6 +5774,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -5862,7 +5947,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -6016,6 +6102,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6031,9 +6132,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6049,7 +6303,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6069,11 +6323,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6089,7 +6347,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6108,6 +6366,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6119,12 +6381,10 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
+ 
+ 
+ 
+@@ -6136,6 +6396,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}strip; ac_word=$2
+@@ -6470,8 +6788,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6507,6 +6825,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -6548,6 +6867,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6559,7 +6890,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -6585,8 +6916,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6596,8 +6927,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -6634,6 +6965,21 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
++
++
+ 
+ 
+ 
+@@ -6652,6 +6998,40 @@ fi
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
+ 
+ 
+ 
+@@ -6861,6 +7241,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -7424,6 +7921,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7619,7 +8118,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -7708,7 +8208,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8006,8 +8506,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8173,6 +8671,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8235,7 +8739,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -8292,13 +8796,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8359,6 +8867,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8709,7 +9222,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8757,7 +9271,7 @@ _LT_EOF
+       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ 	 && test "$tmp_diet" = no
+       then
+-	tmp_addflag=
++	tmp_addflag=' $pic_flag'
+ 	tmp_sharedflag='-shared'
+ 	case $cc_basename,$host_cpu in
+         pgcc*)				# Portland Group C compiler
+@@ -8808,12 +9322,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -8827,8 +9341,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -8846,8 +9360,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -8893,8 +9407,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9024,7 +9538,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9037,22 +9557,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9064,7 +9591,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9077,22 +9610,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9137,20 +9677,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9211,7 +9794,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9219,7 +9802,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9235,7 +9818,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -9259,10 +9842,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -9341,23 +9924,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9442,7 +10038,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -9461,9 +10057,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -10039,8 +10635,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10073,13 +10670,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10171,7 +10826,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -11011,10 +11666,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11117,10 +11772,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -15274,13 +15929,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -15295,14 +15957,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -15335,12 +16000,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -15395,8 +16060,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -15406,12 +16076,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -15427,7 +16099,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -15463,6 +16134,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -16227,7 +16899,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -16330,19 +17003,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -16372,6 +17068,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -16381,6 +17083,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -16495,12 +17200,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -16587,9 +17292,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -16605,6 +17307,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -16637,210 +17342,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+diff --git a/gprof/configure b/gprof/configure
+index 79961c5..c4f6ac9 100755
+--- a/gprof/configure
++++ b/gprof/configure
+@@ -629,8 +629,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -741,6 +744,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1399,6 +1403,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+ 
+ Some influential environment variables:
+   CC          C compiler command
+@@ -4831,8 +4837,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -4872,7 +4878,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5558,8 +5564,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -5608,6 +5614,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5624,6 +5704,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -5792,7 +5877,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -5869,11 +5955,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+-linux-uclibc*)
+-  lt_cv_deplibs_check_method=pass_all
+-  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+-  ;;
+-
+ netbsd*)
+   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+     lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+@@ -5951,6 +6032,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -5966,9 +6062,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -5984,7 +6233,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6004,11 +6253,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6024,7 +6277,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6043,6 +6296,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6054,12 +6311,10 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
+ 
+ 
+ 
+@@ -6071,6 +6326,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+ set dummy ${ac_tool_prefix}strip; ac_word=$2
+@@ -6405,8 +6718,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6442,6 +6755,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -6483,6 +6797,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6494,7 +6820,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -6520,8 +6846,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6531,8 +6857,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -6569,6 +6895,18 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
++
++
+ 
+ 
+ 
+@@ -6590,6 +6928,43 @@ fi
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
++
++
++
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+   enableval=$enable_libtool_lock;
+@@ -6796,6 +7171,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -7359,6 +7851,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7554,7 +8048,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -7643,7 +8138,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -7941,8 +8436,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8108,6 +8601,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8170,7 +8669,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -8227,13 +8726,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8294,6 +8797,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8644,7 +9152,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8692,7 +9201,7 @@ _LT_EOF
+       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ 	 && test "$tmp_diet" = no
+       then
+-	tmp_addflag=
++	tmp_addflag=' $pic_flag'
+ 	tmp_sharedflag='-shared'
+ 	case $cc_basename,$host_cpu in
+         pgcc*)				# Portland Group C compiler
+@@ -8743,12 +9252,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -8762,8 +9271,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -8781,8 +9290,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -8828,8 +9337,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -8959,7 +9468,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -8972,22 +9487,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -8999,7 +9521,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9012,22 +9540,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9072,20 +9607,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9146,7 +9724,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9154,7 +9732,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9170,7 +9748,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -9194,10 +9772,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -9276,23 +9854,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9377,7 +9968,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -9396,9 +9987,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -9974,8 +10565,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10008,13 +10600,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10106,7 +10756,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -10946,10 +11596,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11052,10 +11702,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -12924,13 +13574,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -12945,14 +13602,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -12985,12 +13645,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -13045,8 +13705,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -13056,12 +13721,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -13077,7 +13744,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -13113,6 +13779,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -13869,7 +14536,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -13972,19 +14640,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -14014,6 +14705,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -14023,6 +14720,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -14137,12 +14837,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -14229,9 +14929,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -14247,6 +14944,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -14279,210 +14979,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+diff --git a/ld/configure b/ld/configure
+index 4408b0d..2fbaebf 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -654,8 +654,11 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
+ RANLIB
++ac_ct_AR
+ AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -776,6 +779,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_plugins
+ enable_largefile
+@@ -1453,6 +1457,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+   --with-lib-path=dir1:dir2...  set default LIB_PATH
+   --with-sysroot=DIR Search for usr/lib et al within DIR.
+   --with-zlib             include zlib support (auto/yes/no) default=auto
+@@ -5645,8 +5651,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -5686,7 +5692,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -6372,8 +6378,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -6422,6 +6428,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -6438,6 +6518,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6606,7 +6691,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -6760,6 +6846,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6775,9 +6876,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6793,7 +7047,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6813,11 +7067,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6833,7 +7091,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6852,6 +7110,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6863,12 +7125,12 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
+ 
+ 
+ 
+@@ -6878,6 +7140,62 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
++
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
++
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
++
++
++
++
++
+ 
+ 
+ if test -n "$ac_tool_prefix"; then
+@@ -7214,8 +7532,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -7251,6 +7569,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -7292,6 +7611,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -7303,7 +7634,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -7329,8 +7660,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -7340,8 +7671,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -7378,6 +7709,19 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
++
++
++
+ 
+ 
+ 
+@@ -7398,6 +7742,42 @@ fi
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
++
++
+ 
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+@@ -7605,6 +7985,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -8168,6 +8665,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -8236,6 +8735,16 @@ done
+ 
+ 
+ 
++func_stripname_cnf ()
++{
++  case ${2} in
++  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++  esac
++} # func_stripname_cnf
++
++
++
+ 
+ 
+ # Set options
+@@ -8364,7 +8873,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -8453,7 +8963,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8751,8 +9261,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8918,6 +9426,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8980,7 +9494,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -9037,13 +9551,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -9104,6 +9622,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -9454,7 +9977,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -9502,7 +10026,7 @@ _LT_EOF
+       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ 	 && test "$tmp_diet" = no
+       then
+-	tmp_addflag=
++	tmp_addflag=' $pic_flag'
+ 	tmp_sharedflag='-shared'
+ 	case $cc_basename,$host_cpu in
+         pgcc*)				# Portland Group C compiler
+@@ -9553,12 +10077,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -9572,8 +10096,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -9591,8 +10115,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9638,8 +10162,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9769,7 +10293,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9782,22 +10312,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9809,7 +10346,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9822,22 +10365,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9881,21 +10431,64 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # When not using gcc, we currently assume that we are using
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+-      # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      # no search path for DLLs.
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9956,7 +10549,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9964,7 +10557,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9980,7 +10573,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -10004,10 +10597,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -10086,23 +10679,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -10187,7 +10793,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -10206,9 +10812,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -10784,8 +11390,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10818,13 +11425,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10916,7 +11581,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -11712,7 +12377,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 11715 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -11756,10 +12421,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11818,7 +12483,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 11821 "configure"
++#line $LINENO "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -11862,10 +12527,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -12257,6 +12922,7 @@ $RM -r conftest*
+ 
+   # Allow CC to be a program name with arguments.
+   lt_save_CC=$CC
++  lt_save_CFLAGS=$CFLAGS
+   lt_save_LD=$LD
+   lt_save_GCC=$GCC
+   GCC=$GXX
+@@ -12274,6 +12940,7 @@ $RM -r conftest*
+   fi
+   test -z "${LDCXX+set}" || LD=$LDCXX
+   CC=${CXX-"c++"}
++  CFLAGS=$CXXFLAGS
+   compiler=$CC
+   compiler_CXX=$CC
+   for cc_temp in $compiler""; do
+@@ -12413,8 +13080,8 @@ with_gnu_ld=$lt_cv_prog_gnu_ld
+       # Check if GNU C++ uses GNU ld as the underlying linker, since the
+       # archiving commands below assume that GNU ld is being used.
+       if test "$with_gnu_ld" = yes; then
+-        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-        archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
++        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ 
+         hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+         export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+@@ -12556,7 +13223,13 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
+           allow_undefined_flag_CXX='-berok'
+           # Determine the default libpath from the value encoded in an empty
+           # executable.
+-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++          if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath__CXX+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -12569,22 +13242,29 @@ main ()
+ _ACEOF
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath__CXX"; then
++    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath__CXX"; then
++    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath__CXX
++fi
+ 
+           hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 
+@@ -12597,7 +13277,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+           else
+ 	    # Determine the default libpath from the value encoded in an
+ 	    # empty executable.
+-	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	    if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath__CXX+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -12610,22 +13296,29 @@ main ()
+ _ACEOF
+ if ac_fn_cxx_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath__CXX"; then
++    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath__CXX"; then
++    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath__CXX
++fi
+ 
+ 	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	    # Warning - without using the other run time loading flags,
+@@ -12668,29 +13361,75 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+         ;;
+ 
+       cygwin* | mingw* | pw32* | cegcc*)
+-        # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+-        # as there is no search path for DLLs.
+-        hardcode_libdir_flag_spec_CXX='-L$libdir'
+-        export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+-        allow_undefined_flag_CXX=unsupported
+-        always_export_symbols_CXX=no
+-        enable_shared_with_static_runtimes_CXX=yes
+-
+-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+-          archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-          # If the export-symbols file already is a .def file (1st line
+-          # is EXPORTS), use it as is; otherwise, prepend...
+-          archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+-	    cp $export_symbols $output_objdir/$soname.def;
+-          else
+-	    echo EXPORTS > $output_objdir/$soname.def;
+-	    cat $export_symbols >> $output_objdir/$soname.def;
+-          fi~
+-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-        else
+-          ld_shlibs_CXX=no
+-        fi
+-        ;;
++	case $GXX,$cc_basename in
++	,cl* | no,cl*)
++	  # Native MSVC
++	  # hardcode_libdir_flag_spec is actually meaningless, as there is
++	  # no search path for DLLs.
++	  hardcode_libdir_flag_spec_CXX=' '
++	  allow_undefined_flag_CXX=unsupported
++	  always_export_symbols_CXX=yes
++	  file_list_spec_CXX='@'
++	  # Tell ltmain to make .lib files, not .a files.
++	  libext=lib
++	  # Tell ltmain to make .dll files, not .so files.
++	  shrext_cmds=".dll"
++	  # FIXME: Setting linknames here is a bad hack.
++	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	  archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	    else
++	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	    fi~
++	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	    linknames='
++	  # The linker will not automatically build a static lib if we build a DLL.
++	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
++	  enable_shared_with_static_runtimes_CXX=yes
++	  # Don't use ranlib
++	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
++	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
++	    lt_tool_outputfile="@TOOL_OUTPUT@"~
++	    case $lt_outputfile in
++	      *.exe|*.EXE) ;;
++	      *)
++		lt_outputfile="$lt_outputfile.exe"
++		lt_tool_outputfile="$lt_tool_outputfile.exe"
++		;;
++	    esac~
++	    func_to_tool_file "$lt_outputfile"~
++	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	      $RM "$lt_outputfile.manifest";
++	    fi'
++	  ;;
++	*)
++	  # g++
++	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
++	  # as there is no search path for DLLs.
++	  hardcode_libdir_flag_spec_CXX='-L$libdir'
++	  export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
++	  allow_undefined_flag_CXX=unsupported
++	  always_export_symbols_CXX=no
++	  enable_shared_with_static_runtimes_CXX=yes
++
++	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
++	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	    # If the export-symbols file already is a .def file (1st line
++	    # is EXPORTS), use it as is; otherwise, prepend...
++	    archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	      cp $export_symbols $output_objdir/$soname.def;
++	    else
++	      echo EXPORTS > $output_objdir/$soname.def;
++	      cat $export_symbols >> $output_objdir/$soname.def;
++	    fi~
++	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	  else
++	    ld_shlibs_CXX=no
++	  fi
++	  ;;
++	esac
++	;;
+       darwin* | rhapsody*)
+ 
+ 
+@@ -12796,7 +13535,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+             ;;
+           *)
+             if test "$GXX" = yes; then
+-              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+             else
+               # FIXME: insert proper C++ library support
+               ld_shlibs_CXX=no
+@@ -12867,10 +13606,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	          ia64*)
+-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	          *)
+-	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	        esac
+ 	      fi
+@@ -12911,9 +13650,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+           *)
+ 	    if test "$GXX" = yes; then
+ 	      if test "$with_gnu_ld" = no; then
+-	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	      else
+-	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
++	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ 	      fi
+ 	    fi
+ 	    link_all_deplibs_CXX=yes
+@@ -12983,20 +13722,20 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	      prelink_cmds_CXX='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
++		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ 	      old_archive_cmds_CXX='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
++		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ 		$RANLIB $oldlib'
+ 	      archive_cmds_CXX='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
++		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ 	      archive_expsym_cmds_CXX='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
++		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ 	      ;;
+ 	    *) # Version 6 and above use weak symbols
+ 	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+@@ -13191,7 +13930,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 		  ;;
+ 	        *)
+-	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 		  ;;
+ 	      esac
+ 
+@@ -13237,7 +13976,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+       solaris*)
+         case $cc_basename in
+-          CC*)
++          CC* | sunCC*)
+ 	    # Sun C++ 4.2, 5.x and Centerline C++
+             archive_cmds_need_lc_CXX=yes
+ 	    no_undefined_flag_CXX=' -zdefs'
+@@ -13278,9 +14017,9 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ 	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+-	        archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ 	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
++		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+ 
+ 	        # Commands to make compiler produce verbose output that lists
+ 	        # what "hidden" libraries, object files and flags are used when
+@@ -13415,6 +14154,13 @@ private:
+ };
+ _LT_EOF
+ 
++
++_lt_libdeps_save_CFLAGS=$CFLAGS
++case "$CC $CFLAGS " in #(
++*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
++*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
++esac
++
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+   (eval $ac_compile) 2>&5
+   ac_status=$?
+@@ -13428,7 +14174,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+   pre_test_object_deps_done=no
+ 
+   for p in `eval "$output_verbose_link_cmd"`; do
+-    case $p in
++    case ${prev}${p} in
+ 
+     -L* | -R* | -l*)
+        # Some compilers place space between "-{L,R}" and the path.
+@@ -13437,13 +14183,22 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+           test $p = "-R"; then
+ 	 prev=$p
+ 	 continue
+-       else
+-	 prev=
+        fi
+ 
++       # Expand the sysroot to ease extracting the directories later.
++       if test -z "$prev"; then
++         case $p in
++         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
++         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
++         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
++         esac
++       fi
++       case $p in
++       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
++       esac
+        if test "$pre_test_object_deps_done" = no; then
+-	 case $p in
+-	 -L* | -R*)
++	 case ${prev} in
++	 -L | -R)
+ 	   # Internal compiler library paths should come after those
+ 	   # provided the user.  The postdeps already come after the
+ 	   # user supplied libs so there is no need to process them.
+@@ -13463,8 +14218,10 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ 	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ 	 fi
+        fi
++       prev=
+        ;;
+ 
++    *.lto.$objext) ;; # Ignore GCC LTO objects
+     *.$objext)
+        # This assumes that the test object file only shows up
+        # once in the compiler output.
+@@ -13500,6 +14257,7 @@ else
+ fi
+ 
+ $RM -f confest.$objext
++CFLAGS=$_lt_libdeps_save_CFLAGS
+ 
+ # PORTME: override above test on systems where it is broken
+ case $host_os in
+@@ -13535,7 +14293,7 @@ linux*)
+ 
+ solaris*)
+   case $cc_basename in
+-  CC*)
++  CC* | sunCC*)
+     # The more standards-conforming stlport4 library is
+     # incompatible with the Cstd library. Avoid specifying
+     # it if it's in CXXFLAGS. Ignore libCrun as
+@@ -13600,8 +14358,6 @@ fi
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   # C++ specific cases for pic, static, wl, etc.
+   if test "$GXX" = yes; then
+@@ -13706,6 +14462,11 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	  ;;
+ 	esac
+ 	;;
++      mingw* | cygwin* | os2* | pw32* | cegcc*)
++	# This hack is so that the source file can tell whether it is being
++	# built for inclusion in a dll (and should export symbols for example).
++	lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
++	;;
+       dgux*)
+ 	case $cc_basename in
+ 	  ec++*)
+@@ -13858,7 +14619,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	;;
+       solaris*)
+ 	case $cc_basename in
+-	  CC*)
++	  CC* | sunCC*)
+ 	    # Sun C++ 4.2, 5.x and Centerline C++
+ 	    lt_prog_compiler_pic_CXX='-KPIC'
+ 	    lt_prog_compiler_static_CXX='-Bstatic'
+@@ -13923,10 +14684,17 @@ case $host_os in
+     lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5
+-$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic_CXX+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
++$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
++lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -13984,6 +14752,8 @@ fi
+ 
+ 
+ 
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -14161,6 +14931,7 @@ fi
+ $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+ 
+   export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+   case $host_os in
+   aix[4-9]*)
+     # If we're using GNU nm, then we don't want the "-C" option.
+@@ -14175,15 +14946,20 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
+     ;;
+   pw32*)
+     export_symbols_cmds_CXX="$ltdll_cmds"
+-  ;;
++    ;;
+   cygwin* | mingw* | cegcc*)
+-    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+-  ;;
++    case $cc_basename in
++    cl*) ;;
++    *)
++      export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
++      ;;
++    esac
++    ;;
+   *)
+     export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+-  ;;
++    ;;
+   esac
+-  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+ 
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+ $as_echo "$ld_shlibs_CXX" >&6; }
+@@ -14446,8 +15222,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -14479,13 +15256,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -14576,7 +15411,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -15035,6 +15870,7 @@ fi
+   fi # test -n "$compiler"
+ 
+   CC=$lt_save_CC
++  CFLAGS=$lt_save_CFLAGS
+   LDCXX=$LD
+   LD=$lt_save_LD
+   GCC=$lt_save_GCC
+@@ -17807,13 +18643,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -17828,14 +18671,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -17868,12 +18714,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -17912,8 +18758,8 @@ old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote
+ compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+ GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+ archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+@@ -17940,12 +18786,12 @@ hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_
+ hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path_CXX='`$ECHO "$fix_srcfile_path_CXX" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+ include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
++postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+ file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+ hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+ compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+@@ -17983,8 +18829,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -17994,12 +18845,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -18015,7 +18868,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -18037,8 +18889,8 @@ LD_CXX \
+ reload_flag_CXX \
+ compiler_CXX \
+ lt_prog_compiler_no_builtin_flag_CXX \
+-lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_pic_CXX \
++lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_static_CXX \
+ lt_cv_prog_compiler_c_o_CXX \
+ export_dynamic_flag_spec_CXX \
+@@ -18050,7 +18902,6 @@ no_undefined_flag_CXX \
+ hardcode_libdir_flag_spec_CXX \
+ hardcode_libdir_flag_spec_ld_CXX \
+ hardcode_libdir_separator_CXX \
+-fix_srcfile_path_CXX \
+ exclude_expsyms_CXX \
+ include_expsyms_CXX \
+ file_list_spec_CXX \
+@@ -18084,6 +18935,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -18098,7 +18950,8 @@ archive_expsym_cmds_CXX \
+ module_cmds_CXX \
+ module_expsym_cmds_CXX \
+ export_symbols_cmds_CXX \
+-prelink_cmds_CXX; do
++prelink_cmds_CXX \
++postlink_cmds_CXX; do
+     case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+     *[\\\\\\\`\\"\\\$]*)
+       eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+@@ -18891,7 +19744,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -18994,19 +19848,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -19036,6 +19913,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -19045,6 +19928,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -19159,12 +20045,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -19251,9 +20137,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -19269,6 +20152,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -19315,210 +20201,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+@@ -19546,12 +20391,12 @@ with_gcc=$GCC_CXX
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl_CXX
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic_CXX
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl_CXX
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static_CXX
+ 
+@@ -19638,9 +20483,6 @@ inherit_rpath=$inherit_rpath_CXX
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs_CXX
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path_CXX
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols_CXX
+ 
+@@ -19656,6 +20498,9 @@ include_expsyms=$lt_include_expsyms_CXX
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds_CXX
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds_CXX
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec_CXX
+ 
+diff --git a/libtool.m4 b/libtool.m4
+index 797468f..02b15b3 100644
+--- a/libtool.m4
++++ b/libtool.m4
+@@ -1,7 +1,8 @@
+ # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ # This file is free software; the Free Software Foundation gives
+@@ -10,7 +11,8 @@
+ 
+ m4_define([_LT_COPYING], [dnl
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -37,7 +39,7 @@ m4_define([_LT_COPYING], [dnl
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ ])
+ 
+-# serial 56 LT_INIT
++# serial 57 LT_INIT
+ 
+ 
+ # LT_PREREQ(VERSION)
+@@ -92,7 +94,8 @@ _LT_SET_OPTIONS([$0], [$1])
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ AC_SUBST(LIBTOOL)dnl
+ 
+ _LT_SETUP
+@@ -166,10 +169,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+ dnl
+ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_CHECK_SHELL_FEATURES])dnl
++m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+ m4_require([_LT_CMD_RELOAD])dnl
+ m4_require([_LT_CHECK_MAGIC_METHOD])dnl
++m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+ m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+ m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
++m4_require([_LT_WITH_SYSROOT])dnl
+ 
+ _LT_CONFIG_LIBTOOL_INIT([
+ # See if we are running on zsh, and set the options which allow our
+@@ -199,7 +205,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -632,7 +638,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+ m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+ configured by $[0], generated by m4_PACKAGE_STRING.
+ 
+-Copyright (C) 2009 Free Software Foundation, Inc.
++Copyright (C) 2010 Free Software Foundation, Inc.
+ This config.lt script is free software; the Free Software Foundation
+ gives unlimited permision to copy, distribute and modify it."
+ 
+@@ -746,15 +752,12 @@ _LT_EOF
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
+ 
+-  _LT_PROG_XSI_SHELLFNS
++  _LT_PROG_REPLACE_SHELLFNS
+ 
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ ],
+@@ -980,6 +983,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+       echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+       $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
++      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
++      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -1069,30 +1074,41 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
+   fi
+ ])
+ 
+-# _LT_SYS_MODULE_PATH_AIX
+-# -----------------------
++# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
++# ----------------------------------
+ # Links a minimal program and checks the executable
+ # for the system default hardcoded library path. In most cases,
+ # this is /usr/lib:/lib, but when the MPI compilers are used
+ # the location of the communication and MPI libs are included too.
+ # If we don't find anything, use the default library path according
+ # to the aix ld manual.
++# Store the results from the different compilers for each TAGNAME.
++# Allow to override them for all tags through lt_cv_aix_libpath.
+ m4_defun([_LT_SYS_MODULE_PATH_AIX],
+ [m4_require([_LT_DECL_SED])dnl
+-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi],[])
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
++  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
++  lt_aix_libpath_sed='[
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }]'
++  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
++    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi],[])
++  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
++    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
++  fi
++  ])
++  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
++fi
+ ])# _LT_SYS_MODULE_PATH_AIX
+ 
+ 
+@@ -1117,7 +1133,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ 
+ AC_MSG_CHECKING([how to print strings])
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -1161,6 +1177,39 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+ ])# _LT_PROG_ECHO_BACKSLASH
+ 
+ 
++# _LT_WITH_SYSROOT
++# ----------------
++AC_DEFUN([_LT_WITH_SYSROOT],
++[AC_MSG_CHECKING([for sysroot])
++AC_ARG_WITH([libtool-sysroot],
++[  --with-libtool-sysroot[=DIR] Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).],
++[], [with_libtool_sysroot=no])
++
++dnl lt_sysroot will always be passed unquoted.  We quote it here
++dnl in case the user passed a directory name.
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   AC_MSG_RESULT([${with_libtool_sysroot}])
++   AC_MSG_ERROR([The sysroot must be an absolute path.])
++   ;;
++esac
++
++ AC_MSG_RESULT([${lt_sysroot:-no}])
++_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
++[dependent libraries, and in which our libraries should be installed.])])
++
+ # _LT_ENABLE_LOCK
+ # ---------------
+ m4_defun([_LT_ENABLE_LOCK],
+@@ -1320,14 +1369,47 @@ need_locks="$enable_libtool_lock"
+ ])# _LT_ENABLE_LOCK
+ 
+ 
++# _LT_PROG_AR
++# -----------
++m4_defun([_LT_PROG_AR],
++[AC_CHECK_TOOLS(AR, [ar], false)
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++_LT_DECL([], [AR], [1], [The archiver])
++_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
++
++AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
++  [lt_cv_ar_at_file=no
++   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
++     [echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
++      AC_TRY_EVAL([lt_ar_try])
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	AC_TRY_EVAL([lt_ar_try])
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
++     ])
++  ])
++
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
++_LT_DECL([], [archiver_list_spec], [1],
++  [How to feed a file listing to the archiver])
++])# _LT_PROG_AR
++
++
+ # _LT_CMD_OLD_ARCHIVE
+ # -------------------
+ m4_defun([_LT_CMD_OLD_ARCHIVE],
+-[AC_CHECK_TOOL(AR, ar, false)
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
+-_LT_DECL([], [AR], [1], [The archiver])
+-_LT_DECL([], [AR_FLAGS], [1])
++[_LT_PROG_AR
+ 
+ AC_CHECK_TOOL(STRIP, strip, :)
+ test -z "$STRIP" && STRIP=:
+@@ -1623,7 +1705,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-[#line __oline__ "configure"
++[#line $LINENO "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -1667,10 +1749,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -2210,8 +2292,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -2244,13 +2327,71 @@ m4_if([$1], [],[
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -2342,7 +2483,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -2950,6 +3091,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -3016,7 +3162,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -3167,6 +3314,21 @@ tpf*)
+   ;;
+ esac
+ ])
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -3174,7 +3336,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ _LT_DECL([], [deplibs_check_method], [1],
+     [Method to check whether dependent libraries are shared objects])
+ _LT_DECL([], [file_magic_cmd], [1],
+-    [Command to use when deplibs_check_method == "file_magic"])
++    [Command to use when deplibs_check_method = "file_magic"])
++_LT_DECL([], [file_magic_glob], [1],
++    [How to find potential files when deplibs_check_method = "file_magic"])
++_LT_DECL([], [want_nocaseglob], [1],
++    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+ ])# _LT_CHECK_MAGIC_METHOD
+ 
+ 
+@@ -3277,6 +3443,67 @@ dnl aclocal-1.4 backwards compatibility:
+ dnl AC_DEFUN([AM_PROG_NM], [])
+ dnl AC_DEFUN([AC_PROG_NM], [])
+ 
++# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
++# --------------------------------
++# how to determine the name of the shared library
++# associated with a specific link library.
++#  -- PORTME fill in with the dynamic library characteristics
++m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
++[m4_require([_LT_DECL_EGREP])
++m4_require([_LT_DECL_OBJDUMP])
++m4_require([_LT_DECL_DLLTOOL])
++AC_CACHE_CHECK([how to associate runtime and link libraries],
++lt_cv_sharedlib_from_linklib_cmd,
++[lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++])
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
++    [Command to associate shared and link libraries])
++])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
++
++
++# _LT_PATH_MANIFEST_TOOL
++# ----------------------
++# locate the manifest tool
++m4_defun([_LT_PATH_MANIFEST_TOOL],
++[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
++  [lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&AS_MESSAGE_LOG_FD
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*])
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
++])# _LT_PATH_MANIFEST_TOOL
++
+ 
+ # LT_LIB_M
+ # --------
+@@ -3403,8 +3630,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -3440,6 +3667,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -3473,6 +3701,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT@&t@_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT@&t@_DLSYM_CONST
++#else
++# define LT@&t@_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -3484,7 +3724,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT@&t@_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -3510,15 +3750,15 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ 	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ 	fi
+@@ -3551,6 +3791,13 @@ else
+   AC_MSG_RESULT(ok)
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
+ _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+     [Take the output of nm and produce a listing of raw symbols and C names])
+ _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+@@ -3561,6 +3808,8 @@ _LT_DECL([global_symbol_to_c_name_address],
+ _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+     [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+     [Transform the output of nm in a C name address pair when lib prefix is needed])
++_LT_DECL([], [nm_file_list_spec], [1],
++    [Specify filename containing input files for $NM])
+ ]) # _LT_CMD_GLOBAL_SYMBOLS
+ 
+ 
+@@ -3572,7 +3821,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)=
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_TAGVAR(lt_prog_compiler_static, $1)=
+ 
+-AC_MSG_CHECKING([for $compiler option to produce PIC])
+ m4_if([$1], [CXX], [
+   # C++ specific cases for pic, static, wl, etc.
+   if test "$GXX" = yes; then
+@@ -3678,6 +3926,12 @@ m4_if([$1], [CXX], [
+ 	  ;;
+ 	esac
+ 	;;
++      mingw* | cygwin* | os2* | pw32* | cegcc*)
++	# This hack is so that the source file can tell whether it is being
++	# built for inclusion in a dll (and should export symbols for example).
++	m4_if([$1], [GCJ], [],
++	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
++	;;
+       dgux*)
+ 	case $cc_basename in
+ 	  ec++*)
+@@ -3830,7 +4084,7 @@ m4_if([$1], [CXX], [
+ 	;;
+       solaris*)
+ 	case $cc_basename in
+-	  CC*)
++	  CC* | sunCC*)
+ 	    # Sun C++ 4.2, 5.x and Centerline C++
+ 	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ 	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+@@ -4053,6 +4307,12 @@ m4_if([$1], [CXX], [
+ 	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+ 	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
++	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
++	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -4115,7 +4375,7 @@ m4_if([$1], [CXX], [
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+       *)
+ 	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+@@ -4172,9 +4432,11 @@ case $host_os in
+     _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+     ;;
+ esac
+-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+-	[How to pass a linker flag through the compiler])
++
++AC_CACHE_CHECK([for $compiler option to produce PIC],
++  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
++  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
++_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -4193,6 +4455,8 @@ fi
+ _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+ 	[Additional compiler flags for building library objects])
+ 
++_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
++	[How to pass a linker flag through the compiler])
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -4213,6 +4477,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+ m4_defun([_LT_LINKER_SHLIBS],
+ [AC_REQUIRE([LT_PATH_LD])dnl
+ AC_REQUIRE([LT_PATH_NM])dnl
++m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+ m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_DECL_EGREP])dnl
+ m4_require([_LT_DECL_SED])dnl
+@@ -4221,6 +4486,7 @@ m4_require([_LT_TAG_COMPILER])dnl
+ AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ m4_if([$1], [CXX], [
+   _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
++  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+   case $host_os in
+   aix[[4-9]]*)
+     # If we're using GNU nm, then we don't want the "-C" option.
+@@ -4235,15 +4501,20 @@ m4_if([$1], [CXX], [
+     ;;
+   pw32*)
+     _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+-  ;;
++    ;;
+   cygwin* | mingw* | cegcc*)
+-    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+-  ;;
++    case $cc_basename in
++    cl*) ;;
++    *)
++      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
++      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
++      ;;
++    esac
++    ;;
+   *)
+     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+-  ;;
++    ;;
+   esac
+-  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+ ], [
+   runpath_var=
+   _LT_TAGVAR(allow_undefined_flag, $1)=
+@@ -4411,7 +4682,8 @@ _LT_EOF
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       _LT_TAGVAR(always_export_symbols, $1)=no
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
++      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
++      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -4459,7 +4731,7 @@ _LT_EOF
+       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ 	 && test "$tmp_diet" = no
+       then
+-	tmp_addflag=
++	tmp_addflag=' $pic_flag'
+ 	tmp_sharedflag='-shared'
+ 	case $cc_basename,$host_cpu in
+         pgcc*)				# Portland Group C compiler
+@@ -4510,12 +4782,12 @@ _LT_EOF
+ 	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+ 	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ 	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+-	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -4529,8 +4801,8 @@ _LT_EOF
+ 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -4548,8 +4820,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	_LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+@@ -4595,8 +4867,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	_LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+@@ -4726,7 +4998,7 @@ _LT_EOF
+ 	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        _LT_SYS_MODULE_PATH_AIX
++        _LT_SYS_MODULE_PATH_AIX([$1])
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+@@ -4737,7 +5009,7 @@ _LT_EOF
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 _LT_SYS_MODULE_PATH_AIX
++	 _LT_SYS_MODULE_PATH_AIX([$1])
+ 	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+ 	  # -berok will link without error, but may produce a broken library.
+@@ -4781,20 +5053,63 @@ _LT_EOF
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+-      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+-      # FIXME: Should let the user specify the lib program.
+-      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+-      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	_LT_TAGVAR(always_export_symbols, $1)=yes
++	_LT_TAGVAR(file_list_spec, $1)='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
++	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++	# FIXME: Should let the user specify the lib program.
++	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -4828,7 +5143,7 @@ _LT_EOF
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+@@ -4836,7 +5151,7 @@ _LT_EOF
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -4852,7 +5167,7 @@ _LT_EOF
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -4876,10 +5191,10 @@ _LT_EOF
+ 	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -4926,16 +5241,31 @@ _LT_EOF
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        AC_LINK_IFELSE(int foo(void) {},
+-          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-        )
+-        LDFLAGS="$save_LDFLAGS"
++	# This should be the same for all languages, so no per-tag cache variable.
++	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
++	  [lt_cv_irix_exported_symbol],
++	  [save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   AC_LINK_IFELSE(
++	     [AC_LANG_SOURCE(
++	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
++			      [C++], [[int foo (void) { return 0; }]],
++			      [Fortran 77], [[
++      subroutine foo
++      end]],
++			      [Fortran], [[
++      subroutine foo
++      end]])])],
++	      [lt_cv_irix_exported_symbol=yes],
++	      [lt_cv_irix_exported_symbol=no])
++           LDFLAGS="$save_LDFLAGS"])
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -5020,7 +5350,7 @@ _LT_EOF
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+       else
+ 	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+@@ -5039,9 +5369,9 @@ _LT_EOF
+       _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -5313,8 +5643,6 @@ _LT_TAGDECL([], [inherit_rpath], [0],
+     to runtime path list])
+ _LT_TAGDECL([], [link_all_deplibs], [0],
+     [Whether libtool must link a program against all its dependency libraries])
+-_LT_TAGDECL([], [fix_srcfile_path], [1],
+-    [Fix the shell variable $srcfile for the compiler])
+ _LT_TAGDECL([], [always_export_symbols], [0],
+     [Set to "yes" if exported symbols are required])
+ _LT_TAGDECL([], [export_symbols_cmds], [2],
+@@ -5325,6 +5653,8 @@ _LT_TAGDECL([], [include_expsyms], [1],
+     [Symbols that must always be exported])
+ _LT_TAGDECL([], [prelink_cmds], [2],
+     [Commands necessary for linking programs (against libraries) with templates])
++_LT_TAGDECL([], [postlink_cmds], [2],
++    [Commands necessary for finishing linking programs])
+ _LT_TAGDECL([], [file_list_spec], [1],
+     [Specify filename containing input files])
+ dnl FIXME: Not yet implemented
+@@ -5426,6 +5756,7 @@ CC="$lt_save_CC"
+ m4_defun([_LT_LANG_CXX_CONFIG],
+ [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+ m4_require([_LT_DECL_EGREP])dnl
++m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+     ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+     (test "X$CXX" != "Xg++"))) ; then
+@@ -5487,6 +5818,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 
+   # Allow CC to be a program name with arguments.
+   lt_save_CC=$CC
++  lt_save_CFLAGS=$CFLAGS
+   lt_save_LD=$LD
+   lt_save_GCC=$GCC
+   GCC=$GXX
+@@ -5504,6 +5836,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+   fi
+   test -z "${LDCXX+set}" || LD=$LDCXX
+   CC=${CXX-"c++"}
++  CFLAGS=$CXXFLAGS
+   compiler=$CC
+   _LT_TAGVAR(compiler, $1)=$CC
+   _LT_CC_BASENAME([$compiler])
+@@ -5525,8 +5858,8 @@ if test "$_lt_caught_CXX_error" != yes; then
+       # Check if GNU C++ uses GNU ld as the underlying linker, since the
+       # archiving commands below assume that GNU ld is being used.
+       if test "$with_gnu_ld" = yes; then
+-        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
++        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ 
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+@@ -5667,7 +6000,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+           _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+           # Determine the default libpath from the value encoded in an empty
+           # executable.
+-          _LT_SYS_MODULE_PATH_AIX
++          _LT_SYS_MODULE_PATH_AIX([$1])
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -5679,7 +6012,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+           else
+ 	    # Determine the default libpath from the value encoded in an
+ 	    # empty executable.
+-	    _LT_SYS_MODULE_PATH_AIX
++	    _LT_SYS_MODULE_PATH_AIX([$1])
+ 	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	    # Warning - without using the other run time loading flags,
+ 	    # -berok will link without error, but may produce a broken library.
+@@ -5721,29 +6054,75 @@ if test "$_lt_caught_CXX_error" != yes; then
+         ;;
+ 
+       cygwin* | mingw* | pw32* | cegcc*)
+-        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+-        # as there is no search path for DLLs.
+-        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+-        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+-        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+-        _LT_TAGVAR(always_export_symbols, $1)=no
+-        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+-
+-        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+-          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-          # If the export-symbols file already is a .def file (1st line
+-          # is EXPORTS), use it as is; otherwise, prepend...
+-          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+-	    cp $export_symbols $output_objdir/$soname.def;
+-          else
+-	    echo EXPORTS > $output_objdir/$soname.def;
+-	    cat $export_symbols >> $output_objdir/$soname.def;
+-          fi~
+-          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+-        else
+-          _LT_TAGVAR(ld_shlibs, $1)=no
+-        fi
+-        ;;
++	case $GXX,$cc_basename in
++	,cl* | no,cl*)
++	  # Native MSVC
++	  # hardcode_libdir_flag_spec is actually meaningless, as there is
++	  # no search path for DLLs.
++	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
++	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	  _LT_TAGVAR(always_export_symbols, $1)=yes
++	  _LT_TAGVAR(file_list_spec, $1)='@'
++	  # Tell ltmain to make .lib files, not .a files.
++	  libext=lib
++	  # Tell ltmain to make .dll files, not .so files.
++	  shrext_cmds=".dll"
++	  # FIXME: Setting linknames here is a bad hack.
++	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	    else
++	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	    fi~
++	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	    linknames='
++	  # The linker will not automatically build a static lib if we build a DLL.
++	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
++	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++	  # Don't use ranlib
++	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
++	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
++	    lt_tool_outputfile="@TOOL_OUTPUT@"~
++	    case $lt_outputfile in
++	      *.exe|*.EXE) ;;
++	      *)
++		lt_outputfile="$lt_outputfile.exe"
++		lt_tool_outputfile="$lt_tool_outputfile.exe"
++		;;
++	    esac~
++	    func_to_tool_file "$lt_outputfile"~
++	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	      $RM "$lt_outputfile.manifest";
++	    fi'
++	  ;;
++	*)
++	  # g++
++	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
++	  # as there is no search path for DLLs.
++	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
++	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
++	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
++	  _LT_TAGVAR(always_export_symbols, $1)=no
++	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
++
++	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
++	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	    # If the export-symbols file already is a .def file (1st line
++	    # is EXPORTS), use it as is; otherwise, prepend...
++	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	      cp $export_symbols $output_objdir/$soname.def;
++	    else
++	      echo EXPORTS > $output_objdir/$soname.def;
++	      cat $export_symbols >> $output_objdir/$soname.def;
++	    fi~
++	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
++	  else
++	    _LT_TAGVAR(ld_shlibs, $1)=no
++	  fi
++	  ;;
++	esac
++	;;
+       darwin* | rhapsody*)
+         _LT_DARWIN_LINKER_FEATURES($1)
+ 	;;
+@@ -5818,7 +6197,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+             ;;
+           *)
+             if test "$GXX" = yes; then
+-              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+             else
+               # FIXME: insert proper C++ library support
+               _LT_TAGVAR(ld_shlibs, $1)=no
+@@ -5889,10 +6268,10 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	          ia64*)
+-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	          *)
+-	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
++	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ 	            ;;
+ 	        esac
+ 	      fi
+@@ -5933,9 +6312,9 @@ if test "$_lt_caught_CXX_error" != yes; then
+           *)
+ 	    if test "$GXX" = yes; then
+ 	      if test "$with_gnu_ld" = no; then
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	      else
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ 	      fi
+ 	    fi
+ 	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+@@ -6005,20 +6384,20 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+-		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
++		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ 	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+-		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
++		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ 		$RANLIB $oldlib'
+ 	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
++		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ 	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+ 		rm -rf $tpldir~
+ 		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+-		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
++		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ 	      ;;
+ 	    *) # Version 6 and above use weak symbols
+ 	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+@@ -6213,7 +6592,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 		  ;;
+ 	        *)
+-	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 		  ;;
+ 	      esac
+ 
+@@ -6259,7 +6638,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 
+       solaris*)
+         case $cc_basename in
+-          CC*)
++          CC* | sunCC*)
+ 	    # Sun C++ 4.2, 5.x and Centerline C++
+             _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+ 	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+@@ -6300,9 +6679,9 @@ if test "$_lt_caught_CXX_error" != yes; then
+ 	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ 	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ 	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+-	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ 	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
++		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+ 
+ 	        # Commands to make compiler produce verbose output that lists
+ 	        # what "hidden" libraries, object files and flags are used when
+@@ -6431,6 +6810,7 @@ if test "$_lt_caught_CXX_error" != yes; then
+   fi # test -n "$compiler"
+ 
+   CC=$lt_save_CC
++  CFLAGS=$lt_save_CFLAGS
+   LDCXX=$LD
+   LD=$lt_save_LD
+   GCC=$lt_save_GCC
+@@ -6445,6 +6825,29 @@ AC_LANG_POP
+ ])# _LT_LANG_CXX_CONFIG
+ 
+ 
++# _LT_FUNC_STRIPNAME_CNF
++# ----------------------
++# func_stripname_cnf prefix suffix name
++# strip PREFIX and SUFFIX off of NAME.
++# PREFIX and SUFFIX must not contain globbing or regex special
++# characters, hashes, percent signs, but SUFFIX may contain a leading
++# dot (in which case that matches only a dot).
++#
++# This function is identical to the (non-XSI) version of func_stripname,
++# except this one can be used by m4 code that may be executed by configure,
++# rather than the libtool script.
++m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
++AC_REQUIRE([_LT_DECL_SED])
++AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
++func_stripname_cnf ()
++{
++  case ${2} in
++  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++  esac
++} # func_stripname_cnf
++])# _LT_FUNC_STRIPNAME_CNF
++
+ # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+ # ---------------------------------
+ # Figure out "hidden" library dependencies from verbose
+@@ -6453,6 +6856,7 @@ AC_LANG_POP
+ # objects, libraries and library flags.
+ m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+ [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
++AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+ # Dependencies to place before and after the object being linked:
+ _LT_TAGVAR(predep_objects, $1)=
+ _LT_TAGVAR(postdep_objects, $1)=
+@@ -6503,6 +6907,13 @@ public class foo {
+ };
+ _LT_EOF
+ ])
++
++_lt_libdeps_save_CFLAGS=$CFLAGS
++case "$CC $CFLAGS " in #(
++*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
++*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
++esac
++
+ dnl Parse the compiler output and extract the necessary
+ dnl objects, libraries and library flags.
+ if AC_TRY_EVAL(ac_compile); then
+@@ -6514,7 +6925,7 @@ if AC_TRY_EVAL(ac_compile); then
+   pre_test_object_deps_done=no
+ 
+   for p in `eval "$output_verbose_link_cmd"`; do
+-    case $p in
++    case ${prev}${p} in
+ 
+     -L* | -R* | -l*)
+        # Some compilers place space between "-{L,R}" and the path.
+@@ -6523,13 +6934,22 @@ if AC_TRY_EVAL(ac_compile); then
+           test $p = "-R"; then
+ 	 prev=$p
+ 	 continue
+-       else
+-	 prev=
+        fi
+ 
++       # Expand the sysroot to ease extracting the directories later.
++       if test -z "$prev"; then
++         case $p in
++         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
++         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
++         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
++         esac
++       fi
++       case $p in
++       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
++       esac
+        if test "$pre_test_object_deps_done" = no; then
+-	 case $p in
+-	 -L* | -R*)
++	 case ${prev} in
++	 -L | -R)
+ 	   # Internal compiler library paths should come after those
+ 	   # provided the user.  The postdeps already come after the
+ 	   # user supplied libs so there is no need to process them.
+@@ -6549,8 +6969,10 @@ if AC_TRY_EVAL(ac_compile); then
+ 	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ 	 fi
+        fi
++       prev=
+        ;;
+ 
++    *.lto.$objext) ;; # Ignore GCC LTO objects
+     *.$objext)
+        # This assumes that the test object file only shows up
+        # once in the compiler output.
+@@ -6586,6 +7008,7 @@ else
+ fi
+ 
+ $RM -f confest.$objext
++CFLAGS=$_lt_libdeps_save_CFLAGS
+ 
+ # PORTME: override above test on systems where it is broken
+ m4_if([$1], [CXX],
+@@ -6622,7 +7045,7 @@ linux*)
+ 
+ solaris*)
+   case $cc_basename in
+-  CC*)
++  CC* | sunCC*)
+     # The more standards-conforming stlport4 library is
+     # incompatible with the Cstd library. Avoid specifying
+     # it if it's in CXXFLAGS. Ignore libCrun as
+@@ -6735,7 +7158,9 @@ if test "$_lt_disable_F77" != yes; then
+   # Allow CC to be a program name with arguments.
+   lt_save_CC="$CC"
+   lt_save_GCC=$GCC
++  lt_save_CFLAGS=$CFLAGS
+   CC=${F77-"f77"}
++  CFLAGS=$FFLAGS
+   compiler=$CC
+   _LT_TAGVAR(compiler, $1)=$CC
+   _LT_CC_BASENAME([$compiler])
+@@ -6789,6 +7214,7 @@ if test "$_lt_disable_F77" != yes; then
+ 
+   GCC=$lt_save_GCC
+   CC="$lt_save_CC"
++  CFLAGS="$lt_save_CFLAGS"
+ fi # test "$_lt_disable_F77" != yes
+ 
+ AC_LANG_POP
+@@ -6865,7 +7291,9 @@ if test "$_lt_disable_FC" != yes; then
+   # Allow CC to be a program name with arguments.
+   lt_save_CC="$CC"
+   lt_save_GCC=$GCC
++  lt_save_CFLAGS=$CFLAGS
+   CC=${FC-"f95"}
++  CFLAGS=$FCFLAGS
+   compiler=$CC
+   GCC=$ac_cv_fc_compiler_gnu
+ 
+@@ -6921,7 +7349,8 @@ if test "$_lt_disable_FC" != yes; then
+   fi # test -n "$compiler"
+ 
+   GCC=$lt_save_GCC
+-  CC="$lt_save_CC"
++  CC=$lt_save_CC
++  CFLAGS=$lt_save_CFLAGS
+ fi # test "$_lt_disable_FC" != yes
+ 
+ AC_LANG_POP
+@@ -6958,10 +7387,12 @@ _LT_COMPILER_BOILERPLATE
+ _LT_LINKER_BOILERPLATE
+ 
+ # Allow CC to be a program name with arguments.
+-lt_save_CC="$CC"
++lt_save_CC=$CC
++lt_save_CFLAGS=$CFLAGS
+ lt_save_GCC=$GCC
+ GCC=yes
+ CC=${GCJ-"gcj"}
++CFLAGS=$GCJFLAGS
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_TAGVAR(LD, $1)="$LD"
+@@ -6992,7 +7423,8 @@ fi
+ AC_LANG_RESTORE
+ 
+ GCC=$lt_save_GCC
+-CC="$lt_save_CC"
++CC=$lt_save_CC
++CFLAGS=$lt_save_CFLAGS
+ ])# _LT_LANG_GCJ_CONFIG
+ 
+ 
+@@ -7027,9 +7459,11 @@ _LT_LINKER_BOILERPLATE
+ 
+ # Allow CC to be a program name with arguments.
+ lt_save_CC="$CC"
++lt_save_CFLAGS=$CFLAGS
+ lt_save_GCC=$GCC
+ GCC=
+ CC=${RC-"windres"}
++CFLAGS=
+ compiler=$CC
+ _LT_TAGVAR(compiler, $1)=$CC
+ _LT_CC_BASENAME([$compiler])
+@@ -7042,7 +7476,8 @@ fi
+ 
+ GCC=$lt_save_GCC
+ AC_LANG_RESTORE
+-CC="$lt_save_CC"
++CC=$lt_save_CC
++CFLAGS=$lt_save_CFLAGS
+ ])# _LT_LANG_RC_CONFIG
+ 
+ 
+@@ -7101,6 +7536,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+ AC_SUBST([OBJDUMP])
+ ])
+ 
++# _LT_DECL_DLLTOOL
++# ----------------
++# Ensure DLLTOOL variable is set.
++m4_defun([_LT_DECL_DLLTOOL],
++[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
++AC_SUBST([DLLTOOL])
++])
+ 
+ # _LT_DECL_SED
+ # ------------
+@@ -7194,8 +7638,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES],
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -7234,206 +7678,162 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+ ])# _LT_CHECK_SHELL_FEATURES
+ 
+ 
+-# _LT_PROG_XSI_SHELLFNS
+-# ---------------------
+-# Bourne and XSI compatible variants of some useful shell functions.
+-m4_defun([_LT_PROG_XSI_SHELLFNS],
+-[case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $[*] ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
++# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
++# ------------------------------------------------------
++# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
++# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
++m4_defun([_LT_PROG_FUNCTION_REPLACE],
++[dnl {
++sed -e '/^$1 ()$/,/^} # $1 /c\
++$1 ()\
++{\
++m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
++} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++])
+ 
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+ 
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
++# _LT_PROG_REPLACE_SHELLFNS
++# -------------------------
++# Replace existing portable implementations of several shell functions with
++# equivalent extended shell implementations where those features are available..
++m4_defun([_LT_PROG_REPLACE_SHELLFNS],
++[if test x"$xsi_shell" = xyes; then
++  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
++    case ${1} in
++      */*) func_dirname_result="${1%/*}${2}" ;;
++      *  ) func_dirname_result="${3}" ;;
++    esac])
++
++  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
++    func_basename_result="${1##*/}"])
++
++  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
++    case ${1} in
++      */*) func_dirname_result="${1%/*}${2}" ;;
++      *  ) func_dirname_result="${3}" ;;
++    esac
++    func_basename_result="${1##*/}"])
+ 
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
++    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
++    # positional parameters, so assign one to ordinary parameter first.
++    func_stripname_result=${3}
++    func_stripname_result=${func_stripname_result#"${1}"}
++    func_stripname_result=${func_stripname_result%"${2}"}])
+ 
+-dnl func_dirname_and_basename
+-dnl A portable version of this function is already defined in general.m4sh
+-dnl so there is no need for it here.
++  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
++    func_split_long_opt_name=${1%%=*}
++    func_split_long_opt_arg=${1#*=}])
+ 
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
++    func_split_short_opt_arg=${1#??}
++    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+ 
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[[^=]]*=//'
++  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
++    case ${1} in
++      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
++      *)    func_lo2o_result=${1} ;;
++    esac])
+ 
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+ 
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+ 
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
++fi
+ 
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$[@]"`
+-}
++if test x"$lt_shell_append" = xyes; then
++  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+ 
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
++  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
++    func_quote_for_eval "${2}"
++dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
++    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+ 
+-_LT_EOF
+-esac
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
+ 
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
++if test x"$_lt_function_replace_fail" = x":"; then
++  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
++fi
++])
+ 
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$[1]+=\$[2]"
+-}
+-_LT_EOF
++# _LT_PATH_CONVERSION_FUNCTIONS
++# -----------------------------
++# Determine which file name conversion functions should be used by
++# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
++# for certain cross-compile configurations and native mingw.
++m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
++[AC_REQUIRE([AC_CANONICAL_HOST])dnl
++AC_REQUIRE([AC_CANONICAL_BUILD])dnl
++AC_MSG_CHECKING([how to convert $build file names to $host format])
++AC_CACHE_VAL(lt_cv_to_host_file_cmd,
++[case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
+     ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$[1]=\$$[1]\$[2]"
+-}
+-
+-_LT_EOF
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
+     ;;
+-  esac
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++])
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
++_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
++         [0], [convert $build file names to $host format])dnl
++
++AC_MSG_CHECKING([how to convert $build file names to toolchain format])
++AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
++[#assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
+ ])
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
++_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
++         [0], [convert $build files to toolchain format])dnl
++])# _LT_PATH_CONVERSION_FUNCTIONS
+diff --git a/ltmain.sh b/ltmain.sh
+index 9503ec8..70e856e 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -1,10 +1,9 @@
+-# Generated from ltmain.m4sh.
+ 
+-# libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a
++# libtool (GNU libtool) 2.4
+ # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+ 
+ # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+-# 2007, 2008, 2009 Free Software Foundation, Inc.
++# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ # This is free software; see the source for copying conditions.  There is NO
+ # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ 
+@@ -38,7 +37,6 @@
+ #   -n, --dry-run            display commands without modifying any files
+ #       --features           display basic configuration information and exit
+ #       --mode=MODE          use operation mode MODE
+-#       --no-finish          let install mode avoid finish commands
+ #       --preserve-dup-deps  don't remove duplicate dependency libraries
+ #       --quiet, --silent    don't print informational messages
+ #       --no-quiet, --no-silent
+@@ -71,17 +69,19 @@
+ #         compiler:		$LTCC
+ #         compiler flags:		$LTCFLAGS
+ #         linker:		$LD (gnu? $with_gnu_ld)
+-#         $progname:	(GNU libtool 1.3134 2009-11-29) 2.2.7a
++#         $progname:	(GNU libtool) 2.4
+ #         automake:	$automake_version
+ #         autoconf:	$autoconf_version
+ #
+ # Report bugs to <bug-libtool@gnu.org>.
++# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
++# General help using GNU software: <http://www.gnu.org/gethelp/>.
+ 
+ PROGRAM=libtool
+ PACKAGE=libtool
+-VERSION=2.2.7a
+-TIMESTAMP=" 1.3134 2009-11-29"
+-package_revision=1.3134
++VERSION=2.4
++TIMESTAMP=""
++package_revision=1.3293
+ 
+ # Be Bourne compatible
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+@@ -106,9 +106,6 @@ _LTECHO_EOF'
+ }
+ 
+ # NLS nuisances: We save the old values to restore during execute mode.
+-# Only set LANG and LC_ALL to C if already set.
+-# These must not be set unconditionally because not all systems understand
+-# e.g. LANG=C (notably SCO).
+ lt_user_locale=
+ lt_safe_locale=
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+@@ -121,15 +118,13 @@ do
+ 	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ 	fi"
+ done
++LC_ALL=C
++LANGUAGE=C
++export LANGUAGE LC_ALL
+ 
+ $lt_unset CDPATH
+ 
+ 
+-
+-
+-
+-
+-
+ # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+ # is ksh but when the shell is invoked as "sh" and the current value of
+ # the _XPG environment variable is not equal to 1 (one), the special
+@@ -140,7 +135,7 @@ progpath="$0"
+ 
+ 
+ : ${CP="cp -f"}
+-: ${ECHO=$as_echo}
++test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+ : ${EGREP="/bin/grep -E"}
+ : ${FGREP="/bin/grep -F"}
+ : ${GREP="/bin/grep"}
+@@ -149,7 +144,7 @@ progpath="$0"
+ : ${MKDIR="mkdir"}
+ : ${MV="mv -f"}
+ : ${RM="rm -f"}
+-: ${SED="/mount/endor/wildenhu/local-x86_64/bin/sed"}
++: ${SED="/bin/sed"}
+ : ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+ : ${Xsed="$SED -e 1s/^X//"}
+ 
+@@ -169,6 +164,27 @@ IFS=" 	$lt_nl"
+ dirname="s,/[^/]*$,,"
+ basename="s,^.*/,,"
+ 
++# func_dirname file append nondir_replacement
++# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
++# otherwise set result to NONDIR_REPLACEMENT.
++func_dirname ()
++{
++    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
++    if test "X$func_dirname_result" = "X${1}"; then
++      func_dirname_result="${3}"
++    else
++      func_dirname_result="$func_dirname_result${2}"
++    fi
++} # func_dirname may be replaced by extended shell implementation
++
++
++# func_basename file
++func_basename ()
++{
++    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
++} # func_basename may be replaced by extended shell implementation
++
++
+ # func_dirname_and_basename file append nondir_replacement
+ # perform func_basename and func_dirname in a single function
+ # call:
+@@ -183,17 +199,31 @@ basename="s,^.*/,,"
+ # those functions but instead duplicate the functionality here.
+ func_dirname_and_basename ()
+ {
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-  func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+-}
++    # Extract subdirectory from the argument.
++    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
++    if test "X$func_dirname_result" = "X${1}"; then
++      func_dirname_result="${3}"
++    else
++      func_dirname_result="$func_dirname_result${2}"
++    fi
++    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
++} # func_dirname_and_basename may be replaced by extended shell implementation
++
++
++# func_stripname prefix suffix name
++# strip PREFIX and SUFFIX off of NAME.
++# PREFIX and SUFFIX must not contain globbing or regex special
++# characters, hashes, percent signs, but SUFFIX may contain a leading
++# dot (in which case that matches only a dot).
++# func_strip_suffix prefix name
++func_stripname ()
++{
++    case ${2} in
++      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
++      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
++    esac
++} # func_stripname may be replaced by extended shell implementation
+ 
+-# Generated shell functions inserted here.
+ 
+ # These SED scripts presuppose an absolute path with a trailing slash.
+ pathcar='s,^/\([^/]*\).*$,\1,'
+@@ -376,6 +406,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+ # Same as above, but do not quote variable references.
+ double_quote_subst='s/\(["`\\]\)/\\\1/g'
+ 
++# Sed substitution that turns a string into a regex matching for the
++# string literally.
++sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
++
++# Sed substitution that converts a w32 file name or path
++# which contains forward slashes, into one that contains
++# (escaped) backslashes.  A very naive implementation.
++lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
++
+ # Re-`\' parameter expansions in output of double_quote_subst that were
+ # `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+ # in input to double_quote_subst, that '$' was protected from expansion.
+@@ -404,7 +443,7 @@ opt_warning=:
+ # name if it has been set yet.
+ func_echo ()
+ {
+-    $ECHO "$progname${mode+: }$mode: $*"
++    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+ }
+ 
+ # func_verbose arg...
+@@ -430,14 +469,14 @@ func_echo_all ()
+ # Echo program name prefixed message to standard error.
+ func_error ()
+ {
+-    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
++    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+ }
+ 
+ # func_warning arg...
+ # Echo program name prefixed warning message to standard error.
+ func_warning ()
+ {
+-    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
++    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+ 
+     # bash bug again:
+     :
+@@ -656,19 +695,35 @@ func_show_eval_locale ()
+     fi
+ }
+ 
+-
+-
++# func_tr_sh
++# Turn $1 into a string suitable for a shell variable name.
++# Result is stored in $func_tr_sh_result.  All characters
++# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
++# if $1 begins with a digit, a '_' is prepended as well.
++func_tr_sh ()
++{
++  case $1 in
++  [0-9]* | *[!a-zA-Z0-9_]*)
++    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
++    ;;
++  * )
++    func_tr_sh_result=$1
++    ;;
++  esac
++}
+ 
+ 
+ # func_version
+ # Echo version message to standard output and exit.
+ func_version ()
+ {
++    $opt_debug
++
+     $SED -n '/(C)/!b go
+ 	:more
+ 	/\./!{
+ 	  N
+-	  s/\n# //
++	  s/\n# / /
+ 	  b more
+ 	}
+ 	:go
+@@ -685,7 +740,9 @@ func_version ()
+ # Echo short help message to standard output and exit.
+ func_usage ()
+ {
+-    $SED -n '/^# Usage:/,/^#  *-h/ {
++    $opt_debug
++
++    $SED -n '/^# Usage:/,/^#  *.*--help/ {
+         s/^# //
+ 	s/^# *$//
+ 	s/\$progname/'$progname'/
+@@ -701,7 +758,10 @@ func_usage ()
+ # unless 'noexit' is passed as argument.
+ func_help ()
+ {
++    $opt_debug
++
+     $SED -n '/^# Usage:/,/# Report bugs to/ {
++	:print
+         s/^# //
+ 	s/^# *$//
+ 	s*\$progname*'$progname'*
+@@ -714,7 +774,11 @@ func_help ()
+ 	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+ 	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ 	p
+-     }' < "$progpath"
++	d
++     }
++     /^# .* home page:/b print
++     /^# General help using/b print
++     ' < "$progpath"
+     ret=$?
+     if test -z "$1"; then
+       exit $ret
+@@ -726,12 +790,39 @@ func_help ()
+ # exit_cmd.
+ func_missing_arg ()
+ {
+-    func_error "missing argument for $1"
++    $opt_debug
++
++    func_error "missing argument for $1."
+     exit_cmd=exit
+ }
+ 
+-exit_cmd=:
+ 
++# func_split_short_opt shortopt
++# Set func_split_short_opt_name and func_split_short_opt_arg shell
++# variables after splitting SHORTOPT after the 2nd character.
++func_split_short_opt ()
++{
++    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
++    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
++
++    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
++    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
++} # func_split_short_opt may be replaced by extended shell implementation
++
++
++# func_split_long_opt longopt
++# Set func_split_long_opt_name and func_split_long_opt_arg shell
++# variables after splitting LONGOPT at the `=' sign.
++func_split_long_opt ()
++{
++    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
++    my_sed_long_arg='1s/^--[^=]*=//'
++
++    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
++    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
++} # func_split_long_opt may be replaced by extended shell implementation
++
++exit_cmd=:
+ 
+ 
+ 
+@@ -741,26 +832,64 @@ magic="%%%MAGIC variable%%%"
+ magic_exe="%%%MAGIC EXE variable%%%"
+ 
+ # Global variables.
+-# $mode is unset
+ nonopt=
+-execute_dlfiles=
+ preserve_args=
+ lo2o="s/\\.lo\$/.${objext}/"
+ o2lo="s/\\.${objext}\$/.lo/"
+ extracted_archives=
+ extracted_serial=0
+ 
+-opt_dry_run=false
+-opt_finish=:
+-opt_duplicate_deps=false
+-opt_silent=false
+-opt_debug=:
+-
+ # If this variable is set in any of the actions, the command in it
+ # will be execed at the end.  This prevents here-documents from being
+ # left over by shells.
+ exec_cmd=
+ 
++# func_append var value
++# Append VALUE to the end of shell variable VAR.
++func_append ()
++{
++    eval "${1}=\$${1}\${2}"
++} # func_append may be replaced by extended shell implementation
++
++# func_append_quoted var value
++# Quote VALUE and append to the end of shell variable VAR, separated
++# by a space.
++func_append_quoted ()
++{
++    func_quote_for_eval "${2}"
++    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
++} # func_append_quoted may be replaced by extended shell implementation
++
++
++# func_arith arithmetic-term...
++func_arith ()
++{
++    func_arith_result=`expr "${@}"`
++} # func_arith may be replaced by extended shell implementation
++
++
++# func_len string
++# STRING may not start with a hyphen.
++func_len ()
++{
++    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
++} # func_len may be replaced by extended shell implementation
++
++
++# func_lo2o object
++func_lo2o ()
++{
++    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
++} # func_lo2o may be replaced by extended shell implementation
++
++
++# func_xform libobj-or-source
++func_xform ()
++{
++    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
++} # func_xform may be replaced by extended shell implementation
++
++
+ # func_fatal_configuration arg...
+ # Echo program name prefixed message to standard error, followed by
+ # a configuration failure hint, and exit.
+@@ -850,130 +979,204 @@ func_enable_tag ()
+   esac
+ }
+ 
+-# Parse options once, thoroughly.  This comes as soon as possible in
+-# the script to make things like `libtool --version' happen quickly.
++# func_check_version_match
++# Ensure that we are using m4 macros, and libtool script from the same
++# release of libtool.
++func_check_version_match ()
+ {
++  if test "$package_revision" != "$macro_revision"; then
++    if test "$VERSION" != "$macro_version"; then
++      if test -z "$macro_version"; then
++        cat >&2 <<_LT_EOF
++$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
++$progname: definition of this LT_INIT comes from an older release.
++$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
++$progname: and run autoconf again.
++_LT_EOF
++      else
++        cat >&2 <<_LT_EOF
++$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
++$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
++$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
++$progname: and run autoconf again.
++_LT_EOF
++      fi
++    else
++      cat >&2 <<_LT_EOF
++$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
++$progname: but the definition of this LT_INIT comes from revision $macro_revision.
++$progname: You should recreate aclocal.m4 with macros from revision $package_revision
++$progname: of $PACKAGE $VERSION and run autoconf again.
++_LT_EOF
++    fi
+ 
+-  # Shorthand for --mode=foo, only valid as the first argument
+-  case $1 in
+-  clean|clea|cle|cl)
+-    shift; set dummy --mode clean ${1+"$@"}; shift
+-    ;;
+-  compile|compil|compi|comp|com|co|c)
+-    shift; set dummy --mode compile ${1+"$@"}; shift
+-    ;;
+-  execute|execut|execu|exec|exe|ex|e)
+-    shift; set dummy --mode execute ${1+"$@"}; shift
+-    ;;
+-  finish|finis|fini|fin|fi|f)
+-    shift; set dummy --mode finish ${1+"$@"}; shift
+-    ;;
+-  install|instal|insta|inst|ins|in|i)
+-    shift; set dummy --mode install ${1+"$@"}; shift
+-    ;;
+-  link|lin|li|l)
+-    shift; set dummy --mode link ${1+"$@"}; shift
+-    ;;
+-  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+-    shift; set dummy --mode uninstall ${1+"$@"}; shift
+-    ;;
+-  esac
++    exit $EXIT_MISMATCH
++  fi
++}
++
++
++# Shorthand for --mode=foo, only valid as the first argument
++case $1 in
++clean|clea|cle|cl)
++  shift; set dummy --mode clean ${1+"$@"}; shift
++  ;;
++compile|compil|compi|comp|com|co|c)
++  shift; set dummy --mode compile ${1+"$@"}; shift
++  ;;
++execute|execut|execu|exec|exe|ex|e)
++  shift; set dummy --mode execute ${1+"$@"}; shift
++  ;;
++finish|finis|fini|fin|fi|f)
++  shift; set dummy --mode finish ${1+"$@"}; shift
++  ;;
++install|instal|insta|inst|ins|in|i)
++  shift; set dummy --mode install ${1+"$@"}; shift
++  ;;
++link|lin|li|l)
++  shift; set dummy --mode link ${1+"$@"}; shift
++  ;;
++uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
++  shift; set dummy --mode uninstall ${1+"$@"}; shift
++  ;;
++esac
+ 
+-  # Parse non-mode specific arguments:
+-  while test "$#" -gt 0; do
++
++
++# Option defaults:
++opt_debug=:
++opt_dry_run=false
++opt_config=false
++opt_preserve_dup_deps=false
++opt_features=false
++opt_finish=false
++opt_help=false
++opt_help_all=false
++opt_silent=:
++opt_verbose=:
++opt_silent=false
++opt_verbose=false
++
++
++# Parse options once, thoroughly.  This comes as soon as possible in the
++# script to make things like `--version' happen as quickly as we can.
++{
++  # this just eases exit handling
++  while test $# -gt 0; do
+     opt="$1"
+     shift
+-
+     case $opt in
+-      --config)		func_config					;;
+-
+-      --debug)		preserve_args="$preserve_args $opt"
++      --debug|-x)	opt_debug='set -x'
+ 			func_echo "enabling shell trace mode"
+-			opt_debug='set -x'
+ 			$opt_debug
+ 			;;
+-
+-      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+-			execute_dlfiles="$execute_dlfiles $1"
+-			shift
++      --dry-run|--dryrun|-n)
++			opt_dry_run=:
+ 			;;
+-
+-      --dry-run | -n)	opt_dry_run=:					;;
+-      --features)       func_features					;;
+-      --finish)		mode="finish"					;;
+-      --no-finish)	opt_finish=false				;;
+-
+-      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+-			case $1 in
+-			  # Valid mode arguments:
+-			  clean)	;;
+-			  compile)	;;
+-			  execute)	;;
+-			  finish)	;;
+-			  install)	;;
+-			  link)		;;
+-			  relink)	;;
+-			  uninstall)	;;
+-
+-			  # Catch anything else as an error
+-			  *) func_error "invalid argument for $opt"
+-			     exit_cmd=exit
+-			     break
+-			     ;;
+-		        esac
+-
+-			mode="$1"
++      --config)
++			opt_config=:
++func_config
++			;;
++      --dlopen|-dlopen)
++			optarg="$1"
++			opt_dlopen="${opt_dlopen+$opt_dlopen
++}$optarg"
+ 			shift
+ 			;;
+-
+       --preserve-dup-deps)
+-			opt_duplicate_deps=:				;;
+-
+-      --quiet|--silent)	preserve_args="$preserve_args $opt"
+-			opt_silent=:
+-			opt_verbose=false
++			opt_preserve_dup_deps=:
+ 			;;
+-
+-      --no-quiet|--no-silent)
+-			preserve_args="$preserve_args $opt"
+-			opt_silent=false
++      --features)
++			opt_features=:
++func_features
+ 			;;
+-
+-      --verbose| -v)	preserve_args="$preserve_args $opt"
++      --finish)
++			opt_finish=:
++set dummy --mode finish ${1+"$@"}; shift
++			;;
++      --help)
++			opt_help=:
++			;;
++      --help-all)
++			opt_help_all=:
++opt_help=': help-all'
++			;;
++      --mode)
++			test $# = 0 && func_missing_arg $opt && break
++			optarg="$1"
++			opt_mode="$optarg"
++case $optarg in
++  # Valid mode arguments:
++  clean|compile|execute|finish|install|link|relink|uninstall) ;;
++
++  # Catch anything else as an error
++  *) func_error "invalid argument for $opt"
++     exit_cmd=exit
++     break
++     ;;
++esac
++			shift
++			;;
++      --no-silent|--no-quiet)
+ 			opt_silent=false
+-			opt_verbose=:
++func_append preserve_args " $opt"
+ 			;;
+-
+-      --no-verbose)	preserve_args="$preserve_args $opt"
++      --no-verbose)
+ 			opt_verbose=false
++func_append preserve_args " $opt"
+ 			;;
+-
+-      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+-			preserve_args="$preserve_args $opt $1"
+-			func_enable_tag "$1"	# tagname is set here
++      --silent|--quiet)
++			opt_silent=:
++func_append preserve_args " $opt"
++        opt_verbose=false
++			;;
++      --verbose|-v)
++			opt_verbose=:
++func_append preserve_args " $opt"
++opt_silent=false
++			;;
++      --tag)
++			test $# = 0 && func_missing_arg $opt && break
++			optarg="$1"
++			opt_tag="$optarg"
++func_append preserve_args " $opt $optarg"
++func_enable_tag "$optarg"
+ 			shift
+ 			;;
+ 
++      -\?|-h)		func_usage				;;
++      --help)		func_help				;;
++      --version)	func_version				;;
++
+       # Separate optargs to long options:
+-      -dlopen=*|--mode=*|--tag=*)
+-			func_opt_split "$opt"
+-			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
++      --*=*)
++			func_split_long_opt "$opt"
++			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+ 			shift
+ 			;;
+ 
+-      -\?|-h)		func_usage					;;
+-      --help)		opt_help=:					;;
+-      --help-all)	opt_help=': help-all'				;;
+-      --version)	func_version					;;
+-
+-      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
+-
+-      *)		nonopt="$opt"
+-			break
++      # Separate non-argument short options:
++      -\?*|-h*|-n*|-v*)
++			func_split_short_opt "$opt"
++			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
++			shift
+ 			;;
++
++      --)		break					;;
++      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
++      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
+     esac
+   done
+ 
++  # Validate options:
++
++  # save first non-option argument
++  if test "$#" -gt 0; then
++    nonopt="$opt"
++    shift
++  fi
++
++  # preserve --debug
++  test "$opt_debug" = : || func_append preserve_args " --debug"
+ 
+   case $host in
+     *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* )
+@@ -981,82 +1184,44 @@ func_enable_tag ()
+       opt_duplicate_compiler_generated_deps=:
+       ;;
+     *)
+-      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
++      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+       ;;
+   esac
+ 
+-  # Having warned about all mis-specified options, bail out if
+-  # anything was wrong.
+-  $exit_cmd $EXIT_FAILURE
+-}
++  $opt_help || {
++    # Sanity checks first:
++    func_check_version_match
+ 
+-# func_check_version_match
+-# Ensure that we are using m4 macros, and libtool script from the same
+-# release of libtool.
+-func_check_version_match ()
+-{
+-  if test "$package_revision" != "$macro_revision"; then
+-    if test "$VERSION" != "$macro_version"; then
+-      if test -z "$macro_version"; then
+-        cat >&2 <<_LT_EOF
+-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+-$progname: definition of this LT_INIT comes from an older release.
+-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+-$progname: and run autoconf again.
+-_LT_EOF
+-      else
+-        cat >&2 <<_LT_EOF
+-$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+-$progname: and run autoconf again.
+-_LT_EOF
+-      fi
+-    else
+-      cat >&2 <<_LT_EOF
+-$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+-$progname: of $PACKAGE $VERSION and run autoconf again.
+-_LT_EOF
++    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
++      func_fatal_configuration "not configured to build any kind of library"
+     fi
+ 
+-    exit $EXIT_MISMATCH
+-  fi
+-}
+-
++    # Darwin sucks
++    eval std_shrext=\"$shrext_cmds\"
+ 
+-## ----------- ##
+-##    Main.    ##
+-## ----------- ##
+-
+-$opt_help || {
+-  # Sanity checks first:
+-  func_check_version_match
+-
+-  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+-    func_fatal_configuration "not configured to build any kind of library"
+-  fi
++    # Only execute mode is allowed to have -dlopen flags.
++    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
++      func_error "unrecognized option \`-dlopen'"
++      $ECHO "$help" 1>&2
++      exit $EXIT_FAILURE
++    fi
+ 
+-  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
++    # Change the help message to a mode-specific one.
++    generic_help="$help"
++    help="Try \`$progname --help --mode=$opt_mode' for more information."
++  }
+ 
+ 
+-  # Darwin sucks
+-  eval "std_shrext=\"$shrext_cmds\""
++  # Bail if the options were screwed
++  $exit_cmd $EXIT_FAILURE
++}
+ 
+ 
+-  # Only execute mode is allowed to have -dlopen flags.
+-  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+-    func_error "unrecognized option \`-dlopen'"
+-    $ECHO "$help" 1>&2
+-    exit $EXIT_FAILURE
+-  fi
+ 
+-  # Change the help message to a mode-specific one.
+-  generic_help="$help"
+-  help="Try \`$progname --help --mode=$mode' for more information."
+-}
+ 
++## ----------- ##
++##    Main.    ##
++## ----------- ##
+ 
+ # func_lalib_p file
+ # True iff FILE is a libtool `.la' library or `.lo' object file.
+@@ -1121,12 +1286,9 @@ func_ltwrapper_executable_p ()
+ # temporary ltwrapper_script.
+ func_ltwrapper_scriptname ()
+ {
+-    func_ltwrapper_scriptname_result=""
+-    if func_ltwrapper_executable_p "$1"; then
+-	func_dirname_and_basename "$1" "" "."
+-	func_stripname '' '.exe' "$func_basename_result"
+-	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+-    fi
++    func_dirname_and_basename "$1" "" "."
++    func_stripname '' '.exe' "$func_basename_result"
++    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+ }
+ 
+ # func_ltwrapper_p file
+@@ -1149,7 +1311,7 @@ func_execute_cmds ()
+     save_ifs=$IFS; IFS='~'
+     for cmd in $1; do
+       IFS=$save_ifs
+-      eval "cmd=\"$cmd\""
++      eval cmd=\"$cmd\"
+       func_show_eval "$cmd" "${2-:}"
+     done
+     IFS=$save_ifs
+@@ -1172,6 +1334,37 @@ func_source ()
+ }
+ 
+ 
++# func_resolve_sysroot PATH
++# Replace a leading = in PATH with a sysroot.  Store the result into
++# func_resolve_sysroot_result
++func_resolve_sysroot ()
++{
++  func_resolve_sysroot_result=$1
++  case $func_resolve_sysroot_result in
++  =*)
++    func_stripname '=' '' "$func_resolve_sysroot_result"
++    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
++    ;;
++  esac
++}
++
++# func_replace_sysroot PATH
++# If PATH begins with the sysroot, replace it with = and
++# store the result into func_replace_sysroot_result.
++func_replace_sysroot ()
++{
++  case "$lt_sysroot:$1" in
++  ?*:"$lt_sysroot"*)
++    func_stripname "$lt_sysroot" '' "$1"
++    func_replace_sysroot_result="=$func_stripname_result"
++    ;;
++  *)
++    # Including no sysroot.
++    func_replace_sysroot_result=$1
++    ;;
++  esac
++}
++
+ # func_infer_tag arg
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+@@ -1184,8 +1377,7 @@ func_infer_tag ()
+     if test -n "$available_tags" && test -z "$tagname"; then
+       CC_quoted=
+       for arg in $CC; do
+-        func_quote_for_eval "$arg"
+-	CC_quoted="$CC_quoted $func_quote_for_eval_result"
++	func_append_quoted CC_quoted "$arg"
+       done
+       CC_expanded=`func_echo_all $CC`
+       CC_quoted_expanded=`func_echo_all $CC_quoted`
+@@ -1204,8 +1396,7 @@ func_infer_tag ()
+ 	    CC_quoted=
+ 	    for arg in $CC; do
+ 	      # Double-quote args containing other shell metacharacters.
+-	      func_quote_for_eval "$arg"
+-	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
++	      func_append_quoted CC_quoted "$arg"
+ 	    done
+ 	    CC_expanded=`func_echo_all $CC`
+ 	    CC_quoted_expanded=`func_echo_all $CC_quoted`
+@@ -1274,6 +1465,486 @@ EOF
+     }
+ }
+ 
++
++##################################################
++# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
++##################################################
++
++# func_convert_core_file_wine_to_w32 ARG
++# Helper function used by file name conversion functions when $build is *nix,
++# and $host is mingw, cygwin, or some other w32 environment. Relies on a
++# correctly configured wine environment available, with the winepath program
++# in $build's $PATH.
++#
++# ARG is the $build file name to be converted to w32 format.
++# Result is available in $func_convert_core_file_wine_to_w32_result, and will
++# be empty on error (or when ARG is empty)
++func_convert_core_file_wine_to_w32 ()
++{
++  $opt_debug
++  func_convert_core_file_wine_to_w32_result="$1"
++  if test -n "$1"; then
++    # Unfortunately, winepath does not exit with a non-zero error code, so we
++    # are forced to check the contents of stdout. On the other hand, if the
++    # command is not found, the shell will set an exit code of 127 and print
++    # *an error message* to stdout. So we must check for both error code of
++    # zero AND non-empty stdout, which explains the odd construction:
++    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
++    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
++      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
++        $SED -e "$lt_sed_naive_backslashify"`
++    else
++      func_convert_core_file_wine_to_w32_result=
++    fi
++  fi
++}
++# end: func_convert_core_file_wine_to_w32
++
++
++# func_convert_core_path_wine_to_w32 ARG
++# Helper function used by path conversion functions when $build is *nix, and
++# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
++# configured wine environment available, with the winepath program in $build's
++# $PATH. Assumes ARG has no leading or trailing path separator characters.
++#
++# ARG is path to be converted from $build format to win32.
++# Result is available in $func_convert_core_path_wine_to_w32_result.
++# Unconvertible file (directory) names in ARG are skipped; if no directory names
++# are convertible, then the result may be empty.
++func_convert_core_path_wine_to_w32 ()
++{
++  $opt_debug
++  # unfortunately, winepath doesn't convert paths, only file names
++  func_convert_core_path_wine_to_w32_result=""
++  if test -n "$1"; then
++    oldIFS=$IFS
++    IFS=:
++    for func_convert_core_path_wine_to_w32_f in $1; do
++      IFS=$oldIFS
++      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
++      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
++        if test -z "$func_convert_core_path_wine_to_w32_result"; then
++          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
++        else
++          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
++        fi
++      fi
++    done
++    IFS=$oldIFS
++  fi
++}
++# end: func_convert_core_path_wine_to_w32
++
++
++# func_cygpath ARGS...
++# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
++# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
++# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
++# (2), returns the Cygwin file name or path in func_cygpath_result (input
++# file name or path is assumed to be in w32 format, as previously converted
++# from $build's *nix or MSYS format). In case (3), returns the w32 file name
++# or path in func_cygpath_result (input file name or path is assumed to be in
++# Cygwin format). Returns an empty string on error.
++#
++# ARGS are passed to cygpath, with the last one being the file name or path to
++# be converted.
++#
++# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
++# environment variable; do not put it in $PATH.
++func_cygpath ()
++{
++  $opt_debug
++  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
++    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
++    if test "$?" -ne 0; then
++      # on failure, ensure result is empty
++      func_cygpath_result=
++    fi
++  else
++    func_cygpath_result=
++    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
++  fi
++}
++#end: func_cygpath
++
++
++# func_convert_core_msys_to_w32 ARG
++# Convert file name or path ARG from MSYS format to w32 format.  Return
++# result in func_convert_core_msys_to_w32_result.
++func_convert_core_msys_to_w32 ()
++{
++  $opt_debug
++  # awkward: cmd appends spaces to result
++  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
++    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
++}
++#end: func_convert_core_msys_to_w32
++
++
++# func_convert_file_check ARG1 ARG2
++# Verify that ARG1 (a file name in $build format) was converted to $host
++# format in ARG2. Otherwise, emit an error message, but continue (resetting
++# func_to_host_file_result to ARG1).
++func_convert_file_check ()
++{
++  $opt_debug
++  if test -z "$2" && test -n "$1" ; then
++    func_error "Could not determine host file name corresponding to"
++    func_error "  \`$1'"
++    func_error "Continuing, but uninstalled executables may not work."
++    # Fallback:
++    func_to_host_file_result="$1"
++  fi
++}
++# end func_convert_file_check
++
++
++# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
++# Verify that FROM_PATH (a path in $build format) was converted to $host
++# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
++# func_to_host_file_result to a simplistic fallback value (see below).
++func_convert_path_check ()
++{
++  $opt_debug
++  if test -z "$4" && test -n "$3"; then
++    func_error "Could not determine the host path corresponding to"
++    func_error "  \`$3'"
++    func_error "Continuing, but uninstalled executables may not work."
++    # Fallback.  This is a deliberately simplistic "conversion" and
++    # should not be "improved".  See libtool.info.
++    if test "x$1" != "x$2"; then
++      lt_replace_pathsep_chars="s|$1|$2|g"
++      func_to_host_path_result=`echo "$3" |
++        $SED -e "$lt_replace_pathsep_chars"`
++    else
++      func_to_host_path_result="$3"
++    fi
++  fi
++}
++# end func_convert_path_check
++
++
++# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
++# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
++# and appending REPL if ORIG matches BACKPAT.
++func_convert_path_front_back_pathsep ()
++{
++  $opt_debug
++  case $4 in
++  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
++    ;;
++  esac
++  case $4 in
++  $2 ) func_append func_to_host_path_result "$3"
++    ;;
++  esac
++}
++# end func_convert_path_front_back_pathsep
++
++
++##################################################
++# $build to $host FILE NAME CONVERSION FUNCTIONS #
++##################################################
++# invoked via `$to_host_file_cmd ARG'
++#
++# In each case, ARG is the path to be converted from $build to $host format.
++# Result will be available in $func_to_host_file_result.
++
++
++# func_to_host_file ARG
++# Converts the file name ARG from $build format to $host format. Return result
++# in func_to_host_file_result.
++func_to_host_file ()
++{
++  $opt_debug
++  $to_host_file_cmd "$1"
++}
++# end func_to_host_file
++
++
++# func_to_tool_file ARG LAZY
++# converts the file name ARG from $build format to toolchain format. Return
++# result in func_to_tool_file_result.  If the conversion in use is listed
++# in (the comma separated) LAZY, no conversion takes place.
++func_to_tool_file ()
++{
++  $opt_debug
++  case ,$2, in
++    *,"$to_tool_file_cmd",*)
++      func_to_tool_file_result=$1
++      ;;
++    *)
++      $to_tool_file_cmd "$1"
++      func_to_tool_file_result=$func_to_host_file_result
++      ;;
++  esac
++}
++# end func_to_tool_file
++
++
++# func_convert_file_noop ARG
++# Copy ARG to func_to_host_file_result.
++func_convert_file_noop ()
++{
++  func_to_host_file_result="$1"
++}
++# end func_convert_file_noop
++
++
++# func_convert_file_msys_to_w32 ARG
++# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
++# conversion to w32 is not available inside the cwrapper.  Returns result in
++# func_to_host_file_result.
++func_convert_file_msys_to_w32 ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    func_convert_core_msys_to_w32 "$1"
++    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_msys_to_w32
++
++
++# func_convert_file_cygwin_to_w32 ARG
++# Convert file name ARG from Cygwin to w32 format.  Returns result in
++# func_to_host_file_result.
++func_convert_file_cygwin_to_w32 ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
++    # LT_CYGPATH in this case.
++    func_to_host_file_result=`cygpath -m "$1"`
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_cygwin_to_w32
++
++
++# func_convert_file_nix_to_w32 ARG
++# Convert file name ARG from *nix to w32 format.  Requires a wine environment
++# and a working winepath. Returns result in func_to_host_file_result.
++func_convert_file_nix_to_w32 ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    func_convert_core_file_wine_to_w32 "$1"
++    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_nix_to_w32
++
++
++# func_convert_file_msys_to_cygwin ARG
++# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
++# Returns result in func_to_host_file_result.
++func_convert_file_msys_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    func_convert_core_msys_to_w32 "$1"
++    func_cygpath -u "$func_convert_core_msys_to_w32_result"
++    func_to_host_file_result="$func_cygpath_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_msys_to_cygwin
++
++
++# func_convert_file_nix_to_cygwin ARG
++# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
++# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
++# in func_to_host_file_result.
++func_convert_file_nix_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_file_result="$1"
++  if test -n "$1"; then
++    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
++    func_convert_core_file_wine_to_w32 "$1"
++    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
++    func_to_host_file_result="$func_cygpath_result"
++  fi
++  func_convert_file_check "$1" "$func_to_host_file_result"
++}
++# end func_convert_file_nix_to_cygwin
++
++
++#############################################
++# $build to $host PATH CONVERSION FUNCTIONS #
++#############################################
++# invoked via `$to_host_path_cmd ARG'
++#
++# In each case, ARG is the path to be converted from $build to $host format.
++# The result will be available in $func_to_host_path_result.
++#
++# Path separators are also converted from $build format to $host format.  If
++# ARG begins or ends with a path separator character, it is preserved (but
++# converted to $host format) on output.
++#
++# All path conversion functions are named using the following convention:
++#   file name conversion function    : func_convert_file_X_to_Y ()
++#   path conversion function         : func_convert_path_X_to_Y ()
++# where, for any given $build/$host combination the 'X_to_Y' value is the
++# same.  If conversion functions are added for new $build/$host combinations,
++# the two new functions must follow this pattern, or func_init_to_host_path_cmd
++# will break.
++
++
++# func_init_to_host_path_cmd
++# Ensures that function "pointer" variable $to_host_path_cmd is set to the
++# appropriate value, based on the value of $to_host_file_cmd.
++to_host_path_cmd=
++func_init_to_host_path_cmd ()
++{
++  $opt_debug
++  if test -z "$to_host_path_cmd"; then
++    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
++    to_host_path_cmd="func_convert_path_${func_stripname_result}"
++  fi
++}
++
++
++# func_to_host_path ARG
++# Converts the path ARG from $build format to $host format. Return result
++# in func_to_host_path_result.
++func_to_host_path ()
++{
++  $opt_debug
++  func_init_to_host_path_cmd
++  $to_host_path_cmd "$1"
++}
++# end func_to_host_path
++
++
++# func_convert_path_noop ARG
++# Copy ARG to func_to_host_path_result.
++func_convert_path_noop ()
++{
++  func_to_host_path_result="$1"
++}
++# end func_convert_path_noop
++
++
++# func_convert_path_msys_to_w32 ARG
++# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
++# conversion to w32 is not available inside the cwrapper.  Returns result in
++# func_to_host_path_result.
++func_convert_path_msys_to_w32 ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # Remove leading and trailing path separator characters from ARG.  MSYS
++    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
++    # and winepath ignores them completely.
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
++    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
++    func_convert_path_check : ";" \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++  fi
++}
++# end func_convert_path_msys_to_w32
++
++
++# func_convert_path_cygwin_to_w32 ARG
++# Convert path ARG from Cygwin to w32 format.  Returns result in
++# func_to_host_file_result.
++func_convert_path_cygwin_to_w32 ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # See func_convert_path_msys_to_w32:
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
++    func_convert_path_check : ";" \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++  fi
++}
++# end func_convert_path_cygwin_to_w32
++
++
++# func_convert_path_nix_to_w32 ARG
++# Convert path ARG from *nix to w32 format.  Requires a wine environment and
++# a working winepath.  Returns result in func_to_host_file_result.
++func_convert_path_nix_to_w32 ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # See func_convert_path_msys_to_w32:
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
++    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
++    func_convert_path_check : ";" \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
++  fi
++}
++# end func_convert_path_nix_to_w32
++
++
++# func_convert_path_msys_to_cygwin ARG
++# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
++# Returns result in func_to_host_file_result.
++func_convert_path_msys_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # See func_convert_path_msys_to_w32:
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
++    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
++    func_to_host_path_result="$func_cygpath_result"
++    func_convert_path_check : : \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
++  fi
++}
++# end func_convert_path_msys_to_cygwin
++
++
++# func_convert_path_nix_to_cygwin ARG
++# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
++# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
++# func_to_host_file_result.
++func_convert_path_nix_to_cygwin ()
++{
++  $opt_debug
++  func_to_host_path_result="$1"
++  if test -n "$1"; then
++    # Remove leading and trailing path separator characters from
++    # ARG. msys behavior is inconsistent here, cygpath turns them
++    # into '.;' and ';.', and winepath ignores them completely.
++    func_stripname : : "$1"
++    func_to_host_path_tmp1=$func_stripname_result
++    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
++    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
++    func_to_host_path_result="$func_cygpath_result"
++    func_convert_path_check : : \
++      "$func_to_host_path_tmp1" "$func_to_host_path_result"
++    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
++  fi
++}
++# end func_convert_path_nix_to_cygwin
++
++
+ # func_mode_compile arg...
+ func_mode_compile ()
+ {
+@@ -1314,12 +1985,12 @@ func_mode_compile ()
+ 	  ;;
+ 
+ 	-pie | -fpie | -fPIE)
+-          pie_flag="$pie_flag $arg"
++          func_append pie_flag " $arg"
+ 	  continue
+ 	  ;;
+ 
+ 	-shared | -static | -prefer-pic | -prefer-non-pic)
+-	  later="$later $arg"
++	  func_append later " $arg"
+ 	  continue
+ 	  ;;
+ 
+@@ -1340,15 +2011,14 @@ func_mode_compile ()
+ 	  save_ifs="$IFS"; IFS=','
+ 	  for arg in $args; do
+ 	    IFS="$save_ifs"
+-	    func_quote_for_eval "$arg"
+-	    lastarg="$lastarg $func_quote_for_eval_result"
++	    func_append_quoted lastarg "$arg"
+ 	  done
+ 	  IFS="$save_ifs"
+ 	  func_stripname ' ' '' "$lastarg"
+ 	  lastarg=$func_stripname_result
+ 
+ 	  # Add the arguments to base_compile.
+-	  base_compile="$base_compile $lastarg"
++	  func_append base_compile " $lastarg"
+ 	  continue
+ 	  ;;
+ 
+@@ -1364,8 +2034,7 @@ func_mode_compile ()
+       esac    #  case $arg_mode
+ 
+       # Aesthetically quote the previous argument.
+-      func_quote_for_eval "$lastarg"
+-      base_compile="$base_compile $func_quote_for_eval_result"
++      func_append_quoted base_compile "$lastarg"
+     done # for arg
+ 
+     case $arg_mode in
+@@ -1496,17 +2165,16 @@ compiler."
+ 	$opt_dry_run || $RM $removelist
+ 	exit $EXIT_FAILURE
+       fi
+-      removelist="$removelist $output_obj"
++      func_append removelist " $output_obj"
+       $ECHO "$srcfile" > "$lockfile"
+     fi
+ 
+     $opt_dry_run || $RM $removelist
+-    removelist="$removelist $lockfile"
++    func_append removelist " $lockfile"
+     trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+ 
+-    if test -n "$fix_srcfile_path"; then
+-      eval "srcfile=\"$fix_srcfile_path\""
+-    fi
++    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
++    srcfile=$func_to_tool_file_result
+     func_quote_for_eval "$srcfile"
+     qsrcfile=$func_quote_for_eval_result
+ 
+@@ -1526,7 +2194,7 @@ compiler."
+ 
+       if test -z "$output_obj"; then
+ 	# Place PIC objects in $objdir
+-	command="$command -o $lobj"
++	func_append command " -o $lobj"
+       fi
+ 
+       func_show_eval_locale "$command"	\
+@@ -1573,11 +2241,11 @@ compiler."
+ 	command="$base_compile $qsrcfile $pic_flag"
+       fi
+       if test "$compiler_c_o" = yes; then
+-	command="$command -o $obj"
++	func_append command " -o $obj"
+       fi
+ 
+       # Suppress compiler output if we already did a PIC compilation.
+-      command="$command$suppress_output"
++      func_append command "$suppress_output"
+       func_show_eval_locale "$command" \
+         '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+ 
+@@ -1622,13 +2290,13 @@ compiler."
+ }
+ 
+ $opt_help || {
+-  test "$mode" = compile && func_mode_compile ${1+"$@"}
++  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+ }
+ 
+ func_mode_help ()
+ {
+     # We need to display help for each of the modes.
+-    case $mode in
++    case $opt_mode in
+       "")
+         # Generic help is extracted from the usage comments
+         # at the start of this file.
+@@ -1659,8 +2327,8 @@ This mode accepts the following additional options:
+ 
+   -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+   -no-suppress      do not suppress compiler output for multiple passes
+-  -prefer-pic       try to building PIC objects only
+-  -prefer-non-pic   try to building non-PIC objects only
++  -prefer-pic       try to build PIC objects only
++  -prefer-non-pic   try to build non-PIC objects only
+   -shared           do not build a \`.o' file suitable for static linking
+   -static           only build a \`.o' file suitable for static linking
+   -Wc,FLAG          pass FLAG directly to the compiler
+@@ -1804,7 +2472,7 @@ Otherwise, only FILE itself is deleted using RM."
+         ;;
+ 
+       *)
+-        func_fatal_help "invalid operation mode \`$mode'"
++        func_fatal_help "invalid operation mode \`$opt_mode'"
+         ;;
+     esac
+ 
+@@ -1819,13 +2487,13 @@ if $opt_help; then
+   else
+     {
+       func_help noexit
+-      for mode in compile link execute install finish uninstall clean; do
++      for opt_mode in compile link execute install finish uninstall clean; do
+ 	func_mode_help
+       done
+     } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+     {
+       func_help noexit
+-      for mode in compile link execute install finish uninstall clean; do
++      for opt_mode in compile link execute install finish uninstall clean; do
+ 	echo
+ 	func_mode_help
+       done
+@@ -1854,13 +2522,16 @@ func_mode_execute ()
+       func_fatal_help "you must specify a COMMAND"
+ 
+     # Handle -dlopen flags immediately.
+-    for file in $execute_dlfiles; do
++    for file in $opt_dlopen; do
+       test -f "$file" \
+ 	|| func_fatal_help "\`$file' is not a file"
+ 
+       dir=
+       case $file in
+       *.la)
++	func_resolve_sysroot "$file"
++	file=$func_resolve_sysroot_result
++
+ 	# Check to see that this really is a libtool archive.
+ 	func_lalib_unsafe_p "$file" \
+ 	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+@@ -1882,7 +2553,7 @@ func_mode_execute ()
+ 	dir="$func_dirname_result"
+ 
+ 	if test -f "$dir/$objdir/$dlname"; then
+-	  dir="$dir/$objdir"
++	  func_append dir "/$objdir"
+ 	else
+ 	  if test ! -f "$dir/$dlname"; then
+ 	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+@@ -1907,10 +2578,10 @@ func_mode_execute ()
+       test -n "$absdir" && dir="$absdir"
+ 
+       # Now add the directory to shlibpath_var.
+-      if eval test -z \"\$$shlibpath_var\"; then
+-	eval $shlibpath_var=\$dir
++      if eval "test -z \"\$$shlibpath_var\""; then
++	eval "$shlibpath_var=\"\$dir\""
+       else
+-	eval $shlibpath_var=\$dir:\$$shlibpath_var
++	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+       fi
+     done
+ 
+@@ -1939,8 +2610,7 @@ func_mode_execute ()
+ 	;;
+       esac
+       # Quote arguments (to preserve shell metacharacters).
+-      func_quote_for_eval "$file"
+-      args="$args $func_quote_for_eval_result"
++      func_append_quoted args "$file"
+     done
+ 
+     if test "X$opt_dry_run" = Xfalse; then
+@@ -1972,22 +2642,59 @@ func_mode_execute ()
+     fi
+ }
+ 
+-test "$mode" = execute && func_mode_execute ${1+"$@"}
++test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+ 
+ 
+ # func_mode_finish arg...
+ func_mode_finish ()
+ {
+     $opt_debug
+-    libdirs="$nonopt"
++    libs=
++    libdirs=
+     admincmds=
+ 
+-    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+-      for dir
+-      do
+-	libdirs="$libdirs $dir"
+-      done
++    for opt in "$nonopt" ${1+"$@"}
++    do
++      if test -d "$opt"; then
++	func_append libdirs " $opt"
+ 
++      elif test -f "$opt"; then
++	if func_lalib_unsafe_p "$opt"; then
++	  func_append libs " $opt"
++	else
++	  func_warning "\`$opt' is not a valid libtool archive"
++	fi
++
++      else
++	func_fatal_error "invalid argument \`$opt'"
++      fi
++    done
++
++    if test -n "$libs"; then
++      if test -n "$lt_sysroot"; then
++        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
++        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
++      else
++        sysroot_cmd=
++      fi
++
++      # Remove sysroot references
++      if $opt_dry_run; then
++        for lib in $libs; do
++          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
++        done
++      else
++        tmpdir=`func_mktempdir`
++        for lib in $libs; do
++	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
++	    > $tmpdir/tmp-la
++	  mv -f $tmpdir/tmp-la $lib
++	done
++        ${RM}r "$tmpdir"
++      fi
++    fi
++
++    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+       for libdir in $libdirs; do
+ 	if test -n "$finish_cmds"; then
+ 	  # Do each command in the finish commands.
+@@ -1997,7 +2704,7 @@ func_mode_finish ()
+ 	if test -n "$finish_eval"; then
+ 	  # Do the single finish_eval.
+ 	  eval cmds=\"$finish_eval\"
+-	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
++	  $opt_dry_run || eval "$cmds" || func_append admincmds "
+        $cmds"
+ 	fi
+       done
+@@ -2006,53 +2713,55 @@ func_mode_finish ()
+     # Exit here if they wanted silent mode.
+     $opt_silent && exit $EXIT_SUCCESS
+ 
+-    echo "----------------------------------------------------------------------"
+-    echo "Libraries have been installed in:"
+-    for libdir in $libdirs; do
+-      $ECHO "   $libdir"
+-    done
+-    echo
+-    echo "If you ever happen to want to link against installed libraries"
+-    echo "in a given directory, LIBDIR, you must either use libtool, and"
+-    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+-    echo "flag during linking and do at least one of the following:"
+-    if test -n "$shlibpath_var"; then
+-      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+-      echo "     during execution"
+-    fi
+-    if test -n "$runpath_var"; then
+-      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+-      echo "     during linking"
+-    fi
+-    if test -n "$hardcode_libdir_flag_spec"; then
+-      libdir=LIBDIR
+-      eval "flag=\"$hardcode_libdir_flag_spec\""
++    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
++      echo "----------------------------------------------------------------------"
++      echo "Libraries have been installed in:"
++      for libdir in $libdirs; do
++	$ECHO "   $libdir"
++      done
++      echo
++      echo "If you ever happen to want to link against installed libraries"
++      echo "in a given directory, LIBDIR, you must either use libtool, and"
++      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
++      echo "flag during linking and do at least one of the following:"
++      if test -n "$shlibpath_var"; then
++	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
++	echo "     during execution"
++      fi
++      if test -n "$runpath_var"; then
++	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
++	echo "     during linking"
++      fi
++      if test -n "$hardcode_libdir_flag_spec"; then
++	libdir=LIBDIR
++	eval flag=\"$hardcode_libdir_flag_spec\"
+ 
+-      $ECHO "   - use the \`$flag' linker flag"
+-    fi
+-    if test -n "$admincmds"; then
+-      $ECHO "   - have your system administrator run these commands:$admincmds"
+-    fi
+-    if test -f /etc/ld.so.conf; then
+-      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+-    fi
+-    echo
++	$ECHO "   - use the \`$flag' linker flag"
++      fi
++      if test -n "$admincmds"; then
++	$ECHO "   - have your system administrator run these commands:$admincmds"
++      fi
++      if test -f /etc/ld.so.conf; then
++	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
++      fi
++      echo
+ 
+-    echo "See any operating system documentation about shared libraries for"
+-    case $host in
+-      solaris2.[6789]|solaris2.1[0-9])
+-        echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+-	echo "pages."
+-	;;
+-      *)
+-        echo "more information, such as the ld(1) and ld.so(8) manual pages."
+-        ;;
+-    esac
+-    echo "----------------------------------------------------------------------"
++      echo "See any operating system documentation about shared libraries for"
++      case $host in
++	solaris2.[6789]|solaris2.1[0-9])
++	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
++	  echo "pages."
++	  ;;
++	*)
++	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
++	  ;;
++      esac
++      echo "----------------------------------------------------------------------"
++    fi
+     exit $EXIT_SUCCESS
+ }
+ 
+-test "$mode" = finish && func_mode_finish ${1+"$@"}
++test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+ 
+ 
+ # func_mode_install arg...
+@@ -2077,7 +2786,7 @@ func_mode_install ()
+     # The real first argument should be the name of the installation program.
+     # Aesthetically quote it.
+     func_quote_for_eval "$arg"
+-    install_prog="$install_prog$func_quote_for_eval_result"
++    func_append install_prog "$func_quote_for_eval_result"
+     install_shared_prog=$install_prog
+     case " $install_prog " in
+       *[\\\ /]cp\ *) install_cp=: ;;
+@@ -2097,7 +2806,7 @@ func_mode_install ()
+     do
+       arg2=
+       if test -n "$dest"; then
+-	files="$files $dest"
++	func_append files " $dest"
+ 	dest=$arg
+ 	continue
+       fi
+@@ -2135,11 +2844,11 @@ func_mode_install ()
+ 
+       # Aesthetically quote the argument.
+       func_quote_for_eval "$arg"
+-      install_prog="$install_prog $func_quote_for_eval_result"
++      func_append install_prog " $func_quote_for_eval_result"
+       if test -n "$arg2"; then
+ 	func_quote_for_eval "$arg2"
+       fi
+-      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
++      func_append install_shared_prog " $func_quote_for_eval_result"
+     done
+ 
+     test -z "$install_prog" && \
+@@ -2151,7 +2860,7 @@ func_mode_install ()
+     if test -n "$install_override_mode" && $no_mode; then
+       if $install_cp; then :; else
+ 	func_quote_for_eval "$install_override_mode"
+-	install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
++	func_append install_shared_prog " -m $func_quote_for_eval_result"
+       fi
+     fi
+ 
+@@ -2209,10 +2918,13 @@ func_mode_install ()
+       case $file in
+       *.$libext)
+ 	# Do the static libraries later.
+-	staticlibs="$staticlibs $file"
++	func_append staticlibs " $file"
+ 	;;
+ 
+       *.la)
++	func_resolve_sysroot "$file"
++	file=$func_resolve_sysroot_result
++
+ 	# Check to see that this really is a libtool archive.
+ 	func_lalib_unsafe_p "$file" \
+ 	  || func_fatal_help "\`$file' is not a valid libtool archive"
+@@ -2226,23 +2938,30 @@ func_mode_install ()
+ 	if test "X$destdir" = "X$libdir"; then
+ 	  case "$current_libdirs " in
+ 	  *" $libdir "*) ;;
+-	  *) current_libdirs="$current_libdirs $libdir" ;;
++	  *) func_append current_libdirs " $libdir" ;;
+ 	  esac
+ 	else
+ 	  # Note the libdir as a future libdir.
+ 	  case "$future_libdirs " in
+ 	  *" $libdir "*) ;;
+-	  *) future_libdirs="$future_libdirs $libdir" ;;
++	  *) func_append future_libdirs " $libdir" ;;
+ 	  esac
+ 	fi
+ 
+ 	func_dirname "$file" "/" ""
+ 	dir="$func_dirname_result"
+-	dir="$dir$objdir"
++	func_append dir "$objdir"
+ 
+ 	if test -n "$relink_command"; then
++      # Strip any trailing slash from the destination.
++      func_stripname '' '/' "$libdir"
++      destlibdir=$func_stripname_result
++
++      func_stripname '' '/' "$destdir"
++      s_destdir=$func_stripname_result
++
+ 	  # Determine the prefix the user has applied to our future dir.
+-	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
++	  inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
+ 
+ 	  # Don't allow the user to place us outside of our expected
+ 	  # location b/c this prevents finding dependent libraries that
+@@ -2315,7 +3034,7 @@ func_mode_install ()
+ 	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+ 
+ 	# Maybe install the static library, too.
+-	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
++	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+ 	;;
+ 
+       *.lo)
+@@ -2503,7 +3222,7 @@ func_mode_install ()
+     test -n "$future_libdirs" && \
+       func_warning "remember to run \`$progname --finish$future_libdirs'"
+ 
+-    if test -n "$current_libdirs" && $opt_finish; then
++    if test -n "$current_libdirs"; then
+       # Maybe just do a dry run.
+       $opt_dry_run && current_libdirs=" -n$current_libdirs"
+       exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+@@ -2512,7 +3231,7 @@ func_mode_install ()
+     fi
+ }
+ 
+-test "$mode" = install && func_mode_install ${1+"$@"}
++test "$opt_mode" = install && func_mode_install ${1+"$@"}
+ 
+ 
+ # func_generate_dlsyms outputname originator pic_p
+@@ -2559,6 +3278,18 @@ extern \"C\" {
+ #pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+ #endif
+ 
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ /* External symbol declarations for the compiler. */\
+ "
+ 
+@@ -2570,21 +3301,22 @@ extern \"C\" {
+ 	  # Add our own program objects to the symbol list.
+ 	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+ 	  for progfile in $progfiles; do
+-	    func_verbose "extracting global C symbols from \`$progfile'"
+-	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
++	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
++	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
++	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+ 	  done
+ 
+ 	  if test -n "$exclude_expsyms"; then
+ 	    $opt_dry_run || {
+-	      $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+-	      $MV "$nlist"T "$nlist"
++	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
++	      eval '$MV "$nlist"T "$nlist"'
+ 	    }
+ 	  fi
+ 
+ 	  if test -n "$export_symbols_regex"; then
+ 	    $opt_dry_run || {
+-	      $EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T
+-	      $MV "$nlist"T "$nlist"
++	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
++	      eval '$MV "$nlist"T "$nlist"'
+ 	    }
+ 	  fi
+ 
+@@ -2593,23 +3325,23 @@ extern \"C\" {
+ 	    export_symbols="$output_objdir/$outputname.exp"
+ 	    $opt_dry_run || {
+ 	      $RM $export_symbols
+-	      ${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' < "$nlist" > "$export_symbols"
++	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ 	      case $host in
+ 	      *cygwin* | *mingw* | *cegcc* )
+-                echo EXPORTS > "$output_objdir/$outputname.def"
+-                cat "$export_symbols" >> "$output_objdir/$outputname.def"
++                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
++                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ 	        ;;
+ 	      esac
+ 	    }
+ 	  else
+ 	    $opt_dry_run || {
+-	      ${SED} -e 's/\([].[*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/' < "$export_symbols" > "$output_objdir/$outputname.exp"
+-	      $GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T
+-	      $MV "$nlist"T "$nlist"
++	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
++	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
++	      eval '$MV "$nlist"T "$nlist"'
+ 	      case $host in
+ 	        *cygwin* | *mingw* | *cegcc* )
+-	          echo EXPORTS > "$output_objdir/$outputname.def"
+-	          cat "$nlist" >> "$output_objdir/$outputname.def"
++	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
++	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ 	          ;;
+ 	      esac
+ 	    }
+@@ -2620,10 +3352,52 @@ extern \"C\" {
+ 	  func_verbose "extracting global C symbols from \`$dlprefile'"
+ 	  func_basename "$dlprefile"
+ 	  name="$func_basename_result"
+-	  $opt_dry_run || {
+-	    $ECHO ": $name " >> "$nlist"
+-	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+-	  }
++          case $host in
++	    *cygwin* | *mingw* | *cegcc* )
++	      # if an import library, we need to obtain dlname
++	      if func_win32_import_lib_p "$dlprefile"; then
++	        func_tr_sh "$dlprefile"
++	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
++	        dlprefile_dlbasename=""
++	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
++	          # Use subshell, to avoid clobbering current variable values
++	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
++	          if test -n "$dlprefile_dlname" ; then
++	            func_basename "$dlprefile_dlname"
++	            dlprefile_dlbasename="$func_basename_result"
++	          else
++	            # no lafile. user explicitly requested -dlpreopen <import library>.
++	            $sharedlib_from_linklib_cmd "$dlprefile"
++	            dlprefile_dlbasename=$sharedlib_from_linklib_result
++	          fi
++	        fi
++	        $opt_dry_run || {
++	          if test -n "$dlprefile_dlbasename" ; then
++	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
++	          else
++	            func_warning "Could not compute DLL name from $name"
++	            eval '$ECHO ": $name " >> "$nlist"'
++	          fi
++	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
++	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
++	        }
++	      else # not an import lib
++	        $opt_dry_run || {
++	          eval '$ECHO ": $name " >> "$nlist"'
++	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
++	        }
++	      fi
++	    ;;
++	    *)
++	      $opt_dry_run || {
++	        eval '$ECHO ": $name " >> "$nlist"'
++	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
++	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
++	      }
++	    ;;
++          esac
+ 	done
+ 
+ 	$opt_dry_run || {
+@@ -2661,26 +3435,9 @@ typedef struct {
+   const char *name;
+   void *address;
+ } lt_dlsymlist;
+-"
+-	  case $host in
+-	  *cygwin* | *mingw* | *cegcc* )
+-	    echo >> "$output_objdir/$my_dlsyms" "\
+-/* DATA imports from DLLs on WIN32 con't be const, because
+-   runtime relocations are performed -- see ld's documentation
+-   on pseudo-relocs.  */"
+-	    lt_dlsym_const= ;;
+-	  *osf5*)
+-	    echo >> "$output_objdir/$my_dlsyms" "\
+-/* This system does not cope well with relocations in const data */"
+-	    lt_dlsym_const= ;;
+-	  *)
+-	    lt_dlsym_const=const ;;
+-	  esac
+-
+-	  echo >> "$output_objdir/$my_dlsyms" "\
+-extern $lt_dlsym_const lt_dlsymlist
++extern LT_DLSYM_CONST lt_dlsymlist
+ lt_${my_prefix}_LTX_preloaded_symbols[];
+-$lt_dlsym_const lt_dlsymlist
++LT_DLSYM_CONST lt_dlsymlist
+ lt_${my_prefix}_LTX_preloaded_symbols[] =
+ {\
+   { \"$my_originator\", (void *) 0 },"
+@@ -2736,7 +3493,7 @@ static const void *lt_preloaded_setup() {
+ 	for arg in $LTCFLAGS; do
+ 	  case $arg in
+ 	  -pie | -fpie | -fPIE) ;;
+-	  *) symtab_cflags="$symtab_cflags $arg" ;;
++	  *) func_append symtab_cflags " $arg" ;;
+ 	  esac
+ 	done
+ 
+@@ -2796,9 +3553,11 @@ func_win32_libid ()
+     win32_libid_type="x86 archive import"
+     ;;
+   *ar\ archive*) # could be an import, or static
+-    if $OBJDUMP -f "$1" | $SED -e '10q' 2>/dev/null |
+-       $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+-      win32_nmres=`$NM -f posix -A "$1" |
++    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
++    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
++       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
++      func_to_tool_file "$1" func_convert_file_msys_to_w32
++      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ 	$SED -n -e '
+ 	    1,100{
+ 		/ I /{
+@@ -2827,6 +3586,131 @@ func_win32_libid ()
+   $ECHO "$win32_libid_type"
+ }
+ 
++# func_cygming_dll_for_implib ARG
++#
++# Platform-specific function to extract the
++# name of the DLL associated with the specified
++# import library ARG.
++# Invoked by eval'ing the libtool variable
++#    $sharedlib_from_linklib_cmd
++# Result is available in the variable
++#    $sharedlib_from_linklib_result
++func_cygming_dll_for_implib ()
++{
++  $opt_debug
++  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
++}
++
++# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
++#
++# The is the core of a fallback implementation of a
++# platform-specific function to extract the name of the
++# DLL associated with the specified import library LIBNAME.
++#
++# SECTION_NAME is either .idata$6 or .idata$7, depending
++# on the platform and compiler that created the implib.
++#
++# Echos the name of the DLL associated with the
++# specified import library.
++func_cygming_dll_for_implib_fallback_core ()
++{
++  $opt_debug
++  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
++  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
++    $SED '/^Contents of section '"$match_literal"':/{
++      # Place marker at beginning of archive member dllname section
++      s/.*/====MARK====/
++      p
++      d
++    }
++    # These lines can sometimes be longer than 43 characters, but
++    # are always uninteresting
++    /:[	 ]*file format pe[i]\{,1\}-/d
++    /^In archive [^:]*:/d
++    # Ensure marker is printed
++    /^====MARK====/p
++    # Remove all lines with less than 43 characters
++    /^.\{43\}/!d
++    # From remaining lines, remove first 43 characters
++    s/^.\{43\}//' |
++    $SED -n '
++      # Join marker and all lines until next marker into a single line
++      /^====MARK====/ b para
++      H
++      $ b para
++      b
++      :para
++      x
++      s/\n//g
++      # Remove the marker
++      s/^====MARK====//
++      # Remove trailing dots and whitespace
++      s/[\. \t]*$//
++      # Print
++      /./p' |
++    # we now have a list, one entry per line, of the stringified
++    # contents of the appropriate section of all members of the
++    # archive which possess that section. Heuristic: eliminate
++    # all those which have a first or second character that is
++    # a '.' (that is, objdump's representation of an unprintable
++    # character.) This should work for all archives with less than
++    # 0x302f exports -- but will fail for DLLs whose name actually
++    # begins with a literal '.' or a single character followed by
++    # a '.'.
++    #
++    # Of those that remain, print the first one.
++    $SED -e '/^\./d;/^.\./d;q'
++}
++
++# func_cygming_gnu_implib_p ARG
++# This predicate returns with zero status (TRUE) if
++# ARG is a GNU/binutils-style import library. Returns
++# with nonzero status (FALSE) otherwise.
++func_cygming_gnu_implib_p ()
++{
++  $opt_debug
++  func_to_tool_file "$1" func_convert_file_msys_to_w32
++  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
++  test -n "$func_cygming_gnu_implib_tmp"
++}
++
++# func_cygming_ms_implib_p ARG
++# This predicate returns with zero status (TRUE) if
++# ARG is an MS-style import library. Returns
++# with nonzero status (FALSE) otherwise.
++func_cygming_ms_implib_p ()
++{
++  $opt_debug
++  func_to_tool_file "$1" func_convert_file_msys_to_w32
++  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
++  test -n "$func_cygming_ms_implib_tmp"
++}
++
++# func_cygming_dll_for_implib_fallback ARG
++# Platform-specific function to extract the
++# name of the DLL associated with the specified
++# import library ARG.
++#
++# This fallback implementation is for use when $DLLTOOL
++# does not support the --identify-strict option.
++# Invoked by eval'ing the libtool variable
++#    $sharedlib_from_linklib_cmd
++# Result is available in the variable
++#    $sharedlib_from_linklib_result
++func_cygming_dll_for_implib_fallback ()
++{
++  $opt_debug
++  if func_cygming_gnu_implib_p "$1" ; then
++    # binutils import library
++    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
++  elif func_cygming_ms_implib_p "$1" ; then
++    # ms-generated import library
++    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
++  else
++    # unknown
++    sharedlib_from_linklib_result=""
++  fi
++}
+ 
+ 
+ # func_extract_an_archive dir oldlib
+@@ -2917,7 +3801,7 @@ func_extract_archives ()
+ 	    darwin_file=
+ 	    darwin_files=
+ 	    for darwin_file in $darwin_filelist; do
+-	      darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
++	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+ 	      $LIPO -create -output "$darwin_file" $darwin_files
+ 	    done # $darwin_filelist
+ 	    $RM -rf unfat-$$
+@@ -2932,7 +3816,7 @@ func_extract_archives ()
+         func_extract_an_archive "$my_xdir" "$my_xabs"
+ 	;;
+       esac
+-      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
++      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+     done
+ 
+     func_extract_archives_result="$my_oldobjs"
+@@ -3014,7 +3898,110 @@ func_fallback_echo ()
+ _LTECHO_EOF'
+ }
+     ECHO=\"$qECHO\"
+-  fi\
++  fi
++
++# Very basic option parsing. These options are (a) specific to
++# the libtool wrapper, (b) are identical between the wrapper
++# /script/ and the wrapper /executable/ which is used only on
++# windows platforms, and (c) all begin with the string "--lt-"
++# (application programs are unlikely to have options which match
++# this pattern).
++#
++# There are only two supported options: --lt-debug and
++# --lt-dump-script. There is, deliberately, no --lt-help.
++#
++# The first argument to this parsing function should be the
++# script's $0 value, followed by "$@".
++lt_option_debug=
++func_parse_lt_options ()
++{
++  lt_script_arg0=\$0
++  shift
++  for lt_opt
++  do
++    case \"\$lt_opt\" in
++    --lt-debug) lt_option_debug=1 ;;
++    --lt-dump-script)
++        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
++        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
++        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
++        cat \"\$lt_dump_D/\$lt_dump_F\"
++        exit 0
++      ;;
++    --lt-*)
++        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
++        exit 1
++      ;;
++    esac
++  done
++
++  # Print the debug banner immediately:
++  if test -n \"\$lt_option_debug\"; then
++    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
++  fi
++}
++
++# Used when --lt-debug. Prints its arguments to stdout
++# (redirection is the responsibility of the caller)
++func_lt_dump_args ()
++{
++  lt_dump_args_N=1;
++  for lt_arg
++  do
++    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
++    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
++  done
++}
++
++# Core function for launching the target application
++func_exec_program_core ()
++{
++"
++  case $host in
++  # Backslashes separate directories on plain windows
++  *-*-mingw | *-*-os2* | *-cegcc*)
++    $ECHO "\
++      if test -n \"\$lt_option_debug\"; then
++        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
++        func_lt_dump_args \${1+\"\$@\"} 1>&2
++      fi
++      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
++"
++    ;;
++
++  *)
++    $ECHO "\
++      if test -n \"\$lt_option_debug\"; then
++        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
++        func_lt_dump_args \${1+\"\$@\"} 1>&2
++      fi
++      exec \"\$progdir/\$program\" \${1+\"\$@\"}
++"
++    ;;
++  esac
++  $ECHO "\
++      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
++      exit 1
++}
++
++# A function to encapsulate launching the target application
++# Strips options in the --lt-* namespace from \$@ and
++# launches target application with the remaining arguments.
++func_exec_program ()
++{
++  for lt_wr_arg
++  do
++    case \$lt_wr_arg in
++    --lt-*) ;;
++    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
++    esac
++    shift
++  done
++  func_exec_program_core \${1+\"\$@\"}
++}
++
++  # Parse options
++  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+ 
+   # Find the directory that this script lives in.
+   thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+@@ -3078,7 +4065,7 @@ _LTECHO_EOF'
+ 
+     # relink executable if necessary
+     if test -n \"\$relink_command\"; then
+-      if relink_command_output=\`eval \"\$relink_command\" 2>&1\`; then :
++      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+       else
+ 	$ECHO \"\$relink_command_output\" >&2
+ 	$RM \"\$progdir/\$file\"
+@@ -3102,6 +4089,18 @@ _LTECHO_EOF'
+ 
+   if test -f \"\$progdir/\$program\"; then"
+ 
++	# fixup the dll searchpath if we need to.
++	#
++	# Fix the DLL searchpath if we need to.  Do this before prepending
++	# to shlibpath, because on Windows, both are PATH and uninstalled
++	# libraries must come first.
++	if test -n "$dllsearchpath"; then
++	  $ECHO "\
++    # Add the dll search path components to the executable PATH
++    PATH=$dllsearchpath:\$PATH
++"
++	fi
++
+ 	# Export our shlibpath_var if we have one.
+ 	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ 	  $ECHO "\
+@@ -3116,35 +4115,10 @@ _LTECHO_EOF'
+ "
+ 	fi
+ 
+-	# fixup the dll searchpath if we need to.
+-	if test -n "$dllsearchpath"; then
+-	  $ECHO "\
+-    # Add the dll search path components to the executable PATH
+-    PATH=$dllsearchpath:\$PATH
+-"
+-	fi
+-
+ 	$ECHO "\
+     if test \"\$libtool_execute_magic\" != \"$magic\"; then
+       # Run the actual program with our arguments.
+-"
+-	case $host in
+-	# Backslashes separate directories on plain windows
+-	*-*-mingw | *-*-os2* | *-cegcc*)
+-	  $ECHO "\
+-      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+-"
+-	  ;;
+-
+-	*)
+-	  $ECHO "\
+-      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+-"
+-	  ;;
+-	esac
+-	$ECHO "\
+-      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+-      exit 1
++      func_exec_program \${1+\"\$@\"}
+     fi
+   else
+     # The program doesn't exist.
+@@ -3158,166 +4132,6 @@ fi\
+ }
+ 
+ 
+-# func_to_host_path arg
+-#
+-# Convert paths to host format when used with build tools.
+-# Intended for use with "native" mingw (where libtool itself
+-# is running under the msys shell), or in the following cross-
+-# build environments:
+-#    $build          $host
+-#    mingw (msys)    mingw  [e.g. native]
+-#    cygwin          mingw
+-#    *nix + wine     mingw
+-# where wine is equipped with the `winepath' executable.
+-# In the native mingw case, the (msys) shell automatically
+-# converts paths for any non-msys applications it launches,
+-# but that facility isn't available from inside the cwrapper.
+-# Similar accommodations are necessary for $host mingw and
+-# $build cygwin.  Calling this function does no harm for other
+-# $host/$build combinations not listed above.
+-#
+-# ARG is the path (on $build) that should be converted to
+-# the proper representation for $host. The result is stored
+-# in $func_to_host_path_result.
+-func_to_host_path ()
+-{
+-  func_to_host_path_result="$1"
+-  if test -n "$1"; then
+-    case $host in
+-      *mingw* )
+-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+-        case $build in
+-          *mingw* ) # actually, msys
+-            # awkward: cmd appends spaces to result
+-            func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
+-              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          *cygwin* )
+-            func_to_host_path_result=`cygpath -w "$1" |
+-	      $SED -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          * )
+-            # Unfortunately, winepath does not exit with a non-zero
+-            # error code, so we are forced to check the contents of
+-            # stdout. On the other hand, if the command is not
+-            # found, the shell will set an exit code of 127 and print
+-            # *an error message* to stdout. So we must check for both
+-            # error code of zero AND non-empty stdout, which explains
+-            # the odd construction:
+-            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+-            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+-              func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
+-                $SED -e "$lt_sed_naive_backslashify"`
+-            else
+-              # Allow warning below.
+-              func_to_host_path_result=
+-            fi
+-            ;;
+-        esac
+-        if test -z "$func_to_host_path_result" ; then
+-          func_error "Could not determine host path corresponding to"
+-          func_error "  \`$1'"
+-          func_error "Continuing, but uninstalled executables may not work."
+-          # Fallback:
+-          func_to_host_path_result="$1"
+-        fi
+-        ;;
+-    esac
+-  fi
+-}
+-# end: func_to_host_path
+-
+-# func_to_host_pathlist arg
+-#
+-# Convert pathlists to host format when used with build tools.
+-# See func_to_host_path(), above. This function supports the
+-# following $build/$host combinations (but does no harm for
+-# combinations not listed here):
+-#    $build          $host
+-#    mingw (msys)    mingw  [e.g. native]
+-#    cygwin          mingw
+-#    *nix + wine     mingw
+-#
+-# Path separators are also converted from $build format to
+-# $host format. If ARG begins or ends with a path separator
+-# character, it is preserved (but converted to $host format)
+-# on output.
+-#
+-# ARG is a pathlist (on $build) that should be converted to
+-# the proper representation on $host. The result is stored
+-# in $func_to_host_pathlist_result.
+-func_to_host_pathlist ()
+-{
+-  func_to_host_pathlist_result="$1"
+-  if test -n "$1"; then
+-    case $host in
+-      *mingw* )
+-        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+-        # Remove leading and trailing path separator characters from
+-        # ARG. msys behavior is inconsistent here, cygpath turns them
+-        # into '.;' and ';.', and winepath ignores them completely.
+-	func_stripname : : "$1"
+-        func_to_host_pathlist_tmp1=$func_stripname_result
+-        case $build in
+-          *mingw* ) # Actually, msys.
+-            # Awkward: cmd appends spaces to result.
+-            func_to_host_pathlist_result=`
+-	      ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
+-	      $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          *cygwin* )
+-            func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
+-              $SED -e "$lt_sed_naive_backslashify"`
+-            ;;
+-          * )
+-            # unfortunately, winepath doesn't convert pathlists
+-            func_to_host_pathlist_result=""
+-            func_to_host_pathlist_oldIFS=$IFS
+-            IFS=:
+-            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+-              IFS=$func_to_host_pathlist_oldIFS
+-              if test -n "$func_to_host_pathlist_f" ; then
+-                func_to_host_path "$func_to_host_pathlist_f"
+-                if test -n "$func_to_host_path_result" ; then
+-                  if test -z "$func_to_host_pathlist_result" ; then
+-                    func_to_host_pathlist_result="$func_to_host_path_result"
+-                  else
+-                    func_append func_to_host_pathlist_result ";$func_to_host_path_result"
+-                  fi
+-                fi
+-              fi
+-            done
+-            IFS=$func_to_host_pathlist_oldIFS
+-            ;;
+-        esac
+-        if test -z "$func_to_host_pathlist_result"; then
+-          func_error "Could not determine the host path(s) corresponding to"
+-          func_error "  \`$1'"
+-          func_error "Continuing, but uninstalled executables may not work."
+-          # Fallback. This may break if $1 contains DOS-style drive
+-          # specifications. The fix is not to complicate the expression
+-          # below, but for the user to provide a working wine installation
+-          # with winepath so that path translation in the cross-to-mingw
+-          # case works properly.
+-          lt_replace_pathsep_nix_to_dos="s|:|;|g"
+-          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+-            $SED -e "$lt_replace_pathsep_nix_to_dos"`
+-        fi
+-        # Now, add the leading and trailing path separators back
+-        case "$1" in
+-          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+-            ;;
+-        esac
+-        case "$1" in
+-          *: ) func_append func_to_host_pathlist_result ";"
+-            ;;
+-        esac
+-        ;;
+-    esac
+-  fi
+-}
+-# end: func_to_host_pathlist
+-
+ # func_emit_cwrapperexe_src
+ # emit the source code for a wrapper executable on stdout
+ # Must ONLY be called from within func_mode_link because
+@@ -3334,10 +4148,6 @@ func_emit_cwrapperexe_src ()
+ 
+    This wrapper executable should never be moved out of the build directory.
+    If it is, it will not operate correctly.
+-
+-   Currently, it simply execs the wrapper *script* "$SHELL $output",
+-   but could eventually absorb all of the scripts functionality and
+-   exec $objdir/$outputname directly.
+ */
+ EOF
+ 	    cat <<"EOF"
+@@ -3462,22 +4272,13 @@ int setenv (const char *, const char *, int);
+   if (stale) { free ((void *) stale); stale = 0; } \
+ } while (0)
+ 
+-#undef LTWRAPPER_DEBUGPRINTF
+-#if defined LT_DEBUGWRAPPER
+-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
+-static void
+-ltwrapper_debugprintf (const char *fmt, ...)
+-{
+-    va_list args;
+-    va_start (args, fmt);
+-    (void) vfprintf (stderr, fmt, args);
+-    va_end (args);
+-}
++#if defined(LT_DEBUGWRAPPER)
++static int lt_debug = 1;
+ #else
+-# define LTWRAPPER_DEBUGPRINTF(args)
++static int lt_debug = 0;
+ #endif
+ 
+-const char *program_name = NULL;
++const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+ 
+ void *xmalloc (size_t num);
+ char *xstrdup (const char *string);
+@@ -3487,7 +4288,10 @@ char *chase_symlinks (const char *pathspec);
+ int make_executable (const char *path);
+ int check_executable (const char *path);
+ char *strendzap (char *str, const char *pat);
+-void lt_fatal (const char *message, ...);
++void lt_debugprintf (const char *file, int line, const char *fmt, ...);
++void lt_fatal (const char *file, int line, const char *message, ...);
++static const char *nonnull (const char *s);
++static const char *nonempty (const char *s);
+ void lt_setenv (const char *name, const char *value);
+ char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+ void lt_update_exe_path (const char *name, const char *value);
+@@ -3497,14 +4301,14 @@ void lt_dump_script (FILE *f);
+ EOF
+ 
+ 	    cat <<EOF
+-const char * MAGIC_EXE = "$magic_exe";
++volatile const char * MAGIC_EXE = "$magic_exe";
+ const char * LIB_PATH_VARNAME = "$shlibpath_var";
+ EOF
+ 
+ 	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+-              func_to_host_pathlist "$temp_rpath"
++              func_to_host_path "$temp_rpath"
+ 	      cat <<EOF
+-const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
++const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
+ EOF
+ 	    else
+ 	      cat <<"EOF"
+@@ -3513,10 +4317,10 @@ EOF
+ 	    fi
+ 
+ 	    if test -n "$dllsearchpath"; then
+-              func_to_host_pathlist "$dllsearchpath:"
++              func_to_host_path "$dllsearchpath:"
+ 	      cat <<EOF
+ const char * EXE_PATH_VARNAME = "PATH";
+-const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
++const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
+ EOF
+ 	    else
+ 	      cat <<"EOF"
+@@ -3539,12 +4343,10 @@ EOF
+ 	    cat <<"EOF"
+ 
+ #define LTWRAPPER_OPTION_PREFIX         "--lt-"
+-#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
+ 
+-static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
+ static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+-
+ static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
++static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+ 
+ int
+ main (int argc, char *argv[])
+@@ -3561,10 +4363,13 @@ main (int argc, char *argv[])
+   int i;
+ 
+   program_name = (char *) xstrdup (base_name (argv[0]));
+-  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
+-  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
++  newargz = XMALLOC (char *, argc + 1);
+ 
+-  /* very simple arg parsing; don't want to rely on getopt */
++  /* very simple arg parsing; don't want to rely on getopt
++   * also, copy all non cwrapper options to newargz, except
++   * argz[0], which is handled differently
++   */
++  newargc=0;
+   for (i = 1; i < argc; i++)
+     {
+       if (strcmp (argv[i], dumpscript_opt) == 0)
+@@ -3581,21 +4386,54 @@ EOF
+ 	  lt_dump_script (stdout);
+ 	  return 0;
+ 	}
++      if (strcmp (argv[i], debug_opt) == 0)
++	{
++          lt_debug = 1;
++          continue;
++	}
++      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
++        {
++          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
++             namespace, but it is not one of the ones we know about and
++             have already dealt with, above (inluding dump-script), then
++             report an error. Otherwise, targets might begin to believe
++             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
++             namespace. The first time any user complains about this, we'll
++             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
++             or a configure.ac-settable value.
++           */
++          lt_fatal (__FILE__, __LINE__,
++		    "unrecognized %s option: '%s'",
++                    ltwrapper_option_prefix, argv[i]);
++        }
++      /* otherwise ... */
++      newargz[++newargc] = xstrdup (argv[i]);
+     }
++  newargz[++newargc] = NULL;
++
++EOF
++	    cat <<EOF
++  /* The GNU banner must be the first non-error debug message */
++  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
++EOF
++	    cat <<"EOF"
++  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
++  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+ 
+-  newargz = XMALLOC (char *, argc + 1);
+   tmp_pathspec = find_executable (argv[0]);
+   if (tmp_pathspec == NULL)
+-    lt_fatal ("Couldn't find %s", argv[0]);
+-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
+-			  tmp_pathspec));
++    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
++  lt_debugprintf (__FILE__, __LINE__,
++                  "(main) found exe (before symlink chase) at: %s\n",
++		  tmp_pathspec);
+ 
+   actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+-  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
+-			  actual_cwrapper_path));
++  lt_debugprintf (__FILE__, __LINE__,
++                  "(main) found exe (after symlink chase) at: %s\n",
++		  actual_cwrapper_path);
+   XFREE (tmp_pathspec);
+ 
+-  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
++  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+   strendzap (actual_cwrapper_path, actual_cwrapper_name);
+ 
+   /* wrapper name transforms */
+@@ -3613,8 +4451,9 @@ EOF
+   target_name = tmp_pathspec;
+   tmp_pathspec = 0;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
+-			  target_name));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(main) libtool target name: %s\n",
++		  target_name);
+ EOF
+ 
+ 	    cat <<EOF
+@@ -3664,35 +4503,19 @@ EOF
+ 
+   lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+   lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+-  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
++  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
++     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
++     because on Windows, both *_VARNAMEs are PATH but uninstalled
++     libraries must come first. */
+   lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
++  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+ 
+-  newargc=0;
+-  for (i = 1; i < argc; i++)
+-    {
+-      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
+-        {
+-          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+-             namespace, but it is not one of the ones we know about and
+-             have already dealt with, above (inluding dump-script), then
+-             report an error. Otherwise, targets might begin to believe
+-             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+-             namespace. The first time any user complains about this, we'll
+-             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+-             or a configure.ac-settable value.
+-           */
+-          lt_fatal ("Unrecognized option in %s namespace: '%s'",
+-                    ltwrapper_option_prefix, argv[i]);
+-        }
+-      /* otherwise ... */
+-      newargz[++newargc] = xstrdup (argv[i]);
+-    }
+-  newargz[++newargc] = NULL;
+-
+-  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
++		  nonnull (lt_argv_zero));
+   for (i = 0; i < newargc; i++)
+     {
+-      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
++      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
++		      i, nonnull (newargz[i]));
+     }
+ 
+ EOF
+@@ -3706,7 +4529,9 @@ EOF
+   if (rval == -1)
+     {
+       /* failed to start process */
+-      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
++      lt_debugprintf (__FILE__, __LINE__,
++		      "(main) failed to launch target \"%s\": %s\n",
++		      lt_argv_zero, nonnull (strerror (errno)));
+       return 127;
+     }
+   return rval;
+@@ -3728,7 +4553,7 @@ xmalloc (size_t num)
+ {
+   void *p = (void *) malloc (num);
+   if (!p)
+-    lt_fatal ("Memory exhausted");
++    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+ 
+   return p;
+ }
+@@ -3762,8 +4587,8 @@ check_executable (const char *path)
+ {
+   struct stat st;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
+-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
++  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
++                  nonempty (path));
+   if ((!path) || (!*path))
+     return 0;
+ 
+@@ -3780,8 +4605,8 @@ make_executable (const char *path)
+   int rval = 0;
+   struct stat st;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
+-			  path ? (*path ? path : "EMPTY!") : "NULL!"));
++  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
++                  nonempty (path));
+   if ((!path) || (!*path))
+     return 0;
+ 
+@@ -3807,8 +4632,8 @@ find_executable (const char *wrapper)
+   int tmp_len;
+   char *concat_name;
+ 
+-  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
+-			  wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
++  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
++                  nonempty (wrapper));
+ 
+   if ((wrapper == NULL) || (*wrapper == '\0'))
+     return NULL;
+@@ -3861,7 +4686,8 @@ find_executable (const char *wrapper)
+ 		{
+ 		  /* empty path: current directory */
+ 		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+-		    lt_fatal ("getcwd failed");
++		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
++                              nonnull (strerror (errno)));
+ 		  tmp_len = strlen (tmp);
+ 		  concat_name =
+ 		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+@@ -3886,7 +4712,8 @@ find_executable (const char *wrapper)
+     }
+   /* Relative path | not found in path: prepend cwd */
+   if (getcwd (tmp, LT_PATHMAX) == NULL)
+-    lt_fatal ("getcwd failed");
++    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
++              nonnull (strerror (errno)));
+   tmp_len = strlen (tmp);
+   concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+   memcpy (concat_name, tmp, tmp_len);
+@@ -3912,8 +4739,9 @@ chase_symlinks (const char *pathspec)
+   int has_symlinks = 0;
+   while (strlen (tmp_pathspec) && !has_symlinks)
+     {
+-      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
+-			      tmp_pathspec));
++      lt_debugprintf (__FILE__, __LINE__,
++		      "checking path component for symlinks: %s\n",
++		      tmp_pathspec);
+       if (lstat (tmp_pathspec, &s) == 0)
+ 	{
+ 	  if (S_ISLNK (s.st_mode) != 0)
+@@ -3935,8 +4763,9 @@ chase_symlinks (const char *pathspec)
+ 	}
+       else
+ 	{
+-	  char *errstr = strerror (errno);
+-	  lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
++	  lt_fatal (__FILE__, __LINE__,
++		    "error accessing file \"%s\": %s",
++		    tmp_pathspec, nonnull (strerror (errno)));
+ 	}
+     }
+   XFREE (tmp_pathspec);
+@@ -3949,7 +4778,8 @@ chase_symlinks (const char *pathspec)
+   tmp_pathspec = realpath (pathspec, buf);
+   if (tmp_pathspec == 0)
+     {
+-      lt_fatal ("Could not follow symlinks for %s", pathspec);
++      lt_fatal (__FILE__, __LINE__,
++		"could not follow symlinks for %s", pathspec);
+     }
+   return xstrdup (tmp_pathspec);
+ #endif
+@@ -3975,11 +4805,25 @@ strendzap (char *str, const char *pat)
+   return str;
+ }
+ 
++void
++lt_debugprintf (const char *file, int line, const char *fmt, ...)
++{
++  va_list args;
++  if (lt_debug)
++    {
++      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
++      va_start (args, fmt);
++      (void) vfprintf (stderr, fmt, args);
++      va_end (args);
++    }
++}
++
+ static void
+-lt_error_core (int exit_status, const char *mode,
++lt_error_core (int exit_status, const char *file,
++	       int line, const char *mode,
+ 	       const char *message, va_list ap)
+ {
+-  fprintf (stderr, "%s: %s: ", program_name, mode);
++  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+   vfprintf (stderr, message, ap);
+   fprintf (stderr, ".\n");
+ 
+@@ -3988,20 +4832,32 @@ lt_error_core (int exit_status, const char *mode,
+ }
+ 
+ void
+-lt_fatal (const char *message, ...)
++lt_fatal (const char *file, int line, const char *message, ...)
+ {
+   va_list ap;
+   va_start (ap, message);
+-  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
++  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+   va_end (ap);
+ }
+ 
++static const char *
++nonnull (const char *s)
++{
++  return s ? s : "(null)";
++}
++
++static const char *
++nonempty (const char *s)
++{
++  return (s && !*s) ? "(empty)" : nonnull (s);
++}
++
+ void
+ lt_setenv (const char *name, const char *value)
+ {
+-  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
+-                          (name ? name : "<NULL>"),
+-                          (value ? value : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(lt_setenv) setting '%s' to '%s'\n",
++                  nonnull (name), nonnull (value));
+   {
+ #ifdef HAVE_SETENV
+     /* always make a copy, for consistency with !HAVE_SETENV */
+@@ -4049,9 +4905,9 @@ lt_extend_str (const char *orig_value, const char *add, int to_end)
+ void
+ lt_update_exe_path (const char *name, const char *value)
+ {
+-  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+-                          (name ? name : "<NULL>"),
+-                          (value ? value : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
++                  nonnull (name), nonnull (value));
+ 
+   if (name && *name && value && *value)
+     {
+@@ -4070,9 +4926,9 @@ lt_update_exe_path (const char *name, const char *value)
+ void
+ lt_update_lib_path (const char *name, const char *value)
+ {
+-  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+-                          (name ? name : "<NULL>"),
+-                          (value ? value : "<NULL>")));
++  lt_debugprintf (__FILE__, __LINE__,
++		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
++                  nonnull (name), nonnull (value));
+ 
+   if (name && *name && value && *value)
+     {
+@@ -4222,7 +5078,7 @@ EOF
+ func_win32_import_lib_p ()
+ {
+     $opt_debug
+-    case `eval "$file_magic_cmd \"\$1\" 2>/dev/null" | $SED -e 10q` in
++    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+     *import*) : ;;
+     *) false ;;
+     esac
+@@ -4401,9 +5257,9 @@ func_mode_link ()
+ 	    ;;
+ 	  *)
+ 	    if test "$prev" = dlfiles; then
+-	      dlfiles="$dlfiles $arg"
++	      func_append dlfiles " $arg"
+ 	    else
+-	      dlprefiles="$dlprefiles $arg"
++	      func_append dlprefiles " $arg"
+ 	    fi
+ 	    prev=
+ 	    continue
+@@ -4427,7 +5283,7 @@ func_mode_link ()
+ 	    *-*-darwin*)
+ 	      case "$deplibs " in
+ 		*" $qarg.ltframework "*) ;;
+-		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
++		*) func_append deplibs " $qarg.ltframework" # this is fixed later
+ 		   ;;
+ 	      esac
+ 	      ;;
+@@ -4446,7 +5302,7 @@ func_mode_link ()
+ 	    moreargs=
+ 	    for fil in `cat "$save_arg"`
+ 	    do
+-#	      moreargs="$moreargs $fil"
++#	      func_append moreargs " $fil"
+ 	      arg=$fil
+ 	      # A libtool-controlled object.
+ 
+@@ -4475,7 +5331,7 @@ func_mode_link ()
+ 
+ 		  if test "$prev" = dlfiles; then
+ 		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+-		      dlfiles="$dlfiles $pic_object"
++		      func_append dlfiles " $pic_object"
+ 		      prev=
+ 		      continue
+ 		    else
+@@ -4487,7 +5343,7 @@ func_mode_link ()
+ 		  # CHECK ME:  I think I busted this.  -Ossama
+ 		  if test "$prev" = dlprefiles; then
+ 		    # Preload the old-style object.
+-		    dlprefiles="$dlprefiles $pic_object"
++		    func_append dlprefiles " $pic_object"
+ 		    prev=
+ 		  fi
+ 
+@@ -4557,12 +5413,12 @@ func_mode_link ()
+ 	  if test "$prev" = rpath; then
+ 	    case "$rpath " in
+ 	    *" $arg "*) ;;
+-	    *) rpath="$rpath $arg" ;;
++	    *) func_append rpath " $arg" ;;
+ 	    esac
+ 	  else
+ 	    case "$xrpath " in
+ 	    *" $arg "*) ;;
+-	    *) xrpath="$xrpath $arg" ;;
++	    *) func_append xrpath " $arg" ;;
+ 	    esac
+ 	  fi
+ 	  prev=
+@@ -4574,28 +5430,28 @@ func_mode_link ()
+ 	  continue
+ 	  ;;
+ 	weak)
+-	  weak_libs="$weak_libs $arg"
++	  func_append weak_libs " $arg"
+ 	  prev=
+ 	  continue
+ 	  ;;
+ 	xcclinker)
+-	  linker_flags="$linker_flags $qarg"
+-	  compiler_flags="$compiler_flags $qarg"
++	  func_append linker_flags " $qarg"
++	  func_append compiler_flags " $qarg"
+ 	  prev=
+ 	  func_append compile_command " $qarg"
+ 	  func_append finalize_command " $qarg"
+ 	  continue
+ 	  ;;
+ 	xcompiler)
+-	  compiler_flags="$compiler_flags $qarg"
++	  func_append compiler_flags " $qarg"
+ 	  prev=
+ 	  func_append compile_command " $qarg"
+ 	  func_append finalize_command " $qarg"
+ 	  continue
+ 	  ;;
+ 	xlinker)
+-	  linker_flags="$linker_flags $qarg"
+-	  compiler_flags="$compiler_flags $wl$qarg"
++	  func_append linker_flags " $qarg"
++	  func_append compiler_flags " $wl$qarg"
+ 	  prev=
+ 	  func_append compile_command " $wl$qarg"
+ 	  func_append finalize_command " $wl$qarg"
+@@ -4686,15 +5542,16 @@ func_mode_link ()
+ 	;;
+ 
+       -L*)
+-	func_stripname '-L' '' "$arg"
+-	dir=$func_stripname_result
+-	if test -z "$dir"; then
++	func_stripname "-L" '' "$arg"
++	if test -z "$func_stripname_result"; then
+ 	  if test "$#" -gt 0; then
+ 	    func_fatal_error "require no space between \`-L' and \`$1'"
+ 	  else
+ 	    func_fatal_error "need path for \`-L' option"
+ 	  fi
+ 	fi
++	func_resolve_sysroot "$func_stripname_result"
++	dir=$func_resolve_sysroot_result
+ 	# We need an absolute path.
+ 	case $dir in
+ 	[\\/]* | [A-Za-z]:[\\/]*) ;;
+@@ -4706,10 +5563,16 @@ func_mode_link ()
+ 	  ;;
+ 	esac
+ 	case "$deplibs " in
+-	*" -L$dir "*) ;;
++	*" -L$dir "* | *" $arg "*)
++	  # Will only happen for absolute or sysroot arguments
++	  ;;
+ 	*)
+-	  deplibs="$deplibs -L$dir"
+-	  lib_search_path="$lib_search_path $dir"
++	  # Preserve sysroot, but never include relative directories
++	  case $dir in
++	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
++	    *) func_append deplibs " -L$dir" ;;
++	  esac
++	  func_append lib_search_path " $dir"
+ 	  ;;
+ 	esac
+ 	case $host in
+@@ -4718,12 +5581,12 @@ func_mode_link ()
+ 	  case :$dllsearchpath: in
+ 	  *":$dir:"*) ;;
+ 	  ::) dllsearchpath=$dir;;
+-	  *) dllsearchpath="$dllsearchpath:$dir";;
++	  *) func_append dllsearchpath ":$dir";;
+ 	  esac
+ 	  case :$dllsearchpath: in
+ 	  *":$testbindir:"*) ;;
+ 	  ::) dllsearchpath=$testbindir;;
+-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
++	  *) func_append dllsearchpath ":$testbindir";;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -4747,7 +5610,7 @@ func_mode_link ()
+ 	    ;;
+ 	  *-*-rhapsody* | *-*-darwin1.[012])
+ 	    # Rhapsody C and math libraries are in the System framework
+-	    deplibs="$deplibs System.ltframework"
++	    func_append deplibs " System.ltframework"
+ 	    continue
+ 	    ;;
+ 	  *-*-sco3.2v5* | *-*-sco5v6*)
+@@ -4758,9 +5621,6 @@ func_mode_link ()
+ 	    # Compiler inserts libc in the correct place for threads to work
+ 	    test "X$arg" = "X-lc" && continue
+ 	    ;;
+-	  *-*-linux*)
+-	    test "X$arg" = "X-lc" && continue
+-	    ;;
+ 	  esac
+ 	elif test "X$arg" = "X-lc_r"; then
+ 	 case $host in
+@@ -4770,7 +5630,7 @@ func_mode_link ()
+ 	   ;;
+ 	 esac
+ 	fi
+-	deplibs="$deplibs $arg"
++	func_append deplibs " $arg"
+ 	continue
+ 	;;
+ 
+@@ -4782,8 +5642,8 @@ func_mode_link ()
+       # Tru64 UNIX uses -model [arg] to determine the layout of C++
+       # classes, name mangling, and exception handling.
+       # Darwin uses the -arch flag to determine output architecture.
+-      -model|-arch|-isysroot)
+-	compiler_flags="$compiler_flags $arg"
++      -model|-arch|-isysroot|--sysroot)
++	func_append compiler_flags " $arg"
+ 	func_append compile_command " $arg"
+ 	func_append finalize_command " $arg"
+ 	prev=xcompiler
+@@ -4791,12 +5651,12 @@ func_mode_link ()
+ 	;;
+ 
+       -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+-	compiler_flags="$compiler_flags $arg"
++	func_append compiler_flags " $arg"
+ 	func_append compile_command " $arg"
+ 	func_append finalize_command " $arg"
+ 	case "$new_inherited_linker_flags " in
+ 	    *" $arg "*) ;;
+-	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
++	    * ) func_append new_inherited_linker_flags " $arg" ;;
+ 	esac
+ 	continue
+ 	;;
+@@ -4863,13 +5723,17 @@ func_mode_link ()
+ 	# We need an absolute path.
+ 	case $dir in
+ 	[\\/]* | [A-Za-z]:[\\/]*) ;;
++	=*)
++	  func_stripname '=' '' "$dir"
++	  dir=$lt_sysroot$func_stripname_result
++	  ;;
+ 	*)
+ 	  func_fatal_error "only absolute run-paths are allowed"
+ 	  ;;
+ 	esac
+ 	case "$xrpath " in
+ 	*" $dir "*) ;;
+-	*) xrpath="$xrpath $dir" ;;
++	*) func_append xrpath " $dir" ;;
+ 	esac
+ 	continue
+ 	;;
+@@ -4922,8 +5786,8 @@ func_mode_link ()
+ 	for flag in $args; do
+ 	  IFS="$save_ifs"
+           func_quote_for_eval "$flag"
+-	  arg="$arg $func_quote_for_eval_result"
+-	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
++	  func_append arg " $func_quote_for_eval_result"
++	  func_append compiler_flags " $func_quote_for_eval_result"
+ 	done
+ 	IFS="$save_ifs"
+ 	func_stripname ' ' '' "$arg"
+@@ -4938,9 +5802,9 @@ func_mode_link ()
+ 	for flag in $args; do
+ 	  IFS="$save_ifs"
+           func_quote_for_eval "$flag"
+-	  arg="$arg $wl$func_quote_for_eval_result"
+-	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+-	  linker_flags="$linker_flags $func_quote_for_eval_result"
++	  func_append arg " $wl$func_quote_for_eval_result"
++	  func_append compiler_flags " $wl$func_quote_for_eval_result"
++	  func_append linker_flags " $func_quote_for_eval_result"
+ 	done
+ 	IFS="$save_ifs"
+ 	func_stripname ' ' '' "$arg"
+@@ -4968,24 +5832,27 @@ func_mode_link ()
+ 	arg="$func_quote_for_eval_result"
+ 	;;
+ 
+-      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+-      # -r[0-9][0-9]* specifies the processor on the SGI compiler
+-      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+-      # +DA*, +DD* enable 64-bit mode on the HP compiler
+-      # -q* pass through compiler args for the IBM compiler
+-      # -m*, -t[45]*, -txscale* pass through architecture-specific
+-      # compiler args for GCC
+-      # -F/path gives path to uninstalled frameworks, gcc on darwin
+-      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+-      # @file GCC response files
+-      # -tp=* Portland pgcc target processor selection
++      # Flags to be passed through unchanged, with rationale:
++      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
++      # -r[0-9][0-9]*        specify processor for the SGI compiler
++      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
++      # +DA*, +DD*           enable 64-bit mode for the HP compiler
++      # -q*                  compiler args for the IBM compiler
++      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
++      # -F/path              path to uninstalled frameworks, gcc on darwin
++      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
++      # @file                GCC response files
++      # -tp=*                Portland pgcc target processor selection
++      # --sysroot=*          for sysroot support
++      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+-      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
++      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
++      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+         func_quote_for_eval "$arg"
+ 	arg="$func_quote_for_eval_result"
+         func_append compile_command " $arg"
+         func_append finalize_command " $arg"
+-        compiler_flags="$compiler_flags $arg"
++        func_append compiler_flags " $arg"
+         continue
+         ;;
+ 
+@@ -4997,7 +5864,7 @@ func_mode_link ()
+ 
+       *.$objext)
+ 	# A standard object.
+-	objs="$objs $arg"
++	func_append objs " $arg"
+ 	;;
+ 
+       *.lo)
+@@ -5028,7 +5895,7 @@ func_mode_link ()
+ 
+ 	    if test "$prev" = dlfiles; then
+ 	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+-		dlfiles="$dlfiles $pic_object"
++		func_append dlfiles " $pic_object"
+ 		prev=
+ 		continue
+ 	      else
+@@ -5040,7 +5907,7 @@ func_mode_link ()
+ 	    # CHECK ME:  I think I busted this.  -Ossama
+ 	    if test "$prev" = dlprefiles; then
+ 	      # Preload the old-style object.
+-	      dlprefiles="$dlprefiles $pic_object"
++	      func_append dlprefiles " $pic_object"
+ 	      prev=
+ 	    fi
+ 
+@@ -5085,24 +5952,25 @@ func_mode_link ()
+ 
+       *.$libext)
+ 	# An archive.
+-	deplibs="$deplibs $arg"
+-	old_deplibs="$old_deplibs $arg"
++	func_append deplibs " $arg"
++	func_append old_deplibs " $arg"
+ 	continue
+ 	;;
+ 
+       *.la)
+ 	# A libtool-controlled library.
+ 
++	func_resolve_sysroot "$arg"
+ 	if test "$prev" = dlfiles; then
+ 	  # This library was specified with -dlopen.
+-	  dlfiles="$dlfiles $arg"
++	  func_append dlfiles " $func_resolve_sysroot_result"
+ 	  prev=
+ 	elif test "$prev" = dlprefiles; then
+ 	  # The library was specified with -dlpreopen.
+-	  dlprefiles="$dlprefiles $arg"
++	  func_append dlprefiles " $func_resolve_sysroot_result"
+ 	  prev=
+ 	else
+-	  deplibs="$deplibs $arg"
++	  func_append deplibs " $func_resolve_sysroot_result"
+ 	fi
+ 	continue
+ 	;;
+@@ -5127,7 +5995,7 @@ func_mode_link ()
+       func_fatal_help "the \`$prevarg' option requires an argument"
+ 
+     if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+-      eval "arg=\"$export_dynamic_flag_spec\""
++      eval arg=\"$export_dynamic_flag_spec\"
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+     fi
+@@ -5144,11 +6012,13 @@ func_mode_link ()
+     else
+       shlib_search_path=
+     fi
+-    eval "sys_lib_search_path=\"$sys_lib_search_path_spec\""
+-    eval "sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\""
++    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
++    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+ 
+     func_dirname "$output" "/" ""
+     output_objdir="$func_dirname_result$objdir"
++    func_to_tool_file "$output_objdir/"
++    tool_output_objdir=$func_to_tool_file_result
+     # Create the object directory.
+     func_mkdir_p "$output_objdir"
+ 
+@@ -5169,12 +6039,12 @@ func_mode_link ()
+     # Find all interdependent deplibs by searching for libraries
+     # that are linked more than once (e.g. -la -lb -la)
+     for deplib in $deplibs; do
+-      if $opt_duplicate_deps ; then
++      if $opt_preserve_dup_deps ; then
+ 	case "$libs " in
+-	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ 	esac
+       fi
+-      libs="$libs $deplib"
++      func_append libs " $deplib"
+     done
+ 
+     if test "$linkmode" = lib; then
+@@ -5187,9 +6057,9 @@ func_mode_link ()
+       if $opt_duplicate_compiler_generated_deps; then
+ 	for pre_post_dep in $predeps $postdeps; do
+ 	  case "$pre_post_deps " in
+-	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
++	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+ 	  esac
+-	  pre_post_deps="$pre_post_deps $pre_post_dep"
++	  func_append pre_post_deps " $pre_post_dep"
+ 	done
+       fi
+       pre_post_deps=
+@@ -5256,8 +6126,9 @@ func_mode_link ()
+ 	for lib in $dlprefiles; do
+ 	  # Ignore non-libtool-libs
+ 	  dependency_libs=
++	  func_resolve_sysroot "$lib"
+ 	  case $lib in
+-	  *.la)	func_source "$lib" ;;
++	  *.la)	func_source "$func_resolve_sysroot_result" ;;
+ 	  esac
+ 
+ 	  # Collect preopened libtool deplibs, except any this library
+@@ -5267,7 +6138,7 @@ func_mode_link ()
+             deplib_base=$func_basename_result
+ 	    case " $weak_libs " in
+ 	    *" $deplib_base "*) ;;
+-	    *) deplibs="$deplibs $deplib" ;;
++	    *) func_append deplibs " $deplib" ;;
+ 	    esac
+ 	  done
+ 	done
+@@ -5288,11 +6159,11 @@ func_mode_link ()
+ 	    compile_deplibs="$deplib $compile_deplibs"
+ 	    finalize_deplibs="$deplib $finalize_deplibs"
+ 	  else
+-	    compiler_flags="$compiler_flags $deplib"
++	    func_append compiler_flags " $deplib"
+ 	    if test "$linkmode" = lib ; then
+ 		case "$new_inherited_linker_flags " in
+ 		    *" $deplib "*) ;;
+-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
++		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+ 		esac
+ 	    fi
+ 	  fi
+@@ -5377,7 +6248,7 @@ func_mode_link ()
+ 	    if test "$linkmode" = lib ; then
+ 		case "$new_inherited_linker_flags " in
+ 		    *" $deplib "*) ;;
+-		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
++		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+ 		esac
+ 	    fi
+ 	  fi
+@@ -5390,7 +6261,8 @@ func_mode_link ()
+ 	    test "$pass" = conv && continue
+ 	    newdependency_libs="$deplib $newdependency_libs"
+ 	    func_stripname '-L' '' "$deplib"
+-	    newlib_search_path="$newlib_search_path $func_stripname_result"
++	    func_resolve_sysroot "$func_stripname_result"
++	    func_append newlib_search_path " $func_resolve_sysroot_result"
+ 	    ;;
+ 	  prog)
+ 	    if test "$pass" = conv; then
+@@ -5404,7 +6276,8 @@ func_mode_link ()
+ 	      finalize_deplibs="$deplib $finalize_deplibs"
+ 	    fi
+ 	    func_stripname '-L' '' "$deplib"
+-	    newlib_search_path="$newlib_search_path $func_stripname_result"
++	    func_resolve_sysroot "$func_stripname_result"
++	    func_append newlib_search_path " $func_resolve_sysroot_result"
+ 	    ;;
+ 	  *)
+ 	    func_warning "\`-L' is ignored for archives/objects"
+@@ -5415,17 +6288,21 @@ func_mode_link ()
+ 	-R*)
+ 	  if test "$pass" = link; then
+ 	    func_stripname '-R' '' "$deplib"
+-	    dir=$func_stripname_result
++	    func_resolve_sysroot "$func_stripname_result"
++	    dir=$func_resolve_sysroot_result
+ 	    # Make sure the xrpath contains only unique directories.
+ 	    case "$xrpath " in
+ 	    *" $dir "*) ;;
+-	    *) xrpath="$xrpath $dir" ;;
++	    *) func_append xrpath " $dir" ;;
+ 	    esac
+ 	  fi
+ 	  deplibs="$deplib $deplibs"
+ 	  continue
+ 	  ;;
+-	*.la) lib="$deplib" ;;
++	*.la)
++	  func_resolve_sysroot "$deplib"
++	  lib=$func_resolve_sysroot_result
++	  ;;
+ 	*.$libext)
+ 	  if test "$pass" = conv; then
+ 	    deplibs="$deplib $deplibs"
+@@ -5488,11 +6365,11 @@ func_mode_link ()
+ 	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ 	      # If there is no dlopen support or we're linking statically,
+ 	      # we need to preload.
+-	      newdlprefiles="$newdlprefiles $deplib"
++	      func_append newdlprefiles " $deplib"
+ 	      compile_deplibs="$deplib $compile_deplibs"
+ 	      finalize_deplibs="$deplib $finalize_deplibs"
+ 	    else
+-	      newdlfiles="$newdlfiles $deplib"
++	      func_append newdlfiles " $deplib"
+ 	    fi
+ 	  fi
+ 	  continue
+@@ -5538,7 +6415,7 @@ func_mode_link ()
+ 	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+ 	    case " $new_inherited_linker_flags " in
+ 	      *" $tmp_inherited_linker_flag "*) ;;
+-	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
++	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+ 	    esac
+ 	  done
+ 	fi
+@@ -5546,8 +6423,8 @@ func_mode_link ()
+ 	if test "$linkmode,$pass" = "lib,link" ||
+ 	   test "$linkmode,$pass" = "prog,scan" ||
+ 	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+-	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+-	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
++	  test -n "$dlopen" && func_append dlfiles " $dlopen"
++	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+ 	fi
+ 
+ 	if test "$pass" = conv; then
+@@ -5558,20 +6435,20 @@ func_mode_link ()
+ 	      func_fatal_error "cannot find name of link library for \`$lib'"
+ 	    fi
+ 	    # It is a libtool convenience library, so add in its objects.
+-	    convenience="$convenience $ladir/$objdir/$old_library"
+-	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
++	    func_append convenience " $ladir/$objdir/$old_library"
++	    func_append old_convenience " $ladir/$objdir/$old_library"
+ 	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ 	    func_fatal_error "\`$lib' is not a convenience library"
+ 	  fi
+ 	  tmp_libs=
+ 	  for deplib in $dependency_libs; do
+ 	    deplibs="$deplib $deplibs"
+-	    if $opt_duplicate_deps ; then
++	    if $opt_preserve_dup_deps ; then
+ 	      case "$tmp_libs " in
+-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ 	      esac
+ 	    fi
+-	    tmp_libs="$tmp_libs $deplib"
++	    func_append tmp_libs " $deplib"
+ 	  done
+ 	  continue
+ 	fi # $pass = conv
+@@ -5579,9 +6456,15 @@ func_mode_link ()
+ 
+ 	# Get the name of the library we link against.
+ 	linklib=
+-	for l in $old_library $library_names; do
+-	  linklib="$l"
+-	done
++	if test -n "$old_library" &&
++	   { test "$prefer_static_libs" = yes ||
++	     test "$prefer_static_libs,$installed" = "built,no"; }; then
++	  linklib=$old_library
++	else
++	  for l in $old_library $library_names; do
++	    linklib="$l"
++	  done
++	fi
+ 	if test -z "$linklib"; then
+ 	  func_fatal_error "cannot find name of link library for \`$lib'"
+ 	fi
+@@ -5598,9 +6481,9 @@ func_mode_link ()
+ 	    # statically, we need to preload.  We also need to preload any
+ 	    # dependent libraries so libltdl's deplib preloader doesn't
+ 	    # bomb out in the load deplibs phase.
+-	    dlprefiles="$dlprefiles $lib $dependency_libs"
++	    func_append dlprefiles " $lib $dependency_libs"
+ 	  else
+-	    newdlfiles="$newdlfiles $lib"
++	    func_append newdlfiles " $lib"
+ 	  fi
+ 	  continue
+ 	fi # $pass = dlopen
+@@ -5622,14 +6505,14 @@ func_mode_link ()
+ 
+ 	# Find the relevant object directory and library name.
+ 	if test "X$installed" = Xyes; then
+-	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
++	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ 	    func_warning "library \`$lib' was moved."
+ 	    dir="$ladir"
+ 	    absdir="$abs_ladir"
+ 	    libdir="$abs_ladir"
+ 	  else
+-	    dir="$libdir"
+-	    absdir="$libdir"
++	    dir="$lt_sysroot$libdir"
++	    absdir="$lt_sysroot$libdir"
+ 	  fi
+ 	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ 	else
+@@ -5637,12 +6520,12 @@ func_mode_link ()
+ 	    dir="$ladir"
+ 	    absdir="$abs_ladir"
+ 	    # Remove this search path later
+-	    notinst_path="$notinst_path $abs_ladir"
++	    func_append notinst_path " $abs_ladir"
+ 	  else
+ 	    dir="$ladir/$objdir"
+ 	    absdir="$abs_ladir/$objdir"
+ 	    # Remove this search path later
+-	    notinst_path="$notinst_path $abs_ladir"
++	    func_append notinst_path " $abs_ladir"
+ 	  fi
+ 	fi # $installed = yes
+ 	func_stripname 'lib' '.la' "$laname"
+@@ -5653,20 +6536,46 @@ func_mode_link ()
+ 	  if test -z "$libdir" && test "$linkmode" = prog; then
+ 	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ 	  fi
+-	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+-	  # are required to link).
+-	  if test -n "$old_library"; then
+-	    newdlprefiles="$newdlprefiles $dir/$old_library"
+-	    # Keep a list of preopened convenience libraries to check
+-	    # that they are being used correctly in the link pass.
+-	    test -z "$libdir" && \
+-		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+-	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+-	  elif test -n "$dlname"; then
+-	    newdlprefiles="$newdlprefiles $dir/$dlname"
+-	  else
+-	    newdlprefiles="$newdlprefiles $dir/$linklib"
+-	  fi
++	  case "$host" in
++	    # special handling for platforms with PE-DLLs.
++	    *cygwin* | *mingw* | *cegcc* )
++	      # Linker will automatically link against shared library if both
++	      # static and shared are present.  Therefore, ensure we extract
++	      # symbols from the import library if a shared library is present
++	      # (otherwise, the dlopen module name will be incorrect).  We do
++	      # this by putting the import library name into $newdlprefiles.
++	      # We recover the dlopen module name by 'saving' the la file
++	      # name in a special purpose variable, and (later) extracting the
++	      # dlname from the la file.
++	      if test -n "$dlname"; then
++	        func_tr_sh "$dir/$linklib"
++	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
++	        func_append newdlprefiles " $dir/$linklib"
++	      else
++	        func_append newdlprefiles " $dir/$old_library"
++	        # Keep a list of preopened convenience libraries to check
++	        # that they are being used correctly in the link pass.
++	        test -z "$libdir" && \
++	          func_append dlpreconveniencelibs " $dir/$old_library"
++	      fi
++	    ;;
++	    * )
++	      # Prefer using a static library (so that no silly _DYNAMIC symbols
++	      # are required to link).
++	      if test -n "$old_library"; then
++	        func_append newdlprefiles " $dir/$old_library"
++	        # Keep a list of preopened convenience libraries to check
++	        # that they are being used correctly in the link pass.
++	        test -z "$libdir" && \
++	          func_append dlpreconveniencelibs " $dir/$old_library"
++	      # Otherwise, use the dlname, so that lt_dlopen finds it.
++	      elif test -n "$dlname"; then
++	        func_append newdlprefiles " $dir/$dlname"
++	      else
++	        func_append newdlprefiles " $dir/$linklib"
++	      fi
++	    ;;
++	  esac
+ 	fi # $pass = dlpreopen
+ 
+ 	if test -z "$libdir"; then
+@@ -5684,7 +6593,7 @@ func_mode_link ()
+ 
+ 
+ 	if test "$linkmode" = prog && test "$pass" != link; then
+-	  newlib_search_path="$newlib_search_path $ladir"
++	  func_append newlib_search_path " $ladir"
+ 	  deplibs="$lib $deplibs"
+ 
+ 	  linkalldeplibs=no
+@@ -5697,7 +6606,8 @@ func_mode_link ()
+ 	  for deplib in $dependency_libs; do
+ 	    case $deplib in
+ 	    -L*) func_stripname '-L' '' "$deplib"
+-	         newlib_search_path="$newlib_search_path $func_stripname_result"
++	         func_resolve_sysroot "$func_stripname_result"
++	         func_append newlib_search_path " $func_resolve_sysroot_result"
+ 		 ;;
+ 	    esac
+ 	    # Need to link against all dependency_libs?
+@@ -5708,12 +6618,12 @@ func_mode_link ()
+ 	      # or/and link against static libraries
+ 	      newdependency_libs="$deplib $newdependency_libs"
+ 	    fi
+-	    if $opt_duplicate_deps ; then
++	    if $opt_preserve_dup_deps ; then
+ 	      case "$tmp_libs " in
+-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+ 	      esac
+ 	    fi
+-	    tmp_libs="$tmp_libs $deplib"
++	    func_append tmp_libs " $deplib"
+ 	  done # for deplib
+ 	  continue
+ 	fi # $linkmode = prog...
+@@ -5728,7 +6638,7 @@ func_mode_link ()
+ 	      # Make sure the rpath contains only unique directories.
+ 	      case "$temp_rpath:" in
+ 	      *"$absdir:"*) ;;
+-	      *) temp_rpath="$temp_rpath$absdir:" ;;
++	      *) func_append temp_rpath "$absdir:" ;;
+ 	      esac
+ 	    fi
+ 
+@@ -5740,7 +6650,7 @@ func_mode_link ()
+ 	    *)
+ 	      case "$compile_rpath " in
+ 	      *" $absdir "*) ;;
+-	      *) compile_rpath="$compile_rpath $absdir"
++	      *) func_append compile_rpath " $absdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5749,7 +6659,7 @@ func_mode_link ()
+ 	    *)
+ 	      case "$finalize_rpath " in
+ 	      *" $libdir "*) ;;
+-	      *) finalize_rpath="$finalize_rpath $libdir"
++	      *) func_append finalize_rpath " $libdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5774,12 +6684,12 @@ func_mode_link ()
+ 	  case $host in
+ 	  *cygwin* | *mingw* | *cegcc*)
+ 	      # No point in relinking DLLs because paths are not encoded
+-	      notinst_deplibs="$notinst_deplibs $lib"
++	      func_append notinst_deplibs " $lib"
+ 	      need_relink=no
+ 	    ;;
+ 	  *)
+ 	    if test "$installed" = no; then
+-	      notinst_deplibs="$notinst_deplibs $lib"
++	      func_append notinst_deplibs " $lib"
+ 	      need_relink=yes
+ 	    fi
+ 	    ;;
+@@ -5814,7 +6724,7 @@ func_mode_link ()
+ 	    *)
+ 	      case "$compile_rpath " in
+ 	      *" $absdir "*) ;;
+-	      *) compile_rpath="$compile_rpath $absdir"
++	      *) func_append compile_rpath " $absdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5823,7 +6733,7 @@ func_mode_link ()
+ 	    *)
+ 	      case "$finalize_rpath " in
+ 	      *" $libdir "*) ;;
+-	      *) finalize_rpath="$finalize_rpath $libdir"
++	      *) func_append finalize_rpath " $libdir" ;;
+ 	      esac
+ 	      ;;
+ 	    esac
+@@ -5835,7 +6745,7 @@ func_mode_link ()
+ 	    shift
+ 	    realname="$1"
+ 	    shift
+-	    eval "libname=\"$libname_spec\""
++	    libname=`eval "\\$ECHO \"$libname_spec\""`
+ 	    # use dlname if we got it. it's perfectly good, no?
+ 	    if test -n "$dlname"; then
+ 	      soname="$dlname"
+@@ -5848,7 +6758,7 @@ func_mode_link ()
+ 		versuffix="-$major"
+ 		;;
+ 	      esac
+-	      eval "soname=\"$soname_spec\""
++	      eval soname=\"$soname_spec\"
+ 	    else
+ 	      soname="$realname"
+ 	    fi
+@@ -5877,7 +6787,7 @@ func_mode_link ()
+ 	    linklib=$newlib
+ 	  fi # test -n "$old_archive_from_expsyms_cmds"
+ 
+-	  if test "$linkmode" = prog || test "$mode" != relink; then
++	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ 	    add_shlibpath=
+ 	    add_dir=
+ 	    add=
+@@ -5933,7 +6843,7 @@ func_mode_link ()
+ 		if test -n "$inst_prefix_dir"; then
+ 		  case $libdir in
+ 		    [\\/]*)
+-		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
++		      func_append add_dir " -L$inst_prefix_dir$libdir"
+ 		      ;;
+ 		  esac
+ 		fi
+@@ -5955,7 +6865,7 @@ func_mode_link ()
+ 	    if test -n "$add_shlibpath"; then
+ 	      case :$compile_shlibpath: in
+ 	      *":$add_shlibpath:"*) ;;
+-	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
++	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
+ 	      esac
+ 	    fi
+ 	    if test "$linkmode" = prog; then
+@@ -5969,13 +6879,13 @@ func_mode_link ()
+ 		 test "$hardcode_shlibpath_var" = yes; then
+ 		case :$finalize_shlibpath: in
+ 		*":$libdir:"*) ;;
+-		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++		*) func_append finalize_shlibpath "$libdir:" ;;
+ 		esac
+ 	      fi
+ 	    fi
+ 	  fi
+ 
+-	  if test "$linkmode" = prog || test "$mode" = relink; then
++	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ 	    add_shlibpath=
+ 	    add_dir=
+ 	    add=
+@@ -5989,7 +6899,7 @@ func_mode_link ()
+ 	    elif test "$hardcode_shlibpath_var" = yes; then
+ 	      case :$finalize_shlibpath: in
+ 	      *":$libdir:"*) ;;
+-	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
++	      *) func_append finalize_shlibpath "$libdir:" ;;
+ 	      esac
+ 	      add="-l$name"
+ 	    elif test "$hardcode_automatic" = yes; then
+@@ -6001,12 +6911,12 @@ func_mode_link ()
+ 	      fi
+ 	    else
+ 	      # We cannot seem to hardcode it, guess we'll fake it.
+-	      add_dir="-L$libdir"
++	      add_dir="-L$lt_sysroot$libdir"
+ 	      # Try looking first in the location we're being installed to.
+ 	      if test -n "$inst_prefix_dir"; then
+ 		case $libdir in
+ 		  [\\/]*)
+-		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
++		    func_append add_dir " -L$inst_prefix_dir$libdir"
+ 		    ;;
+ 		esac
+ 	      fi
+@@ -6083,27 +6993,33 @@ func_mode_link ()
+ 	           temp_xrpath=$func_stripname_result
+ 		   case " $xrpath " in
+ 		   *" $temp_xrpath "*) ;;
+-		   *) xrpath="$xrpath $temp_xrpath";;
++		   *) func_append xrpath " $temp_xrpath";;
+ 		   esac;;
+-	      *) temp_deplibs="$temp_deplibs $libdir";;
++	      *) func_append temp_deplibs " $libdir";;
+ 	      esac
+ 	    done
+ 	    dependency_libs="$temp_deplibs"
+ 	  fi
+ 
+-	  newlib_search_path="$newlib_search_path $absdir"
++	  func_append newlib_search_path " $absdir"
+ 	  # Link against this library
+ 	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ 	  # ... and its dependency_libs
+ 	  tmp_libs=
+ 	  for deplib in $dependency_libs; do
+ 	    newdependency_libs="$deplib $newdependency_libs"
+-	    if $opt_duplicate_deps ; then
++	    case $deplib in
++              -L*) func_stripname '-L' '' "$deplib"
++                   func_resolve_sysroot "$func_stripname_result";;
++              *) func_resolve_sysroot "$deplib" ;;
++            esac
++	    if $opt_preserve_dup_deps ; then
+ 	      case "$tmp_libs " in
+-	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
++	      *" $func_resolve_sysroot_result "*)
++                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+ 	      esac
+ 	    fi
+-	    tmp_libs="$tmp_libs $deplib"
++	    func_append tmp_libs " $func_resolve_sysroot_result"
+ 	  done
+ 
+ 	  if test "$link_all_deplibs" != no; then
+@@ -6113,8 +7029,10 @@ func_mode_link ()
+ 	      case $deplib in
+ 	      -L*) path="$deplib" ;;
+ 	      *.la)
++	        func_resolve_sysroot "$deplib"
++	        deplib=$func_resolve_sysroot_result
+ 	        func_dirname "$deplib" "" "."
+-		dir="$func_dirname_result"
++		dir=$func_dirname_result
+ 		# We need an absolute path.
+ 		case $dir in
+ 		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+@@ -6130,7 +7048,7 @@ func_mode_link ()
+ 		case $host in
+ 		*-*-darwin*)
+ 		  depdepl=
+-		  deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
++		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ 		  if test -n "$deplibrary_names" ; then
+ 		    for tmp in $deplibrary_names ; do
+ 		      depdepl=$tmp
+@@ -6141,8 +7059,8 @@ func_mode_link ()
+                       if test -z "$darwin_install_name"; then
+                           darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                       fi
+-		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+-		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
++		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
++		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ 		      path=
+ 		    fi
+ 		  fi
+@@ -6152,7 +7070,7 @@ func_mode_link ()
+ 		  ;;
+ 		esac
+ 		else
+-		  libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ 		  test -z "$libdir" && \
+ 		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+ 		  test "$absdir" != "$libdir" && \
+@@ -6192,7 +7110,7 @@ func_mode_link ()
+ 	  for dir in $newlib_search_path; do
+ 	    case "$lib_search_path " in
+ 	    *" $dir "*) ;;
+-	    *) lib_search_path="$lib_search_path $dir" ;;
++	    *) func_append lib_search_path " $dir" ;;
+ 	    esac
+ 	  done
+ 	  newlib_search_path=
+@@ -6205,7 +7123,7 @@ func_mode_link ()
+ 	fi
+ 	for var in $vars dependency_libs; do
+ 	  # Add libraries to $var in reverse order
+-	  eval tmp_libs=\$$var
++	  eval tmp_libs=\"\$$var\"
+ 	  new_libs=
+ 	  for deplib in $tmp_libs; do
+ 	    # FIXME: Pedantically, this is the right thing to do, so
+@@ -6250,13 +7168,13 @@ func_mode_link ()
+ 	    -L*)
+ 	      case " $tmp_libs " in
+ 	      *" $deplib "*) ;;
+-	      *) tmp_libs="$tmp_libs $deplib" ;;
++	      *) func_append tmp_libs " $deplib" ;;
+ 	      esac
+ 	      ;;
+-	    *) tmp_libs="$tmp_libs $deplib" ;;
++	    *) func_append tmp_libs " $deplib" ;;
+ 	    esac
+ 	  done
+-	  eval $var=\$tmp_libs
++	  eval $var=\"$tmp_libs\"
+ 	done # for var
+       fi
+       # Last step: remove runtime libs from dependency_libs
+@@ -6269,7 +7187,7 @@ func_mode_link ()
+ 	  ;;
+ 	esac
+ 	if test -n "$i" ; then
+-	  tmp_libs="$tmp_libs $i"
++	  func_append tmp_libs " $i"
+ 	fi
+       done
+       dependency_libs=$tmp_libs
+@@ -6310,7 +7228,7 @@ func_mode_link ()
+       # Now set the variables for building old libraries.
+       build_libtool_libs=no
+       oldlibs="$output"
+-      objs="$objs$old_deplibs"
++      func_append objs "$old_deplibs"
+       ;;
+ 
+     lib)
+@@ -6319,8 +7237,8 @@ func_mode_link ()
+       lib*)
+ 	func_stripname 'lib' '.la' "$outputname"
+ 	name=$func_stripname_result
+-	eval "shared_ext=\"$shrext_cmds\""
+-	eval "libname=\"$libname_spec\""
++	eval shared_ext=\"$shrext_cmds\"
++	eval libname=\"$libname_spec\"
+ 	;;
+       *)
+ 	test "$module" = no && \
+@@ -6330,8 +7248,8 @@ func_mode_link ()
+ 	  # Add the "lib" prefix for modules if required
+ 	  func_stripname '' '.la' "$outputname"
+ 	  name=$func_stripname_result
+-	  eval "shared_ext=\"$shrext_cmds\""
+-	  eval "libname=\"$libname_spec\""
++	  eval shared_ext=\"$shrext_cmds\"
++	  eval libname=\"$libname_spec\"
+ 	else
+ 	  func_stripname '' '.la' "$outputname"
+ 	  libname=$func_stripname_result
+@@ -6346,7 +7264,7 @@ func_mode_link ()
+ 	  echo
+ 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+ 	  $ECHO "*** objects $objs is not portable!"
+-	  libobjs="$libobjs $objs"
++	  func_append libobjs " $objs"
+ 	fi
+       fi
+ 
+@@ -6544,7 +7462,7 @@ func_mode_link ()
+ 	  done
+ 
+ 	  # Make executables depend on our current version.
+-	  verstring="$verstring:${current}.0"
++	  func_append verstring ":${current}.0"
+ 	  ;;
+ 
+ 	qnx)
+@@ -6612,10 +7530,10 @@ func_mode_link ()
+       fi
+ 
+       func_generate_dlsyms "$libname" "$libname" "yes"
+-      libobjs="$libobjs $symfileobj"
++      func_append libobjs " $symfileobj"
+       test "X$libobjs" = "X " && libobjs=
+ 
+-      if test "$mode" != relink; then
++      if test "$opt_mode" != relink; then
+ 	# Remove our outputs, but don't remove object files since they
+ 	# may have been created when compiling PIC objects.
+ 	removelist=
+@@ -6631,7 +7549,7 @@ func_mode_link ()
+ 		   continue
+ 		 fi
+ 	       fi
+-	       removelist="$removelist $p"
++	       func_append removelist " $p"
+ 	       ;;
+ 	    *) ;;
+ 	  esac
+@@ -6642,7 +7560,7 @@ func_mode_link ()
+ 
+       # Now set the variables for building old libraries.
+       if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+-	oldlibs="$oldlibs $output_objdir/$libname.$libext"
++	func_append oldlibs " $output_objdir/$libname.$libext"
+ 
+ 	# Transform .lo files to .o files.
+ 	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+@@ -6659,10 +7577,11 @@ func_mode_link ()
+ 	# If the user specified any rpath flags, then add them.
+ 	temp_xrpath=
+ 	for libdir in $xrpath; do
+-	  temp_xrpath="$temp_xrpath -R$libdir"
++	  func_replace_sysroot "$libdir"
++	  func_append temp_xrpath " -R$func_replace_sysroot_result"
+ 	  case "$finalize_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
++	  *) func_append finalize_rpath " $libdir" ;;
+ 	  esac
+ 	done
+ 	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+@@ -6676,7 +7595,7 @@ func_mode_link ()
+       for lib in $old_dlfiles; do
+ 	case " $dlprefiles $dlfiles " in
+ 	*" $lib "*) ;;
+-	*) dlfiles="$dlfiles $lib" ;;
++	*) func_append dlfiles " $lib" ;;
+ 	esac
+       done
+ 
+@@ -6686,7 +7605,7 @@ func_mode_link ()
+       for lib in $old_dlprefiles; do
+ 	case "$dlprefiles " in
+ 	*" $lib "*) ;;
+-	*) dlprefiles="$dlprefiles $lib" ;;
++	*) func_append dlprefiles " $lib" ;;
+ 	esac
+       done
+ 
+@@ -6698,7 +7617,7 @@ func_mode_link ()
+ 	    ;;
+ 	  *-*-rhapsody* | *-*-darwin1.[012])
+ 	    # Rhapsody C library is in the System framework
+-	    deplibs="$deplibs System.ltframework"
++	    func_append deplibs " System.ltframework"
+ 	    ;;
+ 	  *-*-netbsd*)
+ 	    # Don't link with libc until the a.out ld.so is fixed.
+@@ -6715,7 +7634,7 @@ func_mode_link ()
+ 	  *)
+ 	    # Add libc to deplibs on all other systems if necessary.
+ 	    if test "$build_libtool_need_lc" = "yes"; then
+-	      deplibs="$deplibs -lc"
++	      func_append deplibs " -lc"
+ 	    fi
+ 	    ;;
+ 	  esac
+@@ -6764,18 +7683,18 @@ EOF
+ 		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		  case " $predeps $postdeps " in
+ 		  *" $i "*)
+-		    newdeplibs="$newdeplibs $i"
++		    func_append newdeplibs " $i"
+ 		    i=""
+ 		    ;;
+ 		  esac
+ 		fi
+ 		if test -n "$i" ; then
+-		  eval "libname=\"$libname_spec\""
+-		  eval "deplib_matches=\"$library_names_spec\""
++		  libname=`eval "\\$ECHO \"$libname_spec\""`
++		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ 		  set dummy $deplib_matches; shift
+ 		  deplib_match=$1
+ 		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+-		    newdeplibs="$newdeplibs $i"
++		    func_append newdeplibs " $i"
+ 		  else
+ 		    droppeddeps=yes
+ 		    echo
+@@ -6789,7 +7708,7 @@ EOF
+ 		fi
+ 		;;
+ 	      *)
+-		newdeplibs="$newdeplibs $i"
++		func_append newdeplibs " $i"
+ 		;;
+ 	      esac
+ 	    done
+@@ -6807,18 +7726,18 @@ EOF
+ 		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		    case " $predeps $postdeps " in
+ 		    *" $i "*)
+-		      newdeplibs="$newdeplibs $i"
++		      func_append newdeplibs " $i"
+ 		      i=""
+ 		      ;;
+ 		    esac
+ 		  fi
+ 		  if test -n "$i" ; then
+-		    eval "libname=\"$libname_spec\""
+-		    eval "deplib_matches=\"$library_names_spec\""
++		    libname=`eval "\\$ECHO \"$libname_spec\""`
++		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+ 		    set dummy $deplib_matches; shift
+ 		    deplib_match=$1
+ 		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+-		      newdeplibs="$newdeplibs $i"
++		      func_append newdeplibs " $i"
+ 		    else
+ 		      droppeddeps=yes
+ 		      echo
+@@ -6840,7 +7759,7 @@ EOF
+ 		fi
+ 		;;
+ 	      *)
+-		newdeplibs="$newdeplibs $i"
++		func_append newdeplibs " $i"
+ 		;;
+ 	      esac
+ 	    done
+@@ -6857,15 +7776,27 @@ EOF
+ 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		case " $predeps $postdeps " in
+ 		*" $a_deplib "*)
+-		  newdeplibs="$newdeplibs $a_deplib"
++		  func_append newdeplibs " $a_deplib"
+ 		  a_deplib=""
+ 		  ;;
+ 		esac
+ 	      fi
+ 	      if test -n "$a_deplib" ; then
+-		eval "libname=\"$libname_spec\""
++		libname=`eval "\\$ECHO \"$libname_spec\""`
++		if test -n "$file_magic_glob"; then
++		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
++		else
++		  libnameglob=$libname
++		fi
++		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+-		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
++		  if test "$want_nocaseglob" = yes; then
++		    shopt -s nocaseglob
++		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
++		    $nocaseglob
++		  else
++		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
++		  fi
+ 		  for potent_lib in $potential_libs; do
+ 		      # Follow soft links.
+ 		      if ls -lLd "$potent_lib" 2>/dev/null |
+@@ -6885,10 +7816,10 @@ EOF
+ 			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ 			esac
+ 		      done
+-		      if eval "$file_magic_cmd \"\$potlib\"" 2>/dev/null |
++		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+ 			 $SED -e 10q |
+ 			 $EGREP "$file_magic_regex" > /dev/null; then
+-			newdeplibs="$newdeplibs $a_deplib"
++			func_append newdeplibs " $a_deplib"
+ 			a_deplib=""
+ 			break 2
+ 		      fi
+@@ -6913,7 +7844,7 @@ EOF
+ 	      ;;
+ 	    *)
+ 	      # Add a -L argument.
+-	      newdeplibs="$newdeplibs $a_deplib"
++	      func_append newdeplibs " $a_deplib"
+ 	      ;;
+ 	    esac
+ 	  done # Gone through all deplibs.
+@@ -6929,20 +7860,20 @@ EOF
+ 	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ 		case " $predeps $postdeps " in
+ 		*" $a_deplib "*)
+-		  newdeplibs="$newdeplibs $a_deplib"
++		  func_append newdeplibs " $a_deplib"
+ 		  a_deplib=""
+ 		  ;;
+ 		esac
+ 	      fi
+ 	      if test -n "$a_deplib" ; then
+-		eval "libname=\"$libname_spec\""
++		libname=`eval "\\$ECHO \"$libname_spec\""`
+ 		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ 		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ 		  for potent_lib in $potential_libs; do
+ 		    potlib="$potent_lib" # see symlink-check above in file_magic test
+ 		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+ 		       $EGREP "$match_pattern_regex" > /dev/null; then
+-		      newdeplibs="$newdeplibs $a_deplib"
++		      func_append newdeplibs " $a_deplib"
+ 		      a_deplib=""
+ 		      break 2
+ 		    fi
+@@ -6967,7 +7898,7 @@ EOF
+ 	      ;;
+ 	    *)
+ 	      # Add a -L argument.
+-	      newdeplibs="$newdeplibs $a_deplib"
++	      func_append newdeplibs " $a_deplib"
+ 	      ;;
+ 	    esac
+ 	  done # Gone through all deplibs.
+@@ -7071,7 +8002,7 @@ EOF
+ 	*)
+ 	  case " $deplibs " in
+ 	  *" -L$path/$objdir "*)
+-	    new_libs="$new_libs -L$path/$objdir" ;;
++	    func_append new_libs " -L$path/$objdir" ;;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -7081,10 +8012,10 @@ EOF
+ 	-L*)
+ 	  case " $new_libs " in
+ 	  *" $deplib "*) ;;
+-	  *) new_libs="$new_libs $deplib" ;;
++	  *) func_append new_libs " $deplib" ;;
+ 	  esac
+ 	  ;;
+-	*) new_libs="$new_libs $deplib" ;;
++	*) func_append new_libs " $deplib" ;;
+ 	esac
+       done
+       deplibs="$new_libs"
+@@ -7101,10 +8032,12 @@ EOF
+ 	  hardcode_libdirs=
+ 	  dep_rpath=
+ 	  rpath="$finalize_rpath"
+-	  test "$mode" != relink && rpath="$compile_rpath$rpath"
++	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ 	  for libdir in $rpath; do
+ 	    if test -n "$hardcode_libdir_flag_spec"; then
+ 	      if test -n "$hardcode_libdir_separator"; then
++		func_replace_sysroot "$libdir"
++		libdir=$func_replace_sysroot_result
+ 		if test -z "$hardcode_libdirs"; then
+ 		  hardcode_libdirs="$libdir"
+ 		else
+@@ -7113,18 +8046,18 @@ EOF
+ 		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ 		    ;;
+ 		  *)
+-		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ 		    ;;
+ 		  esac
+ 		fi
+ 	      else
+-		eval "flag=\"$hardcode_libdir_flag_spec\""
+-		dep_rpath="$dep_rpath $flag"
++		eval flag=\"$hardcode_libdir_flag_spec\"
++		func_append dep_rpath " $flag"
+ 	      fi
+ 	    elif test -n "$runpath_var"; then
+ 	      case "$perm_rpath " in
+ 	      *" $libdir "*) ;;
+-	      *) perm_rpath="$perm_rpath $libdir" ;;
++	      *) func_apped perm_rpath " $libdir" ;;
+ 	      esac
+ 	    fi
+ 	  done
+@@ -7133,40 +8066,38 @@ EOF
+ 	     test -n "$hardcode_libdirs"; then
+ 	    libdir="$hardcode_libdirs"
+ 	    if test -n "$hardcode_libdir_flag_spec_ld"; then
+-	      eval "dep_rpath=\"$hardcode_libdir_flag_spec_ld\""
++	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ 	    else
+-	      eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
++	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ 	    fi
+ 	  fi
+ 	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ 	    # We should set the runpath_var.
+ 	    rpath=
+ 	    for dir in $perm_rpath; do
+-	      rpath="$rpath$dir:"
++	      func_append rpath "$dir:"
+ 	    done
+-	    eval $runpath_var=\$rpath\$$runpath_var
+-	    export $runpath_var
++	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ 	  fi
+ 	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ 	fi
+ 
+ 	shlibpath="$finalize_shlibpath"
+-	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
++	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ 	if test -n "$shlibpath"; then
+-	  eval $shlibpath_var=\$shlibpath\$$shlibpath_var
+-	  export $shlibpath_var
++	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ 	fi
+ 
+ 	# Get the real and link names of the library.
+-	eval "shared_ext=\"$shrext_cmds\""
+-	eval "library_names=\"$library_names_spec\""
++	eval shared_ext=\"$shrext_cmds\"
++	eval library_names=\"$library_names_spec\"
+ 	set dummy $library_names
+ 	shift
+ 	realname="$1"
+ 	shift
+ 
+ 	if test -n "$soname_spec"; then
+-	  eval "soname=\"$soname_spec\""
++	  eval soname=\"$soname_spec\"
+ 	else
+ 	  soname="$realname"
+ 	fi
+@@ -7178,7 +8109,7 @@ EOF
+ 	linknames=
+ 	for link
+ 	do
+-	  linknames="$linknames $link"
++	  func_append linknames " $link"
+ 	done
+ 
+ 	# Use standard objects if they are pic
+@@ -7189,7 +8120,7 @@ EOF
+ 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ 	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+ 	  export_symbols="$output_objdir/$libname.uexp"
+-	  delfiles="$delfiles $export_symbols"
++	  func_append delfiles " $export_symbols"
+ 	fi
+ 
+ 	orig_export_symbols=
+@@ -7220,13 +8151,45 @@ EOF
+ 	    $opt_dry_run || $RM $export_symbols
+ 	    cmds=$export_symbols_cmds
+ 	    save_ifs="$IFS"; IFS='~'
+-	    for cmd in $cmds; do
++	    for cmd1 in $cmds; do
+ 	      IFS="$save_ifs"
+-	      eval "cmd=\"$cmd\""
+-	      func_len " $cmd"
+-	      len=$func_len_result
+-	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
++	      # Take the normal branch if the nm_file_list_spec branch
++	      # doesn't work or if tool conversion is not needed.
++	      case $nm_file_list_spec~$to_tool_file_cmd in
++		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
++		  try_normal_branch=yes
++		  eval cmd=\"$cmd1\"
++		  func_len " $cmd"
++		  len=$func_len_result
++		  ;;
++		*)
++		  try_normal_branch=no
++		  ;;
++	      esac
++	      if test "$try_normal_branch" = yes \
++		 && { test "$len" -lt "$max_cmd_len" \
++		      || test "$max_cmd_len" -le -1; }
++	      then
++		func_show_eval "$cmd" 'exit $?'
++		skipped_export=false
++	      elif test -n "$nm_file_list_spec"; then
++		func_basename "$output"
++		output_la=$func_basename_result
++		save_libobjs=$libobjs
++		save_output=$output
++		output=${output_objdir}/${output_la}.nm
++		func_to_tool_file "$output"
++		libobjs=$nm_file_list_spec$func_to_tool_file_result
++		func_append delfiles " $output"
++		func_verbose "creating $NM input file list: $output"
++		for obj in $save_libobjs; do
++		  func_to_tool_file "$obj"
++		  $ECHO "$func_to_tool_file_result"
++		done > "$output"
++		eval cmd=\"$cmd1\"
+ 		func_show_eval "$cmd" 'exit $?'
++		output=$save_output
++		libobjs=$save_libobjs
+ 		skipped_export=false
+ 	      else
+ 		# The command line is too long to execute in one step.
+@@ -7248,7 +8211,7 @@ EOF
+ 	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ 	  tmp_export_symbols="$export_symbols"
+ 	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+-	  $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
++	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ 	fi
+ 
+ 	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+@@ -7260,7 +8223,7 @@ EOF
+ 	  # global variables. join(1) would be nice here, but unfortunately
+ 	  # isn't a blessed tool.
+ 	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+-	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
++	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ 	  export_symbols=$output_objdir/$libname.def
+ 	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ 	fi
+@@ -7270,7 +8233,7 @@ EOF
+ 	  case " $convenience " in
+ 	  *" $test_deplib "*) ;;
+ 	  *)
+-	    tmp_deplibs="$tmp_deplibs $test_deplib"
++	    func_append tmp_deplibs " $test_deplib"
+ 	    ;;
+ 	  esac
+ 	done
+@@ -7286,43 +8249,43 @@ EOF
+ 	  fi
+ 	  if test -n "$whole_archive_flag_spec"; then
+ 	    save_libobjs=$libobjs
+-	    eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
++	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ 	    test "X$libobjs" = "X " && libobjs=
+ 	  else
+ 	    gentop="$output_objdir/${outputname}x"
+-	    generated="$generated $gentop"
++	    func_append generated " $gentop"
+ 
+ 	    func_extract_archives $gentop $convenience
+-	    libobjs="$libobjs $func_extract_archives_result"
++	    func_append libobjs " $func_extract_archives_result"
+ 	    test "X$libobjs" = "X " && libobjs=
+ 	  fi
+ 	fi
+ 
+ 	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+-	  eval "flag=\"$thread_safe_flag_spec\""
+-	  linker_flags="$linker_flags $flag"
++	  eval flag=\"$thread_safe_flag_spec\"
++	  func_append linker_flags " $flag"
+ 	fi
+ 
+ 	# Make a backup of the uninstalled library when relinking
+-	if test "$mode" = relink; then
+-	  $opt_dry_run || (cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U) || exit $?
++	if test "$opt_mode" = relink; then
++	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+ 	fi
+ 
+ 	# Do each of the archive commands.
+ 	if test "$module" = yes && test -n "$module_cmds" ; then
+ 	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+-	    eval "test_cmds=\"$module_expsym_cmds\""
++	    eval test_cmds=\"$module_expsym_cmds\"
+ 	    cmds=$module_expsym_cmds
+ 	  else
+-	    eval "test_cmds=\"$module_cmds\""
++	    eval test_cmds=\"$module_cmds\"
+ 	    cmds=$module_cmds
+ 	  fi
+ 	else
+ 	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+-	    eval "test_cmds=\"$archive_expsym_cmds\""
++	    eval test_cmds=\"$archive_expsym_cmds\"
+ 	    cmds=$archive_expsym_cmds
+ 	  else
+-	    eval "test_cmds=\"$archive_cmds\""
++	    eval test_cmds=\"$archive_cmds\"
+ 	    cmds=$archive_cmds
+ 	  fi
+ 	fi
+@@ -7366,10 +8329,13 @@ EOF
+ 	    echo 'INPUT (' > $output
+ 	    for obj in $save_libobjs
+ 	    do
+-	      $ECHO "$obj" >> $output
++	      func_to_tool_file "$obj"
++	      $ECHO "$func_to_tool_file_result" >> $output
+ 	    done
+ 	    echo ')' >> $output
+-	    delfiles="$delfiles $output"
++	    func_append delfiles " $output"
++	    func_to_tool_file "$output"
++	    output=$func_to_tool_file_result
+ 	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+ 	    output=${output_objdir}/${output_la}.lnk
+ 	    func_verbose "creating linker input file list: $output"
+@@ -7383,15 +8349,17 @@ EOF
+ 	    fi
+ 	    for obj
+ 	    do
+-	      $ECHO "$obj" >> $output
++	      func_to_tool_file "$obj"
++	      $ECHO "$func_to_tool_file_result" >> $output
+ 	    done
+-	    delfiles="$delfiles $output"
+-	    output=$firstobj\"$file_list_spec$output\"
++	    func_append delfiles " $output"
++	    func_to_tool_file "$output"
++	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+ 	  else
+ 	    if test -n "$save_libobjs"; then
+ 	      func_verbose "creating reloadable object files..."
+ 	      output=$output_objdir/$output_la-${k}.$objext
+-	      eval "test_cmds=\"$reload_cmds\""
++	      eval test_cmds=\"$reload_cmds\"
+ 	      func_len " $test_cmds"
+ 	      len0=$func_len_result
+ 	      len=$len0
+@@ -7411,12 +8379,12 @@ EOF
+ 		  if test "$k" -eq 1 ; then
+ 		    # The first file doesn't have a previous command to add.
+ 		    reload_objs=$objlist
+-		    eval "concat_cmds=\"$reload_cmds\""
++		    eval concat_cmds=\"$reload_cmds\"
+ 		  else
+ 		    # All subsequent reloadable object files will link in
+ 		    # the last one created.
+ 		    reload_objs="$objlist $last_robj"
+-		    eval "concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\""
++		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+ 		  fi
+ 		  last_robj=$output_objdir/$output_la-${k}.$objext
+ 		  func_arith $k + 1
+@@ -7433,11 +8401,11 @@ EOF
+ 	      # files will link in the last one created.
+ 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ 	      reload_objs="$objlist $last_robj"
+-	      eval "concat_cmds=\"\${concat_cmds}$reload_cmds\""
++	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ 	      if test -n "$last_robj"; then
+-	        eval "concat_cmds=\"\${concat_cmds}~\$RM $last_robj\""
++	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ 	      fi
+-	      delfiles="$delfiles $output"
++	      func_append delfiles " $output"
+ 
+ 	    else
+ 	      output=
+@@ -7450,9 +8418,9 @@ EOF
+ 	      libobjs=$output
+ 	      # Append the command to create the export file.
+ 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+-	      eval "concat_cmds=\"\$concat_cmds$export_symbols_cmds\""
++	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+ 	      if test -n "$last_robj"; then
+-		eval "concat_cmds=\"\$concat_cmds~\$RM $last_robj\""
++		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+ 	      fi
+ 	    fi
+ 
+@@ -7471,7 +8439,7 @@ EOF
+ 		lt_exit=$?
+ 
+ 		# Restore the uninstalled library and exit
+-		if test "$mode" = relink; then
++		if test "$opt_mode" = relink; then
+ 		  ( cd "$output_objdir" && \
+ 		    $RM "${realname}T" && \
+ 		    $MV "${realname}U" "$realname" )
+@@ -7492,7 +8460,7 @@ EOF
+ 	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ 	      tmp_export_symbols="$export_symbols"
+ 	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+-	      $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"
++	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+ 	    fi
+ 
+ 	    if test -n "$orig_export_symbols"; then
+@@ -7504,7 +8472,7 @@ EOF
+ 	      # global variables. join(1) would be nice here, but unfortunately
+ 	      # isn't a blessed tool.
+ 	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+-	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
++	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+ 	      export_symbols=$output_objdir/$libname.def
+ 	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+ 	    fi
+@@ -7515,7 +8483,7 @@ EOF
+ 	  output=$save_output
+ 
+ 	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+-	    eval "libobjs=\"\$libobjs $whole_archive_flag_spec\""
++	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ 	    test "X$libobjs" = "X " && libobjs=
+ 	  fi
+ 	  # Expand the library linking commands again to reset the
+@@ -7539,23 +8507,23 @@ EOF
+ 
+ 	if test -n "$delfiles"; then
+ 	  # Append the command to remove temporary files to $cmds.
+-	  eval "cmds=\"\$cmds~\$RM $delfiles\""
++	  eval cmds=\"\$cmds~\$RM $delfiles\"
+ 	fi
+ 
+ 	# Add any objects from preloaded convenience libraries
+ 	if test -n "$dlprefiles"; then
+ 	  gentop="$output_objdir/${outputname}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 
+ 	  func_extract_archives $gentop $dlprefiles
+-	  libobjs="$libobjs $func_extract_archives_result"
++	  func_append libobjs " $func_extract_archives_result"
+ 	  test "X$libobjs" = "X " && libobjs=
+ 	fi
+ 
+ 	save_ifs="$IFS"; IFS='~'
+ 	for cmd in $cmds; do
+ 	  IFS="$save_ifs"
+-	  eval "cmd=\"$cmd\""
++	  eval cmd=\"$cmd\"
+ 	  $opt_silent || {
+ 	    func_quote_for_expand "$cmd"
+ 	    eval "func_echo $func_quote_for_expand_result"
+@@ -7564,7 +8532,7 @@ EOF
+ 	    lt_exit=$?
+ 
+ 	    # Restore the uninstalled library and exit
+-	    if test "$mode" = relink; then
++	    if test "$opt_mode" = relink; then
+ 	      ( cd "$output_objdir" && \
+ 	        $RM "${realname}T" && \
+ 		$MV "${realname}U" "$realname" )
+@@ -7576,8 +8544,8 @@ EOF
+ 	IFS="$save_ifs"
+ 
+ 	# Restore the uninstalled library and exit
+-	if test "$mode" = relink; then
+-	  $opt_dry_run || (cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname) || exit $?
++	if test "$opt_mode" = relink; then
++	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+ 
+ 	  if test -n "$convenience"; then
+ 	    if test -z "$whole_archive_flag_spec"; then
+@@ -7656,17 +8624,20 @@ EOF
+ 
+       if test -n "$convenience"; then
+ 	if test -n "$whole_archive_flag_spec"; then
+-	  eval "tmp_whole_archive_flags=\"$whole_archive_flag_spec\""
++	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ 	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ 	else
+ 	  gentop="$output_objdir/${obj}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 
+ 	  func_extract_archives $gentop $convenience
+ 	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+ 	fi
+       fi
+ 
++      # If we're not building shared, we need to use non_pic_objs
++      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
++
+       # Create the old-style object.
+       reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+ 
+@@ -7690,7 +8661,7 @@ EOF
+ 	# Create an invalid libtool object if no PIC, so that we don't
+ 	# accidentally link it into a program.
+ 	# $show "echo timestamp > $libobj"
+-	# $opt_dry_run || echo timestamp > $libobj || exit $?
++	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+ 	exit $EXIT_SUCCESS
+       fi
+ 
+@@ -7740,8 +8711,8 @@ EOF
+ 	if test "$tagname" = CXX ; then
+ 	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+ 	    10.[0123])
+-	      compile_command="$compile_command ${wl}-bind_at_load"
+-	      finalize_command="$finalize_command ${wl}-bind_at_load"
++	      func_append compile_command " ${wl}-bind_at_load"
++	      func_append finalize_command " ${wl}-bind_at_load"
+ 	    ;;
+ 	  esac
+ 	fi
+@@ -7761,7 +8732,7 @@ EOF
+ 	*)
+ 	  case " $compile_deplibs " in
+ 	  *" -L$path/$objdir "*)
+-	    new_libs="$new_libs -L$path/$objdir" ;;
++	    func_append new_libs " -L$path/$objdir" ;;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -7771,17 +8742,17 @@ EOF
+ 	-L*)
+ 	  case " $new_libs " in
+ 	  *" $deplib "*) ;;
+-	  *) new_libs="$new_libs $deplib" ;;
++	  *) func_append new_libs " $deplib" ;;
+ 	  esac
+ 	  ;;
+-	*) new_libs="$new_libs $deplib" ;;
++	*) func_append new_libs " $deplib" ;;
+ 	esac
+       done
+       compile_deplibs="$new_libs"
+ 
+ 
+-      compile_command="$compile_command $compile_deplibs"
+-      finalize_command="$finalize_command $finalize_deplibs"
++      func_append compile_command " $compile_deplibs"
++      func_append finalize_command " $finalize_deplibs"
+ 
+       if test -n "$rpath$xrpath"; then
+ 	# If the user specified any rpath flags, then add them.
+@@ -7789,7 +8760,7 @@ EOF
+ 	  # This is the magic to use -rpath.
+ 	  case "$finalize_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) finalize_rpath="$finalize_rpath $libdir" ;;
++	  *) func_append finalize_rpath " $libdir" ;;
+ 	  esac
+ 	done
+       fi
+@@ -7808,18 +8779,18 @@ EOF
+ 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ 		;;
+ 	      *)
+-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ 		;;
+ 	      esac
+ 	    fi
+ 	  else
+-	    eval "flag=\"$hardcode_libdir_flag_spec\""
+-	    rpath="$rpath $flag"
++	    eval flag=\"$hardcode_libdir_flag_spec\"
++	    func_append rpath " $flag"
+ 	  fi
+ 	elif test -n "$runpath_var"; then
+ 	  case "$perm_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) perm_rpath="$perm_rpath $libdir" ;;
++	  *) func_append perm_rpath " $libdir" ;;
+ 	  esac
+ 	fi
+ 	case $host in
+@@ -7828,12 +8799,12 @@ EOF
+ 	  case :$dllsearchpath: in
+ 	  *":$libdir:"*) ;;
+ 	  ::) dllsearchpath=$libdir;;
+-	  *) dllsearchpath="$dllsearchpath:$libdir";;
++	  *) func_append dllsearchpath ":$libdir";;
+ 	  esac
+ 	  case :$dllsearchpath: in
+ 	  *":$testbindir:"*) ;;
+ 	  ::) dllsearchpath=$testbindir;;
+-	  *) dllsearchpath="$dllsearchpath:$testbindir";;
++	  *) func_append dllsearchpath ":$testbindir";;
+ 	  esac
+ 	  ;;
+ 	esac
+@@ -7842,7 +8813,7 @@ EOF
+       if test -n "$hardcode_libdir_separator" &&
+ 	 test -n "$hardcode_libdirs"; then
+ 	libdir="$hardcode_libdirs"
+-	eval "rpath=\" $hardcode_libdir_flag_spec\""
++	eval rpath=\" $hardcode_libdir_flag_spec\"
+       fi
+       compile_rpath="$rpath"
+ 
+@@ -7859,18 +8830,18 @@ EOF
+ 	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ 		;;
+ 	      *)
+-		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
++		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+ 		;;
+ 	      esac
+ 	    fi
+ 	  else
+-	    eval "flag=\"$hardcode_libdir_flag_spec\""
+-	    rpath="$rpath $flag"
++	    eval flag=\"$hardcode_libdir_flag_spec\"
++	    func_append rpath " $flag"
+ 	  fi
+ 	elif test -n "$runpath_var"; then
+ 	  case "$finalize_perm_rpath " in
+ 	  *" $libdir "*) ;;
+-	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
++	  *) func_append finalize_perm_rpath " $libdir" ;;
+ 	  esac
+ 	fi
+       done
+@@ -7878,7 +8849,7 @@ EOF
+       if test -n "$hardcode_libdir_separator" &&
+ 	 test -n "$hardcode_libdirs"; then
+ 	libdir="$hardcode_libdirs"
+-	eval "rpath=\" $hardcode_libdir_flag_spec\""
++	eval rpath=\" $hardcode_libdir_flag_spec\"
+       fi
+       finalize_rpath="$rpath"
+ 
+@@ -7921,6 +8892,12 @@ EOF
+ 	exit_status=0
+ 	func_show_eval "$link_command" 'exit_status=$?'
+ 
++	if test -n "$postlink_cmds"; then
++	  func_to_tool_file "$output"
++	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++	  func_execute_cmds "$postlink_cmds" 'exit $?'
++	fi
++
+ 	# Delete the generated files.
+ 	if test -f "$output_objdir/${outputname}S.${objext}"; then
+ 	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+@@ -7943,7 +8920,7 @@ EOF
+ 	  # We should set the runpath_var.
+ 	  rpath=
+ 	  for dir in $perm_rpath; do
+-	    rpath="$rpath$dir:"
++	    func_append rpath "$dir:"
+ 	  done
+ 	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ 	fi
+@@ -7951,7 +8928,7 @@ EOF
+ 	  # We should set the runpath_var.
+ 	  rpath=
+ 	  for dir in $finalize_perm_rpath; do
+-	    rpath="$rpath$dir:"
++	    func_append rpath "$dir:"
+ 	  done
+ 	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ 	fi
+@@ -7966,6 +8943,13 @@ EOF
+ 	$opt_dry_run || $RM $output
+ 	# Link the executable and exit
+ 	func_show_eval "$link_command" 'exit $?'
++
++	if test -n "$postlink_cmds"; then
++	  func_to_tool_file "$output"
++	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++	  func_execute_cmds "$postlink_cmds" 'exit $?'
++	fi
++
+ 	exit $EXIT_SUCCESS
+       fi
+ 
+@@ -7999,6 +8983,12 @@ EOF
+ 
+       func_show_eval "$link_command" 'exit $?'
+ 
++      if test -n "$postlink_cmds"; then
++	func_to_tool_file "$output_objdir/$outputname"
++	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
++	func_execute_cmds "$postlink_cmds" 'exit $?'
++      fi
++
+       # Now create the wrapper script.
+       func_verbose "creating $output"
+ 
+@@ -8096,7 +9086,7 @@ EOF
+ 	else
+ 	  oldobjs="$old_deplibs $non_pic_objects"
+ 	  if test "$preload" = yes && test -f "$symfileobj"; then
+-	    oldobjs="$oldobjs $symfileobj"
++	    func_append oldobjs " $symfileobj"
+ 	  fi
+ 	fi
+ 	addlibs="$old_convenience"
+@@ -8104,10 +9094,10 @@ EOF
+ 
+       if test -n "$addlibs"; then
+ 	gentop="$output_objdir/${outputname}x"
+-	generated="$generated $gentop"
++	func_append generated " $gentop"
+ 
+ 	func_extract_archives $gentop $addlibs
+-	oldobjs="$oldobjs $func_extract_archives_result"
++	func_append oldobjs " $func_extract_archives_result"
+       fi
+ 
+       # Do each command in the archive commands.
+@@ -8118,10 +9108,10 @@ EOF
+ 	# Add any objects from preloaded convenience libraries
+ 	if test -n "$dlprefiles"; then
+ 	  gentop="$output_objdir/${outputname}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 
+ 	  func_extract_archives $gentop $dlprefiles
+-	  oldobjs="$oldobjs $func_extract_archives_result"
++	  func_append oldobjs " $func_extract_archives_result"
+ 	fi
+ 
+ 	# POSIX demands no paths to be encoded in archives.  We have
+@@ -8139,7 +9129,7 @@ EOF
+ 	else
+ 	  echo "copying selected object files to avoid basename conflicts..."
+ 	  gentop="$output_objdir/${outputname}x"
+-	  generated="$generated $gentop"
++	  func_append generated " $gentop"
+ 	  func_mkdir_p "$gentop"
+ 	  save_oldobjs=$oldobjs
+ 	  oldobjs=
+@@ -8163,18 +9153,28 @@ EOF
+ 		esac
+ 	      done
+ 	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+-	      oldobjs="$oldobjs $gentop/$newobj"
++	      func_append oldobjs " $gentop/$newobj"
+ 	      ;;
+-	    *) oldobjs="$oldobjs $obj" ;;
++	    *) func_append oldobjs " $obj" ;;
+ 	    esac
+ 	  done
+ 	fi
+-	eval "cmds=\"$old_archive_cmds\""
++	eval cmds=\"$old_archive_cmds\"
+ 
+ 	func_len " $cmds"
+ 	len=$func_len_result
+ 	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ 	  cmds=$old_archive_cmds
++	elif test -n "$archiver_list_spec"; then
++	  func_verbose "using command file archive linking..."
++	  for obj in $oldobjs
++	  do
++	    func_to_tool_file "$obj"
++	    $ECHO "$func_to_tool_file_result"
++	  done > $output_objdir/$libname.libcmd
++	  func_to_tool_file "$output_objdir/$libname.libcmd"
++	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
++	  cmds=$old_archive_cmds
+ 	else
+ 	  # the command line is too long to link in one step, link in parts
+ 	  func_verbose "using piecewise archive linking..."
+@@ -8189,7 +9189,7 @@ EOF
+ 	  do
+ 	    last_oldobj=$obj
+ 	  done
+-	  eval "test_cmds=\"$old_archive_cmds\""
++	  eval test_cmds=\"$old_archive_cmds\"
+ 	  func_len " $test_cmds"
+ 	  len0=$func_len_result
+ 	  len=$len0
+@@ -8208,7 +9208,7 @@ EOF
+ 		RANLIB=$save_RANLIB
+ 	      fi
+ 	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+-	      eval "concat_cmds=\"\${concat_cmds}$old_archive_cmds\""
++	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ 	      objlist=
+ 	      len=$len0
+ 	    fi
+@@ -8216,9 +9216,9 @@ EOF
+ 	  RANLIB=$save_RANLIB
+ 	  oldobjs=$objlist
+ 	  if test "X$oldobjs" = "X" ; then
+-	    eval "cmds=\"\$concat_cmds\""
++	    eval cmds=\"\$concat_cmds\"
+ 	  else
+-	    eval "cmds=\"\$concat_cmds~\$old_archive_cmds\""
++	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ 	  fi
+ 	fi
+       fi
+@@ -8268,12 +9268,23 @@ EOF
+ 	      *.la)
+ 		func_basename "$deplib"
+ 		name="$func_basename_result"
+-		libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
++		func_resolve_sysroot "$deplib"
++		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ 		test -z "$libdir" && \
+ 		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+-		newdependency_libs="$newdependency_libs $libdir/$name"
++		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
++		;;
++	      -L*)
++		func_stripname -L '' "$deplib"
++		func_replace_sysroot "$func_stripname_result"
++		func_append newdependency_libs " -L$func_replace_sysroot_result"
+ 		;;
+-	      *) newdependency_libs="$newdependency_libs $deplib" ;;
++	      -R*)
++		func_stripname -R '' "$deplib"
++		func_replace_sysroot "$func_stripname_result"
++		func_append newdependency_libs " -R$func_replace_sysroot_result"
++		;;
++	      *) func_append newdependency_libs " $deplib" ;;
+ 	      esac
+ 	    done
+ 	    dependency_libs="$newdependency_libs"
+@@ -8284,12 +9295,14 @@ EOF
+ 	      *.la)
+ 	        func_basename "$lib"
+ 		name="$func_basename_result"
+-		libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++		func_resolve_sysroot "$lib"
++		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
++
+ 		test -z "$libdir" && \
+ 		  func_fatal_error "\`$lib' is not a valid libtool archive"
+-		newdlfiles="$newdlfiles $libdir/$name"
++		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+ 		;;
+-	      *) newdlfiles="$newdlfiles $lib" ;;
++	      *) func_append newdlfiles " $lib" ;;
+ 	      esac
+ 	    done
+ 	    dlfiles="$newdlfiles"
+@@ -8303,10 +9316,11 @@ EOF
+ 		# the library:
+ 		func_basename "$lib"
+ 		name="$func_basename_result"
+-		libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
++		func_resolve_sysroot "$lib"
++		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ 		test -z "$libdir" && \
+ 		  func_fatal_error "\`$lib' is not a valid libtool archive"
+-		newdlprefiles="$newdlprefiles $libdir/$name"
++		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+ 		;;
+ 	      esac
+ 	    done
+@@ -8318,7 +9332,7 @@ EOF
+ 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ 		*) abs=`pwd`"/$lib" ;;
+ 	      esac
+-	      newdlfiles="$newdlfiles $abs"
++	      func_append newdlfiles " $abs"
+ 	    done
+ 	    dlfiles="$newdlfiles"
+ 	    newdlprefiles=
+@@ -8327,7 +9341,7 @@ EOF
+ 		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ 		*) abs=`pwd`"/$lib" ;;
+ 	      esac
+-	      newdlprefiles="$newdlprefiles $abs"
++	      func_append newdlprefiles " $abs"
+ 	    done
+ 	    dlprefiles="$newdlprefiles"
+ 	  fi
+@@ -8412,7 +9426,7 @@ relink_command=\"$relink_command\""
+     exit $EXIT_SUCCESS
+ }
+ 
+-{ test "$mode" = link || test "$mode" = relink; } &&
++{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+     func_mode_link ${1+"$@"}
+ 
+ 
+@@ -8432,9 +9446,9 @@ func_mode_uninstall ()
+     for arg
+     do
+       case $arg in
+-      -f) RM="$RM $arg"; rmforce=yes ;;
+-      -*) RM="$RM $arg" ;;
+-      *) files="$files $arg" ;;
++      -f) func_append RM " $arg"; rmforce=yes ;;
++      -*) func_append RM " $arg" ;;
++      *) func_append files " $arg" ;;
+       esac
+     done
+ 
+@@ -8443,24 +9457,23 @@ func_mode_uninstall ()
+ 
+     rmdirs=
+ 
+-    origobjdir="$objdir"
+     for file in $files; do
+       func_dirname "$file" "" "."
+       dir="$func_dirname_result"
+       if test "X$dir" = X.; then
+-	objdir="$origobjdir"
++	odir="$objdir"
+       else
+-	objdir="$dir/$origobjdir"
++	odir="$dir/$objdir"
+       fi
+       func_basename "$file"
+       name="$func_basename_result"
+-      test "$mode" = uninstall && objdir="$dir"
++      test "$opt_mode" = uninstall && odir="$dir"
+ 
+-      # Remember objdir for removal later, being careful to avoid duplicates
+-      if test "$mode" = clean; then
++      # Remember odir for removal later, being careful to avoid duplicates
++      if test "$opt_mode" = clean; then
+ 	case " $rmdirs " in
+-	  *" $objdir "*) ;;
+-	  *) rmdirs="$rmdirs $objdir" ;;
++	  *" $odir "*) ;;
++	  *) func_append rmdirs " $odir" ;;
+ 	esac
+       fi
+ 
+@@ -8486,18 +9499,17 @@ func_mode_uninstall ()
+ 
+ 	  # Delete the libtool libraries and symlinks.
+ 	  for n in $library_names; do
+-	    rmfiles="$rmfiles $objdir/$n"
++	    func_append rmfiles " $odir/$n"
+ 	  done
+-	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
++	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+ 
+-	  case "$mode" in
++	  case "$opt_mode" in
+ 	  clean)
+-	    case "  $library_names " in
+-	    # "  " in the beginning catches empty $dlname
++	    case " $library_names " in
+ 	    *" $dlname "*) ;;
+-	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
++	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+ 	    esac
+-	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
++	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+ 	    ;;
+ 	  uninstall)
+ 	    if test -n "$library_names"; then
+@@ -8525,19 +9537,19 @@ func_mode_uninstall ()
+ 	  # Add PIC object to the list of files to remove.
+ 	  if test -n "$pic_object" &&
+ 	     test "$pic_object" != none; then
+-	    rmfiles="$rmfiles $dir/$pic_object"
++	    func_append rmfiles " $dir/$pic_object"
+ 	  fi
+ 
+ 	  # Add non-PIC object to the list of files to remove.
+ 	  if test -n "$non_pic_object" &&
+ 	     test "$non_pic_object" != none; then
+-	    rmfiles="$rmfiles $dir/$non_pic_object"
++	    func_append rmfiles " $dir/$non_pic_object"
+ 	  fi
+ 	fi
+ 	;;
+ 
+       *)
+-	if test "$mode" = clean ; then
++	if test "$opt_mode" = clean ; then
+ 	  noexename=$name
+ 	  case $file in
+ 	  *.exe)
+@@ -8547,7 +9559,7 @@ func_mode_uninstall ()
+ 	    noexename=$func_stripname_result
+ 	    # $file with .exe has already been added to rmfiles,
+ 	    # add $file without .exe
+-	    rmfiles="$rmfiles $file"
++	    func_append rmfiles " $file"
+ 	    ;;
+ 	  esac
+ 	  # Do a test to see if this is a libtool program.
+@@ -8556,7 +9568,7 @@ func_mode_uninstall ()
+ 	      func_ltwrapper_scriptname "$file"
+ 	      relink_command=
+ 	      func_source $func_ltwrapper_scriptname_result
+-	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
++	      func_append rmfiles " $func_ltwrapper_scriptname_result"
+ 	    else
+ 	      relink_command=
+ 	      func_source $dir/$noexename
+@@ -8564,12 +9576,12 @@ func_mode_uninstall ()
+ 
+ 	    # note $name still contains .exe if it was in $file originally
+ 	    # as does the version of $file that was added into $rmfiles
+-	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
++	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+ 	    if test "$fast_install" = yes && test -n "$relink_command"; then
+-	      rmfiles="$rmfiles $objdir/lt-$name"
++	      func_append rmfiles " $odir/lt-$name"
+ 	    fi
+ 	    if test "X$noexename" != "X$name" ; then
+-	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
++	      func_append rmfiles " $odir/lt-${noexename}.c"
+ 	    fi
+ 	  fi
+ 	fi
+@@ -8577,7 +9589,6 @@ func_mode_uninstall ()
+       esac
+       func_show_eval "$RM $rmfiles" 'exit_status=1'
+     done
+-    objdir="$origobjdir"
+ 
+     # Try to remove the ${objdir}s in the directories where we deleted files
+     for dir in $rmdirs; do
+@@ -8589,16 +9600,16 @@ func_mode_uninstall ()
+     exit $exit_status
+ }
+ 
+-{ test "$mode" = uninstall || test "$mode" = clean; } &&
++{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+     func_mode_uninstall ${1+"$@"}
+ 
+-test -z "$mode" && {
++test -z "$opt_mode" && {
+   help="$generic_help"
+   func_fatal_help "you must specify a MODE"
+ }
+ 
+ test -z "$exec_cmd" && \
+-  func_fatal_help "invalid operation mode \`$mode'"
++  func_fatal_help "invalid operation mode \`$opt_mode'"
+ 
+ if test -n "$exec_cmd"; then
+   eval exec "$exec_cmd"
+diff --git a/ltoptions.m4 b/ltoptions.m4
+index 5ef12ce..17cfd51 100644
+--- a/ltoptions.m4
++++ b/ltoptions.m4
+@@ -8,7 +8,7 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ 
+-# serial 6 ltoptions.m4
++# serial 7 ltoptions.m4
+ 
+ # This is to help aclocal find these macros, as it can't see m4_define.
+ AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+diff --git a/ltversion.m4 b/ltversion.m4
+index bf87f77..9c7b5d4 100644
+--- a/ltversion.m4
++++ b/ltversion.m4
+@@ -7,17 +7,17 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ 
+-# Generated from ltversion.in.
++# @configure_input@
+ 
+-# serial 3134 ltversion.m4
++# serial 3293 ltversion.m4
+ # This file is part of GNU Libtool
+ 
+-m4_define([LT_PACKAGE_VERSION], [2.2.7a])
+-m4_define([LT_PACKAGE_REVISION], [1.3134])
++m4_define([LT_PACKAGE_VERSION], [2.4])
++m4_define([LT_PACKAGE_REVISION], [1.3293])
+ 
+ AC_DEFUN([LTVERSION_VERSION],
+-[macro_version='2.2.7a'
+-macro_revision='1.3134'
++[macro_version='2.4'
++macro_revision='1.3293'
+ _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+ _LT_DECL(, macro_revision, 0)
+ ])
+diff --git a/lt~obsolete.m4 b/lt~obsolete.m4
+index bf92b5e..c573da9 100644
+--- a/lt~obsolete.m4
++++ b/lt~obsolete.m4
+@@ -7,7 +7,7 @@
+ # unlimited permission to copy and/or distribute it, with or without
+ # modifications, as long as this notice is preserved.
+ 
+-# serial 4 lt~obsolete.m4
++# serial 5 lt~obsolete.m4
+ 
+ # These exist entirely to fool aclocal when bootstrapping libtool.
+ #
+diff --git a/opcodes/configure b/opcodes/configure
+index c9c04ce..31141d9 100755
+--- a/opcodes/configure
++++ b/opcodes/configure
+@@ -648,6 +648,9 @@ OTOOL
+ LIPO
+ NMEDIT
+ DSYMUTIL
++MANIFEST_TOOL
++ac_ct_AR
++DLLTOOL
+ OBJDUMP
+ LN_S
+ NM
+@@ -760,6 +763,7 @@ enable_static
+ with_pic
+ enable_fast_install
+ with_gnu_ld
++with_libtool_sysroot
+ enable_libtool_lock
+ enable_targets
+ enable_werror
+@@ -1420,6 +1424,8 @@ Optional Packages:
+   --with-pic              try to use only PIC/non-PIC objects [default=use
+                           both]
+   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
++  --with-libtool-sysroot=DIR Search for dependent libraries within DIR
++                        (or the compiler's sysroot if not specified).
+ 
+ Some influential environment variables:
+   CC          C compiler command
+@@ -5110,8 +5116,8 @@ esac
+ 
+ 
+ 
+-macro_version='2.2.7a'
+-macro_revision='1.3134'
++macro_version='2.4'
++macro_revision='1.3293'
+ 
+ 
+ 
+@@ -5151,7 +5157,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+ $as_echo_n "checking how to print strings... " >&6; }
+ # Test print first, because it will be a builtin if present.
+-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
++if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+    test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+   ECHO='print -r --'
+ elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+@@ -5837,8 +5843,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
+ # Try some XSI features
+ xsi_shell=no
+ ( _lt_dummy="a/b/c"
+-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+-      = c,a/b,, \
++  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
++      = c,a/b,b/c, \
+     && eval 'test $(( 1 + 1 )) -eq 2 \
+     && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+   && xsi_shell=yes
+@@ -5887,6 +5893,80 @@ esac
+ 
+ 
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
++$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
++if test "${lt_cv_to_host_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
++        ;;
++    esac
++    ;;
++  *-*-cygwin* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
++        ;;
++      *-*-cygwin* )
++        lt_cv_to_host_file_cmd=func_convert_file_noop
++        ;;
++      * ) # otherwise, assume *nix
++        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
++        ;;
++    esac
++    ;;
++  * ) # unhandled hosts (and "normal" native builds)
++    lt_cv_to_host_file_cmd=func_convert_file_noop
++    ;;
++esac
++
++fi
++
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
++$as_echo "$lt_cv_to_host_file_cmd" >&6; }
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
++$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
++if test "${lt_cv_to_tool_file_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  #assume ordinary cross tools, or native build.
++lt_cv_to_tool_file_cmd=func_convert_file_noop
++case $host in
++  *-*-mingw* )
++    case $build in
++      *-*-mingw* ) # actually msys
++        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
++        ;;
++    esac
++    ;;
++esac
++
++fi
++
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
++$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
++
++
++
++
++
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+ $as_echo_n "checking for $LD option to reload object files... " >&6; }
+ if test "${lt_cv_ld_reload_flag+set}" = set; then :
+@@ -5903,6 +5983,11 @@ case $reload_flag in
+ esac
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ case $host_os in
++  cygwin* | mingw* | pw32* | cegcc*)
++    if test "$GCC" != yes; then
++      reload_cmds=false
++    fi
++    ;;
+   darwin*)
+     if test "$GCC" = yes; then
+       reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+@@ -6071,7 +6156,8 @@ mingw* | pw32*)
+     lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+     lt_cv_file_magic_cmd='func_win32_libid'
+   else
+-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
++    # Keep this pattern in sync with the one in func_win32_libid.
++    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+     lt_cv_file_magic_cmd='$OBJDUMP -f'
+   fi
+   ;;
+@@ -6225,6 +6311,21 @@ esac
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+ $as_echo "$lt_cv_deplibs_check_method" >&6; }
++
++file_magic_glob=
++want_nocaseglob=no
++if test "$build" = "$host"; then
++  case $host_os in
++  mingw* | pw32*)
++    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
++      want_nocaseglob=yes
++    else
++      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
++    fi
++    ;;
++  esac
++fi
++
+ file_magic_cmd=$lt_cv_file_magic_cmd
+ deplibs_check_method=$lt_cv_deplibs_check_method
+ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+@@ -6240,9 +6341,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+ 
+ 
+ 
++
++
++
++
++
++
++
++
++
++
+ if test -n "$ac_tool_prefix"; then
+-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+-set dummy ${ac_tool_prefix}ar; ac_word=$2
++  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
++set dummy ${ac_tool_prefix}dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$DLLTOOL"; then
++  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++DLLTOOL=$ac_cv_prog_DLLTOOL
++if test -n "$DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
++$as_echo "$DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_DLLTOOL"; then
++  ac_ct_DLLTOOL=$DLLTOOL
++  # Extract the first word of "dlltool", so it can be a program name with args.
++set dummy dlltool; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_DLLTOOL"; then
++  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
++if test -n "$ac_ct_DLLTOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
++$as_echo "$ac_ct_DLLTOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_DLLTOOL" = x; then
++    DLLTOOL="false"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    DLLTOOL=$ac_ct_DLLTOOL
++  fi
++else
++  DLLTOOL="$ac_cv_prog_DLLTOOL"
++fi
++
++test -z "$DLLTOOL" && DLLTOOL=dlltool
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
++$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
++if test "${lt_cv_sharedlib_from_linklib_cmd+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_sharedlib_from_linklib_cmd='unknown'
++
++case $host_os in
++cygwin* | mingw* | pw32* | cegcc*)
++  # two different shell functions defined in ltmain.sh
++  # decide which to use based on capabilities of $DLLTOOL
++  case `$DLLTOOL --help 2>&1` in
++  *--identify-strict*)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
++    ;;
++  *)
++    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
++    ;;
++  esac
++  ;;
++*)
++  # fallback: assume linklib IS sharedlib
++  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
++  ;;
++esac
++
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
++$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
++sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
++test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
++
++
++
++
++
++
++
++if test -n "$ac_tool_prefix"; then
++  for ac_prog in ar
++  do
++    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
++set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_AR+set}" = set; then :
+@@ -6258,7 +6512,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_AR="${ac_tool_prefix}ar"
++    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6278,11 +6532,15 @@ $as_echo "no" >&6; }
+ fi
+ 
+ 
++    test -n "$AR" && break
++  done
+ fi
+-if test -z "$ac_cv_prog_AR"; then
++if test -z "$AR"; then
+   ac_ct_AR=$AR
+-  # Extract the first word of "ar", so it can be a program name with args.
+-set dummy ar; ac_word=$2
++  for ac_prog in ar
++do
++  # Extract the first word of "$ac_prog", so it can be a program name with args.
++set dummy $ac_prog; ac_word=$2
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+ $as_echo_n "checking for $ac_word... " >&6; }
+ if test "${ac_cv_prog_ac_ct_AR+set}" = set; then :
+@@ -6298,7 +6556,7 @@ do
+   test -z "$as_dir" && as_dir=.
+     for ac_exec_ext in '' $ac_executable_extensions; do
+   if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+-    ac_cv_prog_ac_ct_AR="ar"
++    ac_cv_prog_ac_ct_AR="$ac_prog"
+     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+     break 2
+   fi
+@@ -6317,6 +6575,10 @@ else
+ $as_echo "no" >&6; }
+ fi
+ 
++
++  test -n "$ac_ct_AR" && break
++done
++
+   if test "x$ac_ct_AR" = x; then
+     AR="false"
+   else
+@@ -6328,16 +6590,72 @@ ac_tool_warned=yes ;;
+ esac
+     AR=$ac_ct_AR
+   fi
+-else
+-  AR="$ac_cv_prog_AR"
+ fi
+ 
+-test -z "$AR" && AR=ar
+-test -z "$AR_FLAGS" && AR_FLAGS=cru
++: ${AR=ar}
++: ${AR_FLAGS=cru}
++
++
++
++
++
++
++
++
++
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
++$as_echo_n "checking for archiver @FILE support... " >&6; }
++if test "${lt_cv_ar_at_file+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_ar_at_file=no
++   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
+ 
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  echo conftest.$ac_objext > conftest.lst
++      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
++      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++      if test "$ac_status" -eq 0; then
++	# Ensure the archiver fails upon bogus file names.
++	rm -f conftest.$ac_objext libconftest.a
++	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
++  (eval $lt_ar_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }
++	if test "$ac_status" -ne 0; then
++          lt_cv_ar_at_file=@
++        fi
++      fi
++      rm -f conftest.* libconftest.a
+ 
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
++$as_echo "$lt_cv_ar_at_file" >&6; }
+ 
++if test "x$lt_cv_ar_at_file" = xno; then
++  archiver_list_spec=
++else
++  archiver_list_spec=$lt_cv_ar_at_file
++fi
+ 
+ 
+ 
+@@ -6679,8 +6997,8 @@ esac
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ 
+ # Transform an extracted symbol line into symbol name and symbol address
+-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
++lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+ 
+ # Handle CRLF in mingw tool chain
+ opt_cr=
+@@ -6716,6 +7034,7 @@ for ac_symprfx in "" "_"; do
+   else
+     lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+   fi
++  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+ 
+   # Check to see that the pipe works correctly.
+   pipe_works=no
+@@ -6757,6 +7076,18 @@ _LT_EOF
+       if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+ 	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+ 	  cat <<_LT_EOF > conftest.$ac_ext
++/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
++#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
++/* DATA imports from DLLs on WIN32 con't be const, because runtime
++   relocations are performed -- see ld's documentation on pseudo-relocs.  */
++# define LT_DLSYM_CONST
++#elif defined(__osf__)
++/* This system does not cope well with relocations in const data.  */
++# define LT_DLSYM_CONST
++#else
++# define LT_DLSYM_CONST const
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+@@ -6768,7 +7099,7 @@ _LT_EOF
+ 	  cat <<_LT_EOF >> conftest.$ac_ext
+ 
+ /* The mapping between symbol names and symbols.  */
+-const struct {
++LT_DLSYM_CONST struct {
+   const char *name;
+   void       *address;
+ }
+@@ -6794,8 +7125,8 @@ static const void *lt_preloaded_setup() {
+ _LT_EOF
+ 	  # Now try linking the two files.
+ 	  mv conftest.$ac_objext conftstm.$ac_objext
+-	  lt_save_LIBS="$LIBS"
+-	  lt_save_CFLAGS="$CFLAGS"
++	  lt_globsym_save_LIBS=$LIBS
++	  lt_globsym_save_CFLAGS=$CFLAGS
+ 	  LIBS="conftstm.$ac_objext"
+ 	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ 	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+@@ -6805,8 +7136,8 @@ _LT_EOF
+   test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ 	    pipe_works=yes
+ 	  fi
+-	  LIBS="$lt_save_LIBS"
+-	  CFLAGS="$lt_save_CFLAGS"
++	  LIBS=$lt_globsym_save_LIBS
++	  CFLAGS=$lt_globsym_save_CFLAGS
+ 	else
+ 	  echo "cannot find nm_test_func in $nlist" >&5
+ 	fi
+@@ -6843,6 +7174,16 @@ else
+ $as_echo "ok" >&6; }
+ fi
+ 
++# Response file support.
++if test "$lt_cv_nm_interface" = "MS dumpbin"; then
++  nm_file_list_spec='@'
++elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
++  nm_file_list_spec='@'
++fi
++
++
++
++
+ 
+ 
+ 
+@@ -6864,6 +7205,45 @@ fi
+ 
+ 
+ 
++
++
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
++$as_echo_n "checking for sysroot... " >&6; }
++
++# Check whether --with-libtool-sysroot was given.
++if test "${with_libtool_sysroot+set}" = set; then :
++  withval=$with_libtool_sysroot;
++else
++  with_libtool_sysroot=no
++fi
++
++
++lt_sysroot=
++case ${with_libtool_sysroot} in #(
++ yes)
++   if test "$GCC" = yes; then
++     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++   fi
++   ;; #(
++ /*)
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
++   ;; #(
++ no|'')
++   ;; #(
++ *)
++   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_libtool_sysroot}" >&5
++$as_echo "${with_libtool_sysroot}" >&6; }
++   as_fn_error "The sysroot must be an absolute path." "$LINENO" 5
++   ;;
++esac
++
++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
++$as_echo "${lt_sysroot:-no}" >&6; }
++
++
++
++
++
+ # Check whether --enable-libtool-lock was given.
+ if test "${enable_libtool_lock+set}" = set; then :
+   enableval=$enable_libtool_lock;
+@@ -7070,6 +7450,123 @@ esac
+ 
+ need_locks="$enable_libtool_lock"
+ 
++if test -n "$ac_tool_prefix"; then
++  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
++set dummy ${ac_tool_prefix}mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$MANIFEST_TOOL"; then
++  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
++if test -n "$MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
++$as_echo "$MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++fi
++if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
++  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
++  # Extract the first word of "mt", so it can be a program name with args.
++set dummy mt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_ac_ct_MANIFEST_TOOL+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$ac_ct_MANIFEST_TOOL"; then
++  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++fi
++fi
++ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
++if test -n "$ac_ct_MANIFEST_TOOL"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
++$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++  if test "x$ac_ct_MANIFEST_TOOL" = x; then
++    MANIFEST_TOOL=":"
++  else
++    case $cross_compiling:$ac_tool_warned in
++yes:)
++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
++ac_tool_warned=yes ;;
++esac
++    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
++  fi
++else
++  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
++fi
++
++test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
++$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
++if test "${lt_cv_path_mainfest_tool+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_path_mainfest_tool=no
++  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
++  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
++  cat conftest.err >&5
++  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
++    lt_cv_path_mainfest_tool=yes
++  fi
++  rm -f conftest*
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
++$as_echo "$lt_cv_path_mainfest_tool" >&6; }
++if test "x$lt_cv_path_mainfest_tool" != xyes; then
++  MANIFEST_TOOL=:
++fi
++
++
++
++
++
+ 
+   case $host_os in
+     rhapsody* | darwin*)
+@@ -7633,6 +8130,8 @@ _LT_EOF
+       $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+       echo "$AR cru libconftest.a conftest.o" >&5
+       $AR cru libconftest.a conftest.o 2>&5
++      echo "$RANLIB libconftest.a" >&5
++      $RANLIB libconftest.a 2>&5
+       cat > conftest.c << _LT_EOF
+ int main() { return 0;}
+ _LT_EOF
+@@ -7798,7 +8297,8 @@ fi
+ LIBTOOL_DEPS="$ltmain"
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(SHELL) $(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ 
+ 
+ 
+@@ -7887,7 +8387,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a `.a' archive for static linking (except MSVC,
+@@ -8185,8 +8685,6 @@ fi
+ lt_prog_compiler_pic=
+ lt_prog_compiler_static=
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 
+   if test "$GCC" = yes; then
+     lt_prog_compiler_wl='-Wl,'
+@@ -8352,6 +8850,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+ 	lt_prog_compiler_pic='--shared'
+ 	lt_prog_compiler_static='--static'
+ 	;;
++      nagfor*)
++	# NAG Fortran compiler
++	lt_prog_compiler_wl='-Wl,-Wl,,'
++	lt_prog_compiler_pic='-PIC'
++	lt_prog_compiler_static='-Bstatic'
++	;;
+       pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+         # Portland Group compilers (*not* the Pentium gcc compiler,
+ 	# which looks to be a dead project)
+@@ -8414,7 +8918,7 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-Bstatic'
+       case $cc_basename in
+-      f77* | f90* | f95*)
++      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+ 	lt_prog_compiler_wl='-Qoption ld ';;
+       *)
+ 	lt_prog_compiler_wl='-Wl,';;
+@@ -8471,13 +8975,17 @@ case $host_os in
+     lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+     ;;
+ esac
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+-$as_echo "$lt_prog_compiler_pic" >&6; }
+-
+-
+-
+-
+ 
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
++$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
++if test "${lt_cv_prog_compiler_pic+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
++$as_echo "$lt_cv_prog_compiler_pic" >&6; }
++lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+ 
+ #
+ # Check to make sure the PIC flag actually works.
+@@ -8538,6 +9046,11 @@ fi
+ 
+ 
+ 
++
++
++
++
++
+ #
+ # Check to make sure the static flag actually works.
+ #
+@@ -8888,7 +9401,8 @@ _LT_EOF
+       allow_undefined_flag=unsupported
+       always_export_symbols=no
+       enable_shared_with_static_runtimes=yes
+-      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
++      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+ 
+       if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+         archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+@@ -8936,7 +9450,7 @@ _LT_EOF
+       if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+ 	 && test "$tmp_diet" = no
+       then
+-	tmp_addflag=
++	tmp_addflag=' $pic_flag'
+ 	tmp_sharedflag='-shared'
+ 	case $cc_basename,$host_cpu in
+         pgcc*)				# Portland Group C compiler
+@@ -8987,12 +9501,12 @@ _LT_EOF
+ 	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+ 	  hardcode_libdir_flag_spec=
+ 	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+-	  archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
++	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+ 	  if test "x$supports_anon_versioning" = xyes; then
+ 	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+ 	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ 	      echo "local: *; };" >> $output_objdir/$libname.ver~
+-	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
++	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ 	  fi
+ 	  ;;
+ 	esac
+@@ -9006,8 +9520,8 @@ _LT_EOF
+ 	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+       else
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       fi
+       ;;
+ 
+@@ -9025,8 +9539,8 @@ _LT_EOF
+ 
+ _LT_EOF
+       elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9072,8 +9586,8 @@ _LT_EOF
+ 
+     *)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+-	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
++	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+       else
+ 	ld_shlibs=no
+       fi
+@@ -9203,7 +9717,13 @@ _LT_EOF
+ 	allow_undefined_flag='-berok'
+         # Determine the default libpath from the value encoded in an
+         # empty executable.
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++        if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9216,22 +9736,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+         hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+@@ -9243,7 +9770,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	else
+ 	 # Determine the default libpath from the value encoded in an
+ 	 # empty executable.
+-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	 if test "${lt_cv_aix_libpath+set}" = set; then
++  aix_libpath=$lt_cv_aix_libpath
++else
++  if test "${lt_cv_aix_libpath_+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ 
+ int
+@@ -9256,22 +9789,29 @@ main ()
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+ 
+-lt_aix_libpath_sed='
+-    /Import File Strings/,/^$/ {
+-	/^0/ {
+-	    s/^0  *\(.*\)$/\1/
+-	    p
+-	}
+-    }'
+-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-# Check for a 64-bit object if we didn't find anything.
+-if test -z "$aix_libpath"; then
+-  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+-fi
++  lt_aix_libpath_sed='
++      /Import File Strings/,/^$/ {
++	  /^0/ {
++	      s/^0  *\([^ ]*\) *$/\1/
++	      p
++	  }
++      }'
++  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  # Check for a 64-bit object if we didn't find anything.
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
++  fi
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
++  if test -z "$lt_cv_aix_libpath_"; then
++    lt_cv_aix_libpath_="/usr/lib:/lib"
++  fi
++
++fi
++
++  aix_libpath=$lt_cv_aix_libpath_
++fi
+ 
+ 	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ 	  # Warning - without using the other run time loading flags,
+@@ -9316,20 +9856,63 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+       # Microsoft Visual C++.
+       # hardcode_libdir_flag_spec is actually meaningless, as there is
+       # no search path for DLLs.
+-      hardcode_libdir_flag_spec=' '
+-      allow_undefined_flag=unsupported
+-      # Tell ltmain to make .lib files, not .a files.
+-      libext=lib
+-      # Tell ltmain to make .dll files, not .so files.
+-      shrext_cmds=".dll"
+-      # FIXME: Setting linknames here is a bad hack.
+-      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+-      # The linker will automatically build a .lib file if we build a DLL.
+-      old_archive_from_new_cmds='true'
+-      # FIXME: Should let the user specify the lib program.
+-      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+-      fix_srcfile_path='`cygpath -w "$srcfile"`'
+-      enable_shared_with_static_runtimes=yes
++      case $cc_basename in
++      cl*)
++	# Native MSVC
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	always_export_symbols=yes
++	file_list_spec='@'
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
++	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
++	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
++	  else
++	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
++	  fi~
++	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
++	  linknames='
++	# The linker will not automatically build a static lib if we build a DLL.
++	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
++	enable_shared_with_static_runtimes=yes
++	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
++	# Don't use ranlib
++	old_postinstall_cmds='chmod 644 $oldlib'
++	postlink_cmds='lt_outputfile="@OUTPUT@"~
++	  lt_tool_outputfile="@TOOL_OUTPUT@"~
++	  case $lt_outputfile in
++	    *.exe|*.EXE) ;;
++	    *)
++	      lt_outputfile="$lt_outputfile.exe"
++	      lt_tool_outputfile="$lt_tool_outputfile.exe"
++	      ;;
++	  esac~
++	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
++	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
++	    $RM "$lt_outputfile.manifest";
++	  fi'
++	;;
++      *)
++	# Assume MSVC wrapper
++	hardcode_libdir_flag_spec=' '
++	allow_undefined_flag=unsupported
++	# Tell ltmain to make .lib files, not .a files.
++	libext=lib
++	# Tell ltmain to make .dll files, not .so files.
++	shrext_cmds=".dll"
++	# FIXME: Setting linknames here is a bad hack.
++	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
++	# The linker will automatically build a .lib file if we build a DLL.
++	old_archive_from_new_cmds='true'
++	# FIXME: Should let the user specify the lib program.
++	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
++	enable_shared_with_static_runtimes=yes
++	;;
++      esac
+       ;;
+ 
+     darwin* | rhapsody*)
+@@ -9390,7 +9973,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+     freebsd* | dragonfly*)
+-      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
++      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       hardcode_libdir_flag_spec='-R$libdir'
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+@@ -9398,7 +9981,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux9*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
++	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       else
+ 	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+       fi
+@@ -9414,7 +9997,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 
+     hpux10*)
+       if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+-	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+       else
+ 	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+       fi
+@@ -9438,10 +10021,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ 	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	ia64*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	*)
+-	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
++	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ 	  ;;
+ 	esac
+       else
+@@ -9520,23 +10103,36 @@ fi
+ 
+     irix5* | irix6* | nonstopux*)
+       if test "$GCC" = yes; then
+-	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	# Try to use the -exported_symbol ld option, if it does not
+ 	# work, assume that -exports_file does not work either and
+ 	# implicitly export all symbols.
+-        save_LDFLAGS="$LDFLAGS"
+-        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++	# This should be the same for all languages, so no per-tag cache variable.
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
++$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
++if test "${lt_cv_irix_exported_symbol+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  save_LDFLAGS="$LDFLAGS"
++	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
++	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-int foo(void) {}
++int foo (void) { return 0; }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+-
++  lt_cv_irix_exported_symbol=yes
++else
++  lt_cv_irix_exported_symbol=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+-        LDFLAGS="$save_LDFLAGS"
++           LDFLAGS="$save_LDFLAGS"
++fi
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
++$as_echo "$lt_cv_irix_exported_symbol" >&6; }
++	if test "$lt_cv_irix_exported_symbol" = yes; then
++          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
++	fi
+       else
+ 	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ 	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+@@ -9621,7 +10217,7 @@ rm -f core conftest.err conftest.$ac_objext \
+     osf4* | osf5*)	# as osf3* with the addition of -msym flag
+       if test "$GCC" = yes; then
+ 	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+-	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
++	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ 	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+       else
+ 	allow_undefined_flag=' -expect_unresolved \*'
+@@ -9640,9 +10236,9 @@ rm -f core conftest.err conftest.$ac_objext \
+       no_undefined_flag=' -z defs'
+       if test "$GCC" = yes; then
+ 	wlarc='${wl}'
+-	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
++	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ 	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+-	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
++	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+       else
+ 	case `$CC -V 2>&1` in
+ 	*"Compilers 5.0"*)
+@@ -10218,8 +10814,9 @@ cygwin* | mingw* | pw32* | cegcc*)
+   need_version=no
+   need_lib_prefix=no
+ 
+-  case $GCC,$host_os in
+-  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
++  case $GCC,$cc_basename in
++  yes,*)
++    # gcc
+     library_names_spec='$libname.dll.a'
+     # DLL is installed to $(libdir)/../bin by postinstall_cmds
+     postinstall_cmds='base_file=`basename \${file}`~
+@@ -10252,13 +10849,71 @@ cygwin* | mingw* | pw32* | cegcc*)
+       library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+       ;;
+     esac
++    dynamic_linker='Win32 ld.exe'
++    ;;
++
++  *,cl*)
++    # Native MSVC
++    libname_spec='$name'
++    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
++    library_names_spec='${libname}.dll.lib'
++
++    case $build_os in
++    mingw*)
++      sys_lib_search_path_spec=
++      lt_save_ifs=$IFS
++      IFS=';'
++      for lt_path in $LIB
++      do
++        IFS=$lt_save_ifs
++        # Let DOS variable expansion print the short 8.3 style file name.
++        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
++        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
++      done
++      IFS=$lt_save_ifs
++      # Convert to MSYS style.
++      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
++      ;;
++    cygwin*)
++      # Convert to unix form, then to dos form, then back to unix form
++      # but this time dos style (no spaces!) so that the unix form looks
++      # like /cygdrive/c/PROGRA~1:/cygdr...
++      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
++      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
++      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      ;;
++    *)
++      sys_lib_search_path_spec="$LIB"
++      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
++        # It is most probably a Windows format PATH.
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
++      else
++        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
++      fi
++      # FIXME: find the short name or the path components, as spaces are
++      # common. (e.g. "Program Files" -> "PROGRA~1")
++      ;;
++    esac
++
++    # DLL is installed to $(libdir)/../bin by postinstall_cmds
++    postinstall_cmds='base_file=`basename \${file}`~
++      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
++      dldir=$destdir/`dirname \$dlpath`~
++      test -d \$dldir || mkdir -p \$dldir~
++      $install_prog $dir/$dlname \$dldir/$dlname'
++    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
++      dlpath=$dir/\$dldll~
++       $RM \$dlpath'
++    shlibpath_overrides_runpath=yes
++    dynamic_linker='Win32 link.exe'
+     ;;
+ 
+   *)
++    # Assume MSVC wrapper
+     library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
++    dynamic_linker='Win32 ld.exe'
+     ;;
+   esac
+-  dynamic_linker='Win32 ld.exe'
+   # FIXME: first we should search . and the directory the executable is in
+   shlibpath_var=PATH
+   ;;
+@@ -10350,7 +11005,7 @@ haiku*)
+   soname_spec='${libname}${release}${shared_ext}$major'
+   shlibpath_var=LIBRARY_PATH
+   shlibpath_overrides_runpath=yes
+-  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
++  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+   hardcode_into_libs=yes
+   ;;
+ 
+@@ -11190,10 +11845,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -11296,10 +11951,10 @@ else
+ /* When -fvisbility=hidden is used, assume the code has been annotated
+    correspondingly for the symbols needed.  */
+ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+-void fnord () __attribute__((visibility("default")));
++int fnord () __attribute__((visibility("default")));
+ #endif
+ 
+-void fnord () { int i=42; }
++int fnord () { return 42; }
+ int main ()
+ {
+   void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+@@ -12450,7 +13105,7 @@ if test "$enable_shared" = "yes"; then
+ # since libbfd may not pull in the entirety of libiberty.
+   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+   if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+   fi
+ 
+   case "${host}" in
+@@ -13422,13 +14077,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+ lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+ lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+ lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
++lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+ reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+ reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+ OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+ deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+ file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
++file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
++want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
++DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
++sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+ AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+ AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
++archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+ STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+ RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+ old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+@@ -13443,14 +14105,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
+ lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
++nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
++lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+ objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+ MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
++lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+ lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+ lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+ need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
++MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+ DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+ NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+ LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+@@ -13483,12 +14148,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
+ hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+ inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+ link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+ always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+ export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+ exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+ include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+ prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
++postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+ file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+ variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+ need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+@@ -13543,8 +14208,13 @@ reload_flag \
+ OBJDUMP \
+ deplibs_check_method \
+ file_magic_cmd \
++file_magic_glob \
++want_nocaseglob \
++DLLTOOL \
++sharedlib_from_linklib_cmd \
+ AR \
+ AR_FLAGS \
++archiver_list_spec \
+ STRIP \
+ RANLIB \
+ CC \
+@@ -13554,12 +14224,14 @@ lt_cv_sys_global_symbol_pipe \
+ lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
++nm_file_list_spec \
+ lt_prog_compiler_no_builtin_flag \
+-lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
++lt_prog_compiler_wl \
+ lt_prog_compiler_static \
+ lt_cv_prog_compiler_c_o \
+ need_locks \
++MANIFEST_TOOL \
+ DSYMUTIL \
+ NMEDIT \
+ LIPO \
+@@ -13575,7 +14247,6 @@ no_undefined_flag \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+-fix_srcfile_path \
+ exclude_expsyms \
+ include_expsyms \
+ file_list_spec \
+@@ -13611,6 +14282,7 @@ module_cmds \
+ module_expsym_cmds \
+ export_symbols_cmds \
+ prelink_cmds \
++postlink_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ finish_cmds \
+@@ -14367,7 +15039,8 @@ $as_echo X"$file" |
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ #
+ #   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+-#                 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
++#                 Inc.
+ #   Written by Gordon Matzigkeit, 1996
+ #
+ #   This file is part of GNU Libtool.
+@@ -14470,19 +15143,42 @@ SP2NL=$lt_lt_SP2NL
+ # turn newlines into spaces.
+ NL2SP=$lt_lt_NL2SP
+ 
++# convert \$build file names to \$host format.
++to_host_file_cmd=$lt_cv_to_host_file_cmd
++
++# convert \$build files to toolchain format.
++to_tool_file_cmd=$lt_cv_to_tool_file_cmd
++
+ # An object symbol dumper.
+ OBJDUMP=$lt_OBJDUMP
+ 
+ # Method to check whether dependent libraries are shared objects.
+ deplibs_check_method=$lt_deplibs_check_method
+ 
+-# Command to use when deplibs_check_method == "file_magic".
++# Command to use when deplibs_check_method = "file_magic".
+ file_magic_cmd=$lt_file_magic_cmd
+ 
++# How to find potential files when deplibs_check_method = "file_magic".
++file_magic_glob=$lt_file_magic_glob
++
++# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
++want_nocaseglob=$lt_want_nocaseglob
++
++# DLL creation program.
++DLLTOOL=$lt_DLLTOOL
++
++# Command to associate shared and link libraries.
++sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
++
+ # The archiver.
+ AR=$lt_AR
++
++# Flags to create an archive.
+ AR_FLAGS=$lt_AR_FLAGS
+ 
++# How to feed a file listing to the archiver.
++archiver_list_spec=$lt_archiver_list_spec
++
+ # A symbol stripping program.
+ STRIP=$lt_STRIP
+ 
+@@ -14512,6 +15208,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+ # Transform the output of nm in a C name address pair when lib prefix is needed.
+ global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+ 
++# Specify filename containing input files for \$NM.
++nm_file_list_spec=$lt_nm_file_list_spec
++
++# The root where to search for dependent libraries,and in which our libraries should be installed.
++lt_sysroot=$lt_sysroot
++
+ # The name of the directory that contains temporary libtool files.
+ objdir=$objdir
+ 
+@@ -14521,6 +15223,9 @@ MAGIC_CMD=$MAGIC_CMD
+ # Must we lock files when doing compilation?
+ need_locks=$lt_need_locks
+ 
++# Manifest tool.
++MANIFEST_TOOL=$lt_MANIFEST_TOOL
++
+ # Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+ DSYMUTIL=$lt_DSYMUTIL
+ 
+@@ -14635,12 +15340,12 @@ with_gcc=$GCC
+ # Compiler flag to turn off builtin functions.
+ no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+ 
+-# How to pass a linker flag through the compiler.
+-wl=$lt_lt_prog_compiler_wl
+-
+ # Additional compiler flags for building library objects.
+ pic_flag=$lt_lt_prog_compiler_pic
+ 
++# How to pass a linker flag through the compiler.
++wl=$lt_lt_prog_compiler_wl
++
+ # Compiler flag to prevent dynamic linking.
+ link_static_flag=$lt_lt_prog_compiler_static
+ 
+@@ -14727,9 +15432,6 @@ inherit_rpath=$inherit_rpath
+ # Whether libtool must link a program against all its dependency libraries.
+ link_all_deplibs=$link_all_deplibs
+ 
+-# Fix the shell variable \$srcfile for the compiler.
+-fix_srcfile_path=$lt_fix_srcfile_path
+-
+ # Set to "yes" if exported symbols are required.
+ always_export_symbols=$always_export_symbols
+ 
+@@ -14745,6 +15447,9 @@ include_expsyms=$lt_include_expsyms
+ # Commands necessary for linking programs (against libraries) with templates.
+ prelink_cmds=$lt_prelink_cmds
+ 
++# Commands necessary for finishing linking programs.
++postlink_cmds=$lt_postlink_cmds
++
+ # Specify filename containing input files.
+ file_list_spec=$lt_file_list_spec
+ 
+@@ -14777,210 +15482,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
+   # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+   # text mode, it properly converts lines to CR/LF.  This bash problem
+   # is reportedly fixed, but why not run on old versions too?
+-  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  case $xsi_shell in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_dirname_and_basename file append nondir_replacement
+-# perform func_basename and func_dirname in a single function
+-# call:
+-#   dirname:  Compute the dirname of FILE.  If nonempty,
+-#             add APPEND to the result, otherwise set result
+-#             to NONDIR_REPLACEMENT.
+-#             value returned in "$func_dirname_result"
+-#   basename: Compute filename of FILE.
+-#             value retuned in "$func_basename_result"
+-# Implementation must be kept synchronized with func_dirname
+-# and func_basename. For efficiency, we do not delegate to
+-# those functions but instead duplicate the functionality here.
+-func_dirname_and_basename ()
+-{
+-  case ${1} in
+-    */*) func_dirname_result="${1%/*}${2}" ;;
+-    *  ) func_dirname_result="${3}" ;;
+-  esac
+-  func_basename_result="${1##*/}"
+-}
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-func_stripname ()
+-{
+-  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+-  # positional parameters, so assign one to ordinary parameter first.
+-  func_stripname_result=${3}
+-  func_stripname_result=${func_stripname_result#"${1}"}
+-  func_stripname_result=${func_stripname_result%"${2}"}
+-}
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=${1%%=*}
+-  func_opt_split_arg=${1#*=}
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  case ${1} in
+-    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+-    *)    func_lo2o_result=${1} ;;
+-  esac
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=${1%.*}.lo
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=$(( $* ))
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=${#1}
+-}
+-
+-_LT_EOF
+-    ;;
+-  *) # Bourne compatible functions.
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_dirname file append nondir_replacement
+-# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+-# otherwise set result to NONDIR_REPLACEMENT.
+-func_dirname ()
+-{
+-  # Extract subdirectory from the argument.
+-  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+-  if test "X$func_dirname_result" = "X${1}"; then
+-    func_dirname_result="${3}"
+-  else
+-    func_dirname_result="$func_dirname_result${2}"
+-  fi
+-}
+-
+-# func_basename file
+-func_basename ()
+-{
+-  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+-}
+-
+-
+-# func_stripname prefix suffix name
+-# strip PREFIX and SUFFIX off of NAME.
+-# PREFIX and SUFFIX must not contain globbing or regex special
+-# characters, hashes, percent signs, but SUFFIX may contain a leading
+-# dot (in which case that matches only a dot).
+-# func_strip_suffix prefix name
+-func_stripname ()
+-{
+-  case ${2} in
+-    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+-    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+-  esac
+-}
+-
+-# sed scripts:
+-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+-my_sed_long_arg='1s/^-[^=]*=//'
+-
+-# func_opt_split
+-func_opt_split ()
+-{
+-  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+-  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+-}
+-
+-# func_lo2o object
+-func_lo2o ()
+-{
+-  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+-}
+-
+-# func_xform libobj-or-source
+-func_xform ()
+-{
+-  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+-}
+-
+-# func_arith arithmetic-term...
+-func_arith ()
+-{
+-  func_arith_result=`expr "$@"`
+-}
+-
+-# func_len string
+-# STRING may not start with a hyphen.
+-func_len ()
+-{
+-  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+-}
+-
+-_LT_EOF
+-esac
+-
+-case $lt_shell_append in
+-  yes)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1+=\$2"
+-}
+-_LT_EOF
+-    ;;
+-  *)
+-    cat << \_LT_EOF >> "$cfgfile"
+-
+-# func_append var value
+-# Append VALUE to the end of shell variable VAR.
+-func_append ()
+-{
+-  eval "$1=\$$1\$2"
+-}
+-
+-_LT_EOF
+-    ;;
+-  esac
+-
+-
+-  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+-    || (rm -f "$cfgfile"; exit 1)
+-
+-  mv -f "$cfgfile" "$ofile" ||
++  sed '$q' "$ltmain" >> "$cfgfile" \
++     || (rm -f "$cfgfile"; exit 1)
++
++  if test x"$xsi_shell" = xyes; then
++  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
++func_dirname ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_basename ()$/,/^} # func_basename /c\
++func_basename ()\
++{\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
++func_dirname_and_basename ()\
++{\
++\    case ${1} in\
++\      */*) func_dirname_result="${1%/*}${2}" ;;\
++\      *  ) func_dirname_result="${3}" ;;\
++\    esac\
++\    func_basename_result="${1##*/}"\
++} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
++func_stripname ()\
++{\
++\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
++\    # positional parameters, so assign one to ordinary parameter first.\
++\    func_stripname_result=${3}\
++\    func_stripname_result=${func_stripname_result#"${1}"}\
++\    func_stripname_result=${func_stripname_result%"${2}"}\
++} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
++func_split_long_opt ()\
++{\
++\    func_split_long_opt_name=${1%%=*}\
++\    func_split_long_opt_arg=${1#*=}\
++} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
++func_split_short_opt ()\
++{\
++\    func_split_short_opt_arg=${1#??}\
++\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
++} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
++func_lo2o ()\
++{\
++\    case ${1} in\
++\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
++\      *)    func_lo2o_result=${1} ;;\
++\    esac\
++} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_xform ()$/,/^} # func_xform /c\
++func_xform ()\
++{\
++    func_xform_result=${1%.*}.lo\
++} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_arith ()$/,/^} # func_arith /c\
++func_arith ()\
++{\
++    func_arith_result=$(( $* ))\
++} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_len ()$/,/^} # func_len /c\
++func_len ()\
++{\
++    func_len_result=${#1}\
++} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++fi
++
++if test x"$lt_shell_append" = xyes; then
++  sed -e '/^func_append ()$/,/^} # func_append /c\
++func_append ()\
++{\
++    eval "${1}+=\\${2}"\
++} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
++func_append_quoted ()\
++{\
++\    func_quote_for_eval "${2}"\
++\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
++} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
++  && mv -f "$cfgfile.tmp" "$cfgfile" \
++    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++test 0 -eq $? || _lt_function_replace_fail=:
++
++
++  # Save a `func_append' function call where possible by direct use of '+='
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++else
++  # Save a `func_append' function call even when '+=' is not available
++  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
++    && mv -f "$cfgfile.tmp" "$cfgfile" \
++      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
++  test 0 -eq $? || _lt_function_replace_fail=:
++fi
++
++if test x"$_lt_function_replace_fail" = x":"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
++$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
++fi
++
++
++   mv -f "$cfgfile" "$ofile" ||
+     (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+   chmod +x "$ofile"
+ 
+diff --git a/opcodes/configure.ac b/opcodes/configure.ac
+index b93e855..43ba976 100644
+--- a/opcodes/configure.ac
++++ b/opcodes/configure.ac
+@@ -167,7 +167,7 @@ changequote(,)dnl
+   x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+ changequote([,])dnl
+   if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
++    SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a"
+   fi
+ 
+   case "${host}" in
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch b/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch
new file mode 100644
index 0000000..a037634
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0007-Add-the-armv5e-architecture-to-binutils.patch
@@ -0,0 +1,35 @@
+From 743f42aaecb1ab89eba0eaf5e88ed67bbf3ba304 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:37:10 +0000
+Subject: [PATCH 07/13] Add the armv5e architecture to binutils
+
+Binutils has a comment that indicates it is supposed to match gcc for
+all of the support "-march=" settings, but it was lacking the armv5e setting.
+This was a simple way to add it, as thumb instructions shouldn't be generated
+by the compiler anyway.
+
+Upstream-Status: Denied
+Upstream maintainer indicated that we should not be using armv5e, even
+though it is a legal archicture defined by our gcc.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gas/config/tc-arm.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
+index 2db6c2d..ab48168 100644
+--- a/gas/config/tc-arm.c
++++ b/gas/config/tc-arm.c
+@@ -24463,6 +24463,7 @@ static const struct arm_arch_option_table arm_archs[] =
+   ARM_ARCH_OPT ("armv4t",	ARM_ARCH_V4T,	 FPU_ARCH_FPA),
+   ARM_ARCH_OPT ("armv4txm",	ARM_ARCH_V4TxM,	 FPU_ARCH_FPA),
+   ARM_ARCH_OPT ("armv5",	ARM_ARCH_V5,	 FPU_ARCH_VFP),
++  ARM_ARCH_OPT ("armv5e",	ARM_ARCH_V5TE,	 FPU_ARCH_VFP),
+   ARM_ARCH_OPT ("armv5t",	ARM_ARCH_V5T,	 FPU_ARCH_VFP),
+   ARM_ARCH_OPT ("armv5txm",	ARM_ARCH_V5TxM,	 FPU_ARCH_VFP),
+   ARM_ARCH_OPT ("armv5te",	ARM_ARCH_V5TE,	 FPU_ARCH_VFP),
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch b/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
new file mode 100644
index 0000000..0ae68fc
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0008-don-t-let-the-distro-compiler-point-to-the-wrong-ins.patch
@@ -0,0 +1,35 @@
+From 4d3a9f6db604055348332b56889d466c058fa5f3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:39:01 +0000
+Subject: [PATCH 08/13] don't let the distro compiler point to the wrong
+ installation location
+
+Thanks to RP for helping find the source code causing the issue.
+
+2010/08/13
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libiberty/Makefile.in | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
+index 9b87720..ff43f53 100644
+--- a/libiberty/Makefile.in
++++ b/libiberty/Makefile.in
+@@ -361,7 +361,8 @@ install-strip: install
+ # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
+ # default multilib, so we have to take CFLAGS into account as well,
+ # since it will be passed the multilib flags.
+-MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
++#MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
++MULTIOSDIR = ""
+ install_to_libdir: all
+ 	if test -n "${target_header_dir}"; then \
+ 		${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR); \
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0009-Upstream-Status-Inappropriate-distribution-codesourc.patch b/meta/recipes-devtools/binutils/binutils/0009-Upstream-Status-Inappropriate-distribution-codesourc.patch
new file mode 100644
index 0000000..f800796
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0009-Upstream-Status-Inappropriate-distribution-codesourc.patch
@@ -0,0 +1,278 @@
+From e02e119b278c3f404e97669e7180cac944134c91 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:41:04 +0000
+Subject: [PATCH 09/13] Upstream-Status: Inappropriate [distribution:
+ codesourcery]
+
+Patch originally created by Mark Hatle, forward-ported to
+binutils 2.21 by Scott Garman.
+
+purpose:  warn for uses of system directories when cross linking
+
+Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
+
+2008-07-02  Joseph Myers  <joseph@codesourcery.com>
+
+    ld/
+    * ld.h (args_type): Add error_poison_system_directories.
+    * ld.texinfo (--error-poison-system-directories): Document.
+    * ldfile.c (ldfile_add_library_path): Check
+    command_line.error_poison_system_directories.
+    * ldmain.c (main): Initialize
+    command_line.error_poison_system_directories.
+    * lexsup.c (enum option_values): Add
+    OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
+    (ld_options): Add --error-poison-system-directories.
+    (parse_args): Handle new option.
+
+2007-06-13  Joseph Myers  <joseph@codesourcery.com>
+
+    ld/
+    * config.in: Regenerate.
+    * ld.h (args_type): Add poison_system_directories.
+    * ld.texinfo (--no-poison-system-directories): Document.
+    * ldfile.c (ldfile_add_library_path): Check
+    command_line.poison_system_directories.
+    * ldmain.c (main): Initialize
+    command_line.poison_system_directories.
+    * lexsup.c (enum option_values): Add
+    OPTION_NO_POISON_SYSTEM_DIRECTORIES.
+    (ld_options): Add --no-poison-system-directories.
+    (parse_args): Handle new option.
+
+2007-04-20  Joseph Myers  <joseph@codesourcery.com>
+
+    Merge from Sourcery G++ binutils 2.17:
+
+    2007-03-20  Joseph Myers  <joseph@codesourcery.com>
+    Based on patch by Mark Hatle <mark.hatle@windriver.com>.
+    ld/
+    * configure.in (--enable-poison-system-directories): New option.
+    * configure, config.in: Regenerate.
+    * ldfile.c (ldfile_add_library_path): If
+    ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
+    /usr/lib, /usr/local/lib or /usr/X11R6/lib.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ld/config.in    |  3 +++
+ ld/configure    | 14 ++++++++++++++
+ ld/configure.ac | 10 ++++++++++
+ ld/ld.h         |  8 ++++++++
+ ld/ld.texinfo   | 12 ++++++++++++
+ ld/ldfile.c     | 17 +++++++++++++++++
+ ld/ldlex.h      |  2 ++
+ ld/ldmain.c     |  2 ++
+ ld/lexsup.c     | 16 ++++++++++++++++
+ 9 files changed, 84 insertions(+)
+
+diff --git a/ld/config.in b/ld/config.in
+index 2ab4844..766d23c 100644
+--- a/ld/config.in
++++ b/ld/config.in
+@@ -11,6 +11,9 @@
+    language is requested. */
+ #undef ENABLE_NLS
+ 
++/* Define to warn for use of native system library directories */
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++
+ /* Additional extension a shared object might have. */
+ #undef EXTRA_SHLIB_EXTENSION
+ 
+diff --git a/ld/configure b/ld/configure
+index 2fbaebf..5726a08 100755
+--- a/ld/configure
++++ b/ld/configure
+@@ -787,6 +787,7 @@ with_lib_path
+ enable_targets
+ enable_64_bit_bfd
+ with_sysroot
++enable_poison_system_directories
+ enable_gold
+ enable_got
+ enable_werror
+@@ -1443,6 +1444,8 @@ Optional Features:
+   --disable-largefile     omit support for large files
+   --enable-targets        alternative target configurations
+   --enable-64-bit-bfd     64-bit support (on hosts with narrower word sizes)
++  --enable-poison-system-directories
++                          warn for use of native system library directories
+   --enable-gold[=ARG]     build gold [ARG={default,yes,no}]
+   --enable-got=<type>     GOT handling scheme (target, single, negative,
+                           multigot)
+@@ -16323,7 +16326,18 @@ else
+ fi
+ 
+ 
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++  enableval=$enable_poison_system_directories;
++else
++  enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
+ 
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
+ 
+ # Check whether --enable-got was given.
+ if test "${enable_got+set}" = set; then :
+diff --git a/ld/configure.ac b/ld/configure.ac
+index 1bddfc9..e9edb7f 100644
+--- a/ld/configure.ac
++++ b/ld/configure.ac
+@@ -94,6 +94,16 @@ AC_SUBST(use_sysroot)
+ AC_SUBST(TARGET_SYSTEM_ROOT)
+ AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
+ 
++AC_ARG_ENABLE([poison-system-directories],
++         AS_HELP_STRING([--enable-poison-system-directories],
++                [warn for use of native system library directories]),,
++         [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++  AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++       [1],
++       [Define to warn for use of native system library directories])
++fi
++
+ dnl Use --enable-gold to decide if this linker should be the default.
+ dnl "install_as_default" is set to false if gold is the default linker.
+ dnl "installed_linker" is the installed BFD linker name.
+diff --git a/ld/ld.h b/ld/ld.h
+index f773ce7..adba0f6 100644
+--- a/ld/ld.h
++++ b/ld/ld.h
+@@ -161,6 +161,14 @@ typedef struct {
+   /* If TRUE we'll just print the default output on stdout.  */
+   bfd_boolean print_output_format;
+ 
++  /* If TRUE (the default) warn for uses of system directories when
++     cross linking.  */
++  bfd_boolean poison_system_directories;
++
++  /* If TRUE (default FALSE) give an error for uses of system
++     directories when cross linking instead of a warning.  */
++  bfd_boolean error_poison_system_directories;
++
+   /* Big or little endian as set on command line.  */
+   enum endian_enum endian;
+ 
+diff --git a/ld/ld.texinfo b/ld/ld.texinfo
+index 502582c..dae168a 100644
+--- a/ld/ld.texinfo
++++ b/ld/ld.texinfo
+@@ -2212,6 +2212,18 @@ string identifying the original linked file does not change.
+ 
+ Passing @code{none} for @var{style} disables the setting from any
+ @code{--build-id} options earlier on the command line.
++
++@kindex --no-poison-system-directories
++@item --no-poison-system-directories
++Do not warn for @option{-L} options using system directories such as
++@file{/usr/lib} when cross linking.  This option is intended for use
++in chroot environments when such directories contain the correct
++libraries for the target system rather than the host.
++
++@kindex --error-poison-system-directories
++@item --error-poison-system-directories
++Give an error instead of a warning for @option{-L} options using
++system directories when cross linking.
+ @end table
+ 
+ @c man end
+diff --git a/ld/ldfile.c b/ld/ldfile.c
+index 782ed7f..19a9ab4 100644
+--- a/ld/ldfile.c
++++ b/ld/ldfile.c
+@@ -114,6 +114,23 @@ ldfile_add_library_path (const char *name, bfd_boolean cmdline)
+     new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
+   else
+     new_dirs->name = xstrdup (name);
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++  if (command_line.poison_system_directories
++  && ((!strncmp (name, "/lib", 4))
++      || (!strncmp (name, "/usr/lib", 8))
++      || (!strncmp (name, "/usr/local/lib", 14))
++      || (!strncmp (name, "/usr/X11R6/lib", 14))))
++   {
++     if (command_line.error_poison_system_directories)
++       einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
++            "cross-compilation\n"), name);
++     else
++       einfo (_("%P: warning: library search path \"%s\" is unsafe for "
++            "cross-compilation\n"), name);
++   }
++#endif
++
+ }
+ 
+ /* Try to open a BFD for a lang_input_statement.  */
+diff --git a/ld/ldlex.h b/ld/ldlex.h
+index e3e9b24..29487a3 100644
+--- a/ld/ldlex.h
++++ b/ld/ldlex.h
+@@ -140,6 +140,8 @@ enum option_values
+   OPTION_IGNORE_UNRESOLVED_SYMBOL,
+   OPTION_PUSH_STATE,
+   OPTION_POP_STATE,
++  OPTION_NO_POISON_SYSTEM_DIRECTORIES,
++  OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
+ };
+ 
+ /* The initial parser states.  */
+diff --git a/ld/ldmain.c b/ld/ldmain.c
+index 818d108..54c49f2 100644
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -266,6 +266,8 @@ main (int argc, char **argv)
+   command_line.warn_mismatch = TRUE;
+   command_line.warn_search_mismatch = TRUE;
+   command_line.check_section_addresses = -1;
++  command_line.poison_system_directories = TRUE;
++  command_line.error_poison_system_directories = FALSE;
+ 
+   /* We initialize DEMANGLING based on the environment variable
+      COLLECT_NO_DEMANGLE.  The gcc collect2 program will demangle the
+diff --git a/ld/lexsup.c b/ld/lexsup.c
+index 4812c97..21b49df 100644
+--- a/ld/lexsup.c
++++ b/ld/lexsup.c
+@@ -513,6 +513,14 @@ static const struct ld_option ld_options[] =
+   { {"pop-state", no_argument, NULL, OPTION_POP_STATE},
+     '\0', NULL, N_("Pop state of flags governing input file handling"),
+     TWO_DASHES },
++  { {"no-poison-system-directories", no_argument, NULL,
++     OPTION_NO_POISON_SYSTEM_DIRECTORIES},
++    '\0', NULL, N_("Do not warn for -L options using system directories"),
++    TWO_DASHES },
++  { {"error-poison-system-directories", no_argument, NULL,
++    +     OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
++    '\0', NULL, N_("Give an error for -L options using system directories"),
++    TWO_DASHES },
+ };
+ 
+ #define OPTION_COUNT ARRAY_SIZE (ld_options)
+@@ -1474,6 +1482,14 @@ parse_args (unsigned argc, char **argv)
+ 	      free (oldp);
+ 	    }
+ 	  break;
++
++	case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
++	  command_line.poison_system_directories = FALSE;
++	  break;
++
++	case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
++	  command_line.error_poison_system_directories = TRUE;
++	  break;
+ 	}
+     }
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch b/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
new file mode 100644
index 0000000..5451e74
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0010-Fix-rpath-in-libtool-when-sysroot-is-enabled.patch
@@ -0,0 +1,52 @@
+From edbee9a68e1c2e11c059668aa1d13001d9f3de06 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:42:38 +0000
+Subject: [PATCH 10/13] Fix rpath in libtool when sysroot is enabled
+
+Enabling sysroot support in libtool exposed a bug where the final
+library had an RPATH encoded into it which still pointed to the
+sysroot. This works around the issue until it gets sorted out
+upstream.
+
+Fix suggested by Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 70e856e..11ee684 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -8035,9 +8035,11 @@ EOF
+ 	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ 	  for libdir in $rpath; do
+ 	    if test -n "$hardcode_libdir_flag_spec"; then
++		  func_replace_sysroot "$libdir"
++		  libdir=$func_replace_sysroot_result
++		  func_stripname '=' '' "$libdir"
++		  libdir=$func_stripname_result
+ 	      if test -n "$hardcode_libdir_separator"; then
+-		func_replace_sysroot "$libdir"
+-		libdir=$func_replace_sysroot_result
+ 		if test -z "$hardcode_libdirs"; then
+ 		  hardcode_libdirs="$libdir"
+ 		else
+@@ -8770,6 +8772,10 @@ EOF
+       hardcode_libdirs=
+       for libdir in $compile_rpath $finalize_rpath; do
+ 	if test -n "$hardcode_libdir_flag_spec"; then
++	  func_replace_sysroot "$libdir"
++	  libdir=$func_replace_sysroot_result
++	  func_stripname '=' '' "$libdir"
++	  libdir=$func_stripname_result
+ 	  if test -n "$hardcode_libdir_separator"; then
+ 	    if test -z "$hardcode_libdirs"; then
+ 	      hardcode_libdirs="$libdir"
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch b/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch
new file mode 100644
index 0000000..d9d57ee
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0011-Change-default-emulation-for-mips64-linux.patch
@@ -0,0 +1,59 @@
+From 2a5e8813d3c5db3e2b7d9dfa2ab27cccd5111e53 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:44:14 +0000
+Subject: [PATCH 11/13] Change default emulation for mips64*-*-linux
+
+we change the default emulations to be N64 instead of N32
+
+Upstream-Status: Inappropriate [ OE configuration Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ bfd/config.bfd   | 8 ++++----
+ ld/configure.tgt | 8 ++++----
+ 2 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/bfd/config.bfd b/bfd/config.bfd
+index 7bcb92a..03d2c6f 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -1062,12 +1062,12 @@ case "${targ}" in
+     targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec"
+     ;;
+   mips64*el-*-linux*)
+-    targ_defvec=mips_elf32_ntrad_le_vec
+-    targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec"
++    targ_defvec=mips_elf64_trad_le_vec
++    targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec"
+     ;;
+   mips64*-*-linux*)
+-    targ_defvec=mips_elf32_ntrad_be_vec
+-    targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
++    targ_defvec=mips_elf64_trad_be_vec
++    targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_be_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec"
+     ;;
+   mips*el-*-linux*)
+     targ_defvec=mips_elf32_trad_le_vec
+diff --git a/ld/configure.tgt b/ld/configure.tgt
+index 24e36d1..740b2ea 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -476,11 +476,11 @@ mips*el-*-vxworks*)	targ_emul=elf32elmipvxworks
+ mips*-*-vxworks*)	targ_emul=elf32ebmipvxworks
+ 		        targ_extra_emuls="elf32elmipvxworks" ;;
+ mips*-*-windiss)	targ_emul=elf32mipswindiss ;;
+-mips64*el-*-linux-*)	targ_emul=elf32ltsmipn32
+-			targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
++mips64*el-*-linux-*)	targ_emul=elf64ltsmip
++			targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
+ 			targ_extra_libpath=$targ_extra_emuls ;;
+-mips64*-*-linux-*)	targ_emul=elf32btsmipn32
+-			targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
++mips64*-*-linux-*)	targ_emul=elf64btsmip
++			targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip"
+ 			targ_extra_libpath=$targ_extra_emuls ;;
+ mips*el-*-linux-*)	targ_emul=elf32ltsmip
+ 			targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0012-Add-XLP-instructions-support.patch b/meta/recipes-devtools/binutils/binutils/0012-Add-XLP-instructions-support.patch
new file mode 100644
index 0000000..c56ff91
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0012-Add-XLP-instructions-support.patch
@@ -0,0 +1,428 @@
+From 448329ea097447aee73d050045295c5a0ae8519e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 01:51:05 +0000
+Subject: [PATCH 12/13] Add XLP instructions support
+
+From 26adb06ce515aadfec08ce13109b4b98287f677b Mon Sep 17 00:00:00 2001
+From: Nebu Philips <nphilips@netlogicmicro.com>
+Date: Fri, 30 Jul 2010 15:10:03 -0700
+Subject: [PATCH] Add support for Netlogic XLP
+
+Using the mipsisa64r2nlm target, add support for XLP from
+Netlogic. Also, update vendor name to NLM wherever applicable.
+---
+ bfd/aoutx.h           |    1 +
+ bfd/archures.c        |    1 +
+ bfd/bfd-in2.h         |    1 +
+ bfd/config.bfd        |    5 +++++
+ bfd/cpu-mips.c        |    6 ++++--
+ bfd/elfxx-mips.c      |    8 ++++++++
+ binutils/readelf.c    |    1 +
+ gas/config/tc-mips.c  |    4 +++-
+ gas/configure         |    3 +++
+ gas/configure.tgt     |    2 +-
+ include/elf/mips.h    |    1 +
+ include/opcode/mips.h |   10 ++++++++--
+ ld/configure.tgt      |    2 ++
+ opcodes/mips-dis.c    |   12 +++++-------
+ opcodes/mips-opc.c    |   33 +++++++++++++++++++++------------
+ 15 files changed, 65 insertions(+), 25 deletions(-)
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ bfd/aoutx.h           |  1 +
+ bfd/archures.c        |  1 +
+ bfd/bfd-in2.h         |  1 +
+ bfd/config.bfd        |  5 +++++
+ bfd/cpu-mips.c        |  6 ++++--
+ bfd/elfxx-mips.c      |  8 ++++++++
+ binutils/readelf.c    |  1 +
+ gas/config/tc-mips.c  |  4 +++-
+ gas/configure         |  3 +++
+ gas/configure.tgt     |  2 +-
+ include/elf/mips.h    |  1 +
+ include/opcode/mips.h | 10 ++++++++--
+ ld/configure.tgt      |  2 ++
+ opcodes/mips-dis.c    | 12 +++++-------
+ opcodes/mips-opc.c    | 33 +++++++++++++++++++++------------
+ 15 files changed, 65 insertions(+), 25 deletions(-)
+
+diff --git a/bfd/aoutx.h b/bfd/aoutx.h
+index 9385a98..a88df99 100644
+--- a/bfd/aoutx.h
++++ b/bfd/aoutx.h
+@@ -802,6 +802,7 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
+ 	case bfd_mach_mipsisa64r6:
+ 	case bfd_mach_mips_sb1:
+ 	case bfd_mach_mips_xlr:
++	case bfd_mach_mips_xlp:
+ 	  /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc.  */
+ 	  arch_flags = M_MIPS2;
+ 	  break;
+diff --git a/bfd/archures.c b/bfd/archures.c
+index c9fd6c8..547bd09 100644
+--- a/bfd/archures.c
++++ b/bfd/archures.c
+@@ -180,6 +180,7 @@ DESCRIPTION
+ .#define bfd_mach_mips_octeonp		6601
+ .#define bfd_mach_mips_octeon2		6502
+ .#define bfd_mach_mips_xlr              887682   {* decimal 'XLR'  *}
++.#define bfd_mach_mips_xlp              887680   {* decimal 'XLP'  *}
+ .#define bfd_mach_mipsisa32             32
+ .#define bfd_mach_mipsisa32r2           33
+ .#define bfd_mach_mipsisa32r3           34
+diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
+index c7a2bb5..413b773 100644
+--- a/bfd/bfd-in2.h
++++ b/bfd/bfd-in2.h
+@@ -1967,6 +1967,7 @@ enum bfd_architecture
+ #define bfd_mach_mips_octeonp          6601
+ #define bfd_mach_mips_octeon2          6502
+ #define bfd_mach_mips_xlr              887682   /* decimal 'XLR'  */
++#define bfd_mach_mips_xlp              887680   /* decimal 'XLP'  */
+ #define bfd_mach_mipsisa32             32
+ #define bfd_mach_mipsisa32r2           33
+ #define bfd_mach_mipsisa32r3           34
+diff --git a/bfd/config.bfd b/bfd/config.bfd
+index 03d2c6f..27086db 100644
+--- a/bfd/config.bfd
++++ b/bfd/config.bfd
+@@ -1041,6 +1041,11 @@ case "${targ}" in
+     targ_defvec=mips_elf32_le_vec
+     targ_selvecs="mips_elf32_be_vec mips_elf64_be_vec mips_elf64_le_vec"
+     ;;
++  mipsisa64*-*-elf*)
++	targ_defvec=mips_elf32_trad_be_vec
++	targ_selvecs="mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec"
++	want64=true
++	;;
+   mips*-*-elf* | mips*-*-rtems* | mips*-*-vxworks | mips*-*-windiss)
+     targ_defvec=mips_elf32_be_vec
+     targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec"
+diff --git a/bfd/cpu-mips.c b/bfd/cpu-mips.c
+index b617aaa..19a99d1 100644
+--- a/bfd/cpu-mips.c
++++ b/bfd/cpu-mips.c
+@@ -103,7 +103,8 @@ enum
+   I_mipsocteonp,
+   I_mipsocteon2,
+   I_xlr,
+-  I_micromips
++  I_micromips,
++  I_xlp
+ };
+ 
+ #define NN(index) (&arch_info_struct[(index) + 1])
+@@ -153,7 +154,8 @@ static const bfd_arch_info_type arch_info_struct[] =
+   N (64, 64, bfd_mach_mips_octeonp,"mips:octeon+",  FALSE, NN(I_mipsocteonp)),
+   N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2",  FALSE, NN(I_mipsocteon2)),
+   N (64, 64, bfd_mach_mips_xlr, "mips:xlr",       FALSE, NN(I_xlr)),
+-  N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,0)
++  N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,NN(I_micromips)),
++  N (64, 64, bfd_mach_mips_xlp, "mips:xlp",      FALSE, 0)
+ };
+ 
+ /* The default architecture is mips:3000, but with a machine number of
+diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
+index 0df7abf..d268e86 100644
+--- a/bfd/elfxx-mips.c
++++ b/bfd/elfxx-mips.c
+@@ -6608,6 +6608,9 @@ _bfd_elf_mips_mach (flagword flags)
+     case E_MIPS_MACH_XLR:
+       return bfd_mach_mips_xlr;
+ 
++	case E_MIPS_MACH_XLP:
++      return bfd_mach_mips_xlp;
++
+     default:
+       switch (flags & EF_MIPS_ARCH)
+ 	{
+@@ -11878,6 +11881,10 @@ mips_set_isa_flags (bfd *abfd)
+       val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON2;
+       break;
+ 
++	case bfd_mach_mips_xlp:
++	  val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_XLP;
++	  break;
++
+     case bfd_mach_mipsisa32:
+       val = E_MIPS_ARCH_32;
+       break;
+@@ -14765,6 +14772,7 @@ static const struct mips_mach_extension mips_mach_extensions[] =
+   { bfd_mach_mips_octeonp, bfd_mach_mips_octeon },
+   { bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 },
+   { bfd_mach_mips_loongson_3a, bfd_mach_mipsisa64r2 },
++  { bfd_mach_mips_xlp, bfd_mach_mipsisa64r2 },
+ 
+   /* MIPS64 extensions.  */
+   { bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 },
+diff --git a/binutils/readelf.c b/binutils/readelf.c
+index 0c00b2f..6e9d5e4 100644
+--- a/binutils/readelf.c
++++ b/binutils/readelf.c
+@@ -2898,6 +2898,7 @@ get_machine_flags (unsigned e_flags, unsigned e_machine)
+ 	    case E_MIPS_MACH_OCTEON2: strcat (buf, ", octeon2"); break;
+ 	    case E_MIPS_MACH_OCTEON3: strcat (buf, ", octeon3"); break;
+ 	    case E_MIPS_MACH_XLR:  strcat (buf, ", xlr"); break;
++		case E_MIPS_MACH_XLP:  strcat (buf, ", xlp"); break;
+ 	    case 0:
+ 	    /* We simply ignore the field in this case to avoid confusion:
+ 	       MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
+diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
+index c3e3e2a..8d64344 100644
+--- a/gas/config/tc-mips.c
++++ b/gas/config/tc-mips.c
+@@ -551,6 +551,7 @@ static int mips_32bitmode = 0;
+    || mips_opts.arch == CPU_RM7000                    \
+    || mips_opts.arch == CPU_VR5500                    \
+    || mips_opts.micromips                             \
++   || mips_opts.arch == CPU_XLP                       \
+    )
+ 
+ /* Whether the processor uses hardware interlocks to protect reads
+@@ -580,6 +581,7 @@ static int mips_32bitmode = 0;
+     && mips_opts.isa != ISA_MIPS3)                    \
+    || mips_opts.arch == CPU_R4300                     \
+    || mips_opts.micromips                             \
++   || mips_opts.arch == CPU_XLP                       \
+    )
+ 
+ /* Whether the processor uses hardware interlocks to protect reads
+@@ -18682,7 +18684,7 @@ static const struct mips_cpu_info mips_cpu_info_table[] =
+   /* Broadcom XLP.
+      XLP is mostly like XLR, with the prominent exception that it is
+      MIPS64R2 rather than MIPS64.  */
+-  { "xlp",	      0, 0,			ISA_MIPS64R2, CPU_XLR },
++  { "xlp",	      0, 0,			ISA_MIPS64R2, CPU_XLP },
+ 
+   /* End marker */
+   { NULL, 0, 0, 0, 0 }
+diff --git a/gas/configure b/gas/configure
+index 074886f..8091f2f 100755
+--- a/gas/configure
++++ b/gas/configure
+@@ -12808,6 +12808,9 @@ _ACEOF
+ 	  mipsisa64r6 | mipsisa64r6el)
+ 	    mips_cpu=mips64r6
+ 	    ;;
++	  mipsisa64r2nlm | mipsisa64r2nlmel)
++		mips_cpu=xlp
++		;;
+ 	  mipstx39 | mipstx39el)
+ 	    mips_cpu=r3900
+ 	    ;;
+diff --git a/gas/configure.tgt b/gas/configure.tgt
+index 1d92f55..06e8b4f 100644
+--- a/gas/configure.tgt
++++ b/gas/configure.tgt
+@@ -332,7 +332,7 @@ case ${generic_target} in
+   mips-*-sysv4*MP* | mips-*-gnu*)	fmt=elf em=tmips ;;
+   mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
+ 					fmt=elf em=tmips ;;
+-  mips-*-elf* | mips-*-rtems*)		fmt=elf ;;
++  mips-*-elf* | mips-*-rtems*)		fmt=elf em=tmips ;;
+   mips-*-netbsd*)			fmt=elf em=tmips ;;
+   mips-*-openbsd*)			fmt=elf em=tmips ;;
+ 
+diff --git a/include/elf/mips.h b/include/elf/mips.h
+index 2ed6acd..e541f50 100644
+--- a/include/elf/mips.h
++++ b/include/elf/mips.h
+@@ -285,6 +285,7 @@ END_RELOC_NUMBERS (R_MIPS_maxext)
+ #define E_MIPS_MACH_SB1         0x008a0000
+ #define E_MIPS_MACH_OCTEON	0x008b0000
+ #define E_MIPS_MACH_XLR     	0x008c0000
++#define E_MIPS_MACH_XLP         0x008f0000
+ #define E_MIPS_MACH_OCTEON2	0x008d0000
+ #define E_MIPS_MACH_OCTEON3	0x008e0000
+ #define E_MIPS_MACH_5400	0x00910000
+diff --git a/include/opcode/mips.h b/include/opcode/mips.h
+index ef26167..ef53ec6 100644
+--- a/include/opcode/mips.h
++++ b/include/opcode/mips.h
+@@ -1227,8 +1227,10 @@ static const unsigned int mips_isa_table[] = {
+ #define INSN_LOONGSON_2F          0x80000000
+ /* Loongson 3A.  */
+ #define INSN_LOONGSON_3A          0x00000400
+-/* RMI Xlr instruction */
+-#define INSN_XLR                 0x00000020
++/* Netlogic Xlr instruction */
++#define INSN_XLR		0x00000020
++/* Netlogic XlP instruction */
++#define INSN_XLP		0x00000040
+ 
+ /* DSP ASE */
+ #define ASE_DSP			0x00000001
+@@ -1324,6 +1326,7 @@ static const unsigned int mips_isa_table[] = {
+ #define CPU_OCTEONP	6601
+ #define CPU_OCTEON2	6502
+ #define CPU_XLR     	887682   	/* decimal 'XLR'   */
++#define CPU_XLP         887680      /* decimal 'XLP'   */
+ 
+ /* Return true if the given CPU is included in INSN_* mask MASK.  */
+ 
+@@ -1398,6 +1401,9 @@ cpu_is_member (int cpu, unsigned int mask)
+       return ((mask & INSN_ISA_MASK) == INSN_ISA32R6)
+ 	     || ((mask & INSN_ISA_MASK) == INSN_ISA64R6);
+ 
++    case CPU_XLP:
++      return (mask & INSN_XLP) != 0;
++
+     default:
+       return FALSE;
+     }
+diff --git a/ld/configure.tgt b/ld/configure.tgt
+index 740b2ea..4df13a7 100644
+--- a/ld/configure.tgt
++++ b/ld/configure.tgt
+@@ -462,6 +462,8 @@ mips*el-sde-elf*)	targ_emul=elf32ltsmip
+ mips*-sde-elf* | mips*-mti-elf* | mips*-img-elf*)
+ 			targ_emul=elf32btsmip
+ 			targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" ;;
++mipsisa64*-*-elf*)	targ_emul=elf32btsmip
++			targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip" ;;
+ mips64*el-ps2-elf*)	targ_emul=elf32lr5900n32
+ 			targ_extra_emuls="elf32lr5900"
+ 			targ_extra_libpath=$targ_extra_emuls ;;
+diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
+index 1eb1d45..d6881af 100644
+--- a/opcodes/mips-dis.c
++++ b/opcodes/mips-dis.c
+@@ -655,13 +655,11 @@ const struct mips_arch_choice mips_arch_choices[] =
+     mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr),
+     mips_cp1_names_mips3264, mips_hwr_names_numeric },
+ 
+-  /* XLP is mostly like XLR, with the prominent exception it is being
+-     MIPS64R2.  */
+-  { "xlp", 1, bfd_mach_mips_xlr, CPU_XLR,
+-    ISA_MIPS64R2 | INSN_XLR, 0,
+-    mips_cp0_names_xlr,
+-    mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr),
+-    mips_cp1_names_mips3264, mips_hwr_names_numeric },
++  { "xlp", 1, bfd_mach_mips_xlp, CPU_XLP,
++    ISA_MIPS64R2 | INSN_XLP, 0,
++    mips_cp0_names_mips3264r2,
++    mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2),
++    mips_hwr_names_mips3264r2 },
+ 
+   /* This entry, mips16, is here only for ISA/processor selection; do
+      not print its name.  */
+diff --git a/opcodes/mips-opc.c b/opcodes/mips-opc.c
+index 2c3bbad..9785a7e 100644
+--- a/opcodes/mips-opc.c
++++ b/opcodes/mips-opc.c
+@@ -319,7 +319,8 @@ decode_mips_operand (const char *p)
+ #define IOCT	(INSN_OCTEON | INSN_OCTEONP | INSN_OCTEON2)
+ #define IOCTP	(INSN_OCTEONP | INSN_OCTEON2)
+ #define IOCT2	INSN_OCTEON2
+-#define XLR     INSN_XLR
++#define XLR	INSN_XLR
++#define XLP	INSN_XLP
+ #define IVIRT	ASE_VIRT
+ #define IVIRT64	ASE_VIRT64
+ 
+@@ -956,6 +957,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"clo",			"U,s",		0x70000021, 0xfc0007ff, WR_1|RD_2,		0,		I32|N55,	0,	I37 },
+ {"clz",			"d,s",		0x00000050, 0xfc1f07ff, WR_1|RD_2,		0,		I37,		0,	0 },
+ {"clz",			"U,s",		0x70000020, 0xfc0007ff, WR_1|RD_2,		0,		I32|N55,	0,	I37 },
++{"crc",			"d,s,t",	0x7000001c, 0xfc0007ff,	WR_1|RD_2|RD_3,	0,		XLP, 		0,	0 },
+ /* ctc0 is at the bottom of the table.  */
+ {"ctc1",		"t,G",		0x44c00000, 0xffe007ff,	RD_1|WR_CC|CM,		0,		I1,		0,	0 },
+ {"ctc1",		"t,S",		0x44c00000, 0xffe007ff,	RD_1|WR_CC|CM,		0,		I1,		0,	0 },
+@@ -988,12 +990,13 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"daddiu",		"t,r,j",	0x64000000, 0xfc000000, WR_1|RD_2,		0,		I3,		0,	0 },
+ {"daddu",		"d,v,t",	0x0000002d, 0xfc0007ff, WR_1|RD_2|RD_3,		0,		I3,		0,	0 },
+ {"daddu",		"t,r,I",	0,    (int) M_DADDU_I,	INSN_MACRO,		0,		I3,		0,	0 },
+-{"daddwc",		"d,s,t", 	0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0,		XLR,		0,	0 },
++{"daddwc",		"d,s,t", 	0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0,		XLR|XLP,	0,	0 },
+ {"dbreak",		"",		0x7000003f, 0xffffffff,	0,			0,		N5,		0,	0 },
+ {"dclo",		"d,s",		0x00000053, 0xfc1f07ff, WR_1|RD_2,		0,		I69,		0,	0 },
+ {"dclo",		"U,s",	 	0x70000025, 0xfc0007ff, WR_1|RD_2, 	0,		I64|N55,	0,	I69 },
+ {"dclz",		"d,s",		0x00000052, 0xfc1f07ff, WR_1|RD_2,		0,		I69,		0,	0 },
+ {"dclz",		"U,s",	 	0x70000024, 0xfc0007ff, WR_1|RD_2, 	0,		I64|N55,	0,	I69 },
++{"dcrc",		"d,s,t",	0x7000001d, 0xfc0007ff, WR_1|RD_2|RD_3,	0,		XLP, 		0,	0 },
+ /* dctr and dctw are used on the r5000.  */
+ {"dctr",		"o(b)",	 	0xbc050000, 0xfc1f0000, RD_2,			0,		I3,		0,	0 },
+ {"dctw",		"o(b)",		0xbc090000, 0xfc1f0000, RD_2,			0,		I3,		0,	0 },
+@@ -1065,6 +1068,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"dmfc0",		"t,G,H",	0x40200000, 0xffe007f8,	WR_1|RD_C0|LC,		0,		I64,		0,	0 },
+ {"dmfgc0",		"t,G",		0x40600100, 0xffe007ff, WR_1|RD_C0|LC,		0,		0,		IVIRT64, 0 },
+ {"dmfgc0",		"t,G,H",	0x40600100, 0xffe007f8, WR_1|RD_C0|LC,		0,		0,		IVIRT64, 0 },
++{"dmfur",		"t,d",		0x7000001e, 0xffe007ff, WR_1,			0,		XLP,		0,	0 },
+ {"dmt",			"",		0x41600bc1, 0xffffffff, TRAP,			0,		0,		MT32,	0 },
+ {"dmt",			"t",		0x41600bc1, 0xffe0ffff, WR_1|TRAP,		0,		0,		MT32,	0 },
+ {"dmtc0",		"t,G",		0x40a00000, 0xffe007ff,	RD_1|WR_C0|WR_CC|CM,	0,		I3,		0,	EE },
+@@ -1080,6 +1084,8 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ /* dmfc3 is at the bottom of the table.  */
+ /* dmtc3 is at the bottom of the table.  */
+ {"dmuh",		"d,s,t",	0x000000dc, 0xfc0007ff, WR_1|RD_2|RD_3,		0,		I69,		0,	0 },
++{"dmtur",		"t,d",		0x7000001f, 0xffe007ff,	RD_1,			0,		XLP,		0,	0 },
++{"dmul",		"d,s,t",	0x70000006, 0xfc0007ff,	WR_1|RD_2|RD_3,		0,		XLP,		0,	0 },
+ {"dmul",		"d,s,t",	0x0000009c, 0xfc0007ff, WR_1|RD_2|RD_3,		0,		I69,		0,	0 },
+ {"dmul",		"d,v,t",	0x70000003, 0xfc0007ff, WR_1|RD_2|RD_3|WR_HILO,	0,		IOCT,		0,	0 },
+ {"dmul",		"d,v,t",	0,    (int) M_DMUL,	INSN_MACRO,		0,		I3,		0,	M32|I69 },
+@@ -1229,9 +1235,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"ld",			"s,-b(+R)",	0xec180000, 0xfc1c0000, WR_1,			RD_pc,		I69,		0,	0 },
+ {"ld",			"t,A(b)",	0,    (int) M_LD_AB,	INSN_MACRO,		0,		I1,		0,	0 },
+ {"ld",			"t,o(b)",	0xdc000000, 0xfc000000, WR_1|RD_3|LM,		0,		I3,		0,	0 },
+-{"ldaddw",		"t,b",		0x70000010, 0xfc00ffff,	MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
+-{"ldaddwu",		"t,b",		0x70000011, 0xfc00ffff,	MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
+-{"ldaddd",		"t,b",		0x70000012, 0xfc00ffff,	MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
++{"ldaddw",		"t,b",		0x70000010, 0xfc00ffff,	MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
++{"ldaddwu",		"t,b",		0x70000011, 0xfc00ffff,	MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
++{"ldaddd",		"t,b",		0x70000012, 0xfc00ffff,	MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
+ {"ldc1",		"T,o(b)",	0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D,	0,		I2,		0,	SF },
+ {"ldc1",		"E,o(b)",	0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D,	0,		I2,		0,	SF },
+ {"ldc1",		"T,A(b)",	0,    (int) M_LDC1_AB,	INSN_MACRO,		INSN2_M_FP_D,	I2,		0,	SF },
+@@ -1396,7 +1402,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"mflo",		"d,9",		0x00000012, 0xff9f07ff, WR_1|RD_LO,		0,		0,		D32,	0 },
+ {"mflo1",		"d",		0x70000012, 0xffff07ff,	WR_1|RD_LO,		0,		EE,		0,	0 },
+ {"mflhxu",		"d",		0x00000052, 0xffff07ff,	WR_1|MOD_HILO,		0,		0,		SMT,	0 },
+-{"mfcr",		"t,s",		0x70000018, 0xfc00ffff, WR_1|RD_2,		0,		XLR,		0,	0 },
++{"mfcr",		"t,s",		0x70000018, 0xfc00ffff, WR_1,			0,		XLR|XLP,	0,	0 },
+ {"mfsa",		"d",		0x00000028, 0xffff07ff,	WR_1,			0,		EE,		0,	0 },
+ {"min.ob",		"X,Y,Q",	0x78000006, 0xfc20003f,	WR_1|RD_2|RD_3|FP_D,	0,		SB1,		MX,	0 },
+ {"min.ob",		"D,S,Q",	0x48000006, 0xfc20003f,	WR_1|RD_2|RD_3|FP_D,	0,		N54,		0,	0 },
+@@ -1441,10 +1447,13 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ /* move is at the top of the table.  */
+ {"msgn.qh",		"X,Y,Q",	0x78200000, 0xfc20003f,	WR_1|RD_2|RD_3|FP_D,	0,		0,		MX,	0 },
+ {"msgsnd",		"t",		0,    (int) M_MSGSND,	INSN_MACRO,		0,		XLR,		0,	0 },
++{"msgsnds",		"d,t",		0x4a000001, 0xffe007ff,	WR_1|RD_2|RD_C0|WR_C0,	0,		XLP,		0,	0 },
+ {"msgld",		"", 		0,    (int) M_MSGLD,	INSN_MACRO,		0,		XLR,		0,	0 },
+ {"msgld",		"t",		0,    (int) M_MSGLD_T,	INSN_MACRO,		0,		XLR,		0,	0 },
+-{"msgwait",		"", 		0,    (int) M_MSGWAIT,	INSN_MACRO,		0,		XLR,		0,	0 },
+-{"msgwait",		"t",		0,    (int) M_MSGWAIT_T,INSN_MACRO,		0,		XLR,		0,	0 },
++{"msglds",		"d,t",		0x4a000002, 0xffe007ff,	WR_1|RD_2|RD_C0|WR_C0,	0,		XLP,		0,	0 },
++{"msgwait",		"",		0,    (int) M_MSGWAIT,  INSN_MACRO,		0,		XLR|XLP,	0,	0 },
++{"msgwait",		"t",		0,    (int) M_MSGWAIT_T,INSN_MACRO,		0,		XLR|XLP,	0,	0 },
++{"msgsync",		"",		0x4a000004, 0xffffffff,0,			0,		XLP,		0,	0 },
+ {"msub.d",		"D,R,S,T",	0x4c000029, 0xfc00003f, WR_1|RD_2|RD_3|RD_4|FP_D, 0,		I4_33,		0,	I37 },
+ {"msub.d",		"D,S,T",	0x46200019, 0xffe0003f,	WR_1|RD_2|RD_3|FP_D,	0,		IL2E,		0,	0 },
+ {"msub.d",		"D,S,T",	0x72200019, 0xffe0003f,	WR_1|RD_2|RD_3|FP_D,	0,		IL2F,		0,	0 },
+@@ -1494,7 +1503,7 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"mtlo",		"s,7",		0x00000013, 0xfc1fe7ff, RD_1|WR_LO,		0,		0,		D32,	0 },
+ {"mtlo1",		"s",		0x70000013, 0xfc1fffff,	RD_1|WR_LO,		0,		EE,		0,	0 },
+ {"mtlhx",		"s",		0x00000053, 0xfc1fffff,	RD_1|MOD_HILO,		0,		0,		SMT,	0 },
+-{"mtcr",		"t,s",		0x70000019, 0xfc00ffff, RD_1|RD_2,		0,		XLR,		0,	0 },
++{"mtcr",		"t,s",		0x70000019, 0xfc00ffff, RD_1,			0,		XLR|XLP,	0,	0 },
+ {"mtm0",		"s",		0x70000008, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
+ {"mtm1",		"s",		0x7000000c, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
+ {"mtm2",		"s",		0x7000000d, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
+@@ -1924,9 +1933,9 @@ const struct mips_opcode mips_builtin_opcodes[] =
+ {"suxc1",		"S,t(b)",	0x4c00000d, 0xfc0007ff, RD_1|RD_2|RD_3|SM|FP_D,	0,		I5_33|N55,	0,	I37},
+ {"sw",			"t,o(b)",	0xac000000, 0xfc000000,	RD_1|RD_3|SM,		0,		I1,		0,	0 },
+ {"sw",			"t,A(b)",	0,    (int) M_SW_AB,	INSN_MACRO,		0,		I1,		0,	0 },
+-{"swapw",		"t,b",		0x70000014, 0xfc00ffff, MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
+-{"swapwu",		"t,b",		0x70000015, 0xfc00ffff, MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
+-{"swapd",		"t,b",		0x70000016, 0xfc00ffff, MOD_1|RD_2|LM|SM,	0,		XLR,		0,	0 },
++{"swapw",		"t,b",		0x70000014, 0xfc00ffff, MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
++{"swapwu",		"t,b",		0x70000015, 0xfc00ffff, MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
++{"swapd",		"t,b",		0x70000016, 0xfc00ffff, MOD_1|RD_2|SM,		0,		XLR|XLP,	0,	0 },
+ {"swc0",		"E,o(b)",	0xe0000000, 0xfc000000,	RD_3|RD_C0|SM,		0,		I1,		0,	IOCT|IOCTP|IOCT2|I37 },
+ {"swc0",		"E,A(b)",	0,    (int) M_SWC0_AB,	INSN_MACRO,		0,		I1,		0,	IOCT|IOCTP|IOCT2|I37 },
+ {"swc1",		"T,o(b)",	0xe4000000, 0xfc000000,	RD_1|RD_3|SM|FP_S,	0,		I1,		0,	0 },
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0013-Fix-an-internal-error-in-do_print_to_mapfile-seen-wi.patch b/meta/recipes-devtools/binutils/binutils/0013-Fix-an-internal-error-in-do_print_to_mapfile-seen-wi.patch
new file mode 100644
index 0000000..aee01c0
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0013-Fix-an-internal-error-in-do_print_to_mapfile-seen-wi.patch
@@ -0,0 +1,35 @@
+From 8e8f77ec2b6262e7d10af54700c340173d957267 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 27 Feb 2015 09:05:49 +0000
+Subject: [PATCH 13/13] Fix an internal error in do_print_to_mapfile seen with
+ gold on arm
+
+This is due to missing implementation of do_print_to_mapfile for
+atrributea section (ARM.attributes), it started to show up after fix
+for PR gold/16980 was installed
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Submitted
+---
+ gold/attributes.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/gold/attributes.h b/gold/attributes.h
+index 2aa7a78..3d126e6 100644
+--- a/gold/attributes.h
++++ b/gold/attributes.h
+@@ -387,6 +387,10 @@ class Output_attributes_section_data : public Output_section_data
+   { }
+ 
+  protected:
++  // Write to a map file.
++  void
++  do_print_to_mapfile(Mapfile* mapfile) const
++  { mapfile->print_output_data(this, _("** attributes")); }
+   // Write the data to the output file.
+   void
+   do_write(Output_file*);
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0014-gold-arm-Skip-pic-check-for-R_ARM_REL32.patch b/meta/recipes-devtools/binutils/binutils/0014-gold-arm-Skip-pic-check-for-R_ARM_REL32.patch
new file mode 100644
index 0000000..e024302
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0014-gold-arm-Skip-pic-check-for-R_ARM_REL32.patch
@@ -0,0 +1,25 @@
+From ebe26d855452d07e0152bd78d4966475d2de1de8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 5 Mar 2015 07:30:31 +0000
+Subject: [PATCH] gold/arm: Skip pic check for R_ARM_REL32
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gold/arm.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gold/arm.cc b/gold/arm.cc
+index 6c472bb..fb80435 100644
+--- a/gold/arm.cc
++++ b/gold/arm.cc
+@@ -7829,6 +7829,7 @@ Target_arm<big_endian>::Scan::check_non_pic(Relobj* object,
+     case elfcpp::R_ARM_TLS_DTPMOD32:
+     case elfcpp::R_ARM_TLS_DTPOFF32:
+     case elfcpp::R_ARM_TLS_TPOFF32:
++    case elfcpp::R_ARM_REL32:
+       return;
+ 
+     default:
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/binutils/binutils/0015-Fix-dynamic-list-so-that-symbols-not-in-the-list-are.patch b/meta/recipes-devtools/binutils/binutils/0015-Fix-dynamic-list-so-that-symbols-not-in-the-list-are.patch
new file mode 100644
index 0000000..ee49c38
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/0015-Fix-dynamic-list-so-that-symbols-not-in-the-list-are.patch
@@ -0,0 +1,131 @@
+From e9c1bdad269c0c3352eebcc9481ed65144001b0b Mon Sep 17 00:00:00 2001
+From: Cary Coutant <ccoutant@google.com>
+Date: Mon, 16 Feb 2015 22:15:12 -0800
+Subject: [PATCH] Fix --dynamic-list so that symbols not in the list are still
+ exported.
+
+In PR 13577, the complaint was that -Bsymbolic was overriding the binding
+behavior for symbols listed in the --dynamic-list by setting the DT_SYMBOLIC
+tag in the dynamic table. In reading the Gnu ld manual, I decided that
+--dynamic-list should be mutually exclusive of -Bsymbolic, and modified
+gold so that --dynamic-list would treat symbols listed as preemptible,
+and all other symbols as internally bound. I was wrong.
+
+PR 16992 shows that with --dynamic-list (and not -Bsymbolic), a symbol
+not listed in the dynamic list is being internally bound within the
+shared library, but because it's still in the dynamic symbol table, we
+expose it to a COPY relocation, and things go really bad from there.
+
+(I can reproduce the same failure, simply by turning on -Bsymbolic-functions
+with the Gnu linker. Even though the symbol is bound internally, it's
+still exported to the dynamic symbol table, and is exposed to a COPY
+relocation.)
+
+I've backed out part of the fix for PR 13577, and -Bsymbolic (or
+-Bsymbolic-functions) can now be used with --dynamic-list, but if the
+two are used together, we do not set DT_SYMBOLIC or DF_SYMBOLIC
+(this matches Gnu ld behavior). We now treat symbols listed in the
+dynamic list as premptible, but we do not automatically treat symbols
+not listed there as non-premptible.
+
+gold/
+	PR gold/13577
+	PR gold/16992
+	* layout.cc (Layout::finish_dynamic_section): Don't set DT_SYMBOLIC or
+	DF_SYMBOLIC if --dynamic-list option is used.
+	* options.cc (General_options::finalize): --dynamic-list is not
+	mutually exclusive with -Bsymbolic.
+	* symtab.h (Symbol::is_preemptible): Don't exclude dynamic symbols not
+	listed in --dynamic-list.
+	* testsuite/Makefile.am (dynamic_list_lib2.so): Add
+	-Bsymbolic-functions.
+	* testsuite/Makefile.in: Regenerate.
+---
+Upstream-Status: Backport
+
+ gold/ChangeLog             | 14 ++++++++++++++
+ gold/layout.cc             |  3 ++-
+ gold/options.cc            |  7 -------
+ gold/symtab.h              |  6 ++----
+ gold/testsuite/Makefile.am |  2 +-
+ gold/testsuite/Makefile.in |  2 +-
+ 6 files changed, 20 insertions(+), 14 deletions(-)
+
+diff --git a/gold/layout.cc b/gold/layout.cc
+index bcdaac8..7836640 100644
+--- a/gold/layout.cc
++++ b/gold/layout.cc
+@@ -4873,7 +4873,8 @@ Layout::finish_dynamic_section(const Input_objects* input_objects,
+     flags |= elfcpp::DF_STATIC_TLS;
+   if (parameters->options().origin())
+     flags |= elfcpp::DF_ORIGIN;
+-  if (parameters->options().Bsymbolic())
++  if (parameters->options().Bsymbolic()
++      && !parameters->options().have_dynamic_list())
+     {
+       flags |= elfcpp::DF_SYMBOLIC;
+       // Add DT_SYMBOLIC for compatibility with older loaders.
+diff --git a/gold/options.cc b/gold/options.cc
+index 7eb8f27..7f1f69e 100644
+--- a/gold/options.cc
++++ b/gold/options.cc
+@@ -1200,13 +1200,6 @@ General_options::finalize()
+   // in the path, as appropriate.
+   this->add_sysroot();
+ 
+-  // --dynamic-list overrides -Bsymbolic and -Bsymbolic-functions.
+-  if (this->have_dynamic_list())
+-    {
+-      this->set_Bsymbolic(false);
+-      this->set_Bsymbolic_functions(false);
+-    }
+-
+   // Now that we've normalized the options, check for contradictory ones.
+   if (this->shared() && this->is_static())
+     gold_fatal(_("-shared and -static are incompatible"));
+diff --git a/gold/symtab.h b/gold/symtab.h
+index aa0cb68..9413360 100644
+--- a/gold/symtab.h
++++ b/gold/symtab.h
+@@ -604,10 +604,8 @@ class Symbol
+     if (parameters->options().in_dynamic_list(this->name()))
+       return true;
+ 
+-    // If the user used -Bsymbolic or provided a --dynamic-list script,
+-    // then nothing (else) is preemptible.
+-    if (parameters->options().Bsymbolic()
+-        || parameters->options().have_dynamic_list())
++    // If the user used -Bsymbolic, then nothing (else) is preemptible.
++    if (parameters->options().Bsymbolic())
+       return false;
+ 
+     // If the user used -Bsymbolic-functions, then functions are not
+diff --git a/gold/testsuite/Makefile.am b/gold/testsuite/Makefile.am
+index f767c21..7b73f9d 100644
+--- a/gold/testsuite/Makefile.am
++++ b/gold/testsuite/Makefile.am
+@@ -1518,7 +1518,7 @@ dynamic_list_lib1.o: dynamic_list_lib1.cc
+ 	$(CXXCOMPILE) -c -fpic -o $@ $<
+ 
+ dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t
+-	$(CXXLINK) -Bgcctestdir/ -shared -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
++	$(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
+ dynamic_list_lib2.o: dynamic_list_lib2.cc
+ 	$(CXXCOMPILE) -c -fpic -o $@ $<
+ 
+diff --git a/gold/testsuite/Makefile.in b/gold/testsuite/Makefile.in
+index 217e472..b4ae3fd 100644
+--- a/gold/testsuite/Makefile.in
++++ b/gold/testsuite/Makefile.in
+@@ -5319,7 +5319,7 @@ uninstall-am:
+ @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -c -fpic -o $@ $<
+ 
+ @GCC_TRUE@@NATIVE_LINKER_TRUE@dynamic_list_lib2.so: gcctestdir/ld dynamic_list_lib2.o $(srcdir)/dynamic_list_2.t
+-@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -shared -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
++@GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXLINK) -Bgcctestdir/ -shared -Wl,-Bsymbolic-functions -Wl,--dynamic-list,$(srcdir)/dynamic_list_2.t dynamic_list_lib2.o
+ @GCC_TRUE@@NATIVE_LINKER_TRUE@dynamic_list_lib2.o: dynamic_list_lib2.cc
+ @GCC_TRUE@@NATIVE_LINKER_TRUE@	$(CXXCOMPILE) -c -fpic -o $@ $<
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/binutils/binutils/add-thunderx-support-for-gas.patch b/meta/recipes-devtools/binutils/binutils/add-thunderx-support-for-gas.patch
new file mode 100644
index 0000000..0f6875e
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/add-thunderx-support-for-gas.patch
@@ -0,0 +1,33 @@
+Add thunderx support to gas
+
+Upstream-Status: Submitted [https://sourceware.org/ml/binutils/2014-10/msg00170.html]
+
+Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
+
+Author: Andrew Pinski <apinski@cavium.com>
+Date: Mon, 20 Oct 2014 11:42:58 -0700
+
+    This patch adds -mcpu=thunderx support to gas.
+
+diff -Naurp git_org/gas/config/tc-aarch64.c git/gas/config/tc-aarch64.c
+--- git_org/gas/config/tc-aarch64.c	2015-09-07 02:13:51.988973523 -0700
++++ git/gas/config/tc-aarch64.c	2015-09-07 02:15:21.705981540 -0700
+@@ -7206,6 +7206,7 @@ static const struct aarch64_cpu_option_t
+ 				 AARCH64_FEATURE_CRC), "Cortex-A57"},
+   {"cortex-a72", AARCH64_FEATURE (AARCH64_ARCH_V8,
+ 				  AARCH64_FEATURE_CRC), "Cortex-A72"},
++  {"thunderx",		AARCH64_ARCH_V8, "Cavium ThunderX"},				  
+   {"exynos-m1", AARCH64_FEATURE (AARCH64_ARCH_V8,
+ 				 AARCH64_FEATURE_CRC | AARCH64_FEATURE_CRYPTO),
+ 				 "Samsung Exynos M1"},
+diff -Naurp git_org/gas/doc/c-aarch64.texi git/gas/doc/c-aarch64.texi
+--- git_org/gas/doc/c-aarch64.texi	2015-09-07 02:13:51.969973522 -0700
++++ git/gas/doc/c-aarch64.texi	2015-09-07 02:16:03.364985262 -0700
+@@ -58,6 +58,7 @@ on the target processor.  The following
+ @code{cortex-a53},
+ @code{cortex-a57},
+ @code{cortex-a72},
++@code{thunderx},
+ @code{exynos-m1},
+ @code{xgene1},
+ and
diff --git a/meta/recipes-devtools/binutils/binutils/binutils-octeon3.patch b/meta/recipes-devtools/binutils/binutils/binutils-octeon3.patch
new file mode 100644
index 0000000..6108c0d
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/binutils-octeon3.patch
@@ -0,0 +1,272 @@
+Upstream-Status: Backport
+
+https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=2c62985659da21a3fe16062d211a7158f79ad2e9
+
+Signed-off-By: Armin Kuster <akuster@mvista.com>
+
+Index: git/bfd/archures.c
+===================================================================
+--- git.orig/bfd/archures.c
++++ git/bfd/archures.c
+@@ -179,6 +179,7 @@ DESCRIPTION
+ .#define bfd_mach_mips_octeon		6501
+ .#define bfd_mach_mips_octeonp		6601
+ .#define bfd_mach_mips_octeon2		6502
++.#define bfd_mach_mips_octeon3		6503
+ .#define bfd_mach_mips_xlr              887682   {* decimal 'XLR'  *}
+ .#define bfd_mach_mips_xlp              887680   {* decimal 'XLP'  *}
+ .#define bfd_mach_mipsisa32             32
+Index: git/bfd/bfd-in2.h
+===================================================================
+--- git.orig/bfd/bfd-in2.h
++++ git/bfd/bfd-in2.h
+@@ -1969,6 +1969,7 @@ enum bfd_architecture
+ #define bfd_mach_mips_octeon           6501
+ #define bfd_mach_mips_octeonp          6601
+ #define bfd_mach_mips_octeon2          6502
++#define bfd_mach_mips_octeon3          6503
+ #define bfd_mach_mips_xlr              887682   /* decimal 'XLR'  */
+ #define bfd_mach_mips_xlp              887680   /* decimal 'XLP'  */
+ #define bfd_mach_mipsisa32             32
+Index: git/bfd/cpu-mips.c
+===================================================================
+--- git.orig/bfd/cpu-mips.c
++++ git/bfd/cpu-mips.c
+@@ -102,6 +102,7 @@ enum
+   I_mipsocteon,
+   I_mipsocteonp,
+   I_mipsocteon2,
++  I_mipsocteon3,
+   I_xlr,
+   I_micromips,
+   I_xlp
+@@ -153,6 +154,7 @@ static const bfd_arch_info_type arch_inf
+   N (64, 64, bfd_mach_mips_octeon,"mips:octeon",  FALSE, NN(I_mipsocteon)),
+   N (64, 64, bfd_mach_mips_octeonp,"mips:octeon+",  FALSE, NN(I_mipsocteonp)),
+   N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2",  FALSE, NN(I_mipsocteon2)),
++  N (64, 64, bfd_mach_mips_octeon3,"mips:octeon3",  FALSE, NN(I_mipsocteon3)),
+   N (64, 64, bfd_mach_mips_xlr, "mips:xlr",       FALSE, NN(I_xlr)),
+   N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,NN(I_micromips)),
+   N (64, 64, bfd_mach_mips_xlp, "mips:xlp",      FALSE, 0)
+Index: git/bfd/elfxx-mips.c
+===================================================================
+--- git.orig/bfd/elfxx-mips.c
++++ git/bfd/elfxx-mips.c
+@@ -6604,6 +6604,9 @@ _bfd_elf_mips_mach (flagword flags)
+     case E_MIPS_MACH_LS3A:
+       return bfd_mach_mips_loongson_3a;
+ 
++    case E_MIPS_MACH_OCTEON3:
++      return bfd_mach_mips_octeon3;
++
+     case E_MIPS_MACH_OCTEON2:
+       return bfd_mach_mips_octeon2;
+ 
+@@ -11878,6 +11881,10 @@ mips_set_isa_flags (bfd *abfd)
+       val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON;
+       break;
+ 
++    case bfd_mach_mips_octeon3:
++      val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON3;
++      break;
++
+     case bfd_mach_mips_xlr:
+       val = E_MIPS_ARCH_64 | E_MIPS_MACH_XLR;
+       break;
+@@ -14773,6 +14780,7 @@ struct mips_mach_extension
+ static const struct mips_mach_extension mips_mach_extensions[] =
+ {
+   /* MIPS64r2 extensions.  */
++  { bfd_mach_mips_octeon3, bfd_mach_mips_octeon2 },
+   { bfd_mach_mips_octeon2, bfd_mach_mips_octeonp },
+   { bfd_mach_mips_octeonp, bfd_mach_mips_octeon },
+   { bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 },
+Index: git/gas/config/tc-mips.c
+===================================================================
+--- git.orig/gas/config/tc-mips.c
++++ git/gas/config/tc-mips.c
+@@ -306,7 +306,7 @@ static unsigned int file_ase_explicit;
+ unsigned long mips_gprmask;
+ unsigned long mips_cprmask[4];
+ 
+-/* True if any MIPS16 code was produced.  */
++/* 2True if any MIPS16 code was produced.  */
+ static int file_ase_mips16;
+ 
+ #define ISA_SUPPORTS_MIPS16E (mips_opts.isa == ISA_MIPS32		\
+@@ -510,7 +510,8 @@ static int mips_32bitmode = 0;
+ #define CPU_HAS_ROR(CPU)	CPU_HAS_DROR (CPU)
+ 
+ /* True if CPU is in the Octeon family */
+-#define CPU_IS_OCTEON(CPU) ((CPU) == CPU_OCTEON || (CPU) == CPU_OCTEONP || (CPU) == CPU_OCTEON2)
++#define CPU_IS_OCTEON(CPU) ((CPU) == CPU_OCTEON || (CPU) == CPU_OCTEONP \
++                           || (CPU) == CPU_OCTEON2 || (CPU) == CPU_OCTEON3)
+ 
+ /* True if CPU has seq/sne and seqi/snei instructions.  */
+ #define CPU_HAS_SEQ(CPU)	(CPU_IS_OCTEON (CPU))
+@@ -18677,6 +18678,7 @@ static const struct mips_cpu_info mips_c
+   { "octeon",	      0, 0,			ISA_MIPS64R2, CPU_OCTEON },
+   { "octeon+",	      0, 0,			ISA_MIPS64R2, CPU_OCTEONP },
+   { "octeon2",	      0, 0,			ISA_MIPS64R2, CPU_OCTEON2 },
++  { "octeon3",        0, ASE_VIRT | ASE_VIRT64, ISA_MIPS64R2, CPU_OCTEON3 },
+ 
+   /* RMI Xlr */
+   { "xlr",	      0, 0,			ISA_MIPS64,   CPU_XLR },
+Index: git/gas/doc/c-mips.texi
+===================================================================
+--- git.orig/gas/doc/c-mips.texi
++++ git/gas/doc/c-mips.texi
+@@ -382,6 +382,7 @@ loongson3a,
+ octeon,
+ octeon+,
+ octeon2,
++octeon3,
+ xlr,
+ xlp
+ @end quotation
+Index: git/gas/testsuite/gas/mips/mips.exp
+===================================================================
+--- git.orig/gas/testsuite/gas/mips/mips.exp
++++ git/gas/testsuite/gas/mips/mips.exp
+@@ -1102,6 +1102,7 @@ if { [istarget mips*-*-vxworks*] } {
+     run_list_test_arches "octeon-ill"	[mips_arch_list_matching octeon]
+     run_dump_test_arches "octeon-pref"	[mips_arch_list_matching octeon]
+     run_dump_test_arches "octeon2"	[mips_arch_list_matching octeon2]
++    run_dump_test_arches "octeon3"	[mips_arch_list_matching octeon3]
+ 
+     run_dump_test "smartmips"
+     run_dump_test_arches "mips32-dsp"	[mips_arch_list_matching mips32r2 \
+Index: git/gas/testsuite/gas/mips/octeon3.d
+===================================================================
+--- /dev/null
++++ git/gas/testsuite/gas/mips/octeon3.d
+@@ -0,0 +1,20 @@
++#objdump: -d -r --show-raw-insn
++#name: MIPS octeon3 instructions
++
++.*: +file format .*mips.*
++
++Disassembly of section .text:
++
++[0-9a-f]+ <foo>:
++.*:    71ec0008        mtm0    t3,t0
++.*:    71a40008        mtm0    t1,a0
++.*:    7083000c        mtm1    a0,v1
++.*:    70e1000c        mtm1    a3,at
++.*:    7022000d        mtm2    at,v0
++.*:    7083000c        mtm1    a0,v1
++.*:    70a20009        mtp0    a1,v0
++.*:    70c40009        mtp0    a2,a0
++.*:    7083000a        mtp1    a0,v1
++.*:    70e1000a        mtp1    a3,at
++.*:    7022000b        mtp2    at,v0
++.*:    7083000a        mtp1    a0,v1
+Index: git/gas/testsuite/gas/mips/octeon3.s
+===================================================================
+--- /dev/null
++++ git/gas/testsuite/gas/mips/octeon3.s
+@@ -0,0 +1,22 @@
+++       .text
++       .set noreorder
++       .set noat
++
++foo:
++        mtm0 $15,$12
++        mtm0 $13,$4
++
++        mtm1 $4,$3
++        mtm1 $7,$1
++
++        mtm2 $1,$2
++        mtm1 $4,$3
++
++        mtp0 $5,$2
++        mtp0 $6,$4
++
++        mtp1 $4,$3
++        mtp1 $7,$1
++
++        mtp2 $1,$2
++        mtp1 $4,$3
+Index: git/include/opcode/mips.h
+===================================================================
+--- git.orig/include/opcode/mips.h
++++ git/include/opcode/mips.h
+@@ -1196,6 +1196,7 @@ static const unsigned int mips_isa_table
+ #define INSN_OCTEON		  0x00000800
+ #define INSN_OCTEONP		  0x00000200
+ #define INSN_OCTEON2		  0x00000100
++#define INSN_OCTEON3		  0x00000040
+ 
+ /* MIPS R5900 instruction */
+ #define INSN_5900                 0x00004000
+@@ -1325,6 +1326,7 @@ static const unsigned int mips_isa_table
+ #define CPU_OCTEON	6501
+ #define CPU_OCTEONP	6601
+ #define CPU_OCTEON2	6502
++#define CPU_OCTEON3	6503
+ #define CPU_XLR     	887682   	/* decimal 'XLR'   */
+ #define CPU_XLP         887680      /* decimal 'XLP'   */
+ 
+@@ -1391,6 +1393,9 @@ cpu_is_member (int cpu, unsigned int mas
+     case CPU_OCTEON2:
+       return (mask & INSN_OCTEON2) != 0;
+ 
++    case CPU_OCTEON3:
++      return (mask & INSN_OCTEON3) != 0;
++
+     case CPU_XLR:
+       return (mask & INSN_XLR) != 0;
+ 
+Index: git/opcodes/mips-dis.c
+===================================================================
+--- git.orig/opcodes/mips-dis.c
++++ git/opcodes/mips-dis.c
+@@ -649,6 +649,11 @@ const struct mips_arch_choice mips_arch_
+     ISA_MIPS64R2 | INSN_OCTEON2, 0, mips_cp0_names_numeric,
+     NULL, 0, mips_cp1_names_mips3264, mips_hwr_names_numeric },
+ 
++  { "octeon3",   1, bfd_mach_mips_octeon3, CPU_OCTEON3,
++    ISA_MIPS64R2 | INSN_OCTEON3, ASE_VIRT | ASE_VIRT64,
++    mips_cp0_names_numeric,
++    NULL, 0, mips_hwr_names_numeric },
++
+   { "xlr", 1, bfd_mach_mips_xlr, CPU_XLR,
+     ISA_MIPS64 | INSN_XLR, 0,
+     mips_cp0_names_xlr,
+Index: git/opcodes/mips-opc.c
+===================================================================
+--- git.orig/opcodes/mips-opc.c
++++ git/opcodes/mips-opc.c
+@@ -316,9 +316,10 @@ decode_mips_operand (const char *p)
+ #define N5	(INSN_5400 | INSN_5500)
+ #define N54	INSN_5400
+ #define N55	INSN_5500
+-#define IOCT	(INSN_OCTEON | INSN_OCTEONP | INSN_OCTEON2)
+-#define IOCTP	(INSN_OCTEONP | INSN_OCTEON2)
+-#define IOCT2	INSN_OCTEON2
++#define IOCT	(INSN_OCTEON | INSN_OCTEONP | INSN_OCTEON2 | INSN_OCTEON3)
++#define IOCTP	(INSN_OCTEONP | INSN_OCTEON2 | INSN_OCTEON3)
++#define IOCT2	(INSN_OCTEON2 | INSN_OCTEON3)
++#define IOCT3  INSN_OCTEON3
+ #define XLR	INSN_XLR
+ #define XLP	INSN_XLP
+ #define IVIRT	ASE_VIRT
+@@ -1505,11 +1506,17 @@ const struct mips_opcode mips_builtin_op
+ {"mtlhx",		"s",		0x00000053, 0xfc1fffff,	RD_1|MOD_HILO,		0,		0,		SMT,	0 },
+ {"mtcr",		"t,s",		0x70000019, 0xfc00ffff, RD_1,			0,		XLR|XLP,	0,	0 },
+ {"mtm0",		"s",		0x70000008, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
++{"mtm0",                "s,t",          0x70000008, 0xfc00ffff, RD_1|RD_2,              0,              IOCT3,          0,      0 },
+ {"mtm1",		"s",		0x7000000c, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
++{"mtm1",                "s,t",          0x7000000c, 0xfc00ffff, RD_1|RD_2,              0,              IOCT3,          0,      0 },
+ {"mtm2",		"s",		0x7000000d, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
++{"mtm2",                "s,t",          0x7000000d, 0xfc00ffff, RD_1|RD_2,              0,              IOCT3,          0,      0 },
+ {"mtp0",		"s",		0x70000009, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
++{"mtp0",                "s,t",          0x70000009, 0xfc00ffff, RD_1|RD_2,              0,              IOCT3,          0,      0 },
+ {"mtp1",		"s",		0x7000000a, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
++{"mtp1",                "s,t",          0x7000000a, 0xfc00ffff, RD_1|RD_2,              0,              IOCT3,          0,      0 },
+ {"mtp2",		"s",		0x7000000b, 0xfc1fffff, RD_1,			0,		IOCT,		0,	0 },
++{"mtp2",                "s,t",          0x7000000b, 0xfc00ffff, RD_1|RD_2,              0,              IOCT3,          0,      0 },
+ {"mtsa",		"s",		0x00000029, 0xfc1fffff,	RD_1,			0,		EE,		0,	0 },
+ {"mtsab",		"s,j",		0x04180000, 0xfc1f0000,	RD_1,			0,		EE,		0,	0 },
+ {"mtsah",		"s,j",		0x04190000, 0xfc1f0000,	RD_1,			0,		EE,		0,	0 },
diff --git a/meta/recipes-devtools/binutils/binutils_2.25.1.bb b/meta/recipes-devtools/binutils/binutils_2.25.1.bb
new file mode 100644
index 0000000..6f42671
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils_2.25.1.bb
@@ -0,0 +1,39 @@
+require binutils.inc
+require binutils-${PV}.inc
+
+DEPENDS += "flex bison zlib"
+
+EXTRA_OECONF += "--with-sysroot=/ \
+                --enable-install-libbfd \
+                --enable-install-libiberty \
+                --enable-shared \
+                "
+
+EXTRA_OECONF_class-native = "--enable-targets=all \
+                             --enable-64-bit-bfd \
+                             --enable-install-libiberty \
+                             --enable-install-libbfd"
+
+do_install_class-native () {
+	autotools_do_install
+
+	# Install the libiberty header
+	install -d ${D}${includedir}
+	install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
+	install -m 644 ${S}/include/libiberty.h ${D}${includedir}
+
+	# We only want libiberty, libbfd and libopcodes
+	rm -rf ${D}${bindir}
+	rm -rf ${D}${prefix}/${TARGET_SYS}
+	rm -rf ${D}${prefix}/lib/ldscripts
+	rm -rf ${D}${prefix}/share/info
+	rm -rf ${D}${prefix}/share/locale
+	rm -rf ${D}${prefix}/share/man
+	rmdir ${D}${prefix}/share || :
+	rmdir ${D}/${libdir}/gcc-lib || :
+	rmdir ${D}/${libdir}64/gcc-lib || :
+	rmdir ${D}/${libdir} || :
+	rmdir ${D}/${libdir}64 || :
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..ba1a4ba
--- /dev/null
+++ b/meta/recipes-devtools/bison/bison/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch b/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch
new file mode 100644
index 0000000..9543a56
--- /dev/null
+++ b/meta/recipes-devtools/bison/bison/0001-src-local.mk-fix-parallel-issue.patch
@@ -0,0 +1,33 @@
+From 3a15f7c9ace6c0294edc313a1848cafcc31b2a92 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 24 Apr 2015 00:38:32 -0700
+Subject: [PATCH] src/local.mk: fix parallel issue
+
+Fixed:
+rm -f src/yacc src/yacc.tmp
+echo '#! /bin/sh' >src/yacc.tmp
+/bin/bash: src/yacc.tmp: No such file or directory
+Makefile:6670: recipe for target 'src/yacc' failed
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ src/local.mk |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/local.mk b/src/local.mk
+index 573ad00..28bfae4 100644
+--- a/src/local.mk
++++ b/src/local.mk
+@@ -119,6 +119,7 @@ MOSTLYCLEANFILES += src/yacc
+ 
+ src/yacc:
+ 	$(AM_V_GEN)rm -f $@ $@.tmp
++	$(AM_V_at)$(MKDIR_P) src
+ 	$(AM_V_at)echo '#! /bin/sh' >$@.tmp
+ 	$(AM_V_at)echo "exec '$(bindir)/bison' -y "'"$$@"' >>$@.tmp
+ 	$(AM_V_at)chmod a+x $@.tmp
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch b/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch
new file mode 100644
index 0000000..348ce1d
--- /dev/null
+++ b/meta/recipes-devtools/bison/bison/bison-2.3_m4.patch
@@ -0,0 +1,591 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- /dev/null
++++ bison-1.875/m4/inttypes-pri.m4
+@@ -0,0 +1,32 @@
++# inttypes-pri.m4 serial 1 (gettext-0.11.4)
++dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
++# macros to non-string values.  This is the case on AIX 4.3.3.
++
++AC_DEFUN([gt_INTTYPES_PRI],
++[
++  AC_REQUIRE([gt_HEADER_INTTYPES_H])
++  if test $gt_cv_header_inttypes_h = yes; then
++    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
++      gt_cv_inttypes_pri_broken,
++      [
++        AC_TRY_COMPILE([#include <inttypes.h>
++#ifdef PRId32
++char *p = PRId32;
++#endif
++], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
++      ])
++  fi
++  if test "$gt_cv_inttypes_pri_broken" = yes; then
++    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
++      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
++  fi
++])
+--- /dev/null
++++ bison-1.875/m4/lcmessage.m4
+@@ -0,0 +1,32 @@
++# lcmessage.m4 serial 3 (gettext-0.11.3)
++dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
++
++# Check whether LC_MESSAGES is available in <locale.h>.
++
++AC_DEFUN([AM_LC_MESSAGES],
++[
++  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
++    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
++       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
++  if test $am_cv_val_LC_MESSAGES = yes; then
++    AC_DEFINE(HAVE_LC_MESSAGES, 1,
++      [Define if your <locale.h> file defines LC_MESSAGES.])
++  fi
++])
+--- /dev/null
++++ bison-1.875/m4/uintmax_t.m4
+@@ -0,0 +1,29 @@
++# uintmax_t.m4 serial 6 (gettext-0.11)
++dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++AC_PREREQ(2.13)
++
++# Define uintmax_t to `unsigned long' or `unsigned long long'
++# if <inttypes.h> does not exist.
++
++AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
++[
++  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
++  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
++  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
++    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
++    test $ac_cv_type_unsigned_long_long = yes \
++      && ac_type='unsigned long long' \
++      || ac_type='unsigned long'
++    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
++  [Define to unsigned long or unsigned long long
++   if <inttypes.h> and <stdint.h> don't define.])
++  fi
++])
+--- /dev/null
++++ bison-1.875/m4/glibc21.m4
+@@ -0,0 +1,32 @@
++# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
++dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++# Test for the GNU C Library, version 2.1 or newer.
++# From Bruno Haible.
++
++AC_DEFUN([jm_GLIBC21],
++  [
++    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
++      ac_cv_gnu_library_2_1,
++      [AC_EGREP_CPP([Lucky GNU user],
++	[
++#include <features.h>
++#ifdef __GNU_LIBRARY__
++ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
++  Lucky GNU user
++ #endif
++#endif
++	],
++	ac_cv_gnu_library_2_1=yes,
++	ac_cv_gnu_library_2_1=no)
++      ]
++    )
++    AC_SUBST(GLIBC21)
++    GLIBC21="$ac_cv_gnu_library_2_1"
++  ]
++)
+--- /dev/null
++++ bison-1.875/m4/stdint_h.m4
+@@ -0,0 +1,28 @@
++# stdint_h.m4 serial 2 (gettext-0.11.4)
++dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
++# doesn't clash with <sys/types.h>, and declares uintmax_t.
++
++AC_DEFUN([jm_AC_HEADER_STDINT_H],
++[
++  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
++  [AC_TRY_COMPILE(
++    [#include <sys/types.h>
++#include <stdint.h>],
++    [uintmax_t i = (uintmax_t) -1;],
++    jm_ac_cv_header_stdint_h=yes,
++    jm_ac_cv_header_stdint_h=no)])
++  if test $jm_ac_cv_header_stdint_h = yes; then
++    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
++[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
++   and declares uintmax_t. ])
++  fi
++])
+--- /dev/null
++++ bison-1.875/m4/inttypes_h.m4
+@@ -0,0 +1,28 @@
++# inttypes_h.m4 serial 4 (gettext-0.11.4)
++dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
++# doesn't clash with <sys/types.h>, and declares uintmax_t.
++
++AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
++[
++  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
++  [AC_TRY_COMPILE(
++    [#include <sys/types.h>
++#include <inttypes.h>],
++    [uintmax_t i = (uintmax_t) -1;],
++    jm_ac_cv_header_inttypes_h=yes,
++    jm_ac_cv_header_inttypes_h=no)])
++  if test $jm_ac_cv_header_inttypes_h = yes; then
++    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
++[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
++   and declares uintmax_t. ])
++  fi
++])
+--- /dev/null
++++ bison-1.875/m4/ulonglong.m4
+@@ -0,0 +1,23 @@
++# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
++dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
++[
++  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
++  [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
++    [unsigned long long ullmax = (unsigned long long) -1;
++     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
++    ac_cv_type_unsigned_long_long=yes,
++    ac_cv_type_unsigned_long_long=no)])
++  if test $ac_cv_type_unsigned_long_long = yes; then
++    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
++      [Define if you have the unsigned long long type.])
++  fi
++])
+--- /dev/null
++++ bison-1.875/m4/codeset.m4
+@@ -0,0 +1,23 @@
++# codeset.m4 serial AM1 (gettext-0.10.40)
++dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([AM_LANGINFO_CODESET],
++[
++  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
++    [AC_TRY_LINK([#include <langinfo.h>],
++      [char* cs = nl_langinfo(CODESET);],
++      am_cv_langinfo_codeset=yes,
++      am_cv_langinfo_codeset=no)
++    ])
++  if test $am_cv_langinfo_codeset = yes; then
++    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
++      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
++  fi
++])
+--- /dev/null
++++ bison-1.875/m4/intdiv0.m4
+@@ -0,0 +1,72 @@
++# intdiv0.m4 serial 1 (gettext-0.11.3)
++dnl Copyright (C) 2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([gt_INTDIV0],
++[
++  AC_REQUIRE([AC_PROG_CC])dnl
++  AC_REQUIRE([AC_CANONICAL_HOST])dnl
++
++  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
++    gt_cv_int_divbyzero_sigfpe,
++    [
++      AC_TRY_RUN([
++#include <stdlib.h>
++#include <signal.h>
++
++static void
++#ifdef __cplusplus
++sigfpe_handler (int sig)
++#else
++sigfpe_handler (sig) int sig;
++#endif
++{
++  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
++  exit (sig != SIGFPE);
++}
++
++int x = 1;
++int y = 0;
++int z;
++int nan;
++
++int main ()
++{
++  signal (SIGFPE, sigfpe_handler);
++/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
++#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
++  signal (SIGTRAP, sigfpe_handler);
++#endif
++/* Linux/SPARC yields signal SIGILL.  */
++#if defined (__sparc__) && defined (__linux__)
++  signal (SIGILL, sigfpe_handler);
++#endif
++
++  z = x / y;
++  nan = y / y;
++  exit (1);
++}
++], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
++        [
++          # Guess based on the CPU.
++          case "$host_cpu" in
++            alpha* | i[34567]86 | m68k | s390*)
++              gt_cv_int_divbyzero_sigfpe="guessing yes";;
++            *)
++              gt_cv_int_divbyzero_sigfpe="guessing no";;
++          esac
++        ])
++    ])
++  case "$gt_cv_int_divbyzero_sigfpe" in
++    *yes) value=1;;
++    *) value=0;;
++  esac
++  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
++    [Define if integer division by zero raises signal SIGFPE.])
++])
+--- /dev/null
++++ bison-1.875/m4/glib.m4
+@@ -0,0 +1,196 @@
++# Configure paths for GLIB
++# Owen Taylor     97-11-3
++
++dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
++dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or 
++dnl gthread is specified in MODULES, pass to glib-config
++dnl
++AC_DEFUN(AM_PATH_GLIB,
++[dnl 
++dnl Get the cflags and libraries from the glib-config script
++dnl
++AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
++            glib_config_prefix="$withval", glib_config_prefix="")
++AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
++            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
++AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
++		    , enable_glibtest=yes)
++
++  if test x$glib_config_exec_prefix != x ; then
++     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
++     if test x${GLIB_CONFIG+set} != xset ; then
++        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
++     fi
++  fi
++  if test x$glib_config_prefix != x ; then
++     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
++     if test x${GLIB_CONFIG+set} != xset ; then
++        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
++     fi
++  fi
++
++  for module in . $4
++  do
++      case "$module" in
++         gmodule) 
++             glib_config_args="$glib_config_args gmodule"
++         ;;
++         gthread) 
++             glib_config_args="$glib_config_args gthread"
++         ;;
++      esac
++  done
++
++  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
++  min_glib_version=ifelse([$1], ,0.99.7,$1)
++  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
++  no_glib=""
++  if test "$GLIB_CONFIG" = "no" ; then
++    no_glib=yes
++  else
++    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
++    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
++    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
++           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
++    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
++           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
++    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
++           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
++    if test "x$enable_glibtest" = "xyes" ; then
++      ac_save_CFLAGS="$CFLAGS"
++      ac_save_LIBS="$LIBS"
++      CFLAGS="$CFLAGS $GLIB_CFLAGS"
++      LIBS="$GLIB_LIBS $LIBS"
++dnl
++dnl Now check if the installed GLIB is sufficiently new. (Also sanity
++dnl checks the results of glib-config to some extent
++dnl
++      rm -f conf.glibtest
++      AC_TRY_RUN([
++#include <glib.h>
++#include <stdio.h>
++#include <stdlib.h>
++
++int 
++main ()
++{
++  int major, minor, micro;
++  char *tmp_version;
++
++  system ("touch conf.glibtest");
++
++  /* HP/UX 9 (%@#!) writes to sscanf strings */
++  tmp_version = g_strdup("$min_glib_version");
++  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
++     printf("%s, bad version string\n", "$min_glib_version");
++     exit(1);
++   }
++
++  if ((glib_major_version != $glib_config_major_version) ||
++      (glib_minor_version != $glib_config_minor_version) ||
++      (glib_micro_version != $glib_config_micro_version))
++    {
++      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
++             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
++             glib_major_version, glib_minor_version, glib_micro_version);
++      printf ("*** was found! If glib-config was correct, then it is best\n");
++      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
++      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
++      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
++      printf("*** required on your system.\n");
++      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
++      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
++      printf("*** before re-running configure\n");
++    } 
++  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
++	   (glib_minor_version != GLIB_MINOR_VERSION) ||
++           (glib_micro_version != GLIB_MICRO_VERSION))
++    {
++      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
++	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
++      printf("*** library (version %d.%d.%d)\n",
++	     glib_major_version, glib_minor_version, glib_micro_version);
++    }
++  else
++    {
++      if ((glib_major_version > major) ||
++        ((glib_major_version == major) && (glib_minor_version > minor)) ||
++        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
++      {
++        return 0;
++       }
++     else
++      {
++        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
++               glib_major_version, glib_minor_version, glib_micro_version);
++        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
++	       major, minor, micro);
++        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
++        printf("***\n");
++        printf("*** If you have already installed a sufficiently new version, this error\n");
++        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
++        printf("*** being found. The easiest way to fix this is to remove the old version\n");
++        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
++        printf("*** correct copy of glib-config. (In this case, you will have to\n");
++        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
++        printf("*** so that the correct libraries are found at run-time))\n");
++      }
++    }
++  return 1;
++}
++],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
++       CFLAGS="$ac_save_CFLAGS"
++       LIBS="$ac_save_LIBS"
++     fi
++  fi
++  if test "x$no_glib" = x ; then
++     AC_MSG_RESULT(yes)
++     ifelse([$2], , :, [$2])     
++  else
++     AC_MSG_RESULT(no)
++     if test "$GLIB_CONFIG" = "no" ; then
++       echo "*** The glib-config script installed by GLIB could not be found"
++       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
++       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
++       echo "*** full path to glib-config."
++     else
++       if test -f conf.glibtest ; then
++        :
++       else
++          echo "*** Could not run GLIB test program, checking why..."
++          CFLAGS="$CFLAGS $GLIB_CFLAGS"
++          LIBS="$LIBS $GLIB_LIBS"
++          AC_TRY_LINK([
++#include <glib.h>
++#include <stdio.h>
++],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
++        [ echo "*** The test program compiled, but did not run. This usually means"
++          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
++          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
++          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
++          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
++          echo "*** is required on your system"
++	  echo "***"
++          echo "*** If you have an old version installed, it is best to remove it, although"
++          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
++          echo "***"
++          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
++          echo "*** came with the system with the command"
++          echo "***"
++          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
++        [ echo "*** The test program failed to compile or link. See the file config.log for the"
++          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
++          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
++          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
++          CFLAGS="$ac_save_CFLAGS"
++          LIBS="$ac_save_LIBS"
++       fi
++     fi
++     GLIB_CFLAGS=""
++     GLIB_LIBS=""
++     ifelse([$3], , :, [$3])
++  fi
++  AC_SUBST(GLIB_CFLAGS)
++  AC_SUBST(GLIB_LIBS)
++  rm -f conf.glibtest
++])
+--- /dev/null
++++ bison-1.875/m4/inttypes.m4
+@@ -0,0 +1,27 @@
++# inttypes.m4 serial 1 (gettext-0.11.4)
++dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
++# <sys/types.h>.
++
++AC_DEFUN([gt_HEADER_INTTYPES_H],
++[
++  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
++  [
++    AC_TRY_COMPILE(
++      [#include <sys/types.h>
++#include <inttypes.h>],
++      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
++  ])
++  if test $gt_cv_header_inttypes_h = yes; then
++    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
++      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
++  fi
++])
+--- /dev/null
++++ bison-1.875/m4/isc-posix.m4
+@@ -0,0 +1,26 @@
++# isc-posix.m4 serial 2 (gettext-0.11.2)
++dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
++
++# This test replaces the one in autoconf.
++# Currently this macro should have the same name as the autoconf macro
++# because gettext's gettext.m4 (distributed in the automake package)
++# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
++# give these diagnostics:
++#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
++#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
++
++undefine([AC_ISC_POSIX])
++
++AC_DEFUN([AC_ISC_POSIX],
++  [
++    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
++    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
++  ]
++)
+
diff --git a/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch b/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch
new file mode 100644
index 0000000..ac16c57
--- /dev/null
+++ b/meta/recipes-devtools/bison/bison/dont-depend-on-help2man.patch.patch
@@ -0,0 +1,46 @@
+From 4c0d7733f30903f8d7c7cd7433f5c8a7505e35f5 Mon Sep 17 00:00:00 2001
+From: Marko Lindqvist <cazfi74@gmail.com>
+Date: Tue, 21 Apr 2015 00:48:45 -0700
+Subject: [PATCH] doc/local.mk: dont-depend-on-help2man.patch
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+Updated for bison 3.0.4
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ doc/local.mk |    9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/doc/local.mk b/doc/local.mk
+index c340452..642f385 100644
+--- a/doc/local.mk
++++ b/doc/local.mk
+@@ -98,10 +98,7 @@ endif ! CROSS_COMPILING
+ ## Man Pages.  ##
+ ## ----------- ##
+ 
+-dist_man_MANS = $(top_srcdir)/doc/bison.1
+-
+-EXTRA_DIST += $(dist_man_MANS:.1=.x)
+-MAINTAINERCLEANFILES += $(dist_man_MANS)
++EXTRA_DIST += bison.x
+ 
+ # Differences to ignore when comparing the man page (the date).
+ remove_time_stamp = \
+@@ -124,10 +121,6 @@ $(top_srcdir)/doc/bison.1: $(MAN_DEPS)
+ 	fi
+ 	$(AM_V_at)rm -f $@*.t
+ 
+-if ENABLE_YACC
+-nodist_man_MANS = doc/yacc.1
+-endif
+-
+ ## ----------------------------- ##
+ ## Graphviz examples generation. ##
+ ## ----------------------------- ##
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/bison/bison/m4.patch b/meta/recipes-devtools/bison/bison/m4.patch
new file mode 100644
index 0000000..d139da5
--- /dev/null
+++ b/meta/recipes-devtools/bison/bison/m4.patch
@@ -0,0 +1,414 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+Index: bison-2.4.2/m4/lcmessage.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/lcmessage.m4
+@@ -0,0 +1,32 @@
++# lcmessage.m4 serial 3 (gettext-0.11.3)
++dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are *not* in the public domain.
++
++dnl Authors:
++dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
++
++# Check whether LC_MESSAGES is available in <locale.h>.
++
++AC_DEFUN([AM_LC_MESSAGES],
++[
++  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
++    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
++       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
++  if test $am_cv_val_LC_MESSAGES = yes; then
++    AC_DEFINE(HAVE_LC_MESSAGES, 1,
++      [Define if your <locale.h> file defines LC_MESSAGES.])
++  fi
++])
+Index: bison-2.4.2/m4/uintmax_t.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/uintmax_t.m4
+@@ -0,0 +1,29 @@
++# uintmax_t.m4 serial 6 (gettext-0.11)
++dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++AC_PREREQ(2.13)
++
++# Define uintmax_t to `unsigned long' or `unsigned long long'
++# if <inttypes.h> does not exist.
++
++AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
++[
++  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
++  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
++  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
++    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
++    test $ac_cv_type_unsigned_long_long = yes \
++      && ac_type='unsigned long long' \
++      || ac_type='unsigned long'
++    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
++  [Define to unsigned long or unsigned long long
++   if <inttypes.h> and <stdint.h> don't define.])
++  fi
++])
+Index: bison-2.4.2/m4/ulonglong.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/ulonglong.m4
+@@ -0,0 +1,23 @@
++# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
++dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert.
++
++AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
++[
++  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
++  [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
++    [unsigned long long ullmax = (unsigned long long) -1;
++     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
++    ac_cv_type_unsigned_long_long=yes,
++    ac_cv_type_unsigned_long_long=no)])
++  if test $ac_cv_type_unsigned_long_long = yes; then
++    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
++      [Define if you have the unsigned long long type.])
++  fi
++])
+Index: bison-2.4.2/m4/intdiv0.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/intdiv0.m4
+@@ -0,0 +1,72 @@
++# intdiv0.m4 serial 1 (gettext-0.11.3)
++dnl Copyright (C) 2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++AC_DEFUN([gt_INTDIV0],
++[
++  AC_REQUIRE([AC_PROG_CC])dnl
++  AC_REQUIRE([AC_CANONICAL_HOST])dnl
++
++  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
++    gt_cv_int_divbyzero_sigfpe,
++    [
++      AC_TRY_RUN([
++#include <stdlib.h>
++#include <signal.h>
++
++static void
++#ifdef __cplusplus
++sigfpe_handler (int sig)
++#else
++sigfpe_handler (sig) int sig;
++#endif
++{
++  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
++  exit (sig != SIGFPE);
++}
++
++int x = 1;
++int y = 0;
++int z;
++int nan;
++
++int main ()
++{
++  signal (SIGFPE, sigfpe_handler);
++/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
++#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
++  signal (SIGTRAP, sigfpe_handler);
++#endif
++/* Linux/SPARC yields signal SIGILL.  */
++#if defined (__sparc__) && defined (__linux__)
++  signal (SIGILL, sigfpe_handler);
++#endif
++
++  z = x / y;
++  nan = y / y;
++  exit (1);
++}
++], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
++        [
++          # Guess based on the CPU.
++          case "$host_cpu" in
++            alpha* | i[34567]86 | m68k | s390*)
++              gt_cv_int_divbyzero_sigfpe="guessing yes";;
++            *)
++              gt_cv_int_divbyzero_sigfpe="guessing no";;
++          esac
++        ])
++    ])
++  case "$gt_cv_int_divbyzero_sigfpe" in
++    *yes) value=1;;
++    *) value=0;;
++  esac
++  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
++    [Define if integer division by zero raises signal SIGFPE.])
++])
+Index: bison-2.4.2/m4/glib.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/glib.m4
+@@ -0,0 +1,196 @@
++# Configure paths for GLIB
++# Owen Taylor     97-11-3
++
++dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
++dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or 
++dnl gthread is specified in MODULES, pass to glib-config
++dnl
++AC_DEFUN(AM_PATH_GLIB,
++[dnl 
++dnl Get the cflags and libraries from the glib-config script
++dnl
++AC_ARG_WITH(glib-prefix,[  --with-glib-prefix=PFX   Prefix where GLIB is installed (optional)],
++            glib_config_prefix="$withval", glib_config_prefix="")
++AC_ARG_WITH(glib-exec-prefix,[  --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
++            glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
++AC_ARG_ENABLE(glibtest, [  --disable-glibtest       Do not try to compile and run a test GLIB program],
++		    , enable_glibtest=yes)
++
++  if test x$glib_config_exec_prefix != x ; then
++     glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
++     if test x${GLIB_CONFIG+set} != xset ; then
++        GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
++     fi
++  fi
++  if test x$glib_config_prefix != x ; then
++     glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
++     if test x${GLIB_CONFIG+set} != xset ; then
++        GLIB_CONFIG=$glib_config_prefix/bin/glib-config
++     fi
++  fi
++
++  for module in . $4
++  do
++      case "$module" in
++         gmodule) 
++             glib_config_args="$glib_config_args gmodule"
++         ;;
++         gthread) 
++             glib_config_args="$glib_config_args gthread"
++         ;;
++      esac
++  done
++
++  AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
++  min_glib_version=ifelse([$1], ,0.99.7,$1)
++  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
++  no_glib=""
++  if test "$GLIB_CONFIG" = "no" ; then
++    no_glib=yes
++  else
++    GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
++    GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
++    glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
++           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
++    glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
++           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
++    glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
++           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
++    if test "x$enable_glibtest" = "xyes" ; then
++      ac_save_CFLAGS="$CFLAGS"
++      ac_save_LIBS="$LIBS"
++      CFLAGS="$CFLAGS $GLIB_CFLAGS"
++      LIBS="$GLIB_LIBS $LIBS"
++dnl
++dnl Now check if the installed GLIB is sufficiently new. (Also sanity
++dnl checks the results of glib-config to some extent
++dnl
++      rm -f conf.glibtest
++      AC_TRY_RUN([
++#include <glib.h>
++#include <stdio.h>
++#include <stdlib.h>
++
++int 
++main ()
++{
++  int major, minor, micro;
++  char *tmp_version;
++
++  system ("touch conf.glibtest");
++
++  /* HP/UX 9 (%@#!) writes to sscanf strings */
++  tmp_version = g_strdup("$min_glib_version");
++  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
++     printf("%s, bad version string\n", "$min_glib_version");
++     exit(1);
++   }
++
++  if ((glib_major_version != $glib_config_major_version) ||
++      (glib_minor_version != $glib_config_minor_version) ||
++      (glib_micro_version != $glib_config_micro_version))
++    {
++      printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", 
++             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
++             glib_major_version, glib_minor_version, glib_micro_version);
++      printf ("*** was found! If glib-config was correct, then it is best\n");
++      printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
++      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
++      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
++      printf("*** required on your system.\n");
++      printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
++      printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
++      printf("*** before re-running configure\n");
++    } 
++  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
++	   (glib_minor_version != GLIB_MINOR_VERSION) ||
++           (glib_micro_version != GLIB_MICRO_VERSION))
++    {
++      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
++	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
++      printf("*** library (version %d.%d.%d)\n",
++	     glib_major_version, glib_minor_version, glib_micro_version);
++    }
++  else
++    {
++      if ((glib_major_version > major) ||
++        ((glib_major_version == major) && (glib_minor_version > minor)) ||
++        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
++      {
++        return 0;
++       }
++     else
++      {
++        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
++               glib_major_version, glib_minor_version, glib_micro_version);
++        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
++	       major, minor, micro);
++        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
++        printf("***\n");
++        printf("*** If you have already installed a sufficiently new version, this error\n");
++        printf("*** probably means that the wrong copy of the glib-config shell script is\n");
++        printf("*** being found. The easiest way to fix this is to remove the old version\n");
++        printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
++        printf("*** correct copy of glib-config. (In this case, you will have to\n");
++        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
++        printf("*** so that the correct libraries are found at run-time))\n");
++      }
++    }
++  return 1;
++}
++],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
++       CFLAGS="$ac_save_CFLAGS"
++       LIBS="$ac_save_LIBS"
++     fi
++  fi
++  if test "x$no_glib" = x ; then
++     AC_MSG_RESULT(yes)
++     ifelse([$2], , :, [$2])     
++  else
++     AC_MSG_RESULT(no)
++     if test "$GLIB_CONFIG" = "no" ; then
++       echo "*** The glib-config script installed by GLIB could not be found"
++       echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
++       echo "*** your path, or set the GLIB_CONFIG environment variable to the"
++       echo "*** full path to glib-config."
++     else
++       if test -f conf.glibtest ; then
++        :
++       else
++          echo "*** Could not run GLIB test program, checking why..."
++          CFLAGS="$CFLAGS $GLIB_CFLAGS"
++          LIBS="$LIBS $GLIB_LIBS"
++          AC_TRY_LINK([
++#include <glib.h>
++#include <stdio.h>
++],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
++        [ echo "*** The test program compiled, but did not run. This usually means"
++          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
++          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
++          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
++          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
++          echo "*** is required on your system"
++	  echo "***"
++          echo "*** If you have an old version installed, it is best to remove it, although"
++          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
++          echo "***"
++          echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
++          echo "*** came with the system with the command"
++          echo "***"
++          echo "***    rpm --erase --nodeps gtk gtk-devel" ],
++        [ echo "*** The test program failed to compile or link. See the file config.log for the"
++          echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
++          echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
++          echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
++          CFLAGS="$ac_save_CFLAGS"
++          LIBS="$ac_save_LIBS"
++       fi
++     fi
++     GLIB_CFLAGS=""
++     GLIB_LIBS=""
++     ifelse([$3], , :, [$3])
++  fi
++  AC_SUBST(GLIB_CFLAGS)
++  AC_SUBST(GLIB_LIBS)
++  rm -f conf.glibtest
++])
+Index: bison-2.4.2/m4/isc-posix.m4
+===================================================================
+--- /dev/null
++++ bison-2.4.2/m4/isc-posix.m4
+@@ -0,0 +1,26 @@
++# isc-posix.m4 serial 2 (gettext-0.11.2)
++dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
++
++# This test replaces the one in autoconf.
++# Currently this macro should have the same name as the autoconf macro
++# because gettext's gettext.m4 (distributed in the automake package)
++# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
++# give these diagnostics:
++#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
++#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
++
++undefine([AC_ISC_POSIX])
++
++AC_DEFUN([AC_ISC_POSIX],
++  [
++    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
++    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
++  ]
++)
diff --git a/meta/recipes-devtools/bison/bison_2.3.bb b/meta/recipes-devtools/bison/bison_2.3.bb
new file mode 100644
index 0000000..182e880
--- /dev/null
+++ b/meta/recipes-devtools/bison/bison_2.3.bb
@@ -0,0 +1,26 @@
+SUMMARY = "GNU Project parser generator (yacc replacement)"
+DESCRIPTION = "Bison is a general-purpose parser generator that converts an annotated context-free grammar into \
+an LALR(1) or GLR parser for that grammar.  Bison is upward compatible with Yacc: all properly-written Yacc \
+grammars ought to work with Bison with no change. Anyone familiar with Yacc should be able to use Bison with \
+little trouble."
+HOMEPAGE = "http://www.gnu.org/software/bison/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+SECTION = "devel"
+DEPENDS = "bison-native flex-native"
+
+PR = "r1"
+
+SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.gz \
+         file://bison-2.3_m4.patch"
+
+SRC_URI[md5sum] = "22327efdd5080e2b1acb6e560a04b43a"
+SRC_URI[sha256sum] = "52f78aa4761a74ceb7fdf770f3554dd84308c3b93c4255e3a5c17558ecda293e"
+
+inherit autotools gettext texinfo
+acpaths = "-I ${S}/m4"
+
+do_configure_prepend () {
+	rm -f ${S}/m4/*gl.m4
+	cp ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/runtime-po/
+}
diff --git a/meta/recipes-devtools/bison/bison_3.0.4.bb b/meta/recipes-devtools/bison/bison_3.0.4.bb
new file mode 100644
index 0000000..708e9a3
--- /dev/null
+++ b/meta/recipes-devtools/bison/bison_3.0.4.bb
@@ -0,0 +1,39 @@
+SUMMARY = "GNU Project parser generator (yacc replacement)"
+DESCRIPTION = "Bison is a general-purpose parser generator that converts an annotated context-free grammar into \
+an LALR(1) or GLR parser for that grammar.  Bison is upward compatible with Yacc: all properly-written Yacc \
+grammars ought to work with Bison with no change. Anyone familiar with Yacc should be able to use Bison with \
+little trouble."
+HOMEPAGE = "http://www.gnu.org/software/bison/"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+SECTION = "devel"
+DEPENDS = "bison-native flex-native"
+
+SRC_URI = "${GNU_MIRROR}/bison/bison-${PV}.tar.xz \
+           file://m4.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           file://dont-depend-on-help2man.patch.patch \
+           file://0001-src-local.mk-fix-parallel-issue.patch \
+"
+
+# No point in hardcoding path to m4, just use PATH
+EXTRA_OECONF += "M4=m4"
+
+SRC_URI[md5sum] = "c342201de104cc9ce0a21e0ad10d4021"
+SRC_URI[sha256sum] = "a72428c7917bdf9fa93cb8181c971b6e22834125848cf1d03ce10b1bb0716fe1"
+
+LDFLAGS_prepend_libc-uclibc = " -lrt "
+DEPENDS_class-native = "gettext-minimal-native"
+
+inherit autotools gettext texinfo
+acpaths = "-I ${S}/m4"
+
+do_compile_prepend() {
+	for i in mfcalc calc++ rpcalc; do mkdir -p ${B}/examples/$i; done
+}
+
+do_install_append_class-native() {
+	create_wrapper ${D}/${bindir}/bison \
+		BISON_PKGDATADIR=${STAGING_DATADIR_NATIVE}/bison
+}
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh b/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh
new file mode 100644
index 0000000..21a7887
--- /dev/null
+++ b/meta/recipes-devtools/bootchart2/bootchart2/bootchartd_stop.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          bootchartd_stop
+# Required-Start:    $remote_fs $all
+# Required-Stop: 
+# Default-Start:     2 3 4 5
+# Default-Stop:
+# Short-Description: Stop bootchartd collection
+# Description:       This script accompanies bootchartd from bootchart2. 
+#                    bootchartd should stop detect the end of the boot process
+#                    automatically if a window manager is launched, but for
+#                    command-line only operating systems, this script should be
+#                    used instead.
+### END INIT INFO
+
+/sbin/bootchartd stop
+
+: exit 0
diff --git a/meta/recipes-devtools/bootchart2/bootchart2_0.14.7.bb b/meta/recipes-devtools/bootchart2/bootchart2_0.14.7.bb
new file mode 100644
index 0000000..4b0a980
--- /dev/null
+++ b/meta/recipes-devtools/bootchart2/bootchart2_0.14.7.bb
@@ -0,0 +1,154 @@
+# Copyright (c) 2013 LG Electronics, Inc.
+# Copyright (C) 2014 Intel Corp.
+
+# This recipe creates packages for the bootchart2 system-wide profiler daemon 
+# and related utilities. Depending on the images you're building, additional
+# configuration may be needed in order to use it.
+#
+# Packages:
+#   *   bootchart2 - The daemon itself.
+#   *   pybootchartgui - Python program to visualize and display the data
+#       collected by bootchart2 or compatible daemons such as the original 
+#       bootchart.
+#   *   bootchartd-stop-initscript - A SysV init script to stop data collection
+#       when booting completes (see below for details.)
+#
+# While bootchart2 is designed to stop collecting data roughly when the boot 
+# process completes, it is not exactly a stopwatch. It has a list of programs 
+# which are supposed signify that the boot process has completed (for example,
+# openbox or gnome-shell,) but it waits a full 20 seconds after such a program
+# is launched before stopping itself, to collect additional data.
+#
+# If you are using a window manager or GUI which isn't included in bootchart2's
+# default configuration file, you should write bbappend file to amend
+# bootchartd.conf and add it to EXIT_PROC. An example of this is shown in this
+# recipe, where the Matchbox window manager (used by Sato) is added.
+#
+# If you want data collection to end at a certain point exactly, you should
+# arrange for the following command to be run:
+#   bootchartd stop
+# You might set this command to be launched by the desktop environment shipped
+# on the image you're building after the other startup programs are complete.
+# This will not incur the 20 second wait period and will cause bootchart2 to
+# behave a bit more like a stopwatch. An example of this is shown in this 
+# recipe, specifically the bootchartd-stop-initscript package, which stops data
+# collection as the last action when switching to runlevels 2 through 5. You can
+# add bootchartd-stop-initscript to IMAGE_INSTALL if you need to use it.
+#
+# Unless you're doing something special, if your image does not launch an X 
+# window manager, you will need to add bootchartd-stop-initscript to your image.
+#
+# Bootchart2 can be started in two ways. Data collection can be initiated by
+# running the following command:
+#   bootchartd start
+# However, for the most complete data, the bootchart2 developers recommend
+# running it as PID 1. This can be done by adding the following to the kernel 
+# command line parameters in the bootloader setup:
+#   init=/sbin/bootchartd
+# When invoked this way, bootchart2 will set itself up and then automatically 
+# run /sbin/init. For example, when booting the default qemux86 image, one might
+# use a command like this:
+#   runqemu qemux86 bootparams="initcall_debug printk.time=y quiet \
+#                               init=/sbin/bootchartd"
+#
+# Neither method is actually implemented here, choose what works for you.
+#
+# If you are building your image with systemd instead of SysV init, bootchart2
+# includes systemd service files to begin collection automatically at boot and 
+# end collection automatically 20 seconds after the boot process has completed.
+# However, be aware that systemd tends to start bootchart2 relatively late into
+# the boot process, so it's highly recommended to use bootchart2 as PID 1. If 
+# you're using systemd and you wish to use another method to stop data
+# collection at a time of your choosing, you may do so as long as you get to it
+# before the 20 second timeout of the systemd service files. Also, you may write
+# a bbappend to patch bootchart2-done.timer.in to increase or decrease the
+# timeout. Decreasing it to 0 will make it behave like
+# bootchartd-stop-initscript.
+#
+# By default, when data collection is stopped, a file named bootchart.tgz will
+# be created in /var/log. If pybootchartgui is included in your image,
+# bootchart.png will also be created at the same time. However, this results in
+# a noticeable hitch or pause at boot time, which may not be what you want on an
+# embedded device. So you may prefer to omit pybootchartgui from your image. In
+# that case, copy bootchart.tgz over to your development system and generate
+# bootchart.png there. To get pybootchartgui on your development system, you can
+# either install it directly from some other source, or build bootchart2-native
+# and find pybootchartgui in the native sysroot:
+#    bitbake bootchart2-native
+#   ./tmp/sysroots/x86_64-linux/usr/bin/pybootchartgui /path/to/bootchart.tgz
+# Note that, whether installed on your build system or on your image, the 
+# pybootchartgui provided by this recipe does not support the -i option. You 
+# will need to install pybootchartgui by other means in order to run it in
+# interactive mode.
+
+SUMMARY = "Booting sequence and CPU,I/O usage monitor"
+DESCRIPTION = "Monitors where the system spends its time at start, creating a graph of all processes, disk utilization, and wait time."
+AUTHOR = "Wonhong Kwon <wonhong.kwon@lge.com>"
+HOMEPAGE = "https://github.com/mmeeks/bootchart"
+LICENSE = "GPL-3.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=44ac4678311254db62edf8fd39cb8124"
+
+SRC_URI = "git://github.com/mmeeks/bootchart.git \
+           file://bootchartd_stop.sh \
+          "
+
+S = "${WORKDIR}/git"
+SRCREV = "6f050b65ae9f266645f04f0aecab9efb88375f1c"
+
+inherit systemd
+inherit update-rc.d
+inherit pythonnative
+
+# The only reason to build bootchart2-native is for a native pybootchartgui.
+BBCLASSEXTEND = "native"
+
+SYSTEMD_SERVICE_${PN} = "bootchart2.service bootchart2-done.service bootchart2-done.timer"
+
+UPDATERCPN = "bootchartd-stop-initscript"
+INITSCRIPT_NAME = "bootchartd_stop.sh"
+INITSCRIPT_PARAMS = "start 99 2 3 4 5 ."
+
+# We want native pybootchartgui to execute with the correct Python interpeter.
+do_compile_append_class-native () {
+    echo "#! ${PYTHON}" | cat - ${S}/pybootchartgui.py > ${WORKDIR}/temp_pybootchartgui
+    mv ${WORKDIR}/temp_pybootchartgui ${S}/pybootchartgui.py
+    chmod +x ${S}/pybootchartgui
+}
+
+do_compile_prepend () {
+    export PY_LIBDIR="${libdir}/${PYTHON_DIR}"
+    export BINDIR="${bindir}"
+    export LIBDIR="${base_libdir}"
+}
+
+do_install () {
+    install -d ${D}${sysconfdir} # needed for -native
+    export PY_LIBDIR="${libdir}/${PYTHON_DIR}"
+    export BINDIR="${bindir}"
+    export DESTDIR="${D}"
+    export LIBDIR="${base_libdir}"
+
+    oe_runmake install
+    install -d ${D}${sysconfdir}/init.d
+    install -m 0755 ${WORKDIR}/bootchartd_stop.sh ${D}${sysconfdir}/init.d
+
+    echo 'EXIT_PROC="$EXIT_PROC matchbox-window-manager"' >> ${D}${sysconfdir}/bootchartd.conf
+}
+
+PACKAGES =+ "pybootchartgui"
+FILES_pybootchartgui += "${libdir}/python*/site-packages/pybootchartgui ${bindir}/pybootchartgui"
+RDEPENDS_pybootchartgui = "python-pycairo python-compression python-image python-textutils python-shell python-compression python-codecs"
+RDEPENDS_${PN}_class-target += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit-pidof', 'procps', d)}"
+RDEPENDS_${PN}_class-target += "lsb"
+DEPENDS_append_class-native = " python-pycairo-native"
+
+PACKAGES =+ "bootchartd-stop-initscript"
+FILES_bootchartd-stop-initscript += "${sysconfdir}/init.d ${sysconfdir}/rc*.d"
+
+FILES_${PN} += "${base_libdir}/bootchart/bootchart-collector"
+FILES_${PN} += "${base_libdir}/bootchart/tmpfs"
+FILES_${PN} += "${libdir}"
+FILES_${PN}-dbg += "${base_libdir}/bootchart/.debug"
+FILES_${PN}-doc += "${datadir}/docs"
+
+RCONFLICTS_${PN} = "bootchart"
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch b/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch
new file mode 100644
index 0000000..bbc53c6
--- /dev/null
+++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools/fix-parallel.patch
@@ -0,0 +1,32 @@
+From 373eb51328b5e10529763cad441210e6b0efb24e Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 11 Feb 2015 22:08:41 -0800
+Subject: [PATCH] Makefile: fix for parallel build
+
+Fixed:
+mkfs.c:300:46: error: 'BTRFS_BUILD_VERSION' undeclared (first use in this function)
+  fprintf(stderr, "mkfs.btrfs, part of %s\n", BTRFS_BUILD_VERSION);
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 860a390..8a6fbd7 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -142,7 +142,7 @@ else
+ 	check_echo = true
+ endif
+ 
+-%.o.d: %.c
++%.o.d: %.c version.h
+ 	$(Q)$(CC) -MM -MG -MF $@ -MT $(@:.o.d=.o) -MT $(@:.o.d=.static.o) -MT $@ $(CFLAGS) $<
+ 
+ .c.o:
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.1.2.bb b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.1.2.bb
new file mode 100644
index 0000000..37c622b
--- /dev/null
+++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.1.2.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Checksumming Copy on Write Filesystem utilities"
+DESCRIPTION = "Btrfs is a new copy on write filesystem for Linux aimed at \
+implementing advanced features while focusing on fault tolerance, repair and \
+easy administration. \
+This package contains utilities (mkfs, fsck, btrfsctl) used to work with \
+btrfs and an utility (btrfs-convert) to make a btrfs filesystem from an ext3."
+
+HOMEPAGE = "https://btrfs.wiki.kernel.org"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fcb02dc552a041dee27e4b85c7396067"
+SECTION = "base"
+DEPENDS = "util-linux attr e2fsprogs lzo acl"
+
+SRCREV = "7f1328ccb5d159efe850d4eaea9b49bbe8c4181e"
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
+           file://fix-parallel.patch \
+"
+
+inherit autotools-brokensep pkgconfig
+
+EXTRA_OECONF += "--disable-documentation"
+
+do_configure_prepend() {
+      sh autogen.sh
+}
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/build-compare/build-compare_git.bb b/meta/recipes-devtools/build-compare/build-compare_git.bb
new file mode 100644
index 0000000..7ac3784
--- /dev/null
+++ b/meta/recipes-devtools/build-compare/build-compare_git.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Build Result Compare Script"
+DESCRIPTION = "This package contains scripts to find out if the build result\
+differs to a former build."
+HOMEPAGE = "https://github.com/openSUSE/build-compare"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "git://github.com/openSUSE/build-compare.git \
+           file://Rename-rpm-check.sh-to-pkg-diff.sh.patch;striplevel=1 \
+           file://Ignore-DWARF-sections.patch;striplevel=1 \
+           file://0001-Add-support-for-deb-and-ipk-packaging.patch \
+           "
+PATCHTOOL = "git"
+
+SRCREV = "c5352c054c6ef15735da31b76d6d88620f4aff0a"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND += "native nativesdk"
+
+do_install() {
+    install -d ${D}/${bindir}
+    install -m 755 functions.sh ${D}/${bindir}
+    install -m 755 pkg-diff.sh ${D}/${bindir}
+    install -m 755 same-build-result.sh ${D}/${bindir}
+    install -m 755 srpm-check.sh ${D}/${bindir}
+}
+
+RDEPENDS_${PN} += "bash"
diff --git a/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch b/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
new file mode 100644
index 0000000..5c15218
--- /dev/null
+++ b/meta/recipes-devtools/build-compare/files/0001-Add-support-for-deb-and-ipk-packaging.patch
@@ -0,0 +1,64 @@
+From 02dbc7e3478e409d6f5e3e1c53daddf8838be999 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Tue, 1 Sep 2015 12:04:33 +0100
+Subject: [PATCH] Add support for deb and ipk packaging
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ functions.sh | 15 +++++++++++++++
+ pkg-diff.sh  |  6 ++++++
+ 2 files changed, 21 insertions(+)
+
+diff --git a/functions.sh b/functions.sh
+index 06079df..85c9003 100644
+--- a/functions.sh
++++ b/functions.sh
+@@ -85,6 +85,13 @@ function unpackage()
+             CPIO_OPTS="--extract --unconditional --preserve-modification-time --make-directories --quiet"
+             rpm2cpio $file | cpio ${CPIO_OPTS}
+             ;;
++        *.ipk|*.deb)
++            ar x $file
++            tar xf control.tar.gz
++            rm control.tar.gz
++            tar xf data.tar.gz
++            rm data.tar.gz
++            ;;
+     esac
+     popd 1>/dev/null
+ }
+@@ -255,4 +262,12 @@ function cmp_spec ()
+     rm $file1 $file2
+     return $RES
+ }
++
++function adjust_controlfile () {
++    cat $1/control | sed '/^Version: /d' > $1/control.fixed
++    mv $1/control.fixed $1/control
++    cat $2/control | sed '/^Version: /d' > $2/control.fixed
++    mv $2/control.fixed $2/control
++}
++
+ # vim: tw=666 ts=2 et
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+index 0f1fa76..3cf10aa 100644
+--- a/pkg-diff.sh
++++ b/pkg-diff.sh
+@@ -138,6 +138,12 @@ echo "Extracting packages"
+ unpackage $oldpkg $dir/old
+ unpackage $newpkg $dir/new
+ 
++case $oldpkg in
++  *.deb|*.ipk)
++     adjust_controlfile $dir/old $dir/new
++  ;;
++esac
++
+ # files is set in cmp_spec for rpms, so if RES is empty we should assume
+ # it wasn't an rpm and pick all files for comparison.
+ if [ -z $RES ]; then
+-- 
+2.1.0
+
diff --git a/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch b/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch
new file mode 100644
index 0000000..7dda1ac
--- /dev/null
+++ b/meta/recipes-devtools/build-compare/files/Ignore-DWARF-sections.patch
@@ -0,0 +1,40 @@
+From 015715694eadd714b903f30ade876e0738d44974 Mon Sep 17 00:00:00 2001
+From: Randy Witt <randy.e.witt@linux.intel.com>
+Date: Mon, 5 Jan 2015 15:09:20 -0800
+Subject: [PATCH] Ignore DWARF sections.
+
+Assume for now that we don't care about the DWARF sections due to path
+differences. However, in the case the tool is ran on a "debug" package
+it will most likely falsely say the packages have no differences.
+
+Upstream-Status: Inappropriate [other]
+
+The package difference tool is correctly labelling the packages as different
+when the DWARF sections don't match due to paths. The paths in the debug info
+should actually be made to be the same using compile flags or some other
+mechanism.
+
+However, to make the tool more useful to Yocto until the work can be done
+to ensure identical paths in debug sections, this patch is being applied.
+
+Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
+---
+ pkg-diff.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+index 56035c1..0f1fa76 100755
+--- a/pkg-diff.sh
++++ b/pkg-diff.sh
+@@ -658,7 +658,7 @@ check_single_file()
+        echo "" >$file1
+        echo "" >$file2
+        # Don't compare .build-id and .gnu_debuglink sections
+-       sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr "\n" " ")"
++       sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" -e "\.debug_abbrev" -e "\.debug_aranges" -e "\.debug_frame" -e "\.debug_info" -e "\.debug_line" -e "\.debug_loc" -e "\.debug_macinfo" -e "\.debug_pubnames" -e "\.debug_pubtypes" -e "\.debug_ranges"  -e "\.debug_str" | tr "\n" " ")"
+        for section in $sections; do
+           objdump -s -j $section old/$file | sed "s,^old/,," > $file1
+           objdump -s -j $section new/$file | sed "s,^new/,," > $file2
+-- 
+1.9.3
+
diff --git a/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch b/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch
new file mode 100644
index 0000000..cff3a9e
--- /dev/null
+++ b/meta/recipes-devtools/build-compare/files/Rename-rpm-check.sh-to-pkg-diff.sh.patch
@@ -0,0 +1,1599 @@
+From 4de3df5a1b361cd09a081f0e0bdb94cbf684ed48 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 19 Feb 2015 00:34:47 -0800
+Subject: [PATCH] Rename rpm-check.sh to pkg-diff.sh.
+
+The tool now accepts package input other than rpm, so change the name
+which could be misleading.
+
+Upstream-Status: Submitted [https://github.com/openSUSE/build-compare/pulls]
+
+Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
+
+Updated for rpm-check.sh.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ build-compare.spec   |    2 +-
+ pkg-diff.sh          |  765 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ rpm-check.sh         |  764 -------------------------------------------------
+ same-build-result.sh |    4 +-
+ 4 files changed, 768 insertions(+), 767 deletions(-)
+ create mode 100644 pkg-diff.sh
+ delete mode 100755 rpm-check.sh
+
+diff --git a/build-compare.spec b/build-compare.spec
+index 14a97e9..5f47ca1 100644
+--- a/build-compare.spec
++++ b/build-compare.spec
+@@ -25,7 +25,7 @@ Version:        2015.02.10
+ Release:        0
+ Source1:        COPYING
+ Source2:        same-build-result.sh
+-Source3:        rpm-check.sh
++Source3:        pkg-diff.sh
+ Source4:        functions.sh
+ Source5:        srpm-check.sh
+ BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+diff --git a/pkg-diff.sh b/pkg-diff.sh
+new file mode 100644
+index 0000000..56035c1
+--- /dev/null
++++ b/pkg-diff.sh
+@@ -0,0 +1,765 @@
++#! /bin/bash
++#
++# Copyright (c) 2009, 2010, 2011, 2012 SUSE Linux Product GmbH, Germany.
++# Licensed under GPL v2, see COPYING file for details.
++#
++# Written by Michael Matz and Stephan Coolo
++# Enhanced by Andreas Jaeger
++
++FUNCTIONS=${0%/*}/functions.sh
++
++check_all=
++case $1 in
++  -a | --check-all)
++    check_all=1
++    shift
++esac
++
++if test "$#" != 2; then
++   echo "usage: $0 [-a|--check-all] old.rpm new.rpm"
++   exit 1
++fi
++
++self_script=$(cd $(dirname $0); echo $(pwd)/$(basename $0))
++
++source $FUNCTIONS
++
++oldpkg=`readlink -f $1`
++newpkg=`readlink -f $2`
++rename_script=`mktemp`
++
++if test ! -f "$oldpkg"; then
++    echo "can't open $1"
++    exit 1
++fi
++
++if test ! -f "$newpkg"; then
++    echo "can't open $2"
++    exit 1
++fi
++
++#usage unjar <file>
++function unjar()
++{
++    local file
++    file=$1
++
++    if [[ $(type -p fastjar) ]]; then
++        UNJAR=fastjar
++    elif [[ $(type -p jar) ]]; then
++        UNJAR=jar
++    elif [[ $(type -p unzip) ]]; then
++        UNJAR=unzip
++    else
++        echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
++        exit 1
++    fi
++
++    case $UNJAR in
++        jar|fastjar)
++        # echo jar -xf $file
++        ${UNJAR} -xf $file
++        ;;
++        unzip)
++        unzip -oqq $file
++        ;;
++    esac
++}
++
++# list files in directory
++#usage unjar_l <file>
++function unjar_l()
++{
++    local file
++    file=$1
++
++    if [[ $(type -p fastjar) ]]; then
++        UNJAR=fastjar
++    elif [[ $(type -p jar) ]]; then
++        UNJAR=jar
++    elif [[ $(type -p unzip) ]]; then
++        UNJAR=unzip
++    else
++        echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
++        exit 1
++    fi
++
++    case $UNJAR in
++        jar|fastjar)
++        ${UNJAR} -tf $file
++        ;;
++        unzip)
++        unzip -l $file
++        ;;
++    esac
++}
++
++filter_disasm()
++{
++   sed -e 's/^ *[0-9a-f]\+://' -e 's/\$0x[0-9a-f]\+/$something/' -e 's/callq *[0-9a-f]\+/callq /' -e 's/# *[0-9a-f]\+/#  /' -e 's/\(0x\)\?[0-9a-f]\+(/offset(/' -e 's/[0-9a-f]\+ </</' -e 's/^<\(.*\)>:/\1:/' -e 's/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/' 
++}
++
++echo "Comparing `basename $oldpkg` to `basename $newpkg`"
++
++case $oldpkg in
++  *.rpm)
++     cmp_spec $rename_script $oldpkg $newpkg
++     RES=$?
++     case $RES in
++       0)
++          echo "RPM meta information is identical"
++          if test -z "$check_all"; then
++             exit 0
++          fi
++          ;;
++       1)
++          echo "RPM meta information is different"
++          if test -z "$check_all"; then
++             exit 1
++          fi
++          ;;
++       2)
++          echo "RPM file checksum differs."
++          RES=0
++          ;;
++       *)
++          echo "Wrong exit code!"
++          exit 1
++          ;;
++     esac
++     ;;
++esac
++
++file1=`mktemp`
++file2=`mktemp`
++
++dir=`mktemp -d`
++echo "Extracting packages"
++unpackage $oldpkg $dir/old
++unpackage $newpkg $dir/new
++
++# files is set in cmp_spec for rpms, so if RES is empty we should assume
++# it wasn't an rpm and pick all files for comparison.
++if [ -z $RES ]; then
++    oldfiles=`cd $dir/old; find . -type f`
++    newfiles=`cd $dir/new; find . -type f`
++
++    files=`echo -e "$oldfiles\n$newfiles" | sort -u`
++fi
++
++cd $dir
++bash $rename_script
++
++dfile=`mktemp`
++
++diff_two_files()
++{
++  if ! cmp -s old/$file new/$file; then
++     echo "$file differs ($ftype)"
++     hexdump -C old/$file > $file1
++     hexdump -C new/$file > $file2
++     diff -u $file1 $file2 | head -n 200
++     return 1
++  fi
++  return 0
++}
++
++trim_man_first_line()
++{
++    # Handles the first line if it is like:
++    #.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
++    #.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.43.3.
++    local f=$1
++    sed -i -e '1{
++    s|^\.\\"[[:blank:]]\+Automatically[[:blank:]]generated[[:blank:]]by[[:blank:]]Pod::Man[[:blank:]].*|.\\" Overly verbose Pod::Man|
++    s|^\.\\"[[:blank:]]\+DO[[:blank:]]NOT[[:blank:]]MODIFY[[:blank:]]THIS[[:blank:]]FILE![[:blank:]]\+It[[:blank:]]was[[:blank:]]generated[[:blank:]]by[[:blank:]]help2man[[:blank:]].*|.\\" Overly verbose help2man|
++    }' $f
++}
++
++trim_man_TH()
++{
++    # Handles lines like:
++    # .TH debhelper 7 "2010-02-27" "7.4.15" "Debhelper"
++    # .TH DIRMNGR-CLIENT 1 2010-02-27 "Dirmngr 1.0.3" "GNU Privacy Guard"
++    # .TH ccmake 1 "March 06, 2010" "ccmake 2.8.1-rc3"
++    # .TH QEMU-IMG 1 "2010-03-14" " " " "
++    # .TH kdecmake 1 "May 07, 2010" "cmake 2.8.1"
++    # .TH "appender.h" 3 "12 May 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
++    # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
++    # .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual"
++    # .TH gv 3guile "13 May 2010"
++    #.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual"
++    # .TH LDIRECTORD 8 "2010-10-20" "perl v5.12.2" "User Contributed Perl Documentation"
++    # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7"
++    # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
++    # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands"
++    # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" ""
++    #.TH Locale::Po4a::Xml.pm 3pm "2015-01-30" "Po4a Tools" "Po4a Tools"
++    local f=$1
++    # (.TH   quoted section) (quoted_date)(*)
++    sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "qq2000-01-01"\3|' $f
++    # (.TH unquoted section) (quoted_date)(*)
++    sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "uq2000-02-02"\3|' $f
++    # (.TH   quoted section) (unquoted_date)(*)
++    sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 qu2000-03-03\3|' $f
++    # (.TH unquoted section) (unquoted_date)(*)
++    sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 uu2000-04-04\3|' $f
++}
++
++strip_numbered_anchors()
++{
++  # Remove numbered anchors on Docbook / HTML files.
++  # This should be save since we remove them from old and new files.
++  # A trailing </a> or </div> tag will stay also on both files.
++  for f in old/$file new/$file; do
++     sed -i -e 's%<[ ]*a[ ]\+name[^<]*[0-9]\+[^<]*%%g' \
++     -e 's%<[ ]*a[ ]\+href[^<]*#[^<]*[0-9]\+[^<]*%%g' \
++     -e 's%<[^<]*id="ftn\.[^<]*[0-9]\+[^<]*%%g' $f
++  done
++}
++
++
++check_compressed_file()
++{
++  local file=$1
++  local ext=$2
++  local tmpdir=`mktemp -d`
++  local ftype
++  local ret=0
++  echo "$ext file with odd filename: $file"
++  if test -n "$tmpdir"; then
++    mkdir $tmpdir/{old,new}
++    cp --parents --dereference old/$file $tmpdir/
++    cp --parents --dereference new/$file $tmpdir/
++    if pushd $tmpdir > /dev/null ; then
++      case "$ext" in
++        bz2)
++          mv old/$file{,.bz2}
++          mv new/$file{,.bz2}
++          bzip2 -d old/$file.bz2
++          bzip2 -d new/$file.bz2
++          ;;
++        gzip)
++          mv old/$file{,.gz}
++          mv new/$file{,.gz}
++          gzip -d old/$file.gz
++          gzip -d new/$file.gz
++          ;;
++        xz)
++          mv old/$file{,.xz}
++          mv new/$file{,.xz}
++          xz -d old/$file.xz
++          xz -d new/$file.xz
++          ;;
++      esac
++      ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
++      case $ftype in
++        POSIX\ tar\ archive)
++          echo "$ext content is: $ftype"
++          mv old/$file{,.tar}
++          mv new/$file{,.tar}
++          if ! check_single_file ${file}.tar; then
++            ret=1
++          fi
++          ;;
++        ASCII\ cpio\ archive\ *)
++          echo "$ext content is: $ftype"
++          mv old/$file{,.cpio}
++          mv new/$file{,.cpio}
++          if ! check_single_file ${file}.cpio; then
++            ret=1
++          fi
++          ;;
++        *)
++          echo "unhandled $ext content: $ftype"
++          if ! diff_two_files; then
++            ret=1
++          fi
++          ;;
++      esac
++      popd > /dev/null
++    fi
++    rm -rf "$tmpdir"
++  fi
++  return $ret
++}
++
++check_single_file()
++{
++  local file="$1"
++  case $file in
++    *.spec)
++       sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file
++       sed -i -e "s,Release:.*$release2,Release: @RELEASE@," new/$file
++       ;;
++    *.exe.mdb|*.dll.mdb)
++       # Just debug information, we can skip them
++       echo "$file skipped as debug file."
++       return 0
++       ;;
++    *.a)
++       flist=`ar t new/$file`
++       pwd=$PWD
++       fdir=`dirname $file`
++       cd old/$fdir
++       ar x `basename $file`
++       cd $pwd/new/$fdir
++       ar x `basename $file`
++       cd $pwd
++       for f in $flist; do
++          if ! check_single_file $fdir/$f; then
++             return 1
++          fi
++       done
++       return 0
++       ;;
++    *.cpio)
++       flist=`cpio --quiet --list --force-local < "new/$file"`
++       pwd=$PWD
++       fdir=$file.extract.$PPID.$$
++       mkdir old/$fdir new/$fdir
++       cd old/$fdir
++       cpio --quiet --extract --force-local < "../${file##*/}"
++       cd $pwd/new/$fdir
++       cpio --quiet --extract --force-local < "../${file##*/}"
++       cd $pwd
++       local ret=0
++       for f in $flist; do
++         if ! check_single_file $fdir/$f; then
++           ret=1
++           if test -z "$check_all"; then
++             break
++           fi
++         fi
++       done
++       rm -rf old/$fdir new/$fdir
++       return $ret
++       ;;
++    *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2)
++       flist=`tar tf new/$file`
++       pwd=$PWD
++       fdir=`dirname $file`
++       cd old/$fdir
++       tar xf `basename $file`
++       cd $pwd/new/$fdir
++       tar xf `basename $file`
++       cd $pwd
++       local ret=0
++       for f in $flist; do
++         if ! check_single_file $fdir/$f; then
++           ret=1
++           if test -z "$check_all"; then
++             break
++           fi
++         fi
++       done
++       return $ret
++       ;;
++    *.zip|*.jar|*.war)
++       cd old
++       unjar_l ./$file |sort > flist
++       #  10-05-2010 14:39
++       sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ," flist
++       # 2012-02-03 07:59
++       sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
++       cd ../new
++       unjar_l ./$file |sort> flist
++       sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ,; " flist
++       sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
++       cd ..
++       if ! cmp -s old/flist new/flist; then
++          echo "$file has different file list"
++          diff -u old/flist new/flist
++          return 1
++       fi
++       flist=`grep date new/flist | sed -e 's,.* date ,,'`
++       pwd=$PWD
++       fdir=`dirname $file`
++       cd old/$fdir
++       unjar `basename $file`
++       cd $pwd/new/$fdir
++       unjar `basename $file`
++       cd $pwd
++       local ret=0
++       for f in $flist; do
++         if test -f new/$fdir/$f && ! check_single_file $fdir/$f; then
++           ret=1
++           if test -z "$check_all"; then
++             break
++           fi
++         fi
++       done
++       return $ret;;
++     *.pyc|*.pyo)
++        perl -e "open fh, '+<', 'old/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
++        perl -e "open fh, '+<', 'new/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
++        ;;
++     *.bz2)
++        bunzip2 -c old/$file > old/${file/.bz2/}
++        bunzip2 -c new/$file > new/${file/.bz2/}
++        check_single_file ${file/.bz2/}
++        return $?
++        ;;
++     *.gz)
++        gunzip -c old/$file > old/${file/.gz/}
++        gunzip -c new/$file > new/${file/.gz/}
++        check_single_file ${file/.gz/}
++        return $?
++        ;;
++     *.rpm)
++	$self_script -a old/$file new/$file
++        return $?
++        ;;
++     *png)
++	# Try to remove timestamps, only if convert from ImageMagick is installed
++        if [[ $(type -p convert) ]]; then
++	  convert old/$file +set date:create +set date:modify old/${file/.png/_n.png}
++	  convert old/$file +set date:create +set date:modify new/${file/.png/_n.png}
++	  if ! cmp -s old/${file/.png/_n.png} new/${file/.png/_n.png}; then
++	      echo "$file differs ($ftype)"
++	      hexdump -C old/${file/.png/_n.png} > $file1
++	      hexdump -C new/${file/.png/_n.png} > $file2
++	      diff -u $file1 $file2 | head -n 20
++	      return 1
++	  fi
++	  return 0
++	fi
++        ;;
++     /usr/share/locale/*/LC_MESSAGES/*.mo|/usr/share/locale-bundle/*/LC_MESSAGES/*.mo)
++       for f in old/$file new/$file; do
++         sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," $f
++       done
++       ;;
++     /usr/share/doc/packages/*/*.html|\
++     /usr/share/doc/kde/HTML/*/*/*.html|/usr/share/doc/*/html/*.html)
++       for f in old/$file new/$file; do
++         # texi2html output, e.g. in kvm, indent, qemu
++	 sed -i -e "s|^<!-- Created on .*, 20.. by texi2html .\...|<!-- Created on August 7, 2009 by texi2html 1.82|" $f
++	 sed -i -e 's|^ *This document was generated by <em>Autobuild</em> on <em>.*, 20..</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html .\...</em></a>.$|  This document was generated by <em>Autobuild</em> on <em>August 7, 2009</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.|' $f
++	 # doxygen docu, e.g. in libssh and log4c
++	 sed -i -e 's|Generated on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] 20[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
++	 # Generated on Sat Aug 14 2010 16:49:48 for libssh
++	 sed -i -e 's|Generated on ... ... [0-9]* 20[0-9][0-9] [0-9]*:[0-9][0-9]:[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
++       done
++       strip_numbered_anchors
++       ;;
++     /usr/share/javadoc/*.html |\
++     /usr/share/javadoc/*/*.html|/usr/share/javadoc/*/*/*.html)
++       strip_numbered_anchors
++       # There are more timestamps in html, so far we handle only some primitive versions.
++       for f in old/$file new/$file; do
++         # Javadoc:
++          # <head>
++          # <!-- Generated by javadoc (version 1.7.0_75) on Tue Feb 03 02:20:12 GMT 2015 -->
++          # <!-- Generated by javadoc on Tue Feb 03 00:02:48 GMT 2015 -->
++          # <meta name="date" content="2015-02-03">
++          # </head>
++          sed -i -e '
++            /^<head>/{
++              : next
++              n
++              /^<\/head>/{
++                b end_head
++              }
++              s/^\(<!-- Generated by javadoc\) \((\(build\|version\) [0-9._]\+) on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \5/
++              t next
++              s/^\(<!-- Generated by javadoc\) \(on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \3/
++              t next
++              s/^<meta name="date" content="[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}">/<meta name="date" content="some-date-removed-by-build-compare">/
++              b next
++            }
++            : end_head
++          ' $f
++         # Gjdoc HtmlDoclet:
++	 sed -i -e 's%Generated by Gjdoc HtmlDoclet [0-9,.]*, part of <a href="http://www.gnu.org/software/classpath/cp-tools/" title="" target="_top">GNU Classpath Tools</a>, on .*, 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.%Generated by Gjdoc.%' $f
++	 sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\(.*\)GNU Classpath Tools</a>, on [A-Z][a-z]* [0-9]*, 20?? [0-9]*:??:?? \(a|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\1GNU Classpath Tools</a>, on January 1, 2009 0:00:00 a.m. GMT.</p>%' $f
++	 sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\(.*GNU Classpath Tools</a>\), on [a-zA-Z]* [0-9][0-9], 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\1,on May 1, 2010 1:11:42 p.m. GMT.</p>%' $f
++	 # deprecated-list is randomly ordered, sort it for comparison
++	 case $f in
++	   */deprecated-list.html)
++	     sort -o $f $f
++	     ;;
++	 esac
++       done
++       ;;
++     /usr/share/javadoc/gjdoc.properties |\
++     /usr/share/javadoc/*/gjdoc.properties)
++       for f in old/$file new/$file; do
++	 sed -i -e 's|^#[A-Z][a-z]\{2\} [A-Z][a-z]\{2\} [0-9]\{2\} ..:..:.. GMT 20..$|#Fri Jan 01 11:27:36 GMT 2009|' $f
++       done
++       ;;
++     */fonts.scale|*/fonts.dir|*/encodings.dir)
++       for f in old/$file new/$file; do
++         # sort files before comparing
++         sort -o $f $f
++       done
++       ;;
++     /var/adm/perl-modules/*)
++       for f in old/$file new/$file; do
++         sed -i -e 's|^=head2 ... ... .. ..:..:.. ....: C<Module>|=head2 Wed Jul  1 00:00:00 2009: C<Module>|' $f
++       done
++       ;;
++     /usr/share/man/man3/*3pm)
++       for f in old/$file new/$file; do
++         sed -i -e 's| 3 "20..-..-.." "perl v5....." "User Contributed Perl Documentation"$| 3 "2009-01-01" "perl v5.10.0" "User Contributed Perl Documentation"|' $f
++         trim_man_TH $f
++         trim_man_first_line $f
++       done
++       ;;
++     /usr/share/man/*/man*|/usr/share/man/man*|/usr/lib/texmf/doc/man/*/*)
++
++       for f in old/$file new/$file; do
++         trim_man_TH $f
++         trim_man_first_line $f
++         # generated by docbook xml:
++         #.\"      Date: 09/13/2010
++         sed -i -e 's|Date: [0-1][0-9]/[0-9][0-9]/201[0-9]|Date: 09/13/2010|' $f
++       done
++       ;;
++     *.elc)
++       # emacs lisp files
++       for f in old/$file new/$file; do
++         sed -i -e 's|Compiled by abuild@.* on ... ... .. ..:..:.. 20..$|compiled by abuild@buildhost on Wed Jul 01 00:00:00 2009|' $f
++       done
++       ;;
++     /var/lib/texmf/web2c/*/*fmt |\
++     /var/lib/texmf/web2c/metafont/*.base|\
++     /var/lib/texmf/web2c/metapost/*.mem)
++       # binary dump of TeX and Metafont formats, we can ignore them for good
++       echo "difference in $file ignored."
++       return 0
++       ;;
++     */libtool)
++       for f in old/$file new/$file; do
++	  sed -i -e 's|^# Libtool was configured on host [A-Za-z0-9]*:$|# Libtool was configured on host x42:|' $f
++       done
++       ;;
++     /etc/mail/*cf|/etc/sendmail.cf)
++       # from sendmail package
++       for f in old/$file new/$file; do
++	  # - ##### built by abuild@build33 on Thu May 6 11:21:17 UTC 2010
++	  sed -i -e 's|built by abuild@[a-z0-9]* on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] .* 20[0-9][0-9]|built by abuild@build42 on Thu May 6 11:21:17 UTC 2010|' $f
++       done
++       ;;
++     /usr/share/doc/kde/HTML/*/*/index.cache|/usr/share/doc/kde/HTML/*/*/*/index.cache|\
++     /usr/share/gtk-doc/html/*/*.html|/usr/share/gtk-doc/html/*/*.devhelp2)
++       # various kde and gtk packages
++       strip_numbered_anchors
++       ;;
++    */created.rid)
++       # ruby documentation
++       # file just contains a timestamp and nothing else, so ignore it
++       echo "Ignore $file"
++       return 0
++       ;;
++    */rdoc/files/*.html)
++       # ruby documentation
++       # <td>Mon Sep 20 19:02:43 +0000 2010</td>
++       for f in old/$file new/$file; do
++          sed -i -e 's%<td>[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+ +0000 201[0-9]</td>%<td>Mon Sep 20 19:02:43 +0000 2010</td>%g' $f
++       done
++       strip_numbered_anchors
++       ;;
++    */Linux*Env.Set.sh)
++       # LibreOffice files, contains:
++       # Generated on: Mon Apr 18 13:19:22 UTC 2011
++       for f in old/$file new/$file; do
++	 sed -i -e 's%^# Generated on:.*UTC 201[0-9] *$%# Generated on: Sometime%g' $f
++       done
++       ;;
++    /usr/lib/libreoffice/solver/inc/*/deliver.log)
++       # LibreOffice log file
++      echo "Ignore $file"
++      return 0
++      ;;
++    /var/adm/update-messages/*|/var/adm/update-scripts/*)
++      # encode version-release inside
++      oldfn=`echo "$file"|sed -e s/-$release2/-$release1/;`
++
++      # fetchmsttfonts embeds the release number in the update shell script.
++      echo sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
++      sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
++
++      if ! diff -u old/$oldfn new/$file; then
++           echo "$oldfn is not same as $file"
++           return 1
++      fi
++      echo "$file and $oldfn are same"
++      return 0
++      ;;
++    *.ps)
++      for f in "old/$file" "new/$file"; do
++        sed -i -e '
++          /^%%CreationDate:[[:blank:]]/d
++          /^%%Creator:[[:blank:]]groff[[:blank:]]version[[:blank:]]/d
++          /^%DVIPSSource:[[:blank:]]/d
++        ' "$f"
++      done
++    ;;
++    *pdf)
++      # PDF files contain a unique ID, remove it
++      # Format of the ID is:
++      # /ID [<9ACE247A70CF9BEAFEE15E116259BD6D> <9ACE247A70CF9BEAFEE15E116259BD6D>]
++      # with optional spaces. pdftex creates also:
++      # /CreationDate (D:20120103083206Z)
++      # /ModDate (D:20120103083206Z)
++      # and possibly XML metadata as well
++      for f in "old/$file" "new/$file"; do
++        sed -i \
++            '/obj/,/endobj/{
++               s%/ID \?\[ \?<[^>]\+> \?<[^>]\+> \?\]%/IDrandom%g;
++               s%/CreationDate \?(D:[^)]*)%/CreationDate (D: XXX)%g;
++               s%/ModDate \?(D:[^)]*)%/ModDate (D: XXX)%g;
++               s%<pdf:CreationDate>[^<]*</pdf:CreationDate>%<pdf:CreationDate>XXX</pdf:CreationDate>%g;
++               s%<pdf:ModDate>[^<]*</pdf:ModDate>%<pdf:ModDate>XXX</pdf:ModDate>%g;
++               s%<xap:CreateDate>[^<]*</xap:CreateDate>%<xap:CreateDate>XXX</xap:CreateDate>%g;
++               s%<xap:ModifyDate>[^<]*</xap:ModifyDate>%<xap:ModifyDate>XXX</xap:ModifyDate>%g;
++               s%<xap:MetadataDate>[^<]*</xap:MetadataDate>%<xap:MetadataDate>XXX</xap:MetadataDate>%g;
++            }' "$f"
++      done
++      ;;
++  esac
++
++  ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
++  case $ftype in
++     PE32\ executable*Mono\/\.Net\ assembly*)
++       echo "PE32 Mono/.Net assembly: $file"
++       if [ -x /usr/bin/monodis ] ; then
++         monodis old/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file1}
++         monodis new/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file2}
++         if ! cmp -s ${file1} ${file2}; then
++           echo "$file differs ($ftype)"
++           diff -u ${file1} ${file2}
++           return 1
++         fi
++       else
++         echo "Cannot compare, no monodis installed"
++         return 1
++       fi
++       ;;
++    ELF*executable*|ELF*[LM]SB\ shared\ object*)
++       objdump -d --no-show-raw-insn old/$file | filter_disasm > $file1
++       if ! test -s $file1; then
++         # objdump has no idea how to handle it
++         if ! diff_two_files; then
++           ret=1
++           break
++         fi
++       fi       
++       elfdiff=
++       sed -i -e "s,old/,," $file1
++       objdump -d --no-show-raw-insn new/$file | filter_disasm > $file2
++       sed -i -e "s,new/,," $file2
++       if ! diff -u $file1 $file2 > $dfile; then
++          echo "$file differs in assembler output"
++          head -n 200 $dfile
++          elfdiff="1"
++       fi
++       echo "" >$file1
++       echo "" >$file2
++       # Don't compare .build-id and .gnu_debuglink sections
++       sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr "\n" " ")"
++       for section in $sections; do
++          objdump -s -j $section old/$file | sed "s,^old/,," > $file1
++          objdump -s -j $section new/$file | sed "s,^new/,," > $file2
++          if ! diff -u $file1 $file2 > $dfile; then
++             echo "$file differs in ELF section $section"
++             head -n 200 $dfile
++             elfdiff="1"
++          fi
++       done
++       if test -z "$elfdiff"; then
++          echo "$file: only difference was in build-id or gnu_debuglink, GOOD."
++          return 0
++       fi
++       return 1
++       ;;
++     *ASCII*|*text*)
++       if ! cmp -s old/$file new/$file; then
++         echo "$file differs ($ftype)"
++         diff -u old/$file new/$file | head -n 200
++         return 1
++       fi
++       ;;
++     directory|setuid,\ directory|sticky,\ directory)
++       # tar might package directories - ignore them here
++       return 0
++       ;;
++     bzip2\ compressed\ data*)
++       if ! check_compressed_file "$file" "bz2"; then
++           return 1
++       fi
++       ;;
++     gzip\ compressed\ data*)
++       if ! check_compressed_file "$file" "gzip"; then
++           return 1
++       fi
++       ;;
++     XZ\ compressed\ data*)
++       if ! check_compressed_file "$file" "xz"; then
++           return 1
++       fi
++       ;;
++     POSIX\ tar\ archive)
++          mv old/$file{,.tar}
++          mv new/$file{,.tar}
++          if ! check_single_file ${file}.tar; then
++            return 1
++          fi
++       ;;
++     cpio\ archive)
++          mv old/$file{,.cpio}
++          mv new/$file{,.cpio}
++          if ! check_single_file ${file}.cpio; then
++            return 1
++          fi
++     ;;
++     symbolic\ link\ to\ *)
++       readlink "old/$file" > $file1
++       readlink "new/$file" > $file2
++       if ! diff -u $file1 $file2; then
++         echo "symlink target for $file differs"
++         return 1
++       fi
++       ;;
++     *)
++       if ! diff_two_files; then
++           return 1
++       fi
++       ;;
++  esac
++  return 0
++}
++
++# We need /proc mounted for some tests, so check that it's mounted and
++# complain if not.
++PROC_MOUNTED=0
++if [ ! -d /proc/self/ ]; then
++  echo "/proc is not mounted"
++  mount -orw -n -tproc none /proc
++  PROC_MOUNTED=1
++fi
++
++# preserve cmp_spec result for check_all runs
++ret=$RES
++for file in $files; do
++   if ! check_single_file $file; then
++       ret=1
++       if test -z "$check_all"; then
++           break
++       fi
++   fi
++done
++
++if [ "$PROC_MOUNTED" -eq "1" ]; then
++  echo "Unmounting proc"
++  umount /proc
++fi
++
++rm $file1 $file2 $dfile $rename_script
++rm -rf $dir
++if test "$ret" = 0; then
++     echo "Package content is identical"
++fi
++exit $ret
++# vim: tw=666 ts=2 et
+diff --git a/rpm-check.sh b/rpm-check.sh
+deleted file mode 100755
+index dd47642..0000000
+--- a/rpm-check.sh
++++ /dev/null
+@@ -1,764 +0,0 @@
+-#! /bin/bash
+-#
+-# Copyright (c) 2009, 2010, 2011, 2012 SUSE Linux Product GmbH, Germany.
+-# Licensed under GPL v2, see COPYING file for details.
+-#
+-# Written by Michael Matz and Stephan Coolo
+-# Enhanced by Andreas Jaeger
+-
+-FUNCTIONS=${0%/*}/functions.sh
+-
+-check_all=
+-case $1 in
+-  -a | --check-all)
+-    check_all=1
+-    shift
+-esac
+-
+-if test "$#" != 2; then
+-   echo "usage: $0 [-a|--check-all] old.rpm new.rpm"
+-   exit 1
+-fi
+-
+-self_script=$(cd $(dirname $0); echo $(pwd)/$(basename $0))
+-
+-source $FUNCTIONS
+-
+-oldpkg=`readlink -f $1`
+-newpkg=`readlink -f $2`
+-rename_script=`mktemp`
+-
+-if test ! -f "$oldpkg"; then
+-    echo "can't open $1"
+-    exit 1
+-fi
+-
+-if test ! -f "$newpkg"; then
+-    echo "can't open $2"
+-    exit 1
+-fi
+-
+-#usage unjar <file>
+-function unjar()
+-{
+-    local file
+-    file=$1
+-
+-    if [[ $(type -p fastjar) ]]; then
+-        UNJAR=fastjar
+-    elif [[ $(type -p jar) ]]; then
+-        UNJAR=jar
+-    elif [[ $(type -p unzip) ]]; then
+-        UNJAR=unzip
+-    else
+-        echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
+-        exit 1
+-    fi
+-
+-    case $UNJAR in
+-        jar|fastjar)
+-        # echo jar -xf $file
+-        ${UNJAR} -xf $file
+-        ;;
+-        unzip)
+-        unzip -oqq $file
+-        ;;
+-    esac
+-}
+-
+-# list files in directory
+-#usage unjar_l <file>
+-function unjar_l()
+-{
+-    local file
+-    file=$1
+-
+-    if [[ $(type -p fastjar) ]]; then
+-        UNJAR=fastjar
+-    elif [[ $(type -p jar) ]]; then
+-        UNJAR=jar
+-    elif [[ $(type -p unzip) ]]; then
+-        UNJAR=unzip
+-    else
+-        echo "ERROR: jar, fastjar, or unzip is not installed (trying file $file)"
+-        exit 1
+-    fi
+-
+-    case $UNJAR in
+-        jar|fastjar)
+-        ${UNJAR} -tf $file
+-        ;;
+-        unzip)
+-        unzip -l $file
+-        ;;
+-    esac
+-}
+-
+-filter_disasm()
+-{
+-   sed -e 's/^ *[0-9a-f]\+://' -e 's/\$0x[0-9a-f]\+/$something/' -e 's/callq *[0-9a-f]\+/callq /' -e 's/# *[0-9a-f]\+/#  /' -e 's/\(0x\)\?[0-9a-f]\+(/offset(/' -e 's/[0-9a-f]\+ </</' -e 's/^<\(.*\)>:/\1:/' -e 's/<\(.*\)+0x[0-9a-f]\+>/<\1 + ofs>/' 
+-}
+-
+-echo "Comparing `basename $oldpkg` to `basename $newpkg`"
+-
+-case $oldpkg in
+-  *.rpm)
+-     cmp_spec $rename_script $oldpkg $newpkg
+-     RES=$?
+-     case $RES in
+-       0)
+-          echo "RPM meta information is identical"
+-          if test -z "$check_all"; then
+-             exit 0
+-          fi
+-          ;;
+-       1)
+-          echo "RPM meta information is different"
+-          if test -z "$check_all"; then
+-             exit 1
+-          fi
+-          ;;
+-       2)
+-          echo "RPM file checksum differs."
+-          RES=0
+-          ;;
+-       *)
+-          echo "Wrong exit code!"
+-          exit 1
+-          ;;
+-     esac
+-     ;;
+-esac
+-
+-file1=`mktemp`
+-file2=`mktemp`
+-
+-dir=`mktemp -d`
+-echo "Extracting packages"
+-unpackage $oldpkg $dir/old
+-unpackage $newpkg $dir/new
+-
+-# files is set in cmp_spec for rpms, so if RES is empty we should assume
+-# it wasn't an rpm and pick all files for comparison.
+-if [ -z $RES ]; then
+-    oldfiles=`cd $dir/old; find . -type f`
+-    newfiles=`cd $dir/new; find . -type f`
+-
+-    files=`echo -e "$oldfiles\n$newfiles" | sort -u`
+-fi
+-
+-cd $dir
+-bash $rename_script
+-
+-dfile=`mktemp`
+-
+-diff_two_files()
+-{
+-  if ! cmp -s old/$file new/$file; then
+-     echo "$file differs ($ftype)"
+-     hexdump -C old/$file > $file1
+-     hexdump -C new/$file > $file2
+-     diff -u $file1 $file2 | head -n 200
+-     return 1
+-  fi
+-  return 0
+-}
+-
+-trim_man_first_line()
+-{
+-    # Handles the first line if it is like:
+-    #.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
+-    #.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.43.3.
+-    local f=$1
+-    sed -i -e '1{
+-    s|^\.\\"[[:blank:]]\+Automatically[[:blank:]]generated[[:blank:]]by[[:blank:]]Pod::Man[[:blank:]].*|.\\" Overly verbose Pod::Man|
+-    s|^\.\\"[[:blank:]]\+DO[[:blank:]]NOT[[:blank:]]MODIFY[[:blank:]]THIS[[:blank:]]FILE![[:blank:]]\+It[[:blank:]]was[[:blank:]]generated[[:blank:]]by[[:blank:]]help2man[[:blank:]].*|.\\" Overly verbose help2man|
+-    }' $f
+-}
+-
+-trim_man_TH()
+-{
+-    # Handles lines like:
+-    # .TH debhelper 7 "2010-02-27" "7.4.15" "Debhelper"
+-    # .TH DIRMNGR-CLIENT 1 2010-02-27 "Dirmngr 1.0.3" "GNU Privacy Guard"
+-    # .TH ccmake 1 "March 06, 2010" "ccmake 2.8.1-rc3"
+-    # .TH QEMU-IMG 1 "2010-03-14" " " " "
+-    # .TH kdecmake 1 "May 07, 2010" "cmake 2.8.1"
+-    # .TH "appender.h" 3 "12 May 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
+-    # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
+-    # .TH "OFFLINEIMAP" "1" "11 May 2010" "John Goerzen" "OfflineIMAP Manual"
+-    # .TH gv 3guile "13 May 2010"
+-    #.TH "GIT\-ARCHIMPORT" "1" "09/13/2010" "Git 1\&.7\&.1" "Git Manual"
+-    # .TH LDIRECTORD 8 "2010-10-20" "perl v5.12.2" "User Contributed Perl Documentation"
+-    # .TH ccmake 1 "February 05, 2012" "ccmake 2.8.7"
+-    # .TH "appender.h" 3 "Tue Aug 31 2010" "Version 1.2.1" "log4c" \" -*- nroff -*-
+-    # .TH ARCH "1" "September 2010" "GNU coreutils 8.5" "User Commands"
+-    # .TH "GCM-CALIBRATE" "1" "03 February 2012" "" ""
+-    #.TH Locale::Po4a::Xml.pm 3pm "2015-01-30" "Po4a Tools" "Po4a Tools"
+-    local f=$1
+-    # (.TH   quoted section) (quoted_date)(*)
+-    sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "qq2000-01-01"\3|' $f
+-    # (.TH unquoted section) (quoted_date)(*)
+-    sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\("[^"]\+"\)\([[:blank:]]\+.*\)\?|\1 "uq2000-02-02"\3|' $f
+-    # (.TH   quoted section) (unquoted_date)(*)
+-    sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+"[^"]\+"[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 qu2000-03-03\3|' $f
+-    # (.TH unquoted section) (unquoted_date)(*)
+-    sed -i -e 's|^\([[:blank:]]*\.TH[[:blank:]]\+[^"][^[:blank:]]\+[[:blank:]]\+[^[:blank:]]\+\)[[:blank:]]\+\([^"][^[:blank:]]\+\)\([[:blank:]]\+.*\)\?|\1 uu2000-04-04\3|' $f
+-}
+-
+-strip_numbered_anchors()
+-{
+-  # Remove numbered anchors on Docbook / HTML files.
+-  # This should be save since we remove them from old and new files.
+-  # A trailing </a> or </div> tag will stay also on both files.
+-  for f in old/$file new/$file; do
+-     sed -i -e 's%<[ ]*a[ ]\+name[^<]*[0-9]\+[^<]*%%g' \
+-     -e 's%<[ ]*a[ ]\+href[^<]*#[^<]*[0-9]\+[^<]*%%g' \
+-     -e 's%<[^<]*id="ftn\.[^<]*[0-9]\+[^<]*%%g' $f
+-  done
+-}
+-
+-
+-check_compressed_file()
+-{
+-  local file=$1
+-  local ext=$2
+-  local tmpdir=`mktemp -d`
+-  local ftype
+-  local ret=0
+-  echo "$ext file with odd filename: $file"
+-  if test -n "$tmpdir"; then
+-    mkdir $tmpdir/{old,new}
+-    cp --parents --dereference old/$file $tmpdir/
+-    cp --parents --dereference new/$file $tmpdir/
+-    if pushd $tmpdir > /dev/null ; then
+-      case "$ext" in
+-        bz2)
+-          mv old/$file{,.bz2}
+-          mv new/$file{,.bz2}
+-          bzip2 -d old/$file.bz2
+-          bzip2 -d new/$file.bz2
+-          ;;
+-        gzip)
+-          mv old/$file{,.gz}
+-          mv new/$file{,.gz}
+-          gzip -d old/$file.gz
+-          gzip -d new/$file.gz
+-          ;;
+-        xz)
+-          mv old/$file{,.xz}
+-          mv new/$file{,.xz}
+-          xz -d old/$file.xz
+-          xz -d new/$file.xz
+-          ;;
+-      esac
+-      ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
+-      case $ftype in
+-        POSIX\ tar\ archive)
+-          echo "$ext content is: $ftype"
+-          mv old/$file{,.tar}
+-          mv new/$file{,.tar}
+-          if ! check_single_file ${file}.tar; then
+-            ret=1
+-          fi
+-          ;;
+-        ASCII\ cpio\ archive\ *)
+-          echo "$ext content is: $ftype"
+-          mv old/$file{,.cpio}
+-          mv new/$file{,.cpio}
+-          if ! check_single_file ${file}.cpio; then
+-            ret=1
+-          fi
+-          ;;
+-        *)
+-          echo "unhandled $ext content: $ftype"
+-          if ! diff_two_files; then
+-            ret=1
+-          fi
+-          ;;
+-      esac
+-      popd > /dev/null
+-    fi
+-    rm -rf "$tmpdir"
+-  fi
+-  return $ret
+-}
+-
+-check_single_file()
+-{
+-  local file="$1"
+-  case $file in
+-    *.spec)
+-       sed -i -e "s,Release:.*$release1,Release: @RELEASE@," old/$file
+-       sed -i -e "s,Release:.*$release2,Release: @RELEASE@," new/$file
+-       ;;
+-    *.exe.mdb|*.dll.mdb)
+-       # Just debug information, we can skip them
+-       echo "$file skipped as debug file."
+-       return 0
+-       ;;
+-    *.a)
+-       flist=`ar t new/$file`
+-       pwd=$PWD
+-       fdir=`dirname $file`
+-       cd old/$fdir
+-       ar x `basename $file`
+-       cd $pwd/new/$fdir
+-       ar x `basename $file`
+-       cd $pwd
+-       for f in $flist; do
+-          if ! check_single_file $fdir/$f; then
+-             return 1
+-          fi
+-       done
+-       return 0
+-       ;;
+-    *.cpio)
+-       flist=`cpio --quiet --list --force-local < "new/$file"`
+-       pwd=$PWD
+-       fdir=$file.extract.$PPID.$$
+-       mkdir old/$fdir new/$fdir
+-       cd old/$fdir
+-       cpio --quiet --extract --force-local < "../${file##*/}"
+-       cd $pwd/new/$fdir
+-       cpio --quiet --extract --force-local < "../${file##*/}"
+-       cd $pwd
+-       local ret=0
+-       for f in $flist; do
+-         if ! check_single_file $fdir/$f; then
+-           ret=1
+-           if test -z "$check_all"; then
+-             break
+-           fi
+-         fi
+-       done
+-       rm -rf old/$fdir new/$fdir
+-       return $ret
+-       ;;
+-    *.tar|*.tar.bz2|*.tar.gz|*.tgz|*.tbz2)
+-       flist=`tar tf new/$file`
+-       pwd=$PWD
+-       fdir=`dirname $file`
+-       cd old/$fdir
+-       tar xf `basename $file`
+-       cd $pwd/new/$fdir
+-       tar xf `basename $file`
+-       cd $pwd
+-       local ret=0
+-       for f in $flist; do
+-         if ! check_single_file $fdir/$f; then
+-           ret=1
+-           if test -z "$check_all"; then
+-             break
+-           fi
+-         fi
+-       done
+-       return $ret
+-       ;;
+-    *.zip|*.jar|*.war)
+-       cd old
+-       unjar_l ./$file |sort > flist
+-       #  10-05-2010 14:39
+-       sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ," flist
+-       # 2012-02-03 07:59
+-       sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
+-       cd ../new
+-       unjar_l ./$file |sort> flist
+-       sed -i -e "s, [0-9][0-9]-[0-9][0-9]-[0-9]\+ [0-9][0-9]:[0-9][0-9] , date ,; " flist
+-       sed -i -e "s, 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9] , date ," flist
+-       cd ..
+-       if ! cmp -s old/flist new/flist; then
+-          echo "$file has different file list"
+-          diff -u old/flist new/flist
+-          return 1
+-       fi
+-       flist=`grep date new/flist | sed -e 's,.* date ,,'`
+-       pwd=$PWD
+-       fdir=`dirname $file`
+-       cd old/$fdir
+-       unjar `basename $file`
+-       cd $pwd/new/$fdir
+-       unjar `basename $file`
+-       cd $pwd
+-       local ret=0
+-       for f in $flist; do
+-         if test -f new/$fdir/$f && ! check_single_file $fdir/$f; then
+-           ret=1
+-           if test -z "$check_all"; then
+-             break
+-           fi
+-         fi
+-       done
+-       return $ret;;
+-     *.pyc|*.pyo)
+-        perl -e "open fh, '+<', 'old/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
+-        perl -e "open fh, '+<', 'new/$file'; seek fh, 4, SEEK_SET; print fh '0000';"
+-        ;;
+-     *.bz2)
+-        bunzip2 -c old/$file > old/${file/.bz2/}
+-        bunzip2 -c new/$file > new/${file/.bz2/}
+-        check_single_file ${file/.bz2/}
+-        return $?
+-        ;;
+-     *.gz)
+-        gunzip -c old/$file > old/${file/.gz/}
+-        gunzip -c new/$file > new/${file/.gz/}
+-        check_single_file ${file/.gz/}
+-        return $?
+-        ;;
+-     *.rpm)
+-	$self_script -a old/$file new/$file
+-        return $?
+-        ;;
+-     *png)
+-	# Try to remove timestamps, only if convert from ImageMagick is installed
+-        if [[ $(type -p convert) ]]; then
+-	  convert old/$file +set date:create +set date:modify old/${file/.png/_n.png}
+-	  convert old/$file +set date:create +set date:modify new/${file/.png/_n.png}
+-	  if ! cmp -s old/${file/.png/_n.png} new/${file/.png/_n.png}; then
+-	      echo "$file differs ($ftype)"
+-	      hexdump -C old/${file/.png/_n.png} > $file1
+-	      hexdump -C new/${file/.png/_n.png} > $file2
+-	      diff -u $file1 $file2 | head -n 20
+-	      return 1
+-	  fi
+-	  return 0
+-	fi
+-        ;;
+-     /usr/share/locale/*/LC_MESSAGES/*.mo|/usr/share/locale-bundle/*/LC_MESSAGES/*.mo)
+-       for f in old/$file new/$file; do
+-         sed -i -e "s,POT-Creation-Date: ....-..-.. ..:..+....,POT-Creation-Date: 1970-01-01 00:00+0000," $f
+-       done
+-       ;;
+-     /usr/share/doc/packages/*/*.html|\
+-     /usr/share/doc/kde/HTML/*/*/*.html|/usr/share/doc/*/html/*.html)
+-       for f in old/$file new/$file; do
+-         # texi2html output, e.g. in kvm, indent, qemu
+-	 sed -i -e "s|^<!-- Created on .*, 20.. by texi2html .\...|<!-- Created on August 7, 2009 by texi2html 1.82|" $f
+-	 sed -i -e 's|^ *This document was generated by <em>Autobuild</em> on <em>.*, 20..</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html .\...</em></a>.$|  This document was generated by <em>Autobuild</em> on <em>August 7, 2009</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.|' $f
+-	 # doxygen docu, e.g. in libssh and log4c
+-	 sed -i -e 's|Generated on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] 20[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
+-	 # Generated on Sat Aug 14 2010 16:49:48 for libssh
+-	 sed -i -e 's|Generated on ... ... [0-9]* 20[0-9][0-9] [0-9]*:[0-9][0-9]:[0-9][0-9] for |Generated on Mon May 10 20:45:00 2010 for |' $f
+-       done
+-       strip_numbered_anchors
+-       ;;
+-     /usr/share/javadoc/*.html |\
+-     /usr/share/javadoc/*/*.html|/usr/share/javadoc/*/*/*.html)
+-       strip_numbered_anchors
+-       # There are more timestamps in html, so far we handle only some primitive versions.
+-       for f in old/$file new/$file; do
+-         # Javadoc:
+-          # <head>
+-          # <!-- Generated by javadoc (version 1.7.0_75) on Tue Feb 03 02:20:12 GMT 2015 -->
+-          # <!-- Generated by javadoc on Tue Feb 03 00:02:48 GMT 2015 -->
+-          # <meta name="date" content="2015-02-03">
+-          # </head>
+-          sed -i -e '
+-            /^<head>/{
+-              : next
+-              n
+-              /^<\/head>/{
+-                b end_head
+-              }
+-              s/^\(<!-- Generated by javadoc\) \((\(build\|version\) [0-9._]\+) on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \5/
+-              t next
+-              s/^\(<!-- Generated by javadoc\) \(on ... ... .. ..:..:.. \(GMT\|UTC\) ....\) \(-->\)/\1 some-date-removed-by-build-compare \3/
+-              t next
+-              s/^<meta name="date" content="[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}">/<meta name="date" content="some-date-removed-by-build-compare">/
+-              b next
+-            }
+-            : end_head
+-          ' $f
+-         # Gjdoc HtmlDoclet:
+-	 sed -i -e 's%Generated by Gjdoc HtmlDoclet [0-9,.]*, part of <a href="http://www.gnu.org/software/classpath/cp-tools/" title="" target="_top">GNU Classpath Tools</a>, on .*, 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.%Generated by Gjdoc.%' $f
+-	 sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\(.*\)GNU Classpath Tools</a>, on [A-Z][a-z]* [0-9]*, 20?? [0-9]*:??:?? \(a|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN"\1GNU Classpath Tools</a>, on January 1, 2009 0:00:00 a.m. GMT.</p>%' $f
+-	 sed -i -e 's%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\(.*GNU Classpath Tools</a>\), on [a-zA-Z]* [0-9][0-9], 20.. [0-9]*:..:.. \(a\|p\)\.m\. GMT.</p>%<!DOCTYPE html PUBLIC "-//gnu.org///DTD\1,on May 1, 2010 1:11:42 p.m. GMT.</p>%' $f
+-	 # deprecated-list is randomly ordered, sort it for comparison
+-	 case $f in
+-	   */deprecated-list.html)
+-	     sort -o $f $f
+-	     ;;
+-	 esac
+-       done
+-       ;;
+-     /usr/share/javadoc/gjdoc.properties |\
+-     /usr/share/javadoc/*/gjdoc.properties)
+-       for f in old/$file new/$file; do
+-	 sed -i -e 's|^#[A-Z][a-z]\{2\} [A-Z][a-z]\{2\} [0-9]\{2\} ..:..:.. GMT 20..$|#Fri Jan 01 11:27:36 GMT 2009|' $f
+-       done
+-       ;;
+-     */fonts.scale|*/fonts.dir|*/encodings.dir)
+-       for f in old/$file new/$file; do
+-         # sort files before comparing
+-         sort -o $f $f
+-       done
+-       ;;
+-     /var/adm/perl-modules/*)
+-       for f in old/$file new/$file; do
+-         sed -i -e 's|^=head2 ... ... .. ..:..:.. ....: C<Module>|=head2 Wed Jul  1 00:00:00 2009: C<Module>|' $f
+-       done
+-       ;;
+-     /usr/share/man/man3/*3pm)
+-       for f in old/$file new/$file; do
+-         sed -i -e 's| 3 "20..-..-.." "perl v5....." "User Contributed Perl Documentation"$| 3 "2009-01-01" "perl v5.10.0" "User Contributed Perl Documentation"|' $f
+-         trim_man_TH $f
+-         trim_man_first_line $f
+-       done
+-       ;;
+-     /usr/share/man/*/man*|/usr/share/man/man*|/usr/lib/texmf/doc/man/*/*)
+-
+-       for f in old/$file new/$file; do
+-         trim_man_TH $f
+-         trim_man_first_line $f
+-         # generated by docbook xml:
+-         #.\"      Date: 09/13/2010
+-         sed -i -e 's|Date: [0-1][0-9]/[0-9][0-9]/201[0-9]|Date: 09/13/2010|' $f
+-       done
+-       ;;
+-     *.elc)
+-       # emacs lisp files
+-       for f in old/$file new/$file; do
+-         sed -i -e 's|Compiled by abuild@.* on ... ... .. ..:..:.. 20..$|compiled by abuild@buildhost on Wed Jul 01 00:00:00 2009|' $f
+-       done
+-       ;;
+-     /var/lib/texmf/web2c/*/*fmt |\
+-     /var/lib/texmf/web2c/metafont/*.base|\
+-     /var/lib/texmf/web2c/metapost/*.mem)
+-       # binary dump of TeX and Metafont formats, we can ignore them for good
+-       echo "difference in $file ignored."
+-       return 0
+-       ;;
+-     */libtool)
+-       for f in old/$file new/$file; do
+-	  sed -i -e 's|^# Libtool was configured on host [A-Za-z0-9]*:$|# Libtool was configured on host x42:|' $f
+-       done
+-       ;;
+-     /etc/mail/*cf|/etc/sendmail.cf)
+-       # from sendmail package
+-       for f in old/$file new/$file; do
+-	  # - ##### built by abuild@build33 on Thu May 6 11:21:17 UTC 2010
+-	  sed -i -e 's|built by abuild@[a-z0-9]* on ... ... [0-9]* [0-9]*:[0-9][0-9]:[0-9][0-9] .* 20[0-9][0-9]|built by abuild@build42 on Thu May 6 11:21:17 UTC 2010|' $f
+-       done
+-       ;;
+-     /usr/share/doc/kde/HTML/*/*/index.cache|/usr/share/doc/kde/HTML/*/*/*/index.cache|\
+-     /usr/share/gtk-doc/html/*/*.html|/usr/share/gtk-doc/html/*/*.devhelp2)
+-       # various kde and gtk packages
+-       strip_numbered_anchors
+-       ;;
+-    */created.rid)
+-       # ruby documentation
+-       # file just contains a timestamp and nothing else, so ignore it
+-       echo "Ignore $file"
+-       return 0
+-       ;;
+-    */rdoc/files/*.html)
+-       # ruby documentation
+-       # <td>Mon Sep 20 19:02:43 +0000 2010</td>
+-       for f in old/$file new/$file; do
+-          sed -i -e 's%<td>[A-Z][a-z][a-z] [A-Z][a-z][a-z] [0-9]\+ [0-9]\+:[0-9]\+:[0-9]\+ +0000 201[0-9]</td>%<td>Mon Sep 20 19:02:43 +0000 2010</td>%g' $f
+-       done
+-       strip_numbered_anchors
+-       ;;
+-    */Linux*Env.Set.sh)
+-       # LibreOffice files, contains:
+-       # Generated on: Mon Apr 18 13:19:22 UTC 2011
+-       for f in old/$file new/$file; do
+-	 sed -i -e 's%^# Generated on:.*UTC 201[0-9] *$%# Generated on: Sometime%g' $f
+-       done
+-       ;;
+-    /usr/lib/libreoffice/solver/inc/*/deliver.log)
+-       # LibreOffice log file
+-      echo "Ignore $file"
+-      return 0
+-      ;;
+-    /var/adm/update-messages/*|/var/adm/update-scripts/*)
+-      # encode version-release inside
+-      oldfn=`echo "$file"|sed -e s/-$release2/-$release1/;`
+-
+-      # fetchmsttfonts embeds the release number in the update shell script.
+-      echo sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
+-      sed -i -e "s/-$release1/-$release2/g;" "old/$oldfn"
+-
+-      if ! diff -u old/$oldfn new/$file; then
+-           echo "$oldfn is not same as $file"
+-           return 1
+-      fi
+-      echo "$file and $oldfn are same"
+-      return 0
+-      ;;
+-    *.ps)
+-      for f in "old/$file" "new/$file"; do
+-        sed -i -e '
+-	/^%%CreationDate:[[:blank:]]/d
+-	/^%%Creator:[[:blank:]]groff[[:blank:]]version[[:blank:]]/d
+-	' "$f"
+-      done
+-    ;;
+-    *pdf)
+-      # PDF files contain a unique ID, remove it
+-      # Format of the ID is:
+-      # /ID [<9ACE247A70CF9BEAFEE15E116259BD6D> <9ACE247A70CF9BEAFEE15E116259BD6D>]
+-      # with optional spaces. pdftex creates also:
+-      # /CreationDate (D:20120103083206Z)
+-      # /ModDate (D:20120103083206Z)
+-      # and possibly XML metadata as well
+-      for f in "old/$file" "new/$file"; do
+-        sed -i \
+-            '/obj/,/endobj/{
+-               s%/ID \?\[ \?<[^>]\+> \?<[^>]\+> \?\]%/IDrandom%g;
+-               s%/CreationDate \?(D:[^)]*)%/CreationDate (D: XXX)%g;
+-               s%/ModDate \?(D:[^)]*)%/ModDate (D: XXX)%g;
+-               s%<pdf:CreationDate>[^<]*</pdf:CreationDate>%<pdf:CreationDate>XXX</pdf:CreationDate>%g;
+-               s%<pdf:ModDate>[^<]*</pdf:ModDate>%<pdf:ModDate>XXX</pdf:ModDate>%g;
+-               s%<xap:CreateDate>[^<]*</xap:CreateDate>%<xap:CreateDate>XXX</xap:CreateDate>%g;
+-               s%<xap:ModifyDate>[^<]*</xap:ModifyDate>%<xap:ModifyDate>XXX</xap:ModifyDate>%g;
+-               s%<xap:MetadataDate>[^<]*</xap:MetadataDate>%<xap:MetadataDate>XXX</xap:MetadataDate>%g;
+-            }' "$f"
+-      done
+-      ;;
+-  esac
+-
+-  ftype=`/usr/bin/file old/$file | sed 's@^[^:]\+:[[:blank:]]*@@'`
+-  case $ftype in
+-     PE32\ executable*Mono\/\.Net\ assembly*)
+-       echo "PE32 Mono/.Net assembly: $file"
+-       if [ -x /usr/bin/monodis ] ; then
+-         monodis old/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file1}
+-         monodis new/$file 2>/dev/null|sed -e 's/GUID = {.*}/GUID = { 42 }/;'> ${file2}
+-         if ! cmp -s ${file1} ${file2}; then
+-           echo "$file differs ($ftype)"
+-           diff -u ${file1} ${file2}
+-           return 1
+-         fi
+-       else
+-         echo "Cannot compare, no monodis installed"
+-         return 1
+-       fi
+-       ;;
+-    ELF*executable*|ELF*[LM]SB\ shared\ object*)
+-       objdump -d --no-show-raw-insn old/$file | filter_disasm > $file1
+-       if ! test -s $file1; then
+-         # objdump has no idea how to handle it
+-         if ! diff_two_files; then
+-           ret=1
+-           break
+-         fi
+-       fi       
+-       elfdiff=
+-       sed -i -e "s,old/,," $file1
+-       objdump -d --no-show-raw-insn new/$file | filter_disasm > $file2
+-       sed -i -e "s,new/,," $file2
+-       if ! diff -u $file1 $file2 > $dfile; then
+-          echo "$file differs in assembler output"
+-          head -n 200 $dfile
+-          elfdiff="1"
+-       fi
+-       echo "" >$file1
+-       echo "" >$file2
+-       # Don't compare .build-id and .gnu_debuglink sections
+-       sections="$(objdump -s new/$file | grep "Contents of section .*:" | sed -r "s,.* (.*):,\1,g" | grep -v -e "\.build-id" -e "\.gnu_debuglink" | tr "\n" " ")"
+-       for section in $sections; do
+-          objdump -s -j $section old/$file | sed "s,^old/,," > $file1
+-          objdump -s -j $section new/$file | sed "s,^new/,," > $file2
+-          if ! diff -u $file1 $file2 > $dfile; then
+-             echo "$file differs in ELF section $section"
+-             head -n 200 $dfile
+-             elfdiff="1"
+-          fi
+-       done
+-       if test -z "$elfdiff"; then
+-          echo "$file: only difference was in build-id or gnu_debuglink, GOOD."
+-          return 0
+-       fi
+-       return 1
+-       ;;
+-     *ASCII*|*text*)
+-       if ! cmp -s old/$file new/$file; then
+-         echo "$file differs ($ftype)"
+-         diff -u old/$file new/$file | head -n 200
+-         return 1
+-       fi
+-       ;;
+-     directory|setuid,\ directory|sticky,\ directory)
+-       # tar might package directories - ignore them here
+-       return 0
+-       ;;
+-     bzip2\ compressed\ data*)
+-       if ! check_compressed_file "$file" "bz2"; then
+-           return 1
+-       fi
+-       ;;
+-     gzip\ compressed\ data*)
+-       if ! check_compressed_file "$file" "gzip"; then
+-           return 1
+-       fi
+-       ;;
+-     XZ\ compressed\ data*)
+-       if ! check_compressed_file "$file" "xz"; then
+-           return 1
+-       fi
+-       ;;
+-     POSIX\ tar\ archive)
+-          mv old/$file{,.tar}
+-          mv new/$file{,.tar}
+-          if ! check_single_file ${file}.tar; then
+-            return 1
+-          fi
+-       ;;
+-     cpio\ archive)
+-          mv old/$file{,.cpio}
+-          mv new/$file{,.cpio}
+-          if ! check_single_file ${file}.cpio; then
+-            return 1
+-          fi
+-     ;;
+-     symbolic\ link\ to\ *)
+-       readlink "old/$file" > $file1
+-       readlink "new/$file" > $file2
+-       if ! diff -u $file1 $file2; then
+-         echo "symlink target for $file differs"
+-         return 1
+-       fi
+-       ;;
+-     *)
+-       if ! diff_two_files; then
+-           return 1
+-       fi
+-       ;;
+-  esac
+-  return 0
+-}
+-
+-# We need /proc mounted for some tests, so check that it's mounted and
+-# complain if not.
+-PROC_MOUNTED=0
+-if [ ! -d /proc/self/ ]; then
+-  echo "/proc is not mounted"
+-  mount -orw -n -tproc none /proc
+-  PROC_MOUNTED=1
+-fi
+-
+-# preserve cmp_spec result for check_all runs
+-ret=$RES
+-for file in $files; do
+-   if ! check_single_file $file; then
+-       ret=1
+-       if test -z "$check_all"; then
+-           break
+-       fi
+-   fi
+-done
+-
+-if [ "$PROC_MOUNTED" -eq "1" ]; then
+-  echo "Unmounting proc"
+-  umount /proc
+-fi
+-
+-rm $file1 $file2 $dfile $rename_script
+-rm -rf $dir
+-if test "$ret" = 0; then
+-     echo "Package content is identical"
+-fi
+-exit $ret
+-# vim: tw=666 ts=2 et
+diff --git a/same-build-result.sh b/same-build-result.sh
+index c8907e2..7e9bd4f 100644
+--- a/same-build-result.sh
++++ b/same-build-result.sh
+@@ -7,11 +7,11 @@
+ # Enhanced by Andreas Jaeger <aj@suse.de>
+ #
+ # The script decides if the new build differes from the former one,
+-# using rpm-check.sh.
++# using pkg-diff.sh.
+ # The script is called as part of the build process as:
+ # /usr/lib/build/same-build-result.sh /.build.oldpackages /usr/src/packages/RPMS /usr/src/packages/SRPMS
+ 
+-CMPSCRIPT=${0%/*}/rpm-check.sh
++CMPSCRIPT=${0%/*}/pkg-diff.sh
+ SCMPSCRIPT=${0%/*}/srpm-check.sh
+ 
+ check_all=1
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/ccache/ccache.inc b/meta/recipes-devtools/ccache/ccache.inc
new file mode 100644
index 0000000..69aa64e
--- /dev/null
+++ b/meta/recipes-devtools/ccache/ccache.inc
@@ -0,0 +1,18 @@
+SUMMARY = "a fast C/C++ compiler cache"
+DESCRIPTION = "ccache is a compiler cache. It speeds up recompilation \
+by caching the result of previous compilations and detecting when the \
+same compilation is being done again. Supported languages are C, C\+\+, \
+Objective-C and Objective-C++."
+HOMEPAGE = "http://ccache.samba.org"
+SECTION = "devel"
+LICENSE = "GPLv3+"
+
+DEPENDS = "zlib"
+
+SRC_URI = "git://git.samba.org/ccache.git"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/ccache/ccache_3.2.3.bb b/meta/recipes-devtools/ccache/ccache_3.2.3.bb
new file mode 100644
index 0000000..357df75
--- /dev/null
+++ b/meta/recipes-devtools/ccache/ccache_3.2.3.bb
@@ -0,0 +1,8 @@
+require ccache.inc
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b3c337e7664559a789d9f7a93e5283c1"
+
+SRCREV = "4cad46e8ee0053144bb00919f0dadd20c1f87013"
+
+SRC_URI += "file://0001-Fix-regression-in-recent-change-related-to-zlib-in-n.patch"
diff --git a/meta/recipes-devtools/ccache/files/0001-Fix-regression-in-recent-change-related-to-zlib-in-n.patch b/meta/recipes-devtools/ccache/files/0001-Fix-regression-in-recent-change-related-to-zlib-in-n.patch
new file mode 100644
index 0000000..f5bd9aa
--- /dev/null
+++ b/meta/recipes-devtools/ccache/files/0001-Fix-regression-in-recent-change-related-to-zlib-in-n.patch
@@ -0,0 +1,73 @@
+From f74c76107933046309861680b741adc67ac2a34e Mon Sep 17 00:00:00 2001
+From: Joel Rosdahl <joel@rosdahl.net>
+Date: Mon, 17 Aug 2015 19:05:14 +0200
+Subject: [PATCH] Fix regression in recent change related to zlib in
+ nonstandard location
+
+To allow for specifying a -L flag in LDFLAGS and have it take effect for
+-lz, 0220de9c8ebfb18caae2ac1aa163d060e98ceade put -lz in extra_libs
+instead of extra_ldflags. However, extra_libs is supposed to contain
+paths to libraries which are prerequisites of the ccache link rule, and
+some older versions of make got confused by seeing -lz as a
+prerequisite.
+
+This fix is to revert 0220de9c8ebfb18caae2ac1aa163d060e98ceade and
+instead make sure that LDFLAGS comes before extra_ldflags.
+
+Upstream-Status: Backport
+---
+ Makefile.in  |  2 +-
+ NEWS.txt     | 10 ++++++++++
+ configure.ac |  2 +-
+ 3 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index e7515b1..d3621cd 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -20,7 +20,7 @@ RANLIB = @RANLIB@
+ 
+ all_cflags = $(CFLAGS)
+ all_cppflags = @DEFS@ @extra_cppflags@ -DSYSCONFDIR=$(sysconfdir) -I. -I$(srcdir) $(CPPFLAGS)
+-all_ldflags = @extra_ldflags@ $(LDFLAGS)
++all_ldflags = $(LDFLAGS) @extra_ldflags@
+ extra_libs = @extra_libs@
+ 
+ base_sources = \
+diff --git a/NEWS.txt b/NEWS.txt
+index f13feeb..eaeadf6 100644
+--- a/NEWS.txt
++++ b/NEWS.txt
+@@ -2,6 +2,16 @@ ccache news
+ ===========
+ 
+ 
++Unreleased 3.2.4
++----------------
++
++Bug fixes
++~~~~~~~~~
++
++- Fixed build error related to zlib on systems with older make versions
++  (regression in ccache 3.2.3).
++
++
+ ccache 3.2.3
+ ------------
+ Release date: 2015-08-16
+diff --git a/configure.ac b/configure.ac
+index 8d8ce92..9e65588 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -120,7 +120,7 @@ if test x${use_bundled_zlib} = xyes; then
+     extra_libs="zlib/libz.a"
+     mkdir -p zlib
+ else
+-    extra_libs="-lz"
++    extra_ldflags="-lz"
+ fi
+ 
+ dnl Linking on Windows needs ws2_32
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/cdrtools/cdrtools-native_3.01a31.bb b/meta/recipes-devtools/cdrtools/cdrtools-native_3.01a31.bb
new file mode 100644
index 0000000..d0f36e2
--- /dev/null
+++ b/meta/recipes-devtools/cdrtools/cdrtools-native_3.01a31.bb
@@ -0,0 +1,21 @@
+# cdrtools-native OE build file
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+SUMMARY = "A set of tools for CD recording, including cdrecord"
+HOMEPAGE = "http://sourceforge.net/projects/cdrtools/"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & CDDL-1.0 & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=32f68170be424c2cd64804337726b312"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/cdrtools/alpha/cdrtools-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "78172557894f469b4584d008e93ec469"
+SRC_URI[sha256sum] = "183b5c12777779e78d8b69461aae52401f863768e7e7391d60730006f8cadc5a"
+
+S = "${WORKDIR}/cdrtools-3.01"
+
+inherit native
+
+do_install() {
+	make install GMAKE_NOWARN=true INS_BASE=${prefix} DESTDIR=${D}
+}
diff --git a/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch b/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch
new file mode 100644
index 0000000..f96f104
--- /dev/null
+++ b/meta/recipes-devtools/chrpath/chrpath/standarddoc.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+autoconf/automake set docdir automatically, use their value ensuring 
+doc files are placed into $datadir/doc, not $prefix/doc.
+
+RP 5/7/2011
+
+Index: chrpath-0.13/Makefile.am
+===================================================================
+--- chrpath-0.13.orig/Makefile.am	2011-07-05 23:40:14.769920254 +0100
++++ chrpath-0.13/Makefile.am	2011-07-05 23:40:19.819920635 +0100
+@@ -1,7 +1,5 @@
+ SUBDIRS = testsuite deb
+ 
+-docdir = $(prefix)/doc/$(PACKAGE)-$(VERSION)
+-
+ doc_DATA = AUTHORS COPYING ChangeLog INSTALL NEWS README
+ 
+ bin_PROGRAMS = chrpath
diff --git a/meta/recipes-devtools/chrpath/chrpath_0.16.bb b/meta/recipes-devtools/chrpath/chrpath_0.16.bb
new file mode 100644
index 0000000..0a3b06e
--- /dev/null
+++ b/meta/recipes-devtools/chrpath/chrpath_0.16.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Tool to edit rpath in ELF binaries"
+DESCRIPTION = "chrpath allows you to change the rpath (where the \
+application looks for libraries) in an application. It does not \
+(yet) allow you to add an rpath if there isn't one already."
+HOMEPAGE = "http://alioth.debian.org/projects/chrpath/"
+BUGTRACKER = "http://alioth.debian.org/tracker/?atid=412807&group_id=31052"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+SRC_URI = "http://alioth.debian.org/frs/download.php/file/3979/chrpath-0.16.tar.gz \
+           file://standarddoc.patch"
+
+SRC_URI[md5sum] = "2bf8d1d1ee345fc8a7915576f5649982"
+SRC_URI[sha256sum] = "bb0d4c54bac2990e1bdf8132f2c9477ae752859d523e141e72b3b11a12c26e7b"
+
+inherit autotools
+
+# We don't have a staged chrpath-native for ensuring our binary is
+# relocatable, so use the one we've just built
+CHRPATH_BIN_class-native = "${B}/chrpath"
+
+PROVIDES_append_class-native = " chrpath-replacement-native"
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/cmake/cmake-native_3.3.1.bb b/meta/recipes-devtools/cmake/cmake-native_3.3.1.bb
new file mode 100644
index 0000000..cb4e749
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake-native_3.3.1.bb
@@ -0,0 +1,16 @@
+require cmake.inc
+inherit native
+
+# Using cmake's internal libarchive, so some dependencies are needed
+DEPENDS += "bzip2-native zlib-native"
+
+SRC_URI += "\
+    file://cmlibarchive-disable-ext2fs.patch \
+"
+
+# Disable ccmake since we don't depend on ncurses
+CMAKE_EXTRACONF = "\
+    -DBUILD_CursesDialog=0 \
+    -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \
+    -DHAVE_SYS_ACL_H=0 \
+"
diff --git a/meta/recipes-devtools/cmake/cmake.inc b/meta/recipes-devtools/cmake/cmake.inc
new file mode 100644
index 0000000..57e93ac
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake.inc
@@ -0,0 +1,52 @@
+# Copyright (C) 2005, Koninklijke Philips Electronics NV.  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+SUMMARY = "Cross-platform, open-source make system"
+HOMEPAGE = "http://www.cmake.org/"
+BUGTRACKER = "http://public.kitware.com/Bug/my_view_page.php"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://Copyright.txt;md5=3ba5a6c34481652ce573e5c4e1d707e4 \
+                    file://Source/cmake.h;beginline=1;endline=10;md5=341736dae83c9e344b53eeb1bc7d7bc2"
+
+CMAKE_MAJOR_VERSION = "${@'.'.join(d.getVar('PV',1).split('.')[0:2])}"
+
+SRC_URI = "http://www.cmake.org/files/v${CMAKE_MAJOR_VERSION}/cmake-${PV}.tar.gz \
+           file://support-oe-qt4-tools-names.patch \
+           file://qt4-fail-silent.patch \
+           "
+
+SRC_URI[md5sum] = "52638576f4e1e621fed6c3410d3a1b12"
+SRC_URI[sha256sum] = "cd65022c6a0707f1c7112f99e9c981677fdd5518f7ddfa0f778d4cee7113e3d6"
+
+inherit autotools
+
+# Ugly hack to work around undefined OE_QMAKE_PATH_EXTERNAL_HOST_BINS variable
+# and possibly missing qmake binary (qtbase-native can be removed from sysroot
+# e.g. in order to upgrade it, even when there is target qtbase)
+
+# Fixes errors like this in cmake(-native).do_configure:
+#| -- Performing Test run_pic_test - Success
+#| CMake Error at tmp-eglibc/sysroots/qemuarm/usr/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:27 (message):
+#|   The imported target "Qt5::Core" references the file
+#|
+#|      "/qmake"
+#|
+#|   but this file does not exist.  Possible reasons include:
+
+do_configure_prepend() {
+	sed -i 's/^find_package(Qt5Core QUIET)$/#find_package(Qt5Core QUIET)/g' ${S}/Tests/RunCMake/CMakeLists.txt
+	sed -i 's/^  find_package(Qt5Core REQUIRED)/#  find_package(Qt5Core REQUIRED)/g' ${S}/Tests/Qt4And5Automoc/CMakeLists.txt
+	sed -i 's/^  find_package(Qt5Widgets QUIET NO_MODULE)/#  find_package(Qt5Widgets QUIET NO_MODULE)/g' ${S}/Tests/CMakeLists.txt
+	sed -i 's/^find_package(Qt5Widgets QUIET)/#find_package(Qt5Widgets QUIET)/g' ${S}/Source/QtDialog/CMakeLists.txt
+	sed -i 's/^  find_package(Qt5Widgets REQUIRED)/#  find_package(Qt5Widgets REQUIRED)/g' ${S}/Tests/QtAutoUicInterface/CMakeLists.txt
+	sed -i 's/^  find_package(Qt5Widgets REQUIRED)/#  find_package(Qt5Widgets REQUIRED)/g' ${S}/Tests/QtAutogen/CMakeLists.txt
+	sed -i 's/^  find_package(Qt5Core REQUIRED)/#  find_package(Qt5Core REQUIRED)/g' ${S}/Tests/QtAutogen/autorcc_depends/CMakeLists.txt
+}
+
+# Extra flags to pass to cmake invoked by bootstrap
+CMAKE_EXTRACONF = ""
+
+do_configure () {
+	${S}/configure --prefix=${prefix} -- ${CMAKE_EXTRACONF}
+}
diff --git a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
new file mode 100644
index 0000000..60014bb
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake
@@ -0,0 +1,18 @@
+set( CMAKE_SYSTEM_NAME Linux )
+set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE )
+set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS}  CACHE STRING "" FORCE )
+set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
+set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE )
+set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} )
+set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
+set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+
+string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT})
+string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
+
+# Include the toolchain configuration subscripts
+file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" )
+foreach(config ${toolchain_config_files})
+    include(${config})
+endforeach()
diff --git a/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch b/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch
new file mode 100644
index 0000000..bf36712
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake/cmlibarchive-disable-ext2fs.patch
@@ -0,0 +1,26 @@
+Disable use of ext2fs/ext2_fs.h by cmake's internal libarchive copy
+
+We don't want to add a dependency on e2fsprogs-native for cmake-native,
+and we don't use CPack so just disable this functionality.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+--- a/Utilities/cmlibarchive/CMakeLists.txt
++++ b/Utilities/cmlibarchive/CMakeLists.txt
+@@ -237,12 +237,8 @@ LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H)
+ LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H)
+ LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H)
+ LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H)
+-LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H)
+-
+-CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h>
+-#include <ext2fs/ext2_fs.h>
+-int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS)
+-
++SET(HAVE_EXT2FS_EXT2_FS_H 0)
++SET(HAVE_WORKING_EXT2_IOC_GETFLAGS 0)
+ LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H)
+ LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H)
+ LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
diff --git a/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch b/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch
new file mode 100644
index 0000000..0c059f1
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake/dont-run-cross-binaries.patch
@@ -0,0 +1,23 @@
+cmake: don't run cross-binaries on host machine
+
+When doing the cross build we obviously cannot run those binaries on
+host since they can be binary incompatible.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+Index: cmake-2.8.10.1/CMakeLists.txt
+===================================================================
+--- cmake-2.8.10.1.orig/CMakeLists.txt
++++ cmake-2.8.10.1/CMakeLists.txt
+@@ -588,7 +588,8 @@ mark_as_advanced(CMAKE_STRICT)
+ 
+ # build the remaining subdirectories
+ add_subdirectory(Source)
+-add_subdirectory(Utilities)
++# Come on! Running the cross-binaries on host is not a good idea.
++#add_subdirectory(Utilities)
+ add_subdirectory(Tests)
+ 
+ if(BUILD_TESTING)
diff --git a/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh b/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh
new file mode 100644
index 0000000..0eb56b6
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake/environment.d-cmake.sh
@@ -0,0 +1 @@
+alias cmake="cmake -DCMAKE_TOOLCHAIN_FILE=$OECORE_NATIVE_SYSROOT/usr/share/cmake/OEToolchainConfig.cmake"
diff --git a/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch b/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch
new file mode 100644
index 0000000..80fc277
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake/qt4-fail-silent.patch
@@ -0,0 +1,77 @@
+Fail silently if system Qt installation is broken
+
+Fixes a regression in behaviour from 2.8.10 to 2.8.11 resulting in the
+following error if the system Qt installation is broken:
+
+CMake Error at Modules/FindQt4.cmake:1028 (set_property):
+  set_property could not find TARGET Qt4::QtCore.  Perhaps it has not yet
+  been created.
+Call Stack (most recent call first):
+  Tests/RunCMake/CMakeLists.txt:79 (find_package)
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+The patch was slightly adapted in order to match cmake 3.2.2:
+Another set_property was introduced which had to be included
+within the if(QT_QTCORE_FOUND) statement.
+
+Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de>
+---
+ Modules/FindQt4.cmake | 39 ++++++++++++++++++++-------------------
+ 1 file changed, 20 insertions(+), 19 deletions(-)
+
+diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
+index 6704769..9048e35 100644
+--- a/Modules/FindQt4.cmake
++++ b/Modules/FindQt4.cmake
+@@ -1000,25 +1000,26 @@ if (QT_QMAKE_EXECUTABLE AND
+     endif()
+   endmacro()
+ 
+-
+-  # Set QT_xyz_LIBRARY variable and add
+-  # library include path to QT_INCLUDES
+-  _QT4_ADJUST_LIB_VARS(QtCore)
+-  set_property(TARGET Qt4::QtCore APPEND PROPERTY
+-    INTERFACE_INCLUDE_DIRECTORIES
+-      "${QT_MKSPECS_DIR}/default"
+-      ${QT_INCLUDE_DIR}
+-  )
+-  set_property(TARGET Qt4::QtCore APPEND PROPERTY
+-    INTERFACE_COMPILE_DEFINITIONS
+-      $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>
+-  )
+-  set_property(TARGET Qt4::QtCore PROPERTY
+-    INTERFACE_QT_MAJOR_VERSION 4
+-  )
+-  set_property(TARGET Qt4::QtCore APPEND PROPERTY
+-    COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION
+-  )
++  if(QT_QTCORE_FOUND)
++    # Set QT_xyz_LIBRARY variable and add
++    # library include path to QT_INCLUDES
++    _QT4_ADJUST_LIB_VARS(QtCore)
++    set_property(TARGET Qt4::QtCore APPEND PROPERTY
++      INTERFACE_INCLUDE_DIRECTORIES
++        "${QT_MKSPECS_DIR}/default"
++        ${QT_INCLUDE_DIR}
++    )
++    set_property(TARGET Qt4::QtCore APPEND PROPERTY
++      INTERFACE_COMPILE_DEFINITIONS
++        $<$<NOT:$<CONFIG:Debug>>:QT_NO_DEBUG>
++    )
++    set_property(TARGET Qt4::QtCore PROPERTY
++      INTERFACE_QT_MAJOR_VERSION 4
++    )
++    set_property(TARGET Qt4::QtCore APPEND PROPERTY
++      COMPATIBLE_INTERFACE_STRING QT_MAJOR_VERSION
++    )
++  endif()
+ 
+   foreach(QT_MODULE ${QT_MODULES})
+     _QT4_ADJUST_LIB_VARS(${QT_MODULE})
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch b/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch
new file mode 100644
index 0000000..15cbca8
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake/support-oe-qt4-tools-names.patch
@@ -0,0 +1,54 @@
+cmake: support OpenEmbedded Qt4 tool binary names
+
+The FindQt4 module looks for Qt4 binaries to be able to gather the
+paths used for compilation and also to be using during other processes
+(translation update, translation binary generating and like) however
+OpenEmbedded has renamed those to allow old QMake to be used in
+parallel with the current one. This patch adds support for the
+OpenEmbedded specific binary names.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+The patch was slightly adapted in order to match cmake 3.2.2:
+Instead of find_program, _find_qt4_program is now used.
+
+Signed-off-by: Moritz Blume <moritz.blume@bmw-carit.de>
+---
+ Modules/FindQt4.cmake | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
+index 11091b5..6704769 100644
+--- a/Modules/FindQt4.cmake
++++ b/Modules/FindQt4.cmake
+@@ -522,7 +522,7 @@ endfunction()
+ 
+ set(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
+ 
+-set(_QT4_QMAKE_NAMES qmake qmake4 qmake-qt4 qmake-mac)
++set(_QT4_QMAKE_NAMES qmake qmake2 qmake4 qmake-qt4 qmake-mac)
+ _qt4_find_qmake("${_QT4_QMAKE_NAMES}" QT_QMAKE_EXECUTABLE QTVERSION)
+ 
+ if (QT_QMAKE_EXECUTABLE AND
+@@ -1148,12 +1148,12 @@ if (QT_QMAKE_EXECUTABLE AND
+   _find_qt4_program(QT_MOC_EXECUTABLE Qt4::moc moc-qt4 moc4 moc)
+   _find_qt4_program(QT_UIC_EXECUTABLE Qt4::uic uic-qt4 uic4 uic)
+   _find_qt4_program(QT_UIC3_EXECUTABLE Qt4::uic3 uic3)
+-  _find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc)
+-  _find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml)
+-  _find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp)
++  _find_qt4_program(QT_RCC_EXECUTABLE Qt4::rcc rcc4 rcc)
++  _find_qt4_program(QT_DBUSCPP2XML_EXECUTABLE Qt4::qdbuscpp2xml qdbuscpp2xml4 qdbuscpp2xml)
++  _find_qt4_program(QT_DBUSXML2CPP_EXECUTABLE Qt4::qdbusxml2cpp qdbusxml2cpp4 qdbusxml2cpp)
+   _find_qt4_program(QT_LUPDATE_EXECUTABLE Qt4::lupdate lupdate-qt4 lupdate4 lupdate)
+   _find_qt4_program(QT_LRELEASE_EXECUTABLE Qt4::lrelease lrelease-qt4 lrelease4 lrelease)
+-  _find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator)
++  _find_qt4_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE Qt4::qcollectiongenerator qcollectiongenerator-qt4 qcollectiongenerator qcollectiongenerator4)
+   _find_qt4_program(QT_DESIGNER_EXECUTABLE Qt4::designer designer-qt4 designer4 designer)
+   _find_qt4_program(QT_LINGUIST_EXECUTABLE Qt4::linguist linguist-qt4 linguist4 linguist)
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/cmake/cmake_3.3.1.bb b/meta/recipes-devtools/cmake/cmake_3.3.1.bb
new file mode 100644
index 0000000..2f188f0
--- /dev/null
+++ b/meta/recipes-devtools/cmake/cmake_3.3.1.bb
@@ -0,0 +1,53 @@
+require cmake.inc
+
+inherit cmake
+
+DEPENDS += "curl expat zlib libarchive xz ncurses bzip2"
+
+SRC_URI_append_class-nativesdk = " \
+    file://OEToolchainConfig.cmake \
+    file://environment.d-cmake.sh"
+
+# Strip ${prefix} from ${docdir}, set result into docdir_stripped
+python () {
+    prefix=d.getVar("prefix", True)
+    docdir=d.getVar("docdir", True)
+
+    if not docdir.startswith(prefix):
+        raise bb.build.FuncFailed('docdir must contain prefix as its prefix')
+
+    docdir_stripped = docdir[len(prefix):]
+    if len(docdir_stripped) > 0 and docdir_stripped[0] == '/':
+        docdir_stripped = docdir_stripped[1:]
+
+    d.setVar("docdir_stripped", docdir_stripped)
+}
+
+EXTRA_OECMAKE=" \
+    -DCMAKE_DOC_DIR=${docdir_stripped}/cmake-${CMAKE_MAJOR_VERSION} \
+    -DCMAKE_USE_SYSTEM_LIBRARY_BZIP2=1 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_CURL=1 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=1 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_FORM=1 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE=1 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_LIBLZMA=1 \
+    -DCMAKE_USE_SYSTEM_LIBRARY_ZLIB=1 \
+    -DKWSYS_CHAR_IS_SIGNED=1 \
+    -DBUILD_CursesDialog=0 \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '-DKWSYS_LFS_WORKS=1', '-DKWSYS_LFS_DISABLE=1', d)} \
+"
+
+do_install_append_class-nativesdk() {
+    mkdir -p ${D}${datadir}/cmake
+    install -m 644 ${WORKDIR}/OEToolchainConfig.cmake ${D}${datadir}/cmake/
+
+    mkdir -p ${D}${SDKPATHNATIVE}/environment-setup.d
+    install -m 644 ${WORKDIR}/environment.d-cmake.sh ${D}${SDKPATHNATIVE}/environment-setup.d/cmake.sh
+}
+
+FILES_${PN}_append_class-nativesdk = " ${SDKPATHNATIVE}"
+
+FILES_${PN} += "${datadir}/cmake-${CMAKE_MAJOR_VERSION}"
+FILES_${PN}-doc += "${docdir}/cmake-${CMAKE_MAJOR_VERSION}"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.22.bb b/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.22.bb
new file mode 100644
index 0000000..6f73564
--- /dev/null
+++ b/meta/recipes-devtools/desktop-file-utils/desktop-file-utils-native_0.22.bb
@@ -0,0 +1,16 @@
+SECTION = "console/utils"
+SUMMARY = "Command line utilities for working with *.desktop files"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/desktop-file-utils"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS = "glib-2.0-native"
+
+SRC_URI = "http://freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "c6b9f9aac1ea143091178c23437e6cd0"
+SRC_URI[sha256sum] = "843532672692f98e9b2d6ae6cc8658da562dfde1606c7f33d9d227a344de56c5"
+
+inherit autotools native
+
+S = "${WORKDIR}/desktop-file-utils-${PV}"
diff --git a/meta/recipes-devtools/devel-config/distcc-config.bb b/meta/recipes-devtools/devel-config/distcc-config.bb
new file mode 100644
index 0000000..cb7830b
--- /dev/null
+++ b/meta/recipes-devtools/devel-config/distcc-config.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Sets up distcc for compilation on the target device"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://distcc.sh"
+
+S = "${WORKDIR}"
+
+# Default to the host machine for a running qemu session
+DISTCC_HOSTS ?= "192.168.7.1"
+
+do_configure() {
+	sed -i "s%@DISTCC_HOSTS@%${DISTCC_HOSTS}%" distcc.sh
+}
+
+do_install() {
+	install -d ${D}${sysconfdir}/profile.d
+	install -m 0755 distcc.sh ${D}${sysconfdir}/profile.d/
+}
+
+RDEPENDS_${PN} = "distcc"
diff --git a/meta/recipes-devtools/devel-config/distcc-config/distcc.sh b/meta/recipes-devtools/devel-config/distcc-config/distcc.sh
new file mode 100644
index 0000000..b420593
--- /dev/null
+++ b/meta/recipes-devtools/devel-config/distcc-config/distcc.sh
@@ -0,0 +1,4 @@
+DISTCC_HOSTS="@DISTCC_HOSTS@"
+#DISTCC_VERBOSE="1"
+
+export DISTCC_HOSTS
diff --git a/meta/recipes-devtools/devel-config/nfs-export-root.bb b/meta/recipes-devtools/devel-config/nfs-export-root.bb
new file mode 100644
index 0000000..169d005
--- /dev/null
+++ b/meta/recipes-devtools/devel-config/nfs-export-root.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Configuration script to export target rootfs filesystem"
+DESCRIPTION = "Enables NFS access from any host to the entire filesystem (for development purposes)."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r1"
+
+SRC_URI = "file://exports"
+
+S = "${WORKDIR}"
+
+do_install() {
+	install -d ${D}${sysconfdir}
+	install -m 0644 exports ${D}${sysconfdir}/
+}
+
+RDEPENDS_${PN} = "packagegroup-core-nfs-server"
diff --git a/meta/recipes-devtools/devel-config/nfs-export-root/exports b/meta/recipes-devtools/devel-config/nfs-export-root/exports
new file mode 100644
index 0000000..1353c5a
--- /dev/null
+++ b/meta/recipes-devtools/devel-config/nfs-export-root/exports
@@ -0,0 +1 @@
+/ *(rw,no_root_squash,async,no_subtree_check)
diff --git a/meta/recipes-devtools/diffstat/diffstat/run-ptest b/meta/recipes-devtools/diffstat/diffstat/run-ptest
new file mode 100644
index 0000000..a936b3d
--- /dev/null
+++ b/meta/recipes-devtools/diffstat/diffstat/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+./testing/run_test.sh ./testing/case*.pat |sed \
+  -e 's|** ok|PASS|' \
+  -e 's|?? fail|FAIL|'
diff --git a/meta/recipes-devtools/diffstat/diffstat_1.60.bb b/meta/recipes-devtools/diffstat/diffstat_1.60.bb
new file mode 100644
index 0000000..25ba4da
--- /dev/null
+++ b/meta/recipes-devtools/diffstat/diffstat_1.60.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Tool to produce a statistics based on a diff"
+DESCRIPTION = "diffstat reads the output of diff and displays a histogram of \
+the insertions, deletions, and modifications per-file. It is useful for \
+reviewing large, complex patch files."
+HOMEPAGE = "http://invisible-island.net/diffstat/"
+SECTION = "devel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://install-sh;endline=42;md5=b3549726c1022bee09c174c72a0ca4a5"
+
+SRC_URI = "ftp://invisible-island.net/diffstat/diffstat-${PV}.tgz \
+           file://run-ptest \
+"
+
+SRC_URI[md5sum] = "ba889da4c06b547aa2d78fa96800ae6f"
+SRC_URI[sha256sum] = "2032e418b43bae70d548e32da901ebc4ac12972381de1314bebde0b126fb0123"
+
+S = "${WORKDIR}/diffstat-${PV}"
+
+inherit autotools gettext ptest
+
+LDFLAGS += "${TOOLCHAIN_OPTIONS}"
+
+do_configure () {
+	if [ ! -e ${S}/acinclude.m4 ]; then
+		mv ${S}/aclocal.m4 ${S}/acinclude.m4
+	fi
+	autotools_do_configure
+}
+
+do_install_ptest() {
+	cp -r ${S}/testing ${D}${PTEST_PATH}
+}
diff --git a/meta/recipes-devtools/distcc/distcc_3.1.bb b/meta/recipes-devtools/distcc/distcc_3.1.bb
new file mode 100644
index 0000000..f8879c8
--- /dev/null
+++ b/meta/recipes-devtools/distcc/distcc_3.1.bb
@@ -0,0 +1,74 @@
+SUMMARY = "A parallel build system"
+DESCRIPTION = "distcc is a parallel build system that distributes \
+compilation of C/C++/ObjC code across machines on a network."
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "avahi"
+
+GTKCONFIG = "gtk"
+GTKCONFIG_libc-uclibc = ""
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${GTKCONFIG}', '', d)} popt"
+PACKAGECONFIG[gtk] = "--with-gtk,--without-gtk --without-gnome,gtk+"
+# use system popt by default
+PACKAGECONFIG[popt] = "--without-included-popt,--with-included-popt,popt"
+
+RRECOMMENDS_${PN} = "avahi-daemon"
+
+SRC_URI = "git://github.com/distcc/distcc.git \
+           file://separatebuilddir.patch \
+           file://0001-zeroconf-Include-fcntl.h.patch \
+           file://default \
+           file://distccmon-gnome.desktop \
+           file://distcc \
+           file://distcc.service"
+SRCREV = "9a172d3d20042754a30c0cd9a5d63fd1a8120c31"
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig update-rc.d useradd systemd
+
+EXTRA_OECONF += "--disable-Werror PYTHON=/dev/null"
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system \
+                       --home /dev/null \
+                       --no-create-home \
+                       --gid nogroup \
+                       distcc"
+
+INITSCRIPT_NAME = "distcc"
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "distcc.service"
+
+do_install_append() {
+    install -d ${D}${sysconfdir}/init.d/
+    install -d ${D}${sysconfdir}/default
+    install -m 0755 ${WORKDIR}/distcc ${D}${sysconfdir}/init.d/
+    install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/distcc
+    install -d ${D}${systemd_unitdir}/system/
+    install -m 0644 ${WORKDIR}/distcc.service ${D}${systemd_unitdir}/system
+    sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/distcc.service
+    ${DESKTOPINSTALL}
+}
+DESKTOPINSTALL = ""
+DESKTOPINSTALL_libc-glibc () {
+    install -d ${D}${datadir}/distcc/
+    install -m 0644 ${WORKDIR}/distccmon-gnome.desktop ${D}${datadir}/distcc/
+}
+PACKAGES += "distcc-distmon-gnome"
+
+FILES_${PN} = " ${sysconfdir} \
+		${bindir}/distcc \
+    ${bindir}/lsdistcc \
+		${bindir}/distccd \
+		${bindir}/distccmon-text \
+		${systemd_unitdir}/system/distcc.service"
+FILES_distcc-distmon-gnome = "  ${bindir}/distccmon-gnome \
+				${datadir}/distcc"
+
+pkg_postrm_${PN} () {
+	deluser distcc || true
+}
diff --git a/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch b/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch
new file mode 100644
index 0000000..b17ec9c
--- /dev/null
+++ b/meta/recipes-devtools/distcc/files/0001-zeroconf-Include-fcntl.h.patch
@@ -0,0 +1,29 @@
+From 8331fc4759d809512f404e7a27f817ad6d616450 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 18:00:33 -0700
+Subject: [PATCH] zeroconf: Include fcntl.h
+
+We need it for getting deinitions for O_* e.g. O_CREAT
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/zeroconf.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/zeroconf.c b/src/zeroconf.c
+index 414ddc4..31bd33f 100644
+--- a/src/zeroconf.c
++++ b/src/zeroconf.c
+@@ -33,6 +33,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <limits.h>
++#include <fcntl.h>
+ 
+ #include <avahi-common/domain.h>
+ #include <avahi-common/error.h>
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/distcc/files/default b/meta/recipes-devtools/distcc/files/default
new file mode 100644
index 0000000..63c4159
--- /dev/null
+++ b/meta/recipes-devtools/distcc/files/default
@@ -0,0 +1,24 @@
+# Defaults for distcc initscript
+# sourced by /etc/init.d/distcc
+
+#
+# should distcc be started on boot?
+#
+# STARTDISTCC="true"
+
+STARTDISTCC="true"
+
+#
+# Which networks/hosts should be allowed to connect to the daemon?
+# You can list multiple hosts/networks separated by spaces.
+# Networks have to be in CIDR notation, f.e. 192.168.1.0/24
+# Hosts are represented by a single IP Adress
+#
+# ALLOWEDNETS="127.0.0.1"
+
+ALLOWEDNETS="192.168.7.0/24"
+
+#
+# OPTIONS is used for the systemd service file
+#
+OPTIONS="--allow 192.168.7.0/24"
diff --git a/meta/recipes-devtools/distcc/files/distcc b/meta/recipes-devtools/distcc/files/distcc
new file mode 100755
index 0000000..e36f0fa
--- /dev/null
+++ b/meta/recipes-devtools/distcc/files/distcc
@@ -0,0 +1,119 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          distcc
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      1
+# Short-Description: simple distributed compiler client and server
+### END INIT INFO
+#
+# distccd Debian init.d script contributed by Jason Thomas.  (Debian #161136)
+#
+# skeleton	example file to build /etc/init.d/ scripts.
+#		This file should be used to construct scripts for /etc/init.d.
+#
+#		Written by Miquel van Smoorenburg <miquels@cistron.nl>.
+#		Modified for Debian GNU/Linux
+#		by Ian Murdock <imurdock@gnu.ai.mit.edu>.
+#
+# Version:	@(#)skeleton  1.9.1  08-Apr-2002  miquels@cistron.nl
+#
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/distccd
+NAME=distcc
+DESC="Distributed Compiler Daemon"
+DAEMON_ARGS="--pid-file=/var/run/$NAME.pid --daemon"
+# please change those variables by overriding them in /etc/defaults/distcc
+ALLOWEDNETS="127.0.0.1"
+
+# Reads config file (will override defaults above)
+[ -r /etc/default/distcc ] && . /etc/default/distcc
+
+test -x $DAEMON || exit 0
+
+set -e
+
+# Source function library.
+. /etc/init.d/functions
+
+# construct access list
+ALLOW=""
+for net in $ALLOWEDNETS
+do
+	ALLOW="$ALLOW --allow $net"
+done
+
+should_start() {
+	if [ "$STARTDISTCC" != "true" ] && [ "$STARTDISTCC" != "YES" ]; then
+		echo "STARTDISTCC is set to false in /etc/default/distcc"
+		echo "$DAEMON not starting"
+		exit 0
+	fi
+	# we need permission to write to the pid file
+	touch /var/run/$NAME.pid
+	chown distcc /var/run/$NAME.pid
+}
+
+case "$1" in
+  start)
+	should_start
+	echo -n "Starting $DESC: $NAME"
+	start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+	--exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
+	{
+	    code=$?
+	    echo "$0: start failed with error code $code" >&2
+	    exit $code
+	}
+	echo "."
+	;;
+  stop)
+	echo -n "Stopping $DESC: $NAME"
+	start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+		--exec $DAEMON ||
+	{
+	    code=$?
+	    echo "$0: stop failed with error code $code" >&2
+	    exit $code
+	}
+	rm -f /var/run/$NAME.pid >/dev/null 2>&1
+	echo "."
+	;;
+  restart|force-reload)
+	#
+	#	If the "reload" option is implemented, move the "force-reload"
+	#	option to the "reload" entry above. If not, "force-reload" is
+	#	just the same as "restart".
+	#
+	echo -n "Restarting $DESC: $NAME"
+	start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
+		--exec $DAEMON
+	sleep 1
+	should_start
+	start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
+		--exec $DAEMON -- $DAEMON_ARGS $ALLOW ||
+	{
+	    code=$?
+	    rm -f /var/run/$NAME.pid >/dev/null 2>&1
+	    echo "$0: restart failed with error code $code" >&2
+	    exit $code
+	}
+	echo "."
+	;;
+
+   status)
+	status $DAEMON
+	exit $?
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload|status}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
+
+
diff --git a/meta/recipes-devtools/distcc/files/distcc.service b/meta/recipes-devtools/distcc/files/distcc.service
new file mode 100644
index 0000000..0253ddf
--- /dev/null
+++ b/meta/recipes-devtools/distcc/files/distcc.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Distccd A Distributed Compilation Server
+After=network.target
+
+[Service]
+User=distcc
+EnvironmentFile=-/etc/default/distcc
+ExecStart=@BINDIR@/distccd --verbose --no-detach --daemon $OPTIONS
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop b/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop
new file mode 100644
index 0000000..7b5d85c
--- /dev/null
+++ b/meta/recipes-devtools/distcc/files/distccmon-gnome.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Version=0.9.4
+Exec=distccmon-gnome
+Name=distcc monitor
+GenericName=Distributed Compile Monitor
+Comment=Graphical view of distributed compile tasks
+Icon=distccmon-gnome-icon
+TryExec=distccmon-gnome
+Terminal=false
+Type=Application
+Categories=GNOME;Development;
+StartupNotify=true
diff --git a/meta/recipes-devtools/distcc/files/separatebuilddir.patch b/meta/recipes-devtools/distcc/files/separatebuilddir.patch
new file mode 100644
index 0000000..b9e3e42
--- /dev/null
+++ b/meta/recipes-devtools/distcc/files/separatebuilddir.patch
@@ -0,0 +1,21 @@
+When building with a separate build directory, make install fails,
+unable to find the gnome_data files. This patch corrects the
+patch and ensures the build works in this case.
+
+RP 2013/3/8
+
+Upstream-Status: Pending
+
+Index: distcc-3.1/Makefile.in
+===================================================================
+--- distcc-3.1.orig/Makefile.in	2008-12-02 21:50:31.000000000 +0000
++++ distcc-3.1/Makefile.in	2013-03-08 10:49:24.224400937 +0000
+@@ -1088,7 +1088,7 @@
+ install-gnome-data: $(gnome_data)
+ 	$(mkinstalldirs) "$(DESTDIR)$(pkgdatadir)"
+ 	for p in $(gnome_data); do				\
+-	$(INSTALL_DATA) "$$p" "$(DESTDIR)$(pkgdatadir)" || exit 1; \
++	$(INSTALL_DATA) "$(srcdir)/$$p" "$(DESTDIR)$(pkgdatadir)" || exit 1; \
+ 	done
+ 
+ install-conf: $(conf_files) $(default_files)
diff --git a/meta/recipes-devtools/dmidecode/dmidecode_2.12.bb b/meta/recipes-devtools/dmidecode/dmidecode_2.12.bb
new file mode 100644
index 0000000..4c16556
--- /dev/null
+++ b/meta/recipes-devtools/dmidecode/dmidecode_2.12.bb
@@ -0,0 +1,20 @@
+SUMMARY = "DMI (Desktop Management Interface) table related utilities"
+HOMEPAGE = "http://www.nongnu.org/dmidecode/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/dmidecode/${BP}.tar.bz2"
+
+COMPATIBLE_HOST = "(i.86|x86_64|aarch64|arm|powerpc|powerpc64).*-linux"
+
+do_install() {
+	oe_runmake DESTDIR="${D}" install
+}
+
+do_unpack_extra() {
+	sed -i -e '/^prefix/s:/usr/local:${exec_prefix}:' ${S}/Makefile
+}
+addtask unpack_extra after do_unpack before do_patch
+
+SRC_URI[md5sum] = "a406f3cbb27736491698697beeddb781"
+SRC_URI[sha256sum] = "913ff3055d563a62a420789b8ee33b038de9afa18ea61254760ddf8ab87a5088"
diff --git a/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb b/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb
new file mode 100644
index 0000000..461b48f
--- /dev/null
+++ b/meta/recipes-devtools/docbook-dsssl-stylesheets/docbook-dsssl-stylesheets-native_1.79.bb
@@ -0,0 +1,68 @@
+SUMMARY = "DSSSL stylesheets used to transform SGML and XML DocBook files"
+HOMEPAGE = "http://docbook.sourceforge.net"
+# Simple persmissive
+LICENSE = "DSSSL"
+LIC_FILES_CHKSUM = "file://README;beginline=41;endline=74;md5=875385159b2ee76ecf56136ae7f542d6"
+
+DEPENDS = "sgml-common-native"
+
+PR = "r4"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docbook/docbook-dsssl-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "bc192d23266b9a664ca0aba4a7794c7c"
+SRC_URI[sha256sum] = "2f329e120bee9ef42fbdd74ddd60e05e49786c5a7953a0ff4c680ae6bdf0e2bc"
+
+S = "${WORKDIR}/docbook-dsssl-${PV}"
+
+inherit native
+
+SSTATEPOSTINSTFUNCS += "docbook_dsssl_stylesheets_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS += "docbook_dsssl_sysroot_preprocess"
+CLEANFUNCS += "docbook_dsssl_stylesheets_sstate_clean"
+
+
+do_install () {
+	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/docbook-dsssl.html
+	# for details.
+	install -d ${D}${bindir}
+	install -m 0755 bin/collateindex.pl ${D}${bindir}
+
+	install -d ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
+	install -m 0644 catalog ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
+	cp -v -R * ${D}${datadir}/sgml/docbook/dsssl-stylesheets-${PV}
+
+	install -d ${D}${sysconfdir}/sgml
+	echo "CATALOG ${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/catalog" > \
+		 ${D}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
+	echo "CATALOG ${datadir}/sgml/docbook/dsssl-stylesheets-${PV}/common/catalog" >> \
+		${D}${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
+}
+
+docbook_dsssl_stylesheets_sstate_postinst () {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+		# Ensure that the catalog file sgml-docbook.cat is properly
+		# updated when the package is installed from sstate cache.
+		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl \
+			--add ${sysconfdir}/sgml/sgml-docbook.bak \
+			${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
+		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl \
+			--add ${sysconfdir}/sgml/sgml-docbook.cat \
+			${sysconfdir}/sgml/dsssl-docbook-stylesheets.cat
+	fi
+}
+
+docbook_dsssl_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+    install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-dsssl
+}
+
+docbook_dsssl_stylesheets_sstate_clean () {
+	# Ensure that the catalog file sgml-docbook.cat is properly
+	# updated when the package is removed from sstate cache.
+	files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
+	for f in $files; do
+		[ ! -f $f ] || sed -i '/\/sgml\/dsssl-docbook-stylesheets.cat/d' $f
+	done
+}
diff --git a/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb b/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb
new file mode 100644
index 0000000..a7df4f9
--- /dev/null
+++ b/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-3.1-native_3.1.bb
@@ -0,0 +1,23 @@
+require docbook-sgml-dtd-native.inc
+
+LICENSE = "OASIS"
+LIC_FILES_CHKSUM = "file://LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
+
+DTD_VERSION = "3.1"
+
+PR = "${INC_PR}.0"
+
+# Note: the upstream sources are not distributed with a license file.
+# LICENSE-OASIS is included as a "patch" to workaround this. When
+# upgrading this recipe, please verify whether this is still needed.
+SRC_URI = "http://www.docbook.org/sgml/3.1/docbk31.zip \
+           file://LICENSE-OASIS"
+
+SRC_URI[md5sum] = "432749c0c806dbae81c8bcb70da3b5d3"
+SRC_URI[sha256sum] = "20261d2771b9a052abfa3d8fab1aa62be05791a010281c566f9073bf0e644538"
+
+do_compile() {
+	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd-3.html
+	# for details.
+	sed -i -e '/ISO 8879/d' -e 's|DTDDECL "-//OASIS//DTD DocBook V3.1//EN"|SGMLDECL|g' docbook.cat
+}
diff --git a/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb b/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb
new file mode 100644
index 0000000..88c9396
--- /dev/null
+++ b/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.1-native_4.1.bb
@@ -0,0 +1,23 @@
+require docbook-sgml-dtd-native.inc
+
+LICENSE = "OASIS"
+LIC_FILES_CHKSUM = "file://LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
+
+DTD_VERSION = "4.1"
+
+PR = "${INC_PR}.0"
+
+# Note: the upstream sources are not distributed with a license file.
+# LICENSE-OASIS is included as a "patch" to workaround this. When
+# upgrading this recipe, please verify whether this is still needed.
+SRC_URI = "http://docbook.org/sgml/4.1/docbk41.zip \
+           file://LICENSE-OASIS"
+
+SRC_URI[md5sum] = "489f6ff2a2173eb1e14216c10533ede2"
+SRC_URI[sha256sum] = "deaafcf0a3677692e7ad4412c0e41c1db3e9da6cdcdb3dd32b2cc1f9c97d6311"
+
+do_compile() {
+	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
+	# for details.
+	sed -i -e '/ISO 8879/d' -e '/gml/d' docbook.cat
+}
diff --git a/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb b/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb
new file mode 100644
index 0000000..ae723c7
--- /dev/null
+++ b/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-4.5-native.bb
@@ -0,0 +1,18 @@
+require docbook-sgml-dtd-native.inc
+
+LICENSE = "OASIS"
+LIC_FILES_CHKSUM = "file://LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
+
+DTD_VERSION = "4.5"
+
+PR = "${INC_PR}.0"
+PV = "4.5"
+
+SRC_URI[md5sum] = "07c581f4bbcba6d3aac85360a19f95f7"
+SRC_URI[sha256sum] = "8043e514e80c6c19cb146b5d37937d1305bf3abf9b0097c36df7f70f611cdf43"
+
+do_compile() {
+	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
+	# for details.
+	sed -i -e '/ISO 8879/d' -e'/gml/d' docbook.cat
+}
diff --git a/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc b/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc
new file mode 100644
index 0000000..af50987
--- /dev/null
+++ b/meta/recipes-devtools/docbook-sgml-dtd/docbook-sgml-dtd-native.inc
@@ -0,0 +1,70 @@
+# The DTDs of the various versions have to be installed in parallel and
+# should not replace each other. The installation step is common for
+# all versions and just differs in ${DTD_VERSION} which is set in each
+# version recipe.
+#
+# The DTDs do have some quirks (see LFS documentation).
+SUMMARY = "Document type definitions for verification of SGML data files"
+DESCRIPTION = "Document type definitions for verification of SGML data \
+files against the DocBook rule set"
+HOMEPAGE = "http://www.docbook.org/sgml/"
+
+DEPENDS = "sgml-common-native"
+
+# Note: the upstream sources are not distributed with a license file.
+# LICENSE-OASIS is included as a "patch" to workaround this. When
+# upgrading this recipe, please verify whether this is still needed.
+SRC_URI = "http://www.docbook.org/sgml/${DTD_VERSION}/docbook-${DTD_VERSION}.zip \
+           file://LICENSE-OASIS"
+
+# The .zip file extracts to the current dir
+S = "${WORKDIR}"
+
+INC_PR = "r3"
+
+SSTATEPOSTINSTFUNCS += "docbook_sgml_dtd_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS += "docbook_sgml_dtd_sysroot_preprocess"
+
+inherit native
+
+do_install () {
+	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/sgml-dtd.html
+	# for details.
+	install -d -m 755 ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}
+	install docbook.cat ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog
+	cp -PpRr *.dtd *.mod *.dcl ${D}${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}
+
+	install -d ${D}${sysconfdir}/sgml
+	echo "CATALOG ${datadir}/sgml/docbook/sgml-dtd-${DTD_VERSION}/catalog" > \
+		${D}${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
+}
+
+docbook_sgml_dtd_sstate_postinst () {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+		# Ensure that the catalog file sgml-docbook.cat is properly
+		# updated when the package is installed from sstate cache.
+		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION} \
+			--add ${sysconfdir}/sgml/sgml-docbook.bak \
+			${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
+		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION} \
+			--add ${sysconfdir}/sgml/sgml-docbook.cat \
+			${sysconfdir}/sgml/sgml-docbook-dtd-${DTD_VERSION}.cat
+	fi
+}
+
+docbook_sgml_dtd_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+    install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-docbook-sgml-dtd-${DTD_VERSION}
+}
+
+CLEANFUNCS += "docbook_sgml_dtd_sstate_clean"
+
+docbook_sgml_dtd_sstate_clean () {
+	# Ensure that the catalog file sgml-docbook.cat is properly
+	# updated when the package is removed from sstate cache.
+	files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
+	for f in $files; do
+		[ ! -f $f ] || sed -i '/\/sgml\/sgml-docbook-dtd-${DTD_VERSION}.cat/d' $f
+	done
+}
diff --git a/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS b/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS
new file mode 100644
index 0000000..6da7f5b
--- /dev/null
+++ b/meta/recipes-devtools/docbook-sgml-dtd/files/LICENSE-OASIS
@@ -0,0 +1,16 @@
+Permission to use, copy, modify and distribute the DocBook XML DTD
+and its accompanying documentation for any purpose and without fee
+is hereby granted in perpetuity, provided that the above copyright
+notice and this paragraph appear in all copies.  The copyright
+holders make no representation about the suitability of the DTD for
+any purpose.  It is provided "as is" without expressed or implied
+warranty.
+
+If you modify the DocBook DTD in any way, except for declaring and
+referencing additional sets of general entities and declaring
+additional notations, label your DTD as a variant of DocBook.  See
+the maintenance documentation for more information.
+
+Please direct all questions, bug reports, or suggestions for 
+changes to the docbook@lists.oasis-open.org mailing list. For more
+information, see http://www.oasis-open.org/docbook/.
diff --git a/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch b/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch
new file mode 100644
index 0000000..db079d6
--- /dev/null
+++ b/meta/recipes-devtools/docbook-utils/docbook-utils-0.6.14/re.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+Fix runtime error occurred e.g. with docbook-to-man calls:
+
+  grep: character class syntax is [[:space:]], not [:space:]
+  grep: character class syntax is [[:space:]], not [:space:]
+  jw: There is no frontend called "/docbook/utils-0.6.14/frontends/docbook".
+
+See also:
+
+   <https://qa.mandriva.com/show_bug.cgi?id=61127>
+
+Signed-off-by: Steffen Sledz <sledz@dresearch-fe.de>
+
+diff -Nurd docbook-utils-0.6.14-orig/bin/jw.in docbook-utils-0.6.14/bin/jw.in
+--- docbook-utils-0.6.14-orig/bin/jw.in	2012-03-29 07:50:00.789564826 +0200
++++ docbook-utils-0.6.14/bin/jw.in	2012-03-29 07:52:10.371302967 +0200
+@@ -80,9 +80,9 @@
+ SGML_CATALOGS_DIR="/etc/sgml"
+ if [ -f "$SGML_CONF" ]
+ then
+-  RE='^[:space:]*SGML_BASE_DIR[:space:]*=[:space:]*'
++  RE='^[[:space:]]*SGML_BASE_DIR[[:space:]]*=[[:space:]]*'
+   SGML_BASE_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"`
+-  RE='^[:space:]*SGML_CATALOGS_DIR[:space:]*=[:space:]*'
++  RE='^[[:space:]]*SGML_CATALOGS_DIR[[:space:]]*=[[:space:]]*'
+   SGML_CATALOGS_DIR=`grep $RE $SGML_CONF | sed "s/$RE//"`
+ fi
+ 
diff --git a/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb b/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
new file mode 100644
index 0000000..c3a5f3b
--- /dev/null
+++ b/meta/recipes-devtools/docbook-utils/docbook-utils-native_0.6.14.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Utilities for formatting and manipulating DocBook documents"
+DESCRIPTION = "A collection of all the free software tools you need to \
+work on and format DocBook documents."
+HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+DEPENDS = "openjade-native sgmlspl-native docbook-dsssl-stylesheets-native docbook-sgml-dtd-3.1-native"
+
+PR = "r3"
+
+SRC_URI = "\
+	ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/docbook-utils-${PV}.tar.gz \
+	file://re.patch \
+"
+
+SRC_URI[md5sum] = "6b41b18c365c01f225bc417cf632d81c"
+SRC_URI[sha256sum] = "48faab8ee8a7605c9342fb7b906e0815e3cee84a489182af38e8f7c0df2e92e9"
+
+inherit autotools native
+
+do_configure_prepend() {
+	# Fix hard-coded references to /etc/sgml
+	if [ ! -e ${S}/.sed_done ]; then
+		sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" ${S}/bin/jw.in
+		sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" ${S}/doc/man/Makefile.am
+		sed -i -e "s|/etc/sgml|${sysconfdir}/sgml|g" ${S}/doc/HTML/Makefile.am
+
+		# Point jw to the native sysroot catalog
+		sed -i -e 's|^SGML_EXTRA_CATALOGS=""|SGML_EXTRA_CATALOGS=":${sysconfdir}/sgml/catalog"|g' ${S}/bin/jw.in
+		touch ${S}/.sed_done
+	fi
+}
+do_unpack[cleandirs] += "${S}"
+
+do_install() {
+	install -d ${D}${bindir}
+	# Install the binaries and a bunch of other commonly used names for them.
+	for doctype in html ps dvi man pdf rtf tex texi txt
+	do
+		install -m 0755 ${S}/bin/docbook2$doctype ${D}${bindir}/
+		ln -sf docbook2x-$doctype ${D}${bindir}/db2$doctype
+		ln -sf docbook2$doctype ${D}${bindir}/db2$doctype
+		ln -sf docbook2$doctype ${D}${bindir}/docbook-to-$doctype
+	done
+
+	install -m 0755 ${B}/bin/jw ${D}${bindir}/
+	for i in backends/dvi backends/html \
+		backends/pdf backends/ps backends/rtf backends/tex \
+		backends/txt \
+		helpers/docbook2man-spec.pl helpers/docbook2texi-spec.pl \
+		docbook-utils.dsl
+	do
+		install -d ${D}${datadir}/sgml/docbook/utils-${PV}/`dirname $i`
+		install ${S}/$i ${D}${datadir}/sgml/docbook/utils-${PV}/$i
+	done
+	for i in backends/man backends/texi frontends/docbook
+	do
+		install -d ${D}${datadir}/sgml/docbook/utils-${PV}/`dirname $i`
+		install ${B}/$i ${D}${datadir}/sgml/docbook/utils-${PV}/$i
+	done
+
+}
diff --git a/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS b/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS
new file mode 100644
index 0000000..6da7f5b
--- /dev/null
+++ b/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/LICENSE-OASIS
@@ -0,0 +1,16 @@
+Permission to use, copy, modify and distribute the DocBook XML DTD
+and its accompanying documentation for any purpose and without fee
+is hereby granted in perpetuity, provided that the above copyright
+notice and this paragraph appear in all copies.  The copyright
+holders make no representation about the suitability of the DTD for
+any purpose.  It is provided "as is" without expressed or implied
+warranty.
+
+If you modify the DocBook DTD in any way, except for declaring and
+referencing additional sets of general entities and declaring
+additional notations, label your DTD as a variant of DocBook.  See
+the maintenance documentation for more information.
+
+Please direct all questions, bug reports, or suggestions for 
+changes to the docbook@lists.oasis-open.org mailing list. For more
+information, see http://www.oasis-open.org/docbook/.
diff --git a/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch b/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch
new file mode 100644
index 0000000..5970360
--- /dev/null
+++ b/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml-update-catalog.xml.patch
@@ -0,0 +1,515 @@
+docbook-xml: update catalog.xml
+
+Refer Ubuntu 13.04 to update catalog.xml
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ docbook-4.0/catalog.xml   | 72 +++++++++++++++++++++++++++++++++++++++++++++++
+ docbook-4.1.2/catalog.xml | 66 +++++++++++++++++++++++++++++++++++++++++++
+ docbook-4.2/catalog.xml   | 69 ++++++---------------------------------------
+ docbook-4.3/catalog.xml   | 72 ++++++++---------------------------------------
+ docbook-4.4/catalog.xml   | 63 ++---------------------------------------
+ docbook-4.5/catalog.xml   | 63 ++---------------------------------------
+ 6 files changed, 165 insertions(+), 240 deletions(-)
+ create mode 100644 docbook-4.0/catalog.xml
+ create mode 100644 docbook-4.1.2/catalog.xml
+
+diff --git a/docbook-4.0/catalog.xml b/docbook-4.0/catalog.xml
+new file mode 100644
+--- /dev/null
++++ b/docbook-4.0/catalog.xml
+@@ -0,0 +1,72 @@
++<?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" 
++    "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
++<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
++
++<!-- ...................................................................... -->
++<!-- XML Catalog data for DocBook XML V4.0............................... -->
++<!-- File catalog.xml ..................................................... -->
++
++<!-- Please direct all questions, bug reports, or suggestions for
++     changes to the docbook@lists.oasis-open.org mailing list. For more
++     information, see http://www.oasis-open.org/.
++  -->
++
++<!-- This is the catalog data file for DocBook V4.0. It is provided as
++     a convenience in building your own catalog files. You need not use
++     the filenames listed here, and need not use the filename method of
++     identifying storage objects at all.  See the documentation for
++     detailed information on the files associated with the DocBook DTD.
++     See XML Catalogs at http://www.oasis-open.org/committees/entity/ for
++     detailed information on supplying and using catalog data.
++  -->
++
++<!-- ...................................................................... -->
++<!-- DocBook driver file .................................................. -->
++
++<public publicId="-//Norman Walsh//DTD DocBk XML V4.0//EN"
++        uri="docbookx.dtd"/>
++
++<!-- Other ways to refer to DocBook XML v4.0............................... -->
++<public publicId="-//Norman Walsh//DTD DocBook XML V4.0//EN"
++        uri="docbookx.dtd"/>
++
++<system systemId="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd"
++        uri="docbookx.dtd"/>
++
++<!-- ...................................................................... -->
++<!-- DocBook modules ...................................................... -->
++
++<public publicId="-//Norman Walsh//ENTITIES DocBook XML Notations V4.0//EN"
++        uri="dbnotnx.mod"/>
++
++<public publicId="-//Norman Walsh//ENTITIES DocBook XML Character Entities V4.0//EN"
++        uri="dbcentx.mod"/>
++
++<public publicId="-//Norman Walsh//ELEMENTS DocBook XML Information Pool V4.0//EN"
++        uri="dbpoolx.mod"/>
++
++<public publicId="-//Norman Walsh//ELEMENTS DocBook XML Document Hierarchy V4.0//EN"
++        uri="dbhierx.mod"/>
++
++<public publicId="-//Norman Walsh//ENTITIES DocBook XML Additional General Entities V4.0//EN"
++        uri="dbgenent.mod"/>
++
++<public publicId="-//Norman Walsh//DTD CALS Table Model XML V4.0//EN"
++        uri="calstblx.dtd"/>
++
++<!-- UNOFFICIAL conversion of the exchange table model to XML, based on the OASIS Exchange -->
++<!--    Table Model PUBLIC "-//SGML Open//DTD Exchange Table Model 19960430//EN"           -->
++<public publicId="-//Normal Walsh//Exchange Table Model 19960430 XML V4.0//EN"
++        uri="soextblx.dtd"/>
++
++<!-- the following FPI is declared for the DTD inside the DTD, but we'll -->
++<!-- use the version from the latest DocBook
++<public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
++        uri="soextblx.dtd"/> -->
++
++<!-- End of catalog data for DocBook XML V4.0 ............................. -->
++<!-- ...................................................................... -->
++
++</catalog>
+diff --git a/docbook-4.1.2/catalog.xml b/docbook-4.1.2/catalog.xml
+new file mode 100644
+--- /dev/null
++++ b/docbook-4.1.2/catalog.xml
+@@ -0,0 +1,66 @@
++<?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" 
++    "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
++<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
++
++<!-- ...................................................................... -->
++<!-- XML Catalog data for DocBook XML V4.1.2............................... -->
++<!-- File catalog.xml ..................................................... -->
++
++<!-- Please direct all questions, bug reports, or suggestions for
++     changes to the docbook@lists.oasis-open.org mailing list. For more
++     information, see http://www.oasis-open.org/.
++  -->
++
++<!-- This is the catalog data file for DocBook V4.1.2. It is provided as
++     a convenience in building your own catalog files. You need not use
++     the filenames listed here, and need not use the filename method of
++     identifying storage objects at all.  See the documentation for
++     detailed information on the files associated with the DocBook DTD.
++     See XML Catalogs at http://www.oasis-open.org/committees/entity/ for
++     detailed information on supplying and using catalog data.
++  -->
++
++<!-- ...................................................................... -->
++<!-- DocBook driver file .................................................. -->
++
++<public publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
++        uri="docbookx.dtd"/>
++
++<system systemId="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"
++        uri="docbookx.dtd"/>
++
++<system systemId="http://docbook.org/xml/4.1.2/docbookx.dtd"
++        uri="docbookx.dtd"/>
++
++<!-- ...................................................................... -->
++<!-- DocBook modules ...................................................... -->
++
++<public publicId="-//OASIS//DTD DocBook CALS Table Model V4.1.2//EN"
++        uri="calstblx.dtd"/>
++
++  <!-- already included in docbook 4.2
++<public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
++        uri="soextblx.dtd"/> -->
++
++<public publicId="-//OASIS//ELEMENTS DocBook XML Information Pool V4.1.2//EN"
++        uri="dbpoolx.mod"/>
++
++<public publicId="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.1.2//EN"
++        uri="dbhierx.mod"/>
++
++<public publicId="-//OASIS//ENTITIES DocBook Additional General Entities V4.1.2//EN"
++        uri="dbgenent.mod"/>
++
++<public publicId="-//OASIS//ENTITIES DocBook Notations V4.1.2//EN"
++        uri="dbnotnx.mod"/>
++
++<public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.1.2//EN"
++        uri="dbcentx.mod"/>
++
++
++<!-- End of catalog data for DocBook XML V4.1.2 ............................. -->
++<!-- ...................................................................... -->
++
++</catalog>
+diff --git a/docbook-4.2/catalog.xml b/docbook-4.2/catalog.xml
+--- a/docbook-4.2/catalog.xml
++++ b/docbook-4.2/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++    "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+ 
+ <!-- ...................................................................... -->
+@@ -25,6 +28,12 @@
+ <public publicId="-//OASIS//DTD DocBook XML V4.2//EN"
+         uri="docbookx.dtd"/>
+ 
++<system systemId="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
++        uri="docbookx.dtd"/>
++
++<system systemId="http://docbook.org/xml/4.2/docbookx.dtd"
++        uri="docbookx.dtd"/>
++
+ <!-- ...................................................................... -->
+ <!-- DocBook modules ...................................................... -->
+ 
+@@ -49,66 +58,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.2//EN"
+         uri="dbcentx.mod"/>
+ 
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+-        uri="ent/iso-dia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+-        uri="ent/iso-num.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+-        uri="ent/iso-pub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+-        uri="ent/iso-tech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+-        uri="ent/iso-lat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+-        uri="ent/iso-lat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+-        uri="ent/iso-grk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+-        uri="ent/iso-grk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+-        uri="ent/iso-grk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+-        uri="ent/iso-grk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+-        uri="ent/iso-amsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+-        uri="ent/iso-amsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+-        uri="ent/iso-amsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+-        uri="ent/iso-amsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+-        uri="ent/iso-amso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+-        uri="ent/iso-amsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+-        uri="ent/iso-box.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+-        uri="ent/iso-cyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+-        uri="ent/iso-cyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.2 ............................. -->
+ <!-- ...................................................................... -->
+ 
+diff --git a/docbook-4.3/catalog.xml b/docbook-4.3/catalog.xml
+--- a/docbook-4.3/catalog.xml
++++ b/docbook-4.3/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++    "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+ 
+ <!-- ...................................................................... -->
+@@ -25,12 +28,21 @@
+ <public publicId="-//OASIS//DTD DocBook XML V4.3//EN"
+         uri="docbookx.dtd"/>
+ 
++<system systemId="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
++        uri="docbookx.dtd"/>
++
++<system systemId="http://docbook.org/xml/4.3/docbookx.dtd"
++        uri="docbookx.dtd"/>
++
+ <!-- ...................................................................... -->
+ <!-- DocBook modules ...................................................... -->
+ 
+ <public publicId="-//OASIS//DTD DocBook CALS Table Model V4.3//EN"
+         uri="calstblx.dtd"/>
+ 
++<public publicId="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.3//EN"
++        uri="htmltblx.mod"/>
++
+ <public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN"
+         uri="soextblx.dtd"/>
+ 
+@@ -49,66 +61,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.3//EN"
+         uri="dbcentx.mod"/>
+ 
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+-        uri="ent/iso-dia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+-        uri="ent/iso-num.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+-        uri="ent/iso-pub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+-        uri="ent/iso-tech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+-        uri="ent/iso-lat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+-        uri="ent/iso-lat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+-        uri="ent/iso-grk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+-        uri="ent/iso-grk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+-        uri="ent/iso-grk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+-        uri="ent/iso-grk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+-        uri="ent/iso-amsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+-        uri="ent/iso-amsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+-        uri="ent/iso-amsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+-        uri="ent/iso-amsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+-        uri="ent/iso-amso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+-        uri="ent/iso-amsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+-        uri="ent/iso-box.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+-        uri="ent/iso-cyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+-        uri="ent/iso-cyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.3 ............................. -->
+ <!-- ...................................................................... -->
+ 
+diff --git a/docbook-4.4/catalog.xml b/docbook-4.4/catalog.xml
+--- a/docbook-4.4/catalog.xml
++++ b/docbook-4.4/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++    "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
+ 
+ <!-- ...................................................................... -->
+@@ -58,66 +61,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.4//EN"
+         uri="dbcentx.mod"/>
+ 
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+-        uri="ent/isodia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+-        uri="ent/isonum.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+-        uri="ent/isopub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+-        uri="ent/isotech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+-        uri="ent/isolat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+-        uri="ent/isolat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+-        uri="ent/isogrk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+-        uri="ent/isogrk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+-        uri="ent/isogrk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+-        uri="ent/isogrk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+-        uri="ent/isoamsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+-        uri="ent/isoamsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+-        uri="ent/isoamsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+-        uri="ent/isoamsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+-        uri="ent/isoamso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+-        uri="ent/isoamsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+-        uri="ent/isobox.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+-        uri="ent/isocyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+-        uri="ent/isocyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.4 ............................. -->
+ <!-- ...................................................................... -->
+ 
+diff --git a/docbook-4.5/catalog.xml b/docbook-4.5/catalog.xml
+--- a/docbook-4.5/catalog.xml
++++ b/docbook-4.5/catalog.xml
+@@ -1,4 +1,7 @@
+ <?xml version='1.0'?>
++<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
++    "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
++
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
+ 
+ <!-- ...................................................................... -->
+@@ -58,66 +61,6 @@
+ <public publicId="-//OASIS//ENTITIES DocBook Character Entities V4.5//EN"
+         uri="dbcentx.mod"/>
+ 
+-<!-- ...................................................................... -->
+-<!-- ISO entity sets ...................................................... -->
+-
+-<public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN//XML"
+-        uri="ent/isodia.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN//XML"
+-        uri="ent/isonum.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Publishing//EN//XML"
+-        uri="ent/isopub.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES General Technical//EN//XML"
+-        uri="ent/isotech.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN//XML"
+-        uri="ent/isolat1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN//XML"
+-        uri="ent/isolat2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN//XML"
+-        uri="ent/isogrk1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN//XML"
+-        uri="ent/isogrk2.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN//XML"
+-        uri="ent/isogrk3.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN//XML"
+-        uri="ent/isogrk4.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN//XML"
+-        uri="ent/isoamsa.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN//XML"
+-        uri="ent/isoamsb.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN//XML"
+-        uri="ent/isoamsc.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN//XML"
+-        uri="ent/isoamsn.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN//XML"
+-        uri="ent/isoamso.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN//XML"
+-        uri="ent/isoamsr.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN//XML"
+-        uri="ent/isobox.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN//XML"
+-        uri="ent/isocyr1.ent"/>
+-
+-<public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN//XML"
+-        uri="ent/isocyr2.ent"/>
+-
+ <!-- End of catalog data for DocBook XML V4.5 ............................. -->
+ <!-- ...................................................................... -->
+ 
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml b/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml
new file mode 100644
index 0000000..b71f559
--- /dev/null
+++ b/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4/docbook-xml.xml
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//Norman Walsh//ELEMENTS DocBook XML Information Pool V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.1//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBook XML Notations V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//Norman Walsh//DTD CALS Table Model XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBook XML Character Entities V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//Norman Walsh//ELEMENTS DocBook XML Document Hierarchy V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//Normal Walsh//Exchange Table Model 19960430 XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://docbook.org/xml/4.4/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://docbook.org/xml/4.1/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBk XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML Information Pool V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBook XML V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://docbook.org/xml/4.1.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook XML HTML Tables V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://docbook.org/xml/4.5/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Notations V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBook XML Additional General Entities V4.0//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.0/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://docbook.org/xml/4.2/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD XML Exchange Table Model 19990315//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.4//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.4/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Additional General Entities V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML V4.3//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://docbook.org/xml/4.3/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/4.3/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Information Pool V4.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model V4.5//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.5/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook Document Hierarchy V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+  <delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook Character Entities V4.1.2//EN" catalog="file:///usr/share/xml/docbook/schema/dtd/4.1.2/catalog.xml"/>
+  <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd" catalog="file:///usr/share/xml/docbook/schema/dtd/catalog.xml"/>
+</catalog>
diff --git a/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb b/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb
new file mode 100644
index 0000000..de1bc39
--- /dev/null
+++ b/meta/recipes-devtools/docbook-xml/docbook-xml-dtd4_4.5.bb
@@ -0,0 +1,64 @@
+SUMMARY = "Document type definitions for verification of XML data files"
+DESCRIPTION = "Document type definitions for verification of XML data \
+files against the DocBook rule set, it ships with the latest DocBook 4.5 \
+XML DTD, as well as a selected set of legacy DTDs for use with older \
+documents, including 4.0, 4.1.2, 4.2, 4.3 and 4.4"
+HOMEPAGE = "http://www.docbook.org/xml/"
+
+LICENSE = "OASIS"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE-OASIS;md5=c608985dd5f7f215e669e7639a0b1d2e"
+
+# Note: the upstream sources are not distributed with a license file.
+# LICENSE-OASIS is included as a "patch" to workaround this. When
+# upgrading this recipe, please verify whether this is still needed.
+SRC_URI = "${DEBIAN_MIRROR}/main/d/docbook-xml/docbook-xml_${PV}.orig.tar.gz \
+           file://LICENSE-OASIS \
+           file://docbook-xml-update-catalog.xml.patch \
+           file://docbook-xml.xml \
+"
+
+SRC_URI[md5sum] = "487b4d44e15cffb1f4048af23f98208e"
+SRC_URI[sha256sum] = "b0f8edcf697f5318e63dd98c9a931f3fee167af0805ba441db372e0f17b2a44f"
+
+S="${WORKDIR}/docbook-xml-4.5.c31424"
+
+inherit allarch
+BBCLASSEXTEND = "native"
+
+SSTATEPOSTINSTFUNCS_append_class-native = " docbook_xml_dtd_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " docbook_xml_dtd_sysroot_preprocess"
+
+do_configre (){
+    :
+}
+
+do_compile (){
+    :
+}
+
+do_install () {
+    # Refer debian https://packages.debian.org/sid/all/docbook-xml/filelist
+    for DTDVERSION in 4.0 4.1.2 4.2 4.3 4.4 4.5; do
+        install -d -m 755 ${D}${datadir}/xml/docbook/schema/dtd/${DTDVERSION}
+        cp -v -R docbook-${DTDVERSION}/* ${D}${datadir}/xml/docbook/schema/dtd/${DTDVERSION}
+    done
+
+    install -d ${D}${sysconfdir}/xml/
+    install -m 755  ${WORKDIR}/docbook-xml.xml ${D}${sysconfdir}/xml/docbook-xml.xml
+}
+
+docbook_xml_dtd_sstate_postinst () {
+    if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+    then
+        # Ensure that the catalog file sgml-docbook.cat is properly
+        # updated when the package is installed from sstate cache.
+        sed -i -e "s|file://.*/usr/share/xml|file://${datadir}/xml|g" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xml.xml
+    fi
+}
+
+docbook_xml_dtd_sysroot_preprocess () {
+    # Update the hardcode dir in docbook-xml.xml
+    sed -i -e "s|file:///usr/share/xml|file://${datadir}/xml|g" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xml.xml
+}
+
+FILES_${PN} = "${datadir}/* ${sysconfdir}/xml/docbook-xml.xml"
diff --git a/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch b/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch
new file mode 100644
index 0000000..0559a5c
--- /dev/null
+++ b/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch
@@ -0,0 +1,24 @@
+docbook-xsl-stylesheets: no bashism in docbook-xsl-update
+
+The checkbashisms shows there is no bashism, so use /bin/sh.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ tools/bin/docbook-xsl-update | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/bin/docbook-xsl-update b/tools/bin/docbook-xsl-update
+index aba0016..cc73aa2 100755
+--- a/tools/bin/docbook-xsl-update
++++ b/tools/bin/docbook-xsl-update
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ # vim: number
+ 
+ # docbook-xsl-update - Update environment to latest docbook-xsl snapshot
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml b/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml
new file mode 100644
index 0000000..a1a576a
--- /dev/null
+++ b/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets/docbook-xsl.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+<delegateURI uriStartString="http://docbook.sourceforge.net/release/xsl/" catalog="file:///usr/share/xml/docbook/xsl-stylesheets-1.78.1/catalog.xml"/>
+<delegateSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/" catalog="file:///usr/share/xml/docbook/xsl-stylesheets-1.78.1/catalog.xml"/>
+</catalog>
diff --git a/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb b/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb
new file mode 100644
index 0000000..2a1bdc4
--- /dev/null
+++ b/meta/recipes-devtools/docbook-xml/docbook-xsl-stylesheets_1.78.1.bb
@@ -0,0 +1,69 @@
+SUMMARY = "XSL stylesheets for processing DocBook XML to various output formats"
+HOMEPAGE = "http://docbook.sourceforge.net"
+LICENSE = "XSL"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6eeeed43d498c22a835382533356462"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docbook/docbook-xsl-${PV}.tar.bz2 \
+           file://docbook-xsl.xml \
+           file://docbook-xsl-stylesheets-no-bashism-in-docbook-xsl-up.patch \
+"
+
+SRC_URI[md5sum] = "6dd0f89131cc35bf4f2ed105a1c17771"
+SRC_URI[sha256sum] = "c98f7296ab5c8ccd2e0bc07634976a37f50847df2d8a59bdb1e157664700b467"
+
+S = "${WORKDIR}/docbook-xsl-${PV}"
+
+inherit allarch
+BBCLASSEXTEND = "native"
+
+SSTATEPOSTINSTFUNCS_append_class-native = " docbook_xsl_stylesheets_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS_append_class-native = " docbook_xsl_stylesheets_sysroot_preprocess"
+
+do_configure (){
+	:
+}
+
+do_compile (){
+	:
+}
+
+do_install () {
+	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/docbook-xsl.html
+	# for details.
+	install -v -m755 -d ${D}${datadir}/xml/docbook/xsl-stylesheets-1.78.1
+
+	cp -v -R VERSION common eclipse epub extensions fo highlighting html \
+		htmlhelp images javahelp lib manpages params profiling \
+		roundtrip slides template tests tools webhelp website \
+		xhtml xhtml-1_1 catalog.xml \
+	${D}${datadir}/xml/docbook/xsl-stylesheets-1.78.1
+
+	ln -s VERSION ${D}/${datadir}/xml/docbook/xsl-stylesheets-1.78.1/VERSION.xsl
+
+	install -v -m644 -D README \
+		${D}${datadir}/doc/docbook-xsl-1.78.1/README.txt
+	install -v -m644    RELEASE-NOTES* NEWS* \
+		${D}${datadir}/doc/docbook-xsl-1.78.1
+
+	install -d ${D}${sysconfdir}/xml/
+	install -m 755  ${WORKDIR}/docbook-xsl.xml ${D}${sysconfdir}/xml/docbook-xsl.xml
+
+}
+
+docbook_xsl_stylesheets_sstate_postinst () {
+    if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+    then
+        # Ensure that the catalog file sgml-docbook.cat is properly
+        # updated when the package is installed from sstate cache.
+        sed -i -e "s|file://.*/usr/share/xml|file://${datadir}/xml|g" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xsl.xml
+    fi
+}
+
+docbook_xsl_stylesheets_sysroot_preprocess () {
+    # Update the hardcode dir in docbook-xml.xml
+    sed -i -e "s|file:///usr/share/xml|file://${datadir}/xml|g" ${SYSROOT_DESTDIR}${sysconfdir}/xml/docbook-xsl.xml
+}
+
+RDEPENDS_${PN} += "perl"
+FILES_${PN} = "${datadir}/xml/* ${sysconfdir}/xml/docbook-xsl.xml"
+FILES_${PN}-doc = "${datadir}/doc/*"
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch b/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch
new file mode 100644
index 0000000..06f5b7a
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/0001-Include-fcntl.h-for-getting-loff_t-definition.patch
@@ -0,0 +1,41 @@
+From b7c42c6a9829bea911b22201edd7df2a9bec1a14 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:52:34 -0700
+Subject: [PATCH] Include fcntl.h for getting loff_t definition
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ dosfsck/dosfsck.h | 2 ++
+ dosfsck/lfn.c     | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/dosfsck/dosfsck.h b/dosfsck/dosfsck.h
+index d9314b1..2076d5f 100644
+--- a/dosfsck/dosfsck.h
++++ b/dosfsck/dosfsck.h
+@@ -50,6 +50,8 @@
+ #define CT_LE_L(v) (v)
+ #endif /* __BIG_ENDIAN */
+ 
++#include <fcntl.h>
++
+ #define VFAT_LN_ATTR (ATTR_RO | ATTR_HIDDEN | ATTR_SYS | ATTR_VOLUME)
+ 
+ /* ++roman: Use own definition of boot sector structure -- the kernel headers'
+diff --git a/dosfsck/lfn.c b/dosfsck/lfn.c
+index 9b2cfc3..bb04fda 100644
+--- a/dosfsck/lfn.c
++++ b/dosfsck/lfn.c
+@@ -7,6 +7,7 @@
+ #include <string.h>
+ #include <limits.h>
+ #include <time.h>
++#include <fcntl.h>
+ 
+ #include "common.h"
+ #include "io.h"
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch b/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch
new file mode 100644
index 0000000..b46b2db
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/alignment_hack.patch
@@ -0,0 +1,38 @@
+The problem is that unsigned char[2] is
+guranteed to be 8Bit aligned on arm
+but unsigned short is/needs to be 16bit aligned
+the union { unsigned short; unsigned char[2] } trick 
+didn't work so no we use the alpha hack.
+
+memcpy into an 16bit aligned
+
+    -zecke
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- dosfstools/dosfsck/boot.c.orig	2003-05-15 19:32:23.000000000 +0200
++++ dosfstools/dosfsck/boot.c	2003-06-13 17:44:25.000000000 +0200
+@@ -36,17 +36,15 @@
+     { 0xff, "5.25\" 320k floppy 2s/40tr/8sec" },
+ };
+ 
+-#if defined __alpha || defined __ia64__ || defined __s390x__ || defined __x86_64__ || defined __ppc64__
++
+ /* Unaligned fields must first be copied byte-wise */
+ #define GET_UNALIGNED_W(f)			\
+     ({						\
+ 	unsigned short __v;			\
+ 	memcpy( &__v, &f, sizeof(__v) );	\
+-	CF_LE_W( *(unsigned short *)&f );	\
++	CF_LE_W( *(unsigned short *)&__v );	\
+     })
+-#else
+-#define GET_UNALIGNED_W(f) CF_LE_W( *(unsigned short *)&f )
+-#endif
++
+ 
+ 
+ static char *get_media_descr( unsigned char media )
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch b/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch
new file mode 100644
index 0000000..35abd1a
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/dosfstools-msdos_fs-types.patch
@@ -0,0 +1,37 @@
+Ensure the __s8 type is properly defined.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- dosfstools-2.10/dosfsck/dosfsck.h.org	2006-02-21 08:36:14.000000000 -0700
++++ dosfstools-2.10/dosfsck/dosfsck.h	2006-02-21 08:40:12.000000000 -0700
+@@ -22,6 +22,14 @@
+        #undef __KERNEL__
+ #endif
+ 
++#ifndef __s8
++#include <asm/types.h>
++#endif
++
++#ifndef __ASM_STUB_BYTEORDER_H__
++#include <asm/byteorder.h>
++#endif
++
+ #include <linux/msdos_fs.h>
+ 
+ /* 2.1 kernels use le16_to_cpu() type functions for CF_LE_W & Co., but don't
+--- dosfstools-2.10/dosfsck/file.c.org	2006-02-21 08:37:36.000000000 -0700
++++ dosfstools-2.10/dosfsck/file.c	2006-02-21 08:37:47.000000000 -0700
+@@ -23,6 +23,10 @@
+        #undef __KERNEL__
+ #endif
+ 
++#ifndef __s8
++#include <asm/types.h>
++#endif
++
+ #include <linux/msdos_fs.h>
+ 
+ #include "common.h"
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch b/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch
new file mode 100644
index 0000000..9d7f732
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/fix_populated_dosfs_creation.patch
@@ -0,0 +1,489 @@
+Upstream-Status: Inappropriate
+
+This patch fixes populated dosfs image creation with directory 
+structures. Earlier it was causing segfault; and only image 
+population with no subdirectories was working.
+
+Issues fixed:
+1. (dir->count == dir->entries) check was only needed for root 
+   directory entries. And this check is wrong for non-root 
+   directories.
+2. For each dir entry 2 dir->table entries were needed, one for 
+   the file/dir and 2nd for long file name support. Earlier long
+   name support was added for filenames but the 2nd entry 
+   allocation, initialization & counting was missed.
+3. The memory clearing was missed at the code path after dir->table 
+   memroy allocation.
+4. Add entries for . & .. directories in all non-root directories.
+5. The . directory points to the correct entry in fat now.
+6. All directoriy entries' size was not zero as required for dosfsck,
+   Now all directory entries' size is zero.
+
+Enhancements:
+1. Added support for long names for directory names. This is same
+   as the existing long name support for filenames.
+2. Added error messages for previously silent memory allocation and 
+   other errors.
+3. -d options does not work correctly with fat32, so now throwing 
+   an error for that.
+4. Use predefined structures from kernel's msdos_fs.h file, rather 
+   than defining again here. And accordingly change the names & use
+   of structure variables.
+
+Outstanding Issues:
+1. The .. directory entry do not point to the parent of current
+   directory. This issue can be fixed by running dosfsck -a after
+   image creation.
+2. For files the filesize is correct, but the clusters size is more 
+   than it needs to be, this also can be fixed by running dosfsck -a
+   after image creation.
+
+Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> 
+2011/12/13
+
+
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c
++++ dosfstools-2.11/mkdosfs/mkdosfs.c
+@@ -21,7 +21,17 @@
+    June 2004 - Jordan Crouse (info.linux@amd.com)
+    Added -d <directory> support to populate the image
+    Copyright (C) 2004, Advanced Micro Devices, All Rights Reserved
+-   
++
++   2011-12-13: Nitin A Kamble <nitin.a.kamble@intel.com>
++   Enhanced the -d <directory> support for population of image while
++   creation. Earlier subdirectores support was broken, only files in
++   the rootdir were supported. Now directory hirarchy is supported.
++   Also added long filename support to directory names.
++     The -d <directory> option (image population while creation)
++   is broken with fat32.
++   Copyright (C) 2011, Intel Corporation, All Rights Reserved
++
++
+    Fixes/additions May 1998 by Roman Hodek
+    <Roman.Hodek@informatik.uni-erlangen.de>:
+    - Atari format support
+@@ -86,23 +96,23 @@
+ # undef __KERNEL__
+ #endif
+ 
+-#if __BYTE_ORDER == __BIG_ENDIAN
+-
++#ifndef __ASM_STUB_BYTEORDER_H__
+ #include <asm/byteorder.h>
+-#ifdef __le16_to_cpu
+-/* ++roman: 2.1 kernel headers define these function, they're probably more
+- * efficient then coding the swaps machine-independently. */
+-#define CF_LE_W	__le16_to_cpu
+-#define CF_LE_L	__le32_to_cpu
+-#define CT_LE_W	__cpu_to_le16
+-#define CT_LE_L	__cpu_to_le32
+-#else
+-#define CF_LE_W(v) ((((v) & 0xff) << 8) | (((v) >> 8) & 0xff))
+-#define CF_LE_L(v) (((unsigned)(v)>>24) | (((unsigned)(v)>>8)&0xff00) | \
+-               (((unsigned)(v)<<8)&0xff0000) | ((unsigned)(v)<<24))
++#endif
++
++#include <linux/msdos_fs.h>
++
++#undef CF_LE_W
++#undef CF_LE_L
++#undef CT_LE_W
++#undef CT_LE_L
++
++#if __BYTE_ORDER == __BIG_ENDIAN
++#include <byteswap.h>
++#define CF_LE_W(v) bswap_16(v)
++#define CF_LE_L(v) bswap_32(v)
+ #define CT_LE_W(v) CF_LE_W(v)
+ #define CT_LE_L(v) CF_LE_L(v)
+-#endif /* defined(__le16_to_cpu) */
+     
+ #else
+ 
+@@ -253,33 +263,6 @@ struct fat32_fsinfo {
+   __u32		reserved2[4];
+ };
+ 
+-/* This stores up to 13 chars of the name */
+-
+-struct msdos_dir_slot {
+-        __u8    id;             /* sequence number for slot */
+-        __u8    name0_4[10];    /* first 5 characters in name */
+-        __u8    attr;           /* attribute byte */
+-        __u8    reserved;       /* always 0 */
+-        __u8    alias_checksum; /* checksum for 8.3 alias */
+-        __u8    name5_10[12];   /* 6 more characters in name */
+-        __u16   start;          /* starting cluster number, 0 in long slots */
+-        __u8    name11_12[4];   /* last 2 characters in name */
+-};
+-
+-struct msdos_dir_entry
+-  {
+-    char	name[8], ext[3];	/* name and extension */
+-    __u8        attr;			/* attribute bits */
+-    __u8	lcase;			/* Case for base and extension */
+-    __u8	ctime_ms;		/* Creation time, milliseconds */
+-    __u16	ctime;			/* Creation time */
+-    __u16	cdate;			/* Creation date */
+-    __u16	adate;			/* Last access date */
+-    __u16	starthi;		/* high 16 bits of first cl. (FAT32) */
+-    __u16	time, date, start;	/* time, date and first cluster */
+-    __u32	size;			/* file size (in bytes) */
+-  } __attribute__ ((packed));
+-
+ /* The "boot code" we put into the filesystem... it writes a message and
+    tells the user to try again */
+ 
+@@ -356,7 +339,6 @@ static struct msdos_dir_entry *root_dir;
+ static int size_root_dir;	/* Size of the root directory in bytes */
+ static int sectors_per_cluster = 0;	/* Number of sectors per disk cluster */
+ static int root_dir_entries = 0;	/* Number of root directory entries */
+-static int root_dir_num_entries = 0;
+ static int last_cluster_written = 0;
+ 
+ static char *blank_sector;		/* Blank sector - all zeros */
+@@ -1315,7 +1297,7 @@ setup_tables (void)
+       de->date = CT_LE_W((unsigned short)(ctime->tm_mday +
+ 					  ((ctime->tm_mon+1) << 5) +
+ 					  ((ctime->tm_year-80) << 9)));
+-      de->ctime_ms = 0;
++      de->ctime_cs = 0;
+       de->ctime = de->time;
+       de->cdate = de->date;
+       de->adate = de->date;
+@@ -1451,16 +1433,23 @@ write_tables (void)
+ 
+ /* Add a file to the specified directory entry, and also write it into the image */
+ 
+-static void copy_filename(char *filename, char *base, char *ext) {
++static void copy_filename(char *filename, char *dos_name) {
+   
+   char *ch = filename;
+   int i, len;
+ 
+-  memset(base, 0x20, 8);
+-  memset(ext, 0x20, 3);
++  if (!strcmp(filename, ".")) {
++    strncpy(dos_name, MSDOS_DOT, MSDOS_NAME);
++    return;
++  }
++  if (!strcmp(filename, "..")) {
++    strncpy(dos_name, MSDOS_DOTDOT, MSDOS_NAME);
++    return;
++  }
++  memset(dos_name, 0x20, MSDOS_NAME);
+   
+   for(len = 0 ; *ch && *ch != '.'; ch++) {
+-    base[len++] = toupper(*ch);
++    dos_name[len++] = toupper(*ch);
+     if (len == 8) break;
+   }
+   
+@@ -1468,7 +1457,7 @@ static void copy_filename(char *filename
+   if (*ch) ch++;
+   
+   for(len = 0 ; *ch; ch++) {
+-    ext[len++] = toupper(*ch);
++    dos_name[8 + len++] = toupper(*ch);
+     if (len == 3) break;
+   }
+ }
+@@ -1551,7 +1540,7 @@ static int add_file(char *filename, stru
+   int start;
+   int usedsec, totalsec;
+ 
+-  char name83[8], ext83[3];
++  char dos_name[MSDOS_NAME+1];
+ 
+   struct msdos_dir_slot *slot;
+   int i;
+@@ -1562,23 +1551,22 @@ static int add_file(char *filename, stru
+   if (dir->root) {
+     if (dir->count == dir->entries) {
+       printf("Error - too many directory entries\n");
++      return;
+     }
+   }
+   else {
+-    if (dir->count == dir->entries) {
+-      if (!dir->table) 
+-	dir->table = 
+-	  (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
+-      else {
+-	dir->table = 
+-	  (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) * 
+-					     sizeof(struct msdos_dir_entry));
+-
+-	memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
+-      }
+-
+-      dir->entries++;
+-    }
++    /* 2 entries, one extra for long filename */
++    if (!dir->table)
++      dir->table =
++        (struct msdos_dir_entry *) malloc(2 * sizeof(struct msdos_dir_entry));
++    else
++      dir->table =
++        (struct msdos_dir_entry *) realloc(dir->table, 2 * (dir->entries + 1) *
++      				     sizeof(struct msdos_dir_entry));
++    if (!dir->table)
++      printf("Error - realloc failed\n");
++    memset(&dir->table[dir->entries], 0, 2 * sizeof(struct msdos_dir_entry));
++    dir->entries += 2;
+   }
+ 
+   infile = open(filename, O_RDONLY, 0);
+@@ -1611,13 +1599,13 @@ static int add_file(char *filename, stru
+     return -1;
+   }
+ 
+-  printf("ADD %s\n", filename);
++  printf("ADD FILE %s\n", filename);
+ 
+   /* Grab the basename of the file */
+   base = basename(filename);
+   
+-  /* Extract out the 8.3 name */
+-  copy_filename(base, name83, ext83);
++  /* convert for dos fat structure  */
++  copy_filename(base, dos_name);
+ 
+   /* Make an extended name slot */
+ 
+@@ -1629,12 +1617,9 @@ static int add_file(char *filename, stru
+   
+   slot->alias_checksum = 0;
+   
+-  for(i = 0; i < 8; i++) 
+-    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + name83[i];
++  for(i = 0; i < MSDOS_NAME; i++)
++    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + dos_name[i];
+   
+-  for(i = 0; i < 3; i++) 
+-    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + ext83[i];
+-
+   p = base;
+ 
+   copy_name(slot->name0_4, 10, &p);
+@@ -1645,8 +1630,7 @@ static int add_file(char *filename, stru
+   /* Get the entry from the root filesytem */
+   entry = &dir->table[dir->count++];
+ 
+-  strncpy(entry->name, name83, 8);
+-  strncpy(entry->ext, ext83, 3);
++  strncpy(entry->name, dos_name, MSDOS_NAME);
+ 
+ 
+   /* If the user has it read only, then add read only to the incoming
+@@ -1665,7 +1649,7 @@ static int add_file(char *filename, stru
+ 				      ((ctime->tm_mon+1) << 5) +
+ 				      ((ctime->tm_year-80) << 9)));
+ 
+-  entry->ctime_ms = 0;
++  entry->ctime_cs = 0;
+   entry->ctime = entry->time;
+   entry->cdate = entry->date;
+   entry->adate = entry->date;
+@@ -1711,6 +1695,7 @@ static int add_file(char *filename, stru
+ 
+  exit_add:
+   if (infile) close(infile);
++  return 0;
+ }
+ 
+ /* Add a new directory to the specified directory entry, and in turn populate 
+@@ -1727,10 +1712,18 @@ static void add_directory(char *filename
+   struct dirent *dentry = 0;
+   int remain;
+   char *data;
++  char *base;
++  char dos_name[MSDOS_NAME+1];
++  struct msdos_dir_slot *slot;
++  int i;
++  char *p;
+ 
+   /* If the directory doesn't exist */
+-  if (!rddir) return;
+-  
++  if (!rddir) {
++    printf("Error - dir does not exist: %s\n", filename);
++    return;
++  }
++
+   if (dir->root) {
+     if (dir->count == dir->entries) {
+       printf("Error - too many directory entries\n");
+@@ -1738,28 +1731,58 @@ static void add_directory(char *filename
+     }
+   }
+   else {
+-    if (dir->count == dir->entries) {
+-      if (!dir->table) 
+-	dir->table = (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
+-      else {
+-	dir->table = (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) * 
+-							sizeof(struct msdos_dir_entry));
+-
+-	/* Zero it out to avoid issues */
+-	memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
+-      }
+-	dir->entries++;
++    /* 2 entries, one extra for long name of the directory */
++    if (!dir->table)
++      dir->table = (struct msdos_dir_entry *) malloc(2 * sizeof(struct msdos_dir_entry));
++    else
++      dir->table = (struct msdos_dir_entry *) realloc(dir->table, 2 * (dir->entries + 1) *
++                                                             sizeof(struct msdos_dir_entry));
++    if (!dir->table) {
++      printf("Error - memory allocation failed\n");
++      goto exit_add_dir;
+     }
++    /* Zero it out to avoid issues */
++    memset(&dir->table[dir->entries], 0, 2 * sizeof(struct msdos_dir_entry));
++    dir->entries += 2;
+   }
+ 
++  printf("ADD DIR %s\n", filename);
+   /* Now, create a new directory entry for the new directory */
+   newdir = (struct dir_entry *) calloc(1, sizeof(struct dir_entry));
+-  if (!newdir) goto exit_add_dir;
++  if (!newdir) {
++    printf("Error - calloc failed\n");
++    goto exit_add_dir;
++  }
++
++  /* Grab the basename of the file */
++  base = basename(filename);
++
++  /* convert for dos structure  */
++  copy_filename(base, dos_name);
++
++  /* Make an extended name slot */
++  slot = (struct msdos_dir_slot *) &dir->table[dir->count++];
++  slot->id = 'A';
++  slot->attr = 0x0F;
++  slot->reserved = 0;
++  slot->start = 0;
++
++  slot->alias_checksum = 0;
+ 
++  for (i = 0; i < MSDOS_NAME; i++)
++    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + dos_name[i];
++
++  p = base;
++
++  copy_name(slot->name0_4, 10, &p);
++  copy_name(slot->name5_10, 12, &p);
++  copy_name(slot->name11_12, 4, &p);
++
++  /* Get the entry from the root filesytem */
+   entry = &dir->table[dir->count++];
+ 
+-  strncpy(entry->name, basename(filename), sizeof(entry->name));
+-  
++  strncpy(entry->name, dos_name, MSDOS_NAME);
++
+   entry->attr = ATTR_DIR;
+   ctime = localtime(&create_time);
+ 
+@@ -1770,25 +1793,32 @@ static void add_directory(char *filename
+ 				      ((ctime->tm_mon+1) << 5) +
+ 				      ((ctime->tm_year-80) << 9)));
+ 
+-  entry->ctime_ms = 0;
++  entry->ctime_cs = 0;
+   entry->ctime = entry->time;
+   entry->cdate = entry->date;
+   entry->adate = entry->date;
+ 
+   /* Now, read the directory */
+ 
+-  while((dentry = readdir(rddir))) {
++
++  while((base[0] != '.') && (dentry = readdir(rddir))) {
+     struct stat st;
+     char *buffer;
+-    
+-    if (!strcmp(dentry->d_name, ".") || !strcmp(dentry->d_name, ".."))
+-      continue;
+ 
+-    /* DOS wouldn't like a typical unix . (dot) file, so we skip those too */
+-    if (dentry->d_name[0] == '.') continue;
++    if (dentry->d_name[0] == '.') {
++        /* dos also has . & .. directory entries */
++      if (! ((!strcmp(dentry->d_name, ".")) || (!strcmp(dentry->d_name, "..")))) {
++        /* ignore other .* files */
++        printf("Error - File/Dir name is not dos compatible, ignored: %s\n", dentry->d_name);
++        continue;
++      }
++    }
+ 
+     buffer = malloc(strlen(filename) + strlen(dentry->d_name) + 3);
+-    if (!buffer) continue;
++    if (!buffer) {
++        printf("Error - malloc failed\n");
++        goto exit_add_dir;
++    }
+     
+     sprintf(buffer, "%s/%s", filename, dentry->d_name);
+     if (!stat(buffer, &st)) {
+@@ -1806,11 +1836,23 @@ static void add_directory(char *filename
+   /* Now that the entire directory has been written, go ahead and write the directory
+      entry as well */
+ 
++  entry->size = 0; /* a directory has zero size */
++
++  if (base[0] == '.')  { /* . & .. point to parent's cluster */
++    goto exit_add_dir;
++  }
++
+   entry->start = CT_LE_W(last_cluster_written);
+   entry->starthi = CT_LE_W((last_cluster_written & 0xFFFF0000) >> 16); 
+-  entry->size = newdir->count * sizeof(struct msdos_dir_entry);
++
++/* . dir start points to parent */
++  newdir->table[1].start = entry->start;
++/* .. dir points to parent of parent*/
++/* .. dir start is not set yet, would need more changes to the code,
++ * but dosfsck can fix these .. entry start pointers correctly */
++
++  remain = newdir->count * sizeof(struct msdos_dir_entry);
+   
+-  remain = entry->size;
+   data = (char *) newdir->table;
+ 
+   while(remain) {
+@@ -1858,6 +1900,7 @@ static void add_root_directory(char *dir
+ 
+   if (!newdir) {
+     closedir(dir);
++    printf("Error - calloc failed!\n");
+     return;
+   }
+ 
+@@ -1877,7 +1920,10 @@ static void add_root_directory(char *dir
+     if (entry->d_name[0] == '.') continue;
+  
+     buffer = malloc(strlen(dirname) + strlen(entry->d_name) + 3);
+-    if (!buffer) continue;
++    if (!buffer) {
++        printf("Error - malloc failed!\n");
++        continue;
++    }
+ 
+     sprintf(buffer, "%s/%s", dirname, entry->d_name);
+     if (!stat(buffer, &st)) {
+@@ -2245,6 +2291,9 @@ main (int argc, char **argv)
+   if (check && listfile)	/* Auto and specified bad block handling are mutually */
+     die ("-c and -l are incompatible");		/* exclusive of each other! */
+ 
++  if (dirname && (size_fat == 32))
++    die ("-d is incompatible with FAT32");
++
+   if (!create) {
+     check_mount (device_name);	/* Is the device already mounted? */
+     dev = open (device_name, O_RDWR);	/* Is it a suitable device to build the FS on? */
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch b/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch
new file mode 100644
index 0000000..ab5c8cf
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/include-linux-types.patch
@@ -0,0 +1,22 @@
+mkdsofs is using types of the style __u8, which it gets with some
+versions of libc headers via linux/hdreg.h including asm/types.h.
+Newer version of fedora (at least) have a hdreg.h whichdoes not
+include asm/types.h. To work around this patch mkdosfs.c to explicity
+include linux/types.h which will in turn pull in asm/types.h which
+defines these variables.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- dosfstools-2.10/mkdosfs/mkdosfs.c~	2006-07-12 18:46:21.000000000 +1000
++++ dosfstools-2.10/mkdosfs/mkdosfs.c	2006-07-12 18:46:21.000000000 +1000
+@@ -60,6 +60,7 @@
+ #include "../version.h"
+ 
+ #include <fcntl.h>
++#include <linux/types.h>
+ #include <linux/hdreg.h>
+ #include <linux/fs.h>
+ #include <linux/fd.h>
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
new file mode 100644
index 0000000..ae21bee
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-bootcode.patch
@@ -0,0 +1,241 @@
+Add option to read in bootcode from a file.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: dosfstools-2.11/mkdosfs/ChangeLog
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/ChangeLog	1997-06-18 10:09:38.000000000 +0000
++++ dosfstools-2.11/mkdosfs/ChangeLog	2011-12-06 12:14:23.634011558 +0000
+@@ -1,3 +1,14 @@
++19th June 2003			Sam Bingner (sam@bingner.com)
++
++	Added option to read in bootcode from a file so that if you have
++	for example Windows 2000 boot code, you can have it write that
++	as the bootcode.  This is a dump of the behinning of a partition
++	generally 512 bytes, but can be up to reserved sectors*512 bytes.
++        Also writes 0x80 as the	BIOS drive number if we are formatting a
++	hard drive, and sets the number of hidden sectors to be the
++	number of sectors in one track. These were required so that DOS
++	could boot using the bootcode.
++
+ 28th January 1995		H. Peter Anvin (hpa@yggdrasil.com)
+ 
+ 	Better algorithm to select cluster sizes on large filesystems.
+Index: dosfstools-2.11/mkdosfs/mkdosfs.8
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.8	2004-02-25 19:36:07.000000000 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.8	2011-12-06 12:19:54.777888434 +0000
+@@ -44,6 +44,10 @@
+ .I message-file
+ ]
+ [
++.B \-B
++.I bootcode-file
++]
++[
+ .B \-n
+ .I volume-name
+ ]
+@@ -165,6 +169,18 @@
+ carriage return-line feed combinations, and tabs have been expanded.
+ If the filename is a hyphen (-), the text is taken from standard input. 
+ .TP
++.BI \-B " bootcode-file"
++Uses boot machine code from file "file".  On any thing other than FAT32,
++this only writes the first 3 bytes, and 480 bytes from offset 3Eh.  On
++FAT32, this writes the first 3 bytes, 420 bytes from offset 5Ah to both
++primary and backup boot sectors.  Also writes all other reserved sectors
++excluding the sectors following boot sectors (usually sector 2 and 7).
++Does not require that the input file be as large as reserved_sectors*512.
++To make a FAT32 partition bootable, you will need at least the first
++13 sectors (6656 bytes).  You can also specify a partition as the argument
++to clone the boot code from that partition.
++i.e mkdosfs -B /dev/sda1 /dev/sda1
++.TP
+ .BI \-n " volume-name"
+ Sets the volume name (label) of the filesystem.  The volume name can
+ be up to 11 characters long.  The default is no label.
+@@ -198,8 +214,9 @@
+ simply will not support it ;)
+ .SH AUTHOR
+ Dave Hudson - <dave@humbug.demon.co.uk>; modified by Peter Anvin
+-<hpa@yggdrasil.com>. Fixes and additions by Roman Hodek
+-<roman@hodek.net> for Debian/GNU Linux.
++<hpa@yggdrasil.com> and Sam Bingner <sam@bingner.com>. Fixes and
++additions by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>
++for Debian/GNU Linux.
+ .SH ACKNOWLEDGEMENTS
+ .B mkdosfs
+ is based on code from
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c	2005-03-12 16:12:16.000000000 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.c	2011-12-06 12:27:55.121886076 +0000
+@@ -24,6 +24,12 @@
+    - New options -A, -S, -C
+    - Support for filesystems > 2GB
+    - FAT32 support
++
++   Fixes/additions June 2003 by Sam Bingner
++   <sam@bingner.com>:
++   - Add -B option to read in bootcode from a file
++   - Write BIOS drive number so that FS can properly boot
++   - Set number of hidden sectors before boot code to be one track
+    
+    Copying:     Copyright 1993, 1994 David Hudson (dave@humbug.demon.co.uk)
+ 
+@@ -153,6 +159,8 @@
+ #define FAT_BAD      0x0ffffff7
+ 
+ #define MSDOS_EXT_SIGN 0x29	/* extended boot sector signature */
++#define HD_DRIVE_NUMBER 0x80	/* Boot off first hard drive */
++#define FD_DRIVE_NUMBER 0x00	/* Boot off first floppy drive */
+ #define MSDOS_FAT12_SIGN "FAT12   "	/* FAT12 filesystem signature */
+ #define MSDOS_FAT16_SIGN "FAT16   "	/* FAT16 filesystem signature */
+ #define MSDOS_FAT32_SIGN "FAT32   "	/* FAT32 filesystem signature */
+@@ -175,6 +183,8 @@
+ #define BOOTCODE_SIZE		448
+ #define BOOTCODE_FAT32_SIZE	420
+ 
++#define MAX_RESERVED		0xFFFF
++
+ /* __attribute__ ((packed)) is used on all structures to make gcc ignore any
+  * alignments */
+ 
+@@ -202,7 +212,7 @@
+   __u16         fat_length;	/* sectors/FAT */
+   __u16         secs_track;	/* sectors per track */
+   __u16         heads;		/* number of heads */
+-  __u32         hidden;		/* hidden sectors (unused) */
++  __u32         hidden;		/* hidden sectors (one track) */
+   __u32         total_sect;	/* number of sectors (if sectors == 0) */
+   union {
+     struct {
+@@ -285,6 +295,8 @@
+ 
+ /* Global variables - the root of all evil :-) - see these and weep! */
+ 
++static char *template_boot_code;	/* Variable to store a full template boot sector in */
++static int use_template = 0;
+ static char *program_name = "mkdosfs";	/* Name of the program */
+ static char *device_name = NULL;	/* Name of the device on which to create the filesystem */
+ static int atari_format = 0;	/* Use Atari variation of MS-DOS FS format */
+@@ -837,6 +849,12 @@
+     vi->volume_id[2] = (unsigned char) ((volume_id & 0x00ff0000) >> 16);
+     vi->volume_id[3] = (unsigned char) (volume_id >> 24);
+   }
++  if (bs.media == 0xf8) {
++      vi->drive_number = HD_DRIVE_NUMBER;  /* Set bios drive number to 80h */
++  }
++  else {
++      vi->drive_number = FD_DRIVE_NUMBER;  /* Set bios drive number to 00h */
++  }
+ 
+   if (!atari_format) {
+     memcpy(vi->volume_label, volume_name, 11);
+@@ -1362,6 +1380,32 @@
+    * dir area on FAT12/16, and the first cluster on FAT32. */
+   writebuf( (char *) root_dir, size_root_dir, "root directory" );
+ 
++  if (use_template == 1) {
++    /* dupe template into reserved sectors */
++    seekto( 0, "Start of partition" );
++    if (size_fat == 32) {
++      writebuf( template_boot_code, 3, "backup jmpBoot" );
++      seekto( 0x5a, "sector 1 boot area" );
++      writebuf( template_boot_code+0x5a, 420, "sector 1 boot area" );
++      seekto( 512*2, "third sector" );
++      if (backup_boot != 0) {
++        writebuf( template_boot_code+512*2, backup_boot*sector_size - 512*2, "data to backup boot" );
++        seekto( backup_boot*sector_size, "backup boot sector" );
++        writebuf( template_boot_code, 3, "backup jmpBoot" );
++        seekto( backup_boot*sector_size+0x5a, "backup boot sector boot area" );
++        writebuf( template_boot_code+0x5a, 420, "backup boot sector boot area" );
++        seekto( (backup_boot+2)*sector_size, "sector following backup code" );
++        writebuf( template_boot_code+(backup_boot+2)*sector_size, (reserved_sectors-backup_boot-2)*512, "remaining data" );
++      } else {
++        writebuf( template_boot_code+512*2, (reserved_sectors-2)*512, "remaining data" );
++      }
++    } else {
++      writebuf( template_boot_code, 3, "jmpBoot" );
++      seekto( 0x3e, "sector 1 boot area" );
++      writebuf( template_boot_code+0x3e, 448, "boot code" );
++    }
++  }
++
+   if (blank_sector) free( blank_sector );
+   if (info_sector) free( info_sector );
+   free (root_dir);   /* Free up the root directory space from setup_tables */
+@@ -1376,7 +1420,7 @@
+ {
+   fatal_error("\
+ Usage: mkdosfs [-A] [-c] [-C] [-v] [-I] [-l bad-block-file] [-b backup-boot-sector]\n\
+-       [-m boot-msg-file] [-n volume-name] [-i volume-id]\n\
++       [-m boot-msg-file] [-n volume-name] [-i volume-id] [-B bootcode]\n\
+        [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\
+        [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
+        /dev/name [blocks]\n");
+@@ -1439,7 +1483,7 @@
+   printf ("%s " VERSION " (" VERSION_DATE ")\n",
+ 	   program_name);
+ 
+-  while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:h:v")) != EOF)
++  while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
+     /* Scan the command line for options */
+     switch (c)
+       {
+@@ -1509,6 +1553,51 @@
+ 	listfile = optarg;
+ 	break;
+ 
++      case 'B':         /* B : read in bootcode */
++        if ( strcmp(optarg, "-") )
++	  {
++	    msgfile = fopen(optarg, "r");
++	    if ( !msgfile )
++	      perror(optarg);
++	  }
++	else
++	  msgfile = stdin;
++
++	if ( msgfile )
++	  {
++            if (!(template_boot_code = malloc( MAX_RESERVED )))
++                die( "Out of memory" );
++	    /* The template boot sector including reserved must not be > 65535 */
++            use_template = 1;
++	    i = 0;
++	    do
++	      {
++		ch = getc(msgfile);
++		switch (ch)
++		  {
++		  case EOF:
++		    break;
++
++		  default:
++		    template_boot_code[i++] = ch; /* Store character */
++		    break;
++		  }
++	      }
++	    while ( ch != EOF && i < MAX_RESERVED );
++	    ch = getc(msgfile); /* find out if we're at EOF */
++
++	    /* Fill up with zeros */
++	    while( i < MAX_RESERVED )
++		template_boot_code[i++] = '\0';
++	    
++	    if ( ch != EOF )
++	      printf ("Warning: template too long; truncated after %d bytes\n", i);
++	    
++	    if ( msgfile != stdin )
++	      fclose(msgfile);
++	  }
++	break;
++
+       case 'm':		/* m : Set boot message */
+ 	if ( strcmp(optarg, "-") )
+ 	  {
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
new file mode 100644
index 0000000..3ba4711
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/mkdosfs-dir.patch
@@ -0,0 +1,639 @@
+Add -d <directory> support to populate the image.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c	2011-12-06 12:27:55.000000000 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.c	2011-12-06 12:37:13.445950703 +0000
+@@ -18,6 +18,10 @@
+    as a rule), and not the block.  For example the boot block does not
+    occupy a full cluster.
+ 
++   June 2004 - Jordan Crouse (info.linux@amd.com)
++   Added -d <directory> support to populate the image
++   Copyright (C) 2004, Advanced Micro Devices, All Rights Reserved
++   
+    Fixes/additions May 1998 by Roman Hodek
+    <Roman.Hodek@informatik.uni-erlangen.de>:
+    - Atari format support
+@@ -71,6 +75,8 @@
+ #include <unistd.h>
+ #include <time.h>
+ #include <errno.h>
++#include <libgen.h>
++#include <dirent.h>
+ 
+ #include <linux/version.h>
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
+@@ -110,6 +116,8 @@
+  * sufficient (or even better :) for 64 bit offsets in the meantime */
+ #define llseek lseek
+ 
++#define ROUND_UP(value, divisor) (value + (divisor - (value % divisor))) / divisor
++
+ /* Constant definitions */
+ 
+ #define TRUE 1			/* Boolean constants */
+@@ -149,7 +157,6 @@
+ #define ATTR_VOLUME  8		/* volume label */
+ #define ATTR_DIR     16		/* directory */
+ #define ATTR_ARCH    32		/* archived */
+-
+ #define ATTR_NONE    0		/* no attribute bits */
+ #define ATTR_UNUSED  (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN)
+ 	/* attribute bits that are copied "as is" */
+@@ -245,6 +252,19 @@
+   __u32		reserved2[4];
+ };
+ 
++/* This stores up to 13 chars of the name */
++
++struct msdos_dir_slot {
++        __u8    id;             /* sequence number for slot */
++        __u8    name0_4[10];    /* first 5 characters in name */
++        __u8    attr;           /* attribute byte */
++        __u8    reserved;       /* always 0 */
++        __u8    alias_checksum; /* checksum for 8.3 alias */
++        __u8    name5_10[12];   /* 6 more characters in name */
++        __u16   start;          /* starting cluster number, 0 in long slots */
++        __u8    name11_12[4];   /* last 2 characters in name */
++};
++
+ struct msdos_dir_entry
+   {
+     char	name[8], ext[3];	/* name and extension */
+@@ -293,6 +313,15 @@
+ 
+ #define MESSAGE_OFFSET 29	/* Offset of message in above code */
+ 
++/* Special structure to keep track of directories as we add them for the -d option */
++
++struct dir_entry {
++  int root;                       /* Specifies if this is the root dir or not */
++  int count;                      /* Number of items in the table */
++  int entries;                    /* Number of entries in the table */
++  struct msdos_dir_entry *table;  /* Pointer to the entry table */
++};
++
+ /* Global variables - the root of all evil :-) - see these and weep! */
+ 
+ static char *template_boot_code;	/* Variable to store a full template boot sector in */
+@@ -326,6 +355,9 @@
+ static int size_root_dir;	/* Size of the root directory in bytes */
+ static int sectors_per_cluster = 0;	/* Number of sectors per disk cluster */
+ static int root_dir_entries = 0;	/* Number of root directory entries */
++static int root_dir_num_entries = 0;
++static int last_cluster_written = 0;
++
+ static char *blank_sector;		/* Blank sector - all zeros */
+ static int hidden_sectors = 0;		/* Number of hidden sectors */
+ 
+@@ -399,7 +431,6 @@
+   }
+ }
+ 
+-
+ /* Mark a specified sector as having a particular value in it's FAT entry */
+ 
+ static void
+@@ -1266,6 +1297,9 @@
+       die ("unable to allocate space for root directory in memory");
+     }
+ 
++
++  last_cluster_written = 2;
++  
+   memset(root_dir, 0, size_root_dir);
+   if ( memcmp(volume_name, "           ", 11) )
+     {
+@@ -1314,11 +1348,11 @@
+   }
+   
+   if (!(blank_sector = malloc( sector_size )))
+-      die( "Out of memory" );
++    die( "Out of memory" );
++  
+   memset(blank_sector, 0, sector_size);
+ }
+-
+-
++  
+ /* Write the new filesystem's data tables to wherever they're going to end up! */
+ 
+ #define error(str)				\
+@@ -1340,7 +1374,7 @@
+   do {							\
+     int __size = (size);				\
+     if (write (dev, buf, __size) != __size)		\
+-	error ("failed whilst writing " errstr);	\
++       error ("failed whilst writing " errstr);	\
+   } while(0)
+ 
+ 
+@@ -1412,6 +1446,452 @@
+   free (fat);  /* Free up the fat table space reserved during setup_tables */
+ }
+ 
++/* Add a file to the specified directory entry, and also write it into the image */
++
++static void copy_filename(char *filename, char *base, char *ext) {
++  
++  char *ch = filename;
++  int i, len;
++
++  memset(base, 0x20, 8);
++  memset(ext, 0x20, 3);
++  
++  for(len = 0 ; *ch && *ch != '.'; ch++) {
++    base[len++] = toupper(*ch);
++    if (len == 8) break;
++  }
++  
++  for ( ; *ch && *ch != '.'; ch++);
++  if (*ch) ch++;
++  
++  for(len = 0 ; *ch; ch++) {
++    ext[len++] = toupper(*ch);
++    if (len == 3) break;
++  }
++}
++
++/* Check for an .attrib.<filename> file, and read the attributes therein */
++
++/* We are going to be pretty pedantic about this.  The file needs 3
++   bytes at the beginning, the attributes are listed in this order:
++   
++   (H)idden|(S)ystem|(A)rchived
++   
++   A capital HSA means to enable it, anything else will disable it
++   (I recommend a '-') The unix user attributes will still be used 
++   for write access.
++
++   For example, to enable system file access for ldlinux.sys, write 
++   the following to .attrib.ldlinux.sys: -S-
++*/
++
++unsigned char check_attrib_file(char *dir, char *filename) {
++
++  char attrib[4] = { '-', '-', '-' };
++  unsigned char *buffer = 0;
++  int ret = ATTR_NONE;
++  int fd = -1;
++
++  buffer = (char *) calloc(1, strlen(dir) + strlen(filename) + 10);
++  if (!buffer) return ATTR_NONE;
++
++  sprintf(buffer, "%s/.attrib.%s", dir, filename);
++
++  if (access(buffer, R_OK)) 
++    goto exit_attrib;
++
++  if ((fd = open(buffer, O_RDONLY, 0)) < 0)
++    goto exit_attrib;
++
++  if (read(fd, attrib, 3) < 0)
++    goto exit_attrib;
++  
++  if (attrib[0] == 'H') ret |= ATTR_HIDDEN;
++  if (attrib[1] == 'S') ret |= ATTR_SYS;
++  if (attrib[2] == 'A') ret |= ATTR_ARCH;
++
++  printf("%s: Setting atrribute %x\n", filename, ret);
++
++ exit_attrib:
++  if (fd >= 0) close(fd);
++  if (buffer) free(buffer);
++
++  return ret;
++}
++
++static void copy_name(char *buffer, int size, char **pointer) {
++  int i;
++
++  for(i = 0; i < size; i += 2) {
++    if (*pointer) {
++      buffer[i] = **pointer;
++      buffer[i + 1] = 0x00;
++      *pointer = **pointer ? *pointer + 1 : 0;
++    }
++    else {
++      buffer[i] = 0xFF;
++      buffer[i + 1] = 0xFF;
++    }
++  }  
++}
++
++static int add_file(char *filename, struct dir_entry *dir, unsigned char attr) 
++{
++  struct stat stat;
++  struct msdos_dir_entry *entry;
++  int infile = 0;
++  int sectors, clusters;
++  struct tm *ctime;
++  int c, s;
++  int ptr;
++  char *buffer, *base;
++  int start;
++  int usedsec, totalsec;
++
++  char name83[8], ext83[3];
++
++  struct msdos_dir_slot *slot;
++  int i;
++  char *p;
++
++  /* The root directory is static, everything else grows as needed */
++
++  if (dir->root) {
++    if (dir->count == dir->entries) {
++      printf("Error - too many directory entries\n");
++    }
++  }
++  else {
++    if (dir->count == dir->entries) {
++      if (!dir->table) 
++	dir->table = 
++	  (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
++      else {
++	dir->table = 
++	  (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) * 
++					     sizeof(struct msdos_dir_entry));
++
++	memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
++      }
++
++      dir->entries++;
++    }
++  }
++
++  infile = open(filename, O_RDONLY, 0);
++  if (!infile) return;
++  
++  if (fstat(infile, &stat))
++    goto exit_add;
++ 
++  if (S_ISCHR(stat.st_mode) ||S_ISBLK(stat.st_mode) ||
++      S_ISFIFO(stat.st_mode) || S_ISLNK(stat.st_mode)) {
++    printf("Error - cannot create a special file in a FATFS\n");
++    goto exit_add;
++  }
++
++  /* FIXME: This isn't very pretty */
++
++  usedsec = start_data_sector + (size_root_dir / sector_size) +
++    (last_cluster_written * bs.cluster_size);
++
++  totalsec = blocks * BLOCK_SIZE / sector_size;
++  
++  /* Figure out how many sectors / clustors the file requires */
++
++  sectors = ROUND_UP(stat.st_size, sector_size);
++  clusters = ROUND_UP(sectors, (int) bs.cluster_size);
++
++  if (usedsec + sectors > totalsec) {
++    printf("Error - %s is too big (%d vs %d)\n", filename, sectors, totalsec - usedsec);
++    close(infile);
++    return -1;
++  }
++
++  printf("ADD %s\n", filename);
++
++  /* Grab the basename of the file */
++  base = basename(filename);
++  
++  /* Extract out the 8.3 name */
++  copy_filename(base, name83, ext83);
++
++  /* Make an extended name slot */
++
++  slot = (struct msdos_dir_slot *) &dir->table[dir->count++];
++  slot->id = 'A';  
++  slot->attr = 0x0F;
++  slot->reserved = 0;
++  slot->start = 0;
++  
++  slot->alias_checksum = 0;
++  
++  for(i = 0; i < 8; i++) 
++    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + name83[i];
++  
++  for(i = 0; i < 3; i++) 
++    slot->alias_checksum = (((slot->alias_checksum&1)<<7)|((slot->alias_checksum&0xfe)>>1)) + ext83[i];
++
++  p = base;
++
++  copy_name(slot->name0_4, 10, &p);
++  copy_name(slot->name5_10, 12, &p);
++  copy_name(slot->name11_12, 4, &p);
++
++
++  /* Get the entry from the root filesytem */
++  entry = &dir->table[dir->count++];
++
++  strncpy(entry->name, name83, 8);
++  strncpy(entry->ext, ext83, 3);
++
++
++  /* If the user has it read only, then add read only to the incoming
++     attribute settings */
++
++  if (!(stat.st_mode & S_IWUSR)) attr |= ATTR_RO;
++  entry->attr = attr;
++
++  /* Set the access time on the file */
++  ctime = localtime(&create_time);
++
++  entry->time = CT_LE_W((unsigned short)((ctime->tm_sec >> 1) +
++					  (ctime->tm_min << 5) + (ctime->tm_hour << 11)));
++
++  entry->date = CT_LE_W((unsigned short)(ctime->tm_mday +
++				      ((ctime->tm_mon+1) << 5) +
++				      ((ctime->tm_year-80) << 9)));
++
++  entry->ctime_ms = 0;
++  entry->ctime = entry->time;
++  entry->cdate = entry->date;
++  entry->adate = entry->date;
++  entry->size = stat.st_size;
++
++  start = last_cluster_written;
++
++  entry->start = CT_LE_W(start);  /* start sector */
++  entry->starthi = CT_LE_W((start & 0xFFFF0000) >> 16); /* High start sector (for FAT32) */
++
++  /* We mark all of the clusters we use in the FAT */
++  
++  for(c = 0; c < clusters; c++ ) {
++    int free;
++    int next = c == (clusters - 1) ? FAT_EOF : start + c + 1;
++    mark_FAT_cluster(start + c, next);  
++    last_cluster_written++;
++  }
++  
++  /* This confused me too - cluster 2 starts after the
++     root directory data - search me as to why */
++
++  ptr = (start_data_sector * sector_size) + size_root_dir;
++  ptr += (start - 2) * bs.cluster_size * sector_size;
++    
++  buffer = (char *) malloc(sector_size);
++
++  if (!buffer) {
++    printf("Error - couldn't allocate memory\n");
++    goto exit_add;
++  }
++
++  /* Write the file into the file block */
++
++  seekto(ptr, "datafile");
++
++  while(1) {
++    int size = read(infile, buffer, sector_size);    
++    if (size <= 0) break;
++    
++    writebuf(buffer, size, "data");    
++  }
++
++ exit_add:
++  if (infile) close(infile);
++}
++
++/* Add a new directory to the specified directory entry, and in turn populate 
++   it with its own files */
++
++/* FIXME:  This should check to make sure there is enough size to add itself */
++
++static void add_directory(char *filename, struct dir_entry *dir) {
++
++  struct dir_entry *newdir = 0;
++  struct msdos_dir_entry *entry;
++  struct tm *ctime;
++  DIR *rddir = opendir(filename);
++  struct dirent *dentry = 0;
++  int remain;
++  char *data;
++
++  /* If the directory doesn't exist */
++  if (!rddir) return;
++  
++  if (dir->root) {
++    if (dir->count == dir->entries) {
++      printf("Error - too many directory entries\n");
++      goto exit_add_dir;
++    }
++  }
++  else {
++    if (dir->count == dir->entries) {
++      if (!dir->table) 
++	dir->table = (struct msdos_dir_entry *) malloc(sizeof(struct msdos_dir_entry));
++      else {
++	dir->table = (struct msdos_dir_entry *) realloc(dir->table, (dir->entries + 1) * 
++							sizeof(struct msdos_dir_entry));
++
++	/* Zero it out to avoid issues */
++	memset(&dir->table[dir->entries], 0, sizeof(struct msdos_dir_entry));
++      }
++	dir->entries++;
++    }
++  }
++
++  /* Now, create a new directory entry for the new directory */
++  newdir = (struct dir_entry *) calloc(1, sizeof(struct dir_entry));
++  if (!newdir) goto exit_add_dir;
++
++  entry = &dir->table[dir->count++];
++
++  strncpy(entry->name, basename(filename), sizeof(entry->name));
++  
++  entry->attr = ATTR_DIR;
++  ctime = localtime(&create_time);
++
++  entry->time = CT_LE_W((unsigned short)((ctime->tm_sec >> 1) +
++					  (ctime->tm_min << 5) + (ctime->tm_hour << 11)));
++
++  entry->date = CT_LE_W((unsigned short)(ctime->tm_mday +
++				      ((ctime->tm_mon+1) << 5) +
++				      ((ctime->tm_year-80) << 9)));
++
++  entry->ctime_ms = 0;
++  entry->ctime = entry->time;
++  entry->cdate = entry->date;
++  entry->adate = entry->date;
++
++  /* Now, read the directory */
++
++  while((dentry = readdir(rddir))) {
++    struct stat st;
++    char *buffer;
++    
++    if (!strcmp(dentry->d_name, ".") || !strcmp(dentry->d_name, ".."))
++      continue;
++
++    /* DOS wouldn't like a typical unix . (dot) file, so we skip those too */
++    if (dentry->d_name[0] == '.') continue;
++
++    buffer = malloc(strlen(filename) + strlen(dentry->d_name) + 3);
++    if (!buffer) continue;
++    
++    sprintf(buffer, "%s/%s", filename, dentry->d_name);
++    if (!stat(buffer, &st)) {
++      if (S_ISDIR(st.st_mode)) 
++	add_directory(buffer, newdir);
++      else if (S_ISREG(st.st_mode)) {
++	unsigned char attrib = check_attrib_file(filename, dentry->d_name);
++	add_file(buffer, newdir, attrib);
++      }
++    }
++ 
++    free(buffer);
++  }
++  
++  /* Now that the entire directory has been written, go ahead and write the directory
++     entry as well */
++
++  entry->start = CT_LE_W(last_cluster_written);
++  entry->starthi = CT_LE_W((last_cluster_written & 0xFFFF0000) >> 16); 
++  entry->size = newdir->count * sizeof(struct msdos_dir_entry);
++  
++  remain = entry->size;
++  data = (char *) newdir->table;
++
++  while(remain) {
++    int size = 
++      remain > bs.cluster_size * sector_size ? bs.cluster_size * sector_size : remain;
++
++    int pos = (start_data_sector * sector_size) + size_root_dir;
++    pos += (last_cluster_written - 2) * bs.cluster_size * sector_size;
++    
++    seekto(pos, "add_dir");
++    writebuf(data, size, "add_dir");
++    
++    remain -= size;
++    data += size;
++
++    mark_FAT_cluster(last_cluster_written, remain ? last_cluster_written + 1 : FAT_EOF);      
++    last_cluster_written++;
++  }
++  
++ exit_add_dir:
++  if (rddir) closedir(rddir);
++  if (newdir->table) free(newdir->table);
++  if (newdir) free(newdir);
++}  
++  
++/* Given a directory, add all the files and directories to the root directory of the
++   image.  
++*/
++
++static void add_root_directory(char *dirname) 
++{
++  DIR *dir = opendir(dirname);
++  struct dirent *entry = 0;
++  struct dir_entry *newdir = 0;
++
++  if (!dir) {
++    printf("Error - directory %s does not exist\n", dirname);
++    return;
++  }
++ 
++  /* Create the root directory structure - this is a bit different then
++     above, because the table already exists, we just refer to it. */
++
++  newdir = (struct dir_entry *) calloc(1,sizeof(struct dir_entry));
++
++  if (!newdir) {
++    closedir(dir);
++    return;
++  }
++
++  newdir->entries = root_dir_entries;
++  newdir->root = 1;
++  newdir->count = 0;
++  newdir->table = root_dir;
++
++  while((entry = readdir(dir))) {
++    struct stat st;
++    char *buffer;
++    
++    if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."))
++      continue;
++    
++    /* DOS wouldn't like a typical unix . (dot) file, so we skip those too */
++    if (entry->d_name[0] == '.') continue;
++ 
++    buffer = malloc(strlen(dirname) + strlen(entry->d_name) + 3);
++    if (!buffer) continue;
++
++    sprintf(buffer, "%s/%s", dirname, entry->d_name);
++    if (!stat(buffer, &st)) {
++      if (S_ISDIR(st.st_mode)) 
++	add_directory(buffer, newdir);
++      else if (S_ISREG(st.st_mode)) {
++	unsigned char attrib = check_attrib_file(dirname, entry->d_name);
++	add_file(buffer, newdir, attrib);
++      }
++    }
++
++    free(buffer);
++  }
++
++  closedir(dir);
++  if (newdir) free(newdir);
++}
+ 
+ /* Report the command usage and return a failure error code */
+ 
+@@ -1423,7 +1903,7 @@
+        [-m boot-msg-file] [-n volume-name] [-i volume-id] [-B bootcode]\n\
+        [-s sectors-per-cluster] [-S logical-sector-size] [-f number-of-FATs]\n\
+        [-h hidden-sectors] [-F fat-size] [-r root-dir-entries] [-R reserved-sectors]\n\
+-       /dev/name [blocks]\n");
++       [-d directory] /dev/name [blocks]\n");
+ }
+ 
+ /*
+@@ -1463,6 +1943,8 @@
+   int c;
+   char *tmp;
+   char *listfile = NULL;
++  char *dirname = NULL;
++
+   FILE *msgfile;
+   struct stat statbuf;
+   int i = 0, pos, ch;
+@@ -1483,7 +1965,7 @@
+   printf ("%s " VERSION " (" VERSION_DATE ")\n",
+ 	   program_name);
+ 
+-  while ((c = getopt (argc, argv, "AbcCf:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
++  while ((c = getopt (argc, argv, "AbcCd:f:F:Ii:l:m:n:r:R:s:S:v:B:")) != EOF)
+     /* Scan the command line for options */
+     switch (c)
+       {
+@@ -1508,6 +1990,10 @@
+ 	create = TRUE;
+ 	break;
+ 
++  case 'd':
++	dirname = optarg;
++	break;
++
+       case 'f':		/* f : Choose number of FATs */
+ 	nr_fats = (int) strtol (optarg, &tmp, 0);
+ 	if (*tmp || nr_fats < 1 || nr_fats > 4)
+@@ -1811,8 +2297,10 @@
+   else if (listfile)
+     get_list_blocks (listfile);
+ 
+-  write_tables ();		/* Write the file system tables away! */
+ 
++  if (dirname) add_root_directory(dirname);
++
++  write_tables ();		/* Write the file system tables away! */  
+   exit (0);			/* Terminate with no errors! */
+ }
+ 
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch b/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch
new file mode 100644
index 0000000..11e8a75
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/msdos_fat12_undefined.patch
@@ -0,0 +1,19 @@
+Fix a compilation error due to undefined MSDOS_FAT12.
+
+Upstream-Status: Inappropriate [licensing]
+We're tracking an old release of dosfstools due to licensing issues.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- dosfstools-2.10/dosfsck/boot.c.orig	2004-10-15 08:51:42.394725176 -0600
++++ dosfstools-2.10/dosfsck/boot.c	2004-10-15 08:49:16.776862456 -0600
+@@ -14,6 +14,9 @@
+ #include "io.h"
+ #include "boot.h"
+ 
++#ifndef MSDOS_FAT12
++#define MSDOS_FAT12 4084
++#endif
+ 
+ #define ROUND_TO_MULTIPLE(n,m) ((n) && (m) ? (n)+(m)-1-((n)-1)%(m) : 0)
+     /* don't divide by zero */
diff --git a/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch b/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch
new file mode 100644
index 0000000..848a76b
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools/nofat32_autoselect.patch
@@ -0,0 +1,27 @@
+FAT32 appears to be broken when used with the -d option to populate the msdos
+image. This disables the FAT32 autoselection code which means we don't get
+broken images with the -d option. It can still be enabled on the commandline
+at the users own risk. This changes us back to the 2.10 version's behaviour
+which was known to work well even with large images.
+
+Upstream-Status: Inappropriate [depends on other patches we apply]
+
+RP 2011/12/13
+
+Index: dosfstools-2.11/mkdosfs/mkdosfs.c
+===================================================================
+--- dosfstools-2.11.orig/mkdosfs/mkdosfs.c	2011-12-13 13:54:37.538509391 +0000
++++ dosfstools-2.11/mkdosfs/mkdosfs.c	2011-12-13 13:55:10.258508631 +0000
+@@ -808,10 +808,12 @@
+       bs.media = (char) 0xf8; /* Set up the media descriptor for a hard drive */
+       bs.dir_entries[0] = (char) 0;	/* Default to 512 entries */
+       bs.dir_entries[1] = (char) 2;
++/*
+       if (!size_fat && blocks*SECTORS_PER_BLOCK > 1064960) {
+ 	  if (verbose) printf("Auto-selecting FAT32 for large filesystem\n");
+ 	  size_fat = 32;
+       }
++*/
+       if (size_fat == 32) {
+ 	  /* For FAT32, try to do the same as M$'s format command:
+ 	   * fs size < 256M: 0.5k clusters
diff --git a/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb b/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
new file mode 100644
index 0000000..beec488
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools_2.11.bb
@@ -0,0 +1,38 @@
+# dosfstools OE build file
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+SUMMARY = "DOS FAT Filesystem Utilities"
+HOMEPAGE = "http://daniel-baumann.ch/software/dosfstools/"
+
+SECTION = "base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://mkdosfs/COPYING;md5=cbe67f08d6883bff587f615f0cc81aa8"
+PR = "r5"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.src.tar.gz/407d405ade410f7597d364ab5dc8c9f6/${BP}.src.tar.gz \
+           file://mkdosfs-bootcode.patch \
+           file://mkdosfs-dir.patch \
+           file://alignment_hack.patch \
+           file://msdos_fat12_undefined.patch \
+           file://dosfstools-msdos_fs-types.patch \
+           file://include-linux-types.patch \
+           file://nofat32_autoselect.patch \
+           file://fix_populated_dosfs_creation.patch \
+	   file://0001-Include-fcntl.h-for-getting-loff_t-definition.patch \
+	   "
+
+SRC_URI[md5sum] = "407d405ade410f7597d364ab5dc8c9f6"
+SRC_URI[sha256sum] = "0eac6d12388b3d9ed78684529c1b0d9346fa2abbe406c4d4a3eb5a023c98a484"
+
+# Makefile sets this, but we clobber its CFLAGS, so
+# add this in here to for sure allow for big files.
+#
+CFLAGS_append = " -D_FILE_OFFSET_BITS=64"
+CFLAGS_append_libc-musl = " -D_GNU_SOURCE"
+
+do_install () {
+	oe_runmake "PREFIX=${D}" "SBINDIR=${D}${base_sbindir}" \
+		   "MANDIR=${D}${mandir}/man8" install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/dosfstools/dosfstools_3.0.28.bb b/meta/recipes-devtools/dosfstools/dosfstools_3.0.28.bb
new file mode 100644
index 0000000..ac131cb
--- /dev/null
+++ b/meta/recipes-devtools/dosfstools/dosfstools_3.0.28.bb
@@ -0,0 +1,24 @@
+# dosfstools OE build file
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc.  All Rights Reserved
+# Copyright (C) 2015, Sören Brinkmann <soeren.brinkmann@gmail>  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+SUMMARY = "DOS FAT Filesystem Utilities"
+HOMEPAGE = "https://github.com/dosfstools/dosfstools"
+
+SECTION = "base"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "https://github.com/dosfstools/dosfstools/releases/download/v3.0.28/dosfstools-3.0.28.tar.xz"
+SRC_URI[md5sum] = "6a047a6c65186b9ebb1853709adb36db"
+SRC_URI[sha256sum] = "ee95913044ecf2719b63ea11212917649709a6e53209a72d622135aaa8517ee2"
+
+FILES_${PN} = "${base_sbindir}"
+FILES_${PN}-doc = "${mandir} ${docdir}"
+
+do_install () {
+	oe_runmake "PREFIX=${D}${prefix}" "SBINDIR=${D}${base_sbindir}" \
+		   "MANDIR=${D}${mandir}" "DOCDIR=${D}${docdir}" install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/dpkg/dpkg.inc b/meta/recipes-devtools/dpkg/dpkg.inc
new file mode 100644
index 0000000..6eec2cd
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg.inc
@@ -0,0 +1,79 @@
+SUMMARY = "Package maintenance system from Debian"
+LICENSE = "GPLv2.0+"
+SECTION = "base"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.xz"
+
+SRC_URI_append_class-native = " file://0001-When-running-do_package_write_deb-we-have-trees-of-h.patch"
+
+DEPENDS = "zlib bzip2 perl ncurses"
+DEPENDS_class-native = "bzip2-replacement-native zlib-native virtual/update-alternatives-native gettext-native perl-native"
+RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} xz run-postinsts perl"
+RDEPENDS_${PN}_class-native = "xz-native"
+
+inherit autotools gettext perlnative pkgconfig systemd
+
+python () {
+    if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d):
+        pn = d.getVar('PN', True)
+        d.setVar('SYSTEMD_SERVICE_%s' % (pn), 'dpkg-configure.service')
+}
+
+export PERL = "${bindir}/perl"
+PERL_class-native = "${STAGING_BINDIR_NATIVE}/perl-native/perl"
+
+export PERL_LIBDIR = "${libdir}/perl"
+PERL_LIBDIR_class-native = "${libdir}/perl-native/perl"
+
+EXTRA_OECONF = "\
+		--disable-dselect \
+		--enable-start-stop-daemon \
+		--with-zlib \
+		--with-bz2 \
+		--without-liblzma \
+		--without-selinux \
+		"
+
+EXTRA_OECONF_append_class-target = " TAR=tar"
+
+do_configure () {
+    echo >> ${S}/m4/compiler.m4
+    sed -i -e 's#PERL_LIBDIR=.*$#PERL_LIBDIR="${libdir}/perl"#' ${S}/configure
+    autotools_do_configure
+}
+
+do_install_append () {
+	if [ "${PN}" = "dpkg-native" ]; then
+		# update-alternatives doesn't have an offline mode
+		rm ${D}${bindir}/update-alternatives
+		sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env nativeperl|' ${D}${bindir}/dpkg-*
+	else
+		sed -i -e 's|^#!.*${bindir}/perl-native.*/perl|#!/usr/bin/env perl|' ${D}${bindir}/dpkg-*
+	fi
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)};then
+		install -d ${D}${systemd_unitdir}/system
+		install -m 0644 ${WORKDIR}/dpkg-configure.service ${D}${systemd_unitdir}/system/
+		sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+			-e 's,@SYSCONFDIR@,${sysconfdir},g' \
+			-e 's,@BINDIR@,${bindir},g' \
+			-e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
+			${D}${systemd_unitdir}/system/dpkg-configure.service
+	fi
+}
+
+PROV = "virtual/update-alternatives"
+PROV_class-native = ""
+
+PROVIDES += "${PROV}"
+
+PACKAGES =+ "update-alternatives-dpkg"
+FILES_update-alternatives-dpkg = "${bindir}/update-alternatives ${localstatedir}/lib/dpkg/alternatives ${sysconfdir}/alternatives"
+RPROVIDES_update-alternatives-dpkg += "update-alternatives"
+
+PACKAGES += "${PN}-perl"
+FILES_${PN}-perl = "${libdir}/perl"
+
+BBCLASSEXTEND = "native"
+
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch b/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch
new file mode 100644
index 0000000..6967ef4
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0001-When-running-do_package_write_deb-we-have-trees-of-h.patch
@@ -0,0 +1,63 @@
+From d14ffd786993da60ca84c4812da8a6594a8c764e Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 15:48:13 +0300
+Subject: [PATCH 1/5] When running do_package_write_deb, we have trees of
+ hardlinked files such as the dbg source files in ${PN}-dbg. If something
+ makes another copy of one of those files (or deletes one), the number of
+ links a file has changes and tar can notice this, e.g.:
+
+| DEBUG: Executing python function do_package_deb
+| dpkg-deb: building package `sed-ptest' in `/media/build1/poky/build/tmp/work/i586-poky-linux/sed/4.2.2-r0/deploy-debs/i586/sed-ptest_4.2.2-r0.3_i386.deb'.
+| tar: ./usr/lib/sed/ptest/testsuite/tst-regex2: file changed as we read it
+| dpkg-deb: error: subprocess tar -cf returned error exit status 1
+
+Tar returns an error of 1 when files 'change' and other errors codes
+in other error cases. We tweak dpkg-deb here so that it ignores an exit
+code of 1 from tar. The files don't really change (and we have locking in
+place to avoid that kind of issue).
+
+Upstream-Status: Inappropriate
+RP 2015/3/27
+---
+ dpkg-deb/build.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
+index ea3d861..1589927 100644
+--- a/dpkg-deb/build.c
++++ b/dpkg-deb/build.c
+@@ -458,7 +458,7 @@ do_build(const char *const *argv)
+   char *debar;
+   char *tfbuf;
+   int arfd;
+-  int p1[2], p2[2], gzfd;
++  int p1[2], p2[2], gzfd, rc;
+   pid_t c1, c2;
+ 
+   /* Decode our arguments. */
+@@ -538,7 +538,9 @@ do_build(const char *const *argv)
+   }
+   close(p1[0]);
+   subproc_reap(c2, _("<compress> from tar -cf"), 0);
+-  subproc_reap(c1, "tar -cf", 0);
++  rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
++  if (rc && rc != 1)
++    ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
+ 
+   if (lseek(gzfd, 0, SEEK_SET))
+     ohshite(_("failed to rewind temporary file (%s)"), _("control member"));
+@@ -626,7 +628,10 @@ do_build(const char *const *argv)
+   /* All done, clean up wait for tar and <compress> to finish their job. */
+   close(p1[1]);
+   subproc_reap(c2, _("<compress> from tar -cf"), 0);
+-  subproc_reap(c1, "tar -cf", 0);
++  rc = subproc_reap(c1, "tar -cf", SUBPROC_RETERROR);
++  if (rc && rc != 1)
++    ohshite(_("subprocess %s returned error exit status %d"), "tar -cf", rc);
++
+   /* Okay, we have data.tar as well now, add it to the ar wrapper. */
+   if (deb_format.major == 2) {
+     char datamember[16 + 1];
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch b/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch
new file mode 100644
index 0000000..231a6a2
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch
@@ -0,0 +1,38 @@
+From b4ea54158c399874e12394ebc91afe98954695e2 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:16:16 +0300
+Subject: [PATCH 2/5] Adapt to linux-wrs kernel version, which has character
+ '_' inside. Remove the first-char-digit-check (as the 1.15.8.5 version does).
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ lib/dpkg/parsehelp.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/lib/dpkg/parsehelp.c b/lib/dpkg/parsehelp.c
+index 79b2908..7758aa5 100644
+--- a/lib/dpkg/parsehelp.c
++++ b/lib/dpkg/parsehelp.c
+@@ -235,14 +235,12 @@ parseversion(struct dpkg_version *rversion, const char *string,
+ 
+   /* XXX: Would be faster to use something like cisversion and cisrevision. */
+   ptr = rversion->version;
+-  if (*ptr && !c_isdigit(*ptr++))
+-    return dpkg_put_warn(err, _("version number does not start with digit"));
+   for (; *ptr; ptr++) {
+-    if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~:", *ptr) == NULL)
++    if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~:_", *ptr) == NULL)
+       return dpkg_put_warn(err, _("invalid character in version number"));
+   }
+   for (ptr = rversion->revision; *ptr; ptr++) {
+-    if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".+~", *ptr) == NULL)
++    if (!c_isdigit(*ptr) && !c_isalpha(*ptr) && strchr(".-+~_", *ptr) == NULL)
+       return dpkg_put_warn(err, _("invalid character in revision number"));
+   }
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch b/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
new file mode 100644
index 0000000..9f77c6c
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch
@@ -0,0 +1,60 @@
+From 24229971492515b64c81e8c6392e5dfbdc22b44c Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:25:45 +0300
+Subject: [PATCH 3/5] Our pre/postinsts expect $D to be set when running in a
+ sysroot and don't expect a chroot. This matches up our system expectations
+ with what dpkg does.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2011/12/07
+---
+ src/script.c | 31 ++-----------------------------
+ 1 file changed, 2 insertions(+), 29 deletions(-)
+
+diff --git a/src/script.c b/src/script.c
+index a958145..24c49f9 100644
+--- a/src/script.c
++++ b/src/script.c
+@@ -100,36 +100,9 @@ maintscript_pre_exec(struct command *cmd)
+ 	size_t instdirl = strlen(instdir);
+ 
+ 	if (*instdir) {
+-		if (strncmp(admindir, instdir, instdirl) != 0)
+-			ohshit(_("admindir must be inside instdir for dpkg to work properly"));
+-		if (setenv("DPKG_ADMINDIR", admindir + instdirl, 1) < 0)
+-			ohshite(_("unable to setenv for subprocesses"));
+-
+-		if (chroot(instdir))
+-			ohshite(_("failed to chroot to '%.250s'"), instdir);
+-	}
+-	/* Switch to a known good directory to give the maintainer script
+-	 * a saner environment, also needed after the chroot(). */
+-	if (chdir("/"))
+-		ohshite(_("failed to chdir to '%.255s'"), "/");
+-	if (debug_has_flag(dbg_scripts)) {
+-		struct varbuf args = VARBUF_INIT;
+-		const char **argv = cmd->argv;
+-
+-		while (*++argv) {
+-			varbuf_add_char(&args, ' ');
+-			varbuf_add_str(&args, *argv);
+-		}
+-		varbuf_end_str(&args);
+-		debug(dbg_scripts, "fork/exec %s (%s )", cmd->filename,
+-		      args.buf);
+-		varbuf_destroy(&args);
++		setenv("D", instdir, 1);
+ 	}
+-	if (!instdirl)
+-		return cmd->filename;
+-
+-	assert(strlen(cmd->filename) >= instdirl);
+-	return cmd->filename + instdirl;
++	return cmd->filename;
+ }
+ 
+ /**
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch b/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch
new file mode 100644
index 0000000..56c85c7
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch
@@ -0,0 +1,31 @@
+From adb6bfd0feeceaf030df0debe3343d7f73e708a0 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:27:45 +0300
+Subject: [PATCH 4/5] The lutimes function doesn't work properly for all
+ systems.
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ src/archives.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/archives.c b/src/archives.c
+index bff5f14..b711013 100644
+--- a/src/archives.c
++++ b/src/archives.c
+@@ -449,8 +449,9 @@ tarobject_set_mtime(struct tar_entry *te, const char *path)
+ 
+   if (te->type == TAR_FILETYPE_SYMLINK) {
+ #ifdef HAVE_LUTIMES
+-    if (lutimes(path, tv) && errno != ENOSYS)
++/*    if (lutimes(path, tv) && errno != ENOSYS)
+       ohshite(_("error setting timestamps of '%.255s'"), path);
++*/
+ #endif
+   } else {
+     if (utimes(path, tv))
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch b/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch
new file mode 100644
index 0000000..96e96f2
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/0005-dpkg-compiler.m4-remove-Wvla.patch
@@ -0,0 +1,36 @@
+From 0ad7bba80d5b9035089ff2b2f77a774b5b201915 Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Wed, 26 Aug 2015 16:28:59 +0300
+Subject: [PATCH 5/5] dpkg-compiler.m4: remove -Wvla
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Remove the -Wvla flag from the set of compiler warning flags, since gcc
+on old host systems such as CentOS 5.8 doesn't support it, and it
+causes a build error for dpkg-native.
+
+Upstream-Status: Pending
+
+Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ m4/dpkg-compiler.m4 | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4
+index 682857c..23ed7d0 100644
+--- a/m4/dpkg-compiler.m4
++++ b/m4/dpkg-compiler.m4
+@@ -52,7 +52,6 @@ AC_DEFUN([DPKG_CHECK_COMPILER_WARNINGS], [
+   DPKG_CHECK_COMPILER_FLAG([-Wlogical-op])
+   DPKG_CHECK_COMPILER_FLAG([-Wlogical-not-parentheses])
+   DPKG_CHECK_COMPILER_FLAG([-Wswitch-bool])
+-  DPKG_CHECK_COMPILER_FLAG([-Wvla])
+   DPKG_CHECK_COMPILER_FLAG([-Winit-self])
+   DPKG_CHECK_COMPILER_FLAG([-Wwrite-strings])
+   DPKG_CHECK_COMPILER_FLAG([-Wcast-align])
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch b/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch
new file mode 100644
index 0000000..af275de
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/add_armeb_triplet_entry.patch
@@ -0,0 +1,38 @@
+Author: Krishnanjanappa, Jagadeesh <jagadeesh.krishnanjanappa@caviumnetworks.com>
+Date:   Wed Apr 8 18:08:14 2015 +0530
+
+[PATCH] add armeb triplet entry into triplettable.
+
+Cross-compling dpkg application for armeb fails with below error
+during configure task,
+
+(snip)
+ configure:23141: checking dpkg cpu type
+ configure:23148: result: armeb
+ configure:23150: WARNING: armeb not found in cputable
+ configure:23162: checking dpkg operating system type
+ configure:23169: result: linux-gnueabi
+ configure:23171: WARNING: linux-gnueabi not found in ostable
+ configure:23183: checking dpkg architecture name
+ configure:23189: error: cannot determine host dpkg architecture
+-- CUT --
+
+the required combination of "gnueabi-linux-armeb" was not found in
+the triplettable file thereby returning dpkg_arch as
+empty in configure script.
+
+Upstream-Status: Pending
+
+Signed-off-by: Krishnanjanappa, Jagadeesh <jagadeesh.krishnanjanappa@caviumnetworks.com>
+
+diff -Naurp dpkg-1.17.21_org/triplettable dpkg-1.17.21/triplettable
+--- dpkg-1.17.21_org/triplettable	2015-04-08 17:08:52.370759171 +0530
++++ dpkg-1.17.21/triplettable	2015-04-08 17:09:12.406752081 +0530
+@@ -9,6 +9,7 @@ musleabihf-linux-arm	musl-linux-armhf
+ musl-linux-<cpu>	musl-linux-<cpu>
+ gnueabihf-linux-arm	armhf
+ gnueabi-linux-arm	armel
++gnueabi-linux-armeb	armeb
+ gnuabin32-linux-mips64el	mipsn32el
+ gnuabin32-linux-mips64	mipsn32
+ gnuabi64-linux-mips64el	mips64el
diff --git a/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch b/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
new file mode 100644
index 0000000..cad4c0f
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/arch_pm.patch
@@ -0,0 +1,22 @@
+configure cannot determine the proper cpu, os, or
+architecture for mips64, and possibly other arch's
+because of faulty code added to Arch.pm in the latest
+release from upstream.  We remove that code.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+
+--- a/scripts/Dpkg/Arch.pm
++++ b/scripts/Dpkg/Arch.pm
+@@ -233,9 +233,6 @@ sub read_triplettable()
+ 		    (my $dt = $debtriplet) =~ s/<cpu>/$_cpu/;
+ 		    (my $da = $debarch) =~ s/<cpu>/$_cpu/;
+ 
+-		    next if exists $debarch_to_debtriplet{$da}
+-		         or exists $debtriplet_to_debarch{$dt};
+-
+ 		    $debarch_to_debtriplet{$da} = $dt;
+ 		    $debtriplet_to_debarch{$dt} = $da;
+ 		}
diff --git a/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service b/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service
new file mode 100644
index 0000000..f0b0789
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/dpkg-configure.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=dpkg first boot configure
+DefaultDependencies=no
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
+Before=sysinit.target
+
+[Service]
+Type=oneshot
+EnvironmentFile=-@SYSCONFDIR@/default/postinst
+ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/dpkg --configure -a > $LOGFILE 2>&1; else @BINDIR@/dpkg --configure -a; fi"
+ExecStartPost=@BASE_BINDIR@/systemctl disable dpkg-configure.service
+StandardOutput=syslog
+RemainAfterExit=No
+
+[Install]
+WantedBy=basic.target
+WantedBy=sysinit.target
diff --git a/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch b/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch
new file mode 100644
index 0000000..e73311c
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/fix-abs-redefine.patch
@@ -0,0 +1,40 @@
+Upstream-Status: Pending
+
+dpkg defines:
+#define DPKG_BEGIN_DECLS	extern "C" {
+
+That makes header cstdlib included in a extern "C" block which is not supported
+by gcc 4.8. It fails on Fedora 19:
+
+/usr/include/c++/4.8.1/cstdlib: In function ‘long long int std::abs(long long int)’:
+/usr/include/c++/4.8.1/cstdlib:174:20: error: declaration of C function ‘long long int std::abs(long long int)’ conflicts with
+   abs(long long __x) { return __builtin_llabs (__x); }
+                    ^
+/usr/include/c++/4.8.1/cstdlib:166:3: error: previous declaration ‘long int std::abs(long int)’ here
+   abs(long __i) { return __builtin_labs(__i); }
+   ^
+
+Move include gettext.h out of the extern "C" block to fix this issue.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+--- dpkg-1.17.1/lib/dpkg/i18n.h.orig	2013-08-13 17:31:28.870935573 +0800
++++ dpkg-1.17.1/lib/dpkg/i18n.h	2013-08-13 17:31:37.893065249 +0800
+@@ -23,8 +23,6 @@
+ 
+ #include <dpkg/macros.h>
+ 
+-DPKG_BEGIN_DECLS
+-
+ /**
+  * @defgroup i18n Internationalization support
+  * @ingroup dpkg-internal
+@@ -33,6 +31,8 @@
+ 
+ #include <gettext.h>
+ 
++DPKG_BEGIN_DECLS
++
+ /* We need to include this because pgettext() uses LC_MESSAGES, but libintl.h
+  * which gets pulled by gettext.h only includes it if building optimized. */
+ #include <locale.h>
diff --git a/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch b/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch
new file mode 100644
index 0000000..d56b8a6
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/glibc2.5-sync_file_range.patch
@@ -0,0 +1,86 @@
+CentOS 5.8 kernels and headers support the sync_file_range() system call,
+but glibc 2.5 doesn't provide the syscall stub.  It appears that this
+problem is known but will never be fixed:
+
+  https://bugzilla.redhat.com/show_bug.cgi?id=518581
+
+  Bug 518581 - [RHEL5] glibc misses sync_file_range syscall interface 
+
+  Status:       CLOSED CANTFIX 
+  Last Closed:  2009-11-22 22:19:55
+
+  Kirby Zhou 2009-08-20 23:37:55 EDT
+
+  Description of problem:
+
+  glibc misses sync_file_range syscall interface.  The header file and
+  man page both say 'sync_file_range' should exist.  From man page,
+  sync_file_range should exist sinc kernel-2.6.17
+
+  Andreas Schwab 2009-08-21 03:24:24 EDT
+
+  It has only been added to glibc 2.6, and cannot be backported due to
+  ABI breakage.  You can always fall back to syscall(3).
+
+  Ulrich Drepper 2009-11-22 22:19:55 EST
+
+  As comment #1 says, no chance to backport this.
+
+  See the syscall man page for instructions.
+
+  Jon E 2010-03-19 10:32:37 EDT
+
+  then why document it if it's broken and you're not going to fix it?
+  .. might want to FTFM over at sync_file_range(2) - in the meantime -
+  borrowing from glibc 2.6 .. any thoughts on this implementation for a
+  hacky workaround for those still on your "ancient releases" .. (eg:
+  RHEL5.3)?:
+
+  #ifdef ULI_WONT_FIX_THIS_IN_GLIBC2.5
+  #define NR_sync_file_range 277
+  int sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
+  {
+    return syscall (NR_sync_file_range, fd,
+                           __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+                           __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+                           flags);
+  }
+  #endif
+
+  assuming of course that you're on an x86_64 and include/asm-
+  x86_64/unistd.h has the correct entry
+
+  (fwiw - fio is starting to use this now)
+
+Rather than attempting to provide an implementation using syscall(),
+we take the more conservative route and ignore header support for
+sync_file_range() flags when the glibc version is <= 2.5.
+
+Upstream-Status: Inappropriate [everyone else builds on newer hosts :-)]
+
+Signed-off-by: Donn Seeley <donn.seeley@windriver.com>
+Signed-off-by: Lei Liu <lei.liu2@windriver.com>
+---
+ src/archives.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/src/archives.c
++++ b/src/archives.c
+@@ -75,7 +75,7 @@
+   /* Ignore the return code as it should be considered equivalent to an
+    * asynchronous hint for the kernel, we are doing an fsync() later on
+    * anyway. */
+-#if defined(SYNC_FILE_RANGE_WRITE)
++#if defined(SYNC_FILE_RANGE_WRITE) && __GLIBC_PREREQ(2, 6)
+   sync_file_range(fd, 0, 0, SYNC_FILE_RANGE_WRITE);
+ #elif defined(HAVE_POSIX_FADVISE)
+   posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED);
+@@ -1179,7 +1179,7 @@
+   return 0;
+ }
+ 
+-#if defined(SYNC_FILE_RANGE_WAIT_BEFORE)
++#if defined(SYNC_FILE_RANGE_WAIT_BEFORE) && __GLIBC_PREREQ(2, 6)
+ static void
+ tar_writeback_barrier(struct fileinlist *files, struct pkginfo *pkg)
+ {
diff --git a/meta/recipes-devtools/dpkg/dpkg/noman.patch b/meta/recipes-devtools/dpkg/dpkg/noman.patch
new file mode 100644
index 0000000..d30c150
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/noman.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate [disable feature]
+
+diff -ruN dpkg-1.15.8.5-orig/Makefile.am dpkg-1.15.8.5/Makefile.am
+--- dpkg-1.15.8.5-orig/Makefile.am	2010-10-08 12:27:15.042083703 +0800
++++ dpkg-1.15.8.5/Makefile.am	2010-10-08 12:27:27.755148228 +0800
+@@ -12,8 +12,7 @@
+ 	utils \
+ 	$(MAYBE_DSELECT) \
+ 	scripts \
+-	po \
+-	man
++	po
+ 
+ ACLOCAL_AMFLAGS = -I m4
diff --git a/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch b/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
new file mode 100644
index 0000000..4f408ff
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg/remove-tar-no-timestamp.patch
@@ -0,0 +1,17 @@
+busybox-1.19.4 tar utility doesn't support --warning=no-timestamp
+
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+Index: dpkg-1.17.1/dpkg-deb/extract.c
+===================================================================
+--- dpkg-1.17.1.orig/dpkg-deb/extract.c
++++ dpkg-1.17.1/dpkg-deb/extract.c
+@@ -318,7 +318,6 @@ extracthalf(const char *debar, const cha
+ 
+       command_add_arg(&cmd, "-f");
+       command_add_arg(&cmd, "-");
+-      command_add_arg(&cmd, "--warning=no-timestamp");
+ 
+       m_dup2(p2[0],0);
+       close(p2[0]);
diff --git a/meta/recipes-devtools/dpkg/dpkg_1.18.2.bb b/meta/recipes-devtools/dpkg/dpkg_1.18.2.bb
new file mode 100644
index 0000000..4c3fa4f
--- /dev/null
+++ b/meta/recipes-devtools/dpkg/dpkg_1.18.2.bb
@@ -0,0 +1,19 @@
+require dpkg.inc
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI += "file://noman.patch \
+            file://remove-tar-no-timestamp.patch \
+            file://fix-abs-redefine.patch \
+            file://arch_pm.patch \
+            file://dpkg-configure.service \
+            file://glibc2.5-sync_file_range.patch \
+            file://add_armeb_triplet_entry.patch \
+	    file://0002-Adapt-to-linux-wrs-kernel-version-which-has-characte.patch \
+	    file://0003-Our-pre-postinsts-expect-D-to-be-set-when-running-in.patch \
+	    file://0004-The-lutimes-function-doesn-t-work-properly-for-all-s.patch \
+	    file://0005-dpkg-compiler.m4-remove-Wvla.patch \
+           "
+
+SRC_URI[md5sum] = "63b9d869081ec49adeef6c5ff62d6576"
+SRC_URI[sha256sum] = "11484f2a73d027d696e720a60380db71978bb5c06cd88fe30c291e069ac457a4"
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc b/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc
new file mode 100644
index 0000000..bcd9ba7
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs.inc
@@ -0,0 +1,25 @@
+SUMMARY = "Ext2 Filesystem Utilities"
+DESCRIPTION = "The Ext2 Filesystem Utilities (e2fsprogs) contain all of the standard utilities for creating, \
+fixing, configuring , and debugging ext2 filesystems."
+HOMEPAGE = "http://e2fsprogs.sourceforge.net/"
+
+LICENSE = "GPLv2 & LGPLv2 & BSD & MIT"
+LICENSE_e2fsprogs-e2fsck = "GPLv2"
+LICENSE_e2fsprogs-mke2fs = "GPLv2"
+LICENSE_e2fsprogs-fsck = "GPLv2"
+LICENSE_e2fsprogs-tune2fs = "GPLv2"
+LICENSE_e2fsprogs-badblocks = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b48f21d765b875bd10400975d12c1ca2 \
+                      file://lib/ext2fs/ext2fs.h;beginline=1;endline=9;md5=596a8dedcb4e731c6b21c7a46fba6bef \
+                      file://lib/e2p/e2p.h;beginline=1;endline=7;md5=8a74ade8f9d65095d70ef2d4bf48e36a \
+                      file://lib/uuid/uuid.h.in;beginline=1;endline=32;md5=dbb8079e114a5f841934b99e59c8820a \
+                      file://lib/uuid/COPYING;md5=58dcd8452651fc8b07d1f65ce07ca8af \
+                      file://lib/et/et_name.c;beginline=1;endline=11;md5=ead236447dac7b980dbc5b4804d8c836 \
+                      file://lib/ss/ss.h;beginline=1;endline=20;md5=6e89ad47da6e75fecd2b5e0e81e1d4a6"
+SECTION = "base"
+DEPENDS = "util-linux"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/e2fsprogs/e2fsprogs-${PV}.tar.gz \
+           file://mkdir.patch"
+
+inherit autotools gettext texinfo pkgconfig multilib_header
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsprogs-fix-cross-compilation-problem.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsprogs-fix-cross-compilation-problem.patch
new file mode 100644
index 0000000..73043be
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-e2fsprogs-fix-cross-compilation-problem.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Pending
+
+Subject: e2fsprogs: fix cross compilation problem
+
+The checking of types in parse-types.sh doesn't make much sense in a
+cross-compilation environment, because the generated binary is executed
+on build machine.
+
+So even if asm_types.h has got correct statements for types, it's possible
+that the generated binary will report an error. Because these types are for
+the target machine.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ config/parse-types.sh |    6 ++++--
+ configure.in          |    6 +++++-
+ 2 files changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/config/parse-types.sh b/config/parse-types.sh
+index 5076f6c..24d2a99 100755
+--- a/config/parse-types.sh
++++ b/config/parse-types.sh
+@@ -118,8 +118,10 @@ if ./asm_types
+ then
+     true
+ else
+-    echo "Problem detected with asm_types.h"
+-    echo "" > asm_types.h
++    if [ "${CROSS_COMPILE}" != "1" ]; then
++	echo "Problem detected with asm_types.h"
++	echo "" > asm_types.h
++    fi
+ fi
+ rm asm_types.c asm_types
+ 
+diff --git a/configure.in b/configure.in
+index 68adf0d..ed1697b 100644
+--- a/configure.in
++++ b/configure.in
+@@ -953,7 +953,11 @@ AC_SUBST(SIZEOF_LONG)
+ AC_SUBST(SIZEOF_LONG_LONG)
+ AC_SUBST(SIZEOF_OFF_T)
+ AC_C_BIGENDIAN
+-BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
++if test $cross_compiling = no; then
++  BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
++else
++  CROSS_COMPILE="1" BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
++fi
+ ASM_TYPES_HEADER=./asm_types.h
+ AC_SUBST_FILE(ASM_TYPES_HEADER)
+ dnl
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-libext2fs-fix-potential-buffer-overflow-in-closefs.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-libext2fs-fix-potential-buffer-overflow-in-closefs.patch
new file mode 100644
index 0000000..72f77cc
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-libext2fs-fix-potential-buffer-overflow-in-closefs.patch
@@ -0,0 +1,58 @@
+From 49d0fe2a14f2a23da2fe299643379b8c1d37df73 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Fri, 6 Feb 2015 12:46:39 -0500
+Subject: [PATCH] libext2fs: fix potential buffer overflow in closefs()
+
+Upstream-Status: Backport
+
+The bug fix in f66e6ce4446: "libext2fs: avoid buffer overflow if
+s_first_meta_bg is too big" had a typo in the fix for
+ext2fs_closefs().  In practice most of the security exposure was from
+the openfs path, since this meant if there was a carefully crafted
+file system, buffer overrun would be triggered when the file system was
+opened.
+
+However, if corrupted file system didn't trip over some corruption
+check, and then the file system was modified via tune2fs or debugfs,
+such that the superblock was marked dirty and then written out via the
+closefs() path, it's possible that the buffer overrun could be
+triggered when the file system is closed.
+
+Also clear up a signed vs unsigned warning while we're at it.
+
+Thanks to Nick Kralevich <nnk@google.com> for asking me to look at
+compiler warning in the code in question, which led me to notice the
+bug in f66e6ce4446.
+
+Addresses: CVE-2015-1572
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+---
+ lib/ext2fs/closefs.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c
+index 1f99113..ab5b2fb 100644
+--- a/lib/ext2fs/closefs.c
++++ b/lib/ext2fs/closefs.c
+@@ -287,7 +287,7 @@ errcode_t ext2fs_flush2(ext2_filsys fs, int flags)
+ 	dgrp_t		j;
+ #endif
+ 	char	*group_ptr;
+-	int	old_desc_blocks;
++	blk64_t	old_desc_blocks;
+ 	struct ext2fs_numeric_progress_struct progress;
+ 
+ 	EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+@@ -346,7 +346,7 @@ errcode_t ext2fs_flush2(ext2_filsys fs, int flags)
+ 	group_ptr = (char *) group_shadow;
+ 	if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) {
+ 		old_desc_blocks = fs->super->s_first_meta_bg;
+-		if (old_desc_blocks > fs->super->s_first_meta_bg)
++		if (old_desc_blocks > fs->desc_blocks)
+ 			old_desc_blocks = fs->desc_blocks;
+ 	} else
+ 		old_desc_blocks = fs->desc_blocks;
+-- 
+2.1.0
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-mke2fs-add-the-ability-to-copy-files-from-a-given-di.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-mke2fs-add-the-ability-to-copy-files-from-a-given-di.patch
new file mode 100644
index 0000000..9ea413e
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0001-mke2fs-add-the-ability-to-copy-files-from-a-given-di.patch
@@ -0,0 +1,98 @@
+From c98fec004f077e566b9dfa20b25e3b86cb462a2e Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 24 Dec 2013 01:41:08 -0500
+Subject: [PATCH 01/11] mke2fs: add the ability to copy files from a given
+ directory
+
+We will add a -d option which will be used for adding the files from a
+given directory to the filesystem, it is similiar to genext2fs, but
+genext2fs doesn't fully support ext4.
+
+* We already have the basic operations in debugfs:
+  - Copy regular file
+  - Create directory
+  - Create symlink
+  - Create special file
+
+  We will move these operations into create_inode.h and create_inode.c,
+  then let both mke2fs and debugfs use them.
+
+* What we need to do are:
+  - Copy the given directory recursively, this will be done by the
+    populate_fs()
+  - Set the owner, mode and other informations
+  - Handle the hard links
+
+TODO:
+  - The libext2fs can't create the socket file (S_IFSOCK), do we have a
+    plan to support it ?
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ misc/create_inode.c |   26 ++++++++++++++++++++++++++
+ misc/create_inode.h |   17 +++++++++++++++++
+ 2 files changed, 43 insertions(+)
+ create mode 100644 misc/create_inode.c
+ create mode 100644 misc/create_inode.h
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+new file mode 100644
+index 0000000..46aaa60
+--- /dev/null
++++ b/misc/create_inode.c
+@@ -0,0 +1,26 @@
++#include "create_inode.h"
++
++/* Make a special file which is block, character and fifo */
++errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st)
++{
++}
++
++/* Make a symlink name -> target */
++errcode_t do_symlink_internal(ext2_ino_t cwd, const char *name, char *target)
++{
++}
++
++/* Make a directory in the fs */
++errcode_t do_mkdir_internal(ext2_ino_t cwd, const char *name, struct stat *st)
++{
++}
++
++/* Copy the native file to the fs */
++errcode_t do_write_internal(ext2_ino_t cwd, const char *src, const char *dest)
++{
++}
++
++/* Copy files from source_dir to fs */
++errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir)
++{
++}
+diff --git a/misc/create_inode.h b/misc/create_inode.h
+new file mode 100644
+index 0000000..9fc97fa
+--- /dev/null
++++ b/misc/create_inode.h
+@@ -0,0 +1,17 @@
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <fcntl.h>
++#include "et/com_err.h"
++#include "e2p/e2p.h"
++#include "ext2fs/ext2fs.h"
++#include "nls-enable.h"
++
++ext2_filsys    current_fs;
++ext2_ino_t     root;
++
++/* For populating the filesystem */
++extern errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir);
++extern errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st);
++extern errcode_t do_symlink_internal(ext2_ino_t cwd, const char *name, char *target);
++extern errcode_t do_mkdir_internal(ext2_ino_t cwd, const char *name, struct stat *st);
++extern errcode_t do_write_internal(ext2_ino_t cwd, const char *src, const char *dest);
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0002-misc-create_inode.c-copy-files-recursively.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0002-misc-create_inode.c-copy-files-recursively.patch
new file mode 100644
index 0000000..9bff644
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0002-misc-create_inode.c-copy-files-recursively.patch
@@ -0,0 +1,135 @@
+From 08dfbaf4e3f704232ff46d78c0758a6cfe3961c8 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 23 Dec 2013 02:59:10 -0500
+Subject: [PATCH 02/11] misc/create_inode.c: copy files recursively
+
+Use opendir() and readdir() to read the native directory, then use
+lstat() to identify the file type and call the corresponding function to
+add the file to the filesystem, call the populate_fs() recursively if it
+is a directory.
+
+NOTE: the libext2fs can't create the socket file.
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ misc/create_inode.c |   97 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 97 insertions(+)
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index 46aaa60..b68b910 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -1,5 +1,13 @@
+ #include "create_inode.h"
+ 
++#if __STDC_VERSION__ < 199901L
++# if __GNUC__ >= 2
++#  define __func__ __FUNCTION__
++# else
++#  define __func__ "<unknown>"
++# endif
++#endif
++
+ /* Make a special file which is block, character and fifo */
+ errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st)
+ {
+@@ -23,4 +31,93 @@ errcode_t do_write_internal(ext2_ino_t cwd, const char *src, const char *dest)
+ /* Copy files from source_dir to fs */
+ errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir)
+ {
++	const char	*name;
++	DIR		*dh;
++	struct dirent	*dent;
++	struct stat	st;
++	char		ln_target[PATH_MAX];
++	ext2_ino_t	ino;
++	errcode_t	retval;
++	int		read_cnt;
++
++	root = EXT2_ROOT_INO;
++
++	if (chdir(source_dir) < 0) {
++		com_err(__func__, errno,
++			_("while changing working directory to \"%s\""), source_dir);
++		return errno;
++	}
++
++	if (!(dh = opendir("."))) {
++		com_err(__func__, errno,
++			_("while openning directory \"%s\""), source_dir);
++		return errno;
++	}
++
++	while((dent = readdir(dh))) {
++		if((!strcmp(dent->d_name, ".")) || (!strcmp(dent->d_name, "..")))
++			continue;
++		lstat(dent->d_name, &st);
++		name = dent->d_name;
++
++		switch(st.st_mode & S_IFMT) {
++			case S_IFCHR:
++			case S_IFBLK:
++			case S_IFIFO:
++				if ((retval = do_mknod_internal(parent_ino, name, &st))) {
++					com_err(__func__, retval,
++						_("while creating special file \"%s\""), name);
++					return retval;
++				}
++				break;
++			case S_IFSOCK:
++				/* FIXME: there is no make socket function atm. */
++				com_err(__func__, 0,
++					_("ignoring socket file \"%s\""), name);
++				continue;
++			case S_IFLNK:
++				if((read_cnt = readlink(name, ln_target, sizeof(ln_target))) == -1) {
++					com_err(__func__, errno,
++						_("while trying to readlink \"%s\""), name);
++					return errno;
++				}
++				ln_target[read_cnt] = '\0';
++				if ((retval = do_symlink_internal(parent_ino, name, ln_target))) {
++					com_err(__func__, retval,
++						_("while writing symlink\"%s\""), name);
++					return retval;
++				}
++				break;
++			case S_IFREG:
++				if ((retval = do_write_internal(parent_ino, name, name))) {
++					com_err(__func__, retval,
++						_("while writing file \"%s\""), name);
++					return retval;
++				}
++				break;
++			case S_IFDIR:
++				if ((retval = do_mkdir_internal(parent_ino, name, &st))) {
++					com_err(__func__, retval,
++						_("while making dir \"%s\""), name);
++					return retval;
++				}
++				if ((retval = ext2fs_namei(current_fs, root, parent_ino, name, &ino))) {
++					com_err(name, retval, 0);
++						return retval;
++				}
++				/* Populate the dir recursively*/
++				retval = populate_fs(ino, name);
++				if (retval) {
++					com_err(__func__, retval, _("while adding dir \"%s\""), name);
++					return retval;
++				}
++				chdir("..");
++				break;
++			default:
++				com_err(__func__, 0,
++					_("ignoring entry \"%s\""), name);
++		}
++	}
++	closedir(dh);
++	return retval;
+ }
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0003-misc-create_inode.c-create-special-file.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0003-misc-create_inode.c-create-special-file.patch
new file mode 100644
index 0000000..3847b6e
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0003-misc-create_inode.c-create-special-file.patch
@@ -0,0 +1,103 @@
+From ae7d33823bfc330e08b25c5fe4d25838ef7c77ce Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 23 Dec 2013 03:13:28 -0500
+Subject: [PATCH 03/11] misc/create_inode.c: create special file
+
+The do_mknod_internal() is used for creating special file which is
+block, character and fifo, most of the code are from debugfs/debugfs.c,
+the debugfs/debugfs.c will be modified to use this function.
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ misc/create_inode.c |   72 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 72 insertions(+)
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index b68b910..4da8aff 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -11,6 +11,78 @@
+ /* Make a special file which is block, character and fifo */
+ errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st)
+ {
++	ext2_ino_t		ino;
++	errcode_t 		retval;
++	struct ext2_inode	inode;
++	unsigned long		major, minor, mode;
++	int			filetype;
++
++	switch(st->st_mode & S_IFMT) {
++		case S_IFCHR:
++			mode = LINUX_S_IFCHR;
++			filetype = EXT2_FT_CHRDEV;
++			break;
++		case S_IFBLK:
++			mode = LINUX_S_IFBLK;
++			filetype =  EXT2_FT_BLKDEV;
++			break;
++		case S_IFIFO:
++			mode = LINUX_S_IFIFO;
++			filetype = EXT2_FT_FIFO;
++			break;
++	}
++
++	if (!(current_fs->flags & EXT2_FLAG_RW)) {
++		com_err(__func__, 0, "Filesystem opened read/only");
++		return -1;
++	}
++	retval = ext2fs_new_inode(current_fs, cwd, 010755, 0, &ino);
++	if (retval) {
++		com_err(__func__, retval, 0);
++		return retval;
++	}
++
++#ifdef DEBUGFS
++	printf("Allocated inode: %u\n", ino);
++#endif
++	retval = ext2fs_link(current_fs, cwd, name, ino, filetype);
++	if (retval == EXT2_ET_DIR_NO_SPACE) {
++		retval = ext2fs_expand_dir(current_fs, cwd);
++		if (retval) {
++			com_err(__func__, retval, "while expanding directory");
++			return retval;
++		}
++		retval = ext2fs_link(current_fs, cwd, name, ino, filetype);
++	}
++	if (retval) {
++		com_err(name, retval, 0);
++		return -1;
++	}
++        if (ext2fs_test_inode_bitmap2(current_fs->inode_map, ino))
++		com_err(__func__, 0, "Warning: inode already set");
++	ext2fs_inode_alloc_stats2(current_fs, ino, +1, 0);
++	memset(&inode, 0, sizeof(inode));
++	inode.i_mode = mode;
++	inode.i_atime = inode.i_ctime = inode.i_mtime =
++		current_fs->now ? current_fs->now : time(0);
++
++	major = major(st->st_rdev);
++	minor = minor(st->st_rdev);
++
++	if ((major < 256) && (minor < 256)) {
++		inode.i_block[0] = major * 256 + minor;
++		inode.i_block[1] = 0;
++	} else {
++		inode.i_block[0] = 0;
++		inode.i_block[1] = (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
++	}
++	inode.i_links_count = 1;
++
++	retval = ext2fs_write_new_inode(current_fs, ino, &inode);
++	if (retval)
++		com_err(__func__, retval, "while creating inode %u", ino);
++
++	return retval;
+ }
+ 
+ /* Make a symlink name -> target */
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0004-misc-create_inode.c-create-symlink.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0004-misc-create_inode.c-create-symlink.patch
new file mode 100644
index 0000000..83d198c
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0004-misc-create_inode.c-create-symlink.patch
@@ -0,0 +1,63 @@
+From 09d3049776882167f7249ee26265b4163d7222c1 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 23 Dec 2013 03:19:55 -0500
+Subject: [PATCH 04/11] misc/create_inode.c: create symlink
+
+The do_symlink_internal() is used for creating symlinks, most of the
+code are from debugfs/debugfs.c, the debugfs/debugfs.c will be modified
+to use this function.
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ misc/create_inode.c |   32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index 4da8aff..f845103 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -88,6 +88,38 @@ errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st)
+ /* Make a symlink name -> target */
+ errcode_t do_symlink_internal(ext2_ino_t cwd, const char *name, char *target)
+ {
++	char			*cp;
++	ext2_ino_t		parent_ino;
++	errcode_t		retval;
++	struct ext2_inode	inode;
++	struct stat		st;
++
++	cp = strrchr(name, '/');
++	if (cp) {
++		*cp = 0;
++		if ((retval =  ext2fs_namei(current_fs, root, cwd, name, &parent_ino))){
++			com_err(name, retval, 0);
++			return retval;
++		}
++		name = cp+1;
++	} else
++		parent_ino = cwd;
++
++try_again:
++	retval = ext2fs_symlink(current_fs, parent_ino, 0, name, target);
++	if (retval == EXT2_ET_DIR_NO_SPACE) {
++		retval = ext2fs_expand_dir(current_fs, parent_ino);
++		if (retval) {
++			com_err("do_symlink_internal", retval, "while expanding directory");
++			return retval;
++		}
++		goto try_again;
++	}
++	if (retval) {
++		com_err("ext2fs_symlink", retval, 0);
++		return retval;
++	}
++
+ }
+ 
+ /* Make a directory in the fs */
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0005-misc-create_inode.c-copy-regular-file.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0005-misc-create_inode.c-copy-regular-file.patch
new file mode 100644
index 0000000..7935cd8
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0005-misc-create_inode.c-copy-regular-file.patch
@@ -0,0 +1,224 @@
+From 2973c74afaa532f3f72639b463322b2523519c20 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 23 Dec 2013 03:28:12 -0500
+Subject: [PATCH 05/11] misc/create_inode.c: copy regular file
+
+The do_write_internal() is used for copying file from native fs to
+target, most of the code are from debugfs/debugfs.c, the
+debugfs/debugfs.c will be modified to use this function.
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ misc/create_inode.c |  183 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 183 insertions(+)
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index f845103..98f4a93 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -8,6 +8,16 @@
+ # endif
+ #endif
+ 
++/* 64KiB is the minimium blksize to best minimize system call overhead. */
++#ifndef IO_BUFSIZE
++#define IO_BUFSIZE 64*1024
++#endif
++
++/* Block size for `st_blocks' */
++#ifndef S_BLKSIZE
++#define S_BLKSIZE 512
++#endif
++
+ /* Make a special file which is block, character and fifo */
+ errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st)
+ {
+@@ -127,9 +137,182 @@ errcode_t do_mkdir_internal(ext2_ino_t cwd, const char *name, struct stat *st)
+ {
+ }
+ 
++static errcode_t copy_file(int fd, ext2_ino_t newfile, int bufsize, int make_holes)
++{
++	ext2_file_t	e2_file;
++	errcode_t	retval;
++	int		got;
++	unsigned int	written;
++	char		*buf;
++	char		*ptr;
++	char		*zero_buf;
++	int		cmp;
++
++	retval = ext2fs_file_open(current_fs, newfile,
++				  EXT2_FILE_WRITE, &e2_file);
++	if (retval)
++		return retval;
++
++	retval = ext2fs_get_mem(bufsize, &buf);
++	if (retval) {
++		com_err("copy_file", retval, "can't allocate buffer\n");
++		return retval;
++	}
++
++	/* This is used for checking whether the whole block is zero */
++	retval = ext2fs_get_memzero(bufsize, &zero_buf);
++	if (retval) {
++		com_err("copy_file", retval, "can't allocate buffer\n");
++		ext2fs_free_mem(&buf);
++		return retval;
++	}
++
++	while (1) {
++		got = read(fd, buf, bufsize);
++		if (got == 0)
++			break;
++		if (got < 0) {
++			retval = errno;
++			goto fail;
++		}
++		ptr = buf;
++
++		/* Sparse copy */
++		if (make_holes) {
++			/* Check whether all is zero */
++			cmp = memcmp(ptr, zero_buf, got);
++			if (cmp == 0) {
++				 /* The whole block is zero, make a hole */
++				retval = ext2fs_file_lseek(e2_file, got, EXT2_SEEK_CUR, NULL);
++				if (retval)
++					goto fail;
++				got = 0;
++			}
++		}
++
++		/* Normal copy */
++		while (got > 0) {
++			retval = ext2fs_file_write(e2_file, ptr,
++						   got, &written);
++			if (retval)
++				goto fail;
++
++			got -= written;
++			ptr += written;
++		}
++	}
++	ext2fs_free_mem(&buf);
++	ext2fs_free_mem(&zero_buf);
++	retval = ext2fs_file_close(e2_file);
++	return retval;
++
++fail:
++	ext2fs_free_mem(&buf);
++	ext2fs_free_mem(&zero_buf);
++	(void) ext2fs_file_close(e2_file);
++	return retval;
++}
++
+ /* Copy the native file to the fs */
+ errcode_t do_write_internal(ext2_ino_t cwd, const char *src, const char *dest)
+ {
++	int		fd;
++	struct stat	statbuf;
++	ext2_ino_t	newfile;
++	errcode_t	retval;
++	struct ext2_inode inode;
++	int		bufsize = IO_BUFSIZE;
++	int		make_holes = 0;
++
++	fd = open(src, O_RDONLY);
++	if (fd < 0) {
++		com_err(src, errno, 0);
++		return errno;
++	}
++	if (fstat(fd, &statbuf) < 0) {
++		com_err(src, errno, 0);
++		close(fd);
++		return errno;
++	}
++
++	retval = ext2fs_namei(current_fs, root, cwd, dest, &newfile);
++	if (retval == 0) {
++		com_err(__func__, 0, "The file '%s' already exists\n", dest);
++		close(fd);
++		return retval;
++	}
++
++	retval = ext2fs_new_inode(current_fs, cwd, 010755, 0, &newfile);
++	if (retval) {
++		com_err(__func__, retval, 0);
++		close(fd);
++		return retval;
++	}
++#ifdef DEBUGFS
++	printf("Allocated inode: %u\n", newfile);
++#endif
++	retval = ext2fs_link(current_fs, cwd, dest, newfile,
++				EXT2_FT_REG_FILE);
++	if (retval == EXT2_ET_DIR_NO_SPACE) {
++		retval = ext2fs_expand_dir(current_fs, cwd);
++		if (retval) {
++			com_err(__func__, retval, "while expanding directory");
++			close(fd);
++			return retval;
++		}
++		retval = ext2fs_link(current_fs, cwd, dest, newfile,
++					EXT2_FT_REG_FILE);
++	}
++	if (retval) {
++		com_err(dest, retval, 0);
++		close(fd);
++		return retval;
++	}
++        if (ext2fs_test_inode_bitmap2(current_fs->inode_map, newfile))
++		com_err(__func__, 0, "Warning: inode already set");
++	ext2fs_inode_alloc_stats2(current_fs, newfile, +1, 0);
++	memset(&inode, 0, sizeof(inode));
++	inode.i_mode = (statbuf.st_mode & ~LINUX_S_IFMT) | LINUX_S_IFREG;
++	inode.i_atime = inode.i_ctime = inode.i_mtime =
++		current_fs->now ? current_fs->now : time(0);
++	inode.i_links_count = 1;
++	inode.i_size = statbuf.st_size;
++	if (current_fs->super->s_feature_incompat &
++	    EXT3_FEATURE_INCOMPAT_EXTENTS) {
++		int i;
++		struct ext3_extent_header *eh;
++
++		eh = (struct ext3_extent_header *) &inode.i_block[0];
++		eh->eh_depth = 0;
++		eh->eh_entries = 0;
++		eh->eh_magic = ext2fs_cpu_to_le16(EXT3_EXT_MAGIC);
++		i = (sizeof(inode.i_block) - sizeof(*eh)) /
++			sizeof(struct ext3_extent);
++		eh->eh_max = ext2fs_cpu_to_le16(i);
++		inode.i_flags |= EXT4_EXTENTS_FL;
++	}
++
++	if ((retval = ext2fs_write_new_inode(current_fs, newfile, &inode))) {
++		com_err(__func__, retval, "while creating inode %u", newfile);
++		close(fd);
++		return retval;
++	}
++	if (LINUX_S_ISREG(inode.i_mode)) {
++		if (statbuf.st_blocks < statbuf.st_size / S_BLKSIZE) {
++			make_holes = 1;
++			/*
++			 * Use I/O blocksize as buffer size when
++			 * copying sparse files.
++			 */
++			bufsize = statbuf.st_blksize;
++		}
++		retval = copy_file(fd, newfile, bufsize, make_holes);
++		if (retval)
++			com_err("copy_file", retval, 0);
++	}
++	close(fd);
++
++	return 0;
+ }
+ 
+ /* Copy files from source_dir to fs */
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0006-misc-create_inode.c-create-directory.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0006-misc-create_inode.c-create-directory.patch
new file mode 100644
index 0000000..5c7ca9c
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0006-misc-create_inode.c-create-directory.patch
@@ -0,0 +1,62 @@
+From c8d1c43be24489036137f8fdebcfccc208f7cc8b Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 23 Dec 2013 03:34:14 -0500
+Subject: [PATCH 06/11] misc/create_inode.c: create directory
+
+The do_mkdir_internal() is used for making dir on the target fs, most of
+the code are from debugfs/debugfs.c, the debugfs/debugfs.c will be
+modified to use this function.
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ misc/create_inode.c |   31 +++++++++++++++++++++++++++++++
+ 1 file changed, 31 insertions(+)
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index 98f4a93..6a8c92a 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -135,6 +135,37 @@ try_again:
+ /* Make a directory in the fs */
+ errcode_t do_mkdir_internal(ext2_ino_t cwd, const char *name, struct stat *st)
+ {
++	char			*cp;
++	ext2_ino_t		parent_ino, ino;
++	errcode_t		retval;
++	struct ext2_inode	inode;
++
++
++	cp = strrchr(name, '/');
++	if (cp) {
++		*cp = 0;
++		if ((retval =  ext2fs_namei(current_fs, root, cwd, name, &parent_ino))){
++			com_err(name, retval, 0);
++			return retval;
++		}
++		name = cp+1;
++	} else
++		parent_ino = cwd;
++
++try_again:
++	retval = ext2fs_mkdir(current_fs, parent_ino, 0, name);
++	if (retval == EXT2_ET_DIR_NO_SPACE) {
++		retval = ext2fs_expand_dir(current_fs, parent_ino);
++		if (retval) {
++			com_err(__func__, retval, "while expanding directory");
++			return retval;
++		}
++		goto try_again;
++	}
++	if (retval) {
++		com_err("ext2fs_mkdir", retval, 0);
++		return retval;
++	}
+ }
+ 
+ static errcode_t copy_file(int fd, ext2_ino_t newfile, int bufsize, int make_holes)
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0007-misc-create_inode.c-set-owner-mode-time-for-the-inod.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0007-misc-create_inode.c-set-owner-mode-time-for-the-inod.patch
new file mode 100644
index 0000000..f296393
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0007-misc-create_inode.c-set-owner-mode-time-for-the-inod.patch
@@ -0,0 +1,81 @@
+From 2b1f6e6b386703a5d7e60b7d8b72746f3d31a8bc Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 23 Dec 2013 03:39:56 -0500
+Subject: [PATCH 07/11] misc/create_inode.c: set owner/mode/time for the inode
+
+Set the uid, gid, mode and time for inode.
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ misc/create_inode.c |   45 +++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 45 insertions(+)
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index 6a8c92a..aad7354 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -18,6 +18,40 @@
+ #define S_BLKSIZE 512
+ #endif
+ 
++/* Fill the uid, gid, mode and time for the inode */
++static void fill_inode(struct ext2_inode *inode, struct stat *st)
++{
++	if (st != NULL) {
++		inode->i_uid = st->st_uid;
++		inode->i_gid = st->st_gid;
++		inode->i_mode |= st->st_mode;
++		inode->i_atime = st->st_atime;
++		inode->i_mtime = st->st_mtime;
++		inode->i_ctime = st->st_ctime;
++	}
++}
++
++/* Set the uid, gid, mode and time for the inode */
++errcode_t set_inode_extra(ext2_ino_t cwd, ext2_ino_t ino, struct stat *st)
++{
++	errcode_t		retval;
++	struct ext2_inode	inode;
++
++	retval = ext2fs_read_inode(current_fs, ino, &inode);
++        if (retval) {
++		com_err(__func__, retval, "while reading inode %u", ino);
++		return retval;
++	}
++
++	fill_inode(&inode, st);
++
++	retval = ext2fs_write_inode(current_fs, ino, &inode);
++	if (retval) {
++		com_err(__func__, retval, "while writing inode %u", ino);
++		return retval;
++	}
++}
++
+ /* Make a special file which is block, character and fifo */
+ errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st)
+ {
+@@ -435,6 +469,17 @@ errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir)
+ 				com_err(__func__, 0,
+ 					_("ignoring entry \"%s\""), name);
+ 		}
++
++		if ((retval =  ext2fs_namei(current_fs, root, parent_ino, name, &ino))){
++			com_err(name, retval, 0);
++			return retval;
++		}
++
++		if ((retval = set_inode_extra(parent_ino, ino, &st))) {
++			com_err(__func__, retval,
++				_("while setting inode for \"%s\""), name);
++			return retval;
++		}
+ 	}
+ 	closedir(dh);
+ 	return retval;
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0008-mke2fs.c-add-an-option-d-root-directory.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0008-mke2fs.c-add-an-option-d-root-directory.patch
new file mode 100644
index 0000000..1f98673
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0008-mke2fs.c-add-an-option-d-root-directory.patch
@@ -0,0 +1,168 @@
+From df856929e42bd4f3bdc8d4f59ee82ae8b28532e6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 24 Dec 2013 01:50:45 -0500
+Subject: [PATCH 08/11] mke2fs.c: add an option: -d root-directory
+
+This option is used for adding the files from a given directory (the
+root-directory) to the filesystem, it is similiar to genext2fs, but
+genext2fs doesn't fully support ext4.
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ misc/Makefile.in |   14 ++++++++++----
+ misc/mke2fs.c    |   32 +++++++++++++++++++++++---------
+ 2 files changed, 33 insertions(+), 13 deletions(-)
+
+diff --git a/misc/Makefile.in b/misc/Makefile.in
+index 553c361..8253723 100644
+--- a/misc/Makefile.in
++++ b/misc/Makefile.in
+@@ -42,7 +42,8 @@ LPROGS=		@E2INITRD_PROG@
+ 
+ TUNE2FS_OBJS=	tune2fs.o util.o
+ MKLPF_OBJS=	mklost+found.o
+-MKE2FS_OBJS=	mke2fs.o util.o profile.o prof_err.o default_profile.o
++MKE2FS_OBJS=	mke2fs.o util.o profile.o prof_err.o default_profile.o \
++			create_inode.o
+ CHATTR_OBJS=	chattr.o
+ LSATTR_OBJS=	lsattr.o
+ UUIDGEN_OBJS=	uuidgen.o
+@@ -60,7 +61,8 @@ E2FREEFRAG_OBJS= e2freefrag.o
+ PROFILED_TUNE2FS_OBJS=	profiled/tune2fs.o profiled/util.o
+ PROFILED_MKLPF_OBJS=	profiled/mklost+found.o
+ PROFILED_MKE2FS_OBJS=	profiled/mke2fs.o profiled/util.o profiled/profile.o \
+-			profiled/prof_err.o profiled/default_profile.o
++			profiled/prof_err.o profiled/default_profile.o \
++			profiled/create_inode.o
+ PROFILED_CHATTR_OBJS=	profiled/chattr.o
+ PROFILED_LSATTR_OBJS=	profiled/lsattr.o
+ PROFILED_UUIDGEN_OBJS=	profiled/uuidgen.o
+@@ -82,7 +84,7 @@ SRCS=	$(srcdir)/tune2fs.c $(srcdir)/mklost+found.c $(srcdir)/mke2fs.c \
+ 		$(srcdir)/uuidgen.c $(srcdir)/blkid.c $(srcdir)/logsave.c \
+ 		$(srcdir)/filefrag.c $(srcdir)/base_device.c \
+ 		$(srcdir)/ismounted.c $(srcdir)/../e2fsck/profile.c \
+-		$(srcdir)/e2undo.c $(srcdir)/e2freefrag.c
++		$(srcdir)/e2undo.c $(srcdir)/e2freefrag.c $(srcdir)/create_inode.c
+ 
+ LIBS= $(LIBEXT2FS) $(LIBCOM_ERR) 
+ DEPLIBS= $(LIBEXT2FS) $(DEPLIBCOM_ERR)
+@@ -630,7 +632,7 @@ mke2fs.o: $(srcdir)/mke2fs.c $(top_builddir)/lib/config.h \
+  $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
+  $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
+  $(srcdir)/util.h profile.h prof_err.h $(top_srcdir)/version.h \
+- $(srcdir)/nls-enable.h $(top_srcdir)/lib/quota/mkquota.h \
++ $(srcdir)/nls-enable.h $(top_srcdir)/lib/quota/mkquota.h $(srcdir)/create_inode.h\
+  $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+  $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ chattr.o: $(srcdir)/chattr.c $(top_builddir)/lib/config.h \
+@@ -710,3 +712,7 @@ e2freefrag.o: $(srcdir)/e2freefrag.c $(top_builddir)/lib/config.h \
+  $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
+  $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
+  $(srcdir)/e2freefrag.h
++create_inode.o: $(srcdir)/create_inode.h $(srcdir)/create_inode.c \
++ $(top_builddir)/lib/config.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
++ $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/e2p/e2p.h \
++ $(srcdir)/nls-enable.h
+diff --git a/misc/mke2fs.c b/misc/mke2fs.c
+index 2e8ba60..578b62d 100644
+--- a/misc/mke2fs.c
++++ b/misc/mke2fs.c
+@@ -22,7 +22,6 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <strings.h>
+-#include <fcntl.h>
+ #include <ctype.h>
+ #include <time.h>
+ #ifdef __linux__
+@@ -44,24 +43,19 @@ extern int optind;
+ #include <errno.h>
+ #endif
+ #include <sys/ioctl.h>
+-#include <sys/types.h>
+-#include <sys/stat.h>
+ #include <libgen.h>
+ #include <limits.h>
+ #include <blkid/blkid.h>
+ 
+ #include "ext2fs/ext2_fs.h"
+ #include "ext2fs/ext2fsP.h"
+-#include "et/com_err.h"
+ #include "uuid/uuid.h"
+-#include "e2p/e2p.h"
+-#include "ext2fs/ext2fs.h"
+ #include "util.h"
+ #include "profile.h"
+ #include "prof_err.h"
+ #include "../version.h"
+-#include "nls-enable.h"
+ #include "quota/mkquota.h"
++#include "create_inode.h"
+ 
+ #define STRIDE_LENGTH 8
+ 
+@@ -105,6 +99,7 @@ static char *mount_dir;
+ char *journal_device;
+ static int sync_kludge;	/* Set using the MKE2FS_SYNC env. option */
+ static char **fs_types;
++const char *root_dir;  /* Copy files from the specified directory */
+ 
+ static profile_t	profile;
+ 
+@@ -116,7 +111,8 @@ static void usage(void)
+ 	fprintf(stderr, _("Usage: %s [-c|-l filename] [-b block-size] "
+ 	"[-C cluster-size]\n\t[-i bytes-per-inode] [-I inode-size] "
+ 	"[-J journal-options]\n"
+-	"\t[-G flex-group-size] [-N number-of-inodes]\n"
++	"\t[-G flex-group-size] [-N number-of-inodes] "
++	"[-d root-directory]\n"
+ 	"\t[-m reserved-blocks-percentage] [-o creator-os]\n"
+ 	"\t[-g blocks-per-group] [-L volume-label] "
+ 	"[-M last-mounted-directory]\n\t[-O feature[,...]] "
+@@ -1394,7 +1390,7 @@ profile_error:
+ 	}
+ 
+ 	while ((c = getopt (argc, argv,
+-		    "b:cg:i:jl:m:no:qr:s:t:vC:DE:FG:I:J:KL:M:N:O:R:ST:U:V")) != EOF) {
++		    "b:cg:i:jl:m:no:qr:s:t:d:vC:DE:FG:I:J:KL:M:N:O:R:ST:U:V")) != EOF) {
+ 		switch (c) {
+ 		case 'b':
+ 			blocksize = parse_num_blocks2(optarg, -1);
+@@ -1582,6 +1578,9 @@ profile_error:
+ 		case 'U':
+ 			fs_uuid = optarg;
+ 			break;
++		case 'd':
++			root_dir = optarg;
++			break;
+ 		case 'v':
+ 			verbose = 1;
+ 			break;
+@@ -2726,6 +2725,21 @@ no_journal:
+ 				       EXT4_FEATURE_RO_COMPAT_QUOTA))
+ 		create_quota_inodes(fs);
+ 
++	/* Copy files from the specified directory */
++	if (root_dir) {
++		if (!quiet)
++			printf("%s", _("Copying files into the device: "));
++
++		current_fs = fs;
++		root = EXT2_ROOT_INO;
++		retval = populate_fs(root, root_dir);
++		if (retval)
++			fprintf(stderr, "%s",
++				_("\nError while populating file system"));
++		else if (!quiet)
++			printf("%s", _("done\n"));
++	}
++
+ 	if (!quiet)
+ 		printf("%s", _("Writing superblocks and "
+ 		       "filesystem accounting information: "));
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0009-misc-create_inode.c-handle-hardlinks.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0009-misc-create_inode.c-handle-hardlinks.patch
new file mode 100644
index 0000000..a330ee4
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0009-misc-create_inode.c-handle-hardlinks.patch
@@ -0,0 +1,210 @@
+From d83dc950b3ec1fbde33b23d42c5154091a74f4d9 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 23 Dec 2013 03:44:03 -0500
+Subject: [PATCH 09/11] misc/create_inode.c: handle hardlinks
+
+Create the inode and save the native inode number when we meet the hard
+link (st_nlink > 1) at the first time, use ext2fs_link() to link the
+name to the target inode number when we meet the same native inode
+number again.
+
+This algorithm is referred from the genext2fs.
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ misc/create_inode.c |   88 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ misc/create_inode.h |   18 +++++++++++
+ misc/mke2fs.c       |   12 +++++++
+ 3 files changed, 118 insertions(+)
+
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index aad7354..763504d 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -18,6 +18,44 @@
+ #define S_BLKSIZE 512
+ #endif
+ 
++/* For saving the hard links */
++int hdlink_cnt = HDLINK_CNT;
++
++/* Link an inode number to a directory */
++static errcode_t add_link(ext2_ino_t parent_ino, ext2_ino_t ino, const char *name)
++{
++	struct ext2_inode	inode;
++	errcode_t		retval;
++
++	retval = ext2fs_read_inode(current_fs, ino, &inode);
++        if (retval) {
++		com_err(__func__, retval, "while reading inode %u", ino);
++		return retval;
++	}
++
++	retval = ext2fs_link(current_fs, parent_ino, name, ino, inode.i_flags);
++	if (retval == EXT2_ET_DIR_NO_SPACE) {
++		retval = ext2fs_expand_dir(current_fs, parent_ino);
++		if (retval) {
++			com_err(__func__, retval, "while expanding directory");
++			return retval;
++		}
++		retval = ext2fs_link(current_fs, parent_ino, name, ino, inode.i_flags);
++	}
++	if (retval) {
++		com_err(__func__, retval, "while linking %s", name);
++		return retval;
++	}
++
++	inode.i_links_count++;
++
++	retval = ext2fs_write_inode(current_fs, ino, &inode);
++	if (retval)
++		com_err(__func__, retval, "while writing inode %u", ino);
++
++	return retval;
++}
++
+ /* Fill the uid, gid, mode and time for the inode */
+ static void fill_inode(struct ext2_inode *inode, struct stat *st)
+ {
+@@ -278,6 +316,17 @@ fail:
+ 	return retval;
+ }
+ 
++int is_hardlink(ext2_ino_t ino)
++{
++	int i;
++
++	for(i = 0; i < hdlinks.count; i++) {
++		if(hdlinks.hdl[i].src_ino == ino)
++			return i;
++	}
++	return -1;
++}
++
+ /* Copy the native file to the fs */
+ errcode_t do_write_internal(ext2_ino_t cwd, const char *src, const char *dest)
+ {
+@@ -388,9 +437,11 @@ errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir)
+ 	struct dirent	*dent;
+ 	struct stat	st;
+ 	char		ln_target[PATH_MAX];
++	unsigned int	save_inode;
+ 	ext2_ino_t	ino;
+ 	errcode_t	retval;
+ 	int		read_cnt;
++	int		hdlink;
+ 
+ 	root = EXT2_ROOT_INO;
+ 
+@@ -412,6 +463,22 @@ errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir)
+ 		lstat(dent->d_name, &st);
+ 		name = dent->d_name;
+ 
++		/* Check for hardlinks */
++		save_inode = 0;
++		if (!S_ISDIR(st.st_mode) && !S_ISLNK(st.st_mode) && st.st_nlink > 1) {
++			hdlink = is_hardlink(st.st_ino);
++			if (hdlink >= 0) {
++				retval = add_link(parent_ino,
++						hdlinks.hdl[hdlink].dst_ino, name);
++				if (retval) {
++					com_err(__func__, retval, "while linking %s", name);
++					return retval;
++				}
++				continue;
++			} else
++				save_inode = 1;
++		}
++
+ 		switch(st.st_mode & S_IFMT) {
+ 			case S_IFCHR:
+ 			case S_IFBLK:
+@@ -480,6 +547,27 @@ errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir)
+ 				_("while setting inode for \"%s\""), name);
+ 			return retval;
+ 		}
++
++		/* Save the hardlink ino */
++		if (save_inode) {
++			/*
++			 * Check whether need more memory, and we don't need
++			 * free() since the lifespan will be over after the fs
++			 * populated.
++			 */
++			if (hdlinks.count == hdlink_cnt) {
++				if ((hdlinks.hdl = realloc (hdlinks.hdl,
++						(hdlink_cnt + HDLINK_CNT) *
++						sizeof (struct hdlink_s))) == NULL) {
++					com_err(name, errno, "Not enough memory");
++					return errno;
++				}
++				hdlink_cnt += HDLINK_CNT;
++			}
++			hdlinks.hdl[hdlinks.count].src_ino = st.st_ino;
++			hdlinks.hdl[hdlinks.count].dst_ino = ino;
++			hdlinks.count++;
++		}
+ 	}
+ 	closedir(dh);
+ 	return retval;
+diff --git a/misc/create_inode.h b/misc/create_inode.h
+index 9fc97fa..2b6d429 100644
+--- a/misc/create_inode.h
++++ b/misc/create_inode.h
+@@ -6,9 +6,27 @@
+ #include "ext2fs/ext2fs.h"
+ #include "nls-enable.h"
+ 
++struct hdlink_s
++{
++	ext2_ino_t src_ino;
++	ext2_ino_t dst_ino;
++};
++
++struct hdlinks_s
++{
++	int count;
++	struct hdlink_s *hdl;
++};
++
++struct hdlinks_s hdlinks;
++
+ ext2_filsys    current_fs;
+ ext2_ino_t     root;
+ 
++/* For saving the hard links */
++#define HDLINK_CNT     4
++extern int hdlink_cnt;
++
+ /* For populating the filesystem */
+ extern errcode_t populate_fs(ext2_ino_t parent_ino, const char *source_dir);
+ extern errcode_t do_mknod_internal(ext2_ino_t cwd, const char *name, struct stat *st);
+diff --git a/misc/mke2fs.c b/misc/mke2fs.c
+index 578b62d..a63f0b7 100644
+--- a/misc/mke2fs.c
++++ b/misc/mke2fs.c
+@@ -2730,6 +2730,18 @@ no_journal:
+ 		if (!quiet)
+ 			printf("%s", _("Copying files into the device: "));
+ 
++		/*
++		 * Allocate memory for the hardlinks, we don't need free()
++		 * since the lifespan will be over after the fs populated.
++		 */
++		if ((hdlinks.hdl = (struct hdlink_s *)
++				malloc(hdlink_cnt * sizeof(struct hdlink_s))) == NULL) {
++			fprintf(stderr, "%s", _("\nNot enough memory\n"));
++			retval = ext2fs_close(fs);
++			return retval;
++		}
++
++		hdlinks.count = 0;
+ 		current_fs = fs;
+ 		root = EXT2_ROOT_INO;
+ 		retval = populate_fs(root, root_dir);
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0010-debugfs-use-the-functions-in-misc-create_inode.c.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0010-debugfs-use-the-functions-in-misc-create_inode.c.patch
new file mode 100644
index 0000000..2a6ca8f
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0010-debugfs-use-the-functions-in-misc-create_inode.c.patch
@@ -0,0 +1,496 @@
+From db89992fab2215f52dce4c595a39271b4ff3000b Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 23 Dec 2013 04:22:22 -0500
+Subject: [PATCH 10/11] debugfs: use the functions in misc/create_inode.c
+
+* Use the functions in misc/create_inode.c, and remove the duplicated
+  code.
+
+* The CREATE_INODE_DEPS in the debugfs/Makefile.in is used for recording
+  create_inode.o's depends which is from misc/Makefile.in, we have to
+  recompile create_inode.o because we need it to print more messages when
+  it is used by debugfs, just like we recompile e2freefrag.o, but it seems
+  that the e2freefrag.o's depends in debugfs/Makefile.in is incorrect, it
+  would not rebuild when its depends (e.g.: lib/config.h) is changed,
+  which would cause unexpected errors. Make duplicated code in
+  debugfs/Makefile.in and misc/Makefile.in is not a good idea, maybe we'd
+  better define CREATE_INODE_DEPS in the top Makefile, I'd like to send
+  another patch and fix the e2freefrag if you are fine with it.
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ debugfs/Makefile.in |   17 ++-
+ debugfs/debugfs.c   |  305 +++------------------------------------------------
+ debugfs/debugfs.h   |    1 +
+ 3 files changed, 31 insertions(+), 292 deletions(-)
+
+diff --git a/debugfs/Makefile.in b/debugfs/Makefile.in
+index bf037e0..f51b78e 100644
+--- a/debugfs/Makefile.in
++++ b/debugfs/Makefile.in
+@@ -18,7 +18,7 @@ MK_CMDS=	_SS_DIR_OVERRIDE=../lib/ss ../lib/ss/mk_cmds
+ 
+ DEBUG_OBJS= debug_cmds.o debugfs.o util.o ncheck.o icheck.o ls.o \
+ 	lsdel.o dump.o set_fields.o logdump.o htree.o unused.o e2freefrag.o \
+-	filefrag.o extent_cmds.o extent_inode.o zap.o
++	filefrag.o extent_cmds.o extent_inode.o zap.o create_inode.o
+ 
+ RO_DEBUG_OBJS= ro_debug_cmds.o ro_debugfs.o util.o ncheck.o icheck.o ls.o \
+ 	lsdel.o logdump.o htree.o e2freefrag.o filefrag.o extent_cmds.o \
+@@ -28,7 +28,13 @@ SRCS= debug_cmds.c $(srcdir)/debugfs.c $(srcdir)/util.c $(srcdir)/ls.c \
+ 	$(srcdir)/ncheck.c $(srcdir)/icheck.c $(srcdir)/lsdel.c \
+ 	$(srcdir)/dump.c $(srcdir)/set_fields.c ${srcdir}/logdump.c \
+ 	$(srcdir)/htree.c $(srcdir)/unused.c ${srcdir}/../misc/e2freefrag.c \
+-	$(srcdir)/filefrag.c $(srcdir)/extent_inode.c $(srcdir)/zap.c
++	$(srcdir)/filefrag.c $(srcdir)/extent_inode.c $(srcdir)/zap.c \
++	$(srcdir)/../misc/create_inode.c
++
++CREATE_INODE_DEPS= $(srcdir)/../misc/create_inode.h \
++	$(srcdir)/../misc/create_inode.c $(top_builddir)/lib/config.h \
++	$(srcdir)/../lib/ext2fs/ext2fs.h $(srcdir)/../lib/et/com_err.h \
++	$(srcdir)/../lib/e2p/e2p.h $(srcdir)/../misc/nls-enable.h
+ 
+ LIBS= $(LIBEXT2FS) $(LIBE2P) $(LIBSS) $(LIBCOM_ERR) $(LIBBLKID) \
+ 	$(LIBUUID)
+@@ -81,6 +87,11 @@ e2freefrag.o: $(srcdir)/../misc/e2freefrag.c
+ 	$(E) "	CC $@"
+ 	$(Q) $(CC) -c $(ALL_CFLAGS) -I$(srcdir) $< -DDEBUGFS -o $@
+ 
++create_inode.o: $(CREATE_INODE_DEPS)
++	$(E) "	CC $@"
++	$(Q) $(CC) -c $(ALL_CFLAGS) -I$(srcdir) \
++		 $(srcdir)/../misc/create_inode.c -DDEBUGFS -o $@
++
+ debugfs.8: $(DEP_SUBSTITUTE) $(srcdir)/debugfs.8.in
+ 	$(E) "	SUBST $@"
+ 	$(Q) $(SUBSTITUTE_UPTIME) $(srcdir)/debugfs.8.in debugfs.8
+@@ -142,7 +153,7 @@ debugfs.o: $(srcdir)/debugfs.c $(top_srcdir)/lib/et/com_err.h \
+  $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
+  $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/version.h $(srcdir)/jfs_user.h \
+  $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
+- $(top_srcdir)/lib/ext2fs/kernel-list.h
++ $(top_srcdir)/lib/ext2fs/kernel-list.h $(top_srcdir)/misc/util.h
+ util.o: $(srcdir)/util.c $(srcdir)/debugfs.h \
+  $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+  $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
+index 9c215f7..62e9f44 100644
+--- a/debugfs/debugfs.c
++++ b/debugfs/debugfs.c
+@@ -25,8 +25,6 @@ extern char *optarg;
+ #include <errno.h>
+ #endif
+ #include <fcntl.h>
+-#include <sys/types.h>
+-#include <sys/stat.h>
+ 
+ #include "debugfs.h"
+ #include "uuid/uuid.h"
+@@ -41,22 +39,11 @@ extern char *optarg;
+ #define BUFSIZ 8192
+ #endif
+ 
+-/* 64KiB is the minimium blksize to best minimize system call overhead. */
+-#ifndef IO_BUFSIZE
+-#define IO_BUFSIZE 64*1024
+-#endif
+-
+-/* Block size for `st_blocks' */
+-#ifndef S_BLKSIZE
+-#define S_BLKSIZE 512
+-#endif
+-
+ ss_request_table *extra_cmds;
+ const char *debug_prog_name;
+ int sci_idx;
+ 
+-ext2_filsys	current_fs = NULL;
+-ext2_ino_t	root, cwd;
++ext2_ino_t	cwd;
+ 
+ static void open_filesystem(char *device, int open_flags, blk64_t superblock,
+ 			    blk64_t blocksize, int catastrophic,
+@@ -1576,189 +1563,24 @@ void do_find_free_inode(int argc, char *argv[])
+ }
+ 
+ #ifndef READ_ONLY
+-static errcode_t copy_file(int fd, ext2_ino_t newfile, int bufsize, int make_holes)
+-{
+-	ext2_file_t	e2_file;
+-	errcode_t	retval;
+-	int		got;
+-	unsigned int	written;
+-	char		*buf;
+-	char		*ptr;
+-	char		*zero_buf;
+-	int		cmp;
+-
+-	retval = ext2fs_file_open(current_fs, newfile,
+-				  EXT2_FILE_WRITE, &e2_file);
+-	if (retval)
+-		return retval;
+-
+-	retval = ext2fs_get_mem(bufsize, &buf);
+-	if (retval) {
+-		com_err("copy_file", retval, "can't allocate buffer\n");
+-		return retval;
+-	}
+-
+-	/* This is used for checking whether the whole block is zero */
+-	retval = ext2fs_get_memzero(bufsize, &zero_buf);
+-	if (retval) {
+-		com_err("copy_file", retval, "can't allocate buffer\n");
+-		ext2fs_free_mem(&buf);
+-		return retval;
+-	}
+-
+-	while (1) {
+-		got = read(fd, buf, bufsize);
+-		if (got == 0)
+-			break;
+-		if (got < 0) {
+-			retval = errno;
+-			goto fail;
+-		}
+-		ptr = buf;
+-
+-		/* Sparse copy */
+-		if (make_holes) {
+-			/* Check whether all is zero */
+-			cmp = memcmp(ptr, zero_buf, got);
+-			if (cmp == 0) {
+-				 /* The whole block is zero, make a hole */
+-				retval = ext2fs_file_lseek(e2_file, got, EXT2_SEEK_CUR, NULL);
+-				if (retval)
+-					goto fail;
+-				got = 0;
+-			}
+-		}
+-
+-		/* Normal copy */
+-		while (got > 0) {
+-			retval = ext2fs_file_write(e2_file, ptr,
+-						   got, &written);
+-			if (retval)
+-				goto fail;
+-
+-			got -= written;
+-			ptr += written;
+-		}
+-	}
+-	ext2fs_free_mem(&buf);
+-	ext2fs_free_mem(&zero_buf);
+-	retval = ext2fs_file_close(e2_file);
+-	return retval;
+-
+-fail:
+-	ext2fs_free_mem(&buf);
+-	ext2fs_free_mem(&zero_buf);
+-	(void) ext2fs_file_close(e2_file);
+-	return retval;
+-}
+-
+-
+ void do_write(int argc, char *argv[])
+ {
+-	int		fd;
+-	struct stat	statbuf;
+-	ext2_ino_t	newfile;
+ 	errcode_t	retval;
+-	struct ext2_inode inode;
+-	int		bufsize = IO_BUFSIZE;
+-	int		make_holes = 0;
+ 
+ 	if (common_args_process(argc, argv, 3, 3, "write",
+ 				"<native file> <new file>", CHECK_FS_RW))
+ 		return;
+ 
+-	fd = open(argv[1], O_RDONLY);
+-	if (fd < 0) {
+-		com_err(argv[1], errno, 0);
+-		return;
+-	}
+-	if (fstat(fd, &statbuf) < 0) {
+-		com_err(argv[1], errno, 0);
+-		close(fd);
+-		return;
+-	}
+-
+-	retval = ext2fs_namei(current_fs, root, cwd, argv[2], &newfile);
+-	if (retval == 0) {
+-		com_err(argv[0], 0, "The file '%s' already exists\n", argv[2]);
+-		close(fd);
+-		return;
+-	}
+-
+-	retval = ext2fs_new_inode(current_fs, cwd, 010755, 0, &newfile);
+-	if (retval) {
++	if ((retval = do_write_internal(cwd, argv[1], argv[2])))
+ 		com_err(argv[0], retval, 0);
+-		close(fd);
+-		return;
+-	}
+-	printf("Allocated inode: %u\n", newfile);
+-	retval = ext2fs_link(current_fs, cwd, argv[2], newfile,
+-			     EXT2_FT_REG_FILE);
+-	if (retval == EXT2_ET_DIR_NO_SPACE) {
+-		retval = ext2fs_expand_dir(current_fs, cwd);
+-		if (retval) {
+-			com_err(argv[0], retval, "while expanding directory");
+-			close(fd);
+-			return;
+-		}
+-		retval = ext2fs_link(current_fs, cwd, argv[2], newfile,
+-				     EXT2_FT_REG_FILE);
+-	}
+-	if (retval) {
+-		com_err(argv[2], retval, 0);
+-		close(fd);
+-		return;
+-	}
+-        if (ext2fs_test_inode_bitmap2(current_fs->inode_map,newfile))
+-		com_err(argv[0], 0, "Warning: inode already set");
+-	ext2fs_inode_alloc_stats2(current_fs, newfile, +1, 0);
+-	memset(&inode, 0, sizeof(inode));
+-	inode.i_mode = (statbuf.st_mode & ~LINUX_S_IFMT) | LINUX_S_IFREG;
+-	inode.i_atime = inode.i_ctime = inode.i_mtime =
+-		current_fs->now ? current_fs->now : time(0);
+-	inode.i_links_count = 1;
+-	inode.i_size = statbuf.st_size;
+-	if (current_fs->super->s_feature_incompat &
+-	    EXT3_FEATURE_INCOMPAT_EXTENTS) {
+-		int i;
+-		struct ext3_extent_header *eh;
+-
+-		eh = (struct ext3_extent_header *) &inode.i_block[0];
+-		eh->eh_depth = 0;
+-		eh->eh_entries = 0;
+-		eh->eh_magic = ext2fs_cpu_to_le16(EXT3_EXT_MAGIC);
+-		i = (sizeof(inode.i_block) - sizeof(*eh)) /
+-			sizeof(struct ext3_extent);
+-		eh->eh_max = ext2fs_cpu_to_le16(i);
+-		inode.i_flags |= EXT4_EXTENTS_FL;
+-	}
+-	if (debugfs_write_new_inode(newfile, &inode, argv[0])) {
+-		close(fd);
+-		return;
+-	}
+-	if (LINUX_S_ISREG(inode.i_mode)) {
+-		if (statbuf.st_blocks < statbuf.st_size / S_BLKSIZE) {
+-			make_holes = 1;
+-			/*
+-			 * Use I/O blocksize as buffer size when
+-			 * copying sparse files.
+-			 */
+-			bufsize = statbuf.st_blksize;
+-		}
+-		retval = copy_file(fd, newfile, bufsize, make_holes);
+-		if (retval)
+-			com_err("copy_file", retval, 0);
+-	}
+-	close(fd);
+ }
+ 
+ void do_mknod(int argc, char *argv[])
+ {
+ 	unsigned long	mode, major, minor;
+-	ext2_ino_t	newfile;
+ 	errcode_t 	retval;
+-	struct ext2_inode inode;
+ 	int		filetype, nr;
++	struct stat	st;
+ 
+ 	if (check_fs_open(argv[0]))
+ 		return;
+@@ -1767,115 +1589,50 @@ void do_mknod(int argc, char *argv[])
+ 		com_err(argv[0], 0, "Usage: mknod <name> [p| [c|b] <major> <minor>]");
+ 		return;
+ 	}
++
+ 	mode = minor = major = 0;
+ 	switch (argv[2][0]) {
+ 		case 'p':
+-			mode = LINUX_S_IFIFO;
+-			filetype = EXT2_FT_FIFO;
++			st.st_mode = S_IFIFO;
+ 			nr = 3;
+ 			break;
+ 		case 'c':
+-			mode = LINUX_S_IFCHR;
+-			filetype = EXT2_FT_CHRDEV;
++			st.st_mode = S_IFCHR;
+ 			nr = 5;
+ 			break;
+ 		case 'b':
+-			mode = LINUX_S_IFBLK;
+-			filetype = EXT2_FT_BLKDEV;
++			st.st_mode = S_IFBLK;
+ 			nr = 5;
+ 			break;
+ 		default:
+-			filetype = 0;
+ 			nr = 0;
+ 	}
++
+ 	if (nr == 5) {
+ 		major = strtoul(argv[3], argv+3, 0);
+ 		minor = strtoul(argv[4], argv+4, 0);
+ 		if (major > 65535 || minor > 65535 || argv[3][0] || argv[4][0])
+ 			nr = 0;
+ 	}
++
+ 	if (argc != nr)
+ 		goto usage;
+-	if (check_fs_read_write(argv[0]))
+-		return;
+-	retval = ext2fs_new_inode(current_fs, cwd, 010755, 0, &newfile);
+-	if (retval) {
++
++	st.st_rdev = makedev(major, minor);
++	if ((retval = do_mknod_internal(cwd, argv[1], &st)))
+ 		com_err(argv[0], retval, 0);
+-		return;
+-	}
+-	printf("Allocated inode: %u\n", newfile);
+-	retval = ext2fs_link(current_fs, cwd, argv[1], newfile, filetype);
+-	if (retval == EXT2_ET_DIR_NO_SPACE) {
+-		retval = ext2fs_expand_dir(current_fs, cwd);
+-		if (retval) {
+-			com_err(argv[0], retval, "while expanding directory");
+-			return;
+-		}
+-		retval = ext2fs_link(current_fs, cwd, argv[1], newfile,
+-				     filetype);
+-	}
+-	if (retval) {
+-		com_err(argv[1], retval, 0);
+-		return;
+-	}
+-        if (ext2fs_test_inode_bitmap2(current_fs->inode_map,newfile))
+-		com_err(argv[0], 0, "Warning: inode already set");
+-	ext2fs_inode_alloc_stats2(current_fs, newfile, +1, 0);
+-	memset(&inode, 0, sizeof(inode));
+-	inode.i_mode = mode;
+-	inode.i_atime = inode.i_ctime = inode.i_mtime =
+-		current_fs->now ? current_fs->now : time(0);
+-	if ((major < 256) && (minor < 256)) {
+-		inode.i_block[0] = major*256+minor;
+-		inode.i_block[1] = 0;
+-	} else {
+-		inode.i_block[0] = 0;
+-		inode.i_block[1] = (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12);
+-	}
+-	inode.i_links_count = 1;
+-	if (debugfs_write_new_inode(newfile, &inode, argv[0]))
+-		return;
+ }
+ 
+ void do_mkdir(int argc, char *argv[])
+ {
+-	char	*cp;
+-	ext2_ino_t	parent;
+-	char	*name;
+ 	errcode_t retval;
+ 
+ 	if (common_args_process(argc, argv, 2, 2, "mkdir",
+ 				"<filename>", CHECK_FS_RW))
+ 		return;
+ 
+-	cp = strrchr(argv[1], '/');
+-	if (cp) {
+-		*cp = 0;
+-		parent = string_to_inode(argv[1]);
+-		if (!parent) {
+-			com_err(argv[1], ENOENT, 0);
+-			return;
+-		}
+-		name = cp+1;
+-	} else {
+-		parent = cwd;
+-		name = argv[1];
+-	}
+-
+-try_again:
+-	retval = ext2fs_mkdir(current_fs, parent, 0, name);
+-	if (retval == EXT2_ET_DIR_NO_SPACE) {
+-		retval = ext2fs_expand_dir(current_fs, parent);
+-		if (retval) {
+-			com_err(argv[0], retval, "while expanding directory");
+-			return;
+-		}
+-		goto try_again;
+-	}
+-	if (retval) {
+-		com_err("ext2fs_mkdir", retval, 0);
+-		return;
+-	}
++	if ((retval = do_mkdir_internal(cwd, argv[1], NULL)))
++		com_err(argv[0], retval, 0);
+ 
+ }
+ 
+@@ -2270,44 +2027,14 @@ void do_punch(int argc, char *argv[])
+ 
+ void do_symlink(int argc, char *argv[])
+ {
+-	char		*cp;
+-	ext2_ino_t	parent;
+-	char		*name, *target;
+ 	errcode_t	retval;
+ 
+ 	if (common_args_process(argc, argv, 3, 3, "symlink",
+ 				"<filename> <target>", CHECK_FS_RW))
+ 		return;
+ 
+-	cp = strrchr(argv[1], '/');
+-	if (cp) {
+-		*cp = 0;
+-		parent = string_to_inode(argv[1]);
+-		if (!parent) {
+-			com_err(argv[1], ENOENT, 0);
+-			return;
+-		}
+-		name = cp+1;
+-	} else {
+-		parent = cwd;
+-		name = argv[1];
+-	}
+-	target = argv[2];
+-
+-try_again:
+-	retval = ext2fs_symlink(current_fs, parent, 0, name, target);
+-	if (retval == EXT2_ET_DIR_NO_SPACE) {
+-		retval = ext2fs_expand_dir(current_fs, parent);
+-		if (retval) {
+-			com_err(argv[0], retval, "while expanding directory");
+-			return;
+-		}
+-		goto try_again;
+-	}
+-	if (retval) {
+-		com_err("ext2fs_symlink", retval, 0);
+-		return;
+-	}
++	if ((retval = do_symlink_internal(cwd, argv[1], argv[2])))
++		com_err(argv[0], retval, 0);
+ 
+ }
+ 
+diff --git a/debugfs/debugfs.h b/debugfs/debugfs.h
+index 6b4f6ef..2d464c1 100644
+--- a/debugfs/debugfs.h
++++ b/debugfs/debugfs.h
+@@ -5,6 +5,7 @@
+ #include "ss/ss.h"
+ #include "ext2fs/ext2_fs.h"
+ #include "ext2fs/ext2fs.h"
++#include "../misc/create_inode.h"
+ 
+ #ifdef __STDC__
+ #define NOARGS void
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0011-mke2fs.8.in-update-the-manual-for-the-d-option.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0011-mke2fs.8.in-update-the-manual-for-the-d-option.patch
new file mode 100644
index 0000000..ddd2cb8
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0011-mke2fs.8.in-update-the-manual-for-the-d-option.patch
@@ -0,0 +1,43 @@
+From 89fca439f1b58595f2f424598a27869f8c7bd815 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 23 Dec 2013 04:43:18 -0500
+Subject: [PATCH 11/11] mke2fs.8.in: update the manual for the -d option
+
+Update the manual for the -d option
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Reviewed-by: Darren Hart <dvhart@linux.intel.com>
+---
+ misc/mke2fs.8.in |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/misc/mke2fs.8.in b/misc/mke2fs.8.in
+index fea50da..b1ca486 100644
+--- a/misc/mke2fs.8.in
++++ b/misc/mke2fs.8.in
+@@ -52,6 +52,10 @@ mke2fs \- create an ext2/ext3/ext4 filesystem
+ .I number-of-inodes
+ ]
+ [
++.B \-d
++.I root-directory
++]
++[
+ .B \-n
+ ]
+ [
+@@ -502,6 +506,9 @@ the
+ ratio).  This allows the user to specify the number
+ of desired inodes directly.
+ .TP
++.BI \-d " root-directory"
++Add the files from the root-directory to the filesystem.
++.TP
+ .BI \-o " creator-os"
+ Overrides the default value of the "creator operating system" field of the
+ filesystem.  The creator field is set by default to the name of the OS the
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/0012-Fix-musl-build-failures.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0012-Fix-musl-build-failures.patch
new file mode 100644
index 0000000..0b8008d
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/0012-Fix-musl-build-failures.patch
@@ -0,0 +1,54 @@
+From c6ff7feb9038d6e8aaffe2e69b205ad5fa33df2f Mon Sep 17 00:00:00 2001
+From: Paul Barker <paul@paulbarker.me.uk>
+Date: Mon, 18 Aug 2014 21:02:56 +0200
+Subject: [PATCH] Fix musl build failures
+
+In lib/ext2fs/unix_io.c, __u64 should be used instead of __uint64_t. This type
+is guaranteed by the e2fsprogs build system.
+(795c02def3681a99cc792a5ebc162d06f8a1eeb7)
+
+In misc/create_inode.c, <limits.h> is needed for the definition of PATH_MAX.
+(bbccc6f3c6a106721fb6f1ef4df6bc32c7986235)
+
+Both of these fixes have been made upstream with the git commit IDs given but
+those are larger commits containing other changes not needed here.
+
+Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
+
+Upstream-Status: Backport
+---
+ lib/ext2fs/unix_io.c | 6 +++---
+ misc/create_inode.c  | 1 +
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
+index 19be630..0cc0f52 100644
+--- a/lib/ext2fs/unix_io.c
++++ b/lib/ext2fs/unix_io.c
+@@ -931,10 +931,10 @@ static errcode_t unix_discard(io_channel channel, unsigned long long block,
+ 
+ 	if (channel->flags & CHANNEL_FLAGS_BLOCK_DEVICE) {
+ #ifdef BLKDISCARD
+-		__uint64_t range[2];
++		__u64 range[2];
+ 
+-		range[0] = (__uint64_t)(block) * channel->block_size;
+-		range[1] = (__uint64_t)(count) * channel->block_size;
++		range[0] = (__u64)(block) * channel->block_size;
++		range[1] = (__u64)(count) * channel->block_size;
+ 
+ 		ret = ioctl(data->dev, BLKDISCARD, &range);
+ #else
+diff --git a/misc/create_inode.c b/misc/create_inode.c
+index 6d8de04..fcec5aa 100644
+--- a/misc/create_inode.c
++++ b/misc/create_inode.c
+@@ -1,4 +1,5 @@
+ #include "create_inode.h"
++#include <limits.h>
+ 
+ #if __STDC_VERSION__ < 199901L
+ # if __GNUC__ >= 2
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2015-0247.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2015-0247.patch
new file mode 100644
index 0000000..4de67c9
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/CVE-2015-0247.patch
@@ -0,0 +1,58 @@
+From f66e6ce4446738c2c7f43d41988a3eb73347e2f5 Mon Sep 17 00:00:00 2001
+From: Theodore Ts'o <tytso@mit.edu>
+Date: Sat, 9 Aug 2014 12:24:54 -0400
+Subject: libext2fs: avoid buffer overflow if s_first_meta_bg is too big
+
+If s_first_meta_bg is greater than the of number block group
+descriptor blocks, then reading or writing the block group descriptors
+will end up overruning the memory buffer allocated for the
+descriptors.  Fix this by limiting first_meta_bg to no more than
+fs->desc_blocks.  This doesn't correct the bad s_first_meta_bg value,
+but it avoids causing the e2fsprogs userspace programs from
+potentially crashing.
+
+Fixes CVE-2015-0247
+Upstream-Status: Backport
+
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
+
+diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c
+index 4599eef..1f99113 100644
+--- a/lib/ext2fs/closefs.c
++++ b/lib/ext2fs/closefs.c
+@@ -344,9 +344,11 @@ errcode_t ext2fs_flush2(ext2_filsys fs, int flags)
+ 	 * superblocks and group descriptors.
+ 	 */
+ 	group_ptr = (char *) group_shadow;
+-	if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
++	if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) {
+ 		old_desc_blocks = fs->super->s_first_meta_bg;
+-	else
++		if (old_desc_blocks > fs->super->s_first_meta_bg)
++			old_desc_blocks = fs->desc_blocks;
++	} else
+ 		old_desc_blocks = fs->desc_blocks;
+ 
+ 	ext2fs_numeric_progress_init(fs, &progress, NULL,
+diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
+index a1a3517..ba501e6 100644
+--- a/lib/ext2fs/openfs.c
++++ b/lib/ext2fs/openfs.c
+@@ -378,9 +378,11 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
+ #ifdef WORDS_BIGENDIAN
+ 	groups_per_block = EXT2_DESC_PER_BLOCK(fs->super);
+ #endif
+-	if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG)
++	if (fs->super->s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) {
+ 		first_meta_bg = fs->super->s_first_meta_bg;
+-	else
++		if (first_meta_bg > fs->desc_blocks)
++			first_meta_bg = fs->desc_blocks;
++	} else
+ 		first_meta_bg = fs->desc_blocks;
+ 	if (first_meta_bg) {
+ 		retval = io_channel_read_blk(fs->io, group_block +
+-- 
+cgit v0.10.2
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4 b/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4
new file mode 100644
index 0000000..c0bd7db
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/acinclude.m4
@@ -0,0 +1,135 @@
+# Extracted from the package's shipped aclocal.m4. Custom macros should be in
+# acinclude.m4 so running aclocal doesn't blow them away.
+#
+# Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+# from http://autoconf-archive.cryp.to/ax_tls.html
+#
+# This was licensed under the GPL with the following exception:
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you make
+# and distribute a modified version of the Autoconf Macro, you may
+# extend this special exception to the GPL to apply to your modified
+# version as well.
+#
+AC_DEFUN([AX_TLS], [
+  AC_MSG_CHECKING(for thread local storage (TLS) class)
+  AC_CACHE_VAL(ac_cv_tls, [
+    ax_tls_keywords="__thread __declspec(thread) none"
+    for ax_tls_keyword in $ax_tls_keywords; do
+       case $ax_tls_keyword in
+          none) ac_cv_tls=none ; break ;;
+          *)
+             AC_TRY_COMPILE(
+                [#include <stdlib.h>
+                 static void
+                 foo(void) {
+                 static ] $ax_tls_keyword [ int bar;
+                 exit(1);
+                 }],
+                 [],
+                 [ac_cv_tls=$ax_tls_keyword ; break],
+                 ac_cv_tls=none
+             )
+          esac
+    done
+])
+
+  if test "$ac_cv_tls" != "none"; then
+    dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
+    AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
+  fi
+  AC_MSG_RESULT($ac_cv_tls)
+])
+
+# ===========================================================================
+#         http://www.nongnu.org/autoconf-archive/check_gnu_make.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   CHECK_GNU_MAKE()
+#
+# DESCRIPTION
+#
+#   This macro searches for a GNU version of make. If a match is found, the
+#   makefile variable `ifGNUmake' is set to the empty string, otherwise it
+#   is set to "#". This is useful for including a special features in a
+#   Makefile, which cannot be handled by other versions of make. The
+#   variable _cv_gnu_make_command is set to the command to invoke GNU make
+#   if it exists, the empty string otherwise.
+#
+#   Here is an example of its use:
+#
+#   Makefile.in might contain:
+#
+#       # A failsafe way of putting a dependency rule into a makefile
+#       $(DEPEND):
+#               $(CC) -MM $(srcdir)/*.c > $(DEPEND)
+#
+#       @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
+#       @ifGNUmake@ include $(DEPEND)
+#       @ifGNUmake@ endif
+#
+#   Then configure.in would normally contain:
+#
+#       CHECK_GNU_MAKE()
+#       AC_OUTPUT(Makefile)
+#
+#   Then perhaps to cause gnu make to override any other make, we could do
+#   something like this (note that GNU make always looks for GNUmakefile
+#   first):
+#
+#       if  ! test x$_cv_gnu_make_command = x ; then
+#               mv Makefile GNUmakefile
+#               echo .DEFAULT: > Makefile ;
+#               echo \  $_cv_gnu_make_command \$@ >> Makefile;
+#       fi
+#
+#   Then, if any (well almost any) other make is called, and GNU make also
+#   exists, then the other make wraps the GNU make.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 John Darrington <j.darrington@elvis.murdoch.edu.au>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved.
+#
+# Note: Modified by Ted Ts'o to add @ifNotGNUMake@
+
+AC_DEFUN(
+        [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
+                _cv_gnu_make_command='' ;
+dnl Search all the common names for GNU make
+                for a in "$MAKE" make gmake gnumake ; do
+                        if test -z "$a" ; then continue ; fi ;
+                        if  ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
+                                _cv_gnu_make_command=$a ;
+                                break;
+                        fi
+                done ;
+        ) ;
+dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
+        if test  "x$_cv_gnu_make_command" != "x"  ; then
+                ifGNUmake='' ;
+                ifNotGNUmake='#' ;
+        else
+                ifGNUmake='#' ;
+                ifNotGNUmake='' ;
+                AC_MSG_RESULT("Not found");
+        fi
+        AC_SUBST(ifGNUmake)
+        AC_SUBST(ifNotGNUmake)
+] )
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/cache_inode.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/cache_inode.patch
new file mode 100644
index 0000000..f9ef8e5
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/cache_inode.patch
@@ -0,0 +1,52 @@
+The comment to this function says:
+
+"""
+  * Stupid algorithm --- we now just search forward starting from the
+  * goal.  Should put in a smarter one someday....
+"""
+
+This adds in a rather hacky algorthim which starts where we finished
+searching previously using a static variable rather than starting 
+from scratch if a hint isn't provided.
+
+This was after noticing that mkfs.ext4 -F X -d Y was spending *lots*
+of time in ext2fs_new_block2 called from ext2fs_bmap from ext2fs_file_write().
+
+Numbers wise, this took a core-image-sato-sdk mkfs time from over 
+8 minutes to around 35 seconds.
+
+Upstream-Status: Pending
+
+RP 2015/02/20
+
+Index: e2fsprogs-1.42.9/lib/ext2fs/alloc.c
+===================================================================
+--- e2fsprogs-1.42.9.orig/lib/ext2fs/alloc.c
++++ e2fsprogs-1.42.9/lib/ext2fs/alloc.c
+@@ -160,6 +160,8 @@ errcode_t ext2fs_new_inode(ext2_filsys f
+ 	return 0;
+ }
+ 
++static blk64_t last_goal = 0;
++
+ /*
+  * Stupid algorithm --- we now just search forward starting from the
+  * goal.  Should put in a smarter one someday....
+@@ -170,6 +172,9 @@ errcode_t ext2fs_new_block2(ext2_filsys
+ 	blk64_t	i;
+ 	int	c_ratio;
+ 
++        if (!goal)
++            goal = last_goal;
++
+ 	EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+ 
+ 	if (!map)
+@@ -194,6 +199,7 @@ errcode_t ext2fs_new_block2(ext2_filsys
+ 
+ 		if (!ext2fs_fast_test_block_bitmap2(map, i)) {
+ 			*ret = i;
++			last_goal = i;
+ 			return 0;
+ 		}
+ 		i = (i + c_ratio) & ~(c_ratio - 1);
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/fix-icache.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/fix-icache.patch
new file mode 100644
index 0000000..d38cc4d
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/fix-icache.patch
@@ -0,0 +1,65 @@
+inode.c: only update the icache for ext2_inode
+
+We only read the cache when:
+
+bufsize == sizeof(struct ext2_inode)
+
+then we should only update the cache in the same condition, otherwise
+there would be errors, for example:
+
+cache[0]: cached ino 14 when bufsize = 128 by ext2fs_write_inode_full()
+cache[1]: cached ino 14 when bufsize = 156 by ext2fs_read_inode_full()
+
+Then update the cache:
+cache[0]: cached ino 15 when bufsize = 156 by ext2fs_read_inode_full()
+
+Then the ino 14 would hit the cache[1] when bufsize = 128 (but it was
+cached by bufsize = 156), so there would be errors.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ lib/ext2fs/inode.c | 20 ++++++++++++--------
+ 1 file changed, 12 insertions(+), 8 deletions(-)
+
+diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c
+--- a/lib/ext2fs/inode.c
++++ b/lib/ext2fs/inode.c
+@@ -612,10 +612,12 @@ errcode_t ext2fs_read_inode_full(ext2_filsys fs, ext2_ino_t ino,
+ #endif
+ 
+ 	/* Update the inode cache */
+-	fs->icache->cache_last = (fs->icache->cache_last + 1) %
+-		fs->icache->cache_size;
+-	fs->icache->cache[fs->icache->cache_last].ino = ino;
+-	fs->icache->cache[fs->icache->cache_last].inode = *inode;
++	if (bufsize == sizeof(struct ext2_inode)) {
++		fs->icache->cache_last = (fs->icache->cache_last + 1) %
++			fs->icache->cache_size;
++		fs->icache->cache[fs->icache->cache_last].ino = ino;
++		fs->icache->cache[fs->icache->cache_last].inode = *inode;
++	}
+ 
+ 	return 0;
+ }
+@@ -648,10 +650,12 @@ errcode_t ext2fs_write_inode_full(ext2_filsys fs, ext2_ino_t ino,
+ 
+ 	/* Check to see if the inode cache needs to be updated */
+ 	if (fs->icache) {
+-		for (i=0; i < fs->icache->cache_size; i++) {
+-			if (fs->icache->cache[i].ino == ino) {
+-				fs->icache->cache[i].inode = *inode;
+-				break;
++		if (bufsize == sizeof(struct ext2_inode)) {
++			for (i=0; i < fs->icache->cache_size; i++) {
++				if (fs->icache->cache[i].ino == ino) {
++					fs->icache->cache[i].inode = *inode;
++					break;
++				}
+ 			}
+ 		}
+ 	} else {
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch
new file mode 100644
index 0000000..cba0ce0
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch
@@ -0,0 +1,37 @@
+From e4ffd6fe975888d306b5f700ba54af18b59f6759 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 20 Mar 2014 11:10:21 +0800
+Subject: [PATCH] misc/mke2fs.c: return error when failed to populate filesystem
+
+We need return retval when "mke2fs -d" failed, otherwise the "$?" would
+be 0 which is misleading.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ misc/mke2fs.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/misc/mke2fs.c b/misc/mke2fs.c
+index a63f0b7..846190e 100644
+--- a/misc/mke2fs.c
++++ b/misc/mke2fs.c
+@@ -2745,10 +2745,11 @@ no_journal:
+ 		current_fs = fs;
+ 		root = EXT2_ROOT_INO;
+ 		retval = populate_fs(root, root_dir);
+-		if (retval)
++		if (retval) {
+ 			fprintf(stderr, "%s",
+-				_("\nError while populating file system"));
+-		else if (!quiet)
++				_("\nError while populating file system\n"));
++			return retval;
++		} else if (!quiet)
+ 			printf("%s", _("done\n"));
+ 	}
+ 
+-- 
+1.8.3.1
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch
new file mode 100644
index 0000000..aa7a298
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/mkdir.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+
+Index: e2fsprogs-1.41.5/po/Makefile.in.in
+===================================================================
+--- e2fsprogs-1.41.5.orig/po/Makefile.in.in	2009-02-14 13:49:08.000000000 +0000
++++ e2fsprogs-1.41.5/po/Makefile.in.in	2009-08-19 17:52:31.000000000 +0100
+@@ -30,7 +30,7 @@
+ INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+ MKINSTALLDIRS = @MKINSTALLDIRS@
+-mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
++mkinstalldirs = $(MKINSTALLDIRS)
+ 
+ GMSGFMT = @GMSGFMT@
+ MSGFMT = @MSGFMT@
+Index: e2fsprogs-1.41.5/configure.in
+===================================================================
+--- e2fsprogs-1.41.5.orig/configure.in	2009-08-19 17:53:50.000000000 +0100
++++ e2fsprogs-1.41.5/configure.in	2009-08-19 17:48:38.000000000 +0100
+@@ -970,6 +970,8 @@
+ fi
+ AC_SUBST(BUILD_CFLAGS)
+ AC_SUBST(BUILD_LDFLAGS)
++MKINSTALLDIRS="mkdir -p"
++AC_SUBST(MKINSTALLDIRS)
+ dnl
+ dnl Make our output files, being sure that we create the some miscellaneous 
+ dnl directories
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch
new file mode 100644
index 0000000..b8a53e9
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/ptest.patch
@@ -0,0 +1,66 @@
+Index: e2fsprogs-1.42.9/tests/Makefile.in
+===================================================================
+--- e2fsprogs-1.42.9.orig/tests/Makefile.in
++++ e2fsprogs-1.42.9/tests/Makefile.in
+@@ -18,7 +18,7 @@ test_one: $(srcdir)/test_one.in Makefile
+ 	@echo "#!/bin/sh" > test_one
+ @HTREE_CMT@	@echo "HTREE=y" >> test_one
+ @QUOTA_CMT@	@echo "QUOTA=y" >> test_one
+-	@echo "SRCDIR=@srcdir@" >> test_one
++	@echo "SRCDIR=/usr/lib/e2fsprogs/ptest/test" >> test_one
+ 	@echo "DIFF_OPTS=@UNI_DIFF_OPTS@" >> test_one
+ 	@cat $(srcdir)/test_one.in >> test_one
+ 	@chmod +x test_one
+@@ -26,7 +26,7 @@ test_one: $(srcdir)/test_one.in Makefile
+ test_script: test_one test_script.in Makefile mke2fs.conf
+ 	@echo "Creating test_script..."
+ 	@echo "#!/bin/sh" > test_script
+-	@echo "SRCDIR=@srcdir@" >> test_script
++	@echo "SRCDIR=/usr/lib/e2fsprogs/ptest/test" >> test_script
+ 	@cat $(srcdir)/test_script.in >> test_script
+ 	@chmod +x test_script
+ 
+Index: e2fsprogs-1.42.9/tests/test_config
+===================================================================
+--- e2fsprogs-1.42.9.orig/tests/test_config
++++ e2fsprogs-1.42.9/tests/test_config
+@@ -3,23 +3,23 @@
+ #
+ 
+ unset LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE LC_TIME PAGER
+-FSCK="$USE_VALGRIND ../e2fsck/e2fsck"
+-MKE2FS="$USE_VALGRIND ../misc/mke2fs"
+-DUMPE2FS="$USE_VALGRIND ../misc/dumpe2fs"
+-TUNE2FS="$USE_VALGRIND ../misc/tune2fs"
+-CHATTR="$USE_VALGRIND../misc/chattr"
+-LSATTR="$USE_VALGRIND ../misc/lsattr"
+-E2IMAGE="$USE_VALGRIND ../misc/e2image"
+-E2IMAGE_EXE="../misc/e2image"
+-DEBUGFS="$USE_VALGRIND ../debugfs/debugfs"
+-DEBUGFS_EXE="../debugfs/debugfs"
+-TEST_BITS="../debugfs/debugfs"
+-RESIZE2FS_EXE="../resize/resize2fs"
++FSCK="$USE_VALGRIND e2fsck"
++MKE2FS="$USE_VALGRIND mke2fs"
++DUMPE2FS="$USE_VALGRIND dumpe2fs"
++TUNE2FS="$USE_VALGRIND tune2fs"
++CHATTR="$USE_VALGRIND chattr"
++LSATTR="$USE_VALGRIND lsattr"
++E2IMAGE="$USE_VALGRIND e2image"
++E2IMAGE_EXE="/sbin/e2image"
++DEBUGFS="$USE_VALGRIND debugfs"
++DEBUGFS_EXE="/sbin/debugfs"
++TEST_BITS="/sbin/debugfs"
++RESIZE2FS_EXE="/sbin/resize2fs"
+ RESIZE2FS="$USE_VALGRIND $RESIZE2FS_EXE"
+-E2UNDO_EXE="../misc/e2undo"
+-TEST_REL=../tests/progs/test_rel
+-TEST_ICOUNT=../tests/progs/test_icount
+-CRCSUM=../tests/progs/crcsum
++E2UNDO_EXE="/sbin/e2undo"
++TEST_REL=./progs/test_rel
++TEST_ICOUNT=./progs/test_icount
++CRCSUM=./progs/crcsum
+ LD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss
+ DYLD_LIBRARY_PATH=../lib:../lib/ext2fs:../lib/e2p:../lib/et:../lib/ss
+ export LD_LIBRARY_PATH
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch
new file mode 100644
index 0000000..830e9d5
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/quiet-debugfs.patch
@@ -0,0 +1,19 @@
+When executing a script don't echo every command, as we do this for entire
+filesystems at rootfs time.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
+index 5590295..ac57292 100644
+--- a/debugfs/debugfs.c
++++ b/debugfs/debugfs.c
+@@ -2378,7 +2378,7 @@ static int source_file(const char *cmd_file, int ss_idx)
+ 		cp = strchr(buf, '\r');
+ 		if (cp)
+ 			*cp = 0;
+-		printf("debugfs: %s\n", buf);
++		/*printf("debugfs: %s\n", buf);*/
+ 		retval = ss_execute_line(ss_idx, buf);
+ 		if (retval) {
+ 			ss_perror(ss_idx, retval, buf);
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch b/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch
new file mode 100644
index 0000000..f3e6eb7
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/remove.ldconfig.call.patch
@@ -0,0 +1,44 @@
+From b139e03ac2f72e644e547c7ee9b1514383af4d97 Mon Sep 17 00:00:00 2001
+From: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+Date: Wed, 30 Jan 2013 15:22:04 +0200
+Subject: [PATCH] When /etc/ld.so.cache is writeable by user running bitbake
+ then it creates invalid cache (in my case libstdc++.so
+ cannot be found after building zlib(-native) and I have to
+ call touch */libstdc++.so && /sbin/ldconfig to fix it.
+
+So remove ldconfig call from make install-libs
+
+Patch authored by Martin Jansa.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+---
+ lib/Makefile.elf-lib |    3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/lib/Makefile.elf-lib b/lib/Makefile.elf-lib
+index 78479d3..4a4a5ac 100644
+--- a/lib/Makefile.elf-lib
++++ b/lib/Makefile.elf-lib
+@@ -50,8 +50,6 @@ install-shlibs install:: $(ELF_LIB) installdirs-elf-lib $(DEP_INSTALL_SYMLINK)
+ 	$(E) "	SYMLINK $(libdir)/$(ELF_IMAGE).so"
+ 	$(Q) $(INSTALL_SYMLINK) $(ELF_INSTALL_DIR)/$(ELF_SONAME) \
+ 		$(libdir)/$(ELF_IMAGE).so $(DESTDIR)
+-	$(E) "	LDCONFIG"
+-	$(Q) -$(LDCONFIG)
+ 
+ install-strip: install
+ 	$(E) "	STRIP-LIB $(ELF_INSTALL_DIR)/$(ELF_LIB)"
+@@ -67,7 +65,6 @@ uninstall-shlibs uninstall::
+ 	$(RM) -f $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) \
+ 		$(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_SONAME) \
+ 		$(DESTDIR)$(libdir)/$(ELF_IMAGE).so
+-	-$(LDCONFIG)
+ 
+ clean::
+ 	$(RM) -rf elfshared
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest b/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest
new file mode 100644
index 0000000..1ac2513
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs/run-ptest
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+cd ./test
+./test_script &>../test.log
+if [ $? -eq 0 ]
+then
+	echo "PASS: e2fsprogs"
+	rm test.log
+else
+	echo "FAIL: e2fsprogs"
+fi
diff --git a/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb
new file mode 100644
index 0000000..97e29c8
--- /dev/null
+++ b/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.42.9.bb
@@ -0,0 +1,116 @@
+require e2fsprogs.inc
+
+RECIPE_NO_UPDATE_REASON = "Updating backported patches to 1.42.13 is too much pain. Let's wait until 1.43 is released."
+
+SRC_URI += "file://acinclude.m4 \
+            file://remove.ldconfig.call.patch \
+            file://fix-icache.patch \
+            file://quiet-debugfs.patch \
+            file://0001-mke2fs-add-the-ability-to-copy-files-from-a-given-di.patch \
+            file://0002-misc-create_inode.c-copy-files-recursively.patch \
+            file://0003-misc-create_inode.c-create-special-file.patch \
+            file://0004-misc-create_inode.c-create-symlink.patch \
+            file://0005-misc-create_inode.c-copy-regular-file.patch \
+            file://0006-misc-create_inode.c-create-directory.patch \
+            file://0007-misc-create_inode.c-set-owner-mode-time-for-the-inod.patch \
+            file://0008-mke2fs.c-add-an-option-d-root-directory.patch \
+            file://0009-misc-create_inode.c-handle-hardlinks.patch \
+            file://0010-debugfs-use-the-functions-in-misc-create_inode.c.patch \
+            file://0011-mke2fs.8.in-update-the-manual-for-the-d-option.patch \
+            file://0012-Fix-musl-build-failures.patch \
+            file://0001-e2fsprogs-fix-cross-compilation-problem.patch \
+            file://misc-mke2fs.c-return-error-when-failed-to-populate-fs.patch \
+            file://cache_inode.patch \
+            file://CVE-2015-0247.patch \
+            file://0001-libext2fs-fix-potential-buffer-overflow-in-closefs.patch \
+"
+
+SRC_URI[md5sum] = "3f8e41e63b432ba114b33f58674563f7"
+SRC_URI[sha256sum] = "2f92ac06e92fa00f2ada3ee67dad012d74d685537527ad1241d82f2d041f2802"
+
+EXTRA_OECONF += "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-elf-shlibs --disable-libuuid --disable-uuidd --enable-verbose-makecmds"
+EXTRA_OECONF_darwin = "--libdir=${base_libdir} --sbindir=${base_sbindir} --enable-bsd-shlibs"
+
+do_configure_prepend () {
+	cp ${WORKDIR}/acinclude.m4 ${S}/
+}
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install
+	oe_runmake 'DESTDIR=${D}' install-libs
+	# We use blkid from util-linux now so remove from here
+	rm -f ${D}${base_libdir}/libblkid*
+	rm -rf ${D}${includedir}/blkid
+	rm -f ${D}${base_libdir}/pkgconfig/blkid.pc
+	rm -f ${D}${base_sbindir}/blkid
+	rm -f ${D}${base_sbindir}/fsck
+	rm -f ${D}${base_sbindir}/findfs
+
+	# e2initrd_helper and the pkgconfig files belong in libdir
+	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+		install -d ${D}${libdir}
+		mv ${D}${base_libdir}/e2initrd_helper ${D}${libdir}
+		mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
+	fi
+
+	oe_multilib_header ext2fs/ext2_types.h
+	install -d ${D}${base_bindir}
+	mv ${D}${bindir}/chattr ${D}${base_bindir}/chattr.e2fsprogs
+
+	install -v -m 755 ${S}/contrib/populate-extfs.sh ${D}${base_sbindir}/
+}
+
+do_install_append_class-target() {
+	# Clean host path in compile_et, mk_cmds
+	sed -i -e "s,ET_DIR=\"${S}/lib/et\",ET_DIR=\"${datadir}/et\",g" ${D}${bindir}/compile_et
+	sed -i -e "s,SS_DIR=\"${S}/lib/ss\",SS_DIR=\"${datadir}/ss\",g" ${D}${bindir}/mk_cmds
+}
+
+RDEPENDS_e2fsprogs = "e2fsprogs-badblocks"
+RRECOMMENDS_e2fsprogs = "e2fsprogs-mke2fs e2fsprogs-e2fsck"
+
+PACKAGES =+ "e2fsprogs-e2fsck e2fsprogs-mke2fs e2fsprogs-tune2fs e2fsprogs-badblocks e2fsprogs-resize2fs"
+PACKAGES =+ "libcomerr libss libe2p libext2fs"
+
+FILES_e2fsprogs-resize2fs = "${base_sbindir}/resize2fs*"
+FILES_e2fsprogs-e2fsck = "${base_sbindir}/e2fsck ${base_sbindir}/fsck.ext*"
+FILES_e2fsprogs-mke2fs = "${base_sbindir}/mke2fs ${base_sbindir}/mkfs.ext* ${sysconfdir}/mke2fs.conf"
+FILES_e2fsprogs-tune2fs = "${base_sbindir}/tune2fs ${base_sbindir}/e2label"
+FILES_e2fsprogs-badblocks = "${base_sbindir}/badblocks"
+FILES_libcomerr = "${base_libdir}/libcom_err.so.*"
+FILES_libss = "${base_libdir}/libss.so.*"
+FILES_libe2p = "${base_libdir}/libe2p.so.*"
+FILES_libext2fs = "${libdir}/e2initrd_helper ${base_libdir}/libext2fs.so.*"
+FILES_${PN}-dev += "${datadir}/*/*.awk ${datadir}/*/*.sed ${base_libdir}/*.so"
+
+BBCLASSEXTEND = "native nativesdk"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "chattr"
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_LINK_NAME[chattr] = "${base_bindir}/chattr"
+ALTERNATIVE_TARGET[chattr] = "${base_bindir}/chattr.e2fsprogs"
+
+ALTERNATIVE_${PN}-doc = "libblkid.3 blkid.8 findfs.8 fsck.8"
+ALTERNATIVE_LINK_NAME[libblkid.3] = "${mandir}/man3/libblkid.3"
+ALTERNATIVE_LINK_NAME[blkid.8] = "${mandir}/man8/blkid.8"
+ALTERNATIVE_LINK_NAME[findfs.8] = "${mandir}/man8/findfs.8"
+ALTERNATIVE_LINK_NAME[fsck.8] = "${mandir}/man8/fsck.8"
+
+inherit ptest
+SRC_URI += "file://run-ptest"
+SRC_URI += "file://ptest.patch"
+
+RDEPENDS_${PN}-ptest += "${PN} ${PN}-tune2fs coreutils procps"
+#RDEPENDS_${PN}-ptest += "expect"
+
+do_compile_ptest() {
+	oe_runmake -C ${B}/tests
+}
+
+do_install_ptest() {
+	cp -a ${B}/tests ${D}${PTEST_PATH}/test
+	cp -a ${S}/tests/* ${D}${PTEST_PATH}/test
+	sed -e 's!../e2fsck/e2fsck!e2fsck!g' -i ${D}${PTEST_PATH}/test/*/expect*
+}
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff
new file mode 100644
index 0000000..d4e4675
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/arm_backend.diff
@@ -0,0 +1,449 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.146/backends/arm_init.c
+===================================================================
+--- elfutils-0.146.orig/backends/arm_init.c	2009-04-21 14:50:01.000000000 +0000
++++ elfutils-0.146/backends/arm_init.c	2010-04-24 10:11:13.000000000 +0000
+@@ -32,21 +32,32 @@
+ #define RELOC_PREFIX	R_ARM_
+ #include "libebl_CPU.h"
+ 
++#include "libebl_arm.h"
++
+ /* This defines the common reloc hooks based on arm_reloc.def.  */
+ #include "common-reloc.c"
+ 
+ 
+ const char *
+ arm_init (elf, machine, eh, ehlen)
+-     Elf *elf __attribute__ ((unused));
++     Elf *elf;
+      GElf_Half machine __attribute__ ((unused));
+      Ebl *eh;
+      size_t ehlen;
+ {
++  int soft_float = 0;
++
+   /* Check whether the Elf_BH object has a sufficent size.  */
+   if (ehlen < sizeof (Ebl))
+     return NULL;
+ 
++  if (elf) {
++    GElf_Ehdr ehdr_mem;
++    GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++    if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT))
++      soft_float = 1;
++  }
++
+   /* We handle it.  */
+   eh->name = "ARM";
+   arm_init_reloc (eh);
+@@ -58,7 +69,10 @@
+   HOOK (eh, core_note);
+   HOOK (eh, auxv_info);
+   HOOK (eh, check_object_attribute);
+-  HOOK (eh, return_value_location);
++  if (soft_float)
++    eh->return_value_location = arm_return_value_location_soft;
++  else
++    eh->return_value_location = arm_return_value_location_hard;
+ 
+   return MODVERSION;
+ }
+Index: elfutils-0.146/backends/arm_regs.c
+===================================================================
+--- elfutils-0.146.orig/backends/arm_regs.c	2009-04-21 14:50:01.000000000 +0000
++++ elfutils-0.146/backends/arm_regs.c	2010-04-24 10:11:13.000000000 +0000
+@@ -28,6 +28,7 @@
+ #endif
+ 
+ #include <string.h>
++#include <stdio.h>
+ #include <dwarf.h>
+ 
+ #define BACKEND arm_
+@@ -58,7 +59,15 @@
+       namelen = 2;
+       break;
+ 
+-    case 10 ... 12:
++    case 10 ... 11:
++      name[0] = 'r';
++      name[1] = '1';
++      name[2] = regno % 10 + '0';
++      namelen = 3;
++      break;
++
++    case 12:
++      *type = DW_ATE_unsigned;
+       name[0] = 'r';
+       name[1] = '1';
+       name[2] = regno % 10 + '0';
+@@ -73,6 +82,9 @@
+       break;
+ 
+     case 16 + 0 ... 16 + 7:
++      /* AADWARF says that there are no registers in that range,
++       * but gcc maps FPA registers here
++       */
+       regno += 96 - 16;
+       /* Fall through.  */
+     case 96 + 0 ... 96 + 7:
+@@ -84,11 +96,139 @@
+       namelen = 2;
+       break;
+ 
++    case 64 + 0 ... 64 + 9:
++      *setname = "VFP";
++      *bits = 32;
++      *type = DW_ATE_float;
++      name[0] = 's';
++      name[1] = regno - 64 + '0';
++      namelen = 2;
++      break;
++
++    case 64 + 10 ... 64 + 31:
++      *setname = "VFP";
++      *bits = 32;
++      *type = DW_ATE_float;
++      name[0] = 's';
++      name[1] = (regno - 64) / 10 + '0';
++      name[2] = (regno - 64) % 10 + '0';
++      namelen = 3;
++      break;
++
++    case 104 + 0 ... 104 + 7:
++      /* XXX TODO:
++       * This can be either intel wireless MMX general purpose/control
++       * registers or xscale accumulator, which have different usage.
++       * We only have the intel wireless MMX here now.
++       * The name needs to be changed for the xscale accumulator too. */
++      *setname = "MMX";
++      *type = DW_ATE_unsigned;
++      *bits = 32;
++      memcpy(name, "wcgr", 4);
++      name[4] = regno - 104 + '0';
++      namelen = 5;
++      break;
++
++    case 112 + 0 ... 112 + 9:
++      *setname = "MMX";
++      *type = DW_ATE_unsigned;
++      *bits = 64;
++      name[0] = 'w';
++      name[1] = 'r';
++      name[2] = regno - 112 + '0';
++      namelen = 3;
++      break;
++
++    case 112 + 10 ... 112 + 15:
++      *setname = "MMX";
++      *type = DW_ATE_unsigned;
++      *bits = 64;
++      name[0] = 'w';
++      name[1] = 'r';
++      name[2] = '1';
++      name[3] = regno - 112 - 10 + '0';
++      namelen = 4;
++      break;
++
+     case 128:
++      *setname = "special";
+       *type = DW_ATE_unsigned;
+       return stpcpy (name, "spsr") + 1 - name;
+ 
++    case 129:
++      *setname = "special";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_fiq") + 1 - name;
++
++    case 130:
++      *setname = "special";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_irq") + 1 - name;
++
++    case 131:
++      *setname = "special";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_abt") + 1 - name;
++
++    case 132:
++      *setname = "special";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_und") + 1 - name;
++
++    case 133:
++      *setname = "special";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_svc") + 1 - name;
++
++    case 144 ... 150:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_usr", regno - 144 + 8) + 1;
++
++    case 151 ... 157:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1;
++
++    case 158 ... 159:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_irq", regno - 158 + 13) + 1;
++
++    case 160 ... 161:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_abt", regno - 160 + 13) + 1;
++
++    case 162 ... 163:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_und", regno - 162 + 13) + 1;
++
++    case 164 ... 165:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_svc", regno - 164 + 13) + 1;
++
++    case 192 ... 199:
++     *setname = "MMX";
++      *bits = 32;
++      *type = DW_ATE_unsigned;
++      name[0] = 'w';
++      name[1] = 'c';
++      name[2] = regno - 192 + '0';
++      namelen = 3;
++      break;
++
+     case 256 + 0 ... 256 + 9:
++      /* XXX TODO: Neon also uses those registers and can contain
++       * both float and integers */
+       *setname = "VFP";
+       *type = DW_ATE_float;
+       *bits = 64;
+Index: elfutils-0.146/backends/arm_retval.c
+===================================================================
+--- elfutils-0.146.orig/backends/arm_retval.c	2010-01-12 16:57:54.000000000 +0000
++++ elfutils-0.146/backends/arm_retval.c	2010-04-24 10:11:13.000000000 +0000
+@@ -45,6 +45,13 @@
+ #define nloc_intreg	1
+ #define nloc_intregs(n)	(2 * (n))
+ 
++/* f1  */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */
++static const Dwarf_Op loc_fpreg[] =
++  {
++    { .atom = DW_OP_reg16 },
++  };
++#define nloc_fpreg  1
++
+ /* The return value is a structure and is actually stored in stack space
+    passed in a hidden argument by the caller.  But, the compiler
+    helpfully returns the address of that space in r0.  */
+@@ -55,8 +62,9 @@
+ #define nloc_aggregate 1
+ 
+ 
+-int
+-arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++static int
++arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp,
++		            int soft_float)
+ {
+   /* Start with the function's type, and get the DW_AT_type attribute,
+      which is the type of the return value.  */
+@@ -109,14 +117,31 @@
+ 	  else
+ 	    return -1;
+ 	}
++      if (tag == DW_TAG_base_type)
++	{
++	  Dwarf_Word encoding;
++	  if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++	                       &attr_mem), &encoding) != 0)
++	    return -1;
++
++	  if ((encoding == DW_ATE_float) && !soft_float)
++	    {
++	      *locp = loc_fpreg;
++	      if (size <= 8)
++		return nloc_fpreg;
++	      goto aggregate;
++	    }
++	}
+       if (size <= 16)
+ 	{
+ 	intreg:
+ 	  *locp = loc_intreg;
+ 	  return size <= 4 ? nloc_intreg : nloc_intregs ((size + 3) / 4);
+ 	}
++      /* fall through. */
+ 
+     aggregate:
++      /* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */
+       *locp = loc_aggregate;
+       return nloc_aggregate;
+ 
+@@ -135,3 +160,18 @@
+      DWARF and might be valid.  */
+   return -2;
+ }
++
++/* return location for -mabi=apcs-gnu -msoft-float */
++int
++arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++   return arm_return_value_location_ (functypedie, locp, 1);
++}
++
++/* return location for -mabi=apcs-gnu -mhard-float (current default) */
++int
++arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++   return arm_return_value_location_ (functypedie, locp, 0);
++}
++
+Index: elfutils-0.146/libelf/elf.h
+===================================================================
+--- elfutils-0.146.orig/libelf/elf.h	2010-04-24 10:11:11.000000000 +0000
++++ elfutils-0.146/libelf/elf.h	2010-04-24 10:11:13.000000000 +0000
+@@ -2290,6 +2290,9 @@
+ #define EF_ARM_EABI_VER4	0x04000000
+ #define EF_ARM_EABI_VER5	0x05000000
+ 
++/* EI_OSABI values */
++#define ELFOSABI_ARM_AEABI    64      /* Contains symbol versioning. */
++
+ /* Additional symbol types for Thumb.  */
+ #define STT_ARM_TFUNC		STT_LOPROC /* A Thumb function.  */
+ #define STT_ARM_16BIT		STT_HIPROC /* A Thumb label.  */
+@@ -2307,12 +2310,19 @@
+ 
+ /* Processor specific values for the Phdr p_type field.  */
+ #define PT_ARM_EXIDX		(PT_LOPROC + 1)	/* ARM unwind segment.  */
++#define PT_ARM_UNWIND		PT_ARM_EXIDX
+ 
+ /* Processor specific values for the Shdr sh_type field.  */
+ #define SHT_ARM_EXIDX		(SHT_LOPROC + 1) /* ARM unwind section.  */
+ #define SHT_ARM_PREEMPTMAP	(SHT_LOPROC + 2) /* Preemption details.  */
+ #define SHT_ARM_ATTRIBUTES	(SHT_LOPROC + 3) /* ARM attributes section.  */
+ 
++/* Processor specific values for the Dyn d_tag field.  */
++#define DT_ARM_RESERVED1	(DT_LOPROC + 0)
++#define DT_ARM_SYMTABSZ		(DT_LOPROC + 1)
++#define DT_ARM_PREEMTMAB	(DT_LOPROC + 2)
++#define DT_ARM_RESERVED2	(DT_LOPROC + 3)
++#define DT_ARM_NUM		4
+ 
+ /* ARM relocs.  */
+ 
+@@ -2344,12 +2354,75 @@
+ #define R_ARM_GOTPC		25	/* 32 bit PC relative offset to GOT */
+ #define R_ARM_GOT32		26	/* 32 bit GOT entry */
+ #define R_ARM_PLT32		27	/* 32 bit PLT address */
++#define R_ARM_CALL		28
++#define R_ARM_JUMP24		29
++#define R_ARM_THM_JUMP24	30
++#define R_ARM_BASE_ABS		31
+ #define R_ARM_ALU_PCREL_7_0	32
+ #define R_ARM_ALU_PCREL_15_8	33
+ #define R_ARM_ALU_PCREL_23_15	34
+ #define R_ARM_LDR_SBREL_11_0	35
+ #define R_ARM_ALU_SBREL_19_12	36
+ #define R_ARM_ALU_SBREL_27_20	37
++#define R_ARM_TARGET1		38
++#define R_ARM_SBREL31		39
++#define R_ARM_V4BX		40
++#define R_ARM_TARGET2		41
++#define R_ARM_PREL31		42
++#define R_ARM_MOVW_ABS_NC	43
++#define R_ARM_MOVT_ABS		44
++#define R_ARM_MOVW_PREL_NC	45
++#define R_ARM_MOVT_PREL		46
++#define R_ARM_THM_MOVW_ABS_NC	47
++#define R_ARM_THM_MOVT_ABS	48
++#define R_ARM_THM_MOVW_PREL_NC	49
++#define R_ARM_THM_MOVT_PREL	50
++#define R_ARM_THM_JUMP19	51
++#define R_ARM_THM_JUMP6		52
++#define R_ARM_THM_ALU_PREL_11_0	53
++#define R_ARM_THM_PC12		54
++#define R_ARM_ABS32_NOI		55
++#define R_ARM_REL32_NOI		56
++#define R_ARM_ALU_PC_G0_NC	57
++#define R_ARM_ALU_PC_G0		58
++#define R_ARM_ALU_PC_G1_NC	59
++#define R_ARM_ALU_PC_G1		60
++#define R_ARM_ALU_PC_G2		61
++#define R_ARM_LDR_PC_G1		62
++#define R_ARM_LDR_PC_G2		63
++#define R_ARM_LDRS_PC_G0	64
++#define R_ARM_LDRS_PC_G1	65
++#define R_ARM_LDRS_PC_G2	66
++#define R_ARM_LDC_PC_G0		67
++#define R_ARM_LDC_PC_G1		68
++#define R_ARM_LDC_PC_G2		69
++#define R_ARM_ALU_SB_G0_NC	70
++#define R_ARM_ALU_SB_G0		71
++#define R_ARM_ALU_SB_G1_NC	72
++#define R_ARM_ALU_SB_G1		73
++#define R_ARM_ALU_SB_G2		74
++#define R_ARM_LDR_SB_G0		75
++#define R_ARM_LDR_SB_G1		76
++#define R_ARM_LDR_SB_G2		77
++#define R_ARM_LDRS_SB_G0	78
++#define R_ARM_LDRS_SB_G1	79
++#define R_ARM_LDRS_SB_G2	80
++#define R_ARM_LDC_G0		81
++#define R_ARM_LDC_G1		82
++#define R_ARM_LDC_G2		83
++#define R_ARM_MOVW_BREL_NC	84
++#define R_ARM_MOVT_BREL		85
++#define R_ARM_MOVW_BREL		86
++#define R_ARM_THM_MOVW_BREL_NC	87
++#define R_ARM_THM_MOVT_BREL	88
++#define R_ARM_THM_MOVW_BREL	89
++/* 90-93 unallocated */
++#define R_ARM_PLT32_ABS		94
++#define R_ARM_GOT_ABS		95
++#define R_ARM_GOT_PREL		96
++#define R_ARM_GOT_BREL12	97
++#define R_ARM_GOTOFF12		98
++#define R_ARM_GOTRELAX		99
+ #define R_ARM_GNU_VTENTRY	100
+ #define R_ARM_GNU_VTINHERIT	101
+ #define R_ARM_THM_PC11		102	/* thumb unconditional branch */
+@@ -2364,6 +2437,12 @@
+ 					   static TLS block offset */
+ #define R_ARM_TLS_LE32		108	/* 32 bit offset relative to static
+ 					   TLS block */
++#define R_ARM_TLS_LDO12		109
++#define R_ARM_TLS_LE12		110
++#define R_ARM_TLS_IE12GP	111
++/* 112 - 127 private range */
++#define R_ARM_ME_TOO		128	/* obsolete */
++
+ #define R_ARM_RXPC25		249
+ #define R_ARM_RSBREL32		250
+ #define R_ARM_THM_RPC22		251
+Index: elfutils-0.146/backends/libebl_arm.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/libebl_arm.h	2010-04-24 10:11:13.000000000 +0000
+@@ -0,0 +1,9 @@
++#ifndef _LIBEBL_ARM_H
++#define _LIBEBL_ARM_H 1
++
++#include <libdw.h>
++
++extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
++extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
++
++#endif
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff
new file mode 100644
index 0000000..5baa709
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/elf_additions.diff
@@ -0,0 +1,71 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.146/libelf/elf.h
+===================================================================
+--- elfutils-0.146.orig/libelf/elf.h	2010-04-24 10:13:50.000000000 +0000
++++ elfutils-0.146/libelf/elf.h	2010-04-24 10:22:43.000000000 +0000
+@@ -143,6 +143,7 @@
+ #define ELFOSABI_HPUX		1	/* HP-UX */
+ #define ELFOSABI_NETBSD		2	/* NetBSD.  */
+ #define ELFOSABI_LINUX		3	/* Linux.  */
++#define ELFOSABI_HURD		4	/* GNU/Hurd */
+ #define ELFOSABI_SOLARIS	6	/* Sun Solaris.  */
+ #define ELFOSABI_AIX		7	/* IBM AIX.  */
+ #define ELFOSABI_IRIX		8	/* SGI Irix.  */
+@@ -150,8 +151,13 @@
+ #define ELFOSABI_TRU64		10	/* Compaq TRU64 UNIX.  */
+ #define ELFOSABI_MODESTO	11	/* Novell Modesto.  */
+ #define ELFOSABI_OPENBSD	12	/* OpenBSD.  */
++#define ELFOSABI_OPENVMS	13	/* OpenVMS */
++#define ELFOSABI_NSK		14	/* Hewlett-Packard Non-Stop Kernel */
++#define ELFOSABI_AROS		15	/* Amiga Research OS */
++/* 64-255 Architecture-specific value range */
+ #define ELFOSABI_ARM_AEABI	64	/* ARM EABI */
+ #define ELFOSABI_ARM		97	/* ARM */
++/* This is deprecated? It's not in the latest version anymore. */
+ #define ELFOSABI_STANDALONE	255	/* Standalone (embedded) application */
+ 
+ #define EI_ABIVERSION	8		/* ABI version */
+@@ -206,7 +212,7 @@
+ #define EM_H8_300H	47		/* Hitachi H8/300H */
+ #define EM_H8S		48		/* Hitachi H8S */
+ #define EM_H8_500	49		/* Hitachi H8/500 */
+-#define EM_IA_64	50		/* Intel Merced */
++#define EM_IA_64	50		/* Intel IA64 */
+ #define EM_MIPS_X	51		/* Stanford MIPS-X */
+ #define EM_COLDFIRE	52		/* Motorola Coldfire */
+ #define EM_68HC12	53		/* Motorola M68HC12 */
+@@ -220,7 +226,8 @@
+ #define EM_TINYJ	61		/* Advanced Logic Corp. Tinyj emb.fam*/
+ #define EM_X86_64	62		/* AMD x86-64 architecture */
+ #define EM_PDSP		63		/* Sony DSP Processor */
+-
++#define	EM_PDP10	64		/* Digital Equipment Corp. PDP-10 */
++#define EM_PDP11	65		/* Digital Equipment Corp. PDP-11 */
+ #define EM_FX66		66		/* Siemens FX66 microcontroller */
+ #define EM_ST9PLUS	67		/* STMicroelectronics ST9+ 8/16 mc */
+ #define EM_ST7		68		/* STmicroelectronics ST7 8 bit mc */
+@@ -250,7 +257,22 @@
+ #define EM_OPENRISC	92		/* OpenRISC 32-bit embedded processor */
+ #define EM_ARC_A5	93		/* ARC Cores Tangent-A5 */
+ #define EM_XTENSA	94		/* Tensilica Xtensa Architecture */
+-#define EM_NUM		95
++#define	EM_VIDEOCORE	95		/* Alphamosaic VideoCore processor */
++#define	EM_TMM_GPP	96		/* Thompson Multimedia General Purpose Processor */
++#define	EM_NS32K	97		/* National Semiconductor 32000 series */
++#define	EM_TPC		98		/* Tenor Network TPC processor */
++#define	EM_SNP1K	99		/* Trebia SNP 1000 processor */
++#define	EM_ST200	100		/* STMicroelectronics (www.st.com) ST200 microcontroller */
++#define EM_IP2K         101		/* Ubicom IP2XXX microcontroller family */
++#define	EM_MAX		102		/* MAX Processor */
++#define EM_CR           103		/* National Semiconductor CompactRISC */
++#define	EM_F2MC16	104		/* Fujitsu F2MC16 */
++#define EM_MSP430       105		/* TI msp430 micro controller */
++#define EM_BLACKFIN     106		/* Analog Devices Blackfin (DSP) processor */
++#define EM_SE_C33	107		/* S1C33 Family of Seiko Epson processors */
++#define	EM_SEP		108		/* Sharp embedded microprocessor */
++#define EM_ARCA		109		/* Arca RISC Microprocessor */
++#define EM_NUM		110
+ 
+ /* If it is necessary to assign new unofficial EM_* values, please
+    pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch
new file mode 100644
index 0000000..84e8ddc
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/elf_begin.c-CVE-2014-9447-fix.patch
@@ -0,0 +1,36 @@
+From 323ca04a0c9189544075c19b49da67f6443a8950 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Wed, 21 Jan 2015 09:33:38 +0900
+Subject: [PATCH] elf_begin.c: CVE-2014-9447 fix
+
+this patch is from:
+ https://git.fedorahosted.org/cgit/elfutils.git/commit/?id=147018e729e7c22eeabf15b82d26e4bf68a0d18e
+
+Upstream-Status: Backport
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ libelf/elf_begin.c | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/libelf/elf_begin.c b/libelf/elf_begin.c
+index e46add3..e83ba35 100644
+--- a/libelf/elf_begin.c
++++ b/libelf/elf_begin.c
+@@ -736,11 +736,8 @@ read_long_names (Elf *elf)
+ 	    break;
+ 
+ 	  /* NUL-terminate the string.  */
+-	  *runp = '\0';
+-
+-	  /* Skip the NUL byte and the \012.  */
+-	  runp += 2;
+-
++	  *runp++ = '\0';
++ 
+ 	  /* A sanity check.  Somebody might have generated invalid
+ 	     archive.  */
+ 	  if (runp >= newp + len)
+-- 
+1.8.4.2
+
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch
new file mode 100644
index 0000000..b619619
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-ar-c-fix-num-passed-to-memset.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport
+
+ar.c (do_oper_delete): Fix num passed to memset
+native build failed as following on Fedora18+: 
+ar.c: In function 'do_oper_delete':
+ar.c:918:31: error: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? [-Werror=sizeof-pointer-memaccess]
+   memset (found, '\0', sizeof (found));
+                                ^
+The original commit is http://git.fedorahosted.org/cgit/elfutils.git/commit/src/ar.c?id=1a4d0668d18bf1090c5c08cdb5cb3ba2b8eb5410
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+
+--- elfutils-0.148/src/ar.c.org	2013-03-12 21:12:17.928281375 -0500
++++ elfutils-0.148/src/ar.c	2013-03-12 21:15:30.053285271 -0500
+@@ -915,7 +915,7 @@
+ 		long int instance)
+ {
+   bool *found = alloca (sizeof (bool) * argc);
+-  memset (found, '\0', sizeof (found));
++  memset (found, '\0', sizeof (bool) * argc);
+ 
+   /* List of the files we keep.  */
+   struct armem *to_copy = NULL;
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch
new file mode 100644
index 0000000..0ff353d
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/elfutils-fsize.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Backport
+
+The ELF_T_LIB and ELF_T_GNUHASH sizes were missing from fsize table.
+
+This could cause a failure in the elf*_xlatetof function.
+
+diff -ur elfutils-0.148.orig/libelf/exttypes.h elfutils-0.148/libelf/exttypes.h
+--- elfutils-0.148.orig/libelf/exttypes.h	2009-01-08 12:56:37.000000000 -0800
++++ elfutils-0.148/libelf/exttypes.h	2010-08-18 14:00:33.000000000 -0700
+@@ -94,6 +94,7 @@
+ Vernaux32 (Ext_);
+ Syminfo32 (Ext_);
+ Move32 (Ext_);
++Lib32 (Ext_);
+ auxv_t32 (Ext_);
+ 
+ Ehdr64 (Ext_);
+@@ -110,6 +111,7 @@
+ Vernaux64 (Ext_);
+ Syminfo64 (Ext_);
+ Move64 (Ext_);
++Lib64 (Ext_);
+ auxv_t64 (Ext_);
+ 
+ #undef START
+diff -ur elfutils-0.148.orig/libelf/gelf_fsize.c elfutils-0.148/libelf/gelf_fsize.c
+--- elfutils-0.148.orig/libelf/gelf_fsize.c	2009-01-08 12:56:37.000000000 -0800
++++ elfutils-0.148/libelf/gelf_fsize.c	2010-08-18 14:11:57.000000000 -0700
+@@ -87,7 +87,9 @@
+       [ELF_T_NHDR]	= sizeof (ElfW2(LIBELFBITS, Ext_Nhdr)),		      \
+       [ELF_T_SYMINFO]	= sizeof (ElfW2(LIBELFBITS, Ext_Syminfo)),	      \
+       [ELF_T_MOVE]	= sizeof (ElfW2(LIBELFBITS, Ext_Move)),		      \
+-      [ELF_T_AUXV]	= sizeof (ElfW2(LIBELFBITS, Ext_auxv_t))
++      [ELF_T_LIB]	= sizeof (ElfW2(LIBELFBITS, Ext_Lib)),		      \
++      [ELF_T_AUXV]	= sizeof (ElfW2(LIBELFBITS, Ext_auxv_t)),	      \
++      [ELF_T_GNUHASH]	= ELFW2(LIBELFBITS, FSZ_WORD)
+       TYPE_SIZES (32)
+     },
+     [ELFCLASS64 - 1] = {
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch
new file mode 100644
index 0000000..0e28690
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/fix-build-gcc-4.8.patch
@@ -0,0 +1,57 @@
+This patch fixes a warning seen with gcc 4.8 (especially on ubuntu 13.10)
+
+| addr2line.c: In function 'handle_address':
+| addr2line.c:450:7: error: format '%a' expects argument of type 'float *', but argument 3 has type 'char **' [-Werror=format=]
+|        if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
+|        ^
+| addr2line.c:453:7: error: format '%a' expects argument of type 'float *', but argument 3 has type 'char **' [-Werror=format=]
+|        switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
+|        ^
+| cc1: all warnings being treated as errors
+
+
+%a is old GNU style and should be abandoned in favor of %m
+
+Also see
+
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54361
+
+to support this assertion
+
+This patch is added via redhat-compatibility patch so lets revert this part
+here.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [Caused by an earlier patch]
+
+Index: elfutils-0.148/src/addr2line.c
+===================================================================
+--- elfutils-0.148.orig/src/addr2line.c	2013-09-23 17:46:45.513586538 -0700
++++ elfutils-0.148/src/addr2line.c	2013-09-23 17:46:46.329586558 -0700
+@@ -447,10 +447,10 @@
+       bool parsed = false;
+       int i, j;
+       char *name = NULL;
+-      if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
++      if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
+ 	  && string[i] == '\0')
+ 	parsed = adjust_to_section (name, &addr, dwfl);
+-      switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
++      switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
+ 	{
+ 	default:
+ 	  break;
+Index: elfutils-0.148/tests/line2addr.c
+===================================================================
+--- elfutils-0.148.orig/tests/line2addr.c	2013-09-23 17:46:45.521586538 -0700
++++ elfutils-0.148/tests/line2addr.c	2013-09-23 17:46:46.329586558 -0700
+@@ -132,7 +132,7 @@
+     {
+       struct args a = { .arg = argv[cnt] };
+ 
+-      switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
++      switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
+ 	{
+ 	default:
+ 	case 0:
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch
new file mode 100644
index 0000000..bd634b4
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/fix_for_gcc-4.7.patch
@@ -0,0 +1,73 @@
+Upstream-Status: pending
+gcc 4.7 does not like pointer conversion, so have a void * tmp var to work 
+around following compilation issue.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/07/07
+
+| md5.c: In function 'md5_finish_ctx':
+| md5.c:108:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
+| md5.c:109:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
+| cc1: all warnings being treated as errors
+| 
+| make[2]: *** [md5.o] Error 1
+| make[2]: *** Waiting for unfinished jobs....
+| sha1.c: In function 'sha1_finish_ctx':
+| sha1.c:109:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
+| sha1.c:111:3: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
+| cc1: all warnings being treated as errors
+| 
+| make[2]: *** [sha1.o] Error 1
+
+Index: elfutils-0.148/lib/md5.c
+===================================================================
+--- elfutils-0.148.orig/lib/md5.c
++++ elfutils-0.148/lib/md5.c
+@@ -95,6 +95,7 @@ md5_finish_ctx (ctx, resbuf)
+   /* Take yet unprocessed bytes into account.  */
+   md5_uint32 bytes = ctx->buflen;
+   size_t pad;
++  void * tmp;
+ 
+   /* Now count remaining bytes.  */
+   ctx->total[0] += bytes;
+@@ -105,9 +106,10 @@ md5_finish_ctx (ctx, resbuf)
+   memcpy (&ctx->buffer[bytes], fillbuf, pad);
+ 
+   /* Put the 64-bit file length in *bits* at the end of the buffer.  */
+-  *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3);
+-  *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) |
+-							(ctx->total[0] >> 29));
++  tmp = &ctx->buffer[bytes + pad];
++  *(md5_uint32 *) tmp = SWAP (ctx->total[0] << 3);
++  tmp = &ctx->buffer[bytes + pad + 4];
++  *(md5_uint32 *) tmp = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
+ 
+   /* Process last bytes.  */
+   md5_process_block (ctx->buffer, bytes + pad + 8, ctx);
+Index: elfutils-0.148/lib/sha1.c
+===================================================================
+--- elfutils-0.148.orig/lib/sha1.c
++++ elfutils-0.148/lib/sha1.c
+@@ -96,6 +96,7 @@ sha1_finish_ctx (ctx, resbuf)
+   /* Take yet unprocessed bytes into account.  */
+   sha1_uint32 bytes = ctx->buflen;
+   size_t pad;
++  void * tmp;
+ 
+   /* Now count remaining bytes.  */
+   ctx->total[0] += bytes;
+@@ -106,9 +107,10 @@ sha1_finish_ctx (ctx, resbuf)
+   memcpy (&ctx->buffer[bytes], fillbuf, pad);
+ 
+   /* Put the 64-bit file length in *bits* at the end of the buffer.  */
+-  *(sha1_uint32 *) &ctx->buffer[bytes + pad] = SWAP ((ctx->total[1] << 3) |
+-						     (ctx->total[0] >> 29));
+-  *(sha1_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP (ctx->total[0] << 3);
++  tmp = &ctx->buffer[bytes + pad];
++  *(sha1_uint32 *) tmp = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
++  tmp = &ctx->buffer[bytes + pad + 4];
++  *(sha1_uint32 *) tmp = SWAP (ctx->total[0] << 3);
+ 
+   /* Process last bytes.  */
+   sha1_process_block (ctx->buffer, bytes + pad + 8, ctx);
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff
new file mode 100644
index 0000000..a86b97c
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/hppa_backend.diff
@@ -0,0 +1,801 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.146/backends/parisc_init.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/parisc_init.c	2010-04-24 10:10:50.000000000 +0000
+@@ -0,0 +1,74 @@
++/* Initialization of PA-RISC specific backend library.
++   Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND		parisc_
++#define RELOC_PREFIX	R_PARISC_
++#include "libebl_CPU.h"
++#include "libebl_parisc.h"
++
++/* This defines the common reloc hooks based on parisc_reloc.def.  */
++#include "common-reloc.c"
++
++
++const char *
++parisc_init (elf, machine, eh, ehlen)
++     Elf *elf __attribute__ ((unused));
++     GElf_Half machine __attribute__ ((unused));
++     Ebl *eh;
++     size_t ehlen;
++{
++  int pa64 = 0;
++
++  /* Check whether the Elf_BH object has a sufficent size.  */
++  if (ehlen < sizeof (Ebl))
++    return NULL;
++
++  if (elf) {
++    GElf_Ehdr ehdr_mem;
++    GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++    if (ehdr && (ehdr->e_flags & EF_PARISC_WIDE))
++      pa64 = 1;
++  }
++  /* We handle it.  */
++  eh->name = "PA-RISC";
++  parisc_init_reloc (eh);
++  HOOK (eh, reloc_simple_type);
++  HOOK (eh, machine_flag_check);
++  HOOK (eh, symbol_type_name);
++  HOOK (eh, segment_type_name);
++  HOOK (eh, section_type_name);
++  HOOK (eh, register_info);
++  if (pa64)
++    eh->return_value_location = parisc_return_value_location_64;
++  else
++    eh->return_value_location = parisc_return_value_location_32;
++
++  return MODVERSION;
++}
+Index: elfutils-0.146/backends/parisc_regs.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/parisc_regs.c	2010-04-24 10:10:50.000000000 +0000
+@@ -0,0 +1,159 @@
++/* Register names and numbers for PA-RISC DWARF.
++   Copyright (C) 2005, 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND parisc_
++#include "libebl_CPU.h"
++
++ssize_t
++parisc_register_info (Ebl *ebl, int regno, char *name, size_t namelen,
++		     const char **prefix, const char **setname,
++		     int *bits, int *type)
++{
++  int pa64 = 0;
++
++  if (ebl->elf) {
++    GElf_Ehdr ehdr_mem;
++    GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem);
++    if (ehdr->e_flags & EF_PARISC_WIDE)
++      pa64 = 1;
++  }
++
++  int nregs = pa64 ? 127 : 128;
++
++  if (name == NULL)
++    return nregs;
++
++  if (regno < 0 || regno >= nregs || namelen < 6)
++    return -1;
++
++  *prefix = "%";
++
++  if (regno < 32)
++  {
++    *setname = "integer";
++    *type = DW_ATE_signed;
++    if (pa64)
++    {
++	*bits = 64;
++    }
++    else
++    {
++    	*bits = 32;
++    }
++  }
++  else if (regno == 32)
++  {
++    *setname = "special";
++    if (pa64)
++    {
++	*bits = 6;
++    }
++    else
++    {
++    	*bits = 5;
++    }
++    *type = DW_ATE_unsigned;
++  }
++  else
++  {
++    *setname = "FPU";
++    *type = DW_ATE_float;
++    if (pa64)
++    {
++	*bits = 64;
++    }
++    else
++    {
++    	*bits = 32;
++    }
++  }
++
++  if (regno < 33) {
++    switch (regno)
++      {
++      case 0 ... 9:
++        name[0] = 'r';
++        name[1] = regno + '0';
++        namelen = 2;
++        break;
++      case 10 ... 31:
++        name[0] = 'r';
++        name[1] = regno / 10 + '0';
++        name[2] = regno % 10 + '0';
++        namelen = 3;
++        break;
++      case 32:
++	*prefix = NULL;
++	name[0] = 'S';
++	name[1] = 'A';
++	name[2] = 'R';
++	namelen = 3;
++	break;
++      }
++  }
++  else {
++    if (pa64 && ((regno - 72) % 2)) {
++      *setname = NULL;
++      return 0;
++    }
++
++    switch (regno)
++      {
++      case 72 + 0 ... 72 + 11:
++        name[0] = 'f';
++	name[1] = 'r';
++        name[2] = (regno + 8 - 72) / 2 + '0';
++        namelen = 3;
++        if ((regno + 8 - 72) % 2) {
++	  name[3] = 'R';
++	  namelen++;
++        }
++        break;
++      case 72 + 12 ... 72 + 55:
++        name[0] = 'f';
++	name[1] = 'r';
++        name[2] = (regno + 8 - 72) / 2 / 10 + '0';
++        name[3] = (regno + 8 - 72) / 2 % 10 + '0';
++        namelen = 4;
++        if ((regno + 8 - 72) % 2) {
++	  name[4] = 'R';
++	  namelen++;
++        }
++        break;
++      default:
++        *setname = NULL;
++        return 0;
++      }
++  }
++  name[namelen++] = '\0';
++  return namelen;
++}
+Index: elfutils-0.146/backends/parisc_reloc.def
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/parisc_reloc.def	2010-04-24 10:10:50.000000000 +0000
+@@ -0,0 +1,128 @@
++/* List the relocation types for PA-RISC.  -*- C -*-
++   Copyright (C) 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++/*	    NAME,		REL|EXEC|DYN	*/
++
++RELOC_TYPE (NONE,		EXEC|DYN)
++RELOC_TYPE (DIR32,		REL|EXEC|DYN)
++RELOC_TYPE (DIR21L,		REL|EXEC|DYN)
++RELOC_TYPE (DIR17R,		REL)
++RELOC_TYPE (DIR17F,		REL)
++RELOC_TYPE (DIR14R,		REL|DYN)
++RELOC_TYPE (PCREL32,		REL)
++RELOC_TYPE (PCREL21L,		REL)
++RELOC_TYPE (PCREL17R,		REL)
++RELOC_TYPE (PCREL17F,		REL)
++RELOC_TYPE (PCREL14R,		REL|EXEC)
++RELOC_TYPE (DPREL21L,		REL)
++RELOC_TYPE (DPREL14WR,		REL)
++RELOC_TYPE (DPREL14DR,          REL)
++RELOC_TYPE (DPREL14R,		REL)
++RELOC_TYPE (GPREL21L,		0)
++RELOC_TYPE (GPREL14R,		0)
++RELOC_TYPE (LTOFF21L,		REL)
++RELOC_TYPE (LTOFF14R,		REL)
++RELOC_TYPE (DLTIND14F,		0)
++RELOC_TYPE (SETBASE,		0)
++RELOC_TYPE (SECREL32,		REL)
++RELOC_TYPE (BASEREL21L,		0)
++RELOC_TYPE (BASEREL17R,		0)
++RELOC_TYPE (BASEREL14R,		0)
++RELOC_TYPE (SEGBASE,		0)
++RELOC_TYPE (SEGREL32,		REL)
++RELOC_TYPE (PLTOFF21L,		0)
++RELOC_TYPE (PLTOFF14R,		0)
++RELOC_TYPE (PLTOFF14F,		0)
++RELOC_TYPE (LTOFF_FPTR32,	0)
++RELOC_TYPE (LTOFF_FPTR21L,	0)
++RELOC_TYPE (LTOFF_FPTR14R,	0)
++RELOC_TYPE (FPTR64,		0)
++RELOC_TYPE (PLABEL32,		REL|DYN)
++RELOC_TYPE (PCREL64,		0)
++RELOC_TYPE (PCREL22C,		0)
++RELOC_TYPE (PCREL22F,		0)
++RELOC_TYPE (PCREL14WR,		0)
++RELOC_TYPE (PCREL14DR,		0)
++RELOC_TYPE (PCREL16F,		0)
++RELOC_TYPE (PCREL16WF,		0)
++RELOC_TYPE (PCREL16DF,		0)
++RELOC_TYPE (DIR64,		REL|DYN)
++RELOC_TYPE (DIR14WR,		REL)
++RELOC_TYPE (DIR14DR,		REL)
++RELOC_TYPE (DIR16F,		REL)
++RELOC_TYPE (DIR16WF,		REL)
++RELOC_TYPE (DIR16DF,		REL)
++RELOC_TYPE (GPREL64,		0)
++RELOC_TYPE (GPREL14WR,		0)
++RELOC_TYPE (GPREL14DR,		0)
++RELOC_TYPE (GPREL16F,		0)
++RELOC_TYPE (GPREL16WF,		0)
++RELOC_TYPE (GPREL16DF,		0)
++RELOC_TYPE (LTOFF64,		0)
++RELOC_TYPE (LTOFF14WR,		0)
++RELOC_TYPE (LTOFF14DR,		0)
++RELOC_TYPE (LTOFF16F,		0)
++RELOC_TYPE (LTOFF16WF,		0)
++RELOC_TYPE (LTOFF16DF,		0)
++RELOC_TYPE (SECREL64,		0)
++RELOC_TYPE (BASEREL14WR,	0)
++RELOC_TYPE (BASEREL14DR,	0)
++RELOC_TYPE (SEGREL64,		0)
++RELOC_TYPE (PLTOFF14WR,		0)
++RELOC_TYPE (PLTOFF14DR,		0)
++RELOC_TYPE (PLTOFF16F,		0)
++RELOC_TYPE (PLTOFF16WF,		0)
++RELOC_TYPE (PLTOFF16DF,		0)
++RELOC_TYPE (LTOFF_FPTR64,	0)
++RELOC_TYPE (LTOFF_FPTR14WR,	0)
++RELOC_TYPE (LTOFF_FPTR14DR,	0)
++RELOC_TYPE (LTOFF_FPTR16F,	0)
++RELOC_TYPE (LTOFF_FPTR16WF,	0)
++RELOC_TYPE (LTOFF_FPTR16DF,	0)
++RELOC_TYPE (COPY,		EXEC)
++RELOC_TYPE (IPLT,		EXEC|DYN)
++RELOC_TYPE (EPLT,		0)
++RELOC_TYPE (TPREL32,		DYN)
++RELOC_TYPE (TPREL21L,		0)
++RELOC_TYPE (TPREL14R,		0)
++RELOC_TYPE (LTOFF_TP21L,	0)
++RELOC_TYPE (LTOFF_TP14R,	0)
++RELOC_TYPE (LTOFF_TP14F,	0)
++RELOC_TYPE (TPREL64,		0)
++RELOC_TYPE (TPREL14WR,		0)
++RELOC_TYPE (TPREL14DR,		0)
++RELOC_TYPE (TPREL16F,		0)
++RELOC_TYPE (TPREL16WF,		0)
++RELOC_TYPE (TPREL16DF,		0)
++RELOC_TYPE (LTOFF_TP64,		0)
++RELOC_TYPE (LTOFF_TP14WR,	0)
++RELOC_TYPE (LTOFF_TP14DR,	0)
++RELOC_TYPE (LTOFF_TP16F,	0)
++RELOC_TYPE (LTOFF_TP16WF,	0)
++RELOC_TYPE (LTOFF_TP16DF,	0)
++RELOC_TYPE (TLS_DTPMOD32,	DYN)
++RELOC_TYPE (TLS_DTPMOD64,	DYN)
++
++#define NO_RELATIVE_RELOC       1
+Index: elfutils-0.146/backends/parisc_retval.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/parisc_retval.c	2010-04-24 10:10:50.000000000 +0000
+@@ -0,0 +1,213 @@
++/* Function return value location for Linux/PA-RISC ABI.
++   Copyright (C) 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <assert.h>
++#include <dwarf.h>
++
++#define BACKEND parisc_
++#include "libebl_CPU.h"
++#include "libebl_parisc.h"
++
++/* %r28, or pair %r28, %r29.  */
++static const Dwarf_Op loc_intreg32[] =
++  {
++    { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++
++static const Dwarf_Op loc_intreg[] =
++  {
++    { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 8 },
++    { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 8 },
++  };
++#define nloc_intreg	1
++#define nloc_intregpair	4
++
++/* %fr4L, or pair %fr4L, %fr4R on pa-32 */
++static const Dwarf_Op loc_fpreg32[] =
++  {
++    { .atom = DW_OP_regx, .number = 72 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 73 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++#define nloc_fpreg32 2
++#define nloc_fpregpair32 4
++
++/* $fr4 */
++static const Dwarf_Op loc_fpreg[] =
++  {
++    { .atom = DW_OP_regx, .number = 72 },
++  };
++#define nloc_fpreg  1
++
++#if 0
++/* The return value is a structure and is actually stored in stack space
++   passed in a hidden argument by the caller. Address of the location is stored
++   in %r28 before function call, but it may be changed by function. */
++static const Dwarf_Op loc_aggregate[] =
++  {
++    { .atom = DW_OP_breg28 },
++  };
++#define nloc_aggregate 1
++#endif
++
++static int
++parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, int pa64)
++{
++  Dwarf_Word regsize = pa64 ? 8 : 4;
++
++  /* Start with the function's type, and get the DW_AT_type attribute,
++     which is the type of the return value.  */
++
++  Dwarf_Attribute attr_mem;
++  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
++  if (attr == NULL)
++    /* The function has no return value, like a `void' function in C.  */
++    return 0;
++
++  Dwarf_Die die_mem;
++  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
++  int tag = dwarf_tag (typedie);
++
++  /* Follow typedefs and qualifiers to get to the actual type.  */
++  while (tag == DW_TAG_typedef
++	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
++	 || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
++    {
++      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++      typedie = dwarf_formref_die (attr, &die_mem);
++      tag = dwarf_tag (typedie);
++    }
++
++  switch (tag)
++    {
++    case -1:
++      return -1;
++
++    case DW_TAG_subrange_type:
++      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
++	{
++	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++	  typedie = dwarf_formref_die (attr, &die_mem);
++	  tag = dwarf_tag (typedie);
++	}
++      /* Fall through.  */
++
++    case DW_TAG_base_type:
++    case DW_TAG_enumeration_type:
++    case DW_TAG_pointer_type:
++    case DW_TAG_ptr_to_member_type:
++      {
++        Dwarf_Word size;
++	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
++					 &attr_mem), &size) != 0)
++	  {
++	    if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
++	      size = 4;
++	    else
++	      return -1;
++	  }
++	if (tag == DW_TAG_base_type)
++	  {
++	    Dwarf_Word encoding;
++	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++					     &attr_mem), &encoding) != 0)
++	      return -1;
++
++	    if (encoding == DW_ATE_float)
++	      {
++		if (pa64) {
++		  *locp = loc_fpreg;
++		  if (size <= 8)
++		      return nloc_fpreg;
++		}
++		else {
++		  *locp = loc_fpreg32;
++		  if (size <= 4)
++		    return nloc_fpreg32;
++		  else if (size <= 8)
++		    return nloc_fpregpair32;
++		}
++		goto aggregate;
++	      }
++	  }
++	if (pa64)
++	  *locp = loc_intreg;
++	else
++	  *locp = loc_intreg32;
++	if (size <= regsize)
++	  return nloc_intreg;
++	if (size <= 2 * regsize)
++	  return nloc_intregpair;
++
++	/* Else fall through.  */
++      }
++
++    case DW_TAG_structure_type:
++    case DW_TAG_class_type:
++    case DW_TAG_union_type:
++    case DW_TAG_array_type:
++    aggregate: {
++        Dwarf_Word size;
++	if (dwarf_aggregate_size (typedie, &size) != 0)
++	  return -1;
++	if (pa64)
++          *locp = loc_intreg;
++	else
++	  *locp = loc_intreg32;
++        if (size <= regsize)
++	  return nloc_intreg;
++        if (size <= 2 * regsize)
++	  return nloc_intregpair;
++#if 0
++	/* there should be some way to know this location... But I do not see it. */
++        *locp = loc_aggregate;
++        return nloc_aggregate;
++#endif
++	/* fall through.  */
++      }
++    }
++
++  /* XXX We don't have a good way to return specific errors from ebl calls.
++     This value means we do not understand the type, but it is well-formed
++     DWARF and might be valid.  */
++  return -2;
++}
++
++int
++parisc_return_value_location_32 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++  return parisc_return_value_location_ (functypedie, locp, 0);
++}
++
++int
++parisc_return_value_location_64 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++  return parisc_return_value_location_ (functypedie, locp, 1);
++}
++
+Index: elfutils-0.146/backends/parisc_symbol.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/parisc_symbol.c	2010-04-24 10:10:50.000000000 +0000
+@@ -0,0 +1,112 @@
++/* PA-RISC specific symbolic name handling.
++   Copyright (C) 2002, 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND		parisc_
++#include "libebl_CPU.h"
++
++const char *
++parisc_segment_type_name (int segment, char *buf __attribute__ ((unused)),
++			size_t len __attribute__ ((unused)))
++{
++  switch (segment)
++    {
++    case PT_PARISC_ARCHEXT:
++      return "PARISC_ARCHEXT";
++    case PT_PARISC_UNWIND:
++      return "PARISC_UNWIND";
++    default:
++      break;
++    }
++  return NULL;
++}
++
++/* Return symbolic representation of symbol type.  */
++const char *
++parisc_symbol_type_name(int symbol, char *buf __attribute__ ((unused)),
++    size_t len __attribute__ ((unused)))
++{
++	if (symbol == STT_PARISC_MILLICODE)
++	  return "PARISC_MILLI";
++	return NULL;
++}
++
++/* Return symbolic representation of section type.  */
++const char *
++parisc_section_type_name (int type,
++			char *buf __attribute__ ((unused)),
++			size_t len __attribute__ ((unused)))
++{
++  switch (type)
++    {
++    case SHT_PARISC_EXT:
++      return "PARISC_EXT";
++    case SHT_PARISC_UNWIND:
++      return "PARISC_UNWIND";
++    case SHT_PARISC_DOC:
++      return "PARISC_DOC";
++    }
++
++  return NULL;
++}
++
++/* Check whether machine flags are valid.  */
++bool
++parisc_machine_flag_check (GElf_Word flags)
++{
++  if (flags &~ (EF_PARISC_TRAPNIL | EF_PARISC_EXT | EF_PARISC_LSB |
++	EF_PARISC_WIDE | EF_PARISC_NO_KABP |
++	EF_PARISC_LAZYSWAP | EF_PARISC_ARCH))
++    return 0;
++
++  GElf_Word arch = flags & EF_PARISC_ARCH;
++
++  return ((arch == EFA_PARISC_1_0) || (arch == EFA_PARISC_1_1) ||
++      (arch == EFA_PARISC_2_0));
++}
++
++/* Check for the simple reloc types.  */
++Elf_Type
++parisc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++  switch (type)
++    {
++    case R_PARISC_DIR64:
++    case R_PARISC_SECREL64:
++      return ELF_T_XWORD;
++    case R_PARISC_DIR32:
++    case R_PARISC_SECREL32:
++      return ELF_T_WORD;
++    default:
++      return ELF_T_NUM;
++    }
++}
+Index: elfutils-0.146/backends/libebl_parisc.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/libebl_parisc.h	2010-04-24 10:10:50.000000000 +0000
+@@ -0,0 +1,9 @@
++#ifndef _LIBEBL_HPPA_H
++#define _LIBEBL_HPPA_H 1
++
++#include <libdw.h>
++
++extern int parisc_return_value_location_32(Dwarf_Die *, const Dwarf_Op **locp);
++extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp);
++
++#endif
+Index: elfutils-0.146/backends/Makefile.am
+===================================================================
+--- elfutils-0.146.orig/backends/Makefile.am	2010-04-24 10:10:41.000000000 +0000
++++ elfutils-0.146/backends/Makefile.am	2010-04-24 10:10:50.000000000 +0000
+@@ -29,11 +29,11 @@
+ 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
+ 
+ 
+-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390
++modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc
+ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
+ 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
+ 	     libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
+-	     libebl_s390_pic.a
++	     libebl_s390_pic.a libebl_parisc_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+ 
+@@ -95,6 +95,9 @@
+ libebl_s390_pic_a_SOURCES = $(s390_SRCS)
+ am_libebl_s390_pic_a_OBJECTS = $(s390_SRCS:.c=.os)
+ 
++parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
++libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
++am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
+ 
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ 	@rm -f $(@:.so=.map)
+Index: elfutils-0.146/libelf/elf.h
+===================================================================
+--- elfutils-0.146.orig/libelf/elf.h	2010-04-13 20:08:02.000000000 +0000
++++ elfutils-0.146/libelf/elf.h	2010-04-24 10:10:50.000000000 +0000
+@@ -1789,16 +1789,24 @@
+ #define R_PARISC_PCREL17F	12	/* 17 bits of rel. address.  */
+ #define R_PARISC_PCREL14R	14	/* Right 14 bits of rel. address.  */
+ #define R_PARISC_DPREL21L	18	/* Left 21 bits of rel. address.  */
++#define R_PARISC_DPREL14WR	19
++#define R_PARISC_DPREL14DR	20
+ #define R_PARISC_DPREL14R	22	/* Right 14 bits of rel. address.  */
+ #define R_PARISC_GPREL21L	26	/* GP-relative, left 21 bits.  */
+ #define R_PARISC_GPREL14R	30	/* GP-relative, right 14 bits.  */
+ #define R_PARISC_LTOFF21L	34	/* LT-relative, left 21 bits.  */
+ #define R_PARISC_LTOFF14R	38	/* LT-relative, right 14 bits.  */
++#define R_PARISC_DLTIND14F	39
++#define R_PARISC_SETBASE	40
+ #define R_PARISC_SECREL32	41	/* 32 bits section rel. address.  */
++#define R_PARISC_BASEREL21L	42
++#define R_PARISC_BASEREL17R	43
++#define R_PARISC_BASEREL14R	46
+ #define R_PARISC_SEGBASE	48	/* No relocation, set segment base.  */
+ #define R_PARISC_SEGREL32	49	/* 32 bits segment rel. address.  */
+ #define R_PARISC_PLTOFF21L	50	/* PLT rel. address, left 21 bits.  */
+ #define R_PARISC_PLTOFF14R	54	/* PLT rel. address, right 14 bits.  */
++#define R_PARISC_PLTOFF14F	55
+ #define R_PARISC_LTOFF_FPTR32	57	/* 32 bits LT-rel. function pointer. */
+ #define R_PARISC_LTOFF_FPTR21L	58	/* LT-rel. fct ptr, left 21 bits. */
+ #define R_PARISC_LTOFF_FPTR14R	62	/* LT-rel. fct ptr, right 14 bits. */
+@@ -1807,6 +1815,7 @@
+ #define R_PARISC_PLABEL21L	66	/* Left 21 bits of fdesc address.  */
+ #define R_PARISC_PLABEL14R	70	/* Right 14 bits of fdesc address.  */
+ #define R_PARISC_PCREL64	72	/* 64 bits PC-rel. address.  */
++#define R_PARISC_PCREL22C	73
+ #define R_PARISC_PCREL22F	74	/* 22 bits PC-rel. address.  */
+ #define R_PARISC_PCREL14WR	75	/* PC-rel. address, right 14 bits.  */
+ #define R_PARISC_PCREL14DR	76	/* PC rel. address, right 14 bits.  */
+@@ -1832,6 +1841,8 @@
+ #define R_PARISC_LTOFF16WF	102	/* 16 bits LT-rel. address.  */
+ #define R_PARISC_LTOFF16DF	103	/* 16 bits LT-rel. address.  */
+ #define R_PARISC_SECREL64	104	/* 64 bits section rel. address.  */
++#define R_PARISC_BASEREL14WR	107
++#define R_PARISC_BASEREL14DR	108
+ #define R_PARISC_SEGREL64	112	/* 64 bits segment rel. address.  */
+ #define R_PARISC_PLTOFF14WR	115	/* PLT-rel. address, right 14 bits.  */
+ #define R_PARISC_PLTOFF14DR	116	/* PLT-rel. address, right 14 bits.  */
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h b/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h
new file mode 100644
index 0000000..a5cc01f
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/i386_dis.h
@@ -0,0 +1,1657 @@
+#define MNEMONIC_BITS 10
+#define SUFFIX_BITS 3
+#define FCT1_BITS 7
+#define STR1_BITS 4
+#define OFF1_1_BITS 7
+#define OFF1_1_BIAS 3
+#define OFF1_2_BITS 7
+#define OFF1_2_BIAS 4
+#define OFF1_3_BITS 1
+#define OFF1_3_BIAS 7
+#define FCT2_BITS 6
+#define STR2_BITS 2
+#define OFF2_1_BITS 7
+#define OFF2_1_BIAS 5
+#define OFF2_2_BITS 7
+#define OFF2_2_BIAS 4
+#define OFF2_3_BITS 4
+#define OFF2_3_BIAS 7
+#define FCT3_BITS 4
+#define STR3_BITS 1
+#define OFF3_1_BITS 6
+#define OFF3_1_BIAS 10
+#define OFF3_2_BITS 1
+#define OFF3_2_BIAS 21
+
+#include <i386_data.h>
+
+#define suffix_none 0
+#define suffix_w 1
+#define suffix_w0 2
+#define suffix_W 3
+#define suffix_tttn 4
+#define suffix_D 7
+#define suffix_w1 5
+#define suffix_W1 6
+
+static const opfct_t op1_fct[] =
+{
+  NULL,
+  FCT_MOD$R_M,
+  FCT_Mod$R_m,
+  FCT_abs,
+  FCT_ax,
+  FCT_ax$w,
+  FCT_ccc,
+  FCT_ddd,
+  FCT_disp8,
+  FCT_ds_bx,
+  FCT_ds_si,
+  FCT_dx,
+  FCT_es_di,
+  FCT_freg,
+  FCT_imm$s,
+  FCT_imm$w,
+  FCT_imm16,
+  FCT_imm8,
+  FCT_imms8,
+  FCT_mmxreg,
+  FCT_mod$16r_m,
+  FCT_mod$64r_m,
+  FCT_mod$8r_m,
+  FCT_mod$r_m,
+  FCT_mod$r_m$w,
+  FCT_reg,
+  FCT_reg$w,
+  FCT_reg16,
+  FCT_reg64,
+  FCT_rel,
+  FCT_sel,
+  FCT_sreg2,
+  FCT_sreg3,
+  FCT_string,
+  FCT_xmmreg,
+};
+static const char op1_str[] =
+  "%ax\0"
+  "%cl\0"
+  "%eax\0"
+  "%st\0"
+  "%xmm0\0"
+  "*";
+static const uint8_t op1_str_idx[] = {
+  0,
+  4,
+  8,
+  13,
+  17,
+  23,
+};
+static const opfct_t op2_fct[] =
+{
+  NULL,
+  FCT_MOD$R_M,
+  FCT_Mod$R_m,
+  FCT_abs,
+  FCT_absval,
+  FCT_ax$w,
+  FCT_ccc,
+  FCT_ddd,
+  FCT_ds_si,
+  FCT_dx,
+  FCT_es_di,
+  FCT_freg,
+  FCT_imm8,
+  FCT_mmxreg,
+  FCT_mod$64r_m,
+  FCT_mod$r_m,
+  FCT_mod$r_m$w,
+  FCT_moda$r_m,
+  FCT_reg,
+  FCT_reg$w,
+  FCT_reg64,
+  FCT_sreg3,
+  FCT_string,
+  FCT_xmmreg,
+};
+static const char op2_str[] =
+  "%ecx\0"
+  "%st";
+static const uint8_t op2_str_idx[] = {
+  0,
+  5,
+};
+static const opfct_t op3_fct[] =
+{
+  NULL,
+  FCT_mmxreg,
+  FCT_mod$r_m,
+  FCT_reg,
+  FCT_string,
+  FCT_xmmreg,
+};
+static const char op3_str[] =
+  "%edx";
+static const uint8_t op3_str_idx[] = {
+  0,
+};
+static const struct instr_enc instrtab[] =
+{
+  { .mnemonic = MNE_aaa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_aad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_aam, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_aas, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_arpl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bound, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 17, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bsf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bswap, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lcall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 30, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 4, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lcall, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_clc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cli, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_syscall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_clts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sysret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sysenter, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sysexit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmov, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmps, .rep = 0, .repe = 1, .suffix = 1, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 8, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpxchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpxchg8b, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cpuid, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtdq2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_daa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_das, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_dec, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_dec, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_div, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_enter, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 19, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fabs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ftst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fxam, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fld1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldl2t, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldl2e, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldpi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldlg2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldln2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldz, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_f2xm1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fyl2x, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fptan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fpatan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fxtract, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fprem1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fprem, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fyl2xp1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsqrt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsincos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_frndint, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fscale, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsin, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnstenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnstcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fxch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_faddp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fiadd, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fmulp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fimul, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsubp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fisub, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsubrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fisubr, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 1, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fbld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fbstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_finit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovnb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovnbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovnu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcompp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fucomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fucomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fidivl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fidiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fidivrl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fidivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ffree, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ficom, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ficomp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fild, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fildl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fildll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fninit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fist, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fistp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fistpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fisttp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fisttpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fstpt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fucom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_frstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fucomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_hlt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_idiv, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 14, .str1 = 0, .off1_1 = 13, .off1_2 = 2, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_inc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_inc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ins, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_int, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_int3, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_into, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_invd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_swapgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_invlpg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_iret, .rep = 0, .repe = 0, .suffix = 6, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 30, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 4, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 21, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lar, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lds, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lea, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_leave, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_les, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lfs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lgdt, .rep = 0, .repe = 0, .suffix = 2, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lidt, .rep = 0, .repe = 0, .suffix = 2, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lmsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lock, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lods, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_loop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_loope, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_loopne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lsl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ltr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 3, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 35, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 37, .off1_2 = 3, .off1_3 = 0, .fct2 = 3, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 6, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 6, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 7, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 7, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movsbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movswl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movzbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movzwl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_neg, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pause, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_nop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_popcnt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_not, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_outs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_popf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 25, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 14, .str1 = 0, .off1_1 = 5, .off1_2 = 2, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pusha, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_popa, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pushf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rdmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rdpmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rdtsc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rsm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_scas, .rep = 0, .repe = 1, .suffix = 0, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+  { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+  { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+  { .mnemonic = MNE_vmcall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmlaunch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmresume, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmxoff, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmread, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 28, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 14, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmwrite, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sgdtl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_monitor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 4, .str3 = 1, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 22, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sidtl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_smsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_stc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_std, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_stos, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_str, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ud2a, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_verr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_verw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_wbinvd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetchw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetchnta, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetcht0, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetcht1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetcht2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_nop, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_wrmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 4, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xlat, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 9, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpeqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpunordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpneqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpnltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpnleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpeqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpunordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpneqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpnltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpnless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fxrstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fxsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ldmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_stmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movddup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movsldup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_unpcklpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_unpcklps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_unpckhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_unpckhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movshdup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtsi2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtsi2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtpi2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtpi2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movntpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movntps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ucomisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ucomiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_comisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_comiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_getsec, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movmskpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movmskps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sqrtpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sqrtsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rsqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rsqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcpss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_orpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_orps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xorpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xorps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mulsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mulss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mulpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mulps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtsd2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtss2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtpd2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtps2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtdq2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_subsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_subss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_subpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_subps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_minsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_minss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_minpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_minps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_divsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_divss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_divpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_divps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maxss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maxpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maxps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpcklqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pshufd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_pshuflw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_pshufhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_pshufw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_haddpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_haddps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_hsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_hsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movnti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+  { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+  { .mnemonic = MNE_shufpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_shufps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movdq2q, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movq2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 19, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 19, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movntdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movntq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lddqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maskmovdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maskmovq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 19, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_vmclear, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmxon, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmptrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmptrst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pslldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_clflush, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_blendps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_blendpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_blendvps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_blendvpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_dpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_dppd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_insertps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_movntdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mpsadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_packusdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pblendvb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pblendw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpestri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpestrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpistri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpistrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phminposuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pinsrb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pinsrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmuldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ptest, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 23, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_roundps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_roundpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_roundss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_roundsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 17, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+};
+static const uint8_t match_data[] =
+{
+  0x11, 0x37,
+  0x22, 0xd5, 0xa,
+  0x22, 0xd4, 0xa,
+  0x11, 0x3f,
+  0x1, 0xfe, 0x14,
+  0x2, 0xfe, 0x80, 0x38, 0x10,
+  0x2, 0xfe, 0x82, 0x38, 0x10,
+  0x2, 0xfe, 0x10, 0, 0,
+  0x2, 0xfe, 0x12, 0, 0,
+  0x1, 0xfe, 0x4,
+  0x2, 0xfe, 0x80, 0x38, 0,
+  0x12, 0x83, 0x38, 0,
+  0x2, 0xfe, 0, 0, 0,
+  0x2, 0xfe, 0x2, 0, 0,
+  0x34, 0x66, 0xf, 0xd0, 0, 0,
+  0x34, 0xf2, 0xf, 0xd0, 0, 0,
+  0x1, 0xfe, 0x24,
+  0x2, 0xfe, 0x80, 0x38, 0x20,
+  0x2, 0xfe, 0x82, 0x38, 0x20,
+  0x2, 0xfe, 0x20, 0, 0,
+  0x2, 0xfe, 0x22, 0, 0,
+  0x34, 0x66, 0xf, 0x54, 0, 0,
+  0x23, 0xf, 0x54, 0, 0,
+  0x34, 0x66, 0xf, 0x55, 0, 0,
+  0x23, 0xf, 0x55, 0, 0,
+  0x12, 0x63, 0, 0,
+  0x12, 0x62, 0, 0,
+  0x23, 0xf, 0xbc, 0, 0,
+  0x23, 0xf, 0xbd, 0, 0,
+  0x12, 0xf, 0xf8, 0xc8,
+  0x23, 0xf, 0xa3, 0, 0,
+  0x23, 0xf, 0xba, 0x38, 0x20,
+  0x23, 0xf, 0xbb, 0, 0,
+  0x23, 0xf, 0xba, 0x38, 0x38,
+  0x23, 0xf, 0xb3, 0, 0,
+  0x23, 0xf, 0xba, 0x38, 0x30,
+  0x23, 0xf, 0xab, 0, 0,
+  0x23, 0xf, 0xba, 0x38, 0x28,
+  0x11, 0xe8,
+  0x12, 0xff, 0x38, 0x10,
+  0x11, 0x9a,
+  0x12, 0xff, 0x38, 0x18,
+  0x11, 0x98,
+  0x11, 0x99,
+  0x11, 0xf8,
+  0x11, 0xfc,
+  0x11, 0xfa,
+  0x22, 0xf, 0x5,
+  0x22, 0xf, 0x6,
+  0x22, 0xf, 0x7,
+  0x22, 0xf, 0x34,
+  0x22, 0xf, 0x35,
+  0x11, 0xf5,
+  0x13, 0xf, 0xf0, 0x40, 0, 0,
+  0x1, 0xfe, 0x3c,
+  0x2, 0xfe, 0x80, 0x38, 0x38,
+  0x12, 0x83, 0x38, 0x38,
+  0x2, 0xfe, 0x38, 0, 0,
+  0x2, 0xfe, 0x3a, 0, 0,
+  0x34, 0xf2, 0xf, 0xc2, 0, 0,
+  0x34, 0xf3, 0xf, 0xc2, 0, 0,
+  0x34, 0x66, 0xf, 0xc2, 0, 0,
+  0x23, 0xf, 0xc2, 0, 0,
+  0x1, 0xfe, 0xa6,
+  0x13, 0xf, 0xfe, 0xb0, 0, 0,
+  0x23, 0xf, 0xc7, 0x38, 0x8,
+  0x22, 0xf, 0xa2,
+  0x34, 0xf3, 0xf, 0xe6, 0, 0,
+  0x34, 0xf2, 0xf, 0xe6, 0, 0,
+  0x34, 0x66, 0xf, 0xe6, 0, 0,
+  0x11, 0x27,
+  0x11, 0x2f,
+  0x2, 0xfe, 0xfe, 0x38, 0x8,
+  0x1, 0xf8, 0x48,
+  0x2, 0xfe, 0xf6, 0x38, 0x30,
+  0x22, 0xf, 0x77,
+  0x11, 0xc8,
+  0x22, 0xd9, 0xd0,
+  0x22, 0xd9, 0xe0,
+  0x22, 0xd9, 0xe1,
+  0x22, 0xd9, 0xe4,
+  0x22, 0xd9, 0xe5,
+  0x22, 0xd9, 0xe8,
+  0x22, 0xd9, 0xe9,
+  0x22, 0xd9, 0xea,
+  0x22, 0xd9, 0xeb,
+  0x22, 0xd9, 0xec,
+  0x22, 0xd9, 0xed,
+  0x22, 0xd9, 0xee,
+  0x22, 0xd9, 0xf0,
+  0x22, 0xd9, 0xf1,
+  0x22, 0xd9, 0xf2,
+  0x22, 0xd9, 0xf3,
+  0x22, 0xd9, 0xf4,
+  0x22, 0xd9, 0xf5,
+  0x22, 0xd9, 0xf6,
+  0x22, 0xd9, 0xf7,
+  0x22, 0xd9, 0xf8,
+  0x22, 0xd9, 0xf9,
+  0x22, 0xd9, 0xfa,
+  0x22, 0xd9, 0xfb,
+  0x22, 0xd9, 0xfc,
+  0x22, 0xd9, 0xfd,
+  0x22, 0xd9, 0xfe,
+  0x22, 0xd9, 0xff,
+  0x12, 0xd8, 0xf8, 0xc0,
+  0x12, 0xdc, 0xf8, 0xc0,
+  0x2, 0xfb, 0xd8, 0x38, 0,
+  0x12, 0xd8, 0xf8, 0xc8,
+  0x12, 0xdc, 0xf8, 0xc8,
+  0x2, 0xfb, 0xd8, 0x38, 0x8,
+  0x12, 0xd8, 0xf8, 0xe0,
+  0x12, 0xdc, 0xf8, 0xe0,
+  0x2, 0xfb, 0xd8, 0x38, 0x20,
+  0x12, 0xd8, 0xf8, 0xe8,
+  0x12, 0xdc, 0xf8, 0xe8,
+  0x2, 0xfb, 0xd8, 0x38, 0x28,
+  0x12, 0xdd, 0xf8, 0xd0,
+  0x2, 0xfb, 0xd9, 0x38, 0x10,
+  0x12, 0xdd, 0xf8, 0xd8,
+  0x2, 0xfb, 0xd9, 0x38, 0x18,
+  0x12, 0xd9, 0x38, 0x20,
+  0x12, 0xd9, 0x38, 0x28,
+  0x12, 0xd9, 0x38, 0x30,
+  0x12, 0xd9, 0x38, 0x38,
+  0x12, 0xd9, 0xf8, 0xc8,
+  0x12, 0xde, 0xf8, 0xc0,
+  0x12, 0xda, 0xf8, 0xc0,
+  0x2, 0xfb, 0xda, 0x38, 0,
+  0x12, 0xda, 0xf8, 0xc8,
+  0x12, 0xde, 0xf8, 0xc8,
+  0x2, 0xfb, 0xda, 0x38, 0x8,
+  0x12, 0xde, 0xf8, 0xe0,
+  0x2, 0xfb, 0xda, 0x38, 0x20,
+  0x12, 0xde, 0xf8, 0xe8,
+  0x2, 0xfb, 0xda, 0x38, 0x28,
+  0x22, 0xdf, 0xe0,
+  0x12, 0xdf, 0x38, 0x20,
+  0x12, 0xdf, 0xf8, 0xf0,
+  0x12, 0xdf, 0x38, 0x30,
+  0x22, 0xd9, 0xe0,
+  0x33, 0x9b, 0xdb, 0xe2,
+  0x33, 0x9b, 0xdb, 0xe3,
+  0x11, 0x9b,
+  0x22, 0xdb, 0xe2,
+  0x12, 0xda, 0xf8, 0xc0,
+  0x12, 0xda, 0xf8, 0xc8,
+  0x12, 0xda, 0xf8, 0xd0,
+  0x12, 0xda, 0xf8, 0xd8,
+  0x12, 0xdb, 0xf8, 0xc0,
+  0x12, 0xdb, 0xf8, 0xc8,
+  0x12, 0xdb, 0xf8, 0xd0,
+  0x12, 0xdb, 0xf8, 0xd8,
+  0x12, 0xd8, 0xf8, 0xd0,
+  0x2, 0xfb, 0xd8, 0x38, 0x10,
+  0x12, 0xd8, 0xf8, 0xd8,
+  0x2, 0xfb, 0xd8, 0x38, 0x18,
+  0x22, 0xde, 0xd9,
+  0x12, 0xdb, 0xf8, 0xf0,
+  0x12, 0xdf, 0xf8, 0xf0,
+  0x12, 0xdb, 0xf8, 0xe8,
+  0x12, 0xdf, 0xf8, 0xe8,
+  0x22, 0xd9, 0xff,
+  0x22, 0xd9, 0xf6,
+  0x12, 0xd8, 0xf8, 0xf0,
+  0x12, 0xdc, 0xf8, 0xf0,
+  0x2, 0xfb, 0xd8, 0x38, 0x30,
+  0x12, 0xda, 0x38, 0x30,
+  0x12, 0xde, 0xf8, 0xf0,
+  0x12, 0xde, 0x38, 0x30,
+  0x12, 0xde, 0xf8, 0xf8,
+  0x12, 0xd8, 0xf8, 0xf8,
+  0x12, 0xdc, 0xf8, 0xf8,
+  0x2, 0xfb, 0xd8, 0x38, 0x38,
+  0x12, 0xda, 0x38, 0x38,
+  0x12, 0xde, 0x38, 0x38,
+  0x12, 0xde, 0xf8, 0xf0,
+  0x12, 0xdd, 0xf8, 0xc0,
+  0x12, 0xda, 0xf8, 0xd0,
+  0x2, 0xfb, 0xda, 0x38, 0x10,
+  0x12, 0xda, 0xf8, 0xd8,
+  0x2, 0xfb, 0xda, 0x38, 0x18,
+  0x12, 0xdf, 0x38, 0,
+  0x12, 0xdb, 0x38, 0,
+  0x12, 0xdf, 0x38, 0x28,
+  0x22, 0xd9, 0xf7,
+  0x22, 0xdb, 0xe3,
+  0x2, 0xfb, 0xdb, 0x38, 0x10,
+  0x2, 0xfb, 0xdb, 0x38, 0x18,
+  0x12, 0xdf, 0x38, 0x38,
+  0x2, 0xfb, 0xdb, 0x38, 0x8,
+  0x12, 0xdd, 0x38, 0x8,
+  0x12, 0xdb, 0x38, 0x28,
+  0x12, 0xdb, 0x38, 0x38,
+  0x12, 0xd9, 0xf8, 0xc0,
+  0x2, 0xfb, 0xd9, 0x38, 0,
+  0x12, 0xdd, 0xf8, 0xe0,
+  0x12, 0xdd, 0x38, 0x20,
+  0x12, 0xdd, 0xf8, 0xe8,
+  0x12, 0xdd, 0x38, 0x30,
+  0x12, 0xdd, 0x38, 0x38,
+  0x11, 0xf4,
+  0x2, 0xfe, 0xf6, 0x38, 0x38,
+  0x2, 0xfe, 0xf6, 0x38, 0x28,
+  0x23, 0xf, 0xaf, 0, 0,
+  0x2, 0xfd, 0x69, 0, 0,
+  0x1, 0xfe, 0xe4,
+  0x1, 0xfe, 0xec,
+  0x2, 0xfe, 0xfe, 0x38, 0,
+  0x1, 0xf8, 0x40,
+  0x1, 0xfe, 0x6c,
+  0x11, 0xcd,
+  0x11, 0xcc,
+  0x11, 0xce,
+  0x22, 0xf, 0x8,
+  0x33, 0xf, 0x1, 0xf8,
+  0x23, 0xf, 0x1, 0x38, 0x38,
+  0x11, 0xcf,
+  0x1, 0xf0, 0x70,
+  0x12, 0xf, 0xf0, 0x80,
+  0x13, 0xf, 0xf0, 0x90, 0x38, 0,
+  0x11, 0xe3,
+  0x11, 0xeb,
+  0x11, 0xe9,
+  0x12, 0xff, 0x38, 0x20,
+  0x11, 0xea,
+  0x12, 0xff, 0x38, 0x28,
+  0x11, 0x9f,
+  0x23, 0xf, 0x2, 0, 0,
+  0x12, 0xc5, 0, 0,
+  0x12, 0x8d, 0, 0,
+  0x11, 0xc9,
+  0x12, 0xc4, 0, 0,
+  0x23, 0xf, 0xb4, 0, 0,
+  0x23, 0xf, 0xb5, 0, 0,
+  0x23, 0xf, 0x1, 0x38, 0x10,
+  0x23, 0xf, 0x1, 0x38, 0x18,
+  0x23, 0xf, 0, 0x38, 0x10,
+  0x23, 0xf, 0x1, 0x38, 0x30,
+  0x11, 0xf0,
+  0x1, 0xfe, 0xac,
+  0x11, 0xe2,
+  0x11, 0xe1,
+  0x11, 0xe0,
+  0x23, 0xf, 0x3, 0, 0,
+  0x23, 0xf, 0xb2, 0, 0,
+  0x23, 0xf, 0, 0x38, 0x18,
+  0x2, 0xfe, 0x88, 0, 0,
+  0x2, 0xfe, 0x8a, 0, 0,
+  0x2, 0xfe, 0xc6, 0x38, 0,
+  0x1, 0xf0, 0xb0,
+  0x1, 0xfe, 0xa0,
+  0x1, 0xfe, 0xa2,
+  0x23, 0xf, 0x20, 0xc0, 0xc0,
+  0x23, 0xf, 0x22, 0xc0, 0xc0,
+  0x23, 0xf, 0x21, 0xc0, 0xc0,
+  0x23, 0xf, 0x23, 0xc0, 0xc0,
+  0x12, 0x8c, 0, 0,
+  0x12, 0x8e, 0, 0,
+  0x1, 0xfe, 0xa4,
+  0x23, 0xf, 0xbe, 0, 0,
+  0x23, 0xf, 0xbf, 0, 0,
+  0x23, 0xf, 0xb6, 0, 0,
+  0x23, 0xf, 0xb7, 0, 0,
+  0x2, 0xfe, 0xf6, 0x38, 0x20,
+  0x2, 0xfe, 0xf6, 0x38, 0x18,
+  0x22, 0xf3, 0x90,
+  0x11, 0x90,
+  0x34, 0xf3, 0xf, 0xb8, 0, 0,
+  0x2, 0xfe, 0xf6, 0x38, 0x10,
+  0x2, 0xfe, 0x8, 0, 0,
+  0x2, 0xfe, 0xa, 0, 0,
+  0x2, 0xfe, 0x80, 0x38, 0x8,
+  0x2, 0xfe, 0x82, 0x38, 0x8,
+  0x1, 0xfe, 0xc,
+  0x1, 0xfe, 0xe6,
+  0x1, 0xfe, 0xee,
+  0x1, 0xfe, 0x6e,
+  0x12, 0x8f, 0x38, 0,
+  0x12, 0xf, 0xc7, 0x81,
+  0x11, 0x9d,
+  0x12, 0xff, 0x38, 0x30,
+  0x1, 0xf8, 0x50,
+  0x1, 0xf8, 0x58,
+  0x1, 0xfd, 0x68,
+  0x1, 0xe7, 0x6,
+  0x12, 0xf, 0xc7, 0x80,
+  0x11, 0x60,
+  0x11, 0x61,
+  0x11, 0x9c,
+  0x2, 0xfe, 0xd0, 0x38, 0x10,
+  0x2, 0xfe, 0xd2, 0x38, 0x10,
+  0x2, 0xfe, 0xc0, 0x38, 0x10,
+  0x2, 0xfe, 0xd0, 0x38, 0x18,
+  0x2, 0xfe, 0xd2, 0x38, 0x18,
+  0x2, 0xfe, 0xc0, 0x38, 0x18,
+  0x22, 0xf, 0x32,
+  0x22, 0xf, 0x33,
+  0x22, 0xf, 0x31,
+  0x11, 0xc3,
+  0x11, 0xc2,
+  0x11, 0xcb,
+  0x11, 0xca,
+  0x2, 0xfe, 0xd0, 0x38, 0,
+  0x2, 0xfe, 0xd2, 0x38, 0,
+  0x2, 0xfe, 0xc0, 0x38, 0,
+  0x2, 0xfe, 0xd0, 0x38, 0x8,
+  0x2, 0xfe, 0xd2, 0x38, 0x8,
+  0x2, 0xfe, 0xc0, 0x38, 0x8,
+  0x22, 0xf, 0xaa,
+  0x11, 0x9e,
+  0x2, 0xfe, 0xd0, 0x38, 0x38,
+  0x2, 0xfe, 0xd2, 0x38, 0x38,
+  0x2, 0xfe, 0xc0, 0x38, 0x38,
+  0x2, 0xfe, 0x18, 0, 0,
+  0x2, 0xfe, 0x1a, 0, 0,
+  0x1, 0xfe, 0x1c,
+  0x2, 0xfe, 0x80, 0x38, 0x18,
+  0x2, 0xfe, 0x82, 0x38, 0x18,
+  0x1, 0xfe, 0xae,
+  0x13, 0xf, 0xf0, 0x90, 0x38, 0,
+  0x2, 0xfe, 0xd0, 0x38, 0x20,
+  0x2, 0xfe, 0xd2, 0x38, 0x20,
+  0x2, 0xfe, 0xc0, 0x38, 0x20,
+  0x2, 0xfe, 0xd0, 0x38, 0x28,
+  0x23, 0xf, 0xa4, 0, 0,
+  0x23, 0xf, 0xa5, 0, 0,
+  0x2, 0xfe, 0xd2, 0x38, 0x28,
+  0x2, 0xfe, 0xc0, 0x38, 0x28,
+  0x23, 0xf, 0xac, 0, 0,
+  0x23, 0xf, 0xad, 0, 0,
+  0x33, 0xf, 0x1, 0xc1,
+  0x33, 0xf, 0x1, 0xc2,
+  0x33, 0xf, 0x1, 0xc3,
+  0x33, 0xf, 0x1, 0xc4,
+  0x23, 0xf, 0x78, 0, 0,
+  0x23, 0xf, 0x79, 0, 0,
+  0x23, 0xf, 0x1, 0x38, 0,
+  0x33, 0xf, 0x1, 0xc8,
+  0x33, 0xf, 0x1, 0xc9,
+  0x23, 0xf, 0x1, 0x38, 0x8,
+  0x23, 0xf, 0, 0x38, 0,
+  0x23, 0xf, 0x1, 0x38, 0x20,
+  0x11, 0xf9,
+  0x11, 0xfd,
+  0x11, 0xfb,
+  0x1, 0xfe, 0xaa,
+  0x23, 0xf, 0, 0x38, 0x8,
+  0x2, 0xfe, 0x28, 0, 0,
+  0x2, 0xfe, 0x2a, 0, 0,
+  0x1, 0xfe, 0x2c,
+  0x2, 0xfe, 0x80, 0x38, 0x28,
+  0x2, 0xfe, 0x82, 0x38, 0x28,
+  0x2, 0xfe, 0x84, 0, 0,
+  0x1, 0xfe, 0xa8,
+  0x2, 0xfe, 0xf6, 0x38, 0,
+  0x22, 0xf, 0xb,
+  0x23, 0xf, 0, 0x38, 0x20,
+  0x23, 0xf, 0, 0x38, 0x28,
+  0x22, 0xf, 0x9,
+  0x23, 0xf, 0xd, 0x38, 0,
+  0x23, 0xf, 0xd, 0x38, 0x8,
+  0x23, 0xf, 0x18, 0x38, 0,
+  0x23, 0xf, 0x18, 0x38, 0x8,
+  0x23, 0xf, 0x18, 0x38, 0x10,
+  0x23, 0xf, 0x18, 0x38, 0x18,
+  0x23, 0xf, 0x1f, 0, 0,
+  0x22, 0xf, 0x30,
+  0x13, 0xf, 0xfe, 0xc0, 0, 0,
+  0x2, 0xfe, 0x86, 0, 0,
+  0x1, 0xf8, 0x90,
+  0x11, 0xd7,
+  0x2, 0xfe, 0x30, 0, 0,
+  0x2, 0xfe, 0x32, 0, 0,
+  0x1, 0xfe, 0x34,
+  0x2, 0xfe, 0x80, 0x38, 0x30,
+  0x2, 0xfe, 0x82, 0x38, 0x30,
+  0x22, 0xf, 0x77,
+  0x34, 0x66, 0xf, 0xdb, 0, 0,
+  0x23, 0xf, 0xdb, 0, 0,
+  0x34, 0x66, 0xf, 0xdf, 0, 0,
+  0x23, 0xf, 0xdf, 0, 0,
+  0x34, 0x66, 0xf, 0xf5, 0, 0,
+  0x23, 0xf, 0xf5, 0, 0,
+  0x34, 0x66, 0xf, 0xeb, 0, 0,
+  0x23, 0xf, 0xeb, 0, 0,
+  0x34, 0x66, 0xf, 0xef, 0, 0,
+  0x23, 0xf, 0xef, 0, 0,
+  0x23, 0xf, 0x55, 0, 0,
+  0x23, 0xf, 0x54, 0, 0,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x1,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x2,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x3,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x4,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x5,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x6,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x7,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x1,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x2,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x3,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x4,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x5,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x6,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x7,
+  0x23, 0xf, 0xae, 0x38, 0x8,
+  0x23, 0xf, 0xae, 0x38, 0,
+  0x23, 0xf, 0xae, 0x38, 0x10,
+  0x23, 0xf, 0xae, 0x38, 0x18,
+  0x34, 0xf2, 0xf, 0x10, 0, 0,
+  0x34, 0xf3, 0xf, 0x10, 0, 0,
+  0x34, 0x66, 0xf, 0x10, 0, 0,
+  0x23, 0xf, 0x10, 0, 0,
+  0x34, 0xf2, 0xf, 0x11, 0, 0,
+  0x34, 0xf3, 0xf, 0x11, 0, 0,
+  0x34, 0x66, 0xf, 0x11, 0, 0,
+  0x23, 0xf, 0x11, 0, 0,
+  0x34, 0xf2, 0xf, 0x12, 0, 0,
+  0x34, 0xf3, 0xf, 0x12, 0, 0,
+  0x34, 0x66, 0xf, 0x12, 0, 0,
+  0x23, 0xf, 0x12, 0xc0, 0xc0,
+  0x23, 0xf, 0x12, 0, 0,
+  0x34, 0x66, 0xf, 0x13, 0xc0, 0xc0,
+  0x23, 0xf, 0x13, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0x13, 0, 0,
+  0x23, 0xf, 0x13, 0, 0,
+  0x34, 0x66, 0xf, 0x14, 0, 0,
+  0x23, 0xf, 0x14, 0, 0,
+  0x34, 0x66, 0xf, 0x15, 0, 0,
+  0x23, 0xf, 0x15, 0, 0,
+  0x34, 0xf3, 0xf, 0x16, 0, 0,
+  0x34, 0x66, 0xf, 0x16, 0, 0,
+  0x23, 0xf, 0x16, 0xc0, 0xc0,
+  0x23, 0xf, 0x16, 0, 0,
+  0x34, 0x66, 0xf, 0x17, 0xc0, 0xc0,
+  0x23, 0xf, 0x17, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0x17, 0, 0,
+  0x23, 0xf, 0x17, 0, 0,
+  0x34, 0x66, 0xf, 0x28, 0, 0,
+  0x23, 0xf, 0x28, 0, 0,
+  0x34, 0x66, 0xf, 0x29, 0, 0,
+  0x23, 0xf, 0x29, 0, 0,
+  0x34, 0xf2, 0xf, 0x2a, 0, 0,
+  0x34, 0xf3, 0xf, 0x2a, 0, 0,
+  0x34, 0x66, 0xf, 0x2a, 0, 0,
+  0x23, 0xf, 0x2a, 0, 0,
+  0x34, 0x66, 0xf, 0x2b, 0, 0,
+  0x23, 0xf, 0x2b, 0, 0,
+  0x34, 0xf2, 0xf, 0x2c, 0, 0,
+  0x34, 0xf3, 0xf, 0x2c, 0, 0,
+  0x34, 0x66, 0xf, 0x2c, 0, 0,
+  0x23, 0xf, 0x2c, 0, 0,
+  0x34, 0x66, 0xf, 0x2d, 0, 0,
+  0x34, 0xf2, 0xf, 0x2d, 0, 0,
+  0x34, 0xf3, 0xf, 0x2d, 0, 0,
+  0x23, 0xf, 0x2d, 0, 0,
+  0x34, 0x66, 0xf, 0x2e, 0, 0,
+  0x23, 0xf, 0x2e, 0, 0,
+  0x34, 0x66, 0xf, 0x2f, 0, 0,
+  0x23, 0xf, 0x2f, 0, 0,
+  0x22, 0xf, 0x37,
+  0x34, 0x66, 0xf, 0x50, 0xc0, 0xc0,
+  0x23, 0xf, 0x50, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0x51, 0, 0,
+  0x34, 0xf2, 0xf, 0x51, 0, 0,
+  0x34, 0xf3, 0xf, 0x51, 0, 0,
+  0x23, 0xf, 0x51, 0, 0,
+  0x34, 0xf3, 0xf, 0x52, 0, 0,
+  0x23, 0xf, 0x52, 0, 0,
+  0x34, 0xf3, 0xf, 0x53, 0, 0,
+  0x23, 0xf, 0x53, 0, 0,
+  0x34, 0x66, 0xf, 0x54, 0, 0,
+  0x23, 0xf, 0x54, 0, 0,
+  0x34, 0x66, 0xf, 0x55, 0, 0,
+  0x23, 0xf, 0x55, 0, 0,
+  0x34, 0x66, 0xf, 0x56, 0, 0,
+  0x23, 0xf, 0x56, 0, 0,
+  0x34, 0x66, 0xf, 0x57, 0, 0,
+  0x23, 0xf, 0x57, 0, 0,
+  0x34, 0xf2, 0xf, 0x58, 0, 0,
+  0x34, 0xf3, 0xf, 0x58, 0, 0,
+  0x34, 0x66, 0xf, 0x58, 0, 0,
+  0x23, 0xf, 0x58, 0, 0,
+  0x34, 0xf2, 0xf, 0x59, 0, 0,
+  0x34, 0xf3, 0xf, 0x59, 0, 0,
+  0x34, 0x66, 0xf, 0x59, 0, 0,
+  0x23, 0xf, 0x59, 0, 0,
+  0x34, 0xf2, 0xf, 0x5a, 0, 0,
+  0x34, 0xf3, 0xf, 0x5a, 0, 0,
+  0x34, 0x66, 0xf, 0x5a, 0, 0,
+  0x23, 0xf, 0x5a, 0, 0,
+  0x34, 0x66, 0xf, 0x5b, 0, 0,
+  0x34, 0xf3, 0xf, 0x5b, 0, 0,
+  0x23, 0xf, 0x5b, 0, 0,
+  0x34, 0xf2, 0xf, 0x5c, 0, 0,
+  0x34, 0xf3, 0xf, 0x5c, 0, 0,
+  0x34, 0x66, 0xf, 0x5c, 0, 0,
+  0x23, 0xf, 0x5c, 0, 0,
+  0x34, 0xf2, 0xf, 0x5d, 0, 0,
+  0x34, 0xf3, 0xf, 0x5d, 0, 0,
+  0x34, 0x66, 0xf, 0x5d, 0, 0,
+  0x23, 0xf, 0x5d, 0, 0,
+  0x34, 0xf2, 0xf, 0x5e, 0, 0,
+  0x34, 0xf3, 0xf, 0x5e, 0, 0,
+  0x34, 0x66, 0xf, 0x5e, 0, 0,
+  0x23, 0xf, 0x5e, 0, 0,
+  0x34, 0xf2, 0xf, 0x5f, 0, 0,
+  0x34, 0xf3, 0xf, 0x5f, 0, 0,
+  0x34, 0x66, 0xf, 0x5f, 0, 0,
+  0x23, 0xf, 0x5f, 0, 0,
+  0x34, 0x66, 0xf, 0x60, 0, 0,
+  0x23, 0xf, 0x60, 0, 0,
+  0x34, 0x66, 0xf, 0x61, 0, 0,
+  0x23, 0xf, 0x61, 0, 0,
+  0x34, 0x66, 0xf, 0x62, 0, 0,
+  0x23, 0xf, 0x62, 0, 0,
+  0x34, 0x66, 0xf, 0x63, 0, 0,
+  0x23, 0xf, 0x63, 0, 0,
+  0x34, 0x66, 0xf, 0x64, 0, 0,
+  0x23, 0xf, 0x64, 0, 0,
+  0x34, 0x66, 0xf, 0x65, 0, 0,
+  0x23, 0xf, 0x65, 0, 0,
+  0x34, 0x66, 0xf, 0x66, 0, 0,
+  0x23, 0xf, 0x66, 0, 0,
+  0x34, 0x66, 0xf, 0x67, 0, 0,
+  0x23, 0xf, 0x67, 0, 0,
+  0x34, 0x66, 0xf, 0x68, 0, 0,
+  0x23, 0xf, 0x68, 0, 0,
+  0x34, 0x66, 0xf, 0x69, 0, 0,
+  0x23, 0xf, 0x69, 0, 0,
+  0x34, 0x66, 0xf, 0x6a, 0, 0,
+  0x23, 0xf, 0x6a, 0, 0,
+  0x34, 0x66, 0xf, 0x6b, 0, 0,
+  0x23, 0xf, 0x6b, 0, 0,
+  0x34, 0x66, 0xf, 0x6c, 0, 0,
+  0x34, 0x66, 0xf, 0x6d, 0, 0,
+  0x34, 0x66, 0xf, 0x6e, 0, 0,
+  0x23, 0xf, 0x6e, 0, 0,
+  0x34, 0x66, 0xf, 0x6f, 0, 0,
+  0x34, 0xf3, 0xf, 0x6f, 0, 0,
+  0x23, 0xf, 0x6f, 0, 0,
+  0x34, 0x66, 0xf, 0x70, 0, 0,
+  0x34, 0xf2, 0xf, 0x70, 0, 0,
+  0x34, 0xf3, 0xf, 0x70, 0, 0,
+  0x23, 0xf, 0x70, 0, 0,
+  0x34, 0x66, 0xf, 0x74, 0, 0,
+  0x23, 0xf, 0x74, 0, 0,
+  0x34, 0x66, 0xf, 0x75, 0, 0,
+  0x23, 0xf, 0x75, 0, 0,
+  0x34, 0x66, 0xf, 0x76, 0, 0,
+  0x23, 0xf, 0x76, 0, 0,
+  0x34, 0x66, 0xf, 0x7c, 0, 0,
+  0x34, 0xf2, 0xf, 0x7c, 0, 0,
+  0x34, 0x66, 0xf, 0x7d, 0, 0,
+  0x34, 0xf2, 0xf, 0x7d, 0, 0,
+  0x34, 0x66, 0xf, 0x7e, 0, 0,
+  0x34, 0xf3, 0xf, 0x7e, 0, 0,
+  0x23, 0xf, 0x7e, 0, 0,
+  0x34, 0x66, 0xf, 0x7f, 0, 0,
+  0x34, 0xf3, 0xf, 0x7f, 0, 0,
+  0x23, 0xf, 0x7f, 0, 0,
+  0x23, 0xf, 0xc3, 0, 0,
+  0x34, 0x66, 0xf, 0xc4, 0, 0,
+  0x23, 0xf, 0xc4, 0, 0,
+  0x34, 0x66, 0xf, 0xc5, 0xc0, 0xc0,
+  0x23, 0xf, 0xc5, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0xc6, 0, 0,
+  0x23, 0xf, 0xc6, 0, 0,
+  0x34, 0x66, 0xf, 0xd1, 0, 0,
+  0x23, 0xf, 0xd1, 0, 0,
+  0x34, 0x66, 0xf, 0xd2, 0, 0,
+  0x23, 0xf, 0xd2, 0, 0,
+  0x34, 0x66, 0xf, 0xd3, 0, 0,
+  0x23, 0xf, 0xd3, 0, 0,
+  0x34, 0x66, 0xf, 0xd4, 0, 0,
+  0x23, 0xf, 0xd4, 0, 0,
+  0x34, 0x66, 0xf, 0xd5, 0, 0,
+  0x23, 0xf, 0xd5, 0, 0,
+  0x34, 0x66, 0xf, 0xd6, 0, 0,
+  0x34, 0xf2, 0xf, 0xd6, 0xc0, 0xc0,
+  0x34, 0xf3, 0xf, 0xd6, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0xd7, 0xc0, 0xc0,
+  0x23, 0xf, 0xd7, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0xd8, 0, 0,
+  0x23, 0xf, 0xd8, 0, 0,
+  0x34, 0x66, 0xf, 0xd9, 0, 0,
+  0x23, 0xf, 0xd9, 0, 0,
+  0x34, 0x66, 0xf, 0xda, 0, 0,
+  0x23, 0xf, 0xda, 0, 0,
+  0x34, 0x66, 0xf, 0xdc, 0, 0,
+  0x23, 0xf, 0xdc, 0, 0,
+  0x34, 0x66, 0xf, 0xdd, 0, 0,
+  0x23, 0xf, 0xdd, 0, 0,
+  0x34, 0x66, 0xf, 0xde, 0, 0,
+  0x23, 0xf, 0xde, 0, 0,
+  0x34, 0x66, 0xf, 0xe0, 0, 0,
+  0x23, 0xf, 0xe0, 0, 0,
+  0x34, 0x66, 0xf, 0xe1, 0, 0,
+  0x23, 0xf, 0xe1, 0, 0,
+  0x34, 0x66, 0xf, 0xe2, 0, 0,
+  0x23, 0xf, 0xe2, 0, 0,
+  0x34, 0x66, 0xf, 0xe3, 0, 0,
+  0x23, 0xf, 0xe3, 0, 0,
+  0x34, 0x66, 0xf, 0xe4, 0, 0,
+  0x23, 0xf, 0xe4, 0, 0,
+  0x34, 0x66, 0xf, 0xe5, 0, 0,
+  0x23, 0xf, 0xe5, 0, 0,
+  0x34, 0x66, 0xf, 0xe7, 0, 0,
+  0x23, 0xf, 0xe7, 0, 0,
+  0x34, 0x66, 0xf, 0xe8, 0, 0,
+  0x23, 0xf, 0xe8, 0, 0,
+  0x34, 0x66, 0xf, 0xe9, 0, 0,
+  0x23, 0xf, 0xe9, 0, 0,
+  0x34, 0x66, 0xf, 0xea, 0, 0,
+  0x23, 0xf, 0xea, 0, 0,
+  0x34, 0x66, 0xf, 0xec, 0, 0,
+  0x23, 0xf, 0xec, 0, 0,
+  0x34, 0x66, 0xf, 0xed, 0, 0,
+  0x23, 0xf, 0xed, 0, 0,
+  0x34, 0x66, 0xf, 0xee, 0, 0,
+  0x23, 0xf, 0xee, 0, 0,
+  0x34, 0xf2, 0xf, 0xf0, 0, 0,
+  0x34, 0x66, 0xf, 0xf1, 0, 0,
+  0x23, 0xf, 0xf1, 0, 0,
+  0x34, 0x66, 0xf, 0xf2, 0, 0,
+  0x23, 0xf, 0xf2, 0, 0,
+  0x34, 0x66, 0xf, 0xf3, 0, 0,
+  0x23, 0xf, 0xf3, 0, 0,
+  0x34, 0x66, 0xf, 0xf4, 0, 0,
+  0x23, 0xf, 0xf4, 0, 0,
+  0x34, 0x66, 0xf, 0xf6, 0, 0,
+  0x23, 0xf, 0xf6, 0, 0,
+  0x34, 0x66, 0xf, 0xf7, 0xc0, 0xc0,
+  0x23, 0xf, 0xf7, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0xf8, 0, 0,
+  0x23, 0xf, 0xf8, 0, 0,
+  0x34, 0x66, 0xf, 0xf9, 0, 0,
+  0x23, 0xf, 0xf9, 0, 0,
+  0x34, 0x66, 0xf, 0xfa, 0, 0,
+  0x23, 0xf, 0xfa, 0, 0,
+  0x34, 0x66, 0xf, 0xfb, 0, 0,
+  0x23, 0xf, 0xfb, 0, 0,
+  0x34, 0x66, 0xf, 0xfc, 0, 0,
+  0x23, 0xf, 0xfc, 0, 0,
+  0x34, 0x66, 0xf, 0xfd, 0, 0,
+  0x23, 0xf, 0xfd, 0, 0,
+  0x34, 0x66, 0xf, 0xfe, 0, 0,
+  0x23, 0xf, 0xfe, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0, 0, 0,
+  0x34, 0xf, 0x38, 0, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x1, 0, 0,
+  0x34, 0xf, 0x38, 0x1, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x2, 0, 0,
+  0x34, 0xf, 0x38, 0x2, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3, 0, 0,
+  0x34, 0xf, 0x38, 0x3, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x4, 0, 0,
+  0x34, 0xf, 0x38, 0x4, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x5, 0, 0,
+  0x34, 0xf, 0x38, 0x5, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x6, 0, 0,
+  0x34, 0xf, 0x38, 0x6, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x7, 0, 0,
+  0x34, 0xf, 0x38, 0x7, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x8, 0, 0,
+  0x34, 0xf, 0x38, 0x8, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x9, 0, 0,
+  0x34, 0xf, 0x38, 0x9, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0xa, 0, 0,
+  0x34, 0xf, 0x38, 0xa, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0xb, 0, 0,
+  0x34, 0xf, 0x38, 0xb, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x1c, 0, 0,
+  0x34, 0xf, 0x38, 0x1c, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x1d, 0, 0,
+  0x34, 0xf, 0x38, 0x1d, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x1e, 0, 0,
+  0x34, 0xf, 0x38, 0x1e, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xf, 0, 0,
+  0x34, 0xf, 0x3a, 0xf, 0, 0,
+  0x34, 0x66, 0xf, 0xc7, 0x38, 0x30,
+  0x34, 0xf3, 0xf, 0xc7, 0x38, 0x30,
+  0x23, 0xf, 0xc7, 0x38, 0x30,
+  0x23, 0xf, 0xc7, 0x38, 0x38,
+  0x34, 0x66, 0xf, 0x71, 0xf8, 0xd0,
+  0x23, 0xf, 0x71, 0xf8, 0xd0,
+  0x34, 0x66, 0xf, 0x71, 0xf8, 0xe0,
+  0x23, 0xf, 0x71, 0xf8, 0xe0,
+  0x34, 0x66, 0xf, 0x71, 0xf8, 0xf0,
+  0x23, 0xf, 0x71, 0xf8, 0xf0,
+  0x34, 0x66, 0xf, 0x72, 0xf8, 0xd0,
+  0x23, 0xf, 0x72, 0xf8, 0xd0,
+  0x34, 0x66, 0xf, 0x72, 0xf8, 0xe0,
+  0x23, 0xf, 0x72, 0xf8, 0xe0,
+  0x34, 0x66, 0xf, 0x72, 0xf8, 0xf0,
+  0x23, 0xf, 0x72, 0xf8, 0xf0,
+  0x34, 0x66, 0xf, 0x73, 0xf8, 0xd0,
+  0x23, 0xf, 0x73, 0xf8, 0xd0,
+  0x34, 0x66, 0xf, 0x73, 0xf8, 0xd8,
+  0x34, 0x66, 0xf, 0x73, 0xf8, 0xf0,
+  0x23, 0xf, 0x73, 0xf8, 0xf0,
+  0x34, 0x66, 0xf, 0x73, 0xf8, 0xf8,
+  0x33, 0xf, 0xae, 0xe8,
+  0x33, 0xf, 0xae, 0xf0,
+  0x33, 0xf, 0xae, 0xf8,
+  0x23, 0xf, 0xae, 0x38, 0x38,
+  0x23, 0xf, 0xf, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xc, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xd, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x14, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x15, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x40, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x41, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x21, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x2a, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x42, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x2b, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x10, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xe, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x29, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x61, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x60, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x63, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x62, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x37, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x41, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x20, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x22, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3c, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3d, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3f, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3e, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x38, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x39, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3b, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3a, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x20, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x21, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x22, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x23, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x24, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x25, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x30, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x31, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x32, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x33, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x34, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x35, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x28, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x40, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x17, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x8, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x9, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xa, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xb, 0, 0,
+  0x1, 0xe7, 0x7,
+};
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff
new file mode 100644
index 0000000..5b621f9
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/m68k_backend.diff
@@ -0,0 +1,309 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.146/backends/m68k_init.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/m68k_init.c	2010-04-24 10:11:38.000000000 +0000
+@@ -0,0 +1,49 @@
++/* Initialization of m68k specific backend library.
++   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++   This software 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; version 2 of the License.
++
++   This softare is distributed in the hope that 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 software; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++*/
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND		m68k_
++#define RELOC_PREFIX	R_68K_
++#include "libebl_CPU.h"
++
++/* This defines the common reloc hooks based on m68k_reloc.def.  */
++#include "common-reloc.c"
++
++
++const char *
++m68k_init (elf, machine, eh, ehlen)
++     Elf *elf __attribute__ ((unused));
++     GElf_Half machine __attribute__ ((unused));
++     Ebl *eh;
++     size_t ehlen;
++{
++  /* Check whether the Elf_BH object has a sufficent size.  */
++  if (ehlen < sizeof (Ebl))
++    return NULL;
++
++  /* We handle it.  */
++  eh->name = "m68k";
++  m68k_init_reloc (eh);
++  HOOK (eh, reloc_simple_type);
++  HOOK (eh, register_info);
++
++  return MODVERSION;
++}
+Index: elfutils-0.146/backends/m68k_regs.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/m68k_regs.c	2010-04-24 10:11:38.000000000 +0000
+@@ -0,0 +1,106 @@
++/* Register names and numbers for m68k DWARF.
++   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++   This software 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; version 2 of the License.
++
++   This software is distributed in the hope that 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 software; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND m68k_
++#include "libebl_CPU.h"
++
++ssize_t
++m68k_register_info (Ebl *ebl __attribute__ ((unused)),
++		   int regno, char *name, size_t namelen,
++		   const char **prefix, const char **setname,
++		   int *bits, int *type)
++{
++	if (name == NULL)
++		return 25;
++
++	if (regno < 0 || regno > 24 || namelen < 5)
++		return -1;
++
++	*prefix = "%";
++	*bits = 32;
++	*type = (regno < 8 ? DW_ATE_signed
++		: regno < 16 ? DW_ATE_address : DW_ATE_float);
++
++	if (regno < 8)
++	{
++		*setname = "integer";
++	}
++	else if (regno < 16)
++	{
++		*setname = "address";
++	}
++	else if (regno < 24)
++	{
++		*setname = "FPU";
++	}
++	else
++	{
++		*setname = "address";
++		*type = DW_ATE_address;
++	}
++
++	switch (regno)
++	{
++	case 0 ... 7:
++		name[0] = 'd';
++		name[1] = regno + '0';
++		namelen = 2;
++		break;
++
++	case 8 ... 13:
++		name[0] = 'a';
++		name[1] = regno - 8 + '0';
++		namelen = 2;
++		break;
++
++	case 14:
++		name[0] = 'f';
++		name[1] = 'p';
++   		namelen = 2;
++		break;
++
++	case 15:
++		name[0] = 's';
++		name[1] = 'p';
++   		namelen = 2;
++		break;
++
++	case 16 ... 23:
++		name[0] = 'f';
++		name[1] = 'p';
++		name[2] = regno - 16 + '0';
++   		namelen = 3;
++		break;
++
++	case 24:
++		name[0] = 'p';
++		name[1] = 'c';
++		namelen = 2;
++	}
++
++	name[namelen++] = '\0';
++	return namelen;
++}
++
+Index: elfutils-0.146/backends/m68k_reloc.def
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/m68k_reloc.def	2010-04-24 10:11:38.000000000 +0000
+@@ -0,0 +1,45 @@
++/* List the relocation types for m68k.  -*- C -*-
++   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++   This software 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; version 2 of the License.
++
++   This software is distributed in the hope that 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 software; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++*/
++
++/* 	    NAME,		REL|EXEC|DYN	*/
++
++RELOC_TYPE (NONE,		0)
++RELOC_TYPE (32,			REL|EXEC|DYN)
++RELOC_TYPE (16,			REL)
++RELOC_TYPE (8,			REL)
++RELOC_TYPE (PC32,		REL|EXEC|DYN)
++RELOC_TYPE (PC16,		REL)
++RELOC_TYPE (PC8,		REL)
++RELOC_TYPE (GOT32,		REL)
++RELOC_TYPE (GOT16,		REL)
++RELOC_TYPE (GOT8,		REL)
++RELOC_TYPE (GOT32O,		REL)
++RELOC_TYPE (GOT16O,		REL)
++RELOC_TYPE (GOT8O,		REL)
++RELOC_TYPE (PLT32,		REL)
++RELOC_TYPE (PLT16,		REL)
++RELOC_TYPE (PLT8,		REL)
++RELOC_TYPE (PLT32O,		REL)
++RELOC_TYPE (PLT16O,		REL)
++RELOC_TYPE (PLT8O,		REL)
++RELOC_TYPE (COPY,		EXEC)
++RELOC_TYPE (GLOB_DAT,		EXEC|DYN)
++RELOC_TYPE (JMP_SLOT,		EXEC|DYN)
++RELOC_TYPE (RELATIVE,		EXEC|DYN)
++RELOC_TYPE (GNU_VTINHERIT,	REL)
++RELOC_TYPE (GNU_VTENTRY,	REL)
++
+Index: elfutils-0.146/libelf/elf.h
+===================================================================
+--- elfutils-0.146.orig/libelf/elf.h	2010-04-24 10:11:13.000000000 +0000
++++ elfutils-0.146/libelf/elf.h	2010-04-24 10:13:50.000000000 +0000
+@@ -1125,6 +1125,9 @@
+ #define R_68K_GLOB_DAT	20		/* Create GOT entry */
+ #define R_68K_JMP_SLOT	21		/* Create PLT entry */
+ #define R_68K_RELATIVE	22		/* Adjust by program base */
++/* The next 2 are GNU extensions to enable C++ vtable garbage collection.  */
++#define R_68K_GNU_VTINHERIT 23
++#define R_68K_GNU_VTENTRY   24
+ #define R_68K_TLS_GD32      25          /* 32 bit GOT offset for GD */
+ #define R_68K_TLS_GD16      26          /* 16 bit GOT offset for GD */
+ #define R_68K_TLS_GD8       27          /* 8 bit GOT offset for GD */
+Index: elfutils-0.146/backends/Makefile.am
+===================================================================
+--- elfutils-0.146.orig/backends/Makefile.am	2010-04-24 10:11:23.000000000 +0000
++++ elfutils-0.146/backends/Makefile.am	2010-04-24 10:11:38.000000000 +0000
+@@ -29,11 +29,12 @@
+ 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
+ 
+ 
+-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc mips
++modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc mips m68k
+ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
+ 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
+ 	     libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
+-	     libebl_s390_pic.a libebl_parisc_pic.a libebl_mips_pic.a
++	     libebl_s390_pic.a libebl_parisc_pic.a libebl_mips_pic.a \
++	     libebl_m68k_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+ 
+@@ -103,6 +104,10 @@
+ libebl_mips_pic_a_SOURCES = $(mips_SRCS)
+ am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
+ 
++m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c
++libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
++am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
++
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ 	@rm -f $(@:.so=.map)
+ 	echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
+Index: elfutils-0.146/backends/m68k_symbol.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.146/backends/m68k_symbol.c	2010-04-24 10:11:38.000000000 +0000
+@@ -0,0 +1,43 @@
++/* m68k specific symbolic name handling.
++   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++   This software 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; version 2 of the License.
++
++   This software distributed in the hope that 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 software; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++*/
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND		m68k_
++#include "libebl_CPU.h"
++
++/* Check for the simple reloc types.  */
++Elf_Type
++m68k_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++  switch (type)
++    {
++    case R_68K_32:
++      return ELF_T_SWORD;
++    case R_68K_16:
++      return ELF_T_HALF;
++    case R_68K_8:
++      return ELF_T_BYTE;
++    default:
++      return ELF_T_NUM;
++    }
++}
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff
new file mode 100644
index 0000000..3f81a75
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/mips_backend.diff
@@ -0,0 +1,713 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.145/backends/mips_init.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.145/backends/mips_init.c	2010-02-24 18:57:35.000000000 +0000
+@@ -0,0 +1,60 @@
++/* Initialization of mips specific backend library.
++   Copyright (C) 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND		mips_
++#define RELOC_PREFIX	R_MIPS_
++#include "libebl_CPU.h"
++
++/* This defines the common reloc hooks based on mips_reloc.def.  */
++#include "common-reloc.c"
++
++const char *
++mips_init (elf, machine, eh, ehlen)
++     Elf *elf __attribute__ ((unused));
++     GElf_Half machine __attribute__ ((unused));
++     Ebl *eh;
++     size_t ehlen;
++{
++  /* Check whether the Elf_BH object has a sufficent size.  */
++  if (ehlen < sizeof (Ebl))
++    return NULL;
++
++  /* We handle it.  */
++  if (machine == EM_MIPS)
++    eh->name = "MIPS R3000 big-endian";
++  else if (machine == EM_MIPS_RS3_LE)
++    eh->name = "MIPS R3000 little-endian";
++
++  mips_init_reloc (eh);
++  HOOK (eh, reloc_simple_type);
++  HOOK (eh, return_value_location);
++  HOOK (eh, register_info);
++
++  return MODVERSION;
++}
+Index: elfutils-0.145/backends/mips_regs.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.145/backends/mips_regs.c	2010-02-24 18:57:35.000000000 +0000
+@@ -0,0 +1,104 @@
++/* Register names and numbers for MIPS DWARF.
++   Copyright (C) 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND mips_
++#include "libebl_CPU.h"
++
++ssize_t
++mips_register_info (Ebl *ebl __attribute__((unused)),
++		    int regno, char *name, size_t namelen,
++		    const char **prefix, const char **setname,
++		    int *bits, int *type)
++{
++  if (name == NULL)
++    return 66;
++
++  if (regno < 0 || regno > 65 || namelen < 4)
++    return -1;
++
++  *prefix = "$";
++
++  if (regno < 32)
++    {
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      if (regno < 32 + 10)
++        {
++          name[0] = regno + '0';
++          namelen = 1;
++        }
++      else
++        {
++          name[0] = (regno / 10) + '0';
++          name[1] = (regno % 10) + '0';
++          namelen = 2;
++        }
++    }
++  else if (regno < 64)
++    {
++      *setname = "FPU";
++      *type = DW_ATE_float;
++      *bits = 32;
++      name[0] = 'f';
++      if (regno < 32 + 10)
++	{
++	  name[1] = (regno - 32) + '0';
++	  namelen = 2;
++	}
++      else
++	{
++	  name[1] = (regno - 32) / 10 + '0';
++	  name[2] = (regno - 32) % 10 + '0';
++	  namelen = 3;
++	}
++    }
++  else if (regno == 64)
++    {
++      *type = DW_ATE_signed;
++      *bits = 32;
++      name[0] = 'h';
++      name[1] = 'i';
++      namelen = 2;
++    }
++  else
++    {
++      *type = DW_ATE_signed;
++      *bits = 32;
++      name[0] = 'l';
++      name[1] = 'o';
++      namelen = 2;
++    }
++
++  name[namelen++] = '\0';
++  return namelen;
++}
+Index: elfutils-0.145/backends/mips_reloc.def
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.145/backends/mips_reloc.def	2010-02-24 18:57:35.000000000 +0000
+@@ -0,0 +1,79 @@
++/* List the relocation types for mips.  -*- C -*-
++   Copyright (C) 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++/* 	    NAME,		REL|EXEC|DYN	*/
++
++RELOC_TYPE (NONE,               0)
++RELOC_TYPE (16,                 0)
++RELOC_TYPE (32,                 0)
++RELOC_TYPE (REL32,              0)
++RELOC_TYPE (26,                 0)
++RELOC_TYPE (HI16,               0)
++RELOC_TYPE (LO16,               0)
++RELOC_TYPE (GPREL16,            0)
++RELOC_TYPE (LITERAL,            0)
++RELOC_TYPE (GOT16,              0)
++RELOC_TYPE (PC16,               0)
++RELOC_TYPE (CALL16,             0)
++RELOC_TYPE (GPREL32,            0)
++
++RELOC_TYPE (SHIFT5,             0)
++RELOC_TYPE (SHIFT6,             0)
++RELOC_TYPE (64,                 0)
++RELOC_TYPE (GOT_DISP,           0)
++RELOC_TYPE (GOT_PAGE,           0)
++RELOC_TYPE (GOT_OFST,           0)
++RELOC_TYPE (GOT_HI16,           0)
++RELOC_TYPE (GOT_LO16,           0)
++RELOC_TYPE (SUB,                0)
++RELOC_TYPE (INSERT_A,           0)
++RELOC_TYPE (INSERT_B,           0)
++RELOC_TYPE (DELETE,             0)
++RELOC_TYPE (HIGHER,             0)
++RELOC_TYPE (HIGHEST,            0)
++RELOC_TYPE (CALL_HI16,          0)
++RELOC_TYPE (CALL_LO16,          0)
++RELOC_TYPE (SCN_DISP,           0)
++RELOC_TYPE (REL16,              0)
++RELOC_TYPE (ADD_IMMEDIATE,      0)
++RELOC_TYPE (PJUMP,              0)
++RELOC_TYPE (RELGOT,             0)
++RELOC_TYPE (JALR,               0)
++RELOC_TYPE (TLS_DTPMOD32,       0)
++RELOC_TYPE (TLS_DTPREL32,       0)
++RELOC_TYPE (TLS_DTPMOD64,       0)
++RELOC_TYPE (TLS_DTPREL64,       0)
++RELOC_TYPE (TLS_GD,             0)
++RELOC_TYPE (TLS_LDM,            0)
++RELOC_TYPE (TLS_DTPREL_HI16,    0)
++RELOC_TYPE (TLS_DTPREL_LO16,    0)
++RELOC_TYPE (TLS_GOTTPREL,       0)
++RELOC_TYPE (TLS_TPREL32,        0)
++RELOC_TYPE (TLS_TPREL64,        0)
++RELOC_TYPE (TLS_TPREL_HI16,     0)
++RELOC_TYPE (TLS_TPREL_LO16,     0)
++
++#define NO_COPY_RELOC 1
++#define NO_RELATIVE_RELOC 1
+Index: elfutils-0.145/backends/mips_retval.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.145/backends/mips_retval.c	2010-02-24 18:57:35.000000000 +0000
+@@ -0,0 +1,321 @@
++/* Function return value location for Linux/mips ABI.
++   Copyright (C) 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <assert.h>
++#include <dwarf.h>
++#include <elf.h>
++
++#include "../libebl/libeblP.h"
++#include "../libdw/libdwP.h"
++
++#define BACKEND mips_
++#include "libebl_CPU.h"
++
++/* The ABI of the file.  Also see EF_MIPS_ABI2 above. */
++#define EF_MIPS_ABI		0x0000F000
++
++/* The original o32 abi. */
++#define E_MIPS_ABI_O32          0x00001000
++
++/* O32 extended to work on 64 bit architectures */
++#define E_MIPS_ABI_O64          0x00002000
++
++/* EABI in 32 bit mode */
++#define E_MIPS_ABI_EABI32       0x00003000
++
++/* EABI in 64 bit mode */
++#define E_MIPS_ABI_EABI64       0x00004000
++
++/* All the possible MIPS ABIs. */
++enum mips_abi
++  {
++    MIPS_ABI_UNKNOWN = 0,
++    MIPS_ABI_N32,
++    MIPS_ABI_O32,
++    MIPS_ABI_N64,
++    MIPS_ABI_O64,
++    MIPS_ABI_EABI32,
++    MIPS_ABI_EABI64,
++    MIPS_ABI_LAST
++  };
++
++/* Find the mips ABI of the current file */
++enum mips_abi find_mips_abi(Elf *elf)
++{
++  GElf_Ehdr ehdr_mem;
++  GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++
++  if (ehdr == NULL)
++    return MIPS_ABI_LAST;
++
++  GElf_Word elf_flags = ehdr->e_flags;
++
++  /* Check elf_flags to see if it specifies the ABI being used.  */
++  switch ((elf_flags & EF_MIPS_ABI))
++    {
++    case E_MIPS_ABI_O32:
++      return MIPS_ABI_O32;
++    case E_MIPS_ABI_O64:
++      return MIPS_ABI_O64;
++    case E_MIPS_ABI_EABI32:
++      return MIPS_ABI_EABI32;
++    case E_MIPS_ABI_EABI64:
++      return MIPS_ABI_EABI64;
++    default:
++      if ((elf_flags & EF_MIPS_ABI2))
++	return MIPS_ABI_N32;
++    }
++
++  /* GCC creates a pseudo-section whose name describes the ABI.  */
++  size_t shstrndx;
++  if (elf_getshdrstrndx (elf, &shstrndx) < 0)
++    return MIPS_ABI_LAST;
++
++  const char *name;
++  Elf_Scn *scn = NULL;
++  while ((scn = elf_nextscn (elf, scn)) != NULL)
++    {
++      GElf_Shdr shdr_mem;
++      GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
++      if (shdr == NULL)
++        return MIPS_ABI_LAST;
++
++      name = elf_strptr (elf, shstrndx, shdr->sh_name) ?: "";
++      if (strncmp (name, ".mdebug.", 8) != 0)
++        continue;
++
++      if (strcmp (name, ".mdebug.abi32") == 0)
++        return MIPS_ABI_O32;
++      else if (strcmp (name, ".mdebug.abiN32") == 0)
++        return MIPS_ABI_N32;
++      else if (strcmp (name, ".mdebug.abi64") == 0)
++        return MIPS_ABI_N64;
++      else if (strcmp (name, ".mdebug.abiO64") == 0)
++        return MIPS_ABI_O64;
++      else if (strcmp (name, ".mdebug.eabi32") == 0)
++        return MIPS_ABI_EABI32;
++      else if (strcmp (name, ".mdebug.eabi64") == 0)
++        return MIPS_ABI_EABI64;
++      else
++        return MIPS_ABI_UNKNOWN;
++    }
++
++  return MIPS_ABI_UNKNOWN;
++}
++
++unsigned int
++mips_abi_regsize (enum mips_abi abi)
++{
++  switch (abi)
++    {
++    case MIPS_ABI_EABI32:
++    case MIPS_ABI_O32:
++      return 4;
++    case MIPS_ABI_N32:
++    case MIPS_ABI_N64:
++    case MIPS_ABI_O64:
++    case MIPS_ABI_EABI64:
++      return 8;
++    case MIPS_ABI_UNKNOWN:
++    case MIPS_ABI_LAST:
++    default:
++      return 0;
++    }
++}
++
++
++/* $v0 or pair $v0, $v1 */
++static const Dwarf_Op loc_intreg_o32[] =
++  {
++    { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++
++static const Dwarf_Op loc_intreg[] =
++  {
++    { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 8 },
++    { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 8 },
++  };
++#define nloc_intreg	1
++#define nloc_intregpair	4
++
++/* $f0 (float), or pair $f0, $f1 (double).
++ * f2/f3 are used for COMPLEX (= 2 doubles) returns in Fortran */
++static const Dwarf_Op loc_fpreg_o32[] =
++  {
++    { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++
++/* $f0, or pair $f0, $f2.  */
++static const Dwarf_Op loc_fpreg[] =
++  {
++    { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 8 },
++    { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 },
++  };
++#define nloc_fpreg  1
++#define nloc_fpregpair 4
++#define nloc_fpregquad 8
++
++/* The return value is a structure and is actually stored in stack space
++   passed in a hidden argument by the caller.  But, the compiler
++   helpfully returns the address of that space in $v0.  */
++static const Dwarf_Op loc_aggregate[] =
++  {
++    { .atom = DW_OP_breg2, .number = 0 }
++  };
++#define nloc_aggregate 1
++
++int
++mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++  /* First find the ABI used by the elf object */
++  enum mips_abi abi = find_mips_abi(functypedie->cu->dbg->elf);
++
++  /* Something went seriously wrong while trying to figure out the ABI */
++  if (abi == MIPS_ABI_LAST)
++    return -1;
++
++  /* We couldn't identify the ABI, but the file seems valid */
++  if (abi == MIPS_ABI_UNKNOWN)
++    return -2;
++
++  /* Can't handle EABI variants */
++  if ((abi == MIPS_ABI_EABI32) || (abi == MIPS_ABI_EABI64))
++    return -2;
++
++  unsigned int regsize = mips_abi_regsize (abi);
++  if (!regsize)
++    return -2;
++
++  /* Start with the function's type, and get the DW_AT_type attribute,
++     which is the type of the return value.  */
++
++  Dwarf_Attribute attr_mem;
++  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
++  if (attr == NULL)
++    /* The function has no return value, like a `void' function in C.  */
++    return 0;
++
++  Dwarf_Die die_mem;
++  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
++  int tag = dwarf_tag (typedie);
++
++  /* Follow typedefs and qualifiers to get to the actual type.  */
++  while (tag == DW_TAG_typedef
++	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
++	 || tag == DW_TAG_restrict_type || tag == DW_TAG_mutable_type)
++    {
++      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++      typedie = dwarf_formref_die (attr, &die_mem);
++      tag = dwarf_tag (typedie);
++    }
++
++  switch (tag)
++    {
++    case -1:
++      return -1;
++
++    case DW_TAG_subrange_type:
++      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
++	{
++	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++	  typedie = dwarf_formref_die (attr, &die_mem);
++	  tag = dwarf_tag (typedie);
++	}
++      /* Fall through.  */
++
++    case DW_TAG_base_type:
++    case DW_TAG_enumeration_type:
++    case DW_TAG_pointer_type:
++    case DW_TAG_ptr_to_member_type:
++      {
++        Dwarf_Word size;
++	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
++					 &attr_mem), &size) != 0)
++	  {
++	    if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
++	      size = regsize;
++	    else
++	      return -1;
++	  }
++	if (tag == DW_TAG_base_type)
++	  {
++	    Dwarf_Word encoding;
++	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++					     &attr_mem), &encoding) != 0)
++	      return -1;
++
++#define ABI_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc))
++
++	    if (encoding == DW_ATE_float)
++	      {
++		*locp = ABI_LOC(loc_fpreg, regsize);
++		if (size <= regsize)
++		    return nloc_fpreg;
++
++		if (size <= 2*regsize)
++                  return nloc_fpregpair;
++
++		if (size <= 4*regsize && abi == MIPS_ABI_O32)
++                  return nloc_fpregquad;
++
++		goto aggregate;
++	      }
++	  }
++	*locp = ABI_LOC(loc_intreg, regsize);
++	if (size <= regsize)
++	  return nloc_intreg;
++	if (size <= 2*regsize)
++	  return nloc_intregpair;
++
++	/* Else fall through. Shouldn't happen though (at least with gcc) */
++      }
++
++    case DW_TAG_structure_type:
++    case DW_TAG_class_type:
++    case DW_TAG_union_type:
++    case DW_TAG_array_type:
++    aggregate:
++      /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
++      if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64))
++        return -2;
++
++      *locp = loc_aggregate;
++      return nloc_aggregate;
++    }
++
++  /* XXX We don't have a good way to return specific errors from ebl calls.
++     This value means we do not understand the type, but it is well-formed
++     DWARF and might be valid.  */
++  return -2;
++}
+Index: elfutils-0.145/backends/mips_symbol.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.145/backends/mips_symbol.c	2010-02-24 18:57:35.000000000 +0000
+@@ -0,0 +1,52 @@
++/* MIPS specific symbolic name handling.
++   Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++   Written by Jakub Jelinek <jakub@redhat.com>, 2002.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND		mips_
++#include "libebl_CPU.h"
++
++/* Check for the simple reloc types.  */
++Elf_Type
++mips_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++  switch (type)
++    {
++    case R_MIPS_16:
++      return ELF_T_HALF;
++    case R_MIPS_32:
++      return ELF_T_WORD;
++    case R_MIPS_64:
++      return ELF_T_XWORD;
++    default:
++      return ELF_T_NUM;
++    }
++}
+Index: elfutils-0.145/libebl/eblopenbackend.c
+===================================================================
+--- elfutils-0.145.orig/libebl/eblopenbackend.c	2010-02-24 18:55:51.000000000 +0000
++++ elfutils-0.145/libebl/eblopenbackend.c	2010-02-24 18:57:35.000000000 +0000
+@@ -91,6 +91,8 @@
+   { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 },
+   { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 },
+   { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 },
++  { "mips", "elf_mips", "mips", 4, EM_MIPS, 0, 0 },
++  { "mips", "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 },
+ 
+   { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
+   { "m68k", "elf_m68k", "m68k", 4, EM_68K, 0, 0 },
+Index: elfutils-0.145/backends/common-reloc.c
+===================================================================
+--- elfutils-0.145.orig/backends/common-reloc.c	2010-02-24 18:55:51.000000000 +0000
++++ elfutils-0.145/backends/common-reloc.c	2010-02-24 18:57:35.000000000 +0000
+@@ -109,11 +109,13 @@
+ }
+ 
+ 
++#ifndef NO_COPY_RELOC
+ bool
+ EBLHOOK(copy_reloc_p) (int reloc)
+ {
+   return reloc == R_TYPE (COPY);
+ }
++#endif
+ 
+ bool
+ EBLHOOK(none_reloc_p) (int reloc)
+@@ -135,7 +137,9 @@
+   ebl->reloc_type_name = EBLHOOK(reloc_type_name);
+   ebl->reloc_type_check = EBLHOOK(reloc_type_check);
+   ebl->reloc_valid_use = EBLHOOK(reloc_valid_use);
++#ifndef NO_COPY_RELOC
+   ebl->copy_reloc_p = EBLHOOK(copy_reloc_p);
++#endif
+   ebl->none_reloc_p = EBLHOOK(none_reloc_p);
+ #ifndef NO_RELATIVE_RELOC
+   ebl->relative_reloc_p = EBLHOOK(relative_reloc_p);
+Index: elfutils-0.145/backends/Makefile.am
+===================================================================
+--- elfutils-0.145.orig/backends/Makefile.am	2010-02-24 18:57:26.000000000 +0000
++++ elfutils-0.145/backends/Makefile.am	2010-02-24 18:57:57.000000000 +0000
+@@ -29,11 +29,11 @@
+ 	   -I$(top_srcdir)/libelf -I$(top_srcdir)/libdw
+ 
+ 
+-modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc
++modules = i386 sh x86_64 ia64 alpha arm sparc ppc ppc64 s390 parisc mips
+ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a \
+ 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a \
+ 	     libebl_sparc_pic.a libebl_ppc_pic.a libebl_ppc64_pic.a \
+-	     libebl_s390_pic.a libebl_parisc_pic.a
++	     libebl_s390_pic.a libebl_parisc_pic.a libebl_mips_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+ 
+@@ -99,6 +99,10 @@
+ libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
+ am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
+ 
++mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c
++libebl_mips_pic_a_SOURCES = $(mips_SRCS)
++am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
++
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ 	@rm -f $(@:.so=.map)
+ 	echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
new file mode 100644
index 0000000..2b5dad3
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Backport
+
+nm: Fix size passed to snprintf for invalid sh_name case.
+native build failed as following on Fedora18:
+nm.c: In function 'show_symbols_sysv':
+nm.c:756:27: error: argument to 'sizeof' in 'snprintf' call is the same expression as the destination; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess]
+    snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]",
+                           ^
+
+The original commit is http://git.fedorahosted.org/cgit/elfutils.git/commit/src/nm.c?id=57bd66cabf6e6b9ecf622cdbf350804897a8df58
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+
+--- elfutils-0.148/src/nm.c.org	2013-03-11 22:36:11.000000000 -0500
++++ elfutils-0.148/src/nm.c	2013-03-11 22:46:09.000000000 -0500
+@@ -752,8 +752,9 @@
+ 			       gelf_getshdr (scn, &shdr_mem)->sh_name);
+       if (unlikely (name == NULL))
+ 	{
+-	  name = alloca (sizeof "[invalid sh_name 0x12345678]");
+-	  snprintf (name, sizeof name, "[invalid sh_name %#" PRIx32 "]",
++	  const size_t bufsz = sizeof "[invalid sh_name 0x12345678]";
++	  name = alloca (bufsz);
++	  snprintf (name, bufsz, "[invalid sh_name %#" PRIx32 "]",
+ 		    gelf_getshdr (scn, &shdr_mem)->sh_name);
+ 	}
+       scnnames[elf_ndxscn (scn)] = name;
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff
new file mode 100644
index 0000000..b8a912c
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-portability.diff
@@ -0,0 +1,756 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.148/backends/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/backends/ChangeLog	2010-04-13 20:08:02.000000000 +0000
++++ elfutils-0.148/backends/ChangeLog	2010-07-03 13:04:07.000000000 +0000
+@@ -106,6 +106,10 @@
+ 	* ppc_attrs.c (ppc_check_object_attribute): Handle tag
+ 	GNU_Power_ABI_Struct_Return.
+ 
++2009-01-23  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
++
+ 2008-10-04  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
+@@ -433,6 +437,11 @@
+ 	* sparc_init.c: Likewise.
+ 	* x86_64_init.c: Likewise.
+ 
++2005-11-22  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
++	(libebl_%.so rule): Use it in place of -Wl,--as-needed.
++
+ 2005-11-19  Roland McGrath  <roland@redhat.com>
+ 
+ 	* ppc64_reloc.def: REL30 -> ADDR30.
+@@ -455,6 +464,9 @@
+ 	* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
+ 	(CLEANFILES): Add libebl_$(m).so.
+ 
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 	* ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
+ 	* ppc64_reloc.def: Likewise.
+ 
+Index: elfutils-0.148/backends/Makefile.am
+===================================================================
+--- elfutils-0.148.orig/backends/Makefile.am	2010-04-13 20:08:02.000000000 +0000
++++ elfutils-0.148/backends/Makefile.am	2010-07-03 13:04:07.000000000 +0000
+@@ -103,7 +103,7 @@
+ 	$(LINK) -shared -o $(@:.map=.so) \
+ 		-Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
+ 		-Wl,--version-script,$(@:.so=.map) \
+-		-Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw) $(libmudflap)
++		-Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw) $(libmudflap)
+ 	$(textrel_check)
+ 
+ libebl_i386.so: $(cpu_i386)
+Index: elfutils-0.148/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/ChangeLog	2010-04-21 14:26:40.000000000 +0000
++++ elfutils-0.148/ChangeLog	2010-07-03 13:04:07.000000000 +0000
+@@ -2,6 +2,10 @@
+ 
+ 	* configure.ac (LOCALEDIR, DATADIRNAME): Removed.
+ 
++2009-11-22  Roland McGrath  <roland@redhat.com>
++
++	* configure.ac: Use sed and expr instead of modern bash extensions.
++
+ 2009-09-21  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* configure.ac: Update for more modern autoconf.
+@@ -10,6 +14,10 @@
+ 
+ 	* configure.ac (zip_LIBS): Check for liblzma too.
+ 
++2009-08-17  Roland McGrath  <roland@redhat.com>
++
++	* configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
++
+ 2009-04-19  Roland McGrath  <roland@redhat.com>
+ 
+ 	* configure.ac (eu_version): Round down here, not in version.h macros.
+@@ -21,6 +29,8 @@
+ 
+ 2009-01-23  Roland McGrath  <roland@redhat.com>
+ 
++	* configure.ac: Check for __builtin_popcount.
++
+ 	* configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
+ 
+ 	* configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
+@@ -101,6 +111,10 @@
+ 	* configure.ac: Add dummy automake conditional to get dependencies
+ 	for non-generic linker right.  See src/Makefile.am.
+ 
++2005-11-22  Roland McGrath  <roland@redhat.com>
++
++	* configure.ac: Check for --as-needed linker option.
++
+ 2005-11-18  Roland McGrath  <roland@redhat.com>
+ 
+ 	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
+@@ -148,6 +162,17 @@
+ 	* Makefile.am (all_SUBDIRS): Add libdwfl.
+ 	* configure.ac: Write libdwfl/Makefile.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* configure.ac (WEXTRA): Check for -Wextra and set this substitution.
++
++	* configure.ac: Check for struct stat st_?tim members.
++	* src/strip.c (process_file): Use st_?time if st_?tim are not there.
++
++	* configure.ac: Check for futimes function.
++	* src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
++	(handle_ar) [! HAVE_FUTIMES]: Likewise.
++
+ 2005-05-19  Roland McGrath  <roland@redhat.com>
+ 
+ 	* configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
+Index: elfutils-0.148/config/eu.am
+===================================================================
+--- elfutils-0.148.orig/config/eu.am	2010-04-21 14:26:40.000000000 +0000
++++ elfutils-0.148/config/eu.am	2010-07-03 13:04:07.000000000 +0000
+@@ -25,11 +25,14 @@
+ ## <http://www.openinventionnetwork.com>.
+ ##
+ 
++WEXTRA = @WEXTRA@
++LD_AS_NEEDED = @LD_AS_NEEDED@
++
+ DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
+ INCLUDES = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
+ AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
+ 	    $(if $($(*F)_no_Werror),,-Werror) \
+-	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
++	    $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
+ 	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
+ 	    $($(*F)_CFLAGS)
+ 
+Index: elfutils-0.148/config.h.in
+===================================================================
+--- elfutils-0.148.orig/config.h.in	2010-06-28 19:07:37.000000000 +0000
++++ elfutils-0.148/config.h.in	2010-07-03 13:04:07.000000000 +0000
+@@ -1,5 +1,8 @@
+ /* config.h.in.  Generated from configure.ac by autoheader.  */
+ 
++/* Have __builtin_popcount. */
++#undef HAVE_BUILTIN_POPCOUNT
++
+ /* $libdir subdirectory containing libebl modules. */
+ #undef LIBEBL_SUBDIR
+ 
+@@ -55,4 +58,7 @@
+ /* Define for large files, on AIX-style hosts. */
+ #undef _LARGE_FILES
+ 
++/* Stubbed out if missing compiler support. */
++#undef __thread
++
+ #include <eu-config.h>
+Index: elfutils-0.148/configure.ac
+===================================================================
+--- elfutils-0.148.orig/configure.ac	2010-06-28 19:07:26.000000000 +0000
++++ elfutils-0.148/configure.ac	2010-07-03 13:04:07.000000000 +0000
+@@ -73,6 +73,54 @@
+ AS_IF([test "x$ac_cv_c99" != xyes],
+       AC_MSG_ERROR([gcc with C99 support required]))
+ 
++AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
++old_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -Wextra"
++AC_COMPILE_IFELSE([void foo (void) { }],
++		  ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
++CFLAGS="$old_CFLAGS"])
++AC_SUBST(WEXTRA)
++AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
++
++AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
++old_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -fgnu89-inline -Werror"
++AC_COMPILE_IFELSE([
++void foo (void)
++{
++  inline void bar (void) {}
++  bar ();
++}
++extern inline void baz (void) {}
++], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
++CFLAGS="$old_CFLAGS"])
++AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
++      [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
++
++AC_CACHE_CHECK([for --as-needed linker option],
++	       ac_cv_as_needed, [dnl
++cat > conftest.c <<EOF
++int main (void) { return 0; }
++EOF
++if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
++			    -fPIC -shared -o conftest.so conftest.c
++			    -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
++then
++  ac_cv_as_needed=yes
++else
++  ac_cv_as_needed=no
++fi
++rm -f conftest*])
++AS_IF([test "x$ac_cv_as_needed" = xyes],
++      [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
++AC_SUBST(LD_AS_NEEDED)
++
++AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
++AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
++	       ac_cv_popcount=yes, ac_cv_popcount=no)])
++AS_IF([test "x$ac_cv_popcount" = xyes],
++      [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
++
+ AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
+ # Use the same flags that we use for our DSOs, so the test is representative.
+ # Some old compiler/linker/libc combinations fail some ways and not others.
+@@ -88,7 +136,10 @@
+ CFLAGS="$save_CFLAGS"
+ LDFLAGS="$save_LDFLAGS"])
+ AS_IF([test "x$ac_cv_tls" != xyes],
+-      AC_MSG_ERROR([__thread support required]))
++      [AS_IF([test "$use_locks" = yes],
++	     [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
++	     [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
++			[Stubbed out if missing compiler support.])])])
+ 
+ dnl This test must come as early as possible after the compiler configuration
+ dnl tests, because the choice of the file model can (in principle) affect
+@@ -251,7 +302,7 @@
+ 
+ # 1.234<whatever> -> 1234<whatever>
+ case "$PACKAGE_VERSION" in
+-[[0-9]].*) eu_version="${PACKAGE_VERSION/./}" ;;
++[[0-9]].*) eu_version=`echo "$PACKAGE_VERSION" | sed 's@\.@@'` ;;
+ *)     	   AC_MSG_ERROR([confused by version number '$PACKAGE_VERSION']) ;;
+ esac
+ case "$eu_version" in
+@@ -280,6 +331,6 @@
+ esac
+ 
+ # Round up to the next release API (x.y) version.
+-[eu_version=$[($eu_version + 999) / 1000]]
++eu_version=`expr \( $eu_version + 999 \) / 1000`
+ 
+ AC_OUTPUT
+Index: elfutils-0.148/lib/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/lib/ChangeLog	2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/lib/ChangeLog	2010-07-03 13:04:07.000000000 +0000
+@@ -14,6 +14,9 @@
+ 
+ 2009-01-23  Roland McGrath  <roland@redhat.com>
+ 
++	* eu-config.h [! HAVE_BUILTIN_POPCOUNT]
++	(__builtin_popcount): New inline function.
++
+ 	* eu-config.h: Add multiple inclusion protection.
+ 
+ 2009-01-17  Ulrich Drepper  <drepper@redhat.com>
+@@ -70,6 +73,11 @@
+ 	* Makefile.am (libeu_a_SOURCES): Add it.
+ 	* system.h: Declare crc32_file.
+ 
++2005-02-07  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-04-30  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* Makefile.am: Use -ffunction-sections for xmalloc.c.
+Index: elfutils-0.148/lib/eu-config.h
+===================================================================
+--- elfutils-0.148.orig/lib/eu-config.h	2009-08-12 14:23:22.000000000 +0000
++++ elfutils-0.148/lib/eu-config.h	2010-07-03 13:04:07.000000000 +0000
+@@ -182,6 +182,17 @@
+ /* This macro is used by the tests conditionalize for standalone building.  */
+ #define ELFUTILS_HEADER(name) <lib##name.h>
+ 
++#ifndef HAVE_BUILTIN_POPCOUNT
++# define __builtin_popcount hakmem_popcount
++static inline unsigned int __attribute__ ((unused))
++hakmem_popcount (unsigned int x)
++{
++  /* HAKMEM 169 */
++  unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
++  return ((n + (n >> 3)) & 030707070707) % 63;
++}
++#endif	/* HAVE_BUILTIN_POPCOUNT */
++
+ 
+ #ifdef SHARED
+ # define OLD_VERSION(name, version) \
+Index: elfutils-0.148/libasm/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libasm/ChangeLog	2010-03-05 05:48:23.000000000 +0000
++++ elfutils-0.148/libasm/ChangeLog	2010-07-03 13:04:07.000000000 +0000
+@@ -67,6 +67,11 @@
+ 	* asm_error.c: Add new error ASM_E_IOERROR.
+ 	* libasmP.h: Add ASM_E_IOERROR definition.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
+Index: elfutils-0.148/libcpu/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libcpu/ChangeLog	2010-03-05 05:48:23.000000000 +0000
++++ elfutils-0.148/libcpu/ChangeLog	2010-07-03 13:04:07.000000000 +0000
+@@ -9,6 +9,9 @@
+ 
+ 2009-01-23  Roland McGrath  <roland@redhat.com>
+ 
++	* i386_disasm.c (i386_disasm): Add abort after assert-constant for old
++	compilers that don't realize it's noreturn.
++
+ 	* Makefile.am (i386_parse_CFLAGS): Use quotes around command
+ 	substitution that can produce leading whitespace.
+ 
+@@ -338,6 +341,11 @@
+ 	* defs/i386.doc: New file.
+ 	* defs/x86_64: New file.
+ 
++2005-04-04  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it instead of -Wextra.
++
+ 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
+Index: elfutils-0.148/libcpu/i386_disasm.c
+===================================================================
+--- elfutils-0.148.orig/libcpu/i386_disasm.c	2009-01-08 20:56:36.000000000 +0000
++++ elfutils-0.148/libcpu/i386_disasm.c	2010-07-03 13:04:07.000000000 +0000
+@@ -791,6 +791,7 @@
+ 
+ 			default:
+ 			  assert (! "INVALID not handled");
++			  abort ();
+ 			}
+ 		    }
+ 		  else
+Index: elfutils-0.148/libdw/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libdw/ChangeLog	2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/libdw/ChangeLog	2010-07-03 13:04:07.000000000 +0000
+@@ -276,6 +276,10 @@
+ 
+ 	* dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
+ 
++2009-08-17  Roland McGrath  <roland@redhat.com>
++
++	* libdw.h: Disable extern inlines for GCC 4.2.
++
+ 2009-08-10  Roland McGrath  <roland@redhat.com>
+ 
+ 	* dwarf_getscopevar.c: Use dwarf_diename.
+@@ -1044,6 +1048,11 @@
+ 
+ 2005-05-31  Roland McGrath  <roland@redhat.com>
+ 
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
+ 	* dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
+ 	formref offset.
+ 
+Index: elfutils-0.148/libdw/libdw.h
+===================================================================
+--- elfutils-0.148.orig/libdw/libdw.h	2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/libdw/libdw.h	2010-07-03 13:04:07.000000000 +0000
+@@ -842,7 +842,7 @@
+ 
+ 
+ /* Inline optimizations.  */
+-#ifdef __OPTIMIZE__
++#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
+ /* Return attribute code of given attribute.  */
+ __libdw_extern_inline unsigned int
+ dwarf_whatattr (Dwarf_Attribute *attr)
+Index: elfutils-0.148/libdwfl/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libdwfl/ChangeLog	2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/libdwfl/ChangeLog	2010-07-03 13:04:07.000000000 +0000
+@@ -1265,6 +1265,11 @@
+ 
+ 2005-07-21  Roland McGrath  <roland@redhat.com>
+ 
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
++2005-07-21  Roland McGrath  <roland@redhat.com>
++
+ 	* Makefile.am (noinst_HEADERS): Add loc2c.c.
+ 
+ 	* test2.c (main): Check sscanf result to quiet warning.
+Index: elfutils-0.148/libebl/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libebl/ChangeLog	2010-03-05 05:48:23.000000000 +0000
++++ elfutils-0.148/libebl/ChangeLog	2010-07-03 13:04:07.000000000 +0000
+@@ -624,6 +624,11 @@
+ 	* Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
+ 	tracking works right.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-21  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* libebl_x86_64.map: Add x86_64_core_note.
+Index: elfutils-0.148/libelf/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libelf/ChangeLog	2010-06-14 21:17:20.000000000 +0000
++++ elfutils-0.148/libelf/ChangeLog	2010-07-03 13:04:07.000000000 +0000
+@@ -657,6 +657,11 @@
+ 
+ 	* elf.h: Update from glibc.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-08  Roland McGrath  <roland@redhat.com>
+ 
+ 	* elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
+Index: elfutils-0.148/libelf/common.h
+===================================================================
+--- elfutils-0.148.orig/libelf/common.h	2009-01-08 20:56:36.000000000 +0000
++++ elfutils-0.148/libelf/common.h	2010-07-03 13:04:07.000000000 +0000
+@@ -160,7 +160,7 @@
+   (Var) = (sizeof (Var) == 1						      \
+ 	   ? (unsigned char) (Var)					      \
+ 	   : (sizeof (Var) == 2						      \
+-	      ? bswap_16 (Var)						      \
++	      ? (unsigned short int) bswap_16 (Var)			      \
+ 	      : (sizeof (Var) == 4					      \
+ 		 ? bswap_32 (Var)					      \
+ 		 : bswap_64 (Var))))
+@@ -169,7 +169,7 @@
+   (Dst) = (sizeof (Var) == 1						      \
+ 	   ? (unsigned char) (Var)					      \
+ 	   : (sizeof (Var) == 2						      \
+-	      ? bswap_16 (Var)						      \
++	      ? (unsigned short int) bswap_16 (Var)			      \
+ 	      : (sizeof (Var) == 4					      \
+ 		 ? bswap_32 (Var)					      \
+ 		 : bswap_64 (Var))))
+Index: elfutils-0.148/src/addr2line.c
+===================================================================
+--- elfutils-0.148.orig/src/addr2line.c	2010-05-28 14:38:30.000000000 +0000
++++ elfutils-0.148/src/addr2line.c	2010-07-03 13:05:40.000000000 +0000
+@@ -447,10 +447,10 @@
+       bool parsed = false;
+       int i, j;
+       char *name = NULL;
+-      if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
++      if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
+ 	  && string[i] == '\0')
+ 	parsed = adjust_to_section (name, &addr, dwfl);
+-      switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
++      switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
+ 	{
+ 	default:
+ 	  break;
+Index: elfutils-0.148/src/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/src/ChangeLog	2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/src/ChangeLog	2010-07-03 13:04:08.000000000 +0000
+@@ -165,8 +165,16 @@
+ 	* readelf.c (attr_callback): Use print_block only when we don't use
+ 	print_ops.
+ 
++2009-08-17  Roland McGrath  <roland@redhat.com>
++
++	* ld.h: Disable extern inlines for GCC 4.2.
++
+ 2009-08-14  Roland McGrath  <roland@redhat.com>
+ 
++	* strings.c (read_block): Conditionalize posix_fadvise use
++	on [POSIX_FADV_SEQUENTIAL].
++	From Petr Salinger <Petr.Salinger@seznam.cz>.
++
+ 	* ar.c (do_oper_extract): Use pathconf instead of statfs.
+ 
+ 2009-08-01  Ulrich Drepper  <drepper@redhat.com>
+@@ -330,6 +338,8 @@
+ 	* readelf.c (print_debug_frame_section): Use t instead of j formats
+ 	for ptrdiff_t OFFSET.
+ 
++	* addr2line.c (handle_address): Use %a instead of %m for compatibility.
++
+ 2009-01-21  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
+@@ -513,6 +523,11 @@
+ 	that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
+ 	is valid in RELRO.
+ 
++2008-03-01  Roland McGrath  <roland@redhat.com>
++
++	* readelf.c (dump_archive_index): Tweak portability hack
++	to match [__GNUC__ < 4] too.
++
+ 2008-02-29  Roland McGrath  <roland@redhat.com>
+ 
+ 	* readelf.c (print_attributes): Add a cast.
+@@ -764,6 +779,8 @@
+ 
+ 	* readelf.c (hex_dump): Fix rounding error in whitespace calculation.
+ 
++	* Makefile.am (readelf_no_Werror): New variable.
++
+ 2007-10-15  Roland McGrath  <roland@redhat.com>
+ 
+ 	* make-debug-archive.in: New file.
+@@ -1203,6 +1220,10 @@
+ 	* elflint.c (valid_e_machine): Add EM_ALPHA.
+ 	Reported by Christian Aichinger <Greek0@gmx.net>.
+ 
++	* strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
++	MADV_SEQUENTIAL if undefined.  	Don't call posix_madvise
++	if neither is defined.
++
+ 2006-08-08  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
+@@ -1279,6 +1300,10 @@
+ 	* Makefile.am: Add hacks to create dependency files for non-generic
+ 	linker.
+ 
++2006-04-05  Roland McGrath  <roland@redhat.com>
++
++	* strings.c (MAP_POPULATE): Define to 0 if undefined.
++
+ 2006-06-12  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
+@@ -1627,6 +1652,11 @@
+ 	* readelf.c (print_debug_loc_section): Fix indentation for larger
+ 	address size.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-30  Roland McGrath  <roland@redhat.com>
+ 
+ 	* readelf.c (print_debug_line_section): Print section offset of each
+Index: elfutils-0.148/src/findtextrel.c
+===================================================================
+--- elfutils-0.148.orig/src/findtextrel.c	2009-02-11 01:12:59.000000000 +0000
++++ elfutils-0.148/src/findtextrel.c	2010-07-03 13:04:08.000000000 +0000
+@@ -490,7 +490,11 @@
+ 
+ 
+ static void
+-check_rel (size_t nsegments, struct segments segments[nsegments],
++check_rel (size_t nsegments, struct segments segments[
++#if __GNUC__ >= 4
++						      nsegments
++#endif
++	   ],
+ 	   GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
+ 	   const char *fname, bool more_than_one, void **knownsrcs)
+ {
+Index: elfutils-0.148/src/ld.h
+===================================================================
+--- elfutils-0.148.orig/src/ld.h	2009-06-13 22:39:51.000000000 +0000
++++ elfutils-0.148/src/ld.h	2010-07-03 13:04:08.000000000 +0000
+@@ -1122,6 +1122,7 @@
+ 
+ /* Checked whether the symbol is undefined and referenced from a DSO.  */
+ extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
++#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
+@@ -1139,5 +1140,6 @@
+ 
+   return sym->defined && sym->in_dso;
+ }
++#endif	/* Optimizing and not GCC 4.2.  */
+ 
+ #endif	/* ld.h */
+Index: elfutils-0.148/src/Makefile.am
+===================================================================
+--- elfutils-0.148.orig/src/Makefile.am	2010-03-05 05:48:23.000000000 +0000
++++ elfutils-0.148/src/Makefile.am	2010-07-03 13:04:08.000000000 +0000
+@@ -99,6 +99,9 @@
+ # XXX While the file is not finished, don't warn about this
+ ldgeneric_no_Wunused = yes
+ 
++# Buggy old compilers.
++readelf_no_Werror = yes
++
+ readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(libmudflap) -ldl
+ size_LDADD = $(libelf) $(libeu) $(libmudflap)
+
+Index: elfutils-0.148/src/readelf.c
+===================================================================
+--- elfutils-0.148.orig/src/readelf.c	2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/src/readelf.c	2010-07-03 13:04:08.000000000 +0000
+@@ -7845,7 +7845,7 @@
+ 	  if (unlikely (elf_rand (elf, as_off) == 0)
+ 	      || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
+ 			   == NULL))
+-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
++#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
+ 	    while (1)
+ #endif
+ 	      error (EXIT_FAILURE, 0,
+Index: elfutils-0.148/src/strings.c
+===================================================================
+--- elfutils-0.148.orig/src/strings.c	2009-02-11 01:12:59.000000000 +0000
++++ elfutils-0.148/src/strings.c	2010-07-03 13:04:08.000000000 +0000
+@@ -51,6 +51,10 @@
+ 
+ #include <system.h>
+ 
++#ifndef MAP_POPULATE
++# define MAP_POPULATE 0
++#endif
++
+ 
+ /* Prototypes of local functions.  */
+ static int read_fd (int fd, const char *fname, off64_t fdlen);
+@@ -491,8 +495,13 @@
+ 		    fd, start_off);
+       if (mem != MAP_FAILED)
+ 	{
++#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
++# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
++#endif
++#ifdef POSIX_MADV_SEQUENTIAL
+ 	  /* We will go through the mapping sequentially.  */
+ 	  (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
++#endif
+ 	  break;
+ 	}
+       if (errno != EINVAL && errno != ENOMEM)
+@@ -586,9 +595,11 @@
+       elfmap_off = from & ~(ps - 1);
+       elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
+ 
++#ifdef POSIX_FADV_SEQUENTIAL
+       if (unlikely (elfmap == MAP_FAILED))
+ 	/* Let the kernel know we are going to read everything in sequence.  */
+ 	(void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
++#endif
+     }
+ 
+   if (unlikely (elfmap == MAP_FAILED))
+Index: elfutils-0.148/src/strip.c
+===================================================================
+--- elfutils-0.148.orig/src/strip.c	2010-01-15 09:05:55.000000000 +0000
++++ elfutils-0.148/src/strip.c	2010-07-03 13:04:08.000000000 +0000
+@@ -53,6 +53,12 @@
+ #include <libebl.h>
+ #include <system.h>
+ 
++#ifdef HAVE_FUTIMES
++# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
++#else
++# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
++#endif
++
+ 
+ /* Name and version of program.  */
+ static void print_version (FILE *stream, struct argp_state *state);
+@@ -301,8 +307,18 @@
+ 
+       /* If we have to preserve the timestamp, we need it in the
+ 	 format utimes() understands.  */
++#ifdef HAVE_STRUCT_STAT_ST_ATIM
+       TIMESPEC_TO_TIMEVAL (&tv[0], &pre_st.st_atim);
++#else
++      tv[0].tv_sec = pre_st.st_atime;
++      tv[0].tv_usec = 0;
++#endif
++#ifdef HAVE_STRUCT_STAT_ST_MTIM
+       TIMESPEC_TO_TIMEVAL (&tv[1], &pre_st.st_mtim);
++#else
++      tv[1].tv_sec = pre_st.st_atime;
++      tv[1].tv_usec = 0;
++#endif
+     }
+ 
+   /* Open the file.  */
+@@ -1747,7 +1763,7 @@
+   /* If requested, preserve the timestamp.  */
+   if (tvp != NULL)
+     {
+-      if (futimes (fd, tvp) != 0)
++      if (FUTIMES (fd, output_fname, tvp) != 0)
+ 	{
+ 	  error (0, errno, gettext ("\
+ cannot set access and modification date of '%s'"),
+@@ -1804,7 +1820,7 @@
+ 
+   if (tvp != NULL)
+     {
+-      if (unlikely (futimes (fd, tvp) != 0))
++      if (unlikely (FUTIMES (fd, fname, tvp) != 0))
+ 	{
+ 	  error (0, errno, gettext ("\
+ cannot set access and modification date of '%s'"), fname);
+Index: elfutils-0.148/tests/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/tests/ChangeLog	2010-06-28 19:05:56.000000000 +0000
++++ elfutils-0.148/tests/ChangeLog	2010-07-03 13:04:08.000000000 +0000
+@@ -154,6 +154,8 @@
+ 
+ 2008-01-21  Roland McGrath  <roland@redhat.com>
+ 
++	* line2addr.c (main): Revert last change.
++
+ 	* testfile45.S.bz2: Add tests for cltq, cqto.
+ 	* testfile45.expect.bz2: Adjust.
+ 
+@@ -862,6 +864,11 @@
+ 	* Makefile.am (TESTS): Add run-elflint-test.sh.
+ 	(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-24  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* get-files.c (main): Use correct format specifier.
+Index: elfutils-0.148/tests/line2addr.c
+===================================================================
+--- elfutils-0.148.orig/tests/line2addr.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/tests/line2addr.c	2010-07-03 13:04:08.000000000 +0000
+@@ -132,7 +132,7 @@
+     {
+       struct args a = { .arg = argv[cnt] };
+ 
+-      switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
++      switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
+ 	{
+ 	default:
+ 	case 0:
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff
new file mode 100644
index 0000000..cd39854
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/redhat-robustify.diff
@@ -0,0 +1,1709 @@
+Upstream-Status: Backport
+
+Index: elfutils-0.148/libelf/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/libelf/ChangeLog	2010-07-03 13:07:10.000000000 +0000
++++ elfutils-0.148/libelf/ChangeLog	2010-07-03 13:07:11.000000000 +0000
+@@ -649,10 +649,53 @@
+ 	If section content hasn't been read yet, do it before looking for the
+ 	block size.  If no section data present, infer size of section header.
+ 
++2005-05-14  Jakub Jelinek  <jakub@redhat.com>
++
++	* libelfP.h (INVALID_NDX): Define.
++	* gelf_getdyn.c (gelf_getdyn): Use it.  Remove ndx < 0 test if any.
++	* gelf_getlib.c (gelf_getlib): Likewise.
++	* gelf_getmove.c (gelf_getmove): Likewise.
++	* gelf_getrel.c (gelf_getrel): Likewise.
++	* gelf_getrela.c (gelf_getrela): Likewise.
++	* gelf_getsym.c (gelf_getsym): Likewise.
++	* gelf_getsyminfo.c (gelf_getsyminfo): Likewise.
++	* gelf_getsymshndx.c (gelf_getsymshndx): Likewise.
++	* gelf_getversym.c (gelf_getversym): Likewise.
++	* gelf_update_dyn.c (gelf_update_dyn): Likewise.
++	* gelf_update_lib.c (gelf_update_lib): Likewise.
++	* gelf_update_move.c (gelf_update_move): Likewise.
++	* gelf_update_rel.c (gelf_update_rel): Likewise.
++	* gelf_update_rela.c (gelf_update_rela): Likewise.
++	* gelf_update_sym.c (gelf_update_sym): Likewise.
++	* gelf_update_syminfo.c (gelf_update_syminfo): Likewise.
++	* gelf_update_symshndx.c (gelf_update_symshndx): Likewise.
++	* gelf_update_versym.c (gelf_update_versym): Likewise.
++	* elf_newscn.c (elf_newscn): Check for overflow.
++	* elf32_updatefile.c (__elfw2(LIBELFBITS,updatemmap)): Likewise.
++	(__elfw2(LIBELFBITS,updatefile)): Likewise.
++	* elf_begin.c (file_read_elf): Likewise.
++	* elf32_newphdr.c (elfw2(LIBELFBITS,newphdr)): Likewise.
++	* elf_getarsym.c (elf_getarsym): Likewise.
++	* elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)): Likewise.
+ 2005-05-11  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* elf.h: Update again.
+ 
++2005-05-17  Jakub Jelinek  <jakub@redhat.com>
++
++	* elf32_getphdr.c (elfw2(LIBELFBITS,getphdr)): Check if program header
++	table fits into object's bounds.
++	* elf_getshstrndx.c (elf_getshstrndx): Add elf->start_offset to
++	elf->map_address.  Check if first section header fits into object's
++	bounds.
++	* elf32_getshdr.c (elfw2(LIBELFBITS,getshdr)):
++	Check if section header table fits into object's bounds.
++	* elf_begin.c (get_shnum): Ensure section headers fits into
++	object's bounds.
++	(file_read_elf): Make sure scncnt is small enough to allocate both
++	ElfXX_Shdr and Elf_Scn array.  Make sure section and program header
++	tables fit into object's bounds.  Avoid memory leak on failure.
++
+ 2005-05-09  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* elf.h: Update from glibc.
+Index: elfutils-0.148/libelf/elf32_getphdr.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf32_getphdr.c	2010-04-21 14:26:40.000000000 +0000
++++ elfutils-0.148/libelf/elf32_getphdr.c	2010-07-03 13:07:11.000000000 +0000
+@@ -114,6 +114,16 @@
+ 
+       if (elf->map_address != NULL)
+ 	{
++	  /* First see whether the information in the ELF header is
++	     valid and it does not ask for too much.  */
++	  if (unlikely (ehdr->e_phoff >= elf->maximum_size)
++	      || unlikely (elf->maximum_size - ehdr->e_phoff < size))
++	    {
++	      /* Something is wrong.  */
++	      __libelf_seterrno (ELF_E_INVALID_PHDR);
++	      goto out;
++	    }
++
+ 	  /* All the data is already mapped.  Use it.  */
+ 	  void *file_phdr = ((char *) elf->map_address
+ 			     + elf->start_offset + ehdr->e_phoff);
+Index: elfutils-0.148/libelf/elf32_getshdr.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf32_getshdr.c	2009-06-13 22:41:42.000000000 +0000
++++ elfutils-0.148/libelf/elf32_getshdr.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Return section header.
+-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2005, 2007, 2009 Red Hat, Inc.
++   Copyright (C) 1998-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 1998.
+ 
+@@ -81,7 +81,8 @@
+     goto out;
+ 
+   size_t shnum;
+-  if (__elf_getshdrnum_rdlock (elf, &shnum) != 0)
++  if (__elf_getshdrnum_rdlock (elf, &shnum) != 0
++      || shnum > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Shdr)))
+     goto out;
+   size_t size = shnum * sizeof (ElfW2(LIBELFBITS,Shdr));
+ 
+@@ -98,6 +99,16 @@
+ 
+   if (elf->map_address != NULL)
+     {
++      /* First see whether the information in the ELF header is
++	 valid and it does not ask for too much.  */
++      if (unlikely (ehdr->e_shoff >= elf->maximum_size)
++	  || unlikely (elf->maximum_size - ehdr->e_shoff < size))
++	{
++	  /* Something is wrong.  */
++	  __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
++	  goto free_and_out;
++	}
++
+       ElfW2(LIBELFBITS,Shdr) *notcvt;
+ 
+       /* All the data is already mapped.  If we could use it
+Index: elfutils-0.148/libelf/elf32_newphdr.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf32_newphdr.c	2010-01-12 16:57:54.000000000 +0000
++++ elfutils-0.148/libelf/elf32_newphdr.c	2010-07-03 13:07:11.000000000 +0000
+@@ -135,6 +135,12 @@
+ 	   || count == PN_XNUM
+ 	   || elf->state.ELFW(elf,LIBELFBITS).phdr == NULL)
+     {
++      if (unlikely (count > SIZE_MAX / sizeof (ElfW2(LIBELFBITS,Phdr))))
++	{
++	  result = NULL;
++	  goto out;
++	}
++
+       /* Allocate a new program header with the appropriate number of
+ 	 elements.  */
+       result = (ElfW2(LIBELFBITS,Phdr) *)
+Index: elfutils-0.148/libelf/elf32_updatefile.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf32_updatefile.c	2010-01-12 16:57:54.000000000 +0000
++++ elfutils-0.148/libelf/elf32_updatefile.c	2010-07-03 13:07:11.000000000 +0000
+@@ -223,6 +223,9 @@
+   /* Write all the sections.  Well, only those which are modified.  */
+   if (shnum > 0)
+     {
++      if (unlikely (shnum > SIZE_MAX / sizeof (Elf_Scn *)))
++ 	return 1;
++
+       Elf_ScnList *list = &elf->state.ELFW(elf,LIBELFBITS).scns;
+       Elf_Scn **scns = (Elf_Scn **) alloca (shnum * sizeof (Elf_Scn *));
+       char *const shdr_start = ((char *) elf->map_address + elf->start_offset
+@@ -645,6 +648,10 @@
+   /* Write all the sections.  Well, only those which are modified.  */
+   if (shnum > 0)
+     {
++      if (unlikely (shnum > SIZE_MAX / (sizeof (Elf_Scn *)
++					+ sizeof (ElfW2(LIBELFBITS,Shdr)))))
++	return 1;
++
+       off_t shdr_offset = elf->start_offset + ehdr->e_shoff;
+ #if EV_NUM != 2
+       xfct_t shdr_fctp = __elf_xfctstom[__libelf_version - 1][EV_CURRENT - 1][ELFW(ELFCLASS, LIBELFBITS) - 1][ELF_T_SHDR];
+Index: elfutils-0.148/libelf/elf_begin.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf_begin.c	2010-04-21 14:26:40.000000000 +0000
++++ elfutils-0.148/libelf/elf_begin.c	2010-07-03 13:07:11.000000000 +0000
+@@ -165,7 +165,8 @@
+ 
+       if (unlikely (result == 0) && ehdr.e32->e_shoff != 0)
+ 	{
+-	  if (ehdr.e32->e_shoff + sizeof (Elf32_Shdr) > maxsize)
++	  if (unlikely (ehdr.e32->e_shoff >= maxsize)
++	      || unlikely (maxsize - ehdr.e32->e_shoff < sizeof (Elf32_Shdr)))
+ 	    /* Cannot read the first section header.  */
+ 	    return 0;
+ 
+@@ -213,7 +214,8 @@
+ 
+       if (unlikely (result == 0) && ehdr.e64->e_shoff != 0)
+ 	{
+-	  if (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize)
++	  if (unlikely (ehdr.e64->e_shoff >= maxsize)
++	      || unlikely (ehdr.e64->e_shoff + sizeof (Elf64_Shdr) > maxsize))
+ 	    /* Cannot read the first section header.  */
+ 	    return 0;
+ 
+@@ -285,6 +287,15 @@
+     /* Could not determine the number of sections.  */
+     return NULL;
+ 
++  /* Check for too many sections.  */
++  if (e_ident[EI_CLASS] == ELFCLASS32)
++    {
++      if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf32_Shdr)))
++	return NULL;
++    }
++  else if (scncnt > SIZE_MAX / (sizeof (Elf_Scn) + sizeof (Elf64_Shdr)))
++    return NULL;
++
+   /* We can now allocate the memory.  Even if there are no section headers,
+      we allocate space for a zeroth section in case we need it later.  */
+   const size_t scnmax = (scncnt ?: (cmd == ELF_C_RDWR || cmd == ELF_C_RDWR_MMAP)
+@@ -324,6 +335,16 @@
+ 	{
+ 	  /* We can use the mmapped memory.  */
+ 	  elf->state.elf32.ehdr = ehdr;
++
++	  if (unlikely (ehdr->e_shoff >= maxsize)
++	      || unlikely (maxsize - ehdr->e_shoff
++			   < scncnt * sizeof (Elf32_Shdr)))
++	    {
++	    free_and_out:
++	      free (elf);
++	      __libelf_seterrno (ELF_E_INVALID_FILE);
++	      return NULL;
++	    }
+ 	  elf->state.elf32.shdr
+ 	    = (Elf32_Shdr *) ((char *) ehdr + ehdr->e_shoff);
+ 
+@@ -410,6 +431,11 @@
+ 	{
+ 	  /* We can use the mmapped memory.  */
+ 	  elf->state.elf64.ehdr = ehdr;
++
++	  if (unlikely (ehdr->e_shoff >= maxsize)
++	      || unlikely (ehdr->e_shoff
++			   + scncnt * sizeof (Elf32_Shdr) > maxsize))
++	    goto free_and_out;
+ 	  elf->state.elf64.shdr
+ 	    = (Elf64_Shdr *) ((char *) ehdr + ehdr->e_shoff);
+ 
+Index: elfutils-0.148/libelf/elf_getarsym.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf_getarsym.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/elf_getarsym.c	2010-07-03 13:07:11.000000000 +0000
+@@ -179,6 +179,9 @@
+       size_t index_size = atol (tmpbuf);
+ 
+       if (SARMAG + sizeof (struct ar_hdr) + index_size > elf->maximum_size
++#if SIZE_MAX <= 4294967295U
++	  || n >= SIZE_MAX / sizeof (Elf_Arsym)
++#endif
+ 	  || n * sizeof (uint32_t) > index_size)
+ 	{
+ 	  /* This index table cannot be right since it does not fit into
+Index: elfutils-0.148/libelf/elf_getshdrstrndx.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf_getshdrstrndx.c	2009-06-13 22:31:35.000000000 +0000
++++ elfutils-0.148/libelf/elf_getshdrstrndx.c	2010-07-03 13:07:11.000000000 +0000
+@@ -125,10 +125,25 @@
+ 	      if (elf->map_address != NULL
+ 		  && elf->state.elf32.ehdr->e_ident[EI_DATA] == MY_ELFDATA
+ 		  && (ALLOW_UNALIGNED
+-		      || (((size_t) ((char *) elf->map_address + offset))
++		      || (((size_t) ((char *) elf->map_address
++			   + elf->start_offset + offset))
+ 			  & (__alignof__ (Elf32_Shdr) - 1)) == 0))
+-		/* We can directly access the memory.  */
+-		num = ((Elf32_Shdr *) (elf->map_address + offset))->sh_link;
++		{
++		  /* First see whether the information in the ELF header is
++		     valid and it does not ask for too much.  */
++		  if (unlikely (elf->maximum_size - offset
++				< sizeof (Elf32_Shdr)))
++		    {
++		      /* Something is wrong.  */
++		      __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
++		      result = -1;
++		      goto out;
++		    }
++
++		  /* We can directly access the memory.  */
++		  num = ((Elf32_Shdr *) (elf->map_address + elf->start_offset
++					 + offset))->sh_link;
++		}
+ 	      else
+ 		{
+ 		  /* We avoid reading in all the section headers.  Just read
+@@ -163,10 +178,25 @@
+ 	      if (elf->map_address != NULL
+ 		  && elf->state.elf64.ehdr->e_ident[EI_DATA] == MY_ELFDATA
+ 		  && (ALLOW_UNALIGNED
+-		      || (((size_t) ((char *) elf->map_address + offset))
++		      || (((size_t) ((char *) elf->map_address
++			   + elf->start_offset + offset))
+ 			  & (__alignof__ (Elf64_Shdr) - 1)) == 0))
+-		/* We can directly access the memory.  */
+-		num = ((Elf64_Shdr *) (elf->map_address + offset))->sh_link;
++		{
++		  /* First see whether the information in the ELF header is
++		     valid and it does not ask for too much.  */
++		  if (unlikely (elf->maximum_size - offset
++				< sizeof (Elf64_Shdr)))
++		    {
++		      /* Something is wrong.  */
++		      __libelf_seterrno (ELF_E_INVALID_SECTION_HEADER);
++		      result = -1;
++		      goto out;
++		    }
++
++		  /* We can directly access the memory.  */
++		  num = ((Elf64_Shdr *) (elf->map_address + elf->start_offset
++					 + offset))->sh_link;
++		}
+ 	      else
+ 		{
+ 		  /* We avoid reading in all the section headers.  Just read
+Index: elfutils-0.148/libelf/elf_newscn.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf_newscn.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/elf_newscn.c	2010-07-03 13:07:11.000000000 +0000
+@@ -104,10 +104,18 @@
+   else
+     {
+       /* We must allocate a new element.  */
+-      Elf_ScnList *newp;
++      Elf_ScnList *newp = NULL;
+ 
+       assert (elf->state.elf.scnincr > 0);
+ 
++      if (
++#if SIZE_MAX <= 4294967295U
++	  likely (elf->state.elf.scnincr
++		  < SIZE_MAX / 2 / sizeof (Elf_Scn) - sizeof (Elf_ScnList))
++#else
++	  1
++#endif
++	  )
+       newp = (Elf_ScnList *) calloc (sizeof (Elf_ScnList)
+ 				     + ((elf->state.elf.scnincr *= 2)
+ 					* sizeof (Elf_Scn)), 1);
+Index: elfutils-0.148/libelf/gelf_getdyn.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getdyn.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getdyn.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get information from dynamic table at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -93,7 +93,7 @@
+ 	 table entries has to be adopted.  The user better has provided
+ 	 a buffer where we can store the information.  While copying the
+ 	 data we are converting the format.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+@@ -114,7 +114,7 @@
+ 
+       /* The data is already in the correct form.  Just make sure the
+ 	 index is OK.  */
+-      if (unlikely ((ndx + 1) * sizeof (GElf_Dyn) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, GElf_Dyn, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+Index: elfutils-0.148/libelf/gelf_getlib.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getlib.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getlib.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get library from table at the given index.
+-   Copyright (C) 2004 Red Hat, Inc.
++   Copyright (C) 2004-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2004.
+ 
+@@ -86,7 +86,7 @@
+   /* The data is already in the correct form.  Just make sure the
+      index is OK.  */
+   GElf_Lib *result = NULL;
+-  if (unlikely ((ndx + 1) * sizeof (GElf_Lib) > data->d_size))
++  if (INVALID_NDX (ndx, GElf_Lib, data))
+     __libelf_seterrno (ELF_E_INVALID_INDEX);
+   else
+     {
+Index: elfutils-0.148/libelf/gelf_getmove.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getmove.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getmove.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get move structure at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -83,7 +83,7 @@
+ 
+   /* The data is already in the correct form.  Just make sure the
+      index is OK.  */
+-  if (unlikely ((ndx + 1) * sizeof (GElf_Move) > data->d_size))
++  if (INVALID_NDX (ndx, GElf_Move, data))
+     {
+       __libelf_seterrno (ELF_E_INVALID_INDEX);
+       goto out;
+Index: elfutils-0.148/libelf/gelf_getrela.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getrela.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getrela.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get RELA relocation information at given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -71,12 +71,6 @@
+   if (data_scn == NULL)
+     return NULL;
+ 
+-  if (unlikely (ndx < 0))
+-    {
+-      __libelf_seterrno (ELF_E_INVALID_INDEX);
+-      return NULL;
+-    }
+-
+   if (unlikely (data_scn->d.d_type != ELF_T_RELA))
+     {
+       __libelf_seterrno (ELF_E_INVALID_HANDLE);
+@@ -93,7 +87,7 @@
+   if (scn->elf->class == ELFCLASS32)
+     {
+       /* We have to convert the data.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  result = NULL;
+@@ -114,7 +108,7 @@
+     {
+       /* Simply copy the data after we made sure we are actually getting
+ 	 correct data.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  result = NULL;
+Index: elfutils-0.148/libelf/gelf_getrel.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getrel.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getrel.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get REL relocation information at given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -71,12 +71,6 @@
+   if (data_scn == NULL)
+     return NULL;
+ 
+-  if (unlikely (ndx < 0))
+-    {
+-      __libelf_seterrno (ELF_E_INVALID_INDEX);
+-      return NULL;
+-    }
+-
+   if (unlikely (data_scn->d.d_type != ELF_T_REL))
+     {
+       __libelf_seterrno (ELF_E_INVALID_HANDLE);
+@@ -93,7 +87,7 @@
+   if (scn->elf->class == ELFCLASS32)
+     {
+       /* We have to convert the data.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  result = NULL;
+@@ -113,7 +107,7 @@
+     {
+       /* Simply copy the data after we made sure we are actually getting
+ 	 correct data.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  result = NULL;
+Index: elfutils-0.148/libelf/gelf_getsym.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getsym.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getsym.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get symbol information from symbol table at the given index.
+-   Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 1999-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 1999.
+ 
+@@ -90,7 +90,7 @@
+ 	 table entries has to be adopted.  The user better has provided
+ 	 a buffer where we can store the information.  While copying the
+ 	 data we are converting the format.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data->d_size))
++      if (INVALID_NDX (ndx, Elf32_Sym, data))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+@@ -119,7 +119,7 @@
+ 
+       /* The data is already in the correct form.  Just make sure the
+ 	 index is OK.  */
+-      if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > data->d_size))
++      if (INVALID_NDX (ndx, GElf_Sym, data))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+Index: elfutils-0.148/libelf/gelf_getsyminfo.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getsyminfo.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getsyminfo.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get additional symbol information from symbol table at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -84,7 +84,7 @@
+ 
+   /* The data is already in the correct form.  Just make sure the
+      index is OK.  */
+-  if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data->d_size))
++  if (INVALID_NDX (ndx, GElf_Syminfo, data))
+     {
+       __libelf_seterrno (ELF_E_INVALID_INDEX);
+       goto out;
+Index: elfutils-0.148/libelf/gelf_getsymshndx.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getsymshndx.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getsymshndx.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,6 +1,6 @@
+ /* Get symbol information and separate section index from symbol table
+    at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -90,7 +90,7 @@
+      section index table.  */
+   if (likely (shndxdata_scn != NULL))
+     {
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Word) > shndxdata_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Word, &shndxdata_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+@@ -110,7 +110,7 @@
+ 	 table entries has to be adopted.  The user better has provided
+ 	 a buffer where we can store the information.  While copying the
+ 	 data we are converting the format.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata->d_size))
++      if (INVALID_NDX (ndx, Elf32_Sym, symdata))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+@@ -139,7 +139,7 @@
+ 
+       /* The data is already in the correct form.  Just make sure the
+ 	 index is OK.  */
+-      if (unlikely ((ndx + 1) * sizeof (GElf_Sym) > symdata->d_size))
++      if (INVALID_NDX (ndx, GElf_Sym, symdata))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+Index: elfutils-0.148/libelf/gelf_getversym.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_getversym.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_getversym.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Get symbol version information at the given index.
+-   Copyright (C) 1999, 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 1999-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 1999.
+ 
+@@ -92,7 +92,7 @@
+ 
+   /* The data is already in the correct form.  Just make sure the
+      index is OK.  */
+-  if (unlikely ((ndx + 1) * sizeof (GElf_Versym) > data->d_size))
++  if (INVALID_NDX (ndx, GElf_Versym, data))
+     {
+       __libelf_seterrno (ELF_E_INVALID_INDEX);
+       result = NULL;
+Index: elfutils-0.148/libelf/gelf_update_dyn.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_dyn.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_dyn.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update information in dynamic table at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -71,12 +71,6 @@
+   if (data == NULL)
+     return 0;
+ 
+-  if (unlikely (ndx < 0))
+-    {
+-      __libelf_seterrno (ELF_E_INVALID_INDEX);
+-      return 0;
+-    }
+-
+   if (unlikely (data_scn->d.d_type != ELF_T_DYN))
+     {
+       /* The type of the data better should match.  */
+@@ -102,7 +96,7 @@
+ 	}
+ 
+       /* Check whether we have to resize the data buffer.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Dyn) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Dyn, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+@@ -116,7 +110,7 @@
+   else
+     {
+       /* Check whether we have to resize the data buffer.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf64_Dyn) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Dyn, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+Index: elfutils-0.148/libelf/gelf_update_lib.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_lib.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_lib.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update library in table at the given index.
+-   Copyright (C) 2004 Red Hat, Inc.
++   Copyright (C) 2004-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2004.
+ 
+@@ -68,12 +68,6 @@
+   if (data == NULL)
+     return 0;
+ 
+-  if (unlikely (ndx < 0))
+-    {
+-      __libelf_seterrno (ELF_E_INVALID_INDEX);
+-      return 0;
+-    }
+-
+   Elf_Data_Scn *data_scn = (Elf_Data_Scn *) data;
+   if (unlikely (data_scn->d.d_type != ELF_T_LIB))
+     {
+@@ -87,7 +81,7 @@
+ 
+   /* Check whether we have to resize the data buffer.  */
+   int result = 0;
+-  if (unlikely ((ndx + 1) * sizeof (Elf64_Lib) > data_scn->d.d_size))
++  if (INVALID_NDX (ndx, Elf64_Lib, &data_scn->d))
+     __libelf_seterrno (ELF_E_INVALID_INDEX);
+   else
+     {
+Index: elfutils-0.148/libelf/gelf_update_move.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_move.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_move.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update move structure at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -75,8 +75,7 @@
+   assert (sizeof (GElf_Move) == sizeof (Elf64_Move));
+ 
+   /* Check whether we have to resize the data buffer.  */
+-  if (unlikely (ndx < 0)
+-      || unlikely ((ndx + 1) * sizeof (GElf_Move) > data_scn->d.d_size))
++  if (INVALID_NDX (ndx, GElf_Move, &data_scn->d))
+     {
+       __libelf_seterrno (ELF_E_INVALID_INDEX);
+       return 0;
+Index: elfutils-0.148/libelf/gelf_update_rela.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_rela.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_rela.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update RELA relocation information at given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -68,12 +68,6 @@
+   if (dst == NULL)
+     return 0;
+ 
+-  if (unlikely (ndx < 0))
+-    {
+-      __libelf_seterrno (ELF_E_INVALID_INDEX);
+-      return 0;
+-    }
+-
+   if (unlikely (data_scn->d.d_type != ELF_T_RELA))
+     {
+       /* The type of the data better should match.  */
+@@ -101,7 +95,7 @@
+ 	}
+ 
+       /* Check whether we have to resize the data buffer.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Rela) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Rela, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+@@ -117,7 +111,7 @@
+   else
+     {
+       /* Check whether we have to resize the data buffer.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf64_Rela) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Rela, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+Index: elfutils-0.148/libelf/gelf_update_rel.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_rel.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_rel.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update REL relocation information at given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -68,12 +68,6 @@
+   if (dst == NULL)
+     return 0;
+ 
+-  if (unlikely (ndx < 0))
+-    {
+-      __libelf_seterrno (ELF_E_INVALID_INDEX);
+-      return 0;
+-    }
+-
+   if (unlikely (data_scn->d.d_type != ELF_T_REL))
+     {
+       /* The type of the data better should match.  */
+@@ -99,7 +93,7 @@
+ 	}
+ 
+       /* Check whether we have to resize the data buffer.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Rel) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Rel, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+@@ -114,7 +108,7 @@
+   else
+     {
+       /* Check whether we have to resize the data buffer.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf64_Rel) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Rel, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+Index: elfutils-0.148/libelf/gelf_update_sym.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_sym.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_sym.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update symbol information in symbol table at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -72,12 +72,6 @@
+   if (data == NULL)
+     return 0;
+ 
+-  if (unlikely (ndx < 0))
+-    {
+-      __libelf_seterrno (ELF_E_INVALID_INDEX);
+-      return 0;
+-    }
+-
+   if (unlikely (data_scn->d.d_type != ELF_T_SYM))
+     {
+       /* The type of the data better should match.  */
+@@ -102,7 +96,7 @@
+ 	}
+ 
+       /* Check whether we have to resize the data buffer.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Sym, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+@@ -125,7 +119,7 @@
+   else
+     {
+       /* Check whether we have to resize the data buffer.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > data_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Sym, &data_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+Index: elfutils-0.148/libelf/gelf_update_syminfo.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_syminfo.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_syminfo.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update additional symbol information in symbol table at the given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -72,12 +72,6 @@
+   if (data == NULL)
+     return 0;
+ 
+-  if (unlikely (ndx < 0))
+-    {
+-      __libelf_seterrno (ELF_E_INVALID_INDEX);
+-      return 0;
+-    }
+-
+   if (unlikely (data_scn->d.d_type != ELF_T_SYMINFO))
+     {
+       /* The type of the data better should match.  */
+@@ -93,7 +87,7 @@
+   rwlock_wrlock (scn->elf->lock);
+ 
+   /* Check whether we have to resize the data buffer.  */
+-  if (unlikely ((ndx + 1) * sizeof (GElf_Syminfo) > data_scn->d.d_size))
++  if (INVALID_NDX (ndx, GElf_Syminfo, &data_scn->d))
+     {
+       __libelf_seterrno (ELF_E_INVALID_INDEX);
+       goto out;
+Index: elfutils-0.148/libelf/gelf_update_symshndx.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_symshndx.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_symshndx.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,6 +1,6 @@
+ /* Update symbol information and section index in symbol table at the
+    given index.
+-   Copyright (C) 2000, 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2000-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2000.
+ 
+@@ -77,12 +77,6 @@
+   if (symdata == NULL)
+     return 0;
+ 
+-  if (unlikely (ndx < 0))
+-    {
+-      __libelf_seterrno (ELF_E_INVALID_INDEX);
+-      return 0;
+-    }
+-
+   if (unlikely (symdata_scn->d.d_type != ELF_T_SYM))
+     {
+       /* The type of the data better should match.  */
+@@ -128,7 +122,7 @@
+ 	}
+ 
+       /* Check whether we have to resize the data buffer.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf32_Sym) > symdata_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf32_Sym, &symdata_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+@@ -151,7 +145,7 @@
+   else
+     {
+       /* Check whether we have to resize the data buffer.  */
+-      if (unlikely ((ndx + 1) * sizeof (Elf64_Sym) > symdata_scn->d.d_size))
++      if (INVALID_NDX (ndx, Elf64_Sym, &symdata_scn->d))
+ 	{
+ 	  __libelf_seterrno (ELF_E_INVALID_INDEX);
+ 	  goto out;
+Index: elfutils-0.148/libelf/gelf_update_versym.c
+===================================================================
+--- elfutils-0.148.orig/libelf/gelf_update_versym.c	2009-01-08 20:56:37.000000000 +0000
++++ elfutils-0.148/libelf/gelf_update_versym.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1,5 +1,5 @@
+ /* Update symbol version information.
+-   Copyright (C) 2001, 2002 Red Hat, Inc.
++   Copyright (C) 2001-2009 Red Hat, Inc.
+    This file is part of Red Hat elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2001.
+ 
+@@ -75,8 +75,7 @@
+   assert (sizeof (GElf_Versym) == sizeof (Elf64_Versym));
+ 
+   /* Check whether we have to resize the data buffer.  */
+-  if (unlikely (ndx < 0)
+-      || unlikely ((ndx + 1) * sizeof (GElf_Versym) > data_scn->d.d_size))
++  if (INVALID_NDX (ndx, GElf_Versym, &data_scn->d))
+     {
+       __libelf_seterrno (ELF_E_INVALID_INDEX);
+       return 0;
+Index: elfutils-0.148/libelf/libelfP.h
+===================================================================
+--- elfutils-0.148.orig/libelf/libelfP.h	2010-01-12 16:57:54.000000000 +0000
++++ elfutils-0.148/libelf/libelfP.h	2010-07-03 13:07:11.000000000 +0000
+@@ -608,4 +608,8 @@
+ /* Align offset to 4 bytes as needed for note name and descriptor data.  */
+ #define NOTE_ALIGN(n)	(((n) + 3) & -4U)
+ 
++/* Convenience macro.  */
++#define INVALID_NDX(ndx, type, data) \
++  unlikely ((data)->d_size / sizeof (type) <= (unsigned int) (ndx))
++
+ #endif  /* libelfP.h */
+Index: elfutils-0.148/src/ChangeLog
+===================================================================
+--- elfutils-0.148.orig/src/ChangeLog	2010-07-03 13:07:10.000000000 +0000
++++ elfutils-0.148/src/ChangeLog	2010-07-03 13:07:11.000000000 +0000
+@@ -1640,6 +1640,16 @@
+ 	object symbols or symbols with unknown type.
+ 	(check_rel): Likewise.
+ 
++2005-06-09  Roland McGrath  <roland@redhat.com>
++
++	* readelf.c (handle_dynamic, handle_symtab): Check for bogus sh_link.
++	(handle_verneed, handle_verdef, handle_versym, handle_hash): Likewise.
++	(handle_scngrp): Check for bogus sh_info.
++
++	* strip.c (handle_elf): Check for bogus values in sh_link, sh_info,
++	st_shndx, e_shstrndx, and SHT_GROUP or SHT_SYMTAB_SHNDX data.
++	Don't use assert on input values, instead bail with "illformed" error.
++
+ 2005-06-08  Roland McGrath  <roland@redhat.com>
+ 
+ 	* readelf.c (print_ops): Add consts.
+@@ -1690,6 +1700,19 @@
+ 
+ 	* readelf.c (dwarf_tag_string): Add new tags.
+ 
++2005-05-17  Jakub Jelinek  <jakub@redhat.com>
++
++	* elflint.c (check_hash): Don't check entries beyond end of section.
++	(check_note): Don't crash if gelf_rawchunk fails.
++	(section_name): Return <invalid> if gelf_getshdr returns NULL.
++
++2005-05-14  Jakub Jelinek  <jakub@redhat.com>
++
++	* elflint.c (section_name): Return "<invalid>" instead of
++	crashing on invalid section name.
++	(check_symtab, is_rel_dyn, check_rela, check_rel, check_dynamic,
++	check_symtab_shndx, check_hash, check_versym): Robustify.
++
+ 2005-05-08  Roland McGrath  <roland@redhat.com>
+ 
+ 	* strip.c (handle_elf): Don't translate hash and versym data formats,
+Index: elfutils-0.148/src/elflint.c
+===================================================================
+--- elfutils-0.148.orig/src/elflint.c	2010-04-13 20:08:02.000000000 +0000
++++ elfutils-0.148/src/elflint.c	2010-07-03 13:07:11.000000000 +0000
+@@ -131,6 +131,10 @@
+ /* Array to count references in section groups.  */
+ static int *scnref;
+ 
++/* Numbers of sections and program headers.  */
++static unsigned int shnum;
++static unsigned int phnum;
++
+ 
+ int
+ main (int argc, char *argv[])
+@@ -319,10 +323,19 @@
+ {
+   GElf_Shdr shdr_mem;
+   GElf_Shdr *shdr;
++  const char *ret;
++
++  if ((unsigned int) idx > shnum)
++    return "<invalid>";
+ 
+   shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem);
++  if (shdr == NULL)
++    return "<invalid>";
+ 
+-  return elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
++  ret = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
++  if (ret == NULL)
++    return "<invalid>";
++  return ret;
+ }
+ 
+ 
+@@ -344,11 +357,6 @@
+   (sizeof (valid_e_machine) / sizeof (valid_e_machine[0]))
+ 
+ 
+-/* Numbers of sections and program headers.  */
+-static unsigned int shnum;
+-static unsigned int phnum;
+-
+-
+ static void
+ check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
+ {
+@@ -632,7 +640,8 @@
+ 	  }
+       }
+ 
+-  if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT))
++  size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT);
++  if (shdr->sh_entsize != sh_entsize)
+     ERROR (gettext ("\
+ section [%2u] '%s': entry size is does not match ElfXX_Sym\n"),
+ 	   idx, section_name (ebl, idx));
+@@ -670,7 +679,7 @@
+ 	       xndxscnidx, section_name (ebl, xndxscnidx));
+     }
+ 
+-  for (size_t cnt = 1; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++  for (size_t cnt = 1; cnt < shdr->sh_size / sh_entsize; ++cnt)
+     {
+       sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx);
+       if (sym == NULL)
+@@ -690,7 +699,8 @@
+       else
+ 	{
+ 	  name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
+-	  assert (name != NULL);
++	  assert (name != NULL
++		  || strshdr->sh_type != SHT_STRTAB);
+ 	}
+ 
+       if (sym->st_shndx == SHN_XINDEX)
+@@ -1038,9 +1048,11 @@
+     {
+       GElf_Shdr rcshdr_mem;
+       const GElf_Shdr *rcshdr = gelf_getshdr (scn, &rcshdr_mem);
+-      assert (rcshdr != NULL);
+ 
+-      if (rcshdr->sh_type == SHT_DYNAMIC)
++      if (rcshdr == NULL)
++	break;
++
++      if (rcshdr->sh_type == SHT_DYNAMIC && rcshdr->sh_entsize)
+ 	{
+ 	  /* Found the dynamic section.  Look through it.  */
+ 	  Elf_Data *d = elf_getdata (scn, NULL);
+@@ -1050,7 +1062,9 @@
+ 	    {
+ 	      GElf_Dyn dyn_mem;
+ 	      GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem);
+-	      assert (dyn != NULL);
++
++	      if (dyn == NULL)
++		break;
+ 
+ 	      if (dyn->d_tag == DT_RELCOUNT)
+ 		{
+@@ -1064,7 +1078,9 @@
+ 		      /* Does the number specified number of relative
+ 			 relocations exceed the total number of
+ 			 relocations?  */
+-		      if (dyn->d_un.d_val > shdr->sh_size / shdr->sh_entsize)
++		      if (shdr->sh_entsize != 0
++			  && dyn->d_un.d_val > (shdr->sh_size
++						/ shdr->sh_entsize))
+ 			ERROR (gettext ("\
+ section [%2d] '%s': DT_RELCOUNT value %d too high for this section\n"),
+ 			       idx, section_name (ebl, idx),
+@@ -1224,7 +1240,8 @@
+ 	}
+     }
+ 
+-  if (shdr->sh_entsize != gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT))
++  size_t sh_entsize = gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT);
++  if (shdr->sh_entsize != sh_entsize)
+     ERROR (gettext (reltype == ELF_T_RELA ? "\
+ section [%2d] '%s': section entry size does not match ElfXX_Rela\n" : "\
+ section [%2d] '%s': section entry size does not match ElfXX_Rel\n"),
+@@ -1447,7 +1464,8 @@
+   Elf_Data *symdata = elf_getdata (symscn, NULL);
+   enum load_state state = state_undecided;
+ 
+-  for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++  size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT);
++  for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
+     {
+       GElf_Rela rela_mem;
+       GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem);
+@@ -1497,7 +1515,8 @@
+   Elf_Data *symdata = elf_getdata (symscn, NULL);
+   enum load_state state = state_undecided;
+ 
+-  for (size_t cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++  size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT);
++  for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
+     {
+       GElf_Rel rel_mem;
+       GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem);
+@@ -1600,7 +1619,8 @@
+ 	   shdr->sh_link, section_name (ebl, shdr->sh_link),
+ 	   idx, section_name (ebl, idx));
+ 
+-  if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT))
++  size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT);
++  if (shdr->sh_entsize != sh_entsize)
+     ERROR (gettext ("\
+ section [%2d] '%s': section entry size does not match ElfXX_Dyn\n"),
+ 	   idx, section_name (ebl, idx));
+@@ -1610,7 +1630,7 @@
+ 	   idx, section_name (ebl, idx));
+ 
+   bool non_null_warned = false;
+-  for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
++  for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt)
+     {
+       GElf_Dyn dyn_mem;
+       GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem);
+@@ -1891,6 +1911,8 @@
+ 	   idx, section_name (ebl, idx));
+ 
+   if (symshdr != NULL
++      && shdr->sh_entsize
++      && symshdr->sh_entsize
+       && (shdr->sh_size / shdr->sh_entsize
+ 	  < symshdr->sh_size / symshdr->sh_entsize))
+     ERROR (gettext ("\
+@@ -1917,6 +1939,12 @@
+     }
+ 
+   Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
++  if (data == NULL)
++    {
++      ERROR (gettext ("section [%2d] '%s': cannot get section data\n"),
++ 	     idx, section_name (ebl, idx));
++      return;
++    }
+ 
+   if (*((Elf32_Word *) data->d_buf) != 0)
+     ERROR (gettext ("symbol 0 should have zero extended section index\n"));
+@@ -1959,7 +1987,7 @@
+ 
+   size_t maxidx = nchain;
+ 
+-  if (symshdr != NULL)
++  if (symshdr != NULL && symshdr->sh_entsize != 0)
+     {
+       size_t symsize = symshdr->sh_size / symshdr->sh_entsize;
+ 
+@@ -1970,18 +1998,28 @@
+       maxidx = symsize;
+     }
+ 
++  Elf32_Word *buf = (Elf32_Word *) data->d_buf;
++  Elf32_Word *end = (Elf32_Word *) ((char *) data->d_buf + shdr->sh_size);
+   size_t cnt;
+   for (cnt = 2; cnt < 2 + nbucket; ++cnt)
+-    if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
++    {
++      if (buf + cnt >= end)
++	break;
++      else if (buf[cnt] >= maxidx)
+       ERROR (gettext ("\
+ section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
+ 	     idx, section_name (ebl, idx), cnt - 2);
++    }
+ 
+   for (; cnt < 2 + nbucket + nchain; ++cnt)
+-    if (((Elf32_Word *) data->d_buf)[cnt] >= maxidx)
++    {
++      if (buf + cnt >= end)
++	break;
++      else if (buf[cnt] >= maxidx)
+       ERROR (gettext ("\
+ section [%2d] '%s': hash chain reference %zu out of bounds\n"),
+ 	     idx, section_name (ebl, idx), cnt - 2 - nbucket);
++    }
+ }
+ 
+ 
+@@ -2011,18 +2049,28 @@
+       maxidx = symsize;
+     }
+ 
++  Elf64_Xword *buf = (Elf64_Xword *) data->d_buf;
++  Elf64_Xword *end = (Elf64_Xword *) ((char *) data->d_buf + shdr->sh_size);
+   size_t cnt;
+   for (cnt = 2; cnt < 2 + nbucket; ++cnt)
+-    if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
++    {
++      if (buf + cnt >= end)
++	break;
++      else if (buf[cnt] >= maxidx)
+       ERROR (gettext ("\
+ section [%2d] '%s': hash bucket reference %zu out of bounds\n"),
+ 	     idx, section_name (ebl, idx), cnt - 2);
++    }
+ 
+   for (; cnt < 2 + nbucket + nchain; ++cnt)
+-    if (((Elf64_Xword *) data->d_buf)[cnt] >= maxidx)
++    {
++      if (buf + cnt >= end)
++	break;
++      else if (buf[cnt] >= maxidx)
+       ERROR (gettext ("\
+ section [%2d] '%s': hash chain reference %" PRIu64 " out of bounds\n"),
+-	     idx, section_name (ebl, idx), (uint64_t) (cnt - 2 - nbucket));
++	       idx, section_name (ebl, idx), (uint64_t) cnt - 2 - nbucket);
++    }
+ }
+ 
+ 
+@@ -2047,7 +2095,7 @@
+   if (shdr->sh_size < (4 + bitmask_words + nbuckets) * sizeof (Elf32_Word))
+     {
+       ERROR (gettext ("\
+-section [%2d] '%s': hash table section is too small (is %ld, expected at least%ld)\n"),
++section [%2d] '%s': hash table section is too small (is %ld, expected at least %ld)\n"),
+ 	     idx, section_name (ebl, idx), (long int) shdr->sh_size,
+ 	     (long int) ((4 + bitmask_words + nbuckets) * sizeof (Elf32_Word)));
+       return;
+@@ -2719,8 +2767,9 @@
+ 
+   /* The number of elements in the version symbol table must be the
+      same as the number of symbols.  */
+-  if (shdr->sh_size / shdr->sh_entsize
+-      != symshdr->sh_size / symshdr->sh_entsize)
++  if (shdr->sh_entsize && symshdr->sh_entsize
++      && (shdr->sh_size / shdr->sh_entsize
++	  != symshdr->sh_size / symshdr->sh_entsize))
+     ERROR (gettext ("\
+ section [%2d] '%s' has different number of entries than symbol table [%2d] '%s'\n"),
+ 	   idx, section_name (ebl, idx),
+Index: elfutils-0.148/src/readelf.c
+===================================================================
+--- elfutils-0.148.orig/src/readelf.c	2010-07-03 13:07:10.000000000 +0000
++++ elfutils-0.148/src/readelf.c	2010-07-03 13:07:11.000000000 +0000
+@@ -1172,6 +1172,8 @@
+   Elf32_Word *grpref = (Elf32_Word *) data->d_buf;
+ 
+   GElf_Sym sym_mem;
++  GElf_Sym *sym = gelf_getsym (symdata, shdr->sh_info, &sym_mem);
++
+   printf ((grpref[0] & GRP_COMDAT)
+ 	  ? ngettext ("\
+ \nCOMDAT section group [%2zu] '%s' with signature '%s' contains %zu entry:\n",
+@@ -1184,8 +1186,8 @@
+ 		      data->d_size / sizeof (Elf32_Word) - 1),
+ 	  elf_ndxscn (scn),
+ 	  elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
+-	  elf_strptr (ebl->elf, symshdr->sh_link,
+-		      gelf_getsym (symdata, shdr->sh_info, &sym_mem)->st_name)
++	  (sym == NULL ? NULL
++	   : elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name))
+ 	  ?: gettext ("<INVALID SYMBOL>"),
+ 	  data->d_size / sizeof (Elf32_Word) - 1);
+ 
+@@ -1336,7 +1338,8 @@
+ handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
+ {
+   int class = gelf_getclass (ebl->elf);
+-  GElf_Shdr glink;
++  GElf_Shdr glink_mem;
++  GElf_Shdr *glink;
+   Elf_Data *data;
+   size_t cnt;
+   size_t shstrndx;
+@@ -1351,6 +1354,11 @@
+     error (EXIT_FAILURE, 0,
+ 	   gettext ("cannot get section header string table index"));
+ 
++  glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
++  if (glink == NULL)
++    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
++	   elf_ndxscn (scn));
++
+   printf (ngettext ("\
+ \nDynamic segment contains %lu entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
+ 		    "\
+@@ -1360,9 +1368,7 @@
+ 	  class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
+ 	  shdr->sh_offset,
+ 	  (int) shdr->sh_link,
+-	  elf_strptr (ebl->elf, shstrndx,
+-		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+-				    &glink)->sh_name));
++	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+   fputs_unlocked (gettext ("  Type              Value\n"), stdout);
+ 
+   for (cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
+@@ -1945,6 +1951,13 @@
+     error (EXIT_FAILURE, 0,
+ 	   gettext ("cannot get section header string table index"));
+ 
++  GElf_Shdr glink_mem;
++  GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
++				   &glink_mem);
++  if (glink == NULL)
++    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
++	   elf_ndxscn (scn));
++
+   /* Now we can compute the number of entries in the section.  */
+   unsigned int nsyms = data->d_size / (class == ELFCLASS32
+ 				       ? sizeof (Elf32_Sym)
+@@ -1955,15 +1968,12 @@
+ 		    nsyms),
+ 	  (unsigned int) elf_ndxscn (scn),
+ 	  elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
+-  GElf_Shdr glink;
+   printf (ngettext (" %lu local symbol  String table: [%2u] '%s'\n",
+ 		    " %lu local symbols  String table: [%2u] '%s'\n",
+ 		    shdr->sh_info),
+ 	  (unsigned long int) shdr->sh_info,
+ 	  (unsigned int) shdr->sh_link,
+-	  elf_strptr (ebl->elf, shstrndx,
+-		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+-				    &glink)->sh_name));
++	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+ 
+   fputs_unlocked (class == ELFCLASS32
+ 		  ? gettext ("\
+@@ -2199,7 +2209,13 @@
+     error (EXIT_FAILURE, 0,
+ 	   gettext ("cannot get section header string table index"));
+ 
+-  GElf_Shdr glink;
++  GElf_Shdr glink_mem;
++  GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
++				   &glink_mem);
++  if (glink == NULL)
++    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
++	   elf_ndxscn (scn));
++
+   printf (ngettext ("\
+ \nVersion needs section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
+ 		    "\
+@@ -2210,9 +2226,7 @@
+ 	  class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
+ 	  shdr->sh_offset,
+ 	  (unsigned int) shdr->sh_link,
+-	  elf_strptr (ebl->elf, shstrndx,
+-		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+-				    &glink)->sh_name));
++	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+ 
+   unsigned int offset = 0;
+   for (int cnt = shdr->sh_info; --cnt >= 0; )
+@@ -2265,8 +2279,14 @@
+     error (EXIT_FAILURE, 0,
+ 	   gettext ("cannot get section header string table index"));
+ 
++  GElf_Shdr glink_mem;
++  GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
++				   &glink_mem);
++  if (glink == NULL)
++    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
++	   elf_ndxscn (scn));
++
+   int class = gelf_getclass (ebl->elf);
+-  GElf_Shdr glink;
+   printf (ngettext ("\
+ \nVersion definition section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
+ 		    "\
+@@ -2278,9 +2298,7 @@
+ 	  class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
+ 	  shdr->sh_offset,
+ 	  (unsigned int) shdr->sh_link,
+-	  elf_strptr (ebl->elf, shstrndx,
+-		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+-				    &glink)->sh_name));
++	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+ 
+   unsigned int offset = 0;
+   for (int cnt = shdr->sh_info; --cnt >= 0; )
+@@ -2542,8 +2560,14 @@
+       filename = NULL;
+     }
+ 
++  GElf_Shdr glink_mem;
++  GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
++				   &glink_mem);
++  if (glink == NULL)
++    error (EXIT_FAILURE, 0, gettext ("invalid sh_link value in section %Zu"),
++	   elf_ndxscn (scn));
++
+   /* Print the header.  */
+-  GElf_Shdr glink;
+   printf (ngettext ("\
+ \nVersion symbols section [%2u] '%s' contains %d entry:\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'",
+ 		    "\
+@@ -2555,9 +2579,7 @@
+ 	  class == ELFCLASS32 ? 10 : 18, shdr->sh_addr,
+ 	  shdr->sh_offset,
+ 	  (unsigned int) shdr->sh_link,
+-	  elf_strptr (ebl->elf, shstrndx,
+-		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+-				    &glink)->sh_name));
++	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+ 
+   /* Now we can finally look at the actual contents of this section.  */
+   for (unsigned int cnt = 0; cnt < shdr->sh_size / shdr->sh_entsize; ++cnt)
+@@ -2609,7 +2631,17 @@
+   for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt)
+     ++counts[lengths[cnt]];
+ 
+-  GElf_Shdr glink;
++  GElf_Shdr glink_mem;
++  GElf_Shdr *glink = gelf_getshdr (elf_getscn (ebl->elf,
++					       shdr->sh_link),
++				   &glink_mem);
++  if (glink == NULL)
++    {
++      error (0, 0, gettext ("invalid sh_link value in section %Zu"),
++	     elf_ndxscn (scn));
++      return;
++    }
++
+   printf (ngettext ("\
+ \nHistogram for bucket list length in section [%2u] '%s' (total of %d bucket):\n Addr: %#0*" PRIx64 "  Offset: %#08" PRIx64 "  Link to section: [%2u] '%s'\n",
+ 		    "\
+@@ -2622,9 +2654,7 @@
+ 	  shdr->sh_addr,
+ 	  shdr->sh_offset,
+ 	  (unsigned int) shdr->sh_link,
+-	  elf_strptr (ebl->elf, shstrndx,
+-		      gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
+-				    &glink)->sh_name));
++	  elf_strptr (ebl->elf, shstrndx, glink->sh_name));
+ 
+   if (extrastr != NULL)
+     fputs (extrastr, stdout);
+@@ -4312,6 +4342,16 @@
+       return;
+     }
+ 
++  GElf_Shdr glink_mem;
++  GElf_Shdr *glink;
++  glink = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &glink_mem);
++  if (glink == NULL)
++    {
++      error (0, 0, gettext ("invalid sh_link value in section %Zu"),
++	     elf_ndxscn (scn));
++      return;
++    }
++
+   printf (ngettext ("\
+ \nDWARF section [%2zu] '%s' at offset %#" PRIx64 " contains %zu entry:\n",
+ 		    "\
+Index: elfutils-0.148/src/strip.c
+===================================================================
+--- elfutils-0.148.orig/src/strip.c	2010-07-03 13:07:10.000000000 +0000
++++ elfutils-0.148/src/strip.c	2010-07-03 13:07:11.000000000 +0000
+@@ -561,6 +561,11 @@
+       goto fail_close;
+     }
+ 
++  if (shstrndx >= shnum)
++    goto illformed;
++
++#define elf_assert(test) do { if (!(test)) goto illformed; } while (0)
++
+   /* Storage for section information.  We leave room for two more
+      entries since we unconditionally create a section header string
+      table.  Maybe some weird tool created an ELF file without one.
+@@ -582,7 +587,7 @@
+     {
+       /* This should always be true (i.e., there should not be any
+ 	 holes in the numbering).  */
+-      assert (elf_ndxscn (scn) == cnt);
++      elf_assert (elf_ndxscn (scn) == cnt);
+ 
+       shdr_info[cnt].scn = scn;
+ 
+@@ -595,6 +600,7 @@
+ 					shdr_info[cnt].shdr.sh_name);
+       if (shdr_info[cnt].name == NULL)
+ 	{
++	illformed:
+ 	  error (0, 0, gettext ("illformed file '%s'"), fname);
+ 	  goto fail_close;
+ 	}
+@@ -604,6 +610,8 @@
+ 
+       /* Remember the shdr.sh_link value.  */
+       shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link;
++      if (shdr_info[cnt].old_sh_link >= shnum)
++	goto illformed;
+ 
+       /* Sections in files other than relocatable object files which
+ 	 are not loaded can be freely moved by us.  In relocatable
+@@ -616,7 +624,7 @@
+ 	 appropriate reference.  */
+       if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX))
+ 	{
+-	  assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
++	  elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
+ 	  shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt;
+ 	}
+       else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP))
+@@ -633,7 +641,12 @@
+ 	  for (inner = 1;
+ 	       inner < shdr_info[cnt].data->d_size / sizeof (Elf32_Word);
+ 	       ++inner)
++	    {
++	      if (grpref[inner] < shnum)
+ 	    shdr_info[grpref[inner]].group_idx = cnt;
++	      else
++		goto illformed;
++	    }
+ 
+ 	  if (inner == 1 || (inner == 2 && (grpref[0] & GRP_COMDAT) == 0))
+ 	    /* If the section group contains only one element and this
+@@ -644,7 +657,7 @@
+ 	}
+       else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym))
+ 	{
+-	  assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
++	  elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
+ 	  shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt;
+ 	}
+ 
+@@ -652,7 +665,7 @@
+ 	 discarded right away.  */
+       if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0)
+ 	{
+-	  assert (shdr_info[cnt].group_idx != 0);
++	  elf_assert (shdr_info[cnt].group_idx != 0);
+ 
+ 	  if (shdr_info[shdr_info[cnt].group_idx].idx == 0)
+ 	    {
+@@ -727,11 +740,15 @@
+ 	    {
+ 	      /* If a relocation section is marked as being removed make
+ 		 sure the section it is relocating is removed, too.  */
+-	      if ((shdr_info[cnt].shdr.sh_type == SHT_REL
++	      if (shdr_info[cnt].shdr.sh_type == SHT_REL
+ 		   || shdr_info[cnt].shdr.sh_type == SHT_RELA)
+-		  && shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
++		{
++		  if (shdr_info[cnt].shdr.sh_info >= shnum)
++		    goto illformed;
++		  else if (shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
+ 		shdr_info[cnt].idx = 1;
+ 	    }
++	    }
+ 
+ 	  if (shdr_info[cnt].idx == 1)
+ 	    {
+@@ -758,7 +775,7 @@
+ 		  if (shdr_info[cnt].symtab_idx != 0
+ 		      && shdr_info[shdr_info[cnt].symtab_idx].data == NULL)
+ 		    {
+-		      assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
++		      elf_assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
+ 
+ 		      shdr_info[shdr_info[cnt].symtab_idx].data
+ 			= elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
+@@ -798,6 +815,9 @@
+ 		      else if (scnidx == SHN_XINDEX)
+ 			scnidx = xndx;
+ 
++		      if (scnidx >= shnum)
++			goto illformed;
++
+ 		      if (shdr_info[scnidx].idx == 0)
+ 			/* This symbol table has a real symbol in
+ 			   a discarded section.  So preserve the
+@@ -828,12 +848,16 @@
+ 		}
+ 
+ 	      /* Handle references through sh_info.  */
+-	      if (SH_INFO_LINK_P (&shdr_info[cnt].shdr)
+-		  && shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
++	      if (SH_INFO_LINK_P (&shdr_info[cnt].shdr))
++		{
++		  if (shdr_info[cnt].shdr.sh_info >= shnum)
++		    goto illformed;
++		  else if ( shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
+ 		{
+ 		  shdr_info[shdr_info[cnt].shdr.sh_info].idx = 1;
+ 		  changes |= shdr_info[cnt].shdr.sh_info < cnt;
+ 		}
++		}
+ 
+ 	      /* Mark the section as investigated.  */
+ 	      shdr_info[cnt].idx = 2;
+@@ -972,7 +996,7 @@
+ 	  error (EXIT_FAILURE, 0, gettext ("while generating output file: %s"),
+ 		 elf_errmsg (-1));
+ 
+-	assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
++	elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
+ 
+ 	/* Add this name to the section header string table.  */
+ 	shdr_info[cnt].se = ebl_strtabadd (shst, shdr_info[cnt].name, 0);
+@@ -1009,7 +1033,7 @@
+ 	error (EXIT_FAILURE, 0,
+ 	       gettext ("while create section header section: %s"),
+ 	       elf_errmsg (-1));
+-      assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
++      elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == shdr_info[cnt].idx);
+ 
+       shdr_info[cnt].data = elf_newdata (shdr_info[cnt].newscn);
+       if (shdr_info[cnt].data == NULL)
+@@ -1065,7 +1089,7 @@
+     error (EXIT_FAILURE, 0,
+ 	   gettext ("while create section header section: %s"),
+ 	   elf_errmsg (-1));
+-  assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
++  elf_assert (elf_ndxscn (shdr_info[cnt].newscn) == idx);
+ 
+   /* Finalize the string table and fill in the correct indices in the
+      section headers.  */
+@@ -1155,20 +1179,20 @@
+ 		    shndxdata = elf_getdata (shdr_info[shdr_info[cnt].symtab_idx].scn,
+ 					     NULL);
+ 
+-		    assert ((versiondata->d_size / sizeof (Elf32_Word))
++		    elf_assert ((versiondata->d_size / sizeof (Elf32_Word))
+ 			    >= shdr_info[cnt].data->d_size / elsize);
+ 		  }
+ 
+ 		if (shdr_info[cnt].version_idx != 0)
+ 		  {
+-		    assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
++		    elf_assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
+ 		    /* This section has associated version
+ 		       information.  We have to modify that
+ 		       information, too.  */
+ 		    versiondata = elf_getdata (shdr_info[shdr_info[cnt].version_idx].scn,
+ 					       NULL);
+ 
+-		    assert ((versiondata->d_size / sizeof (GElf_Versym))
++		    elf_assert ((versiondata->d_size / sizeof (GElf_Versym))
+ 			    >= shdr_info[cnt].data->d_size / elsize);
+ 		  }
+ 
+@@ -1223,7 +1247,7 @@
+ 		      sec = shdr_info[sym->st_shndx].idx;
+ 		    else
+ 		      {
+-			assert (shndxdata != NULL);
++			elf_assert (shndxdata != NULL);
+ 
+ 			sec = shdr_info[xshndx].idx;
+ 		      }
+@@ -1244,7 +1268,7 @@
+ 			    nxshndx = sec;
+ 			  }
+ 
+-			assert (sec < SHN_LORESERVE || shndxdata != NULL);
++			elf_assert (sec < SHN_LORESERVE || shndxdata != NULL);
+ 
+ 			if ((inner != destidx || nshndx != sym->st_shndx
+ 			     || (shndxdata != NULL && nxshndx != xshndx))
+@@ -1268,7 +1292,7 @@
+ 			     || shdr_info[cnt].debug_data == NULL)
+ 		      /* This is a section symbol for a section which has
+ 			 been removed.  */
+-		      assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION);
++		      elf_assert (GELF_ST_TYPE (sym->st_info) == STT_SECTION);
+ 		  }
+ 
+ 		if (destidx != inner)
+@@ -1455,11 +1479,11 @@
+ 		  {
+ 		    GElf_Sym sym_mem;
+ 		    GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
+-		    assert (sym != NULL);
++		    elf_assert (sym != NULL);
+ 
+ 		    const char *name = elf_strptr (elf, strshndx,
+ 						   sym->st_name);
+-		    assert (name != NULL);
++		    elf_assert (name != NULL);
+ 		    size_t hidx = elf_hash (name) % nbucket;
+ 
+ 		    if (bucket[hidx] == 0)
+@@ -1478,7 +1502,7 @@
+ 	    else
+ 	      {
+ 		/* Alpha and S390 64-bit use 64-bit SHT_HASH entries.  */
+-		assert (shdr_info[cnt].shdr.sh_entsize
++		elf_assert (shdr_info[cnt].shdr.sh_entsize
+ 			== sizeof (Elf64_Xword));
+ 
+ 		Elf64_Xword *bucket = (Elf64_Xword *) hashd->d_buf;
+@@ -1509,11 +1533,11 @@
+ 		  {
+ 		    GElf_Sym sym_mem;
+ 		    GElf_Sym *sym = gelf_getsym (symd, inner, &sym_mem);
+-		    assert (sym != NULL);
++		    elf_assert (sym != NULL);
+ 
+ 		    const char *name = elf_strptr (elf, strshndx,
+ 						   sym->st_name);
+-		    assert (name != NULL);
++		    elf_assert (name != NULL);
+ 		    size_t hidx = elf_hash (name) % nbucket;
+ 
+ 		    if (bucket[hidx] == 0)
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch
new file mode 100644
index 0000000..6a19791
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/remove-unused.patch
@@ -0,0 +1,154 @@
+Upstream-Status: Backport
+
+Remove unused variables from the code to prevent -Werror causing a build
+failure on hosts with GCC 4.6.
+
+These changes are all upstream so should not be required once we've updated
+to elfutils 0.152 or later. Therefore this patch consolidates several
+changes from elfutils upstream by Roland McGrath into a single file so that
+it's easier to remove later once we upgrade.
+Links to upstream gitweb of the consolidated commits follow:
+- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=7094d00a169afb27e0323f8580e817798ae7c240
+- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=fd992543185126eb0280c1ee0883e073020499b4
+- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=4db89f04bb59327abd7a3b60e88f2e7e73c65c79
+- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=8f6c1795ab9d41f03805eebd55767070ade55aac
+- http://git.fedorahosted.org/git?p=elfutils.git;a=commit;h=240784b48aa276822c5a61c9ad6a4355051ce259
+
+Joshua Lock <josh@linux.intel.com> - 06/04/11
+
+Index: elfutils-0.148/libasm/asm_newscn.c
+===================================================================
+--- elfutils-0.148.orig/libasm/asm_newscn.c
++++ elfutils-0.148/libasm/asm_newscn.c
+@@ -162,7 +162,6 @@ asm_newscn (ctx, scnname, type, flags)
+      GElf_Xword flags;
+ {
+   size_t scnname_len = strlen (scnname) + 1;
+-  unsigned long int hval;
+   AsmScn_t *result;
+ 
+   /* If no context is given there might be an earlier error.  */
+@@ -180,8 +179,6 @@ asm_newscn (ctx, scnname, type, flags)
+       return NULL;
+     }
+ 
+-  hval = elf_hash (scnname);
+-
+   rwlock_wrlock (ctx->lock);
+ 
+   /* This is a new section.  */
+Index: elfutils-0.148/src/elflint.c
+===================================================================
+--- elfutils-0.148.orig/src/elflint.c
++++ elfutils-0.148/src/elflint.c
+@@ -707,9 +707,10 @@ section [%2d] '%s': symbol %zu: invalid 
+ 	{
+ 	  if (xndxdata == NULL)
+ 	    {
+-	      ERROR (gettext ("\
++	      if (!no_xndx_warned)
++		ERROR (gettext ("\
+ section [%2d] '%s': symbol %zu: too large section index but no extended section index section\n"),
+-		     idx, section_name (ebl, idx), cnt);
++		       idx, section_name (ebl, idx), cnt);
+ 	      no_xndx_warned = true;
+ 	    }
+ 	  else if (xndx < SHN_LORESERVE)
+@@ -1592,10 +1593,6 @@ check_dynamic (Ebl *ebl, GElf_Ehdr *ehdr
+       [DT_STRSZ] = true,
+       [DT_SYMENT] = true
+     };
+-  GElf_Addr reladdr = 0;
+-  GElf_Word relsz = 0;
+-  GElf_Addr pltreladdr = 0;
+-  GElf_Word pltrelsz = 0;
+ 
+   memset (has_dt, '\0', sizeof (has_dt));
+   memset (has_val_dt, '\0', sizeof (has_val_dt));
+@@ -1694,15 +1691,6 @@ section [%2d] '%s': entry %zu: level 2 t
+ section [%2d] '%s': entry %zu: DT_PLTREL value must be DT_REL or DT_RELA\n"),
+ 	       idx, section_name (ebl, idx), cnt);
+ 
+-      if (dyn->d_tag == DT_REL)
+-	reladdr = dyn->d_un.d_ptr;
+-      if (dyn->d_tag == DT_RELSZ)
+-	relsz = dyn->d_un.d_val;
+-      if (dyn->d_tag == DT_JMPREL)
+-	pltreladdr = dyn->d_un.d_ptr;
+-      if (dyn->d_tag == DT_PLTRELSZ)
+-	pltrelsz = dyn->d_un.d_val;
+-
+       /* Check that addresses for entries are in loaded segments.  */
+       switch (dyn->d_tag)
+ 	{
+Index: elfutils-0.148/src/ldgeneric.c
+===================================================================
+--- elfutils-0.148.orig/src/ldgeneric.c
++++ elfutils-0.148/src/ldgeneric.c
+@@ -285,12 +285,10 @@ static int
+ check_for_duplicate2 (struct usedfiles *newp, struct usedfiles *list)
+ {
+   struct usedfiles *first;
+-  struct usedfiles *prevp;
+ 
+   if (list == NULL)
+     return 0;
+ 
+-  prevp = list;
+   list = first = list->next;
+   do
+     {
+Index: elfutils-0.148/src/ldscript.y
+===================================================================
+--- elfutils-0.148.orig/src/ldscript.y
++++ elfutils-0.148/src/ldscript.y
+@@ -802,12 +802,9 @@ add_versions (struct version *versions)
+ 
+   do
+     {
+-      struct version *oldp;
+-
+       add_id_list (versions->versionname, versions->local_names, true);
+       add_id_list (versions->versionname, versions->global_names, false);
+ 
+-      oldp = versions;
+       versions = versions->next;
+     }
+   while (versions != NULL);
+Index: elfutils-0.148/src/unstrip.c
+===================================================================
+--- elfutils-0.148.orig/src/unstrip.c
++++ elfutils-0.148/src/unstrip.c
+@@ -1301,7 +1301,6 @@ more sections in stripped file than debu
+   /* Match each debuginfo section with its corresponding stripped section.  */
+   bool check_prelink = false;
+   Elf_Scn *unstripped_symtab = NULL;
+-  size_t unstripped_strtab_ndx = SHN_UNDEF;
+   size_t alloc_avail = 0;
+   scn = NULL;
+   while ((scn = elf_nextscn (unstripped, scn)) != NULL)
+@@ -1313,7 +1312,6 @@ more sections in stripped file than debu
+       if (shdr->sh_type == SHT_SYMTAB)
+ 	{
+ 	  unstripped_symtab = scn;
+-	  unstripped_strtab_ndx = shdr->sh_link;
+ 	  continue;
+ 	}
+ 
+Index: elfutils-0.148/src/ldscript.c
+===================================================================
+--- elfutils-0.148.orig/src/ldscript.c
++++ elfutils-0.148/src/ldscript.c
+@@ -2728,12 +2728,9 @@ add_versions (struct version *versions)
+ 
+   do
+     {
+-      struct version *oldp;
+-
+       add_id_list (versions->versionname, versions->local_names, true);
+       add_id_list (versions->versionname, versions->global_names, false);
+ 
+-      oldp = versions;
+       versions = versions->next;
+     }
+   while (versions != NULL);
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff b/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff
new file mode 100644
index 0000000..d792d5f
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/testsuite-ignore-elflint.diff
@@ -0,0 +1,21 @@
+Upstream-Status: Backport
+
+On many architectures this test fails because binaries/libs produced by
+binutils don't pass elflint. However elfutils shouldn't FTBFS because of this.
+
+So we run the tests on all archs to see what breaks, but if it breaks we ignore
+the result (exitcode 77 means: this test was skipped).
+
+Index: elfutils-0.128/tests/run-elflint-self.sh
+===================================================================
+--- elfutils-0.128.orig/tests/run-elflint-self.sh	2007-07-08 21:46:16.000000000 +0000
++++ elfutils-0.128/tests/run-elflint-self.sh	2007-07-08 21:46:49.000000000 +0000
+@@ -32,7 +32,7 @@
+ #  echo $1
+   if [ -f $1 ]; then
+     testrun ../src/elflint --quiet --gnu-ld $1 ||
+-    { echo "*** failure in $1"; status=1; }
++    { echo "*** failure in $1"; status=77; }
+   fi
+ }
+ 
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch b/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch
new file mode 100644
index 0000000..3cf16ac
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/uclibc-support-for-elfutils-0.148.patch
@@ -0,0 +1,91 @@
+on uclibc systems libintl and libuargp are separate from libc.
+so they need to be specified on commandline when we use proxy-libintl
+then libintl is a static archive so it should be listed last since
+elfutils does not respect disable-nls we need to link in libintl
+
+We add a new option --enable-uclibc which will be used to control
+the uclibc specific configurations during build.
+
+Signed-off-by: Khem Raj <raj.khem>
+
+Upstream-Status: Inappropriate [uclibc specific]
+
+Index: elfutils-0.148/configure.ac
+===================================================================
+--- elfutils-0.148.orig/configure.ac
++++ elfutils-0.148/configure.ac
+@@ -55,9 +55,16 @@ AS_IF([test "$use_locks" = yes], [AC_DEF
+ 
+ AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
+ 
++AC_ARG_ENABLE([uclibc],
++AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
++use_uclibc=yes, use_uclibc=no)
++AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
++AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
++
++AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
++
+ dnl Add all the languages for which translations are available.
+ ALL_LINGUAS=
+-
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_PROG_YACC
+Index: elfutils-0.148/libelf/Makefile.am
+===================================================================
+--- elfutils-0.148.orig/libelf/Makefile.am
++++ elfutils-0.148/libelf/Makefile.am
+@@ -93,7 +93,12 @@ if !MUDFLAP
+ libelf_pic_a_SOURCES =
+ am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
+ 
++
+ libelf_so_LDLIBS =
++if USE_UCLIBC
++libelf_so_LDLIBS += -lintl -luargp
++endif
++
+ if USE_LOCKS
+ libelf_so_LDLIBS += -lpthread
+ endif
+Index: elfutils-0.148/libdw/Makefile.am
+===================================================================
+--- elfutils-0.148.orig/libdw/Makefile.am
++++ elfutils-0.148/libdw/Makefile.am
+@@ -98,6 +98,11 @@ if !MUDFLAP
+ libdw_pic_a_SOURCES =
+ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+ 
++libdw_so_LDLIBS =
++if USE_UCLIBC
++libdw_so_LDLIBS += -lintl -luargp
++endif
++
+ libdw_so_SOURCES =
+ libdw.so: $(srcdir)/libdw.map libdw_pic.a \
+ 	  ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
+@@ -108,7 +113,7 @@ libdw.so: $(srcdir)/libdw.map libdw_pic.
+ 		-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
+ 		-Wl,--version-script,$<,--no-undefined \
+ 		-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
+-		-ldl $(zip_LIBS)
++		-ldl $(zip_LIBS) $(libdw_so_LDLIBS)
+ 	if readelf -d $@ | fgrep -q TEXTREL; then exit 1; fi
+ 	ln -fs $@ $@.$(VERSION)
+ 
+Index: elfutils-0.148/libcpu/Makefile.am
+===================================================================
+--- elfutils-0.148.orig/libcpu/Makefile.am
++++ elfutils-0.148/libcpu/Makefile.am
+@@ -63,6 +63,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
+ i386_lex.o: i386_parse.h
+ i386_gendis_LDADD = $(libeu) -lm $(libmudflap)
+ 
++if USE_UCLIBC
++i386_gendis_LDADD += -luargp -lintl
++endif
++
+ i386_parse.h: i386_parse.c ;
+ 
+ noinst_HEADERS = memory-access.h i386_parse.h i386_data.h
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h b/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h
new file mode 100644
index 0000000..a0198be
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.148/x86_64_dis.h
@@ -0,0 +1,1632 @@
+#define MNEMONIC_BITS 10
+#define SUFFIX_BITS 3
+#define FCT1_BITS 7
+#define STR1_BITS 4
+#define OFF1_1_BITS 7
+#define OFF1_1_BIAS 3
+#define OFF1_2_BITS 7
+#define OFF1_2_BIAS 4
+#define OFF1_3_BITS 1
+#define OFF1_3_BIAS 7
+#define FCT2_BITS 6
+#define STR2_BITS 2
+#define OFF2_1_BITS 7
+#define OFF2_1_BIAS 5
+#define OFF2_2_BITS 7
+#define OFF2_2_BIAS 4
+#define OFF2_3_BITS 4
+#define OFF2_3_BIAS 7
+#define FCT3_BITS 4
+#define STR3_BITS 1
+#define OFF3_1_BITS 6
+#define OFF3_1_BIAS 10
+#define OFF3_2_BITS 1
+#define OFF3_2_BIAS 21
+
+#include <i386_data.h>
+
+#define suffix_none 0
+#define suffix_w 1
+#define suffix_w0 2
+#define suffix_W 3
+#define suffix_tttn 4
+#define suffix_D 7
+#define suffix_w1 5
+#define suffix_W1 6
+
+static const opfct_t op1_fct[] =
+{
+  NULL,
+  FCT_MOD$R_M,
+  FCT_Mod$R_m,
+  FCT_abs,
+  FCT_ax,
+  FCT_ax$w,
+  FCT_ccc,
+  FCT_ddd,
+  FCT_disp8,
+  FCT_ds_bx,
+  FCT_ds_si,
+  FCT_dx,
+  FCT_es_di,
+  FCT_freg,
+  FCT_imm$s,
+  FCT_imm$w,
+  FCT_imm16,
+  FCT_imm64$w,
+  FCT_imm8,
+  FCT_imms8,
+  FCT_mmxreg,
+  FCT_mod$16r_m,
+  FCT_mod$64r_m,
+  FCT_mod$8r_m,
+  FCT_mod$r_m,
+  FCT_mod$r_m$w,
+  FCT_reg,
+  FCT_reg$w,
+  FCT_reg64,
+  FCT_rel,
+  FCT_sel,
+  FCT_sreg2,
+  FCT_sreg3,
+  FCT_string,
+  FCT_xmmreg,
+};
+static const char op1_str[] =
+  "%ax\0"
+  "%cl\0"
+  "%rax\0"
+  "%st\0"
+  "%xmm0\0"
+  "*";
+static const uint8_t op1_str_idx[] = {
+  0,
+  4,
+  8,
+  13,
+  17,
+  23,
+};
+static const opfct_t op2_fct[] =
+{
+  NULL,
+  FCT_MOD$R_M,
+  FCT_Mod$R_m,
+  FCT_abs,
+  FCT_absval,
+  FCT_ax$w,
+  FCT_ccc,
+  FCT_ddd,
+  FCT_ds_si,
+  FCT_dx,
+  FCT_es_di,
+  FCT_freg,
+  FCT_imm8,
+  FCT_mmxreg,
+  FCT_mod$64r_m,
+  FCT_mod$r_m,
+  FCT_mod$r_m$w,
+  FCT_oreg,
+  FCT_oreg$w,
+  FCT_reg,
+  FCT_reg$w,
+  FCT_reg64,
+  FCT_sreg3,
+  FCT_string,
+  FCT_xmmreg,
+};
+static const char op2_str[] =
+  "%rcx\0"
+  "%st";
+static const uint8_t op2_str_idx[] = {
+  0,
+  5,
+};
+static const opfct_t op3_fct[] =
+{
+  NULL,
+  FCT_mmxreg,
+  FCT_mod$r_m,
+  FCT_reg,
+  FCT_string,
+  FCT_xmmreg,
+};
+static const char op3_str[] =
+  "%rdx";
+static const uint8_t op3_str_idx[] = {
+  0,
+};
+static const struct instr_enc instrtab[] =
+{
+  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_adc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_add, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_and, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movslq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bsf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bswap, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 26, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bt, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_btc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_btr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_bts, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_call, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lcall, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_clc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cli, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_syscall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_clts, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sysret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sysenter, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sysexit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmov, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmps, .rep = 0, .repe = 1, .suffix = 1, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 8, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpxchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cpuid, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtdq2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttpd2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_dec, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_div, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_enter, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 19, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fabs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ftst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fxam, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fld1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldl2t, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldl2e, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldpi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldlg2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldln2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldz, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_f2xm1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fyl2x, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fptan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fpatan, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fxtract, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fprem1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fprem, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fyl2xp1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsqrt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsincos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_frndint, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fscale, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsin, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fadd, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fmul, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsub, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsubr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fst, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fstp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnstenv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnstcw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fxch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_faddp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fiadd, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fmulp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fimul, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsubp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fisub, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fsubrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fisubr, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 1, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fbld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fbstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fchs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_finit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnclex, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmove, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovnb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovnbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovnu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcom, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcomp, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcompp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fucomi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fucomip, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcos, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdecstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdiv, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fidivl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fidiv, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 2, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivr, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fidivrl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fidivr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fdivrp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 4, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 11, .str2 = 0, .off2_1 = 8, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ffree, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovbe, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ficom, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fcmovu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ficomp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fild, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fildl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fildll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fincstp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fninit, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fist, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fistp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fistpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fisttp, .rep = 0, .repe = 0, .suffix = 5, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fisttpll, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fstpt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fld, .rep = 0, .repe = 0, .suffix = 7, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fucom, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_frstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fucomp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 13, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fnstsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_hlt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_idiv, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_imul, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 14, .str1 = 0, .off1_1 = 13, .off1_2 = 2, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_in, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_inc, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ins, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 11, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_int, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_int3, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_invd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_swapgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_invlpg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_iret, .rep = 0, .repe = 0, .suffix = 6, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_j, .rep = 0, .repe = 0, .suffix = 4, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 29, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_jmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 30, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 4, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ljmp, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 22, .str1 = 6, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lar, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lea, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_leave, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lfs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lgs, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lgdt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lidt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lmsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lock, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lods, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_loop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_loope, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_loopne, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 8, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lsl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ltr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 17, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 18, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 3, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 35, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 37, .off1_2 = 3, .off1_3 = 0, .fct2 = 3, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 6, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 6, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 7, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 7, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mov, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 22, .str2 = 0, .off2_1 = 5, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movsbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movswl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movzbl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movzwl, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mul, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_neg, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pause, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_popcnt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_not, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_or, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 12, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_out, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_outs, .rep = 1, .repe = 0, .suffix = 1, .modrm = 0, .fct1 = 10, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 9, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 3, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_popf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 10, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pushq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 28, .str1 = 0, .off1_1 = 2, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 14, .str1 = 0, .off1_1 = 5, .off1_2 = 2, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_push, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 32, .str1 = 0, .off1_1 = 7, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pushf, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rdmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rdpmc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rdtsc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ret, .rep = 0, .repe = 0, .suffix = 3, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lret, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 16, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rol, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ror, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rsm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sahf, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sar, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sbb, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_scas, .rep = 0, .repe = 1, .suffix = 0, .modrm = 0, .fct1 = 12, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 3, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_set, .rep = 0, .repe = 0, .suffix = 4, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shl, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+  { .mnemonic = MNE_shld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shr, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+  { .mnemonic = MNE_shrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 2, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 2, .str3 = 0, .off3_1 = 6, .off3_2 = 0, },
+  { .mnemonic = MNE_vmcall, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmlaunch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmresume, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmxoff, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmread, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 28, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 14, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmwrite, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 22, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 21, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sgdt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_monitor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 4, .str3 = 1, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mwait, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 33, .str1 = 3, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 23, .str2 = 1, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sidt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sldt, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_smsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_stc, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_std, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_stos, .rep = 1, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 5, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 10, .str2 = 0, .off2_1 = 3, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_str, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sub, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_test, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ud2a, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_verr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_verw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 21, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_wbinvd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetch, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetchw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 23, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetchnta, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetcht0, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetcht1, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_prefetcht2, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_nop, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_wrmsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xadd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 15, .off1_2 = 11, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 8, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xchg, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 4, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 17, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xlat, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 9, .str1 = 0, .off1_1 = 5, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 27, .str1 = 0, .off1_1 = 7, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 25, .str1 = 0, .off1_1 = 5, .off1_2 = 9, .off1_3 = 0, .fct2 = 20, .str2 = 0, .off2_1 = 5, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 15, .str1 = 0, .off1_1 = 5, .off1_2 = 3, .off1_3 = 0, .fct2 = 5, .str2 = 0, .off2_1 = 11, .off2_2 = 3, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 15, .str1 = 0, .off1_1 = 13, .off1_2 = 3, .off1_3 = 0, .fct2 = 16, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xor, .rep = 0, .repe = 0, .suffix = 1, .modrm = 1, .fct1 = 19, .str1 = 0, .off1_1 = 13, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 3, .off2_2 = 9, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_emms, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pand, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pandn, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaddwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_por, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pxor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpeqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpunordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpneqps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpnltps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpnleps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpordps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpeqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpunordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpneqss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpnltss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpnless, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cmpordss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fxrstor, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_fxsave, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ldmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_stmxcsr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movupd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movups, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movddup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movsldup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_unpcklpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_unpcklps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_unpckhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_unpckhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movshdup, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movlhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movhps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movapd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movaps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtsi2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtsi2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtpi2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtpi2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movntpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movntps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtpd2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtsd2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtss2si, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtps2pi, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ucomisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ucomiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_comisd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_comiss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_getsec, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movmskpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movmskps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sqrtpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sqrtsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rsqrtss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rsqrtps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcpss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_rcpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andnpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_andnps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_orpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_orps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xorpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_xorps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_addps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mulsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mulss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mulpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mulps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtsd2ss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtss2sd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtpd2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtps2pd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvttps2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_cvtdq2ps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_subsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_subss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_subpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_subps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_minsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_minss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_minpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_minps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_divsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_divss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_divpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_divps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maxss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maxpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maxps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpcklbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpcklwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packsswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packuswb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_packssdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpcklqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_punpckhqdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pshufd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_pshuflw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_pshufhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_pshufw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_haddpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_haddps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_hsubpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_hsubps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movnti, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 26, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_pinsrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+  { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_pextrw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 3, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+  { .mnemonic = MNE_shufpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_shufps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 8, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmullw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movdq2q, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movq2dq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 20, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovmskb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 20, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 19, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddusb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddusw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxub, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pavgb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pavgw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movntdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 34, .str1 = 0, .off1_1 = 23, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_movntq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 20, .str1 = 0, .off1_1 = 15, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 11, .off2_2 = 17, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lddqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmuludq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maskmovdqu, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 34, .str1 = 0, .off1_1 = 26, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_maskmovq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 20, .str1 = 0, .off1_1 = 18, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psubq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_paddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pshufb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phaddsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaddubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phsubsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psignd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulhrsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pabsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 21, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_palignr, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 1, .str2 = 0, .off2_1 = 19, .off2_2 = 25, .off2_3 = 0, .fct3 = 1, .str3 = 0, .off3_1 = 16, .off3_2 = 0, },
+  { .mnemonic = MNE_vmclear, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmxon, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 21, .off1_2 = 25, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmptrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_vmptrst, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psraw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrad, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pslld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrlq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psrldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_psllq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 21, .off1_2 = 0, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 16, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pslldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 18, .str1 = 0, .off1_1 = 29, .off1_2 = 0, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 24, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_lfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_sfence, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 0, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_clflush, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 24, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_INVALID, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 1, .str1 = 0, .off1_1 = 13, .off1_2 = 17, .off1_3 = 0, .fct2 = 13, .str2 = 0, .off2_1 = 13, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_blendps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_blendpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_blendvps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_blendvpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_dpps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_dppd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_insertps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_movntdqa, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_mpsadbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_packusdw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pblendvb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 33, .str1 = 5, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pblendw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpeqq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpestri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpestrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpistri, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpistrm, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pcmpgtq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_phminposuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pinsrb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pinsrd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 15, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmaxuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminsb, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminud, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pminuw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovsxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxbw, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxbd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxbq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxwd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxwq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmovzxdq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmuldq, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_pmulld, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_ptest, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 2, .str1 = 0, .off1_1 = 29, .off1_2 = 33, .off1_3 = 0, .fct2 = 24, .str2 = 0, .off2_1 = 29, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+  { .mnemonic = MNE_roundps, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_roundpd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_roundss, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_roundsd, .rep = 0, .repe = 0, .suffix = 0, .modrm = 1, .fct1 = 18, .str1 = 0, .off1_1 = 37, .off1_2 = 0, .off1_3 = 0, .fct2 = 2, .str2 = 0, .off2_1 = 27, .off2_2 = 33, .off2_3 = 0, .fct3 = 5, .str3 = 0, .off3_1 = 24, .off3_2 = 0, },
+  { .mnemonic = MNE_pop, .rep = 0, .repe = 0, .suffix = 0, .modrm = 0, .fct1 = 31, .str1 = 0, .off1_1 = 0, .off1_2 = 0, .off1_3 = 0, .fct2 = 0, .str2 = 0, .off2_1 = 0, .off2_2 = 0, .off2_3 = 0, .fct3 = 0, .str3 = 0, .off3_1 = 0, .off3_2 = 0, },
+};
+static const uint8_t match_data[] =
+{
+  0x1, 0xfe, 0x14,
+  0x2, 0xfe, 0x80, 0x38, 0x10,
+  0x2, 0xfe, 0x82, 0x38, 0x10,
+  0x2, 0xfe, 0x10, 0, 0,
+  0x2, 0xfe, 0x12, 0, 0,
+  0x1, 0xfe, 0x4,
+  0x2, 0xfe, 0x80, 0x38, 0,
+  0x12, 0x83, 0x38, 0,
+  0x2, 0xfe, 0, 0, 0,
+  0x2, 0xfe, 0x2, 0, 0,
+  0x34, 0x66, 0xf, 0xd0, 0, 0,
+  0x34, 0xf2, 0xf, 0xd0, 0, 0,
+  0x1, 0xfe, 0x24,
+  0x2, 0xfe, 0x80, 0x38, 0x20,
+  0x2, 0xfe, 0x82, 0x38, 0x20,
+  0x2, 0xfe, 0x20, 0, 0,
+  0x2, 0xfe, 0x22, 0, 0,
+  0x34, 0x66, 0xf, 0x54, 0, 0,
+  0x23, 0xf, 0x54, 0, 0,
+  0x34, 0x66, 0xf, 0x55, 0, 0,
+  0x23, 0xf, 0x55, 0, 0,
+  0x12, 0x63, 0, 0,
+  0x23, 0xf, 0xbc, 0, 0,
+  0x23, 0xf, 0xbd, 0, 0,
+  0x12, 0xf, 0xf8, 0xc8,
+  0x23, 0xf, 0xa3, 0, 0,
+  0x23, 0xf, 0xba, 0x38, 0x20,
+  0x23, 0xf, 0xbb, 0, 0,
+  0x23, 0xf, 0xba, 0x38, 0x38,
+  0x23, 0xf, 0xb3, 0, 0,
+  0x23, 0xf, 0xba, 0x38, 0x30,
+  0x23, 0xf, 0xab, 0, 0,
+  0x23, 0xf, 0xba, 0x38, 0x28,
+  0x11, 0xe8,
+  0x12, 0xff, 0x38, 0x10,
+  0x12, 0xff, 0x38, 0x18,
+  0x11, 0x98,
+  0x11, 0x99,
+  0x11, 0xf8,
+  0x11, 0xfc,
+  0x11, 0xfa,
+  0x22, 0xf, 0x5,
+  0x22, 0xf, 0x6,
+  0x22, 0xf, 0x7,
+  0x22, 0xf, 0x34,
+  0x22, 0xf, 0x35,
+  0x11, 0xf5,
+  0x13, 0xf, 0xf0, 0x40, 0, 0,
+  0x1, 0xfe, 0x3c,
+  0x2, 0xfe, 0x80, 0x38, 0x38,
+  0x12, 0x83, 0x38, 0x38,
+  0x2, 0xfe, 0x38, 0, 0,
+  0x2, 0xfe, 0x3a, 0, 0,
+  0x34, 0xf2, 0xf, 0xc2, 0, 0,
+  0x34, 0xf3, 0xf, 0xc2, 0, 0,
+  0x34, 0x66, 0xf, 0xc2, 0, 0,
+  0x23, 0xf, 0xc2, 0, 0,
+  0x1, 0xfe, 0xa6,
+  0x13, 0xf, 0xfe, 0xb0, 0, 0,
+  0x23, 0xf, 0xc7, 0x38, 0x8,
+  0x22, 0xf, 0xa2,
+  0x34, 0xf3, 0xf, 0xe6, 0, 0,
+  0x34, 0xf2, 0xf, 0xe6, 0, 0,
+  0x34, 0x66, 0xf, 0xe6, 0, 0,
+  0x2, 0xfe, 0xfe, 0x38, 0x8,
+  0x2, 0xfe, 0xf6, 0x38, 0x30,
+  0x22, 0xf, 0x77,
+  0x11, 0xc8,
+  0x22, 0xd9, 0xd0,
+  0x22, 0xd9, 0xe0,
+  0x22, 0xd9, 0xe1,
+  0x22, 0xd9, 0xe4,
+  0x22, 0xd9, 0xe5,
+  0x22, 0xd9, 0xe8,
+  0x22, 0xd9, 0xe9,
+  0x22, 0xd9, 0xea,
+  0x22, 0xd9, 0xeb,
+  0x22, 0xd9, 0xec,
+  0x22, 0xd9, 0xed,
+  0x22, 0xd9, 0xee,
+  0x22, 0xd9, 0xf0,
+  0x22, 0xd9, 0xf1,
+  0x22, 0xd9, 0xf2,
+  0x22, 0xd9, 0xf3,
+  0x22, 0xd9, 0xf4,
+  0x22, 0xd9, 0xf5,
+  0x22, 0xd9, 0xf6,
+  0x22, 0xd9, 0xf7,
+  0x22, 0xd9, 0xf8,
+  0x22, 0xd9, 0xf9,
+  0x22, 0xd9, 0xfa,
+  0x22, 0xd9, 0xfb,
+  0x22, 0xd9, 0xfc,
+  0x22, 0xd9, 0xfd,
+  0x22, 0xd9, 0xfe,
+  0x22, 0xd9, 0xff,
+  0x12, 0xd8, 0xf8, 0xc0,
+  0x12, 0xdc, 0xf8, 0xc0,
+  0x2, 0xfb, 0xd8, 0x38, 0,
+  0x12, 0xd8, 0xf8, 0xc8,
+  0x12, 0xdc, 0xf8, 0xc8,
+  0x2, 0xfb, 0xd8, 0x38, 0x8,
+  0x12, 0xd8, 0xf8, 0xe0,
+  0x12, 0xdc, 0xf8, 0xe0,
+  0x2, 0xfb, 0xd8, 0x38, 0x20,
+  0x12, 0xd8, 0xf8, 0xe8,
+  0x12, 0xdc, 0xf8, 0xe8,
+  0x2, 0xfb, 0xd8, 0x38, 0x28,
+  0x12, 0xdd, 0xf8, 0xd0,
+  0x2, 0xfb, 0xd9, 0x38, 0x10,
+  0x12, 0xdd, 0xf8, 0xd8,
+  0x2, 0xfb, 0xd9, 0x38, 0x18,
+  0x12, 0xd9, 0x38, 0x20,
+  0x12, 0xd9, 0x38, 0x28,
+  0x12, 0xd9, 0x38, 0x30,
+  0x12, 0xd9, 0x38, 0x38,
+  0x12, 0xd9, 0xf8, 0xc8,
+  0x12, 0xde, 0xf8, 0xc0,
+  0x12, 0xda, 0xf8, 0xc0,
+  0x2, 0xfb, 0xda, 0x38, 0,
+  0x12, 0xda, 0xf8, 0xc8,
+  0x12, 0xde, 0xf8, 0xc8,
+  0x2, 0xfb, 0xda, 0x38, 0x8,
+  0x12, 0xde, 0xf8, 0xe0,
+  0x2, 0xfb, 0xda, 0x38, 0x20,
+  0x12, 0xde, 0xf8, 0xe8,
+  0x2, 0xfb, 0xda, 0x38, 0x28,
+  0x22, 0xdf, 0xe0,
+  0x12, 0xdf, 0x38, 0x20,
+  0x12, 0xdf, 0xf8, 0xf0,
+  0x12, 0xdf, 0x38, 0x30,
+  0x22, 0xd9, 0xe0,
+  0x33, 0x9b, 0xdb, 0xe2,
+  0x33, 0x9b, 0xdb, 0xe3,
+  0x11, 0x9b,
+  0x22, 0xdb, 0xe2,
+  0x12, 0xda, 0xf8, 0xc0,
+  0x12, 0xda, 0xf8, 0xc8,
+  0x12, 0xda, 0xf8, 0xd0,
+  0x12, 0xda, 0xf8, 0xd8,
+  0x12, 0xdb, 0xf8, 0xc0,
+  0x12, 0xdb, 0xf8, 0xc8,
+  0x12, 0xdb, 0xf8, 0xd0,
+  0x12, 0xdb, 0xf8, 0xd8,
+  0x12, 0xd8, 0xf8, 0xd0,
+  0x2, 0xfb, 0xd8, 0x38, 0x10,
+  0x12, 0xd8, 0xf8, 0xd8,
+  0x2, 0xfb, 0xd8, 0x38, 0x18,
+  0x22, 0xde, 0xd9,
+  0x12, 0xdb, 0xf8, 0xf0,
+  0x12, 0xdf, 0xf8, 0xf0,
+  0x12, 0xdb, 0xf8, 0xe8,
+  0x12, 0xdf, 0xf8, 0xe8,
+  0x22, 0xd9, 0xff,
+  0x22, 0xd9, 0xf6,
+  0x12, 0xd8, 0xf8, 0xf0,
+  0x12, 0xdc, 0xf8, 0xf0,
+  0x2, 0xfb, 0xd8, 0x38, 0x30,
+  0x12, 0xda, 0x38, 0x30,
+  0x12, 0xde, 0xf8, 0xf0,
+  0x12, 0xde, 0x38, 0x30,
+  0x12, 0xde, 0xf8, 0xf8,
+  0x12, 0xd8, 0xf8, 0xf8,
+  0x12, 0xdc, 0xf8, 0xf8,
+  0x2, 0xfb, 0xd8, 0x38, 0x38,
+  0x12, 0xda, 0x38, 0x38,
+  0x12, 0xde, 0x38, 0x38,
+  0x12, 0xde, 0xf8, 0xf0,
+  0x12, 0xdd, 0xf8, 0xc0,
+  0x12, 0xda, 0xf8, 0xd0,
+  0x2, 0xfb, 0xda, 0x38, 0x10,
+  0x12, 0xda, 0xf8, 0xd8,
+  0x2, 0xfb, 0xda, 0x38, 0x18,
+  0x12, 0xdf, 0x38, 0,
+  0x12, 0xdb, 0x38, 0,
+  0x12, 0xdf, 0x38, 0x28,
+  0x22, 0xd9, 0xf7,
+  0x22, 0xdb, 0xe3,
+  0x2, 0xfb, 0xdb, 0x38, 0x10,
+  0x2, 0xfb, 0xdb, 0x38, 0x18,
+  0x12, 0xdf, 0x38, 0x38,
+  0x2, 0xfb, 0xdb, 0x38, 0x8,
+  0x12, 0xdd, 0x38, 0x8,
+  0x12, 0xdb, 0x38, 0x28,
+  0x12, 0xdb, 0x38, 0x38,
+  0x12, 0xd9, 0xf8, 0xc0,
+  0x2, 0xfb, 0xd9, 0x38, 0,
+  0x12, 0xdd, 0xf8, 0xe0,
+  0x12, 0xdd, 0x38, 0x20,
+  0x12, 0xdd, 0xf8, 0xe8,
+  0x12, 0xdd, 0x38, 0x30,
+  0x12, 0xdd, 0x38, 0x38,
+  0x11, 0xf4,
+  0x2, 0xfe, 0xf6, 0x38, 0x38,
+  0x2, 0xfe, 0xf6, 0x38, 0x28,
+  0x23, 0xf, 0xaf, 0, 0,
+  0x2, 0xfd, 0x69, 0, 0,
+  0x1, 0xfe, 0xe4,
+  0x1, 0xfe, 0xec,
+  0x2, 0xfe, 0xfe, 0x38, 0,
+  0x1, 0xfe, 0x6c,
+  0x11, 0xcd,
+  0x11, 0xcc,
+  0x22, 0xf, 0x8,
+  0x33, 0xf, 0x1, 0xf8,
+  0x23, 0xf, 0x1, 0x38, 0x38,
+  0x11, 0xcf,
+  0x1, 0xf0, 0x70,
+  0x12, 0xf, 0xf0, 0x80,
+  0x13, 0xf, 0xf0, 0x90, 0x38, 0,
+  0x11, 0xe3,
+  0x11, 0xeb,
+  0x11, 0xe9,
+  0x12, 0xff, 0x38, 0x20,
+  0x11, 0xea,
+  0x12, 0xff, 0x38, 0x28,
+  0x11, 0x9f,
+  0x23, 0xf, 0x2, 0, 0,
+  0x12, 0x8d, 0, 0,
+  0x11, 0xc9,
+  0x23, 0xf, 0xb4, 0, 0,
+  0x23, 0xf, 0xb5, 0, 0,
+  0x23, 0xf, 0x1, 0x38, 0x10,
+  0x23, 0xf, 0x1, 0x38, 0x18,
+  0x23, 0xf, 0, 0x38, 0x10,
+  0x23, 0xf, 0x1, 0x38, 0x30,
+  0x11, 0xf0,
+  0x1, 0xfe, 0xac,
+  0x11, 0xe2,
+  0x11, 0xe1,
+  0x11, 0xe0,
+  0x23, 0xf, 0x3, 0, 0,
+  0x23, 0xf, 0xb2, 0, 0,
+  0x23, 0xf, 0, 0x38, 0x18,
+  0x2, 0xfe, 0x88, 0, 0,
+  0x2, 0xfe, 0x8a, 0, 0,
+  0x2, 0xfe, 0xc6, 0x38, 0,
+  0x1, 0xf0, 0xb0,
+  0x1, 0xfe, 0xa0,
+  0x1, 0xfe, 0xa2,
+  0x23, 0xf, 0x20, 0xc0, 0xc0,
+  0x23, 0xf, 0x22, 0xc0, 0xc0,
+  0x23, 0xf, 0x21, 0xc0, 0xc0,
+  0x23, 0xf, 0x23, 0xc0, 0xc0,
+  0x12, 0x8c, 0, 0,
+  0x12, 0x8e, 0, 0,
+  0x1, 0xfe, 0xa4,
+  0x23, 0xf, 0xbe, 0, 0,
+  0x23, 0xf, 0xbf, 0, 0,
+  0x23, 0xf, 0xb6, 0, 0,
+  0x23, 0xf, 0xb7, 0, 0,
+  0x2, 0xfe, 0xf6, 0x38, 0x20,
+  0x2, 0xfe, 0xf6, 0x38, 0x18,
+  0x22, 0xf3, 0x90,
+  0x11, 0x90,
+  0x34, 0xf3, 0xf, 0xb8, 0, 0,
+  0x2, 0xfe, 0xf6, 0x38, 0x10,
+  0x2, 0xfe, 0x8, 0, 0,
+  0x2, 0xfe, 0xa, 0, 0,
+  0x2, 0xfe, 0x80, 0x38, 0x8,
+  0x2, 0xfe, 0x82, 0x38, 0x8,
+  0x1, 0xfe, 0xc,
+  0x1, 0xfe, 0xe6,
+  0x1, 0xfe, 0xee,
+  0x1, 0xfe, 0x6e,
+  0x12, 0x8f, 0xf8, 0xc0,
+  0x12, 0x8f, 0x38, 0,
+  0x12, 0xf, 0xc7, 0x81,
+  0x11, 0x9d,
+  0x12, 0xff, 0xf8, 0xf0,
+  0x12, 0xff, 0x38, 0x30,
+  0x1, 0xf8, 0x50,
+  0x1, 0xf8, 0x58,
+  0x1, 0xfd, 0x68,
+  0x1, 0xe7, 0x6,
+  0x12, 0xf, 0xc7, 0x80,
+  0x11, 0x9c,
+  0x2, 0xfe, 0xd0, 0x38, 0x10,
+  0x2, 0xfe, 0xd2, 0x38, 0x10,
+  0x2, 0xfe, 0xc0, 0x38, 0x10,
+  0x2, 0xfe, 0xd0, 0x38, 0x18,
+  0x2, 0xfe, 0xd2, 0x38, 0x18,
+  0x2, 0xfe, 0xc0, 0x38, 0x18,
+  0x22, 0xf, 0x32,
+  0x22, 0xf, 0x33,
+  0x22, 0xf, 0x31,
+  0x11, 0xc3,
+  0x11, 0xc2,
+  0x11, 0xcb,
+  0x11, 0xca,
+  0x2, 0xfe, 0xd0, 0x38, 0,
+  0x2, 0xfe, 0xd2, 0x38, 0,
+  0x2, 0xfe, 0xc0, 0x38, 0,
+  0x2, 0xfe, 0xd0, 0x38, 0x8,
+  0x2, 0xfe, 0xd2, 0x38, 0x8,
+  0x2, 0xfe, 0xc0, 0x38, 0x8,
+  0x22, 0xf, 0xaa,
+  0x11, 0x9e,
+  0x2, 0xfe, 0xd0, 0x38, 0x38,
+  0x2, 0xfe, 0xd2, 0x38, 0x38,
+  0x2, 0xfe, 0xc0, 0x38, 0x38,
+  0x2, 0xfe, 0x18, 0, 0,
+  0x2, 0xfe, 0x1a, 0, 0,
+  0x1, 0xfe, 0x1c,
+  0x2, 0xfe, 0x80, 0x38, 0x18,
+  0x2, 0xfe, 0x82, 0x38, 0x18,
+  0x1, 0xfe, 0xae,
+  0x13, 0xf, 0xf0, 0x90, 0x38, 0,
+  0x2, 0xfe, 0xd0, 0x38, 0x20,
+  0x2, 0xfe, 0xd2, 0x38, 0x20,
+  0x2, 0xfe, 0xc0, 0x38, 0x20,
+  0x2, 0xfe, 0xd0, 0x38, 0x28,
+  0x23, 0xf, 0xa4, 0, 0,
+  0x23, 0xf, 0xa5, 0, 0,
+  0x2, 0xfe, 0xd2, 0x38, 0x28,
+  0x2, 0xfe, 0xc0, 0x38, 0x28,
+  0x23, 0xf, 0xac, 0, 0,
+  0x23, 0xf, 0xad, 0, 0,
+  0x33, 0xf, 0x1, 0xc1,
+  0x33, 0xf, 0x1, 0xc2,
+  0x33, 0xf, 0x1, 0xc3,
+  0x33, 0xf, 0x1, 0xc4,
+  0x23, 0xf, 0x78, 0, 0,
+  0x23, 0xf, 0x79, 0, 0,
+  0x23, 0xf, 0x1, 0x38, 0,
+  0x33, 0xf, 0x1, 0xc8,
+  0x33, 0xf, 0x1, 0xc9,
+  0x23, 0xf, 0x1, 0x38, 0x8,
+  0x23, 0xf, 0, 0x38, 0,
+  0x23, 0xf, 0x1, 0x38, 0x20,
+  0x11, 0xf9,
+  0x11, 0xfd,
+  0x11, 0xfb,
+  0x1, 0xfe, 0xaa,
+  0x23, 0xf, 0, 0x38, 0x8,
+  0x2, 0xfe, 0x28, 0, 0,
+  0x2, 0xfe, 0x2a, 0, 0,
+  0x1, 0xfe, 0x2c,
+  0x2, 0xfe, 0x80, 0x38, 0x28,
+  0x2, 0xfe, 0x82, 0x38, 0x28,
+  0x2, 0xfe, 0x84, 0, 0,
+  0x1, 0xfe, 0xa8,
+  0x2, 0xfe, 0xf6, 0x38, 0,
+  0x22, 0xf, 0xb,
+  0x23, 0xf, 0, 0x38, 0x20,
+  0x23, 0xf, 0, 0x38, 0x28,
+  0x22, 0xf, 0x9,
+  0x23, 0xf, 0xd, 0x38, 0,
+  0x23, 0xf, 0xd, 0x38, 0x8,
+  0x23, 0xf, 0x18, 0x38, 0,
+  0x23, 0xf, 0x18, 0x38, 0x8,
+  0x23, 0xf, 0x18, 0x38, 0x10,
+  0x23, 0xf, 0x18, 0x38, 0x18,
+  0x23, 0xf, 0x1f, 0, 0,
+  0x22, 0xf, 0x30,
+  0x13, 0xf, 0xfe, 0xc0, 0, 0,
+  0x2, 0xfe, 0x86, 0, 0,
+  0x1, 0xf8, 0x90,
+  0x11, 0xd7,
+  0x2, 0xfe, 0x30, 0, 0,
+  0x2, 0xfe, 0x32, 0, 0,
+  0x1, 0xfe, 0x34,
+  0x2, 0xfe, 0x80, 0x38, 0x30,
+  0x2, 0xfe, 0x82, 0x38, 0x30,
+  0x22, 0xf, 0x77,
+  0x34, 0x66, 0xf, 0xdb, 0, 0,
+  0x23, 0xf, 0xdb, 0, 0,
+  0x34, 0x66, 0xf, 0xdf, 0, 0,
+  0x23, 0xf, 0xdf, 0, 0,
+  0x34, 0x66, 0xf, 0xf5, 0, 0,
+  0x23, 0xf, 0xf5, 0, 0,
+  0x34, 0x66, 0xf, 0xeb, 0, 0,
+  0x23, 0xf, 0xeb, 0, 0,
+  0x34, 0x66, 0xf, 0xef, 0, 0,
+  0x23, 0xf, 0xef, 0, 0,
+  0x23, 0xf, 0x55, 0, 0,
+  0x23, 0xf, 0x54, 0, 0,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x1,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x2,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x3,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x4,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x5,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x6,
+  0x24, 0xf, 0xc2, 0, 0, 0xff, 0x7,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x1,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x2,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x3,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x4,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x5,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x6,
+  0x35, 0xf3, 0xf, 0xc2, 0, 0, 0xff, 0x7,
+  0x23, 0xf, 0xae, 0x38, 0x8,
+  0x23, 0xf, 0xae, 0x38, 0,
+  0x23, 0xf, 0xae, 0x38, 0x10,
+  0x23, 0xf, 0xae, 0x38, 0x18,
+  0x34, 0xf2, 0xf, 0x10, 0, 0,
+  0x34, 0xf3, 0xf, 0x10, 0, 0,
+  0x34, 0x66, 0xf, 0x10, 0, 0,
+  0x23, 0xf, 0x10, 0, 0,
+  0x34, 0xf2, 0xf, 0x11, 0, 0,
+  0x34, 0xf3, 0xf, 0x11, 0, 0,
+  0x34, 0x66, 0xf, 0x11, 0, 0,
+  0x23, 0xf, 0x11, 0, 0,
+  0x34, 0xf2, 0xf, 0x12, 0, 0,
+  0x34, 0xf3, 0xf, 0x12, 0, 0,
+  0x34, 0x66, 0xf, 0x12, 0, 0,
+  0x23, 0xf, 0x12, 0xc0, 0xc0,
+  0x23, 0xf, 0x12, 0, 0,
+  0x34, 0x66, 0xf, 0x13, 0xc0, 0xc0,
+  0x23, 0xf, 0x13, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0x13, 0, 0,
+  0x23, 0xf, 0x13, 0, 0,
+  0x34, 0x66, 0xf, 0x14, 0, 0,
+  0x23, 0xf, 0x14, 0, 0,
+  0x34, 0x66, 0xf, 0x15, 0, 0,
+  0x23, 0xf, 0x15, 0, 0,
+  0x34, 0xf3, 0xf, 0x16, 0, 0,
+  0x34, 0x66, 0xf, 0x16, 0, 0,
+  0x23, 0xf, 0x16, 0xc0, 0xc0,
+  0x23, 0xf, 0x16, 0, 0,
+  0x34, 0x66, 0xf, 0x17, 0xc0, 0xc0,
+  0x23, 0xf, 0x17, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0x17, 0, 0,
+  0x23, 0xf, 0x17, 0, 0,
+  0x34, 0x66, 0xf, 0x28, 0, 0,
+  0x23, 0xf, 0x28, 0, 0,
+  0x34, 0x66, 0xf, 0x29, 0, 0,
+  0x23, 0xf, 0x29, 0, 0,
+  0x34, 0xf2, 0xf, 0x2a, 0, 0,
+  0x34, 0xf3, 0xf, 0x2a, 0, 0,
+  0x34, 0x66, 0xf, 0x2a, 0, 0,
+  0x23, 0xf, 0x2a, 0, 0,
+  0x34, 0x66, 0xf, 0x2b, 0, 0,
+  0x23, 0xf, 0x2b, 0, 0,
+  0x34, 0xf2, 0xf, 0x2c, 0, 0,
+  0x34, 0xf3, 0xf, 0x2c, 0, 0,
+  0x34, 0x66, 0xf, 0x2c, 0, 0,
+  0x23, 0xf, 0x2c, 0, 0,
+  0x34, 0x66, 0xf, 0x2d, 0, 0,
+  0x34, 0xf2, 0xf, 0x2d, 0, 0,
+  0x34, 0xf3, 0xf, 0x2d, 0, 0,
+  0x23, 0xf, 0x2d, 0, 0,
+  0x34, 0x66, 0xf, 0x2e, 0, 0,
+  0x23, 0xf, 0x2e, 0, 0,
+  0x34, 0x66, 0xf, 0x2f, 0, 0,
+  0x23, 0xf, 0x2f, 0, 0,
+  0x22, 0xf, 0x37,
+  0x34, 0x66, 0xf, 0x50, 0xc0, 0xc0,
+  0x23, 0xf, 0x50, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0x51, 0, 0,
+  0x34, 0xf2, 0xf, 0x51, 0, 0,
+  0x34, 0xf3, 0xf, 0x51, 0, 0,
+  0x23, 0xf, 0x51, 0, 0,
+  0x34, 0xf3, 0xf, 0x52, 0, 0,
+  0x23, 0xf, 0x52, 0, 0,
+  0x34, 0xf3, 0xf, 0x53, 0, 0,
+  0x23, 0xf, 0x53, 0, 0,
+  0x34, 0x66, 0xf, 0x54, 0, 0,
+  0x23, 0xf, 0x54, 0, 0,
+  0x34, 0x66, 0xf, 0x55, 0, 0,
+  0x23, 0xf, 0x55, 0, 0,
+  0x34, 0x66, 0xf, 0x56, 0, 0,
+  0x23, 0xf, 0x56, 0, 0,
+  0x34, 0x66, 0xf, 0x57, 0, 0,
+  0x23, 0xf, 0x57, 0, 0,
+  0x34, 0xf2, 0xf, 0x58, 0, 0,
+  0x34, 0xf3, 0xf, 0x58, 0, 0,
+  0x34, 0x66, 0xf, 0x58, 0, 0,
+  0x23, 0xf, 0x58, 0, 0,
+  0x34, 0xf2, 0xf, 0x59, 0, 0,
+  0x34, 0xf3, 0xf, 0x59, 0, 0,
+  0x34, 0x66, 0xf, 0x59, 0, 0,
+  0x23, 0xf, 0x59, 0, 0,
+  0x34, 0xf2, 0xf, 0x5a, 0, 0,
+  0x34, 0xf3, 0xf, 0x5a, 0, 0,
+  0x34, 0x66, 0xf, 0x5a, 0, 0,
+  0x23, 0xf, 0x5a, 0, 0,
+  0x34, 0x66, 0xf, 0x5b, 0, 0,
+  0x34, 0xf3, 0xf, 0x5b, 0, 0,
+  0x23, 0xf, 0x5b, 0, 0,
+  0x34, 0xf2, 0xf, 0x5c, 0, 0,
+  0x34, 0xf3, 0xf, 0x5c, 0, 0,
+  0x34, 0x66, 0xf, 0x5c, 0, 0,
+  0x23, 0xf, 0x5c, 0, 0,
+  0x34, 0xf2, 0xf, 0x5d, 0, 0,
+  0x34, 0xf3, 0xf, 0x5d, 0, 0,
+  0x34, 0x66, 0xf, 0x5d, 0, 0,
+  0x23, 0xf, 0x5d, 0, 0,
+  0x34, 0xf2, 0xf, 0x5e, 0, 0,
+  0x34, 0xf3, 0xf, 0x5e, 0, 0,
+  0x34, 0x66, 0xf, 0x5e, 0, 0,
+  0x23, 0xf, 0x5e, 0, 0,
+  0x34, 0xf2, 0xf, 0x5f, 0, 0,
+  0x34, 0xf3, 0xf, 0x5f, 0, 0,
+  0x34, 0x66, 0xf, 0x5f, 0, 0,
+  0x23, 0xf, 0x5f, 0, 0,
+  0x34, 0x66, 0xf, 0x60, 0, 0,
+  0x23, 0xf, 0x60, 0, 0,
+  0x34, 0x66, 0xf, 0x61, 0, 0,
+  0x23, 0xf, 0x61, 0, 0,
+  0x34, 0x66, 0xf, 0x62, 0, 0,
+  0x23, 0xf, 0x62, 0, 0,
+  0x34, 0x66, 0xf, 0x63, 0, 0,
+  0x23, 0xf, 0x63, 0, 0,
+  0x34, 0x66, 0xf, 0x64, 0, 0,
+  0x23, 0xf, 0x64, 0, 0,
+  0x34, 0x66, 0xf, 0x65, 0, 0,
+  0x23, 0xf, 0x65, 0, 0,
+  0x34, 0x66, 0xf, 0x66, 0, 0,
+  0x23, 0xf, 0x66, 0, 0,
+  0x34, 0x66, 0xf, 0x67, 0, 0,
+  0x23, 0xf, 0x67, 0, 0,
+  0x34, 0x66, 0xf, 0x68, 0, 0,
+  0x23, 0xf, 0x68, 0, 0,
+  0x34, 0x66, 0xf, 0x69, 0, 0,
+  0x23, 0xf, 0x69, 0, 0,
+  0x34, 0x66, 0xf, 0x6a, 0, 0,
+  0x23, 0xf, 0x6a, 0, 0,
+  0x34, 0x66, 0xf, 0x6b, 0, 0,
+  0x23, 0xf, 0x6b, 0, 0,
+  0x34, 0x66, 0xf, 0x6c, 0, 0,
+  0x34, 0x66, 0xf, 0x6d, 0, 0,
+  0x34, 0x66, 0xf, 0x6e, 0, 0,
+  0x23, 0xf, 0x6e, 0, 0,
+  0x34, 0x66, 0xf, 0x6f, 0, 0,
+  0x34, 0xf3, 0xf, 0x6f, 0, 0,
+  0x23, 0xf, 0x6f, 0, 0,
+  0x34, 0x66, 0xf, 0x70, 0, 0,
+  0x34, 0xf2, 0xf, 0x70, 0, 0,
+  0x34, 0xf3, 0xf, 0x70, 0, 0,
+  0x23, 0xf, 0x70, 0, 0,
+  0x34, 0x66, 0xf, 0x74, 0, 0,
+  0x23, 0xf, 0x74, 0, 0,
+  0x34, 0x66, 0xf, 0x75, 0, 0,
+  0x23, 0xf, 0x75, 0, 0,
+  0x34, 0x66, 0xf, 0x76, 0, 0,
+  0x23, 0xf, 0x76, 0, 0,
+  0x34, 0x66, 0xf, 0x7c, 0, 0,
+  0x34, 0xf2, 0xf, 0x7c, 0, 0,
+  0x34, 0x66, 0xf, 0x7d, 0, 0,
+  0x34, 0xf2, 0xf, 0x7d, 0, 0,
+  0x34, 0x66, 0xf, 0x7e, 0, 0,
+  0x34, 0xf3, 0xf, 0x7e, 0, 0,
+  0x23, 0xf, 0x7e, 0, 0,
+  0x34, 0x66, 0xf, 0x7f, 0, 0,
+  0x34, 0xf3, 0xf, 0x7f, 0, 0,
+  0x23, 0xf, 0x7f, 0, 0,
+  0x23, 0xf, 0xc3, 0, 0,
+  0x34, 0x66, 0xf, 0xc4, 0, 0,
+  0x23, 0xf, 0xc4, 0, 0,
+  0x34, 0x66, 0xf, 0xc5, 0xc0, 0xc0,
+  0x23, 0xf, 0xc5, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0xc6, 0, 0,
+  0x23, 0xf, 0xc6, 0, 0,
+  0x34, 0x66, 0xf, 0xd1, 0, 0,
+  0x23, 0xf, 0xd1, 0, 0,
+  0x34, 0x66, 0xf, 0xd2, 0, 0,
+  0x23, 0xf, 0xd2, 0, 0,
+  0x34, 0x66, 0xf, 0xd3, 0, 0,
+  0x23, 0xf, 0xd3, 0, 0,
+  0x34, 0x66, 0xf, 0xd4, 0, 0,
+  0x23, 0xf, 0xd4, 0, 0,
+  0x34, 0x66, 0xf, 0xd5, 0, 0,
+  0x23, 0xf, 0xd5, 0, 0,
+  0x34, 0x66, 0xf, 0xd6, 0, 0,
+  0x34, 0xf2, 0xf, 0xd6, 0xc0, 0xc0,
+  0x34, 0xf3, 0xf, 0xd6, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0xd7, 0xc0, 0xc0,
+  0x23, 0xf, 0xd7, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0xd8, 0, 0,
+  0x23, 0xf, 0xd8, 0, 0,
+  0x34, 0x66, 0xf, 0xd9, 0, 0,
+  0x23, 0xf, 0xd9, 0, 0,
+  0x34, 0x66, 0xf, 0xda, 0, 0,
+  0x23, 0xf, 0xda, 0, 0,
+  0x34, 0x66, 0xf, 0xdc, 0, 0,
+  0x23, 0xf, 0xdc, 0, 0,
+  0x34, 0x66, 0xf, 0xdd, 0, 0,
+  0x23, 0xf, 0xdd, 0, 0,
+  0x34, 0x66, 0xf, 0xde, 0, 0,
+  0x23, 0xf, 0xde, 0, 0,
+  0x34, 0x66, 0xf, 0xe0, 0, 0,
+  0x23, 0xf, 0xe0, 0, 0,
+  0x34, 0x66, 0xf, 0xe1, 0, 0,
+  0x23, 0xf, 0xe1, 0, 0,
+  0x34, 0x66, 0xf, 0xe2, 0, 0,
+  0x23, 0xf, 0xe2, 0, 0,
+  0x34, 0x66, 0xf, 0xe3, 0, 0,
+  0x23, 0xf, 0xe3, 0, 0,
+  0x34, 0x66, 0xf, 0xe4, 0, 0,
+  0x23, 0xf, 0xe4, 0, 0,
+  0x34, 0x66, 0xf, 0xe5, 0, 0,
+  0x23, 0xf, 0xe5, 0, 0,
+  0x34, 0x66, 0xf, 0xe7, 0, 0,
+  0x23, 0xf, 0xe7, 0, 0,
+  0x34, 0x66, 0xf, 0xe8, 0, 0,
+  0x23, 0xf, 0xe8, 0, 0,
+  0x34, 0x66, 0xf, 0xe9, 0, 0,
+  0x23, 0xf, 0xe9, 0, 0,
+  0x34, 0x66, 0xf, 0xea, 0, 0,
+  0x23, 0xf, 0xea, 0, 0,
+  0x34, 0x66, 0xf, 0xec, 0, 0,
+  0x23, 0xf, 0xec, 0, 0,
+  0x34, 0x66, 0xf, 0xed, 0, 0,
+  0x23, 0xf, 0xed, 0, 0,
+  0x34, 0x66, 0xf, 0xee, 0, 0,
+  0x23, 0xf, 0xee, 0, 0,
+  0x34, 0xf2, 0xf, 0xf0, 0, 0,
+  0x34, 0x66, 0xf, 0xf1, 0, 0,
+  0x23, 0xf, 0xf1, 0, 0,
+  0x34, 0x66, 0xf, 0xf2, 0, 0,
+  0x23, 0xf, 0xf2, 0, 0,
+  0x34, 0x66, 0xf, 0xf3, 0, 0,
+  0x23, 0xf, 0xf3, 0, 0,
+  0x34, 0x66, 0xf, 0xf4, 0, 0,
+  0x23, 0xf, 0xf4, 0, 0,
+  0x34, 0x66, 0xf, 0xf6, 0, 0,
+  0x23, 0xf, 0xf6, 0, 0,
+  0x34, 0x66, 0xf, 0xf7, 0xc0, 0xc0,
+  0x23, 0xf, 0xf7, 0xc0, 0xc0,
+  0x34, 0x66, 0xf, 0xf8, 0, 0,
+  0x23, 0xf, 0xf8, 0, 0,
+  0x34, 0x66, 0xf, 0xf9, 0, 0,
+  0x23, 0xf, 0xf9, 0, 0,
+  0x34, 0x66, 0xf, 0xfa, 0, 0,
+  0x23, 0xf, 0xfa, 0, 0,
+  0x34, 0x66, 0xf, 0xfb, 0, 0,
+  0x23, 0xf, 0xfb, 0, 0,
+  0x34, 0x66, 0xf, 0xfc, 0, 0,
+  0x23, 0xf, 0xfc, 0, 0,
+  0x34, 0x66, 0xf, 0xfd, 0, 0,
+  0x23, 0xf, 0xfd, 0, 0,
+  0x34, 0x66, 0xf, 0xfe, 0, 0,
+  0x23, 0xf, 0xfe, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0, 0, 0,
+  0x34, 0xf, 0x38, 0, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x1, 0, 0,
+  0x34, 0xf, 0x38, 0x1, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x2, 0, 0,
+  0x34, 0xf, 0x38, 0x2, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3, 0, 0,
+  0x34, 0xf, 0x38, 0x3, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x4, 0, 0,
+  0x34, 0xf, 0x38, 0x4, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x5, 0, 0,
+  0x34, 0xf, 0x38, 0x5, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x6, 0, 0,
+  0x34, 0xf, 0x38, 0x6, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x7, 0, 0,
+  0x34, 0xf, 0x38, 0x7, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x8, 0, 0,
+  0x34, 0xf, 0x38, 0x8, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x9, 0, 0,
+  0x34, 0xf, 0x38, 0x9, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0xa, 0, 0,
+  0x34, 0xf, 0x38, 0xa, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0xb, 0, 0,
+  0x34, 0xf, 0x38, 0xb, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x1c, 0, 0,
+  0x34, 0xf, 0x38, 0x1c, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x1d, 0, 0,
+  0x34, 0xf, 0x38, 0x1d, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x1e, 0, 0,
+  0x34, 0xf, 0x38, 0x1e, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xf, 0, 0,
+  0x34, 0xf, 0x3a, 0xf, 0, 0,
+  0x34, 0x66, 0xf, 0xc7, 0x38, 0x30,
+  0x34, 0xf3, 0xf, 0xc7, 0x38, 0x30,
+  0x23, 0xf, 0xc7, 0x38, 0x30,
+  0x23, 0xf, 0xc7, 0x38, 0x38,
+  0x34, 0x66, 0xf, 0x71, 0xf8, 0xd0,
+  0x23, 0xf, 0x71, 0xf8, 0xd0,
+  0x34, 0x66, 0xf, 0x71, 0xf8, 0xe0,
+  0x23, 0xf, 0x71, 0xf8, 0xe0,
+  0x34, 0x66, 0xf, 0x71, 0xf8, 0xf0,
+  0x23, 0xf, 0x71, 0xf8, 0xf0,
+  0x34, 0x66, 0xf, 0x72, 0xf8, 0xd0,
+  0x23, 0xf, 0x72, 0xf8, 0xd0,
+  0x34, 0x66, 0xf, 0x72, 0xf8, 0xe0,
+  0x23, 0xf, 0x72, 0xf8, 0xe0,
+  0x34, 0x66, 0xf, 0x72, 0xf8, 0xf0,
+  0x23, 0xf, 0x72, 0xf8, 0xf0,
+  0x34, 0x66, 0xf, 0x73, 0xf8, 0xd0,
+  0x23, 0xf, 0x73, 0xf8, 0xd0,
+  0x34, 0x66, 0xf, 0x73, 0xf8, 0xd8,
+  0x34, 0x66, 0xf, 0x73, 0xf8, 0xf0,
+  0x23, 0xf, 0x73, 0xf8, 0xf0,
+  0x34, 0x66, 0xf, 0x73, 0xf8, 0xf8,
+  0x33, 0xf, 0xae, 0xe8,
+  0x33, 0xf, 0xae, 0xf0,
+  0x33, 0xf, 0xae, 0xf8,
+  0x23, 0xf, 0xae, 0x38, 0x38,
+  0x23, 0xf, 0xf, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xc, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xd, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x14, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x15, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x40, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x41, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x21, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x2a, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x42, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x2b, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x10, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xe, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x29, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x61, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x60, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x63, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x62, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x37, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x41, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x20, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x22, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3c, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3d, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3f, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3e, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x38, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x39, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3b, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x3a, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x20, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x21, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x22, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x23, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x24, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x25, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x30, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x31, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x32, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x33, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x34, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x35, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x28, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x40, 0, 0,
+  0x45, 0x66, 0xf, 0x38, 0x17, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x8, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0x9, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xa, 0, 0,
+  0x45, 0x66, 0xf, 0x3a, 0xb, 0, 0,
+  0x1, 0xe7, 0x7,
+};
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
new file mode 100644
index 0000000..3754c1c
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch
@@ -0,0 +1,35 @@
+From 668accf322fd7185e273bfd50b84320e71d9de5a Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 10 Apr 2015 00:29:18 +0200
+Subject: [PATCH] elf_getarsym: Silence -Werror=maybe-uninitialized false
+ positive
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ libelf/elf_getarsym.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/libelf/elf_getarsym.c b/libelf/elf_getarsym.c
+index d0bb28a..08954d2 100644
+--- a/libelf/elf_getarsym.c
++++ b/libelf/elf_getarsym.c
+@@ -165,8 +165,13 @@ elf_getarsym (elf, ptr)
+       int w = index64_p ? 8 : 4;
+ 
+       /* We have an archive.  The first word in there is the number of
+-	 entries in the table.  */
+-      uint64_t n;
++	 entries in the table.
++	 Set to SIZE_MAX just to silence -Werror=maybe-uninitialized
++	 elf_getarsym.c:290:9: error: 'n' may be used uninitialized in this function
++	 The read_number_entries function doesn't initialize n only when returning
++	 -1 which in turn ensures to jump over usage of this uninitialized variable.
++	 */
++      uint64_t n = SIZE_MAX;
+       size_t off = elf->start_offset + SARMAG + sizeof (struct ar_hdr);
+       if (read_number_entries (&n, elf, &off, index64_p) < 0)
+ 	{
+-- 
+2.3.5
+
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/0001-fix-a-stack-usage-warning.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/0001-fix-a-stack-usage-warning.patch
new file mode 100644
index 0000000..6923bf7
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/0001-fix-a-stack-usage-warning.patch
@@ -0,0 +1,28 @@
+[PATCH] fix a stack-usage warning
+
+Upstream-Status: Pending
+
+not use a variable to as a array size, otherwise the warning to error that
+stack usage might be unbounded [-Werror=stack-usage=] will happen
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ backends/ppc_initreg.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/backends/ppc_initreg.c b/backends/ppc_initreg.c
+index 64f5379..52dde3e 100644
+--- a/backends/ppc_initreg.c
++++ b/backends/ppc_initreg.c
+@@ -93,7 +93,7 @@ ppc_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
+ 	return false;
+     }
+   const size_t gprs = sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr);
+-  Dwarf_Word dwarf_regs[gprs];
++  Dwarf_Word dwarf_regs[sizeof (user_regs.r.gpr) / sizeof (*user_regs.r.gpr)];
+   for (unsigned gpr = 0; gpr < gprs; gpr++)
+     dwarf_regs[gpr] = user_regs.r.gpr[gpr];
+   if (! setfunc (0, gprs, dwarf_regs, arg))
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/0001-remove-the-unneed-checking.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/0001-remove-the-unneed-checking.patch
new file mode 100644
index 0000000..5be92d7
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/0001-remove-the-unneed-checking.patch
@@ -0,0 +1,38 @@
+Disable the test to convert euc-jp
+
+Remove the test "Test against HP-UX 11.11 bug:
+No converter from EUC-JP to UTF-8 is provided"
+since we don't support HP-UX and if the euc-jp is not
+installed on the host, the dependence will be built without
+iconv support and will cause guild-native building fail.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ m4/iconv.m4 | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/m4/iconv.m4 b/m4/iconv.m4
+index a503646..299f1eb 100644
+--- a/m4/iconv.m4
++++ b/m4/iconv.m4
+@@ -159,6 +159,7 @@ int main ()
+       }
+   }
+ #endif
++#if 0
+   /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+      provided.  */
+   if (/* Try standardized names.  */
+@@ -170,6 +171,7 @@ int main ()
+       /* Try HP-UX names.  */
+       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+     result |= 16;
++#endif
+   return result;
+ }]])],
+         [am_cv_func_iconv_works=yes],
+-- 
+2.0.1
+
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/arm_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_backend.diff
new file mode 100644
index 0000000..c97c4e4
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_backend.diff
@@ -0,0 +1,625 @@
+From 0db1687eee0b4d16ccbc40db5a06b574fca6614c Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Fri, 14 Nov 2014 15:25:42 +0800
+Subject: [PATCH] Rebase arm_backend.diff from 0.159 to 0.160
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ backends/arm_init.c                 |  18 ++++-
+ backends/arm_regs.c                 | 132 ++++++++++++++++++++++++++++++++++++
+ backends/arm_retval.c               |  44 +++++++++++-
+ backends/libebl_arm.h               |   9 +++
+ libelf/elf.h                        |  11 +++
+ tests/run-addrcfi.sh                |  93 ++++++++++++++++++++++++-
+ tests/run-allregs.sh                |  95 +++++++++++++++++++++++++-
+ tests/run-readelf-mixed-corenote.sh |  11 ++-
+ 8 files changed, 401 insertions(+), 12 deletions(-)
+ create mode 100644 backends/libebl_arm.h
+
+diff --git a/backends/arm_init.c b/backends/arm_init.c
+index 3283c97..8b57d3f 100644
+--- a/backends/arm_init.c
++++ b/backends/arm_init.c
+@@ -35,21 +35,32 @@
+ #define RELOC_PREFIX	R_ARM_
+ #include "libebl_CPU.h"
+ 
++#include "libebl_arm.h"
++
+ /* This defines the common reloc hooks based on arm_reloc.def.  */
+ #include "common-reloc.c"
+ 
+ 
+ const char *
+ arm_init (elf, machine, eh, ehlen)
+-     Elf *elf __attribute__ ((unused));
++     Elf *elf;
+      GElf_Half machine __attribute__ ((unused));
+      Ebl *eh;
+      size_t ehlen;
+ {
++  int soft_float = 0;
++
+   /* Check whether the Elf_BH object has a sufficent size.  */
+   if (ehlen < sizeof (Ebl))
+     return NULL;
+ 
++  if (elf) {
++    GElf_Ehdr ehdr_mem;
++    GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++    if (ehdr && (ehdr->e_flags & EF_ARM_SOFT_FLOAT))
++      soft_float = 1;
++  }
++
+   /* We handle it.  */
+   eh->name = "ARM";
+   arm_init_reloc (eh);
+@@ -61,7 +72,10 @@ arm_init (elf, machine, eh, ehlen)
+   HOOK (eh, core_note);
+   HOOK (eh, auxv_info);
+   HOOK (eh, check_object_attribute);
+-  HOOK (eh, return_value_location);
++  if (soft_float)
++    eh->return_value_location = arm_return_value_location_soft;
++  else
++    eh->return_value_location = arm_return_value_location_hard;
+   HOOK (eh, abi_cfi);
+   HOOK (eh, check_reloc_target_type);
+ 
+diff --git a/backends/arm_regs.c b/backends/arm_regs.c
+index 21c5ad3..4ee1039 100644
+--- a/backends/arm_regs.c
++++ b/backends/arm_regs.c
+@@ -31,6 +31,7 @@
+ #endif
+ 
+ #include <string.h>
++#include <stdio.h>
+ #include <dwarf.h>
+ 
+ #define BACKEND arm_
+@@ -76,6 +77,9 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)),
+       break;
+ 
+     case 16 + 0 ... 16 + 7:
++      /* AADWARF says that there are no registers in that range,
++       * but gcc maps FPA registers here
++       */
+       regno += 96 - 16;
+       /* Fall through.  */
+     case 96 + 0 ... 96 + 7:
+@@ -87,11 +91,139 @@ arm_register_info (Ebl *ebl __attribute__ ((unused)),
+       namelen = 2;
+       break;
+ 
++    case 64 + 0 ... 64 + 9:
++      *setname = "VFP";
++      *bits = 32;
++      *type = DW_ATE_float;
++      name[0] = 's';
++      name[1] = regno - 64 + '0';
++      namelen = 2;
++      break;
++
++    case 64 + 10 ... 64 + 31:
++      *setname = "VFP";
++      *bits = 32;
++      *type = DW_ATE_float;
++      name[0] = 's';
++      name[1] = (regno - 64) / 10 + '0';
++      name[2] = (regno - 64) % 10 + '0';
++      namelen = 3;
++      break;
++
++    case 104 + 0 ... 104 + 7:
++      /* XXX TODO:
++       * This can be either intel wireless MMX general purpose/control
++       * registers or xscale accumulator, which have different usage.
++       * We only have the intel wireless MMX here now.
++       * The name needs to be changed for the xscale accumulator too. */
++      *setname = "MMX";
++      *type = DW_ATE_unsigned;
++      *bits = 32;
++      memcpy(name, "wcgr", 4);
++      name[4] = regno - 104 + '0';
++      namelen = 5;
++      break;
++
++    case 112 + 0 ... 112 + 9:
++      *setname = "MMX";
++      *type = DW_ATE_unsigned;
++      *bits = 64;
++      name[0] = 'w';
++      name[1] = 'r';
++      name[2] = regno - 112 + '0';
++      namelen = 3;
++      break;
++
++    case 112 + 10 ... 112 + 15:
++      *setname = "MMX";
++      *type = DW_ATE_unsigned;
++      *bits = 64;
++      name[0] = 'w';
++      name[1] = 'r';
++      name[2] = '1';
++      name[3] = regno - 112 - 10 + '0';
++      namelen = 4;
++      break;
++
+     case 128:
++      *setname = "state";
+       *type = DW_ATE_unsigned;
+       return stpcpy (name, "spsr") + 1 - name;
+ 
++    case 129:
++      *setname = "state";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_fiq") + 1 - name;
++
++    case 130:
++      *setname = "state";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_irq") + 1 - name;
++
++    case 131:
++      *setname = "state";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_abt") + 1 - name;
++
++    case 132:
++      *setname = "state";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_und") + 1 - name;
++
++    case 133:
++      *setname = "state";
++      *type = DW_ATE_unsigned;
++      return stpcpy(name, "spsr_svc") + 1 - name;
++
++    case 144 ... 150:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_usr", regno - 144 + 8) + 1;
++
++    case 151 ... 157:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_fiq", regno - 151 + 8) + 1;
++
++    case 158 ... 159:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_irq", regno - 158 + 13) + 1;
++
++    case 160 ... 161:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_abt", regno - 160 + 13) + 1;
++
++    case 162 ... 163:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_und", regno - 162 + 13) + 1;
++
++    case 164 ... 165:
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      return sprintf(name, "r%d_svc", regno - 164 + 13) + 1;
++
++    case 192 ... 199:
++     *setname = "MMX";
++      *bits = 32;
++      *type = DW_ATE_unsigned;
++      name[0] = 'w';
++      name[1] = 'c';
++      name[2] = regno - 192 + '0';
++      namelen = 3;
++      break;
++
+     case 256 + 0 ... 256 + 9:
++      /* XXX TODO: Neon also uses those registers and can contain
++       * both float and integers */
+       *setname = "VFP";
+       *type = DW_ATE_float;
+       *bits = 64;
+diff --git a/backends/arm_retval.c b/backends/arm_retval.c
+index 7aced74..052132e 100644
+--- a/backends/arm_retval.c
++++ b/backends/arm_retval.c
+@@ -48,6 +48,13 @@ static const Dwarf_Op loc_intreg[] =
+ #define nloc_intreg	1
+ #define nloc_intregs(n)	(2 * (n))
+ 
++/* f1  */ /* XXX TODO: f0 can also have number 96 if program was compiled with -mabi=aapcs */
++static const Dwarf_Op loc_fpreg[] =
++  {
++    { .atom = DW_OP_reg16 },
++  };
++#define nloc_fpreg  1
++
+ /* The return value is a structure and is actually stored in stack space
+    passed in a hidden argument by the caller.  But, the compiler
+    helpfully returns the address of that space in r0.  */
+@@ -58,8 +65,9 @@ static const Dwarf_Op loc_aggregate[] =
+ #define nloc_aggregate 1
+ 
+ 
+-int
+-arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++static int
++arm_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp,
++		            int soft_float)
+ {
+   /* Start with the function's type, and get the DW_AT_type attribute,
+      which is the type of the return value.  */
+@@ -98,14 +106,31 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+ 	    else
+ 	      return -1;
+ 	  }
++	if (tag == DW_TAG_base_type)
++	{
++	  Dwarf_Word encoding;
++	  if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++	                       &attr_mem), &encoding) != 0)
++	    return -1;
++
++	  if ((encoding == DW_ATE_float) && !soft_float)
++	    {
++	      *locp = loc_fpreg;
++	      if (size <= 8)
++		return nloc_fpreg;
++	      goto aggregate;
++	    }
++	}
+ 	if (size <= 16)
+ 	  {
+ 	  intreg:
+ 	    *locp = loc_intreg;
+ 	    return size <= 4 ? nloc_intreg : nloc_intregs ((size + 3) / 4);
+ 	  }
++	  /* fall through. */
+ 
+       aggregate:
++	/* XXX TODO sometimes aggregates are returned in r0 (-mabi=aapcs) */
+ 	*locp = loc_aggregate;
+ 	return nloc_aggregate;
+       }
+@@ -125,3 +150,18 @@ arm_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
+      DWARF and might be valid.  */
+   return -2;
+ }
++
++/* return location for -mabi=apcs-gnu -msoft-float */
++int
++arm_return_value_location_soft (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++   return arm_return_value_location_ (functypedie, locp, 1);
++}
++
++/* return location for -mabi=apcs-gnu -mhard-float (current default) */
++int
++arm_return_value_location_hard (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++   return arm_return_value_location_ (functypedie, locp, 0);
++}
++
+diff --git a/backends/libebl_arm.h b/backends/libebl_arm.h
+new file mode 100644
+index 0000000..c00770c
+--- /dev/null
++++ b/backends/libebl_arm.h
+@@ -0,0 +1,9 @@
++#ifndef _LIBEBL_ARM_H
++#define _LIBEBL_ARM_H 1
++
++#include <libdw.h>
++
++extern int arm_return_value_location_soft(Dwarf_Die *, const Dwarf_Op **locp);
++extern int arm_return_value_location_hard(Dwarf_Die *, const Dwarf_Op **locp);
++
++#endif
+diff --git a/libelf/elf.h b/libelf/elf.h
+index a3cce3e..0891674 100644
+--- a/libelf/elf.h
++++ b/libelf/elf.h
+@@ -2346,6 +2346,9 @@ typedef Elf32_Addr Elf32_Conflict;
+ #define EF_ARM_EABI_VER4	0x04000000
+ #define EF_ARM_EABI_VER5	0x05000000
+ 
++/* EI_OSABI values */
++#define ELFOSABI_ARM_AEABI    64      /* Contains symbol versioning. */
++
+ /* Additional symbol types for Thumb.  */
+ #define STT_ARM_TFUNC		STT_LOPROC /* A Thumb function.  */
+ #define STT_ARM_16BIT		STT_HIPROC /* A Thumb label.  */
+@@ -2363,12 +2366,19 @@ typedef Elf32_Addr Elf32_Conflict;
+ 
+ /* Processor specific values for the Phdr p_type field.  */
+ #define PT_ARM_EXIDX		(PT_LOPROC + 1)	/* ARM unwind segment.  */
++#define PT_ARM_UNWIND		PT_ARM_EXIDX
+ 
+ /* Processor specific values for the Shdr sh_type field.  */
+ #define SHT_ARM_EXIDX		(SHT_LOPROC + 1) /* ARM unwind section.  */
+ #define SHT_ARM_PREEMPTMAP	(SHT_LOPROC + 2) /* Preemption details.  */
+ #define SHT_ARM_ATTRIBUTES	(SHT_LOPROC + 3) /* ARM attributes section.  */
+ 
++/* Processor specific values for the Dyn d_tag field.  */
++#define DT_ARM_RESERVED1	(DT_LOPROC + 0)
++#define DT_ARM_SYMTABSZ		(DT_LOPROC + 1)
++#define DT_ARM_PREEMTMAB	(DT_LOPROC + 2)
++#define DT_ARM_RESERVED2	(DT_LOPROC + 3)
++#define DT_ARM_NUM		4
+ 
+ /* AArch64 relocs.  */
+ 
+@@ -2647,6 +2657,7 @@ typedef Elf32_Addr Elf32_Conflict;
+ 					   TLS block (LDR, STR).  */
+ #define R_ARM_TLS_IE12GP	111	/* 12 bit GOT entry relative
+ 					   to GOT origin (LDR).  */
++/* 112 - 127 private range */
+ #define R_ARM_ME_TOO		128	/* Obsolete.  */
+ #define R_ARM_THM_TLS_DESCSEQ	129
+ #define R_ARM_THM_TLS_DESCSEQ16	129
+diff --git a/tests/run-addrcfi.sh b/tests/run-addrcfi.sh
+index 5d33246..78464a8 100755
+--- a/tests/run-addrcfi.sh
++++ b/tests/run-addrcfi.sh
+@@ -2530,6 +2530,38 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range
+ 	FPA reg21 (f5): undefined
+ 	FPA reg22 (f6): undefined
+ 	FPA reg23 (f7): undefined
++	VFP reg64 (s0): undefined
++	VFP reg65 (s1): undefined
++	VFP reg66 (s2): undefined
++	VFP reg67 (s3): undefined
++	VFP reg68 (s4): undefined
++	VFP reg69 (s5): undefined
++	VFP reg70 (s6): undefined
++	VFP reg71 (s7): undefined
++	VFP reg72 (s8): undefined
++	VFP reg73 (s9): undefined
++	VFP reg74 (s10): undefined
++	VFP reg75 (s11): undefined
++	VFP reg76 (s12): undefined
++	VFP reg77 (s13): undefined
++	VFP reg78 (s14): undefined
++	VFP reg79 (s15): undefined
++	VFP reg80 (s16): undefined
++	VFP reg81 (s17): undefined
++	VFP reg82 (s18): undefined
++	VFP reg83 (s19): undefined
++	VFP reg84 (s20): undefined
++	VFP reg85 (s21): undefined
++	VFP reg86 (s22): undefined
++	VFP reg87 (s23): undefined
++	VFP reg88 (s24): undefined
++	VFP reg89 (s25): undefined
++	VFP reg90 (s26): undefined
++	VFP reg91 (s27): undefined
++	VFP reg92 (s28): undefined
++	VFP reg93 (s29): undefined
++	VFP reg94 (s30): undefined
++	VFP reg95 (s31): undefined
+ 	FPA reg96 (f0): undefined
+ 	FPA reg97 (f1): undefined
+ 	FPA reg98 (f2): undefined
+@@ -2538,7 +2570,66 @@ dwarf_cfi_addrframe (.eh_frame): no matching address range
+ 	FPA reg101 (f5): undefined
+ 	FPA reg102 (f6): undefined
+ 	FPA reg103 (f7): undefined
+-	integer reg128 (spsr): undefined
++	MMX reg104 (wcgr0): undefined
++	MMX reg105 (wcgr1): undefined
++	MMX reg106 (wcgr2): undefined
++	MMX reg107 (wcgr3): undefined
++	MMX reg108 (wcgr4): undefined
++	MMX reg109 (wcgr5): undefined
++	MMX reg110 (wcgr6): undefined
++	MMX reg111 (wcgr7): undefined
++	MMX reg112 (wr0): undefined
++	MMX reg113 (wr1): undefined
++	MMX reg114 (wr2): undefined
++	MMX reg115 (wr3): undefined
++	MMX reg116 (wr4): undefined
++	MMX reg117 (wr5): undefined
++	MMX reg118 (wr6): undefined
++	MMX reg119 (wr7): undefined
++	MMX reg120 (wr8): undefined
++	MMX reg121 (wr9): undefined
++	MMX reg122 (wr10): undefined
++	MMX reg123 (wr11): undefined
++	MMX reg124 (wr12): undefined
++	MMX reg125 (wr13): undefined
++	MMX reg126 (wr14): undefined
++	MMX reg127 (wr15): undefined
++	state reg128 (spsr): undefined
++	state reg129 (spsr_fiq): undefined
++	state reg130 (spsr_irq): undefined
++	state reg131 (spsr_abt): undefined
++	state reg132 (spsr_und): undefined
++	state reg133 (spsr_svc): undefined
++	integer reg144 (r8_usr): undefined
++	integer reg145 (r9_usr): undefined
++	integer reg146 (r10_usr): undefined
++	integer reg147 (r11_usr): undefined
++	integer reg148 (r12_usr): undefined
++	integer reg149 (r13_usr): undefined
++	integer reg150 (r14_usr): undefined
++	integer reg151 (r8_fiq): undefined
++	integer reg152 (r9_fiq): undefined
++	integer reg153 (r10_fiq): undefined
++	integer reg154 (r11_fiq): undefined
++	integer reg155 (r12_fiq): undefined
++	integer reg156 (r13_fiq): undefined
++	integer reg157 (r14_fiq): undefined
++	integer reg158 (r13_irq): undefined
++	integer reg159 (r14_irq): undefined
++	integer reg160 (r13_abt): undefined
++	integer reg161 (r14_abt): undefined
++	integer reg162 (r13_und): undefined
++	integer reg163 (r14_und): undefined
++	integer reg164 (r13_svc): undefined
++	integer reg165 (r14_svc): undefined
++	MMX reg192 (wc0): undefined
++	MMX reg193 (wc1): undefined
++	MMX reg194 (wc2): undefined
++	MMX reg195 (wc3): undefined
++	MMX reg196 (wc4): undefined
++	MMX reg197 (wc5): undefined
++	MMX reg198 (wc6): undefined
++	MMX reg199 (wc7): undefined
+ 	VFP reg256 (d0): undefined
+ 	VFP reg257 (d1): undefined
+ 	VFP reg258 (d2): undefined
+diff --git a/tests/run-allregs.sh b/tests/run-allregs.sh
+index 6f3862e..13557d5 100755
+--- a/tests/run-allregs.sh
++++ b/tests/run-allregs.sh
+@@ -2671,7 +2671,28 @@ integer registers:
+ 	 13: sp (sp), address 32 bits
+ 	 14: lr (lr), address 32 bits
+ 	 15: pc (pc), address 32 bits
+-	128: spsr (spsr), unsigned 32 bits
++	144: r8_usr (r8_usr), signed 32 bits
++	145: r9_usr (r9_usr), signed 32 bits
++	146: r10_usr (r10_usr), signed 32 bits
++	147: r11_usr (r11_usr), signed 32 bits
++	148: r12_usr (r12_usr), signed 32 bits
++	149: r13_usr (r13_usr), signed 32 bits
++	150: r14_usr (r14_usr), signed 32 bits
++	151: r8_fiq (r8_fiq), signed 32 bits
++	152: r9_fiq (r9_fiq), signed 32 bits
++	153: r10_fiq (r10_fiq), signed 32 bits
++	154: r11_fiq (r11_fiq), signed 32 bits
++	155: r12_fiq (r12_fiq), signed 32 bits
++	156: r13_fiq (r13_fiq), signed 32 bits
++	157: r14_fiq (r14_fiq), signed 32 bits
++	158: r13_irq (r13_irq), signed 32 bits
++	159: r14_irq (r14_irq), signed 32 bits
++	160: r13_abt (r13_abt), signed 32 bits
++	161: r14_abt (r14_abt), signed 32 bits
++	162: r13_und (r13_und), signed 32 bits
++	163: r14_und (r14_und), signed 32 bits
++	164: r13_svc (r13_svc), signed 32 bits
++	165: r14_svc (r14_svc), signed 32 bits
+ FPA registers:
+ 	 16: f0 (f0), float 96 bits
+ 	 17: f1 (f1), float 96 bits
+@@ -2689,7 +2710,72 @@ FPA registers:
+ 	101: f5 (f5), float 96 bits
+ 	102: f6 (f6), float 96 bits
+ 	103: f7 (f7), float 96 bits
++MMX registers:
++	104: wcgr0 (wcgr0), unsigned 32 bits
++	105: wcgr1 (wcgr1), unsigned 32 bits
++	106: wcgr2 (wcgr2), unsigned 32 bits
++	107: wcgr3 (wcgr3), unsigned 32 bits
++	108: wcgr4 (wcgr4), unsigned 32 bits
++	109: wcgr5 (wcgr5), unsigned 32 bits
++	110: wcgr6 (wcgr6), unsigned 32 bits
++	111: wcgr7 (wcgr7), unsigned 32 bits
++	112: wr0 (wr0), unsigned 64 bits
++	113: wr1 (wr1), unsigned 64 bits
++	114: wr2 (wr2), unsigned 64 bits
++	115: wr3 (wr3), unsigned 64 bits
++	116: wr4 (wr4), unsigned 64 bits
++	117: wr5 (wr5), unsigned 64 bits
++	118: wr6 (wr6), unsigned 64 bits
++	119: wr7 (wr7), unsigned 64 bits
++	120: wr8 (wr8), unsigned 64 bits
++	121: wr9 (wr9), unsigned 64 bits
++	122: wr10 (wr10), unsigned 64 bits
++	123: wr11 (wr11), unsigned 64 bits
++	124: wr12 (wr12), unsigned 64 bits
++	125: wr13 (wr13), unsigned 64 bits
++	126: wr14 (wr14), unsigned 64 bits
++	127: wr15 (wr15), unsigned 64 bits
++	192: wc0 (wc0), unsigned 32 bits
++	193: wc1 (wc1), unsigned 32 bits
++	194: wc2 (wc2), unsigned 32 bits
++	195: wc3 (wc3), unsigned 32 bits
++	196: wc4 (wc4), unsigned 32 bits
++	197: wc5 (wc5), unsigned 32 bits
++	198: wc6 (wc6), unsigned 32 bits
++	199: wc7 (wc7), unsigned 32 bits
+ VFP registers:
++	 64: s0 (s0), float 32 bits
++	 65: s1 (s1), float 32 bits
++	 66: s2 (s2), float 32 bits
++	 67: s3 (s3), float 32 bits
++	 68: s4 (s4), float 32 bits
++	 69: s5 (s5), float 32 bits
++	 70: s6 (s6), float 32 bits
++	 71: s7 (s7), float 32 bits
++	 72: s8 (s8), float 32 bits
++	 73: s9 (s9), float 32 bits
++	 74: s10 (s10), float 32 bits
++	 75: s11 (s11), float 32 bits
++	 76: s12 (s12), float 32 bits
++	 77: s13 (s13), float 32 bits
++	 78: s14 (s14), float 32 bits
++	 79: s15 (s15), float 32 bits
++	 80: s16 (s16), float 32 bits
++	 81: s17 (s17), float 32 bits
++	 82: s18 (s18), float 32 bits
++	 83: s19 (s19), float 32 bits
++	 84: s20 (s20), float 32 bits
++	 85: s21 (s21), float 32 bits
++	 86: s22 (s22), float 32 bits
++	 87: s23 (s23), float 32 bits
++	 88: s24 (s24), float 32 bits
++	 89: s25 (s25), float 32 bits
++	 90: s26 (s26), float 32 bits
++	 91: s27 (s27), float 32 bits
++	 92: s28 (s28), float 32 bits
++	 93: s29 (s29), float 32 bits
++	 94: s30 (s30), float 32 bits
++	 95: s31 (s31), float 32 bits
+ 	256: d0 (d0), float 64 bits
+ 	257: d1 (d1), float 64 bits
+ 	258: d2 (d2), float 64 bits
+@@ -2722,6 +2808,13 @@ VFP registers:
+ 	285: d29 (d29), float 64 bits
+ 	286: d30 (d30), float 64 bits
+ 	287: d31 (d31), float 64 bits
++state registers:
++	128: spsr (spsr), unsigned 32 bits
++	129: spsr_fiq (spsr_fiq), unsigned 32 bits
++	130: spsr_irq (spsr_irq), unsigned 32 bits
++	131: spsr_abt (spsr_abt), unsigned 32 bits
++	132: spsr_und (spsr_und), unsigned 32 bits
++	133: spsr_svc (spsr_svc), unsigned 32 bits
+ EOF
+ 
+ # See run-readelf-mixed-corenote.sh for instructions to regenerate
+diff --git a/tests/run-readelf-mixed-corenote.sh b/tests/run-readelf-mixed-corenote.sh
+index 01e4594..9a8a380 100755
+--- a/tests/run-readelf-mixed-corenote.sh
++++ b/tests/run-readelf-mixed-corenote.sh
+@@ -30,12 +30,11 @@ Note segment of 892 bytes at offset 0x274:
+     pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
+     utime: 0.000000, stime: 0.010000, cutime: 0.000000, cstime: 0.000000
+     orig_r0: -1, fpvalid: 1
+-    r0:             1  r1:   -1091672508  r2:   -1091672500
+-    r3:             0  r4:             0  r5:             0
+-    r6:         33728  r7:             0  r8:             0
+-    r9:             0  r10:  -1225703496  r11:  -1091672844
+-    r12:            0  sp:    0xbeee64f4  lr:    0xb6dc3f48
+-    pc:    0x00008500  spsr:  0x60000010
++    r0:            1  r1:  -1091672508  r2:  -1091672500  r3:            0
++    r4:            0  r5:            0  r6:        33728  r7:            0
++    r8:            0  r9:            0  r10: -1225703496  r11: -1091672844
++    r12:           0  sp:   0xbeee64f4  lr:   0xb6dc3f48  pc:   0x00008500
++    spsr:  0x60000010
+   CORE                 124  PRPSINFO
+     state: 0, sname: R, zomb: 0, nice: 0, flag: 0x00400500
+     uid: 0, gid: 0, pid: 11087, ppid: 11063, pgrp: 11087, sid: 11063
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/arm_func_value.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_func_value.patch
new file mode 100644
index 0000000..2fe4df6
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_func_value.patch
@@ -0,0 +1,165 @@
+From: Mark Wielaard <mjw@redhat.com>
+Date: Sun, 15 Jun 2014 11:30:35 +0200
+Subject: libebl: Add sym_func_value hook.
+
+The ARM EABI says that the zero bit of function symbol st_value indicates
+whether the symbol points to a THUMB or ARM function. Add a new ebl hook
+to adjust the st_value in such a case so that we get the actual value that
+the symbol points to. It isn't easily possible to reuse the existing
+resolve_sym_value for this purpose, so we end up with another hook that
+can be used from dwfl_module_getsym and elflint.
+
+Rebase arm_func_value.patch from 0.159 to 0.160
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ backends/arm_init.c          |    1 +
+ backends/arm_symbol.c        |    8 ++++++++
+ libdwfl/dwfl_module_getsym.c |    2 +-
+ libebl/Makefile.am           |    3 ++-
+ libebl/ebl-hooks.h           |    3 +++
+ libebl/eblsymfuncval.c       |   43 ++++++++++++++++++++++++++++++++++++++++++
+ libebl/libebl.h              |   11 +++++++++++
+ 7 files changed, 69 insertions(+), 2 deletions(-)
+
+diff --git a/backends/arm_init.c b/backends/arm_init.c
+index 7171186..9f03630 100644
+--- a/backends/arm_init.c
++++ b/backends/arm_init.c
+@@ -78,6 +78,7 @@ arm_init (elf, machine, eh, ehlen)
+     eh->return_value_location = arm_return_value_location_hard;
+   HOOK (eh, abi_cfi);
+   HOOK (eh, check_reloc_target_type);
++  HOOK (eh, sym_func_value);
+   HOOK (eh, symbol_type_name);
+ 
+   /* We only unwind the core integer registers.  */
+diff --git a/backends/arm_symbol.c b/backends/arm_symbol.c
+index da4a50a..ccea03b 100644
+--- a/backends/arm_symbol.c
++++ b/backends/arm_symbol.c
+@@ -130,6 +130,14 @@ arm_check_reloc_target_type (Ebl *ebl __attribute__ ((unused)), Elf64_Word sh_ty
+   return sh_type == SHT_ARM_EXIDX;
+ }
+ 
++/* ARM EABI says that the low bit indicates whether the function
++   symbol value is a THUMB function or not.  Mask it off.  */
++GElf_Addr
++arm_sym_func_value (Ebl *ebl __attribute__ ((unused)), GElf_Addr val)
++{
++  return val & ~(GElf_Addr)1;
++}
++
+ const char *
+ arm_symbol_type_name (int type,
+ 		      char *buf __attribute__ ((unused)),
+diff --git a/libdwfl/dwfl_module_getsym.c b/libdwfl/dwfl_module_getsym.c
+index 42d2b67..fb192d7 100644
+--- a/libdwfl/dwfl_module_getsym.c
++++ b/libdwfl/dwfl_module_getsym.c
+@@ -119,7 +119,7 @@ __libdwfl_getsym (Dwfl_Module *mod, int ndx, GElf_Sym *sym, GElf_Addr *addr,
+      descriptors).  */
+ 
+   char *ident;
+-  GElf_Addr st_value = sym->st_value & ebl_func_addr_mask (mod->ebl);
++  GElf_Addr st_value = ebl_sym_func_value (mod->ebl, sym->st_value);
+   *resolved = false;
+   if (! adjust_st_value && mod->e_type != ET_REL && alloc
+       && (GELF_ST_TYPE (sym->st_info) == STT_FUNC
+diff --git a/libebl/Makefile.am b/libebl/Makefile.am
+index ec4477b..889c21b 100644
+--- a/libebl/Makefile.am
++++ b/libebl/Makefile.am
+@@ -55,7 +55,8 @@ gen_SOURCES = eblopenbackend.c eblclosebackend.c eblstrtab.c \
+ 	      eblsysvhashentrysize.c eblauxvinfo.c eblcheckobjattr.c \
+ 	      ebl_check_special_section.c ebl_syscall_abi.c eblabicfi.c \
+ 	      eblstother.c eblinitreg.c ebldwarftoregno.c eblnormalizepc.c \
+-	      eblunwind.c eblresolvesym.c eblcheckreloctargettype.c
++	      eblunwind.c eblresolvesym.c eblcheckreloctargettype.c \
++	      eblsymfuncval.c
+ 
+ libebl_a_SOURCES = $(gen_SOURCES)
+ 
+diff --git a/libebl/ebl-hooks.h b/libebl/ebl-hooks.h
+index 2e31446..9df945d 100644
+--- a/libebl/ebl-hooks.h
++++ b/libebl/ebl-hooks.h
+@@ -191,5 +191,8 @@ bool EBLHOOK(unwind) (Ebl *ebl, Dwarf_Addr pc, ebl_tid_registers_t *setfunc,
+    (e.g. function descriptor resolving)  */
+ bool EBLHOOK(resolve_sym_value) (Ebl *ebl, GElf_Addr *addr);
+ 
++/* Returns the real value of a symbol function address or offset.  */
++GElf_Addr EBLHOOK(sym_func_value) (Ebl *ebl, GElf_Addr val);
++
+ /* Destructor for ELF backend handle.  */
+ void EBLHOOK(destr) (struct ebl *);
+diff --git a/libebl/eblsymfuncval.c b/libebl/eblsymfuncval.c
+new file mode 100644
+index 0000000..c0b322f
+--- /dev/null
++++ b/libebl/eblsymfuncval.c
+@@ -0,0 +1,43 @@
++/* Turn a symbol function value into a real function address or offset.
++   Copyright (C) 2014 Red Hat, Inc.
++   This file is part of elfutils.
++
++   This file is free software; you can redistribute it and/or modify
++   it under the terms of either
++
++     * the GNU Lesser General Public License as published by the Free
++       Software Foundation; either version 3 of the License, or (at
++       your option) any later version
++
++   or
++
++     * 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
++
++   or both in parallel, as here.
++
++   elfutils is distributed in the hope that 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 copies of the GNU General Public License and
++   the GNU Lesser General Public License along with this program.  If
++   not, see <http://www.gnu.org/licenses/>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <libeblP.h>
++#include <assert.h>
++
++GElf_Addr
++ebl_sym_func_value (Ebl *ebl, GElf_Addr val)
++{
++  if (ebl == NULL || ebl->sym_func_value == NULL)
++    return val;
++
++  return ebl->sym_func_value (ebl, val);
++}
+diff --git a/libebl/libebl.h b/libebl/libebl.h
+index 7dbf460..96c076b 100644
+--- a/libebl/libebl.h
++++ b/libebl/libebl.h
+@@ -472,6 +472,17 @@ extern bool ebl_unwind (Ebl *ebl, Dwarf_Addr pc, ebl_tid_registers_t *setfunc,
+ extern bool ebl_resolve_sym_value (Ebl *ebl, GElf_Addr *addr)
+    __nonnull_attribute__ (2);
+ 
++/* Returns the real value of a symbol function address or offset
++   (e.g. when the st_value contains some flag bits that need to be
++   masked off).  This is different from ebl_resolve_sym_value which
++   only works for actual symbol addresses (in non-ET_REL files) that
++   might resolve to an address in a different section.
++   ebl_sym_func_value is called to turn the given value into the a
++   real address or offset (the original value might not be a real
++   address).  This works for both ET_REL when the value is a section
++   offset or ET_EXEC or ET_DYN symbol values, which are addresses.  */
++extern GElf_Addr ebl_sym_func_value (Ebl *ebl, GElf_Addr val);
++
+ #ifdef __cplusplus
+ }
+ #endif
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/arm_unwind_ret_mask.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_unwind_ret_mask.patch
new file mode 100644
index 0000000..8abb36b
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/arm_unwind_ret_mask.patch
@@ -0,0 +1,83 @@
+From: Mark Wielaard <mjw@redhat.com>
+Date: Sun, 15 Jun 2014 12:30:02 +0200
+Subject: libebl: Add ebl_unwind_ret_mask.
+
+Another ARM oddity. A return value address in an unwind will contain an
+extra bit to indicate whether to return to a regular ARM or THUMB function.
+Add a new ebl function to return a mask to use to get the actual return
+address during an unwind ebl_unwind_ret_mask.
+
+Rebase arm_unwind_ret_mask.patch from 0.159 to 0.160
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ backends/arm_init.c | 3 +++
+ libebl/eblinitreg.c | 8 ++++++++
+ libebl/libebl.h     | 4 ++++
+ libebl/libeblP.h    | 6 ++++++
+ 4 files changed, 21 insertions(+)
+
+diff --git a/backends/arm_init.c b/backends/arm_init.c
+index 2266829..f8df042 100644
+--- a/backends/arm_init.c
++++ b/backends/arm_init.c
+@@ -87,5 +87,8 @@ arm_init (elf, machine, eh, ehlen)
+   /* Bit zero encodes whether an function address is THUMB or ARM. */
+   eh->func_addr_mask = ~(GElf_Addr)1;
+ 
++  /* Bit zero encodes whether to return to a THUMB or ARM function. */
++  eh->unwind_ret_mask = ~(GElf_Addr)1;
++
+   return MODVERSION;
+ }
+diff --git a/libebl/eblinitreg.c b/libebl/eblinitreg.c
+index 5729b3c..ca681c0 100644
+--- a/libebl/eblinitreg.c
++++ b/libebl/eblinitreg.c
+@@ -56,3 +56,11 @@ ebl_func_addr_mask (Ebl *ebl)
+   return ((ebl == NULL || ebl->func_addr_mask == 0)
+ 	  ? ~(GElf_Addr)0 : ebl->func_addr_mask);
+ }
++
++GElf_Addr
++ebl_unwind_ret_mask (Ebl *ebl)
++{
++  return ((ebl == NULL || ebl->unwind_ret_mask == 0)
++	  ? ~(GElf_Addr)0 : ebl->unwind_ret_mask);
++}
++
+diff --git a/libebl/libebl.h b/libebl/libebl.h
+index 40cf635..be70027 100644
+--- a/libebl/libebl.h
++++ b/libebl/libebl.h
+@@ -420,6 +420,10 @@ extern size_t ebl_frame_nregs (Ebl *ebl)
+    tables) is needed.  */
+ extern GElf_Addr ebl_func_addr_mask (Ebl *ebl);
+ 
++/* Mask to use for unwind return address in case the architecture adds
++   some extra non-address bits to it.  */
++extern GElf_Addr ebl_unwind_ret_mask (Ebl *ebl);
++
+ /* Convert *REGNO as is in DWARF to a lower range suitable for
+    Dwarf_Frame->REGS indexing.  */
+ extern bool ebl_dwarf_to_regno (Ebl *ebl, unsigned *regno)
+diff --git a/libebl/libeblP.h b/libebl/libeblP.h
+index dbd67f3..e18ace6 100644
+--- a/libebl/libeblP.h
++++ b/libebl/libeblP.h
+@@ -70,6 +70,12 @@ struct ebl
+      otherwise it should be the actual mask to use.  */
+   GElf_Addr func_addr_mask;
+ 
++  /* Mask to use to get the return address from an unwind in case the
++     architecture adds some extra non-address bits to it.  When not
++     initialized (0) then ebl_unwind_ret_mask will return ~0, otherwise
++     it should be the actual mask to use.  */
++  GElf_Addr unwind_ret_mask;
++
+   /* Function descriptor load address and table as used by
+      ebl_resolve_sym_value if available for this arch.  */
+   GElf_Addr fd_addr;
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/fixheadercheck.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/fixheadercheck.patch
new file mode 100644
index 0000000..5de3b24
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/fixheadercheck.patch
@@ -0,0 +1,23 @@
+For some binaries we can get a invalid section alignment, for example if 
+sh_align = 1 and sh_addralign is 0. In the case of a zero size section like 
+".note.GNU-stack", this is irrelavent as far as I can tell and we shouldn't
+error in this case.
+
+RP 2014/6/11
+
+Upstream-Status: Pending
+
+diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
+--- a/libelf/elf32_updatenull.c
++++ b/libelf/elf32_updatenull.c
+@@ -339,8 +339,8 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
+ 		     we test for the alignment of the section being large
+ 		     enough for the largest alignment required by a data
+ 		     block.  */
+-		  if (unlikely (! powerof2 (shdr->sh_addralign))
+-		      || unlikely ((shdr->sh_addralign ?: 1) < sh_align))
++		  if (shdr->sh_size && (unlikely (! powerof2 (shdr->sh_addralign))
++		      || unlikely ((shdr->sh_addralign ?: 1) < sh_align)))
+ 		    {
+ 		      __libelf_seterrno (ELF_E_INVALID_ALIGN);
+ 		      return -1;
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/hppa_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/hppa_backend.diff
new file mode 100644
index 0000000..d51a720
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/hppa_backend.diff
@@ -0,0 +1,800 @@
+Index: elfutils-0.158/backends/parisc_init.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/parisc_init.c	2014-04-21 11:12:12.228150280 +0000
+@@ -0,0 +1,74 @@
++/* Initialization of PA-RISC specific backend library.
++   Copyright (C) 2002, 2005, 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND		parisc_
++#define RELOC_PREFIX	R_PARISC_
++#include "libebl_CPU.h"
++#include "libebl_parisc.h"
++
++/* This defines the common reloc hooks based on parisc_reloc.def.  */
++#include "common-reloc.c"
++
++
++const char *
++parisc_init (elf, machine, eh, ehlen)
++     Elf *elf __attribute__ ((unused));
++     GElf_Half machine __attribute__ ((unused));
++     Ebl *eh;
++     size_t ehlen;
++{
++  int pa64 = 0;
++
++  /* Check whether the Elf_BH object has a sufficent size.  */
++  if (ehlen < sizeof (Ebl))
++    return NULL;
++
++  if (elf) {
++    GElf_Ehdr ehdr_mem;
++    GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++    if (ehdr && (ehdr->e_flags & EF_PARISC_WIDE))
++      pa64 = 1;
++  }
++  /* We handle it.  */
++  eh->name = "PA-RISC";
++  parisc_init_reloc (eh);
++  HOOK (eh, reloc_simple_type);
++  HOOK (eh, machine_flag_check);
++  HOOK (eh, symbol_type_name);
++  HOOK (eh, segment_type_name);
++  HOOK (eh, section_type_name);
++  HOOK (eh, register_info);
++  if (pa64)
++    eh->return_value_location = parisc_return_value_location_64;
++  else
++    eh->return_value_location = parisc_return_value_location_32;
++
++  return MODVERSION;
++}
+Index: elfutils-0.158/backends/parisc_regs.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/parisc_regs.c	2014-04-21 11:12:12.228150280 +0000
+@@ -0,0 +1,159 @@
++/* Register names and numbers for PA-RISC DWARF.
++   Copyright (C) 2005, 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND parisc_
++#include "libebl_CPU.h"
++
++ssize_t
++parisc_register_info (Ebl *ebl, int regno, char *name, size_t namelen,
++		     const char **prefix, const char **setname,
++		     int *bits, int *type)
++{
++  int pa64 = 0;
++
++  if (ebl->elf) {
++    GElf_Ehdr ehdr_mem;
++    GElf_Ehdr *ehdr = gelf_getehdr (ebl->elf, &ehdr_mem);
++    if (ehdr->e_flags & EF_PARISC_WIDE)
++      pa64 = 1;
++  }
++
++  int nregs = pa64 ? 127 : 128;
++
++  if (name == NULL)
++    return nregs;
++
++  if (regno < 0 || regno >= nregs || namelen < 6)
++    return -1;
++
++  *prefix = "%";
++
++  if (regno < 32)
++  {
++    *setname = "integer";
++    *type = DW_ATE_signed;
++    if (pa64)
++    {
++	*bits = 64;
++    }
++    else
++    {
++    	*bits = 32;
++    }
++  }
++  else if (regno == 32)
++  {
++    *setname = "special";
++    if (pa64)
++    {
++	*bits = 6;
++    }
++    else
++    {
++    	*bits = 5;
++    }
++    *type = DW_ATE_unsigned;
++  }
++  else
++  {
++    *setname = "FPU";
++    *type = DW_ATE_float;
++    if (pa64)
++    {
++	*bits = 64;
++    }
++    else
++    {
++    	*bits = 32;
++    }
++  }
++
++  if (regno < 33) {
++    switch (regno)
++      {
++      case 0 ... 9:
++        name[0] = 'r';
++        name[1] = regno + '0';
++        namelen = 2;
++        break;
++      case 10 ... 31:
++        name[0] = 'r';
++        name[1] = regno / 10 + '0';
++        name[2] = regno % 10 + '0';
++        namelen = 3;
++        break;
++      case 32:
++	*prefix = NULL;
++	name[0] = 'S';
++	name[1] = 'A';
++	name[2] = 'R';
++	namelen = 3;
++	break;
++      }
++  }
++  else {
++    if (pa64 && ((regno - 72) % 2)) {
++      *setname = NULL;
++      return 0;
++    }
++
++    switch (regno)
++      {
++      case 72 + 0 ... 72 + 11:
++        name[0] = 'f';
++	name[1] = 'r';
++        name[2] = (regno + 8 - 72) / 2 + '0';
++        namelen = 3;
++        if ((regno + 8 - 72) % 2) {
++	  name[3] = 'R';
++	  namelen++;
++        }
++        break;
++      case 72 + 12 ... 72 + 55:
++        name[0] = 'f';
++	name[1] = 'r';
++        name[2] = (regno + 8 - 72) / 2 / 10 + '0';
++        name[3] = (regno + 8 - 72) / 2 % 10 + '0';
++        namelen = 4;
++        if ((regno + 8 - 72) % 2) {
++	  name[4] = 'R';
++	  namelen++;
++        }
++        break;
++      default:
++        *setname = NULL;
++        return 0;
++      }
++  }
++  name[namelen++] = '\0';
++  return namelen;
++}
+Index: elfutils-0.158/backends/parisc_reloc.def
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/parisc_reloc.def	2014-04-21 11:12:12.228150280 +0000
+@@ -0,0 +1,128 @@
++/* List the relocation types for PA-RISC.  -*- C -*-
++   Copyright (C) 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++/*	    NAME,		REL|EXEC|DYN	*/
++
++RELOC_TYPE (NONE,		EXEC|DYN)
++RELOC_TYPE (DIR32,		REL|EXEC|DYN)
++RELOC_TYPE (DIR21L,		REL|EXEC|DYN)
++RELOC_TYPE (DIR17R,		REL)
++RELOC_TYPE (DIR17F,		REL)
++RELOC_TYPE (DIR14R,		REL|DYN)
++RELOC_TYPE (PCREL32,		REL)
++RELOC_TYPE (PCREL21L,		REL)
++RELOC_TYPE (PCREL17R,		REL)
++RELOC_TYPE (PCREL17F,		REL)
++RELOC_TYPE (PCREL14R,		REL|EXEC)
++RELOC_TYPE (DPREL21L,		REL)
++RELOC_TYPE (DPREL14WR,		REL)
++RELOC_TYPE (DPREL14DR,          REL)
++RELOC_TYPE (DPREL14R,		REL)
++RELOC_TYPE (GPREL21L,		0)
++RELOC_TYPE (GPREL14R,		0)
++RELOC_TYPE (LTOFF21L,		REL)
++RELOC_TYPE (LTOFF14R,		REL)
++RELOC_TYPE (DLTIND14F,		0)
++RELOC_TYPE (SETBASE,		0)
++RELOC_TYPE (SECREL32,		REL)
++RELOC_TYPE (BASEREL21L,		0)
++RELOC_TYPE (BASEREL17R,		0)
++RELOC_TYPE (BASEREL14R,		0)
++RELOC_TYPE (SEGBASE,		0)
++RELOC_TYPE (SEGREL32,		REL)
++RELOC_TYPE (PLTOFF21L,		0)
++RELOC_TYPE (PLTOFF14R,		0)
++RELOC_TYPE (PLTOFF14F,		0)
++RELOC_TYPE (LTOFF_FPTR32,	0)
++RELOC_TYPE (LTOFF_FPTR21L,	0)
++RELOC_TYPE (LTOFF_FPTR14R,	0)
++RELOC_TYPE (FPTR64,		0)
++RELOC_TYPE (PLABEL32,		REL|DYN)
++RELOC_TYPE (PCREL64,		0)
++RELOC_TYPE (PCREL22C,		0)
++RELOC_TYPE (PCREL22F,		0)
++RELOC_TYPE (PCREL14WR,		0)
++RELOC_TYPE (PCREL14DR,		0)
++RELOC_TYPE (PCREL16F,		0)
++RELOC_TYPE (PCREL16WF,		0)
++RELOC_TYPE (PCREL16DF,		0)
++RELOC_TYPE (DIR64,		REL|DYN)
++RELOC_TYPE (DIR14WR,		REL)
++RELOC_TYPE (DIR14DR,		REL)
++RELOC_TYPE (DIR16F,		REL)
++RELOC_TYPE (DIR16WF,		REL)
++RELOC_TYPE (DIR16DF,		REL)
++RELOC_TYPE (GPREL64,		0)
++RELOC_TYPE (GPREL14WR,		0)
++RELOC_TYPE (GPREL14DR,		0)
++RELOC_TYPE (GPREL16F,		0)
++RELOC_TYPE (GPREL16WF,		0)
++RELOC_TYPE (GPREL16DF,		0)
++RELOC_TYPE (LTOFF64,		0)
++RELOC_TYPE (LTOFF14WR,		0)
++RELOC_TYPE (LTOFF14DR,		0)
++RELOC_TYPE (LTOFF16F,		0)
++RELOC_TYPE (LTOFF16WF,		0)
++RELOC_TYPE (LTOFF16DF,		0)
++RELOC_TYPE (SECREL64,		0)
++RELOC_TYPE (BASEREL14WR,	0)
++RELOC_TYPE (BASEREL14DR,	0)
++RELOC_TYPE (SEGREL64,		0)
++RELOC_TYPE (PLTOFF14WR,		0)
++RELOC_TYPE (PLTOFF14DR,		0)
++RELOC_TYPE (PLTOFF16F,		0)
++RELOC_TYPE (PLTOFF16WF,		0)
++RELOC_TYPE (PLTOFF16DF,		0)
++RELOC_TYPE (LTOFF_FPTR64,	0)
++RELOC_TYPE (LTOFF_FPTR14WR,	0)
++RELOC_TYPE (LTOFF_FPTR14DR,	0)
++RELOC_TYPE (LTOFF_FPTR16F,	0)
++RELOC_TYPE (LTOFF_FPTR16WF,	0)
++RELOC_TYPE (LTOFF_FPTR16DF,	0)
++RELOC_TYPE (COPY,		EXEC)
++RELOC_TYPE (IPLT,		EXEC|DYN)
++RELOC_TYPE (EPLT,		0)
++RELOC_TYPE (TPREL32,		DYN)
++RELOC_TYPE (TPREL21L,		0)
++RELOC_TYPE (TPREL14R,		0)
++RELOC_TYPE (LTOFF_TP21L,	0)
++RELOC_TYPE (LTOFF_TP14R,	0)
++RELOC_TYPE (LTOFF_TP14F,	0)
++RELOC_TYPE (TPREL64,		0)
++RELOC_TYPE (TPREL14WR,		0)
++RELOC_TYPE (TPREL14DR,		0)
++RELOC_TYPE (TPREL16F,		0)
++RELOC_TYPE (TPREL16WF,		0)
++RELOC_TYPE (TPREL16DF,		0)
++RELOC_TYPE (LTOFF_TP64,		0)
++RELOC_TYPE (LTOFF_TP14WR,	0)
++RELOC_TYPE (LTOFF_TP14DR,	0)
++RELOC_TYPE (LTOFF_TP16F,	0)
++RELOC_TYPE (LTOFF_TP16WF,	0)
++RELOC_TYPE (LTOFF_TP16DF,	0)
++RELOC_TYPE (TLS_DTPMOD32,	DYN)
++RELOC_TYPE (TLS_DTPMOD64,	DYN)
++
++#define NO_RELATIVE_RELOC       1
+Index: elfutils-0.158/backends/parisc_retval.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/parisc_retval.c	2014-04-21 11:12:12.228150280 +0000
+@@ -0,0 +1,213 @@
++/* Function return value location for Linux/PA-RISC ABI.
++   Copyright (C) 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <assert.h>
++#include <dwarf.h>
++
++#define BACKEND parisc_
++#include "libebl_CPU.h"
++#include "libebl_parisc.h"
++
++/* %r28, or pair %r28, %r29.  */
++static const Dwarf_Op loc_intreg32[] =
++  {
++    { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++
++static const Dwarf_Op loc_intreg[] =
++  {
++    { .atom = DW_OP_reg28 }, { .atom = DW_OP_piece, .number = 8 },
++    { .atom = DW_OP_reg29 }, { .atom = DW_OP_piece, .number = 8 },
++  };
++#define nloc_intreg	1
++#define nloc_intregpair	4
++
++/* %fr4L, or pair %fr4L, %fr4R on pa-32 */
++static const Dwarf_Op loc_fpreg32[] =
++  {
++    { .atom = DW_OP_regx, .number = 72 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 73 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++#define nloc_fpreg32 2
++#define nloc_fpregpair32 4
++
++/* $fr4 */
++static const Dwarf_Op loc_fpreg[] =
++  {
++    { .atom = DW_OP_regx, .number = 72 },
++  };
++#define nloc_fpreg  1
++
++#if 0
++/* The return value is a structure and is actually stored in stack space
++   passed in a hidden argument by the caller. Address of the location is stored
++   in %r28 before function call, but it may be changed by function. */
++static const Dwarf_Op loc_aggregate[] =
++  {
++    { .atom = DW_OP_breg28 },
++  };
++#define nloc_aggregate 1
++#endif
++
++static int
++parisc_return_value_location_ (Dwarf_Die *functypedie, const Dwarf_Op **locp, int pa64)
++{
++  Dwarf_Word regsize = pa64 ? 8 : 4;
++
++  /* Start with the function's type, and get the DW_AT_type attribute,
++     which is the type of the return value.  */
++
++  Dwarf_Attribute attr_mem;
++  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
++  if (attr == NULL)
++    /* The function has no return value, like a `void' function in C.  */
++    return 0;
++
++  Dwarf_Die die_mem;
++  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
++  int tag = dwarf_tag (typedie);
++
++  /* Follow typedefs and qualifiers to get to the actual type.  */
++  while (tag == DW_TAG_typedef
++	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
++	 || tag == DW_TAG_restrict_type)
++    {
++      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++      typedie = dwarf_formref_die (attr, &die_mem);
++      tag = dwarf_tag (typedie);
++    }
++
++  switch (tag)
++    {
++    case -1:
++      return -1;
++
++    case DW_TAG_subrange_type:
++      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
++	{
++	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++	  typedie = dwarf_formref_die (attr, &die_mem);
++	  tag = dwarf_tag (typedie);
++	}
++      /* Fall through.  */
++
++    case DW_TAG_base_type:
++    case DW_TAG_enumeration_type:
++    case DW_TAG_pointer_type:
++    case DW_TAG_ptr_to_member_type:
++      {
++        Dwarf_Word size;
++	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
++					 &attr_mem), &size) != 0)
++	  {
++	    if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
++	      size = 4;
++	    else
++	      return -1;
++	  }
++	if (tag == DW_TAG_base_type)
++	  {
++	    Dwarf_Word encoding;
++	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++					     &attr_mem), &encoding) != 0)
++	      return -1;
++
++	    if (encoding == DW_ATE_float)
++	      {
++		if (pa64) {
++		  *locp = loc_fpreg;
++		  if (size <= 8)
++		      return nloc_fpreg;
++		}
++		else {
++		  *locp = loc_fpreg32;
++		  if (size <= 4)
++		    return nloc_fpreg32;
++		  else if (size <= 8)
++		    return nloc_fpregpair32;
++		}
++		goto aggregate;
++	      }
++	  }
++	if (pa64)
++	  *locp = loc_intreg;
++	else
++	  *locp = loc_intreg32;
++	if (size <= regsize)
++	  return nloc_intreg;
++	if (size <= 2 * regsize)
++	  return nloc_intregpair;
++
++	/* Else fall through.  */
++      }
++
++    case DW_TAG_structure_type:
++    case DW_TAG_class_type:
++    case DW_TAG_union_type:
++    case DW_TAG_array_type:
++    aggregate: {
++        Dwarf_Word size;
++	if (dwarf_aggregate_size (typedie, &size) != 0)
++	  return -1;
++	if (pa64)
++          *locp = loc_intreg;
++	else
++	  *locp = loc_intreg32;
++        if (size <= regsize)
++	  return nloc_intreg;
++        if (size <= 2 * regsize)
++	  return nloc_intregpair;
++#if 0
++	/* there should be some way to know this location... But I do not see it. */
++        *locp = loc_aggregate;
++        return nloc_aggregate;
++#endif
++	/* fall through.  */
++      }
++    }
++
++  /* XXX We don't have a good way to return specific errors from ebl calls.
++     This value means we do not understand the type, but it is well-formed
++     DWARF and might be valid.  */
++  return -2;
++}
++
++int
++parisc_return_value_location_32 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++  return parisc_return_value_location_ (functypedie, locp, 0);
++}
++
++int
++parisc_return_value_location_64 (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++  return parisc_return_value_location_ (functypedie, locp, 1);
++}
++
+Index: elfutils-0.158/backends/parisc_symbol.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/parisc_symbol.c	2014-04-21 11:12:12.228150280 +0000
+@@ -0,0 +1,112 @@
++/* PA-RISC specific symbolic name handling.
++   Copyright (C) 2002, 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++   Written by Ulrich Drepper <drepper@redhat.com>, 2002.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND		parisc_
++#include "libebl_CPU.h"
++
++const char *
++parisc_segment_type_name (int segment, char *buf __attribute__ ((unused)),
++			size_t len __attribute__ ((unused)))
++{
++  switch (segment)
++    {
++    case PT_PARISC_ARCHEXT:
++      return "PARISC_ARCHEXT";
++    case PT_PARISC_UNWIND:
++      return "PARISC_UNWIND";
++    default:
++      break;
++    }
++  return NULL;
++}
++
++/* Return symbolic representation of symbol type.  */
++const char *
++parisc_symbol_type_name(int symbol, char *buf __attribute__ ((unused)),
++    size_t len __attribute__ ((unused)))
++{
++	if (symbol == STT_PARISC_MILLICODE)
++	  return "PARISC_MILLI";
++	return NULL;
++}
++
++/* Return symbolic representation of section type.  */
++const char *
++parisc_section_type_name (int type,
++			char *buf __attribute__ ((unused)),
++			size_t len __attribute__ ((unused)))
++{
++  switch (type)
++    {
++    case SHT_PARISC_EXT:
++      return "PARISC_EXT";
++    case SHT_PARISC_UNWIND:
++      return "PARISC_UNWIND";
++    case SHT_PARISC_DOC:
++      return "PARISC_DOC";
++    }
++
++  return NULL;
++}
++
++/* Check whether machine flags are valid.  */
++bool
++parisc_machine_flag_check (GElf_Word flags)
++{
++  if (flags &~ (EF_PARISC_TRAPNIL | EF_PARISC_EXT | EF_PARISC_LSB |
++	EF_PARISC_WIDE | EF_PARISC_NO_KABP |
++	EF_PARISC_LAZYSWAP | EF_PARISC_ARCH))
++    return 0;
++
++  GElf_Word arch = flags & EF_PARISC_ARCH;
++
++  return ((arch == EFA_PARISC_1_0) || (arch == EFA_PARISC_1_1) ||
++      (arch == EFA_PARISC_2_0));
++}
++
++/* Check for the simple reloc types.  */
++Elf_Type
++parisc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++  switch (type)
++    {
++    case R_PARISC_DIR64:
++    case R_PARISC_SECREL64:
++      return ELF_T_XWORD;
++    case R_PARISC_DIR32:
++    case R_PARISC_SECREL32:
++      return ELF_T_WORD;
++    default:
++      return ELF_T_NUM;
++    }
++}
+Index: elfutils-0.158/backends/libebl_parisc.h
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/libebl_parisc.h	2014-04-21 11:12:12.228150280 +0000
+@@ -0,0 +1,9 @@
++#ifndef _LIBEBL_HPPA_H
++#define _LIBEBL_HPPA_H 1
++
++#include <libdw.h>
++
++extern int parisc_return_value_location_32(Dwarf_Die *, const Dwarf_Op **locp);
++extern int parisc_return_value_location_64(Dwarf_Die *, const Dwarf_Op **locp);
++
++#endif
+Index: elfutils-0.158/backends/Makefile.am
+===================================================================
+--- elfutils-0.158.orig/backends/Makefile.am	2014-04-21 11:12:12.252149737 +0000
++++ elfutils-0.158/backends/Makefile.am	2014-04-21 11:13:11.910801105 +0000
+@@ -33,11 +33,12 @@
+ 
+ 
+ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
+-	  tilegx
++	  tilegx parisc
+ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a    \
+ 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a    \
+ 	     libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
+-	     libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a
++	     libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
++	     libebl_parisc_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+ 
+@@ -116,6 +117,9 @@
+ libebl_tilegx_pic_a_SOURCES = $(tilegx_SRCS)
+ am_libebl_tilegx_pic_a_OBJECTS = $(tilegx_SRCS:.c=.os)
+ 
++parisc_SRCS = parisc_init.c parisc_symbol.c parisc_regs.c parisc_retval.c
++libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
++am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
+ 
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ 	@rm -f $(@:.so=.map)
+Index: elfutils-0.158/libelf/elf.h
+===================================================================
+--- elfutils-0.158.orig/libelf/elf.h	2014-04-21 11:12:12.252149737 +0000
++++ elfutils-0.158/libelf/elf.h	2014-04-21 11:12:12.228150280 +0000
+@@ -1814,16 +1814,24 @@
+ #define R_PARISC_PCREL17F	12	/* 17 bits of rel. address.  */
+ #define R_PARISC_PCREL14R	14	/* Right 14 bits of rel. address.  */
+ #define R_PARISC_DPREL21L	18	/* Left 21 bits of rel. address.  */
++#define R_PARISC_DPREL14WR	19
++#define R_PARISC_DPREL14DR	20
+ #define R_PARISC_DPREL14R	22	/* Right 14 bits of rel. address.  */
+ #define R_PARISC_GPREL21L	26	/* GP-relative, left 21 bits.  */
+ #define R_PARISC_GPREL14R	30	/* GP-relative, right 14 bits.  */
+ #define R_PARISC_LTOFF21L	34	/* LT-relative, left 21 bits.  */
+ #define R_PARISC_LTOFF14R	38	/* LT-relative, right 14 bits.  */
++#define R_PARISC_DLTIND14F	39
++#define R_PARISC_SETBASE	40
+ #define R_PARISC_SECREL32	41	/* 32 bits section rel. address.  */
++#define R_PARISC_BASEREL21L	42
++#define R_PARISC_BASEREL17R	43
++#define R_PARISC_BASEREL14R	46
+ #define R_PARISC_SEGBASE	48	/* No relocation, set segment base.  */
+ #define R_PARISC_SEGREL32	49	/* 32 bits segment rel. address.  */
+ #define R_PARISC_PLTOFF21L	50	/* PLT rel. address, left 21 bits.  */
+ #define R_PARISC_PLTOFF14R	54	/* PLT rel. address, right 14 bits.  */
++#define R_PARISC_PLTOFF14F	55
+ #define R_PARISC_LTOFF_FPTR32	57	/* 32 bits LT-rel. function pointer. */
+ #define R_PARISC_LTOFF_FPTR21L	58	/* LT-rel. fct ptr, left 21 bits. */
+ #define R_PARISC_LTOFF_FPTR14R	62	/* LT-rel. fct ptr, right 14 bits. */
+@@ -1832,6 +1840,7 @@
+ #define R_PARISC_PLABEL21L	66	/* Left 21 bits of fdesc address.  */
+ #define R_PARISC_PLABEL14R	70	/* Right 14 bits of fdesc address.  */
+ #define R_PARISC_PCREL64	72	/* 64 bits PC-rel. address.  */
++#define R_PARISC_PCREL22C	73
+ #define R_PARISC_PCREL22F	74	/* 22 bits PC-rel. address.  */
+ #define R_PARISC_PCREL14WR	75	/* PC-rel. address, right 14 bits.  */
+ #define R_PARISC_PCREL14DR	76	/* PC rel. address, right 14 bits.  */
+@@ -1857,6 +1866,8 @@
+ #define R_PARISC_LTOFF16WF	102	/* 16 bits LT-rel. address.  */
+ #define R_PARISC_LTOFF16DF	103	/* 16 bits LT-rel. address.  */
+ #define R_PARISC_SECREL64	104	/* 64 bits section rel. address.  */
++#define R_PARISC_BASEREL14WR	107
++#define R_PARISC_BASEREL14DR	108
+ #define R_PARISC_SEGREL64	112	/* 64 bits segment rel. address.  */
+ #define R_PARISC_PLTOFF14WR	115	/* PLT-rel. address, right 14 bits.  */
+ #define R_PARISC_PLTOFF14DR	116	/* PLT-rel. address, right 14 bits.  */
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/m68k_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/m68k_backend.diff
new file mode 100644
index 0000000..f5b566f
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/m68k_backend.diff
@@ -0,0 +1,493 @@
+From: Kurt Roeckx <kurt@roeckx.be>
+From: Thorsten Glaser <tg@mirbsd.de>
+Subject: m68k support
+
+Written by Kurt Roeckx, except for the retval support which was written
+by Thorsten Glaser
+
+
+Index: elfutils-0.158/backends/m68k_init.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/m68k_init.c	2014-04-21 11:14:23.813175704 +0000
+@@ -0,0 +1,50 @@
++/* Initialization of m68k specific backend library.
++   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++   This software 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; version 2 of the License.
++
++   This softare is distributed in the hope that 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 software; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++*/
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND		m68k_
++#define RELOC_PREFIX	R_68K_
++#include "libebl_CPU.h"
++
++/* This defines the common reloc hooks based on m68k_reloc.def.  */
++#include "common-reloc.c"
++
++
++const char *
++m68k_init (elf, machine, eh, ehlen)
++     Elf *elf __attribute__ ((unused));
++     GElf_Half machine __attribute__ ((unused));
++     Ebl *eh;
++     size_t ehlen;
++{
++  /* Check whether the Elf_BH object has a sufficent size.  */
++  if (ehlen < sizeof (Ebl))
++    return NULL;
++
++  /* We handle it.  */
++  eh->name = "m68k";
++  m68k_init_reloc (eh);
++  HOOK (eh, reloc_simple_type);
++  HOOK (eh, return_value_location);
++  HOOK (eh, register_info);
++
++  return MODVERSION;
++}
+Index: elfutils-0.158/backends/m68k_regs.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/m68k_regs.c	2014-04-21 11:14:23.813175704 +0000
+@@ -0,0 +1,106 @@
++/* Register names and numbers for m68k DWARF.
++   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++   This software 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; version 2 of the License.
++
++   This software is distributed in the hope that 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 software; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND m68k_
++#include "libebl_CPU.h"
++
++ssize_t
++m68k_register_info (Ebl *ebl __attribute__ ((unused)),
++		   int regno, char *name, size_t namelen,
++		   const char **prefix, const char **setname,
++		   int *bits, int *type)
++{
++	if (name == NULL)
++		return 25;
++
++	if (regno < 0 || regno > 24 || namelen < 5)
++		return -1;
++
++	*prefix = "%";
++	*bits = 32;
++	*type = (regno < 8 ? DW_ATE_signed
++		: regno < 16 ? DW_ATE_address : DW_ATE_float);
++
++	if (regno < 8)
++	{
++		*setname = "integer";
++	}
++	else if (regno < 16)
++	{
++		*setname = "address";
++	}
++	else if (regno < 24)
++	{
++		*setname = "FPU";
++	}
++	else
++	{
++		*setname = "address";
++		*type = DW_ATE_address;
++	}
++
++	switch (regno)
++	{
++	case 0 ... 7:
++		name[0] = 'd';
++		name[1] = regno + '0';
++		namelen = 2;
++		break;
++
++	case 8 ... 13:
++		name[0] = 'a';
++		name[1] = regno - 8 + '0';
++		namelen = 2;
++		break;
++
++	case 14:
++		name[0] = 'f';
++		name[1] = 'p';
++   		namelen = 2;
++		break;
++
++	case 15:
++		name[0] = 's';
++		name[1] = 'p';
++   		namelen = 2;
++		break;
++
++	case 16 ... 23:
++		name[0] = 'f';
++		name[1] = 'p';
++		name[2] = regno - 16 + '0';
++   		namelen = 3;
++		break;
++
++	case 24:
++		name[0] = 'p';
++		name[1] = 'c';
++		namelen = 2;
++	}
++
++	name[namelen++] = '\0';
++	return namelen;
++}
++
+Index: elfutils-0.158/backends/m68k_reloc.def
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/m68k_reloc.def	2014-04-21 11:14:23.813175704 +0000
+@@ -0,0 +1,45 @@
++/* List the relocation types for m68k.  -*- C -*-
++   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++   This software 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; version 2 of the License.
++
++   This software is distributed in the hope that 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 software; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++*/
++
++/* 	    NAME,		REL|EXEC|DYN	*/
++
++RELOC_TYPE (NONE,		0)
++RELOC_TYPE (32,			REL|EXEC|DYN)
++RELOC_TYPE (16,			REL)
++RELOC_TYPE (8,			REL)
++RELOC_TYPE (PC32,		REL|EXEC|DYN)
++RELOC_TYPE (PC16,		REL)
++RELOC_TYPE (PC8,		REL)
++RELOC_TYPE (GOT32,		REL)
++RELOC_TYPE (GOT16,		REL)
++RELOC_TYPE (GOT8,		REL)
++RELOC_TYPE (GOT32O,		REL)
++RELOC_TYPE (GOT16O,		REL)
++RELOC_TYPE (GOT8O,		REL)
++RELOC_TYPE (PLT32,		REL)
++RELOC_TYPE (PLT16,		REL)
++RELOC_TYPE (PLT8,		REL)
++RELOC_TYPE (PLT32O,		REL)
++RELOC_TYPE (PLT16O,		REL)
++RELOC_TYPE (PLT8O,		REL)
++RELOC_TYPE (COPY,		EXEC)
++RELOC_TYPE (GLOB_DAT,		EXEC|DYN)
++RELOC_TYPE (JMP_SLOT,		EXEC|DYN)
++RELOC_TYPE (RELATIVE,		EXEC|DYN)
++RELOC_TYPE (GNU_VTINHERIT,	REL)
++RELOC_TYPE (GNU_VTENTRY,	REL)
++
+Index: elfutils-0.158/libelf/elf.h
+===================================================================
+--- elfutils-0.158.orig/libelf/elf.h	2014-04-21 11:14:23.813175704 +0000
++++ elfutils-0.158/libelf/elf.h	2014-04-21 11:14:23.813175704 +0000
+@@ -1157,6 +1157,9 @@
+ #define R_68K_GLOB_DAT	20		/* Create GOT entry */
+ #define R_68K_JMP_SLOT	21		/* Create PLT entry */
+ #define R_68K_RELATIVE	22		/* Adjust by program base */
++/* The next 2 are GNU extensions to enable C++ vtable garbage collection.  */
++#define R_68K_GNU_VTINHERIT 23
++#define R_68K_GNU_VTENTRY   24
+ #define R_68K_TLS_GD32      25          /* 32 bit GOT offset for GD */
+ #define R_68K_TLS_GD16      26          /* 16 bit GOT offset for GD */
+ #define R_68K_TLS_GD8       27          /* 8 bit GOT offset for GD */
+Index: elfutils-0.158/backends/Makefile.am
+===================================================================
+--- elfutils-0.158.orig/backends/Makefile.am	2014-04-21 11:14:23.813175704 +0000
++++ elfutils-0.158/backends/Makefile.am	2014-04-21 11:14:48.344621167 +0000
+@@ -33,12 +33,12 @@
+ 
+ 
+ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
+-	  tilegx parisc mips
++	  tilegx parisc mips m68k
+ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a    \
+ 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a    \
+ 	     libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
+ 	     libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
+-	     libebl_parisc_pic.a libebl_mips_pic.a
++	     libebl_parisc_pic.a libebl_mips_pic.a libebl_m68k_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+ 
+@@ -125,6 +125,10 @@
+ libebl_mips_pic_a_SOURCES = $(mips_SRCS)
+ am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
+ 
++m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c m68k_retval.c
++libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
++am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
++
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ 	@rm -f $(@:.so=.map)
+ 	echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
+Index: elfutils-0.158/backends/m68k_symbol.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/m68k_symbol.c	2014-04-21 11:14:23.813175704 +0000
+@@ -0,0 +1,43 @@
++/* m68k specific symbolic name handling.
++   Copyright (C) 2007 Kurt Roeckx <kurt@roeckx.be>
++
++   This software 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; version 2 of the License.
++
++   This software distributed in the hope that 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 software; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++*/
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND		m68k_
++#include "libebl_CPU.h"
++
++/* Check for the simple reloc types.  */
++Elf_Type
++m68k_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++  switch (type)
++    {
++    case R_68K_32:
++      return ELF_T_SWORD;
++    case R_68K_16:
++      return ELF_T_HALF;
++    case R_68K_8:
++      return ELF_T_BYTE;
++    default:
++      return ELF_T_NUM;
++    }
++}
+Index: elfutils-0.158/backends/m68k_retval.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/m68k_retval.c	2014-04-21 11:14:23.813175704 +0000
+@@ -0,0 +1,172 @@
++/* Function return value location for Linux/m68k ABI.
++   Copyright (C) 2005-2010 Red Hat, Inc.
++   Copyright (c) 2011 Thorsten Glaser, Debian.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <assert.h>
++#include <dwarf.h>
++
++#define BACKEND m68k_
++#include "libebl_CPU.h"
++
++
++/* %d0, or pair %d0, %d1, or %a0 */
++static const Dwarf_Op loc_intreg[] =
++  {
++    { .atom = DW_OP_reg0 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_reg1 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++static const Dwarf_Op loc_ptrreg[] =
++  {
++    { .atom = DW_OP_reg8 },
++  };
++#define nloc_intreg	1
++#define nloc_intregpair	4
++#define nloc_ptrreg	1
++
++/* %f0 */
++static const Dwarf_Op loc_fpreg[] =
++  {
++    { .atom = DW_OP_reg16 }
++  };
++#define nloc_fpreg	1
++
++/* Structures are a bit more complicated - small structures are returned
++   in %d0 / %d1 (-freg-struct-return which is enabled by default), large
++   structures use %a1 (in constrast to the SYSV psABI which says %a0) as
++   reentrant storage space indicator.  */
++static const Dwarf_Op loc_aggregate[] =
++  {
++    { .atom = DW_OP_breg9, .number = 0 }
++  };
++#define nloc_aggregate 1
++
++int
++m68k_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++  Dwarf_Word size;
++
++  /* Start with the function's type, and get the DW_AT_type attribute,
++     which is the type of the return value.  */
++
++  Dwarf_Attribute attr_mem;
++  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type,
++						&attr_mem);
++  if (attr == NULL)
++    /* The function has no return value, like a `void' function in C.  */
++    return 0;
++
++  Dwarf_Die die_mem;
++  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
++  int tag = dwarf_tag (typedie);
++
++  /* Follow typedefs and qualifiers to get to the actual type.  */
++  while (tag == DW_TAG_typedef
++	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
++	 || tag == DW_TAG_restrict_type)
++    {
++      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++      typedie = dwarf_formref_die (attr, &die_mem);
++      tag = dwarf_tag (typedie);
++    }
++
++  switch (tag)
++    {
++    case -1:
++      return -1;
++
++    case DW_TAG_subrange_type:
++      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
++	{
++	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++	  typedie = dwarf_formref_die (attr, &die_mem);
++	  tag = dwarf_tag (typedie);
++	}
++      /* Fall through.  */
++
++    case DW_TAG_base_type:
++    case DW_TAG_enumeration_type:
++    case DW_TAG_pointer_type:
++    case DW_TAG_ptr_to_member_type:
++      if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
++						 &attr_mem), &size) != 0)
++	{
++	  if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
++	    size = 4;
++	  else
++	    return -1;
++	}
++      if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
++	{
++	  *locp = loc_ptrreg;
++          return nloc_ptrreg;
++	}
++      if (tag == DW_TAG_base_type)
++	{
++	  Dwarf_Word encoding;
++	  if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++						     &attr_mem),
++			       &encoding) != 0)
++	    return -1;
++	  if (encoding == DW_ATE_float)
++	    {
++	      /* XXX really 10? */
++              if (size > 10)
++                return -2;
++              *locp = loc_fpreg;
++              return nloc_fpreg;
++	    }
++	}
++      if (size <= 8)
++	{
++	intreg:
++	  /* XXX check endianness of dword pair, int64 vs aggregate */
++	  *locp = loc_intreg;
++	  return size <= 4 ? nloc_intreg : nloc_intregpair;
++	}
++
++    aggregate:
++      *locp = loc_aggregate;
++      return nloc_aggregate;
++
++    case DW_TAG_structure_type:
++    case DW_TAG_class_type:
++    case DW_TAG_union_type:
++    case DW_TAG_array_type:
++      if (dwarf_aggregate_size (typedie, &size) == 0
++	  && size > 0 && size <= 8)
++	/* not accurate for a struct whose only member is a float */
++	goto intreg;
++      goto aggregate;
++    }
++
++  /* XXX We don't have a good way to return specific errors from ebl calls.
++     This value means we do not understand the type, but it is well-formed
++     DWARF and might be valid.  */
++  return -2;
++}
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/mips_backend.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/mips_backend.diff
new file mode 100644
index 0000000..d73a3f2
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/mips_backend.diff
@@ -0,0 +1,712 @@
+Index: elfutils-0.158/backends/mips_init.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/mips_init.c	2014-04-21 11:13:36.910235965 +0000
+@@ -0,0 +1,60 @@
++/* Initialization of mips specific backend library.
++   Copyright (C) 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#define BACKEND		mips_
++#define RELOC_PREFIX	R_MIPS_
++#include "libebl_CPU.h"
++
++/* This defines the common reloc hooks based on mips_reloc.def.  */
++#include "common-reloc.c"
++
++const char *
++mips_init (elf, machine, eh, ehlen)
++     Elf *elf __attribute__ ((unused));
++     GElf_Half machine __attribute__ ((unused));
++     Ebl *eh;
++     size_t ehlen;
++{
++  /* Check whether the Elf_BH object has a sufficent size.  */
++  if (ehlen < sizeof (Ebl))
++    return NULL;
++
++  /* We handle it.  */
++  if (machine == EM_MIPS)
++    eh->name = "MIPS R3000 big-endian";
++  else if (machine == EM_MIPS_RS3_LE)
++    eh->name = "MIPS R3000 little-endian";
++
++  mips_init_reloc (eh);
++  HOOK (eh, reloc_simple_type);
++  HOOK (eh, return_value_location);
++  HOOK (eh, register_info);
++
++  return MODVERSION;
++}
+Index: elfutils-0.158/backends/mips_regs.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/mips_regs.c	2014-04-21 11:13:36.910235965 +0000
+@@ -0,0 +1,104 @@
++/* Register names and numbers for MIPS DWARF.
++   Copyright (C) 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <dwarf.h>
++
++#define BACKEND mips_
++#include "libebl_CPU.h"
++
++ssize_t
++mips_register_info (Ebl *ebl __attribute__((unused)),
++		    int regno, char *name, size_t namelen,
++		    const char **prefix, const char **setname,
++		    int *bits, int *type)
++{
++  if (name == NULL)
++    return 66;
++
++  if (regno < 0 || regno > 65 || namelen < 4)
++    return -1;
++
++  *prefix = "$";
++
++  if (regno < 32)
++    {
++      *setname = "integer";
++      *type = DW_ATE_signed;
++      *bits = 32;
++      if (regno < 32 + 10)
++        {
++          name[0] = regno + '0';
++          namelen = 1;
++        }
++      else
++        {
++          name[0] = (regno / 10) + '0';
++          name[1] = (regno % 10) + '0';
++          namelen = 2;
++        }
++    }
++  else if (regno < 64)
++    {
++      *setname = "FPU";
++      *type = DW_ATE_float;
++      *bits = 32;
++      name[0] = 'f';
++      if (regno < 32 + 10)
++	{
++	  name[1] = (regno - 32) + '0';
++	  namelen = 2;
++	}
++      else
++	{
++	  name[1] = (regno - 32) / 10 + '0';
++	  name[2] = (regno - 32) % 10 + '0';
++	  namelen = 3;
++	}
++    }
++  else if (regno == 64)
++    {
++      *type = DW_ATE_signed;
++      *bits = 32;
++      name[0] = 'h';
++      name[1] = 'i';
++      namelen = 2;
++    }
++  else
++    {
++      *type = DW_ATE_signed;
++      *bits = 32;
++      name[0] = 'l';
++      name[1] = 'o';
++      namelen = 2;
++    }
++
++  name[namelen++] = '\0';
++  return namelen;
++}
+Index: elfutils-0.158/backends/mips_reloc.def
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/mips_reloc.def	2014-04-21 11:13:36.910235965 +0000
+@@ -0,0 +1,79 @@
++/* List the relocation types for mips.  -*- C -*-
++   Copyright (C) 2006 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++/* 	    NAME,		REL|EXEC|DYN	*/
++
++RELOC_TYPE (NONE,               0)
++RELOC_TYPE (16,                 0)
++RELOC_TYPE (32,                 0)
++RELOC_TYPE (REL32,              0)
++RELOC_TYPE (26,                 0)
++RELOC_TYPE (HI16,               0)
++RELOC_TYPE (LO16,               0)
++RELOC_TYPE (GPREL16,            0)
++RELOC_TYPE (LITERAL,            0)
++RELOC_TYPE (GOT16,              0)
++RELOC_TYPE (PC16,               0)
++RELOC_TYPE (CALL16,             0)
++RELOC_TYPE (GPREL32,            0)
++
++RELOC_TYPE (SHIFT5,             0)
++RELOC_TYPE (SHIFT6,             0)
++RELOC_TYPE (64,                 0)
++RELOC_TYPE (GOT_DISP,           0)
++RELOC_TYPE (GOT_PAGE,           0)
++RELOC_TYPE (GOT_OFST,           0)
++RELOC_TYPE (GOT_HI16,           0)
++RELOC_TYPE (GOT_LO16,           0)
++RELOC_TYPE (SUB,                0)
++RELOC_TYPE (INSERT_A,           0)
++RELOC_TYPE (INSERT_B,           0)
++RELOC_TYPE (DELETE,             0)
++RELOC_TYPE (HIGHER,             0)
++RELOC_TYPE (HIGHEST,            0)
++RELOC_TYPE (CALL_HI16,          0)
++RELOC_TYPE (CALL_LO16,          0)
++RELOC_TYPE (SCN_DISP,           0)
++RELOC_TYPE (REL16,              0)
++RELOC_TYPE (ADD_IMMEDIATE,      0)
++RELOC_TYPE (PJUMP,              0)
++RELOC_TYPE (RELGOT,             0)
++RELOC_TYPE (JALR,               0)
++RELOC_TYPE (TLS_DTPMOD32,       0)
++RELOC_TYPE (TLS_DTPREL32,       0)
++RELOC_TYPE (TLS_DTPMOD64,       0)
++RELOC_TYPE (TLS_DTPREL64,       0)
++RELOC_TYPE (TLS_GD,             0)
++RELOC_TYPE (TLS_LDM,            0)
++RELOC_TYPE (TLS_DTPREL_HI16,    0)
++RELOC_TYPE (TLS_DTPREL_LO16,    0)
++RELOC_TYPE (TLS_GOTTPREL,       0)
++RELOC_TYPE (TLS_TPREL32,        0)
++RELOC_TYPE (TLS_TPREL64,        0)
++RELOC_TYPE (TLS_TPREL_HI16,     0)
++RELOC_TYPE (TLS_TPREL_LO16,     0)
++
++#define NO_COPY_RELOC 1
++#define NO_RELATIVE_RELOC 1
+Index: elfutils-0.158/backends/mips_retval.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/mips_retval.c	2014-04-21 11:13:36.910235965 +0000
+@@ -0,0 +1,321 @@
++/* Function return value location for Linux/mips ABI.
++   Copyright (C) 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <string.h>
++#include <assert.h>
++#include <dwarf.h>
++#include <elf.h>
++
++#include "../libebl/libeblP.h"
++#include "../libdw/libdwP.h"
++
++#define BACKEND mips_
++#include "libebl_CPU.h"
++
++/* The ABI of the file.  Also see EF_MIPS_ABI2 above. */
++#define EF_MIPS_ABI		0x0000F000
++
++/* The original o32 abi. */
++#define E_MIPS_ABI_O32          0x00001000
++
++/* O32 extended to work on 64 bit architectures */
++#define E_MIPS_ABI_O64          0x00002000
++
++/* EABI in 32 bit mode */
++#define E_MIPS_ABI_EABI32       0x00003000
++
++/* EABI in 64 bit mode */
++#define E_MIPS_ABI_EABI64       0x00004000
++
++/* All the possible MIPS ABIs. */
++enum mips_abi
++  {
++    MIPS_ABI_UNKNOWN = 0,
++    MIPS_ABI_N32,
++    MIPS_ABI_O32,
++    MIPS_ABI_N64,
++    MIPS_ABI_O64,
++    MIPS_ABI_EABI32,
++    MIPS_ABI_EABI64,
++    MIPS_ABI_LAST
++  };
++
++/* Find the mips ABI of the current file */
++enum mips_abi find_mips_abi(Elf *elf)
++{
++  GElf_Ehdr ehdr_mem;
++  GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
++
++  if (ehdr == NULL)
++    return MIPS_ABI_LAST;
++
++  GElf_Word elf_flags = ehdr->e_flags;
++
++  /* Check elf_flags to see if it specifies the ABI being used.  */
++  switch ((elf_flags & EF_MIPS_ABI))
++    {
++    case E_MIPS_ABI_O32:
++      return MIPS_ABI_O32;
++    case E_MIPS_ABI_O64:
++      return MIPS_ABI_O64;
++    case E_MIPS_ABI_EABI32:
++      return MIPS_ABI_EABI32;
++    case E_MIPS_ABI_EABI64:
++      return MIPS_ABI_EABI64;
++    default:
++      if ((elf_flags & EF_MIPS_ABI2))
++	return MIPS_ABI_N32;
++    }
++
++  /* GCC creates a pseudo-section whose name describes the ABI.  */
++  size_t shstrndx;
++  if (elf_getshdrstrndx (elf, &shstrndx) < 0)
++    return MIPS_ABI_LAST;
++
++  const char *name;
++  Elf_Scn *scn = NULL;
++  while ((scn = elf_nextscn (elf, scn)) != NULL)
++    {
++      GElf_Shdr shdr_mem;
++      GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
++      if (shdr == NULL)
++        return MIPS_ABI_LAST;
++
++      name = elf_strptr (elf, shstrndx, shdr->sh_name) ?: "";
++      if (strncmp (name, ".mdebug.", 8) != 0)
++        continue;
++
++      if (strcmp (name, ".mdebug.abi32") == 0)
++        return MIPS_ABI_O32;
++      else if (strcmp (name, ".mdebug.abiN32") == 0)
++        return MIPS_ABI_N32;
++      else if (strcmp (name, ".mdebug.abi64") == 0)
++        return MIPS_ABI_N64;
++      else if (strcmp (name, ".mdebug.abiO64") == 0)
++        return MIPS_ABI_O64;
++      else if (strcmp (name, ".mdebug.eabi32") == 0)
++        return MIPS_ABI_EABI32;
++      else if (strcmp (name, ".mdebug.eabi64") == 0)
++        return MIPS_ABI_EABI64;
++      else
++        return MIPS_ABI_UNKNOWN;
++    }
++
++  return MIPS_ABI_UNKNOWN;
++}
++
++unsigned int
++mips_abi_regsize (enum mips_abi abi)
++{
++  switch (abi)
++    {
++    case MIPS_ABI_EABI32:
++    case MIPS_ABI_O32:
++      return 4;
++    case MIPS_ABI_N32:
++    case MIPS_ABI_N64:
++    case MIPS_ABI_O64:
++    case MIPS_ABI_EABI64:
++      return 8;
++    case MIPS_ABI_UNKNOWN:
++    case MIPS_ABI_LAST:
++    default:
++      return 0;
++    }
++}
++
++
++/* $v0 or pair $v0, $v1 */
++static const Dwarf_Op loc_intreg_o32[] =
++  {
++    { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++
++static const Dwarf_Op loc_intreg[] =
++  {
++    { .atom = DW_OP_reg2 }, { .atom = DW_OP_piece, .number = 8 },
++    { .atom = DW_OP_reg3 }, { .atom = DW_OP_piece, .number = 8 },
++  };
++#define nloc_intreg	1
++#define nloc_intregpair	4
++
++/* $f0 (float), or pair $f0, $f1 (double).
++ * f2/f3 are used for COMPLEX (= 2 doubles) returns in Fortran */
++static const Dwarf_Op loc_fpreg_o32[] =
++  {
++    { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 33 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 4 },
++    { .atom = DW_OP_regx, .number = 35 }, { .atom = DW_OP_piece, .number = 4 },
++  };
++
++/* $f0, or pair $f0, $f2.  */
++static const Dwarf_Op loc_fpreg[] =
++  {
++    { .atom = DW_OP_regx, .number = 32 }, { .atom = DW_OP_piece, .number = 8 },
++    { .atom = DW_OP_regx, .number = 34 }, { .atom = DW_OP_piece, .number = 8 },
++  };
++#define nloc_fpreg  1
++#define nloc_fpregpair 4
++#define nloc_fpregquad 8
++
++/* The return value is a structure and is actually stored in stack space
++   passed in a hidden argument by the caller.  But, the compiler
++   helpfully returns the address of that space in $v0.  */
++static const Dwarf_Op loc_aggregate[] =
++  {
++    { .atom = DW_OP_breg2, .number = 0 }
++  };
++#define nloc_aggregate 1
++
++int
++mips_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp)
++{
++  /* First find the ABI used by the elf object */
++  enum mips_abi abi = find_mips_abi(functypedie->cu->dbg->elf);
++
++  /* Something went seriously wrong while trying to figure out the ABI */
++  if (abi == MIPS_ABI_LAST)
++    return -1;
++
++  /* We couldn't identify the ABI, but the file seems valid */
++  if (abi == MIPS_ABI_UNKNOWN)
++    return -2;
++
++  /* Can't handle EABI variants */
++  if ((abi == MIPS_ABI_EABI32) || (abi == MIPS_ABI_EABI64))
++    return -2;
++
++  unsigned int regsize = mips_abi_regsize (abi);
++  if (!regsize)
++    return -2;
++
++  /* Start with the function's type, and get the DW_AT_type attribute,
++     which is the type of the return value.  */
++
++  Dwarf_Attribute attr_mem;
++  Dwarf_Attribute *attr = dwarf_attr_integrate (functypedie, DW_AT_type, &attr_mem);
++  if (attr == NULL)
++    /* The function has no return value, like a `void' function in C.  */
++    return 0;
++
++  Dwarf_Die die_mem;
++  Dwarf_Die *typedie = dwarf_formref_die (attr, &die_mem);
++  int tag = dwarf_tag (typedie);
++
++  /* Follow typedefs and qualifiers to get to the actual type.  */
++  while (tag == DW_TAG_typedef
++	 || tag == DW_TAG_const_type || tag == DW_TAG_volatile_type
++	 || tag == DW_TAG_restrict_type)
++    {
++      attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++      typedie = dwarf_formref_die (attr, &die_mem);
++      tag = dwarf_tag (typedie);
++    }
++
++  switch (tag)
++    {
++    case -1:
++      return -1;
++
++    case DW_TAG_subrange_type:
++      if (! dwarf_hasattr_integrate (typedie, DW_AT_byte_size))
++	{
++	  attr = dwarf_attr_integrate (typedie, DW_AT_type, &attr_mem);
++	  typedie = dwarf_formref_die (attr, &die_mem);
++	  tag = dwarf_tag (typedie);
++	}
++      /* Fall through.  */
++
++    case DW_TAG_base_type:
++    case DW_TAG_enumeration_type:
++    case DW_TAG_pointer_type:
++    case DW_TAG_ptr_to_member_type:
++      {
++        Dwarf_Word size;
++	if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_byte_size,
++					 &attr_mem), &size) != 0)
++	  {
++	    if (tag == DW_TAG_pointer_type || tag == DW_TAG_ptr_to_member_type)
++	      size = regsize;
++	    else
++	      return -1;
++	  }
++	if (tag == DW_TAG_base_type)
++	  {
++	    Dwarf_Word encoding;
++	    if (dwarf_formudata (dwarf_attr_integrate (typedie, DW_AT_encoding,
++					     &attr_mem), &encoding) != 0)
++	      return -1;
++
++#define ABI_LOC(loc, regsize) ((regsize) == 4 ? (loc ## _o32) : (loc))
++
++	    if (encoding == DW_ATE_float)
++	      {
++		*locp = ABI_LOC(loc_fpreg, regsize);
++		if (size <= regsize)
++		    return nloc_fpreg;
++
++		if (size <= 2*regsize)
++                  return nloc_fpregpair;
++
++		if (size <= 4*regsize && abi == MIPS_ABI_O32)
++                  return nloc_fpregquad;
++
++		goto aggregate;
++	      }
++	  }
++	*locp = ABI_LOC(loc_intreg, regsize);
++	if (size <= regsize)
++	  return nloc_intreg;
++	if (size <= 2*regsize)
++	  return nloc_intregpair;
++
++	/* Else fall through. Shouldn't happen though (at least with gcc) */
++      }
++
++    case DW_TAG_structure_type:
++    case DW_TAG_class_type:
++    case DW_TAG_union_type:
++    case DW_TAG_array_type:
++    aggregate:
++      /* XXX TODO: Can't handle structure return with other ABI's yet :-/ */
++      if ((abi != MIPS_ABI_O32) && (abi != MIPS_ABI_O64))
++        return -2;
++
++      *locp = loc_aggregate;
++      return nloc_aggregate;
++    }
++
++  /* XXX We don't have a good way to return specific errors from ebl calls.
++     This value means we do not understand the type, but it is well-formed
++     DWARF and might be valid.  */
++  return -2;
++}
+Index: elfutils-0.158/backends/mips_symbol.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ elfutils-0.158/backends/mips_symbol.c	2014-04-21 11:13:36.910235965 +0000
+@@ -0,0 +1,52 @@
++/* MIPS specific symbolic name handling.
++   Copyright (C) 2002, 2003, 2005 Red Hat, Inc.
++   This file is part of Red Hat elfutils.
++   Written by Jakub Jelinek <jakub@redhat.com>, 2002.
++
++   Red Hat elfutils 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; version 2 of the License.
++
++   Red Hat elfutils is distributed in the hope that 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 Red Hat elfutils; if not, write to the Free Software Foundation,
++   Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
++
++   Red Hat elfutils is an included package of the Open Invention Network.
++   An included package of the Open Invention Network is a package for which
++   Open Invention Network licensees cross-license their patents.  No patent
++   license is granted, either expressly or impliedly, by designation as an
++   included package.  Should you wish to participate in the Open Invention
++   Network licensing program, please visit www.openinventionnetwork.com
++   <http://www.openinventionnetwork.com>.  */
++
++#ifdef HAVE_CONFIG_H
++# include <config.h>
++#endif
++
++#include <elf.h>
++#include <stddef.h>
++
++#define BACKEND		mips_
++#include "libebl_CPU.h"
++
++/* Check for the simple reloc types.  */
++Elf_Type
++mips_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
++{
++  switch (type)
++    {
++    case R_MIPS_16:
++      return ELF_T_HALF;
++    case R_MIPS_32:
++      return ELF_T_WORD;
++    case R_MIPS_64:
++      return ELF_T_XWORD;
++    default:
++      return ELF_T_NUM;
++    }
++}
+Index: elfutils-0.158/libebl/eblopenbackend.c
+===================================================================
+--- elfutils-0.158.orig/libebl/eblopenbackend.c	2014-04-21 11:13:36.914235875 +0000
++++ elfutils-0.158/libebl/eblopenbackend.c	2014-04-21 11:13:36.910235965 +0000
+@@ -71,6 +71,8 @@
+   { "sparc", "elf_sparc", "sparc", 5, EM_SPARC, 0, 0 },
+   { "sparc", "elf_sparcv8plus", "sparc", 5, EM_SPARC32PLUS, 0, 0 },
+   { "s390", "ebl_s390", "s390", 4, EM_S390, 0, 0 },
++  { "mips", "elf_mips", "mips", 4, EM_MIPS, 0, 0 },
++  { "mips", "elf_mipsel", "mipsel", 4, EM_MIPS_RS3_LE, 0, 0 },
+ 
+   { "m32", "elf_m32", "m32", 3, EM_M32, 0, 0 },
+   { "m68k", "elf_m68k", "m68k", 4, EM_68K, 0, 0 },
+Index: elfutils-0.158/backends/common-reloc.c
+===================================================================
+--- elfutils-0.158.orig/backends/common-reloc.c	2014-04-21 11:13:36.914235875 +0000
++++ elfutils-0.158/backends/common-reloc.c	2014-04-21 11:13:36.910235965 +0000
+@@ -112,11 +112,13 @@
+ }
+ 
+ 
++#ifndef NO_COPY_RELOC
+ bool
+ EBLHOOK(copy_reloc_p) (int reloc)
+ {
+   return reloc == R_TYPE (COPY);
+ }
++#endif
+ 
+ bool
+ EBLHOOK(none_reloc_p) (int reloc)
+@@ -138,7 +140,9 @@
+   ebl->reloc_type_name = EBLHOOK(reloc_type_name);
+   ebl->reloc_type_check = EBLHOOK(reloc_type_check);
+   ebl->reloc_valid_use = EBLHOOK(reloc_valid_use);
++#ifndef NO_COPY_RELOC
+   ebl->copy_reloc_p = EBLHOOK(copy_reloc_p);
++#endif
+   ebl->none_reloc_p = EBLHOOK(none_reloc_p);
+ #ifndef NO_RELATIVE_RELOC
+   ebl->relative_reloc_p = EBLHOOK(relative_reloc_p);
+Index: elfutils-0.158/backends/Makefile.am
+===================================================================
+--- elfutils-0.158.orig/backends/Makefile.am	2014-04-21 11:13:36.914235875 +0000
++++ elfutils-0.158/backends/Makefile.am	2014-04-21 11:14:10.841468934 +0000
+@@ -33,12 +33,12 @@
+ 
+ 
+ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \
+-	  tilegx parisc
++	  tilegx parisc mips
+ libebl_pic = libebl_i386_pic.a libebl_sh_pic.a libebl_x86_64_pic.a    \
+ 	     libebl_ia64_pic.a libebl_alpha_pic.a libebl_arm_pic.a    \
+ 	     libebl_aarch64_pic.a libebl_sparc_pic.a libebl_ppc_pic.a \
+ 	     libebl_ppc64_pic.a libebl_s390_pic.a libebl_tilegx_pic.a \
+-	     libebl_parisc_pic.a
++	     libebl_parisc_pic.a libebl_mips_pic.a
+ noinst_LIBRARIES = $(libebl_pic)
+ noinst_DATA = $(libebl_pic:_pic.a=.so)
+ 
+@@ -121,6 +121,10 @@
+ libebl_parisc_pic_a_SOURCES = $(parisc_SRCS)
+ am_libebl_parisc_pic_a_OBJECTS = $(parisc_SRCS:.c=.os)
+ 
++mips_SRCS = mips_init.c mips_symbol.c mips_regs.c mips_retval.c
++libebl_mips_pic_a_SOURCES = $(mips_SRCS)
++am_libebl_mips_pic_a_OBJECTS = $(mips_SRCS:.c=.os)
++
+ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ 	@rm -f $(@:.so=.map)
+ 	echo 'ELFUTILS_$(PACKAGE_VERSION) { global: $*_init; local: *; };' \
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/mips_readelf_w.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/mips_readelf_w.patch
new file mode 100644
index 0000000..8e669e7
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/mips_readelf_w.patch
@@ -0,0 +1,22 @@
+From: Kurt Roeckx <kurt@roeckx.be>
+Subject: Make readelf -w output debug information on mips
+Bug-Debian: http://bugs.debian.org/662041
+Forwarded: not-needed
+
+Upstreams wants a change where this is handled by a hook that needs
+to be filled in by the backend for the arch.
+
+Index: elfutils-0.153/src/readelf.c
+===================================================================
+--- elfutils-0.153.orig/src/readelf.c	2012-08-10 22:01:55.000000000 +0200
++++ elfutils-0.153/src/readelf.c	2012-09-18 21:46:27.000000000 +0200
+@@ -7364,7 +7364,8 @@
+       GElf_Shdr shdr_mem;
+       GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
+ 
+-      if (shdr != NULL && shdr->sh_type == SHT_PROGBITS)
++      if (shdr != NULL && (
++	 (shdr->sh_type == SHT_PROGBITS) || (shdr->sh_type == SHT_MIPS_DWARF)))
+ 	{
+ 	  static const struct
+ 	  {
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/non_linux.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/non_linux.patch
new file mode 100644
index 0000000..35b1b38
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/non_linux.patch
@@ -0,0 +1,35 @@
+Index: elfutils-0.159/libdwfl/linux-pid-attach.c
+===================================================================
+--- elfutils-0.159.orig/libdwfl/linux-pid-attach.c
++++ elfutils-0.159/libdwfl/linux-pid-attach.c
+@@ -393,6 +393,16 @@ pid_getthread (Dwfl *dwfl __attribute__
+   return false;
+ }
+ 
++bool
++internal_function
++__libdwfl_ptrace_attach (pid_t tid __attribute__ ((unused)),
++			 bool *tid_was_stoppedp __attribute__ ((unused)))
++{
++  errno = ENOSYS;
++  __libdwfl_seterrno (DWFL_E_ERRNO);
++  return false;
++}
++
+ static bool
+ pid_memory_read (Dwfl *dwfl __attribute__ ((unused)),
+                  Dwarf_Addr addr __attribute__ ((unused)),
+@@ -419,6 +429,13 @@ pid_detach (Dwfl *dwfl __attribute__ ((u
+ {
+ }
+ 
++void
++internal_function
++__libdwfl_ptrace_detach (pid_t tid __attribute__ ((unused)),
++			 bool tid_was_stopped __attribute__ ((unused)))
++{
++}
++
+ static void
+ pid_thread_detach (Dwfl_Thread *thread __attribute__ ((unused)),
+ 		  void *thread_arg __attribute__ ((unused)))
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/redhat-portability.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/redhat-portability.diff
new file mode 100644
index 0000000..a0ff07d
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/redhat-portability.diff
@@ -0,0 +1,1021 @@
+Rebase to 1.162
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ ChangeLog                   |   30 +++++++++++++++++++++
+ backends/ChangeLog          |   12 +++++++++
+ backends/Makefile.am        |    2 +-
+ config/ChangeLog            |    4 +++
+ config/eu.am                |   14 +++++++---
+ configure.ac                |   61 +++++++++++++++++++++++++++++++++++++++++--
+ lib/ChangeLog               |    8 ++++++
+ lib/eu-config.h             |   10 +++++++
+ libasm/ChangeLog            |    5 ++++
+ libcpu/ChangeLog            |    8 ++++++
+ libcpu/i386_disasm.c        |    1 +
+ libdw/ChangeLog             |   13 +++++++++
+ libdw/dwarf_begin_elf.c     |    8 ++++++
+ libdw/libdw.h               |    2 +-
+ libdwfl/ChangeLog           |   20 ++++++++++++++
+ libdwfl/linux-core-attach.c |   29 ++++++++++++++++++++
+ libdwfl/linux-pid-attach.c  |   14 ++++++++++
+ libebl/ChangeLog            |    5 ++++
+ libelf/ChangeLog            |   10 +++++++
+ libelf/common.h             |    4 +--
+ libelf/gnuhash_xlate.h      |    6 +++--
+ src/ChangeLog               |   30 +++++++++++++++++++++
+ src/Makefile.am             |    5 ++++
+ src/addr2line.c             |    4 +--
+ src/findtextrel.c           |    6 ++++-
+ src/ld.h                    |    2 ++
+ src/readelf.c               |   15 +++++++----
+ src/strings.c               |   11 ++++++++
+ src/strip.c                 |    6 +++++
+ tests/ChangeLog             |   14 ++++++++++
+ tests/Makefile.am           |    1 +
+ tests/backtrace.c           |    1 +
+ tests/line2addr.c           |    2 +-
+ 33 files changed, 343 insertions(+), 20 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index d829783..89bfd24 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -253,6 +253,8 @@
+ 
+ 2012-01-24  Mark Wielaard  <mjw@redhat.com>
+ 
++	* configure.ac: Wrap AC_COMPILE_IFELSE sources in AC_LANG_SOURCE.
++
+ 	* COPYING: Fix address. Updated version from gnulib.
+ 
+ 2012-01-23  Mark Wielaard  <mjw@redhat.com>
+@@ -271,6 +273,9 @@
+ 
+ 2011-10-08  Mike Frysinger  <vapier@gentoo.org>
+ 
++	* configure.ac (--disable-werror): Handle it, controlling BUILD_WERROR
++	automake option.
++
+ 	* configure.ac: Fix use of AC_ARG_ENABLE to handle $enableval correctly.
+ 
+ 2011-10-02  Ulrich Drepper  <drepper@gmail.com>
+@@ -292,6 +297,10 @@
+ 
+ 	* configure.ac (LOCALEDIR, DATADIRNAME): Removed.
+ 
++2009-11-22  Roland McGrath  <roland@redhat.com>
++
++	* configure.ac: Use sed and expr instead of modern bash extensions.
++
+ 2009-09-21  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* configure.ac: Update for more modern autoconf.
+@@ -300,6 +309,10 @@
+ 
+ 	* configure.ac (zip_LIBS): Check for liblzma too.
+ 
++2009-08-17  Roland McGrath  <roland@redhat.com>
++
++	* configure.ac: Check for -fgnu89-inline; add it to WEXTRA if it works.
++
+ 2009-04-19  Roland McGrath  <roland@redhat.com>
+ 
+ 	* configure.ac (eu_version): Round down here, not in version.h macros.
+@@ -311,6 +324,8 @@
+ 
+ 2009-01-23  Roland McGrath  <roland@redhat.com>
+ 
++	* configure.ac: Check for __builtin_popcount.
++
+ 	* configure.ac (zlib check): Check for gzdirect, need zlib >= 1.2.2.3.
+ 
+ 	* configure.ac (__thread check): Use AC_LINK_IFELSE, in case of
+@@ -391,6 +406,10 @@
+ 	* configure.ac: Add dummy automake conditional to get dependencies
+ 	for non-generic linker right.  See src/Makefile.am.
+ 
++2005-11-22  Roland McGrath  <roland@redhat.com>
++
++	* configure.ac: Check for --as-needed linker option.
++
+ 2005-11-18  Roland McGrath  <roland@redhat.com>
+ 
+ 	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): New variable.
+@@ -438,6 +457,17 @@
+ 	* Makefile.am (all_SUBDIRS): Add libdwfl.
+ 	* configure.ac: Write libdwfl/Makefile.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* configure.ac (WEXTRA): Check for -Wextra and set this substitution.
++
++	* configure.ac: Check for struct stat st_?tim members.
++	* src/strip.c (process_file): Use st_?time if st_?tim are not there.
++
++	* configure.ac: Check for futimes function.
++	* src/strip.c (handle_elf) [! HAVE_FUTIMES]: Use utimes instead.
++	(handle_ar) [! HAVE_FUTIMES]: Likewise.
++
+ 2005-05-19  Roland McGrath  <roland@redhat.com>
+ 
+ 	* configure.ac [AH_BOTTOM] (INTDECL, _INTDECL): New macros.
+diff --git a/backends/ChangeLog b/backends/ChangeLog
+index fe61d9c..9599623 100644
+--- a/backends/ChangeLog
++++ b/backends/ChangeLog
+@@ -498,6 +498,10 @@
+ 	* ppc_attrs.c (ppc_check_object_attribute): Handle tag
+ 	GNU_Power_ABI_Struct_Return.
+ 
++2009-01-23  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (libebl_%.so): Use $(LD_AS_NEEDED).
++
+ 2008-10-04  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* i386_reloc.def: Fix entries for TLS_GOTDESC, TLS_DESC_CALL, and
+@@ -825,6 +829,11 @@
+ 	* sparc_init.c: Likewise.
+ 	* x86_64_init.c: Likewise.
+ 
++2005-11-22  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (LD_AS_NEEDED): New variable, substituted by configure.
++	(libebl_%.so rule): Use it in place of -Wl,--as-needed.
++
+ 2005-11-19  Roland McGrath  <roland@redhat.com>
+ 
+ 	* ppc64_reloc.def: REL30 -> ADDR30.
+@@ -847,6 +856,9 @@
+ 	* Makefile.am (uninstall): Don't try to remove $(pkgincludedir).
+ 	(CLEANFILES): Add libebl_$(m).so.
+ 
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 	* ppc_reloc.def: Update bits per Alan Modra <amodra@bigpond.net.au>.
+ 	* ppc64_reloc.def: Likewise.
+ 
+diff --git a/backends/Makefile.am b/backends/Makefile.am
+index 21d7bd2..fe920c9 100644
+--- a/backends/Makefile.am
++++ b/backends/Makefile.am
+@@ -119,7 +119,7 @@ libebl_%.so libebl_%.map: libebl_%_pic.a $(libelf) $(libdw)
+ 	$(LINK) -shared -o $(@:.map=.so) \
+ 		-Wl,--whole-archive $< $(cpu_$*) -Wl,--no-whole-archive \
+ 		-Wl,--version-script,$(@:.so=.map) \
+-		-Wl,-z,defs -Wl,--as-needed $(libelf) $(libdw)
++		-Wl,-z,defs $(LD_AS_NEEDED) $(libelf) $(libdw)
+ 	@$(textrel_check)
+ 
+ libebl_i386.so: $(cpu_i386)
+diff --git a/config/ChangeLog b/config/ChangeLog
+index 64b58e1..63b3e90 100644
+--- a/config/ChangeLog
++++ b/config/ChangeLog
+@@ -106,6 +106,10 @@
+ 
+ 	* known-dwarf.awk: Use gawk.
+ 
++2011-10-08  Mike Frysinger  <vapier@gentoo.org>
++
++	* eu.am [BUILD_WERROR]: Conditionalize -Werror use on this.
++
+ 2010-07-02  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* elfutils.spec.in: Add more BuildRequires.
+diff --git a/config/eu.am b/config/eu.am
+index 70d32de..65af085 100644
+--- a/config/eu.am
++++ b/config/eu.am
+@@ -1,6 +1,6 @@
+ ## Common automake fragments for elfutils subdirectory makefiles.
+ ##
+-## Copyright (C) 2010, 2014 Red Hat, Inc.
++## Copyright (C) 2010-2011, 2014 Red Hat, Inc.
+ ##
+ ## This file is part of elfutils.
+ ##
+@@ -29,6 +29,9 @@
+ ## not, see <http://www.gnu.org/licenses/>.
+ ##
+ 
++WEXTRA = @WEXTRA@
++LD_AS_NEEDED = @LD_AS_NEEDED@
++
+ DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"'
+ AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I..
+ 
+@@ -38,12 +41,17 @@ STACK_USAGE_WARNING=-Wstack-usage=262144
+ else
+ STACK_USAGE_WARNING=
+ endif
+-AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
++AM_CFLAGS = -std=gnu99 -Wall -Wshadow \
+ 	    $(if $($(*F)_no_Werror),,-Werror) \
+-	    $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
++	    $(if $($(*F)_no_Wunused),,-Wunused $(WEXTRA)) \
++	    $(if $($(*F)_no_Wformat),-Wno-format,-Wformat=2) \
+ 	    $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
+ 	    $($(*F)_CFLAGS)
+ 
++if BUILD_WERROR
++AM_CFLAGS += $(if $($(*F)_no_Werror),,-Werror)
++endif
++
+ COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
+ 
+ DEFS.os = -DPIC -DSHARED
+diff --git a/configure.ac b/configure.ac
+index bc9ff56..27a1ef3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -106,6 +106,55 @@ CFLAGS="$old_CFLAGS"])
+ AS_IF([test "x$ac_cv_c99" != xyes],
+       AC_MSG_ERROR([gcc with GNU99 support required]))
+ 
++AC_CACHE_CHECK([for -Wextra option to $CC], ac_cv_cc_wextra, [dnl
++old_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -Wextra"
++AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo (void) { }])],
++		  ac_cv_cc_wextra=yes, ac_cv_cc_wextra=no)
++CFLAGS="$old_CFLAGS"])
++AC_SUBST(WEXTRA)
++AS_IF([test "x$ac_cv_cc_wextra" = xyes], [WEXTRA=-Wextra], [WEXTRA=-W])
++
++AC_CACHE_CHECK([for -fgnu89-inline option to $CC], ac_cv_cc_gnu89_inline, [dnl
++old_CFLAGS="$CFLAGS"
++CFLAGS="$CFLAGS -fgnu89-inline -Werror"
++AC_COMPILE_IFELSE([AC_LANG_SOURCE([
++void foo (void)
++{
++  inline void bar (void) {}
++  bar ();
++}
++extern inline void baz (void) {}
++])], ac_cv_cc_gnu89_inline=yes, ac_cv_cc_gnu89_inline=no)
++CFLAGS="$old_CFLAGS"])
++AS_IF([test "x$ac_cv_cc_gnu89_inline" = xyes],
++      [WEXTRA="${WEXTRA:+$WEXTRA }-fgnu89-inline"])
++
++AC_CACHE_CHECK([for --as-needed linker option],
++	       ac_cv_as_needed, [dnl
++cat > conftest.c <<EOF
++int main (void) { return 0; }
++EOF
++if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS
++			    -fPIC -shared -o conftest.so conftest.c
++			    -Wl,--as-needed 1>&AS_MESSAGE_LOG_FD])
++then
++  ac_cv_as_needed=yes
++else
++  ac_cv_as_needed=no
++fi
++rm -f conftest*])
++AS_IF([test "x$ac_cv_as_needed" = xyes],
++      [LD_AS_NEEDED=-Wl,--as-needed], [LD_AS_NEEDED=])
++AC_SUBST(LD_AS_NEEDED)
++
++AC_CACHE_CHECK([for __builtin_popcount], ac_cv_popcount, [dnl
++AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[exit (__builtin_popcount (127));]])],
++	       ac_cv_popcount=yes, ac_cv_popcount=no)])
++AS_IF([test "x$ac_cv_popcount" = xyes],
++      [AC_DEFINE([HAVE_BUILTIN_POPCOUNT], [1], [Have __builtin_popcount.])])
++
++
+ AC_CACHE_CHECK([for __thread support], ac_cv_tls, [dnl
+ # Use the same flags that we use for our DSOs, so the test is representative.
+ # Some old compiler/linker/libc combinations fail some ways and not others.
+@@ -122,7 +171,10 @@ static __thread int a; int foo (int b) { return a + b; }]],
+ CFLAGS="$save_CFLAGS"
+ LDFLAGS="$save_LDFLAGS"])
+ AS_IF([test "x$ac_cv_tls" != xyes],
+-      AC_MSG_ERROR([__thread support required]))
++      [AS_IF([test "$use_locks" = yes],
++	     [AC_MSG_ERROR([--enable-thread-safety requires __thread support])],
++	     [AC_DEFINE([__thread], [/* empty: no multi-thread support */],
++			[Stubbed out if missing compiler support.])])])
+ 
+ dnl This test must come as early as possible after the compiler configuration
+ dnl tests, because the choice of the file model can (in principle) affect
+@@ -224,6 +276,11 @@ AM_CONDITIONAL(USE_VALGRIND, test "$use_valgrind" = yes)
+ AM_CONDITIONAL(BUILD_STATIC, [dnl
+ test "$use_gprof" = yes -o "$use_gcov" = yes])
+ 
++AC_ARG_ENABLE([werror],
++AS_HELP_STRING([--disable-werror],[do not build with -Werror]),
++	       [enable_werror=$enableval], [enable_werror=yes])
++AM_CONDITIONAL(BUILD_WERROR, test "$enable_werror" = yes)
++
+ AC_ARG_ENABLE([tests-rpath],
+ AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]),
+ 	       [tests_use_rpath=$enableval], [tests_use_rpath=no])
+@@ -388,7 +445,7 @@ case "$eu_version" in
+ esac
+ 
+ # Round up to the next release API (x.y) version.
+-eu_version=$(( (eu_version + 999) / 1000 ))
++eu_version=`expr \( $eu_version + 999 \) / 1000`
+ 
+ dnl Unique ID for this build.
+ MODVERSION="Build for ${LIBEBL_SUBDIR} ${eu_version} ${ac_cv_build}"
+diff --git a/lib/ChangeLog b/lib/ChangeLog
+index d04bf17..720c98d 100644
+--- a/lib/ChangeLog
++++ b/lib/ChangeLog
+@@ -73,6 +73,9 @@
+ 
+ 2009-01-23  Roland McGrath  <roland@redhat.com>
+ 
++	* eu-config.h [! HAVE_BUILTIN_POPCOUNT]
++	(__builtin_popcount): New inline function.
++
+ 	* eu-config.h: Add multiple inclusion protection.
+ 
+ 2009-01-17  Ulrich Drepper  <drepper@redhat.com>
+@@ -129,6 +132,11 @@
+ 	* Makefile.am (libeu_a_SOURCES): Add it.
+ 	* system.h: Declare crc32_file.
+ 
++2005-02-07  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-04-30  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* Makefile.am: Use -ffunction-sections for xmalloc.c.
+diff --git a/lib/eu-config.h b/lib/eu-config.h
+index 400cdc6..872f6bc 100644
+--- a/lib/eu-config.h
++++ b/lib/eu-config.h
+@@ -163,6 +163,16 @@ asm (".section predict_data, \"aw\"; .previous\n"
+ /* This macro is used by the tests conditionalize for standalone building.  */
+ #define ELFUTILS_HEADER(name) <lib##name.h>
+ 
++#ifndef HAVE_BUILTIN_POPCOUNT
++# define __builtin_popcount hakmem_popcount
++static inline unsigned int __attribute__ ((unused))
++hakmem_popcount (unsigned int x)
++{
++  /* HAKMEM 169 */
++  unsigned int n = x - ((x >> 1) & 033333333333) - ((x >> 2) & 011111111111);
++  return ((n + (n >> 3)) & 030707070707) % 63;
++}
++#endif	/* HAVE_BUILTIN_POPCOUNT */
+ 
+ #ifdef SYMBOL_VERSIONING
+ # define OLD_VERSION(name, version) \
+diff --git a/libasm/ChangeLog b/libasm/ChangeLog
+index 9b25af9..32b9fd0 100644
+--- a/libasm/ChangeLog
++++ b/libasm/ChangeLog
+@@ -87,6 +87,11 @@
+ 	* asm_error.c: Add new error ASM_E_IOERROR.
+ 	* libasmP.h: Add ASM_E_IOERROR definition.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* Makefile.am (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
+diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog
+index a20f440..5ea23b7 100644
+--- a/libcpu/ChangeLog
++++ b/libcpu/ChangeLog
+@@ -51,6 +51,9 @@
+ 
+ 2009-01-23  Roland McGrath  <roland@redhat.com>
+ 
++	* i386_disasm.c (i386_disasm): Add abort after assert-constant for old
++	compilers that don't realize it's noreturn.
++
+ 	* Makefile.am (i386_parse_CFLAGS): Use quotes around command
+ 	substitution that can produce leading whitespace.
+ 
+@@ -380,6 +383,11 @@
+ 	* defs/i386.doc: New file.
+ 	* defs/x86_64: New file.
+ 
++2005-04-04  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it instead of -Wextra.
++
+ 2005-02-15  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* Makefile (AM_CFLAGS): Add -Wunused -Wextra -Wformat=2.
+diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
+index 832241f..c7a0df0 100644
+--- a/libcpu/i386_disasm.c
++++ b/libcpu/i386_disasm.c
+@@ -822,6 +822,7 @@ i386_disasm (const uint8_t **startp, const uint8_t *end, GElf_Addr addr,
+ 
+ 			default:
+ 			  assert (! "INVALID not handled");
++			  abort ();
+ 			}
+ 		    }
+ 		  else
+diff --git a/libdw/ChangeLog b/libdw/ChangeLog
+index 487e34a..06c737b 100644
+--- a/libdw/ChangeLog
++++ b/libdw/ChangeLog
+@@ -889,6 +889,10 @@
+ 
+ 	* Makefile.am (known-dwarf.h): Run gawk on config/known-dwarf.awk.
+ 
++2011-07-20  Mark Wielaard  <mjw@redhat.com>
++
++	* dwarf_begin_elf.c: Add fallback for be64toh if not defined.
++
+ 2011-07-14  Mark Wielaard  <mjw@redhat.com>
+ 
+ 	* libdw.h (dwarf_offdie): Fix documentation to mention .debug_info.
+@@ -1248,6 +1252,10 @@
+ 
+ 	* dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
+ 
++2009-08-17  Roland McGrath  <roland@redhat.com>
++
++	* libdw.h: Disable extern inlines for GCC 4.2.
++
+ 2009-08-10  Roland McGrath  <roland@redhat.com>
+ 
+ 	* dwarf_getscopevar.c: Use dwarf_diename.
+@@ -2016,6 +2024,11 @@
+ 
+ 2005-05-31  Roland McGrath  <roland@redhat.com>
+ 
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
+ 	* dwarf_formref_die.c (dwarf_formref_die): Add CU header offset to
+ 	formref offset.
+ 
+diff --git a/libdw/dwarf_begin_elf.c b/libdw/dwarf_begin_elf.c
+index 4e0d590..a6616a1 100644
+--- a/libdw/dwarf_begin_elf.c
++++ b/libdw/dwarf_begin_elf.c
+@@ -47,6 +47,14 @@
+ #if USE_ZLIB
+ # include <endian.h>
+ # define crc32		loser_crc32
++# ifndef be64toh
++#  include <byteswap.h>
++#  if __BYTE_ORDER == __LITTLE_ENDIAN
++#   define be64toh(x) bswap_64 (x)
++#  else
++#   define be64toh(x) (x)
++#  endif
++# endif
+ # include <zlib.h>
+ # undef crc32
+ #endif
+diff --git a/libdw/libdw.h b/libdw/libdw.h
+index 473e1a2..5a511cd 100644
+--- a/libdw/libdw.h
++++ b/libdw/libdw.h
+@@ -1004,7 +1004,7 @@ extern Dwarf_OOM dwarf_new_oom_handler (Dwarf *dbg, Dwarf_OOM handler);
+ 
+ 
+ /* Inline optimizations.  */
+-#ifdef __OPTIMIZE__
++#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
+ /* Return attribute code of given attribute.  */
+ __libdw_extern_inline unsigned int
+ dwarf_whatattr (Dwarf_Attribute *attr)
+diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
+index a5253e2..59abfac 100644
+--- a/libdwfl/ChangeLog
++++ b/libdwfl/ChangeLog
+@@ -704,6 +704,21 @@
+ 	(dwfl_module_addrsym) (i_to_symfile): New function.
+ 	(dwfl_module_addrsym) (search_table): Use it.
+ 
++2013-11-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
++
++	Older OS compatibility bits.
++	* linux-core-attach.c (be64toh, le64toh, be32toh, le32toh): Provide
++	fallbacks if not defined by system.
++
++2013-11-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
++
++	Handle T-stopped detach for old kernels.
++	* linux-pid-attach.c (struct pid_arg): New field stopped.
++	(ptrace_attach): New parameter stoppedp.  Set it appropriately.
++	(pid_set_initial_registers): Pass the new field.
++	(pid_thread_detach): Handle the case of STOPPED for old kernels.
++	(__libdwfl_attach_state_for_pid): Initialize STOPPED.
++
+ 2013-11-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
+ 	    Mark Wielaard  <mjw@redhat.com>
+ 
+@@ -2469,6 +2484,11 @@
+ 
+ 2005-07-21  Roland McGrath  <roland@redhat.com>
+ 
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
++2005-07-21  Roland McGrath  <roland@redhat.com>
++
+ 	* Makefile.am (noinst_HEADERS): Add loc2c.c.
+ 
+ 	* test2.c (main): Check sscanf result to quiet warning.
+diff --git a/libdwfl/linux-core-attach.c b/libdwfl/linux-core-attach.c
+index 5a7b3b3..d05ac7e 100644
+--- a/libdwfl/linux-core-attach.c
++++ b/libdwfl/linux-core-attach.c
+@@ -29,6 +29,35 @@
+ #include "libdwflP.h"
+ #include <fcntl.h>
+ #include "system.h"
++#include <endian.h>
++#include <byteswap.h>
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++# ifndef be64toh
++#  define be64toh(x) bswap_64 (x)
++# endif
++# ifndef le64toh
++#  define le64toh(x) (x)
++# endif
++# ifndef be32toh
++#  define be32toh(x) bswap_32 (x)
++# endif
++# ifndef le32toh
++#  define le32toh(x) (x)
++# endif
++#else
++# ifndef be64toh
++#  define be64toh(x) (x)
++# endif
++# ifndef le64toh
++#  define le64toh(x) bswap_64 (x)
++# endif
++# ifndef be32toh
++#  define be32toh(x) (x)
++# endif
++# ifndef le32toh
++#  define le32toh(x) bswap_32 (x)
++# endif
++#endif
+ 
+ #include "../libdw/memory-access.h"
+ 
+diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c
+index ae71702..076b2c3 100644
+--- a/libdwfl/linux-pid-attach.c
++++ b/libdwfl/linux-pid-attach.c
+@@ -255,6 +255,11 @@ void
+ internal_function
+ __libdwfl_ptrace_detach (pid_t tid, bool tid_was_stopped)
+ {
++  // Older kernels (tested kernel-2.6.18-348.12.1.el5.x86_64) need special
++  // handling of the detachment to keep the process State: T (stopped).
++  if (tid_was_stopped)
++    syscall (__NR_tkill, tid, SIGSTOP);
++
+   /* This handling is needed only on older Linux kernels such as
+      2.6.32-358.23.2.el6.ppc64.  Later kernels such as
+      3.11.7-200.fc19.x86_64 remember the T (stopped) state
+@@ -262,6 +267,15 @@ __libdwfl_ptrace_detach (pid_t tid, bool tid_was_stopped)
+      PTRACE_DETACH.  */
+   ptrace (PTRACE_DETACH, tid, NULL,
+ 	  (void *) (intptr_t) (tid_was_stopped ? SIGSTOP : 0));
++
++  if (tid_was_stopped)
++    {
++      // Wait till the SIGSTOP settles down.
++      int i;
++      for (i = 0; i < 100000; i++)
++	if (linux_proc_pid_is_stopped (tid))
++	  break;
++    }
+ }
+ 
+ static void
+diff --git a/libebl/ChangeLog b/libebl/ChangeLog
+index 51ae60f..aee0217 100644
+--- a/libebl/ChangeLog
++++ b/libebl/ChangeLog
+@@ -780,6 +780,11 @@
+ 	* Makefile.am (libebl_*_so_SOURCES): Set to $(*_SRCS) so dependency
+ 	tracking works right.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-21  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* libebl_x86_64.map: Add x86_64_core_note.
+diff --git a/libelf/ChangeLog b/libelf/ChangeLog
+index 30017cd..9ca9c73 100644
+--- a/libelf/ChangeLog
++++ b/libelf/ChangeLog
+@@ -398,6 +398,11 @@
+ 
+ 	* elf-knowledge.h (SECTION_STRIP_P): Remove < SHT_NUM check.
+ 
++2011-03-10  Roland McGrath  <roland@redhat.com>
++
++	* gnuhash_xlate.h (elf_cvt_gnuhash): Avoid post-increment in bswap_32
++	argument, since some implementations are buggy macros.
++
+ 2011-02-26  Mark Wielaard  <mjw@redhat.com>
+ 
+ 	* elf_end.c (elf_end): Call rwlock_unlock before rwlock_fini.
+@@ -1075,6 +1080,11 @@
+ 
+ 	* elf.h: Update from glibc.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-08  Roland McGrath  <roland@redhat.com>
+ 
+ 	* elf_begin.c (read_file) [_MUDFLAP]: Don't use mmap for now.
+diff --git a/libelf/common.h b/libelf/common.h
+index 744f1bb..185ea59 100644
+--- a/libelf/common.h
++++ b/libelf/common.h
+@@ -139,7 +139,7 @@ libelf_release_all (Elf *elf)
+   (Var) = (sizeof (Var) == 1						      \
+ 	   ? (unsigned char) (Var)					      \
+ 	   : (sizeof (Var) == 2						      \
+-	      ? bswap_16 (Var)						      \
++	      ? (unsigned short int) bswap_16 (Var)			      \
+ 	      : (sizeof (Var) == 4					      \
+ 		 ? bswap_32 (Var)					      \
+ 		 : bswap_64 (Var))))
+@@ -148,7 +148,7 @@ libelf_release_all (Elf *elf)
+   (Dst) = (sizeof (Var) == 1						      \
+ 	   ? (unsigned char) (Var)					      \
+ 	   : (sizeof (Var) == 2						      \
+-	      ? bswap_16 (Var)						      \
++	      ? (unsigned short int) bswap_16 (Var)			      \
+ 	      : (sizeof (Var) == 4					      \
+ 		 ? bswap_32 (Var)					      \
+ 		 : bswap_64 (Var))))
+diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h
+index 04d9ca1..3e25936 100644
+--- a/libelf/gnuhash_xlate.h
++++ b/libelf/gnuhash_xlate.h
+@@ -1,5 +1,5 @@
+ /* Conversion functions for versioning information.
+-   Copyright (C) 2006, 2007 Red Hat, Inc.
++   Copyright (C) 2006-2011 Red Hat, Inc.
+    This file is part of elfutils.
+    Written by Ulrich Drepper <drepper@redhat.com>, 2006.
+ 
+@@ -69,7 +69,9 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
+   dest32 = (Elf32_Word *) &dest64[bitmask_words];
+   while (len >= 4)
+     {
+-      *dest32++ = bswap_32 (*src32++);
++      *dest32 = bswap_32 (*src32);
++      ++dest32;
++      ++src32;
+       len -= 4;
+     }
+ }
+diff --git a/src/ChangeLog b/src/ChangeLog
+index 15e6fae..78535c8 100644
+--- a/src/ChangeLog
++++ b/src/ChangeLog
+@@ -1598,8 +1598,16 @@
+ 	* readelf.c (attr_callback): Use print_block only when we don't use
+ 	print_ops.
+ 
++2009-08-17  Roland McGrath  <roland@redhat.com>
++
++	* ld.h: Disable extern inlines for GCC 4.2.
++
+ 2009-08-14  Roland McGrath  <roland@redhat.com>
+ 
++	* strings.c (read_block): Conditionalize posix_fadvise use
++	on [POSIX_FADV_SEQUENTIAL].
++	From Petr Salinger <Petr.Salinger@seznam.cz>.
++
+ 	* ar.c (do_oper_extract): Use pathconf instead of statfs.
+ 
+ 2009-08-01  Ulrich Drepper  <drepper@redhat.com>
+@@ -1763,6 +1771,8 @@
+ 	* readelf.c (print_debug_frame_section): Use t instead of j formats
+ 	for ptrdiff_t OFFSET.
+ 
++	* addr2line.c (handle_address): Use %a instead of %m for compatibility.
++
+ 2009-01-21  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* elflint.c (check_program_header): Fix typo in .eh_frame_hdr section
+@@ -1946,6 +1956,11 @@
+ 	that matches its PT_LOAD's p_flags &~ PF_W.  On sparc, PF_X really
+ 	is valid in RELRO.
+ 
++2008-03-01  Roland McGrath  <roland@redhat.com>
++
++	* readelf.c (dump_archive_index): Tweak portability hack
++	to match [__GNUC__ < 4] too.
++
+ 2008-02-29  Roland McGrath  <roland@redhat.com>
+ 
+ 	* readelf.c (print_attributes): Add a cast.
+@@ -2197,6 +2212,8 @@
+ 
+ 	* readelf.c (hex_dump): Fix rounding error in whitespace calculation.
+ 
++	* Makefile.am (readelf_no_Werror): New variable.
++
+ 2007-10-15  Roland McGrath  <roland@redhat.com>
+ 
+ 	* make-debug-archive.in: New file.
+@@ -2636,6 +2653,10 @@
+ 	* elflint.c (valid_e_machine): Add EM_ALPHA.
+ 	Reported by Christian Aichinger <Greek0@gmx.net>.
+ 
++	* strings.c (map_file): Define POSIX_MADV_SEQUENTIAL to
++	MADV_SEQUENTIAL if undefined.  	Don't call posix_madvise
++	if neither is defined.
++
+ 2006-08-08  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* elflint.c (check_dynamic): Don't require DT_HASH for DT_SYMTAB.
+@@ -2712,6 +2733,10 @@
+ 	* Makefile.am: Add hacks to create dependency files for non-generic
+ 	linker.
+ 
++2006-04-05  Roland McGrath  <roland@redhat.com>
++
++	* strings.c (MAP_POPULATE): Define to 0 if undefined.
++
+ 2006-06-12  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* ldgeneric.c (ld_generic_generate_sections): Don't create .interp
+@@ -3060,6 +3085,11 @@
+ 	* readelf.c (print_debug_loc_section): Fix indentation for larger
+ 	address size.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-30  Roland McGrath  <roland@redhat.com>
+ 
+ 	* readelf.c (print_debug_line_section): Print section offset of each
+diff --git a/src/Makefile.am b/src/Makefile.am
+index dbac3eb..9028aa1 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -90,6 +90,11 @@ endif
+ ldgeneric_no_Wunused = yes
+ ldgeneric_no_Wstack_usage = yes
+ 
++# Buggy old compilers or libc headers.
++readelf_no_Werror = yes
++strings_no_Werror = yes
++addr2line_no_Wformat = yes
++
+ # Bad, bad stack usage...
+ readelf_no_Wstack_usage = yes
+ nm_no_Wstack_usage = yes
+diff --git a/src/addr2line.c b/src/addr2line.c
+index 0ce854f..d2d0c8c 100644
+--- a/src/addr2line.c
++++ b/src/addr2line.c
+@@ -622,10 +622,10 @@ handle_address (const char *string, Dwfl *dwfl)
+       bool parsed = false;
+       int i, j;
+       char *name = NULL;
+-      if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
++      if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
+ 	  && string[i] == '\0')
+ 	parsed = adjust_to_section (name, &addr, dwfl);
+-      switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
++      switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
+ 	{
+ 	default:
+ 	  break;
+diff --git a/src/findtextrel.c b/src/findtextrel.c
+index 264a06b..d7de202 100644
+--- a/src/findtextrel.c
++++ b/src/findtextrel.c
+@@ -502,7 +502,11 @@ ptrcompare (const void *p1, const void *p2)
+ 
+ 
+ static void
+-check_rel (size_t nsegments, struct segments segments[nsegments],
++check_rel (size_t nsegments, struct segments segments[
++#if __GNUC__ >= 4
++						      nsegments
++#endif
++	   ],
+ 	   GElf_Addr addr, Elf *elf, Elf_Scn *symscn, Dwarf *dw,
+ 	   const char *fname, bool more_than_one, void **knownsrcs)
+ {
+diff --git a/src/ld.h b/src/ld.h
+index 29f4031..8695c31 100644
+--- a/src/ld.h
++++ b/src/ld.h
+@@ -1114,6 +1114,7 @@ extern bool dynamically_linked_p (void);
+ 
+ /* Checked whether the symbol is undefined and referenced from a DSO.  */
+ extern bool linked_from_dso_p (struct scninfo *scninfo, size_t symidx);
++#if defined __OPTIMIZE__ && !(__GNUC__ == 4 && __GNUC_MINOR__ == 2)
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
+@@ -1131,5 +1132,6 @@ linked_from_dso_p (struct scninfo *scninfo, size_t symidx)
+ 
+   return sym->defined && sym->in_dso;
+ }
++#endif	/* Optimizing and not GCC 4.2.  */
+ 
+ #endif	/* ld.h */
+diff --git a/src/readelf.c b/src/readelf.c
+index b4cb3a8..606d220 100644
+--- a/src/readelf.c
++++ b/src/readelf.c
+@@ -4364,10 +4364,12 @@ listptr_base (struct listptr *p)
+   return base;
+ }
+ 
++static const char *listptr_name;
++
+ static int
+-compare_listptr (const void *a, const void *b, void *arg)
++compare_listptr (const void *a, const void *b)
+ {
+-  const char *name = arg;
++  const char *const name = listptr_name;
+   struct listptr *p1 = (void *) a;
+   struct listptr *p2 = (void *) b;
+ 
+@@ -4463,8 +4465,11 @@ static void
+ sort_listptr (struct listptr_table *table, const char *name)
+ {
+   if (table->n > 0)
+-    qsort_r (table->table, table->n, sizeof table->table[0],
+-	     &compare_listptr, (void *) name);
++    {
++      listptr_name = name;
++      qsort (table->table, table->n, sizeof table->table[0],
++	     &compare_listptr);
++    }
+ }
+ 
+ static bool
+@@ -9561,7 +9566,7 @@ dump_archive_index (Elf *elf, const char *fname)
+ 	  if (unlikely (elf_rand (elf, as_off) == 0)
+ 	      || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
+ 			   == NULL))
+-#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7)
++#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 7) || __GNUC__ < 4
+ 	    while (1)
+ #endif
+ 	      error (EXIT_FAILURE, 0,
+diff --git a/src/strings.c b/src/strings.c
+index b2bce7b..fe0ab6c 100644
+--- a/src/strings.c
++++ b/src/strings.c
+@@ -43,6 +43,10 @@
+ 
+ #include <system.h>
+ 
++#ifndef MAP_POPULATE
++# define MAP_POPULATE 0
++#endif
++
+ 
+ /* Prototypes of local functions.  */
+ static int read_fd (int fd, const char *fname, off64_t fdlen);
+@@ -489,8 +493,13 @@ map_file (int fd, off64_t start_off, off64_t fdlen, size_t *map_sizep)
+ 		    fd, start_off);
+       if (mem != MAP_FAILED)
+ 	{
++#if !defined POSIX_MADV_SEQUENTIAL && defined MADV_SEQUENTIAL
++# define POSIX_MADV_SEQUENTIAL MADV_SEQUENTIAL
++#endif
++#ifdef POSIX_MADV_SEQUENTIAL
+ 	  /* We will go through the mapping sequentially.  */
+ 	  (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
++#endif
+ 	  break;
+ 	}
+       if (errno != EINVAL && errno != ENOMEM)
+@@ -581,9 +590,11 @@ read_block (int fd, const char *fname, off64_t fdlen, off64_t from, off64_t to)
+       elfmap_off = from & ~(ps - 1);
+       elfmap_base = elfmap = map_file (fd, elfmap_off, fdlen, &elfmap_size);
+ 
++#ifdef POSIX_FADV_SEQUENTIAL
+       if (unlikely (elfmap == MAP_FAILED))
+ 	/* Let the kernel know we are going to read everything in sequence.  */
+ 	(void) posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);
++#endif
+     }
+ 
+   if (unlikely (elfmap == MAP_FAILED))
+diff --git a/src/strip.c b/src/strip.c
+index 5e69334..8bd1790 100644
+--- a/src/strip.c
++++ b/src/strip.c
+@@ -44,6 +44,12 @@
+ #include <libebl.h>
+ #include <system.h>
+ 
++#ifdef HAVE_FUTIMES
++# define FUTIMES(fd, fname, tvp) futimes (fd, tvp)
++#else
++# define FUTIMES(fd, fname, tvp) utimes (fname, tvp)
++#endif
++
+ typedef uint8_t GElf_Byte;
+ 
+ /* Name and version of program.  */
+diff --git a/tests/ChangeLog b/tests/ChangeLog
+index 19878ac..6815028 100644
+--- a/tests/ChangeLog
++++ b/tests/ChangeLog
+@@ -609,6 +609,13 @@
+ 
+ 2013-12-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
+ 
++	Handle T-stopped detach for old kernels.
++	* backtrace.c: Include sys/syscall.h.
++	(linux_proc_pid_is_stopped): New function.
++	(ptrace_detach_stopped): Handle old kernels.
++
++2013-12-02  Jan Kratochvil  <jan.kratochvil@redhat.com>
++
+ 	* Makefile.am (check_PROGRAMS): Add backtrace, backtrace-child,
+ 	backtrace-data and backtrace-dwarf.
+ 	(BUILT_SOURCES, clean-local, backtrace-child-biarch): New.
+@@ -1473,6 +1480,8 @@
+ 
+ 2008-01-21  Roland McGrath  <roland@redhat.com>
+ 
++	* line2addr.c (main): Revert last change.
++
+ 	* testfile45.S.bz2: Add tests for cltq, cqto.
+ 	* testfile45.expect.bz2: Adjust.
+ 
+@@ -2181,6 +2190,11 @@
+ 	* Makefile.am (TESTS): Add run-elflint-test.sh.
+ 	(EXTRA_DIST): Add run-elflint-test.sh and testfile18.bz2.
+ 
++2005-05-31  Roland McGrath  <roland@redhat.com>
++
++	* Makefile.am (WEXTRA): New variable, substituted by configure.
++	(AM_CFLAGS): Use it in place of -Wextra.
++
+ 2005-05-24  Ulrich Drepper  <drepper@redhat.com>
+ 
+ 	* get-files.c (main): Use correct format specifier.
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 425f8cd..69760a4 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -382,6 +382,7 @@ get_lines_LDADD = $(libdw) $(libelf)
+ get_files_LDADD = $(libdw) $(libelf)
+ get_aranges_LDADD = $(libdw) $(libelf)
+ allfcts_LDADD = $(libdw) $(libelf)
++line2addr_no_Wformat = yes
+ line2addr_LDADD = $(libdw) $(argp_LDADD)
+ addrscopes_LDADD = $(libdw) $(argp_LDADD)
+ funcscopes_LDADD = $(libdw) $(argp_LDADD)
+diff --git a/tests/backtrace.c b/tests/backtrace.c
+index abd56ab..6a7c661 100644
+--- a/tests/backtrace.c
++++ b/tests/backtrace.c
+@@ -36,6 +36,7 @@
+ #include <fcntl.h>
+ #include <string.h>
+ #include <argp.h>
++#include <sys/syscall.h>
+ #include ELFUTILS_HEADER(dwfl)
+ 
+ #ifndef __linux__
+diff --git a/tests/line2addr.c b/tests/line2addr.c
+index e0d65d3..7c171b9 100644
+--- a/tests/line2addr.c
++++ b/tests/line2addr.c
+@@ -124,7 +124,7 @@ main (int argc, char *argv[])
+     {
+       struct args a = { .arg = argv[cnt] };
+ 
+-      switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
++      switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
+ 	{
+ 	default:
+ 	case 0:
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/scanf-format.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/scanf-format.patch
new file mode 100644
index 0000000..c08519c
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/scanf-format.patch
@@ -0,0 +1,40 @@
+From: Kurt Roeckx <kurt@roeckx.be>
+Subject: Use %m[ instead of %a[ in scanf()
+
+%a was a gnu extention, but C99 made this a float.  So it got
+changed to %m (supported by glibc 2.7), but %a[ and %as are
+still supported by glibc.  The portability branch changed this
+from %m to %a again since that's supported by more versions of
+glibc.  However gcc gives a warning about this using -Wformat
+and we have a new enough libc to use %m.
+
+Index: elfutils-0.153/src/addr2line.c
+===================================================================
+--- elfutils-0.153.orig/src/addr2line.c	2012-02-24 22:29:50.000000000 +0000
++++ elfutils-0.153/src/addr2line.c	2012-02-24 22:29:52.000000000 +0000
+@@ -455,10 +455,10 @@
+       bool parsed = false;
+       int i, j;
+       char *name = NULL;
+-      if (sscanf (string, "(%a[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
++      if (sscanf (string, "(%m[^)])%" PRIiMAX "%n", &name, &addr, &i) == 2
+ 	  && string[i] == '\0')
+ 	parsed = adjust_to_section (name, &addr, dwfl);
+-      switch (sscanf (string, "%a[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
++      switch (sscanf (string, "%m[^-+]%n%" PRIiMAX "%n", &name, &i, &addr, &j))
+ 	{
+ 	default:
+ 	  break;
+Index: elfutils-0.153/tests/line2addr.c
+===================================================================
+--- elfutils-0.153.orig/tests/line2addr.c	2012-02-24 22:29:50.000000000 +0000
++++ elfutils-0.153/tests/line2addr.c	2012-02-24 22:29:52.000000000 +0000
+@@ -132,7 +132,7 @@
+     {
+       struct args a = { .arg = argv[cnt] };
+ 
+-      switch (sscanf (a.arg, "%a[^:]:%d", &a.file, &a.line))
++      switch (sscanf (a.arg, "%m[^:]:%d", &a.file, &a.line))
+ 	{
+ 	default:
+ 	case 0:
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/testsuite-ignore-elflint.diff b/meta/recipes-devtools/elfutils/elfutils-0.163/testsuite-ignore-elflint.diff
new file mode 100644
index 0000000..eae5796
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/testsuite-ignore-elflint.diff
@@ -0,0 +1,39 @@
+On many architectures this test fails because binaries/libs produced by
+binutils don't pass elflint. However elfutils shouldn't FTBFS because of this.
+
+So we run the tests on all archs to see what breaks, but if it breaks we ignore
+the result (exitcode 77 means: this test was skipped).
+
+Index: elfutils-0.156/tests/run-elflint-self.sh
+===================================================================
+--- elfutils-0.156.orig/tests/run-elflint-self.sh	2013-07-28 14:35:36.000000000 +0200
++++ elfutils-0.156/tests/run-elflint-self.sh	2013-07-28 14:36:10.000000000 +0200
+@@ -18,4 +18,4 @@
+ 
+ . $srcdir/test-subr.sh
+ 
+-testrun_on_self ${abs_top_builddir}/src/elflint --quiet --gnu-ld
++testrun_on_self_skip ${abs_top_builddir}/src/elflint --quiet --gnu-ld
+Index: elfutils-0.156/tests/test-subr.sh
+===================================================================
+--- elfutils-0.156.orig/tests/test-subr.sh	2013-07-28 14:35:36.000000000 +0200
++++ elfutils-0.156/tests/test-subr.sh	2013-07-28 14:35:36.000000000 +0200
+@@ -149,3 +149,18 @@
+   # Only exit if something failed
+   if test $exit_status != 0; then exit $exit_status; fi
+ }
++
++# Same as testrun_on_self(), but skip on failure.
++testrun_on_self_skip()
++{
++  exit_status=0
++
++  for file in $self_test_files; do
++      testrun $* $file \
++	  || { echo "*** failure in $* $file"; exit_status=77; }
++  done
++
++  # Only exit if something failed
++  if test $exit_status != 0; then exit $exit_status; fi
++}
++
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.163/uclibc-support-for-elfutils-0.161.patch b/meta/recipes-devtools/elfutils/elfutils-0.163/uclibc-support-for-elfutils-0.161.patch
new file mode 100644
index 0000000..f1533bf
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.163/uclibc-support-for-elfutils-0.161.patch
@@ -0,0 +1,106 @@
+From 3daec2dd11a04955f95e8f65a48820103d84dbec Mon Sep 17 00:00:00 2001
+From: Junling Zheng <zhengjunling@huawei.com>
+Date: Thu, 9 Apr 2015 12:12:49 +0000
+Subject: [PATCH] uclibc support for elfutils 0.161
+
+on uclibc systems libintl and libuargp are separate from libc.
+so they need to be specified on commandline when we use proxy-libintl
+then libintl is a static archive so it should be listed last since
+elfutils does not respect disable-nls we need to link in libintl
+
+We add a new option --enable-uclibc which will be used to control
+the uclibc specific configurations during build.
+
+Upstream-Status: Inappropriate [uclibc specific]
+
+Signed-off-by: Khem Raj <raj.khem>
+Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
+[Junling Zheng:
+ - adjust context
+]
+---
+ configure.ac       | 8 ++++++++
+ libcpu/Makefile.am | 4 ++++
+ libdw/Makefile.am  | 7 ++++++-
+ libelf/Makefile.am | 5 +++++
+ 4 files changed, 23 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index a1ad6db..81fc33f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -70,6 +70,14 @@ AS_IF([test "$use_locks" = yes],
+ 
+ AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
+ 
++AC_ARG_ENABLE([uclibc],
++AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
++use_uclibc=yes, use_uclibc=no)
++AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
++AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
++
++AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
++
+ AC_PROG_CC
+ AC_PROG_RANLIB
+ AC_PROG_YACC
+diff --git a/libcpu/Makefile.am b/libcpu/Makefile.am
+index 3beccf3..9ba6c04 100644
+--- a/libcpu/Makefile.am
++++ b/libcpu/Makefile.am
+@@ -80,6 +80,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i386.mnemonics`"
+ i386_lex.o: i386_parse.h
+ i386_gendis_LDADD = $(libeu) -lm
+ 
++if USE_UCLIBC
++i386_gendis_LDADD += -luargp -lintl
++endif
++
+ i386_parse.h: i386_parse.c ;
+ 
+ EXTRA_DIST = defs/i386
+diff --git a/libdw/Makefile.am b/libdw/Makefile.am
+index 887da6b..d31b428 100644
+--- a/libdw/Makefile.am
++++ b/libdw/Makefile.am
+@@ -102,6 +102,11 @@ endif
+ libdw_pic_a_SOURCES =
+ am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
+ 
++libdw_so_LDLIBS =
++if USE_UCLIBC
++libdw_so_LDLIBS += -lintl -luargp
++endif
++
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ 	  ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
+@@ -112,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ 		-Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
+ 		-Wl,--version-script,$<,--no-undefined \
+ 		-Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
+-		-ldl $(zip_LIBS)
++		-ldl $(zip_LIBS) $(libdw_so_LDLIBS)
+ 	@$(textrel_check)
+ 	ln -fs $@ $@.$(VERSION)
+ 
+diff --git a/libelf/Makefile.am b/libelf/Makefile.am
+index afcb2aa..02836a1 100644
+--- a/libelf/Makefile.am
++++ b/libelf/Makefile.am
+@@ -93,7 +93,12 @@ libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \
+ libelf_pic_a_SOURCES =
+ am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
+ 
++
+ libelf_so_LDLIBS =
++if USE_UCLIBC
++libelf_so_LDLIBS += -lintl -luargp
++endif
++
+ if USE_LOCKS
+ libelf_so_LDLIBS += -lpthread
+ endif
+-- 
+1.8.3.4
+
diff --git a/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch b/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch
new file mode 100644
index 0000000..f861e89
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils/Fix_elf_cvt_gunhash.patch
@@ -0,0 +1,29 @@
+Fix elf_cvt_gunhash if dest and src are same.
+
+Upstream-Status: Pending
+
+The 'dest' and 'src' can be same, we need to save the value of src32[2]
+before swaping it.
+
+Signed-off-by: Baoshan Pang <BaoShan.Pang@windriver.com>
+diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h
+index 6faf113..04d9ca1 100644
+--- a/libelf/gnuhash_xlate.h
++++ b/libelf/gnuhash_xlate.h
+@@ -40,6 +40,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
+      words.  We must detangle them here.   */
+   Elf32_Word *dest32 = dest;
+   const Elf32_Word *src32 = src;
++  Elf32_Word save_src32_2 = src32[2]; // dest could be equal to src
+ 
+   /* First four control words, 32 bits.  */
+   for (unsigned int cnt = 0; cnt < 4; ++cnt)
+@@ -50,7 +51,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
+       len -= 4;
+     }
+ 
+-  Elf32_Word bitmask_words = encode ? src32[2] : dest32[2];
++  Elf32_Word bitmask_words = encode ? save_src32_2 : dest32[2];
+ 
+   /* Now the 64 bit words.  */
+   Elf64_Xword *dest64 = (Elf64_Xword *) &dest32[4];
diff --git a/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch b/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch
new file mode 100644
index 0000000..d0cd3ed
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils/dso-link-change.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+
+# This patch makes the link to the dependencies of libdw explicit, as recent
+# ld no longer implicitly links them. See
+# http://lists.fedoraproject.org/pipermail/devel/2010-March/133601.html as
+# a similar example of the error message you can encounter without this patch,
+# and https://fedoraproject.org/wiki/UnderstandingDSOLinkChange and
+# https://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking for more
+# details.
+
+--- elfutils-0.148.orig/src/Makefile.am
++++ elfutils-0.148/src/Makefile.am
+@@ -86,7 +86,7 @@ libdw = ../libdw/libdw.a $(zip_LIBS) $(l
+ libelf = ../libelf/libelf.a
+ else
+ libasm = ../libasm/libasm.so
+-libdw = ../libdw/libdw.so
++libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libelf = ../libelf/libelf.so
+ endif
+ libebl = ../libebl/libebl.a
+--- elfutils-0.148.orig/tests/Makefile.am
++++ elfutils-0.148/tests/Makefile.am
+@@ -172,7 +172,7 @@ libdw = ../libdw/libdw.a $(zip_LIBS) $(l
+ libelf = ../libelf/libelf.a
+ libasm = ../libasm/libasm.a
+ else
+-libdw = ../libdw/libdw.so
++libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
+ libelf = ../libelf/libelf.so
+ libasm = ../libasm/libasm.so
+ endif
diff --git a/meta/recipes-devtools/elfutils/elfutils/mempcpy.patch b/meta/recipes-devtools/elfutils/elfutils/mempcpy.patch
new file mode 100644
index 0000000..24e31fa
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils/mempcpy.patch
@@ -0,0 +1,24 @@
+
+uclibc does not export __mempcpy like glibc so we alias it here.
+This patch may make sense for upstream but elfutils uses more
+glibc specific features like obstack_printf which are missing in
+uclibc they need to be fixed along to make it work all the way
+
+Upstream-Status: Inappropriate[Elfutils uses more glibc specific features]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: elfutils-0.148/libelf/elf_begin.c
+===================================================================
+--- elfutils-0.148.orig/libelf/elf_begin.c
++++ elfutils-0.148/libelf/elf_begin.c
+@@ -68,6 +68,9 @@
+ #include "libelfP.h"
+ #include "common.h"
+ 
++#ifdef __UCLIBC__
++#define __mempcpy mempcpy
++#endif
+ 
+ /* Create descriptor for archive in memory.  */
+ static inline Elf *
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.148.bb b/meta/recipes-devtools/elfutils/elfutils_0.148.bb
new file mode 100644
index 0000000..0d8490d
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils_0.148.bb
@@ -0,0 +1,91 @@
+SUMMARY = "Utilities and libraries for handling compiled object files"
+HOMEPAGE = "https://fedorahosted.org/elfutils"
+SECTION = "base"
+LICENSE = "(GPL-2+ & Elfutils-Exception)"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3\
+                    file://EXCEPTION;md5=570adcb0c1218ab57f2249c67d0ce417"
+DEPENDS = "libtool bzip2 zlib virtual/libintl"
+
+PR = "r11"
+
+SRC_URI = "https://fedorahosted.org/releases/e/l/${BPN}/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "a0bed1130135f17ad27533b0034dba8d"
+SRC_URI[sha256sum] = "8aebfa4a745db21cf5429c9541fe482729b62efc7e53e9110151b4169fe887da"
+
+# pick the patch from debian
+# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.148-1.debian.tar.gz
+
+SRC_URI += "\
+        file://redhat-portability.diff \
+        file://redhat-robustify.diff \
+        file://hppa_backend.diff \
+        file://arm_backend.diff \
+        file://mips_backend.diff \
+        file://m68k_backend.diff \
+        file://testsuite-ignore-elflint.diff \
+        file://elf_additions.diff \
+        file://elfutils-fsize.patch \
+        file://remove-unused.patch \
+        file://mempcpy.patch \
+        file://fix_for_gcc-4.7.patch \
+        file://dso-link-change.patch \
+        file://nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch \
+        file://elfutils-ar-c-fix-num-passed-to-memset.patch \
+        file://Fix_elf_cvt_gunhash.patch \
+        file://elf_begin.c-CVE-2014-9447-fix.patch \
+        file://fix-build-gcc-4.8.patch \
+"
+# Only apply when building uclibc based target recipe
+SRC_URI_append_libc-uclibc = " file://uclibc-support-for-elfutils-0.148.patch"
+
+# The buildsystem wants to generate 2 .h files from source using a binary it just built,
+# which can not pass the cross compiling, so let's work around it by adding 2 .h files
+# along with the do_configure_prepend()
+
+SRC_URI += "\
+        file://i386_dis.h \
+        file://x86_64_dis.h \
+"
+inherit autotools gettext
+
+EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
+EXTRA_OECONF_append_class-native = " --without-bzlib"
+EXTRA_OECONF_append_libc-uclibc = " --enable-uclibc"
+
+do_configure_prepend() {
+    sed -i '/^i386_dis.h:/,+4 {/.*/d}' ${S}/libcpu/Makefile.am
+
+    cp ${WORKDIR}/*dis.h ${S}/libcpu
+}
+
+# we can not build complete elfutils when using uclibc
+# but some recipes e.g. gcc 4.5 depends on libelf so we
+# build only libelf for uclibc case
+
+EXTRA_OEMAKE_libc-uclibc = "-C libelf"
+EXTRA_OEMAKE_class-native = ""
+EXTRA_OEMAKE_class-nativesdk = ""
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Package utilities separately
+PACKAGES =+ "${PN}-binutils libelf libasm libdw"
+FILES_${PN}-binutils = "\
+    ${bindir}/eu-addr2line \
+    ${bindir}/eu-ld \
+    ${bindir}/eu-nm \
+    ${bindir}/eu-readelf \
+    ${bindir}/eu-size \
+    ${bindir}/eu-strip"
+
+FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
+FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
+FILES_libdw  = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
+# Some packages have the version preceeding the .so instead properly
+# versioned .so.<version>, so we need to reorder and repackage.
+#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
+#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
+
+# The package contains symlinks that trip up insane
+INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.163.bb b/meta/recipes-devtools/elfutils/elfutils_0.163.bb
new file mode 100644
index 0000000..e391813
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils_0.163.bb
@@ -0,0 +1,87 @@
+SUMMARY = "Utilities and libraries for handling compiled object files"
+HOMEPAGE = "https://fedorahosted.org/elfutils"
+SECTION = "base"
+LICENSE = "(GPLv3 & Elfutils-Exception)"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "libtool bzip2 zlib virtual/libintl"
+
+SRC_URI = "https://fedorahosted.org/releases/e/l/elfutils/${PV}/${BP}.tar.bz2"
+
+SRC_URI[md5sum] = "77ce87f259987d2e54e4d87b86cbee41"
+SRC_URI[sha256sum] = "7c774f1eef329309f3b05e730bdac50013155d437518a2ec0e24871d312f2e23"
+
+SRC_URI += "\
+        file://mempcpy.patch \
+        file://dso-link-change.patch \
+        file://Fix_elf_cvt_gunhash.patch \
+        file://fixheadercheck.patch \
+        file://0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch \
+        file://0001-remove-the-unneed-checking.patch \
+        file://0001-fix-a-stack-usage-warning.patch \
+"
+
+# pick the patch from debian
+# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.159-4.debian.tar.xz
+SRC_URI += "\
+        file://redhat-portability.diff \
+        file://hppa_backend.diff \
+        file://arm_backend.diff \
+        file://mips_backend.diff \
+        file://m68k_backend.diff \
+        file://testsuite-ignore-elflint.diff \
+        file://scanf-format.patch \
+        file://mips_readelf_w.patch \
+        file://arm_func_value.patch \
+        file://arm_unwind_ret_mask.patch \
+        file://non_linux.patch \
+"
+
+# Only apply when building uclibc based target recipe
+SRC_URI_append_libc-uclibc = " file://uclibc-support-for-elfutils-0.161.patch"
+
+# The buildsystem wants to generate 2 .h files from source using a binary it just built,
+# which can not pass the cross compiling, so let's work around it by adding 2 .h files
+# along with the do_configure_prepend()
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
+EXTRA_OECONF_append_class-native = " --without-bzlib"
+EXTRA_OECONF_append_libc-uclibc = " --enable-uclibc"
+
+do_install_append() {
+	if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
+		rm ${D}${bindir}/eu-objdump
+	fi
+}
+
+# we can not build complete elfutils when using uclibc
+# but some recipes e.g. gcc 4.5 depends on libelf so we
+# build only libelf for uclibc case
+
+EXTRA_OEMAKE_libc-uclibc = "-C libelf"
+EXTRA_OEMAKE_class-native = ""
+EXTRA_OEMAKE_class-nativesdk = ""
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Package utilities separately
+PACKAGES =+ "${PN}-binutils libelf libasm libdw"
+FILES_${PN}-binutils = "\
+    ${bindir}/eu-addr2line \
+    ${bindir}/eu-ld \
+    ${bindir}/eu-nm \
+    ${bindir}/eu-readelf \
+    ${bindir}/eu-size \
+    ${bindir}/eu-strip"
+
+FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
+FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
+FILES_libdw  = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
+# Some packages have the version preceeding the .so instead properly
+# versioned .so.<version>, so we need to reorder and repackage.
+#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
+#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
+
+# The package contains symlinks that trip up insane
+INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
diff --git a/meta/recipes-devtools/expect/expect/0001-configure.in.patch b/meta/recipes-devtools/expect/expect/0001-configure.in.patch
new file mode 100644
index 0000000..7595a25
--- /dev/null
+++ b/meta/recipes-devtools/expect/expect/0001-configure.in.patch
@@ -0,0 +1,108 @@
+Allow cross compiling.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/configure.in b/configure.in
+--- a/configure.in	2012-12-14 15:31:32.623180450 +0100
++++ b/configure.in	2012-12-14 15:53:34.518233519 +0100
+@@ -481,7 +481,7 @@
+ ,
+ 	AC_MSG_RESULT(no)
+ ,
+-	AC_MSG_ERROR([Expect can't be cross compiled])
++	AC_MSG_RESULT(no)
+ )
+ 
+ AC_MSG_CHECKING([if any value exists for WNOHANG])
+@@ -506,7 +506,9 @@
+ 	AC_MSG_RESULT(no)
+ 	AC_DEFINE(WNOHANG_BACKUP_VALUE, 1)
+ ,
+-	AC_MSG_ERROR([Expect can't be cross compiled])
++	AC_MSG_RESULT(yes)
++	AC_DEFINE_UNQUOTED(WNOHANG_BACKUP_VALUE, `cat wnohang`)
++	rm -f wnohang
+ )
+ 
+ #
+@@ -574,7 +576,8 @@
+ 	AC_DEFINE(REARM_SIG)
+ ,
+ 	AC_MSG_RESULT(no)
+-, AC_MSG_WARN([Expect can't be cross compiled])
++,
++	AC_MSG_RESULT(no)
+ )
+ 
+ # HPUX7 has trouble with the big cat so split it
+@@ -725,7 +728,9 @@
+ ,
+         AC_MSG_RESULT(no)
+ ,
+-	AC_MSG_ERROR([Expect can't be cross compiled])
++        AC_MSG_RESULT(yes)
++        AC_DEFINE(HAVE_SGTTYB)
++        PTY_TYPE=sgttyb
+ )
+ 
+ # mach systems have include files for unimplemented features
+@@ -749,7 +754,9 @@
+ ,
+         AC_MSG_RESULT(no)
+ ,
+-	AC_MSG_ERROR([Expect can't be cross compiled])
++        AC_DEFINE(HAVE_TERMIO)
++        PTY_TYPE=termios
++        AC_MSG_RESULT(yes)
+ )
+ 
+   # now check for the new style ttys (not yet posix)
+@@ -771,7 +778,9 @@
+   ,
+         AC_MSG_RESULT(no)
+   ,
+-	AC_MSG_ERROR([Expect can't be cross compiled])
++        AC_DEFINE(HAVE_TERMIOS)
++        PTY_TYPE=termios
++        AC_MSG_RESULT(yes)
+   )
+ fi
+ 
+@@ -794,7 +803,7 @@
+ ,
+ 	AC_MSG_RESULT(no)
+ ,
+-	AC_MSG_ERROR([Expect can't be cross compiled])
++	AC_MSG_RESULT(no)
+ )
+ 
+ AC_MSG_CHECKING([if TIOCGWINSZ in termios.h])
+@@ -816,7 +825,7 @@
+ ,
+ 	AC_MSG_RESULT(no)
+ ,
+-	AC_MSG_ERROR([Expect can't be cross compiled])
++	AC_MSG_RESULT(no)
+ )
+ 
+ # finally check for Cray style ttys
+@@ -837,7 +846,7 @@
+ ,
+ 	AC_MSG_RESULT(no)
+ ,
+-	AC_MSG_ERROR([Expect can't be cross compiled])
++	AC_MSG_RESULT(no)
+ )
+ 
+ #
+@@ -889,7 +898,8 @@
+ 	AC_MSG_RESULT(yes),
+ 	AC_MSG_RESULT(no)
+ ,
+-	AC_MSG_ERROR([Expect can't be cross compiled])
++	AC_DEFINE(HAVE_SV_TIMEZONE)
++	AC_MSG_RESULT(yes),
+ )
+ 
+ 
diff --git a/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch b/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch
new file mode 100644
index 0000000..274ad86
--- /dev/null
+++ b/meta/recipes-devtools/expect/expect/0001-expect-install-scripts-without-using-the-fixline1-tc.patch
@@ -0,0 +1,34 @@
+Upstream-Status: Inappropriate [wrlinux specific]
+
+Subject: expect: install scripts without using the fixline1 tcl script
+
+On older machines like SLED11.2, we are encountering do_install failures
+complaining that 'GLIBC_2.14' is not found in /lib64/libc.so.6 but is required
+by libtcl8.6.so.0.
+
+This is because that we're executing the fixline1 tcl script which requires
+libtcl8.6.so.0 in sysroot. However, all commands in SCRIPTS already have got
+the correct first line, that is '#!/bin/sh'. We don't need to modify anything.
+That's why we could just copy them.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ Makefile.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index c05c880..f1394ff 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -380,7 +380,7 @@ dist: dist-clean doc
+ 	cp $(DIST_ROOT)/$(PKG_DIR).tar.gz $(top_builddir)
+ 
+ $(SCRIPTS):
+-	$(TCLSH) $(srcdir)/fixline1 $(SHORT_BINDIR) < $(srcdir)/example/$@ > $@
++	cp $(srcdir)/example/$@ $@
+ 
+ ## We cannot use TCL_LIBS below (after TCL_LIB_SPEC) because its
+ ## expansion references the contents of LIBS, which contains linker
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch b/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch
new file mode 100644
index 0000000..dc4c6ba
--- /dev/null
+++ b/meta/recipes-devtools/expect/expect/0002-tcl.m4.patch
@@ -0,0 +1,17 @@
+Use proper -L path when cross compiling.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/tclconfig/tcl.m4 b/tclconfig/tcl.m4
+--- a/tclconfig/tcl.m4	2012-12-14 09:16:58.789861281 +0100
++++ b/tclconfig/tcl.m4	2012-12-14 10:55:43.542297010 +0100
+@@ -371,7 +371,7 @@
+     # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC
+     # instead of TCL_BUILD_LIB_SPEC since it will work with both an
+     # installed and uninstalled version of Tcl.
+-    if test -f "${TCL_BIN_DIR}/Makefile" ; then
++    if test -f "${TCL_BIN_DIR}/Makefile" || test "$cross_compiling" = yes; then
+         TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
+         TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
+         TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
diff --git a/meta/recipes-devtools/expect/expect/01-example-shebang.patch b/meta/recipes-devtools/expect/expect/01-example-shebang.patch
new file mode 100644
index 0000000..8597f31
--- /dev/null
+++ b/meta/recipes-devtools/expect/expect/01-example-shebang.patch
@@ -0,0 +1,144 @@
+Author: Mike Markley <mike@markley.org>
+Author: Sergei Golovan <sgolovan@debian.org>
+Description: Fixes shebangs in examples (Closes: #152367).
+
+Backported from Debian
+
+Upstream-Status: Pending
+Index: expect5.45/example/beer.exp
+===================================================================
+--- expect5.45.orig/example/beer.exp	2006-01-25 13:51:39.000000000 -0800
++++ expect5.45/example/beer.exp	2013-11-01 17:35:19.817318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect -f
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+ 
+ # 99 bottles of beer on the wall, Expect-style
+ # Author: Don Libes <libes@nist.gov>
+Index: expect5.45/example/expectd.proto
+===================================================================
+--- expect5.45.orig/example/expectd.proto	2010-07-02 09:03:31.000000000 -0700
++++ expect5.45/example/expectd.proto	2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,10 @@
+-#!/depot/tcl/src/expect/e --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
++
+ # Description: Simple fragment to begin a telnet daemon
+ # For more information, see Chapter 17 of "Exploring Expect"
+ # Author: Don Libes, NIST
+Index: expect5.45/example/irsh
+===================================================================
+--- expect5.45.orig/example/irsh	2010-07-02 09:03:31.000000000 -0700
++++ expect5.45/example/irsh	2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+ 
+ # Do rsh interactively.  For example, consider the following command:
+ #    rsh <remote> ls -l "|" more
+Index: expect5.45/example/passwd.cgi
+===================================================================
+--- expect5.45.orig/example/passwd.cgi	2000-01-06 15:22:07.000000000 -0800
++++ expect5.45/example/passwd.cgi	2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+ 
+ # This is a CGI script to process requests created by the accompanying
+ # passwd.html form.  This script is pretty basic, although it is
+Index: expect5.45/example/passwdprompt
+===================================================================
+--- expect5.45.orig/example/passwdprompt	2003-09-05 12:01:59.000000000 -0700
++++ expect5.45/example/passwdprompt	2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+ 
+ # This script prompts for a passwd from stdin while echoing *'s
+ 
+Index: expect5.45/example/reprompt
+===================================================================
+--- expect5.45.orig/example/reprompt	2000-01-06 15:22:07.000000000 -0800
++++ expect5.45/example/reprompt	2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+ 
+ # Name: reprompt
+ # Description: reprompt every so often until user enters something
+Index: expect5.45/example/term_expect
+===================================================================
+--- expect5.45.orig/example/term_expect	2005-02-15 10:11:31.000000000 -0800
++++ expect5.45/example/term_expect	2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expectk
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec wish "$0" ${1+"$@"}
++
++package require Expect
+ 
+ # Name: tkterm - terminal emulator using Expect and Tk text widget, v3.0
+ # Author: Don Libes, July '94
+Index: expect5.45/example/vrfy
+===================================================================
+--- expect5.45.orig/example/vrfy	2010-07-02 09:03:31.000000000 -0700
++++ expect5.45/example/vrfy	2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,9 @@
+-#!/depot/path/expect -f
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
+ 
+ 
+ # separate address into user and host
+Index: expect5.45/example/xrlogin
+===================================================================
+--- expect5.45.orig/example/xrlogin	2000-01-06 15:22:08.000000000 -0800
++++ expect5.45/example/xrlogin	2013-11-01 17:35:19.821318341 -0700
+@@ -1,4 +1,10 @@
+-#!/depot/path/expect --
++#!/bin/sh
++# -*- tcl -*-
++# The next line is executed by /bin/sh, but not tcl \
++exec tclsh "$0" ${1+"$@"}
++
++package require Expect
++
+ # xrlogin - rlogin but with current DISPLAY
+ #
+ # You can extend this idea to save any arbitrary information across rlogin
diff --git a/meta/recipes-devtools/expect/expect_5.45.bb b/meta/recipes-devtools/expect/expect_5.45.bb
new file mode 100644
index 0000000..3c2aab4
--- /dev/null
+++ b/meta/recipes-devtools/expect/expect_5.45.bb
@@ -0,0 +1,64 @@
+SUMMARY = "tool for automating interactive applications according to a script"
+DESCRIPTION = "Expect is a tool for automating interactive applications according to a script. \
+Following the script, Expect knows what can be expected from a program and what \
+the correct response should be. Expect is also useful for testing these same \
+applications. And by adding Tk, you can also wrap interactive applications in \
+X11 GUIs. An interpreted language provides branching and high-level control \
+structures to direct the dialogue. In addition, the user can take control and \
+interact directly when desired, afterward returning control to the script. \
+"
+HOMEPAGE = "http://sourceforge.net/projects/expect/"
+LICENSE = "PD"
+SECTION = "devel"
+
+LIC_FILES_CHKSUM = "file://license.terms;md5=fbf2de7e9102505b1439db06fc36ce5c"
+
+DEPENDS += "tcl"
+RDEPENDS_${PN} = "tcl"
+
+inherit autotools
+
+PR = "r1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/expect/Expect/${PV}/${BPN}${PV}.tar.gz \
+           file://0001-configure.in.patch \
+           file://0002-tcl.m4.patch \
+           file://01-example-shebang.patch \
+           file://0001-expect-install-scripts-without-using-the-fixline1-tc.patch \
+          "
+SRC_URI[md5sum] = "44e1a4f4c877e9ddc5a542dfa7ecc92b"
+SRC_URI[sha256sum] = "b28dca90428a3b30e650525cdc16255d76bb6ccd65d448be53e620d95d5cc040"
+
+S = "${WORKDIR}/${BPN}${PV}"
+
+do_install_append() {
+	install -d ${D}${libdir}
+        install -m 0755 ${D}${libdir}/expect${PV}/libexpect*.so   ${D}${libdir}/
+        install -m 0755 ${S}/fixline1           ${D}${libdir}/expect${PV}/
+        install -m 0755 ${S}/example/*          ${D}${libdir}/expect${PV}/
+        rm ${D}${libdir}/expect${PV}/libexpect*.so
+        sed -e 's|$dir|${libdir}|' -i ${D}${libdir}/expect${PV}/pkgIndex.tcl
+}
+
+EXTRA_OECONF += "--with-tcl=${STAGING_LIBDIR} \
+                 --with-tclinclude=${STAGING_INCDIR}/tcl8.6 \
+                 --enable-shared \
+                 --enable-threads \
+                 --disable-rpath \
+                "
+EXTRA_OEMAKE_install = " 'SCRIPTS=' "
+
+FILES_${PN}-dbg += "${libdir}/${BPN}${PV}/.debug \
+                    ${libdir}/.debug \
+                   "
+FILES_${PN}-dev = "${libdir_native}/expect${PV}/libexpect*.so \
+                   ${includedir}/expect.h \
+                   ${includedir}/expect_tcl.h \
+                   ${includedir}/expect_comm.h \
+                   ${includedir}/tcldbg.h \
+                   ${includedir}/*.h \
+                  "
+
+FILES_${PN} += "${libdir}/libexpect${PV}.so \
+                ${libdir}/expect${PV}/* \
+               "
diff --git a/meta/recipes-devtools/fdisk/gptfdisk_1.0.0.bb b/meta/recipes-devtools/fdisk/gptfdisk_1.0.0.bb
new file mode 100644
index 0000000..f4b0e32
--- /dev/null
+++ b/meta/recipes-devtools/fdisk/gptfdisk_1.0.0.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "GPT fdisk is a disk partitioning tool loosely modeled on Linux fdisk, but used for modifying GUID Partition Table (GPT) disks. The related FixParts utility fixes some common problems on Master Boot Record (MBR) disks."
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+DEPENDS = "util-linux popt ncurses"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${PV}/${BP}.tar.gz"
+SRC_URI[md5sum] = "2061f917af084215898d4fea04d8388f"
+SRC_URI[sha256sum] = "5b66956743a799fc0471cdb032665c1391e82f9c5b3f1d7d726d29fe2ba01d6c"
+
+do_install() {
+    install -d ${D}${sbindir}
+    install -m 0755 cgdisk ${D}${sbindir}
+    install -m 0755 gdisk ${D}${sbindir}
+    install -m 0755 sgdisk ${D}${sbindir}
+    install -m 0755 fixparts ${D}${sbindir}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch b/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch
new file mode 100644
index 0000000..8a16b2c
--- /dev/null
+++ b/meta/recipes-devtools/file/file/0001-Add-P-prompt-into-Usage-info.patch
@@ -0,0 +1,39 @@
+From 08abf944b2bff27b6dd325dd15b4861cebef113a Mon Sep 17 00:00:00 2001
+From: Junling Zheng <zhengjunling@huawei.com>
+Date: Wed, 8 Apr 2015 03:26:57 +0000
+Subject: [PATCH] Add -P prompt into Usage info
+
+Currently, Usage info doesn't include -P prompt, add it:
+
+root@arma9el:~# file
+Usage: file [-bcEhikLlNnprsvz0] [--apple] [--mime-encoding] [--mime-type]
+            [-e testname] [-F separator] [-f namefile] [-m magicfiles]
+            [-P parameter=limits] file ...
+       file -C [-m magicfiles]
+       file [--help]
+
+Upstream-Status: Submitted
+
+Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
+---
+ src/file.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/file.c b/src/file.c
+index 2b15e21..e5a957b 100644
+--- a/src/file.c
++++ b/src/file.c
+@@ -76,8 +76,8 @@ int getopt_long(int argc, char * const *argv, const char *optstring, const struc
+ # define USAGE  \
+     "Usage: %s [" FILE_FLAGS \
+ 	"] [--apple] [--extension] [--mime-encoding] [--mime-type]\n" \
+-    "            [-e testname] [-F separator] [-f namefile] [-m magicfiles] " \
+-    "file ...\n" \
++    "            [-e testname] [-F separator] [-f namefile] [-m magicfiles]\n " \
++    "            [-P parameter=limits] file ...\n" \
+     "       %s -C [-m magicfiles]\n" \
+     "       %s [--help]\n"
+ 
+-- 
+1.8.3.4
+
diff --git a/meta/recipes-devtools/file/file/debian-742262.patch b/meta/recipes-devtools/file/file/debian-742262.patch
new file mode 100644
index 0000000..1ef485e
--- /dev/null
+++ b/meta/recipes-devtools/file/file/debian-742262.patch
@@ -0,0 +1,19 @@
+The awk pattern was checked *before* the Perl pattern, so the perl
+script with BEGIN{...} would be reported as awk, this patch fixes it.
+
+Upstream-Status: Backport [debian]
+
+Signed-off-by: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+diff --git a/magic/Magdir/commands b/magic/Magdir/commands
+--- a/magic/Magdir/commands
++++ b/magic/Magdir/commands
+@@ -57,6 +57,7 @@
+ 0	string/wt	#!\ /usr/bin/awk	awk script text executable
+ !:mime	text/x-awk
+ 0	regex/4096	=^\\s{0,100}BEGIN\\s{0,100}[{]	awk or perl script text
++!:strength - 12
+ 
+ # AT&T Bell Labs' Plan 9 shell
+ 0	string/wt	#!\ /bin/rc	Plan 9 rc shell script text executable
diff --git a/meta/recipes-devtools/file/file_5.24.bb b/meta/recipes-devtools/file/file_5.24.bb
new file mode 100644
index 0000000..08b95d7
--- /dev/null
+++ b/meta/recipes-devtools/file/file_5.24.bb
@@ -0,0 +1,36 @@
+SUMMARY = "File classification tool"
+DESCRIPTION = "File attempts to classify files depending \
+on their contents and prints a description if a match is found."
+HOMEPAGE = "http://www.darwinsys.com/file/"
+SECTION = "console/utils"
+
+# two clause BSD
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;beginline=2;md5=6a7382872edb68d33e1a9398b6e03188"
+
+DEPENDS = "zlib file-native"
+DEPENDS_class-native = "zlib-native"
+
+SRC_URI = "git://github.com/file/file.git \
+        file://debian-742262.patch \
+        file://0001-Add-P-prompt-into-Usage-info.patch \
+        "
+
+SRCREV = "3c0874be4d3232d672b20f513451a39cfd7c585a"
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+FILES_${PN} += "${datadir}/misc/*.mgc"
+
+do_install_append_class-native() {
+	create_cmdline_wrapper ${D}/${bindir}/file \
+		--magic-file ${datadir}/misc/magic.mgc
+}
+
+do_install_append_class-nativesdk() {
+	create_cmdline_wrapper ${D}/${bindir}/file \
+		--magic-file ${datadir}/misc/magic.mgc
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/flex/files/do_not_create_pdf_doc.patch b/meta/recipes-devtools/flex/files/do_not_create_pdf_doc.patch
new file mode 100644
index 0000000..032833a
--- /dev/null
+++ b/meta/recipes-devtools/flex/files/do_not_create_pdf_doc.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate (embedded specific)
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: flex-2.5.37/doc/Makefile.am
+===================================================================
+--- flex-2.5.37.orig/doc/Makefile.am	2012-07-21 04:18:27.000000000 +0300
++++ flex-2.5.37/doc/Makefile.am	2013-07-30 17:57:09.834834531 +0300
+@@ -2,7 +2,7 @@
+ 
+ info_TEXINFOS =	flex.texi
+ dist_man_MANS = flex.1
+-dist_doc_DATA= flex.pdf
++EXTRA_DIST= flex.pdf
+ 
+ CLEANFILES = \
+ 	flex.hks \
diff --git a/meta/recipes-devtools/flex/files/run-ptest b/meta/recipes-devtools/flex/files/run-ptest
new file mode 100755
index 0000000..bffba16
--- /dev/null
+++ b/meta/recipes-devtools/flex/files/run-ptest
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+test1="test-alloc-extra test-array-nr test-array-r test-basic-nr test-basic-r test-extended test-quotes \
+test-bison-nr test-bison-yylloc test-bison-yylval test-c++-basic test-c-cpp-nr test-prefix-nr test-ccl \
+test-c-cpp-r test-c++-multiple-scanners test-mem-r test-mem-nr test-debug-nr test-linedir-r test-noansi-r \
+test-yyextra test-header-r test-noansi-nr test-debug-r TEMPLATE test-top test-header-nr test-prefix-r"
+test2="test-multiple-scanners-nr test-posixly-correct test-posix test-string-r test-string-nr"
+test3="test-pthread test-include-by-push test-include-by-buffer test-include-by-reentrant"
+test4="test-lineno-nr test-lineno-r test-lineno-trailing"
+test5="test-c++-yywrap test-rescan-r test-rescan-nr"
+test6="test-reject-nr test-reject-r"
+test7="test-reject-ser test-reject-ver"
+test8="test-multiple-scanners-r"
+
+output() {
+  if [ $? -eq 0 ]; \
+    then echo "PASS: $i"; \
+    else echo "FAIL: $i"; \
+  fi;
+}
+
+for i in $test1; do $i/$i < $i/test.input >/dev/null; output; done
+for i in $test2; do $i/$i >/dev/null; output; done
+for i in $test3; do cd $i; ./$i test-1.input >/dev/null; output; cd ..; done
+for i in $test4; do test `$i/$i < $i/test.input` -eq `$i/$i 1 < $i/test.input` >/dev/null; output; done
+for i in $test5; do $i/$i $i/test.input >/dev/null; output; done
+for i in $test6; do test-reject/$i < test-reject/test.input >/dev/null; output; done
+for i in $test7; do test-reject/$i test-reject/$i.tables < test-reject/test.input >/dev/null; output; done
+cd $test8; ./$test8 >/dev/null; i=$test8 output
diff --git a/meta/recipes-devtools/flex/flex.inc b/meta/recipes-devtools/flex/flex.inc
new file mode 100644
index 0000000..a4a26e2
--- /dev/null
+++ b/meta/recipes-devtools/flex/flex.inc
@@ -0,0 +1,44 @@
+SUMMARY = "Flex (The Fast Lexical Analyzer)"
+DESCRIPTION = "Flex is a fast lexical analyser generator.  Flex is a tool for generating programs that recognize \
+lexical patterns in text."
+HOMEPAGE = "http://sourceforge.net/projects/flex/"
+
+SECTION = "devel"
+LICENSE = "BSD"
+DEPENDS += "${@'bison-native flex-native' if '${PTEST_ENABLED}' == '1' else ''}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/flex/flex-${PV}.tar.bz2 \
+           file://run-ptest \
+"
+
+inherit autotools gettext texinfo ptest
+
+
+M4 = "${bindir}/m4"
+M4_class-native = "${STAGING_BINDIR_NATIVE}/m4"
+
+EXTRA_OECONF += "ac_cv_path_M4=${M4}"
+EXTRA_OEMAKE += "m4=${STAGING_BINDIR_NATIVE}/m4"
+
+do_install_append_class-native() {
+	create_wrapper ${D}/${bindir}/flex M4=${M4}
+}
+
+do_install_append_class-nativesdk() {
+	create_wrapper ${D}/${bindir}/flex M4=${M4}
+}
+
+RDEPENDS_${PN} += "m4"
+
+do_compile_ptest() {
+	for i in `find ${S}/tests/ -type d |grep -Ev "concatenated-options|reject|table-opts" | awk -F/ '{print $NF}'`; \
+	  do oe_runmake -C ${S}/tests/$i -f ${B}/tests/$i/Makefile top_builddir=${B} FLEX=flex $i; \
+	done
+	oe_runmake -C ${S}/tests/test-reject -f ${B}/tests/test-reject/Makefile top_builddir=${B} FLEX=flex test-reject-nr test-reject-r test-reject-ser test-reject-ver
+}
+
+do_install_ptest() {
+	for i in `find ${S}/tests/ -type d | awk -F/ '{print $NF}'`; \
+	  do cp -r ${S}/tests/$i ${D}${PTEST_PATH}; \
+	done
+}
diff --git a/meta/recipes-devtools/flex/flex_2.5.39.bb b/meta/recipes-devtools/flex/flex_2.5.39.bb
new file mode 100644
index 0000000..7485743
--- /dev/null
+++ b/meta/recipes-devtools/flex/flex_2.5.39.bb
@@ -0,0 +1,9 @@
+require flex.inc
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e4742cf92e89040b39486a6219b68067"
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI += "file://do_not_create_pdf_doc.patch"
+
+SRC_URI[md5sum] = "77d44c6bb8c0705e0017ab9a84a1502b"
+SRC_URI[sha256sum] = "add2b55f3bc38cb512b48fad7d72f43b11ef244487ff25fc00aabec1e32b617f"
diff --git a/meta/recipes-devtools/gcc/gcc-4.8.inc b/meta/recipes-devtools/gcc/gcc-4.8.inc
new file mode 100644
index 0000000..6a2454d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8.inc
@@ -0,0 +1,118 @@
+require gcc-common.inc
+
+# Third digit in PV should be incremented after a minor release
+
+PV = "4.8.4"
+
+# BINV should be incremented to a revision after a minor gcc release
+
+BINV = "4.8.4"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.8:"
+
+DEPENDS =+ "mpfr gmp libmpc zlib"
+NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native"
+
+LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
+
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+    file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
+"
+
+SRC_URI = "\
+    ${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
+    file://0002-uclibc-conf.patch \
+    file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
+    file://0004-uclibc-locale.patch \
+    file://0005-uclibc-locale-no__x.patch \
+    file://0006-uclibc-locale-wchar_fix.patch \
+    file://0007-uclibc-locale-update.patch \
+    file://0008-missing-execinfo_h.patch \
+    file://0009-c99-snprintf.patch \
+    file://0010-c99-complex-ugly-hack.patch \
+    file://0011-index_macro.patch \
+    file://0012-libmudflap-susv3-legacy.patch \
+    file://0013-libstdc-namespace.patch \
+    file://0014-sh-pr24836.patch \
+    file://0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch \
+    file://0016-gcc-poison-system-directories.patch \
+    file://0017-gcc-poison-dir-extend.patch \
+    file://0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+    file://0019-64-bit-multilib-hack.patch \
+    file://0020-optional-libstdc.patch \
+    file://0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+    file://0022-COLLECT_GCC_OPTIONS.patch \
+    file://0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+    file://0024-PR-target-32219.patch \
+    file://0025-fortran-cross-compile-hack.patch \
+    file://0026-libgcc-sjlj-check.patch \
+    file://0027-cpp-honor-sysroot.patch \
+    file://0028-MIPS64-Default-to-N64-ABI.patch \
+    file://0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+    file://0030-gcc-Fix-argument-list-too-long-error.patch \
+    file://0031-Disable-sdt.patch \
+    file://0032-libtool.patch \
+    file://0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+    file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+    file://0035-wcast-qual-PR-55383.patch \
+    file://0038-gcc-4.8-build-args.patch \
+    file://0040-fix-g++-sysroot.patch \
+    file://0041-libtool-avoid-libdir.patch \
+    file://0042-pr57748.patch \
+    file://0043-cpp.patch \
+    file://0044-gengtypes.patch \
+    file://0046-libatomic-deptracking.patch \
+    file://0047-repomembug.patch \
+    file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+    file://target-gcc-includedir.patch \
+"
+SRC_URI[md5sum] = "5a84a30839b2aca22a2d723de2a626ec"
+SRC_URI[sha256sum] = "4a80aa23798b8e9b5793494b8c976b39b8d9aa2e53cd5ed5534aff662a7f8695"
+
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+# Language Overrides
+FORTRAN = ""
+JAVA = ""
+
+LTO = "--enable-lto"
+
+EXTRA_OECONF_BASE = "\
+    ${LTO} \
+    --enable-libssp \
+    --disable-bootstrap \
+    --disable-libmudflap \
+    --with-system-zlib \
+    --with-linker-hash-style=${LINKER_HASH_STYLE} \
+    --enable-linker-build-id \
+    --with-ppl=no \
+    --with-cloog=no \
+    --enable-checking=release \
+    --enable-cheaders=c_global \
+"
+
+EXTRA_OECONF_INITIAL = "\
+    --disable-libmudflap \
+    --disable-libgomp \
+    --disable-libssp \
+    --disable-libquadmath \
+    --with-system-zlib \
+    --disable-lto \
+    --disable-plugin \
+    --enable-decimal-float=no \
+"
+
+EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
+
+EXTRA_OECONF_PATHS = "\ 
+    --with-gxx-include-dir=${STAGING_DIR_TARGET}${target_includedir}/c++/${BINV} \ 
+    --with-sysroot=${STAGING_DIR_TARGET} \ 
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.8/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000..e588011
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
@@ -0,0 +1,42 @@
+From bf3d96ae58fa180b8b468d25dc2e0209daca2751 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:37:11 +0400
+Subject: [PATCH 01/35] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ configure    |    2 +-
+ configure.ac |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index d809535..1b76c90 100755
+--- a/configure
++++ b/configure
+@@ -7439,7 +7439,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+ 
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+  *" newlib "*)
+   case " $target_configargs " in
+diff --git a/configure.ac b/configure.ac
+index 48ec1aa..89d1d3f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2873,7 +2873,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+ 
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+  *" newlib "*)
+   case " $target_configargs " in
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0002-uclibc-conf.patch b/meta/recipes-devtools/gcc/gcc-4.8/0002-uclibc-conf.patch
new file mode 100644
index 0000000..dda3b10
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0002-uclibc-conf.patch
@@ -0,0 +1,53 @@
+From d030973c872c00d916921d84deee0af2c0d38081 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:38:25 +0400
+Subject: [PATCH 02/35] uclibc-conf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ contrib/regression/objs-gcc.sh |    4 ++++
+ libjava/classpath/ltconfig     |    4 ++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497..6dc7ead 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+  then
+   make all-gdb all-dejagnu all-ld || exit 1
+   make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++  make all-gdb all-dejagnu all-ld || exit 1
++  make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+   make bootstrap || exit 1
+   make install || exit 1
+diff --git a/libjava/classpath/ltconfig b/libjava/classpath/ltconfig
+index 743d951..ae4ea60 100755
+--- a/libjava/classpath/ltconfig
++++ b/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ 
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+ 
+@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   version_type=linux
+   need_lib_prefix=no
+   need_version=no
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/meta/recipes-devtools/gcc/gcc-4.8/0003-gcc-uclibc-locale-ctype_touplow_t.patch
new file mode 100644
index 0000000..7098e99
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0003-gcc-uclibc-locale-ctype_touplow_t.patch
@@ -0,0 +1,87 @@
+From d2d9dd756c4356d14dd7ae003856344cb4f37985 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:40:12 +0400
+Subject: [PATCH 03/35] gcc-uclibc-locale-ctype_touplow_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/generic/c_locale.cc |    5 +++++
+ libstdc++-v3/config/locale/generic/c_locale.h  |    9 +++++++++
+ libstdc++-v3/config/os/gnu-linux/ctype_base.h  |    9 +++++++++
+ 3 files changed, 23 insertions(+)
+
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
+index 0d309a5..f2f1e1f 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.cc
++++ b/libstdc++-v3/config/locale/generic/c_locale.cc
+@@ -263,5 +263,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
+ #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
+ #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
+   extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
++#ifdef __UCLIBC__
++// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int*
++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs);
++#else
+ _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
++#endif
+ #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h
+index b5fd989..3da9a5d 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -40,13 +40,22 @@
+ 
+ #include <clocale>
+ 
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ #define _GLIBCXX_NUM_CATEGORIES 0
+ 
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ 
++#ifdef __UCLIBC__
++  typedef __ctype_touplow_t*	__c_locale;
++#else
+   typedef int*			__c_locale;
++#endif
+ 
+   // Convert numeric value of type double and long double to string and
+   // return length of string.  If vsnprintf is available use it, otherwise
+diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+index 2d8e978..14eb08f 100644
+--- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h
++++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+@@ -33,6 +33,11 @@
+ 
+ // Information as gleaned from /usr/include/ctype.h
+ 
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+   struct ctype_base
+   {
+     // Non-standard typedefs.
++#ifdef __UCLIBC__
++    typedef const __ctype_touplow_t*	__to_type;
++#else
+     typedef const int* 		__to_type;
++#endif
+ 
+     // NB: Offsets into ctype<char>::_M_table force a particular size
+     // on the mask type. Because of this, we don't use an enum.
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0004-uclibc-locale.patch b/meta/recipes-devtools/gcc/gcc-4.8/0004-uclibc-locale.patch
new file mode 100644
index 0000000..49f5f33
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0004-uclibc-locale.patch
@@ -0,0 +1,2862 @@
+From a55c751a449c2cbf0b3fcc07aab1b86bf9661510 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:41:39 +0400
+Subject: [PATCH 04/35] uclibc-locale
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/acinclude.m4                          |   37 ++
+ .../config/locale/uclibc/c++locale_internal.h      |   63 ++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc      |  160 +++++
+ libstdc++-v3/config/locale/uclibc/c_locale.h       |  117 ++++
+ .../config/locale/uclibc/codecvt_members.cc        |  308 +++++++++
+ .../config/locale/uclibc/collate_members.cc        |   80 +++
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc |  300 +++++++++
+ .../config/locale/uclibc/messages_members.cc       |  100 +++
+ .../config/locale/uclibc/messages_members.h        |  118 ++++
+ .../config/locale/uclibc/monetary_members.cc       |  692 ++++++++++++++++++++
+ .../config/locale/uclibc/numeric_members.cc        |  160 +++++
+ libstdc++-v3/config/locale/uclibc/time_members.cc  |  406 ++++++++++++
+ libstdc++-v3/config/locale/uclibc/time_members.h   |   68 ++
+ libstdc++-v3/configure                             |   75 +++
+ libstdc++-v3/include/c_compatibility/wchar.h       |    2 +
+ libstdc++-v3/include/c_std/cwchar                  |    2 +
+ 16 files changed, 2688 insertions(+)
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/collate_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/ctype_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/monetary_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/numeric_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.h
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index 0871a6a..326d7ef 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -1905,6 +1905,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+   # Default to "generic".
+   if test $enable_clocale_flag = auto; then
+     case ${target_os} in
++      *-uclibc*)
++        enable_clocale_flag=uclibc
++        ;;
+       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ 	enable_clocale_flag=gnu
+ 	;;
+@@ -2069,6 +2072,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+       CTIME_CC=config/locale/generic/time_members.cc
+       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+       ;;
++    uclibc)
++      AC_MSG_RESULT(uclibc)
++
++      # Declare intention to use gettext, and add support for specific
++      # languages.
++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++      ALL_LINGUAS="de fr"
++
++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++        USE_NLS=yes
++      fi
++      # Export the build objects.
++      for ling in $ALL_LINGUAS; do \
++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++      done
++      AC_SUBST(glibcxx_MOFILES)
++      AC_SUBST(glibcxx_POFILES)
++
++      CLOCALE_H=config/locale/uclibc/c_locale.h
++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++      CMESSAGES_H=config/locale/uclibc/messages_members.h
++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++      CTIME_H=config/locale/uclibc/time_members.h
++      CTIME_CC=config/locale/uclibc/time_members.cc
++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++      ;;
+   esac
+ 
+   # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+new file mode 100644
+index 0000000..2ae3e4a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <bits/c++config.h>
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
++extern "C" __typeof(strcoll_l) __strcoll_l;
++extern "C" __typeof(strftime_l) __strftime_l;
++extern "C" __typeof(strtod_l) __strtod_l;
++extern "C" __typeof(strtof_l) __strtof_l;
++extern "C" __typeof(strtold_l) __strtold_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_l;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++extern "C" __typeof(iswctype_l) __iswctype_l;
++extern "C" __typeof(towlower_l) __towlower_l;
++extern "C" __typeof(towupper_l) __towupper_l;
++extern "C" __typeof(wcscoll_l) __wcscoll_l;
++extern "C" __typeof(wcsftime_l) __wcsftime_l;
++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
++extern "C" __typeof(wctype_l) __wctype_l;
++#endif
++
++#endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+new file mode 100644
+index 0000000..5081dc1
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -0,0 +1,160 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8  Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno>  // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
++#define __strtof_l(S, E, L)         strtof((S), (E))
++#define __strtod_l(S, E, L)         strtod((S), (E))
++#define __strtold_l(S, E, L)        strtold((S), (E))
++#warning should dummy __newlocale check for C|POSIX ?
++#define __newlocale(a, b, c)        NULL
++#define __freelocale(a)             ((void)0)
++#define __duplocale(a)              __c_locale()
++#endif
++
++namespace std
++{
++  template<>
++    void
++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++		   const __c_locale& __cloc)
++    {
++      if (!(__err & ios_base::failbit))
++	{
++	  char* __sanity;
++	  errno = 0;
++	  float __f = __strtof_l(__s, &__sanity, __cloc);
++          if (__sanity != __s && errno != ERANGE)
++	    __v = __f;
++	  else
++	    __err |= ios_base::failbit;
++	}
++    }
++
++  template<>
++    void
++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++		   const __c_locale& __cloc)
++    {
++      if (!(__err & ios_base::failbit))
++	{
++	  char* __sanity;
++	  errno = 0;
++	  double __d = __strtod_l(__s, &__sanity, __cloc);
++          if (__sanity != __s && errno != ERANGE)
++	    __v = __d;
++	  else
++	    __err |= ios_base::failbit;
++	}
++    }
++
++  template<>
++    void
++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
++		   const __c_locale& __cloc)
++    {
++      if (!(__err & ios_base::failbit))
++	{
++	  char* __sanity;
++	  errno = 0;
++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
++          if (__sanity != __s && errno != ERANGE)
++	    __v = __ld;
++	  else
++	    __err |= ios_base::failbit;
++	}
++    }
++
++  void
++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++				    __c_locale __old)
++  {
++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
++#ifdef __UCLIBC_HAS_XLOCALE__
++    if (!__cloc)
++      {
++	// This named locale is not supported by the underlying OS.
++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++			      "name not valid"));
++      }
++#endif
++  }
++
++  void
++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++  {
++    if (_S_get_c_locale() != __cloc)
++      __freelocale(__cloc);
++  }
++
++  __c_locale
++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++  { return __duplocale(__cloc); }
++} // namespace std
++
++namespace __gnu_cxx
++{
++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++    {
++      "LC_CTYPE",
++      "LC_NUMERIC",
++      "LC_TIME",
++      "LC_COLLATE",
++      "LC_MONETARY",
++      "LC_MESSAGES",
++#if _GLIBCXX_NUM_CATEGORIES != 0
++      "LC_PAPER",
++      "LC_NAME",
++      "LC_ADDRESS",
++      "LC_TELEPHONE",
++      "LC_MEASUREMENT",
++      "LC_IDENTIFICATION"
++#endif
++    };
++}
++
++namespace std
++{
++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++}  // namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+new file mode 100644
+index 0000000..da07c1f
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -0,0 +1,117 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8  Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring>              // get std::strlen
++#include <cstdio>               // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h>		// For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h>		// For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> 		// For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCXX_C_LOCALE_GNU for
++#endif
++#define _GLIBCXX_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCXX_NUM_CATEGORIES 6
++#define _GLIBCXX_NUM_CATEGORIES 0
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++namespace __gnu_cxx
++{
++  extern "C" __typeof(uselocale) __uselocale;
++}
++#endif
++
++namespace std
++{
++#ifdef __UCLIBC_HAS_XLOCALE__
++  typedef __locale_t		__c_locale;
++#else
++  typedef int*			__c_locale;
++#endif
++
++  // Convert numeric value of type _Tv to string and return length of
++  // string.  If snprintf is available use it, otherwise fall back to
++  // the unsafe sprintf which, in general, can be dangerous and should
++  // be avoided.
++  template<typename _Tv>
++    int
++    __convert_from_v(char* __out,
++		     const int __size __attribute__ ((__unused__)),
++		     const char* __fmt,
++#ifdef __UCLIBC_HAS_XCLOCALE__
++		     _Tv __v, const __c_locale& __cloc, int __prec)
++    {
++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++		     _Tv __v, const __c_locale&, int __prec)
++    {
++# ifdef __UCLIBC_HAS_LOCALE__
++      char* __old = std::setlocale(LC_ALL, NULL);
++      char* __sav = new char[std::strlen(__old) + 1];
++      std::strcpy(__sav, __old);
++      std::setlocale(LC_ALL, "C");
++# endif
++#endif
++
++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++
++#ifdef __UCLIBC_HAS_XCLOCALE__
++      __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++      std::setlocale(LC_ALL, __sav);
++      delete [] __sav;
++#endif
++      return __ret;
++    }
++}
++
++#endif
+diff --git a/libstdc++-v3/config/locale/uclibc/codecvt_members.cc b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+new file mode 100644
+index 0000000..64aa962
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+@@ -0,0 +1,308 @@
++// std::codecvt implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <cstdlib>  // For MB_CUR_MAX
++#include <climits>  // For MB_LEN_MAX
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++  // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++  codecvt_base::result
++  codecvt<wchar_t, char, mbstate_t>::
++  do_out(state_type& __state, const intern_type* __from,
++	 const intern_type* __from_end, const intern_type*& __from_next,
++	 extern_type* __to, extern_type* __to_end,
++	 extern_type*& __to_next) const
++  {
++    result __ret = ok;
++    state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
++    // in case we fall back to wcrtomb and then continue, in a loop.
++    // NB: wcsnrtombs is a GNU extension
++    for (__from_next = __from, __to_next = __to;
++	 __from_next < __from_end && __to_next < __to_end
++	 && __ret == ok;)
++      {
++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
++						      __from_end - __from_next);
++	if (!__from_chunk_end)
++	  __from_chunk_end = __from_end;
++
++	__from = __from_next;
++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
++					 __from_chunk_end - __from_next,
++					 __to_end - __to_next, &__state);
++	if (__conv == static_cast<size_t>(-1))
++	  {
++	    // In case of error, in order to stop at the exact place we
++	    // have to start again from the beginning with a series of
++	    // wcrtomb.
++	    for (; __from < __from_next; ++__from)
++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
++	    __state = __tmp_state;
++	    __ret = error;
++	  }
++	else if (__from_next && __from_next < __from_chunk_end)
++	  {
++	    __to_next += __conv;
++	    __ret = partial;
++	  }
++	else
++	  {
++	    __from_next = __from_chunk_end;
++	    __to_next += __conv;
++	  }
++
++	if (__from_next < __from_end && __ret == ok)
++	  {
++	    extern_type __buf[MB_LEN_MAX];
++	    __tmp_state = __state;
++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
++	      __ret = partial;
++	    else
++	      {
++		memcpy(__to_next, __buf, __conv);
++		__state = __tmp_state;
++		__to_next += __conv;
++		++__from_next;
++	      }
++	  }
++      }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++
++    return __ret;
++  }
++
++  codecvt_base::result
++  codecvt<wchar_t, char, mbstate_t>::
++  do_in(state_type& __state, const extern_type* __from,
++	const extern_type* __from_end, const extern_type*& __from_next,
++	intern_type* __to, intern_type* __to_end,
++	intern_type*& __to_next) const
++  {
++    result __ret = ok;
++    state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++    // in case we store a L'\0' and then continue, in a loop.
++    // NB: mbsnrtowcs is a GNU extension
++    for (__from_next = __from, __to_next = __to;
++	 __from_next < __from_end && __to_next < __to_end
++	 && __ret == ok;)
++      {
++	const extern_type* __from_chunk_end;
++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
++								  __from_end
++								  - __from_next));
++	if (!__from_chunk_end)
++	  __from_chunk_end = __from_end;
++
++	__from = __from_next;
++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
++				   __from_chunk_end - __from_next,
++				   __to_end - __to_next, &__state);
++	if (__conv == static_cast<size_t>(-1))
++	  {
++	    // In case of error, in order to stop at the exact place we
++	    // have to start again from the beginning with a series of
++	    // mbrtowc.
++	    for (;; ++__to_next, __from += __conv)
++	      {
++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
++				 &__tmp_state);
++		if (__conv == static_cast<size_t>(-1)
++		    || __conv == static_cast<size_t>(-2))
++		  break;
++	      }
++	    __from_next = __from;
++	    __state = __tmp_state;
++	    __ret = error;
++	  }
++	else if (__from_next && __from_next < __from_chunk_end)
++	  {
++	    // It is unclear what to return in this case (see DR 382).
++	    __to_next += __conv;
++	    __ret = partial;
++	  }
++	else
++	  {
++	    __from_next = __from_chunk_end;
++	    __to_next += __conv;
++	  }
++
++	if (__from_next < __from_end && __ret == ok)
++	  {
++	    if (__to_next < __to_end)
++	      {
++		// XXX Probably wrong for stateful encodings
++		__tmp_state = __state;
++		++__from_next;
++		*__to_next++ = L'\0';
++	      }
++	    else
++	      __ret = partial;
++	  }
++      }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++
++    return __ret;
++  }
++
++  int
++  codecvt<wchar_t, char, mbstate_t>::
++  do_encoding() const throw()
++  {
++    // XXX This implementation assumes that the encoding is
++    // stateless and is either single-byte or variable-width.
++    int __ret = 0;
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++    if (MB_CUR_MAX == 1)
++      __ret = 1;
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return __ret;
++  }
++
++  int
++  codecvt<wchar_t, char, mbstate_t>::
++  do_max_length() const throw()
++  {
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++    // XXX Probably wrong for stateful encodings.
++    int __ret = MB_CUR_MAX;
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return __ret;
++  }
++
++  int
++  codecvt<wchar_t, char, mbstate_t>::
++  do_length(state_type& __state, const extern_type* __from,
++	    const extern_type* __end, size_t __max) const
++  {
++    int __ret = 0;
++    state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++    // in case we advance past it and then continue, in a loop.
++    // NB: mbsnrtowcs is a GNU extension
++
++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
++    // its fourth parameter (it wouldn't with NULL as first parameter).
++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++							   * __max));
++    while (__from < __end && __max)
++      {
++	const extern_type* __from_chunk_end;
++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
++								  __end
++								  - __from));
++	if (!__from_chunk_end)
++	  __from_chunk_end = __end;
++
++	const extern_type* __tmp_from = __from;
++	size_t __conv = mbsnrtowcs(__to, &__from,
++				   __from_chunk_end - __from,
++				   __max, &__state);
++	if (__conv == static_cast<size_t>(-1))
++	  {
++	    // In case of error, in order to stop at the exact place we
++	    // have to start again from the beginning with a series of
++	    // mbrtowc.
++	    for (__from = __tmp_from;; __from += __conv)
++	      {
++		__conv = mbrtowc(NULL, __from, __end - __from,
++				 &__tmp_state);
++		if (__conv == static_cast<size_t>(-1)
++		    || __conv == static_cast<size_t>(-2))
++		  break;
++	      }
++	    __state = __tmp_state;
++	    __ret += __from - __tmp_from;
++	    break;
++	  }
++	if (!__from)
++	  __from = __from_chunk_end;
++
++	__ret += __from - __tmp_from;
++	__max -= __conv;
++
++	if (__from < __end && __max)
++	  {
++	    // XXX Probably wrong for stateful encodings
++	    __tmp_state = __state;
++	    ++__from;
++	    ++__ret;
++	    --__max;
++	  }
++      }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++
++    return __ret;
++  }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+new file mode 100644
+index 0000000..c2664a7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -0,0 +1,80 @@
++// std::collate implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
++#endif
++
++namespace std
++{
++  // These are basically extensions to char_traits, and perhaps should
++  // be put there instead of here.
++  template<>
++    int
++    collate<char>::_M_compare(const char* __one, const char* __two) const
++    {
++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++    }
++
++  template<>
++    size_t
++    collate<char>::_M_transform(char* __to, const char* __from,
++				size_t __n) const
++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    int
++    collate<wchar_t>::_M_compare(const wchar_t* __one,
++				 const wchar_t* __two) const
++    {
++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++    }
++
++  template<>
++    size_t
++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++				   size_t __n) const
++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+new file mode 100644
+index 0000000..7294e3a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -0,0 +1,300 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __wctype_l(S, L)           wctype((S))
++#define __towupper_l(C, L)         towupper((C))
++#define __towlower_l(C, L)         towlower((C))
++#define __iswctype_l(C, M, L)      iswctype((C), (M))
++#endif
++
++namespace std
++{
++  // NB: The other ctype<char> specializations are in src/locale.cc and
++  // various /config/os/* files.
++  template<>
++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++    : ctype<char>(0, false, __refs)
++    {
++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++	{
++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
++#endif
++	}
++    }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  ctype<wchar_t>::__wmask_type
++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
++  {
++    __wmask_type __ret;
++    switch (__m)
++      {
++      case space:
++	__ret = __wctype_l("space", _M_c_locale_ctype);
++	break;
++      case print:
++	__ret = __wctype_l("print", _M_c_locale_ctype);
++	break;
++      case cntrl:
++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
++	break;
++      case upper:
++	__ret = __wctype_l("upper", _M_c_locale_ctype);
++	break;
++      case lower:
++	__ret = __wctype_l("lower", _M_c_locale_ctype);
++	break;
++      case alpha:
++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
++	break;
++      case digit:
++	__ret = __wctype_l("digit", _M_c_locale_ctype);
++	break;
++      case punct:
++	__ret = __wctype_l("punct", _M_c_locale_ctype);
++	break;
++      case xdigit:
++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
++	break;
++      case alnum:
++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
++	break;
++      case graph:
++	__ret = __wctype_l("graph", _M_c_locale_ctype);
++	break;
++      default:
++	__ret = __wmask_type();
++      }
++    return __ret;
++  }
++
++  wchar_t
++  ctype<wchar_t>::do_toupper(wchar_t __c) const
++  { return __towupper_l(__c, _M_c_locale_ctype); }
++
++  const wchar_t*
++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
++  {
++    while (__lo < __hi)
++      {
++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
++        ++__lo;
++      }
++    return __hi;
++  }
++
++  wchar_t
++  ctype<wchar_t>::do_tolower(wchar_t __c) const
++  { return __towlower_l(__c, _M_c_locale_ctype); }
++
++  const wchar_t*
++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
++  {
++    while (__lo < __hi)
++      {
++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
++        ++__lo;
++      }
++    return __hi;
++  }
++
++  bool
++  ctype<wchar_t>::
++  do_is(mask __m, wchar_t __c) const
++  {
++    // Highest bitmask in ctype_base == 10, but extra in "C"
++    // library for blank.
++    bool __ret = false;
++    const size_t __bitmasksize = 11;
++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++      if (__m & _M_bit[__bitcur]
++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++	{
++	  __ret = true;
++	  break;
++	}
++    return __ret;
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
++  {
++    for (; __lo < __hi; ++__vec, ++__lo)
++      {
++	// Highest bitmask in ctype_base == 10, but extra in "C"
++	// library for blank.
++	const size_t __bitmasksize = 11;
++	mask __m = 0;
++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
++	    __m |= _M_bit[__bitcur];
++	*__vec = __m;
++      }
++    return __hi;
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
++  {
++    while (__lo < __hi && !this->do_is(__m, *__lo))
++      ++__lo;
++    return __lo;
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
++  {
++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++      ++__lo;
++    return __lo;
++  }
++
++  wchar_t
++  ctype<wchar_t>::
++  do_widen(char __c) const
++  { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++  const char*
++  ctype<wchar_t>::
++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++  {
++    while (__lo < __hi)
++      {
++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++	++__lo;
++	++__dest;
++      }
++    return __hi;
++  }
++
++  char
++  ctype<wchar_t>::
++  do_narrow(wchar_t __wc, char __dfault) const
++  {
++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
++      return _M_narrow[__wc];
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++    const int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return (__c == EOF ? __dfault : static_cast<char>(__c));
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
++	    char* __dest) const
++  {
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++    if (_M_narrow_ok)
++      while (__lo < __hi)
++	{
++	  if (*__lo >= 0 && *__lo < 128)
++	    *__dest = _M_narrow[*__lo];
++	  else
++	    {
++	      const int __c = wctob(*__lo);
++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++	    }
++	  ++__lo;
++	  ++__dest;
++	}
++    else
++      while (__lo < __hi)
++	{
++	  const int __c = wctob(*__lo);
++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++	  ++__lo;
++	  ++__dest;
++	}
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return __hi;
++  }
++
++  void
++  ctype<wchar_t>::_M_initialize_ctype()
++  {
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++    wint_t __i;
++    for (__i = 0; __i < 128; ++__i)
++      {
++	const int __c = wctob(__i);
++	if (__c == EOF)
++	  break;
++	else
++	  _M_narrow[__i] = static_cast<char>(__c);
++      }
++    if (__i == 128)
++      _M_narrow_ok = true;
++    else
++      _M_narrow_ok = false;
++    for (size_t __j = 0;
++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
++      _M_widen[__j] = btowc(__j);
++
++    for (size_t __k = 0; __k <= 11; ++__k)
++      {
++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
++      }
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++  }
++#endif //  _GLIBCXX_USE_WCHAR_T
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+new file mode 100644
+index 0000000..13594d9
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -0,0 +1,100 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix gettext stuff
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__dcgettext(const char *domainname,
++			     const char *msgid, int category);
++#undef gettext
++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#else
++#undef gettext
++#define gettext(msgid) (msgid)
++#endif
++
++namespace std
++{
++  // Specializations.
++  template<>
++    string
++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
++    {
++#ifdef __UCLIBC_HAS_XLOCALE__
++      __c_locale __old = __uselocale(_M_c_locale_messages);
++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
++      __uselocale(__old);
++      return string(__msg);
++#elif defined __UCLIBC_HAS_LOCALE__
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_messages);
++      const char* __msg = gettext(__dfault.c_str());
++      setlocale(LC_ALL, __old);
++      free(__old);
++      return string(__msg);
++#else
++      const char* __msg = gettext(__dfault.c_str());
++      return string(__msg);
++#endif
++    }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    wstring
++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
++    {
++# ifdef __UCLIBC_HAS_XLOCALE__
++      __c_locale __old = __uselocale(_M_c_locale_messages);
++      char* __msg = gettext(_M_convert_to_char(__dfault));
++      __uselocale(__old);
++      return _M_convert_from_char(__msg);
++# elif defined __UCLIBC_HAS_LOCALE__
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_messages);
++      char* __msg = gettext(_M_convert_to_char(__dfault));
++      setlocale(LC_ALL, __old);
++      free(__old);
++      return _M_convert_from_char(__msg);
++# else
++      char* __msg = gettext(_M_convert_to_char(__dfault));
++      return _M_convert_from_char(__msg);
++# endif
++    }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+new file mode 100644
+index 0000000..1424078
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -0,0 +1,118 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2  messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix prototypes for *textdomain funcs
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__textdomain(const char *domainname);
++extern "C" char *__bindtextdomain(const char *domainname,
++				  const char *dirname);
++#else
++#undef __textdomain
++#undef __bindtextdomain
++#define __textdomain(D)           ((void)0)
++#define __bindtextdomain(D,P)     ((void)0)
++#endif
++
++  // Non-virtual member functions.
++  template<typename _CharT>
++     messages<_CharT>::messages(size_t __refs)
++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
++     _M_name_messages(_S_get_c_name())
++     { }
++
++  template<typename _CharT>
++     messages<_CharT>::messages(__c_locale __cloc, const char* __s,
++				size_t __refs)
++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
++     _M_name_messages(__s)
++     {
++       char* __tmp = new char[std::strlen(__s) + 1];
++       std::strcpy(__tmp, __s);
++       _M_name_messages = __tmp;
++     }
++
++  template<typename _CharT>
++    typename messages<_CharT>::catalog
++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++			   const char* __dir) const
++    {
++      __bindtextdomain(__s.c_str(), __dir);
++      return this->do_open(__s, __loc);
++    }
++
++  // Virtual member functions.
++  template<typename _CharT>
++    messages<_CharT>::~messages()
++    {
++      if (_M_name_messages != _S_get_c_name())
++	delete [] _M_name_messages;
++      _S_destroy_c_locale(_M_c_locale_messages);
++    }
++
++  template<typename _CharT>
++    typename messages<_CharT>::catalog
++    messages<_CharT>::do_open(const basic_string<char>& __s,
++			      const locale&) const
++    {
++      // No error checking is done, assume the catalog exists and can
++      // be used.
++      __textdomain(__s.c_str());
++      return 0;
++    }
++
++  template<typename _CharT>
++    void
++    messages<_CharT>::do_close(catalog) const
++    { }
++
++   // messages_byname
++   template<typename _CharT>
++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++     : messages<_CharT>(__refs)
++     {
++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
++	 delete [] this->_M_name_messages;
++       char* __tmp = new char[std::strlen(__s) + 1];
++       std::strcpy(__tmp, __s);
++       this->_M_name_messages = __tmp;
++
++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++	 {
++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s);
++	 }
++     }
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+new file mode 100644
+index 0000000..aa52731
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -0,0 +1,692 @@
++// std::moneypunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning optimize this for uclibc
++#warning tailor for stub locale support
++#endif
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
++#endif
++
++namespace std
++{
++  // Construct and return valid pattern consisting of some combination of:
++  // space none symbol sign value
++  money_base::pattern
++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
++  {
++    pattern __ret;
++
++    // This insanely complicated routine attempts to construct a valid
++    // pattern for use with monyepunct. A couple of invariants:
++
++    // if (__precedes) symbol -> value
++    // else value -> symbol
++
++    // if (__space) space
++    // else none
++
++    // none == never first
++    // space never first or last
++
++    // Any elegant implementations of this are welcome.
++    switch (__posn)
++      {
++      case 0:
++      case 1:
++	// 1 The sign precedes the value and symbol.
++	__ret.field[0] = sign;
++	if (__space)
++	  {
++	    // Pattern starts with sign.
++	    if (__precedes)
++	      {
++		__ret.field[1] = symbol;
++		__ret.field[3] = value;
++	      }
++	    else
++	      {
++		__ret.field[1] = value;
++		__ret.field[3] = symbol;
++	      }
++	    __ret.field[2] = space;
++	  }
++	else
++	  {
++	    // Pattern starts with sign and ends with none.
++	    if (__precedes)
++	      {
++		__ret.field[1] = symbol;
++		__ret.field[2] = value;
++	      }
++	    else
++	      {
++		__ret.field[1] = value;
++		__ret.field[2] = symbol;
++	      }
++	    __ret.field[3] = none;
++	  }
++	break;
++      case 2:
++	// 2 The sign follows the value and symbol.
++	if (__space)
++	  {
++	    // Pattern either ends with sign.
++	    if (__precedes)
++	      {
++		__ret.field[0] = symbol;
++		__ret.field[2] = value;
++	      }
++	    else
++	      {
++		__ret.field[0] = value;
++		__ret.field[2] = symbol;
++	      }
++	    __ret.field[1] = space;
++	    __ret.field[3] = sign;
++	  }
++	else
++	  {
++	    // Pattern ends with sign then none.
++	    if (__precedes)
++	      {
++		__ret.field[0] = symbol;
++		__ret.field[1] = value;
++	      }
++	    else
++	      {
++		__ret.field[0] = value;
++		__ret.field[1] = symbol;
++	      }
++	    __ret.field[2] = sign;
++	    __ret.field[3] = none;
++	  }
++	break;
++      case 3:
++	// 3 The sign immediately precedes the symbol.
++	if (__precedes)
++	  {
++	    __ret.field[0] = sign;
++	    __ret.field[1] = symbol;
++	    if (__space)
++	      {
++		__ret.field[2] = space;
++		__ret.field[3] = value;
++	      }
++	    else
++	      {
++		__ret.field[2] = value;
++		__ret.field[3] = none;
++	      }
++	  }
++	else
++	  {
++	    __ret.field[0] = value;
++	    if (__space)
++	      {
++		__ret.field[1] = space;
++		__ret.field[2] = sign;
++		__ret.field[3] = symbol;
++	      }
++	    else
++	      {
++		__ret.field[1] = sign;
++		__ret.field[2] = symbol;
++		__ret.field[3] = none;
++	      }
++	  }
++	break;
++      case 4:
++	// 4 The sign immediately follows the symbol.
++	if (__precedes)
++	  {
++	    __ret.field[0] = symbol;
++	    __ret.field[1] = sign;
++	    if (__space)
++	      {
++		__ret.field[2] = space;
++		__ret.field[3] = value;
++	      }
++	    else
++	      {
++		__ret.field[2] = value;
++		__ret.field[3] = none;
++	      }
++	  }
++	else
++	  {
++	    __ret.field[0] = value;
++	    if (__space)
++	      {
++		__ret.field[1] = space;
++		__ret.field[2] = symbol;
++		__ret.field[3] = sign;
++	      }
++	    else
++	      {
++		__ret.field[1] = symbol;
++		__ret.field[2] = sign;
++		__ret.field[3] = none;
++	      }
++	  }
++	break;
++      default:
++	;
++      }
++    return __ret;
++  }
++
++  template<>
++    void
++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++						     const char*)
++    {
++      if (!_M_data)
++	_M_data = new __moneypunct_cache<char, true>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = '.';
++	  _M_data->_M_thousands_sep = ',';
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = "";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = "";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = "";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++	}
++      else
++	{
++	  // Named locale.
++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++							__cloc));
++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++							__cloc));
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++	  if (!__nposn)
++	    _M_data->_M_negative_sign = "()";
++	  else
++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++							__cloc);
++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++	  // _Intl == true
++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++						      __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++							__pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++							__nposn);
++	}
++    }
++
++  template<>
++    void
++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++						      const char*)
++    {
++      if (!_M_data)
++	_M_data = new __moneypunct_cache<char, false>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = '.';
++	  _M_data->_M_thousands_sep = ',';
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = "";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = "";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = "";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++	}
++      else
++	{
++	  // Named locale.
++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++							__cloc));
++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++							__cloc));
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++	  if (!__nposn)
++	    _M_data->_M_negative_sign = "()";
++	  else
++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++							__cloc);
++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++	  // _Intl == false
++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++							__pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++							__nposn);
++	}
++    }
++
++  template<>
++    moneypunct<char, true>::~moneypunct()
++    { delete _M_data; }
++
++  template<>
++    moneypunct<char, false>::~moneypunct()
++    { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    void
++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++							const char*)
++#else
++							const char* __name)
++#endif
++    {
++      if (!_M_data)
++	_M_data = new __moneypunct_cache<wchar_t, true>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = L'.';
++	  _M_data->_M_thousands_sep = L',';
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = L"";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = L"";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = L"";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  // Use ctype::widen code without the facet...
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] =
++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
++	}
++      else
++	{
++	  // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __c_locale __old = __uselocale(__cloc);
++#else
++	  // Switch to named locale so that mbsrtowcs will work.
++	  char* __old = strdup(setlocale(LC_ALL, NULL));
++	  setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++	  union { char *__s; wchar_t __w; } __u;
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++	  _M_data->_M_decimal_point = __u.__w;
++
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++	  _M_data->_M_thousands_sep = __u.__w;
++#endif
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++
++	  wchar_t* __wcs_ps = 0;
++	  wchar_t* __wcs_ns = 0;
++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++	  try
++	    {
++	      mbstate_t __state;
++	      size_t __len = strlen(__cpossign);
++	      if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ps = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++		  _M_data->_M_positive_sign = __wcs_ps;
++		}
++	      else
++		_M_data->_M_positive_sign = L"";
++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++	      __len = strlen(__cnegsign);
++	      if (!__nposn)
++		_M_data->_M_negative_sign = L"()";
++	      else if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ns = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++		  _M_data->_M_negative_sign = __wcs_ns;
++		}
++	      else
++		_M_data->_M_negative_sign = L"";
++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++	      // _Intl == true.
++	      __len = strlen(__ccurr);
++	      if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  wchar_t* __wcs = new wchar_t[__len];
++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++		  _M_data->_M_curr_symbol = __wcs;
++		}
++	      else
++		_M_data->_M_curr_symbol = L"";
++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++	    }
++	  catch (...)
++	    {
++	      delete _M_data;
++	      _M_data = 0;
++	      delete __wcs_ps;
++	      delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++	      __uselocale(__old);
++#else
++	      setlocale(LC_ALL, __old);
++	      free(__old);
++#endif
++	      __throw_exception_again;
++	    }
++
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++						      __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++							__pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++							__nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __uselocale(__old);
++#else
++	  setlocale(LC_ALL, __old);
++	  free(__old);
++#endif
++	}
++    }
++
++  template<>
++  void
++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++						       const char*)
++#else
++                                                       const char* __name)
++#endif
++  {
++    if (!_M_data)
++      _M_data = new __moneypunct_cache<wchar_t, false>;
++
++    if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = L'.';
++	  _M_data->_M_thousands_sep = L',';
++	  _M_data->_M_grouping = "";
++          _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = L"";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = L"";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = L"";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  // Use ctype::widen code without the facet...
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] =
++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
++	}
++      else
++	{
++	  // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __c_locale __old = __uselocale(__cloc);
++#else
++	  // Switch to named locale so that mbsrtowcs will work.
++	  char* __old = strdup(setlocale(LC_ALL, NULL));
++	  setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++          union { char *__s; wchar_t __w; } __u;
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++	  _M_data->_M_decimal_point = __u.__w;
++
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++	  _M_data->_M_thousands_sep = __u.__w;
++#endif
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++
++	  wchar_t* __wcs_ps = 0;
++	  wchar_t* __wcs_ns = 0;
++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++	  try
++            {
++              mbstate_t __state;
++              size_t __len;
++              __len = strlen(__cpossign);
++              if (__len)
++                {
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ps = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++		  _M_data->_M_positive_sign = __wcs_ps;
++		}
++	      else
++		_M_data->_M_positive_sign = L"";
++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++	      __len = strlen(__cnegsign);
++	      if (!__nposn)
++		_M_data->_M_negative_sign = L"()";
++	      else if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ns = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++		  _M_data->_M_negative_sign = __wcs_ns;
++		}
++	      else
++		_M_data->_M_negative_sign = L"";
++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++	      // _Intl == true.
++	      __len = strlen(__ccurr);
++	      if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  wchar_t* __wcs = new wchar_t[__len];
++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++		  _M_data->_M_curr_symbol = __wcs;
++		}
++	      else
++		_M_data->_M_curr_symbol = L"";
++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++	    }
++          catch (...)
++	    {
++	      delete _M_data;
++              _M_data = 0;
++	      delete __wcs_ps;
++	      delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++	      __uselocale(__old);
++#else
++	      setlocale(LC_ALL, __old);
++	      free(__old);
++#endif
++              __throw_exception_again;
++	    }
++
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++	                                                __pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++	                                                __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __uselocale(__old);
++#else
++	  setlocale(LC_ALL, __old);
++	  free(__old);
++#endif
++	}
++    }
++
++  template<>
++    moneypunct<wchar_t, true>::~moneypunct()
++    {
++      if (_M_data->_M_positive_sign_size)
++	delete [] _M_data->_M_positive_sign;
++      if (_M_data->_M_negative_sign_size
++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++	delete [] _M_data->_M_negative_sign;
++      if (_M_data->_M_curr_symbol_size)
++	delete [] _M_data->_M_curr_symbol;
++      delete _M_data;
++    }
++
++  template<>
++    moneypunct<wchar_t, false>::~moneypunct()
++    {
++      if (_M_data->_M_positive_sign_size)
++	delete [] _M_data->_M_positive_sign;
++      if (_M_data->_M_negative_sign_size
++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++	delete [] _M_data->_M_negative_sign;
++      if (_M_data->_M_curr_symbol_size)
++	delete [] _M_data->_M_curr_symbol;
++      delete _M_data;
++    }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+new file mode 100644
+index 0000000..883ec1a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -0,0 +1,160 @@
++// std::numpunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
++#endif
++
++namespace std
++{
++  template<>
++    void
++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __numpunct_cache<char>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_use_grouping = false;
++
++	  _M_data->_M_decimal_point = '.';
++	  _M_data->_M_thousands_sep = ',';
++
++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
++
++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
++	}
++      else
++	{
++	  // Named locale.
++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
++							__cloc));
++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
++							__cloc));
++
++	  // Check for NULL, which implies no grouping.
++	  if (_M_data->_M_thousands_sep == '\0')
++	    _M_data->_M_grouping = "";
++	  else
++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	}
++
++      // NB: There is no way to extact this info from posix locales.
++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++      _M_data->_M_truename = "true";
++      _M_data->_M_truename_size = 4;
++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++      _M_data->_M_falsename = "false";
++      _M_data->_M_falsename_size = 5;
++    }
++
++  template<>
++    numpunct<char>::~numpunct()
++    { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    void
++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __numpunct_cache<wchar_t>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_use_grouping = false;
++
++	  _M_data->_M_decimal_point = L'.';
++	  _M_data->_M_thousands_sep = L',';
++
++	  // Use ctype::widen code without the facet...
++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++	    _M_data->_M_atoms_out[__i] =
++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
++
++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++	    _M_data->_M_atoms_in[__j] =
++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
++	}
++      else
++	{
++	  // Named locale.
++	  // NB: In the GNU model wchar_t is always 32 bit wide.
++	  union { char *__s; wchar_t __w; } __u;
++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++	  _M_data->_M_decimal_point = __u.__w;
++
++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++	  _M_data->_M_thousands_sep = __u.__w;
++
++	  if (_M_data->_M_thousands_sep == L'\0')
++	    _M_data->_M_grouping = "";
++	  else
++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	}
++
++      // NB: There is no way to extact this info from posix locales.
++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++      _M_data->_M_truename = L"true";
++      _M_data->_M_truename_size = 4;
++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++      _M_data->_M_falsename = L"false";
++      _M_data->_M_falsename_size = 5;
++    }
++
++  template<>
++    numpunct<wchar_t>::~numpunct()
++    { delete _M_data; }
++ #endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+new file mode 100644
+index 0000000..e0707d7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -0,0 +1,406 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
++#endif
++
++namespace std
++{
++  template<>
++    void
++    __timepunct<char>::
++    _M_put(char* __s, size_t __maxlen, const char* __format,
++	   const tm* __tm) const
++    {
++#ifdef __UCLIBC_HAS_XLOCALE__
++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
++					_M_c_locale_timepunct);
++#else
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_timepunct);
++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
++      setlocale(LC_ALL, __old);
++      free(__old);
++#endif
++      // Make sure __s is null terminated.
++      if (__len == 0)
++	__s[0] = '\0';
++    }
++
++  template<>
++    void
++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __timepunct_cache<char>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_c_locale_timepunct = _S_get_c_locale();
++
++	  _M_data->_M_date_format = "%m/%d/%y";
++	  _M_data->_M_date_era_format = "%m/%d/%y";
++	  _M_data->_M_time_format = "%H:%M:%S";
++	  _M_data->_M_time_era_format = "%H:%M:%S";
++	  _M_data->_M_date_time_format = "";
++	  _M_data->_M_date_time_era_format = "";
++	  _M_data->_M_am = "AM";
++	  _M_data->_M_pm = "PM";
++	  _M_data->_M_am_pm_format = "";
++
++	  // Day names, starting with "C"'s Sunday.
++	  _M_data->_M_day1 = "Sunday";
++	  _M_data->_M_day2 = "Monday";
++	  _M_data->_M_day3 = "Tuesday";
++	  _M_data->_M_day4 = "Wednesday";
++	  _M_data->_M_day5 = "Thursday";
++	  _M_data->_M_day6 = "Friday";
++	  _M_data->_M_day7 = "Saturday";
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  _M_data->_M_aday1 = "Sun";
++	  _M_data->_M_aday2 = "Mon";
++	  _M_data->_M_aday3 = "Tue";
++	  _M_data->_M_aday4 = "Wed";
++	  _M_data->_M_aday5 = "Thu";
++	  _M_data->_M_aday6 = "Fri";
++	  _M_data->_M_aday7 = "Sat";
++
++	  // Month names, starting with "C"'s January.
++	  _M_data->_M_month01 = "January";
++	  _M_data->_M_month02 = "February";
++	  _M_data->_M_month03 = "March";
++	  _M_data->_M_month04 = "April";
++	  _M_data->_M_month05 = "May";
++	  _M_data->_M_month06 = "June";
++	  _M_data->_M_month07 = "July";
++	  _M_data->_M_month08 = "August";
++	  _M_data->_M_month09 = "September";
++	  _M_data->_M_month10 = "October";
++	  _M_data->_M_month11 = "November";
++	  _M_data->_M_month12 = "December";
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  _M_data->_M_amonth01 = "Jan";
++	  _M_data->_M_amonth02 = "Feb";
++	  _M_data->_M_amonth03 = "Mar";
++	  _M_data->_M_amonth04 = "Apr";
++	  _M_data->_M_amonth05 = "May";
++	  _M_data->_M_amonth06 = "Jun";
++	  _M_data->_M_amonth07 = "Jul";
++	  _M_data->_M_amonth08 = "Aug";
++	  _M_data->_M_amonth09 = "Sep";
++	  _M_data->_M_amonth10 = "Oct";
++	  _M_data->_M_amonth11 = "Nov";
++	  _M_data->_M_amonth12 = "Dec";
++	}
++      else
++	{
++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
++							     __cloc);
++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++	  // Day names, starting with "C"'s Sunday.
++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++	  // Month names, starting with "C"'s January.
++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
++	}
++    }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    void
++    __timepunct<wchar_t>::
++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
++	   const tm* __tm) const
++    {
++#ifdef __UCLIBC_HAS_XLOCALE__
++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
++					_M_c_locale_timepunct);
++#else
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_timepunct);
++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
++      setlocale(LC_ALL, __old);
++      free(__old);
++#endif
++      // Make sure __s is null terminated.
++      if (__len == 0)
++	__s[0] = L'\0';
++    }
++
++  template<>
++    void
++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __timepunct_cache<wchar_t>;
++
++#warning wide time stuff
++//       if (!__cloc)
++	{
++	  // "C" locale
++	  _M_c_locale_timepunct = _S_get_c_locale();
++
++	  _M_data->_M_date_format = L"%m/%d/%y";
++	  _M_data->_M_date_era_format = L"%m/%d/%y";
++	  _M_data->_M_time_format = L"%H:%M:%S";
++	  _M_data->_M_time_era_format = L"%H:%M:%S";
++	  _M_data->_M_date_time_format = L"";
++	  _M_data->_M_date_time_era_format = L"";
++	  _M_data->_M_am = L"AM";
++	  _M_data->_M_pm = L"PM";
++	  _M_data->_M_am_pm_format = L"";
++
++	  // Day names, starting with "C"'s Sunday.
++	  _M_data->_M_day1 = L"Sunday";
++	  _M_data->_M_day2 = L"Monday";
++	  _M_data->_M_day3 = L"Tuesday";
++	  _M_data->_M_day4 = L"Wednesday";
++	  _M_data->_M_day5 = L"Thursday";
++	  _M_data->_M_day6 = L"Friday";
++	  _M_data->_M_day7 = L"Saturday";
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  _M_data->_M_aday1 = L"Sun";
++	  _M_data->_M_aday2 = L"Mon";
++	  _M_data->_M_aday3 = L"Tue";
++	  _M_data->_M_aday4 = L"Wed";
++	  _M_data->_M_aday5 = L"Thu";
++	  _M_data->_M_aday6 = L"Fri";
++	  _M_data->_M_aday7 = L"Sat";
++
++	  // Month names, starting with "C"'s January.
++	  _M_data->_M_month01 = L"January";
++	  _M_data->_M_month02 = L"February";
++	  _M_data->_M_month03 = L"March";
++	  _M_data->_M_month04 = L"April";
++	  _M_data->_M_month05 = L"May";
++	  _M_data->_M_month06 = L"June";
++	  _M_data->_M_month07 = L"July";
++	  _M_data->_M_month08 = L"August";
++	  _M_data->_M_month09 = L"September";
++	  _M_data->_M_month10 = L"October";
++	  _M_data->_M_month11 = L"November";
++	  _M_data->_M_month12 = L"December";
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  _M_data->_M_amonth01 = L"Jan";
++	  _M_data->_M_amonth02 = L"Feb";
++	  _M_data->_M_amonth03 = L"Mar";
++	  _M_data->_M_amonth04 = L"Apr";
++	  _M_data->_M_amonth05 = L"May";
++	  _M_data->_M_amonth06 = L"Jun";
++	  _M_data->_M_amonth07 = L"Jul";
++	  _M_data->_M_amonth08 = L"Aug";
++	  _M_data->_M_amonth09 = L"Sep";
++	  _M_data->_M_amonth10 = L"Oct";
++	  _M_data->_M_amonth11 = L"Nov";
++	  _M_data->_M_amonth12 = L"Dec";
++	}
++#if 0
++      else
++	{
++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++	  union { char *__s; wchar_t *__w; } __u;
++
++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
++	  _M_data->_M_date_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
++	  _M_data->_M_date_era_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
++	  _M_data->_M_time_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
++	  _M_data->_M_time_era_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
++	  _M_data->_M_date_time_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
++	  _M_data->_M_date_time_era_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
++	  _M_data->_M_am = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
++	  _M_data->_M_pm = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
++	  _M_data->_M_am_pm_format = __u.__w;
++
++	  // Day names, starting with "C"'s Sunday.
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
++	  _M_data->_M_day1 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
++	  _M_data->_M_day2 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
++	  _M_data->_M_day3 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
++	  _M_data->_M_day4 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
++	  _M_data->_M_day5 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
++	  _M_data->_M_day6 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
++	  _M_data->_M_day7 = __u.__w;
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
++	  _M_data->_M_aday1 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
++	  _M_data->_M_aday2 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
++	  _M_data->_M_aday3 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
++	  _M_data->_M_aday4 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
++	  _M_data->_M_aday5 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
++	  _M_data->_M_aday6 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
++	  _M_data->_M_aday7 = __u.__w;
++
++	  // Month names, starting with "C"'s January.
++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
++	  _M_data->_M_month01 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
++	  _M_data->_M_month02 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
++	  _M_data->_M_month03 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
++	  _M_data->_M_month04 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
++	  _M_data->_M_month05 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
++	  _M_data->_M_month06 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
++	  _M_data->_M_month07 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
++	  _M_data->_M_month08 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
++	  _M_data->_M_month09 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
++	  _M_data->_M_month10 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
++	  _M_data->_M_month11 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
++	  _M_data->_M_month12 = __u.__w;
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
++	  _M_data->_M_amonth01 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
++	  _M_data->_M_amonth02 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
++	  _M_data->_M_amonth03 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
++	  _M_data->_M_amonth04 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
++	  _M_data->_M_amonth05 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
++	  _M_data->_M_amonth06 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
++	  _M_data->_M_amonth07 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
++	  _M_data->_M_amonth08 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
++	  _M_data->_M_amonth09 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
++	  _M_data->_M_amonth10 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
++	  _M_data->_M_amonth11 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
++	  _M_data->_M_amonth12 = __u.__w;
++	}
++#endif // 0
++    }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+new file mode 100644
+index 0000000..ba8e858
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -0,0 +1,68 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++  template<typename _CharT>
++    __timepunct<_CharT>::__timepunct(size_t __refs)
++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++    _M_name_timepunct(_S_get_c_name())
++    { _M_initialize_timepunct(); }
++
++  template<typename _CharT>
++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
++    _M_name_timepunct(_S_get_c_name())
++    { _M_initialize_timepunct(); }
++
++  template<typename _CharT>
++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
++				     size_t __refs)
++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++    _M_name_timepunct(__s)
++    {
++      char* __tmp = new char[std::strlen(__s) + 1];
++      std::strcpy(__tmp, __s);
++      _M_name_timepunct = __tmp;
++      _M_initialize_timepunct(__cloc);
++    }
++
++  template<typename _CharT>
++    __timepunct<_CharT>::~__timepunct()
++    {
++      if (_M_name_timepunct != _S_get_c_name())
++	delete [] _M_name_timepunct;
++      delete _M_data;
++      _S_destroy_c_locale(_M_c_locale_timepunct);
++    }
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index f40ddcf..c57a751 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -15822,6 +15822,9 @@ fi
+   # Default to "generic".
+   if test $enable_clocale_flag = auto; then
+     case ${target_os} in
++      *-uclibc*)
++        enable_clocale_flag=uclibc
++        ;;
+       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ 	enable_clocale_flag=gnu
+ 	;;
+@@ -16079,6 +16082,78 @@ $as_echo "newlib" >&6; }
+       CTIME_CC=config/locale/generic/time_members.cc
+       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+       ;;
++    uclibc)
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: uclibc" >&5
++$as_echo "uclibc" >&6; }
++
++      # Declare intention to use gettext, and add support for specific
++      # languages.
++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++      ALL_LINGUAS="de fr"
++
++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++      # Extract the first word of "msgfmt", so it can be a program name with args.
++set dummy msgfmt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_check_msgfmt+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$check_msgfmt"; then
++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_check_msgfmt="yes"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
++fi
++fi
++check_msgfmt=$ac_cv_prog_check_msgfmt
++if test -n "$check_msgfmt"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_msgfmt" >&5
++$as_echo "$check_msgfmt" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++        USE_NLS=yes
++      fi
++      # Export the build objects.
++      for ling in $ALL_LINGUAS; do \
++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++      done
++
++
++
++      CLOCALE_H=config/locale/uclibc/c_locale.h
++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++      CMESSAGES_H=config/locale/uclibc/messages_members.h
++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++      CTIME_H=config/locale/uclibc/time_members.h
++      CTIME_CC=config/locale/uclibc/time_members.cc
++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++      ;;
+   esac
+ 
+   # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/include/c_compatibility/wchar.h b/libstdc++-v3/include/c_compatibility/wchar.h
+index 580d725..3fe61b8 100644
+--- a/libstdc++-v3/include/c_compatibility/wchar.h
++++ b/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -101,7 +101,9 @@ using std::wmemcmp;
+ using std::wmemcpy;
+ using std::wmemmove;
+ using std::wmemset;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using std::wcsftime;
++#endif
+ 
+ #if _GLIBCXX_USE_C99
+ using std::wcstold;
+diff --git a/libstdc++-v3/include/c_std/cwchar b/libstdc++-v3/include/c_std/cwchar
+index 0e6b1fc..405aee2 100644
+--- a/libstdc++-v3/include/c_std/cwchar
++++ b/libstdc++-v3/include/c_std/cwchar
+@@ -175,7 +175,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+   using ::wcscoll;
+   using ::wcscpy;
+   using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+   using ::wcsftime;
++#endif
+   using ::wcslen;
+   using ::wcsncat;
+   using ::wcsncmp;
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0005-uclibc-locale-no__x.patch b/meta/recipes-devtools/gcc/gcc-4.8/0005-uclibc-locale-no__x.patch
new file mode 100644
index 0000000..dcbbfe4
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0005-uclibc-locale-no__x.patch
@@ -0,0 +1,257 @@
+From 6a3e8506a12c12728d8b29901defd738be43757f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:42:36 +0400
+Subject: [PATCH 05/35] uclibc-locale-no__x
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h      |   45 ++++++++++++++++++++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc      |   14 ------
+ libstdc++-v3/config/locale/uclibc/c_locale.h       |    1 +
+ .../config/locale/uclibc/collate_members.cc        |    7 ---
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc |    7 ---
+ .../config/locale/uclibc/messages_members.cc       |    7 +--
+ .../config/locale/uclibc/messages_members.h        |   18 +++-----
+ .../config/locale/uclibc/monetary_members.cc       |    4 --
+ .../config/locale/uclibc/numeric_members.cc        |    3 --
+ libstdc++-v3/config/locale/uclibc/time_members.cc  |    3 --
+ 10 files changed, 55 insertions(+), 54 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index 2ae3e4a..e74fddf 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
+ extern "C" __typeof(wctype_l) __wctype_l;
+ #endif
+ 
++# define __nl_langinfo_l nl_langinfo_l
++# define __strcoll_l strcoll_l
++# define __strftime_l strftime_l
++# define __strtod_l strtod_l
++# define __strtof_l strtof_l
++# define __strtold_l strtold_l
++# define __strxfrm_l strxfrm_l
++# define __newlocale newlocale
++# define __freelocale freelocale
++# define __duplocale duplocale
++# define __uselocale uselocale
++
++# ifdef _GLIBCXX_USE_WCHAR_T
++#  define __iswctype_l iswctype_l
++#  define __towlower_l towlower_l
++#  define __towupper_l towupper_l
++#  define __wcscoll_l wcscoll_l
++#  define __wcsftime_l wcsftime_l
++#  define __wcsxfrm_l wcsxfrm_l
++#  define __wctype_l wctype_l
++# endif
++
++#else
++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
++# define __strtod_l(S, E, L)         strtod((S), (E))
++# define __strtof_l(S, E, L)         strtof((S), (E))
++# define __strtold_l(S, E, L)        strtold((S), (E))
++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
++# warning should dummy __newlocale check for C|POSIX ?
++# define __newlocale(a, b, c)        NULL
++# define __freelocale(a)             ((void)0)
++# define __duplocale(a)              __c_locale()
++//# define __uselocale ?
++//
++# ifdef _GLIBCXX_USE_WCHAR_T
++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
++#  define __towlower_l(C, L)          towlower((C))
++#  define __towupper_l(C, L)          towupper((C))
++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T))
++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
++#  define __wctype_l(S, L)            wctype((S))
++# endif
++
+ #endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 5081dc1..21430d0 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,20 +39,6 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
+-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
+-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
+-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
+-#define __strtof_l(S, E, L)         strtof((S), (E))
+-#define __strtod_l(S, E, L)         strtod((S), (E))
+-#define __strtold_l(S, E, L)        strtold((S), (E))
+-#warning should dummy __newlocale check for C|POSIX ?
+-#define __newlocale(a, b, c)        NULL
+-#define __freelocale(a)             ((void)0)
+-#define __duplocale(a)              __c_locale()
+-#endif
+-
+ namespace std
+ {
+   template<>
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index da07c1f..4bca5f1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -68,6 +68,7 @@ namespace __gnu_cxx
+ {
+   extern "C" __typeof(uselocale) __uselocale;
+ }
++#define __uselocale uselocale
+ #endif
+ 
+ namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+index c2664a7..ec5c329 100644
+--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -36,13 +36,6 @@
+ #include <locale>
+ #include <bits/c++locale_internal.h>
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
+-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
+-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
+-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
+-#endif
+-
+ namespace std
+ {
+   // These are basically extensions to char_traits, and perhaps should
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7294e3a..7b12861 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -38,13 +38,6 @@
+ #undef _LIBC
+ #include <bits/c++locale_internal.h>
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __wctype_l(S, L)           wctype((S))
+-#define __towupper_l(C, L)         towupper((C))
+-#define __towlower_l(C, L)         towlower((C))
+-#define __iswctype_l(C, M, L)      iswctype((C), (M))
+-#endif
+-
+ namespace std
+ {
+   // NB: The other ctype<char> specializations are in src/locale.cc and
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+index 13594d9..d7693b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -39,13 +39,10 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix gettext stuff
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__dcgettext(const char *domainname,
+-			     const char *msgid, int category);
+ #undef gettext
+-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
+ #else
+-#undef gettext
+ #define gettext(msgid) (msgid)
+ #endif
+ 
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 1424078..d89da33 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -36,15 +36,11 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__textdomain(const char *domainname);
+-extern "C" char *__bindtextdomain(const char *domainname,
+-				  const char *dirname);
+-#else
+-#undef __textdomain
+-#undef __bindtextdomain
+-#define __textdomain(D)           ((void)0)
+-#define __bindtextdomain(D,P)     ((void)0)
++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#undef textdomain
++#undef bindtextdomain
++#define textdomain(D)           ((void)0)
++#define bindtextdomain(D,P)     ((void)0)
+ #endif
+ 
+   // Non-virtual member functions.
+@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+ 			   const char* __dir) const
+     {
+-      __bindtextdomain(__s.c_str(), __dir);
++      bindtextdomain(__s.c_str(), __dir);
+       return this->do_open(__s, __loc);
+     }
+ 
+@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+     {
+       // No error checking is done, assume the catalog exists and can
+       // be used.
+-      __textdomain(__s.c_str());
++      textdomain(__s.c_str());
+       return 0;
+     }
+ 
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index aa52731..2e6f80a 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -43,10 +43,6 @@
+ #warning tailor for stub locale support
+ #endif
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
+-#endif
+-
+ namespace std
+ {
+   // Construct and return valid pattern consisting of some combination of:
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 883ec1a..2c70642 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -41,9 +41,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
+-#endif
+ 
+ namespace std
+ {
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index e0707d7..d848ed5 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -40,9 +40,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
+-#endif
+ 
+ namespace std
+ {
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0006-uclibc-locale-wchar_fix.patch b/meta/recipes-devtools/gcc/gcc-4.8/0006-uclibc-locale-wchar_fix.patch
new file mode 100644
index 0000000..3406859
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0006-uclibc-locale-wchar_fix.patch
@@ -0,0 +1,68 @@
+From 225511a3aeb193a916b3999f0b640a392caa67cd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:45:57 +0400
+Subject: [PATCH 06/35] uclibc-locale-wchar_fix
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/monetary_members.cc |    4 ++--
+ libstdc++-v3/config/locale/uclibc/numeric_members.cc  |   13 +++++++++++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 2e6f80a..31ebb9f 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -401,7 +401,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+@@ -556,7 +556,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 2c70642..d5c8961 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -127,12 +127,25 @@ namespace std
+ 	{
+ 	  // Named locale.
+ 	  // NB: In the GNU model wchar_t is always 32 bit wide.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be numeric
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
+ 	  union { char *__s; wchar_t __w; } __u;
+ 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
+ 	  _M_data->_M_decimal_point = __u.__w;
+ 
+ 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
+ 	  _M_data->_M_thousands_sep = __u.__w;
++#endif
+ 
+ 	  if (_M_data->_M_thousands_sep == L'\0')
+ 	    _M_data->_M_grouping = "";
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0007-uclibc-locale-update.patch b/meta/recipes-devtools/gcc/gcc-4.8/0007-uclibc-locale-update.patch
new file mode 100644
index 0000000..5851123
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0007-uclibc-locale-update.patch
@@ -0,0 +1,542 @@
+From 6ffe7c46f52d27864c3df3663e16ec9ddee71e8f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:46:58 +0400
+Subject: [PATCH 07/35] uclibc-locale-update
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h      |    3 +
+ libstdc++-v3/config/locale/uclibc/c_locale.cc      |   74 +++++++++-----------
+ libstdc++-v3/config/locale/uclibc/c_locale.h       |   42 ++++++-----
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc |   51 ++++++++++----
+ .../config/locale/uclibc/messages_members.h        |   12 ++--
+ .../config/locale/uclibc/monetary_members.cc       |   34 +++++----
+ .../config/locale/uclibc/numeric_members.cc        |    5 ++
+ libstdc++-v3/config/locale/uclibc/time_members.cc  |   18 +++--
+ libstdc++-v3/config/locale/uclibc/time_members.h   |   17 +++--
+ 9 files changed, 158 insertions(+), 98 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index e74fddf..971a6b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -31,6 +31,9 @@
+ 
+ #include <bits/c++config.h>
+ #include <clocale>
++#include <cstdlib>
++#include <cstring>
++#include <cstddef>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning clean this up
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 21430d0..1b9d8e1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,23 +39,20 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+ 
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+   template<>
+     void
+     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
+ 		   const __c_locale& __cloc)
+     {
+-      if (!(__err & ios_base::failbit))
+-	{
+-	  char* __sanity;
+-	  errno = 0;
+-	  float __f = __strtof_l(__s, &__sanity, __cloc);
+-          if (__sanity != __s && errno != ERANGE)
+-	    __v = __f;
+-	  else
+-	    __err |= ios_base::failbit;
+-	}
++      char* __sanity;
++      errno = 0;
++      float __f = __strtof_l(__s, &__sanity, __cloc);
++      if (__sanity != __s && errno != ERANGE)
++	__v = __f;
++      else
++	__err |= ios_base::failbit;
+     }
+ 
+   template<>
+@@ -63,16 +60,13 @@ namespace std
+     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
+ 		   const __c_locale& __cloc)
+     {
+-      if (!(__err & ios_base::failbit))
+-	{
+-	  char* __sanity;
+-	  errno = 0;
+-	  double __d = __strtod_l(__s, &__sanity, __cloc);
+-          if (__sanity != __s && errno != ERANGE)
+-	    __v = __d;
+-	  else
+-	    __err |= ios_base::failbit;
+-	}
++      char* __sanity;
++      errno = 0;
++      double __d = __strtod_l(__s, &__sanity, __cloc);
++      if (__sanity != __s && errno != ERANGE)
++	__v = __d;
++      else
++	__err |= ios_base::failbit;
+     }
+ 
+   template<>
+@@ -80,16 +74,13 @@ namespace std
+     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
+ 		   const __c_locale& __cloc)
+     {
+-      if (!(__err & ios_base::failbit))
+-	{
+-	  char* __sanity;
+-	  errno = 0;
+-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
+-          if (__sanity != __s && errno != ERANGE)
+-	    __v = __ld;
+-	  else
+-	    __err |= ios_base::failbit;
+-	}
++      char* __sanity;
++      errno = 0;
++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
++      if (__sanity != __s && errno != ERANGE)
++	__v = __ld;
++      else
++	__err |= ios_base::failbit;
+     }
+ 
+   void
+@@ -110,17 +101,18 @@ namespace std
+   void
+   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
+   {
+-    if (_S_get_c_locale() != __cloc)
++    if (__cloc && _S_get_c_locale() != __cloc)
+       __freelocale(__cloc);
+   }
+ 
+   __c_locale
+   locale::facet::_S_clone_c_locale(__c_locale& __cloc)
+   { return __duplocale(__cloc); }
+-} // namespace std
+ 
+-namespace __gnu_cxx
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
++
+   const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
+     {
+       "LC_CTYPE",
+@@ -138,9 +130,11 @@ namespace __gnu_cxx
+       "LC_IDENTIFICATION"
+ #endif
+     };
+-}
+ 
+-namespace std
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+   const char* const* const locale::_S_categories = __gnu_cxx::category_names;
+-}  // namespace std
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index 4bca5f1..64a6d46 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -39,21 +39,23 @@
+ #pragma GCC system_header
+ 
+ #include <cstring>              // get std::strlen
+-#include <cstdio>               // get std::snprintf or std::sprintf
++#include <cstdio>               // get std::vsnprintf or std::vsprintf
+ #include <clocale>
+ #include <langinfo.h>		// For codecvt
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix this
+ #endif
+-#ifdef __UCLIBC_HAS_LOCALE__
++#ifdef _GLIBCXX_USE_ICONV
+ #include <iconv.h>		// For codecvt using iconv, iconv_t
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-#include <libintl.h> 		// For messages
++#ifdef HAVE_LIBINTL_H
++#include <libintl.h>		// For messages
+ #endif
++#include <cstdarg>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning what is _GLIBCXX_C_LOCALE_GNU for
++// psm: used in os/gnu-linux/ctype_noninline.h
+ #endif
+ #define _GLIBCXX_C_LOCALE_GNU 1
+ 
+@@ -78,23 +80,25 @@ namespace std
+ #else
+   typedef int*			__c_locale;
+ #endif
+-
+-  // Convert numeric value of type _Tv to string and return length of
+-  // string.  If snprintf is available use it, otherwise fall back to
+-  // the unsafe sprintf which, in general, can be dangerous and should
++  // Convert numeric value of type double to string and return length of
++  // string.  If vsnprintf is available use it, otherwise fall back to
++  // the unsafe vsprintf which, in general, can be dangerous and should
+   // be avoided.
+-  template<typename _Tv>
+-    int
+-    __convert_from_v(char* __out,
+-		     const int __size __attribute__ ((__unused__)),
+-		     const char* __fmt,
+-#ifdef __UCLIBC_HAS_XCLOCALE__
+-		     _Tv __v, const __c_locale& __cloc, int __prec)
++    inline int
++    __convert_from_v(const __c_locale&
++#ifndef __UCLIBC_HAS_XCLOCALE__
++	__cloc __attribute__ ((__unused__))
++#endif
++		     ,
++		     char* __out,
++		     const int __size,
++		     const char* __fmt, ...)
+     {
++      va_list __args;
++#ifdef __UCLIBC_HAS_XCLOCALE__
++
+       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+ #else
+-		     _Tv __v, const __c_locale&, int __prec)
+-    {
+ # ifdef __UCLIBC_HAS_LOCALE__
+       char* __old = std::setlocale(LC_ALL, NULL);
+       char* __sav = new char[std::strlen(__old) + 1];
+@@ -103,7 +107,9 @@ namespace std
+ # endif
+ #endif
+ 
+-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++      va_start(__args, __fmt);
++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
++      va_end(__args);
+ 
+ #ifdef __UCLIBC_HAS_XCLOCALE__
+       __gnu_cxx::__uselocale(__old);
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7b12861..13e011d 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -33,16 +33,20 @@
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+ 
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+   // NB: The other ctype<char> specializations are in src/locale.cc and
+   // various /config/os/* files.
+-  template<>
+     ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
+     : ctype<char>(0, false, __refs)
+     {
+@@ -57,6 +61,8 @@ namespace std
+ #endif
+ 	}
+     }
++    ctype_byname<char>::~ctype_byname()
++    { }
+ 
+ #ifdef _GLIBCXX_USE_WCHAR_T
+   ctype<wchar_t>::__wmask_type
+@@ -138,17 +144,33 @@ namespace std
+   ctype<wchar_t>::
+   do_is(mask __m, wchar_t __c) const
+   {
+-    // Highest bitmask in ctype_base == 10, but extra in "C"
+-    // library for blank.
++    // The case of __m == ctype_base::space is particularly important,
++    // due to its use in many istream functions.  Therefore we deal with
++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
++    // is the mask corresponding to ctype_base::space.  NB: an encoding
++    // change would not affect correctness!
++
+     bool __ret = false;
+-    const size_t __bitmasksize = 11;
+-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+-      if (__m & _M_bit[__bitcur]
+-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
+-	{
+-	  __ret = true;
+-	  break;
+-	}
++    if (__m == _M_bit[5])
++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
++    else
++      {
++	// Highest bitmask in ctype_base == 10, but extra in "C"
++	// library for blank.
++	const size_t __bitmasksize = 11;
++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++	  if (__m & _M_bit[__bitcur])
++	    {
++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++		{
++		  __ret = true;
++		  break;
++		}
++	      else if (__m == _M_bit[__bitcur])
++		break;
++	    }
++      }
++
+     return __ret;
+   }
+ 
+@@ -290,4 +312,5 @@ namespace std
+ #endif
+   }
+ #endif //  _GLIBCXX_USE_WCHAR_T
+-}
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index d89da33..067657a 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -53,12 +53,16 @@
+   template<typename _CharT>
+      messages<_CharT>::messages(__c_locale __cloc, const char* __s,
+ 				size_t __refs)
+-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
+-     _M_name_messages(__s)
++     : facet(__refs), _M_c_locale_messages(NULL),
++     _M_name_messages(NULL)
+      {
+-       char* __tmp = new char[std::strlen(__s) + 1];
+-       std::strcpy(__tmp, __s);
++       const size_t __len = std::strlen(__s) + 1;
++       char* __tmp = new char[__len];
++       std::memcpy(__tmp, __s, __len);
+        _M_name_messages = __tmp;
++
++       // Last to avoid leaking memory if new throws.
++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
+      }
+ 
+   template<typename _CharT>
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 31ebb9f..7679b9c 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -33,9 +33,14 @@
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -206,7 +211,7 @@ namespace std
+ 	  }
+ 	break;
+       default:
+-	;
++	__ret = pattern();
+       }
+     return __ret;
+   }
+@@ -390,7 +395,9 @@ namespace std
+ 	  __c_locale __old = __uselocale(__cloc);
+ #else
+ 	  // Switch to named locale so that mbsrtowcs will work.
+-	  char* __old = strdup(setlocale(LC_ALL, NULL));
++  	  char* __old = setlocale(LC_ALL, NULL);
++          const size_t __llen = strlen(__old) + 1;
++          char* __sav = new char[__llen];
+ 	  setlocale(LC_ALL, __name);
+ #endif
+ 
+@@ -477,8 +484,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	      __uselocale(__old);
+ #else
+-	      setlocale(LC_ALL, __old);
+-	      free(__old);
++	      setlocale(LC_ALL, __sav);
++	      delete [] __sav;
+ #endif
+ 	      __throw_exception_again;
+ 	    }
+@@ -498,8 +505,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	  __uselocale(__old);
+ #else
+-	  setlocale(LC_ALL, __old);
+-	  free(__old);
++	  setlocale(LC_ALL, __sav);
++	  delete [] __sav;
+ #endif
+ 	}
+     }
+@@ -545,8 +552,11 @@ namespace std
+ 	  __c_locale __old = __uselocale(__cloc);
+ #else
+ 	  // Switch to named locale so that mbsrtowcs will work.
+-	  char* __old = strdup(setlocale(LC_ALL, NULL));
+-	  setlocale(LC_ALL, __name);
++          char* __old = setlocale(LC_ALL, NULL);
++          const size_t __llen = strlen(__old) + 1;
++          char* __sav = new char[__llen];
++          memcpy(__sav, __old, __llen);
++          setlocale(LC_ALL, __name);
+ #endif
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -633,8 +643,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	      __uselocale(__old);
+ #else
+-	      setlocale(LC_ALL, __old);
+-	      free(__old);
++	      setlocale(LC_ALL, __sav);
++	      delete [] __sav;
+ #endif
+               __throw_exception_again;
+ 	    }
+@@ -653,8 +663,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	  __uselocale(__old);
+ #else
+-	  setlocale(LC_ALL, __old);
+-	  free(__old);
++	  setlocale(LC_ALL, __sav);
++	  delete [] __sav;
+ #endif
+ 	}
+     }
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index d5c8961..8ae8969 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -33,9 +33,14 @@
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index d848ed5..f24d53e 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -53,11 +53,14 @@ namespace std
+       const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
+ 					_M_c_locale_timepunct);
+ #else
+-      char* __old = strdup(setlocale(LC_ALL, NULL));
++      char* __old = setlocale(LC_ALL, NULL);
++      const size_t __llen = strlen(__old) + 1;
++      char* __sav = new char[__llen];
++      memcpy(__sav, __old, __llen);
+       setlocale(LC_ALL, _M_name_timepunct);
+       const size_t __len = strftime(__s, __maxlen, __format, __tm);
+-      setlocale(LC_ALL, __old);
+-      free(__old);
++      setlocale(LC_ALL, __sav);
++      delete [] __sav;
+ #endif
+       // Make sure __s is null terminated.
+       if (__len == 0)
+@@ -207,11 +210,14 @@ namespace std
+       const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
+ 					_M_c_locale_timepunct);
+ #else
+-      char* __old = strdup(setlocale(LC_ALL, NULL));
++      char* __old = setlocale(LC_ALL, NULL);
++      const size_t __llen = strlen(__old) + 1;
++      char* __sav = new char[__llen];
++      memcpy(__sav, __old, __llen);
+       setlocale(LC_ALL, _M_name_timepunct);
+       const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
+-      setlocale(LC_ALL, __old);
+-      free(__old);
++      setlocale(LC_ALL, __sav);
++      delete [] __sav;
+ #endif
+       // Make sure __s is null terminated.
+       if (__len == 0)
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index ba8e858..1665dde 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -50,12 +50,21 @@
+     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+ 				     size_t __refs)
+     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+-    _M_name_timepunct(__s)
++    _M_name_timepunct(NULL)
+     {
+-      char* __tmp = new char[std::strlen(__s) + 1];
+-      std::strcpy(__tmp, __s);
++      const size_t __len = std::strlen(__s) + 1;
++      char* __tmp = new char[__len];
++      std::memcpy(__tmp, __s, __len);
+       _M_name_timepunct = __tmp;
+-      _M_initialize_timepunct(__cloc);
++
++      try
++	{ _M_initialize_timepunct(__cloc); }
++      catch(...)
++	{
++	  delete [] _M_name_timepunct;
++	  __throw_exception_again;
++	}
++
+     }
+ 
+   template<typename _CharT>
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0008-missing-execinfo_h.patch b/meta/recipes-devtools/gcc/gcc-4.8/0008-missing-execinfo_h.patch
new file mode 100644
index 0000000..2823809
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0008-missing-execinfo_h.patch
@@ -0,0 +1,28 @@
+From 9f2158451981cf0a80cfabdc79ae31bb6976a801 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:48:10 +0400
+Subject: [PATCH 08/35] missing-execinfo_h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ boehm-gc/include/gc.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h
+index c51e017..a7ba8dc 100644
+--- a/boehm-gc/include/gc.h
++++ b/boehm-gc/include/gc.h
+@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+-     && !defined(__ia64__)
++     && !defined(__ia64__) && !defined(__UCLIBC__)
+ #   ifndef GC_HAVE_BUILTIN_BACKTRACE
+ #     define GC_HAVE_BUILTIN_BACKTRACE
+ #   endif
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0009-c99-snprintf.patch b/meta/recipes-devtools/gcc/gcc-4.8/0009-c99-snprintf.patch
new file mode 100644
index 0000000..7168778
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0009-c99-snprintf.patch
@@ -0,0 +1,28 @@
+From e393e076f1ab82d25e1aa04d6edea27b41d3eb06 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:49:03 +0400
+Subject: [PATCH 09/35] c99-snprintf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/include/c_std/cstdio |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/include/c_std/cstdio b/libstdc++-v3/include/c_std/cstdio
+index e85bd83..6af839a 100644
+--- a/libstdc++-v3/include/c_std/cstdio
++++ b/libstdc++-v3/include/c_std/cstdio
+@@ -139,7 +139,7 @@ namespace std
+   using ::vsprintf;
+ } // namespace std
+ 
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
+ 
+ #undef snprintf
+ #undef vfscanf
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0010-c99-complex-ugly-hack.patch b/meta/recipes-devtools/gcc/gcc-4.8/0010-c99-complex-ugly-hack.patch
new file mode 100644
index 0000000..b628571
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0010-c99-complex-ugly-hack.patch
@@ -0,0 +1,29 @@
+From 73f69d806e2c9561a54995223431a1076cfd6164 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:49:57 +0400
+Subject: [PATCH 10/35] c99-complex-ugly-hack
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libstdc++-v3/configure |    3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index c57a751..a1333e2 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -18734,6 +18734,9 @@ $as_echo_n "checking for ISO C99 support to TR1 in <complex.h>... " >&6; }
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #include <complex.h>
++#ifdef __UCLIBC__
++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
++#endif
+ int
+ main ()
+ {
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0011-index_macro.patch b/meta/recipes-devtools/gcc/gcc-4.8/0011-index_macro.patch
new file mode 100644
index 0000000..8ee79b0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0011-index_macro.patch
@@ -0,0 +1,44 @@
+From b037953e40312b45ab84ed0a3ad882bb5e413101 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:51:02 +0400
+Subject: [PATCH 11/35] index_macro
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/include/ext/rope       |    3 +++
+ libstdc++-v3/include/ext/ropeimpl.h |    3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
+index 38eb1e8..158d21a 100644
+--- a/libstdc++-v3/include/ext/rope
++++ b/libstdc++-v3/include/ext/rope
+@@ -55,6 +55,9 @@
+ #include <bits/gthr.h>
+ #include <tr1/functional>
+ 
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ # ifdef __GC
+ #   define __GC_CONST const
+ # else
+diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
+index d7b5cbd..b9b3acb 100644
+--- a/libstdc++-v3/include/ext/ropeimpl.h
++++ b/libstdc++-v3/include/ext/ropeimpl.h
+@@ -48,6 +48,9 @@
+ #include <ext/memory> // For uninitialized_copy_n
+ #include <ext/numeric> // For power
+ 
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0012-libmudflap-susv3-legacy.patch b/meta/recipes-devtools/gcc/gcc-4.8/0012-libmudflap-susv3-legacy.patch
new file mode 100644
index 0000000..968d45e
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0012-libmudflap-susv3-legacy.patch
@@ -0,0 +1,64 @@
+From a0cb13bdd98a941b81fdafe4cd96e4c569feb651 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:52:36 +0400
+Subject: [PATCH 12/35] libmudflap-susv3-legacy
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libmudflap/mf-hooks2.c |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/libmudflap/mf-hooks2.c b/libmudflap/mf-hooks2.c
+index 4af17df..a3c6b2f 100644
+--- a/libmudflap/mf-hooks2.c
++++ b/libmudflap/mf-hooks2.c
+@@ -424,7 +424,7 @@ WRAPPER2(void, bzero, void *s, size_t n)
+ {
+   TRACE ("%s\n", __PRETTY_FUNCTION__);
+   MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
+-  bzero (s, n);
++  memset (s, 0, n);
+ }
+ 
+ 
+@@ -434,7 +434,7 @@ WRAPPER2(void, bcopy, const void *src, void *dest, size_t n)
+   TRACE ("%s\n", __PRETTY_FUNCTION__);
+   MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
+   MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
+-  bcopy (src, dest, n);
++  memmove (dest, src, n);
+ }
+ 
+ 
+@@ -444,7 +444,7 @@ WRAPPER2(int, bcmp, const void *s1, const void *s2, size_t n)
+   TRACE ("%s\n", __PRETTY_FUNCTION__);
+   MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
+   MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
+-  return bcmp (s1, s2, n);
++  return n == 0 ? 0 : memcmp (s1, s2, n);
+ }
+ 
+ 
+@@ -453,7 +453,7 @@ WRAPPER2(char *, index, const char *s, int c)
+   size_t n = strlen (s);
+   TRACE ("%s\n", __PRETTY_FUNCTION__);
+   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
+-  return index (s, c);
++  return strchr (s, c);
+ }
+ 
+ 
+@@ -462,7 +462,7 @@ WRAPPER2(char *, rindex, const char *s, int c)
+   size_t n = strlen (s);
+   TRACE ("%s\n", __PRETTY_FUNCTION__);
+   MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
+-  return rindex (s, c);
++  return strrchr (s, c);
+ }
+ 
+ /* XXX:  stpcpy, memccpy */
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0013-libstdc-namespace.patch b/meta/recipes-devtools/gcc/gcc-4.8/0013-libstdc-namespace.patch
new file mode 100644
index 0000000..4a3efde
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0013-libstdc-namespace.patch
@@ -0,0 +1,54 @@
+From 104e4d66208f2726b14d2f5eebce90700cbc83c8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:54:02 +0400
+Subject: [PATCH 13/35] libstdc++-namespace
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/messages_members.h |    4 +++-
+ libstdc++-v3/config/locale/uclibc/time_members.h     |    4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 067657a..dd76a6c 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -32,7 +32,8 @@
+ //
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+-
++namespace std
++{
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+@@ -116,3 +117,4 @@
+ 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s);
+ 	 }
+      }
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index 1665dde..905c433 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -33,7 +33,8 @@
+ //
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+-
++namespace std
++{
+   template<typename _CharT>
+     __timepunct<_CharT>::__timepunct(size_t __refs)
+     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+@@ -75,3 +76,4 @@
+       delete _M_data;
+       _S_destroy_c_locale(_M_c_locale_timepunct);
+     }
++}
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0014-sh-pr24836.patch b/meta/recipes-devtools/gcc/gcc-4.8/0014-sh-pr24836.patch
new file mode 100644
index 0000000..cb8fd52
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0014-sh-pr24836.patch
@@ -0,0 +1,45 @@
+From edc9acb181810f234b6b9f7d2820b0e4f6a1eeaf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:54:48 +0400
+Subject: [PATCH 14/35] sh-pr24836
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
+---
+ gcc/configure    |    2 +-
+ gcc/configure.ac |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index e12a180..135bbf5 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -23378,7 +23378,7 @@ foo:	.long	25
+ 	tls_first_minor=14
+ 	tls_as_opt="-m64 -Aesame --fatal-warnings"
+ 	;;
+-  sh-*-* | sh[34]-*-*)
++  sh-*-* | sh[34]*-*-*)
+     conftest_s='
+ 	.section ".tdata","awT",@progbits
+ foo:	.long	25
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index eba3577..6363a21 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -3141,7 +3141,7 @@ foo:	.long	25
+ 	tls_first_minor=14
+ 	tls_as_opt="-m64 -Aesame --fatal-warnings"
+ 	;;
+-  sh-*-* | sh[34]-*-*)
++  sh-*-* | sh[34]*-*-*)
+     conftest_s='
+ 	.section ".tdata","awT",@progbits
+ foo:	.long	25
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch b/meta/recipes-devtools/gcc/gcc-4.8/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch
new file mode 100644
index 0000000..1081222
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch
@@ -0,0 +1,29 @@
+From 50e5366005b0f6af27378e2a5c3cb9f9936a7e62 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:58:36 +0400
+Subject: [PATCH 15/35] arm: Use TARGET_ENDIAN_OPTION for determining
+ MULTILIB_DEFAULTS
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/arm/linux-elf.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
+index 488efa4..753dc3a 100644
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -46,7 +46,7 @@
+ 
+ #undef  MULTILIB_DEFAULTS
+ #define MULTILIB_DEFAULTS \
+-	{ "marm", "mlittle-endian", "mfloat-abi=hard", "mno-thumb-interwork" }
++	{ "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=hard", "mno-thumb-interwork" }
+ 
+ /* Now we define the strings used to build the spec file.  */
+ #undef  LIB_SPEC
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0016-gcc-poison-system-directories.patch b/meta/recipes-devtools/gcc/gcc-4.8/0016-gcc-poison-system-directories.patch
new file mode 100644
index 0000000..c955e49
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0016-gcc-poison-system-directories.patch
@@ -0,0 +1,221 @@
+From 160397ef3c3331099af028f1b8d3e085b07d88ad Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:59:00 +0400
+Subject: [PATCH 16/35] gcc: poison-system-directories
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+---
+ gcc/Makefile.in     |    2 +-
+ gcc/common.opt      |    4 ++++
+ gcc/config.in       |    6 ++++++
+ gcc/configure       |   20 ++++++++++++++++++--
+ gcc/configure.ac    |   10 ++++++++++
+ gcc/doc/invoke.texi |    9 +++++++++
+ gcc/gcc.c           |    2 ++
+ gcc/incpath.c       |   19 +++++++++++++++++++
+ 8 files changed, 69 insertions(+), 3 deletions(-)
+
+Index: gcc-4.8.4/gcc/Makefile.in
+===================================================================
+--- gcc-4.8.4.orig/gcc/Makefile.in
++++ gcc-4.8.4/gcc/Makefile.in
+@@ -2019,7 +2019,7 @@ attribs.o : attribs.c $(CONFIG_H) $(SYST
+ 
+ incpath.o: incpath.c incpath.h $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) \
+ 		intl.h prefix.h coretypes.h $(TM_H) cppdefault.h $(TARGET_H) \
+-		$(MACHMODE_H)
++		$(MACHMODE_H) $(FLAGS_H) toplev.h
+ 
+ CFLAGS-prefix.o += -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s)
+ prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h prefix.h \
+Index: gcc-4.8.4/gcc/common.opt
+===================================================================
+--- gcc-4.8.4.orig/gcc/common.opt
++++ gcc-4.8.4/gcc/common.opt
+@@ -595,6 +595,10 @@ Wpedantic
+ Common Var(pedantic) Warning
+ Issue warnings needed for strict compliance to the standard
+ 
++Wpoison-system-directories
++Common Var(flag_poison_system_directories) Init(1) Warning
++Warn for -I and -L options using system directories if cross compiling
++
+ Wshadow
+ Common Var(warn_shadow) Warning
+ Warn when one local variable shadows another
+Index: gcc-4.8.4/gcc/config.in
+===================================================================
+--- gcc-4.8.4.orig/gcc/config.in
++++ gcc-4.8.4/gcc/config.in
+@@ -138,6 +138,12 @@
+ #endif
+ 
+ 
++/* Define to warn for use of native system header directories */
++#ifndef USED_FOR_TARGET
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++#endif
++
++
+ /* Define if you want all operations on RTL (the basic data structure of the
+    optimizer and back end) to be checked for dynamic type safety at runtime.
+    This is quite expensive. */
+Index: gcc-4.8.4/gcc/configure
+===================================================================
+--- gcc-4.8.4.orig/gcc/configure
++++ gcc-4.8.4/gcc/configure
+@@ -918,6 +918,7 @@ with_gc
+ with_system_zlib
+ enable_maintainer_mode
+ enable_version_specific_runtime_libs
++enable_poison_system_directories
+ enable_plugin
+ enable_libquadmath_support
+ with_linker_hash_style
+@@ -1639,6 +1640,8 @@ Optional Features:
+   --enable-version-specific-runtime-libs
+                           specify that runtime libraries should be installed
+                           in a compiler-specific directory
++  --enable-poison-system-directories
++                          warn for use of native system header directories
+   --enable-plugin         enable plugin support
+   --disable-libquadmath-support
+                           disable libquadmath support for Fortran
+@@ -17847,7 +17850,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 17850 "configure"
++#line 17853 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -17953,7 +17956,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 17956 "configure"
++#line 17959 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -27219,6 +27222,19 @@ if test "${enable_version_specific_runti
+ fi
+ 
+ 
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++  enableval=$enable_poison_system_directories;
++else
++  enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
++
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
++
+ # Substitute configuration variables
+ 
+ 
+Index: gcc-4.8.4/gcc/configure.ac
+===================================================================
+--- gcc-4.8.4.orig/gcc/configure.ac
++++ gcc-4.8.4/gcc/configure.ac
+@@ -5120,6 +5120,16 @@ AC_ARG_ENABLE(version-specific-runtime-l
+                 [specify that runtime libraries should be
+                  installed in a compiler-specific directory])])
+ 
++AC_ARG_ENABLE([poison-system-directories],
++             AS_HELP_STRING([--enable-poison-system-directories],
++                            [warn for use of native system header directories]),,
++             [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++  AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++           [1],
++           [Define to warn for use of native system header directories])
++fi
++
+ # Substitute configuration variables
+ AC_SUBST(subdirs)
+ AC_SUBST(srcdir)
+Index: gcc-4.8.4/gcc/doc/invoke.texi
+===================================================================
+--- gcc-4.8.4.orig/gcc/doc/invoke.texi
++++ gcc-4.8.4/gcc/doc/invoke.texi
+@@ -258,6 +258,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
+ -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
+ -Wpointer-arith  -Wno-pointer-to-int-cast @gol
++-Wno-poison-system-directories @gol
+ -Wredundant-decls  -Wno-return-local-addr @gol
+ -Wreturn-type  -Wsequence-point  -Wshadow @gol
+ -Wsign-compare  -Wsign-conversion  -Wsizeof-pointer-memaccess @gol
+@@ -4022,6 +4023,14 @@ headers---for that, @option{-Wunknown-pr
+  for most targets, it is made up of code and thus requires the stack
+  to be made executable in order for the program to work properly.
+ 
++@item -Wno-poison-system-directories
++@opindex Wno-poison-system-directories
++Do not warn for @option{-I} or @option{-L} options using system
++directories such as @file{/usr/include} when cross compiling.  This
++option is intended for use in chroot environments when such
++directories contain the correct headers and libraries for the target
++system rather than the host.
++
+ @item -Wfloat-equal
+ @opindex Wfloat-equal
+ @opindex Wno-float-equal
+Index: gcc-4.8.4/gcc/gcc.c
+===================================================================
+--- gcc-4.8.4.orig/gcc/gcc.c
++++ gcc-4.8.4/gcc/gcc.c
+@@ -741,6 +741,8 @@ proper position among the other output f
+    "%{fuse-ld=*:-fuse-ld=%*}\
+     %X %{o*} %{e*} %{N} %{n} %{r}\
+     %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}}\
++    %{Wno-poison-system-directories:--no-poison-system-directories}\
++    %{Werror=poison-system-directories:--error-poison-system-directories}\
+     %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
+     %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
+     %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
+Index: gcc-4.8.4/gcc/incpath.c
+===================================================================
+--- gcc-4.8.4.orig/gcc/incpath.c
++++ gcc-4.8.4/gcc/incpath.c
+@@ -28,6 +28,7 @@
+ #include "intl.h"
+ #include "incpath.h"
+ #include "cppdefault.h"
++#include "diagnostic-core.h"
+ 
+ /* Microsoft Windows does not natively support inodes.
+    VMS has non-numeric inodes.  */
+@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroo
+ 	}
+       fprintf (stderr, _("End of search list.\n"));
+     }
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++  if (flag_poison_system_directories)
++    {
++       struct cpp_dir *p;
++
++       for (p = heads[QUOTE]; p; p = p->next)
++         {
++          if ((!strncmp (p->name, "/usr/include", 12))
++              || (!strncmp (p->name, "/usr/local/include", 18))
++              || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++            warning (OPT_Wpoison_system_directories,
++                     "include location \"%s\" is unsafe for "
++                     "cross-compilation",
++                     p->name);
++         }
++    }
++#endif
+ }
+ 
+ /* Use given -I paths for #include "..." but not #include <...>, and
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0017-gcc-poison-dir-extend.patch b/meta/recipes-devtools/gcc/gcc-4.8/0017-gcc-poison-dir-extend.patch
new file mode 100644
index 0000000..9e81efd
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0017-gcc-poison-dir-extend.patch
@@ -0,0 +1,39 @@
+From e99c9c97266d6d3e8cac798aa91408250c4d60cf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:00:34 +0400
+Subject: [PATCH 17/35] gcc-poison-dir-extend
+
+Add /sw/include and /opt/include based on the original
+zecke-no-host-includes.patch patch.  The original patch checked for
+/usr/include, /sw/include and /opt/include and then triggered a failure and
+aborted.
+
+Instead, we add the two missing items to the current scan.  If the user
+wants this to be a failure, they can add "-Werror=poison-system-directories".
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/incpath.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index cd41c78..eac4a92 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -393,7 +393,9 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
+          {
+           if ((!strncmp (p->name, "/usr/include", 12))
+               || (!strncmp (p->name, "/usr/local/include", 18))
+-              || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++              || (!strncmp (p->name, "/usr/X11R6/include", 18))
++              || (!strncmp (p->name, "/sw/include", 11))
++              || (!strncmp (p->name, "/opt/include", 12)))
+             warning (OPT_Wpoison_system_directories,
+                      "include location \"%s\" is unsafe for "
+                      "cross-compilation",
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.8/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000..a28cafd
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
@@ -0,0 +1,73 @@
+From 56207fa2923e8edf774e98ffac82666091076be3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:08:31 +0400
+Subject: [PATCH 18/35] gcc-4.3.3: SYSROOT_CFLAGS_FOR_TARGET
+
+Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it.
+
+This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET.
+
+Other changes I had to do include:
+
+- moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though.
+
+- passing the right CFLAGS to configure scripts as exported environment variables
+
+I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do.
+
+Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3?
+
+Signed-off-by: Paolo Bonzini  <bonzini@gnu.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ configure |   32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+diff --git a/configure b/configure
+index 1b76c90..e4dce7c 100755
+--- a/configure
++++ b/configure
+@@ -6772,6 +6772,38 @@ fi
+ 
+ 
+ 
++# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
++# might be empty or "-g".  We don't require a C++ compiler, so CXXFLAGS
++# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
++# We want to ensure that TARGET libraries (which we know are built with
++# gcc) are built with "-O2 -g", so include those options when setting
++# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
++if test "x$CFLAGS_FOR_TARGET" = x; then
++  CFLAGS_FOR_TARGET=$CFLAGS
++  case " $CFLAGS " in
++    *" -O2 "*) ;;
++    *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
++  esac
++  case " $CFLAGS " in
++    *" -g "* | *" -g3 "*) ;;
++    *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
++  esac
++fi
++
++
++if test "x$CXXFLAGS_FOR_TARGET" = x; then
++  CXXFLAGS_FOR_TARGET=$CXXFLAGS
++  case " $CXXFLAGS " in
++    *" -O2 "*) ;;
++    *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;;
++  esac
++  case " $CXXFLAGS " in
++    *" -g "* | *" -g3 "*) ;;
++    *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
++  esac
++fi
++
++
+ # Handle --with-headers=XXX.  If the value is not "yes", the contents of
+ # the named directory are copied to $(tooldir)/sys-include.
+ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0019-64-bit-multilib-hack.patch b/meta/recipes-devtools/gcc/gcc-4.8/0019-64-bit-multilib-hack.patch
new file mode 100644
index 0000000..a975cfb
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0019-64-bit-multilib-hack.patch
@@ -0,0 +1,79 @@
+From 18fde5740b09324dfb9cf41e9849672573ff5fa0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:10:06 +0400
+Subject: [PATCH 19/35] 64-bit multilib hack.
+
+GCC has internal multilib handling code but it assumes a very specific rigid directory
+layout. The build system implementation of multilib layout is very generic and allows
+complete customisation of the library directories.
+
+This patch is a partial solution to allow any custom directories to be passed into gcc
+and handled correctly. It forces gcc to use the base_libdir (which is the current
+directory, "."). We need to do this for each multilib that is configured as we don't
+know which compiler options may be being passed into the compiler. Since we have a compiler
+per mulitlib at this point that isn't an issue.
+
+The one problem is the target compiler is only going to work for the default multlilib at
+this point. Ideally we'd figure out which multilibs were being enabled with which paths
+and be able to patch these entries with a complete set of correct paths but this we
+don't have such code at this point. This is something the target gcc recipe should do
+and override these platform defaults in its build config.
+
+RP 15/8/11
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/i386/t-linux64   |    6 ++----
+ gcc/config/mips/t-linux64   |   10 +++-------
+ gcc/config/rs6000/t-linux64 |    5 ++---
+ 3 files changed, 7 insertions(+), 14 deletions(-)
+
+Index: gcc-4.8.4/gcc/config/i386/t-linux64
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/i386/t-linux64
++++ gcc-4.8.4/gcc/config/i386/t-linux64
+@@ -32,7 +32,5 @@
+ #
+ comma=,
+ MULTILIB_OPTIONS    = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
+-MULTILIB_DIRNAMES   = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
+-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
++MULTILIB_DIRNAMES = . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+Index: gcc-4.8.4/gcc/config/mips/t-linux64
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/mips/t-linux64
++++ gcc-4.8.4/gcc/config/mips/t-linux64
+@@ -17,10 +17,6 @@
+ # <http://www.gnu.org/licenses/>.
+ 
+ MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
+-MULTILIB_DIRNAMES = n32 32 64
+-MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
+-MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
+-MULTILIB_OSDIRNAMES = \
+-	../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+-	../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+-	../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
++MULTILIB_DIRNAMES = . . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
++
+Index: gcc-4.8.4/gcc/config/rs6000/t-linux64
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/rs6000/t-linux64
++++ gcc-4.8.4/gcc/config/rs6000/t-linux64
+@@ -26,7 +26,6 @@
+ # MULTILIB_OSDIRNAMES according to what is found on the target.
+ 
+ MULTILIB_OPTIONS    := m64/m32
+-MULTILIB_DIRNAMES   := 64 32
++MULTILIB_DIRNAMES   := . .
+ MULTILIB_EXTRA_OPTS := 
+-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
++MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0020-optional-libstdc.patch b/meta/recipes-devtools/gcc/gcc-4.8/0020-optional-libstdc.patch
new file mode 100644
index 0000000..eff021e
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0020-optional-libstdc.patch
@@ -0,0 +1,102 @@
+From 307c8ff3ef666b7bd5ac733863f2fbb27a9d521e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:12:56 +0400
+Subject: [PATCH 20/35] optional libstdc
+
+gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++
+will not run correctly since by default the linker will try to link against libstdc++
+which shouldn't exist yet. We need an option to disable -lstdc++
+option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc
+driver. This patch adds such an option which only disables the -lstdc++.
+
+A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to
+do this officially, the likely answer is don't build libstdc++ separately.
+
+RP 29/6/10
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ gcc/c-family/c.opt  |    4 ++++
+ gcc/cp/g++spec.c    |    1 +
+ gcc/doc/invoke.texi |    9 +++++++--
+ gcc/gcc.c           |    1 +
+ 4 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index 10ae84d..dc3ffdf 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1299,6 +1299,10 @@ nostdinc++
+ C++ ObjC++
+ Do not search standard system include directories for C++
+ 
++nostdlib++
++Driver
++Do not link standard C++ runtime library
++
+ o
+ C ObjC C++ ObjC++ Joined Separate
+ ; Documented in common.opt
+diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
+index b896eea..f55216b 100644
+--- a/gcc/cp/g++spec.c
++++ b/gcc/cp/g++spec.c
+@@ -126,6 +126,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
+       switch (decoded_options[i].opt_index)
+ 	{
+ 	case OPT_nostdlib:
++	case OPT_nostdlib__:
+ 	case OPT_nodefaultlibs:
+ 	  library = -1;
+ 	  break;
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index a022622..f15c991 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -190,7 +190,7 @@ in the following sections.
+ -frepo  -fno-rtti  -fstats  -ftemplate-backtrace-limit=@var{n} @gol
+ -ftemplate-depth=@var{n} @gol
+ -fno-threadsafe-statics -fuse-cxa-atexit  -fno-weak  -nostdinc++ @gol
+--fno-default-inline  -fvisibility-inlines-hidden @gol
++-nostdlib++ -fno-default-inline  -fvisibility-inlines-hidden @gol
+ -fvisibility-ms-compat @gol
+ -fext-numeric-literals @gol
+ -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
+@@ -453,7 +453,7 @@ Objective-C and Objective-C++ Dialects}.
+ -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
+ -s  -static -static-libgcc -static-libstdc++ @gol
+ -static-libasan -static-libtsan @gol
+--shared -shared-libgcc  -symbolic @gol
++-shared -shared-libgcc  -symbolic -nostdlib++ @gol
+ -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
+ -u @var{symbol}}
+ 
+@@ -9886,6 +9886,11 @@ These entries are usually resolved by entries in
+ libc.  These entry points should be supplied through some other
+ mechanism when this option is specified.
+ 
++@item -nostdlib++
++@opindex nostdlib++
++Do not use the standard system C++ runtime libraries when linking.
++Only the libraries you specify will be passed to the linker.
++
+ @cindex @option{-lgcc}, use with @option{-nostdlib}
+ @cindex @option{-nostdlib} and unresolved references
+ @cindex unresolved references and @option{-nostdlib}
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index efdb625..477752f 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -748,6 +748,7 @@ proper position among the other output files.  */
+     %(mflib) " STACK_SPLIT_SPEC "\
+     %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
+     %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
++    %{!nostdlib++:}\
+     %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
+ #endif
+ 
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/meta/recipes-devtools/gcc/gcc-4.8/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
new file mode 100644
index 0000000..eb3c61f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
@@ -0,0 +1,59 @@
+From 004696e054ae9dc71d512cc755ccc4074fc62b2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:14:20 +0400
+Subject: [PATCH 21/35] gcc: disable MASK_RELAX_PIC_CALLS bit
+
+The new feature added after 4.3.3
+"http://www.pubbs.net/200909/gcc/94048-patch-add-support-for-rmipsjalr.html"
+will cause cc1plus eat up all the system memory when build webkit-gtk.
+The function mips_get_pic_call_symbol keeps on recursively calling itself.
+Disable this feature to walk aside the bug.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure    |    7 -------
+ gcc/configure.ac |    7 -------
+ 2 files changed, 14 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index b65d21d..bdab45a 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -25829,13 +25829,6 @@ $as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6;
+         rm -f conftest.*
+       fi
+     fi
+-    if test $gcc_cv_as_ld_jalr_reloc = yes; then
+-      if test x$target_cpu_default = x; then
+-        target_cpu_default=MASK_RELAX_PIC_CALLS
+-      else
+-        target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+-      fi
+-    fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5
+ $as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; }
+ 
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index e226b85..5f5c909 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4099,13 +4099,6 @@ x:
+         rm -f conftest.*
+       fi
+     fi
+-    if test $gcc_cv_as_ld_jalr_reloc = yes; then
+-      if test x$target_cpu_default = x; then
+-        target_cpu_default=MASK_RELAX_PIC_CALLS
+-      else
+-        target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+-      fi
+-    fi
+     AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc)
+ 
+     AC_CACHE_CHECK([linker for .eh_frame personality relaxation],
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0022-COLLECT_GCC_OPTIONS.patch b/meta/recipes-devtools/gcc/gcc-4.8/0022-COLLECT_GCC_OPTIONS.patch
new file mode 100644
index 0000000..40c8abf
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0022-COLLECT_GCC_OPTIONS.patch
@@ -0,0 +1,38 @@
+From 7f5c9dcc71c8b83a0b5596266cc4bdf0936e8e00 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:16:28 +0400
+Subject: [PATCH 22/35] COLLECT_GCC_OPTIONS
+
+This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to
+invoke collect2.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/gcc.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 477752f..51062aa 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -4098,6 +4098,15 @@ set_collect_gcc_options (void)
+ 		sizeof ("COLLECT_GCC_OPTIONS=") - 1);
+ 
+   first_time = TRUE;
++#ifdef HAVE_LD_SYSROOT
++  if (target_system_root_changed && target_system_root)
++    {
++      obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
++      obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
++      obstack_grow (&collect_obstack, "'", 1);
++      first_time = FALSE;
++    }
++#endif
+   for (i = 0; (int) i < n_switches; i++)
+     {
+       const char *const *args;
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/meta/recipes-devtools/gcc/gcc-4.8/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
new file mode 100644
index 0000000..9e4435c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -0,0 +1,88 @@
+From 46d52439052f0876a92dcf8a0ab9c60d75c8030b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:17:25 +0400
+Subject: [PATCH 23/35] Use the defaults.h in ${B} instead of ${S}, and t-oe
+ in ${B}
+
+Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that
+the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/Makefile.in  |    2 +-
+ gcc/configure    |    4 ++--
+ gcc/configure.ac |    4 ++--
+ gcc/mkconfig.sh  |    4 ++--
+ 4 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 90a2bba..2320497 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -469,7 +469,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
+ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
+ 
+ xmake_file=@xmake_file@
+-tmake_file=@tmake_file@
++tmake_file=@tmake_file@ ./t-oe
+ TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
+ TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
+ TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
+diff --git a/gcc/configure b/gcc/configure
+index bdab45a..d587993 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11539,8 +11539,8 @@ for f in $tm_file; do
+        tm_include_list="${tm_include_list} $f"
+        ;;
+     defaults.h )
+-       tm_file_list="${tm_file_list} \$(srcdir)/$f"
+-       tm_include_list="${tm_include_list} $f"
++       tm_file_list="${tm_file_list} ./$f"
++       tm_include_list="${tm_include_list} ./$f"
+        ;;
+     * )
+        tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 5f5c909..5e5e84f 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1720,8 +1720,8 @@ for f in $tm_file; do
+        tm_include_list="${tm_include_list} $f"
+        ;;
+     defaults.h )
+-       tm_file_list="${tm_file_list} \$(srcdir)/$f"
+-       tm_include_list="${tm_include_list} $f"
++       tm_file_list="${tm_file_list} ./$f"
++       tm_include_list="${tm_include_list} ./$f"
+        ;;
+     * )
+        tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
+index 29fdfc7..e048dce 100644
+--- a/gcc/mkconfig.sh
++++ b/gcc/mkconfig.sh
+@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
+     if [ $# -ge 1 ]; then
+ 	echo '#ifdef IN_GCC' >> ${output}T
+ 	for file in "$@"; do
+-	    if test x"$file" = x"defaults.h"; then
++	    if test x"$file" = x"./defaults.h"; then
+ 		postpone_defaults_h="yes"
+ 	    else
+ 		echo "# include \"$file\"" >> ${output}T
+@@ -103,7 +103,7 @@ esac
+ 
+ # If we postponed including defaults.h, add the #include now.
+ if test x"$postpone_defaults_h" = x"yes"; then
+-    echo "# include \"defaults.h\"" >> ${output}T
++    echo "# include \"./defaults.h\"" >> ${output}T
+ fi
+ 
+ # Add multiple inclusion protection guard, part two.
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0024-PR-target-32219.patch b/meta/recipes-devtools/gcc/gcc-4.8/0024-PR-target-32219.patch
new file mode 100644
index 0000000..b47d841
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0024-PR-target-32219.patch
@@ -0,0 +1,67 @@
+From e0d15f4f8bf28c351b9215ca37f1caa24df0e1fd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:18:54 +0400
+Subject: [PATCH 24/35] PR target/32219
+
+* varasm.c (default_binds_local_p_1): Weak data is not local.
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Backport
+---
+ gcc/testsuite/gcc.dg/visibility-21.c |   14 ++++++++++++++
+ gcc/varasm.c                         |    9 ++++-----
+ 2 files changed, 18 insertions(+), 5 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.dg/visibility-21.c
+
+diff --git a/gcc/testsuite/gcc.dg/visibility-21.c b/gcc/testsuite/gcc.dg/visibility-21.c
+new file mode 100644
+index 0000000..be7deda
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/visibility-21.c
+@@ -0,0 +1,14 @@
++/* PR target/32219 */
++/* { dg-do run } */
++/* { dg-require-visibility "" } */
++/* { dg-options "-fPIC" { target fpic } } */
++
++extern void f() __attribute__((weak,visibility("hidden")));
++extern int puts( char const* );
++int main()
++{
++	if (f)
++		f();
++	return 0;
++}
++
+diff --git a/gcc/varasm.c b/gcc/varasm.c
+index 6648103..fadba78 100644
+--- a/gcc/varasm.c
++++ b/gcc/varasm.c
+@@ -6675,6 +6675,10 @@ default_binds_local_p_1 (const_tree exp, int shlib)
+   /* Static variables are always local.  */
+   else if (! TREE_PUBLIC (exp))
+     local_p = true;
++  /* hidden weak can't be overridden by something non-local, all
++     that is possible is that it is not defined at all. */
++  else if (DECL_WEAK (exp))
++    local_p = false;
+   /* A variable is local if the user has said explicitly that it will
+      be.  */
+   else if ((DECL_VISIBILITY_SPECIFIED (exp)
+@@ -6688,11 +6692,6 @@ default_binds_local_p_1 (const_tree exp, int shlib)
+      local.  */
+   else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
+     local_p = true;
+-  /* Default visibility weak data can be overridden by a strong symbol
+-     in another module and so are not local.  */
+-  else if (DECL_WEAK (exp)
+-	   && !resolved_locally)
+-    local_p = false;
+   /* If PIC, then assume that any global name can be overridden by
+      symbols resolved from other modules.  */
+   else if (shlib)
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0025-fortran-cross-compile-hack.patch b/meta/recipes-devtools/gcc/gcc-4.8/0025-fortran-cross-compile-hack.patch
new file mode 100644
index 0000000..0e7914d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0025-fortran-cross-compile-hack.patch
@@ -0,0 +1,46 @@
+From af8a56ea4e17b2909eff2c57704ab43ef24f28d3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:01 +0400
+Subject: [PATCH 25/35] fortran cross-compile hack.
+
+* Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used
+used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross
+directory.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libgfortran/configure    |    2 +-
+ libgfortran/configure.ac |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgfortran/configure b/libgfortran/configure
+index 8385e96..b8f7a92 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -12704,7 +12704,7 @@ esac
+ 
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ ac_ext=${ac_fc_srcext-f}
+ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
+index 7d97fed..3f9f484 100644
+--- a/libgfortran/configure.ac
++++ b/libgfortran/configure.ac
+@@ -227,7 +227,7 @@ AC_SUBST(enable_static)
+ 
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ AC_PROG_FC(gfortran)
+ 
+ # extra LD Flags which are required for targets
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0026-libgcc-sjlj-check.patch b/meta/recipes-devtools/gcc/gcc-4.8/0026-libgcc-sjlj-check.patch
new file mode 100644
index 0000000..d4efab9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0026-libgcc-sjlj-check.patch
@@ -0,0 +1,74 @@
+From 08c2398445e6cac282488f64ae6bf29cbcd8db23 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:50 +0400
+Subject: [PATCH 26/35] libgcc-sjlj-check
+
+ac_fn_c_try_compile doesnt seem to keep the intermediate files
+which are needed for sjlj test to pass since it greps into the
+generated file. So we run the compiler command using AC_TRY_COMMAND
+which then generates the needed .s file
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libgcc/configure    |   10 ++++++----
+ libgcc/configure.ac |   10 ++++------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/libgcc/configure b/libgcc/configure
+index 1425df6..d18e3cb 100644
+--- a/libgcc/configure
++++ b/libgcc/configure
+@@ -4208,17 +4208,19 @@ void foo ()
+ }
+ 
+ _ACEOF
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-if ac_fn_c_try_compile; then :
++if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5'
++  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }; }; then
+   if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=yes
+   elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=no
+   fi
+ fi
+-CFLAGS=$CFLAGS_hold
+ rm -f conftest*
+ 
+ fi
+diff --git a/libgcc/configure.ac b/libgcc/configure.ac
+index 8b7aba5..c7c9644 100644
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -216,16 +216,14 @@ void foo ()
+   bar();
+ }
+ ])])
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-AS_IF([ac_fn_c_try_compile],
+-  [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
++if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
++  if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=yes
+   elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=no
+-  fi])
+-CFLAGS=$CFLAGS_hold
++  fi
++fi
+ rm -f conftest*
+ ])
+ 
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0027-cpp-honor-sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.8/0027-cpp-honor-sysroot.patch
new file mode 100644
index 0000000..05e9521
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0027-cpp-honor-sysroot.patch
@@ -0,0 +1,54 @@
+From a0f9bd09c816ad29ecf7c29d6c27f7df97710364 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:22:00 +0400
+Subject: [PATCH 27/35] cpp: honor sysroot.
+
+Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile
+preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location
+rather than the --sysroot option specified on the commandline. If access to that directory is
+permission denied (unreadable), gcc will error.
+
+This happens when ccache is in use due to the fact it uses preprocessed source files.
+
+The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix,
+-isystem, -isysroot happen and the correct sysroot is used.
+
+[YOCTO #2074]
+
+RP 2012/04/13
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/cp/lang-specs.h |    2 +-
+ gcc/gcc.c           |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
+index a001c3e..1aae1e4 100644
+--- a/gcc/cp/lang-specs.h
++++ b/gcc/cp/lang-specs.h
+@@ -63,5 +63,5 @@ along with GCC; see the file COPYING3.  If not see
+   {".ii", "@c++-cpp-output", 0, 0, 0},
+   {"@c++-cpp-output",
+    "%{!M:%{!MM:%{!E:\
+-    cc1plus -fpreprocessed %i %(cc1_options) %2\
++    cc1plus -fpreprocessed %i %I %(cc1_options) %2\
+     %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 51062aa..cf6b99e 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1042,7 +1042,7 @@ static const struct compiler default_compilers[] =
+                     %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0},
+   {".i", "@cpp-output", 0, 0, 0},
+   {"@cpp-output",
+-   "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
++   "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+   {".s", "@assembler", 0, 0, 0},
+   {"@assembler",
+    "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0028-MIPS64-Default-to-N64-ABI.patch b/meta/recipes-devtools/gcc/gcc-4.8/0028-MIPS64-Default-to-N64-ABI.patch
new file mode 100644
index 0000000..2638720
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0028-MIPS64-Default-to-N64-ABI.patch
@@ -0,0 +1,31 @@
+From 301e18d4711db5925e767fad08dffa9cfe0a2f1f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:23:08 +0400
+Subject: [PATCH 28/35] MIPS64: Default to N64 ABI
+
+MIPS64 defaults to n32 ABI, this patch makes it
+so that it defaults to N64 ABI
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE config specific]
+---
+ gcc/config.gcc |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 1a0be50..989c2fb 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -1797,7 +1797,7 @@ mips*-mti-linux*)
+ mips64*-*-linux* | mipsisa64*-*-linux*)
+ 	tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h"
+ 	tmake_file="${tmake_file} mips/t-linux64"
+-	tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
++	tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64"
+ 	case ${target} in
+ 		mips64el-st-linux-gnu)
+ 			tm_file="${tm_file} mips/st.h"
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/meta/recipes-devtools/gcc/gcc-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
new file mode 100644
index 0000000..0aa6d92
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -0,0 +1,209 @@
+From 29d12344fb682a053de53eb08b95704cf3b67af2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:24:50 +0400
+Subject: [PATCH 29/35] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+ relative to SYSTEMLIBS_DIR
+
+This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+relative to SYSTEMLIBS_DIR which can be set in generated headers
+This breaks the assumption of hardcoded multilib in gcc
+Change is only for the supported architectures in OE including
+SH, sparc, alpha for possible future support (if any)
+
+Removes the do_headerfix task in metadata
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE configuration]
+---
+ gcc/config/alpha/linux-elf.h |    4 ++--
+ gcc/config/arm/linux-eabi.h  |    4 ++--
+ gcc/config/arm/linux-elf.h   |    2 +-
+ gcc/config/i386/linux.h      |    2 +-
+ gcc/config/i386/linux64.h    |    6 +++---
+ gcc/config/mips/linux.h      |    2 +-
+ gcc/config/mips/linux64.h    |    8 ++++----
+ gcc/config/rs6000/linux64.h  |    8 ++++----
+ gcc/config/sh/linux.h        |    2 +-
+ gcc/config/sparc/linux.h     |    2 +-
+ gcc/config/sparc/linux64.h   |    4 ++--
+ 11 files changed, 22 insertions(+), 22 deletions(-)
+
+Index: gcc-4.8.4/gcc/config/alpha/linux-elf.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/alpha/linux-elf.h
++++ gcc-4.8.4/gcc/config/alpha/linux-elf.h
+@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3.
+ #define EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+ 
+-#define GLIBC_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER	SYSTEMLIBS_DIR "ld-linux.so.2"
++#define UCLIBC_DYNAMIC_LINKER  SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+Index: gcc-4.8.4/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/arm/linux-eabi.h
++++ gcc-4.8.4/gcc/config/arm/linux-eabi.h
+@@ -68,8 +68,8 @@
+    GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI.  */
+ 
+ #undef  GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
+-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3"
++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3"
+ #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
+ 
+ #define GLIBC_DYNAMIC_LINKER \
+Index: gcc-4.8.4/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/arm/linux-elf.h
++++ gcc-4.8.4/gcc/config/arm/linux-elf.h
+@@ -57,7 +57,7 @@
+ 
+ #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #define LINUX_TARGET_LINK_SPEC  "%{h*} \
+    %{static:-Bstatic} \
+Index: gcc-4.8.4/gcc/config/i386/linux.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/i386/linux.h
++++ gcc-4.8.4/gcc/config/i386/linux.h
+@@ -20,4 +20,4 @@ along with GCC; see the file COPYING3.
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+Index: gcc-4.8.4/gcc/config/i386/linux64.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/i386/linux64.h
++++ gcc-4.8.4/gcc/config/i386/linux64.h
+@@ -27,6 +27,6 @@ see the files COPYING3 and COPYING.RUNTI
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+-#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
+Index: gcc-4.8.4/gcc/config/mips/linux.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/mips/linux.h
++++ gcc-4.8.4/gcc/config/mips/linux.h
+@@ -17,4 +17,4 @@ You should have received a copy of the G
+ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld.so.1"
+Index: gcc-4.8.4/gcc/config/mips/linux64.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/mips/linux64.h
++++ gcc-4.8.4/gcc/config/mips/linux64.h
+@@ -22,10 +22,10 @@ along with GCC; see the file COPYING3.
+ #define GNU_USER_LINK_EMULATION64 "elf64%{EB:b}%{EL:l}tsmip"
+ #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
+-#define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld.so.1"
++#define GLIBC_DYNAMIC_LINKERN32 SYSTEMLIBS_DIR "ld.so.1"
++#define UCLIBC_DYNAMIC_LINKERN32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+Index: gcc-4.8.4/gcc/config/rs6000/linux64.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/rs6000/linux64.h
++++ gcc-4.8.4/gcc/config/rs6000/linux64.h
+@@ -366,14 +366,14 @@ extern int dot_symbols;
+ #undef	LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
+ #ifdef LINUX64_DEFAULT_ABI_ELFv2
+ #define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}"
+ #else
+ #define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
+ #endif
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+Index: gcc-4.8.4/gcc/config/sh/linux.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/sh/linux.h
++++ gcc-4.8.4/gcc/config/sh/linux.h
+@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3.
+ 
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+Index: gcc-4.8.4/gcc/config/sparc/linux.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/sparc/linux.h
++++ gcc-4.8.4/gcc/config/sparc/linux.h
+@@ -83,7 +83,7 @@ extern const char *host_detect_local_cpu
+    When the -shared link option is used a final link is not being
+    done.  */
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #undef  LINK_SPEC
+ #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+Index: gcc-4.8.4/gcc/config/sparc/linux64.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/sparc/linux64.h
++++ gcc-4.8.4/gcc/config/sparc/linux64.h
+@@ -92,8 +92,8 @@ along with GCC; see the file COPYING3.
+    When the -shared link option is used a final link is not being
+    done.  */
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #ifdef SPARC_BI_ARCH
+ 
+Index: gcc-4.8.4/gcc/config/linux.h
+===================================================================
+--- gcc-4.8.4.orig/gcc/config/linux.h
++++ gcc-4.8.4/gcc/config/linux.h
+@@ -73,10 +73,10 @@ see the files COPYING3 and COPYING.RUNTI
+    GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
+    GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
+    supporting both 32-bit and 64-bit compilation.  */
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ldx32-uClibc.so.0"
+ #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0030-gcc-Fix-argument-list-too-long-error.patch b/meta/recipes-devtools/gcc/gcc-4.8/0030-gcc-Fix-argument-list-too-long-error.patch
new file mode 100644
index 0000000..2ceaff6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0030-gcc-Fix-argument-list-too-long-error.patch
@@ -0,0 +1,40 @@
+From c1816c160156f99c34e6a0a0311bb0219326804e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:26:37 +0400
+Subject: [PATCH 30/35] gcc: Fix argument list too long error.
+
+There would be an "Argument list too long" error when the
+build directory is longer than 200, this is caused by:
+
+headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`
+
+The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
+it, use the $(sort list) of GNU make which can handle the too long list
+would fix the problem, the header would be short enough after sorted.
+The "tr ' ' '\012'" was used for translating the space to "\n", the
+$(sort list) doesn't need this.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/Makefile.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 2320497..8562a62 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -4627,7 +4627,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
+ # We keep the directory structure for files in config or c-family and .def
+ # files. All other files are flattened to a single directory.
+ 	$(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
+-	headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \
++	headers="$(sort $(PLUGIN_HEADERS))"; \
+ 	srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
+ 	for file in $$headers; do \
+ 	  if [ -f $$file ] ; then \
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0031-Disable-sdt.patch b/meta/recipes-devtools/gcc/gcc-4.8/0031-Disable-sdt.patch
new file mode 100644
index 0000000..2c1d5e0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0031-Disable-sdt.patch
@@ -0,0 +1,113 @@
+From b85265bc94ec1beaf1d3b697c03db62991553467 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:28:10 +0400
+Subject: [PATCH 31/35] Disable sdt.
+
+We don't list dtrace in DEPENDS so we shouldn't be depending on this header.
+It may or may not exist from preivous builds though. To be determinstic, disable
+sdt.h usage always. This avoids build failures if the header is removed after configure
+but before libgcc is compiled for example.
+
+RP 2012/8/7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Disable sdt for libstdc++-v3.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Inappropriate [hack]
+---
+ gcc/configure             | 12 ++++++------
+ gcc/configure.ac          | 18 +++++++++---------
+ libstdc++-v3/configure    |  6 +++---
+ libstdc++-v3/configure.ac |  2 +-
+ 4 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 3c550a6..01c7626 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -26812,12 +26812,12 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
+ $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
+ have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+-  have_sys_sdt_h=yes
+-
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+-
+-fi
++#if test -f $target_header_dir/sys/sdt.h; then
++#  have_sys_sdt_h=yes
++#
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#
++#fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
+ $as_echo "$have_sys_sdt_h" >&6; }
+ 
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 3601ab6..06e501f 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4779,15 +4779,15 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
+ fi
+ 
+ # Test for <sys/sdt.h> on the target.
+-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
+-AC_MSG_CHECKING(sys/sdt.h in the target C library)
+-have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+-  have_sys_sdt_h=yes
+-  AC_DEFINE(HAVE_SYS_SDT_H, 1,
+-            [Define if your target C library provides sys/sdt.h])
+-fi
+-AC_MSG_RESULT($have_sys_sdt_h)
++#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
++#AC_MSG_CHECKING(sys/sdt.h in the target C library)
++#have_sys_sdt_h=no
++#if test -f $target_header_dir/sys/sdt.h; then
++#  have_sys_sdt_h=yes
++#  AC_DEFINE(HAVE_SYS_SDT_H, 1,
++#            [Define if your target C library provides sys/sdt.h])
++#fi
++#AC_MSG_RESULT($have_sys_sdt_h)
+ 
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index 4953c9f..53a1145 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -20578,11 +20578,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ 
+-  if test $glibcxx_cv_sys_sdt_h = yes; then
++#  if test $glibcxx_cv_sys_sdt_h = yes; then
+ 
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+ 
+-  fi
++#  fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5
+ $as_echo "$glibcxx_cv_sys_sdt_h" >&6; }
+ 
+diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
+index 73d430a..f2135e2 100644
+--- a/libstdc++-v3/configure.ac
++++ b/libstdc++-v3/configure.ac
+@@ -211,7 +211,7 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
+ GLIBCXX_CHECK_SC_NPROC_ONLN
+ GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
+ GLIBCXX_CHECK_SYSCTL_HW_NCPU
+-GLIBCXX_CHECK_SDT_H
++#GLIBCXX_CHECK_SDT_H
+ 
+ # Check for available headers.
+ AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
+-- 
+1.8.3.1
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0032-libtool.patch b/meta/recipes-devtools/gcc/gcc-4.8/0032-libtool.patch
new file mode 100644
index 0000000..3b3d1b6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0032-libtool.patch
@@ -0,0 +1,42 @@
+From 6c715fcfa262adadca81c68a1f3f69aa3187a501 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:29:11 +0400
+Subject: [PATCH 32/35] libtool
+
+libstdc++ from gcc-runtime gets created with -rpath=/usr/lib/../lib for qemux86-64
+when running on am x86_64 build host.
+
+This patch stops this speading to libdir in the libstdc++.la file within libtool.
+Arguably, it shouldn't be passing this into libtool in the first place but
+for now this resolves the nastiest problems this causes.
+
+func_normal_abspath would resolve an empty path to `pwd` so we need
+to filter the zero case.
+
+RP 2012/8/24
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ ltmain.sh |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index a03433f..46f47c2 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -6359,6 +6359,10 @@ func_mode_link ()
+ 	func_warning "ignoring multiple \`-rpath's for a libtool library"
+ 
+       install_libdir="$1"
++      if test -n "$install_libdir"; then
++	func_normal_abspath "$install_libdir"
++	install_libdir=$func_normal_abspath_result
++      fi
+ 
+       oldlibs=
+       if test -z "$rpath"; then
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/meta/recipes-devtools/gcc/gcc-4.8/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
new file mode 100644
index 0000000..199984d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
@@ -0,0 +1,43 @@
+From 97e4591c20310425e7aca0e6712a8d9480e7744c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:30:32 +0400
+Subject: [PATCH 33/35] gcc: armv4: pass fix-v4bx to linker to support EABI.
+
+The LINK_SPEC for linux gets overwritten by linux-eabi.h which
+means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result
+the option is not passed to linker when chosing march=armv4
+This patch redefines this in linux-eabi.h and reinserts it
+for eabi defaulting toolchains.
+
+We might want to send it upstream.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/arm/linux-eabi.h |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index 80f454d..4db3eb9 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -77,10 +77,14 @@
+     %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+     %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+ 
++/* For armv4 we pass --fix-v4bx to linker to support EABI */
++#undef TARGET_FIX_V4BX_SPEC
++#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
+    use the GNU/Linux version, not the generic BPABI version.  */
+ #undef  LINK_SPEC
+-#define LINK_SPEC BE8_LINK_SPEC						\
++#define LINK_SPEC BE8_LINK_SPEC TARGET_FIX_V4BX_SPEC			\
+   LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC,				\
+ 		       LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+ 
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/meta/recipes-devtools/gcc/gcc-4.8/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch
new file mode 100644
index 0000000..66b9f89
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch
@@ -0,0 +1,102 @@
+From fc5e4beaea856a2b486c770ad3addc0f5bb3100e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:33:04 +0400
+Subject: [PATCH 34/35] Use the multilib config files from ${B} instead of
+ using the ones from ${S}
+
+Use the multilib config files from ${B} instead of using the ones from ${S}
+so that the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure    |   22 ++++++++++++++++++----
+ gcc/configure.ac |   22 ++++++++++++++++++----
+ 2 files changed, 36 insertions(+), 8 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 8bc0c98..3cd0817 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11519,10 +11519,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+-	if test -f ${srcdir}/config/$f
+-	then
+-		tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+-	fi
++  case $f in
++    */t-linux64 )
++       if test -f ./config/$f
++       then
++         tmake_file_="${tmake_file_} ./config/$f"
++       fi
++       ;;
++    * )
++       if test -f ${srcdir}/config/$f
++       then
++         tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++       fi
++       ;;
++  esac
+ done
+ tmake_file="${tmake_file_}"
+ 
+@@ -11533,6 +11543,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+   case $f in
++    */linux64.h )
++       tm_file_list="${tm_file_list} ./config/$f"
++       tm_include_list="${tm_include_list} ./config/$f"
++       ;;
+     ./* )
+        f=`echo $f | sed 's/^..//'`
+        tm_file_list="${tm_file_list} $f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 5e5e84f..415a6df 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1700,10 +1700,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+-	if test -f ${srcdir}/config/$f
+-	then
+-		tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+-	fi
++  case $f in
++    */t-linux64 )
++       if test -f ./config/$f
++       then
++         tmake_file_="${tmake_file_} ./config/$f"
++       fi
++       ;;
++    * )
++       if test -f ${srcdir}/config/$f
++       then
++         tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++       fi
++       ;;
++  esac
+ done
+ tmake_file="${tmake_file_}"
+ 
+@@ -1714,6 +1724,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+   case $f in
++    */linux64.h )
++       tm_file_list="${tm_file_list} ./config/$f"
++       tm_include_list="${tm_include_list} ./config/$f"
++       ;;
+     ./* )
+        f=`echo $f | sed 's/^..//'`
+        tm_file_list="${tm_file_list} $f"
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0035-wcast-qual-PR-55383.patch b/meta/recipes-devtools/gcc/gcc-4.8/0035-wcast-qual-PR-55383.patch
new file mode 100644
index 0000000..be4cf4a
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0035-wcast-qual-PR-55383.patch
@@ -0,0 +1,55 @@
+From deffdb0b2497a106061d3ea2c6a3fef4fba3445e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:39:51 +0400
+Subject: [PATCH 35/35] wcast-qual PR/55383
+
+This is a backport from gcc bugzilla
+
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55383
+
+This commit fixes a wrong warning behavior. This bug which has no
+workaround other than disabling the warning.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Backport
+---
+ gcc/c/c-typeck.c                          |    2 +-
+ gcc/testsuite/c-c++-common/Wcast-qual-1.c |    6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
+index ddb6d39..c624120 100644
+--- a/gcc/c/c-typeck.c
++++ b/gcc/c/c-typeck.c
+@@ -4464,7 +4464,7 @@ handle_warn_cast_qual (location_t loc, tree type, tree otype)
+     /* There are qualifiers present in IN_OTYPE that are not present
+        in IN_TYPE.  */
+     warning_at (loc, OPT_Wcast_qual,
+-		"cast discards %q#v qualifier from pointer target type",
++		"cast discards %qv qualifier from pointer target type",
+ 		discarded);
+ 
+   if (added || discarded)
+diff --git a/gcc/testsuite/c-c++-common/Wcast-qual-1.c b/gcc/testsuite/c-c++-common/Wcast-qual-1.c
+index 640e4f0..56382c7 100644
+--- a/gcc/testsuite/c-c++-common/Wcast-qual-1.c
++++ b/gcc/testsuite/c-c++-common/Wcast-qual-1.c
+@@ -85,11 +85,11 @@ f3 (void ***bar)
+ void
+ f4 (void * const **bar)
+ {
+-  const void ***p9 = (const void ***) bar; /* { dg-warning "cast" } */
++  const void ***p9 = (const void ***) bar; /* { dg-warning "cast discards .const. qualifier" } */
+   void * const **p11 = (void * const **) bar;
+-  void ** const *p13 = (void ** const *) bar; /* { dg-warning "cast" } */
++  void ** const *p13 = (void ** const *) bar; /* { dg-warning "cast discards .const. qualifier" } */
+   const void * const **p15 = (const void * const **) bar; /* { dg-warning "cast" } */
+-  const void ** const *p17 = (const void ** const *) bar; /* { dg-warning "cast" } */
++  const void ** const *p17 = (const void ** const *) bar; /* { dg-warning "cast discards .const. qualifier" } */
+   void * const * const * p19 = (void * const * const *) bar;
+   const void * const * const *p21 = (const void * const * const *) bar;
+ }
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0038-gcc-4.8-build-args.patch b/meta/recipes-devtools/gcc/gcc-4.8/0038-gcc-4.8-build-args.patch
new file mode 100644
index 0000000..7c8290f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0038-gcc-4.8-build-args.patch
@@ -0,0 +1,64 @@
+When cross compiling a target gcc, target flags may be used on the host
+
+Configure identifies a number of warning flags (WARN_CFLAGS and
+WARN_CXXFLAGS) from the $CC value.  The cross compiler may be different
+from the host compiler and may not support the same set of flags.  This
+leads to problems such as:
+
+cc1plus: error: unrecognized command line option "-Wno-narrowing"
+cc1plus: error: unrecognized command line option "-Wno-overlength-strings"
+
+Work around this problem by removing the warning flags from the
+BUILD_CXXFLAGS value, in a way similar to the BUILD_CFLAGS.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: gcc-4.8.4/gcc/configure
+===================================================================
+--- gcc-4.8.4.orig/gcc/configure
++++ gcc-4.8.4/gcc/configure
+@@ -17864,7 +17864,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 17853 "configure"
++#line 17867 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -17970,7 +17970,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 17959 "configure"
++#line 17973 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -26918,18 +26918,15 @@ $as_echo "#define TARGET_LIBC_PROVIDES_S
+ fi
+ 
+ # Test for <sys/sdt.h> on the target.
+-
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
+-$as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
+-have_sys_sdt_h=no
++#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
++#AC_MSG_CHECKING(sys/sdt.h in the target C library)
++#have_sys_sdt_h=no
+ #if test -f $target_header_dir/sys/sdt.h; then
+ #  have_sys_sdt_h=yes
+-#
+-#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+-#
++#  AC_DEFINE(HAVE_SYS_SDT_H, 1,
++#            [Define if your target C library provides sys/sdt.h])
+ #fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
+-$as_echo "$have_sys_sdt_h" >&6; }
++#AC_MSG_RESULT($have_sys_sdt_h)
+ 
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0040-fix-g++-sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.8/0040-fix-g++-sysroot.patch
new file mode 100644
index 0000000..d50aa5c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0040-fix-g++-sysroot.patch
@@ -0,0 +1,40 @@
+Portions of
+
+http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html
+
+are not upstreamed yet. So lets keep missing pieces.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gcc-4.8.1/gcc/configure.ac
+===================================================================
+--- gcc-4.8.1.orig/gcc/configure.ac	2013-07-15 15:55:49.488399132 -0700
++++ gcc-4.8.1/gcc/configure.ac	2013-07-15 16:02:31.772406679 -0700
+@@ -148,7 +148,9 @@
+ if test "${with_sysroot+set}" = set; then
+   gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+   if test "${gcc_gxx_without_sysroot}"; then
+-    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    if test x${with_sysroot} != x/; then
++      gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    fi
+     gcc_gxx_include_dir_add_sysroot=1
+   fi
+ fi
+Index: gcc-4.8.1/gcc/configure
+===================================================================
+--- gcc-4.8.1.orig/gcc/configure	2013-07-15 15:55:49.472399132 -0700
++++ gcc-4.8.1/gcc/configure	2013-07-15 16:02:31.780406680 -0700
+@@ -3325,7 +3325,9 @@
+ if test "${with_sysroot+set}" = set; then
+   gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+   if test "${gcc_gxx_without_sysroot}"; then
+-    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    if test x${with_sysroot} != x/; then
++      gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    fi
+     gcc_gxx_include_dir_add_sysroot=1
+   fi
+ fi
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0041-libtool-avoid-libdir.patch b/meta/recipes-devtools/gcc/gcc-4.8/0041-libtool-avoid-libdir.patch
new file mode 100644
index 0000000..2dd9610
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0041-libtool-avoid-libdir.patch
@@ -0,0 +1,19 @@
+Avoid using libdir from .la which usually points to a host path
+
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+
+diff --git a/ltmain.sh b/ltmain.sh
+index a03433f..1902a90 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -5628,6 +5628,9 @@ func_mode_link ()
+ 	    absdir="$abs_ladir"
+ 	    libdir="$abs_ladir"
+ 	  else
++	    # Instead of using libdir from .la which usually points to a host path,
++	    # use the path the .la is contained in.
++	    libdir="$abs_ladir"
+ 	    dir="$libdir"
+ 	    absdir="$libdir"
+ 	  fi
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0042-pr57748.patch b/meta/recipes-devtools/gcc/gcc-4.8/0042-pr57748.patch
new file mode 100644
index 0000000..5356f72
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0042-pr57748.patch
@@ -0,0 +1,78 @@
+Upstream-Status: Backport
+Signed-off-by: Khem Raj
+
+2013-08-01  Martin Jambor  <mjambor@suse.cz>
+
+	PR middle-end/57748
+	* stor-layout.c (compute_record_mode): Treat zero-sized array fields
+	like incomplete types.
+
+testsuite/
+	* gcc.dg/torture/pr57748.c: New test.
+
+
+Index: gcc-4.8.1/gcc/stor-layout.c
+===================================================================
+--- gcc-4.8.1.orig/gcc/stor-layout.c	2013-04-28 10:29:18.000000000 -0700
++++ gcc-4.8.1/gcc/stor-layout.c	2013-08-01 15:02:08.018006125 -0700
+@@ -1618,7 +1618,9 @@
+ 		   && integer_zerop (TYPE_SIZE (TREE_TYPE (field)))))
+ 	  || ! host_integerp (bit_position (field), 1)
+ 	  || DECL_SIZE (field) == 0
+-	  || ! host_integerp (DECL_SIZE (field), 1))
++	  || ! host_integerp (DECL_SIZE (field), 1)
++	  || (TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE
++	      && tree_low_cst (DECL_SIZE (field), 1) == 0))
+ 	return;
+ 
+       /* If this field is the whole struct, remember its mode so
+Index: gcc-4.8.1/gcc/testsuite/gcc.dg/torture/pr57748.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ gcc-4.8.1/gcc/testsuite/gcc.dg/torture/pr57748.c	2013-08-01 15:02:08.062006126 -0700
+@@ -0,0 +1,45 @@
++/* PR middle-end/57748 */
++/* { dg-do run } */
++
++#include <stdlib.h>
++
++extern void abort (void);
++
++typedef long long V
++  __attribute__ ((vector_size (2 * sizeof (long long)), may_alias));
++
++typedef struct S { V a; V b[0]; } P __attribute__((aligned (1)));
++
++struct __attribute__((packed)) T { char c; P s; };
++
++void __attribute__((noinline, noclone))
++check (struct T *t)
++{
++  if (t->s.b[0][0] != 3 || t->s.b[0][1] != 4)
++    abort ();
++}
++
++int __attribute__((noinline, noclone))
++get_i (void)
++{
++  return 0;
++}
++
++void __attribute__((noinline, noclone))
++foo (P *p)
++{
++  V a = { 3, 4 };
++  int i = get_i();
++  p->b[i] = a;
++}
++
++int
++main ()
++{
++  struct T *t = (struct T *) malloc (128);
++
++  foo (&t->s);
++  check (t);
++
++  return 0;
++}
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0043-cpp.patch b/meta/recipes-devtools/gcc/gcc-4.8/0043-cpp.patch
new file mode 100644
index 0000000..eaf8646
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0043-cpp.patch
@@ -0,0 +1,40 @@
+The OE environment sets and exports CPP as being the target gcc. When building 
+gcc-cross-canadian for a mingw targetted sdk, the following can be found in
+build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log:
+
+configure:3641: checking for _FILE_OFFSET_BITS value needed for large files
+configure:3666: gcc  -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe  conftest.c >&5
+configure:3666: $? = 0
+configure:3698: result: no
+configure:3786: checking how to run the C preprocessor
+configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32
+configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32  conftest.c
+configure:3876: $? = 0
+
+Note this is a *build* target (in build-x86_64-linux) so it should be using 
+the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32 headers are 
+very different, using the wrong cpp is a real problem. It is leaking into 
+configure through the CPP variable. Ultimately this leads to build failures 
+related to not being able to include a process.h file for pem-unix.c.
+
+The fix is to ensure we export a sane CPP value into the build environment when
+using build targets. We could define a CPP_FOR_BUILD value which may be the version
+which needs to be upstreamed but for now, this fix is good enough to avoid the 
+problem.
+
+RP 22/08/2013
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/Makefile.in	2013-03-30 11:25:03.000000000 +0000
++++ gcc-4.8.1/Makefile.in	2013-08-13 12:03:17.151988882 +0000
+@@ -149,6 +149,7 @@
+ 	AR="$(AR_FOR_BUILD)"; export AR; \
+ 	AS="$(AS_FOR_BUILD)"; export AS; \
+ 	CC="$(CC_FOR_BUILD)"; export CC; \
++	CPP="$(CC_FOR_BUILD) -E"; export CPP; \
+ 	CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ 	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ 	CXX="$(CXX_FOR_BUILD)"; export CXX; \
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0044-gengtypes.patch b/meta/recipes-devtools/gcc/gcc-4.8/0044-gengtypes.patch
new file mode 100644
index 0000000..e38761d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0044-gengtypes.patch
@@ -0,0 +1,97 @@
+gengtype is generated for both the build system and the target. -DGENERATOR_FILE
+was added in the patch http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00273.html
+and was applied to both versions of gengtype.
+
+Unfortunately the presence of this flag triggers the build configuration (bconfig.h) 
+to be included for the target build of gengtype. Compiling gengtype with the target 
+compiler and bconfig.h can result in errors if the build and target systems are 
+dissimilar. An example case this fails is cross compiling gcc on linux for a darwin 
+target system:
+
+In file included from /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c:25:0:
+| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c: In function 'void parse_error(const char*, ...)':
+| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/system.h:93:53: error: 'fputc_unlocked' was not declared in this scope
+|  #  define fputc(C, Stream) fputc_unlocked (C, Stream)
+
+which occurs since auto-build.h and auto-host.h have differnet values of
+HAVE_FPUTC_UNLOCKED:
+
+#define HAVE_FPUTC_UNLOCKED 1
+/* #undef HAVE_FPUTS_UNLOCKED */
+
+The obvious fix is to only include the flag on build/ targets which this patch does, however 
+this also leads to compile errors due to const_tree being undefined but used in double_int.h
+
+I added a GENERATOR_FILE2 flag to workaround those in the 
+target case and allow the build to succeed.
+
+Only the build/gengtypes should have the -DGENERATOR_FILE 
+
+RP 22/8/2013
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/gcc/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/gcc/Makefile.in	2013-08-19 11:40:36.844014424 +0000
++++ gcc-4.8.1/gcc/Makefile.in	2013-08-19 11:40:37.784014402 +0000
+@@ -3903,27 +3903,29 @@
+ 
+ gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H)
+ gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H)
+-CFLAGS-gengtype-lex.o += -DGENERATOR_FILE
++CFLAGS-build/gengtype-lex.o += -DGENERATOR_FILE
+ build/gengtype-lex.o: $(BCONFIG_H)
+ 
+ gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
+   $(SYSTEM_H)
+ gengtype-parse.o: $(CONFIG_H)
+-CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
++CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE
+ build/gengtype-parse.o: $(BCONFIG_H)
+ 
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+   gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+   $(XREGEX_H)
+ gengtype-state.o: $(CONFIG_H)
+-CFLAGS-gengtype-state.o += -DGENERATOR_FILE
++CFLAGS-gengtype-state.o += -DGENERATOR_FILE2
++CFLAGS-build/gengtype-state.o += -DGENERATOR_FILE
+ build/gengtype-state.o: $(BCONFIG_H)
+ 
+ gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h 	\
+   rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
+   $(OBSTACK_H) $(XREGEX_H)
+ gengtype.o: $(CONFIG_H)
+-CFLAGS-gengtype.o += -DGENERATOR_FILE
++CFLAGS-gengtype.o += -DGENERATOR_FILE2
++CFLAGS-build/gengtype.o += -DGENERATOR_FILE
+ build/gengtype.o: $(BCONFIG_H)
+ 
+ build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h	\
+@@ -3988,7 +3990,7 @@
+ # any system header is included.
+ gengtype-lex.c : gengtype-lex.l
+ 	-$(FLEX) $(FLEXFLAGS) -o$@ $< && { \
+-	  echo '#include "bconfig.h"' > $@.tmp; \
++	  echo '' > $@.tmp; \
+ 	  cat $@ >> $@.tmp; \
+ 	  mv $@.tmp $@; \
+ 	}
+Index: gcc-4.8.1/gcc/double-int.h
+===================================================================
+--- gcc-4.8.1.orig/gcc/double-int.h	2013-01-30 11:04:30.000000000 +0000
++++ gcc-4.8.1/gcc/double-int.h	2013-08-19 11:41:51.564012719 +0000
+@@ -448,10 +448,12 @@
+ 
+ 
+ #ifndef GENERATOR_FILE
++#ifndef GENERATOR_FILE2
+ /* Conversion to and from GMP integer representations.  */
+ 
+ void mpz_set_double_int (mpz_t, double_int, bool);
+ double_int mpz_get_double_int (const_tree, mpz_t, bool);
+ #endif
++#endif
+ 
+ #endif /* DOUBLE_INT_H */
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0046-libatomic-deptracking.patch b/meta/recipes-devtools/gcc/gcc-4.8/0046-libatomic-deptracking.patch
new file mode 100644
index 0000000..6ea4f42
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0046-libatomic-deptracking.patch
@@ -0,0 +1,41 @@
+gcc 4.8 won't build with --disable-dependency-tracking since the *.Ppo files
+don't get created unless --enable-dependency-tracking is true.
+
+This patch ensures we only use those compiler options when its enabled.
+
+Upstream-Status: Submitted
+
+(Problem was already reported upstream, attached this patch there
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55930)
+
+RP 
+2012/09/22
+
+Index: gcc-4.8.1/libatomic/Makefile.am
+===================================================================
+--- gcc-4.8.1.orig/libatomic/Makefile.am	2013-01-14 18:16:23.000000000 +0000
++++ gcc-4.8.1/libatomic/Makefile.am	2013-09-22 10:38:18.904064750 +0000
+@@ -100,7 +100,8 @@
+ IFUNC_DEF	= -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT	= $(word $(PAT_S),$(IFUNC_OPTIONS))
+ 
+-M_DEPS		= -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS		= -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS		= 
+ M_SIZE		= -DN=$(PAT_N)
+ M_IFUNC		= $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE		= $(PAT_BASE)_n.c
+Index: gcc-4.8.1/libatomic/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/libatomic/Makefile.in	2013-05-31 09:09:26.000000000 +0000
++++ gcc-4.8.1/libatomic/Makefile.in	2013-09-22 10:40:42.520059917 +0000
+@@ -298,7 +298,8 @@
+ PAT_S = $(word 3,$(PAT_SPLIT))
+ IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
+-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS = 
+ M_SIZE = -DN=$(PAT_N)
+ M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE = $(PAT_BASE)_n.c
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0047-repomembug.patch b/meta/recipes-devtools/gcc/gcc-4.8/0047-repomembug.patch
new file mode 100644
index 0000000..9afd55c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0047-repomembug.patch
@@ -0,0 +1,53 @@
+When compiling a project using -frepo, .rpo files are written alongside
+the .o file, the symbols either have O or C against them. During final linking,
+the objects can be recompiled with some of the entries tweaked/chosen by the 
+tlink.c code (visible with TLINK_VERBOSE=3), it does this by changing O -> C
+in the .rpo files.
+
+My tests showed that init_repo (cp/repo.c) was correctly calling 
+IDENTIFIER_REPO_CHOSEN against the right identifers and setting the
+chosen bit.
+
+By the time finish_repo() or emit_repo_p() were called, the pointer returned
+by get_identifier() for the symbol marked during init_repo had changed and
+the chosen bit was no longer set. This lead to linking bugs like:
+
+collect: relinking
+collect2: error: '_ZNK6sudoku5ClearINS_8SequenceEEclERS1_' was assigned to 'board.rpo', but was not defined during recompilation, or vice versa
+
+The problem is that the garbage collection is getting called before
+finish_repo() is called and ggc_protect_identifiers is set to false 
+so the identifiers are not preserved. They are recreated but the 
+chosen bits get wiped out which is why the pointer changes and the 
+chosen bit is not set.
+
+The fix is to change ggc_protect_identifiers *after* the finish_repo 
+calls are made.
+
+Reproduction is tricky since you need to trigger the garbage collector at
+just the right moment.
+
+RP 2013/10/9
+
+[YOCTO #5133]
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/gcc/toplev.c
+===================================================================
+--- gcc-4.8.1.orig/gcc/toplev.c	2013-03-28 08:29:51.000000000 +0000
++++ gcc-4.8.1/gcc/toplev.c	2013-10-09 20:27:17.089228023 +0000
+@@ -551,11 +551,11 @@
+   if (flag_syntax_only || flag_wpa)
+     return;
+ 
+-  ggc_protect_identifiers = false;
+-
+   /* This must also call finalize_compilation_unit.  */
+   lang_hooks.decls.final_write_globals ();
+ 
++  ggc_protect_identifiers = false;
++
+   if (seen_error ())
+     return;
+ 
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/meta/recipes-devtools/gcc/gcc-4.8/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
new file mode 100644
index 0000000..b98f8ff
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
@@ -0,0 +1,42 @@
+From 9e0e19eac2562f73858602fe26e2044eb8b20c47 Mon Sep 17 00:00:00 2001
+From: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+Date: Wed, 5 Feb 2014 16:52:31 +0200
+Subject: [PATCH] Enable SPE & AltiVec generation on powepc*linux target
+
+When is configured with --target=powerpc-linux, the resulting GCC will 
+not be able to generate code for SPE targets (e500v1/v2).
+GCC configured with --target=powerpc-linuxspe will not be able to
+generate AltiVec instructions (for e6500).
+This patch modifies the configured file such that SPE or AltiVec code
+can be generated when gcc is configured with --target=powerpc-linux.
+The ABI and speciffic instructions can be selected through the
+"-mabi=spe or -mabi=altivec" and the "-mspe or -maltivec" parameters.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+---
+ gcc/config.gcc |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index cb7a94e..d392c2b 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2068,7 +2068,12 @@ powerpc-*-rtems*)
+ 	tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm"
+ 	;;
+ powerpc*-*-linux*)
+-	tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
++	case ${target} in
++	    powerpc*-*-linux*spe* | powerpc*-*-linux*altivec*)
++		tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h" ;;
++	    *)
++		tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h rs6000/linuxaltivec.h rs6000/linuxspe.h rs6000/e500.h" ;;
++	esac
+ 	extra_options="${extra_options} rs6000/sysv4.opt"
+ 	tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+ 	case ${target} in
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch b/meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch
new file mode 100644
index 0000000..f48c66d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.8/target-gcc-includedir.patch
@@ -0,0 +1,81 @@
+Ensure target gcc headers can be included
+
+There are a few headers installed as part of the OpenEmbedded
+gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe
+built for the target architecture, these are within the target
+sysroot and not cross/nativesdk; thus they weren't able to be
+found by gcc with the existing search paths. Add support for
+picking up these headers under the sysroot supplied on the gcc
+command line in order to resolve this.
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Upstream-Status: Pending
+
+--- a/gcc/Makefile.in	2014-12-23 11:57:33.327873331 +0000
++++ b/gcc/Makefile.in	2015-01-21 11:32:35.447305394 +0000
+@@ -587,6 +587,7 @@
+ 
+ # Directory in which the compiler finds libraries etc.
+ libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
++libsubdir_target = gcc/$(target_noncanonical)/$(version)
+ # Directory in which the compiler finds executables
+ libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
+ # Directory in which all plugin resources are installed
+@@ -2534,6 +2535,7 @@
+ 
+ PREPROCESSOR_DEFINES = \
+   -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
++  -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \
+   -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
+   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
+   -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
+--- a/gcc/cppdefault.c	2015-01-13 17:40:26.131012725 +0000
++++ b/gcc/cppdefault.c	2015-01-21 11:30:08.928426492 +0000
+@@ -59,6 +59,10 @@
+     /* This is the dir for gcc's private headers.  */
+     { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
+ #endif
++#ifdef GCC_INCLUDE_SUBDIR_TARGET
++    /* This is the dir for gcc's private headers under the specified sysroot.  */
++    { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++#endif
+ #ifdef LOCAL_INCLUDE_DIR
+     /* /usr/local/include comes before the fixincluded header files.  */
+     { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+diff --git a/gcc/defaults.h b/gcc/defaults.h
+index f94ae17..d98b40b 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1390,4 +1390,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ 
+ #endif /* GCC_INSN_FLAGS_H  */
+ 
++/* Default prefixes to attach to command names.  */
++
++#ifndef STANDARD_STARTFILE_PREFIX_1
++#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
++#endif
++#ifndef STANDARD_STARTFILE_PREFIX_2
++#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
++#endif
++
+ #endif  /* ! GCC_DEFAULTS_H */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 9f0b781..174fca8 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1189,13 +1189,6 @@ static const char *gcc_libexec_prefix;
+ 
+ /* Default prefixes to attach to command names.  */
+ 
+-#ifndef STANDARD_STARTFILE_PREFIX_1
+-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+-#endif
+-#ifndef STANDARD_STARTFILE_PREFIX_2
+-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+-#endif
+-
+ #ifdef CROSS_DIRECTORY_STRUCTURE  /* Don't use these prefixes for a cross compiler.  */
+ #undef MD_EXEC_PREFIX
+ #undef MD_STARTFILE_PREFIX
diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
new file mode 100644
index 0000000..691ba5f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -0,0 +1,127 @@
+require gcc-common.inc
+
+# Third digit in PV should be incremented after a minor release
+
+PV = "4.9.3"
+
+# BINV should be incremented to a revision after a minor gcc release
+
+BINV = "4.9.3"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-4.9:"
+
+DEPENDS =+ "mpfr gmp libmpc zlib"
+NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native"
+
+LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
+
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+    file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
+"
+
+SRC_URI = "\
+    ${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2 \
+    file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
+    file://0002-uclibc-conf.patch \
+    file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
+    file://0004-uclibc-locale.patch \
+    file://0005-uclibc-locale-no__x.patch \
+    file://0006-uclibc-locale-wchar_fix.patch \
+    file://0007-uclibc-locale-update.patch \
+    file://0008-missing-execinfo_h.patch \
+    file://0009-c99-snprintf.patch \
+    file://0010-c99-complex-ugly-hack.patch \
+    file://0011-index_macro.patch \
+    file://0013-libstdc-namespace.patch \
+    file://0014-sh-pr24836.patch \
+    file://0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch \
+    file://0016-gcc-poison-system-directories.patch \
+    file://0017-gcc-poison-dir-extend.patch \
+    file://0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+    file://0019-64-bit-multilib-hack.patch \
+    file://0020-optional-libstdc.patch \
+    file://0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+    file://0022-COLLECT_GCC_OPTIONS.patch \
+    file://0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+    file://0024-PR-target-32219.patch \
+    file://0025-fortran-cross-compile-hack.patch \
+    file://0026-libgcc-sjlj-check.patch \
+    file://0027-cpp-honor-sysroot.patch \
+    file://0028-MIPS64-Default-to-N64-ABI.patch \
+    file://0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+    file://0030-gcc-Fix-argument-list-too-long-error.patch \
+    file://0031-Disable-sdt.patch \
+    file://0032-libtool.patch \
+    file://0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+    file://0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+    file://0040-fix-g++-sysroot.patch \
+    file://0041-libtool-avoid-libdir.patch \
+    file://0043-cpp.patch \
+    file://0044-gengtypes.patch \
+    file://0046-libatomic-deptracking.patch \
+    file://0047-repomembug.patch \
+    file://0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+    file://0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch \
+    file://0051-eabispe.patch \
+    file://0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch \
+    file://0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch \
+    file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
+    file://0055-dwarf-reg-processing-helper.patch \
+    file://0056-define-default-cfa-register-mapping.patch \
+    file://0057-aarch64-config.patch \
+    file://0058-gcc-r212171.patch \
+    file://0059-gcc-PR-rtl-optimization-63348.patch \
+    file://0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch \
+    file://0061-target-gcc-includedir.patch \
+    file://0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
+    file://0063-nativesdk-gcc-support.patch \
+    file://0064-handle-target-sysroot-multilib.patch \
+"
+SRC_URI[md5sum] = "6f831b4d251872736e8e9cc09746f327"
+SRC_URI[sha256sum] = "2332b2a5a321b57508b9031354a8503af6fdfb868b8c1748d33028d100a8b67e"
+
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+# Language Overrides
+FORTRAN = ""
+JAVA = ""
+
+LTO = "--enable-lto"
+
+EXTRA_OECONF_BASE = "\
+    ${LTO} \
+    --enable-libssp \
+    --disable-bootstrap \
+    --disable-libmudflap \
+    --with-system-zlib \
+    --with-linker-hash-style=${LINKER_HASH_STYLE} \
+    --enable-linker-build-id \
+    --with-ppl=no \
+    --with-cloog=no \
+    --enable-checking=release \
+    --enable-cheaders=c_global \
+"
+
+EXTRA_OECONF_INITIAL = "\
+    --disable-libmudflap \
+    --disable-libgomp \
+    --disable-libssp \
+    --disable-libquadmath \
+    --with-system-zlib \
+    --disable-lto \
+    --disable-plugin \
+    --enable-decimal-float=no \
+"
+
+EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
+
+EXTRA_OECONF_PATHS = "\
+    --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
+    --with-sysroot=/not/exist \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000..e588011
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
@@ -0,0 +1,42 @@
+From bf3d96ae58fa180b8b468d25dc2e0209daca2751 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:37:11 +0400
+Subject: [PATCH 01/35] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ configure    |    2 +-
+ configure.ac |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index d809535..1b76c90 100755
+--- a/configure
++++ b/configure
+@@ -7439,7 +7439,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+ 
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+  *" newlib "*)
+   case " $target_configargs " in
+diff --git a/configure.ac b/configure.ac
+index 48ec1aa..89d1d3f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2873,7 +2873,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+ 
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+  *" newlib "*)
+   case " $target_configargs " in
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch b/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch
new file mode 100644
index 0000000..dda3b10
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0002-uclibc-conf.patch
@@ -0,0 +1,53 @@
+From d030973c872c00d916921d84deee0af2c0d38081 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:38:25 +0400
+Subject: [PATCH 02/35] uclibc-conf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ contrib/regression/objs-gcc.sh |    4 ++++
+ libjava/classpath/ltconfig     |    4 ++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497..6dc7ead 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+  then
+   make all-gdb all-dejagnu all-ld || exit 1
+   make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++  make all-gdb all-dejagnu all-ld || exit 1
++  make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+   make bootstrap || exit 1
+   make install || exit 1
+diff --git a/libjava/classpath/ltconfig b/libjava/classpath/ltconfig
+index 743d951..ae4ea60 100755
+--- a/libjava/classpath/ltconfig
++++ b/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ 
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+ 
+@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   version_type=linux
+   need_lib_prefix=no
+   need_version=no
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch
new file mode 100644
index 0000000..7098e99
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0003-gcc-uclibc-locale-ctype_touplow_t.patch
@@ -0,0 +1,87 @@
+From d2d9dd756c4356d14dd7ae003856344cb4f37985 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:40:12 +0400
+Subject: [PATCH 03/35] gcc-uclibc-locale-ctype_touplow_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/generic/c_locale.cc |    5 +++++
+ libstdc++-v3/config/locale/generic/c_locale.h  |    9 +++++++++
+ libstdc++-v3/config/os/gnu-linux/ctype_base.h  |    9 +++++++++
+ 3 files changed, 23 insertions(+)
+
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
+index 0d309a5..f2f1e1f 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.cc
++++ b/libstdc++-v3/config/locale/generic/c_locale.cc
+@@ -263,5 +263,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
+ #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
+ #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
+   extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
++#ifdef __UCLIBC__
++// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int*
++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs);
++#else
+ _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
++#endif
+ #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h
+index b5fd989..3da9a5d 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -40,13 +40,22 @@
+ 
+ #include <clocale>
+ 
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ #define _GLIBCXX_NUM_CATEGORIES 0
+ 
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ 
++#ifdef __UCLIBC__
++  typedef __ctype_touplow_t*	__c_locale;
++#else
+   typedef int*			__c_locale;
++#endif
+ 
+   // Convert numeric value of type double and long double to string and
+   // return length of string.  If vsnprintf is available use it, otherwise
+diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+index 2d8e978..14eb08f 100644
+--- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h
++++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+@@ -33,6 +33,11 @@
+ 
+ // Information as gleaned from /usr/include/ctype.h
+ 
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+   struct ctype_base
+   {
+     // Non-standard typedefs.
++#ifdef __UCLIBC__
++    typedef const __ctype_touplow_t*	__to_type;
++#else
+     typedef const int* 		__to_type;
++#endif
+ 
+     // NB: Offsets into ctype<char>::_M_table force a particular size
+     // on the mask type. Because of this, we don't use an enum.
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch b/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch
new file mode 100644
index 0000000..49f5f33
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0004-uclibc-locale.patch
@@ -0,0 +1,2862 @@
+From a55c751a449c2cbf0b3fcc07aab1b86bf9661510 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:41:39 +0400
+Subject: [PATCH 04/35] uclibc-locale
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/acinclude.m4                          |   37 ++
+ .../config/locale/uclibc/c++locale_internal.h      |   63 ++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc      |  160 +++++
+ libstdc++-v3/config/locale/uclibc/c_locale.h       |  117 ++++
+ .../config/locale/uclibc/codecvt_members.cc        |  308 +++++++++
+ .../config/locale/uclibc/collate_members.cc        |   80 +++
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc |  300 +++++++++
+ .../config/locale/uclibc/messages_members.cc       |  100 +++
+ .../config/locale/uclibc/messages_members.h        |  118 ++++
+ .../config/locale/uclibc/monetary_members.cc       |  692 ++++++++++++++++++++
+ .../config/locale/uclibc/numeric_members.cc        |  160 +++++
+ libstdc++-v3/config/locale/uclibc/time_members.cc  |  406 ++++++++++++
+ libstdc++-v3/config/locale/uclibc/time_members.h   |   68 ++
+ libstdc++-v3/configure                             |   75 +++
+ libstdc++-v3/include/c_compatibility/wchar.h       |    2 +
+ libstdc++-v3/include/c_std/cwchar                  |    2 +
+ 16 files changed, 2688 insertions(+)
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/collate_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/ctype_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/monetary_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/numeric_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.h
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index 0871a6a..326d7ef 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -1905,6 +1905,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+   # Default to "generic".
+   if test $enable_clocale_flag = auto; then
+     case ${target_os} in
++      *-uclibc*)
++        enable_clocale_flag=uclibc
++        ;;
+       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ 	enable_clocale_flag=gnu
+ 	;;
+@@ -2069,6 +2072,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+       CTIME_CC=config/locale/generic/time_members.cc
+       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+       ;;
++    uclibc)
++      AC_MSG_RESULT(uclibc)
++
++      # Declare intention to use gettext, and add support for specific
++      # languages.
++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++      ALL_LINGUAS="de fr"
++
++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++        USE_NLS=yes
++      fi
++      # Export the build objects.
++      for ling in $ALL_LINGUAS; do \
++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++      done
++      AC_SUBST(glibcxx_MOFILES)
++      AC_SUBST(glibcxx_POFILES)
++
++      CLOCALE_H=config/locale/uclibc/c_locale.h
++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++      CMESSAGES_H=config/locale/uclibc/messages_members.h
++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++      CTIME_H=config/locale/uclibc/time_members.h
++      CTIME_CC=config/locale/uclibc/time_members.cc
++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++      ;;
+   esac
+ 
+   # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+new file mode 100644
+index 0000000..2ae3e4a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <bits/c++config.h>
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
++extern "C" __typeof(strcoll_l) __strcoll_l;
++extern "C" __typeof(strftime_l) __strftime_l;
++extern "C" __typeof(strtod_l) __strtod_l;
++extern "C" __typeof(strtof_l) __strtof_l;
++extern "C" __typeof(strtold_l) __strtold_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_l;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++extern "C" __typeof(iswctype_l) __iswctype_l;
++extern "C" __typeof(towlower_l) __towlower_l;
++extern "C" __typeof(towupper_l) __towupper_l;
++extern "C" __typeof(wcscoll_l) __wcscoll_l;
++extern "C" __typeof(wcsftime_l) __wcsftime_l;
++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
++extern "C" __typeof(wctype_l) __wctype_l;
++#endif
++
++#endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+new file mode 100644
+index 0000000..5081dc1
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -0,0 +1,160 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8  Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno>  // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
++#define __strtof_l(S, E, L)         strtof((S), (E))
++#define __strtod_l(S, E, L)         strtod((S), (E))
++#define __strtold_l(S, E, L)        strtold((S), (E))
++#warning should dummy __newlocale check for C|POSIX ?
++#define __newlocale(a, b, c)        NULL
++#define __freelocale(a)             ((void)0)
++#define __duplocale(a)              __c_locale()
++#endif
++
++namespace std
++{
++  template<>
++    void
++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++		   const __c_locale& __cloc)
++    {
++      if (!(__err & ios_base::failbit))
++	{
++	  char* __sanity;
++	  errno = 0;
++	  float __f = __strtof_l(__s, &__sanity, __cloc);
++          if (__sanity != __s && errno != ERANGE)
++	    __v = __f;
++	  else
++	    __err |= ios_base::failbit;
++	}
++    }
++
++  template<>
++    void
++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++		   const __c_locale& __cloc)
++    {
++      if (!(__err & ios_base::failbit))
++	{
++	  char* __sanity;
++	  errno = 0;
++	  double __d = __strtod_l(__s, &__sanity, __cloc);
++          if (__sanity != __s && errno != ERANGE)
++	    __v = __d;
++	  else
++	    __err |= ios_base::failbit;
++	}
++    }
++
++  template<>
++    void
++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
++		   const __c_locale& __cloc)
++    {
++      if (!(__err & ios_base::failbit))
++	{
++	  char* __sanity;
++	  errno = 0;
++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
++          if (__sanity != __s && errno != ERANGE)
++	    __v = __ld;
++	  else
++	    __err |= ios_base::failbit;
++	}
++    }
++
++  void
++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++				    __c_locale __old)
++  {
++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
++#ifdef __UCLIBC_HAS_XLOCALE__
++    if (!__cloc)
++      {
++	// This named locale is not supported by the underlying OS.
++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++			      "name not valid"));
++      }
++#endif
++  }
++
++  void
++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++  {
++    if (_S_get_c_locale() != __cloc)
++      __freelocale(__cloc);
++  }
++
++  __c_locale
++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++  { return __duplocale(__cloc); }
++} // namespace std
++
++namespace __gnu_cxx
++{
++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++    {
++      "LC_CTYPE",
++      "LC_NUMERIC",
++      "LC_TIME",
++      "LC_COLLATE",
++      "LC_MONETARY",
++      "LC_MESSAGES",
++#if _GLIBCXX_NUM_CATEGORIES != 0
++      "LC_PAPER",
++      "LC_NAME",
++      "LC_ADDRESS",
++      "LC_TELEPHONE",
++      "LC_MEASUREMENT",
++      "LC_IDENTIFICATION"
++#endif
++    };
++}
++
++namespace std
++{
++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++}  // namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+new file mode 100644
+index 0000000..da07c1f
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -0,0 +1,117 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8  Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring>              // get std::strlen
++#include <cstdio>               // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h>		// For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h>		// For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> 		// For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCXX_C_LOCALE_GNU for
++#endif
++#define _GLIBCXX_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCXX_NUM_CATEGORIES 6
++#define _GLIBCXX_NUM_CATEGORIES 0
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++namespace __gnu_cxx
++{
++  extern "C" __typeof(uselocale) __uselocale;
++}
++#endif
++
++namespace std
++{
++#ifdef __UCLIBC_HAS_XLOCALE__
++  typedef __locale_t		__c_locale;
++#else
++  typedef int*			__c_locale;
++#endif
++
++  // Convert numeric value of type _Tv to string and return length of
++  // string.  If snprintf is available use it, otherwise fall back to
++  // the unsafe sprintf which, in general, can be dangerous and should
++  // be avoided.
++  template<typename _Tv>
++    int
++    __convert_from_v(char* __out,
++		     const int __size __attribute__ ((__unused__)),
++		     const char* __fmt,
++#ifdef __UCLIBC_HAS_XCLOCALE__
++		     _Tv __v, const __c_locale& __cloc, int __prec)
++    {
++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++		     _Tv __v, const __c_locale&, int __prec)
++    {
++# ifdef __UCLIBC_HAS_LOCALE__
++      char* __old = std::setlocale(LC_ALL, NULL);
++      char* __sav = new char[std::strlen(__old) + 1];
++      std::strcpy(__sav, __old);
++      std::setlocale(LC_ALL, "C");
++# endif
++#endif
++
++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++
++#ifdef __UCLIBC_HAS_XCLOCALE__
++      __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++      std::setlocale(LC_ALL, __sav);
++      delete [] __sav;
++#endif
++      return __ret;
++    }
++}
++
++#endif
+diff --git a/libstdc++-v3/config/locale/uclibc/codecvt_members.cc b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+new file mode 100644
+index 0000000..64aa962
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+@@ -0,0 +1,308 @@
++// std::codecvt implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <cstdlib>  // For MB_CUR_MAX
++#include <climits>  // For MB_LEN_MAX
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++  // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++  codecvt_base::result
++  codecvt<wchar_t, char, mbstate_t>::
++  do_out(state_type& __state, const intern_type* __from,
++	 const intern_type* __from_end, const intern_type*& __from_next,
++	 extern_type* __to, extern_type* __to_end,
++	 extern_type*& __to_next) const
++  {
++    result __ret = ok;
++    state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
++    // in case we fall back to wcrtomb and then continue, in a loop.
++    // NB: wcsnrtombs is a GNU extension
++    for (__from_next = __from, __to_next = __to;
++	 __from_next < __from_end && __to_next < __to_end
++	 && __ret == ok;)
++      {
++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
++						      __from_end - __from_next);
++	if (!__from_chunk_end)
++	  __from_chunk_end = __from_end;
++
++	__from = __from_next;
++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
++					 __from_chunk_end - __from_next,
++					 __to_end - __to_next, &__state);
++	if (__conv == static_cast<size_t>(-1))
++	  {
++	    // In case of error, in order to stop at the exact place we
++	    // have to start again from the beginning with a series of
++	    // wcrtomb.
++	    for (; __from < __from_next; ++__from)
++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
++	    __state = __tmp_state;
++	    __ret = error;
++	  }
++	else if (__from_next && __from_next < __from_chunk_end)
++	  {
++	    __to_next += __conv;
++	    __ret = partial;
++	  }
++	else
++	  {
++	    __from_next = __from_chunk_end;
++	    __to_next += __conv;
++	  }
++
++	if (__from_next < __from_end && __ret == ok)
++	  {
++	    extern_type __buf[MB_LEN_MAX];
++	    __tmp_state = __state;
++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
++	      __ret = partial;
++	    else
++	      {
++		memcpy(__to_next, __buf, __conv);
++		__state = __tmp_state;
++		__to_next += __conv;
++		++__from_next;
++	      }
++	  }
++      }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++
++    return __ret;
++  }
++
++  codecvt_base::result
++  codecvt<wchar_t, char, mbstate_t>::
++  do_in(state_type& __state, const extern_type* __from,
++	const extern_type* __from_end, const extern_type*& __from_next,
++	intern_type* __to, intern_type* __to_end,
++	intern_type*& __to_next) const
++  {
++    result __ret = ok;
++    state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++    // in case we store a L'\0' and then continue, in a loop.
++    // NB: mbsnrtowcs is a GNU extension
++    for (__from_next = __from, __to_next = __to;
++	 __from_next < __from_end && __to_next < __to_end
++	 && __ret == ok;)
++      {
++	const extern_type* __from_chunk_end;
++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
++								  __from_end
++								  - __from_next));
++	if (!__from_chunk_end)
++	  __from_chunk_end = __from_end;
++
++	__from = __from_next;
++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
++				   __from_chunk_end - __from_next,
++				   __to_end - __to_next, &__state);
++	if (__conv == static_cast<size_t>(-1))
++	  {
++	    // In case of error, in order to stop at the exact place we
++	    // have to start again from the beginning with a series of
++	    // mbrtowc.
++	    for (;; ++__to_next, __from += __conv)
++	      {
++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
++				 &__tmp_state);
++		if (__conv == static_cast<size_t>(-1)
++		    || __conv == static_cast<size_t>(-2))
++		  break;
++	      }
++	    __from_next = __from;
++	    __state = __tmp_state;
++	    __ret = error;
++	  }
++	else if (__from_next && __from_next < __from_chunk_end)
++	  {
++	    // It is unclear what to return in this case (see DR 382).
++	    __to_next += __conv;
++	    __ret = partial;
++	  }
++	else
++	  {
++	    __from_next = __from_chunk_end;
++	    __to_next += __conv;
++	  }
++
++	if (__from_next < __from_end && __ret == ok)
++	  {
++	    if (__to_next < __to_end)
++	      {
++		// XXX Probably wrong for stateful encodings
++		__tmp_state = __state;
++		++__from_next;
++		*__to_next++ = L'\0';
++	      }
++	    else
++	      __ret = partial;
++	  }
++      }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++
++    return __ret;
++  }
++
++  int
++  codecvt<wchar_t, char, mbstate_t>::
++  do_encoding() const throw()
++  {
++    // XXX This implementation assumes that the encoding is
++    // stateless and is either single-byte or variable-width.
++    int __ret = 0;
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++    if (MB_CUR_MAX == 1)
++      __ret = 1;
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return __ret;
++  }
++
++  int
++  codecvt<wchar_t, char, mbstate_t>::
++  do_max_length() const throw()
++  {
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++    // XXX Probably wrong for stateful encodings.
++    int __ret = MB_CUR_MAX;
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return __ret;
++  }
++
++  int
++  codecvt<wchar_t, char, mbstate_t>::
++  do_length(state_type& __state, const extern_type* __from,
++	    const extern_type* __end, size_t __max) const
++  {
++    int __ret = 0;
++    state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++    // in case we advance past it and then continue, in a loop.
++    // NB: mbsnrtowcs is a GNU extension
++
++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
++    // its fourth parameter (it wouldn't with NULL as first parameter).
++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++							   * __max));
++    while (__from < __end && __max)
++      {
++	const extern_type* __from_chunk_end;
++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
++								  __end
++								  - __from));
++	if (!__from_chunk_end)
++	  __from_chunk_end = __end;
++
++	const extern_type* __tmp_from = __from;
++	size_t __conv = mbsnrtowcs(__to, &__from,
++				   __from_chunk_end - __from,
++				   __max, &__state);
++	if (__conv == static_cast<size_t>(-1))
++	  {
++	    // In case of error, in order to stop at the exact place we
++	    // have to start again from the beginning with a series of
++	    // mbrtowc.
++	    for (__from = __tmp_from;; __from += __conv)
++	      {
++		__conv = mbrtowc(NULL, __from, __end - __from,
++				 &__tmp_state);
++		if (__conv == static_cast<size_t>(-1)
++		    || __conv == static_cast<size_t>(-2))
++		  break;
++	      }
++	    __state = __tmp_state;
++	    __ret += __from - __tmp_from;
++	    break;
++	  }
++	if (!__from)
++	  __from = __from_chunk_end;
++
++	__ret += __from - __tmp_from;
++	__max -= __conv;
++
++	if (__from < __end && __max)
++	  {
++	    // XXX Probably wrong for stateful encodings
++	    __tmp_state = __state;
++	    ++__from;
++	    ++__ret;
++	    --__max;
++	  }
++      }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++
++    return __ret;
++  }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+new file mode 100644
+index 0000000..c2664a7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -0,0 +1,80 @@
++// std::collate implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
++#endif
++
++namespace std
++{
++  // These are basically extensions to char_traits, and perhaps should
++  // be put there instead of here.
++  template<>
++    int
++    collate<char>::_M_compare(const char* __one, const char* __two) const
++    {
++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++    }
++
++  template<>
++    size_t
++    collate<char>::_M_transform(char* __to, const char* __from,
++				size_t __n) const
++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    int
++    collate<wchar_t>::_M_compare(const wchar_t* __one,
++				 const wchar_t* __two) const
++    {
++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++    }
++
++  template<>
++    size_t
++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++				   size_t __n) const
++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+new file mode 100644
+index 0000000..7294e3a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -0,0 +1,300 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __wctype_l(S, L)           wctype((S))
++#define __towupper_l(C, L)         towupper((C))
++#define __towlower_l(C, L)         towlower((C))
++#define __iswctype_l(C, M, L)      iswctype((C), (M))
++#endif
++
++namespace std
++{
++  // NB: The other ctype<char> specializations are in src/locale.cc and
++  // various /config/os/* files.
++  template<>
++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++    : ctype<char>(0, false, __refs)
++    {
++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++	{
++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
++#endif
++	}
++    }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  ctype<wchar_t>::__wmask_type
++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
++  {
++    __wmask_type __ret;
++    switch (__m)
++      {
++      case space:
++	__ret = __wctype_l("space", _M_c_locale_ctype);
++	break;
++      case print:
++	__ret = __wctype_l("print", _M_c_locale_ctype);
++	break;
++      case cntrl:
++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
++	break;
++      case upper:
++	__ret = __wctype_l("upper", _M_c_locale_ctype);
++	break;
++      case lower:
++	__ret = __wctype_l("lower", _M_c_locale_ctype);
++	break;
++      case alpha:
++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
++	break;
++      case digit:
++	__ret = __wctype_l("digit", _M_c_locale_ctype);
++	break;
++      case punct:
++	__ret = __wctype_l("punct", _M_c_locale_ctype);
++	break;
++      case xdigit:
++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
++	break;
++      case alnum:
++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
++	break;
++      case graph:
++	__ret = __wctype_l("graph", _M_c_locale_ctype);
++	break;
++      default:
++	__ret = __wmask_type();
++      }
++    return __ret;
++  }
++
++  wchar_t
++  ctype<wchar_t>::do_toupper(wchar_t __c) const
++  { return __towupper_l(__c, _M_c_locale_ctype); }
++
++  const wchar_t*
++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
++  {
++    while (__lo < __hi)
++      {
++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
++        ++__lo;
++      }
++    return __hi;
++  }
++
++  wchar_t
++  ctype<wchar_t>::do_tolower(wchar_t __c) const
++  { return __towlower_l(__c, _M_c_locale_ctype); }
++
++  const wchar_t*
++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
++  {
++    while (__lo < __hi)
++      {
++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
++        ++__lo;
++      }
++    return __hi;
++  }
++
++  bool
++  ctype<wchar_t>::
++  do_is(mask __m, wchar_t __c) const
++  {
++    // Highest bitmask in ctype_base == 10, but extra in "C"
++    // library for blank.
++    bool __ret = false;
++    const size_t __bitmasksize = 11;
++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++      if (__m & _M_bit[__bitcur]
++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++	{
++	  __ret = true;
++	  break;
++	}
++    return __ret;
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
++  {
++    for (; __lo < __hi; ++__vec, ++__lo)
++      {
++	// Highest bitmask in ctype_base == 10, but extra in "C"
++	// library for blank.
++	const size_t __bitmasksize = 11;
++	mask __m = 0;
++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
++	    __m |= _M_bit[__bitcur];
++	*__vec = __m;
++      }
++    return __hi;
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
++  {
++    while (__lo < __hi && !this->do_is(__m, *__lo))
++      ++__lo;
++    return __lo;
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
++  {
++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++      ++__lo;
++    return __lo;
++  }
++
++  wchar_t
++  ctype<wchar_t>::
++  do_widen(char __c) const
++  { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++  const char*
++  ctype<wchar_t>::
++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++  {
++    while (__lo < __hi)
++      {
++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++	++__lo;
++	++__dest;
++      }
++    return __hi;
++  }
++
++  char
++  ctype<wchar_t>::
++  do_narrow(wchar_t __wc, char __dfault) const
++  {
++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
++      return _M_narrow[__wc];
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++    const int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return (__c == EOF ? __dfault : static_cast<char>(__c));
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
++	    char* __dest) const
++  {
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++    if (_M_narrow_ok)
++      while (__lo < __hi)
++	{
++	  if (*__lo >= 0 && *__lo < 128)
++	    *__dest = _M_narrow[*__lo];
++	  else
++	    {
++	      const int __c = wctob(*__lo);
++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++	    }
++	  ++__lo;
++	  ++__dest;
++	}
++    else
++      while (__lo < __hi)
++	{
++	  const int __c = wctob(*__lo);
++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++	  ++__lo;
++	  ++__dest;
++	}
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return __hi;
++  }
++
++  void
++  ctype<wchar_t>::_M_initialize_ctype()
++  {
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++    wint_t __i;
++    for (__i = 0; __i < 128; ++__i)
++      {
++	const int __c = wctob(__i);
++	if (__c == EOF)
++	  break;
++	else
++	  _M_narrow[__i] = static_cast<char>(__c);
++      }
++    if (__i == 128)
++      _M_narrow_ok = true;
++    else
++      _M_narrow_ok = false;
++    for (size_t __j = 0;
++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
++      _M_widen[__j] = btowc(__j);
++
++    for (size_t __k = 0; __k <= 11; ++__k)
++      {
++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
++      }
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++  }
++#endif //  _GLIBCXX_USE_WCHAR_T
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+new file mode 100644
+index 0000000..13594d9
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -0,0 +1,100 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix gettext stuff
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__dcgettext(const char *domainname,
++			     const char *msgid, int category);
++#undef gettext
++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#else
++#undef gettext
++#define gettext(msgid) (msgid)
++#endif
++
++namespace std
++{
++  // Specializations.
++  template<>
++    string
++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
++    {
++#ifdef __UCLIBC_HAS_XLOCALE__
++      __c_locale __old = __uselocale(_M_c_locale_messages);
++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
++      __uselocale(__old);
++      return string(__msg);
++#elif defined __UCLIBC_HAS_LOCALE__
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_messages);
++      const char* __msg = gettext(__dfault.c_str());
++      setlocale(LC_ALL, __old);
++      free(__old);
++      return string(__msg);
++#else
++      const char* __msg = gettext(__dfault.c_str());
++      return string(__msg);
++#endif
++    }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    wstring
++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
++    {
++# ifdef __UCLIBC_HAS_XLOCALE__
++      __c_locale __old = __uselocale(_M_c_locale_messages);
++      char* __msg = gettext(_M_convert_to_char(__dfault));
++      __uselocale(__old);
++      return _M_convert_from_char(__msg);
++# elif defined __UCLIBC_HAS_LOCALE__
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_messages);
++      char* __msg = gettext(_M_convert_to_char(__dfault));
++      setlocale(LC_ALL, __old);
++      free(__old);
++      return _M_convert_from_char(__msg);
++# else
++      char* __msg = gettext(_M_convert_to_char(__dfault));
++      return _M_convert_from_char(__msg);
++# endif
++    }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+new file mode 100644
+index 0000000..1424078
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -0,0 +1,118 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2  messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix prototypes for *textdomain funcs
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__textdomain(const char *domainname);
++extern "C" char *__bindtextdomain(const char *domainname,
++				  const char *dirname);
++#else
++#undef __textdomain
++#undef __bindtextdomain
++#define __textdomain(D)           ((void)0)
++#define __bindtextdomain(D,P)     ((void)0)
++#endif
++
++  // Non-virtual member functions.
++  template<typename _CharT>
++     messages<_CharT>::messages(size_t __refs)
++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
++     _M_name_messages(_S_get_c_name())
++     { }
++
++  template<typename _CharT>
++     messages<_CharT>::messages(__c_locale __cloc, const char* __s,
++				size_t __refs)
++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
++     _M_name_messages(__s)
++     {
++       char* __tmp = new char[std::strlen(__s) + 1];
++       std::strcpy(__tmp, __s);
++       _M_name_messages = __tmp;
++     }
++
++  template<typename _CharT>
++    typename messages<_CharT>::catalog
++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++			   const char* __dir) const
++    {
++      __bindtextdomain(__s.c_str(), __dir);
++      return this->do_open(__s, __loc);
++    }
++
++  // Virtual member functions.
++  template<typename _CharT>
++    messages<_CharT>::~messages()
++    {
++      if (_M_name_messages != _S_get_c_name())
++	delete [] _M_name_messages;
++      _S_destroy_c_locale(_M_c_locale_messages);
++    }
++
++  template<typename _CharT>
++    typename messages<_CharT>::catalog
++    messages<_CharT>::do_open(const basic_string<char>& __s,
++			      const locale&) const
++    {
++      // No error checking is done, assume the catalog exists and can
++      // be used.
++      __textdomain(__s.c_str());
++      return 0;
++    }
++
++  template<typename _CharT>
++    void
++    messages<_CharT>::do_close(catalog) const
++    { }
++
++   // messages_byname
++   template<typename _CharT>
++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++     : messages<_CharT>(__refs)
++     {
++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
++	 delete [] this->_M_name_messages;
++       char* __tmp = new char[std::strlen(__s) + 1];
++       std::strcpy(__tmp, __s);
++       this->_M_name_messages = __tmp;
++
++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++	 {
++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s);
++	 }
++     }
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+new file mode 100644
+index 0000000..aa52731
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -0,0 +1,692 @@
++// std::moneypunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning optimize this for uclibc
++#warning tailor for stub locale support
++#endif
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
++#endif
++
++namespace std
++{
++  // Construct and return valid pattern consisting of some combination of:
++  // space none symbol sign value
++  money_base::pattern
++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
++  {
++    pattern __ret;
++
++    // This insanely complicated routine attempts to construct a valid
++    // pattern for use with monyepunct. A couple of invariants:
++
++    // if (__precedes) symbol -> value
++    // else value -> symbol
++
++    // if (__space) space
++    // else none
++
++    // none == never first
++    // space never first or last
++
++    // Any elegant implementations of this are welcome.
++    switch (__posn)
++      {
++      case 0:
++      case 1:
++	// 1 The sign precedes the value and symbol.
++	__ret.field[0] = sign;
++	if (__space)
++	  {
++	    // Pattern starts with sign.
++	    if (__precedes)
++	      {
++		__ret.field[1] = symbol;
++		__ret.field[3] = value;
++	      }
++	    else
++	      {
++		__ret.field[1] = value;
++		__ret.field[3] = symbol;
++	      }
++	    __ret.field[2] = space;
++	  }
++	else
++	  {
++	    // Pattern starts with sign and ends with none.
++	    if (__precedes)
++	      {
++		__ret.field[1] = symbol;
++		__ret.field[2] = value;
++	      }
++	    else
++	      {
++		__ret.field[1] = value;
++		__ret.field[2] = symbol;
++	      }
++	    __ret.field[3] = none;
++	  }
++	break;
++      case 2:
++	// 2 The sign follows the value and symbol.
++	if (__space)
++	  {
++	    // Pattern either ends with sign.
++	    if (__precedes)
++	      {
++		__ret.field[0] = symbol;
++		__ret.field[2] = value;
++	      }
++	    else
++	      {
++		__ret.field[0] = value;
++		__ret.field[2] = symbol;
++	      }
++	    __ret.field[1] = space;
++	    __ret.field[3] = sign;
++	  }
++	else
++	  {
++	    // Pattern ends with sign then none.
++	    if (__precedes)
++	      {
++		__ret.field[0] = symbol;
++		__ret.field[1] = value;
++	      }
++	    else
++	      {
++		__ret.field[0] = value;
++		__ret.field[1] = symbol;
++	      }
++	    __ret.field[2] = sign;
++	    __ret.field[3] = none;
++	  }
++	break;
++      case 3:
++	// 3 The sign immediately precedes the symbol.
++	if (__precedes)
++	  {
++	    __ret.field[0] = sign;
++	    __ret.field[1] = symbol;
++	    if (__space)
++	      {
++		__ret.field[2] = space;
++		__ret.field[3] = value;
++	      }
++	    else
++	      {
++		__ret.field[2] = value;
++		__ret.field[3] = none;
++	      }
++	  }
++	else
++	  {
++	    __ret.field[0] = value;
++	    if (__space)
++	      {
++		__ret.field[1] = space;
++		__ret.field[2] = sign;
++		__ret.field[3] = symbol;
++	      }
++	    else
++	      {
++		__ret.field[1] = sign;
++		__ret.field[2] = symbol;
++		__ret.field[3] = none;
++	      }
++	  }
++	break;
++      case 4:
++	// 4 The sign immediately follows the symbol.
++	if (__precedes)
++	  {
++	    __ret.field[0] = symbol;
++	    __ret.field[1] = sign;
++	    if (__space)
++	      {
++		__ret.field[2] = space;
++		__ret.field[3] = value;
++	      }
++	    else
++	      {
++		__ret.field[2] = value;
++		__ret.field[3] = none;
++	      }
++	  }
++	else
++	  {
++	    __ret.field[0] = value;
++	    if (__space)
++	      {
++		__ret.field[1] = space;
++		__ret.field[2] = symbol;
++		__ret.field[3] = sign;
++	      }
++	    else
++	      {
++		__ret.field[1] = symbol;
++		__ret.field[2] = sign;
++		__ret.field[3] = none;
++	      }
++	  }
++	break;
++      default:
++	;
++      }
++    return __ret;
++  }
++
++  template<>
++    void
++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++						     const char*)
++    {
++      if (!_M_data)
++	_M_data = new __moneypunct_cache<char, true>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = '.';
++	  _M_data->_M_thousands_sep = ',';
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = "";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = "";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = "";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++	}
++      else
++	{
++	  // Named locale.
++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++							__cloc));
++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++							__cloc));
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++	  if (!__nposn)
++	    _M_data->_M_negative_sign = "()";
++	  else
++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++							__cloc);
++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++	  // _Intl == true
++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++						      __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++							__pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++							__nposn);
++	}
++    }
++
++  template<>
++    void
++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++						      const char*)
++    {
++      if (!_M_data)
++	_M_data = new __moneypunct_cache<char, false>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = '.';
++	  _M_data->_M_thousands_sep = ',';
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = "";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = "";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = "";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++	}
++      else
++	{
++	  // Named locale.
++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++							__cloc));
++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++							__cloc));
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++	  if (!__nposn)
++	    _M_data->_M_negative_sign = "()";
++	  else
++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++							__cloc);
++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++	  // _Intl == false
++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++							__pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++							__nposn);
++	}
++    }
++
++  template<>
++    moneypunct<char, true>::~moneypunct()
++    { delete _M_data; }
++
++  template<>
++    moneypunct<char, false>::~moneypunct()
++    { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    void
++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++							const char*)
++#else
++							const char* __name)
++#endif
++    {
++      if (!_M_data)
++	_M_data = new __moneypunct_cache<wchar_t, true>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = L'.';
++	  _M_data->_M_thousands_sep = L',';
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = L"";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = L"";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = L"";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  // Use ctype::widen code without the facet...
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] =
++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
++	}
++      else
++	{
++	  // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __c_locale __old = __uselocale(__cloc);
++#else
++	  // Switch to named locale so that mbsrtowcs will work.
++	  char* __old = strdup(setlocale(LC_ALL, NULL));
++	  setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++	  union { char *__s; wchar_t __w; } __u;
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++	  _M_data->_M_decimal_point = __u.__w;
++
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++	  _M_data->_M_thousands_sep = __u.__w;
++#endif
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++
++	  wchar_t* __wcs_ps = 0;
++	  wchar_t* __wcs_ns = 0;
++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++	  try
++	    {
++	      mbstate_t __state;
++	      size_t __len = strlen(__cpossign);
++	      if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ps = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++		  _M_data->_M_positive_sign = __wcs_ps;
++		}
++	      else
++		_M_data->_M_positive_sign = L"";
++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++	      __len = strlen(__cnegsign);
++	      if (!__nposn)
++		_M_data->_M_negative_sign = L"()";
++	      else if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ns = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++		  _M_data->_M_negative_sign = __wcs_ns;
++		}
++	      else
++		_M_data->_M_negative_sign = L"";
++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++	      // _Intl == true.
++	      __len = strlen(__ccurr);
++	      if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  wchar_t* __wcs = new wchar_t[__len];
++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++		  _M_data->_M_curr_symbol = __wcs;
++		}
++	      else
++		_M_data->_M_curr_symbol = L"";
++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++	    }
++	  catch (...)
++	    {
++	      delete _M_data;
++	      _M_data = 0;
++	      delete __wcs_ps;
++	      delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++	      __uselocale(__old);
++#else
++	      setlocale(LC_ALL, __old);
++	      free(__old);
++#endif
++	      __throw_exception_again;
++	    }
++
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++						      __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++							__pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++							__nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __uselocale(__old);
++#else
++	  setlocale(LC_ALL, __old);
++	  free(__old);
++#endif
++	}
++    }
++
++  template<>
++  void
++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++						       const char*)
++#else
++                                                       const char* __name)
++#endif
++  {
++    if (!_M_data)
++      _M_data = new __moneypunct_cache<wchar_t, false>;
++
++    if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = L'.';
++	  _M_data->_M_thousands_sep = L',';
++	  _M_data->_M_grouping = "";
++          _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = L"";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = L"";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = L"";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  // Use ctype::widen code without the facet...
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] =
++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
++	}
++      else
++	{
++	  // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __c_locale __old = __uselocale(__cloc);
++#else
++	  // Switch to named locale so that mbsrtowcs will work.
++	  char* __old = strdup(setlocale(LC_ALL, NULL));
++	  setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++          union { char *__s; wchar_t __w; } __u;
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++	  _M_data->_M_decimal_point = __u.__w;
++
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++	  _M_data->_M_thousands_sep = __u.__w;
++#endif
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++
++	  wchar_t* __wcs_ps = 0;
++	  wchar_t* __wcs_ns = 0;
++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++	  try
++            {
++              mbstate_t __state;
++              size_t __len;
++              __len = strlen(__cpossign);
++              if (__len)
++                {
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ps = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++		  _M_data->_M_positive_sign = __wcs_ps;
++		}
++	      else
++		_M_data->_M_positive_sign = L"";
++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++	      __len = strlen(__cnegsign);
++	      if (!__nposn)
++		_M_data->_M_negative_sign = L"()";
++	      else if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ns = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++		  _M_data->_M_negative_sign = __wcs_ns;
++		}
++	      else
++		_M_data->_M_negative_sign = L"";
++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++	      // _Intl == true.
++	      __len = strlen(__ccurr);
++	      if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  wchar_t* __wcs = new wchar_t[__len];
++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++		  _M_data->_M_curr_symbol = __wcs;
++		}
++	      else
++		_M_data->_M_curr_symbol = L"";
++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++	    }
++          catch (...)
++	    {
++	      delete _M_data;
++              _M_data = 0;
++	      delete __wcs_ps;
++	      delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++	      __uselocale(__old);
++#else
++	      setlocale(LC_ALL, __old);
++	      free(__old);
++#endif
++              __throw_exception_again;
++	    }
++
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++	                                                __pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++	                                                __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __uselocale(__old);
++#else
++	  setlocale(LC_ALL, __old);
++	  free(__old);
++#endif
++	}
++    }
++
++  template<>
++    moneypunct<wchar_t, true>::~moneypunct()
++    {
++      if (_M_data->_M_positive_sign_size)
++	delete [] _M_data->_M_positive_sign;
++      if (_M_data->_M_negative_sign_size
++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++	delete [] _M_data->_M_negative_sign;
++      if (_M_data->_M_curr_symbol_size)
++	delete [] _M_data->_M_curr_symbol;
++      delete _M_data;
++    }
++
++  template<>
++    moneypunct<wchar_t, false>::~moneypunct()
++    {
++      if (_M_data->_M_positive_sign_size)
++	delete [] _M_data->_M_positive_sign;
++      if (_M_data->_M_negative_sign_size
++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++	delete [] _M_data->_M_negative_sign;
++      if (_M_data->_M_curr_symbol_size)
++	delete [] _M_data->_M_curr_symbol;
++      delete _M_data;
++    }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+new file mode 100644
+index 0000000..883ec1a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -0,0 +1,160 @@
++// std::numpunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
++#endif
++
++namespace std
++{
++  template<>
++    void
++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __numpunct_cache<char>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_use_grouping = false;
++
++	  _M_data->_M_decimal_point = '.';
++	  _M_data->_M_thousands_sep = ',';
++
++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
++
++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
++	}
++      else
++	{
++	  // Named locale.
++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
++							__cloc));
++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
++							__cloc));
++
++	  // Check for NULL, which implies no grouping.
++	  if (_M_data->_M_thousands_sep == '\0')
++	    _M_data->_M_grouping = "";
++	  else
++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	}
++
++      // NB: There is no way to extact this info from posix locales.
++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++      _M_data->_M_truename = "true";
++      _M_data->_M_truename_size = 4;
++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++      _M_data->_M_falsename = "false";
++      _M_data->_M_falsename_size = 5;
++    }
++
++  template<>
++    numpunct<char>::~numpunct()
++    { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    void
++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __numpunct_cache<wchar_t>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_use_grouping = false;
++
++	  _M_data->_M_decimal_point = L'.';
++	  _M_data->_M_thousands_sep = L',';
++
++	  // Use ctype::widen code without the facet...
++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++	    _M_data->_M_atoms_out[__i] =
++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
++
++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++	    _M_data->_M_atoms_in[__j] =
++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
++	}
++      else
++	{
++	  // Named locale.
++	  // NB: In the GNU model wchar_t is always 32 bit wide.
++	  union { char *__s; wchar_t __w; } __u;
++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++	  _M_data->_M_decimal_point = __u.__w;
++
++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++	  _M_data->_M_thousands_sep = __u.__w;
++
++	  if (_M_data->_M_thousands_sep == L'\0')
++	    _M_data->_M_grouping = "";
++	  else
++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	}
++
++      // NB: There is no way to extact this info from posix locales.
++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++      _M_data->_M_truename = L"true";
++      _M_data->_M_truename_size = 4;
++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++      _M_data->_M_falsename = L"false";
++      _M_data->_M_falsename_size = 5;
++    }
++
++  template<>
++    numpunct<wchar_t>::~numpunct()
++    { delete _M_data; }
++ #endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+new file mode 100644
+index 0000000..e0707d7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -0,0 +1,406 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
++#endif
++
++namespace std
++{
++  template<>
++    void
++    __timepunct<char>::
++    _M_put(char* __s, size_t __maxlen, const char* __format,
++	   const tm* __tm) const
++    {
++#ifdef __UCLIBC_HAS_XLOCALE__
++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
++					_M_c_locale_timepunct);
++#else
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_timepunct);
++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
++      setlocale(LC_ALL, __old);
++      free(__old);
++#endif
++      // Make sure __s is null terminated.
++      if (__len == 0)
++	__s[0] = '\0';
++    }
++
++  template<>
++    void
++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __timepunct_cache<char>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_c_locale_timepunct = _S_get_c_locale();
++
++	  _M_data->_M_date_format = "%m/%d/%y";
++	  _M_data->_M_date_era_format = "%m/%d/%y";
++	  _M_data->_M_time_format = "%H:%M:%S";
++	  _M_data->_M_time_era_format = "%H:%M:%S";
++	  _M_data->_M_date_time_format = "";
++	  _M_data->_M_date_time_era_format = "";
++	  _M_data->_M_am = "AM";
++	  _M_data->_M_pm = "PM";
++	  _M_data->_M_am_pm_format = "";
++
++	  // Day names, starting with "C"'s Sunday.
++	  _M_data->_M_day1 = "Sunday";
++	  _M_data->_M_day2 = "Monday";
++	  _M_data->_M_day3 = "Tuesday";
++	  _M_data->_M_day4 = "Wednesday";
++	  _M_data->_M_day5 = "Thursday";
++	  _M_data->_M_day6 = "Friday";
++	  _M_data->_M_day7 = "Saturday";
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  _M_data->_M_aday1 = "Sun";
++	  _M_data->_M_aday2 = "Mon";
++	  _M_data->_M_aday3 = "Tue";
++	  _M_data->_M_aday4 = "Wed";
++	  _M_data->_M_aday5 = "Thu";
++	  _M_data->_M_aday6 = "Fri";
++	  _M_data->_M_aday7 = "Sat";
++
++	  // Month names, starting with "C"'s January.
++	  _M_data->_M_month01 = "January";
++	  _M_data->_M_month02 = "February";
++	  _M_data->_M_month03 = "March";
++	  _M_data->_M_month04 = "April";
++	  _M_data->_M_month05 = "May";
++	  _M_data->_M_month06 = "June";
++	  _M_data->_M_month07 = "July";
++	  _M_data->_M_month08 = "August";
++	  _M_data->_M_month09 = "September";
++	  _M_data->_M_month10 = "October";
++	  _M_data->_M_month11 = "November";
++	  _M_data->_M_month12 = "December";
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  _M_data->_M_amonth01 = "Jan";
++	  _M_data->_M_amonth02 = "Feb";
++	  _M_data->_M_amonth03 = "Mar";
++	  _M_data->_M_amonth04 = "Apr";
++	  _M_data->_M_amonth05 = "May";
++	  _M_data->_M_amonth06 = "Jun";
++	  _M_data->_M_amonth07 = "Jul";
++	  _M_data->_M_amonth08 = "Aug";
++	  _M_data->_M_amonth09 = "Sep";
++	  _M_data->_M_amonth10 = "Oct";
++	  _M_data->_M_amonth11 = "Nov";
++	  _M_data->_M_amonth12 = "Dec";
++	}
++      else
++	{
++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
++							     __cloc);
++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++	  // Day names, starting with "C"'s Sunday.
++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++	  // Month names, starting with "C"'s January.
++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
++	}
++    }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    void
++    __timepunct<wchar_t>::
++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
++	   const tm* __tm) const
++    {
++#ifdef __UCLIBC_HAS_XLOCALE__
++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
++					_M_c_locale_timepunct);
++#else
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_timepunct);
++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
++      setlocale(LC_ALL, __old);
++      free(__old);
++#endif
++      // Make sure __s is null terminated.
++      if (__len == 0)
++	__s[0] = L'\0';
++    }
++
++  template<>
++    void
++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __timepunct_cache<wchar_t>;
++
++#warning wide time stuff
++//       if (!__cloc)
++	{
++	  // "C" locale
++	  _M_c_locale_timepunct = _S_get_c_locale();
++
++	  _M_data->_M_date_format = L"%m/%d/%y";
++	  _M_data->_M_date_era_format = L"%m/%d/%y";
++	  _M_data->_M_time_format = L"%H:%M:%S";
++	  _M_data->_M_time_era_format = L"%H:%M:%S";
++	  _M_data->_M_date_time_format = L"";
++	  _M_data->_M_date_time_era_format = L"";
++	  _M_data->_M_am = L"AM";
++	  _M_data->_M_pm = L"PM";
++	  _M_data->_M_am_pm_format = L"";
++
++	  // Day names, starting with "C"'s Sunday.
++	  _M_data->_M_day1 = L"Sunday";
++	  _M_data->_M_day2 = L"Monday";
++	  _M_data->_M_day3 = L"Tuesday";
++	  _M_data->_M_day4 = L"Wednesday";
++	  _M_data->_M_day5 = L"Thursday";
++	  _M_data->_M_day6 = L"Friday";
++	  _M_data->_M_day7 = L"Saturday";
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  _M_data->_M_aday1 = L"Sun";
++	  _M_data->_M_aday2 = L"Mon";
++	  _M_data->_M_aday3 = L"Tue";
++	  _M_data->_M_aday4 = L"Wed";
++	  _M_data->_M_aday5 = L"Thu";
++	  _M_data->_M_aday6 = L"Fri";
++	  _M_data->_M_aday7 = L"Sat";
++
++	  // Month names, starting with "C"'s January.
++	  _M_data->_M_month01 = L"January";
++	  _M_data->_M_month02 = L"February";
++	  _M_data->_M_month03 = L"March";
++	  _M_data->_M_month04 = L"April";
++	  _M_data->_M_month05 = L"May";
++	  _M_data->_M_month06 = L"June";
++	  _M_data->_M_month07 = L"July";
++	  _M_data->_M_month08 = L"August";
++	  _M_data->_M_month09 = L"September";
++	  _M_data->_M_month10 = L"October";
++	  _M_data->_M_month11 = L"November";
++	  _M_data->_M_month12 = L"December";
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  _M_data->_M_amonth01 = L"Jan";
++	  _M_data->_M_amonth02 = L"Feb";
++	  _M_data->_M_amonth03 = L"Mar";
++	  _M_data->_M_amonth04 = L"Apr";
++	  _M_data->_M_amonth05 = L"May";
++	  _M_data->_M_amonth06 = L"Jun";
++	  _M_data->_M_amonth07 = L"Jul";
++	  _M_data->_M_amonth08 = L"Aug";
++	  _M_data->_M_amonth09 = L"Sep";
++	  _M_data->_M_amonth10 = L"Oct";
++	  _M_data->_M_amonth11 = L"Nov";
++	  _M_data->_M_amonth12 = L"Dec";
++	}
++#if 0
++      else
++	{
++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++	  union { char *__s; wchar_t *__w; } __u;
++
++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
++	  _M_data->_M_date_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
++	  _M_data->_M_date_era_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
++	  _M_data->_M_time_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
++	  _M_data->_M_time_era_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
++	  _M_data->_M_date_time_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
++	  _M_data->_M_date_time_era_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
++	  _M_data->_M_am = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
++	  _M_data->_M_pm = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
++	  _M_data->_M_am_pm_format = __u.__w;
++
++	  // Day names, starting with "C"'s Sunday.
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
++	  _M_data->_M_day1 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
++	  _M_data->_M_day2 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
++	  _M_data->_M_day3 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
++	  _M_data->_M_day4 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
++	  _M_data->_M_day5 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
++	  _M_data->_M_day6 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
++	  _M_data->_M_day7 = __u.__w;
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
++	  _M_data->_M_aday1 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
++	  _M_data->_M_aday2 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
++	  _M_data->_M_aday3 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
++	  _M_data->_M_aday4 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
++	  _M_data->_M_aday5 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
++	  _M_data->_M_aday6 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
++	  _M_data->_M_aday7 = __u.__w;
++
++	  // Month names, starting with "C"'s January.
++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
++	  _M_data->_M_month01 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
++	  _M_data->_M_month02 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
++	  _M_data->_M_month03 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
++	  _M_data->_M_month04 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
++	  _M_data->_M_month05 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
++	  _M_data->_M_month06 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
++	  _M_data->_M_month07 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
++	  _M_data->_M_month08 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
++	  _M_data->_M_month09 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
++	  _M_data->_M_month10 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
++	  _M_data->_M_month11 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
++	  _M_data->_M_month12 = __u.__w;
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
++	  _M_data->_M_amonth01 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
++	  _M_data->_M_amonth02 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
++	  _M_data->_M_amonth03 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
++	  _M_data->_M_amonth04 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
++	  _M_data->_M_amonth05 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
++	  _M_data->_M_amonth06 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
++	  _M_data->_M_amonth07 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
++	  _M_data->_M_amonth08 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
++	  _M_data->_M_amonth09 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
++	  _M_data->_M_amonth10 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
++	  _M_data->_M_amonth11 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
++	  _M_data->_M_amonth12 = __u.__w;
++	}
++#endif // 0
++    }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+new file mode 100644
+index 0000000..ba8e858
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -0,0 +1,68 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++  template<typename _CharT>
++    __timepunct<_CharT>::__timepunct(size_t __refs)
++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++    _M_name_timepunct(_S_get_c_name())
++    { _M_initialize_timepunct(); }
++
++  template<typename _CharT>
++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
++    _M_name_timepunct(_S_get_c_name())
++    { _M_initialize_timepunct(); }
++
++  template<typename _CharT>
++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
++				     size_t __refs)
++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++    _M_name_timepunct(__s)
++    {
++      char* __tmp = new char[std::strlen(__s) + 1];
++      std::strcpy(__tmp, __s);
++      _M_name_timepunct = __tmp;
++      _M_initialize_timepunct(__cloc);
++    }
++
++  template<typename _CharT>
++    __timepunct<_CharT>::~__timepunct()
++    {
++      if (_M_name_timepunct != _S_get_c_name())
++	delete [] _M_name_timepunct;
++      delete _M_data;
++      _S_destroy_c_locale(_M_c_locale_timepunct);
++    }
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index f40ddcf..c57a751 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -15822,6 +15822,9 @@ fi
+   # Default to "generic".
+   if test $enable_clocale_flag = auto; then
+     case ${target_os} in
++      *-uclibc*)
++        enable_clocale_flag=uclibc
++        ;;
+       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ 	enable_clocale_flag=gnu
+ 	;;
+@@ -16079,6 +16082,78 @@ $as_echo "newlib" >&6; }
+       CTIME_CC=config/locale/generic/time_members.cc
+       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+       ;;
++    uclibc)
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: uclibc" >&5
++$as_echo "uclibc" >&6; }
++
++      # Declare intention to use gettext, and add support for specific
++      # languages.
++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++      ALL_LINGUAS="de fr"
++
++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++      # Extract the first word of "msgfmt", so it can be a program name with args.
++set dummy msgfmt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_check_msgfmt+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$check_msgfmt"; then
++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_check_msgfmt="yes"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
++fi
++fi
++check_msgfmt=$ac_cv_prog_check_msgfmt
++if test -n "$check_msgfmt"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_msgfmt" >&5
++$as_echo "$check_msgfmt" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++        USE_NLS=yes
++      fi
++      # Export the build objects.
++      for ling in $ALL_LINGUAS; do \
++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++      done
++
++
++
++      CLOCALE_H=config/locale/uclibc/c_locale.h
++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++      CMESSAGES_H=config/locale/uclibc/messages_members.h
++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++      CTIME_H=config/locale/uclibc/time_members.h
++      CTIME_CC=config/locale/uclibc/time_members.cc
++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++      ;;
+   esac
+ 
+   # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/include/c_compatibility/wchar.h b/libstdc++-v3/include/c_compatibility/wchar.h
+index 580d725..3fe61b8 100644
+--- a/libstdc++-v3/include/c_compatibility/wchar.h
++++ b/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -101,7 +101,9 @@ using std::wmemcmp;
+ using std::wmemcpy;
+ using std::wmemmove;
+ using std::wmemset;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using std::wcsftime;
++#endif
+ 
+ #if _GLIBCXX_USE_C99
+ using std::wcstold;
+diff --git a/libstdc++-v3/include/c_std/cwchar b/libstdc++-v3/include/c_std/cwchar
+index 0e6b1fc..405aee2 100644
+--- a/libstdc++-v3/include/c_std/cwchar
++++ b/libstdc++-v3/include/c_std/cwchar
+@@ -175,7 +175,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+   using ::wcscoll;
+   using ::wcscpy;
+   using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+   using ::wcsftime;
++#endif
+   using ::wcslen;
+   using ::wcsncat;
+   using ::wcsncmp;
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch b/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch
new file mode 100644
index 0000000..dcbbfe4
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0005-uclibc-locale-no__x.patch
@@ -0,0 +1,257 @@
+From 6a3e8506a12c12728d8b29901defd738be43757f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:42:36 +0400
+Subject: [PATCH 05/35] uclibc-locale-no__x
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h      |   45 ++++++++++++++++++++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc      |   14 ------
+ libstdc++-v3/config/locale/uclibc/c_locale.h       |    1 +
+ .../config/locale/uclibc/collate_members.cc        |    7 ---
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc |    7 ---
+ .../config/locale/uclibc/messages_members.cc       |    7 +--
+ .../config/locale/uclibc/messages_members.h        |   18 +++-----
+ .../config/locale/uclibc/monetary_members.cc       |    4 --
+ .../config/locale/uclibc/numeric_members.cc        |    3 --
+ libstdc++-v3/config/locale/uclibc/time_members.cc  |    3 --
+ 10 files changed, 55 insertions(+), 54 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index 2ae3e4a..e74fddf 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
+ extern "C" __typeof(wctype_l) __wctype_l;
+ #endif
+ 
++# define __nl_langinfo_l nl_langinfo_l
++# define __strcoll_l strcoll_l
++# define __strftime_l strftime_l
++# define __strtod_l strtod_l
++# define __strtof_l strtof_l
++# define __strtold_l strtold_l
++# define __strxfrm_l strxfrm_l
++# define __newlocale newlocale
++# define __freelocale freelocale
++# define __duplocale duplocale
++# define __uselocale uselocale
++
++# ifdef _GLIBCXX_USE_WCHAR_T
++#  define __iswctype_l iswctype_l
++#  define __towlower_l towlower_l
++#  define __towupper_l towupper_l
++#  define __wcscoll_l wcscoll_l
++#  define __wcsftime_l wcsftime_l
++#  define __wcsxfrm_l wcsxfrm_l
++#  define __wctype_l wctype_l
++# endif
++
++#else
++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
++# define __strtod_l(S, E, L)         strtod((S), (E))
++# define __strtof_l(S, E, L)         strtof((S), (E))
++# define __strtold_l(S, E, L)        strtold((S), (E))
++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
++# warning should dummy __newlocale check for C|POSIX ?
++# define __newlocale(a, b, c)        NULL
++# define __freelocale(a)             ((void)0)
++# define __duplocale(a)              __c_locale()
++//# define __uselocale ?
++//
++# ifdef _GLIBCXX_USE_WCHAR_T
++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
++#  define __towlower_l(C, L)          towlower((C))
++#  define __towupper_l(C, L)          towupper((C))
++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T))
++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
++#  define __wctype_l(S, L)            wctype((S))
++# endif
++
+ #endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 5081dc1..21430d0 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,20 +39,6 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
+-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
+-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
+-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
+-#define __strtof_l(S, E, L)         strtof((S), (E))
+-#define __strtod_l(S, E, L)         strtod((S), (E))
+-#define __strtold_l(S, E, L)        strtold((S), (E))
+-#warning should dummy __newlocale check for C|POSIX ?
+-#define __newlocale(a, b, c)        NULL
+-#define __freelocale(a)             ((void)0)
+-#define __duplocale(a)              __c_locale()
+-#endif
+-
+ namespace std
+ {
+   template<>
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index da07c1f..4bca5f1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -68,6 +68,7 @@ namespace __gnu_cxx
+ {
+   extern "C" __typeof(uselocale) __uselocale;
+ }
++#define __uselocale uselocale
+ #endif
+ 
+ namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+index c2664a7..ec5c329 100644
+--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -36,13 +36,6 @@
+ #include <locale>
+ #include <bits/c++locale_internal.h>
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
+-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
+-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
+-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
+-#endif
+-
+ namespace std
+ {
+   // These are basically extensions to char_traits, and perhaps should
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7294e3a..7b12861 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -38,13 +38,6 @@
+ #undef _LIBC
+ #include <bits/c++locale_internal.h>
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __wctype_l(S, L)           wctype((S))
+-#define __towupper_l(C, L)         towupper((C))
+-#define __towlower_l(C, L)         towlower((C))
+-#define __iswctype_l(C, M, L)      iswctype((C), (M))
+-#endif
+-
+ namespace std
+ {
+   // NB: The other ctype<char> specializations are in src/locale.cc and
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+index 13594d9..d7693b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -39,13 +39,10 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix gettext stuff
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__dcgettext(const char *domainname,
+-			     const char *msgid, int category);
+ #undef gettext
+-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
+ #else
+-#undef gettext
+ #define gettext(msgid) (msgid)
+ #endif
+ 
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 1424078..d89da33 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -36,15 +36,11 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__textdomain(const char *domainname);
+-extern "C" char *__bindtextdomain(const char *domainname,
+-				  const char *dirname);
+-#else
+-#undef __textdomain
+-#undef __bindtextdomain
+-#define __textdomain(D)           ((void)0)
+-#define __bindtextdomain(D,P)     ((void)0)
++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#undef textdomain
++#undef bindtextdomain
++#define textdomain(D)           ((void)0)
++#define bindtextdomain(D,P)     ((void)0)
+ #endif
+ 
+   // Non-virtual member functions.
+@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+ 			   const char* __dir) const
+     {
+-      __bindtextdomain(__s.c_str(), __dir);
++      bindtextdomain(__s.c_str(), __dir);
+       return this->do_open(__s, __loc);
+     }
+ 
+@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+     {
+       // No error checking is done, assume the catalog exists and can
+       // be used.
+-      __textdomain(__s.c_str());
++      textdomain(__s.c_str());
+       return 0;
+     }
+ 
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index aa52731..2e6f80a 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -43,10 +43,6 @@
+ #warning tailor for stub locale support
+ #endif
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
+-#endif
+-
+ namespace std
+ {
+   // Construct and return valid pattern consisting of some combination of:
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 883ec1a..2c70642 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -41,9 +41,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
+-#endif
+ 
+ namespace std
+ {
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index e0707d7..d848ed5 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -40,9 +40,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
+-#endif
+ 
+ namespace std
+ {
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch b/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch
new file mode 100644
index 0000000..3406859
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0006-uclibc-locale-wchar_fix.patch
@@ -0,0 +1,68 @@
+From 225511a3aeb193a916b3999f0b640a392caa67cd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:45:57 +0400
+Subject: [PATCH 06/35] uclibc-locale-wchar_fix
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/monetary_members.cc |    4 ++--
+ libstdc++-v3/config/locale/uclibc/numeric_members.cc  |   13 +++++++++++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 2e6f80a..31ebb9f 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -401,7 +401,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+@@ -556,7 +556,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 2c70642..d5c8961 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -127,12 +127,25 @@ namespace std
+ 	{
+ 	  // Named locale.
+ 	  // NB: In the GNU model wchar_t is always 32 bit wide.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be numeric
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
+ 	  union { char *__s; wchar_t __w; } __u;
+ 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
+ 	  _M_data->_M_decimal_point = __u.__w;
+ 
+ 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
+ 	  _M_data->_M_thousands_sep = __u.__w;
++#endif
+ 
+ 	  if (_M_data->_M_thousands_sep == L'\0')
+ 	    _M_data->_M_grouping = "";
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch b/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch
new file mode 100644
index 0000000..5851123
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0007-uclibc-locale-update.patch
@@ -0,0 +1,542 @@
+From 6ffe7c46f52d27864c3df3663e16ec9ddee71e8f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:46:58 +0400
+Subject: [PATCH 07/35] uclibc-locale-update
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h      |    3 +
+ libstdc++-v3/config/locale/uclibc/c_locale.cc      |   74 +++++++++-----------
+ libstdc++-v3/config/locale/uclibc/c_locale.h       |   42 ++++++-----
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc |   51 ++++++++++----
+ .../config/locale/uclibc/messages_members.h        |   12 ++--
+ .../config/locale/uclibc/monetary_members.cc       |   34 +++++----
+ .../config/locale/uclibc/numeric_members.cc        |    5 ++
+ libstdc++-v3/config/locale/uclibc/time_members.cc  |   18 +++--
+ libstdc++-v3/config/locale/uclibc/time_members.h   |   17 +++--
+ 9 files changed, 158 insertions(+), 98 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index e74fddf..971a6b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -31,6 +31,9 @@
+ 
+ #include <bits/c++config.h>
+ #include <clocale>
++#include <cstdlib>
++#include <cstring>
++#include <cstddef>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning clean this up
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 21430d0..1b9d8e1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,23 +39,20 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+ 
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+   template<>
+     void
+     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
+ 		   const __c_locale& __cloc)
+     {
+-      if (!(__err & ios_base::failbit))
+-	{
+-	  char* __sanity;
+-	  errno = 0;
+-	  float __f = __strtof_l(__s, &__sanity, __cloc);
+-          if (__sanity != __s && errno != ERANGE)
+-	    __v = __f;
+-	  else
+-	    __err |= ios_base::failbit;
+-	}
++      char* __sanity;
++      errno = 0;
++      float __f = __strtof_l(__s, &__sanity, __cloc);
++      if (__sanity != __s && errno != ERANGE)
++	__v = __f;
++      else
++	__err |= ios_base::failbit;
+     }
+ 
+   template<>
+@@ -63,16 +60,13 @@ namespace std
+     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
+ 		   const __c_locale& __cloc)
+     {
+-      if (!(__err & ios_base::failbit))
+-	{
+-	  char* __sanity;
+-	  errno = 0;
+-	  double __d = __strtod_l(__s, &__sanity, __cloc);
+-          if (__sanity != __s && errno != ERANGE)
+-	    __v = __d;
+-	  else
+-	    __err |= ios_base::failbit;
+-	}
++      char* __sanity;
++      errno = 0;
++      double __d = __strtod_l(__s, &__sanity, __cloc);
++      if (__sanity != __s && errno != ERANGE)
++	__v = __d;
++      else
++	__err |= ios_base::failbit;
+     }
+ 
+   template<>
+@@ -80,16 +74,13 @@ namespace std
+     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
+ 		   const __c_locale& __cloc)
+     {
+-      if (!(__err & ios_base::failbit))
+-	{
+-	  char* __sanity;
+-	  errno = 0;
+-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
+-          if (__sanity != __s && errno != ERANGE)
+-	    __v = __ld;
+-	  else
+-	    __err |= ios_base::failbit;
+-	}
++      char* __sanity;
++      errno = 0;
++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
++      if (__sanity != __s && errno != ERANGE)
++	__v = __ld;
++      else
++	__err |= ios_base::failbit;
+     }
+ 
+   void
+@@ -110,17 +101,18 @@ namespace std
+   void
+   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
+   {
+-    if (_S_get_c_locale() != __cloc)
++    if (__cloc && _S_get_c_locale() != __cloc)
+       __freelocale(__cloc);
+   }
+ 
+   __c_locale
+   locale::facet::_S_clone_c_locale(__c_locale& __cloc)
+   { return __duplocale(__cloc); }
+-} // namespace std
+ 
+-namespace __gnu_cxx
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
++
+   const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
+     {
+       "LC_CTYPE",
+@@ -138,9 +130,11 @@ namespace __gnu_cxx
+       "LC_IDENTIFICATION"
+ #endif
+     };
+-}
+ 
+-namespace std
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+   const char* const* const locale::_S_categories = __gnu_cxx::category_names;
+-}  // namespace std
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index 4bca5f1..64a6d46 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -39,21 +39,23 @@
+ #pragma GCC system_header
+ 
+ #include <cstring>              // get std::strlen
+-#include <cstdio>               // get std::snprintf or std::sprintf
++#include <cstdio>               // get std::vsnprintf or std::vsprintf
+ #include <clocale>
+ #include <langinfo.h>		// For codecvt
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix this
+ #endif
+-#ifdef __UCLIBC_HAS_LOCALE__
++#ifdef _GLIBCXX_USE_ICONV
+ #include <iconv.h>		// For codecvt using iconv, iconv_t
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-#include <libintl.h> 		// For messages
++#ifdef HAVE_LIBINTL_H
++#include <libintl.h>		// For messages
+ #endif
++#include <cstdarg>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning what is _GLIBCXX_C_LOCALE_GNU for
++// psm: used in os/gnu-linux/ctype_noninline.h
+ #endif
+ #define _GLIBCXX_C_LOCALE_GNU 1
+ 
+@@ -78,23 +80,25 @@ namespace std
+ #else
+   typedef int*			__c_locale;
+ #endif
+-
+-  // Convert numeric value of type _Tv to string and return length of
+-  // string.  If snprintf is available use it, otherwise fall back to
+-  // the unsafe sprintf which, in general, can be dangerous and should
++  // Convert numeric value of type double to string and return length of
++  // string.  If vsnprintf is available use it, otherwise fall back to
++  // the unsafe vsprintf which, in general, can be dangerous and should
+   // be avoided.
+-  template<typename _Tv>
+-    int
+-    __convert_from_v(char* __out,
+-		     const int __size __attribute__ ((__unused__)),
+-		     const char* __fmt,
+-#ifdef __UCLIBC_HAS_XCLOCALE__
+-		     _Tv __v, const __c_locale& __cloc, int __prec)
++    inline int
++    __convert_from_v(const __c_locale&
++#ifndef __UCLIBC_HAS_XCLOCALE__
++	__cloc __attribute__ ((__unused__))
++#endif
++		     ,
++		     char* __out,
++		     const int __size,
++		     const char* __fmt, ...)
+     {
++      va_list __args;
++#ifdef __UCLIBC_HAS_XCLOCALE__
++
+       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+ #else
+-		     _Tv __v, const __c_locale&, int __prec)
+-    {
+ # ifdef __UCLIBC_HAS_LOCALE__
+       char* __old = std::setlocale(LC_ALL, NULL);
+       char* __sav = new char[std::strlen(__old) + 1];
+@@ -103,7 +107,9 @@ namespace std
+ # endif
+ #endif
+ 
+-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++      va_start(__args, __fmt);
++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
++      va_end(__args);
+ 
+ #ifdef __UCLIBC_HAS_XCLOCALE__
+       __gnu_cxx::__uselocale(__old);
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7b12861..13e011d 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -33,16 +33,20 @@
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+ 
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+   // NB: The other ctype<char> specializations are in src/locale.cc and
+   // various /config/os/* files.
+-  template<>
+     ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
+     : ctype<char>(0, false, __refs)
+     {
+@@ -57,6 +61,8 @@ namespace std
+ #endif
+ 	}
+     }
++    ctype_byname<char>::~ctype_byname()
++    { }
+ 
+ #ifdef _GLIBCXX_USE_WCHAR_T
+   ctype<wchar_t>::__wmask_type
+@@ -138,17 +144,33 @@ namespace std
+   ctype<wchar_t>::
+   do_is(mask __m, wchar_t __c) const
+   {
+-    // Highest bitmask in ctype_base == 10, but extra in "C"
+-    // library for blank.
++    // The case of __m == ctype_base::space is particularly important,
++    // due to its use in many istream functions.  Therefore we deal with
++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
++    // is the mask corresponding to ctype_base::space.  NB: an encoding
++    // change would not affect correctness!
++
+     bool __ret = false;
+-    const size_t __bitmasksize = 11;
+-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+-      if (__m & _M_bit[__bitcur]
+-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
+-	{
+-	  __ret = true;
+-	  break;
+-	}
++    if (__m == _M_bit[5])
++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
++    else
++      {
++	// Highest bitmask in ctype_base == 10, but extra in "C"
++	// library for blank.
++	const size_t __bitmasksize = 11;
++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++	  if (__m & _M_bit[__bitcur])
++	    {
++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++		{
++		  __ret = true;
++		  break;
++		}
++	      else if (__m == _M_bit[__bitcur])
++		break;
++	    }
++      }
++
+     return __ret;
+   }
+ 
+@@ -290,4 +312,5 @@ namespace std
+ #endif
+   }
+ #endif //  _GLIBCXX_USE_WCHAR_T
+-}
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index d89da33..067657a 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -53,12 +53,16 @@
+   template<typename _CharT>
+      messages<_CharT>::messages(__c_locale __cloc, const char* __s,
+ 				size_t __refs)
+-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
+-     _M_name_messages(__s)
++     : facet(__refs), _M_c_locale_messages(NULL),
++     _M_name_messages(NULL)
+      {
+-       char* __tmp = new char[std::strlen(__s) + 1];
+-       std::strcpy(__tmp, __s);
++       const size_t __len = std::strlen(__s) + 1;
++       char* __tmp = new char[__len];
++       std::memcpy(__tmp, __s, __len);
+        _M_name_messages = __tmp;
++
++       // Last to avoid leaking memory if new throws.
++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
+      }
+ 
+   template<typename _CharT>
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 31ebb9f..7679b9c 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -33,9 +33,14 @@
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -206,7 +211,7 @@ namespace std
+ 	  }
+ 	break;
+       default:
+-	;
++	__ret = pattern();
+       }
+     return __ret;
+   }
+@@ -390,7 +395,9 @@ namespace std
+ 	  __c_locale __old = __uselocale(__cloc);
+ #else
+ 	  // Switch to named locale so that mbsrtowcs will work.
+-	  char* __old = strdup(setlocale(LC_ALL, NULL));
++  	  char* __old = setlocale(LC_ALL, NULL);
++          const size_t __llen = strlen(__old) + 1;
++          char* __sav = new char[__llen];
+ 	  setlocale(LC_ALL, __name);
+ #endif
+ 
+@@ -477,8 +484,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	      __uselocale(__old);
+ #else
+-	      setlocale(LC_ALL, __old);
+-	      free(__old);
++	      setlocale(LC_ALL, __sav);
++	      delete [] __sav;
+ #endif
+ 	      __throw_exception_again;
+ 	    }
+@@ -498,8 +505,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	  __uselocale(__old);
+ #else
+-	  setlocale(LC_ALL, __old);
+-	  free(__old);
++	  setlocale(LC_ALL, __sav);
++	  delete [] __sav;
+ #endif
+ 	}
+     }
+@@ -545,8 +552,11 @@ namespace std
+ 	  __c_locale __old = __uselocale(__cloc);
+ #else
+ 	  // Switch to named locale so that mbsrtowcs will work.
+-	  char* __old = strdup(setlocale(LC_ALL, NULL));
+-	  setlocale(LC_ALL, __name);
++          char* __old = setlocale(LC_ALL, NULL);
++          const size_t __llen = strlen(__old) + 1;
++          char* __sav = new char[__llen];
++          memcpy(__sav, __old, __llen);
++          setlocale(LC_ALL, __name);
+ #endif
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -633,8 +643,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	      __uselocale(__old);
+ #else
+-	      setlocale(LC_ALL, __old);
+-	      free(__old);
++	      setlocale(LC_ALL, __sav);
++	      delete [] __sav;
+ #endif
+               __throw_exception_again;
+ 	    }
+@@ -653,8 +663,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	  __uselocale(__old);
+ #else
+-	  setlocale(LC_ALL, __old);
+-	  free(__old);
++	  setlocale(LC_ALL, __sav);
++	  delete [] __sav;
+ #endif
+ 	}
+     }
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index d5c8961..8ae8969 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -33,9 +33,14 @@
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index d848ed5..f24d53e 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -53,11 +53,14 @@ namespace std
+       const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
+ 					_M_c_locale_timepunct);
+ #else
+-      char* __old = strdup(setlocale(LC_ALL, NULL));
++      char* __old = setlocale(LC_ALL, NULL);
++      const size_t __llen = strlen(__old) + 1;
++      char* __sav = new char[__llen];
++      memcpy(__sav, __old, __llen);
+       setlocale(LC_ALL, _M_name_timepunct);
+       const size_t __len = strftime(__s, __maxlen, __format, __tm);
+-      setlocale(LC_ALL, __old);
+-      free(__old);
++      setlocale(LC_ALL, __sav);
++      delete [] __sav;
+ #endif
+       // Make sure __s is null terminated.
+       if (__len == 0)
+@@ -207,11 +210,14 @@ namespace std
+       const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
+ 					_M_c_locale_timepunct);
+ #else
+-      char* __old = strdup(setlocale(LC_ALL, NULL));
++      char* __old = setlocale(LC_ALL, NULL);
++      const size_t __llen = strlen(__old) + 1;
++      char* __sav = new char[__llen];
++      memcpy(__sav, __old, __llen);
+       setlocale(LC_ALL, _M_name_timepunct);
+       const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
+-      setlocale(LC_ALL, __old);
+-      free(__old);
++      setlocale(LC_ALL, __sav);
++      delete [] __sav;
+ #endif
+       // Make sure __s is null terminated.
+       if (__len == 0)
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index ba8e858..1665dde 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -50,12 +50,21 @@
+     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+ 				     size_t __refs)
+     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+-    _M_name_timepunct(__s)
++    _M_name_timepunct(NULL)
+     {
+-      char* __tmp = new char[std::strlen(__s) + 1];
+-      std::strcpy(__tmp, __s);
++      const size_t __len = std::strlen(__s) + 1;
++      char* __tmp = new char[__len];
++      std::memcpy(__tmp, __s, __len);
+       _M_name_timepunct = __tmp;
+-      _M_initialize_timepunct(__cloc);
++
++      try
++	{ _M_initialize_timepunct(__cloc); }
++      catch(...)
++	{
++	  delete [] _M_name_timepunct;
++	  __throw_exception_again;
++	}
++
+     }
+ 
+   template<typename _CharT>
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch b/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch
new file mode 100644
index 0000000..2823809
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0008-missing-execinfo_h.patch
@@ -0,0 +1,28 @@
+From 9f2158451981cf0a80cfabdc79ae31bb6976a801 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:48:10 +0400
+Subject: [PATCH 08/35] missing-execinfo_h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ boehm-gc/include/gc.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h
+index c51e017..a7ba8dc 100644
+--- a/boehm-gc/include/gc.h
++++ b/boehm-gc/include/gc.h
+@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+-     && !defined(__ia64__)
++     && !defined(__ia64__) && !defined(__UCLIBC__)
+ #   ifndef GC_HAVE_BUILTIN_BACKTRACE
+ #     define GC_HAVE_BUILTIN_BACKTRACE
+ #   endif
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch b/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch
new file mode 100644
index 0000000..7168778
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0009-c99-snprintf.patch
@@ -0,0 +1,28 @@
+From e393e076f1ab82d25e1aa04d6edea27b41d3eb06 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:49:03 +0400
+Subject: [PATCH 09/35] c99-snprintf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/include/c_std/cstdio |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/include/c_std/cstdio b/libstdc++-v3/include/c_std/cstdio
+index e85bd83..6af839a 100644
+--- a/libstdc++-v3/include/c_std/cstdio
++++ b/libstdc++-v3/include/c_std/cstdio
+@@ -139,7 +139,7 @@ namespace std
+   using ::vsprintf;
+ } // namespace std
+ 
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
+ 
+ #undef snprintf
+ #undef vfscanf
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch b/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch
new file mode 100644
index 0000000..b628571
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0010-c99-complex-ugly-hack.patch
@@ -0,0 +1,29 @@
+From 73f69d806e2c9561a54995223431a1076cfd6164 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:49:57 +0400
+Subject: [PATCH 10/35] c99-complex-ugly-hack
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libstdc++-v3/configure |    3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index c57a751..a1333e2 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -18734,6 +18734,9 @@ $as_echo_n "checking for ISO C99 support to TR1 in <complex.h>... " >&6; }
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #include <complex.h>
++#ifdef __UCLIBC__
++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
++#endif
+ int
+ main ()
+ {
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch b/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch
new file mode 100644
index 0000000..8ee79b0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0011-index_macro.patch
@@ -0,0 +1,44 @@
+From b037953e40312b45ab84ed0a3ad882bb5e413101 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:51:02 +0400
+Subject: [PATCH 11/35] index_macro
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/include/ext/rope       |    3 +++
+ libstdc++-v3/include/ext/ropeimpl.h |    3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
+index 38eb1e8..158d21a 100644
+--- a/libstdc++-v3/include/ext/rope
++++ b/libstdc++-v3/include/ext/rope
+@@ -55,6 +55,9 @@
+ #include <bits/gthr.h>
+ #include <tr1/functional>
+ 
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ # ifdef __GC
+ #   define __GC_CONST const
+ # else
+diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
+index d7b5cbd..b9b3acb 100644
+--- a/libstdc++-v3/include/ext/ropeimpl.h
++++ b/libstdc++-v3/include/ext/ropeimpl.h
+@@ -48,6 +48,9 @@
+ #include <ext/memory> // For uninitialized_copy_n
+ #include <ext/numeric> // For power
+ 
++/* cope w/ index defined as macro, SuSv3 proposal */
++#undef index
++
+ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch b/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch
new file mode 100644
index 0000000..4a3efde
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0013-libstdc-namespace.patch
@@ -0,0 +1,54 @@
+From 104e4d66208f2726b14d2f5eebce90700cbc83c8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:54:02 +0400
+Subject: [PATCH 13/35] libstdc++-namespace
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/messages_members.h |    4 +++-
+ libstdc++-v3/config/locale/uclibc/time_members.h     |    4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 067657a..dd76a6c 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -32,7 +32,8 @@
+ //
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+-
++namespace std
++{
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+@@ -116,3 +117,4 @@
+ 	   this->_S_create_c_locale(this->_M_c_locale_messages, __s);
+ 	 }
+      }
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index 1665dde..905c433 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -33,7 +33,8 @@
+ //
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+-
++namespace std
++{
+   template<typename _CharT>
+     __timepunct<_CharT>::__timepunct(size_t __refs)
+     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+@@ -75,3 +76,4 @@
+       delete _M_data;
+       _S_destroy_c_locale(_M_c_locale_timepunct);
+     }
++}
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch b/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch
new file mode 100644
index 0000000..cb8fd52
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0014-sh-pr24836.patch
@@ -0,0 +1,45 @@
+From edc9acb181810f234b6b9f7d2820b0e4f6a1eeaf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:54:48 +0400
+Subject: [PATCH 14/35] sh-pr24836
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+http://sourceforge.net/mailarchive/forum.php?thread_id=8959304&forum_id=5348
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24836
+---
+ gcc/configure    |    2 +-
+ gcc/configure.ac |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index e12a180..135bbf5 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -23378,7 +23378,7 @@ foo:	.long	25
+ 	tls_first_minor=14
+ 	tls_as_opt="-m64 -Aesame --fatal-warnings"
+ 	;;
+-  sh-*-* | sh[34]-*-*)
++  sh-*-* | sh[34]*-*-*)
+     conftest_s='
+ 	.section ".tdata","awT",@progbits
+ foo:	.long	25
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index eba3577..6363a21 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -3141,7 +3141,7 @@ foo:	.long	25
+ 	tls_first_minor=14
+ 	tls_as_opt="-m64 -Aesame --fatal-warnings"
+ 	;;
+-  sh-*-* | sh[34]-*-*)
++  sh-*-* | sh[34]*-*-*)
+     conftest_s='
+ 	.section ".tdata","awT",@progbits
+ foo:	.long	25
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch b/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch
new file mode 100644
index 0000000..37c46fc
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0015-arm-Use-TARGET_ENDIAN_OPTION-for-determining-MULTILI.patch
@@ -0,0 +1,47 @@
+From 50e5366005b0f6af27378e2a5c3cb9f9936a7e62 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:58:36 +0400
+Subject: [PATCH 15/35] arm: Use TARGET_ENDIAN_OPTION for determining
+ MULTILIB_DEFAULTS
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/arm/linux-elf.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: gcc-4.9.2/gcc/config/arm/coff.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/arm/coff.h
++++ gcc-4.9.2/gcc/config/arm/coff.h
+@@ -32,8 +32,11 @@
+ #define TARGET_DEFAULT (MASK_APCS_FRAME)
+ 
+ #ifndef MULTILIB_DEFAULTS
++#ifndef TARGET_ENDIAN_OPTION
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#endif
+ #define MULTILIB_DEFAULTS \
+-  { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork" }
++  { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=soft", "mno-thumb-interwork" }
+ #endif
+ 
+ /* This is COFF, but prefer stabs.  */
+Index: gcc-4.9.2/gcc/config/arm/elf.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/arm/elf.h
++++ gcc-4.9.2/gcc/config/arm/elf.h
+@@ -116,8 +116,11 @@
+ #endif
+ 
+ #ifndef MULTILIB_DEFAULTS
++#ifndef TARGET_ENDIAN_OPTION
++#define TARGET_ENDIAN_OPTION "mlittle-endian"
++#endif
+ #define MULTILIB_DEFAULTS \
+-  { "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" }
++  { "marm", TARGET_ENDIAN_OPTION, "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" }
+ #endif
+ 
+ #define TARGET_ASM_FILE_START_APP_OFF true
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch b/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch
new file mode 100644
index 0000000..475ef96
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0016-gcc-poison-system-directories.patch
@@ -0,0 +1,190 @@
+From 160397ef3c3331099af028f1b8d3e085b07d88ad Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:59:00 +0400
+Subject: [PATCH 16/35] gcc: poison-system-directories
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+---
+ gcc/Makefile.in     |    2 +-
+ gcc/common.opt      |    4 ++++
+ gcc/config.in       |    6 ++++++
+ gcc/configure       |   20 ++++++++++++++++++--
+ gcc/configure.ac    |   10 ++++++++++
+ gcc/doc/invoke.texi |    9 +++++++++
+ gcc/gcc.c           |    2 ++
+ gcc/incpath.c       |   19 +++++++++++++++++++
+ 8 files changed, 69 insertions(+), 3 deletions(-)
+
+Index: gcc-4.9-20140316/gcc/common.opt
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/common.opt
++++ gcc-4.9-20140316/gcc/common.opt
+@@ -603,6 +603,10 @@ Wpedantic
+ Common Var(pedantic) Warning
+ Issue warnings needed for strict compliance to the standard
+ 
++Wpoison-system-directories
++Common Var(flag_poison_system_directories) Init(1) Warning
++Warn for -I and -L options using system directories if cross compiling
++
+ Wshadow
+ Common Var(warn_shadow) Warning
+ Warn when one local variable shadows another
+Index: gcc-4.9-20140316/gcc/config.in
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config.in
++++ gcc-4.9-20140316/gcc/config.in
+@@ -138,6 +138,12 @@
+ #endif
+ 
+ 
++/* Define to warn for use of native system header directories */
++#ifndef USED_FOR_TARGET
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++#endif
++
++
+ /* Define if you want all operations on RTL (the basic data structure of the
+    optimizer and back end) to be checked for dynamic type safety at runtime.
+    This is quite expensive. */
+Index: gcc-4.9-20140316/gcc/configure
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/configure
++++ gcc-4.9-20140316/gcc/configure
+@@ -928,6 +928,7 @@ with_system_zlib
+ enable_maintainer_mode
+ enable_link_mutex
+ enable_version_specific_runtime_libs
++enable_poison_system_directories
+ enable_plugin
+ enable_host_shared
+ enable_libquadmath_support
+@@ -1648,6 +1649,8 @@ Optional Features:
+   --enable-version-specific-runtime-libs
+                           specify that runtime libraries should be installed
+                           in a compiler-specific directory
++  --enable-poison-system-directories
++                          warn for use of native system header directories
+   --enable-plugin         enable plugin support
+   --enable-host-shared    build host code as shared libraries
+   --disable-libquadmath-support
+@@ -27702,6 +27705,19 @@ if test "${enable_version_specific_runti
+ fi
+ 
+ 
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++  enableval=$enable_poison_system_directories;
++else
++  enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
++
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
++
+ # Substitute configuration variables
+ 
+ 
+Index: gcc-4.9-20140316/gcc/configure.ac
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/configure.ac
++++ gcc-4.9-20140316/gcc/configure.ac
+@@ -5366,6 +5366,16 @@ AC_ARG_ENABLE(version-specific-runtime-l
+                 [specify that runtime libraries should be
+                  installed in a compiler-specific directory])])
+ 
++AC_ARG_ENABLE([poison-system-directories],
++             AS_HELP_STRING([--enable-poison-system-directories],
++                            [warn for use of native system header directories]),,
++             [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++  AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++           [1],
++           [Define to warn for use of native system header directories])
++fi
++
+ # Substitute configuration variables
+ AC_SUBST(subdirs)
+ AC_SUBST(srcdir)
+Index: gcc-4.9-20140316/gcc/doc/invoke.texi
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi
++++ gcc-4.9-20140316/gcc/doc/invoke.texi
+@@ -260,6 +260,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
+ -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
+ -Wpointer-arith  -Wno-pointer-to-int-cast @gol
++-Wno-poison-system-directories @gol
+ -Wredundant-decls  -Wno-return-local-addr @gol
+ -Wreturn-type  -Wsequence-point  -Wshadow @gol
+ -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
+@@ -4230,6 +4231,14 @@ headers---for that, @option{-Wunknown-pr
+  for most targets, it is made up of code and thus requires the stack
+  to be made executable in order for the program to work properly.
+ 
++@item -Wno-poison-system-directories
++@opindex Wno-poison-system-directories
++Do not warn for @option{-I} or @option{-L} options using system
++directories such as @file{/usr/include} when cross compiling.  This
++option is intended for use in chroot environments when such
++directories contain the correct headers and libraries for the target
++system rather than the host.
++
+ @item -Wfloat-equal
+ @opindex Wfloat-equal
+ @opindex Wno-float-equal
+Index: gcc-4.9-20140316/gcc/gcc.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/gcc.c
++++ gcc-4.9-20140316/gcc/gcc.c
+@@ -764,6 +764,8 @@ proper position among the other output f
+    "%{fuse-ld=*:-fuse-ld=%*}\
+     %X %{o*} %{e*} %{N} %{n} %{r}\
+     %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
++    %{Wno-poison-system-directories:--no-poison-system-directories}\
++    %{Werror=poison-system-directories:--error-poison-system-directories}\
+     %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
+     %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
+     %{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
+Index: gcc-4.9-20140316/gcc/incpath.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/incpath.c
++++ gcc-4.9-20140316/gcc/incpath.c
+@@ -28,6 +28,7 @@
+ #include "intl.h"
+ #include "incpath.h"
+ #include "cppdefault.h"
++#include "diagnostic-core.h"
+ 
+ /* Microsoft Windows does not natively support inodes.
+    VMS has non-numeric inodes.  */
+@@ -382,6 +383,24 @@ merge_include_chains (const char *sysroo
+ 	}
+       fprintf (stderr, _("End of search list.\n"));
+     }
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++  if (flag_poison_system_directories)
++    {
++       struct cpp_dir *p;
++
++       for (p = heads[QUOTE]; p; p = p->next)
++         {
++          if ((!strncmp (p->name, "/usr/include", 12))
++              || (!strncmp (p->name, "/usr/local/include", 18))
++              || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++            warning (OPT_Wpoison_system_directories,
++                     "include location \"%s\" is unsafe for "
++                     "cross-compilation",
++                     p->name);
++         }
++    }
++#endif
+ }
+ 
+ /* Use given -I paths for #include "..." but not #include <...>, and
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch b/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch
new file mode 100644
index 0000000..9e81efd
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0017-gcc-poison-dir-extend.patch
@@ -0,0 +1,39 @@
+From e99c9c97266d6d3e8cac798aa91408250c4d60cf Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:00:34 +0400
+Subject: [PATCH 17/35] gcc-poison-dir-extend
+
+Add /sw/include and /opt/include based on the original
+zecke-no-host-includes.patch patch.  The original patch checked for
+/usr/include, /sw/include and /opt/include and then triggered a failure and
+aborted.
+
+Instead, we add the two missing items to the current scan.  If the user
+wants this to be a failure, they can add "-Werror=poison-system-directories".
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/incpath.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index cd41c78..eac4a92 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -393,7 +393,9 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
+          {
+           if ((!strncmp (p->name, "/usr/include", 12))
+               || (!strncmp (p->name, "/usr/local/include", 18))
+-              || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++              || (!strncmp (p->name, "/usr/X11R6/include", 18))
++              || (!strncmp (p->name, "/sw/include", 11))
++              || (!strncmp (p->name, "/opt/include", 12)))
+             warning (OPT_Wpoison_system_directories,
+                      "include location \"%s\" is unsafe for "
+                      "cross-compilation",
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000..a28cafd
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0018-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
@@ -0,0 +1,73 @@
+From 56207fa2923e8edf774e98ffac82666091076be3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:08:31 +0400
+Subject: [PATCH 18/35] gcc-4.3.3: SYSROOT_CFLAGS_FOR_TARGET
+
+Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it.
+
+This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET.
+
+Other changes I had to do include:
+
+- moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though.
+
+- passing the right CFLAGS to configure scripts as exported environment variables
+
+I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do.
+
+Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3?
+
+Signed-off-by: Paolo Bonzini  <bonzini@gnu.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ configure |   32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+diff --git a/configure b/configure
+index 1b76c90..e4dce7c 100755
+--- a/configure
++++ b/configure
+@@ -6772,6 +6772,38 @@ fi
+ 
+ 
+ 
++# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
++# might be empty or "-g".  We don't require a C++ compiler, so CXXFLAGS
++# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
++# We want to ensure that TARGET libraries (which we know are built with
++# gcc) are built with "-O2 -g", so include those options when setting
++# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
++if test "x$CFLAGS_FOR_TARGET" = x; then
++  CFLAGS_FOR_TARGET=$CFLAGS
++  case " $CFLAGS " in
++    *" -O2 "*) ;;
++    *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
++  esac
++  case " $CFLAGS " in
++    *" -g "* | *" -g3 "*) ;;
++    *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
++  esac
++fi
++
++
++if test "x$CXXFLAGS_FOR_TARGET" = x; then
++  CXXFLAGS_FOR_TARGET=$CXXFLAGS
++  case " $CXXFLAGS " in
++    *" -O2 "*) ;;
++    *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;;
++  esac
++  case " $CXXFLAGS " in
++    *" -g "* | *" -g3 "*) ;;
++    *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
++  esac
++fi
++
++
+ # Handle --with-headers=XXX.  If the value is not "yes", the contents of
+ # the named directory are copied to $(tooldir)/sys-include.
+ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch b/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch
new file mode 100644
index 0000000..058be0c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0019-64-bit-multilib-hack.patch
@@ -0,0 +1,82 @@
+From 18fde5740b09324dfb9cf41e9849672573ff5fa0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:10:06 +0400
+Subject: [PATCH 19/35] 64-bit multilib hack.
+
+GCC has internal multilib handling code but it assumes a very specific rigid directory
+layout. The build system implementation of multilib layout is very generic and allows
+complete customisation of the library directories.
+
+This patch is a partial solution to allow any custom directories to be passed into gcc
+and handled correctly. It forces gcc to use the base_libdir (which is the current
+directory, "."). We need to do this for each multilib that is configured as we don't
+know which compiler options may be being passed into the compiler. Since we have a compiler
+per mulitlib at this point that isn't an issue.
+
+The one problem is the target compiler is only going to work for the default multlilib at
+this point. Ideally we'd figure out which multilibs were being enabled with which paths
+and be able to patch these entries with a complete set of correct paths but this we
+don't have such code at this point. This is something the target gcc recipe should do
+and override these platform defaults in its build config.
+
+RP 15/8/11
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/i386/t-linux64   |    6 ++----
+ gcc/config/mips/t-linux64   |   10 +++-------
+ gcc/config/rs6000/t-linux64 |    5 ++---
+ 3 files changed, 7 insertions(+), 14 deletions(-)
+
+Index: gcc-4.9-20140316/gcc/config/i386/t-linux64
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/i386/t-linux64
++++ gcc-4.9-20140316/gcc/config/i386/t-linux64
+@@ -32,7 +32,5 @@
+ #
+ comma=,
+ MULTILIB_OPTIONS    = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
+-MULTILIB_DIRNAMES   = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
+-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
++MULTILIB_DIRNAMES = . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+Index: gcc-4.9-20140316/gcc/config/mips/t-linux64
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/mips/t-linux64
++++ gcc-4.9-20140316/gcc/config/mips/t-linux64
+@@ -17,10 +17,6 @@
+ # <http://www.gnu.org/licenses/>.
+ 
+ MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
+-MULTILIB_DIRNAMES = n32 32 64
+-MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
+-MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
+-MULTILIB_OSDIRNAMES = \
+-	../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+-	../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+-	../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
++MULTILIB_DIRNAMES = . . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
++
+Index: gcc-4.9-20140316/gcc/config/rs6000/t-linux64
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/rs6000/t-linux64
++++ gcc-4.9-20140316/gcc/config/rs6000/t-linux64
+@@ -26,10 +26,9 @@
+ # MULTILIB_OSDIRNAMES according to what is found on the target.
+ 
+ MULTILIB_OPTIONS    := m64/m32
+-MULTILIB_DIRNAMES   := 64 32
++MULTILIB_DIRNAMES   := . .
+ MULTILIB_EXTRA_OPTS := 
+-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
++MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+ 
+ rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
+ 	$(COMPILE) $<
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch b/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch
new file mode 100644
index 0000000..5b46614
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0020-optional-libstdc.patch
@@ -0,0 +1,98 @@
+From 307c8ff3ef666b7bd5ac733863f2fbb27a9d521e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:12:56 +0400
+Subject: [PATCH 20/35] optional libstdc
+
+gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++
+will not run correctly since by default the linker will try to link against libstdc++
+which shouldn't exist yet. We need an option to disable -lstdc++
+option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc
+driver. This patch adds such an option which only disables the -lstdc++.
+
+A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to
+do this officially, the likely answer is don't build libstdc++ separately.
+
+RP 29/6/10
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ gcc/c-family/c.opt  |    4 ++++
+ gcc/cp/g++spec.c    |    1 +
+ gcc/doc/invoke.texi |    9 +++++++--
+ gcc/gcc.c           |    1 +
+ 4 files changed, 13 insertions(+), 2 deletions(-)
+
+Index: gcc-4.9-20140316/gcc/c-family/c.opt
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/c-family/c.opt
++++ gcc-4.9-20140316/gcc/c-family/c.opt
+@@ -1323,6 +1323,10 @@ nostdinc++
+ C++ ObjC++
+ Do not search standard system include directories for C++
+ 
++nostdlib++
++Driver
++Do not link standard C++ runtime library
++
+ o
+ C ObjC C++ ObjC++ Joined Separate
+ ; Documented in common.opt
+Index: gcc-4.9-20140316/gcc/cp/g++spec.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/cp/g++spec.c
++++ gcc-4.9-20140316/gcc/cp/g++spec.c
+@@ -138,6 +138,7 @@ lang_specific_driver (struct cl_decoded_
+       switch (decoded_options[i].opt_index)
+ 	{
+ 	case OPT_nostdlib:
++	case OPT_nostdlib__:
+ 	case OPT_nodefaultlibs:
+ 	  library = -1;
+ 	  break;
+Index: gcc-4.9-20140316/gcc/doc/invoke.texi
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/doc/invoke.texi
++++ gcc-4.9-20140316/gcc/doc/invoke.texi
+@@ -193,6 +193,7 @@ in the following sections.
+ -fvisibility-inlines-hidden @gol
+ -fvtable-verify=@var{std|preinit|none} @gol
+ -fvtv-counts -fvtv-debug @gol
++-nostdlib++ @gol
+ -fvisibility-ms-compat @gol
+ -fext-numeric-literals @gol
+ -Wabi  -Wconversion-null  -Wctor-dtor-privacy @gol
+@@ -457,7 +458,7 @@ Objective-C and Objective-C++ Dialects}.
+ -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
+ -s  -static -static-libgcc -static-libstdc++ @gol
+ -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
+--shared -shared-libgcc  -symbolic @gol
++-shared -shared-libgcc  -symbolic -nostdlib++ @gol
+ -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
+ -u @var{symbol}}
+ 
+@@ -10285,6 +10286,11 @@ These entries are usually resolved by en
+ libc.  These entry points should be supplied through some other
+ mechanism when this option is specified.
+ 
++@item -nostdlib++
++@opindex nostdlib++
++Do not use the standard system C++ runtime libraries when linking.
++Only the libraries you specify will be passed to the linker.
++
+ @cindex @option{-lgcc}, use with @option{-nostdlib}
+ @cindex @option{-nostdlib} and unresolved references
+ @cindex unresolved references and @option{-nostdlib}
+Index: gcc-4.9-20140316/gcc/gcc.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/gcc.c
++++ gcc-4.9-20140316/gcc/gcc.c
+@@ -772,6 +772,7 @@ proper position among the other output f
+     %(mflib) " STACK_SPLIT_SPEC "\
+     %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
+     %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
++    %{!nostdlib++:}\
+     %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
+ #endif
+ 
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
new file mode 100644
index 0000000..eb3c61f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0021-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
@@ -0,0 +1,59 @@
+From 004696e054ae9dc71d512cc755ccc4074fc62b2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:14:20 +0400
+Subject: [PATCH 21/35] gcc: disable MASK_RELAX_PIC_CALLS bit
+
+The new feature added after 4.3.3
+"http://www.pubbs.net/200909/gcc/94048-patch-add-support-for-rmipsjalr.html"
+will cause cc1plus eat up all the system memory when build webkit-gtk.
+The function mips_get_pic_call_symbol keeps on recursively calling itself.
+Disable this feature to walk aside the bug.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure    |    7 -------
+ gcc/configure.ac |    7 -------
+ 2 files changed, 14 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index b65d21d..bdab45a 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -25829,13 +25829,6 @@ $as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6;
+         rm -f conftest.*
+       fi
+     fi
+-    if test $gcc_cv_as_ld_jalr_reloc = yes; then
+-      if test x$target_cpu_default = x; then
+-        target_cpu_default=MASK_RELAX_PIC_CALLS
+-      else
+-        target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+-      fi
+-    fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5
+ $as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; }
+ 
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index e226b85..5f5c909 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4099,13 +4099,6 @@ x:
+         rm -f conftest.*
+       fi
+     fi
+-    if test $gcc_cv_as_ld_jalr_reloc = yes; then
+-      if test x$target_cpu_default = x; then
+-        target_cpu_default=MASK_RELAX_PIC_CALLS
+-      else
+-        target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+-      fi
+-    fi
+     AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc)
+ 
+     AC_CACHE_CHECK([linker for .eh_frame personality relaxation],
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch b/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch
new file mode 100644
index 0000000..40c8abf
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0022-COLLECT_GCC_OPTIONS.patch
@@ -0,0 +1,38 @@
+From 7f5c9dcc71c8b83a0b5596266cc4bdf0936e8e00 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:16:28 +0400
+Subject: [PATCH 22/35] COLLECT_GCC_OPTIONS
+
+This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to
+invoke collect2.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/gcc.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 477752f..51062aa 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -4098,6 +4098,15 @@ set_collect_gcc_options (void)
+ 		sizeof ("COLLECT_GCC_OPTIONS=") - 1);
+ 
+   first_time = TRUE;
++#ifdef HAVE_LD_SYSROOT
++  if (target_system_root_changed && target_system_root)
++    {
++      obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
++      obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
++      obstack_grow (&collect_obstack, "'", 1);
++      first_time = FALSE;
++    }
++#endif
+   for (i = 0; (int) i < n_switches; i++)
+     {
+       const char *const *args;
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
new file mode 100644
index 0000000..fddfe9e
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0023-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -0,0 +1,96 @@
+From f7d49ca445e60faa1b5256c6b4f96c1ee5c0e353 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:17:25 +0400
+Subject: [PATCH 23/35] Use the defaults.h in ${B} instead of ${S}, and t-oe
+ in ${B}
+
+Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that
+the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+While compiling gcc-crosssdk-initial-x86_64 on some host, there is
+occasionally failure that test the existance of default.h doesn't
+work, the reason is tm_include_list='** defaults.h' rather than
+tm_include_list='** ./defaults.h'
+
+So we add the test condition for this situation.
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/Makefile.in  |    2 +-
+ gcc/configure    |    4 ++--
+ gcc/configure.ac |    4 ++--
+ gcc/mkconfig.sh  |    4 ++--
+ 4 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index d1ab22f..15fe4b6 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -483,7 +483,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
+ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
+ 
+ xmake_file=@xmake_file@
+-tmake_file=@tmake_file@
++tmake_file=@tmake_file@ ./t-oe
+ TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
+ TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
+ TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
+diff --git a/gcc/configure b/gcc/configure
+index 5399b2b..60a04bd 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11631,8 +11631,8 @@ for f in $tm_file; do
+        tm_include_list="${tm_include_list} $f"
+        ;;
+     defaults.h )
+-       tm_file_list="${tm_file_list} \$(srcdir)/$f"
+-       tm_include_list="${tm_include_list} $f"
++       tm_file_list="${tm_file_list} ./$f"
++       tm_include_list="${tm_include_list} ./$f"
+        ;;
+     * )
+        tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index f87c3b6..460e0d9 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1740,8 +1740,8 @@ for f in $tm_file; do
+        tm_include_list="${tm_include_list} $f"
+        ;;
+     defaults.h )
+-       tm_file_list="${tm_file_list} \$(srcdir)/$f"
+-       tm_include_list="${tm_include_list} $f"
++       tm_file_list="${tm_file_list} ./$f"
++       tm_include_list="${tm_include_list} ./$f"
+        ;;
+     * )
+        tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
+index c7146ed..b153f45 100644
+--- a/gcc/mkconfig.sh
++++ b/gcc/mkconfig.sh
+@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
+     if [ $# -ge 1 ]; then
+ 	echo '#ifdef IN_GCC' >> ${output}T
+ 	for file in "$@"; do
+-	    if test x"$file" = x"defaults.h"; then
++	    if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then
+ 		postpone_defaults_h="yes"
+ 	    else
+ 		echo "# include \"$file\"" >> ${output}T
+@@ -106,7 +106,7 @@ esac
+ 
+ # If we postponed including defaults.h, add the #include now.
+ if test x"$postpone_defaults_h" = x"yes"; then
+-    echo "# include \"defaults.h\"" >> ${output}T
++    echo "# include \"./defaults.h\"" >> ${output}T
+ fi
+ 
+ # Add multiple inclusion protection guard, part two.
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0024-PR-target-32219.patch b/meta/recipes-devtools/gcc/gcc-4.9/0024-PR-target-32219.patch
new file mode 100644
index 0000000..45acf7f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0024-PR-target-32219.patch
@@ -0,0 +1,62 @@
+From e0d15f4f8bf28c351b9215ca37f1caa24df0e1fd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:18:54 +0400
+Subject: [PATCH 24/35] PR target/32219
+
+* varasm.c (default_binds_local_p_1): Weak data is not local.
+
+Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Backport
+---
+ gcc/testsuite/gcc.dg/visibility-21.c |   14 ++++++++++++++
+ gcc/varasm.c                         |    9 ++++-----
+ 2 files changed, 18 insertions(+), 5 deletions(-)
+ create mode 100644 gcc/testsuite/gcc.dg/visibility-21.c
+
+Index: gcc-4.9-20140316/gcc/varasm.c
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/varasm.c
++++ gcc-4.9-20140316/gcc/varasm.c
+@@ -6771,6 +6771,10 @@ default_binds_local_p_1 (const_tree exp,
+   /* Static variables are always local.  */
+   else if (! TREE_PUBLIC (exp))
+     local_p = true;
++  /* hidden weak can't be overridden by something non-local, all
++     that is possible is that it is not defined at all. */
++  else if (DECL_WEAK (exp))
++    local_p = false;
+   /* A variable is local if the user has said explicitly that it will
+      be.  */
+   else if ((DECL_VISIBILITY_SPECIFIED (exp)
+@@ -6784,11 +6788,6 @@ default_binds_local_p_1 (const_tree exp,
+      local.  */
+   else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
+     local_p = true;
+-  /* Default visibility weak data can be overridden by a strong symbol
+-     in another module and so are not local.  */
+-  else if (DECL_WEAK (exp)
+-	   && !resolved_locally)
+-    local_p = false;
+   /* If PIC, then assume that any global name can be overridden by
+      symbols resolved from other modules.  */
+   else if (shlib)
+Index: gcc-4.9-20140316/gcc/testsuite/gcc.dg/visibility-22.c
+===================================================================
+--- /dev/null
++++ gcc-4.9-20140316/gcc/testsuite/gcc.dg/visibility-22.c
+@@ -0,0 +1,13 @@
++/* PR target/32219 */
++/* { dg-do run } */
++/* { dg-require-visibility "" } */
++/* { dg-options "-fPIC" { target fpic } } */
++
++extern void f() __attribute__((weak,visibility("hidden")));
++extern int puts( char const* );
++int main()
++{
++  if (f)
++    f();
++  return 0;
++}
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch b/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch
new file mode 100644
index 0000000..0e7914d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0025-fortran-cross-compile-hack.patch
@@ -0,0 +1,46 @@
+From af8a56ea4e17b2909eff2c57704ab43ef24f28d3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:01 +0400
+Subject: [PATCH 25/35] fortran cross-compile hack.
+
+* Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used
+used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross
+directory.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libgfortran/configure    |    2 +-
+ libgfortran/configure.ac |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgfortran/configure b/libgfortran/configure
+index 8385e96..b8f7a92 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -12704,7 +12704,7 @@ esac
+ 
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ ac_ext=${ac_fc_srcext-f}
+ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
+index 7d97fed..3f9f484 100644
+--- a/libgfortran/configure.ac
++++ b/libgfortran/configure.ac
+@@ -227,7 +227,7 @@ AC_SUBST(enable_static)
+ 
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ AC_PROG_FC(gfortran)
+ 
+ # extra LD Flags which are required for targets
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch b/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch
new file mode 100644
index 0000000..d4efab9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0026-libgcc-sjlj-check.patch
@@ -0,0 +1,74 @@
+From 08c2398445e6cac282488f64ae6bf29cbcd8db23 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:50 +0400
+Subject: [PATCH 26/35] libgcc-sjlj-check
+
+ac_fn_c_try_compile doesnt seem to keep the intermediate files
+which are needed for sjlj test to pass since it greps into the
+generated file. So we run the compiler command using AC_TRY_COMMAND
+which then generates the needed .s file
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libgcc/configure    |   10 ++++++----
+ libgcc/configure.ac |   10 ++++------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/libgcc/configure b/libgcc/configure
+index 1425df6..d18e3cb 100644
+--- a/libgcc/configure
++++ b/libgcc/configure
+@@ -4208,17 +4208,19 @@ void foo ()
+ }
+ 
+ _ACEOF
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-if ac_fn_c_try_compile; then :
++if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5'
++  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }; }; then
+   if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=yes
+   elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=no
+   fi
+ fi
+-CFLAGS=$CFLAGS_hold
+ rm -f conftest*
+ 
+ fi
+diff --git a/libgcc/configure.ac b/libgcc/configure.ac
+index 8b7aba5..c7c9644 100644
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -216,16 +216,14 @@ void foo ()
+   bar();
+ }
+ ])])
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-AS_IF([ac_fn_c_try_compile],
+-  [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
++if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
++  if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=yes
+   elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=no
+-  fi])
+-CFLAGS=$CFLAGS_hold
++  fi
++fi
+ rm -f conftest*
+ ])
+ 
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch
new file mode 100644
index 0000000..05e9521
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0027-cpp-honor-sysroot.patch
@@ -0,0 +1,54 @@
+From a0f9bd09c816ad29ecf7c29d6c27f7df97710364 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:22:00 +0400
+Subject: [PATCH 27/35] cpp: honor sysroot.
+
+Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile
+preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location
+rather than the --sysroot option specified on the commandline. If access to that directory is
+permission denied (unreadable), gcc will error.
+
+This happens when ccache is in use due to the fact it uses preprocessed source files.
+
+The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix,
+-isystem, -isysroot happen and the correct sysroot is used.
+
+[YOCTO #2074]
+
+RP 2012/04/13
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/cp/lang-specs.h |    2 +-
+ gcc/gcc.c           |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
+index a001c3e..1aae1e4 100644
+--- a/gcc/cp/lang-specs.h
++++ b/gcc/cp/lang-specs.h
+@@ -63,5 +63,5 @@ along with GCC; see the file COPYING3.  If not see
+   {".ii", "@c++-cpp-output", 0, 0, 0},
+   {"@c++-cpp-output",
+    "%{!M:%{!MM:%{!E:\
+-    cc1plus -fpreprocessed %i %(cc1_options) %2\
++    cc1plus -fpreprocessed %i %I %(cc1_options) %2\
+     %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 51062aa..cf6b99e 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1042,7 +1042,7 @@ static const struct compiler default_compilers[] =
+                     %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0},
+   {".i", "@cpp-output", 0, 0, 0},
+   {"@cpp-output",
+-   "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
++   "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+   {".s", "@assembler", 0, 0, 0},
+   {"@assembler",
+    "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch b/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch
new file mode 100644
index 0000000..2638720
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0028-MIPS64-Default-to-N64-ABI.patch
@@ -0,0 +1,31 @@
+From 301e18d4711db5925e767fad08dffa9cfe0a2f1f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:23:08 +0400
+Subject: [PATCH 28/35] MIPS64: Default to N64 ABI
+
+MIPS64 defaults to n32 ABI, this patch makes it
+so that it defaults to N64 ABI
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE config specific]
+---
+ gcc/config.gcc |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 1a0be50..989c2fb 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -1797,7 +1797,7 @@ mips*-mti-linux*)
+ mips64*-*-linux* | mipsisa64*-*-linux*)
+ 	tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} mips/gnu-user.h mips/gnu-user64.h mips/linux64.h mips/linux-common.h"
+ 	tmake_file="${tmake_file} mips/t-linux64"
+-	tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_N32"
++	tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_64"
+ 	case ${target} in
+ 		mips64el-st-linux-gnu)
+ 			tm_file="${tm_file} mips/st.h"
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
new file mode 100644
index 0000000..969d290
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0029-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -0,0 +1,228 @@
+From 29d12344fb682a053de53eb08b95704cf3b67af2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:24:50 +0400
+Subject: [PATCH 29/35] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+ relative to SYSTEMLIBS_DIR
+
+This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+relative to SYSTEMLIBS_DIR which can be set in generated headers
+This breaks the assumption of hardcoded multilib in gcc
+Change is only for the supported architectures in OE including
+SH, sparc, alpha for possible future support (if any)
+
+Removes the do_headerfix task in metadata
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE configuration]
+---
+ gcc/config/alpha/linux-elf.h |    4 ++--
+ gcc/config/arm/linux-eabi.h  |    4 ++--
+ gcc/config/arm/linux-elf.h   |    2 +-
+ gcc/config/i386/linux.h      |    2 +-
+ gcc/config/i386/linux64.h    |    6 +++---
+ gcc/config/mips/linux.h      |    2 +-
+ gcc/config/mips/linux64.h    |    8 ++++----
+ gcc/config/rs6000/linux64.h  |    8 ++++----
+ gcc/config/sh/linux.h        |    2 +-
+ gcc/config/sparc/linux.h     |    2 +-
+ gcc/config/sparc/linux64.h   |    4 ++--
+ 11 files changed, 22 insertions(+), 22 deletions(-)
+
+Index: gcc-4.9.0/gcc/config/alpha/linux-elf.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/alpha/linux-elf.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/alpha/linux-elf.h	2014-05-07 16:43:50.605106535 +0000
+@@ -23,8 +23,8 @@
+ #define EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+ 
+-#define GLIBC_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER	SYSTEMLIBS_DIR "ld-linux.so.2"
++#define UCLIBC_DYNAMIC_LINKER  SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+Index: gcc-4.9.0/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/arm/linux-eabi.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/arm/linux-eabi.h	2014-05-07 16:43:50.605106535 +0000
+@@ -68,8 +68,8 @@
+    GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI.  */
+ 
+ #undef  GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
+-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3"
++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3"
+ #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
+ 
+ #define GLIBC_DYNAMIC_LINKER \
+Index: gcc-4.9.0/gcc/config/arm/linux-elf.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/arm/linux-elf.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/arm/linux-elf.h	2014-05-07 16:43:50.605106535 +0000
+@@ -57,7 +57,7 @@
+ 
+ #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #define LINUX_TARGET_LINK_SPEC  "%{h*} \
+    %{static:-Bstatic} \
+Index: gcc-4.9.0/gcc/config/i386/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/i386/linux.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/i386/linux.h	2014-05-07 16:43:50.605106535 +0000
+@@ -20,4 +20,4 @@
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+Index: gcc-4.9.0/gcc/config/i386/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/i386/linux64.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/i386/linux64.h	2014-05-07 16:43:50.605106535 +0000
+@@ -27,6 +27,6 @@
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+-#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
+Index: gcc-4.9.0/gcc/config/mips/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/mips/linux.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/mips/linux.h	2014-05-07 16:43:50.605106535 +0000
+@@ -18,8 +18,8 @@
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #define GLIBC_DYNAMIC_LINKER \
+-  "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ 
+ #undef UCLIBC_DYNAMIC_LINKER
+ #define UCLIBC_DYNAMIC_LINKER \
+-  "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+Index: gcc-4.9.0/gcc/config/mips/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/mips/linux64.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/mips/linux64.h	2014-05-07 16:43:50.605106535 +0000
+@@ -23,20 +23,20 @@
+ #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
+ 
+ #define GLIBC_DYNAMIC_LINKER32 \
+-  "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKER64 \
+-  "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKERN32 \
+-  "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ 
+ #undef UCLIBC_DYNAMIC_LINKER32
+ #define UCLIBC_DYNAMIC_LINKER32 \
+-  "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+ #undef UCLIBC_DYNAMIC_LINKER64
+ #define UCLIBC_DYNAMIC_LINKER64 \
+-  "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld64-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld64-uClibc.so.0}"
+ #define UCLIBC_DYNAMIC_LINKERN32 \
+-  "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+ 
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+Index: gcc-4.9.0/gcc/config/rs6000/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/rs6000/linux64.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/rs6000/linux64.h	2014-05-07 16:43:50.605106535 +0000
+@@ -367,14 +367,14 @@
+ #undef	LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
+ #ifdef LINUX64_DEFAULT_ABI_ELFv2
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:" SYSTEMLIBS_DIR "ld64.so.1;:" SYSTEMLIBS_DIR "ld64.so.2}"
+ #else
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:" SYSTEMLIBS_DIR "ld64.so.2;:" SYSTEMLIBS_DIR "ld64.so.1}"
+ #endif
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+Index: gcc-4.9.0/gcc/config/sh/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/sh/linux.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/sh/linux.h	2014-05-07 16:43:50.605106535 +0000
+@@ -43,7 +43,7 @@
+ 
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+Index: gcc-4.9.0/gcc/config/sparc/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/sparc/linux.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/sparc/linux.h	2014-05-07 16:43:50.605106535 +0000
+@@ -83,7 +83,7 @@
+    When the -shared link option is used a final link is not being
+    done.  */
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #undef  LINK_SPEC
+ #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+Index: gcc-4.9.0/gcc/config/sparc/linux64.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/sparc/linux64.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/sparc/linux64.h	2014-05-07 16:43:50.605106535 +0000
+@@ -92,8 +92,8 @@
+    When the -shared link option is used a final link is not being
+    done.  */
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #ifdef SPARC_BI_ARCH
+ 
+Index: gcc-4.9.0/gcc/config/linux.h
+===================================================================
+--- gcc-4.9.0.orig/gcc/config/linux.h	2014-05-07 16:43:50.609106535 +0000
++++ gcc-4.9.0/gcc/config/linux.h	2014-05-07 16:43:50.605106535 +0000
+@@ -73,10 +73,10 @@
+    GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
+    GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
+    supporting both 32-bit and 64-bit compilation.  */
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ldx32-uClibc.so.0"
+ #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch b/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch
new file mode 100644
index 0000000..2ceaff6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0030-gcc-Fix-argument-list-too-long-error.patch
@@ -0,0 +1,40 @@
+From c1816c160156f99c34e6a0a0311bb0219326804e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:26:37 +0400
+Subject: [PATCH 30/35] gcc: Fix argument list too long error.
+
+There would be an "Argument list too long" error when the
+build directory is longer than 200, this is caused by:
+
+headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`
+
+The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
+it, use the $(sort list) of GNU make which can handle the too long list
+would fix the problem, the header would be short enough after sorted.
+The "tr ' ' '\012'" was used for translating the space to "\n", the
+$(sort list) doesn't need this.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/Makefile.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 2320497..8562a62 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -4627,7 +4627,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
+ # We keep the directory structure for files in config or c-family and .def
+ # files. All other files are flattened to a single directory.
+ 	$(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
+-	headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`; \
++	headers="$(sort $(PLUGIN_HEADERS))"; \
+ 	srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
+ 	for file in $$headers; do \
+ 	  if [ -f $$file ] ; then \
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch b/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch
new file mode 100644
index 0000000..2c1d5e0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0031-Disable-sdt.patch
@@ -0,0 +1,113 @@
+From b85265bc94ec1beaf1d3b697c03db62991553467 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:28:10 +0400
+Subject: [PATCH 31/35] Disable sdt.
+
+We don't list dtrace in DEPENDS so we shouldn't be depending on this header.
+It may or may not exist from preivous builds though. To be determinstic, disable
+sdt.h usage always. This avoids build failures if the header is removed after configure
+but before libgcc is compiled for example.
+
+RP 2012/8/7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Disable sdt for libstdc++-v3.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Inappropriate [hack]
+---
+ gcc/configure             | 12 ++++++------
+ gcc/configure.ac          | 18 +++++++++---------
+ libstdc++-v3/configure    |  6 +++---
+ libstdc++-v3/configure.ac |  2 +-
+ 4 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 3c550a6..01c7626 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -26812,12 +26812,12 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
+ $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
+ have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+-  have_sys_sdt_h=yes
+-
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+-
+-fi
++#if test -f $target_header_dir/sys/sdt.h; then
++#  have_sys_sdt_h=yes
++#
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#
++#fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
+ $as_echo "$have_sys_sdt_h" >&6; }
+ 
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 3601ab6..06e501f 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4779,15 +4779,15 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
+ fi
+ 
+ # Test for <sys/sdt.h> on the target.
+-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
+-AC_MSG_CHECKING(sys/sdt.h in the target C library)
+-have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+-  have_sys_sdt_h=yes
+-  AC_DEFINE(HAVE_SYS_SDT_H, 1,
+-            [Define if your target C library provides sys/sdt.h])
+-fi
+-AC_MSG_RESULT($have_sys_sdt_h)
++#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
++#AC_MSG_CHECKING(sys/sdt.h in the target C library)
++#have_sys_sdt_h=no
++#if test -f $target_header_dir/sys/sdt.h; then
++#  have_sys_sdt_h=yes
++#  AC_DEFINE(HAVE_SYS_SDT_H, 1,
++#            [Define if your target C library provides sys/sdt.h])
++#fi
++#AC_MSG_RESULT($have_sys_sdt_h)
+ 
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index 4953c9f..53a1145 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -20578,11 +20578,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ 
+-  if test $glibcxx_cv_sys_sdt_h = yes; then
++#  if test $glibcxx_cv_sys_sdt_h = yes; then
+ 
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+ 
+-  fi
++#  fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5
+ $as_echo "$glibcxx_cv_sys_sdt_h" >&6; }
+ 
+diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
+index 73d430a..f2135e2 100644
+--- a/libstdc++-v3/configure.ac
++++ b/libstdc++-v3/configure.ac
+@@ -211,7 +211,7 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
+ GLIBCXX_CHECK_SC_NPROC_ONLN
+ GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
+ GLIBCXX_CHECK_SYSCTL_HW_NCPU
+-GLIBCXX_CHECK_SDT_H
++#GLIBCXX_CHECK_SDT_H
+ 
+ # Check for available headers.
+ AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
+-- 
+1.8.3.1
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch b/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch
new file mode 100644
index 0000000..3b3d1b6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0032-libtool.patch
@@ -0,0 +1,42 @@
+From 6c715fcfa262adadca81c68a1f3f69aa3187a501 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:29:11 +0400
+Subject: [PATCH 32/35] libtool
+
+libstdc++ from gcc-runtime gets created with -rpath=/usr/lib/../lib for qemux86-64
+when running on am x86_64 build host.
+
+This patch stops this speading to libdir in the libstdc++.la file within libtool.
+Arguably, it shouldn't be passing this into libtool in the first place but
+for now this resolves the nastiest problems this causes.
+
+func_normal_abspath would resolve an empty path to `pwd` so we need
+to filter the zero case.
+
+RP 2012/8/24
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ ltmain.sh |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index a03433f..46f47c2 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -6359,6 +6359,10 @@ func_mode_link ()
+ 	func_warning "ignoring multiple \`-rpath's for a libtool library"
+ 
+       install_libdir="$1"
++      if test -n "$install_libdir"; then
++	func_normal_abspath "$install_libdir"
++	install_libdir=$func_normal_abspath_result
++      fi
+ 
+       oldlibs=
+       if test -z "$rpath"; then
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
new file mode 100644
index 0000000..b236c37
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0033-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
@@ -0,0 +1,40 @@
+From 97e4591c20310425e7aca0e6712a8d9480e7744c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:30:32 +0400
+Subject: [PATCH 33/35] gcc: armv4: pass fix-v4bx to linker to support EABI.
+
+The LINK_SPEC for linux gets overwritten by linux-eabi.h which
+means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result
+the option is not passed to linker when chosing march=armv4
+This patch redefines this in linux-eabi.h and reinserts it
+for eabi defaulting toolchains.
+
+We might want to send it upstream.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/arm/linux-eabi.h |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+Index: gcc-4.9-20140316/gcc/config/arm/linux-eabi.h
+===================================================================
+--- gcc-4.9-20140316.orig/gcc/config/arm/linux-eabi.h
++++ gcc-4.9-20140316/gcc/config/arm/linux-eabi.h
+@@ -77,10 +77,14 @@
+     %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+     %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+ 
++/* For armv4 we pass --fix-v4bx to linker to support EABI */
++#undef TARGET_FIX_V4BX_SPEC
++#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
+    use the GNU/Linux version, not the generic BPABI version.  */
+ #undef  LINK_SPEC
+-#define LINK_SPEC EABI_LINK_SPEC					\
++#define LINK_SPEC TARGET_FIX_V4BX_SPEC EABI_LINK_SPEC			\
+   LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC,				\
+ 		       LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+ 
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch
new file mode 100644
index 0000000..66b9f89
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0034-Use-the-multilib-config-files-from-B-instead-of-usin.patch
@@ -0,0 +1,102 @@
+From fc5e4beaea856a2b486c770ad3addc0f5bb3100e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:33:04 +0400
+Subject: [PATCH 34/35] Use the multilib config files from ${B} instead of
+ using the ones from ${S}
+
+Use the multilib config files from ${B} instead of using the ones from ${S}
+so that the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure    |   22 ++++++++++++++++++----
+ gcc/configure.ac |   22 ++++++++++++++++++----
+ 2 files changed, 36 insertions(+), 8 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 8bc0c98..3cd0817 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11519,10 +11519,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+-	if test -f ${srcdir}/config/$f
+-	then
+-		tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+-	fi
++  case $f in
++    */t-linux64 )
++       if test -f ./config/$f
++       then
++         tmake_file_="${tmake_file_} ./config/$f"
++       fi
++       ;;
++    * )
++       if test -f ${srcdir}/config/$f
++       then
++         tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++       fi
++       ;;
++  esac
+ done
+ tmake_file="${tmake_file_}"
+ 
+@@ -11533,6 +11543,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+   case $f in
++    */linux64.h )
++       tm_file_list="${tm_file_list} ./config/$f"
++       tm_include_list="${tm_include_list} ./config/$f"
++       ;;
+     ./* )
+        f=`echo $f | sed 's/^..//'`
+        tm_file_list="${tm_file_list} $f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 5e5e84f..415a6df 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1700,10 +1700,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+-	if test -f ${srcdir}/config/$f
+-	then
+-		tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+-	fi
++  case $f in
++    */t-linux64 )
++       if test -f ./config/$f
++       then
++         tmake_file_="${tmake_file_} ./config/$f"
++       fi
++       ;;
++    * )
++       if test -f ${srcdir}/config/$f
++       then
++         tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++       fi
++       ;;
++  esac
+ done
+ tmake_file="${tmake_file_}"
+ 
+@@ -1714,6 +1724,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+   case $f in
++    */linux64.h )
++       tm_file_list="${tm_file_list} ./config/$f"
++       tm_include_list="${tm_include_list} ./config/$f"
++       ;;
+     ./* )
+        f=`echo $f | sed 's/^..//'`
+        tm_file_list="${tm_file_list} $f"
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch b/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch
new file mode 100644
index 0000000..d50aa5c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0040-fix-g++-sysroot.patch
@@ -0,0 +1,40 @@
+Portions of
+
+http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html
+
+are not upstreamed yet. So lets keep missing pieces.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gcc-4.8.1/gcc/configure.ac
+===================================================================
+--- gcc-4.8.1.orig/gcc/configure.ac	2013-07-15 15:55:49.488399132 -0700
++++ gcc-4.8.1/gcc/configure.ac	2013-07-15 16:02:31.772406679 -0700
+@@ -148,7 +148,9 @@
+ if test "${with_sysroot+set}" = set; then
+   gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+   if test "${gcc_gxx_without_sysroot}"; then
+-    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    if test x${with_sysroot} != x/; then
++      gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    fi
+     gcc_gxx_include_dir_add_sysroot=1
+   fi
+ fi
+Index: gcc-4.8.1/gcc/configure
+===================================================================
+--- gcc-4.8.1.orig/gcc/configure	2013-07-15 15:55:49.472399132 -0700
++++ gcc-4.8.1/gcc/configure	2013-07-15 16:02:31.780406680 -0700
+@@ -3325,7 +3325,9 @@
+ if test "${with_sysroot+set}" = set; then
+   gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+   if test "${gcc_gxx_without_sysroot}"; then
+-    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    if test x${with_sysroot} != x/; then
++      gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    fi
+     gcc_gxx_include_dir_add_sysroot=1
+   fi
+ fi
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch b/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch
new file mode 100644
index 0000000..2dd9610
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0041-libtool-avoid-libdir.patch
@@ -0,0 +1,19 @@
+Avoid using libdir from .la which usually points to a host path
+
+Upstream-Status: Inappropriate [embedded specific]
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+
+diff --git a/ltmain.sh b/ltmain.sh
+index a03433f..1902a90 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -5628,6 +5628,9 @@ func_mode_link ()
+ 	    absdir="$abs_ladir"
+ 	    libdir="$abs_ladir"
+ 	  else
++	    # Instead of using libdir from .la which usually points to a host path,
++	    # use the path the .la is contained in.
++	    libdir="$abs_ladir"
+ 	    dir="$libdir"
+ 	    absdir="$libdir"
+ 	  fi
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch b/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch
new file mode 100644
index 0000000..eaf8646
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0043-cpp.patch
@@ -0,0 +1,40 @@
+The OE environment sets and exports CPP as being the target gcc. When building 
+gcc-cross-canadian for a mingw targetted sdk, the following can be found in
+build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log:
+
+configure:3641: checking for _FILE_OFFSET_BITS value needed for large files
+configure:3666: gcc  -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe  conftest.c >&5
+configure:3666: $? = 0
+configure:3698: result: no
+configure:3786: checking how to run the C preprocessor
+configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32
+configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32  conftest.c
+configure:3876: $? = 0
+
+Note this is a *build* target (in build-x86_64-linux) so it should be using 
+the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32 headers are 
+very different, using the wrong cpp is a real problem. It is leaking into 
+configure through the CPP variable. Ultimately this leads to build failures 
+related to not being able to include a process.h file for pem-unix.c.
+
+The fix is to ensure we export a sane CPP value into the build environment when
+using build targets. We could define a CPP_FOR_BUILD value which may be the version
+which needs to be upstreamed but for now, this fix is good enough to avoid the 
+problem.
+
+RP 22/08/2013
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/Makefile.in	2013-03-30 11:25:03.000000000 +0000
++++ gcc-4.8.1/Makefile.in	2013-08-13 12:03:17.151988882 +0000
+@@ -149,6 +149,7 @@
+ 	AR="$(AR_FOR_BUILD)"; export AR; \
+ 	AS="$(AS_FOR_BUILD)"; export AS; \
+ 	CC="$(CC_FOR_BUILD)"; export CC; \
++	CPP="$(CC_FOR_BUILD) -E"; export CPP; \
+ 	CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ 	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ 	CXX="$(CXX_FOR_BUILD)"; export CXX; \
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch b/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch
new file mode 100644
index 0000000..e38761d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0044-gengtypes.patch
@@ -0,0 +1,97 @@
+gengtype is generated for both the build system and the target. -DGENERATOR_FILE
+was added in the patch http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00273.html
+and was applied to both versions of gengtype.
+
+Unfortunately the presence of this flag triggers the build configuration (bconfig.h) 
+to be included for the target build of gengtype. Compiling gengtype with the target 
+compiler and bconfig.h can result in errors if the build and target systems are 
+dissimilar. An example case this fails is cross compiling gcc on linux for a darwin 
+target system:
+
+In file included from /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c:25:0:
+| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/gengtype-parse.c: In function 'void parse_error(const char*, ...)':
+| /media/build1/poky/build/tmp/work-shared/gcc-4.8.1-r0/gcc-4.8.1/gcc/system.h:93:53: error: 'fputc_unlocked' was not declared in this scope
+|  #  define fputc(C, Stream) fputc_unlocked (C, Stream)
+
+which occurs since auto-build.h and auto-host.h have differnet values of
+HAVE_FPUTC_UNLOCKED:
+
+#define HAVE_FPUTC_UNLOCKED 1
+/* #undef HAVE_FPUTS_UNLOCKED */
+
+The obvious fix is to only include the flag on build/ targets which this patch does, however 
+this also leads to compile errors due to const_tree being undefined but used in double_int.h
+
+I added a GENERATOR_FILE2 flag to workaround those in the 
+target case and allow the build to succeed.
+
+Only the build/gengtypes should have the -DGENERATOR_FILE 
+
+RP 22/8/2013
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/gcc/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/gcc/Makefile.in	2013-08-19 11:40:36.844014424 +0000
++++ gcc-4.8.1/gcc/Makefile.in	2013-08-19 11:40:37.784014402 +0000
+@@ -3903,27 +3903,29 @@
+ 
+ gengtype-lex.o build/gengtype-lex.o : gengtype-lex.c gengtype.h $(SYSTEM_H)
+ gengtype-lex.o: $(CONFIG_H) $(BCONFIG_H)
+-CFLAGS-gengtype-lex.o += -DGENERATOR_FILE
++CFLAGS-build/gengtype-lex.o += -DGENERATOR_FILE
+ build/gengtype-lex.o: $(BCONFIG_H)
+ 
+ gengtype-parse.o build/gengtype-parse.o : gengtype-parse.c gengtype.h \
+   $(SYSTEM_H)
+ gengtype-parse.o: $(CONFIG_H)
+-CFLAGS-gengtype-parse.o += -DGENERATOR_FILE
++CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE
+ build/gengtype-parse.o: $(BCONFIG_H)
+ 
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+   gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+   $(XREGEX_H)
+ gengtype-state.o: $(CONFIG_H)
+-CFLAGS-gengtype-state.o += -DGENERATOR_FILE
++CFLAGS-gengtype-state.o += -DGENERATOR_FILE2
++CFLAGS-build/gengtype-state.o += -DGENERATOR_FILE
+ build/gengtype-state.o: $(BCONFIG_H)
+ 
+ gengtype.o build/gengtype.o : gengtype.c $(SYSTEM_H) gengtype.h 	\
+   rtl.def insn-notes.def errors.h double-int.h version.h $(HASHTAB_H) \
+   $(OBSTACK_H) $(XREGEX_H)
+ gengtype.o: $(CONFIG_H)
+-CFLAGS-gengtype.o += -DGENERATOR_FILE
++CFLAGS-gengtype.o += -DGENERATOR_FILE2
++CFLAGS-build/gengtype.o += -DGENERATOR_FILE
+ build/gengtype.o: $(BCONFIG_H)
+ 
+ build/genmddeps.o: genmddeps.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h	\
+@@ -3988,7 +3990,7 @@
+ # any system header is included.
+ gengtype-lex.c : gengtype-lex.l
+ 	-$(FLEX) $(FLEXFLAGS) -o$@ $< && { \
+-	  echo '#include "bconfig.h"' > $@.tmp; \
++	  echo '' > $@.tmp; \
+ 	  cat $@ >> $@.tmp; \
+ 	  mv $@.tmp $@; \
+ 	}
+Index: gcc-4.8.1/gcc/double-int.h
+===================================================================
+--- gcc-4.8.1.orig/gcc/double-int.h	2013-01-30 11:04:30.000000000 +0000
++++ gcc-4.8.1/gcc/double-int.h	2013-08-19 11:41:51.564012719 +0000
+@@ -448,10 +448,12 @@
+ 
+ 
+ #ifndef GENERATOR_FILE
++#ifndef GENERATOR_FILE2
+ /* Conversion to and from GMP integer representations.  */
+ 
+ void mpz_set_double_int (mpz_t, double_int, bool);
+ double_int mpz_get_double_int (const_tree, mpz_t, bool);
+ #endif
++#endif
+ 
+ #endif /* DOUBLE_INT_H */
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch b/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch
new file mode 100644
index 0000000..6ea4f42
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0046-libatomic-deptracking.patch
@@ -0,0 +1,41 @@
+gcc 4.8 won't build with --disable-dependency-tracking since the *.Ppo files
+don't get created unless --enable-dependency-tracking is true.
+
+This patch ensures we only use those compiler options when its enabled.
+
+Upstream-Status: Submitted
+
+(Problem was already reported upstream, attached this patch there
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55930)
+
+RP 
+2012/09/22
+
+Index: gcc-4.8.1/libatomic/Makefile.am
+===================================================================
+--- gcc-4.8.1.orig/libatomic/Makefile.am	2013-01-14 18:16:23.000000000 +0000
++++ gcc-4.8.1/libatomic/Makefile.am	2013-09-22 10:38:18.904064750 +0000
+@@ -100,7 +100,8 @@
+ IFUNC_DEF	= -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT	= $(word $(PAT_S),$(IFUNC_OPTIONS))
+ 
+-M_DEPS		= -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS		= -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS		= 
+ M_SIZE		= -DN=$(PAT_N)
+ M_IFUNC		= $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE		= $(PAT_BASE)_n.c
+Index: gcc-4.8.1/libatomic/Makefile.in
+===================================================================
+--- gcc-4.8.1.orig/libatomic/Makefile.in	2013-05-31 09:09:26.000000000 +0000
++++ gcc-4.8.1/libatomic/Makefile.in	2013-09-22 10:40:42.520059917 +0000
+@@ -298,7 +298,8 @@
+ PAT_S = $(word 3,$(PAT_SPLIT))
+ IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
+-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS = 
+ M_SIZE = -DN=$(PAT_N)
+ M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE = $(PAT_BASE)_n.c
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch b/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch
new file mode 100644
index 0000000..9afd55c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0047-repomembug.patch
@@ -0,0 +1,53 @@
+When compiling a project using -frepo, .rpo files are written alongside
+the .o file, the symbols either have O or C against them. During final linking,
+the objects can be recompiled with some of the entries tweaked/chosen by the 
+tlink.c code (visible with TLINK_VERBOSE=3), it does this by changing O -> C
+in the .rpo files.
+
+My tests showed that init_repo (cp/repo.c) was correctly calling 
+IDENTIFIER_REPO_CHOSEN against the right identifers and setting the
+chosen bit.
+
+By the time finish_repo() or emit_repo_p() were called, the pointer returned
+by get_identifier() for the symbol marked during init_repo had changed and
+the chosen bit was no longer set. This lead to linking bugs like:
+
+collect: relinking
+collect2: error: '_ZNK6sudoku5ClearINS_8SequenceEEclERS1_' was assigned to 'board.rpo', but was not defined during recompilation, or vice versa
+
+The problem is that the garbage collection is getting called before
+finish_repo() is called and ggc_protect_identifiers is set to false 
+so the identifiers are not preserved. They are recreated but the 
+chosen bits get wiped out which is why the pointer changes and the 
+chosen bit is not set.
+
+The fix is to change ggc_protect_identifiers *after* the finish_repo 
+calls are made.
+
+Reproduction is tricky since you need to trigger the garbage collector at
+just the right moment.
+
+RP 2013/10/9
+
+[YOCTO #5133]
+
+Upstream-Status: Pending
+
+Index: gcc-4.8.1/gcc/toplev.c
+===================================================================
+--- gcc-4.8.1.orig/gcc/toplev.c	2013-03-28 08:29:51.000000000 +0000
++++ gcc-4.8.1/gcc/toplev.c	2013-10-09 20:27:17.089228023 +0000
+@@ -551,11 +551,11 @@
+   if (flag_syntax_only || flag_wpa)
+     return;
+ 
+-  ggc_protect_identifiers = false;
+-
+   /* This must also call finalize_compilation_unit.  */
+   lang_hooks.decls.final_write_globals ();
+ 
++  ggc_protect_identifiers = false;
++
+   if (seen_error ())
+     return;
+ 
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
new file mode 100644
index 0000000..b98f8ff
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0049-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
@@ -0,0 +1,42 @@
+From 9e0e19eac2562f73858602fe26e2044eb8b20c47 Mon Sep 17 00:00:00 2001
+From: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+Date: Wed, 5 Feb 2014 16:52:31 +0200
+Subject: [PATCH] Enable SPE & AltiVec generation on powepc*linux target
+
+When is configured with --target=powerpc-linux, the resulting GCC will 
+not be able to generate code for SPE targets (e500v1/v2).
+GCC configured with --target=powerpc-linuxspe will not be able to
+generate AltiVec instructions (for e6500).
+This patch modifies the configured file such that SPE or AltiVec code
+can be generated when gcc is configured with --target=powerpc-linux.
+The ABI and speciffic instructions can be selected through the
+"-mabi=spe or -mabi=altivec" and the "-mspe or -maltivec" parameters.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+---
+ gcc/config.gcc |    7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index cb7a94e..d392c2b 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2068,7 +2068,12 @@ powerpc-*-rtems*)
+ 	tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm"
+ 	;;
+ powerpc*-*-linux*)
+-	tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h"
++	case ${target} in
++	    powerpc*-*-linux*spe* | powerpc*-*-linux*altivec*)
++		tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h" ;;
++	    *)
++		tm_file="${tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h rs6000/linuxaltivec.h rs6000/linuxspe.h rs6000/e500.h" ;;
++	esac
+ 	extra_options="${extra_options} rs6000/sysv4.opt"
+ 	tmake_file="rs6000/t-fprules rs6000/t-ppcos ${tmake_file} rs6000/t-ppccomm"
+ 	case ${target} in
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch b/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch
new file mode 100644
index 0000000..aead6f6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0050-Revert-Use-dbx_reg_number-for-spanning-registers.patch
@@ -0,0 +1,80 @@
+Upstream-Status: Pending
+
+From cb9b1c041b634a4c128896e3d3eed4082608c797 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 3 May 2014 19:25:17 -0700
+Subject: [PATCH] Revert "2013-05-21  Christian Bruel 
+ <christian.bruel@st.com>"
+
+This reverts commit 3983036a8b6b2710c57777194f21507819a73553.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Conflicts:
+	gcc/ChangeLog
+---
+ gcc/ChangeLog   | 219 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ gcc/dwarf2out.c |  33 +++++----
+ 2 files changed, 234 insertions(+), 18 deletions(-)
+
+diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
+index 1272326..6ac2b28 100644
+--- a/gcc/dwarf2out.c
++++ b/gcc/dwarf2out.c
+@@ -10870,27 +10870,25 @@ static dw_loc_descr_ref
+ multiple_reg_loc_descriptor (rtx rtl, rtx regs,
+ 			     enum var_init_status initialized)
+ {
+-  int size, i;
++  int nregs, size, i;
++  unsigned reg;
+   dw_loc_descr_ref loc_result = NULL;
+ 
+-  /* Simple, contiguous registers.  */
+-  if (regs == NULL_RTX)
+-    {
+-      unsigned reg = REGNO (rtl);
+-      int nregs;
+-
++  reg = REGNO (rtl);
+ #ifdef LEAF_REG_REMAP
+-      if (crtl->uses_only_leaf_regs)
+-	{
+-	  int leaf_reg = LEAF_REG_REMAP (reg);
+-	  if (leaf_reg != -1)
+-	    reg = (unsigned) leaf_reg;
+-	}
++  if (crtl->uses_only_leaf_regs)
++    {
++      int leaf_reg = LEAF_REG_REMAP (reg);
++      if (leaf_reg != -1)
++	reg = (unsigned) leaf_reg;
++    }
+ #endif
++  gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl));
++  nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)];
+ 
+-      gcc_assert ((unsigned) DBX_REGISTER_NUMBER (reg) == dbx_reg_number (rtl));
+-      nregs = hard_regno_nregs[REGNO (rtl)][GET_MODE (rtl)];
+-
++  /* Simple, contiguous registers.  */
++  if (regs == NULL_RTX)
++    {
+       size = GET_MODE_SIZE (GET_MODE (rtl)) / nregs;
+ 
+       loc_result = NULL;
+@@ -10918,9 +10916,10 @@ multiple_reg_loc_descriptor (rtx rtl, rtx regs,
+     {
+       dw_loc_descr_ref t;
+ 
+-      t = one_reg_loc_descriptor (dbx_reg_number (XVECEXP (regs, 0, i)),
++      t = one_reg_loc_descriptor (REGNO (XVECEXP (regs, 0, i)),
+ 				  VAR_INIT_STATUS_INITIALIZED);
+       add_loc_descr (&loc_result, t);
++      size = GET_MODE_SIZE (GET_MODE (XVECEXP (regs, 0, 0)));
+       add_loc_descr_op_piece (&loc_result, size);
+     }
+ 
+-- 
+1.9.2
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch b/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch
new file mode 100644
index 0000000..55e3890
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0051-eabispe.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Taken from http://gcc.gnu.org/ml/gcc-patches/2014-04/msg02064.html
+
+2014-04-30  Cesar Philippidis  <cesar@codesourcery.com>
+
+	gcc/
+	* dwarf2cfi.c (dwf_regno): Don't assert reg is a pseudo
+	register.
+	
+
+diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
+index 4180890..40ef0e2 100644
+--- a/gcc/dwarf2cfi.c
++++ b/gcc/dwarf2cfi.c
+@@ -906,7 +906,6 @@ notice_eh_throw (rtx insn)
+ static inline unsigned
+ dwf_regno (const_rtx reg)
+ {
+-  gcc_assert (REGNO (reg) < FIRST_PSEUDO_REGISTER);
+   return DWARF_FRAME_REGNUM (REGNO (reg));
+ }
+ 
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch b/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch
new file mode 100644
index 0000000..f6958b3
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0052-Add-target-hook-to-override-DWARF2-frame-register-si.patch
@@ -0,0 +1,138 @@
+From d626297e87e19251a284ea1e9360e831b48999ca Mon Sep 17 00:00:00 2001
+From: mpf <mpf@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Thu, 4 Sep 2014 08:32:05 +0000
+Subject: [PATCH] Add target hook to override DWARF2 frame register size
+
+gcc/
+
+	* target.def (TARGET_DWARF_FRAME_REG_MODE): New target hook.
+	* targhooks.c (default_dwarf_frame_reg_mode): New function.
+	* targhooks.h (default_dwarf_frame_reg_mode): New prototype.
+	* doc/tm.texi.in (TARGET_DWARF_FRAME_REG_MODE): Document.
+	* doc/tm.texi: Regenerate.
+	* dwarf2cfi.c (expand_builtin_init_dwarf_reg_sizes): Abstract mode
+	selection logic to default_dwarf_frame_reg_mode.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@214898 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog      | 10 ++++++++++
+ gcc/doc/tm.texi    |  7 +++++++
+ gcc/doc/tm.texi.in |  2 ++
+ gcc/dwarf2cfi.c    |  4 +---
+ gcc/target.def     | 11 +++++++++++
+ gcc/targhooks.c    | 13 +++++++++++++
+ gcc/targhooks.h    |  1 +
+ 7 files changed, 45 insertions(+), 3 deletions(-)
+
+Index: gcc-4.9.2/gcc/doc/tm.texi
+===================================================================
+--- gcc-4.9.2.orig/gcc/doc/tm.texi
++++ gcc-4.9.2/gcc/doc/tm.texi
+@@ -9017,6 +9017,13 @@ register in Dwarf.  Otherwise, this hook
+ If not defined, the default is to return @code{NULL_RTX}.
+ @end deftypefn
+ 
++@deftypefn {Target Hook} {enum machine_mode} TARGET_DWARF_FRAME_REG_MODE (int @var{regno})
++Given a register, this hook should return the mode which the
++corresponding Dwarf frame register should have.  This is normally
++used to return a smaller mode than the raw mode to prevent call
++clobbered parts of a register altering the frame register size
++@end deftypefn
++
+ @deftypefn {Target Hook} void TARGET_INIT_DWARF_REG_SIZES_EXTRA (tree @var{address})
+ If some registers are represented in Dwarf-2 unwind information in
+ multiple pieces, define this hook to fill in information about the
+Index: gcc-4.9.2/gcc/doc/tm.texi.in
+===================================================================
+--- gcc-4.9.2.orig/gcc/doc/tm.texi.in
++++ gcc-4.9.2/gcc/doc/tm.texi.in
+@@ -6745,6 +6745,8 @@ the target supports DWARF 2 frame unwind
+ 
+ @hook TARGET_DWARF_REGISTER_SPAN
+ 
++@hook TARGET_DWARF_FRAME_REG_MODE
++
+ @hook TARGET_INIT_DWARF_REG_SIZES_EXTRA
+ 
+ @hook TARGET_ASM_TTYPE
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -271,11 +271,9 @@ expand_builtin_init_dwarf_reg_sizes (tre
+       if (rnum < DWARF_FRAME_REGISTERS)
+ 	{
+ 	  HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+-	  enum machine_mode save_mode = reg_raw_mode[i];
+ 	  HOST_WIDE_INT size;
++	  enum machine_mode save_mode = targetm.dwarf_frame_reg_mode (i);
+ 
+-	  if (HARD_REGNO_CALL_PART_CLOBBERED (i, save_mode))
+-	    save_mode = choose_hard_reg_mode (i, 1, true);
+ 	  if (dnum == DWARF_FRAME_RETURN_COLUMN)
+ 	    {
+ 	      if (save_mode == VOIDmode)
+Index: gcc-4.9.2/gcc/target.def
+===================================================================
+--- gcc-4.9.2.orig/gcc/target.def
++++ gcc-4.9.2/gcc/target.def
+@@ -3218,6 +3218,17 @@ If not defined, the default is to return
+  rtx, (rtx reg),
+  hook_rtx_rtx_null)
+ 
++/* Given a register return the mode of the corresponding DWARF frame
++   register.  */
++DEFHOOK
++(dwarf_frame_reg_mode,
++ "Given a register, this hook should return the mode which the\n\
++corresponding Dwarf frame register should have.  This is normally\n\
++used to return a smaller mode than the raw mode to prevent call\n\
++clobbered parts of a register altering the frame register size",
++ enum machine_mode, (int regno),
++ default_dwarf_frame_reg_mode)
++
+ /* If expand_builtin_init_dwarf_reg_sizes needs to fill in table
+    entries not corresponding directly to registers below
+    FIRST_PSEUDO_REGISTER, this hook should generate the necessary
+Index: gcc-4.9.2/gcc/targhooks.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/targhooks.c
++++ gcc-4.9.2/gcc/targhooks.c
+@@ -1438,6 +1438,19 @@ default_debug_unwind_info (void)
+   return UI_NONE;
+ }
+ 
++/* Determine the correct mode for a Dwarf frame register that represents
++   register REGNO.  */
++
++enum machine_mode
++default_dwarf_frame_reg_mode (int regno)
++{
++  enum machine_mode save_mode = reg_raw_mode[regno];
++
++  if (HARD_REGNO_CALL_PART_CLOBBERED (regno, save_mode))
++    save_mode = choose_hard_reg_mode (regno, 1, true);
++  return save_mode;
++}
++
+ /* To be used by targets where reg_raw_mode doesn't return the right
+    mode for registers used in apply_builtin_return and apply_builtin_arg.  */
+ 
+Index: gcc-4.9.2/gcc/targhooks.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/targhooks.h
++++ gcc-4.9.2/gcc/targhooks.h
+@@ -194,6 +194,7 @@ extern int default_label_align_max_skip
+ extern int default_jump_align_max_skip (rtx);
+ extern section * default_function_section(tree decl, enum node_frequency freq,
+ 					  bool startup, bool exit);
++extern enum machine_mode default_dwarf_frame_reg_mode (int);
+ extern enum machine_mode default_get_reg_raw_mode (int);
+ 
+ extern void *default_get_pch_validity (size_t *);
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch b/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch
new file mode 100644
index 0000000..23b445c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0053-gcc-fix-segfault-from-calling-free-on-non-malloc-d-a.patch
@@ -0,0 +1,66 @@
+From a22a222c8f9299f6c07a0274388ade7d4ab8c28d Mon Sep 17 00:00:00 2001
+From: Paul Gortmaker <paul.gortmaker@windriver.com>
+Date: Fri, 20 Jun 2014 16:41:08 -0400
+Subject: [PATCH] gcc: fix segfault from calling free on non-malloc'd area
+
+We see the following on a 32bit gcc installed on 64 bit host:
+
+  Reading symbols from ./i586-pokymllib32-linux-gcc...done.
+  (gdb) run
+  Starting program: x86-pokymllib32-linux/lib32-gcc/4.9.0-r0/image/usr/bin/i586-pokymllib32-linux-gcc
+
+  Program received signal SIGSEGV, Segmentation fault.
+  0xf7e957e0 in free () from /lib/i386-linux-gnu/libc.so.6
+  (gdb) bt
+  #0  0xf7e957e0 in free () from /lib/i386-linux-gnu/libc.so.6
+  #1  0x0804b73c in set_multilib_dir () at gcc-4.9.0/gcc/gcc.c:7827
+  #2  main (argc=1, argv=0xffffd504) at gcc-4.9.0/gcc/gcc.c:6688
+  (gdb)
+
+The problem arises because we conditionally assign the pointer we
+eventually free, and the conditional may assign the pointer to the
+non-malloc'd internal string "." which fails when we free it here:
+
+   if (multilib_dir == NULL && multilib_os_dir != NULL
+       && strcmp (multilib_os_dir, ".") == 0)
+     {
+       free (CONST_CAST (char *, multilib_os_dir));
+       ...
+
+As suggested by Jakub, ensure the "." case is also malloc'd via
+xstrdup() and hence the pointer for the "." case can be freed.
+
+Cc: Jakub Jelinek <jakub@redhat.com>
+Cc: Jeff Law <law@redhat.com>
+Cc: Matthias Klose <doko@ubuntu.com>
+CC: Tobias Burnus <burnus@net-b.de>
+Upstream-Status: Accepted [ https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02069.html ]
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 9ac18e60d801..168acf7eb0c9 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -7790,10 +7790,15 @@ set_multilib_dir (void)
+ 		q2++;
+ 	      if (*q2 == ':')
+ 		ml_end = q2;
+-	      new_multilib_os_dir = XNEWVEC (char, ml_end - q);
+-	      memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1);
+-	      new_multilib_os_dir[ml_end - q - 1] = '\0';
+-	      multilib_os_dir = *new_multilib_os_dir ? new_multilib_os_dir : ".";
++	      if (ml_end - q == 1)
++		multilib_os_dir = xstrdup (".");
++	      else
++		{
++		  new_multilib_os_dir = XNEWVEC (char, ml_end - q);
++		  memcpy (new_multilib_os_dir, q + 1, ml_end - q - 1);
++		  new_multilib_os_dir[ml_end - q - 1] = '\0';
++		  multilib_os_dir = new_multilib_os_dir;
++		}
+ 
+ 	      if (q2 < end && *q2 == ':')
+ 		{
+-- 
+1.9.2
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch b/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
new file mode 100644
index 0000000..7e8efa1
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0054-gcc-Makefile.in-fix-parallel-building-failure.patch
@@ -0,0 +1,61 @@
+gcc/Makefile.in: fix parallel building failure
+
+The gcc-ar.o, gcc-nm.o, gcc-ranlib.o and errors.o included
+config.h which was a generated file. But no explicity rule
+to clarify the dependency. There was potential building
+failure while parallel make.
+
+For gcc-ar.o, gcc-nm.o and gcc-ranlib.o, they were compiled from one C
+source file gcc-ar.c, we add them to ALL_HOST_BACKEND_OBJS, so the
+'$(ALL_HOST_OBJS) : | $(generated_files)' rule could work for these
+objects.
+
+For errors.o, it is part of gengtype, and the gengtype generator program
+is special: Two versions are built. One is for the build machine, and one
+is for the host. We refered what gengtype-parse.o did (which also is part
+of gengtype).
+
+[GCC #61899]
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61899
+
+Upstream-Status: Submitted [gcc-patches@gcc.gnu.org]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/Makefile.in | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 6475cba..56e50bb 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -1481,13 +1481,16 @@ OBJS-libcommon-target = $(common_out_object_file) prefix.o params.o \
+ 	opts.o opts-common.o options.o vec.o hooks.o common/common-targhooks.o \
+ 	hash-table.o file-find.o
+ 
++# Objects compiled from one C source file gcc-ar.c
++OBJS-gcc-ar = gcc-ar.o gcc-nm.o gcc-ranlib.o
++
+ # This lists all host objects for the front ends.
+ ALL_HOST_FRONTEND_OBJS = $(foreach v,$(CONFIG_LANGUAGES),$($(v)_OBJS))
+ 
+ ALL_HOST_BACKEND_OBJS = $(GCC_OBJS) $(OBJS) $(OBJS-libcommon) \
+   $(OBJS-libcommon-target) @TREEBROWSER@ main.o c-family/cppspec.o \
+   $(COLLECT2_OBJS) $(EXTRA_GCC_OBJS) $(GCOV_OBJS) $(GCOV_DUMP_OBJS) \
+-  lto-wrapper.o
++  lto-wrapper.o $(OBJS-gcc-ar)
+ 
+ # This lists all host object files, whether they are included in this
+ # compilation or not.
+@@ -2437,6 +2440,8 @@ gengtype-parse.o: $(CONFIG_H)
+ CFLAGS-build/gengtype-parse.o += -DGENERATOR_FILE
+ build/gengtype-parse.o: $(BCONFIG_H)
+ 
++errors.o : $(CONFIG_H)
++
+ gengtype-state.o build/gengtype-state.o: gengtype-state.c $(SYSTEM_H) \
+   gengtype.h errors.h double-int.h version.h $(HASHTAB_H) $(OBSTACK_H) \
+   $(XREGEX_H)
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch b/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch
new file mode 100644
index 0000000..557dab0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0055-dwarf-reg-processing-helper.patch
@@ -0,0 +1,148 @@
+From 4fd39f1329379e00f958394adde6be96f0caf21f Mon Sep 17 00:00:00 2001
+From: hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 5 Dec 2014 16:53:22 +0000
+Subject: [PATCH] 2014-12-05  Olivier Hainque  <hainque@adacore.com>
+
+        * dwarf2cfi.c (init_one_dwarf_reg_size): New helper, processing
+        one particular reg for expand_builtin_init_dwarf_reg_sizes.
+        (expand_builtin_init_dwarf_reg_sizes): Rework to use helper and
+        account for dwarf register spans.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218428 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog   |  7 +++++
+ gcc/dwarf2cfi.c | 98 +++++++++++++++++++++++++++++++++++++++++++++------------
+ 2 files changed, 85 insertions(+), 20 deletions(-)
+
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -252,7 +252,59 @@ init_return_column_size (enum machine_mo
+ 		  gen_int_mode (size, mode));
+ }
+ 
+-/* Generate code to initialize the register size table.  */
++/* Datastructure used by expand_builtin_init_dwarf_reg_sizes and
++   init_one_dwarf_reg_size to communicate on what has been done by the
++   latter.  */
++
++typedef struct
++{
++  /* Whether the dwarf return column was initialized.  */
++  bool wrote_return_column;
++
++  /* For each hard register REGNO, whether init_one_dwarf_reg_size
++     was given REGNO to process already.  */
++  bool processed_regno [FIRST_PSEUDO_REGISTER];
++
++} init_one_dwarf_reg_state;
++
++/* Helper for expand_builtin_init_dwarf_reg_sizes.  Generate code to
++   initialize the dwarf register size table entry corresponding to register
++   REGNO in REGMODE.  TABLE is the table base address, SLOTMODE is the mode to
++   use for the size entry to initialize, and INIT_STATE is the communication
++   datastructure conveying what we're doing to our caller.  */
++
++static
++void init_one_dwarf_reg_size (int regno, machine_mode regmode,
++			      rtx table, machine_mode slotmode,
++			      init_one_dwarf_reg_state *init_state)
++{
++  const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
++  const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++
++  const HOST_WIDE_INT slotoffset = rnum * GET_MODE_SIZE (slotmode);
++  const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
++
++  init_state->processed_regno[regno] = true;
++
++  if (rnum >= DWARF_FRAME_REGISTERS)
++    return;
++
++  if (dnum == DWARF_FRAME_RETURN_COLUMN)
++    {
++      if (regmode == VOIDmode)
++	return;
++      init_state->wrote_return_column = true;
++    }
++
++  if (slotoffset < 0)
++    return;
++
++  emit_move_insn (adjust_address (table, slotmode, slotoffset),
++		  gen_int_mode (regsize, slotmode));
++}
++
++/* Generate code to initialize the dwarf register size table located
++   at the provided ADDRESS.  */
+ 
+ void
+ expand_builtin_init_dwarf_reg_sizes (tree address)
+@@ -261,35 +313,40 @@ expand_builtin_init_dwarf_reg_sizes (tre
+   enum machine_mode mode = TYPE_MODE (char_type_node);
+   rtx addr = expand_normal (address);
+   rtx mem = gen_rtx_MEM (BLKmode, addr);
+-  bool wrote_return_column = false;
++
++  init_one_dwarf_reg_state init_state;
++
++  memset ((char *)&init_state, 0, sizeof (init_state));
+ 
+   for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+     {
+-      unsigned int dnum = DWARF_FRAME_REGNUM (i);
+-      unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
+-
+-      if (rnum < DWARF_FRAME_REGISTERS)
+-	{
+-	  HOST_WIDE_INT offset = rnum * GET_MODE_SIZE (mode);
+-	  HOST_WIDE_INT size;
+-	  enum machine_mode save_mode = targetm.dwarf_frame_reg_mode (i);
++      machine_mode save_mode;
++      rtx span;
+ 
+-	  if (dnum == DWARF_FRAME_RETURN_COLUMN)
++      /* No point in processing a register multiple times.  This could happen
++        with register spans, e.g. when a reg is first processed as a piece of
++        a span, then as a register on its own later on.  */
++
++      if (init_state.processed_regno[i])
++       continue;
++
++      save_mode = targetm.dwarf_frame_reg_mode (i);
++      span = targetm.dwarf_register_span (gen_rtx_REG (save_mode, i));
++      if (!span)
++       init_one_dwarf_reg_size (i, save_mode, mem, mode, &init_state);
++      else
++       {
++         for (int si = 0; si < XVECLEN (span, 0); si++)
+ 	    {
+-	      if (save_mode == VOIDmode)
+-		continue;
+-	      wrote_return_column = true;
+-	    }
+-	  size = GET_MODE_SIZE (save_mode);
+-	  if (offset < 0)
+-	    continue;
++             rtx reg = XVECEXP (span, 0, si);
++             init_one_dwarf_reg_size
++               (REGNO (reg), GET_MODE (reg), mem, mode, &init_state);
++           }
+ 
+-	  emit_move_insn (adjust_address (mem, mode, offset),
+-			  gen_int_mode (size, mode));
+ 	}
+     }
+ 
+-  if (!wrote_return_column)
++  if (!init_state.wrote_return_column)
+     init_return_column_size (mode, mem, DWARF_FRAME_RETURN_COLUMN);
+ 
+ #ifdef DWARF_ALT_FRAME_RETURN_COLUMN
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch b/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch
new file mode 100644
index 0000000..3b6c94c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0056-define-default-cfa-register-mapping.patch
@@ -0,0 +1,75 @@
+From c0235a33de8c4f78cce35b2a8c2035c83fe1bd14 Mon Sep 17 00:00:00 2001
+From: hainque <hainque@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 5 Dec 2014 17:01:42 +0000
+Subject: [PATCH] 2014-12-05  Olivier Hainque  <hainque@adacore.com>
+
+        gcc/
+        * defaults.h: (DWARF_REG_TO_UNWIND_COLUMN): Define default.
+        * dwarf2cfi.c (init_one_dwarf_reg_size): Honor
+        DWARF_REG_TO_UNWIND_COLUMN.
+
+        libgcc/
+        * unwind-dw2.c (DWARF_REG_TO_UNWIND_COLUMN): Remove default def,
+        now provided by defaults.h.
+
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218429 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog       | 6 ++++++
+ gcc/defaults.h      | 5 +++++
+ gcc/dwarf2cfi.c     | 3 ++-
+ libgcc/ChangeLog    | 5 +++++
+ libgcc/unwind-dw2.c | 4 ----
+ 5 files changed, 18 insertions(+), 5 deletions(-)
+
+Index: gcc-4.9.2/gcc/defaults.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/defaults.h
++++ gcc-4.9.2/gcc/defaults.h
+@@ -438,6 +438,11 @@ see the files COPYING3 and COPYING.RUNTI
+ #define DWARF_FRAME_REGNUM(REG) DBX_REGISTER_NUMBER (REG)
+ #endif
+ 
++/* The mapping from dwarf CFA reg number to internal dwarf reg numbers.  */
++#ifndef DWARF_REG_TO_UNWIND_COLUMN
++#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
++#endif
++
+ /* Map register numbers held in the call frame info that gcc has
+    collected using DWARF_FRAME_REGNUM to those that should be output in
+    .debug_frame and .eh_frame.  */
+Index: gcc-4.9.2/gcc/dwarf2cfi.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/dwarf2cfi.c
++++ gcc-4.9.2/gcc/dwarf2cfi.c
+@@ -280,8 +280,9 @@ void init_one_dwarf_reg_size (int regno,
+ {
+   const unsigned int dnum = DWARF_FRAME_REGNUM (regno);
+   const unsigned int rnum = DWARF2_FRAME_REG_OUT (dnum, 1);
++  const unsigned int dcol = DWARF_REG_TO_UNWIND_COLUMN (rnum);
+ 
+-  const HOST_WIDE_INT slotoffset = rnum * GET_MODE_SIZE (slotmode);
++  const HOST_WIDE_INT slotoffset = dcol * GET_MODE_SIZE (slotmode);
+   const HOST_WIDE_INT regsize = GET_MODE_SIZE (regmode);
+ 
+   init_state->processed_regno[regno] = true;
+Index: gcc-4.9.2/libgcc/unwind-dw2.c
+===================================================================
+--- gcc-4.9.2.orig/libgcc/unwind-dw2.c
++++ gcc-4.9.2/libgcc/unwind-dw2.c
+@@ -55,10 +55,6 @@
+ #define PRE_GCC3_DWARF_FRAME_REGISTERS DWARF_FRAME_REGISTERS
+ #endif
+ 
+-#ifndef DWARF_REG_TO_UNWIND_COLUMN
+-#define DWARF_REG_TO_UNWIND_COLUMN(REGNO) (REGNO)
+-#endif
+-
+ /* ??? For the public function interfaces, we tend to gcc_assert that the
+    column numbers are in range.  For the dwarf2 unwind info this does happen,
+    although so far in a case that doesn't actually matter.
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch b/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch
new file mode 100644
index 0000000..f295596
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0057-aarch64-config.patch
@@ -0,0 +1,32 @@
+Disable the MULTILIB_OSDIRNAMES and other multilib options.
+
+Hard coding the MULTILIB_OSDIRNAMES with ../lib64 is causing problems on
+systems where the libdir is NOT set to /lib64.  This is allowed by the ABI, as
+long as the dynamic loader is present in /lib.
+
+We simply want to use the default rules in gcc to find and configure the 
+normal libdir.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: gcc-4.9.1/gcc/config/aarch64/t-aarch64-linux
+===================================================================
+--- gcc-4.9.1.orig/gcc/config/aarch64/t-aarch64-linux
++++ gcc-4.9.1/gcc/config/aarch64/t-aarch64-linux
+@@ -21,11 +21,11 @@
+ LIB1ASMSRC   = aarch64/lib1funcs.asm
+ LIB1ASMFUNCS = _aarch64_sync_cache_range
+ 
+-AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
+-MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+-MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
++#AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
++#MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
++#MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+ 
+ # Disable the multilib for linux-gnu targets for the time being; focus
+ # on the baremetal targets.
+-MULTILIB_OPTIONS    =
+-MULTILIB_DIRNAMES   =
++#MULTILIB_OPTIONS    =
++#MULTILIB_DIRNAMES   =
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch b/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch
new file mode 100644
index 0000000..d442ba8
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0058-gcc-r212171.patch
@@ -0,0 +1,113 @@
+From ca03cf1b133d66eb978c68f6dbc345e9aabcba88 Mon Sep 17 00:00:00 2001
+From: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Mon, 30 Jun 2014 19:30:52 +0000
+Subject: [PATCH] r212171
+
+* except.c (emit_note_eh_region_end): New helper
+ function. 	(convert_to_eh_region_ranges): Use
+ emit_note_eh_region_end to 	emit EH_REGION_END note. 
+ * jump.c (cleanup_barriers): Do not split a call and its 
+ corresponding CALL_ARG_LOCATION note.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212171 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=212171]
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+---
+ gcc/except.c |   23 ++++++++++++++++++-----
+ gcc/jump.c   |   19 +++++++++++++++----
+ 2 files changed, 33 insertions(+), 9 deletions(-)
+
+diff --git a/gcc/except.c b/gcc/except.c
+index dc5c1d2..7ac114f 100644
+--- a/gcc/except.c
++++ b/gcc/except.c
+@@ -2466,6 +2466,20 @@ add_call_site (rtx landing_pad, int action, int section)
+   return call_site_base + crtl->eh.call_site_record_v[section]->length () - 1;
+ }
+ 
++static rtx
++emit_note_eh_region_end (rtx insn)
++{
++  rtx next = NEXT_INSN (insn);
++
++  /* Make sure we do not split a call and its corresponding
++     CALL_ARG_LOCATION note.  */
++  if (next && NOTE_P (next)
++      && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
++    insn = next;
++
++  return emit_note_after (NOTE_INSN_EH_REGION_END, insn);
++}
++
+ /* Turn REG_EH_REGION notes back into NOTE_INSN_EH_REGION notes.
+    The new note numbers will not refer to region numbers, but
+    instead to call site entries.  */
+@@ -2544,8 +2558,8 @@ convert_to_eh_region_ranges (void)
+ 		note = emit_note_before (NOTE_INSN_EH_REGION_BEG,
+ 					 first_no_action_insn_before_switch);
+ 		NOTE_EH_HANDLER (note) = call_site;
+-		note = emit_note_after (NOTE_INSN_EH_REGION_END,
+-					last_no_action_insn_before_switch);
++		note
++		  = emit_note_eh_region_end (last_no_action_insn_before_switch);
+ 		NOTE_EH_HANDLER (note) = call_site;
+ 		gcc_assert (last_action != -3
+ 			    || (last_action_insn
+@@ -2569,8 +2583,7 @@ convert_to_eh_region_ranges (void)
+ 		    first_no_action_insn = NULL_RTX;
+ 		  }
+ 
+-		note = emit_note_after (NOTE_INSN_EH_REGION_END,
+-					last_action_insn);
++		note = emit_note_eh_region_end (last_action_insn);
+ 		NOTE_EH_HANDLER (note) = call_site;
+ 	      }
+ 
+@@ -2617,7 +2630,7 @@ convert_to_eh_region_ranges (void)
+ 
+   if (last_action >= -1 && ! first_no_action_insn)
+     {
+-      note = emit_note_after (NOTE_INSN_EH_REGION_END, last_action_insn);
++      note = emit_note_eh_region_end (last_action_insn);
+       NOTE_EH_HANDLER (note) = call_site;
+     }
+ 
+diff --git a/gcc/jump.c b/gcc/jump.c
+index 9418f65..a5e5f52 100644
+--- a/gcc/jump.c
++++ b/gcc/jump.c
+@@ -121,15 +121,26 @@ rebuild_jump_labels_chain (rtx chain)
+ static unsigned int
+ cleanup_barriers (void)
+ {
+-  rtx insn, next, prev;
+-  for (insn = get_insns (); insn; insn = next)
++  rtx insn;
++  for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+     {
+-      next = NEXT_INSN (insn);
+       if (BARRIER_P (insn))
+ 	{
+-	  prev = prev_nonnote_insn (insn);
++	  rtx prev = prev_nonnote_insn (insn);
+ 	  if (!prev)
+ 	    continue;
++
++	  if (CALL_P (prev))
++	    {
++	      /* Make sure we do not split a call and its corresponding
++		 CALL_ARG_LOCATION note.  */
++	      rtx next = NEXT_INSN (prev);
++
++	      if (NOTE_P (next)
++		  && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION)
++		prev = next;
++	    }
++
+ 	  if (BARRIER_P (prev))
+ 	    delete_insn (insn);
+ 	  else if (prev != PREV_INSN (insn))
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch b/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch
new file mode 100644
index 0000000..de827cb
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0059-gcc-PR-rtl-optimization-63348.patch
@@ -0,0 +1,59 @@
+From 6eae3e637fcc22d21b51d44d61e3a9cb4825e776 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Thu, 30 Oct 2014 20:37:14 -0700
+Subject: [PATCH]PR rtl-optimization/63348
+ 
+PR rtl-optimization/63348
+* emit-rtl.c (try_split): Do not emit extra barrier.
+
+Note: this patch is to fix the side effect introduced by r212171 which was reported at:
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63348
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215613 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport [https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=215613]
+Signed-off-by: Baoshan Pang <baoshan.pang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ gcc/emit-rtl.c |   11 -----------
+ 1 files changed, 0 insertions(+), 11 deletions(-)
+
+diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
+index 4736f8d..ae69dbd 100644
+--- a/gcc/emit-rtl.c
++++ b/gcc/emit-rtl.c
+@@ -3422,7 +3422,6 @@ try_split (rtx pat, rtx trial, int last)
+ {
+   rtx before = PREV_INSN (trial);
+   rtx after = NEXT_INSN (trial);
+-  int has_barrier = 0;
+   rtx note, seq, tem;
+   int probability;
+   rtx insn_last, insn;
+@@ -3441,14 +3440,6 @@ try_split (rtx pat, rtx trial, int last)
+ 
+   split_branch_probability = -1;
+ 
+-  /* If we are splitting a JUMP_INSN, it might be followed by a BARRIER.
+-     We may need to handle this specially.  */
+-  if (after && BARRIER_P (after))
+-    {
+-      has_barrier = 1;
+-      after = NEXT_INSN (after);
+-    }
+-
+   if (!seq)
+     return trial;
+ 
+@@ -3594,8 +3585,6 @@ try_split (rtx pat, rtx trial, int last)
+   tem = emit_insn_after_setloc (seq, trial, INSN_LOCATION (trial));
+ 
+   delete_insn (trial);
+-  if (has_barrier)
+-    emit_barrier_after (tem);
+ 
+   /* Recursively call try_split for each new insn created; by the
+      time control returns here that insn will be fully split, so
+-- 
+1.7.1
+
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
new file mode 100644
index 0000000..75a9fdd
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0060-Only-allow-e500-double-in-SPE_SIMD_REGNO_P-registers.patch
@@ -0,0 +1,55 @@
+From 5c0092070253113cf0d9c45eacc884b3ecc34d81 Mon Sep 17 00:00:00 2001
+From: jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat, 25 Oct 2014 00:23:17 +0000
+Subject: [PATCH] Only allow e500 double in SPE_SIMD_REGNO_P registers.
+
+rs6000_hard_regno_nregs_internal allows SPE vectors in single
+registers satisfying SPE_SIMD_REGNO_P (i.e. register numbers 0 to
+31).  However, the corresponding test for e500 double treats all
+registers as being able to store a 64-bit value, rather than just
+those GPRs.
+
+Logically this inconsistency is wrong; in addition, it causes problems
+unwinding from signal handlers.  linux-unwind.h uses
+ARG_POINTER_REGNUM as a place to store the return address from a
+signal handler, but this logic in rs6000_hard_regno_nregs_internal
+results in that being considered an 8-byte register, resulting in
+assertion failures.
+(<https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02625.html> first
+needs to be applied for unwinding to work in general on e500.)  This
+patch makes rs6000_hard_regno_nregs_internal handle the e500 double
+case consistently with SPE vectors.
+
+Tested with no regressions with cross to powerpc-linux-gnuspe (given
+the aforementioned patch applied).  Failures of signal handling
+unwinding tests such as gcc.dg/cleanup-{8,9,10,11}.c are fixed by this
+patch.
+
+	* config/rs6000/rs6000.c (rs6000_hard_regno_nregs_internal): Do
+	not allow e500 double in registers not satisyfing
+	SPE_SIMD_REGNO_P.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@216688 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [gcc 5.0]
+
+---
+ gcc/ChangeLog              | 6 ++++++
+ gcc/config/rs6000/rs6000.c | 2 +-
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+Index: gcc-4.9.2/gcc/config/rs6000/rs6000.c
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/rs6000/rs6000.c
++++ gcc-4.9.2/gcc/config/rs6000/rs6000.c
+@@ -1703,7 +1703,7 @@ rs6000_hard_regno_nregs_internal (int re
+      SCmode so as to pass the value correctly in a pair of
+      registers.  */
+   else if (TARGET_E500_DOUBLE && FLOAT_MODE_P (mode) && mode != SCmode
+-	   && !DECIMAL_FLOAT_MODE_P (mode))
++	   && !DECIMAL_FLOAT_MODE_P (mode) && SPE_SIMD_REGNO_P (regno))
+     reg_size = UNITS_PER_FP_WORD;
+ 
+   else
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch b/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch
new file mode 100644
index 0000000..f48c66d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0061-target-gcc-includedir.patch
@@ -0,0 +1,81 @@
+Ensure target gcc headers can be included
+
+There are a few headers installed as part of the OpenEmbedded
+gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe
+built for the target architecture, these are within the target
+sysroot and not cross/nativesdk; thus they weren't able to be
+found by gcc with the existing search paths. Add support for
+picking up these headers under the sysroot supplied on the gcc
+command line in order to resolve this.
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Upstream-Status: Pending
+
+--- a/gcc/Makefile.in	2014-12-23 11:57:33.327873331 +0000
++++ b/gcc/Makefile.in	2015-01-21 11:32:35.447305394 +0000
+@@ -587,6 +587,7 @@
+ 
+ # Directory in which the compiler finds libraries etc.
+ libsubdir = $(libdir)/gcc/$(target_noncanonical)/$(version)
++libsubdir_target = gcc/$(target_noncanonical)/$(version)
+ # Directory in which the compiler finds executables
+ libexecsubdir = $(libexecdir)/gcc/$(target_noncanonical)/$(version)
+ # Directory in which all plugin resources are installed
+@@ -2534,6 +2535,7 @@
+ 
+ PREPROCESSOR_DEFINES = \
+   -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
++  -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \
+   -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
+   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
+   -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
+--- a/gcc/cppdefault.c	2015-01-13 17:40:26.131012725 +0000
++++ b/gcc/cppdefault.c	2015-01-21 11:30:08.928426492 +0000
+@@ -59,6 +59,10 @@
+     /* This is the dir for gcc's private headers.  */
+     { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
+ #endif
++#ifdef GCC_INCLUDE_SUBDIR_TARGET
++    /* This is the dir for gcc's private headers under the specified sysroot.  */
++    { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++#endif
+ #ifdef LOCAL_INCLUDE_DIR
+     /* /usr/local/include comes before the fixincluded header files.  */
+     { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+diff --git a/gcc/defaults.h b/gcc/defaults.h
+index f94ae17..d98b40b 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1390,4 +1390,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ 
+ #endif /* GCC_INSN_FLAGS_H  */
+ 
++/* Default prefixes to attach to command names.  */
++
++#ifndef STANDARD_STARTFILE_PREFIX_1
++#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
++#endif
++#ifndef STANDARD_STARTFILE_PREFIX_2
++#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
++#endif
++
+ #endif  /* ! GCC_DEFAULTS_H */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 9f0b781..174fca8 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1189,13 +1189,6 @@ static const char *gcc_libexec_prefix;
+ 
+ /* Default prefixes to attach to command names.  */
+ 
+-#ifndef STANDARD_STARTFILE_PREFIX_1
+-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+-#endif
+-#ifndef STANDARD_STARTFILE_PREFIX_2
+-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+-#endif
+-
+ #ifdef CROSS_DIRECTORY_STRUCTURE  /* Don't use these prefixes for a cross compiler.  */
+ #undef MD_EXEC_PREFIX
+ #undef MD_STARTFILE_PREFIX
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch b/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
new file mode 100644
index 0000000..c48bd48
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0062-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
@@ -0,0 +1,24 @@
+From 861bcfd4ae814f351e0c668ee26d01d1331e0422 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Apr 2015 23:15:27 -0700
+Subject: [PATCH 36/37] Use SYSTEMLIBS_DIR replacement instead of hardcoding
+ base_libdir
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/aarch64-linux.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: gcc-4.9.2/gcc/config/aarch64/aarch64-linux.h
+===================================================================
+--- gcc-4.9.2.orig/gcc/config/aarch64/aarch64-linux.h
++++ gcc-4.9.2/gcc/config/aarch64/aarch64-linux.h
+@@ -21,7 +21,7 @@
+ #ifndef GCC_AARCH64_LINUX_H
+ #define GCC_AARCH64_LINUX_H
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}.so.1"
+ 
+ #define CPP_SPEC "%{pthread:-D_REENTRANT}"
+ 
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch b/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch
new file mode 100644
index 0000000..f9efa45
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0063-nativesdk-gcc-support.patch
@@ -0,0 +1,198 @@
+Being able to build a nativesdk gcc is useful, particularly in cases
+where the host compiler may be of an incompatible version (or a 32
+bit compiler is needed).
+
+Sadly, building nativesdk-gcc is not straight forward. We install
+nativesdk-gcc into a relocatable location and this means that its
+library locations can change. "Normal" sysroot support doesn't help
+in this case since the values of paths like "libdir" change, not just
+base root directory of the system.
+
+In order to handle this we do two things:
+
+a) Add %r into spec file markup which can be used for injected paths
+   such as SYSTEMLIBS_DIR (see gcc_multilib_setup()).
+b) Add other paths which need relocation into a .gccrelocprefix section
+   which the relocation code will notice and adjust automatically.
+
+Upstream-Status: Inappropriate
+RP 2015/7/28
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 5fd3d0a..2de29aa 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -120,6 +120,8 @@ static const char *target_system_root = TARGET_SYSTEM_ROOT;
+ #else
+ static const char *target_system_root = 0;
+ #endif
++ 
++static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
+ 
+ /* Nonzero means pass the updated target_system_root to the compiler.  */
+ 
+@@ -384,6 +386,7 @@ or with constant text in a single argument.
+  %G     process LIBGCC_SPEC as a spec.
+  %R     Output the concatenation of target_system_root and
+         target_sysroot_suffix.
++ %r     Output the base path target_relocatable_prefix
+  %S     process STARTFILE_SPEC as a spec.  A capital S is actually used here.
+  %E     process ENDFILE_SPEC as a spec.  A capital E is actually used here.
+  %C     process CPP_SPEC as a spec.
+@@ -1218,10 +1221,10 @@ static const char *gcc_libexec_prefix;
+    gcc_exec_prefix is set because, in that case, we know where the
+    compiler has been installed, and use paths relative to that
+    location instead.  */
+-static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
+-static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
+-static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
+-static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
++static char standard_exec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_EXEC_PREFIX;
++static char standard_libexec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_LIBEXEC_PREFIX;
++static char standard_bindir_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_BINDIR_PREFIX;
++static char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+ 
+ /* For native compilers, these are well-known paths containing
+    components that may be provided by the system.  For cross
+@@ -1229,9 +1232,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+ static const char *md_exec_prefix = MD_EXEC_PREFIX;
+ static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
+ static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
+-static const char *const standard_startfile_prefix_1
++static char standard_startfile_prefix_1[4096] __attribute__ ((section (".gccrelocprefix")))
+   = STANDARD_STARTFILE_PREFIX_1;
+-static const char *const standard_startfile_prefix_2
++static char standard_startfile_prefix_2[4096] __attribute__ ((section (".gccrelocprefix")))
+   = STANDARD_STARTFILE_PREFIX_2;
+ 
+ /* A relative path to be used in finding the location of tools
+@@ -5305,6 +5308,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
+ 	      }
+ 	    break;
+ 
++          case 'r':
++              obstack_grow (&obstack, target_relocatable_prefix,
++		      strlen (target_relocatable_prefix));
++            break;
++
+ 	  case 'S':
+ 	    value = do_spec_1 (startfile_spec, 0, NULL);
+ 	    if (value != 0)
+
+diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
+index dad69e6..cf43f28 100644
+--- a/gcc/cppdefault.c
++++ b/gcc/cppdefault.c
+@@ -35,6 +35,30 @@
+ # undef CROSS_INCLUDE_DIR
+ #endif
+ 
++static char GPLUSPLUS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_INCLUDE_DIR;
++static char GCC_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GCC_INCLUDE_DIR;
++static char GPLUSPLUS_TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_TOOL_INCLUDE_DIR;
++static char GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_BACKWARD_INCLUDE_DIR;
++static char STANDARD_STARTFILE_PREFIX_2VAR[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET;
++#ifdef LOCAL_INCLUDE_DIR
++static char LOCAL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = LOCAL_INCLUDE_DIR;
++#endif
++#ifdef PREFIX_INCLUDE_DIR
++static char PREFIX_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = PREFIX_INCLUDE_DIR;
++#endif
++#ifdef FIXED_INCLUDE_DIR
++static char FIXED_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = FIXED_INCLUDE_DIR;
++#endif
++#ifdef CROSS_INCLUDE_DIR
++static char CROSS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = CROSS_INCLUDE_DIR;
++#endif
++#ifdef TOOL_INCLUDE_DIR
++static char TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = TOOL_INCLUDE_DIR;
++#endif
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++static char NATIVE_SYSTEM_HEADER_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = NATIVE_SYSTEM_HEADER_DIR;
++#endif
++
+ const struct default_include cpp_include_defaults[]
+ #ifdef INCLUDE_DEFAULTS
+ = INCLUDE_DEFAULTS;
+@@ -42,38 +66,38 @@ const struct default_include cpp_include_defaults[]
+ = {
+ #ifdef GPLUSPLUS_INCLUDE_DIR
+     /* Pick up GNU C++ generic include files.  */
+-    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,
++    { GPLUSPLUS_INCLUDE_DIRVAR, "G++", 1, 1,
+       GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+ #endif
+ #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
+     /* Pick up GNU C++ target-dependent include files.  */
+-    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,
++    { GPLUSPLUS_TOOL_INCLUDE_DIRVAR, "G++", 1, 1,
+       GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },
+ #endif
+ #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
+     /* Pick up GNU C++ backward and deprecated include files.  */
+-    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1,
++    { GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR, "G++", 1, 1,
+       GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_DIR
+     /* This is the dir for gcc's private headers.  */
+-    { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
++    { GCC_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_SUBDIR_TARGET
+     /* This is the dir for gcc's private headers under the specified sysroot.  */
+-    { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++    { STANDARD_STARTFILE_PREFIX_2VAR, "GCC", 0, 0, 1, 0 },
+ #endif
+ #ifdef LOCAL_INCLUDE_DIR
+     /* /usr/local/include comes before the fixincluded header files.  */
+-    { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+-    { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++    { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 2 },
++    { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 0 },
+ #endif
+ #ifdef PREFIX_INCLUDE_DIR
+-    { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 },
++    { PREFIX_INCLUDE_DIRVAR, 0, 0, 1, 0, 0 },
+ #endif
+ #ifdef FIXED_INCLUDE_DIR
+     /* This is the dir for fixincludes.  */
+-    { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0,
++    { FIXED_INCLUDE_DIRVAR, "GCC", 0, 0, 0,
+       /* A multilib suffix needs adding if different multilibs use
+ 	 different headers.  */
+ #ifdef SYSROOT_HEADERS_SUFFIX_SPEC
+@@ -85,16 +109,16 @@ const struct default_include cpp_include_defaults[]
+ #endif
+ #ifdef CROSS_INCLUDE_DIR
+     /* One place the target system's headers might be.  */
+-    { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
++    { CROSS_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef TOOL_INCLUDE_DIR
+     /* Another place the target system's headers might be.  */
+-    { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 },
++    { TOOL_INCLUDE_DIRVAR, "BINUTILS", 0, 1, 0, 0 },
+ #endif
+ #ifdef NATIVE_SYSTEM_HEADER_DIR
+     /* /usr/include comes dead last.  */
+-    { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
+-    { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
++    { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
++    { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
+ #endif
+     { 0, 0, 0, 0, 0, 0 }
+   };
+diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h
+index 30b6fed..2ef96b7 100644
+--- a/gcc/cppdefault.h
++++ b/gcc/cppdefault.h
+@@ -33,7 +33,8 @@
+ 
+ struct default_include
+ {
+-  const char *const fname;	/* The name of the directory.  */
++  const char *fname;     /* The name of the directory.  */
++
+   const char *const component;	/* The component containing the directory
+ 				   (see update_path in prefix.c) */
+   const char cplusplus;		/* Only look here if we're compiling C++.  */
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch b/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch
new file mode 100644
index 0000000..5356984
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0064-handle-target-sysroot-multilib.patch
@@ -0,0 +1,88 @@
+Search target sysroot gcc version specific dirs with multilib.
+
+We install the gcc libraries (such as crtbegin.p) into
+<sysroot><libdir>/<target-sys>/5.2.0/
+which is a default search path for GCC (aka multi_suffix in the 
+code below). <target-sys> is 'machine' in gcc's terminology. We use
+these directories so that multiple gcc versions could in theory 
+co-exist on target.
+
+We only want to build one gcc-cross-canadian per arch and have this work 
+for all multilibs. <target-sys> can be handled by mapping the multilib
+<target-sys> to the one used by gcc-cross-canadian, e.g. mips64-polkmllib32-linux 
+is symlinked to by mips64-poky-linux.
+
+The default gcc search path in the target sysroot for a "lib64" mutlilib is:
+
+<sysroot>/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/../lib64/
+<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/../lib64/
+<sysroot>/lib32/
+<sysroot>/usr/lib32/
+
+which means that the lib32 crtbegin.o will be found and the lib64 ones
+will not which leads to compiler failures.
+
+This patch injects a multilib version of that path first so the lib64
+binaries can be found first. With this change the search path becomes:
+
+<sysroot>/lib32/../lib64/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/../lib64/
+<sysroot>/usr/lib32/../lib64/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/../lib64/
+<sysroot>/lib32/
+<sysroot>/usr/lib32/
+
+Upstream-Status: Pending
+RP 2015/7/31
+
+Index: gcc-5.2.0/gcc/gcc.c
+===================================================================
+--- gcc-5.2.0.orig/gcc/gcc.c
++++ gcc-5.2.0/gcc/gcc.c
+@@ -2305,7 +2305,7 @@ for_each_path (const struct path_prefix
+       if (path == NULL)
+ 	{
+ 	  len = paths->max_len + extra_space + 1;
+-	  len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len);
++	  len += MAX ((suffix_len + multi_os_dir_len), multiarch_len);
+ 	  path = XNEWVEC (char, len);
+ 	}
+ 
+@@ -2317,6 +2317,33 @@ for_each_path (const struct path_prefix
+ 	  /* Look first in MACHINE/VERSION subdirectory.  */
+ 	  if (!skip_multi_dir)
+ 	    {
++	      if (!(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
++	        {
++	          const char *this_multi;
++	          size_t this_multi_len;
++
++	          if (pl->os_multilib)
++		    {
++		      this_multi = multi_os_dir;
++		      this_multi_len = multi_os_dir_len;
++		    }
++	          else
++		    {
++		      this_multi = multi_dir;
++		      this_multi_len = multi_dir_len;
++		    }
++
++	          /* Look in multilib MACHINE/VERSION subdirectory first */
++	          if (this_multi_len)
++	            {
++		      memcpy (path + len, this_multi, this_multi_len + 1);
++	              memcpy (path + len + this_multi_len, multi_suffix, suffix_len + 1);
++	              ret = callback (path, callback_info);
++	                if (ret)
++		          break;
++	            }
++	        }
++
+ 	      memcpy (path + len, multi_suffix, suffix_len + 1);
+ 	      ret = callback (path, callback_info);
+ 	      if (ret)
diff --git a/meta/recipes-devtools/gcc/gcc-5.2.inc b/meta/recipes-devtools/gcc/gcc-5.2.inc
new file mode 100644
index 0000000..f691f58
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2.inc
@@ -0,0 +1,120 @@
+require gcc-common.inc
+
+# Third digit in PV should be incremented after a minor release
+
+PV = "5.2.0"
+
+#SNAP = "5-20150405"
+
+# BINV should be incremented to a revision after a minor gcc release
+
+BINV = "5.2.0"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/gcc-5.2:${FILE_DIRNAME}/gcc-5.2/backport:"
+
+DEPENDS =+ "mpfr gmp libmpc zlib"
+NATIVEDEPS = "mpfr-native gmp-native libmpc-native zlib-native"
+
+LICENSE = "GPL-3.0-with-GCC-exception & GPLv3"
+
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+    file://COPYING.RUNTIME;md5=fe60d87048567d4fe8c8a0ed2448bcc8 \
+"
+#BASEURI = "http://www.netgull.com/gcc/snapshots/${SNAP}/gcc-${SNAP}.tar.bz2"
+BASEURI = "${GNU_MIRROR}/gcc/gcc-${PV}/gcc-${PV}.tar.bz2"
+SRC_URI[md5sum] = "a51bcfeb3da7dd4c623e27207ed43467"
+SRC_URI[sha256sum] = "5f835b04b5f7dd4f4d2dc96190ec1621b8d89f2dc6f638f9f8bc1b1014ba8cad"
+
+SRC_URI = "\
+           ${BASEURI} \
+           ${BACKPORTS} \
+           file://0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch \
+           file://0002-uclibc-conf.patch \
+           file://0003-gcc-uclibc-locale-ctype_touplow_t.patch \
+           file://0004-uclibc-locale.patch \
+           file://0005-uclibc-locale-no__x.patch \
+           file://0006-uclibc-locale-wchar_fix.patch \
+           file://0007-uclibc-locale-update.patch \
+           file://0008-missing-execinfo_h.patch \
+           file://0009-c99-snprintf.patch \
+           file://0010-gcc-poison-system-directories.patch \
+           file://0011-gcc-poison-dir-extend.patch \
+           file://0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch \
+           file://0013-64-bit-multilib-hack.patch \
+           file://0014-optional-libstdc.patch \
+           file://0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch \
+           file://0016-COLLECT_GCC_OPTIONS.patch \
+           file://0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch \
+           file://0018-fortran-cross-compile-hack.patch \
+           file://0019-libgcc-sjlj-check.patch \
+           file://0020-cpp-honor-sysroot.patch \
+           file://0021-MIPS64-Default-to-N64-ABI.patch \
+           file://0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch \
+           file://0023-gcc-Fix-argument-list-too-long-error.patch \
+           file://0024-Disable-sdt.patch \
+           file://0025-libtool.patch \
+           file://0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch \
+           file://0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch \
+           file://0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch \
+           file://0029-export-CPP.patch \
+           file://0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch \
+           file://0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch \
+           file://0032-Ensure-target-gcc-headers-can-be-included.patch \
+           file://0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch \
+           file://0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch \
+           file://0035-Dont-link-the-plugins-with-libgomp-explicitly.patch \
+           file://0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch \
+           file://0037-pr65779.patch \
+           file://0038-fix-g++-sysroot.patch \
+           file://0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch \
+           file://0040-nativesdk-gcc-support.patch \
+           file://0041-handle-target-sysroot-multilib.patch \
+          "
+
+BACKPORTS = ""
+#S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${SNAP}"
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+# Language Overrides
+FORTRAN = ""
+JAVA = ""
+
+LTO = "--enable-lto"
+
+EXTRA_OECONF_BASE = "\
+    ${LTO} \
+    --enable-libssp \
+    --disable-bootstrap \
+    --disable-libmudflap \
+    --with-system-zlib \
+    --with-linker-hash-style=${LINKER_HASH_STYLE} \
+    --enable-linker-build-id \
+    --with-ppl=no \
+    --with-cloog=no \
+    --enable-checking=release \
+    --enable-cheaders=c_global \
+"
+
+EXTRA_OECONF_INITIAL = "\
+    --disable-libmudflap \
+    --disable-libgomp \
+    --disable-libssp \
+    --disable-libquadmath \
+    --with-system-zlib \
+    --disable-lto \
+    --disable-plugin \
+    --enable-decimal-float=no \
+"
+
+EXTRA_OECONF_append_libc-uclibc = " --disable-decimal-float "
+
+EXTRA_OECONF_PATHS = "\
+    --with-gxx-include-dir=/not/exist{target_includedir}/c++/${BINV} \
+    --with-sysroot=/not/exist \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-5.2/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000..2c766f4
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0001-gcc-4.3.1-ARCH_FLAGS_FOR_TARGET.patch
@@ -0,0 +1,42 @@
+From a0fee0cee3d4bd4aab1e3a8e04446f99d918c4ff Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:37:11 +0400
+Subject: [PATCH 01/35] gcc-4.3.1: ARCH_FLAGS_FOR_TARGET
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ configure    | 2 +-
+ configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 7616f88..50e7cbc 100755
+--- a/configure
++++ b/configure
+@@ -7464,7 +7464,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+ 
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+  *" newlib "*)
+   case " $target_configargs " in
+diff --git a/configure.ac b/configure.ac
+index 8c85a08..f34af7e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3104,7 +3104,7 @@ fi
+ # for target_alias and gcc doesn't manage it consistently.
+ target_configargs="--cache-file=./config.cache ${target_configargs}"
+ 
+-FLAGS_FOR_TARGET=
++FLAGS_FOR_TARGET="$ARCH_FLAGS_FOR_TARGET"
+ case " $target_configdirs " in
+  *" newlib "*)
+   case " $target_configargs " in
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0002-uclibc-conf.patch b/meta/recipes-devtools/gcc/gcc-5.2/0002-uclibc-conf.patch
new file mode 100644
index 0000000..69d33a0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0002-uclibc-conf.patch
@@ -0,0 +1,53 @@
+From 7635248a4c9b51d723d721acaeeb5f2f11957987 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:38:25 +0400
+Subject: [PATCH 02/35] uclibc-conf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ contrib/regression/objs-gcc.sh | 4 ++++
+ libjava/classpath/ltconfig     | 4 ++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/contrib/regression/objs-gcc.sh b/contrib/regression/objs-gcc.sh
+index 60b0497..6dc7ead 100755
+--- a/contrib/regression/objs-gcc.sh
++++ b/contrib/regression/objs-gcc.sh
+@@ -106,6 +106,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-gnu ]
+  then
+   make all-gdb all-dejagnu all-ld || exit 1
+   make install-gdb install-dejagnu install-ld || exit 1
++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
++ then
++  make all-gdb all-dejagnu all-ld || exit 1
++  make install-gdb install-dejagnu install-ld || exit 1
+ elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
+   make bootstrap || exit 1
+   make install || exit 1
+diff --git a/libjava/classpath/ltconfig b/libjava/classpath/ltconfig
+index 743d951..ae4ea60 100755
+--- a/libjava/classpath/ltconfig
++++ b/libjava/classpath/ltconfig
+@@ -603,7 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ 
+ # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
+ case $host_os in
+-linux-gnu*) ;;
++linux-gnu*|linux-uclibc*) ;;
+ linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
+ esac
+ 
+@@ -1247,7 +1247,7 @@ linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
+   ;;
+ 
+ # This must be Linux ELF.
+-linux-gnu*)
++linux*)
+   version_type=linux
+   need_lib_prefix=no
+   need_version=no
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0003-gcc-uclibc-locale-ctype_touplow_t.patch b/meta/recipes-devtools/gcc/gcc-5.2/0003-gcc-uclibc-locale-ctype_touplow_t.patch
new file mode 100644
index 0000000..bca254d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0003-gcc-uclibc-locale-ctype_touplow_t.patch
@@ -0,0 +1,87 @@
+From 3aee58ad043af33ab00c9cd7bc88f0cade83f236 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:40:12 +0400
+Subject: [PATCH 03/35] gcc-uclibc-locale-ctype_touplow_t
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/generic/c_locale.cc | 5 +++++
+ libstdc++-v3/config/locale/generic/c_locale.h  | 9 +++++++++
+ libstdc++-v3/config/os/gnu-linux/ctype_base.h  | 9 +++++++++
+ 3 files changed, 23 insertions(+)
+
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
+index 6da5f22..2f85c2f 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.cc
++++ b/libstdc++-v3/config/locale/generic/c_locale.cc
+@@ -263,5 +263,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
+ #ifdef _GLIBCXX_LONG_DOUBLE_COMPAT
+ #define _GLIBCXX_LDBL_COMPAT(dbl, ldbl) \
+   extern "C" void ldbl (void) __attribute__ ((alias (#dbl)))
++#ifdef __UCLIBC__
++// This is because __c_locale is of type __ctype_touplow_t* which is short on uclibc. for glibc its int*
++_GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPs, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPs);
++#else
+ _GLIBCXX_LDBL_COMPAT(_ZSt14__convert_to_vIdEvPKcRT_RSt12_Ios_IostateRKPi, _ZSt14__convert_to_vIeEvPKcRT_RSt12_Ios_IostateRKPi);
++#endif
+ #endif // _GLIBCXX_LONG_DOUBLE_COMPAT
+diff --git a/libstdc++-v3/config/locale/generic/c_locale.h b/libstdc++-v3/config/locale/generic/c_locale.h
+index ee3ef86..7fd5485 100644
+--- a/libstdc++-v3/config/locale/generic/c_locale.h
++++ b/libstdc++-v3/config/locale/generic/c_locale.h
+@@ -40,13 +40,22 @@
+ 
+ #include <clocale>
+ 
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ #define _GLIBCXX_NUM_CATEGORIES 0
+ 
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+ 
++#ifdef __UCLIBC__
++  typedef __ctype_touplow_t*	__c_locale;
++#else
+   typedef int*			__c_locale;
++#endif
+ 
+   // Convert numeric value of type double and long double to string and
+   // return length of string.  If vsnprintf is available use it, otherwise
+diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+index fd52b73..2627cf3 100644
+--- a/libstdc++-v3/config/os/gnu-linux/ctype_base.h
++++ b/libstdc++-v3/config/os/gnu-linux/ctype_base.h
+@@ -33,6 +33,11 @@
+ 
+ // Information as gleaned from /usr/include/ctype.h
+ 
++#ifdef __UCLIBC__
++#include <features.h>
++#include <ctype.h>
++#endif
++
+ namespace std _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -41,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+   struct ctype_base
+   {
+     // Non-standard typedefs.
++#ifdef __UCLIBC__
++    typedef const __ctype_touplow_t*	__to_type;
++#else
+     typedef const int* 		__to_type;
++#endif
+ 
+     // NB: Offsets into ctype<char>::_M_table force a particular size
+     // on the mask type. Because of this, we don't use an enum.
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0004-uclibc-locale.patch b/meta/recipes-devtools/gcc/gcc-5.2/0004-uclibc-locale.patch
new file mode 100644
index 0000000..03947a7
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0004-uclibc-locale.patch
@@ -0,0 +1,2862 @@
+From 9f73e06315c94629fb902bd94219667cf8307b8f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:41:39 +0400
+Subject: [PATCH 04/35] uclibc-locale
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/acinclude.m4                          |  37 ++
+ .../config/locale/uclibc/c++locale_internal.h      |  63 ++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc      | 160 +++++
+ libstdc++-v3/config/locale/uclibc/c_locale.h       | 117 ++++
+ .../config/locale/uclibc/codecvt_members.cc        | 308 +++++++++
+ .../config/locale/uclibc/collate_members.cc        |  80 +++
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 300 +++++++++
+ .../config/locale/uclibc/messages_members.cc       | 100 +++
+ .../config/locale/uclibc/messages_members.h        | 118 ++++
+ .../config/locale/uclibc/monetary_members.cc       | 692 +++++++++++++++++++++
+ .../config/locale/uclibc/numeric_members.cc        | 160 +++++
+ libstdc++-v3/config/locale/uclibc/time_members.cc  | 406 ++++++++++++
+ libstdc++-v3/config/locale/uclibc/time_members.h   |  68 ++
+ libstdc++-v3/configure                             |  75 +++
+ libstdc++-v3/include/c_compatibility/wchar.h       |   2 +
+ libstdc++-v3/include/c_std/cwchar                  |   2 +
+ 16 files changed, 2688 insertions(+)
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/c_locale.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/collate_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/ctype_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/messages_members.h
+ create mode 100644 libstdc++-v3/config/locale/uclibc/monetary_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/numeric_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.cc
+ create mode 100644 libstdc++-v3/config/locale/uclibc/time_members.h
+
+diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
+index a1e301f..0fe9326 100644
+--- a/libstdc++-v3/acinclude.m4
++++ b/libstdc++-v3/acinclude.m4
+@@ -1983,6 +1983,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+   # Default to "generic".
+   if test $enable_clocale_flag = auto; then
+     case ${target_os} in
++      *-uclibc*)
++        enable_clocale_flag=uclibc
++        ;;
+       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ 	enable_clocale_flag=gnu
+ 	;;
+@@ -2167,6 +2170,40 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
+       CTIME_CC=config/locale/generic/time_members.cc
+       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+       ;;
++    uclibc)
++      AC_MSG_RESULT(uclibc)
++
++      # Declare intention to use gettext, and add support for specific
++      # languages.
++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++      ALL_LINGUAS="de fr"
++
++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++        USE_NLS=yes
++      fi
++      # Export the build objects.
++      for ling in $ALL_LINGUAS; do \
++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++      done
++      AC_SUBST(glibcxx_MOFILES)
++      AC_SUBST(glibcxx_POFILES)
++
++      CLOCALE_H=config/locale/uclibc/c_locale.h
++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++      CMESSAGES_H=config/locale/uclibc/messages_members.h
++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++      CTIME_H=config/locale/uclibc/time_members.h
++      CTIME_CC=config/locale/uclibc/time_members.cc
++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++      ;;
+   esac
+ 
+   # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+new file mode 100644
+index 0000000..2ae3e4a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -0,0 +1,63 @@
++// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
++
++// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++// Written by Jakub Jelinek <jakub@redhat.com>
++
++#include <bits/c++config.h>
++#include <clocale>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning clean this up
++#endif
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++
++extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
++extern "C" __typeof(strcoll_l) __strcoll_l;
++extern "C" __typeof(strftime_l) __strftime_l;
++extern "C" __typeof(strtod_l) __strtod_l;
++extern "C" __typeof(strtof_l) __strtof_l;
++extern "C" __typeof(strtold_l) __strtold_l;
++extern "C" __typeof(strxfrm_l) __strxfrm_l;
++extern "C" __typeof(newlocale) __newlocale;
++extern "C" __typeof(freelocale) __freelocale;
++extern "C" __typeof(duplocale) __duplocale;
++extern "C" __typeof(uselocale) __uselocale;
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++extern "C" __typeof(iswctype_l) __iswctype_l;
++extern "C" __typeof(towlower_l) __towlower_l;
++extern "C" __typeof(towupper_l) __towupper_l;
++extern "C" __typeof(wcscoll_l) __wcscoll_l;
++extern "C" __typeof(wcsftime_l) __wcsftime_l;
++extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
++extern "C" __typeof(wctype_l) __wctype_l;
++#endif
++
++#endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+new file mode 100644
+index 0000000..5081dc1
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -0,0 +1,160 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8  Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <cerrno>  // For errno
++#include <locale>
++#include <stdexcept>
++#include <langinfo.h>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
++#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
++#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
++#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
++#define __strtof_l(S, E, L)         strtof((S), (E))
++#define __strtod_l(S, E, L)         strtod((S), (E))
++#define __strtold_l(S, E, L)        strtold((S), (E))
++#warning should dummy __newlocale check for C|POSIX ?
++#define __newlocale(a, b, c)        NULL
++#define __freelocale(a)             ((void)0)
++#define __duplocale(a)              __c_locale()
++#endif
++
++namespace std
++{
++  template<>
++    void
++    __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
++		   const __c_locale& __cloc)
++    {
++      if (!(__err & ios_base::failbit))
++	{
++	  char* __sanity;
++	  errno = 0;
++	  float __f = __strtof_l(__s, &__sanity, __cloc);
++          if (__sanity != __s && errno != ERANGE)
++	    __v = __f;
++	  else
++	    __err |= ios_base::failbit;
++	}
++    }
++
++  template<>
++    void
++    __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
++		   const __c_locale& __cloc)
++    {
++      if (!(__err & ios_base::failbit))
++	{
++	  char* __sanity;
++	  errno = 0;
++	  double __d = __strtod_l(__s, &__sanity, __cloc);
++          if (__sanity != __s && errno != ERANGE)
++	    __v = __d;
++	  else
++	    __err |= ios_base::failbit;
++	}
++    }
++
++  template<>
++    void
++    __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
++		   const __c_locale& __cloc)
++    {
++      if (!(__err & ios_base::failbit))
++	{
++	  char* __sanity;
++	  errno = 0;
++	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
++          if (__sanity != __s && errno != ERANGE)
++	    __v = __ld;
++	  else
++	    __err |= ios_base::failbit;
++	}
++    }
++
++  void
++  locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
++				    __c_locale __old)
++  {
++    __cloc = __newlocale(1 << LC_ALL, __s, __old);
++#ifdef __UCLIBC_HAS_XLOCALE__
++    if (!__cloc)
++      {
++	// This named locale is not supported by the underlying OS.
++	__throw_runtime_error(__N("locale::facet::_S_create_c_locale "
++			      "name not valid"));
++      }
++#endif
++  }
++
++  void
++  locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
++  {
++    if (_S_get_c_locale() != __cloc)
++      __freelocale(__cloc);
++  }
++
++  __c_locale
++  locale::facet::_S_clone_c_locale(__c_locale& __cloc)
++  { return __duplocale(__cloc); }
++} // namespace std
++
++namespace __gnu_cxx
++{
++  const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
++    {
++      "LC_CTYPE",
++      "LC_NUMERIC",
++      "LC_TIME",
++      "LC_COLLATE",
++      "LC_MONETARY",
++      "LC_MESSAGES",
++#if _GLIBCXX_NUM_CATEGORIES != 0
++      "LC_PAPER",
++      "LC_NAME",
++      "LC_ADDRESS",
++      "LC_TELEPHONE",
++      "LC_MEASUREMENT",
++      "LC_IDENTIFICATION"
++#endif
++    };
++}
++
++namespace std
++{
++  const char* const* const locale::_S_categories = __gnu_cxx::category_names;
++}  // namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+new file mode 100644
+index 0000000..da07c1f
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -0,0 +1,117 @@
++// Wrapper for underlying C-language localization -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.8  Standard locale categories.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifndef _C_LOCALE_H
++#define _C_LOCALE_H 1
++
++#pragma GCC system_header
++
++#include <cstring>              // get std::strlen
++#include <cstdio>               // get std::snprintf or std::sprintf
++#include <clocale>
++#include <langinfo.h>		// For codecvt
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this
++#endif
++#ifdef __UCLIBC_HAS_LOCALE__
++#include <iconv.h>		// For codecvt using iconv, iconv_t
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#include <libintl.h> 		// For messages
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning what is _GLIBCXX_C_LOCALE_GNU for
++#endif
++#define _GLIBCXX_C_LOCALE_GNU 1
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix categories
++#endif
++// #define _GLIBCXX_NUM_CATEGORIES 6
++#define _GLIBCXX_NUM_CATEGORIES 0
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++namespace __gnu_cxx
++{
++  extern "C" __typeof(uselocale) __uselocale;
++}
++#endif
++
++namespace std
++{
++#ifdef __UCLIBC_HAS_XLOCALE__
++  typedef __locale_t		__c_locale;
++#else
++  typedef int*			__c_locale;
++#endif
++
++  // Convert numeric value of type _Tv to string and return length of
++  // string.  If snprintf is available use it, otherwise fall back to
++  // the unsafe sprintf which, in general, can be dangerous and should
++  // be avoided.
++  template<typename _Tv>
++    int
++    __convert_from_v(char* __out,
++		     const int __size __attribute__ ((__unused__)),
++		     const char* __fmt,
++#ifdef __UCLIBC_HAS_XCLOCALE__
++		     _Tv __v, const __c_locale& __cloc, int __prec)
++    {
++      __c_locale __old = __gnu_cxx::__uselocale(__cloc);
++#else
++		     _Tv __v, const __c_locale&, int __prec)
++    {
++# ifdef __UCLIBC_HAS_LOCALE__
++      char* __old = std::setlocale(LC_ALL, NULL);
++      char* __sav = new char[std::strlen(__old) + 1];
++      std::strcpy(__sav, __old);
++      std::setlocale(LC_ALL, "C");
++# endif
++#endif
++
++      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++
++#ifdef __UCLIBC_HAS_XCLOCALE__
++      __gnu_cxx::__uselocale(__old);
++#elif defined __UCLIBC_HAS_LOCALE__
++      std::setlocale(LC_ALL, __sav);
++      delete [] __sav;
++#endif
++      return __ret;
++    }
++}
++
++#endif
+diff --git a/libstdc++-v3/config/locale/uclibc/codecvt_members.cc b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+new file mode 100644
+index 0000000..64aa962
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
+@@ -0,0 +1,308 @@
++// std::codecvt implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.5 - Template class codecvt
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <cstdlib>  // For MB_CUR_MAX
++#include <climits>  // For MB_LEN_MAX
++#include <bits/c++locale_internal.h>
++
++namespace std
++{
++  // Specializations.
++#ifdef _GLIBCXX_USE_WCHAR_T
++  codecvt_base::result
++  codecvt<wchar_t, char, mbstate_t>::
++  do_out(state_type& __state, const intern_type* __from,
++	 const intern_type* __from_end, const intern_type*& __from_next,
++	 extern_type* __to, extern_type* __to_end,
++	 extern_type*& __to_next) const
++  {
++    result __ret = ok;
++    state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++    // wcsnrtombs is *very* fast but stops if encounters NUL characters:
++    // in case we fall back to wcrtomb and then continue, in a loop.
++    // NB: wcsnrtombs is a GNU extension
++    for (__from_next = __from, __to_next = __to;
++	 __from_next < __from_end && __to_next < __to_end
++	 && __ret == ok;)
++      {
++	const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
++						      __from_end - __from_next);
++	if (!__from_chunk_end)
++	  __from_chunk_end = __from_end;
++
++	__from = __from_next;
++	const size_t __conv = wcsnrtombs(__to_next, &__from_next,
++					 __from_chunk_end - __from_next,
++					 __to_end - __to_next, &__state);
++	if (__conv == static_cast<size_t>(-1))
++	  {
++	    // In case of error, in order to stop at the exact place we
++	    // have to start again from the beginning with a series of
++	    // wcrtomb.
++	    for (; __from < __from_next; ++__from)
++	      __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
++	    __state = __tmp_state;
++	    __ret = error;
++	  }
++	else if (__from_next && __from_next < __from_chunk_end)
++	  {
++	    __to_next += __conv;
++	    __ret = partial;
++	  }
++	else
++	  {
++	    __from_next = __from_chunk_end;
++	    __to_next += __conv;
++	  }
++
++	if (__from_next < __from_end && __ret == ok)
++	  {
++	    extern_type __buf[MB_LEN_MAX];
++	    __tmp_state = __state;
++	    const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
++	    if (__conv > static_cast<size_t>(__to_end - __to_next))
++	      __ret = partial;
++	    else
++	      {
++		memcpy(__to_next, __buf, __conv);
++		__state = __tmp_state;
++		__to_next += __conv;
++		++__from_next;
++	      }
++	  }
++      }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++
++    return __ret;
++  }
++
++  codecvt_base::result
++  codecvt<wchar_t, char, mbstate_t>::
++  do_in(state_type& __state, const extern_type* __from,
++	const extern_type* __from_end, const extern_type*& __from_next,
++	intern_type* __to, intern_type* __to_end,
++	intern_type*& __to_next) const
++  {
++    result __ret = ok;
++    state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++    // in case we store a L'\0' and then continue, in a loop.
++    // NB: mbsnrtowcs is a GNU extension
++    for (__from_next = __from, __to_next = __to;
++	 __from_next < __from_end && __to_next < __to_end
++	 && __ret == ok;)
++      {
++	const extern_type* __from_chunk_end;
++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
++								  __from_end
++								  - __from_next));
++	if (!__from_chunk_end)
++	  __from_chunk_end = __from_end;
++
++	__from = __from_next;
++	size_t __conv = mbsnrtowcs(__to_next, &__from_next,
++				   __from_chunk_end - __from_next,
++				   __to_end - __to_next, &__state);
++	if (__conv == static_cast<size_t>(-1))
++	  {
++	    // In case of error, in order to stop at the exact place we
++	    // have to start again from the beginning with a series of
++	    // mbrtowc.
++	    for (;; ++__to_next, __from += __conv)
++	      {
++		__conv = mbrtowc(__to_next, __from, __from_end - __from,
++				 &__tmp_state);
++		if (__conv == static_cast<size_t>(-1)
++		    || __conv == static_cast<size_t>(-2))
++		  break;
++	      }
++	    __from_next = __from;
++	    __state = __tmp_state;
++	    __ret = error;
++	  }
++	else if (__from_next && __from_next < __from_chunk_end)
++	  {
++	    // It is unclear what to return in this case (see DR 382).
++	    __to_next += __conv;
++	    __ret = partial;
++	  }
++	else
++	  {
++	    __from_next = __from_chunk_end;
++	    __to_next += __conv;
++	  }
++
++	if (__from_next < __from_end && __ret == ok)
++	  {
++	    if (__to_next < __to_end)
++	      {
++		// XXX Probably wrong for stateful encodings
++		__tmp_state = __state;
++		++__from_next;
++		*__to_next++ = L'\0';
++	      }
++	    else
++	      __ret = partial;
++	  }
++      }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++
++    return __ret;
++  }
++
++  int
++  codecvt<wchar_t, char, mbstate_t>::
++  do_encoding() const throw()
++  {
++    // XXX This implementation assumes that the encoding is
++    // stateless and is either single-byte or variable-width.
++    int __ret = 0;
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++    if (MB_CUR_MAX == 1)
++      __ret = 1;
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return __ret;
++  }
++
++  int
++  codecvt<wchar_t, char, mbstate_t>::
++  do_max_length() const throw()
++  {
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++    // XXX Probably wrong for stateful encodings.
++    int __ret = MB_CUR_MAX;
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return __ret;
++  }
++
++  int
++  codecvt<wchar_t, char, mbstate_t>::
++  do_length(state_type& __state, const extern_type* __from,
++	    const extern_type* __end, size_t __max) const
++  {
++    int __ret = 0;
++    state_type __tmp_state(__state);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_codecvt);
++#endif
++
++    // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
++    // in case we advance past it and then continue, in a loop.
++    // NB: mbsnrtowcs is a GNU extension
++
++    // A dummy internal buffer is needed in order for mbsnrtocws to consider
++    // its fourth parameter (it wouldn't with NULL as first parameter).
++    wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
++							   * __max));
++    while (__from < __end && __max)
++      {
++	const extern_type* __from_chunk_end;
++	__from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
++								  __end
++								  - __from));
++	if (!__from_chunk_end)
++	  __from_chunk_end = __end;
++
++	const extern_type* __tmp_from = __from;
++	size_t __conv = mbsnrtowcs(__to, &__from,
++				   __from_chunk_end - __from,
++				   __max, &__state);
++	if (__conv == static_cast<size_t>(-1))
++	  {
++	    // In case of error, in order to stop at the exact place we
++	    // have to start again from the beginning with a series of
++	    // mbrtowc.
++	    for (__from = __tmp_from;; __from += __conv)
++	      {
++		__conv = mbrtowc(NULL, __from, __end - __from,
++				 &__tmp_state);
++		if (__conv == static_cast<size_t>(-1)
++		    || __conv == static_cast<size_t>(-2))
++		  break;
++	      }
++	    __state = __tmp_state;
++	    __ret += __from - __tmp_from;
++	    break;
++	  }
++	if (!__from)
++	  __from = __from_chunk_end;
++
++	__ret += __from - __tmp_from;
++	__max -= __conv;
++
++	if (__from < __end && __max)
++	  {
++	    // XXX Probably wrong for stateful encodings
++	    __tmp_state = __state;
++	    ++__from;
++	    ++__ret;
++	    --__max;
++	  }
++      }
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++
++    return __ret;
++  }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+new file mode 100644
+index 0000000..c2664a7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -0,0 +1,80 @@
++// std::collate implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.4.1.2  collate virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
++#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
++#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
++#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
++#endif
++
++namespace std
++{
++  // These are basically extensions to char_traits, and perhaps should
++  // be put there instead of here.
++  template<>
++    int
++    collate<char>::_M_compare(const char* __one, const char* __two) const
++    {
++      int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++    }
++
++  template<>
++    size_t
++    collate<char>::_M_transform(char* __to, const char* __from,
++				size_t __n) const
++    { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    int
++    collate<wchar_t>::_M_compare(const wchar_t* __one,
++				 const wchar_t* __two) const
++    {
++      int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
++      return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
++    }
++
++  template<>
++    size_t
++    collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
++				   size_t __n) const
++    { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+new file mode 100644
+index 0000000..7294e3a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -0,0 +1,300 @@
++// std::ctype implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.1.1.2  ctype virtual functions.
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __wctype_l(S, L)           wctype((S))
++#define __towupper_l(C, L)         towupper((C))
++#define __towlower_l(C, L)         towlower((C))
++#define __iswctype_l(C, M, L)      iswctype((C), (M))
++#endif
++
++namespace std
++{
++  // NB: The other ctype<char> specializations are in src/locale.cc and
++  // various /config/os/* files.
++  template<>
++    ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
++    : ctype<char>(0, false, __refs)
++    {
++      if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++	{
++	  this->_S_destroy_c_locale(this->_M_c_locale_ctype);
++	  this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
++	  this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
++	  this->_M_table = this->_M_c_locale_ctype->__ctype_b;
++#endif
++	}
++    }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  ctype<wchar_t>::__wmask_type
++  ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
++  {
++    __wmask_type __ret;
++    switch (__m)
++      {
++      case space:
++	__ret = __wctype_l("space", _M_c_locale_ctype);
++	break;
++      case print:
++	__ret = __wctype_l("print", _M_c_locale_ctype);
++	break;
++      case cntrl:
++	__ret = __wctype_l("cntrl", _M_c_locale_ctype);
++	break;
++      case upper:
++	__ret = __wctype_l("upper", _M_c_locale_ctype);
++	break;
++      case lower:
++	__ret = __wctype_l("lower", _M_c_locale_ctype);
++	break;
++      case alpha:
++	__ret = __wctype_l("alpha", _M_c_locale_ctype);
++	break;
++      case digit:
++	__ret = __wctype_l("digit", _M_c_locale_ctype);
++	break;
++      case punct:
++	__ret = __wctype_l("punct", _M_c_locale_ctype);
++	break;
++      case xdigit:
++	__ret = __wctype_l("xdigit", _M_c_locale_ctype);
++	break;
++      case alnum:
++	__ret = __wctype_l("alnum", _M_c_locale_ctype);
++	break;
++      case graph:
++	__ret = __wctype_l("graph", _M_c_locale_ctype);
++	break;
++      default:
++	__ret = __wmask_type();
++      }
++    return __ret;
++  }
++
++  wchar_t
++  ctype<wchar_t>::do_toupper(wchar_t __c) const
++  { return __towupper_l(__c, _M_c_locale_ctype); }
++
++  const wchar_t*
++  ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
++  {
++    while (__lo < __hi)
++      {
++        *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
++        ++__lo;
++      }
++    return __hi;
++  }
++
++  wchar_t
++  ctype<wchar_t>::do_tolower(wchar_t __c) const
++  { return __towlower_l(__c, _M_c_locale_ctype); }
++
++  const wchar_t*
++  ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
++  {
++    while (__lo < __hi)
++      {
++        *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
++        ++__lo;
++      }
++    return __hi;
++  }
++
++  bool
++  ctype<wchar_t>::
++  do_is(mask __m, wchar_t __c) const
++  {
++    // Highest bitmask in ctype_base == 10, but extra in "C"
++    // library for blank.
++    bool __ret = false;
++    const size_t __bitmasksize = 11;
++    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++      if (__m & _M_bit[__bitcur]
++	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++	{
++	  __ret = true;
++	  break;
++	}
++    return __ret;
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
++  {
++    for (; __lo < __hi; ++__vec, ++__lo)
++      {
++	// Highest bitmask in ctype_base == 10, but extra in "C"
++	// library for blank.
++	const size_t __bitmasksize = 11;
++	mask __m = 0;
++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++	  if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
++	    __m |= _M_bit[__bitcur];
++	*__vec = __m;
++      }
++    return __hi;
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
++  {
++    while (__lo < __hi && !this->do_is(__m, *__lo))
++      ++__lo;
++    return __lo;
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
++  {
++    while (__lo < __hi && this->do_is(__m, *__lo) != 0)
++      ++__lo;
++    return __lo;
++  }
++
++  wchar_t
++  ctype<wchar_t>::
++  do_widen(char __c) const
++  { return _M_widen[static_cast<unsigned char>(__c)]; }
++
++  const char*
++  ctype<wchar_t>::
++  do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
++  {
++    while (__lo < __hi)
++      {
++	*__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++	++__lo;
++	++__dest;
++      }
++    return __hi;
++  }
++
++  char
++  ctype<wchar_t>::
++  do_narrow(wchar_t __wc, char __dfault) const
++  {
++    if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
++      return _M_narrow[__wc];
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++    const int __c = wctob(__wc);
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return (__c == EOF ? __dfault : static_cast<char>(__c));
++  }
++
++  const wchar_t*
++  ctype<wchar_t>::
++  do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
++	    char* __dest) const
++  {
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++    if (_M_narrow_ok)
++      while (__lo < __hi)
++	{
++	  if (*__lo >= 0 && *__lo < 128)
++	    *__dest = _M_narrow[*__lo];
++	  else
++	    {
++	      const int __c = wctob(*__lo);
++	      *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++	    }
++	  ++__lo;
++	  ++__dest;
++	}
++    else
++      while (__lo < __hi)
++	{
++	  const int __c = wctob(*__lo);
++	  *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
++	  ++__lo;
++	  ++__dest;
++	}
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++    return __hi;
++  }
++
++  void
++  ctype<wchar_t>::_M_initialize_ctype()
++  {
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __c_locale __old = __uselocale(_M_c_locale_ctype);
++#endif
++    wint_t __i;
++    for (__i = 0; __i < 128; ++__i)
++      {
++	const int __c = wctob(__i);
++	if (__c == EOF)
++	  break;
++	else
++	  _M_narrow[__i] = static_cast<char>(__c);
++      }
++    if (__i == 128)
++      _M_narrow_ok = true;
++    else
++      _M_narrow_ok = false;
++    for (size_t __j = 0;
++	 __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
++      _M_widen[__j] = btowc(__j);
++
++    for (size_t __k = 0; __k <= 11; ++__k)
++      {
++	_M_bit[__k] = static_cast<mask>(_ISbit(__k));
++	_M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
++      }
++#ifdef __UCLIBC_HAS_XLOCALE__
++    __uselocale(__old);
++#endif
++  }
++#endif //  _GLIBCXX_USE_WCHAR_T
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+new file mode 100644
+index 0000000..13594d9
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -0,0 +1,100 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2  messages virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix gettext stuff
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__dcgettext(const char *domainname,
++			     const char *msgid, int category);
++#undef gettext
++#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#else
++#undef gettext
++#define gettext(msgid) (msgid)
++#endif
++
++namespace std
++{
++  // Specializations.
++  template<>
++    string
++    messages<char>::do_get(catalog, int, int, const string& __dfault) const
++    {
++#ifdef __UCLIBC_HAS_XLOCALE__
++      __c_locale __old = __uselocale(_M_c_locale_messages);
++      const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
++      __uselocale(__old);
++      return string(__msg);
++#elif defined __UCLIBC_HAS_LOCALE__
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_messages);
++      const char* __msg = gettext(__dfault.c_str());
++      setlocale(LC_ALL, __old);
++      free(__old);
++      return string(__msg);
++#else
++      const char* __msg = gettext(__dfault.c_str());
++      return string(__msg);
++#endif
++    }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    wstring
++    messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
++    {
++# ifdef __UCLIBC_HAS_XLOCALE__
++      __c_locale __old = __uselocale(_M_c_locale_messages);
++      char* __msg = gettext(_M_convert_to_char(__dfault));
++      __uselocale(__old);
++      return _M_convert_from_char(__msg);
++# elif defined __UCLIBC_HAS_LOCALE__
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_messages);
++      char* __msg = gettext(_M_convert_to_char(__dfault));
++      setlocale(LC_ALL, __old);
++      free(__old);
++      return _M_convert_from_char(__msg);
++# else
++      char* __msg = gettext(_M_convert_to_char(__dfault));
++      return _M_convert_from_char(__msg);
++# endif
++    }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+new file mode 100644
+index 0000000..1424078
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -0,0 +1,118 @@
++// std::messages implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.7.1.2  messages functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix prototypes for *textdomain funcs
++#endif
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++extern "C" char *__textdomain(const char *domainname);
++extern "C" char *__bindtextdomain(const char *domainname,
++				  const char *dirname);
++#else
++#undef __textdomain
++#undef __bindtextdomain
++#define __textdomain(D)           ((void)0)
++#define __bindtextdomain(D,P)     ((void)0)
++#endif
++
++  // Non-virtual member functions.
++  template<typename _CharT>
++     messages<_CharT>::messages(size_t __refs)
++     : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
++     _M_name_messages(_S_get_c_name())
++     { }
++
++  template<typename _CharT>
++     messages<_CharT>::messages(__c_locale __cloc, const char* __s,
++				size_t __refs)
++     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
++     _M_name_messages(__s)
++     {
++       char* __tmp = new char[std::strlen(__s) + 1];
++       std::strcpy(__tmp, __s);
++       _M_name_messages = __tmp;
++     }
++
++  template<typename _CharT>
++    typename messages<_CharT>::catalog
++    messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
++			   const char* __dir) const
++    {
++      __bindtextdomain(__s.c_str(), __dir);
++      return this->do_open(__s, __loc);
++    }
++
++  // Virtual member functions.
++  template<typename _CharT>
++    messages<_CharT>::~messages()
++    {
++      if (_M_name_messages != _S_get_c_name())
++	delete [] _M_name_messages;
++      _S_destroy_c_locale(_M_c_locale_messages);
++    }
++
++  template<typename _CharT>
++    typename messages<_CharT>::catalog
++    messages<_CharT>::do_open(const basic_string<char>& __s,
++			      const locale&) const
++    {
++      // No error checking is done, assume the catalog exists and can
++      // be used.
++      __textdomain(__s.c_str());
++      return 0;
++    }
++
++  template<typename _CharT>
++    void
++    messages<_CharT>::do_close(catalog) const
++    { }
++
++   // messages_byname
++   template<typename _CharT>
++     messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
++     : messages<_CharT>(__refs)
++     {
++       if (this->_M_name_messages != locale::facet::_S_get_c_name())
++	 delete [] this->_M_name_messages;
++       char* __tmp = new char[std::strlen(__s) + 1];
++       std::strcpy(__tmp, __s);
++       this->_M_name_messages = __tmp;
++
++       if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
++	 {
++	   this->_S_destroy_c_locale(this->_M_c_locale_messages);
++	   this->_S_create_c_locale(this->_M_c_locale_messages, __s);
++	 }
++     }
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+new file mode 100644
+index 0000000..aa52731
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -0,0 +1,692 @@
++// std::moneypunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.6.3.2  moneypunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning optimize this for uclibc
++#warning tailor for stub locale support
++#endif
++
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
++#endif
++
++namespace std
++{
++  // Construct and return valid pattern consisting of some combination of:
++  // space none symbol sign value
++  money_base::pattern
++  money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
++  {
++    pattern __ret;
++
++    // This insanely complicated routine attempts to construct a valid
++    // pattern for use with monyepunct. A couple of invariants:
++
++    // if (__precedes) symbol -> value
++    // else value -> symbol
++
++    // if (__space) space
++    // else none
++
++    // none == never first
++    // space never first or last
++
++    // Any elegant implementations of this are welcome.
++    switch (__posn)
++      {
++      case 0:
++      case 1:
++	// 1 The sign precedes the value and symbol.
++	__ret.field[0] = sign;
++	if (__space)
++	  {
++	    // Pattern starts with sign.
++	    if (__precedes)
++	      {
++		__ret.field[1] = symbol;
++		__ret.field[3] = value;
++	      }
++	    else
++	      {
++		__ret.field[1] = value;
++		__ret.field[3] = symbol;
++	      }
++	    __ret.field[2] = space;
++	  }
++	else
++	  {
++	    // Pattern starts with sign and ends with none.
++	    if (__precedes)
++	      {
++		__ret.field[1] = symbol;
++		__ret.field[2] = value;
++	      }
++	    else
++	      {
++		__ret.field[1] = value;
++		__ret.field[2] = symbol;
++	      }
++	    __ret.field[3] = none;
++	  }
++	break;
++      case 2:
++	// 2 The sign follows the value and symbol.
++	if (__space)
++	  {
++	    // Pattern either ends with sign.
++	    if (__precedes)
++	      {
++		__ret.field[0] = symbol;
++		__ret.field[2] = value;
++	      }
++	    else
++	      {
++		__ret.field[0] = value;
++		__ret.field[2] = symbol;
++	      }
++	    __ret.field[1] = space;
++	    __ret.field[3] = sign;
++	  }
++	else
++	  {
++	    // Pattern ends with sign then none.
++	    if (__precedes)
++	      {
++		__ret.field[0] = symbol;
++		__ret.field[1] = value;
++	      }
++	    else
++	      {
++		__ret.field[0] = value;
++		__ret.field[1] = symbol;
++	      }
++	    __ret.field[2] = sign;
++	    __ret.field[3] = none;
++	  }
++	break;
++      case 3:
++	// 3 The sign immediately precedes the symbol.
++	if (__precedes)
++	  {
++	    __ret.field[0] = sign;
++	    __ret.field[1] = symbol;
++	    if (__space)
++	      {
++		__ret.field[2] = space;
++		__ret.field[3] = value;
++	      }
++	    else
++	      {
++		__ret.field[2] = value;
++		__ret.field[3] = none;
++	      }
++	  }
++	else
++	  {
++	    __ret.field[0] = value;
++	    if (__space)
++	      {
++		__ret.field[1] = space;
++		__ret.field[2] = sign;
++		__ret.field[3] = symbol;
++	      }
++	    else
++	      {
++		__ret.field[1] = sign;
++		__ret.field[2] = symbol;
++		__ret.field[3] = none;
++	      }
++	  }
++	break;
++      case 4:
++	// 4 The sign immediately follows the symbol.
++	if (__precedes)
++	  {
++	    __ret.field[0] = symbol;
++	    __ret.field[1] = sign;
++	    if (__space)
++	      {
++		__ret.field[2] = space;
++		__ret.field[3] = value;
++	      }
++	    else
++	      {
++		__ret.field[2] = value;
++		__ret.field[3] = none;
++	      }
++	  }
++	else
++	  {
++	    __ret.field[0] = value;
++	    if (__space)
++	      {
++		__ret.field[1] = space;
++		__ret.field[2] = symbol;
++		__ret.field[3] = sign;
++	      }
++	    else
++	      {
++		__ret.field[1] = symbol;
++		__ret.field[2] = sign;
++		__ret.field[3] = none;
++	      }
++	  }
++	break;
++      default:
++	;
++      }
++    return __ret;
++  }
++
++  template<>
++    void
++    moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
++						     const char*)
++    {
++      if (!_M_data)
++	_M_data = new __moneypunct_cache<char, true>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = '.';
++	  _M_data->_M_thousands_sep = ',';
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = "";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = "";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = "";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++	}
++      else
++	{
++	  // Named locale.
++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++							__cloc));
++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++							__cloc));
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++	  char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++	  if (!__nposn)
++	    _M_data->_M_negative_sign = "()";
++	  else
++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++							__cloc);
++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++	  // _Intl == true
++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++						      __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++							__pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++							__nposn);
++	}
++    }
++
++  template<>
++    void
++    moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
++						      const char*)
++    {
++      if (!_M_data)
++	_M_data = new __moneypunct_cache<char, false>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = '.';
++	  _M_data->_M_thousands_sep = ',';
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = "";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = "";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = "";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
++	}
++      else
++	{
++	  // Named locale.
++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
++							__cloc));
++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
++							__cloc));
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	  _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
++
++	  char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++	  if (!__nposn)
++	    _M_data->_M_negative_sign = "()";
++	  else
++	    _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
++							__cloc);
++	  _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
++
++	  // _Intl == false
++	  _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++	  _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++							__pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++							__nposn);
++	}
++    }
++
++  template<>
++    moneypunct<char, true>::~moneypunct()
++    { delete _M_data; }
++
++  template<>
++    moneypunct<char, false>::~moneypunct()
++    { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    void
++    moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++							const char*)
++#else
++							const char* __name)
++#endif
++    {
++      if (!_M_data)
++	_M_data = new __moneypunct_cache<wchar_t, true>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = L'.';
++	  _M_data->_M_thousands_sep = L',';
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = L"";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = L"";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = L"";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  // Use ctype::widen code without the facet...
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] =
++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
++	}
++      else
++	{
++	  // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __c_locale __old = __uselocale(__cloc);
++#else
++	  // Switch to named locale so that mbsrtowcs will work.
++	  char* __old = strdup(setlocale(LC_ALL, NULL));
++	  setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++	  union { char *__s; wchar_t __w; } __u;
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++	  _M_data->_M_decimal_point = __u.__w;
++
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++	  _M_data->_M_thousands_sep = __u.__w;
++#endif
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++	  const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
++
++	  wchar_t* __wcs_ps = 0;
++	  wchar_t* __wcs_ns = 0;
++	  const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
++	  try
++	    {
++	      mbstate_t __state;
++	      size_t __len = strlen(__cpossign);
++	      if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ps = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++		  _M_data->_M_positive_sign = __wcs_ps;
++		}
++	      else
++		_M_data->_M_positive_sign = L"";
++	      _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++	      __len = strlen(__cnegsign);
++	      if (!__nposn)
++		_M_data->_M_negative_sign = L"()";
++	      else if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ns = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++		  _M_data->_M_negative_sign = __wcs_ns;
++		}
++	      else
++		_M_data->_M_negative_sign = L"";
++	      _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++	      // _Intl == true.
++	      __len = strlen(__ccurr);
++	      if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  wchar_t* __wcs = new wchar_t[__len];
++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++		  _M_data->_M_curr_symbol = __wcs;
++		}
++	      else
++		_M_data->_M_curr_symbol = L"";
++	      _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++	    }
++	  catch (...)
++	    {
++	      delete _M_data;
++	      _M_data = 0;
++	      delete __wcs_ps;
++	      delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++	      __uselocale(__old);
++#else
++	      setlocale(LC_ALL, __old);
++	      free(__old);
++#endif
++	      __throw_exception_again;
++	    }
++
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
++						      __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++							__pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++							__nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __uselocale(__old);
++#else
++	  setlocale(LC_ALL, __old);
++	  free(__old);
++#endif
++	}
++    }
++
++  template<>
++  void
++  moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
++#ifdef __UCLIBC_HAS_XLOCALE__
++						       const char*)
++#else
++                                                       const char* __name)
++#endif
++  {
++    if (!_M_data)
++      _M_data = new __moneypunct_cache<wchar_t, false>;
++
++    if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_decimal_point = L'.';
++	  _M_data->_M_thousands_sep = L',';
++	  _M_data->_M_grouping = "";
++          _M_data->_M_grouping_size = 0;
++	  _M_data->_M_curr_symbol = L"";
++	  _M_data->_M_curr_symbol_size = 0;
++	  _M_data->_M_positive_sign = L"";
++	  _M_data->_M_positive_sign_size = 0;
++	  _M_data->_M_negative_sign = L"";
++	  _M_data->_M_negative_sign_size = 0;
++	  _M_data->_M_frac_digits = 0;
++	  _M_data->_M_pos_format = money_base::_S_default_pattern;
++	  _M_data->_M_neg_format = money_base::_S_default_pattern;
++
++	  // Use ctype::widen code without the facet...
++	  for (size_t __i = 0; __i < money_base::_S_end; ++__i)
++	    _M_data->_M_atoms[__i] =
++	      static_cast<wchar_t>(money_base::_S_atoms[__i]);
++	}
++      else
++	{
++	  // Named locale.
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __c_locale __old = __uselocale(__cloc);
++#else
++	  // Switch to named locale so that mbsrtowcs will work.
++	  char* __old = strdup(setlocale(LC_ALL, NULL));
++	  setlocale(LC_ALL, __name);
++#endif
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be monetary
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# else
++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
++          union { char *__s; wchar_t __w; } __u;
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
++	  _M_data->_M_decimal_point = __u.__w;
++
++	  __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
++	  _M_data->_M_thousands_sep = __u.__w;
++#endif
++	  _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
++          _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++
++	  const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
++	  const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
++	  const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
++
++	  wchar_t* __wcs_ps = 0;
++	  wchar_t* __wcs_ns = 0;
++	  const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
++	  try
++            {
++              mbstate_t __state;
++              size_t __len;
++              __len = strlen(__cpossign);
++              if (__len)
++                {
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ps = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
++		  _M_data->_M_positive_sign = __wcs_ps;
++		}
++	      else
++		_M_data->_M_positive_sign = L"";
++              _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
++
++	      __len = strlen(__cnegsign);
++	      if (!__nposn)
++		_M_data->_M_negative_sign = L"()";
++	      else if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  __wcs_ns = new wchar_t[__len];
++		  mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
++		  _M_data->_M_negative_sign = __wcs_ns;
++		}
++	      else
++		_M_data->_M_negative_sign = L"";
++              _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
++
++	      // _Intl == true.
++	      __len = strlen(__ccurr);
++	      if (__len)
++		{
++		  ++__len;
++		  memset(&__state, 0, sizeof(mbstate_t));
++		  wchar_t* __wcs = new wchar_t[__len];
++		  mbsrtowcs(__wcs, &__ccurr, __len, &__state);
++		  _M_data->_M_curr_symbol = __wcs;
++		}
++	      else
++		_M_data->_M_curr_symbol = L"";
++              _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
++	    }
++          catch (...)
++	    {
++	      delete _M_data;
++              _M_data = 0;
++	      delete __wcs_ps;
++	      delete __wcs_ns;
++#ifdef __UCLIBC_HAS_XLOCALE__
++	      __uselocale(__old);
++#else
++	      setlocale(LC_ALL, __old);
++	      free(__old);
++#endif
++              __throw_exception_again;
++	    }
++
++	  _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
++	  char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
++	  char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
++	  char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
++	  _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
++	                                                __pposn);
++	  char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
++	  char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
++	  _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
++	                                                __nposn);
++
++#ifdef __UCLIBC_HAS_XLOCALE__
++	  __uselocale(__old);
++#else
++	  setlocale(LC_ALL, __old);
++	  free(__old);
++#endif
++	}
++    }
++
++  template<>
++    moneypunct<wchar_t, true>::~moneypunct()
++    {
++      if (_M_data->_M_positive_sign_size)
++	delete [] _M_data->_M_positive_sign;
++      if (_M_data->_M_negative_sign_size
++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++	delete [] _M_data->_M_negative_sign;
++      if (_M_data->_M_curr_symbol_size)
++	delete [] _M_data->_M_curr_symbol;
++      delete _M_data;
++    }
++
++  template<>
++    moneypunct<wchar_t, false>::~moneypunct()
++    {
++      if (_M_data->_M_positive_sign_size)
++	delete [] _M_data->_M_positive_sign;
++      if (_M_data->_M_negative_sign_size
++          && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
++	delete [] _M_data->_M_negative_sign;
++      if (_M_data->_M_curr_symbol_size)
++	delete [] _M_data->_M_curr_symbol;
++      delete _M_data;
++    }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+new file mode 100644
+index 0000000..883ec1a
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -0,0 +1,160 @@
++// std::numpunct implementation details, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.3.1.2  numpunct virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#define _LIBC
++#include <locale>
++#undef _LIBC
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
++#endif
++
++namespace std
++{
++  template<>
++    void
++    numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __numpunct_cache<char>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_use_grouping = false;
++
++	  _M_data->_M_decimal_point = '.';
++	  _M_data->_M_thousands_sep = ',';
++
++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++	    _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
++
++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++	    _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
++	}
++      else
++	{
++	  // Named locale.
++	  _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
++							__cloc));
++	  _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
++							__cloc));
++
++	  // Check for NULL, which implies no grouping.
++	  if (_M_data->_M_thousands_sep == '\0')
++	    _M_data->_M_grouping = "";
++	  else
++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	}
++
++      // NB: There is no way to extact this info from posix locales.
++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++      _M_data->_M_truename = "true";
++      _M_data->_M_truename_size = 4;
++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++      _M_data->_M_falsename = "false";
++      _M_data->_M_falsename_size = 5;
++    }
++
++  template<>
++    numpunct<char>::~numpunct()
++    { delete _M_data; }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    void
++    numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __numpunct_cache<wchar_t>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_data->_M_grouping = "";
++	  _M_data->_M_grouping_size = 0;
++	  _M_data->_M_use_grouping = false;
++
++	  _M_data->_M_decimal_point = L'.';
++	  _M_data->_M_thousands_sep = L',';
++
++	  // Use ctype::widen code without the facet...
++	  for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
++	    _M_data->_M_atoms_out[__i] =
++	      static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
++
++	  for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
++	    _M_data->_M_atoms_in[__j] =
++	      static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
++	}
++      else
++	{
++	  // Named locale.
++	  // NB: In the GNU model wchar_t is always 32 bit wide.
++	  union { char *__s; wchar_t __w; } __u;
++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
++	  _M_data->_M_decimal_point = __u.__w;
++
++	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
++	  _M_data->_M_thousands_sep = __u.__w;
++
++	  if (_M_data->_M_thousands_sep == L'\0')
++	    _M_data->_M_grouping = "";
++	  else
++	    _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
++	  _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
++	}
++
++      // NB: There is no way to extact this info from posix locales.
++      // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
++      _M_data->_M_truename = L"true";
++      _M_data->_M_truename_size = 4;
++      // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
++      _M_data->_M_falsename = L"false";
++      _M_data->_M_falsename_size = 5;
++    }
++
++  template<>
++    numpunct<wchar_t>::~numpunct()
++    { delete _M_data; }
++ #endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+new file mode 100644
+index 0000000..e0707d7
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -0,0 +1,406 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++#include <locale>
++#include <bits/c++locale_internal.h>
++
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning tailor for stub locale support
++#endif
++#ifndef __UCLIBC_HAS_XLOCALE__
++#define __nl_langinfo_l(N, L)         nl_langinfo((N))
++#endif
++
++namespace std
++{
++  template<>
++    void
++    __timepunct<char>::
++    _M_put(char* __s, size_t __maxlen, const char* __format,
++	   const tm* __tm) const
++    {
++#ifdef __UCLIBC_HAS_XLOCALE__
++      const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
++					_M_c_locale_timepunct);
++#else
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_timepunct);
++      const size_t __len = strftime(__s, __maxlen, __format, __tm);
++      setlocale(LC_ALL, __old);
++      free(__old);
++#endif
++      // Make sure __s is null terminated.
++      if (__len == 0)
++	__s[0] = '\0';
++    }
++
++  template<>
++    void
++    __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __timepunct_cache<char>;
++
++      if (!__cloc)
++	{
++	  // "C" locale
++	  _M_c_locale_timepunct = _S_get_c_locale();
++
++	  _M_data->_M_date_format = "%m/%d/%y";
++	  _M_data->_M_date_era_format = "%m/%d/%y";
++	  _M_data->_M_time_format = "%H:%M:%S";
++	  _M_data->_M_time_era_format = "%H:%M:%S";
++	  _M_data->_M_date_time_format = "";
++	  _M_data->_M_date_time_era_format = "";
++	  _M_data->_M_am = "AM";
++	  _M_data->_M_pm = "PM";
++	  _M_data->_M_am_pm_format = "";
++
++	  // Day names, starting with "C"'s Sunday.
++	  _M_data->_M_day1 = "Sunday";
++	  _M_data->_M_day2 = "Monday";
++	  _M_data->_M_day3 = "Tuesday";
++	  _M_data->_M_day4 = "Wednesday";
++	  _M_data->_M_day5 = "Thursday";
++	  _M_data->_M_day6 = "Friday";
++	  _M_data->_M_day7 = "Saturday";
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  _M_data->_M_aday1 = "Sun";
++	  _M_data->_M_aday2 = "Mon";
++	  _M_data->_M_aday3 = "Tue";
++	  _M_data->_M_aday4 = "Wed";
++	  _M_data->_M_aday5 = "Thu";
++	  _M_data->_M_aday6 = "Fri";
++	  _M_data->_M_aday7 = "Sat";
++
++	  // Month names, starting with "C"'s January.
++	  _M_data->_M_month01 = "January";
++	  _M_data->_M_month02 = "February";
++	  _M_data->_M_month03 = "March";
++	  _M_data->_M_month04 = "April";
++	  _M_data->_M_month05 = "May";
++	  _M_data->_M_month06 = "June";
++	  _M_data->_M_month07 = "July";
++	  _M_data->_M_month08 = "August";
++	  _M_data->_M_month09 = "September";
++	  _M_data->_M_month10 = "October";
++	  _M_data->_M_month11 = "November";
++	  _M_data->_M_month12 = "December";
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  _M_data->_M_amonth01 = "Jan";
++	  _M_data->_M_amonth02 = "Feb";
++	  _M_data->_M_amonth03 = "Mar";
++	  _M_data->_M_amonth04 = "Apr";
++	  _M_data->_M_amonth05 = "May";
++	  _M_data->_M_amonth06 = "Jun";
++	  _M_data->_M_amonth07 = "Jul";
++	  _M_data->_M_amonth08 = "Aug";
++	  _M_data->_M_amonth09 = "Sep";
++	  _M_data->_M_amonth10 = "Oct";
++	  _M_data->_M_amonth11 = "Nov";
++	  _M_data->_M_amonth12 = "Dec";
++	}
++      else
++	{
++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++	  _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
++	  _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
++	  _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
++	  _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
++	  _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
++	  _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
++							     __cloc);
++	  _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
++	  _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
++	  _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
++
++	  // Day names, starting with "C"'s Sunday.
++	  _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
++	  _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
++	  _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
++	  _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
++	  _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
++	  _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
++	  _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
++	  _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
++	  _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
++	  _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
++	  _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
++	  _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
++	  _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
++
++	  // Month names, starting with "C"'s January.
++	  _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
++	  _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
++	  _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
++	  _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
++	  _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
++	  _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
++	  _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
++	  _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
++	  _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
++	  _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
++	  _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
++	  _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
++	  _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
++	  _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
++	  _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
++	  _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
++	  _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
++	  _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
++	  _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
++	  _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
++	  _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
++	  _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
++	  _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
++	}
++    }
++
++#ifdef _GLIBCXX_USE_WCHAR_T
++  template<>
++    void
++    __timepunct<wchar_t>::
++    _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
++	   const tm* __tm) const
++    {
++#ifdef __UCLIBC_HAS_XLOCALE__
++      __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
++      const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
++					_M_c_locale_timepunct);
++#else
++      char* __old = strdup(setlocale(LC_ALL, NULL));
++      setlocale(LC_ALL, _M_name_timepunct);
++      const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
++      setlocale(LC_ALL, __old);
++      free(__old);
++#endif
++      // Make sure __s is null terminated.
++      if (__len == 0)
++	__s[0] = L'\0';
++    }
++
++  template<>
++    void
++    __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
++    {
++      if (!_M_data)
++	_M_data = new __timepunct_cache<wchar_t>;
++
++#warning wide time stuff
++//       if (!__cloc)
++	{
++	  // "C" locale
++	  _M_c_locale_timepunct = _S_get_c_locale();
++
++	  _M_data->_M_date_format = L"%m/%d/%y";
++	  _M_data->_M_date_era_format = L"%m/%d/%y";
++	  _M_data->_M_time_format = L"%H:%M:%S";
++	  _M_data->_M_time_era_format = L"%H:%M:%S";
++	  _M_data->_M_date_time_format = L"";
++	  _M_data->_M_date_time_era_format = L"";
++	  _M_data->_M_am = L"AM";
++	  _M_data->_M_pm = L"PM";
++	  _M_data->_M_am_pm_format = L"";
++
++	  // Day names, starting with "C"'s Sunday.
++	  _M_data->_M_day1 = L"Sunday";
++	  _M_data->_M_day2 = L"Monday";
++	  _M_data->_M_day3 = L"Tuesday";
++	  _M_data->_M_day4 = L"Wednesday";
++	  _M_data->_M_day5 = L"Thursday";
++	  _M_data->_M_day6 = L"Friday";
++	  _M_data->_M_day7 = L"Saturday";
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  _M_data->_M_aday1 = L"Sun";
++	  _M_data->_M_aday2 = L"Mon";
++	  _M_data->_M_aday3 = L"Tue";
++	  _M_data->_M_aday4 = L"Wed";
++	  _M_data->_M_aday5 = L"Thu";
++	  _M_data->_M_aday6 = L"Fri";
++	  _M_data->_M_aday7 = L"Sat";
++
++	  // Month names, starting with "C"'s January.
++	  _M_data->_M_month01 = L"January";
++	  _M_data->_M_month02 = L"February";
++	  _M_data->_M_month03 = L"March";
++	  _M_data->_M_month04 = L"April";
++	  _M_data->_M_month05 = L"May";
++	  _M_data->_M_month06 = L"June";
++	  _M_data->_M_month07 = L"July";
++	  _M_data->_M_month08 = L"August";
++	  _M_data->_M_month09 = L"September";
++	  _M_data->_M_month10 = L"October";
++	  _M_data->_M_month11 = L"November";
++	  _M_data->_M_month12 = L"December";
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  _M_data->_M_amonth01 = L"Jan";
++	  _M_data->_M_amonth02 = L"Feb";
++	  _M_data->_M_amonth03 = L"Mar";
++	  _M_data->_M_amonth04 = L"Apr";
++	  _M_data->_M_amonth05 = L"May";
++	  _M_data->_M_amonth06 = L"Jun";
++	  _M_data->_M_amonth07 = L"Jul";
++	  _M_data->_M_amonth08 = L"Aug";
++	  _M_data->_M_amonth09 = L"Sep";
++	  _M_data->_M_amonth10 = L"Oct";
++	  _M_data->_M_amonth11 = L"Nov";
++	  _M_data->_M_amonth12 = L"Dec";
++	}
++#if 0
++      else
++	{
++	  _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
++
++	  union { char *__s; wchar_t *__w; } __u;
++
++	  __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
++	  _M_data->_M_date_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
++	  _M_data->_M_date_era_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
++	  _M_data->_M_time_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
++	  _M_data->_M_time_era_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
++	  _M_data->_M_date_time_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
++	  _M_data->_M_date_time_era_format = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
++	  _M_data->_M_am = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
++	  _M_data->_M_pm = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
++	  _M_data->_M_am_pm_format = __u.__w;
++
++	  // Day names, starting with "C"'s Sunday.
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
++	  _M_data->_M_day1 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
++	  _M_data->_M_day2 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
++	  _M_data->_M_day3 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
++	  _M_data->_M_day4 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
++	  _M_data->_M_day5 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
++	  _M_data->_M_day6 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
++	  _M_data->_M_day7 = __u.__w;
++
++	  // Abbreviated day names, starting with "C"'s Sun.
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
++	  _M_data->_M_aday1 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
++	  _M_data->_M_aday2 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
++	  _M_data->_M_aday3 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
++	  _M_data->_M_aday4 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
++	  _M_data->_M_aday5 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
++	  _M_data->_M_aday6 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
++	  _M_data->_M_aday7 = __u.__w;
++
++	  // Month names, starting with "C"'s January.
++	  __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
++	  _M_data->_M_month01 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
++	  _M_data->_M_month02 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
++	  _M_data->_M_month03 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
++	  _M_data->_M_month04 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
++	  _M_data->_M_month05 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
++	  _M_data->_M_month06 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
++	  _M_data->_M_month07 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
++	  _M_data->_M_month08 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
++	  _M_data->_M_month09 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
++	  _M_data->_M_month10 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
++	  _M_data->_M_month11 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
++	  _M_data->_M_month12 = __u.__w;
++
++	  // Abbreviated month names, starting with "C"'s Jan.
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
++	  _M_data->_M_amonth01 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
++	  _M_data->_M_amonth02 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
++	  _M_data->_M_amonth03 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
++	  _M_data->_M_amonth04 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
++	  _M_data->_M_amonth05 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
++	  _M_data->_M_amonth06 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
++	  _M_data->_M_amonth07 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
++	  _M_data->_M_amonth08 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
++	  _M_data->_M_amonth09 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
++	  _M_data->_M_amonth10 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
++	  _M_data->_M_amonth11 = __u.__w;
++	  __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
++	  _M_data->_M_amonth12 = __u.__w;
++	}
++#endif // 0
++    }
++#endif
++}
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+new file mode 100644
+index 0000000..ba8e858
+--- /dev/null
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -0,0 +1,68 @@
++// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
++
++// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library.  This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 2, or (at your option)
++// any later version.
++
++// This 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 General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING.  If not, write to the Free
++// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
++// USA.
++
++// As a special exception, you may use this file as part of a free software
++// library without restriction.  Specifically, if other files instantiate
++// templates or use macros or inline functions from this file, or you compile
++// this file and link it with other files to produce an executable, this
++// file does not by itself cause the resulting executable to be covered by
++// the GNU General Public License.  This exception does not however
++// invalidate any other reasons why the executable file might be covered by
++// the GNU General Public License.
++
++//
++// ISO C++ 14882: 22.2.5.1.2 - time_get functions
++// ISO C++ 14882: 22.2.5.3.2 - time_put functions
++//
++
++// Written by Benjamin Kosnik <bkoz@redhat.com>
++
++  template<typename _CharT>
++    __timepunct<_CharT>::__timepunct(size_t __refs)
++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++    _M_name_timepunct(_S_get_c_name())
++    { _M_initialize_timepunct(); }
++
++  template<typename _CharT>
++    __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
++    : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
++    _M_name_timepunct(_S_get_c_name())
++    { _M_initialize_timepunct(); }
++
++  template<typename _CharT>
++    __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
++				     size_t __refs)
++    : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
++    _M_name_timepunct(__s)
++    {
++      char* __tmp = new char[std::strlen(__s) + 1];
++      std::strcpy(__tmp, __s);
++      _M_name_timepunct = __tmp;
++      _M_initialize_timepunct(__cloc);
++    }
++
++  template<typename _CharT>
++    __timepunct<_CharT>::~__timepunct()
++    {
++      if (_M_name_timepunct != _S_get_c_name())
++	delete [] _M_name_timepunct;
++      delete _M_data;
++      _S_destroy_c_locale(_M_c_locale_timepunct);
++    }
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index f5b28f4..fbad667 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -15913,6 +15913,9 @@ fi
+   # Default to "generic".
+   if test $enable_clocale_flag = auto; then
+     case ${target_os} in
++      *-uclibc*)
++        enable_clocale_flag=uclibc
++        ;;
+       linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
+ 	enable_clocale_flag=gnu
+ 	;;
+@@ -16191,6 +16194,78 @@ $as_echo "newlib" >&6; }
+       CTIME_CC=config/locale/generic/time_members.cc
+       CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
+       ;;
++    uclibc)
++      { $as_echo "$as_me:${as_lineno-$LINENO}: result: uclibc" >&5
++$as_echo "uclibc" >&6; }
++
++      # Declare intention to use gettext, and add support for specific
++      # languages.
++      # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
++      ALL_LINGUAS="de fr"
++
++      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
++      # Extract the first word of "msgfmt", so it can be a program name with args.
++set dummy msgfmt; ac_word=$2
++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
++$as_echo_n "checking for $ac_word... " >&6; }
++if test "${ac_cv_prog_check_msgfmt+set}" = set; then :
++  $as_echo_n "(cached) " >&6
++else
++  if test -n "$check_msgfmt"; then
++  ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
++else
++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++for as_dir in $PATH
++do
++  IFS=$as_save_IFS
++  test -z "$as_dir" && as_dir=.
++    for ac_exec_ext in '' $ac_executable_extensions; do
++  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
++    ac_cv_prog_check_msgfmt="yes"
++    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
++    break 2
++  fi
++done
++  done
++IFS=$as_save_IFS
++
++  test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
++fi
++fi
++check_msgfmt=$ac_cv_prog_check_msgfmt
++if test -n "$check_msgfmt"; then
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $check_msgfmt" >&5
++$as_echo "$check_msgfmt" >&6; }
++else
++  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
++$as_echo "no" >&6; }
++fi
++
++
++      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
++        USE_NLS=yes
++      fi
++      # Export the build objects.
++      for ling in $ALL_LINGUAS; do \
++        glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
++        glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
++      done
++
++
++
++      CLOCALE_H=config/locale/uclibc/c_locale.h
++      CLOCALE_CC=config/locale/uclibc/c_locale.cc
++      CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
++      CCOLLATE_CC=config/locale/uclibc/collate_members.cc
++      CCTYPE_CC=config/locale/uclibc/ctype_members.cc
++      CMESSAGES_H=config/locale/uclibc/messages_members.h
++      CMESSAGES_CC=config/locale/uclibc/messages_members.cc
++      CMONEY_CC=config/locale/uclibc/monetary_members.cc
++      CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
++      CTIME_H=config/locale/uclibc/time_members.h
++      CTIME_CC=config/locale/uclibc/time_members.cc
++      CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
++      ;;
+   esac
+ 
+   # This is where the testsuite looks for locale catalogs, using the
+diff --git a/libstdc++-v3/include/c_compatibility/wchar.h b/libstdc++-v3/include/c_compatibility/wchar.h
+index 06b5d47..7d3f835 100644
+--- a/libstdc++-v3/include/c_compatibility/wchar.h
++++ b/libstdc++-v3/include/c_compatibility/wchar.h
+@@ -101,7 +101,9 @@ using std::wmemcmp;
+ using std::wmemcpy;
+ using std::wmemmove;
+ using std::wmemset;
++#if _GLIBCXX_HAVE_WCSFTIME
+ using std::wcsftime;
++#endif
+ 
+ #if _GLIBCXX_USE_C99
+ using std::wcstold;
+diff --git a/libstdc++-v3/include/c_std/cwchar b/libstdc++-v3/include/c_std/cwchar
+index aa1b2fa..45c4617 100644
+--- a/libstdc++-v3/include/c_std/cwchar
++++ b/libstdc++-v3/include/c_std/cwchar
+@@ -175,7 +175,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+   using ::wcscoll;
+   using ::wcscpy;
+   using ::wcscspn;
++#if _GLIBCXX_HAVE_WCSFTIME
+   using ::wcsftime;
++#endif
+   using ::wcslen;
+   using ::wcsncat;
+   using ::wcsncmp;
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0005-uclibc-locale-no__x.patch b/meta/recipes-devtools/gcc/gcc-5.2/0005-uclibc-locale-no__x.patch
new file mode 100644
index 0000000..ac053ea
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0005-uclibc-locale-no__x.patch
@@ -0,0 +1,257 @@
+From a8e683917a3e8a6642639e65c06d4d4fc46cc8ab Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:42:36 +0400
+Subject: [PATCH 05/35] uclibc-locale-no__x
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h      | 45 ++++++++++++++++++++++
+ libstdc++-v3/config/locale/uclibc/c_locale.cc      | 14 -------
+ libstdc++-v3/config/locale/uclibc/c_locale.h       |  1 +
+ .../config/locale/uclibc/collate_members.cc        |  7 ----
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc |  7 ----
+ .../config/locale/uclibc/messages_members.cc       |  7 +---
+ .../config/locale/uclibc/messages_members.h        | 18 ++++-----
+ .../config/locale/uclibc/monetary_members.cc       |  4 --
+ .../config/locale/uclibc/numeric_members.cc        |  3 --
+ libstdc++-v3/config/locale/uclibc/time_members.cc  |  3 --
+ 10 files changed, 55 insertions(+), 54 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index 2ae3e4a..e74fddf 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
+ extern "C" __typeof(wctype_l) __wctype_l;
+ #endif
+ 
++# define __nl_langinfo_l nl_langinfo_l
++# define __strcoll_l strcoll_l
++# define __strftime_l strftime_l
++# define __strtod_l strtod_l
++# define __strtof_l strtof_l
++# define __strtold_l strtold_l
++# define __strxfrm_l strxfrm_l
++# define __newlocale newlocale
++# define __freelocale freelocale
++# define __duplocale duplocale
++# define __uselocale uselocale
++
++# ifdef _GLIBCXX_USE_WCHAR_T
++#  define __iswctype_l iswctype_l
++#  define __towlower_l towlower_l
++#  define __towupper_l towupper_l
++#  define __wcscoll_l wcscoll_l
++#  define __wcsftime_l wcsftime_l
++#  define __wcsxfrm_l wcsxfrm_l
++#  define __wctype_l wctype_l
++# endif
++
++#else
++# define __nl_langinfo_l(N, L)       nl_langinfo((N))
++# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
++# define __strtod_l(S, E, L)         strtod((S), (E))
++# define __strtof_l(S, E, L)         strtof((S), (E))
++# define __strtold_l(S, E, L)        strtold((S), (E))
++# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
++# warning should dummy __newlocale check for C|POSIX ?
++# define __newlocale(a, b, c)        NULL
++# define __freelocale(a)             ((void)0)
++# define __duplocale(a)              __c_locale()
++//# define __uselocale ?
++//
++# ifdef _GLIBCXX_USE_WCHAR_T
++#  define __iswctype_l(C, M, L)       iswctype((C), (M))
++#  define __towlower_l(C, L)          towlower((C))
++#  define __towupper_l(C, L)          towupper((C))
++#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
++//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T))
++#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
++#  define __wctype_l(S, L)            wctype((S))
++# endif
++
+ #endif // GLIBC 2.3 and later
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 5081dc1..21430d0 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,20 +39,6 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
+-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
+-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
+-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
+-#define __strtof_l(S, E, L)         strtof((S), (E))
+-#define __strtod_l(S, E, L)         strtod((S), (E))
+-#define __strtold_l(S, E, L)        strtold((S), (E))
+-#warning should dummy __newlocale check for C|POSIX ?
+-#define __newlocale(a, b, c)        NULL
+-#define __freelocale(a)             ((void)0)
+-#define __duplocale(a)              __c_locale()
+-#endif
+-
+ namespace std
+ {
+   template<>
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index da07c1f..4bca5f1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -68,6 +68,7 @@ namespace __gnu_cxx
+ {
+   extern "C" __typeof(uselocale) __uselocale;
+ }
++#define __uselocale uselocale
+ #endif
+ 
+ namespace std
+diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+index c2664a7..ec5c329 100644
+--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
+@@ -36,13 +36,6 @@
+ #include <locale>
+ #include <bits/c++locale_internal.h>
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
+-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
+-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
+-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
+-#endif
+-
+ namespace std
+ {
+   // These are basically extensions to char_traits, and perhaps should
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7294e3a..7b12861 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -38,13 +38,6 @@
+ #undef _LIBC
+ #include <bits/c++locale_internal.h>
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __wctype_l(S, L)           wctype((S))
+-#define __towupper_l(C, L)         towupper((C))
+-#define __towlower_l(C, L)         towlower((C))
+-#define __iswctype_l(C, M, L)      iswctype((C), (M))
+-#endif
+-
+ namespace std
+ {
+   // NB: The other ctype<char> specializations are in src/locale.cc and
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+index 13594d9..d7693b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
+@@ -39,13 +39,10 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix gettext stuff
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__dcgettext(const char *domainname,
+-			     const char *msgid, int category);
+ #undef gettext
+-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
++#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
+ #else
+-#undef gettext
+ #define gettext(msgid) (msgid)
+ #endif
+ 
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index 1424078..d89da33 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -36,15 +36,11 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix prototypes for *textdomain funcs
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-extern "C" char *__textdomain(const char *domainname);
+-extern "C" char *__bindtextdomain(const char *domainname,
+-				  const char *dirname);
+-#else
+-#undef __textdomain
+-#undef __bindtextdomain
+-#define __textdomain(D)           ((void)0)
+-#define __bindtextdomain(D,P)     ((void)0)
++#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
++#undef textdomain
++#undef bindtextdomain
++#define textdomain(D)           ((void)0)
++#define bindtextdomain(D,P)     ((void)0)
+ #endif
+ 
+   // Non-virtual member functions.
+@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
+ 			   const char* __dir) const
+     {
+-      __bindtextdomain(__s.c_str(), __dir);
++      bindtextdomain(__s.c_str(), __dir);
+       return this->do_open(__s, __loc);
+     }
+ 
+@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
+     {
+       // No error checking is done, assume the catalog exists and can
+       // be used.
+-      __textdomain(__s.c_str());
++      textdomain(__s.c_str());
+       return 0;
+     }
+ 
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index aa52731..2e6f80a 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -43,10 +43,6 @@
+ #warning tailor for stub locale support
+ #endif
+ 
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
+-#endif
+-
+ namespace std
+ {
+   // Construct and return valid pattern consisting of some combination of:
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 883ec1a..2c70642 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -41,9 +41,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
+-#endif
+ 
+ namespace std
+ {
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index e0707d7..d848ed5 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -40,9 +40,6 @@
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning tailor for stub locale support
+ #endif
+-#ifndef __UCLIBC_HAS_XLOCALE__
+-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
+-#endif
+ 
+ namespace std
+ {
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0006-uclibc-locale-wchar_fix.patch b/meta/recipes-devtools/gcc/gcc-5.2/0006-uclibc-locale-wchar_fix.patch
new file mode 100644
index 0000000..9112a2b
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0006-uclibc-locale-wchar_fix.patch
@@ -0,0 +1,68 @@
+From cdb9e9c9440beb59bc20476eea5a9cf2538cd194 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:45:57 +0400
+Subject: [PATCH 06/35] uclibc-locale-wchar_fix
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/config/locale/uclibc/monetary_members.cc |  4 ++--
+ libstdc++-v3/config/locale/uclibc/numeric_members.cc  | 13 +++++++++++++
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 2e6f80a..31ebb9f 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -401,7 +401,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+@@ -556,7 +556,7 @@ namespace std
+ # ifdef __UCLIBC_HAS_XLOCALE__
+ 	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
+-# else
++# elif defined __UCLIBC_HAS_LOCALE__
+ 	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
+ 	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
+ # endif
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index 2c70642..d5c8961 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -127,12 +127,25 @@ namespace std
+ 	{
+ 	  // Named locale.
+ 	  // NB: In the GNU model wchar_t is always 32 bit wide.
++#ifdef __UCLIBC_MJN3_ONLY__
++#warning fix this... should be numeric
++#endif
++#ifdef __UCLIBC__
++# ifdef __UCLIBC_HAS_XLOCALE__
++	  _M_data->_M_decimal_point = __cloc->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
++# elif defined __UCLIBC_HAS_LOCALE__
++	  _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
++	  _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
++# endif
++#else
+ 	  union { char *__s; wchar_t __w; } __u;
+ 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
+ 	  _M_data->_M_decimal_point = __u.__w;
+ 
+ 	  __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
+ 	  _M_data->_M_thousands_sep = __u.__w;
++#endif
+ 
+ 	  if (_M_data->_M_thousands_sep == L'\0')
+ 	    _M_data->_M_grouping = "";
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0007-uclibc-locale-update.patch b/meta/recipes-devtools/gcc/gcc-5.2/0007-uclibc-locale-update.patch
new file mode 100644
index 0000000..728b790
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0007-uclibc-locale-update.patch
@@ -0,0 +1,542 @@
+From 244b9d1b5cc6d5382935192998531ee70afb262d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:46:58 +0400
+Subject: [PATCH 07/35] uclibc-locale-update
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ .../config/locale/uclibc/c++locale_internal.h      |  3 +
+ libstdc++-v3/config/locale/uclibc/c_locale.cc      | 74 ++++++++++------------
+ libstdc++-v3/config/locale/uclibc/c_locale.h       | 42 ++++++------
+ libstdc++-v3/config/locale/uclibc/ctype_members.cc | 51 +++++++++++----
+ .../config/locale/uclibc/messages_members.h        | 12 ++--
+ .../config/locale/uclibc/monetary_members.cc       | 34 ++++++----
+ .../config/locale/uclibc/numeric_members.cc        |  5 ++
+ libstdc++-v3/config/locale/uclibc/time_members.cc  | 18 ++++--
+ libstdc++-v3/config/locale/uclibc/time_members.h   | 17 +++--
+ 9 files changed, 158 insertions(+), 98 deletions(-)
+
+diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+index e74fddf..971a6b4 100644
+--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
++++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+@@ -31,6 +31,9 @@
+ 
+ #include <bits/c++config.h>
+ #include <clocale>
++#include <cstdlib>
++#include <cstring>
++#include <cstddef>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning clean this up
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+index 21430d0..1b9d8e1 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
+@@ -39,23 +39,20 @@
+ #include <langinfo.h>
+ #include <bits/c++locale_internal.h>
+ 
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+   template<>
+     void
+     __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
+ 		   const __c_locale& __cloc)
+     {
+-      if (!(__err & ios_base::failbit))
+-	{
+-	  char* __sanity;
+-	  errno = 0;
+-	  float __f = __strtof_l(__s, &__sanity, __cloc);
+-          if (__sanity != __s && errno != ERANGE)
+-	    __v = __f;
+-	  else
+-	    __err |= ios_base::failbit;
+-	}
++      char* __sanity;
++      errno = 0;
++      float __f = __strtof_l(__s, &__sanity, __cloc);
++      if (__sanity != __s && errno != ERANGE)
++	__v = __f;
++      else
++	__err |= ios_base::failbit;
+     }
+ 
+   template<>
+@@ -63,16 +60,13 @@ namespace std
+     __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
+ 		   const __c_locale& __cloc)
+     {
+-      if (!(__err & ios_base::failbit))
+-	{
+-	  char* __sanity;
+-	  errno = 0;
+-	  double __d = __strtod_l(__s, &__sanity, __cloc);
+-          if (__sanity != __s && errno != ERANGE)
+-	    __v = __d;
+-	  else
+-	    __err |= ios_base::failbit;
+-	}
++      char* __sanity;
++      errno = 0;
++      double __d = __strtod_l(__s, &__sanity, __cloc);
++      if (__sanity != __s && errno != ERANGE)
++	__v = __d;
++      else
++	__err |= ios_base::failbit;
+     }
+ 
+   template<>
+@@ -80,16 +74,13 @@ namespace std
+     __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
+ 		   const __c_locale& __cloc)
+     {
+-      if (!(__err & ios_base::failbit))
+-	{
+-	  char* __sanity;
+-	  errno = 0;
+-	  long double __ld = __strtold_l(__s, &__sanity, __cloc);
+-          if (__sanity != __s && errno != ERANGE)
+-	    __v = __ld;
+-	  else
+-	    __err |= ios_base::failbit;
+-	}
++      char* __sanity;
++      errno = 0;
++      long double __ld = __strtold_l(__s, &__sanity, __cloc);
++      if (__sanity != __s && errno != ERANGE)
++	__v = __ld;
++      else
++	__err |= ios_base::failbit;
+     }
+ 
+   void
+@@ -110,17 +101,18 @@ namespace std
+   void
+   locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
+   {
+-    if (_S_get_c_locale() != __cloc)
++    if (__cloc && _S_get_c_locale() != __cloc)
+       __freelocale(__cloc);
+   }
+ 
+   __c_locale
+   locale::facet::_S_clone_c_locale(__c_locale& __cloc)
+   { return __duplocale(__cloc); }
+-} // namespace std
+ 
+-namespace __gnu_cxx
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
++
+   const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
+     {
+       "LC_CTYPE",
+@@ -138,9 +130,11 @@ namespace __gnu_cxx
+       "LC_IDENTIFICATION"
+ #endif
+     };
+-}
+ 
+-namespace std
+-{
++_GLIBCXX_END_NAMESPACE
++
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+   const char* const* const locale::_S_categories = __gnu_cxx::category_names;
+-}  // namespace std
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
+index 4bca5f1..64a6d46 100644
+--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
++++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
+@@ -39,21 +39,23 @@
+ #pragma GCC system_header
+ 
+ #include <cstring>              // get std::strlen
+-#include <cstdio>               // get std::snprintf or std::sprintf
++#include <cstdio>               // get std::vsnprintf or std::vsprintf
+ #include <clocale>
+ #include <langinfo.h>		// For codecvt
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning fix this
+ #endif
+-#ifdef __UCLIBC_HAS_LOCALE__
++#ifdef _GLIBCXX_USE_ICONV
+ #include <iconv.h>		// For codecvt using iconv, iconv_t
+ #endif
+-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+-#include <libintl.h> 		// For messages
++#ifdef HAVE_LIBINTL_H
++#include <libintl.h>		// For messages
+ #endif
++#include <cstdarg>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+ #warning what is _GLIBCXX_C_LOCALE_GNU for
++// psm: used in os/gnu-linux/ctype_noninline.h
+ #endif
+ #define _GLIBCXX_C_LOCALE_GNU 1
+ 
+@@ -78,23 +80,25 @@ namespace std
+ #else
+   typedef int*			__c_locale;
+ #endif
+-
+-  // Convert numeric value of type _Tv to string and return length of
+-  // string.  If snprintf is available use it, otherwise fall back to
+-  // the unsafe sprintf which, in general, can be dangerous and should
++  // Convert numeric value of type double to string and return length of
++  // string.  If vsnprintf is available use it, otherwise fall back to
++  // the unsafe vsprintf which, in general, can be dangerous and should
+   // be avoided.
+-  template<typename _Tv>
+-    int
+-    __convert_from_v(char* __out,
+-		     const int __size __attribute__ ((__unused__)),
+-		     const char* __fmt,
+-#ifdef __UCLIBC_HAS_XCLOCALE__
+-		     _Tv __v, const __c_locale& __cloc, int __prec)
++    inline int
++    __convert_from_v(const __c_locale&
++#ifndef __UCLIBC_HAS_XCLOCALE__
++	__cloc __attribute__ ((__unused__))
++#endif
++		     ,
++		     char* __out,
++		     const int __size,
++		     const char* __fmt, ...)
+     {
++      va_list __args;
++#ifdef __UCLIBC_HAS_XCLOCALE__
++
+       __c_locale __old = __gnu_cxx::__uselocale(__cloc);
+ #else
+-		     _Tv __v, const __c_locale&, int __prec)
+-    {
+ # ifdef __UCLIBC_HAS_LOCALE__
+       char* __old = std::setlocale(LC_ALL, NULL);
+       char* __sav = new char[std::strlen(__old) + 1];
+@@ -103,7 +107,9 @@ namespace std
+ # endif
+ #endif
+ 
+-      const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
++      va_start(__args, __fmt);
++      const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
++      va_end(__args);
+ 
+ #ifdef __UCLIBC_HAS_XCLOCALE__
+       __gnu_cxx::__uselocale(__old);
+diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+index 7b12861..13e011d 100644
+--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+@@ -33,16 +33,20 @@
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+ 
+-namespace std
+-{
++_GLIBCXX_BEGIN_NAMESPACE(std)
++
+   // NB: The other ctype<char> specializations are in src/locale.cc and
+   // various /config/os/* files.
+-  template<>
+     ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
+     : ctype<char>(0, false, __refs)
+     {
+@@ -57,6 +61,8 @@ namespace std
+ #endif
+ 	}
+     }
++    ctype_byname<char>::~ctype_byname()
++    { }
+ 
+ #ifdef _GLIBCXX_USE_WCHAR_T
+   ctype<wchar_t>::__wmask_type
+@@ -138,17 +144,33 @@ namespace std
+   ctype<wchar_t>::
+   do_is(mask __m, wchar_t __c) const
+   {
+-    // Highest bitmask in ctype_base == 10, but extra in "C"
+-    // library for blank.
++    // The case of __m == ctype_base::space is particularly important,
++    // due to its use in many istream functions.  Therefore we deal with
++    // it first, exploiting the knowledge that on GNU systems _M_bit[5]
++    // is the mask corresponding to ctype_base::space.  NB: an encoding
++    // change would not affect correctness!
++
+     bool __ret = false;
+-    const size_t __bitmasksize = 11;
+-    for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
+-      if (__m & _M_bit[__bitcur]
+-	  && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
+-	{
+-	  __ret = true;
+-	  break;
+-	}
++    if (__m == _M_bit[5])
++      __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
++    else
++      {
++	// Highest bitmask in ctype_base == 10, but extra in "C"
++	// library for blank.
++	const size_t __bitmasksize = 11;
++	for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
++	  if (__m & _M_bit[__bitcur])
++	    {
++	      if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
++		{
++		  __ret = true;
++		  break;
++		}
++	      else if (__m == _M_bit[__bitcur])
++		break;
++	    }
++      }
++
+     return __ret;
+   }
+ 
+@@ -290,4 +312,5 @@ namespace std
+ #endif
+   }
+ #endif //  _GLIBCXX_USE_WCHAR_T
+-}
++
++_GLIBCXX_END_NAMESPACE
+diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
+index d89da33..067657a 100644
+--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
++++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
+@@ -53,12 +53,16 @@
+   template<typename _CharT>
+      messages<_CharT>::messages(__c_locale __cloc, const char* __s,
+ 				size_t __refs)
+-     : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
+-     _M_name_messages(__s)
++     : facet(__refs), _M_c_locale_messages(NULL),
++     _M_name_messages(NULL)
+      {
+-       char* __tmp = new char[std::strlen(__s) + 1];
+-       std::strcpy(__tmp, __s);
++       const size_t __len = std::strlen(__s) + 1;
++       char* __tmp = new char[__len];
++       std::memcpy(__tmp, __s, __len);
+        _M_name_messages = __tmp;
++
++       // Last to avoid leaking memory if new throws.
++       _M_c_locale_messages = _S_clone_c_locale(__cloc);
+      }
+ 
+   template<typename _CharT>
+diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+index 31ebb9f..7679b9c 100644
+--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+@@ -33,9 +33,14 @@
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -206,7 +211,7 @@ namespace std
+ 	  }
+ 	break;
+       default:
+-	;
++	__ret = pattern();
+       }
+     return __ret;
+   }
+@@ -390,7 +395,9 @@ namespace std
+ 	  __c_locale __old = __uselocale(__cloc);
+ #else
+ 	  // Switch to named locale so that mbsrtowcs will work.
+-	  char* __old = strdup(setlocale(LC_ALL, NULL));
++  	  char* __old = setlocale(LC_ALL, NULL);
++          const size_t __llen = strlen(__old) + 1;
++          char* __sav = new char[__llen];
+ 	  setlocale(LC_ALL, __name);
+ #endif
+ 
+@@ -477,8 +484,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	      __uselocale(__old);
+ #else
+-	      setlocale(LC_ALL, __old);
+-	      free(__old);
++	      setlocale(LC_ALL, __sav);
++	      delete [] __sav;
+ #endif
+ 	      __throw_exception_again;
+ 	    }
+@@ -498,8 +505,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	  __uselocale(__old);
+ #else
+-	  setlocale(LC_ALL, __old);
+-	  free(__old);
++	  setlocale(LC_ALL, __sav);
++	  delete [] __sav;
+ #endif
+ 	}
+     }
+@@ -545,8 +552,11 @@ namespace std
+ 	  __c_locale __old = __uselocale(__cloc);
+ #else
+ 	  // Switch to named locale so that mbsrtowcs will work.
+-	  char* __old = strdup(setlocale(LC_ALL, NULL));
+-	  setlocale(LC_ALL, __name);
++          char* __old = setlocale(LC_ALL, NULL);
++          const size_t __llen = strlen(__old) + 1;
++          char* __sav = new char[__llen];
++          memcpy(__sav, __old, __llen);
++          setlocale(LC_ALL, __name);
+ #endif
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+@@ -633,8 +643,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	      __uselocale(__old);
+ #else
+-	      setlocale(LC_ALL, __old);
+-	      free(__old);
++	      setlocale(LC_ALL, __sav);
++	      delete [] __sav;
+ #endif
+               __throw_exception_again;
+ 	    }
+@@ -653,8 +663,8 @@ namespace std
+ #ifdef __UCLIBC_HAS_XLOCALE__
+ 	  __uselocale(__old);
+ #else
+-	  setlocale(LC_ALL, __old);
+-	  free(__old);
++	  setlocale(LC_ALL, __sav);
++	  delete [] __sav;
+ #endif
+ 	}
+     }
+diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+index d5c8961..8ae8969 100644
+--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+@@ -33,9 +33,14 @@
+ 
+ // Written by Benjamin Kosnik <bkoz@redhat.com>
+ 
++#include <features.h>
++#ifdef __UCLIBC_HAS_LOCALE__
+ #define _LIBC
+ #include <locale>
+ #undef _LIBC
++#else
++#include <locale>
++#endif
+ #include <bits/c++locale_internal.h>
+ 
+ #ifdef __UCLIBC_MJN3_ONLY__
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
+index d848ed5..f24d53e 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
++++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
+@@ -53,11 +53,14 @@ namespace std
+       const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
+ 					_M_c_locale_timepunct);
+ #else
+-      char* __old = strdup(setlocale(LC_ALL, NULL));
++      char* __old = setlocale(LC_ALL, NULL);
++      const size_t __llen = strlen(__old) + 1;
++      char* __sav = new char[__llen];
++      memcpy(__sav, __old, __llen);
+       setlocale(LC_ALL, _M_name_timepunct);
+       const size_t __len = strftime(__s, __maxlen, __format, __tm);
+-      setlocale(LC_ALL, __old);
+-      free(__old);
++      setlocale(LC_ALL, __sav);
++      delete [] __sav;
+ #endif
+       // Make sure __s is null terminated.
+       if (__len == 0)
+@@ -207,11 +210,14 @@ namespace std
+       const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
+ 					_M_c_locale_timepunct);
+ #else
+-      char* __old = strdup(setlocale(LC_ALL, NULL));
++      char* __old = setlocale(LC_ALL, NULL);
++      const size_t __llen = strlen(__old) + 1;
++      char* __sav = new char[__llen];
++      memcpy(__sav, __old, __llen);
+       setlocale(LC_ALL, _M_name_timepunct);
+       const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
+-      setlocale(LC_ALL, __old);
+-      free(__old);
++      setlocale(LC_ALL, __sav);
++      delete [] __sav;
+ #endif
+       // Make sure __s is null terminated.
+       if (__len == 0)
+diff --git a/libstdc++-v3/config/locale/uclibc/time_members.h b/libstdc++-v3/config/locale/uclibc/time_members.h
+index ba8e858..1665dde 100644
+--- a/libstdc++-v3/config/locale/uclibc/time_members.h
++++ b/libstdc++-v3/config/locale/uclibc/time_members.h
+@@ -50,12 +50,21 @@
+     __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
+ 				     size_t __refs)
+     : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+-    _M_name_timepunct(__s)
++    _M_name_timepunct(NULL)
+     {
+-      char* __tmp = new char[std::strlen(__s) + 1];
+-      std::strcpy(__tmp, __s);
++      const size_t __len = std::strlen(__s) + 1;
++      char* __tmp = new char[__len];
++      std::memcpy(__tmp, __s, __len);
+       _M_name_timepunct = __tmp;
+-      _M_initialize_timepunct(__cloc);
++
++      try
++	{ _M_initialize_timepunct(__cloc); }
++      catch(...)
++	{
++	  delete [] _M_name_timepunct;
++	  __throw_exception_again;
++	}
++
+     }
+ 
+   template<typename _CharT>
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0008-missing-execinfo_h.patch b/meta/recipes-devtools/gcc/gcc-5.2/0008-missing-execinfo_h.patch
new file mode 100644
index 0000000..b2f6b18
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0008-missing-execinfo_h.patch
@@ -0,0 +1,28 @@
+From 0a80f60de08bd5829ca1b3758f70a92b61dda143 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:48:10 +0400
+Subject: [PATCH 08/35] missing-execinfo_h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ boehm-gc/include/gc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h
+index 6b38f2d..fca98ff 100644
+--- a/boehm-gc/include/gc.h
++++ b/boehm-gc/include/gc.h
+@@ -503,7 +503,7 @@ GC_API GC_PTR GC_malloc_atomic_ignore_off_page GC_PROTO((size_t lb));
+ #if defined(__linux__) || defined(__GLIBC__)
+ # include <features.h>
+ # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
+-     && !defined(__ia64__)
++     && !defined(__ia64__) && !defined(__UCLIBC__)
+ #   ifndef GC_HAVE_BUILTIN_BACKTRACE
+ #     define GC_HAVE_BUILTIN_BACKTRACE
+ #   endif
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0009-c99-snprintf.patch b/meta/recipes-devtools/gcc/gcc-5.2/0009-c99-snprintf.patch
new file mode 100644
index 0000000..525b2a1
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0009-c99-snprintf.patch
@@ -0,0 +1,28 @@
+From 7b7caf4305a54fa4dfdd0efd5bd41cb94cbcf43d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:49:03 +0400
+Subject: [PATCH 09/35] c99-snprintf
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libstdc++-v3/include/c_std/cstdio | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libstdc++-v3/include/c_std/cstdio b/libstdc++-v3/include/c_std/cstdio
+index 37f01ca..f00c06d 100644
+--- a/libstdc++-v3/include/c_std/cstdio
++++ b/libstdc++-v3/include/c_std/cstdio
+@@ -144,7 +144,7 @@ namespace std
+   using ::vsprintf;
+ } // namespace std
+ 
+-#if _GLIBCXX_USE_C99
++#if _GLIBCXX_USE_C99 || defined(__UCLIBC__)
+ 
+ #undef snprintf
+ #undef vfscanf
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0010-gcc-poison-system-directories.patch b/meta/recipes-devtools/gcc/gcc-5.2/0010-gcc-poison-system-directories.patch
new file mode 100644
index 0000000..4e02ef8
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0010-gcc-poison-system-directories.patch
@@ -0,0 +1,192 @@
+From d1e85a363ffcd259e9b0841b85ca10af2f31bd72 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 08:59:00 +0400
+Subject: [PATCH 10/35] gcc: poison-system-directories
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [distribution: codesourcery]
+---
+ gcc/common.opt      |  4 ++++
+ gcc/config.in       |  6 ++++++
+ gcc/configure       | 16 ++++++++++++++++
+ gcc/configure.ac    | 10 ++++++++++
+ gcc/doc/invoke.texi |  9 +++++++++
+ gcc/gcc.c           |  2 ++
+ gcc/incpath.c       | 19 +++++++++++++++++++
+ 7 files changed, 66 insertions(+)
+
+diff --git a/gcc/common.opt b/gcc/common.opt
+index b49ac46..783d231 100644
+--- a/gcc/common.opt
++++ b/gcc/common.opt
+@@ -623,6 +623,10 @@ Wreturn-local-addr
+ Common Var(warn_return_local_addr) Init(1) Warning
+ Warn about returning a pointer/reference to a local or temporary variable.
+ 
++Wpoison-system-directories
++Common Var(flag_poison_system_directories) Init(1) Warning
++Warn for -I and -L options using system directories if cross compiling
++
+ Wshadow
+ Common Var(warn_shadow) Warning
+ Warn when one local variable shadows another
+diff --git a/gcc/config.in b/gcc/config.in
+index f2ed301..f290c6b 100644
+--- a/gcc/config.in
++++ b/gcc/config.in
+@@ -168,6 +168,12 @@
+ #endif
+ 
+ 
++/* Define to warn for use of native system header directories */
++#ifndef USED_FOR_TARGET
++#undef ENABLE_POISON_SYSTEM_DIRECTORIES
++#endif
++
++
+ /* Define if you want all operations on RTL (the basic data structure of the
+    optimizer and back end) to be checked for dynamic type safety at runtime.
+    This is quite expensive. */
+diff --git a/gcc/configure b/gcc/configure
+index 9523773..181748e 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -932,6 +932,7 @@ with_system_zlib
+ enable_maintainer_mode
+ enable_link_mutex
+ enable_version_specific_runtime_libs
++enable_poison_system_directories
+ enable_plugin
+ enable_host_shared
+ enable_libquadmath_support
+@@ -1661,6 +1662,8 @@ Optional Features:
+   --enable-version-specific-runtime-libs
+                           specify that runtime libraries should be installed
+                           in a compiler-specific directory
++  --enable-poison-system-directories
++                          warn for use of native system header directories
+   --enable-plugin         enable plugin support
+   --enable-host-shared    build host code as shared libraries
+   --disable-libquadmath-support
+@@ -28087,6 +28090,19 @@ if test "${enable_version_specific_runtime_libs+set}" = set; then :
+ fi
+ 
+ 
++# Check whether --enable-poison-system-directories was given.
++if test "${enable_poison_system_directories+set}" = set; then :
++  enableval=$enable_poison_system_directories;
++else
++  enable_poison_system_directories=no
++fi
++
++if test "x${enable_poison_system_directories}" = "xyes"; then
++
++$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
++
++fi
++
+ # Substitute configuration variables
+ 
+ 
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 68b0ee8..8b07078 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5571,6 +5571,16 @@ AC_ARG_ENABLE(version-specific-runtime-libs,
+                 [specify that runtime libraries should be
+                  installed in a compiler-specific directory])])
+ 
++AC_ARG_ENABLE([poison-system-directories],
++             AS_HELP_STRING([--enable-poison-system-directories],
++                            [warn for use of native system header directories]),,
++             [enable_poison_system_directories=no])
++if test "x${enable_poison_system_directories}" = "xyes"; then
++  AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
++           [1],
++           [Define to warn for use of native system header directories])
++fi
++
+ # Substitute configuration variables
+ AC_SUBST(subdirs)
+ AC_SUBST(srcdir)
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index 520c2c5..0df8a47 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -269,6 +269,7 @@ Objective-C and Objective-C++ Dialects}.
+ -Woverlength-strings  -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
+ -Wparentheses  -Wpedantic-ms-format -Wno-pedantic-ms-format @gol
+ -Wpointer-arith  -Wno-pointer-to-int-cast @gol
++-Wno-poison-system-directories @gol
+ -Wredundant-decls  -Wno-return-local-addr @gol
+ -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
+ -Wshift-count-negative -Wshift-count-overflow @gol
+@@ -4432,6 +4433,14 @@ made up of data only and thus requires no special treatment.  But, for
+ most targets, it is made up of code and thus requires the stack to be
+ made executable in order for the program to work properly.
+ 
++@item -Wno-poison-system-directories
++@opindex Wno-poison-system-directories
++Do not warn for @option{-I} or @option{-L} options using system
++directories such as @file{/usr/include} when cross compiling.  This
++option is intended for use in chroot environments when such
++directories contain the correct headers and libraries for the target
++system rather than the host.
++
+ @item -Wfloat-equal
+ @opindex Wfloat-equal
+ @opindex Wno-float-equal
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index d956c36..675bcc1 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -835,6 +835,8 @@ proper position among the other output files.  */
+    "%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
+    "%X %{o*} %{e*} %{N} %{n} %{r}\
+     %{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
++    %{Wno-poison-system-directories:--no-poison-system-directories}\
++    %{Werror=poison-system-directories:--error-poison-system-directories}\
+     %{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
+     " CHKP_SPEC " \
+     %{fopenacc|fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index 6c54ca6..cc0c921 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -28,6 +28,7 @@
+ #include "intl.h"
+ #include "incpath.h"
+ #include "cppdefault.h"
++#include "diagnostic-core.h"
+ 
+ /* Microsoft Windows does not natively support inodes.
+    VMS has non-numeric inodes.  */
+@@ -383,6 +384,24 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
+ 	}
+       fprintf (stderr, _("End of search list.\n"));
+     }
++
++#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
++  if (flag_poison_system_directories)
++    {
++       struct cpp_dir *p;
++
++       for (p = heads[QUOTE]; p; p = p->next)
++         {
++          if ((!strncmp (p->name, "/usr/include", 12))
++              || (!strncmp (p->name, "/usr/local/include", 18))
++              || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++            warning (OPT_Wpoison_system_directories,
++                     "include location \"%s\" is unsafe for "
++                     "cross-compilation",
++                     p->name);
++         }
++    }
++#endif
+ }
+ 
+ /* Use given -I paths for #include "..." but not #include <...>, and
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0011-gcc-poison-dir-extend.patch b/meta/recipes-devtools/gcc/gcc-5.2/0011-gcc-poison-dir-extend.patch
new file mode 100644
index 0000000..067d985
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0011-gcc-poison-dir-extend.patch
@@ -0,0 +1,39 @@
+From f158fcc084e88b1d8d1ecf5b005d377765aef16e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:00:34 +0400
+Subject: [PATCH 11/35] gcc-poison-dir-extend
+
+Add /sw/include and /opt/include based on the original
+zecke-no-host-includes.patch patch.  The original patch checked for
+/usr/include, /sw/include and /opt/include and then triggered a failure and
+aborted.
+
+Instead, we add the two missing items to the current scan.  If the user
+wants this to be a failure, they can add "-Werror=poison-system-directories".
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/incpath.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/incpath.c b/gcc/incpath.c
+index cc0c921..0bc1f67 100644
+--- a/gcc/incpath.c
++++ b/gcc/incpath.c
+@@ -394,7 +394,9 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
+          {
+           if ((!strncmp (p->name, "/usr/include", 12))
+               || (!strncmp (p->name, "/usr/local/include", 18))
+-              || (!strncmp (p->name, "/usr/X11R6/include", 18)))
++              || (!strncmp (p->name, "/usr/X11R6/include", 18))
++              || (!strncmp (p->name, "/sw/include", 11))
++              || (!strncmp (p->name, "/opt/include", 12)))
+             warning (OPT_Wpoison_system_directories,
+                      "include location \"%s\" is unsafe for "
+                      "cross-compilation",
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch b/meta/recipes-devtools/gcc/gcc-5.2/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
new file mode 100644
index 0000000..befca73
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0012-gcc-4.3.3-SYSROOT_CFLAGS_FOR_TARGET.patch
@@ -0,0 +1,73 @@
+From a54239cbdc6f93c6d74ea6b078f1470770c4f5aa Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:08:31 +0400
+Subject: [PATCH 12/35] gcc-4.3.3: SYSROOT_CFLAGS_FOR_TARGET
+
+Before committing, I noticed that PR/32161 was marked as a dup of PR/32009, but my previous patch did not fix it.
+
+This alternative patch is better because it lets you just use CFLAGS_FOR_TARGET to set the compilation flags for libgcc. Since bootstrapped target libraries are never compiled with the native compiler, it makes little sense to use different flags for stage1 and later stages. And it also makes little sense to use a different variable than CFLAGS_FOR_TARGET.
+
+Other changes I had to do include:
+
+- moving the creation of default CFLAGS_FOR_TARGET from Makefile.am to configure.ac, because otherwise the BOOT_CFLAGS are substituted into CFLAGS_FOR_TARGET (which is "-O2 -g $(CFLAGS)") via $(CFLAGS). It is also cleaner this way though.
+
+- passing the right CFLAGS to configure scripts as exported environment variables
+
+I also stopped passing LIBCFLAGS to configure scripts since they are unused in the whole src tree. And I updated the documentation as H-P reminded me to do.
+
+Bootstrapped/regtested i686-pc-linux-gnu, will commit to 4.4 shortly. Ok for 4.3?
+
+Signed-off-by: Paolo Bonzini  <bonzini@gnu.org>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ configure | 32 ++++++++++++++++++++++++++++++++
+ 1 file changed, 32 insertions(+)
+
+diff --git a/configure b/configure
+index 50e7cbc..6b97693 100755
+--- a/configure
++++ b/configure
+@@ -6733,6 +6733,38 @@ fi
+ 
+ 
+ 
++# During gcc bootstrap, if we use some random cc for stage1 then CFLAGS
++# might be empty or "-g".  We don't require a C++ compiler, so CXXFLAGS
++# might also be empty (or "-g", if a non-GCC C++ compiler is in the path).
++# We want to ensure that TARGET libraries (which we know are built with
++# gcc) are built with "-O2 -g", so include those options when setting
++# CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET.
++if test "x$CFLAGS_FOR_TARGET" = x; then
++  CFLAGS_FOR_TARGET=$CFLAGS
++  case " $CFLAGS " in
++    *" -O2 "*) ;;
++    *) CFLAGS_FOR_TARGET="-O2 $CFLAGS" ;;
++  esac
++  case " $CFLAGS " in
++    *" -g "* | *" -g3 "*) ;;
++    *) CFLAGS_FOR_TARGET="-g $CFLAGS" ;;
++  esac
++fi
++
++
++if test "x$CXXFLAGS_FOR_TARGET" = x; then
++  CXXFLAGS_FOR_TARGET=$CXXFLAGS
++  case " $CXXFLAGS " in
++    *" -O2 "*) ;;
++    *) CXXFLAGS_FOR_TARGET="-O2 $CXXFLAGS" ;;
++  esac
++  case " $CXXFLAGS " in
++    *" -g "* | *" -g3 "*) ;;
++    *) CXXFLAGS_FOR_TARGET="-g $CXXFLAGS" ;;
++  esac
++fi
++
++
+ # Handle --with-headers=XXX.  If the value is not "yes", the contents of
+ # the named directory are copied to $(tooldir)/sys-include.
+ if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0013-64-bit-multilib-hack.patch b/meta/recipes-devtools/gcc/gcc-5.2/0013-64-bit-multilib-hack.patch
new file mode 100644
index 0000000..67c0661
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0013-64-bit-multilib-hack.patch
@@ -0,0 +1,85 @@
+From d5151bebd079e981dc710f2a031830d89cb1e72e Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:10:06 +0400
+Subject: [PATCH 13/35] 64-bit multilib hack.
+
+GCC has internal multilib handling code but it assumes a very specific rigid directory
+layout. The build system implementation of multilib layout is very generic and allows
+complete customisation of the library directories.
+
+This patch is a partial solution to allow any custom directories to be passed into gcc
+and handled correctly. It forces gcc to use the base_libdir (which is the current
+directory, "."). We need to do this for each multilib that is configured as we don't
+know which compiler options may be being passed into the compiler. Since we have a compiler
+per mulitlib at this point that isn't an issue.
+
+The one problem is the target compiler is only going to work for the default multlilib at
+this point. Ideally we'd figure out which multilibs were being enabled with which paths
+and be able to patch these entries with a complete set of correct paths but this we
+don't have such code at this point. This is something the target gcc recipe should do
+and override these platform defaults in its build config.
+
+RP 15/8/11
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/i386/t-linux64   |  6 ++----
+ gcc/config/mips/t-linux64   | 10 +++-------
+ gcc/config/rs6000/t-linux64 |  5 ++---
+ 3 files changed, 7 insertions(+), 14 deletions(-)
+
+diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
+index f6dbb78..d770da5 100644
+--- a/gcc/config/i386/t-linux64
++++ b/gcc/config/i386/t-linux64
+@@ -32,7 +32,5 @@
+ #
+ comma=,
+ MULTILIB_OPTIONS    = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
+-MULTILIB_DIRNAMES   = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
+-MULTILIB_OSDIRNAMES = m64=../lib64$(call if_multiarch,:x86_64-linux-gnu)
+-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:i386-linux-gnu)
+-MULTILIB_OSDIRNAMES+= mx32=../libx32$(call if_multiarch,:x86_64-linux-gnux32)
++MULTILIB_DIRNAMES = . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
+index 7e96406..b72dcb0 100644
+--- a/gcc/config/mips/t-linux64
++++ b/gcc/config/mips/t-linux64
+@@ -17,10 +17,6 @@
+ # <http://www.gnu.org/licenses/>.
+ 
+ MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
+-MULTILIB_DIRNAMES = n32 32 64
+-MIPS_EL = $(if $(filter %el, $(firstword $(subst -, ,$(target)))),el)
+-MIPS_SOFT = $(if $(strip $(filter MASK_SOFT_FLOAT_ABI, $(target_cpu_default)) $(filter soft, $(with_float))),soft)
+-MULTILIB_OSDIRNAMES = \
+-	../lib32$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabin32$(MIPS_SOFT)) \
+-	../lib$(call if_multiarch,:mips$(MIPS_EL)-linux-gnu$(MIPS_SOFT)) \
+-	../lib64$(call if_multiarch,:mips64$(MIPS_EL)-linux-gnuabi64$(MIPS_SOFT))
++MULTILIB_DIRNAMES = . . .
++MULTILIB_OSDIRNAMES = ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
++
+diff --git a/gcc/config/rs6000/t-linux64 b/gcc/config/rs6000/t-linux64
+index b6b351d..1d5b37a 100644
+--- a/gcc/config/rs6000/t-linux64
++++ b/gcc/config/rs6000/t-linux64
+@@ -26,10 +26,9 @@
+ # MULTILIB_OSDIRNAMES according to what is found on the target.
+ 
+ MULTILIB_OPTIONS    := m64/m32
+-MULTILIB_DIRNAMES   := 64 32
++MULTILIB_DIRNAMES   := . .
+ MULTILIB_EXTRA_OPTS := 
+-MULTILIB_OSDIRNAMES := m64=../lib64$(call if_multiarch,:powerpc64-linux-gnu)
+-MULTILIB_OSDIRNAMES += m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)$(call if_multiarch,:powerpc-linux-gnu)
++MULTILIB_OSDIRNAMES := ../$(shell basename $(base_libdir)) ../$(shell basename $(base_libdir))
+ 
+ rs6000-linux.o: $(srcdir)/config/rs6000/rs6000-linux.c
+ 	$(COMPILE) $<
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0014-optional-libstdc.patch b/meta/recipes-devtools/gcc/gcc-5.2/0014-optional-libstdc.patch
new file mode 100644
index 0000000..374fe43
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0014-optional-libstdc.patch
@@ -0,0 +1,101 @@
+From d7b42d93d077b2523c26f0dff0b6c44fdfff9d3c Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:12:56 +0400
+Subject: [PATCH 14/35] optional libstdc
+
+gcc-runtime builds libstdc++ separately from gcc-cross-*. Its configure tests using g++
+will not run correctly since by default the linker will try to link against libstdc++
+which shouldn't exist yet. We need an option to disable -lstdc++
+option whilst leaving -lc, -lgcc and other automatic library dependencies added by gcc
+driver. This patch adds such an option which only disables the -lstdc++.
+
+A "standard" gcc build uses xgcc and hence avoids this. We should ask upstream how to
+do this officially, the likely answer is don't build libstdc++ separately.
+
+RP 29/6/10
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ gcc/c-family/c.opt  | 4 ++++
+ gcc/cp/g++spec.c    | 1 +
+ gcc/doc/invoke.texi | 8 +++++++-
+ gcc/gcc.c           | 1 +
+ 4 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt
+index 983f4a8..96924f6 100644
+--- a/gcc/c-family/c.opt
++++ b/gcc/c-family/c.opt
+@@ -1543,6 +1543,10 @@ nostdinc++
+ C++ ObjC++
+ Do not search standard system include directories for C++
+ 
++nostdlib++
++Driver
++Do not link standard C++ runtime library
++
+ o
+ C ObjC C++ ObjC++ Joined Separate
+ ; Documented in common.opt
+diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
+index 6536d7e..f57a5d4 100644
+--- a/gcc/cp/g++spec.c
++++ b/gcc/cp/g++spec.c
+@@ -138,6 +138,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options,
+       switch (decoded_options[i].opt_index)
+ 	{
+ 	case OPT_nostdlib:
++	case OPT_nostdlib__:
+ 	case OPT_nodefaultlibs:
+ 	  library = -1;
+ 	  break;
+diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
+index 0df8a47..73856d0 100644
+--- a/gcc/doc/invoke.texi
++++ b/gcc/doc/invoke.texi
+@@ -195,6 +195,7 @@ in the following sections.
+ -fvisibility-inlines-hidden @gol
+ -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
+ -fvtv-counts -fvtv-debug @gol
++-nostdlib++ @gol
+ -fvisibility-ms-compat @gol
+ -fext-numeric-literals @gol
+ -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
+@@ -488,7 +489,7 @@ Objective-C and Objective-C++ Dialects}.
+ -s  -static -static-libgcc -static-libstdc++ @gol
+ -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
+ -static-libmpx -static-libmpxwrappers @gol
+--shared -shared-libgcc  -symbolic @gol
++-shared -shared-libgcc  -symbolic -nostdlib++ @gol
+ -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
+ -u @var{symbol} -z @var{keyword}}
+ 
+@@ -11185,6 +11186,11 @@ These entries are usually resolved by entries in
+ libc.  These entry points should be supplied through some other
+ mechanism when this option is specified.
+ 
++@item -nostdlib++
++@opindex nostdlib++
++Do not use the standard system C++ runtime libraries when linking.
++Only the libraries you specify will be passed to the linker.
++
+ @cindex @option{-lgcc}, use with @option{-nostdlib}
+ @cindex @option{-nostdlib} and unresolved references
+ @cindex unresolved references and @option{-nostdlib}
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 675bcc1..a37ec8b 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -845,6 +845,7 @@ proper position among the other output files.  */
+     %(mflib) " STACK_SPLIT_SPEC "\
+     %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} " SANITIZER_SPEC " \
+     %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
++    %{!nostdlib++:}\
+     %{!nostdlib:%{!nostartfiles:%E}} %{T*} }}}}}}"
+ #endif
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch b/meta/recipes-devtools/gcc/gcc-5.2/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
new file mode 100644
index 0000000..6cf1e3d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0015-gcc-disable-MASK_RELAX_PIC_CALLS-bit.patch
@@ -0,0 +1,59 @@
+From ad1592791698286b80626ddd5679ff2ef457ab76 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:14:20 +0400
+Subject: [PATCH 15/35] gcc: disable MASK_RELAX_PIC_CALLS bit
+
+The new feature added after 4.3.3
+"http://www.pubbs.net/200909/gcc/94048-patch-add-support-for-rmipsjalr.html"
+will cause cc1plus eat up all the system memory when build webkit-gtk.
+The function mips_get_pic_call_symbol keeps on recursively calling itself.
+Disable this feature to walk aside the bug.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure    | 7 -------
+ gcc/configure.ac | 7 -------
+ 2 files changed, 14 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 181748e..9009064 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -26451,13 +26451,6 @@ $as_echo_n "checking assembler and linker for explicit JALR relocation... " >&6;
+         rm -f conftest.*
+       fi
+     fi
+-    if test $gcc_cv_as_ld_jalr_reloc = yes; then
+-      if test x$target_cpu_default = x; then
+-        target_cpu_default=MASK_RELAX_PIC_CALLS
+-      else
+-        target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+-      fi
+-    fi
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_as_ld_jalr_reloc" >&5
+ $as_echo "$gcc_cv_as_ld_jalr_reloc" >&6; }
+ 
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 8b07078..c7a28b4 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -4361,13 +4361,6 @@ x:
+         rm -f conftest.*
+       fi
+     fi
+-    if test $gcc_cv_as_ld_jalr_reloc = yes; then
+-      if test x$target_cpu_default = x; then
+-        target_cpu_default=MASK_RELAX_PIC_CALLS
+-      else
+-        target_cpu_default="($target_cpu_default)|MASK_RELAX_PIC_CALLS"
+-      fi
+-    fi
+     AC_MSG_RESULT($gcc_cv_as_ld_jalr_reloc)
+ 
+     AC_CACHE_CHECK([linker for .eh_frame personality relaxation],
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0016-COLLECT_GCC_OPTIONS.patch b/meta/recipes-devtools/gcc/gcc-5.2/0016-COLLECT_GCC_OPTIONS.patch
new file mode 100644
index 0000000..359de35
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0016-COLLECT_GCC_OPTIONS.patch
@@ -0,0 +1,38 @@
+From 2b22ee2e44688f8a72b9af76a0431d86bac00d47 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:16:28 +0400
+Subject: [PATCH 16/35] COLLECT_GCC_OPTIONS
+
+This patch adds --sysroot into COLLECT_GCC_OPTIONS which is used to
+invoke collect2.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/gcc.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index a37ec8b..87b47c5 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -4352,6 +4352,15 @@ set_collect_gcc_options (void)
+ 		sizeof ("COLLECT_GCC_OPTIONS=") - 1);
+ 
+   first_time = TRUE;
++#ifdef HAVE_LD_SYSROOT
++  if (target_system_root_changed && target_system_root)
++    {
++      obstack_grow (&collect_obstack, "'--sysroot=", sizeof("'--sysroot=")-1);
++      obstack_grow (&collect_obstack, target_system_root,strlen(target_system_root));
++      obstack_grow (&collect_obstack, "'", 1);
++      first_time = FALSE;
++    }
++#endif
+   for (i = 0; (int) i < n_switches; i++)
+     {
+       const char *const *args;
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch b/meta/recipes-devtools/gcc/gcc-5.2/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
new file mode 100644
index 0000000..8506131
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0017-Use-the-defaults.h-in-B-instead-of-S-and-t-oe-in-B.patch
@@ -0,0 +1,96 @@
+From 12f467bc6d8953ba342fe5166b9a2f397b334794 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:17:25 +0400
+Subject: [PATCH 17/35] Use the defaults.h in ${B} instead of ${S}, and t-oe in
+ ${B}
+
+Use the defaults.h in ${B} instead of ${S}, and t-oe in ${B}, so that
+the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+While compiling gcc-crosssdk-initial-x86_64 on some host, there is
+occasionally failure that test the existance of default.h doesn't
+work, the reason is tm_include_list='** defaults.h' rather than
+tm_include_list='** ./defaults.h'
+
+So we add the test condition for this situation.
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gcc/Makefile.in  | 2 +-
+ gcc/configure    | 4 ++--
+ gcc/configure.ac | 4 ++--
+ gcc/mkconfig.sh  | 4 ++--
+ 4 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 4ab7405..661ae17 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -502,7 +502,7 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@
+ TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@
+ 
+ xmake_file=@xmake_file@
+-tmake_file=@tmake_file@
++tmake_file=@tmake_file@ ./t-oe
+ TM_ENDIAN_CONFIG=@TM_ENDIAN_CONFIG@
+ TM_MULTILIB_CONFIG=@TM_MULTILIB_CONFIG@
+ TM_MULTILIB_EXCEPTIONS_CONFIG=@TM_MULTILIB_EXCEPTIONS_CONFIG@
+diff --git a/gcc/configure b/gcc/configure
+index 9009064..f059c2f 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11841,8 +11841,8 @@ for f in $tm_file; do
+        tm_include_list="${tm_include_list} $f"
+        ;;
+     defaults.h )
+-       tm_file_list="${tm_file_list} \$(srcdir)/$f"
+-       tm_include_list="${tm_include_list} $f"
++       tm_file_list="${tm_file_list} ./$f"
++       tm_include_list="${tm_include_list} ./$f"
+        ;;
+     * )
+        tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index c7a28b4..2e668a5 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1832,8 +1832,8 @@ for f in $tm_file; do
+        tm_include_list="${tm_include_list} $f"
+        ;;
+     defaults.h )
+-       tm_file_list="${tm_file_list} \$(srcdir)/$f"
+-       tm_include_list="${tm_include_list} $f"
++       tm_file_list="${tm_file_list} ./$f"
++       tm_include_list="${tm_include_list} ./$f"
+        ;;
+     * )
+        tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
+diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
+index c32f087..6803ab9 100644
+--- a/gcc/mkconfig.sh
++++ b/gcc/mkconfig.sh
+@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
+     if [ $# -ge 1 ]; then
+ 	echo '#ifdef IN_GCC' >> ${output}T
+ 	for file in "$@"; do
+-	    if test x"$file" = x"defaults.h"; then
++	    if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then
+ 		postpone_defaults_h="yes"
+ 	    else
+ 		echo "# include \"$file\"" >> ${output}T
+@@ -109,7 +109,7 @@ esac
+ 
+ # If we postponed including defaults.h, add the #include now.
+ if test x"$postpone_defaults_h" = x"yes"; then
+-    echo "# include \"defaults.h\"" >> ${output}T
++    echo "# include \"./defaults.h\"" >> ${output}T
+ fi
+ 
+ # Add multiple inclusion protection guard, part two.
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0018-fortran-cross-compile-hack.patch b/meta/recipes-devtools/gcc/gcc-5.2/0018-fortran-cross-compile-hack.patch
new file mode 100644
index 0000000..da73392
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0018-fortran-cross-compile-hack.patch
@@ -0,0 +1,46 @@
+From 95506b44c9ef4725fef52fa864d3d3fcf931e443 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:01 +0400
+Subject: [PATCH 18/35] fortran cross-compile hack.
+
+* Fortran would have searched for arm-angstrom-gnueabi-gfortran but would have used
+used gfortan. For gcc_4.2.2.bb we want to use the gfortran compiler from our cross
+directory.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ libgfortran/configure    | 2 +-
+ libgfortran/configure.ac | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgfortran/configure b/libgfortran/configure
+index e1592f7..76d19b3 100755
+--- a/libgfortran/configure
++++ b/libgfortran/configure
+@@ -12747,7 +12747,7 @@ esac
+ 
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ ac_ext=${ac_fc_srcext-f}
+ ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
+index 35a8b39..6a0d8a9 100644
+--- a/libgfortran/configure.ac
++++ b/libgfortran/configure.ac
+@@ -240,7 +240,7 @@ AC_SUBST(enable_static)
+ 
+ # We need gfortran to compile parts of the library
+ #AC_PROG_FC(gfortran)
+-FC="$GFORTRAN"
++#FC="$GFORTRAN"
+ AC_PROG_FC(gfortran)
+ 
+ # extra LD Flags which are required for targets
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0019-libgcc-sjlj-check.patch b/meta/recipes-devtools/gcc/gcc-5.2/0019-libgcc-sjlj-check.patch
new file mode 100644
index 0000000..ec5394a
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0019-libgcc-sjlj-check.patch
@@ -0,0 +1,74 @@
+From 94f619cd3257e35e20a877640d0cb90c2b3efc15 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:20:50 +0400
+Subject: [PATCH 19/35] libgcc-sjlj-check
+
+ac_fn_c_try_compile doesnt seem to keep the intermediate files
+which are needed for sjlj test to pass since it greps into the
+generated file. So we run the compiler command using AC_TRY_COMMAND
+which then generates the needed .s file
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ libgcc/configure    | 10 ++++++----
+ libgcc/configure.ac | 10 ++++------
+ 2 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/libgcc/configure b/libgcc/configure
+index 08c9319..5ffaeb3 100644
+--- a/libgcc/configure
++++ b/libgcc/configure
+@@ -4570,17 +4570,19 @@ void foo ()
+ }
+ 
+ _ACEOF
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-if ac_fn_c_try_compile; then :
++if { ac_try='${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&5'
++  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
++  test $ac_status = 0; }; }; then
+   if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=yes
+   elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=no
+   fi
+ fi
+-CFLAGS=$CFLAGS_hold
+ rm -f conftest*
+ 
+ fi
+diff --git a/libgcc/configure.ac b/libgcc/configure.ac
+index 1c405e8..f52975d 100644
+--- a/libgcc/configure.ac
++++ b/libgcc/configure.ac
+@@ -255,16 +255,14 @@ void foo ()
+   bar();
+ }
+ ])])
+-CFLAGS_hold=$CFLAGS
+-CFLAGS="--save-temps -fexceptions"
+ libgcc_cv_lib_sjlj_exceptions=unknown
+-AS_IF([ac_fn_c_try_compile],
+-  [if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
++if AC_TRY_COMMAND(${CC-cc} -fexceptions -S conftest.c -o conftest.s 1>&AS_MESSAGE_LOG_FD); then
++  if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=yes
+   elif grep _Unwind_Resume conftest.s >/dev/null 2>&1; then
+     libgcc_cv_lib_sjlj_exceptions=no
+-  fi])
+-CFLAGS=$CFLAGS_hold
++  fi
++fi
+ rm -f conftest*
+ ])
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0020-cpp-honor-sysroot.patch b/meta/recipes-devtools/gcc/gcc-5.2/0020-cpp-honor-sysroot.patch
new file mode 100644
index 0000000..71bc68b
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0020-cpp-honor-sysroot.patch
@@ -0,0 +1,54 @@
+From 6e6283d645c83ca534219a02ae882a3d7be95ff1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:22:00 +0400
+Subject: [PATCH 20/35] cpp: honor sysroot.
+
+Currently, if the gcc toolchain is relocated and installed from sstate, then you try and compile
+preprocessed source (.i or .ii files), the compiler will try and access the builtin sysroot location
+rather than the --sysroot option specified on the commandline. If access to that directory is
+permission denied (unreadable), gcc will error.
+
+This happens when ccache is in use due to the fact it uses preprocessed source files.
+
+The fix below adds %I to the cpp-output spec macro so the default substitutions for -iprefix,
+-isystem, -isysroot happen and the correct sysroot is used.
+
+[YOCTO #2074]
+
+RP 2012/04/13
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/cp/lang-specs.h | 2 +-
+ gcc/gcc.c           | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
+index b0728f0..e69ee7d 100644
+--- a/gcc/cp/lang-specs.h
++++ b/gcc/cp/lang-specs.h
+@@ -63,5 +63,5 @@ along with GCC; see the file COPYING3.  If not see
+   {".ii", "@c++-cpp-output", 0, 0, 0},
+   {"@c++-cpp-output",
+    "%{!M:%{!MM:%{!E:\
+-    cc1plus -fpreprocessed %i %(cc1_options) %2\
++    cc1plus -fpreprocessed %i %I %(cc1_options) %2\
+     %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index 87b47c5..e6efae7 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1142,7 +1142,7 @@ static const struct compiler default_compilers[] =
+                     %W{o*:--output-pch=%*}}%V}}}}}}", 0, 0, 0},
+   {".i", "@cpp-output", 0, 0, 0},
+   {"@cpp-output",
+-   "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
++   "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %I %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+   {".s", "@assembler", 0, 0, 0},
+   {"@assembler",
+    "%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0021-MIPS64-Default-to-N64-ABI.patch b/meta/recipes-devtools/gcc/gcc-5.2/0021-MIPS64-Default-to-N64-ABI.patch
new file mode 100644
index 0000000..caad489
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0021-MIPS64-Default-to-N64-ABI.patch
@@ -0,0 +1,57 @@
+From 7f766fc47f9388dd0094852a43f1af2568b4b9b2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:23:08 +0400
+Subject: [PATCH 21/35] MIPS64: Default to N64 ABI
+
+MIPS64 defaults to n32 ABI, this patch makes it
+so that it defaults to N64 ABI
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE config specific]
+---
+ gcc/config.gcc | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index cb08a5c..b155744 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2011,29 +2011,29 @@ mips*-*-linux*)				# Linux MIPS, either endian.
+ 			default_mips_arch=mips32
+ 			;;
+ 		mips64el-st-linux-gnu)
+-			default_mips_abi=n32
++			default_mips_abi=64
+ 			tm_file="${tm_file} mips/st.h"
+ 			tmake_file="${tmake_file} mips/t-st"
+ 			enable_mips_multilibs="yes"
+ 			;;
+ 		mips64octeon*-*-linux*)
+-			default_mips_abi=n32
++			default_mips_abi=64
+ 			tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
+ 			target_cpu_default=MASK_SOFT_FLOAT_ABI
+ 			enable_mips_multilibs="yes"
+ 			;;
+ 		mipsisa64r6*-*-linux*)
+-			default_mips_abi=n32
++			default_mips_abi=64
+ 			default_mips_arch=mips64r6
+ 			enable_mips_multilibs="yes"
+ 			;;
+ 		mipsisa64r2*-*-linux*)
+-			default_mips_abi=n32
++			default_mips_abi=64
+ 			default_mips_arch=mips64r2
+ 			enable_mips_multilibs="yes"
+ 			;;
+ 		mips64*-*-linux* | mipsisa64*-*-linux*)
+-			default_mips_abi=n32
++			default_mips_abi=64
+ 			enable_mips_multilibs="yes"
+ 			;;
+ 	esac
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch b/meta/recipes-devtools/gcc/gcc-5.2/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
new file mode 100644
index 0000000..54520d0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0022-Define-GLIBC_DYNAMIC_LINKER-and-UCLIBC_DYNAMIC_LINKE.patch
@@ -0,0 +1,216 @@
+From 4f94added8b7043642386b31ed4c3a1bd016f316 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:24:50 +0400
+Subject: [PATCH 22/35] Define GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+ relative to SYSTEMLIBS_DIR
+
+This patch defines GLIBC_DYNAMIC_LINKER and UCLIBC_DYNAMIC_LINKER
+relative to SYSTEMLIBS_DIR which can be set in generated headers
+This breaks the assumption of hardcoded multilib in gcc
+Change is only for the supported architectures in OE including
+SH, sparc, alpha for possible future support (if any)
+
+Removes the do_headerfix task in metadata
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE configuration]
+---
+ gcc/config/alpha/linux-elf.h |  4 ++--
+ gcc/config/arm/linux-eabi.h  |  4 ++--
+ gcc/config/arm/linux-elf.h   |  2 +-
+ gcc/config/i386/linux.h      |  2 +-
+ gcc/config/i386/linux64.h    |  6 +++---
+ gcc/config/linux.h           |  8 ++++----
+ gcc/config/mips/linux.h      | 12 ++++++------
+ gcc/config/rs6000/linux64.h  | 10 +++++-----
+ gcc/config/sh/linux.h        |  2 +-
+ gcc/config/sparc/linux.h     |  2 +-
+ gcc/config/sparc/linux64.h   |  4 ++--
+ 11 files changed, 28 insertions(+), 28 deletions(-)
+
+diff --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
+index 2c70a2f..dd048db 100644
+--- a/gcc/config/alpha/linux-elf.h
++++ b/gcc/config/alpha/linux-elf.h
+@@ -23,8 +23,8 @@ along with GCC; see the file COPYING3.  If not see
+ #define EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+ 
+-#define GLIBC_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER	SYSTEMLIBS_DIR "ld-linux.so.2"
++#define UCLIBC_DYNAMIC_LINKER  SYSTEMLIBS_DIR "ld-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index e9d65dc..cfdf3f0 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -68,8 +68,8 @@
+    GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI.  */
+ 
+ #undef  GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "/lib/ld-linux.so.3"
+-#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT "/lib/ld-linux-armhf.so.3"
++#define GLIBC_DYNAMIC_LINKER_SOFT_FLOAT SYSTEMLIBS_DIR "ld-linux.so.3"
++#define GLIBC_DYNAMIC_LINKER_HARD_FLOAT SYSTEMLIBS_DIR "ld-linux-armhf.so.3"
+ #define GLIBC_DYNAMIC_LINKER_DEFAULT GLIBC_DYNAMIC_LINKER_SOFT_FLOAT
+ 
+ #define GLIBC_DYNAMIC_LINKER \
+diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
+index 1279cba..1dde747 100644
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -62,7 +62,7 @@
+ 
+ #define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc"
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #define LINUX_TARGET_LINK_SPEC  "%{h*} \
+    %{static:-Bstatic} \
+diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
+index a100963..21ba2b2 100644
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -20,4 +20,4 @@ along with GCC; see the file COPYING3.  If not see
+ <http://www.gnu.org/licenses/>.  */
+ 
+ #define GNU_USER_LINK_EMULATION "elf_i386"
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index a27d3be..6185cce 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -27,6 +27,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ #define GNU_USER_LINK_EMULATION64 "elf_x86_64"
+ #define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+-#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ld-linux-x32.so.2"
+diff --git a/gcc/config/linux.h b/gcc/config/linux.h
+index 857389a..22b9be5 100644
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -73,10 +73,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+    GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
+    GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
+    supporting both 32-bit and 64-bit compilation.  */
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKERX32 "/lib/ldx32-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKERX32 SYSTEMLIBS_DIR "ldx32-uClibc.so.0"
+ #define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
+diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
+index 91df261..c306afb 100644
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -22,20 +22,20 @@ along with GCC; see the file COPYING3.  If not see
+ #define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
+ 
+ #define GLIBC_DYNAMIC_LINKER32 \
+-  "%{mnan=2008:/lib/ld-linux-mipsn8.so.1;:/lib/ld.so.1}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKER64 \
+-  "%{mnan=2008:/lib64/ld-linux-mipsn8.so.1;:/lib64/ld.so.1}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ #define GLIBC_DYNAMIC_LINKERN32 \
+-  "%{mnan=2008:/lib32/ld-linux-mipsn8.so.1;:/lib32/ld.so.1}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-linux-mipsn8.so.1;:" SYSTEMLIBS_DIR "ld.so.1}"
+ 
+ #undef UCLIBC_DYNAMIC_LINKER32
+ #define UCLIBC_DYNAMIC_LINKER32 \
+-  "%{mnan=2008:/lib/ld-uClibc-mipsn8.so.0;:/lib/ld-uClibc.so.0}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+ #undef UCLIBC_DYNAMIC_LINKER64
+ #define UCLIBC_DYNAMIC_LINKER64 \
+-  "%{mnan=2008:/lib/ld64-uClibc-mipsn8.so.0;:/lib/ld64-uClibc.so.0}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld64-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld64-uClibc.so.0}"
+ #define UCLIBC_DYNAMIC_LINKERN32 \
+-  "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}"
++  "%{mnan=2008:" SYSTEMLIBS_DIR "ld-uClibc-mipsn8.so.0;:" SYSTEMLIBS_DIR "ld-uClibc.so.0}"
+ 
+ #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
+ #define GNU_USER_DYNAMIC_LINKERN32 \
+diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index 0879e7e..31c4338 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -357,14 +357,14 @@ extern int dot_symbols;
+ #undef	LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld.so.1"
+ #ifdef LINUX64_DEFAULT_ABI_ELFv2
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:/lib64/ld64.so.1;:/lib64/ld64.so.2}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv1:" SYSTEMLIBS_DIR "ld64.so.1;:" SYSTEMLIBS_DIR "ld64.so.2}"
+ #else
+-#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:/lib64/ld64.so.2;:/lib64/ld64.so.1}"
++#define GLIBC_DYNAMIC_LINKER64 "%{mabi=elfv2:" SYSTEMLIBS_DIR "ld64.so.2;:" SYSTEMLIBS_DIR "ld64.so.1}"
+ #endif
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld64-uClibc.so.0"
+ #if DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
+index 0f5d614..168416c 100644
+--- a/gcc/config/sh/linux.h
++++ b/gcc/config/sh/linux.h
+@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3.  If not see
+ 
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
+index 56def4b..00b564c 100644
+--- a/gcc/config/sparc/linux.h
++++ b/gcc/config/sparc/linux.h
+@@ -83,7 +83,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
+    When the -shared link option is used a final link is not being
+    done.  */
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #undef  LINK_SPEC
+ #define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
+diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
+index fa805fd..0eb4acd 100644
+--- a/gcc/config/sparc/linux64.h
++++ b/gcc/config/sparc/linux64.h
+@@ -84,8 +84,8 @@ along with GCC; see the file COPYING3.  If not see
+    When the -shared link option is used a final link is not being
+    done.  */
+ 
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER64 SYSTEMLIBS_DIR "ld-linux.so.2"
+ 
+ #ifdef SPARC_BI_ARCH
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0023-gcc-Fix-argument-list-too-long-error.patch b/meta/recipes-devtools/gcc/gcc-5.2/0023-gcc-Fix-argument-list-too-long-error.patch
new file mode 100644
index 0000000..b337df5
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0023-gcc-Fix-argument-list-too-long-error.patch
@@ -0,0 +1,40 @@
+From 8db606205487ebb03eae788826faf64bd6918450 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:26:37 +0400
+Subject: [PATCH 23/35] gcc: Fix argument list too long error.
+
+There would be an "Argument list too long" error when the
+build directory is longer than 200, this is caused by:
+
+headers=`echo $(PLUGIN_HEADERS) | tr ' ' '\012' | sort -u`
+
+The PLUGIN_HEADERS is too long before sort, so the "echo" can't handle
+it, use the $(sort list) of GNU make which can handle the too long list
+would fix the problem, the header would be short enough after sorted.
+The "tr ' ' '\012'" was used for translating the space to "\n", the
+$(sort list) doesn't need this.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 661ae17..9470a92 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -3255,7 +3255,7 @@ install-plugin: installdirs lang.install-plugin s-header-vars install-gengtype
+ # We keep the directory structure for files in config or c-family and .def
+ # files. All other files are flattened to a single directory.
+ 	$(mkinstalldirs) $(DESTDIR)$(plugin_includedir)
+-	headers=`echo $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def) | tr ' ' '\012' | sort -u`; \
++	headers="$(sort $(PLUGIN_HEADERS) $$(cd $(srcdir); echo *.h *.def))"; \
+ 	srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`; \
+ 	for file in $$headers; do \
+ 	  if [ -f $$file ] ; then \
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0024-Disable-sdt.patch b/meta/recipes-devtools/gcc/gcc-5.2/0024-Disable-sdt.patch
new file mode 100644
index 0000000..9f219ca
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0024-Disable-sdt.patch
@@ -0,0 +1,113 @@
+From e136342d2f7c0bdb1cf4b57ad3440d3c9e710322 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:28:10 +0400
+Subject: [PATCH 24/35] Disable sdt.
+
+We don't list dtrace in DEPENDS so we shouldn't be depending on this header.
+It may or may not exist from preivous builds though. To be determinstic, disable
+sdt.h usage always. This avoids build failures if the header is removed after configure
+but before libgcc is compiled for example.
+
+RP 2012/8/7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Disable sdt for libstdc++-v3.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Inappropriate [hack]
+---
+ gcc/configure             | 12 ++++++------
+ gcc/configure.ac          | 18 +++++++++---------
+ libstdc++-v3/configure    |  6 +++---
+ libstdc++-v3/configure.ac |  2 +-
+ 4 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index f059c2f..98853b3 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -27733,12 +27733,12 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
+ $as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
+ have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+-  have_sys_sdt_h=yes
+-
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+-
+-fi
++#if test -f $target_header_dir/sys/sdt.h; then
++#  have_sys_sdt_h=yes
++#
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#
++#fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
+ $as_echo "$have_sys_sdt_h" >&6; }
+ 
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 2e668a5..52cdcb8 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -5232,15 +5232,15 @@ if test x$gcc_cv_libc_provides_ssp = xyes; then
+ fi
+ 
+ # Test for <sys/sdt.h> on the target.
+-GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
+-AC_MSG_CHECKING(sys/sdt.h in the target C library)
+-have_sys_sdt_h=no
+-if test -f $target_header_dir/sys/sdt.h; then
+-  have_sys_sdt_h=yes
+-  AC_DEFINE(HAVE_SYS_SDT_H, 1,
+-            [Define if your target C library provides sys/sdt.h])
+-fi
+-AC_MSG_RESULT($have_sys_sdt_h)
++#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
++#AC_MSG_CHECKING(sys/sdt.h in the target C library)
++#have_sys_sdt_h=no
++#if test -f $target_header_dir/sys/sdt.h; then
++#  have_sys_sdt_h=yes
++#  AC_DEFINE(HAVE_SYS_SDT_H, 1,
++#            [Define if your target C library provides sys/sdt.h])
++#fi
++#AC_MSG_RESULT($have_sys_sdt_h)
+ 
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
+diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
+index fbad667..7d5a6c6 100755
+--- a/libstdc++-v3/configure
++++ b/libstdc++-v3/configure
+@@ -20897,11 +20897,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ 
+-  if test $glibcxx_cv_sys_sdt_h = yes; then
++#  if test $glibcxx_cv_sys_sdt_h = yes; then
+ 
+-$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
++#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+ 
+-  fi
++#  fi
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5
+ $as_echo "$glibcxx_cv_sys_sdt_h" >&6; }
+ 
+diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
+index 7a7c1d8..b13eabc 100644
+--- a/libstdc++-v3/configure.ac
++++ b/libstdc++-v3/configure.ac
+@@ -229,7 +229,7 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
+ GLIBCXX_CHECK_SC_NPROC_ONLN
+ GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
+ GLIBCXX_CHECK_SYSCTL_HW_NCPU
+-GLIBCXX_CHECK_SDT_H
++#GLIBCXX_CHECK_SDT_H
+ 
+ # Check for available headers.
+ AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0025-libtool.patch b/meta/recipes-devtools/gcc/gcc-5.2/0025-libtool.patch
new file mode 100644
index 0000000..b8977d6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0025-libtool.patch
@@ -0,0 +1,42 @@
+From 1ca54967d8f67ab0eca772334e5c925a5e8c80cc Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:29:11 +0400
+Subject: [PATCH 25/35] libtool
+
+libstdc++ from gcc-runtime gets created with -rpath=/usr/lib/../lib for qemux86-64
+when running on am x86_64 build host.
+
+This patch stops this speading to libdir in the libstdc++.la file within libtool.
+Arguably, it shouldn't be passing this into libtool in the first place but
+for now this resolves the nastiest problems this causes.
+
+func_normal_abspath would resolve an empty path to `pwd` so we need
+to filter the zero case.
+
+RP 2012/8/24
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ ltmain.sh | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 9503ec8..0121fba 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -6359,6 +6359,10 @@ func_mode_link ()
+ 	func_warning "ignoring multiple \`-rpath's for a libtool library"
+ 
+       install_libdir="$1"
++      if test -n "$install_libdir"; then
++	func_normal_abspath "$install_libdir"
++	install_libdir=$func_normal_abspath_result
++      fi
+ 
+       oldlibs=
+       if test -z "$rpath"; then
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch b/meta/recipes-devtools/gcc/gcc-5.2/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
new file mode 100644
index 0000000..a8a652a
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0026-gcc-armv4-pass-fix-v4bx-to-linker-to-support-EABI.patch
@@ -0,0 +1,43 @@
+From 5f5ca57fcec4bafe3780371d1342acd40c608697 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:30:32 +0400
+Subject: [PATCH 26/35] gcc: armv4: pass fix-v4bx to linker to support EABI.
+
+The LINK_SPEC for linux gets overwritten by linux-eabi.h which
+means the value of TARGET_FIX_V4BX_SPEC gets lost and as a result
+the option is not passed to linker when chosing march=armv4
+This patch redefines this in linux-eabi.h and reinserts it
+for eabi defaulting toolchains.
+
+We might want to send it upstream.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gcc/config/arm/linux-eabi.h | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index cfdf3f0..048a062 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -77,10 +77,14 @@
+     %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \
+     %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}"
+ 
++/* For armv4 we pass --fix-v4bx to linker to support EABI */
++#undef TARGET_FIX_V4BX_SPEC
++#define TARGET_FIX_V4BX_SPEC "%{mcpu=arm8|mcpu=arm810|mcpu=strongarm*|march=armv4: --fix-v4bx}"
++
+ /* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
+    use the GNU/Linux version, not the generic BPABI version.  */
+ #undef  LINK_SPEC
+-#define LINK_SPEC EABI_LINK_SPEC					\
++#define LINK_SPEC TARGET_FIX_V4BX_SPEC EABI_LINK_SPEC			\
+   LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC,				\
+ 		       LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch b/meta/recipes-devtools/gcc/gcc-5.2/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch
new file mode 100644
index 0000000..445da37
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0027-Use-the-multilib-config-files-from-B-instead-of-usin.patch
@@ -0,0 +1,102 @@
+From 484e8c1e8d43e626ee2ddbde9eb8e0af7a176aef Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 Mar 2013 09:33:04 +0400
+Subject: [PATCH 27/35] Use the multilib config files from ${B} instead of
+ using the ones from ${S}
+
+Use the multilib config files from ${B} instead of using the ones from ${S}
+so that the source can be shared between gcc-cross-initial,
+gcc-cross-intermediate, gcc-cross, gcc-runtime, and also the sdk build.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+---
+ gcc/configure    | 22 ++++++++++++++++++----
+ gcc/configure.ac | 22 ++++++++++++++++++----
+ 2 files changed, 36 insertions(+), 8 deletions(-)
+
+diff --git a/gcc/configure b/gcc/configure
+index 98853b3..d0ec50f 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -11821,10 +11821,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+-	if test -f ${srcdir}/config/$f
+-	then
+-		tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+-	fi
++  case $f in
++    */t-linux64 )
++       if test -f ./config/$f
++       then
++         tmake_file_="${tmake_file_} ./config/$f"
++       fi
++       ;;
++    * )
++       if test -f ${srcdir}/config/$f
++       then
++         tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++       fi
++       ;;
++  esac
+ done
+ tmake_file="${tmake_file_}"
+ 
+@@ -11835,6 +11845,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+   case $f in
++    */linux64.h )
++       tm_file_list="${tm_file_list} ./config/$f"
++       tm_include_list="${tm_include_list} ./config/$f"
++       ;;
+     ./* )
+        f=`echo $f | sed 's/^..//'`
+        tm_file_list="${tm_file_list} $f"
+diff --git a/gcc/configure.ac b/gcc/configure.ac
+index 52cdcb8..3cf606a 100644
+--- a/gcc/configure.ac
++++ b/gcc/configure.ac
+@@ -1812,10 +1812,20 @@ done
+ tmake_file_=
+ for f in ${tmake_file}
+ do
+-	if test -f ${srcdir}/config/$f
+-	then
+-		tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
+-	fi
++  case $f in
++    */t-linux64 )
++       if test -f ./config/$f
++       then
++         tmake_file_="${tmake_file_} ./config/$f"
++       fi
++       ;;
++    * )
++       if test -f ${srcdir}/config/$f
++       then
++         tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
++       fi
++       ;;
++  esac
+ done
+ tmake_file="${tmake_file_}"
+ 
+@@ -1826,6 +1836,10 @@ tm_file_list="options.h"
+ tm_include_list="options.h insn-constants.h"
+ for f in $tm_file; do
+   case $f in
++    */linux64.h )
++       tm_file_list="${tm_file_list} ./config/$f"
++       tm_include_list="${tm_include_list} ./config/$f"
++       ;;
+     ./* )
+        f=`echo $f | sed 's/^..//'`
+        tm_file_list="${tm_file_list} $f"
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch b/meta/recipes-devtools/gcc/gcc-5.2/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
new file mode 100644
index 0000000..4902e90
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0028-Avoid-using-libdir-from-.la-which-usually-points-to-.patch
@@ -0,0 +1,31 @@
+From 112ca9f860114bc79273a79ed42722fdc9ded6ea Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 09:39:38 +0000
+Subject: [PATCH 28/35] Avoid using libdir from .la which usually points to a
+ host path
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 0121fba..52bdbdb 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -5628,6 +5628,9 @@ func_mode_link ()
+ 	    absdir="$abs_ladir"
+ 	    libdir="$abs_ladir"
+ 	  else
++	    # Instead of using libdir from .la which usually points to a host path,
++	    # use the path the .la is contained in.
++	    libdir="$abs_ladir"
+ 	    dir="$libdir"
+ 	    absdir="$libdir"
+ 	  fi
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0029-export-CPP.patch b/meta/recipes-devtools/gcc/gcc-5.2/0029-export-CPP.patch
new file mode 100644
index 0000000..0a05ae5
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0029-export-CPP.patch
@@ -0,0 +1,53 @@
+From a983033f1327a692af55be8d1aa61aede18c4afb Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 09:40:59 +0000
+Subject: [PATCH 29/35] export CPP
+
+The OE environment sets and exports CPP as being the target gcc. When
+building gcc-cross-canadian for a mingw targetted sdk, the following can be found
+in build.x86_64-pokysdk-mingw32.i586-poky-linux/build-x86_64-linux/libiberty/config.log:
+
+configure:3641: checking for _FILE_OFFSET_BITS value needed for large files
+configure:3666: gcc  -c -isystem/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe  conftest.c >&5
+configure:3666: $? = 0
+configure:3698: result: no
+configure:3786: checking how to run the C preprocessor
+configure:3856: result: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32
+configure:3876: x86_64-pokysdk-mingw32-gcc -E --sysroot=/media/build1/poky/build/tmp/sysroots/x86_64-nativesdk-mingw32-pokysdk-mingw32 conftest.c
+configure:3876: $? = 0
+
+Note this is a *build* target (in build-x86_64-linux) so it should be
+using the host "gcc", not x86_64-pokysdk-mingw32-gcc. Since the mingw32
+headers are very different, using the wrong cpp is a real problem. It is leaking
+into configure through the CPP variable. Ultimately this leads to build
+failures related to not being able to include a process.h file for pem-unix.c.
+
+The fix is to ensure we export a sane CPP value into the build
+environment when using build targets. We could define a CPP_FOR_BUILD value which may be
+the version which needs to be upstreamed but for now, this fix is good enough to
+avoid the problem.
+
+RP 22/08/2013
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ Makefile.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.in b/Makefile.in
+index 36b4008..a783e1e 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -149,6 +149,7 @@ BUILD_EXPORTS = \
+ 	AR="$(AR_FOR_BUILD)"; export AR; \
+ 	AS="$(AS_FOR_BUILD)"; export AS; \
+ 	CC="$(CC_FOR_BUILD)"; export CC; \
++	CPP="$(CC_FOR_BUILD) -E"; export CPP; \
+ 	CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ 	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
+ 	CXX="$(CXX_FOR_BUILD)"; export CXX; \
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch b/meta/recipes-devtools/gcc/gcc-5.2/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
new file mode 100644
index 0000000..873dca9
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0030-Enable-SPE-AltiVec-generation-on-powepc-linux-target.patch
@@ -0,0 +1,44 @@
+From 3d870a184c05df1338db1870301c4144ba99fc3d Mon Sep 17 00:00:00 2001
+From: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+Date: Wed, 5 Feb 2014 16:52:31 +0200
+Subject: [PATCH 30/35] Enable SPE & AltiVec generation on powepc*linux target
+
+When is configured with --target=powerpc-linux, the resulting GCC will
+not be able to generate code for SPE targets (e500v1/v2).
+GCC configured with --target=powerpc-linuxspe will not be able to
+generate AltiVec instructions (for e6500).
+This patch modifies the configured file such that SPE or AltiVec code
+can be generated when gcc is configured with --target=powerpc-linux.
+The ABI and speciffic instructions can be selected through the
+"-mabi=spe or -mabi=altivec" and the "-mspe or -maltivec" parameters.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Alexandru-Cezar Sardan <alexandru.sardan@freescale.com>
+---
+ gcc/config.gcc | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index b155744..0541b8a 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2337,7 +2337,14 @@ powerpc-*-rtems*)
+ 	tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-rtems rs6000/t-ppccomm"
+ 	;;
+ powerpc*-*-linux*)
+-	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
++	case ${target} in
++	    powerpc*-*-linux*spe* | powerpc*-*-linux*altivec*)
++		tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h"
++		;;
++	    *)
++		tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h freebsd-spec.h rs6000/sysv4.h rs6000/linuxaltivec.h rs6000/linuxspe.h rs6000/e500.h"
++		;;
++	esac
+ 	extra_options="${extra_options} rs6000/sysv4.opt"
+ 	tmake_file="${tmake_file} rs6000/t-fprules rs6000/t-ppccomm"
+ 	extra_objs="$extra_objs rs6000-linux.o"
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch b/meta/recipes-devtools/gcc/gcc-5.2/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
new file mode 100644
index 0000000..f06cba8
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0031-Disable-the-MULTILIB_OSDIRNAMES-and-other-multilib-o.patch
@@ -0,0 +1,42 @@
+From a824cd3f45875f6c1c47ccdbf33534947bd2b587 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 10:21:55 +0000
+Subject: [PATCH 31/35] Disable the MULTILIB_OSDIRNAMES and other multilib
+ options.
+
+Hard coding the MULTILIB_OSDIRNAMES with ../lib64 is causing problems on
+systems where the libdir is NOT set to /lib64.  This is allowed by the
+ABI, as
+long as the dynamic loader is present in /lib.
+
+We simply want to use the default rules in gcc to find and configure the
+normal libdir.
+
+Upstream-Status: Inappropriate[OE-Specific]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/t-aarch64-linux | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gcc/config/aarch64/t-aarch64-linux b/gcc/config/aarch64/t-aarch64-linux
+index c296376..3bb59bf 100644
+--- a/gcc/config/aarch64/t-aarch64-linux
++++ b/gcc/config/aarch64/t-aarch64-linux
+@@ -21,8 +21,8 @@
+ LIB1ASMSRC   = aarch64/lib1funcs.asm
+ LIB1ASMFUNCS = _aarch64_sync_cache_range
+ 
+-AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
+-MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+-MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
++#AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
++#MULTILIB_OSDIRNAMES = mabi.lp64=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
++#MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+ 
+-MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
++#MULTILIB_OSDIRNAMES += mabi.ilp32=../libilp32
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0032-Ensure-target-gcc-headers-can-be-included.patch b/meta/recipes-devtools/gcc/gcc-5.2/0032-Ensure-target-gcc-headers-can-be-included.patch
new file mode 100644
index 0000000..4513306
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0032-Ensure-target-gcc-headers-can-be-included.patch
@@ -0,0 +1,98 @@
+From e60090f7c537c84fd1b22307edd9f386228c7339 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 10:25:11 +0000
+Subject: [PATCH 32/35] Ensure target gcc headers can be included
+
+There are a few headers installed as part of the OpenEmbedded
+gcc-runtime target (omp.h, ssp/*.h). Being installed from a recipe
+built for the target architecture, these are within the target
+sysroot and not cross/nativesdk; thus they weren't able to be
+found by gcc with the existing search paths. Add support for
+picking up these headers under the sysroot supplied on the gcc
+command line in order to resolve this.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/Makefile.in  | 2 ++
+ gcc/cppdefault.c | 4 ++++
+ gcc/defaults.h   | 9 +++++++++
+ gcc/gcc.c        | 7 -------
+ 4 files changed, 15 insertions(+), 7 deletions(-)
+
+diff --git a/gcc/Makefile.in b/gcc/Makefile.in
+index 9470a92..1497ede 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -582,6 +582,7 @@ libexecdir = @libexecdir@
+ 
+ # Directory in which the compiler finds libraries etc.
+ libsubdir = $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
++libsubdir_target = gcc/$(target_noncanonical)/$(version)
+ # Directory in which the compiler finds executables
+ libexecsubdir = $(libexecdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix)
+ # Directory in which all plugin resources are installed
+@@ -2603,6 +2604,7 @@ CFLAGS-intl.o += -DLOCALEDIR=\"$(localedir)\"
+ 
+ PREPROCESSOR_DEFINES = \
+   -DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
++  -DGCC_INCLUDE_SUBDIR_TARGET=\"$(libsubdir_target)/include\" \
+   -DFIXED_INCLUDE_DIR=\"$(libsubdir)/include-fixed\" \
+   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
+   -DGPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT=$(gcc_gxx_include_dir_add_sysroot) \
+diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
+index 580c1ba..03a0287 100644
+--- a/gcc/cppdefault.c
++++ b/gcc/cppdefault.c
+@@ -59,6 +59,10 @@ const struct default_include cpp_include_defaults[]
+     /* This is the dir for gcc's private headers.  */
+     { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
+ #endif
++#ifdef GCC_INCLUDE_SUBDIR_TARGET
++    /* This is the dir for gcc's private headers under the specified sysroot.  */
++    { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++#endif
+ #ifdef LOCAL_INCLUDE_DIR
+     /* /usr/local/include comes before the fixincluded header files.  */
+     { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+diff --git a/gcc/defaults.h b/gcc/defaults.h
+index 1d54798..983d45e 100644
+--- a/gcc/defaults.h
++++ b/gcc/defaults.h
+@@ -1361,4 +1361,13 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+ 
+ #endif /* GCC_INSN_FLAGS_H  */
+ 
++/* Default prefixes to attach to command names.  */
++
++#ifndef STANDARD_STARTFILE_PREFIX_1
++#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
++#endif
++#ifndef STANDARD_STARTFILE_PREFIX_2
++#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
++#endif
++
+ #endif  /* ! GCC_DEFAULTS_H */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+index e6efae7..3ca27b9 100644
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -1263,13 +1263,6 @@ static const char *gcc_libexec_prefix;
+ 
+ /* Default prefixes to attach to command names.  */
+ 
+-#ifndef STANDARD_STARTFILE_PREFIX_1
+-#define STANDARD_STARTFILE_PREFIX_1 "/lib/"
+-#endif
+-#ifndef STANDARD_STARTFILE_PREFIX_2
+-#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
+-#endif
+-
+ #ifdef CROSS_DIRECTORY_STRUCTURE  /* Don't use these prefixes for a cross compiler.  */
+ #undef MD_EXEC_PREFIX
+ #undef MD_STARTFILE_PREFIX
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch b/meta/recipes-devtools/gcc/gcc-5.2/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
new file mode 100644
index 0000000..519e413
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0033-gcc-4.8-won-t-build-with-disable-dependency-tracking.patch
@@ -0,0 +1,54 @@
+From 997f9e939f85f651b22a48251cfb1444831d54ca Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Feb 2015 11:17:19 +0000
+Subject: [PATCH 33/35] gcc 4.8+ won't build with --disable-dependency-tracking
+
+since the *.Ppo files don't get created unless --enable-dependency-tracking is true.
+
+This patch ensures we only use those compiler options when its enabled.
+
+Upstream-Status: Submitted
+
+(Problem was already reported upstream, attached this patch there
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55930)
+
+RP
+2012/09/22
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libatomic/Makefile.am | 3 ++-
+ libatomic/Makefile.in | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/libatomic/Makefile.am b/libatomic/Makefile.am
+index 3d8ab62..23dff7e 100644
+--- a/libatomic/Makefile.am
++++ b/libatomic/Makefile.am
+@@ -101,7 +101,8 @@ PAT_S		= $(word 3,$(PAT_SPLIT))
+ IFUNC_DEF	= -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT	= $(word $(PAT_S),$(IFUNC_OPTIONS))
+ 
+-M_DEPS		= -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS		= -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS		=
+ M_SIZE		= -DN=$(PAT_N)
+ M_IFUNC		= $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE		= $(PAT_BASE)_n.c
+diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in
+index 9288652..3720256 100644
+--- a/libatomic/Makefile.in
++++ b/libatomic/Makefile.in
+@@ -330,7 +330,8 @@ PAT_N = $(word 2,$(PAT_SPLIT))
+ PAT_S = $(word 3,$(PAT_SPLIT))
+ IFUNC_DEF = -DIFUNC_ALT=$(PAT_S)
+ IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS))
+-M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_TRUE@M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo
++@AMDEP_FALSE@M_DEPS =
+ M_SIZE = -DN=$(PAT_N)
+ M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT))
+ M_FILE = $(PAT_BASE)_n.c
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch b/meta/recipes-devtools/gcc/gcc-5.2/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch
new file mode 100644
index 0000000..207cd7c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0034-Don-t-search-host-directory-during-relink-if-inst_pr.patch
@@ -0,0 +1,38 @@
+From c94da257a219873b946e08306141af7749679f67 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 3 Mar 2015 08:21:19 +0000
+Subject: [PATCH 34/35] Don't search host directory during "relink" if
+ $inst_prefix is provided
+
+http://lists.gnu.org/archive/html/libtool-patches/2011-01/msg00026.html
+
+Upstream-Status: Submitted
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ ltmain.sh | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/ltmain.sh b/ltmain.sh
+index 52bdbdb..82bcec3 100644
+--- a/ltmain.sh
++++ b/ltmain.sh
+@@ -6004,12 +6004,13 @@ func_mode_link ()
+ 	      fi
+ 	    else
+ 	      # We cannot seem to hardcode it, guess we'll fake it.
++	      # Default if $libdir is not relative to the prefix:
+ 	      add_dir="-L$libdir"
+-	      # Try looking first in the location we're being installed to.
++
+ 	      if test -n "$inst_prefix_dir"; then
+ 		case $libdir in
+ 		  [\\/]*)
+-		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
++		    add_dir="-L$inst_prefix_dir$libdir"
+ 		    ;;
+ 		esac
+ 	      fi
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch b/meta/recipes-devtools/gcc/gcc-5.2/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch
new file mode 100644
index 0000000..b75f385
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0035-Dont-link-the-plugins-with-libgomp-explicitly.patch
@@ -0,0 +1,83 @@
+From 3a09545f3d18ce492ef55639215a072282de03d0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 8 Mar 2015 03:41:39 +0000
+Subject: [PATCH 35/35] Dont link the plugins with libgomp explicitly
+
+They are dlopened by libgomp anyway. This fixes
+the libtool relink issue which causes issues during
+cross compilation
+
+libtool: install: /usr/bin/install -c .libs/libgomp.lai
+/home/ubuntu/work/bleeding/build-qemux86-64mc/tmp/work/core2-64-rdk-linux/gcc-runtime/5.0-r0/image/usr/lib/../lib/libgomp.la
+libtool: install: error: cannot install `libgomp-plugin-host_nonshm.la'
+to a directory not ending in /usr/lib
+Makefile:517: recipe for target 'install-toolexeclibLTLIBRARIES' failed
+make[2]: *** [install-toolexeclibLTLIBRARIES] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libgomp/Makefile.in        | 7 +++----
+ libgomp/plugin/Makefrag.am | 3 +--
+ 2 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/libgomp/Makefile.in b/libgomp/Makefile.in
+index b61b108..71b2627 100644
+--- a/libgomp/Makefile.in
++++ b/libgomp/Makefile.in
+@@ -123,7 +123,7 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(infodir)" \
+ 	"$(DESTDIR)$(fincludedir)" "$(DESTDIR)$(libsubincludedir)" \
+ 	"$(DESTDIR)$(toolexeclibdir)"
+ LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
+-libgomp_plugin_host_nonshm_la_DEPENDENCIES = libgomp.la
++libgomp_plugin_host_nonshm_la_LIBADD =
+ am_libgomp_plugin_host_nonshm_la_OBJECTS =  \
+ 	libgomp_plugin_host_nonshm_la-plugin-host.lo
+ libgomp_plugin_host_nonshm_la_OBJECTS =  \
+@@ -133,7 +133,7 @@ libgomp_plugin_host_nonshm_la_LINK = $(LIBTOOL) --tag=CC \
+ 	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ 	$(libgomp_plugin_host_nonshm_la_LDFLAGS) $(LDFLAGS) -o $@
+ am__DEPENDENCIES_1 =
+-@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_DEPENDENCIES = libgomp.la \
++@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_DEPENDENCIES =  \
+ @PLUGIN_NVPTX_TRUE@	$(am__DEPENDENCIES_1)
+ @PLUGIN_NVPTX_TRUE@am_libgomp_plugin_nvptx_la_OBJECTS =  \
+ @PLUGIN_NVPTX_TRUE@	libgomp_plugin_nvptx_la-plugin-nvptx.lo
+@@ -407,7 +407,7 @@ libgomp_la_SOURCES = alloc.c barrier.c critical.c env.c error.c iter.c \
+ @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LDFLAGS =  \
+ @PLUGIN_NVPTX_TRUE@	$(libgomp_plugin_nvptx_version_info) \
+ @PLUGIN_NVPTX_TRUE@	$(lt_host_flags) $(PLUGIN_NVPTX_LDFLAGS)
+-@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBADD = libgomp.la $(PLUGIN_NVPTX_LIBS)
++@PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBADD = $(PLUGIN_NVPTX_LIBS)
+ @PLUGIN_NVPTX_TRUE@libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
+ libgomp_plugin_host_nonshm_version_info = -version-info $(libtool_VERSION)
+ libgomp_plugin_host_nonshm_la_SOURCES = plugin/plugin-host.c
+@@ -415,7 +415,6 @@ libgomp_plugin_host_nonshm_la_CPPFLAGS = $(AM_CPPFLAGS) -DHOST_NONSHM_PLUGIN
+ libgomp_plugin_host_nonshm_la_LDFLAGS = \
+ 	$(libgomp_plugin_host_nonshm_version_info) $(lt_host_flags)
+ 
+-libgomp_plugin_host_nonshm_la_LIBADD = libgomp.la
+ libgomp_plugin_host_nonshm_la_LIBTOOLFLAGS = --tag=disable-static
+ nodist_noinst_HEADERS = libgomp_f.h
+ nodist_libsubinclude_HEADERS = omp.h openacc.h
+diff --git a/libgomp/plugin/Makefrag.am b/libgomp/plugin/Makefrag.am
+index 167485f..d2c5428 100644
+--- a/libgomp/plugin/Makefrag.am
++++ b/libgomp/plugin/Makefrag.am
+@@ -35,7 +35,7 @@ libgomp_plugin_nvptx_la_CPPFLAGS = $(AM_CPPFLAGS) $(PLUGIN_NVPTX_CPPFLAGS)
+ libgomp_plugin_nvptx_la_LDFLAGS = $(libgomp_plugin_nvptx_version_info) \
+ 	$(lt_host_flags)
+ libgomp_plugin_nvptx_la_LDFLAGS += $(PLUGIN_NVPTX_LDFLAGS)
+-libgomp_plugin_nvptx_la_LIBADD = libgomp.la $(PLUGIN_NVPTX_LIBS)
++libgomp_plugin_nvptx_la_LIBADD = $(PLUGIN_NVPTX_LIBS)
+ libgomp_plugin_nvptx_la_LIBTOOLFLAGS = --tag=disable-static
+ endif
+ 
+@@ -45,5 +45,4 @@ libgomp_plugin_host_nonshm_la_SOURCES = plugin/plugin-host.c
+ libgomp_plugin_host_nonshm_la_CPPFLAGS = $(AM_CPPFLAGS) -DHOST_NONSHM_PLUGIN
+ libgomp_plugin_host_nonshm_la_LDFLAGS = \
+ 	$(libgomp_plugin_host_nonshm_version_info) $(lt_host_flags)
+-libgomp_plugin_host_nonshm_la_LIBADD = libgomp.la
+ libgomp_plugin_host_nonshm_la_LIBTOOLFLAGS = --tag=disable-static
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch b/meta/recipes-devtools/gcc/gcc-5.2/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
new file mode 100644
index 0000000..b691946
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0036-Use-SYSTEMLIBS_DIR-replacement-instead-of-hardcoding.patch
@@ -0,0 +1,27 @@
+From 861bcfd4ae814f351e0c668ee26d01d1331e0422 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 28 Apr 2015 23:15:27 -0700
+Subject: [PATCH 36/37] Use SYSTEMLIBS_DIR replacement instead of hardcoding
+ base_libdir
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gcc/config/aarch64/aarch64-linux.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config/aarch64/aarch64-linux.h b/gcc/config/aarch64/aarch64-linux.h
+index 9abb252..79525ee 100644
+--- a/gcc/config/aarch64/aarch64-linux.h
++++ b/gcc/config/aarch64/aarch64-linux.h
+@@ -21,7 +21,7 @@
+ #ifndef GCC_AARCH64_LINUX_H
+ #define GCC_AARCH64_LINUX_H
+ 
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
++#define GLIBC_DYNAMIC_LINKER  SYSTEMLIBS_DIR "ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1"
+ 
+ #undef  ASAN_CC1_SPEC
+ #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0037-pr65779.patch b/meta/recipes-devtools/gcc/gcc-5.2/0037-pr65779.patch
new file mode 100644
index 0000000..1424673
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0037-pr65779.patch
@@ -0,0 +1,173 @@
+List-Id: <gcc-patches.gcc.gnu.org>
+List-Archive: <http://gcc.gnu.org/ml/gcc-patches/>
+List-Post: <mailto:gcc-patches at gcc dot gnu dot org>
+List-Help: <mailto:gcc-patches-help at gcc dot gnu dot org>
+Date: Mon, 20 Apr 2015 12:40:49 +0930
+From: Alan Modra <amodra at gmail dot com>
+To: gcc-patches at gcc dot gnu dot org
+Subject: [Patch] pr65779 - [5/6 Regression] undefined local symbol on powerpc
+
+This patch removes bogus debug info left around by shrink-wrapping,
+which on some powerpc targets with just the right register allocation
+led to assembly errors.
+
+Bootstrapped and regression tested powerpc64-linux and x86_64-linux.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65779
+
+gcc/
+	PR debug/65779
+	* shrink-wrap.c (insn_uses_reg): New function.
+	(move_insn_for_shrink_wrap): Remove debug insns using regs set
+	by the moved insn.
+gcc/testsuite/
+	* gcc.dg/pr65779.c: New.
+	
+Upstream-Status: Pending (from mailing list, not merged yet)
+
+Index: a/gcc/shrink-wrap.c
+===================================================================
+--- a/gcc/shrink-wrap.c.orig
++++ b/gcc/shrink-wrap.c
+@@ -182,6 +182,21 @@ live_edge_for_reg (basic_block bb, int r
+   return live_edge;
+ }
+ 
++static bool
++insn_uses_reg (rtx_insn *insn, unsigned int regno, unsigned int end_regno)
++{
++  df_ref use;
++
++  FOR_EACH_INSN_USE (use, insn)
++    {
++      rtx reg = DF_REF_REG (use);
++
++      if (REG_P (reg) && REGNO (reg) >= regno && REGNO (reg) < end_regno)
++	return true;
++    }
++  return false;
++}
++
+ /* Try to move INSN from BB to a successor.  Return true on success.
+    USES and DEFS are the set of registers that are used and defined
+    after INSN in BB.  SPLIT_P indicates whether a live edge from BB
+@@ -340,10 +355,15 @@ move_insn_for_shrink_wrap (basic_block b
+       *split_p = true;
+     }
+ 
++  vec<basic_block> live_bbs;
++  if (MAY_HAVE_DEBUG_INSNS)
++    live_bbs.create (5);
+   /* At this point we are committed to moving INSN, but let's try to
+      move it as far as we can.  */
+   do
+     {
++      if (MAY_HAVE_DEBUG_INSNS)
++	live_bbs.safe_push (bb);
+       live_out = df_get_live_out (bb);
+       live_in = df_get_live_in (next_block);
+       bb = next_block;
+@@ -426,6 +446,34 @@ move_insn_for_shrink_wrap (basic_block b
+ 	SET_REGNO_REG_SET (bb_uses, i);
+     }
+ 
++  /* Remove debug insns using regs set by the insn we are moving.  */
++  if (MAY_HAVE_DEBUG_INSNS)
++    {
++      while (!live_bbs.is_empty ())
++	{
++	  rtx_insn *dinsn;
++	  basic_block tmp_bb = live_bbs.pop ();
++
++	  FOR_BB_INSNS_REVERSE (tmp_bb, dinsn)
++	    {
++	      if (dinsn == insn)
++		break;
++	      if (DEBUG_INSN_P (dinsn)
++		  && insn_uses_reg (dinsn, dregno, end_dregno))
++		{
++		  if (*split_p)
++		    /* If split, then we will be moving insn into a
++		       newly created block immediately after the entry
++		       block.  Move the debug info there too.  */
++		    emit_debug_insn_after (PATTERN (dinsn), bb_note (bb));
++		  delete_insn (dinsn);
++		  break;
++		}
++	    }
++	}
++      live_bbs.release ();
++    }
++
+   emit_insn_after (PATTERN (insn), bb_note (bb));
+   delete_insn (insn);
+   return true;
+Index: b/gcc/testsuite/gcc.dg/pr65779.c
+===================================================================
+--- /dev/null
++++ b/gcc/testsuite/gcc.dg/pr65779.c
+@@ -0,0 +1,64 @@
++/* { dg-do run } */
++/* { dg-options "-O2 -g" } */
++/* { dg-additional-options "-mrelocatable" { target powerpc-*-rtems* } } */
++
++unsigned long __attribute__ ((noinline))
++adler32 (unsigned long adler, unsigned char *buf, unsigned int len)
++{
++  unsigned long s1 = adler & 0xffff;
++  unsigned long s2 = (adler >> 16) & 0xffff;
++  int k;
++
++  if (buf == 0)
++    return 1L;
++
++  while (len > 0)
++    {
++      k = len < 5552 ? len : 5552;
++      len -= k;
++      while (k >= 16)
++	{
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  s1 += *buf++; s2 += s1;
++	  k -= 16;
++	}
++      if (k != 0)
++	do
++	  {
++	    s1 += *buf++; s2 += s1;
++	  } while (--k);
++      s1 &= 0xffffffffUL;
++      s2 &= 0xffffffffUL;
++      s1 %= 65521L;
++      s2 %= 65521L;
++    }
++  return (s2 << 16) | s1;
++}
++
++unsigned char buf[] = { 0, 1, 2, 3, 4, 5, 6, 7,
++			8, 9, 10, 11, 12, 13, 14, 15,
++			0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
++			0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
++			0x55, 0xaa };
++int
++main ()
++{
++  unsigned long x = adler32 (0, buf, sizeof buf);
++  if (x != 0x640409efUL)
++    __builtin_abort ();
++  return 0;
++}
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0038-fix-g++-sysroot.patch b/meta/recipes-devtools/gcc/gcc-5.2/0038-fix-g++-sysroot.patch
new file mode 100644
index 0000000..f024dd5
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0038-fix-g++-sysroot.patch
@@ -0,0 +1,44 @@
+Portions of
+
+http://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg26013.html
+
+are not upstreamed yet. So lets keep missing pieces.
+
+Upstream-Status: Pending
+
+Without this, compiling something simple like #include <limits> on target
+with c++ test.cpp fails unable to find the header. strace shows it looking in
+usr/include/xxxx rather than /usr/include/xxxx
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gcc-4.8.1/gcc/configure.ac
+===================================================================
+--- gcc-4.8.1.orig/gcc/configure.ac	2013-07-15 15:55:49.488399132 -0700
++++ gcc-4.8.1/gcc/configure.ac	2013-07-15 16:02:31.772406679 -0700
+@@ -148,7 +148,9 @@
+ if test "${with_sysroot+set}" = set; then
+   gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+   if test "${gcc_gxx_without_sysroot}"; then
+-    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    if test x${with_sysroot} != x/; then
++      gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    fi
+     gcc_gxx_include_dir_add_sysroot=1
+   fi
+ fi
+Index: gcc-4.8.1/gcc/configure
+===================================================================
+--- gcc-4.8.1.orig/gcc/configure	2013-07-15 15:55:49.472399132 -0700
++++ gcc-4.8.1/gcc/configure	2013-07-15 16:02:31.780406680 -0700
+@@ -3325,7 +3325,9 @@
+ if test "${with_sysroot+set}" = set; then
+   gcc_gxx_without_sysroot=`expr "${gcc_gxx_include_dir}" : "${with_sysroot}"'\(.*\)'`
+   if test "${gcc_gxx_without_sysroot}"; then
+-    gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    if test x${with_sysroot} != x/; then
++      gcc_gxx_include_dir="${gcc_gxx_without_sysroot}"
++    fi
+     gcc_gxx_include_dir_add_sysroot=1
+   fi
+ fi
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch b/meta/recipes-devtools/gcc/gcc-5.2/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch
new file mode 100644
index 0000000..2f025c6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0039-libcc1-fix-libcc1-s-install-path-and-rpath.patch
@@ -0,0 +1,51 @@
+From acea0df9997a47f8b8224b6ca1618c8c9dfbe6d5 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 5 Jul 2015 20:25:18 -0700
+Subject: [PATCH] libcc1: fix libcc1's install path and rpath
+
+* Install libcc1.so and libcc1plugin.so into
+  $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version), as what we
+  had done to lto-plugin.
+* Fix bad RPATH iussue:
+  gcc-5.2.0: package gcc-plugins contains bad RPATH /patht/to/tmp/sysroots/qemux86-64/usr/lib64/../lib64 in file
+ /path/to/gcc/5.2.0-r0/packages-split/gcc-plugins/usr/lib64/gcc/x86_64-poky-linux/5.2.0/plugin/libcc1plugin.so.0.0.0
+ [rpaths]
+
+Upstream-Status: Inappropriate [OE configuration]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libcc1/Makefile.am  |    4 ++--
+ libcc1/Makefile.in  |    4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libcc1/Makefile.am b/libcc1/Makefile.am
+index 7a274b3..db69bea 100644
+--- a/libcc1/Makefile.am
++++ b/libcc1/Makefile.am
+@@ -35,8 +35,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
+ 	    $(Wc)$(libiberty_normal)))
+ libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
+ 
+-plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
+-cc1libdir = $(libdir)/$(libsuffix)
++cc1libdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
++plugindir = $(cc1libdir)
+ 
+ if ENABLE_PLUGIN
+ plugin_LTLIBRARIES = libcc1plugin.la
+diff --git a/libcc1/Makefile.in b/libcc1/Makefile.in
+index 1916134..c8995d2 100644
+--- a/libcc1/Makefile.in
++++ b/libcc1/Makefile.in
+@@ -262,8 +262,8 @@ libiberty = $(if $(wildcard $(libiberty_noasan)),$(Wc)$(libiberty_noasan), \
+ 	    $(Wc)$(libiberty_normal)))
+ 
+ libiberty_dep = $(patsubst $(Wc)%,%,$(libiberty))
+-plugindir = $(libdir)/gcc/$(target_noncanonical)/$(gcc_version)/plugin
+-cc1libdir = $(libdir)/$(libsuffix)
++cc1libdir = $(libexecdir)/gcc/$(target_noncanonical)/$(gcc_version)
++plugindir = $(cc1libdir)
+ @ENABLE_PLUGIN_TRUE@plugin_LTLIBRARIES = libcc1plugin.la
+ @ENABLE_PLUGIN_TRUE@cc1lib_LTLIBRARIES = libcc1.la
+ BUILT_SOURCES = compiler-name.h
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0040-nativesdk-gcc-support.patch b/meta/recipes-devtools/gcc/gcc-5.2/0040-nativesdk-gcc-support.patch
new file mode 100644
index 0000000..fd81ae2
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0040-nativesdk-gcc-support.patch
@@ -0,0 +1,196 @@
+Being able to build a nativesdk gcc is useful, particularly in cases
+where the host compiler may be of an incompatible version (or a 32
+bit compiler is needed).
+
+Sadly, building nativesdk-gcc is not straight forward. We install
+nativesdk-gcc into a relocatable location and this means that its
+library locations can change. "Normal" sysroot support doesn't help
+in this case since the values of paths like "libdir" change, not just
+base root directory of the system.
+
+In order to handle this we do two things:
+
+a) Add %r into spec file markup which can be used for injected paths
+   such as SYSTEMLIBS_DIR (see gcc_multilib_setup()).
+b) Add other paths which need relocation into a .gccrelocprefix section
+   which the relocation code will notice and adjust automatically.
+
+
+Upstream-Status: Inappropriate
+RP 2015/7/28
+
+diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
+--- a/gcc/cppdefault.c
++++ b/gcc/cppdefault.c
+@@ -35,6 +35,30 @@
+ # undef CROSS_INCLUDE_DIR
+ #endif
+ 
++static char GPLUSPLUS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_INCLUDE_DIR;
++static char GCC_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GCC_INCLUDE_DIR;
++static char GPLUSPLUS_TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_TOOL_INCLUDE_DIR;
++static char GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = GPLUSPLUS_BACKWARD_INCLUDE_DIR;
++static char STANDARD_STARTFILE_PREFIX_2VAR[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET;
++#ifdef LOCAL_INCLUDE_DIR
++static char LOCAL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = LOCAL_INCLUDE_DIR;
++#endif
++#ifdef PREFIX_INCLUDE_DIR
++static char PREFIX_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = PREFIX_INCLUDE_DIR;
++#endif
++#ifdef FIXED_INCLUDE_DIR
++static char FIXED_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = FIXED_INCLUDE_DIR;
++#endif
++#ifdef CROSS_INCLUDE_DIR
++static char CROSS_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = CROSS_INCLUDE_DIR;
++#endif
++#ifdef TOOL_INCLUDE_DIR
++static char TOOL_INCLUDE_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = TOOL_INCLUDE_DIR;
++#endif
++#ifdef NATIVE_SYSTEM_HEADER_DIR
++static char NATIVE_SYSTEM_HEADER_DIRVAR[4096] __attribute__ ((section (".gccrelocprefix"))) = NATIVE_SYSTEM_HEADER_DIR;
++#endif
++
+ const struct default_include cpp_include_defaults[]
+ #ifdef INCLUDE_DEFAULTS
+ = INCLUDE_DEFAULTS;
+@@ -42,38 +66,38 @@ const struct default_include cpp_include_defaults[]
+ = {
+ #ifdef GPLUSPLUS_INCLUDE_DIR
+     /* Pick up GNU C++ generic include files.  */
+-    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,
++    { GPLUSPLUS_INCLUDE_DIRVAR, "G++", 1, 1,
+       GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+ #endif
+ #ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
+     /* Pick up GNU C++ target-dependent include files.  */
+-    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,
++    { GPLUSPLUS_TOOL_INCLUDE_DIRVAR, "G++", 1, 1,
+       GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },
+ #endif
+ #ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
+     /* Pick up GNU C++ backward and deprecated include files.  */
+-    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1,
++    { GPLUSPLUS_BACKWARD_INCLUDE_DIRVAR, "G++", 1, 1,
+       GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_DIR
+     /* This is the dir for gcc's private headers.  */
+-    { GCC_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
++    { GCC_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef GCC_INCLUDE_SUBDIR_TARGET
+     /* This is the dir for gcc's private headers under the specified sysroot.  */
+-    { STANDARD_STARTFILE_PREFIX_2 GCC_INCLUDE_SUBDIR_TARGET, "GCC", 0, 0, 1, 0 },
++    { STANDARD_STARTFILE_PREFIX_2VAR, "GCC", 0, 0, 1, 0 },
+ #endif
+ #ifdef LOCAL_INCLUDE_DIR
+     /* /usr/local/include comes before the fixincluded header files.  */
+-    { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },
+-    { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
++    { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 2 },
++    { LOCAL_INCLUDE_DIRVAR, 0, 0, 1, 1, 0 },
+ #endif
+ #ifdef PREFIX_INCLUDE_DIR
+-    { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0 },
++    { PREFIX_INCLUDE_DIRVAR, 0, 0, 1, 0, 0 },
+ #endif
+ #ifdef FIXED_INCLUDE_DIR
+     /* This is the dir for fixincludes.  */
+-    { FIXED_INCLUDE_DIR, "GCC", 0, 0, 0,
++    { FIXED_INCLUDE_DIRVAR, "GCC", 0, 0, 0,
+       /* A multilib suffix needs adding if different multilibs use
+ 	 different headers.  */
+ #ifdef SYSROOT_HEADERS_SUFFIX_SPEC
+@@ -85,16 +109,16 @@ const struct default_include cpp_include_defaults[]
+ #endif
+ #ifdef CROSS_INCLUDE_DIR
+     /* One place the target system's headers might be.  */
+-    { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0 },
++    { CROSS_INCLUDE_DIRVAR, "GCC", 0, 0, 0, 0 },
+ #endif
+ #ifdef TOOL_INCLUDE_DIR
+     /* Another place the target system's headers might be.  */
+-    { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0 },
++    { TOOL_INCLUDE_DIRVAR, "BINUTILS", 0, 1, 0, 0 },
+ #endif
+ #ifdef NATIVE_SYSTEM_HEADER_DIR
+     /* /usr/include comes dead last.  */
+-    { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
+-    { NATIVE_SYSTEM_HEADER_DIR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
++    { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 2 },
++    { NATIVE_SYSTEM_HEADER_DIRVAR, NATIVE_SYSTEM_HEADER_COMPONENT, 0, 0, 1, 0 },
+ #endif
+     { 0, 0, 0, 0, 0, 0 }
+   };
+diff --git a/gcc/cppdefault.h b/gcc/cppdefault.h
+--- a/gcc/cppdefault.h
++++ b/gcc/cppdefault.h
+@@ -33,7 +33,8 @@
+ 
+ struct default_include
+ {
+-  const char *const fname;	/* The name of the directory.  */
++  const char *fname;     /* The name of the directory.  */
++
+   const char *const component;	/* The component containing the directory
+ 				   (see update_path in prefix.c) */
+   const char cplusplus;		/* Only look here if we're compiling C++.  */
+diff --git a/gcc/gcc.c b/gcc/gcc.c
+--- a/gcc/gcc.c
++++ b/gcc/gcc.c
+@@ -120,6 +120,8 @@ static const char *target_system_root = TARGET_SYSTEM_ROOT;
+ #else
+ static const char *target_system_root = 0;
+ #endif
++ 
++static char target_relocatable_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = SYSTEMLIBS_DIR;
+ 
+ /* Nonzero means pass the updated target_system_root to the compiler.  */
+ 
+@@ -390,6 +392,7 @@ or with constant text in a single argument.
+  %G     process LIBGCC_SPEC as a spec.
+  %R     Output the concatenation of target_system_root and
+         target_sysroot_suffix.
++ %r     Output the base path target_relocatable_prefix
+  %S     process STARTFILE_SPEC as a spec.  A capital S is actually used here.
+  %E     process ENDFILE_SPEC as a spec.  A capital E is actually used here.
+  %C     process CPP_SPEC as a spec.
+@@ -1286,10 +1289,10 @@ static const char *gcc_libexec_prefix;
+    gcc_exec_prefix is set because, in that case, we know where the
+    compiler has been installed, and use paths relative to that
+    location instead.  */
+-static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
+-static const char *const standard_libexec_prefix = STANDARD_LIBEXEC_PREFIX;
+-static const char *const standard_bindir_prefix = STANDARD_BINDIR_PREFIX;
+-static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
++static char standard_exec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_EXEC_PREFIX;
++static char standard_libexec_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_LIBEXEC_PREFIX;
++static char standard_bindir_prefix[4096] __attribute__ ((section (".gccrelocprefix"))) = STANDARD_BINDIR_PREFIX;
++static char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+ 
+ /* For native compilers, these are well-known paths containing
+    components that may be provided by the system.  For cross
+@@ -1297,9 +1300,9 @@ static const char *const standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
+ static const char *md_exec_prefix = MD_EXEC_PREFIX;
+ static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
+ static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
+-static const char *const standard_startfile_prefix_1
++static char standard_startfile_prefix_1[4096] __attribute__ ((section (".gccrelocprefix")))
+   = STANDARD_STARTFILE_PREFIX_1;
+-static const char *const standard_startfile_prefix_2
++static char standard_startfile_prefix_2[4096] __attribute__ ((section (".gccrelocprefix")))
+   = STANDARD_STARTFILE_PREFIX_2;
+ 
+ /* A relative path to be used in finding the location of tools
+@@ -5550,6 +5553,11 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
+ 	      }
+ 	    break;
+ 
++          case 'r':
++              obstack_grow (&obstack, target_relocatable_prefix,
++		      strlen (target_relocatable_prefix));
++            break;
++
+ 	  case 'S':
+ 	    value = do_spec_1 (startfile_spec, 0, NULL);
+ 	    if (value != 0)
diff --git a/meta/recipes-devtools/gcc/gcc-5.2/0041-handle-target-sysroot-multilib.patch b/meta/recipes-devtools/gcc/gcc-5.2/0041-handle-target-sysroot-multilib.patch
new file mode 100644
index 0000000..5356984
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-5.2/0041-handle-target-sysroot-multilib.patch
@@ -0,0 +1,88 @@
+Search target sysroot gcc version specific dirs with multilib.
+
+We install the gcc libraries (such as crtbegin.p) into
+<sysroot><libdir>/<target-sys>/5.2.0/
+which is a default search path for GCC (aka multi_suffix in the 
+code below). <target-sys> is 'machine' in gcc's terminology. We use
+these directories so that multiple gcc versions could in theory 
+co-exist on target.
+
+We only want to build one gcc-cross-canadian per arch and have this work 
+for all multilibs. <target-sys> can be handled by mapping the multilib
+<target-sys> to the one used by gcc-cross-canadian, e.g. mips64-polkmllib32-linux 
+is symlinked to by mips64-poky-linux.
+
+The default gcc search path in the target sysroot for a "lib64" mutlilib is:
+
+<sysroot>/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/../lib64/
+<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/../lib64/
+<sysroot>/lib32/
+<sysroot>/usr/lib32/
+
+which means that the lib32 crtbegin.o will be found and the lib64 ones
+will not which leads to compiler failures.
+
+This patch injects a multilib version of that path first so the lib64
+binaries can be found first. With this change the search path becomes:
+
+<sysroot>/lib32/../lib64/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/lib32/../lib64/
+<sysroot>/usr/lib32/../lib64/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/mips64-poky-linux/5.2.0/
+<sysroot>/usr/lib32/../lib64/
+<sysroot>/lib32/
+<sysroot>/usr/lib32/
+
+Upstream-Status: Pending
+RP 2015/7/31
+
+Index: gcc-5.2.0/gcc/gcc.c
+===================================================================
+--- gcc-5.2.0.orig/gcc/gcc.c
++++ gcc-5.2.0/gcc/gcc.c
+@@ -2305,7 +2305,7 @@ for_each_path (const struct path_prefix
+       if (path == NULL)
+ 	{
+ 	  len = paths->max_len + extra_space + 1;
+-	  len += MAX (MAX (suffix_len, multi_os_dir_len), multiarch_len);
++	  len += MAX ((suffix_len + multi_os_dir_len), multiarch_len);
+ 	  path = XNEWVEC (char, len);
+ 	}
+ 
+@@ -2317,6 +2317,33 @@ for_each_path (const struct path_prefix
+ 	  /* Look first in MACHINE/VERSION subdirectory.  */
+ 	  if (!skip_multi_dir)
+ 	    {
++	      if (!(pl->os_multilib ? skip_multi_os_dir : skip_multi_dir))
++	        {
++	          const char *this_multi;
++	          size_t this_multi_len;
++
++	          if (pl->os_multilib)
++		    {
++		      this_multi = multi_os_dir;
++		      this_multi_len = multi_os_dir_len;
++		    }
++	          else
++		    {
++		      this_multi = multi_dir;
++		      this_multi_len = multi_dir_len;
++		    }
++
++	          /* Look in multilib MACHINE/VERSION subdirectory first */
++	          if (this_multi_len)
++	            {
++		      memcpy (path + len, this_multi, this_multi_len + 1);
++	              memcpy (path + len + this_multi_len, multi_suffix, suffix_len + 1);
++	              ret = callback (path, callback_info);
++	                if (ret)
++		          break;
++	            }
++	        }
++
+ 	      memcpy (path + len, multi_suffix, suffix_len + 1);
+ 	      ret = callback (path, callback_info);
+ 	      if (ret)
diff --git a/meta/recipes-devtools/gcc/gcc-common.inc b/meta/recipes-devtools/gcc/gcc-common.inc
new file mode 100644
index 0000000..d63c07f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-common.inc
@@ -0,0 +1,100 @@
+SUMMARY = "GNU cc and gcc C compilers"
+HOMEPAGE = "http://www.gnu.org/software/gcc/"
+SECTION = "devel"
+LICENSE = "GPL"
+
+NATIVEDEPS = ""
+
+inherit autotools gettext texinfo
+
+BPN = "gcc"
+
+def get_gcc_float_setting(bb, d):
+    if d.getVar('ARMPKGSFX_EABI', True) == "hf" and d.getVar('TRANSLATED_TARGET_ARCH', True) == "arm":
+        return "--with-float=hard"
+    if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+        return "--with-float=soft"
+    if d.getVar('TARGET_FPU', True) in [ 'ppc-efd' ]:
+        return "--enable-e500_double"
+    return ""
+
+get_gcc_float_setting[vardepvalue] = "${@get_gcc_float_setting(bb, d)}"
+
+def get_gcc_mips_plt_setting(bb, d):
+    if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'mips', 'mipsel' ] and bb.utils.contains('DISTRO_FEATURES', 'mplt', True, False, d):
+        return "--with-mips-plt"
+    return ""
+
+def get_long_double_setting(bb, d):
+    if d.getVar('TRANSLATED_TARGET_ARCH', True) in [ 'powerpc', 'powerpc64' ] and d.getVar('TCLIBC', True) in [ 'uclibc', 'glibc' ]:
+        return "--with-long-double-128"
+    return ""
+
+def get_gcc_multiarch_setting(bb, d):
+    target_arch = d.getVar('TRANSLATED_TARGET_ARCH', True)
+    multiarch_options = {
+        "i586":    "--enable-targets=all",
+        "i686":    "--enable-targets=all",
+        "powerpc": "--enable-targets=powerpc64",
+        "mips":    "--enable-targets=all",
+        "sparc":   "--enable-targets=all",
+    }
+
+    if bb.utils.contains('DISTRO_FEATURES', 'multiarch', True, False, d):
+        if target_arch in multiarch_options :
+            return multiarch_options[target_arch]
+    return ""
+
+# this is used by the multilib setup of gcc
+def get_tune_parameters(tune, d):
+    availtunes = d.getVar('AVAILTUNES', True)
+    if tune not in availtunes.split():
+        bb.error('The tune: %s is not one of the available tunes: %s', tune or None, availtunes)
+
+    localdata = bb.data.createCopy(d)
+    override = ':tune-' + tune
+    localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES', False) + override)
+    bb.data.update_data(localdata)
+
+    retdict = {}
+    retdict['tune'] = tune
+    retdict['ccargs'] = localdata.getVar('TUNE_CCARGS', True)
+    retdict['features'] = localdata.getVar('TUNE_FEATURES', True)
+    # BASELIB is used by the multilib code to change library paths
+    retdict['baselib'] = localdata.getVar('BASE_LIB', True) or localdata.getVar('BASELIB', True)
+    retdict['arch'] = localdata.getVar('TUNE_ARCH', True)
+    retdict['abiextension'] = localdata.getVar('ABIEXTENSION', True)
+    retdict['target_fpu'] = localdata.getVar('TARGET_FPU', True)
+    retdict['pkgarch'] = localdata.getVar('TUNE_PKGARCH', True)
+    retdict['package_extra_archs'] = localdata.getVar('PACKAGE_EXTRA_ARCHS', True)
+    return retdict
+
+get_tune_parameters[vardepsexclude] = "AVAILTUNES TUNE_CCARGS OVERRIDES TUNE_FEATURES BASE_LIB BASELIB TUNE_ARCH ABIEXTENSION TARGET_FPU TUNE_PKGARCH PACKAGE_EXTRA_ARCHS"
+
+DEBIANNAME_${MLPREFIX}libgcc = "libgcc1"
+
+MIRRORS =+ "\
+${GNU_MIRROR}/gcc    ftp://gcc.gnu.org/pub/gcc/releases/ \n \
+${GNU_MIRROR}/gcc	ftp://gd.tuwien.ac.at/gnu/gcc/ \n \
+${GNU_MIRROR}/gcc	http://mirrors.rcn.net/pub/sourceware/gcc/releases/ \n \
+${GNU_MIRROR}/gcc   http://gcc.get-software.com/releases/ \n \
+${GNU_MIRROR}/gcc	http://gcc.get-software.com/releases/ \n \
+"
+#
+# Set some default values
+#
+gcclibdir = "${libdir}/gcc"
+BINV = "${PV}"
+#S = "${WORKDIR}/gcc-${PV}"
+S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/gcc-${PV}"
+B = "${WORKDIR}/gcc-${PV}/build.${HOST_SYS}.${TARGET_SYS}"
+
+target_includedir ?= "${includedir}"
+target_libdir ?= "${libdir}"
+target_base_libdir ?= "${base_libdir}"
+target_prefix ?= "${prefix}"
+
+# We need to ensure that for the shared work directory, the do_patch signatures match
+# The real WORKDIR location isn't a dependency for the shared workdir.
+src_patches[vardepsexclude] = "WORKDIR"
+should_apply[vardepsexclude] += "PN"
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
new file mode 100644
index 0000000..a14be73
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -0,0 +1,128 @@
+require gcc-multilib-config.inc
+require gcc-shared-source.inc
+#
+# Build the list of lanaguages to build.
+#
+# These can be overridden by the version specific .inc file.
+
+# Java (gcj doesn't work on all architectures)
+JAVA ?= ",java"
+JAVA_arm ?= ""
+JAVA_armeb ?= ""
+JAVA_mipsel ?= ""
+JAVA_sh3 ?= ""
+# gcc 3.x expects 'f77', 4.0 expects 'f95', 4.1 and 4.2 expect 'fortran'
+FORTRAN ?= ",f77"
+LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
+# disable --enable-target-optspace for powerpc SPE
+# at -Os libgcc.so.1 creates references into
+# hidden symbols in libgcc.a which linker complains
+# when linking shared libraries further in the build like (gnutls)
+
+SPECIAL_ARCH_LIST = "powerpc"
+OPTSPACE = '${@bb.utils.contains("SPECIAL_ARCH_LIST", "${TARGET_ARCH}", "", "--enable-target-optspace",d)}'
+
+EXTRA_OECONF_BASE ?= ""
+EXTRA_OECONF_PATHS ?= ""
+EXTRA_OECONF_INITIAL ?= ""
+
+GCCMULTILIB ?= "--disable-multilib"
+GCCTHREADS ?= "posix"
+
+EXTRA_OECONF = "\
+    ${@['--enable-clocale=generic', ''][d.getVar('USE_NLS', True) != 'no']} \
+    --with-gnu-ld \
+    --enable-shared \
+    --enable-languages=${LANGUAGES} \
+    --enable-threads=${GCCTHREADS} \
+    ${GCCMULTILIB} \
+    --enable-c99 \
+    --enable-long-long \
+    --enable-symvers=gnu \
+    --enable-libstdcxx-pch \
+    --program-prefix=${TARGET_PREFIX} \
+    --without-local-prefix \
+    ${OPTSPACE} \
+    ${EXTRA_OECONF_BASE} \
+    ${EXTRA_OECONF_GCC_FLOAT} \
+    ${EXTRA_OECONF_PATHS} \
+    ${@get_gcc_mips_plt_setting(bb, d)} \
+    ${@get_long_double_setting(bb, d)} \
+    ${@get_gcc_multiarch_setting(bb, d)} \
+"
+
+export gcc_cv_collect2_libs = 'none required'
+# We need to set gcc_cv_collect2_libs else there is cross-compilation badness
+# in the config.log files (which might not get generated until do_compile
+# hence being missed by the insane do_configure check).
+
+# Build uclibc compilers without cxa_atexit support
+EXTRA_OECONF_append_linux = " --enable-__cxa_atexit"
+EXTRA_OECONF_append_libc-uclibc = " --enable-__cxa_atexit"
+
+EXTRA_OECONF_append_mips64 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64el = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64n32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+EXTRA_OECONF_append_mips64eln32 = " --with-abi=64 --with-arch-64=mips64 --with-tune-64=mips64"
+
+# ARMv6+ adds atomic instructions that affect the ABI in libraries built
+# with TUNE_CCARGS in gcc-runtime.  Make the compiler default to a
+# compatible architecture.  armv6 and armv7a cover the minimum tune
+# features used in OE.
+EXTRA_OECONF_append_armv6 = " --with-arch=armv6"
+EXTRA_OECONF_append_armv7a = " --with-arch=armv7-a"
+
+EXTRA_OECONF_GCC_FLOAT ??= ""
+CPPFLAGS = ""
+
+SYSTEMHEADERS = "${target_includedir}"
+SYSTEMLIBS = "${target_base_libdir}/"
+SYSTEMLIBS1 = "${target_libdir}/"
+
+do_configure_prepend () {
+	# teach gcc to find correct target includedir when checking libc ssp support
+	mkdir -p ${B}/gcc
+	echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe
+	cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new
+	cat >>${B}/gcc/defaults.h.new <<_EOF
+#define NATIVE_SYSTEM_HEADER_DIR "${SYSTEMHEADERS}"
+#define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
+#define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
+#define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
+#endif /* ! GCC_DEFAULTS_H */
+_EOF
+	mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h
+}
+
+do_configure () {
+	# Setup these vars for cross building only
+	# ... because foo_FOR_TARGET apparently gets misinterpreted inside the
+	# gcc build stuff when the build is producing a cross compiler - i.e.
+	# when the 'current' target is the 'host' system, and the host is not
+	# the target (because the build is actually making a cross compiler!)
+	if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
+		export CC_FOR_TARGET="${CC}"
+		export GCC_FOR_TARGET="${CC}"
+		export CXX_FOR_TARGET="${CXX}"
+		export AS_FOR_TARGET="${HOST_PREFIX}as"
+		export LD_FOR_TARGET="${HOST_PREFIX}ld"
+		export NM_FOR_TARGET="${HOST_PREFIX}nm"
+		export AR_FOR_TARGET="${HOST_PREFIX}ar"
+		export GFORTRAN_FOR_TARGET="gfortran"
+		export RANLIB_FOR_TARGET="${HOST_PREFIX}ranlib"
+	fi
+	export CC_FOR_BUILD="${BUILD_CC}"
+	export CXX_FOR_BUILD="${BUILD_CXX}"
+	export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
+	export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
+	export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
+	export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
+	export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+	export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+	export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+	export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
+
+
+	oe_runconf
+}
+
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian.inc b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
new file mode 100644
index 0000000..54e4881
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian.inc
@@ -0,0 +1,177 @@
+inherit cross-canadian
+
+SUMMARY = "GNU cc and gcc C compilers (cross-canadian for ${TARGET_ARCH} target)"
+PN = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${HOST_PREFIX}binutils-crosssdk virtual/nativesdk-${HOST_PREFIX}libc-for-gcc nativesdk-gettext"
+
+GCCMULTILIB = "--enable-multilib"
+
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+    --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \
+    --with-build-time-tools=${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}/bin \
+    --with-sysroot=/not/exist \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+# We have to point gcc at a sysroot but we don't need to rebuild if this changes
+# e.g. we switch between different machines with different tunes.
+EXTRA_OECONF_PATHS[vardepsexclude] = "TUNE_PKGARCH"
+TARGET_ARCH[vardepsexclude] = "TUNE_ARCH"
+get_gcc_float_setting[vardepvalue] = ""
+
+#
+# gcc-cross looks and finds these in ${exec_prefix} but we're not so lucky
+# for the sdk. Hardcoding the paths ensures the build doesn't go canadian or worse.
+#
+export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
+export AS_FOR_TARGET = "${TARGET_PREFIX}as"
+export DLLTOOL_FOR_TARGET = "${TARGET_PREFIX}dlltool"
+export CC_FOR_TARGET = "${TARGET_PREFIX}gcc"
+export CXX_FOR_TARGET = "${TARGET_PREFIX}g++"
+export GCC_FOR_TARGET = "${TARGET_PREFIX}gcc"
+export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
+export LIPO_FOR_TARGET = "${TARGET_PREFIX}lipo"
+export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
+export OBJDUMP_FOR_TARGET = "${TARGET_PREFIX}objdump"
+export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
+export STRIP_FOR_TARGET = "${TARGET_PREFIX}strip"
+export WINDRES_FOR_TARGET = "${TARGET_PREFIX}windres"
+
+#
+# We need to override this and make sure the compiler can find staging
+#
+export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET}"
+
+do_configure () {
+	export CC_FOR_BUILD="${BUILD_CC}"
+	export CXX_FOR_BUILD="${BUILD_CXX}"
+	export CFLAGS_FOR_BUILD="${BUILD_CFLAGS}"
+	export CPPFLAGS_FOR_BUILD="${BUILD_CPPFLAGS}"
+	export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}"
+	export LDFLAGS_FOR_BUILD="${BUILD_LDFLAGS}"
+	export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+	export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+	export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+	export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
+	oe_runconf
+}
+
+do_compile () {
+	oe_runmake all-host configure-target-libgcc
+}
+
+# Having anything auto depending on gcc-cross-sdk is a really bad idea...
+EXCLUDE_FROM_SHLIBS = "1"
+
+PACKAGES = "${PN}-dbg ${PN} ${PN}-doc"
+
+FILES_${PN} = "\
+    ${exec_prefix}/bin/* \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/* \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/lib* \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.* \
+    ${includedir}/c++/${BINV} \
+    ${prefix}/${TARGET_SYS}/bin/* \
+    ${prefix}/${TARGET_SYS}/lib/* \
+    ${prefix}/${TARGET_SYS}/usr/include/* \
+"
+INSANE_SKIP_${PN} += "dev-so"
+
+FILES_${PN}-dbg += " \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/.debug \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/.debug \
+"
+
+FILES_${PN}-doc = "\
+    ${infodir} \
+    ${mandir} \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
+"
+
+EXEEXT = ""
+
+# Compute how to get from libexecdir to bindir in python (easier than shell)
+BINRELPATH = "${@os.path.relpath(d.expand("${bindir}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}"
+
+do_install () {
+	( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h )
+	oe_runmake 'DESTDIR=${D}' install-host
+
+	# Cleanup some of the ${libdir}{,exec}/gcc stuff ...
+	rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+	rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+	rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+
+	# We care about g++ not c++
+	rm -f ${D}${bindir}/*c++
+
+	# We don't care about the gcc-<version> copies
+	rm -f ${D}${bindir}/*gcc-?.?*
+
+	# We use libiberty from binutils
+	rm -f ${D}${prefix}/${TARGET_SYS}/lib/libiberty.a
+	# Not sure where the strange paths come from
+	rm -f ${D}${libdir}/../lib/libiberty.a
+	rm -f ${D}${libdir}/libiberty.a
+
+	# Cleanup empty directories which are not shipped
+	# we use rmdir instead of 'rm -f' to ensure the non empty directories are not deleted
+	# ${D}${libdir}/../lib only seems to appear with SDKMACHINE=i686
+	local empty_dirs="${D}${libdir}/../lib ${D}${prefix}/${TARGET_SYS}/lib ${D}${prefix}/${TARGET_SYS} ${D}${includedir}"
+	for i in $empty_dirs; do
+		[ -d $i ] && rmdir --ignore-fail-on-non-empty $i
+	done
+
+	# Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+	# found.
+	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+	install -d $dest
+	suffix=${EXEEXT}
+	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+		if [ "$t" = "g77" -o "$t" = "gfortran" ] && [ ! -e ${D}${bindir}/${TARGET_PREFIX}$t$suffix ]; then
+			continue
+		fi
+
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t$suffix $dest$t$suffix
+	done
+	t=real-ld
+	ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld$suffix $dest$t$suffix
+
+	# libquadmath headers need to  be available in the gcc libexec dir
+	install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+	cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+	cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
+	chown -R root:root ${D}
+	
+	cross_canadian_bindirlinks
+}
+
+ELFUTILS = "nativesdk-elfutils"
+DEPENDS += "nativesdk-gmp nativesdk-mpfr nativesdk-libmpc ${ELFUTILS} nativesdk-zlib"
+RDEPENDS_${PN} += "nativesdk-mpfr nativesdk-libmpc ${ELFUTILS}"
+
+SYSTEMHEADERS = "/usr/include"
+SYSTEMLIBS = "${target_base_libdir}/"
+SYSTEMLIBS1 = "${target_libdir}/"
+
+EXTRA_OECONF += "--enable-poison-system-directories"
+
+EXTRA_OECONF += "\
+    --with-mpfr=${STAGING_DIR_HOST}${layout_exec_prefix} \
+    --with-mpc=${STAGING_DIR_HOST}${layout_exec_prefix} \
+"
+
+EXTRA_OECONF_append_libc-baremetal = " --without-headers"
+EXTRA_OECONF_remove_libc-baremetal = "--with-sysroot=/not/exist"
+EXTRA_OECONF_remove_libc-baremetal = "--with-build-sysroot=${STAGING_DIR_TARGET}"
+
+# gcc 4.7 needs -isystem
+export ARCH_FLAGS_FOR_TARGET = "--sysroot=${STAGING_DIR_TARGET} -isystem=${target_includedir}"
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
new file mode 100644
index 0000000..bf53c5c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.8.bb
@@ -0,0 +1,5 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross-canadian.inc
+
+
+
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb
new file mode 100644
index 0000000..bf53c5c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_4.9.bb
@@ -0,0 +1,5 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross-canadian.inc
+
+
+
diff --git a/meta/recipes-devtools/gcc/gcc-cross-canadian_5.2.bb b/meta/recipes-devtools/gcc/gcc-cross-canadian_5.2.bb
new file mode 100644
index 0000000..bf53c5c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross-canadian_5.2.bb
@@ -0,0 +1,5 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross-canadian.inc
+
+
+
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial.inc b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
new file mode 100644
index 0000000..7197447
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial.inc
@@ -0,0 +1,96 @@
+DEPENDS = "virtual/${TARGET_PREFIX}binutils ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial"
+PACKAGES = ""
+
+INHIBIT_AUTOTOOLS_DEPS = "1"
+INHIBIT_DEFAULT_DEPS = "1"
+
+PN = "gcc-cross-initial-${TARGET_ARCH}"
+
+CROSS_TARGET_SYS_DIR_append = ".${PN}"
+
+# This is intended to be a -very- basic config
+# sysroot is needed in case we use libc-initial
+EXTRA_OECONF = "\
+    --with-newlib \
+    --without-headers \
+    --disable-shared \
+    --disable-threads \
+    --disable-multilib \
+    --disable-__cxa_atexit \
+    --enable-languages=c \
+    ${OPTSPACE} \
+    --program-prefix=${TARGET_PREFIX} \
+    --with-sysroot=/not/exist \
+    --with-build-sysroot=${GCCCROSS_BUILDSYSROOT} \
+    ${EXTRA_OECONF_INITIAL} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)} \
+    ${EXTRA_OECONF_GCC_FLOAT} \
+"
+
+EXTRA_OECONF += "--with-native-system-header-dir=${SYSTEMHEADERS}"
+
+GCCCROSS_BUILDSYSROOT = "${B}/tmpsysroot"
+
+do_configure_prepend () {
+	sysr=${GCCCROSS_BUILDSYSROOT}${target_includedir}
+	mkdir -p $sysr
+	for t in linux asm asm-generic; do
+		rm -f $sysr/$t
+		ln -s ${STAGING_DIR_TARGET}${target_includedir}/$t $sysr/
+	done
+}
+
+do_compile () {
+    oe_runmake all-gcc configure-target-libgcc
+}
+do_install () {
+	( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h )
+	oe_runmake 'DESTDIR=${D}' install-gcc
+
+	# We don't really need this (here shares/ contains man/, info/, locale/).
+	rm -rf ${D}${datadir}/
+
+	# We use libiberty from binutils
+	find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
+	find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
+
+	# Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+	# found. These need to be relative paths so they work in different locations.
+	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+	install -d $dest
+	useld=${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '.bfd', '', d)}
+	ln -sf ${BINRELPATH}/${TARGET_PREFIX}ld${useld} ${dest}ld
+	for t in ar as nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+	done
+	# fixed limits.h infact includes the so called real limits.h
+	# which should come from libc but when we build libc-initial
+	# then bunch of configure tests include fixed limits.h which in turn
+	# includes real limits.h but this real limits.h is not staged yet
+	# so we overwirte the generated include-fixed/limits.h for gcc-cross-initial
+	# to get rid references to real limits.h
+	cp gcc/include-fixed/limits.h ${D}${gcclibdir}/${TARGET_SYS}/${BINV}/include/limits.h
+
+	# gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
+	case ${PN} in
+		*gcc-cross-initial-${TARGET_ARCH}|*gcc-crosssdk-initial-${TARGET_ARCH})
+			dest=${D}/${includedir}/gcc-build-internal-initial-${TARGET_SYS}
+			hardlinkdir . $dest
+		;;
+	esac
+}
+#
+# Override the default sysroot staging copy since this won't look like a target system
+#
+sysroot_stage_all() {
+	sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
+	install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/
+	install -d ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/
+	mv ${SYSROOT_DESTDIR}${target_base_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_base_libdir}/ || true
+	mv ${SYSROOT_DESTDIR}${target_libdir}/* ${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}${target_libdir}/ || true
+}
+
+do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST}/ ${SYSROOT_DESTDIR}/${STAGING_DIR_TARGET}/${target_base_libdir}/"
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST}/ ${STAGING_DIR_TCBOOTSTRAP}/${target_base_libdir}/"
+
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.8.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.8.bb
new file mode 100644
index 0000000..4c73e5c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.8.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-cross-initial.inc
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb
new file mode 100644
index 0000000..4c73e5c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-cross-initial.inc
diff --git a/meta/recipes-devtools/gcc/gcc-cross-initial_5.2.bb b/meta/recipes-devtools/gcc/gcc-cross-initial_5.2.bb
new file mode 100644
index 0000000..4c73e5c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross-initial_5.2.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-cross-initial.inc
diff --git a/meta/recipes-devtools/gcc/gcc-cross.inc b/meta/recipes-devtools/gcc/gcc-cross.inc
new file mode 100644
index 0000000..aa10633
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross.inc
@@ -0,0 +1,198 @@
+inherit cross
+
+INHIBIT_DEFAULT_DEPS = "1"
+EXTRADEPENDS = ""
+DEPENDS = "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}libc-for-gcc ${EXTRADEPENDS} ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+python () {
+    if d.getVar("TARGET_OS", True).startswith("linux"):
+        d.setVar("EXTRADEPENDS", "linux-libc-headers")
+}
+
+PN = "gcc-cross-${TARGET_ARCH}"
+
+require gcc-configure-common.inc
+
+EXTRA_OECONF += "--enable-poison-system-directories"
+EXTRA_OECONF_append_sh4 = " \
+    --with-multilib-list= \
+    --enable-incomplete-targets \
+"
+
+EXTRA_OECONF += "\
+    --with-mpfr=${STAGING_DIR_NATIVE}${prefix_native} \
+    --with-system-zlib \
+"
+
+DEPENDS_remove_libc-baremetal := "virtual/${TARGET_PREFIX}libc-for-gcc"
+EXTRA_OECONF_append_libc-baremetal = " --without-headers"
+EXTRA_OECONF_remove_libc-baremetal = "--enable-threads=posix"
+
+EXTRA_OECONF_PATHS = "\
+    --with-gxx-include-dir=/not/exist${target_includedir}/c++/${BINV} \
+    --with-sysroot=/not/exist \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+ARCH_FLAGS_FOR_TARGET += "-isystem${STAGING_DIR_TARGET}${target_includedir}"
+
+do_compile () {
+	export CC="${BUILD_CC}"
+	export AR_FOR_TARGET="${TARGET_SYS}-ar"
+	export RANLIB_FOR_TARGET="${TARGET_SYS}-ranlib"
+	export LD_FOR_TARGET="${TARGET_SYS}-ld"
+	export NM_FOR_TARGET="${TARGET_SYS}-nm"
+	export CC_FOR_TARGET="${CCACHE} ${TARGET_SYS}-gcc"
+	export CFLAGS_FOR_TARGET="${TARGET_CFLAGS}"
+	export CPPFLAGS_FOR_TARGET="${TARGET_CPPFLAGS}"
+	export CXXFLAGS_FOR_TARGET="${TARGET_CXXFLAGS}"
+	export LDFLAGS_FOR_TARGET="${TARGET_LDFLAGS}"
+
+	oe_runmake all-host configure-target-libgcc
+	# now generate script to drive testing
+	echo "#!/usr/bin/env sh" >${B}/${TARGET_PREFIX}testgcc
+	set >> ${B}/${TARGET_PREFIX}testgcc
+	# prune out the unneeded vars
+	sed -i -e "/^BASH/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^USER/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^OPT/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^DIRSTACK/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^EUID/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^FUNCNAME/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^GROUPS/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^HOST/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^HOME/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^IFS/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^LC_ALL/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^LOGNAME/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^MACHTYPE/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^OSTYPE/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PIPE/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^SHELL/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^'/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^UID/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^TERM/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PATCH_GET/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PKG_/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^POSIXLY_/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PPID/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PS4/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^Q/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^SHLVL/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^STAGING/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^LD_LIBRARY_PATH/d" ${B}/${TARGET_PREFIX}testgcc
+	sed -i -e "/^PSEUDO/d" ${B}/${TARGET_PREFIX}testgcc
+
+	# append execution part of the script
+cat >> ${B}/${TARGET_PREFIX}testgcc << STOP
+target="\$1"
+usage () {
+	echo "Usage:"
+	echo "\$0 user@target 'extra options to dejagnu'"
+	echo "\$0 target 'extra options to dejagnu'"
+	echo "\$0 target"
+	echo "e.g. \$0 192.168.7.2 ' dg.exp=visibility-d.c'"
+	echo "will only run visibility-d.c test case"
+	echo "e.g. \$0 192.168.7.2 '/-mthumb dg.exp=visibility-d.c'"
+	echo "will only run visibility-d.c test case in thumb mode"
+	echo "You need to have dejagnu autogen expect installed"
+	echo "on the build host"
+    }
+if [ "x\$target" = "x" ]
+then
+	echo "Please specify the target machine and remote user in form of user@target\n"
+	usage
+	exit 1;
+fi
+
+shift
+
+echo "\$target" | grep "@" 2>&1 > /dev/null
+if [ "x\$?" = "x0" ]
+then
+   user=\$(echo \$target | cut -d '@' -f 1)
+   target=\$(echo \$target | cut -d '@' -f 2)
+else
+   user=\$USER
+fi
+ssh \$user@\$target date 2>&1 > /dev/null
+if [ "x\$?" != "x0" ]
+then
+	echo "Failed connecting to \$user@\$target it could be because"
+	echo "you don't have passwordless ssh setup to access \$target"
+	echo "or sometimes host key has been changed"
+	echo "in such case do something like below on build host"
+	echo "ssh-keygen -f "~/.ssh/known_hosts" -R \$target"
+	echo "and then try ssh \$user@\$target"
+
+	usage
+	exit 1
+fi
+	echo "lappend boards_dir [pwd]/../../.." > ${B}/site.exp
+	echo "load_generic_config \"unix\"" > ${B}/${PACKAGE_ARCH}.exp
+	echo "set_board_info username \$user" >> ${B}/${PACKAGE_ARCH}.exp
+	echo "set_board_info rsh_prog ssh" >> ${B}/${PACKAGE_ARCH}.exp
+	echo "set_board_info rcp_prog scp" >> ${B}/${PACKAGE_ARCH}.exp
+	echo "set_board_info hostname \$target" >> ${B}/${PACKAGE_ARCH}.exp
+	DEJAGNU=${B}/site.exp make -k check RUNTESTFLAGS="--target_board=${PACKAGE_ARCH}\$@"
+
+STOP
+
+	chmod +x ${B}/${TARGET_PREFIX}testgcc
+
+}
+
+INHIBIT_PACKAGE_STRIP = "1"
+
+# Compute how to get from libexecdir to bindir in python (easier than shell)
+BINRELPATH = "${@os.path.relpath(d.expand("${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_SYS}"), d.expand("${libexecdir}/gcc/${TARGET_SYS}/${BINV}"))}"
+
+do_install () {
+	( cd ${B}/${TARGET_SYS}/libgcc; oe_runmake 'DESTDIR=${D}' install-unwind_h )
+	oe_runmake 'DESTDIR=${D}' install-host
+
+	install -d ${D}${target_base_libdir}
+	install -d ${D}${target_libdir}
+    
+	# Link gfortran to g77 to satisfy not-so-smart configure or hard coded g77
+	# gfortran is fully backwards compatible. This is a safe and practical solution. 
+	ln -sf ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}gfortran ${STAGING_DIR_NATIVE}${prefix_native}/bin/${TARGET_PREFIX}g77 || true
+
+	
+	# Insert symlinks into libexec so when tools without a prefix are searched for, the correct ones are
+	# found. These need to be relative paths so they work in different locations.
+	dest=${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/
+	install -d $dest
+	for t in ar as ld nm objcopy objdump ranlib strip g77 gcc cpp gfortran; do
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t $dest$t
+		ln -sf ${BINRELPATH}/${TARGET_PREFIX}$t ${dest}${TARGET_PREFIX}$t
+	done
+
+	# Remove things we don't need but keep share/java
+	for d in info man share/doc share/locale share/man share/info; do
+		rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/$d
+	done
+
+	# libquadmath headers need to  be available in the gcc libexec dir
+	install -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+	cp ${S}/libquadmath/quadmath.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+	cp ${S}/libquadmath/quadmath_weak.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
+	# We use libiberty from binutils
+	find ${D}${exec_prefix}/lib -name libiberty.a | xargs rm -f
+	find ${D}${exec_prefix}/lib -name libiberty.h | xargs rm -f
+
+	# gcc-runtime installs libgcc into a special location in staging since it breaks doing a standalone build
+	case ${PN} in
+		*gcc-cross-${TARGET_ARCH}|*gcc-crosssdk-${TARGET_ARCH})
+			dest=${D}/${includedir}/gcc-build-internal-${TARGET_SYS}
+			hardlinkdir . $dest
+		;;
+	esac
+}
+
+do_package[noexec] = "1"
+do_packagedata[noexec] = "1"
+do_package_write_ipk[noexec] = "1"
+do_package_write_rpm[noexec] = "1"
+do_package_write_deb[noexec] = "1"
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.8.bb b/meta/recipes-devtools/gcc/gcc-cross_4.8.bb
new file mode 100644
index 0000000..b43cca0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross_4.8.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross.inc
+
diff --git a/meta/recipes-devtools/gcc/gcc-cross_4.9.bb b/meta/recipes-devtools/gcc/gcc-cross_4.9.bb
new file mode 100644
index 0000000..b43cca0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross.inc
+
diff --git a/meta/recipes-devtools/gcc/gcc-cross_5.2.bb b/meta/recipes-devtools/gcc/gcc-cross_5.2.bb
new file mode 100644
index 0000000..b43cca0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-cross_5.2.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-cross.inc
+
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc b/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
new file mode 100644
index 0000000..7d2599c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial.inc
@@ -0,0 +1,10 @@
+inherit crosssdk
+
+PN = "gcc-crosssdk-initial-${TARGET_ARCH}"
+
+SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include"
+SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/"
+SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk gettext-native ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc-initial-crosssdk"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.8.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.8.bb
new file mode 100644
index 0000000..fd90e11
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.8.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
+require gcc-crosssdk-initial.inc
+
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb
new file mode 100644
index 0000000..fd90e11
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
+require gcc-crosssdk-initial.inc
+
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.2.bb b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.2.bb
new file mode 100644
index 0000000..fd90e11
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk-initial_5.2.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-cross-initial_${PV}.bb
+require gcc-crosssdk-initial.inc
+
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk.inc b/meta/recipes-devtools/gcc/gcc-crosssdk.inc
new file mode 100644
index 0000000..53f880f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk.inc
@@ -0,0 +1,12 @@
+inherit crosssdk
+
+PN = "gcc-crosssdk-${TARGET_ARCH}"
+
+SYSTEMHEADERS = "${SDKPATHNATIVE}${prefix_nativesdk}/include"
+SYSTEMLIBS = "${SDKPATHNATIVE}${base_libdir_nativesdk}/"
+SYSTEMLIBS1 = "${SDKPATHNATIVE}${libdir_nativesdk}/"
+
+GCCMULTILIB = "--disable-multilib"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils-crosssdk virtual/nativesdk-${TARGET_PREFIX}libc-for-gcc gettext-native ${NATIVEDEPS}"
+PROVIDES = "virtual/${TARGET_PREFIX}gcc-crosssdk virtual/${TARGET_PREFIX}g++-crosssdk"
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_4.8.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_4.8.bb
new file mode 100644
index 0000000..40a6c4f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk_4.8.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-crosssdk.inc
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb
new file mode 100644
index 0000000..40a6c4f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-crosssdk.inc
diff --git a/meta/recipes-devtools/gcc/gcc-crosssdk_5.2.bb b/meta/recipes-devtools/gcc/gcc-crosssdk_5.2.bb
new file mode 100644
index 0000000..40a6c4f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-crosssdk_5.2.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-cross_${PV}.bb
+require gcc-crosssdk.inc
diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
new file mode 100644
index 0000000..f7f9f55
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -0,0 +1,227 @@
+# following code modifies these definitions in the gcc config
+#    MULTILIB_OPTIONS
+#    MULTILIB_DIRNAMES
+#    MULTILIB_OSDIRNAMES
+#    GLIBC_DYNAMIC_LINKER32
+#    GLIBC_DYNAMIC_LINKER64
+#    GLIBC_DYNAMIC_LINKERX32
+#    GLIBC_DYNAMIC_LINKERN32
+#  For more information on use of these variables look at these files in the gcc source code
+#    gcc/config/i386/t-linux64
+#    gcc/config/mips/t-linux64
+#    gcc/config/rs6000/t-linux64
+#    gcc/config/i386/linux64.h
+#    gcc/config/mips/linux64.h
+#    gcc/config/rs6000/linux64.h
+
+MULTILIB_OPTION_WHITELIST ??= "-m32 -m64 -mx32 -mabi=n32 -mabi=32 -mabi=64" 
+
+python gcc_multilib_setup() {
+    import re
+    import shutil
+    import glob
+
+    srcdir = d.getVar('S', True)
+    builddir = d.getVar('B', True)
+    src_conf_dir = '%s/gcc/config' % srcdir
+    build_conf_dir = '%s/gcc/config' % builddir
+
+    bb.utils.remove(build_conf_dir, True)
+    ml_globs = ('%s/*/t-linux64' % src_conf_dir,
+                '%s/*/linux64.h' % src_conf_dir,
+                '%s/*/linux.h' % src_conf_dir,
+                '%s/linux.h' % src_conf_dir)
+
+    # copy the target multilib config files to ${B}
+    for ml_glob in ml_globs:
+        for fn in glob.glob(ml_glob):
+            rel_path = os.path.relpath(fn, src_conf_dir)
+            parent_dir = os.path.dirname(rel_path)
+            bb.utils.mkdirhier('%s/%s' % (build_conf_dir, parent_dir))
+            bb.utils.copyfile(fn, '%s/%s' % (build_conf_dir, rel_path))
+
+    pn = d.getVar('PN', True)
+    multilibs = (d.getVar('MULTILIB_VARIANTS', True) or '').split()
+    if not multilibs and pn != "nativesdk-gcc":
+        return
+
+    mlprefix = d.getVar('MLPREFIX', True)
+
+    if ('%sgcc' % mlprefix) != pn and (not pn.startswith('gcc-cross-canadian')) and pn != "nativesdk-gcc":
+        return
+
+
+    def write_config(root, files, options, dirnames, osdirnames):
+        for ml_conf_file in files:
+            with open(root + '/' + ml_conf_file, 'r') as f:
+                filelines = f.readlines()
+                # recreate multilib configuration variables
+                substs = [
+                    (r'^(\s*(MULTILIB_OPTIONS\s*=).*)$', r'\2 %s' % '/'.join(options)),
+                    (r'^(\s*MULTILIB_OPTIONS\s*\+=.*)$', ''),
+                    (r'^(\s*(MULTILIB_DIRNAMES\s*=).*)$', r'\2 %s' % ' '.join(dirnames)),
+                    (r'^(\s*MULTILIB_DIRNAMES\s*\+=.*)$', ''),
+                    (r'^(\s*(MULTILIB_OSDIRNAMES\s*=).*)$', r'\2 %s' % ' '.join(osdirnames)),
+                    (r'^(\s*MULTILIB_OSDIRNAMES\s*\+=.*)$', ''),
+                ]
+
+                for (i, line) in enumerate(filelines):
+                    for subst in substs:
+                        line = re.sub(subst[0], subst[1], line)
+                    filelines[i] = line
+
+                with open(root + '/' + ml_conf_file, 'w') as f:
+                    f.write(''.join(filelines))
+
+    def write_headers(root, files, libdir32, libdir64, libdirx32, libdirn32):
+        def wrap_libdir(libdir):
+            if libdir.find('SYSTEMLIBS_DIR') != -1:
+                return '"%r"'
+            else:
+                return '"/%s/"' % libdir
+
+        for ml_conf_file in files:
+            fn = root + '/' + ml_conf_file
+            if not os.path.exists(fn):
+                continue
+            with open(fn, 'r') as f:
+                filelines = f.readlines()
+
+                # replace lines like
+                # #define GLIBC_DYNAMIC_LINKER32 SYSTEMLIBS_DIR "ld-linux.so.2"
+                # by
+                # #define GLIBC_DYNAMIC_LINKER32 "/lib/" "ld-linux.so.2"
+                # this is needed to put the correct dynamic loader path in the generated binaries
+                substs = [
+                    (r'^(#define\s*GLIBC_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$',
+                        r'\1' + wrap_libdir(libdir32) + r'\3'),
+                    (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\"\S+\")$',
+                        r'\1' + wrap_libdir(libdir64) + r'\3'),
+                    (r'^(#define\s*GLIBC_DYNAMIC_LINKER64\s*\"\S+\"\s*)(\S+)(\s*\"\S+\"\s*)(\S+)(\s*\".*\")$',
+                        r'\1' + wrap_libdir(libdir64) + r'\3' + wrap_libdir(libdir64) + r'\5'),
+                    (r'^(#define\s*GLIBC_DYNAMIC_LINKERX32\s*)(\S+)(\s*\".*\")$',
+                        r'\1' + wrap_libdir(libdirx32) + r'\3'),
+                    (r'^(#define\s*GLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$',
+                        r'\1' + wrap_libdir(libdirn32) + r'\3'),
+                    (r'^(#define\s*UCLIBC_DYNAMIC_LINKER32\s*)(\S+)(\s*\".*\")$',
+                        r'\1' + wrap_libdir(libdir32) + r'\3'),
+                    (r'^(#define\s*UCLIBC_DYNAMIC_LINKER64\s*)(\S+)(\s*\".*\")$',
+                        r'\1' + wrap_libdir(libdir64) + r'\3'),
+                    (r'^(#define\s*UCLIBC_DYNAMIC_LINKERN32\s*)(\S+)(\s*\".*\")$',
+                        r'\1' + wrap_libdir(libdirn32) + r'\3'),
+                    (r'^(#define\s*UCLIBC_DYNAMIC_LINKER\b\s*)(\S+)(\s*\".*\")$',
+                        r'\1' + wrap_libdir(libdir32) + r'\3'),
+                ]
+
+                for (i, line) in enumerate(filelines):
+                    for subst in substs:
+                        line = re.sub(subst[0], subst[1], line)
+                    filelines[i] = line
+
+                with open(root + '/' + ml_conf_file, 'w') as f:
+                    f.write(''.join(filelines))
+
+
+    gcc_target_config_files = {
+        'x86_64'    : ['gcc/config/i386/t-linux64'],
+        'i586'      : ['gcc/config/i386/t-linux64'],
+        'i686'      : ['gcc/config/i386/t-linux64'],
+        'mips'      : ['gcc/config/mips/t-linux64'],
+        'mips64'    : ['gcc/config/mips/t-linux64'],
+        'powerpc'   : ['gcc/config/rs6000/t-linux64'],
+        'powerpc64' : ['gcc/config/rs6000/t-linux64'],
+    }
+
+    gcc_header_config_files = {
+        'x86_64'    : ['gcc/config/i386/linux64.h'],
+        'i586'      : ['gcc/config/i386/linux64.h'],
+        'i686'      : ['gcc/config/i386/linux64.h'],
+        'mips'      : ['gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'],
+        'mips64'    : ['gcc/config/mips/linux.h', 'gcc/config/mips/linux64.h'],
+        'powerpc'   : ['gcc/config/rs6000/linux64.h'],
+        'powerpc64' : ['gcc/config/rs6000/linux64.h'],
+    }
+
+    libdir32 = 'SYSTEMLIBS_DIR'
+    libdir64 = 'SYSTEMLIBS_DIR'
+    libdirx32 = 'SYSTEMLIBS_DIR'
+    libdirn32 = 'SYSTEMLIBS_DIR'
+
+
+    target_arch = (d.getVar('TARGET_ARCH_MULTILIB_ORIGINAL', True) if mlprefix
+                    else d.getVar('TARGET_ARCH', True))
+    if pn == "nativesdk-gcc":
+        header_config_files = gcc_header_config_files[d.getVar("SDK_ARCH", True)]
+        write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
+        return
+
+    if target_arch not in gcc_target_config_files:
+        bb.warn('gcc multilib setup is not supported for TARGET_ARCH=' + target_arch)
+        return
+
+    target_config_files = gcc_target_config_files[target_arch]
+    header_config_files = gcc_header_config_files[target_arch]
+
+    ml_list = ['DEFAULTTUNE_MULTILIB_ORIGINAL' if mlprefix else 'DEFAULTTUNE']
+    mltunes = [('DEFAULTTUNE_virtclass-multilib-%s' % ml) for ml in multilibs]
+    if mlprefix:
+        mlindex = 0
+        for ml in multilibs:
+            if mlprefix == ml + '-':
+                break
+            mlindex += 1
+
+        ml_list.extend(mltunes[:mlindex] + ['DEFAULTTUNE'] + mltunes[(mlindex + 1):])
+    else:
+        ml_list.extend(mltunes)
+
+    options = []
+    dirnames = []
+    osdirnames = []
+    optsets = []
+
+    for ml in ml_list:
+        tune = d.getVar(ml, True)
+        if not tune:
+            bb.warn("%s doesn't have a corresponding tune. Skipping..." % ml)
+            continue
+        tune_parameters = get_tune_parameters(tune, d)
+
+        tune_baselib = tune_parameters['baselib']
+        if not tune_baselib:
+            bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
+            continue
+
+        if tune_baselib == 'lib64':
+            libdir64 = tune_baselib
+        elif tune_baselib == 'libx32':
+            libdirx32 = tune_baselib
+        elif tune_baselib == 'lib32':
+            libdirn32 = tune_baselib
+        elif tune_baselib == 'lib':
+            libdir32 = tune_baselib
+        else:
+            bb.error('Unknown libdir (%s) of the tune : %s' % (tune_baselib, tune))
+
+        # take out '-' mcpu='s and march='s from parameters
+        opts = []
+        whitelist = (d.getVar("MULTILIB_OPTION_WHITELIST", True) or "").split()
+        for i in tune_parameters['ccargs'].split():
+            if i in whitelist:
+                # Need to strip '-' from option
+                opts.append(i[1:])
+        options.append(" ".join(opts))
+
+        if tune_baselib == 'lib':
+            dirnames.append('32')  # /lib => 32bit lib
+        else:
+            dirnames.append(tune_baselib.replace('lib', ''))
+        osdirnames.append('../' + tune_baselib)
+
+    write_config(builddir, target_config_files, options, dirnames, osdirnames)
+    write_headers(builddir, header_config_files, libdir32, libdir64, libdirx32, libdirn32)
+}
+
+gcc_multilib_setup[cleandirs] = "${B}/gcc/config"
+
+EXTRACONFFUNCS += "gcc_multilib_setup"
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
new file mode 100644
index 0000000..09757e6
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -0,0 +1,195 @@
+require gcc-configure-common.inc
+
+CXXFLAGS := "${@oe_filter_out('-fvisibility-inlines-hidden', '${CXXFLAGS}', d)}"
+
+EXTRA_OECONF_PATHS = "\
+    --with-gxx-include-dir=${includedir}/c++/${BINV} \
+    --with-sysroot=/not/exist \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
+
+RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic"
+#  ?
+# libiberty
+# libmudflap
+# libgfortran needs separate recipe due to libquadmath dependency
+
+do_configure () {
+	export CXX="${CXX} -nostdinc++ -nostdlib++"
+	mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
+	for d in libgcc ${RUNTIMETARGET}; do
+		echo "Configuring $d"
+		rm -rf ${B}/$target/$d/
+		mkdir -p ${B}/$target/$d/
+		cd ${B}/$target/$d/
+		chmod a+x ${S}/$d/configure
+		${S}/$d/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+	done
+}
+
+do_compile () {
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	for d in libgcc ${RUNTIMETARGET}; do
+		cd ${B}/$target/$d/
+		oe_runmake MULTIBUILDTOP=${B}/$target/$d/
+	done
+}
+
+do_install () {
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	for d in ${RUNTIMETARGET}; do
+		cd ${B}/$target/$d/
+		oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/$d/ install
+	done
+	rm -rf ${D}${infodir}/libgomp.info ${D}${infodir}/dir
+	rm -rf ${D}${infodir}/libquadmath.info ${D}${infodir}/dir
+	if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
+		rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+	fi
+	if [ -d ${D}${infodir} ]; then
+		rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+	fi
+	if [ "${TARGET_OS}" = "linux-gnuspe" ]; then
+		ln -s ${TARGET_SYS} ${D}${includedir}/c++/${BINV}/${TARGET_ARCH}${TARGET_VENDOR}-linux
+	fi
+	chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++ libgcc"
+PROVIDES = "virtual/${TARGET_PREFIX}compilerlibs"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "\
+    ${PN}-dbg \
+    libstdc++ \
+    libstdc++-precompile-dev \
+    libstdc++-dev \
+    libstdc++-staticdev \
+    libg2c \
+    libg2c-dev \
+    libssp \
+    libssp-dev \
+    libssp-staticdev \
+    libmudflap \
+    libmudflap-dev \
+    libmudflap-staticdev \
+    libquadmath \
+    libquadmath-dev \
+    libquadmath-staticdev \
+    libgomp \
+    libgomp-dev \
+    libgomp-staticdev \
+    libatomic \
+    libatomic-dev \
+    libatomic-staticdev \
+"
+
+# Most libraries are licensed with the exception, but
+# one library is really GPLv3.
+#
+LICENSE_${PN}-dbg = "GPL-3.0-with-GCC-exception & GPLv3"
+LICENSE_libstdc++ = "GPL-3.0-with-GCC-exception"
+LICENSE_libstdc++-precompile-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libstdc++-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libstdc++-staticdev = "GPL-3.0-with-GCC-exception"
+LICENSE_libg2c = "GPL-3.0-with-GCC-exception"
+LICENSE_libg2c-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libssp = "GPL-3.0-with-GCC-exception"
+LICENSE_libssp-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libssp-staticdev = "GPL-3.0-with-GCC-exception"
+LICENSE_libgfortran = "GPL-3.0-with-GCC-exception"
+LICENSE_libgfortran-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libgfortran-staticdev = "GPL-3.0-with-GCC-exception"
+LICENSE_libmudflap = "GPL-3.0-with-GCC-exception"
+LICENSE_libmudflap-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libmudflap-staticdev = "GPL-3.0-with-GCC-exception"
+LICENSE_libquadmath = "GPL-3.0-with-GCC-exception"
+LICENSE_libquadmath-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libquadmath-staticdev = "GPL-3.0-with-GCC-exception"
+LICENSE_libatomic = "GPL-3.0-with-GCC-exception"
+LICENSE_libatomic-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_libatomic-staticdev = "GPL-3.0-with-GCC-exception"
+
+LICENSE_libgomp = "GPLv3"
+LICENSE_libgomp-dev = "GPLv3"
+LICENSE_libgomp-staticdev = "GPLv3"
+
+# The base package doesn't exist, so we clear the recommends.
+RRECOMMENDS_${PN}-dbg = ""
+
+# include python debugging scripts
+FILES_${PN}-dbg += "\
+    ${libdir}/libstdc++.so.*-gdb.py \
+    ${datadir}/gcc-${BINV}/python/libstdcxx \
+"
+
+FILES_libg2c = "${target_libdir}/libg2c.so.*"
+FILES_libg2c-dev = "\
+    ${libdir}/libg2c.so \
+    ${libdir}/libg2c.a \
+    ${libdir}/libfrtbegin.a \
+"
+
+FILES_libstdc++ = "${libdir}/libstdc++.so.*"
+FILES_libstdc++-dev = "\
+    ${includedir}/c++/ \
+    ${libdir}/libstdc++.so \
+    ${libdir}/libstdc++.la \
+    ${libdir}/libsupc++.la \
+"
+FILES_libstdc++-staticdev = "\
+    ${libdir}/libstdc++.a \
+    ${libdir}/libsupc++.a \
+"
+
+FILES_libstdc++-precompile-dev = "${includedir}/c++/${TARGET_SYS}/bits/*.gch"
+
+FILES_libssp = "${libdir}/libssp.so.*"
+FILES_libssp-dev = "\
+    ${libdir}/libssp*.so \
+    ${libdir}/libssp*_nonshared.a \
+    ${libdir}/libssp*.la \
+    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/ssp \
+"
+FILES_libssp-staticdev = "${libdir}/libssp*.a"
+
+FILES_libquadmath = "${libdir}/libquadmath*.so.*"
+FILES_libquadmath-dev = "\
+    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/quadmath* \
+    ${libdir}/libquadmath*.so \
+    ${libdir}/libquadmath.la \
+"
+FILES_libquadmath-staticdev = "${libdir}/libquadmath.a"
+
+FILES_libmudflap = "${libdir}/libmudflap*.so.*"
+FILES_libmudflap-dev = "\
+    ${libdir}/libmudflap*.so \
+    ${libdir}/libmudflap.la \
+"
+FILES_libmudflap-staticdev = "${libdir}/libmudflap.a"
+
+FILES_libgomp = "${libdir}/libgomp*${SOLIBS}"
+FILES_libgomp-dev = "\
+    ${libdir}/libgomp*${SOLIBSDEV} \
+    ${libdir}/libgomp*.la \
+    ${libdir}/libgomp.spec \
+    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/omp.h \
+"
+FILES_libgomp-staticdev = "${libdir}/libgomp*.a"
+
+FILES_libatomic = "${libdir}/libatomic.so.*"
+FILES_libatomic-dev = "\
+    ${libdir}/libatomic.so \
+    ${libdir}/libatomic.la \
+"
+FILES_libatomic-staticdev = "${libdir}/libatomic.a"
+
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb
new file mode 100644
index 0000000..497d691
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-runtime_4.8.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-runtime.inc
+
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_4.9.bb b/meta/recipes-devtools/gcc/gcc-runtime_4.9.bb
new file mode 100644
index 0000000..497d691
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-runtime_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-runtime.inc
+
diff --git a/meta/recipes-devtools/gcc/gcc-runtime_5.2.bb b/meta/recipes-devtools/gcc/gcc-runtime_5.2.bb
new file mode 100644
index 0000000..8f31e77
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-runtime_5.2.bb
@@ -0,0 +1,7 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-runtime.inc
+
+FILES_libgomp-dev += "\
+    ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/openacc.h \
+"
+
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers.inc b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
new file mode 100644
index 0000000..c987ccb
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers.inc
@@ -0,0 +1,119 @@
+require gcc-configure-common.inc
+
+LICENSE = "NCSA | MIT"
+
+LIC_FILES_CHKSUM = "\
+    file://libsanitizer/LICENSE.TXT;md5=0249c37748936faf5b1efd5789587909 \
+"
+
+EXTRA_OECONF_PATHS = "\
+    --with-sysroot=/not/exist \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+do_configure () {
+    mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+    target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+    if [ -d ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ]; then
+        hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
+    fi
+
+    echo "Configuring libsanitizer"
+    rm -rf ${B}/$target/libsanitizer/
+    mkdir -p ${B}/$target/libsanitizer/
+    # This is kind of gross, but it's an easy way to make configure happy
+    # without hacking it up to use the system stdc++ instead of the one it
+    # expects to be newly built.
+    rm -rf ${B}/$target/libstdc++-v3/
+    mkdir -p ${B}/$target/libstdc++-v3/src/
+    ln -s ${STAGING_LIBDIR}/libstdc++.la ${B}/$target/libstdc++-v3/src/
+    ln -s ${STAGING_LIBDIR}/libstdc++.so ${B}/$target/libstdc++-v3/src/
+    cd ${B}/$target/libsanitizer/
+    chmod a+x ${S}/libsanitizer/configure
+    ${S}/libsanitizer/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+    # Easiest way to stop bad RPATHs getting into the library since we have a
+    # broken libtool here
+    sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libsanitizer/libtool
+}
+
+do_compile () {
+    target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+    cd ${B}/$target/libsanitizer/
+    oe_runmake MULTIBUILDTOP=${B}/$target/libsanitizer/
+}
+
+do_install () {
+    target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+    cd ${B}/$target/libsanitizer/
+    oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libsanitizer/ install
+    if [ -d ${D}${infodir} ]; then
+        rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+    fi
+    chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+ALLOW_EMPTY_${PN} = "1"
+DEPENDS = "gcc-runtime"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "${PN}"
+PACKAGES += "libasan libubsan liblsan libtsan"
+PACKAGES += "libasan-dev libubsan-dev liblsan-dev libtsan-dev"
+PACKAGES += "libasan-dbg libubsan-dbg liblsan-dbg libtsan-dbg"
+PACKAGES += "libasan-staticdev libubsan-staticdev liblsan-staticdev libtsan-staticdev"
+
+RDEPENDS_libasan += "libstdc++"
+RDEPENDS_libubsan += "libstdc++"
+RDEPENDS_liblsan += "libstdc++"
+RDEPENDS_libtsan += "libstdc++"
+RDEPENDS_libasan-dev += "${PN}"
+RDEPENDS_libubsan-dev += "${PN}"
+RDEPENDS_liblsan-dev += "${PN}"
+RDEPENDS_libtsan-dev += "${PN}"
+RRECOMMENDS_${PN} += "libasan libubsan"
+RRECOMMENDS_${PN}_append_x86-64 = " liblsan libtsan"
+RRECOMMENDS_${PN}_append_x86 = " liblsan"
+
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}${TARGET_PREFIX}compilerlibs:do_packagedata"
+
+# MIPS, aarch64, and SPARC are broken.
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm).*-linux'
+
+FILES_libasan += "${libdir}/libasan.so.*"
+FILES_libasan-dbg += "${libdir}/.debug/libasan.so.*"
+FILES_libasan-dev += "\
+    ${libdir}/libasan_preinit.o \
+    ${libdir}/libasan.so \
+    ${libdir}/libasan.la \
+"
+FILES_libasan-staticdev += "${libdir}/libasan.a"
+
+FILES_libubsan += "${libdir}/libubsan.so.*"
+FILES_libubsan-dbg += "${libdir}/.debug/libubsan.so.*"
+FILES_libubsan-dev += "\
+    ${libdir}/libubsan.so \
+    ${libdir}/libubsan.la \
+"
+FILES_libubsan-staticdev += "${libdir}/libubsan.a"
+
+FILES_liblsan += "${libdir}/liblsan.so.*"
+FILES_liblsan-dbg += "${libdir}/.debug/liblsan.so.*"
+FILES_liblsan-dev += "\
+    ${libdir}/liblsan.so \
+    ${libdir}/liblsan.la \
+"
+FILES_liblsan-staticdev += "${libdir}/liblsan.a"
+
+FILES_libtsan += "${libdir}/libtsan.so.*"
+FILES_libtsan-dbg += "${libdir}/.debug/libtsan.so.*"
+FILES_libtsan-dev += "\
+    ${libdir}/libtsan.so \
+    ${libdir}/libtsan.la \
+"
+FILES_libtsan-staticdev += "${libdir}/libtsan.a"
+
+FILES_${PN} = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/include/sanitizer/*.h"
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb
new file mode 100644
index 0000000..601f666
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers_4.8.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-sanitizers.inc
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb
new file mode 100644
index 0000000..601f666
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-sanitizers.inc
diff --git a/meta/recipes-devtools/gcc/gcc-sanitizers_5.2.bb b/meta/recipes-devtools/gcc/gcc-sanitizers_5.2.bb
new file mode 100644
index 0000000..601f666
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-sanitizers_5.2.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-sanitizers.inc
diff --git a/meta/recipes-devtools/gcc/gcc-shared-source.inc b/meta/recipes-devtools/gcc/gcc-shared-source.inc
new file mode 100644
index 0000000..9acffb1
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-shared-source.inc
@@ -0,0 +1,9 @@
+do_fetch() {
+	:
+}
+do_fetch[noexec] = "1"
+deltask do_unpack
+deltask do_patch
+
+do_configure[depends] += "gcc-source-${PV}:do_preconfigure"
+do_populate_lic[depends] += "gcc-source-${PV}:do_unpack"
diff --git a/meta/recipes-devtools/gcc/gcc-source.inc b/meta/recipes-devtools/gcc/gcc-source.inc
new file mode 100644
index 0000000..794fd4d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-source.inc
@@ -0,0 +1,36 @@
+deltask do_configure 
+deltask do_compile 
+deltask do_package 
+deltask do_package_write_rpm 
+deltask do_package_write_ipk 
+deltask do_package_write_deb
+deltask do_install 
+deltask do_populate_sysroot
+deltask do_populate_lic 
+deltask do_package_qa
+deltask do_packagedata
+deltask do_rm_work
+
+PN = "gcc-source-${PV}"
+WORKDIR = "${TMPDIR}/work-shared/gcc-${PV}-${PR}"
+SSTATE_SWSPEC = "sstate:gcc::${PV}:${PR}::${SSTATE_VERSION}:"
+
+STAMP = "${STAMPS_DIR}/work-shared/gcc-${PV}-${PR}"
+STAMPCLEAN = "${STAMPS_DIR}/work-shared/gcc-${PV}-*"
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = ""
+PACKAGES = ""
+
+python do_preconfigure () {
+    import subprocess
+    cmd = d.expand('cd ${S} && PATH=${PATH} gnu-configize')
+    subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+    # See 0044-gengtypes.patch, we need to regenerate this file
+    bb.utils.remove(d.expand("${S}/gcc/gengtype-lex.c"))
+    cmd = d.expand("sed -i 's/BUILD_INFO=info/BUILD_INFO=/' ${S}/gcc/configure")
+    subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+}
+addtask do_preconfigure after do_patch
+do_preconfigure[depends] += "gnu-config-native:do_populate_sysroot autoconf-native:do_populate_sysroot"
+
diff --git a/meta/recipes-devtools/gcc/gcc-source_4.8.bb b/meta/recipes-devtools/gcc/gcc-source_4.8.bb
new file mode 100644
index 0000000..b890fa3
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-source_4.8.bb
@@ -0,0 +1,4 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require recipes-devtools/gcc/gcc-source.inc
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-devtools/gcc/gcc-source_4.9.bb b/meta/recipes-devtools/gcc/gcc-source_4.9.bb
new file mode 100644
index 0000000..b890fa3
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-source_4.9.bb
@@ -0,0 +1,4 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require recipes-devtools/gcc/gcc-source.inc
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-devtools/gcc/gcc-source_5.2.bb b/meta/recipes-devtools/gcc/gcc-source_5.2.bb
new file mode 100644
index 0000000..b890fa3
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-source_5.2.bb
@@ -0,0 +1,4 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require recipes-devtools/gcc/gcc-source.inc
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-devtools/gcc/gcc-target.inc b/meta/recipes-devtools/gcc/gcc-target.inc
new file mode 100644
index 0000000..6e160c0
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-target.inc
@@ -0,0 +1,214 @@
+GCCMULTILIB = "--enable-multilib"
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+    --with-sysroot=/ \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+    --with-native-system-header-dir=${STAGING_DIR_TARGET}${target_includedir} \
+    --with-gxx-include-dir=${includedir}/c++/${BINV} \
+"
+
+EXTRA_OECONF_append_linuxstdbase = " --enable-clocale=gnu"
+
+# libcc1 requres gcc_cv_objdump when cross build, but gcc_cv_objdump is
+# set in subdir gcc, so subdir libcc1 can't use it, export it here to
+# fix the problem.
+export gcc_cv_objdump = "${TARGET_PREFIX}objdump"
+
+EXTRA_OECONF_GCC_FLOAT = "${@get_gcc_float_setting(bb, d)}"
+
+PACKAGES = "\
+    ${PN} ${PN}-plugins ${PN}-symlinks \
+    g++ g++-symlinks \
+    cpp cpp-symlinks \
+    g77 g77-symlinks \
+    gfortran gfortran-symlinks \
+    gcov gcov-symlinks \
+    ${PN}-doc \
+    ${PN}-dev \
+    ${PN}-dbg \
+"
+
+FILES_${PN} = "\
+    ${bindir}/${TARGET_PREFIX}gcc* \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/collect2 \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc* \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lto* \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/liblto*${SOLIBSDEV} \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/*.o \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/specs \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBS} \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/include \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/include-fixed \
+"
+INSANE_SKIP_${PN} += "dev-so"
+
+FILES_${PN}-dbg += "\
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/.debug/ \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/.debug/ \
+"
+FILES_${PN}-dev = "\
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/lib*${SOLIBSDEV} \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/include/ \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/plugin/gengtype \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin/gtype.state \
+"
+FILES_${PN}-symlinks = "\
+    ${bindir}/cc \
+    ${bindir}/gcc \
+    ${bindir}/gccbug \
+"
+
+FILES_${PN}-plugins = "\
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/plugin \
+"
+ALLOW_EMPTY_${PN}-plugins = "1"
+
+FILES_g77 = "\
+    ${bindir}/${TARGET_PREFIX}g77 \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f771 \
+"
+FILES_g77-symlinks = "\
+    ${bindir}/g77 \
+    ${bindir}/f77 \
+"
+FILES_gfortran = "\
+    ${bindir}/${TARGET_PREFIX}gfortran \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/f951 \
+"
+FILES_gfortran-symlinks = "\
+    ${bindir}/gfortran \
+    ${bindir}/f95"
+
+FILES_cpp = "\
+    ${bindir}/${TARGET_PREFIX}cpp \
+    ${base_libdir}/cpp \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1"
+FILES_cpp-symlinks = "${bindir}/cpp"
+
+FILES_gcov = "${bindir}/${TARGET_PREFIX}gcov \
+    ${bindir}/${TARGET_PREFIX}gcov-tool \
+"
+FILES_gcov-symlinks = "${bindir}/gcov \
+    ${bindir}/gcov-tool \
+"
+
+FILES_g++ = "\
+    ${bindir}/${TARGET_PREFIX}g++ \
+    ${libexecdir}/gcc/${TARGET_SYS}/${BINV}/cc1plus \
+"
+FILES_g++-symlinks = "\
+    ${bindir}/c++ \
+    ${bindir}/g++ \
+"
+
+FILES_${PN}-doc = "\
+    ${infodir} \
+    ${mandir} \
+    ${gcclibdir}/${TARGET_SYS}/${BINV}/include/README \
+"
+
+do_compile () {
+	oe_runmake all-host
+}
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install-host
+
+	# Add unwind.h, it comes from libgcc which we don't want to build again
+	install ${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/gcc/${TARGET_SYS}/${BINV}/include/unwind.h ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include/
+
+	# Info dir listing isn't interesting at this point so remove it if it exists.
+	if [ -e "${D}${infodir}/dir" ]; then
+		rm -f ${D}${infodir}/dir
+	fi
+
+	# Cleanup some of the ${libdir}{,exec}/gcc stuff ...
+	rm -r ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+	rm -r ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/install-tools
+	rm -rf ${D}${libexecdir}/gcc/${TARGET_SYS}/${BINV}/*.la
+	rmdir ${D}${includedir}
+	rm -rf ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+
+	# Hack around specs file assumptions
+	test -f ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs && sed -i -e '/^*cross_compile:$/ { n; s/1/0/; }' ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/specs
+
+	# Cleanup manpages..
+	rm -rf ${D}${mandir}/man7
+
+	cd ${D}${bindir}
+
+	# We care about g++ not c++
+	rm -f *c++
+
+	# We don't care about the gcc-<version> ones for this
+	rm -f *gcc-?.?*
+
+	# We use libiberty from binutils
+	find ${D}${libdir} -name libiberty.a | xargs rm -f
+	find ${D}${libdir} -name libiberty.h | xargs rm -f
+
+	# Not sure why we end up with these but we don't want them...
+	rm -f ${TARGET_PREFIX}${TARGET_PREFIX}*
+
+	# Symlinks so we can use these trivially on the target
+	if [ -e ${TARGET_PREFIX}g77 ]; then
+		ln -sf ${TARGET_PREFIX}g77 g77 || true
+		ln -sf g77 f77 || true
+	fi
+	if [ -e ${TARGET_PREFIX}gfortran ]; then
+		ln -sf ${TARGET_PREFIX}gfortran gfortran || true
+		ln -sf gfortran f95 || true
+	fi
+	ln -sf ${TARGET_PREFIX}g++ g++
+	ln -sf ${TARGET_PREFIX}gcc gcc
+	ln -sf ${TARGET_PREFIX}cpp cpp
+	install -d ${D}${base_libdir}
+	ln -sf ${bindir}/${TARGET_PREFIX}cpp ${D}${base_libdir}/cpp
+	ln -sf g++ c++
+	ln -sf gcc cc
+
+	chown -R root:root ${D}
+}
+
+do_install_append () {
+        #
+        # Thefixinc.sh script, run on the gcc's compile phase, looks into sysroot header
+        # files and places the modified files into
+        # {D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed folder. This makes the
+        # build not deterministic. The following code prunes all those headers
+        # except those under include-fixed/linux, *limits.h and README, yielding
+        # the same include-fixed folders no matter what sysroot
+
+        include_fixed="${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/include-fixed"
+        for f in $(find ${include_fixed} -type f); do
+                case $f in
+                */include-fixed/linux/*)
+                    continue
+                    ;;
+                */include-fixed/*limits.h)
+                    continue
+                    ;;
+                */include-fixed/README)
+                    continue
+                    ;;
+                *)
+                    # remove file and directory if empty
+                    bbdebug 2 "Pruning $f"
+                    rm $f
+                    find $(dirname $f) -maxdepth 0 -empty -exec rmdir {} \;
+                    ;;
+                esac
+        done
+}
+
+# Installing /usr/lib/gcc/* means we'd have two copies, one from gcc-cross
+# and one from here. These can confuse gcc cross where includes use #include_next
+# and builds track file dependencies (e.g. perl and its makedepends code).
+# For determinism we don't install this ever and rely on the copy from gcc-cross.
+# [YOCTO #7287]
+sysroot_stage_dirs_append () {
+	rm -rf $to${libdir}/gcc
+}
diff --git a/meta/recipes-devtools/gcc/gcc_4.8.bb b/meta/recipes-devtools/gcc/gcc_4.8.bb
new file mode 100644
index 0000000..2c618df
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc_4.8.bb
@@ -0,0 +1,9 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-target.inc
+
+# Building with thumb enabled on armv4t fails with
+# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
+# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output
+ARM_INSTRUCTION_SET_armv4 = "arm"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/gcc/gcc_4.9.bb b/meta/recipes-devtools/gcc/gcc_4.9.bb
new file mode 100644
index 0000000..b84baae
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc_4.9.bb
@@ -0,0 +1,14 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-target.inc
+
+# Building with thumb enabled on armv4t fails with
+# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
+# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output
+ARM_INSTRUCTION_SET_armv4 = "arm"
+
+BBCLASSEXTEND = "nativesdk"
+
+#SYSTEMHEADERS_class-nativesdk = "${@'${target_includedir}'.replace(d.getVar('SDKPATH', True),'%r')}"
+#SYSTEMLIBS_class-nativesdk = "${@'${target_base_libdir}'.replace(d.getVar('SDKPATH', True),'%r')}/"
+#SYSTEMLIBS1_class-nativesdk = "${@'${target_libdir}'.replace(d.getVar('SDKPATH', True),'%r')}/"
+
diff --git a/meta/recipes-devtools/gcc/gcc_5.2.bb b/meta/recipes-devtools/gcc/gcc_5.2.bb
new file mode 100644
index 0000000..b0a523c
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc_5.2.bb
@@ -0,0 +1,15 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require gcc-target.inc
+
+# Building with thumb enabled on armv4t fails with
+# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7438:(.text.unlikely+0x2fa): relocation truncated to fit: R_ARM_THM_CALL against symbol `fancy_abort(char const*, int, char const*)' defined in .glue_7 section in linker stubs
+# | gcc-4.8.1-r0/gcc-4.8.1/gcc/cp/decl.c:7442:(.text.unlikely+0x318): additional relocation overflows omitted from the output
+ARM_INSTRUCTION_SET_armv4 = "arm"
+
+do_configure_prepend() {
+	# Easiest way to stop bad RPATHs getting into the library since we have a
+	# broken libtool here
+	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${S}/libcc1/configure
+}
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc b/meta/recipes-devtools/gcc/libgcc-common.inc
new file mode 100644
index 0000000..b09ea65
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc-common.inc
@@ -0,0 +1,144 @@
+BPN = "libgcc"
+
+require gcc-shared-source.inc
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+do_configure () {
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	install -d ${D}${base_libdir} ${D}${libdir}
+	hardlinkdir ${STAGING_INCDIR_NATIVE}/${LIBGCCBUILDTREENAME}$target/ ${B}
+	mkdir -p ${B}/${BPN}
+	mkdir -p ${B}/$target/${BPN}/
+	cd ${B}/${BPN}
+	chmod a+x ${S}/${BPN}/configure
+	${S}/${BPN}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+}
+
+do_compile () {
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	cd ${B}/${BPN}
+	oe_runmake MULTIBUILDTOP=${B}/$target/${BPN}/
+}
+
+do_install () {
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	cd ${B}/${BPN}
+	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/${BPN}/ install
+
+	# Move libgcc_s into /lib
+	mkdir -p ${D}${base_libdir}
+	if [ -f ${D}${libdir}/nof/libgcc_s.so ]; then
+		mv ${D}${libdir}/nof/libgcc* ${D}${base_libdir}
+	else
+		mv ${D}${libdir}/libgcc* ${D}${base_libdir} || true
+	fi
+
+	# install the runtime in /usr/lib/ not in /usr/lib/gcc on target
+	# so that cross-gcc can find it in the sysroot
+
+	mv ${D}${libdir}/gcc/* ${D}${libdir}
+	rm -rf ${D}${libdir}/gcc/
+	# unwind.h is installed here which is shipped in gcc-cross
+	# as well as target gcc and they are identical so we dont
+	# ship one with libgcc here
+	rm -rf ${D}${libdir}/${TARGET_SYS}/${BINV}/include
+}
+
+do_install_append_libc-baremetal () {
+	rmdir ${D}${base_libdir}
+}
+
+RDEPENDS_${PN}-dev_libc-baremetal = ""
+
+BBCLASSEXTEND = "nativesdk"
+
+addtask multilib_install after do_install before do_package do_populate_sysroot
+# this makes multilib gcc files findable for target gcc
+# e.g.
+#    /usr/lib/i586-pokymllib32-linux/4.7/
+# by creating this symlink to it
+#    /usr/lib64/x86_64-poky-linux/4.7/32
+
+fakeroot python do_multilib_install() {
+    import re
+
+    multilibs = d.getVar('MULTILIB_VARIANTS', True)
+    if not multilibs or bb.data.inherits_class('nativesdk', d):
+        return
+
+    binv = d.getVar('BINV', True)
+
+    mlprefix = d.getVar('MLPREFIX', True)
+    if ('%slibgcc' % mlprefix) != d.getVar('PN', True):
+        return
+
+    if mlprefix:
+        orig_tune = d.getVar('DEFAULTTUNE_MULTILIB_ORIGINAL', True)
+        orig_tune_params = get_tune_parameters(orig_tune, d)
+        orig_tune_baselib = orig_tune_params['baselib']
+        orig_tune_bitness = orig_tune_baselib.replace('lib', '')
+        if not orig_tune_bitness:
+            orig_tune_bitness = '32'
+
+        src = '../../../' + orig_tune_baselib + '/' + \
+            d.getVar('TARGET_SYS_MULTILIB_ORIGINAL', True) + '/' + binv + '/'
+
+        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
+            d.getVar('TARGET_SYS', True) + '/' + binv + '/' + orig_tune_bitness
+
+        if os.path.lexists(dest):
+            os.unlink(dest)
+        os.symlink(src, dest)
+        return
+
+
+    for ml in multilibs.split():
+        tune = d.getVar('DEFAULTTUNE_virtclass-multilib-' + ml, True)
+        if not tune:
+            bb.warn('DEFAULTTUNE_virtclass-multilib-%s is not defined. Skipping...' % ml)
+            continue
+
+        tune_parameters = get_tune_parameters(tune, d)
+        tune_baselib = tune_parameters['baselib']
+        if not tune_baselib:
+            bb.warn("Tune %s doesn't have a baselib set. Skipping..." % tune)
+            continue
+
+        tune_arch = tune_parameters['arch']
+        tune_bitness = tune_baselib.replace('lib', '')
+        if not tune_bitness:
+            tune_bitness = '32' # /lib => 32bit lib
+
+        src = '../../../' + tune_baselib + '/' + \
+            tune_arch + d.getVar('TARGET_VENDOR', True) + 'ml' + ml + \
+            '-' + d.getVar('TARGET_OS', True) + '/' + binv + '/'
+
+        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + \
+            d.getVar('TARGET_SYS', True) + '/' + binv + '/' + tune_bitness
+
+        if os.path.lexists(dest):
+            os.unlink(dest)
+        os.symlink(src, dest)
+}
+
+def get_original_vendoros(d):
+    vendoros = d.expand('${TARGET_VENDOR}-${TARGET_OS}')
+    for suffix in [d.getVar('ABIEXTENSION', True), d.getVar('LIBCEXTENSION', True)]:
+        if suffix and vendoros.endswith(suffix):
+            vendoros = vendoros[:-len(suffix)]
+    return vendoros
+
+ORIG_TARGET_VENDOROS := "${@get_original_vendoros(d)}"
+BASETARGET_SYS = "${TARGET_ARCH}${ORIG_TARGET_VENDOROS}"
+
+addtask extra_symlinks after do_multilib_install before do_package do_populate_sysroot
+fakeroot python do_extra_symlinks() {
+    targetsys = d.getVar('BASETARGET_SYS', True)
+
+    if targetsys != d.getVar('TARGET_SYS', True):
+        dest = d.getVar('D', True) + d.getVar('libdir', True) + '/' + targetsys
+        src = d.getVar('TARGET_SYS', True)
+        if not os.path.lexists(dest) and os.path.lexists(d.getVar('D', True) + d.getVar('libdir', True)):
+            os.symlink(src, dest)
+}
diff --git a/meta/recipes-devtools/gcc/libgcc-initial.inc b/meta/recipes-devtools/gcc/libgcc-initial.inc
new file mode 100644
index 0000000..4e92f00
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc-initial.inc
@@ -0,0 +1,18 @@
+require libgcc-common.inc
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc-initial"
+
+LICENSE = "GPL-3.0-with-GCC-exception"
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}"
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+PACKAGES = ""
+
+EXTRA_OECONF += "--disable-shared"
+
+LIBGCCBUILDTREENAME = "gcc-build-internal-initial-"
+
+do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_TCBOOTSTRAP}/"
+
diff --git a/meta/recipes-devtools/gcc/libgcc-initial_4.8.bb b/meta/recipes-devtools/gcc/libgcc-initial_4.8.bb
new file mode 100644
index 0000000..19f253f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc-initial_4.8.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc-initial.inc
diff --git a/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb b/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb
new file mode 100644
index 0000000..19f253f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc-initial_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc-initial.inc
diff --git a/meta/recipes-devtools/gcc/libgcc-initial_5.2.bb b/meta/recipes-devtools/gcc/libgcc-initial_5.2.bb
new file mode 100644
index 0000000..19f253f
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc-initial_5.2.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc-initial.inc
diff --git a/meta/recipes-devtools/gcc/libgcc.inc b/meta/recipes-devtools/gcc/libgcc.inc
new file mode 100644
index 0000000..739adbd
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc.inc
@@ -0,0 +1,41 @@
+require libgcc-common.inc
+
+DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}g++"
+
+PACKAGES = "\
+    ${PN} \
+    ${PN}-dev \
+    ${PN}-dbg \
+"
+
+# All libgcc source is marked with the exception.
+#
+LICENSE_${PN} = "GPL-3.0-with-GCC-exception"
+LICENSE_${PN}-dev = "GPL-3.0-with-GCC-exception"
+LICENSE_${PN}-dbg = "GPL-3.0-with-GCC-exception"
+
+
+FILES_${PN} = "${base_libdir}/libgcc*.so.*"
+FILES_${PN}-dev = "\
+    ${base_libdir}/libgcc*.so \
+    ${libdir}/${TARGET_SYS}/${BINV}/*crt* \
+    ${libdir}/${TARGET_SYS}/${BINV}/64 \
+    ${libdir}/${TARGET_SYS}/${BINV}/32 \
+    ${libdir}/${TARGET_SYS}/${BINV}/x32 \
+    ${libdir}/${TARGET_SYS}/${BINV}/n32 \
+    ${libdir}/${TARGET_SYS}/${BINV}/libgcc* \
+    ${@base_conditional('BASETARGET_SYS', '${TARGET_SYS}', '', '${libdir}/${BASETARGET_SYS}', d)} \
+    ${libdir}/${TARGET_SYS}/${BINV}/libgcov.a \
+"
+
+FILES_${PN}-dbg += "${base_libdir}/.debug/"
+
+LIBGCCBUILDTREENAME = "gcc-build-internal-"
+
+do_package[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+
+INSANE_SKIP_${PN}-dev = "staticdev"
+
diff --git a/meta/recipes-devtools/gcc/libgcc_4.8.bb b/meta/recipes-devtools/gcc/libgcc_4.8.bb
new file mode 100644
index 0000000..a5152f2
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc_4.8.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc.inc
diff --git a/meta/recipes-devtools/gcc/libgcc_4.9.bb b/meta/recipes-devtools/gcc/libgcc_4.9.bb
new file mode 100644
index 0000000..a5152f2
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc_4.9.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc.inc
diff --git a/meta/recipes-devtools/gcc/libgcc_5.2.bb b/meta/recipes-devtools/gcc/libgcc_5.2.bb
new file mode 100644
index 0000000..a5152f2
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgcc_5.2.bb
@@ -0,0 +1,2 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgcc.inc
diff --git a/meta/recipes-devtools/gcc/libgfortran.inc b/meta/recipes-devtools/gcc/libgfortran.inc
new file mode 100644
index 0000000..e42843d
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgfortran.inc
@@ -0,0 +1,74 @@
+require gcc-configure-common.inc
+
+EXTRA_OECONF_PATHS = "\
+    --with-sysroot=/not/exist \
+    --with-build-sysroot=${STAGING_DIR_TARGET} \
+"
+
+do_configure () {
+	mtarget=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	hardlinkdir ${STAGING_INCDIR_NATIVE}/gcc-build-internal-$mtarget ${B}
+
+	echo "Configuring libgfortran"
+	rm -rf ${B}/$target/libgfortran/
+	mkdir -p ${B}/$target/libgfortran/
+	cd ${B}/$target/libgfortran/
+	chmod a+x ${S}/libgfortran/configure
+	${S}/libgfortran/configure ${CONFIGUREOPTS} ${EXTRA_OECONF}
+	# Easiest way to stop bad RPATHs getting into the library since we have a
+	# broken libtool here
+	sed -i -e 's/hardcode_into_libs=yes/hardcode_into_libs=no/' ${B}/$target/libgfortran/libtool
+}
+
+do_compile () {
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	cd ${B}/$target/libgfortran/
+	oe_runmake MULTIBUILDTOP=${B}/$target/libgfortran/
+}
+
+do_install () {
+	target=`echo ${TARGET_SYS} | sed -e s#-${SDKPKGSUFFIX}##`
+	cd ${B}/$target/libgfortran/
+	oe_runmake 'DESTDIR=${D}' MULTIBUILDTOP=${B}/$target/libgfortran/ install
+	if [ -d ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude ]; then
+		rmdir --ignore-fail-on-non-empty -p ${D}${libdir}/gcc/${TARGET_SYS}/${BINV}/finclude
+	fi
+	if [ -d ${D}${infodir} ]; then
+		rmdir --ignore-fail-on-non-empty -p ${D}${infodir}
+	fi
+	chown -R root:root ${D}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS = "gcc-runtime"
+
+BBCLASSEXTEND = "nativesdk"
+
+PACKAGES = "\
+    ${PN}-dbg \
+    libgfortran \
+    libgfortran-dev \
+    libgfortran-staticdev \
+"
+FILES_${PN} = "${libdir}/libgfortran.so.*"
+FILES_${PN}-dev = "\
+    ${libdir}/libgfortran*.so \
+    ${libdir}/libgfortran.spec \
+    ${libdir}/libgfortran.la \
+    ${libdir}/gcc/${TARGET_SYS}/${BINV}/libgfortranbegin.* \
+    ${libdir}/gcc/${TARGET_SYS}/${BINV}/libcaf_single* \
+"
+FILES_${PN}-staticdev = "${libdir}/libgfortran.a"
+
+INSANE_SKIP_${MLPREFIX}libgfortran-dev = "staticdev"
+
+do_package_write_ipk[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_deb[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+do_package_write_rpm[depends] += "virtual/${MLPREFIX}libc:do_packagedata"
+
+python __anonymous () {
+    f = d.getVar("FORTRAN", True)
+    if "fortran" not in f:
+        raise bb.parse.SkipPackage("libgfortran needs fortran support to be enabled in the compiler")
+}
diff --git a/meta/recipes-devtools/gcc/libgfortran_4.8.bb b/meta/recipes-devtools/gcc/libgfortran_4.8.bb
new file mode 100644
index 0000000..71dd8b4
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgfortran_4.8.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgfortran.inc
+
diff --git a/meta/recipes-devtools/gcc/libgfortran_4.9.bb b/meta/recipes-devtools/gcc/libgfortran_4.9.bb
new file mode 100644
index 0000000..71dd8b4
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgfortran_4.9.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgfortran.inc
+
diff --git a/meta/recipes-devtools/gcc/libgfortran_5.2.bb b/meta/recipes-devtools/gcc/libgfortran_5.2.bb
new file mode 100644
index 0000000..71dd8b4
--- /dev/null
+++ b/meta/recipes-devtools/gcc/libgfortran_5.2.bb
@@ -0,0 +1,3 @@
+require recipes-devtools/gcc/gcc-${PV}.inc
+require libgfortran.inc
+
diff --git a/meta/recipes-devtools/gdb/gdb-7.9.1.inc b/meta/recipes-devtools/gdb/gdb-7.9.1.inc
new file mode 100644
index 0000000..1ca95af
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb-7.9.1.inc
@@ -0,0 +1,9 @@
+LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+		    file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+		    file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
+		    file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
+
+SRC_URI[md5sum] = "f3b97de919a9dba84490b2e076ec4cb0"
+SRC_URI[sha256sum] = "4994ad986726ac4128a6f1bd8020cd672e9a92aa76b80736563ef992992764ef"
+
diff --git a/meta/recipes-devtools/gdb/gdb-common.inc b/meta/recipes-devtools/gdb/gdb-common.inc
new file mode 100644
index 0000000..166ba8e
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb-common.inc
@@ -0,0 +1,71 @@
+SUMMARY = "GNU debugger"
+HOMEPAGE = "http://www.gnu.org/software/gdb/"
+LICENSE = "GPLv3+"
+SECTION = "devel"
+DEPENDS = "expat zlib ncurses readline ${LTTNGUST}"
+
+LTTNGUST = "lttng-ust"
+LTTNGUST_aarch64 = ""
+LTTNGUST_libc-uclibc = ""
+LTTNGUST_mips = ""
+LTTNGUST_mipsel = ""
+LTTNGUST_mips64 = ""
+LTTNGUST_mips64el = ""
+LTTNGUST_mips64n32 = ""
+LTTNGUST_mips64eln32 = ""
+LTTNGUST_sh4 = ""
+LTTNGUST_libc-musl = ""
+
+INC_PR = "r0"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+		file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \
+		file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
+		file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
+inherit autotools texinfo
+
+SRC_URI = "${GNU_MIRROR}/gdb/gdb-${PV}.tar.gz \
+          "
+export CC_FOR_BUILD = "${BUILD_CC}"
+export CXX_FOR_BUILD = "${BUILD_CXX}"
+export CPP_FOR_BUILD = "${BUILD_CPP}"
+export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
+export CXXFLAGS_FOR_BUILD = "${BUILD_CXXFLAGS}"
+export CPPFLAGS_FOR_BUILD = "${BUILD_CPPFLAGS}"
+
+B = "${WORKDIR}/build-${TARGET_SYS}"
+
+EXTRA_OEMAKE = "'SUBDIRS=intl mmalloc libiberty opcodes bfd sim gdb etc utils'"
+
+EXPAT = "--with-expat --with-libexpat-prefix=${STAGING_DIR_HOST}"
+
+EXTRA_OECONF = "--disable-gdbtk --disable-tui --disable-x --disable-werror \
+                --with-curses --disable-multilib --with-system-readline --disable-sim \
+                --without-lzma --without-guile \
+                ${GDBPROPREFIX} ${EXPAT} \
+                ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)} \
+                --disable-rpath \
+               "
+
+GDBPROPREFIX = "--program-prefix=''"
+
+do_configure () {
+	# override this function to avoid the autoconf/automake/aclocal/autoheader
+	# calls for now
+	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
+	oe_runconf
+}
+
+# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
+# right bits installed by binutils.
+do_install_append() {
+	rm -rf ${D}${libdir}
+	rm -rf ${D}${includedir}
+	rm -rf ${D}${datadir}/locale
+}
+
+RRECOMMENDS_gdb_append_linux = " glibc-thread-db "
+RRECOMMENDS_gdb_append_linux-gnueabi = " glibc-thread-db "
+RRECOMMENDS_gdbserver_append_linux = " glibc-thread-db "
+RRECOMMENDS_gdbserver_append_linux-gnueabi = " glibc-thread-db "
+
diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian.inc b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
new file mode 100644
index 0000000..4fd60a6
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb-cross-canadian.inc
@@ -0,0 +1,38 @@
+inherit cross-canadian
+inherit python-dir
+
+SUMMARY = "GNU debugger (cross-canadian gdb for ${TARGET_ARCH} target)"
+PN = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"
+BPN = "gdb"
+
+DEPENDS = "nativesdk-ncurses nativesdk-expat nativesdk-gettext nativesdk-readline nativesdk-python"
+RDEPENDS_${PN} += "nativesdk-python-core nativesdk-python-lang nativesdk-python-re \
+                   nativesdk-python-codecs nativesdk-python-netclient"
+
+GDBPROPREFIX = "--program-prefix='${TARGET_PREFIX}'"
+
+EXTRA_OECONF_append = " --with-python=${WORKDIR}/python"
+
+SSTATE_DUPWHITELIST += "${STAGING_DATADIR}/gdb"
+
+do_configure_prepend() {
+cat > ${WORKDIR}/python << EOF
+#! /bin/sh
+case "\$2" in
+        --includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}/" ;;
+        --ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
+        --exec-prefix) echo "${exec_prefix}" ;;
+        *) exit 1 ;;
+esac
+exit 0
+EOF
+        chmod +x ${WORKDIR}/python
+}
+
+# we don't want gdb to provide bfd/iberty/opcodes, which instead will override the
+# right bits installed by binutils.
+do_install_append() {
+	rm -rf ${D}${exec_prefix}/lib
+	cross_canadian_bindirlinks
+}
+
diff --git a/meta/recipes-devtools/gdb/gdb-cross-canadian_7.9.1.bb b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.9.1.bb
new file mode 100644
index 0000000..3010359
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb-cross-canadian_7.9.1.bb
@@ -0,0 +1,3 @@
+require gdb-common.inc
+require gdb-cross-canadian.inc
+require gdb-${PV}.inc
diff --git a/meta/recipes-devtools/gdb/gdb-cross.inc b/meta/recipes-devtools/gdb/gdb-cross.inc
new file mode 100644
index 0000000..6e44778
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb-cross.inc
@@ -0,0 +1,26 @@
+require gdb-common.inc
+
+DEPENDS = "expat-native ncurses-native readline-native python-native"
+
+inherit pythonnative
+
+EXTRA_OECONF += "--with-python=${STAGING_BINDIR_NATIVE}/python-native/python"
+
+do_compile_prepend() {
+    export BUILD_SYS="${BUILD_SYS}"
+    export HOST_SYS="${HOST_SYS}"
+    export STAGING_LIBDIR="${STAGING_LIBDIR_NATIVE}"
+    export STAGING_INCDIR="${STAGING_INCDIR_NATIVE}"
+}
+
+#EXTRA_OEMAKE += "LDFLAGS='${BUILD_LDFLAGS}'"
+
+GDBPROPREFIX = ""
+
+PN = "gdb-cross-${TARGET_ARCH}"
+BPN = "gdb"
+
+inherit cross
+inherit gettext
+
+datadir .= "/gdb-${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
diff --git a/meta/recipes-devtools/gdb/gdb-cross_7.9.1.bb b/meta/recipes-devtools/gdb/gdb-cross_7.9.1.bb
new file mode 100644
index 0000000..3a95cfb
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb-cross_7.9.1.bb
@@ -0,0 +1,4 @@
+require gdb-cross.inc
+require gdb-${PV}.inc
+
+SRC_URI += "file://0001-make-man-install-relative-to-DESTDIR.patch"
diff --git a/meta/recipes-devtools/gdb/gdb.inc b/meta/recipes-devtools/gdb/gdb.inc
new file mode 100644
index 0000000..88c0213
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb.inc
@@ -0,0 +1,14 @@
+require gdb-common.inc
+
+inherit gettext
+
+SRC_URI += "file://0002-Change-order-of-CFLAGS.patch \
+            file://0003-Add-support-for-Renesas-SH-sh4-architecture.patch \
+            file://fix-detection-of-64-bit-PPC-inferior-in-gdbserver.patch \
+           "
+#LDFLAGS_append = " -s"
+#export CFLAGS_append=" -L${STAGING_LIBDIR}"
+
+# cross-canadian must not see this
+PACKAGES =+ "gdbserver"
+FILES_gdbserver = "${bindir}/gdbserver"
diff --git a/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch b/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch
new file mode 100644
index 0000000..6996c18
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb/0001-make-man-install-relative-to-DESTDIR.patch
@@ -0,0 +1,28 @@
+From 12b0506951460c3cc37d775478d024db3f95e9d8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 02:27:55 +0000
+Subject: [PATCH 1/3] make man install relative to DESTDIR
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ sim/common/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/sim/common/Makefile.in b/sim/common/Makefile.in
+index d49a93b..2121c46 100644
+--- a/sim/common/Makefile.in
++++ b/sim/common/Makefile.in
+@@ -35,7 +35,7 @@ tooldir = $(libdir)/$(target_alias)
+ datarootdir = @datarootdir@
+ datadir = @datadir@
+ mandir = @mandir@
+-man1dir = $(mandir)/man1
++man1dir = $(DESTDIR)$(mandir)/man1
+ infodir = @infodir@
+ includedir = @includedir@
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch b/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch
new file mode 100644
index 0000000..bccb45f
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb/0002-Change-order-of-CFLAGS.patch
@@ -0,0 +1,34 @@
+From 262ccc4fdb2a3df0f16c61a807046964ae7729c9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 02:29:23 +0000
+Subject: [PATCH 2/3] Change order of CFLAGS
+
+Lets us override Werror if need be
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gdb/gdbserver/Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
+index 1ed2ec8..0cef95b 100644
+--- a/gdb/gdbserver/Makefile.in
++++ b/gdb/gdbserver/Makefile.in
+@@ -131,10 +131,10 @@ CFLAGS = @CFLAGS@
+ CPPFLAGS = @CPPFLAGS@
+ 
+ # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
+-INTERNAL_CFLAGS_BASE =  ${CFLAGS} ${GLOBAL_CFLAGS} \
++INTERNAL_CFLAGS_BASE = ${GLOBAL_CFLAGS} \
+ 	${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS}
+ INTERNAL_WARN_CFLAGS =  ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
+-INTERNAL_CFLAGS =  ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
++INTERNAL_CFLAGS =  ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) ${CFLAGS} -DGDBSERVER
+ 
+ # LDFLAGS is specifically reserved for setting from the command line
+ # when running make.
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch b/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch
new file mode 100644
index 0000000..4a3e22c
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb/0003-Add-support-for-Renesas-SH-sh4-architecture.patch
@@ -0,0 +1,921 @@
+From 407cb13cfb70697f45dfb761304e005e1ecbd0e9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 2 Mar 2015 02:31:12 +0000
+Subject: [PATCH 3/3] Add support for Renesas SH (sh4) architecture.
+
+gdb (7.4-1~cvs20111117.2) experimental; urgency=low
+ .
+   * Add Renesas SH (sh4) support (Closes: #576242)
+     - Thanks Nobuhiro Iwamatsu, Takashi Yoshii.
+Author: Hector Oron <zumbi@debian.org>
+Bug-Debian: http://bugs.debian.org/576242
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ gdb/Makefile.in                      |   1 +
+ gdb/configure.host                   |   1 +
+ gdb/sh-linux-tdep.c                  | 519 +++++++++++++++++++++++++++++++++++
+ gdb/sh-tdep.c                        |  54 ++--
+ gdb/sh-tdep.h                        |  49 ++++
+ gdb/testsuite/gdb.asm/asm-source.exp |   5 +
+ gdb/testsuite/gdb.asm/sh.inc         |   3 +-
+ gdb/testsuite/gdb.base/annota1.c     |   3 +
+ gdb/testsuite/gdb.base/annota3.c     |   4 +
+ gdb/testsuite/gdb.base/sigall.c      |   3 +
+ gdb/testsuite/gdb.base/signals.c     |   4 +
+ 11 files changed, 617 insertions(+), 29 deletions(-)
+
+diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+index 7937801..63baf81 100644
+--- a/gdb/Makefile.in
++++ b/gdb/Makefile.in
+@@ -1707,6 +1707,7 @@ ALLDEPFILES = \
+ 	score-tdep.c \
+ 	ser-go32.c ser-pipe.c ser-tcp.c ser-mingw.c \
+ 	sh-tdep.c sh64-tdep.c shnbsd-tdep.c shnbsd-nat.c \
++	sh-linux-tdep.c sh-linux-nat.c \
+ 	sol2-tdep.c \
+ 	solib-svr4.c \
+ 	sparc-linux-nat.c sparc-linux-tdep.c \
+diff --git a/gdb/configure.host b/gdb/configure.host
+index d07be4b..b6391c5 100644
+--- a/gdb/configure.host
++++ b/gdb/configure.host
+@@ -150,6 +150,7 @@ powerpc*-*-linux*)	gdb_host=linux ;;
+ 
+ s390*-*-linux*)		gdb_host=linux ;;
+ 
++sh*-*-linux*)		gdb_host=linux ;;
+ sh*-*-netbsdelf* | sh*-*-knetbsd*-gnu)
+ 			gdb_host=nbsd ;;
+ sh*-*-openbsd*)		gdb_host=nbsd ;;
+diff --git a/gdb/sh-linux-tdep.c b/gdb/sh-linux-tdep.c
+index 2ff2ee8..1a11262 100644
+--- a/gdb/sh-linux-tdep.c
++++ b/gdb/sh-linux-tdep.c
+@@ -18,14 +18,37 @@
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ 
+ #include "defs.h"
++#include "gdbcore.h"
++#include "frame.h"
++#include "frame-base.h"
++#include "frame-unwind.h"
++#include "dwarf2-frame.h"
++#include "value.h"
++#include "regcache.h"
++#include "inferior.h"
+ #include "osabi.h"
+ 
++#include "reggroups.h"
++#include "arch-utils.h"
++#include "floatformat.h"
+ #include "solib-svr4.h"
+ #include "symtab.h"
++#include "gdb_string.h"
++#include "command.h"
++#include "gdb_assert.h"
+ 
+ #include "trad-frame.h"
+ #include "tramp-frame.h"
+ 
++#include <sys/ptrace.h>
++#include <sys/types.h>
++#include <sys/param.h>
++#include <sys/user.h>
++#include <sys/syscall.h>
++
++#include <asm/ptrace.h>
++
++#include "regset.h"
+ #include "glibc-tdep.h"
+ #include "sh-tdep.h"
+ #include "linux-tdep.h"
+@@ -180,9 +203,505 @@ static struct tramp_frame sh_linux_rt_sigreturn_tramp_frame = {
+   sh_linux_rt_sigreturn_init
+ };
+ 
++/* Recognizing signal handler frames.  */
++
++/* GNU/Linux has two flavors of signals.  Normal signal handlers, and
++   "realtime" (RT) signals.  The RT signals can provide additional
++   information to the signal handler if the SA_SIGINFO flag is set
++   when establishing a signal handler using `sigaction'.  It is not
++   unlikely that future versions of GNU/Linux will support SA_SIGINFO
++   for normal signals too.  */
++
++/* When the SH Linux kernel calls a signal handler and the
++   SA_RESTORER flag isn't set, the return address points to a bit of
++   code on the stack.  This function returns whether the PC appears to
++   be within this bit of code.
++
++   The instruction sequence for normal signals is
++       mov.w  1f,r3
++       trapa  #16
++       or     r0, r0
++       or     r0, r0
++       or     r0, r0
++       or     r0, r0
++       or     r0, r0
++    1: .word  __NR_sigreturn
++   or 0x9305 0xc310 0x200b 0x200b 0x200b 0x200b 0x200b 0x0077.
++
++   Checking for the code sequence should be somewhat reliable, because
++   the effect is to call the system call sigreturn.  This is unlikely
++   to occur anywhere other than a signal trampoline.
++
++   It kind of sucks that we have to read memory from the process in
++   order to identify a signal trampoline, but there doesn't seem to be
++   any other way.  The PC_IN_SIGTRAMP macro in tm-linux.h arranges to
++   only call us if no function name could be identified, which should
++   be the case since the code is on the stack.
++
++   Detection of signal trampolines for handlers that set the
++   SA_RESTORER flag is in general not possible.  Unfortunately this is
++   what the GNU C Library has been doing for quite some time now.
++   However, as of version 2.1.2, the GNU C Library uses signal
++   trampolines (named __restore and __restore_rt) that are identical
++   to the ones used by the kernel.  Therefore, these trampolines are
++   supported too.  */
++
++#define MOVW(n)	 (0x9300|((n)-2))	/* Move mem word at PC+n to R3 */
++#define TRAP16	 0xc310			/* Syscall w/no args (NR in R3) */
++#define OR_R0_R0 0x200b			/* or r0,r0 (insert to avoid hardware bug) */
++
++#define LINUX_SIGTRAMP_INSN0	MOVW(7)		/* Move mem word at PC+7 to R3 */
++#define LINUX_SIGTRAMP_INSN1	TRAP16		/* Syscall w/no args (NR in R3) */
++#define LINUX_SIGTRAMP_INSN2	OR_R0_R0	/* or r0,r0 (insert to avoid hardware bug) */
++
++static const unsigned short linux_sigtramp_code[] =
++{
++  LINUX_SIGTRAMP_INSN0,
++  LINUX_SIGTRAMP_INSN1,
++  LINUX_SIGTRAMP_INSN2,
++  LINUX_SIGTRAMP_INSN2,
++  LINUX_SIGTRAMP_INSN2,
++  LINUX_SIGTRAMP_INSN2,
++  LINUX_SIGTRAMP_INSN2,
++  __NR_sigreturn
++};
++
++#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
++
++/* If PC is in a sigtramp routine, return the address of the start of
++   the routine.  Otherwise, return 0.  */
++
++static CORE_ADDR
++sh_linux_sigtramp_start (struct frame_info *next_frame)
++{
++  CORE_ADDR pc = get_frame_pc (next_frame);
++  gdb_byte buf[LINUX_SIGTRAMP_LEN];
++
++  /* We only recognize a signal trampoline if PC is at the start of
++     one of the three instructions.  We optimize for finding the PC at
++     the start, as will be the case when the trampoline is not the
++     first frame on the stack.  We assume that in the case where the
++     PC is not at the start of the instruction sequence, there will be
++     a few trailing readable bytes on the stack.  */
++
++  if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_SIGTRAMP_LEN))
++    return 0;
++
++  if (buf[0] != LINUX_SIGTRAMP_INSN0)
++    {
++      if (buf[0] != LINUX_SIGTRAMP_INSN1)
++        return 0;
++
++      pc -= 2;
++
++      if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_SIGTRAMP_LEN))
++	return 0;
++    }
++
++  if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0)
++    return 0;
++
++  return pc;
++}
++
++/* This function does the same for RT signals.  Here the instruction
++   sequence is
++       mov.w  1f,r3
++       trapa  #16
++       or     r0, r0
++       or     r0, r0
++       or     r0, r0
++       or     r0, r0
++       or     r0, r0
++    1: .word  __NR_rt_sigreturn
++   or 0x9305 0xc310 0x200b 0x200b 0x200b 0x200b 0x200b 0x00ad.
++
++   The effect is to call the system call rt_sigreturn.  */
++
++#define LINUX_RT_SIGTRAMP_INSN0		MOVW(7)		/* Move mem word at PC+7 to R3 */
++#define LINUX_RT_SIGTRAMP_INSN1		TRAP16		/* Syscall w/no args (NR in R3) */
++#define LINUX_RT_SIGTRAMP_INSN2		OR_R0_R0	/* or r0,r0 (insert to avoid hardware bug) */
++
++static const unsigned short linux_rt_sigtramp_code[] =
++{
++  LINUX_RT_SIGTRAMP_INSN0,
++  LINUX_RT_SIGTRAMP_INSN1,
++  LINUX_RT_SIGTRAMP_INSN2,
++  LINUX_RT_SIGTRAMP_INSN2,
++  LINUX_RT_SIGTRAMP_INSN2,
++  LINUX_RT_SIGTRAMP_INSN2,
++  LINUX_RT_SIGTRAMP_INSN2,
++  __NR_rt_sigreturn
++};
++
++#define LINUX_RT_SIGTRAMP_LEN (sizeof linux_rt_sigtramp_code)
++
++/* If PC is in a RT sigtramp routine, return the address of the start
++   of the routine.  Otherwise, return 0.  */
++
++static CORE_ADDR
++sh_linux_rt_sigtramp_start (struct frame_info *next_frame)
++{
++  CORE_ADDR pc = get_frame_pc (next_frame);
++  gdb_byte buf[LINUX_RT_SIGTRAMP_LEN];
++
++  /* We only recognize a signal trampoline if PC is at the start of
++     one of the two instructions.  We optimize for finding the PC at
++     the start, as will be the case when the trampoline is not the
++     first frame on the stack.  We assume that in the case where the
++     PC is not at the start of the instruction sequence, there will be
++     a few trailing readable bytes on the stack.  */
++
++  if (!safe_frame_unwind_memory (next_frame, pc, buf, LINUX_RT_SIGTRAMP_LEN))
++    return 0;
++
++  if (buf[0] != LINUX_RT_SIGTRAMP_INSN0)
++    {
++      if (buf[0] != LINUX_RT_SIGTRAMP_INSN1)
++	return 0;
++
++      pc -= 2;
++
++      if (!safe_frame_unwind_memory (next_frame, pc, buf,
++				     LINUX_RT_SIGTRAMP_LEN))
++	return 0;
++    }
++
++  if (memcmp (buf, linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN) != 0)
++    return 0;
++
++  return pc;
++}
++
++/* Return whether PC is in a GNU/Linux sigtramp routine.  */
++
++static int
++sh_linux_sigtramp_p (struct frame_info *this_frame)
++{
++  CORE_ADDR pc = get_frame_pc (this_frame);
++  char *name;
++
++  find_pc_partial_function (pc, &name, NULL, NULL);
++
++  /* If we have NAME, we can optimize the search.  The trampolines are
++     named __restore and __restore_rt.  However, they aren't dynamically
++     exported from the shared C library, so the trampoline may appear to
++     be part of the preceding function.  This should always be sigaction,
++     __sigaction, or __libc_sigaction (all aliases to the same function).  */
++  if (name == NULL || strstr (name, "sigaction") != NULL)
++    return (sh_linux_sigtramp_start (this_frame) != 0
++	    || sh_linux_rt_sigtramp_start (this_frame) != 0);
++
++  return (strcmp ("__restore", name) == 0
++	  || strcmp ("__restore_rt", name) == 0);
++}
++
++/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>.  */
++#define SH_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 12
++
++
++/* Assuming NEXT_FRAME is a frame following a GNU/Linux sigtramp
++   routine, return the address of the associated sigcontext structure.  */
++
++static CORE_ADDR
++sh_linux_sigcontext_addr (struct frame_info *this_frame)
++{
++  CORE_ADDR pc;
++  CORE_ADDR sp;
++
++  sp = get_frame_register_unsigned (this_frame, SP_REGNUM);
++
++  pc = sh_linux_sigtramp_start (this_frame);
++  if (pc)
++    {
++      return sp;
++    }
++
++  pc = sh_linux_rt_sigtramp_start (this_frame);
++  if (pc)
++    {
++      CORE_ADDR ucontext_addr;
++
++      /* The sigcontext structure is part of the user context.  A
++	 pointer to the user context is passed as the third argument
++	 to the signal handler.  */
++      ucontext_addr = get_frame_register_unsigned (this_frame, ARG0_REGNUM+2);
++      return ucontext_addr + SH_LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
++    }
++
++  error ("Couldn't recognize signal trampoline.");
++  return 0;
++}
++
++/* Signal trampolines.  */
++extern struct sh_frame_cache *sh_alloc_frame_cache (void);
++
++static struct sh_frame_cache *
++sh_linux_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
++{
++  struct sh_frame_cache *cache;
++  struct gdbarch_tdep *tdep = gdbarch_tdep (get_current_arch ());
++  CORE_ADDR sigcontext_addr;
++
++  if (*this_cache)
++    return *this_cache;
++
++  cache = sh_alloc_frame_cache ();
++
++  cache->base = get_frame_register_unsigned (this_frame, SP_REGNUM);
++  sigcontext_addr = tdep->sigcontext_addr (this_frame);
++  if (tdep->sc_reg_offset)
++    {
++      int i;
++
++      gdb_assert (tdep->sc_num_regs <= SH_NUM_REGS);
++
++      for (i = 0; i < tdep->sc_num_regs; i++)
++	if (tdep->sc_reg_offset[i] != -1)
++	  cache->saved_regs[i] = sigcontext_addr + tdep->sc_reg_offset[i];
++    }
++
++  *this_cache = cache;
++  return cache;
++}
++
++static void
++sh_linux_sigtramp_frame_this_id (struct frame_info *this_frame, void **this_cache,
++			     struct frame_id *this_id)
++{
++  struct sh_frame_cache *cache =
++    sh_linux_sigtramp_frame_cache (this_frame, this_cache);
++
++  (*this_id) = frame_id_build (cache->base + 64, cache->pc);
++}
++
++extern struct value * sh_frame_prev_register ();
++static struct value *
++sh_linux_sigtramp_frame_prev_register (struct frame_info *this_frame,
++                   void **this_cache, int regnum)
++{
++  sh_linux_sigtramp_frame_cache (this_frame, this_cache);
++
++  return sh_frame_prev_register (this_frame, this_cache, regnum);
++}
++
++static int
++sh_linux_sigtramp_frame_sniffer (const struct frame_unwind *self,
++                 struct frame_info *this_frame,
++                 void **this_prologue_cache)
++{
++  struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
++
++  /* We shouldn't even bother if we don't have a sigcontext_addr
++     handler.  */
++  if (tdep->sigcontext_addr == NULL)
++    return 0;
++
++  if (tdep->sigtramp_p != NULL)
++    {
++      if (tdep->sigtramp_p (this_frame))
++    return 1;
++    }
++
++  return 0;
++}
++
++static const struct frame_unwind sh_linux_sigtramp_frame_unwind =
++{
++  SIGTRAMP_FRAME,
++  sh_linux_sigtramp_frame_this_id,
++  sh_linux_sigtramp_frame_prev_register,
++  NULL,
++  sh_linux_sigtramp_frame_sniffer
++};
++
++/* Supply register REGNUM from the buffer specified by GREGS and LEN
++   in the general-purpose register set REGSET to register cache
++   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
++
++void
++sh_supply_gregset (const struct regset *regset, struct regcache *regcache,
++             int regnum, const void *gregs, size_t len)
++{
++  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++  const char *regs = gregs;
++  int i;
++
++  gdb_assert (len == tdep->sizeof_gregset);
++
++  for (i = 0; i < tdep->gregset_num_regs; i++)
++    {
++      if ((regnum == i || regnum == -1)
++      && tdep->gregset_reg_offset[i] != -1)
++    regcache_raw_supply (regcache, i, regs + tdep->gregset_reg_offset[i]);
++    }
++}
++
++/* Collect register REGNUM from the register cache REGCACHE and store
++   it in the buffer specified by GREGS and LEN as described by the
++   general-purpose register set REGSET.  If REGNUM is -1, do this for
++   all registers in REGSET.  */
++
++void
++sh_collect_gregset (const struct regset *regset,
++              const struct regcache *regcache,
++              int regnum, void *gregs, size_t len)
++{
++  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++  char *regs = gregs;
++  int i;
++
++  gdb_assert (len == tdep->sizeof_gregset);
++
++  for (i = 0; i < tdep->gregset_num_regs; i++)
++    {
++      if ((regnum == i || regnum == -1)
++      && tdep->gregset_reg_offset[i] != -1)
++    regcache_raw_collect (regcache, i, regs + tdep->gregset_reg_offset[i]);
++    }
++}
++
++/* Supply register REGNUM from the buffer specified by FPREGS and LEN
++   in the floating-point register set REGSET to register cache
++   REGCACHE.  If REGNUM is -1, do this for all registers in REGSET.  */
++
++static void
++sh_supply_fpregset (const struct regset *regset, struct regcache *regcache,
++              int regnum, const void *fpregs, size_t len)
++{
++  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++  const char *regs = fpregs;
++  int i;
++
++  gdb_assert (len == tdep->sizeof_fpregset);
++  for (i = 0; i < 16; i++)
++    {
++      if (regnum == i+25 || regnum == -1)
++    regcache_raw_supply (regcache, i+25, regs + i*4);
++    }
++  if (regnum == FPSCR_REGNUM || regnum == -1)
++    regcache_raw_supply (regcache, FPSCR_REGNUM, regs + 32*4);
++  if (regnum == FPUL_REGNUM || regnum == -1)
++    regcache_raw_supply (regcache, FPUL_REGNUM, regs + 33*4);
++}
++
++/* Collect register REGNUM from the register cache REGCACHE and store
++   it in the buffer specified by FPREGS and LEN as described by the
++   floating-point register set REGSET.  If REGNUM is -1, do this for
++   all registers in REGSET.  */
++
++static void
++sh_collect_fpregset (const struct regset *regset,
++               const struct regcache *regcache,
++               int regnum, void *fpregs, size_t len)
++{
++  const struct gdbarch_tdep *tdep = gdbarch_tdep (regset->arch);
++  char *regs = fpregs;
++  int i;
++
++  gdb_assert (len == tdep->sizeof_fpregset);
++  for (i = 0; i < 16; i++)
++    {
++      if (regnum == i+25 || regnum == -1)
++    regcache_raw_collect (regcache, i+25, regs + i*4);
++    }
++  if (regnum == FPSCR_REGNUM || regnum == -1)
++    regcache_raw_collect (regcache, FPSCR_REGNUM, regs + 32*4);
++  if (regnum == FPUL_REGNUM || regnum == -1)
++    regcache_raw_collect (regcache, FPUL_REGNUM, regs + 33*4);
++}
++
++/* Return the appropriate register set for the core section identified
++   by SECT_NAME and SECT_SIZE.  */
++
++const struct regset *
++sh_linux_regset_from_core_section (struct gdbarch *gdbarch,
++                   const char *sect_name, size_t sect_size)
++{
++  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
++
++  if (strcmp (sect_name, ".reg") == 0 && sect_size == tdep->sizeof_gregset)
++    {
++      if (tdep->gregset == NULL)
++    tdep->gregset = regset_alloc (gdbarch, sh_supply_gregset,
++                      sh_collect_gregset);
++      return tdep->gregset;
++    }
++
++  if ((strcmp (sect_name, ".reg2") == 0 && sect_size == tdep->sizeof_fpregset))
++    {
++      if (tdep->fpregset == NULL)
++    tdep->fpregset = regset_alloc (gdbarch, sh_supply_fpregset,
++                       sh_collect_fpregset);
++      return tdep->fpregset;
++    }
++
++  return NULL;
++}
++
++/* The register sets used in GNU/Linux ELF core-dumps are identical to
++   the register sets in `struct user' that are used for a.out
++   core-dumps.  These are also used by ptrace(2).  The corresponding
++   types are `elf_gregset_t' for the general-purpose registers (with
++   `elf_greg_t' the type of a single GP register) and `elf_fpregset_t'
++   for the floating-point registers.
++
++   Those types used to be available under the names `gregset_t' and
++   `fpregset_t' too, and GDB used those names in the past.  But those
++   names are now used for the register sets used in the `mcontext_t'
++   type, which have a different size and layout.  */
++
++/* Mapping between the general-purpose registers in `struct user'
++   format and GDB's register cache layout.  */
++
++/* From <sys/reg.h>.  */
++static int sh_linux_gregset_reg_offset[] =
++{
++ 0,	4,	8,	12,	16,	20,	24,	28,
++ 32,	36,	40,	44,	48,	52,	56,	60,
++
++ REG_PC*4,   REG_PR*4,   REG_GBR*4,  -1,
++ REG_MACH*4, REG_MACL*4, REG_SR*4,
++};
++
++/* Mapping between the general-purpose registers in `struct
++   sigcontext' format and GDB's register cache layout.  */
++
++/* From <asm/sigcontext.h>.  */
++static int sh_linux_sc_reg_offset[] =
++{
++ 4,	8,	12,	16,	20,	24,	28,	32,
++ 36,	40,	44,	48,	52,	56,	60,	64,
++ 68,	72,	80,	-1,
++ 84,	88,	76
++};
++
+ static void
+ sh_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
+ {
++  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
++  bfd abfd;
++
++  tdep->gregset_reg_offset = sh_linux_gregset_reg_offset;
++  tdep->gregset_num_regs = ARRAY_SIZE (sh_linux_gregset_reg_offset);
++  tdep->sizeof_gregset = 23 * 4;
++
++  tdep->jb_pc_offset = 32;     /* From <bits/setjmp.h>.  */
++
++  tdep->sigtramp_p = sh_linux_sigtramp_p;
++  tdep->sigcontext_addr = sh_linux_sigcontext_addr;
++  tdep->sc_reg_offset = sh_linux_sc_reg_offset;
++  tdep->sc_num_regs = ARRAY_SIZE (sh_linux_sc_reg_offset);
++
++  frame_unwind_append_unwinder(gdbarch, &sh_linux_sigtramp_frame_unwind);
++
++  /* If we have a register mapping, enable the generic core file
++     support, unless it has already been enabled.  */
++  if (tdep->gregset_reg_offset
++      && !gdbarch_regset_from_core_section_p (gdbarch))
++    set_gdbarch_regset_from_core_section (gdbarch,
++                                         sh_linux_regset_from_core_section);
++
+   linux_init_abi (info, gdbarch);
+ 
+   /* GNU/Linux uses SVR4-style shared libraries.  */
+diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
+index 82cf2f4..b443e46 100644
+--- a/gdb/sh-tdep.c
++++ b/gdb/sh-tdep.c
+@@ -21,6 +21,9 @@
+    sac@cygnus.com.  */
+ 
+ #include "defs.h"
++#include "arch-utils.h"
++#include "command.h"
++#include "dummy-frame.h"
+ #include "frame.h"
+ #include "frame-base.h"
+ #include "frame-unwind.h"
+@@ -35,6 +38,7 @@
+ #include "arch-utils.h"
+ #include "floatformat.h"
+ #include "regcache.h"
++#include "regset.h"
+ #include "doublest.h"
+ #include "osabi.h"
+ #include "reggroups.h"
+@@ -67,23 +71,6 @@ static const char *const sh_cc_enum[] = {
+ 
+ static const char *sh_active_calling_convention = sh_cc_gcc;
+ 
+-#define SH_NUM_REGS 67
+-
+-struct sh_frame_cache
+-{
+-  /* Base address.  */
+-  CORE_ADDR base;
+-  LONGEST sp_offset;
+-  CORE_ADDR pc;
+-
+-  /* Flag showing that a frame has been created in the prologue code.  */
+-  int uses_fp;
+-
+-  /* Saved registers.  */
+-  CORE_ADDR saved_regs[SH_NUM_REGS];
+-  CORE_ADDR saved_sp;
+-};
+-
+ static int
+ sh_is_renesas_calling_convention (struct type *func_type)
+ {
+@@ -1043,7 +1030,7 @@ sh_treat_as_flt_p (struct type *type)
+     return 0;
+   /* Otherwise if the type of that member is float, the whole type is
+      treated as float.  */
+-  if (TYPE_CODE (TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_FLT)
++  if (TYPE_CODE (check_typedef (TYPE_FIELD_TYPE (type, 0))) == TYPE_CODE_FLT)
+     return 1;
+   /* Otherwise it's not treated as float.  */
+   return 0;
+@@ -1093,7 +1080,7 @@ sh_push_dummy_call_fpu (struct gdbarch *gdbarch,
+      in four registers available.  Loop thru args from first to last.  */
+   for (argnum = 0; argnum < nargs; argnum++)
+     {
+-      type = value_type (args[argnum]);
++      type = check_typedef (value_type (args[argnum]));
+       len = TYPE_LENGTH (type);
+       val = sh_justify_value_in_reg (gdbarch, args[argnum], len);
+ 
+@@ -1821,7 +1808,7 @@ sh_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum,
+     reg->how = DWARF2_FRAME_REG_UNDEFINED;
+ }
+ 
+-static struct sh_frame_cache *
++struct sh_frame_cache *
+ sh_alloc_frame_cache (void)
+ {
+   struct sh_frame_cache *cache;
+@@ -1848,7 +1835,7 @@ sh_alloc_frame_cache (void)
+   return cache;
+ }
+ 
+-static struct sh_frame_cache *
++struct sh_frame_cache *
+ sh_frame_cache (struct frame_info *this_frame, void **this_cache)
+ {
+   struct gdbarch *gdbarch = get_frame_arch (this_frame);
+@@ -1915,9 +1902,9 @@ sh_frame_cache (struct frame_info *this_frame, void **this_cache)
+   return cache;
+ }
+ 
+-static struct value *
+-sh_frame_prev_register (struct frame_info *this_frame,
+-			void **this_cache, int regnum)
++struct value *
++sh_frame_prev_register (struct frame_info *this_frame, void **this_cache,
++			int regnum)
+ {
+   struct gdbarch *gdbarch = get_frame_arch (this_frame);
+   struct sh_frame_cache *cache = sh_frame_cache (this_frame, this_cache);
+@@ -1931,7 +1918,7 @@ sh_frame_prev_register (struct frame_info *this_frame,
+      the current frame.  Frob regnum so that we pull the value from
+      the correct place.  */
+   if (regnum == gdbarch_pc_regnum (gdbarch))
+-    regnum = PR_REGNUM;
++    regnum = PR_REGNUM; /* XXX: really? */
+ 
+   if (regnum < SH_NUM_REGS && cache->saved_regs[regnum] != -1)
+     return frame_unwind_got_memory (this_frame, regnum,
+@@ -2237,8 +2224,8 @@ sh_return_in_first_hidden_param_p (struct gdbarch *gdbarch,
+ static struct gdbarch *
+ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+ {
+-  struct gdbarch *gdbarch;
+   struct gdbarch_tdep *tdep;
++  struct gdbarch *gdbarch;
+ 
+   /* SH5 is handled entirely in sh64-tdep.c.  */
+   if (info.bfd_arch_info->mach == bfd_mach_sh5)
+@@ -2254,6 +2241,18 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+   tdep = XCNEW (struct gdbarch_tdep);
+   gdbarch = gdbarch_alloc (&info, tdep);
+ 
++  /* General-purpose registers.  */
++  tdep->gregset = NULL;
++  tdep->gregset_reg_offset = NULL;
++  tdep->gregset_num_regs = 23;
++  tdep->sizeof_gregset = 0;
++
++  /* Floating-point registers.  */
++  tdep->fpregset = NULL;
++  tdep->sizeof_fpregset = 34*4;
++
++  tdep->jb_pc_offset = -1;
++
+   set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
+   set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+   set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
+@@ -2404,10 +2403,11 @@ sh_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
+       break;
+     }
+ 
++  dwarf2_append_unwinders (gdbarch);
++
+   /* Hook in ABI-specific overrides, if they have been registered.  */
+   gdbarch_init_osabi (info, gdbarch);
+ 
+-  dwarf2_append_unwinders (gdbarch);
+   frame_unwind_append_unwinder (gdbarch, &sh_stub_unwind);
+   frame_unwind_append_unwinder (gdbarch, &sh_frame_unwind);
+ 
+diff --git a/gdb/sh-tdep.h b/gdb/sh-tdep.h
+index fc671a5..699f59f 100644
+--- a/gdb/sh-tdep.h
++++ b/gdb/sh-tdep.h
+@@ -21,6 +21,12 @@
+ 
+ /* Contributed by Steve Chamberlain sac@cygnus.com.  */
+ 
++struct frame_info;
++struct gdbarch;
++struct reggroup;
++struct regset;
++struct regcache;
++
+ /* Registers for all SH variants.  Used also by sh3-rom.c.  */
+ enum
+   {
+@@ -29,6 +35,7 @@ enum
+     ARG0_REGNUM = 4,
+     ARGLAST_REGNUM = 7,
+     FP_REGNUM = 14,
++    SP_REGNUM = 15,
+     PC_REGNUM = 16,
+     PR_REGNUM = 17,
+     GBR_REGNUM = 18,
+@@ -81,6 +88,24 @@ enum
+     FV0_REGNUM = 76,
+     FV_LAST_REGNUM = 79
+   };
++#define SH_NUM_REGS 67
++
++struct sh_frame_cache
++{
++  /* Base address.  */
++  CORE_ADDR base;
++  LONGEST sp_offset;
++  CORE_ADDR pc;
++
++  /* Flag showing that a frame has been created in the prologue code. */
++  int uses_fp;
++
++  /* Saved registers.  */
++  CORE_ADDR saved_regs[SH_NUM_REGS];
++  CORE_ADDR saved_sp;
++};
++
++extern struct sh_frame_cache *sh_frame_cache (struct frame_info *next_frame, void **this_cache);
+ 
+ /* This structure describes a register in a core-file.  */
+ struct sh_corefile_regmap
+@@ -89,8 +114,32 @@ struct sh_corefile_regmap
+   unsigned int offset;
+ };
+ 
++/* sh architecture specific information.  */
+ struct gdbarch_tdep
+ {
++  /* General-purpose registers.  */
++  struct regset *gregset;
++  int *gregset_reg_offset;
++  int gregset_num_regs;
++  size_t sizeof_gregset;
++
++  /* Floating-point registers.  */
++  struct regset *fpregset;
++  size_t sizeof_fpregset;
++
++  /* Offset of saved PC in jmp_buf.  */
++  int jb_pc_offset;
++
++  /* Detect sigtramp.  */
++  int (*sigtramp_p) (struct frame_info *);
++
++  /* Get address of sigcontext for sigtramp.  */
++  CORE_ADDR (*sigcontext_addr) (struct frame_info *);
++
++  /* Offset of registers in `struct sigcontext'.  */
++  int *sc_reg_offset;
++  int sc_num_regs;
++
+   /* Non-NULL when debugging from a core file.  Provides the offset
+      where each general-purpose register is stored inside the associated
+      core file section.  */
+diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
+index 8854af0..ef44682 100644
+--- a/gdb/testsuite/gdb.asm/asm-source.exp
++++ b/gdb/testsuite/gdb.asm/asm-source.exp
+@@ -113,6 +113,11 @@ switch -glob -- [istarget] {
+             append link-flags " -m elf32ppc"
+         }
+     }
++    "sh*-linux*" {
++        set asm-arch sh-linux
++        set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
++	set debug-flags "-gdwarf-2"
++    }
+     "sh*-*-*" {
+         set asm-arch sh
+ 	set debug-flags "-gdwarf-2"
+diff --git a/gdb/testsuite/gdb.asm/sh.inc b/gdb/testsuite/gdb.asm/sh.inc
+index a4a5fc5..89efed7 100644
+--- a/gdb/testsuite/gdb.asm/sh.inc
++++ b/gdb/testsuite/gdb.asm/sh.inc
+@@ -40,9 +40,8 @@
+ 	mov.l   .Lconst\@,r1
+ 	bra	.Lafterconst\@
+ 	nop
+-	nop
+-.Lconst\@:
+ 	.align	2
++.Lconst\@:
+ 	.long	\subr
+ 	.align	1
+ .Lafterconst\@:
+diff --git a/gdb/testsuite/gdb.base/annota1.c b/gdb/testsuite/gdb.base/annota1.c
+index 424e1b8..0de2e7b 100644
+--- a/gdb/testsuite/gdb.base/annota1.c
++++ b/gdb/testsuite/gdb.base/annota1.c
+@@ -1,6 +1,9 @@
+ #include <stdio.h>
+ #include <signal.h>
+ 
++#ifdef __sh__
++#define signal(a,b)    /* Signals not supported on this target - make them go away */
++#endif
+ 
+ void
+ handle_USR1 (int sig)
+diff --git a/gdb/testsuite/gdb.base/annota3.c b/gdb/testsuite/gdb.base/annota3.c
+index 424e1b8..952aaf2 100644
+--- a/gdb/testsuite/gdb.base/annota3.c
++++ b/gdb/testsuite/gdb.base/annota3.c
+@@ -1,6 +1,10 @@
+ #include <stdio.h>
+ #include <signal.h>
+ 
++#ifdef __sh__
++#define signal(a,b)    /* Signals not supported on this target - make them go away */
++#endif
++
+ 
+ void
+ handle_USR1 (int sig)
+diff --git a/gdb/testsuite/gdb.base/sigall.c b/gdb/testsuite/gdb.base/sigall.c
+index 81f3b08..1574b2d 100644
+--- a/gdb/testsuite/gdb.base/sigall.c
++++ b/gdb/testsuite/gdb.base/sigall.c
+@@ -1,6 +1,9 @@
+ #include <signal.h>
+ #include <unistd.h>
+ 
++#ifdef __sh__
++#define signal(a,b)    /* Signals not supported on this target - make them go away */
++#endif
+ 
+ /* Signal handlers, we set breakpoints in them to make sure that the
+    signals really get delivered.  */
+diff --git a/gdb/testsuite/gdb.base/signals.c b/gdb/testsuite/gdb.base/signals.c
+index 7566068..1205a9b 100644
+--- a/gdb/testsuite/gdb.base/signals.c
++++ b/gdb/testsuite/gdb.base/signals.c
+@@ -3,6 +3,10 @@
+ #include <signal.h>
+ #include <unistd.h>
+ 
++#ifdef __sh__
++#define signal(a,b)    /* Signals not supported on this target - make them go away */
++#define alarm(a)       /* Ditto for alarm() */
++#endif
+ 
+ static int count = 0;
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/gdb/gdb/fix-detection-of-64-bit-PPC-inferior-in-gdbserver.patch b/meta/recipes-devtools/gdb/gdb/fix-detection-of-64-bit-PPC-inferior-in-gdbserver.patch
new file mode 100644
index 0000000..2854352
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb/fix-detection-of-64-bit-PPC-inferior-in-gdbserver.patch
@@ -0,0 +1,56 @@
+From 4fe67dbafa1bee679daecc12ed30621d5c2605de Mon Sep 17 00:00:00 2001
+From: Yao Qi <yao@codesourcery.com>
+Date: Mon, 11 May 2015 10:57:33 +0800
+Subject: [PATCH] Fix detection of 64-bit PPC inferior in gdbserver
+
+Issue #16775
+
+* gdbserver/linux-ppc-low.c (ppc_arch_setup): Change variable msr to type
+'unsigned long'.  Check bit 63 or bit 31 is one.
+
+https://sourceware.org/ml/gdb-patches/2014-12/msg00239.html
+Written by: Yao Qi <yao@codesourcery.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ gdb/gdbserver/linux-ppc-low.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
+index 63d4218..a62cf22 100644
+--- a/gdb/gdbserver/linux-ppc-low.c
++++ b/gdb/gdbserver/linux-ppc-low.c
+@@ -374,7 +374,7 @@ ppc_arch_setup (void)
+ {
+   const struct target_desc *tdesc;
+ #ifdef __powerpc64__
+-  long msr;
++  unsigned long msr;
+   struct regcache *regcache;
+ 
+   /* On a 64-bit host, assume 64-bit inferior process with no
+@@ -384,13 +384,16 @@ ppc_arch_setup (void)
+   current_process ()->tdesc = tdesc;
+   ppc_hwcap = 0;
+ 
+-  /* Only if the high bit of the MSR is set, we actually have
+-     a 64-bit inferior.  */
++  /* We actually have a 64-bit inferior only if the certain bit of the
++     MSR is set.  The PowerISA Book III-S MSR is different from the
++     PowerISA Book III-E MSR.  The Book III-S MSR is 64 bits wide, and
++     its MSR[SF] is the bit 0 of a 64-bit value.  Book III-E MSR is 32
++     bits wide, and its MSR[CM] is the bit 0 of a 32-bit value.  */
+   regcache = new_register_cache (tdesc);
+   fetch_inferior_registers (regcache, find_regno (tdesc, "msr"));
+   collect_register_by_name (regcache, "msr", &msr);
+   free_register_cache (regcache);
+-  if (msr < 0)
++  if (msr & 0x8000000080000000)
+     {
+       ppc_get_hwcap (&ppc_hwcap);
+       if (ppc_hwcap & PPC_FEATURE_CELL)
+-- 
+1.8.5.2.233.g932f7e4
+
diff --git a/meta/recipes-devtools/gdb/gdb_7.9.1.bb b/meta/recipes-devtools/gdb/gdb_7.9.1.bb
new file mode 100644
index 0000000..cd52e27
--- /dev/null
+++ b/meta/recipes-devtools/gdb/gdb_7.9.1.bb
@@ -0,0 +1,24 @@
+require gdb.inc
+require gdb-${PV}.inc
+
+inherit python-dir
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[python] = "--with-python=${WORKDIR}/python,--without-python,python,python python-codecs"
+PACKAGECONFIG[babeltrace] = "--with-babeltrace,--without-babeltrace,babeltrace"
+
+do_configure_prepend() {
+	if [ -n "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}" ]; then
+		cat > ${WORKDIR}/python << EOF
+#!/bin/sh
+case "\$2" in
+	--includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}/" ;;
+	--ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}" ;;
+	--exec-prefix) echo "${exec_prefix}" ;;
+	*) exit 1 ;;
+esac
+exit 0
+EOF
+		chmod +x ${WORKDIR}/python
+	fi
+}
diff --git a/meta/recipes-devtools/git/git.inc b/meta/recipes-devtools/git/git.inc
new file mode 100644
index 0000000..4da4a27
--- /dev/null
+++ b/meta/recipes-devtools/git/git.inc
@@ -0,0 +1,130 @@
+SUMMARY = "Distributed version control system"
+HOMEPAGE = "http://git-scm.com"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+DEPENDS = "openssl curl zlib expat"
+
+PROVIDES_append_class-native = " git-replacement-native"
+
+SRC_URI = "${KERNELORG_MIRROR}/software/scm/git/git-${PV}.tar.gz;name=tarball \
+           ${KERNELORG_MIRROR}/software/scm/git/git-manpages-${PV}.tar.gz;name=manpages"
+
+S = "${WORKDIR}/git-${PV}"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=7c0d7ef03a7eb04ce795b0f60e68e7e1"
+
+EXTRA_OECONF = "--with-perl=${STAGING_BINDIR_NATIVE}/perl-native/perl \
+		--without-tcltk \
+"
+
+inherit autotools-brokensep perlnative
+
+EXTRA_OEMAKE = "NO_PYTHON=1 CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
+EXTRA_OEMAKE += "'PERL_PATH=/usr/bin/env perl'"
+EXTRA_OEMAKE_append_class-native = " NO_CROSS_DIRECTORY_HARDLINKS=1"
+
+do_compile_prepend () {
+	# Remove perl/perl.mak to fix the out-of-date perl.mak error
+	# during rebuild
+	rm -f perl/perl.mak
+}
+
+do_install () {
+	oe_runmake install DESTDIR="${D}" bindir=${bindir} \
+		template_dir=${datadir}/git-core/templates \
+		GIT_PYTHON_DIR=${D}${datadir}/git-core/python
+	install -d ${D}/${mandir}/man1
+	install -d ${D}/${mandir}/man5
+	install -d ${D}/${mandir}/man7
+	install -t ${D}/${mandir}/man1 ${WORKDIR}/man1/*
+	install -t ${D}/${mandir}/man5 ${WORKDIR}/man5/*
+	install -t ${D}/${mandir}/man7 ${WORKDIR}/man7/*
+	install -d ${D}/${datadir}/bash-completion/completions/
+	install -m 644 ${S}/contrib/completion/git-completion.bash ${D}/${datadir}/bash-completion/completions/git
+}
+
+perl_native_fixup () {
+	sed -i -e 's#${STAGING_BINDIR_NATIVE}/perl-native/#${bindir}/#' \
+	       -e 's#${libdir}/perl-native/#${libdir}/#' \
+	    ${@d.getVar("PERLTOOLS", True).replace(' /',d.getVar('D', True) + '/')}
+
+	# ${libdir} is not applicable here, perl-native files are always
+	# installed to /usr/lib on both 32/64 bits targets.
+	mv ${D}${exec_prefix}/lib/perl-native/perl ${D}${libdir}
+	rmdir -p ${D}${exec_prefix}/lib/perl-native || true
+}
+
+REL_GIT_EXEC_PATH = "${@os.path.relpath(libexecdir, bindir)}/git-core"
+REL_GIT_TEMPLATE_DIR = "${@os.path.relpath(datadir, bindir)}/git-core/templates"
+
+do_install_append_class-target () {
+	perl_native_fixup
+}
+
+do_install_append_class-native() {
+	create_wrapper ${D}${bindir}/git \
+		GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
+		GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
+}
+
+do_install_append_class-nativesdk() {
+	create_wrapper ${D}${bindir}/git \
+		GIT_EXEC_PATH='`dirname $''realpath`'/${REL_GIT_EXEC_PATH} \
+		GIT_TEMPLATE_DIR='`dirname $''realpath`'/${REL_GIT_TEMPLATE_DIR}
+	perl_native_fixup
+}
+
+FILES_${PN} += "${datadir}/git-core ${libexecdir}/git-core/"
+FILES_${PN}-dbg += "${libexecdir}/git-core/.debug"
+
+PERLTOOLS = " \
+    ${libexecdir}/git-core/git-add--interactive \
+    ${libexecdir}/git-core/git-archimport \
+    ${libexecdir}/git-core/git-cvsexportcommit \
+    ${libexecdir}/git-core/git-cvsimport \
+    ${libexecdir}/git-core/git-cvsserver \
+    ${bindir}/git-cvsserver \
+    ${libexecdir}/git-core/git-difftool \
+    ${libexecdir}/git-core/git-relink \
+    ${libexecdir}/git-core/git-send-email \
+    ${libexecdir}/git-core/git-svn \
+    ${libexecdir}/git-core/git-instaweb \
+    ${libexecdir}/git-core/git-submodule \
+    ${libexecdir}/git-core/git-am \
+    ${libexecdir}/git-core/git-request-pull \
+    ${datadir}/gitweb/gitweb.cgi \
+    ${datadir}/git-core/templates/hooks/prepare-commit-msg.sample \
+    ${datadir}/git-core/templates/hooks/pre-rebase.sample \
+"
+
+# Basic tab completion support
+PACKAGES =+ "${PN}-bash-completion"
+FILES_${PN}-bash-completion = "${datadir}/bash-completion/completions/*"
+
+# Git tools requiring perl
+PACKAGES =+ "${PN}-perltools"
+FILES_${PN}-perltools += " \
+    ${PERLTOOLS} \
+    ${libdir}/perl \
+    ${datadir}/perl \
+"
+RDEPENDS_${PN}-perltools = "${PN} perl perl-module-file-path findutils"
+
+PACKAGES =+ "${PN}-python"
+FILES_${PN}-python = "${libdir}/python*"
+
+
+# git-tk package with gitk and git-gui
+PACKAGES =+ "${PN}-tk"
+#RDEPENDS_${PN}-tk = "${PN} tk tcl"
+#EXTRA_OEMAKE = "TCL_PATH=${STAGING_BINDIR_CROSS}/tclsh"
+FILES_${PN}-tk = " \
+    ${bindir}/gitk \
+    ${datadir}/gitk \
+"
+
+PACKAGES =+ "gitweb"
+FILES_gitweb = "${datadir}/gitweb/"
+
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/git/git_2.5.0.bb b/meta/recipes-devtools/git/git_2.5.0.bb
new file mode 100644
index 0000000..de686c2
--- /dev/null
+++ b/meta/recipes-devtools/git/git_2.5.0.bb
@@ -0,0 +1,11 @@
+require git.inc
+
+EXTRA_OECONF += "ac_cv_snprintf_returns_bogus=no \
+                 ac_cv_fread_reads_directories=${ac_cv_fread_reads_directories=yes} \
+                 "
+EXTRA_OEMAKE += "NO_GETTEXT=1"
+
+SRC_URI[tarball.md5sum] = "3bc9b0a803ae8ec6c5316cc64f0b7f78"
+SRC_URI[tarball.sha256sum] = "8fa13ba8434ff83d24f57f831d55dbb9046434c266641180a37744facfce72ac"
+SRC_URI[manpages.md5sum] = "134b049e51420a336049aac21c88a75a"
+SRC_URI[manpages.sha256sum] = "745e4e797fe5061e781c880d370b1beb480199127da5acaf4e376e0b09d4d685"
diff --git a/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch b/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch
new file mode 100644
index 0000000..2094116
--- /dev/null
+++ b/meta/recipes-devtools/gnu-config/gnu-config/config-guess-uclibc.patch
@@ -0,0 +1,170 @@
+Upstream-Status: Pending
+
+Patch courtesy gentoo-portage/sys-devel/gnuconfig/files/automake-1.8.5-config-guess-uclibc.patch.
+
+updated to 20050516 by Marcin 'Hrw' Juszkiewicz (by hand)
+updated to 20080123 by Nitin A Kamble (by hand)
+updated to 20111001 by Saul Wold (by hand)
+updated to 20120818 by Marcin 'Hrw' Juszkiewicz (by hand)
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
+
+---
+ config.guess |   67 +++++++++++++++++++++++++++++++++++------------------------
+ 1 file changed, 40 insertions(+), 27 deletions(-)
+
+--- git.orig/config.guess
++++ git/config.guess
+@@ -138,6 +138,19 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
+ UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+ UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+ 
++# Detect uclibc systems.
++
++LIBC="gnu"
++if [ -f /usr/include/bits/uClibc_config.h ]
++then
++	LIBC=uclibc
++	if [ -n `grep "#define __UCLIBC_CONFIG_VERSION__" /usr/include/bits/uClibc_config.h` ]
++	then
++		UCLIBC_SUBVER=`sed -n "/#define __UCLIBC_CONFIG_VERSION__ /s///p" /usr/include/bits/uClibc_config.h`
++		LIBC=$LIBC$UCLIBC_SUBVER
++	fi
++fi
++
+ # Note: order is significant - the case branches are not exclusive.
+ 
+ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+@@ -886,15 +899,15 @@ EOF
+ 	  EV68*) UNAME_MACHINE=alphaev68 ;;
+ 	esac
+ 	objdump --private-headers /bin/sh | grep -q ld.so.1
+-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
++	if test "$?" = 0 ; then LIBC="gnulibc1" ; else LIBC="" ; fi
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     arm*:Linux:*:*)
+ 	eval $set_cc_for_build
+ 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ 	    | grep -q __ARM_EABI__
+ 	then
+-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
++	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	else
+ 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ 		| grep -q __ARM_PCS_VFP
+@@ -906,19 +919,19 @@ EOF
+ 	fi
+ 	exit ;;
+     avr32*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     cris:Linux:*:*)
+-	echo ${UNAME_MACHINE}-axis-linux-gnu
++	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ 	exit ;;
+     crisv32:Linux:*:*)
+-	echo ${UNAME_MACHINE}-axis-linux-gnu
++	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ 	exit ;;
+     frv:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     hexagon:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     i*86:Linux:*:*)
+ 	LIBC=gnu
+@@ -932,13 +945,13 @@ EOF
+ 	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ 	exit ;;
+     ia64:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     m32r*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     m68*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     mips:Linux:*:* | mips64:Linux:*:*)
+ 	eval $set_cc_for_build
+@@ -957,54 +970,54 @@ EOF
+ 	#endif
+ EOF
+ 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
++	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ 	;;
+     or32:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     padre:Linux:*:*)
+-	echo sparc-unknown-linux-gnu
++	echo sparc-unknown-linux-${LIBC}
+ 	exit ;;
+     parisc64:Linux:*:* | hppa64:Linux:*:*)
+-	echo hppa64-unknown-linux-gnu
++	echo hppa64-unknown-linux-${LIBC}
+ 	exit ;;
+     parisc:Linux:*:* | hppa:Linux:*:*)
+ 	# Look for CPU level
+ 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+-	  *)    echo hppa-unknown-linux-gnu ;;
++	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
++	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
++	  *)    echo hppa-unknown-linux-${LIBC} ;;
+ 	esac
+ 	exit ;;
+     ppc64:Linux:*:*)
+-	echo powerpc64-unknown-linux-gnu
++	echo powerpc64-unknown-linux-${LIBC}
+ 	exit ;;
+     ppc:Linux:*:*)
+-	echo powerpc-unknown-linux-gnu
++	echo powerpc-unknown-linux-${LIBC}
+ 	exit ;;
+     s390:Linux:*:* | s390x:Linux:*:*)
+ 	echo ${UNAME_MACHINE}-ibm-linux
+ 	exit ;;
+     sh64*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     sh*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     sparc:Linux:*:* | sparc64:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     tile*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     vax:Linux:*:*)
+-	echo ${UNAME_MACHINE}-dec-linux-gnu
++	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ 	exit ;;
+     x86_64:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     xtensa*:Linux:*:*)
+-	echo ${UNAME_MACHINE}-unknown-linux-gnu
++	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ 	exit ;;
+     i*86:DYNIX/ptx:4*:*)
+ 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
diff --git a/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in b/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in
new file mode 100755
index 0000000..d4908fc
--- /dev/null
+++ b/meta/recipes-devtools/gnu-config/gnu-config/gnu-configize.in
@@ -0,0 +1,267 @@
+#! /usr/bin/env perl
+# -*- perl -*-
+
+eval 'case $# in 0) exec /usr/bin/perl -S "$0";; *) exec /usr/bin/perl -S "$0" "$@";; esac'
+    if 0;
+
+# gnu-configize - install the GNU config.guess / config.sub in a directory tree
+# Based on autoreconf:
+#   Copyright (C) 1994, 1999, 2000, 2001, 2002, 2003
+#   Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+BEGIN
+{
+  my $datadir = $ENV{'autom4te_perllibdir'} || '@autom4te_perllibdir@';
+#  '/home/kergoth/code/build-arm/tmp/staging/share/autoconf';
+  unshift @INC, $datadir;
+
+  # Override SHELL.  On DJGPP SHELL may not be set to a shell
+  # that can handle redirection and quote arguments correctly,
+  # e.g.: COMMAND.COM.  For DJGPP always use the shell that configure
+  # has detected.
+  $ENV{'SHELL'} = '/bin/sh' if ($^O eq 'dos');
+}
+
+use Autom4te::ChannelDefs;
+use Autom4te::Channels;
+use Autom4te::Configure_ac;
+use Autom4te::FileUtils;
+use Autom4te::General;
+use Autom4te::XFile;
+# Do not use Cwd::chdir, since it might hang.
+use Cwd 'cwd';
+use strict;
+
+## ----------- ##
+## Variables.  ##
+## ----------- ##
+
+# $HELP
+# -----
+$help = "Usage: $0 [OPTION] ... [CONFIGURE-AC or DIRECTORY] ...
+
+Install the GNU config.sub and config.guess scripts in the
+DIRECTORIES or the directory trees driven by CONFIGURE-AC
+(defaulting to `.').
+
+Operation modes:
+  -h, --help               print this help, then exit
+  -V, --version            print version number, then exit
+  -v, --verbose            verbosely report processing
+  -f, --force              consider all files obsolete
+  -s, --symlink            install symbolic links instead of copies
+  -W, --warnings=CATEGORY  report the warnings falling in CATEGORY [syntax]
+
+" . Autom4te::ChannelDefs::usage . "
+
+The environment variable \`WARNINGS\' is honored.  Some subtools might
+support other warning types, using \`all' is encouraged.
+";
+
+# $VERSION
+# --------
+$version = "gnu-configize 1.0
+
+Copyright (C) 2004 Chris Larson
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+";
+
+my $configdir  = '@gnu-configdir@';
+#'/home/kergoth/code/build-arm/tmp/staging/i686-linux/share/gnu-config';
+my $autoconf   = $ENV{'AUTOCONF'}     || 'autoconf';
+
+# use symlinks instead.
+my $symlink = 0;
+
+my $configure_ac;
+
+my $rm = "rm -f";
+my $ln_s = "ln -sf";
+my $cp = "cp -f";
+my $mkdir = "mkdir";
+my $chmod = "chmod";
+
+## ---------- ##
+## Routines.  ##
+## ---------- ##
+
+
+# parse_args ()
+# -------------
+# Process any command line arguments.
+sub parse_args ()
+{
+  my $srcdir;
+
+  getopt ('s|symlink'            => \$symlink);
+
+  # Even if the user specified a configure.ac, trim to get the
+  # directory, and look for configure.ac again.  Because (i) the code
+  # is simpler, and (ii) we are still able to diagnose simultaneous
+  # presence of configure.ac and configure.in.
+  @ARGV = map { /configure\.(ac|in)$/ ? dirname ($_) : $_ } @ARGV;
+  push @ARGV, '.' unless @ARGV;
+}
+
+
+# &gnu_configize_current_directory
+# -----------------------------
+sub gnu_configize_current_directory ()
+{
+  my $configure_ac = require_configure_ac;
+
+  # ---------------------- #
+  # Is it using Autoconf?  #
+  # ---------------------- #
+
+  my $uses_autoconf;
+  my $uses_gettext;
+  my $configure_ac_file = new Autom4te::XFile $configure_ac;
+  while ($_ = $configure_ac_file->getline)
+     {
+       s/#.*//;
+       s/dnl.*//;
+       $uses_autoconf = 1 if /AC_INIT/;
+     }
+
+  if (!$uses_autoconf)
+    {
+      verb "$configure_ac: not using Autoconf";
+      return;
+    }
+
+  my $aux_dir;
+  my @subdir;
+  my $cmd;
+  my $dest;
+
+  verb "$configure_ac: tracing";
+  my $traces = new Autom4te::XFile
+    ("$autoconf"
+     . join (' --trace=', '',
+	     # If you change this list, update the
+	     # `Autoreconf-preselections' section of autom4te.in.
+	     'AC_CONFIG_AUX_DIR:AC_CONFIG_AUX_DIR:\$1',
+	     'AC_CONFIG_SUBDIRS:AC_CONFIG_SUBDIRS:\$1',
+	     'AC_INIT',
+	    )
+     . ' |');
+  while ($_ = $traces->getline)
+    {
+      $aux_dir = $1                 if /AC_CONFIG_AUX_DIR:(.*)/;
+      $uses_autoconf = 1            if /AC_INIT/;
+      push @subdir, split (' ', $1) if /AC_CONFIG_SUBDIRS:(.*)/;
+    }
+
+  # The subdirs are *optional*, they may not exist.
+  foreach (@subdir)
+    {
+      if (-d)
+	{
+	  verb "$configure_ac: subdirectory $_ to gnu-configize";
+	  gnu_configize ($_);
+	}
+      else
+	{
+	  verb "$configure_ac: subdirectory $_ not present";
+	}
+    }
+
+  $dest = ".";
+
+  if (defined $aux_dir)
+    {
+      $dest = $aux_dir;
+      if (! -d $aux_dir)
+        {
+          verb "$configure_ac: creating directory $aux_dir";
+          mkdir $aux_dir
+            or error "cannot create $aux_dir: $!";
+        }
+    }
+
+  if (!$symlink)
+    {
+      $cmd = $cp;
+    }
+  else
+    {
+      $cmd = $ln_s;
+    }
+
+  xsystem ("$cmd $configdir/config.guess $dest/");
+  xsystem ("$chmod u+x $dest/config.guess");
+  xsystem ("$cmd $configdir/config.sub $dest/");
+  xsystem ("$chmod u+x $dest/config.sub");
+}
+
+
+# &gnu_configize ($DIRECTORY)
+# ------------------------
+# Reconf the $DIRECTORY.
+sub gnu_configize ($)
+{
+  my ($directory) = @_;
+  my $cwd = cwd;
+
+  # The format for this message is not free: taken from Emacs, itself
+  # using GNU Make's format.
+  verb "Entering directory `$directory'";
+  chdir $directory
+    or error "cannot chdir to $directory: $!";
+
+  gnu_configize_current_directory;
+
+  # The format is not free: taken from Emacs, itself using GNU Make's
+  # format.
+  verb "Leaving directory `$directory'";
+  chdir $cwd
+    or error "cannot chdir to $cwd: $!";
+}
+
+
+## ------ ##
+## Main.  ##
+## ------ ##
+
+parse_args;
+
+# Autoreconf all the given configure.ac.  A while loop, not a for,
+# since the list can change at runtime because of AC_CONFIG_SUBDIRS.
+for my $directory (@ARGV)
+  {
+    gnu_configize ($directory);
+  }
+
+### Setup "GNU" style for perl-mode and cperl-mode.
+## Local Variables:
+## perl-indent-level: 2
+## perl-continued-statement-offset: 2
+## perl-continued-brace-offset: 0
+## perl-brace-offset: 0
+## perl-brace-imaginary-offset: 0
+## perl-label-offset: -2
+## cperl-indent-level: 2
+## cperl-brace-offset: 0
+## cperl-continued-brace-offset: 0
+## cperl-label-offset: -2
+## cperl-extra-newline-before-brace: t
+## cperl-merge-trailing-else: nil
+## cperl-continued-statement-offset: 2
+## End:
diff --git a/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch b/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch
new file mode 100644
index 0000000..3147435
--- /dev/null
+++ b/meta/recipes-devtools/gnu-config/gnu-config/musl-support.patch
@@ -0,0 +1,25 @@
+support musl
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: gnu-config-20120814/config.sub
+===================================================================
+--- gnu-config-20120814.orig/config.sub	2012-09-18 02:27:45.000000000 -0700
++++ gnu-config-20120814/config.sub	2014-03-26 00:34:19.955996709 -0700
+@@ -123,6 +123,7 @@
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
++  linux-musl* | \
+   linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+   knetbsd*-gnu* | netbsd*-gnu* | \
+   kopensolaris*-gnu* | \
+@@ -1365,6 +1366,7 @@
+ 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ 	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ 	      | -linux-newlib* | -linux-uclibc* \
++	      | -linux-musl* \
+ 	      | -uxpv* | -beos* | -mpeix* | -udk* \
+ 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
diff --git a/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch b/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch
new file mode 100644
index 0000000..75fe100
--- /dev/null
+++ b/meta/recipes-devtools/gnu-config/gnu-config/uclibc.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+--- config.sub.orig	2004-05-14 19:38:36.000000000 -0500
++++ config.sub	2004-05-14 19:39:17.000000000 -0500
+@@ -118,7 +118,7 @@
+ # Here we must recognize all the valid KERNEL-OS combinations.
+ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+ case $maybe_os in
+-  nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
++  nto-qnx* | linux-gnu* | linux-uclibc* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+     os=-$maybe_os
+     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+     ;;
+@@ -1135,7 +1135,8 @@
+ 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ 	      | -chorusos* | -chorusrdb* \
+ 	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+-	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
++	      | -mingw32* | -linux-gnu* | -linux-uclibc* \
++	      | -uxpv* | -beos* | -mpeix* | -udk* \
+ 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
diff --git a/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb b/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb
new file mode 100644
index 0000000..eb7e420
--- /dev/null
+++ b/meta/recipes-devtools/gnu-config/gnu-config_20120814.bb
@@ -0,0 +1,41 @@
+SUMMARY = "gnu-configize"
+DESCRIPTION = "Tool that installs the GNU config.guess / config.sub into a directory tree"
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://config.guess;endline=39;md5=b79a4663475f4d724846463277817e0d"
+
+DEPENDS_class-native = "perl-native-runtime"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/gnu-config/gnu-config-${PV}.tar.bz2 \
+	   file://config-guess-uclibc.patch \
+	   file://musl-support.patch \
+           file://gnu-configize.in"
+
+SRC_URI[md5sum] = "bcfca5a2bb39edad4aae5a65efc84094"
+SRC_URI[sha256sum] = "44f99a8e76f3e8e4fec0bb5ad4762f8e44366168554ce66cb85afbe2ed3efd8b"
+
+CLEANBROKEN = "1"
+
+do_compile[noexec] = "1"
+
+do_install () {
+	install -d ${D}${datadir}/gnu-config \
+		   ${D}${bindir}
+	cat ${WORKDIR}/gnu-configize.in | \
+		sed -e 's,@gnu-configdir@,${datadir}/gnu-config,g' \
+		    -e 's,@autom4te_perllibdir@,${datadir}/autoconf,g' > ${D}${bindir}/gnu-configize
+	# In the native case we want the system perl as perl-native can't have built yet
+	if [ "${PN}" != "gnu-config-native" -a "${PN}" != "nativesdk-gnu-config" ]; then
+		sed -i -e 's,/usr/bin/env,${bindir}/env,g' ${D}${bindir}/gnu-configize
+	fi
+	chmod 755 ${D}${bindir}/gnu-configize
+	install -m 0644 config.guess config.sub ${D}${datadir}/gnu-config/
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} = "${bindir} ${datadir}/gnu-config"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/gnu-config/gnu-config_git.bb b/meta/recipes-devtools/gnu-config/gnu-config_git.bb
new file mode 100644
index 0000000..3d5f2b8
--- /dev/null
+++ b/meta/recipes-devtools/gnu-config/gnu-config_git.bb
@@ -0,0 +1,40 @@
+SUMMARY = "gnu-configize"
+DESCRIPTION = "Tool that installs the GNU config.guess / config.sub into a directory tree"
+SECTION = "devel"
+LICENSE = "GPL-3.0-with-autoconf-exception"
+LIC_FILES_CHKSUM = "file://config.guess;beginline=7;endline=27;md5=9bac8b1743c2240ae07cce6e546ac2f2"
+
+DEPENDS_class-native = "perl-native-runtime"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+SRCREV = "b576fa87c140b824466ef1638e945e87dc5c0343"
+PV = "20150728+git${SRCPV}"
+
+SRC_URI = "git://git.sv.gnu.org/config.git \
+           file://gnu-configize.in"
+
+S = "${WORKDIR}/git"
+
+CLEANBROKEN = "1"
+
+do_compile[noexec] = "1"
+
+do_install () {
+	install -d ${D}${datadir}/gnu-config \
+		   ${D}${bindir}
+	cat ${WORKDIR}/gnu-configize.in | \
+		sed -e 's,@gnu-configdir@,${datadir}/gnu-config,g' \
+		    -e 's,@autom4te_perllibdir@,${datadir}/autoconf,g' > ${D}${bindir}/gnu-configize
+	# In the native case we want the system perl as perl-native can't have built yet
+	if [ "${PN}" != "gnu-config-native" -a "${PN}" != "nativesdk-gnu-config" ]; then
+		sed -i -e 's,/usr/bin/env,${bindir}/env,g' ${D}${bindir}/gnu-configize
+	fi
+	chmod 755 ${D}${bindir}/gnu-configize
+	install -m 0644 config.guess config.sub ${D}${datadir}/gnu-config/
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} = "${bindir} ${datadir}/gnu-config"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/guile/files/arm_aarch64.patch b/meta/recipes-devtools/guile/files/arm_aarch64.patch
new file mode 100644
index 0000000..f1788b6
--- /dev/null
+++ b/meta/recipes-devtools/guile/files/arm_aarch64.patch
@@ -0,0 +1,19 @@
+guile: add aarch64 recognition
+
+Assume little-endian.
+
+Upstream-Status: Pending
+
+Signed-off-by: joe.slater@windriver.com
+
+--- a/module/system/base/target.scm
++++ b/module/system/base/target.scm
+@@ -70,6 +70,8 @@
+             ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+                            "mips" "mips64"))
+              (endianness big))
++            ((string-match "^aarch64" cpu)
++             (endianness little))
+             ((string-match "^arm.*eb" cpu)
+              (endianness big))
+             ((string-match "^arm.*" cpu)
diff --git a/meta/recipes-devtools/guile/files/arm_endianness.patch b/meta/recipes-devtools/guile/files/arm_endianness.patch
new file mode 100644
index 0000000..ea4328b
--- /dev/null
+++ b/meta/recipes-devtools/guile/files/arm_endianness.patch
@@ -0,0 +1,23 @@
+Support form ARM endianness
+
+Fixes Yocto bug# 2729
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: guile-2.0.5/module/system/base/target.scm
+===================================================================
+--- guile-2.0.5.orig/module/system/base/target.scm	2012-01-24 03:06:06.000000000 -0800
++++ guile-2.0.5/module/system/base/target.scm	2012-07-12 13:05:44.372364103 -0700
+@@ -70,7 +70,9 @@
+             ((member cpu '("sparc" "sparc64" "powerpc" "powerpc64" "spu"
+                            "mips" "mips64"))
+              (endianness big))
+-            ((string-match "^arm.*el" cpu)
++            ((string-match "^arm.*eb" cpu)
++             (endianness big))
++            ((string-match "^arm.*" cpu)
+              (endianness little))
+             (else
+              (error "unknown CPU endianness" cpu)))))
diff --git a/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch b/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch
new file mode 100644
index 0000000..43238a7
--- /dev/null
+++ b/meta/recipes-devtools/guile/files/debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [debian patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+From e52bfcdbaca5dce498678d8f512381e3e39a4066 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Sun, 18 Mar 2012 11:40:55 -0500
+Subject: Mark "Unused modules are removed" gc test as unresolved.
+
+As per discussion with upstream, mark this test as unresolved since it
+may produce false negatives, depending on the behavior/timing of the
+garbage collector.
+---
+ test-suite/tests/gc.test |   11 ++++++-----
+ 1 files changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/test-suite/tests/gc.test b/test-suite/tests/gc.test
+index a969752..8c8e13e 100644
+--- a/test-suite/tests/gc.test
++++ b/test-suite/tests/gc.test
+@@ -84,11 +84,13 @@
+       ;; one gc round. not sure why.
+ 
+       (maybe-gc-flakiness
+-       (= (let lp ((i 0))
+-            (if (guard)
+-                (lp (1+ i))
+-                i))
+-          total))))
++       (or (= (let lp ((i 0))
++                (if (guard)
++                    (lp (1+ i))
++                    i))
++              total)
++           (throw 'unresolved)))))
++
+ 
+   (pass-if "Lexical vars are collectable"
+     (let ((l (compile
diff --git a/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch b/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
new file mode 100644
index 0000000..34be3b9
--- /dev/null
+++ b/meta/recipes-devtools/guile/files/debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Inappropriate [debian patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+From 848543091d55dddb54a85612155964506d712852 Mon Sep 17 00:00:00 2001
+From: Rob Browning <rlb@defaultvalue.org>
+Date: Sun, 18 Mar 2012 13:28:24 -0500
+Subject: Mark "mutex with owner not retained" threads test as unresolved.
+
+As per discussion with upstream, mark this test as unresolved since it
+may produce false negatives, depending on the behavior/timing of the
+garbage collector.
+---
+ test-suite/tests/threads.test |    6 ++++--
+ 1 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/test-suite/tests/threads.test b/test-suite/tests/threads.test
+index 85a7c38..50899cb 100644
+--- a/test-suite/tests/threads.test
++++ b/test-suite/tests/threads.test
+@@ -414,8 +414,10 @@
+ 
+             (gc) (gc)
+             (let ((m (g)))
+-              (and (mutex? m)
+-                   (eq? (mutex-owner m) (current-thread)))))))
++              (or
++               (and (mutex? m)
++                    (eq? (mutex-owner m) (current-thread)))
++               (throw 'unresolved))))))
+ 
+       ;;
+       ;; mutex lock levels
diff --git a/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch b/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch
new file mode 100644
index 0000000..e5dc226
--- /dev/null
+++ b/meta/recipes-devtools/guile/files/guile_2.0.6_fix_sed_error.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Pending
+
+This fixes sed issue when prefix has / in it, like /usr/local
+
+autoreconf error avoided:
+| sed: -e expression #1, char 9: unknown option to `s'
+| configure.ac:39: error: AC_INIT should be called with package and version arguments
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/01
+
+Index: guile-2.0.5/build-aux/git-version-gen
+===================================================================
+--- guile-2.0.5.orig/build-aux/git-version-gen
++++ guile-2.0.5/build-aux/git-version-gen
+@@ -187,7 +187,7 @@ else
+     v=UNKNOWN
+ fi
+ 
+-v=`echo "$v" |sed "s/^$prefix//"`
++v=`echo "$v" |sed "s#^$prefix##"`
+ 
+ # Test whether to append the "-dirty" suffix only if the version
+ # string we're using came from git.  I.e., skip the test if it's "UNKNOWN"
diff --git a/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch b/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch
new file mode 100644
index 0000000..290b9d4
--- /dev/null
+++ b/meta/recipes-devtools/guile/files/libguile-Makefile.am-hook.patch
@@ -0,0 +1,42 @@
+From 9c4e120a7a87db34d22a50883a5a525170b480d7 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 6 Jan 2015 23:10:51 -0800
+Subject: [PATCH] libguile/Makefile.am: install-data-hook -> install-exec-hook
+
+It may install such a file:
+/usr/lib64/libguile-2.0*-gdb.scm
+
+This is because when there is no file in the directory:
+for f in libguile-2.0*; do
+    [snip]
+done
+
+The f would be libguile-2.0* itself, use install-exec-hook will fix the
+problem since it depends on install-libLTLIBRARIES.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libguile/Makefile.am |    4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/libguile/Makefile.am b/libguile/Makefile.am
+index 5decd99..52645b7 100644
+--- a/libguile/Makefile.am
++++ b/libguile/Makefile.am
+@@ -446,10 +446,8 @@ EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = _scm.h		\
+ ## delete guile-snarf.awk from the installation bindir, in case it's
+ ## lingering there due to an earlier guile version not having been
+ ## wiped out.
+-install-exec-hook:
++install-exec-hook: libguile-2.0-gdb.scm
+ 	rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
+-
+-install-data-hook: libguile-2.0-gdb.scm
+ 	@$(MKDIR_P) $(DESTDIR)$(libdir)
+ ## We want to install libguile-2.0-gdb.scm as SOMETHING-gdb.scm.
+ ## SOMETHING is the full name of the final library.  We want to ignore
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch b/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch
new file mode 100644
index 0000000..e50059a
--- /dev/null
+++ b/meta/recipes-devtools/guile/files/libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch
@@ -0,0 +1,43 @@
+From a85c78ea1393985fdb6e6678dea19135c553d341 Mon Sep 17 00:00:00 2001
+From: Mark H Weaver <mhw@netris.org>
+Date: Fri, 19 Sep 2014 21:18:09 -0400
+Subject: [PATCH] VM: ASM_MUL for ARM: Add earlyclobber constraint to the SMULL
+ outputs.
+
+Reported by Rob Browning <rlb@defaultvalue.org>.
+
+* libguile/vm-i-scheme.c (ASM_MUL)[ARM]: Add earlyclobber (&) constraint
+  to the SMULL output registers.
+
+Author: Mark H Weaver <mhw@netris.org>
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ libguile/vm-i-scheme.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/libguile/vm-i-scheme.c b/libguile/vm-i-scheme.c
+index 587aa95..162efab 100644
+--- a/libguile/vm-i-scheme.c
++++ b/libguile/vm-i-scheme.c
+@@ -1,5 +1,4 @@
+-/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013,
+- *   2014 Free Software Foundation, Inc.
++/* Copyright (C) 2001, 2009-2014 Free Software Foundation, Inc.
+  * 
+  * This library is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public License
+@@ -363,7 +362,7 @@ VM_DEFINE_FUNCTION (149, ge, "ge?", 2)
+       {									\
+ 	scm_t_signed_bits rlo, rhi;					\
+ 	asm ("smull %0, %1, %2, %3\n"					\
+-	     : "=r" (rlo), "=r" (rhi)					\
++	     : "=&r" (rlo), "=&r" (rhi)					\
+ 	     : "r" (SCM_UNPACK (x) - scm_tc2_int),			\
+ 	       "r" (SCM_I_INUM (y)));					\
+ 	if (SCM_LIKELY (SCM_SRS (rlo, 31) == rhi))			\
+-- 
+2.3.5
+
diff --git a/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch b/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch
new file mode 100644
index 0000000..d3e312f
--- /dev/null
+++ b/meta/recipes-devtools/guile/files/opensuse/guile-64bit.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [opensuse patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Index: guile-2.0.3/libguile/hash.c
+===================================================================
+--- guile-2.0.3.orig/libguile/hash.c	2011-07-06 15:49:59.000000000 -0700
++++ guile-2.0.3/libguile/hash.c	2012-01-13 21:49:43.332844884 -0800
+@@ -270,7 +270,7 @@ scm_hasher(SCM obj, unsigned long n, siz
+ unsigned long
+ scm_ihashq (SCM obj, unsigned long n)
+ {
+-  return (SCM_UNPACK (obj) >> 1) % n;
++  return ((unsigned long) SCM_UNPACK (obj) >> 1) % n;
+ }
+ 
+ 
+@@ -306,7 +306,7 @@ scm_ihashv (SCM obj, unsigned long n)
+   if (SCM_NUMP(obj))
+     return (unsigned long) scm_hasher(obj, n, 10);
+   else
+-    return SCM_UNPACK (obj) % n;
++    return (unsigned long) SCM_UNPACK (obj) % n;
+ }
+ 
+ 
+Index: guile-2.0.3/libguile/struct.c
+===================================================================
+--- guile-2.0.3.orig/libguile/struct.c	2011-07-06 15:50:00.000000000 -0700
++++ guile-2.0.3/libguile/struct.c	2012-01-13 21:49:43.332844884 -0800
+@@ -942,7 +942,7 @@ scm_struct_ihashq (SCM obj, unsigned lon
+ {
+   /* The length of the hash table should be a relative prime it's not
+      necessary to shift down the address.  */
+-  return SCM_UNPACK (obj) % n;
++  return (unsigned long) SCM_UNPACK (obj) % n;
+ }
+ 
+ SCM_DEFINE (scm_struct_vtable_name, "struct-vtable-name", 1, 0, 0, 
diff --git a/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch b/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch
new file mode 100644
index 0000000..e201486
--- /dev/null
+++ b/meta/recipes-devtools/guile/files/opensuse/guile-turn-off-gc-test.patch
@@ -0,0 +1,49 @@
+Upstream-Status: Inappropriate [opensuse patch]
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10096
+why this test is turned off.
+Index: guile-2.0.3/test-suite/tests/gc.test
+===================================================================
+--- guile-2.0.3.orig/test-suite/tests/gc.test	2011-10-15 09:34:40.000000000 -0700
++++ guile-2.0.3/test-suite/tests/gc.test	2012-01-13 21:52:10.282540355 -0800
+@@ -65,23 +65,23 @@
+       foo)))
+ 
+ 
+-(with-test-prefix "gc"
+-  (pass-if "Unused modules are removed"
+-    (let* ((guard (make-guardian))
+-           (total 1000))
+-
+-      (for-each (lambda (x) (guard (make-module))) (iota total))
++;;(with-test-prefix "gc"
++;;  (pass-if "Unused modules are removed"
++;;    (let* ((guard (make-guardian))
++;;           (total 1000))
++;;
++;;      (for-each (lambda (x) (guard (make-module))) (iota total))
+ 
+       ;; Avoid false references to the modules on the stack.
+-      (stack-cleanup 20)
++;;      (stack-cleanup 20)
+ 
+-      (gc)
+-      (gc) ;; twice: have to kill the weak vectors.
+-      (gc) ;; thrice: because the test doesn't succeed with only
++;;      (gc)
++;;      (gc) ;; twice: have to kill the weak vectors.
++;;      (gc) ;; thrice: because the test doesn't succeed with only
+            ;; one gc round. not sure why.
+ 
+-      (= (let lp ((i 0))
+-           (if (guard)
+-               (lp (1+ i))
+-               i))
+-         total))))
++;;      (= (let lp ((i 0))
++;;           (if (guard)
++;;               (lp (1+ i))
++;;               i))
++;;         total))))
diff --git a/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch b/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch
new file mode 100644
index 0000000..6c34838
--- /dev/null
+++ b/meta/recipes-devtools/guile/files/workaround-ice-ssa-corruption.patch
@@ -0,0 +1,60 @@
+libguile/vm-i-system.c: workaround ice ssa corruption while compiling with option -g -O
+
+While compiling with option -g -O, there was a ssa corruption:
+..
+Unable to coalesce ssa_names 48 and 3476 which are marked as MUST COALESCE.
+sp_48(ab) and  sp_3476(ab)
+guile-2.0.11/libguile/vm-engine.c: In function 'vm_debug_engine':
+guile-2.0.11/libguile/vm.c:673:19: internal compiler error: SSA corruption
+ #define VM_NAME   vm_debug_engine
+                   ^
+guile-2.0.11/libguile/vm-engine.c:39:1: note: in expansion of macro 'VM_NAME'
+ VM_NAME (SCM vm, SCM program, SCM *argv, int nargs)
+ ^
+Please submit a full bug report,
+with preprocessed source if appropriate.
+See <http://gcc.gnu.org/bugs.html> for instructions.
+...
+
+Tweak libguile/vm-i-system.c to add boundary value check to workaround it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libguile/vm-i-system.c | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
+--- a/libguile/vm-i-system.c
++++ b/libguile/vm-i-system.c
+@@ -625,10 +625,22 @@ VM_DEFINE_INSTRUCTION (47, bind_optionals_shuffle, "bind-optionals/shuffle", 6,
+   /* now shuffle up, from walk to ntotal */
+   {
+     scm_t_ptrdiff nshuf = sp - walk + 1, i;
+-    sp = (fp - 1) + ntotal + nshuf;
+-    CHECK_OVERFLOW ();
+-    for (i = 0; i < nshuf; i++)
+-      sp[-i] = walk[nshuf-i-1];
++    /* check the value of nshuf to workaround ice ssa corruption */
++    /* while compiling with -O -g */
++    if (nshuf > 0)
++    {
++      sp = (fp - 1) + ntotal + nshuf;
++      CHECK_OVERFLOW ();
++      for (i = 0; i < nshuf; i++)
++        sp[-i] = walk[nshuf-i-1];
++    }
++    else
++    {
++      sp = (fp - 1) + ntotal + nshuf;
++      CHECK_OVERFLOW ();
++      for (i = 0; i < nshuf; i++)
++        sp[-i] = walk[nshuf-i-1];
++    }
+   }
+   /* and fill optionals & keyword args with SCM_UNDEFINED */
+   while (walk <= (fp - 1) + ntotal)
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/guile/guile_2.0.11.bb b/meta/recipes-devtools/guile/guile_2.0.11.bb
new file mode 100644
index 0000000..4869694
--- /dev/null
+++ b/meta/recipes-devtools/guile/guile_2.0.11.bb
@@ -0,0 +1,111 @@
+SUMMARY = "Guile is the GNU Ubiquitous Intelligent Language for Extensions"
+DESCRIPTION = "Guile is the GNU Ubiquitous Intelligent Language for Extensions,\
+ the official extension language for the GNU operating system.\
+ Guile is a library designed to help programmers create flexible applications.\
+ Using Guile in an application allows the application's functionality to be\
+ extended by users or other programmers with plug-ins, modules, or scripts.\
+ Guile provides what might be described as 'practical software freedom,'\
+ making it possible for users to customize an application to meet their\
+ needs without digging into the application's internals."
+
+HOMEPAGE = "http://www.gnu.org/software/guile/"
+SECTION = "devel"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/guile/guile-${PV}.tar.xz \
+           file://debian/0002-Mark-Unused-modules-are-removed-gc-test-as-unresolve.patch \
+           file://debian/0003-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch \
+           file://opensuse/guile-64bit.patch \
+           file://guile_2.0.6_fix_sed_error.patch \
+           file://arm_endianness.patch \
+           file://arm_aarch64.patch \
+           file://workaround-ice-ssa-corruption.patch \
+           file://libguile-Makefile.am-hook.patch \
+           file://libguile-VM-ASM_MUL-for-ARM-Add-earlyclobber.patch \
+           "
+
+#           file://debian/0001-Change-guile-to-guile-X.Y-for-info-pages.patch
+#           file://opensuse/guile-turn-off-gc-test.patch
+
+SRC_URI[md5sum] = "03f1bce1a4983076d955003472306a13"
+SRC_URI[sha256sum] = "aed0a4a6db4e310cbdfeb3613fa6f86fddc91ef624c1e3f8937a6304c69103e2"
+
+
+inherit autotools gettext pkgconfig texinfo
+BBCLASSEXTEND = "native"
+
+DEPENDS = "libunistring bdwgc gmp libtool libffi ncurses readline"
+# add guile-native only to the target recipe's DEPENDS
+DEPENDS_append_class-target = " guile-native libatomic-ops"
+
+RDEPENDS_${PN}_append_libc-glibc_class-target = "glibc-gconv-iso8859-1"
+
+EXTRA_OECONF += "${@['--without-libltdl-prefix --without-libgmp-prefix --without-libreadline-prefix', ''][bb.data.inherits_class('native',d)]}"
+
+EXTRA_OECONF_append_class-target = " --with-libunistring-prefix=${STAGING_LIBDIR} \
+                                     --with-libgmp-prefix=${STAGING_LIBDIR} \
+                                     --with-libltdl-prefix=${STAGING_LIBDIR}"
+
+do_configure_prepend() {
+	mkdir -p po
+}
+
+export GUILE_FOR_BUILD="${BUILD_SYS}-guile"
+
+do_compile_append() {
+	# just for target recipe
+	if [ "${PN}" = "guile" ]
+	then
+		sed -i -e s:${STAGING_DIR_TARGET}::g \
+	               -e s:/${TARGET_SYS}::g \
+	               -e s:-L/usr/lib::g \
+        	       -e s:-isystem/usr/include::g \
+	               -e s:,/usr/lib:,\$\{libdir\}:g \
+	                  meta/guile-2.0.pc
+	fi
+}
+
+do_install_append_class-native() {
+	install -m 0755  ${D}${bindir}/guile ${D}${bindir}/${HOST_SYS}-guile
+
+	create_wrapper ${D}/${bindir}/guile \
+		GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
+		GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
+	create_wrapper ${D}${bindir}/${HOST_SYS}-guile \
+		GUILE_LOAD_PATH=${STAGING_DATADIR_NATIVE}/guile/2.0 \
+		GUILE_LOAD_COMPILED_PATH=${STAGING_LIBDIR_NATIVE}/guile/2.0/ccache
+}
+
+SYSROOT_PREPROCESS_FUNCS = "guile_cross_config"
+
+guile_cross_config() {
+	# this is only for target recipe
+	if [ "${PN}" = "guile" ]
+	then
+	        # Create guile-config returning target values instead of native values
+	        install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}
+        	echo '#!'`which ${BUILD_SYS}-guile`$' \\\n--no-auto-compile -e main -s\n!#\n(define %guile-build-info '\'\( \
+			> ${B}/guile-config.cross
+	        sed -n -e 's:^[ \t]*{[ \t]*":  (:' \
+			-e 's:",[ \t]*": . ":' \
+			-e 's:" *}, *\\:"):' \
+			-e 's:^.*cachedir.*$::' \
+			-e '/^  (/p' \
+			< ${B}/libguile/libpath.h >> ${B}/guile-config.cross
+	        echo '))' >> ${B}/guile-config.cross
+	        cat ${B}/meta/guile-config >> ${B}/guile-config.cross
+	        install ${B}/guile-config.cross ${STAGING_BINDIR_CROSS}/guile-config
+	fi
+}
+
+# Guile needs the compiled files to be newer than the source, and it won't
+# auto-compile into the prefix even if it can write there, so touch them here as
+# sysroot is managed.
+SSTATEPOSTINSTFUNCS += "guile_sstate_postinst"
+guile_sstate_postinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+                find ${STAGING_DIR_TARGET}/${libdir}/guile/2.0/ccache -type f | xargs touch
+	fi
+}
diff --git a/meta/recipes-devtools/guilt/files/guilt-bash.patch b/meta/recipes-devtools/guilt/files/guilt-bash.patch
new file mode 100644
index 0000000..70a439e
--- /dev/null
+++ b/meta/recipes-devtools/guilt/files/guilt-bash.patch
@@ -0,0 +1,288 @@
+guilt: explicitly call for bash
+
+Running complex guilt stacks of patches/commits can cause interesting
+failures after ~20m of processing, with errors like "Bad substitution".
+
+These have been traced back to having /bin/sh -->  /bin/dash on Ubuntu
+systems.  Putting a shell that actually *works* (such as /bin/bash)
+in as /bin/sh makes the problem go away.  So here we change the guilt
+scripts to explicitly call for bash to ensure we don't have a similar
+issue after deployment.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+---
+ guilt               |    2 +-
+ guilt-add           |    2 +-
+ guilt-applied       |    2 +-
+ guilt-branch        |    2 +-
+ guilt-delete        |    2 +-
+ guilt-diff          |    2 +-
+ guilt-export        |    2 +-
+ guilt-files         |    2 +-
+ guilt-fold          |    2 +-
+ guilt-fork          |    2 +-
+ guilt-graph         |    2 +-
+ guilt-header        |    2 +-
+ guilt-help          |    2 +-
+ guilt-import        |    2 +-
+ guilt-import-commit |    2 +-
+ guilt-init          |    4 ++--
+ guilt-new           |    2 +-
+ guilt-next          |    2 +-
+ guilt-patchbomb     |    2 +-
+ guilt-pop           |    2 +-
+ guilt-prev          |    2 +-
+ guilt-push          |    2 +-
+ guilt-rebase        |    2 +-
+ guilt-refresh       |    2 +-
+ guilt-rm            |    2 +-
+ guilt-series        |    2 +-
+ guilt-status        |    2 +-
+ guilt-top           |    2 +-
+ guilt-unapplied     |    2 +-
+ 29 files changed, 30 insertions(+), 30 deletions(-)
+
+--- a/guilt
++++ b/guilt
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006-2010
+ #
+--- a/guilt-add
++++ b/guilt-add
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-applied
++++ b/guilt-applied
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-branch
++++ b/guilt-branch
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007-2008
+ #
+--- a/guilt-delete
++++ b/guilt-delete
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-diff
++++ b/guilt-diff
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (C) 2007 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
+ #
+--- a/guilt-export
++++ b/guilt-export
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Pierre Habouzit, 2007
+ #
+--- a/guilt-files
++++ b/guilt-files
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (C) 2007 Yasushi SHOJI <yashi@atmark-techno.com>
+ #
+--- a/guilt-fold
++++ b/guilt-fold
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-fork
++++ b/guilt-fork
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-graph
++++ b/guilt-graph
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-header
++++ b/guilt-header
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006-2010
+ #
+--- a/guilt-help
++++ b/guilt-help
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-import
++++ b/guilt-import
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-import-commit
++++ b/guilt-import-commit
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-init
++++ b/guilt-init
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+@@ -31,7 +31,7 @@ touch "$GUILT_DIR/$branch/status"
+ 
+ mkdir -p "$GIT_DIR/hooks/guilt"
+ cat > "$GIT_DIR/hooks/guilt/delete" <<EOF
+-#!/bin/sh
++#!/bin/bash
+ # Usage: <script> <patch being removed>
+ 
+ echo "Removing patch '\$1'..."
+--- a/guilt-new
++++ b/guilt-new
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-next
++++ b/guilt-next
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-patchbomb
++++ b/guilt-patchbomb
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-pop
++++ b/guilt-pop
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-prev
++++ b/guilt-prev
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-push
++++ b/guilt-push
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-rebase
++++ b/guilt-rebase
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2007
+ #
+--- a/guilt-refresh
++++ b/guilt-refresh
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-rm
++++ b/guilt-rm
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-series
++++ b/guilt-series
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-status
++++ b/guilt-status
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-top
++++ b/guilt-top
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
+--- a/guilt-unapplied
++++ b/guilt-unapplied
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!/bin/bash
+ #
+ # Copyright (c) Josef "Jeff" Sipek, 2006, 2007
+ #
diff --git a/meta/recipes-devtools/guilt/guilt-native_git.bb b/meta/recipes-devtools/guilt/guilt-native_git.bb
new file mode 100644
index 0000000..b63c68c
--- /dev/null
+++ b/meta/recipes-devtools/guilt/guilt-native_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "quilt-like tool for Git"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b6f3400dc1a01cebafe8a52b3f344135"
+
+inherit native
+
+SRC_URI = "git://repo.or.cz/guilt.git \
+           file://guilt-bash.patch \
+           "
+PV = "0.35+git${SRCPV}"
+SRCREV = "c2a5bae511c6d5354aa4e1cb59069c31df2b8eeb"
+
+S = "${WORKDIR}/git"
+
+# we don't compile, we just install
+do_compile() {
+	:
+}
+
+do_install() {
+	oe_runmake PREFIX=${D}/${prefix} install
+}
diff --git a/meta/recipes-devtools/help2man/help2man-native_1.47.1.bb b/meta/recipes-devtools/help2man/help2man-native_1.47.1.bb
new file mode 100644
index 0000000..bc6d50e
--- /dev/null
+++ b/meta/recipes-devtools/help2man/help2man-native_1.47.1.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Program for creating simple man pages"
+SECTION = "devel"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "autoconf-native automake-native"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "cf7aaaeea40bff1176df825430694173"
+SRC_URI[sha256sum] = "c59b26f60cb06e45b00e729dea721e7a17220e2c17d800eb428271a750382b06"
+
+inherit autotools native
+
+EXTRA_OECONF = "--disable-nls"
+
+# We don't want to reconfigure things as it would require 'perlnative' to be
+# used.
+do_configure() {
+	oe_runconf
+}
+
+do_install_append () {
+	# Make sure we use /usr/bin/env perl
+	sed -i -e "1s:#!.*:#! /usr/bin/env perl:" ${D}${bindir}/help2man
+}
diff --git a/meta/recipes-devtools/i2c-tools/files/Module.mk b/meta/recipes-devtools/i2c-tools/files/Module.mk
new file mode 100644
index 0000000..fcaf72f
--- /dev/null
+++ b/meta/recipes-devtools/i2c-tools/files/Module.mk
@@ -0,0 +1,72 @@
+# EEPROMER
+#
+# Licensed under the GNU General Public License.
+
+EEPROMER_DIR	:= eepromer
+
+EEPROMER_CFLAGS	:= -Wstrict-prototypes -Wshadow -Wpointer-arith -Wcast-qual \
+		   -Wcast-align -Wwrite-strings -Wnested-externs -Winline \
+		   -W -Wundef -Wmissing-prototypes -Iinclude
+
+EEPROMER_TARGETS	:= eepromer eeprom eeprog
+
+#
+# Programs
+#
+
+$(EEPROMER_DIR)/eepromer: $(EEPROMER_DIR)/eepromer.o
+	$(CC) $(LDFLAGS) -o $@ $^
+
+$(EEPROMER_DIR)/eeprom: $(EEPROMER_DIR)/eeprom.o
+	$(CC) $(LDFLAGS) -o $@ $^
+
+$(EEPROMER_DIR)/eeprog: $(EEPROMER_DIR)/eeprog.o $(EEPROMER_DIR)/24cXX.o 
+	$(CC) $(LDFLAGS) -o $@ $^
+
+#
+# Objects
+#
+
+$(EEPROMER_DIR)/eepromer.o: $(EEPROMER_DIR)/eepromer.c
+	$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/eeprom.o: $(EEPROMER_DIR)/eeprom.c
+	$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/eeprog.o: $(EEPROMER_DIR)/eeprog.c
+	$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+$(EEPROMER_DIR)/24cXX.o: $(EEPROMER_DIR)/24cXX.c
+	$(CC) $(CFLAGS) $(EEPROMER_CFLAGS) -c $< -o $@
+
+#
+# Commands
+#
+
+all-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+
+strip-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+	strip $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+
+clean-eepromer:
+	$(RM) $(addprefix $(EEPROMER_DIR)/,*.o $(EEPROMER_TARGETS))
+
+install-eepromer: $(addprefix $(EEPROMER_DIR)/,$(EEPROMER_TARGETS))
+	$(INSTALL_DIR) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
+	for program in $(EEPROMER_TARGETS) ; do \
+	$(INSTALL_PROGRAM) $(EEPROMER_DIR)/$$program $(DESTDIR)$(sbindir) ; done
+
+uninstall-eepromer:
+	for program in $(EEPROMER_TARGETS) ; do \
+	$(RM) $(DESTDIR)$(sbindir)/$$program ; \
+	$(RM) $(DESTDIR)$(man8dir)/$$program.8 ; done
+
+all: all-eepromer
+
+strip: strip-eepromer
+
+clean: clean-eepromer
+
+install: install-eepromer
+
+uninstall: uninstall-eepromer
diff --git a/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb b/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb
new file mode 100644
index 0000000..92f4d69
--- /dev/null
+++ b/meta/recipes-devtools/i2c-tools/i2c-tools_3.1.2.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Set of i2c tools for linux"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+SRC_URI = "http://dl.lm-sensors.org/i2c-tools/releases/${BP}.tar.bz2 \
+           file://Module.mk \
+"
+SRC_URI[md5sum] = "7104a1043d11a5e2c7b131614eb1b962"
+SRC_URI[sha256sum] = "db5e69f2e2a6e3aa2ecdfe6a5f490b149c504468770f58921c8c5b8a7860a441"
+
+inherit autotools-brokensep
+
+do_compile_prepend() {
+    cp ${WORKDIR}/Module.mk ${S}/eepromer/
+    sed -i 's#/usr/local#/usr#' ${S}/Makefile
+    echo "include eepromer/Module.mk" >> ${S}/Makefile
+}
+
+do_install_append() {
+    install -d ${D}${includedir}/linux
+    install -m 0644 include/linux/i2c-dev.h ${D}${includedir}/linux/i2c-dev-user.h
+    rm -f ${D}${includedir}/linux/i2c-dev.h
+}
+
+PACKAGES =+ "${PN}-misc"
+FILES_${PN}-misc = "${sbindir}/i2c-stub-from-dump \
+                        ${bindir}/ddcmon \
+                        ${bindir}/decode-edid \
+                        ${bindir}/decode-dimms \
+                        ${bindir}/decode-vaio \
+                       "
+RDEPENDS_${PN} += "${PN}-misc"
+RDEPENDS_${PN}-misc += "perl"
diff --git a/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
new file mode 100644
index 0000000..f8f4aef
--- /dev/null
+++ b/meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb
@@ -0,0 +1,36 @@
+SUMMARY = "icecc environment setup script"
+DESCRIPTION = "This is a version of the icecc-create-env script that has \
+been modified in order to make it work with OE."
+SECTION = "base"
+# source file has just a "GPL" word, but upstream is GPLv2+.
+# most probably just GPL would be a mistake
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://icecc-create-env;beginline=2;endline=5;md5=ae1df3d6a058bfda40b66094c5f6065f"
+
+PR = "r2"
+
+DEPENDS = ""
+INHIBIT_DEFAULT_DEPS = "1"
+
+inherit native
+
+# This is needed, because otherwise there is dependency loop from quilt-native
+# Dependency loop #1 found:
+#  Task 10907 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_install) (dependent Tasks ['quilt-native, do_compile'])
+#  Task 10908 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_populate_sysroot) (dependent Tasks ['quilt-native, do_install'])
+#  Task 10997 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_patch) (dependent Tasks ['icecc-create-env-native, do_unpack', 'quilt-native, do_populate_sysroot'])
+#  Task 11001 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_configure) (dependent Tasks ['icecc-create-env-native, do_patch'])
+#  Task 11002 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_compile) (dependent Tasks ['icecc-create-env-native, do_configure'])
+#  Task 10998 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_install) (dependent Tasks ['icecc-create-env-native, do_compile'])
+#  Task 10999 (meta/recipes-devtools/icecc-create-env/icecc-create-env-native_0.1.bb, do_populate_sysroot) (dependent Tasks ['icecc-create-env-native, do_install'])
+#  Task 10910 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_configure) (dependent Tasks ['quilt-native, do_patch', 'icecc-create-env-native, do_populate_sysroot'])
+#  Task 10911 (meta/recipes-devtools/quilt/quilt-native_0.60.bb, do_compile) (dependent Tasks ['quilt-native, do_configure'])
+PATCHTOOL = "patch"
+SRC_URI = "file://icecc-create-env"
+
+S = "${WORKDIR}"
+
+do_install() {
+    install -d ${D}/${bindir}
+    install -m 0755 ${WORKDIR}/icecc-create-env ${D}/${bindir}
+}
diff --git a/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env b/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env
new file mode 100755
index 0000000..7e4dbc4
--- /dev/null
+++ b/meta/recipes-devtools/icecc-create-env/icecc-create-env/icecc-create-env
@@ -0,0 +1,192 @@
+#! /usr/bin/env bash
+# icecc -- A simple distributed compiler system
+#
+# Copyright (C) 2004 by the Icecream Authors
+# GPL
+
+target_files=
+
+is_contained ()
+{
+  case " $target_files " in
+    *" $1 "* ) return 0 ;;
+    *"=$1 "* ) return 0;;
+    * ) return 1 ;;
+  esac
+}
+
+add_file ()
+{
+  local name="$1"
+  local path="$1";
+  if test -n "$2"; then
+    name="$2"
+  fi
+  test -z "$name" && return
+  # ls -H isn't really the same as readlink, but
+  # readlink is not portable enough.
+  path=`ls -H $path`
+  toadd="$name=$path"
+  is_contained "$toadd" && return
+  if test -z "$silent"; then
+  echo "adding file $toadd"
+  fi
+  target_files="$target_files $toadd"
+  if test -x "$path"; then
+    # Only call ldd when it makes sense
+    if file -L "$path" | grep 'ELF' > /dev/null 2>&1; then
+	if ! file -L "$path" | grep 'static' > /dev/null 2>&1; then
+	   # ldd now outputs ld as /lib/ld-linux.so.xx on current nptl based glibc
+		# this regexp parse the outputs like:
+		# ldd /usr/bin/gcc
+		#         linux-gate.so.1 =>  (0xffffe000)
+		#         libc.so.6 => /lib/tls/libc.so.6 (0xb7e81000)
+		#         /lib/ld-linux.so.2 (0xb7fe8000)
+		# covering both situations ( with => and without )
+          for lib in `ldd "$path" | sed -n 's,^[^/]*\(/[^ ]*\).*,\1,p'`; do
+	    test -f "$lib" || continue
+	    # Check wether the same library also exists in the parent directory,
+	    # and prefer that on the assumption that it is a more generic one.
+	    local baselib=`echo "$lib" | sed 's,\(/[^/]*\)/.*\(/[^/]*\)$,\1\2,'`
+	    test -f "$baselib" && lib=$baselib
+	  add_file "$lib"
+        done
+      fi
+    fi
+  fi
+}
+
+# backward compat
+if test "$1" = "--respect-path"; then
+  shift
+fi
+
+#add a --silent switch to avoid "broken pipe" errors when calling this scipt from within OE
+if test "$1" = "--silent"; then
+ silent=1
+ shift
+fi
+
+
+added_gcc=$1
+shift
+added_gxx=$1
+shift
+added_as=$1
+shift
+archive_name=$1
+
+if test -z "$added_gcc" || test -z "$added_gxx" ; then
+	echo "usage: $0 <gcc_path> <g++_path>"
+	exit 1
+fi
+
+if ! test -x "$added_gcc" ; then
+  echo "'$added_gcc' is no executable."
+  exit 1
+fi
+
+if ! test -x "$added_gxx" ; then
+  echo "'$added_gcc' is no executable."
+  exit 1
+fi
+
+
+
+add_file $added_gcc /usr/bin/gcc
+add_file $added_gxx /usr/bin/g++
+
+if test -z "$added_as" ; then
+ add_file /usr/bin/as /usr/bin/as
+else
+ if ! test -x "$added_as" ; then
+  echo "'$added_as' is no executable."
+  exit 1
+ fi
+
+ add_file $added_as  /usr/bin/as
+fi
+
+add_file `$added_gcc -print-prog-name=cc1` /usr/bin/cc1
+add_file `$added_gxx -print-prog-name=cc1plus` /usr/bin/cc1plus
+specfile=`$added_gcc -print-file-name=specs`
+if test -n "$specfile" && test -e "$specfile"; then
+  add_file "$specfile"
+fi
+
+ltofile=`$added_gcc -print-prog-name=lto1`
+pluginfile="${ltofile%lto1}liblto_plugin.so"
+if test -r "$pluginfile"
+then
+  add_file $pluginfile  ${pluginfile#*usr}
+  add_file $pluginfile  /usr${pluginfile#*usr}
+fi
+
+tempdir=`mktemp -d /tmp/iceccenvXXXXXX`
+new_target_files=
+for i in $target_files; do
+ case $i in
+   *=/*)
+    target=`echo $i | cut -d= -f1`
+    path=`echo $i | cut -d= -f2`
+    ;;
+   *)
+    path=$i
+    target=$i
+    ;;
+  esac
+  mkdir -p $tempdir/`dirname $target`
+  cp -p $path $tempdir/$target
+  if test -f $tempdir/$target -a -x $tempdir/$target; then
+    strip -s $tempdir/$target 2>/dev/null
+  fi
+  target=`echo $target | cut -b2-`
+  new_target_files="$new_target_files $target"
+done
+
+#sort the files
+target_files=`for i in $new_target_files; do echo $i; done | sort`
+
+#test if an archive name was supplied
+#if not use the md5 of all files as the archive name
+if test -z "$archive_name"; then
+  md5sum=NONE
+  for file in /usr/bin/md5sum /bin/md5 /usr/bin/md5; do
+    if test -x $file; then
+      md5sum=$file
+      break
+    fi
+  done
+
+  #calculate md5 and use it as the archive name
+  archive_name=`for i in $target_files; do test -f $tempdir/$i && $md5sum $tempdir/$i; done | sed -e 's/ .*$//' | $md5sum | sed -e 's/ .*$//'`.tar.gz || {
+    if test -z "$silent"; then
+     echo "Couldn't compute MD5 sum."
+    fi
+    exit 2
+  }
+  mydir=`pwd`
+else
+  mydir="`dirname "$archive_name"`"
+
+  #check if we have a full path or only a filename
+  if test "$mydir" = "." ; then
+    mydir=`pwd`
+  else
+    mydir=""
+  fi
+fi
+
+if test -z "$silent"; then
+echo "creating $archive_name"
+fi
+
+cd $tempdir
+tar -czhf "$mydir/$archive_name" $target_files || {
+ if test -z "$silent"; then
+  echo "Couldn't create archive"
+ fi
+  exit 3
+}
+cd ..
+rm -rf $tempdir
diff --git a/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb b/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb
new file mode 100644
index 0000000..6b356b0
--- /dev/null
+++ b/meta/recipes-devtools/icon-naming-utils/icon-naming-utils_0.8.90.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Enables backwards compatibility with current desktop icon themes"
+DESCRIPTION = "A Perl script used for maintaining backwards \
+compatibility with current desktop icon themes, while migrating to the \
+names specified in the Icon Naming Specification. The Icon Naming \
+Utilities map the icon names used by the GNOME and KDE desktops to the \
+icon names proposed in the Icon Naming Specification, and generate the \
+icon files appropriate to the desktop environment you use. The Icon \
+Naming Specification provides a standard list of common icon contexts \
+and names that can be used to make icon themes work in a desktop \
+environment or application that implements the naming specification. "
+LICENSE = "GPLv2"
+DEPENDS = "libxml-simple-perl-native"
+PR = "r5"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://tango.freedesktop.org/releases/icon-naming-utils-${PV}.tar.gz"
+SRC_URI[md5sum] = "2c5c7a418e5eb3268f65e21993277fba"
+SRC_URI[sha256sum] = "044ab2199ed8c6a55ce36fd4fcd8b8021a5e21f5bab028c0a7cdcf52a5902e1c"
+
+inherit autotools allarch perlnative
+
+do_configure_append() {
+	# Make sure we use our nativeperl wrapper.
+	sed -i -e "1s:#!.*:#!/usr/bin/env nativeperl:" ${S}/icon-name-mapping.pl.in
+}
+
+FILES_${PN} += "${datadir}/dtds"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/installer/adt-installer/adt_installer b/meta/recipes-devtools/installer/adt-installer/adt_installer
new file mode 100755
index 0000000..b8cfb2e
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/adt_installer
@@ -0,0 +1,420 @@
+#!/bin/bash
+# Yocto ADT Installer
+#
+# Copyright 2010-2011 by Intel Corp.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy 
+# of this software and associated documentation files (the "Software"), to deal 
+# in the Software without restriction, including without limitation the rights 
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+# copies of the Software, and to permit persons to whom the Software is 
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in 
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
+# THE SOFTWARE.
+
+
+usage ()
+{
+
+  INST_ARCH=`uname -m`
+  INST_OS=`uname -o| tr '[A-Z]' '[a-z]'`
+  INST_KR=`uname -r| tr '[A-Z]' '[a-z]'`
+
+  echo_info "#########################################################################"
+  echo_info "# Welcome to Yocto Application Developement Tools (ADT) Installer"
+  echo_info "# "
+  echo_info "# Host Machine:\t\t\t\t"$INST_ARCH
+  echo_info "# OS info:\t\t\t\t$INST_KR"  
+  echo_info "# Yocto ADT version to be installed:\t$YOCTOADT_VERSION"
+  echo_info "# supported target architectures:\t$YOCTOADT_SUPPORTED_TARGETS"
+  echo_info "# supported target root_fs images:\t$YOCTOADT_SUPPORTED_ROOTFS"
+  echo_info "#########################################################################\n"
+
+  echo_info "Systemwide installation. Installation will occur under $INSTALL_FOLDER\n"
+  echo_info "############################################################################"
+  echo_info "# Your system installation configurations from adt_installer.conf"
+  echo_info "############################################################################"
+
+  echo_info "# Cross toolchains:\t\t$YOCTOADT_TARGETS"
+  echo_info "# Install Qemu:\t\t\t$YOCTOADT_QEMU"
+  echo_info "# Install NFS utilities:\t$YOCTOADT_NFS_UTIL"
+  #echo_info "# Install bitbake + UI:\t\t$YOCTOADT_BITBAKE"
+  #echo_info "# Install metadata:\t$YOCTOADT_METADATA"
+  #echo_info "############################################################################\n"
+
+    echo_info "\n##############################################################################"
+    echo_info "# Your rootfs image(s) and target sysroot selections from adt_installer.conf"
+    echo_info "##############################################################################"
+prompt=1
+for arch_type in $YOCTOADT_TARGETS; do
+  download_images $arch_type $prompt
+done
+    echo_info "############################################################################\n"
+  select_install_type
+}
+
+validate_config()
+{
+
+  for selected_arch_type in $YOCTOADT_TARGETS; do
+    found=0
+    select_machine_var="\$YOCTOADT_TARGET_MACHINE_$selected_arch_type"
+    select_machine=`eval echo $select_machine_var`
+    show_error_banner=0
+
+    for supported_arch_type in $YOCTOADT_SUPPORTED_TARGETS; do
+      if [ "$selected_arch_type" == "$supported_arch_type" ]; then
+        found=1
+        break
+      fi
+    done
+    if [ $found == 0 ]; then
+       echo_info "[ADT_INST] Error: YOCTADT_TARGETS in adt_installer.conf contains invalid entries: $YOCTOADT_TARGETS. Valid values are: $YOCTOADT_SUPPORTED_TARGETS"
+       show_error_banner=1
+    elif [ -z "$select_machine" ]; then
+       echo_info "[ADT_INST] Error: No MACHINE was defined for $selected_arch_type architecture! This is needed to install the toolchain and the correct environment settings."
+       echo_info "[ADT_INST] To do that, in adt-installer.conf, set the following variable: YOCTOADT_TARGET_MACHINE_$selected_arch_type"
+       show_error_banner=1
+    fi
+
+    if [ $show_error_banner == 1 ]; then
+       echo -e "\n#############################################################################"
+       echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
+       echo -e "#############################################################################\n"
+       exit -1
+    fi
+  done
+
+  for arch_type in $YOCTOADT_SUPPORTED_TARGETS; do
+    #select_target_var="\$YOCTOADT_TARGET_$arch_type"
+    #select_target=`eval echo $select_target_var`
+
+    #if [ "$select_target" != "Y" ] || [ "$selected_target" != "y" ]; then
+    #  continue;
+    #fi
+
+    target_sysroot_image_var="\$YOCTOADT_TARGET_SYSROOT_IMAGE_$arch_type"
+    target_sysroot_image=`eval echo $target_sysroot_image_var`
+
+
+    select_rootfs_var="\$YOCTOADT_ROOTFS_$arch_type"
+    select_rootfs=`eval echo $select_rootfs_var`
+
+    if [ "$select_rootfs" == "" ] && [ "$target_sysroot_image" == "" ]; then
+       continue;
+    fi
+
+    for image_type in $select_rootfs; do
+#validate rootfs type defined in YOCTOADT_ROOTFS_{ARCH} is valid and in YOCTOADT_SUPPORTED_ROOTFS
+      found=0
+      for supported_rootfs_type in $YOCTOADT_SUPPORTED_ROOTFS; do
+        if [ "$image_type" == "$supported_rootfs_type" ]; then
+          found=1
+          break
+        fi
+      done
+      if [ $found == 0 ]; then
+#the rootfs type listed for downloading is not valid
+        echo_info "[ADT_INST] Error: Selected YOCTOADT_ROOTFS_$arch_type value: $image_type, is not valid! Valid values are: $YOCTOADT_SUPPORTED_ROOTFS "
+       echo -e "\n#############################################################################"
+       echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
+       echo -e "#############################################################################\n"
+        exit -1
+      fi
+    done
+
+    found=0
+    for image_type in $select_rootfs; do
+#validate that rootfs to be extracted must be in the item: YOCTOADT_ROOTFS_${ARCH}
+      if [ "$target_sysroot_image" == "$image_type" ]; then
+        found=1
+        break
+      fi
+    done
+# the rootfs image to be extracted is not selected
+    if [ $found == 0 ]; then
+      echo_info "[ADT_INST] Error: YOCTOADT_TARGET_SYSROOT_IMAGE_$arch_type selection: $target_sysroot_image is not included in YOCTOADT_ROOTFS_$arch_type selections: $select_rootfs"
+      echo -e "\n#############################################################################"
+      echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
+      echo -e "#############################################################################\n"
+      exit -1
+    fi
+  done
+}
+
+
+#detect opkg installed or not, for installing sdk, we will use
+#this installed local opkg
+install_opkg()
+{
+if [ ! -x "$LOCAL_OPKG_LOC/bin/opkg" ]; then
+  echo_info "OPKG is not setup, setting up opkg in local, which is required for installing yocto ADT...\n"
+
+  if [ -d $LOCAL_OPKG_LOC ]; then
+    echo_info "Deleting old OPKG folder, which doesn't contain executables... "
+    rm -rf $LOCAL_OPKG_LOC
+  fi
+
+  parent_folder=`pwd`
+  cd $LOCAL_OPKG_FOLDER
+  check_result
+
+  opkg_source_dir=`ls -d opkg-*`
+
+  if [ $opkg_source_dir == "" ]; then
+    echo_info "[ADT_INST] Error: OPKG source directory is not found!"
+    echo -e "\n#############################################################################"
+    echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
+    echo -e "#############################################################################\n"
+    exit -1
+  fi
+
+  cd $opkg_source_dir
+  check_result
+
+  echo_info "Configure opkg ...\n"
+  autoreconf -i
+  ./configure --prefix=$parent_folder/$LOCAL_OPKG_LOC --enable-shared=no --disable-curl --disable-ssl-curl --disable-gpg >> $parent_folder/$YOCTOADT_INSTALL_LOG_FILE
+  check_result
+
+  echo_info "Make opkg ...\n"
+  make &>> $parent_folder/$YOCTOADT_INSTALL_LOG_FILE
+  check_result
+
+  echo_info "Make Install opkg ...\n"
+  make install &>> $parent_folder/$YOCTOADT_INSTALL_LOG_FILE
+  #if meet error when installing opkg, cancel the installation
+  check_result
+
+  cd $parent_folder
+  echo_info "Successfully installed OPKG.\n"
+fi
+}
+
+confirm_download()
+{
+#avoid repeated reminding
+if [ "$override_oldfile" == 1 ]; then
+  return $pre_result
+else
+  override_oldfile=1
+fi
+
+while true; do
+  #echo_info "[ADT_INST] Files [$1] already exists. If you continue downloading, old files will be overrided."
+  #echo_info "[ADT_INST] Further prompts will not be given if there're more existing files to be downloaded."
+  #echo_info "[ADT_INST] Do you want to continue downloading? Please enter Y/N:"
+  echo_info "\nFile [$1] already exists, which means you've downloaded the qemu kernel and rootfs file(s) before.  If you choose continue downloading, old files will be overridden."
+  echo_info "[ADT_INST] Do you want to continue downloading? Please enter Y/N:"
+  read YOCTOADT_INSTALL
+  YOCTOADT_INSTALL=`tr '[a-z]' '[A-Z]'<<<"$YOCTOADT_INSTALL"`
+  if [ "$YOCTOADT_INSTALL" == "Y" ]; then
+    pre_result=0
+    return 0
+  elif [ "$YOCTOADT_INSTALL" == "N" ]; then
+    pre_result=1
+    return 1
+  fi
+done
+}
+
+download_file()
+{
+local filename=`echo ${1##*/}`
+if [ -f "$LOCAL_DOWNLOAD/$filename" ]; then
+  confirm_download $filename
+  result="$?"
+  if [ ! "$result" == "0" ]; then
+    return
+  else
+    echo "Removing old file [$1]"
+    rm -rf "$LOCAL_DOWNLOAD/$filename" 
+  fi
+fi
+echo_info "Downloading file: $filename..."
+wget "$YOCTOADT_REPO/rootfs/$1" -P $LOCAL_DOWNLOAD --progress=bar:force 2>&1 | tee -a "$YOCTOADT_INSTALL_LOG_FILE" 
+}
+
+
+
+#Need three input params:
+# $1 arch_type(arm powerpc x86 mips)
+# $2 machine(qemuarm beagleboard)
+# $3 rootfs_image_type (a list of sdk sato minimal lsb)
+get_image()
+{
+  local machine=$2
+ 
+  if [ "$1" == "x86" ] || [ "$1" == "x86_64" ]; then
+    kernel="bzImage-$machine.bin"
+  elif [ "$1" == "ppc" ] || [ "$1" == "mips" ]; then
+    kernel="vmlinux-$machine.bin"
+  else
+    kernel="zImage-$machine.bin"
+  fi
+
+  #echo_info "[ADT_INST] Downloading qemu kernel binary: $qemu_kernel"
+  download_file $machine/$kernel
+  check_result
+  
+  for image_type in $select_rootfs; do
+    #echo_info "[ADT_INST] Downloading rootfs file: core-image-$image_type-$machine.tar.bz2"
+    filename="core-image-$image_type-$machine.tar.bz2"
+    download_file $machine/$filename
+    check_result
+  done
+}
+
+download_images()
+{
+  select_rootfs_var="\$YOCTOADT_ROOTFS_$1"
+  select_sysroot_image_var="\$YOCTOADT_TARGET_SYSROOT_IMAGE_$1"
+  select_sysroot_var="\$YOCTOADT_TARGET_SYSROOT_LOC_$1"
+  select_machine_var="\$YOCTOADT_TARGET_MACHINE_$1"
+  select_rootfs=`eval echo $select_rootfs_var`
+  select_sysroot_image=`eval echo $select_sysroot_image_var`
+  select_sysroot=`eval echo $select_sysroot_var`
+  select_machine=`eval echo $select_machine_var`
+
+  if [ -n "$select_sysroot" ]; then
+    select_sysroot=`readlink -m $select_sysroot`
+  fi
+
+  if [ "$select_rootfs" != "" ]; then
+    if [ $2 ]; then
+    #echo_info "\n############################################################################"
+    #echo_info "# To be downloaded rootfs image details defined in adt_installer.conf"
+    #echo_info "############################################################################"
+    echo_info "# Target architecture:\t\t$1"
+    echo_info "# Target machine:\t\t$select_machine"
+    echo_info "# Root_fs images:\t\t$select_rootfs"
+    echo_info "# Target sysroot image:\t\t$select_sysroot_image"
+    echo_info "# Target sysroot loc:\t\t$select_sysroot"
+    echo_info "\n"
+    #echo_info "############################################################################\n"
+    else
+    get_image $1 $select_machine $select_rootfs
+    fi
+  fi
+}
+
+
+
+
+#Main body of installer
+
+clear
+
+run_path=`dirname $0`
+cd $run_path
+
+if [ ! -f "scripts/util" ]; then
+  echo -e "[ADT_INST] Error: Script file: util, can't be found under: $run_path!"
+  echo -e "\n#############################################################################"
+  echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
+  echo -e "#############################################################################\n"
+  exit -1
+fi
+
+if [ ! -f "scripts/adt_installer_internal" ]; then
+  echo -e "[ADT_INST] Error: Script file: adt_installer_internal, can't be found under: $run_path!"
+  echo -e "\n#############################################################################"
+  echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
+  echo -e "#############################################################################\n"
+  exit -1
+fi
+
+config_file="adt_installer.conf"
+if [ ! -f "$config_file" ]; then
+  echo_info "[ADT_INST] Error: Installation configuration file: adt_installer.conf is not found!\n"
+  echo_info "\n##################################################################################"
+  echo_info "# Meet error(s) when installing Yocto ADT. Please check log file for details. "
+  echo_info "##################################################################################\n"
+  exit -1
+fi
+
+. scripts/data_define
+. scripts/util
+
+
+if [ -f "$YOCTOADT_INSTALL_LOG_FILE" ]; then
+  rm $YOCTOADT_INSTALL_LOG_FILE
+fi
+
+echo -n "Please enter the install location (default: $DEFAULT_INSTALL_FOLDER): "
+read INSTALL_FOLDER
+
+if [ "$INSTALL_FOLDER" = "" ]; then
+    INSTALL_FOLDER=$DEFAULT_INSTALL_FOLDER
+fi
+
+eval INSTALL_FOLDER=$(printf "%q" "$INSTALL_FOLDER")
+if [ -d "$INSTALL_FOLDER" ]; then
+	export INSTALL_FOLDER=$(cd "$INSTALL_FOLDER"; pwd)
+else
+	export INSTALL_FOLDER=$(readlink -m "$INSTALL_FOLDER")
+fi
+
+if [ -n "$(echo $INSTALL_FOLDER|grep ' ')" ]; then
+       echo "The target directory path ($INSTALL_FOLDER) contains spaces. Abort!"
+       exit 1
+fi
+
+clear
+
+usage
+
+user_inst_type="$?"
+
+validate_config
+check_result
+
+#check adt_repo exist
+wget --spider $YOCTOADT_REPO 2>&1 | tee -a "$YOCTOADT_INSTALL_LOG_FILE"
+if grep -q "404 Not Found" $YOCTOADT_INSTALL_LOG_FILE; then
+  echo -e "[ADT_INST] Error: YOCTOADT_REPO does not exist: $YOCTOADT_REPO"
+  echo -e "\n#############################################################################"
+  echo -e "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
+  echo -e "#############################################################################\n"
+  exit -1
+fi
+
+#firstly we need to install opkg host
+install_opkg
+
+#Create folders for holding rootfs/qemu images
+if [ ! -d "$LOCAL_DOWNLOAD" ]; then
+  echo_info "Creating new images downloading folder: $LOCAL_DOWNLOAD ..."
+  mkdir -p $LOCAL_DOWNLOAD
+fi
+
+#downloading required qemu images/rootfs
+if [ "$user_inst_type" == "0" ]; then
+  override_oldfile=1
+else
+  override_oldfile=0
+fi
+
+for arch_type in $YOCTOADT_TARGETS; do
+  download_images $arch_type
+done
+
+scripts/adt_installer_internal $user_inst_type
+
+result="$?"
+#echo_info "\n############################################################"
+if [ "$result" == "0" ]; then
+  echo_info "\n############################################################"
+  echo_info "# Yocto ADT has been successfully installed."
+  echo_info "############################################################\n"
+fi
+
diff --git a/meta/recipes-devtools/installer/adt-installer/adt_installer.conf b/meta/recipes-devtools/installer/adt-installer/adt_installer.conf
new file mode 100644
index 0000000..867fbd1
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/adt_installer.conf
@@ -0,0 +1,75 @@
+# Yocto ADT Installer Configuration File
+#
+# Copyright 2010-2011 by Intel Corp.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy 
+# of this software and associated documentation files (the "Software"), to deal 
+# in the Software without restriction, including without limitation the rights 
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+# copies of the Software, and to permit persons to whom the Software is 
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in 
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
+# THE SOFTWARE.
+
+
+# Your yocto distro repository, this should include IPKG based packages and root filesystem files where the installation is based on
+
+YOCTOADT_REPO="ADTREPO"
+
+# The following are for system wide setup
+# Target architectures that you want to setup host cross dev environment for
+# valid values are: arm, x86, x86_64, ppc, mips with space separation between entries
+YOCTOADT_TARGETS="arm x86"
+# Whether install qemu or not, valid entries are: Y/N
+YOCTOADT_QEMU="Y"
+# Whether install user-mode nfs or not, valid entries are: Y/N.  If you want to use Yocto Eclipse plug-in as your dev IDE, you need to select both qemu and NFS
+YOCTOADT_NFS_UTIL="Y"
+
+# These 2 values will be supported in the furture installer
+#YOCTOADT_BITBAKE="Y"
+#YOCTOADT_METADATA="Y"
+
+#The followings are for setting up specific target architecture
+#YOCTOADT_ROOTFS_$arch is for specifying what root filesystem image files you want to download from the repository. The valid values to replace $arch are: arm, x86, x86_64, powerpc, mips.  The valid image files are: minimal, minimal-dev, sato, sato-dev, sato-sdk,lsb, lsb-dev, lsb-sdk.  If you want to download multiple images, the entries are space separated
+YOCTOADT_ROOTFS_arm="minimal sato-sdk"
+#Specify which root filesystem file to use to extract as target sysroot.  Please ensure the entry is in the list of downloaded root filesystem files that specified above in YOCTOADT_ROOTFS_$arch
+YOCTOADT_TARGET_SYSROOT_IMAGE_arm="sato-sdk"
+#The machine for which you want to download the image. Each machine might have
+#different compilation options in order to select certain hardware models or
+#configurations
+YOCTOADT_TARGET_MACHINE_arm="qemuarm"
+#The location where the target sysroot will be setup
+YOCTOADT_TARGET_SYSROOT_LOC_arm="$HOME/test-yocto/$YOCTOADT_TARGET_MACHINE_arm"
+
+
+#Here's a template for setting up target arch of x86 
+YOCTOADT_ROOTFS_x86="sato-sdk"
+YOCTOADT_TARGET_SYSROOT_IMAGE_x86="sato-sdk"
+YOCTOADT_TARGET_MACHINE_x86="qemux86"
+YOCTOADT_TARGET_SYSROOT_LOC_x86="$HOME/test-yocto/$YOCTOADT_TARGET_MACHINE_x86"
+
+#Here's some template of other arches, which you need to change the value in ""
+YOCTOADT_ROOTFS_x86_64="sato-sdk"
+YOCTOADT_TARGET_SYSROOT_IMAGE_x86_64="sato-sdk"
+YOCTOADT_TARGET_MACHINE_x86_64="qemux86-64"
+YOCTOADT_TARGET_SYSROOT_LOC_x86_64="$HOME/test-yocto/$YOCTOADT_TARGET_MACHINE_x86_64"
+
+YOCTOADT_ROOTFS_ppc="sato-sdk"
+YOCTOADT_TARGET_SYSROOT_IMAGE_ppc="sato-sdk"
+YOCTOADT_TARGET_MACHINE_ppc="qemuppc"
+YOCTOADT_TARGET_SYSROOT_LOC_ppc="$HOME/test-yocto/$YOCTOADT_TARGET_MACHINE_ppc"
+
+YOCTOADT_ROOTFS_mips="sato-sdk"
+YOCTOADT_TARGET_SYSROOT_IMAGE_mips="sato-sdk"
+YOCTOADT_TARGET_MACHINE_mips="qemumips"
+YOCTOADT_TARGET_SYSROOT_LOC_mips="$HOME/test-yocto/$YOCTOADT_TARGET_MACHINE_mips"
+
diff --git a/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-i686.conf b/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-i686.conf
new file mode 100644
index 0000000..ba627b3
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-i686.conf
@@ -0,0 +1,6 @@
+arch all 1
+arch any 6
+arch noarch 11
+arch i686-nativesdk 16
+src yp-i686-nativesdk ADTREPO_URL/adt-ipk/i686-nativesdk
+src yp-i686-all ADTREPO_URL/adt-ipk/all
diff --git a/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-x86_64.conf b/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-x86_64.conf
new file mode 100644
index 0000000..10504a9
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/opkg/conf/opkg-sdk-x86_64.conf
@@ -0,0 +1,6 @@
+arch all 1
+arch any 6
+arch noarch 11
+arch x86_64-nativesdk 16
+src yp-x86_64-nativesdk ADTREPO_URL/adt-ipk/x86_64-nativesdk
+src yp-x86_64-all ADTREPO_URL/adt-ipk/all
diff --git a/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
new file mode 100755
index 0000000..6f5fb49
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/adt_installer_internal
@@ -0,0 +1,312 @@
+#!/bin/bash
+
+# Yocto ADT Installer
+#
+# Copyright 2010-2011 by Intel Corp.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy 
+# of this software and associated documentation files (the "Software"), to deal 
+# in the Software without restriction, including without limitation the rights 
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+# copies of the Software, and to permit persons to whom the Software is 
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in 
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
+# THE SOFTWARE.
+
+parse_config()
+{
+  INST_ARCH=`uname -m`
+
+  case $INST_ARCH in 
+  i[3-6]86)
+    OPKG_CONFIG_FILE=$YOCTOADT_OPKG_CONF_FILE_32
+    OECORE_NATIVE_SYSROOT="$INSTALL_FOLDER/sysroots/$INST_ARCH$SDK_VENDOR-linux/"
+    ;;
+  x86_64)
+    OPKG_CONFIG_FILE=$YOCTOADT_OPKG_CONF_FILE_64
+    OECORE_NATIVE_SYSROOT="$INSTALL_FOLDER/sysroots/x86_64$SDK_VENDOR-linux/"
+    ;;
+  *)
+    echo_info "[ADT_INST] Error: Installation Machine is not supported!"
+    exit -1
+    ;;
+  esac
+}
+
+get_sudo_app()
+{
+  username=$(id -nu)
+
+  # find the owner of the parent
+  dir=$1
+  while [ 1 ]; do
+      if [ -d $dir ]; then
+          owner=$(stat -c %U $dir)
+          break
+     else
+          dir=$(dirname $dir)
+     fi
+  done
+
+  if [ "$owner" = "$username" ]; then
+      true
+  else
+      echo sudo
+  fi
+}
+
+# this function accepts arch_type (x86, x86_64, arm, ppc, mips) as the first
+# argument, returning the location of the target rootfs
+get_target_rootfs_location() {
+	[ -z "$1" ] && return
+
+	arch_type=$1
+	# rootfs extraction directory
+	target_sysroot_var="\$YOCTOADT_TARGET_SYSROOT_LOC_$arch_type"
+	target_sysroot=`eval echo $target_sysroot_var`
+
+	if [ "$target_sysroot" == "" ]; then
+		return
+	else
+		echo "`readlink -m $target_sysroot`"
+	fi
+}
+
+
+#let us install a qemu-native firstly
+#installation step 2
+install_native_sdk()
+{
+
+echo_info "\nStart installing selected native ADT for archs: $YOCTOADT_TARGETS..."
+
+# where the packages are installed.
+NATIVE_INSTALL_DIR=$INSTALL_FOLDER
+
+if [ -d "$INSTALL_FOLDER" ]; then
+  echo_info "\nNative ADT installation directory \"$INSTALL_FOLDER\" already exists! Continue installation will override its contents!"
+  confirm_install $1
+fi
+
+#Now begin to install native sdk and extract qemu rootfs which needs privilege rights
+#depending on the install location
+SUDO=$(get_sudo_app $NATIVE_INSTALL_DIR)
+if [ -n "$SUDO" ]; then
+  echo_info "#######################################################################"
+  echo_info "Please note from this point on installation requires sudo password ..."
+  echo_info "#######################################################################"
+fi
+
+#we need to make this directory firstly since opkg need to use it.
+OPKG_LOCK_DIR="$NATIVE_INSTALL_DIR/$OPKG_LIBDIR/opkg"
+if [ ! -d "$OPKG_LOCK_DIR" ]; then
+  $SUDO mkdir -p $OPKG_LOCK_DIR
+  echo_info "Successfully create directory $OPKG_LOCK_DIR. "
+#if user delete /opt/xxx, while dangling folders there, report error
+elif [ ! -d "$INSTALL_FOLDER" ]; then
+  echo_info "\nDangling opkg cache folder $OPKG_LOCK_DIR detected. Continue installation will remove the folder!"
+  confirm_install $1
+  $SUDO rm -rf $OPKG_LOCK_DIR
+  $SUDO mkdir -p $OPKG_LOCK_DIR
+#if user are updating installing, just let him/her go, give her/him prompt
+else
+  echo_info "ADT has already been installed. Will update its contents..."
+fi
+
+#first update repository
+if [ "x$SUDO" = "x" ]; then
+    OPKG_CMD="$LOCAL_OPKG_LOC/bin/opkg"
+else
+    OPKG_CMD="sudo -E $LOCAL_OPKG_LOC/bin/opkg"
+fi
+
+echo_info "Updating opkg..."
+$OPKG_CMD -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR update &>> $YOCTOADT_INSTALL_LOG_FILE
+check_result
+echo_info "opkg update process ended..."
+
+#install below must sdk-host packages
+OPKG_INSTALL_CMD="$OPKG_CMD "
+OPKG_INSTALL_NATIVE_CMD="$OPKG_INSTALL_CMD  --force-overwrite -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR install"
+
+BASE_HOSTSDK_PKGNAMES="pseudo opkg pkgconfig libtool autoconf automake"
+for pkg in $BASE_HOSTSDK_PKGNAMES; do
+  echo_info "Installing ${pkg} nativesdk ...\n"
+  $OPKG_INSTALL_NATIVE_CMD nativesdk-${pkg} &>> $YOCTOADT_INSTALL_LOG_FILE
+  check_result
+done
+
+for target_type in $YOCTOADT_TARGETS; do
+  machine_var="\$YOCTOADT_TARGET_MACHINE_$target_type"
+  machine=`eval echo $machine_var`
+  echo_info "Installing cross canadian packages for $machine ..."
+  $OPKG_INSTALL_NATIVE_CMD packagegroup-cross-canadian-$machine &>> $YOCTOADT_INSTALL_LOG_FILE
+  check_result
+
+  target_sysroot=`get_target_rootfs_location $target_type`
+  [ -z "$target_sysroot" ] && continue
+
+  # get the environment setup script paths: original (the one before relocation)
+  # and relocated
+  env_script_original=`$OPKG_CMD -f $OPKG_CONFIG_FILE -o $NATIVE_INSTALL_DIR files meta-environment-$machine|\
+							grep environment-setup`
+  env_script_relocated=$INSTALL_FOLDER/${env_script_original##*/}
+
+  # opkg will not install packagegroup-cross-canadian package if it was already
+  # installed. So, the environment script is in one place or the other.
+  [ -e "$INSTALL_FOLDER/$env_script_original" ] && env_script=$INSTALL_FOLDER/$env_script_original
+  [ -e "$env_script_original" ] && env_script=$env_script_original
+  [ -e "$env_script_relocated" ] && env_script=$env_script_relocated
+
+  $SUDO sed -i -e "s%SDKTARGETSYSROOT=.*%SDKTARGETSYSROOT=$target_sysroot%g" $env_script
+done
+
+if [ "$YOCTOADT_QEMU" == "Y" ] || [ "$YOCTOADT_QEMU" == "y" ]; then
+  echo_info "\nInstalling qemu native ..."
+  $OPKG_INSTALL_NATIVE_CMD nativesdk-qemu &>> $YOCTOADT_INSTALL_LOG_FILE
+  check_result
+  $OPKG_INSTALL_NATIVE_CMD nativesdk-qemu-helper &>> $YOCTOADT_INSTALL_LOG_FILE
+  check_result
+fi
+
+if [ "$YOCTOADT_NFS_UTIL" == "Y" ] || [ "$YOCTOADT_NFS_UTIL" == "y" ]; then
+  echo_info "\nInstalling unfs ..."
+  $OPKG_INSTALL_NATIVE_CMD nativesdk-unfs3 &>> $YOCTOADT_INSTALL_LOG_FILE
+  check_result
+fi
+
+# Lose the ./opt/${DISTRO}/${SDK_VERSION} part, we don't really need to keep
+# the entire directory structure. We could patch opkg to do that but it's far
+# simpler to do that here and achieve the same result.
+# This is done in two steps:
+if [ -d $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER ]; then
+    # Step 1: copy ./opt/${DISTRO}/${SDK_VERSION} contents to $NATIVE_INSTALL_DIR.
+    # We cannot use move if $NATIVE_INSTALL_DIR is not empty (for example: contains
+    # another SDK)
+    $SUDO cp -r $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/* $NATIVE_INSTALL_DIR
+
+    # delete the source directory now
+    $SUDO rm -rf $NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER/*
+
+    # Step 2: Delete the ./opt/${DISTRO}/${SDK_VERSION} directories too, they should be empty
+    dir=$NATIVE_INSTALL_DIR/$DEFAULT_INSTALL_FOLDER
+    while [ "$dir" != "$NATIVE_INSTALL_DIR" ]; do
+        # if the user chose / as the install folder, then we should leave /opt in place
+        if [ "$dir" = "/opt" ]; then
+            break
+        fi
+
+        # try to delete the directory, only if it's empty
+        $SUDO rmdir $dir
+        if [ $? -ne 0 ]; then
+            break
+        fi
+
+        # go to the next directory
+        dir=$(dirname $dir)
+    done
+    # Step 3: Rewrite the *.list files to contain the correct paths
+    $SUDO find $NATIVE_INSTALL_DIR/var/lib/opkg -type f -exec sed -i -e '#^$DEFAULT_INSTALL_FOLDER#$NATIVE_INSTALL_DIR#' {} \;
+fi
+
+# Link the ld.so.cache file into the hosts filesystem
+if [ ! -f "$OECORE_NATIVE_SYSROOT/etc/ld.so.cache" ]; then
+echo_info "Link the ld.so.cache file into the host filesystem"
+$SUDO ln -s /etc/ld.so.cache $OECORE_NATIVE_SYSROOT/etc/ld.so.cache
+check_result
+fi
+
+# relocate binaries
+echo_info "\nRelocating binaries ..."
+escaped_sdkpath=$(echo $DEFAULT_INSTALL_FOLDER |sed -e "s:[\+\.]:\\\\\\\\\0:g")
+
+# We don't change the script in-place since we may want the user to re-run
+# adt-installer script
+sed -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" scripts/relocate_sdk.py > scripts/relocate_sdk_tmp.py
+chmod +x scripts/relocate_sdk_tmp.py
+
+dl_path=$(find $OECORE_NATIVE_SYSROOT/lib -name "ld-linux*")
+executable_files=$(find $OECORE_NATIVE_SYSROOT -type f -perm /111)
+
+$SUDO scripts/relocate_sdk_tmp.py $INSTALL_FOLDER $dl_path $executable_files
+check_result
+
+# replace /opt/${DISTRO}/${SDK_VERSION} with the install folder in all configs
+env_setup_script=$(find $NATIVE_INSTALL_DIR/ -name "environment-setup-*")
+$SUDO sed -i -e "s:$DEFAULT_INSTALL_FOLDER:$NATIVE_INSTALL_DIR:g" $env_setup_script
+
+find $OECORE_NATIVE_SYSROOT -type f -exec file '{}' \; | grep ":.*\(ASCII\|script\|source\).*text" | \
+    cut -d':' -f1 | xargs $SUDO sed -i -e "s:$DEFAULT_INSTALL_FOLDER:$NATIVE_INSTALL_DIR:g"
+
+# change all symlinks pointing to /opt/${DISTRO}/${SDK_VERSION}
+for l in $(find $NATIVE_INSTALL_DIR -type l); do
+    $SUDO ln -sfn $(readlink $l|sed -e "s:$DEFAULT_INSTALL_FOLDER:$NATIVE_INSTALL_DIR:") $l
+done
+
+# find out all perl scripts in $OECORE_NATIVE_SYSROOT and modify them
+# replacing the host perl with SDK perl.
+for perl_script in $($SUDO grep -m 1 "^#!.*perl" -rl $OECORE_NATIVE_SYSROOT); do
+    $SUDO sed -i -e "s:^#! */usr/bin/perl.*:#! /usr/bin/env perl:g" -e \
+        "s: /usr/bin/perl: /usr/bin/env perl:g" $perl_script
+done
+
+echo_info "\nSuccessfully installed selected native ADT!"
+}
+
+#Need three input params, $1 -- arch_type(arm powerpc x86 mips) #2 -- user installation type
+#customer or scilent
+
+install_target()
+{
+
+target_sysroot=`get_target_rootfs_location $1`
+[ -z "$target_sysroot" ] && return 0
+
+target_sysroot_image_var="\$YOCTOADT_TARGET_SYSROOT_IMAGE_$1"
+target_sysroot_image=`eval echo $target_sysroot_image_var`
+if [ "$target_sysroot_image" == "" ]; then
+  echo_info "[ADT_INST] Error: YOCTOADT_TARGET_SYSROOT_IMAGE_$1 selection is empty, failed to create target sysroot!"
+  return 1
+fi
+
+echo_info "Installing target sysroot for arch: $1, rootfs type: $target_sysroot_image, location: $target_sysroot"
+
+target_machine_var="\$YOCTOADT_TARGET_MACHINE_$1"
+target_machine=`eval echo $target_machine_var`
+sysroot_image_name="core-image-$target_sysroot_image-$target_machine.tar.bz2"
+    #echo_info "Extracting rootfs: $sysroot_image_name, using pseudo..."
+
+# sudo password might be needed to install the target sysroot
+SUDO=$(get_sudo_app $target_sysroot)
+
+$SUDO scripts/extract_rootfs $sysroot_image_name $target_sysroot $OECORE_NATIVE_SYSROOT $user_inst_type
+check_result
+}
+
+
+#Main part
+. scripts/data_define
+. scripts/util
+
+parse_config
+
+#secondly we will start to install native tools
+user_inst_type=$1
+install_native_sdk $user_inst_type
+check_result
+
+for arch_type in $YOCTOADT_TARGETS; do
+  install_target $arch_type
+  check_result
+done
+
+
diff --git a/meta/recipes-devtools/installer/adt-installer/scripts/data_define b/meta/recipes-devtools/installer/adt-installer/scripts/data_define
new file mode 100644
index 0000000..cfd6716
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/data_define
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Yocto ADT Installer
+#
+# Copyright 2010-2011 by Intel Corp.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy 
+# of this software and associated documentation files (the "Software"), to deal 
+# in the Software without restriction, including without limitation the rights 
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+# copies of the Software, and to permit persons to whom the Software is 
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in 
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
+# THE SOFTWARE.
+
+config_file="adt_installer.conf"
+source `pwd`/$config_file
+
+LOCAL_OPKG_LOC="./opkg/build/opkg"
+LOCAL_OPKG_FOLDER="./opkg/build"
+
+# List all supported root fs types and target types,
+# it will be used in user configuration validity checking
+YOCTOADT_SUPPORTED_ROOTFS="minimal minimal-dev sato sato-dev sato-sdk lsb lsb-dev lsb-sdk"
+YOCTOADT_SUPPORTED_TARGETS="x86 x86_64 arm ppc mips"
+# Different host (32 bit or 64 bit) will have different opkg
+# configuration files
+YOCTOADT_OPKG_CONF_FILE_32="./opkg/conf/opkg-sdk-i686.conf"
+YOCTOADT_OPKG_CONF_FILE_64="./opkg/conf/opkg-sdk-x86_64.conf"
diff --git a/meta/recipes-devtools/installer/adt-installer/scripts/extract_rootfs b/meta/recipes-devtools/installer/adt-installer/scripts/extract_rootfs
new file mode 100755
index 0000000..d1a595b
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/extract_rootfs
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+# Yocto ADT Installer
+#
+# Copyright 2010-2011 by Intel Corp.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy 
+# of this software and associated documentation files (the "Software"), to deal 
+# in the Software without restriction, including without limitation the rights 
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+# copies of the Software, and to permit persons to whom the Software is 
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in 
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
+# THE SOFTWARE.
+
+extract_rootfs()
+{
+
+  native_sysroot=$3
+  target_sysroot=$2
+  PSEUDO_COMMAND="$native_sysroot/usr/bin/pseudo"
+  TAR_OPTS="-xjf"
+  PSEUDO_OPTS="-P $native_sysroot/usr"
+
+
+  rm -rf $PSEUDO_LOCALSTATEDIR
+
+  if [ -d "$target_sysroot" ]; then
+    echo_info "\nTarget sysroot location: $target_sysroot, already exists! If you continue installation, this folder will be re-created."
+    confirm_install $4
+    rm -rf "$target_sysroot"
+  fi
+
+  if [ ! -d "$target_sysroot" ]; then
+    echo_info "Creating directory $target_sysroot..."
+    mkdir -p "$target_sysroot"
+  fi
+
+  pseudo_state_dir="$target_sysroot/../$(basename "$target_sysroot").pseudo_state"
+  mkdir -p "$pseudo_state_dir"
+  touch "$pseudo_state_dir/pseudo.pid"
+  PSEUDO_LOCALSTATEDIR="$pseudo_state_dir"
+  export PSEUDO_LOCALSTATEDIR
+
+  echo_info "Extracting rootfs: $1, using pseudo..."
+  $PSEUDO_COMMAND $PSEUDO_OPTS tar -C $2 "$TAR_OPTS" $LOCAL_DOWNLOAD/$1 &>> $YOCTOADT_INSTALL_LOG_FILE
+  check_result
+}
+
+#Main part
+. scripts/util
+
+#Parameter detail is listed below:
+#Param 4: Silent install or customize install
+#Param 3: OECORE_NATIVE_SYSROOT
+#Param 2: user defined rootfs extraction directory
+#param 1: sysroot image name
+extract_rootfs $1 $2 $3 $4
diff --git a/meta/recipes-devtools/installer/adt-installer/scripts/util b/meta/recipes-devtools/installer/adt-installer/scripts/util
new file mode 100644
index 0000000..9be7517
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer/scripts/util
@@ -0,0 +1,104 @@
+#!/bin/bash
+
+# Yocto ADT Installer
+#
+# Copyright 2010-2011 by Intel Corp.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy 
+# of this software and associated documentation files (the "Software"), to deal 
+# in the Software without restriction, including without limitation the rights 
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+# copies of the Software, and to permit persons to whom the Software is 
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in 
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
+# THE SOFTWARE.
+
+echo_info()
+{
+  echo -e $1 | tee -a $YOCTOADT_INSTALL_LOG_FILE
+}
+
+select_install_type()
+{
+# If choosing silent install, all older installation data will be
+# overriden without user's interaction
+while true; do
+  #echo_info "[ADT_INST] Silent install means overrides all existing older"
+  #echo_info "[ADT_INST] data and the installation needs least user interaction"
+  #echo_info "[ADT_INST] If you want to use silent installation, please enter S:"
+  #echo_info "[ADT_INST] If you want to customize installation, please enter C:"
+  #echo_info "[ADT_INST} If you want to exit current installation, please enter X:"
+  echo_info "There're two ways you can do installation: silent mode or interactive mode. To choose silent mode, which means you opt for the system to override the existing data under the specified installation directories without prompting for your confirmation.  Please be cautious with this selection which may trigger your losing data.  With the interactive mode, you have to closely monitor the installation process, since it will prompt you each step it needs to override some existing data.  To choose silent mode, please enter [S], for interactive mode, please enter [I] or [X] to exit the installation."
+  echo_info "[ADT_INST] Please enter your selections here:"
+  read YOCTOADT_SEL
+  YOCTOADT_SEL=`tr '[a-z]' '[A-Z]'<<<"$YOCTOADT_SEL"`
+  if [ "$YOCTOADT_SEL" == "S" ]; then
+    return "0"
+  elif [ "$YOCTOADT_SEL" == "I" ]; then
+    return "1"
+  elif [ "$YOCTOADT_SEL" == "X" ]; then
+    echo_info "\n############################################################"
+    echo_info "# User cancelled installation!"
+    echo_info "############################################################\n"
+    exit 1
+  fi
+done
+
+
+}
+
+confirm_install()
+{
+# below are prompt, make sure user still want to install even meet
+# some prompts
+
+#User likes to enjoy silent installation, we will not break his
+#installation process here
+if [ "$1" == "0" ]; then
+  return
+fi
+
+while true; do
+  echo_info "[ADT_INST] Do you want to continue installation? Please enter Y/N:"
+  read YOCTOADT_INSTALL
+  YOCTOADT_INSTALL=`tr '[a-z]' '[A-Z]'<<<"$YOCTOADT_INSTALL"`
+  if [ "$YOCTOADT_INSTALL" == "Y" ]; then
+    break
+  elif [ "$YOCTOADT_INSTALL" == "N" ]; then
+    echo_info "\n############################################################"
+    echo_info "# User cancelled installation!"
+    echo_info "############################################################\n"
+    exit 1
+  fi
+done
+}
+
+check_result()
+{
+  result=$?
+  if [ $result -eq 1 ]; then
+    exit -1
+  elif [  $result -ne 0 ]; then
+     echo_info "\n#############################################################################"
+     echo_info "# Meet error(s) when installing Yocto ADT! Please check log file for details. "
+     echo_info "#############################################################################\n"
+    exit -1
+  fi
+}
+
+# yocto adt installation log file
+YOCTOADT_INSTALL_LOG_FILE="adt_installer.log"
+# Temp folders holding qemu/rootfs downloaded images
+# It will be put into the installation folder
+LOCAL_DOWNLOAD="./download_image"
+
+
diff --git a/meta/recipes-devtools/installer/adt-installer_1.0.bb b/meta/recipes-devtools/installer/adt-installer_1.0.bb
new file mode 100644
index 0000000..22e3850
--- /dev/null
+++ b/meta/recipes-devtools/installer/adt-installer_1.0.bb
@@ -0,0 +1,95 @@
+# Yocto ADT Installer bb file
+#
+# Copyright 2010-2012 by Intel Corp.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy 
+# of this software and associated documentation files (the "Software"), to deal 
+# in the Software without restriction, including without limitation the rights 
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
+# copies of the Software, and to permit persons to whom the Software is 
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in 
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
+# THE SOFTWARE.
+
+
+SUMMARY = "Application Development Toolkit"
+DESCRIPTION = "Creates the Application Development Toolkit (ADT) installer tarball"
+HOMEPAGE = "http://www.yoctoproject.org/tools-resources/projects/application-development-toolkit-adt"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+LICENSE = "MIT"
+
+PACKAGES = ""
+INHIBIT_DEFAULT_DEPS = "1"
+
+PR = "r11"
+
+ADT_DEPLOY = "${DEPLOY_DIR}/sdk/"
+ADT_DIR = "${WORKDIR}/adt-installer/"
+S = "${WORKDIR}/opkg-${PV}"
+
+PV = "0.3.0"
+SRC_URI = "http://downloads.yoctoproject.org/releases/opkg/opkg-${PV}.tar.gz \
+           file://wget_cache.patch \
+           file://adt_installer \
+           file://scripts/adt_installer_internal \
+           file://scripts/util \
+           file://scripts/data_define \
+           file://scripts/extract_rootfs \
+           file://adt_installer.conf \
+           file://opkg/conf/opkg-sdk-x86_64.conf \
+           file://opkg/conf/opkg-sdk-i686.conf \
+	  "
+
+SRC_URI[md5sum] = "3412cdc71d78b98facc84b19331ec64e"
+SRC_URI[sha256sum] = "7f735d1cdb8ef3718fb0f9fba44ca0d9a5c90d3a7f014f37a6d2f9474f54988f"
+
+ADTREPO ?= "http://adtrepo.yoctoproject.org/${SDK_VERSION}"
+
+# This recipe makes no sense as a multilib
+MULTILIBS = ""
+
+do_populate_adt[umask] = "022"
+
+fakeroot do_populate_adt () {
+	cd ${WORKDIR}
+	mkdir -p ${ADT_DEPLOY}
+	rm -f ${ADT_DEPLOY}/adt_installer.tar.bz2
+	rm -rf ${ADT_DIR}
+	mkdir -p ${ADT_DIR}/opkg/build
+	cp -r opkg ${ADT_DIR}/
+	sed -i -e 's#ADTREPO_URL#${ADTREPO}#' ${ADT_DIR}/opkg/conf/*.conf
+	cp -r opkg-${PV} ${ADT_DIR}/opkg/build/
+	mv ${ADT_DIR}/opkg/build/opkg-${PV} ${ADT_DIR}/opkg/build/opkg-svn
+	rm -rf ${ADT_DIR}/opkg/build/opkg-svn/patches ${ADT_DIR}/opkg/build/opkg-svn/.pc
+	cp -r scripts ${ADT_DIR}/
+	cp adt_installer ${ADT_DIR}
+	cp adt_installer.conf ${ADT_DIR}
+	sed -i -e 's#ADTREPO#${ADTREPO}#' ${ADT_DIR}/adt_installer.conf
+	echo 'SDK_VENDOR=${SDK_VENDOR}' >> ${ADT_DIR}/scripts/data_define
+	echo 'DEFAULT_INSTALL_FOLDER=${SDKPATH}' >> ${ADT_DIR}/scripts/data_define
+	cp ${COREBASE}/scripts/relocate_sdk.py ${ADT_DIR}/scripts/
+	tar cfj adt_installer.tar.bz2 adt-installer
+	cp ${WORKDIR}/adt_installer.tar.bz2 ${ADT_DEPLOY}
+}
+
+do_populate_adt[nostamp] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_package[noexec] = "1"
+do_packagedata[noexec] = "1"
+do_package_write_ipk[noexec] = "1"
+do_package_write_rpm[noexec] = "1"
+do_package_write_deb[noexec] = "1"
+do_poplulate_sysroot[noexec] = "1"
+
+addtask populate_adt before do_build after do_install
diff --git a/meta/recipes-devtools/installer/files/wget_cache.patch b/meta/recipes-devtools/installer/files/wget_cache.patch
new file mode 100644
index 0000000..9117510
--- /dev/null
+++ b/meta/recipes-devtools/installer/files/wget_cache.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ libopkg/opkg_download_wget.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libopkg/opkg_download_wget.c b/libopkg/opkg_download_wget.c
+index 9001493..18ef91e 100644
+--- a/libopkg/opkg_download_wget.c
++++ b/libopkg/opkg_download_wget.c
+@@ -50,6 +50,7 @@ int opkg_download_backend(const char *src, const char *dest,
+ 
+     argv[i++] = "wget";
+     argv[i++] = "-q";
++    argv[i++] = "--no-cache";
+     if (opkg_config->http_proxy || opkg_config->ftp_proxy) {
+         argv[i++] = "-Y";
+         argv[i++] = "on";
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/intltool/intltool.inc b/meta/recipes-devtools/intltool/intltool.inc
new file mode 100644
index 0000000..be77704
--- /dev/null
+++ b/meta/recipes-devtools/intltool/intltool.inc
@@ -0,0 +1,27 @@
+SUMMARY = "Utility scripts for internationalizing XML"
+SECTION = "devel"
+LICENSE = "GPLv2"
+
+URLV="${@'.'.join(d.getVar('PV',1).split('.')[0:2])}"
+SRC_URI = "http://launchpad.net/${BPN}/trunk/${PV}/+download/${BP}.tar.gz"
+S = "${WORKDIR}/intltool-${PV}"
+
+DEPENDS = "libxml-parser-perl-native"
+RDEPENDS_${PN} = "gettext-dev libxml-parser-perl"
+DEPENDS_class-native = "libxml-parser-perl-native"
+# gettext is assumed to exist on the host
+RDEPENDS_${PN}_class-native = "libxml-parser-perl-native"
+RRECOMMENDS_${PN} = "perl-modules"
+RRECOMMENDS_${PN}_class-native = ""
+
+FILES_${PN}-dev = ""
+FILES_${PN} += "${datadir}/aclocal"
+
+INSANE_SKIP_${PN} += "dev-deps"
+
+inherit autotools pkgconfig perlnative
+
+export PERL = "${bindir}/env perl"
+PERL_class-native = "/usr/bin/env nativeperl"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch b/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch
new file mode 100644
index 0000000..06c938b
--- /dev/null
+++ b/meta/recipes-devtools/intltool/intltool/intltool-nowarn.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: intltool-0.40.0/intltool-extract.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-extract.in	2011-10-08 22:24:57.000000000 +0300
++++ intltool-0.50.0/intltool-extract.in	2011-12-07 16:04:07.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w 
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4  -*-
+ 
+ #
+Index: intltool-0.50.0/intltool-merge.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-merge.in	2011-10-08 17:52:01.000000000 +0300
++++ intltool-0.50.0/intltool-merge.in	2011-12-07 16:05:55.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4  -*-
+ 
+ #
+Index: intltool-0.50.0/intltool-prepare.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-prepare.in	2011-10-08 09:16:58.000000000 +0300
++++ intltool-0.50.0/intltool-prepare.in	2011-12-07 16:06:13.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4  -*-
+ 
+ #  Intltool .desktop, .directory Prepare Tool
+Index: intltool-0.50.0/intltool-update.in
+===================================================================
+--- intltool-0.50.0.orig/intltool-update.in	2011-10-08 22:24:57.000000000 +0300
++++ intltool-0.50.0/intltool-update.in	2011-12-07 16:06:39.000000000 +0200
+@@ -1,4 +1,4 @@
+-#!@INTLTOOL_PERL@ -w
++#!@INTLTOOL_PERL@
+ # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 4  -*-
+ 
+ #
diff --git a/meta/recipes-devtools/intltool/intltool/noperlcheck.patch b/meta/recipes-devtools/intltool/intltool/noperlcheck.patch
new file mode 100644
index 0000000..853ee1a
--- /dev/null
+++ b/meta/recipes-devtools/intltool/intltool/noperlcheck.patch
@@ -0,0 +1,40 @@
+In the target case, we can't check if perl exists or try running it. If we
+don't patch the code, the native perl location would be used, not the target
+which is also incorrect. We therefore disable this code and rely on the 
+correct value of PERL being passed in.
+
+RP 31/8/2011
+
+Upstream-Status: Inappropriate [OE specific]
+
+diff --git a/configure.ac b/configure.ac
+index 5338a76..e709a2b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -11,24 +11,10 @@ AC_SUBST(pkgdatadir) dnl automake does not need this, but libtoolize does
+ aclocaldir='${datadir}'/aclocal
+ AC_SUBST(aclocaldir)
+ 
+-AC_PATH_PROG(PERL, perl)
+ if test -z "$PERL"; then
+-   AC_MSG_ERROR([perl not found])
+-fi
+-AC_MSG_CHECKING([for perl >= 5.8.1])
+-$PERL -e "use 5.8.1;" > /dev/null 2>&1
+-if test $? -ne 0; then
+-   AC_MSG_ERROR([perl 5.8.1 is required for intltool])
+-else
+-   PERL_VERSION="`$PERL -e \"printf '%vd', $^V\"`"
+-   AC_MSG_RESULT([$PERL_VERSION])
+-fi
+-AC_MSG_CHECKING([for XML::Parser])
+-if `$PERL -e "require XML::Parser" 2>/dev/null`; then
+-   AC_MSG_RESULT([ok])
+-else
+-   AC_MSG_ERROR([XML::Parser perl module is required for intltool])
++   AC_MSG_ERROR([PERL variable not set])
+ fi
++AC_SUBST(PERL)
+ AC_PATH_PROG(BZR, bzr)
+ 
+ 
diff --git a/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch b/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch
new file mode 100644
index 0000000..eb52172
--- /dev/null
+++ b/meta/recipes-devtools/intltool/intltool/perl-522-deprecations.patch
@@ -0,0 +1,55 @@
+Perl 5.22 has deprecated some regex features, which causes warnings when
+intltool-update runs:
+
+Unescaped left brace in regex is deprecated, passed through in regex; marked by
+<-- HERE in m/^(.*)\${ <-- HERE ?([A-Z_]+)}?(.*)$/ at
+/data/poky-master/tmp/sysroots/x86_64-linux/usr/bin/intltool-update line 1065.
+
+Take a patch from Debian to solve this.
+
+Upstream-Status: Submitted (https://bugs.launchpad.net/intltool/+bug/1465010)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- intltool-0.51.0-ORIG/intltool-update.in	2015-05-27 00:20:43.038379963 +0200
++++ intltool-0.51.0/intltool-update.in	2015-05-27 00:23:53.309078052 +0200
+@@ -1062,7 +1062,7 @@
+ 	}
+     }
+ 
+-    if ($str =~ /^(.*)\${?([A-Z_]+)}?(.*)$/)
++    if ($str =~ /^(.*)\$\{?([A-Z_]+)\}?(.*)$/)
+     {
+ 	my $rest = $3;
+ 	my $untouched = $1;
+@@ -1190,10 +1190,10 @@
+ 	$name    =~ s/\(+$//g;
+ 	$version =~ s/\(+$//g;
+ 
+-	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
+-	$varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+-	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
+-	$varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
++	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME\}?/);
++	$varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE\}?/);
++	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION\}?/);
++	$varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION\}?/);
+     }
+ 
+     if ($conf_source =~ /^AC_INIT\(([^,\)]+),([^,\)]+)[,]?([^,\)]+)?/m)
+@@ -1219,11 +1219,11 @@
+ 	$version =~ s/\(+$//g;
+         $bugurl  =~ s/\(+$//g if (defined $bugurl);
+ 
+-	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\${?AC_PACKAGE_NAME}?/);
+-	$varhash{"PACKAGE"} = $name if (not $name =~ /\${?PACKAGE}?/);
+-	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\${?AC_PACKAGE_VERSION}?/);
+-	$varhash{"VERSION"} = $version if (not $name =~ /\${?VERSION}?/);
+-        $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\${?\w+}?/);
++	$varhash{"PACKAGE_NAME"} = $name if (not $name =~ /\$\{?AC_PACKAGE_NAME\}?/);
++	$varhash{"PACKAGE"} = $name if (not $name =~ /\$\{?PACKAGE\}?/);
++	$varhash{"PACKAGE_VERSION"} = $version if (not $name =~ /\$\{?AC_PACKAGE_VERSION\}?/);
++	$varhash{"VERSION"} = $version if (not $name =~ /\$\{?VERSION\}?/);
++        $varhash{"PACKAGE_BUGREPORT"} = $bugurl if (defined $bugurl and not $bugurl =~ /\$\{?\w+\}?/);
+     }
+ 
+     # \s makes this not work, why?
\ No newline at end of file
diff --git a/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch b/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch
new file mode 100644
index 0000000..fc69e37
--- /dev/null
+++ b/meta/recipes-devtools/intltool/intltool/remove-xml-check.patch
@@ -0,0 +1,33 @@
+Signed-off-by: Florin Sarbu <florin.sarbu@windriver.com>
+
+Upstream-Status: Inappropriate [OE specific]
+
+Index: intltool-0.40.6/intltool.m4
+===================================================================
+--- intltool-0.40.6.orig/intltool.m4	2009-02-14 14:12:28.000000000 -0800
++++ intltool-0.40.6/intltool.m4	2011-11-23 15:39:34.689561872 -0800
+@@ -122,14 +122,16 @@
+    IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`"
+    AC_MSG_RESULT([$IT_PERL_VERSION])
+ fi
+-if test "x$2" != "xno-xml"; then
+-   AC_MSG_CHECKING([for XML::Parser])
+-   if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
+-       AC_MSG_RESULT([ok])
+-   else
+-       AC_MSG_ERROR([XML::Parser perl module is required for intltool])
+-   fi
+-fi
++
++# Disable this check since we know XML::Parser is installed
++#if test "x$2" != "xno-xml"; then
++#   AC_MSG_CHECKING([for XML::Parser])
++#   if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
++#       AC_MSG_RESULT([ok])
++#   else
++#       AC_MSG_ERROR([XML::Parser perl module is required for intltool])
++#   fi
++#fi
+ 
+ # Substitute ALL_LINGUAS so we can use it in po/Makefile
+ AC_SUBST(ALL_LINGUAS)
diff --git a/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch b/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch
new file mode 100644
index 0000000..5f5fed3
--- /dev/null
+++ b/meta/recipes-devtools/intltool/intltool/use-nativeperl.patch
@@ -0,0 +1,20 @@
+OE has perl binary as 'nativeperl' in native sysroot so we look for it
+in order to avoid intltool searching and finding perl from /usr/bin
+on build system which may not have all the modules that it needs.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Inappropriate [OE specific]
+Index: intltool-0.40.6/intltool.m4
+===================================================================
+--- intltool-0.40.6.orig/intltool.m4	2009-02-14 14:12:28.000000000 -0800
++++ intltool-0.40.6/intltool.m4	2011-08-09 08:07:16.427347846 -0700
+@@ -110,7 +110,7 @@
+     AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
+ fi
+ 
+-AC_PATH_PROG(INTLTOOL_PERL, perl)
++AC_PATH_PROG(INTLTOOL_PERL, nativeperl)
+ if test -z "$INTLTOOL_PERL"; then
+    AC_MSG_ERROR([perl not found])
+ fi
diff --git a/meta/recipes-devtools/intltool/intltool_0.51.0.bb b/meta/recipes-devtools/intltool/intltool_0.51.0.bb
new file mode 100644
index 0000000..d520d43
--- /dev/null
+++ b/meta/recipes-devtools/intltool/intltool_0.51.0.bb
@@ -0,0 +1,19 @@
+require intltool.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI += "file://intltool-nowarn.patch \
+            file://perl-522-deprecations.patch \
+           ${NATIVEPATCHES} \
+           "
+
+#
+# All of the intltool scripts have the correct paths to perl already
+# embedded into them and can find perl fine, so we add the remove xml-check
+# in the intltool.m4 via the remove-xml-check.patch
+NATIVEPATCHES = "file://noperlcheck.patch \
+                 file://remove-xml-check.patch"
+NATIVEPATCHES_class-native = "file://use-nativeperl.patch" 
+
+SRC_URI[md5sum] = "12e517cac2b57a0121cda351570f1e63"
+SRC_URI[sha256sum] = "67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd"
diff --git a/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch b/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch
new file mode 100644
index 0000000..d29d911
--- /dev/null
+++ b/meta/recipes-devtools/json-c/json-c/0001-json_tokener-requires-INF-and-NAN.patch
@@ -0,0 +1,37 @@
+From 9be71700eb580c815688584a64621a38867c3fdd Mon Sep 17 00:00:00 2001
+From: James Myatt <james.myatt@tessella.com>
+Date: Thu, 5 Feb 2015 15:57:14 +0000
+Subject: [PATCH] json_tokener requires INF and NAN
+
+---
+Upstream-Status: Backport
+
+ json_tokener.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: json-c-0.12/json_tokener.c
+===================================================================
+--- json-c-0.12.orig/json_tokener.c
++++ json-c-0.12/json_tokener.c
+@@ -16,6 +16,7 @@
+ #include "config.h"
+ 
+ #include <math.h>
++#include "math_compat.h"
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <stddef.h>
+@@ -352,12 +353,10 @@ struct json_object* json_tokener_parse_e
+ 
+     case json_tokener_state_inf: /* aka starts with 'i' */
+       {
+-	int size;
+-	int size_inf;
++	size_t size_inf;
+ 	int is_negative = 0;
+ 
+ 	printbuf_memappend_fast(tok->pb, &c, 1);
+-	size = json_min(tok->st_pos+1, json_null_str_len);
+ 	size_inf = json_min(tok->st_pos+1, json_inf_str_len);
+ 	char *infbuf = tok->pb->buf;
+ 	if (*infbuf == '-')
diff --git a/meta/recipes-devtools/json-c/json-c_0.12.bb b/meta/recipes-devtools/json-c/json-c_0.12.bb
new file mode 100644
index 0000000..cfef03d
--- /dev/null
+++ b/meta/recipes-devtools/json-c/json-c_0.12.bb
@@ -0,0 +1,21 @@
+SUMMARY = "C bindings for apps which will manipulate JSON data"
+DESCRIPTION = "JSON-C implements a reference counting object model that allows you to easily construct JSON objects in C."
+HOMEPAGE = "https://github.com/json-c/json-c/wiki"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2"
+
+SRC_URI = "https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
+           file://0001-json_tokener-requires-INF-and-NAN.patch \
+          "
+
+SRC_URI[md5sum] = "3ca4bbb881dfc4017e8021b5e0a8c491"
+SRC_URI[sha256sum] = "000c01b2b3f82dcb4261751eb71f1b084404fb7d6a282f06074d3c17078b9f3f"
+
+RPROVIDES_${PN} = "libjson"
+
+inherit autotools
+
+do_configure_prepend() {
+    # Clean up autoconf cruft that should not be in the tarball
+    rm -f ${S}/config.status
+}
diff --git a/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb b/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb
new file mode 100644
index 0000000..48a2f93
--- /dev/null
+++ b/meta/recipes-devtools/kconfig-frontends/kconfig-frontends_3.12.0.0.bb
@@ -0,0 +1,38 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Linux kernel style configuration framework for other projects"
+DESCRIPTION = "The kconfig-frontends project aims at centralising \
+the effort of keeping an up-to-date, out-of-tree, packaging of the \
+kconfig infrastructure, ready for use by third-party projects. \
+The kconfig-frontends package provides the kconfig parser, as well as all \
+the frontends"
+HOMEPAGE = "http://ymorin.is-a-geek.org/projects/kconfig-frontends"
+LICENSE = "GPL-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9b8cf60ff39767ff04b671fca8302408"
+SECTION = "devel"
+DEPENDS += "ncurses flex bison gperf-native pkgconfig-native"
+RDEPENDS_${PN} += "python bash"
+SRC_URI = "http://ymorin.is-a-geek.org/download/${BPN}/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "b939280dcc83f8feabd87a1d5f9b00c2"
+SRC_URI[sha256sum] = "ea2615a62c74bea6ce3b38402f00c7513858f307f6ba7aa9fdbf0bbc12bcf407"
+
+inherit autotools
+do_configure_prepend () {
+	mkdir -p scripts/.autostuff/m4
+}
+
+do_install_append() {
+	ln -s kconfig-conf ${D}${bindir}/conf
+	ln -s kconfig-mconf ${D}${bindir}/mconf
+}
+
+EXTRA_OECONF += "--disable-gconf --disable-qconf"
+
+# Some packages have the version preceeding the .so instead properly
+# versioned .so.<version>, so we need to reorder and repackage.
+SOLIBS = "-${@d.getVar('PV',1)[:-2]}.so"
+FILES_SOLIBSDEV = "${libdir}/libkconfig-parser.so"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/libtool/libtool-2.4.6.inc b/meta/recipes-devtools/libtool/libtool-2.4.6.inc
new file mode 100644
index 0000000..a977c73
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool-2.4.6.inc
@@ -0,0 +1,45 @@
+SUMMARY = "Generic library support script"
+DESCRIPTION = "This is GNU libtool, a generic library support script. \
+Libtool hides the complexity of generating special library types \
+(such as shared libraries) behind a consistent interface."
+HOMEPAGE = "http://www.gnu.org/software/libtool/libtool.html"
+SECTION = "devel"
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+    file://libltdl/COPYING.LIB;md5=4fbd65380cdd255951079008b364516c "
+
+SRC_URI = "${GNU_MIRROR}/libtool/libtool-${PV}.tar.gz \
+           file://trailingslash.patch \
+           file://rename-with-sysroot.patch \
+           file://use-sysroot-in-libpath.patch \
+           file://fix-final-rpath.patch \
+           file://fix-rpath.patch \
+           file://norm-rpath.patch \
+           file://dont-depend-on-help2man.patch \
+           file://fix-resolve-lt-sysroot.patch \
+           file://nohardcodepaths.patch \
+           file://unwind-opt-parsing.patch \
+          "
+
+SRC_URI[md5sum] = "addf44b646ddb4e3919805aa88fa7c5e"
+SRC_URI[sha256sum] = "e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3"
+
+do_compile_prepend () {
+	# Sometimes this file doesn't get rebuilt, force the issue
+	rm -f ${S}/build-aux/ltmain.sh
+	make build-aux/ltmain.sh
+	./config.status
+}
+
+inherit autotools texinfo
+EXTRA_AUTORECONF = "--exclude=libtoolize"
+
+DEPENDS = "libtool-native"
+
+PACKAGES =+ "libltdl"
+FILES_${PN} += "${datadir}/aclocal"
+
+FILES_${PN}-dev_remove = "${datadir}/aclocal"
+FILES_libltdl = "${libdir}/libltdl${SOLIBS}"
+
+export CONFIG_SHELL="/bin/bash"
diff --git a/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb b/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
new file mode 100644
index 0000000..8478802
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool-cross_2.4.6.bb
@@ -0,0 +1,41 @@
+require libtool-${PV}.inc
+
+PACKAGES = ""
+SRC_URI += "file://prefix.patch"
+SRC_URI += "file://fixinstall.patch"
+
+datadir = "${STAGING_DIR_TARGET}${target_datadir}"
+
+do_configure_prepend () {
+	# Remove any existing libtool m4 since old stale versions would break
+	# any upgrade
+	rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
+	rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
+}
+
+do_install () {
+	install -d ${D}${bindir_crossscripts}/
+	install -m 0755 ${HOST_SYS}-libtool ${D}${bindir_crossscripts}/${HOST_SYS}-libtool
+	install -d ${D}${bindir_crossscripts}/
+	GREP='/bin/grep' SED='sed' ${S}/build-aux/inline-source libtoolize > ${D}${bindir_crossscripts}/libtoolize
+	chmod 0755 ${D}${bindir_crossscripts}/libtoolize
+	install -d ${D}${target_datadir}/libtool/build-aux/
+	install -d ${D}${target_datadir}/aclocal/
+	install -c ${S}/build-aux/compile ${D}${target_datadir}/libtool/build-aux/
+	install -c ${S}/build-aux/config.guess ${D}${target_datadir}/libtool/build-aux/
+	install -c ${S}/build-aux/config.sub ${D}${target_datadir}/libtool/build-aux/
+	install -c ${S}/build-aux/depcomp ${D}${target_datadir}/libtool/build-aux/
+	install -c ${S}/build-aux/install-sh ${D}${target_datadir}/libtool/build-aux/
+	install -c ${S}/build-aux/missing ${D}${target_datadir}/libtool/build-aux/
+	install -c -m 0644 ${S}/build-aux/ltmain.sh ${D}${target_datadir}/libtool/build-aux/
+	install -c -m 0644 ${S}/m4/*.m4 ${D}${target_datadir}/aclocal/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "libtoolcross_sysroot_preprocess"
+
+libtoolcross_sysroot_preprocess () {
+	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+	sysroot_stage_dir ${D}${target_datadir} ${SYSROOT_DESTDIR}${target_datadir}
+}
+
+SSTATE_SCAN_FILES += "libtoolize *-libtool"
diff --git a/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb b/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb
new file mode 100644
index 0000000..4c5218a
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool-native_2.4.6.bb
@@ -0,0 +1,22 @@
+require libtool-${PV}.inc
+
+DEPENDS = ""
+
+SRC_URI += "file://prefix.patch"
+
+inherit native
+
+EXTRA_OECONF = " --with-libtool-sysroot=${STAGING_DIR_NATIVE}"
+
+do_configure_prepend () {
+	# Remove any existing libtool m4 since old stale versions would break
+	# any upgrade
+	rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
+	rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
+}
+
+do_install () {
+	autotools_do_install
+	install -d ${D}${bindir}/
+	install -m 0755 ${HOST_SYS}-libtool ${D}${bindir}/${HOST_SYS}-libtool
+}
diff --git a/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch b/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch
new file mode 100644
index 0000000..fd4084c
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/dont-depend-on-help2man.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -404,21 +404,6 @@ $(notes_txt): $(notes_texi)
+ 	$(AM_V_GEN)$(MAKEINFO) -P '$(srcdir)/doc' --no-headers \
+ 	    $(MAKEINFOFLAGS) -o '$@' '$(notes_texi)'
+ 
+-dist_man1_MANS		= $(libtool_1) $(libtoolize_1)
+-MAINTAINERCLEANFILES	+= $(dist_man1_MANS)
+-update_mans = \
+-  PATH=".$(PATH_SEPARATOR)$$PATH"; export PATH; \
+-  $(HELP2MAN) --output='$@'
+-
+-# It's wrong to make distributed files (e.g. $(libtool_1)) rely on
+-# files created in the build tree, so instead we regenerate the
+-# manual pages if the sources for the build-tree files we want to
+-# run have changed.
+-$(libtool_1): $(ltmain_sh)
+-	$(AM_V_GEN)$(update_mans) --help-option=--help-all libtool
+-$(libtoolize_1): $(libtoolize_in)
+-	$(AM_V_GEN)$(update_mans) libtoolize
+-
+ 
+ ## ------------- ##
+ ## Installation. ##
diff --git a/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch b/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch
new file mode 100644
index 0000000..5c9f8cc
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/fix-final-rpath.patch
@@ -0,0 +1,50 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Enalbing sysroot support exposed a bug where the final library
+had an RPATH encoded into it which still pointed to the sysroot.
+This works around the issue until it gets sorted out upstream.
+
+Fix suggested by Richard Purdie <richard.purdie@intel.com>
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -7569,9 +7569,11 @@ EOF
+ 	  test relink = "$opt_mode" || rpath=$compile_rpath$rpath
+ 	  for libdir in $rpath; do
+ 	    if test -n "$hardcode_libdir_flag_spec"; then
++		  func_replace_sysroot "$libdir"
++		  libdir=$func_replace_sysroot_result
++		  func_stripname '=' '' "$libdir"
++		  libdir=$func_stripname_result
+ 	      if test -n "$hardcode_libdir_separator"; then
+-		func_replace_sysroot "$libdir"
+-		libdir=$func_replace_sysroot_result
+ 		if test -z "$hardcode_libdirs"; then
+ 		  hardcode_libdirs=$libdir
+ 		else
+@@ -8301,6 +8303,10 @@ EOF
+       hardcode_libdirs=
+       for libdir in $compile_rpath $finalize_rpath; do
+ 	if test -n "$hardcode_libdir_flag_spec"; then
++	  func_replace_sysroot "$libdir"
++	  libdir=$func_replace_sysroot_result
++	  func_stripname '=' '' "$libdir"
++	  libdir=$func_stripname_result
+ 	  if test -n "$hardcode_libdir_separator"; then
+ 	    if test -z "$hardcode_libdirs"; then
+ 	      hardcode_libdirs=$libdir
+@@ -8352,6 +8358,10 @@ EOF
+       hardcode_libdirs=
+       for libdir in $finalize_rpath; do
+ 	if test -n "$hardcode_libdir_flag_spec"; then
++	  func_replace_sysroot "$libdir"
++	  libdir=$func_replace_sysroot_result
++	  func_stripname '=' '' "$libdir"
++	  libdir=$func_stripname_result
+ 	  if test -n "$hardcode_libdir_separator"; then
+ 	    if test -z "$hardcode_libdirs"; then
+ 	      hardcode_libdirs=$libdir
diff --git a/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch b/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch
new file mode 100644
index 0000000..1bd9598
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/fix-resolve-lt-sysroot.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Pending
+
+This patch updates libtool.m4 (and its output) to resolve a problem
+with variable 'lt_sysroot' not being properly updated if the option
+'--with[-libtool]-sysroot' is not provided when running the 'configure'
+script for a package.
+
+I have also reported the problem to libtool here
+
+http://lists.gnu.org/archive/html/bug-libtool/2013-09/msg00005.html
+
+Signed-off-by: Hans Beckerus <hans.beckerus at gmail.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+---
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -1225,16 +1225,21 @@ dnl lt_sysroot will always be passed unquoted.  We quote it here
+ dnl in case the user passed a directory name.
+ lt_sysroot=
+ case $with_libtool_sysroot in #(
+- yes)
++ no)
+    if test yes = "$GCC"; then
+      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
++     # Treat "/" the same a an unset sysroot. It seems to be more
++     # compatible across host platforms that way!?
++     if test "$lt_sysroot" = /; then
++       lt_sysroot=
++     fi
+    fi
+    ;; #(
++ yes|''|/)
++   ;; #(
+  /*)
+    lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+    ;; #(
+- no|'')
+-   ;; #(
+  *)
+    AC_MSG_RESULT([$with_libtool_sysroot])
+    AC_MSG_ERROR([The sysroot must be an absolute path.])
diff --git a/meta/recipes-devtools/libtool/libtool/fix-rpath.patch b/meta/recipes-devtools/libtool/libtool/fix-rpath.patch
new file mode 100644
index 0000000..a2ec947
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/fix-rpath.patch
@@ -0,0 +1,65 @@
+We don't want to add RPATHS which match default linker
+search paths, they're a waste of space. This patch
+filters libtools list and removes the ones we don't need.
+
+RP 23/9/2011
+
+Upstream-Status: Pending
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+Index: libtool-2.4.2/build-aux/ltmain.in
+===================================================================
+--- libtool-2.4.2.orig/build-aux/ltmain.in
++++ libtool-2.4.2/build-aux/ltmain.in
+@@ -7286,8 +7286,14 @@ EOF
+ 		  esac
+ 		fi
+ 	      else
+-		eval flag=\"$hardcode_libdir_flag_spec\"
+-		func_append dep_rpath " $flag"
++                # We only want to hardcode in an rpath if it isn't in the
++                # default dlsearch path.
++	        case " $sys_lib_dlsearch_path " in
++	        *" $libdir "*) ;;
++	        *) eval flag=\"$hardcode_libdir_flag_spec\"
++                   func_append dep_rpath " $flag"
++                   ;;
++	        esac
+ 	      fi
+ 	    elif test -n "$runpath_var"; then
+ 	      case "$perm_rpath " in
+@@ -8019,8 +8025,14 @@ EOF
+ 	      esac
+ 	    fi
+ 	  else
+-	    eval flag=\"$hardcode_libdir_flag_spec\"
+-	    func_append rpath " $flag"
++            # We only want to hardcode in an rpath if it isn't in the
++            # default dlsearch path.
++	    case " $sys_lib_dlsearch_path " in
++	    *" $libdir "*) ;;
++	    *) eval flag=\"$hardcode_libdir_flag_spec\"
++               rpath+=" $flag"
++               ;;
++	    esac
+ 	  fi
+ 	elif test -n "$runpath_var"; then
+ 	  case "$perm_rpath " in
+@@ -8070,8 +8082,14 @@ EOF
+ 	      esac
+ 	    fi
+ 	  else
+-	    eval flag=\"$hardcode_libdir_flag_spec\"
+-	    func_append rpath " $flag"
++            # We only want to hardcode in an rpath if it isn't in the
++            # default dlsearch path.
++	    case " $sys_lib_dlsearch_path " in
++	    *" $libdir "*) ;;
++	    *) eval flag=\"$hardcode_libdir_flag_spec\"
++               func_append rpath " $flag"
++               ;;
++	    esac    
+ 	  fi
+ 	elif test -n "$runpath_var"; then
+ 	  case "$finalize_perm_rpath " in
diff --git a/meta/recipes-devtools/libtool/libtool/fixinstall.patch b/meta/recipes-devtools/libtool/libtool/fixinstall.patch
new file mode 100644
index 0000000..8f343bf
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/fixinstall.patch
@@ -0,0 +1,102 @@
+There is no point in having "executable" binaries in the .libs
+directory linked with different rpaths to the target which 
+could concivably be run on the build system when cross compiling.
+
+This patch removes the extra rpaths ($compile_rpath) so that the
+output from the "link" stage can be used on the target. We can then
+avoid having to "relink" during the install stage.
+
+This saves some build time (do_install is over 2 minutes faster for
+pulseaudio).
+
+This patch also removes an annoying "seems to be moved" warning
+which is totally bogus in the sysroot case.
+
+Upstream-Status: Inappropriate [upstream are unlikely to take a patch like this]
+
+RP 2011/11/16
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -2355,7 +2355,7 @@ func_mode_install ()
+ 	dir=$func_dirname_result
+ 	func_append dir "$objdir"
+ 
+-	if test -n "$relink_command"; then
++	if test "$fast_install" = no && test -n "$relink_command"; then
+       # Strip any trailing slash from the destination.
+       func_stripname '' '/' "$libdir"
+       destlibdir=$func_stripname_result
+@@ -2394,7 +2394,7 @@ func_mode_install ()
+ 	  shift
+ 
+ 	  srcname=$realname
+-	  test -n "$relink_command" && srcname=${realname}T
++	  test "$fast_install" = no && test -n "$relink_command" && srcname="$realname"T
+ 
+ 	  # Install the shared library and build the symlinks.
+ 	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+@@ -6162,15 +6162,15 @@ func_mode_link ()
+ 	    # Hardcode the library path.
+ 	    # Skip directories that are in the system default run-time
+ 	    # search path.
+-	    case " $sys_lib_dlsearch_path " in
+-	    *" $absdir "*) ;;
+-	    *)
+-	      case "$compile_rpath " in
+-	      *" $absdir "*) ;;
+-	      *) func_append compile_rpath " $absdir" ;;
+-	      esac
+-	      ;;
+-	    esac
++	    #case " $sys_lib_dlsearch_path " in
++	    #*" $absdir "*) ;;
++	    #*)
++	    #  case "$compile_rpath " in
++	    #  *" $absdir "*) ;;
++	    #  *) func_append compile_rpath " $absdir" ;;
++	    #  esac
++	    #  ;;
++	    #esac
+ 	    case " $sys_lib_dlsearch_path " in
+ 	    *" $libdir "*) ;;
+ 	    *)
+@@ -6236,15 +6236,15 @@ func_mode_link ()
+ 	    # Hardcode the library path.
+ 	    # Skip directories that are in the system default run-time
+ 	    # search path.
+-	    case " $sys_lib_dlsearch_path " in
+-	    *" $absdir "*) ;;
+-	    *)
+-	      case "$compile_rpath " in
+-	      *" $absdir "*) ;;
+-	      *) func_append compile_rpath " $absdir" ;;
+-	      esac
+-	      ;;
+-	    esac
++	    #case " $sys_lib_dlsearch_path " in
++	    #*" $absdir "*) ;;
++	    #*)
++	    #  case "$compile_rpath " in
++	    #  *" $absdir "*) ;;
++	    #  *) func_append compile_rpath " $absdir" ;;
++	    #  esac
++	    #  ;;
++	    #esac
+ 	    case " $sys_lib_dlsearch_path " in
+ 	    *" $libdir "*) ;;
+ 	    *)
+@@ -6590,8 +6590,8 @@ func_mode_link ()
+ 		  eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ 		  test -z "$libdir" && \
+ 		    func_fatal_error "'$deplib' is not a valid libtool archive"
+-		  test "$absdir" != "$libdir" && \
+-		    func_warning "'$deplib' seems to be moved"
++		  #test "$absdir" != "$libdir" && \
++		  #  func_warning "'$deplib' seems to be moved"
+ 
+ 		  path=-L$absdir
+ 		fi
diff --git a/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch b/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch
new file mode 100644
index 0000000..b2239fb
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/nohardcodepaths.patch
@@ -0,0 +1,27 @@
+If for example you build on a machine with /bin/grep, then restore that sstate
+onto a machine with /usr/bin/grep, things will fail. Simply don't bother
+hardcoding paths.
+
+RP 2015/2/3
+
+Index: libtool-2.4.5/libtoolize.in
+===================================================================
+--- libtool-2.4.5.orig/libtoolize.in
++++ libtool-2.4.5/libtoolize.in
+@@ -40,11 +40,11 @@
+ 
+ : ${AUTOCONF="autoconf"}
+ : ${AUTOMAKE="automake"}
+-: ${EGREP="@EGREP@"}
+-: ${FGREP="@FGREP@"}
+-: ${GREP="@GREP@"}
+-: ${LN_S="@LN_S@"}
+-: ${SED="@SED@"}
++: ${EGREP="egrep"}
++: ${FGREP="fgrep"}
++: ${GREP="grep"}
++: ${LN_S="ln -s"}
++: ${SED="sed"}
+ 
+ 
+ ## -------------------------- ##
diff --git a/meta/recipes-devtools/libtool/libtool/norm-rpath.patch b/meta/recipes-devtools/libtool/libtool/norm-rpath.patch
new file mode 100644
index 0000000..1e4c65e
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/norm-rpath.patch
@@ -0,0 +1,38 @@
+libtool: normalize link paths before considering for RPATH
+
+Libtool may be passed link paths of the form "/usr/lib/../lib", which
+fool its detection code into thinking it should be included as an
+RPATH in the generated binary.  Normalize before comparision.
+
+Signed-off-by: Andy Ross <andy.ross@windriver.com>
+Upstream-Status: Pending
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff -ur a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in	2012-08-16 13:58:55.058900363 -0700
++++ b/build-aux/ltmain.in	2012-08-22 11:01:34.191345989 -0700
+@@ -7288,8 +7288,10 @@
+ 	      else
+                 # We only want to hardcode in an rpath if it isn't in the
+                 # default dlsearch path.
++                func_normal_abspath "$libdir"
++                libdir_norm=$func_normal_abspath_result
+ 	        case " $sys_lib_dlsearch_path " in
+-	        *" $libdir "*) ;;
++	        *" $libdir_norm "*) ;;
+ 	        *) eval flag=\"$hardcode_libdir_flag_spec\"
+                    func_append dep_rpath " $flag"
+                    ;;
+@@ -8027,8 +8029,10 @@
+ 	  else
+             # We only want to hardcode in an rpath if it isn't in the
+             # default dlsearch path.
++            func_normal_abspath "$libdir"
++            libdir_norm=$func_normal_abspath_result
+ 	    case " $sys_lib_dlsearch_path " in
+-	    *" $libdir "*) ;;
++	    *" $libdir_norm "*) ;;
+ 	    *) eval flag=\"$hardcode_libdir_flag_spec\"
+                rpath+=" $flag"
+                ;;
diff --git a/meta/recipes-devtools/libtool/libtool/prefix.patch b/meta/recipes-devtools/libtool/libtool/prefix.patch
new file mode 100644
index 0000000..a73df2e
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/prefix.patch
@@ -0,0 +1,98 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Renames "libtool" -> "${TARGET_PREFIX}libtool" which makes sure
+it can't be confused with the host libtool.
+
+Originally by: RP
+
+Updated: Date: 2010/06/28
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+It also adjusts libtool so that the header at the script is used for 
+script execution and not thevalue of $SHELL. This is because many 
+Makefiles change $SHELL so dash can get used to execute what is 
+otherwise configured as a bash shell script. Since we don't need to 
+execute scipts this way on any system I'm aware of us building upon, 
+the simplest fix is just to remove $SHELL.
+
+Updated: Date: 2011/11/09
+RP
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/Makefile.am b/Makefile.am
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -31,7 +31,7 @@ SUBDIRS			= .
+ DIST_SUBDIRS		= $(SUBDIRS)
+ EXTRA_DIST		=
+ 
+-BUILT_SOURCES		= libtool libtoolize
++BUILT_SOURCES		= $(host_alias)-libtool libtoolize
+ 
+ CLEANFILES		=
+ MOSTLYCLEANFILES	=
+@@ -67,7 +67,7 @@ build_scripts	= $(srcdir)/$(aux_dir)/announce-gen \
+ 
+ EXTRA_DIST     += bootstrap bootstrap.conf $(build_scripts) cfg.mk maint.mk \
+ 		  GNUmakefile
+-CLEANFILES     += libtool libtoolize
++CLEANFILES     += $(host_alias)-libtool libtoolize
+ 
+ ## If a file is named several times below, and especially if it
+ ## is a distributed file created during Libtool bootstrap, we
+@@ -276,7 +276,7 @@ configure_edit = $(bootstrap_edit) \
+ 	-e 's|@srcdir\@|$(srcdir)|g'
+ 
+ # The libtool distributor and the standalone libtool script.
+-bin_SCRIPTS = libtool
++bin_SCRIPTS = $(host_alias)-libtool
+ 
+ libtoolize: $(libtoolize_in) $(config_status)
+ 	$(AM_V_at)rm -f '$@'
+@@ -287,7 +287,7 @@ libtoolize: $(libtoolize_in) $(config_status)
+ # We used to do this with a 'stamp-vcl' file, but non-gmake builds
+ # would rerun configure on every invocation, so now we manually
+ # check the version numbers from the build rule when necessary.
+-libtool: $(ltmain_sh) $(config_status) $(dotversion)
++$(host_alias)-libtool: $(ltmain_sh) $(config_status) $(dotversion)
+ 	@$(rebuild); \
+ 	if test -f '$@'; then \
+ 	  eval `'$(SED)' -n '/^package_revision=/p' '$@'`; \
+@@ -731,12 +731,12 @@ TESTS_ENVIRONMENT = MAKE="$(MAKE)" CC="$(CC)" CFLAGS="$(CFLAGS)" \
+ 
+ BUILDCHECK_ENVIRONMENT = _lt_pkgdatadir="$(abs_top_srcdir)" \
+ 	LIBTOOLIZE="$(abs_top_builddir)/libtoolize" \
+-	LIBTOOL="$(abs_top_builddir)/libtool" \
++	LIBTOOL="$(abs_top_builddir)/$(host_alias)-libtool" \
+ 	tst_aclocaldir="$(abs_top_srcdir)/m4"
+ 
+ INSTALLCHECK_ENVIRONMENT = \
+ 	LIBTOOLIZE="$(bindir)/`echo libtoolize |$(SED) '$(program_transform_name)'`" \
+-	LIBTOOL="$(bindir)/`echo libtool |$(SED) '$(program_transform_name)'`" \
++	LIBTOOL="$(bindir)/`echo $(host_alias)-libtool |$(SED) '$(program_transform_name)'`" \
+ 	LTDLINCL="-I$(includedir)" \
+ 	LIBLTDL="$(libdir)/libltdl.la" \
+ 	tst_aclocaldir="$(aclocaldir)"
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -86,7 +86,8 @@ _LT_SET_OPTIONS([$0], [$1])
+ LIBTOOL_DEPS=$ltmain
+ 
+ # Always use our own libtool.
+-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
++LIBTOOL='$(top_builddir)'
++LIBTOOL="$LIBTOOL/${host_alias}-libtool"
+ AC_SUBST(LIBTOOL)dnl
+ 
+ _LT_SETUP
+@@ -199,7 +200,7 @@ aix3*)
+ esac
+ 
+ # Global variables:
+-ofile=libtool
++ofile=${host_alias}-libtool
+ can_build_shared=yes
+ 
+ # All known linkers require a '.a' archive for static linking (except MSVC,
diff --git a/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch b/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch
new file mode 100644
index 0000000..ad2b110
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/rename-with-sysroot.patch
@@ -0,0 +1,166 @@
+Upstream-Status: Pending
+
+This patch renames the --with-sysroot option to --with-libtool-sysroot
+to avoid namespace conflict with binutils, gcc and other toolchain
+components.
+
+I also reported the problem to libtool here
+
+http://lists.gnu.org/archive/html/libtool/2010-10/msg00048.html
+
+-Khem Raj <raj.khem@gmail.com>
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/m4/libtool.m4 b/m4/libtool.m4
+--- a/m4/libtool.m4
++++ b/m4/libtool.m4
+@@ -1215,28 +1215,28 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+ # ----------------
+ AC_DEFUN([_LT_WITH_SYSROOT],
+ [AC_MSG_CHECKING([for sysroot])
+-AC_ARG_WITH([sysroot],
+-[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
++AC_ARG_WITH([libtool-sysroot],
++[AS_HELP_STRING([--with-libtool-sysroot@<:@=DIR@:>@],
+   [Search for dependent libraries within DIR (or the compiler's sysroot
+    if not specified).])],
+-[], [with_sysroot=no])
++[], [with_libtool_sysroot=no])
+ 
+ dnl lt_sysroot will always be passed unquoted.  We quote it here
+ dnl in case the user passed a directory name.
+ lt_sysroot=
+-case $with_sysroot in #(
++case $with_libtool_sysroot in #(
+  yes)
+    if test yes = "$GCC"; then
+      lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+    fi
+    ;; #(
+  /*)
+-   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
++   lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
+    ;; #(
+  no|'')
+    ;; #(
+  *)
+-   AC_MSG_RESULT([$with_sysroot])
++   AC_MSG_RESULT([$with_libtool_sysroot])
+    AC_MSG_ERROR([The sysroot must be an absolute path.])
+    ;;
+ esac
+diff --git a/tests/sysroot.at b/tests/sysroot.at
+--- a/tests/sysroot.at
++++ b/tests/sysroot.at
+@@ -64,7 +64,7 @@ while read file; do
+ done])
+ 
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+ 
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -114,7 +114,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ ]])
+@@ -155,7 +155,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ ]])
+diff --git a/tests/testsuite b/tests/testsuite
+--- a/tests/testsuite
++++ b/tests/testsuite
+@@ -48945,7 +48945,7 @@ $at_traceon; }
+ 
+ 
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+ 
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -49154,7 +49154,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -49342,7 +49342,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -49694,7 +49694,7 @@ $at_traceon; }
+ 
+ 
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+ 
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -49903,7 +49903,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -50091,7 +50091,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -50443,7 +50443,7 @@ $at_traceon; }
+ 
+ 
+ LDFLAGS="$LDFLAGS --sysroot=$sysroot -no-undefined"
+-configure_options="$configure_options --with-sysroot=$sysroot --prefix=$prefix"
++configure_options="$configure_options --with-libtool-sysroot=$sysroot --prefix=$prefix"
+ 
+ #???
+ if test PATH = "$shlibpath_var"; then
+@@ -50652,7 +50652,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([lib2.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
+@@ -50840,7 +50840,7 @@ AM_INIT_AUTOMAKE([foreign])
+ AC_PROG_CC
+ AC_CONFIG_SRCDIR([prog.c])
+ LT_INIT
+-sysroot=$with_sysroot
++sysroot=$with_libtool_sysroot
+ AC_SUBST([sysroot])
+ AC_OUTPUT(Makefile)
+ _ATEOF
diff --git a/meta/recipes-devtools/libtool/libtool/trailingslash.patch b/meta/recipes-devtools/libtool/libtool/trailingslash.patch
new file mode 100644
index 0000000..e8824d7
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/trailingslash.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+A command like /bin/sh ../../i586-poky-linux-libtool   --mode=install /usr/bin/install -c   gck-roots-store-standalone.la '/media/data1/builds/poky1/tmp/work/core2-poky-linux/gnome-keyring-2.26.1-r1/image/usr/lib/gnome-keyring/standalone/' fails (e.g. gnome-keyring or pulseaudio)
+
+This is because libdir has a trailing slash which breaks the comparision.
+
+RP 2/1/10
+
+Merged a patch received from Gary Thomas <gary@mlbassoc.com>
+
+Date: 2010/07/12
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -2356,8 +2356,15 @@ func_mode_install ()
+ 	func_append dir "$objdir"
+ 
+ 	if test -n "$relink_command"; then
++      # Strip any trailing slash from the destination.
++      func_stripname '' '/' "$libdir"
++      destlibdir=$func_stripname_result
++
++      func_stripname '' '/' "$destdir"
++      s_destdir=$func_stripname_result
++
+ 	  # Determine the prefix the user has applied to our future dir.
+-	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
++	  inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"`
+ 
+ 	  # Don't allow the user to place us outside of our expected
+ 	  # location b/c this prevents finding dependent libraries that
diff --git a/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch b/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch
new file mode 100644
index 0000000..b633bc4
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/unwind-opt-parsing.patch
@@ -0,0 +1,179 @@
+Cut and paste the pieces of build-aux/options-parser inline into the main
+ltmain.sh code. This removes a performance degradation caused by the 
+repeated calls to func_quote_for_eval, the mechanism funclib uses
+to construct the functions used for option parsing.
+
+Upstream-Status: Submitted [Being discussed on mailing list Feb 2015]
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+index d5cf07a..0f54303 100644
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -342,11 +342,15 @@ _LT_EOF
+ # libtool_options_prep [ARG]...
+ # -----------------------------
+ # Preparation for options parsed by libtool.
+-libtool_options_prep ()
+-{
++#libtool_options_prep ()
++#{
+     $debug_mode
+ 
+     # Option defaults:
++    opt_verbose=false
++    opt_warning_types=
++
++    # Option defaults:
+     opt_config=false
+     opt_dlopen=
+     opt_dry_run=false
+@@ -382,19 +386,14 @@ libtool_options_prep ()
+       shift; set dummy --mode uninstall ${1+"$@"}; shift
+       ;;
+     esac
+-
+-    # Pass back the list of options.
+-    func_quote_for_eval ${1+"$@"}
+-    libtool_options_prep_result=$func_quote_for_eval_result
+-}
+-func_add_hook func_options_prep libtool_options_prep
++#}
+ 
+ 
+ # libtool_parse_options [ARG]...
+ # ---------------------------------
+ # Provide handling for libtool specific options.
+-libtool_parse_options ()
+-{
++#libtool_parse_options ()
++#{
+     $debug_cmd
+ 
+     # Perform our own loop to consume as many options as possible in
+@@ -474,29 +473,90 @@ libtool_parse_options ()
+                         func_append preserve_args " $_G_opt"
+                         ;;
+ 
+-	# An option not handled by this hook function:
+-        *)		set dummy "$_G_opt" ${1+"$@"};	shift; break  ;;
+-      esac
+-    done
++        --debug|-x)   debug_cmd='set -x'
++                      func_echo "enabling shell trace mode"
++                      $debug_cmd
++                      ;;
+ 
++        --no-warnings|--no-warning|--no-warn)
++                      set dummy --warnings none ${1+"$@"}
++                      shift
++		      ;;
+ 
+-    # save modified positional parameters for caller
+-    func_quote_for_eval ${1+"$@"}
+-    libtool_parse_options_result=$func_quote_for_eval_result
+-}
+-func_add_hook func_parse_options libtool_parse_options
++        --warnings|--warning|-W)
++                      test $# = 0 && func_missing_arg $_G_opt && break
++                      case " $warning_categories $1" in
++                        *" $1 "*)
++                          # trailing space prevents matching last $1 above
++                          func_append_uniq opt_warning_types " $1"
++                          ;;
++                        *all)
++                          opt_warning_types=$warning_categories
++                          ;;
++                        *none)
++                          opt_warning_types=none
++                          warning_func=:
++                          ;;
++                        *error)
++                          opt_warning_types=$warning_categories
++                          warning_func=func_fatal_error
++                          ;;
++                        *)
++                          func_fatal_error \
++                             "unsupported warning category: '$1'"
++                          ;;
++                      esac
++                      shift
++                      ;;
++
++        --verbose|-v) opt_verbose=: ;;
++        --version)    func_version ;;
++        -\?|-h)       func_usage ;;
++        --help)       func_help ;;
++
++	# Separate optargs to long options (plugins may need this):
++	--*=*)        func_split_equals "$_G_opt"
++	              set dummy "$func_split_equals_lhs" \
++                          "$func_split_equals_rhs" ${1+"$@"}
++                      shift
++                      ;;
++
++       # Separate optargs to short options:
++        -W*)
++                      func_split_short_opt "$_G_opt"
++                      set dummy "$func_split_short_opt_name" \
++                          "$func_split_short_opt_arg" ${1+"$@"}
++                      shift
++                      ;;
++
++        # Separate non-argument short options:
++        -\?*|-h*|-v*|-x*)
++                      func_split_short_opt "$_G_opt"
++                      set dummy "$func_split_short_opt_name" \
++                          "-$func_split_short_opt_arg" ${1+"$@"}
++                      shift
++                      ;;
++
++        --)           break ;;
++        -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
++        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
++      esac
++    done
++#}
+ 
++# Display all warnings if -W was not given.
++test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+ 
+ 
+ # libtool_validate_options [ARG]...
+ # ---------------------------------
+ # Perform any sanity checks on option settings and/or unconsumed
+ # arguments.
+-libtool_validate_options ()
+-{
++#libtool_validate_options ()
++#{
+     # save first non-option argument
+     if test 0 -lt $#; then
+-      nonopt=$1
++      nonopt=$_G_opt
+       shift
+     fi
+ 
+@@ -537,20 +597,10 @@ libtool_validate_options ()
+       generic_help=$help
+       help="Try '$progname --help --mode=$opt_mode' for more information."
+     }
++#}
+ 
+-    # Pass back the unparsed argument list
+-    func_quote_for_eval ${1+"$@"}
+-    libtool_validate_options_result=$func_quote_for_eval_result
+-}
+-func_add_hook func_validate_options libtool_validate_options
+-
+-
+-# Process options as early as possible so that --help and --version
+-# can return quickly.
+-func_options ${1+"$@"}
+-eval set dummy "$func_options_result"; shift
+-
+-
++# Bail if the options were screwed!
++$exit_cmd $EXIT_FAILURE
+ 
+ ## ----------- ##
+ ##    Main.    ##
diff --git a/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch b/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch
new file mode 100644
index 0000000..6af99f3
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool/use-sysroot-in-libpath.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+When using sysroot we should append it to libdir, which is helpful in
+cross builds as the system is staged in the sysroot. For normal builds,
+i.e. when lt_sysroot is not set, it will still behave the same and add
+-L/usr/lib to the relink command.
+
+-Khem Raj <raj.khem@gmail.com>
+Updated by: Robert Yang <liezhi.yang@windriver.com>
+
+diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
+--- a/build-aux/ltmain.in
++++ b/build-aux/ltmain.in
+@@ -6421,7 +6421,7 @@ func_mode_link ()
+ 	      fi
+ 	    else
+ 	      # We cannot seem to hardcode it, guess we'll fake it.
+-	      add_dir=-L$libdir
++	      add_dir="-L$lt_sysroot$libdir"
+ 	      # Try looking first in the location we're being installed to.
+ 	      if test -n "$inst_prefix_dir"; then
+ 		case $libdir in
diff --git a/meta/recipes-devtools/libtool/libtool_2.4.6.bb b/meta/recipes-devtools/libtool/libtool_2.4.6.bb
new file mode 100644
index 0000000..45f1b2f
--- /dev/null
+++ b/meta/recipes-devtools/libtool/libtool_2.4.6.bb
@@ -0,0 +1,26 @@
+require libtool-${PV}.inc
+
+RDEPENDS_${PN} += "bash"
+
+#
+# We want the results of libtool-cross preserved - don't stage anything ourselves.
+#
+SYSROOT_PREPROCESS_FUNCS += "libtool_sysroot_preprocess"
+
+do_install_append () {
+        sed -e 's@--sysroot=${STAGING_DIR_HOST}@@g' \
+            -e 's@${STAGING_DIR_HOST}@@g' \
+            -e 's@^\(sys_lib_search_path_spec="\).*@\1${libdir} ${base_libdir}"@' \
+            -e 's@^\(compiler_lib_search_dirs="\).*@\1${libdir} ${base_libdir}"@' \
+            -e 's@^\(compiler_lib_search_path="\).*@\1${libdir} ${base_libdir}"@' \
+            -e 's@^\(predep_objects="\).*@\1"@' \
+            -e 's@^\(postdep_objects="\).*@\1"@' \
+            -i ${D}${bindir}/libtool
+}
+
+libtool_sysroot_preprocess () {
+	rm -rf ${SYSROOT_DESTDIR}${bindir}/*
+	rm -rf ${SYSROOT_DESTDIR}${datadir}/aclocal/*
+	rm -rf ${SYSROOT_DESTDIR}${datadir}/libtool/build-aux/*
+}
+
diff --git a/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb b/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb
new file mode 100644
index 0000000..508eade
--- /dev/null
+++ b/meta/recipes-devtools/libtool/nativesdk-libtool_2.4.6.bb
@@ -0,0 +1,31 @@
+require libtool-${PV}.inc
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/libtool:"
+
+SRC_URI += "file://prefix.patch"
+SRC_URI += "file://fixinstall.patch"
+
+inherit nativesdk
+
+S = "${WORKDIR}/libtool-${PV}"
+FILES_${PN} += "${datadir}/libtool/*"
+
+do_configure_prepend () {
+	# Remove any existing libtool m4 since old stale versions would break
+	# any upgrade
+	rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
+	rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
+}
+
+do_install () {
+	autotools_do_install
+	install -d ${D}${bindir}/
+	install -m 0755 ${HOST_SYS}-libtool ${D}${bindir}/
+}
+
+SYSROOT_PREPROCESS_FUNCS += "libtoolnativesdk_sysroot_preprocess"
+
+libtoolnativesdk_sysroot_preprocess () {
+	install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+	install -m 755 ${D}${bindir}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${bindir_crossscripts}/${HOST_SYS}-libtool
+}
diff --git a/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb b/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb
new file mode 100644
index 0000000..a8a90fc
--- /dev/null
+++ b/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools-native_0.9.69.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Convert LinuxDoc SGML source into other formats"
+HOMEPAGE = "http://packages.debian.org/linuxdoc-tools"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=077ef64ec3ac257fb0d786531cf26931"
+
+DEPENDS = "groff-native openjade-native"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/l/linuxdoc-tools/linuxdoc-tools_${PV}.orig.tar.gz \
+           file://disable_sgml2rtf.patch \
+           file://disable_txt_doc.patch \
+           file://disable_tex_doc.patch \
+           file://disable_dvips_doc.patch"
+
+SRC_URI[md5sum] = "1d13d500918a7a145b0edc2f16f61dd1"
+SRC_URI[sha256sum] = "7103facee18a2ea97186ca459d743d22f7f89ad4b5cd1dfd1c34f83d6bfd4101"
+
+inherit autotools-brokensep native
+
+do_configure () {
+	oe_runconf
+}
+
+do_install() {
+	oe_runmake 'DESTDIR=${D}' 'TMPDIR=${T}' install
+}
diff --git a/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch b/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch
new file mode 100644
index 0000000..490b367
--- /dev/null
+++ b/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_dvips_doc.patch
@@ -0,0 +1,33 @@
+Disable building documentation which requires the dvips utility.
+This patch should be dropped once we include a native version of
+dvips.
+
+Upstream-Status: Inappropriate [Other]
+Temporary workaround which disables documentation.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh linuxdoc-tools-0.9.66/doc/Makedoc.sh
+--- linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh	2011-02-25 15:26:41.142917782 -0800
++++ linuxdoc-tools-0.9.66/doc/Makedoc.sh	2011-02-25 15:27:25.141917472 -0800
+@@ -52,13 +52,13 @@
+ #	$TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
+ #fi
+ 
+-if [ -n "`which dvips`" ]; then
+-	echo "   + dvips" >&2
+-	dvips -t letter -o ./guide.ps ./guide.dvi
+-	if [ -n "`which gzip`" -a -f ./guide.ps ]; then
+-		gzip -fN ./guide.ps
+-	fi
+-fi
++#if [ -n "`which dvips`" ]; then
++#	echo "   + dvips" >&2
++#	dvips -t letter -o ./guide.ps ./guide.dvi
++#	if [ -n "`which gzip`" -a -f ./guide.ps ]; then
++#		gzip -fN ./guide.ps
++#	fi
++#fi
+ 
+ 
+ echo "- Building info docs" >&2
diff --git a/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch b/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch
new file mode 100644
index 0000000..50c8a8f
--- /dev/null
+++ b/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_sgml2rtf.patch
@@ -0,0 +1,64 @@
+From 756f20e70a97ee2dea9b32c0955eabfc27f29be1 Mon Sep 17 00:00:00 2001
+From: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+Date: Wed, 29 May 2013 16:50:17 +0300
+Subject: [PATCH] The build of sgml2rtf is problematic due to the way it wants
+ to link to a shared library version of flex. Flex only
+ ships with a static lib. Rather than diverging from
+ upstream flex, simply skip building this un-needed utility.
+
+Upstream-Status: Inappropriate [Other]
+Workaround which disables a feature.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Andrei Dinu <andrei.adrianx.dinu@intel.com>
+---
+ Makefile.in |   12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 359f14e..fc04020 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -40,7 +40,7 @@ perl5lib_ddir      = $(DESTDIR)$(perl5libdir)
+ pkgdata_ddir       = $(DESTDIR)$(pkgdatadir)
+ tex_ddir           = $(DESTDIR)$(texdir)
+ 
+-progs    := sgml2html sgml2info sgml2latex sgml2lyx sgml2rtf sgml2txt sgmlcheck
++progs    := sgml2html sgml2info sgml2latex sgml2lyx sgml2txt sgmlcheck
+ 
+ PROFILE  =
+ INCLUDE  =
+@@ -71,9 +71,9 @@ endif
+ 	( cd sgmlpre ; \
+ 	  $(MAKE)  CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LEX=flex sgmlpre || exit -1 )
+ 
+-	@echo "Compiling RTF conversion tools (in rtf-fix/)..."
+-	( cd rtf-fix ; \
+-	  $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" || exit -1 )
++#	@echo "Compiling RTF conversion tools (in rtf-fix/)..."
++#	( cd rtf-fix ; \
++#	  $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" || exit -1 )
+ 
+ 	@echo "making man pages in genman ..."
+ 	if [ ! -d genman ]; then mkdir genman ; fi
+@@ -117,7 +117,7 @@ endif
+ 
+ #    -- Install auxiliary programs
+ 	mkdir -p $(auxbin_ddir)
+-	for ii in sgmlpre/sgmlpre rtf-fix/rtf2rtf; do \
++	for ii in sgmlpre/sgmlpre; do \
+ 	  bn=`basename $$ii`; \
+ 	  $(INSTALL_PROGRAM) $$ii $(auxbin_ddir)/$$bn; \
+ 	done
+@@ -206,7 +206,7 @@ bin/linuxdoc:: Makefile bin/linuxdoc.in
+ 
+ clean::
+ 	-rm -f *~ bin/*~ bin/linuxdoc
+-	for d in $(DDIRS) $(MDIRS) rtf-fix; do $(MAKE) -C $$d clean; done
++	for d in $(DDIRS) $(MDIRS); do $(MAKE) -C $$d clean; done
+ 	(cd sgmlpre ; rm -f sgmlpre.o sgmlpre)
+ 	-rm -rf genman/
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch b/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch
new file mode 100644
index 0000000..b62895c
--- /dev/null
+++ b/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_tex_doc.patch
@@ -0,0 +1,29 @@
+Disable building documentation which requires the latex utility.
+This patch should be dropped once we include a native version of
+latex.
+
+Upstream-Status: Inappropriate [Other]
+Temporary workaround which disables documentation.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh linuxdoc-tools-0.9.66/doc/Makedoc.sh
+--- linuxdoc-tools-0.9.66.orig/doc/Makedoc.sh	2009-11-09 11:58:25.000000000 -0800
++++ linuxdoc-tools-0.9.66/doc/Makedoc.sh	2011-02-25 15:23:58.610016114 -0800
+@@ -46,11 +46,11 @@
+ 	$TMPDIR/sgml2txt -b 1 ./guide
+ fi
+ 
+-if [ -n "`which latex`" ]; then
+-	ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
+-	echo "- Building latex docs" >&2
+-	$TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
+-fi
++#if [ -n "`which latex`" ]; then
++#	ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
++#	echo "- Building latex docs" >&2
++#	$TMPDIR/sgml2latex --pass="\usepackage{times}" -o dvi ./guide
++#fi
+ 
+ if [ -n "`which dvips`" ]; then
+ 	echo "   + dvips" >&2
diff --git a/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch b/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch
new file mode 100644
index 0000000..8d78411
--- /dev/null
+++ b/meta/recipes-devtools/linuxdoc-tools/linuxdoc-tools/disable_txt_doc.patch
@@ -0,0 +1,36 @@
+Disable building txt documentation. This is a temporary workaround,
+as I have found an Ubuntu 10.10 system which throws errors during
+building this that I'd like to ultimately fix. The error manifests
+itself from the end of LinuxDocTools.pm with the following messages
+during do_install:
+
+| - Building txt docs
+| Processing file ./guide
+| troff: fatal error: can't find macro file s
+|  fmt_txt::postASP: Empty output file, error when calling groff. Aborting...
+
+Upstream-Status: Inappropriate [Other]
+Temporary workaround which disables documentation.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN linuxdoc-tools-0.9.66.orig//doc/Makedoc.sh linuxdoc-tools-0.9.66/doc/Makedoc.sh
+--- linuxdoc-tools-0.9.66.orig//doc/Makedoc.sh	2009-11-09 11:58:25.000000000 -0800
++++ linuxdoc-tools-0.9.66/doc/Makedoc.sh	2011-03-04 17:37:24.788923998 -0800
+@@ -40,11 +40,11 @@
+ 
+ chmod u+x $TMPDIR/linuxdoc
+ 
+-if [ -n "`which groff`" ]; then
+-	ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2txt
+-	echo "- Building txt docs" >&2
+-	$TMPDIR/sgml2txt -b 1 ./guide
+-fi
++#if [ -n "`which groff`" ]; then
++#	ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2txt
++#	echo "- Building txt docs" >&2
++#	$TMPDIR/sgml2txt -b 1 ./guide
++#fi
+ 
+ if [ -n "`which latex`" ]; then
+ 	ln -s $TMPDIR/linuxdoc $TMPDIR/sgml2latex
diff --git a/meta/recipes-devtools/m4/m4-1.4.17.inc b/meta/recipes-devtools/m4/m4-1.4.17.inc
new file mode 100644
index 0000000..8ea4e04
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4-1.4.17.inc
@@ -0,0 +1,18 @@
+require m4.inc
+
+EXTRA_OECONF += "--without-libsigsegv-prefix"
+
+LICENSE = "GPLv3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+	            file://examples/COPYING;md5=4031593b2166d6c47cae282d944a7ede"
+
+SRC_URI += "file://ac_config_links.patch \
+            file://remove-gets.patch \
+           "
+
+SRC_URI_append_class-target = "\
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+	   "
+SRC_URI[md5sum] = "a5e9954b1dae036762f7b13673a2cf76"
+SRC_URI[sha256sum] = "3ce725133ee552b8b4baca7837fb772940b25e81b2a9dc92537aeaf733538c9e"
diff --git a/meta/recipes-devtools/m4/m4-1.4.9.inc b/meta/recipes-devtools/m4/m4-1.4.9.inc
new file mode 100644
index 0000000..aab2c1e
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4-1.4.9.inc
@@ -0,0 +1,13 @@
+require m4.inc
+
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe\
+	file://examples/COPYING;md5=1d49bd61dc590f014cae7173b43e3e5c"
+
+PR = "r2"
+SRC_URI += "file://fix_for_circular_dependency.patch"
+
+SRC_URI[md5sum] = "1ba8e147aff5e79bd2bfb983d86b53d5"
+SRC_URI[sha256sum] = "815ce53853fbf6493617f467389b799208b1ec98296b95be44a683f8bcfd7c47"
+
diff --git a/meta/recipes-devtools/m4/m4-native_1.4.17.bb b/meta/recipes-devtools/m4/m4-native_1.4.17.bb
new file mode 100644
index 0000000..06d8aa2
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4-native_1.4.17.bb
@@ -0,0 +1,13 @@
+require m4-${PV}.inc
+
+inherit native
+
+INHIBIT_AUTOTOOLS_DEPS = "1"
+DEPENDS += "gnu-config-native"
+
+do_configure()  {
+	install -m 0644 ${STAGING_DATADIR}/gnu-config/config.sub .
+	install -m 0644 ${STAGING_DATADIR}/gnu-config/config.guess .
+	oe_runconf
+}
+
diff --git a/meta/recipes-devtools/m4/m4.inc b/meta/recipes-devtools/m4/m4.inc
new file mode 100644
index 0000000..4a83929
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4.inc
@@ -0,0 +1,10 @@
+SUMMARY = "Traditional Unix macro processor"
+DESCRIPTION = "GNU m4 is an implementation of the traditional Unix macro processor.  It is mostly SVR4 \
+compatible although it has some extensions (for example, handling more than 9 positional parameters to macros). \
+GNU M4 also has built-in functions for including files, running shell commands, doing arithmetic, etc."
+
+inherit autotools texinfo
+
+EXTRA_OEMAKE += "'infodir=${infodir}'"
+LDFLAGS_prepend_libc-uclibc = " -lrt "
+SRC_URI = "${GNU_MIRROR}/m4/m4-${PV}.tar.gz"
diff --git a/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..ba1a4ba
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/m4/m4/ac_config_links.patch b/meta/recipes-devtools/m4/m4/ac_config_links.patch
new file mode 100644
index 0000000..275c0b2
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4/ac_config_links.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate [configuration]
+
+This patch fixes a build problem for m4-native experienced on Ubuntu 9.10,
+where autoconf/automake (AC_CONFIG_LINKS) ends up making GNUmakefile a
+symlink to itself.
+
+The patch comments out ac_config_links directly in configure,
+as autoreconf is not actually run for m4-native.
+
+I believe it should be safe, as GNUmakefile is actually unpacked from
+source, and what we want is to is to not touch it.
+
+Tested on x86_64_linux (Ubuntu 8.04 and 9.10).
+
+2009-11-10	Esben Haabendal	    <eha@doredevelopment.dk>
+
+diff -urN m4-1.4.13.orig/configure m4-1.4.13/configure
+--- m4-1.4.13.orig/configure	2009-11-10 10:54:00.301707097 +0100
++++ m4-1.4.13/configure	2009-11-10 10:54:17.314206379 +0100
+@@ -14860,8 +14860,8 @@
+   # only, it does not matter if we skip the link with older autoconf.
+   # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
+   # builds, so use a shell variable to bypass this.
+-  GNUmakefile=GNUmakefile
+-  ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
++ # GNUmakefile=GNUmakefile
++ # ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
+ 
+ 
+ 
diff --git a/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch b/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch
new file mode 100644
index 0000000..9877453
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4/fix_for_circular_dependency.patch
@@ -0,0 +1,77 @@
+Upstream-Status: Inappropriate [licensing]
+
+The older GPLv2 m4 does not work well with newer autoconf. It causes the 
+circular dependency as seen bellow.
+  Removing this m4 file which was needed only forl older autoconf
+
+| configure.ac:34: error: AC_REQUIRE: circular dependency of AC_GNU_SOURCE
+| /build_disk/poky_build/build1/tmp/work/i586-poky-linux/m4-1.4.9-r0/m4-1.4.9/m4/extensions.m4:19: AC_USE_SYSTEM_EXTENSIONS is expanded from...
+| ../../lib/autoconf/specific.m4:310: AC_GNU_SOURCE is expanded from...
+| /build_disk/poky_build/build1/tmp/work/i586-poky-linux/m4-1.4.9-r0/m4-1.4.9/m4/gnulib-comp.m4:21: M4_EARLY is expanded from...
+| configure.ac:34: the top level
+| autom4te: /build_disk/poky_build/build1/tmp/sysroots/x86_64-linux/usr/bin/m4 failed with exit status: 1
+| aclocal: /build_disk/poky_build/build1/tmp/sysroots/x86_64-linux/usr/bin/autom4te failed with exit status: 1
+| autoreconf: aclocal failed with exit status: 1
+
+Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/03/16
+
+Index: m4-1.4.9/m4/extensions.m4
+===================================================================
+--- m4-1.4.9.orig/m4/extensions.m4
++++ m4-1.4.9/m4/extensions.m4
+@@ -6,53 +6,10 @@
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+ 
+-# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+-# Autoconf.  Perhaps we can remove this once we can assume Autoconf
+-# 2.61 or later everywhere, but since CVS Autoconf mutates rapidly
+-# enough in this area it's likely we'll need to redefine
+-# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+-
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+-  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+-  AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+-  AC_REQUIRE([AC_GNU_SOURCE])
+-  AC_REQUIRE([AC_AIX])
+-  AC_REQUIRE([AC_MINIX])
+-
+-  AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris.  */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+-  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+-    [ac_cv_safe_to_define___extensions__],
+-    [AC_COMPILE_IFELSE(
+-       [AC_LANG_PROGRAM([
+-#	  define __EXTENSIONS__ 1
+-	  AC_INCLUDES_DEFAULT])],
+-       [ac_cv_safe_to_define___extensions__=yes],
+-       [ac_cv_safe_to_define___extensions__=no])])
+-  test $ac_cv_safe_to_define___extensions__ = yes &&
+-    AC_DEFINE([__EXTENSIONS__])
+-  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+-  AC_DEFINE([_TANDEM_SOURCE])
+-])
+ 
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
+ AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+-  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
++  [])
diff --git a/meta/recipes-devtools/m4/m4/make.patch b/meta/recipes-devtools/m4/m4/make.patch
new file mode 100644
index 0000000..79fb415
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4/make.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- m4-1.4.2/doc/Makefile.in~make
++++ m4-1.4.2/doc/Makefile.in
+@@ -57,9 +57,9 @@
+ 	date > $(srcdir)/stamp-vti
+ 
+ install: all
+-	$(srcdir)/../mkinstalldirs $(infodir)
++	$(srcdir)/../mkinstalldirs $(DESTDIR)$(infodir)
+ 	cd $(srcdir) && for file in m4.info*; do \
+-	  $(INSTALL_DATA) $$file $(infodir)/$$file; \
++	  $(INSTALL_DATA) $$file $(DESTDIR)$(infodir)/$$file; \
+ 	done
+ 
+ uninstall:
+--- m4-1.4.2/src/Makefile.in~make
++++ m4-1.4.2/src/Makefile.in
+@@ -35,7 +35,7 @@
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ transform = @program_transform_name@
+-bindir = $(exec_prefix)/bin
++bindir = @bindir@
+ 
+ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+ LINK = $(CC) $(LDFLAGS) -o $@
+@@ -84,8 +84,8 @@
+ 	$(LINK) ansi2knr.o $(LIBS)
+ 
+ install: all
+-	$(srcdir)/../mkinstalldirs $(bindir)
+-	$(INSTALL_PROGRAM) m4 $(bindir)/`echo m4 | sed '$(transform)'`
++	$(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir)
++	$(INSTALL_PROGRAM) m4 $(DESTDIR)$(bindir)/`echo m4 | sed '$(transform)'`
+ 
+ uninstall:
+ 	rm -f $(bindir)/`echo m4 | sed '$(transform)'`
diff --git a/meta/recipes-devtools/m4/m4/remove-gets.patch b/meta/recipes-devtools/m4/m4/remove-gets.patch
new file mode 100644
index 0000000..effb353
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4/remove-gets.patch
@@ -0,0 +1,23 @@
+eglibc has remove gets starting 2.16
+therefore check for its being there before 
+undefining it.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: m4-1.4.17/lib/stdio.in.h
+===================================================================
+--- m4-1.4.17.orig/lib/stdio.in.h	2013-10-16 14:41:01.678496227 +0300
++++ m4-1.4.17/lib/stdio.in.h	2013-10-16 14:41:48.849427839 +0300
+@@ -717,10 +717,12 @@
+ /* It is very rare that the developer ever has full control of stdin,
+    so any use of gets warrants an unconditional warning; besides, C11
+    removed it.  */
++#if defined gets
+ #undef gets
+ #if HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
++#endif
+ 
+ 
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
diff --git a/meta/recipes-devtools/m4/m4_1.4.17.bb b/meta/recipes-devtools/m4/m4_1.4.17.bb
new file mode 100644
index 0000000..b12c0ad
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4_1.4.17.bb
@@ -0,0 +1,3 @@
+require m4-${PV}.inc
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/m4/m4_1.4.9.bb b/meta/recipes-devtools/m4/m4_1.4.9.bb
new file mode 100644
index 0000000..b12c0ad
--- /dev/null
+++ b/meta/recipes-devtools/m4/m4_1.4.9.bb
@@ -0,0 +1,3 @@
+require m4-${PV}.inc
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch b/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..9b2e964
--- /dev/null
+++ b/meta/recipes-devtools/make/make-3.81/make_fix_for_automake-1.12.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:48: error: automatic de-ANSI-fication support has been removed
+...
+| Makefile.am:19: error: automatic de-ANSI-fication support has been removed
+| autoreconf: automake failed with exit status: 1
+| ERROR: autoreconf execution failed.
+
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: make-3.81/configure.in
+===================================================================
+--- make-3.81.orig/configure.in
++++ make-3.81/configure.in
+@@ -44,9 +44,6 @@ AC_AIX
+ AC_ISC_POSIX
+ AC_MINIX
+ 
+-# Needed for ansi2knr
+-AM_C_PROTOTYPES
+-
+ # Enable gettext, in "external" mode.
+ 
+ AM_GNU_GETTEXT_VERSION(0.14.1)
+Index: make-3.81/Makefile.am
+===================================================================
+--- make-3.81.orig/Makefile.am
++++ make-3.81/Makefile.am
+@@ -16,7 +16,7 @@
+ # GNU Make; see the file COPYING.  If not, write to the Free Software
+ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ 
+-AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news ansi2knr
++AUTOMAKE_OPTIONS = 1.8 dist-bzip2 check-news
+ ACLOCAL_AMFLAGS	=  -I config
+ 
+ MAKE_HOST =	@MAKE_HOST@
diff --git a/meta/recipes-devtools/make/make-3.81/makeinfo.patch b/meta/recipes-devtools/make/make-3.81/makeinfo.patch
new file mode 100644
index 0000000..5dd7604
--- /dev/null
+++ b/meta/recipes-devtools/make/make-3.81/makeinfo.patch
@@ -0,0 +1,22 @@
+Allow docs to build with makeinfo 5.X, fixing the error:
+
+doc/make.texi:8165: @itemx must follow @item
+
+Upstream-Status: Backport
+
+RP
+2014/03/29
+
+Index: make-3.81/doc/make.texi
+===================================================================
+--- make-3.81.orig/doc/make.texi	2006-04-01 06:36:40.000000000 +0000
++++ make-3.81/doc/make.texi	2014-03-29 09:39:51.007727012 +0000
+@@ -8162,7 +8162,7 @@
+ rarely need to specify this option since @samp{make} does it for you;
+ see @ref{-w Option, ,The @samp{--print-directory} Option}.)
+ 
+-@itemx --no-print-directory
++@item --no-print-directory
+ @cindex @code{--no-print-directory}
+ Disable printing of the working directory under @code{-w}.
+ This option is useful when @code{-w} is turned on automatically,
diff --git a/meta/recipes-devtools/make/make.inc b/meta/recipes-devtools/make/make.inc
new file mode 100644
index 0000000..57ea605
--- /dev/null
+++ b/meta/recipes-devtools/make/make.inc
@@ -0,0 +1,10 @@
+SUMMARY = "GNU tool that controls the build process"
+DESCRIPTION = "Make is a tool which controls the generation of executables and other non-source files of a \
+program from the program's source files.  Make gets its knowledge of how to build your program from a file \
+called the makefile, which lists each of the non-source files and how to compute it from other files."
+HOMEPAGE = "http://www.gnu.org/software/make/"
+SECTION = "devel"
+
+SRC_URI = "${GNU_MIRROR}/make/make-${PV}.tar.bz2"
+
+inherit autotools gettext pkgconfig texinfo
diff --git a/meta/recipes-devtools/make/make_3.81.bb b/meta/recipes-devtools/make/make_3.81.bb
new file mode 100644
index 0000000..b8a79b0
--- /dev/null
+++ b/meta/recipes-devtools/make/make_3.81.bb
@@ -0,0 +1,15 @@
+PR = "r1"
+
+LICENSE = "GPLv2 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=361b6b837cad26c6900a926b62aada5f \
+                    file://tests/COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+                    file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
+
+require make.inc
+
+SRC_URI += "file://make_fix_for_automake-1.12.patch"
+SRC_URI += "file://makeinfo.patch"
+
+SRC_URI[md5sum] = "354853e0b2da90c527e35aabb8d6f1e6"
+SRC_URI[sha256sum] = "f3e69023771e23908f5d5592954d8271d3d6af09693cecfd29cee6fde8550dc8"
+
diff --git a/meta/recipes-devtools/make/make_4.1.bb b/meta/recipes-devtools/make/make_4.1.bb
new file mode 100644
index 0000000..a1b0d7c
--- /dev/null
+++ b/meta/recipes-devtools/make/make_4.1.bb
@@ -0,0 +1,12 @@
+LICENSE = "GPLv3 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://tests/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
+require make.inc
+
+EXTRA_OECONF += "--without-guile"
+
+SRC_URI[md5sum] = "57a7a224a822f94789a587ccbcedff69"
+SRC_URI[sha256sum] = "0bc7613389650ee6a24554b52572a272f7356164fd2c4132b0bcf13123e4fca5"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/makedevs/makedevs/COPYING.patch b/meta/recipes-devtools/makedevs/makedevs/COPYING.patch
new file mode 100644
index 0000000..3a8902b
--- /dev/null
+++ b/meta/recipes-devtools/makedevs/makedevs/COPYING.patch
@@ -0,0 +1,346 @@
+Upstream-Status: Inappropriate [licensing]
+
+diff -ruN makedevs-1.0.0-orig/COPYING makedevs-1.0.0/COPYING
+--- makedevs-1.0.0-orig/COPYING	1970-01-01 08:00:00.000000000 +0800
++++ makedevs-1.0.0/COPYING	2010-12-09 16:42:20.274984665 +0800
+@@ -0,0 +1,340 @@
++		    GNU GENERAL PUBLIC LICENSE
++		       Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
++                       59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++			    Preamble
++
++  The licenses for most software are designed to take away your
++freedom to share and change it.  By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users.  This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it.  (Some other Free Software Foundation software is covered by
++the GNU Library General Public License instead.)  You can apply it to
++your programs, too.
++
++  When we speak of free software, we are referring to freedom, not
++price.  Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++  To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++  For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have.  You must make sure that they, too, receive or can get the
++source code.  And you must show them these terms so they know their
++rights.
++
++  We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++  Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software.  If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++  Finally, any free program is threatened constantly by software
++patents.  We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary.  To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++  The precise terms and conditions for copying, distribution and
++modification follow.
++
++		    GNU GENERAL PUBLIC LICENSE
++   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++  0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License.  The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language.  (Hereinafter, translation is included without limitation in
++the term "modification".)  Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope.  The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++  1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++  2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++    a) You must cause the modified files to carry prominent notices
++    stating that you changed the files and the date of any change.
++
++    b) You must cause any work that you distribute or publish, that in
++    whole or in part contains or is derived from the Program or any
++    part thereof, to be licensed as a whole at no charge to all third
++    parties under the terms of this License.
++
++    c) If the modified program normally reads commands interactively
++    when run, you must cause it, when started running for such
++    interactive use in the most ordinary way, to print or display an
++    announcement including an appropriate copyright notice and a
++    notice that there is no warranty (or else, saying that you provide
++    a warranty) and that users may redistribute the program under
++    these conditions, and telling the user how to view a copy of this
++    License.  (Exception: if the Program itself is interactive but
++    does not normally print such an announcement, your work based on
++    the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole.  If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works.  But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++  3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++    a) Accompany it with the complete corresponding machine-readable
++    source code, which must be distributed under the terms of Sections
++    1 and 2 above on a medium customarily used for software interchange; or,
++
++    b) Accompany it with a written offer, valid for at least three
++    years, to give any third party, for a charge no more than your
++    cost of physically performing source distribution, a complete
++    machine-readable copy of the corresponding source code, to be
++    distributed under the terms of Sections 1 and 2 above on a medium
++    customarily used for software interchange; or,
++
++    c) Accompany it with the information you received as to the offer
++    to distribute corresponding source code.  (This alternative is
++    allowed only for noncommercial distribution and only if you
++    received the program in object code or executable form with such
++    an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it.  For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable.  However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++  4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License.  Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++  5. You are not required to accept this License, since you have not
++signed it.  However, nothing else grants you permission to modify or
++distribute the Program or its derivative works.  These actions are
++prohibited by law if you do not accept this License.  Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++  6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions.  You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++  7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License.  If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all.  For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices.  Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++  8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded.  In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++  9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time.  Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number.  If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation.  If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++  10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission.  For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this.  Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++			    NO WARRANTY
++
++  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++		     END OF TERMS AND CONDITIONS
++
++	    How to Apply These Terms to Your New Programs
++
++  If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++  To do so, attach the following notices to the program.  It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++    <one line to give the program's name and a brief idea of what it does.>
++    Copyright (C) <year>  <name of author>
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation; either version 2 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License
++    along with this program; if not, write to the Free Software
++    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++    Gnomovision version 69, Copyright (C) year name of author
++    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++    This is free software, and you are welcome to redistribute it
++    under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License.  Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary.  Here is a sample; alter the names:
++
++  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++  `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++  <signature of Ty Coon>, 1 April 1989
++  Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs.  If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library.  If this is what you want to do, use the GNU Library General
++Public License instead of this License.
diff --git a/meta/recipes-devtools/makedevs/makedevs/makedevs.c b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
new file mode 100644
index 0000000..771f33e
--- /dev/null
+++ b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
@@ -0,0 +1,589 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <fcntl.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <time.h>
+#include <getopt.h>
+#include <libgen.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#define MINORBITS	8
+#define MKDEV(ma,mi)	(((ma) << MINORBITS) | (mi))
+#define MAX_ID_LEN      40
+#define MAX_NAME_LEN    40
+#ifndef PATH_MAX
+#define PATH_MAX        4096
+#endif
+#define VERSION         "1.0.1"
+
+/* These are all stolen from busybox's libbb to make
+ * error handling simpler (and since I maintain busybox,
+ * I'm rather partial to these for error handling).
+ *  -Erik
+ */
+static const char *const app_name = "makedevs";
+static const char *const memory_exhausted = "memory exhausted";
+static char default_rootdir[]=".";
+static char *rootdir = default_rootdir;
+static int trace = 0;
+
+struct name_id {
+	char name[MAX_NAME_LEN+1];
+	unsigned long id;
+	struct name_id *next;
+};
+
+static struct name_id *usr_list = NULL;
+static struct name_id *grp_list = NULL;
+
+static void verror_msg(const char *s, va_list p)
+{
+	fflush(stdout);
+	fprintf(stderr, "%s: ", app_name);
+	vfprintf(stderr, s, p);
+}
+
+static void error_msg_and_die(const char *s, ...)
+{
+	va_list p;
+
+	va_start(p, s);
+	verror_msg(s, p);
+	va_end(p);
+	putc('\n', stderr);
+	exit(EXIT_FAILURE);
+}
+
+static void vperror_msg(const char *s, va_list p)
+{
+	int err = errno;
+
+	if (s == 0)
+		s = "";
+	verror_msg(s, p);
+	if (*s)
+		s = ": ";
+	fprintf(stderr, "%s%s\n", s, strerror(err));
+}
+
+static void perror_msg_and_die(const char *s, ...)
+{
+	va_list p;
+
+	va_start(p, s);
+	vperror_msg(s, p);
+	va_end(p);
+	exit(EXIT_FAILURE);
+}
+
+static FILE *xfopen(const char *path, const char *mode)
+{
+	FILE *fp;
+
+	if ((fp = fopen(path, mode)) == NULL)
+		perror_msg_and_die("%s", path);
+	return fp;
+}
+
+static char *xstrdup(const char *s)
+{
+	char *t;
+
+	if (s == NULL)
+		return NULL;
+
+	t = strdup(s);
+
+	if (t == NULL)
+		error_msg_and_die(memory_exhausted);
+
+	return t;
+}
+
+static struct name_id* alloc_node(void)
+{
+	struct name_id *node;
+	node = (struct name_id*)malloc(sizeof(struct name_id));
+	if (node == NULL) {
+		error_msg_and_die(memory_exhausted);
+	}
+	memset((void *)node->name, 0, MAX_NAME_LEN+1);
+	node->id = 0xffffffff;
+	node->next = NULL;
+	return node;
+}
+
+static struct name_id* parse_line(char *line)
+{
+	char *p;
+	int i;
+	char id_buf[MAX_ID_LEN+1];
+	struct name_id *node;
+	node = alloc_node();
+	p = line;
+	i = 0;
+	// Get name field
+	while (*p != ':') {
+		if (i > MAX_NAME_LEN)
+			error_msg_and_die("Name field too long");
+		node->name[i++] = *p++;
+	}
+	node->name[i] = '\0';
+	p++;
+	// Skip the second field
+	while (*p != ':')
+		p++;
+	p++;
+	// Get id field
+	i = 0;
+	while (*p != ':') {
+		if (i > MAX_ID_LEN)
+			error_msg_and_die("ID filed too long");
+		id_buf[i++] = *p++;
+	}
+	id_buf[i] = '\0';
+	node->id = atol(id_buf);
+	return node;
+}
+
+static void get_list_from_file(FILE *file, struct name_id **plist)
+{
+	char *line;
+	int len = 0;
+	size_t length = 256;
+	struct name_id *node, *cur;
+
+	if((line = (char *)malloc(length)) == NULL) {
+		error_msg_and_die(memory_exhausted);
+	}
+
+	while ((len = getline(&line, &length, file)) != -1) {
+		node = parse_line(line);
+		if (*plist == NULL) {
+			*plist = node;
+			cur = *plist;
+		} else {
+			cur->next = node;
+			cur = cur->next;
+		}
+	}
+
+	if (line)
+		free(line);
+}
+
+static unsigned long convert2guid(char *id_buf, struct name_id *search_list)
+{
+	char *p;
+	int isnum;
+	struct name_id *node;
+	p = id_buf;
+	isnum = 1;
+	while (*p != '\0') {
+		if (!isdigit(*p)) {
+			isnum = 0;
+			break;
+		}
+		p++;
+	}
+	if (isnum) {
+		// Check for bad user/group name
+		node = search_list;
+		while (node != NULL) {
+			if (!strncmp(node->name, id_buf, strlen(id_buf))) {
+				fprintf(stderr, "WARNING: Bad user/group name %s detected\n", id_buf);
+				break;
+			}
+			node = node->next;
+		}
+		return (unsigned long)atol(id_buf);
+	} else {
+		node = search_list;
+		while (node != NULL) {
+			if (!strncmp(node->name, id_buf, strlen(id_buf)))
+				return node->id;
+			node = node->next;
+		}
+		error_msg_and_die("No entry for %s in search list", id_buf);
+	}
+}
+
+static void free_list(struct name_id *list)
+{
+	struct name_id *cur;
+	cur = list;
+	while (cur != NULL) {
+		list = cur;
+		cur = cur->next;
+		free(list);
+	}
+}
+
+static void add_new_directory(char *name, char *path,
+		unsigned long uid, unsigned long gid, unsigned long mode)
+{
+	if (trace)
+		fprintf(stderr, "Directory: %s %s  UID: %ld  GID %ld  MODE: %04lo", path, name, uid, gid, mode);
+
+	if (mkdir(path, mode) < 0) {
+		if (EEXIST == errno) {
+			/* Unconditionally apply the mode setting to the existing directory.
+			 * XXX should output something when trace */
+			chmod(path, mode & ~S_IFMT);
+		}
+	}
+	if (trace)
+		putc('\n', stderr);
+	chown(path, uid, gid);
+}
+
+static void add_new_device(char *name, char *path, unsigned long uid,
+	unsigned long gid, unsigned long mode, dev_t rdev)
+{
+	int status;
+	struct stat sb;
+
+	if (trace) {
+		fprintf(stderr, "Device: %s %s  UID: %ld  GID: %ld  MODE: %04lo  MAJOR: %d  MINOR: %d",
+				path, name, uid, gid, mode, (short)(rdev >> 8), (short)(rdev & 0xff));
+	}
+
+	memset(&sb, 0, sizeof(struct stat));
+	status = lstat(path, &sb);
+	if (status >= 0) {
+		/* It is ok for some types of files to not exit on disk (such as
+		 * device nodes), but if they _do_ exist, the file type bits had
+		 * better match those of the actual file or strange things will happen... */
+		if ((mode & S_IFMT) != (sb.st_mode & S_IFMT)) {
+			if (trace)
+				putc('\n', stderr);
+			error_msg_and_die("%s: existing file (04%o) type does not match specified file type (04%lo)!",
+						path, (sb.st_mode & S_IFMT), (mode & S_IFMT));
+		}
+		if (mode != sb.st_mode) {
+			if (trace)
+				fprintf(stderr, " -- applying new mode 04%lo (old was 04%o)\n", mode & ~S_IFMT, sb.st_mode & ~S_IFMT);
+			/* Apply the mode setting to the existing device node */
+			chmod(path, mode & ~S_IFMT);
+		}
+		else {
+			if (trace)
+				fprintf(stderr, " -- extraneous entry in table\n", path);
+		}
+	}
+	else {
+		mknod(path, mode, rdev);
+		if (trace)
+			putc('\n', stderr);
+
+	}
+
+	chown(path, uid, gid);
+}
+
+static void add_new_file(char *name, char *path, unsigned long uid,
+				  unsigned long gid, unsigned long mode)
+{
+	if (trace) {
+		fprintf(stderr, "File: %s %s  UID: %ld  GID: %ld  MODE: %04lo\n",
+			path, name, gid, uid, mode);
+	}
+
+	int fd = open(path,O_CREAT | O_WRONLY, mode);
+	if (fd < 0) {
+		error_msg_and_die("%s: file can not be created!", path);
+	} else {
+		close(fd);
+	}
+	chmod(path, mode);
+	chown(path, uid, gid);
+}
+
+
+static void add_new_fifo(char *name, char *path, unsigned long uid,
+				  unsigned long gid, unsigned long mode)
+{
+	if (trace) {
+		printf("Fifo: %s %s  UID: %ld  GID: %ld  MODE: %04lo\n",
+			path, name, gid, uid, mode);
+	}
+
+	int status;
+	struct stat sb;
+
+	memset(&sb, 0, sizeof(struct stat));
+	status = stat(path, &sb);
+
+
+	/* Update the mode if we exist and are a fifo already */
+	if (status >= 0 && S_ISFIFO(sb.st_mode)) {
+		chmod(path, mode);
+	} else {
+		if (mknod(path, mode, 0))
+			error_msg_and_die("%s: file can not be created with mknod!", path);
+	}
+	chown(path, uid, gid);
+}
+
+
+/*  device table entries take the form of:
+    <path>	<type> <mode>	<usr>	<grp>	<major>	<minor>	<start>	<inc>	<count>
+    /dev/mem    c      640      0       0       1       1       0        0        -
+    /dev/zero   c      644      root    root    1       5       -        -        -
+
+    type can be one of:
+	f	A regular file
+	d	Directory
+	c	Character special device file
+	b	Block special device file
+	p	Fifo (named pipe)
+
+    I don't bother with symlinks (permissions are irrelevant), hard
+    links (special cases of regular files), or sockets (why bother).
+
+    Regular files must exist in the target root directory.  If a char,
+    block, fifo, or directory does not exist, it will be created.
+*/
+static int interpret_table_entry(char *line)
+{
+	char *name;
+	char usr_buf[MAX_ID_LEN];
+	char grp_buf[MAX_ID_LEN];
+	char path[4096], type;
+	unsigned long mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
+	unsigned long start = 0, increment = 1, count = 0;
+
+	if (0 > sscanf(line, "%40s %c %lo %40s %40s %lu %lu %lu %lu %lu", path,
+		    &type, &mode, usr_buf, grp_buf, &major, &minor, &start,
+		    &increment, &count))
+	{
+		fprintf(stderr, "%s: sscanf returned < 0 for line '%s'\n", app_name, line);
+		return 1;
+	}
+
+	uid = convert2guid(usr_buf, usr_list);
+	gid = convert2guid(grp_buf, grp_list);
+
+	if (strncmp(path, "/", 1)) {
+		error_msg_and_die("Device table entries require absolute paths");
+	}
+	name = xstrdup(path + 1);
+	/* prefix path with rootdir */
+	sprintf(path, "%s/%s", rootdir, name);
+
+	/* XXX Why is name passed into all of the add_new_*() routines? */
+	switch (type) {
+	case 'd':
+		mode |= S_IFDIR;
+		add_new_directory(name, path, uid, gid, mode);
+		break;
+	case 'f':
+		mode |= S_IFREG;
+		add_new_file(name, path, uid, gid, mode);
+		break;
+	case 'p':
+		mode |= S_IFIFO;
+		add_new_fifo(name, path, uid, gid, mode);
+		break;
+	case 'c':
+	case 'b':
+		mode |= (type == 'c') ? S_IFCHR : S_IFBLK;
+		if (count > 0) {
+			int i;
+			dev_t rdev;
+			char buf[80];
+
+			for (i = start; i < start + count; i++) {
+				sprintf(buf, "%s%d", name, i);
+				sprintf(path, "%s/%s%d", rootdir, name, i);
+				/* FIXME:  MKDEV uses illicit insider knowledge of kernel
+				 * major/minor representation...  */
+				rdev = MKDEV(major, minor + (i - start) * increment);
+				sprintf(path, "%s/%s\0", rootdir, buf);
+				add_new_device(buf, path, uid, gid, mode, rdev);
+			}
+		} else {
+			/* FIXME:  MKDEV uses illicit insider knowledge of kernel
+			 * major/minor representation...  */
+			dev_t rdev = MKDEV(major, minor);
+			add_new_device(name, path, uid, gid, mode, rdev);
+		}
+		break;
+	default:
+		error_msg_and_die("Unsupported file type");
+	}
+	if (name) free(name);
+	return 0;
+}
+
+
+static void parse_device_table(FILE * file)
+{
+	char *line;
+	size_t length = 256;
+	int len = 0;
+
+	if((line = (char *)malloc(length)) == NULL) {
+		error_msg_and_die(memory_exhausted);
+	}
+	/* Looks ok so far.  The general plan now is to read in one
+	 * line at a time, trim off leading and trailing whitespace,
+	 * check for leading comment delimiters ('#') or a blank line,
+	 * then try and parse the line as a device table entry. If we fail
+	 * to parse things, try and help the poor fool to fix their
+	 * device table with a useful error msg... */
+
+	while ((len = getline(&line, &length, file)) != -1) {
+		/* First trim off any whitespace */
+
+		/* trim trailing whitespace */
+		while (len > 0 && isspace(line[len - 1]))
+			line[--len] = '\0';
+
+		/* trim leading whitespace */
+		memmove(line, &line[strspn(line, " \n\r\t\v")], len + 1);
+
+		/* If this is NOT a comment or an empty line, try to interpret it */
+		if (*line != '#' && *line != '\0') interpret_table_entry(line);
+	}
+
+	if (line)
+		free(line);
+}
+
+static int parse_devtable(FILE * devtable)
+{
+	struct stat sb;
+
+	if (lstat(rootdir, &sb)) {
+		perror_msg_and_die("%s", rootdir);
+	}
+	if (chdir(rootdir))
+		perror_msg_and_die("%s", rootdir);
+
+	if (devtable)
+		parse_device_table(devtable);
+
+	return 0;
+}
+
+
+static struct option long_options[] = {
+	{"root", 1, NULL, 'r'},
+	{"help", 0, NULL, 'h'},
+	{"trace", 0, NULL, 't'},
+	{"version", 0, NULL, 'v'},
+	{"devtable", 1, NULL, 'D'},
+	{NULL, 0, NULL, 0}
+};
+
+static char *helptext =
+	"Usage: makedevs [OPTIONS]\n"
+	"Build entries based upon device_table.txt\n\n"
+	"Options:\n"
+	"  -r, -d, --root=DIR     Build filesystem from directory DIR (default: cwd)\n"
+	"  -D, --devtable=FILE    Use the named FILE as a device table file\n"
+	"  -h, --help             Display this help text\n"
+	"  -t, --trace            Be verbose\n"
+	"  -v, --version          Display version information\n\n";
+
+
+int main(int argc, char **argv)
+{
+	int c, opt;
+	extern char *optarg;
+	struct stat statbuf;
+	char passwd_path[PATH_MAX];
+	char group_path[PATH_MAX];
+	FILE *passwd_file = NULL;
+	FILE *group_file = NULL;
+	FILE *devtable = NULL;
+	DIR *dir = NULL;
+
+	umask (0);
+
+	if (argc==1) {
+		fprintf(stderr, helptext);
+		exit(1);
+	}
+
+	while ((opt = getopt_long(argc, argv, "D:d:r:htv",
+			long_options, &c)) >= 0) {
+		switch (opt) {
+		case 'D':
+			devtable = xfopen(optarg, "r");
+			if (fstat(fileno(devtable), &statbuf) < 0)
+				perror_msg_and_die(optarg);
+			if (statbuf.st_size < 10)
+				error_msg_and_die("%s: not a proper device table file", optarg);
+			break;
+		case 'h':
+			printf(helptext);
+			exit(0);
+		case 'r':
+		case 'd':				/* for compatibility with mkfs.jffs, genext2fs, etc... */
+			if (rootdir != default_rootdir) {
+				error_msg_and_die("root directory specified more than once");
+			}
+			if ((dir = opendir(optarg)) == NULL) {
+				perror_msg_and_die(optarg);
+			} else {
+				closedir(dir);
+			}
+			/* If "/" is specified, use "" because rootdir is always prepended to a
+			 * string that starts with "/" */
+			if (0 == strcmp(optarg, "/"))
+				rootdir = xstrdup("");
+			else
+				rootdir = xstrdup(optarg);
+			break;
+
+		case 't':
+			trace = 1;
+			break;
+
+		case 'v':
+			printf("%s: %s\n", app_name, VERSION);
+			exit(0);
+		default:
+			fprintf(stderr, helptext);
+			exit(1);
+		}
+	}
+
+	if (argv[optind] != NULL) {
+		fprintf(stderr, helptext);
+		exit(1);
+	}
+
+	// Get name-id mapping
+	sprintf(passwd_path, "%s/etc/passwd", rootdir);
+	sprintf(group_path, "%s/etc/group", rootdir);
+	if ((passwd_file = fopen(passwd_path, "r")) != NULL) {
+		get_list_from_file(passwd_file, &usr_list);
+		fclose(passwd_file);
+	}
+	if ((group_file = fopen(group_path, "r")) != NULL) {
+		get_list_from_file(group_file, &grp_list);
+		fclose(group_file);
+	}
+
+	// Parse devtable
+	if(devtable) {
+		parse_devtable(devtable);
+		fclose(devtable);
+	}
+
+	// Free list
+	free_list(usr_list);
+	free_list(grp_list);
+
+	return 0;
+}
diff --git a/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb b/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb
new file mode 100644
index 0000000..92d5870
--- /dev/null
+++ b/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Tool for creating device nodes"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+SECTION = "base"
+SRC_URI = "file://makedevs.c \
+           file://COPYING.patch"
+
+S = "${WORKDIR}"
+
+FILES_${PN}_append_class-nativesdk = " ${datadir}"
+
+do_compile() {
+	${CC} ${CFLAGS} ${LDFLAGS} -o ${S}/makedevs ${S}/makedevs.c
+}
+
+do_install() {
+	install -d ${D}${base_sbindir}
+	install -m 0755 ${S}/makedevs ${D}${base_sbindir}/makedevs
+}
+
+do_install_append_class-nativesdk() {
+	install -d ${D}${datadir}
+	install -m 644 ${COREBASE}/meta/files/device_table-minimal.txt ${D}${datadir}/
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch b/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
new file mode 100644
index 0000000..7692709
--- /dev/null
+++ b/meta/recipes-devtools/mkelfimage/mkelfimage/cross-compile.patch
@@ -0,0 +1,71 @@
+make the tool to be cross compilable.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: mkelfImage/configure.ac
+===================================================================
+--- mkelfImage.orig/configure.ac	2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/configure.ac	2012-07-14 14:10:47.800916083 -0700
+@@ -70,6 +70,9 @@
+ 		AC_MSG_ERROR([cc not found])
+ 	fi
+ 	eval "${with_default}_CC='$CC'"
++	if test "x$HOST_CC" = 'x'; then
++		AC_CHECK_PROG([HOST_CC], [$CC], [$CC], [gcc], [$PATH])
++	fi
+ 	AC_PROG_CPP
+ 	if test "$CPP" = no; then
+ 		AC_MSG_ERROR([cpp not found])
+@@ -172,7 +175,6 @@
+ 
+ dnl ---Output variables...
+ 
+-HOST_CC=$CC
+ HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)"
+ 
+ dnl TODO: figure out how to set these appropriately for compilers other than gcc
+Index: mkelfImage/linux-i386/Makefile
+===================================================================
+--- mkelfImage.orig/linux-i386/Makefile	2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/linux-i386/Makefile	2012-07-14 14:04:49.032898671 -0700
+@@ -4,7 +4,7 @@
+ 
+ $(LI386_OBJ)/mkelf-linux-i386.o: $(LI386_DIR)/mkelf-linux-i386.c $(LI386_DIR)/convert.bin.c $(LI386_DEP)
+ 	$(MKDIR) -p $(@D)
+-	$(HOST_CC) $(HOST_CFLAGS) -c -g $< -o $@
++	$(CC) $(HOST_CFLAGS) -c -g $< -o $@
+ 
+ 
+ ifdef I386_CC
+Index: mkelfImage/linux-ia64/Makefile
+===================================================================
+--- mkelfImage.orig/linux-ia64/Makefile	2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/linux-ia64/Makefile	2012-07-14 14:04:49.032898671 -0700
+@@ -4,7 +4,7 @@
+ 
+ $(LIA64_OBJ)/mkelf-linux-ia64.o: $(LIA64_DIR)/mkelf-linux-ia64.c $(LIA64_DIR)/convert.bin.c $(LIA64_DEP)
+ 	$(MKDIR) -p $(@D)
+-	$(HOST_CC) $(HOST_CFLAGS) -c -g $< -o $@
++	$(CC) $(HOST_CFLAGS) -c -g $< -o $@
+ 
+ ifdef IA64_CC
+ 
+Index: mkelfImage/main/Makefile
+===================================================================
+--- mkelfImage.orig/main/Makefile	2012-07-14 14:04:48.964898667 -0700
++++ mkelfImage/main/Makefile	2012-07-14 14:04:49.032898671 -0700
+@@ -4,11 +4,11 @@
+ 
+ $(OBJDIR)/sbin/mkelfImage: $(MKELF_OBJS) $(DEPS)
+ 	$(MKDIR) -p $(@D)
+-	$(HOST_CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
++	$(CC) $(HOST_CFLAGS) $(MKELF_OBJS) -o $@ $(LIBS)
+ 
+ $(OBJDIR)/main/mkelfImage.o: main/mkelfImage.c include/mkelfImage.h $(DEPS)
+ 	$(MKDIR) -p $(@D)
+-	$(HOST_CC) $(HOST_CFLAGS) -c $< -o $@
++	$(CC) $(HOST_CFLAGS) -c $< -o $@
+ 
+ $(OBJDIR)/man/man8/mkelfImage.8: main/mkelfImage.man
+ 	$(MKDIR) -p $(@D)
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch b/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch
new file mode 100644
index 0000000..756a65c
--- /dev/null
+++ b/meta/recipes-devtools/mkelfimage/mkelfimage/fix-makefile-to-find-libz.patch
@@ -0,0 +1,30 @@
+Let makefile find libz and zlib.h by CFLAGS and LDFLAGS.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+diff --git a/configure.ac b/configure.ac
+index d1acc36..6f865b0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -62,7 +62,7 @@ AC_CHECK_PROG([RPM],   rpm,   rpm,   [], [$PATH])
+ AC_CHECK_PROG([SED],   sed,   sed,   [], [$PATH])
+ AC_CHECK_PROG([FIND],  find,  find,  [], [$PATH])
+ 
+-AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, inflateInit_, [AC_DEFINE(HAVE_ZLIB_H, 1) LIBS="$LIBS -lz"]))
++AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, inflateInit_, [AC_DEFINE(HAVE_ZLIB_H, 1) LIBS="$LIBS $LDFLAGS -lz"]))
+ 
+ dnl Find the default programs
+ if test "with_default" != no ; then
+@@ -175,7 +175,7 @@ fi
+ 
+ dnl ---Output variables...
+ 
+-HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS)"
++HOST_CFLAGS="$HOST_CFLAGS -O2 -Wall \$(HOST_CPPFLAGS) $CFLAGS"
+ 
+ dnl TODO: figure out how to set these appropriately for compilers other than gcc
+ I386_CFLAGS="$I386_CFLAGS -Os -ffreestanding -Wall -W -Wno-format \$(I386_CPPFLAGS)"
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb b/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
new file mode 100644
index 0000000..2845b8c
--- /dev/null
+++ b/meta/recipes-devtools/mkelfimage/mkelfimage_git.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Utility for creating ELF boot images for ELF-based Linux kernel images"
+HOMEPAGE = "http://www.coreboot.org/Mkelfimage"
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a"
+
+SRCREV = "686a48a339b3200184c27e7f98d4c03180b2be6c"
+PV = "4.0+git${SRCPV}"
+RECIPE_NO_UPDATE_REASON = "mkelfimage has been removed in coreboot 4.1 release: \
+http://review.coreboot.org/gitweb?p=coreboot.git;a=commit;h=34fc4ab80b507739e2580d490dff67fcfdde11ea"
+
+
+DEPENDS += "zlib"
+
+SRC_URI = "git://review.coreboot.org/p/coreboot;protocol=http \
+           file://cross-compile.patch   \
+           file://fix-makefile-to-find-libz.patch   \
+          "
+
+CLEANBROKEN = "1"
+
+S = "${WORKDIR}/git/util/mkelfImage"
+
+CFLAGS += "-fno-stack-protector"
+CACHED_CONFIGUREVARS += "HOST_CC='${BUILD_CC}'"
+EXTRA_OEMAKE += "HOST_CPPFLAGS='${BUILD_CPPFLAGS}'"
+
+inherit autotools-brokensep
+
+do_install_append() {
+	rmdir ${D}${datadir}/mkelfImage/elf32-i386
+	rmdir ${D}${datadir}/mkelfImage
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/mklibs/files/ac_init_fix.patch b/meta/recipes-devtools/mklibs/files/ac_init_fix.patch
new file mode 100644
index 0000000..422af10
--- /dev/null
+++ b/meta/recipes-devtools/mklibs/files/ac_init_fix.patch
@@ -0,0 +1,19 @@
+Get the version of mklibs by simpler means. The MKLIBS_VERSION string in the 
+configure.ac file is replaced with real version string by the 
+do_configure_prepend() function from the recipe .bb file.
+
+Upstream-Status: Inappropriate [configuration]
+
+Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2011/01/24
+
+Index: mklibs/configure.ac
+===================================================================
+--- mklibs.orig/configure.ac	2010-02-21 17:34:56.000000000 -0800
++++ mklibs/configure.ac	2011-01-24 18:52:19.943242079 -0800
+@@ -1,4 +1,4 @@
+-AC_INIT([mklibs],m4_esyscmd(dpkg-parsechangelog | perl -ne 'print $1 if m/^Version: (.*)$/;'))
++AC_INIT([mklibs], MKLIBS_VERSION)
+ AM_INIT_AUTOMAKE([foreign no-define])
+ AC_CONFIG_HEADERS([config.h])
+ AM_MAINTAINER_MODE
diff --git a/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch b/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch
new file mode 100644
index 0000000..7d6d62e
--- /dev/null
+++ b/meta/recipes-devtools/mklibs/files/avoid-failure-on-symbol-provided-by-application.patch
@@ -0,0 +1,102 @@
+From f172101130604e4a9efa5746f4d8d30de99a0fdc Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <yuanjie.huang@windriver.com>
+Date: Fri, 17 Apr 2015 14:48:20 +0800
+Subject: [PATCH] avoid failure on symbol provided by application
+
+Upstream-Status: Pending
+
+Undefined symbols in a library can be provided by the application
+that links to the library, such as `logsink' in libmultipath.so.0.
+This fix checks the type of object in which the symbol is needed
+and the existence of the symbol in application, when a symbol
+cannot be provided by libraries. It prevents false alarm on absence
+of symbols.
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ src/mklibs | 28 ++++++++++++++++++++++++----
+ 1 file changed, 24 insertions(+), 4 deletions(-)
+
+diff --git a/src/mklibs b/src/mklibs
+index c5614ea..b0d9034 100755
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -133,9 +133,9 @@ class Symbol(object):
+         return '@'.join(ret)
+ 
+ class UndefinedSymbol(Symbol):
+-    def __init__(self, name, weak, version, library):
++    def __init__(self, name, weak, version, library, object):
+         super(UndefinedSymbol, self).__init__(name, version, library)
+-        self.weak, self.library = weak, library
++        self.weak, self.library, self.object = weak, library, object
+ 
+ # Return undefined symbols in an object as a set of tuples (name, weakness)
+ def undefined_symbols(obj):
+@@ -144,6 +144,11 @@ def undefined_symbols(obj):
+ 
+     output = command("mklibs-readelf", "--print-symbols-undefined", obj)
+ 
++    if len(obj) > len(dest_path) and obj[:len(dest_path)] == dest_path:
++        object = obj[len(dest_path) + 1:-len('-so-stripped')]
++    else:
++        object = obj
++
+     result = []
+     for line in output:
+         name, weak_string, version_string, library_string = line.split()[:4]
+@@ -160,7 +165,7 @@ def undefined_symbols(obj):
+         if library_string.lower() != 'none':
+             library = library_string
+ 
+-        result.append(UndefinedSymbol(name, weak, version, library))
++        result.append(UndefinedSymbol(name, weak, version, library, object))
+ 
+     return result
+ 
+@@ -495,12 +500,13 @@ while 1:
+                      and re.search("^ps_", str(symbol)))
+                 and not (re.search("ld-linux.so.3$", str(symbol)))
+                 and not (re.search("^__gnu_local_gp", str(symbol)))):
+-                debug(DEBUG_SPAM, "needed_symbols adding %s, weak: %s" % (symbol, symbol.weak))
++                debug(DEBUG_SPAM, "needed_symbols adding %s, weak: %s, for %s" % (symbol, symbol.weak, obj))
+                 needed_symbols[str(symbol)] = symbol
+         libraries.update(library_depends(obj))
+ 
+     # calculate what symbols are present in small_libs and available_libs
+     present_symbols = {}
++    present_symbol_progs = {}
+     checked_libs = small_libs
+     checked_libs.extend(available_libs)
+     checked_libs.append(ldlib)
+@@ -510,6 +516,12 @@ while 1:
+             names = symbol.base_names()
+             for name in names:
+                 present_symbols[name] = symbol
++            if not so_pattern.match(lib):
++                debug(DEBUG_SPAM, "present_symbol_progs adding %s, from executable %s" % (' '.join(names), lib))
++                for name in names:
++                    progs = present_symbol_progs.get(name, set())
++                    progs.add(lib)
++                    present_symbol_progs[name] = progs
+ 
+     # are we finished?
+     num_unresolved = 0
+@@ -565,6 +577,14 @@ while 1:
+     for name in needed_symbols:
+         if not name in symbol_provider:
+             if not needed_symbols[name].weak:
++                # WORKAROUND: Undefined symbols in a library can be provided by the application
++                # that links to the library. So if the object which requires the symbol is a library
++                # and some application can provide the symbol, the undefined symbol is skipped.
++                symbol = needed_symbols[name]
++                if so_pattern.match(symbol.object) and present_symbol_progs.get(name, None):
++                    debug(DEBUG_SPAM, "symbol %s in library %s is provided by executable %s" \
++                          % (name, symbol.object, ' '.join(present_symbol_progs[name])))
++                    continue
+                 raise Exception("No library provides non-weak %s" % name)
+         else:
+             lib = symbol_provider[name]
+-- 
+1.8.5.2.233.g932f7e4
+
diff --git a/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch b/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch
new file mode 100644
index 0000000..d27a489
--- /dev/null
+++ b/meta/recipes-devtools/mklibs/files/fix_STT_GNU_IFUNC.patch
@@ -0,0 +1,26 @@
+The libc6-dev in Ubuntu 9.04 is so old that the elf.h doesn't
+define STT_GNU_IFUNC, so we have to define it ourselves.
+
+Upstream-Status: Inappropriate [other] - old release specific, maybe removable
+
+-- Dexuan Cui (dexuan.cui@intel.com) Feb 16, 2011.
+
+diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp
+index 2444c39..56d93f8 100644
+--- a/src/mklibs-readelf/main.cpp
++++ b/src/mklibs-readelf/main.cpp
+@@ -6,6 +6,14 @@
+ #include <vector>
+ 
+ #include <elf.h>
++/*
++ * The /usr/include/elf.h in some distributions(like Ubuntu 9.04) doesn't
++ * define the macro. We need to define it here.
++ */
++#ifndef STT_GNU_IFUNC
++#define STT_GNU_IFUNC   10              /* Symbol is indirect code object */
++#endif
++
+ #include <getopt.h>
+ 
+ #include "elf.hpp"
diff --git a/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch b/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
new file mode 100644
index 0000000..13e4606
--- /dev/null
+++ b/meta/recipes-devtools/mklibs/files/fix_cross_compile.patch
@@ -0,0 +1,81 @@
+Remove dependency on dpkg
+
+Upstream-Status: Submitted
+
+Asking the host OS whether it supports multiarch is not useful
+in a cross-compilation environment, or if the user has specified
+a libdir explicitly. So this patch, based on the work of Mentor
+Graphics, removes mklibs's dependency on dpkg package.
+
+Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+ src/mklibs | 30 +++++++++++++++++++-----------
+ 1 file changed, 19 insertions(+), 11 deletions(-)
+
+diff --git a/src/mklibs b/src/mklibs
+index d9b784b..c5614ea 100755
+--- a/src/mklibs
++++ b/src/mklibs
+@@ -261,6 +261,11 @@ def extract_soname(so_file):
+     return ""
+ 
+ def multiarch(paths):
++    # Asking the host OS whether it supports multiarch is not useful
++    # in a cross-compilation environment, or if the user has specified
++    # a libdir explicitly.
++    if sysroot != "" or libdir != "":
++        return paths
+     devnull = open('/dev/null', 'w')
+     dpkg_architecture = subprocess.Popen(
+         ['dpkg-architecture', '-qDEB_HOST_MULTIARCH'],
+@@ -340,7 +345,7 @@ lib_path = []
+ dest_path = "DEST"
+ ldlib = "LDLIB"
+ include_default_lib_path = "yes"
+-default_lib_path = multiarch(["/lib/", "/usr/lib/", "/usr/X11R6/lib/"])
++default_lib_path = ["/lib/", "/usr/lib/", "/usr/X11R6/lib/"]
+ libc_extras_dir = "/usr/lib/libc_pic"
+ libc_extras_dir_default = True
+ libdir = "lib"
+@@ -386,7 +391,7 @@ for opt, arg in optlist:
+     elif opt == "--libdir":
+         libdir = arg
+     elif opt in ("--help", "-h"):
+-	usage(0)
++        usage(0)
+         sys.exit(0)
+     elif opt in ("--version", "-V"):
+         version(vers)
+@@ -395,6 +400,7 @@ for opt, arg in optlist:
+         print "WARNING: unknown option: " + opt + "\targ: " + arg
+ 
+ if include_default_lib_path == "yes":
++    default_lib_path = multiarch(default_lib_path)
+     lib_path.extend([a.replace("/lib/", "/" + libdir + "/") for a in default_lib_path])
+ 
+ if libc_extras_dir_default:
+@@ -661,16 +669,16 @@ ld_path_name = os.path.dirname(ldlib)
+ ld_full_path = "../" + ldlib
+ ld_file = find_lib(ld_file_name)
+ 
+-if ld_path_name != "/lib":
+-    if os.access(dest_path + "/" + ld_file_name, os.F_OK):
+-        os.remove(dest_path + "/" + ld_file_name)
++#if ld_path_name != "/lib":
++#    if os.access(dest_path + "/" + ld_file_name, os.F_OK):
++#        os.remove(dest_path + "/" + ld_file_name)
+ 
+-if not os.path.exists(dest_path + "/../" + ld_path_name):
+-    os.mkdir(dest_path + "/../" + ld_path_name)
++#if not os.path.exists(dest_path + "/../" + ld_path_name):
++#    os.mkdir(dest_path + "/../" + ld_path_name)
+ 
+-if not os.access(dest_path + "/" + ld_full_path, os.F_OK):
+-    debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_full_path)
++if not os.access(dest_path + "/" + ld_file_name, os.F_OK):
++    debug(DEBUG_NORMAL, "I: stripping and copying dynamic linker to " + ld_file_name)
+     command(target + "objcopy", "--strip-unneeded -R .note -R .comment",
+-            ld_file, dest_path + "/" + ld_full_path)
++            ld_file, dest_path + "/" + ld_file_name)
+ 
+-os.chmod(dest_path + "/" + ld_full_path, 0755)
++os.chmod(dest_path + "/" + ld_file_name, 0755)
diff --git a/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch b/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch
new file mode 100644
index 0000000..bc56593
--- /dev/null
+++ b/meta/recipes-devtools/mklibs/files/show-GNU-unique-symbols-as-provided-symbols.patch
@@ -0,0 +1,34 @@
+From eddf04c7f8312e9c29cdb24e431b7e4fb2cc70ed Mon Sep 17 00:00:00 2001
+From: Yuanjie Huang <yuanjie.huang@windriver.com>
+Date: Wed, 15 Apr 2015 14:00:06 +0800
+Subject: [PATCH] Show GNU unique symbols as provided symbols
+
+Upstream-Status: Submitted
+
+GNU Unique symbol is a GNU extension employed by new version of GCC
+by default. Even Standard C++ library in GCC 4.9 provides some symbols,
+such as _ZNSs4_Rep20_S_empty_rep_storageE in this binding type instead
+of ELF standard weak binding.
+This patch adds support of this new binding type to mklibs-readelf.
+
+Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
+---
+ src/mklibs-readelf/main.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mklibs-readelf/main.cpp b/src/mklibs-readelf/main.cpp
+index 56d93f8..0134530 100644
+--- a/src/mklibs-readelf/main.cpp
++++ b/src/mklibs-readelf/main.cpp
+@@ -88,7 +88,7 @@ static void process_symbols_provided (const Elf::section_type<Elf::section_type_
+     uint8_t type = symbol->get_type ();
+     const std::string &name = symbol->get_name_string ();
+ 
+-    if (bind != STB_GLOBAL && bind != STB_WEAK)
++    if (bind != STB_GLOBAL && bind != STB_WEAK && bind != STB_GNU_UNIQUE)
+       continue;
+     if (shndx == SHN_UNDEF || shndx == SHN_ABS)
+       continue;
+-- 
+1.8.5.2.233.g932f7e4
+
diff --git a/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch b/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch
new file mode 100644
index 0000000..75500a0
--- /dev/null
+++ b/meta/recipes-devtools/mklibs/files/sysrooted-ldso.patch
@@ -0,0 +1,18 @@
+In cross builds we will have to respect sysroot
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: mklibs-0.1.39/src/mklibs
+===================================================================
+--- mklibs-0.1.39.orig/src/mklibs	2014-03-01 18:25:36.000000000 +0000
++++ mklibs-0.1.39/src/mklibs	2014-10-19 00:51:46.813534596 +0000
+@@ -495,7 +495,7 @@
+     present_symbols = {}
+     checked_libs = small_libs
+     checked_libs.extend(available_libs)
+-    checked_libs.append(ldlib)
++    checked_libs.append(sysroot + ldlib)
+     for lib in checked_libs:
+         for symbol in provided_symbols(lib):
+             debug(DEBUG_SPAM, "present_symbols adding %s" % symbol)
diff --git a/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb b/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb
new file mode 100644
index 0000000..59fec29
--- /dev/null
+++ b/meta/recipes-devtools/mklibs/mklibs-native_0.1.40.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Shared library optimisation tool"
+DESCRIPTION = "mklibs produces cut-down shared libraries that contain only the routines required by a particular set of executables."
+HOMEPAGE = "https://launchpad.net/mklibs"
+SECTION = "devel"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=98d31037b13d896e33890738ef01af64"
+DEPENDS = "python-native"
+
+SRC_URI = "http://ftp.de.debian.org/debian/pool/main/m/mklibs/${BPN}_${PV}.tar.xz \
+	file://ac_init_fix.patch\
+	file://fix_STT_GNU_IFUNC.patch\
+	file://sysrooted-ldso.patch \
+	file://avoid-failure-on-symbol-provided-by-application.patch \
+	file://show-GNU-unique-symbols-as-provided-symbols.patch \
+	file://fix_cross_compile.patch \
+"
+
+SRC_URI[md5sum] = "e1dafe5f962caa9dc5f2651c0723812a"
+SRC_URI[sha256sum] = "1db24ae779d21ccfed49f22e49a2b7ee43ec0e9197bc206d81cd02f96e91e125"
+
+inherit autotools gettext native pythonnative
diff --git a/meta/recipes-devtools/mmc/mmc-utils/0001-mmc.h-don-t-include-asm-generic-int-ll64.h.patch b/meta/recipes-devtools/mmc/mmc-utils/0001-mmc.h-don-t-include-asm-generic-int-ll64.h.patch
new file mode 100644
index 0000000..1724de5
--- /dev/null
+++ b/meta/recipes-devtools/mmc/mmc-utils/0001-mmc.h-don-t-include-asm-generic-int-ll64.h.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+mmc.h: don't include <asm-generic/int-ll64.h>
+
+Including this file causes a compile failure for qemumips64.
+This file is not needed to be explicitly included, because it will be
+included by the <linux/mmc/ioctl.h> file if _MIPS_SZLONG is not 64.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ mmc.h |    1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/mmc.h b/mmc.h
+index 9871d62..3df2cdf 100644
+--- a/mmc.h
++++ b/mmc.h
+@@ -14,7 +14,6 @@
+  * Boston, MA 021110-1307, USA.
+  */
+ 
+-#include <asm-generic/int-ll64.h>
+ #include <linux/mmc/ioctl.h>
+ #include <stdio.h>
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/mmc/mmc-utils_git.bb b/meta/recipes-devtools/mmc/mmc-utils_git.bb
new file mode 100644
index 0000000..8950360
--- /dev/null
+++ b/meta/recipes-devtools/mmc/mmc-utils_git.bb
@@ -0,0 +1,23 @@
+DESCRIPTION = "Userspace tools for MMC/SD devices"
+HOMEPAGE = "http://git.kernel.org/cgit/linux/kernel/git/cjb/mmc-utils.git/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://mmc.c;beginline=1;endline=17;md5=d7747fc87f1eb22b946ef819969503f0"
+
+BRANCH ?= "master"
+SRCREV = "f4eb241519f8d500ce6068a70d2389be39ac5189"
+
+PV = "0.1"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc-utils.git;branch=${BRANCH} \
+           file://0001-mmc.h-don-t-include-asm-generic-int-ll64.h.patch"
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend() {
+    sed -i "s:-Werror::g" ${S}/Makefile
+}
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 mmc ${D}${bindir}
+}
diff --git a/meta/recipes-devtools/mtd/mtd-utils/0001-hashtable-Remove-duplicate-hashtable_iterator_value-.patch b/meta/recipes-devtools/mtd/mtd-utils/0001-hashtable-Remove-duplicate-hashtable_iterator_value-.patch
new file mode 100644
index 0000000..2d36158
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/0001-hashtable-Remove-duplicate-hashtable_iterator_value-.patch
@@ -0,0 +1,64 @@
+From b856ff35c20124ceae40bbc4d32584df47618c96 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 25 Feb 2015 09:28:26 +0000
+Subject: [PATCH] hashtable: Remove duplicate hashtable_iterator_value/hashtable_iterator_key
+
+gcc5 is defaulting to gnu11 instead of gnu89 like previous versions
+as a result the semantics of 'extern inline' changes where in gnu89 for 'extern inline' no external
+visible function is generated,in c99 'external inline' generates externally visible function
+there is no equivalent in c99+ because redefinitions arent allowed
+but 'static inline' remains same for for c89 and c99+, thats why we change the semantics
+so we make the functions static inline, and achieve the same effect
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: pending
+
+---
+ mkfs.ubifs/hashtable/hashtable_itr.c | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+Index: git/mkfs.ubifs/hashtable/hashtable_itr.h
+===================================================================
+--- git.orig/mkfs.ubifs/hashtable/hashtable_itr.h
++++ git/mkfs.ubifs/hashtable/hashtable_itr.h
+@@ -28,7 +28,7 @@ hashtable_iterator(struct hashtable *h);
+ /* hashtable_iterator_key
+  * - return the value of the (key,value) pair at the current position */
+ 
+-extern inline void *
++static inline void *
+ hashtable_iterator_key(struct hashtable_itr *i)
+ {
+     return i->e->k;
+@@ -37,7 +37,7 @@ hashtable_iterator_key(struct hashtable_
+ /*****************************************************************************/
+ /* value - return the value of the (key,value) pair at the current position */
+ 
+-extern inline void *
++static inline void *
+ hashtable_iterator_value(struct hashtable_itr *i)
+ {
+     return i->e->v;
+Index: git/mkfs.ubifs/hashtable/hashtable_itr.c
+===================================================================
+--- git.orig/mkfs.ubifs/hashtable/hashtable_itr.c
++++ git/mkfs.ubifs/hashtable/hashtable_itr.c
+@@ -35,18 +35,6 @@ hashtable_iterator(struct hashtable *h)
+ }
+ 
+ /*****************************************************************************/
+-/* key      - return the key of the (key,value) pair at the current position */
+-/* value    - return the value of the (key,value) pair at the current position */
+-
+-void *
+-hashtable_iterator_key(struct hashtable_itr *i)
+-{ return i->e->k; }
+-
+-void *
+-hashtable_iterator_value(struct hashtable_itr *i)
+-{ return i->e->v; }
+-
+-/*****************************************************************************/
+ /* advance - advance the iterator to the next element
+  *           returns zero if advanced to end of table */
+ 
diff --git a/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch b/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
new file mode 100644
index 0000000..57d6a30
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/add-exclusion-to-mkfs-jffs2-git-2.patch
@@ -0,0 +1,103 @@
+Upstream-Status: Pending
+
+--- /tmp/mkfs.jffs2.c	2009-01-11 15:28:41.000000000 +0100
++++ git/mkfs.jffs2.c	2009-01-11 15:59:29.000000000 +0100
+@@ -100,6 +100,11 @@
+ 	struct rb_node hardlink_rb;
+ };
+ 
++struct ignorepath_entry {
++	struct ignorepath_entry* next;  /* Points to the next ignorepath element */
++	char name[PATH_MAX];        /* Name of the entry */
++};
++static struct ignorepath_entry* ignorepath = 0;
+ struct rb_root hardlinks;
+ static int out_fd = -1;
+ static int in_fd = -1;
+@@ -408,7 +413,7 @@
+ 	char *hpath, *tpath;
+ 	struct dirent *dp, **namelist;
+ 	struct filesystem_entry *entry;
+-
++	struct ignorepath_entry* element = ignorepath;
+ 
+ 	if (lstat(hostpath, &sb)) {
+ 		perror_msg_and_die("%s", hostpath);
+@@ -417,6 +422,15 @@
+ 	entry = add_host_filesystem_entry(targetpath, hostpath,
+ 			sb.st_uid, sb.st_gid, sb.st_mode, 0, parent);
+ 
++	while ( element ) {
++		if ( strcmp( element->name, targetpath ) == 0 ) {
++			printf( "Note: ignoring directories below '%s'\n", targetpath );
++			return entry;
++			break;
++		}
++		element = element->next;
++	}
++
+ 	n = scandir(hostpath, &namelist, 0, alphasort);
+ 	if (n < 0) {
+ 		perror_msg_and_die("opening directory %s", hostpath);
+@@ -1453,6 +1467,7 @@
+ 	{"root", 1, NULL, 'r'},
+ 	{"pagesize", 1, NULL, 's'},
+ 	{"eraseblock", 1, NULL, 'e'},
++	{"ignore", 1, NULL, 'I'},
+ 	{"output", 1, NULL, 'o'},
+ 	{"help", 0, NULL, 'h'},
+ 	{"verbose", 0, NULL, 'v'},
+@@ -1500,6 +1515,7 @@
+ "  -L, --list-compressors  Show the list of the avaiable compressors\n"
+ "  -t, --test-compression  Call decompress and compare with the original (for test)\n"
+ "  -n, --no-cleanmarkers   Don't add a cleanmarker to every eraseblock\n"
++"  -I, --ignore=PATH       Ignore sub directory and file tree below PATH when recursing over the file system\n"
+ "  -o, --output=FILE       Output to FILE (default: stdout)\n"
+ "  -l, --little-endian     Create a little-endian filesystem\n"
+ "  -b, --big-endian        Create a big-endian filesystem\n"
+@@ -1666,6 +1682,7 @@
+ 	char *compr_name = NULL;
+ 	int compr_prior  = -1;
+ 	int warn_page_size = 0;
++	struct ignorepath_entry* element = ignorepath;
+ 
+ 	page_size = sysconf(_SC_PAGESIZE);
+ 	if (page_size < 0) /* System doesn't know so ... */
+@@ -1676,7 +1693,7 @@
+ 	jffs2_compressors_init();
+ 
+ 	while ((opt = getopt_long(argc, argv,
+-					"D:d:r:s:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
++					"D:d:r:s:I:o:qUPfh?vVe:lbp::nc:m:x:X:Lty:i:", long_options, &c)) >= 0)
+ 	{
+ 		switch (opt) {
+ 			case 'D':
+@@ -1700,6 +1717,28 @@
+ 				warn_page_size = 0; /* set by user, so don't need to warn */
+ 				break;
+ 
++			case 'I':
++				printf( "Note: Adding '%s' to ignore Path\n", optarg );
++				element = ignorepath;
++				if ( !ignorepath ) {
++					ignorepath = xmalloc( sizeof( struct ignorepath_entry ) );
++					ignorepath->next = 0;
++					strcpy( &ignorepath->name[0], optarg );
++				} else {
++					while ( element->next ) element = element->next;
++					element->next = xmalloc( sizeof( struct ignorepath_entry ) );
++ 					element->next->next = 0;
++					strcpy( &element->next->name[0], optarg );
++				}
++				printf( "--------- Dumping ignore path list ----------------\n" );
++				element = ignorepath;
++				while ( element ) {
++					printf( "  * '%s'\n", &element->name[0] );
++					element = element->next;
++				}
++				printf( "---------------------------------------------------\n" );
++				break;
++
+ 			case 'o':
+ 				if (out_fd != -1) {
+ 					error_msg_and_die("output filename specified more than once");
diff --git a/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
new file mode 100644
index 0000000..05f1629
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/fix-armv7-neon-alignment.patch
@@ -0,0 +1,44 @@
+Upstream-Status: Pending
+
+NEON instruction VLD1.64 was used to copy 64 bits data after type
+casting, and they will trigger alignment trap.
+This patch uses memcpy to avoid alignment problem.
+
+Signed-off-by: Yuanjie Huang <Yuanjie.Huang@windriver.com>
+
+diff --git a/mkfs.ubifs/key.h b/mkfs.ubifs/key.h
+index d3a02d4..e7e9218 100644
+--- a/mkfs.ubifs/key.h
++++ b/mkfs.ubifs/key.h
+@@ -141,10 +141,12 @@ static inline void data_key_init(union ubifs_key *key, ino_t inum,
+  */
+ static inline void key_write(const union ubifs_key *from, void *to)
+ {
+-	union ubifs_key *t = to;
++	__le32 x[2];
+ 
+-	t->j32[0] = cpu_to_le32(from->u32[0]);
+-	t->j32[1] = cpu_to_le32(from->u32[1]);
++	x[0] = cpu_to_le32(from->u32[0]);
++	x[1] = cpu_to_le32(from->u32[1]);
++
++	memcpy(to, &x, 8);
+ 	memset(to + 8, 0, UBIFS_MAX_KEY_LEN - 8);
+ }
+ 
+@@ -156,10 +158,12 @@ static inline void key_write(const union ubifs_key *from, void *to)
+  */
+ static inline void key_write_idx(const union ubifs_key *from, void *to)
+ {
+-	union ubifs_key *t = to;
++	__le32 x[2];
++
++	x[0] = cpu_to_le32(from->u32[0]);
++	x[1] = cpu_to_le32(from->u32[1]);
+ 
+-	t->j32[0] = cpu_to_le32(from->u32[0]);
+-	t->j32[1] = cpu_to_le32(from->u32[1]);
++	memcpy(to, &x, 8);
+ }
+ 
+ /**
diff --git a/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch b/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
new file mode 100644
index 0000000..7207cfc
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils/mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch
@@ -0,0 +1,137 @@
+Upstream-Status: Pending
+From patchwork Mon Aug  8 08:16:43 2011
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: mtd-utils: fix corrupt cleanmarker with flash_erase -j command
+Date: Sun, 07 Aug 2011 22:16:43 -0000
+From: b35362@freescale.com
+X-Patchwork-Id: 108873
+Message-Id: <1312791403-13473-1-git-send-email-b35362@freescale.com>
+To: <dwmw2@infradead.org>
+Cc: Liu Shuo <b35362@freescale.com>, Artem.Bityutskiy@nokia.com,
+ Li Yang <leoli@freescale.com>, linux-mtd@lists.infradead.org
+
+From: Liu Shuo <b35362@freescale.com>
+
+Flash_erase -j should fill discrete freeoob areas with required bytes
+of JFFS2 cleanmarker in jffs2_check_nand_cleanmarker(). Not just fill
+the first freeoob area.
+
+The below is the result without this workaround:
+
+JFFS2: Erase block at 0x00000000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00004000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00008000 is not formatted. It will be erased
+JFFS2: Erase block at 0x0000c000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00010000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00014000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00018000 is not formatted. It will be erased
+JFFS2: Erase block at 0x0001c000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00020000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00024000 is not formatted. It will be erased
+JFFS2: Erase block at 0x00028000 is not formatted. It will be erased
+...
+
+Signed-off-by: Liu Shuo <b35362@freescale.com>
+Signed-off-by: Li Yang <leoli@freescale.com>
+
+Updated for the new version
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+---
+v2 : get length of availble freeoob bytes from oobinfo information,
+      not use the ioctl ECCGETLAYOUT which is being deprecated.
+
+ flash_erase.c |   46 +++++++++++++++++++++++++++++++++++++++-------
+ 1 files changed, 39 insertions(+), 7 deletions(-)
+
+diff --git a/flash_erase.c b/flash_erase.c
+index 933373a..4b9d84b 100644
+--- a/flash_erase.c
++++ b/flash_erase.c
+@@ -99,6 +99,7 @@ int main(int argc, char *argv[])
+ 	bool isNAND;
+ 	int error = 0;
+ 	off_t offset = 0;
++	void *oob_data = NULL;
+ 
+ 	/*
+ 	 * Process user arguments
+@@ -201,15 +202,43 @@ int main(int argc, char *argv[])
+ 			if (ioctl(fd, MEMGETOOBSEL, &oobinfo) != 0)
+ 				return sys_errmsg("%s: unable to get NAND oobinfo", mtd_device);
+ 
++			cleanmarker.totlen = cpu_to_je32(8);
+ 			/* Check for autoplacement */
+ 			if (oobinfo.useecc == MTD_NANDECC_AUTOPLACE) {
+-				/* Get the position of the free bytes */
+-				if (!oobinfo.oobfree[0][1])
++				struct nand_ecclayout_user ecclayout;
++				int i, oobavail;
++
++				for (i = 0, oobavail = 0; oobinfo.oobfree[i][1]; i++)
++					oobavail += oobinfo.oobfree[i][1];
++
++				if (!oobavail)
+ 					return errmsg(" Eeep. Autoplacement selected and no empty space in oob");
++
++				/* Get the position of the free bytes */
+ 				clmpos = oobinfo.oobfree[0][0];
+-				clmlen = oobinfo.oobfree[0][1];
+-				if (clmlen > 8)
+-					clmlen = 8;
++				clmlen = MIN(oobavail, 8);
++
++				if (oobinfo.oobfree[0][1] < 8 && oobavail >= 8) {
++					int left, n, last = 0;
++					void *cm;
++
++					oob_data = malloc(mtd.oob_size);
++					if (!oob_data)
++						return -ENOMEM;
++
++					memset(oob_data, 0xff, mtd.oob_size);
++					cm = &cleanmarker;
++					for (i = 0, left = clmlen; left ; i++) {
++						n = MIN(left, oobinfo.oobfree[i][1]);
++						memcpy(oob_data + oobinfo.oobfree[i][0],
++								cm, n);
++						left -= n;
++						cm   += n;
++						last = oobinfo.oobfree[i][0] + n;
++					}
++
++					clmlen = last - clmpos;
++				}
+ 			} else {
+ 				/* Legacy mode */
+ 				switch (mtd.oob_size) {
+@@ -227,7 +256,6 @@ int main(int argc, char *argv[])
+ 						break;
+ 				}
+ 			}
+-			cleanmarker.totlen = cpu_to_je32(8);
+ 		}
+ 		cleanmarker.hdr_crc = cpu_to_je32(mtd_crc32(0, &cleanmarker, sizeof(cleanmarker) - 4));
+ 	}
+@@ -276,7 +304,8 @@ int main(int argc, char *argv[])
+ 
+ 		/* write cleanmarker */
+ 		if (isNAND) {
+-			if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, &cleanmarker) != 0) {
++			void *data = oob_data ? oob_data + clmpos : &cleanmarker;
++			if (mtd_write_oob(mtd_desc, &mtd, fd, (uint64_t)offset + clmpos, clmlen, data) != 0) {
+ 				sys_errmsg("%s: MTD writeoob failure", mtd_device);
+ 				continue;
+ 			}
+@@ -291,5 +320,8 @@ int main(int argc, char *argv[])
+ 	show_progress(&mtd, offset, eb, eb_start, eb_cnt);
+ 	bareverbose(!quiet, "\n");
+ 
++	if (oob_data)
++		free(oob_data);
++
+ 	return 0;
+ }
diff --git a/meta/recipes-devtools/mtd/mtd-utils_git.bb b/meta/recipes-devtools/mtd/mtd-utils_git.bb
new file mode 100644
index 0000000..17dca77
--- /dev/null
+++ b/meta/recipes-devtools/mtd/mtd-utils_git.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Tools for managing memory technology devices"
+HOMEPAGE = "http://www.linux-mtd.infradead.org/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+                    file://include/common.h;beginline=1;endline=17;md5=ba05b07912a44ea2bf81ce409380049c"
+
+DEPENDS = "zlib lzo e2fsprogs util-linux"
+
+PV = "1.5.1+git${SRCPV}"
+
+SRCREV = "9f107132a6a073cce37434ca9cda6917dd8d866b"
+SRC_URI = "git://git.infradead.org/mtd-utils.git \
+           file://add-exclusion-to-mkfs-jffs2-git-2.patch \
+           file://fix-armv7-neon-alignment.patch \
+           file://0001-hashtable-Remove-duplicate-hashtable_iterator_value-.patch \
+           file://mtd-utils-fix-corrupt-cleanmarker-with-flash_erase--j-command.patch \
+"
+
+S = "${WORKDIR}/git/"
+
+# xattr support creates an additional compile-time dependency on acl because
+# the sys/acl.h header is needed. libacl is not needed and thus enabling xattr
+# regardless whether acl is enabled or disabled in the distro should be okay.
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG[xattr] = ",,acl,"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} ${@bb.utils.contains('PACKAGECONFIG', 'xattr', '', '-DWITHOUT_XATTR', d)} -I${S}/include' 'BUILDDIR=${S}'"
+
+do_install () {
+	oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}
+}
+
+PACKAGES =+ "mtd-utils-jffs2 mtd-utils-ubifs mtd-utils-misc"
+
+FILES_mtd-utils-jffs2 = "${sbindir}/mkfs.jffs2 ${sbindir}/jffs2dump ${sbindir}/jffs2reader ${sbindir}/sumtool"
+FILES_mtd-utils-ubifs = "${sbindir}/mkfs.ubifs ${sbindir}/ubi*"
+FILES_mtd-utils-misc = "${sbindir}/nftl* ${sbindir}/ftl* ${sbindir}/rfd* ${sbindir}/doc* ${sbindir}/serve_image ${sbindir}/recv_image"
+
+BBCLASSEXTEND = "native"
+
+# git/.compr.c.dep:46: warning: NUL character seen; rest of line ignored
+# git/.compr.c.dep:47: *** missing separator.  Stop.
+PARALLEL_MAKE = ""
diff --git a/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch b/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch
new file mode 100644
index 0000000..cb45491
--- /dev/null
+++ b/meta/recipes-devtools/mtools/mtools/fix-broken-lz.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport
+
+Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ Makefile.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Makefile.in b/Makefile.in
+index 8f9305a..694e837 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -251,6 +251,7 @@ install-scripts: ${DESTDIR}$(bindir)/mtools
+ 	@$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
+ 	@for j in $(SCRIPTS) ; do \
+ 		$(INSTALL_SCRIPT) $(srcdir)/scripts/$$j ${DESTDIR}$(bindir)/$$j ; \
++		$(INSTALL_PROGRAM) $(srcdir)/scripts/$$j ${DESTDIR}$(bindir)/$$j ; \
+ 		echo ${DESTDIR}$(bindir)/$$j ; \
+ 	done
+ 	rm -f ${DESTDIR}$(bindir)/lz
+-- 
+2.0.0
+
diff --git a/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch b/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch
new file mode 100644
index 0000000..2e2873a
--- /dev/null
+++ b/meta/recipes-devtools/mtools/mtools/mtools-makeinfo.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Inappropriate [licensing]
+
+--- mtools-3.9.9/configure.in.orig	2006-04-14 16:05:54.337655192 -0600
++++ mtools-3.9.9/configure.in	2006-04-14 16:12:29.736545424 -0600
+@@ -21,6 +21,33 @@
+ AC_C_CONST
+ AC_C_INLINE
+ 
++AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
++if test "x$MAKEINFO" = "x"; then
++	MAKEINFO="@echo makeinfo missing; true"
++fi
++AC_CHECK_PROG(TEXI2DVI, texi2dvi, texi2dvi, )
++if test "x$TEXI2DVI" = "x"; then
++	TEXI2DVI="@echo texi2dvi missing; true"
++fi
++AC_CHECK_PROG(TEXI2PDF, texi2pdf, texi2pdf, )
++if test "x$TEXI2PDF" = "x"; then
++	TEXI2PDF="@echo texi2pdf missing; true"
++fi
++AC_CHECK_PROG(TEXI2HTML, texi2html, texi2html, )
++if test "x$TEXI2HTML" = "x"; then
++	TEXI2HTML="@echo texi2html missing; true"
++fi    
++AC_CHECK_PROG(DVI2PS, dvi2ps, dvi2ps, )
++if test "x$DVI2PS" = "x"; then
++	DVI2PS="@echo dvi2ps missing; true"
++fi
++
++AC_SUBST(MAKEINFO)
++AC_SUBST(TEXI2DVI)
++AC_SUBST(TEXI2PDF)
++AC_SUBST(TEXI2HTML)
++AC_SUBST(DVI2PS)
++
+ 
+ dnl Check for configuration options
+ dnl Enable OS/2 extended density format disks
+--- mtools-3.9.9/Makefile.in.sav	2006-04-14 15:56:19.000000000 -0600
++++ mtools-3.9.9/Makefile.in	2006-04-14 16:15:29.315245312 -0600
+@@ -11,10 +11,11 @@
+ USERLDFLAGS =
+ USERLDLIBS =
+ 
+-MAKEINFO = makeinfo
+-TEXI2DVI = texi2dvi
+-TEXI2PDF = texi2pdf
+-TEXI2HTML = texi2html
++MAKEINFO = @MAKEINFO@
++TEXI2DVI = @TEXI2DVI@
++TEXI2PDF = @TEXI2PDF@
++TEXI2HTML = @TEXI2HTML@
++DVI2PS = @DVI2PS@
+ 
+ 
+ # do not edit below this line
+@@ -181,7 +182,7 @@
+ 
+ ps: mtools.ps
+ %.ps: %.dvi
+-	dvips -f < $< > $@
++	$(DVI2PS) -f < $< > $@
+ 
+ pdf: mtools.pdf
+ %.pdf: %.texi
diff --git a/meta/recipes-devtools/mtools/mtools/mtools.patch b/meta/recipes-devtools/mtools/mtools/mtools.patch
new file mode 100644
index 0000000..15a3208
--- /dev/null
+++ b/meta/recipes-devtools/mtools/mtools/mtools.patch
@@ -0,0 +1,129 @@
+$NetBSD: patch-aa,v 1.10 2007/08/17 20:55:34 joerg Exp $
+
+---
+ Makefile.in |   74 ++++++++++++++++++++++++++----------------------------------
+ 1 file changed, 33 insertions(+), 41 deletions(-)
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: mtools-3.9.9/Makefile.in
+===================================================================
+--- mtools-3.9.9.orig/Makefile.in	2007-10-12 11:18:46.000000000 +0100
++++ mtools-3.9.9/Makefile.in	2007-10-12 11:28:14.000000000 +0100
+@@ -195,30 +195,22 @@ html: mtools.html mtools_toc.html
+ 
+ # Don't cd, to avoid breaking install-sh references.
+ install-info: info
+-	$(top_srcdir)/mkinstalldirs $(infodir)
++	$(top_srcdir)/mkinstalldirs ${DESTDIR}$(infodir)
+ 	if test -f mtools.info; then \
+ 	  for i in mtools.info*; do \
+-	    $(INSTALL_DATA) $$i $(infodir)/$$i; \
++	    $(INSTALL_DATA) $$i ${DESTDIR}$(infodir)/$$i; \
+ 	  done; \
+ 	else \
+ 	  for i in $(srcdir)/mtools.info*; do \
+-	    $(INSTALL_DATA) $$i $(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
++	    $(INSTALL_DATA) $$i ${DESTDIR}$(infodir)/`echo $$i | sed 's|^$(srcdir)/||'`; \
+ 	  done; \
+ 	fi; \
+-	if [ -n "$(INSTALL_INFO)" ] ; then \
+-		if [ -f $(infodir)/dir.info ] ; then \
+-			$(INSTALL_INFO) $(infodir)/mtools.info $(infodir)/dir.info; \
+-		fi; \
+-		if [ -f $(infodir)/dir ] ; then \
+-			$(INSTALL_INFO) $(infodir)/mtools.info $(infodir)/dir; \
+-		fi; \
+-	fi
+ 
+ uninstall-info:
+ 	cd $(infodir) && rm -f mtools.info*
+ 
+-install:	$(bindir)/mtools @BINFLOPPYD@ install-man install-links \
+-		$(bindir)/mkmanifest install-scripts install-info
++install:	${DESTDIR}$(bindir)/mtools ${DESTDIR}$(bindir)/floppyd install-man install-links \
++		${DESTDIR}$(bindir)/mkmanifest install-scripts install-info
+ 
+ uninstall:	uninstall-bin uninstall-man uninstall-links \
+ 		uninstall-scripts
+@@ -228,52 +220,52 @@ distclean: clean texclean
+ maintainer-clean: distclean
+ 
+ 
+-$(bindir)/floppyd: floppyd
+-	$(top_srcdir)/mkinstalldirs $(bindir)
+-	$(INSTALL_PROGRAM) floppyd $(bindir)/floppyd
++${DESTDIR}$(bindir)/floppyd: floppyd
++	$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
++	$(INSTALL_PROGRAM) floppyd ${DESTDIR}$(bindir)/floppyd
+ 
+-$(bindir)/floppyd_installtest: floppyd_installtest
+-	$(top_srcdir)/mkinstalldirs $(bindir)
+-	$(INSTALL_PROGRAM) floppyd_installtest $(bindir)/floppyd_installtest
++${DESTDIR}$(bindir)/floppyd_installtest: floppyd_installtest
++	$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
++	$(INSTALL_PROGRAM) floppyd_installtest ${DESTDIR}$(bindir)/floppyd_installtest
+ 
+-$(bindir)/mtools: mtools
+-	$(top_srcdir)/mkinstalldirs $(bindir)
+-	$(INSTALL_PROGRAM) mtools $(bindir)/mtools
++${DESTDIR}$(bindir)/mtools: mtools
++	$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
++	$(INSTALL_PROGRAM) mtools ${DESTDIR}$(bindir)/mtools
+ 
+-$(bindir)/mkmanifest: mkmanifest
+-	$(top_srcdir)/mkinstalldirs $(bindir)
+-	$(INSTALL_PROGRAM) mkmanifest $(bindir)/mkmanifest
++${DESTDIR}$(bindir)/mkmanifest: mkmanifest
++	$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
++	$(INSTALL_PROGRAM) mkmanifest ${DESTDIR}$(bindir)/mkmanifest
+ 
+ #$(ETCDIR)/mtools: mtools.etc
+ #	cp mtools.etc $(ETCDIR)/mtools
+ 
+-install-links: $(bindir)/mtools
++install-links: ${DESTDIR}$(bindir)/mtools
+ 	@for j in $(LINKS); do \
+-		rm -f $(bindir)/$$j ; \
+-		$(LN_S) mtools $(bindir)/$$j ; \
+-		echo $(bindir)/$$j ; \
++		rm -f ${DESTDIR}$(bindir)/$$j ; \
++		$(LN_S) mtools ${DESTDIR}$(bindir)/$$j ; \
++		echo ${DESTDIR}$(bindir)/$$j ; \
+ 	done
+ 
+ ## "z" is the older version of "gz"; the name is just *too* short
+-install-scripts: $(bindir)/mtools
+-	@$(top_srcdir)/mkinstalldirs $(bindir)
++install-scripts: ${DESTDIR}$(bindir)/mtools
++	@$(top_srcdir)/mkinstalldirs ${DESTDIR}$(bindir)
+ 	@for j in $(SCRIPTS) ; do \
+-		$(INSTALL_PROGRAM) $(srcdir)/scripts/$$j $(bindir)/$$j ; \
+-		echo $(bindir)/$$j ; \
++		$(INSTALL_SCRIPT) $(srcdir)/scripts/$$j ${DESTDIR}$(bindir)/$$j ; \
++		echo ${DESTDIR}$(bindir)/$$j ; \
+ 	done
+-	rm -f $(bindir)/lz
+-	$(LN_S) uz $(bindir)/lz
++	rm -f ${DESTDIR}$(bindir)/lz
++	$(LN_S) uz ${DESTDIR}$(bindir)/lz
+ 
+ install-man:
+-	@$(top_srcdir)/mkinstalldirs $(MAN1DIR)
++	@$(top_srcdir)/mkinstalldirs ${DESTDIR}$(MAN1DIR)
+ 	@for j in $(MAN1); do \
+-		$(INSTALL_DATA) $(srcdir)/$$j $(MAN1DIR)/$$j ; \
+-		echo $(MAN1DIR)/$$j ; \
++		$(INSTALL_DATA) $(srcdir)/$$j ${DESTDIR}$(MAN1DIR)/$$j ; \
++		echo ${DESTDIR}$(MAN1DIR)/$$j ; \
+ 	done
+-	@$(top_srcdir)/mkinstalldirs $(MAN5DIR)
++	@$(top_srcdir)/mkinstalldirs ${DESTDIR}$(MAN5DIR)
+ 	@for j in $(MAN5); do \
+-		$(INSTALL_DATA) $(srcdir)/$$j $(MAN5DIR)/$$j ; \
+-		echo $(MAN5DIR)/$$j ; \
++		$(INSTALL_DATA) $(srcdir)/$$j ${DESTDIR}$(MAN5DIR)/$$j ; \
++		echo ${DESTDIR}$(MAN5DIR)/$$j ; \
+ 	done
+ 
+ uninstall-bin:
diff --git a/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch b/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch
new file mode 100644
index 0000000..9cb3e39
--- /dev/null
+++ b/meta/recipes-devtools/mtools/mtools/no-x11.gplv3.patch
@@ -0,0 +1,18 @@
+Disable building with X11 support.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN mtools-4.0.15.orig//Makefile.in mtools-4.0.15//Makefile.in
+--- mtools-4.0.15.orig//Makefile.in	2010-10-17 08:41:09.000000000 -0700
++++ mtools-4.0.15//Makefile.in	2010-11-23 13:59:49.258258374 -0800
+@@ -146,7 +146,7 @@
+ CXXFLAGS  = $(CPPFLAGS) $(DEFS) $(MYCXXFLAGS) -I. @extraincludedir@ -I@srcdir@ $(USERCFLAGS)
+ LINK      = $(CC) $(LDFLAGS) $(USERLDFLAGS) @extralibdir@
+ ALLLIBS   = $(USERLDLIBS) $(MACHDEPLIBS) $(SHLIB) $(LIBS)
+-X_LDFLAGS = $(X_EXTRA_LIBS) $(X_LIBS) -lXau -lX11 $(LIBS)
++X_LDFLAGS = $(X_EXTRA_LIBS) $(X_LIBS) $(LIBS)
+ X_CCFLAGS = $(X_CFLAGS) $(CFLAGS)
+ 
+ all:    mtools $(LINKS) mkmanifest @FLOPPYD@ mtools.1 mtools.5
diff --git a/meta/recipes-devtools/mtools/mtools/no-x11.patch b/meta/recipes-devtools/mtools/mtools/no-x11.patch
new file mode 100644
index 0000000..705b629
--- /dev/null
+++ b/meta/recipes-devtools/mtools/mtools/no-x11.patch
@@ -0,0 +1,21 @@
+---
+ Makefile.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Upstream-Status: Inappropriate [licensing]
+
+--- mtools-3.9.9.orig/Makefile.in
++++ mtools-3.9.9/Makefile.in
+@@ -128,11 +128,11 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@
+ X_PRE_LIBS = @X_PRE_LIBS@
+ CFLAGS = $(CPPFLAGS) $(DEFS) $(MYCFLAGS) -I. @extraincludedir@ -I@srcdir@ $(USERCFLAGS) 
+ CXXFLAGS  = $(CPPFLAGS) $(DEFS) $(MYCXXFLAGS) -I. @extraincludedir@ -I@srcdir@ $(USERCFLAGS) 
+ LINK      = $(CC) $(LDFLAGS) $(USERLDFLAGS) @extralibdir@
+ ALLLIBS   = $(USERLDLIBS) $(MACHDEPLIBS) $(SHLIB) $(LIBS)
+-X_LDFLAGS = $(X_EXTRA_LIBS) $(X_LIBS) $(X_PRE_LIBS) -lXau -lX11 $(LIBS) 
++X_LDFLAGS = $(X_EXTRA_LIBS) $(X_LIBS) $(X_PRE_LIBS) $(LIBS)
+ X_CCFLAGS = $(X_CFLAGS) $(CFLAGS)
+ 
+ all:    mtools $(LINKS) mkmanifest @FLOPPYD@
+ 
+ %.o: %.c
diff --git a/meta/recipes-devtools/mtools/mtools_3.9.9.bb b/meta/recipes-devtools/mtools/mtools_3.9.9.bb
new file mode 100644
index 0000000..c284a71
--- /dev/null
+++ b/meta/recipes-devtools/mtools/mtools_3.9.9.bb
@@ -0,0 +1,56 @@
+# mtools OE build file
+# Copyright (C) 2004-2006, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+SUMMARY = "Utilities to access MS-DOS disks without mounting them"
+DESCRIPTION = "Mtools is a collection of utilities for accessing MS-DOS disks from Unix without mounting them."
+HOMEPAGE = "http://www.gnu.org/software/mtools/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=92b58ec77696788ce278b044d2a8e9d3"
+PR = "r6"
+
+RDEPENDS_${PN} = "glibc-gconv-ibm850"
+RRECOMMENDS_${PN} = "\
+	glibc-gconv-ibm437 \
+	glibc-gconv-ibm737 \
+	glibc-gconv-ibm775 \
+	glibc-gconv-ibm851 \
+	glibc-gconv-ibm852 \
+	glibc-gconv-ibm855 \
+	glibc-gconv-ibm857 \
+	glibc-gconv-ibm860 \
+	glibc-gconv-ibm861 \
+	glibc-gconv-ibm862 \
+	glibc-gconv-ibm863 \
+	glibc-gconv-ibm865 \
+	glibc-gconv-ibm866 \
+	glibc-gconv-ibm869 \
+	"
+
+#http://mtools.linux.lu/mtools-${PV}.tar.gz 
+SRC_URI = "http://downloads.yoctoproject.org/mirror/sources/mtools-${PV}.tar.gz \
+	file://mtools-makeinfo.patch \
+	file://mtools.patch \
+	file://no-x11.patch \
+	file://fix-broken-lz.patch \
+"
+
+SRC_URI[md5sum] = "3e68b857b4e1f3a6521d1dfefbd30a36"
+SRC_URI[sha256sum] = "af083a73425d664d4607ef6c6564fd9319a0e47ee7c105259a45356cb834690e"
+
+S = "${WORKDIR}/mtools-${PV}"
+
+inherit autotools texinfo
+
+EXTRA_OECONF = "--without-x"
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libbsd] = "ac_cv_lib_bsd_main=yes,ac_cv_lib_bsd_main=no,libbsd"
+
+do_install_prepend () {
+    # Create bindir to fix parallel installation issues
+    mkdir -p ${D}/${bindir}
+    mkdir -p ${D}/${datadir}
+}
diff --git a/meta/recipes-devtools/mtools/mtools_4.0.18.bb b/meta/recipes-devtools/mtools/mtools_4.0.18.bb
new file mode 100644
index 0000000..52decfd
--- /dev/null
+++ b/meta/recipes-devtools/mtools/mtools_4.0.18.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Utilities to access MS-DOS disks without mounting them"
+DESCRIPTION = "Mtools is a collection of utilities to access MS-DOS disks from GNU and Unix without mounting them."
+HOMEPAGE = "http://www.gnu.org/software/mtools/"
+SECTION = "optional"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+
+RDEPENDS_${PN} = "glibc-gconv-ibm850"
+RRECOMMENDS_${PN} = "\
+	glibc-gconv-ibm437 \
+	glibc-gconv-ibm737 \
+	glibc-gconv-ibm775 \
+	glibc-gconv-ibm851 \
+	glibc-gconv-ibm852 \
+	glibc-gconv-ibm855 \
+	glibc-gconv-ibm857 \
+	glibc-gconv-ibm860 \
+	glibc-gconv-ibm861 \
+	glibc-gconv-ibm862 \
+	glibc-gconv-ibm863 \
+	glibc-gconv-ibm865 \
+	glibc-gconv-ibm866 \
+	glibc-gconv-ibm869 \
+	"
+SRC_URI[md5sum] = "a23646617546bf6ad56f061d8b283c85"
+SRC_URI[sha256sum] = "59e9cf80885399c4f229e5d87e49c0c2bfeec044e1386d59fcd0b0aead6b2f85"
+
+SRC_URI = "${GNU_MIRROR}/mtools/mtools-${PV}.tar.bz2 \
+           file://mtools-makeinfo.patch \
+           file://no-x11.gplv3.patch"
+
+
+inherit autotools texinfo
+
+EXTRA_OECONF = "--without-x"
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libbsd] = "ac_cv_lib_bsd_main=yes,ac_cv_lib_bsd_main=no,libbsd"
+
+do_install_prepend () {
+    # Create bindir to fix parallel installation issues
+    mkdir -p ${D}/${bindir}
+    mkdir -p ${D}/${datadir}
+}
diff --git a/meta/recipes-devtools/nasm/nasm_2.11.08.bb b/meta/recipes-devtools/nasm/nasm_2.11.08.bb
new file mode 100644
index 0000000..e0724e6
--- /dev/null
+++ b/meta/recipes-devtools/nasm/nasm_2.11.08.bb
@@ -0,0 +1,30 @@
+SUMMARY = "General-purpose x86 assembler"
+SECTION = "devel"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=90904486f8fbf1861cf42752e1a39efe"
+COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)'
+
+
+SRC_URI = "http://www.nasm.us/pub/nasm/releasebuilds/${PV}/nasm-${PV}.tar.bz2 "
+
+SRC_URI[md5sum] = "7aae5cb8e03fac48029c82a7470ab066"
+SRC_URI[sha256sum] = "9da3a0291a0bdc06305b7ba194f1e2c2b55ae6f11210b4af43729868149d5445"
+
+inherit autotools-brokensep
+
+do_configure_prepend () {
+	if [ -f ${S}/aclocal.m4 ] && [ ! -f ${S}/acinclude.m4 ]; then
+		mv ${S}/aclocal.m4 ${S}/acinclude.m4
+	fi
+}
+
+do_install() {
+	install -d ${D}${bindir}
+	install -d ${D}${mandir}/man1
+
+	oe_runmake 'INSTALLROOT=${D}' install
+}
+
+BBCLASSEXTEND = "native"
+
+DEPENDS = "groff-native"
diff --git a/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch b/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch
new file mode 100644
index 0000000..6b40afd
--- /dev/null
+++ b/meta/recipes-devtools/openjade/openjade-1.3.2/fix-regex.patch
@@ -0,0 +1,32 @@
+From 55f6fd8f1958aa36584eefeecce782a505963c88 Mon Sep 17 00:00:00 2001
+From: benvm <benvm@yow-gmoffatt-lx2.wrs.com>
+Date: Wed, 9 Jan 2013 12:14:06 -0500
+Subject: [PATCH] Fix Makefile regular expression
+
+This patch modifies a regular expression within a Makefile to stop builds
+from failing in the case where the path contains the characters ".a".
+
+Upstream-Status: Submitted
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ Makefile.prog.in |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile.prog.in b/Makefile.prog.in
+index 76310c9..44c3534 100644
+--- a/Makefile.prog.in
++++ b/Makefile.prog.in
+@@ -12,7 +12,7 @@ LINKFLAGS = @LINKFLAGS@
+ 
+ ALL_LIBS = $(XLIBS) $(LIBS)
+ Makefile.lt:
+-	echo 'LT_LIBS='`echo $(ALL_LIBS)|sed 's/\.a/.la/g'` >Makefile.lt
++	echo 'LT_LIBS='`echo $(ALL_LIBS) | sed 's/\.a\s/\.la /g' | sed s/\.a$$/\.la/` > Makefile.lt
+ 
+ PROG:=$(shell echo "$(PROG)" | sed '@program_transform_name@')
+ 
+-- 
+1.7.0.4
+
diff --git a/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch b/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch
new file mode 100644
index 0000000..968b9b4
--- /dev/null
+++ b/meta/recipes-devtools/openjade/openjade-1.3.2/makefile.patch
@@ -0,0 +1,39 @@
+This patch fixes libtool QA issues with WORKDIR creeping in to
+libospgrove.la and libostyle.la. Patch obtained from OpenEmbedded.
+
+Upstream-Status: Inappropriate [Other]
+Workaround is specific to our build system.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: openjade-1.3.2/spgrove/Makefile.sub
+===================================================================
+--- openjade-1.3.2.orig/spgrove/Makefile.sub
++++ openjade-1.3.2/spgrove/Makefile.sub
+@@ -1,8 +1,8 @@
+ LTVERSION=0:1:0
+ LIB=ospgrove
+ INCLUDE=-I$(srcdir)/../grove
+-DEPLIBS=-lm -L$(TOP)/grove -L$(TOP)/grove/.libs \
+-	-L$(TOP)/lib -L$(TOP)/lib/.libs \
++DEPLIBS=-lm $(TOP)/grove \
++	$(TOP)/lib \
+ 	$(LIB_THREADS)
+ OBJS=GroveApp.o GroveBuilder.o SdNode.o
+ GENSRCS=grove_inst.cxx
+Index: openjade-1.3.2/style/Makefile.sub
+===================================================================
+--- openjade-1.3.2.orig/style/Makefile.sub
++++ openjade-1.3.2/style/Makefile.sub
+@@ -1,8 +1,8 @@
+ LTVERSION=0:1:0
+ LIB=ostyle
+-DEPLIBS=-lm -L$(TOP)/grove -L$(TOP)/grove/.libs \
+-  -L$(TOP)/lib -L$(TOP)/lib/.libs \
+-  -L$(TOP)/spgrove -L$(TOP)/spgrove/.libs 
++DEPLIBS=-lm $(TOP)/grove \
++  $(TOP)/lib  \
++  $(TOP)/spgrove
+ OBJS=LangObj.o \
+   Collector.o \
+   DssslApp.o \
diff --git a/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch b/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch
new file mode 100644
index 0000000..b47fd46
--- /dev/null
+++ b/meta/recipes-devtools/openjade/openjade-1.3.2/msggen.pl.patch
@@ -0,0 +1,44 @@
+commit fcc5b94f118495b1a467edcda6c6f631691c3f69
+Author: Dennis Lan <dennis.yxun@gmail.com>
+Date:   Tue Jul 3 09:25:42 2012 +0800
+
+    openjade: fix undefined Getopts error, use std namespace
+    
+    Using Gentoo Linux as the build host, it fails without this patch
+    Use Getopt::Std in place of getopts.pl.
+    
+    Upstream-Status: Inappropriate [no upstream]
+    Original-Author-By: Mike Gilbert <floppym@gentoo.org>
+    Signed-off-by: Dennis Lan <dennis.yxun@gmail.com>
+
+diff --git a/msggen.pl b/msggen.pl
+index 0c33968..2ee3f66 100644
+--- a/msggen.pl
++++ b/msggen.pl
+@@ -4,6 +4,7 @@
+ # See the file COPYING for copying permission.
+ 
+ use POSIX;
++use Getopt::Std;
+ 
+ # Package and version.
+ $package = 'openjade';
+@@ -18,8 +19,7 @@ $gen_c = 0;
+ undef $opt_l;
+ undef $opt_p;
+ undef $opt_t;
+-do 'getopts.pl';
+-&Getopts('l:p:t:');
++getopts('l:p:t:');
+ $module = $opt_l;
+ $pot_file = $opt_p;
+ 
+@@ -72,7 +72,7 @@ while (<DEF>) {
+     else {
+ 	$field[0] =~ /^[IWQXE][0-9]$/ || &error("invalid first field");;
+ 	$type[$num] = substr($field[0], 0, 1);
+-	$argc = int(substr($field[0], 1, 1));
++	$argc = substr($field[0], 1, 1);
+     }
+     $nargs[$num] = $argc;
+     $field[1] =~ /^[a-zA-Z_][a-zA-Z0-9_]+$/ || &error("invalid tag");
diff --git a/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch b/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch
new file mode 100644
index 0000000..1a23a4a
--- /dev/null
+++ b/meta/recipes-devtools/openjade/openjade-1.3.2/reautoconf.patch
@@ -0,0 +1,83 @@
+Ensure we reautoconf the packag
+
+Currently since configure.in in is in a subdirectory, we don't reautoconf the 
+recipe. We really need to do this, to update things like the libtool script used
+and fix various issues such as those that could creep in if a reautoconf is 
+triggered for some reason. Since this source only calls AM_INIT_AUTOMAKE to 
+gain the PACKAGE and VERSION definitions and that macro now errors if Makefile.am 
+doesn't exist, we need to add these definitions manually. 
+
+These changes avoid failures like: 
+---- 
+| ... 
+| DssslApp.cxx:117:36: error: 'PACKAGE' was not declared in this scope 
+| DssslApp.cxx:118:36: error: 'VERSION' was not declared in this scope 
+| make[2]: *** [DssslApp.lo] Error 1 ----
+
+Upstream-Status: Pending
+
+RP 2012/6/12
+
+Index: openjade-1.3.2/acinclude.m4
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ openjade-1.3.2/acinclude.m4	2012-06-12 12:48:54.871365344 +0000
+@@ -0,0 +1,39 @@
++dnl Configure-time switch with default
++dnl
++dnl Each switch defines an --enable-FOO and --disable-FOO option in
++dnl the resulting configure script.
++dnl
++dnl Usage:
++dnl smr_SWITCH(name, description, default, pos-def, neg-def)
++dnl
++dnl where:
++dnl
++dnl name        name of switch; generates --enable-name & --disable-name
++dnl             options
++dnl description help string is set to this prefixed by "enable" or
++dnl             "disable", whichever is the non-default value
++dnl default     either "on" or "off"; specifies default if neither
++dnl             --enable-name nor --disable-name is specified
++dnl pos-def     a symbol to AC_DEFINE if switch is on (optional)
++dnl neg-def     a symbol to AC_DEFINE if switch is off (optional)
++dnl
++AC_DEFUN(smr_SWITCH, [
++    AC_MSG_CHECKING(whether to enable $2)
++    AC_ARG_ENABLE(
++        $1,
++        ifelse($3, on,
++            [  --disable-[$1]    disable [$2]],
++            [  --enable-[$1]     enable [$2]]),
++        [ if test "$enableval" = yes; then
++            AC_MSG_RESULT(yes)
++            ifelse($4, , , AC_DEFINE($4))
++        else
++            AC_MSG_RESULT(no)
++            ifelse($5, , , AC_DEFINE($5))
++        fi ],
++        ifelse($3, on,
++           [ AC_MSG_RESULT(yes)
++             ifelse($4, , , AC_DEFINE($4)) ],
++           [ AC_MSG_RESULT(no)
++            ifelse($5, , , AC_DEFINE($5))]))])
++
+Index: openjade-1.3.2/config/configure.in
+===================================================================
+--- openjade-1.3.2.orig/config/configure.in	2012-06-12 12:47:20.735365445 +0000
++++ openjade-1.3.2/config/configure.in	2012-06-12 12:48:17.507364080 +0000
+@@ -12,9 +12,12 @@
+ dnl  Credits: this autoconf script was largely "inspired" <g> by the
+ dnl  autoconf script around SP made by Henry Thompson.
+ dnl
+-AC_INIT(dsssl)
++AC_INIT([openjade], [1.3.2])
+ AC_CONFIG_AUX_DIR(config)
+-AM_INIT_AUTOMAKE( openjade, 1.3.2)
++AC_SUBST([PACKAGE], [openjade])
++AC_SUBST([VERSION], [1.3.2])
++AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
++AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+ TOP=`pwd`
+ AC_SUBST(TOP)
+ dnl
diff --git a/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch b/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch
new file mode 100644
index 0000000..073af46
--- /dev/null
+++ b/meta/recipes-devtools/openjade/openjade-1.3.2/user-declared-default-constructor.patch
@@ -0,0 +1,92 @@
+In GCC 4.6 the compiler no longer allows objects of const-qualified type to
+be default initialized unless the type has a user-declared default
+constructor.
+
+Patch from Gentoo bugzilla: http://bugs.gentoo.org/show_bug.cgi?id=358021
+
+Gentoo Bugzilla description follows:
+"If a class or struct has no user-defined default constructor, C++ doesn't
+allow you to default construct a const instance of it.
+
+https://bugs.gentoo.org/358021
+http://clang.llvm.org/compatibility.html#default_init_const
+http://gcc.gnu.org/PR44499"
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- a/jade/TeXFOTBuilder.cxx
++++ b/jade/TeXFOTBuilder.cxx
+@@ -88,6 +88,8 @@ public:
+       value.convertString(nic_.placement);
+       }
+     ExtensionFlowObj *copy() const { return new PageFloatFlowObj(*this); }
++  public:
++    PageFloatFlowObj() {}
+   private:
+     PageFloatNIC nic_;
+     StringC name_;
+@@ -101,6 +103,8 @@ public:
+       fotb.endPageFootnote();
+     }
+     ExtensionFlowObj *copy() const { return new PageFootnoteFlowObj(*this); }
++  public:
++    PageFootnoteFlowObj() {}
+   private:
+   };
+   //////////////////////////////////////////////////////////////////////
+--- a/jade/TransformFOTBuilder.cxx
++++ b/jade/TransformFOTBuilder.cxx
+@@ -41,6 +41,7 @@ public:
+   };
+   class EntityRefFlowObj : public TransformExtensionFlowObj {
+   public:
++    EntityRefFlowObj() {}
+     void atomic(TransformFOTBuilder &fotb, const NodePtr &) const {
+       fotb.entityRef(name_);
+     }
+@@ -56,6 +57,7 @@ public:
+   };
+   class ProcessingInstructionFlowObj : public TransformExtensionFlowObj {
+   public:
++    ProcessingInstructionFlowObj() {}
+     void atomic(TransformFOTBuilder &fotb, const NodePtr &) const {
+       fotb.processingInstruction(data_);
+     }
+@@ -98,6 +100,8 @@ public:
+       }
+     }
+     ExtensionFlowObj *copy() const { return new EmptyElementFlowObj(*this); }
++  public:
++    EmptyElementFlowObj() {}
+   private:
+     ElementNIC nic_;
+   };
+@@ -133,6 +137,8 @@ public:
+       }
+     }
+     ExtensionFlowObj *copy() const { return new ElementFlowObj(*this); }
++  public:
++    ElementFlowObj() {}
+   private:
+     ElementNIC nic_;
+   };
+@@ -150,6 +156,8 @@ public:
+       value.convertString(systemId_);
+     }
+     ExtensionFlowObj *copy() const { return new EntityFlowObj(*this); }
++  public:
++    EntityFlowObj() {}
+   private:
+     StringC systemId_;
+   };
+@@ -174,6 +182,8 @@ public:
+       }
+     }
+     ExtensionFlowObj *copy() const { return new DocumentTypeFlowObj(*this); }
++  public:
++    DocumentTypeFlowObj() {}
+   private:
+     DocumentTypeNIC nic_;
+   };
diff --git a/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb b/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
new file mode 100644
index 0000000..fa7aa62
--- /dev/null
+++ b/meta/recipes-devtools/openjade/openjade-native_1.3.2.bb
@@ -0,0 +1,108 @@
+SUMMARY = "Tools for working with DSSSL stylesheets for SGML and XML documents"
+DESCRIPTION = "OpenJade is a suite of tools for validating, \
+processing, and applying DSSSL (Document Style Semantics and \
+Specification Language) stylesheets to SGML and XML documents."
+HOMEPAGE = "http://openjade.sourceforge.net"
+SECTION = "base"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=641ff1e4511f0a87044ad42f87cb1045"
+
+PR = "r5"
+
+DEPENDS = "opensp-native sgml-common-native"
+RDEPENDS_${PN} = "sgml-common-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/openjade/openjade-${PV}.tar.gz \
+           file://makefile.patch \
+           file://msggen.pl.patch \
+           file://reautoconf.patch \
+	   file://user-declared-default-constructor.patch \
+           file://fix-regex.patch"
+
+SRC_URI[md5sum] = "7df692e3186109cc00db6825b777201e"
+SRC_URI[sha256sum] = "1d2d7996cc94f9b87d0c51cf0e028070ac177c4123ecbfd7ac1cb8d0b7d322d1"
+
+inherit autotools-brokensep native
+
+EXTRA_OECONF = "--enable-spincludedir=${STAGING_INCDIR}/OpenSP \
+                --enable-splibdir=${STAGING_LIBDIR}"
+
+# We need to set datadir explicitly, but adding it to EXTRA_OECONF
+# results in it being specified twice when configure is run.
+CONFIGUREOPTS := "${@d.getVar('CONFIGUREOPTS', True).replace('--datadir=${datadir}', '--datadir=${STAGING_DATADIR}/sgml/openjade-${PV}')}"
+
+# CONFIGUREOPTS has hard coded paths so we need to ignore it's vardeps
+# there are other bits in there too but they are picked up by other variable
+# dependencies so it all works out
+oe_runconf[vardepsexclude] += "CONFIGUREOPTS"
+
+CFLAGS =+ "-I${S}/include"
+
+SSTATEPOSTINSTFUNCS += "openjade_sstate_postinst"
+SYSROOT_PREPROCESS_FUNCS += "openjade_sysroot_preprocess"
+CLEANFUNCS += "openjade_sstate_clean"
+
+# configure.in needs to be reloacted to trigger reautoconf
+do_extraunpack () {
+	cp ${S}/config/configure.in ${S}/
+}
+addtask extraunpack after do_patch before do_configure
+
+# We need to do this else the source interdependencies aren't generated and
+# build failures can result (e.g. zero size style/Makefile.dep file)
+do_compile_prepend () {
+	oe_runmake depend
+}
+
+do_install() {
+	# Refer to http://www.linuxfromscratch.org/blfs/view/stable/pst/openjade.html
+	# for details.
+	install -d ${D}${bindir}	
+	install -m 0755 ${S}/jade/.libs/openjade ${D}${bindir}/openjade
+	ln -sf openjade ${D}${bindir}/jade
+
+	oe_libinstall -a -so -C style libostyle ${D}${libdir}
+	oe_libinstall -a -so -C spgrove libospgrove ${D}${libdir}
+	oe_libinstall -a -so -C grove libogrove ${D}${libdir}
+
+	install -d ${D}${datadir}/sgml/openjade-${PV}
+	install -m 644 dsssl/catalog ${D}${datadir}/sgml/openjade-${PV}
+	install -m 644 dsssl/*.dtd ${D}${datadir}/sgml/openjade-${PV}
+	install -m 644 dsssl/*.dsl ${D}${datadir}/sgml/openjade-${PV}
+	install -m 644 dsssl/*.sgm ${D}${datadir}/sgml/openjade-${PV}
+
+	install -d ${datadir}/sgml/openjade-${PV}
+	install -m 644 dsssl/catalog ${datadir}/sgml/openjade-${PV}/catalog
+
+	install -d ${D}${sysconfdir}/sgml
+	echo "CATALOG ${datadir}/sgml/openjade-${PV}/catalog" > \
+		${D}${sysconfdir}/sgml/openjade-${PV}.cat
+}
+
+openjade_sstate_postinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+		# Ensure that the catalog file sgml-docbook.cat is properly
+		# updated when the package is installed from sstate cache.
+		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \
+			--add ${sysconfdir}/sgml/sgml-docbook.bak \
+			${sysconfdir}/sgml/openjade-${PV}.cat
+		${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade \
+			--add ${sysconfdir}/sgml/sgml-docbook.cat \
+			${sysconfdir}/sgml/openjade-${PV}.cat
+	fi
+}
+
+openjade_sysroot_preprocess () {
+    install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+    install -m 755 ${STAGING_BINDIR_NATIVE}/install-catalog ${SYSROOT_DESTDIR}${bindir_crossscripts}/install-catalog-openjade
+}
+
+openjade_sstate_clean () {
+	# Ensure that the catalog file sgml-docbook.cat is properly
+	# updated when the package is removed from sstate cache.
+	files="${sysconfdir}/sgml/sgml-docbook.bak ${sysconfdir}/sgml/sgml-docbook.cat"
+	for f in $files; do
+		[ ! -f $f ] || sed -i '/\/sgml\/openjade-${PV}.cat/d' $f
+	done
+}
diff --git a/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch b/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch
new file mode 100644
index 0000000..42218a6
--- /dev/null
+++ b/meta/recipes-devtools/opensp/opensp-1.5.2/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [https://sourceforge.net/tracker/?func=detail&aid=3599291&group_id=2115&atid=102115]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd OpenSP-1.5.2/configure.in OpenSP-1.5.2/configure.in
+--- OpenSP-1.5.2/configure.in	2005-12-23 16:15:21.000000000 +0200
++++ OpenSP-1.5.2/configure.in	2013-01-03 09:04:51.922645689 +0200
+@@ -16,7 +16,7 @@
+ AM_INIT_AUTOMAKE(OpenSP, 1.5.2, no-define)
+ AM_MAINTAINER_MODE
+ AC_PREREQ(2.53)
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+ AM_SANITY_CHECK
+
+ dnl Autoheader definitions
diff --git a/meta/recipes-devtools/opensp/opensp_1.5.2.bb b/meta/recipes-devtools/opensp/opensp_1.5.2.bb
new file mode 100644
index 0000000..a1f115c
--- /dev/null
+++ b/meta/recipes-devtools/opensp/opensp_1.5.2.bb
@@ -0,0 +1,55 @@
+SUMMARY = "An SGML parser"
+DESCRIPTION = "An SGML parser used by the OpenJade suite of utilities."
+HOMEPAGE = "http://openjade.sourceforge.net"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=641ff1e4511f0a87044ad42f87cb1045"
+
+PR = "r1"
+
+# At -Os it encounters calls to some inline functions which are then
+# not found in any other objects with gcc 4.5
+FULL_OPTIMIZATION += "-O2"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/openjade/OpenSP-${PV}.tar.gz \
+           file://obsolete_automake_macros.patch \
+"
+
+SRC_URI[md5sum] = "670b223c5d12cee40c9137be86b6c39b"
+SRC_URI[sha256sum] = "57f4898498a368918b0d49c826aa434bb5b703d2c3b169beb348016ab25617ce"
+
+S = "${WORKDIR}/OpenSP-${PV}"
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--disable-doc-build"
+
+EXTRA_OECONF_class-native = "\
+	--disable-doc-build \
+	--enable-default-catalog=${sysconfdir}/sgml/catalog \
+	--enable-default-search-path=${datadir}/sgml \
+	"
+
+do_install_append() {
+	# Set up symlinks to often-used alternate names. See
+	# http://www.linuxfromscratch.org/blfs/view/stable/pst/opensp.html
+	cd ${D}${libdir}
+	ln -sf libosp.so libsp.so
+
+	cd ${D}${bindir}
+	for util in nsgmls sgmlnorm spam spcat spent sx; do
+		ln -sf o$util $util	
+	done
+	ln -sf osx sgml2xml
+}
+
+do_install_append_class-native() {
+	for util in nsgmls sgmlnorm spam spcat spent sx; do
+		create_cmdline_wrapper ${D}/${bindir}/$util \
+		    -D ${sysconfdir}/sgml
+	done
+}
+
+FILES_${PN} += "${datadir}/OpenSP/"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch b/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
new file mode 100644
index 0000000..4dddb08
--- /dev/null
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils/tar_ignore_error.patch
@@ -0,0 +1,47 @@
+If a the number of hard links decreases or increases while creating
+the tar files used for an ipk package, tar fails with error code 1:
+
+| DEBUG: Executing python function do_package_ipk
+| tar: ./usr/src/debug/gperf/3.0.4-r0/gperf-3.0.4/src/main.cc: file changed as we read it
+NOTE: recipe gperf-3.0.4-r0: task do_package_write_ipk: Failed
+ERROR: Task 6539 (recipes-extended/gperf/gperf_3.0.4.bb, do_package_write_ipk) failed with exit code '1'
+
+
+We detect if the error code produced by tar is 1 and in this case ignore it.
+
+This a similar behavior to the one on dpkg:
+http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=40731942515ec8d80c727ad561174986d4f05818
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+
+Index: git/opkg-build
+===================================================================
+--- git.orig/opkg-build
++++ git/opkg-build
+@@ -250,8 +250,21 @@ tmp_dir=$dest_dir/IPKG_BUILD.$$
+ mkdir $tmp_dir
+ 
+ echo $CONTROL > $tmp_dir/tarX
+-( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -cz $tarformat -f $tmp_dir/data.tar.gz . )
+-( cd $pkg_dir/$CONTROL && tar $ogargs -cz $tarformat -f $tmp_dir/control.tar.gz . )
++
++
++# Ignore error code 1, caused by modifying the number of hard links while creating the tar file
++rc=0
++( cd $pkg_dir && tar $ogargs -X $tmp_dir/tarX -cz $tarformat -f $tmp_dir/data.tar.gz . ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++        exit $rc 
++fi
++
++rc=0
++( cd $pkg_dir/$CONTROL && tar $ogargs -cz $tarformat -f $tmp_dir/control.tar.gz . ) || rc=$?
++if [ $rc -ne 1 ] && [ $rc -ne 0 ]; then
++        exit $rc
++fi
++
+ rm $tmp_dir/tarX
+ 
+ echo "2.0" > $tmp_dir/debian-binary
diff --git a/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
new file mode 100644
index 0000000..5f518d2
--- /dev/null
+++ b/meta/recipes-devtools/opkg-utils/opkg-utils_git.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Additional utilities for the opkg package manager"
+SUMMARY_update-alternatives-opkg = "Utility for managing the alternatives system"
+SECTION = "base"
+HOMEPAGE = "http://code.google.com/p/opkg/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://opkg.py;beginline=1;endline=18;md5=15917491ad6bf7acc666ca5f7cc1e083"
+PROVIDES += "virtual/update-alternatives"
+
+SRCREV = "53274f087565fd45d8452c5367997ba6a682a37a"
+PV = "0.1.8+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/opkg-utils"
+
+SRC_URI_append_class-native = " file://tar_ignore_error.patch"
+
+S = "${WORKDIR}/git"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+PYTHONRDEPS = "python python-shell python-io python-math python-crypt python-logging python-fcntl python-subprocess python-pickle python-compression python-textutils python-stringold"
+PYTHONRDEPS_class-native = ""
+
+PACKAGECONFIG = "python"
+PACKAGECONFIG[python] = ",,,${PYTHONRDEPS}"
+
+do_install() {
+	oe_runmake PREFIX=${prefix} DESTDIR=${D} install
+}
+
+do_install_append_class-target() {
+	sed -i ${D}${bindir}/update-alternatives -e 's,/usr/bin,${bindir},g; s,/usr/lib,${libdir},g'
+}
+
+PACKAGES =+ "update-alternatives-opkg"
+FILES_update-alternatives-opkg = "${bindir}/update-alternatives"
+RPROVIDES_update-alternatives-opkg = "update-alternatives update-alternatives-cworth"
+RREPLACES_update-alternatives-opkg = "update-alternatives-cworth"
+RCONFLICTS_update-alternatives-opkg = "update-alternatives-cworth"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb b/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb
new file mode 100644
index 0000000..ace3de4
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg-arch-config_1.0.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Architecture-dependent configuration for opkg"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+PR = "r1"
+
+S = "${WORKDIR}"
+
+do_compile() {
+	mkdir -p ${S}/${sysconfdir}/opkg/
+
+	archconf=${S}/${sysconfdir}/opkg/arch.conf
+
+	rm -f $archconf
+	ipkgarchs="${ALL_MULTILIB_PACKAGE_ARCHS}"
+	priority=1
+	for arch in $ipkgarchs; do 
+		echo "arch $arch $priority" >> $archconf
+		priority=$(expr $priority + 5)
+	done
+}
+
+
+do_install () {
+	install -d ${D}${sysconfdir}/opkg
+	install -m 0644  ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/
+}
+
+FILES_${PN} = "${sysconfdir}/opkg/ "
+
+CONFFILES_${PN} += "${sysconfdir}/opkg/arch.conf"
+
+RREPLACES_${PN} = "opkg-config-base"
+RCONFLICTS_${PN} = "opkg-config-base"
+RPROVIDES_${PN} = "opkg-config-base"
diff --git a/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb b/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb
new file mode 100644
index 0000000..18d6abd
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg-keyrings_1.0.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Keyrings for verifying opkg packages and feeds"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+# Distro-specific keys can be added to this package in two ways:
+#
+#   1) In a .bbappend, add .gpg and/or .asc files to SRC_URI and install them to
+#      ${D}${datadir}/opkg/keyrings/ in a do_install_append function. These
+#      files should not be named 'key-$name.gpg' to ensure they don't conflict
+#      with keys exported as per (2).
+#
+#   2) In a .bbappend, distro config or local.conf, override the variable
+#      OPKG_KEYRING_KEYS to contain a space-separated list of key names. For
+#      each name, 'gpg --export $name' will be ran to export the public key to a
+#      file named 'key-$name.gpg'. The public key must therefore be in the gpg
+#      keyrings on the build machine.
+
+OPKG_KEYRING_KEYS ?= ""
+
+do_compile() {
+    for name in ${OPKG_KEYRING_KEYS}; do
+        gpg --export ${name} > ${B}/key-${name}.gpg
+    done
+}
+
+do_install () {
+    install -d ${D}${datadir}/opkg/keyrings/
+    for name in ${OPKG_KEYRING_KEYS}; do
+        install -m 0644 ${B}/key-${name}.gpg ${D}${datadir}/opkg/keyrings/
+    done
+}
+
+FILES_${PN} = "${datadir}/opkg/keyrings"
+
+# We need 'opkg-key' to run the postinst script
+RDEPENDS_${PN} = "opkg"
+
+pkg_postinst_${PN} () {
+#! /bin/sh
+set -e
+
+if [ x"$D" = "x" ]; then
+    # On target
+    opkg-key populate
+else
+    exit 1
+fi
+}
diff --git a/meta/recipes-devtools/opkg/opkg/0001-opkg_archive-add-support-for-empty-compressed-files.patch b/meta/recipes-devtools/opkg/opkg/0001-opkg_archive-add-support-for-empty-compressed-files.patch
new file mode 100644
index 0000000..dabd196
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/0001-opkg_archive-add-support-for-empty-compressed-files.patch
@@ -0,0 +1,64 @@
+From bd32bb8646459508bb0b0ce54a14bd6fe0e19b75 Mon Sep 17 00:00:00 2001
+From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+Date: Thu, 27 Aug 2015 15:52:16 -0500
+Subject: [PATCH] opkg_archive: add support for empty compressed files
+
+Regression from 0.2.x: opkg used to support empty Package.gz files.
+
+Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
+
+Upstream-Status: Accepted
+---
+ libopkg/opkg_archive.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/libopkg/opkg_archive.c b/libopkg/opkg_archive.c
+index be903e4..7e91e48 100644
+--- a/libopkg/opkg_archive.c
++++ b/libopkg/opkg_archive.c
+@@ -121,6 +121,9 @@ static int copy_to_stream(struct archive *a, FILE * stream)
+     int eof;
+     size_t len = EXTRACT_BUFFER_LEN;
+ 
++    if (archive_format(a) == ARCHIVE_FORMAT_EMPTY)
++        return 0;
++
+     buffer = xmalloc(len);
+ 
+     while (1) {
+@@ -654,6 +657,13 @@ static struct archive *open_compressed_file(const char *filename)
+         goto err_cleanup;
+     }
+ 
++    r = archive_read_support_format_empty(ar);
++    if (r != ARCHIVE_OK) {
++        opkg_msg(ERROR, "Empty format not supported: %s\n",
++                 archive_error_string(ar));
++        goto err_cleanup;
++    }
++
+     /* Open input file and prepare for reading. */
+     r = archive_read_open_filename(ar, filename, EXTRACT_BUFFER_LEN);
+     if (r != ARCHIVE_OK) {
+@@ -723,6 +733,7 @@ struct opkg_ar *ar_open_compressed_file(const char *filename)
+ {
+     struct opkg_ar *ar;
+     struct archive_entry *entry;
++    int eof;
+ 
+     ar = (struct opkg_ar *)xmalloc(sizeof(struct opkg_ar));
+ 
+@@ -737,8 +748,8 @@ struct opkg_ar *ar_open_compressed_file(const char *filename)
+      * header. We skip over this header here so that the caller doesn't need
+      * to know about it.
+      */
+-    entry = read_header(ar->ar, NULL);
+-    if (!entry)
++    entry = read_header(ar->ar, &eof);
++    if (!entry && !eof)
+         goto err_cleanup;
+ 
+     return ar;
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/opkg/opkg/opkg-configure.service b/meta/recipes-devtools/opkg/opkg/opkg-configure.service
new file mode 100644
index 0000000..8e74026
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/opkg-configure.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Opkg first boot configure
+DefaultDependencies=no
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
+Before=sysinit.target
+
+[Service]
+Type=oneshot
+EnvironmentFile=-@SYSCONFDIR@/default/postinst
+ExecStart=-@BASE_BINDIR@/sh -c " if [ $POSTINST_LOGGING = '1' ]; then @BINDIR@/opkg configure > $LOGFILE 2>&1; else @BINDIR@/opkg configure; fi"
+ExecStartPost=@BASE_BINDIR@/systemctl disable opkg-configure.service
+StandardOutput=syslog
+RemainAfterExit=No
+
+[Install]
+WantedBy=basic.target
+WantedBy=sysinit.target
diff --git a/meta/recipes-devtools/opkg/opkg/opkg.conf b/meta/recipes-devtools/opkg/opkg/opkg.conf
new file mode 100644
index 0000000..c2e9e92
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg/opkg.conf
@@ -0,0 +1,28 @@
+# Must have one or more source entries of the form:
+#
+#   src <src-name> <source-url>
+#
+# and one or more destination entries of the form:
+#
+#   dest <dest-name> <target-path>
+#
+# where <src-name> and <dest-names> are identifiers that
+# should match [a-zA-Z0-9._-]+, <source-url> should be a
+# URL that points to a directory containing a Familiar
+# Packages file, and <target-path> should be a directory
+# that exists on the target system.
+
+# Proxy Support
+#option http_proxy http://proxy.tld:3128
+#option ftp_proxy http://proxy.tld:3128
+#option proxy_username <username>
+#option proxy_password <password>
+
+# Enable GPGME signature
+# option check_signature 1
+
+# Offline mode (for use in constructing flash images offline)
+#option offline_root target
+
+# Default destination for installed packages
+dest root /
diff --git a/meta/recipes-devtools/opkg/opkg_0.3.0.bb b/meta/recipes-devtools/opkg/opkg_0.3.0.bb
new file mode 100644
index 0000000..f4dbb2d
--- /dev/null
+++ b/meta/recipes-devtools/opkg/opkg_0.3.0.bb
@@ -0,0 +1,72 @@
+SUMMARY = "Open Package Manager"
+SUMMARY_libopkg = "Open Package Manager library"
+SECTION = "base"
+HOMEPAGE = "http://code.google.com/p/opkg/"
+BUGTRACKER = "http://code.google.com/p/opkg/issues/list"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://src/opkg.c;beginline=2;endline=21;md5=90435a519c6ea69ef22e4a88bcc52fa0"
+
+DEPENDS = "libarchive"
+
+PE = "1"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/${BPN}/${BPN}-${PV}.tar.gz \
+           file://opkg-configure.service \
+           file://opkg.conf \
+           file://0001-opkg_archive-add-support-for-empty-compressed-files.patch \
+"
+
+SRC_URI[md5sum] = "3412cdc71d78b98facc84b19331ec64e"
+SRC_URI[sha256sum] = "7f735d1cdb8ef3718fb0f9fba44ca0d9a5c90d3a7f014f37a6d2f9474f54988f"
+
+inherit autotools pkgconfig systemd
+
+SYSTEMD_SERVICE_${PN} = "opkg-configure.service"
+
+target_localstatedir := "${localstatedir}"
+OPKGLIBDIR = "${target_localstatedir}/lib"
+
+PACKAGECONFIG ??= ""
+
+PACKAGECONFIG[gpg] = "--enable-gpg,--disable-gpg,gpgme libgpg-error,gnupg"
+PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl"
+PACKAGECONFIG[ssl-curl] = "--enable-ssl-curl,--disable-ssl-curl,curl openssl"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[sha256] = "--enable-sha256,--disable-sha256"
+PACKAGECONFIG[pathfinder] = "--enable-pathfinder,--disable-pathfinder,pathfinder"
+
+do_install_append () {
+	install -d ${D}${sysconfdir}/opkg
+	install -m 0644 ${WORKDIR}/opkg.conf ${D}${sysconfdir}/opkg/opkg.conf
+	echo "option lists_dir ${OPKGLIBDIR}/opkg/lists" >>${D}${sysconfdir}/opkg/opkg.conf
+
+	# We need to create the lock directory
+	install -d ${D}${OPKGLIBDIR}/opkg
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
+		install -d ${D}${systemd_unitdir}/system
+		install -m 0644 ${WORKDIR}/opkg-configure.service ${D}${systemd_unitdir}/system/
+		sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+			-e 's,@SYSCONFDIR@,${sysconfdir},g' \
+			-e 's,@BINDIR@,${bindir},g' \
+			-e 's,@SYSTEMD_UNITDIR@,${systemd_unitdir},g' \
+			${D}${systemd_unitdir}/system/opkg-configure.service
+	fi
+}
+
+RDEPENDS_${PN} = "${VIRTUAL-RUNTIME_update-alternatives} opkg-arch-config run-postinsts libarchive"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+RREPLACES_${PN} = "opkg-nogpg opkg-collateral"
+RCONFLICTS_${PN} = "opkg-collateral"
+RPROVIDES_${PN} = "opkg-collateral"
+
+PACKAGES =+ "libopkg"
+
+FILES_libopkg = "${libdir}/*.so.* ${OPKGLIBDIR}/opkg/"
+FILES_${PN} += "${systemd_unitdir}/system/"
+
+BBCLASSEXTEND = "native nativesdk"
+
+CONFFILES_${PN} = "${sysconfdir}/opkg/opkg.conf"
diff --git a/meta/recipes-devtools/orc/orc_0.4.23.bb b/meta/recipes-devtools/orc/orc_0.4.23.bb
new file mode 100644
index 0000000..d4257c3
--- /dev/null
+++ b/meta/recipes-devtools/orc/orc_0.4.23.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Optimised Inner Loop Runtime Compiler"
+HOMEPAGE = "http://code.entropywave.com/projects/orc/"
+LICENSE = "BSD-2-Clause & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1400bd9d09e8af56b9ec982b3d85797e"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/orc/orc-${PV}.tar.xz;name=orc"
+SRC_URI[orc.md5sum] = "72e0612ace54d77aa2f7a006348ee81a"
+SRC_URI[orc.sha256sum] = "767eaebce2941737b43368225ec54598b3055ca78b4dc50c4092f5fcdc0bdfe7"
+
+inherit autotools pkgconfig
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGES =+ "orc-examples"
+FILES_orc-examples = "${libdir}/orc/*"
+FILES_${PN} = "${bindir}/*"
+
+python populate_packages_prepend () {
+    libdir = d.expand('${libdir}')
+    do_split_packages(d, libdir, '^lib(.*)\.so\.*', 'lib%s', 'ORC %s library', extra_depends='', allow_links=True)
+}
+
+do_compile_prepend_class-native () {
+    sed -i -e 's#/tmp#.#g' ${S}/orc/orccodemem.c
+}
diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch
new file mode 100644
index 0000000..ed67c50
--- /dev/null
+++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0001-Change-library-name.patch
@@ -0,0 +1,119 @@
+From: Piotr Roszatycki <dexter@debian.org>
+Date: Wed, 27 Jan 2010 16:53:11 +0100
+Subject: [PATCH] Change library name
+
+The soname was changed to ossp-uuid to prevend the name clash with e2fsprogs's
+uuid library.
+---
+ Makefile.in      |    6 +++---
+ perl/Makefile.PL |   12 ++++++------
+ php/config.m4    |    2 +-
+ uuid-config.in   |    2 +-
+ uuid.pc.in       |    4 ++--
+ 5 files changed, 13 insertions(+), 13 deletions(-)
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/Makefile.in b/Makefile.in
+index d28f4be..c2ba99d 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -62,13 +62,13 @@ PERL        = @PERL@
+ PHP         = @PHP@
+ PG_CONFIG   = @PG_CONFIG@
+ 
+-LIB_NAME    = libuuid.la
++LIB_NAME    = libossp-uuid.la
+ LIB_OBJS    = uuid.lo uuid_md5.lo uuid_sha1.lo uuid_prng.lo uuid_mac.lo uuid_time.lo uuid_ui64.lo uuid_ui128.lo uuid_str.lo
+ 
+-DCE_NAME    = libuuid_dce.la
++DCE_NAME    = libossp-uuid_dce.la
+ DCE_OBJS    = uuid_dce.lo $(LIB_OBJS)
+ 
+-CXX_NAME    = libuuid++.la
++CXX_NAME    = libossp-uuid++.la
+ CXX_OBJS    = uuid++.lo $(LIB_OBJS)
+ 
+ PRG_NAME    = uuid
+diff --git a/perl/Makefile.PL b/perl/Makefile.PL
+index 92f4494..9c6fee6 100644
+--- a/perl/Makefile.PL
++++ b/perl/Makefile.PL
+@@ -33,9 +33,9 @@ use Config;
+ use ExtUtils::MakeMaker;
+ 
+ #   determine source directory
+-my ($srcdir) = map { my $d = $_; $d =~ s/\/libuuid\.la$//; $d }
+-               grep { -f $_ } ("../libuuid.la", glob("../*/libuuid.la"))
+-    or die "no source directory found (where libuuid.la is located)";
++my ($srcdir) = map { my $d = $_; $d =~ s/\/libossp-uuid\.la$//; $d }
++               grep { -f $_ } ("../libossp-uuid.la", glob("../*/libossp-uuid.la"))
++    or die "no source directory found (where libossp-uuid.la is located)";
+ 
+ #   determine extra build options
+ my $compat = 0;
+@@ -47,15 +47,15 @@ WriteMakefile(
+     VERSION_FROM      => 'uuid.pm',
+     ABSTRACT_FROM     => 'uuid.pod',
+     PREREQ_PM         => {},
+-    LIBS              => [ "-L$srcdir/.libs -L$srcdir -luuid" ],
++    LIBS              => [ "-L$srcdir/.libs -L$srcdir -lossp-uuid" ],
+     DEFINE            => '',
+     INC               => "-I. -I$srcdir",
+     PM                => { 'uuid.pm'   => '$(INST_LIBDIR)/uuid.pm',
+                            'uuid.pod'  => '$(INST_LIBDIR)/uuid.pod',
+                            ($compat ? ('uuid_compat.pm'  => '$(INST_LIBDIR)/../Data/UUID.pm')  : ()),
+                            ($compat ? ('uuid_compat.pod' => '$(INST_LIBDIR)/../Data/UUID.pod') : ()), },
+-    MAN3PODS          => { 'uuid.pod' => '$(INST_MAN3DIR)/OSSP::uuid.3',
+-                           ($compat ? ('uuid_compat.pod' => '$(INST_MAN3DIR)/Data::UUID.3') : ()), },
++    MAN3PODS          => { 'uuid.pod' => '$(INST_MAN3DIR)/OSSP::uuid.3pm',
++                           ($compat ? ('uuid_compat.pod' => '$(INST_MAN3DIR)/Data::UUID.3pm') : ()), },
+     TYPEMAPS          => [ 'uuid.tm' ],
+     test              => { TESTS => 'uuid.ts' . ($compat ? ' uuid_compat.ts' : '') },
+     NO_META           => 1,
+diff --git a/php/config.m4 b/php/config.m4
+index 5091b96..969b457 100644
+--- a/php/config.m4
++++ b/php/config.m4
+@@ -34,7 +34,7 @@ if test "$PHP_UUID" != "no"; then
+     PHP_NEW_EXTENSION(uuid, uuid.c, $ext_shared)
+     AC_DEFINE(HAVE_UUID, 1, [Have OSSP uuid library])
+     PHP_ADD_LIBPATH([..], )
+-    PHP_ADD_LIBRARY([uuid],, UUID_SHARED_LIBADD)
++    PHP_ADD_LIBRARY([ossp-uuid],, UUID_SHARED_LIBADD)
+     PHP_ADD_INCLUDE([..])
+     PHP_SUBST(UUID_SHARED_LIBADD)
+ 
+diff --git a/uuid-config.in b/uuid-config.in
+index 8d2a063..5b58812 100644
+--- a/uuid-config.in
++++ b/uuid-config.in
+@@ -121,7 +121,7 @@ do
+             output_extra="$output_extra $uuid_ldflags"
+             ;;
+         --libs)
+-            output="$output -luuid"
++            output="$output -lossp-uuid"
+             output_extra="$output_extra $uuid_libs"
+             ;;
+         * )
+diff --git a/uuid.pc.in b/uuid.pc.in
+index c76ad1e..de00c2f 100644
+--- a/uuid.pc.in
++++ b/uuid.pc.in
+@@ -36,7 +36,7 @@ Name: OSSP uuid
+ Description: Universally Unique Identifier (UUID) Library
+ Version: @UUID_VERSION_RAW@
+ URL: http://www.ossp.org/pkg/lib/uuid/
+-Cflags: -I${includedir}
+-Libs: -L${libdir} -luuid
++Cflags: -I${includedir}/ossp
++Libs: -L${libdir} -lossp-uuid
+ Libs.private: @LIBS@
+ 
+-- 
diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch
new file mode 100644
index 0000000..804a627
--- /dev/null
+++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0002-uuid-preserve-m-option-status-in-v-option-handling.patch
@@ -0,0 +1,62 @@
+From: Marco Nenciarini <marco.nenciarini@devise.it>
+Date: Wed, 27 Jan 2010 19:46:21 +0100
+Subject: [PATCH] uuid: preserve -m option status in -v option handling
+
+Bug: 531396
+---
+ uuid_cli.c |   19 ++++++++++---------
+ 1 files changed, 10 insertions(+), 9 deletions(-)
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/uuid_cli.c b/uuid_cli.c
+index d1b0b11..14a67fe 100644
+--- a/uuid_cli.c
++++ b/uuid_cli.c
+@@ -140,11 +140,12 @@ int main(int argc, char *argv[])
+                 i = strtol(optarg, &p, 10);
+                 if (*p != '\0')
+                     usage("invalid argument to option 'v'");
++                version &= ~(UUID_MAKE_V1|UUID_MAKE_V3|UUID_MAKE_V4|UUID_MAKE_V5);
+                 switch (i) {
+-                    case 1: version = UUID_MAKE_V1; break;
+-                    case 3: version = UUID_MAKE_V3; break;
+-                    case 4: version = UUID_MAKE_V4; break;
+-                    case 5: version = UUID_MAKE_V5; break;
++                    case 1: version |= UUID_MAKE_V1; break;
++                    case 3: version |= UUID_MAKE_V3; break;
++                    case 4: version |= UUID_MAKE_V4; break;
++                    case 5: version |= UUID_MAKE_V5; break;
+                     default:
+                         usage("invalid version on option 'v'");
+                         break;
+@@ -213,10 +214,10 @@ int main(int argc, char *argv[])
+     }
+     else {
+         /* encoding */
+-        if (   (version == UUID_MAKE_V1 && argc != 0)
+-            || (version == UUID_MAKE_V3 && argc != 2)
+-            || (version == UUID_MAKE_V4 && argc != 0)
+-            || (version == UUID_MAKE_V5 && argc != 2))
++        if (   (version & UUID_MAKE_V1 && argc != 0)
++            || (version & UUID_MAKE_V3 && argc != 2)
++            || (version & UUID_MAKE_V4 && argc != 0)
++            || (version & UUID_MAKE_V5 && argc != 2))
+             usage("invalid number of arguments");
+         if ((rc = uuid_create(&uuid)) != UUID_RC_OK)
+             error(1, "uuid_create: %s", uuid_error(rc));
+@@ -232,7 +233,7 @@ int main(int argc, char *argv[])
+                 if ((rc = uuid_load(uuid, "nil")) != UUID_RC_OK)
+                     error(1, "uuid_load: %s", uuid_error(rc));
+             }
+-            if (version == UUID_MAKE_V3 || version == UUID_MAKE_V5) {
++            if (version & UUID_MAKE_V3 || version & UUID_MAKE_V5) {
+                 if ((rc = uuid_create(&uuid_ns)) != UUID_RC_OK)
+                     error(1, "uuid_create: %s", uuid_error(rc));
+                 if ((rc = uuid_load(uuid_ns, argv[0])) != UUID_RC_OK) {
+-- 
diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch
new file mode 100644
index 0000000..13cbb59
--- /dev/null
+++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0003-Fix-whatis-entries.patch
@@ -0,0 +1,58 @@
+From: Marco Nenciarini <marco.nenciarini@devise.it>
+Date: Tue, 2 Feb 2010 12:16:49 +0100
+Subject: [PATCH] Fix whatis entries
+
+Fix whatis entry of uuid.1, uuid.3ossp and uuid++.3ossp manpages
+---
+ uuid++.pod   |    2 +-
+ uuid.pod     |    2 +-
+ uuid_cli.pod |    2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/uuid++.pod b/uuid++.pod
+index 8b5a4b1..89c5efb 100644
+--- a/uuid++.pod
++++ b/uuid++.pod
+@@ -31,7 +31,7 @@
+ 
+ =head1 NAME
+ 
+-B<OSSP uuid> - B<Universally Unique Identifier> (C++ API)
++B<uuid++> - B<Universally Unique Identifier> (C++ API)
+ 
+ =head1 VERSION
+ 
+diff --git a/uuid.pod b/uuid.pod
+index 4ad3742..0179a46 100644
+--- a/uuid.pod
++++ b/uuid.pod
+@@ -31,7 +31,7 @@
+ 
+ =head1 NAME
+ 
+-B<OSSP uuid> - B<Universally Unique Identifier>
++B<uuid> - B<Universally Unique Identifier>
+ 
+ =head1 VERSION
+ 
+diff --git a/uuid_cli.pod b/uuid_cli.pod
+index ddec6bb..df9dc83 100644
+--- a/uuid_cli.pod
++++ b/uuid_cli.pod
+@@ -31,7 +31,7 @@
+ 
+ =head1 NAME
+ 
+-B<OSSP uuid> - B<Universally Unique Identifier Command-Line Tool>
++B<uuid> - B<Universally Unique Identifier Command-Line Tool>
+ 
+ =head1 VERSION
+ 
+-- 
diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch
new file mode 100644
index 0000000..bc5e111
--- /dev/null
+++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/0004-fix-data-uuid-from-string.patch
@@ -0,0 +1,43 @@
+Description: Support dash-less args to from_string.
+Author: Tim Retout <diocles@debian.org>
+Bug-Debian: http://bugs.debian.org/635607
+
+The module Data::GUID depends on Data::UUID supporting this behaviour.
+
+----
+Upstream-Status: Inappropriate [not author]
+
+This patch is from debian ossp-uuid 1.6.2 integration.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- a/perl/uuid_compat.pm
++++ b/perl/uuid_compat.pm
+@@ -93,7 +93,9 @@
+     $uuid->import('str',
+           $str =~ /^0x/
+         ? join '-', unpack('x2 a8 a4 a4 a4 a12', $str)
+-        : $str
++        : $str =~ /-/
++        ? $str
++        : join '-', unpack('A8 A4 A4 A4 A12', $str)
+     );
+     return $uuid->export('bin');
+ }
+--- a/perl/uuid_compat.ts
++++ b/perl/uuid_compat.ts
+@@ -28,7 +28,7 @@
+ ##  uuid_compat.ts: Data::UUID Backward Compatibility Perl API (Perl test suite part)
+ ##
+ 
+-use Test::More tests => 14;
++use Test::More tests => 16;
+ 
+ BEGIN {
+     use_ok('Data::UUID');
+@@ -53,3 +53,5 @@
+ ok($uuid8 = $ug->from_string("6ba7b811-9dad-11d1-80b4-00c04fd430c8"));
+ ok($ug->compare($uuid7, $uuid8) == 0);
+ 
++ok($uuid9 = $ug->from_string("6ba7b8119dad11d180b400c04fd430c8"));
++ok($ug->compare($uuid7, $uuid9) == 0);
diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch b/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch
new file mode 100644
index 0000000..04222cb
--- /dev/null
+++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/install-pc.patch
@@ -0,0 +1,19 @@
+uuid.pc is generated at build time so should be installed from the current
+directory, and not $S.
+
+Upstream-Status: Pending [should be submitted]
+Signed-Off-By: Ross Burton <ross.burton@intel.com>
+
+Index: uuid-1.6.2/Makefile.in
+===================================================================
+--- uuid-1.6.2.orig/Makefile.in	2012-11-13 16:58:28.624156000 +0000
++++ uuid-1.6.2/Makefile.in	2012-11-13 17:05:24.224158670 +0000
+@@ -232,7 +232,7 @@
+ 	$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1
+ 	$(SHTOOL) install -c -m 755 uuid-config $(DESTDIR)$(bindir)/
+ 	$(SHTOOL) install -c -m 644 $(S)/uuid-config.1 $(DESTDIR)$(mandir)/man1/
+-	$(SHTOOL) install -c -m 644 $(S)/uuid.pc $(DESTDIR)$(libdir)/pkgconfig/
++	$(SHTOOL) install -c -m 644 uuid.pc $(DESTDIR)$(libdir)/pkgconfig/
+ 	$(SHTOOL) install -c -m 644 uuid.h $(DESTDIR)$(includedir)/
+ 	-@if [ ".$(WITH_DCE)" = .yes ]; then \
+ 	    echo "$(SHTOOL) install -c -m 644 $(S)/uuid_dce.h $(DESTDIR)$(includedir)/"; \
diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch b/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch
new file mode 100644
index 0000000..4dfc137
--- /dev/null
+++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/ldflags.patch
@@ -0,0 +1,26 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Pending
+
+--- uuid-1.6.2.orig/Makefile.in
++++ uuid-1.6.2/Makefile.in
+@@ -113,15 +113,15 @@ all: $(TARGETS)
+	@$(LIBTOOL) --mode=compile $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $<
+
+ $(LIB_NAME): $(LIB_OBJS)
+-	@$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
++	@$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
+	    -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+ $(DCE_NAME): $(DCE_OBJS)
+-	@$(LIBTOOL) --mode=link $(CC) -o $(DCE_NAME) $(DCE_OBJS) -rpath $(libdir) \
++	@$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(DCE_NAME) $(DCE_OBJS) -rpath $(libdir) \
+	    -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+ $(CXX_NAME): $(CXX_OBJS)
+-	@$(LIBTOOL) --mode=link $(CXX) -o $(CXX_NAME) $(CXX_OBJS) -rpath $(libdir) \
++	@$(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $(CXX_NAME) $(CXX_OBJS) -rpath $(libdir) \
+	    -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+ $(PRG_NAME): $(PRG_OBJS) $(LIB_NAME)
diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch b/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch
new file mode 100644
index 0000000..4bc91b8
--- /dev/null
+++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-libtool.patch
@@ -0,0 +1,27 @@
+Remove hardcoded libtool name, fall back to generated name
+
+Upstream-Status: Inappropriate [no upstream]
+The project appears to no longer be accepting changes.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur uuid-1.6.2.orig/Makefile.in uuid-1.6.2/Makefile.in
+--- uuid-1.6.2.orig/Makefile.in	2012-05-14 14:37:19.579672930 -0500
++++ uuid-1.6.2/Makefile.in	2012-05-14 14:37:49.112733787 -0500
+@@ -32,6 +32,7 @@
+ VPATH       = @srcdir@
+ srcdir      = @srcdir@
+ top_srcdir  = @top_srcdir@
++top_builddir = @top_builddir@
+ S           = $(srcdir)
+ C           = .
+ 
+@@ -55,7 +56,7 @@
+ CP          = cp
+ RMDIR       = rmdir
+ SHTOOL      = $(S)/shtool
+-LIBTOOL     = $(C)/libtool
++LIBTOOL     = @LIBTOOL@
+ TRUE        = true
+ POD2MAN     = pod2man
+ PERL        = @PERL@
diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch b/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch
new file mode 100644
index 0000000..d806b5f
--- /dev/null
+++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid/uuid-nostrip.patch
@@ -0,0 +1,19 @@
+We don't want anything stripped
+
+Upstream-Status: Inappropriate [no upstream]
+The project appears to no longer be accepting changes.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur uuid-1.6.2.orig/Makefile.in uuid-1.6.2/Makefile.in
+--- uuid-1.6.2.orig/Makefile.in	2012-05-14 14:42:42.225789456 -0500
++++ uuid-1.6.2/Makefile.in	2012-05-14 15:03:03.119733400 -0500
+@@ -254,7 +254,7 @@
+ 	-@if [ ".$(WITH_CXX)" = .yes ]; then \
+ 	    $(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(CXX_NAME) $(DESTDIR)$(libdir)/; \
+ 	fi
+-	@$(LIBTOOL) --mode=install $(SHTOOL) install -c -s -m 755 uuid $(DESTDIR)$(bindir)/
++	@$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 755 uuid $(DESTDIR)$(bindir)/
+ 	$(SHTOOL) install -c -m 644 $(S)/uuid.1 $(DESTDIR)$(mandir)/man1/
+ 	-@if [ ".$(WITH_PERL)" = .yes ]; then \
+ 	    (cd $(S)/perl && $(MAKE) $(MFLAGS) install DESTDIR=$(DESTDIR)); \
diff --git a/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb b/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb
new file mode 100644
index 0000000..08926ba
--- /dev/null
+++ b/meta/recipes-devtools/ossp-uuid/ossp-uuid_1.6.2.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Universally Unique Identifier (UUID) library"
+DESCRIPTION = "OSSP uuid is a ISO-C:1999 application programming interface \
+(API) and corresponding command line interface (CLI) for the generation of \
+DCE 1.1, ISO/IEC 11578:1996 and RFC 4122 compliant Universally Unique \
+Identifier (UUID). It supports DCE 1.1 variant UUIDs of version 1 (time \
+and node based), version 3 (name based, MD5), version 4 (random number \
+based) and version 5 (name based, SHA-1)."
+DESCRIPTION_uuid = "This package contains a tool to create Universally \
+Unique Identifiers (UUID) from the command-line."
+
+HOMEPAGE = "http://www.ossp.org/pkg/lib/uuid/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README;beginline=30;endline=55;md5=b394fadb039bbfca6ad9d9d769ee960e \
+	   file://uuid_md5.c;beginline=1;endline=28;md5=9c1f4b2218546deae24c91be1dcf00dd"
+
+PR = "r2"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/o/${BPN}/${BPN}_${PV}.orig.tar.gz \
+	   file://0001-Change-library-name.patch \
+	   file://0002-uuid-preserve-m-option-status-in-v-option-handling.patch \
+	   file://0003-Fix-whatis-entries.patch \
+	   file://0004-fix-data-uuid-from-string.patch \
+	   file://uuid-libtool.patch \
+	   file://uuid-nostrip.patch \
+           file://install-pc.patch \
+           file://ldflags.patch \
+	  "
+SRC_URI[md5sum] = "5db0d43a9022a6ebbbc25337ae28942f"
+SRC_URI[sha256sum] = "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0"
+
+S = "${WORKDIR}/uuid-${PV}"
+
+inherit autotools update-alternatives
+
+EXTRA_OECONF = "--without-dce --without-cxx --without-perl --without-perl-compat --without-php --without-pgsql"
+EXTRA_OECONF = "--includedir=${includedir}/ossp"
+
+do_configure_prepend() {
+  # This package has a completely custom aclocal.m4, which should be acinclude.m4.
+  if [ ! -e ${S}/acinclude.m4 ]; then
+    mv ${S}/aclocal.m4 ${S}/acinclude.m4
+  fi
+
+  rm -f ${S}/libtool.m4
+}
+
+do_install_append() {
+  mkdir -p  ${D}${includedir}/ossp
+  mv ${D}${libdir}/pkgconfig/uuid.pc ${D}${libdir}/pkgconfig/ossp-uuid.pc
+}
+
+PACKAGES =+ "uuid"
+FILES_uuid = "${bindir}/uuid"
+FILES_${PN} = "${libdir}/libossp-uuid.so.16*"
+FILES_${PN}-dev += "${bindir}/uuid-config"
+
+BBCLASSEXTEND = "native nativesdk"
+
+ALTERNATIVE_${PN}-doc = "uuid.3"
+ALTERNATIVE_PRIORITY_${PN}-doc = "200"
+ALTERNATIVE_LINK_NAME[uuid.3] = "${mandir}/man3/uuid.3"
diff --git a/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb b/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb
new file mode 100644
index 0000000..e831860
--- /dev/null
+++ b/meta/recipes-devtools/packagegroups/packagegroup-core-device-devel.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Provides a small set of tools for development on the device"
+LICENSE = "MIT"
+
+PR = "r1"
+
+inherit packagegroup
+
+RPROVIDES_${PN} = "qemu-config"
+RREPLACES_${PN} = "qemu-config"
+RCONFLICTS_${PN} = "qemu-config"
+
+RDEPENDS_${PN} = "\
+    distcc-config \
+    oprofileui-server \
+    nfs-export-root \
+    bash \
+    "
+
diff --git a/meta/recipes-devtools/patch/patch.inc b/meta/recipes-devtools/patch/patch.inc
new file mode 100644
index 0000000..cbfb8cf
--- /dev/null
+++ b/meta/recipes-devtools/patch/patch.inc
@@ -0,0 +1,14 @@
+SUMMARY = "Tool for applying a patch file"
+DESCRIPTION = "patch takes a patch file containing a difference listing \
+produced by the diff program and applies those differences to one or more \
+original files, producing patched versions."
+SECTION = "utils"
+HOMEPAGE = "http://savannah.gnu.org/projects/patch/"
+
+SRC_URI = "${GNU_MIRROR}/patch/patch-${PV}.tar.gz"
+S = "${WORKDIR}/patch-${PV}"
+
+inherit autotools update-alternatives
+
+ALTERNATIVE_${PN} = "patch"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..ba1a4ba
--- /dev/null
+++ b/meta/recipes-devtools/patch/patch/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
+-- 
+2.1.4
+
diff --git a/meta/recipes-devtools/patch/patch/debian.patch b/meta/recipes-devtools/patch/patch/debian.patch
new file mode 100644
index 0000000..1a07646
--- /dev/null
+++ b/meta/recipes-devtools/patch/patch/debian.patch
@@ -0,0 +1,10426 @@
+Upstream-Status: Inappropriate [debian patch]
+
+--- patch-2.5.9.orig/m4/hash.m4
++++ patch-2.5.9/m4/hash.m4
+@@ -0,0 +1,15 @@
++# hash.m4 serial 1
++dnl Copyright (C) 2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++AC_DEFUN([gl_HASH],
++[
++  dnl Prerequisites of lib/hash.c.
++  AC_CHECK_HEADERS_ONCE(stdlib.h)
++  AC_HEADER_STDBOOL
++  AC_CHECK_DECLS_ONCE(free malloc)
++])
+--- patch-2.5.9.orig/m4/nanosecond_stat.m4
++++ patch-2.5.9/m4/nanosecond_stat.m4
+@@ -0,0 +1,35 @@
++AC_DEFUN([ag_CHECK_NANOSECOND_STAT],
++  [AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
++     [ac_cv_stat_nsec],
++     [AC_TRY_COMPILE(
++	[
++	  #include <sys/types.h>
++	  #include <sys/stat.h>
++	  #include <unistd.h>
++	  struct stat st;
++	],
++	[ return st.st_atimensec + st.st_mtimensec + st.st_ctimensec; ],
++	[ac_cv_stat_nsec=yes],
++	[ac_cv_stat_nsec=no])
++     ])
++   if test $ac_cv_stat_nsec = yes; then
++     AC_DEFINE(HAVE_STAT_NSEC, 1, [Define to 1 if struct stat has nanosecond timestamps.])
++   fi
++
++   AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
++     [ac_cv_stat_timeval],
++     [AC_TRY_COMPILE(
++	[
++	  #include <time.h>
++	  #include <sys/types.h>
++	  #include <sys/stat.h>
++	  #include <unistd.h>
++	  struct stat st;
++	],
++	[ return st.st_atim.tv_nsec + st.st_mtim.tv_nsec + st.st_ctim.tv_nsec; ],
++	[ac_cv_stat_timeval=yes],
++	[ac_cv_stat_timeval=no])
++     ])
++   if test $ac_cv_stat_timeval = yes; then
++     AC_DEFINE(HAVE_STAT_TIMEVAL, 1, [Define to 1 if struct stat comtains struct timeval's.])
++   fi])
+--- patch-2.5.9.orig/Makefile.in
++++ patch-2.5.9/Makefile.in
+@@ -62,7 +62,7 @@
+ SHELL = /bin/sh
+ 
+ LIBSRCS = error.c malloc.c memchr.c mkdir.c \
+-	realloc.c rmdir.c strcasecmp.c strncasecmp.c
++	realloc.c rmdir.c strcasecmp.c strncasecmp.c hash.c
+ SRCS = $(LIBSRCS) \
+ 	addext.c argmatch.c backupfile.c \
+ 	basename.c dirname.c \
+@@ -78,12 +78,12 @@
+ 	maketime.$(OBJEXT) partime.$(OBJEXT) \
+ 	patch.$(OBJEXT) pch.$(OBJEXT) \
+ 	quote.$(OBJEXT) quotearg.$(OBJEXT) quotesys.$(OBJEXT) \
+-	util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT)
++	util.$(OBJEXT) version.$(OBJEXT) xmalloc.$(OBJEXT) hash.$(OBJEXT)
+ HDRS = argmatch.h backupfile.h common.h dirname.h \
+ 	error.h getopt.h gettext.h \
+ 	inp.h maketime.h partime.h pch.h \
+ 	quote.h quotearg.h quotesys.h \
+-	unlocked-io.h util.h version.h xalloc.h
++	unlocked-io.h util.h version.h xalloc.h hash.h
+ MISC = AUTHORS COPYING ChangeLog INSTALL Makefile.in NEWS README \
+ 	aclocal.m4 \
+ 	config.hin configure configure.ac \
+--- patch-2.5.9.orig/aclocal.m4
++++ patch-2.5.9/aclocal.m4
+@@ -1,3 +1,1058 @@
++dnl aclocal.m4 generated automatically by aclocal 1.4-p6
++
++dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++
++dnl This program is distributed in the hope that it will be useful,
++dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
++dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
++dnl PARTICULAR PURPOSE.
++
++# lib-prefix.m4 serial 3 (gettext-0.13)
++dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
++dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
++dnl require excessive bracketing.
++ifdef([AC_HELP_STRING],
++[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
++[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
++
++dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
++dnl to access previously installed libraries. The basic assumption is that
++dnl a user will want packages to use other packages he previously installed
++dnl with the same --prefix option.
++dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
++dnl libraries, but is otherwise very convenient.
++AC_DEFUN([AC_LIB_PREFIX],
++[
++  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
++  AC_REQUIRE([AC_PROG_CC])
++  AC_REQUIRE([AC_CANONICAL_HOST])
++  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++  dnl By default, look in $includedir and $libdir.
++  use_additional=yes
++  AC_LIB_WITH_FINAL_PREFIX([
++    eval additional_includedir=\"$includedir\"
++    eval additional_libdir=\"$libdir\"
++  ])
++  AC_LIB_ARG_WITH([lib-prefix],
++[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
++  --without-lib-prefix    don't search for libraries in includedir and libdir],
++[
++    if test "X$withval" = "Xno"; then
++      use_additional=no
++    else
++      if test "X$withval" = "X"; then
++        AC_LIB_WITH_FINAL_PREFIX([
++          eval additional_includedir=\"$includedir\"
++          eval additional_libdir=\"$libdir\"
++        ])
++      else
++        additional_includedir="$withval/include"
++        additional_libdir="$withval/lib"
++      fi
++    fi
++])
++  if test $use_additional = yes; then
++    dnl Potentially add $additional_includedir to $CPPFLAGS.
++    dnl But don't add it
++    dnl   1. if it's the standard /usr/include,
++    dnl   2. if it's already present in $CPPFLAGS,
++    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
++    dnl   4. if it doesn't exist as a directory.
++    if test "X$additional_includedir" != "X/usr/include"; then
++      haveit=
++      for x in $CPPFLAGS; do
++        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++        if test "X$x" = "X-I$additional_includedir"; then
++          haveit=yes
++          break
++        fi
++      done
++      if test -z "$haveit"; then
++        if test "X$additional_includedir" = "X/usr/local/include"; then
++          if test -n "$GCC"; then
++            case $host_os in
++              linux*) haveit=yes;;
++            esac
++          fi
++        fi
++        if test -z "$haveit"; then
++          if test -d "$additional_includedir"; then
++            dnl Really add $additional_includedir to $CPPFLAGS.
++            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
++          fi
++        fi
++      fi
++    fi
++    dnl Potentially add $additional_libdir to $LDFLAGS.
++    dnl But don't add it
++    dnl   1. if it's the standard /usr/lib,
++    dnl   2. if it's already present in $LDFLAGS,
++    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
++    dnl   4. if it doesn't exist as a directory.
++    if test "X$additional_libdir" != "X/usr/lib"; then
++      haveit=
++      for x in $LDFLAGS; do
++        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++        if test "X$x" = "X-L$additional_libdir"; then
++          haveit=yes
++          break
++        fi
++      done
++      if test -z "$haveit"; then
++        if test "X$additional_libdir" = "X/usr/local/lib"; then
++          if test -n "$GCC"; then
++            case $host_os in
++              linux*) haveit=yes;;
++            esac
++          fi
++        fi
++        if test -z "$haveit"; then
++          if test -d "$additional_libdir"; then
++            dnl Really add $additional_libdir to $LDFLAGS.
++            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
++          fi
++        fi
++      fi
++    fi
++  fi
++])
++
++dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
++dnl acl_final_exec_prefix, containing the values to which $prefix and
++dnl $exec_prefix will expand at the end of the configure script.
++AC_DEFUN([AC_LIB_PREPARE_PREFIX],
++[
++  dnl Unfortunately, prefix and exec_prefix get only finally determined
++  dnl at the end of configure.
++  if test "X$prefix" = "XNONE"; then
++    acl_final_prefix="$ac_default_prefix"
++  else
++    acl_final_prefix="$prefix"
++  fi
++  if test "X$exec_prefix" = "XNONE"; then
++    acl_final_exec_prefix='${prefix}'
++  else
++    acl_final_exec_prefix="$exec_prefix"
++  fi
++  acl_save_prefix="$prefix"
++  prefix="$acl_final_prefix"
++  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
++  prefix="$acl_save_prefix"
++])
++
++dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
++dnl variables prefix and exec_prefix bound to the values they will have
++dnl at the end of the configure script.
++AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
++[
++  acl_save_prefix="$prefix"
++  prefix="$acl_final_prefix"
++  acl_save_exec_prefix="$exec_prefix"
++  exec_prefix="$acl_final_exec_prefix"
++  $1
++  exec_prefix="$acl_save_exec_prefix"
++  prefix="$acl_save_prefix"
++])
++
++# lib-link.m4 serial 4 (gettext-0.12)
++dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Bruno Haible.
++
++dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
++dnl the libraries corresponding to explicit and implicit dependencies.
++dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
++dnl augments the CPPFLAGS variable.
++AC_DEFUN([AC_LIB_LINKFLAGS],
++[
++  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++  AC_REQUIRE([AC_LIB_RPATH])
++  define([Name],[translit([$1],[./-], [___])])
++  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
++    AC_LIB_LINKFLAGS_BODY([$1], [$2])
++    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
++    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
++    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
++  ])
++  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
++  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
++  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
++  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
++  AC_SUBST([LIB]NAME)
++  AC_SUBST([LTLIB]NAME)
++  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
++  dnl results of this search when this library appears as a dependency.
++  HAVE_LIB[]NAME=yes
++  undefine([Name])
++  undefine([NAME])
++])
++
++dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
++dnl searches for libname and the libraries corresponding to explicit and
++dnl implicit dependencies, together with the specified include files and
++dnl the ability to compile and link the specified testcode. If found, it
++dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
++dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
++dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
++dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
++AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
++[
++  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
++  AC_REQUIRE([AC_LIB_RPATH])
++  define([Name],[translit([$1],[./-], [___])])
++  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++
++  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
++  dnl accordingly.
++  AC_LIB_LINKFLAGS_BODY([$1], [$2])
++
++  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
++  dnl because if the user has installed lib[]Name and not disabled its use
++  dnl via --without-lib[]Name-prefix, he wants to use it.
++  ac_save_CPPFLAGS="$CPPFLAGS"
++  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
++
++  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
++    ac_save_LIBS="$LIBS"
++    LIBS="$LIBS $LIB[]NAME"
++    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
++    LIBS="$ac_save_LIBS"
++  ])
++  if test "$ac_cv_lib[]Name" = yes; then
++    HAVE_LIB[]NAME=yes
++    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
++    AC_MSG_CHECKING([how to link with lib[]$1])
++    AC_MSG_RESULT([$LIB[]NAME])
++  else
++    HAVE_LIB[]NAME=no
++    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
++    dnl $INC[]NAME either.
++    CPPFLAGS="$ac_save_CPPFLAGS"
++    LIB[]NAME=
++    LTLIB[]NAME=
++  fi
++  AC_SUBST([HAVE_LIB]NAME)
++  AC_SUBST([LIB]NAME)
++  AC_SUBST([LTLIB]NAME)
++  undefine([Name])
++  undefine([NAME])
++])
++
++dnl Determine the platform dependent parameters needed to use rpath:
++dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
++dnl hardcode_direct, hardcode_minus_L.
++AC_DEFUN([AC_LIB_RPATH],
++[
++  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
++  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
++  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
++  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
++  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
++    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
++    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
++    . ./conftest.sh
++    rm -f ./conftest.sh
++    acl_cv_rpath=done
++  ])
++  wl="$acl_cv_wl"
++  libext="$acl_cv_libext"
++  shlibext="$acl_cv_shlibext"
++  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
++  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
++  hardcode_direct="$acl_cv_hardcode_direct"
++  hardcode_minus_L="$acl_cv_hardcode_minus_L"
++  dnl Determine whether the user wants rpath handling at all.
++  AC_ARG_ENABLE(rpath,
++    [  --disable-rpath         do not hardcode runtime library paths],
++    :, enable_rpath=yes)
++])
++
++dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
++dnl the libraries corresponding to explicit and implicit dependencies.
++dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
++AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
++[
++  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
++                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
++  dnl By default, look in $includedir and $libdir.
++  use_additional=yes
++  AC_LIB_WITH_FINAL_PREFIX([
++    eval additional_includedir=\"$includedir\"
++    eval additional_libdir=\"$libdir\"
++  ])
++  AC_LIB_ARG_WITH([lib$1-prefix],
++[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
++  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
++[
++    if test "X$withval" = "Xno"; then
++      use_additional=no
++    else
++      if test "X$withval" = "X"; then
++        AC_LIB_WITH_FINAL_PREFIX([
++          eval additional_includedir=\"$includedir\"
++          eval additional_libdir=\"$libdir\"
++        ])
++      else
++        additional_includedir="$withval/include"
++        additional_libdir="$withval/lib"
++      fi
++    fi
++])
++  dnl Search the library and its dependencies in $additional_libdir and
++  dnl $LDFLAGS. Using breadth-first-seach.
++  LIB[]NAME=
++  LTLIB[]NAME=
++  INC[]NAME=
++  rpathdirs=
++  ltrpathdirs=
++  names_already_handled=
++  names_next_round='$1 $2'
++  while test -n "$names_next_round"; do
++    names_this_round="$names_next_round"
++    names_next_round=
++    for name in $names_this_round; do
++      already_handled=
++      for n in $names_already_handled; do
++        if test "$n" = "$name"; then
++          already_handled=yes
++          break
++        fi
++      done
++      if test -z "$already_handled"; then
++        names_already_handled="$names_already_handled $name"
++        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
++        dnl or AC_LIB_HAVE_LINKFLAGS call.
++        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
++        eval value=\"\$HAVE_LIB$uppername\"
++        if test -n "$value"; then
++          if test "$value" = yes; then
++            eval value=\"\$LIB$uppername\"
++            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
++            eval value=\"\$LTLIB$uppername\"
++            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
++          else
++            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
++            dnl that this library doesn't exist. So just drop it.
++            :
++          fi
++        else
++          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
++          dnl and the already constructed $LIBNAME/$LTLIBNAME.
++          found_dir=
++          found_la=
++          found_so=
++          found_a=
++          if test $use_additional = yes; then
++            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
++              found_dir="$additional_libdir"
++              found_so="$additional_libdir/lib$name.$shlibext"
++              if test -f "$additional_libdir/lib$name.la"; then
++                found_la="$additional_libdir/lib$name.la"
++              fi
++            else
++              if test -f "$additional_libdir/lib$name.$libext"; then
++                found_dir="$additional_libdir"
++                found_a="$additional_libdir/lib$name.$libext"
++                if test -f "$additional_libdir/lib$name.la"; then
++                  found_la="$additional_libdir/lib$name.la"
++                fi
++              fi
++            fi
++          fi
++          if test "X$found_dir" = "X"; then
++            for x in $LDFLAGS $LTLIB[]NAME; do
++              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++              case "$x" in
++                -L*)
++                  dir=`echo "X$x" | sed -e 's/^X-L//'`
++                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
++                    found_dir="$dir"
++                    found_so="$dir/lib$name.$shlibext"
++                    if test -f "$dir/lib$name.la"; then
++                      found_la="$dir/lib$name.la"
++                    fi
++                  else
++                    if test -f "$dir/lib$name.$libext"; then
++                      found_dir="$dir"
++                      found_a="$dir/lib$name.$libext"
++                      if test -f "$dir/lib$name.la"; then
++                        found_la="$dir/lib$name.la"
++                      fi
++                    fi
++                  fi
++                  ;;
++              esac
++              if test "X$found_dir" != "X"; then
++                break
++              fi
++            done
++          fi
++          if test "X$found_dir" != "X"; then
++            dnl Found the library.
++            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
++            if test "X$found_so" != "X"; then
++              dnl Linking with a shared library. We attempt to hardcode its
++              dnl directory into the executable's runpath, unless it's the
++              dnl standard /usr/lib.
++              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
++                dnl No hardcoding is needed.
++                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++              else
++                dnl Use an explicit option to hardcode DIR into the resulting
++                dnl binary.
++                dnl Potentially add DIR to ltrpathdirs.
++                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
++                haveit=
++                for x in $ltrpathdirs; do
++                  if test "X$x" = "X$found_dir"; then
++                    haveit=yes
++                    break
++                  fi
++                done
++                if test -z "$haveit"; then
++                  ltrpathdirs="$ltrpathdirs $found_dir"
++                fi
++                dnl The hardcoding into $LIBNAME is system dependent.
++                if test "$hardcode_direct" = yes; then
++                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
++                  dnl resulting binary.
++                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++                else
++                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
++                    dnl Use an explicit option to hardcode DIR into the resulting
++                    dnl binary.
++                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++                    dnl Potentially add DIR to rpathdirs.
++                    dnl The rpathdirs will be appended to $LIBNAME at the end.
++                    haveit=
++                    for x in $rpathdirs; do
++                      if test "X$x" = "X$found_dir"; then
++                        haveit=yes
++                        break
++                      fi
++                    done
++                    if test -z "$haveit"; then
++                      rpathdirs="$rpathdirs $found_dir"
++                    fi
++                  else
++                    dnl Rely on "-L$found_dir".
++                    dnl But don't add it if it's already contained in the LDFLAGS
++                    dnl or the already constructed $LIBNAME
++                    haveit=
++                    for x in $LDFLAGS $LIB[]NAME; do
++                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++                      if test "X$x" = "X-L$found_dir"; then
++                        haveit=yes
++                        break
++                      fi
++                    done
++                    if test -z "$haveit"; then
++                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
++                    fi
++                    if test "$hardcode_minus_L" != no; then
++                      dnl FIXME: Not sure whether we should use
++                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
++                      dnl here.
++                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
++                    else
++                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
++                      dnl here, because this doesn't fit in flags passed to the
++                      dnl compiler. So give up. No hardcoding. This affects only
++                      dnl very old systems.
++                      dnl FIXME: Not sure whether we should use
++                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
++                      dnl here.
++                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
++                    fi
++                  fi
++                fi
++              fi
++            else
++              if test "X$found_a" != "X"; then
++                dnl Linking with a static library.
++                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
++              else
++                dnl We shouldn't come here, but anyway it's good to have a
++                dnl fallback.
++                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
++              fi
++            fi
++            dnl Assume the include files are nearby.
++            additional_includedir=
++            case "$found_dir" in
++              */lib | */lib/)
++                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
++                additional_includedir="$basedir/include"
++                ;;
++            esac
++            if test "X$additional_includedir" != "X"; then
++              dnl Potentially add $additional_includedir to $INCNAME.
++              dnl But don't add it
++              dnl   1. if it's the standard /usr/include,
++              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
++              dnl   3. if it's already present in $CPPFLAGS or the already
++              dnl      constructed $INCNAME,
++              dnl   4. if it doesn't exist as a directory.
++              if test "X$additional_includedir" != "X/usr/include"; then
++                haveit=
++                if test "X$additional_includedir" = "X/usr/local/include"; then
++                  if test -n "$GCC"; then
++                    case $host_os in
++                      linux*) haveit=yes;;
++                    esac
++                  fi
++                fi
++                if test -z "$haveit"; then
++                  for x in $CPPFLAGS $INC[]NAME; do
++                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++                    if test "X$x" = "X-I$additional_includedir"; then
++                      haveit=yes
++                      break
++                    fi
++                  done
++                  if test -z "$haveit"; then
++                    if test -d "$additional_includedir"; then
++                      dnl Really add $additional_includedir to $INCNAME.
++                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
++                    fi
++                  fi
++                fi
++              fi
++            fi
++            dnl Look for dependencies.
++            if test -n "$found_la"; then
++              dnl Read the .la file. It defines the variables
++              dnl dlname, library_names, old_library, dependency_libs, current,
++              dnl age, revision, installed, dlopen, dlpreopen, libdir.
++              save_libdir="$libdir"
++              case "$found_la" in
++                */* | *\\*) . "$found_la" ;;
++                *) . "./$found_la" ;;
++              esac
++              libdir="$save_libdir"
++              dnl We use only dependency_libs.
++              for dep in $dependency_libs; do
++                case "$dep" in
++                  -L*)
++                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
++                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
++                    dnl But don't add it
++                    dnl   1. if it's the standard /usr/lib,
++                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
++                    dnl   3. if it's already present in $LDFLAGS or the already
++                    dnl      constructed $LIBNAME,
++                    dnl   4. if it doesn't exist as a directory.
++                    if test "X$additional_libdir" != "X/usr/lib"; then
++                      haveit=
++                      if test "X$additional_libdir" = "X/usr/local/lib"; then
++                        if test -n "$GCC"; then
++                          case $host_os in
++                            linux*) haveit=yes;;
++                          esac
++                        fi
++                      fi
++                      if test -z "$haveit"; then
++                        haveit=
++                        for x in $LDFLAGS $LIB[]NAME; do
++                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++                          if test "X$x" = "X-L$additional_libdir"; then
++                            haveit=yes
++                            break
++                          fi
++                        done
++                        if test -z "$haveit"; then
++                          if test -d "$additional_libdir"; then
++                            dnl Really add $additional_libdir to $LIBNAME.
++                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
++                          fi
++                        fi
++                        haveit=
++                        for x in $LDFLAGS $LTLIB[]NAME; do
++                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++                          if test "X$x" = "X-L$additional_libdir"; then
++                            haveit=yes
++                            break
++                          fi
++                        done
++                        if test -z "$haveit"; then
++                          if test -d "$additional_libdir"; then
++                            dnl Really add $additional_libdir to $LTLIBNAME.
++                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
++                          fi
++                        fi
++                      fi
++                    fi
++                    ;;
++                  -R*)
++                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
++                    if test "$enable_rpath" != no; then
++                      dnl Potentially add DIR to rpathdirs.
++                      dnl The rpathdirs will be appended to $LIBNAME at the end.
++                      haveit=
++                      for x in $rpathdirs; do
++                        if test "X$x" = "X$dir"; then
++                          haveit=yes
++                          break
++                        fi
++                      done
++                      if test -z "$haveit"; then
++                        rpathdirs="$rpathdirs $dir"
++                      fi
++                      dnl Potentially add DIR to ltrpathdirs.
++                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
++                      haveit=
++                      for x in $ltrpathdirs; do
++                        if test "X$x" = "X$dir"; then
++                          haveit=yes
++                          break
++                        fi
++                      done
++                      if test -z "$haveit"; then
++                        ltrpathdirs="$ltrpathdirs $dir"
++                      fi
++                    fi
++                    ;;
++                  -l*)
++                    dnl Handle this in the next round.
++                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
++                    ;;
++                  *.la)
++                    dnl Handle this in the next round. Throw away the .la's
++                    dnl directory; it is already contained in a preceding -L
++                    dnl option.
++                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
++                    ;;
++                  *)
++                    dnl Most likely an immediate library name.
++                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
++                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
++                    ;;
++                esac
++              done
++            fi
++          else
++            dnl Didn't find the library; assume it is in the system directories
++            dnl known to the linker and runtime loader. (All the system
++            dnl directories known to the linker should also be known to the
++            dnl runtime loader, otherwise the system is severely misconfigured.)
++            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
++            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
++          fi
++        fi
++      fi
++    done
++  done
++  if test "X$rpathdirs" != "X"; then
++    if test -n "$hardcode_libdir_separator"; then
++      dnl Weird platform: only the last -rpath option counts, the user must
++      dnl pass all path elements in one option. We can arrange that for a
++      dnl single library, but not when more than one $LIBNAMEs are used.
++      alldirs=
++      for found_dir in $rpathdirs; do
++        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
++      done
++      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
++      acl_save_libdir="$libdir"
++      libdir="$alldirs"
++      eval flag=\"$hardcode_libdir_flag_spec\"
++      libdir="$acl_save_libdir"
++      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
++    else
++      dnl The -rpath options are cumulative.
++      for found_dir in $rpathdirs; do
++        acl_save_libdir="$libdir"
++        libdir="$found_dir"
++        eval flag=\"$hardcode_libdir_flag_spec\"
++        libdir="$acl_save_libdir"
++        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
++      done
++    fi
++  fi
++  if test "X$ltrpathdirs" != "X"; then
++    dnl When using libtool, the option that works for both libraries and
++    dnl executables is -R. The -R options are cumulative.
++    for found_dir in $ltrpathdirs; do
++      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
++    done
++  fi
++])
++
++dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
++dnl unless already present in VAR.
++dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
++dnl contains two or three consecutive elements that belong together.
++AC_DEFUN([AC_LIB_APPENDTOVAR],
++[
++  for element in [$2]; do
++    haveit=
++    for x in $[$1]; do
++      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
++      if test "X$x" = "X$element"; then
++        haveit=yes
++        break
++      fi
++    done
++    if test -z "$haveit"; then
++      [$1]="${[$1]}${[$1]:+ }$element"
++    fi
++  done
++])
++
++# lib-ld.m4 serial 3 (gettext-0.13)
++dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl Subroutines of libtool.m4,
++dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
++dnl with libtool.m4.
++
++dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
++AC_DEFUN([AC_LIB_PROG_LD_GNU],
++[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
++[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
++case `$LD -v 2>&1 </dev/null` in
++*GNU* | *'with BFD'*)
++  acl_cv_prog_gnu_ld=yes ;;
++*)
++  acl_cv_prog_gnu_ld=no ;;
++esac])
++with_gnu_ld=$acl_cv_prog_gnu_ld
++])
++
++dnl From libtool-1.4. Sets the variable LD.
++AC_DEFUN([AC_LIB_PROG_LD],
++[AC_ARG_WITH(gnu-ld,
++[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
++test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
++AC_REQUIRE([AC_PROG_CC])dnl
++AC_REQUIRE([AC_CANONICAL_HOST])dnl
++# Prepare PATH_SEPARATOR.
++# The user is always right.
++if test "${PATH_SEPARATOR+set}" != set; then
++  echo "#! /bin/sh" >conf$$.sh
++  echo  "exit 0"   >>conf$$.sh
++  chmod +x conf$$.sh
++  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
++    PATH_SEPARATOR=';'
++  else
++    PATH_SEPARATOR=:
++  fi
++  rm -f conf$$.sh
++fi
++ac_prog=ld
++if test "$GCC" = yes; then
++  # Check if gcc -print-prog-name=ld gives a path.
++  AC_MSG_CHECKING([for ld used by GCC])
++  case $host in
++  *-*-mingw*)
++    # gcc leaves a trailing carriage return which upsets mingw
++    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
++  *)
++    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
++  esac
++  case $ac_prog in
++    # Accept absolute paths.
++    [[\\/]* | [A-Za-z]:[\\/]*)]
++      [re_direlt='/[^/][^/]*/\.\./']
++      # Canonicalize the path of ld
++      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
++      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
++	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
++      done
++      test -z "$LD" && LD="$ac_prog"
++      ;;
++  "")
++    # If it fails, then pretend we aren't using GCC.
++    ac_prog=ld
++    ;;
++  *)
++    # If it is relative, then search for the first ld in PATH.
++    with_gnu_ld=unknown
++    ;;
++  esac
++elif test "$with_gnu_ld" = yes; then
++  AC_MSG_CHECKING([for GNU ld])
++else
++  AC_MSG_CHECKING([for non-GNU ld])
++fi
++AC_CACHE_VAL(acl_cv_path_LD,
++[if test -z "$LD"; then
++  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
++  for ac_dir in $PATH; do
++    test -z "$ac_dir" && ac_dir=.
++    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
++      acl_cv_path_LD="$ac_dir/$ac_prog"
++      # Check to see if the program is GNU ld.  I'd rather use --version,
++      # but apparently some GNU ld's only accept -v.
++      # Break only if it was the GNU/non-GNU ld that we prefer.
++      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
++      *GNU* | *'with BFD'*)
++	test "$with_gnu_ld" != no && break ;;
++      *)
++	test "$with_gnu_ld" != yes && break ;;
++      esac
++    fi
++  done
++  IFS="$ac_save_ifs"
++else
++  acl_cv_path_LD="$LD" # Let the user override the test with a path.
++fi])
++LD="$acl_cv_path_LD"
++if test -n "$LD"; then
++  AC_MSG_RESULT($LD)
++else
++  AC_MSG_RESULT(no)
++fi
++test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
++AC_LIB_PROG_LD_GNU
++])
++
++# isc-posix.m4 serial 2 (gettext-0.11.2)
++dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
++
++# This test replaces the one in autoconf.
++# Currently this macro should have the same name as the autoconf macro
++# because gettext's gettext.m4 (distributed in the automake package)
++# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
++# give these diagnostics:
++#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
++#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
++
++undefine([AC_ISC_POSIX])
++
++AC_DEFUN([AC_ISC_POSIX],
++  [
++    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
++    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
++  ]
++)
++
++# Check for stdbool.h that conforms to C99.
++
++# Copyright (C) 2002-2003 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++# 02111-1307, USA.
++
++# Prepare for substituting <stdbool.h> if it is not supported.
++
++AC_DEFUN([AM_STDBOOL_H],
++[
++  AC_REQUIRE([AC_HEADER_STDBOOL])
++
++  # Define two additional variables used in the Makefile substitution.
++
++  if test "$ac_cv_header_stdbool_h" = yes; then
++    STDBOOL_H=''
++  else
++    STDBOOL_H='stdbool.h'
++  fi
++  AC_SUBST([STDBOOL_H])
++
++  if test "$ac_cv_type__Bool" = yes; then
++    HAVE__BOOL=1
++  else
++    HAVE__BOOL=0
++  fi
++  AC_SUBST([HAVE__BOOL])
++])
++
++# This macro is only needed in autoconf <= 2.54.  Newer versions of autoconf
++# have this macro built-in.
++
++AC_DEFUN([AC_HEADER_STDBOOL],
++  [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
++     [ac_cv_header_stdbool_h],
++     [AC_TRY_COMPILE(
++	[
++	  #include <stdbool.h>
++	  #ifndef bool
++	   "error: bool is not defined"
++	  #endif
++	  #ifndef false
++	   "error: false is not defined"
++	  #endif
++	  #if false
++	   "error: false is not 0"
++	  #endif
++	  #ifndef true
++	   "error: false is not defined"
++	  #endif
++	  #if true != 1
++	   "error: true is not 1"
++	  #endif
++	  #ifndef __bool_true_false_are_defined
++	   "error: __bool_true_false_are_defined is not defined"
++	  #endif
++
++	  struct s { _Bool s: 1; _Bool t; } s;
++
++	  char a[true == 1 ? 1 : -1];
++	  char b[false == 0 ? 1 : -1];
++	  char c[__bool_true_false_are_defined == 1 ? 1 : -1];
++	  char d[(bool) -0.5 == true ? 1 : -1];
++	  bool e = &s;
++	  char f[(_Bool) -0.0 == false ? 1 : -1];
++	  char g[true];
++	  char h[sizeof (_Bool)];
++	  char i[sizeof s.t];
++	],
++	[ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
++	[ac_cv_header_stdbool_h=yes],
++	[ac_cv_header_stdbool_h=no])])
++   AC_CHECK_TYPES([_Bool])
++   if test $ac_cv_header_stdbool_h = yes; then
++     AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
++   fi])
++
++#serial 5
++
++dnl From Jim Meyering
++
++dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
++dnl usually in <utime.h>.
++dnl Some systems have utime.h but don't declare the struct anywhere.
++
++AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
++[
++  AC_CHECK_HEADERS_ONCE(sys/time.h utime.h)
++  AC_REQUIRE([AC_HEADER_TIME])
++  AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
++    [AC_TRY_COMPILE(
++      [
++#ifdef TIME_WITH_SYS_TIME
++# include <sys/time.h>
++# include <time.h>
++#else
++# ifdef HAVE_SYS_TIME_H
++#  include <sys/time.h>
++# else
++#  include <time.h>
++# endif
++#endif
++#ifdef HAVE_UTIME_H
++# include <utime.h>
++#endif
++      ],
++      [static struct utimbuf x; x.actime = x.modtime;],
++      fu_cv_sys_struct_utimbuf=yes,
++      fu_cv_sys_struct_utimbuf=no)
++    ])
++
++  if test $fu_cv_sys_struct_utimbuf = yes; then
++    AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
++      [Define if struct utimbuf is declared -- usually in <utime.h>.
++       Some systems have utime.h but don't declare the struct anywhere. ])
++  fi
++])
++
++# onceonly.m4 serial 3
++dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl This file defines some "once only" variants of standard autoconf macros.
++dnl   AC_CHECK_HEADERS_ONCE         like  AC_CHECK_HEADERS
++dnl   AC_CHECK_FUNCS_ONCE           like  AC_CHECK_FUNCS
++dnl   AC_CHECK_DECLS_ONCE           like  AC_CHECK_DECLS
++dnl   AC_REQUIRE([AC_HEADER_STDC])  like  AC_HEADER_STDC
++dnl The advantage is that the check for each of the headers/functions/decls
++dnl will be put only once into the 'configure' file. It keeps the size of
++dnl the 'configure' file down, and avoids redundant output when 'configure'
++dnl is run.
++dnl The drawback is that the checks cannot be conditionalized. If you write
++dnl   if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
++dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
++dnl empty, and the check will be inserted before the body of the AC_DEFUNed
++dnl function.
++
++dnl Autoconf version 2.57 or newer is recommended.
++AC_PREREQ(2.54)
++
++# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
++# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
++AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
++  :
++  AC_FOREACH([gl_HEADER_NAME], [$1], [
++    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]),
++                                                 [-./], [___])), [
++      AC_CHECK_HEADERS(gl_HEADER_NAME)
++    ])
++    AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
++                                                   [-./], [___])))
++  ])
++])
++
++# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
++# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
++AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
++  :
++  AC_FOREACH([gl_FUNC_NAME], [$1], [
++    AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
++      AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME]))
++    ])
++    AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
++  ])
++])
++
++# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
++# AC_CHECK_DECLS(DECL1, DECL2, ...).
++AC_DEFUN([AC_CHECK_DECLS_ONCE], [
++  :
++  AC_FOREACH([gl_DECL_NAME], [$1], [
++    AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
++      AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
++    ])
++    AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
++  ])
++])
++
+ # backupfile.m4 serial 1
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+@@ -21,6 +1076,7 @@
+   AC_CHECK_HEADERS_ONCE(limits.h string.h unistd.h)
+   AC_CHECK_FUNCS(pathconf)
+ ])
++
+ #serial 5
+ 
+ dnl From Jim Meyering.
+@@ -63,31 +1119,7 @@
+    fi
+   ]
+ )
+-# dirname.m4 serial 1
+-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+-dnl This file is free software, distributed under the terms of the GNU
+-dnl General Public License.  As a special exception to the GNU General
+-dnl Public License, this file may be distributed as part of a program
+-dnl that contains a configuration script generated by Autoconf, under
+-dnl the same distribution terms as the rest of that program.
+ 
+-AC_DEFUN([gl_DIRNAME],
+-[
+-  dnl Prerequisites of lib/dirname.h.
+-  AC_REQUIRE([jm_AC_DOS])
+-
+-  dnl Prerequisites of lib/dirname.c.
+-  AC_REQUIRE([AC_HEADER_STDC])
+-  AC_CHECK_HEADERS_ONCE(string.h)
+-
+-  dnl Prerequisites of lib/basename.c.
+-  AC_REQUIRE([AC_HEADER_STDC])
+-  AC_CHECK_HEADERS_ONCE(string.h)
+-
+-  dnl Prerequisites of lib/stripslash.c.
+-  AC_REQUIRE([AC_HEADER_STDC])
+-  AC_CHECK_HEADERS_ONCE(string.h)
+-])
+ #serial 5
+ 
+ # Define some macros required for proper operation of code in lib/*.c
+@@ -141,6 +1173,33 @@
+       [Define if the backslash character may also serve as a file name
+        component separator.])
+   ])
++
++# dirname.m4 serial 1
++dnl Copyright (C) 2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++AC_DEFUN([gl_DIRNAME],
++[
++  dnl Prerequisites of lib/dirname.h.
++  AC_REQUIRE([jm_AC_DOS])
++
++  dnl Prerequisites of lib/dirname.c.
++  AC_REQUIRE([AC_HEADER_STDC])
++  AC_CHECK_HEADERS_ONCE(string.h)
++
++  dnl Prerequisites of lib/basename.c.
++  AC_REQUIRE([AC_HEADER_STDC])
++  AC_CHECK_HEADERS_ONCE(string.h)
++
++  dnl Prerequisites of lib/stripslash.c.
++  AC_REQUIRE([AC_HEADER_STDC])
++  AC_CHECK_HEADERS_ONCE(string.h)
++])
++
+ #serial 7
+ 
+ AC_DEFUN([gl_ERROR],
+@@ -159,7 +1218,67 @@
+   AC_CHECK_DECLS([strerror])
+   AC_FUNC_STRERROR_R
+ ])
+-# getopt.m4 serial 1
++
++# memchr.m4 serial 1
++dnl Copyright (C) 2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++AC_DEFUN([gl_FUNC_MEMCHR],
++[
++  AC_REPLACE_FUNCS(memchr)
++  if test $ac_cv_func_memchr = no; then
++    jm_PREREQ_MEMCHR
++  fi
++])
++
++# Prerequisites of lib/memchr.c.
++AC_DEFUN([jm_PREREQ_MEMCHR], [
++  AC_CHECK_HEADERS_ONCE(limits.h stdlib.h)
++  AC_CHECK_HEADERS(bp-sym.h)
++])
++
++# rmdir.m4 serial 1
++dnl Copyright (C) 2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++AC_DEFUN([gl_FUNC_RMDIR],
++[
++  AC_REPLACE_FUNCS(rmdir)
++  if test $ac_cv_func_rmdir = no; then
++    gl_PREREQ_RMDIR
++  fi
++])
++
++# Prerequisites of lib/rmdir.c.
++AC_DEFUN([gl_PREREQ_RMDIR], [
++  AC_REQUIRE([AC_HEADER_STAT])
++  :
++])
++
++
++# getopt.m4 serial 1
++dnl Copyright (C) 2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++AC_DEFUN([gl_GETOPT],
++[
++  dnl Prerequisites of lib/getopt.c.
++  AC_CHECK_HEADERS_ONCE(string.h)
++])
++
++# xalloc.m4 serial 1
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+ dnl General Public License.  As a special exception to the GNU General
+@@ -167,11 +1286,25 @@
+ dnl that contains a configuration script generated by Autoconf, under
+ dnl the same distribution terms as the rest of that program.
+ 
+-AC_DEFUN([gl_GETOPT],
++AC_DEFUN([gl_XALLOC],
+ [
+-  dnl Prerequisites of lib/getopt.c.
++  gl_PREREQ_XMALLOC
++  gl_PREREQ_XSTRDUP
++])
++
++# Prerequisites of lib/xmalloc.c.
++AC_DEFUN([gl_PREREQ_XMALLOC], [
++  AC_REQUIRE([AC_HEADER_STDC])
++  AC_REQUIRE([jm_FUNC_MALLOC])
++  AC_REQUIRE([jm_FUNC_REALLOC])
++])
++
++# Prerequisites of lib/xstrdup.c.
++AC_DEFUN([gl_PREREQ_XSTRDUP], [
++  AC_REQUIRE([AC_HEADER_STDC])
+   AC_CHECK_HEADERS_ONCE(string.h)
+ ])
++
+ # malloc.m4 serial 7
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+@@ -197,66 +1330,8 @@
+ AC_DEFUN([gl_PREREQ_MALLOC], [
+   :
+ ])
+-# mbrtowc.m4 serial 5
+-dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
+-dnl This file is free software, distributed under the terms of the GNU
+-dnl General Public License.  As a special exception to the GNU General
+-dnl Public License, this file may be distributed as part of a program
+-dnl that contains a configuration script generated by Autoconf, under
+-dnl the same distribution terms as the rest of that program.
+-
+-dnl From Paul Eggert
+-
+-dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with
+-dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
+-
+-AC_DEFUN([jm_FUNC_MBRTOWC],
+-[
+-  AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
+-    jm_cv_func_mbrtowc,
+-    [AC_TRY_LINK(
+-       [#include <wchar.h>],
+-       [mbstate_t state; return ! (sizeof state && mbrtowc);],
+-       jm_cv_func_mbrtowc=yes,
+-       jm_cv_func_mbrtowc=no)])
+-  if test $jm_cv_func_mbrtowc = yes; then
+-    AC_DEFINE(HAVE_MBRTOWC, 1,
+-      [Define to 1 if mbrtowc and mbstate_t are properly declared.])
+-  fi
+-])
+-# mbstate_t.m4 serial 9
+-dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+-dnl This file is free software, distributed under the terms of the GNU
+-dnl General Public License.  As a special exception to the GNU General
+-dnl Public License, this file may be distributed as part of a program
+-dnl that contains a configuration script generated by Autoconf, under
+-dnl the same distribution terms as the rest of that program.
+-
+-# From Paul Eggert.
+-
+-# BeOS 5 has <wchar.h> but does not define mbstate_t,
+-# so you can't declare an object of that type.
+-# Check for this incompatibility with Standard C.
+ 
+-# AC_TYPE_MBSTATE_T
+-# -----------------
+-AC_DEFUN([AC_TYPE_MBSTATE_T],
+-  [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
+-     [AC_COMPILE_IFELSE(
+-	[AC_LANG_PROGRAM(
+-	   [AC_INCLUDES_DEFAULT
+-#	    include <wchar.h>],
+-	   [mbstate_t x; return sizeof x;])],
+-	[ac_cv_type_mbstate_t=yes],
+-	[ac_cv_type_mbstate_t=no])])
+-   if test $ac_cv_type_mbstate_t = yes; then
+-     AC_DEFINE([HAVE_MBSTATE_T], 1,
+-	       [Define to 1 if <wchar.h> declares mbstate_t.])
+-   else
+-     AC_DEFINE([mbstate_t], int,
+-	       [Define to a type if <wchar.h> does not define.])
+-   fi])
+-# memchr.m4 serial 1
++# realloc.m4 serial 7
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+ dnl General Public License.  As a special exception to the GNU General
+@@ -264,116 +1339,24 @@
+ dnl that contains a configuration script generated by Autoconf, under
+ dnl the same distribution terms as the rest of that program.
+ 
+-AC_DEFUN([gl_FUNC_MEMCHR],
++dnl From Jim Meyering.
++dnl Determine whether realloc works when both arguments are 0.
++dnl If it doesn't, arrange to use the replacement function.
++
++AC_DEFUN([jm_FUNC_REALLOC],
+ [
+-  AC_REPLACE_FUNCS(memchr)
+-  if test $ac_cv_func_memchr = no; then
+-    jm_PREREQ_MEMCHR
++  AC_REQUIRE([AC_FUNC_REALLOC])
++  dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works.
++  if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then
++    gl_PREREQ_REALLOC
+   fi
+ ])
+ 
+-# Prerequisites of lib/memchr.c.
+-AC_DEFUN([jm_PREREQ_MEMCHR], [
+-  AC_CHECK_HEADERS_ONCE(limits.h stdlib.h)
+-  AC_CHECK_HEADERS(bp-sym.h)
+-])
+-#serial 1
+-
+-dnl From Mumit Khan and Paul Eggert
+-dnl Determine whether mkdir accepts only one argument instead of the usual two.
+-
+-AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG],
+-  [AC_CHECK_FUNCS(mkdir)
+-   AC_CACHE_CHECK([whether mkdir takes only one argument],
+-     patch_cv_mkdir_takes_one_arg,
+-     [patch_cv_mkdir_takes_one_arg=no
+-      if test $ac_cv_func_mkdir = yes; then
+-        AC_TRY_COMPILE([
+-#include <sys/types.h>
+-#include <sys/stat.h>
+-	  ],
+-	  [mkdir (".", 0);],
+-	  ,
+-	  [AC_TRY_COMPILE([
+-#include <sys/types.h>
+-#include <sys/stat.h>
+-	     ],
+-	     [mkdir (".");],
+-	     patch_cv_mkdir_takes_one_arg=yes
+-	  )]
+-	)
+-      fi
+-     ]
+-   )
+-   if test $patch_cv_mkdir_takes_one_arg = yes; then
+-     AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
+-       [Define if mkdir takes only one argument.])
+-   fi
+-  ]
+-)
+-# onceonly.m4 serial 3
+-dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+-dnl This file is free software, distributed under the terms of the GNU
+-dnl General Public License.  As a special exception to the GNU General
+-dnl Public License, this file may be distributed as part of a program
+-dnl that contains a configuration script generated by Autoconf, under
+-dnl the same distribution terms as the rest of that program.
+-
+-dnl This file defines some "once only" variants of standard autoconf macros.
+-dnl   AC_CHECK_HEADERS_ONCE         like  AC_CHECK_HEADERS
+-dnl   AC_CHECK_FUNCS_ONCE           like  AC_CHECK_FUNCS
+-dnl   AC_CHECK_DECLS_ONCE           like  AC_CHECK_DECLS
+-dnl   AC_REQUIRE([AC_HEADER_STDC])  like  AC_HEADER_STDC
+-dnl The advantage is that the check for each of the headers/functions/decls
+-dnl will be put only once into the 'configure' file. It keeps the size of
+-dnl the 'configure' file down, and avoids redundant output when 'configure'
+-dnl is run.
+-dnl The drawback is that the checks cannot be conditionalized. If you write
+-dnl   if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
+-dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
+-dnl empty, and the check will be inserted before the body of the AC_DEFUNed
+-dnl function.
+-
+-dnl Autoconf version 2.57 or newer is recommended.
+-AC_PREREQ(2.54)
+-
+-# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
+-# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
+-AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
+-  :
+-  AC_FOREACH([gl_HEADER_NAME], [$1], [
+-    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]),
+-                                                 [-./], [___])), [
+-      AC_CHECK_HEADERS(gl_HEADER_NAME)
+-    ])
+-    AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
+-                                                   [-./], [___])))
+-  ])
+-])
+-
+-# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
+-# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
+-AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
++# Prerequisites of lib/realloc.c.
++AC_DEFUN([gl_PREREQ_REALLOC], [
+   :
+-  AC_FOREACH([gl_FUNC_NAME], [$1], [
+-    AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
+-      AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME]))
+-    ])
+-    AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
+-  ])
+ ])
+ 
+-# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
+-# AC_CHECK_DECLS(DECL1, DECL2, ...).
+-AC_DEFUN([AC_CHECK_DECLS_ONCE], [
+-  :
+-  AC_FOREACH([gl_DECL_NAME], [$1], [
+-    AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
+-      AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
+-    ])
+-    AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
+-  ])
+-])
+ # quote.m4 serial 1
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+@@ -387,6 +1370,7 @@
+   dnl Prerequisites of lib/quote.c.
+   AC_CHECK_HEADERS_ONCE(stddef.h)
+ ])
++
+ # quotearg.m4 serial 1
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+@@ -403,32 +1387,69 @@
+   AC_TYPE_MBSTATE_T
+   jm_FUNC_MBRTOWC
+ ])
+-# realloc.m4 serial 7
+-dnl Copyright (C) 2002 Free Software Foundation, Inc.
++
++# mbstate_t.m4 serial 9
++dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+ dnl General Public License.  As a special exception to the GNU General
+ dnl Public License, this file may be distributed as part of a program
+ dnl that contains a configuration script generated by Autoconf, under
+ dnl the same distribution terms as the rest of that program.
+ 
+-dnl From Jim Meyering.
+-dnl Determine whether realloc works when both arguments are 0.
+-dnl If it doesn't, arrange to use the replacement function.
++# From Paul Eggert.
+ 
+-AC_DEFUN([jm_FUNC_REALLOC],
++# BeOS 5 has <wchar.h> but does not define mbstate_t,
++# so you can't declare an object of that type.
++# Check for this incompatibility with Standard C.
++
++# AC_TYPE_MBSTATE_T
++# -----------------
++AC_DEFUN([AC_TYPE_MBSTATE_T],
++  [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
++     [AC_COMPILE_IFELSE(
++	[AC_LANG_PROGRAM(
++	   [AC_INCLUDES_DEFAULT
++#	    include <wchar.h>],
++	   [mbstate_t x; return sizeof x;])],
++	[ac_cv_type_mbstate_t=yes],
++	[ac_cv_type_mbstate_t=no])])
++   if test $ac_cv_type_mbstate_t = yes; then
++     AC_DEFINE([HAVE_MBSTATE_T], 1,
++	       [Define to 1 if <wchar.h> declares mbstate_t.])
++   else
++     AC_DEFINE([mbstate_t], int,
++	       [Define to a type if <wchar.h> does not define.])
++   fi])
++
++# mbrtowc.m4 serial 5
++dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
++dnl This file is free software, distributed under the terms of the GNU
++dnl General Public License.  As a special exception to the GNU General
++dnl Public License, this file may be distributed as part of a program
++dnl that contains a configuration script generated by Autoconf, under
++dnl the same distribution terms as the rest of that program.
++
++dnl From Paul Eggert
++
++dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with
++dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
++
++AC_DEFUN([jm_FUNC_MBRTOWC],
+ [
+-  AC_REQUIRE([AC_FUNC_REALLOC])
+-  dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works.
+-  if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then
+-    gl_PREREQ_REALLOC
++  AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
++    jm_cv_func_mbrtowc,
++    [AC_TRY_LINK(
++       [#include <wchar.h>],
++       [mbstate_t state; return ! (sizeof state && mbrtowc);],
++       jm_cv_func_mbrtowc=yes,
++       jm_cv_func_mbrtowc=no)])
++  if test $jm_cv_func_mbrtowc = yes; then
++    AC_DEFINE(HAVE_MBRTOWC, 1,
++      [Define to 1 if mbrtowc and mbstate_t are properly declared.])
+   fi
+ ])
+ 
+-# Prerequisites of lib/realloc.c.
+-AC_DEFUN([gl_PREREQ_REALLOC], [
+-  :
+-])
+-# rmdir.m4 serial 1
++# hash.m4 serial 1
+ dnl Copyright (C) 2002 Free Software Foundation, Inc.
+ dnl This file is free software, distributed under the terms of the GNU
+ dnl General Public License.  As a special exception to the GNU General
+@@ -436,18 +1457,71 @@
+ dnl that contains a configuration script generated by Autoconf, under
+ dnl the same distribution terms as the rest of that program.
+ 
+-AC_DEFUN([gl_FUNC_RMDIR],
++AC_DEFUN([gl_HASH],
+ [
+-  AC_REPLACE_FUNCS(rmdir)
+-  if test $ac_cv_func_rmdir = no; then
+-    gl_PREREQ_RMDIR
+-  fi
++  dnl Prerequisites of lib/hash.c.
++  AC_CHECK_HEADERS_ONCE(stdlib.h)
++  AC_HEADER_STDBOOL
++  AC_CHECK_DECLS_ONCE(free malloc)
+ ])
+ 
+-# Prerequisites of lib/rmdir.c.
+-AC_DEFUN([gl_PREREQ_RMDIR], [
+-  AC_REQUIRE([AC_HEADER_STAT])
+-  :
++AC_DEFUN([ag_CHECK_NANOSECOND_STAT],
++  [AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
++     [ac_cv_stat_nsec],
++     [AC_TRY_COMPILE(
++	[
++	  #include <sys/types.h>
++	  #include <sys/stat.h>
++	  #include <unistd.h>
++	  struct stat st;
++	],
++	[ return st.st_atimensec + st.st_mtimensec + st.st_ctimensec; ],
++	[ac_cv_stat_nsec=yes],
++	[ac_cv_stat_nsec=no])
++     ])
++   if test $ac_cv_stat_nsec = yes; then
++     AC_DEFINE(HAVE_STAT_NSEC, 1, [Define to 1 if struct stat has nanosecond timestamps.])
++   fi
++
++   AC_CACHE_CHECK([for nanosecond timestamps in struct stat],
++     [ac_cv_stat_timeval],
++     [AC_TRY_COMPILE(
++	[
++	  #include <time.h>
++	  #include <sys/types.h>
++	  #include <sys/stat.h>
++	  #include <unistd.h>
++	  struct stat st;
++	],
++	[ return st.st_atim.tv_nsec + st.st_mtim.tv_nsec + st.st_ctim.tv_nsec; ],
++	[ac_cv_stat_timeval=yes],
++	[ac_cv_stat_timeval=no])
++     ])
++   if test $ac_cv_stat_timeval = yes; then
++     AC_DEFINE(HAVE_STAT_TIMEVAL, 1, [Define to 1 if struct stat comtains struct timeval's.])
++   fi])
++
++#serial 7 -*- autoconf -*-
++
++dnl From Jim Meyering.
++dnl
++dnl See if the glibc *_unlocked I/O macros or functions are available.
++dnl Use only those *_unlocked macros or functions that are declared
++dnl (because some of them were declared in Solaris 2.5.1 but were removed
++dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
++dnl on Solaris 2.6).
++
++AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
++[
++  dnl Persuade glibc <stdio.h> to declare fgets_unlocked(), fputs_unlocked()
++  dnl etc.
++  AC_REQUIRE([AC_GNU_SOURCE])
++
++  AC_CHECK_DECLS_ONCE(
++     [clearerr_unlocked feof_unlocked ferror_unlocked
++      fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
++      fread_unlocked fwrite_unlocked getc_unlocked
++      getchar_unlocked putc_unlocked putchar_unlocked])
+ ])
+ 
+ # Check for setmode, DOS style.
+@@ -488,180 +1562,39 @@
+      AC_DEFINE(HAVE_SETMODE_DOS, 1,
+        [Define to 1 if you have the DOS-style `setmode' function.])
+    fi])
+-# Check for stdbool.h that conforms to C99.
+-
+-# Copyright (C) 2002-2003 Free Software Foundation, Inc.
+-
+-# This program is free software; you can redistribute it and/or modify
+-# it under the terms of the GNU General Public License as published by
+-# the Free Software Foundation; either version 2, or (at your option)
+-# any later version.
+-
+-# This program is distributed in the hope that it will be useful,
+-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-# GNU General Public License for more details.
+-
+-# You should have received a copy of the GNU General Public License
+-# along with this program; if not, write to the Free Software
+-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+-# 02111-1307, USA.
+-
+-# Prepare for substituting <stdbool.h> if it is not supported.
+-
+-AC_DEFUN([AM_STDBOOL_H],
+-[
+-  AC_REQUIRE([AC_HEADER_STDBOOL])
+-
+-  # Define two additional variables used in the Makefile substitution.
+-
+-  if test "$ac_cv_header_stdbool_h" = yes; then
+-    STDBOOL_H=''
+-  else
+-    STDBOOL_H='stdbool.h'
+-  fi
+-  AC_SUBST([STDBOOL_H])
+-
+-  if test "$ac_cv_type__Bool" = yes; then
+-    HAVE__BOOL=1
+-  else
+-    HAVE__BOOL=0
+-  fi
+-  AC_SUBST([HAVE__BOOL])
+-])
+-
+-# This macro is only needed in autoconf <= 2.54.  Newer versions of autoconf
+-# have this macro built-in.
+-
+-AC_DEFUN([AC_HEADER_STDBOOL],
+-  [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
+-     [ac_cv_header_stdbool_h],
+-     [AC_TRY_COMPILE(
+-	[
+-	  #include <stdbool.h>
+-	  #ifndef bool
+-	   "error: bool is not defined"
+-	  #endif
+-	  #ifndef false
+-	   "error: false is not defined"
+-	  #endif
+-	  #if false
+-	   "error: false is not 0"
+-	  #endif
+-	  #ifndef true
+-	   "error: false is not defined"
+-	  #endif
+-	  #if true != 1
+-	   "error: true is not 1"
+-	  #endif
+-	  #ifndef __bool_true_false_are_defined
+-	   "error: __bool_true_false_are_defined is not defined"
+-	  #endif
+-
+-	  struct s { _Bool s: 1; _Bool t; } s;
+-
+-	  char a[true == 1 ? 1 : -1];
+-	  char b[false == 0 ? 1 : -1];
+-	  char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+-	  char d[(bool) -0.5 == true ? 1 : -1];
+-	  bool e = &s;
+-	  char f[(_Bool) -0.0 == false ? 1 : -1];
+-	  char g[true];
+-	  char h[sizeof (_Bool)];
+-	  char i[sizeof s.t];
+-	],
+-	[ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
+-	[ac_cv_header_stdbool_h=yes],
+-	[ac_cv_header_stdbool_h=no])])
+-   AC_CHECK_TYPES([_Bool])
+-   if test $ac_cv_header_stdbool_h = yes; then
+-     AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
+-   fi])
+-#serial 7 -*- autoconf -*-
+-
+-dnl From Jim Meyering.
+-dnl
+-dnl See if the glibc *_unlocked I/O macros or functions are available.
+-dnl Use only those *_unlocked macros or functions that are declared
+-dnl (because some of them were declared in Solaris 2.5.1 but were removed
+-dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
+-dnl on Solaris 2.6).
+-
+-AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
+-[
+-  dnl Persuade glibc <stdio.h> to declare fgets_unlocked(), fputs_unlocked()
+-  dnl etc.
+-  AC_REQUIRE([AC_GNU_SOURCE])
+-
+-  AC_CHECK_DECLS_ONCE(
+-     [clearerr_unlocked feof_unlocked ferror_unlocked
+-      fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
+-      fread_unlocked fwrite_unlocked getc_unlocked
+-      getchar_unlocked putc_unlocked putchar_unlocked])
+-])
+-#serial 5
+-
+-dnl From Jim Meyering
+-
+-dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
+-dnl usually in <utime.h>.
+-dnl Some systems have utime.h but don't declare the struct anywhere.
+-
+-AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
+-[
+-  AC_CHECK_HEADERS_ONCE(sys/time.h utime.h)
+-  AC_REQUIRE([AC_HEADER_TIME])
+-  AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
+-    [AC_TRY_COMPILE(
+-      [
+-#ifdef TIME_WITH_SYS_TIME
+-# include <sys/time.h>
+-# include <time.h>
+-#else
+-# ifdef HAVE_SYS_TIME_H
+-#  include <sys/time.h>
+-# else
+-#  include <time.h>
+-# endif
+-#endif
+-#ifdef HAVE_UTIME_H
+-# include <utime.h>
+-#endif
+-      ],
+-      [static struct utimbuf x; x.actime = x.modtime;],
+-      fu_cv_sys_struct_utimbuf=yes,
+-      fu_cv_sys_struct_utimbuf=no)
+-    ])
+ 
+-  if test $fu_cv_sys_struct_utimbuf = yes; then
+-    AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
+-      [Define if struct utimbuf is declared -- usually in <utime.h>.
+-       Some systems have utime.h but don't declare the struct anywhere. ])
+-  fi
+-])
+-# xalloc.m4 serial 1
+-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+-dnl This file is free software, distributed under the terms of the GNU
+-dnl General Public License.  As a special exception to the GNU General
+-dnl Public License, this file may be distributed as part of a program
+-dnl that contains a configuration script generated by Autoconf, under
+-dnl the same distribution terms as the rest of that program.
++#serial 1
+ 
+-AC_DEFUN([gl_XALLOC],
+-[
+-  gl_PREREQ_XMALLOC
+-  gl_PREREQ_XSTRDUP
+-])
++dnl From Mumit Khan and Paul Eggert
++dnl Determine whether mkdir accepts only one argument instead of the usual two.
+ 
+-# Prerequisites of lib/xmalloc.c.
+-AC_DEFUN([gl_PREREQ_XMALLOC], [
+-  AC_REQUIRE([AC_HEADER_STDC])
+-  AC_REQUIRE([jm_FUNC_MALLOC])
+-  AC_REQUIRE([jm_FUNC_REALLOC])
+-])
++AC_DEFUN([PATCH_FUNC_MKDIR_TAKES_ONE_ARG],
++  [AC_CHECK_FUNCS(mkdir)
++   AC_CACHE_CHECK([whether mkdir takes only one argument],
++     patch_cv_mkdir_takes_one_arg,
++     [patch_cv_mkdir_takes_one_arg=no
++      if test $ac_cv_func_mkdir = yes; then
++        AC_TRY_COMPILE([
++#include <sys/types.h>
++#include <sys/stat.h>
++	  ],
++	  [mkdir (".", 0);],
++	  ,
++	  [AC_TRY_COMPILE([
++#include <sys/types.h>
++#include <sys/stat.h>
++	     ],
++	     [mkdir (".");],
++	     patch_cv_mkdir_takes_one_arg=yes
++	  )]
++	)
++      fi
++     ]
++   )
++   if test $patch_cv_mkdir_takes_one_arg = yes; then
++     AC_DEFINE([MKDIR_TAKES_ONE_ARG], 1,
++       [Define if mkdir takes only one argument.])
++   fi
++  ]
++)
+ 
+-# Prerequisites of lib/xstrdup.c.
+-AC_DEFUN([gl_PREREQ_XSTRDUP], [
+-  AC_REQUIRE([AC_HEADER_STDC])
+-  AC_CHECK_HEADERS_ONCE(string.h)
+-])
+--- patch-2.5.9.orig/configure
++++ patch-2.5.9/configure
+@@ -1,11 +1,10 @@
+ #! /bin/sh
+ # Guess values for system-dependent variables and create Makefiles.
+-# Generated by GNU Autoconf 2.57 for patch 2.5.9.
++# Generated by GNU Autoconf 2.59 for patch 2.5.9.
+ #
+ # Report bugs to <bug-patch@gnu.org>.
+ #
+-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+-# Free Software Foundation, Inc.
++# Copyright (C) 2003 Free Software Foundation, Inc.
+ # This configure script is free software; the Free Software Foundation
+ # gives unlimited permission to copy, distribute and modify it.
+ ## --------------------- ##
+@@ -22,9 +21,10 @@
+ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+   set -o posix
+ fi
++DUALCASE=1; export DUALCASE # for MKS sh
+ 
+ # Support unset when possible.
+-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+   as_unset=unset
+ else
+   as_unset=false
+@@ -43,7 +43,7 @@
+   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+   LC_TELEPHONE LC_TIME
+ do
+-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
++  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+     eval $as_var=C; export $as_var
+   else
+     $as_unset $as_var
+@@ -220,16 +220,17 @@
+ if mkdir -p . 2>/dev/null; then
+   as_mkdir_p=:
+ else
++  test -d ./-p && rmdir ./-p
+   as_mkdir_p=false
+ fi
+ 
+ as_executable_p="test -f"
+ 
+ # Sed expression to map a string onto a valid CPP name.
+-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+ 
+ # Sed expression to map a string onto a valid variable name.
+-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+ 
+ 
+ # IFS
+@@ -669,7 +670,7 @@
+ 
+ # Be sure to have absolute paths.
+ for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+-              localstatedir libdir includedir oldincludedir infodir mandir
++	      localstatedir libdir includedir oldincludedir infodir mandir
+ do
+   eval ac_val=$`echo $ac_var`
+   case $ac_val in
+@@ -709,10 +710,10 @@
+   # Try the directory containing this script, then its parent.
+   ac_confdir=`(dirname "$0") 2>/dev/null ||
+ $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+-         X"$0" : 'X\(//\)[^/]' \| \
+-         X"$0" : 'X\(//\)$' \| \
+-         X"$0" : 'X\(/\)' \| \
+-         .     : '\(.\)' 2>/dev/null ||
++	 X"$0" : 'X\(//\)[^/]' \| \
++	 X"$0" : 'X\(//\)$' \| \
++	 X"$0" : 'X\(/\)' \| \
++	 .     : '\(.\)' 2>/dev/null ||
+ echo X"$0" |
+     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -804,9 +805,9 @@
+   cat <<_ACEOF
+ Installation directories:
+   --prefix=PREFIX         install architecture-independent files in PREFIX
+-                          [$ac_default_prefix]
++			  [$ac_default_prefix]
+   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+-                          [PREFIX]
++			  [PREFIX]
+ 
+ By default, \`make install' will install all the files in
+ \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+@@ -896,12 +897,45 @@
+     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+     ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ esac
+-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+-# absolute.
+-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++  case "$ac_dir" in
++  .) ac_abs_builddir=`pwd`;;
++  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++  *) ac_abs_builddir=`pwd`/"$ac_dir";;
++  esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++  case ${ac_top_builddir}. in
++  .) ac_abs_top_builddir=$ac_abs_builddir;;
++  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++  esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++  case $ac_srcdir in
++  .) ac_abs_srcdir=$ac_abs_builddir;;
++  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++  esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++  case $ac_top_srcdir in
++  .) ac_abs_top_srcdir=$ac_abs_builddir;;
++  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++  esac;;
++esac
+ 
+     cd $ac_dir
+     # Check for guested configure; otherwise get Cygnus style configure.
+@@ -912,13 +946,13 @@
+       echo
+       $SHELL $ac_srcdir/configure  --help=recursive
+     elif test -f $ac_srcdir/configure.ac ||
+-           test -f $ac_srcdir/configure.in; then
++	   test -f $ac_srcdir/configure.in; then
+       echo
+       $ac_configure --help
+     else
+       echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+     fi
+-    cd $ac_popdir
++    cd "$ac_popdir"
+   done
+ fi
+ 
+@@ -926,10 +960,9 @@
+ if $ac_init_version; then
+   cat <<\_ACEOF
+ patch configure 2.5.9
+-generated by GNU Autoconf 2.57
++generated by GNU Autoconf 2.59
+ 
+-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+-Free Software Foundation, Inc.
++Copyright (C) 2003 Free Software Foundation, Inc.
+ This configure script is free software; the Free Software Foundation
+ gives unlimited permission to copy, distribute and modify it.
+ _ACEOF
+@@ -941,7 +974,7 @@
+ running configure, to aid debugging if configure makes a mistake.
+ 
+ It was created by patch $as_me 2.5.9, which was
+-generated by GNU Autoconf 2.57.  Invocation command line was
++generated by GNU Autoconf 2.59.  Invocation command line was
+ 
+   $ $0 $@
+ 
+@@ -1018,19 +1051,19 @@
+     2)
+       ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+       if test $ac_must_keep_next = true; then
+-        ac_must_keep_next=false # Got value, back to normal.
++	ac_must_keep_next=false # Got value, back to normal.
+       else
+-        case $ac_arg in
+-          *=* | --config-cache | -C | -disable-* | --disable-* \
+-          | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+-          | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+-          | -with-* | --with-* | -without-* | --without-* | --x)
+-            case "$ac_configure_args0 " in
+-              "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+-            esac
+-            ;;
+-          -* ) ac_must_keep_next=true ;;
+-        esac
++	case $ac_arg in
++	  *=* | --config-cache | -C | -disable-* | --disable-* \
++	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
++	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
++	  | -with-* | --with-* | -without-* | --without-* | --x)
++	    case "$ac_configure_args0 " in
++	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
++	    esac
++	    ;;
++	  -* ) ac_must_keep_next=true ;;
++	esac
+       fi
+       ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+       # Get rid of the leading space.
+@@ -1064,12 +1097,12 @@
+     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+     *ac_space=\ *)
+       sed -n \
+-        "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+-    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
++	"s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
++	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+       ;;
+     *)
+       sed -n \
+-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+       ;;
+     esac;
+ }
+@@ -1098,7 +1131,7 @@
+       for ac_var in $ac_subst_files
+       do
+ 	eval ac_val=$`echo $ac_var`
+-        echo "$ac_var='"'"'$ac_val'"'"'"
++	echo "$ac_var='"'"'$ac_val'"'"'"
+       done | sort
+       echo
+     fi
+@@ -1117,7 +1150,7 @@
+       echo "$as_me: caught signal $ac_signal"
+     echo "$as_me: exit $exit_status"
+   } >&5
+-  rm -f core core.* *.core &&
++  rm -f core *.core &&
+   rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+     exit $exit_status
+      ' 0
+@@ -1197,7 +1230,7 @@
+ # value.
+ ac_cache_corrupted=false
+ for ac_var in `(set) 2>&1 |
+-               sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
++	       sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+   eval ac_old_set=\$ac_cv_env_${ac_var}_set
+   eval ac_new_set=\$ac_env_${ac_var}_set
+   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+@@ -1214,13 +1247,13 @@
+     ,);;
+     *)
+       if test "x$ac_old_val" != "x$ac_new_val"; then
+-        { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
++	{ echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+ echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+-        { echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
++	{ echo "$as_me:$LINENO:   former value:  $ac_old_val" >&5
+ echo "$as_me:   former value:  $ac_old_val" >&2;}
+-        { echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
++	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+ echo "$as_me:   current value: $ac_new_val" >&2;}
+-        ac_cache_corrupted=:
++	ac_cache_corrupted=:
+       fi;;
+   esac
+   # Pass precious variables to config.status.
+@@ -1629,7 +1662,6 @@
+   (exit $ac_status); }
+ 
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -1649,8 +1681,8 @@
+ # Try to create an executable without -o first, disregard a.out.
+ # It will help us diagnose broken compilers, and finding out an intuition
+ # of exeext.
+-echo "$as_me:$LINENO: checking for C compiler default output" >&5
+-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
++echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
++echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+ if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+   (eval $ac_link_default) 2>&5
+@@ -1670,23 +1702,23 @@
+   test -f "$ac_file" || continue
+   case $ac_file in
+     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+-        ;;
++	;;
+     conftest.$ac_ext )
+-        # This is the source file.
+-        ;;
++	# This is the source file.
++	;;
+     [ab].out )
+-        # We found the default executable, but exeext='' is most
+-        # certainly right.
+-        break;;
++	# We found the default executable, but exeext='' is most
++	# certainly right.
++	break;;
+     *.* )
+-        ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+-        # FIXME: I believe we export ac_cv_exeext for Libtool,
+-        # but it would be cool to find out if it's true.  Does anybody
+-        # maintain Libtool? --akim.
+-        export ac_cv_exeext
+-        break;;
++	ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
++	# FIXME: I believe we export ac_cv_exeext for Libtool,
++	# but it would be cool to find out if it's true.  Does anybody
++	# maintain Libtool? --akim.
++	export ac_cv_exeext
++	break;;
+     * )
+-        break;;
++	break;;
+   esac
+ done
+ else
+@@ -1760,8 +1792,8 @@
+   case $ac_file in
+     *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+-          export ac_cv_exeext
+-          break;;
++	  export ac_cv_exeext
++	  break;;
+     * ) break;;
+   esac
+ done
+@@ -1786,7 +1818,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -1837,7 +1868,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -1857,11 +1887,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -1874,7 +1913,7 @@
+ 
+ ac_compiler_gnu=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_cv_c_compiler_gnu=$ac_compiler_gnu
+ 
+ fi
+@@ -1890,7 +1929,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -1907,11 +1945,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -1924,7 +1971,7 @@
+ 
+ ac_cv_prog_cc_g=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+ echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+@@ -1951,7 +1998,6 @@
+   ac_cv_prog_cc_stdc=no
+ ac_save_CC=$CC
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -1979,6 +2025,16 @@
+   va_end (v);
+   return s;
+ }
++
++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
++   function prototypes and stuff, but not '\xHH' hex character constants.
++   These don't provoke an error unfortunately, instead are silently treated
++   as 'x'.  The following induces an error, until -std1 is added to get
++   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
++   array size at least.  It's necessary to write '\x00'==0 to get something
++   that's true only with -std1.  */
++int osf4_cc_array ['\x00' == 0 ? 1 : -1];
++
+ int test (int i, double x);
+ struct s1 {int (*f) (int a);};
+ struct s2 {int (*f) (double a);};
+@@ -2005,11 +2061,20 @@
+   CC="$ac_save_CC $ac_arg"
+   rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -2022,7 +2087,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext
++rm -f conftest.err conftest.$ac_objext
+ done
+ rm -f conftest.$ac_ext conftest.$ac_objext
+ CC=$ac_save_CC
+@@ -2050,19 +2115,27 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+   for ac_declaration in \
+-   ''\
+-   '#include <stdlib.h>' \
++   '' \
+    'extern "C" void std::exit (int) throw (); using std::exit;' \
+    'extern "C" void std::exit (int); using std::exit;' \
+    'extern "C" void exit (int) throw ();' \
+@@ -2070,14 +2143,13 @@
+    'void exit (int);'
+ do
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+-#include <stdlib.h>
+ $ac_declaration
++#include <stdlib.h>
+ int
+ main ()
+ {
+@@ -2088,11 +2160,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -2105,9 +2186,8 @@
+ 
+ continue
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2124,11 +2204,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -2140,7 +2229,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ done
+ rm -f conftest*
+ if test -n "$ac_declaration"; then
+@@ -2154,7 +2243,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_ext=c
+ ac_cpp='$CPP $CPPFLAGS'
+ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+@@ -2189,7 +2278,6 @@
+   # On the NeXT, cc -E runs the code through the compiler's parser,
+   # not just through cpp. "Syntax error" is here to catch this case.
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2200,7 +2288,7 @@
+ #else
+ # include <assert.h>
+ #endif
+-                     Syntax error
++		     Syntax error
+ _ACEOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+@@ -2212,6 +2300,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -2232,7 +2321,6 @@
+   # OK, works on sane cases.  Now check whether non-existent headers
+   # can be detected and how.
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2250,6 +2338,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -2296,7 +2385,6 @@
+   # On the NeXT, cc -E runs the code through the compiler's parser,
+   # not just through cpp. "Syntax error" is here to catch this case.
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2307,7 +2395,7 @@
+ #else
+ # include <assert.h>
+ #endif
+-                     Syntax error
++		     Syntax error
+ _ACEOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+@@ -2319,6 +2407,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -2339,7 +2428,6 @@
+   # OK, works on sane cases.  Now check whether non-existent headers
+   # can be detected and how.
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2357,6 +2445,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -2431,6 +2520,7 @@
+ # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+ # AFS /usr/afsws/bin/install, which mishandles nonexistent args
+ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
++# OS/2's system install, which has a completely different semantic
+ # ./install, which can be erroneously created by make from ./install.sh.
+ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+ echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+@@ -2447,6 +2537,7 @@
+ case $as_dir/ in
+   ./ | .// | /cC/* | \
+   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
++  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+   /usr/ucb/* ) ;;
+   *)
+     # OSF1 and SCO ODT 3.0 have their own names for install.
+@@ -2454,20 +2545,20 @@
+     # by default.
+     for ac_prog in ginstall scoinst install; do
+       for ac_exec_ext in '' $ac_executable_extensions; do
+-        if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+-          if test $ac_prog = install &&
+-            grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+-            # AIX install.  It has an incompatible calling convention.
+-            :
+-          elif test $ac_prog = install &&
+-            grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+-            # program-specific install script used by HP pwplus--don't use.
+-            :
+-          else
+-            ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+-            break 3
+-          fi
+-        fi
++	if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
++	  if test $ac_prog = install &&
++	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++	    # AIX install.  It has an incompatible calling convention.
++	    :
++	  elif test $ac_prog = install &&
++	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
++	    # program-specific install script used by HP pwplus--don't use.
++	    :
++	  else
++	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
++	    break 3
++	  fi
++	fi
+       done
+     done
+     ;;
+@@ -2499,7 +2590,7 @@
+ 
+ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+ echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+ if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+@@ -2596,7 +2687,6 @@
+ echo "$as_me:$LINENO: checking for AIX" >&5
+ echo $ECHO_N "checking for AIX... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2628,7 +2718,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2649,11 +2738,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -2666,12 +2764,11 @@
+ 
+ ac_cv_header_stdc=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
+ if test $ac_cv_header_stdc = yes; then
+   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2693,7 +2790,6 @@
+ if test $ac_cv_header_stdc = yes; then
+   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2718,7 +2814,6 @@
+   :
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2730,9 +2825,9 @@
+ # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+ #else
+ # define ISLOWER(c) \
+-                   (('a' <= (c) && (c) <= 'i') \
+-                     || ('j' <= (c) && (c) <= 'r') \
+-                     || ('s' <= (c) && (c) <= 'z'))
++		   (('a' <= (c) && (c) <= 'i') \
++		     || ('j' <= (c) && (c) <= 'r') \
++		     || ('s' <= (c) && (c) <= 'z'))
+ # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+ #endif
+ 
+@@ -2743,7 +2838,7 @@
+   int i;
+   for (i = 0; i < 256; i++)
+     if (XOR (islower (i), ISLOWER (i))
+-        || toupper (i) != TOUPPER (i))
++	|| toupper (i) != TOUPPER (i))
+       exit(2);
+   exit (0);
+ }
+@@ -2768,7 +2863,7 @@
+ ( exit $ac_status )
+ ac_cv_header_stdc=no
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ fi
+@@ -2793,7 +2888,7 @@
+ 
+ 
+ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+-                  inttypes.h stdint.h unistd.h
++		  inttypes.h stdint.h unistd.h
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+@@ -2802,7 +2897,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2814,11 +2908,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -2831,7 +2934,7 @@
+ 
+ eval "$as_ac_Header=no"
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -2858,7 +2961,6 @@
+ echo "$as_me:$LINENO: checking minix/config.h usability" >&5
+ echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2869,11 +2971,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -2886,7 +2997,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -2894,7 +3005,6 @@
+ echo "$as_me:$LINENO: checking minix/config.h presence" >&5
+ echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -2912,6 +3022,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -2931,33 +3042,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: minix/config.h:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: minix/config.h:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -3000,15 +3110,15 @@
+ fi
+ 
+ 
+-echo "$as_me:$LINENO: checking for library containing strerror" >&5
+-echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
+-if test "${ac_cv_search_strerror+set}" = set; then
++
++        echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5
++echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6
++if test "${ac_cv_lib_cposix_strerror+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  ac_func_search_save_LIBS=$LIBS
+-ac_cv_search_strerror=no
++  ac_check_lib_save_LIBS=$LIBS
++LIBS="-lcposix  $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3032,79 +3142,43 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); }; }; then
+-  ac_cv_search_strerror="none required"
+-else
+-  echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+-if test "$ac_cv_search_strerror" = no; then
+-  for ac_lib in cposix; do
+-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+-    cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+-/* confdefs.h.  */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h.  */
+-
+-/* Override any gcc2 internal prototype to avoid an error.  */
+-#ifdef __cplusplus
+-extern "C"
+-#endif
+-/* We use char because int might match the return type of a gcc2
+-   builtin and then its argument prototype would still apply.  */
+-char strerror ();
+-int
+-main ()
+-{
+-strerror ();
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
+-  ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+-  (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }; }; then
+-  ac_cv_search_strerror="-l$ac_lib"
+-break
++  ac_cv_lib_cposix_strerror=yes
+ else
+   echo "$as_me: failed program was:" >&5
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
++ac_cv_lib_cposix_strerror=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+-  done
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
++LIBS=$ac_check_lib_save_LIBS
+ fi
+-LIBS=$ac_func_search_save_LIBS
++echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5
++echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6
++if test $ac_cv_lib_cposix_strerror = yes; then
++  LIBS="$LIBS -lcposix"
+ fi
+-echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
+-echo "${ECHO_T}$ac_cv_search_strerror" >&6
+-if test "$ac_cv_search_strerror" != no; then
+-  test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
+ 
+-fi
++
+ 
+ # Check whether --enable-largefile or --disable-largefile was given.
+ if test "${enable_largefile+set}" = set; then
+@@ -3124,8 +3198,7 @@
+        while :; do
+      	 # IRIX 6.2 and later do not support large files by default,
+      	 # so use the C compiler's -n32 option if that helps.
+-         cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
++	 cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3150,11 +3223,20 @@
+ _ACEOF
+      	 rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3166,15 +3248,24 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext
++rm -f conftest.err conftest.$ac_objext
+      	 CC="$CC -n32"
+      	 rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3186,8 +3277,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext
+-         break
++rm -f conftest.err conftest.$ac_objext
++	 break
+        done
+        CC=$ac_save_CC
+        rm -f conftest.$ac_ext
+@@ -3207,7 +3298,6 @@
+   while :; do
+   ac_cv_sys_file_offset_bits=no
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3232,11 +3322,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3248,9 +3347,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3276,11 +3374,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3292,7 +3399,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   break
+ done
+ fi
+@@ -3314,7 +3421,6 @@
+   while :; do
+   ac_cv_sys_large_files=no
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3339,11 +3445,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3355,9 +3470,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3383,11 +3497,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3399,7 +3522,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   break
+ done
+ fi
+@@ -3443,7 +3566,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3506,11 +3628,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3523,7 +3654,7 @@
+ 
+ ac_cv_c_const=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+ echo "${ECHO_T}$ac_cv_c_const" >&6
+@@ -3550,7 +3681,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3570,11 +3700,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3587,7 +3726,7 @@
+ 
+ eval "$as_ac_Header=no"
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -3610,7 +3749,6 @@
+   ac_func_search_save_LIBS=$LIBS
+ ac_cv_search_opendir=no
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3634,11 +3772,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3650,12 +3797,12 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ if test "$ac_cv_search_opendir" = no; then
+   for ac_lib in dir; do
+     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+     cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3679,11 +3826,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3696,7 +3852,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+   done
+ fi
+ LIBS=$ac_func_search_save_LIBS
+@@ -3717,7 +3874,6 @@
+   ac_func_search_save_LIBS=$LIBS
+ ac_cv_search_opendir=no
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3741,11 +3897,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3757,12 +3922,12 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ if test "$ac_cv_search_opendir" = no; then
+   for ac_lib in x; do
+     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+     cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3786,11 +3951,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3803,7 +3977,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+   done
+ fi
+ LIBS=$ac_func_search_save_LIBS
+@@ -3823,7 +3998,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3844,11 +4018,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -3861,12 +4044,11 @@
+ 
+ ac_cv_header_stdc=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
+ if test $ac_cv_header_stdc = yes; then
+   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3888,7 +4070,6 @@
+ if test $ac_cv_header_stdc = yes; then
+   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3913,7 +4094,6 @@
+   :
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -3925,9 +4105,9 @@
+ # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+ #else
+ # define ISLOWER(c) \
+-                   (('a' <= (c) && (c) <= 'i') \
+-                     || ('j' <= (c) && (c) <= 'r') \
+-                     || ('s' <= (c) && (c) <= 'z'))
++		   (('a' <= (c) && (c) <= 'i') \
++		     || ('j' <= (c) && (c) <= 'r') \
++		     || ('s' <= (c) && (c) <= 'z'))
+ # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+ #endif
+ 
+@@ -3938,7 +4118,7 @@
+   int i;
+   for (i = 0; i < 256; i++)
+     if (XOR (islower (i), ISLOWER (i))
+-        || toupper (i) != TOUPPER (i))
++	|| toupper (i) != TOUPPER (i))
+       exit(2);
+   exit (0);
+ }
+@@ -3963,7 +4143,7 @@
+ ( exit $ac_status )
+ ac_cv_header_stdc=no
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ fi
+@@ -3999,7 +4179,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4010,11 +4189,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4027,7 +4215,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -4035,7 +4223,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4053,6 +4240,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -4072,33 +4260,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
++    ;;
++  no:yes:* )
++    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
++echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
+-    ;;
+-  no:yes )
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -4109,7 +4296,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -4131,7 +4318,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4151,11 +4337,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4168,7 +4363,7 @@
+ 
+ ac_cv_type_mode_t=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
+ echo "${ECHO_T}$ac_cv_type_mode_t" >&6
+@@ -4188,7 +4383,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4208,11 +4402,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4225,7 +4428,7 @@
+ 
+ ac_cv_type_off_t=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+ echo "${ECHO_T}$ac_cv_type_off_t" >&6
+@@ -4245,7 +4448,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4265,11 +4467,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4282,7 +4493,7 @@
+ 
+ ac_cv_type_pid_t=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+ echo "${ECHO_T}$ac_cv_type_pid_t" >&6
+@@ -4302,7 +4513,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4329,11 +4539,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4346,7 +4565,7 @@
+ 
+ ac_cv_type_signal=int
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+ echo "${ECHO_T}$ac_cv_type_signal" >&6
+@@ -4362,7 +4581,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4382,11 +4600,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4399,7 +4626,7 @@
+ 
+ ac_cv_type_size_t=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+ echo "${ECHO_T}$ac_cv_type_size_t" >&6
+@@ -4419,7 +4646,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4468,11 +4694,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4485,7 +4720,7 @@
+ 
+ ac_cv_header_stdbool_h=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
+ echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
+@@ -4495,7 +4730,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4515,11 +4749,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4532,7 +4775,7 @@
+ 
+ ac_cv_type__Bool=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
+ echo "${ECHO_T}$ac_cv_type__Bool" >&6
+@@ -4589,7 +4832,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4600,11 +4842,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4617,7 +4868,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -4625,7 +4876,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4643,6 +4893,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -4662,33 +4913,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -4699,7 +4949,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -4733,7 +4983,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4744,11 +4993,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4761,7 +5019,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -4769,7 +5027,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4787,6 +5044,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -4806,33 +5064,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -4843,7 +5100,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -4865,7 +5122,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4886,11 +5142,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4903,7 +5168,7 @@
+ 
+ ac_cv_header_time=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+ echo "${ECHO_T}$ac_cv_header_time" >&6
+@@ -4933,7 +5198,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -4964,11 +5228,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -4981,7 +5254,7 @@
+ 
+ fu_cv_sys_struct_utimbuf=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
+ fi
+ echo "$as_me:$LINENO: result: $fu_cv_sys_struct_utimbuf" >&5
+@@ -5005,7 +5278,6 @@
+   ac_cv_func_closedir_void=yes
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5045,7 +5317,7 @@
+ ( exit $ac_status )
+ ac_cv_func_closedir_void=yes
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
+@@ -5076,7 +5348,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5087,11 +5358,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -5104,7 +5384,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -5112,7 +5392,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5130,6 +5409,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -5149,33 +5429,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -5186,7 +5465,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -5220,7 +5499,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5231,11 +5509,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -5248,7 +5535,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -5256,7 +5543,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5274,6 +5560,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -5293,33 +5580,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -5330,7 +5616,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -5364,7 +5650,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5375,11 +5660,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -5392,7 +5686,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -5400,7 +5694,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5418,6 +5711,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -5437,33 +5731,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -5474,7 +5767,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -5497,7 +5790,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5517,11 +5809,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -5534,7 +5835,7 @@
+ 
+ ac_cv_have_decl_getenv=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6
+@@ -5562,7 +5863,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5582,11 +5882,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -5599,7 +5908,7 @@
+ 
+ ac_cv_have_decl_malloc=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6
+@@ -5628,7 +5937,6 @@
+ else
+ 
+         cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5647,11 +5955,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -5664,7 +5981,7 @@
+ 
+ ac_cv_win_or_dos=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5
+@@ -5714,7 +6031,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5725,11 +6041,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -5742,7 +6067,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -5750,7 +6075,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5768,6 +6092,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -5787,33 +6112,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -5824,7 +6148,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -5872,7 +6196,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -5905,11 +6228,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -5922,7 +6254,8 @@
+ 
+ jm_cv_struct_dirent_d_ino=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ 
+ 
+ fi
+@@ -6011,21 +6344,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6056,11 +6396,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6073,7 +6422,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -6126,21 +6476,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6171,11 +6528,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6188,7 +6554,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -6203,21 +6570,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define _doprnt innocuous__doprnt
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char _doprnt (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef _doprnt
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6248,11 +6622,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6265,7 +6648,8 @@
+ 
+ ac_cv_func__doprnt=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+ echo "${ECHO_T}$ac_cv_func__doprnt" >&6
+@@ -6288,13 +6672,12 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+-
++$ac_includes_default
+ int
+ main ()
+ {
+@@ -6305,11 +6688,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6322,12 +6714,20 @@
+ 
+ ac_cv_lib_error_at_line=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_lib_error_at_line" >&5
+ echo "${ECHO_T}$ac_cv_lib_error_at_line" >&6
+ if test $ac_cv_lib_error_at_line = no; then
+-  LIBOBJS="$LIBOBJS error.$ac_objext"
++  case $LIBOBJS in
++    "error.$ac_objext"   | \
++  *" error.$ac_objext"   | \
++    "error.$ac_objext "* | \
++  *" error.$ac_objext "* ) ;;
++  *) LIBOBJS="$LIBOBJS error.$ac_objext" ;;
++esac
++
+ fi
+ 
+ 
+@@ -6343,21 +6743,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6388,11 +6795,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
+-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6405,7 +6821,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -6423,7 +6840,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6443,11 +6859,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6460,7 +6885,7 @@
+ 
+ ac_cv_have_decl_strerror=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_strerror" >&6
+@@ -6486,7 +6911,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6506,11 +6930,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6523,7 +6956,7 @@
+ 
+ ac_cv_have_decl_strerror_r=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6
+@@ -6553,21 +6986,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6598,11 +7038,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6615,7 +7064,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -6636,7 +7086,6 @@
+     ac_cv_func_strerror_r_char_p=no
+     if test $ac_cv_have_decl_strerror_r = yes; then
+       cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6657,11 +7106,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6673,7 +7131,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+     else
+       # strerror_r is not declared.  Choose between
+       # systems that have relatively inaccessible declarations for the
+@@ -6685,7 +7143,6 @@
+   :
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6721,7 +7178,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+     fi
+ 
+@@ -6749,21 +7206,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -6794,11 +7258,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6811,7 +7284,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -6821,7 +7295,14 @@
+ _ACEOF
+ 
+ else
+-  LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
++  case $LIBOBJS in
++    "$ac_func.$ac_objext"   | \
++  *" $ac_func.$ac_objext"   | \
++    "$ac_func.$ac_objext "* | \
++  *" $ac_func.$ac_objext "* ) ;;
++  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
++esac
++
+ fi
+ done
+ 
+@@ -6855,7 +7336,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6866,11 +7346,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -6883,7 +7372,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -6891,7 +7380,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -6909,6 +7397,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -6928,33 +7417,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -6965,7 +7453,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -6989,7 +7477,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7053,21 +7540,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -7098,11 +7592,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -7115,7 +7618,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -7125,7 +7629,14 @@
+ _ACEOF
+ 
+ else
+-  LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
++  case $LIBOBJS in
++    "$ac_func.$ac_objext"   | \
++  *" $ac_func.$ac_objext"   | \
++    "$ac_func.$ac_objext "* | \
++  *" $ac_func.$ac_objext "* ) ;;
++  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
++esac
++
+ fi
+ done
+ 
+@@ -7163,7 +7674,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7174,11 +7684,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -7191,7 +7710,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -7199,7 +7718,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7217,6 +7735,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -7236,33 +7755,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -7273,7 +7791,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -7297,7 +7815,6 @@
+   ac_cv_func_malloc_0_nonnull=no
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7337,7 +7854,7 @@
+ ( exit $ac_status )
+ ac_cv_func_malloc_0_nonnull=no
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5
+@@ -7353,7 +7870,14 @@
+ #define HAVE_MALLOC 0
+ _ACEOF
+ 
+-   LIBOBJS="$LIBOBJS malloc.$ac_objext"
++   case $LIBOBJS in
++    "malloc.$ac_objext"   | \
++  *" malloc.$ac_objext"   | \
++    "malloc.$ac_objext "* | \
++  *" malloc.$ac_objext "* ) ;;
++  *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;;
++esac
++
+ 
+ cat >>confdefs.h <<\_ACEOF
+ #define malloc rpl_malloc
+@@ -7388,7 +7912,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7399,11 +7922,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -7416,7 +7948,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -7424,7 +7956,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7442,6 +7973,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -7461,33 +7993,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -7498,7 +8029,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -7522,7 +8053,6 @@
+   ac_cv_func_realloc_0_nonnull=no
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7562,7 +8092,7 @@
+ ( exit $ac_status )
+ ac_cv_func_realloc_0_nonnull=no
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5
+@@ -7578,7 +8108,14 @@
+ #define HAVE_REALLOC 0
+ _ACEOF
+ 
+-   LIBOBJS="$LIBOBJS realloc.$ac_objext"
++   case $LIBOBJS in
++    "realloc.$ac_objext"   | \
++  *" realloc.$ac_objext"   | \
++    "realloc.$ac_objext "* | \
++  *" realloc.$ac_objext "* ) ;;
++  *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;;
++esac
++
+ 
+ cat >>confdefs.h <<\_ACEOF
+ #define realloc rpl_realloc
+@@ -7619,7 +8156,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7630,11 +8166,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -7647,7 +8192,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -7655,7 +8200,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7673,6 +8217,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -7692,33 +8237,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -7729,7 +8273,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -7772,7 +8316,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7783,11 +8326,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -7800,7 +8352,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -7808,7 +8360,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7826,6 +8377,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -7845,33 +8397,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -7882,7 +8433,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -7916,7 +8467,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7927,11 +8477,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -7944,7 +8503,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -7952,7 +8511,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -7970,6 +8528,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -7989,33 +8548,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -8026,7 +8584,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -8053,21 +8611,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -8098,11 +8663,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8115,7 +8689,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -8139,21 +8714,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -8184,11 +8766,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8201,7 +8792,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -8241,7 +8833,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8259,11 +8850,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8276,7 +8876,7 @@
+ 
+ ac_cv_type_mbstate_t=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_type_mbstate_t" >&5
+ echo "${ECHO_T}$ac_cv_type_mbstate_t" >&6
+@@ -8300,7 +8900,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8317,11 +8916,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8334,7 +8942,8 @@
+ 
+ jm_cv_func_mbrtowc=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $jm_cv_func_mbrtowc" >&5
+ echo "${ECHO_T}$jm_cv_func_mbrtowc" >&6
+@@ -8348,69 +8957,465 @@
+ 
+ 
+ 
+-
+-
+-
+-
+-for ac_func in pathconf
+-do
+-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+-echo "$as_me:$LINENO: checking for $ac_func" >&5
+-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+-if eval "test \"\${$as_ac_var+set}\" = set"; then
++      echo "$as_me:$LINENO: checking whether free is declared" >&5
++echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6
++if test "${ac_cv_have_decl_free+set}" = set; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
+-/* System header to define __stub macros and hopefully few prototypes,
+-    which can conflict with char $ac_func (); below.
+-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+-    <limits.h> exists even on freestanding compilers.  */
+-#ifdef __STDC__
+-# include <limits.h>
+-#else
+-# include <assert.h>
+-#endif
+-/* Override any gcc2 internal prototype to avoid an error.  */
+-#ifdef __cplusplus
+-extern "C"
+-{
+-#endif
+-/* We use char because int might match the return type of a gcc2
+-   builtin and then its argument prototype would still apply.  */
+-char $ac_func ();
+-/* The GNU C library defines this for functions which it implements
+-    to always fail with ENOSYS.  Some functions are actually named
+-    something starting with __ and the normal name is an alias.  */
+-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+-choke me
+-#else
+-char (*f) () = $ac_func;
+-#endif
+-#ifdef __cplusplus
+-}
+-#endif
+-
++$ac_includes_default
+ int
+ main ()
+ {
+-return f != $ac_func;
++#ifndef free
++  char *p = (char *) free;
++#endif
++
+   ;
+   return 0;
+ }
+ _ACEOF
+-rm -f conftest.$ac_objext conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_have_decl_free=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_have_decl_free=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5
++echo "${ECHO_T}$ac_cv_have_decl_free" >&6
++if test $ac_cv_have_decl_free = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE_DECL_FREE 1
++_ACEOF
++
++
++else
++  cat >>confdefs.h <<_ACEOF
++#define HAVE_DECL_FREE 0
++_ACEOF
++
++
++fi
++
++
++
++
++
++  :
++
++
++
++
++
++  echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
++echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
++if test "${ac_cv_header_stdbool_h+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++	  #include <stdbool.h>
++	  #ifndef bool
++	   "error: bool is not defined"
++	  #endif
++	  #ifndef false
++	   "error: false is not defined"
++	  #endif
++	  #if false
++	   "error: false is not 0"
++	  #endif
++	  #ifndef true
++	   "error: false is not defined"
++	  #endif
++	  #if true != 1
++	   "error: true is not 1"
++	  #endif
++	  #ifndef __bool_true_false_are_defined
++	   "error: __bool_true_false_are_defined is not defined"
++	  #endif
++
++	  struct s { _Bool s: 1; _Bool t; } s;
++
++	  char a[true == 1 ? 1 : -1];
++	  char b[false == 0 ? 1 : -1];
++	  char c[__bool_true_false_are_defined == 1 ? 1 : -1];
++	  char d[(bool) -0.5 == true ? 1 : -1];
++	  bool e = &s;
++	  char f[(_Bool) -0.0 == false ? 1 : -1];
++	  char g[true];
++	  char h[sizeof (_Bool)];
++	  char i[sizeof s.t];
++
++int
++main ()
++{
++ return !a + !b + !c + !d + !e + !f + !g + !h + !i;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_header_stdbool_h=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_header_stdbool_h=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
++echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
++   echo "$as_me:$LINENO: checking for _Bool" >&5
++echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
++if test "${ac_cv_type__Bool+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++$ac_includes_default
++int
++main ()
++{
++if ((_Bool *) 0)
++  return 0;
++if (sizeof (_Bool))
++  return 0;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_type__Bool=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_type__Bool=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
++echo "${ECHO_T}$ac_cv_type__Bool" >&6
++if test $ac_cv_type__Bool = yes; then
++
++cat >>confdefs.h <<_ACEOF
++#define HAVE__BOOL 1
++_ACEOF
++
++
++fi
++
++   if test $ac_cv_header_stdbool_h = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_STDBOOL_H 1
++_ACEOF
++
++   fi
++
++  :
++
++
++
++
++
++
++
++
++
++
++echo "$as_me:$LINENO: checking for nanosecond timestamps in struct stat" >&5
++echo $ECHO_N "checking for nanosecond timestamps in struct stat... $ECHO_C" >&6
++if test "${ac_cv_stat_nsec+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++	  #include <sys/types.h>
++	  #include <sys/stat.h>
++	  #include <unistd.h>
++	  struct stat st;
++
++int
++main ()
++{
++ return st.st_atimensec + st.st_mtimensec + st.st_ctimensec;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_stat_nsec=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_stat_nsec=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_stat_nsec" >&5
++echo "${ECHO_T}$ac_cv_stat_nsec" >&6
++   if test $ac_cv_stat_nsec = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_STAT_NSEC 1
++_ACEOF
++
++   fi
++
++   echo "$as_me:$LINENO: checking for nanosecond timestamps in struct stat" >&5
++echo $ECHO_N "checking for nanosecond timestamps in struct stat... $ECHO_C" >&6
++if test "${ac_cv_stat_timeval+set}" = set; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++
++	  #include <time.h>
++	  #include <sys/types.h>
++	  #include <sys/stat.h>
++	  #include <unistd.h>
++	  struct stat st;
++
++int
++main ()
++{
++ return st.st_atim.tv_nsec + st.st_mtim.tv_nsec + st.st_ctim.tv_nsec;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext
++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
++  (eval $ac_compile) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; }; then
++  ac_cv_stat_timeval=yes
++else
++  echo "$as_me: failed program was:" >&5
++sed 's/^/| /' conftest.$ac_ext >&5
++
++ac_cv_stat_timeval=no
++fi
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
++
++fi
++echo "$as_me:$LINENO: result: $ac_cv_stat_timeval" >&5
++echo "${ECHO_T}$ac_cv_stat_timeval" >&6
++   if test $ac_cv_stat_timeval = yes; then
++
++cat >>confdefs.h <<\_ACEOF
++#define HAVE_STAT_TIMEVAL 1
++_ACEOF
++
++   fi
++
++
++
++
++
++for ac_func in pathconf
++do
++as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
++echo "$as_me:$LINENO: checking for $ac_func" >&5
++echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
++if eval "test \"\${$as_ac_var+set}\" = set"; then
++  echo $ECHO_N "(cached) $ECHO_C" >&6
++else
++  cat >conftest.$ac_ext <<_ACEOF
++/* confdefs.h.  */
++_ACEOF
++cat confdefs.h >>conftest.$ac_ext
++cat >>conftest.$ac_ext <<_ACEOF
++/* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
++/* System header to define __stub macros and hopefully few prototypes,
++    which can conflict with char $ac_func (); below.
++    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
++    <limits.h> exists even on freestanding compilers.  */
++
++#ifdef __STDC__
++# include <limits.h>
++#else
++# include <assert.h>
++#endif
++
++#undef $ac_func
++
++/* Override any gcc2 internal prototype to avoid an error.  */
++#ifdef __cplusplus
++extern "C"
++{
++#endif
++/* We use char because int might match the return type of a gcc2
++   builtin and then its argument prototype would still apply.  */
++char $ac_func ();
++/* The GNU C library defines this for functions which it implements
++    to always fail with ENOSYS.  Some functions are actually named
++    something starting with __ and the normal name is an alias.  */
++#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
++choke me
++#else
++char (*f) () = $ac_func;
++#endif
++#ifdef __cplusplus
++}
++#endif
++
++int
++main ()
++{
++return f != $ac_func;
++  ;
++  return 0;
++}
++_ACEOF
++rm -f conftest.$ac_objext conftest$ac_exeext
++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
++  (eval $ac_link) 2>conftest.er1
++  ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); } &&
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8423,7 +9428,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -8454,7 +9460,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8465,11 +9470,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8482,7 +9496,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -8490,7 +9504,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8508,6 +9521,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -8527,33 +9541,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -8564,7 +9577,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -8587,7 +9600,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8607,11 +9619,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8624,7 +9645,7 @@
+ 
+ ac_cv_have_decl_free=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_free" >&6
+@@ -8648,7 +9669,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8668,11 +9688,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8685,7 +9714,7 @@
+ 
+ ac_cv_have_decl_getenv=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getenv" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_getenv" >&6
+@@ -8709,7 +9738,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8729,11 +9757,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8746,7 +9783,7 @@
+ 
+ ac_cv_have_decl_malloc=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6
+@@ -8770,7 +9807,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -8790,11 +9826,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8807,7 +9852,7 @@
+ 
+ ac_cv_have_decl_mktemp=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_mktemp" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_mktemp" >&6
+@@ -8849,21 +9894,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -8894,11 +9946,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8911,7 +9972,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -8934,21 +9996,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -8979,11 +10048,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -8996,7 +10074,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -9006,7 +10085,14 @@
+ _ACEOF
+ 
+ else
+-  LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
++  case $LIBOBJS in
++    "$ac_func.$ac_objext"   | \
++  *" $ac_func.$ac_objext"   | \
++    "$ac_func.$ac_objext "* | \
++  *" $ac_func.$ac_objext "* ) ;;
++  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
++esac
++
+ fi
+ done
+ 
+@@ -9019,7 +10105,6 @@
+   while :; do
+   ac_cv_sys_largefile_source=no
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9036,11 +10121,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9052,9 +10146,8 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9072,11 +10165,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9088,7 +10190,7 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   break
+ done
+ fi
+@@ -9112,7 +10214,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9129,11 +10230,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9146,7 +10256,8 @@
+ 
+ ac_cv_func_fseeko=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_fseeko" >&5
+ echo "${ECHO_T}$ac_cv_func_fseeko" >&6
+@@ -9165,7 +10276,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9185,11 +10295,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9202,7 +10321,7 @@
+ 
+ ac_cv_have_decl_clearerr_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_clearerr_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_clearerr_unlocked" >&6
+@@ -9230,7 +10349,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9250,11 +10368,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9267,7 +10394,7 @@
+ 
+ ac_cv_have_decl_feof_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_feof_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_feof_unlocked" >&6
+@@ -9295,7 +10422,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9315,11 +10441,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9332,7 +10467,7 @@
+ 
+ ac_cv_have_decl_ferror_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_ferror_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_ferror_unlocked" >&6
+@@ -9360,7 +10495,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9380,11 +10514,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9397,7 +10540,7 @@
+ 
+ ac_cv_have_decl_fflush_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fflush_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fflush_unlocked" >&6
+@@ -9425,7 +10568,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9445,11 +10587,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9462,7 +10613,7 @@
+ 
+ ac_cv_have_decl_fgets_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fgets_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fgets_unlocked" >&6
+@@ -9490,7 +10641,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9510,11 +10660,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9527,7 +10686,7 @@
+ 
+ ac_cv_have_decl_fputc_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputc_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fputc_unlocked" >&6
+@@ -9555,7 +10714,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9575,11 +10733,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9592,7 +10759,7 @@
+ 
+ ac_cv_have_decl_fputs_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fputs_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fputs_unlocked" >&6
+@@ -9620,7 +10787,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9640,11 +10806,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9657,7 +10832,7 @@
+ 
+ ac_cv_have_decl_fread_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fread_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fread_unlocked" >&6
+@@ -9685,7 +10860,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9705,11 +10879,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9722,7 +10905,7 @@
+ 
+ ac_cv_have_decl_fwrite_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fwrite_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_fwrite_unlocked" >&6
+@@ -9750,7 +10933,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9770,11 +10952,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9787,7 +10978,7 @@
+ 
+ ac_cv_have_decl_getc_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getc_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_getc_unlocked" >&6
+@@ -9815,7 +11006,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9835,11 +11025,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9852,7 +11051,7 @@
+ 
+ ac_cv_have_decl_getchar_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getchar_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_getchar_unlocked" >&6
+@@ -9880,7 +11079,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9900,11 +11098,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9917,7 +11124,7 @@
+ 
+ ac_cv_have_decl_putc_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putc_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_putc_unlocked" >&6
+@@ -9945,7 +11152,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -9965,11 +11171,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -9982,7 +11197,7 @@
+ 
+ ac_cv_have_decl_putchar_unlocked=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_have_decl_putchar_unlocked" >&5
+ echo "${ECHO_T}$ac_cv_have_decl_putchar_unlocked" >&6
+@@ -10075,7 +11290,6 @@
+   ac_cv_func_closedir_void=yes
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10115,7 +11329,7 @@
+ ( exit $ac_status )
+ ac_cv_func_closedir_void=yes
+ fi
+-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
++rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+ fi
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
+@@ -10146,7 +11360,6 @@
+ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+ echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10157,11 +11370,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -10174,7 +11396,7 @@
+ 
+ ac_header_compiler=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+ echo "${ECHO_T}$ac_header_compiler" >&6
+ 
+@@ -10182,7 +11404,6 @@
+ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+ echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10200,6 +11421,7 @@
+   (exit $ac_status); } >/dev/null; then
+   if test -s conftest.err; then
+     ac_cpp_err=$ac_c_preproc_warn_flag
++    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+   else
+     ac_cpp_err=
+   fi
+@@ -10219,33 +11441,32 @@
+ echo "${ECHO_T}$ac_header_preproc" >&6
+ 
+ # So?  What about this header?
+-case $ac_header_compiler:$ac_header_preproc in
+-  yes:no )
++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
++  yes:no: )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+ echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+-    (
+-      cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
+-_ASBOX
+-    ) |
+-      sed "s/^/$as_me: WARNING:     /" >&2
++    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
++echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
++    ac_header_preproc=yes
+     ;;
+-  no:yes )
++  no:yes:* )
+     { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+ echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+-    { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
++echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
++echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
++echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+     { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
++    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
++echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+     (
+       cat <<\_ASBOX
+-## ------------------------------------ ##
+-## Report this to bug-autoconf@gnu.org. ##
+-## ------------------------------------ ##
++## -------------------------------- ##
++## Report this to bug-patch@gnu.org ##
++## -------------------------------- ##
+ _ASBOX
+     ) |
+       sed "s/^/$as_me: WARNING:     /" >&2
+@@ -10256,7 +11477,7 @@
+ if eval "test \"\${$as_ac_Header+set}\" = set"; then
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+-  eval "$as_ac_Header=$ac_header_preproc"
++  eval "$as_ac_Header=\$ac_header_preproc"
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+@@ -10277,7 +11498,6 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10300,11 +11520,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -10317,7 +11546,8 @@
+ 
+ ac_cv_func_setmode_dos=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func_setmode_dos" >&5
+ echo "${ECHO_T}$ac_cv_func_setmode_dos" >&6
+@@ -10338,21 +11568,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -10383,11 +11620,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -10400,7 +11646,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -10415,21 +11662,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define _doprnt innocuous__doprnt
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char _doprnt (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef _doprnt
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -10460,11 +11714,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -10477,7 +11740,8 @@
+ 
+ ac_cv_func__doprnt=no
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+ echo "${ECHO_T}$ac_cv_func__doprnt" >&6
+@@ -10503,21 +11767,28 @@
+   echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+   cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+ cat >>conftest.$ac_ext <<_ACEOF
+ /* end confdefs.h.  */
++/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
++   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
++#define $ac_func innocuous_$ac_func
++
+ /* System header to define __stub macros and hopefully few prototypes,
+     which can conflict with char $ac_func (); below.
+     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
++
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #endif
++
++#undef $ac_func
++
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ #ifdef __cplusplus
+ extern "C"
+@@ -10548,11 +11819,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext conftest$ac_exeext
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+-  (eval $ac_link) 2>&5
++  (eval $ac_link) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest$ac_exeext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest$ac_exeext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -10565,7 +11845,8 @@
+ 
+ eval "$as_ac_var=no"
+ fi
+-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext \
++      conftest$ac_exeext conftest.$ac_ext
+ fi
+ echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+ echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+@@ -10585,7 +11866,6 @@
+   patch_cv_mkdir_takes_one_arg=no
+       if test $ac_cv_func_mkdir = yes; then
+         cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10605,11 +11885,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -10621,7 +11910,6 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10641,11 +11929,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -10658,10 +11955,10 @@
+ sed 's/^/| /' conftest.$ac_ext >&5
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+       fi
+ 
+ 
+@@ -10686,7 +11983,6 @@
+ else
+ 
+         cat >conftest.$ac_ext <<_ACEOF
+-#line $LINENO "configure"
+ /* confdefs.h.  */
+ _ACEOF
+ cat confdefs.h >>conftest.$ac_ext
+@@ -10705,11 +12001,20 @@
+ _ACEOF
+ rm -f conftest.$ac_objext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+-  (eval $ac_compile) 2>&5
++  (eval $ac_compile) 2>conftest.er1
+   ac_status=$?
++  grep -v '^ *+' conftest.er1 >conftest.err
++  rm -f conftest.er1
++  cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } &&
+-         { ac_try='test -s conftest.$ac_objext'
++	 { ac_try='test -z "$ac_c_werror_flag"			 || test ! -s conftest.err'
++  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
++  (eval $ac_try) 2>&5
++  ac_status=$?
++  echo "$as_me:$LINENO: \$? = $ac_status" >&5
++  (exit $ac_status); }; } &&
++	 { ac_try='test -s conftest.$ac_objext'
+   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+   (eval $ac_try) 2>&5
+   ac_status=$?
+@@ -10722,7 +12027,7 @@
+ 
+ ac_cv_win_or_dos=no
+ fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
+ fi
+ echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5
+@@ -10834,13 +12139,13 @@
+       # `set' does not quote correctly, so add quotes (double-quote
+       # substitution turns \\\\ into \\, and sed turns \\ into \).
+       sed -n \
+-        "s/'/'\\\\''/g;
+-    	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
++	"s/'/'\\\\''/g;
++	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+       ;;
+     *)
+       # `set' quotes correctly as required by POSIX, so do not add quotes.
+       sed -n \
+-        "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
++	"s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+       ;;
+     esac;
+ } |
+@@ -10870,13 +12175,13 @@
+ # trailing colons and then remove the whole line if VPATH becomes empty
+ # (actually we leave an empty line to preserve line numbers).
+ if test "x$srcdir" = x.; then
+-  ac_vpsub='/^[ 	]*VPATH[ 	]*=/{
++  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+ s/:*\$(srcdir):*/:/;
+ s/:*\${srcdir}:*/:/;
+ s/:*@srcdir@:*/:/;
+-s/^\([^=]*=[ 	]*\):*/\1/;
++s/^\([^=]*=[	 ]*\):*/\1/;
+ s/:*$//;
+-s/^[^=]*=[ 	]*$//;
++s/^[^=]*=[	 ]*$//;
+ }'
+ fi
+ 
+@@ -10887,7 +12192,7 @@
+ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+   # 1. Remove the extension, and $U if already installed.
+   ac_i=`echo "$ac_i" |
+-         sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
++	 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+   # 2. Add them.
+   ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+   ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+@@ -10931,9 +12236,10 @@
+ elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+   set -o posix
+ fi
++DUALCASE=1; export DUALCASE # for MKS sh
+ 
+ # Support unset when possible.
+-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
++if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+   as_unset=unset
+ else
+   as_unset=false
+@@ -10952,7 +12258,7 @@
+   LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+   LC_TELEPHONE LC_TIME
+ do
+-  if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
++  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+     eval $as_var=C; export $as_var
+   else
+     $as_unset $as_var
+@@ -11131,16 +12437,17 @@
+ if mkdir -p . 2>/dev/null; then
+   as_mkdir_p=:
+ else
++  test -d ./-p && rmdir ./-p
+   as_mkdir_p=false
+ fi
+ 
+ as_executable_p="test -f"
+ 
+ # Sed expression to map a string onto a valid CPP name.
+-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+ 
+ # Sed expression to map a string onto a valid variable name.
+-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+ 
+ 
+ # IFS
+@@ -11167,7 +12474,7 @@
+ cat >&5 <<_CSEOF
+ 
+ This file was extended by patch $as_me 2.5.9, which was
+-generated by GNU Autoconf 2.57.  Invocation command line was
++generated by GNU Autoconf 2.59.  Invocation command line was
+ 
+   CONFIG_FILES    = $CONFIG_FILES
+   CONFIG_HEADERS  = $CONFIG_HEADERS
+@@ -11211,9 +12518,9 @@
+   -d, --debug      don't remove temporary files
+       --recheck    update $as_me by reconfiguring in the same conditions
+   --file=FILE[:TEMPLATE]
+-                   instantiate the configuration file FILE
++		   instantiate the configuration file FILE
+   --header=FILE[:TEMPLATE]
+-                   instantiate the configuration header FILE
++		   instantiate the configuration header FILE
+ 
+ Configuration files:
+ $config_files
+@@ -11227,11 +12534,10 @@
+ cat >>$CONFIG_STATUS <<_ACEOF
+ ac_cs_version="\\
+ patch config.status 2.5.9
+-configured by $0, generated by GNU Autoconf 2.57,
++configured by $0, generated by GNU Autoconf 2.59,
+   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+ 
+-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+-Free Software Foundation, Inc.
++Copyright (C) 2003 Free Software Foundation, Inc.
+ This config.status script is free software; the Free Software Foundation
+ gives unlimited permission to copy, distribute and modify it."
+ srcdir=$srcdir
+@@ -11463,9 +12769,9 @@
+       (echo ':t
+   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+       if test -z "$ac_sed_cmds"; then
+-  	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
++	ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+       else
+-  	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
++	ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+       fi
+       ac_sed_frag=`expr $ac_sed_frag + 1`
+       ac_beg=$ac_end
+@@ -11483,21 +12789,21 @@
+   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+   case $ac_file in
+   - | *:- | *:-:* ) # input from stdin
+-        cat >$tmp/stdin
+-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++	cat >$tmp/stdin
++	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+   * )   ac_file_in=$ac_file.in ;;
+   esac
+ 
+   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+   ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+-         X"$ac_file" : 'X\(//\)[^/]' \| \
+-         X"$ac_file" : 'X\(//\)$' \| \
+-         X"$ac_file" : 'X\(/\)' \| \
+-         .     : '\(.\)' 2>/dev/null ||
++	 X"$ac_file" : 'X\(//\)[^/]' \| \
++	 X"$ac_file" : 'X\(//\)$' \| \
++	 X"$ac_file" : 'X\(/\)' \| \
++	 .     : '\(.\)' 2>/dev/null ||
+ echo X"$ac_file" |
+     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -11513,10 +12819,10 @@
+       as_dirs="$as_dir $as_dirs"
+       as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+-         X"$as_dir" : 'X\(//\)[^/]' \| \
+-         X"$as_dir" : 'X\(//\)$' \| \
+-         X"$as_dir" : 'X\(/\)' \| \
+-         .     : '\(.\)' 2>/dev/null ||
++	 X"$as_dir" : 'X\(//\)[^/]' \| \
++	 X"$as_dir" : 'X\(//\)$' \| \
++	 X"$as_dir" : 'X\(/\)' \| \
++	 .     : '\(.\)' 2>/dev/null ||
+ echo X"$as_dir" |
+     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -11554,12 +12860,45 @@
+     ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+     ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ esac
+-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+-# absolute.
+-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
++
++# Do not use `cd foo && pwd` to compute absolute paths, because
++# the directories may not exist.
++case `pwd` in
++.) ac_abs_builddir="$ac_dir";;
++*)
++  case "$ac_dir" in
++  .) ac_abs_builddir=`pwd`;;
++  [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
++  *) ac_abs_builddir=`pwd`/"$ac_dir";;
++  esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_builddir=${ac_top_builddir}.;;
++*)
++  case ${ac_top_builddir}. in
++  .) ac_abs_top_builddir=$ac_abs_builddir;;
++  [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
++  *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
++  esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_srcdir=$ac_srcdir;;
++*)
++  case $ac_srcdir in
++  .) ac_abs_srcdir=$ac_abs_builddir;;
++  [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
++  *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
++  esac;;
++esac
++case $ac_abs_builddir in
++.) ac_abs_top_srcdir=$ac_top_srcdir;;
++*)
++  case $ac_top_srcdir in
++  .) ac_abs_top_srcdir=$ac_abs_builddir;;
++  [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
++  *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
++  esac;;
++esac
+ 
+ 
+   case $INSTALL in
+@@ -11567,11 +12906,6 @@
+   *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+   esac
+ 
+-  if test x"$ac_file" != x-; then
+-    { echo "$as_me:$LINENO: creating $ac_file" >&5
+-echo "$as_me: creating $ac_file" >&6;}
+-    rm -f "$ac_file"
+-  fi
+   # Let's still pretend it is `configure' which instantiates (i.e., don't
+   # use $as_me), people would be surprised to read:
+   #    /* config.h.  Generated by config.status.  */
+@@ -11581,7 +12915,7 @@
+     configure_input="$ac_file.  "
+   fi
+   configure_input=$configure_input"Generated from `echo $ac_file_in |
+-                                     sed 's,.*/,,'` by configure."
++				     sed 's,.*/,,'` by configure."
+ 
+   # First look for the input files in the build tree, otherwise in the
+   # src tree.
+@@ -11590,26 +12924,32 @@
+       case $f in
+       -) echo $tmp/stdin ;;
+       [\\/$]*)
+-         # Absolute (can't be DOS-style, as IFS=:)
+-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++	 # Absolute (can't be DOS-style, as IFS=:)
++	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+    { (exit 1); exit 1; }; }
+-         echo $f;;
++	 echo "$f";;
+       *) # Relative
+-         if test -f "$f"; then
+-           # Build tree
+-           echo $f
+-         elif test -f "$srcdir/$f"; then
+-           # Source tree
+-           echo $srcdir/$f
+-         else
+-           # /dev/null tree
+-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++	 if test -f "$f"; then
++	   # Build tree
++	   echo "$f"
++	 elif test -f "$srcdir/$f"; then
++	   # Source tree
++	   echo "$srcdir/$f"
++	 else
++	   # /dev/null tree
++	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+    { (exit 1); exit 1; }; }
+-         fi;;
++	 fi;;
+       esac
+     done` || { (exit 1); exit 1; }
++
++  if test x"$ac_file" != x-; then
++    { echo "$as_me:$LINENO: creating $ac_file" >&5
++echo "$as_me: creating $ac_file" >&6;}
++    rm -f "$ac_file"
++  fi
+ _ACEOF
+ cat >>$CONFIG_STATUS <<_ACEOF
+   sed "$ac_vpsub
+@@ -11649,12 +12989,12 @@
+ # NAME is the cpp macro being defined and VALUE is the value it is being given.
+ #
+ # ac_d sets the value in "#define NAME VALUE" lines.
+-ac_dA='s,^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
+-ac_dB='[ 	].*$,\1#\2'
++ac_dA='s,^\([	 ]*\)#\([	 ]*define[	 ][	 ]*\)'
++ac_dB='[	 ].*$,\1#\2'
+ ac_dC=' '
+ ac_dD=',;t'
+ # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+-ac_uA='s,^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
++ac_uA='s,^\([	 ]*\)#\([	 ]*\)undef\([	 ][	 ]*\)'
+ ac_uB='$,\1#\2define\3'
+ ac_uC=' '
+ ac_uD=',;t'
+@@ -11663,11 +13003,11 @@
+   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+   case $ac_file in
+   - | *:- | *:-:* ) # input from stdin
+-        cat >$tmp/stdin
+-        ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++	cat >$tmp/stdin
++	ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
++	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+-        ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
++	ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+   * )   ac_file_in=$ac_file.in ;;
+   esac
+ 
+@@ -11681,28 +13021,29 @@
+       case $f in
+       -) echo $tmp/stdin ;;
+       [\\/$]*)
+-         # Absolute (can't be DOS-style, as IFS=:)
+-         test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++	 # Absolute (can't be DOS-style, as IFS=:)
++	 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+    { (exit 1); exit 1; }; }
+-         echo $f;;
++	 # Do quote $f, to prevent DOS paths from being IFS'd.
++	 echo "$f";;
+       *) # Relative
+-         if test -f "$f"; then
+-           # Build tree
+-           echo $f
+-         elif test -f "$srcdir/$f"; then
+-           # Source tree
+-           echo $srcdir/$f
+-         else
+-           # /dev/null tree
+-           { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
++	 if test -f "$f"; then
++	   # Build tree
++	   echo "$f"
++	 elif test -f "$srcdir/$f"; then
++	   # Source tree
++	   echo "$srcdir/$f"
++	 else
++	   # /dev/null tree
++	   { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ echo "$as_me: error: cannot find input file: $f" >&2;}
+    { (exit 1); exit 1; }; }
+-         fi;;
++	 fi;;
+       esac
+     done` || { (exit 1); exit 1; }
+   # Remove the trailing spaces.
+-  sed 's/[ 	]*$//' $ac_file_inputs >$tmp/in
++  sed 's/[	 ]*$//' $ac_file_inputs >$tmp/in
+ 
+ _ACEOF
+ 
+@@ -11725,9 +13066,9 @@
+ s,[\\$`],\\&,g
+ t clear
+ : clear
+-s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	(][^ 	(]*\)\(([^)]*)\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
++s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 (][^	 (]*\)\(([^)]*)\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+ t end
+-s,^[ 	]*#[ 	]*define[ 	][ 	]*\([^ 	][^ 	]*\)[ 	]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
++s,^[	 ]*#[	 ]*define[	 ][	 ]*\([^	 ][^	 ]*\)[	 ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+ : end
+ _ACEOF
+ # If some macros were called several times there might be several times
+@@ -11741,13 +13082,13 @@
+ # example, in the case of _POSIX_SOURCE, which is predefined and required
+ # on some systems where configure will not decide to define it.
+ cat >>conftest.undefs <<\_ACEOF
+-s,^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
++s,^[	 ]*#[	 ]*undef[	 ][	 ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+ _ACEOF
+ 
+ # Break up conftest.defines because some shells have a limit on the size
+ # of here documents, and old seds have small limits too (100 cmds).
+ echo '  # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+-echo '  if grep "^[ 	]*#[ 	]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
++echo '  if grep "^[	 ]*#[	 ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+ echo '  # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+ echo '  :' >>$CONFIG_STATUS
+ rm -f conftest.tail
+@@ -11756,7 +13097,7 @@
+   # Write a limited-size here document to $tmp/defines.sed.
+   echo '  cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+   # Speed up: don't consider the non `#define' lines.
+-  echo '/^[ 	]*#[ 	]*define/!b' >>$CONFIG_STATUS
++  echo '/^[	 ]*#[	 ]*define/!b' >>$CONFIG_STATUS
+   # Work around the forget-to-reset-the-flag bug.
+   echo 't clr' >>$CONFIG_STATUS
+   echo ': clr' >>$CONFIG_STATUS
+@@ -11783,7 +13124,7 @@
+   # Write a limited-size here document to $tmp/undefs.sed.
+   echo '  cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+   # Speed up: don't consider the non `#undef'
+-  echo '/^[ 	]*#[ 	]*undef/!b' >>$CONFIG_STATUS
++  echo '/^[	 ]*#[	 ]*undef/!b' >>$CONFIG_STATUS
+   # Work around the forget-to-reset-the-flag bug.
+   echo 't clr' >>$CONFIG_STATUS
+   echo ': clr' >>$CONFIG_STATUS
+@@ -11817,10 +13158,10 @@
+     else
+       ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+-         X"$ac_file" : 'X\(//\)[^/]' \| \
+-         X"$ac_file" : 'X\(//\)$' \| \
+-         X"$ac_file" : 'X\(/\)' \| \
+-         .     : '\(.\)' 2>/dev/null ||
++	 X"$ac_file" : 'X\(//\)[^/]' \| \
++	 X"$ac_file" : 'X\(//\)$' \| \
++	 X"$ac_file" : 'X\(/\)' \| \
++	 .     : '\(.\)' 2>/dev/null ||
+ echo X"$ac_file" |
+     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+@@ -11836,10 +13177,10 @@
+       as_dirs="$as_dir $as_dirs"
+       as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+-         X"$as_dir" : 'X\(//\)[^/]' \| \
+-         X"$as_dir" : 'X\(//\)$' \| \
+-         X"$as_dir" : 'X\(/\)' \| \
+-         .     : '\(.\)' 2>/dev/null ||
++	 X"$as_dir" : 'X\(//\)[^/]' \| \
++	 X"$as_dir" : 'X\(//\)$' \| \
++	 X"$as_dir" : 'X\(/\)' \| \
++	 .     : '\(.\)' 2>/dev/null ||
+ echo X"$as_dir" |
+     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+   	  /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+--- patch-2.5.9.orig/configure.ac
++++ patch-2.5.9/configure.ac
+@@ -64,6 +64,9 @@
+ gl_PREREQ_XMALLOC
+ gl_QUOTE
+ gl_QUOTEARG
++gl_HASH
++
++ag_CHECK_NANOSECOND_STAT
+ 
+ dnl This should be in gnulib, but isn't for some reason.
+ AC_DEFUN([jm_PREREQ_ADDEXT],
+--- patch-2.5.9.orig/pch.c
++++ patch-2.5.9/pch.c
+@@ -1,6 +1,6 @@
+ /* reading patches */
+ 
+-/* $Id: pch.c,v 1.44 2003/05/20 14:03:17 eggert Exp $ */
++/* $Id: pch.c,v 1.45 2003/07/02 22:19:21 eggert Exp $ */
+ 
+ /* Copyright (C) 1986, 1987, 1988 Larry Wall
+ 
+@@ -366,10 +366,16 @@
+ 	if (!stars_last_line && strnEQ(s, "*** ", 4))
+ 	    name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]);
+ 	else if (strnEQ(s, "+++ ", 4))
++	  {
+ 	    /* Swap with NEW below.  */
+ 	    name[OLD] = fetchname (s+4, strippath, &p_timestamp[OLD]);
++	    p_strip_trailing_cr = strip_trailing_cr;
++	  }
+ 	else if (strnEQ(s, "Index:", 6))
++	  {
+ 	    name[INDEX] = fetchname (s+6, strippath, (time_t *) 0);
++	    p_strip_trailing_cr = strip_trailing_cr;
++	  }
+ 	else if (strnEQ(s, "Prereq:", 7)) {
+ 	    for (t = s + 7;  ISSPACE ((unsigned char) *t);  t++)
+ 	      continue;
+@@ -409,6 +415,7 @@
+ 		    p_timestamp[NEW] = timestamp;
+ 		    p_rfc934_nesting = (t - s) >> 1;
+ 		  }
++		p_strip_trailing_cr = strip_trailing_cr;
+ 	      }
+ 	  }
+ 	if ((diff_type == NO_DIFF || diff_type == ED_DIFF) &&
+--- patch-2.5.9.orig/util.c
++++ patch-2.5.9/util.c
+@@ -45,9 +45,17 @@
+ # define raise(sig) kill (getpid (), sig)
+ #endif
+ 
++#if defined(HAVE_STAT_TIMEVAL)
++#include <time.h>
++#endif
++
+ #include <stdarg.h>
++#include <hash.h>
+ 
+ static void makedirs (char *);
++static bool fid_search (const char *, const struct stat *, bool);
++# define fid_exists(name, pst) fid_search (name, pst, false)
++# define insert_fid(name) fid_search (name, NULL, true)
+ 
+ /* Move a file FROM (where *FROM_NEEDS_REMOVAL is nonzero if FROM
+    needs removal when cleaning up at the end of execution)
+@@ -64,7 +72,7 @@
+   struct stat to_st;
+   int to_errno = ! backup ? -1 : stat (to, &to_st) == 0 ? 0 : errno;
+ 
+-  if (backup)
++  if (backup && (to_errno || ! fid_exists (to, &to_st)))
+     {
+       int try_makedirs_errno = 0;
+       char *bakname;
+@@ -165,6 +173,7 @@
+ 	      if (! to_dir_known_to_exist)
+ 		makedirs (to);
+ 	      copy_file (from, to, 0, mode);
++	      insert_fid (to);
+ 	      return;
+ 	    }
+ 
+@@ -173,6 +182,7 @@
+ 	}
+ 
+     rename_succeeded:
++      insert_fid (to);
+       /* Do not clear *FROM_NEEDS_REMOVAL if it's possible that the
+ 	 rename returned zero because FROM and TO are hard links to
+ 	 the same file.  */
+@@ -1011,3 +1021,105 @@
+   if (file_seek (stream, offset, ptrname) != 0)
+     pfatal ("fseek");
+ }
++
++typedef struct
++{
++  dev_t		fid_dev;
++  ino_t		fid_ino;
++  time_t	fid_mtime;
++  unsigned long	fid_mtimensec;
++} file_id;
++
++unsigned
++file_id_hasher (file_id *entry, unsigned table_size)
++{
++  return ((unsigned long) entry->fid_ino +
++  	  (unsigned long) entry->fid_dev +
++  	  (unsigned long) entry->fid_mtime +
++	  (unsigned long) entry->fid_mtimensec) % table_size;
++}
++
++bool
++file_id_comparator (file_id *entry1, file_id *entry2)
++{
++  return (entry1->fid_dev	== entry2->fid_dev &&
++	  entry1->fid_ino	== entry2->fid_ino &&
++	  entry1->fid_mtime	== entry2->fid_mtime &&
++	  entry1->fid_mtimensec == entry2->fid_mtimensec);
++}
++
++void
++file_id_freer (file_id *entry)
++{
++  free (entry);
++}
++
++Hash_table *file_id_hash;
++
++/* Check if the file identified by FILENAME and PST was already seen. If the
++   file was already seen, returns TRUE.  If the file has not yet been seen
++   and INSERT is TRUE, it is inserted.  PST or FILENAME may be NULL (but not
++   both of them).  */
++
++static bool
++fid_search (const char *filename, const struct stat *pst, bool insert)
++{
++  struct stat st;
++
++  if (!file_id_hash)
++    {
++      file_id_hash = hash_initialize (0, NULL, (Hash_hasher) file_id_hasher,
++				      (Hash_comparator) file_id_comparator,
++				      (Hash_data_freer) file_id_freer);
++      if (!file_id_hash)
++	pfatal ("hash_initialize");
++    }
++
++  if (!pst)
++    {
++      if (stat (filename, &st) != 0)
++	pfatal ("%s", quotearg (filename));
++      pst = &st;
++    }
++
++  if (insert)
++    {
++      file_id *pfid = xmalloc (sizeof (file_id)), *old_pfid;
++      pfid->fid_dev	  = pst->st_dev;
++      pfid->fid_ino	  = pst->st_ino;
++      pfid->fid_mtime	  = pst->st_mtime;
++#if defined(HAVE_STAT_NSEC)
++      pfid->fid_mtimensec = pst->st_mtimensec;
++#elif defined(HAVE_STAT_TIMEVAL)
++      pfid->fid_mtimensec = pst->st_mtim.tv_nsec;
++#else
++      pfid->fid_mtimensec = 0;
++#endif
++      old_pfid = hash_insert (file_id_hash, pfid);
++      if (!old_pfid)
++	pfatal ("hash_insert");
++      else if (old_pfid != pfid)
++        {
++	  free (pfid);
++	  return true;
++	}
++      else
++	return false;
++    }
++  else
++    {
++      file_id fid;
++      fid.fid_dev	= pst->st_dev;
++      fid.fid_ino	= pst->st_ino;
++      fid.fid_mtime	= pst->st_mtime;
++#if defined(HAVE_STAT_NSEC)
++      fid.fid_mtimensec = pst->st_mtimensec;
++#elif defined(HAVE_STAT_TIMEVAL)
++      fid.fid_mtimensec = pst->st_mtim.tv_nsec;
++#else
++      fid.fid_mtimensec = 0;
++#endif
++      return hash_lookup (file_id_hash, &fid) != 0;
++    }
++}
++
+--- patch-2.5.9.orig/hash.c
++++ patch-2.5.9/hash.c
+@@ -0,0 +1,1051 @@
++/* hash - hashing table processing.
++
++   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
++   Foundation, Inc.
++
++   Written by Jim Meyering, 1992.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software Foundation,
++   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++
++/* A generic hash table package.  */
++
++/* Define USE_OBSTACK to 1 if you want the allocator to use obstacks instead
++   of malloc.  If you change USE_OBSTACK, you have to recompile!  */
++
++#if HAVE_CONFIG_H
++# include <config.h>
++#endif
++#if HAVE_STDLIB_H
++# include <stdlib.h>
++#endif
++
++#include <limits.h>
++#include <stdbool.h>
++#include <stdio.h>
++
++#ifndef HAVE_DECL_FREE
++"this configure-time declaration test was not run"
++#endif
++#if !HAVE_DECL_FREE
++void free ();
++#endif
++
++#ifndef HAVE_DECL_MALLOC
++"this configure-time declaration test was not run"
++#endif
++#if !HAVE_DECL_MALLOC
++char *malloc ();
++#endif
++
++#if USE_OBSTACK
++# include "obstack.h"
++# ifndef obstack_chunk_alloc
++#  define obstack_chunk_alloc malloc
++# endif
++# ifndef obstack_chunk_free
++#  define obstack_chunk_free free
++# endif
++#endif
++
++#include "hash.h"
++
++struct hash_table
++  {
++    /* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
++       for a possibility of N_BUCKETS.  Among those, N_BUCKETS_USED buckets
++       are not empty, there are N_ENTRIES active entries in the table.  */
++    struct hash_entry *bucket;
++    struct hash_entry *bucket_limit;
++    unsigned n_buckets;
++    unsigned n_buckets_used;
++    unsigned n_entries;
++
++    /* Tuning arguments, kept in a physicaly separate structure.  */
++    const Hash_tuning *tuning;
++
++    /* Three functions are given to `hash_initialize', see the documentation
++       block for this function.  In a word, HASHER randomizes a user entry
++       into a number up from 0 up to some maximum minus 1; COMPARATOR returns
++       true if two user entries compare equally; and DATA_FREER is the cleanup
++       function for a user entry.  */
++    Hash_hasher hasher;
++    Hash_comparator comparator;
++    Hash_data_freer data_freer;
++
++    /* A linked list of freed struct hash_entry structs.  */
++    struct hash_entry *free_entry_list;
++
++#if USE_OBSTACK
++    /* Whenever obstacks are used, it is possible to allocate all overflowed
++       entries into a single stack, so they all can be freed in a single
++       operation.  It is not clear if the speedup is worth the trouble.  */
++    struct obstack entry_stack;
++#endif
++  };
++
++/* A hash table contains many internal entries, each holding a pointer to
++   some user provided data (also called a user entry).  An entry indistinctly
++   refers to both the internal entry and its associated user entry.  A user
++   entry contents may be hashed by a randomization function (the hashing
++   function, or just `hasher' for short) into a number (or `slot') between 0
++   and the current table size.  At each slot position in the hash table,
++   starts a linked chain of entries for which the user data all hash to this
++   slot.  A bucket is the collection of all entries hashing to the same slot.
++
++   A good `hasher' function will distribute entries rather evenly in buckets.
++   In the ideal case, the length of each bucket is roughly the number of
++   entries divided by the table size.  Finding the slot for a data is usually
++   done in constant time by the `hasher', and the later finding of a precise
++   entry is linear in time with the size of the bucket.  Consequently, a
++   larger hash table size (that is, a larger number of buckets) is prone to
++   yielding shorter chains, *given* the `hasher' function behaves properly.
++
++   Long buckets slow down the lookup algorithm.  One might use big hash table
++   sizes in hope to reduce the average length of buckets, but this might
++   become inordinate, as unused slots in the hash table take some space.  The
++   best bet is to make sure you are using a good `hasher' function (beware
++   that those are not that easy to write! :-), and to use a table size
++   larger than the actual number of entries.  */
++
++/* If an insertion makes the ratio of nonempty buckets to table size larger
++   than the growth threshold (a number between 0.0 and 1.0), then increase
++   the table size by multiplying by the growth factor (a number greater than
++   1.0).  The growth threshold defaults to 0.8, and the growth factor
++   defaults to 1.414, meaning that the table will have doubled its size
++   every second time 80% of the buckets get used.  */
++#define DEFAULT_GROWTH_THRESHOLD 0.8
++#define DEFAULT_GROWTH_FACTOR 1.414
++
++/* If a deletion empties a bucket and causes the ratio of used buckets to
++   table size to become smaller than the shrink threshold (a number between
++   0.0 and 1.0), then shrink the table by multiplying by the shrink factor (a
++   number greater than the shrink threshold but smaller than 1.0).  The shrink
++   threshold and factor default to 0.0 and 1.0, meaning that the table never
++   shrinks.  */
++#define DEFAULT_SHRINK_THRESHOLD 0.0
++#define DEFAULT_SHRINK_FACTOR 1.0
++
++/* Use this to initialize or reset a TUNING structure to
++   some sensible values. */
++static const Hash_tuning default_tuning =
++  {
++    DEFAULT_SHRINK_THRESHOLD,
++    DEFAULT_SHRINK_FACTOR,
++    DEFAULT_GROWTH_THRESHOLD,
++    DEFAULT_GROWTH_FACTOR,
++    false
++  };
++
++/* Information and lookup.  */
++
++/* The following few functions provide information about the overall hash
++   table organization: the number of entries, number of buckets and maximum
++   length of buckets.  */
++
++/* Return the number of buckets in the hash table.  The table size, the total
++   number of buckets (used plus unused), or the maximum number of slots, are
++   the same quantity.  */
++
++unsigned
++hash_get_n_buckets (const Hash_table *table)
++{
++  return table->n_buckets;
++}
++
++/* Return the number of slots in use (non-empty buckets).  */
++
++unsigned
++hash_get_n_buckets_used (const Hash_table *table)
++{
++  return table->n_buckets_used;
++}
++
++/* Return the number of active entries.  */
++
++unsigned
++hash_get_n_entries (const Hash_table *table)
++{
++  return table->n_entries;
++}
++
++/* Return the length of the longest chain (bucket).  */
++
++unsigned
++hash_get_max_bucket_length (const Hash_table *table)
++{
++  struct hash_entry *bucket;
++  unsigned max_bucket_length = 0;
++
++  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++    {
++      if (bucket->data)
++	{
++	  struct hash_entry *cursor = bucket;
++	  unsigned bucket_length = 1;
++
++	  while (cursor = cursor->next, cursor)
++	    bucket_length++;
++
++	  if (bucket_length > max_bucket_length)
++	    max_bucket_length = bucket_length;
++	}
++    }
++
++  return max_bucket_length;
++}
++
++/* Do a mild validation of a hash table, by traversing it and checking two
++   statistics.  */
++
++bool
++hash_table_ok (const Hash_table *table)
++{
++  struct hash_entry *bucket;
++  unsigned n_buckets_used = 0;
++  unsigned n_entries = 0;
++
++  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++    {
++      if (bucket->data)
++	{
++	  struct hash_entry *cursor = bucket;
++
++	  /* Count bucket head.  */
++	  n_buckets_used++;
++	  n_entries++;
++
++	  /* Count bucket overflow.  */
++	  while (cursor = cursor->next, cursor)
++	    n_entries++;
++	}
++    }
++
++  if (n_buckets_used == table->n_buckets_used && n_entries == table->n_entries)
++    return true;
++
++  return false;
++}
++
++void
++hash_print_statistics (const Hash_table *table, FILE *stream)
++{
++  unsigned n_entries = hash_get_n_entries (table);
++  unsigned n_buckets = hash_get_n_buckets (table);
++  unsigned n_buckets_used = hash_get_n_buckets_used (table);
++  unsigned max_bucket_length = hash_get_max_bucket_length (table);
++
++  fprintf (stream, "# entries:         %u\n", n_entries);
++  fprintf (stream, "# buckets:         %u\n", n_buckets);
++  fprintf (stream, "# buckets used:    %u (%.2f%%)\n", n_buckets_used,
++	   (100.0 * n_buckets_used) / n_buckets);
++  fprintf (stream, "max bucket length: %u\n", max_bucket_length);
++}
++
++/* If ENTRY matches an entry already in the hash table, return the
++   entry from the table.  Otherwise, return NULL.  */
++
++void *
++hash_lookup (const Hash_table *table, const void *entry)
++{
++  struct hash_entry *bucket
++    = table->bucket + table->hasher (entry, table->n_buckets);
++  struct hash_entry *cursor;
++
++  if (! (bucket < table->bucket_limit))
++    abort ();
++
++  if (bucket->data == NULL)
++    return NULL;
++
++  for (cursor = bucket; cursor; cursor = cursor->next)
++    if (table->comparator (entry, cursor->data))
++      return cursor->data;
++
++  return NULL;
++}
++
++/* Walking.  */
++
++/* The functions in this page traverse the hash table and process the
++   contained entries.  For the traversal to work properly, the hash table
++   should not be resized nor modified while any particular entry is being
++   processed.  In particular, entries should not be added or removed.  */
++
++/* Return the first data in the table, or NULL if the table is empty.  */
++
++void *
++hash_get_first (const Hash_table *table)
++{
++  struct hash_entry *bucket;
++
++  if (table->n_entries == 0)
++    return NULL;
++
++  for (bucket = table->bucket; ; bucket++)
++    if (! (bucket < table->bucket_limit))
++      abort ();
++    else if (bucket->data)
++      return bucket->data;
++}
++
++/* Return the user data for the entry following ENTRY, where ENTRY has been
++   returned by a previous call to either `hash_get_first' or `hash_get_next'.
++   Return NULL if there are no more entries.  */
++
++void *
++hash_get_next (const Hash_table *table, const void *entry)
++{
++  struct hash_entry *bucket
++    = table->bucket + table->hasher (entry, table->n_buckets);
++  struct hash_entry *cursor;
++
++  if (! (bucket < table->bucket_limit))
++    abort ();
++
++  /* Find next entry in the same bucket.  */
++  for (cursor = bucket; cursor; cursor = cursor->next)
++    if (cursor->data == entry && cursor->next)
++      return cursor->next->data;
++
++  /* Find first entry in any subsequent bucket.  */
++  while (++bucket < table->bucket_limit)
++    if (bucket->data)
++      return bucket->data;
++
++  /* None found.  */
++  return NULL;
++}
++
++/* Fill BUFFER with pointers to active user entries in the hash table, then
++   return the number of pointers copied.  Do not copy more than BUFFER_SIZE
++   pointers.  */
++
++unsigned
++hash_get_entries (const Hash_table *table, void **buffer,
++		  unsigned buffer_size)
++{
++  unsigned counter = 0;
++  struct hash_entry *bucket;
++  struct hash_entry *cursor;
++
++  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++    {
++      if (bucket->data)
++	{
++	  for (cursor = bucket; cursor; cursor = cursor->next)
++	    {
++	      if (counter >= buffer_size)
++		return counter;
++	      buffer[counter++] = cursor->data;
++	    }
++	}
++    }
++
++  return counter;
++}
++
++/* Call a PROCESSOR function for each entry of a hash table, and return the
++   number of entries for which the processor function returned success.  A
++   pointer to some PROCESSOR_DATA which will be made available to each call to
++   the processor function.  The PROCESSOR accepts two arguments: the first is
++   the user entry being walked into, the second is the value of PROCESSOR_DATA
++   as received.  The walking continue for as long as the PROCESSOR function
++   returns nonzero.  When it returns zero, the walking is interrupted.  */
++
++unsigned
++hash_do_for_each (const Hash_table *table, Hash_processor processor,
++		  void *processor_data)
++{
++  unsigned counter = 0;
++  struct hash_entry *bucket;
++  struct hash_entry *cursor;
++
++  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++    {
++      if (bucket->data)
++	{
++	  for (cursor = bucket; cursor; cursor = cursor->next)
++	    {
++	      if (!(*processor) (cursor->data, processor_data))
++		return counter;
++	      counter++;
++	    }
++	}
++    }
++
++  return counter;
++}
++
++/* Allocation and clean-up.  */
++
++/* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1.
++   This is a convenience routine for constructing other hashing functions.  */
++
++#if USE_DIFF_HASH
++
++/* About hashings, Paul Eggert writes to me (FP), on 1994-01-01: "Please see
++   B. J. McKenzie, R. Harries & T. Bell, Selecting a hashing algorithm,
++   Software--practice & experience 20, 2 (Feb 1990), 209-224.  Good hash
++   algorithms tend to be domain-specific, so what's good for [diffutils'] io.c
++   may not be good for your application."  */
++
++unsigned
++hash_string (const char *string, unsigned n_buckets)
++{
++# define ROTATE_LEFT(Value, Shift) \
++  ((Value) << (Shift) | (Value) >> ((sizeof (unsigned) * CHAR_BIT) - (Shift)))
++# define HASH_ONE_CHAR(Value, Byte) \
++  ((Byte) + ROTATE_LEFT (Value, 7))
++
++  unsigned value = 0;
++
++  for (; *string; string++)
++    value = HASH_ONE_CHAR (value, *(const unsigned char *) string);
++  return value % n_buckets;
++
++# undef ROTATE_LEFT
++# undef HASH_ONE_CHAR
++}
++
++#else /* not USE_DIFF_HASH */
++
++/* This one comes from `recode', and performs a bit better than the above as
++   per a few experiments.  It is inspired from a hashing routine found in the
++   very old Cyber `snoop', itself written in typical Greg Mansfield style.
++   (By the way, what happened to this excellent man?  Is he still alive?)  */
++
++unsigned
++hash_string (const char *string, unsigned n_buckets)
++{
++  unsigned value = 0;
++
++  while (*string)
++    value = ((value * 31 + (int) *(const unsigned char *) string++)
++	     % n_buckets);
++  return value;
++}
++
++#endif /* not USE_DIFF_HASH */
++
++/* Return true if CANDIDATE is a prime number.  CANDIDATE should be an odd
++   number at least equal to 11.  */
++
++static bool
++is_prime (unsigned long candidate)
++{
++  unsigned long divisor = 3;
++  unsigned long square = divisor * divisor;
++
++  while (square < candidate && (candidate % divisor))
++    {
++      divisor++;
++      square += 4 * divisor;
++      divisor++;
++    }
++
++  return (candidate % divisor ? true : false);
++}
++
++/* Round a given CANDIDATE number up to the nearest prime, and return that
++   prime.  Primes lower than 10 are merely skipped.  */
++
++static unsigned long
++next_prime (unsigned long candidate)
++{
++  /* Skip small primes.  */
++  if (candidate < 10)
++    candidate = 10;
++
++  /* Make it definitely odd.  */
++  candidate |= 1;
++
++  while (!is_prime (candidate))
++    candidate += 2;
++
++  return candidate;
++}
++
++void
++hash_reset_tuning (Hash_tuning *tuning)
++{
++  *tuning = default_tuning;
++}
++
++/* For the given hash TABLE, check the user supplied tuning structure for
++   reasonable values, and return true if there is no gross error with it.
++   Otherwise, definitively reset the TUNING field to some acceptable default
++   in the hash table (that is, the user loses the right of further modifying
++   tuning arguments), and return false.  */
++
++static bool
++check_tuning (Hash_table *table)
++{
++  const Hash_tuning *tuning = table->tuning;
++
++  if (tuning->growth_threshold > 0.0
++      && tuning->growth_threshold < 1.0
++      && tuning->growth_factor > 1.0
++      && tuning->shrink_threshold >= 0.0
++      && tuning->shrink_threshold < 1.0
++      && tuning->shrink_factor > tuning->shrink_threshold
++      && tuning->shrink_factor <= 1.0
++      && tuning->shrink_threshold < tuning->growth_threshold)
++    return true;
++
++  table->tuning = &default_tuning;
++  return false;
++}
++
++/* Allocate and return a new hash table, or NULL upon failure.  The initial
++   number of buckets is automatically selected so as to _guarantee_ that you
++   may insert at least CANDIDATE different user entries before any growth of
++   the hash table size occurs.  So, if have a reasonably tight a-priori upper
++   bound on the number of entries you intend to insert in the hash table, you
++   may save some table memory and insertion time, by specifying it here.  If
++   the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE
++   argument has its meaning changed to the wanted number of buckets.
++
++   TUNING points to a structure of user-supplied values, in case some fine
++   tuning is wanted over the default behavior of the hasher.  If TUNING is
++   NULL, the default tuning parameters are used instead.
++
++   The user-supplied HASHER function should be provided.  It accepts two
++   arguments ENTRY and TABLE_SIZE.  It computes, by hashing ENTRY contents, a
++   slot number for that entry which should be in the range 0..TABLE_SIZE-1.
++   This slot number is then returned.
++
++   The user-supplied COMPARATOR function should be provided.  It accepts two
++   arguments pointing to user data, it then returns true for a pair of entries
++   that compare equal, or false otherwise.  This function is internally called
++   on entries which are already known to hash to the same bucket index.
++
++   The user-supplied DATA_FREER function, when not NULL, may be later called
++   with the user data as an argument, just before the entry containing the
++   data gets freed.  This happens from within `hash_free' or `hash_clear'.
++   You should specify this function only if you want these functions to free
++   all of your `data' data.  This is typically the case when your data is
++   simply an auxiliary struct that you have malloc'd to aggregate several
++   values.  */
++
++Hash_table *
++hash_initialize (unsigned candidate, const Hash_tuning *tuning,
++		 Hash_hasher hasher, Hash_comparator comparator,
++		 Hash_data_freer data_freer)
++{
++  Hash_table *table;
++  struct hash_entry *bucket;
++
++  if (hasher == NULL || comparator == NULL)
++    return NULL;
++
++  table = (Hash_table *) malloc (sizeof (Hash_table));
++  if (table == NULL)
++    return NULL;
++
++  if (!tuning)
++    tuning = &default_tuning;
++  table->tuning = tuning;
++  if (!check_tuning (table))
++    {
++      /* Fail if the tuning options are invalid.  This is the only occasion
++	 when the user gets some feedback about it.  Once the table is created,
++	 if the user provides invalid tuning options, we silently revert to
++	 using the defaults, and ignore further request to change the tuning
++	 options.  */
++      free (table);
++      return NULL;
++    }
++
++  table->n_buckets
++    = next_prime (tuning->is_n_buckets ? candidate
++		  : (unsigned) (candidate / tuning->growth_threshold));
++
++  table->bucket = (struct hash_entry *)
++    malloc (table->n_buckets * sizeof (struct hash_entry));
++  if (table->bucket == NULL)
++    {
++      free (table);
++      return NULL;
++    }
++  table->bucket_limit = table->bucket + table->n_buckets;
++
++  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++    {
++      bucket->data = NULL;
++      bucket->next = NULL;
++    }
++  table->n_buckets_used = 0;
++  table->n_entries = 0;
++
++  table->hasher = hasher;
++  table->comparator = comparator;
++  table->data_freer = data_freer;
++
++  table->free_entry_list = NULL;
++#if USE_OBSTACK
++  obstack_init (&table->entry_stack);
++#endif
++  return table;
++}
++
++/* Make all buckets empty, placing any chained entries on the free list.
++   Apply the user-specified function data_freer (if any) to the datas of any
++   affected entries.  */
++
++void
++hash_clear (Hash_table *table)
++{
++  struct hash_entry *bucket;
++
++  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++    {
++      if (bucket->data)
++	{
++	  struct hash_entry *cursor;
++	  struct hash_entry *next;
++
++	  /* Free the bucket overflow.  */
++	  for (cursor = bucket->next; cursor; cursor = next)
++	    {
++	      if (table->data_freer)
++		(*table->data_freer) (cursor->data);
++	      cursor->data = NULL;
++
++	      next = cursor->next;
++	      /* Relinking is done one entry at a time, as it is to be expected
++		 that overflows are either rare or short.  */
++	      cursor->next = table->free_entry_list;
++	      table->free_entry_list = cursor;
++	    }
++
++	  /* Free the bucket head.  */
++	  if (table->data_freer)
++	    (*table->data_freer) (bucket->data);
++	  bucket->data = NULL;
++	  bucket->next = NULL;
++	}
++    }
++
++  table->n_buckets_used = 0;
++  table->n_entries = 0;
++}
++
++/* Reclaim all storage associated with a hash table.  If a data_freer
++   function has been supplied by the user when the hash table was created,
++   this function applies it to the data of each entry before freeing that
++   entry.  */
++
++void
++hash_free (Hash_table *table)
++{
++  struct hash_entry *bucket;
++  struct hash_entry *cursor;
++  struct hash_entry *next;
++
++  /* Call the user data_freer function.  */
++  if (table->data_freer && table->n_entries)
++    {
++      for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++	{
++	  if (bucket->data)
++	    {
++	      for (cursor = bucket; cursor; cursor = cursor->next)
++		{
++		  (*table->data_freer) (cursor->data);
++		}
++	    }
++	}
++    }
++
++#if USE_OBSTACK
++
++  obstack_free (&table->entry_stack, NULL);
++
++#else
++
++  /* Free all bucket overflowed entries.  */
++  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++    {
++      for (cursor = bucket->next; cursor; cursor = next)
++	{
++	  next = cursor->next;
++	  free (cursor);
++	}
++    }
++
++  /* Also reclaim the internal list of previously freed entries.  */
++  for (cursor = table->free_entry_list; cursor; cursor = next)
++    {
++      next = cursor->next;
++      free (cursor);
++    }
++
++#endif
++
++  /* Free the remainder of the hash table structure.  */
++  free (table->bucket);
++  free (table);
++}
++
++/* Insertion and deletion.  */
++
++/* Get a new hash entry for a bucket overflow, possibly by reclying a
++   previously freed one.  If this is not possible, allocate a new one.  */
++
++static struct hash_entry *
++allocate_entry (Hash_table *table)
++{
++  struct hash_entry *new;
++
++  if (table->free_entry_list)
++    {
++      new = table->free_entry_list;
++      table->free_entry_list = new->next;
++    }
++  else
++    {
++#if USE_OBSTACK
++      new = (struct hash_entry *)
++	obstack_alloc (&table->entry_stack, sizeof (struct hash_entry));
++#else
++      new = (struct hash_entry *) malloc (sizeof (struct hash_entry));
++#endif
++    }
++
++  return new;
++}
++
++/* Free a hash entry which was part of some bucket overflow,
++   saving it for later recycling.  */
++
++static void
++free_entry (Hash_table *table, struct hash_entry *entry)
++{
++  entry->data = NULL;
++  entry->next = table->free_entry_list;
++  table->free_entry_list = entry;
++}
++
++/* This private function is used to help with insertion and deletion.  When
++   ENTRY matches an entry in the table, return a pointer to the corresponding
++   user data and set *BUCKET_HEAD to the head of the selected bucket.
++   Otherwise, return NULL.  When DELETE is true and ENTRY matches an entry in
++   the table, unlink the matching entry.  */
++
++static void *
++hash_find_entry (Hash_table *table, const void *entry,
++		 struct hash_entry **bucket_head, bool delete)
++{
++  struct hash_entry *bucket
++    = table->bucket + table->hasher (entry, table->n_buckets);
++  struct hash_entry *cursor;
++
++  if (! (bucket < table->bucket_limit))
++    abort ();
++
++  *bucket_head = bucket;
++
++  /* Test for empty bucket.  */
++  if (bucket->data == NULL)
++    return NULL;
++
++  /* See if the entry is the first in the bucket.  */
++  if ((*table->comparator) (entry, bucket->data))
++    {
++      void *data = bucket->data;
++
++      if (delete)
++	{
++	  if (bucket->next)
++	    {
++	      struct hash_entry *next = bucket->next;
++
++	      /* Bump the first overflow entry into the bucket head, then save
++		 the previous first overflow entry for later recycling.  */
++	      *bucket = *next;
++	      free_entry (table, next);
++	    }
++	  else
++	    {
++	      bucket->data = NULL;
++	    }
++	}
++
++      return data;
++    }
++
++  /* Scan the bucket overflow.  */
++  for (cursor = bucket; cursor->next; cursor = cursor->next)
++    {
++      if ((*table->comparator) (entry, cursor->next->data))
++	{
++	  void *data = cursor->next->data;
++
++	  if (delete)
++	    {
++	      struct hash_entry *next = cursor->next;
++
++	      /* Unlink the entry to delete, then save the freed entry for later
++		 recycling.  */
++	      cursor->next = next->next;
++	      free_entry (table, next);
++	    }
++
++	  return data;
++	}
++    }
++
++  /* No entry found.  */
++  return NULL;
++}
++
++/* For an already existing hash table, change the number of buckets through
++   specifying CANDIDATE.  The contents of the hash table are preserved.  The
++   new number of buckets is automatically selected so as to _guarantee_ that
++   the table may receive at least CANDIDATE different user entries, including
++   those already in the table, before any other growth of the hash table size
++   occurs.  If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the
++   exact number of buckets desired.  */
++
++bool
++hash_rehash (Hash_table *table, unsigned candidate)
++{
++  Hash_table *new_table;
++  struct hash_entry *bucket;
++  struct hash_entry *cursor;
++  struct hash_entry *next;
++
++  new_table = hash_initialize (candidate, table->tuning, table->hasher,
++			       table->comparator, table->data_freer);
++  if (new_table == NULL)
++    return false;
++
++  /* Merely reuse the extra old space into the new table.  */
++#if USE_OBSTACK
++  obstack_free (&new_table->entry_stack, NULL);
++  new_table->entry_stack = table->entry_stack;
++#endif
++  new_table->free_entry_list = table->free_entry_list;
++
++  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++    if (bucket->data)
++      for (cursor = bucket; cursor; cursor = next)
++	{
++	  void *data = cursor->data;
++	  struct hash_entry *new_bucket
++	    = (new_table->bucket
++	       + new_table->hasher (data, new_table->n_buckets));
++
++	  if (! (new_bucket < new_table->bucket_limit))
++	    abort ();
++
++	  next = cursor->next;
++
++	  if (new_bucket->data)
++	    {
++	      if (cursor == bucket)
++		{
++		  /* Allocate or recycle an entry, when moving from a bucket
++		     header into a bucket overflow.  */
++		  struct hash_entry *new_entry = allocate_entry (new_table);
++
++		  if (new_entry == NULL)
++		    return false;
++
++		  new_entry->data = data;
++		  new_entry->next = new_bucket->next;
++		  new_bucket->next = new_entry;
++		}
++	      else
++		{
++		  /* Merely relink an existing entry, when moving from a
++		     bucket overflow into a bucket overflow.  */
++		  cursor->next = new_bucket->next;
++		  new_bucket->next = cursor;
++		}
++	    }
++	  else
++	    {
++	      /* Free an existing entry, when moving from a bucket
++		 overflow into a bucket header.  Also take care of the
++		 simple case of moving from a bucket header into a bucket
++		 header.  */
++	      new_bucket->data = data;
++	      new_table->n_buckets_used++;
++	      if (cursor != bucket)
++		free_entry (new_table, cursor);
++	    }
++	}
++
++  free (table->bucket);
++  table->bucket = new_table->bucket;
++  table->bucket_limit = new_table->bucket_limit;
++  table->n_buckets = new_table->n_buckets;
++  table->n_buckets_used = new_table->n_buckets_used;
++  table->free_entry_list = new_table->free_entry_list;
++  /* table->n_entries already holds its value.  */
++#if USE_OBSTACK
++  table->entry_stack = new_table->entry_stack;
++#endif
++  free (new_table);
++
++  return true;
++}
++
++/* If ENTRY matches an entry already in the hash table, return the pointer
++   to the entry from the table.  Otherwise, insert ENTRY and return ENTRY.
++   Return NULL if the storage required for insertion cannot be allocated.  */
++
++void *
++hash_insert (Hash_table *table, const void *entry)
++{
++  void *data;
++  struct hash_entry *bucket;
++
++  /* The caller cannot insert a NULL entry.  */
++  if (! entry)
++    abort ();
++
++  /* If there's a matching entry already in the table, return that.  */
++  if ((data = hash_find_entry (table, entry, &bucket, false)) != NULL)
++    return data;
++
++  /* ENTRY is not matched, it should be inserted.  */
++
++  if (bucket->data)
++    {
++      struct hash_entry *new_entry = allocate_entry (table);
++
++      if (new_entry == NULL)
++	return NULL;
++
++      /* Add ENTRY in the overflow of the bucket.  */
++
++      new_entry->data = (void *) entry;
++      new_entry->next = bucket->next;
++      bucket->next = new_entry;
++      table->n_entries++;
++      return (void *) entry;
++    }
++
++  /* Add ENTRY right in the bucket head.  */
++
++  bucket->data = (void *) entry;
++  table->n_entries++;
++  table->n_buckets_used++;
++
++  /* If the growth threshold of the buckets in use has been reached, increase
++     the table size and rehash.  There's no point in checking the number of
++     entries:  if the hashing function is ill-conditioned, rehashing is not
++     likely to improve it.  */
++
++  if (table->n_buckets_used
++      > table->tuning->growth_threshold * table->n_buckets)
++    {
++      /* Check more fully, before starting real work.  If tuning arguments
++	 became invalid, the second check will rely on proper defaults.  */
++      check_tuning (table);
++      if (table->n_buckets_used
++	  > table->tuning->growth_threshold * table->n_buckets)
++	{
++	  const Hash_tuning *tuning = table->tuning;
++	  unsigned candidate
++	    = (unsigned) (tuning->is_n_buckets
++			  ? (table->n_buckets * tuning->growth_factor)
++			  : (table->n_buckets * tuning->growth_factor
++			     * tuning->growth_threshold));
++
++	  /* If the rehash fails, arrange to return NULL.  */
++	  if (!hash_rehash (table, candidate))
++	    entry = NULL;
++	}
++    }
++
++  return (void *) entry;
++}
++
++/* If ENTRY is already in the table, remove it and return the just-deleted
++   data (the user may want to deallocate its storage).  If ENTRY is not in the
++   table, don't modify the table and return NULL.  */
++
++void *
++hash_delete (Hash_table *table, const void *entry)
++{
++  void *data;
++  struct hash_entry *bucket;
++
++  data = hash_find_entry (table, entry, &bucket, true);
++  if (!data)
++    return NULL;
++
++  table->n_entries--;
++  if (!bucket->data)
++    {
++      table->n_buckets_used--;
++
++      /* If the shrink threshold of the buckets in use has been reached,
++	 rehash into a smaller table.  */
++
++      if (table->n_buckets_used
++	  < table->tuning->shrink_threshold * table->n_buckets)
++	{
++	  /* Check more fully, before starting real work.  If tuning arguments
++	     became invalid, the second check will rely on proper defaults.  */
++	  check_tuning (table);
++	  if (table->n_buckets_used
++	      < table->tuning->shrink_threshold * table->n_buckets)
++	    {
++	      const Hash_tuning *tuning = table->tuning;
++	      unsigned candidate
++		= (unsigned) (tuning->is_n_buckets
++			      ? table->n_buckets * tuning->shrink_factor
++			      : (table->n_buckets * tuning->shrink_factor
++				 * tuning->growth_threshold));
++
++	      hash_rehash (table, candidate);
++	    }
++	}
++    }
++
++  return data;
++}
++
++/* Testing.  */
++
++#if TESTING
++
++void
++hash_print (const Hash_table *table)
++{
++  struct hash_entry *bucket;
++
++  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
++    {
++      struct hash_entry *cursor;
++
++      if (bucket)
++	printf ("%d:\n", bucket - table->bucket);
++
++      for (cursor = bucket; cursor; cursor = cursor->next)
++	{
++	  char *s = (char *) cursor->data;
++	  /* FIXME */
++	  if (s)
++	    printf ("  %s\n", s);
++	}
++    }
++}
++
++#endif /* TESTING */
+--- patch-2.5.9.orig/hash.h
++++ patch-2.5.9/hash.h
+@@ -0,0 +1,93 @@
++/* hash - hashing table processing.
++   Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
++   Written by Jim Meyering <meyering@ascend.com>, 1998.
++
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
++
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software Foundation,
++   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
++
++/* A generic hash table package.  */
++
++/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
++   obstacks instead of malloc, and recompile `hash.c' with same setting.  */
++
++#ifndef HASH_H_
++# define HASH_H_
++
++# ifndef PARAMS
++#  if PROTOTYPES || __STDC__
++#   define PARAMS(Args) Args
++#  else
++#   define PARAMS(Args) ()
++#  endif
++# endif
++
++typedef unsigned (*Hash_hasher) PARAMS ((const void *, unsigned));
++typedef bool (*Hash_comparator) PARAMS ((const void *, const void *));
++typedef void (*Hash_data_freer) PARAMS ((void *));
++typedef bool (*Hash_processor) PARAMS ((void *, void *));
++
++struct hash_entry
++  {
++    void *data;
++    struct hash_entry *next;
++  };
++
++struct hash_tuning
++  {
++    /* This structure is mainly used for `hash_initialize', see the block
++       documentation of `hash_reset_tuning' for more complete comments.  */
++
++    float shrink_threshold;	/* ratio of used buckets to trigger a shrink */
++    float shrink_factor;	/* ratio of new smaller size to original size */
++    float growth_threshold;	/* ratio of used buckets to trigger a growth */
++    float growth_factor;	/* ratio of new bigger size to original size */
++    bool is_n_buckets;		/* if CANDIDATE really means table size */
++  };
++
++typedef struct hash_tuning Hash_tuning;
++
++struct hash_table;
++
++typedef struct hash_table Hash_table;
++
++/* Information and lookup.  */
++unsigned hash_get_n_buckets PARAMS ((const Hash_table *));
++unsigned hash_get_n_buckets_used PARAMS ((const Hash_table *));
++unsigned hash_get_n_entries PARAMS ((const Hash_table *));
++unsigned hash_get_max_bucket_length PARAMS ((const Hash_table *));
++bool hash_table_ok PARAMS ((const Hash_table *));
++void hash_print_statistics PARAMS ((const Hash_table *, FILE *));
++void *hash_lookup PARAMS ((const Hash_table *, const void *));
++
++/* Walking.  */
++void *hash_get_first PARAMS ((const Hash_table *));
++void *hash_get_next PARAMS ((const Hash_table *, const void *));
++unsigned hash_get_entries PARAMS ((const Hash_table *, void **, unsigned));
++unsigned hash_do_for_each PARAMS ((const Hash_table *, Hash_processor, void *));
++
++/* Allocation and clean-up.  */
++unsigned hash_string PARAMS ((const char *, unsigned));
++void hash_reset_tuning PARAMS ((Hash_tuning *));
++Hash_table *hash_initialize PARAMS ((unsigned, const Hash_tuning *,
++				     Hash_hasher, Hash_comparator,
++				     Hash_data_freer));
++void hash_clear PARAMS ((Hash_table *));
++void hash_free PARAMS ((Hash_table *));
++
++/* Insertion and deletion.  */
++bool hash_rehash PARAMS ((Hash_table *, unsigned));
++void *hash_insert PARAMS ((Hash_table *, const void *));
++void *hash_delete PARAMS ((Hash_table *, const void *));
++
++#endif
diff --git a/meta/recipes-devtools/patch/patch/global-reject-file.diff b/meta/recipes-devtools/patch/patch/global-reject-file.diff
new file mode 100644
index 0000000..bb7ca79
--- /dev/null
+++ b/meta/recipes-devtools/patch/patch/global-reject-file.diff
@@ -0,0 +1,203 @@
+Upstream-Status: Inappropriate [debian patch]
+
+Index: patch-2.5.9/patch.man
+===================================================================
+--- patch-2.5.9.orig/patch.man
++++ patch-2.5.9/patch.man
+@@ -520,6 +520,15 @@ file.
+ \fB\*=reject\-unified\fP
+ Produce unified reject files. The default is to produce context type reject files.
+ .TP
++.BI \*=global\-reject\-file= rejectfile
++Put all rejects into
++.I rejectfile
++instead of creating separate reject files for all files that have rejects. The
++.I rejectfile
++will contain headers that identify which file each reject refers to. Note that
++the global reject file is created even if \-\-dry\-run is specified (while
++non-global reject files will only be created without \-\-dry\-run).
++.TP
+ \fB\-R\fP  or  \fB\*=reverse\fP
+ Assume that this patch was created with the old and new files swapped.
+ (Yes, I'm afraid that does happen occasionally, human nature being what it
+Index: patch-2.5.9/patch.c
+===================================================================
+--- patch-2.5.9.orig/patch.c
++++ patch-2.5.9/patch.c
+@@ -67,6 +67,7 @@ static bool similar (char const *, size_
+ static bool spew_output (struct outstate *);
+ static char const *make_temp (char);
+ static int numeric_string (char const *, bool, char const *);
++static void reject_header (const char *filename);
+ static void abort_hunk (void);
+ static void cleanup (void);
+ static void get_some_switches (void);
+@@ -98,6 +99,7 @@ static int Argc;
+ static char * const *Argv;
+ 
+ static FILE *rejfp;  /* reject file pointer */
++static char *global_reject;
+ 
+ static char const *patchname;
+ static char *rejname;
+@@ -172,6 +174,10 @@ main (int argc, char **argv)
+     /* Make sure we clean up in case of disaster.  */
+     set_signals (false);
+ 
++    /* initialize global reject file */
++    if (global_reject)
++      init_reject ();
++
+     for (
+ 	open_patch_file (patchname);
+ 	there_is_another_patch();
+@@ -208,8 +214,9 @@ main (int argc, char **argv)
+ 	    init_output (TMPOUTNAME, exclusive, &outstate);
+ 	  }
+ 
+-	/* initialize reject file */
+-	init_reject ();
++	/* initialize per-patch reject file */
++	if (!global_reject)
++	  init_reject ();
+ 
+ 	/* find out where all the lines are */
+ 	if (!skip_rest_of_patch)
+@@ -278,6 +285,8 @@ main (int argc, char **argv)
+ 
+ 	    newwhere = pch_newfirst() + last_offset;
+ 	    if (skip_rest_of_patch) {
++		if (!failed)
++		  reject_header(outname);
+ 		abort_hunk();
+ 		failed++;
+ 		if (verbosity == VERBOSE)
+@@ -292,6 +301,8 @@ main (int argc, char **argv)
+ 		  say ("Patch attempted to create file %s, which already exists.\n",
+ 		       quotearg (inname));
+ 
++		if (!failed)
++		  reject_header(outname);
+ 		abort_hunk();
+ 		failed++;
+ 		if (verbosity != SILENT)
+@@ -299,6 +310,8 @@ main (int argc, char **argv)
+ 		       format_linenum (numbuf, newwhere));
+ 	    }
+ 	    else if (! apply_hunk (&outstate, where)) {
++		if (!failed)
++		  reject_header(outname);
+ 		abort_hunk ();
+ 		failed++;
+ 		if (verbosity != SILENT)
+@@ -332,7 +345,8 @@ main (int argc, char **argv)
+ 		    fclose (outstate.ofp);
+ 		    outstate.ofp = 0;
+ 		  }
+-		fclose (rejfp);
++		if (!global_reject)
++		  fclose (rejfp);
+ 		continue;
+ 	      }
+ 
+@@ -412,13 +426,13 @@ main (int argc, char **argv)
+ 	    }
+       }
+       if (diff_type != ED_DIFF) {
+-	if (fclose (rejfp) != 0)
++	if (!global_reject && fclose (rejfp) != 0)
+ 	    write_fatal ();
+ 	if (failed) {
+ 	    somefailed = true;
+ 	    say ("%d out of %d hunk%s %s", failed, hunk, "s" + (hunk == 1),
+ 		 skip_rest_of_patch ? "ignored" : "FAILED");
+-	    if (outname) {
++	    if (!global_reject && outname) {
+ 		char *rej = rejname;
+ 		if (!rejname) {
+ 		    rej = xmalloc (strlen (outname) + 5);
+@@ -445,6 +459,20 @@ main (int argc, char **argv)
+       }
+       set_signals (true);
+     }
++    if (global_reject)
++      {
++	if (fclose (rejfp) != 0)
++	  write_fatal ();
++	if (somefailed)
++	  {
++	  say (" -- saving rejects to file %s\n", quotearg (global_reject));
++	  /*if (! dry_run)
++	    {*/
++	      move_file (TMPREJNAME, &TMPREJNAME_needs_removal,
++			 global_reject, 0644, false);
++	    /*}*/
++	  }
++      }
+     if (outstate.ofp && (ferror (outstate.ofp) || fclose (outstate.ofp) != 0))
+       write_fatal ();
+     cleanup ();
+@@ -523,6 +551,7 @@ static struct option const longopts[] =
+   {"posix", no_argument, NULL, CHAR_MAX + 7},
+   {"quoting-style", required_argument, NULL, CHAR_MAX + 8},
+   {"unified-reject-files", no_argument, NULL, CHAR_MAX + 9},
++  {"global-reject-file", required_argument, NULL, CHAR_MAX + 10},
+   {NULL, no_argument, NULL, 0}
+ };
+ 
+@@ -582,6 +611,7 @@ static char const *const option_help[] =
+ "  --dry-run  Do not actually change any files; just print what would happen.",
+ "  --posix  Conform to the POSIX standard.",
+ "  --unified-reject-files  Create unified reject files.",
++"  --global-reject-file=file  Put all rejects into one file.",
+ "",
+ "  -d DIR  --directory=DIR  Change the working directory to DIR first.",
+ #if HAVE_SETMODE_DOS
+@@ -784,6 +814,9 @@ get_some_switches (void)
+ 	    case CHAR_MAX + 9:
+ 		unified_reject_files = true;
+ 		break;
++	    case CHAR_MAX + 10:
++		global_reject = savestr (optarg);
++		break;
+ 	    default:
+ 		usage (stderr, 2);
+ 	}
+@@ -933,6 +966,37 @@ locate_hunk (LINENUM fuzz)
+ }
+ 
+ static char *
++format_timestamp (char timebuf[37], bool which)
++{
++  time_t ts = pch_timestamp(which);
++  if (ts != -1)
++    {
++      struct tm *tm = localtime(&ts);
++      strftime(timebuf, 37, "\t%Y-%m-%d %H:%M:%S.000000000 %z", tm);
++    }
++  else
++    timebuf[0] = 0;
++  return timebuf;
++}
++
++/* Write a header in a reject file that combines multiple hunks. */
++static void
++reject_header (const char *outname)
++{
++    char timebuf0[37], timebuf1[37];
++    if (!global_reject)
++      return;
++    if (diff_type == UNI_DIFF)
++	fprintf(rejfp, "--- %s.orig%s\n+++ %s%s\n",
++		outname, format_timestamp(timebuf0, reverse),
++		outname, format_timestamp(timebuf1, !reverse));
++    else
++	fprintf(rejfp, "*** %s.orig%s\n--- %s%s\n",
++		outname, format_timestamp(timebuf0, reverse),
++		outname, format_timestamp(timebuf1, !reverse));
++}
++
++static char *
+ format_linerange (char rangebuf[LINENUM_LENGTH_BOUND*2 + 2],
+ 		  LINENUM first, LINENUM lines)
+ {
diff --git a/meta/recipes-devtools/patch/patch/install.patch b/meta/recipes-devtools/patch/patch/install.patch
new file mode 100644
index 0000000..0354ec8
--- /dev/null
+++ b/meta/recipes-devtools/patch/patch/install.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: patch-2.5.4/Makefile.in
+===================================================================
+--- patch-2.5.4.orig/Makefile.in	2005-03-09 07:23:54.779311824 -0500
++++ patch-2.5.4/Makefile.in	2005-03-09 07:26:09.616813408 -0500
+@@ -43,10 +43,11 @@
+ PACKAGE_NAME = @PACKAGE_NAME@
+ PACKAGE_VERSION = @PACKAGE_VERSION@
+ 
++DESTDIR =
+ prefix = @prefix@
+ exec_prefix = @exec_prefix@
+ 
+-bindir = $(exec_prefix)/bin
++bindir = @bindir@
+ 
+ # Where to put the manual pages.
+ mandir = @mandir@
+@@ -112,18 +113,18 @@
+ 	$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS)
+ 
+ install:: all installdirs
+-	$(INSTALL_PROGRAM) patch$(EXEEXT) $(bindir)/$(patch_name)$(EXEEXT)
+-	-$(INSTALL_DATA) $(srcdir)/patch.man $(man1dir)/$(patch_name)$(man1ext)
++	$(INSTALL_PROGRAM) patch$(EXEEXT) $(DESTDIR)$(bindir)/$(patch_name)$(EXEEXT)
++	-$(INSTALL_DATA) $(srcdir)/patch.man $(DESTDIR)$(man1dir)/$(patch_name)$(man1ext)
+ 
+ installdirs::
+-	$(SHELL) $(srcdir)/mkinstalldirs $(bindir) $(man1dir)
++	$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
+ 
+ install-strip::
+ 	$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' install
+ 
+ uninstall::
+-	rm -f $(bindir)/$(patch_name)$(EXEEXT)
+-	rm -f $(man1dir)/$(patch_name)$(man1ext)
++	rm -f $(DESTDIR)$(bindir)/$(patch_name)$(EXEEXT)
++	rm -f $(DESTDIR)$(man1dir)/$(patch_name)$(man1ext)
+ 
+ Makefile: Makefile.in $(CONFIG_STATUS)
+ 	$(SHELL) $(CONFIG_STATUS)
diff --git a/meta/recipes-devtools/patch/patch/unified-reject-files.diff b/meta/recipes-devtools/patch/patch/unified-reject-files.diff
new file mode 100644
index 0000000..4b59212
--- /dev/null
+++ b/meta/recipes-devtools/patch/patch/unified-reject-files.diff
@@ -0,0 +1,307 @@
+Upstream-Status: Inappropriate [debian patch]
+
+Generate unified diff style reject files. Also include the C function names
+in reject files whenever possible.
+
+	$ cat > f.orig
+	< a() {
+	< 2
+	< 3
+	<
+	< 5
+	< 6
+	< }
+
+	$ sed -e 's/5/5a/' f.orig > f
+	$ diff -U2 -p f.orig f > f.diff
+	$ sed -e 's/5/5a/' -e 's/6/6x/' f.orig > f
+	$ ./patch -F0 -s --no-backup-if-mismatch f --reject-unified < f.diff
+	> 1 out of 1 hunk FAILED -- saving rejects to file f.rej
+
+	$ cat f.rej
+	> @@ -3,5 +3,5 @@ a() {
+	>  3
+	>  
+	> -5
+	> +5a
+	>  6
+	>  }
+
+	$ ./patch -F0 -s --no-backup-if-mismatch f < f.diff
+	> 1 out of 1 hunk FAILED -- saving rejects to file f.rej
+
+	$ cat f.rej
+	> *************** a() {
+	> *** 3,7 ****
+	>   3
+	>   
+	> - 5
+	>   6
+	>   }
+	> --- 3,7 ----
+	>   3
+	>   
+	> + 5a
+	>   6
+	>   }
+
+	$ diff -Nu -p /dev/null f.orig > f2.diff
+	$ ./patch -F0 -s --no-backup-if-mismatch f --reject-unified < f2.diff
+	> Patch attempted to create file f, which already exists.
+	> 1 out of 1 hunk FAILED -- saving rejects to file f.rej
+
+	$ cat f.rej
+	> @@ -0,0 +1,7 @@
+	> +a() {
+	> +2
+	> +3
+	> +
+	> +5
+	> +6
+	> +}
+
+	$ rm -f f f.orig f.rej f.diff f2.diff
+
+Index: patch-2.5.9/pch.c
+===================================================================
+--- patch-2.5.9.orig/pch.c
++++ patch-2.5.9/pch.c
+@@ -68,6 +68,7 @@ static LINENUM p_sline;			/* and the lin
+ static LINENUM p_hunk_beg;		/* line number of current hunk */
+ static LINENUM p_efake = -1;		/* end of faked up lines--don't free */
+ static LINENUM p_bfake = -1;		/* beg of faked up lines */
++static char *p_c_function;		/* the C function a hunk is in */
+ 
+ enum nametype { OLD, NEW, INDEX, NONE };
+ 
+@@ -888,6 +889,19 @@ another_hunk (enum diff difftype, bool r
+ 	    next_intuit_at(line_beginning,p_input_line);
+ 	    return chars_read == (size_t) -1 ? -1 : 0;
+ 	}
++	s = buf;
++	while (*s == '*')
++	    s++;
++	if (*s == ' ')
++	  {
++	    p_c_function = s;
++	    while (*s != '\n')
++		s++;
++	    *s = '\0';
++	    p_c_function = savestr (p_c_function);
++	  }
++	else
++	    p_c_function = NULL;
+ 	p_hunk_beg = p_input_line + 1;
+ 	while (p_end < p_max) {
+ 	    chars_read = get_line ();
+@@ -1277,8 +1291,18 @@ another_hunk (enum diff difftype, bool r
+ 	else
+ 	    p_repl_lines = 1;
+ 	if (*s == ' ') s++;
+-	if (*s != '@')
++	if (*s++ != '@')
+ 	    malformed ();
++	if (*s++ == '@' && *s == ' ' && *s != '\0')
++	  {
++	    p_c_function = s;
++	    while (*s != '\n')
++		s++;
++	    *s = '\0';
++	    p_c_function = savestr (p_c_function);
++	  }
++	else
++	    p_c_function = NULL;
+ 	if (!p_ptrn_lines)
+ 	    p_first++;			/* do append rather than insert */
+ 	if (!p_repl_lines)
+@@ -1884,6 +1908,12 @@ pch_hunk_beg (void)
+     return p_hunk_beg;
+ }
+ 
++char const *
++pch_c_function (void)
++{
++    return p_c_function;
++}
++
+ /* Is the newline-terminated line a valid `ed' command for patch
+    input?  If so, return the command character; if not, return 0.
+    This accepts accepts just a subset of the valid commands, but it's
+Index: patch-2.5.9/pch.h
+===================================================================
+--- patch-2.5.9.orig/pch.h
++++ patch-2.5.9/pch.h
+@@ -25,6 +25,7 @@
+ LINENUM pch_end (void);
+ LINENUM pch_first (void);
+ LINENUM pch_hunk_beg (void);
++char const *pch_c_function (void);
+ LINENUM pch_newfirst (void);
+ LINENUM pch_prefix_context (void);
+ LINENUM pch_ptrn_lines (void);
+Index: patch-2.5.9/patch.man
+===================================================================
+--- patch-2.5.9.orig/patch.man
++++ patch-2.5.9/patch.man
+@@ -517,6 +517,9 @@ instead of the default
+ .B \&.rej
+ file.
+ .TP
++\fB\*=reject\-unified\fP
++Produce unified reject files. The default is to produce context type reject files.
++.TP
+ \fB\-R\fP  or  \fB\*=reverse\fP
+ Assume that this patch was created with the old and new files swapped.
+ (Yes, I'm afraid that does happen occasionally, human nature being what it
+Index: patch-2.5.9/common.h
+===================================================================
+--- patch-2.5.9.orig/common.h
++++ patch-2.5.9/common.h
+@@ -146,6 +146,7 @@ XTERN int invc;
+ XTERN struct stat instat;
+ XTERN bool dry_run;
+ XTERN bool posixly_correct;
++XTERN bool unified_reject_files;
+ 
+ XTERN char const *origprae;
+ XTERN char const *origbase;
+Index: patch-2.5.9/patch.c
+===================================================================
+--- patch-2.5.9.orig/patch.c
++++ patch-2.5.9/patch.c
+@@ -522,6 +522,7 @@ static struct option const longopts[] =
+   {"no-backup-if-mismatch", no_argument, NULL, CHAR_MAX + 6},
+   {"posix", no_argument, NULL, CHAR_MAX + 7},
+   {"quoting-style", required_argument, NULL, CHAR_MAX + 8},
++  {"unified-reject-files", no_argument, NULL, CHAR_MAX + 9},
+   {NULL, no_argument, NULL, 0}
+ };
+ 
+@@ -580,6 +581,7 @@ static char const *const option_help[] =
+ "  --verbose  Output extra information about the work being done.",
+ "  --dry-run  Do not actually change any files; just print what would happen.",
+ "  --posix  Conform to the POSIX standard.",
++"  --unified-reject-files  Create unified reject files.",
+ "",
+ "  -d DIR  --directory=DIR  Change the working directory to DIR first.",
+ #if HAVE_SETMODE_DOS
+@@ -779,6 +781,9 @@ get_some_switches (void)
+ 				     (enum quoting_style) i);
+ 		}
+ 		break;
++	    case CHAR_MAX + 9:
++		unified_reject_files = true;
++		break;
+ 	    default:
+ 		usage (stderr, 2);
+ 	}
+@@ -927,6 +932,24 @@ locate_hunk (LINENUM fuzz)
+     return 0;
+ }
+ 
++static char *
++format_linerange (char rangebuf[LINENUM_LENGTH_BOUND*2 + 2],
++		  LINENUM first, LINENUM lines)
++{
++    if (lines == 1)
++      rangebuf = format_linenum (rangebuf, first);
++    else
++      {
++	char *rb;
++	rangebuf = format_linenum (rangebuf + LINENUM_LENGTH_BOUND + 1, lines);
++	rb = rangebuf-1;
++	rangebuf = format_linenum (rangebuf - LINENUM_LENGTH_BOUND - 1,
++				   (lines > 0) ? first : 0);
++	*rb = ',';
++      }
++    return rangebuf;
++}
++
+ /* We did not find the pattern, dump out the hunk so they can handle it. */
+ 
+ static void
+@@ -943,8 +966,83 @@ abort_hunk (void)
+       (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ****" : "";
+     char const *minuses =
+       (int) NEW_CONTEXT_DIFF <= (int) diff_type ? " ----" : " -----";
++    char const *function = pch_c_function();
++    if (function == NULL)
++	function = "";
++
++    if (unified_reject_files)
++      {
++	/* produce unified reject files */
++	char rangebuf0[LINENUM_LENGTH_BOUND*2 + 2];
++	char rangebuf1[LINENUM_LENGTH_BOUND*2 + 2];
++	LINENUM j;
++
++	/* Find the beginning of the remove and insert section. */
++	for (j = 0; j <= pat_end; j++)
++	  if (pch_char (j) == '=')
++	    break;
++	for (i = j+1; i <= pat_end; i++)
++	  if (pch_char (i) == '^')
++	    break;
++	if (pch_char (0) != '*' || j > pat_end || i > pat_end+1)
++	  fatal ("internal error in abort_hunk");
++	i = 1; j++;
++
++	/* @@ -from,lines +to,lines @@ */
++	fprintf (rejfp, "@@ -%s +%s @@%s\n",
++		 format_linerange (rangebuf0, oldfirst, pch_ptrn_lines()),
++		 format_linerange (rangebuf1, newfirst, pch_repl_lines()),
++		 function);
++
++	while (   (i <= pat_end && pch_char (i) != '=')
++	       || (j <= pat_end && pch_char (j) != '^'))
++	  {
++	    if (i <= pat_end
++		&& (pch_char (i) == '-' || pch_char (i) == '!'))
++	      {
++		fputc('-', rejfp);
++		pch_write_line (i++, rejfp);
++	      }
++	    else if (j <= pat_end
++		     && (pch_char (j) == '+' || pch_char (j) == '!'))
++	      {
++		fputc('+', rejfp);
++		pch_write_line (j++, rejfp);
++	      }
++	    else if ((i <= pat_end
++		      && (pch_char (i) == ' ' || pch_char (i) == '\n')) &&
++		     (j > pat_end
++		      || (pch_char (j) == ' ' || pch_char (j) == '\n')))
++	      {
++		/* Unless j is already past the end, lines i and j
++		   must be equal here.  */
++
++		if (pch_char (i) == ' ')
++		  fputc(' ', rejfp);
++		pch_write_line (i++, rejfp);
++		if (j <= pat_end)
++		  j++;
++	      }
++	    else if ((j <= pat_end &&
++		     (pch_char (j) == ' ' || pch_char (j) == '\n')) &&
++		     (pch_char (i) == '='))
++	      {
++		if (pch_char (j) == ' ')
++		  fputc(' ', rejfp);
++		pch_write_line (j++, rejfp);
++	      }
++	    else
++	      fatal ("internal error in abort_hunk");
++	  }
++
++	if (ferror (rejfp))
++	  write_fatal ();
++	return;
++      }
+ 
+-    fprintf(rejfp, "***************\n");
++    /* produce context type reject files */
++   
++    fprintf(rejfp, "***************%s\n", function);
+     for (i=0; i<=pat_end; i++) {
+ 	char numbuf0[LINENUM_LENGTH_BOUND + 1];
+ 	char numbuf1[LINENUM_LENGTH_BOUND + 1];
diff --git a/meta/recipes-devtools/patch/patch_2.5.9.bb b/meta/recipes-devtools/patch/patch_2.5.9.bb
new file mode 100644
index 0000000..c29b240
--- /dev/null
+++ b/meta/recipes-devtools/patch/patch_2.5.9.bb
@@ -0,0 +1,12 @@
+require patch.inc
+LICENSE = "GPLv2"
+
+SRC_URI += " file://debian.patch \
+	   file://install.patch \
+           file://unified-reject-files.diff \
+           file://global-reject-file.diff "
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+SRC_URI[md5sum] = "dacfb618082f8d3a2194601193cf8716"
+SRC_URI[sha256sum] = "ecb5c6469d732bcf01d6ec1afe9e64f1668caba5bfdb103c28d7f537ba3cdb8a"
diff --git a/meta/recipes-devtools/patch/patch_2.7.5.bb b/meta/recipes-devtools/patch/patch_2.7.5.bb
new file mode 100644
index 0000000..f3fcf5e
--- /dev/null
+++ b/meta/recipes-devtools/patch/patch_2.7.5.bb
@@ -0,0 +1,15 @@
+require patch.inc
+LICENSE = "GPLv3"
+
+SRC_URI += "file://0001-Unset-need_charset_alias-when-building-for-musl.patch"
+
+SRC_URI[md5sum] = "ed4d5674ef4543b4eb463db168886dc7"
+SRC_URI[sha256sum] = "7436f5a19f93c3ca83153ce9c5cbe4847e97c5d956e57a220121e741f6e7968f"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+acpaths = "-I ${S}/m4 "
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)}"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+
diff --git a/meta/recipes-devtools/patchelf/patchelf_0.8.bb b/meta/recipes-devtools/patchelf/patchelf_0.8.bb
new file mode 100644
index 0000000..c1b87f5
--- /dev/null
+++ b/meta/recipes-devtools/patchelf/patchelf_0.8.bb
@@ -0,0 +1,12 @@
+SRC_URI = "http://nixos.org/releases/${BPN}/${BPN}-${PV}/${BPN}-${PV}.tar.bz2"
+LICENSE = "GPLv3"
+SUMMARY = "Tool to allow editing of RPATH and interpreter fields in ELF binaries"
+
+SRC_URI[md5sum] = "5b151e3c83b31f5931b4a9fc01635bfd"
+SRC_URI[sha256sum] = "c99f84d124347340c36707089ec8f70530abd56e7827c54d506eb4cc097a17e7"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+inherit autotools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/pax-utils/pax-utils_1.0.5.bb b/meta/recipes-devtools/pax-utils/pax-utils_1.0.5.bb
new file mode 100644
index 0000000..0716a08
--- /dev/null
+++ b/meta/recipes-devtools/pax-utils/pax-utils_1.0.5.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Security-focused ELF files checking tool"
+DESCRIPTION = "This is a small set of various PaX aware and related \
+utilities for ELF binaries. It can check ELF binary files and running \
+processes for issues that might be relevant when using ELF binaries \
+along with PaX, such as non-PIC code or executable stack and heap."
+HOMEPAGE = "http://www.gentoo.org/proj/en/hardened/pax-utils.xml"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+
+SRC_URI = "http://gentoo.osuosl.org/distfiles/pax-utils-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "d731f5385682a7a62ee2e7b7dacc13a7"
+SRC_URI[sha256sum] = "f69a9938e4af7912d26d585094bc0203e43571a990fdd048319088a8b8ad906f"
+
+RDEPENDS_${PN} += "bash python"
+
+do_install() {
+    oe_runmake PREFIX=${D}${prefix} DESTDIR=${D} install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/perl/liberror-perl_0.17024.bb b/meta/recipes-devtools/perl/liberror-perl_0.17024.bb
new file mode 100644
index 0000000..6ae0e7e
--- /dev/null
+++ b/meta/recipes-devtools/perl/liberror-perl_0.17024.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Error - Error/exception handling in an OO-ish way"
+DESCRIPTION = "The Error package provides two interfaces. Firstly \
+Error provides a procedural interface to exception handling. \
+Secondly Error is a base class for errors/exceptions that can \
+either be thrown, for subsequent catch, or can simply be recorded."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8f3499d09ee74a050c0319391ff9d100"
+
+DEPENDS += "perl"
+
+SRC_URI = "http://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/Error-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "7e3676a7fb14f65f568f12d4b40a2a72"
+SRC_URI[sha256sum] = "074db7c783a67b0667eca64a4f6a0c3de94998afc92c01d6453163eb04b9150d"
+
+S = "${WORKDIR}/Error-${PV}"
+
+inherit cpan
+
+do_compile() {
+	export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+	cpan_do_compile
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/perl/liburi-perl_1.60.bb b/meta/recipes-devtools/perl/liburi-perl_1.60.bb
new file mode 100644
index 0000000..8809a44
--- /dev/null
+++ b/meta/recipes-devtools/perl/liburi-perl_1.60.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Perl module to manipulate and access URI strings"
+DESCRIPTION = "This package contains the URI.pm module with friends. \
+The module implements the URI class. URI objects can be used to access \
+and manipulate the various components that make up these strings."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://README;beginline=26;endline=30;md5=6c33ae5c87fd1c4897714e122dd9c23d"
+
+DEPENDS += "perl"
+
+SRC_URI = "http://www.cpan.org/authors/id/G/GA/GAAS/URI-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "70f739be8ce28b8baba7c5920ffee4dc"
+SRC_URI[sha256sum] = "1f92d3dc64acb8845e9917c945e22b9a5275aeb9ff924eb7873c3b7a5c0d2377"
+
+S = "${WORKDIR}/URI-${PV}"
+
+EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR}"
+
+inherit cpan
+
+do_compile() {
+	export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+	cpan_do_compile
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb b/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
new file mode 100644
index 0000000..9ccd417
--- /dev/null
+++ b/meta/recipes-devtools/perl/libxml-parser-perl_2.44.bb
@@ -0,0 +1,37 @@
+SUMMARY = "XML::Parser - A perl module for parsing XML documents"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README;beginline=2;endline=6;md5=c8767d7516229f07b26e42d1cf8b51f1"
+
+DEPENDS += "expat expat-native"
+
+SRC_URI = "http://www.cpan.org/modules/by-module/XML/XML-Parser-${PV}.tar.gz"
+SRC_URI[md5sum] = "af4813fe3952362451201ced6fbce379"
+SRC_URI[sha256sum] = "1ae9d07ee9c35326b3d9aad56eae71a6730a73a116b9fe9e8a4758b7cc033216"
+
+S = "${WORKDIR}/XML-Parser-${PV}"
+
+EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR} CC='${CC}' LD='${CCLD}' FULL_AR='${AR}'"
+
+inherit cpan
+
+# fix up sub MakeMaker project as arguments don't get propagated though
+# see https://rt.cpan.org/Public/Bug/Display.html?id=28632
+do_configure_append() {
+	sed 's:--sysroot=.*\(\s\|$\):--sysroot=${STAGING_DIR_TARGET} :g' -i Makefile Expat/Makefile
+	sed 's:^FULL_AR = .*:FULL_AR = ${AR}:g' -i Expat/Makefile
+}
+
+do_compile() {
+	export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+	cpan_do_compile
+}
+
+do_compile_class-native() {
+	cpan_do_compile
+}
+
+FILES_${PN}-dbg += "${libdir}/perl/vendor_perl/*/auto/XML/Parser/Expat/.debug/"
+
+BBCLASSEXTEND="native"
+
diff --git a/meta/recipes-devtools/perl/libxml-perl_0.08.bb b/meta/recipes-devtools/perl/libxml-perl_0.08.bb
new file mode 100644
index 0000000..2c01976
--- /dev/null
+++ b/meta/recipes-devtools/perl/libxml-perl_0.08.bb
@@ -0,0 +1,27 @@
+DESCRIPTION = "libxml-perl is a collection of smaller Perl modules, scripts, and \
+documents for working with XML in Perl.  libxml-perl software \
+works in combination with XML::Parser, PerlSAX, XML::DOM, \
+XML::Grove and others."
+SUMMARY = "Collection of Perl modules for working with XML"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://README;beginline=33;endline=35;md5=1705549eef7577a3d6ba71123a1f0ce8"
+
+DEPENDS += "libxml-parser-perl"
+
+SRC_URI = "http://www.cpan.org/modules/by-module/XML/${BPN}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "0ed5fbdda53d1301ddaed88db10503bb"
+SRC_URI[sha256sum] = "4571059b7b5d48b7ce52b01389e95d798bf5cf2020523c153ff27b498153c9cb"
+
+EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR}"
+
+inherit cpan
+
+do_compile() {
+	export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+	cpan_do_compile
+}
+
diff --git a/meta/recipes-devtools/perl/libxml-simple-perl_2.20.bb b/meta/recipes-devtools/perl/libxml-simple-perl_2.20.bb
new file mode 100644
index 0000000..4721b4b
--- /dev/null
+++ b/meta/recipes-devtools/perl/libxml-simple-perl_2.20.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Perl module for reading and writing XML"
+DESCRIPTION = "The XML::Simple Perl module provides a simple API layer \
+on top of an underlying XML parsing module to maintain XML files \
+(especially configuration files). It is a blunt rewrite of XML::Simple \
+(by Grant McLean) to use the XML::LibXML parser for XML structures, \
+where the original uses plain Perl or SAX parsers."
+HOMEPAGE = "http://search.cpan.org/~markov/XML-LibXML-Simple-0.93/lib/XML/LibXML/Simple.pod"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e7dbb3e2241fac8457967053fc1a1ddb"
+DEPENDS += "libxml-parser-perl"
+
+SRC_URI = "http://www.cpan.org/modules/by-module/XML/XML-Simple-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "4d10964e123b76eca36678464daa63cd"
+SRC_URI[sha256sum] = "5cff13d0802792da1eb45895ce1be461903d98ec97c9c953bc8406af7294434a"
+
+S = "${WORKDIR}/XML-Simple-${PV}"
+
+EXTRA_PERLFLAGS = "-I ${PERLHOSTLIB}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/perl/perl-native_5.22.0.bb b/meta/recipes-devtools/perl/perl-native_5.22.0.bb
new file mode 100644
index 0000000..a9a1cab
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-native_5.22.0.bb
@@ -0,0 +1,123 @@
+require perl.inc
+
+SRC_URI += "\
+           file://Configure-multilib.patch \
+           file://perl-configpm-switch.patch \
+           file://native-nopacklist.patch \
+           file://native-perlinc.patch \
+           file://MM_Unix.pm.patch \
+           file://debian/errno_ver.diff \
+           file://dynaloaderhack.patch \
+           file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
+          "
+
+SRC_URI[md5sum] = "ff0f09b17de426eff323426cb140ee79"
+SRC_URI[sha256sum] = "be83ead0c5c26cbbe626fa4bac1a4beabe23a9eebc15d35ba49ccde11878e196"
+
+inherit native
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+export LD="${CCLD}"
+
+do_configure () {
+	./Configure \
+		-Dcc="${CC}" \
+		-Dcflags="${CFLAGS}" \
+		-Dldflags="${LDFLAGS}" \
+		-Dcf_by="Open Embedded" \
+		-Dprefix=${prefix} \
+		-Dvendorprefix=${prefix} \
+		-Dvendorprefix=${prefix} \
+		-Dsiteprefix=${prefix} \
+		\
+		-Dbin=${STAGING_BINDIR}/${PN} \
+		-Dprivlib=${STAGING_LIBDIR}/perl/${PV} \
+		-Darchlib=${STAGING_LIBDIR}/perl/${PV} \
+		-Dvendorlib=${STAGING_LIBDIR}/perl/${PV} \
+		-Dvendorarch=${STAGING_LIBDIR}/perl/${PV} \
+		-Dsitelib=${STAGING_LIBDIR}/perl/${PV} \
+		-Dsitearch=${STAGING_LIBDIR}/perl/${PV} \
+		\
+		-Duseshrplib \
+		-Dusethreads \
+		-Duseithreads \
+		-Duselargefiles \
+		-Dnoextensions=ODBM_File \
+		-Ud_dosuid \
+		-Ui_db \
+		-Ui_ndbm \
+		-Ui_gdbm \
+		-Ui_gdbm_ndbm \
+		-Ui_gdbmndbm \
+		-Di_shadow \
+		-Di_syslog \
+		-Duseperlio \
+		-Dman3ext=3pm \
+		-Dsed=/bin/sed \
+		-Uafs \
+		-Ud_csh \
+		-Uusesfio \
+		-Uusenm -des
+}
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' install
+
+	# We need a hostperl link for building perl
+	ln -sf perl${PV} ${D}${bindir}/hostperl
+
+        ln -sf perl ${D}${libdir}/perl5
+
+	install -d ${D}${libdir}/perl/${PV}/CORE \
+	           ${D}${datadir}/perl/${PV}/ExtUtils
+
+	# Save native config 
+	install config.sh ${D}${libdir}/perl
+	install lib/Config.pm ${D}${libdir}/perl/${PV}/
+	install lib/ExtUtils/typemap ${D}${libdir}/perl/${PV}/ExtUtils/
+
+	# perl shared library headers
+	# reference perl 5.20.0-1 in debian:
+	# https://packages.debian.org/experimental/i386/perl/filelist
+	for i in av.h bitcount.h charclass_invlists.h config.h cop.h cv.h dosish.h \
+		embed.h embedvar.h EXTERN.h fakesdio.h feature.h form.h git_version.h \
+		gv.h handy.h hv_func.h hv.h inline.h INTERN.h intrpvar.h iperlsys.h \
+		keywords.h l1_char_class_tab.h malloc_ctl.h metaconfig.h mg_data.h \
+		mg.h mg_raw.h mg_vtable.h mydtrace.h nostdio.h opcode.h op.h \
+		opnames.h op_reg_common.h overload.h pad.h parser.h patchlevel.h \
+		perlapi.h perl.h perlio.h perliol.h perlsdio.h perlvars.h perly.h \
+		pp.h pp_proto.h proto.h reentr.h regcharclass.h regcomp.h regexp.h \
+		regnodes.h scope.h sv.h thread.h time64_config.h time64.h uconfig.h \
+		unicode_constants.h unixish.h utf8.h utfebcdic.h util.h uudmap.h \
+		vutil.h warnings.h XSUB.h
+	do
+		install $i ${D}${libdir}/perl/${PV}/CORE
+	done
+
+	create_wrapper ${D}${bindir}/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl:${STAGING_LIBDIR}/perl/site_perl/${PV}:${STAGING_LIBDIR}/perl/vendor_perl/${PV}'
+	create_wrapper ${D}${bindir}/perl${PV} PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl/${PV}:${STAGING_LIBDIR}/perl${STAGING_LIBDIR}/perl:${STAGING_LIBDIR}/perl/site_perl/${PV}:${STAGING_LIBDIR}/perl/vendor_perl/${PV}'
+
+	# Use /usr/bin/env nativeperl for the perl script.
+	for f in `grep -Il '#! *${bindir}/perl' ${D}/${bindir}/*`; do
+		sed -i -e 's|${bindir}/perl|/usr/bin/env nativeperl|' $f
+	done
+}
+
+SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper"
+
+perl_sysroot_create_wrapper () {
+	mkdir -p ${SYSROOT_DESTDIR}${bindir}
+	# Create a wrapper that /usr/bin/env perl will use to get perl-native.
+	# This MUST live in the normal bindir.
+	cat > ${SYSROOT_DESTDIR}${bindir}/../nativeperl << EOF
+#!/bin/sh
+realpath=\`readlink -fn \$0\`
+exec \`dirname \$realpath\`/perl-native/perl "\$@"
+EOF
+	chmod 0755 ${SYSROOT_DESTDIR}${bindir}/../nativeperl
+	cat ${SYSROOT_DESTDIR}${bindir}/../nativeperl
+}
+
+# Fix the path in sstate
+SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
diff --git a/meta/recipes-devtools/perl/perl-ptest.inc b/meta/recipes-devtools/perl/perl-ptest.inc
new file mode 100644
index 0000000..948ea7c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-ptest.inc
@@ -0,0 +1,37 @@
+inherit ptest
+
+SRC_URI += "file://run-ptest \
+           "
+
+do_install_ptest () {
+	mkdir -p ${D}${PTEST_PATH}
+	sed -e "s:\/opt:\/usr:" -i Porting/add-package.pl
+	sed -e "s:\/local\/gnu\/:\/:" -i hints/cxux.sh
+	tar -cf - * --exclude \*.o --exclude libperl.so --exclude Makefile --exclude makefile --exclude hostperl \
+		--exclude miniperl --exclude generate_uudmap --exclude patches | ( cd ${D}${PTEST_PATH} && tar -xf - )
+
+	sed -i -e "s,${D},,g" \
+	       -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
+	       -e "s,-isystem${STAGING_INCDIR} ,,g" \
+	       -e "s,${STAGING_LIBDIR},${libdir},g" \
+	       -e "s,${STAGING_BINDIR},${bindir},g" \
+	       -e "s,${STAGING_INCDIR},${includedir},g" \
+	       -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
+	       -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
+	       -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
+	    ${D}${PTEST_PATH}/lib/Config.pm
+
+	ln -sf ${bindir}/perl ${D}${PTEST_PATH}/t/perl
+
+}
+
+python populate_packages_prepend() {
+    # Put all *.t files from the lib dir in the ptest package
+    # do_split_packages requires a pair of () in the regex, but we have nothing
+    # to match, so use an empty pair.
+    if bb.utils.contains('DISTRO_FEATURES', 'ptest', True, False, d):
+        do_split_packages(d, d.expand('${libdir}/perl/${PV}'), '.*\.t()',
+            '${PN}-ptest%s', '%s', recursive=True, match_path=True)
+}
+
+RDEPENDS_${PN}-ptest += "${PN}-modules ${PN}-doc ${PN}-misc sed"
diff --git a/meta/recipes-devtools/perl/perl-rdepends_5.22.0.inc b/meta/recipes-devtools/perl/perl-rdepends_5.22.0.inc
new file mode 100644
index 0000000..7f886f3
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl-rdepends_5.22.0.inc
@@ -0,0 +1,2567 @@
+# To create/update the perl-rdepends_${PV}.inc use this piece of ugly script (modified for your arch/paths etc):
+
+#jiahongxu:5.20.0-r1$ pwd
+#/home/jiahongxu/yocto/build-20140618-perl/tmp/work/i586-poky-linux/perl/5.20.0-r1
+
+#1 cp -r packages-split packages-split.new && cd packages-split.new
+#2 find . -name \*.pm | xargs sed -i '/^=head/,/^=cut/d'
+#3 egrep -r "^\s*(\<use .*|\<require .*);?" perl-module-* --include="*.pm" 
+#| sed "s/\/.*\.pm: */ += /g;s/[\"\']//g;s/;.*/\"/g;s/+= .*\(require\|use\)\> */+= \"perl-module-/g;s/CPANPLUS::.*/cpanplus/g;s/CPAN::.*/cpan/g;s/::/-/g;s/ [^+\"].*//g;s/_/-/g;s/\.pl\"$/\"/;s/\"\?\$/\"/;s/(//;" | tr [:upper:] [:lower:] 
+#| grep -v -e "\-vms\-" -e module-5 -e "^$" -e "\\$" -e your -e tk -e autoperl -e html -e http -e parse-cpan -e perl-ostype -e ndbm-file -e module-mac -e fcgi -e lwp -e dbd -e dbix 
+#| sort -u 
+#| sed 's/^/RDEPENDS_/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;' 
+#| egrep -wv '=>|module-a|module-apache.?|module-apr|module-authen-sasl|module-b-asmdata|module-convert-ebcdic|module-devel-size|module-digest-perl-md5|module-dumpvalue|module-extutils-constant-aaargh56hash|module-extutils-xssymset|module-file-bsdglob|module-for|module-it|module-io-string|module-ipc-system-simple|module-lexical|module-local-lib|metadata|module-modperl-util|module-pluggable-object|module-test-builder-io-scalar|module-text-unidecode|module-win32|objects\sload|syscall.ph|systeminfo.ph|%s' > /tmp/perl-rdepends
+
+RDEPENDS_perl-misc += "perl"
+RDEPENDS_${PN}-pod += "perl"
+
+# Some additional dependencies that the above doesn't manage to figure out
+RDEPENDS_${PN}-module-file-spec += "${PN}-module-file-spec-unix"
+DEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-attributes"
+
+
+# Depends list
+# copy contents of /tmp/perl-rdepends in this file
+RDEPENDS_${PN}-module-anydbm-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-anydbm-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-config"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-cpan"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-getopt-std"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-if"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-net-ping"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-user-pwent"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-vars"
+RDEPENDS_${PN}-module-app-cpan += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-app-prove-state"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-base"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-getopt-long"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-tap-harness"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-tap-harness-env"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-app-prove += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-app-prove-state-result"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-base"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-tap-parser-yamlish-reader"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-tap-parser-yamlish-writer"
+RDEPENDS_${PN}-module-app-prove-state += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-app-prove-state-result-test"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-carp"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-constant"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove-state-result += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-app-prove-state-result-test += "${PN}-module-strict"
+RDEPENDS_${PN}-module-app-prove-state-result-test += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-constant"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-io-compress-bzip2"
+RDEPENDS_${PN}-module-archive-tar-constant += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-archive-tar"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-archive-tar-constant"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-archive-tar-file += "${PN}-module-vars"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-archive-tar-constant"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-archive-tar-file"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-config"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-io-zlib"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-strict"
+RDEPENDS_${PN}-module-archive-tar += "${PN}-module-vars"
+RDEPENDS_${PN}-module-arybase += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-carp"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-strict"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-vars"
+RDEPENDS_${PN}-module-attribute-handlers += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-carp"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-attributes += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-constant"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-fatal"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-overload"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-exception += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-parent"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-exception-system += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-b"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-constant"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-hints += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-constant"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-lib"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-parent"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-scope-guard += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-scope-guard += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-autodie-scope-guard"
+RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-scope-guardstack += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-autodie-scope-guardstack"
+RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-scopeutil += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autodie-skip += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autodie-skip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-autoloader += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autoloader += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-carp"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-config"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-autosplit += "${PN}-module-strict"
+RDEPENDS_${PN}-module-autouse += "${PN}-module-carp"
+RDEPENDS_${PN}-module-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-base += "${PN}-module-vars"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-b-op-private"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-config"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-concise += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-b-debug += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-debug += "${PN}-module-config"
+RDEPENDS_${PN}-module-b-debug += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-carp"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-feature"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-overloading"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-re"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-vars"
+RDEPENDS_${PN}-module-b-deparse += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-benchmark += "${PN}-module-carp"
+RDEPENDS_${PN}-module-benchmark += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-benchmark += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-carp"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-constant"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-math-bigint-trace"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-overload"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bigint += "${PN}-module-vars"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-bigint"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-carp"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigfloat-trace"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-math-bigint-trace"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-overload"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bignum += "${PN}-module-vars"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-bigint"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigint-trace"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-math-bigrat"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-overload"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bigrat += "${PN}-module-vars"
+RDEPENDS_${PN}-module-blib += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-blib += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-blib += "${PN}-module-vars"
+RDEPENDS_${PN}-module-b += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-b += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b-concise"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-b-terse"
+RDEPENDS_${PN}-module-b-showlex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-b-concise"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-carp"
+RDEPENDS_${PN}-module-b-terse += "${PN}-module-strict"
+RDEPENDS_${PN}-module-b-xref += "${PN}-module-b"
+RDEPENDS_${PN}-module-b-xref += "${PN}-module-config"
+RDEPENDS_${PN}-module-b-xref += "${PN}-module-strict"
+RDEPENDS_${PN}-module-bytes += "${PN}-module-bytes-heavy"
+RDEPENDS_${PN}-module-bytes += "${PN}-module-carp"
+RDEPENDS_${PN}-module-carp-heavy += "${PN}-module-carp"
+RDEPENDS_${PN}-module-carp += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-carp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-carp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-carp"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-re"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-strict"
+RDEPENDS_${PN}-module-charnames += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-carp"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-strict"
+RDEPENDS_${PN}-module-class-struct += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-bytes "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-carp "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-constant"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-strict "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-warnings "
+RDEPENDS_${PN}-module-compress-raw-bzip2 += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-bytes "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-carp "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-constant"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-strict "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-warnings "
+RDEPENDS_${PN}-module-compress-raw-zlib += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-bytes "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-carp "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-constant"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-gzip"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-handle "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-io-uncompress-gunzip"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-strict "
+RDEPENDS_${PN}-module-compress-zlib += "${PN}-module-warnings "
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-config"
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-strict"
+RDEPENDS_${PN}-module-config-extensions += "${PN}-module-vars"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-config"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-strict"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-vars"
+RDEPENDS_${PN}-module-config-perl-v += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-constant += "${PN}-module-carp"
+RDEPENDS_${PN}-module-constant += "${PN}-module-strict"
+RDEPENDS_${PN}-module-constant += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-corelist"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-strict"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-vars"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-version"
+RDEPENDS_${PN}-module-corelist += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-b"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-carp"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-config"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-cpan"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-dirhandle"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-extutils-manifest"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-lib"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-net-ping"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-overload"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-posix"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-safe"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-strict"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-sys-hostname"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-term-readline"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-vars"
+RDEPENDS_${PN}-module-cpan += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-vars"
+RDEPENDS_${PN}-module-cwd += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-b-deparse"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-carp"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-config"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-constant"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-overload"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-data-dumper += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-compress += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-encode += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-int32 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-int32 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-null += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-null += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-dbm-filter-utf8 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-db += "${PN}-module-strict"
+RDEPENDS_${PN}-module-deprecate += "${PN}-module-carp"
+RDEPENDS_${PN}-module-deprecate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-deprecate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-devel-peek += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-devel-peek += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-getopt-long"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-strict"
+RDEPENDS_${PN}-module-devel-ppport += "${PN}-module-vars"
+RDEPENDS_${PN}-module-devel-selfstubber += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-devel-selfstubber += "${PN}-module-selfloader"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-carp"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-config"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-getopt-std"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-strict"
+RDEPENDS_${PN}-module-diagnostics += "${PN}-module-text-tabs"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-base += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-digest"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-file += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-digest-base"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-md5 += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-digest += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-carp"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-digest-base"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-integer"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-strict"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-vars"
+RDEPENDS_${PN}-module-digest-sha += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-dirhandle += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dirhandle += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-dynaloader += "${PN}-module-carp"
+RDEPENDS_${PN}-module-dynaloader += "${PN}-module-config"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-alias += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-byte += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-cjkconstants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-vars"
+RDEPENDS_${PN}-module-encode-cn-hz += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-encode-cn-hz"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-cn += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-config += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-config += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-ebcdic += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-overload"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-encoder += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-encode-mime-name"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-encoding += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-encode-gsm0338 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-encode-unicode"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-guess += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-vars"
+RDEPENDS_${PN}-module-encode-jp-h2z += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-encode-jp-h2z"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-jp-jis7 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-encode-jp-jis7"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-jp += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-kr-2022-kr += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-encode-kr-2022-kr"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-kr += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-encode-cjkconstants"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-mime-header-iso-2022-jp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encode-mime-header += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-mime-name += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-mime-name += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-encode += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encode += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-alias"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-config"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-configlocal-pm"
+RDEPENDS_${PN}-module-encode += "${PN}-module-encode-encoding"
+RDEPENDS_${PN}-module-encode += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-encode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-symbol += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-tw += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encode-unicode += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-parent"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-re"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encode-unicode-utf7 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-config"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-constant"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-encode"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-filter-util-call"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-i18n-langinfo"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-strict"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-encoding += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-encoding-warnings += "${PN}-module-carp"
+RDEPENDS_${PN}-module-encoding-warnings += "${PN}-module-strict"
+RDEPENDS_${PN}-module-english += "${PN}-module-carp "
+RDEPENDS_${PN}-module-english += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-env += "${PN}-module-config"
+RDEPENDS_${PN}-module-env += "${PN}-module-tie-array"
+RDEPENDS_${PN}-module-errno += "${PN}-module-carp"
+RDEPENDS_${PN}-module-errno += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-errno += "${PN}-module-strict"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-carp"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-feature"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-strict"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-version"
+RDEPENDS_${PN}-module-experimental += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-carp"
+RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-exporter-heavy += "${PN}-module-strict"
+RDEPENDS_${PN}-module-exporter += "${PN}-module-exporter-heavy"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-extutils-mksymlists"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-ipc-cmd"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-base += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-aix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-android += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-cygwin += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-darwin += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-dec-osf += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-extutils-cbuilder-platform-unix"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-os2 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-extutils-cbuilder-base"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-unix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-extutils-cbuilder-base"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-vms += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-extutils-cbuilder-base"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-cbuilder-platform-windows += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-extutils-command"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-extutils-install"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-getopt-long"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-test-harness"
+RDEPENDS_${PN}-module-extutils-command-mm += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-command += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-constant"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-extutils-constant-base += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-proxysubs"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-extutils-constant-xs"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-extutils-constant-xs"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-proxysubs += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-constant"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-posix"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-utils += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant-base"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-extutils-constant-utils"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-constant-xs += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-extutils-liblist"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-getopt-std"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-embed += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-extutils-packlist"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-installed += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-autosplit"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-extutils-packlist"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-compare"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-install += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-extutils-liblist-kid += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-extutils-liblist-kid"
+RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-liblist += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-config += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-makemaker-config += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-base"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-encode"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-encode-alias"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-i18n-langinfo"
+RDEPENDS_${PN}-module-extutils-makemaker-locale += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-b"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-makemaker-version"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-manifest"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-mm"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-extutils-my"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker += "${PN}-module-version"
+RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-extutils-makemaker-version-regex"
+RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-version += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-makemaker-version-regex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-version-regex += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-b"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-extutils-makemaker-version-regex"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-locale"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-overload"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-universal"
+RDEPENDS_${PN}-module-extutils-makemaker-version-vpp += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-manifest += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-extutils-embed"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-miniperl += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-mkbootstrap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-mksymlists += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-aix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-autosplit"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-cpan"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-data-dumper"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-any += "${PN}-module-version"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-beos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-extutils-mm-win32"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-cygwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-darwin += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-darwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-dos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-macos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-extutils-mm-win32"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-nw5 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-os2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-liblist"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-qnx += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-qnx += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-dirhandle"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-encode"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-liblist"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-mm-unix += "${PN}-module-version"
+RDEPENDS_${PN}-module-extutils-mm-uwin += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-uwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-liblist-kid"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-extutils-mm-vms += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-vos += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-vos += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-mm-any"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-extutils-mm-unix"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-mm-win32 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-extutils-makemaker-config"
+RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-extutils-mm-win32"
+RDEPENDS_${PN}-module-extutils-mm-win95 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-my += "${PN}-module-extutils-mm"
+RDEPENDS_${PN}-module-extutils-my += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-carp"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-packlist += "${PN}-module-vars"
+RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-extutils-parsexs-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-parsexs-countlines += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-eval += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-eval += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-config"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-constants"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-countlines"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-eval"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-extutils-parsexs-utilities"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-re"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-extutils-parsexs-constants"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-extutils-typemaps"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-parsexs-utilities += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-lib"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-testlib += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-extutils-typemaps"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-cmd += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-inputmap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-inputmap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-re"
+RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-outputmap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-parsexs"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-parsexs-constants"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-inputmap"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-outputmap"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-extutils-typemaps-type"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-extutils-typemaps"
+RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-strict"
+RDEPENDS_${PN}-module-extutils-typemaps-type += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-exception-system"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-hints"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-autodie-scopeutil"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-carp"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-config"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-constant"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-fatal"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-posix"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-strict"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-tie-refhash"
+RDEPENDS_${PN}-module-fatal += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-fcntl += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-fcntl += "${PN}-module-strict"
+RDEPENDS_${PN}-module-fcntl += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-feature += "${PN}-module-carp"
+RDEPENDS_${PN}-module-fields += "${PN}-module-base"
+RDEPENDS_${PN}-module-fields += "${PN}-module-carp"
+RDEPENDS_${PN}-module-fields += "${PN}-module-hash-util"
+RDEPENDS_${PN}-module-fields += "${PN}-module-strict"
+RDEPENDS_${PN}-module-fields += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-re"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-basename += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-carp"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-parent"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-strict"
+RDEPENDS_${PN}-module-filecache += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-compare += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-config"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-copy += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-dosglob += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-copy"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-ipc-cmd"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-load"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-params-check"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-fetch += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-config"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-find += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-file-glob"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-globmapper += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-glob += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-glob += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-glob += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-filehandle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-path += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-cygwin += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-epoc += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-functions += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-mac += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-os2 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-unix += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-vms += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-cwd "
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-file-spec-unix"
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-spec-win32 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-overload "
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-vars"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-file-stat += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-errno"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-io-seekable"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-overload"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-parent"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-posix"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-file-temp += "${PN}-module-vars"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-carp"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-filter-util-call"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-text-balanced"
+RDEPENDS_${PN}-module-filter-simple += "${PN}-module-vars"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-carp "
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-strict"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-vars"
+RDEPENDS_${PN}-module-filter-util-call += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-carp"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-findbin += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-constant"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-overload"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-pod-usage"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-strict"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-getopt-long += "${PN}-module-vars"
+RDEPENDS_${PN}-module-getopt-std += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-strict"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-hash-util-fieldhash += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-carp"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-hash-util-fieldhash"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-hash-util += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-overload"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-posix"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-collate += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-carp"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-i18n-langinfo += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-i18n-langtags"
+RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langtags-detect += "${PN}-module-vars"
+RDEPENDS_${PN}-module-i18n-langtags-list += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langtags-list += "${PN}-module-vars"
+RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-i18n-langtags"
+RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-strict"
+RDEPENDS_${PN}-module-i18n-langtags += "${PN}-module-vars"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-compress-raw-bzip2"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-adapter-bzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-adapter-deflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-adapter-identity += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-encode"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-file-globmapper"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-io-compress-base-common += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-io-handle "
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-compress-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-adapter-bzip2"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-base"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-bzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-rawdeflate"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-io-compress-zlib-constants"
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-deflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-gzip-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-rawdeflate"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-gzip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-base"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-rawdeflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zip-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-config"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-adapter-deflate"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-adapter-identity"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-bzip2 "
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-rawdeflate"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-zip-constants"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zlib-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-compress-zlib-extra += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-file-stat"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-dir += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-io-seekable"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-selectsaver"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-file += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-io"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-selectsaver"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-handle += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-pipe += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-poll += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-poll += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-poll += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-seekable += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-vars"
+RDEPENDS_${PN}-module-io-select += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-errno"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-socket"
+RDEPENDS_${PN}-module-io-socket-inet += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-base"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-errno"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-posix"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-socket"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-socket-ip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-errno"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-socket-inet"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-io-socket-unix"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-socket"
+RDEPENDS_${PN}-module-io-socket += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-io-socket-unix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-compress-raw-bzip2"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-bunzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-io-compress-zip-constants "
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-identity += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-adapter-inflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-adapter-inflate"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-gunzip"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-inflate"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-io-uncompress-unzip"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-anyinflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-uncompress-anyuncompress += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-carp "
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-io-file "
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-uncompress-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-uncompress-adapter-bunzip2"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-bunzip2 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-gzip-constants"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-gunzip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-compress-zlib-constants"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-inflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-uncompress-adapter-inflate"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-io-uncompress-base"
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-rawinflate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-compress-raw-zlib"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-constant"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-exporter "
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-base-common"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-zip-constants"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-compress-zlib-extra"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-adapter-identity"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-adapter-inflate"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-io-uncompress-rawinflate"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-posix"
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-strict "
+RDEPENDS_${PN}-module-io-uncompress-unzip += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-carp"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-strict"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-tie-handle"
+RDEPENDS_${PN}-module-io-zlib += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-constant"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-extutils-makemaker"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-ipc-open3"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-load"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-params-check"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-posix"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-socket"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-time-hires"
+RDEPENDS_${PN}-module-ipc-cmd += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-ipc-sysv"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-msg += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-ipc-open3"
+RDEPENDS_${PN}-module-ipc-open2 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-constant"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-io-pipe"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-posix"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-open3 += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-ipc-sysv"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-semaphore += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-ipc-sysv"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-sharedmem += "${PN}-module-vars"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-config"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ipc-sysv += "${PN}-module-vars"
+RDEPENDS_${PN}-module-json-pp-boolean += "${PN}-module-json-pp"
+RDEPENDS_${PN}-module-json-pp-boolean += "${PN}-module-strict"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-b"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-base"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-bytes"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-encode"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-overload"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-json-pp += "${PN}-module-subs"
+RDEPENDS_${PN}-module-less += "${PN}-module-strict"
+RDEPENDS_${PN}-module-less += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-lib += "${PN}-module-carp"
+RDEPENDS_${PN}-module-lib += "${PN}-module-config"
+RDEPENDS_${PN}-module-lib += "${PN}-module-strict"
+RDEPENDS_${PN}-module-list-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-list-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-list-util += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-list-util-xs += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-list-util-xs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-loaded += "${PN}-module-carp"
+RDEPENDS_${PN}-module-loaded += "${PN}-module-strict"
+RDEPENDS_${PN}-module-loaded += "${PN}-module-vars"
+RDEPENDS_${PN}-module-load += "${PN}-module-carp"
+RDEPENDS_${PN}-module-load += "${PN}-module-config"
+RDEPENDS_${PN}-module-load += "${PN}-module-constant"
+RDEPENDS_${PN}-module-load += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-load += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-load += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-load += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-load += "${PN}-module-corelist"
+RDEPENDS_${PN}-module-load += "${PN}-module-load"
+RDEPENDS_${PN}-module-load += "${PN}-module-params-check"
+RDEPENDS_${PN}-module-load += "${PN}-module-strict"
+RDEPENDS_${PN}-module-load += "${PN}-module-vars"
+RDEPENDS_${PN}-module-load += "${PN}-module-version"
+RDEPENDS_${PN}-module-load += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-constant"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-constants += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-country-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-country-codes"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-locale-codes-country-retired"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-country += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-country-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-currency-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-currency-codes"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-locale-codes-currency-retired"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-currency += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-currency-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langext-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-langext-codes"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-locale-codes-langext-retired"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langext += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langext-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langfam-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-langfam-codes"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-locale-codes-langfam-retired"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langfam += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langfam-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langfam-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-language-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-language-codes"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-locale-codes-language-retired"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-language += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-language-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langvar-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-langvar-codes"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-locale-codes-langvar-retired"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langvar += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-langvar-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-script-codes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-constants"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-script-codes"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-locale-codes-script-retired"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-script += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-locale-codes-script-retired += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-country += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-country += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-country += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-currency += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-currency += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-currency += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-language += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-language += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-language += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-locale-maketext-gutsloader += "${PN}-module-locale-maketext"
+RDEPENDS_${PN}-module-locale-maketext-guts += "${PN}-module-locale-maketext"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-i18n-langtags"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-i18n-langtags-detect"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-integer"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-maketext += "${PN}-module-vars"
+RDEPENDS_${PN}-module-locale-maketext-simple += "${PN}-module-base"
+RDEPENDS_${PN}-module-locale-maketext-simple += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale += "${PN}-module-carp"
+RDEPENDS_${PN}-module-locale += "${PN}-module-config"
+RDEPENDS_${PN}-module-locale-script += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-locale-script += "${PN}-module-strict"
+RDEPENDS_${PN}-module-locale-script += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigfloat += "${PN}-module-vars"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigfloat-trace += "${PN}-module-vars"
+RDEPENDS_${PN}-module-math-bigint-calcemu += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-calcemu += "${PN}-module-vars"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-constant"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-integer"
+RDEPENDS_${PN}-module-math-bigint-calc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-math-bigint-calc"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-vars"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-bigint-fastcalc += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint += "${PN}-module-vars"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigint-trace += "${PN}-module-vars"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-carp"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-math-bigfloat"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-math-bigint"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-bigrat += "${PN}-module-vars"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-config"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-overload"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-math-complex += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-math-trig += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-math-trig += "${PN}-module-math-complex"
+RDEPENDS_${PN}-module-math-trig += "${PN}-module-strict"
+RDEPENDS_${PN}-module-memoize-anydbm-file += "${PN}-module-vars"
+RDEPENDS_${PN}-module-memoize-expirefile += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize-expire += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-config"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-strict"
+RDEPENDS_${PN}-module-memoize += "${PN}-module-vars"
+RDEPENDS_${PN}-module-memoize-sdbm-file += "${PN}-module-sdbm-file"
+RDEPENDS_${PN}-module-memoize-storable += "${PN}-module-carp"
+RDEPENDS_${PN}-module-memoize-storable += "${PN}-module-storable"
+RDEPENDS_${PN}-module-meta-notation += "${PN}-module-strict"
+RDEPENDS_${PN}-module-meta-notation += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-vars"
+RDEPENDS_${PN}-module-mime-base64 += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-mime-quotedprint += "${PN}-module-vars"
+RDEPENDS_${PN}-module-mro += "${PN}-module-strict"
+RDEPENDS_${PN}-module-mro += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-mro += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-constant"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-net-cmd += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-config += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-posix"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-domain += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-net-ftp-dataconn"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-a += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-errno"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-dataconn += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-net-ftp-i"
+RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-e += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-net-ftp-dataconn"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-i += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-net-ftp-i"
+RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp-l += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-ftp-a"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-net-netrc"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-net-ftp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-hostent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-netent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-netrc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-net-nntp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-constant"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-filehandle"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-posix"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-time-hires"
+RDEPENDS_${PN}-module-net-ping += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-net-netrc"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-pop3 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-protoent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-servent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-io-socket-ip"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-mime-base64"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-net-cmd"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-socket"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-smtp += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-carp"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-io-socket"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-net-config"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-strict"
+RDEPENDS_${PN}-module-net-time += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-next += "${PN}-module-carp"
+RDEPENDS_${PN}-module-next += "${PN}-module-overload"
+RDEPENDS_${PN}-module-next += "${PN}-module-strict"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-odbm-file += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-ok += "${PN}-module-strict"
+RDEPENDS_${PN}-module-ok += "${PN}-module-test-more"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-carp"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-strict"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-subs"
+RDEPENDS_${PN}-module-opcode += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-open += "${PN}-module-carp"
+RDEPENDS_${PN}-module-open += "${PN}-module-encode"
+RDEPENDS_${PN}-module-open += "${PN}-module-encoding"
+RDEPENDS_${PN}-module-open += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-o += "${PN}-module-b"
+RDEPENDS_${PN}-module-o += "${PN}-module-carp"
+RDEPENDS_${PN}-module-ops += "${PN}-module-opcode"
+RDEPENDS_${PN}-module-overloading += "${PN}-module-overload-numbers"
+RDEPENDS_${PN}-module-overloading += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-overload += "${PN}-module-mro"
+RDEPENDS_${PN}-module-overload += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-overload += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-carp"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-locale-maketext-simple"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-strict"
+RDEPENDS_${PN}-module-params-check += "${PN}-module-vars"
+RDEPENDS_${PN}-module-parent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-parent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-perlfaq += "${PN}-module-strict"
+RDEPENDS_${PN}-module-perlfaq += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-perlio-encoding += "${PN}-module-strict"
+RDEPENDS_${PN}-module-perlio-encoding += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-perlio-mmap += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-scalar += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-via += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-perlio-via-quotedprint += "${PN}-module-mime-quotedprint"
+RDEPENDS_${PN}-module-perlio-via-quotedprint += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-pod-parser"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-pod-parseutils"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-checker += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-escapes += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-file-find"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-find += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-functions += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-functions += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-inputobjects += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-inputobjects += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-subs"
+RDEPENDS_${PN}-module-pod-man += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-parselink += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-pod-inputobjects"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-parser += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-parseutils += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-baseto += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-getoptsoo += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-getoptsoo += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-pod-perldoc-getoptsoo"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-pod-text-color"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toansi += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-pod-checker"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-tochecker += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-file-spec-functions"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-ipc-open3"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-pod-man"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-pod-perldoc-topod"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toman += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-pod-man"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-tonroff += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-topod += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-tortf += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-pod-text-termcap"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toterm += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-totext += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-parent"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-perldoc-toxml += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-pod-select"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-plaintext += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-pod-parser"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-select += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-integer"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-pod-simple-transcode"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-blackbox += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-pod-simple-methody"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-pod-simple-checker += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-debug += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-dumpastext += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-dumpasxml += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-overload"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-pod-simple-blackbox"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-linksection += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-methody += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-integer"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-escapes"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-blackbox"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-linksection"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-pod-simple-tiedoutfh"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-simple += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-progress += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-pod-simple-pullparsertoken"
+RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserendtoken += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparserendtoken"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparserstarttoken"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-pod-simple-pullparsertexttoken"
+RDEPENDS_${PN}-module-pod-simple-pullparser += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-pod-simple-pullparsertoken"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparserstarttoken += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-pod-simple-pullparsertoken"
+RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-pullparsertexttoken += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-pullparsertoken += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-integer"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-pod-simple-pullparser"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-rtf += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-cwd"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-search += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-simpletree += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-textcontent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-pod-simple-methody"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-text-wrap"
+RDEPENDS_${PN}-module-pod-simple-text += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-pod-simple-tiedoutfh += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-transcodedumb += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-transcodedumb += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-transcode += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-transcodesmart += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-simple-xmloutstream += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-term-ansicolor"
+RDEPENDS_${PN}-module-pod-text-color += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text-overstrike += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-encode"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-pod-simple"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-pod-text"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-posix"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-term-cap"
+RDEPENDS_${PN}-module-pod-text-termcap += "${PN}-module-vars"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-carp"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-config"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-strict"
+RDEPENDS_${PN}-module-pod-usage += "${PN}-module-vars"
+RDEPENDS_${PN}-module-posix += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-posix += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-posix += "${PN}-module-strict"
+RDEPENDS_${PN}-module-posix += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-posix += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-posix += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-re += "${PN}-module-carp"
+RDEPENDS_${PN}-module-re += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-re += "${PN}-module-strict"
+RDEPENDS_${PN}-module-re += "${PN}-module-term-cap"
+RDEPENDS_${PN}-module-re += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-re += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-safe += "${PN}-module-b"
+RDEPENDS_${PN}-module-safe += "${PN}-module-carp"
+RDEPENDS_${PN}-module-safe += "${PN}-module-carp-heavy"
+RDEPENDS_${PN}-module-safe += "${PN}-module-opcode"
+RDEPENDS_${PN}-module-safe += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-safe += "${PN}-module-strict"
+RDEPENDS_${PN}-module-safe += "${PN}-module-utf8"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-carp"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-scalar-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-sdbm-file += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-search-dict += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-search-dict += "${PN}-module-feature"
+RDEPENDS_${PN}-module-search-dict += "${PN}-module-strict"
+RDEPENDS_${PN}-module-selectsaver += "${PN}-module-carp"
+RDEPENDS_${PN}-module-selectsaver += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-strict"
+RDEPENDS_${PN}-module-selfloader += "${PN}-module-vars"
+RDEPENDS_${PN}-module-sigtrap += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sigtrap += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-socket += "${PN}-module-carp"
+RDEPENDS_${PN}-module-socket += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-socket += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-socket += "${PN}-module-strict"
+RDEPENDS_${PN}-module-socket += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-socket += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-sort += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sort += "${PN}-module-strict"
+RDEPENDS_${PN}-module-storable += "${PN}-module-carp"
+RDEPENDS_${PN}-module-storable += "${PN}-module-config"
+RDEPENDS_${PN}-module-storable += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-storable += "${PN}-module-io-file"
+RDEPENDS_${PN}-module-storable += "${PN}-module-vars"
+RDEPENDS_${PN}-module-storable += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-list-util"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sub-util += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-symbol += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-posix"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sys-hostname += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-carp"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-posix"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-socket"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-strict"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-sys-hostname"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-vars"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-sys-syslog += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-tap-formatter-color"
+RDEPENDS_${PN}-module-tap-formatter-base += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-color += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-console-parallelsession += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-console += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-console-session += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-tap-formatter-file-session"
+RDEPENDS_${PN}-module-tap-formatter-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-file-session += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-formatter-session += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-tap-object"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-tap-harness-env += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-file-path"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-harness += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-object += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-object += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-object += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-benchmark"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-aggregator += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-tap-parser-resultfactory"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-tap-parser-yamlish-reader"
+RDEPENDS_${PN}-module-tap-parser-grammar += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator-array += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iteratorfactory += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-config"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-io-handle"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator-process += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-iterator-stream += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-io-select"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-multiplexer += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-grammar"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-iterator"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-result"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-resultfactory"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-source"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-executable"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-file"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-handle"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-perl"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-tap-parser-sourcehandler-rawtap"
+RDEPENDS_${PN}-module-tap-parser += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-bailout += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-comment += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-bailout"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-comment"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-plan"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-pragma"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-test"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-unknown"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-version"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-tap-parser-result-yaml"
+RDEPENDS_${PN}-module-tap-parser-resultfactory += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-plan += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-pragma += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-test += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-unknown += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-version += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-result-yaml += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-scheduler-job += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-tap-parser-scheduler-job"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-tap-parser-scheduler-spinner"
+RDEPENDS_${PN}-module-tap-parser-scheduler += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-scheduler-spinner += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-tap-parser-iterator-process"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-executable += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-tap-parser-iterator-stream"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-file += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-tap-parser-iterator-stream"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-handle += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-tap-parser-iterator"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-config"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-tap-parser-iterator-process"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-perl += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-tap-parser-iterator-array"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-tap-parser-iteratorfactory"
+RDEPENDS_${PN}-module-tap-parser-sourcehandler-rawtap += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-constant"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-file-basename"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-source += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-yamlish-reader += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-base"
+RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tap-parser-yamlish-writer += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-carp"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-ansicolor += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-term-cap += "${PN}-module-carp"
+RDEPENDS_${PN}-module-term-cap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-cap += "${PN}-module-vars"
+RDEPENDS_${PN}-module-term-complete += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-term-complete += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-readline += "${PN}-module-strict"
+RDEPENDS_${PN}-module-term-readline += "${PN}-module-term-cap"
+RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder-module += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-config"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-perlio"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-test-builder += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test-builder-tester-color += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder-tester-color += "${PN}-module-test-builder-tester"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-carp"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-test-builder-tester += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-base"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-config"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-constant"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-harness"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-aggregator"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-source"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-tap-parser-sourcehandler-perl"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-text-parsewords"
+RDEPENDS_${PN}-module-test-harness += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-test-builder-module"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-test-more"
+RDEPENDS_${PN}-module-test-more += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test += "${PN}-module-carp"
+RDEPENDS_${PN}-module-test += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test += "${PN}-module-file-temp"
+RDEPENDS_${PN}-module-test += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test += "${PN}-module-vars"
+RDEPENDS_${PN}-module-test-simple += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-simple += "${PN}-module-test-builder-module"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-config"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-test-tester-capture += "${PN}-module-vars"
+RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester-capturerunner += "${PN}-module-test-tester-capture"
+RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-vars"
+RDEPENDS_${PN}-module-test-tester-delegate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-strict"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-builder"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-tester-capturerunner"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-test-tester-delegate"
+RDEPENDS_${PN}-module-test-tester += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-abbrev += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-carp"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-overload"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-selfloader"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-balanced += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-carp"
+RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-parsewords += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-tabs += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-tabs += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-tabs += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-re"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-strict"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-text-tabs"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-vars"
+RDEPENDS_${PN}-module-text-wrap += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-thread += "${PN}-module-config"
+RDEPENDS_${PN}-module-thread += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-thread += "${PN}-module-strict"
+RDEPENDS_${PN}-module-thread += "${PN}-module-threads"
+RDEPENDS_${PN}-module-thread += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-thread += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-carp"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-strict"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-thread-queue += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-carp"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-strict"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-threads-shared"
+RDEPENDS_${PN}-module-thread-semaphore += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-threads += "${PN}-module-carp"
+RDEPENDS_${PN}-module-threads += "${PN}-module-config"
+RDEPENDS_${PN}-module-threads += "${PN}-module-overload"
+RDEPENDS_${PN}-module-threads += "${PN}-module-strict"
+RDEPENDS_${PN}-module-threads += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-threads += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-carp"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-scalar-util"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-strict"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-threads-shared += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-tie-array += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-array += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-array += "${PN}-module-vars"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-fcntl"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-posix"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-file += "${PN}-module-symbol"
+RDEPENDS_${PN}-module-tie-handle += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-handle += "${PN}-module-tie-stdhandle"
+RDEPENDS_${PN}-module-tie-handle += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-tie-hash-namedcapture += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-hash-namedcapture += "${PN}-module-xsloader"
+RDEPENDS_${PN}-module-tie-hash += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-hash += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-tie-memoize += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-memoize += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-config"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-overload"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-tie-hash"
+RDEPENDS_${PN}-module-tie-refhash += "${PN}-module-vars"
+RDEPENDS_${PN}-module-tie-scalar += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-scalar += "${PN}-module-warnings-register"
+RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-strict"
+RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-tie-handle"
+RDEPENDS_${PN}-module-tie-stdhandle += "${PN}-module-vars"
+RDEPENDS_${PN}-module-tie-substrhash += "${PN}-module-carp"
+RDEPENDS_${PN}-module-tie-substrhash += "${PN}-module-integer"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-time-tm"
+RDEPENDS_${PN}-module-time-gmtime += "${PN}-module-vars"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-carp"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-hires += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-carp"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-config"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-constant"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-local += "${PN}-module-vars"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-time-tm"
+RDEPENDS_${PN}-module-time-localtime += "${PN}-module-vars"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-carp"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-constant"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-integer"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-overload"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-time-local"
+RDEPENDS_${PN}-module-time-piece += "${PN}-module-time-seconds"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-constant"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-overload "
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-strict"
+RDEPENDS_${PN}-module-time-seconds += "${PN}-module-vars"
+RDEPENDS_${PN}-module-time-tm += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-time-tm += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-big5 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-big5 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-gb2312 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-gb2312 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-jisx0208 += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-jisx0208 += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-korean += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-korean += "${PN}-module-unicode-collate"
+RDEPENDS_${PN}-module-unicode-collate-cjk-korean += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-pinyin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-pinyin += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-stroke += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-stroke += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-cjk-zhuyin += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-cjk-zhuyin += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-base"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate-locale += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-constant"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-dynaloader"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-collate += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-constant"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-normalize += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-carp"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-charnames"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-feature"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-file-spec"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-if"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-integer"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-strict"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-unicode-normalize"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-unicore"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-utf8-heavy"
+RDEPENDS_${PN}-module-unicode-ucd += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-unicore += "${PN}-module-integer"
+RDEPENDS_${PN}-module-universal += "${PN}-module-carp"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-user-grent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-carp"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-class-struct"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-config"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-exporter"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-strict"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-vars"
+RDEPENDS_${PN}-module-user-pwent += "${PN}-module-warnings"
+RDEPENDS_${PN}-module-utf8 += "${PN}-module-carp"
+RDEPENDS_${PN}-module-utf8 += "${PN}-module-utf8-heavy"
+RDEPENDS_${PN}-module-version += "${PN}-module-strict"
+RDEPENDS_${PN}-module-version += "${PN}-module-vars"
+RDEPENDS_${PN}-module-version += "${PN}-module-version-regex"
+RDEPENDS_${PN}-module-version-regex += "${PN}-module-strict"
+RDEPENDS_${PN}-module-version-regex += "${PN}-module-vars"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-b"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-carp"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-config"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-constant"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-if"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-overload"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-posix"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-strict"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-universal"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-vars"
+RDEPENDS_${PN}-module-version-vpp += "${PN}-module-version-regex"
+RDEPENDS_${PN}-module-xsloader += "${PN}-module-carp"
+RDEPENDS_${PN}-module-xsloader += "${PN}-module-dynaloader"
diff --git a/meta/recipes-devtools/perl/perl.inc b/meta/recipes-devtools/perl/perl.inc
new file mode 100644
index 0000000..0d9716c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl.inc
@@ -0,0 +1,8 @@
+SUMMARY = "Perl scripting language"
+HOMEPAGE = "http://www.perl.org/"
+SECTION = "devel"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://Copying;md5=5b122a36d0f6dc55279a0ebc69f3c60b \
+		    file://Artistic;md5=2e6fd2475335af892494fe1f7327baf3"
+
+SRC_URI = "http://www.cpan.org/src/5.0/${BP}.tar.xz"
diff --git a/meta/recipes-devtools/perl/perl/Configure-multilib.patch b/meta/recipes-devtools/perl/perl/Configure-multilib.patch
new file mode 100644
index 0000000..9625b0b
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/Configure-multilib.patch
@@ -0,0 +1,17 @@
+Upstream-Status:Pending
+
+Index: perl-5.12.3/Configure
+===================================================================
+--- perl-5.12.3.orig/Configure
++++ perl-5.12.3/Configure
+@@ -1316,8 +1316,9 @@ loclibpth="/usr/local/lib /opt/local/lib
+ loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
+ 
+ : general looking path for locating libraries
+-glibpth="/lib /usr/lib $xlibpth"
++glibpth="/lib /usr/lib /lib64 /usr/lib64 $xlibpth"
+ glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
++test -f /usr/lib/*-linux-gnu/libc.so && glibpth="/usr/lib/*-linux-gnu $glibpth"
+ test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
+ test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
+ test -d /usr/lib64         && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
diff --git a/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch b/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch
new file mode 100644
index 0000000..eb92ccb
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/MM_Unix.pm.patch
@@ -0,0 +1,22 @@
+Upstream-Status:Pending
+
+The perl-native should be relocatable while re-use sstate-cache from
+another build, especially the original build was renamed/removed.
+
+To get the MakeMaker.pm works in this case, we need perl wrapper here
+instead of real perl binary.
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+===================================================================
+--- perl-5.12.3/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm.orig	2011-08-12 16:07:30.000000000 +0800
++++ perl-5.12.3/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm	2011-08-12 16:08:56.000000000 +0800
+@@ -1019,6 +1019,9 @@
+     }
+ 
+     foreach my $name (@$names){
++        # Getting MakeMaker.pm use perl wrapper instead of 'perl.real' directly
++        $name =~ s/perl\.real/perl/ if ($name =~ /perl\.real/);
++
+         foreach my $dir (@$dirs){
+             next unless defined $dir; # $self->{PERL_SRC} may be undefined
+             my ($abs, $val);
diff --git a/meta/recipes-devtools/perl/perl/Makefile.SH.patch b/meta/recipes-devtools/perl/perl/Makefile.SH.patch
new file mode 100644
index 0000000..3de2331
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/Makefile.SH.patch
@@ -0,0 +1,374 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.SH |  145 +++++++++++++++++++++++++++--------------------------------
+ 1 file changed, 67 insertions(+), 78 deletions(-)
+
+diff --git a/Makefile.SH b/Makefile.SH
+index 034d812..67e08fd 100755
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -39,10 +39,10 @@ case "$useshrplib" in
+ true)
+ 	# Prefix all runs of 'miniperl' and 'perl' with
+ 	# $ldlibpth so that ./perl finds *this* shared libperl.
+-	case "$LD_LIBRARY_PATH" in
+-	'')  ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
+-	*)   ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
+-	esac
++	#case "$LD_LIBRARY_PATH" in
++	#'')  ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
++	#*)   ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
++	#esac
+ 
+ 	pldlflags="$cccdlflags"
+ 	static_ldflags=''
+@@ -122,10 +122,11 @@ true)
+ 	    *)
+ 		eval "ldlibpthval=\"\$$ldlibpthname\""
+ 
+-		case "$ldlibpthval" in
+-		'')  ldlibpth="$ldlibpthname=` quote "$pwd" `" ;;
+-		*)   ldlibpth="$ldlibpthname=` quote "$pwd" `:` quote "$ldlibpthval" `" ;;
+-		esac
++# We compile in the library path in OE from cross-compile, so lets not do this
++#		case "$ldlibpthval" in
++#		'')  ldlibpth="$ldlibpthname=` quote "$pwd" `" ;;
++#		*)   ldlibpth="$ldlibpthname=` quote "$pwd" `:` quote "$ldlibpthval" `" ;;
++#		esac
+ 
+ 		;;
+ 	    esac
+@@ -141,18 +142,7 @@ true)
+ 	    # INSTALL file, under "Building a shared perl library".
+ 	    # If there is no pre-existing $libperl, we don't need
+ 	    # to do anything further.
+-	    if test -f $archlib/CORE/$libperl; then
+-		rm -f preload
+-		cat <<'EOT' > preload
+-#! /bin/sh
+-lib=$1
+-shift
+-test -r $lib && export LD_PRELOAD="$lib $LD_PRELOAD"
+-exec "$@"
+-EOT
+-		chmod 755 preload
+-		ldlibpth="$ldlibpth `pwd`/preload `pwd`/$libperl"
+-	    fi
++	    echo linux libraries overwritten by cross-compile patches
+ 	    ;;
+ 	os390)	test -f /bin/env && ldlibpth="/bin/env $ldlibpth"
+ 		;;
+@@ -566,13 +556,23 @@ splintfiles = $(c1)
+ 	@echo `$(CCCMDSRC)` -S $*.c
+ 	@`$(CCCMDSRC)` -S $*.c
+ 
+-all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make $(MANIFEST_SRT)
+-	@echo " ";
+-	@echo "	Everything is up to date. Type '$(MAKE) test' to run test suite."
++#all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) $(generated_pods) $(private) $(unidatafiles) $(public) $(dynamic_ext) $(nonxs_ext) extras.make $(MANIFEST_SRT)
++#	@echo " ";
++#	@echo "	Everything is up to date. Type '$(MAKE) test' to run test suite."
++
++all: $(FIRSTMAKEFILE) $(MINIPERL_EXE) miniperl $(unidatafiles)
++
++more: $(generated_pods) $(private) $(public)
++
++more2: $(dynamic_ext)
+ 
+-$(MANIFEST_SRT):	MANIFEST $(PERL_EXE)
+-	@$(RUN_PERL) Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
+-	    $(RUN_PERL) Porting/manisort -q -o MANIFEST; sh -c true)
++more3: $(nonxs_ext)
++
++more4: extras.make $(MANIFEST_SRT)
++
++$(MANIFEST_SRT):	MANIFEST
++	@$(MINIPERL) Porting/manisort -q || (echo "WARNING: re-sorting MANIFEST"; \
++	    $(MINIPERL) Porting/manisort -q -o MANIFEST; sh -c true)
+ 	@touch $(MANIFEST_SRT)
+ 
+ .PHONY: all utilities
+@@ -581,7 +581,7 @@ $(MANIFEST_SRT):	MANIFEST $(PERL_EXE)
+ # by make_patchnum.pl.
+ git_version.h: lib/Config_git.pl
+ 
+-lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl
++lib/Config_git.pl: make_patchnum.pl
+ 	$(MINIPERL) make_patchnum.pl
+ 
+ # make sure that we recompile perl.c if the git version changes
+@@ -594,7 +594,7 @@ perl$(OBJ_EXT): git_version.h
+ # loading, we need to build perl first.
+ case "$usedl$static_cwd" in
+ defineundef)
+-    util_deps='$(MINIPERL_EXE) $(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE'
++    util_deps='$(CONFIGPM) lib/auto/Cwd/Cwd$(DLSUFFIX) FORCE'
+     ;;
+ definedefine)
+     util_deps='$(PERL_EXE) $(CONFIGPM) FORCE'
+@@ -604,7 +604,7 @@ definedefine)
+ esac
+ 
+ $spitshell >>$Makefile <<!GROK!THIS!
+-utils/Makefile: \$(MINIPERL_EXE) \$(CONFIGPM) utils/Makefile.PL
++utils/Makefile: \$(CONFIGPM) utils/Makefile.PL
+ 	\$(MINIPERL) -Ilib utils/Makefile.PL
+ 
+ utilities:	utils/Makefile $util_deps
+@@ -699,7 +699,7 @@ esac
+ 
+ 
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-perlmain.c: $(MINIPERL_EXE) ext/ExtUtils-Miniperl/pm_to_blib
++perlmain.c: ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm
+ 	$(MINIPERL) -Ilib -MExtUtils::Miniperl -e 'writemain(\"perlmain.c", @ARGV)' DynaLoader $(static_ext)
+ 
+ # The file ext.libs is a list of libraries that must be linked in
+@@ -760,7 +760,7 @@ PERLEXPORT		= perl.exp
+ 	;;
+ 	esac
+ 	$spitshell >>$Makefile <<'!NO!SUBS!'
+-perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
++perl.exp: makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
+ 	./$(MINIPERLEXP) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp
+ 
+ !NO!SUBS!
+@@ -769,7 +769,7 @@ os2)
+ 	$spitshell >>$Makefile <<'!NO!SUBS!'
+ MINIPERLEXP		= miniperl
+ 
+-perl5.def: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map
++perl5.def: makedef.pl $(CONFIGPM) $(SYM) $(SYMH) miniperl.map
+ 	./$(MINIPERLEXP) makedef.pl PLATFORM=os2 -DPERL_DLL=$(PERL_DLL) CC_FLAGS="$(OPTIMIZE)" > perl5.def
+ 
+ !NO!SUBS!
+@@ -829,7 +829,7 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LIBPERLEXPORT)
+ 	true)
+ 		$spitshell >>$Makefile <<'!NO!SUBS!'
+ 	rm -f $@
+-	$(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs)
++	$(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -Wl,-soname,libperl.so.5
+ !NO!SUBS!
+ 		case "$osname" in
+ 		aix)
+@@ -877,7 +877,9 @@ $(MINIPERL_EXE): lib/buildcustomize.pl
+ 		$spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(mini_obj)
+ 	$(CC) -o $(MINIPERL_EXE) $(CLDFLAGS) $(mini_obj) $(libs)
+-	$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
++	mv -f miniperl miniperl-target
++	ln -s hostperl miniperl
++	#$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+ 	$(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+ 		;;
+@@ -885,7 +887,9 @@ lib/buildcustomize.pl: $& $(mini_obj)
+ 		$spitshell >>$Makefile <<'!NO!SUBS!'
+ lib/buildcustomize.pl: $& $(mini_obj) write    ldcustomize.pl
+ 	$(CC) -o $(MINIPERL_EXE) $(mini_obj    libs)
+-	$(LDLIBPTH) ./miniperl$(HOST    _EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
++	mv -f miniperl miniperl-target
++	ln -s hostperl miniperl
++	#$(LDLIBPTH) ./miniperl$(HOST    _EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+ 	$(MINIPERL) -f write_buildcustomize.pl    
+ !NO!SUBS!
+ 		;;
+@@ -907,7 +911,9 @@ lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl
+ 	-@rm -f miniperl.xok
+ 	$(CC) $(CLDFLAGS) $(NAMESPACEFLAGS) -o $(MINIPERL_EXE) \
+ 	    $(mini_obj) $(libs)
+-	$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
++	mv -f miniperl miniperl-target
++	ln -s hostperl miniperl
++	#$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+ 	$(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+ 		;;
+@@ -918,7 +924,9 @@ lib/buildcustomize.pl: \$& \$(mini_obj) write_buildcustomize.pl
+ 	-@rm -f miniperl.xok
+ 	-@rm \$(MINIPERL_EXE)
+ 	\$(LNS) \$(HOST_PERL) \$(MINIPERL_EXE)
+-	\$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
++	mv -f miniperl miniperl-target
++	ln -s hostperl miniperl
++	#\$(LDLIBPTH) ./miniperl\$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+ 	\$(MINIPERL) -f write_buildcustomize.pl 'osname' "$osname"
+ !GROK!THIS!
+ 		else
+@@ -927,7 +935,9 @@ lib/buildcustomize.pl: $& $(mini_obj) write_buildcustomize.pl
+ 	-@rm -f miniperl.xok
+ 	$(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ 	    $(mini_obj) $(libs)
+-	$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
++	mv -f miniperl miniperl-target
++	ln -s hostperl miniperl
++	#$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl.  Please run make minitest; exit 1'
+ 	$(MINIPERL) -f write_buildcustomize.pl
+ !NO!SUBS!
+ 		fi
+@@ -971,7 +981,7 @@ case "${osname}" in
+ catamount)
+ $spitshell >>$Makefile <<!GROK!THIS!
+ .PHONY: makeppport
+-makeppport: \$(MINIPERL_EXE) \$(CONFIGPM)
++makeppport: \$(CONFIGPM)
+ 	-@for f in Makefile.PL PPPort_pm.PL PPPort_xs.PL ppport_h.PL; do \
+ 	(cd ext/Devel-PPPort && `pwd`/run.sh ../../$(MINIPERL_EXE) -I../../lib \$\$f); \
+ 	done
+@@ -981,7 +991,7 @@ makeppport: \$(MINIPERL_EXE) \$(CONFIGPM)
+ *)
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ .PHONY: makeppport
+-makeppport: $(MINIPERL_EXE) $(CONFIGPM) $(nonxs_ext)
++makeppport: $(CONFIGPM) $(nonxs_ext)
+ 	$(MINIPERL) mkppport
+ 
+ !NO!SUBS!
+@@ -991,16 +1001,16 @@ esac
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+ 
+ .PHONY: preplibrary
+-preplibrary: $(MINIPERL_EXE) $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
++preplibrary: $(CONFIGPM) $(PREPLIBRARY_LIBPERL)
+ 
+ $(CONFIGPM_FROM_CONFIG_SH): $(CONFIGPOD)
+ 
+-$(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git.pl
++$(CONFIGPOD): config.sh configpm Porting/Glossary lib/Config_git.pl
+ 	$(MINIPERL) configpm
+ 
+ unidatafiles $(unidatafiles) pod/perluniprops.pod: uni.data
+ 
+-uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
++uni.data: $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
+ 	$(MINIPERL) lib/unicore/mktables -C lib/unicore -P pod -maketest -makelist -p
+ #	Commented out so always runs, mktables looks at far more files than we
+ #	can in this makefile to decide if needs to run or not
+@@ -1009,12 +1019,12 @@ uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
+ # $(PERL_EXE) and ext because pod_lib.pl needs Digest::MD5
+ # But also this ensures that all extensions are built before we try to scan
+ # them, which picks up Devel::PPPort's documentation.
+-pod/perltoc.pod: $(perltoc_pod_prereqs)  $(PERL_EXE) $(ext) pod/buildtoc
+-	$(RUN_PERL) -f pod/buildtoc -q
++pod/perltoc.pod: $(perltoc_pod_prereqs) $(ext) pod/buildtoc
++	$(MINIPERL) -f pod/buildtoc -q
+ 
+ pod/perlapi.pod: pod/perlintern.pod
+ 
+-pod/perlintern.pod: $(MINIPERL_EXE) autodoc.pl embed.fnc
++pod/perlintern.pod: autodoc.pl embed.fnc
+ 	$(MINIPERL) autodoc.pl
+ 
+ pod/perlmodlib.pod: $(MINIPERL_EXE) pod/perlmodlib.PL MANIFEST
+@@ -1024,7 +1034,7 @@ pod/perl5220delta.pod: pod/perldelta.pod
+ 	$(RMS) pod/perl5220delta.pod
+ 	$(LNS) perldelta.pod pod/perl5220delta.pod
+ 
+-extra.pods: $(MINIPERL_EXE)
++extra.pods:
+ 	-@test ! -f extra.pods || rm -f `cat extra.pods`
+ 	-@rm -f extra.pods
+ 	-@for x in `grep -l '^=[a-z]' README.* | grep -v README.vms` ; do \
+@@ -1068,8 +1078,7 @@ EOT
+         $spitshell >>$Makefile <<EOT
+ 
+ install_$name install-$name: \$(INSTALL_DEPENDENCE) installperl all installman
+-	\$(RUN_PERL) installperl --destdir=\$(DESTDIR) $flags \$(INSTALLFLAGS) \$(STRIPFLAGS)
+-	\$(RUN_PERL) installman --destdir=\$(DESTDIR) $flags
++	./hostperl -Ifake_config_library -Ilib -MConfig installperl --destdir=\$(DESTDIR) $flags  \$(INSTALLFLAGS) \$(STRIPFLAGS)
+ EOT
+     fi
+ 
+@@ -1079,11 +1088,7 @@ done
+ if test "X$hostperl" != X; then
+ 	$spitshell >>$Makefile <<'!NO!SUBS!'
+ install.perl:	$(INSTALL_DEPENDENCE) installperl
+-	$(HOST_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+-	-@test ! -s extras.lst || $(MAKE) extras.install
+-
+-install.man:	all installman
+-	$(HOST_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
++	./hostperl -Ifake_config_library -Ilib -MConfig installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+ 
+ # XXX Experimental. Hardwired values, but useful for testing.
+ # Eventually Configure could ask for some of these values.
+@@ -1101,24 +1106,8 @@ install.html: all installhtml
+ else
+ 	$spitshell >>$Makefile <<'!NO!SUBS!'
+ install.perl:	$(INSTALL_DEPENDENCE) installperl
+-	$(RUN_PERL) installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+-	-@test ! -s extras.lst || PATH="`pwd`:\${PATH}" PERL5LIB="`pwd`/lib" \$(RUN_PERL) -Ilib -MCPAN -e '@ARGV&&install(@ARGV)' `cat extras.lst`
++	./hostperl -Ifake_config_library -Ilib -MConfig installperl --destdir=$(DESTDIR) $(INSTALLFLAGS) $(STRIPFLAGS)
+ 
+-install.man:	all installman
+-	$(RUN_PERL) installman --destdir=$(DESTDIR) $(INSTALLFLAGS)
+-
+-# XXX Experimental. Hardwired values, but useful for testing.
+-# Eventually Configure could ask for some of these values.
+-install.html: all installhtml
+-	-@test -f README.vms && cd vms && $(LNS) ../README.vms README_vms.pod && cd ..
+-	$(RUN_PERL) installhtml   \
+-      --podroot=. --podpath=. --recurse  \
+-      --htmldir=$(privlib)/html   \
+-      --htmlroot=$(privlib)/html  \
+-      --splithead=pod/perlipc     \
+-      --splititem=pod/perlfunc    \
+-      --ignore=Porting/Maintainers.pm,Porting/pumpkin.pod,Porting/repository.pod \
+-      --verbose
+ !NO!SUBS!
+ fi
+ 
+@@ -1210,13 +1199,13 @@ manicheck:	FORCE
+ #
+ # DynaLoader may be needed for extensions that use Makefile.PL.
+ 
+-$(DYNALOADER):	$(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext)
++$(DYNALOADER): lib/buildcustomize.pl preplibrary FORCE $(nonxs_ext)
+ 	$(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
+ 
+-d_dummy $(dynamic_ext):	$(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) $(LIBPERL)
++d_dummy $(dynamic_ext):	lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE $(PERLEXPORT) $(LIBPERL)
+ 	$(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
+ 
+-s_dummy $(static_ext):	$(MINIPERL_EXE) lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
++s_dummy $(static_ext):	lib/buildcustomize.pl preplibrary makeppport $(DYNALOADER) FORCE
+ 	$(MINIPERL) make_ext.pl $@ $(MAKE_EXT_ARGS) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=static $(STATIC_LDFLAGS)
+ 
+ n_dummy $(nonxs_ext):	$(MINIPERL_EXE) lib/buildcustomize.pl preplibrary FORCE
+@@ -1405,14 +1394,14 @@ test_prep_pre: preplibrary utilities $(nonxs_ext)
+ 
+ case "$targethost" in
+ '') $spitshell >>$Makefile <<'!NO!SUBS!'
+-test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
++test_prep test-prep: test_prep_pre $(unidatafiles) $(PERL_EXE) \
+ 	$(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods)
+ 	cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+ 
+ !NO!SUBS!
+ ;;
+ *) $spitshell >>$Makefile <<!GROK!THIS!
+-test_prep test-prep: test_prep_pre \$(MINIPERL_EXE) \$(unidatafiles) \$(PERL_EXE) \
++test_prep test-prep: test_prep_pre \$(unidatafiles) \$(PERL_EXE) \
+ 	\$(dynamic_ext) \$(TEST_PERL_DLL) runtests \
+ 	\$(generated_pods)
+ 	$to libperl.*
+@@ -1465,7 +1454,7 @@ test_prep test-prep: test_prep_pre \$(MINIPERL_EXE) \$(unidatafiles) \$(PERL_EXE
+ esac
+ 
+ $spitshell >>$Makefile <<'!NO!SUBS!'
+-test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
++test_prep_reonly: $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)
+ 	$(MINIPERL) make_ext.pl $(dynamic_ext_re) MAKE="$(MAKE)" LIBPERL_A=$(LIBPERL) LINKTYPE=dynamic
+ 	cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))
+ !NO!SUBS!
+@@ -1516,7 +1505,7 @@ $spitshell >>$Makefile <<'!NO!SUBS!'
+ 
+ # Can't depend on lib/Config.pm because that might be where miniperl
+ # is crashing.
+-minitest: $(MINIPERL_EXE)
++minitest:
+ 	-@test -f lib/Config.pm || $(MAKE) lib/Config.pm $(unidatafiles)
+ 	@echo " "
+ 	@echo "You may see some irrelevant test failures if you have been unable"
diff --git a/meta/recipes-devtools/perl/perl/Makefile.patch b/meta/recipes-devtools/perl/perl/Makefile.patch
new file mode 100644
index 0000000..858e2e1
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/Makefile.patch
@@ -0,0 +1,58 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.14.2/Cross/Makefile
+===================================================================
+--- perl-5.14.2.orig/Cross/Makefile
++++ perl-5.14.2/Cross/Makefile
+@@ -1,6 +1,7 @@
+ ## Toplevel Makefile for cross-compilation of perl
+ 
+-export TOPDIR=${shell pwd}
++override TOPDIR=${shell pwd}
++export TOPDIR
+ include $(TOPDIR)/config
+ export CFLAGS
+ export SYS=$(ARCH)-$(OS)
+@@ -10,7 +11,7 @@ export OPTIMIZATION = -O2
+ 
+ export CC = $(CROSS)gcc
+ export CXX = $(CROSS)g++
+-export LD = $(CROSS)ld
++export LD = $(CC)
+ export STRIP = $(CROSS)strip
+ export AR = $(CROSS)ar
+ export RANLIB = $(CROSS)ranlib
+@@ -32,17 +33,6 @@ CFLAGS+=$(FULL_OPTIMIZATION)
+ all:
+ 	@echo Please read the README file before doing anything else.
+ 
+-gen_patch:
+-	diff -Bbur ../Makefile.SH Makefile.SH > Makefile.SH.patch
+-	diff -Bbur ../installperl installperl > installperl.patch
+-
+-patch:
+-	cd .. ; if [ ! -e ./CROSS_PATCHED ] ; then \
+-		patch -p1 < Cross/Makefile.SH.patch; \
+-		patch -p1 < Cross/installperl.patch ; mv installperl installperl-patched; \
+-		sed -e 's/XXSTRIPXX/$(SYS)/' installperl-patched > installperl; \
+-		touch CROSS_PATCHED ; fi
+-
+ perl:
+ 	@echo Perl cross-build directory is $(TOPDIR)
+ 	@echo Target arch is $(SYS)
+@@ -52,11 +42,11 @@ perl:
+ 	$(TOPDIR)/generate_config_sh config.sh-$(SYS) > $(TOPDIR)/../config.sh
+ 	cd $(TOPDIR)/.. ; ./Configure -S ; make depend ; make ; make more
+ 	cd $(TOPDIR)/.. ; mkdir -p fake_config_library ; cp lib/Config.pm lib/Config_heavy.pl fake_config_library
+-	cd $(TOPDIR)/.. ; $(MAKE) more2 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
+-	cd $(TOPDIR)/.. ; $(MAKE) more3 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
+-	cd $(TOPDIR)/.. ; $(MAKE) more4 "PERLRUN=/usr/bin/perl -I$(TOPDIR)/../fake_config_library -MConfig"
++	cd $(TOPDIR)/.. ; $(MAKE) more2 "PERLRUN=hostperl -I$(TOPDIR)/../fake_config_library -MConfig"
++	cd $(TOPDIR)/.. ; $(MAKE) more3 "PERLRUN=hostperl -I$(TOPDIR)/../fake_config_library -MConfig"
++	cd $(TOPDIR)/.. ; $(MAKE) more4 "PERLRUN=hostperl -I$(TOPDIR)/../fake_config_library -MConfig"
+ 	cd $(TOPDIR)/.. ; rm -rf install_me_here
+-	cd $(TOPDIR)/.. ; make install-strip
++#	cd $(TOPDIR)/.. ; make install-strip
+ 	cd $(TOPDIR)/.. ; sh -x Cross/warp
+ 
+ 
diff --git a/meta/recipes-devtools/perl/perl/config.sh b/meta/recipes-devtools/perl/perl/config.sh
new file mode 100644
index 0000000..9fb5042
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/config.sh
@@ -0,0 +1,1221 @@
+#!/bin/sh
+#
+# This file was produced by running the Configure script. It holds all the
+# definitions figured out by Configure. Should you modify one of these values,
+# do not forget to propagate your changes by running "Configure -der". You may
+# instead choose to run each of the .SH files by yourself, or "Configure -S".
+#
+
+# Package name      : perl5
+# Source directory  : .
+# Configuration time: Thu Jun 18 05:37:27 UTC 2015
+# Configured by     : Open Embedded
+# Target system     : linux qemux86-64 3.19.5-yocto-standard #1 smp preempt tue jun 16 00:28:17 pdt 2015 x86_64 gnulinux
+
+: Configure command line arguments.
+config_arg0='Configure'
+config_args='-des -Doptimize=-O2 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Open Embedded -Dinstallprefix=@EXECPREFIX@ -Dprefix=@EXECPREFIX@ -Dvendorprefix=@EXECPREFIX@ -Dsiteprefix=@EXECPREFIX@ -Dotherlibdirs=@LIBDIR@/perl/5.22.0 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles -Ud_dosuid -Dd_semctl_semun -Ui_db -Ui_ndbm -Ui_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 -Uversiononly -Dpager=@USRBIN@/less -isr'
+config_argc=28
+config_arg1='-des'
+config_arg2='-Doptimize=-O2'
+config_arg3='-Dmyhostname=localhost'
+config_arg4='-Dperladmin=root@localhost'
+config_arg5='-Dcc=gcc'
+config_arg6='-Dcf_by=Open Embedded'
+config_arg7='-Dinstallprefix=@EXECPREFIX@'
+config_arg8='-Dprefix=@EXECPREFIX@'
+config_arg9='-Dvendorprefix=@EXECPREFIX@'
+config_arg10='-Dsiteprefix=@EXECPREFIX@'
+config_arg11='-Dotherlibdirs=@LIBDIR@/perl/5.22.0'
+config_arg12='-Duseshrplib'
+config_arg13='-Dusethreads'
+config_arg14='-Duseithreads'
+config_arg15='-Duselargefiles'
+config_arg16='-Ud_dosuid'
+config_arg17='-Dd_semctl_semun'
+config_arg18='-Ui_db'
+config_arg19='-Ui_ndbm'
+config_arg20='-Ui_gdbm'
+config_arg21='-Di_shadow'
+config_arg22='-Di_syslog'
+config_arg23='-Dman3ext=3pm'
+config_arg24='-Duseperlio'
+config_arg25='-Dinstallusrbinperl'
+config_arg26='-Ubincompat5005'
+config_arg27='-Uversiononly'
+config_arg28='-Dpager=@USRBIN@/less -isr'
+
+Author=''
+Date=''
+Header=''
+Id=''
+Locker=''
+Log=''
+RCSfile=''
+Revision=''
+Source=''
+State=''
+_a='.a'
+_exe=''
+_o='.o'
+afs='false'
+afsroot='/afs'
+alignbytes='8'
+ansi2knr=''
+aphostname=''
+api_revision='5'
+api_subversion='0'
+api_version='22'
+api_versionstring='5.22.0'
+ar='ar'
+archlib='@LIBDIR@/perl/5.22.0/@ARCH@-thread-multi'
+archlibexp='@STAGINGDIR@@LIBDIR@/perl/5.22.0/@ARCH@-thread-multi'
+archlib_exp='@LIBDIR@/perl/5.22.0/@ARCH@-thread-multi'
+archname64=''
+archname='@ARCH@-thread-multi'
+archobjs=''
+asctime_r_proto='REENTRANT_PROTO_B_SB'
+awk='awk'
+baserev='5.0'
+bash=''
+bin='@USRBIN@'
+bin_ELF='define'
+binexp='@USRBIN@'
+bison='bison'
+byacc='byacc'
+c=''
+castflags='0'
+cat='cat'
+cc='gcc'
+cccdlflags='-fPIC'
+ccdlflags='-Wl,-E -Wl,-rpath,@LIBDIR@/perl/5.22.0/@ARCH@-thread-multi/CORE'
+ccflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
+ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
+ccname='gcc'
+ccsymbols=''
+ccversion=''
+cf_by='Open Embedded'
+cf_email='Open Embedded@localhost.localdomain'
+cf_time='Thu Jun 18 05:37:27 UTC 2015'
+charbits='8'
+charsize='1'
+chgrp=''
+chmod='chmod'
+chown=''
+clocktype='clock_t'
+comm='comm'
+compress=''
+contains='grep'
+cp='cp'
+cpio=''
+cpp='cpp'
+cpp_stuff='42'
+cppccsymbols=''
+cppflags='-D_REENTRANT -D_GNU_SOURCE -fwrapv -fno-strict-aliasing -pipe'
+cpplast='-'
+cppminus='-'
+cpprun='gcc  -E'
+cppstdin='gcc  -E'
+crypt_r_proto='REENTRANT_PROTO_B_CCS'
+cryptlib=''
+csh='csh'
+ctermid_r_proto='0'
+ctime_r_proto='REENTRANT_PROTO_B_SB'
+d_Gconvert='gcvt((x),(n),(b))'
+d_PRIEUldbl='define'
+d_PRIFUldbl='define'
+d_PRIGUldbl='define'
+d_PRIXU64='define'
+d_PRId64='define'
+d_PRIeldbl='define'
+d_PRIfldbl='define'
+d_PRIgldbl='define'
+d_PRIi64='define'
+d_PRIo64='define'
+d_PRIu64='define'
+d_PRIx64='define'
+d_SCNfldbl='define'
+d__fwalk='undef'
+d_access='define'
+d_accessx='undef'
+d_acosh='define'
+d_aintl='undef'
+d_alarm='define'
+d_archlib='define'
+d_asctime64='undef'
+d_asctime_r='define'
+d_asinh='define'
+d_atanh='define'
+d_atolf='undef'
+d_atoll='define'
+d_attribute_deprecated='define'
+d_attribute_format='define'
+d_attribute_malloc='define'
+d_attribute_nonnull='define'
+d_attribute_noreturn='define'
+d_attribute_pure='define'
+d_attribute_unused='define'
+d_attribute_warn_unused_result='define'
+d_backtrace='define'
+d_bcmp='define'
+d_bcopy='define'
+d_bsd='undef'
+d_bsdgetpgrp='undef'
+d_bsdsetpgrp='undef'
+d_builtin_choose_expr='define'
+d_builtin_expect='define'
+d_bzero='define'
+d_c99_variadic_macros='define'
+d_casti32='define'
+d_castneg='define'
+d_cbrt='define'
+d_charvspr='undef'
+d_chown='define'
+d_chroot='define'
+d_chsize='undef'
+d_class='undef'
+d_clearenv='define'
+d_closedir='define'
+d_cmsghdr_s='define'
+d_const='define'
+d_copysign='define'
+d_copysignl='define'
+d_cplusplus='undef'
+d_crypt='define'
+d_crypt_r='define'
+d_csh='undef'
+d_ctermid='define'
+d_ctermid_r='undef'
+d_ctime64='undef'
+d_ctime_r='define'
+d_cuserid='define'
+d_dbl_dig='define'
+d_dbminitproto='define'
+d_difftime64='undef'
+d_difftime='define'
+d_dir_dd_fd='undef'
+d_dirfd='define'
+d_dirnamlen='undef'
+d_dladdr='define'
+d_dlerror='define'
+d_dlopen='define'
+d_dlsymun='undef'
+d_dosuid='undef'
+d_drand48_r='define'
+d_drand48proto='define'
+d_dup2='define'
+d_eaccess='define'
+d_endgrent='define'
+d_endgrent_r='undef'
+d_endhent='define'
+d_endhostent_r='undef'
+d_endnent='define'
+d_endnetent_r='undef'
+d_endpent='define'
+d_endprotoent_r='undef'
+d_endpwent='define'
+d_endpwent_r='undef'
+d_endsent='define'
+d_endservent_r='undef'
+d_eofnblk='define'
+d_erf='define'
+d_erfc='define'
+d_eunice='undef'
+d_exp2='define'
+d_expm1='define'
+d_faststdio='undef'
+d_fchdir='define'
+d_fchmod='define'
+d_fchown='define'
+d_fcntl='define'
+d_fcntl_can_lock='define'
+d_fd_macros='define'
+d_fd_set='define'
+d_fdim='define'
+d_fds_bits='define'
+d_fegetround='define'
+d_fgetpos='define'
+d_finite='define'
+d_finitel='define'
+d_flexfnam='define'
+d_flock='define'
+d_flockproto='define'
+d_fma='define'
+d_fmax='define'
+d_fmin='define'
+d_fork='define'
+d_fp_class='undef'
+d_fp_classify='undef'
+d_fp_classl='undef'
+d_fpathconf='define'
+d_fpclass='undef'
+d_fpclassify='define'
+d_fpclassl='undef'
+d_fpgetround='undef'
+d_fpos64_t='undef'
+d_frexpl='define'
+d_fs_data_s='undef'
+d_fseeko='define'
+d_fsetpos='define'
+d_fstatfs='define'
+d_fstatvfs='define'
+d_fsync='define'
+d_ftello='define'
+d_ftime='undef'
+d_futimes='define'
+d_gdbm_ndbm_h_uses_prototypes='undef'
+d_gdbmndbm_h_uses_prototypes='define'
+d_getaddrinfo='define'
+d_getcwd='define'
+d_getespwnam='undef'
+d_getfsstat='undef'
+d_getgrent='define'
+d_getgrent_r='define'
+d_getgrgid_r='define'
+d_getgrnam_r='define'
+d_getgrps='define'
+d_gethbyaddr='define'
+d_gethbyname='define'
+d_gethent='define'
+d_gethname='define'
+d_gethostbyaddr_r='define'
+d_gethostbyname_r='define'
+d_gethostent_r='define'
+d_gethostprotos='define'
+d_getitimer='define'
+d_getlogin='define'
+d_getlogin_r='define'
+d_getmnt='undef'
+d_getmntent='define'
+d_getnameinfo='define'
+d_getnbyaddr='define'
+d_getnbyname='define'
+d_getnent='define'
+d_getnetbyaddr_r='define'
+d_getnetbyname_r='define'
+d_getnetent_r='define'
+d_getnetprotos='define'
+d_getpagsz='define'
+d_getpbyname='define'
+d_getpbynumber='define'
+d_getpent='define'
+d_getpgid='define'
+d_getpgrp2='undef'
+d_getpgrp='define'
+d_getppid='define'
+d_getprior='define'
+d_getprotobyname_r='define'
+d_getprotobynumber_r='define'
+d_getprotoent_r='define'
+d_getprotoprotos='define'
+d_getprpwnam='undef'
+d_getpwent='define'
+d_getpwent_r='define'
+d_getpwnam_r='define'
+d_getpwuid_r='define'
+d_getsbyname='define'
+d_getsbyport='define'
+d_getsent='define'
+d_getservbyname_r='define'
+d_getservbyport_r='define'
+d_getservent_r='define'
+d_getservprotos='define'
+d_getspnam='define'
+d_getspnam_r='define'
+d_gettimeod='define'
+d_gmtime64='undef'
+d_gmtime_r='define'
+d_gnulibc='define'
+d_grpasswd='define'
+d_hasmntopt='define'
+d_htonl='define'
+d_hypot='define'
+d_ilogb='define'
+d_ilogbl='define'
+d_inc_version_list='undef'
+d_index='undef'
+d_inetaton='define'
+d_inetntop='define'
+d_inetpton='define'
+d_int64_t='define'
+d_ip_mreq='define'
+d_ip_mreq_source='define'
+d_ipv6_mreq='define'
+d_ipv6_mreq_source='undef'
+d_isascii='define'
+d_isblank='define'
+d_isfinite='define'
+d_isfinitel='undef'
+d_isinf='define'
+d_isinfl='define'
+d_isless='undef'
+d_isnan='define'
+d_isnanl='define'
+d_isnormal='define'
+d_j0='define'
+d_j0l='define'
+d_killpg='define'
+d_lc_monetary_2008='define'
+d_lchown='define'
+d_ldbl_dig='define'
+d_ldexpl='define'
+d_lgamma='define'
+d_lgamma_r='define'
+d_libm_lib_version='define'
+d_libname_unique='undef'
+d_link='define'
+d_llrint='define'
+d_llrintl='define'
+d_llround='define'
+d_llroundl='define'
+d_localtime64='undef'
+d_localtime_r='define'
+d_localtime_r_needs_tzset='define'
+d_locconv='define'
+d_lockf='define'
+d_log1p='define'
+d_log2='define'
+d_logb='define'
+d_longdbl='define'
+d_longlong='define'
+d_lrint='define'
+d_lrintl='define'
+d_lround='define'
+d_lroundl='define'
+d_lseekproto='define'
+d_lstat='define'
+d_madvise='define'
+d_malloc_good_size='undef'
+d_malloc_size='undef'
+d_mblen='define'
+d_mbstowcs='define'
+d_mbtowc='define'
+d_memchr='define'
+d_memcmp='define'
+d_memcpy='define'
+d_memmove='define'
+d_memset='define'
+d_mkdir='define'
+d_mkdtemp='define'
+d_mkfifo='define'
+d_mkstemp='define'
+d_mkstemps='define'
+d_mktime64='undef'
+d_mktime='define'
+d_mmap='define'
+d_modfl='define'
+d_modfl_pow32_bug='undef'
+d_modflproto='define'
+d_mprotect='define'
+d_msg='define'
+d_msg_ctrunc='define'
+d_msg_dontroute='define'
+d_msg_oob='define'
+d_msg_peek='define'
+d_msg_proxy='define'
+d_msgctl='define'
+d_msgget='define'
+d_msghdr_s='define'
+d_msgrcv='define'
+d_msgsnd='define'
+d_msync='define'
+d_munmap='define'
+d_mymalloc='undef'
+d_nan='define'
+d_ndbm='define'
+d_ndbm_h_uses_prototypes='undef'
+d_nearbyint='define'
+d_nextafter='define'
+d_nexttoward='define'
+d_nice='define'
+d_nl_langinfo='define'
+d_nv_preserves_uv='undef'
+d_nv_zero_is_allbits_zero='define'
+d_off64_t='define'
+d_old_pthread_create_joinable='undef'
+d_oldpthreads='undef'
+d_oldsock='undef'
+d_open3='define'
+d_pathconf='define'
+d_pause='define'
+d_perl_otherlibdirs='define'
+d_phostname='undef'
+d_pipe='define'
+d_poll='define'
+d_portable='define'
+d_prctl='define'
+d_prctl_set_name='define'
+d_printf_format_null='undef'
+d_procselfexe='define'
+d_pseudofork='undef'
+d_pthread_atfork='define'
+d_pthread_attr_setscope='define'
+d_pthread_yield='define'
+d_ptrdiff_t='define'
+d_pwage='undef'
+d_pwchange='undef'
+d_pwclass='undef'
+d_pwcomment='undef'
+d_pwexpire='undef'
+d_pwgecos='define'
+d_pwpasswd='define'
+d_pwquota='undef'
+d_qgcvt='define'
+d_quad='define'
+d_random_r='define'
+d_re_comp='undef'
+d_readdir64_r='define'
+d_readdir='define'
+d_readdir_r='define'
+d_readlink='define'
+d_readv='define'
+d_recvmsg='define'
+d_regcmp='undef'
+d_regcomp='define'
+d_remainder='define'
+d_remquo='define'
+d_rename='define'
+d_rewinddir='define'
+d_rint='define'
+d_rmdir='define'
+d_round='define'
+d_safebcpy='undef'
+d_safemcpy='undef'
+d_sanemcmp='define'
+d_sbrkproto='define'
+d_scalbn='define'
+d_scalbnl='define'
+d_sched_yield='define'
+d_scm_rights='define'
+d_seekdir='define'
+d_select='define'
+d_sem='define'
+d_semctl='define'
+d_semctl_semid_ds='define'
+d_semctl_semun='define'
+d_semget='define'
+d_semop='define'
+d_sendmsg='define'
+d_setegid='define'
+d_seteuid='define'
+d_setgrent='define'
+d_setgrent_r='undef'
+d_setgrps='define'
+d_sethent='define'
+d_sethostent_r='undef'
+d_setitimer='define'
+d_setlinebuf='define'
+d_setlocale='define'
+d_setlocale_r='undef'
+d_setnent='define'
+d_setnetent_r='undef'
+d_setpent='define'
+d_setpgid='define'
+d_setpgrp2='undef'
+d_setpgrp='define'
+d_setprior='define'
+d_setproctitle='undef'
+d_setprotoent_r='undef'
+d_setpwent='define'
+d_setpwent_r='undef'
+d_setregid='define'
+d_setresgid='define'
+d_setresuid='define'
+d_setreuid='define'
+d_setrgid='undef'
+d_setruid='undef'
+d_setsent='define'
+d_setservent_r='undef'
+d_setsid='define'
+d_setvbuf='define'
+d_shm='define'
+d_shmat='define'
+d_shmatprototype='define'
+d_shmctl='define'
+d_shmdt='define'
+d_shmget='define'
+d_sigaction='define'
+d_signbit='define'
+d_sigprocmask='define'
+d_sigsetjmp='define'
+d_sin6_scope_id='define'
+d_sitearch='define'
+d_snprintf='define'
+d_sockaddr_in6='define'
+d_sockaddr_sa_len='undef'
+d_sockatmark='define'
+d_sockatmarkproto='define'
+d_socket='define'
+d_socklen_t='define'
+d_sockpair='define'
+d_socks5_init='undef'
+d_sprintf_returns_strlen='define'
+d_sqrtl='define'
+d_srand48_r='define'
+d_srandom_r='define'
+d_sresgproto='define'
+d_sresuproto='define'
+d_stat='define'
+d_statblks='define'
+d_statfs_f_flags='define'
+d_statfs_s='define'
+d_static_inline='define'
+d_statvfs='define'
+d_stdio_cnt_lval='undef'
+d_stdio_ptr_lval='undef'
+d_stdio_ptr_lval_nochange_cnt='undef'
+d_stdio_ptr_lval_sets_cnt='undef'
+d_stdio_stream_array='undef'
+d_stdiobase='undef'
+d_stdstdio='undef'
+d_strchr='define'
+d_strcoll='define'
+d_strctcpy='define'
+d_strerrm='strerror(e)'
+d_strerror='define'
+d_strerror_r='define'
+d_strftime='define'
+d_strlcat='undef'
+d_strlcpy='undef'
+d_strtod='define'
+d_strtol='define'
+d_strtold='define'
+d_strtoll='define'
+d_strtoq='define'
+d_strtoul='define'
+d_strtoull='define'
+d_strtouq='define'
+d_strxfrm='define'
+d_suidsafe='undef'
+d_symlink='define'
+d_syscall='define'
+d_syscallproto='define'
+d_sysconf='define'
+d_sysernlst=''
+d_syserrlst='define'
+d_system='define'
+d_tcgetpgrp='define'
+d_tcsetpgrp='define'
+d_telldir='define'
+d_telldirproto='define'
+d_tgamma='define'
+d_time='define'
+d_timegm='define'
+d_times='define'
+d_tm_tm_gmtoff='define'
+d_tm_tm_zone='define'
+d_tmpnam_r='define'
+d_trunc='define'
+d_truncate='define'
+d_truncl='define'
+d_ttyname_r='define'
+d_tzname='define'
+d_u32align='define'
+d_ualarm='define'
+d_umask='define'
+d_uname='define'
+d_union_semun='undef'
+d_unordered='undef'
+d_unsetenv='define'
+d_usleep='define'
+d_usleepproto='define'
+d_ustat='define'
+d_vendorarch='define'
+d_vendorbin='define'
+d_vendorlib='define'
+d_vendorscript='define'
+d_vfork='undef'
+d_void_closedir='undef'
+d_voidsig='define'
+d_voidtty=''
+d_volatile='define'
+d_vprintf='define'
+d_vsnprintf='define'
+d_wait4='define'
+d_waitpid='define'
+d_wcscmp='define'
+d_wcstombs='define'
+d_wcsxfrm='define'
+d_wctomb='define'
+d_writev='define'
+d_xenix='undef'
+date='date'
+db_hashtype='u_int32_t'
+db_prefixtype='size_t'
+db_version_major=''
+db_version_minor=''
+db_version_patch=''
+direntrytype='struct dirent'
+dlext='so'
+dlsrc='dl_dlopen.xs'
+doublekind='3'
+doublesize='8'
+drand01='Perl_drand48()'
+drand48_r_proto='REENTRANT_PROTO_I_ST'
+dtrace=''
+dynamic_ext='B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate XS/APItest XS/Typemap arybase attributes mro re threads threads/shared'
+eagain='EAGAIN'
+ebcdic='undef'
+echo='echo'
+egrep='egrep'
+emacs=''
+endgrent_r_proto='0'
+endhostent_r_proto='0'
+endnetent_r_proto='0'
+endprotoent_r_proto='0'
+endpwent_r_proto='0'
+endservent_r_proto='0'
+eunicefix=':'
+exe_ext=''
+expr='expr'
+extensions='B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper Devel/PPPort Devel/Peek Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util MIME/Base64 Math/BigInt/FastCalc NDBM_File ODBM_File Opcode POSIX PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via SDBM_File Socket Storable Sys/Hostname Sys/Syslog Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate XS/APItest XS/Typemap arybase attributes mro re threads threads/shared Archive/Tar Attribute/Handlers AutoLoader B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Config/Perl/V Devel/SelfStubber Digest Dumpvalue Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NEXT Net/Ping Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local Unicode/Normalize XSLoader autodie autouse base bignum constant encoding/warnings experimental if lib libnet parent perlfaq podlators version'
+extern_C='extern'
+extras=''
+fflushNULL='define'
+fflushall='undef'
+find=''
+firstmakefile='makefile'
+flex=''
+fpossize='16'
+fpostype='fpos_t'
+freetype='void'
+from=':'
+full_ar='ar'
+full_csh='csh'
+full_sed='sed'
+gccansipedantic=''
+gccosandvers=''
+gccversion='4.9.2'
+getgrent_r_proto='REENTRANT_PROTO_I_SBWR'
+getgrgid_r_proto='REENTRANT_PROTO_I_TSBWR'
+getgrnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+gethostbyaddr_r_proto='REENTRANT_PROTO_I_TsISBWRE'
+gethostbyname_r_proto='REENTRANT_PROTO_I_CSBWRE'
+gethostent_r_proto='REENTRANT_PROTO_I_SBWRE'
+getlogin_r_proto='REENTRANT_PROTO_I_BW'
+getnetbyaddr_r_proto='REENTRANT_PROTO_I_uISBWRE'
+getnetbyname_r_proto='REENTRANT_PROTO_I_CSBWRE'
+getnetent_r_proto='REENTRANT_PROTO_I_SBWRE'
+getprotobyname_r_proto='REENTRANT_PROTO_I_CSBWR'
+getprotobynumber_r_proto='REENTRANT_PROTO_I_ISBWR'
+getprotoent_r_proto='REENTRANT_PROTO_I_SBWR'
+getpwent_r_proto='REENTRANT_PROTO_I_SBWR'
+getpwnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+getpwuid_r_proto='REENTRANT_PROTO_I_TSBWR'
+getservbyname_r_proto='REENTRANT_PROTO_I_CCSBWR'
+getservbyport_r_proto='REENTRANT_PROTO_I_ICSBWR'
+getservent_r_proto='REENTRANT_PROTO_I_SBWR'
+getspnam_r_proto='REENTRANT_PROTO_I_CSBWR'
+gidformat='"u"'
+gidsign='1'
+gidsize='4'
+gidtype='gid_t'
+glibpth='@EXECPREFIX@/shlib  @BASELIBDIR@ @LIBDIR@ @LIBDIR@/386 @BASELIBDIR@386 @EXECPREFIX@/ccs@BASELIBDIR@ @EXECPREFIX@/ucblib @EXECPREFIX@/local@BASELIBDIR@ @BASELIBDIR@ @LIBDIR@ @EXECPREFIX@/local@BASELIBDIR@ '
+gmake='gmake'
+gmtime_r_proto='REENTRANT_PROTO_S_TS'
+gnulibc_version='2.21'
+grep='grep'
+groupcat='cat /etc/group'
+groupstype='gid_t'
+gzip='gzip'
+h_fcntl='false'
+h_sysfile='true'
+hint='recommended'
+hostcat='cat /etc/hosts'
+hostgenerate=''
+hostosname=''
+hostperl=''
+html1dir=' '
+html1direxp=''
+html3dir=' '
+html3direxp=''
+i16size='2'
+i16type='short'
+i32size='4'
+i32type='int'
+i64size='8'
+i64type='long'
+i8size='1'
+i8type='signed char'
+i_arpainet='define'
+i_assert='define'
+i_bfd='define'
+i_bsdioctl=''
+i_crypt='define'
+i_db='undef'
+i_dbm='define'
+i_dirent='define'
+i_dlfcn='define'
+i_execinfo='define'
+i_fcntl='undef'
+i_fenv='define'
+i_float='define'
+i_fp='undef'
+i_fp_class='undef'
+i_gdbm='undef'
+i_gdbm_ndbm='undef'
+i_gdbmndbm='define'
+i_grp='define'
+i_ieeefp='undef'
+i_inttypes='define'
+i_langinfo='define'
+i_libutil='undef'
+i_limits='define'
+i_locale='define'
+i_machcthr='undef'
+i_malloc='define'
+i_mallocmalloc='undef'
+i_math='define'
+i_memory='undef'
+i_mntent='define'
+i_ndbm='undef'
+i_netdb='define'
+i_neterrno='undef'
+i_netinettcp='define'
+i_niin='define'
+i_poll='define'
+i_prot='undef'
+i_pthread='define'
+i_pwd='define'
+i_quadmath='undef'
+i_rpcsvcdbm='undef'
+i_sgtty='undef'
+i_shadow='define'
+i_socks='undef'
+i_stdarg='define'
+i_stdbool='define'
+i_stddef='define'
+i_stdint='define'
+i_stdlib='define'
+i_string='define'
+i_sunmath='undef'
+i_sysaccess='undef'
+i_sysdir='define'
+i_sysfile='define'
+i_sysfilio='undef'
+i_sysin='undef'
+i_sysioctl='define'
+i_syslog='define'
+i_sysmman='define'
+i_sysmode='undef'
+i_sysmount='define'
+i_sysndir='undef'
+i_sysparam='define'
+i_syspoll='define'
+i_sysresrc='define'
+i_syssecrt='undef'
+i_sysselct='define'
+i_syssockio='undef'
+i_sysstat='define'
+i_sysstatfs='define'
+i_sysstatvfs='define'
+i_systime='define'
+i_systimek='undef'
+i_systimes='define'
+i_systypes='define'
+i_sysuio='define'
+i_sysun='define'
+i_sysutsname='define'
+i_sysvfs='define'
+i_syswait='define'
+i_termio='undef'
+i_termios='define'
+i_time='define'
+i_unistd='define'
+i_ustat='define'
+i_utime='define'
+i_values='define'
+i_varargs='undef'
+i_varhdr='stdarg.h'
+i_vfork='undef'
+ignore_versioned_solibs='y'
+inc_version_list=' '
+inc_version_list_init='0'
+incpath=''
+inews=''
+initialinstalllocation='@USRBIN@'
+installarchlib='@LIBDIR@/perl/5.22.0/@ARCH@-thread-multi'
+installbin='@USRBIN@'
+installhtml1dir=''
+installhtml3dir=''
+installman1dir=''
+installman3dir=''
+installprefix='@EXECPREFIX@'
+installprefixexp='@EXECPREFIX@'
+installprivlib='@LIBDIR@/perl/5.22.0'
+installscript='@USRBIN@'
+installsitearch='@LIBDIR@/perl/site_perl/5.22.0/@ARCH@-thread-multi'
+installsitebin='@USRBIN@'
+installsitehtml1dir=''
+installsitehtml3dir=''
+installsitelib='@LIBDIR@/perl/site_perl/5.22.0'
+installsiteman1dir=''
+installsiteman3dir=''
+installsitescript='@USRBIN@'
+installstyle='lib/perl'
+installusrbinperl='define'
+installvendorarch='@LIBDIR@/perl/vendor_perl/5.22.0/@ARCH@-thread-multi'
+installvendorbin='@USRBIN@'
+installvendorhtml1dir=''
+installvendorhtml3dir=''
+installvendorlib='@LIBDIR@/perl/vendor_perl/5.22.0'
+installvendorman1dir=''
+installvendorman3dir=''
+installvendorscript='@USRBIN@'
+intsize='4'
+issymlink='test -h'
+ivdformat='"ld"'
+ivsize='8'
+ivtype='long'
+known_extensions='Archive/Tar Attribute/Handlers AutoLoader B B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Compress/Raw/Bzip2 Compress/Raw/Zlib Config/Perl/V Cwd DB_File Data/Dumper Devel/PPPort Devel/Peek Devel/SelfStubber Digest Digest/MD5 Digest/SHA Dumpvalue Encode Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS Fcntl File/DosGlob File/Fetch File/Find File/Glob File/Path File/Temp FileCache Filter/Simple Filter/Util/Call GDBM_File Getopt/Long HTTP/Tiny Hash/Util Hash/Util/FieldHash I18N/Collate I18N/LangTags I18N/Langinfo IO IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 IPC/SysV JSON/PP List/Util Locale/Codes Locale/Maketext Locale/Maketext/Simple MIME/Base64 Math/BigInt Math/BigInt/FastCalc Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NDBM_File NEXT Net/Ping ODBM_File Opcode POSIX Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage SDBM_File Safe Search/Dict SelfLoader Socket Storable Sys/Hostname Sys/Syslog Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Hash/NamedCapture Tie/Memoize Tie/RefHash Time/HiRes Time/Local Time/Piece Unicode/Collate Unicode/Normalize VMS/DCLsym VMS/Filespec VMS/Stdio Win32 Win32API/File Win32CORE XS/APItest XS/Typemap XSLoader arybase attributes autodie autouse base bignum constant encoding/warnings experimental if lib libnet mro parent perlfaq podlators re threads threads/shared version '
+ksh=''
+ld='gcc'
+ld_can_script='define'
+lddlflags='-shared -O2'
+ldflags=''
+ldflags_uselargefiles=''
+ldlibpthname='LD_LIBRARY_PATH'
+less='less'
+lib_ext='.a'
+libc='libc-2.21.so'
+libperl='libperl.so'
+libpth='@LIBDIR@ @BASELIBDIR@'
+libs='-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat'
+libsdirs=' @LIBDIR@'
+libsfiles=' libpthread.so libnsl.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so'
+libsfound=' @LIBDIR@/libpthread.so @LIBDIR@/libnsl.so @LIBDIR@/libgdbm.so @LIBDIR@/libdb.so @LIBDIR@/libdl.so @LIBDIR@/libm.so @LIBDIR@/libcrypt.so @LIBDIR@/libutil.so @LIBDIR@/libc.so @LIBDIR@/libgdbm_compat.so'
+libspath=' @LIBDIR@ @BASELIBDIR@'
+libswanted='cl pthread socket inet nsl nm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat'
+libswanted_uselargefiles=''
+line=''
+lint=''
+lkflags=''
+ln='ln'
+lns='/bin/ln -s'
+localtime_r_proto='REENTRANT_PROTO_S_TS'
+locincpth='@EXECPREFIX@/local/include /opt/local/include @EXECPREFIX@/gnu/include /opt/gnu/include @EXECPREFIX@/GNU/include /opt/GNU/include'
+loclibpth='@EXECPREFIX@/local@BASELIBDIR@ /opt/local@BASELIBDIR@ @EXECPREFIX@/gnu@BASELIBDIR@ /opt/gnu@BASELIBDIR@ @EXECPREFIX@/GNU@BASELIBDIR@ /opt/GNU@BASELIBDIR@'
+longdblkind='3'
+longdblsize='16'
+longlongsize='8'
+longsize='8'
+lp=''
+lpr=''
+ls='ls'
+lseeksize='8'
+lseektype='off_t'
+mail=''
+mailx=''
+make='make'
+make_set_make='#'
+mallocobj=''
+mallocsrc=''
+malloctype='void *'
+man1dir=' '
+man1direxp=''
+man1ext='0'
+man3dir=' '
+man3direxp=''
+man3ext='0'
+mips_type=''
+mistrustnm=''
+mkdir='mkdir'
+mmaptype='void *'
+modetype='mode_t'
+more='more'
+multiarch='undef'
+mv=''
+myarchname='@ARCH@'
+mydomain='.localdomain'
+myhostname='localhost'
+myuname='linux qemux86-64 3.19.5-yocto-standard #1 smp preempt tue jun 16 00:28:17 pdt 2015 x86_64 gnulinux '
+n='-n'
+need_va_copy='define'
+netdb_hlen_type='size_t'
+netdb_host_type='char *'
+netdb_name_type='const char *'
+netdb_net_type='in_addr_t'
+nm='nm'
+nm_opt=''
+nm_so_opt='--dynamic'
+nonxs_ext='Archive/Tar Attribute/Handlers AutoLoader B/Debug CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Carp Config/Perl/V Devel/SelfStubber Digest Dumpvalue Env Errno Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata NEXT Net/Ping Params/Check Parse/CPAN/Meta Perl/OSType PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local Unicode/Normalize XSLoader autodie autouse base bignum constant encoding/warnings experimental if lib libnet parent perlfaq podlators version'
+nroff='nroff'
+nvEUformat='"E"'
+nvFUformat='"F"'
+nvGUformat='"G"'
+nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0'
+nv_preserves_uv_bits='53'
+nveformat='"e"'
+nvfformat='"f"'
+nvgformat='"g"'
+nvsize='8'
+nvtype='double'
+o_nonblock='O_NONBLOCK'
+obj_ext='.o'
+old_pthread_create_joinable=''
+optimize='-O2'
+orderlib='false'
+osname='linux'
+osvers='3.19.5-yocto-standard'
+otherlibdirs='@LIBDIR@/perl/5.22.0'
+package='perl'
+pager='/usr/bin/less -isr'
+passcat='cat /etc/passwd'
+patchlevel='22'
+path_sep=':'
+perl5='@USRBIN@/perl'
+perl='perl'
+perl_patchlevel=''
+perl_static_inline='static __inline__'
+perladmin='root@localhost'
+perllibs='-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc'
+perlpath='@USRBIN@/perl'
+pg='pg'
+phostname=''
+pidtype='pid_t'
+plibpth='@LIBDIR@ @BASELIBDIR@'
+pmake=''
+pr=''
+prefix='@EXECPREFIX@'
+prefixexp='@EXECPREFIX@'
+privlib='@LIBDIR@/perl/5.22.0'
+privlibexp='@LIBDIR@/perl/5.22.0'
+procselfexe='"/proc/self/exe"'
+prototype='define'
+ptrsize='8'
+quadkind='2'
+quadtype='long'
+randbits='48'
+randfunc='Perl_drand48'
+random_r_proto='REENTRANT_PROTO_I_St'
+randseedtype='U32'
+ranlib=':'
+rd_nodata='-1'
+readdir64_r_proto='REENTRANT_PROTO_I_TSR'
+readdir_r_proto='REENTRANT_PROTO_I_TSR'
+revision='5'
+rm='rm'
+rm_try='/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*'
+rmail=''
+run=''
+runnm='false'
+sGMTIME_max='67768036191676799'
+sGMTIME_min='-62167219200'
+sLOCALTIME_max='67768036191676799'
+sLOCALTIME_min='-62167219200'
+sPRIEUldbl='"LE"'
+sPRIFUldbl='"LF"'
+sPRIGUldbl='"LG"'
+sPRIXU64='"lX"'
+sPRId64='"ld"'
+sPRIeldbl='"Le"'
+sPRIfldbl='"Lf"'
+sPRIgldbl='"Lg"'
+sPRIi64='"li"'
+sPRIo64='"lo"'
+sPRIu64='"lu"'
+sPRIx64='"lx"'
+sSCNfldbl='"Lf"'
+sched_yield='sched_yield()'
+scriptdir='@USRBIN@'
+scriptdirexp='@USRBIN@'
+sed='sed'
+seedfunc='Perl_drand48_init'
+selectminbits='64'
+selecttype='fd_set *'
+sendmail=''
+setgrent_r_proto='0'
+sethostent_r_proto='0'
+setlocale_r_proto='0'
+setnetent_r_proto='0'
+setprotoent_r_proto='0'
+setpwent_r_proto='0'
+setservent_r_proto='0'
+sh='/bin/sh'
+shar=''
+sharpbang='#!'
+shmattype='void *'
+shortsize='2'
+shrpenv=''
+shsharp='true'
+sig_count='65'
+sig_name='ZERO HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH IO PWR SYS NUM32 NUM33 RTMIN NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 NUM63 RTMAX IOT CLD POLL UNUSED '
+sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "BUS", "FPE", "KILL", "USR1", "SEGV", "USR2", "PIPE", "ALRM", "TERM", "STKFLT", "CHLD", "CONT", "STOP", "TSTP", "TTIN", "TTOU", "URG", "XCPU", "XFSZ", "VTALRM", "PROF", "WINCH", "IO", "PWR", "SYS", "NUM32", "NUM33", "RTMIN", "NUM35", "NUM36", "NUM37", "NUM38", "NUM39", "NUM40", "NUM41", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "NUM63", "RTMAX", "IOT", "CLD", "POLL", "UNUSED", 0'
+sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 6 17 29 31 '
+sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 6, 17, 29, 31, 0'
+sig_size='69'
+signal_t='void'
+sitearch='@LIBDIR@/perl/site_perl/5.22.0/@ARCH@-thread-multi'
+sitearchexp='@LIBDIR@/perl/site_perl/5.22.0/@ARCH@-thread-multi'
+sitebin='@USRBIN@'
+sitebinexp='@USRBIN@'
+sitehtml1dir=''
+sitehtml1direxp=''
+sitehtml3dir=''
+sitehtml3direxp=''
+sitelib='@LIBDIR@/perl/site_perl/5.22.0'
+sitelib_stem='@LIBDIR@/perl/site_perl'
+sitelibexp='@LIBDIR@/perl/site_perl/5.22.0'
+siteman1dir=''
+siteman1direxp=''
+siteman3dir=''
+siteman3direxp=''
+siteprefix='@EXECPREFIX@'
+siteprefixexp='@EXECPREFIX@'
+sitescript='@USRBIN@'
+sitescriptexp='@USRBIN@'
+sizesize='8'
+sizetype='size_t'
+sleep=''
+smail=''
+so='so'
+sockethdr=''
+socketlib=''
+socksizetype='socklen_t'
+sort='sort'
+spackage='Perl5'
+spitshell='cat'
+srand48_r_proto='REENTRANT_PROTO_I_LS'
+srandom_r_proto='REENTRANT_PROTO_I_TS'
+src='.'
+ssizetype='ssize_t'
+st_ino_sign='1'
+st_ino_size='8'
+startperl='#!@USRBIN@/perl'
+startsh='#!/bin/sh'
+static_ext=' '
+stdchar='char'
+stdio_base='((fp)->_IO_read_base)'
+stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)'
+stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
+stdio_filbuf=''
+stdio_ptr='((fp)->_IO_read_ptr)'
+stdio_stream_array=''
+strerror_r_proto='REENTRANT_PROTO_B_IBW'
+strings='@INCLUDEDIR@/string.h'
+submit=''
+subversion='0'
+sysman='@EXECPREFIX@/share/man/man1'
+sysroot=''
+tail=''
+tar=''
+targetarch=''
+targetdir=''
+targetenv=''
+targethost=''
+targetmkdir=''
+targetport=''
+targetsh='/bin/sh'
+tbl=''
+tee=''
+test='test'
+timeincl='@INCLUDEDIR@/sys/time.h @INCLUDEDIR@/time.h '
+timetype='time_t'
+tmpnam_r_proto='REENTRANT_PROTO_B_B'
+to=':'
+touch='touch'
+tr='tr'
+trnl='\n'
+troff=''
+ttyname_r_proto='REENTRANT_PROTO_I_IBW'
+u16size='2'
+u16type='unsigned short'
+u32size='4'
+u32type='unsigned int'
+u64size='8'
+u64type='unsigned long'
+u8size='1'
+u8type='unsigned char'
+uidformat='"u"'
+uidsign='1'
+uidsize='4'
+uidtype='uid_t'
+uname='uname'
+uniq='uniq'
+uquadtype='unsigned long'
+use5005threads='undef'
+use64bitall='define'
+use64bitint='define'
+usecbacktrace='undef'
+usecrosscompile='define'
+usedevel='undef'
+usedl='define'
+usedtrace='undef'
+usefaststdio='undef'
+useithreads='define'
+usekernprocpathname='undef'
+uselargefiles='define'
+uselongdouble='undef'
+usemallocwrap='define'
+usemorebits='undef'
+usemultiplicity='define'
+usemymalloc='n'
+usenm='false'
+usensgetexecutablepath='undef'
+useopcode='true'
+useperlio='define'
+useposix='true'
+usequadmath='undef'
+usereentrant='undef'
+userelocatableinc='undef'
+useshrplib='true'
+usesitecustomize='undef'
+usesocks='undef'
+usethreads='define'
+usevendorprefix='define'
+useversionedarchname='undef'
+usevfork='false'
+usrinc='@INCLUDEDIR@'
+uuname=''
+uvXUformat='"lX"'
+uvoformat='"lo"'
+uvsize='8'
+uvtype='unsigned long'
+uvuformat='"lu"'
+uvxformat='"lx"'
+vaproto='define'
+vendorarch='@LIBDIR@/perl/vendor_perl/5.22.0/@ARCH@-thread-multi'
+vendorarchexp='@LIBDIR@/perl/vendor_perl/5.22.0/@ARCH@-thread-multi'
+vendorbin='@USRBIN@'
+vendorbinexp='@USRBIN@'
+vendorhtml1dir=' '
+vendorhtml1direxp=''
+vendorhtml3dir=' '
+vendorhtml3direxp=''
+vendorlib='@LIBDIR@/perl/vendor_perl/5.22.0'
+vendorlib_stem='@LIBDIR@/perl/vendor_perl'
+vendorlibexp='@LIBDIR@/perl/vendor_perl/5.22.0'
+vendorman1dir=' '
+vendorman1direxp=''
+vendorman3dir=' '
+vendorman3direxp=''
+vendorprefix='@EXECPREFIX@'
+vendorprefixexp='@EXECPREFIX@'
+vendorscript='@USRBIN@'
+vendorscriptexp='@USRBIN@'
+version='5.22.0'
+version_patchlevel_string='version 22 subversion 0'
+versiononly='undef'
+vi=''
+xlibpth='@LIBDIR@/386 @BASELIBDIR@386'
+yacc='yacc'
+yaccflags=''
+zcat=''
+zip='zip'
+PERL_REVISION=5
+PERL_VERSION=22
+PERL_SUBVERSION=0
+PERL_API_REVISION=5
+PERL_API_VERSION=22
+PERL_API_SUBVERSION=0
+PERL_PATCHLEVEL=''
+PERL_CONFIG_SH=true
+: Variables propagated from previous config.sh file.
+libdb_needs_pthread='N'
+
+# for Time-HiRes
+d_clock_nanosleep='define'
+d_clock_gettime='define'
+d_clock_getres='define'
+d_clock='define'
+d_nanosleep='define'
diff --git a/meta/recipes-devtools/perl/perl/config.sh-32 b/meta/recipes-devtools/perl/perl/config.sh-32
new file mode 100644
index 0000000..7259a0c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/config.sh-32
@@ -0,0 +1,38 @@
+alignbytes='4'
+cf_time='Thu Dec 23 03:57:51 UTC 2010'
+cppsymbols='_FILE_OFFSET_BITS=64 _GNU_SOURCE=1 _LARGEFILE64_SOURCE=1 _LARGEFILE_SOURCE=1 _POSIX_C_SOURCE=200809L _POSIX_SOURCE=1 _REENTRANT=1 _XOPEN_SOURCE=700 _XOPEN_SOURCE_EXTENDED=1 __BIGGEST_ALIGNMENT__=16 __CHAR16_TYPE__=short\ unsigned\ int __CHAR32_TYPE__=unsigned\ int __CHAR_BIT__=8 __DBL_DENORM_MIN__=((double)4.94065645841246544177e-324L) __DBL_DIG__=15 __DBL_EPSILON__=((double)2.22044604925031308085e-16L) __DBL_HAS_DENORM__=1 __DBL_HAS_INFINITY__=1 __DBL_HAS_QUIET_NAN__=1 __DBL_MANT_DIG__=53 __DBL_MAX_10_EXP__=308 __DBL_MAX_EXP__=1024 __DBL_MAX__=((double)1.79769313486231570815e+308L) __DBL_MIN_10_EXP__=(-307) __DBL_MIN_EXP__=(-1021) __DBL_MIN__=((double)2.22507385850720138309e-308L) __DEC128_EPSILON__=1E-33DL __DEC128_MANT_DIG__=34 __DEC128_MAX_EXP__=6145 __DEC128_MAX__=9.999999999999999999999999999999999E6144DL __DEC128_MIN_EXP__=(-6142) __DEC128_MIN__=1E-6143DL __DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL __DEC32_EPSILON__=1E-6DF __DEC32_MANT_DIG__=7 __DEC32_MAX_EXP__=97 __DEC32_MAX__=9.999999E96DF __DEC32_MIN_EXP__=(-94) __DEC32_MIN__=1E-95DF __DEC32_SUBNORMAL_MIN__=0.000001E-95DF __DEC64_EPSILON__=1E-15DD __DEC64_MANT_DIG__=16 __DEC64_MAX_EXP__=385 __DEC64_MAX__=9.999999999999999E384DD __DEC64_MIN_EXP__=(-382) __DEC64_MIN__=1E-383DD __DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD __DECIMAL_BID_FORMAT__=1 __DECIMAL_DIG__=21 __DEC_EVAL_METHOD__=2 __ELF__=1 __FINITE_MATH_ONLY__=0 __FLT_DENORM_MIN__=1.40129846432481707092e-45F __FLT_DIG__=6 __FLT_EPSILON__=1.19209289550781250000e-7F __FLT_EVAL_METHOD__=2 __FLT_HAS_DENORM__=1 __FLT_HAS_INFINITY__=1 __FLT_HAS_QUIET_NAN__=1 __FLT_MANT_DIG__=24 __FLT_MAX_10_EXP__=38 __FLT_MAX_EXP__=128 __FLT_MAX__=3.40282346638528859812e+38F __FLT_MIN_10_EXP__=(-37) __FLT_MIN_EXP__=(-125) __FLT_MIN__=1.17549435082228750797e-38F __FLT_RADIX__=2 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1 __GLIBC_MINOR__=12 __GLIBC__=2 __GNUC_GNU_INLINE__=1 __GNUC_MINOR__=5 __GNUC_PATCHLEVEL__=1 __GNUC__=4 __GNU_LIBRARY__=6 __GXX_ABI_VERSION=1002 __INT16_C(c)=c __INT16_MAX__=32767 __INT16_TYPE__=short\ int __INT32_C(c)=c __INT32_MAX__=2147483647 __INT32_TYPE__=int __INT64_C(c)=cLL __INT64_MAX__=9223372036854775807LL __INT64_TYPE__=long\ long\ int __INT8_C(c)=c __INT8_MAX__=127 __INT8_TYPE__=signed\ char __INTMAX_C(c)=cLL __INTMAX_MAX__=9223372036854775807LL __INTMAX_TYPE__=long\ long\ int __INTPTR_MAX__=2147483647 __INTPTR_TYPE__=int __INT_FAST16_MAX__=2147483647 __INT_FAST16_TYPE__=int __INT_FAST32_MAX__=2147483647 __INT_FAST32_TYPE__=int __INT_FAST64_MAX__=9223372036854775807LL __INT_FAST64_TYPE__=long\ long\ int __INT_FAST8_MAX__=127 __INT_FAST8_TYPE__=signed\ char __INT_LEAST16_MAX__=32767 __INT_LEAST16_TYPE__=short\ int __INT_LEAST32_MAX__=2147483647 __INT_LEAST32_TYPE__=int __INT_LEAST64_MAX__=9223372036854775807LL __INT_LEAST64_TYPE__=long\ long\ int __INT_LEAST8_MAX__=127 __INT_LEAST8_TYPE__=signed\ char __INT_MAX__=2147483647 __LDBL_DENORM_MIN__=3.64519953188247460253e-4951L __LDBL_DIG__=18 __LDBL_EPSILON__=1.08420217248550443401e-19L __LDBL_HAS_DENORM__=1 __LDBL_HAS_INFINITY__=1 __LDBL_HAS_QUIET_NAN__=1 __LDBL_MANT_DIG__=64 __LDBL_MAX_10_EXP__=4932 __LDBL_MAX_EXP__=16384 __LDBL_MAX__=1.18973149535723176502e+4932L __LDBL_MIN_10_EXP__=(-4931) __LDBL_MIN_EXP__=(-16381) __LDBL_MIN__=3.36210314311209350626e-4932L __LONG_LONG_MAX__=9223372036854775807LL __LONG_MAX__=2147483647L __PRAGMA_REDEFINE_EXTNAME=1 __PTRDIFF_MAX__=2147483647 __PTRDIFF_TYPE__=int __REGISTER_PREFIX__= __SCHAR_MAX__=127 __SHRT_MAX__=32767 __SIG_ATOMIC_MAX__=2147483647 __SIG_ATOMIC_MIN__=(-2147483647\ -\ 1) __SIG_ATOMIC_TYPE__=int __SIZEOF_DOUBLE__=8 __SIZEOF_FLOAT__=4 __SIZEOF_INT__=4 __SIZEOF_LONG_DOUBLE__=12 __SIZEOF_LONG_LONG__=8 __SIZEOF_LONG__=4 __SIZEOF_POINTER__=4 __SIZEOF_PTRDIFF_T__=4 __SIZEOF_SHORT__=2 __SIZEOF_SIZE_T__=4 __SIZEOF_WCHAR_T__=4 __SIZEOF_WINT_T__=4 __SIZE_MAX__=4294967295U __SIZE_TYPE__=unsigned\ int __STDC_HOSTED__=1 __STDC__=1 __UINT16_C(c)=c __UINT16_MAX__=65535 __UINT16_TYPE__=short\ unsigned\ int __UINT32_C(c)=cU __UINT32_MAX__=4294967295U __UINT32_TYPE__=unsigned\ int __UINT64_C(c)=cULL __UINT64_MAX__=18446744073709551615ULL __UINT64_TYPE__=long\ long\ unsigned\ int __UINT8_C(c)=c __UINT8_MAX__=255 __UINT8_TYPE__=unsigned\ char __UINTMAX_C(c)=cULL __UINTMAX_MAX__=18446744073709551615ULL __UINTMAX_TYPE__=long\ long\ unsigned\ int __UINTPTR_MAX__=4294967295U __UINTPTR_TYPE__=unsigned\ int __UINT_FAST16_MAX__=4294967295U __UINT_FAST16_TYPE__=unsigned\ int __UINT_FAST32_MAX__=4294967295U __UINT_FAST32_TYPE__=unsigned\ int __UINT_FAST64_MAX__=18446744073709551615ULL __UINT_FAST64_TYPE__=long\ long\ unsigned\ int __UINT_FAST8_MAX__=255 __UINT_FAST8_TYPE__=unsigned\ char __UINT_LEAST16_MAX__=65535 __UINT_LEAST16_TYPE__=short\ unsigned\ int __UINT_LEAST32_MAX__=4294967295U __UINT_LEAST32_TYPE__=unsigned\ int __UINT_LEAST64_MAX__=18446744073709551615ULL __UINT_LEAST64_TYPE__=long\ long\ unsigned\ int __UINT_LEAST8_MAX__=255 __UINT_LEAST8_TYPE__=unsigned\ char __USER_LABEL_PREFIX__= __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_GNU=1 __USE_LARGEFILE64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_POSIX=1 __USE_REENTRANT=1 __USE_SVID=1 __USE_UNIX98=1 __USE_XOPEN=1 __USE_XOPEN_EXTENDED=1 __VERSION__="4.5.1" __WCHAR_MAX__=2147483647L __WCHAR_MIN__=(-2147483647L\ -\ 1) __WCHAR_TYPE__=long\ int __WINT_MAX__=4294967295U __WINT_MIN__=0U __WINT_TYPE__=unsigned\ int __gnu_linux__=1 __i386=1 __i386__=1 __i586=1 __i586__=1 __linux=1 __linux__=1 __pentium=1 __pentium__=1 __tune_i586__=1 __tune_pentium__=1 __unix=1 __unix__=1 i386=1 linux=1 unix=1'
+d_nv_preserves_uv='define'
+d_printf_format_null='define'
+d_u32align='undef'
+gidformat='"lu"'
+i32type='long'
+i64type='long long'
+ivsize='4'
+longdblsize='12'
+longsize='4'
+myuname='linux qemux86 2.6.37-rc5-yocto-standard+ #1 preempt mon dec 20 14:21:27 pst 2010 i686 gnulinux '
+need_va_copy='undef'
+netdb_host_type='const void *'
+nv_preserves_uv_bits='32'
+ptrsize='4'
+quadkind='3'
+quadtype='long long'
+sGMTIME_max='2147483647'
+sGMTIME_min='-2147483648'
+sLOCALTIME_max='2147483647'
+sLOCALTIME_min='-2147483648'
+sPRIXU64='"LX"'
+sPRId64='"Ld"'
+sPRIi64='"Li"'
+sPRIo64='"Lo"'
+sPRIu64='"Lu"'
+sPRIx64='"Lx"'
+selectminbits='32'
+sizesize='4'
+u32type='unsigned long'
+u64type='unsigned long long'
+uidformat='"lu"'
+uquadtype='unsigned long long'
+use64bitall='undef'
+use64bitint='undef'
+uvsize='4'
diff --git a/meta/recipes-devtools/perl/perl/config.sh-32-be b/meta/recipes-devtools/perl/perl/config.sh-32-be
new file mode 100644
index 0000000..a59a9ab
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/config.sh-32-be
@@ -0,0 +1 @@
+byteorder='4321'
diff --git a/meta/recipes-devtools/perl/perl/config.sh-32-le b/meta/recipes-devtools/perl/perl/config.sh-32-le
new file mode 100644
index 0000000..10e4226
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/config.sh-32-le
@@ -0,0 +1 @@
+byteorder='1234'
diff --git a/meta/recipes-devtools/perl/perl/config.sh-64 b/meta/recipes-devtools/perl/perl/config.sh-64
new file mode 100644
index 0000000..6929d3a
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/config.sh-64
@@ -0,0 +1,38 @@
+alignbytes='8'
+cf_time='Thu Dec 23 02:06:42 UTC 2010'
+cppsymbols='_FILE_OFFSET_BITS=64 _GNU_SOURCE=1 _LARGEFILE64_SOURCE=1 _LARGEFILE_SOURCE=1 _LP64=1 _POSIX_C_SOURCE=200809L _POSIX_SOURCE=1 _REENTRANT=1 _XOPEN_SOURCE=700 _XOPEN_SOURCE_EXTENDED=1 __BIGGEST_ALIGNMENT__=16 __CHAR16_TYPE__=short\ unsigned\ int __CHAR32_TYPE__=unsigned\ int __CHAR_BIT__=8 __DBL_DENORM_MIN__=((double)4.94065645841246544177e-324L) __DBL_DIG__=15 __DBL_EPSILON__=((double)2.22044604925031308085e-16L) __DBL_HAS_DENORM__=1 __DBL_HAS_INFINITY__=1 __DBL_HAS_QUIET_NAN__=1 __DBL_MANT_DIG__=53 __DBL_MAX_10_EXP__=308 __DBL_MAX_EXP__=1024 __DBL_MAX__=((double)1.79769313486231570815e+308L) __DBL_MIN_10_EXP__=(-307) __DBL_MIN_EXP__=(-1021) __DBL_MIN__=((double)2.22507385850720138309e-308L) __DEC128_EPSILON__=1E-33DL __DEC128_MANT_DIG__=34 __DEC128_MAX_EXP__=6145 __DEC128_MAX__=9.999999999999999999999999999999999E6144DL __DEC128_MIN_EXP__=(-6142) __DEC128_MIN__=1E-6143DL __DEC128_SUBNORMAL_MIN__=0.000000000000000000000000000000001E-6143DL __DEC32_EPSILON__=1E-6DF __DEC32_MANT_DIG__=7 __DEC32_MAX_EXP__=97 __DEC32_MAX__=9.999999E96DF __DEC32_MIN_EXP__=(-94) __DEC32_MIN__=1E-95DF __DEC32_SUBNORMAL_MIN__=0.000001E-95DF __DEC64_EPSILON__=1E-15DD __DEC64_MANT_DIG__=16 __DEC64_MAX_EXP__=385 __DEC64_MAX__=9.999999999999999E384DD __DEC64_MIN_EXP__=(-382) __DEC64_MIN__=1E-383DD __DEC64_SUBNORMAL_MIN__=0.000000000000001E-383DD __DECIMAL_BID_FORMAT__=1 __DECIMAL_DIG__=21 __DEC_EVAL_METHOD__=2 __ELF__=1 __FINITE_MATH_ONLY__=0 __FLT_DENORM_MIN__=1.40129846432481707092e-45F __FLT_DIG__=6 __FLT_EPSILON__=1.19209289550781250000e-7F __FLT_EVAL_METHOD__=0 __FLT_HAS_DENORM__=1 __FLT_HAS_INFINITY__=1 __FLT_HAS_QUIET_NAN__=1 __FLT_MANT_DIG__=24 __FLT_MAX_10_EXP__=38 __FLT_MAX_EXP__=128 __FLT_MAX__=3.40282346638528859812e+38F __FLT_MIN_10_EXP__=(-37) __FLT_MIN_EXP__=(-125) __FLT_MIN__=1.17549435082228750797e-38F __FLT_RADIX__=2 __GCC_HAVE_DWARF2_CFI_ASM=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4=1 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8=1 __GLIBC_MINOR__=12 __GLIBC__=2 __GNUC_GNU_INLINE__=1 __GNUC_MINOR__=5 __GNUC_PATCHLEVEL__=1 __GNUC__=4 __GNU_LIBRARY__=6 __GXX_ABI_VERSION=1002 __INT16_C(c)=c __INT16_MAX__=32767 __INT16_TYPE__=short\ int __INT32_C(c)=c __INT32_MAX__=2147483647 __INT32_TYPE__=int __INT64_C(c)=cL __INT64_MAX__=9223372036854775807L __INT64_TYPE__=long\ int __INT8_C(c)=c __INT8_MAX__=127 __INT8_TYPE__=signed\ char __INTMAX_C(c)=cL __INTMAX_MAX__=9223372036854775807L __INTMAX_TYPE__=long\ int __INTPTR_MAX__=9223372036854775807L __INTPTR_TYPE__=long\ int __INT_FAST16_MAX__=9223372036854775807L __INT_FAST16_TYPE__=long\ int __INT_FAST32_MAX__=9223372036854775807L __INT_FAST32_TYPE__=long\ int __INT_FAST64_MAX__=9223372036854775807L __INT_FAST64_TYPE__=long\ int __INT_FAST8_MAX__=127 __INT_FAST8_TYPE__=signed\ char __INT_LEAST16_MAX__=32767 __INT_LEAST16_TYPE__=short\ int __INT_LEAST32_MAX__=2147483647 __INT_LEAST32_TYPE__=int __INT_LEAST64_MAX__=9223372036854775807L __INT_LEAST64_TYPE__=long\ int __INT_LEAST8_MAX__=127 __INT_LEAST8_TYPE__=signed\ char __INT_MAX__=2147483647 __LDBL_DENORM_MIN__=3.64519953188247460253e-4951L __LDBL_DIG__=18 __LDBL_EPSILON__=1.08420217248550443401e-19L __LDBL_HAS_DENORM__=1 __LDBL_HAS_INFINITY__=1 __LDBL_HAS_QUIET_NAN__=1 __LDBL_MANT_DIG__=64 __LDBL_MAX_10_EXP__=4932 __LDBL_MAX_EXP__=16384 __LDBL_MAX__=1.18973149535723176502e+4932L __LDBL_MIN_10_EXP__=(-4931) __LDBL_MIN_EXP__=(-16381) __LDBL_MIN__=3.36210314311209350626e-4932L __LONG_LONG_MAX__=9223372036854775807LL __LONG_MAX__=9223372036854775807L __LP64__=1 __MMX__=1 __PRAGMA_REDEFINE_EXTNAME=1 __PTRDIFF_MAX__=9223372036854775807L __PTRDIFF_TYPE__=long\ int __REGISTER_PREFIX__= __SCHAR_MAX__=127 __SHRT_MAX__=32767 __SIG_ATOMIC_MAX__=2147483647 __SIG_ATOMIC_MIN__=(-2147483647\ -\ 1) __SIG_ATOMIC_TYPE__=int __SIZEOF_DOUBLE__=8 __SIZEOF_FLOAT__=4 __SIZEOF_INT__=4 __SIZEOF_LONG_DOUBLE__=16 __SIZEOF_LONG_LONG__=8 __SIZEOF_LONG__=8 __SIZEOF_POINTER__=8 __SIZEOF_PTRDIFF_T__=8 __SIZEOF_SHORT__=2 __SIZEOF_SIZE_T__=8 __SIZEOF_WCHAR_T__=4 __SIZEOF_WINT_T__=4 __SIZE_MAX__=18446744073709551615UL __SIZE_TYPE__=long\ unsigned\ int __SSE2_MATH__=1 __SSE2__=1 __SSE_MATH__=1 __SSE__=1 __STDC_HOSTED__=1 __STDC__=1 __UINT16_C(c)=c __UINT16_MAX__=65535 __UINT16_TYPE__=short\ unsigned\ int __UINT32_C(c)=cU __UINT32_MAX__=4294967295U __UINT32_TYPE__=unsigned\ int __UINT64_C(c)=cUL __UINT64_MAX__=18446744073709551615UL __UINT64_TYPE__=long\ unsigned\ int __UINT8_C(c)=c __UINT8_MAX__=255 __UINT8_TYPE__=unsigned\ char __UINTMAX_C(c)=cUL __UINTMAX_MAX__=18446744073709551615UL __UINTMAX_TYPE__=long\ unsigned\ int __UINTPTR_MAX__=18446744073709551615UL __UINTPTR_TYPE__=long\ unsigned\ int __UINT_FAST16_MAX__=18446744073709551615UL __UINT_FAST16_TYPE__=long\ unsigned\ int __UINT_FAST32_MAX__=18446744073709551615UL __UINT_FAST32_TYPE__=long\ unsigned\ int __UINT_FAST64_MAX__=18446744073709551615UL __UINT_FAST64_TYPE__=long\ unsigned\ int __UINT_FAST8_MAX__=255 __UINT_FAST8_TYPE__=unsigned\ char __UINT_LEAST16_MAX__=65535 __UINT_LEAST16_TYPE__=short\ unsigned\ int __UINT_LEAST32_MAX__=4294967295U __UINT_LEAST32_TYPE__=unsigned\ int __UINT_LEAST64_MAX__=18446744073709551615UL __UINT_LEAST64_TYPE__=long\ unsigned\ int __UINT_LEAST8_MAX__=255 __UINT_LEAST8_TYPE__=unsigned\ char __USER_LABEL_PREFIX__= __USE_BSD=1 __USE_FILE_OFFSET64=1 __USE_GNU=1 __USE_LARGEFILE64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_POSIX=1 __USE_REENTRANT=1 __USE_SVID=1 __USE_UNIX98=1 __USE_XOPEN=1 __USE_XOPEN_EXTENDED=1 __VERSION__="4.5.1" __WCHAR_MAX__=2147483647 __WCHAR_MIN__=(-2147483647\ -\ 1) __WCHAR_TYPE__=int __WINT_MAX__=4294967295U __WINT_MIN__=0U __WINT_TYPE__=unsigned\ int __amd64=1 __amd64__=1 __gnu_linux__=1 __k8=1 __k8__=1 __linux=1 __linux__=1 __unix=1 __unix__=1 __x86_64=1 __x86_64__=1 linux=1 unix=1'
+d_nv_preserves_uv='undef'
+d_printf_format_null='undef'
+d_u32align='define'
+gidformat='"u"'
+i32type='int'
+i64type='long'
+ivsize='8'
+longdblsize='16'
+longsize='8'
+myuname='linux qemux86-64 2.6.37-rc5-yocto-standard+ #1 smp preempt mon dec 20 17:19:50 pst 2010 x86_64 gnulinux '
+need_va_copy='define'
+netdb_host_type='char *'
+nv_preserves_uv_bits='53'
+ptrsize='8'
+quadkind='2'
+quadtype='long'
+sGMTIME_max='67768036191676799'
+sGMTIME_min='-62167219200'
+sLOCALTIME_max='67768036191676799'
+sLOCALTIME_min='-62167219200'
+sPRIXU64='"lX"'
+sPRId64='"ld"'
+sPRIi64='"li"'
+sPRIo64='"lo"'
+sPRIu64='"lu"'
+sPRIx64='"lx"'
+selectminbits='64'
+sizesize='8'
+u32type='unsigned int'
+u64type='unsigned long'
+uidformat='"u"'
+uquadtype='unsigned long'
+use64bitall='define'
+use64bitint='define'
+uvsize='8'
diff --git a/meta/recipes-devtools/perl/perl/config.sh-64-be b/meta/recipes-devtools/perl/perl/config.sh-64-be
new file mode 100644
index 0000000..c08ce3c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/config.sh-64-be
@@ -0,0 +1 @@
+byteorder='87654321'
diff --git a/meta/recipes-devtools/perl/perl/config.sh-64-le b/meta/recipes-devtools/perl/perl/config.sh-64-le
new file mode 100644
index 0000000..277d2a9
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/config.sh-64-le
@@ -0,0 +1 @@
+byteorder='12345678'
diff --git a/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch b/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch
new file mode 100644
index 0000000..a00ad61
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/cross-generate_uudmap.patch
@@ -0,0 +1,15 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.14.2/Makefile.SH
+===================================================================
+--- perl-5.14.2.orig/Makefile.SH
++++ perl-5.14.2/Makefile.SH
+@@ -622,7 +622,7 @@ bitcount.h: generate_uudmap$(HOST_EXE_EX
+ 	$(RUN) ./generate_uudmap$(HOST_EXE_EXT) uudmap.h bitcount.h
+ 
+ generate_uudmap$(HOST_EXE_EXT): generate_uudmap$(OBJ_EXT)
+-	$(CC) -o generate_uudmap$(EXE_EXT) $(LDFLAGS) generate_uudmap$(OBJ_EXT) $(libs)
++	$(BUILD_CC) -o generate_uudmap$(EXE_EXT) generate_uudmap.c
+ 
+ miniperlmain$(OBJ_EXT): miniperlmain.c patchlevel.h
+ 	$(CCCMD) $(PLDLFLAGS) $*.c
diff --git a/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff b/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff
new file mode 100644
index 0000000..a63b968
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/cpan-missing-site-dirs.diff
@@ -0,0 +1,62 @@
+From d33d46963035ef726144dc66be2ae9c00aec0333 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Tue, 16 Oct 2012 23:07:56 +0300
+Subject: Fix CPAN::FirstTime defaults with nonexisting site dirs if a parent
+ is writable
+
+The site directories do not exist on a typical Debian system.  The build
+systems will create them when necessary, so there's no need for a prompt
+suggesting local::lib if the first existing parent directory is writable.
+
+Also, writability of the core directories is not interesting as we
+explicitly tell CPAN not to touch those with INSTALLDIRS=site.
+
+Bug-Debian: http://bugs.debian.org/688842
+Patch-Name: debian/cpan-missing-site-dirs.diff
+---
+ cpan/CPAN/lib/CPAN/FirstTime.pm | 31 +++++++++++++++++++++++++++----
+ 1 file changed, 27 insertions(+), 4 deletions(-)
+
+diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm
+index 33054cd..7b0becf 100644
+--- a/cpan/CPAN/lib/CPAN/FirstTime.pm
++++ b/cpan/CPAN/lib/CPAN/FirstTime.pm
+@@ -2057,11 +2057,34 @@ sub _print_urllist {
+     };
+ }
+ 
++# Debian modification: return true if this directory
++# or the first existing one upwards is writable
++sub _can_write_to_this_or_parent {
++    my ($dir) = @_;
++    my @parts = File::Spec->splitdir($dir);
++    while (@parts) {
++        my $cur = File::Spec->catdir(@parts);
++        return 1 if -w $cur;
++        return 0 if -e _;
++        pop @parts;
++    }
++    return 0;
++}
++
++# Debian specific modification: the site directories don't necessarily
++# exist on the system, but the build systems create them when necessary,
++# so return true if the first existing directory upwards is writable
++#
++# Furthermore, on Debian, only test the site directories
++# (installsite*, expanded to /usr/local/{share,lib}/perl),
++# not the core ones 
++# (install*lib, expanded to /usr/{share,lib}/perl).
++# We pass INSTALLDIRS=site by default to keep CPAN from touching
++# the core directories.
++
+ sub _can_write_to_libdirs {
+-    return -w $Config{installprivlib}
+-        && -w $Config{installarchlib}
+-        && -w $Config{installsitelib}
+-        && -w $Config{installsitearch}
++    return _can_write_to_this_or_parent($Config{installsitelib})
++        && _can_write_to_this_or_parent($Config{installsitearch})
+ }
+ 
+ sub _using_installbase {
diff --git a/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff b/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff
new file mode 100644
index 0000000..6b52950
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/cpan_definstalldirs.diff
@@ -0,0 +1,37 @@
+From 5ff1f21484aab68efe321ff4ba5d35928f72af96 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Provide a sensible INSTALLDIRS default for modules installed from
+ CPAN.
+
+Some modules which are included in core set INSTALLDIRS => 'perl'
+explicitly in Makefile.PL or Build.PL.  This makes sense for the normal @INC
+ordering, but not ours.
+
+Patch-Name: debian/cpan_definstalldirs.diff
+---
+ cpan/CPAN/lib/CPAN/FirstTime.pm | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm
+index 918e009..33054cd 100644
+--- a/cpan/CPAN/lib/CPAN/FirstTime.pm
++++ b/cpan/CPAN/lib/CPAN/FirstTime.pm
+@@ -1024,7 +1024,7 @@ sub init {
+     my_prompt_loop(prefer_installer => 'MB', $matcher, 'MB|EUMM|RAND');
+ 
+     if (!$matcher or 'makepl_arg make_arg' =~ /$matcher/) {
+-        my_dflt_prompt(makepl_arg => "", $matcher);
++        my_dflt_prompt(makepl_arg => "INSTALLDIRS=site", $matcher);
+         my_dflt_prompt(make_arg => "", $matcher);
+         if ( $CPAN::Config->{makepl_arg} =~ /LIBS=|INC=/ ) {
+             $CPAN::Frontend->mywarn(
+@@ -1056,7 +1056,7 @@ sub init {
+     my_dflt_prompt(make_install_arg => $CPAN::Config->{make_arg} || "",
+                    $matcher);
+ 
+-    my_dflt_prompt(mbuildpl_arg => "", $matcher);
++    my_dflt_prompt(mbuildpl_arg => "--installdirs site", $matcher);
+     my_dflt_prompt(mbuild_arg => "", $matcher);
+ 
+     if (exists $CPAN::HandleConfig::keys{mbuild_install_build_command}
diff --git a/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff b/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff
new file mode 100644
index 0000000..280bf11
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/db_file_ver.diff
@@ -0,0 +1,34 @@
+From 01421f8a80d5c623959695ba2b8167f30112d333 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 16 Dec 2005 01:32:14 +1100
+Subject: Remove overly restrictive DB_File version check.
+
+Bug-Debian: http://bugs.debian.org/340047
+
+Package dependencies ensure the correct library is linked at run-time.
+
+Patch-Name: debian/db_file_ver.diff
+---
+ cpan/DB_File/version.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/cpan/DB_File/version.c b/cpan/DB_File/version.c
+index e01f6f6..544e6ee 100644
+--- a/cpan/DB_File/version.c
++++ b/cpan/DB_File/version.c
+@@ -48,6 +48,7 @@ __getBerkeleyDBInfo()
+ 
+     (void)db_version(&Major, &Minor, &Patch) ;
+ 
++#ifndef DEBIAN
+     /* Check that the versions of db.h and libdb.a are the same */
+     if (Major != DB_VERSION_MAJOR || Minor != DB_VERSION_MINOR )
+ 		/* || Patch != DB_VERSION_PATCH) */
+@@ -55,6 +56,7 @@ __getBerkeleyDBInfo()
+ 	croak("\nDB_File was build with libdb version %d.%d.%d,\nbut you are attempting to run it with libdb version %d.%d.%d\n",
+ 		DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH, 
+ 		Major, Minor, Patch) ;
++#endif /* DEBIAN */
+     
+     /* check that libdb is recent enough  -- we need 2.3.4 or greater */
+     if (Major == 2 && (Minor < 3 || (Minor ==  3 && Patch < 4)))
diff --git a/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff b/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff
new file mode 100644
index 0000000..601ee4c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/deprecate-with-apt.diff
@@ -0,0 +1,56 @@
+From def4aa3817f98aae625e601b791ef068276f05d5 Mon Sep 17 00:00:00 2001
+From: Dominic Hargreaves <dom@earth.li>
+Date: Mon, 17 May 2010 13:23:07 +0300
+Subject: Point users to Debian packages of deprecated core modules
+
+Bug-Debian: http://bugs.debian.org/747628
+
+Several modules are being deprecated with perl 5.20.
+To get a clean transition, perl/perl-modules is going to recommend the
+separate Debian packages of these for one release cycle so that they will be
+pulled in by default on upgrades. This is taking place for perl 5.20/jessie.
+
+However, on systems configured to ignore recommendations the deprecation
+warnings will still be useful, so modify them slightly to point to the
+separate packages instead.
+
+Patch-Name: debian/deprecate-with-apt.diff
+---
+ lib/deprecate.pm | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/lib/deprecate.pm b/lib/deprecate.pm
+index 47bc112..b0c61df 100644
+--- a/lib/deprecate.pm
++++ b/lib/deprecate.pm
+@@ -7,6 +7,13 @@ our $VERSION = 0.03;
+ our %Config;
+ unless (%Config) { require Config; *Config = \%Config::Config; }
+ 
++# Debian-specific change: recommend the separate Debian packages of
++# deprecated modules where available
++
++our %DEBIAN_PACKAGES = (
++    # None for the perl 5.22 cycle
++);
++
+ # This isn't a public API. It's internal to code maintained by the perl-porters
+ # If you would like it to be a public API, please send a patch with
+ # documentation and tests. Until then, it may change without warning.
+@@ -58,9 +65,15 @@ EOM
+ 	if (defined $callers_bitmask
+ 	    && (vec($callers_bitmask, $warnings::Offsets{deprecated}, 1)
+ 		|| vec($callers_bitmask, $warnings::Offsets{all}, 1))) {
+-	    warn <<"EOM";
++		if (my $deb = $DEBIAN_PACKAGES{$package}) {
++		    warn <<"EOM";
++$package will be removed from the Perl core distribution in the next major release. Please install the separate $deb package. It is being used at $call_file, line $call_line.
++EOM
++		} else {
++		    warn <<"EOM";
+ $package will be removed from the Perl core distribution in the next major release. Please install it from CPAN. It is being used at $call_file, line $call_line.
+ EOM
++		}
+ 	}
+     }
+ }
diff --git a/meta/recipes-devtools/perl/perl/debian/doc_info.diff b/meta/recipes-devtools/perl/perl/debian/doc_info.diff
new file mode 100644
index 0000000..fbea2ee
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/doc_info.diff
@@ -0,0 +1,35 @@
+From e18f81e69c55d698abd293e71063d6b6b275cc07 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Replace generic man(1) instructions with Debian-specific information.
+
+Indicate that the user needs to install the perl-doc package.
+
+Patch-Name: debian/doc_info.diff
+---
+ pod/perl.pod | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/pod/perl.pod b/pod/perl.pod
+index 364e957..f97e103 100644
+--- a/pod/perl.pod
++++ b/pod/perl.pod
+@@ -291,8 +291,16 @@ aux c2ph h2ph h2xs perlbug pl2pm pod2html pod2man splain xsubpp
+ 
+ =for buildtoc __END__
+ 
+-On a Unix-like system, these documentation files will usually also be
+-available as manpages for use with the F<man> program.
++On Debian systems, you need to install the B<perl-doc> package which
++contains the majority of the standard Perl documentation and the
++F<perldoc> program.
++
++Extensive additional documentation for Perl modules is available, both
++those distributed with Perl and third-party modules which are packaged
++or locally installed.
++
++You should be able to view Perl's documentation with your man(1)
++program or perldoc(1).
+ 
+ Some documentation is not available as man pages, so if a
+ cross-reference is not found by man, try it with L<perldoc>.  Perldoc can
diff --git a/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff b/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff
new file mode 100644
index 0000000..e074b20
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/enc2xs_inc.diff
@@ -0,0 +1,70 @@
+From 7fe59a3d0601c6d8634eae4f99dae3024cd02a92 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Tweak enc2xs to follow symlinks and ignore missing @INC directories.
+
+Bug-Debian: http://bugs.debian.org/290336
+
+- ignore missing directories,
+- follow symlinks (/usr/share/perl/5.8 -> 5.8.4).
+- filter "." out when running "enc2xs -C", it's unnecessary and causes
+  issues with follow => 1 (see #603686 and [rt.cpan.org #64585])
+
+Patch-Name: debian/enc2xs_inc.diff
+---
+ cpan/Encode/bin/enc2xs | 8 ++++----
+ t/porting/customized.t | 3 +++
+ 2 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs
+index 19f2b2b..4d64e38 100644
+--- a/cpan/Encode/bin/enc2xs
++++ b/cpan/Encode/bin/enc2xs
+@@ -944,11 +944,11 @@ use vars qw(
+ sub find_e2x{
+     eval { require File::Find; };
+     my (@inc, %e2x_dir);
+-    for my $inc (@INC){
++    for my $inc (grep -d, @INC){
+     push @inc, $inc unless $inc eq '.'; #skip current dir
+     }
+     File::Find::find(
+-         sub {
++         { wanted => sub {
+          my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
+              $atime,$mtime,$ctime,$blksize,$blocks)
+              = lstat($_) or return;
+@@ -958,7 +958,7 @@ sub find_e2x{
+              $e2x_dir{$File::Find::dir} ||= $mtime;
+          }
+          return;
+-         }, @inc);
++         }, follow => 1}, @inc);
+     warn join("\n", keys %e2x_dir), "\n";
+     for my $d (sort {$e2x_dir{$a} <=> $e2x_dir{$b}} keys %e2x_dir){
+     $_E2X = $d;
+@@ -1025,7 +1025,7 @@ sub make_configlocal_pm {
+ 	    $LocalMod{$enc} ||= $mod;
+ 	}
+     };
+-    File::Find::find({wanted => $wanted}, @INC);
++    File::Find::find({wanted => $wanted, follow => 1}, grep -d && !/^\./, @INC);
+     $_ModLines = "";
+     for my $enc ( sort keys %LocalMod ) {
+         $_ModLines .=
+diff --git a/t/porting/customized.t b/t/porting/customized.t
+index 45fcafb..3bd6adb 100644
+--- a/t/porting/customized.t
++++ b/t/porting/customized.t
+@@ -101,8 +101,11 @@ foreach my $module ( sort keys %Modules ) {
+       print $data_fh join(' ', $module, $file, $id), "\n";
+       next;
+     }
++SKIP: {
++    skip("$file modified for Debian", 1) if $file eq 'cpan/Encode/bin/enc2xs';
+     my $should_be = $customised{ $module }->{ $file };
+     is( $id, $should_be, "SHA for $file matches stashed SHA" );
++}
+   }
+ }
+ 
diff --git a/meta/recipes-devtools/perl/perl/debian/errno_ver.diff b/meta/recipes-devtools/perl/perl/debian/errno_ver.diff
new file mode 100644
index 0000000..bcb59c6
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/errno_ver.diff
@@ -0,0 +1,35 @@
+From 827eee225897c35ec97194a5971bf4bfcf250748 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 16 Dec 2005 01:32:14 +1100
+Subject: Remove Errno version check due to upgrade problems with long-running
+ processes.
+
+Bug-Debian: http://bugs.debian.org/343351
+
+Remove version check which can cause problems for long running
+processes embedding perl when upgrading to a newer version,
+compatible, but built on a different machine.
+
+Patch-Name: debian/errno_ver.diff
+---
+ ext/Errno/Errno_pm.PL | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
+index c6bfa06..519e5c7 100644
+--- a/ext/Errno/Errno_pm.PL
++++ b/ext/Errno/Errno_pm.PL
+@@ -278,13 +278,8 @@ sub write_errno_pm {
+ 
+ package Errno;
+ require Exporter;
+-use Config;
+ use strict;
+ 
+-"\$Config{'archname'}-\$Config{'osvers'}" eq
+-"$archname-$Config{'osvers'}" or
+-	die "Errno architecture ($archname-$Config{'osvers'}) does not match executable architecture (\$Config{'archname'}-\$Config{'osvers'})";
+-
+ our \$VERSION = "$VERSION";
+ \$VERSION = eval \$VERSION;
+ our \@ISA = 'Exporter';
diff --git a/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff b/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff
new file mode 100644
index 0000000..adb4bd9
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/extutils_set_libperl_path.diff
@@ -0,0 +1,37 @@
+From 431275078b0490d2e092442d9582be06bb95b354 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sat, 10 May 2014 23:34:14 +0300
+Subject: EU:MM: set location of libperl.a under /usr/lib
+
+The Debian packaging moves libperl.a a couple of levels up from the
+CORE directory to match other static libraries.
+
+Patch-Name: debian/extutils_set_libperl_path.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +-
+ pp.c                                            | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 5f1b87f..570a631 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2505,7 +2505,7 @@ MAP_PRELIBS   = $Config{perllibs} $Config{cryptlib}
+ 	($lperl = $libperl) =~ s/\$\(A\)/$self->{LIB_EXT}/;
+     }
+     unless ($libperl && -f $lperl) { # Ilya's code...
+-	my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/CORE";
++	my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/../..";
+ 	$dir = "$self->{PERL_ARCHLIB}/.." if $self->{UNINSTALLED_PERL};
+ 	$libperl ||= "libperl$self->{LIB_EXT}";
+ 	$libperl   = "$dir/$libperl";
+diff --git a/pp.c b/pp.c
+index 42f156a..77c1279 100644
+--- a/pp.c
++++ b/pp.c
+@@ -1,4 +1,4 @@
+-/*    pp.c
++ /*    pp.c
+  *
+  *    Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+  *    2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by Larry Wall and others
diff --git a/meta/recipes-devtools/perl/perl/debian/fakeroot.diff b/meta/recipes-devtools/perl/perl/debian/fakeroot.diff
new file mode 100644
index 0000000..ec461cf
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fakeroot.diff
@@ -0,0 +1,42 @@
+From 27ae7b18078d801a2c943aa6de2f7e9808177251 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Postpone LD_LIBRARY_PATH evaluation to the binary targets.
+
+Modify the setting of LD_LIBRARY_PATH to append pre-existing values at the
+time the rule is evaluated rather than when the Makefile is created.
+
+This is required when building packages with dpkg-buildpackage and fakeroot,
+since fakeroot (which now sets LD_LIBRARY_PATH) is not used for the "build"
+rule where the Makefile is created, but is for the clean/binary* targets.
+
+Patch-Name: debian/fakeroot.diff
+---
+ Makefile.SH | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.SH b/Makefile.SH
+index 034d812..04dd7d5 100755
+--- a/Makefile.SH
++++ b/Makefile.SH
+@@ -39,10 +39,7 @@ case "$useshrplib" in
+ true)
+ 	# Prefix all runs of 'miniperl' and 'perl' with
+ 	# $ldlibpth so that ./perl finds *this* shared libperl.
+-	case "$LD_LIBRARY_PATH" in
+-	'')  ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `" ;;
+-	*)   ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `:` quote "$LD_LIBRARY_PATH" `" ;;
+-	esac
++	ldlibpth="LD_LIBRARY_PATH=` quote "$pwd" `"'$${LD_LIBRARY_PATH:+:}$$LD_LIBRARY_PATH'
+ 
+ 	pldlflags="$cccdlflags"
+ 	static_ldflags=''
+@@ -113,7 +110,7 @@ true)
+ 	    ;;
+ 	esac
+ 	case "$ldlibpthname" in
+-	'') ;;
++	''|LD_LIBRARY_PATH) ;;
+ 	*)
+ 	    case "$osname" in
+ 	    os2)
diff --git a/meta/recipes-devtools/perl/perl/debian/find_html2text.diff b/meta/recipes-devtools/perl/perl/debian/find_html2text.diff
new file mode 100644
index 0000000..d319e75
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/find_html2text.diff
@@ -0,0 +1,35 @@
+From c81dbdedff9e9b4fb75ac028aa718838c0292d2f Mon Sep 17 00:00:00 2001
+From: Andreas Marschke <andreas.marschke@googlemail.com>
+Date: Sat, 17 Sep 2011 11:38:42 +0100
+Subject: Configure CPAN::Distribution with correct name of html2text
+
+Bug-Debian: http://bugs.debian.org/640479
+Patch-Name: debian/find_html2text.diff
+
+If you use cpan from Debian you usually wind up trying to read online
+documentation through it. Unfortunately cpan can't find the
+html2text.pl script even though it is installed using the Debian
+package 'html2text'.
+
+Please see the attached patch for a quick fix of this issue.
+
+[Maintainer's note: html2text in Debian is not the same implementation
+as the html2text.pl which is expected, but should provide similar
+functionality].
+---
+ cpan/CPAN/lib/CPAN/Distribution.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/CPAN/lib/CPAN/Distribution.pm b/cpan/CPAN/lib/CPAN/Distribution.pm
+index 092b781..5c2bae1 100644
+--- a/cpan/CPAN/lib/CPAN/Distribution.pm
++++ b/cpan/CPAN/lib/CPAN/Distribution.pm
+@@ -4099,7 +4099,7 @@ sub _display_url {
+       if $CPAN::DEBUG;
+ 
+     # should we define it in the config instead?
+-    my $html_converter = "html2text.pl";
++    my $html_converter = "html2text";
+ 
+     my $web_browser = $CPAN::Config->{'lynx'} || undef;
+     my $web_browser_out = $web_browser
diff --git a/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff b/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff
new file mode 100644
index 0000000..61a9271
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fixes/document_makemaker_ccflags.diff
@@ -0,0 +1,31 @@
+From 9faf6dcc3a5c4154484d812eb3cc3dd78b35563b Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Mon, 30 May 2011 22:54:24 +0300
+Subject: Document that CCFLAGS should include $Config{ccflags}
+
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=68613
+Bug-Debian: http://bugs.debian.org/628522
+
+Compiling XS extensions without $Config{ccflags} can break the
+binary interface on some platforms.
+
+Patch-Name: fixes/document_makemaker_ccflags.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
+index fe95b27..90403e8 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
+@@ -1774,6 +1774,10 @@ currently used by MakeMaker but may be handy in Makefile.PLs.
+ String that will be included in the compiler call command line between
+ the arguments INC and OPTIMIZE.
+ 
++The default value is taken from $Config{ccflags}. When overriding
++CCFLAGS, make sure to include the $Config{ccflags} settings to avoid
++binary incompatibilities.
++
+ =item CONFIG
+ 
+ Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from
diff --git a/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff b/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff
new file mode 100644
index 0000000..525f962
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fixes/memoize_storable_nstore.diff
@@ -0,0 +1,110 @@
+From 55d430eb02fc116581847304ca20321687978269 Mon Sep 17 00:00:00 2001
+From: Jonathan Nieder <jrnieder@gmail.com>
+Date: Fri, 27 Jul 2012 10:35:07 -0500
+Subject: Memoize::Storable: respect 'nstore' option not respected
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Memoize(3perl) says:
+
+                tie my %cache => 'Memoize::Storable', $filename, 'nstore';
+                memoize 'function', SCALAR_CACHE => [HASH => \%cache];
+
+        Include the ‘nstore’ option to have the "Storable" database
+        written in ‘network order’.  (See Storable for more details
+        about this.)
+
+In fact the "nstore" option does no such thing.  Option parsing looks
+like this:
+
+        @options{@_} = ();
+
+$self->{OPTIONS}{'nstore'} is accordingly set to undef.  Later
+Memoize::Storable checks if the option is true, and since undef is
+not true, the "else" branch is always taken.
+
+        if ($self->{OPTIONS}{'nstore'}) {
+                Storable::nstore($self->{H}, $self->{FILENAME});
+        } else {
+                Storable::store($self->{H}, $self->{FILENAME});
+        }
+
+Correcting the condition to (exists $self->{OPTIONS}{'nstore'}) fixes
+it.
+
+Noticed because git-svn, which uses the 'nstore' option for its
+on-disk caches, was producing
+
+        Byte order is not compatible at ../../lib/Storable.pm
+
+when run using a perl with a different integer size (and hence
+byteorder).
+
+Reported by Tim Retout (RT#77790)
+
+Bug-Debian: http://bugs.debian.org/587650
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=77790
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=77790
+Patch-Name: fixes/memoize_storable_nstore.diff
+---
+ cpan/Memoize/Memoize/Storable.pm |  2 +-
+ cpan/Memoize/t/tie_storable.t    | 24 ++++++++++++++++++++----
+ 2 files changed, 21 insertions(+), 5 deletions(-)
+
+diff --git a/cpan/Memoize/Memoize/Storable.pm b/cpan/Memoize/Memoize/Storable.pm
+index 1314797..87876f2 100644
+--- a/cpan/Memoize/Memoize/Storable.pm
++++ b/cpan/Memoize/Memoize/Storable.pm
+@@ -55,7 +55,7 @@ sub DESTROY {
+   require Carp if $Verbose;
+   my $self= shift;
+   print STDERR "Memoize::Storable::DESTROY(@_)\n" if $Verbose;
+-  if ($self->{OPTIONS}{'nstore'}) {
++  if (exists $self->{OPTIONS}{'nstore'}) {
+     Storable::nstore($self->{H}, $self->{FILENAME});
+   } else {
+     Storable::store($self->{H}, $self->{FILENAME});
+diff --git a/cpan/Memoize/t/tie_storable.t b/cpan/Memoize/t/tie_storable.t
+index de3b8dc..a624238 100644
+--- a/cpan/Memoize/t/tie_storable.t
++++ b/cpan/Memoize/t/tie_storable.t
+@@ -31,18 +31,34 @@ if ($@) {
+   exit 0;
+ }
+ 
+-print "1..4\n";
++print "1..9\n";
+ 
+ $file = "storable$$";
+ 1 while unlink $file;
+ tryout('Memoize::Storable', $file, 1);  # Test 1..4
+ 1 while unlink $file;
++tryout('Memoize::Storable', $file, 5, 'nstore');  # Test 5..8
++assert_netorder($file, 9);  # Test 9
++1 while unlink $file;
++
++
++sub assert_netorder {
++  my ($file, $testno) = @_;
++
++  my $netorder = Storable::file_magic($file)->{'netorder'};
++  print ($netorder ? "ok $testno\n" : "not ok $testno\n");
++}
+ 
+ sub tryout {
+-  my ($tiepack, $file, $testno) = @_;
++  my ($tiepack, $file, $testno, $option) = @_;
+ 
+-  tie my %cache => $tiepack, $file
+-    or die $!;
++  if (defined $option) {
++    tie my %cache => $tiepack, $file, $option
++      or die $!;
++  } else {
++    tie my %cache => $tiepack, $file
++      or die $!;
++  }
+ 
+   memoize 'c5', 
+   SCALAR_CACHE => [HASH => \%cache],
diff --git a/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff b/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff
new file mode 100644
index 0000000..3c31972
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fixes/net_smtp_docs.diff
@@ -0,0 +1,25 @@
+From fa085fedd9c406edcd4a1a256c025d5ff7f6c6de Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Thu, 20 Sep 2007 19:47:14 +1000
+Subject: Document the Net::SMTP 'Port' option
+
+Bug-Debian: http://bugs.debian.org/100195
+Bug: http://rt.cpan.org/Public/Bug/Display.html?id=36038
+
+Patch-Name: fixes/net_smtp_docs.diff
+---
+ cpan/libnet/lib/Net/SMTP.pm | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/cpan/libnet/lib/Net/SMTP.pm b/cpan/libnet/lib/Net/SMTP.pm
+index afd017a..6ae7d9e 100644
+--- a/cpan/libnet/lib/Net/SMTP.pm
++++ b/cpan/libnet/lib/Net/SMTP.pm
+@@ -738,6 +738,7 @@ Net::SMTP will attempt to extract the address from the value passed.
+ 
+ B<Debug> - Enable debugging information
+ 
++B<Port> - Select a port on the remote host to connect to (default is 25)
+ 
+ Example:
+ 
diff --git a/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff b/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff
new file mode 100644
index 0000000..b5564fd
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fixes/perl-Cnn.diff
@@ -0,0 +1,73 @@
+From 0ecf83f259db09cb38cb37c9b22e72be185afa8f Mon Sep 17 00:00:00 2001
+From: Hugo van der Sanden <hv@crypt.org>
+Date: Thu, 11 Jun 2015 12:25:40 +0100
+Subject: fix -Cnn parsing
+
+Commit 22ff313068 for [perl #123814] inadvertently changed the logic when
+parsing a numeric parameter to the -C option, such that the successfully
+parsed number was not saved as the option value if it parsed to the end
+of the argument.
+
+Bug: https://rt.perl.org/Ticket/Display.html?id=125381
+Bug-Debian: https://bugs.debian.org/788636
+Origin: upstream, http://perl5.git.perl.org/perl.git/commit/89d84ff965
+Patch-Name: fixes/perl-Cnn.diff
+---
+ t/run/switchC.t |  7 ++++++-
+ util.c          | 17 ++++++++---------
+ 2 files changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/t/run/switchC.t b/t/run/switchC.t
+index f6aa868..4f63c3b 100644
+--- a/t/run/switchC.t
++++ b/t/run/switchC.t
+@@ -11,7 +11,7 @@ BEGIN {
+     skip_all_if_miniperl('-C and $ENV{PERL_UNICODE} are disabled on miniperl');
+ }
+ 
+-plan(tests => 13);
++plan(tests => 14);
+ 
+ my $r;
+ 
+@@ -25,6 +25,11 @@ $r = runperl( switches => [ '-CO', '-w' ],
+               stderr   => 1 );
+ like( $r, qr/^$b(?:\r?\n)?$/s, '-CO: no warning on UTF-8 output' );
+ 
++$r = runperl( switches => [ '-C2', '-w' ],
++	      prog     => 'print chr(256)',
++              stderr   => 1 );
++like( $r, qr/^$b(?:\r?\n)?$/s, '-C2: no warning on UTF-8 output' );
++
+ SKIP: {
+     if (exists $ENV{PERL_UNICODE} &&
+ 	($ENV{PERL_UNICODE} eq "" || $ENV{PERL_UNICODE} =~ /[SO]/)) {
+diff --git a/util.c b/util.c
+index 8cf62f5..ee23314 100644
+--- a/util.c
++++ b/util.c
+@@ -4420,16 +4420,15 @@ Perl_parse_unicode_opts(pTHX_ const char **popt)
+        if (isDIGIT(*p)) {
+             const char* endptr;
+             UV uv;
+-            if (grok_atoUV(p, &uv, &endptr)
+-                && uv <= U32_MAX
+-                && (p = endptr)
+-                && *p && *p != '\n' && *p != '\r'
+-            ) {
++            if (grok_atoUV(p, &uv, &endptr) && uv <= U32_MAX) {
+                 opt = (U32)uv;
+-                if (isSPACE(*p))
+-                    goto the_end_of_the_opts_parser;
+-                else
+-                    Perl_croak(aTHX_ "Unknown Unicode option letter '%c'", *p);
++                p = endptr;
++                if (p && *p && *p != '\n' && *p != '\r') {
++                    if (isSPACE(*p))
++                        goto the_end_of_the_opts_parser;
++                    else
++                        Perl_croak(aTHX_ "Unknown Unicode option letter '%c'", *p);
++                }
+             }
+         }
+         else {
diff --git a/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff b/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff
new file mode 100644
index 0000000..7c9ca86
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fixes/pod_man_reproducible_date.diff
@@ -0,0 +1,170 @@
+From 9057adc106d6bbef53c9e706523cd94f1a7a08d4 Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@debian.org>
+Date: Sat, 30 Aug 2014 15:10:41 -0700
+Subject: Support POD_MAN_DATE in Pod::Man for the left-hand footer
+
+Honor the environment variable POD_MAN_DATE and use its contents, if
+set, as the value of the left-hand footer if the date option is not
+set, overriding the timestamp of the input file.  This is primarily
+useful to ensure reproducible builds of the same output file given the
+same souce and Pod::Man version, even when file timestamps may not be
+consistent.  Thanks, Niko Tyni.
+
+Bug-Debian: http://bugs.debian.org/759405
+Origin: upstream
+Patch-Name: fixes/pod_man_reproducible_date.diff
+---
+ cpan/podlators/lib/Pod/Man.pm  | 69 +++++++++++++++++++++++++++++++-----------
+ cpan/podlators/t/devise-date.t | 29 +++++++++++++-----
+ 2 files changed, 72 insertions(+), 26 deletions(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 72ca9ff..0536662 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -876,25 +876,42 @@ sub devise_title {
+ }
+ 
+ # Determine the modification date and return that, properly formatted in ISO
+-# format.  If we can't get the modification date of the input, instead use the
+-# current time.  Pod::Simple returns a completely unuseful stringified file
+-# handle as the source_filename for input from a file handle, so we have to
+-# deal with that as well.
++# format.
++#
++# If POD_MAN_DATE is set, that overrides anything else.  This can be used for
++# reproducible generation of the same file even if the input file timestamps
++# are unpredictable or the POD coms from standard input.
++#
++# Otherwise, use the modification date of the input if we can stat it.  Be
++# aware that Pod::Simple returns the stringification of the file handle as
++# source_filename for input from a file handle, so we'll stat some random ref
++# string in that case.  If that fails, instead use the current time.
++#
++# $self - Pod::Man object, used to get the source file
++#
++# Returns: YYYY-MM-DD date suitable for the left-hand footer
+ sub devise_date {
+     my ($self) = @_;
++
++    # If POD_MAN_DATE is set, always use it.
++    if ($ENV{POD_MAN_DATE}) {
++        return $ENV{POD_MAN_DATE};
++    }
++
++    # Otherwise, get the input filename and try to stat it.  If that fails,
++    # use the current time.
+     my $input = $self->source_filename;
+     my $time;
+     if ($input) {
+-        $time = (stat $input)[9] || time;
++        $time = (stat($input))[9] || time();
+     } else {
+-        $time = time;
++        $time = time();
+     }
+ 
+-    # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker
+-    # uses this and it has to work in the core which can't load dynamic
+-    # libraries.
+-    my ($year, $month, $day) = (localtime $time)[5,4,3];
+-    return sprintf ("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
++    # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker uses
++    # this and it has to work in the core which can't load dynamic libraries.
++    my ($year, $month, $day) = (localtime($time))[5,4,3];
++    return sprintf("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
+ }
+ 
+ # Print out the preamble and the title.  The meaning of the arguments to .TH
+@@ -1632,6 +1649,15 @@ argument.
+ Sets the centered page header to use instead of "User Contributed Perl
+ Documentation".
+ 
++=item date
++
++Sets the left-hand footer.  If this option is not set, the contents of the
++environment variable POD_MAN_DATE, if set, will be used.  Failing that,
++the modification date of the input file will be used, or the current time
++if stat() can't find that file (which will be the case if the input is
++from C<STDIN>).  If obtained from the file modification date or the
++current time, he date will be formatted as C<YYYY-MM-DD>.
++
+ =item errors
+ 
+ How to report errors.  C<die> says to throw an exception on any POD
+@@ -1642,13 +1668,6 @@ POD errors entirely, as much as possible.
+ 
+ The default is C<pod>.
+ 
+-=item date
+-
+-Sets the left-hand footer.  By default, the modification date of the input
+-file will be used, or the current date if stat() can't find that file (the
+-case if the input is from C<STDIN>), and the date will be formatted as
+-C<YYYY-MM-DD>.
+-
+ =item fixed
+ 
+ The fixed-width font to use for verbatim text and code.  Defaults to
+@@ -1810,6 +1829,20 @@ option was set to C<die>.
+ 
+ =back
+ 
++=head1 ENVIRONMENT
++
++=over 4
++
++=item POD_MAN_DATE
++
++If set, this will be used as the value of the left-hand footer unless the
++C<date> option is explicitly set, overriding the timestamp of the input
++file or the current time.  This is primarily useful to ensure reproducible
++builds of the same output file given the same souce and Pod::Man version,
++even when file timestamps may not be consistent.
++
++=back
++
+ =head1 BUGS
+ 
+ Encoding handling assumes that PerlIO is available and does not work
+diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
+index 3cce9f5..c610dd9 100644
+--- a/cpan/podlators/t/devise-date.t
++++ b/cpan/podlators/t/devise-date.t
+@@ -1,15 +1,28 @@
+-#!/usr/bin/perl -w
+-
+-# In order for MakeMaker to build in the core, nothing can use
+-# Fcntl which includes POSIX.  devise_date()'s use of strftime()
+-# was replaced.  This tests that it's identical.
++#!/usr/bin/perl
++#
++# In order for MakeMaker to build in the core, nothing can use Fcntl which
++# includes POSIX.  devise_date()'s use of strftime() was replaced.  This tests
++# that it's identical.  It also tests special handling of the POD_MAN_DATE
++# environment variable.
+ 
++use 5.006;
+ use strict;
+-
+-use Test::More tests => 1;
++use warnings;
+ 
+ use Pod::Man;
+ use POSIX qw(strftime);
+ 
++use Test::More tests => 2;
++
++# Check that the results of device_date matches strftime.  There is no input
++# file name, so this will use the current time.
+ my $parser = Pod::Man->new;
+-is $parser->devise_date, strftime("%Y-%m-%d", localtime);
++is(
++    $parser->devise_date,
++    strftime('%Y-%m-%d', localtime()),
++    'devise_date matches strftime'
++);
++
++# Set the override environment variable and ensure that it's honored.
++local $ENV{POD_MAN_DATE} = '2014-01-01';
++is($parser->devise_date, '2014-01-01', 'devise_date honors POD_MAN_DATE');
diff --git a/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff b/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff
new file mode 100644
index 0000000..7ebbf9c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fixes/podman-empty-date.diff
@@ -0,0 +1,51 @@
+From 183bb4af7ad862a2cf31d0dcb3dd45c100f76776 Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@cpan.org>
+Date: Wed, 15 Apr 2015 22:21:25 -0700
+Subject: Support an empty POD_MAN_DATE environment variable
+
+One may want to set this to an empty string.  Handle that correctly.
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=e0e9fcb53e8fc954b2b1955385eea18c27f869af
+Bug-Debian: https://bugs.debian.org/780259
+Patch-Name: fixes/podman-empty-date.diff
+---
+ cpan/podlators/lib/Pod/Man.pm  | 2 +-
+ cpan/podlators/t/devise-date.t | 6 +++++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 365892e..8997a15 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -894,7 +894,7 @@ sub devise_date {
+     my ($self) = @_;
+ 
+     # If POD_MAN_DATE is set, always use it.
+-    if ($ENV{POD_MAN_DATE}) {
++    if (defined($ENV{POD_MAN_DATE})) {
+         return $ENV{POD_MAN_DATE};
+     }
+ 
+diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
+index 9da9d1b..27271d9 100644
+--- a/cpan/podlators/t/devise-date.t
++++ b/cpan/podlators/t/devise-date.t
+@@ -12,7 +12,7 @@ use warnings;
+ use Pod::Man;
+ use POSIX qw(strftime);
+ 
+-use Test::More tests => 2;
++use Test::More tests => 3;
+ 
+ # Check that the results of device_date matches strftime.  There is no input
+ # file name, so this will use the current time.
+@@ -26,3 +26,7 @@ is(
+ # Set the override environment variable and ensure that it's honored.
+ local $ENV{POD_MAN_DATE} = '2014-01-01';
+ is($parser->devise_date, '2014-01-01', 'devise_date honors POD_MAN_DATE');
++
++# Check that an empty environment variable is honored.
++local $ENV{POD_MAN_DATE} = q{};
++is($parser->devise_date, q{}, 'devise_date honors empty POD_MAN_DATE');
diff --git a/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff b/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff
new file mode 100644
index 0000000..1a60361
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fixes/podman-pipe.diff
@@ -0,0 +1,109 @@
+From 7671d101baa75d7a79bfbd8c75c1595fbb3f53ba Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@cpan.org>
+Date: Sat, 7 Feb 2015 19:03:34 -0800
+Subject: Better errors for man pages from standard input
+
+[Pod::Man] Attempt to detect if the input came from a pipe and
+therefore has a completely unhelpful (and nonreproducible) source file
+name, and diagnose this as an error.  Document that the name option
+(--name to pod2man) is required when processing POD source from
+standard input.  (Debian Bug#777405)
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=d98872e46c93861b7aba14949e1258712087dc55
+Bug-Debian: https://bugs.debian.org/777405
+Patch-Name: fixes/podman-pipe.diff
+---
+ cpan/podlators/lib/Pod/Man.pm     | 15 +++++++++++++++
+ cpan/podlators/scripts/pod2man.PL |  4 ++++
+ cpan/podlators/t/devise-title.t   | 32 ++++++++++++++++++++++++++++++++
+ 3 files changed, 51 insertions(+)
+ create mode 100755 cpan/podlators/t/devise-title.t
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 8997a15..969eaff 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -828,6 +828,17 @@ sub devise_title {
+     $section = 3 if (!$$self{section} && $name =~ /\.pm\z/i);
+     $name =~ s/\.p(od|[lm])\z//i;
+ 
++    # If Pod::Parser gave us an IO::File reference as the source file name,
++    # convert that to the empty string as well.  Then, if we don't have a
++    # valid name, emit a warning and convert it to STDIN.
++    if ($name =~ /^IO::File(?:=\w+)\(0x[\da-f]+\)$/i) {
++        $name = '';
++    }
++    if ($name eq '') {
++        $self->whine (1, 'No name given for document');
++        $name = 'STDIN';
++    }
++
+     # If the section isn't 3, then the name defaults to just the basename of
+     # the file.  Otherwise, assume we're dealing with a module.  We want to
+     # figure out the full module name from the path to the file, but we don't
+@@ -1705,6 +1716,10 @@ module path.  If it is, a path like C<.../lib/Pod/Man.pm> is converted into
+ a name like C<Pod::Man>.  This option, if given, overrides any automatic
+ determination of the name.
+ 
++If generating a manual page from standard input, this option is required,
++since there's otherwise no way for Pod::Man to know what to use for the
++manual page name.
++
+ =item nourls
+ 
+ Normally, LZ<><> formatting codes with a URL but anchor text are formatted
+diff --git a/cpan/podlators/scripts/pod2man.PL b/cpan/podlators/scripts/pod2man.PL
+index 38695f8..43e35df 100644
+--- a/cpan/podlators/scripts/pod2man.PL
++++ b/cpan/podlators/scripts/pod2man.PL
+@@ -236,6 +236,10 @@ Note that this option is probably not useful when converting multiple POD
+ files at once.  The convention for Unix man pages for commands is for the
+ man page title to be in all-uppercase even if the command isn't.
+ 
++When converting POD source from standard input, this option is required,
++since there's otherwise no way to know what to use as the name of the
++manual page.
++
+ =item B<--nourls>
+ 
+ Normally, LZ<><> formatting codes with a URL but anchor text are formatted
+diff --git a/cpan/podlators/t/devise-title.t b/cpan/podlators/t/devise-title.t
+new file mode 100755
+index 0000000..8639441
+--- /dev/null
++++ b/cpan/podlators/t/devise-title.t
+@@ -0,0 +1,32 @@
++#!/usr/bin/perl
++#
++# Tests for the automatic determination of the manual page title if not
++# specified via options to pod2man or the Pod::Man constructor.
++
++use 5.006;
++use strict;
++use warnings;
++
++use File::Spec;
++use IO::File;
++use Test::More tests => 3;
++
++BEGIN {
++    use_ok('Pod::Man');
++}
++
++# Create a parser and set it up with an input source.  There isn't a way to do
++# this in Pod::Simple without actually parsing the document, so send the
++# output to a string that we'll ignore.
++my $path = File::Spec->catdir('t', 'data', 'basic.pod');
++my $handle = IO::File->new($path, 'r');
++my $parser = Pod::Man->new(errors => 'pod');
++my $output;
++$parser->output_string(\$output);
++$parser->parse_file($handle);
++
++# Check the results of devise_title for this.  We should get back STDIN, and
++# we should have reported an error.
++my ($name, $section) = $parser->devise_title;
++is($name, 'STDIN', 'devise_title uses STDIN for file handle input');
++ok($parser->errors_seen, '...and errors were seen');
diff --git a/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff b/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff
new file mode 100644
index 0000000..0cdfeff
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc-docs.diff
@@ -0,0 +1,86 @@
+From 6198856b5323d6204094293f01b890472618f182 Mon Sep 17 00:00:00 2001
+From: Russ Allbery <rra@cpan.org>
+Date: Wed, 15 Apr 2015 20:49:07 -0700
+Subject: Documentation and test suite updates for UTC fix
+
+Update the Pod::Man and pod2man documentation and the test suite
+for the new UTC-based default page footer, and add a Changes
+entry.
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=52db93bf80e4a06f8497e4ebade0506b6ee0e70d
+Bug-Debian: https://bugs.debian.org/780259
+Patch-Name: fixes/podman-utc-docs.diff
+---
+ cpan/podlators/lib/Pod/Man.pm     |  6 +++++-
+ cpan/podlators/scripts/pod2man.PL | 11 ++++++-----
+ cpan/podlators/t/devise-date.t    |  2 +-
+ 3 files changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index c3ba201..365892e 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -910,6 +910,8 @@ sub devise_date {
+ 
+     # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker uses
+     # this and it has to work in the core which can't load dynamic libraries.
++    # Use gmtime instead of localtime so that the generated man page does not
++    # depend on the local time zone setting and is more reproducible
+     my ($year, $month, $day) = (gmtime($time))[5,4,3];
+     return sprintf("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
+ }
+@@ -1656,7 +1658,9 @@ environment variable POD_MAN_DATE, if set, will be used.  Failing that,
+ the modification date of the input file will be used, or the current time
+ if stat() can't find that file (which will be the case if the input is
+ from C<STDIN>).  If obtained from the file modification date or the
+-current time, he date will be formatted as C<YYYY-MM-DD>.
++current time, the date will be formatted as C<YYYY-MM-DD> and will be based
++on UTC (so that the output will be reproducible regardless of local time
++zone).
+ 
+ =item errors
+ 
+diff --git a/cpan/podlators/scripts/pod2man.PL b/cpan/podlators/scripts/pod2man.PL
+index 6af3474..38695f8 100644
+--- a/cpan/podlators/scripts/pod2man.PL
++++ b/cpan/podlators/scripts/pod2man.PL
+@@ -174,9 +174,10 @@ Contributed Perl Documentation", but also see B<--official> below.
+ 
+ =item B<-d> I<string>, B<--date>=I<string>
+ 
+-Set the left-hand footer string to this value.  By default, the modification
+-date of the input file will be used, or the current date if input comes from
+-C<STDIN>.
++Set the left-hand footer string to this value.  By default, the
++modification date of the input file will be used, or the current date if
++input comes from C<STDIN>, and will be based on UTC (so that the output
++will be reproducible regardless of local time zone).
+ 
+ =item B<-errors>=I<style>
+ 
+@@ -383,8 +384,8 @@ B<pod2man> by Larry Wall and Tom Christiansen.
+ 
+ =head1 COPYRIGHT AND LICENSE
+ 
+-Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013 Russ
+-Allbery <rra@stanford.edu>.
++Copyright 1999, 2000, 2001, 2004, 2006, 2008, 2010, 2012, 2013, 2014,
++2015 Russ Allbery <rra@cpan.org>.
+ 
+ This program is free software; you may redistribute it and/or modify it
+ under the same terms as Perl itself.
+diff --git a/cpan/podlators/t/devise-date.t b/cpan/podlators/t/devise-date.t
+index c610dd9..9da9d1b 100644
+--- a/cpan/podlators/t/devise-date.t
++++ b/cpan/podlators/t/devise-date.t
+@@ -19,7 +19,7 @@ use Test::More tests => 2;
+ my $parser = Pod::Man->new;
+ is(
+     $parser->devise_date,
+-    strftime('%Y-%m-%d', localtime()),
++    strftime('%Y-%m-%d', gmtime()),
+     'devise_date matches strftime'
+ );
+ 
diff --git a/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff b/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff
new file mode 100644
index 0000000..fbd7b9d
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fixes/podman-utc.diff
@@ -0,0 +1,33 @@
+From c796775cdbd2cce06acbb7ac355187d4063017a2 Mon Sep 17 00:00:00 2001
+From: Chris Lamb <lamby@debian.org>
+Date: Wed, 15 Apr 2015 20:42:53 -0700
+Subject: Make the embedded date from Pod::Man reproducible
+
+While working on the "reproducible builds" effort, we have noticed
+that Pod::Man generates output that varies depending on the current
+timezone.
+
+The attached patch fixes this by using GMT (~UTC) dates instead.
+
+(backported to Perl 5.20.2 by Niko Tyni <ntyni@debian.org>)
+
+Origin: upstream, http://git.eyrie.org/?p=perl/podlators.git;a=commitdiff;h=913fbb2bd2ce071e20128629302ae2852554cad4
+Bug-Debian: https://bugs.debian.org/780259
+Patch-Name: fixes/podman-utc.diff
+---
+ cpan/podlators/lib/Pod/Man.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/podlators/lib/Pod/Man.pm b/cpan/podlators/lib/Pod/Man.pm
+index 0536662..c3ba201 100644
+--- a/cpan/podlators/lib/Pod/Man.pm
++++ b/cpan/podlators/lib/Pod/Man.pm
+@@ -910,7 +910,7 @@ sub devise_date {
+ 
+     # Can't use POSIX::strftime(), which uses Fcntl, because MakeMaker uses
+     # this and it has to work in the core which can't load dynamic libraries.
+-    my ($year, $month, $day) = (localtime($time))[5,4,3];
++    my ($year, $month, $day) = (gmtime($time))[5,4,3];
+     return sprintf("%04d-%02d-%02d", $year + 1900, $month + 1, $day);
+ }
+ 
diff --git a/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff b/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff
new file mode 100644
index 0000000..d1b498b
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/fixes/respect_umask.diff
@@ -0,0 +1,153 @@
+From d9d535ef97f57af6e9728075944c33f3b0b5372f Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Respect umask during installation
+
+This is needed to satisfy Debian policy regarding group-writable
+site directories.
+
+Patch-Name: fixes/respect_umask.diff
+---
+ cpan/ExtUtils-Install/lib/ExtUtils/Install.pm   | 18 +++++++++---------
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 18 +++++++++---------
+ 2 files changed, 18 insertions(+), 18 deletions(-)
+
+diff --git a/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm b/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
+index 1e8ac4c..3e79121 100644
+--- a/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
++++ b/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
+@@ -451,7 +451,7 @@ sub _can_write_dir {
+ 
+ =pod
+ 
+-=item _mkpath($dir,$show,$mode,$verbose,$dry_run)
++=item _mkpath($dir,$show,$verbose,$dry_run)
+ 
+ Wrapper around File::Path::mkpath() to handle errors.
+ 
+@@ -468,13 +468,13 @@ writable.
+ =cut
+ 
+ sub _mkpath {
+-    my ($dir,$show,$mode,$verbose,$dry_run)=@_;
++    my ($dir,$show,$verbose,$dry_run)=@_;
+     if ( $verbose && $verbose > 1 && ! -d $dir) {
+         $show= 1;
+-        printf "mkpath(%s,%d,%#o)\n", $dir, $show, $mode;
++        printf "mkpath(%s,%d)\n", $dir, $show;
+     }
+     if (!$dry_run) {
+-        if ( ! eval { File::Path::mkpath($dir,$show,$mode); 1 } ) {
++        if ( ! eval { File::Path::mkpath($dir,$show); 1 } ) {
+             _choke("Can't create '$dir'","$@");
+         }
+ 
+@@ -783,7 +783,7 @@ sub install { #XXX OS-SPECIFIC
+         _chdir($cwd);
+     }
+     foreach my $targetdir (sort keys %check_dirs) {
+-        _mkpath( $targetdir, 0, 0755, $verbose, $dry_run );
++        _mkpath( $targetdir, 0, $verbose, $dry_run );
+     }
+     foreach my $found (@found_files) {
+         my ($diff, $ffd, $origfile, $mode, $size, $atime, $mtime,
+@@ -797,7 +797,7 @@ sub install { #XXX OS-SPECIFIC
+                     $targetfile= _unlink_or_rename( $targetfile, 'tryhard', 'install' )
+                         unless $dry_run;
+                 } elsif ( ! -d $targetdir ) {
+-                    _mkpath( $targetdir, 0, 0755, $verbose, $dry_run );
++                    _mkpath( $targetdir, 0, $verbose, $dry_run );
+                 }
+                 print "Installing $targetfile\n";
+ 
+@@ -837,7 +837,7 @@ sub install { #XXX OS-SPECIFIC
+ 
+     if ($pack{'write'}) {
+         $dir = install_rooted_dir(dirname($pack{'write'}));
+-        _mkpath( $dir, 0, 0755, $verbose, $dry_run );
++        _mkpath( $dir, 0, $verbose, $dry_run );
+         print "Writing $pack{'write'}\n" if $verbose;
+         $packlist->write(install_rooted_file($pack{'write'})) unless $dry_run;
+     }
+@@ -1180,7 +1180,7 @@ environment variable will silence this output.
+ sub pm_to_blib {
+     my($fromto,$autodir,$pm_filter) = @_;
+ 
+-    _mkpath($autodir,0,0755);
++    _mkpath($autodir,0);
+     while(my($from, $to) = each %$fromto) {
+         if( -f $to && -s $from == -s $to && -M $to < -M $from ) {
+             print "Skip $to (unchanged)\n" unless $INSTALL_QUIET;
+@@ -1203,7 +1203,7 @@ sub pm_to_blib {
+             # we wont try hard here. its too likely to mess things up.
+             forceunlink($to);
+         } else {
+-            _mkpath(dirname($to),0,0755);
++            _mkpath(dirname($to),0);
+         }
+         if ($need_filtering) {
+             run_filter($pm_filter, $from, $to);
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index f63145c..197f102 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2118,7 +2118,7 @@ doc__install : doc_site_install
+ 	$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
+ 
+ pure_perl_install :: all
+-	$(NOECHO) $(MOD_INSTALL) \
++	$(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+ 
+     push @m,
+@@ -2138,7 +2138,7 @@ q{		"$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+ 
+ 
+ pure_site_install :: all
+-	$(NOECHO) $(MOD_INSTALL) \
++	$(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+     push @m,
+ q{		read "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+@@ -2156,7 +2156,7 @@ q{		"$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
+ 		"}.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{"
+ 
+ pure_vendor_install :: all
+-	$(NOECHO) $(MOD_INSTALL) \
++	$(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+     push @m,
+ q{		read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+@@ -2188,8 +2188,8 @@ doc_vendor_install :: all
+     push @m, q{
+ doc_perl_install :: all
+ 	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+-	-$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+-	-$(NOECHO) $(DOC_INSTALL) \
++	-$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++	-$(NOECHO) umask 022; $(DOC_INSTALL) \
+ 		"Module" "$(NAME)" \
+ 		"installed into" $(INSTALLPRIVLIB) \
+ 		LINKTYPE "$(LINKTYPE)" \
+@@ -2199,8 +2199,8 @@ doc_perl_install :: all
+ 
+ doc_site_install :: all
+ 	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+-	-$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+-	-$(NOECHO) $(DOC_INSTALL) \
++	-$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++	-$(NOECHO) umask 022; $(DOC_INSTALL) \
+ 		"Module" "$(NAME)" \
+ 		"installed into" $(INSTALLSITELIB) \
+ 		LINKTYPE "$(LINKTYPE)" \
+@@ -2210,8 +2210,8 @@ doc_site_install :: all
+ 
+ doc_vendor_install :: all
+ 	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+-	-$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+-	-$(NOECHO) $(DOC_INSTALL) \
++	-$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++	-$(NOECHO) umask 022; $(DOC_INSTALL) \
+ 		"Module" "$(NAME)" \
+ 		"installed into" $(INSTALLVENDORLIB) \
+ 		LINKTYPE "$(LINKTYPE)" \
diff --git a/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff b/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff
new file mode 100644
index 0000000..a62c746
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/instmodsh_doc.diff
@@ -0,0 +1,27 @@
+From 26209b55201a1b2d25252ac3b425bc49081299de Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Debian policy doesn't install .packlist files for core or vendor.
+
+Patch-Name: debian/instmodsh_doc.diff
+---
+ cpan/ExtUtils-MakeMaker/bin/instmodsh | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/bin/instmodsh b/cpan/ExtUtils-MakeMaker/bin/instmodsh
+index 8b9aa95..e551434 100644
+--- a/cpan/ExtUtils-MakeMaker/bin/instmodsh
++++ b/cpan/ExtUtils-MakeMaker/bin/instmodsh
+@@ -18,9 +18,11 @@ instmodsh - A shell to examine installed modules
+ 
+ =head1 DESCRIPTION
+ 
+-A little interface to ExtUtils::Installed to examine installed modules,
++A little interface to ExtUtils::Installed to examine locally* installed modules,
+ validate your packlists and even create a tarball from an installed module.
+ 
++*On Debian system, B<core> and B<vendor> modules are managed by C<dpkg>.
++
+ =head1 SEE ALSO
+ 
+ ExtUtils::Installed
diff --git a/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff b/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff
new file mode 100644
index 0000000..d80f86c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/ld_run_path.diff
@@ -0,0 +1,24 @@
+From 53ce69085918232a1b7e26e7762c1b2f70b1eb4a Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Remove standard libs from LD_RUN_PATH as per Debian policy.
+
+Patch-Name: debian/ld_run_path.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+index 37bcfd4..bd66e65 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+@@ -56,6 +56,9 @@ sub _unix_os2_ext {
+     my ( $pwd )   = cwd();    # from Cwd.pm
+     my ( $found ) = 0;
+ 
++    # Debian-specific: don't use LD_RUN_PATH for standard dirs
++    $ld_run_path_seen{$_}++ for @libpath;
++
+     foreach my $thislib ( split ' ', $potential_libs ) {
+         my ( $custom_name ) = '';
+ 
diff --git a/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff b/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff
new file mode 100644
index 0000000..54ef964
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/libnet_config_path.diff
@@ -0,0 +1,37 @@
+From a7f6d453e60256d329469a75b642cca854cebea1 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Set location of libnet.cfg to /etc/perl/Net as /usr may not be
+ writable.
+
+Patch-Name: debian/libnet_config_path.diff
+---
+ cpan/libnet/lib/Net/Config.pm | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/cpan/libnet/lib/Net/Config.pm b/cpan/libnet/lib/Net/Config.pm
+index 953a826..61ba12a 100644
+--- a/cpan/libnet/lib/Net/Config.pm
++++ b/cpan/libnet/lib/Net/Config.pm
+@@ -68,9 +68,8 @@ my %nc = (
+ TRY_INTERNET_CONFIG
+ }
+ 
+-my $file = __FILE__;
++my $file = '/etc/perl/Net/libnet.cfg';
+ my $ref;
+-$file =~ s/Config.pm/libnet.cfg/;
+ if (-f $file) {
+   $ref = eval { local $SIG{__DIE__}; do $file };
+   if (ref($ref) eq 'HASH') {
+@@ -142,8 +141,8 @@ Net::Config - Local configuration data for libnet
+ C<Net::Config> holds configuration data for the modules in the libnet
+ distribution. During installation you will be asked for these values.
+ 
+-The configuration data is held globally in a file in the perl installation
+-tree, but a user may override any of these values by providing their own. This
++The configuration data is held globally in C</etc/perl/Net/libnet.cfg>,
++but a user may override any of these values by providing their own. This
+ can be done by having a C<.libnetrc> file in their home directory. This file
+ should return a reference to a HASH containing the keys described below.
+ For example
diff --git a/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff b/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff
new file mode 100644
index 0000000..76b8054
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/libperl_embed_doc.diff
@@ -0,0 +1,26 @@
+From fb8bdbb4bf56382de099e62c2564286b9dfda46d Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Note that libperl-dev package is required for embedded linking
+
+Bug-Debian: http://bugs.debian.org/186778
+
+Patch-Name: debian/libperl_embed_doc.diff
+---
+ lib/ExtUtils/Embed.pm | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/ExtUtils/Embed.pm b/lib/ExtUtils/Embed.pm
+index 3f983c1..0ec8a67 100644
+--- a/lib/ExtUtils/Embed.pm
++++ b/lib/ExtUtils/Embed.pm
+@@ -296,6 +296,9 @@ and extensions in your C/C++ applications.
+ Typically, an application F<Makefile> will invoke C<ExtUtils::Embed>
+ functions while building your application.  
+ 
++Note that on Debian systems the B<libperl-dev> package is required for
++compiling applications which embed an interpreter.
++
+ =head1 @EXPORT
+ 
+ C<ExtUtils::Embed> exports the following functions:
diff --git a/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff b/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff
new file mode 100644
index 0000000..fd471ed
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/locale-robustness.diff
@@ -0,0 +1,52 @@
+From 289eaf87f8de4d9ebfd661d4e4299c2952435243 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 10 Apr 2015 10:19:51 +0300
+Subject: Make t/run/locale.t survive missing locales masked by LC_ALL
+
+If LC_ALL is set to a valid locale but another LC_* setting like LC_CTYPE
+isn't, t/run/locale.t would fail because it explicitly unsets LC_ALL,
+unmasking the problem underneath. All the other tests survive such
+a scenario.
+
+While this is clearly an error in the build environment, it's easy to make
+the test more robust by first clearing all the locale relevant variables.
+
+Bug: https://rt.perl.org/Ticket/Display.html?id=124310
+Bug-Debian: https://bugs.debian.org/782068
+Patch-Name: debian/locale-robustness.diff
+---
+ t/run/locale.t | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/t/run/locale.t b/t/run/locale.t
+index bd1a034..2105339 100644
+--- a/t/run/locale.t
++++ b/t/run/locale.t
+@@ -27,6 +27,9 @@ my @locales = eval { find_locales( [ &LC_ALL, &LC_CTYPE, &LC_NUMERIC ],
+                                  ) };
+ skip_all("no locales available") unless @locales;
+ 
++# reset the locale environment
++local @ENV{'LANG', (grep /^LC_/, keys %ENV)};
++
+ plan tests => &last;
+ 
+ my $non_C_locale;
+@@ -58,9 +61,6 @@ EOF
+ SKIP: {
+     skip("Windows stores locale defaults in the registry", 1 )
+                                                             if $^O eq 'MSWin32';
+-    local $ENV{LC_NUMERIC}; # So not taken as a default
+-    local $ENV{LC_ALL}; # so it never overrides LC_NUMERIC
+-    local $ENV{LANG};   # So not taken as a default
+     fresh_perl_is("for (qw(@locales)) {\n" . <<'EOF',
+         use POSIX qw(locale_h);
+         use locale;
+@@ -348,7 +348,6 @@ EOF
+ 
+     {
+ 	local $ENV{LC_NUMERIC} = $different;
+-	local $ENV{LC_ALL}; # so it never overrides LC_NUMERIC
+ 	fresh_perl_is(<<"EOF",
+ 	    use POSIX qw(locale_h);
+ 
diff --git a/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff b/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff
new file mode 100644
index 0000000..fa0f9da
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/makemaker-pasthru.diff
@@ -0,0 +1,30 @@
+From 593dd52f535b1f439dfd0afe52211ae8960e980a Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sun, 24 Aug 2014 12:56:11 -0700
+Subject: Pass LD settings through to subdirectories
+
+[rt.cpan.org #28632] fixed most issues with passing LD down to
+subdirectory Makefile.PL files. However, there are some distributions
+(including Wx, Par::Packer, and Verilog-Perl) that explicitly set
+LD. Those still can't be overridden from the command line. Adding LD to
+the PASTHRU list fixes this.
+
+Bug-Debian: https://bugs.debian.org/758471
+Patch-Name: debian/makemaker-pasthru.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 4a8e14c..548d98e 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2793,7 +2793,7 @@ sub pasthru {
+     my($sep) = $Is{VMS} ? ',' : '';
+     $sep .= "\\\n\t";
+ 
+-    foreach my $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE
++    foreach my $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE LD
+                      PREFIX INSTALL_BASE)
+                  )
+     {
diff --git a/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff b/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff
new file mode 100644
index 0000000..b1b4cb9
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/makemaker_customized.diff
@@ -0,0 +1,42 @@
+From 634449066a9c810e81506425d2ca925b2fd72ab2 Mon Sep 17 00:00:00 2001
+From: Dominic Hargreaves <dom@earth.li>
+Date: Sat, 23 May 2015 21:15:06 +0200
+Subject: Update t/porting/customized.dat for files patched in Debian
+
+Patch-Name: debian/makemaker_customized.diff
+---
+ t/porting/customized.dat | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/t/porting/customized.dat b/t/porting/customized.dat
+index 7df398d..f857bd2 100644
+--- a/t/porting/customized.dat
++++ b/t/porting/customized.dat
+@@ -1,7 +1,7 @@
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm 7f4dfd0fe884bd42412bcf04ca80ef97b39c1d54
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist.pm bef099988b15fb0b2a1f5ac48c01af1f7f36d329
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm 8168e18f0e3ce3ece4bb7e7c72d57ec07c67c402
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 7115e97a53559cb3ec061dd6f7f344e522724c4a
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm 3493ae6f93264e967f58dedaa3dbf3dbcb249853
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm 3d7abd674b15ed323f743594ef0bd09db76b1aee
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Config.pm f8db8d4245bf0684b8210c811f50d7cfb1a27d78
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/FAQ.pod 757bffb47857521311f8f3bde43ebe165f8d5191
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker/Locale.pm 82be06851deb84c6419ad003ce9b6d1957f395f3
+@@ -13,7 +13,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mkbootstrap.pm 58872d66
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/Mksymlists.pm ab80029ab16d38d4f2e41dc88d2ceb9f3790e477
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM.pm 453e0abbc4bb38db4c0820ad5c4846f313b66291
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_AIX.pm c1b1babda8f43ae7a2caba1cb4f70f92af5a0e34
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm 6f90d94ad3e7aa0045a3b1a10a1bb18391f89f57
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm 21bde53290bf1a4da4457290b65bd1b0ca6f1d16
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_BeOS.pm cab2b3ce08b71a4ce89aa630f236eb08b852439d
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Cygwin.pm 61fced0faf518bf87c265fcb51ed330ba354623f
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Darwin.pm ae0ef51a7b6dd0b05aa61c779df7167dda5f5119
+@@ -22,7 +22,7 @@ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_MacOS.pm 0544301f712
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_NW5.pm 433135eecb85b4b1d90d3027432f329436c78447
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_OS2.pm 1fbb5605bfb47feee4083feba8aa85e659628f70
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_QNX.pm 5b66d1f485a6034d96fc24ba1665b1bad9e447f1
+-ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm 8cef99a9bd370ecfd07ddb0efbdcbb4101255e45
++ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm c455c915fb7dc3eeb1200ed1cd19048e6f21e6b1
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_UWIN.pm 939572fde3d59ba77c2e677fe2df2bed4bed5898
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm 09c2049bfd25b735e2a5bcf56a6cff7b4827f9c8
+ ExtUtils::MakeMaker cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_VOS.pm d65d63f8217a55c36f62e249814988974f593c79
diff --git a/meta/recipes-devtools/perl/perl/debian/mod_paths.diff b/meta/recipes-devtools/perl/perl/debian/mod_paths.diff
new file mode 100644
index 0000000..ae15907
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/mod_paths.diff
@@ -0,0 +1,99 @@
+From 6c6cf14e204f3c031372bfd9604ad524d5691186 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Tweak @INC ordering for Debian
+
+Our order is:
+
+    etc (for config files)
+    site (5.8.1)
+    vendor (all)
+    core (5.8.1)
+    site (version-indep)
+    site (pre-5.8.1)
+
+The rationale being that an admin (via site), or module packager
+(vendor) can chose to shadow core modules when there is a newer
+version than is included in core.
+
+Patch-Name: debian/mod_paths.diff
+---
+ perl.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 58 insertions(+)
+
+diff --git a/perl.c b/perl.c
+index 086645b..e64f1f4 100644
+--- a/perl.c
++++ b/perl.c
+@@ -4373,6 +4373,11 @@ S_init_perllib(pTHX)
+ 		      INCPUSH_ADD_SUB_DIRS|INCPUSH_CAN_RELOCATE);
+ #endif
+ 
++#ifdef DEBIAN
++    /* for configuration where /usr is mounted ro (CPAN::Config, Net::Config) */
++    S_incpush_use_sep(aTHX_ STR_WITH_LEN("/etc/perl"), 0x0);
++#endif
++
+ #ifdef SITEARCH_EXP
+     /* sitearch is always relative to sitelib on Windows for
+      * DLL-based path intuition to work correctly */
+@@ -4490,6 +4495,59 @@ S_init_perllib(pTHX)
+ 		      INCPUSH_ADD_OLD_VERS|INCPUSH_CAN_RELOCATE);
+ #endif
+ 
++#ifdef DEBIAN
++    /* Non-versioned site directory for local modules and for
++       compatability with the previous packages' site dirs */
++    S_incpush_use_sep(aTHX_ STR_WITH_LEN("/usr/local/lib/site_perl"),
++		      INCPUSH_ADD_SUB_DIRS);
++
++#ifdef PERL_INC_VERSION_LIST
++    {
++	struct stat s;
++
++	/* add small buffer in case old versions are longer than the
++	   current version */
++	char sitearch[sizeof(SITEARCH_EXP)+16] = SITEARCH_EXP;
++	char sitelib[sizeof(SITELIB_EXP)+16] = SITELIB_EXP;
++	char const *vers[] = { PERL_INC_VERSION_LIST };
++	char const **p;
++
++	char *arch_vers = strrchr(sitearch, '/');
++	char *lib_vers = strrchr(sitelib, '/');
++
++	if (arch_vers && isdigit(*++arch_vers))
++	    *arch_vers = 0;
++	else
++	    arch_vers = 0;
++
++	if (lib_vers && isdigit(*++lib_vers))
++	    *lib_vers = 0;
++	else
++	    lib_vers = 0;
++
++	/* there is some duplication here as incpush does something
++	   similar internally, but required as sitearch is not a
++	   subdirectory of sitelib */
++	for (p = vers; *p; p++)
++	{
++	    if (arch_vers)
++	    {
++		strcpy(arch_vers, *p);
++		if (PerlLIO_stat(sitearch, &s) >= 0 && S_ISDIR(s.st_mode))
++		    S_incpush_use_sep(aTHX_ sitearch, strlen(sitearch), 0x0);
++	    }
++
++	    if (lib_vers)
++	    {
++		strcpy(lib_vers, *p);
++		if (PerlLIO_stat(sitelib, &s) >= 0 && S_ISDIR(s.st_mode))
++		    S_incpush_use_sep(aTHX_ sitelib, strlen(sitelib), 0x0);
++	    }
++	}
++    }
++#endif
++#endif
++
+ #ifdef PERL_OTHERLIBDIRS
+     S_incpush_use_sep(aTHX_ STR_WITH_LEN(PERL_OTHERLIBDIRS),
+ 		      INCPUSH_ADD_OLD_VERS|INCPUSH_ADD_ARCHONLY_SUB_DIRS
diff --git a/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff b/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff
new file mode 100644
index 0000000..b911fd2
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/no_packlist_perllocal.diff
@@ -0,0 +1,92 @@
+From 240f2f4aeb3850bc0c5370b9fbc3909573bed9b3 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Don't install .packlist or perllocal.pod for perl or vendor
+
+Patch-Name: debian/no_packlist_perllocal.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 35 +++----------------------
+ 1 file changed, 3 insertions(+), 32 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 570a631..391dc22 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2122,11 +2122,6 @@ pure_perl_install :: all
+ };
+ 
+     push @m,
+-q{		read "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+-		write "}.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+-
+-    push @m,
+ q{		"$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+ 		"$(INST_ARCHLIB)" "$(DESTINSTALLARCHLIB)" \
+ 		"$(INST_BIN)" "$(DESTINSTALLBIN)" \
+@@ -2158,10 +2153,6 @@ q{		"$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
+ pure_vendor_install :: all
+ 	$(NOECHO) umask 022; $(MOD_INSTALL) \
+ };
+-    push @m,
+-q{		read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+-		write "}.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+ 
+     push @m,
+ q{		"$(INST_LIB)" "$(DESTINSTALLVENDORLIB)" \
+@@ -2187,37 +2178,19 @@ doc_vendor_install :: all
+ 
+     push @m, q{
+ doc_perl_install :: all
+-	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+-	-$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
+-	-$(NOECHO) umask 022; $(DOC_INSTALL) \
+-		"Module" "$(NAME)" \
+-		"installed into" $(INSTALLPRIVLIB) \
+-		LINKTYPE "$(LINKTYPE)" \
+-		VERSION "$(VERSION)" \
+-		EXE_FILES "$(EXE_FILES)" \
+-		>> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+ 
+ doc_site_install :: all
+-	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+-	-$(NOECHO) umask 02; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLSITEARCH)/perllocal.pod"
++	-$(NOECHO) umask 02; $(MKPATH) "$(DESTINSTALLSITEARCH)"
+ 	-$(NOECHO) umask 02; $(DOC_INSTALL) \
+ 		"Module" "$(NAME)" \
+ 		"installed into" $(INSTALLSITELIB) \
+ 		LINKTYPE "$(LINKTYPE)" \
+ 		VERSION "$(VERSION)" \
+ 		EXE_FILES "$(EXE_FILES)" \
+-		>> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
++		>> "}.$self->catfile('$(DESTINSTALLSITEARCH)','perllocal.pod').q{"
+ 
+ doc_vendor_install :: all
+-	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+-	-$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
+-	-$(NOECHO) umask 022; $(DOC_INSTALL) \
+-		"Module" "$(NAME)" \
+-		"installed into" $(INSTALLVENDORLIB) \
+-		LINKTYPE "$(LINKTYPE)" \
+-		VERSION "$(VERSION)" \
+-		EXE_FILES "$(EXE_FILES)" \
+-		>> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+ 
+ } unless $self->{NO_PERLLOCAL};
+ 
+@@ -2226,13 +2199,11 @@ uninstall :: uninstall_from_$(INSTALLDIRS)dirs
+ 	$(NOECHO) $(NOOP)
+ 
+ uninstall_from_perldirs ::
+-	$(NOECHO) $(UNINSTALL) "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{"
+ 
+ uninstall_from_sitedirs ::
+ 	$(NOECHO) $(UNINSTALL) "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+ 
+ uninstall_from_vendordirs ::
+-	$(NOECHO) $(UNINSTALL) "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+ };
+ 
+     join("",@m);
diff --git a/meta/recipes-devtools/perl/perl/debian/patchlevel.diff b/meta/recipes-devtools/perl/perl/debian/patchlevel.diff
new file mode 100644
index 0000000..8656b02
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/patchlevel.diff
@@ -0,0 +1,30 @@
+From b517c5e15d0871e36d0f1187661fe1dd28ddf820 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sun, 15 May 2011 19:35:58 +0300
+Subject: List packaged patches in patchlevel.h
+
+Origin: vendor
+Bug-Debian: http://bugs.debian.org/567489
+
+The list of packaged patches is in patchlevel-debian.h, which is generated
+from the debian/patches/ directory when building the package.
+
+Patch-Name: debian/patchlevel.diff
+---
+ patchlevel.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/patchlevel.h b/patchlevel.h
+index a0ad78b..01367b7 100644
+--- a/patchlevel.h
++++ b/patchlevel.h
+@@ -137,6 +137,9 @@ static const char * const local_patches[] = {
+ 	,"uncommitted-changes"
+ #endif
+ 	PERL_GIT_UNPUSHED_COMMITS    	/* do not remove this line */
++#ifdef DEBIAN
++#include "patchlevel-debian.h"
++#endif
+ 	,NULL
+ };
+ 
diff --git a/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch b/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch
new file mode 100644
index 0000000..533952c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/perl5db-x-terminal-emulator.patch
@@ -0,0 +1,29 @@
+From c99c61e8f863a508a0793168011c98dc74abbd05 Mon Sep 17 00:00:00 2001
+From: Dominic Hargreaves <dom@earth.li>
+Date: Sat, 14 Apr 2012 11:34:05 +0100
+Subject: Invoke x-terminal-emulator rather than xterm in perl5db.pl
+
+In Debian systems, xterm might not exist or might not be the preferred
+terminal emulator. Use x-terminal-emulator instead
+
+Bug-Debian: http://bugs.debian.org/668490
+Forwarded: not-needed
+
+Patch-Name: debian/perl5db-x-terminal-emulator.patch
+---
+ lib/perl5db.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/perl5db.pl b/lib/perl5db.pl
+index 7e7194e..c466bf3 100644
+--- a/lib/perl5db.pl
++++ b/lib/perl5db.pl
+@@ -6960,7 +6960,7 @@ properly set up.
+ sub xterm_get_fork_TTY {
+     ( my $name = $0 ) =~ s,^.*[/\\],,s;
+     open XT,
+-qq[3>&1 xterm -title "Daughter Perl debugger $pids $name" -e sh -c 'tty 1>&3;\
++qq[3>&1 x-terminal-emulator -T "Daughter Perl debugger $pids $name" -e sh -c 'tty 1>&3;\
+  sleep 10000000' |];
+ 
+     # Get the output from 'tty' and clean it up a little.
diff --git a/meta/recipes-devtools/perl/perl/debian/perlivp.diff b/meta/recipes-devtools/perl/perl/debian/perlivp.diff
new file mode 100644
index 0000000..2c1eab9
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/perlivp.diff
@@ -0,0 +1,39 @@
+From fbfbeb7a690d703a3cdc56f923e89eb7b7997d31 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 9 Jan 2009 18:54:47 +0200
+Subject: Make perlivp skip include directories in /usr/local
+
+Bug-Debian: http://bugs.debian.org/510895
+
+On Sat, Jan 10, 2009 at 12:37:18AM +1100, Brendan O'Dea wrote:
+> On Wed, Jan 7, 2009 at 12:21 AM, Niko Tyni <ntyni@debian.org> wrote:
+
+> > We could create the directories in a postinst script, but I'm not sure
+> > I see the point. They will be created automatically when installing
+> > CPAN modules.
+>
+> The directories are intentionally not created, as this way they are
+> excluded from the search path at start-up, saving a bunch of wasted
+> stats at use/require time in the common case that the user has not
+> installed any local packages.  As Niko points out, they will be
+> created as required.
+
+Signed-off-by: Niko Tyni <ntyni@debian.org>
+
+Patch-Name: debian/perlivp.diff
+---
+ utils/perlivp.PL | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/utils/perlivp.PL b/utils/perlivp.PL
+index c2f0a11..cc49f96 100644
+--- a/utils/perlivp.PL
++++ b/utils/perlivp.PL
+@@ -153,6 +153,7 @@ my $INC_total = 0;
+ my $INC_there = 0;
+ foreach (@INC) {
+     next if $_ eq '.'; # skip -d test here
++    next if m|/usr/local|; # not shipped on Debian
+     if (-d $_) {
+         print "## Perl \@INC directory '$_' exists.\n" if $opt{'v'};
+         $INC_there++;
diff --git a/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff b/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff
new file mode 100644
index 0000000..6270b87
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/pod2man-customized.diff
@@ -0,0 +1,23 @@
+From 27a4952c2e531947dc9f2f02e2063d117e2e699a Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sat, 18 Apr 2015 17:39:32 +0300
+Subject: Update porting/customized.dat for pod2man modifications
+
+Patch-Name: debian/pod2man-customized.diff
+---
+ t/porting/customized.dat | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/t/porting/customized.dat b/t/porting/customized.dat
+index 0eed9f7..7df398d 100644
+--- a/t/porting/customized.dat
++++ b/t/porting/customized.dat
+@@ -42,7 +42,7 @@ Win32API::File cpan/Win32API-File/Makefile.PL 605d0aee31aebe84a99408f9ab5f644db5
+ Win32API::File cpan/Win32API-File/t/file.t 124e64aa77e755235eb297644a87fac5388d3d78
+ Win32API::File cpan/Win32API-File/t/tie.t 712ea7edd0cc805ce1c0b8172c01b03dd19b583d
+ Win32API::File cpan/Win32API-File/typemap 24bff088babeadac0873e8df390d1666d9d9db4a
+-podlators cpan/podlators/scripts/pod2man.PL f81acf53f3ff46cdcc5ebdd661c5d13eb35d20d6
++podlators cpan/podlators/scripts/pod2man.PL 761f35d3fcf91c1bc2f9e024a9fa5c62fd3fc338
+ podlators cpan/podlators/scripts/pod2text.PL b4693fcfe4a0a1b38a215cfb8985a65d5d025d69
+ version cpan/version/lib/version.pm d0923b895d57f1d669ae36fcf85c87b16db341d1
+ version vutil.c 668f17ca43e2527645674d29ba772b86330d5663
diff --git a/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff b/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff
new file mode 100644
index 0000000..c41efbe
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/prefix_changes.diff
@@ -0,0 +1,118 @@
+From 914948f026efce02cf0abff8b0312aaad96592ed Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Fiddle with *PREFIX and variables written to the makefile
+
+Fiddle with *PREFIX and variables written to the makefile so that
+install directories may be changed when make is run by passing
+PREFIX= to the "make install" command (used when packaging
+modules).
+
+Patch-Name: debian/prefix_changes.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm  | 12 ++++++------
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm |  3 +--
+ cpan/ExtUtils-MakeMaker/t/INST.t                |  4 +---
+ cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t         | 10 +++++-----
+ 4 files changed, 13 insertions(+), 16 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
+index 4c00129..1ea2035 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
+@@ -902,8 +902,6 @@ all POD files in MAN1PODS and MAN3PODS.
+ sub manifypods_target {
+     my($self) = shift;
+ 
+-    my $man1pods      = '';
+-    my $man3pods      = '';
+     my $dependencies  = '';
+ 
+     # populate manXpods & dependencies:
+@@ -919,7 +917,7 @@ END
+     foreach my $section (qw(1 3)) {
+         my $pods = $self->{"MAN${section}PODS"};
+         my $p2m = sprintf <<CMD, $] > 5.008 ? " -u" : "";
+-	\$(NOECHO) \$(POD2MAN) --section=$section --perm_rw=\$(PERM_RW)%s
++	\$(NOECHO) \$(POD2MAN) --section=\$(MAN${section}EXT) --perm_rw=\$(PERM_RW)%s
+ CMD
+         push @man_cmds, $self->split_command($p2m, map {($_,$pods->{$_})} sort keys %$pods);
+     }
+@@ -1875,9 +1873,11 @@ sub init_INSTALL_from_PREFIX {
+         $self->{SITEPREFIX}   ||= $sprefix;
+         $self->{VENDORPREFIX} ||= $vprefix;
+ 
+-        # Lots of MM extension authors like to use $(PREFIX) so we
+-        # put something sensible in there no matter what.
+-        $self->{PREFIX} = '$('.uc $self->{INSTALLDIRS}.'PREFIX)';
++	my $p = $self->{PREFIX} = $self->{PERLPREFIX};
++	for my $t (qw/PERL SITE VENDOR/)
++	{
++	    $self->{"${t}PREFIX"} =~ s!^\Q$p\E(?=/|$)!\$(PREFIX)!;
++	}
+     }
+ 
+     my $arch    = $Config{archname};
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 391dc22..4a8e14c 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -3077,8 +3077,7 @@ sub prefixify {
+     warn "  prefixify $var => $path\n" if $Verbose >= 2;
+     warn "    from $sprefix to $rprefix\n" if $Verbose >= 2;
+ 
+-    if( $self->{ARGS}{PREFIX} &&
+-        $path !~ s{^\Q$sprefix\E\b}{$rprefix}s )
++    if( $path !~ s{^\Q$sprefix\E\b}{$rprefix}s && $self->{ARGS}{PREFIX} )
+     {
+ 
+         warn "    cannot prefix, using default.\n" if $Verbose >= 2;
+diff --git a/cpan/ExtUtils-MakeMaker/t/INST.t b/cpan/ExtUtils-MakeMaker/t/INST.t
+index 91058bb..e399ced 100644
+--- a/cpan/ExtUtils-MakeMaker/t/INST.t
++++ b/cpan/ExtUtils-MakeMaker/t/INST.t
+@@ -65,9 +65,7 @@ isa_ok( $mm, 'ExtUtils::MakeMaker' );
+ is( $mm->{NAME}, 'Big::Dummy',  'NAME' );
+ is( $mm->{VERSION}, 0.01,            'VERSION' );
+ 
+-my $config_prefix = $Config{installprefixexp} || $Config{installprefix} ||
+-                    $Config{prefixexp}        || $Config{prefix};
+-is( $mm->{PERLPREFIX}, $config_prefix,   'PERLPREFIX' );
++is( $mm->{PERLPREFIX}, '$(PREFIX)',   'PERLPREFIX' );
+ 
+ is( !!$mm->{PERL_CORE}, !!$ENV{PERL_CORE}, 'PERL_CORE' );
+ 
+diff --git a/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t b/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
+index e8de7c6..3fb3f12 100644
+--- a/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
++++ b/cpan/ExtUtils-MakeMaker/t/INST_PREFIX.t
+@@ -10,7 +10,7 @@ BEGIN {
+ }
+ 
+ use strict;
+-use Test::More tests => 52;
++use Test::More tests => 47;
+ use MakeMaker::Test::Utils;
+ use MakeMaker::Test::Setup::BFD;
+ use ExtUtils::MakeMaker;
+@@ -62,16 +62,16 @@ like( $stdout->read, qr{
+                         (?:Writing\ MYMETA.yml\ and\ MYMETA.json\n)?
+ }x );
+ 
+-is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
++#is( $mm->{PREFIX}, '$(SITEPREFIX)', 'PREFIX set based on INSTALLDIRS' );
+ 
+ isa_ok( $mm, 'ExtUtils::MakeMaker' );
+ 
+ is( $mm->{NAME}, 'Big::Dummy',  'NAME' );
+ is( $mm->{VERSION}, 0.01,            'VERSION' );
+ 
+-foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
+-    unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
+-}
++#foreach my $prefix (qw(PREFIX PERLPREFIX SITEPREFIX VENDORPREFIX)) {
++#    unlike( $mm->{$prefix}, qr/\$\(PREFIX\)/ );
++#}
+ 
+ 
+ my $PREFIX = File::Spec->catdir('foo', 'bar');
diff --git a/meta/recipes-devtools/perl/perl/debian/prune_libs.diff b/meta/recipes-devtools/perl/perl/debian/prune_libs.diff
new file mode 100644
index 0000000..b4443f6
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/prune_libs.diff
@@ -0,0 +1,38 @@
+From 21bc033755f0b609f9bb2aa9e98b10d58424406f Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Fri, 18 Mar 2005 22:22:25 +1100
+Subject: Prune the list of libraries wanted to what we actually need.
+
+Bug-Debian: http://bugs.debian.org/128355
+
+We want to keep the dependencies on perl-base as small as possible,
+and some of the original list may be present on buildds (see Bug#128355).
+
+Patch-Name: debian/prune_libs.diff
+---
+ Configure | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/Configure b/Configure
+index 0a405d3..6fcc3bc 100755
+--- a/Configure
++++ b/Configure
+@@ -1454,8 +1454,7 @@ libswanted_uselargefiles=''
+ : set usesocks on the Configure command line to enable socks.
+ : List of libraries we want.
+ : If anyone needs extra -lxxx, put those in a hint file.
+-libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
+-libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD"
++libswanted='gdbm gdbm_compat db dl m c crypt'
+ : We probably want to search /usr/shlib before most other libraries.
+ : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
+ glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
+@@ -23593,7 +23592,7 @@ sunos*X4*)
+     ;;
+ *) case "$usedl" in
+     $define|true|[yY]*)
+-	    set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
++	    set X `echo " $libs " | sed -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldb @ @'`
+ 	    shift
+ 	    perllibs="$*"
+ 	    ;;
diff --git a/meta/recipes-devtools/perl/perl/debian/regen-skip.diff b/meta/recipes-devtools/perl/perl/debian/regen-skip.diff
new file mode 100644
index 0000000..8a3fc99
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/regen-skip.diff
@@ -0,0 +1,27 @@
+From cb3e98e17a666896150b109694e9eb9278620845 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sat, 17 May 2014 14:57:01 +0300
+Subject: Skip a regeneration check in unrelated git repositories
+
+If the test is run in a git repository without lib/.gitignore,
+for instance because the repository only imported the Perl tarball,
+the regeneration check is broken because lib/.gitignore is missing.
+
+Patch-Name: debian/regen-skip.diff
+---
+ regen/lib_cleanup.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/regen/lib_cleanup.pl b/regen/lib_cleanup.pl
+index c9d6e43..fece1ed 100644
+--- a/regen/lib_cleanup.pl
++++ b/regen/lib_cleanup.pl
+@@ -159,7 +159,7 @@ foreach ('win32/Makefile', 'win32/makefile.mk') {
+ }
+ 
+ # This must come last as it can exit early:
+-if ($TAP && !-d '.git' && !-f 'lib/.gitignore') {
++if ($TAP && !-d '.git' || !-f 'lib/.gitignore') {
+     print "ok # skip not being run from a git checkout, hence no lib/.gitignore\n";
+     exit 0;
+ }
diff --git a/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff b/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff
new file mode 100644
index 0000000..ecfc0bc
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/skip-kfreebsd-crash.diff
@@ -0,0 +1,40 @@
+From 42853af65a28066b119d23d96e964e94b55a8541 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 5 Aug 2011 10:50:18 +0300
+Subject: Skip a crashing test case in t/op/threads.t on GNU/kFreeBSD
+
+Bug: http://rt.perl.org/rt3/Ticket/Display.html?id=96272
+Bug-Debian: http://bugs.debian.org/628493
+
+The crash is not a regression in 5.14, it just gets triggered there by
+a new unrelated test case.
+
+Skip the test until the culprit is found.
+
+Patch-Name: debian/skip-kfreebsd-crash.diff
+---
+ t/op/threads.t | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/t/op/threads.t b/t/op/threads.t
+index e76c956..bec210b 100644
+--- a/t/op/threads.t
++++ b/t/op/threads.t
+@@ -376,6 +376,9 @@ EOF
+ }
+ 
+ 
++SKIP: {
++    skip "[perl #96272] avoid crash on GNU/kFreeBSD", 1
++        if $^O eq 'gnukfreebsd';
+ # [perl #78494] Pipes shared between threads block when closed
+ {
+   my $perl = which_perl;
+@@ -384,6 +387,7 @@ EOF
+   threads->create(sub { })->join;
+   ok(1, "Pipes shared between threads do not block when closed");
+ }
++}
+ 
+ # [perl #105208] Typeglob clones should not be cloned again during a join
+ {
diff --git a/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff b/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff
new file mode 100644
index 0000000..4c87104
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/skip-upstream-git-tests.diff
@@ -0,0 +1,28 @@
+From ae9b645d6da2990fd055368eca2c67c449474e38 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Fri, 22 Apr 2011 11:15:32 +0300
+Subject: Skip tests specific to the upstream Git repository
+
+These tests fail if run from a different git repository than
+upstream. This complicates things needlessly for downstream packagers.
+
+Skip the tests altogether even if the .git directory exists.
+
+Patch-Name: debian/skip-upstream-git-tests.diff
+---
+ t/test.pl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/t/test.pl b/t/test.pl
+index cda3840..af579a2 100644
+--- a/t/test.pl
++++ b/t/test.pl
+@@ -174,7 +174,7 @@ sub skip_all_without_unicode_tables { # (but only under miniperl)
+ 
+ sub find_git_or_skip {
+     my ($source_dir, $reason);
+-    if (-d '.git') {
++    if (-d '.git' && ! -d 'debian') {
+ 	$source_dir = '.';
+     } elsif (-l 'MANIFEST' && -l 'AUTHORS') {
+ 	my $where = readlink 'MANIFEST';
diff --git a/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff b/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff
new file mode 100644
index 0000000..cb31457
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/squelch-locale-warnings.diff
@@ -0,0 +1,56 @@
+From 487a6d6ada0b08e6a7276520ebc61cd851005e7c Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Sun, 3 Oct 2010 21:36:17 +0300
+Subject: Squelch locale warnings in Debian package maintainer scripts
+
+Bug-Debian: http://bugs.debian.org/508764
+
+The system locales are rather frequently out of sync with the C library
+during package upgrades, causing a huge amount of useless Perl locale
+warnings. Squelch them when running package maintainer scripts, detected
+by the DPKG_RUNNING_VERSION environment variable.
+
+Any real locale problem will show up after the system upgrade too, and
+the warning will be triggered normally again at that point.
+
+Patch-Name: debian/squelch-locale-warnings.diff
+---
+ locale.c           | 5 ++++-
+ pod/perllocale.pod | 8 ++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/locale.c b/locale.c
+index 7a4a418..fdf911d 100644
+--- a/locale.c
++++ b/locale.c
+@@ -674,7 +674,10 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
+ 
+     const bool locwarn = (printwarn > 1
+                           || (printwarn
+-                              && (! bad_lang_use_once
++                              &&
++                                 /* Debian specific change - see http://bugs.debian.org/508764 */
++                                 (!PerlEnv_getenv("DPKG_RUNNING_VERSION")) &&
++                                 (! bad_lang_use_once
+                                   || (
+                                     /* disallow with "" or "0" */
+                                     *bad_lang_use_once
+diff --git a/pod/perllocale.pod b/pod/perllocale.pod
+index 701b422..58cabaf 100644
+--- a/pod/perllocale.pod
++++ b/pod/perllocale.pod
+@@ -1217,6 +1217,14 @@ B<NOTE>: C<PERL_BADLANG> only gives you a way to hide the warning message.
+ The message tells about some problem in your system's locale support,
+ and you should investigate what the problem is.
+ 
++=item DPKG_RUNNING_VERSION
++
++On Debian systems, if the DPKG_RUNNING_VERSION environment variable is
++set (to any value), the locale failure warnings will be suppressed just
++like with a zero PERL_BADLANG setting. This is done to avoid floods
++of spurious warnings during system upgrades.
++See L<http://bugs.debian.org/508764>.
++
+ =back
+ 
+ The following environment variables are not specific to Perl: They are
diff --git a/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff b/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff
new file mode 100644
index 0000000..53adc2f
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/debian/writable_site_dirs.diff
@@ -0,0 +1,36 @@
+From 591c1f9b7d4755bfc59d9665bab1f2ca410de765 Mon Sep 17 00:00:00 2001
+From: Brendan O'Dea <bod@debian.org>
+Date: Tue, 8 Mar 2005 19:30:38 +1100
+Subject: Set umask approproately for site install directories
+
+Policy requires group writable site directories
+
+Patch-Name: debian/writable_site_dirs.diff
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 197f102..5f1b87f 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2138,7 +2138,7 @@ q{		"$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+ 
+ 
+ pure_site_install :: all
+-	$(NOECHO) umask 022; $(MOD_INSTALL) \
++	$(NOECHO) umask 02; $(MOD_INSTALL) \
+ };
+     push @m,
+ q{		read "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+@@ -2199,8 +2199,8 @@ doc_perl_install :: all
+ 
+ doc_site_install :: all
+ 	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+-	-$(NOECHO) umask 022; $(MKPATH) "$(DESTINSTALLARCHLIB)"
+-	-$(NOECHO) umask 022; $(DOC_INSTALL) \
++	-$(NOECHO) umask 02; $(MKPATH) "$(DESTINSTALLARCHLIB)"
++	-$(NOECHO) umask 02; $(DOC_INSTALL) \
+ 		"Module" "$(NAME)" \
+ 		"installed into" $(INSTALLSITELIB) \
+ 		LINKTYPE "$(LINKTYPE)" \
diff --git a/meta/recipes-devtools/perl/perl/dynaloaderhack.patch b/meta/recipes-devtools/perl/perl/dynaloaderhack.patch
new file mode 100644
index 0000000..3df5933
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/dynaloaderhack.patch
@@ -0,0 +1,23 @@
+Hack the dynamic module loader so that we use native modules since we can't load
+the target ones.
+
+Upstream-Status: Inappropriate
+
+RP
+2013/01/13
+
+Index: perl-5.14.2/ext/DynaLoader/DynaLoader_pm.PL
+===================================================================
+--- perl-5.14.2.orig/ext/DynaLoader/DynaLoader_pm.PL	2011-09-19 13:18:22.000000000 +0000
++++ perl-5.14.2/ext/DynaLoader/DynaLoader_pm.PL	2013-01-19 16:09:51.020584945 +0000
+@@ -310,6 +310,10 @@
+     foreach (@INC) {
+ 	<<$^O-eq-VMS>>chop($_ = VMS::Filespec::unixpath($_));<</$^O-eq-VMS>>
+ 	    my $dir = "$_/auto/$modpname";
++
++	if (defined $ENV{PERL_LIB} and defined $ENV{PERLHOSTLIB}) {
++	    $dir =~ s/$ENV{PERL_LIB}/$ENV{PERLHOSTLIB}/g;
++	}
+ 	
+ 	next unless -d $dir; # skip over uninteresting directories
+ 	
diff --git a/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch b/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch
new file mode 100644
index 0000000..994ef70
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch
@@ -0,0 +1,35 @@
+From ba4ed0b5b7baad5353c1e65b655f41d45e01c990 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 22 Jun 2015 20:00:11 -0700
+Subject: [PATCH] ext/ODBM_File/hints/linux.pl: link libgdbm_compat
+
+Fixed for test case ../ext/ODBM_File/t/odbm.t:
+ok 1 - use ODBM_File;
+ok 2 - use Fcntl;
+./perl: symbol lookup error: /usr/lib/perl/5.22.0/auto/ODBM_File/ODBM_File.so: undefined symbol: dbminit
+
+The checking "if -e $_.'/libgdbm_compat.so'" doesn't work when cross
+build, so always link libgdbm_compat, since perl depends on gdbm and we
+always have libgdbm_compat.
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ ext/ODBM_File/hints/linux.pl |    6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/ext/ODBM_File/hints/linux.pl b/ext/ODBM_File/hints/linux.pl
+index 204bba0..9271b45 100644
+--- a/ext/ODBM_File/hints/linux.pl
++++ b/ext/ODBM_File/hints/linux.pl
+@@ -1,8 +1,2 @@
+ # uses GDBM dbm compatibility feature - at least on SuSE 8.0
+-$self->{LIBS} = ['-lgdbm'];
+-
+-# Debian/Ubuntu have libgdbm_compat.so but not this file,
+-# so linking may fail
+-foreach (split / /, $Config{libpth}) {
+-    $self->{LIBS}->[0] .= ' -lgdbm_compat' if -e $_.'/libgdbm_compat.so';
+-}
++$self->{LIBS} = ['-lgdbm -lgdbm_compat'];
diff --git a/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch b/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch
new file mode 100644
index 0000000..6b05b87
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch
@@ -0,0 +1,31 @@
+From b842e1de7798a1f7df770bb3f185ad3356e490e6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 22 Jun 2015 20:06:56 -0700
+Subject: [PATCH] ext/ODBM_File/t/odbm.t: fix the  path of dbmt_common.pl
+
+It should be lib/dbmt_common.pl when run by run-ptest.
+
+Fixed:
+Can't locate ../../t/lib/dbmt_common.pl in @INC
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ ext/ODBM_File/t/odbm.t |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext/ODBM_File/t/odbm.t b/ext/ODBM_File/t/odbm.t
+index 079b9f1..250b991 100644
+--- a/ext/ODBM_File/t/odbm.t
++++ b/ext/ODBM_File/t/odbm.t
+@@ -2,7 +2,7 @@
+ 
+ our $DBM_Class = 'ODBM_File';
+ 
+-require '../../t/lib/dbmt_common.pl';
++require 'lib/dbmt_common.pl';
+ 
+ if ($^O eq 'hpux') {
+     print <<EOM;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch b/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch
new file mode 100644
index 0000000..69ac434
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/fix_bad_rpath.patch
@@ -0,0 +1,24 @@
+Upstream-Status:Inappropriate [embedded specific]
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/07/01
+
+Fix these Package QA warnings before they are converted into fetal errors:
+
+WARNING: QA Issue: package perl-module-compress contains bad RPATH /build_disk/poky_build/build0/tmp/sysroots/qemux86/usr/lib in file /build_disk/poky_build/build0/tmp/work/i586-poky-linux/perl-5.12.3-r1/packages-split/perl-module-compress/usr/lib/perl/5.12.3/auto/Compress/Raw/Zlib/Zlib.so
+
+This fixes this warning for perl recipe as well as libxml-parser-perl recipe. 
+It is a fix to MakeMaker within perl, so all such perl recipes will get 
+fixed with this perl fix.
+
+Index: perl-5.14.2/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+===================================================================
+--- perl-5.14.2.orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
++++ perl-5.14.2/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+@@ -55,6 +55,7 @@ sub _unix_os2_ext {
+     my($found) = 0;
+ 
+     # Debian-specific: don't use LD_RUN_PATH for standard dirs
++    push(@libpath, "SYSROOTLIB");
+     $ld_run_path_seen{$_}++ for @libpath;
+ 
+     foreach my $thislib (split ' ', $potential_libs) {
diff --git a/meta/recipes-devtools/perl/perl/generate-sh.patch b/meta/recipes-devtools/perl/perl/generate-sh.patch
new file mode 100644
index 0000000..27f6e69
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/generate-sh.patch
@@ -0,0 +1,56 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Use the ld flags from the supplied configuration file. For sh we need the
+flags that specify to build PIC code so that the shared libraries work.
+
+Index: perl-5.14.2/Cross/generate_config_sh
+===================================================================
+--- perl-5.14.2.orig/Cross/generate_config_sh	2010-12-30 04:07:14.000000000 +0200
++++ perl-5.14.2/Cross/generate_config_sh	2012-11-22 15:58:49.852852805 +0200
+@@ -19,10 +19,10 @@
+ $callbacks->{'ar'} = [\&simple_process, ["AR", "arm-linux-ar"]];
+ $callbacks->{'archname'} = [\&simple_process, ["SYS", "armv4l-linux"]];
+ $callbacks->{'cc'} = [\&simple_process, ["CC", "arm-linux-gcc"]];
+-$callbacks->{'cccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
+-$callbacks->{'ccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
+-$callbacks->{'ccflags'} = [\&simple_process, ["CFLAGS", "-fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
+-$callbacks->{'ccflags_uselargefiles'} = [\&simple_process, ["CFLAGS", "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
++#$callbacks->{'cccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
++#$callbacks->{'ccdlflags'} = [\&simple_process, ["CFLAGS", ""]];
++$callbacks->{'ccflags'} = [\&simple_process_insert, ["CFLAGS", "-fno-strict-aliasing -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
++$callbacks->{'ccflags_uselargefiles'} = [\&simple_process_insert, ["CFLAGS", "-D_GNU_SOURCE -DTHREADS_HAVE_PIDS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"]];
+ $callbacks->{'ccname'} = [\&simple_process, ["CC", "arm-linux-gcc"]];
+ $callbacks->{'cpp'} = [\&simple_process, ["CCP", "arm-linux-cpp"]];
+ $callbacks->{'cppflags'} = [\&simple_process, ["CCPFLAGS", "-fno-strict-aliasing"]];
+@@ -30,6 +30,7 @@
+ $callbacks->{'cppstdin'} = [\&simple_process_append, ["CC", "arm-linux-gcc -E", "-E"]];
+ $callbacks->{'full_ar'} = [\&backtick, ["AR", "which $ENV{AR}", "/usr/local/arm/2.95.3/bin/arm-linux-ar"]];
+ $callbacks->{'ld'} = [\&simple_process, ["LD", "arm-linux-ld"]];
++$callbacks->{'lddlflags'} = [\&simple_process, ["LDDLFLAGS", ""]];
+ $callbacks->{'ldflags'} = [\&simple_process, ["LDFLAGS", ""]];
+ $callbacks->{'ldflags_uselargefiles'} = [\&simple_process, ["LDFLAGS", ""]];
+ $callbacks->{'myarchname'} = [\&simple_process, ["SYS", "armv4l-linux"]];
+@@ -105,6 +106,23 @@
+ 
+ }
+ 
++# Insert env var into the variables value
++sub simple_process_insert {
++	my $key = shift;
++	my $value = shift;
++	my $envvar = $callbacks->{$key}->[1][0];
++
++	if ($ENV{$envvar}) {
++		# Strip quotes from value
++		$value =~ s/^\'//;
++		$value =~ s/\'$//;
++		# Remove -I/usr/local/... from the value
++		$value =~ s#\W-I/usr/local/\w+\W# #g;
++		# Prepend env var (OE setting) to value
++		print("$key=\'$ENV{$envvar} $value\'\n");
++	}
++}
++
+ sub library_munge {
+ 	my $key = shift;
+ 	my $value = shift;
diff --git a/meta/recipes-devtools/perl/perl/installperl.patch b/meta/recipes-devtools/perl/perl/installperl.patch
new file mode 100644
index 0000000..4560123
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/installperl.patch
@@ -0,0 +1,17 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.12.3/installperl
+===================================================================
+--- perl-5.12.3.orig/installperl
++++ perl-5.12.3/installperl
+@@ -3,8 +3,8 @@
+ BEGIN {
+     require 5.004;
+     chdir '..' if !-d 'lib' and -d '../lib';
+-    @INC = 'lib';
+-    $ENV{PERL5LIB} = 'lib';
++#    @INC = 'lib';
++#    $ENV{PERL5LIB} = 'lib';
+ 
+     # This needs to be at BEGIN time, before any use of Config
+     require './install_lib.pl';
diff --git a/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch b/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch
new file mode 100644
index 0000000..5161e4c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/letgcc-find-errno.patch
@@ -0,0 +1,46 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+This removes all the logic that perl uses to locate an appropriate
+errno.h for the target. Instead we simple create a file that does
+
+  #include "errno.h"
+
+and use that as the file to parse. This is needed when using an
+external toolchain since perl will search in ${STAGING_INCDIR} for
+errno.h (when using gcc) and that isn't where it's located - its
+wherever the external toolchain keeps it's headers.
+
+Index: perl-5.12.3/ext/Errno/Errno_pm.PL
+===================================================================
+--- perl-5.12.3.orig/ext/Errno/Errno_pm.PL
++++ perl-5.12.3/ext/Errno/Errno_pm.PL
+@@ -17,8 +17,18 @@ unlink "Errno.tmp" if -f "Errno.tmp";
+ open OUT, ">Errno.tmp" or die "Cannot open Errno.tmp: $!";
+ select OUT;
+ my $file;
+-my @files = get_files();
+-if ($Config{gccversion} ne '' && $^O eq 'MSWin32') {
++#my @files = get_files();
++my @files = ("errno.h");
++
++if (1) {
++    open INCS, '>includes.c' or
++	die "Cannot open includes.c";
++    print INCS qq[#include "errno.h"\n];
++    close INCS;
++    process_file('includes.c');
++    unlink 'includes.c';
++}
++elsif ($Config{gccversion} ne '' && $^O eq 'MSWin32') {
+     # MinGW complains "warning: #pragma system_header ignored outside include
+     # file" if the header files are processed individually, so include them
+     # all in .c file and process that instead.
+@@ -53,7 +63,7 @@ sub process_file {
+         chomp($file = `cygpath -w "$file"`);
+     }
+ 
+-    return unless defined $file and -f $file;
++#    return unless defined $file and -f $file;
+ #    warn "Processing $file\n";
+ 
+     local *FH;
diff --git a/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch b/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch
new file mode 100644
index 0000000..de6f652
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch
@@ -0,0 +1,30 @@
+make_ext.pl: fix regenerate makefile failed while $cc changed
+
+While $cc changed, the existance of 'xdefine' caused makefile
+regeneration failed.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ make_ext.pl | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/make_ext.pl b/make_ext.pl
+index b433762..9fc1a36 100644
+--- a/make_ext.pl
++++ b/make_ext.pl
+@@ -335,6 +335,10 @@ sub build_extension {
+                 print "Deleting non-Cross makefile\n";
+                 close $mfh or die "close $makefile: $!";
+                 _unlink($makefile);
++                if(-e 'xdefine') {
++                    print "Deleting xdefine for regenerate makefile\n";
++                    _unlink('xdefine');
++                }
+             }
+         }
+     }
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-devtools/perl/perl/native-nopacklist.patch b/meta/recipes-devtools/perl/perl/native-nopacklist.patch
new file mode 100644
index 0000000..5482dcb
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/native-nopacklist.patch
@@ -0,0 +1,91 @@
+Upstream-Status:Inappropriate [debian patch]
+
+Part of 52_debian_extutils_hacks.patch just to exclude the installation of .packlist files
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm |   35 ++---------------------
+ 1 file changed, 3 insertions(+), 32 deletions(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index f63145c..a589710 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2122,11 +2122,6 @@ pure_perl_install :: all
+ };
+ 
+     push @m,
+-q{		read "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+-		write "}.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+-
+-    push @m,
+ q{		"$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
+ 		"$(INST_ARCHLIB)" "$(DESTINSTALLARCHLIB)" \
+ 		"$(INST_BIN)" "$(DESTINSTALLBIN)" \
+@@ -2158,10 +2153,6 @@ q{		"$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
+ pure_vendor_install :: all
+ 	$(NOECHO) $(MOD_INSTALL) \
+ };
+-    push @m,
+-q{		read "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{" \
+-		write "}.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{" \
+-} unless $self->{NO_PACKLIST};
+ 
+     push @m,
+ q{		"$(INST_LIB)" "$(DESTINSTALLVENDORLIB)" \
+@@ -2187,37 +2178,19 @@ doc_vendor_install :: all
+ 
+     push @m, q{
+ doc_perl_install :: all
+-	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+-	-$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+-	-$(NOECHO) $(DOC_INSTALL) \
+-		"Module" "$(NAME)" \
+-		"installed into" $(INSTALLPRIVLIB) \
+-		LINKTYPE "$(LINKTYPE)" \
+-		VERSION "$(VERSION)" \
+-		EXE_FILES "$(EXE_FILES)" \
+-		>> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+ 
+ doc_site_install :: all
+-	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+-	-$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
++	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLSITEARCH)/perllocal.pod"
++	-$(NOECHO) $(MKPATH) "$(DESTINSTALLSITEARCH)"
+ 	-$(NOECHO) $(DOC_INSTALL) \
+ 		"Module" "$(NAME)" \
+ 		"installed into" $(INSTALLSITELIB) \
+ 		LINKTYPE "$(LINKTYPE)" \
+ 		VERSION "$(VERSION)" \
+ 		EXE_FILES "$(EXE_FILES)" \
+-		>> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
++		>> "}.$self->catfile('$(DESTINSTALLSITEARCH)','perllocal.pod').q{"
+ 
+ doc_vendor_install :: all
+-	$(NOECHO) $(ECHO) Appending installation info to "$(DESTINSTALLARCHLIB)/perllocal.pod"
+-	-$(NOECHO) $(MKPATH) "$(DESTINSTALLARCHLIB)"
+-	-$(NOECHO) $(DOC_INSTALL) \
+-		"Module" "$(NAME)" \
+-		"installed into" $(INSTALLVENDORLIB) \
+-		LINKTYPE "$(LINKTYPE)" \
+-		VERSION "$(VERSION)" \
+-		EXE_FILES "$(EXE_FILES)" \
+-		>> "}.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{"
+ 
+ } unless $self->{NO_PERLLOCAL};
+ 
+@@ -2226,13 +2199,11 @@ uninstall :: uninstall_from_$(INSTALLDIRS)dirs
+ 	$(NOECHO) $(NOOP)
+ 
+ uninstall_from_perldirs ::
+-	$(NOECHO) $(UNINSTALL) "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{"
+ 
+ uninstall_from_sitedirs ::
+ 	$(NOECHO) $(UNINSTALL) "}.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+ 
+ uninstall_from_vendordirs ::
+-	$(NOECHO) $(UNINSTALL) "}.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{"
+ };
+ 
+     join("",@m);
diff --git a/meta/recipes-devtools/perl/perl/native-perlinc.patch b/meta/recipes-devtools/perl/perl/native-perlinc.patch
new file mode 100644
index 0000000..f0bb1f6
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/native-perlinc.patch
@@ -0,0 +1,26 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.8.8/lib/ExtUtils/MM_Unix.pm
+===================================================================
+--- perl-5.12.3.orig/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm	2008-10-31 22:01:35.000000000 +0000
++++ perl-5.12.3/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm	2008-10-31 22:01:35.000000000 +0000
+@@ -1597,6 +1597,19 @@
+ 	$self->{PERL_LIB}     ||= $Config{privlibexp};
+ 	$self->{PERL_ARCHLIB} ||= $Config{archlibexp};
+ 	$self->{PERL_INC}     = $self->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now
++	# Check for environment override so we'll find the headers in the correct place
++        if (defined $ENV{PERL_LIB})
++        {
++            $self->{PERL_LIB} = $ENV{PERL_LIB};
++        }
++        if (defined $ENV{PERL_ARCHLIB})
++        {
++            $self->{PERL_ARCHLIB} = $ENV{PERL_ARCHLIB};
++        }
++        if (defined $ENV{PERL_INC})
++        {
++            $self->{PERL_INC} = $ENV{PERL_INC};
++        }
+ 	my $perl_h;
+ 
+ 	if (not -f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h"))
diff --git a/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch b/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch
new file mode 100644
index 0000000..7dd9041
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/perl-PathTools-don-t-filter-out-blib-from-INC.patch
@@ -0,0 +1,33 @@
+From 90c252cecc38aed5d5faedb30485dd6eee2e54eb Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Wed, 11 Feb 2015 15:14:40 +0800
+Subject: [PATCH] perl / PathTools: don't filter out blib from @INC
+
+If $TOPDIR includes the string "blib", filter it out from @INC may empty
+the @INC and cause build errors like:
+
+  Can't locate ExtUtils/MakeMaker.pm in @INC \
+  (you may need to install the ExtUtils::MakeMaker module) \
+  (@INC contains: .) at Makefile.PL
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ dist/PathTools/Makefile.PL | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/dist/PathTools/Makefile.PL b/dist/PathTools/Makefile.PL
+index 1b21de4..f562cb2 100644
+--- a/dist/PathTools/Makefile.PL
++++ b/dist/PathTools/Makefile.PL
+@@ -1,6 +1,3 @@
+-
+-BEGIN { @INC = grep {!/blib/} @INC }
+-
+ require 5.005;
+ use ExtUtils::MakeMaker;
+ WriteMakefile
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch b/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch
new file mode 100644
index 0000000..d912d00
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/perl-archlib-exp.patch
@@ -0,0 +1,40 @@
+perl: add archlib_exp variable used to generate ARCHLIB_EXP in config.h
+    
+perl.c uses an ARCHLIB_EXP define to generate compile-time code that
+adds the archlibexp path to @INC during run-time initialization of a
+new perl interpreter.
+    
+Because we've changed this value in a temporary way to make it
+possible to use ExtUtils::Embed in the target build (the temporary
+value in config.sh gets re-stripped out during packaging), the
+ARCHLIB_EXP value that gets generated still uses the temporary version
+instead of the original expected version (i.e. becauses it's in the
+generated config.h, it doesn't get stripped out during packaging like
+the others in config.sh).
+
+This creates an unmodified version called archlib_exp that gets used
+by a modified config_h.SH to get the correct value into config.h
+    
+This patch uses an unmodified version of archlibexp called
+archlib_exp, introduced to config.sh, which is used to generate the
+correct value of ARCHLIB_EXP into config.h
+  
+See YOCTO #3099 for more info.
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: perl-5.14.2/config_h.SH
+===================================================================
+--- perl-5.14.2.orig/config_h.SH
++++ perl-5.14.2/config_h.SH
+@@ -996,7 +996,7 @@ sed <<!GROK!THIS! >$CONFIG_H -e 's!^#und
+  *	in programs that are not prepared to deal with ~ expansion at run-time.
+  */
+ #$d_archlib ARCHLIB "$archlib"		/**/
+-#$d_archlib ARCHLIB_EXP "$archlibexp"		/**/
++#$d_archlib ARCHLIB_EXP "$archlib_exp"		/**/
+ 
+ /* ARCHNAME:
+  *	This symbol holds a string representing the architecture name.
diff --git a/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch b/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch
new file mode 100644
index 0000000..c6cc15c
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/perl-configpm-switch.patch
@@ -0,0 +1,47 @@
+Upstream-Status:Inappropriate [native]
+
+This patch is used for perl-native only. It enables the switching of
+configuration files between Config_heavy.pl and
+Config_heavy-target.pl by setting the environment variables
+PERLCONFIGTARGET - the later containing settings for the target while
+the former contains those for the host. This will allow cpan.bbclass
+to use the settings appropriate for the native and/or target builds
+as required. This also disables the use of the cache since the cached
+values would be valid for the host only.
+
+Index: perl-5.14.2/configpm
+===================================================================
+--- perl-5.14.2.orig/configpm
++++ perl-5.14.2/configpm
+@@ -658,7 +658,7 @@ sub FETCH {
+     my($self, $key) = @_;
+ 
+     # check for cached value (which may be undef so we use exists not defined)
+-    return exists $self->{$key} ? $self->{$key} : $self->fetch_string($key);
++    return $self->fetch_string($key);
+ }
+ 
+ ENDOFEND
+@@ -816,7 +816,21 @@ $config_txt .= sprintf <<'ENDOFTIE', $fa
+ sub DESTROY { }
+ 
+ sub AUTOLOAD {
+-    require 'Config_heavy.pl';
++    my $cfgfile = 'Config_heavy.pl';
++    if (defined $ENV{PERLCONFIGTARGET} and $ENV{PERLCONFIGTARGET} eq "yes")
++    {
++        $cfgfile = 'Config_heavy-target.pl';
++    }
++    if (defined $ENV{PERL_ARCHLIB})
++    {
++        push @INC, $ENV{PERL_ARCHLIB};
++        require $cfgfile;
++        pop @INC;
++    }
++    else
++    {
++        require $cfgfile;
++    }
+     goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
+     die "&Config::AUTOLOAD failed on $Config::AUTOLOAD";
+ }
diff --git a/meta/recipes-devtools/perl/perl/perl-configure.sh b/meta/recipes-devtools/perl/perl/perl-configure.sh
new file mode 100755
index 0000000..e72ce49
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/perl-configure.sh
@@ -0,0 +1,43 @@
+#! /bin/sh
+
+#
+# Generate the common perl configuration
+# Needs to be run on a host that matches the bitsize of the target platform
+#
+
+echo sh Configure -des \
+        -Doptimize=-O2 \
+        -Dmyhostname=localhost \
+        -Dperladmin=root@localhost \
+        -Dcc=gcc \
+        -Dcf_by='Open Embedded' \
+        -Dinstallprefix=@DESTDIR@ \
+        -Dprefix=/usr \
+        -Dvendorprefix=/usr \
+        -Dsiteprefix=/usr \
+        -Dotherlibdirs=/usr/lib/perl5/5.12.3 \
+        -Duseshrplib \
+        -Dusethreads \
+        -Duseithreads \
+        -Duselargefiles \
+        -Ud_dosuid \
+        -Dd_semctl_semun \
+        -Ui_db \
+        -Ui_ndbm \
+        -Ui_gdbm \
+        -Di_shadow \
+        -Di_syslog \
+        -Dman3ext=3pm \
+        -Duseperlio \
+        -Dinstallusrbinperl \
+        -Ubincompat5005 \
+        -Uversiononly \
+        -Dpager='/usr/bin/less -isr'
+
+cp -f config.sh config.sh.COMMON
+
+TARGETOS=$(grep myarchname config.sh.COMMON | sed "s#.*'\(.*\)'.*#\1#")
+
+sed -r -i config.sh.COMMON \
+	-e "s#(install.*=')(/usr)/local(.*')#\1@DESTDIR@\2\3#g" \
+	-e 's#'$TARGETOS'#@ARCH@#g'
diff --git a/meta/recipes-devtools/perl/perl/perl-dynloader.patch b/meta/recipes-devtools/perl/perl/perl-dynloader.patch
new file mode 100644
index 0000000..035beba
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/perl-dynloader.patch
@@ -0,0 +1,34 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Allow the location that .so files are searched for for dynamic
+loading to be changed via an environment variable. This is to allow
+us to load .so's from the host system while building for the target
+system.
+
+Update by Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/21
+
+Index: perl-5.14.2/dist/XSLoader/XSLoader_pm.PL
+===================================================================
+--- perl-5.14.2.orig/dist/XSLoader/XSLoader_pm.PL
++++ perl-5.14.2/dist/XSLoader/XSLoader_pm.PL
+@@ -28,6 +28,20 @@ sub load {
+ 
+     my ($module, $modlibname) = caller();
+ 
++    # OE: Allow env to form dynamic loader to look in a different place
++    # This is so it finds the host .so files, not the targets
++    if (defined $ENV{PERLHOSTLIB})
++    {
++        my $hostlib = $ENV{PERLHOSTLIB};
++        print STDERR "*** Module name IN: $modlibname\n";
++        ($p1, $p2, $p3, $p4, $p5) = $modlibname =~ m/(^(.*lib\w*\/)?)((perl\/[0-9\.]*\/)?)(.*)$/;
++        print STDERR "*** p1: $p1  p3: $p3  p5: $p5\n";
++        if ( $p1 ne "" ) {
++            $modlibname = $hostlib.$p5;
++        }
++        print STDERR "*** Module name OUT: $modlibname\n";
++    }
++
+     if (@_) {
+ 	$module = $_[0];
+     } else {
diff --git a/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch b/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch
new file mode 100644
index 0000000..aa83fca
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/perl-enable-gdbm.patch
@@ -0,0 +1,19 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+Index: perl-5.8.8/config_h.SH
+===================================================================
+--- perl-5.8.8.orig/config_h.SH	2005-11-01 02:13:05.000000000 +0800
++++ perl-5.8.8/config_h.SH	2010-11-01 17:06:07.215219738 +0800
+@@ -709,6 +709,12 @@
+  */
+ #$i_float I_FLOAT		/**/
+ 
++/* I_GDBM:
++ *      This symbol, if defined, indicates that <gdbm.h> exists and should
++ *      be included.
++ */
++#$i_gdbm I_GDBM /**/
++
+ /* I_LIMITS:
+  *	This symbol, if defined, indicates to the C program that it should
+  *	include <limits.h> to get definition of symbols like WORD_BIT or
diff --git a/meta/recipes-devtools/perl/perl/perl-moreconfig.patch b/meta/recipes-devtools/perl/perl/perl-moreconfig.patch
new file mode 100644
index 0000000..59ce85a
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/perl-moreconfig.patch
@@ -0,0 +1,18 @@
+Upstream-Status:Inappropriate [embedded specific]
+
+We need ld in the fake config library, but it's not included by default. So
+expand the number of items included. While this works it indicates that the
+rest of the config items are not being picked up and/or are being picked up
+from the host. More investigation needed.
+
+--- perl-5.8.8/configpm	2007/04/20 09:48:05	1.1
++++ perl-5.8.8/configpm	2007/04/20 09:57:12
+@@ -2,7 +2,7 @@
+ use strict;
+ use vars qw(%Config $Config_SH_expanded);
+ 
+-my $how_many_common = 22;
++my $how_many_common = 50;
+ 
+ # commonly used names to precache (and hence lookup fastest)
+ my %Common;
diff --git a/meta/recipes-devtools/perl/perl/run-ptest b/meta/recipes-devtools/perl/perl/run-ptest
new file mode 100644
index 0000000..1e2dd1b
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+cd t && ./TEST | sed -u -e 's|\(.*\) .* ok$|PASS: \1|' -e 's|\(.*\) .* skipped|SKIP: \1|' -e 's|\(.*\) \.\(.*\)|FAIL: \1|'
diff --git a/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch b/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch
new file mode 100644
index 0000000..03fdf4a
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/t-run-switches.t-perl5-perl.patch
@@ -0,0 +1,30 @@
+From 1561549ea36e37cc25706f094a195de4928f4211 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 19 Jun 2015 01:23:46 -0700
+Subject: [PATCH] t/run/switches.t: perl5 -> perl
+
+We call it perl rather than perl5 in oe.
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ t/run/switches.t |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/t/run/switches.t b/t/run/switches.t
+index 78915e0..e9e4b45 100644
+--- a/t/run/switches.t
++++ b/t/run/switches.t
+@@ -269,7 +269,7 @@ is runperl(stderr => 1, prog => '#!perl -M'),
+           '-V generates 20+ lines' );
+ 
+     like( runperl( switches => ['-V'] ),
+-	  qr/\ASummary of my perl5 .*configuration:/,
++	  qr/\ASummary of my perl .*configuration:/,
+           '-V looks okay' );
+ 
+     # lookup a known config var
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch b/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch
new file mode 100644
index 0000000..c8293c3
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/test/dist-threads-t-join.t-adjust-ps-option.patch
@@ -0,0 +1,38 @@
+dist/threads/t/join.t: adjust ps option
+
+The ps's option '-f' is not supported by busybox in oe.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ dist/threads/t/join.t | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/dist/threads/t/join.t b/dist/threads/t/join.t
+--- a/dist/threads/t/join.t
++++ b/dist/threads/t/join.t
+@@ -118,7 +118,7 @@ if ($^O eq 'linux') {
+                  })->join;
+     #print "# mainthread: \$0 = $0\n";
+     #print "# pid = $$\n";
+-    if (open PS, "ps -f |") { # Note: must work in (all) systems.
++    if (open PS, "ps |") { # Note: must work in (all) systems.
+         my ($sawpid, $sawexe);
+         while (<PS>) {
+             chomp;
+@@ -135,10 +135,10 @@ if ($^O eq 'linux') {
+         if ($sawpid) {
+             ok($sawpid && $sawexe, 'altering $0 is effective');
+         } else {
+-            skip("\$0 check: did not see pid $$ in 'ps -f |'");
++            skip("\$0 check: did not see pid $$ in 'ps |'");
+         }
+     } else {
+-        skip("\$0 check: opening 'ps -f |' failed: $!");
++        skip("\$0 check: opening 'ps |' failed: $!");
+     }
+ } else {
+     skip("\$0 check: only on Linux");
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch b/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch
new file mode 100644
index 0000000..ce577fe
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch
@@ -0,0 +1,26 @@
+ext/DynaLoader/t/DynaLoader.t: fix calling dl_findfile() failed
+
+Use '$Config{libc}' as the libc file name
+
+Upstream-Status: Inappropriate
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ ext/DynaLoader/t/DynaLoader.t | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ext/DynaLoader/t/DynaLoader.t b/ext/DynaLoader/t/DynaLoader.t
+index ade1f8e..3567afe 100644
+--- a/ext/DynaLoader/t/DynaLoader.t
++++ b/ext/DynaLoader/t/DynaLoader.t
+@@ -106,7 +106,7 @@ ok( defined $dlerr, "dl_error() returning an error message: '$dlerr'" );
+ # ... dl_findfile()
+ SKIP: {
+     my @files = ();
+-    eval { @files = DynaLoader::dl_findfile("c") };
++    eval { @files = DynaLoader::dl_findfile($Config{libc}) };
+     is( $@, '', "calling dl_findfile()" );
+     # Some platforms are known to not have a "libc"
+     # (not at least by that name) that the dl_findfile()
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-devtools/perl/perl_5.22.0.bb b/meta/recipes-devtools/perl/perl_5.22.0.bb
new file mode 100644
index 0000000..3ce7849
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl_5.22.0.bb
@@ -0,0 +1,371 @@
+require perl.inc
+
+# We need gnugrep (for -I)
+DEPENDS = "virtual/db grep-native"
+DEPENDS += "gdbm zlib"
+
+# Pick up patches from debian
+# http://ftp.de.debian.org/debian/pool/main/p/perl/perl_5.22.0-1.debian.tar.xz
+SRC_URI += " \
+	file://debian/cpan_definstalldirs.diff \
+	file://debian/db_file_ver.diff \
+	file://debian/doc_info.diff \
+	file://debian/enc2xs_inc.diff \
+	file://debian/errno_ver.diff \
+	file://debian/libperl_embed_doc.diff \
+	file://debian/fixes/respect_umask.diff \
+	file://debian/writable_site_dirs.diff \
+	file://debian/extutils_set_libperl_path.diff \
+	file://debian/no_packlist_perllocal.diff \
+	file://debian/prefix_changes.diff \
+	file://debian/instmodsh_doc.diff \
+	file://debian/ld_run_path.diff \
+	file://debian/libnet_config_path.diff \
+	file://debian/mod_paths.diff \
+	file://debian/prune_libs.diff \
+	file://debian/fixes/net_smtp_docs.diff \
+	file://debian/perlivp.diff \
+	file://debian/squelch-locale-warnings.diff \
+	file://debian/skip-upstream-git-tests.diff \
+	file://debian/skip-kfreebsd-crash.diff \
+	file://debian/fixes/document_makemaker_ccflags.diff \
+	file://debian/find_html2text.diff \
+	file://debian/perl5db-x-terminal-emulator.patch \
+	file://debian/cpan-missing-site-dirs.diff \
+	file://debian/fixes/memoize_storable_nstore.diff \
+	file://debian/regen-skip.diff \
+"
+
+SRC_URI += " \
+        file://Makefile.patch \
+        file://Makefile.SH.patch \
+        file://installperl.patch \
+        file://perl-dynloader.patch \
+        file://perl-moreconfig.patch \
+        file://letgcc-find-errno.patch \
+        file://generate-sh.patch \
+        file://native-perlinc.patch \
+        file://perl-enable-gdbm.patch \
+        file://cross-generate_uudmap.patch \
+        file://fix_bad_rpath.patch \
+        file://perl-archlib-exp.patch \
+        file://dynaloaderhack.patch \
+        file://config.sh \
+        file://config.sh-32 \
+        file://config.sh-32-le \
+        file://config.sh-32-be \
+        file://config.sh-64 \
+        file://config.sh-64-le \
+        file://config.sh-64-be \
+        file://make_ext.pl-fix-regenerate-makefile-failed-while-cc-.patch \
+        file://t-run-switches.t-perl5-perl.patch \
+        file://ext-ODBM_File-hints-linux.pl-link-libgdbm_compat.patch \
+        file://ext-ODBM_File-t-odbm.t-fix-the-path-of-dbmt_common.p.patch \
+        file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
+"
+
+# Fix test case issues
+SRC_URI_append_class-target = " \
+            file://test/dist-threads-t-join.t-adjust-ps-option.patch \
+            file://test/ext-DynaLoader-t-DynaLoader.t-fix-calling-dl_findfil.patch \
+           "
+
+SRC_URI[md5sum] = "ff0f09b17de426eff323426cb140ee79"
+SRC_URI[sha256sum] = "be83ead0c5c26cbbe626fa4bac1a4beabe23a9eebc15d35ba49ccde11878e196"
+
+inherit perlnative siteinfo
+
+# Where to find the native perl
+HOSTPERL = "${STAGING_BINDIR_NATIVE}/perl-native/perl${PV}"
+
+# Where to find .so files - use the -native versions not those from the target build
+export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
+
+# Where to find perl @INC/#include files
+# - use the -native versions not those from the target build
+export PERL_LIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
+export PERL_ARCHLIB = "${STAGING_LIBDIR_NATIVE}/perl-native/perl/${PV}/"
+
+# LDFLAGS for shared libraries
+export LDDLFLAGS = "${LDFLAGS} -shared"
+
+LDFLAGS_append = " -fstack-protector"
+
+# We're almost Debian, aren't we?
+CFLAGS += "-DDEBIAN"
+
+do_nolargefile() {
+	sed -i -e "s,\(uselargefiles=\)'define',\1'undef',g" \
+		-e "s,\(d_readdir64_r=\)'define',\1'undef',g" \
+		-e "s,\(readdir64_r_proto=\)'\w+',\1'0',g" \
+		-e "/ccflags_uselargefiles/d" \
+		-e "s/-Duselargefiles//" \
+		-e "s/-D_FILE_OFFSET_BITS=64//" \
+		-e "s/-D_LARGEFILE_SOURCE//" \
+		${S}/Cross/config.sh-${TARGET_ARCH}-${TARGET_OS}
+}
+
+do_configure() {
+        # Make hostperl in build directory be the native perl
+        ln -sf ${HOSTPERL} hostperl
+
+	if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
+		if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a -e Makefile ]; then
+			${MAKE} clean
+		fi
+		find ${S} -name *.so -delete
+	fi
+	if [ -n "${CONFIGURESTAMPFILE}" ]; then
+		echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+	fi
+
+        # Do our work in the cross subdir
+        cd Cross
+
+        # Generate configuration
+        rm -f config.sh-${TARGET_ARCH}-${TARGET_OS}
+        for i in ${WORKDIR}/config.sh \
+                 ${WORKDIR}/config.sh-${SITEINFO_BITS} \
+                 ${WORKDIR}/config.sh-${SITEINFO_BITS}-${SITEINFO_ENDIANNESS}; do
+            cat $i >> config.sh-${TARGET_ARCH}-${TARGET_OS}
+        done
+
+        # Fixups for uclibc
+        if [ "${TARGET_OS}" = "linux-uclibc" -o "${TARGET_OS}" = "linux-uclibceabi" ]; then
+                sed -i -e "s,\(d_crypt_r=\)'define',\1'undef',g" \
+                       -e "s,\(d_futimes=\)'define',\1'undef',g" \
+                       -e "s,\(d_finitel=\)'define',\1'undef',g" \
+                       -e "s,\(crypt_r_proto=\)'\w+',\1'0',g" \
+                       -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
+                       -e "s,\(getnetbyname_r_proto=\)'\w+',\1'0',g" \
+                       -e "s,\(d_getnetbyaddr_r=\)'define',\1'undef',g" \
+                       -e "s,\(getnetbyaddr_r_proto=\)'\w+',\1'0',g" \
+                       -e "s,\(d_getnetent_r=\)'define',\1'undef',g" \
+                       -e "s,\(getnetent_r_proto=\)'\w+',\1'0',g" \
+                       -e "s,\(d_sockatmark=\)'define',\1'undef',g" \
+                       -e "s,\(d_sockatmarkproto=\)'\w+',\1'0',g" \
+                       -e "s,\(d_eaccess=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdiobase=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdstdio=\)'define',\1'undef',g" \
+                       -e "s,-fstack-protector,-fno-stack-protector,g" \
+                    config.sh-${TARGET_ARCH}-${TARGET_OS}
+        fi
+        # Fixups for musl
+        if [ "${TARGET_OS}" = "linux-musl" -o "${TARGET_OS}" = "linux-musleabi" ]; then
+                sed -i -e "s,\(d_libm_lib_version=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdio_ptr_lval=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdio_ptr_lval_sets_cnt=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdiobase=\)'define',\1'undef',g" \
+                       -e "s,\(d_stdstdio=\)'define',\1'undef',g" \
+                       -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
+                       -e "s,\(d_finitel=\)'define',\1'undef',g" \
+                       -e "s,\(getprotobyname_r=\)'define',\1'undef',g" \
+                       -e "s,\(getpwent_r=\)'define',\1'undef',g" \
+                       -e "s,\(getservent_r=\)'define',\1'undef',g" \
+                       -e "s,\(gethostent_r=\)'define',\1'undef',g" \
+                       -e "s,\(getnetent_r=\)'define',\1'undef',g" \
+                       -e "s,\(getnetbyaddr_r=\)'define',\1'undef',g" \
+                       -e "s,\(getprotoent_r=\)'define',\1'undef',g" \
+                       -e "s,\(getprotobynumber_r=\)'define',\1'undef',g" \
+                       -e "s,\(getgrent_r=\)'define',\1'undef',g" \
+                       -e "s,\(i_fcntl=\)'undef',\1'define',g" \
+                       -e "s,\(h_fcntl=\)'false',\1'true',g" \
+                       -e "s,-fstack-protector,-fno-stack-protector,g" \
+                       -e "s,-lnsl,,g" \
+                    config.sh-${TARGET_ARCH}-${TARGET_OS}
+        fi
+
+	${@bb.utils.contains('DISTRO_FEATURES', 'largefile', '', 'do_nolargefile', d)}
+
+        # Update some paths in the configuration
+        sed -i -e 's,@ARCH@-thread-multi,,g' \
+               -e 's,@ARCH@,${TARGET_ARCH}-${TARGET_OS},g' \
+               -e 's,@STAGINGDIR@,${STAGING_DIR_HOST},g' \
+               -e "s,@INCLUDEDIR@,${STAGING_INCDIR},g" \
+               -e "s,@LIBDIR@,${libdir},g" \
+               -e "s,@BASELIBDIR@,${base_libdir},g" \
+               -e "s,@EXECPREFIX@,${exec_prefix},g" \
+               -e 's,@USRBIN@,${bindir},g' \
+            config.sh-${TARGET_ARCH}-${TARGET_OS}
+
+	case "${TARGET_ARCH}" in
+		x86_64 | powerpc | s390)
+			sed -i -e "s,\(need_va_copy=\)'undef',\1'define',g" \
+				config.sh-${TARGET_ARCH}-${TARGET_OS}
+			;;
+		arm)
+			sed -i -e "s,\(d_u32align=\)'undef',\1'define',g" \
+				config.sh-${TARGET_ARCH}-${TARGET_OS}
+			;;
+	esac
+        # These are strewn all over the source tree
+        for foo in `grep -I --exclude="*.patch" --exclude="*.diff" --exclude="*.pod" --exclude="README*" -m1 "/usr/include/.*\.h" ${S}/* -r -l` ${S}/utils/h2xs.PL ; do
+            echo Fixing: $foo
+            sed -e 's|\([ "^'\''I]\+\)/usr/include/|\1${STAGING_INCDIR}/|g' -i $foo
+        done
+
+        rm -f config
+        echo "ARCH = ${TARGET_ARCH}" > config
+        echo "OS = ${TARGET_OS}" >> config
+}
+
+do_compile() {
+        # Fix to avoid recursive substitution of path
+        sed -i -e 's|(@libpath, ".*"|(@libpath, "${STAGING_LIBDIR}"|g' cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
+
+        cd Cross
+        oe_runmake perl LD="${CCLD}"
+}
+
+do_install() {
+	#export hostperl="${STAGING_BINDIR_NATIVE}/perl-native/perl${PV}"
+	oe_runmake install DESTDIR=${D}
+        # Add perl pointing at current version
+        ln -sf perl${PV} ${D}${bindir}/perl
+
+        ln -sf perl ${D}/${libdir}/perl5
+
+        # Remove unwanted file and empty directories
+        rm -f ${D}/${libdir}/perl/${PV}/.packlist
+	rmdir ${D}/${libdir}/perl/site_perl/${PV}
+	rmdir ${D}/${libdir}/perl/site_perl
+
+        # Fix up shared library
+        mv ${D}/${libdir}/perl/${PV}/CORE/libperl.so ${D}/${libdir}/libperl.so.${PV}
+        ln -sf libperl.so.${PV} ${D}/${libdir}/libperl.so.5
+        ln -sf ../../../libperl.so.${PV} ${D}/${libdir}/perl/${PV}/CORE/libperl.so
+
+        # target config, used by cpan.bbclass to extract version information
+        install config.sh ${D}${libdir}/perl
+
+        ln -s Config_heavy.pl ${D}${libdir}/perl/${PV}/Config_heavy-target.pl
+}
+
+do_install_append_class-nativesdk () {
+        create_wrapper ${D}${bindir}/perl \
+            PERL5LIB='$PERL5LIB:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/site_perl/${PV}:$OECORE_NATIVE_SYSROOT/${libdir_nativesdk}/perl/vendor_perl/${PV}'
+}
+
+PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess"
+
+perl_package_preprocess () {
+        # Fix up installed configuration
+        sed -i -e "s,${D},,g" \
+               -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
+               -e "s,-isystem${STAGING_INCDIR} ,,g" \
+               -e "s,${STAGING_LIBDIR},${libdir},g" \
+               -e "s,${STAGING_BINDIR},${bindir},g" \
+               -e "s,${STAGING_INCDIR},${includedir},g" \
+               -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
+               -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
+               -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
+            ${PKGD}${bindir}/h2xs \
+            ${PKGD}${bindir}/h2ph \
+            ${PKGD}${bindir}/pod2man \
+            ${PKGD}${bindir}/pod2text \
+            ${PKGD}${bindir}/pod2usage \
+            ${PKGD}${bindir}/podchecker \
+            ${PKGD}${bindir}/podselect \
+            ${PKGD}${libdir}/perl/${PV}/CORE/config.h \
+            ${PKGD}${libdir}/perl/${PV}/CORE/perl.h \
+            ${PKGD}${libdir}/perl/${PV}/CORE/pp.h \
+            ${PKGD}${libdir}/perl/${PV}/Config.pm \
+            ${PKGD}${libdir}/perl/${PV}/Config.pod \
+            ${PKGD}${libdir}/perl/${PV}/Config_heavy.pl \
+            ${PKGD}${libdir}/perl/${PV}/ExtUtils/Liblist/Kid.pm \
+            ${PKGD}${libdir}/perl/${PV}/FileCache.pm \
+            ${PKGD}${libdir}/perl/${PV}/pod/*.pod \
+            ${PKGD}${libdir}/perl/config.sh
+}
+
+PACKAGES = "perl-dbg perl perl-misc perl-dev perl-pod perl-doc perl-lib \
+            perl-module-cpan perl-module-cpanplus perl-module-unicore"
+FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV} \
+               ${libdir}/perl/${PV}/Config.pm \
+               ${libdir}/perl/${PV}/strict.pm \
+               ${libdir}/perl/${PV}/warnings.pm \
+               ${libdir}/perl/${PV}/warnings \
+               ${libdir}/perl/${PV}/vars.pm \
+              "
+FILES_${PN}_append_class-nativesdk = " ${bindir}/perl.real"
+RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
+                    perl-module-warnings-register"
+FILES_${PN}-dev = "${libdir}/perl/${PV}/CORE"
+FILES_${PN}-lib = "${libdir}/libperl.so* \
+                   ${libdir}/perl5 \
+                   ${libdir}/perl/config.sh \
+                   ${libdir}/perl/${PV}/Config_heavy.pl \
+                   ${libdir}/perl/${PV}/Config_heavy-target.pl"
+FILES_${PN}-pod = "${libdir}/perl/${PV}/pod \
+		   ${libdir}/perl/${PV}/*.pod \
+                   ${libdir}/perl/${PV}/*/*.pod \
+                   ${libdir}/perl/${PV}/*/*/*.pod "
+FILES_perl-misc = "${bindir}/*"
+FILES_${PN}-dbg += "${libdir}/perl/${PV}/auto/*/.debug \
+                    ${libdir}/perl/${PV}/auto/*/*/.debug \
+                    ${libdir}/perl/${PV}/auto/*/*/*/.debug \
+                    ${libdir}/perl/${PV}/CORE/.debug \
+                    ${libdir}/perl/${PV}/*/.debug \
+                    ${libdir}/perl/${PV}/*/*/.debug \
+                    ${libdir}/perl/${PV}/*/*/*/.debug "
+FILES_${PN}-doc = "${libdir}/perl/${PV}/*/*.txt \
+                   ${libdir}/perl/${PV}/*/*/*.txt \
+                   ${libdir}/perl/${PV}/auto/XS/Typemap \
+                   ${libdir}/perl/${PV}/B/assemble \
+                   ${libdir}/perl/${PV}/B/cc_harness \
+                   ${libdir}/perl/${PV}/B/disassemble \
+                   ${libdir}/perl/${PV}/B/makeliblinks \
+                   ${libdir}/perl/${PV}/CGI/eg \
+                   ${libdir}/perl/${PV}/CPAN/PAUSE2003.pub \
+                   ${libdir}/perl/${PV}/CPAN/SIGNATURE \
+		   ${libdir}/perl/${PV}/CPANPLUS/Shell/Default/Plugins/HOWTO.pod \
+                   ${libdir}/perl/${PV}/Encode/encode.h \
+                   ${libdir}/perl/${PV}/ExtUtils/MANIFEST.SKIP \
+                   ${libdir}/perl/${PV}/ExtUtils/NOTES \
+                   ${libdir}/perl/${PV}/ExtUtils/PATCHING \
+                   ${libdir}/perl/${PV}/ExtUtils/typemap \
+                   ${libdir}/perl/${PV}/ExtUtils/xsubpp \
+		   ${libdir}/perl/${PV}/ExtUtils/Changes_EU-Install \
+                   ${libdir}/perl/${PV}/Net/*.eg \
+                   ${libdir}/perl/${PV}/unicore/mktables \
+                   ${libdir}/perl/${PV}/unicore/mktables.lst \
+                   ${libdir}/perl/${PV}/unicore/version "
+
+FILES_perl-module-cpan += "${libdir}/perl/${PV}/CPAN \
+                           ${libdir}/perl/${PV}/CPAN.pm"
+FILES_perl-module-cpanplus += "${libdir}/perl/${PV}/CPANPLUS \
+                               ${libdir}/perl/${PV}/CPANPLUS.pm"
+FILES_perl-module-unicore += "${libdir}/perl/${PV}/unicore"
+
+# Create a perl-modules package recommending all the other perl
+# packages (actually the non modules packages and not created too)
+ALLOW_EMPTY_perl-modules = "1"
+PACKAGES_append = " perl-modules "
+
+python populate_packages_prepend () {
+    libdir = d.expand('${libdir}/perl/${PV}')
+    do_split_packages(d, libdir, 'auto/([^.]*)/[^/]*\.(so|ld|ix|al)', 'perl-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
+    do_split_packages(d, libdir, 'Module/([^\/]*)\.pm', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+    do_split_packages(d, libdir, 'Module/([^\/]*)/.*', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+    do_split_packages(d, libdir, '(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|auto\/)[^\/]).*)\.(pm|pl|e2x)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
+
+    # perl-modules should recommend every perl module, and only the
+    # modules. Don't attempt to use the result of do_split_packages() as some
+    # modules are manually split (eg. perl-module-unicore).
+    packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES', True).split())
+    d.setVar("RRECOMMENDS_${PN}-modules", ' '.join(packages))
+}
+
+PACKAGES_DYNAMIC += "^perl-module-.*"
+PACKAGES_DYNAMIC_class-nativesdk += "^nativesdk-perl-module-.*"
+
+RPROVIDES_perl-lib = "perl-lib"
+
+require perl-rdepends_${PV}.inc
+require perl-ptest.inc
+
+SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/pkgconfig/pkgconfig.inc b/meta/recipes-devtools/pkgconfig/pkgconfig.inc
new file mode 100644
index 0000000..55ab5c4
--- /dev/null
+++ b/meta/recipes-devtools/pkgconfig/pkgconfig.inc
@@ -0,0 +1,49 @@
+SUMMARY = "Helper tool used when compiling"
+DESCRIPTION = "pkg-config is a helper tool used when compiling applications and libraries. It helps determined \
+the correct compiler/link options.  It is also language-agnostic."
+HOMEPAGE = "http://pkg-config.freedesktop.org/wiki/"
+BUGTRACKER = "http://bugs.freedesktop.org/buglist.cgi?product=pkg-config"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "glib-2.0"
+DEPENDS_class-native = ""
+DEPENDS_class-nativesdk = ""
+
+SRCREV = "40342dd0ead05d457a2a4e692cf865f50033a709"
+PV = "0.28+git${SRCPV}"
+SRC_URI = "git://anongit.freedesktop.org/pkg-config"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+EXTRA_OECONF = "--without-internal-glib"
+EXTRA_OECONF_class-native = "--with-internal-glib"
+EXTRA_OECONF_class-nativesdk = "--with-internal-glib"
+
+acpaths = "-I ."
+
+BBCLASSEXTEND = "native nativesdk"
+
+# Set an empty dev package to ensure the base PN package gets
+# the pkg.m4 macros, pkgconfig does not deliver any other -dev
+# files.
+FILES_${PN}-dev = ""
+FILES_${PN} += "${datadir}/aclocal/pkg.m4"
+
+# When using the RPM generated automatic package dependencies, some packages
+# will end up requiring 'pkgconfig(pkg-config)'.  Allow this behavior by
+# specifying an appropriate provide.
+RPROVIDES_${PN} += "pkgconfig(pkg-config)"
+
+# Install a pkg-config-native wrapper that will use the native sysroot instead
+# of the MACHINE sysroot, for using pkg-config when building native tools.
+do_install_append_class-native () {
+    sed -e "s|@PATH_NATIVE@|${PKG_CONFIG_PATH}|" \
+        -e "s|@LIBDIR_NATIVE@|${PKG_CONFIG_LIBDIR}|" \
+        < ${WORKDIR}/pkg-config-native.in > ${B}/pkg-config-native
+    install -m755 ${B}/pkg-config-native ${D}${bindir}/pkg-config-native
+}
diff --git a/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch b/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch
new file mode 100644
index 0000000..01c6247
--- /dev/null
+++ b/meta/recipes-devtools/pkgconfig/pkgconfig/fix-glib-configure-libtool-usage.patch
@@ -0,0 +1,45 @@
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: pkg-config-0.28/glib/configure.ac
+===================================================================
+--- pkg-config-0.28.orig/glib/configure.ac
++++ pkg-config-0.28/glib/configure.ac
+@@ -1438,7 +1438,7 @@ if test x"$glib_native_win32" = xyes; th
+   G_MODULE_LDFLAGS=
+ else
+   export SED
+-  G_MODULE_LDFLAGS=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++  G_MODULE_LDFLAGS=`(./${host_alias}-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ fi
+ dnl G_MODULE_IMPL= don't reset, so cmd-line can override
+ G_MODULE_NEED_USCORE=0
+@@ -1503,13 +1503,13 @@ if test "$G_MODULE_IMPL" = "G_MODULE_IMP
+ 	LDFLAGS="$LDFLAGS $G_MODULE_LDFLAGS"
+ dnl *** check for OSF1/5.0 RTLD_GLOBAL brokenness
+ 	echo "void glib_plugin_test(void) { }" > plugin.c
+-	${SHELL} ./libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
++	${SHELL} ./${host_alias}-libtool --mode=compile --tag=CC ${CC} ${CFLAGS} \
+ 		${CPPFLAGS} -c -o plugin.lo plugin.c >/dev/null 2>&1
+-	${SHELL} ./libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
++	${SHELL} ./${host_alias}-libtool --mode=link --tag=CC ${CC} ${CFLAGS} \
+ 		${LDFLAGS} -module -o plugin.la -export-dynamic \
+ 		-shrext ".o" -avoid-version plugin.lo \
+ 		-rpath /dont/care >/dev/null 2>&1
+-	eval `./libtool --config | grep ^objdir`
++	eval `./${host_alias}-libtool --config | grep ^objdir`
+ 	AC_CACHE_CHECK([for RTLD_GLOBAL brokenness],
+ 		glib_cv_rtldglobal_broken,[
+ 		AC_TRY_RUN([
+@@ -1582,7 +1582,7 @@ fi
+ 
+ AC_MSG_CHECKING(for the suffix of module shared libraries)
+ export SED
+-shrext_cmds=`./libtool --config | grep '^shrext_cmds='`
++shrext_cmds=`./${host_alias}-libtool --config | grep '^shrext_cmds='`
+ eval $shrext_cmds
+ module=yes eval std_shrext=$shrext_cmds
+ # chop the initial dot
diff --git a/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in b/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in
new file mode 100644
index 0000000..5e44bb4
--- /dev/null
+++ b/meta/recipes-devtools/pkgconfig/pkgconfig/pkg-config-native.in
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+PKG_CONFIG_PATH="@PATH_NATIVE@"
+PKG_CONFIG_LIBDIR="@LIBDIR_NATIVE@"
+unset PKG_CONFIG_SYSROOT_DIR
+
+pkg-config "$@"
diff --git a/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb b/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
new file mode 100644
index 0000000..eaa511a
--- /dev/null
+++ b/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb
@@ -0,0 +1,6 @@
+require pkgconfig.inc
+
+SRC_URI += " \
+            file://pkg-config-native.in \
+            file://fix-glib-configure-libtool-usage.patch \
+           "
diff --git a/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb b/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb
new file mode 100644
index 0000000..7dc45c6
--- /dev/null
+++ b/meta/recipes-devtools/postinst-intercept/nativesdk-postinst-intercept_1.0.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Postinstall scriptlets"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+FILES_${PN}_append = " ${datadir}/postinst-intercepts/*"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+	install -d ${D}${datadir}/postinst-intercepts
+	install -m 755 ${COREBASE}/scripts/postinst-intercepts/postinst_intercept ${D}${datadir}/postinst-intercepts/
+	install -m 755 ${COREBASE}/scripts/postinst-intercepts/update_font_cache ${D}${datadir}/postinst-intercepts/
+	install -m 755 ${COREBASE}/scripts/postinst-intercepts/update_icon_cache ${D}${datadir}/postinst-intercepts/
+	install -m 755 ${COREBASE}/scripts/postinst-intercepts/update_pixbuf_cache ${D}${datadir}/postinst-intercepts/
+}
+
+inherit nativesdk
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/meta/recipes-devtools/prelink/prelink/macros.prelink b/meta/recipes-devtools/prelink/prelink/macros.prelink
new file mode 100644
index 0000000..cb16695
--- /dev/null
+++ b/meta/recipes-devtools/prelink/prelink/macros.prelink
@@ -0,0 +1,5 @@
+# rpm-4.1 verifies prelinked libraries using a prelink undo helper.
+#       Note: The 2nd token is used as argv[0] and "library" is a
+#       placeholder that will be deleted and replaced with the appropriate
+#       library file path.
+%__prelink_undo_cmd     /usr/sbin/prelink prelink -y library
diff --git a/meta/recipes-devtools/prelink/prelink/prelink.conf b/meta/recipes-devtools/prelink/prelink/prelink.conf
new file mode 100644
index 0000000..562f23c
--- /dev/null
+++ b/meta/recipes-devtools/prelink/prelink/prelink.conf
@@ -0,0 +1,18 @@
+# This config file contains a list of directories both with binaries
+# and libraries prelink should consider by default.
+# If a directory name is prefixed with `-l ', the directory hierarchy
+# will be walked as long as filesystem boundaries are not crossed.
+# If a directory name is prefixed with `-h ', symbolic links in a
+# directory hierarchy are followed.
+-l /usr/local/sbin
+-l /sbin
+-l /usr/sbin
+-l /usr/local/bin
+-l /bin
+-l /usr/bin
+-l /usr/X11R6/bin
+-l /usr/games
+-l /usr/local/lib{,32,64,x32}
+-l /lib{,32,64,x32}
+-l /usr/lib{,32,64,x32}
+-l /usr/X11R6/lib{,32,64,x32}
diff --git a/meta/recipes-devtools/prelink/prelink/prelink.cron.daily b/meta/recipes-devtools/prelink/prelink/prelink.cron.daily
new file mode 100644
index 0000000..0b3c073
--- /dev/null
+++ b/meta/recipes-devtools/prelink/prelink/prelink.cron.daily
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+. /etc/default/prelink
+
+renice +19 -p $$ >/dev/null 2>&1
+
+if [ "$PRELINKING" != yes ]; then
+  if [ -f /etc/prelink.cache ]; then
+    echo /usr/sbin/prelink -uav > /var/log/prelink.log
+    /usr/sbin/prelink -uav >> /var/log/prelink.log 2>&1
+    rm -f /etc/prelink.cache
+    # Restart init if needed
+    [ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+  fi
+  exit 0
+fi
+
+if [ ! -f /etc/prelink.cache -o -f /var/lib/misc/prelink.force ] \
+   || grep -q '^prelink-ELF0.[0-2]' /etc/prelink.cache; then
+  # If cache does not exist or is from older prelink versions or
+  # if we were asked to explicitely, force full prelinking
+  rm -f /etc/prelink.cache /var/lib/misc/prelink.force
+  PRELINK_OPTS="$PRELINK_OPTS -f"
+  date > /var/lib/misc/prelink.full
+elif [ -n "$PRELINK_FULL_TIME_INTERVAL" \
+       -a "`find /var/lib/misc/prelink.full -mtime -${PRELINK_FULL_TIME_INTERVAL} 2>/dev/null`" \
+	  = /var/lib/misc/prelink.full ]; then
+  # If prelink without -q has been run in the last
+  # PRELINK_FULL_TIME_INTERVAL days, just use quick mode
+  PRELINK_OPTS="$PRELINK_OPTS -q"
+else
+  date > /var/lib/misc/prelink.full
+fi
+
+echo /usr/sbin/prelink -av $PRELINK_OPTS > /var/log/prelink.log
+/usr/sbin/prelink -av $PRELINK_OPTS >> /var/log/prelink.log 2>&1
+# Restart init if needed
+[ -n "$(find `ldd /sbin/init | awk '{ print $3 }'` /sbin/init -ctime -1 2>/dev/null )" ] && /sbin/telinit u
+
+exit 0
diff --git a/meta/recipes-devtools/prelink/prelink/prelink.default b/meta/recipes-devtools/prelink/prelink/prelink.default
new file mode 100644
index 0000000..d8802f8
--- /dev/null
+++ b/meta/recipes-devtools/prelink/prelink/prelink.default
@@ -0,0 +1,22 @@
+# Set this to no to disable prelinking altogether
+# or to yes to enable it.
+# (if you change this from yes to no prelink -ua
+# will be run next night to undo prelinking)
+PRELINKING=yes
+
+# Options to pass to prelink
+# -m	Try to conserve virtual memory by allowing overlapping
+#	assigned virtual memory slots for libraries which
+#	never appear together in one binary
+# -R	Randomize virtual memory slot assignments for libraries.
+#	This makes it slightly harder for various buffer overflow
+#	attacks, since library addresses will be different on each
+#	host using -R.
+PRELINK_OPTS=-mR
+
+# How often should full prelink be run (in days)
+# Normally, prelink will be run in quick mode, every
+# $PRELINK_FULL_TIME_INTERVAL days it will be run
+# in normal mode.  Comment this line out if prelink 
+# should be run in normal mode always.
+PRELINK_FULL_TIME_INTERVAL=14
diff --git a/meta/recipes-devtools/prelink/prelink_git.bb b/meta/recipes-devtools/prelink/prelink_git.bb
new file mode 100644
index 0000000..6ff6917
--- /dev/null
+++ b/meta/recipes-devtools/prelink/prelink_git.bb
@@ -0,0 +1,81 @@
+SECTION = "devel"
+# Need binutils for libiberty.a
+# Would need transfig-native for documentation if it wasn't disabled
+DEPENDS = "elfutils binutils"
+SUMMARY = "An ELF prelinking utility"
+DESCRIPTION = "The prelink package contains a utility which modifies ELF shared libraries \
+and executables, so that far fewer relocations need to be resolved at \
+runtime and thus programs come up faster."
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
+SRCREV = "40327fb99654e96db6ef15e2f2d5ef140ac3e998"
+PV = "1.0+git${SRCPV}"
+
+#
+# The cron script attempts to re-prelink the system daily -- on
+# systems where users are adding applications, this might be reasonable
+# but for embedded, we should be re-running prelink -a after an update.
+#
+# Default is prelinking is enabled.
+#
+SUMMARY_${PN}-cron = "Cron scripts to control automatic prelinking"
+DESCRIPTION_${PN}-cron = "Cron scripts to control automatic prelinking.  \
+See: ${sysconfdir}/cron.daily/prelink for configuration information."
+
+FILES_${PN}-cron = "${sysconfdir}/cron.daily ${sysconfdir}/default"
+
+PACKAGES =+ "${PN}-cron"
+
+SRC_URI = "git://git.yoctoproject.org/prelink-cross.git;branch=cross_prelink \
+           file://prelink.conf \
+           file://prelink.cron.daily \
+           file://prelink.default \
+	   file://macros.prelink"
+
+TARGET_OS_ORIG := "${TARGET_OS}"
+OVERRIDES_append = ":${TARGET_OS_ORIG}"
+
+S = "${WORKDIR}/git/trunk"
+
+inherit autotools 
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF = "--disable-selinux --with-pkgversion=${PV}-${PR} \
+	--with-bugurl=http://bugzilla.yoctoproject.org/"
+
+do_configure_prepend () {
+        # Disable documentation!
+        echo "all:" > ${S}/doc/Makefile.am
+}
+
+do_install_append () {
+	install -d ${D}${sysconfdir}/cron.daily ${D}${sysconfdir}/default ${D}${sysconfdir}/rpm
+	install -m 0644 ${WORKDIR}/prelink.conf ${D}${sysconfdir}/prelink.conf
+	install -m 0644 ${WORKDIR}/prelink.cron.daily ${D}${sysconfdir}/cron.daily/prelink
+	install -m 0644 ${WORKDIR}/prelink.default ${D}${sysconfdir}/default/prelink
+	install -m 0644 ${WORKDIR}/macros.prelink ${D}${sysconfdir}/rpm/macros.prelink
+}
+
+# If we're using image-prelink, we want to skip this on the host side
+# but still do it if the package is installed on the target...
+pkg_postinst_prelink() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+  ${@bb.utils.contains('USER_CLASSES', 'image-prelink', 'exit 0', 'exit 1', d)}
+fi
+
+prelink -a
+}
+
+pkg_prerm_prelink() {
+#!/bin/sh
+
+if [ "x$D" != "x" ]; then
+  exit 1
+fi
+
+prelink -au
+}
+
diff --git a/meta/recipes-devtools/pseudo/files/fallback-group b/meta/recipes-devtools/pseudo/files/fallback-group
new file mode 100644
index 0000000..81bf732
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/fallback-group
@@ -0,0 +1,2 @@
+root:*:0:
+mail:*:8:
diff --git a/meta/recipes-devtools/pseudo/files/fallback-passwd b/meta/recipes-devtools/pseudo/files/fallback-passwd
new file mode 100644
index 0000000..c1458dc
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/files/fallback-passwd
@@ -0,0 +1 @@
+root::0:0:root:/home/root:/bin/sh
diff --git a/meta/recipes-devtools/pseudo/pseudo.inc b/meta/recipes-devtools/pseudo/pseudo.inc
new file mode 100644
index 0000000..fe12258
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/pseudo.inc
@@ -0,0 +1,135 @@
+# Note: Due to the bitbake wrapper script, making changes to pseudo can be
+# difficult.  To work around the current version of the wrapper use:
+# BBFETCH2=True PSEUDO_BUILD=1 ../bitbake/bin/bitbake pseudo-native [-c CMD]
+
+SUMMARY = "Pseudo gives fake root capabilities to a normal user"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/pseudo"
+LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad"
+SECTION = "base"
+LICENSE = "LGPL2.1"
+DEPENDS = "sqlite3 attr"
+
+FILES_${PN} = "${prefix}/lib/pseudo/lib*/libpseudo.so ${bindir}/* ${localstatedir}/pseudo ${prefix}/var/pseudo"
+FILES_${PN}-dbg += "${prefix}/lib/pseudo/lib*/.debug"
+INSANE_SKIP_${PN} += "libdir"
+INSANE_SKIP_${PN}-dbg += "libdir"
+
+PROVIDES += "virtual/fakeroot"
+
+MAKEOPTS = ""
+
+inherit siteinfo
+
+do_configure () {
+	:
+}
+
+NO32LIBS ??= "1"
+NO32LIBS_class-nativesdk = "1"
+
+# Compile for the local machine arch...
+do_compile () {
+	if [ "${SITEINFO_BITS}" = "64" ]; then
+	  ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib${SITEINFO_BITS} --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
+	else
+	  ${S}/configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --cflags="${CFLAGS}" --bits=${SITEINFO_BITS} --enable-static-sqlite --without-rpath
+	fi
+	oe_runmake ${MAKEOPTS}
+}
+do_compile[vardepsexclude] = "SITEINFO_BITS"
+
+maybe_make32() {
+	# We probably don't need to build 32-bit binaries.
+	make32=false
+	if [ "${SITEINFO_BITS}" = "64" ]; then
+		case "${NO32LIBS}" in
+		0)	make32=true
+			;;
+		1)	make32=false
+			;;
+		*)	# If unset, build 32-bit if we think we can.
+			if [ -e "/usr/include/gnu/stubs-32.h" ]; then
+				make32=true
+			fi
+			;;
+		esac
+	fi
+	if $make32; then
+		if ! [ -e "/usr/include/gnu/stubs-32.h" ]; then
+			warn_32bit_missing
+		else
+			bbnote "Attempting to build 32-bit libpseudo.so for ${PN}."
+		fi
+	else
+		bbnote "Building/installing only 64-bit libpseudo.so for ${PN}."
+		bbnote "If you need to run 32-bit executables, ensure that NO32LIBS is set to 0."
+	fi
+}
+maybe_make32[vardepsexclude] = "SITEINFO_BITS"
+
+warn_32bit_missing() {
+	bbwarn "Can't find stubs-32.h, but usually need it to build 32-bit libpseudo."
+	bbwarn "If the build fails, install 32-bit developer packages."
+	bbwarn "If you are using 32-bit binaries, the 32-bit libpseudo is NOT optional."
+}
+
+# Two below are the same
+# If necessary compile for the alternative machine arch.  This is only 
+# necessary in a native build.
+do_compile_prepend_class-native () {
+	maybe_make32
+	if $make32; then
+		# We need the 32-bit libpseudo on a 64-bit machine...
+		# Note that this is not well-tested outside of x86/x86_64.
+
+		# if we're being rebuilt due to a dependency change, we need to make sure
+		# everything is clean before we configure and build -- if we haven't previously
+		# built this will fail and be ignored.
+		make ${MAKEOPTS} distclean || :
+
+		./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
+		save_traps=$(trap)
+		trap 'warn_32bit_missing' 0
+		oe_runmake ${MAKEOPTS} libpseudo
+		eval "$save_traps"
+		# prevent it from removing the lib, but remove everything else
+		make 'LIB=foo' ${MAKEOPTS} distclean 
+	fi
+}
+
+do_compile_prepend_class-nativesdk () {
+	maybe_make32
+	if $make32; then
+		# We need the 32-bit libpseudo on a 64-bit machine.
+		# Note that this is not well-tested outside of x86/x86_64.
+		./configure ${PSEUDO_EXTRA_OPTS} --prefix=${prefix} --libdir=${prefix}/lib/pseudo/lib --with-sqlite-lib=${baselib} --with-sqlite=${STAGING_DIR_TARGET}${exec_prefix} --bits=32 --without-rpath
+		oe_runmake ${MAKEOPTS} libpseudo
+		# prevent it from removing the lib, but remove everything else
+		make 'LIB=foo' ${MAKEOPTS} distclean 
+	fi
+}
+
+do_install () {
+	oe_runmake 'DESTDIR=${D}' ${MAKEOPTS} 'LIB=lib/pseudo/lib$(MARK64)' install
+}
+
+# Two below are the same
+# If necessary install for the alternative machine arch.  This is only 
+# necessary in a native build.
+do_install_append_class-native () {
+	maybe_make32
+	if $make32; then
+		mkdir -p ${D}${prefix}/lib/pseudo/lib
+		cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
+	fi
+}
+
+do_install_append_class-nativesdk () {
+	maybe_make32
+	if $make32; then
+		mkdir -p ${D}${prefix}/lib/pseudo/lib
+		cp lib/pseudo/lib/libpseudo.so ${D}${prefix}/lib/pseudo/lib/.
+	fi
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb b/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb
new file mode 100644
index 0000000..b8c20ad
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/pseudo_1.6.7.bb
@@ -0,0 +1,19 @@
+require pseudo.inc
+
+SRC_URI = " \
+    http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \
+    file://fallback-passwd \
+    file://fallback-group \
+"
+
+SRC_URI[md5sum] = "4cd39502f9bd0e734dee80e08b28a5f1"
+SRC_URI[sha256sum] = "9f2caca5f1579a376a509cd81a81156fc208650add9f0af275da9e911f18f291"
+
+PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback"
+
+do_install_append_class-native () {
+	install -d ${D}${sysconfdir}
+	# The fallback files should never be modified
+	install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd
+	install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group
+}
diff --git a/meta/recipes-devtools/pseudo/pseudo_1.7.3.bb b/meta/recipes-devtools/pseudo/pseudo_1.7.3.bb
new file mode 100644
index 0000000..1e9ef3b
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/pseudo_1.7.3.bb
@@ -0,0 +1,19 @@
+require pseudo.inc
+
+SRC_URI = " \
+    http://downloads.yoctoproject.org/releases/pseudo/${BPN}-${PV}.tar.bz2 \
+    file://fallback-passwd \
+    file://fallback-group \
+"
+
+SRC_URI[md5sum] = "2bd0a44eadd4713e90ad8c152eea77aa"
+SRC_URI[sha256sum] = "e9fc3922f8feb97839b50d14eb1987afdc8f22cdcac93119323cccd5f8444652"
+
+PSEUDO_EXTRA_OPTS ?= "--enable-force-async --without-passwd-fallback"
+
+do_install_append_class-native () {
+	install -d ${D}${sysconfdir}
+	# The fallback files should never be modified
+	install -m 444 ${WORKDIR}/fallback-passwd ${D}${sysconfdir}/passwd
+	install -m 444 ${WORKDIR}/fallback-group ${D}${sysconfdir}/group
+}
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
new file mode 100644
index 0000000..31e1223
--- /dev/null
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -0,0 +1,11 @@
+require pseudo.inc
+
+SRCREV = "e795df44a90a426a76b790f1b2774f3046a8fc31"
+PV = "1.7.2+git${SRCPV}"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "git://git.yoctoproject.org/pseudo"
+
+S = "${WORKDIR}/git"
+
diff --git a/meta/recipes-devtools/python/python-2.7-manifest.inc b/meta/recipes-devtools/python/python-2.7-manifest.inc
new file mode 100644
index 0000000..dd8d825
--- /dev/null
+++ b/meta/recipes-devtools/python/python-2.7-manifest.inc
@@ -0,0 +1,288 @@
+
+# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
+# Generator: '../../../scripts/contrib/python/generate-manifest-2.7.py' Version 20110222.2 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
+
+ 
+
+PROVIDES+="${PN}-2to3 ${PN}-argparse ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-contextlib ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils ${PN}-distutils-staticdev ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib "
+
+PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-argparse ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-contextlib ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils-staticdev ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib ${PN}-modules"
+
+SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator"
+RDEPENDS_${PN}-2to3="${PN}-core"
+FILES_${PN}-2to3="${bindir}/2to3 ${libdir}/python2.7/lib2to3 "
+
+SUMMARY_${PN}-argparse="Python command line argument parser"
+RDEPENDS_${PN}-argparse="${PN}-core ${PN}-codecs ${PN}-textutils"
+FILES_${PN}-argparse="${libdir}/python2.7/argparse.* "
+
+SUMMARY_${PN}-audio="Python Audio Handling"
+RDEPENDS_${PN}-audio="${PN}-core"
+FILES_${PN}-audio="${libdir}/python2.7/wave.* ${libdir}/python2.7/chunk.* ${libdir}/python2.7/sndhdr.* ${libdir}/python2.7/lib-dynload/ossaudiodev.so ${libdir}/python2.7/lib-dynload/audioop.so ${libdir}/python2.7/audiodev.* ${libdir}/python2.7/sunaudio.* ${libdir}/python2.7/sunau.* ${libdir}/python2.7/toaiff.* "
+
+SUMMARY_${PN}-bsddb="Python bindings for the Berkeley Database"
+RDEPENDS_${PN}-bsddb="${PN}-core"
+FILES_${PN}-bsddb="${libdir}/python2.7/bsddb ${libdir}/python2.7/lib-dynload/_bsddb.so "
+
+SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support"
+RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang"
+FILES_${PN}-codecs="${libdir}/python2.7/codecs.* ${libdir}/python2.7/encodings ${libdir}/python2.7/gettext.* ${libdir}/python2.7/locale.* ${libdir}/python2.7/lib-dynload/_locale.so ${libdir}/python2.7/lib-dynload/_codecs* ${libdir}/python2.7/lib-dynload/_multibytecodec.so ${libdir}/python2.7/lib-dynload/unicodedata.so ${libdir}/python2.7/stringprep.* ${libdir}/python2.7/xdrlib.* "
+
+SUMMARY_${PN}-compile="Python bytecode compilation support"
+RDEPENDS_${PN}-compile="${PN}-core"
+FILES_${PN}-compile="${libdir}/python2.7/py_compile.* ${libdir}/python2.7/compileall.* "
+
+SUMMARY_${PN}-compiler="Python compiler support"
+RDEPENDS_${PN}-compiler="${PN}-core"
+FILES_${PN}-compiler="${libdir}/python2.7/compiler "
+
+SUMMARY_${PN}-compression="Python high-level compression support"
+RDEPENDS_${PN}-compression="${PN}-core ${PN}-zlib"
+FILES_${PN}-compression="${libdir}/python2.7/gzip.* ${libdir}/python2.7/zipfile.* ${libdir}/python2.7/tarfile.* ${libdir}/python2.7/lib-dynload/bz2.so "
+
+SUMMARY_${PN}-contextlib="Python utilities for with-statementcontexts."
+RDEPENDS_${PN}-contextlib="${PN}-core"
+FILES_${PN}-contextlib="${libdir}/python${PYTHON_MAJMIN}/contextlib.* "
+
+SUMMARY_${PN}-core="Python interpreter and core modules"
+RDEPENDS_${PN}-core="${PN}-lang ${PN}-re"
+FILES_${PN}-core="${libdir}/python2.7/__future__.* ${libdir}/python2.7/_abcoll.* ${libdir}/python2.7/abc.* ${libdir}/python2.7/copy.* ${libdir}/python2.7/copy_reg.* ${libdir}/python2.7/ConfigParser.* ${libdir}/python2.7/genericpath.* ${libdir}/python2.7/getopt.* ${libdir}/python2.7/linecache.* ${libdir}/python2.7/new.* ${libdir}/python2.7/os.* ${libdir}/python2.7/posixpath.* ${libdir}/python2.7/struct.* ${libdir}/python2.7/warnings.* ${libdir}/python2.7/site.* ${libdir}/python2.7/stat.* ${libdir}/python2.7/UserDict.* ${libdir}/python2.7/UserList.* ${libdir}/python2.7/UserString.* ${libdir}/python2.7/lib-dynload/binascii.so ${libdir}/python2.7/lib-dynload/_struct.so ${libdir}/python2.7/lib-dynload/time.so ${libdir}/python2.7/lib-dynload/xreadlines.so ${libdir}/python2.7/types.* ${libdir}/python2.7/platform.* ${bindir}/python* ${libdir}/python2.7/_weakrefset.* ${libdir}/python2.7/sysconfig.* ${libdir}/python2.7/_sysconfigdata.* ${libdir}/python2.7/config/Makefile ${includedir}/python${PYTHON_MAJMIN}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
+
+SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support"
+RDEPENDS_${PN}-crypt="${PN}-core"
+FILES_${PN}-crypt="${libdir}/python2.7/hashlib.* ${libdir}/python2.7/md5.* ${libdir}/python2.7/sha.* ${libdir}/python2.7/lib-dynload/crypt.so ${libdir}/python2.7/lib-dynload/_hashlib.so ${libdir}/python2.7/lib-dynload/_sha256.so ${libdir}/python2.7/lib-dynload/_sha512.so "
+
+SUMMARY_${PN}-ctypes="Python C types support"
+RDEPENDS_${PN}-ctypes="${PN}-core"
+FILES_${PN}-ctypes="${libdir}/python2.7/ctypes ${libdir}/python2.7/lib-dynload/_ctypes.so ${libdir}/python2.7/lib-dynload/_ctypes_test.so "
+
+SUMMARY_${PN}-curses="Python curses support"
+RDEPENDS_${PN}-curses="${PN}-core"
+FILES_${PN}-curses="${libdir}/python2.7/curses ${libdir}/python2.7/lib-dynload/_curses.so ${libdir}/python2.7/lib-dynload/_curses_panel.so "
+
+SUMMARY_${PN}-datetime="Python calendar and time support"
+RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs"
+FILES_${PN}-datetime="${libdir}/python2.7/_strptime.* ${libdir}/python2.7/calendar.* ${libdir}/python2.7/lib-dynload/datetime.so "
+
+SUMMARY_${PN}-db="Python file-based database support"
+RDEPENDS_${PN}-db="${PN}-core"
+FILES_${PN}-db="${libdir}/python2.7/anydbm.* ${libdir}/python2.7/dumbdbm.* ${libdir}/python2.7/whichdb.* "
+
+SUMMARY_${PN}-debugger="Python debugger"
+RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint"
+FILES_${PN}-debugger="${libdir}/python2.7/bdb.* ${libdir}/python2.7/pdb.* "
+
+SUMMARY_${PN}-dev="Python development package"
+RDEPENDS_${PN}-dev="${PN}-core"
+FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig "
+
+SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects"
+RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
+FILES_${PN}-difflib="${libdir}/python2.7/difflib.* "
+
+SUMMARY_${PN}-distutils="Python Distribution Utilities"
+RDEPENDS_${PN}-distutils="${PN}-core"
+FILES_${PN}-distutils="${libdir}/python2.7/config ${libdir}/python2.7/distutils "
+
+SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)"
+RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils"
+FILES_${PN}-distutils-staticdev="${libdir}/python2.7/config/lib*.a "
+
+SUMMARY_${PN}-doctest="Python framework for running examples in docstrings"
+RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib"
+FILES_${PN}-doctest="${libdir}/python2.7/doctest.* "
+
+SUMMARY_${PN}-elementtree="Python elementree"
+RDEPENDS_${PN}-elementtree="${PN}-core"
+FILES_${PN}-elementtree="${libdir}/python2.7/lib-dynload/_elementtree.so "
+
+SUMMARY_${PN}-email="Python email support"
+RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient"
+FILES_${PN}-email="${libdir}/python2.7/imaplib.* ${libdir}/python2.7/email "
+
+SUMMARY_${PN}-fcntl="Python's fcntl interface"
+RDEPENDS_${PN}-fcntl="${PN}-core"
+FILES_${PN}-fcntl="${libdir}/python2.7/lib-dynload/fcntl.so "
+
+SUMMARY_${PN}-gdbm="Python GNU database support"
+RDEPENDS_${PN}-gdbm="${PN}-core"
+FILES_${PN}-gdbm="${libdir}/python2.7/lib-dynload/gdbm.so "
+
+SUMMARY_${PN}-hotshot="Python hotshot performance profiler"
+RDEPENDS_${PN}-hotshot="${PN}-core"
+FILES_${PN}-hotshot="${libdir}/python2.7/hotshot ${libdir}/python2.7/lib-dynload/_hotshot.so "
+
+SUMMARY_${PN}-html="Python HTML processing support"
+RDEPENDS_${PN}-html="${PN}-core"
+FILES_${PN}-html="${libdir}/python2.7/formatter.* ${libdir}/python2.7/htmlentitydefs.* ${libdir}/python2.7/htmllib.* ${libdir}/python2.7/markupbase.* ${libdir}/python2.7/sgmllib.* ${libdir}/python2.7/HTMLParser.* "
+
+SUMMARY_${PN}-idle="Python Integrated Development Environment"
+RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
+FILES_${PN}-idle="${bindir}/idle ${libdir}/python2.7/idlelib "
+
+SUMMARY_${PN}-image="Python graphical image handling"
+RDEPENDS_${PN}-image="${PN}-core"
+FILES_${PN}-image="${libdir}/python2.7/colorsys.* ${libdir}/python2.7/imghdr.* ${libdir}/python2.7/lib-dynload/imageop.so ${libdir}/python2.7/lib-dynload/rgbimg.so "
+
+SUMMARY_${PN}-importlib="Python import implementation library"
+RDEPENDS_${PN}-importlib="${PN}-core"
+FILES_${PN}-importlib="${libdir}/python2.7/importlib "
+
+SUMMARY_${PN}-io="Python low-level I/O"
+RDEPENDS_${PN}-io="${PN}-core ${PN}-math ${PN}-textutils ${PN}-netclient ${PN}-contextlib"
+FILES_${PN}-io="${libdir}/python2.7/lib-dynload/_socket.so ${libdir}/python2.7/lib-dynload/_io.so ${libdir}/python2.7/lib-dynload/_ssl.so ${libdir}/python2.7/lib-dynload/select.so ${libdir}/python2.7/lib-dynload/termios.so ${libdir}/python2.7/lib-dynload/cStringIO.so ${libdir}/python2.7/pipes.* ${libdir}/python2.7/socket.* ${libdir}/python2.7/ssl.* ${libdir}/python2.7/tempfile.* ${libdir}/python2.7/StringIO.* ${libdir}/python2.7/io.* ${libdir}/python2.7/_pyio.* "
+
+SUMMARY_${PN}-json="Python JSON support"
+RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re ${PN}-codecs"
+FILES_${PN}-json="${libdir}/python2.7/json ${libdir}/python2.7/lib-dynload/_json.so "
+
+SUMMARY_${PN}-lang="Python low-level language support"
+RDEPENDS_${PN}-lang="${PN}-core"
+FILES_${PN}-lang="${libdir}/python2.7/lib-dynload/_bisect.so ${libdir}/python2.7/lib-dynload/_collections.so ${libdir}/python2.7/lib-dynload/_heapq.so ${libdir}/python2.7/lib-dynload/_weakref.so ${libdir}/python2.7/lib-dynload/_functools.so ${libdir}/python2.7/lib-dynload/array.so ${libdir}/python2.7/lib-dynload/itertools.so ${libdir}/python2.7/lib-dynload/operator.so ${libdir}/python2.7/lib-dynload/parser.so ${libdir}/python2.7/atexit.* ${libdir}/python2.7/bisect.* ${libdir}/python2.7/code.* ${libdir}/python2.7/codeop.* ${libdir}/python2.7/collections.* ${libdir}/python2.7/dis.* ${libdir}/python2.7/functools.* ${libdir}/python2.7/heapq.* ${libdir}/python2.7/inspect.* ${libdir}/python2.7/keyword.* ${libdir}/python2.7/opcode.* ${libdir}/python2.7/symbol.* ${libdir}/python2.7/repr.* ${libdir}/python2.7/token.* ${libdir}/python2.7/tokenize.* ${libdir}/python2.7/traceback.* ${libdir}/python2.7/weakref.* "
+
+SUMMARY_${PN}-logging="Python logging support"
+RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold"
+FILES_${PN}-logging="${libdir}/python2.7/logging "
+
+SUMMARY_${PN}-mailbox="Python mailbox format support"
+RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
+FILES_${PN}-mailbox="${libdir}/python2.7/mailbox.* "
+
+SUMMARY_${PN}-math="Python math support"
+RDEPENDS_${PN}-math="${PN}-core ${PN}-crypt"
+FILES_${PN}-math="${libdir}/python2.7/lib-dynload/cmath.so ${libdir}/python2.7/lib-dynload/math.so ${libdir}/python2.7/lib-dynload/_random.so ${libdir}/python2.7/random.* ${libdir}/python2.7/sets.* "
+
+SUMMARY_${PN}-mime="Python MIME handling APIs"
+RDEPENDS_${PN}-mime="${PN}-core ${PN}-io"
+FILES_${PN}-mime="${libdir}/python2.7/mimetools.* ${libdir}/python2.7/uu.* ${libdir}/python2.7/quopri.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/MimeWriter.* "
+
+SUMMARY_${PN}-mmap="Python memory-mapped file support"
+RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io"
+FILES_${PN}-mmap="${libdir}/python2.7/lib-dynload/mmap.so "
+
+SUMMARY_${PN}-multiprocessing="Python multiprocessing support"
+RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap"
+FILES_${PN}-multiprocessing="${libdir}/python2.7/lib-dynload/_multiprocessing.so ${libdir}/python2.7/multiprocessing "
+
+SUMMARY_${PN}-netclient="Python Internet Protocol clients"
+RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime"
+FILES_${PN}-netclient="${libdir}/python2.7/*Cookie*.* ${libdir}/python2.7/base64.* ${libdir}/python2.7/cookielib.* ${libdir}/python2.7/ftplib.* ${libdir}/python2.7/gopherlib.* ${libdir}/python2.7/hmac.* ${libdir}/python2.7/httplib.* ${libdir}/python2.7/mimetypes.* ${libdir}/python2.7/nntplib.* ${libdir}/python2.7/poplib.* ${libdir}/python2.7/smtplib.* ${libdir}/python2.7/telnetlib.* ${libdir}/python2.7/urllib.* ${libdir}/python2.7/urllib2.* ${libdir}/python2.7/urlparse.* ${libdir}/python2.7/uuid.* ${libdir}/python2.7/rfc822.* ${libdir}/python2.7/mimetools.* "
+
+SUMMARY_${PN}-netserver="Python Internet Protocol servers"
+RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient ${PN}-shell ${PN}-threading"
+FILES_${PN}-netserver="${libdir}/python2.7/cgi.* ${libdir}/python2.7/*HTTPServer.* ${libdir}/python2.7/SocketServer.* "
+
+SUMMARY_${PN}-numbers="Python number APIs"
+RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re"
+FILES_${PN}-numbers="${libdir}/python2.7/decimal.* ${libdir}/python2.7/fractions.* ${libdir}/python2.7/numbers.* "
+
+SUMMARY_${PN}-pickle="Python serialisation/persistence support"
+RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re"
+FILES_${PN}-pickle="${libdir}/python2.7/pickle.* ${libdir}/python2.7/shelve.* ${libdir}/python2.7/lib-dynload/cPickle.so ${libdir}/python2.7/pickletools.* "
+
+SUMMARY_${PN}-pkgutil="Python package extension utility support"
+RDEPENDS_${PN}-pkgutil="${PN}-core"
+FILES_${PN}-pkgutil="${libdir}/python2.7/pkgutil.* "
+
+SUMMARY_${PN}-pprint="Python pretty-print support"
+RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
+FILES_${PN}-pprint="${libdir}/python2.7/pprint.* "
+
+SUMMARY_${PN}-profile="Python basic performance profiling support"
+RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils"
+FILES_${PN}-profile="${libdir}/python2.7/profile.* ${libdir}/python2.7/pstats.* ${libdir}/python2.7/cProfile.* ${libdir}/python2.7/lib-dynload/_lsprof.so "
+
+SUMMARY_${PN}-pydoc="Python interactive help support"
+RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re"
+FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python2.7/pydoc.* ${libdir}/python2.7/pydoc_data "
+
+SUMMARY_${PN}-re="Python Regular Expression APIs"
+RDEPENDS_${PN}-re="${PN}-core"
+FILES_${PN}-re="${libdir}/python2.7/re.* ${libdir}/python2.7/sre.* ${libdir}/python2.7/sre_compile.* ${libdir}/python2.7/sre_constants* ${libdir}/python2.7/sre_parse.* "
+
+SUMMARY_${PN}-readline="Python readline support"
+RDEPENDS_${PN}-readline="${PN}-core"
+FILES_${PN}-readline="${libdir}/python2.7/lib-dynload/readline.so ${libdir}/python2.7/rlcompleter.* "
+
+SUMMARY_${PN}-resource="Python resource control interface"
+RDEPENDS_${PN}-resource="${PN}-core"
+FILES_${PN}-resource="${libdir}/python2.7/lib-dynload/resource.so "
+
+SUMMARY_${PN}-robotparser="Python robots.txt parser"
+RDEPENDS_${PN}-robotparser="${PN}-core ${PN}-netclient"
+FILES_${PN}-robotparser="${libdir}/python2.7/robotparser.* "
+
+SUMMARY_${PN}-shell="Python shell-like functionality"
+RDEPENDS_${PN}-shell="${PN}-core ${PN}-re"
+FILES_${PN}-shell="${libdir}/python2.7/cmd.* ${libdir}/python2.7/commands.* ${libdir}/python2.7/dircache.* ${libdir}/python2.7/fnmatch.* ${libdir}/python2.7/glob.* ${libdir}/python2.7/popen2.* ${libdir}/python2.7/shlex.* ${libdir}/python2.7/shutil.* "
+
+SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon"
+RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime"
+FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python2.7/smtpd.* "
+
+SUMMARY_${PN}-sqlite3="Python Sqlite3 database support"
+RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading ${PN}-zlib"
+FILES_${PN}-sqlite3="${libdir}/python2.7/lib-dynload/_sqlite3.so ${libdir}/python2.7/sqlite3/dbapi2.* ${libdir}/python2.7/sqlite3/__init__.* ${libdir}/python2.7/sqlite3/dump.* "
+
+SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests"
+RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3"
+FILES_${PN}-sqlite3-tests="${libdir}/python2.7/sqlite3/test "
+
+SUMMARY_${PN}-stringold="Python string APIs [deprecated]"
+RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
+FILES_${PN}-stringold="${libdir}/python2.7/lib-dynload/strop.so ${libdir}/python2.7/string.* ${libdir}/python2.7/stringold.* "
+
+SUMMARY_${PN}-subprocess="Python subprocess support"
+RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle"
+FILES_${PN}-subprocess="${libdir}/python2.7/subprocess.* "
+
+SUMMARY_${PN}-syslog="Python syslog interface"
+RDEPENDS_${PN}-syslog="${PN}-core"
+FILES_${PN}-syslog="${libdir}/python2.7/lib-dynload/syslog.so "
+
+SUMMARY_${PN}-terminal="Python terminal controlling support"
+RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io"
+FILES_${PN}-terminal="${libdir}/python2.7/pty.* ${libdir}/python2.7/tty.* "
+
+SUMMARY_${PN}-tests="Python tests"
+RDEPENDS_${PN}-tests="${PN}-core"
+FILES_${PN}-tests="${libdir}/python2.7/test "
+
+SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support"
+RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold"
+FILES_${PN}-textutils="${libdir}/python2.7/lib-dynload/_csv.so ${libdir}/python2.7/csv.* ${libdir}/python2.7/optparse.* ${libdir}/python2.7/textwrap.* "
+
+SUMMARY_${PN}-threading="Python threading & synchronization support"
+RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang"
+FILES_${PN}-threading="${libdir}/python2.7/_threading_local.* ${libdir}/python2.7/dummy_thread.* ${libdir}/python2.7/dummy_threading.* ${libdir}/python2.7/mutex.* ${libdir}/python2.7/threading.* ${libdir}/python2.7/Queue.* "
+
+SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings"
+RDEPENDS_${PN}-tkinter="${PN}-core"
+FILES_${PN}-tkinter="${libdir}/python2.7/lib-dynload/_tkinter.so ${libdir}/python2.7/lib-tk "
+
+SUMMARY_${PN}-unittest="Python unit testing framework"
+RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell"
+FILES_${PN}-unittest="${libdir}/python2.7/unittest/ "
+
+SUMMARY_${PN}-unixadmin="Python Unix administration support"
+RDEPENDS_${PN}-unixadmin="${PN}-core"
+FILES_${PN}-unixadmin="${libdir}/python2.7/lib-dynload/nis.so ${libdir}/python2.7/lib-dynload/grp.so ${libdir}/python2.7/lib-dynload/pwd.so ${libdir}/python2.7/getpass.* "
+
+SUMMARY_${PN}-xml="Python basic XML support"
+RDEPENDS_${PN}-xml="${PN}-core ${PN}-elementtree ${PN}-re"
+FILES_${PN}-xml="${libdir}/python2.7/lib-dynload/pyexpat.so ${libdir}/python2.7/xml ${libdir}/python2.7/xmllib.* "
+
+SUMMARY_${PN}-xmlrpc="Python XML-RPC support"
+RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang"
+FILES_${PN}-xmlrpc="${libdir}/python2.7/xmlrpclib.* ${libdir}/python2.7/SimpleXMLRPCServer.* ${libdir}/python2.7/DocXMLRPCServer.* "
+
+SUMMARY_${PN}-zlib="Python zlib compression support"
+RDEPENDS_${PN}-zlib="${PN}-core"
+FILES_${PN}-zlib="${libdir}/python2.7/lib-dynload/zlib.so "
+
+SUMMARY_${PN}-modules="All Python modules"
+RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-argparse ${PN}-audio ${PN}-bsddb ${PN}-codecs ${PN}-compile ${PN}-compiler ${PN}-compression ${PN}-contextlib ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-hotshot ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-resource ${PN}-robotparser ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-zlib  "
+ALLOW_EMPTY_${PN}-modules = "1"
+
+
diff --git a/meta/recipes-devtools/python/python-3.4-manifest.inc b/meta/recipes-devtools/python/python-3.4-manifest.inc
new file mode 100644
index 0000000..07e1490
--- /dev/null
+++ b/meta/recipes-devtools/python/python-3.4-manifest.inc
@@ -0,0 +1,268 @@
+
+# WARNING: This file is AUTO GENERATED: Manual edits will be lost next time I regenerate the file.
+# Generator: '../../../scripts/contrib/python/generate-manifest-3.4.py' Version 20140131 (C) 2002-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# Visit the Python for Embedded Systems Site => http://www.Vanille.de/projects/python.spy
+
+ 
+
+PROVIDES+="${PN}-2to3 ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils ${PN}-distutils-staticdev ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc "
+
+PACKAGES="${PN}-dbg ${PN}-2to3 ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-dev ${PN}-difflib ${PN}-distutils-staticdev ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc ${PN}-modules"
+
+SUMMARY_${PN}-2to3="Python automated Python 2 to 3 code translator"
+RDEPENDS_${PN}-2to3="${PN}-core"
+FILES_${PN}-2to3="${libdir}/python3.4/lib2to3 "
+
+SUMMARY_${PN}-asyncio="Python Asynchronous I/O, event loop, coroutines and tasks"
+RDEPENDS_${PN}-asyncio="${PN}-core"
+FILES_${PN}-asyncio="${libdir}/python3.4/asyncio "
+
+SUMMARY_${PN}-audio="Python Audio Handling"
+RDEPENDS_${PN}-audio="${PN}-core"
+FILES_${PN}-audio="${libdir}/python3.4/wave.* ${libdir}/python3.4/chunk.* ${libdir}/python3.4/sndhdr.* ${libdir}/python3.4/lib-dynload/ossaudiodev.*.so ${libdir}/python3.4/lib-dynload/audioop.*.so ${libdir}/python3.4/audiodev.* ${libdir}/python3.4/sunaudio.* ${libdir}/python3.4/sunau.* ${libdir}/python3.4/toaiff.* "
+
+SUMMARY_${PN}-codecs="Python codecs, encodings & i18n support"
+RDEPENDS_${PN}-codecs="${PN}-core ${PN}-lang"
+FILES_${PN}-codecs="${libdir}/python3.4/codecs.* ${libdir}/python3.4/encodings ${libdir}/python3.4/gettext.* ${libdir}/python3.4/locale.* ${libdir}/python3.4/lib-dynload/_locale.*.so ${libdir}/python3.4/lib-dynload/_codecs* ${libdir}/python3.4/lib-dynload/_multibytecodec.*.so ${libdir}/python3.4/lib-dynload/unicodedata.*.so ${libdir}/python3.4/stringprep.* ${libdir}/python3.4/xdrlib.* "
+
+SUMMARY_${PN}-compile="Python bytecode compilation support"
+RDEPENDS_${PN}-compile="${PN}-core"
+FILES_${PN}-compile="${libdir}/python3.4/py_compile.* ${libdir}/python3.4/compileall.* "
+
+SUMMARY_${PN}-compression="Python high-level compression support"
+RDEPENDS_${PN}-compression="${PN}-core ${PN}-codecs"
+FILES_${PN}-compression="${libdir}/python3.4/gzip.* ${libdir}/python3.4/zipfile.* ${libdir}/python3.4/tarfile.* ${libdir}/python3.4/lib-dynload/bz2.*.so "
+
+SUMMARY_${PN}-core="Python interpreter and core modules"
+RDEPENDS_${PN}-core="${PN}-lang ${PN}-re ${PN}-reprlib ${PN}-codecs ${PN}-io ${PN}-math"
+FILES_${PN}-core="${libdir}/python3.4/__future__.* ${libdir}/python3.4/_abcoll.* ${libdir}/python3.4/abc.* ${libdir}/python3.4/copy.* ${libdir}/python3.4/copyreg.* ${libdir}/python3.4/ConfigParser.* ${libdir}/python3.4/genericpath.* ${libdir}/python3.4/getopt.* ${libdir}/python3.4/linecache.* ${libdir}/python3.4/new.* ${libdir}/python3.4/os.* ${libdir}/python3.4/posixpath.* ${libdir}/python3.4/struct.* ${libdir}/python3.4/warnings.* ${libdir}/python3.4/site.* ${libdir}/python3.4/stat.* ${libdir}/python3.4/UserDict.* ${libdir}/python3.4/UserList.* ${libdir}/python3.4/UserString.* ${libdir}/python3.4/lib-dynload/binascii.*.so ${libdir}/python3.4/lib-dynload/_struct.*.so ${libdir}/python3.4/lib-dynload/time.*.so ${libdir}/python3.4/lib-dynload/xreadlines.*.so ${libdir}/python3.4/types.* ${libdir}/python3.4/platform.* ${bindir}/python* ${libdir}/python3.4/_weakrefset.* ${libdir}/python3.4/sysconfig.* ${libdir}/python3.4/_sysconfigdata.* ${libdir}/python3.4/config/Makefile ${includedir}/python${PYTHON_BINABI}/pyconfig*.h ${libdir}/python${PYTHON_MAJMIN}/collections ${libdir}/python${PYTHON_MAJMIN}/_collections_abc.* ${libdir}/python${PYTHON_MAJMIN}/_sitebuiltins.* ${libdir}/python${PYTHON_MAJMIN}/sitecustomize.py "
+
+SUMMARY_${PN}-crypt="Python basic cryptographic and hashing support"
+RDEPENDS_${PN}-crypt="${PN}-core"
+FILES_${PN}-crypt="${libdir}/python3.4/hashlib.* ${libdir}/python3.4/md5.* ${libdir}/python3.4/sha.* ${libdir}/python3.4/lib-dynload/crypt.*.so ${libdir}/python3.4/lib-dynload/_hashlib.*.so ${libdir}/python3.4/lib-dynload/_sha256.*.so ${libdir}/python3.4/lib-dynload/_sha512.*.so "
+
+SUMMARY_${PN}-ctypes="Python C types support"
+RDEPENDS_${PN}-ctypes="${PN}-core"
+FILES_${PN}-ctypes="${libdir}/python3.4/ctypes ${libdir}/python3.4/lib-dynload/_ctypes.*.so ${libdir}/python3.4/lib-dynload/_ctypes_test.*.so "
+
+SUMMARY_${PN}-curses="Python curses support"
+RDEPENDS_${PN}-curses="${PN}-core"
+FILES_${PN}-curses="${libdir}/python3.4/curses ${libdir}/python3.4/lib-dynload/_curses.*.so ${libdir}/python3.4/lib-dynload/_curses_panel.*.so "
+
+SUMMARY_${PN}-datetime="Python calendar and time support"
+RDEPENDS_${PN}-datetime="${PN}-core ${PN}-codecs"
+FILES_${PN}-datetime="${libdir}/python3.4/_strptime.* ${libdir}/python3.4/calendar.* ${libdir}/python3.4/lib-dynload/datetime.*.so "
+
+SUMMARY_${PN}-db="Python file-based database support"
+RDEPENDS_${PN}-db="${PN}-core"
+FILES_${PN}-db="${libdir}/python3.4/anydbm.* ${libdir}/python3.4/dumbdbm.* ${libdir}/python3.4/whichdb.* ${libdir}/python3.4/dbm ${libdir}/python3.4/lib-dynload/_dbm.*.so "
+
+SUMMARY_${PN}-debugger="Python debugger"
+RDEPENDS_${PN}-debugger="${PN}-core ${PN}-io ${PN}-lang ${PN}-re ${PN}-stringold ${PN}-shell ${PN}-pprint"
+FILES_${PN}-debugger="${libdir}/python3.4/bdb.* ${libdir}/python3.4/pdb.* "
+
+SUMMARY_${PN}-dev="Python development package"
+RDEPENDS_${PN}-dev="${PN}-core"
+FILES_${PN}-dev="${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la ${libdir}/*.a ${libdir}/*.o ${libdir}/pkgconfig ${base_libdir}/*.a ${base_libdir}/*.o ${datadir}/aclocal ${datadir}/pkgconfig "
+
+SUMMARY_${PN}-difflib="Python helpers for computing deltas between objects"
+RDEPENDS_${PN}-difflib="${PN}-lang ${PN}-re"
+FILES_${PN}-difflib="${libdir}/python3.4/difflib.* "
+
+SUMMARY_${PN}-distutils="Python Distribution Utilities"
+RDEPENDS_${PN}-distutils="${PN}-core"
+FILES_${PN}-distutils="${libdir}/python3.4/config ${libdir}/python3.4/distutils "
+
+SUMMARY_${PN}-distutils-staticdev="Python distribution utilities (static libraries)"
+RDEPENDS_${PN}-distutils-staticdev="${PN}-distutils"
+FILES_${PN}-distutils-staticdev="${libdir}/python3.4/config/lib*.a "
+
+SUMMARY_${PN}-doctest="Python framework for running examples in docstrings"
+RDEPENDS_${PN}-doctest="${PN}-core ${PN}-lang ${PN}-io ${PN}-re ${PN}-unittest ${PN}-debugger ${PN}-difflib"
+FILES_${PN}-doctest="${libdir}/python3.4/doctest.* "
+
+SUMMARY_${PN}-elementtree="Python elementree"
+RDEPENDS_${PN}-elementtree="${PN}-core"
+FILES_${PN}-elementtree="${libdir}/python3.4/lib-dynload/_elementtree.*.so "
+
+SUMMARY_${PN}-email="Python email support"
+RDEPENDS_${PN}-email="${PN}-core ${PN}-io ${PN}-re ${PN}-mime ${PN}-audio ${PN}-image ${PN}-netclient"
+FILES_${PN}-email="${libdir}/python3.4/imaplib.* ${libdir}/python3.4/email "
+
+SUMMARY_${PN}-fcntl="Python's fcntl interface"
+RDEPENDS_${PN}-fcntl="${PN}-core"
+FILES_${PN}-fcntl="${libdir}/python3.4/lib-dynload/fcntl.*.so "
+
+SUMMARY_${PN}-gdbm="Python GNU database support"
+RDEPENDS_${PN}-gdbm="${PN}-core"
+FILES_${PN}-gdbm="${libdir}/python3.4/lib-dynload/_gdbm.*.so "
+
+SUMMARY_${PN}-html="Python HTML processing support"
+RDEPENDS_${PN}-html="${PN}-core"
+FILES_${PN}-html="${libdir}/python3.4/formatter.* ${libdir}/python3.4/htmlentitydefs.* ${libdir}/python3.4/htmllib.* ${libdir}/python3.4/markupbase.* ${libdir}/python3.4/sgmllib.* ${libdir}/python3.4/HTMLParser.* "
+
+SUMMARY_${PN}-idle="Python Integrated Development Environment"
+RDEPENDS_${PN}-idle="${PN}-core ${PN}-tkinter"
+FILES_${PN}-idle="${bindir}/idle ${libdir}/python3.4/idlelib "
+
+SUMMARY_${PN}-image="Python graphical image handling"
+RDEPENDS_${PN}-image="${PN}-core"
+FILES_${PN}-image="${libdir}/python3.4/colorsys.* ${libdir}/python3.4/imghdr.* ${libdir}/python3.4/lib-dynload/imageop.*.so ${libdir}/python3.4/lib-dynload/rgbimg.*.so "
+
+SUMMARY_${PN}-importlib="Python import implementation library"
+RDEPENDS_${PN}-importlib="${PN}-core"
+FILES_${PN}-importlib="${libdir}/python3.4/importlib "
+
+SUMMARY_${PN}-io="Python low-level I/O"
+RDEPENDS_${PN}-io="${PN}-core ${PN}-math"
+FILES_${PN}-io="${libdir}/python3.4/lib-dynload/_socket.*.so ${libdir}/python3.4/lib-dynload/_io.*.so ${libdir}/python3.4/lib-dynload/_ssl.*.so ${libdir}/python3.4/lib-dynload/select.*.so ${libdir}/python3.4/lib-dynload/termios.*.so ${libdir}/python3.4/lib-dynload/cStringIO.*.so ${libdir}/python3.4/pipes.* ${libdir}/python3.4/socket.* ${libdir}/python3.4/ssl.* ${libdir}/python3.4/tempfile.* ${libdir}/python3.4/StringIO.* ${libdir}/python3.4/io.* ${libdir}/python3.4/_pyio.* "
+
+SUMMARY_${PN}-json="Python JSON support"
+RDEPENDS_${PN}-json="${PN}-core ${PN}-math ${PN}-re"
+FILES_${PN}-json="${libdir}/python3.4/json ${libdir}/python3.4/lib-dynload/_json.*.so "
+
+SUMMARY_${PN}-lang="Python low-level language support"
+RDEPENDS_${PN}-lang="${PN}-core"
+FILES_${PN}-lang="${libdir}/python3.4/lib-dynload/_bisect.*.so ${libdir}/python3.4/lib-dynload/_collections.*.so ${libdir}/python3.4/lib-dynload/_heapq.*.so ${libdir}/python3.4/lib-dynload/_weakref.*.so ${libdir}/python3.4/lib-dynload/_functools.*.so ${libdir}/python3.4/lib-dynload/array.*.so ${libdir}/python3.4/lib-dynload/itertools.*.so ${libdir}/python3.4/lib-dynload/operator.*.so ${libdir}/python3.4/lib-dynload/parser.*.so ${libdir}/python3.4/atexit.* ${libdir}/python3.4/bisect.* ${libdir}/python3.4/code.* ${libdir}/python3.4/codeop.* ${libdir}/python3.4/collections.* ${libdir}/python3.4/_collections_abc.* ${libdir}/python3.4/dis.* ${libdir}/python3.4/functools.* ${libdir}/python3.4/heapq.* ${libdir}/python3.4/inspect.* ${libdir}/python3.4/keyword.* ${libdir}/python3.4/opcode.* ${libdir}/python3.4/symbol.* ${libdir}/python3.4/repr.* ${libdir}/python3.4/token.* ${libdir}/python3.4/tokenize.* ${libdir}/python3.4/traceback.* ${libdir}/python3.4/weakref.* "
+
+SUMMARY_${PN}-logging="Python logging support"
+RDEPENDS_${PN}-logging="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-stringold"
+FILES_${PN}-logging="${libdir}/python3.4/logging "
+
+SUMMARY_${PN}-mailbox="Python mailbox format support"
+RDEPENDS_${PN}-mailbox="${PN}-core ${PN}-mime"
+FILES_${PN}-mailbox="${libdir}/python3.4/mailbox.* "
+
+SUMMARY_${PN}-math="Python math support"
+RDEPENDS_${PN}-math="${PN}-core"
+FILES_${PN}-math="${libdir}/python3.4/lib-dynload/cmath.*.so ${libdir}/python3.4/lib-dynload/math.*.so ${libdir}/python3.4/lib-dynload/_random.*.so ${libdir}/python3.4/random.* ${libdir}/python3.4/sets.* "
+
+SUMMARY_${PN}-mime="Python MIME handling APIs"
+RDEPENDS_${PN}-mime="${PN}-core ${PN}-io"
+FILES_${PN}-mime="${libdir}/python3.4/mimetools.* ${libdir}/python3.4/uu.* ${libdir}/python3.4/quopri.* ${libdir}/python3.4/rfc822.* ${libdir}/python3.4/MimeWriter.* "
+
+SUMMARY_${PN}-mmap="Python memory-mapped file support"
+RDEPENDS_${PN}-mmap="${PN}-core ${PN}-io"
+FILES_${PN}-mmap="${libdir}/python3.4/lib-dynload/mmap.*.so "
+
+SUMMARY_${PN}-multiprocessing="Python multiprocessing support"
+RDEPENDS_${PN}-multiprocessing="${PN}-core ${PN}-io ${PN}-lang ${PN}-pickle ${PN}-threading ${PN}-ctypes ${PN}-mmap"
+FILES_${PN}-multiprocessing="${libdir}/python3.4/lib-dynload/_multiprocessing.*.so ${libdir}/python3.4/multiprocessing "
+
+SUMMARY_${PN}-netclient="Python Internet Protocol clients"
+RDEPENDS_${PN}-netclient="${PN}-core ${PN}-crypt ${PN}-datetime ${PN}-io ${PN}-lang ${PN}-logging ${PN}-mime"
+FILES_${PN}-netclient="${libdir}/python3.4/*Cookie*.* ${libdir}/python3.4/base64.* ${libdir}/python3.4/cookielib.* ${libdir}/python3.4/ftplib.* ${libdir}/python3.4/gopherlib.* ${libdir}/python3.4/hmac.* ${libdir}/python3.4/httplib.* ${libdir}/python3.4/mimetypes.* ${libdir}/python3.4/nntplib.* ${libdir}/python3.4/poplib.* ${libdir}/python3.4/smtplib.* ${libdir}/python3.4/telnetlib.* ${libdir}/python3.4/urllib ${libdir}/python3.4/uuid.* ${libdir}/python3.4/rfc822.* ${libdir}/python3.4/mimetools.* "
+
+SUMMARY_${PN}-netserver="Python Internet Protocol servers"
+RDEPENDS_${PN}-netserver="${PN}-core ${PN}-netclient ${PN}-shell ${PN}-threading"
+FILES_${PN}-netserver="${libdir}/python3.4/cgi.* ${libdir}/python3.4/*HTTPServer.* ${libdir}/python3.4/SocketServer.* "
+
+SUMMARY_${PN}-numbers="Python number APIs"
+RDEPENDS_${PN}-numbers="${PN}-core ${PN}-lang ${PN}-re"
+FILES_${PN}-numbers="${libdir}/python3.4/decimal.* ${libdir}/python3.4/fractions.* ${libdir}/python3.4/numbers.* "
+
+SUMMARY_${PN}-pickle="Python serialisation/persistence support"
+RDEPENDS_${PN}-pickle="${PN}-core ${PN}-codecs ${PN}-io ${PN}-re"
+FILES_${PN}-pickle="${libdir}/python3.4/pickle.* ${libdir}/python3.4/shelve.* ${libdir}/python3.4/lib-dynload/cPickle.*.so ${libdir}/python3.4/pickletools.* "
+
+SUMMARY_${PN}-pkgutil="Python package extension utility support"
+RDEPENDS_${PN}-pkgutil="${PN}-core"
+FILES_${PN}-pkgutil="${libdir}/python3.4/pkgutil.* "
+
+SUMMARY_${PN}-pprint="Python pretty-print support"
+RDEPENDS_${PN}-pprint="${PN}-core ${PN}-io"
+FILES_${PN}-pprint="${libdir}/python3.4/pprint.* "
+
+SUMMARY_${PN}-profile="Python basic performance profiling support"
+RDEPENDS_${PN}-profile="${PN}-core ${PN}-textutils"
+FILES_${PN}-profile="${libdir}/python3.4/profile.* ${libdir}/python3.4/pstats.* ${libdir}/python3.4/cProfile.* ${libdir}/python3.4/lib-dynload/_lsprof.*.so "
+
+SUMMARY_${PN}-pydoc="Python interactive help support"
+RDEPENDS_${PN}-pydoc="${PN}-core ${PN}-lang ${PN}-stringold ${PN}-re"
+FILES_${PN}-pydoc="${bindir}/pydoc ${libdir}/python3.4/pydoc.* ${libdir}/python3.4/pydoc_data "
+
+SUMMARY_${PN}-re="Python Regular Expression APIs"
+RDEPENDS_${PN}-re="${PN}-core"
+FILES_${PN}-re="${libdir}/python3.4/re.* ${libdir}/python3.4/sre.* ${libdir}/python3.4/sre_compile.* ${libdir}/python3.4/sre_constants* ${libdir}/python3.4/sre_parse.* "
+
+SUMMARY_${PN}-readline="Python readline support"
+RDEPENDS_${PN}-readline="${PN}-core"
+FILES_${PN}-readline="${libdir}/python3.4/lib-dynload/readline.*.so ${libdir}/python3.4/rlcompleter.* "
+
+SUMMARY_${PN}-reprlib="Python alternate repr() implementation"
+RDEPENDS_${PN}-reprlib="${PN}-core"
+FILES_${PN}-reprlib="${libdir}/python3.4/reprlib.py "
+
+SUMMARY_${PN}-resource="Python resource control interface"
+RDEPENDS_${PN}-resource="${PN}-core"
+FILES_${PN}-resource="${libdir}/python3.4/lib-dynload/resource.*.so "
+
+SUMMARY_${PN}-shell="Python shell-like functionality"
+RDEPENDS_${PN}-shell="${PN}-core ${PN}-re"
+FILES_${PN}-shell="${libdir}/python3.4/cmd.* ${libdir}/python3.4/commands.* ${libdir}/python3.4/dircache.* ${libdir}/python3.4/fnmatch.* ${libdir}/python3.4/glob.* ${libdir}/python3.4/popen2.* ${libdir}/python3.4/shlex.* ${libdir}/python3.4/shutil.* "
+
+SUMMARY_${PN}-smtpd="Python Simple Mail Transport Daemon"
+RDEPENDS_${PN}-smtpd="${PN}-core ${PN}-netserver ${PN}-email ${PN}-mime"
+FILES_${PN}-smtpd="${bindir}/smtpd.* ${libdir}/python3.4/smtpd.* "
+
+SUMMARY_${PN}-sqlite3="Python Sqlite3 database support"
+RDEPENDS_${PN}-sqlite3="${PN}-core ${PN}-datetime ${PN}-lang ${PN}-crypt ${PN}-io ${PN}-threading"
+FILES_${PN}-sqlite3="${libdir}/python3.4/lib-dynload/_sqlite3.*.so ${libdir}/python3.4/sqlite3/dbapi2.* ${libdir}/python3.4/sqlite3/__init__.* ${libdir}/python3.4/sqlite3/dump.* "
+
+SUMMARY_${PN}-sqlite3-tests="Python Sqlite3 database support tests"
+RDEPENDS_${PN}-sqlite3-tests="${PN}-core ${PN}-sqlite3"
+FILES_${PN}-sqlite3-tests="${libdir}/python3.4/sqlite3/test "
+
+SUMMARY_${PN}-stringold="Python string APIs [deprecated]"
+RDEPENDS_${PN}-stringold="${PN}-core ${PN}-re"
+FILES_${PN}-stringold="${libdir}/python3.4/lib-dynload/strop.*.so ${libdir}/python3.4/string.* ${libdir}/python3.4/stringold.* "
+
+SUMMARY_${PN}-subprocess="Python subprocess support"
+RDEPENDS_${PN}-subprocess="${PN}-core ${PN}-io ${PN}-re ${PN}-fcntl ${PN}-pickle"
+FILES_${PN}-subprocess="${libdir}/python3.4/subprocess.* "
+
+SUMMARY_${PN}-syslog="Python syslog interface"
+RDEPENDS_${PN}-syslog="${PN}-core"
+FILES_${PN}-syslog="${libdir}/python3.4/lib-dynload/syslog.*.so "
+
+SUMMARY_${PN}-terminal="Python terminal controlling support"
+RDEPENDS_${PN}-terminal="${PN}-core ${PN}-io"
+FILES_${PN}-terminal="${libdir}/python3.4/pty.* ${libdir}/python3.4/tty.* "
+
+SUMMARY_${PN}-tests="Python tests"
+RDEPENDS_${PN}-tests="${PN}-core"
+FILES_${PN}-tests="${libdir}/python3.4/test "
+
+SUMMARY_${PN}-textutils="Python option parsing, text wrapping and CSV support"
+RDEPENDS_${PN}-textutils="${PN}-core ${PN}-io ${PN}-re ${PN}-stringold"
+FILES_${PN}-textutils="${libdir}/python3.4/lib-dynload/_csv.*.so ${libdir}/python3.4/csv.* ${libdir}/python3.4/optparse.* ${libdir}/python3.4/textwrap.* "
+
+SUMMARY_${PN}-threading="Python threading & synchronization support"
+RDEPENDS_${PN}-threading="${PN}-core ${PN}-lang"
+FILES_${PN}-threading="${libdir}/python3.4/_threading_local.* ${libdir}/python3.4/dummy_thread.* ${libdir}/python3.4/dummy_threading.* ${libdir}/python3.4/mutex.* ${libdir}/python3.4/threading.* ${libdir}/python3.4/Queue.* "
+
+SUMMARY_${PN}-tkinter="Python Tcl/Tk bindings"
+RDEPENDS_${PN}-tkinter="${PN}-core"
+FILES_${PN}-tkinter="${libdir}/python3.4/lib-dynload/_tkinter.*.so ${libdir}/python3.4/lib-tk ${libdir}/python3.4/tkinter "
+
+SUMMARY_${PN}-unittest="Python unit testing framework"
+RDEPENDS_${PN}-unittest="${PN}-core ${PN}-stringold ${PN}-lang ${PN}-io ${PN}-difflib ${PN}-pprint ${PN}-shell"
+FILES_${PN}-unittest="${libdir}/python3.4/unittest/ "
+
+SUMMARY_${PN}-unixadmin="Python Unix administration support"
+RDEPENDS_${PN}-unixadmin="${PN}-core"
+FILES_${PN}-unixadmin="${libdir}/python3.4/lib-dynload/nis.*.so ${libdir}/python3.4/lib-dynload/grp.*.so ${libdir}/python3.4/lib-dynload/pwd.*.so ${libdir}/python3.4/getpass.* "
+
+SUMMARY_${PN}-xml="Python basic XML support"
+RDEPENDS_${PN}-xml="${PN}-core ${PN}-elementtree ${PN}-re"
+FILES_${PN}-xml="${libdir}/python3.4/lib-dynload/pyexpat.*.so ${libdir}/python3.4/xml ${libdir}/python3.4/xmllib.* "
+
+SUMMARY_${PN}-xmlrpc="Python XML-RPC support"
+RDEPENDS_${PN}-xmlrpc="${PN}-core ${PN}-xml ${PN}-netserver ${PN}-lang"
+FILES_${PN}-xmlrpc="${libdir}/python3.4/xmlrpclib.* ${libdir}/python3.4/SimpleXMLRPCServer.* ${libdir}/python3.4/DocXMLRPCServer.* ${libdir}/python3.4/xmlrpc "
+
+SUMMARY_${PN}-modules="All Python modules"
+RDEPENDS_${PN}-modules="${PN}-2to3 ${PN}-asyncio ${PN}-audio ${PN}-codecs ${PN}-compile ${PN}-compression ${PN}-core ${PN}-crypt ${PN}-ctypes ${PN}-curses ${PN}-datetime ${PN}-db ${PN}-debugger ${PN}-difflib ${PN}-distutils ${PN}-doctest ${PN}-elementtree ${PN}-email ${PN}-fcntl ${PN}-gdbm ${PN}-html ${PN}-idle ${PN}-image ${PN}-importlib ${PN}-io ${PN}-json ${PN}-lang ${PN}-logging ${PN}-mailbox ${PN}-math ${PN}-mime ${PN}-mmap ${PN}-multiprocessing ${PN}-netclient ${PN}-netserver ${PN}-numbers ${PN}-pickle ${PN}-pkgutil ${PN}-pprint ${PN}-profile ${PN}-pydoc ${PN}-re ${PN}-readline ${PN}-reprlib ${PN}-resource ${PN}-shell ${PN}-smtpd ${PN}-sqlite3 ${PN}-sqlite3-tests ${PN}-stringold ${PN}-subprocess ${PN}-syslog ${PN}-terminal ${PN}-tests ${PN}-textutils ${PN}-threading ${PN}-tkinter ${PN}-unittest ${PN}-unixadmin ${PN}-xml ${PN}-xmlrpc  "
+ALLOW_EMPTY_${PN}-modules = "1"
+
+
diff --git a/meta/recipes-devtools/python/python-async_0.6.2.bb b/meta/recipes-devtools/python/python-async_0.6.2.bb
new file mode 100644
index 0000000..8ed0b03
--- /dev/null
+++ b/meta/recipes-devtools/python/python-async_0.6.2.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Python framework to process interdependent tasks in a pool of workers"
+HOMEPAGE = "http://github.com/gitpython-developers/async"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=88df8e78b9edfd744953862179f2d14e"
+
+SRC_URI = "http://pypi.python.org/packages/source/a/async/async-${PV}.tar.gz"
+SRC_URI[md5sum] = "9b06b5997de2154f3bc0273f80bcef6b"
+SRC_URI[sha256sum] = "ac6894d876e45878faae493b0cf61d0e28ec417334448ac0a6ea2229d8343051"
+
+S = "${WORKDIR}/async-${PV}"
+
+inherit distutils
+
+RDEPENDS_${PN} += "python-threading python-lang"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/python/python-dbus_1.2.0.bb b/meta/recipes-devtools/python/python-dbus_1.2.0.bb
new file mode 100644
index 0000000..b314dce
--- /dev/null
+++ b/meta/recipes-devtools/python/python-dbus_1.2.0.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Python bindings for the DBus inter-process communication system"
+SECTION = "devel/python"
+HOMEPAGE = "http://www.freedesktop.org/Software/dbus"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0b83047ce9e948b67c0facc5f233476a"
+DEPENDS = "expat dbus dbus-glib virtual/libintl python-pyrex-native"
+
+SRC_URI = "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-${PV}.tar.gz \
+"
+
+SRC_URI[md5sum] = "b09cd2d1a057cc432ce944de3fc06bf7"
+SRC_URI[sha256sum] = "e12c6c8b2bf3a9302f75166952cbe41d6b38c3441bbc6767dbd498942316c6df"
+S = "${WORKDIR}/dbus-python-${PV}"
+
+inherit distutils-base autotools pkgconfig
+
+PACKAGECONFIG ?= ""
+PACKAGECONFIG[docs] = "--enable-html-docs,--disable-html-docs,python-docutils-native"
+PACKAGECONFIG[api-docs] = "--enable-api-docs,--disable-api-docs,python-docutils-native python-epydoc-native"
+
+export BUILD_SYS
+export HOST_SYS
+
+export STAGING_LIBDIR
+export STAGING_INCDIR
+
+RDEPENDS_${PN} = "python-io python-logging python-stringold python-threading python-xml"
+
+FILES_${PN}-dev += "${libdir}/pkgconfig"
diff --git a/meta/recipes-devtools/python/python-docutils_0.12.bb b/meta/recipes-devtools/python/python-docutils_0.12.bb
new file mode 100644
index 0000000..8cda88d
--- /dev/null
+++ b/meta/recipes-devtools/python/python-docutils_0.12.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Text processing system for documentation"
+HOMEPAGE = "http://docutils.sourceforge.net"
+SECTION = "devel/python"
+LICENSE = "PSF & BSD-2-Clause & GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=a722fbdc20347db7b69223594dd54574"
+
+DEPENDS = "python"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/docutils/docutils-${PV}.tar.gz"
+SRC_URI[md5sum] = "4622263b62c5c771c03502afa3157768"
+SRC_URI[sha256sum] = "c7db717810ab6965f66c8cf0398a98c9d8df982da39b4cd7f162911eb89596fa"
+
+S = "${WORKDIR}/docutils-${PV}"
+
+inherit distutils
+
+BBCLASSEXTEND = "native"
+
diff --git a/meta/recipes-devtools/python/python-git_1.0.1.bb b/meta/recipes-devtools/python/python-git_1.0.1.bb
new file mode 100644
index 0000000..a78d7c8
--- /dev/null
+++ b/meta/recipes-devtools/python/python-git_1.0.1.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Python library used to interact with Git repositories"
+DESCRIPTION = "GitPython provides object model read and write access to \
+a git repository. Access repository information conveniently, alter the \
+index directly, handle remotes, or go down to low-level object database \
+access with big-files support."
+HOMEPAGE = "http://github.com/gitpython-developers/GitPython"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8b8d26c37c1d5a04f9b0186edbebc183"
+DEPENDS = "python-gitdb"
+
+SRC_URI = "http://pypi.python.org/packages/source/G/GitPython/GitPython-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "4659644b42c41e5e5170c0cd83ed6422"
+SRC_URI[sha256sum] = "9c88c17bbcae2a445ff64024ef13526224f70e35e38c33416be5ceb56ca7f760"
+
+S = "${WORKDIR}/GitPython-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} += "python-gitdb python-lang python-io python-shell python-math python-re python-subprocess python-stringold"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/python/python-gitdb_0.6.4.bb b/meta/recipes-devtools/python/python-gitdb_0.6.4.bb
new file mode 100644
index 0000000..f0083bd
--- /dev/null
+++ b/meta/recipes-devtools/python/python-gitdb_0.6.4.bb
@@ -0,0 +1,19 @@
+SUMMARY = "A pure-Python git object database"
+HOMEPAGE = "http://github.com/gitpython-developers/gitdb"
+SECTION = "devel/python"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=59e5ecb13339a936eedf83282eaf4528"
+DEPENDS = "python-async python-smmap"
+
+SRC_URI = "https://pypi.python.org/packages/source/g/gitdb/gitdb-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "44e4366b8bdfd306b075c3a52c96ae1a"
+SRC_URI[sha256sum] = "a3ebbc27be035a2e874ed904df516e35f4a29a778a764385de09de9e0f139658"
+
+S = "${WORKDIR}/gitdb-${PV}"
+
+inherit distutils
+
+RDEPENDS_${PN} += "python-smmap python-async python-mmap python-lang python-zlib python-io python-shell"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch b/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch
new file mode 100644
index 0000000..2575306
--- /dev/null
+++ b/meta/recipes-devtools/python/python-imaging/0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch
@@ -0,0 +1,55 @@
+From 07d4f095a9e22ae676a8d68073101131e65012dc Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 15 Nov 2011 13:16:54 +0100
+Subject: [PATCH] python imaging setup.py: force paths for zlib, freetype and jpeg and don't add host paths
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+
+Upstream-Status: Inappropriate [embedded specific]
+---
+ setup.py |   14 +++-----------
+ 1 files changed, 3 insertions(+), 11 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 5d4d53a..b1a22ec 100644
+--- a/setup.py
++++ b/setup.py
+@@ -34,10 +34,10 @@ def libinclude(root):
+ # TIFF_ROOT = libinclude("/opt/tiff")
+ 
+ TCL_ROOT = None
+-JPEG_ROOT = None
+-ZLIB_ROOT = None
++JPEG_ROOT = os.environ['STAGING_LIBDIR']
++ZLIB_ROOT = os.environ['STAGING_LIBDIR']
+ TIFF_ROOT = None
+-FREETYPE_ROOT = None
++FREETYPE_ROOT =  os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR']
+ LCMS_ROOT = None
+ 
+ # FIXME: add mechanism to explicitly *disable* the use of a library
+@@ -147,7 +147,6 @@ class pil_build_ext(build_ext):
+             add_directory(library_dirs, "/opt/local/lib")
+             add_directory(include_dirs, "/opt/local/include")
+ 
+-        add_directory(library_dirs, "/usr/local/lib")
+         # FIXME: check /opt/stuff directories here?
+ 
+         prefix = sysconfig.get_config_var("prefix")
+@@ -207,13 +206,6 @@ class pil_build_ext(build_ext):
+             if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
+                 add_directory(include_dirs, tcl_dir)
+ 
+-        # standard locations
+-        add_directory(library_dirs, "/usr/local/lib")
+-        add_directory(include_dirs, "/usr/local/include")
+-
+-        add_directory(library_dirs, "/usr/lib")
+-        add_directory(include_dirs, "/usr/include")
+-
+         #
+         # insert new dirs *before* default libs, to avoid conflicts
+         # between Python PYD stub libs and real libraries
+-- 
+1.7.2.5
+
diff --git a/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch b/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch
new file mode 100644
index 0000000..4960ed4
--- /dev/null
+++ b/meta/recipes-devtools/python/python-imaging/allow.to.disable.some.features.patch
@@ -0,0 +1,65 @@
+At least lcms wasn't deterministicly detected from sysroot.
+
+This will allow to export LCMS_ENABLED=False when lcms isn't in PACKAGECONFIG.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+diff -uNr Imaging-1.1.7.orig/setup.py Imaging-1.1.7/setup.py
+--- Imaging-1.1.7.orig/setup.py	2013-07-22 10:17:02.081457075 +0200
++++ Imaging-1.1.7/setup.py	2013-07-22 13:10:09.029707492 +0200
+@@ -39,6 +39,12 @@
+ TIFF_ROOT = None
+ FREETYPE_ROOT =  os.environ['STAGING_LIBDIR'], os.environ['STAGING_INCDIR']
+ LCMS_ROOT = None
++TCL_ENABLED = os.getenv('TCL_ENABLED', "True")
++JPEG_ENABLED = os.getenv('JPEG_ENABLED', "True")
++ZLIB_ENABLED = os.getenv('ZLIB_ENABLED', "True")
++TIFF_ENABLED = os.getenv('TIFF_ENABLED', "True")
++FREETYPE_ENABLED = os.getenv('FREETYPE_ENABLED', "True")
++LCMS_ENABLED = os.getenv('LCMS_ENABLED', "True")
+ 
+ # FIXME: add mechanism to explicitly *disable* the use of a library
+ 
+@@ -220,22 +226,22 @@
+             zlib = jpeg = tiff = freetype = tcl = tk = lcms = None
+         feature = feature()
+ 
+-        if find_include_file(self, "zlib.h"):
++        if ZLIB_ENABLED == 'True' and find_include_file(self, "zlib.h"):
+             if find_library_file(self, "z"):
+                 feature.zlib = "z"
+             elif sys.platform == "win32" and find_library_file(self, "zlib"):
+                 feature.zlib = "zlib" # alternative name
+ 
+-        if find_include_file(self, "jpeglib.h"):
++        if JPEG_ENABLED == 'True' and find_include_file(self, "jpeglib.h"):
+             if find_library_file(self, "jpeg"):
+                 feature.jpeg = "jpeg"
+             elif sys.platform == "win32" and find_library_file(self, "libjpeg"):
+                 feature.jpeg = "libjpeg" # alternative name
+ 
+-        if find_library_file(self, "tiff"):
++        if TIFF_ENABLED == 'True' and find_library_file(self, "tiff"):
+             feature.tiff = "tiff"
+ 
+-        if find_library_file(self, "freetype"):
++        if FREETYPE_ENABLED == 'True' and find_library_file(self, "freetype"):
+             # look for freetype2 include files
+             freetype_version = 0
+             for dir in self.compiler.include_dirs:
+@@ -256,11 +262,11 @@
+                 if dir:
+                     add_directory(self.compiler.include_dirs, dir, 0)
+ 
+-        if find_include_file(self, "lcms.h"):
++        if LCMS_ENABLED == 'True' and find_include_file(self, "lcms.h"):
+             if find_library_file(self, "lcms"):
+                 feature.lcms = "lcms"
+ 
+-        if _tkinter and find_include_file(self, "tk.h"):
++        if TCL_ENABLED == 'True' and _tkinter and find_include_file(self, "tk.h"):
+             # the library names may vary somewhat (e.g. tcl84 or tcl8.4)
+             version = TCL_VERSION[0] + TCL_VERSION[2]
+             if find_library_file(self, "tcl" + version):
diff --git a/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch b/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch
new file mode 100644
index 0000000..9ecc63a
--- /dev/null
+++ b/meta/recipes-devtools/python/python-imaging/fix-freetype-includes.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From c6040f618d8f2706a7b46d1cdf37d1a587f9701f Mon Sep 17 00:00:00 2001
+From: Andrew Stromnov <stromnov@gmail.com>
+Date: Thu, 28 Nov 2013 16:58:43 +0400
+Subject: [PATCH] fix compiling with FreeType 2.5.1
+
+---
+ _imagingft.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/_imagingft.c b/_imagingft.c
+index 47d50bd..f19555b 100644
+--- a/_imagingft.c
++++ b/_imagingft.c
+@@ -59,7 +59,11 @@ struct {
+     const char* message;
+ } ft_errors[] =
+ 
++#if defined(USE_FREETYPE_2_1)
++#include FT_ERRORS_H
++#else
+ #include <freetype/fterrors.h>
++#endif
+ 
+ /* -------------------------------------------------------------------- */
+ /* font objects */
+-- 
+1.8.5.1
diff --git a/meta/recipes-devtools/python/python-imaging_1.1.7.bb b/meta/recipes-devtools/python/python-imaging_1.1.7.bb
new file mode 100644
index 0000000..a678328
--- /dev/null
+++ b/meta/recipes-devtools/python/python-imaging_1.1.7.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Python Imaging Library (PIL)"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README;beginline=92;endline=120;md5=c4371af4579f1e489cf881c1443dd4ec"
+DEPENDS = "freetype jpeg tiff"
+SRCNAME = "Imaging"
+PR = "r5"
+
+SRC_URI = "http://effbot.org/downloads/Imaging-${PV}.tar.gz \
+           file://0001-python-imaging-setup.py-force-paths-for-zlib-freetyp.patch \
+           file://allow.to.disable.some.features.patch \
+           file://fix-freetype-includes.patch"
+
+SRC_URI[md5sum] = "fc14a54e1ce02a0225be8854bfba478e"
+SRC_URI[sha256sum] = "895bc7c2498c8e1f9b99938f1a40dc86b3f149741f105cf7c7bd2e0725405211"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+# There isn't enable/disable option, and lcms is in meta-oe, at least make it explicit when enabled
+# setup.py already has FIXME: add mechanism to explicitly *disable* the use of a library
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lcms] = ",,lcms"
+
+inherit distutils
+
+do_compile() {
+    export STAGING_LIBDIR=${STAGING_LIBDIR}
+    export STAGING_INCDIR=${STAGING_INCDIR}
+    export LCMS_ENABLED=${@bb.utils.contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)}
+    distutils_do_compile
+}
+
+do_install() {
+    export STAGING_LIBDIR=${STAGING_LIBDIR}
+    export STAGING_INCDIR=${STAGING_INCDIR}
+    export LCMS_ENABLED=${@bb.utils.contains('PACKAGECONFIG', 'lcms', 'True', 'False', d)}
+    distutils_do_install
+    install -d ${D}${datadir}/doc/${BPN}/html/
+    install -m 0644 ${S}/README ${D}${datadir}/doc/${BPN}/
+    install -m 0644 ${S}/Docs/* ${D}${datadir}/doc/${BPN}/html/
+
+    # get rid of #!/usr/local/bin/python
+    sed -i -e 's:/usr/local/bin/:${bindir}/env :g' ${D}${bindir}/*
+}
+
+RDEPENDS_${PN} += "python-lang python-stringold"
diff --git a/meta/recipes-devtools/python/python-mako_1.0.1.bb b/meta/recipes-devtools/python/python-mako_1.0.1.bb
new file mode 100644
index 0000000..5d42b0c
--- /dev/null
+++ b/meta/recipes-devtools/python/python-mako_1.0.1.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Templating library for Python"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=deb3ff8e4c17aaf7b80889b6b2bf4c83"
+
+SRC_URI = "https://pypi.python.org/packages/source/M/Mako/Mako-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "9f0aafd177b039ef67b90ea350497a54"
+SRC_URI[sha256sum] = "45f0869febea59dab7efd256fb451c377cbb7947bef386ff0bb44627c31a8d1c"
+
+S = "${WORKDIR}/Mako-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} = "python-threading \
+                  python-netclient \
+                  python-html \
+"
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch b/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
new file mode 100644
index 0000000..a39247c
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+# Some versions of SWIG do not use the extension parameter.
+# Make it optional.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Index: Python-2.6.1/Lib/distutils/command/build_ext.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_ext.py
++++ Python-2.6.1/Lib/distutils/command/build_ext.py
+@@ -566,7 +566,7 @@ class build_ext (Command):
+             target_lang=language)
+ 
+ 
+-    def swig_sources (self, sources, extension):
++    def swig_sources (self, sources, extension=None):
+ 
+         """Walk the list of source files in 'sources', looking for SWIG
+         interface (.i) files.  Run SWIG on all that are found, and
diff --git a/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch b/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
new file mode 100644
index 0000000..c92469b
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+# Don't modify the she-bang line for a cross-build.
+# Otherwise it points to our hostpython (which we do not want)
+#
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+
+Index: Python-2.6.1/Lib/distutils/command/build_scripts.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_scripts.py
++++ Python-2.6.1/Lib/distutils/command/build_scripts.py
+@@ -87,7 +87,7 @@ class build_scripts (Command):
+                     continue
+ 
+                 match = first_line_re.match(first_line)
+-                if match:
++                if False: #match:
+                     adjust = 1
+                     post_interp = match.group(1) or ''
+ 
diff --git a/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 0000000..f89aaff
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,65 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+# The proper prefix is inside our staging area.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+# Signed-off-by: Phil Blundell <philb@gnu.org>
+
+--- Python-2.6.6/Lib/distutils/sysconfig.py.orig	2012-01-03 14:02:03.027005296 +0000
++++ Python-2.6.6/Lib/distutils/sysconfig.py	2012-01-03 14:02:31.517601081 +0000
+@@ -19,8 +19,8 @@
+ from distutils.errors import DistutilsPlatformError
+ 
+ # These are needed in a couple of spots, so just compute them once.
+-PREFIX = os.path.normpath(sys.prefix)
+-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
++PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+ 
+ # Path to the base directory of the project. On Windows the binary may
+ # live in project/PCBuild9.  If we're dealing with an x64 Windows build,
+@@ -70,7 +70,7 @@
+     sys.exec_prefix -- i.e., ignore 'plat_specific'.
+     """
+     if prefix is None:
+-        prefix = plat_specific and EXEC_PREFIX or PREFIX
++        prefix = os.environ['STAGING_INCDIR'].rstrip('include')
+ 
+     if os.name == "posix":
+         if python_build:
+@@ -115,12 +115,16 @@
+     If 'prefix' is supplied, use it instead of sys.prefix or
+     sys.exec_prefix -- i.e., ignore 'plat_specific'.
+     """
++    lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
+     if prefix is None:
+-        prefix = plat_specific and EXEC_PREFIX or PREFIX
++        if plat_specific:
++            prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
++        else:
++            prefix = PREFIX
+ 
+     if os.name == "posix":
+         libpython = os.path.join(prefix,
+-                                 "lib", "python" + get_python_version())
++                                 lib_basename, "python" + get_python_version())
+         if standard_lib:
+             return libpython
+         else:
+@@ -216,7 +220,7 @@
+     else:
+         # The name of the config.h file changed in 2.2
+         config_h = 'pyconfig.h'
+-    return os.path.join(inc_dir, config_h)
++    return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+ 
+ 
+ def get_makefile_filename():
+@@ -225,7 +229,7 @@
+         return os.path.join(os.path.dirname(os.path.realpath(sys.executable)),
+                             "Makefile")
+     lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
+-    return os.path.join(lib_dir, "config", "Makefile")
++    return os.path.join(lib_dir, "config", "Makefile").replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+ 
+ 
+ def parse_config_h(fp, g=None):
diff --git a/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch b/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch
new file mode 100644
index 0000000..5279e7c
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/avoid_parallel_make_races_on_pgen.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Pending
+
+Avoids parallel make races linking errors when making Parser/PGEN
+
+- Implements Richard Purdie's idea
+
+Signed-Off-By: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -610,12 +610,10 @@ Modules/grpmodule.o: $(srcdir)/Modules/g
+ 
+ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
+ 
+-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
++$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN)
+ 		@$(MKDIR_P) Include
+-		$(MAKE) $(PGEN)
+ 		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
+-		$(MAKE) $(GRAMMAR_H)
+ 		touch $(GRAMMAR_C)
+ 
+ $(PGEN):	$(PGENOBJS)
diff --git a/meta/recipes-devtools/python/python-native/debug.patch b/meta/recipes-devtools/python/python-native/debug.patch
new file mode 100644
index 0000000..5ec10d6
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/debug.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+Index: Python-2.6.1/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/unixccompiler.py	2009-11-13 16:04:54.000000000 +0000
++++ Python-2.6.1/Lib/distutils/unixccompiler.py	2009-11-13 16:06:27.000000000 +0000
+@@ -300,6 +300,8 @@
+         dylib_f = self.library_filename(lib, lib_type='dylib')
+         static_f = self.library_filename(lib, lib_type='static')
+ 
++        print "Looking in %s for %s" % (lib, dirs)
++
+         for dir in dirs:
+             shared = os.path.join(dir, shared_f)
+             dylib = os.path.join(dir, dylib_f)
+@@ -309,10 +311,13 @@
+             # assuming that *all* Unix C compilers do.  And of course I'm
+             # ignoring even GCC's "-static" option.  So sue me.
+             if os.path.exists(dylib):
++                print "Found %s" % (dylib)
+                 return dylib
+             elif os.path.exists(shared):
++                print "Found %s" % (shared)
+                 return shared
+             elif os.path.exists(static):
++                print "Found %s" % (static)
+                 return static
+ 
+         # Oops, didn't find it in *any* of 'dirs'
diff --git a/meta/recipes-devtools/python/python-native/multilib.patch b/meta/recipes-devtools/python/python-native/multilib.patch
new file mode 100644
index 0000000..8ca89e7
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/multilib.patch
@@ -0,0 +1,235 @@
+Rebased for Python 2.7.9
+
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+2011/09/29
+The python recipe building was failing because python-native 
+could not handle sys.lib var. sys.lib var is defined in the 
+multilib patch hence added this multilib.patch for python-native 
+recipe.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Index: Python-2.7.9/Include/pythonrun.h
+===================================================================
+--- Python-2.7.9.orig/Include/pythonrun.h
++++ Python-2.7.9/Include/pythonrun.h
+@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);
+ PyAPI_FUNC(const char *) Py_GetPlatform(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
+ PyAPI_FUNC(const char *) Py_GetCopyright(void);
+ PyAPI_FUNC(const char *) Py_GetCompiler(void);
+ PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+Index: Python-2.7.9/Lib/distutils/command/install.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/command/install.py
++++ Python-2.7.9/Lib/distutils/command/install.py
+@@ -22,6 +22,8 @@ from site import USER_BASE
+ from site import USER_SITE
+ 
+ 
++libname = sys.lib
++
+ if sys.version < "2.2":
+     WINDOWS_SCHEME = {
+         'purelib': '$base',
+@@ -42,7 +44,7 @@ else:
+ INSTALL_SCHEMES = {
+     'unix_prefix': {
+         'purelib': '$base/lib/python$py_version_short/site-packages',
+-        'platlib': '$platbase/lib/python$py_version_short/site-packages',
++        'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+         'headers': '$base/include/python$py_version_short/$dist_name',
+         'scripts': '$base/bin',
+         'data'   : '$base',
+Index: Python-2.7.9/Lib/pydoc.py
+===================================================================
+--- Python-2.7.9.orig/Lib/pydoc.py
++++ Python-2.7.9/Lib/pydoc.py
+@@ -383,7 +383,7 @@ class Doc:
+ 
+         docloc = os.environ.get("PYTHONDOCS",
+                                 "http://docs.python.org/library")
+-        basedir = os.path.join(sys.exec_prefix, "lib",
++        basedir = os.path.join(sys.exec_prefix, sys.lib,
+                                "python"+sys.version[0:3])
+         if (isinstance(object, type(os)) and
+             (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
+Index: Python-2.7.9/Lib/site.py
+===================================================================
+--- Python-2.7.9.orig/Lib/site.py
++++ Python-2.7.9/Lib/site.py
+@@ -288,13 +288,19 @@ def getsitepackages():
+         if sys.platform in ('os2emx', 'riscos'):
+             sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+         elif os.sep == '/':
+-            sitepackages.append(os.path.join(prefix, "lib",
++            sitepackages.append(os.path.join(prefix, sys.lib,
+                                         "python" + sys.version[:3],
+                                         "site-packages"))
+-            sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++            if sys.lib != "lib":
++                sitepackages.append(os.path.join(prefix, "lib",
++                                        "python" + sys.version[:3],
++                                        "site-packages"))
++            sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
++            if sys.lib != "lib":
++                sitepackages.append(os.path.join(prefix, "lib", "site-python"))
+         else:
+             sitepackages.append(prefix)
+-            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++            sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
+         if sys.platform == "darwin":
+             # for framework builds *only* we add the standard Apple
+             # locations.
+Index: Python-2.7.9/Lib/test/test_dl.py
+===================================================================
+--- Python-2.7.9.orig/Lib/test/test_dl.py
++++ Python-2.7.9/Lib/test/test_dl.py
+@@ -4,10 +4,11 @@
+ import unittest
+ from test.test_support import verbose, import_module
+ dl = import_module('dl', deprecated=True)
++import sys
+ 
+ sharedlibs = [
+-    ('/usr/lib/libc.so', 'getpid'),
+-    ('/lib/libc.so.6', 'getpid'),
++    ('/usr/'+sys.lib+'/libc.so', 'getpid'),
++    ('/'+sys.lib+'/libc.so.6', 'getpid'),
+     ('/usr/bin/cygwin1.dll', 'getpid'),
+     ('/usr/lib/libc.dylib', 'getpid'),
+     ]
+Index: Python-2.7.9/Lib/trace.py
+===================================================================
+--- Python-2.7.9.orig/Lib/trace.py
++++ Python-2.7.9/Lib/trace.py
+@@ -754,10 +754,10 @@ def main(argv=None):
+                 # should I also call expanduser? (after all, could use $HOME)
+ 
+                 s = s.replace("$prefix",
+-                              os.path.join(sys.prefix, "lib",
++                              os.path.join(sys.prefix, sys.lib,
+                                            "python" + sys.version[:3]))
+                 s = s.replace("$exec_prefix",
+-                              os.path.join(sys.exec_prefix, "lib",
++                              os.path.join(sys.exec_prefix, sys.lib,
+                                            "python" + sys.version[:3]))
+                 s = os.path.normpath(s)
+                 ignore_dirs.append(s)
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -87,6 +87,7 @@ PY_CFLAGS=	$(CFLAGS) $(CPPFLAGS) $(CFLAG
+ 
+ # Machine-dependent subdirectories
+ MACHDEP=	@MACHDEP@
++LIB=		@LIB@
+ 
+ # Multiarch directory (may be empty)
+ MULTIARCH=	@MULTIARCH@
+@@ -106,7 +107,7 @@ LIBDIR=		@libdir@
+ MANDIR=		@mandir@
+ INCLUDEDIR=	@includedir@
+ CONFINCLUDEDIR=	$(exec_prefix)/include
+-SCRIPTDIR=	$(prefix)/lib
++SCRIPTDIR=	$(prefix)/@LIB@
+ 
+ # Detailed destination directories
+ BINLIBDEST=	$(LIBDIR)/python$(VERSION)
+@@ -597,6 +598,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ 		-DEXEC_PREFIX='"$(exec_prefix)"' \
+ 		-DVERSION='"$(VERSION)"' \
+ 		-DVPATH='"$(VPATH)"' \
++		-DLIB='"$(LIB)"' \
+ 		-o $@ $(srcdir)/Modules/getpath.c
+ 
+ Modules/python.o: $(srcdir)/Modules/python.c
+@@ -639,7 +641,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
+ Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
+ 
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+-		$(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++		$(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+ 
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ 		$(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-2.7.9/Modules/getpath.c
+===================================================================
+--- Python-2.7.9.orig/Modules/getpath.c
++++ Python-2.7.9/Modules/getpath.c
+@@ -116,9 +116,11 @@
+ #define EXEC_PREFIX PREFIX
+ #endif
+ 
++#define LIB_PYTHON LIB "/python" VERSION
++
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+-              EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++              EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+ #endif
+ 
+ #ifndef LANDMARK
+@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = LIB_PYTHON;
+ 
+ static void
+ reduce(char *dir)
+Index: Python-2.7.9/Python/getplatform.c
+===================================================================
+--- Python-2.7.9.orig/Python/getplatform.c
++++ Python-2.7.9/Python/getplatform.c
+@@ -10,3 +10,13 @@ Py_GetPlatform(void)
+ {
+ 	return PLATFORM;
+ }
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++	return LIB;
++}
+Index: Python-2.7.9/Python/sysmodule.c
+===================================================================
+--- Python-2.7.9.orig/Python/sysmodule.c
++++ Python-2.7.9/Python/sysmodule.c
+@@ -1437,6 +1437,8 @@ _PySys_Init(void)
+                         PyString_FromString(Py_GetCopyright()));
+     SET_SYS_FROM_STRING("platform",
+                         PyString_FromString(Py_GetPlatform()));
++    SET_SYS_FROM_STRING("lib",
++                PyString_FromString(Py_GetLib()));
+     SET_SYS_FROM_STRING("executable",
+                         PyString_FromString(Py_GetProgramFullPath()));
+     SET_SYS_FROM_STRING("prefix",
+Index: Python-2.7.9/configure.ac
+===================================================================
+--- Python-2.7.9.orig/configure.ac
++++ Python-2.7.9/configure.ac
+@@ -736,6 +736,11 @@ SunOS*)
+     ;;
+ esac
+ 
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++LIB=`basename ${libdir}`
++AC_MSG_RESULT($LIB)
++
+ 
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
diff --git a/meta/recipes-devtools/python/python-native/nohostlibs.patch b/meta/recipes-devtools/python/python-native/nohostlibs.patch
new file mode 100644
index 0000000..8a452e9
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/nohostlibs.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+2014/12/15
+Rebased for python-2.7.9
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -439,9 +439,9 @@ class PyBuildExt(build_ext):
+ 
+     def detect_modules(self):
+         # Ensure that /usr/local is always used
+-        if not cross_compiling:
+-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+-            add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
++        # if not cross_compiling:
++            # add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++            # add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+         if cross_compiling:
+             self.add_gcc_paths()
+         self.add_multiarch_paths()
+@@ -480,15 +480,15 @@ class PyBuildExt(build_ext):
+                     for directory in reversed(options.dirs):
+                         add_dir_to_list(dir_list, directory)
+ 
+-        if os.path.normpath(sys.prefix) != '/usr' \
+-                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++        #if os.path.normpath(sys.prefix) != '/usr' \
++                #and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+             # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+             # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+             # building a framework with different architectures than
+             # the one that is currently installed (issue #7473)
+-            add_dir_to_list(self.compiler.library_dirs,
++        add_dir_to_list(self.compiler.library_dirs,
+                             sysconfig.get_config_var("LIBDIR"))
+-            add_dir_to_list(self.compiler.include_dirs,
++        add_dir_to_list(self.compiler.include_dirs,
+                             sysconfig.get_config_var("INCLUDEDIR"))
+ 
+         try:
+@@ -761,8 +761,7 @@ class PyBuildExt(build_ext):
+                 pass # Issue 7384: Already linked against curses or tinfo.
+             elif curses_library:
+                 readline_libs.append(curses_library)
+-            elif self.compiler.find_library_file(lib_dirs +
+-                                                     ['/usr/lib/termcap'],
++            elif self.compiler.find_library_file(lib_dirs,
+                                                      'termcap'):
+                 readline_libs.append('termcap')
+             exts.append( Extension('readline', ['readline.c'],
diff --git a/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch b/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
new file mode 100644
index 0000000..202aaf1
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/revert_use_of_sysconfigdata.patch
@@ -0,0 +1,86 @@
+On older versions of Python, sysconfig read the data from both the Makefile and
+the Python.h file generated at build time, created dictionaries with their variables
+and used those when using get_config_var(), now it uses _sysconfigdata.build_time_vars[]
+which contains information from the HOST, erroneous in our case, this patch reverts this
+behavior and uses Python.h and Makefile to get information.
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/Lib/distutils/sysconfig.py
+@@ -401,12 +401,66 @@ _config_vars = None
+ 
+ def _init_posix():
+     """Initialize the module as appropriate for POSIX systems."""
+-    # _sysconfigdata is generated at build time, see the sysconfig module
+-    from _sysconfigdata import build_time_vars
+-    global _config_vars
+-    _config_vars = {}
+-    _config_vars.update(build_time_vars)
++    g = {}
++    # load the installed Makefile:
++    try:
++        filename = get_makefile_filename()
++        parse_makefile(filename, g)
++    except IOError, msg:
++        my_msg = "invalid Python installation: unable to open %s" % filename
++        if hasattr(msg, "strerror"):
++            my_msg = my_msg + " (%s)" % msg.strerror
++
++        raise DistutilsPlatformError(my_msg)
++
++    # load the installed pyconfig.h:
++    try:
++        filename = get_config_h_filename()
++        parse_config_h(file(filename), g)
++    except IOError, msg:
++        my_msg = "invalid Python installation: unable to open %s" % filename
++        if hasattr(msg, "strerror"):
++            my_msg = my_msg + " (%s)" % msg.strerror
++
++        raise DistutilsPlatformError(my_msg)
++
++    # On AIX, there are wrong paths to the linker scripts in the Makefile
++    # -- these paths are relative to the Python source, but when installed
++    # the scripts are in another directory.
++    if python_build:
++        g['LDSHARED'] = g['BLDSHARED']
+ 
++    elif get_python_version() < '2.1':
++        # The following two branches are for 1.5.2 compatibility.
++        if sys.platform == 'aix4':          # what about AIX 3.x ?
++            # Linker script is in the config directory, not in Modules as the
++            # Makefile says.
++            python_lib = get_python_lib(standard_lib=1)
++            ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix')
++            python_exp = os.path.join(python_lib, 'config', 'python.exp')
++
++            g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp)
++
++        elif sys.platform == 'beos':
++            # Linker script is in the config directory.  In the Makefile it is
++            # relative to the srcdir, which after installation no longer makes
++            # sense.
++            python_lib = get_python_lib(standard_lib=1)
++            linkerscript_path = string.split(g['LDSHARED'])[0]
++            linkerscript_name = os.path.basename(linkerscript_path)
++            linkerscript = os.path.join(python_lib, 'config',
++                                        linkerscript_name)
++
++            # XXX this isn't the right place to do this: adding the Python
++            # library to the link, if needed, should be in the "build_ext"
++            # command.  (It's also needed for non-MS compilers on Windows, and
++            # it's taken care of for them by the 'build_ext.get_libraries()'
++            # method.)
++            g['LDSHARED'] = ("%s -L%s/lib -lpython%s" %
++                             (linkerscript, PREFIX, get_python_version()))
++
++    global _config_vars
++    _config_vars = g
+ 
+ def _init_nt():
+     """Initialize the module as appropriate for NT"""
diff --git a/meta/recipes-devtools/python/python-native/unixccompiler.patch b/meta/recipes-devtools/python/python-native/unixccompiler.patch
new file mode 100644
index 0000000..4502829
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/unixccompiler.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+The CC variable,sometimes like:"x86_64-poky-linux-gcc   -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information. 
+This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Python-2.7.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.7.2.orig/Lib/distutils/unixccompiler.py	2011-11-24 13:51:10.539998722 -0800
++++ Python-2.7.2/Lib/distutils/unixccompiler.py	2011-11-24 15:54:36.872137766 -0800
+@@ -282,7 +282,7 @@
+         # this time, there's no way to determine this information from
+         # the configuration data stored in the Python installation, so
+         # we use this hack.
+-        compiler = os.path.basename(sysconfig.get_config_var("CC"))
++        compiler = sysconfig.get_config_var("CC")
+         if sys.platform[:6] == "darwin":
+             # MacOSX's linker doesn't understand the -R flag at all
+             return "-L" + dir
diff --git a/meta/recipes-devtools/python/python-native_2.7.9.bb b/meta/recipes-devtools/python/python-native_2.7.9.bb
new file mode 100644
index 0000000..34f5c29
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native_2.7.9.bb
@@ -0,0 +1,63 @@
+require python.inc
+
+EXTRANATIVEPATH += "bzip2-native"
+DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native"
+PR = "${INC_PR}.1"
+
+SRC_URI += "\
+            file://05-enable-ctypes-cross-build.patch \
+            file://10-distutils-fix-swig-parameter.patch \
+            file://11-distutils-never-modify-shebang-line.patch \
+            file://12-distutils-prefix-is-inside-staging-area.patch \
+            file://debug.patch \
+            file://unixccompiler.patch \
+            file://nohostlibs.patch \
+            file://multilib.patch \
+            file://add-md5module-support.patch \
+            file://builddir.patch \
+            file://parallel-makeinst-create-bindir.patch \
+            file://revert_use_of_sysconfigdata.patch \
+            file://avoid_parallel_make_races_on_pgen.patch \
+           "
+S = "${WORKDIR}/Python-${PV}"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/${PN}:"
+
+inherit native
+
+RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-codecs-native python-core-native"
+
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN}"
+
+EXTRA_OEMAKE = '\
+  BUILD_SYS="" \
+  HOST_SYS="" \
+  LIBC="" \
+  STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
+  STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
+'
+
+do_configure_append() {
+	autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_install() {
+	oe_runmake 'DESTDIR=${D}' install
+	install -d ${D}${bindir}/${PN}
+	install -m 0755 Parser/pgen ${D}${bindir}/${PN}
+
+	# Make sure we use /usr/bin/env python
+	for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
+		sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
+	done
+
+	# Add a symlink to the native Python so that scripts can just invoke
+	# "nativepython" and get the right one without needing absolute paths
+	# (these often end up too long for the #! parser in the kernel as the
+	# buffer is 128 bytes long).
+	ln -s python-native/python ${D}${bindir}/nativepython
+
+	# We don't want modules in ~/.local being used in preference to those
+	# installed in the native sysroot, so disable user site support.
+	sed -i -e 's,^\(ENABLE_USER_SITE = \).*,\1False,' ${D}${libdir}/python${PYTHON_MAJMIN}/site.py
+}
diff --git a/meta/recipes-devtools/python/python-nose_1.3.6.bb b/meta/recipes-devtools/python/python-nose_1.3.6.bb
new file mode 100644
index 0000000..d6e8fc1
--- /dev/null
+++ b/meta/recipes-devtools/python/python-nose_1.3.6.bb
@@ -0,0 +1,16 @@
+DESCRIPTION = "nose extends the test loading and running features of unittest, \
+making it easier to write, find and run tests."
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://lgpl.txt;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+SRC_URI = "http://pypi.python.org/packages/source/n/nose/nose-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "0ca546d81ca8309080fc80cb389e7a16"
+SRC_URI[sha256sum] = "f61e0909a743eed37b1207e38a8e7b4a2fe0a82185e36f2be252ef1b3f901758"
+
+S = "${WORKDIR}/nose-${PV}"
+
+inherit setuptools
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h
new file mode 100644
index 0000000..be57ac2
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/aarch64/_numpyconfig.h
@@ -0,0 +1,30 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x00000007
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/aarch64/config.h b/meta/recipes-devtools/python/python-numpy/aarch64/config.h
new file mode 100644
index 0000000..c30b868
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/aarch64/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/arm/config.h b/meta/recipes-devtools/python/python-numpy/arm/config.h
new file mode 100644
index 0000000..17ef186
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/arm/config.h
@@ -0,0 +1,21 @@
+/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
+/* #define SIZEOF_SHORT 2 */
+/* #define SIZEOF_INT 4 */
+/* #define SIZEOF_LONG 4 */
+/* #define SIZEOF_FLOAT 4 */
+/* #define SIZEOF_DOUBLE 8 */
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_PY_INTPTR_T 4
+/* #define SIZEOF_LONG_LONG 8 */
+#define SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+#define MATHLIB m
+#define HAVE_FLOAT_FUNCS
+#define HAVE_LOG1P
+#define HAVE_EXPM1
+#define HAVE_INVERSE_HYPERBOLIC
+#define HAVE_INVERSE_HYPERBOLIC_FLOAT
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define HAVE_RINT
+
diff --git a/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h
new file mode 100644
index 0000000..c4bf654
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/arm/numpyconfig.h
@@ -0,0 +1,17 @@
+/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
+/*
+ *  * This file is generated by numpy/core/setup.pyc. DO NOT EDIT 
+ *   */
+#define NPY_SIZEOF_SHORT 2 
+#define NPY_SIZEOF_INT 4 
+#define NPY_SIZEOF_LONG 4 
+#define NPY_SIZEOF_FLOAT 4 
+#define NPY_SIZEOF_DOUBLE 8 
+#define NPY_SIZEOF_LONGDOUBLE 12 
+#define NPY_SIZEOF_PY_INTPTR_T 4 
+#define NPY_NO_SMP 0
+
+#define NPY_SIZEOF_LONGLONG 8 
+#define NPY_SIZEOF_PY_LONG_LONG 8 
+/* #define CHAR_BIT 8 */
+
diff --git a/meta/recipes-devtools/python/python-numpy/armeb/config.h b/meta/recipes-devtools/python/python-numpy/armeb/config.h
new file mode 100644
index 0000000..17ef186
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/armeb/config.h
@@ -0,0 +1,21 @@
+/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
+/* #define SIZEOF_SHORT 2 */
+/* #define SIZEOF_INT 4 */
+/* #define SIZEOF_LONG 4 */
+/* #define SIZEOF_FLOAT 4 */
+/* #define SIZEOF_DOUBLE 8 */
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_PY_INTPTR_T 4
+/* #define SIZEOF_LONG_LONG 8 */
+#define SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+#define MATHLIB m
+#define HAVE_FLOAT_FUNCS
+#define HAVE_LOG1P
+#define HAVE_EXPM1
+#define HAVE_INVERSE_HYPERBOLIC
+#define HAVE_INVERSE_HYPERBOLIC_FLOAT
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define HAVE_RINT
+
diff --git a/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h
new file mode 100644
index 0000000..c4bf654
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/armeb/numpyconfig.h
@@ -0,0 +1,17 @@
+/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
+/*
+ *  * This file is generated by numpy/core/setup.pyc. DO NOT EDIT 
+ *   */
+#define NPY_SIZEOF_SHORT 2 
+#define NPY_SIZEOF_INT 4 
+#define NPY_SIZEOF_LONG 4 
+#define NPY_SIZEOF_FLOAT 4 
+#define NPY_SIZEOF_DOUBLE 8 
+#define NPY_SIZEOF_LONGDOUBLE 12 
+#define NPY_SIZEOF_PY_INTPTR_T 4 
+#define NPY_NO_SMP 0
+
+#define NPY_SIZEOF_LONGLONG 8 
+#define NPY_SIZEOF_PY_LONG_LONG 8 
+/* #define CHAR_BIT 8 */
+
diff --git a/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h
new file mode 100644
index 0000000..c0c4285
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/mips/_numpyconfig.h
@@ -0,0 +1,30 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 8
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 16
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x00000007
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/mips/config.h b/meta/recipes-devtools/python/python-numpy/mips/config.h
new file mode 100644
index 0000000..2f6135a
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/mips/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 4
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_DOUBLE_BE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h
new file mode 100644
index 0000000..be57ac2
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/mips64/_numpyconfig.h
@@ -0,0 +1,30 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x00000007
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/mips64/config.h b/meta/recipes-devtools/python/python-numpy/mips64/config.h
new file mode 100644
index 0000000..c30b868
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/mips64/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h
new file mode 100644
index 0000000..be57ac2
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/mips64n32/_numpyconfig.h
@@ -0,0 +1,30 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x00000007
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/mips64n32/config.h b/meta/recipes-devtools/python/python-numpy/mips64n32/config.h
new file mode 100644
index 0000000..c30b868
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/mips64n32/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/mipsel/config.h b/meta/recipes-devtools/python/python-numpy/mipsel/config.h
new file mode 100644
index 0000000..17ef186
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/mipsel/config.h
@@ -0,0 +1,21 @@
+/* ./src.linux-i686-2.5/numpy/core/include/numpy/config.h */
+/* #define SIZEOF_SHORT 2 */
+/* #define SIZEOF_INT 4 */
+/* #define SIZEOF_LONG 4 */
+/* #define SIZEOF_FLOAT 4 */
+/* #define SIZEOF_DOUBLE 8 */
+#define SIZEOF_LONG_DOUBLE 12
+#define SIZEOF_PY_INTPTR_T 4
+/* #define SIZEOF_LONG_LONG 8 */
+#define SIZEOF_PY_LONG_LONG 8
+/* #define CHAR_BIT 8 */
+#define MATHLIB m
+#define HAVE_FLOAT_FUNCS
+#define HAVE_LOG1P
+#define HAVE_EXPM1
+#define HAVE_INVERSE_HYPERBOLIC
+#define HAVE_INVERSE_HYPERBOLIC_FLOAT
+#define HAVE_ISNAN
+#define HAVE_ISINF
+#define HAVE_RINT
+
diff --git a/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h
new file mode 100644
index 0000000..c4bf654
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/mipsel/numpyconfig.h
@@ -0,0 +1,17 @@
+/* cat ./src.linux-i686-2.5/numpy/core/include/numpy/numpyconfig.h */
+/*
+ *  * This file is generated by numpy/core/setup.pyc. DO NOT EDIT 
+ *   */
+#define NPY_SIZEOF_SHORT 2 
+#define NPY_SIZEOF_INT 4 
+#define NPY_SIZEOF_LONG 4 
+#define NPY_SIZEOF_FLOAT 4 
+#define NPY_SIZEOF_DOUBLE 8 
+#define NPY_SIZEOF_LONGDOUBLE 12 
+#define NPY_SIZEOF_PY_INTPTR_T 4 
+#define NPY_NO_SMP 0
+
+#define NPY_SIZEOF_LONGLONG 8 
+#define NPY_SIZEOF_PY_LONG_LONG 8 
+/* #define CHAR_BIT 8 */
+
diff --git a/meta/recipes-devtools/python/python-numpy/no-host-paths.patch b/meta/recipes-devtools/python/python-numpy/no-host-paths.patch
new file mode 100644
index 0000000..d745036
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/no-host-paths.patch
@@ -0,0 +1,57 @@
+Don't search /usr and so on for libraries by default to avoid host contamination.
+
+Upstream-Status: Inappropriate (As the code stands, this is a hack)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
+index bac90fb..a63d796 100644
+--- a/numpy/distutils/system_info.py
++++ b/numpy/distutils/system_info.py
+@@ -191,41 +191,12 @@ if sys.platform == 'win32':
+     default_x11_lib_dirs = []
+     default_x11_include_dirs = []
+ else:
+-    default_lib_dirs = libpaths(['/usr/local/lib', '/opt/lib', '/usr/lib',
+-                                 '/opt/local/lib', '/sw/lib'], platform_bits)
+-    default_include_dirs = ['/usr/local/include',
+-                            '/opt/include', '/usr/include',
+-                            # path of umfpack under macports
+-                            '/opt/local/include/ufsparse',
+-                            '/opt/local/include', '/sw/include',
+-                            '/usr/include/suitesparse']
+-    default_src_dirs = ['.', '/usr/local/src', '/opt/src', '/sw/src']
+-
+-    default_x11_lib_dirs = libpaths(['/usr/X11R6/lib', '/usr/X11/lib',
+-                                     '/usr/lib'], platform_bits)
+-    default_x11_include_dirs = ['/usr/X11R6/include', '/usr/X11/include',
+-                                '/usr/include']
+-
+-    if os.path.exists('/usr/lib/X11'):
+-        globbed_x11_dir = glob('/usr/lib/*/libX11.so')
+-        if globbed_x11_dir:
+-            x11_so_dir = os.path.split(globbed_x11_dir[0])[0]
+-            default_x11_lib_dirs.extend([x11_so_dir, '/usr/lib/X11'])
+-            default_x11_include_dirs.extend(['/usr/lib/X11/include',
+-                                             '/usr/include/X11'])
+-
+-    import subprocess as sp
+-    try:
+-        p = sp.Popen(["gcc", "-print-multiarch"], stdout=sp.PIPE,
+-                stderr=open(os.devnull, 'w'))
+-    except OSError:
+-        pass # gcc is not installed
+-    else:
+-        triplet = str(p.communicate()[0].decode().strip())
+-        if p.returncode == 0:
+-            # gcc supports the "-print-multiarch" option
+-            default_x11_lib_dirs += [os.path.join("/usr/lib/", triplet)]
+-            default_lib_dirs += [os.path.join("/usr/lib/", triplet)]
++    default_lib_dirs = libpaths(['/deadir/lib'], platform_bits)
++    default_include_dirs = ['/deaddir/include']
++    default_src_dirs = ['.', '/deaddir/src']
++
++    default_x11_lib_dirs = libpaths(['/deaddir/lib'], platform_bits)
++    default_x11_include_dirs = ['/deaddir/include']
+ 
+ if os.path.join(sys.prefix, 'lib') not in default_lib_dirs:
+     default_lib_dirs.insert(0, os.path.join(sys.prefix, 'lib'))
diff --git a/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h
new file mode 100644
index 0000000..73cbfb1
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/powerpc/_numpyconfig.h
@@ -0,0 +1,30 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_SIZEOF_PY_INTPTR_T 4
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x00000007
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/powerpc/config.h b/meta/recipes-devtools/python/python-numpy/powerpc/config.h
new file mode 100644
index 0000000..f65d39d
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/powerpc/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 4
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_DOUBLE_DOUBLE_BE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h
new file mode 100644
index 0000000..be57ac2
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/powerpc64/_numpyconfig.h
@@ -0,0 +1,30 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x00000007
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/powerpc64/config.h b/meta/recipes-devtools/python/python-numpy/powerpc64/config.h
new file mode 100644
index 0000000..c30b868
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/powerpc64/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_IEEE_QUAD_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h b/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h
new file mode 100644
index 0000000..be57ac2
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/x86-64/_numpyconfig.h
@@ -0,0 +1,30 @@
+#define NPY_HAVE_ENDIAN_H 1
+#define NPY_SIZEOF_SHORT SIZEOF_SHORT
+#define NPY_SIZEOF_INT SIZEOF_INT
+#define NPY_SIZEOF_LONG SIZEOF_LONG
+#define NPY_SIZEOF_FLOAT 4
+#define NPY_SIZEOF_COMPLEX_FLOAT 8
+#define NPY_SIZEOF_DOUBLE 8
+#define NPY_SIZEOF_COMPLEX_DOUBLE 16
+#define NPY_SIZEOF_LONGDOUBLE 16
+#define NPY_SIZEOF_COMPLEX_LONGDOUBLE 32
+#define NPY_SIZEOF_PY_INTPTR_T 8
+#define NPY_SIZEOF_PY_LONG_LONG 8
+#define NPY_SIZEOF_LONGLONG 8
+#define NPY_NO_SMP 0
+#define NPY_HAVE_DECL_ISNAN
+#define NPY_HAVE_DECL_ISINF
+#define NPY_HAVE_DECL_ISFINITE
+#define NPY_HAVE_DECL_SIGNBIT
+#define NPY_USE_C99_COMPLEX 1
+#define NPY_HAVE_COMPLEX_DOUBLE 1
+#define NPY_HAVE_COMPLEX_FLOAT 1
+#define NPY_HAVE_COMPLEX_LONG_DOUBLE 1
+#define NPY_USE_C99_FORMATS 1
+#define NPY_VISIBILITY_HIDDEN __attribute__((visibility("hidden")))
+#define NPY_ABI_VERSION 0x01000009
+#define NPY_API_VERSION 0x00000007
+
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/x86-64/config.h b/meta/recipes-devtools/python/python-numpy/x86-64/config.h
new file mode 100644
index 0000000..0ce63b7
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/x86-64/config.h
@@ -0,0 +1,139 @@
+#define HAVE_ENDIAN_H 1
+#define SIZEOF_PY_INTPTR_T 8
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN 1
+#define HAVE_COS 1
+#define HAVE_TAN 1
+#define HAVE_SINH 1
+#define HAVE_COSH 1
+#define HAVE_TANH 1
+#define HAVE_FABS 1
+#define HAVE_FLOOR 1
+#define HAVE_CEIL 1
+#define HAVE_SQRT 1
+#define HAVE_LOG10 1
+#define HAVE_LOG 1
+#define HAVE_EXP 1
+#define HAVE_ASIN 1
+#define HAVE_ACOS 1
+#define HAVE_ATAN 1
+#define HAVE_FMOD 1
+#define HAVE_MODF 1
+#define HAVE_FREXP 1
+#define HAVE_LDEXP 1
+#define HAVE_RINT 1
+#define HAVE_TRUNC 1
+#define HAVE_EXP2 1
+#define HAVE_LOG2 1
+#define HAVE_ATAN2 1
+#define HAVE_POW 1
+#define HAVE_NEXTAFTER 1
+#define HAVE_SINF 1
+#define HAVE_COSF 1
+#define HAVE_TANF 1
+#define HAVE_SINHF 1
+#define HAVE_COSHF 1
+#define HAVE_TANHF 1
+#define HAVE_FABSF 1
+#define HAVE_FLOORF 1
+#define HAVE_CEILF 1
+#define HAVE_RINTF 1
+#define HAVE_TRUNCF 1
+#define HAVE_SQRTF 1
+#define HAVE_LOG10F 1
+#define HAVE_LOGF 1
+#define HAVE_LOG1PF 1
+#define HAVE_EXPF 1
+#define HAVE_EXPM1F 1
+#define HAVE_ASINF 1
+#define HAVE_ACOSF 1
+#define HAVE_ATANF 1
+#define HAVE_ASINHF 1
+#define HAVE_ACOSHF 1
+#define HAVE_ATANHF 1
+#define HAVE_HYPOTF 1
+#define HAVE_ATAN2F 1
+#define HAVE_POWF 1
+#define HAVE_FMODF 1
+#define HAVE_MODFF 1
+#define HAVE_FREXPF 1
+#define HAVE_LDEXPF 1
+#define HAVE_EXP2F 1
+#define HAVE_LOG2F 1
+#define HAVE_COPYSIGNF 1
+#define HAVE_NEXTAFTERF 1
+#define HAVE_SINL 1
+#define HAVE_COSL 1
+#define HAVE_TANL 1
+#define HAVE_SINHL 1
+#define HAVE_COSHL 1
+#define HAVE_TANHL 1
+#define HAVE_FABSL 1
+#define HAVE_FLOORL 1
+#define HAVE_CEILL 1
+#define HAVE_RINTL 1
+#define HAVE_TRUNCL 1
+#define HAVE_SQRTL 1
+#define HAVE_LOG10L 1
+#define HAVE_LOGL 1
+#define HAVE_LOG1PL 1
+#define HAVE_EXPL 1
+#define HAVE_EXPM1L 1
+#define HAVE_ASINL 1
+#define HAVE_ACOSL 1
+#define HAVE_ATANL 1
+#define HAVE_ASINHL 1
+#define HAVE_ACOSHL 1
+#define HAVE_ATANHL 1
+#define HAVE_HYPOTL 1
+#define HAVE_ATAN2L 1
+#define HAVE_POWL 1
+#define HAVE_FMODL 1
+#define HAVE_MODFL 1
+#define HAVE_FREXPL 1
+#define HAVE_LDEXPL 1
+#define HAVE_EXP2L 1
+#define HAVE_LOG2L 1
+#define HAVE_COPYSIGNL 1
+#define HAVE_NEXTAFTERL 1
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H 1
+#define HAVE_CREAL 1
+#define HAVE_CIMAG 1
+#define HAVE_CABS 1
+#define HAVE_CARG 1
+#define HAVE_CEXP 1
+#define HAVE_CSQRT 1
+#define HAVE_CLOG 1
+#define HAVE_CCOS 1
+#define HAVE_CSIN 1
+#define HAVE_CPOW 1
+#define HAVE_CREALF 1
+#define HAVE_CIMAGF 1
+#define HAVE_CABSF 1
+#define HAVE_CARGF 1
+#define HAVE_CEXPF 1
+#define HAVE_CSQRTF 1
+#define HAVE_CLOGF 1
+#define HAVE_CCOSF 1
+#define HAVE_CSINF 1
+#define HAVE_CPOWF 1
+#define HAVE_CREALL 1
+#define HAVE_CIMAGL 1
+#define HAVE_CABSL 1
+#define HAVE_CARGL 1
+#define HAVE_CEXPL 1
+#define HAVE_CSQRTL 1
+#define HAVE_CLOGL 1
+#define HAVE_CCOSL 1
+#define HAVE_CSINL 1
+#define HAVE_CPOWL 1
+#define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/x86/config.h b/meta/recipes-devtools/python/python-numpy/x86/config.h
new file mode 100644
index 0000000..08e41e3
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/x86/config.h
@@ -0,0 +1,108 @@
+#define SIZEOF_PY_INTPTR_T 4
+#define SIZEOF_PY_LONG_LONG 8
+#define MATHLIB m
+#define HAVE_SIN
+#define HAVE_COS
+#define HAVE_TAN
+#define HAVE_SINH
+#define HAVE_COSH
+#define HAVE_TANH
+#define HAVE_FABS
+#define HAVE_FLOOR
+#define HAVE_CEIL
+#define HAVE_SQRT
+#define HAVE_LOG10
+#define HAVE_LOG
+#define HAVE_EXP
+#define HAVE_ASIN
+#define HAVE_ACOS
+#define HAVE_ATAN
+#define HAVE_FMOD
+#define HAVE_MODF
+#define HAVE_FREXP
+#define HAVE_LDEXP
+#define HAVE_RINT
+#define HAVE_TRUNC
+#define HAVE_EXP2
+#define HAVE_LOG2
+#define HAVE_ATAN2
+#define HAVE_POW
+#define HAVE_NEXTAFTER
+#define HAVE_SINF
+#define HAVE_COSF
+#define HAVE_TANF
+#define HAVE_SINHF
+#define HAVE_COSHF
+#define HAVE_TANHF
+#define HAVE_FABSF
+#define HAVE_FLOORF
+#define HAVE_CEILF
+#define HAVE_RINTF
+#define HAVE_TRUNCF
+#define HAVE_SQRTF
+#define HAVE_LOG10F
+#define HAVE_LOGF
+#define HAVE_LOG1PF
+#define HAVE_EXPF
+#define HAVE_EXPM1F
+#define HAVE_ASINF
+#define HAVE_ACOSF
+#define HAVE_ATANF
+#define HAVE_ASINHF
+#define HAVE_ACOSHF
+#define HAVE_ATANHF
+#define HAVE_HYPOTF
+#define HAVE_ATAN2F
+#define HAVE_POWF
+#define HAVE_FMODF
+#define HAVE_MODFF
+#define HAVE_FREXPF
+#define HAVE_LDEXPF
+#define HAVE_EXP2F
+#define HAVE_LOG2F
+#define HAVE_COPYSIGNF
+#define HAVE_NEXTAFTERF
+#define HAVE_SINL
+#define HAVE_COSL
+#define HAVE_TANL
+#define HAVE_SINHL
+#define HAVE_COSHL
+#define HAVE_TANHL
+#define HAVE_FABSL
+#define HAVE_FLOORL
+#define HAVE_CEILL
+#define HAVE_RINTL
+#define HAVE_TRUNCL
+#define HAVE_SQRTL
+#define HAVE_LOG10L
+#define HAVE_LOGL
+#define HAVE_LOG1PL
+#define HAVE_EXPL
+#define HAVE_EXPM1L
+#define HAVE_ASINL
+#define HAVE_ACOSL
+#define HAVE_ATANL
+#define HAVE_ASINHL
+#define HAVE_ACOSHL
+#define HAVE_ATANHL
+#define HAVE_HYPOTL
+#define HAVE_ATAN2L
+#define HAVE_POWL
+#define HAVE_FMODL
+#define HAVE_MODFL
+#define HAVE_FREXPL
+#define HAVE_LDEXPL
+#define HAVE_EXP2L
+#define HAVE_LOG2L
+#define HAVE_COPYSIGNL
+#define HAVE_NEXTAFTERL
+#define HAVE_DECL_SIGNBIT
+#define HAVE_COMPLEX_H
+#define HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE 1
+#ifndef __cplusplus
+/* #undef inline */
+#endif
+
+#ifndef _NPY_NPY_CONFIG_H_
+#error config.h should never be included directly, include npy_config.h instead
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy/x86/numpyconfig.h b/meta/recipes-devtools/python/python-numpy/x86/numpyconfig.h
new file mode 100644
index 0000000..ff7938c
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy/x86/numpyconfig.h
@@ -0,0 +1,24 @@
+#ifndef _NPY_NUMPYCONFIG_H_
+#define _NPY_NUMPYCONFIG_H_
+
+#include "_numpyconfig.h"
+
+/* 
+ * On Mac OS X, because there is only one configuration stage for all the archs
+ * in universal builds, any macro which depends on the arch needs to be
+ * harcoded
+ */
+#ifdef __APPLE__
+	#undef NPY_SIZEOF_LONG
+	#undef NPY_SIZEOF_PY_INTPTR_T
+
+	#ifdef __LP64__
+		#define NPY_SIZEOF_LONG 		8
+		#define NPY_SIZEOF_PY_INTPTR_T 	8
+	#else
+		#define NPY_SIZEOF_LONG 		4
+		#define NPY_SIZEOF_PY_INTPTR_T 	4
+	#endif
+#endif
+
+#endif
diff --git a/meta/recipes-devtools/python/python-numpy_1.7.0.bb b/meta/recipes-devtools/python/python-numpy_1.7.0.bb
new file mode 100644
index 0000000..81cdfde
--- /dev/null
+++ b/meta/recipes-devtools/python/python-numpy_1.7.0.bb
@@ -0,0 +1,99 @@
+SUMMARY = "A sophisticated Numeric Processing Package for Python"
+SECTION = "devel/python"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=f87832d854acbade6e9f5c601c8b30b1"
+PR = "r1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/numpy-${PV}.tar.gz \
+           file://no-host-paths.patch \
+           ${CONFIGFILESURI} "
+
+CONFIGFILESURI ?= ""
+
+CONFIGFILESURI_aarch64 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_arm = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_armeb = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_mipsel = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_x86 = " \
+    file://config.h \
+    file://numpyconfig.h \
+"
+CONFIGFILESURI_x86-64 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mips = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_powerpc = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_powerpc64 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mips64 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+CONFIGFILESURI_mips64n32 = " \
+    file://config.h \
+    file://_numpyconfig.h \
+"
+
+S = "${WORKDIR}/numpy-${PV}"
+
+inherit distutils
+
+# Make the build fail and replace *config.h with proper one
+# This is a ugly, ugly hack - Koen
+do_compile_prepend_class-target() {
+    BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+    ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build ${DISTUTILS_BUILD_ARGS} || \
+    true
+    cp ${WORKDIR}/*config.h ${S}/build/$(ls ${S}/build | grep src)/numpy/core/include/numpy/
+}
+
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/numpy/core/lib/*.a"
+
+SRC_URI[md5sum] = "4fa54e40b6a243416f0248123b6ec332"
+SRC_URI[sha256sum] = "f4fa70b7edbab65ee6432eb63743f5489f1919c614632b20b2fb45aa7e682ac6"
+
+# install what is needed for numpy.test()
+RDEPENDS_${PN} = "python-unittest \
+                  python-difflib \
+                  python-pprint \
+                  python-pickle \
+                  python-shell \
+                  python-nose \
+                  python-doctest \
+                  python-datetime \
+                  python-distutils \
+                  python-misc \
+                  python-mmap \
+                  python-netclient \
+                  python-numbers \
+                  python-pydoc \
+                  python-pkgutil \
+                  python-email \
+                  python-subprocess \
+                  python-compression \
+"
+
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/python/python-pexpect_3.3.bb b/meta/recipes-devtools/python/python-pexpect_3.3.bb
new file mode 100644
index 0000000..cd80aeb
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pexpect_3.3.bb
@@ -0,0 +1,23 @@
+SUMMARY = "A Pure Python Expect like Module for Python"
+HOMEPAGE = "http://pexpect.readthedocs.org/"
+SECTION = "devel/python"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c25d9a0770ba69a9965acc894e9f3644"
+
+SRC_URI = "https://pypi.python.org/packages/source/p/pexpect/pexpect-${PV}.tar.gz"
+SRC_URI[md5sum] = "0de72541d3f1374b795472fed841dce8"
+SRC_URI[sha256sum] = "dfea618d43e83cfff21504f18f98019ba520f330e4142e5185ef7c73527de5ba"
+
+S = "${WORKDIR}/pexpect-${PV}"
+
+inherit distutils
+
+RDEPENDS_${PN} = "\
+    python-core \
+    python-io \
+    python-terminal \
+    python-resource \
+    python-fcntl \
+"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/python/python-pycairo_1.10.0.bb b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
new file mode 100644
index 0000000..70fe25c
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycairo_1.10.0.bb
@@ -0,0 +1,41 @@
+SUMMARY = "Python bindings for the Cairo canvas library"
+HOMEPAGE = "http://cairographics.org/pycairo"
+BUGTRACKER = "http://bugs.freedesktop.org"
+SECTION = "python-devel"
+LICENSE = "LGPLv2.1 & MPL-1.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f2e071ab72978431b294a0d696327421 \
+                    file://COPYING-LGPL-2.1;md5=fad9b3332be894bab9bc501572864b29 \
+                    file://COPYING-MPL-1.1;md5=bfe1f75d606912a4111c90743d6c7325"
+
+# cairo >= 1.8.8
+DEPENDS = "cairo"
+PR = "r2"
+
+SRC_URI = "http://cairographics.org/releases/py2cairo-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "20337132c4ab06c1146ad384d55372c5"
+SRC_URI[sha256sum] = "d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431"
+
+S = "${WORKDIR}/py2cairo-${PV}"
+
+inherit distutils pkgconfig
+
+BBCLASSEXTEND = "native"
+
+do_configure() {
+	BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} ./waf configure --prefix=${D}${prefix} --libdir=${D}${libdir}
+}
+
+do_compile() {
+	./waf build ${PARALLEL_MAKE}
+}
+
+do_install() {
+	./waf install
+	sed \
+		-e 's:@prefix@:${prefix}:' \
+		-e 's:@VERSION@:${PV}:' \
+		-e 's:@includedir@:${includedir}:' \
+		pycairo.pc.in > pycairo.pc
+	install -m 0644 pycairo.pc ${D}${libdir}/pkgconfig/
+}
diff --git a/meta/recipes-devtools/python/python-pycurl/no-static-link.patch b/meta/recipes-devtools/python/python-pycurl/no-static-link.patch
new file mode 100644
index 0000000..c5349ee
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycurl/no-static-link.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: pycurl-7.19.3.1/setup.py
+===================================================================
+--- pycurl-7.19.3.1.orig/setup.py	2014-07-16 12:57:24.065346887 +0000
++++ pycurl-7.19.3.1/setup.py	2014-07-16 12:57:53.057347678 +0000
+@@ -147,7 +147,7 @@
+         optbuf = ''
+         sslhintbuf = ''
+         errtext = ''
+-        for option in ["--libs", "--static-libs"]:
++        for option in ["--libs"]:
+             p = subprocess.Popen((CURL_CONFIG, option),
+                 stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+             stdout, stderr = p.communicate()
diff --git a/meta/recipes-devtools/python/python-pycurl_7.19.5.1.bb b/meta/recipes-devtools/python/python-pycurl_7.19.5.1.bb
new file mode 100644
index 0000000..0d0effe
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pycurl_7.19.5.1.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Python bindings for libcurl"
+HOMEPAGE = "http://pycurl.sourceforge.net/"
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1+ | MIT"
+LIC_FILES_CHKSUM = "file://README.rst;beginline=166;endline=181;md5=57e5ab0c0f964533fc59d93dec5695bb \
+                    file://COPYING-LGPL;md5=3579a9fd0221d49a237aaa33492f988c \
+                    file://COPYING-MIT;md5=e8200955c773b2a0fd6cea36ea5e87be"
+
+DEPENDS = "curl python"
+RDEPENDS_${PN} = "python-core curl"
+SRCNAME = "pycurl"
+
+SRC_URI = "\
+  http://${SRCNAME}.sourceforge.net/download/${SRCNAME}-${PV}.tar.gz;name=archive \
+  file://no-static-link.patch \
+"
+
+SRC_URI[archive.md5sum] = "f44cd54256d7a643ab7b16e3f409b26b"
+SRC_URI[archive.sha256sum] = "6e9770f80459757f73bd71af82fbb29cd398b38388cdf1beab31ea91a331bc6c"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+# need to export these variables for python-config to work
+export BUILD_SYS
+export HOST_SYS
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+BBCLASSEXTEND = "native"
+
+# Ensure the docstrings are generated as make clean will remove them
+do_compile_prepend() {
+	${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py docstrings
+}
+
+do_install_append() {
+	rm -rf ${D}${datadir}/share
+}
diff --git a/meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch b/meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch
new file mode 100644
index 0000000..c259112
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygobject/obsolete_automake_macros.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Accepted [https://bugzilla.gnome.org/show_bug.cgi?id=691101]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd pygobject-2.27.91/configure.ac pygobject-2.27.91/configure.ac
+--- pygobject-2.27.91/configure.ac	2011-02-23 22:14:37.000000000 +0200
++++ pygobject-2.27.91/configure.ac	2013-01-03 05:13:44.034949954 +0200
+@@ -35,7 +35,7 @@
+ AC_DEFINE(PYGOBJECT_MICRO_VERSION, pygobject_micro_version, [pygobject micro version])
+ AC_SUBST(PYGOBJECT_MICRO_VERSION, pygobject_micro_version)
+
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES(yes)])
+ AM_INIT_AUTOMAKE(foreign)
+ AM_MAINTAINER_MODE
+@@ -82,7 +82,6 @@
+ m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
+ AC_ISC_POSIX
+ AC_PROG_CC
+-AM_PROG_CC_STDC
+ AM_PROG_CC_C_O
+
+ # check that we have the minimum version of python necisary to build
diff --git a/meta/recipes-devtools/python/python-pygobject_2.28.3.bb b/meta/recipes-devtools/python/python-pygobject_2.28.3.bb
new file mode 100644
index 0000000..81d37b4
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygobject_2.28.3.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Python GObject bindings"
+SECTION = "devel/python"
+LICENSE = "LGPLv2.1"
+
+RECIPE_NO_UPDATE_REASON = "Newer versions of python-pygobject depend on gobject-introspection which doesn't cross-compile"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
+DEPENDS = "python python-pygobject-native libffi glib-2.0"
+DEPENDS_class-native = "python-native libffi-native glib-2.0-native"
+RDEPENDS_class-native = ""
+
+MAJ_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+
+SRC_URI = "${GNOME_MIRROR}/pygobject/${MAJ_VER}/pygobject-${PV}.tar.bz2 \
+           file://obsolete_automake_macros.patch \
+"
+
+# libtool-native doesn't have fixinstall.patch applied which means
+# that libs get relinked at installation time. This triggers a 
+# relinking along the lines of:
+# gcc -L/tmp/foo/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/lib -lpyglib-2.0-python -o .libs/_glib.so
+# where /tmp/foo is DESTDIR and pyglib-2.0-python may be installed/reinstalled
+# at the same time as the gcc command runs.
+# If this happens between the handoff between gcc and ld, you can see:
+# /bin/ld: cannot find -lpyglib-2.0-python
+# Adding a dependency rule like  install-pyglibLTLIBRARIES: install-libLTLIBRARIES
+# would be ideal but automake can't cope with that without manually 
+# defining the whole function. Give up and disable parallel make in native builds.
+PARALLEL_MAKEINST_class-native = ""
+
+SRC_URI[md5sum] = "aa64900b274c4661a5c32e52922977f9"
+SRC_URI[sha256sum] = "7da88c169a56efccc516cebd9237da3fe518a343095a664607b368fe21df95b6"
+S = "${WORKDIR}/pygobject-${PV}"
+
+EXTRA_OECONF += "--disable-introspection"
+
+inherit autotools distutils-base pkgconfig
+
+# necessary to let the call for python-config succeed
+export BUILD_SYS
+export HOST_SYS
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+PACKAGES += "${PN}-lib"
+
+RDEPENDS_${PN} += "python-textutils"
+
+FILES_${PN} = "${libdir}/python*"
+FILES_${PN}-lib = "${libdir}/lib*.so.*"
+FILES_${PN}-dev += "${bindir} ${datadir}"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/python/python-pygtk/acinclude.m4 b/meta/recipes-devtools/python/python-pygtk/acinclude.m4
new file mode 100644
index 0000000..53518fb
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk/acinclude.m4
@@ -0,0 +1,90 @@
+## this one is commonly used with AM_PATH_PYTHONDIR ...
+dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Check if a module containing a given symbol is visible to python.
+AC_DEFUN(AM_CHECK_PYMOD,
+[AC_REQUIRE([AM_PATH_PYTHON])
+py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
+AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
+ifelse([$2],[], [prog="
+import sys
+try:
+        import $1
+except ImportError:
+        sys.exit(1)
+except:
+        sys.exit(0)
+sys.exit(0)"], [prog="
+import $1
+$1.$2"])
+if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
+  then
+    eval "py_cv_mod_$py_mod_var=yes"
+  else
+    eval "py_cv_mod_$py_mod_var=no"
+  fi
+])
+py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
+if test "x$py_val" != xno; then
+  AC_MSG_RESULT(yes)
+  ifelse([$3], [],, [$3
+])dnl
+else
+  AC_MSG_RESULT(no)
+  ifelse([$4], [],, [$4
+])dnl
+fi
+])
+
+dnl a macro to check for ability to create python extensions
+dnl  AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
+dnl function also defines PYTHON_INCLUDES
+AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING(for headers required to compile python extensions)
+dnl deduce PYTHON_INCLUDES
+AC_ARG_WITH(python-includes,
+	[  --with-python-includes=DIR  path to Python includes], py_exec_prefix=$withval)
+if test x$py_exec_prefix != x; then
+PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+else
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])
+
+dnl
+dnl JH_ADD_CFLAG(FLAG)
+dnl checks whether the C compiler supports the given flag, and if so, adds
+dnl it to $CFLAGS.  If the flag is already present in the list, then the
+dnl check is not performed.
+AC_DEFUN([JH_ADD_CFLAG],
+[
+case " $CFLAGS " in
+*@<:@\	\ @:>@$1@<:@\	\ @:>@*)
+  ;;
+*)
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS $1"
+  AC_MSG_CHECKING([whether [$]CC understands $1])
+  AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no])
+  AC_MSG_RESULT($jh_has_option)
+  if test $jh_has_option = no; then
+    CFLAGS="$save_CFLAGS"
+  fi
+  ;;
+esac])
diff --git a/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch b/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch
new file mode 100644
index 0000000..df0f9cd
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk/add-gtk-types.defs-into-gdk.c-dependence.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Submitted
+
+add gtk-types.defs into gdk.c dependence
+
+gdk.c depends on gtk-types.defs but
+gdk/Makefile.am miss this. This will cause
+build error sometimes when built
+with multi-jobbing, so add gtk-types.defs into
+gdk.c dependence.
+
+Signed-off-by: Song.Li <Song.Li@windriver.com>
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ gtk/Makefile.am |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/gtk/Makefile.am b/gtk/Makefile.am
+index 7bb5d0c..4a88351 100644
+--- a/gtk/Makefile.am
++++ b/gtk/Makefile.am
+@@ -214,7 +214,7 @@ gtkunixprint.defs: $(GTKUNIXPRINT_DEFS) Makefile
+ gtkunixprint-types.defs: $(GTKUNIXPRINT_TYPES_DEFS) Makefile
+ 	$(CREATEDEFS) $@ $(GTKUNIXPRINT_TYPES_DEFS)
+ 
+-gdk.c: gdk-types.defs gdk.defs $(GDK_OVERRIDES)
++gdk.c: gdk-types.defs gtk-types.defs gdk.defs $(GDK_OVERRIDES)
+ gtk.c: gdk-types.defs gtk-types.defs gtk.defs gdk-types.defs $(GTK_OVERRIDES)
+ _gtk_la_CFLAGS = $(PYCAIRO_CFLAGS) $(GTK_CFLAGS)
+ _gtk_la_LDFLAGS = $(common_ldflags) -export-symbols-regex init_gtk
+-- 
+1.7.4
+
diff --git a/meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch b/meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch
new file mode 100644
index 0000000..16c0e8e
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk/fix-gtkunixprint.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: pygtk-2.24.0/gtk/gtkunixprint.override
+===================================================================
+--- pygtk-2.24.0.orig/gtk/gtkunixprint.override
++++ pygtk-2.24.0/gtk/gtkunixprint.override
+@@ -102,11 +102,6 @@ _wrap_gtk_print_job_get_surface(PyGObjec
+     if (pyg_error_check(&error))
+         return NULL;
+ 
+-#if PYCAIRO_VERSION_HEX >= 0x1010600
+-    return PycairoSurface_FromSurface(cairo_surface_reference(surface), NULL);
+-#else
+-    return PycairoSurface_FromSurface(cairo_surface_reference(surface), NULL, NULL);
+-#endif
+ }
+ %%
+ override gtk_print_job_send kwargs
diff --git a/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch b/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch
new file mode 100644
index 0000000..b615654
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk/fix-pygtk-2.0.pc.patch
@@ -0,0 +1,13 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: pygtk-2.24.0/pygtk-2.0.pc.in
+===================================================================
+--- pygtk-2.24.0.orig/pygtk-2.0.pc.in
++++ pygtk-2.24.0/pygtk-2.0.pc.in
+@@ -1,5 +1,6 @@
+ prefix=@prefix@
+ exec_prefix=@exec_prefix@
++libdir=@libdir@
+ includedir=@includedir@
+ datarootdir=@datarootdir@
+ datadir=@datadir@
diff --git a/meta/recipes-devtools/python/python-pygtk/nodocs.patch b/meta/recipes-devtools/python/python-pygtk/nodocs.patch
new file mode 100644
index 0000000..f07309a
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk/nodocs.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: pygtk-2.17.0/Makefile.am
+===================================================================
+--- pygtk-2.17.0.orig/Makefile.am
++++ pygtk-2.17.0/Makefile.am
+@@ -4,7 +4,7 @@ if BUILD_GTK
+   GTK_SUBDIR = gtk
+ endif
+ 
+-SUBDIRS = . $(GTK_SUBDIR) examples tests docs
++SUBDIRS = . $(GTK_SUBDIR) examples tests
+ 
+ PLATFORM_VERSION = 2.0
+ 
diff --git a/meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch b/meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch
new file mode 100644
index 0000000..833038e
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk/prevent_to_get_display_during_import.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Index: pygtk-2.10.4/gtk/__init__.py
+===================================================================
+--- pygtk-2.10.4.orig/gtk/__init__.py	2007-11-27 19:27:05.000000000 -0300
++++ pygtk-2.10.4/gtk/__init__.py	2007-11-27 19:28:22.000000000 -0300
+@@ -78,7 +78,8 @@
+ 
+ keysyms = LazyModule('keysyms', locals())
+ 
+-_init()
++if not hasattr(sys.modules['__main__'], 'python_launcher_enabled'):
++    _init()
+ 
+ # CAPI
+ _PyGtk_API = _gtk._PyGtk_API
diff --git a/meta/recipes-devtools/python/python-pygtk/python-pygtk2/acinclude.m4 b/meta/recipes-devtools/python/python-pygtk/python-pygtk2/acinclude.m4
new file mode 100644
index 0000000..53518fb
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk/python-pygtk2/acinclude.m4
@@ -0,0 +1,90 @@
+## this one is commonly used with AM_PATH_PYTHONDIR ...
+dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]])
+dnl Check if a module containing a given symbol is visible to python.
+AC_DEFUN(AM_CHECK_PYMOD,
+[AC_REQUIRE([AM_PATH_PYTHON])
+py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1)
+AC_CACHE_VAL(py_cv_mod_$py_mod_var, [
+ifelse([$2],[], [prog="
+import sys
+try:
+        import $1
+except ImportError:
+        sys.exit(1)
+except:
+        sys.exit(0)
+sys.exit(0)"], [prog="
+import $1
+$1.$2"])
+if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC
+  then
+    eval "py_cv_mod_$py_mod_var=yes"
+  else
+    eval "py_cv_mod_$py_mod_var=no"
+  fi
+])
+py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"`
+if test "x$py_val" != xno; then
+  AC_MSG_RESULT(yes)
+  ifelse([$3], [],, [$3
+])dnl
+else
+  AC_MSG_RESULT(no)
+  ifelse([$4], [],, [$4
+])dnl
+fi
+])
+
+dnl a macro to check for ability to create python extensions
+dnl  AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE])
+dnl function also defines PYTHON_INCLUDES
+AC_DEFUN([AM_CHECK_PYTHON_HEADERS],
+[AC_REQUIRE([AM_PATH_PYTHON])
+AC_MSG_CHECKING(for headers required to compile python extensions)
+dnl deduce PYTHON_INCLUDES
+AC_ARG_WITH(python-includes,
+	[  --with-python-includes=DIR  path to Python includes], py_exec_prefix=$withval)
+if test x$py_exec_prefix != x; then
+PYTHON_INCLUDES="-I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+else
+py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
+PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+if test "$py_prefix" != "$py_exec_prefix"; then
+  PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+fi
+fi
+AC_SUBST(PYTHON_INCLUDES)
+dnl check if the headers exist:
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+AC_TRY_CPP([#include <Python.h>],dnl
+[AC_MSG_RESULT(found)
+$1],dnl
+[AC_MSG_RESULT(not found)
+$2])
+CPPFLAGS="$save_CPPFLAGS"
+])
+
+dnl
+dnl JH_ADD_CFLAG(FLAG)
+dnl checks whether the C compiler supports the given flag, and if so, adds
+dnl it to $CFLAGS.  If the flag is already present in the list, then the
+dnl check is not performed.
+AC_DEFUN([JH_ADD_CFLAG],
+[
+case " $CFLAGS " in
+*@<:@\	\ @:>@$1@<:@\	\ @:>@*)
+  ;;
+*)
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS $1"
+  AC_MSG_CHECKING([whether [$]CC understands $1])
+  AC_TRY_COMPILE([], [], [jh_has_option=yes], [jh_has_option=no])
+  AC_MSG_RESULT($jh_has_option)
+  if test $jh_has_option = no; then
+    CFLAGS="$save_CFLAGS"
+  fi
+  ;;
+esac])
diff --git a/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch b/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch
new file mode 100644
index 0000000..3ed954e
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk/update-dependences-of-defs.c.patch
@@ -0,0 +1,38 @@
+From dc024e9079bbffbb44436ba3e70a758ebad5520f Mon Sep 17 00:00:00 2001
+From: "Song.Li" <Song.Li@windriver.com>
+Date: Sat, 5 Jan 2013 14:55:59 +0800
+Subject: [PATCH] update dependences of defs.c in Makefile.am
+
+In gtk/Makefile.am, defs.c should dependes on gdk-types.defs and
+gtk-types.defs, otherwise it fails occasionally when parallel compile.
+The error message:
+"IOError: [Errno 2] No such file or directory: 'gtk-types.defs'"
+
+Add them to dependences of defs.c to fix this issue.
+
+Upstream-Status: Submitted
+https://bugzilla.gnome.org/show_bug.cgi?id=702706
+
+Signed-off-by: Song.Li <Song.Li@windriver.com>
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ gtk/Makefile.am |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gtk/Makefile.am b/gtk/Makefile.am
+index 7bb5d0c..91826cb 100644
+--- a/gtk/Makefile.am
++++ b/gtk/Makefile.am
+@@ -289,7 +289,7 @@ if HAVE_GIO_TYPES_DEFS
+ extra_codegen_args += --register $(PYGOBJECT_DEFSDIR)/gio-types.defs
+ endif
+ 
+-.defs.c: 
++.defs.c: gdk-types.defs gtk-types.defs
+ 	($(PYTHON) $(CODEGENDIR)/codegen.py \
+ 	   $(PYGTK_CODEGEN_DEFINES) \
+ 	    -I $(srcdir) \
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/python/python-pygtk_2.24.0.bb b/meta/recipes-devtools/python/python-pygtk_2.24.0.bb
new file mode 100644
index 0000000..e4c33a8
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pygtk_2.24.0.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Python bindings for the GTK+ UI toolkit"
+SECTION = "devel/python"
+# needs gtk+ 2.17.x
+DEPENDS = "gtk+ libglade python-pycairo python-pygobject"
+RDEPENDS_${PN} = "python-shell python-pycairo python-pygobject"
+PROVIDES = "python-pygtk2"
+SRCNAME = "pygtk"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
+
+PR = "r1"
+
+SRC_URI = "ftp://ftp.gnome.org/pub/gnome/sources/pygtk/2.24/${SRCNAME}-${PV}.tar.bz2 \
+           file://add-gtk-types.defs-into-gdk.c-dependence.patch \
+           file://fix-gtkunixprint.patch \
+           file://prevent_to_get_display_during_import.patch \
+           file://nodocs.patch \
+	   file://fix-pygtk-2.0.pc.patch \
+           file://acinclude.m4 \
+           file://update-dependences-of-defs.c.patch"
+
+SRC_URI[md5sum] = "a1051d5794fd7696d3c1af6422d17a49"
+SRC_URI[sha256sum] = "cd1c1ea265bd63ff669e92a2d3c2a88eb26bcd9e5363e0f82c896e649f206912"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+EXTRA_OECONF = "--disable-docs --with-python-includes=${STAGING_INCDIR}/../"
+
+inherit autotools pkgconfig distutils-base
+
+do_configure_prepend() {
+	install -m 0644 ${WORKDIR}/acinclude.m4 ${S}/
+	sed -i \
+		-e s:'`$PKG_CONFIG --variable defsdir pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/2.0/defs\":g \
+		-e s:'`$PKG_CONFIG --variable=pygtkincludedir pygobject-2.0`':\"${STAGING_INCDIR}/pygtk-2.0\":g \
+		-e s:'`$PKG_CONFIG --variable=datadir pygobject-2.0`':\"${STAGING_DATADIR}\":g \
+		-e s:'`$PKG_CONFIG --variable codegendir pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/2.0/codegen\":g \
+		-e s:'`$PKG_CONFIG --variable=fixxref pygobject-2.0`':\"${STAGING_DATADIR}/pygobject/xsl/fixxref.py\":g \
+		${S}/configure.ac
+}
+
+# dirty fix #2: fix build system paths leaking in
+do_install_append() {
+	sed -i -e '1s|^#!.*python|#!/usr/bin/env python|' ${D}${bindir}/pygtk-demo
+}
+
+PACKAGES =+ "${PN}-demo"
+FILES_${PN}-demo = " ${bindir}/pygtk-demo ${libdir}/pygtk "
+RDEPENDS_${PN}-demo = "python-pygtk python-stringold python-lang"
+
+# todo: revamp packaging, package demo seperatly
+FILES_${PN}-dev += " ${libdir}/pygtk/2.0 ${bindir}/pygtk-* ${datadir}/pygtk/2.0"
+
diff --git a/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb b/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb
new file mode 100644
index 0000000..e8ef1aa
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pyrex-native_0.9.9.bb
@@ -0,0 +1,5 @@
+require python-pyrex_${PV}.bb
+inherit native pythonnative
+DEPENDS = "python-native"
+RDEPENDS_${PN} = ""
+PR = "r3"
diff --git a/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch b/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch
new file mode 100644
index 0000000..c58c328
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pyrex/pyrex-fix-optimized-mode.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: Pyrex-0.9.8.4/Pyrex/Distutils/extension.py
+===================================================================
+--- Pyrex-0.9.8.4.orig/Pyrex/Distutils/extension.py
++++ Pyrex-0.9.8.4/Pyrex/Distutils/extension.py
+@@ -15,7 +15,7 @@ except ImportError:
+     warnings = None
+ 
+ class Extension(_Extension.Extension):
+-    _Extension.Extension.__doc__ + \
++    _Extension.Extension.__doc__ or "" + \
+     """pyrex_include_dirs : [string]
+         list of directories to search for Pyrex header files (.pxd) (in
+         Unix form for portability)
diff --git a/meta/recipes-devtools/python/python-pyrex_0.9.9.bb b/meta/recipes-devtools/python/python-pyrex_0.9.9.bb
new file mode 100644
index 0000000..c4dd2e6
--- /dev/null
+++ b/meta/recipes-devtools/python/python-pyrex_0.9.9.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Language for writing Python extension modules"
+DESCRIPTION = "Pyrex is a language specially designed for writing Python extension modules. \
+It's designed to bridge the gap between the nice, high-level, easy-to-use world of Python \
+and the messy, low-level world of C."
+SECTION = "devel/python"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=771d472f53f933033f57eeee7808e5bd"
+SRCNAME = "Pyrex"
+PR = "r4"
+
+SRC_URI = "\
+  http://www.cosc.canterbury.ac.nz/greg.ewing/python/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
+  file://pyrex-fix-optimized-mode.patch \
+"
+
+SRC_URI[md5sum] = "515dee67d15d4393841e2d60e8341947"
+SRC_URI[sha256sum] = "5f87df06831d0b3412eb4bc9d3fc2ee7bfae1b913d7da8c23ab2bf5699fb6b50"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+FILES_${PN} += "${datadir}${base_libdir}/${PYTHON_DIR}/site-packages/Pyrex/Compiler/Lexicon.pickle"
diff --git a/meta/recipes-devtools/python/python-scons-native_2.3.6.bb b/meta/recipes-devtools/python/python-scons-native_2.3.6.bb
new file mode 100644
index 0000000..dae89ab
--- /dev/null
+++ b/meta/recipes-devtools/python/python-scons-native_2.3.6.bb
@@ -0,0 +1,8 @@
+require python-scons_${PV}.bb
+inherit native pythonnative
+DEPENDS = "python-native"
+RDEPENDS_${PN} = ""
+
+do_install_append() {
+    create_wrapper ${D}${bindir}/scons SCONS_LIB_DIR='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}'
+}
diff --git a/meta/recipes-devtools/python/python-scons_2.3.6.bb b/meta/recipes-devtools/python/python-scons_2.3.6.bb
new file mode 100644
index 0000000..c4ad7d3
--- /dev/null
+++ b/meta/recipes-devtools/python/python-scons_2.3.6.bb
@@ -0,0 +1,14 @@
+SUMMARY = "Software Construction tool (make/autotools replacement)"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=23bc1530c55e9f0d1b709056bcea237d"
+SRCNAME = "scons"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/scons/scons-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "9c6a1c3c716cbe5f16515f163c91d928"
+SRC_URI[sha256sum] = "98adaa351d8f4e4068a5bf1894bdd7f85b390c8c3f80d437cf8bb266012404df"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
diff --git a/meta/recipes-devtools/python/python-setuptools_18.2.bb b/meta/recipes-devtools/python/python-setuptools_18.2.bb
new file mode 100644
index 0000000..1de2b2e
--- /dev/null
+++ b/meta/recipes-devtools/python/python-setuptools_18.2.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Downloads, builds, installs, upgrades, and uninstalls Python packages"
+HOMEPAGE = "https://pypi.python.org/pypi/setuptools"
+SECTION = "devel/python"
+LICENSE = "Python-2.0 | ZPL-2.0"
+LIC_FILES_CHKSUM = "file://setup.py;beginline=78;endline=78;md5=8a314270dd7a8dbca741775415f1716e"
+
+SRCNAME = "setuptools"
+
+PROVIDES = "python-distribute"
+
+DEPENDS += "python"
+DEPENDS_class-native += "python-native"
+
+inherit distutils
+
+SRC_URI = "https://pypi.python.org/packages/source/s/setuptools/setuptools-${PV}.tar.gz"
+SRC_URI[md5sum] = "52b4e48939ef311d7204f8fe940764f4"
+SRC_URI[sha256sum] = "0994a58df27ea5dc523782a601357a2198b7493dcc99a30d51827a23585b5b1d"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+
+do_install_prepend() {
+    install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
+}
+
+RDEPENDS_${PN} = "\
+  python-stringold \
+  python-email \
+  python-shell \
+  python-distutils \
+  python-compression \
+"
+
+RDEPENDS_${PN}_class-native = "\
+  python-distutils \
+  python-compression \
+"
+
+RREPLACES_${PN} = "python-distribute"
+RPROVIDES_${PN} = "python-distribute"
+RCONFLICTS_${PN} = "python-distribute"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch b/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch
new file mode 100644
index 0000000..8a27f25
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-add-for-rpm-ignoresize-check.patch
@@ -0,0 +1,37 @@
+python-smartpm: Add checking for "rpm-ignoresize" option
+
+The do_rootfs takes a very long time when build host has mounted many NFS
+devices. syscall lstat() was being called on every filesystem mounted on the
+build host during building.
+The reason for the lstat() is that rpm is verifying that enough free disk space
+is available to do the install. However, since the install is into the target
+rootfs it should not matter how much free space there is in the host mounts.
+Add checking for "rpm-ignoresize", by it, smart can make whether RPM skip
+checking for diskspace when install a rpm package.
+
+Upstream-Status: Pending
+
+Signed-off-by: wenlin.kang <wenlin.kang@windriver.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ smart/backends/rpm/pm.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py
+index 5da9ee6..f0488ec 100644
+--- a/smart/backends/rpm/pm.py
++++ b/smart/backends/rpm/pm.py
+@@ -241,6 +241,10 @@ class RPMPackageManager(PackageManager):
+         except AttributeError:
+             probfilter |= rpm.RPMPROB_FILTER_IGNOREARCH
+ 
++        if sysconf.get("rpm-ignoresize", False):
++            probfilter |= rpm.RPMPROB_FILTER_DISKNODES
++            probfilter |= rpm.RPMPROB_FILTER_DISKSPACE
++
+         if force or reinstall:
+             probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG
+             probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch b/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch
new file mode 100644
index 0000000..9055555
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-already-installed-message.patch
@@ -0,0 +1,54 @@
+From a74a9a9eb9d75964a0e978950e8b191d7a18d763 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Fri, 5 Jun 2015 17:07:16 +0100
+Subject: [PATCH] smart: change "is already installed" message from warning to
+ info
+
+This doesn't need to be a warning.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ smart/commands/install.py            | 4 ++--
+ smart/interfaces/text/interactive.py | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/smart/commands/install.py b/smart/commands/install.py
+index 6ef9682..80d456b 100644
+--- a/smart/commands/install.py
++++ b/smart/commands/install.py
+@@ -152,7 +152,7 @@ def main(ctrl, opts):
+             for obj in results:
+                 for pkg in obj.packages:
+                     if pkg.installed:
+-                        iface.warning(_("%s (for %s) is already installed")
++                        iface.info(_("%s (for %s) is already installed")
+                                       % (pkg, arg))
+                         installed = True
+                         break
+@@ -184,7 +184,7 @@ def main(ctrl, opts):
+         for name in names:
+             pkg = names[name][0]
+             if pkg.installed:
+-                iface.warning(_("%s is already installed") % pkg)
++                iface.info(_("%s is already installed") % pkg)
+             else:
+                 trans.enqueue(pkg, INSTALL)
+ 
+diff --git a/smart/interfaces/text/interactive.py b/smart/interfaces/text/interactive.py
+index 9865584..190867b 100644
+--- a/smart/interfaces/text/interactive.py
++++ b/smart/interfaces/text/interactive.py
+@@ -278,7 +278,7 @@ class Interpreter(Cmd):
+             for name in names:
+                 pkg = names[name][0]
+                 if pkg.installed:
+-                    iface.warning(_("%s is already installed") % pkg)
++                    iface.info(_("%s is already installed") % pkg)
+                 else:
+                     found = True
+                     transaction.enqueue(pkg, INSTALL)
+-- 
+2.1.0
+
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch b/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch
new file mode 100644
index 0000000..6e672b3
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-attempt-fix.patch
@@ -0,0 +1,158 @@
+Sadly, smart is not deterministic so the same build can go down multiple different
+pathways. We'd expect to see the same warnings however depending on the pathway
+taken, it may or may not warn, particularly with Recommends since they're optional.
+
+For example, where a Recommended package is available but has Conflicts, we'd expect
+to see an warning that we couldn't install it. Some code paths silently hide this
+(its a LOCKED_CONFLICT). We add printing of warnings for this case.
+
+Also, if there are two compatible feeds available (e.g. i586 and core2_32), this 
+changes the code path from direct _install() to _pending() since there are multiple
+providers. This patch adds warning handling to _pending() so we don't hit hard 
+failures there. This is as seen with the mysterious libspeexdsp failures for x86-lsb
+on the autobuilder.
+
+Upstream-Status: Pending
+RP
+2015/7/16
+
+Index: git/smart/transaction.py
+===================================================================
+--- git.orig/smart/transaction.py
++++ git/smart/transaction.py
+@@ -651,13 +651,14 @@ class Transaction(object):
+ 
+             if not prvpkgs:
+                 # No packages provide it at all. Give up.
++
++                reasons = []
++                for prv in req.providedby:
++                    for prvpkg in prv.packages:
++                        lockedres = lockedpkgs.get(prvpkg, None)
++                        if lockedres:
++                            reasons.append(lock_reason(prvpkg, lockedres))
+                 if reqrequired:
+-                    reasons = []
+-                    for prv in req.providedby:
+-                        for prvpkg in prv.packages:
+-                            lockedres = lockedpkgs.get(prvpkg, None)
+-                            if lockedres:
+-                                reasons.append(lock_reason(prvpkg, lockedres))
+                     if reasons:
+                         raise Failed, _("Can't install %s: unable to install provider for %s:\n    %s") % \
+                                 (pkg, req, '\n    '.join(reasons))
+@@ -665,7 +666,11 @@ class Transaction(object):
+                         raise Failed, _("Can't install %s: no package provides %s") % \
+                                 (pkg, req)
+                 else:
++                    if reasons:
++                        iface.warning(_("Can't install %s: unable to install provider for %s:\n    %s") % \
++                                (pkg, req, '\n    '.join(reasons)))
++
+                     # It's only a recommend, skip
+                     continue
+ 
+             if len(prvpkgs) == 1:
+@@ -846,6 +852,14 @@ class Transaction(object):
+         isinst = changeset.installed
+         getweight = self._policy.getWeight
+ 
++        attempt = sysconf.has("attempt-install", soft=True)
++
++        def handle_failure(msg):
++            if attempt:
++                iface.warning(msg)
++            else:
++                raise Failed, msg
++
+         updown = []
+         while pending:
+             item = pending.pop(0)
+@@ -870,8 +884,9 @@ class Transaction(object):
+ 
+                 if not prvpkgs:
+                     # No packages provide it at all. Give up.
+-                    raise Failed, _("Can't install %s: no package "
+-                                    "provides %s") % (pkg, req)
++                    handle_failure(_("Can't install %s: no package "
++                                    "provides %s") % (pkg, req))
++                    continue
+ 
+                 if len(prvpkgs) > 1:
+                     # More than one package provide it. We use _pending here,
+@@ -894,9 +909,10 @@ class Transaction(object):
+                                                  keeporder, cs, lk))
+                             keeporder += 0.000001
+                     if not alternatives:
+-                        raise Failed, _("Can't install %s: all packages "
++                        handle_failure(_("Can't install %s: all packages "
+                                         "providing %s failed to install:\n%s")\
+-                                      % (pkg, req,  "\n".join(failures))
++                                      % (pkg, req,  "\n".join(failures)))
++                        continue
+                     alternatives.sort()
+                     changeset.setState(alternatives[0][1])
+                     if len(alternatives) == 1:
+@@ -954,18 +970,20 @@ class Transaction(object):
+ 
+                     for reqpkg in reqpkgs:
+                         if reqpkg in locked and isinst(reqpkg):
+-                            raise Failed, _("Can't remove %s: requiring "
++                            handle_failure(_("Can't remove %s: requiring "
+                                             "package %s is locked") % \
+-                                          (pkg, reqpkg)
++                                          (pkg, reqpkg))
++                            continue
+                     for reqpkg in reqpkgs:
+                         # We check again, since other actions may have
+                         # changed their state.
+                         if not isinst(reqpkg):
+                             continue
+                         if reqpkg in locked:
+-                            raise Failed, _("Can't remove %s: requiring "
++                            handle_failure(_("Can't remove %s: requiring "
+                                             "package %s is locked") % \
+-                                          (pkg, reqpkg)
++                                          (pkg, reqpkg))
++                            continue
+                         self._remove(reqpkg, changeset, locked,
+                                      pending, depth)
+                     continue
+@@ -978,12 +996,14 @@ class Transaction(object):
+                 try:
+                     for reqpkg in reqpkgs:
+                         if reqpkg in locked and isinst(reqpkg):
+-                            raise Failed, _("%s is locked") % reqpkg
++                            handle_failure(_("%s is locked") % reqpkg)
++                            continue
+                     for reqpkg in reqpkgs:
+                         if not cs.installed(reqpkg):
+                             continue
+                         if reqpkg in lk:
+-                            raise Failed, _("%s is locked") % reqpkg
++                            handle_failure(_("%s is locked") % reqpkg)
++                            continue
+                         self._remove(reqpkg, cs, lk, None, depth)
+                 except Failed, e:
+                     failures.append(unicode(e))
+@@ -991,9 +1011,10 @@ class Transaction(object):
+                     alternatives.append((getweight(cs), cs, lk))
+ 
+                 if not alternatives:
+-                    raise Failed, _("Can't install %s: all packages providing "
++                    handle_failure(_("Can't install %s: all packages providing "
+                                     "%s failed to install:\n%s") \
+-                                  % (pkg, prv,  "\n".join(failures))
++                                  % (pkg, prv,  "\n".join(failures)))
++                    continue
+ 
+                 alternatives.sort()
+                 changeset.setState(alternatives[0][1])
+@@ -1246,6 +1267,7 @@ class Transaction(object):
+                             changeset.setRequested(pkg, True)
+                     except Failed, e:
+                         if sysconf.has("attempt-install", soft=True):
++                            iface.warning(_("Can't install %s: %s") % (pkg, str(e)))
+                             if pkg in changeset:
+                                 del changeset[pkg]
+                             continue
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
new file mode 100644
index 0000000..ec98e03
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-attempt.patch
@@ -0,0 +1,177 @@
+From b105e7fe812da3ccaf7155c0fe14c8728b0d39a5 Mon Sep 17 00:00:00 2001
+From: Mark Hatle <mark.hatle@windriver.com>
+Date: Mon, 20 Jan 2014 14:30:52 +0000
+Subject: [PATCH] Add mechanism to attempt install without failing
+
+In OpenEmbedded, for complementary and 'attemptonly' package processing,
+we need a way to instruct smart to try to install, but ignore any
+failures (usually conflicts).
+
+This option only works for the install operation.
+
+If a complementary install fails, an actual error occurred, one that
+we can't ignore without losing the entire attempted transaction.  Keep
+this as an error so that we can catch these cases in the futre.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ backends/rpm/pm.py |   35 ++++++++++++++++++++++++++++++++++-
+ transaction.py     |   50 +++++++++++++++++++++++++++++++++++++-------------
+ 2 files changed, 71 insertions(+), 14 deletions(-)
+
+diff --git a/smart/backends/rpm/pm.py b/smart/backends/rpm/pm.py
+index 9bbd952..ba6405a 100644
+--- a/smart/backends/rpm/pm.py
++++ b/smart/backends/rpm/pm.py
+@@ -241,15 +241,48 @@ class RPMPackageManager(PackageManager):
+         cb = RPMCallback(prog, upgradednames)
+         cb.grabOutput(True)
+         probs = None
++        retry = 0
+         try:
+             probs = ts.run(cb, None)
+         finally:
+             del getTS.ts
+             cb.grabOutput(False)
++            if probs and sysconf.has("attempt-install", soft=True):
++                def remove_conflict(pkgNEVR):
++                    for key in changeset.keys():
++                        if pkgNEVR == str(key):
++                            del changeset[key]
++                            del pkgpaths[key]
++                            iface.warning("Removing %s due to file %s conflicting with %s" % (pkgNEVR, fname, altNEVR))
++                            break
++
++                retry = 1
++                for prob in probs:
++                    if prob[1][0] == rpm.RPMPROB_NEW_FILE_CONFLICT:
++                        msg = prob[0].split()
++                        fname = msg[1]
++                        pkgNEVR = msg[7]
++                        altNEVR = msg[9]
++                        pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1]
++                        altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1]
++                        remove_conflict(pkgNEVR)
++                    elif prob[1][0] == rpm.RPMPROB_FILE_CONFLICT:
++                        msg = prob[0].split()
++                        fname = msg[1]
++                        pkgNEVR = msg[5]
++                        altNEVR = msg[11]
++                        pkgNEVR = pkgNEVR.rsplit('.', 1)[0] + '@' + pkgNEVR.rsplit('.', 1)[1]
++                        altNEVR = altNEVR.rsplit('.', 1)[0] + '@' + altNEVR.rsplit('.', 1)[1]
++                        remove_conflict(pkgNEVR)
++                    else:
++                        retry = 0
++
+             prog.setDone()
+-            if probs:
++            if probs and (not retry):
+                 raise Error, "\n".join([x[0] for x in probs])
+             prog.stop()
++            if retry and len(changeset):
++                self.commit(changeset, pkgpaths)
+ 
+ class RPMCallback:
+     def __init__(self, prog, upgradednames):
+diff --git a/smart/transaction.py b/smart/transaction.py
+index 4b90cb7..3e043e9 100644
+--- a/smart/transaction.py
++++ b/smart/transaction.py
+@@ -555,6 +555,8 @@ class Transaction(object):
+         changeset.set(pkg, INSTALL)
+         isinst = changeset.installed
+ 
++        attempt = sysconf.has("attempt-install", soft=True)
++
+         # Remove packages conflicted by this one.
+         for cnf in pkg.conflicts:
+             for prv in cnf.providedby:
+@@ -564,11 +566,16 @@ class Transaction(object):
+                     if not isinst(prvpkg):
+                         locked[prvpkg] = (LOCKED_CONFLICT_BY, pkg)
+                         continue
+-                    if prvpkg in locked:
+-                        raise Failed, _("Can't install %s: conflicted package "
+-                                        "%s is locked") % (pkg, prvpkg)
+-                    self._remove(prvpkg, changeset, locked, pending, depth)
+-                    pending.append((PENDING_UPDOWN, prvpkg))
++                    if attempt:
++                        del changeset[pkg]
++                        raise Failed, _("Can't install %s: it conflicts with package "
++                                        "%s") % (pkg, prvpkg)
++                    else:
++                        if prvpkg in locked:
++                            raise Failed, _("Can't install %s: conflicted package "
++                                            "%s is locked") % (pkg, prvpkg)
++                        self._remove(prvpkg, changeset, locked, pending, depth)
++                        pending.append((PENDING_UPDOWN, prvpkg))
+ 
+         # Remove packages conflicting with this one.
+         for prv in pkg.provides:
+@@ -579,12 +586,18 @@ class Transaction(object):
+                     if not isinst(cnfpkg):
+                         locked[cnfpkg] = (LOCKED_CONFLICT, pkg)
+                         continue
+-                    if cnfpkg in locked:
++                    if attempt:
++                        del changeset[pkg]
+                         raise Failed, _("Can't install %s: it's conflicted by "
+-                                        "the locked package %s") \
+-                                      % (pkg, cnfpkg)
+-                    self._remove(cnfpkg, changeset, locked, pending, depth)
+-                    pending.append((PENDING_UPDOWN, cnfpkg))
++                                        "the package %s") \
++                                    % (pkg, cnfpkg)
++                    else:
++                        if cnfpkg in locked:
++                            raise Failed, _("Can't install %s: it's conflicted by "
++                                            "the locked package %s") \
++                                        % (pkg, cnfpkg)
++                        self._remove(cnfpkg, changeset, locked, pending, depth)
++                        pending.append((PENDING_UPDOWN, cnfpkg))
+ 
+         # Remove packages with the same name that can't
+         # coexist with this one.
+@@ -594,10 +607,15 @@ class Transaction(object):
+                 if not isinst(namepkg):
+                     locked[namepkg] = (LOCKED_NO_COEXIST, pkg)
+                     continue
+-                if namepkg in locked:
++                if attempt:
++                    del changeset[pkg]
+                     raise Failed, _("Can't install %s: it can't coexist "
+                                     "with %s") % (pkg, namepkg)
+-                self._remove(namepkg, changeset, locked, pending, depth)
++                else:
++                    if namepkg in locked:
++                        raise Failed, _("Can't install %s: it can't coexist "
++                                        "with %s") % (pkg, namepkg)
++                    self._remove(namepkg, changeset, locked, pending, depth)
+ 
+         # Install packages required by this one.
+         for req in pkg.requires + pkg.recommends:
+@@ -1176,6 +1194,8 @@ class Transaction(object):
+ 
+         self._policy.runStarting()
+ 
++        attempt = sysconf.has("attempt-install", soft=True)
++
+         try:
+             changeset = self._changeset.copy()
+             isinst = changeset.installed
+@@ -1190,7 +1210,11 @@ class Transaction(object):
+                     locked[pkg] = (LOCKED_KEEP, None)
+                 elif op is INSTALL:
+                     if not isinst(pkg) and pkg in locked:
+-                        raise Failed, _("Can't install %s: it's locked") % pkg
++                        if attempt:
++                            iface.warning(_("Can't install %s: it's locked") % pkg)
++                            del changeset[pkg]
++                        else:
++                            raise Failed, _("Can't install %s: it's locked") % pkg
+                     changeset.set(pkg, INSTALL)
+                     locked[pkg] = (LOCKED_INSTALL, None)
+                 elif op is REMOVE:
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch b/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch
new file mode 100644
index 0000000..e621b33
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-channelsdir.patch
@@ -0,0 +1,24 @@
+Make CHANNELSDIR in smart empty, since this causes host contamination issues
+on some RPM-based hosts on which smart is already installed.
+
+[YOCTO #3881]
+
+Upstream-Status: Inappropriate [embedded specific]
+
+diff --git a/smart/plugins/channelsync.py b/smart/plugins/channelsync.py
+index 3ba95ff..646d696 100644
+--- a/smart/plugins/channelsync.py
++++ b/smart/plugins/channelsync.py
+@@ -23,7 +23,11 @@ from smart.channel import *
+ from smart import *
+ import os
+ 
+-CHANNELSDIR = "/etc/smart/channels/"
++# For now, we leave the definition of CHANNELSDIR empty. This prevents smart
++# from erroneously consider the  build host's channels while setting up its
++# channels [YOCTO #3881]. If this feature will be used in the future, CHANNELSDIR
++# should be set to a proper value.
++CHANNELSDIR = ""
+ 
+ def syncChannels(channelsdir, force=None):
+ 
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch b/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
new file mode 100644
index 0000000..b82265b
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-improve-error-reporting.patch
@@ -0,0 +1,91 @@
+Improve error reporting in smart
+
+Add code to check proper command line arguments for various
+smart commands. Exit with error if erroneous/additional arguments
+are given in the command line.
+
+Upstream-Status: Pending
+
+Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
+
+diff --git a/smart/util/optparse.py b/smart/util/optparse.py
+index 6fff1bc..f445a3b 100644
+--- a/smart/util/optparse.py
++++ b/smart/util/optparse.py
+@@ -70,6 +70,8 @@ import sys, os
+ import types
+ import textwrap
+ from gettext import gettext as _
++from smart import Error
++import re
+ 
+ def _repr(self):
+     return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self)
+@@ -710,6 +712,12 @@ class Option:
+             self.action, self.dest, opt, value, values, parser)
+ 
+     def take_action(self, action, dest, opt, value, values, parser):
++        # Keep all the options in the command line in the '_given_opts' array
++        # This will be used later to validate the command line
++        given_opts = getattr(parser.values, "_given_opts", [])
++        user_opt = re.sub(r"^\-*", "", opt).replace("-", "_")
++        given_opts.append(user_opt)
++        setattr(parser.values, "_given_opts", given_opts)
+         if action == "store":
+             setattr(values, dest, value)
+         elif action == "store_const":
+@@ -821,6 +829,54 @@ class Values:
+             setattr(self, attr, value)
+         return getattr(self, attr)
+ 
++    # Check if the given option has the specified number of arguments
++    # Raise an error if the option has an invalid number of arguments
++    # A negative number for 'nargs' means "at least |nargs| arguments are needed"
++    def check_args_of_option(self, opt, nargs, err=None):
++        given_opts = getattr(self, "_given_opts", [])
++        if not opt in given_opts:
++            return
++        values = getattr(self, opt, [])
++        if type(values) != type([]):
++            return
++        if nargs < 0:
++            nargs = -nargs
++            if len(values) >= nargs:
++                return
++            if not err:
++                if nargs == 1:
++                    err = _("Option '%s' requires at least one argument") % opt
++                else:
++                    err = _("Option '%s' requires at least %d arguments") % (opt, nargs)
++            raise Error, err
++        elif nargs == 0:
++            if len( values ) == 0:
++                return
++            raise Error, err
++        else:
++            if len(values) == nargs:
++                return
++            if not err:
++                if nargs == 1:
++                    err = _("Option '%s' requires one argument") % opt
++                else:
++                    err = _("Option '%s' requires %d arguments") % (opt, nargs)
++            raise Error, err
++
++    # Check that at least one of the options in 'actlist' was given as an argument
++    # to the command 'cmdname'
++    def ensure_action(self, cmdname, actlist):
++        given_opts = getattr(self, "_given_opts", [])
++        for action in actlist:
++            if action in given_opts:
++                return
++        raise Error, _("No action specified for command '%s'") % cmdname
++
++    # Check if there are any other arguments left after parsing the command line and
++    # raise an error if such arguments are found
++    def check_remaining_args(self):
++        if self.args:
++            raise Error, _("Invalid argument(s) '%s'" % str(self.args))
+ 
+ class OptionContainer:
+ 
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch b/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch
new file mode 100644
index 0000000..d607fc4
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-recommends.patch
@@ -0,0 +1,381 @@
+Handle recommended packages in core and rpm backends
+
+Identify and store recommended packages in the cache, add a query option
+to read them and ignore them if they are not present when installing.
+
+Initial identification code from Mark Hatle <mark.hatle@windriver.com>.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
+index 9332ea0..4fcfbee 100644
+--- a/smart/backends/rpm/base.py
++++ b/smart/backends/rpm/base.py
+@@ -225,6 +225,52 @@ class RPMPackage(Package):
+                         break
+                 else:
+                     return False
++        srecs = fk(self.recommends)
++        orecs = fk(other.recommends)
++        if srecs != orecs:
++            for srec in srecs:
++                if srec.name[0] == "/" or srec in orecs:
++                    continue
++                for orec in orecs:
++                    if (srec.name == orec.name and
++                        srec.relation == orec.relation and
++                        checkver(srec.version, orec.version)):
++                        break
++                else:
++                    return False
++            for orec in orecs:
++                if orec.name[0] == "/" or orec in srecs:
++                    continue
++                for srec in srecs:
++                    if (srec.name == orec.name and
++                        srec.relation == orec.relation and
++                        checkver(srec.version, orec.version)):
++                        break
++                else:
++                    return False
++        srecs = fk(self.recommends)
++        orecs = fk(other.recommends)
++        if srecs != orecs:
++            for srec in srecs:
++                if srec.name[0] == "/" or srec in orecs:
++                    continue
++                for orec in orecs:
++                    if (srec.name == orec.name and
++                        srec.relation == orec.relation and
++                        checkver(srec.version, orec.version)):
++                        break
++                else:
++                    return False
++            for orec in orecs:
++                if orec.name[0] == "/" or orec in srecs:
++                    continue
++                for srec in srecs:
++                    if (srec.name == orec.name and
++                        srec.relation == orec.relation and
++                        checkver(srec.version, orec.version)):
++                        break
++                else:
++                    return False
+         return True
+ 
+     def coexists(self, other):
+diff --git a/smart/ccache.c b/smart/ccache.c
+index 7193185..8b66515 100644
+--- a/smart/ccache.c
++++ b/smart/ccache.c
+@@ -500,6 +500,46 @@ Package_equals(PackageObject *self, PackageObject *other)
+         }
+     }
+ 
++    ilen = 0;
++    jlen = 0;
++    for (i = 0; i != PyList_GET_SIZE(self->recommends); i++) {
++        PyObject *item = PyList_GET_ITEM(self->recommends, i);
++        if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) {
++            PyErr_SetString(PyExc_TypeError, "Depends instance expected");
++            return NULL;
++        }
++        if (STR(((DependsObject *)item)->name)[0] != '/')
++            ilen += 1;
++    }
++    for (j = 0; j != PyList_GET_SIZE(other->recommends); j++) {
++        PyObject *item = PyList_GET_ITEM(other->recommends, j);
++        if (!PyObject_IsInstance(item, (PyObject *)&Depends_Type)) {
++            PyErr_SetString(PyExc_TypeError, "Depends instance expected");
++            return NULL;
++        }
++        if (STR(((DependsObject *)item)->name)[0] != '/')
++            jlen += 1;
++    }
++    if (ilen != jlen) {
++        ret = Py_False;
++        goto exit;
++    }
++
++    ilen = PyList_GET_SIZE(self->recommends);
++    jlen = PyList_GET_SIZE(other->recommends);
++    for (i = 0; i != ilen; i++) {
++        PyObject *item = PyList_GET_ITEM(self->recommends, i);
++        if (STR(((DependsObject *)item)->name)[0] != '/') {
++            for (j = 0; j != jlen; j++)
++                if (item == PyList_GET_ITEM(other->recommends, j))
++                    break;
++            if (j == jlen) {
++                ret = Py_False;
++                goto exit;
++            }
++        }
++    }
++
+ exit:
+     Py_INCREF(ret);
+     return ret;
+@@ -1813,6 +1853,59 @@ Loader_buildPackage(LoaderObject *self, PyObject *args)
+         }
+     }
+ 
++    /* if recargs: */
++    if (recargs) {
++        int i = 0;
++        int len = PyList_GET_SIZE(recargs);
++        /* pkg.recommends = [] */
++        Py_DECREF(pkgobj->recommends);
++        pkgobj->recommends = PyList_New(len);
++        /* for args in recargs: */
++        for (; i != len; i++) {
++            PyObject *args = PyList_GET_ITEM(recargs, i);
++            DependsObject *recobj;
++            PyObject *rec;
++            
++            if (!PyTuple_Check(args)) {
++                PyErr_SetString(PyExc_TypeError,
++                                "Item in recargs is not a tuple");
++                return NULL;
++            }
++
++            /* rec = cache._objmap.get(args) */
++            rec = PyDict_GetItem(cache->_objmap, args);
++            recobj = (DependsObject *)rec;
++
++            /* if not rec: */
++            if (!rec) {
++                if (!PyTuple_Check(args) || PyTuple_GET_SIZE(args) < 2) {
++                    PyErr_SetString(PyExc_ValueError, "Invalid recargs tuple");
++                    return NULL;
++                }
++                /* rec = args[0](*args[1:]) */
++                callargs = PyTuple_GetSlice(args, 1, PyTuple_GET_SIZE(args));
++                rec = PyObject_CallObject(PyTuple_GET_ITEM(args, 0), callargs);
++                Py_DECREF(callargs);
++                if (!rec) return NULL;
++                recobj = (DependsObject *)rec;
++
++                /* cache._objmap[args] = rec */
++                PyDict_SetItem(cache->_objmap, args, rec);
++                Py_DECREF(rec);
++
++                /* cache._recommends.append(rec) */
++                PyList_Append(cache->_recommends, rec);
++            }
++
++            /* relpkgs.append(rec.packages) */
++            PyList_Append(relpkgs, recobj->packages);
++
++            /* pkg.recommends.append(rec) */
++            Py_INCREF(rec);
++            PyList_SET_ITEM(pkgobj->recommends, i, rec);
++        }
++    }
++
+     /* if upgargs: */
+     if (upgargs) {
+         int i = 0;
+@@ -2592,6 +2685,16 @@ Cache_reset(CacheObject *self, PyObject *args)
+         if (PyList_Check(reqobj->providedby))
+             LIST_CLEAR(reqobj->providedby);
+     }
++    len = PyList_GET_SIZE(self->_recommends);
++    for (i = 0; i != len; i++) {
++        DependsObject *reqobj;
++        PyObject *req;
++        req = PyList_GET_ITEM(self->_recommends, i);
++        reqobj = (DependsObject *)req;
++        LIST_CLEAR(reqobj->packages);
++        if (PyList_Check(reqobj->providedby))
++            LIST_CLEAR(reqobj->providedby);
++    }
+     len = PyList_GET_SIZE(self->_upgrades);
+     for (i = 0; i != len; i++) {
+         DependsObject *upgobj;
+@@ -2834,6 +2937,30 @@ Cache__reload(CacheObject *self, PyObject *args)
+                 }
+ 
+                 /*
++                   for rec in pkg.recommends:
++                       rec.packages.append(pkg)
++                       if rec not in recommends:
++                           recommends[rec] = True
++                           objmap[rec.getInitArgs()] = rec
++                */
++                if (PyList_Check(pkg->recommends)) {
++                    klen = PyList_GET_SIZE(pkg->recommends);
++                    for (k = 0; k != klen; k++) {
++                        PyObject *rec = PyList_GET_ITEM(pkg->recommends, k);
++                        PyList_Append(((DependsObject *)rec)->packages,
++                                      (PyObject *)pkg);
++                        if (!PyDict_GetItem(recommends, rec)) {
++                            PyDict_SetItem(recommends, rec, Py_True);
++                            args = PyObject_CallMethod(rec, "getInitArgs",
++                                                       NULL);
++                            if (!args) return NULL;
++                            PyDict_SetItem(objmap, args, rec);
++                            Py_DECREF(args);
++                        }
++                    }
++                }
++
++                /*
+                    for upg in pkg.upgrades:
+                        upg.packages.append(pkg)
+                        if upg not in upgrades:
+@@ -3097,6 +3224,47 @@ Cache_linkDeps(CacheObject *self, PyObject *args)
+         Py_DECREF(seq);
+     }
+ 
++    /* recnames = {} */
++    recnames = PyDict_New();
++    /* for rec in self._recommends: */
++    len = PyList_GET_SIZE(self->_recommends);
++    for (i = 0; i != len; i++) {
++        PyObject *rec = PyList_GET_ITEM(self->_recommends, i);
++
++        /* for name in rec.getMatchNames(): */
++        PyObject *names = PyObject_CallMethod(rec, "getMatchNames", NULL);
++        PyObject *seq = PySequence_Fast(names, "getMatchNames() returned "
++                                               "non-sequence object");
++        int nameslen;
++        if (!seq) return NULL;
++        nameslen = PySequence_Fast_GET_SIZE(seq);
++        for (j = 0; j != nameslen; j++) {
++            PyObject *name = PySequence_Fast_GET_ITEM(seq, j);
++            
++            /* lst = recnames.get(name) */
++            lst = PyDict_GetItem(recnames, name);
++
++            /* 
++               if lst:
++                   lst.append(rec)
++               else:
++                   recnames[name] = [rec]
++            */
++            if (lst) {
++                PyList_Append(lst, rec);
++            } else {
++                lst = PyList_New(1);
++                Py_INCREF(rec);
++                PyList_SET_ITEM(lst, 0, rec);
++                PyDict_SetItem(recnames, name, lst);
++                Py_DECREF(lst);
++            }
++        }
++
++        Py_DECREF(names);
++        Py_DECREF(seq);
++    }
++
+     /* upgnames = {} */
+     upgnames = PyDict_New();
+     /* for upg in self._upgrades: */
+@@ -3286,6 +3454,56 @@ Cache_linkDeps(CacheObject *self, PyObject *args)
+             }
+         }
+ 
++        /* lst = recnames.get(prv.name) */
++        lst = PyDict_GetItem(recnames, prv->name);
++
++        /* if lst: */
++        if (lst) {
++            /* for rec in lst: */
++            int reclen = PyList_GET_SIZE(lst);
++            for (j = 0; j != reclen; j++) {
++                DependsObject *rec = (DependsObject *)PyList_GET_ITEM(lst, j);
++                /* if rec.matches(prv): */
++                PyObject *ret = PyObject_CallMethod((PyObject *)rec, "matches",
++                                                    "O", (PyObject *)prv);
++                if (!ret) return NULL;
++                if (PyObject_IsTrue(ret)) {
++                    /*
++                       if rec.providedby:
++                           rec.providedby.append(prv)
++                       else:
++                           rec.providedby = [prv]
++                    */
++                    if (PyList_Check(rec->providedby)) {
++                        PyList_Append(rec->providedby, (PyObject *)prv);
++                    } else {
++                        PyObject *_lst = PyList_New(1);
++                        Py_INCREF(prv);
++                        PyList_SET_ITEM(_lst, 0, (PyObject *)prv);
++                        Py_DECREF(rec->providedby);
++                        rec->providedby = _lst;
++                    }
++
++                    /*
++                       if prv.recommendedby:
++                           prv.recommendedby.append(prv)
++                       else:
++                           prv.recommendedby = [prv]
++                    */
++                    if (PyList_Check(prv->recommendedby)) {
++                        PyList_Append(prv->recommendedby, (PyObject *)rec);
++                    } else {
++                        PyObject *_lst = PyList_New(1);
++                        Py_INCREF(rec);
++                        PyList_SET_ITEM(_lst, 0, (PyObject *)rec);
++                        Py_DECREF(prv->recommendedby);
++                        prv->recommendedby = _lst;
++                    }
++                }
++                Py_DECREF(ret);
++            }
++        }
++
+         /* lst = upgnames.get(prv.name) */
+         lst = PyDict_GetItem(upgnames, prv->name);
+ 
+@@ -3821,6 +4094,21 @@ Cache__setstate__(CacheObject *self, PyObject *state)
+         }
+ 
+         /*
++           for rec in pkg.recommends:
++               rec.packages.append(pkg)
++               recommends[rec] = True
++        */
++        if (PyList_Check(pkgobj->recommends)) {
++            jlen = PyList_GET_SIZE(pkgobj->recommends);
++            for (j = 0; j != jlen; j++) {
++                PyObject *rec = PyList_GET_ITEM(pkgobj->recommends, j);
++                DependsObject *recobj = (DependsObject *)rec;
++                PyList_Append(recobj->packages, pkg);
++                PyDict_SetItem(recommends, rec, Py_True);
++            }
++        }
++
++        /*
+            for upg in pkg.upgrades:
+                upg.packages.append(pkg)
+                upgrades[upg] = True
+diff --git a/smart/commands/query.py b/smart/commands/query.py
+index 9265cd9..b6f5697 100644
+--- a/smart/commands/query.py
++++ b/smart/commands/query.py
+@@ -750,6 +750,22 @@ class TextOutput(NullOutput):
+             name = str(prvpkg)
+         print "       ", "%s (%s)" % (name, prv)
+ 
++    def showRecommends(self, pkg, rec):
++        if self._firstrecommends:
++            self._firstrecommends = False
++            print " ", _("Recommends:")
++        print "   ", rec
++
++    def showRecommendsProvidedBy(self, pkg, req, prv, prvpkg):
++        if self._firstrecommendsprovidedby:
++            self._firstrecommendsprovidedby = False
++            print "     ", _("Provided By:")
++        if self.opts.hide_version:
++            name = prvpkg.name
++        else:
++            name = str(prvpkg)
++        print "       ", "%s (%s)" % (name, prv)
++
+     def showUpgrades(self, pkg, upg):
+         if self._firstupgrades:
+             self._firstupgrades = False
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch b/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch
new file mode 100644
index 0000000..708ffe6
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-rpm4-fixes.patch
@@ -0,0 +1,49 @@
+
+This patch checks for rpm5 related functions in order to allow rpm4 
+to work correctly. Currently the rpm4 archscore and filter work
+differently enough that they need to be changed.
+
+Upstream-Status: Inappropriate [OE-Core Specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: smart-1.4.1/smart/backends/rpm/base.py
+===================================================================
+--- smart-1.4.1.orig/smart/backends/rpm/base.py
++++ smart-1.4.1/smart/backends/rpm/base.py
+@@ -338,10 +338,14 @@ class RPMObsoletes(Depends):
+ 
+ _SCOREMAP = {}
+ def getArchScore(arch, _sm=_SCOREMAP):
+-    if arch not in _sm:
+-        score = rpm.archscore(arch)
+-        _sm[arch] = score
+-    return _sm.get(arch, 0)
++    try:
++        rpm.platformscore(arch)
++        if arch not in _sm:
++            score = rpm.archscore(arch)
++            _sm[arch] = score
++        return _sm.get(arch, 0)
++    except AttributeError:
++        return 1
+ 
+ # TODO: Embed color into nameprovides and obsoletes relations.
+ _COLORMAP = {"noarch": 0, "x86_64": 2, "ppc64": 2, "s390x": 2, "sparc64": 2}
+Index: smart-1.4.1/smart/backends/rpm/pm.py
+===================================================================
+--- smart-1.4.1.orig/smart/backends/rpm/pm.py
++++ smart-1.4.1/smart/backends/rpm/pm.py
+@@ -235,6 +235,12 @@ class RPMPackageManager(PackageManager):
+         if sysconf.get("rpm-order"):
+             ts.order()
+         probfilter = rpm.RPMPROB_FILTER_OLDPACKAGE
++        try:
++            # Test for RPM5 function
++            rpm.platformscore("")
++        except AttributeError:
++            probfilter |= rpm.RPMPROB_FILTER_IGNOREARCH
++
+         if force or reinstall:
+             probfilter |= rpm.RPMPROB_FILTER_REPLACEPKG
+             probfilter |= rpm.RPMPROB_FILTER_REPLACEOLDFILES
diff --git a/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch b/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch
new file mode 100644
index 0000000..2885998
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smart-set-noprogress-for-pycurl.patch
@@ -0,0 +1,20 @@
+Set NOPROGRESS for pycurl just as same as default operation in pycurl module itself.
+If set NOPROGRESS with 0 for pycurl, it causes dead lock issue of Python GIL when
+call smart library by python gui just like pygtk.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff -u smart-1.4.1/smart.orig/fetcher.py smart-1.4.1/smart/fetcher.py
+--- smart-1.4.1/smart.orig/fetcher.py	2014-07-15 16:42:19.240437080 +0800
++++ smart-1.4.1/smart/fetcher.py	2014-07-15 17:02:37.812470289 +0800
+@@ -1720,7 +1720,7 @@
+                         handle.setopt(pycurl.OPT_FILETIME, 1)
+                         handle.setopt(pycurl.LOW_SPEED_LIMIT, 1)
+                         handle.setopt(pycurl.LOW_SPEED_TIME, SOCKETTIMEOUT)
+-                        handle.setopt(pycurl.NOPROGRESS, 0)
++                        handle.setopt(pycurl.NOPROGRESS, 1)
+                         handle.setopt(pycurl.PROGRESSFUNCTION, progress)
+                         handle.setopt(pycurl.WRITEDATA, local)
+                         handle.setopt(pycurl.FOLLOWLOCATION, 1)
diff --git a/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch b/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch
new file mode 100644
index 0000000..fefb29a
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm/smartpm-rpm5-nodig.patch
@@ -0,0 +1,59 @@
+RPM5 has removed support for RPMVSF_NOSIGNATURES
+
+Patch smart to no longer use this flag
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff --git a/smart/backends/rpm/base.py b/smart/backends/rpm/base.py
+--- a/smart/backends/rpm/base.py
++++ b/smart/backends/rpm/base.py
+@@ -63,11 +63,11 @@ def getTS(new=False):
+         if sysconf.get("rpm-dbpath"):
+             rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
+         getTS.ts = rpm.ts(getTS.root)
+-        if not sysconf.get("rpm-check-signatures", False):
+-            if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
+-                getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
+-            else:
+-                raise Error, _("rpm requires checking signatures")
++        #if not sysconf.get("rpm-check-signatures", False):
++        #    if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
++        #        getTS.ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
++        #    else:
++        #        raise Error, _("rpm requires checking signatures")
+         rpm_dbpath = sysconf.get("rpm-dbpath", "var/lib/rpm")
+         dbdir = rpm_join_dbpath(getTS.root, rpm_dbpath)
+         if not os.path.isdir(dbdir):
+@@ -89,11 +89,11 @@ def getTS(new=False):
+         if sysconf.get("rpm-dbpath"):
+             rpm.addMacro('_dbpath', "/" + sysconf.get("rpm-dbpath"))
+         ts = rpm.ts(getTS.root)
+-        if not sysconf.get("rpm-check-signatures", False):
+-            if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
+-                ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
+-            else:
+-                raise Error, _("rpm requires checking signatures")
++        #if not sysconf.get("rpm-check-signatures", False):
++        #    if hasattr(rpm, '_RPMVSF_NOSIGNATURES'):
++        #        ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
++        #    else:
++        #        raise Error, _("rpm requires checking signatures")
+         return ts
+     else:
+         return getTS.ts
+diff --git a/smart/plugins/yumchannelsync.py b/smart/plugins/yumchannelsync.py
+--- a/smart/plugins/yumchannelsync.py
++++ b/smart/plugins/yumchannelsync.py
+@@ -56,8 +56,8 @@ def _getreleasever():
+ 
+     rpmroot = sysconf.get("rpm-root", "/")
+     ts = rpmUtils.transaction.initReadOnlyTransaction(root=rpmroot)
+-    if hasattr(rpm, '_RPMVSF_NOSIGNATURES') and hasattr(rpm, '_RPMVSF_NODIGESTS'):
+-        ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
++    #if hasattr(rpm, '_RPMVSF_NOSIGNATURES') and hasattr(rpm, '_RPMVSF_NODIGESTS'):
++    #    ts.pushVSFlags(~(rpm._RPMVSF_NOSIGNATURES|rpm._RPMVSF_NODIGESTS))
+     releasever = None
+     # HACK: we're hard-coding the most used distros, will add more if needed
+     idx = ts.dbMatch('provides', 'fedora-release')
diff --git a/meta/recipes-devtools/python/python-smartpm_git.bb b/meta/recipes-devtools/python/python-smartpm_git.bb
new file mode 100644
index 0000000..8b974b0
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smartpm_git.bb
@@ -0,0 +1,139 @@
+SUMMARY = "The Smart Package Manager"
+DESCRIPTION = "The Smart Package Manager project has the ambitious objective of creating \
+smart and portable algorithms for solving adequately the problem of managing software \
+upgrades and installation."
+
+HOMEPAGE = "http://labix.org/smart/"
+SECTION = "devel/python"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=393a5ca445f6965873eca0259a17f833"
+
+DEPENDS = "python rpm gettext-native python-rpm"
+SRCNAME = "smart"
+
+SRC_URI = "\
+          git://github.com/smartpm/smart.git \
+          file://smartpm-rpm5-nodig.patch \
+          file://smart-recommends.patch \
+          file://smart-improve-error-reporting.patch \
+          file://smart-channelsdir.patch \
+          file://smart-attempt.patch \
+          file://smart-attempt-fix.patch \
+          file://smart-rpm4-fixes.patch \
+          file://smart-add-for-rpm-ignoresize-check.patch \
+          file://smart-already-installed-message.patch \
+          file://smart-set-noprogress-for-pycurl.patch \
+         "
+
+SRCREV = "407a7eca766431257dcd1da15175cc36a1bb22d0"
+PV = "1.5+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+# Options - rpm, qt4, gtk
+PACKAGECONFIG ??= "rpm"
+
+RPM_RDEP = "${PN}-backend-rpm"
+QT_RDEP = "${PN}-interface-qt4"
+GTK_RDEP = "${PN}-interface-gtk"
+
+RPM_RDEP_class-native = ""
+QT_RDEP_class-native = ""
+GTK_RDEP_class-native = ""
+
+RPM_RDEP_class-nativesdk = ""
+QT_RDEP_class-nativesdk = ""
+GTK_RDEP_class-nativesdk = ""
+
+PACKAGECONFIG[rpm] = ",,rpm,${RPM_RDEP}"
+PACKAGECONFIG[qt4] = ",,qt4-x11,${QT_RDEP}"
+PACKAGECONFIG[gtk] = ",,gtk+,${GTK_RDEP}"
+
+inherit distutils
+
+do_install_append() {
+   # We don't support the following items
+   rm -rf ${D}${libdir}/python*/site-packages/smart/backends/slack
+   rm -rf ${D}${libdir}/python*/site-packages/smart/backends/arch
+   rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt
+
+   # Temporary, debian support in OE is missing the python module
+   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/aptchannelsync.py*
+   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/debdir.py*
+   rm -rf ${D}${libdir}/python*/site-packages/smart/backends/deb
+
+   # Disable automatic channel detection
+   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/detectsys.py*
+
+   # Disable landscape support
+   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/landscape.py*
+
+   # Disable urpmi channel support
+   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/urpmichannelsync.py*
+
+   # Disable yum channel support
+   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/yumchannelsync.py*
+
+   # Disable zypper channel support
+   rm -f ${D}${libdir}/python*/site-packages/smart/plugins/zyppchannelsync.py*
+
+   if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'rpm', 'rpm', '', d)}" ]; then
+      rm -f ${D}${libdir}/python*/site-packages/smart/plugins/rpmdir.py*
+      rm -rf ${D}${libdir}/python*/site-packages/smart/backends/rpm
+   fi
+
+   if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'qt4', 'qt4', '', d)}" ]; then
+      rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/qt4
+   fi
+
+   if [ -z "${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'gtk', '', d)}" ]; then
+      rm -rf ${D}${libdir}/python*/site-packages/smart/interfaces/gtk
+   fi
+}
+
+add_native_wrapper() {
+        create_wrapper ${D}/${bindir}/smart \
+		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+}
+
+do_install_append_class-native() {
+        sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/smart
+        add_native_wrapper
+}
+
+do_install_append_class-nativesdk() {
+        add_native_wrapper
+}
+
+PACKAGES = "${PN}-dev ${PN}-dbg ${PN}-doc smartpm \
+            ${@bb.utils.contains('PACKAGECONFIG', 'rpm', '${PN}-backend-rpm', '', d)} \
+            ${@bb.utils.contains('PACKAGECONFIG', 'qt4', '${PN}-interface-qt4', '', d)} \
+            ${@bb.utils.contains('PACKAGECONFIG', 'gtk', '${PN}-interface-gtk', '', d)} \
+            ${PN}-interface-images ${PN}"
+
+RDEPENDS_smartpm = "${PN}"
+
+RDEPENDS_${PN} += "${PN}-backend-rpm python-codecs python-textutils python-xml python-fcntl \
+                   python-pickle python-crypt python-compression python-shell \
+                   python-resource python-netclient python-threading python-unixadmin python-pprint"
+RDEPENDS_${PN}_class-native = ""
+
+RDEPENDS_${PN}-backend-rpm = "python-rpm"
+
+RDEPENDS_${PN}-interface-qt4 = "qt4-x11 ${PN}-interface-images"
+RDEPENDS_${PN}-interface-gtk = "gtk+ ${PN}-interface-images"
+
+FILES_smartpm = "${bindir}/smart"
+
+FILES_${PN}-dbg += "${libdir}/python*/site-packages/smart/backends/rpm/.debug"
+
+FILES_${PN}-backend-rpm = "${libdir}/python*/site-packages/smart/backends/rpm"
+
+FILES_${PN}-interface-qt4 = "${libdir}/python*/site-packages/smart/interfaces/qt4"
+FILES_${PN}-interface-gtk = "${libdir}/python*/site-packages/smart/interfaces/gtk"
+FILES_${PN}-interface-images = "${datadir}/${baselib}/python*/site-packages/smart/interfaces/images"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/meta/recipes-devtools/python/python-smmap_0.9.0.bb b/meta/recipes-devtools/python/python-smmap_0.9.0.bb
new file mode 100644
index 0000000..b658be8
--- /dev/null
+++ b/meta/recipes-devtools/python/python-smmap_0.9.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Python implementation of a sliding window memory map manager"
+DESCRIPTION = "A pure Python implementation of a sliding memory map to \
+help unifying memory mapped access on 32 and 64 bit systems and to help \
+managing resources more efficiently."
+HOMEPAGE = "http://github.com/gitpython-developers/GitPython"
+SECTION = "devel/python"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709"
+
+SRC_URI = "http://pypi.python.org/packages/source/s/smmap/smmap-${PV}.tar.gz"
+SRC_URI[md5sum] = "d7932d5ace206bf4ae15198cf36fb6ab"
+SRC_URI[sha256sum] = "0e2b62b497bd5f0afebc002eda4d90df9d209c30ef257e8673c90a6b5c119d62"
+
+S = "${WORKDIR}/smmap-${PV}"
+
+inherit setuptools
+
+RDEPENDS_${PN} += "python-codecs python-mmap python-lang"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/python/python.inc b/meta/recipes-devtools/python/python.inc
new file mode 100644
index 0000000..e18ab8e
--- /dev/null
+++ b/meta/recipes-devtools/python/python.inc
@@ -0,0 +1,31 @@
+SUMMARY = "The Python Programming Language"
+HOMEPAGE = "http://www.python.org"
+LICENSE = "PSFv2"
+SECTION = "devel/python"
+# bump this on every change in contrib/python/generate-manifest-2.7.py
+INC_PR = "r1"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dff3d00f049545862992d2d097831a13"
+
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "38d530f7efc373d64a8fb1637e3baaa7"
+SRC_URI[sha256sum] = "90d27e14ea7e03570026850e2e50ba71ad20b7eb31035aada1cf3def8f8d4916"
+
+PYTHON_MAJMIN = "2.7"
+
+inherit autotools
+
+PYTHONLSBOPTS = "--with-wctype-functions"
+PYTHONLSBOPTS_linuxstdbase = "ac_cv_sizeof_off_t=8"
+
+EXTRA_OECONF = "\
+  --with-threads \
+  --with-pymalloc \
+  --without-cxx-main \
+  --with-signal-module \
+  --enable-shared \
+  --enable-ipv6=${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'yes', 'no', d)} \
+  ac_cv_header_bluetooth_bluetooth_h=no ac_cv_header_bluetooth_h=no \
+  ${PYTHONLSBOPTS} \
+"
diff --git a/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
new file mode 100644
index 0000000..1257ca6
--- /dev/null
+++ b/meta/recipes-devtools/python/python/01-use-proper-tools-for-cross-build.patch
@@ -0,0 +1,97 @@
+We need to ensure our host tools get run during build, not the freshly
+built cross-tools (this will not work), so we introduce HOSTPYTHON and HOSTPGEN.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebased for python-2.7.9
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -234,6 +234,7 @@ LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
+ ##########################################################################
+ # Parser
+ PGEN=		Parser/pgen$(EXE)
++HOSTPGEN=	$(PGEN)$(EXE)
+ 
+ PSRCS=		\
+ 		Parser/acceler.c \
+@@ -445,7 +446,7 @@ $(BUILDPYTHON):	Modules/python.o $(LIBRA
+ 			$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
+ 
+ platform: $(BUILDPYTHON) pybuilddir.txt
+-	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
++	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
+ 
+ # Create build directory and generate the sysconfig build-time data there.
+ # pybuilddir.txt contains the name of the build dir and is used for
+@@ -611,7 +612,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/p
+ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
+ 		@$(MKDIR_P) Include
+ 		$(MAKE) $(PGEN)
+-		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++		$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
+ 		$(MAKE) $(GRAMMAR_H)
+ 		touch $(GRAMMAR_C)
+@@ -1043,27 +1044,27 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
+ 			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ 	fi
+ 	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
+-		$(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
++		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		-d $(LIBDEST) -f \
+ 		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ 		$(DESTDIR)$(LIBDEST)
+ 	PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-		$(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
++		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		-d $(LIBDEST) -f \
+ 		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ 		$(DESTDIR)$(LIBDEST)
+ 	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
+-		$(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
++		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		-d $(LIBDEST)/site-packages -f \
+ 		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-		$(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
++		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		-d $(LIBDEST)/site-packages -f \
+ 		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
++		$(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+ 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
++		$(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+ 
+ # Create the PLATDIR source directory, if one wasn't distributed..
+ $(srcdir)/Lib/$(PLATDIR):
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -334,6 +334,7 @@ class PyBuildExt(build_ext):
+             self.failed.append(ext.name)
+             self.announce('*** WARNING: renaming "%s" since importing it'
+                           ' failed: %s' % (ext.name, why), level=3)
++            return
+             assert not self.inplace
+             basename, tail = os.path.splitext(ext_filename)
+             newname = basename + "_failed" + tail
+@@ -558,6 +559,9 @@ class PyBuildExt(build_ext):
+ 
+         # XXX Omitted modules: gl, pure, dl, SGI-specific modules
+ 
++        lib_dirs = [ os.getenv("STAGING_LIBDIR"),  os.getenv("STAGING_BASELIBDIR") ]
++        inc_dirs = [ os.getenv("STAGING_INCDIR") ]
++
+         #
+         # The following modules are all pretty straightforward, and compile
+         # on pretty much any POSIXish platform.
diff --git a/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch b/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
new file mode 100644
index 0000000..650ceb5
--- /dev/null
+++ b/meta/recipes-devtools/python/python/03-fix-tkinter-detection.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+We need to supply STAGING_INCDIR here, otherwise the Tk headers
+will not be found.
+
+Signed-off-by: Michael 'Mickey' Lauer <mickey@vanille.de>
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Rebased for python-2.7.9
+
+diff --git a/setup.py b/setup.py
+index 8fe1fb8..67eda74 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1892,7 +1892,7 @@ class PyBuildExt(build_ext):
+                 dotversion = dotversion[:-1] + '.' + dotversion[-1]
+             tcl_include_sub = []
+             tk_include_sub = []
+-            for dir in inc_dirs:
++            for dir in [os.getenv("STAGING_INCDIR")]:
+                 tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
+                 tk_include_sub += [dir + os.sep + "tk" + dotversion]
+             tk_include_sub += tcl_include_sub
+@@ -1911,22 +1911,6 @@ class PyBuildExt(build_ext):
+             if dir not in include_dirs:
+                 include_dirs.append(dir)
+ 
+-        # Check for various platform-specific directories
+-        if host_platform == 'sunos5':
+-            include_dirs.append('/usr/openwin/include')
+-            added_lib_dirs.append('/usr/openwin/lib')
+-        elif os.path.exists('/usr/X11R6/include'):
+-            include_dirs.append('/usr/X11R6/include')
+-            added_lib_dirs.append('/usr/X11R6/lib64')
+-            added_lib_dirs.append('/usr/X11R6/lib')
+-        elif os.path.exists('/usr/X11R5/include'):
+-            include_dirs.append('/usr/X11R5/include')
+-            added_lib_dirs.append('/usr/X11R5/lib')
+-        else:
+-            # Assume default location for X11
+-            include_dirs.append('/usr/X11/include')
+-            added_lib_dirs.append('/usr/X11/lib')
+-
+         # If Cygwin, then verify that X is installed before proceeding
+         if host_platform == 'cygwin':
+             x11_inc = find_file('X11/Xlib.h', [], include_dirs)
diff --git a/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch b/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
new file mode 100644
index 0000000..5cc8742
--- /dev/null
+++ b/meta/recipes-devtools/python/python/05-enable-ctypes-cross-build.patch
@@ -0,0 +1,27 @@
+Rebased for python 2.7.9
+
+Upstream-Status: Inappropriate [embedded specific]
+
+# CTypes need to know the actual host we are building on.
+# Signed-Off: Michael Dietrich <mdt@emdete.de>
+
+Index: Python-2.7.9/setup.py
+===================================================================
+--- Python-2.7.9.orig/setup.py
++++ Python-2.7.9/setup.py
+@@ -2028,12 +2028,12 @@ class PyBuildExt(build_ext):
+ 
+                 # Pass empty CFLAGS because we'll just append the resulting
+                 # CFLAGS to Python's; -g or -O2 is to be avoided.
+-                cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
+-                      % (ffi_builddir, ffi_srcdir, " ".join(config_args))
++                cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \
++                    % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args))
+ 
+                 res = os.system(cmd)
+                 if res or not os.path.exists(ffi_configfile):
+-                    print "Failed to configure _ctypes module"
++                    print "Failed to configure _ctypes module (res=%d) or missing conffile=%s" % ( res, ffi_configfile )
+                     return False
+ 
+             fficonfig = {}
diff --git a/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch b/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
new file mode 100644
index 0000000..e452cb6
--- /dev/null
+++ b/meta/recipes-devtools/python/python/06-avoid_usr_lib_termcap_path_in_linking.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+The poison directories patch has detected library path issue while 
+compiling the python in cross environment, as seen bellow.
+
+warning: library search path "/usr/lib/termcap" is unsafe for cross-compilation
+
+This Patch fixes this issue in the python build environment.
+11 Oct 2010
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+2011/09/29
+Rebased for python 2.7.2
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+diff --git a/setup.py b/setup.py
+index 67eda74..59c537e 100644
+--- a/setup.py
++++ b/setup.py
+@@ -761,12 +761,10 @@ class PyBuildExt(build_ext):
+                 pass # Issue 7384: Already linked against curses or tinfo.
+             elif curses_library:
+                 readline_libs.append(curses_library)
+-            elif self.compiler.find_library_file(lib_dirs +
+-                                                     ['/usr/lib/termcap'],
++            elif self.compiler.find_library_file(lib_dirs,
+                                                      'termcap'):
+                 readline_libs.append('termcap')
+             exts.append( Extension('readline', ['readline.c'],
+-                                   library_dirs=['/usr/lib/termcap'],
+                                    extra_link_args=readline_extra_link_args,
+                                    libraries=readline_libs) )
+         else:
diff --git a/meta/recipes-devtools/python/python/add-md5module-support.patch b/meta/recipes-devtools/python/python/add-md5module-support.patch
new file mode 100644
index 0000000..33fea77
--- /dev/null
+++ b/meta/recipes-devtools/python/python/add-md5module-support.patch
@@ -0,0 +1,18 @@
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: Python-2.7.2/Modules/Setup.dist
+===================================================================
+--- Python-2.7.2.orig/Modules/Setup.dist	2011-06-11 08:46:26.000000000 -0700
++++ Python-2.7.2/Modules/Setup.dist	2011-12-27 15:51:41.244623219 -0800
+@@ -248,7 +248,7 @@
+ # Message-Digest Algorithm, described in RFC 1321.  The necessary files
+ # md5.c and md5.h are included here.
+ 
+-#_md5 md5module.c md5.c
++_md5 md5module.c md5.c
+ 
+ 
+ # The _sha module implements the SHA checksum algorithms.
diff --git a/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch b/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch
new file mode 100644
index 0000000..e9bae32
--- /dev/null
+++ b/meta/recipes-devtools/python/python/avoid_parallel_make_races_on_pgen.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Pending
+
+Avoids parallel make races linking errors when making Parser/PGEN
+
+- Implements Richard Purdie's idea
+
+Signed-Off-By: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -611,12 +611,10 @@ Modules/grpmodule.o: $(srcdir)/Modules/g
+ 
+ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h
+ 
+-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
++$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN)
+ 		@$(MKDIR_P) Include
+-		$(MAKE) $(PGEN)
+ 		$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
+-		$(MAKE) $(GRAMMAR_H)
+ 		touch $(GRAMMAR_C)
+ 
+ $(PGEN):	$(PGENOBJS)
diff --git a/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch b/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
new file mode 100644
index 0000000..208c57c
--- /dev/null
+++ b/meta/recipes-devtools/python/python/avoid_warning_about_tkinter.patch
@@ -0,0 +1,25 @@
+_tkinter module needs tk module along with tcl. tk is not yet integrated
+in yocto so we skip the check for this module.
+Avoid a warning by not adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py	2012-04-05 23:18:38.500136647 +0300
++++ Python-2.7.2/setup.py	2012-04-05 23:19:35.888134969 +0300
+@@ -1634,8 +1634,10 @@
+         # Call the method for detecting whether _tkinter can be compiled
+         self.detect_tkinter(inc_dirs, lib_dirs)
+ 
+-        if '_tkinter' not in [e.name for e in self.extensions]:
+-            missing.append('_tkinter')
++        # tkinter module will not be avalaible as yocto
++        # doesn't have tk integrated (yet)
++        #if '_tkinter' not in [e.name for e in self.extensions]:
++        #    missing.append('_tkinter')
+ 
+         return missing
+ 
diff --git a/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch b/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
new file mode 100644
index 0000000..337e0e3
--- /dev/null
+++ b/meta/recipes-devtools/python/python/avoid_warning_for_sunos_specific_module.patch
@@ -0,0 +1,23 @@
+sunaudiodev module is sunos specific so we avoid a warning by not 
+adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py	2012-04-05 22:29:18.049196608 +0300
++++ Python-2.7.2/setup.py	2012-04-05 22:29:57.505195453 +0300
+@@ -1522,8 +1522,9 @@
+         if platform == 'sunos5':
+             # SunOS specific modules
+             exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
+-        else:
+-            missing.append('sunaudiodev')
++        # If platform is not sunos warning is useless
++        #else:
++        #    missing.append('sunaudiodev')
+ 
+         if platform == 'darwin':
+             # _scproxy
diff --git a/meta/recipes-devtools/python/python/builddir.patch b/meta/recipes-devtools/python/python/builddir.patch
new file mode 100644
index 0000000..ad629a0
--- /dev/null
+++ b/meta/recipes-devtools/python/python/builddir.patch
@@ -0,0 +1,46 @@
+When cross compiling python, we used to need to install the Makefile, pyconfig.h 
+and the python library to their final location before being able to compile the 
+rest of python. This change allows us to point python at its own source when
+building, avoiding a variety of sysroot staging issues and simplifying the main
+python recipe.
+
+Upstream-Status: Inappropriate
+RP 2012/11/13
+
+Index: Python-2.7.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/Lib/sysconfig.py
+@@ -93,6 +93,7 @@ _PREFIX = os.path.normpath(sys.prefix)
+ _EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+ _CONFIG_VARS = None
+ _USER_BASE = None
++_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
+ 
+ def _safe_realpath(path):
+     try:
+@@ -100,7 +101,9 @@ def _safe_realpath(path):
+     except OSError:
+         return path
+ 
+-if sys.executable:
++if _PYTHONBUILDDIR:
++    _PROJECT_BASE = _PYTHONBUILDDIR
++elif sys.executable:
+     _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable))
+ else:
+     # sys.executable can be empty if argv[0] has been changed and Python is
+Index: Python-2.7.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/Lib/distutils/sysconfig.py
+@@ -26,6 +26,9 @@ EXEC_PREFIX = os.path.normpath(sys.exec_
+ # live in project/PCBuild9.  If we're dealing with an x64 Windows build,
+ # it'll live in project/PCbuild/amd64.
+ project_base = os.path.dirname(os.path.abspath(sys.executable))
++_PYTHONBUILDDIR = os.environ.get("PYTHONBUILDDIR", None)
++if _PYTHONBUILDDIR:
++    project_base = _PYTHONBUILDDIR
+ if os.name == "nt" and "pcbuild" in project_base[-8:].lower():
+     project_base = os.path.abspath(os.path.join(project_base, os.path.pardir))
+ # PC/VS7.1
diff --git a/meta/recipes-devtools/python/python/cgi_py.patch b/meta/recipes-devtools/python/python/cgi_py.patch
new file mode 100644
index 0000000..de504f9
--- /dev/null
+++ b/meta/recipes-devtools/python/python/cgi_py.patch
@@ -0,0 +1,23 @@
+Lib/cgi.py: Update the script as mentioned in the comment
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- Python-2.6.6/Lib/cgi.py.orig	2010-08-01 22:14:27.000000000 -0500
++++ Python-2.6.6/Lib/cgi.py	2011-09-21 15:28:40.478208631 -0500
+@@ -1,13 +1,4 @@
+-#! /usr/local/bin/python
+-
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is
+-# intentionally NOT "/usr/bin/env python".  On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python.  Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin.  So let those vendors patch cgi.py to match their choice
+-# of installation.
++#! /usr/bin/env python
+ 
+ """Support module for CGI (Common Gateway Interface) scripts.
+ 
diff --git a/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch b/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
new file mode 100644
index 0000000..2b62db3
--- /dev/null
+++ b/meta/recipes-devtools/python/python/check-if-target-is-64b-not-host.patch
@@ -0,0 +1,57 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+Date:   Sun Mar 25 02:02:27 2012 +0200
+
+This patch was added for 64bit host machines. In the compile process python
+is checking if platform is a 64bit platform using sys.maxint which is the host's
+value. The patch fixes this issue so that python would check if TARGET machine
+is 64bit not the HOST machine. In this way will have "dl" and "imageop" modules
+built if HOST machine is 64bit but the target machine is 32bit.
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Upstream-Status: Pending
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py	2012-03-25 01:10:41.540163187 +0200
++++ Python-2.7.2/setup.py	2012-03-25 01:26:06.092539990 +0200
+@@ -23,6 +23,21 @@
+ # This global variable is used to hold the list of modules to be disabled.
+ disabled_module_list = []
+ 
++def target_is_64bit_platform ():
++    """
++    In case of cross-compile, some modules are not build as setup checks if HOST
++    is 64bit and not TARGET.
++    As python was built for TARGET we can check this in pyconfig.h in this way:
++	Sizeof LONG on a 32 bit platform is 4 bytes
++	Sizeof LONG on a 64 bit platform is 8 bytes
++    """
++    pyconf = open("pyconfig.h").read()
++    aux = re.search(r"#s*define\s+SIZEOF_LONG\s+8\s*", pyconf)
++    if aux is not None:
++	return True
++    else:
++	return False
++
+ def add_dir_to_list(dirlist, dir):
+     """Add the directory 'dir' to the list 'dirlist' (at the front) if
+     1) 'dir' is not already in 'dirlist'
+@@ -628,7 +643,7 @@
+         exts.append( Extension('audioop', ['audioop.c']) )
+ 
+         # Disabled on 64-bit platforms
+-        if sys.maxint != 9223372036854775807L:
++        if not target_is_64bit_platform():
+             # Operations on images
+             exts.append( Extension('imageop', ['imageop.c']) )
+         else:
+@@ -1418,7 +1433,7 @@
+                 missing.append('_codecs_%s' % loc)
+ 
+         # Dynamic loading module
+-        if sys.maxint == 0x7fffffff:
++        if not target_is_64bit_platform():
+             # This requires sizeof(int) == sizeof(long) == sizeof(char*)
+             dl_inc = find_file('dlfcn.h', [], inc_dirs)
+             if (dl_inc is not None) and (platform not in ['atheos']):
diff --git a/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch b/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch
new file mode 100644
index 0000000..669112d
--- /dev/null
+++ b/meta/recipes-devtools/python/python/fix-makefile-for-ptest.patch
@@ -0,0 +1,33 @@
+Add 'build-test' and 'runtest-TESTS' targets to Makefile, to build and run tests
+cross-compiled.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+---
+diff -ruN a/Makefile.pre.in b/Makefile.pre.in
+--- a/Makefile.pre.in	2013-06-27 10:44:11.033840532 +0200
++++ b/Makefile.pre.in	2013-06-27 10:44:39.572635273 +0200
+@@ -709,14 +709,19 @@
+ # generated bytecode.  This is sometimes a very shy bug needing a lot of
+ # sample data.
+ 
+-TESTOPTS=	-l $(EXTRATESTOPTS)
++TESTOPTS=	-l -v $(EXTRATESTOPTS)
+ TESTPROG=	$(srcdir)/Lib/test/regrtest.py
+-TESTPYTHON=	$(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
+-test:		all platform
+-		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
++TESTPYTHON=	$(RUNSHARED) $(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
++test:		build-test
++		$(MAKE) runtest-TESTS
++
++runtest-TESTS:
++		-find $(srcdir) -name '*.py[co]' -print | xargs rm -f
+ 		-$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
+ 		$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
+ 
++build-test:	all platform
++
+ testall:	all platform
+ 		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
+ 		$(TESTPYTHON) $(srcdir)/Lib/compileall.py
diff --git a/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch b/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
new file mode 100644
index 0000000..e4262d9
--- /dev/null
+++ b/meta/recipes-devtools/python/python/fix_for_using_different_libdir.patch
@@ -0,0 +1,77 @@
+Upstream-Status: Inappropriate [Embedded specific]
+
+This patch fixes issuing with different libdir like lib64.
+This patch makes the native python binary modules findable
+in the install process of the host python.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/03/14
+
+Updated for python 2.7.3
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/05/01
+
+Rebased for python-2.7.9
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+
+Index: Python-2.7.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/Lib/sysconfig.py
+@@ -9,7 +9,7 @@ _INSTALL_SCHEMES = {
+     'posix_prefix': {
+         'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
+         'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+-        'purelib': '{base}/lib/python{py_version_short}/site-packages',
++        'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'include': '{base}/include/python{py_version_short}',
+         'platinclude': '{platbase}/include/python{py_version_short}',
+@@ -67,7 +67,7 @@ _INSTALL_SCHEMES = {
+     'posix_user': {
+         'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+         'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+-        'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
++        'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'include': '{userbase}/include/python{py_version_short}',
+         'scripts': '{userbase}/bin',
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -1046,27 +1046,27 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
+ 		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ 			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ 	fi
+-	PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
++	PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ 		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		-d $(LIBDEST) -f \
+ 		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ 		$(DESTDIR)$(LIBDEST)
+-	PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++	PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH}$(RUNSHARED) \
+ 		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		-d $(LIBDEST) -f \
+ 		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+ 		$(DESTDIR)$(LIBDEST)
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
++	-PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ 		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		-d $(LIBDEST)/site-packages -f \
+ 		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++	-PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ 		$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ 		-d $(LIBDEST)/site-packages -f \
+ 		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++	-PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ 		$(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++	-PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ 		$(HOSTPYTHON) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+ 
+ # Create the PLATDIR source directory, if one wasn't distributed..
diff --git a/meta/recipes-devtools/python/python/host_include_contamination.patch b/meta/recipes-devtools/python/python/host_include_contamination.patch
new file mode 100644
index 0000000..e0aafb2
--- /dev/null
+++ b/meta/recipes-devtools/python/python/host_include_contamination.patch
@@ -0,0 +1,28 @@
+when building python for qemux86-64 on ubuntu 11.10/64bit
+it gropes into host includes and then mixes them with cross
+includes and as a result some modules fail to compile and link
+one of the modules is python-elementtree which is then not
+found during image creation
+
+Proble is that setup.py tries to add native includes that newer
+ubuntu has introduced for multiarch support. But that should
+only happen for native builds and not cross building python
+so we add a check here.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+
+diff --git a/setup.py b/setup.py
+index ba2d242..bf859be 100644
+--- a/setup.py
++++ b/setup.py
+@@ -393,6 +393,8 @@ class PyBuildExt(build_ext):
+ 
+         if not find_executable('dpkg-architecture'):
+             return
++        if os.environ.get('CROSS_COMPILE') is not None:
++            return
+         opt = ''
+         if cross_compiling:
+             opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE')
diff --git a/meta/recipes-devtools/python/python/multilib.patch b/meta/recipes-devtools/python/python/multilib.patch
new file mode 100644
index 0000000..0bfa0d2
--- /dev/null
+++ b/meta/recipes-devtools/python/python/multilib.patch
@@ -0,0 +1,296 @@
+Rebased for python-2.7.9
+Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/configure.ac
+===================================================================
+--- Python-2.7.9.orig/configure.ac
++++ Python-2.7.9/configure.ac
+@@ -736,6 +736,10 @@ SunOS*)
+     ;;
+ esac
+ 
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++LIB=`basename ${libdir}`
++AC_MSG_RESULT($LIB)
+ 
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+Index: Python-2.7.9/Include/pythonrun.h
+===================================================================
+--- Python-2.7.9.orig/Include/pythonrun.h
++++ Python-2.7.9/Include/pythonrun.h
+@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);
+ PyAPI_FUNC(const char *) Py_GetPlatform(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
+ PyAPI_FUNC(const char *) Py_GetCopyright(void);
+ PyAPI_FUNC(const char *) Py_GetCompiler(void);
+ PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+Index: Python-2.7.9/Lib/distutils/command/install.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/command/install.py
++++ Python-2.7.9/Lib/distutils/command/install.py
+@@ -22,6 +22,8 @@ from site import USER_BASE
+ from site import USER_SITE
+ 
+ 
++libname = sys.lib
++
+ if sys.version < "2.2":
+     WINDOWS_SCHEME = {
+         'purelib': '$base',
+@@ -42,7 +44,7 @@ else:
+ INSTALL_SCHEMES = {
+     'unix_prefix': {
+         'purelib': '$base/lib/python$py_version_short/site-packages',
+-        'platlib': '$platbase/lib/python$py_version_short/site-packages',
++        'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+         'headers': '$base/include/python$py_version_short/$dist_name',
+         'scripts': '$base/bin',
+         'data'   : '$base',
+Index: Python-2.7.9/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/distutils/sysconfig.py
++++ Python-2.7.9/Lib/distutils/sysconfig.py
+@@ -119,8 +119,11 @@ def get_python_lib(plat_specific=0, stan
+         prefix = plat_specific and EXEC_PREFIX or PREFIX
+ 
+     if os.name == "posix":
+-        libpython = os.path.join(prefix,
+-                                 "lib", "python" + get_python_version())
++        if plat_specific or standard_lib:
++            lib = sys.lib
++        else:
++            lib = "lib"
++        libpython = os.path.join(prefix, lib, "python" + get_python_version())
+         if standard_lib:
+             return libpython
+         else:
+Index: Python-2.7.9/Lib/pydoc.py
+===================================================================
+--- Python-2.7.9.orig/Lib/pydoc.py
++++ Python-2.7.9/Lib/pydoc.py
+@@ -383,7 +383,7 @@ class Doc:
+ 
+         docloc = os.environ.get("PYTHONDOCS",
+                                 "http://docs.python.org/library")
+-        basedir = os.path.join(sys.exec_prefix, "lib",
++        basedir = os.path.join(sys.exec_prefix, sys.lib,
+                                "python"+sys.version[0:3])
+         if (isinstance(object, type(os)) and
+             (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
+Index: Python-2.7.9/Lib/site.py
+===================================================================
+--- Python-2.7.9.orig/Lib/site.py
++++ Python-2.7.9/Lib/site.py
+@@ -288,13 +288,18 @@ def getsitepackages():
+         if sys.platform in ('os2emx', 'riscos'):
+             sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
+         elif os.sep == '/':
+-            sitepackages.append(os.path.join(prefix, "lib",
++            sitepackages.append(os.path.join(prefix, sys.lib,
+                                         "python" + sys.version[:3],
+                                         "site-packages"))
+-            sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++            sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
++            if sys.lib != "lib":
++                sitepackages.append(os.path.join(prefix, "lib",
++                                            "python" + sys.version[:3],
++                                            "site-packages"))
++                sitepackages.append(os.path.join(prefix, "lib", "site-python"))
+         else:
+             sitepackages.append(prefix)
+-            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++            sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
+         if sys.platform == "darwin":
+             # for framework builds *only* we add the standard Apple
+             # locations.
+Index: Python-2.7.9/Lib/sysconfig.py
+===================================================================
+--- Python-2.7.9.orig/Lib/sysconfig.py
++++ Python-2.7.9/Lib/sysconfig.py
+@@ -7,10 +7,10 @@ from os.path import pardir, realpath
+ 
+ _INSTALL_SCHEMES = {
+     'posix_prefix': {
+-        'stdlib': '{base}/lib/python{py_version_short}',
+-        'platstdlib': '{platbase}/lib/python{py_version_short}',
++        'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
++        'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+         'purelib': '{base}/lib/python{py_version_short}/site-packages',
+-        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
++        'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'include': '{base}/include/python{py_version_short}',
+         'platinclude': '{platbase}/include/python{py_version_short}',
+         'scripts': '{base}/bin',
+@@ -65,10 +65,10 @@ _INSTALL_SCHEMES = {
+         'data'   : '{userbase}',
+         },
+     'posix_user': {
+-        'stdlib': '{userbase}/lib/python{py_version_short}',
+-        'platstdlib': '{userbase}/lib/python{py_version_short}',
++        'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
++        'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+         'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+-        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
++        'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'include': '{userbase}/include/python{py_version_short}',
+         'scripts': '{userbase}/bin',
+         'data'   : '{userbase}',
+Index: Python-2.7.9/Lib/test/test_dl.py
+===================================================================
+--- Python-2.7.9.orig/Lib/test/test_dl.py
++++ Python-2.7.9/Lib/test/test_dl.py
+@@ -4,10 +4,11 @@
+ import unittest
+ from test.test_support import verbose, import_module
+ dl = import_module('dl', deprecated=True)
++import sys
+ 
+ sharedlibs = [
+-    ('/usr/lib/libc.so', 'getpid'),
+-    ('/lib/libc.so.6', 'getpid'),
++    ('/usr/'+sys.lib+'/libc.so', 'getpid'),
++    ('/'+sys.lib+'/libc.so.6', 'getpid'),
+     ('/usr/bin/cygwin1.dll', 'getpid'),
+     ('/usr/lib/libc.dylib', 'getpid'),
+     ]
+Index: Python-2.7.9/Lib/test/test_site.py
+===================================================================
+--- Python-2.7.9.orig/Lib/test/test_site.py
++++ Python-2.7.9/Lib/test/test_site.py
+@@ -241,12 +241,16 @@ class HelperFunctionsTests(unittest.Test
+             self.assertEqual(dirs[2], wanted)
+         elif os.sep == '/':
+             # OS X non-framwework builds, Linux, FreeBSD, etc
+-            self.assertEqual(len(dirs), 2)
+             wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
+                                   'site-packages')
+-            self.assertEqual(dirs[0], wanted)
++            self.assertTrue(wanted in dirs)
+             wanted = os.path.join('xoxo', 'lib', 'site-python')
+-            self.assertEqual(dirs[1], wanted)
++            self.assertTrue(wanted in dirs)
++            wanted = os.path.join('xoxo', sys.lib, 'python' + sys.version[:3],
++                                  'site-packages')
++            self.assertTrue(wanted in dirs)
++            wanted = os.path.join('xoxo', sys.lib, 'site-python')
++            self.assertTrue(wanted in dirs)
+         else:
+             # other platforms
+             self.assertEqual(len(dirs), 2)
+Index: Python-2.7.9/Lib/trace.py
+===================================================================
+--- Python-2.7.9.orig/Lib/trace.py
++++ Python-2.7.9/Lib/trace.py
+@@ -754,10 +754,10 @@ def main(argv=None):
+                 # should I also call expanduser? (after all, could use $HOME)
+ 
+                 s = s.replace("$prefix",
+-                              os.path.join(sys.prefix, "lib",
++                              os.path.join(sys.prefix, sys.lib,
+                                            "python" + sys.version[:3]))
+                 s = s.replace("$exec_prefix",
+-                              os.path.join(sys.exec_prefix, "lib",
++                              os.path.join(sys.exec_prefix, sys.lib,
+                                            "python" + sys.version[:3]))
+                 s = os.path.normpath(s)
+                 ignore_dirs.append(s)
+Index: Python-2.7.9/Makefile.pre.in
+===================================================================
+--- Python-2.7.9.orig/Makefile.pre.in
++++ Python-2.7.9/Makefile.pre.in
+@@ -87,6 +87,7 @@ PY_CFLAGS=	$(CFLAGS) $(CPPFLAGS) $(CFLAG
+ 
+ # Machine-dependent subdirectories
+ MACHDEP=	@MACHDEP@
++LIB=		@LIB@
+ 
+ # Multiarch directory (may be empty)
+ MULTIARCH=	@MULTIARCH@
+@@ -106,7 +107,7 @@ LIBDIR=		@libdir@
+ MANDIR=		@mandir@
+ INCLUDEDIR=	@includedir@
+ CONFINCLUDEDIR=	$(exec_prefix)/include
+-SCRIPTDIR=	$(prefix)/lib
++SCRIPTDIR=	$(prefix)/@LIB@
+ 
+ # Detailed destination directories
+ BINLIBDEST=	$(LIBDIR)/python$(VERSION)
+@@ -598,6 +599,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ 		-DEXEC_PREFIX='"$(exec_prefix)"' \
+ 		-DVERSION='"$(VERSION)"' \
+ 		-DVPATH='"$(VPATH)"' \
++		-DLIB='"$(LIB)"' \
+ 		-o $@ $(srcdir)/Modules/getpath.c
+ 
+ Modules/python.o: $(srcdir)/Modules/python.c
+@@ -640,7 +642,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES)
+ Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
+ 
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+-		$(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++		$(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+ 
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ 		$(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-2.7.9/Modules/getpath.c
+===================================================================
+--- Python-2.7.9.orig/Modules/getpath.c
++++ Python-2.7.9/Modules/getpath.c
+@@ -116,9 +116,11 @@
+ #define EXEC_PREFIX PREFIX
+ #endif
+ 
++#define LIB_PYTHON LIB "/python" VERSION
++
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+-              EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++              EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+ #endif
+ 
+ #ifndef LANDMARK
+@@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1];
+ static char exec_prefix[MAXPATHLEN+1];
+ static char progpath[MAXPATHLEN+1];
+ static char *module_search_path = NULL;
+-static char lib_python[] = "lib/python" VERSION;
++static char lib_python[] = LIB_PYTHON;
+ 
+ static void
+ reduce(char *dir)
+Index: Python-2.7.9/Python/getplatform.c
+===================================================================
+--- Python-2.7.9.orig/Python/getplatform.c
++++ Python-2.7.9/Python/getplatform.c
+@@ -10,3 +10,13 @@ Py_GetPlatform(void)
+ {
+ 	return PLATFORM;
+ }
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++	return LIB;
++}
+Index: Python-2.7.9/Python/sysmodule.c
+===================================================================
+--- Python-2.7.9.orig/Python/sysmodule.c
++++ Python-2.7.9/Python/sysmodule.c
+@@ -1437,6 +1437,8 @@ _PySys_Init(void)
+                         PyString_FromString(Py_GetCopyright()));
+     SET_SYS_FROM_STRING("platform",
+                         PyString_FromString(Py_GetPlatform()));
++    SET_SYS_FROM_STRING("lib",
++                        PyString_FromString(Py_GetLib()));
+     SET_SYS_FROM_STRING("executable",
+                         PyString_FromString(Py_GetProgramFullPath()));
+     SET_SYS_FROM_STRING("prefix",
diff --git a/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch b/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
new file mode 100644
index 0000000..951cb46
--- /dev/null
+++ b/meta/recipes-devtools/python/python/parallel-makeinst-create-bindir.patch
@@ -0,0 +1,19 @@
+When using make -j with the 'install' target, it's possible for altbininstall
+(which normally creates BINDIR) and libainstall (which doesn't, though it
+installs python-config there) to race, resulting in a failure due to
+attempting to install python-config into a nonexistent BINDIR. Ensure it also
+exists in the libainstall target.
+
+Upstream-Status: Pending
+
+--- Python-2.7.3.orig/Makefile.pre.in
++++ Python-2.7.3/Makefile.pre.in
+@@ -1008,7 +1008,7 @@ LIBPL=		$(LIBP)/config
+ LIBPC=		$(LIBDIR)/pkgconfig
+
+ libainstall:	all python-config
+-	@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \
++	@for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC) $(BINDIR); \
+	do \
+		if test ! -d $(DESTDIR)$$i; then \
+			echo "Creating directory $$i"; \
diff --git a/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch b/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
new file mode 100644
index 0000000..216be0a
--- /dev/null
+++ b/meta/recipes-devtools/python/python/python-2.7.3-remove-bsdb-rpath.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Remove the RPATH to avoid QA issue warning.
+
+RP: Added secondary unnecessary rpath to the list 2012/8/7
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+
+Index: Python-2.7.3/setup.py
+===================================================================
+--- Python-2.7.3.orig/setup.py	2012-08-07 10:41:58.560132529 +0000
++++ Python-2.7.3/setup.py	2012-08-07 11:09:47.852094515 +0000
+@@ -1042,7 +1042,6 @@
+             exts.append(Extension('_bsddb', ['_bsddb.c'],
+                                   depends = ['bsddb.h'],
+                                   library_dirs=dblib_dir,
+-                                  runtime_library_dirs=dblib_dir,
+                                   include_dirs=db_incs,
+                                   libraries=dblibs))
+         else:
+@@ -1252,7 +1251,6 @@
+                         print "building dbm using bdb"
+                         dbmext = Extension('dbm', ['dbmmodule.c'],
+                                            library_dirs=dblib_dir,
+-                                           runtime_library_dirs=dblib_dir,
+                                            include_dirs=db_incs,
+                                            define_macros=[
+                                                ('HAVE_BERKDB_H', None),
diff --git a/meta/recipes-devtools/python/python/run-ptest b/meta/recipes-devtools/python/python/run-ptest
new file mode 100644
index 0000000..a2f9eed
--- /dev/null
+++ b/meta/recipes-devtools/python/python/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+#
+#This script is used to run python test suites
+
+make -f LIBDIR/python/ptest/Makefile -k runtest-TESTS srcdir=LIBDIR/python2.7 TESTPROG=LIBDIR/python2.7/test/regrtest.py | sed -e '/\.\.\. ok/ s/^/PASS: /g' -e '/\.\.\. [ERROR|FAIL]/ s/^/FAIL: /g' -e '/\.\.\. skipped/ s/^/SKIP: /g' -e 's/ \.\.\. ok//g' -e 's/ \.\.\. ERROR//g' -e 's/ \.\.\. FAIL//g' -e 's/ \.\.\. skipped//g'
diff --git a/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch b/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
new file mode 100644
index 0000000..dacb552
--- /dev/null
+++ b/meta/recipes-devtools/python/python/search_db_h_in_inc_dirs_and_avoid_warning.patch
@@ -0,0 +1,35 @@
+python should search for db.h in inc_dirs and not in a hardcoded path.
+If db.h is found but HASHVERSION is not 2 we avoid a warning by not 
+adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+
+diff --git a/setup.py b/setup.py
+index b887808..ae51607 100644
+--- a/setup.py
++++ b/setup.py
+@@ -1237,6 +1237,8 @@ class PyBuildExt(build_ext):
+         # the more recent berkeleydb's db.h file first in the include path
+         # when attempting to compile and it will fail.
+         f = "/usr/include/db.h"
++        if len(inc_dirs) != 0:
++            f = os.path.join(inc_dirs[0], "db.h")
+ 
+         if host_platform == 'darwin':
+             if is_macosx_sdk_path(f):
+@@ -1257,8 +1259,10 @@ class PyBuildExt(build_ext):
+                                           libraries=libraries))
+                 else:
+                     exts.append(Extension('bsddb185', ['bsddbmodule.c']))
+-            else:
+-                missing.append('bsddb185')
++            # If a newer version is detected don't report an useless
++            # warning
++            #else:
++            #    missing.append('bsddb185')
+         else:
+             missing.append('bsddb185')
+ 
diff --git a/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch b/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
new file mode 100644
index 0000000..6ccdb94
--- /dev/null
+++ b/meta/recipes-devtools/python/python/setup_py_skip_cross_import_check.patch
@@ -0,0 +1,27 @@
+This patch skips over the 'import check' setup.py does when building
+extensions.  This generally won't work when cross-compiling.
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py	2011-11-04 16:46:34.553796410 -0500
++++ Python-2.7.2/setup.py	2011-11-04 16:59:49.692802313 -0500
+@@ -287,6 +287,15 @@
+                           (ext.name, sys.exc_info()[1]))
+             self.failed.append(ext.name)
+             return
++
++        # If we're cross-compiling, we want to skip the import check
++        # i.e. we shouldn't be dynamically loading target shared libs
++        if os.environ.get('CROSS_COMPILE') is not None:
++            self.announce(
++                'WARNING: skipping import check for cross-compiled "%s"' %
++                ext.name)
++            return
++
+         # Workaround for Mac OS X: The Carbon-based modules cannot be
+         # reliably imported into a command-line Python
+         if 'Carbon' in ext.extra_link_args:
diff --git a/meta/recipes-devtools/python/python/setuptweaks.patch b/meta/recipes-devtools/python/python/setuptweaks.patch
new file mode 100644
index 0000000..3a91b19
--- /dev/null
+++ b/meta/recipes-devtools/python/python/setuptweaks.patch
@@ -0,0 +1,57 @@
+This patch removes various ways native system options can pass into the python 
+compilation and somehow break C modules.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2012/04/23
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py	2012-04-23 20:03:47.295582553 +0000
++++ Python-2.7.2/setup.py	2012-04-23 20:03:15.000000000 +0000
+@@ -231,7 +231,13 @@
+         # compilers
+         if compiler is not None:
+             (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+-            args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
++            # Need to filter out -isysroot from the flags. Ideally should 
++            # figure out target flags here.
++            flags = []
++            for f in cflags.split():
++                if not f.startswith("-isystem"):
++                    flags.append(f)
++            args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
+         self.compiler.set_executables(**args)
+ 
+         build_ext.build_extensions(self)
+@@ -393,7 +399,6 @@
+         # into configure and stored in the Makefile (issue found on OS X 10.3).
+         for env_var, arg_name, dir_list in (
+                 ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+-                ('LDFLAGS', '-L', self.compiler.library_dirs),
+                 ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+             env_val = sysconfig.get_config_var(env_var)
+             if env_val:
+@@ -419,16 +424,16 @@
+                     for directory in reversed(options.dirs):
+                         add_dir_to_list(dir_list, directory)
+ 
+-        if os.path.normpath(sys.prefix) != '/usr' \
+-                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++#        if os.path.normpath(sys.prefix) != '/usr' \
++#                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+             # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+             # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+             # building a framework with different architectures than
+             # the one that is currently installed (issue #7473)
+-            add_dir_to_list(self.compiler.library_dirs,
+-                            sysconfig.get_config_var("LIBDIR"))
+-            add_dir_to_list(self.compiler.include_dirs,
+-                            sysconfig.get_config_var("INCLUDEDIR"))
++#            add_dir_to_list(self.compiler.library_dirs,
++#                            sysconfig.get_config_var("LIBDIR"))
++#            add_dir_to_list(self.compiler.include_dirs,
++#                            sysconfig.get_config_var("INCLUDEDIR"))
+ 
+         try:
+             have_unicode = unicode
diff --git a/meta/recipes-devtools/python/python/sitecustomize.py b/meta/recipes-devtools/python/python/sitecustomize.py
new file mode 100644
index 0000000..2739018
--- /dev/null
+++ b/meta/recipes-devtools/python/python/sitecustomize.py
@@ -0,0 +1,45 @@
+# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# GPLv2 or later
+# Version: 20081123
+# Features:
+# * set proper default encoding
+# * enable readline completion in the interactive interpreter
+# * load command line history on startup
+# * save command line history on exit 
+
+import os
+
+def __exithandler():
+    try:
+        readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+    except IOError:
+        pass
+
+def __registerExitHandler():
+    import atexit
+    atexit.register( __exithandler )
+
+def __enableReadlineSupport():
+    readline.set_history_length( 1000 )
+    readline.parse_and_bind( "tab: complete" )
+    try:
+        readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+    except IOError:
+        pass
+
+def __enableDefaultEncoding():
+    import sys
+    try:
+        sys.setdefaultencoding( "utf8" )
+    except LookupError:
+        pass
+
+import sys
+try:
+    import rlcompleter, readline
+except ImportError:
+    pass
+else:
+    __enableDefaultEncoding()
+    __registerExitHandler()
+    __enableReadlineSupport()
diff --git a/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch b/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
new file mode 100644
index 0000000..2c65786
--- /dev/null
+++ b/meta/recipes-devtools/python/python/use_sysroot_ncurses_instead_of_host.patch
@@ -0,0 +1,20 @@
+Python tries to use ncursesw from the host,
+if it is not found causes an error on configure,
+we should use ncursesw from sysroot instead
+
+
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-2.7.9/configure.ac
+===================================================================
+--- Python-2.7.9.orig/configure.ac
++++ Python-2.7.9/configure.ac
+@@ -4311,7 +4311,7 @@ fi
+ 
+ # first curses configure check
+ ac_save_cppflags="$CPPFLAGS"
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
+ 
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+ 
diff --git a/meta/recipes-devtools/python/python3-native_3.4.3.bb b/meta/recipes-devtools/python/python3-native_3.4.3.bb
new file mode 100644
index 0000000..464ff05
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-native_3.4.3.bb
@@ -0,0 +1,76 @@
+require recipes-devtools/python/python.inc
+
+PR = "${INC_PR}.0"
+PYTHON_MAJMIN = "3.4"
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
+file://12-distutils-prefix-is-inside-staging-area.patch \
+file://python-config.patch \
+file://000-cross-compile.patch \
+file://020-dont-compile-python-files.patch \
+file://030-fixup-include-dirs.patch \
+file://070-dont-clean-ipkg-install.patch \
+file://080-distutils-dont_adjust_files.patch \
+file://110-enable-zlib.patch \
+file://130-readline-setup.patch \
+file://150-fix-setupterm.patch \
+file://python-3.3-multilib.patch \
+file://03-fix-tkinter-detection.patch \
+file://avoid_warning_about_tkinter.patch \
+file://shutil-follow-symlink-fix.patch \
+file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
+file://sysroot-include-headers.patch \
+file://unixccompiler.patch \
+file://makerace.patch \
+${DISTRO_SRC_URI} \
+file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \
+file://setup.py-check-cross_compiling-when-get-FLAGS.patch \
+"
+SRC_URI[md5sum] = "7d092d1bba6e17f0d9bd21b49e441dd5"
+SRC_URI[sha256sum] = "b5b3963533768d5fc325a4d7a6bd6f666726002d696f1d399ec06b043ea996b8"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dd98d01d471fac8d8dbdd975229dba03"
+
+S = "${WORKDIR}/Python-${PV}"
+
+EXTRANATIVEPATH += "bzip2-native"
+DEPENDS = "openssl-native bzip2-replacement-native zlib-native readline-native sqlite3-native"
+
+inherit native
+
+RPROVIDES += "python3-distutils-native python3-compression-native python3-textutils-native python3-core-native"
+
+EXTRA_OECONF_append = " --bindir=${bindir}/${PN} --without-ensurepip"
+
+EXTRA_OEMAKE = '\
+  BUILD_SYS="" \
+  HOST_SYS="" \
+  LIBC="" \
+  STAGING_LIBDIR=${STAGING_LIBDIR_NATIVE} \
+  STAGING_INCDIR=${STAGING_INCDIR_NATIVE} \
+  LIB=${baselib} \
+  ARCH=${TARGET_ARCH} \
+'
+
+# No ctypes option for python 3
+PYTHONLSBOPTS = ""
+
+do_configure_append() {
+	autoreconf --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_install() {
+	install -d ${D}${libdir}/pkgconfig
+	oe_runmake 'DESTDIR=${D}' install
+	if [ -e ${WORKDIR}/sitecustomize.py ]; then
+		install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+	fi
+	install -d ${D}${bindir}/${PN}
+	install -m 0755 Parser/pgen ${D}${bindir}/${PN}
+
+	# Make sure we use /usr/bin/env python
+	for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
+		sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
+	done
+}
diff --git a/meta/recipes-devtools/python/python3-pip_6.1.1.bb b/meta/recipes-devtools/python/python3-pip_6.1.1.bb
new file mode 100644
index 0000000..7bfc30e
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-pip_6.1.1.bb
@@ -0,0 +1,40 @@
+SUMMARY = "The PyPA recommended tool for installing Python packages"
+sHOMEPAGEsss = "https://pypi.python.org/pypi/pip"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=45665b53032c02b35e29ddab8e61fa91"
+
+SRCNAME = "pip"
+DEPENDS += "python3 python3-setuptools-native"
+
+SRC_URI = " \
+  http://pypi.python.org/packages/source/p/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
+"
+SRC_URI[md5sum] = "6b19e0a934d982a5a4b798e957cb6d45"
+SRC_URI[sha256sum] = "89f3b626d225e08e7f20d85044afa40f612eb3284484169813dc2d0631f2a556"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils3
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+
+do_install_prepend() {
+    install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
+}
+
+# Use setuptools site.py instead, avoid shared state issue
+do_install_append() {
+    rm ${D}/${libdir}/${PYTHON_DIR}/site-packages/site.py
+    rm ${D}/${libdir}/${PYTHON_DIR}/site-packages/__pycache__/site.cpython-34.pyc
+}
+
+RDEPENDS_${PN} = "\
+  python3-compile \
+  python3-io \
+  python3-json \
+  python3-netserver \
+  python3-setuptools \
+  python3-unixadmin \
+  python3-xmlrpc \
+"
diff --git a/meta/recipes-devtools/python/python3-setuptools_18.2.bb b/meta/recipes-devtools/python/python3-setuptools_18.2.bb
new file mode 100644
index 0000000..dc0ac80
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-setuptools_18.2.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Download, build, install, upgrade, and uninstall Python packages"
+HOMEPAGE = "http://packages.python.org/setuptools"
+SECTION = "devel/python"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://setup.py;beginline=78;endline=78;md5=8a314270dd7a8dbca741775415f1716e"
+
+SRCNAME = "setuptools"
+DEPENDS += "python3"
+DEPENDS_class-native += "python3-native"
+
+SRC_URI = " \
+  http://pypi.python.org/packages/source/s/${SRCNAME}/${SRCNAME}-${PV}.tar.gz \
+"
+SRC_URI[md5sum] = "52b4e48939ef311d7204f8fe940764f4"
+SRC_URI[sha256sum] = "0994a58df27ea5dc523782a601357a2198b7493dcc99a30d51827a23585b5b1d"
+
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils3
+
+DISTUTILS_INSTALL_ARGS += "--install-lib=${D}${libdir}/${PYTHON_DIR}/site-packages"
+
+do_install_prepend() {
+    install -d ${D}/${libdir}/${PYTHON_DIR}/site-packages
+}
+#
+#  The installer puts the wrong path in the setuptools.pth file.  Correct it.
+#
+do_install_append() {
+    rm ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
+    mv ${D}${bindir}/easy_install ${D}${bindir}/easy3_install
+    echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
+}
+
+RDEPENDS_${PN} = "\
+  python3-distutils \
+  python3-compression \
+"
+RDEPENDS_${PN}_class-target = "\
+  python3-ctypes \
+  python3-distutils \
+  python3-email \
+  python3-importlib \
+  python3-numbers \
+  python3-compression \
+  python3-shell \
+  python3-subprocess \
+  python3-textutils \
+  python3-pkgutil \
+  python3-threading \
+  python3-misc \
+  python3-unittest \
+  python3-xml \
+"
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/python/python3/000-cross-compile.patch b/meta/recipes-devtools/python/python3/000-cross-compile.patch
new file mode 100644
index 0000000..2506a59
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/000-cross-compile.patch
@@ -0,0 +1,83 @@
+We cross compile python. This patch uses tools from host/native
+python instead of in-tree tools
+
+-Khem
+
+Upstream-Status: Inappropriate[Configuration Specific]
+
+---
+ Makefile.pre.in |   25 +++++++++++++------------
+ 1 file changed, 13 insertions(+), 12 deletions(-)
+
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -193,6 +193,7 @@ LIBOBJS=	@LIBOBJS@
+ 
+ PYTHON=		python$(EXE)
+ BUILDPYTHON=	python$(BUILDEXE)
++HOSTPYTHON=	$(BUILDPYTHON)
+ 
+ PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
+ _PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
+@@ -239,6 +240,7 @@ LIBFFI_INCLUDEDIR=	@LIBFFI_INCLUDEDIR@
+ ##########################################################################
+ # Parser
+ PGEN=		Parser/pgen$(EXE)
++HOSTPGEN=	$(PGEN)$(EXE)
+ 
+ PSRCS=		\
+ 		Parser/acceler.c \
+@@ -451,7 +453,7 @@ build_all_generate_profile:
+ 
+ run_profile_task:
+ 	: # FIXME: can't run for a cross build
+-	$(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
++	$(RUNSHARED) $(HOSTPYTHON) $(PROFILE_TASK)
+ 
+ build_all_use_profile:
+ 	$(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction"
+@@ -640,7 +642,7 @@ $(IO_OBJS): $(IO_H)
+ $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
+ 		@$(MKDIR_P) Include
+ 		$(MAKE) $(PGEN)
+-		$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
++		$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
+ 		$(MAKE) $(GRAMMAR_H)
+ 		touch $(GRAMMAR_C)
+@@ -820,7 +822,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
+ ######################################################################
+ 
+ TESTOPTS=	$(EXTRATESTOPTS)
+-TESTPYTHON=	$(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
++TESTPYTHON=	$(RUNSHARED) $(HOSTPYTHON) $(TESTPYTHONOPTS)
+ TESTRUNNER=	$(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
+ TESTTIMEOUT=	3600
+ 
+@@ -1229,7 +1231,7 @@ frameworkinstallstructure:	$(LDLIBRARY)
+ 		fi; \
+ 	done
+ 	$(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
+-	sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
++	sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
+ 	$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
+ 	$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
+ 	$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
+@@ -1288,7 +1290,7 @@ config.status:	$(srcdir)/configure
+ 
+ # Run reindent on the library
+ reindent:
+-	./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
++	$(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
+ 
+ # Rerun configure with the same options as it was run last time,
+ # provided the config.status script exists
+@@ -1414,7 +1416,7 @@ funny:
+ 
+ # Perform some verification checks on any modified files.
+ patchcheck:
+-	$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
++	$(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
+ 
+ # Dependencies
+ 
diff --git a/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch b/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
new file mode 100644
index 0000000..dd6b24f
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch
@@ -0,0 +1,37 @@
+From 2f5a4c708d90fa8db21f446ae879cff79387448d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 20 May 2013 21:03:16 -0700
+Subject: [PATCH] h2py: Fix issue 13032 where it fails with UnicodeDecodeError
+
+use utf-8 to open the files
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ Tools/scripts/h2py.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py
+index 4f871d9..a53fbe0 100755
+--- a/Tools/scripts/h2py.py
++++ b/Tools/scripts/h2py.py
+@@ -69,13 +69,13 @@ def main():
+             sys.stdout.write('# Generated by h2py from stdin\n')
+             process(sys.stdin, sys.stdout)
+         else:
+-            fp = open(filename, 'r')
++            fp = open(filename, 'r', encoding='utf-8')
+             outfile = os.path.basename(filename)
+             i = outfile.rfind('.')
+             if i > 0: outfile = outfile[:i]
+             modname = outfile.upper()
+             outfile = modname + '.py'
+-            outfp = open(outfile, 'w')
++            outfp = open(outfile, 'w', encoding='utf-8')
+             outfp.write('# Generated by h2py from %s\n' % filename)
+             filedict = {}
+             for dir in searchdirs:
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch b/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
new file mode 100644
index 0000000..03ef286
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/020-dont-compile-python-files.patch
@@ -0,0 +1,37 @@
+Dont cross compile site packages
+
+-Khem
+
+Upstream-Status: Inappropriate[Embedded-Specific]
+
+---
+ Makefile.pre.in |   16 ----------------
+ 1 file changed, 16 deletions(-)
+
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1078,24 +1078,6 @@ libinstall:	build_all $(srcdir)/Lib/$(PL
+ 		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ 			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ 	fi
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
+-		$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+-		-d $(LIBDEST) -f \
+-		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+-		$(DESTDIR)$(LIBDEST)
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-		$(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+-		-d $(LIBDEST) -f \
+-		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
+-		$(DESTDIR)$(LIBDEST)
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
+-		$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
+-		-d $(LIBDEST)/site-packages -f \
+-		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+-		$(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
+-		-d $(LIBDEST)/site-packages -f \
+-		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
+ 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ 		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+ 	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
diff --git a/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch b/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
new file mode 100644
index 0000000..fddfd2b
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/03-fix-tkinter-detection.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+# We need to supply STAGING_INCDIR here, otherwise the Tk headers
+# will not be found.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille.de>
+
+Index: Python-3.3.0rc2/setup.py
+===================================================================
+--- Python-3.3.0rc2.orig/setup.py	2012-09-20 15:24:14.009124003 -0700
++++ Python-3.3.0rc2/setup.py	2012-09-20 15:25:08.449124963 -0700
+@@ -1620,7 +1620,7 @@
+                 dotversion = dotversion[:-1] + '.' + dotversion[-1]
+             tcl_include_sub = []
+             tk_include_sub = []
+-            for dir in inc_dirs:
++            for dir in [os.getenv("STAGING_INCDIR")]:
+                 tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
+                 tk_include_sub += [dir + os.sep + "tk" + dotversion]
+             tk_include_sub += tcl_include_sub
+@@ -1639,22 +1639,6 @@
+             if dir not in include_dirs:
+                 include_dirs.append(dir)
+ 
+-        # Check for various platform-specific directories
+-        if host_platform == 'sunos5':
+-            include_dirs.append('/usr/openwin/include')
+-            added_lib_dirs.append('/usr/openwin/lib')
+-        elif os.path.exists('/usr/X11R6/include'):
+-            include_dirs.append('/usr/X11R6/include')
+-            added_lib_dirs.append('/usr/X11R6/lib64')
+-            added_lib_dirs.append('/usr/X11R6/lib')
+-        elif os.path.exists('/usr/X11R5/include'):
+-            include_dirs.append('/usr/X11R5/include')
+-            added_lib_dirs.append('/usr/X11R5/lib')
+-        else:
+-            # Assume default location for X11
+-            include_dirs.append('/usr/X11/include')
+-            added_lib_dirs.append('/usr/X11/lib')
+-
+         # If Cygwin, then verify that X is installed before proceeding
+         if host_platform == 'cygwin':
+             x11_inc = find_file('X11/Xlib.h', [], include_dirs)
diff --git a/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch b/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
new file mode 100644
index 0000000..6beac7b
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/030-fixup-include-dirs.patch
@@ -0,0 +1,33 @@
+Do not hardcode /usr into include paths when cross compiling
+
+-Khem
+
+Upstream-Status: Pending
+ 
+---
+ setup.py |   15 ++-------------
+ 1 file changed, 2 insertions(+), 13 deletions(-)
+
+Index: Python-3.3.2/setup.py
+===================================================================
+--- Python-3.3.2.orig/setup.py
++++ Python-3.3.2/setup.py
+@@ -444,7 +444,8 @@ class PyBuildExt(build_ext):
+         # only change this for cross builds for 3.3, issues on Mageia
+         if cross_compiling:
+             self.add_gcc_paths()
+-        self.add_multiarch_paths()
++        if not cross_compiling:
++            self.add_multiarch_paths()
+ 
+         # Add paths specified in the environment variables LDFLAGS and
+         # CPPFLAGS for header and library files.
+@@ -480,7 +481,7 @@ class PyBuildExt(build_ext):
+                     for directory in reversed(options.dirs):
+                         add_dir_to_list(dir_list, directory)
+ 
+-        if os.path.normpath(sys.base_prefix) != '/usr' \
++        if not cross_compiling and os.path.normpath(sys.base_prefix) != '/usr' \
+                 and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+             # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+             # (PYTHONFRAMEWORK is set) to avoid # linking problems when
diff --git a/meta/recipes-devtools/python/python3/04-default-is-optimized.patch b/meta/recipes-devtools/python/python3/04-default-is-optimized.patch
new file mode 100644
index 0000000..3b8f264
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/04-default-is-optimized.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+# when compiling for an embedded system, we need every bit of
+# performance we can get. default to optimized with the option
+# of opt-out.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+
+
+2012/05/01
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Rebased for 3.4.2 02/2015
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-3.4.2/Python/compile.c
+===================================================================
+--- Python-3.4.2.orig/Python/compile.c
++++ Python-3.4.2/Python/compile.c
+@@ -30,7 +30,7 @@
+ #include "symtable.h"
+ #include "opcode.h"
+ 
+-int Py_OptimizeFlag = 0;
++int Py_OptimizeFlag = 1;
+ 
+ #define DEFAULT_BLOCK_SIZE 16
+ #define DEFAULT_BLOCKS 8
+Index: Python-3.4.2/Modules/main.c
+===================================================================
+--- Python-3.4.2.orig/Modules/main.c
++++ Python-3.4.2/Modules/main.c
+@@ -38,7 +38,7 @@ static wchar_t **orig_argv;
+ static int  orig_argc;
+ 
+ /* command line options */
+-#define BASE_OPTS L"bBc:dEhiIJm:OqRsStuvVW:xX:?"
++#define BASE_OPTS L"bBc:dEhiIJm:NOqRsStuvVW:xX:?"
+ 
+ #define PROGRAM_OPTS BASE_OPTS
+ 
+@@ -64,6 +64,7 @@ static char *usage_2 = "\
+ -m mod : run library module as a script (terminates option list)\n\
+ -O     : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n\
+ -OO    : remove doc-strings in addition to the -O optimizations\n\
++-N     : do NOT optimize generated bytecode\n\
+ -q     : don't print version and copyright messages on interactive startup\n\
+ -s     : don't add user site directory to sys.path; also PYTHONNOUSERSITE\n\
+ -S     : don't imply 'import site' on initialization\n\
+@@ -418,8 +419,8 @@ Py_Main(int argc, wchar_t **argv)
+ 
+         /* case 'J': reserved for Jython */
+ 
+-        case 'O':
+-            Py_OptimizeFlag++;
++        case 'N':
++            Py_OptimizeFlag=0;
+             break;
+ 
+         case 'B':
diff --git a/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch b/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
new file mode 100644
index 0000000..789929b
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/070-dont-clean-ipkg-install.patch
@@ -0,0 +1,36 @@
+consider opkg directories when cleaning up
+
+-Khem
+
+Upstream-Status: Inappropriate [OE specific]
+
+---
+ Makefile.pre.in |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -1306,8 +1306,8 @@ touch:
+ # Sanitation targets -- clean leaves libraries, executables and tags
+ # files, which clobber removes as well
+ pycremoval:
+-	-find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
+-	-find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'
++	-find $(srcdir) ! -path './ipkg-install/*' -depth -name '__pycache__' -exec rm -rf {} ';'
++	-find $(srcdir) ! -path './ipkg-install/*' -name '*.py[co]' -exec rm -f {} ';'
+ 
+ rmtestturds:
+ 	-rm -f *BAD *GOOD *SKIPPED
+@@ -1321,9 +1321,9 @@ docclean:
+ 	-rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils
+ 
+ clean: pycremoval
+-	find . -name '*.[oa]' -exec rm -f {} ';'
+-	find . -name '*.s[ol]' -exec rm -f {} ';'
+-	find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
++	find . ! -path './ipkg-install/*' -name '*.[oa]' -exec rm -f {} ';'
++	find . ! -path './ipkg-install/*' -name '*.s[ol]' -exec rm -f {} ';'
++	find . ! -path './ipkg-install/*' -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
+ 	find build -name 'fficonfig.h' -exec rm -f {} ';' || true
+ 	find build -name 'fficonfig.py' -exec rm -f {} ';' || true
+ 	-rm -f Lib/lib2to3/*Grammar*.pickle
diff --git a/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch b/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
new file mode 100644
index 0000000..b96419a
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/080-distutils-dont_adjust_files.patch
@@ -0,0 +1,92 @@
+do not "adjust" python files before copying
+
+-Khem
+
+Upstream-Status: Inappropriate [Embedded-Specific]
+
+---
+ Lib/distutils/command/build_scripts.py |   43 +++------------------------------
+ 1 file changed, 4 insertions(+), 39 deletions(-)
+
+--- a/Lib/distutils/command/build_scripts.py
++++ b/Lib/distutils/command/build_scripts.py
+@@ -51,10 +51,7 @@ class build_scripts(Command):
+ 
+ 
+     def copy_scripts(self):
+-        """Copy each script listed in 'self.scripts'; if it's marked as a
+-        Python script in the Unix way (first line matches 'first_line_re',
+-        ie. starts with "\#!" and contains "python"), then adjust the first
+-        line to refer to the current Python interpreter as we copy.
++        """Copy each script listed in 'self.scripts'
+         """
+         self.mkpath(self.build_dir)
+         outfiles = []
+@@ -78,64 +75,10 @@ class build_scripts(Command):
+                 if not self.dry_run:
+                     raise
+                 f = None
+-            else:
+-                encoding, lines = tokenize.detect_encoding(f.readline)
+-                f.seek(0)
+-                first_line = f.readline()
+-                if not first_line:
+-                    self.warn("%s is an empty file (skipping)" % script)
+-                    continue
+-
+-                match = first_line_re.match(first_line)
+-                if match:
+-                    adjust = True
+-                    post_interp = match.group(1) or b''
+-
+-            if adjust:
+-                log.info("copying and adjusting %s -> %s", script,
+-                         self.build_dir)
+-                updated_files.append(outfile)
+-                if not self.dry_run:
+-                    if not sysconfig.python_build:
+-                        executable = self.executable
+-                    else:
+-                        executable = os.path.join(
+-                            sysconfig.get_config_var("BINDIR"),
+-                           "python%s%s" % (sysconfig.get_config_var("VERSION"),
+-                                           sysconfig.get_config_var("EXE")))
+-                    executable = os.fsencode(executable)
+-                    shebang = b"#!" + executable + post_interp + b"\n"
+-                    # Python parser starts to read a script using UTF-8 until
+-                    # it gets a #coding:xxx cookie. The shebang has to be the
+-                    # first line of a file, the #coding:xxx cookie cannot be
+-                    # written before. So the shebang has to be decodable from
+-                    # UTF-8.
+-                    try:
+-                        shebang.decode('utf-8')
+-                    except UnicodeDecodeError:
+-                        raise ValueError(
+-                            "The shebang ({!r}) is not decodable "
+-                            "from utf-8".format(shebang))
+-                    # If the script is encoded to a custom encoding (use a
+-                    # #coding:xxx cookie), the shebang has to be decodable from
+-                    # the script encoding too.
+-                    try:
+-                        shebang.decode(encoding)
+-                    except UnicodeDecodeError:
+-                        raise ValueError(
+-                            "The shebang ({!r}) is not decodable "
+-                            "from the script encoding ({})"
+-                            .format(shebang, encoding))
+-                    with open(outfile, "wb") as outf:
+-                        outf.write(shebang)
+-                        outf.writelines(f.readlines())
+-                if f:
+-                    f.close()
+-            else:
+-                if f:
++            if f:
+                     f.close()
+-                updated_files.append(outfile)
+-                self.copy_file(script, outfile)
++            updated_files.append(outfile)
++            self.copy_file(script, outfile)
+ 
+         if os.name == 'posix':
+             for file in outfiles:
diff --git a/meta/recipes-devtools/python/python3/110-enable-zlib.patch b/meta/recipes-devtools/python/python3/110-enable-zlib.patch
new file mode 100644
index 0000000..fb92a19
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/110-enable-zlib.patch
@@ -0,0 +1,21 @@
+Enable zlib in python
+
+-Khem
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+---
+ Modules/Setup.dist |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/Modules/Setup.dist
++++ b/Modules/Setup.dist
+@@ -354,7 +354,7 @@ _symtable symtablemodule.c
+ # Andrew Kuchling's zlib module.
+ # This require zlib 1.1.3 (or later).
+ # See http://www.gzip.org/zlib/
+-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
++zlib zlibmodule.c -lz
+ 
+ # Interface to the Expat XML parser
+ #
diff --git a/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 0000000..bf02df2
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,81 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+02/2015 Rebased for Python 3.4.2
+
+# The proper prefix is inside our staging area.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+# Signed-off-by: Phil Blundell <philb@gnu.org>
+# Signed-off-by: Khem Raj <raj.khem@gmail.com>
+# Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-3.4.2/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-3.4.2.orig/Lib/distutils/sysconfig.py
++++ Python-3.4.2/Lib/distutils/sysconfig.py
+@@ -16,10 +16,11 @@ import sys
+ from .errors import DistutilsPlatformError
+ 
+ # These are needed in a couple of spots, so just compute them once.
+-PREFIX = os.path.normpath(sys.prefix)
+-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
+-BASE_PREFIX = os.path.normpath(sys.base_prefix)
+-BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
++PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++BASE_PREFIX = os.path.normpath(sys.base_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++BASE_EXEC_PREFIX= os.path.normpath(sys.base_exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++
+ 
+ # Path to the base directory of the project. On Windows the binary may
+ # live in project/PCBuild9.  If we're dealing with an x64 Windows build,
+@@ -93,7 +94,9 @@ def get_python_inc(plat_specific=0, pref
+     If 'prefix' is supplied, use it instead of sys.base_prefix or
+     sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
+     """
+-    if prefix is None:
++    if prefix is None and os.environ['STAGING_INCDIR'] != "":
++        prefix = os.environ['STAGING_INCDIR'].rstrip('include')
++    elif prefix is None:
+         prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
+     if os.name == "posix":
+         if python_build:
+@@ -134,6 +137,12 @@ def get_python_lib(plat_specific=0, stan
+     If 'prefix' is supplied, use it instead of sys.base_prefix or
+     sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
+     """
++    if prefix is None and os.environ['STAGING_LIBDIR'] != "":
++        lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1]
++        prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename)
++    else:
++        lib_basename = sys.lib
++
+     if prefix is None:
+         if standard_lib:
+             prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
+@@ -142,7 +151,7 @@ def get_python_lib(plat_specific=0, stan
+ 
+     if os.name == "posix":
+         libpython = os.path.join(prefix,
+-                                 "lib", "python" + get_python_version())
++                                 lib_basename, "python" + get_python_version())
+         if standard_lib:
+             return libpython
+         else:
+@@ -242,7 +251,7 @@ def get_config_h_filename():
+     else:
+         inc_dir = get_python_inc(plat_specific=1)
+ 
+-    return os.path.join(inc_dir, 'pyconfig.h')
++    return os.path.join(inc_dir, 'pyconfig.h'.replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ))
+ 
+ 
+ def get_makefile_filename():
+@@ -251,7 +260,7 @@ def get_makefile_filename():
+         return os.path.join(_sys_home or project_base, "Makefile")
+     lib_dir = get_python_lib(plat_specific=0, standard_lib=1)
+     config_file = 'config-{}{}'.format(get_python_version(), build_flags)
+-    return os.path.join(lib_dir, config_file, 'Makefile')
++    return os.path.join(lib_dir, config_file, 'Makefile').replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+ 
+ 
+ def parse_config_h(fp, g=None):
diff --git a/meta/recipes-devtools/python/python3/130-readline-setup.patch b/meta/recipes-devtools/python/python3/130-readline-setup.patch
new file mode 100644
index 0000000..c805652
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/130-readline-setup.patch
@@ -0,0 +1,55 @@
+package python-readline
+
+-Khem
+
+Upstream-Status: Inappropriate [Embedded Specific]
+
+--- a/setup.py
++++ b/setup.py
+@@ -666,45 +666,7 @@ class PyBuildExt(build_ext):
+         # readline
+         do_readline = self.compiler.find_library_file(lib_dirs, 'readline')
+         readline_termcap_library = ""
+-        curses_library = ""
+-        # Cannot use os.popen here in py3k.
+-        tmpfile = os.path.join(self.build_temp, 'readline_termcap_lib')
+-        if not os.path.exists(self.build_temp):
+-            os.makedirs(self.build_temp)
+-        # Determine if readline is already linked against curses or tinfo.
+-        if do_readline:
+-            if cross_compiling:
+-                ret = os.system("%s -d %s | grep '(NEEDED)' > %s" \
+-                                % (sysconfig.get_config_var('READELF'),
+-                                   do_readline, tmpfile))
+-            elif find_executable('ldd'):
+-                ret = os.system("ldd %s > %s" % (do_readline, tmpfile))
+-            else:
+-                ret = 256
+-            if ret >> 8 == 0:
+-                with open(tmpfile) as fp:
+-                    for ln in fp:
+-                        if 'curses' in ln:
+-                            readline_termcap_library = re.sub(
+-                                r'.*lib(n?cursesw?)\.so.*', r'\1', ln
+-                            ).rstrip()
+-                            break
+-                        # termcap interface split out from ncurses
+-                        if 'tinfo' in ln:
+-                            readline_termcap_library = 'tinfo'
+-                            break
+-            if os.path.exists(tmpfile):
+-                os.unlink(tmpfile)
+-        # Issue 7384: If readline is already linked against curses,
+-        # use the same library for the readline and curses modules.
+-        if 'curses' in readline_termcap_library:
+-            curses_library = readline_termcap_library
+-        elif self.compiler.find_library_file(lib_dirs, 'ncursesw'):
+-            curses_library = 'ncursesw'
+-        elif self.compiler.find_library_file(lib_dirs, 'ncurses'):
+-            curses_library = 'ncurses'
+-        elif self.compiler.find_library_file(lib_dirs, 'curses'):
+-            curses_library = 'curses'
++        curses_library = "ncurses"
+ 
+         if host_platform == 'darwin':
+             os_release = int(os.uname()[2].split('.')[0])
diff --git a/meta/recipes-devtools/python/python3/150-fix-setupterm.patch b/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
new file mode 100644
index 0000000..78d7c78
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/150-fix-setupterm.patch
@@ -0,0 +1,17 @@
+Fix warning with newer compiler
+
+-Khem
+
+Upstream-Status: Pending
+
+--- a/Modules/_cursesmodule.c
++++ b/Modules/_cursesmodule.c
+@@ -116,7 +116,7 @@ char *PyCursesVersion = "2.2";
+     #defines many common symbols (such as "lines") which breaks the
+     curses module in other ways.  So the code will just specify
+     explicit prototypes here. */
+-extern int setupterm(char *,int,int *);
++//extern int setupterm(char *,int,int *);
+ #ifdef __sgi
+ #include <term.h>
+ #endif
diff --git a/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch b/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
new file mode 100644
index 0000000..f29ae53
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/avoid-ncursesw-include-path.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Pending
+
+We should make sure that sysroot is used by gcc instead of assuming
+hardcoded locations for include paths
+
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: Python-3.4.2/configure.ac
+===================================================================
+--- Python-3.4.2.orig/configure.ac
++++ Python-3.4.2/configure.ac
+@@ -4434,7 +4434,7 @@ fi
+ 
+ # first curses header check
+ ac_save_cppflags="$CPPFLAGS"
+-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
++CPPFLAGS="$CPPFLAGS -I=/usr/include/ncursesw"
+ 
+ AC_CHECK_HEADERS(curses.h ncurses.h)
+ 
diff --git a/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
new file mode 100644
index 0000000..208c57c
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/avoid_warning_about_tkinter.patch
@@ -0,0 +1,25 @@
+_tkinter module needs tk module along with tcl. tk is not yet integrated
+in yocto so we skip the check for this module.
+Avoid a warning by not adding this module to missing variable.
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py	2012-04-05 23:18:38.500136647 +0300
++++ Python-2.7.2/setup.py	2012-04-05 23:19:35.888134969 +0300
+@@ -1634,8 +1634,10 @@
+         # Call the method for detecting whether _tkinter can be compiled
+         self.detect_tkinter(inc_dirs, lib_dirs)
+ 
+-        if '_tkinter' not in [e.name for e in self.extensions]:
+-            missing.append('_tkinter')
++        # tkinter module will not be avalaible as yocto
++        # doesn't have tk integrated (yet)
++        #if '_tkinter' not in [e.name for e in self.extensions]:
++        #    missing.append('_tkinter')
+ 
+         return missing
+ 
diff --git a/meta/recipes-devtools/python/python3/cgi_py.patch b/meta/recipes-devtools/python/python3/cgi_py.patch
new file mode 100644
index 0000000..de504f9
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/cgi_py.patch
@@ -0,0 +1,23 @@
+Lib/cgi.py: Update the script as mentioned in the comment
+
+Upstream-Status: Inappropriate [distribution]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+--- Python-2.6.6/Lib/cgi.py.orig	2010-08-01 22:14:27.000000000 -0500
++++ Python-2.6.6/Lib/cgi.py	2011-09-21 15:28:40.478208631 -0500
+@@ -1,13 +1,4 @@
+-#! /usr/local/bin/python
+-
+-# NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is
+-# intentionally NOT "/usr/bin/env python".  On many systems
+-# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
+-# scripts, and /usr/local/bin is the default directory where Python is
+-# installed, so /usr/bin/env would be unable to find python.  Granted,
+-# binary installations by Linux vendors often install Python in
+-# /usr/bin.  So let those vendors patch cgi.py to match their choice
+-# of installation.
++#! /usr/bin/env python
+ 
+ """Support module for CGI (Common Gateway Interface) scripts.
+ 
diff --git a/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch b/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
new file mode 100644
index 0000000..cd1a978
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/fix_for_using_different_libdir.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Inappropriate [Embedded specific]
+
+This patch fixes issuing with different libdir like lib64.
+This patch makes the native python binary modules findable
+in the install process of the host python.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/03/14
+
+Updated for python 2.7.3
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2012/05/01
+
+Index: Python-3.3.0rc2/Lib/sysconfig.py
+===================================================================
+--- Python-3.3.0rc2.orig/Lib/sysconfig.py	2012-09-20 22:50:11.000000000 -0700
++++ Python-3.3.0rc2/Lib/sysconfig.py	2012-09-20 22:53:01.561123396 -0700
+@@ -21,9 +21,9 @@
+ 
+ _INSTALL_SCHEMES = {
+     'posix_prefix': {
+-        'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
++        'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
+         'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+-        'purelib': '{base}/lib/python{py_version_short}/site-packages',
++        'purelib': '{base}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'include':
+             '{installed_base}/include/python{py_version_short}{abiflags}',
+@@ -83,7 +83,7 @@
+     'posix_user': {
+         'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+         'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+-        'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
++        'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'include': '{userbase}/include/python{py_version_short}',
+         'scripts': '{userbase}/bin',
+Index: Python-3.3.0rc2/Makefile.pre.in
+===================================================================
+--- Python-3.3.0rc2.orig/Makefile.pre.in	2012-09-20 22:50:11.000000000 -0700
++++ Python-3.3.0rc2/Makefile.pre.in	2012-09-20 22:50:54.245123997 -0700
+@@ -1080,9 +1080,9 @@
+ 		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
+ 			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
+ 	fi
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++	-PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ 		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
+-	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
++	-PYTHONPATH=$(DESTDIR)$(LIBDEST):${CROSSPYTHONPATH} $(RUNSHARED) \
+ 		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt
+ 
+ # Create the PLATDIR source directory, if one wasn't distributed..
diff --git a/meta/recipes-devtools/python/python3/host_include_contamination.patch b/meta/recipes-devtools/python/python3/host_include_contamination.patch
new file mode 100644
index 0000000..ef2054d
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/host_include_contamination.patch
@@ -0,0 +1,28 @@
+when building python for qemux86-64 on ubuntu 11.10/64bit
+it gropes into host includes and then mixes them with cross
+includes and as a result some modules fail to compile and link
+one of the modules is python-elementtree which is then not
+found during image creation
+
+Proble is that setup.py tries to add native includes that newer
+ubuntu has introduced for multiarch support. But that should
+only happen for native builds and not cross building python
+so we add a check here.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: Python-3.3.0rc2/setup.py
+===================================================================
+--- Python-3.3.0rc2.orig/setup.py	2012-09-20 21:54:50.000000000 -0700
++++ Python-3.3.0rc2/setup.py	2012-09-20 21:57:35.029123858 -0700
+@@ -402,6 +402,9 @@
+ 
+         if not find_executable('dpkg-architecture'):
+             return
++        if cross_compiling:
++            return
++
+         opt = ''
+         if cross_compiling:
+             opt = '-t' + sysconfig.get_config_var('HOST_GNU_TYPE')
diff --git a/meta/recipes-devtools/python/python3/makerace.patch b/meta/recipes-devtools/python/python3/makerace.patch
new file mode 100644
index 0000000..d8a6892
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/makerace.patch
@@ -0,0 +1,28 @@
+There is a race due to the execution of make inside the makefile:
+
+| gcc  -pthread -c -Wno-unused-result -DNDEBUG -g  -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe   -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c
+| gcc  -pthread -c -Wno-unused-result -DNDEBUG -g  -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe   -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Parser/pgen.o Parser/pgen.c| gcc  -pthread -c -Wno-unused-result -DNDEBUG -g  -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe   -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c
+| gcc  -pthread -c -Wno-unused-result -DNDEBUG -g  -O3 -Wall -Wstrict-prototypes -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -O2 -pipe   -I. -IInclude -I./Include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -isystem/home/pokybuild/yocto-autobuilder-dev/yocto-slave/nightly-world/build/build/tmp/sysroots/x86_64-linux/usr/include -fPIC -DPy_BUILD_CORE -o Objects/obmalloc.o Objects/obmalloc.c
+| Objects/obmalloc.o: file not recognized: File truncated
+| collect2: error: ld returned 1 exit status
+| make[1]: *** [Parser/pgen] Error 1
+
+The easiest way to avoid this is to list the dependencies explictly.
+
+RP 28/2/2014
+
+Upstream-Status: Pending
+
+Index: Python-3.3.3/Makefile.pre.in
+===================================================================
+--- Python-3.3.3.orig/Makefile.pre.in	2014-02-27 14:04:38.268339533 +0000
++++ Python-3.3.3/Makefile.pre.in	2014-02-28 10:40:59.166361125 +0000
+@@ -676,7 +676,7 @@
+ 
+ $(IO_OBJS): $(IO_H)
+ 
+-$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
++$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) $(PGEN)
+ 		@$(MKDIR_P) Include
+ 		$(MAKE) $(PGEN)
+ 		$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
diff --git a/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
new file mode 100644
index 0000000..b3e9860
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch
@@ -0,0 +1,338 @@
+Upstream-Status: Pending
+
+get the sys.lib from python itself and do not use hardcoded value of 'lib'
+
+02/2015 Rebased for 3.4.2
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
+
+Index: Python-3.4.2/Include/pythonrun.h
+===================================================================
+--- Python-3.4.2.orig/Include/pythonrun.h
++++ Python-3.4.2/Include/pythonrun.h
+@@ -220,6 +220,8 @@ int _Py_CheckPython3();
+ /* In their own files */
+ PyAPI_FUNC(const char *) Py_GetVersion(void);
+ PyAPI_FUNC(const char *) Py_GetPlatform(void);
++PyAPI_FUNC(const char *) Py_GetArch(void);
++PyAPI_FUNC(const char *) Py_GetLib(void);
+ PyAPI_FUNC(const char *) Py_GetCopyright(void);
+ PyAPI_FUNC(const char *) Py_GetCompiler(void);
+ PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
+Index: Python-3.4.2/Lib/distutils/command/install.py
+===================================================================
+--- Python-3.4.2.orig/Lib/distutils/command/install.py
++++ Python-3.4.2/Lib/distutils/command/install.py
+@@ -19,6 +19,8 @@ from site import USER_BASE
+ from site import USER_SITE
+ HAS_USER_SITE = True
+ 
++libname = sys.lib
++
+ WINDOWS_SCHEME = {
+     'purelib': '$base/Lib/site-packages',
+     'platlib': '$base/Lib/site-packages',
+@@ -30,7 +32,7 @@ WINDOWS_SCHEME = {
+ INSTALL_SCHEMES = {
+     'unix_prefix': {
+         'purelib': '$base/lib/python$py_version_short/site-packages',
+-        'platlib': '$platbase/lib/python$py_version_short/site-packages',
++        'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
+         'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
+         'scripts': '$base/bin',
+         'data'   : '$base',
+Index: Python-3.4.2/Lib/pydoc.py
+===================================================================
+--- Python-3.4.2.orig/Lib/pydoc.py
++++ Python-3.4.2/Lib/pydoc.py
+@@ -394,7 +394,7 @@ class Doc:
+ 
+         docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS)
+ 
+-        basedir = os.path.join(sys.base_exec_prefix, "lib",
++        basedir = os.path.join(sys.base_exec_prefix, sys.lib,
+                                "python%d.%d" %  sys.version_info[:2])
+         if (isinstance(object, type(os)) and
+             (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
+Index: Python-3.4.2/Lib/trace.py
+===================================================================
+--- Python-3.4.2.orig/Lib/trace.py
++++ Python-3.4.2/Lib/trace.py
+@@ -751,10 +751,10 @@ def main(argv=None):
+                 # should I also call expanduser? (after all, could use $HOME)
+ 
+                 s = s.replace("$prefix",
+-                              os.path.join(sys.base_prefix, "lib",
++                              os.path.join(sys.base_prefix, sys.lib,
+                                            "python" + sys.version[:3]))
+                 s = s.replace("$exec_prefix",
+-                              os.path.join(sys.base_exec_prefix, "lib",
++                              os.path.join(sys.base_exec_prefix, sys.lib,
+                                            "python" + sys.version[:3]))
+                 s = os.path.normpath(s)
+                 ignore_dirs.append(s)
+Index: Python-3.4.2/Makefile.pre.in
+===================================================================
+--- Python-3.4.2.orig/Makefile.pre.in
++++ Python-3.4.2/Makefile.pre.in
+@@ -101,6 +101,8 @@ PY_CORE_CFLAGS=	$(PY_CFLAGS) $(PY_CFLAGS
+ 
+ # Machine-dependent subdirectories
+ MACHDEP=	@MACHDEP@
++LIB=		@LIB@
++ARCH=		@ARCH@
+ 
+ # Multiarch directory (may be empty)
+ MULTIARCH=	@MULTIARCH@
+@@ -120,7 +122,7 @@ LIBDIR=		@libdir@
+ MANDIR=		@mandir@
+ INCLUDEDIR=	@includedir@
+ CONFINCLUDEDIR=	$(exec_prefix)/include
+-SCRIPTDIR=	$(prefix)/lib
++SCRIPTDIR=	@libdir@
+ ABIFLAGS=	@ABIFLAGS@
+ 
+ # Detailed destination directories
+@@ -712,6 +714,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
+ 		-DEXEC_PREFIX='"$(exec_prefix)"' \
+ 		-DVERSION='"$(VERSION)"' \
+ 		-DVPATH='"$(VPATH)"' \
++		-DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \
+ 		-o $@ $(srcdir)/Modules/getpath.c
+ 
+ Modules/python.o: $(srcdir)/Modules/python.c
+@@ -780,7 +783,7 @@ $(AST_C): $(AST_H) $(AST_ASDL) $(ASDLGEN
+ Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
+ 
+ Python/getplatform.o: $(srcdir)/Python/getplatform.c
+-		$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
++		$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
+ 
+ Python/importdl.o: $(srcdir)/Python/importdl.c
+ 		$(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
+Index: Python-3.4.2/Modules/getpath.c
+===================================================================
+--- Python-3.4.2.orig/Modules/getpath.c
++++ Python-3.4.2/Modules/getpath.c
+@@ -117,9 +117,11 @@
+ #define EXEC_PREFIX PREFIX
+ #endif
+ 
++#define LIB_PYTHON LIB "/python" VERSION
++
+ #ifndef PYTHONPATH
+-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
+-              EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
++#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
++              EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
+ #endif
+ 
+ #ifndef LANDMARK
+@@ -130,6 +132,7 @@ static wchar_t prefix[MAXPATHLEN+1];
+ static wchar_t exec_prefix[MAXPATHLEN+1];
+ static wchar_t progpath[MAXPATHLEN+1];
+ static wchar_t *module_search_path = NULL;
++static wchar_t *lib_python = L"" LIB_PYTHON;
+ 
+ static void
+ reduce(wchar_t *dir)
+Index: Python-3.4.2/Python/getplatform.c
+===================================================================
+--- Python-3.4.2.orig/Python/getplatform.c
++++ Python-3.4.2/Python/getplatform.c
+@@ -10,3 +10,23 @@ Py_GetPlatform(void)
+ {
+ 	return PLATFORM;
+ }
++
++#ifndef ARCH
++#define ARCH "unknown"
++#endif
++
++const char *
++Py_GetArch(void)
++{
++	return ARCH;
++}
++
++#ifndef LIB
++#define LIB "lib"
++#endif
++
++const char *
++Py_GetLib(void)
++{
++	return LIB;
++}
+Index: Python-3.4.2/Python/sysmodule.c
+===================================================================
+--- Python-3.4.2.orig/Python/sysmodule.c
++++ Python-3.4.2/Python/sysmodule.c
+@@ -1697,6 +1697,10 @@ _PySys_Init(void)
+                         PyUnicode_FromString(Py_GetCopyright()));
+     SET_SYS_FROM_STRING("platform",
+                         PyUnicode_FromString(Py_GetPlatform()));
++    SET_SYS_FROM_STRING("arch",
++                        PyUnicode_FromString(Py_GetArch()));
++    SET_SYS_FROM_STRING("lib",
++                        PyUnicode_FromString(Py_GetLib()));
+     SET_SYS_FROM_STRING("executable",
+                         PyUnicode_FromWideChar(
+                                Py_GetProgramFullPath(), -1));
+Index: Python-3.4.2/setup.py
+===================================================================
+--- Python-3.4.2.orig/setup.py
++++ Python-3.4.2/setup.py
+@@ -454,7 +454,7 @@ class PyBuildExt(build_ext):
+         # directories (i.e. '.' and 'Include') must be first.  See issue
+         # 10520.
+         if not cross_compiling:
+-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
++            add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
+             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+         # only change this for cross builds for 3.3, issues on Mageia
+         if cross_compiling:
+@@ -512,8 +512,7 @@ class PyBuildExt(build_ext):
+         # be assumed that no additional -I,-L directives are needed.
+         if not cross_compiling:
+             lib_dirs = self.compiler.library_dirs + [
+-                '/lib64', '/usr/lib64',
+-                '/lib', '/usr/lib',
++                '/' + sys.lib, '/usr/' + sys.lib,
+                 ]
+             inc_dirs = self.compiler.include_dirs + ['/usr/include']
+         else:
+@@ -696,11 +695,11 @@ class PyBuildExt(build_ext):
+             elif curses_library:
+                 readline_libs.append(curses_library)
+             elif self.compiler.find_library_file(lib_dirs +
+-                                                     ['/usr/lib/termcap'],
++                                                     ['/usr/'+sys.lib+'/termcap'],
+                                                      'termcap'):
+                 readline_libs.append('termcap')
+             exts.append( Extension('readline', ['readline.c'],
+-                                   library_dirs=['/usr/lib/termcap'],
++                                   library_dirs=['/usr/'+sys.lib+'/termcap'],
+                                    extra_link_args=readline_extra_link_args,
+                                    libraries=readline_libs) )
+         else:
+Index: Python-3.4.2/Lib/sysconfig.py
+===================================================================
+--- Python-3.4.2.orig/Lib/sysconfig.py
++++ Python-3.4.2/Lib/sysconfig.py
+@@ -20,10 +20,10 @@ __all__ = [
+ 
+ _INSTALL_SCHEMES = {
+     'posix_prefix': {
+-        'stdlib': '{installed_base}/lib/python{py_version_short}',
+-        'platstdlib': '{platbase}/lib/python{py_version_short}',
++        'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',
++        'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}',
+         'purelib': '{base}/lib/python{py_version_short}/site-packages',
+-        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
++        'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'include':
+             '{installed_base}/include/python{py_version_short}{abiflags}',
+         'platinclude':
+@@ -32,10 +32,10 @@ _INSTALL_SCHEMES = {
+         'data': '{base}',
+         },
+     'posix_home': {
+-        'stdlib': '{installed_base}/lib/python',
+-        'platstdlib': '{base}/lib/python',
++        'stdlib': '{installed_base}/'+sys.lib+'/python',
++        'platstdlib': '{base}/'+sys.lib+'/python',
+         'purelib': '{base}/lib/python',
+-        'platlib': '{base}/lib/python',
++        'platlib': '{base}/'+sys.lib+'/python',
+         'include': '{installed_base}/include/python',
+         'platinclude': '{installed_base}/include/python',
+         'scripts': '{base}/bin',
+@@ -61,10 +61,10 @@ _INSTALL_SCHEMES = {
+         'data': '{userbase}',
+         },
+     'posix_user': {
+-        'stdlib': '{userbase}/lib/python{py_version_short}',
+-        'platstdlib': '{userbase}/lib/python{py_version_short}',
++        'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
++        'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}',
+         'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
+-        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
++        'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages',
+         'include': '{userbase}/include/python{py_version_short}',
+         'scripts': '{userbase}/bin',
+         'data': '{userbase}',
+Index: Python-3.4.2/configure.ac
+===================================================================
+--- Python-3.4.2.orig/configure.ac
++++ Python-3.4.2/configure.ac
+@@ -791,6 +791,41 @@ esac
+ MULTIARCH=$($CC --print-multiarch 2>/dev/null)
+ AC_SUBST(MULTIARCH)
+ 
++AC_SUBST(ARCH)
++AC_MSG_CHECKING(ARCH)
++ARCH=`uname -m`
++case $ARCH in
++i?86) ARCH=i386;;
++esac
++AC_MSG_RESULT($ARCH)
++
++AC_SUBST(LIB)
++AC_MSG_CHECKING(LIB)
++case $ac_sys_system in
++Linux*)
++  # Test if the compiler is 64bit
++  echo 'int i;' > conftest.$ac_ext
++  python_cv_cc_64bit_output=no
++  if AC_TRY_EVAL(ac_compile); then
++    case `/usr/bin/file conftest.$ac_objext` in
++    *"ELF 64"*)
++      python_cv_cc_64bit_output=yes
++      ;;
++    esac
++  fi
++  rm -rf conftest*
++  ;;
++esac
++
++case $ARCH:$python_cv_cc_64bit_output in
++ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
++  LIB="lib64"
++  ;;
++*:*)
++  LIB="lib"
++  ;;
++esac
++AC_MSG_RESULT($LIB)
+ 
+ AC_SUBST(LIBRARY)
+ AC_MSG_CHECKING(LIBRARY)
+Index: Python-3.4.2/Lib/site.py
+===================================================================
+--- Python-3.4.2.orig/Lib/site.py
++++ Python-3.4.2/Lib/site.py
+@@ -304,13 +304,19 @@ def getsitepackages(prefixes=None):
+         seen.add(prefix)
+ 
+         if os.sep == '/':
+-            sitepackages.append(os.path.join(prefix, "lib",
++            sitepackages.append(os.path.join(prefix, sys.lib,
+                                         "python" + sys.version[:3],
+                                         "site-packages"))
+-            sitepackages.append(os.path.join(prefix, "lib", "site-python"))
++            if sys.lib != "lib":
++                sitepackages.append(os.path.join(prefix, "lib",
++                                        "python" + sys.version[:3],
++                                        "site-packages"))
++            sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
++            if sys.lib != "lib":
++                sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
+         else:
+             sitepackages.append(prefix)
+-            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
++            sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
+         if sys.platform == "darwin":
+             # for framework builds *only* we add the standard Apple
+             # locations.
diff --git a/meta/recipes-devtools/python/python3/python-config.patch b/meta/recipes-devtools/python/python3/python-config.patch
new file mode 100644
index 0000000..f23b8b7
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/python-config.patch
@@ -0,0 +1,46 @@
+python-config: Revert to using distutils.sysconfig
+
+The newer sysconfig module shares some code with distutils.sysconfig, but the same modifications as in
+
+12-distutils-prefix-is-inside-staging-area.patch makes distutils.sysconfig
+
+affect the native runtime as well as cross building. Use the old, patched
+implementation which returns paths in the staging directory and for the target,
+as appropriate.
+
+Upstream-Status: Inappropriate [Embedded Specific]
+
+Signed-off-by: Tyler Hall <tylerwhall@gmail.com>
+:
+Index: Python-3.3.3/Misc/python-config.in
+===================================================================
+--- Python-3.3.3.orig/Misc/python-config.in
++++ Python-3.3.3/Misc/python-config.in
+@@ -4,7 +4,7 @@
+ import getopt
+ import os
+ import sys
+-import sysconfig
++from distutils import sysconfig
+ 
+ valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
+               'ldflags', 'extension-suffix', 'help', 'abiflags', 'configdir']
+@@ -32,14 +32,14 @@ if '--help' in opt_flags:
+ 
+ for opt in opt_flags:
+     if opt == '--prefix':
+-        print(sysconfig.get_config_var('prefix'))
++        print(sysconfig.PREFIX)
+ 
+     elif opt == '--exec-prefix':
+-        print(sysconfig.get_config_var('exec_prefix'))
++        print(sysconfig.EXEC_PREFIX)
+ 
+     elif opt in ('--includes', '--cflags'):
+-        flags = ['-I' + sysconfig.get_path('include'),
+-                 '-I' + sysconfig.get_path('platinclude')]
++        flags = ['-I' + sysconfig.get_python_inc(),
++                 '-I' + sysconfig.get_python_inc(plat_specific=True)]
+         if opt == '--cflags':
+             flags.extend(getvar('CFLAGS').split())
+         print(' '.join(flags))
diff --git a/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch b/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch
new file mode 100644
index 0000000..2bc8b8c
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/python3-setup.py-no-host-headers-libs.patch
@@ -0,0 +1,33 @@
+From 43238e1ac13e32984d015c92a5841f3de1fe1d15 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 18 Nov 2014 00:07:07 -0500
+Subject: [PATCH] setup.py: no host headers libs
+
+When we are cross-compiling, setup.py should never look in /usr
+or /usr/local to find headers or libraries.
+
+Upstream-Status: Inappropriate [Cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ setup.py | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index f020b28..e8339cd 100644
+--- a/setup.py
++++ b/setup.py
+@@ -444,10 +444,7 @@ class PyBuildExt(build_ext):
+         if not cross_compiling:
+             add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib))
+             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+-        # only change this for cross builds for 3.3, issues on Mageia
+-        if cross_compiling:
+             self.add_gcc_paths()
+-        if not cross_compiling:
+             self.add_multiarch_paths()
+ 
+         # Add paths specified in the environment variables LDFLAGS and
+-- 
+2.0.0
+
diff --git a/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch b/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
new file mode 100644
index 0000000..74490d9
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch
@@ -0,0 +1,28 @@
+From 53ed216d7bf70dd2a925432b6805a701e5fc3e0e Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 17 Nov 2014 06:44:47 +0000
+Subject: [PATCH] python3 use CROSSPYTHONPATH for PYTHON_FOR_BUILD
+
+Upstream-Status: Inappropriate [Cross compile specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 989baf9..2890c96 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -67,7 +67,7 @@ if test "$cross_compiling" = yes; then
+ 	    AC_MSG_ERROR([python$PACKAGE_VERSION interpreter not found])
+ 	fi
+         AC_MSG_RESULT($interp)
+-	PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(shell test -f pybuilddir.txt && echo $(abs_builddir)/`cat pybuilddir.txt`:)$(srcdir)/Lib:$(srcdir)/Lib/$(PLATDIR) '$interp
++	PYTHON_FOR_BUILD='_PYTHON_PROJECT_BASE=$(abs_builddir) _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(CROSSPYTHONPATH) '$interp
+     fi
+ elif test "$cross_compiling" = maybe; then
+     AC_MSG_ERROR([Cross compiling required --host=HOST-TUPLE and --build=ARCH])
+-- 
+2.0.1
+
diff --git a/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch b/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch
new file mode 100644
index 0000000..fc2e12d
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/setup.py-check-cross_compiling-when-get-FLAGS.patch
@@ -0,0 +1,50 @@
+From 8dad810f3a3d073f09ad72e1a3ee0a895eab2ca1 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 18 Jan 2015 19:05:36 -0800
+Subject: [PATCH] setup.py:check cross_compiling when get FLAGS
+
+Fixed when compile target pythnon3:
+gcc -isystem/path/to/sysroots/x86_64-linux/usr/include \
+    -L=/path/to/sysroots/x86_64-linux/usr/lib
+
+This is incorrect, the native sysroot should not be used by target
+python3.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ setup.py |   10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index e8339cd..83fd31f 100644
+--- a/setup.py
++++ b/setup.py
+@@ -238,7 +238,10 @@ class PyBuildExt(build_ext):
+         # unfortunately, distutils doesn't let us provide separate C and C++
+         # compilers
+         if compiler is not None:
+-            (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
++            if cross_compiling:
++                (ccshared,cflags) = (os.environ.get('CCSHARED') or '', os.environ.get('CFLAGS') or '')
++            else:
++                (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+             args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
+         self.compiler.set_executables(**args)
+ 
+@@ -457,7 +460,10 @@ class PyBuildExt(build_ext):
+                 ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+                 ('LDFLAGS', '-L', self.compiler.library_dirs),
+                 ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+-            env_val = sysconfig.get_config_var(env_var)
++            if cross_compiling:
++                env_val = os.environ.get(env_var)
++            else:
++                env_val = sysconfig.get_config_var(env_var)
+             if env_val:
+                 # To prevent optparse from raising an exception about any
+                 # options in env_val that it doesn't know about we strip out
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch b/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch
new file mode 100644
index 0000000..f26bd38
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/setup.py-find-libraries-in-staging-dirs.patch
@@ -0,0 +1,30 @@
+Patch setup.py so that the detect_modules() function looks for required
+libraries and headers in STAGING_LIBDIR / STAGING_INCDIR.
+
+Without this patch, several extension modules are not built, even though
+their dependencies are present in the compiler's search paths.
+The result is the following warning, and ultimately incomplete packages:
+
+| The necessary bits to build these optional modules were not found:
+| _bz2                  _curses_panel         _dbm
+| _gdbm                 _lzma                 _sqlite3
+| nis                   readline              zlib
+| To find the necessary bits, look in setup.py in detect_modules() for the module's name.
+
+Upstream-Status:  Inappropriate [Cross compile specific]
+
+Signed-off-by: Dominic Sacré <dominic.sacre@gmx.de>
+
+Index: Python-3.4.3/setup.py
+===================================================================
+--- Python-3.4.3.orig/setup.py
++++ Python-3.4.3/setup.py
+@@ -521,6 +521,8 @@ class PyBuildExt(build_ext):
+         else:
+             lib_dirs = self.compiler.library_dirs[:]
+             inc_dirs = self.compiler.include_dirs[:]
++            lib_dirs.append(os.environ.get('STAGING_LIBDIR'))
++            inc_dirs.append(os.environ.get('STAGING_INCDIR'))
+         exts = []
+         missing = []
+ 
diff --git a/meta/recipes-devtools/python/python3/setuptweaks.patch b/meta/recipes-devtools/python/python3/setuptweaks.patch
new file mode 100644
index 0000000..3a91b19
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/setuptweaks.patch
@@ -0,0 +1,57 @@
+This patch removes various ways native system options can pass into the python 
+compilation and somehow break C modules.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2012/04/23
+
+Index: Python-2.7.2/setup.py
+===================================================================
+--- Python-2.7.2.orig/setup.py	2012-04-23 20:03:47.295582553 +0000
++++ Python-2.7.2/setup.py	2012-04-23 20:03:15.000000000 +0000
+@@ -231,7 +231,13 @@
+         # compilers
+         if compiler is not None:
+             (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')
+-            args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags
++            # Need to filter out -isysroot from the flags. Ideally should 
++            # figure out target flags here.
++            flags = []
++            for f in cflags.split():
++                if not f.startswith("-isystem"):
++                    flags.append(f)
++            args['compiler_so'] = compiler + ' ' + ccshared + ' ' + ' '.join(flags)
+         self.compiler.set_executables(**args)
+ 
+         build_ext.build_extensions(self)
+@@ -393,7 +399,6 @@
+         # into configure and stored in the Makefile (issue found on OS X 10.3).
+         for env_var, arg_name, dir_list in (
+                 ('LDFLAGS', '-R', self.compiler.runtime_library_dirs),
+-                ('LDFLAGS', '-L', self.compiler.library_dirs),
+                 ('CPPFLAGS', '-I', self.compiler.include_dirs)):
+             env_val = sysconfig.get_config_var(env_var)
+             if env_val:
+@@ -419,16 +424,16 @@
+                     for directory in reversed(options.dirs):
+                         add_dir_to_list(dir_list, directory)
+ 
+-        if os.path.normpath(sys.prefix) != '/usr' \
+-                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
++#        if os.path.normpath(sys.prefix) != '/usr' \
++#                and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
+             # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
+             # (PYTHONFRAMEWORK is set) to avoid # linking problems when
+             # building a framework with different architectures than
+             # the one that is currently installed (issue #7473)
+-            add_dir_to_list(self.compiler.library_dirs,
+-                            sysconfig.get_config_var("LIBDIR"))
+-            add_dir_to_list(self.compiler.include_dirs,
+-                            sysconfig.get_config_var("INCLUDEDIR"))
++#            add_dir_to_list(self.compiler.library_dirs,
++#                            sysconfig.get_config_var("LIBDIR"))
++#            add_dir_to_list(self.compiler.include_dirs,
++#                            sysconfig.get_config_var("INCLUDEDIR"))
+ 
+         try:
+             have_unicode = unicode
diff --git a/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch b/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
new file mode 100644
index 0000000..802b1c7
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/shutil-follow-symlink-fix.patch
@@ -0,0 +1,17 @@
+shutils should consider symlinks
+
+-Khem
+
+Upstream-Status: Pending
+
+--- a/Lib/shutil.py	2013-01-29 12:31:06.926555779 -0800
++++ b/Lib/shutil.py	2013-01-29 16:31:39.097554182 -0800
+@@ -132,7 +132,7 @@ def copymode(src, dst, *, follow_symlink
+     st = stat_func(src)
+     chmod_func(dst, stat.S_IMODE(st.st_mode))
+ 
+-if hasattr(os, 'listxattr'):
++if hasattr(os, 'listxattr') and os.listxattr in os.supports_follow_symlinks:
+     def _copyxattr(src, dst, *, follow_symlinks=True):
+         """Copy extended filesystem attributes from `src` to `dst`.
+ 
diff --git a/meta/recipes-devtools/python/python3/sitecustomize.py b/meta/recipes-devtools/python/python3/sitecustomize.py
new file mode 100644
index 0000000..4c8b5e2
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/sitecustomize.py
@@ -0,0 +1,37 @@
+# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# GPLv2 or later
+# Version: 20081123
+# Features:
+# * set proper default encoding
+# * enable readline completion in the interactive interpreter
+# * load command line history on startup
+# * save command line history on exit 
+
+import os
+
+def __exithandler():
+    try:
+        readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+    except IOError:
+        pass
+
+def __registerExitHandler():
+    import atexit
+    atexit.register( __exithandler )
+
+def __enableReadlineSupport():
+    readline.set_history_length( 1000 )
+    readline.parse_and_bind( "tab: complete" )
+    try:
+        readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+    except IOError:
+        pass
+
+import sys
+try:
+    import rlcompleter, readline
+except ImportError:
+    pass
+else:
+    __registerExitHandler()
+    __enableReadlineSupport()
diff --git a/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch b/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
new file mode 100644
index 0000000..de07643
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/sysconfig.py-add-_PYTHON_PROJECT_SRC.patch
@@ -0,0 +1,54 @@
+From fc93b3cc23b4f9698ae92a42986dbb02b6f19588 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sun, 18 Jan 2015 06:29:50 -0800
+Subject: [PATCH] sysconfig.py: add _PYTHON_PROJECT_SRC
+
+python3 has introduced _PYTHON_PROJECT_BASE which is used for separate B
+and S, but it doesn't work when compile Modules, the target python3 runs
+python3-native's sysconfig to get srcdir which is the native's, there
+would be errors when native's srcdir has been removed, add
+_PYTHON_PROJECT_SRC to fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Lib/distutils/sysconfig.py |    5 ++++-
+ Lib/sysconfig.py           |    5 ++++-
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
+index a545ab9..74317d1 100644
+--- a/Lib/distutils/sysconfig.py
++++ b/Lib/distutils/sysconfig.py
+@@ -554,7 +554,10 @@ def get_config_vars(*args):
+         _config_vars['exec_prefix'] = EXEC_PREFIX
+ 
+         # Always convert srcdir to an absolute path
+-        srcdir = _config_vars.get('srcdir', project_base)
++        if "_PYTHON_PROJECT_SRC" in os.environ:
++            srcdir = os.path.abspath(os.environ["_PYTHON_PROJECT_SRC"])
++        else:
++            srcdir = _config_vars.get('srcdir', project_base)
+         if os.name == 'posix':
+             if python_build:
+                 # If srcdir is a relative path (typically '.' or '..')
+diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
+index 7287f11..cc92998 100644
+--- a/Lib/sysconfig.py
++++ b/Lib/sysconfig.py
+@@ -562,7 +562,10 @@ def get_config_vars(*args):
+         _CONFIG_VARS['userbase'] = _getuserbase()
+ 
+         # Always convert srcdir to an absolute path
+-        srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
++        if "_PYTHON_PROJECT_SRC" in os.environ:
++            srcdir = os.path.abspath(os.environ["_PYTHON_PROJECT_SRC"])
++        else:
++            srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
+         if os.name == 'posix':
+             if _PYTHON_BUILD:
+                 # If srcdir is a relative path (typically '.' or '..')
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/python/python3/sysroot-include-headers.patch b/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
new file mode 100644
index 0000000..785b556
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/sysroot-include-headers.patch
@@ -0,0 +1,35 @@
+Dont search hardcoded paths, we might be doing a cross-build
+Use '=' in-front to let compiler append sysroot, if it can
+
+Should fix things like
+
+configure:6972: arm-angstrom-linux-gnueabi-gcc  -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 -DNDEBUG -fno-inline -D__SOFTFP__ --sysroot=/build/v2013.06/build/tmp-angstrom_v2013_06-eglibc/sysroots/beaglebone -c -O2 -pipe -g -feliminate-unused-debug-types  -I/usr/include/ncursesw conftest.c >&5
+cc1: warning: include location "/usr/include/ncursesw" is unsafe for cross-compilation [-Wpoison-system-directories]
+
+
+Signed-off-by: Khem Raj
+Upstream-Status: Pending
+
+
+Index: Python-3.3.2/setup.py
+===================================================================
+--- Python-3.3.2.orig/setup.py	2013-07-30 01:30:48.000000000 -0700
++++ Python-3.3.2/setup.py	2013-07-30 01:41:11.697862723 -0700
+@@ -1210,7 +1210,7 @@
+         panel_library = 'panel'
+         if curses_library == 'ncursesw':
+             curses_defines.append(('HAVE_NCURSESW', '1'))
+-            curses_includes.append('/usr/include/ncursesw')
++            curses_includes.append('=/usr/include/ncursesw')
+             # Bug 1464056: If _curses.so links with ncursesw,
+             # _curses_panel.so must link with panelw.
+             panel_library = 'panelw'
+@@ -1819,7 +1819,7 @@
+         if host_platform == 'darwin':
+             # OS X 10.5 comes with libffi.dylib; the include files are
+             # in /usr/include/ffi
+-            inc_dirs.append('/usr/include/ffi')
++            inc_dirs.append('=/usr/include/ffi')
+ 
+         ffi_inc = [sysconfig.get_config_var("LIBFFI_INCLUDEDIR")]
+         if not ffi_inc or ffi_inc[0] == '':
diff --git a/meta/recipes-devtools/python/python3/unixccompiler.patch b/meta/recipes-devtools/python/python3/unixccompiler.patch
new file mode 100644
index 0000000..7b90f13
--- /dev/null
+++ b/meta/recipes-devtools/python/python3/unixccompiler.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Pending
+
+The CC variable,sometimes like:"x86_64-poky-linux-gcc   -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information. 
+This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name.
+
+Secondly add -L=<path> this way linker will be able to resolve /usr/lib w.r.t sysroot and not
+use hardcoded /usr/lib to look for libs which is wrong in cross compile environment and this will work
+ok on native systems too since sysroot for native compilers is /
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: Python-3.3.2/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-3.3.2.orig/Lib/distutils/unixccompiler.py	2013-05-15 09:32:54.000000000 -0700
++++ Python-3.3.2/Lib/distutils/unixccompiler.py	2013-08-01 00:58:18.629056286 -0700
+@@ -202,7 +202,9 @@
+     # ccompiler.py.
+ 
+     def library_dir_option(self, dir):
+-        return "-L" + dir
++        if dir.startswith("."):
++            return "-L" + dir
++        return "-L=" + dir
+ 
+     def _is_gcc(self, compiler_name):
+         return "gcc" in compiler_name or "g++" in compiler_name
+@@ -221,7 +221,7 @@
+         # this time, there's no way to determine this information from
+         # the configuration data stored in the Python installation, so
+         # we use this hack.
+-        compiler = os.path.basename(sysconfig.get_config_var("CC"))
++        compiler = sysconfig.get_config_var("CC")
+         if sys.platform[:6] == "darwin":
+             # MacOSX's linker doesn't understand the -R flag at all
+             return "-L" + dir
diff --git a/meta/recipes-devtools/python/python3_3.4.3.bb b/meta/recipes-devtools/python/python3_3.4.3.bb
new file mode 100644
index 0000000..f61d278
--- /dev/null
+++ b/meta/recipes-devtools/python/python3_3.4.3.bb
@@ -0,0 +1,225 @@
+require recipes-devtools/python/python.inc
+
+DEPENDS = "python3-native libffi bzip2 db gdbm openssl readline sqlite3 zlib virtual/libintl xz"
+PR = "${INC_PR}.0"
+PYTHON_MAJMIN = "3.4"
+PYTHON_BINABI= "${PYTHON_MAJMIN}m"
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
+file://python-config.patch \
+file://000-cross-compile.patch \
+file://020-dont-compile-python-files.patch \
+file://030-fixup-include-dirs.patch \
+file://070-dont-clean-ipkg-install.patch \
+file://080-distutils-dont_adjust_files.patch \
+file://110-enable-zlib.patch \
+file://130-readline-setup.patch \
+file://150-fix-setupterm.patch \
+file://0001-h2py-Fix-issue-13032-where-it-fails-with-UnicodeDeco.patch \
+file://makerace.patch \
+${DISTRO_SRC_URI} \
+"
+
+SRC_URI += "\
+            file://03-fix-tkinter-detection.patch \
+            file://04-default-is-optimized.patch \
+            file://avoid_warning_about_tkinter.patch \
+            file://cgi_py.patch \
+            file://host_include_contamination.patch \
+            file://python-3.3-multilib.patch \
+            file://shutil-follow-symlink-fix.patch \
+            file://sysroot-include-headers.patch \
+            file://unixccompiler.patch \
+            file://avoid-ncursesw-include-path.patch \
+            file://python3-use-CROSSPYTHONPATH-for-PYTHON_FOR_BUILD.patch \
+            file://python3-setup.py-no-host-headers-libs.patch \
+            file://sysconfig.py-add-_PYTHON_PROJECT_SRC.patch \
+            file://setup.py-check-cross_compiling-when-get-FLAGS.patch \
+            file://setup.py-find-libraries-in-staging-dirs.patch \
+           "
+SRC_URI[md5sum] = "7d092d1bba6e17f0d9bd21b49e441dd5"
+SRC_URI[sha256sum] = "b5b3963533768d5fc325a4d7a6bd6f666726002d696f1d399ec06b043ea996b8"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=dd98d01d471fac8d8dbdd975229dba03"
+
+S = "${WORKDIR}/Python-${PV}"
+
+inherit autotools multilib_header python3native pkgconfig
+
+CONFIGUREOPTS += " --with-system-ffi "
+
+CACHED_CONFIGUREVARS = "ac_cv_have_chflags=no \
+                ac_cv_have_lchflags=no \
+                ac_cv_have_long_long_format=yes \
+                ac_cv_buggy_getaddrinfo=no \
+                ac_cv_file__dev_ptmx=yes \
+                ac_cv_file__dev_ptc=no \
+"
+# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
+#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
+TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
+TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
+TARGET_CC_ARCH += "-DNDEBUG -fno-inline"
+EXTRA_OEMAKE += "CROSS_COMPILE=yes"
+EXTRA_OECONF += "CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ --without-ensurepip"
+
+export CROSS_COMPILE = "${TARGET_PREFIX}"
+export _PYTHON_PROJECT_BASE = "${B}"
+export _PYTHON_PROJECT_SRC = "${S}"
+export CCSHARED = "-fPIC"
+
+# Fix ctypes cross compilation
+export CROSSPYTHONPATH = "${B}/build/lib.linux-${TARGET_ARCH}-${PYTHON_MAJMIN}:${S}/Lib:${S}/Lib/plat-linux"
+
+# No ctypes option for python 3
+PYTHONLSBOPTS = ""
+
+do_configure_append() {
+	rm -f ${S}/Makefile.orig
+	autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_compile() {
+        # regenerate platform specific files, because they depend on system headers
+        cd ${S}/Lib/plat-linux*
+        include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+                ${S}/Tools/scripts/h2py.py -i '(u_long)' \
+                ${STAGING_INCDIR}/dlfcn.h \
+                ${STAGING_INCDIR}/linux/cdrom.h \
+                ${STAGING_INCDIR}/netinet/in.h \
+                ${STAGING_INCDIR}/sys/types.h
+        sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
+        cd -
+
+
+	# remove any bogus LD_LIBRARY_PATH
+	sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
+
+	if [ ! -f Makefile.orig ]; then
+		install -m 0644 Makefile Makefile.orig
+	fi
+	sed -i -e 's,^CONFIGURE_LDFLAGS=.*,CONFIGURE_LDFLAGS=-L. -L${STAGING_LIBDIR},g' \
+		-e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
+		-e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
+		-e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
+		-e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
+		-e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
+		-e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
+		Makefile
+	# save copy of it now, because if we do it in do_install and 
+	# then call do_install twice we get Makefile.orig == Makefile.sysroot
+	install -m 0644 Makefile Makefile.sysroot
+
+	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+		STAGING_LIBDIR=${STAGING_LIBDIR} \
+		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+		STAGING_INCDIR=${STAGING_INCDIR} \
+		BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+		LIB=${baselib} \
+		ARCH=${TARGET_ARCH} \
+		OPT="${CFLAGS}" libpython3.so
+
+	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+		STAGING_LIBDIR=${STAGING_LIBDIR} \
+		STAGING_INCDIR=${STAGING_INCDIR} \
+		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+		BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+		LIB=${baselib} \
+		ARCH=${TARGET_ARCH} \
+		OPT="${CFLAGS}"
+}
+
+do_install() {
+	# make install needs the original Makefile, or otherwise the inclues would
+	# go to ${D}${STAGING...}/...
+	install -m 0644 Makefile.orig Makefile
+
+	install -d ${D}${libdir}/pkgconfig
+	install -d ${D}${libdir}/python${PYTHON_MAJMIN}/config
+
+	# rerun the build once again with original makefile this time
+	# run install in a separate step to avoid compile/install race
+	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+		STAGING_LIBDIR=${STAGING_LIBDIR} \
+		STAGING_INCDIR=${STAGING_INCDIR} \
+		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+		BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+		LIB=${baselib} \
+		ARCH=${TARGET_ARCH} \
+		DESTDIR=${D} LIBDIR=${libdir}
+	
+	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python3-native/pgen \
+		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
+		STAGING_LIBDIR=${STAGING_LIBDIR} \
+		STAGING_INCDIR=${STAGING_INCDIR} \
+		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+		BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+		LIB=${baselib} \
+		ARCH=${TARGET_ARCH} \
+		DESTDIR=${D} LIBDIR=${libdir} install
+
+	# avoid conflict with 2to3 from Python 2
+	rm -f ${D}/${bindir}/2to3
+
+	install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+
+	if [ -e ${WORKDIR}/sitecustomize.py ]; then
+		install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+	fi
+
+	oe_multilib_header python${PYTHON_BINABI}/pyconfig.h
+}
+
+do_install_append_class-nativesdk () {
+	create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
+}
+
+SSTATE_SCAN_FILES += "Makefile"
+PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
+
+py_package_preprocess () {
+	# copy back the old Makefile to fix target package
+	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
+	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+}
+
+require python-${PYTHON_MAJMIN}-manifest.inc
+
+# manual dependency additions
+RPROVIDES_${PN}-core = "${PN}"
+RRECOMMENDS_${PN}-core = "${PN}-readline"
+RRECOMMENDS_${PN}-crypt = "openssl"
+RRECOMMENDS_${PN}-crypt_class-nativesdk = "nativesdk-openssl"
+
+FILES_${PN}-2to3 += "${bindir}/2to3-${PYTHON_MAJMIN}"
+FILES_${PN}-pydoc += "${bindir}/pydoc${PYTHON_MAJMIN} ${bindir}/pydoc3"
+FILES_${PN}-idle += "${bindir}/idle3 ${bindir}/idle${PYTHON_MAJMIN}"
+
+PACKAGES =+ "${PN}-pyvenv"
+FILES_${PN}-pyvenv += "${bindir}/pyvenv-${PYTHON_MAJMIN} ${bindir}/pyvenv"
+
+# package libpython3
+PACKAGES =+ "libpython3 libpython3-staticdev"
+FILES_libpython3 = "${libdir}/libpython*.so.*"
+FILES_libpython3-staticdev += "${libdir}/python${PYTHON_MAJMIN}/config-${PYTHON_BINABI}/libpython${PYTHON_BINABI}.a"
+
+# catch debug extensions (isn't that already in python-core-dbg?)
+FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
+
+# catch all the rest (unsorted)
+PACKAGES += "${PN}-misc"
+RDEPENDS_${PN}-misc += "${PN}-core"
+FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
+
+# catch manpage
+PACKAGES += "${PN}-man"
+FILES_${PN}-man = "${datadir}/man"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/python/python_2.7.9.bb b/meta/recipes-devtools/python/python_2.7.9.bb
new file mode 100644
index 0000000..ae45577
--- /dev/null
+++ b/meta/recipes-devtools/python/python_2.7.9.bb
@@ -0,0 +1,180 @@
+require python.inc
+DEPENDS = "python-native libffi bzip2 db gdbm openssl readline sqlite3 zlib"
+PR = "${INC_PR}"
+
+DISTRO_SRC_URI ?= "file://sitecustomize.py"
+DISTRO_SRC_URI_linuxstdbase = ""
+SRC_URI += "\
+  file://01-use-proper-tools-for-cross-build.patch \
+  file://03-fix-tkinter-detection.patch \
+  file://06-avoid_usr_lib_termcap_path_in_linking.patch \
+  ${DISTRO_SRC_URI} \
+  file://multilib.patch \
+  file://cgi_py.patch \
+  file://setup_py_skip_cross_import_check.patch \
+  file://add-md5module-support.patch \
+  file://host_include_contamination.patch \
+  file://fix_for_using_different_libdir.patch \
+  file://setuptweaks.patch \
+  file://check-if-target-is-64b-not-host.patch \
+  file://search_db_h_in_inc_dirs_and_avoid_warning.patch \
+  file://avoid_warning_about_tkinter.patch \
+  file://avoid_warning_for_sunos_specific_module.patch \
+  file://python-2.7.3-remove-bsdb-rpath.patch \
+  file://fix-makefile-for-ptest.patch \
+  file://run-ptest \
+  file://parallel-makeinst-create-bindir.patch \
+  file://use_sysroot_ncurses_instead_of_host.patch \
+  file://avoid_parallel_make_races_on_pgen.patch \
+"
+
+S = "${WORKDIR}/Python-${PV}"
+
+inherit autotools multilib_header python-dir pythonnative
+
+CONFIGUREOPTS += " --with-system-ffi "
+
+# The 3 lines below are copied from the libffi recipe, ctypes ships its own copy of the libffi sources
+#Somehow gcc doesn't set __SOFTFP__ when passing -mfloatabi=softp :(
+TARGET_CC_ARCH_append_armv6 = " -D__SOFTFP__"
+TARGET_CC_ARCH_append_armv7a = " -D__SOFTFP__"
+
+# The following is a hack until we drop ac_cv_sizeof_off_t from site files
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'ac_cv_sizeof_off_t=8', '', d)} ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=no"
+
+do_configure_append() {
+	rm -f ${S}/Makefile.orig
+        autoreconf -Wcross --verbose --install --force --exclude=autopoint ../Python-${PV}/Modules/_ctypes/libffi
+}
+
+do_compile() {
+        # regenerate platform specific files, because they depend on system headers
+        cd ${S}/Lib/plat-linux2
+        include=${STAGING_INCDIR} ${STAGING_BINDIR_NATIVE}/python-native/python \
+                ${S}/Tools/scripts/h2py.py -i '(u_long)' \
+                ${STAGING_INCDIR}/dlfcn.h \
+                ${STAGING_INCDIR}/linux/cdrom.h \
+                ${STAGING_INCDIR}/netinet/in.h \
+                ${STAGING_INCDIR}/sys/types.h
+        sed -e 's,${STAGING_DIR_HOST},,g' -i *.py
+        cd -
+
+	# remove any bogus LD_LIBRARY_PATH
+	sed -i -e s,RUNSHARED=.*,RUNSHARED=, Makefile
+
+	if [ ! -f Makefile.orig ]; then
+		install -m 0644 Makefile Makefile.orig
+	fi
+	sed -i -e 's#^LDFLAGS=.*#LDFLAGS=${LDFLAGS} -L. -L${STAGING_LIBDIR}#g' \
+		-e 's,libdir=${libdir},libdir=${STAGING_LIBDIR},g' \
+		-e 's,libexecdir=${libexecdir},libexecdir=${STAGING_DIR_HOST}${libexecdir},g' \
+		-e 's,^LIBDIR=.*,LIBDIR=${STAGING_LIBDIR},g' \
+		-e 's,includedir=${includedir},includedir=${STAGING_INCDIR},g' \
+		-e 's,^INCLUDEDIR=.*,INCLUDE=${STAGING_INCDIR},g' \
+		-e 's,^CONFINCLUDEDIR=.*,CONFINCLUDE=${STAGING_INCDIR},g' \
+		Makefile
+	# save copy of it now, because if we do it in do_install and 
+	# then call do_install twice we get Makefile.orig == Makefile.sysroot
+	install -m 0644 Makefile Makefile.sysroot
+
+	export CROSS_COMPILE="${TARGET_PREFIX}"
+	export PYTHONBUILDDIR="${B}"
+
+	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+		STAGING_LIBDIR=${STAGING_LIBDIR} \
+		STAGING_INCDIR=${STAGING_INCDIR} \
+		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+		BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+		OPT="${CFLAGS}"
+}
+
+do_install() {
+	# make install needs the original Makefile, or otherwise the inclues would
+	# go to ${D}${STAGING...}/...
+	install -m 0644 Makefile.orig Makefile
+
+	export CROSS_COMPILE="${TARGET_PREFIX}"
+	export PYTHONBUILDDIR="${B}"
+
+	# After swizzling the makefile, we need to run the build again.
+	# install can race with the build so we have to run this first, then install
+	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+		CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
+		STAGING_LIBDIR=${STAGING_LIBDIR} \
+		STAGING_INCDIR=${STAGING_INCDIR} \
+		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+		BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+		DESTDIR=${D} LIBDIR=${libdir}
+	
+	oe_runmake HOSTPGEN=${STAGING_BINDIR_NATIVE}/python-native/pgen \
+		HOSTPYTHON=${STAGING_BINDIR_NATIVE}/python-native/python \
+		CROSSPYTHONPATH=${STAGING_LIBDIR_NATIVE}/python${PYTHON_MAJMIN}/lib-dynload/ \
+		STAGING_LIBDIR=${STAGING_LIBDIR} \
+		STAGING_INCDIR=${STAGING_INCDIR} \
+		STAGING_BASELIBDIR=${STAGING_BASELIBDIR} \
+		BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
+		DESTDIR=${D} LIBDIR=${libdir} install
+
+	install -m 0644 Makefile.sysroot ${D}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+
+	if [ -e ${WORKDIR}/sitecustomize.py ]; then
+		install -m 0644 ${WORKDIR}/sitecustomize.py ${D}/${libdir}/python${PYTHON_MAJMIN}
+	fi
+
+	oe_multilib_header python${PYTHON_MAJMIN}/pyconfig.h
+}
+
+do_install_append_class-nativesdk () {
+	create_wrapper ${D}${bindir}/python2.7 TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo'
+}
+
+SSTATE_SCAN_FILES += "Makefile"
+PACKAGE_PREPROCESS_FUNCS += "py_package_preprocess"
+
+py_package_preprocess () {
+	# copy back the old Makefile to fix target package
+	install -m 0644 ${B}/Makefile.orig ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile
+
+	# Remove references to buildmachine paths in target Makefile and _sysconfigdata
+	sed -i -e 's:--sysroot=${STAGING_DIR_TARGET}::g' -e s:'--with-libtool-sysroot=${STAGING_DIR_TARGET}'::g \
+		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/config/Makefile \
+		${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata.py
+}
+
+require python-${PYTHON_MAJMIN}-manifest.inc
+
+# manual dependency additions
+RPROVIDES_${PN}-core = "${PN}"
+RRECOMMENDS_${PN}-core = "${PN}-readline"
+RRECOMMENDS_${PN}-core_append_class-nativesdk = " nativesdk-python-modules"
+RRECOMMENDS_${PN}-crypt = "openssl"
+
+# package libpython2
+PACKAGES =+ "lib${BPN}2"
+FILES_lib${BPN}2 = "${libdir}/libpython*.so.*"
+
+# catch debug extensions (isn't that already in python-core-dbg?)
+FILES_${PN}-dbg += "${libdir}/python${PYTHON_MAJMIN}/lib-dynload/.debug"
+
+# catch all the rest (unsorted)
+PACKAGES += "${PN}-misc"
+FILES_${PN}-misc = "${libdir}/python${PYTHON_MAJMIN}"
+RDEPENDS_${PN}-ptest = "${PN}-modules ${PN}-misc"
+#inherit ptest after "require python-${PYTHON_MAJMIN}-manifest.inc" so PACKAGES doesn't get overwritten
+inherit ptest
+
+# This must come after inherit ptest for the override to take effect
+do_install_ptest() {
+	cp ${B}/Makefile ${D}${PTEST_PATH}
+	sed -e s:LIBDIR/python/ptest:${PTEST_PATH}:g \
+	 -e s:LIBDIR:${libdir}:g \
+	 -i ${D}${PTEST_PATH}/run-ptest
+}
+
+# catch manpage
+PACKAGES += "${PN}-man"
+FILES_${PN}-man = "${datadir}/man"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb b/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
new file mode 100644
index 0000000..51d1c59
--- /dev/null
+++ b/meta/recipes-devtools/qemu/nativesdk-qemu-helper_1.0.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Qemu helper scripts"
+LICENSE = "GPLv2"
+RDEPENDS_${PN} = "nativesdk-qemu"
+PR = "r9"
+
+
+LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999 \
+                    file://${COREBASE}/scripts/runqemu;endline=18;md5=77fbe442a88b1bcdc29c3ba67733b21b"
+
+
+SRC_URI = "file://${COREBASE}/scripts/runqemu \
+           file://${COREBASE}/scripts/runqemu-internal \
+           file://${COREBASE}/scripts/runqemu-addptable2image \
+           file://${COREBASE}/scripts/runqemu-gen-tapdevs \
+           file://${COREBASE}/scripts/runqemu-ifup \
+           file://${COREBASE}/scripts/runqemu-ifdown \
+           file://${COREBASE}/scripts/oe-find-native-sysroot \
+           file://${COREBASE}/scripts/runqemu-extract-sdk \
+           file://${COREBASE}/scripts/runqemu-export-rootfs \
+           file://tunctl.c \
+           file://raw2flash.c \
+          "
+
+S = "${WORKDIR}"
+
+inherit nativesdk
+
+do_compile() {
+	${CC} tunctl.c -o tunctl
+	${CC} raw2flash.c -o raw2flash.spitz
+	${CC} raw2flash.c -o flash2raw.spitz -Dflash2raw
+}
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 ${WORKDIR}${COREBASE}/scripts/oe-* ${D}${bindir}/
+	install -m 0755 ${WORKDIR}${COREBASE}/scripts/runqemu* ${D}${bindir}/
+	install tunctl ${D}${bindir}/
+	install raw2flash.spitz ${D}${bindir}/
+	install flash2raw.spitz ${D}${bindir}/
+	ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.akita
+	ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.borzoi
+	ln -fs raw2flash.spitz ${D}${bindir}/raw2flash.terrier
+	ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.akita
+	ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.borzoi
+	ln -fs flash2raw.spitz ${D}${bindir}/flash2raw.terrier
+}
diff --git a/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb b/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
new file mode 100644
index 0000000..8d27c4d
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Helper utilities needed by the runqemu script"
+LICENSE = "GPLv2"
+RDEPENDS_${PN} = "qemu-native"
+PR = "r1"
+
+LIC_FILES_CHKSUM = "file://${WORKDIR}/tunctl.c;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999"
+
+SRC_URI = "file://tunctl.c"
+
+S = "${WORKDIR}"
+
+inherit native
+
+do_compile() {
+	${CC} tunctl.c -o tunctl
+}
+
+do_install() {
+	install -d ${D}${bindir}
+	install tunctl ${D}${bindir}/
+}
diff --git a/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c b/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c
new file mode 100644
index 0000000..19faf62
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu-helper/raw2flash.c
@@ -0,0 +1,370 @@
+/*
+ * Copyright (c) 2006 OpenedHand Ltd.
+ *
+ * This file is licensed under GNU GPL v2.
+ */
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <stdlib.h>
+
+#define TFR(_)		_
+#define VERBOSE
+#define PBAR_LEN	40
+
+#define PARTITION_START	0x00700000
+
+static const int ecc_pos8[] = {
+	0x0, 0x1, 0x2,
+};
+
+static const int ecc_pos16[] = {
+	0x0, 0x1, 0x2, 0x3, 0x6, 0x7,
+};
+
+static const int ecc_pos64[] = {
+	0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+	0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+	0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+};
+
+static const int ecc_akita[] = {
+	0x05, 0x01, 0x02, 0x03, 0x06, 0x07, 0x15, 0x11,
+	0x12, 0x13, 0x16, 0x17, 0x25, 0x21, 0x22, 0x23,
+	0x26, 0x27, 0x35, 0x31, 0x32, 0x33, 0x36, 0x37,
+};
+
+struct jffs_marker_s {
+	int pos;
+	uint8_t value;
+};
+
+static const struct jffs_marker_s free_pos8[] = {
+	{ 0x03, 0xff }, { 0x04, 0xff }, { 0x06, 0x85 }, { 0x07, 0x19 },
+	{ -1 },
+};
+
+static const struct jffs_marker_s free_pos16[] = {
+	{ 0x08, 0x85 }, { 0x09, 0x19 }, { 0x0a, 0x03 }, { 0x0b, 0x20 },
+	{ 0x0c, 0x08 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 },
+	{ -1 },
+};
+
+static const struct jffs_marker_s free_pos64[] = {
+	{ 0x02, 0xff }, { 0x03, 0xff }, { 0x04, 0xff }, { 0x05, 0xff },
+	{ 0x06, 0xff }, { 0x07, 0xff }, { 0x08, 0xff }, { 0x09, 0xff },
+	{ 0x0a, 0xff }, { 0x0b, 0xff }, { 0x0c, 0xff }, { 0x0d, 0xff },
+	{ 0x0e, 0xff }, { 0x0f, 0xff }, { 0x10, 0x85 }, { 0x11, 0x19 },
+	{ 0x12, 0x03 }, { 0x13, 0x20 }, { 0x14, 0x08 }, { 0x15, 0x00 },
+	{ 0x16, 0x00 }, { 0x17, 0x00 }, { 0x18, 0xff }, { 0x19, 0xff },
+	{ 0x1a, 0xff }, { 0x1b, 0xff }, { 0x1c, 0xff }, { 0x1d, 0xff },
+	{ 0x1e, 0xff }, { 0x1f, 0xff }, { 0x20, 0xff }, { 0x21, 0xff },
+	{ 0x22, 0xff }, { 0x23, 0xff }, { 0x24, 0xff }, { 0x25, 0xff },
+	{ 0x26, 0xff }, { 0x27, 0xff },
+	{ -1 },
+};
+
+static const struct jffs_marker_s free_akita[] = {
+	{ 0x08, 0x85 }, { 0x09, 0x19 }, { 0x0a, 0x03 }, { 0x0b, 0x20 },
+	{ 0x0c, 0x08 }, { 0x0d, 0x00 }, { 0x0e, 0x00 }, { 0x0f, 0x00 },
+	{ 0x10, 0xff },
+	{ -1 },
+};
+
+#define LEN(array)	(sizeof(array) / sizeof(*array))
+
+static const struct ecc_style_s {
+	int page_size;
+	int oob_size;
+	int eccbytes;
+	int eccsize;
+	const int *eccpos;
+	int romsize;
+	const struct jffs_marker_s *freepos;
+} spitz = {
+	0x200, 0x10, 0x100, LEN(ecc_pos16), ecc_pos16, 0x01000000, free_pos16
+}, akita = {
+	0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
+}, borzoi = {
+	0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
+}, terrier = {
+	0x800, 0x40, 0x100, LEN(ecc_akita), ecc_akita, 0x08000000, free_akita
+};
+
+struct ecc_state_s {
+	int count;
+	uint8_t cp;
+	uint8_t lp[2];
+	const struct ecc_style_s *style;
+};
+
+#ifndef flash2raw
+/*
+ * Pre-calculated 256-way 1 byte column parity.  Table borrowed from Linux.
+ */
+static const uint8_t ecc_precalc_table[] = {
+	0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a,
+	0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00,
+	0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f,
+	0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
+	0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c,
+	0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
+	0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59,
+	0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
+	0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33,
+	0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
+	0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56,
+	0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
+	0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55,
+	0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
+	0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30,
+	0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
+	0x6a, 0x3f, 0x3c, 0x69, 0x33, 0x66, 0x65, 0x30,
+	0x30, 0x65, 0x66, 0x33, 0x69, 0x3c, 0x3f, 0x6a,
+	0x0f, 0x5a, 0x59, 0x0c, 0x56, 0x03, 0x00, 0x55,
+	0x55, 0x00, 0x03, 0x56, 0x0c, 0x59, 0x5a, 0x0f,
+	0x0c, 0x59, 0x5a, 0x0f, 0x55, 0x00, 0x03, 0x56,
+	0x56, 0x03, 0x00, 0x55, 0x0f, 0x5a, 0x59, 0x0c,
+	0x69, 0x3c, 0x3f, 0x6a, 0x30, 0x65, 0x66, 0x33,
+	0x33, 0x66, 0x65, 0x30, 0x6a, 0x3f, 0x3c, 0x69,
+	0x03, 0x56, 0x55, 0x00, 0x5a, 0x0f, 0x0c, 0x59,
+	0x59, 0x0c, 0x0f, 0x5a, 0x00, 0x55, 0x56, 0x03,
+	0x66, 0x33, 0x30, 0x65, 0x3f, 0x6a, 0x69, 0x3c,
+	0x3c, 0x69, 0x6a, 0x3f, 0x65, 0x30, 0x33, 0x66,
+	0x65, 0x30, 0x33, 0x66, 0x3c, 0x69, 0x6a, 0x3f,
+	0x3f, 0x6a, 0x69, 0x3c, 0x66, 0x33, 0x30, 0x65,
+	0x00, 0x55, 0x56, 0x03, 0x59, 0x0c, 0x0f, 0x5a,
+	0x5a, 0x0f, 0x0c, 0x59, 0x03, 0x56, 0x55, 0x00,
+};
+
+/* Update ECC parity count */
+static inline uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample) {
+	uint8_t idx = ecc_precalc_table[sample];
+
+	s->cp ^= idx & 0x3f;
+	if (idx & 0x40) {
+		s->lp[0] ^= ~(s->count & 0xff);
+		s->lp[1] ^= s->count & 0xff;
+	}
+	s->count ++;
+
+	return sample;
+}
+
+static void buffer_digest(struct ecc_state_s *ecc,
+		const uint8_t *buf, uint8_t *out) {
+	int i, lp_a[2];
+
+	ecc->lp[0] = 0x00;
+	ecc->lp[1] = 0x00;
+	ecc->cp = 0x00;
+	ecc->count = 0;
+	for (i = 0; i < ecc->style->eccbytes; i ++)
+		ecc_digest(ecc, buf[i]);
+
+# define BSHR(byte, from, to)	((ecc->lp[byte] >> (from - to)) & (1 << to))
+	lp_a[0] =
+		BSHR(0, 4, 0) | BSHR(0, 5, 2) |
+		BSHR(0, 6, 4) | BSHR(0, 7, 6) |
+		BSHR(1, 4, 1) | BSHR(1, 5, 3) |
+		BSHR(1, 6, 5) | BSHR(1, 7, 7);
+
+# define BSHL(byte, from, to)	((ecc->lp[byte] << (to - from)) & (1 << to))
+	lp_a[1] =
+		BSHL(0, 0, 0) | BSHL(0, 1, 2) |
+		BSHL(0, 2, 4) | BSHL(0, 3, 6) |
+		BSHL(1, 0, 1) | BSHL(1, 1, 3) |
+		BSHL(1, 2, 5) | BSHL(1, 3, 7);
+
+	out[0] = ~lp_a[1];
+	out[1] = ~lp_a[0];
+	out[2] = (~ecc->cp << 2) | 0x03;
+}
+
+static void jffs2_format(const struct ecc_state_s *ecc, uint8_t oob[]) {
+	const struct jffs_marker_s *byte;
+	for (byte = ecc->style->freepos; byte->pos >= 0; byte ++)
+		oob[byte->pos] = byte->value;
+}
+
+static void buffer_fill(const struct ecc_state_s *ecc, uint8_t buffer[],
+		int *len, int *partition, int count, uint8_t jffs_buffer[]) {
+	int ret;
+
+	switch (*partition) {
+	case 0:
+		if (count < PARTITION_START) {
+			memcpy(buffer, jffs_buffer + count,
+					ecc->style->eccbytes);
+			*len = ecc->style->eccbytes;
+			break;
+		}
+		*partition = 1;
+	case 1:
+		if (count - PARTITION_START < PARTITION_START) {
+			memcpy(buffer, jffs_buffer + count - PARTITION_START,
+					ecc->style->eccbytes);
+			*len = ecc->style->eccbytes;
+			break;
+		}
+
+		while (*len < ecc->style->eccbytes) {
+			ret = TFR(read(0, buffer + *len, 0x800 - *len));
+			if (ret <= 0)
+				break;
+			*len += ret;
+		}
+
+		if (*len == 0)
+			*partition = 2;
+		else if (*len < ecc->style->eccbytes) {
+			fprintf(stderr, "\nWarning: %i stray bytes\n", *len);
+			memset(buffer + *len, 0xff,
+					ecc->style->eccbytes - *len);
+			*len = ecc->style->eccbytes;
+			break;
+		} else
+			break;
+	case 2:
+		memset(buffer, 0xff, ecc->style->eccbytes);
+		*len = ecc->style->eccbytes;
+		break;
+	}
+}
+
+int main(int argc, char *argv[], char *envp[]) {
+	struct ecc_state_s ecc;
+	uint8_t buffer[0x1000], ecc_payload[0x40], regs[3], *jffs;
+	int ret, len, eccbyte, count, partition;
+
+	/* Check if we're called by "raw2flash.spitz" or similar */
+	len = strlen(argv[0]);
+	if (!strcasecmp(argv[0] + len - 5, "akita"))
+		ecc.style = &akita;
+	else if (!strcasecmp(argv[0] + len - 6, "borzoi"))
+		ecc.style = &borzoi;
+	else if (!strcasecmp(argv[0] + len - 7, "terrier"))
+		ecc.style = &terrier;
+	else
+		ecc.style = &spitz;
+
+# ifdef VERBOSE
+	fprintf(stderr, "[");
+# endif
+
+	/* Skip first 10 bytes */
+	TFR(read(0, buffer, 0x10));
+
+	len = 0;
+	jffs = (uint8_t *) malloc(PARTITION_START);
+	while (len < PARTITION_START) {
+		ret = TFR(read(0, jffs + len, PARTITION_START - len));
+		if (ret <= 0)
+			break;
+		len += ret;
+	}
+
+	/* Convert data from stdin */
+	partition = len = eccbyte = count = 0;
+	memset(ecc_payload, 0xff, ecc.style->oob_size);
+	jffs2_format(&ecc, ecc_payload);
+	while (count < ecc.style->romsize) {
+		buffer_fill(&ecc, buffer, &len, &partition, count, jffs);
+		buffer_digest(&ecc, buffer, regs);
+
+		ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[0];
+		ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[1];
+		ecc_payload[ecc.style->eccpos[eccbyte ++]] = regs[2];
+
+		TFR(write(1, buffer, ecc.style->eccbytes));
+		count += ecc.style->eccbytes;
+		len -= ecc.style->eccbytes;
+		memmove(buffer, buffer + ecc.style->eccbytes, len);
+
+		if (eccbyte >= ecc.style->eccsize) {
+			TFR(write(1, ecc_payload, ecc.style->oob_size));
+			eccbyte = 0;
+			memset(ecc_payload, 0xff, ecc.style->oob_size);
+			if (partition < 2)
+				jffs2_format(&ecc, ecc_payload);
+		}
+
+# ifdef VERBOSE
+		if (count * PBAR_LEN / ecc.style->romsize >
+				(count - ecc.style->eccbytes) *
+				PBAR_LEN / ecc.style->romsize)
+			fprintf(stderr, "#");
+# endif
+	}
+
+# ifdef VERBOSE
+	fprintf(stderr, "]\n");
+# endif
+	free(jffs);
+	return 0;
+}
+#else
+int main(int argc, char *argv[], char *envp[]) {
+	struct ecc_state_s ecc;
+	uint8_t buffer[0x1000];
+	int ret, len, count;
+
+	/* Check if we're called by "flash2raw.spitz" or similar */
+	len = strlen(argv[0]);
+	if (!strcasecmp(argv[0] + len - 5, "akita"))
+		ecc.style = &akita;
+	else if (!strcasecmp(argv[0] + len - 6, "borzoi"))
+		ecc.style = &borzoi;
+	else if (!strcasecmp(argv[0] + len - 7, "terrier"))
+		ecc.style = &terrier;
+	else
+		ecc.style = &spitz;
+
+# ifdef VERBOSE
+	fprintf(stderr, "[");
+# endif
+
+	/* Convert data from stdin */
+	count = 0;
+	while (count < ecc.style->romsize) {
+		len = 0;
+		while (len < ecc.style->page_size) {
+			ret = TFR(read(0, buffer + len,
+						ecc.style->page_size - len));
+			if (ret <= 0)
+				break;
+			len += ret;
+		}
+		if (len == 0)
+			break;
+		if (len < ecc.style->page_size) {
+			fprintf(stderr, "\nWarning: %i stray bytes\n", len);
+		}
+
+		TFR(write(1, buffer, ecc.style->page_size));
+
+		count += len;
+		len = 0;
+		while (len < ecc.style->oob_size) {
+			ret = TFR(read(0, buffer, ecc.style->oob_size - len));
+			if (ret <= 0)
+				break;
+			len += ret;
+		}
+
+# ifdef VERBOSE
+		if (count * PBAR_LEN / ecc.style->romsize >
+				(count - ecc.style->page_size) *
+				PBAR_LEN / ecc.style->romsize)
+			fprintf(stderr, "#");
+# endif
+	}
+
+# ifdef VERBOSE
+	fprintf(stderr, "]\n");
+# endif
+	return 0;
+}
+#endif
diff --git a/meta/recipes-devtools/qemu/qemu-helper/tunctl.c b/meta/recipes-devtools/qemu/qemu-helper/tunctl.c
new file mode 100644
index 0000000..16e24a2
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu-helper/tunctl.c
@@ -0,0 +1,156 @@
+/* Copyright 2002 Jeff Dike
+ * Licensed under the GPL
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <pwd.h>
+#include <grp.h>
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <linux/if_tun.h>
+
+/* TUNSETGROUP appeared in 2.6.23 */
+#ifndef TUNSETGROUP
+#define TUNSETGROUP   _IOW('T', 206, int)
+#endif
+
+static void Usage(char *name)
+{
+  fprintf(stderr, "Create: %s [-b] [-u owner] [-g group] [-t device-name] "
+	  "[-f tun-clone-device]\n", name);
+  fprintf(stderr, "Delete: %s -d device-name [-f tun-clone-device]\n\n",
+	  name);
+  fprintf(stderr, "The default tun clone device is /dev/net/tun - some systems"
+	  " use\n/dev/misc/net/tun instead\n\n");
+  fprintf(stderr, "-b will result in brief output (just the device name)\n");
+  exit(1);
+}
+
+int main(int argc, char **argv)
+{
+  struct ifreq ifr;
+  struct passwd *pw;
+  struct group *gr;
+  uid_t owner = -1;
+  gid_t group = -1;
+  int tap_fd, opt, delete = 0, brief = 0;
+  char *tun = "", *file = "/dev/net/tun", *name = argv[0], *end;
+
+  while((opt = getopt(argc, argv, "bd:f:t:u:g:")) > 0){
+    switch(opt) {
+      case 'b':
+        brief = 1;
+        break;
+      case 'd':
+        delete = 1;
+	tun = optarg;
+        break;
+      case 'f':
+	file = optarg;
+	break;
+      case 'u':
+	pw = getpwnam(optarg);
+	if(pw != NULL){
+	  owner = pw->pw_uid;
+	  break;
+	}
+        owner = strtol(optarg, &end, 0);
+	if(*end != '\0'){
+	  fprintf(stderr, "'%s' is neither a username nor a numeric uid.\n",
+		  optarg);
+	  Usage(name);
+	}
+        break;
+      case 'g':
+	gr = getgrnam(optarg);
+	if(gr != NULL){
+	  group = gr->gr_gid;
+	  break;
+	}
+        group = strtol(optarg, &end, 0);
+	if(*end != '\0'){
+	  fprintf(stderr, "'%s' is neither a groupname nor a numeric group.\n",
+		  optarg);
+	  Usage(name);
+	}
+        break;
+
+      case 't':
+        tun = optarg;
+        break;
+      case 'h':
+      default:
+        Usage(name);
+    }
+  }
+
+  argv += optind;
+  argc -= optind;
+
+  if(argc > 0)
+    Usage(name);
+
+  if((tap_fd = open(file, O_RDWR)) < 0){
+    fprintf(stderr, "Failed to open '%s' : ", file);
+    perror("");
+    exit(1);
+  }
+
+  memset(&ifr, 0, sizeof(ifr));
+
+  ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
+  strncpy(ifr.ifr_name, tun, sizeof(ifr.ifr_name) - 1);
+  if(ioctl(tap_fd, TUNSETIFF, (void *) &ifr) < 0){
+    perror("TUNSETIFF");
+    exit(1);
+  }
+
+  if(delete){
+    if(ioctl(tap_fd, TUNSETPERSIST, 0) < 0){
+      perror("disabling TUNSETPERSIST");
+      exit(1);
+    }
+    printf("Set '%s' nonpersistent\n", ifr.ifr_name);
+  }
+  else {
+    /* emulate behaviour prior to TUNSETGROUP */
+    if(owner == -1 && group == -1) {
+      owner = geteuid();
+    }
+
+    if(owner != -1) {
+      if(ioctl(tap_fd, TUNSETOWNER, owner) < 0){
+      	perror("TUNSETOWNER");
+      	exit(1);
+      }
+    }
+    if(group != -1) {
+      if(ioctl(tap_fd, TUNSETGROUP, group) < 0){
+      	perror("TUNSETGROUP");
+      	exit(1);
+      }
+    }
+
+    if(ioctl(tap_fd, TUNSETPERSIST, 1) < 0){
+      perror("enabling TUNSETPERSIST");
+      exit(1);
+    }
+
+    if(brief)
+      printf("%s\n", ifr.ifr_name);
+    else {
+      printf("Set '%s' persistent and owned by", ifr.ifr_name);
+      if(owner != -1)
+          printf(" uid %d", owner);
+      if(group != -1)
+          printf(" gid %d", group);
+      printf("\n");
+    }
+  }
+  return(0);
+}
diff --git a/meta/recipes-devtools/qemu/qemu-targets.inc b/meta/recipes-devtools/qemu/qemu-targets.inc
new file mode 100644
index 0000000..5c35655
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu-targets.inc
@@ -0,0 +1,22 @@
+# possible arch values are arm aarch64 mips mipsel mips64 mips64el ppc ppc64 ppc64abi32
+# ppcemb armeb alpha sparc32plus i386 x86_64 cris m68k microblaze sparc sparc32
+# sparc32plus
+
+def get_qemu_target_list(d):
+    import bb
+    archs = d.getVar('QEMU_TARGETS', True).split()
+    tos = d.getVar('HOST_OS', True)
+    softmmuonly = ""
+    for arch in ['mips64', 'mips64el', 'ppcemb']:
+        if arch in archs:
+            softmmuonly += arch + "-softmmu,"
+            archs.remove(arch)
+    linuxuseronly = ""
+    for arch in ['armeb', 'alpha', 'ppc64abi32', 'sparc32plus']:
+        if arch in archs:
+            linuxuseronly += arch + "-linux-user,"
+            archs.remove(arch)
+    if 'linux' not in tos:
+        return softmmuonly + ''.join([arch + "-softmmu" + "," for arch in archs]).rstrip(',')
+    return softmmuonly + linuxuseronly + ''.join([arch + "-linux-user" + "," + arch + "-softmmu" + "," for arch in archs]).rstrip(',')
+
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
new file mode 100644
index 0000000..738bf2b
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -0,0 +1,137 @@
+SUMMARY = "Fast open source processor emulator"
+HOMEPAGE = "http://qemu.org"
+LICENSE = "GPLv2 & LGPLv2.1"
+DEPENDS = "glib-2.0 zlib pixman"
+RDEPENDS_${PN}_class-target += "bash python"
+RDEPENDS_${PN}-ptest = "bash make"
+
+require qemu-targets.inc
+inherit autotools ptest
+BBCLASSEXTEND = "native nativesdk"
+
+PR = "r1"
+
+# QEMU_TARGETS is overridable variable
+QEMU_TARGETS ?= "arm aarch64 i386 mips mipsel mips64 mips64el ppc sh4 x86_64"
+
+SRC_URI = "\
+    file://powerpc_rom.bin \
+    file://disable-grabs.patch \
+    file://exclude-some-arm-EABI-obsolete-syscalls.patch \
+    file://wacom.patch \
+    file://add-ptest-in-makefile.patch \
+    file://run-ptest \
+    file://cpus.c-qemu_mutex_lock_iothread-fix-race-condition-a.patch \
+    "
+
+SRC_URI_append_class-native = "\
+    file://fix-libcap-header-issue-on-some-distro.patch \
+    file://cpus.c-qemu_cpu_kick_thread_debugging.patch \
+    "
+
+EXTRA_OECONF += "--target-list=${@get_qemu_target_list(d)} --disable-werror  --disable-bluez --disable-libiscsi --with-system-pixman --extra-cflags='${CFLAGS}'"
+
+EXTRA_OECONF_append_class-native = " --enable-debug --enable-debug-info"
+INHIBIT_SYSROOT_STRIP = "1"
+
+EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disable-werror \
+				"
+export LIBTOOL="${HOST_SYS}-libtool"
+
+do_configure_prepend_class-native() {
+	# Append build host pkg-config paths for native target since the host may provide sdl
+	BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
+	if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
+		export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
+	fi
+}
+
+KVMENABLE = "--enable-kvm"
+KVMENABLE_darwin = "--disable-kvm"
+KVMENABLE_mingw32 = "--disable-kvm"
+
+do_configure() {
+    # Handle distros such as CentOS 5 32-bit that do not have kvm support
+    KVMOPTS="--disable-kvm"
+    if [ "${PN}" != "qemu-native" -a "${PN}" != "nativesdk-qemu" ] \
+       || [ -f /usr/include/linux/kvm.h ] ; then
+       KVMOPTS="${KVMENABLE}"
+    fi
+
+    ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --libexecdir=${libexecdir} --localstatedir=${localstatedir} --disable-strip ${EXTRA_OECONF} $KVMOPTS
+    test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
+}
+
+do_compile_ptest() {
+	make buildtest-TESTS
+}
+
+do_install_ptest() {
+	cp -rL ${B}/tests ${D}${PTEST_PATH}
+	find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcod]" | xargs -i rm -rf {}
+
+	cp ${S}/tests/Makefile ${D}${PTEST_PATH}/tests
+}
+
+do_install () {
+	export STRIP="true"
+	autotools_do_install
+	install -d ${D}${datadir}/qemu
+	install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
+}
+
+# The following fragment will create a wrapper for qemu-mips user emulation
+# binary in order to work around a segmentation fault issue. Basically, by
+# default, the reserved virtual address space for 32-on-64 bit is set to 4GB.
+# This will trigger a MMU access fault in the virtual CPU. With this change,
+# the qemu-mips works fine.
+# IMPORTANT: This piece needs to be removed once the root cause is fixed!
+do_install_append() {
+	if [ -e "${D}/${bindir}/qemu-mips" ]; then
+		create_wrapper ${D}/${bindir}/qemu-mips \
+			QEMU_RESERVED_VA=0x0
+	fi
+}
+# END of qemu-mips workaround
+
+PACKAGECONFIG ??= " \
+	fdt sdl \
+	${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+	${@bb.utils.contains('DISTRO_FEATURES', 'xen', 'xen', '', d)} \
+	"
+PACKAGECONFIG_class-native ??= "fdt alsa uuid"
+PACKAGECONFIG_class-nativesdk ??= "fdt sdl"
+NATIVEDEPS = ""
+NATIVEDEPS_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libxext-native', '',d)}"
+PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl ${NATIVEDEPS},"
+PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr,--disable-virtfs,libcap attr,"
+PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
+PACKAGECONFIG[xfs] = "--enable-xfsctl,--disable-xfsctl,xfsprogs,"
+PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen,xen-libxenstore xen-libxenctrl xen-libxenguest"
+PACKAGECONFIG[vnc-tls] = "--enable-vnc --enable-vnc-tls,--disable-vnc-tls, gnutls,"
+PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
+PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
+PACKAGECONFIG[vnc-png] = "--enable-vnc --enable-vnc-png,--disable-vnc-png,libpng,"
+PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,libcurl,"
+PACKAGECONFIG[nss] = "--enable-smartcard-nss,--disable-smartcard-nss,nss,"
+PACKAGECONFIG[uuid] = "--enable-uuid,--disable-uuid,util-linux,"
+PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
+PACKAGECONFIG[gtk+] = "--enable-gtk --enable-vte,--disable-gtk --disable-vte,gtk+ libvte,"
+PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
+PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2,"
+PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
+PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
+PACKAGECONFIG[alsa] = ",,alsa-lib"
+PACKAGECONFIG[glx] = "--enable-opengl,--disable-opengl,mesa"
+PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
+PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
+PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
+
+EXTRA_OECONF += "${@bb.utils.contains('PACKAGECONFIG', 'alsa', '--audio-drv-list=oss,alsa', '', d)}"
+
+# Qemu target will not build in world build for ARM or Mips
+BROKEN_qemuarm = "1"
+BROKEN_qemumips64 = "1"
+BROKEN_qemumips = "1"
+
+INSANE_SKIP_${PN} = "arch"
diff --git a/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch b/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
new file mode 100644
index 0000000..1a6cf51
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/Qemu-Arm-versatilepb-Add-memory-size-checking.patch
@@ -0,0 +1,46 @@
+From 896fa02c24347e6e9259812cfda187b1d6ca6199 Mon Sep 17 00:00:00 2001
+From: Jiang Lu <lu.jiang@windriver.com>
+Date: Wed, 13 Nov 2013 10:38:08 +0800
+Subject: [PATCH] Qemu:Arm:versatilepb: Add memory size checking
+
+The machine can not work with memory over 256M, so add a checking
+at startup. If the memory size exceed 256M, just stop emulation then
+throw out warning about memory limitation.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jiang Lu <lu.jiang@windriver.com>
+
+Updated it on 2014-01-15 for rebasing
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Update it when upgrade qemu to 2.2.0
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+---
+ hw/arm/versatilepb.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c
+index 6c69f4e..9278d90 100644
+--- a/hw/arm/versatilepb.c
++++ b/hw/arm/versatilepb.c
+@@ -204,6 +204,13 @@ static void versatile_init(MachineState *machine, int board_id)
+         exit(1);
+     }
+
++    if (machine->ram_size > (256 << 20)) {
++        fprintf(stderr,
++                "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n",
++                ((unsigned int)ram_size / (1 << 20)));
++        exit(1);
++    }
++
+     cpuobj = object_new(object_class_get_name(cpu_oc));
+
+     /* By default ARM1176 CPUs have EL3 enabled.  This board does not
+-- 
+2.1.0
+
diff --git a/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch b/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch
new file mode 100644
index 0000000..a99f720
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/add-ptest-in-makefile.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+Add subpackage -ptest which runs all unit test cases for qemu.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ tests/Makefile |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/tests/Makefile b/tests/Makefile
+index 88f7105..3f40b4b 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -405,3 +405,12 @@ all: $(QEMU_IOTESTS_HELPERS-y)
+ 
+ -include $(wildcard tests/*.d)
+ -include $(wildcard tests/libqos/*.d)
++
++buildtest-TESTS: $(check-unit-y)
++
++runtest-TESTS:
++	for f in $(check-unit-y); do \
++		nf=$$(echo $$f | sed 's/tests\//\.\//g'); \
++		$$nf; \
++	done
++
+--
+1.7.9.5
+
diff --git a/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch b/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch
new file mode 100644
index 0000000..59cdc1c
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/configure-fix-Darwin-target-detection.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+
+From 9ac096d8eccf2d56ece646320c282c8369f8337c Mon Sep 17 00:00:00 2001
+From: Cristian Iorga <cristian.iorga@intel.com>
+Date: Tue, 29 Jul 2014 18:35:59 +0300
+Subject: [PATCH] configure: fix Darwin target detection
+
+fix Darwin target detection for qemu
+cross-compilation.
+
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+---
+ configure | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure b/configure
+index 283c71c..1c66a11 100755
+--- a/configure
++++ b/configure
+@@ -444,6 +444,8 @@ elif check_define __sun__ ; then
+   targetos='SunOS'
+ elif check_define __HAIKU__ ; then
+   targetos='Haiku'
++elif check_define __APPLE__ ; then
++  targetos='Darwin'
+ else
+   targetos=`uname -s`
+ fi
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch b/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch
new file mode 100644
index 0000000..6822132
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_cpu_kick_thread_debugging.patch
@@ -0,0 +1,76 @@
+From 697a834c35d19447b7dcdb9e1d9434bc6ce17c21 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Wed, 12 Aug 2015 15:11:30 -0500
+Subject: [PATCH] cpus.c: Add error messages when qemi_cpu_kick_thread fails.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Add custom_debug.h with function for print backtrace information.
+When pthread_kill fails in qemu_cpu_kick_thread display backtrace and
+current cpu information.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ cpus.c         |  5 +++++
+ custom_debug.h | 24 ++++++++++++++++++++++++
+ 2 files changed, 29 insertions(+)
+ create mode 100644 custom_debug.h
+
+diff --git a/cpus.c b/cpus.c
+index a822ce3..7e4786e 100644
+--- a/cpus.c
++++ b/cpus.c
+@@ -1080,6 +1080,8 @@ static void *qemu_tcg_cpu_thread_fn(void *arg)
+     return NULL;
+ }
+ 
++#include "custom_debug.h"
++
+ static void qemu_cpu_kick_thread(CPUState *cpu)
+ {
+ #ifndef _WIN32
+@@ -1088,6 +1090,9 @@ static void qemu_cpu_kick_thread(CPUState *cpu)
+     err = pthread_kill(cpu->thread->thread, SIG_IPI);
+     if (err) {
+         fprintf(stderr, "qemu:%s: %s", __func__, strerror(err));
++        fprintf(stderr, "CPU #%d:\n", cpu->cpu_index);
++        cpu_dump_state(cpu, stderr, fprintf, 0);
++        backtrace_print();
+         exit(1);
+     }
+ #else /* _WIN32 */
+diff --git a/custom_debug.h b/custom_debug.h
+new file mode 100644
+index 0000000..f029e45
+--- /dev/null
++++ b/custom_debug.h
+@@ -0,0 +1,24 @@
++#include <execinfo.h>
++#include <stdio.h>
++#define BACKTRACE_MAX 128
++static void backtrace_print(void)
++{
++	int nfuncs = 0;
++	void *buf[BACKTRACE_MAX];
++	char **symbols;
++	int i;
++
++	nfuncs = backtrace(buf, BACKTRACE_MAX);
++
++	symbols = backtrace_symbols(buf, nfuncs);
++	if (symbols == NULL) {
++		fprintf(stderr, "backtrace_print failed to get symbols");
++		return;
++	}
++
++	fprintf(stderr, "Backtrace ...\n");
++	for (i = 0; i < nfuncs; i++)
++		fprintf(stderr, "%s\n", symbols[i]);
++
++	free(symbols);
++}
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_mutex_lock_iothread-fix-race-condition-a.patch b/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_mutex_lock_iothread-fix-race-condition-a.patch
new file mode 100644
index 0000000..45dffab
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/cpus.c-qemu_mutex_lock_iothread-fix-race-condition-a.patch
@@ -0,0 +1,45 @@
+Upstream-Status: Submitted
+
+From f354b9333408d411854af058cc44cceda60b4473 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?An=C3=ADbal=20Lim=C3=B3n?= <anibal.limon@linux.intel.com>
+Date: Thu, 3 Sep 2015 14:07:34 -0500
+Subject: [PATCH] cpus.c: qemu_mutex_lock_iothread fix race condition at cpu
+ thread init
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When QEMU starts the RCU thread executes qemu_mutex_lock_thread
+causing error "qemu:qemu_cpu_kick_thread: No such process" and exits.
+
+This isn't occur frequently but in glibc the thread id can exist and
+this not guarantee that the thread is on active/running state. If is
+inserted a sleep(1) after newthread assignment [1] the issue appears.
+
+So not make assumption that thread exist if first_cpu->thread is set
+then change the validation of cpu to created that is set into cpu
+threads (kvm, tcg, dummy).
+
+[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=nptl/pthread_create.c;h=d10f4ea8004e1d8f3a268b95cc0f8d93b8d89867;hb=HEAD#l621
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+---
+ cpus.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpus.c b/cpus.c
+index 7e4786e..05e5400 100644
+--- a/cpus.c
++++ b/cpus.c
+@@ -1171,7 +1171,7 @@ void qemu_mutex_lock_iothread(void)
+      * TCG code execution.
+      */
+     if (!tcg_enabled() || qemu_in_vcpu_thread() ||
+-        !first_cpu || !first_cpu->thread) {
++        !first_cpu || !first_cpu->created) {
+         qemu_mutex_lock(&qemu_global_mutex);
+         atomic_dec(&iothread_requesting_mutex);
+     } else {
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/qemu/qemu/disable-grabs.patch b/meta/recipes-devtools/qemu/qemu/disable-grabs.patch
new file mode 100644
index 0000000..41726b1
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/disable-grabs.patch
@@ -0,0 +1,72 @@
+When the pointer enters the Qemu window it calls SDL_WM_GrabInput, which calls
+XGrabPointer in a busyloop until it returns GrabSuccess. However if there's already
+a pointer grab (screen is locked, a menu is open) then qemu will hang until the
+grab can be taken.  In the specific case of a headless X server on an autobuilder, once
+the screensaver has kicked in any qemu instance that appears underneath the
+pointer will hang.
+
+I'm not entirely sure why pointer grabs are required (the documentation
+explicitly says it doesn't do grabs when using a tablet, which we are) so wrap
+them in a conditional that can be set by the autobuilder environment, preserving
+the current grabbing behaviour for everyone else.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 4b1988ecb01a178269ec0513a75f2ec620c7ef6a Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 18 Sep 2013 14:04:54 +0100
+Subject: [PATCH] sdl.c: allow user to disable pointer grabs
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Signed-off-by: Eric Bénard <eric@eukrea.com>
+---
+ ui/sdl.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/ui/sdl.c b/ui/sdl.c
+index 39a42d6..9b8abe5 100644
+--- a/ui/sdl.c
++++ b/ui/sdl.c
+@@ -59,6 +59,10 @@ static SDL_Cursor *guest_sprite = NULL;
+ static SDL_PixelFormat host_format;
+ static int scaling_active = 0;
+ static Notifier mouse_mode_notifier;
++#ifndef True
++#define True 1
++#endif
++static doing_grabs = True;
+ 
+ static void sdl_update(DisplayChangeListener *dcl,
+                        int x, int y, int w, int h)
+@@ -384,14 +388,16 @@ static void sdl_grab_start(void)
+             SDL_WarpMouse(guest_x, guest_y);
+     } else
+         sdl_hide_cursor();
+-    SDL_WM_GrabInput(SDL_GRAB_ON);
++    if (doing_grabs)
++      SDL_WM_GrabInput(SDL_GRAB_ON);
+     gui_grab = 1;
+     sdl_update_caption();
+ }
+ 
+ static void sdl_grab_end(void)
+ {
+-    SDL_WM_GrabInput(SDL_GRAB_OFF);
++    if (doing_grabs)
++      SDL_WM_GrabInput(SDL_GRAB_OFF);
+     gui_grab = 0;
+     sdl_show_cursor();
+     sdl_update_caption();
+@@ -909,6 +915,8 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
+      * This requires SDL >= 1.2.14. */
+     setenv("SDL_DISABLE_LOCK_KEYS", "1", 1);
+ 
++    doing_grabs = (getenv("QEMU_DONT_GRAB") == NULL);
++
+     flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
+     if (SDL_Init (flags)) {
+         fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",
+-- 
+1.8.3.1
+
diff --git a/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch b/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch
new file mode 100644
index 0000000..171bda7
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/exclude-some-arm-EABI-obsolete-syscalls.patch
@@ -0,0 +1,93 @@
+[PATCH] exclude some arm EABI obsolete syscalls
+
+Upstream-Status: Pending
+
+some syscalls are obsolete and no longer available for EABI, exclude them to
+fix the below error:
+	In file included from qemu-seccomp.c:16:0:
+	qemu-seccomp.c:28:7: error: '__NR_select' undeclared here (not in a function)
+	      { SCMP_SYS(select), 252 },
+	        ^
+	qemu-seccomp.c:36:7: error: '__NR_mmap' undeclared here (not in a function)
+	      { SCMP_SYS(mmap), 247 },
+	        ^
+	qemu-seccomp.c:57:7: error: '__NR_getrlimit' undeclared here (not in a function)
+	      { SCMP_SYS(getrlimit), 245 },
+	        ^
+	qemu-seccomp.c:96:7: error: '__NR_time' undeclared here (not in a function)
+	      { SCMP_SYS(time), 245 },
+	        ^
+	qemu-seccomp.c:185:7: error: '__NR_alarm' undeclared here (not in a function)
+	      { SCMP_SYS(alarm), 241 },
+
+please refer source files:
+	arch/arm/include/uapi/asm/unistd.h
+or kernel header:
+	/usr/include/asm/unistd.h
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ qemu-seccomp.c | 14 ++++++++------
+ 1 file changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/qemu-seccomp.c b/qemu-seccomp.c
+index caa926e..5a78502 100644
+--- a/qemu-seccomp.c
++++ b/qemu-seccomp.c
+@@ -25,15 +25,21 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+     { SCMP_SYS(timer_settime), 255 },
+     { SCMP_SYS(timer_gettime), 254 },
+     { SCMP_SYS(futex), 253 },
++#if !defined(__ARM_EABI__)
+     { SCMP_SYS(select), 252 },
++    { SCMP_SYS(time), 245 },
++    { SCMP_SYS(alarm), 241 },
++    { SCMP_SYS(getrlimit), 245 },
++    { SCMP_SYS(mmap), 247 },
++    { SCMP_SYS(socketcall), 250 },
++    { SCMP_SYS(ipc), 245 },
++#endif
+     { SCMP_SYS(recvfrom), 251 },
+     { SCMP_SYS(sendto), 250 },
+-    { SCMP_SYS(socketcall), 250 },
+     { SCMP_SYS(read), 249 },
+     { SCMP_SYS(io_submit), 249 },
+     { SCMP_SYS(brk), 248 },
+     { SCMP_SYS(clone), 247 },
+-    { SCMP_SYS(mmap), 247 },
+     { SCMP_SYS(mprotect), 246 },
+     { SCMP_SYS(execve), 245 },
+     { SCMP_SYS(open), 245 },
+@@ -48,13 +54,11 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+     { SCMP_SYS(bind), 245 },
+     { SCMP_SYS(listen), 245 },
+     { SCMP_SYS(semget), 245 },
+-    { SCMP_SYS(ipc), 245 },
+     { SCMP_SYS(gettimeofday), 245 },
+     { SCMP_SYS(readlink), 245 },
+     { SCMP_SYS(access), 245 },
+     { SCMP_SYS(prctl), 245 },
+     { SCMP_SYS(signalfd), 245 },
+-    { SCMP_SYS(getrlimit), 245 },
+     { SCMP_SYS(set_tid_address), 245 },
+     { SCMP_SYS(statfs), 245 },
+     { SCMP_SYS(unlink), 245 },
+@@ -93,7 +97,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+     { SCMP_SYS(times), 245 },
+     { SCMP_SYS(exit), 245 },
+     { SCMP_SYS(clock_gettime), 245 },
+-    { SCMP_SYS(time), 245 },
+     { SCMP_SYS(restart_syscall), 245 },
+     { SCMP_SYS(pwrite64), 245 },
+     { SCMP_SYS(nanosleep), 245 },
+@@ -182,7 +185,6 @@ static const struct QemuSeccompSyscall seccomp_whitelist[] = {
+     { SCMP_SYS(lstat64), 241 },
+     { SCMP_SYS(sendfile64), 241 },
+     { SCMP_SYS(ugetrlimit), 241 },
+-    { SCMP_SYS(alarm), 241 },
+     { SCMP_SYS(rt_sigsuspend), 241 },
+     { SCMP_SYS(rt_sigqueueinfo), 241 },
+     { SCMP_SYS(rt_tgsigqueueinfo), 241 },
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch b/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch
new file mode 100644
index 0000000..13a6ea2
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/fix-libcap-header-issue-on-some-distro.patch
@@ -0,0 +1,84 @@
+fix libcap header issue on some distro
+
+1, When build qemu-native on SLED 11.2, there is an error:
+...
+| In file included from /usr/include/bits/sigcontext.h:28,
+|  from /usr/include/signal.h:339,
+|  from /buildarea2/tmp/work/i686-linux/qemu-native/1.4.0-r0/
+qemu-1.4.0/include/qemu-common.h:42,
+|  from fsdev/virtfs-proxy-helper.c:23:
+|  /usr/include/asm/sigcontext.h:28: error: expected specifier-
+qualifier-list before '__u64'
+|  /usr/include/asm/sigcontext.h:191: error: expected specifier-
+qualifier-list before '__u64'
+...
+
+2, The virtfs-proxy-helper.c includes <sys/capability.h> and
+qemu-common.h in sequence. The header include map is:
+(`-->' presents `include')
+...
+"virtfs-proxy-helper.c" --> <sys/capability.h>
+...
+"virtfs-proxy-helper.c" --> "qemu-common.h" --> <signal.h> -->
+<bits/sigcontext.h> --> <asm/sigcontext.h> --> <linux/types.h> -->
+<asm/types.h> --> <asm-generic/types.h> --> <asm-generic/int-ll64.h>
+...
+
+3, The bug is found on SLED 11.2 x86. In libcap header file
+/usr/include/sys/capability.h, it does evil stuff like this:
+...
+  25 /*
+  26  * Make sure we can be included from userland by preventing
+  27  * capability.h from including other kernel headers
+  28  */
+  29 #define _LINUX_TYPES_H
+  30 #define _LINUX_FS_H
+  31 #define __LINUX_COMPILER_H
+  32 #define __user
+  33
+  34 typedef unsigned int __u32;
+  35 typedef __u32 __le32;
+...
+This completely prevents including /usr/include/linux/types.h.
+The above `<asm/sigcontext.h> --> <linux/types.h>' is prevented,
+and '__u64' is defined in <asm-generic/int-ll64.h>.
+
+4, Modify virtfs-proxy-helper.c to include <sys/capability.h>
+last to workaround the issue.
+
+http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html
+http://patchwork.linuxtv.org/patch/12748/
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ fsdev/virtfs-proxy-helper.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/fsdev/virtfs-proxy-helper.c b/fsdev/virtfs-proxy-helper.c
+--- a/fsdev/virtfs-proxy-helper.c
++++ b/fsdev/virtfs-proxy-helper.c
+@@ -12,7 +12,6 @@
+ #include <sys/resource.h>
+ #include <getopt.h>
+ #include <syslog.h>
+-#include <sys/capability.h>
+ #include <sys/fsuid.h>
+ #include <sys/vfs.h>
+ #include <sys/ioctl.h>
+@@ -26,7 +25,11 @@
+ #include "virtio-9p-marshal.h"
+ #include "hw/9pfs/virtio-9p-proxy.h"
+ #include "fsdev/virtio-9p-marshal.h"
+-
++/*
++ * Include this one last due to some versions of it being buggy:
++ * http://www.linuxtv.org/pipermail/vdr/2009-August/021194.html
++ */
++#include <sys/capability.h>
+ #define PROGNAME "virtfs-proxy-helper"
+ 
+ #ifndef XFS_SUPER_MAGIC
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin b/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin
new file mode 100644
index 0000000..c404429
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/powerpc_rom.bin
Binary files differ
diff --git a/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch b/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch
new file mode 100644
index 0000000..c7425ab
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/qemu-enlarge-env-entry-size.patch
@@ -0,0 +1,31 @@
+qemu: Add addition environment space to boot loader qemu-system-mips 
+
+Upstream-Status: Inappropriate - OE uses deep paths
+
+If you create a project with very long directory names like 128 characters
+deep and use NFS, the kernel arguments will be truncated. The kernel will
+accept longer strings such as 1024 bytes, but the qemu boot loader defaulted
+to only 256 bytes. This patch expands the limit.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ hw/mips/mips_malta.c    |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
+index 9d521cc..17c0391 100644
+--- a/hw/mips/mips_malta.c
++++ b/hw/mips/mips_malta.c
+@@ -53,7 +53,7 @@
+ 
+ #define ENVP_ADDR		0x80002000l
+ #define ENVP_NB_ENTRIES	 	16
+-#define ENVP_ENTRY_SIZE	 	256
++#define ENVP_ENTRY_SIZE	 	1024
+ 
+ /* Hardware addresses */
+ #define FLASH_ADDRESS 0x1e000000ULL
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/qemu/qemu/run-ptest b/meta/recipes-devtools/qemu/qemu/run-ptest
new file mode 100644
index 0000000..f4b8e97
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+#This script is used to run qemu test suites
+ptestdir=$(pwd)
+cd tests
+
+export SRC_PATH=$ptestdir
+make -k runtest-TESTS | sed '/: OK/ s/^/PASS: /g'
diff --git a/meta/recipes-devtools/qemu/qemu/smc91c111_fix.patch b/meta/recipes-devtools/qemu/qemu/smc91c111_fix.patch
new file mode 100644
index 0000000..e37e777
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/smc91c111_fix.patch
@@ -0,0 +1,74 @@
+The smc91c111.c driver appears to have several issues. The can_receive()
+function can return that the driver is ready when rx_fifo has not been 
+freed yet. There is also no sanity check of rx_fifo() in _receive() which
+can lead to corruption of the rx_fifo array.
+
+release_packet() can also call qemu_flush_queued_packets() before rx_fifo 
+has been cleaned up, resulting in cases where packets are submitted
+for which there is not yet any space.
+
+This patch therefore:
+
+* fixes the logic in can_receive()
+* adds logic to receive() as a sanity check
+* moves the flush() calls to the correct places where data is ready
+  to be received
+
+Upstream-Status: Pending [discussion in progress on mailing list]
+RP 2015/9/7
+
+Index: qemu-2.4.0/hw/net/smc91c111.c
+===================================================================
+--- qemu-2.4.0.orig/hw/net/smc91c111.c
++++ qemu-2.4.0/hw/net/smc91c111.c
+@@ -185,7 +185,6 @@ static void smc91c111_release_packet(smc
+     s->allocated &= ~(1 << packet);
+     if (s->tx_alloc == 0x80)
+         smc91c111_tx_alloc(s);
+-    qemu_flush_queued_packets(qemu_get_queue(s->nic));
+ }
+ 
+ /* Flush the TX FIFO.  */
+@@ -237,9 +236,11 @@ static void smc91c111_do_tx(smc91c111_st
+             }
+         }
+ #endif
+-        if (s->ctr & CTR_AUTO_RELEASE)
++        if (s->ctr & CTR_AUTO_RELEASE) {
+             /* Race?  */
+             smc91c111_release_packet(s, packetnum);
++            qemu_flush_queued_packets(qemu_get_queue(s->nic));
++        }
+         else if (s->tx_fifo_done_len < NUM_PACKETS)
+             s->tx_fifo_done[s->tx_fifo_done_len++] = packetnum;
+         qemu_send_packet(qemu_get_queue(s->nic), p, len);
+@@ -379,9 +380,11 @@ static void smc91c111_writeb(void *opaqu
+                     smc91c111_release_packet(s, s->rx_fifo[0]);
+                 }
+                 smc91c111_pop_rx_fifo(s);
++                qemu_flush_queued_packets(qemu_get_queue(s->nic));
+                 break;
+             case 5: /* Release.  */
+                 smc91c111_release_packet(s, s->packet_num);
++                qemu_flush_queued_packets(qemu_get_queue(s->nic));
+                 break;
+             case 6: /* Add to TX FIFO.  */
+                 smc91c111_queue_tx(s, s->packet_num);
+@@ -642,7 +642,7 @@ static int smc91c111_can_receive(NetClie
+ 
+     if ((s->rcr & RCR_RXEN) == 0 || (s->rcr & RCR_SOFT_RST))
+         return 1;
+-    if (s->allocated == (1 << NUM_PACKETS) - 1)
++    if ((s->allocated == (1 << NUM_PACKETS) - 1) || (s->rx_fifo_len == NUM_PACKETS))
+         return 0;
+     return 1;
+ }
+@@ -671,6 +671,8 @@ static ssize_t smc91c111_receive(NetClie
+     /* TODO: Flag overrun and receive errors.  */
+     if (packetsize > 2048)
+         return -1;
++    if  (s->rx_fifo_len == NUM_PACKETS)
++        return -1;    
+     packetnum = smc91c111_allocate_packet(s);
+     if (packetnum == 0x80)
+         return -1;
diff --git a/meta/recipes-devtools/qemu/qemu/smc91c111_fix1.patch b/meta/recipes-devtools/qemu/qemu/smc91c111_fix1.patch
new file mode 100644
index 0000000..bd1223a
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/smc91c111_fix1.patch
@@ -0,0 +1,85 @@
+From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
+Subject: [RFT PATCH v1 1/3] net: smc91c111: guard flush_queued_packets() on
+ can_rx()
+Date: Thu, 10 Sep 2015 21:23:43 -0700
+
+Check that the core can once again receive packets before asking the
+net layer to do a flush. This will make it more convenient to flush
+packets when adding new conditions to can_receive.
+
+Add missing if braces while moving the can_receive() core code.
+
+Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
+
+Upstream-Status: Submitted
+
+---
+
+ hw/net/smc91c111.c | 30 ++++++++++++++++++++++--------
+ 1 file changed, 22 insertions(+), 8 deletions(-)
+
+Index: qemu-2.4.0/hw/net/smc91c111.c
+===================================================================
+--- qemu-2.4.0.orig/hw/net/smc91c111.c
++++ qemu-2.4.0/hw/net/smc91c111.c
+@@ -124,6 +124,24 @@ static void smc91c111_update(smc91c111_s
+     qemu_set_irq(s->irq, level);
+ }
+ 
++static int smc91c111_can_receive(smc91c111_state *s)
++{
++    if ((s->rcr & RCR_RXEN) == 0 || (s->rcr & RCR_SOFT_RST)) {
++        return 1;
++    }
++    if (s->allocated == (1 << NUM_PACKETS) - 1) {
++        return 0;
++    }
++    return 1;
++}
++
++static inline void smc91c111_flush_queued_packets(smc91c111_state *s)
++{
++    if (smc91c111_can_receive(s)) {
++        qemu_flush_queued_packets(qemu_get_queue(s->nic));
++    }
++}
++
+ /* Try to allocate a packet.  Returns 0x80 on failure.  */
+ static int smc91c111_allocate_packet(smc91c111_state *s)
+ {
+@@ -185,7 +203,7 @@ static void smc91c111_release_packet(smc
+     s->allocated &= ~(1 << packet);
+     if (s->tx_alloc == 0x80)
+         smc91c111_tx_alloc(s);
+-    qemu_flush_queued_packets(qemu_get_queue(s->nic));
++    smc91c111_flush_queued_packets(s);
+ }
+ 
+ /* Flush the TX FIFO.  */
+@@ -636,15 +654,11 @@ static uint32_t smc91c111_readl(void *op
+     return val;
+ }
+ 
+-static int smc91c111_can_receive(NetClientState *nc)
++static int smc91c111_can_receive_nc(NetClientState *nc)
+ {
+     smc91c111_state *s = qemu_get_nic_opaque(nc);
+ 
+-    if ((s->rcr & RCR_RXEN) == 0 || (s->rcr & RCR_SOFT_RST))
+-        return 1;
+-    if (s->allocated == (1 << NUM_PACKETS) - 1)
+-        return 0;
+-    return 1;
++    return smc91c111_can_receive(s);
+ }
+ 
+ static ssize_t smc91c111_receive(NetClientState *nc, const uint8_t *buf, size_t size)
+@@ -739,7 +753,7 @@ static const MemoryRegionOps smc91c111_m
+ static NetClientInfo net_smc91c111_info = {
+     .type = NET_CLIENT_OPTIONS_KIND_NIC,
+     .size = sizeof(NICState),
+-    .can_receive = smc91c111_can_receive,
++    .can_receive = smc91c111_can_receive_nc,
+     .receive = smc91c111_receive,
+ };
+ 
diff --git a/meta/recipes-devtools/qemu/qemu/smc91c111_fix2.patch b/meta/recipes-devtools/qemu/qemu/smc91c111_fix2.patch
new file mode 100644
index 0000000..018aed5
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/smc91c111_fix2.patch
@@ -0,0 +1,46 @@
+From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
+X-Google-Original-From: Peter Crosthwaite <crosthwaite.peter@gmail.com>
+To: qemu-devel@nongnu.org
+Cc: peter.maydell@linaro.org, richard.purdie@linuxfoundation.org
+Subject: [RFT PATCH v1 2/3] net: smc91c111: gate can_receive() on rx FIFO
+ having a slot
+Date: Thu, 10 Sep 2015 21:23:57 -0700
+
+Return false from can_receive() when the FIFO doesn't have a free RX
+slot. This fixes a bug in the current code where the allocated buffer
+is freed before the fifo pop, triggering a premature flush of queued RX
+packets. It also will handle a corner case, where the guest manually
+frees the allocated buffer before popping the rx FIFO (hence it is not
+enough to just delay the flush_queued_packets()).
+
+Reported-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
+
+Upstream-Status: Submitted
+---
+
+ hw/net/smc91c111.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+Index: qemu-2.4.0/hw/net/smc91c111.c
+===================================================================
+--- qemu-2.4.0.orig/hw/net/smc91c111.c
++++ qemu-2.4.0/hw/net/smc91c111.c
+@@ -129,7 +129,8 @@ static int smc91c111_can_receive(smc91c1
+     if ((s->rcr & RCR_RXEN) == 0 || (s->rcr & RCR_SOFT_RST)) {
+         return 1;
+     }
+-    if (s->allocated == (1 << NUM_PACKETS) - 1) {
++    if (s->allocated == (1 << NUM_PACKETS) - 1 ||
++        s->rx_fifo_len == NUM_PACKETS) {
+         return 0;
+     }
+     return 1;
+@@ -182,6 +183,7 @@ static void smc91c111_pop_rx_fifo(smc91c
+     } else {
+         s->int_level &= ~INT_RCV;
+     }
++    smc91c111_flush_queued_packets(s);
+     smc91c111_update(s);
+ }
+ 
diff --git a/meta/recipes-devtools/qemu/qemu/smc91c111_fix3.patch b/meta/recipes-devtools/qemu/qemu/smc91c111_fix3.patch
new file mode 100644
index 0000000..9e865f7
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/smc91c111_fix3.patch
@@ -0,0 +1,33 @@
+From: Peter Crosthwaite <crosthwaitepeter@gmail.com>
+To: qemu-devel@nongnu.org
+Cc: peter.maydell@linaro.org, richard.purdie@linuxfoundation.org
+Subject: [RFT PATCH v1 3/3] net: smc91c111: flush packets on RCR register
+ changes
+Date: Thu, 10 Sep 2015 21:24:12 -0700
+
+The SOFT_RST or RXEN in the control register can be used as a condition
+to unblock the net layer via can_receive(). So check for possible
+flushes on RCR changes. This will drop all pending packets on soft
+reset or disable which is the functional intent of the can_receive()
+logic.
+
+Signed-off-by: Peter Crosthwaite <crosthwaite.peter@gmail.com>
+
+Upstream-Status: Submitted
+---
+
+ hw/net/smc91c111.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+Index: qemu-2.4.0/hw/net/smc91c111.c
+===================================================================
+--- qemu-2.4.0.orig/hw/net/smc91c111.c
++++ qemu-2.4.0/hw/net/smc91c111.c
+@@ -331,6 +331,7 @@ static void smc91c111_writeb(void *opaqu
+             if (s->rcr & RCR_SOFT_RST) {
+                 smc91c111_reset(DEVICE(s));
+             }
++            smc91c111_flush_queued_packets(s);
+             return;
+         case 10: case 11: /* RPCR */
+             /* Ignored */
diff --git a/meta/recipes-devtools/qemu/qemu/wacom.patch b/meta/recipes-devtools/qemu/qemu/wacom.patch
new file mode 100644
index 0000000..cd06aa4
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu/wacom.patch
@@ -0,0 +1,130 @@
+The USB wacom device is missing a HID descriptor which causes it
+to fail to operate with recent kernels (e.g. 3.17).
+
+This patch adds a HID desriptor to the device, based upon one from 
+real wcom device.
+
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Upstream-Status: Submitted
+2014/11/27
+
+Index: qemu-2.1.0/hw/usb/dev-wacom.c
+===================================================================
+--- qemu-2.1.0.orig/hw/usb/dev-wacom.c	2014-08-01 15:12:17.000000000 +0100
++++ qemu-2.1.0/hw/usb/dev-wacom.c	2014-10-12 12:13:30.540306042 +0100
+@@ -68,6 +68,89 @@
+     [STR_SERIALNUMBER]     = "1",
+ };
+ 
++static const uint8_t qemu_tablet_hid_report_descriptor[] = {
++    0x05, 0x01,		/* Usage Page (Generic Desktop) */
++    0x09, 0x02,		/* Usage (Mouse) */
++    0xa1, 0x01,		/* Collection (Application) */
++    0x85, 0x01,		/*   Report ID (1) */ 
++    0x09, 0x01,		/*   Usage (Pointer) */
++    0xa1, 0x00,		/*   Collection (Physical) */
++    0x05, 0x09,		/*     Usage Page (Button) */
++    0x19, 0x01,		/*     Usage Minimum (1) */
++    0x29, 0x05,		/*     Usage Maximum (5) */
++    0x15, 0x00,		/*     Logical Minimum (0) */
++    0x25, 0x01,		/*     Logical Maximum (1) */
++    0x95, 0x05,		/*     Report Count (5) */
++    0x75, 0x01,		/*     Report Size (1) */
++    0x81, 0x02,		/*     Input (Data, Variable, Absolute) */
++    0x95, 0x01,		/*     Report Count (1) */
++    0x75, 0x03,		/*     Report Size (3) */
++    0x81, 0x01,		/*     Input (Constant) */
++    0x05, 0x01,		/*     Usage Page (Generic Desktop) */
++    0x09, 0x30,		/*     Usage (X) */
++    0x09, 0x31,		/*     Usage (Y) */
++    0x15, 0x81,		/*     Logical Minimum (-127) */
++    0x25, 0x7f,		/*     Logical Maximum (127) */
++    0x75, 0x08,		/*     Report Size (8) */
++    0x95, 0x02,		/*     Report Count (2) */
++    0x81, 0x06,		/*     Input (Data, Variable, Relative) */
++    0xc0,		/*   End Collection */
++    0xc0,		/* End Collection */
++    0x05, 0x0d,		/* Usage Page (Digitizer) */
++    0x09, 0x01,		/* Usage (Digitizer) */
++    0xa1, 0x01,		/* Collection (Application) */
++    0x85, 0x02,		/*   Report ID (2) */ 
++    0xa1, 0x00,		/*   Collection (Physical) */
++    0x06, 0x00, 0xff,   /*   Usage Page (Vendor 0xff00) */
++    0x09, 0x01, 	/*   Usage (Digitizer) */
++    0x15, 0x00, 	/*     Logical Minimum (0) */
++    0x26, 0xff, 0x00,	/*     Logical Maximum (255) */
++    0x75, 0x08,		/*     Report Size (8) */
++    0x95, 0x08,		/*     Report Count (8) */
++    0x81, 0x02,		/*     Input (Data, Variable, Absolute) */
++    0xc0, 		/*   End Collection */
++    0x09, 0x01,		/*   Usage (Digitizer) */
++    0x85, 0x02, 	/*   Report ID (2) */ 
++    0x95, 0x01,		/*   Report Count (1) */
++    0xb1, 0x02,		/*   FEATURE (2) */
++    0xc0,		/* End Collection */
++    0x06, 0x00, 0xff,	/* Usage Page (Vendor 0xff00) */
++    0x09, 0x01,		/* Usage (Digitizer) */
++    0xa1, 0x01,		/* Collection (Application) */
++    0x85, 0x02,   	/*   Report ID (2) */ 
++    0x05, 0x0d,		/*   Usage Page (Digitizer)  */
++    0x09, 0x22, 	/*   Usage (Finger) */
++    0xa1, 0x00,  	/*   Collection (Physical) */
++    0x06, 0x00, 0xff,	/*   Usage Page (Vendor 0xff00) */
++    0x09, 0x01,		/*     Usage (Digitizer) */
++    0x15, 0x00, 	/*     Logical Minimum (0) */
++    0x26, 0xff, 0x00,  	/*     Logical Maximum */
++    0x75, 0x08,		/*     Report Size (8) */
++    0x95, 0x02,		/*     Report Count (2) */
++    0x81, 0x02, 	/*     Input (Data, Variable, Absolute) */
++    0x05, 0x01,		/*     Usage Page (Generic Desktop) */
++    0x09, 0x30,		/*     Usage (X) */
++    0x35, 0x00, 	/*     Physical Minimum */
++    0x46, 0xe0, 0x2e,	/*     Physical Maximum */
++    0x26, 0xe0, 0x01,   /*     Logical Maximum */
++    0x75, 0x10,		/*     Report Size (16) */
++    0x95, 0x01,		/*     Report Count (1) */
++    0x81, 0x02,		/*     Input (Data, Variable, Absolute) */
++    0x09, 0x31,		/*     Usage (Y) */
++    0x46, 0x40, 0x1f, 	/*     Physical Maximum */
++    0x26, 0x40, 0x01, 	/*     Logical Maximum */
++    0x81, 0x02, 	/*     Input (Data, Variable, Absolute) */
++    0x06, 0x00, 0xff,	/*     Usage Page (Vendor 0xff00) */
++    0x09, 0x01, 	/*     Usage (Digitizer) */
++    0x26, 0xff, 0x00,  	/*     Logical Maximum */
++    0x75, 0x08,		/*     Report Size (8) */
++    0x95, 0x0d,		/*     Report Count (13) */
++    0x81, 0x02,		/*     Input (Data, Variable, Absolute) */
++    0xc0,		/*   End Collection */ 
++    0xc0,		/* End Collection */
++};
++
++
+ static const USBDescIface desc_iface_wacom = {
+     .bInterfaceNumber              = 0,
+     .bNumEndpoints                 = 1,
+@@ -85,7 +168,7 @@
+                 0x00,          /*  u8  country_code */
+                 0x01,          /*  u8  num_descriptors */
+                 0x22,          /*  u8  type: Report */
+-                0x6e, 0,       /*  u16 len */
++                sizeof(qemu_tablet_hid_report_descriptor), 0, /*  u16 len */
+             },
+         },
+     },
+@@ -265,6 +350,15 @@
+     }
+ 
+     switch (request) {
++    case InterfaceRequest | USB_REQ_GET_DESCRIPTOR:
++        switch (value >> 8) {
++        case 0x22:
++                memcpy(data, qemu_tablet_hid_report_descriptor,
++                       sizeof(qemu_tablet_hid_report_descriptor));
++                p->actual_length = sizeof(qemu_tablet_hid_report_descriptor);
++            break;
++        }
++        break;
+     case WACOM_SET_REPORT:
+         if (s->mouse_grabbed) {
+             qemu_remove_mouse_event_handler(s->eh_entry);
diff --git a/meta/recipes-devtools/qemu/qemu_2.4.0.bb b/meta/recipes-devtools/qemu/qemu_2.4.0.bb
new file mode 100644
index 0000000..59b1788
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemu_2.4.0.bb
@@ -0,0 +1,22 @@
+require qemu.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
+                    file://COPYING.LIB;endline=24;md5=c04def7ae38850e7d3ef548588159913"
+
+SRC_URI += "file://configure-fix-Darwin-target-detection.patch \
+            file://qemu-enlarge-env-entry-size.patch \
+            file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
+            file://smc91c111_fix1.patch \
+            file://smc91c111_fix2.patch \
+            file://smc91c111_fix3.patch \
+           "
+SRC_URI_prepend = "http://wiki.qemu-project.org/download/${BP}.tar.bz2"
+SRC_URI[md5sum] = "186ee8194140a484a455f8e3c74589f4"
+SRC_URI[sha256sum] = "72b0b991bbcc540663a019e1e8c4f714053b691dda32c9b9ee80b25f367e6620"
+
+COMPATIBLE_HOST_class-target_mips64 = "null"
+
+do_install_append() {
+    # Prevent QA warnings about installed ${localstatedir}/run
+    if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
+}
diff --git a/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb b/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
new file mode 100644
index 0000000..7f4c6d9
--- /dev/null
+++ b/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb
@@ -0,0 +1,50 @@
+SUMMARY = "QEMU wrapper script"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+S = "${WORKDIR}"
+
+inherit qemu
+
+do_install () {
+	install -d ${D}${bindir_crossscripts}/
+
+	echo "#!/bin/sh" > ${D}${bindir_crossscripts}/qemuwrapper
+	qemu_binary=${@qemu_target_binary(d)}
+	qemu_options='${QEMU_OPTIONS}'
+	echo "$qemu_binary $qemu_options \"\$@\"" >> ${D}${bindir_crossscripts}/qemuwrapper
+	fallback_qemu_bin=
+	case $qemu_binary in
+		"qemu-i386")
+			fallback_qemu_bin=qemu-x86_64
+			;;
+		"qemu-x86_64")
+			fallback_qemu_bin=qemu-i386
+			;;
+		*)
+			;;
+	esac
+
+	if [ -n "$fallback_qemu_bin" ]; then
+
+		cat >> ${D}${bindir_crossscripts}/qemuwrapper << EOF
+rc=\$?
+if [ \$rc = 255 ]; then
+	$fallback_qemu_bin "\$@"
+	rc=\$?
+fi
+exit \$rc
+EOF
+
+	fi
+
+	chmod +x ${D}${bindir_crossscripts}/qemuwrapper
+}
+
+SYSROOT_PREPROCESS_FUNCS += "qemuwrapper_sysroot_preprocess"
+
+qemuwrapper_sysroot_preprocess () {
+	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+}
+
+INHIBIT_DEFAULT_DEPS = "1"
diff --git a/meta/recipes-devtools/quilt/quilt-native.inc b/meta/recipes-devtools/quilt/quilt-native.inc
new file mode 100644
index 0000000..5c4b0a2
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt-native.inc
@@ -0,0 +1,18 @@
+RDEPENDS_${PN} = "diffstat-native patch-native bzip2-native util-linux-native"
+
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+inherit native
+
+PATCHTOOL = "patch"
+EXTRA_OECONF = "--disable-nls"
+
+do_configure () {
+	oe_runconf
+}
+
+do_install_append () {
+	# Dummy quiltrc file for patch.bbclass
+	install -d ${D}${sysconfdir}/
+	touch ${D}${sysconfdir}/quiltrc
+}
diff --git a/meta/recipes-devtools/quilt/quilt-native_0.64.bb b/meta/recipes-devtools/quilt/quilt-native_0.64.bb
new file mode 100644
index 0000000..6bc7dcd
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt-native_0.64.bb
@@ -0,0 +1,2 @@
+require quilt.inc
+require quilt-native.inc
diff --git a/meta/recipes-devtools/quilt/quilt.inc b/meta/recipes-devtools/quilt/quilt.inc
new file mode 100644
index 0000000..837b36b
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt.inc
@@ -0,0 +1,62 @@
+SUMMARY = "Tool for working with series of patches"
+HOMEPAGE = "http://savannah.nongnu.org/projects/quilt/"
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/quilt/quilt-${PV}.tar.gz \
+        file://install.patch \
+        file://run-ptest \
+        file://Makefile \
+"
+
+SRC_URI[md5sum] = "fc0310db5868a0873d602d4332a76d43"
+SRC_URI[sha256sum] = "c4bfd3282214a288e8d3e921ae4d52e73e24c4fead72b5446752adee99a7affd"
+
+inherit autotools-brokensep ptest
+
+EXTRA_OECONF_darwin += "--without-date \
+                        --without-getopt \
+                        "
+
+CLEANBROKEN = "1"
+
+PACKAGES += "guards guards-doc"
+FILES_${PN} = "${sysconfdir} ${datadir}/quilt \
+               ${bindir}/quilt ${libdir}/quilt"
+FILES_guards = "${bindir}/guards"
+FILES_${PN}-doc = "${mandir}/man1/quilt.1 ${docdir}/${BPN}"
+FILES_guards-doc = "${mandir}/man1/guards.1"
+
+RDEPENDS_${PN} = "bash"
+
+EXTRA_OE_MAKE_ARGS_darwin ?= ""
+EXTRA_OE_MAKE_ARGS ?= "BUILD_ROOT=${D}"
+
+CACHED_CONFIGUREVARS += "ac_cv_path_BASH=/bin/bash"
+
+# quilt ignores DESTDIR
+do_install () {
+	oe_runmake ${EXTRA_OE_MAKE_ARGS} install
+	# cleanup unpackaged files
+	rm -rf ${D}/${datadir}/emacs
+}
+
+do_compile_ptest() {
+	oe_runmake bin/patch-wrapper test/.depend
+}
+
+do_install_ptest() {
+	tar -cf - bin/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	tar -cf - compat/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	tar -cf - quilt/ --exclude \*.in | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	tar -cf - test/ --exclude mail.test --exclude delete.test | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	cp ${WORKDIR}/Makefile ${D}${PTEST_PATH}
+}
+
+RDEPENDS_${PN}-ptest = "make file sed gawk diffutils findutils ed perl \
+                        perl-module-filehandle perl-module-getopt-std \
+                        perl-module-posix perl-module-file-temp \
+                        perl-module-text-parsewords perl-module-overloading \
+                        bash util-linux-getopt \
+                       "
diff --git a/meta/recipes-devtools/quilt/quilt/Makefile b/meta/recipes-devtools/quilt/quilt/Makefile
new file mode 100644
index 0000000..7b3ac8a
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt/Makefile
@@ -0,0 +1,13 @@
+PATH :=         $(CURDIR)/bin:$(CURDIR)/compat:$(PATH)
+QUILT_DIR :=    $(CURDIR)/quilt
+QUILTRC :=      $(CURDIR)/test/test.quiltrc
+export QUILT_DIR QUILTRC
+CHECK_ENV := P=patches/; _P=../patches/; export P _P
+-include test/.depend
+
+check-% : test/%.test
+	@LANG=C; LC_ALL=C; \
+	export LANG LC_ALL; \
+	$(CHECK_ENV); \
+	cd $(<D); \
+	./run -q $(<F)
diff --git a/meta/recipes-devtools/quilt/quilt/aclocal.patch b/meta/recipes-devtools/quilt/quilt/aclocal.patch
new file mode 100644
index 0000000..daf4429
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt/aclocal.patch
@@ -0,0 +1,128 @@
+Upstream-Status: Pending
+
+Add the aclocal.m4 as acinclude.m4
+
+Index: quilt-0.47/acinclude.m4
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ quilt-0.47/acinclude.m4	2006-10-10 17:05:56.000000000 +0100
+@@ -0,0 +1,119 @@
++dnl Allow configure to specify a specific binary
++dnl 1: Environment variable
++dnl 2: binary name
++dnl 3: optional list of alternative binary names
++dnl 4: optional list of additional search directories
++AC_DEFUN([QUILT_COMPAT_PROG_PATH],[
++  m4_define([internal_$2_cmd],[esyscmd(ls compat/$2.in 2>/dev/null)])
++
++  AC_ARG_WITH($2, AC_HELP_STRING(
++    [--with-$2], [name of the $2 executable to use]
++                 m4_if(internal_$2_cmd,[],[],[ (use --without-$2
++                          to use an internal mechanism)])),
++  [
++    if test x"$withval" = xnone; then
++      AC_MSG_ERROR([Invalid configure argument.  use --without-$2])
++    fi
++    if test x"$withval" != xno; then
++      AC_MSG_CHECKING(for $2)
++      $1="$withval"
++      if test -e "$$1"; then
++	if test ! -f "$$1" -a ! -h "$$1" || test ! -x "$$1"; then
++	  AC_MSG_ERROR([$$1 is not an executable file])
++	fi
++      fi
++      AC_MSG_RESULT([$$1])
++      if test ! -e "$$1"; then
++        AC_MSG_WARN([$$1 does not exist])
++      fi
++      COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++    fi
++  ],[
++    m4_if([$3],[],[
++      AC_PATH_PROG($1,$2,,$PATH:$4)
++    ],[
++      AC_PATH_PROGS($1,$3,,$PATH:$4)
++      if test -n "$$1" -a "`expr "$$1" : '.*/\([[^/]]*\)$'`" != "$2"; then
++	COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++      fi
++    ])
++    m4_if([$4],[],[],[
++      if test -n "$$1"; then
++	as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++        for dir in "$4"; do
++          if test "`dirname $$1`" = "$dir"; then
++            COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++	    break
++	  fi
++        done
++	IFS="$as_save_IFS"
++      fi
++    ])
++  ])
++  if test -z "$$1"; then
++    m4_if(internal_$2_cmd,[],[
++      AC_MSG_ERROR([Please specify the location of $2 with the option '--with-$2'])
++    ],[
++      AC_MSG_WARN([Using internal $2 mechanism.  Use option '--with-$2' to override])
++      COMPAT_PROGRAMS="$COMPAT_PROGRAMS $2"
++      $1=$2
++      INTERNAL_$1=1
++    ])
++  fi
++  AC_SUBST($1)
++])
++
++dnl Allow configure to specify a specific binary
++dnl This variant is for optional binaries.
++dnl 1: Environment variable
++dnl 2: binary name
++dnl 3: optional list of alternative binary names
++dnl 4: optional list of additional search directories
++AC_DEFUN([QUILT_COMPAT_PROG_PATH_OPT],[
++  AC_ARG_WITH($2, AC_HELP_STRING(
++    [--with-$2], [name of the $2 executable to use]),
++  [
++    if test x"$withval" != xno; then
++      AC_MSG_CHECKING(for $2)
++      $1="$withval"
++      if test -e "$$1"; then
++	if test ! -f "$$1" -a ! -h "$$1" || test ! -x "$$1"; then
++	  AC_MSG_ERROR([$$1 is not an executable file])
++	fi
++      fi
++      AC_MSG_RESULT([$$1])
++      if test ! -e "$$1"; then
++        AC_MSG_WARN([$$1 does not exist])
++      fi
++      COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++    fi
++  ],[
++    m4_if([$3],[],[
++      AC_PATH_PROG($1,$2,,$PATH:$4)
++    ],[
++      AC_PATH_PROGS($1,$3,,$PATH:$4)
++      if test -n "$$1" -a "`expr "$$1" : '.*/\([[^/]]*\)$'`" != "$2"; then
++	COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++      fi
++    ])
++    m4_if([$4],[],[],[
++      if test -n "$$1"; then
++	as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
++        for dir in "$4"; do
++          if test "`dirname $$1`" = "$dir"; then
++            COMPAT_SYMLINKS="$COMPAT_SYMLINKS $2"
++	    break
++	  fi
++        done
++	IFS="$as_save_IFS"
++      fi
++    ])
++    if test -z "$$1"; then
++      AC_MSG_WARN([$2 not found, some optional functionalities will be missing])
++    fi
++  ])
++  if test -z "$$1"; then
++    $1=$2
++  fi
++  AC_SUBST($1)
++])
diff --git a/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch b/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch
new file mode 100644
index 0000000..672155b
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt/gnu_patch_test_fix_target.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+the test should be skipped for cross compiling.
+
+Signed-off-by: Qing He <qing.he@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 026a36c..8af591b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -245,6 +245,7 @@ fi
+ QUILT_COMPAT_PROG_PATH(DIFF, diff)
+ QUILT_COMPAT_PROG_PATH(PATCH, patch)
+ 
++if test "x$cross_compiling" != "xyes"; then
+ # Sun diff and others will not work because GNU patch options are used.
+ AC_MSG_CHECKING([the version of $DIFF])
+ if $DIFF --version 2>/dev/null | grep GNU >/dev/null; then
+@@ -293,6 +294,7 @@ current version of patch from ftp.gnu.org, or if you already have GNU patch
+ then you can supply its path with the '--with-patch=' option.
+ ])
+ fi
++fi
+ 
+ QUILT_COMPAT_PROG_PATH(FIND, find)
+ 
diff --git a/meta/recipes-devtools/quilt/quilt/install.patch b/meta/recipes-devtools/quilt/quilt/install.patch
new file mode 100644
index 0000000..e2a7af6
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt/install.patch
@@ -0,0 +1,13 @@
+Upstream-Status: Pending
+
+--- quilt-0.47/Makefile.in	2008-12-31 19:09:13.000000000 +0000
++++ quilt-0.47/Makefile.in.orig	2008-08-21 13:21:32.000000000 +0100
+@@ -13,7 +13,7 @@
+ mandir :=	@mandir@
+ localedir :=	$(datadir)/locale
+ emacsdir :=	$(datadir)/emacs/site-lisp
+-etcdir :=	$(subst /usr/etc,/etc,$(prefix)/etc)
++etcdir :=	@sysconfdir@
+ 
+ INSTALL :=	@INSTALL@
+ POD2MAN :=	@POD2MAN@
diff --git a/meta/recipes-devtools/quilt/quilt/run-ptest b/meta/recipes-devtools/quilt/quilt/run-ptest
new file mode 100755
index 0000000..958a9df
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+ln -sf /bin/ed /usr/bin/ed
+for i in `ls test/*.test |awk -F. '{print $1}' |awk -F/ '{print $2}'`; do make check-$i; if [ $? -eq 0 ]; then echo PASS: $i.test; else echo FAIL: $i.test; fi; done
+rm -f /usr/bin/ed
diff --git a/meta/recipes-devtools/quilt/quilt_0.64.bb b/meta/recipes-devtools/quilt/quilt_0.64.bb
new file mode 100644
index 0000000..00f900a
--- /dev/null
+++ b/meta/recipes-devtools/quilt/quilt_0.64.bb
@@ -0,0 +1,16 @@
+require quilt.inc
+inherit gettext
+RDEPENDS_${PN} += "patch diffstat bzip2 util-linux"
+SRC_URI += "file://aclocal.patch \
+            file://gnu_patch_test_fix_target.patch \
+           "
+
+# fix build-distro specific perl path in the target perl scripts
+do_install_append() {
+	for perlscript in ${D}${datadir}/quilt/scripts/remove-trailing-ws ${D}${datadir}/quilt/scripts/dependency-graph ${D}${datadir}/quilt/scripts/edmail ${D}${bindir}/guards
+	do
+		if [ -f $perlscript ]; then
+			sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' $perlscript
+		fi
+	done
+}
diff --git a/meta/recipes-devtools/remake/remake.inc b/meta/recipes-devtools/remake/remake.inc
new file mode 100644
index 0000000..df889fc
--- /dev/null
+++ b/meta/recipes-devtools/remake/remake.inc
@@ -0,0 +1,16 @@
+SUMMARY = "Makefile debugger which is gnumake compatible"
+DESCRIPTION = "remake is a patched and modernized version of GNU make \
+utility that adds improved error reporting, the ability to trace \
+execution in a comprehensible way, and a debugger."
+
+HOMEPAGE = "http://bashdb.sourceforge.net/remake/"
+SECTION = "devel"
+
+SRC_URI = "git://github.com/rocky/remake.git"
+
+inherit autotools gettext update-alternatives pkgconfig
+
+ALTERNATIVE_${PN} = "make"
+ALTERNATIVE_LINK_NAME[make] = "${bindir}/make"
+ALTERNATIVE_TARGET[make] = "${bindir}/remake"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-devtools/remake/remake/version-remake.texi.patch b/meta/recipes-devtools/remake/remake/version-remake.texi.patch
new file mode 100644
index 0000000..fa6329e
--- /dev/null
+++ b/meta/recipes-devtools/remake/remake/version-remake.texi.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+version-remake.texi is not there but it is required by remake.texi,
+just add it for getting the 'make remake.info' works.
+
+==============================================================
+diff --git a/doc/version-remake.texi b/doc/version-remake.texi
+new file mode 100644
+index 0000000..2a3b72b
+--- /dev/null
++++ b/doc/version-remake.texi
+@@ -0,0 +1,4 @@
++@set UPDATED 10 June 2012
++@set UPDATED-MONTH June 2012
++@set EDITION 3.82+dbg-0.9git
++@set VERSION 3.82+dbg-0.9git
diff --git a/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb b/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb
new file mode 100644
index 0000000..c61913d
--- /dev/null
+++ b/meta/recipes-devtools/remake/remake_4.1+dbg-1.1.bb
@@ -0,0 +1,27 @@
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://tests/COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://glob/COPYING.LIB;md5=4a770b67e6be0f60da244beb2de0fce4"
+require remake.inc
+
+SRC_URI += "file://version-remake.texi.patch \
+           "
+SRCREV = "cf54641d50a0165bb17622b3e9770f426ccbc561"
+S = "${WORKDIR}/git"
+
+DEPENDS += "readline guile"
+# Need to add "gettext-native" dependency to remake-native.
+# By default only "gettext-minimal-native" is added
+# when inherit gettext.
+DEPENDS_class-native += "gettext-native"
+PROVIDES += "make"
+
+do_configure_prepend() {
+    # remove the default LINGUAS since we are not going to generate languages
+    rm ${S}/po/LINGUAS
+    touch ${S}/po/LINGUAS
+    # create config.rpath which required by configure.ac
+    ( cd ${S}; autopoint || touch config.rpath )
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch
new file mode 100644
index 0000000..b877870
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm-4.11.2/add_RPMSENSE_MISSINGOK_to_rpmmodule.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org> 
+
+diff --git a/python/rpmmodule.c b/python/rpmmodule.c
+index a4fe217..728c66c 100644
+--- a/python/rpmmodule.c
++++ b/python/rpmmodule.c
+@@ -396,6 +396,10 @@ static int initModule(PyObject *m)
+     REGISTER_ENUM(RPMSENSE_STRONG);
+     REGISTER_ENUM(RPMSENSE_CONFIG);
+ 
++#if defined(RPM_VENDOR_OE)
++    REGISTER_ENUM(RPMSENSE_MISSINGOK);
++#endif
++
+     REGISTER_ENUM(RPMTRANS_FLAG_TEST);
+     REGISTER_ENUM(RPMTRANS_FLAG_BUILD_PROBS);
+     REGISTER_ENUM(RPMTRANS_FLAG_NOSCRIPTS);
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch
new file mode 100644
index 0000000..7a646de
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm-4.11.2/disable_shortcircuited.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org>
+
+
+Index: rpm-4.11.2/build/pack.c
+===================================================================
+--- rpm-4.11.2.orig/build/pack.c
++++ rpm-4.11.2/build/pack.c
+@@ -571,9 +571,9 @@ rpmRC packageBinaries(rpmSpec spec, cons
+ 	    headerPutBin(pkg->header, RPMTAG_SOURCEPKGID, spec->sourcePkgId,16);
+ 	}
+ 
+-	if (cheating) {
+-	    (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1");
+-	}
++//	if (cheating) {
++//	    (void) rpmlibNeedsFeature(pkg, "ShortCircuited", "4.9.0-1");
++//	}
+ 	
+ 	{   char *binFormat = rpmGetPath("%{_rpmfilename}", NULL);
+ 	    char *binRpm, *binDir;
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch
new file mode 100644
index 0000000..be0626c
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm-4.11.2/fix_libdir.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [OE-Core specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org>
+
+
+diff --git a/installplatform b/installplatform
+index 8c3eba0..fa15e91 100755
+--- a/installplatform
++++ b/installplatform
+@@ -112,7 +112,7 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
+   [ -z "$CANONARCH" ] && continue
+ 
+   if [ "$OS" = "linux" ] && [ "$CANONCOLOR" = 3 ]; then
+-      LIB=${LIB}64
++      LIB=${LIB}
+   fi
+ 
+   PPD="${DESTDIR}/${platformdir}/${ARCH}-${OS}"
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh b/meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh
new file mode 100755
index 0000000..083b174
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm-4.11.2/pythondeps.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+[ $# -ge 1 ] || {
+    cat > /dev/null
+    exit 0
+}
+
+case $1 in
+-R|--requires)
+    shift
+    grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python"
+    exit 0
+    ;;
+esac
+
+exit 0
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch
new file mode 100644
index 0000000..2640e54
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-db3-from-configure.patch
@@ -0,0 +1,26 @@
+
+Disable configuring the db3 directory since we will be using the
+external DB provided as part of OE-Core already, no need to have
+duplicate database code.
+
+Upstream-Status: Inappropriate [OE-Core Specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: rpm-4.11.2/configure.ac
+===================================================================
+--- rpm-4.11.2.orig/configure.ac
++++ rpm-4.11.2/configure.ac
+@@ -825,9 +825,9 @@ AC_SUBST(RPMCONFIGDIR)
+ 
+ AC_SUBST(OBJDUMP)
+ 
+-if test "$with_external_db" = no; then
+-    AC_CONFIG_SUBDIRS(db3)
+-fi
++#if test "$with_external_db" = no; then
++#    AC_CONFIG_SUBDIRS(db3)
++#fi
+ 
+ AM_CONDITIONAL([WITH_INTERNAL_DB],[test "$with_external_db" = no])
+ AM_CONDITIONAL([DOXYGEN],[test "$DOXYGEN" != no])
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch
new file mode 100644
index 0000000..f1ecab7
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm-4.11.2/remove-dir-check.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org>
+
+
+Index: rpm-4.11.2/build/files.c
+===================================================================
+--- rpm-4.11.2.orig/build/files.c
++++ rpm-4.11.2/build/files.c
+@@ -1321,12 +1321,6 @@ static rpmRC addFile(FileList fl, const
+ 	}
+     }
+ 
+-    /* Error out when a non-directory is specified as one in spec */
+-    if (fl->cur.isDir && (statp == &statbuf) && !S_ISDIR(statp->st_mode)) {
+-	rpmlog(RPMLOG_ERR, _("Not a directory: %s\n"), diskPath);
+-	goto exit;
+-    }
+-
+     /* Don't recurse into explicit %dir, don't double-recurse from fts */
+     if ((fl->cur.isDir != 1) && (statp == &statbuf) && S_ISDIR(statp->st_mode)) {
+ 	return recurseDir(fl, diskPath);
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch
new file mode 100644
index 0000000..9333dea
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm-4.11.2/rpm-scriptetexechelp.patch
@@ -0,0 +1,194 @@
+Upstream-Status: Inappropriate [OE-Core]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org>
+
+
+Index: rpm-4.11.2/lib/psm.c
+===================================================================
+--- rpm-4.11.2.orig/lib/psm.c
++++ rpm-4.11.2/lib/psm.c
+@@ -421,7 +421,8 @@ static rpmRC runScript(rpmpsm psm, ARGV_
+ 
+     rpmswEnter(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0);
+     rc = rpmScriptRun(script, arg1, arg2, sfd,
+-		      prefixes, warn_only, selinux);
++		      prefixes, warn_only, selinux, rpmtsRootDir(psm->ts) );
++
+     rpmswExit(rpmtsOp(psm->ts, RPMTS_OP_SCRIPTLETS), 0);
+ 
+     /* Map warn-only errors to "notfound" for script stop callback */
+@@ -958,15 +959,49 @@ static rpmRC rpmpsmStage(rpmpsm psm, pkg
+     case PSM_DESTROY:
+ 	break;
+     case PSM_SCRIPT:	/* Run current package scriptlets. */
++#ifdef RPM_VENDOR_OE
++        {
++        const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++	if (scriptletWrapper && *scriptletWrapper)
++	     (void) rpmChrootOut();
++#endif
++
+ 	rc = runInstScript(psm);
++#ifdef RPM_VENDOR_OE
++	if (scriptletWrapper && *scriptletWrapper)
++	     (void) rpmChrootIn();
++        }
++#endif
+ 	break;
+     case PSM_TRIGGERS:
+ 	/* Run triggers in other package(s) this package sets off. */
++#ifdef RPM_VENDOR_OE
++        {
++        const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++	if (scriptletWrapper && *scriptletWrapper)
++	     (void) rpmChrootOut();
++#endif
+ 	rc = runTriggers(psm);
++#ifdef RPM_VENDOR_OE
++	if (scriptletWrapper && *scriptletWrapper)
++	     (void) rpmChrootIn();
++        }
++#endif
+ 	break;
+     case PSM_IMMED_TRIGGERS:
+ 	/* Run triggers in this package other package(s) set off. */
++#ifdef RPM_VENDOR_OE
++	{
++            const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++	    if (scriptletWrapper && *scriptletWrapper)
++	     (void) rpmChrootOut();
++#endif
+ 	rc = runImmedTriggers(psm);
++#ifdef RPM_VENDOR_OE
++	    if (scriptletWrapper && *scriptletWrapper)
++	     (void) rpmChrootIn();
++	}
++#endif
+ 	break;
+ 
+     case PSM_RPMDB_ADD: {
+Index: rpm-4.11.2/lib/rpmscript.c
+===================================================================
+--- rpm-4.11.2.orig/lib/rpmscript.c
++++ rpm-4.11.2/lib/rpmscript.c
+@@ -92,7 +92,7 @@ static rpmRC runLuaScript(int selinux, A
+ static const char * const SCRIPT_PATH = "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin";
+ 
+ static void doScriptExec(int selinux, ARGV_const_t argv, ARGV_const_t prefixes,
+-			FD_t scriptFd, FD_t out)
++			FD_t scriptFd, FD_t out, char * rootDir )
+ {
+     int pipes[2];
+     int flag;
+@@ -158,13 +158,12 @@ static void doScriptExec(int selinux, AR
+ 	    setenv("RPM_INSTALL_PREFIX", *pf, 1);
+ 	}
+     }
+-	
+-    if (chdir("/") == 0) {
++    if (chdir(rootDir) == 0) {
+ 	/* XXX Don't mtrace into children. */
+ 	unsetenv("MALLOC_CHECK_");
+ 
+ 	/* Permit libselinux to do the scriptlet exec. */
+-	if (selinux == 1) {	
++	if (selinux == 1) {
+ 	    xx = rpm_execcon(0, argv[0], argv, environ);
+ 	}
+ 
+@@ -175,12 +174,12 @@ static void doScriptExec(int selinux, AR
+     _exit(127); /* exit 127 for compatibility with bash(1) */
+ }
+ 
+-static char * writeScript(const char *cmd, const char *script)
++static char * writeScript(const char *cmd, const char *script, char * rootDir)
+ {
+     char *fn = NULL;
+     size_t slen = strlen(script);
+     int ok = 0;
+-    FD_t fd = rpmMkTempFile("/", &fn);
++    FD_t fd = rpmMkTempFile(rootDir, &fn);
+ 
+     if (Ferror(fd))
+ 	goto exit;
+@@ -204,7 +203,7 @@ exit:
+  */
+ static rpmRC runExtScript(int selinux, ARGV_const_t prefixes,
+ 		   const char *sname, rpmlogLvl lvl, FD_t scriptFd,
+-		   ARGV_t * argvp, const char *script, int arg1, int arg2)
++		   ARGV_t * argvp, const char *script, int arg1, int arg2,char * rootDir)
+ {
+     FD_t out = NULL;
+     char * fn = NULL;
+@@ -215,7 +214,7 @@ static rpmRC runExtScript(int selinux, A
+     rpmlog(RPMLOG_DEBUG, "%s: scriptlet start\n", sname);
+ 
+     if (script) {
+-	fn = writeScript(*argvp[0], script);
++	fn = writeScript(*argvp[0], script, rootDir);
+ 	if (fn == NULL) {
+ 	    rpmlog(RPMLOG_ERR,
+ 		   _("Couldn't create temporary file for %s: %s\n"),
+@@ -258,7 +257,7 @@ static rpmRC runExtScript(int selinux, A
+     } else if (pid == 0) {/* Child */
+ 	rpmlog(RPMLOG_DEBUG, "%s: execv(%s) pid %d\n",
+ 	       sname, *argvp[0], (unsigned)getpid());
+-	doScriptExec(selinux, *argvp, prefixes, scriptFd, out);
++	doScriptExec(selinux, *argvp, prefixes, scriptFd, out, rootDir);
+     }
+ 
+     do {
+@@ -297,13 +296,27 @@ exit:
+ }
+ 
+ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd,
+-		   ARGV_const_t prefixes, int warn_only, int selinux)
++		   ARGV_const_t prefixes, int warn_only, int selinux, char * rootDir)
+ {
+     ARGV_t args = NULL;
+     rpmlogLvl lvl = warn_only ? RPMLOG_WARNING : RPMLOG_ERR;
+     rpmRC rc;
+-
+-    if (script == NULL) return RPMRC_OK;
++#ifdef RPM_VENDOR_OE
++    const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++#endif
++ 
++     if (script == NULL) return RPMRC_OK;
++#ifdef RPM_VENDOR_OE
++    if (scriptletWrapper && *scriptletWrapper) {
++       argvAdd(&args, scriptletWrapper);
++
++       if ( rootDir ) {
++         argvAdd(&args, rootDir);
++       } else {
++         argvAdd(&args, "/");
++       }
++    }
++#endif
+ 
+     /* construct a new argv as we can't modify the one from header */
+     if (script->args) {
+@@ -315,7 +328,7 @@ rpmRC rpmScriptRun(rpmScript script, int
+     if (rstreq(args[0], "<lua>")) {
+ 	rc = runLuaScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2);
+     } else {
+-	rc = runExtScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2);
++	rc = runExtScript(selinux, prefixes, script->descr, lvl, scriptFd, &args, script->body, arg1, arg2, rootDir);
+     }
+     argvFree(args);
+ 
+Index: rpm-4.11.2/lib/rpmscript.h
+===================================================================
+--- rpm-4.11.2.orig/lib/rpmscript.h
++++ rpm-4.11.2/lib/rpmscript.h
+@@ -29,7 +29,7 @@ rpmScript rpmScriptFree(rpmScript script
+ 
+ RPM_GNUC_INTERNAL
+ rpmRC rpmScriptRun(rpmScript script, int arg1, int arg2, FD_t scriptFd,
+-                   ARGV_const_t prefixes, int warn_only, int selinux);
++                   ARGV_const_t prefixes, int warn_only, int selinux, char * rootDir);
+ 
+ RPM_GNUC_INTERNAL
+ rpmTagVal rpmScriptTag(rpmScript script);
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch
new file mode 100644
index 0000000..3da6085
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm-4.11.2/support-suggests-tag.patch
@@ -0,0 +1,384 @@
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org>
+
+diff --git a/build/pack.c b/build/pack.c
+index b6b2bea..5c3d8df 100644
+--- a/build/pack.c
++++ b/build/pack.c
+@@ -273,8 +273,10 @@ static rpmTagVal depevrtags[] = {
+     RPMTAG_CONFLICTVERSION,
+     RPMTAG_ORDERVERSION,
+     RPMTAG_TRIGGERVERSION,
+-    RPMTAG_SUGGESTSVERSION,
+-    RPMTAG_ENHANCESVERSION,
++    RPMTAG_SUGGESTVERSION,
++    RPMTAG_ENHANCEVERSION,
++    RPMTAG_RECOMMENDVERSION,
++    RPMTAG_SUPPLEMENTVERSION,
+     0
+ };
+ 
+diff --git a/build/parsePreamble.c b/build/parsePreamble.c
+index 5772bef..cbbbee3 100644
+--- a/build/parsePreamble.c
++++ b/build/parsePreamble.c
+@@ -821,6 +821,10 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag,
+ 	}
+ 	/* fallthrough */
+     case RPMTAG_PREREQ:
++    case RPMTAG_RECOMMENDFLAGS:
++    case RPMTAG_SUGGESTFLAGS:
++    case RPMTAG_SUPPLEMENTFLAGS:
++    case RPMTAG_ENHANCEFLAGS:
+     case RPMTAG_CONFLICTFLAGS:
+     case RPMTAG_OBSOLETEFLAGS:
+     case RPMTAG_PROVIDEFLAGS:
+@@ -922,6 +926,10 @@ static struct PreambleRec_s const preambleList[] = {
+     {RPMTAG_ICON,		0, 0, LEN_AND_STR("icon")},
+     {RPMTAG_PROVIDEFLAGS,	0, 0, LEN_AND_STR("provides")},
+     {RPMTAG_REQUIREFLAGS,	2, 0, LEN_AND_STR("requires")},
++    {RPMTAG_RECOMMENDFLAGS,	0, 0, LEN_AND_STR("recommends")},
++    {RPMTAG_SUGGESTFLAGS,	0, 0, LEN_AND_STR("suggests")},
++    {RPMTAG_SUPPLEMENTFLAGS,	0, 0, LEN_AND_STR("supplements")},
++    {RPMTAG_ENHANCEFLAGS,	0, 0, LEN_AND_STR("enhances")},
+     {RPMTAG_PREREQ,		2, 1, LEN_AND_STR("prereq")},
+     {RPMTAG_CONFLICTFLAGS,	0, 0, LEN_AND_STR("conflicts")},
+     {RPMTAG_OBSOLETEFLAGS,	0, 0, LEN_AND_STR("obsoletes")},
+diff --git a/build/parseReqs.c b/build/parseReqs.c
+index ba080a1..1427111 100644
+--- a/build/parseReqs.c
++++ b/build/parseReqs.c
+@@ -61,6 +61,18 @@ rpmRC parseRCPOT(rpmSpec spec, Package pkg, const char *field, rpmTagVal tagN,
+ 	nametag = RPMTAG_REQUIRENAME;
+ 	tagflags |= RPMSENSE_ANY;
+ 	break;
++    case RPMTAG_RECOMMENDFLAGS:
++	nametag = RPMTAG_RECOMMENDNAME;
++	break;
++    case RPMTAG_SUGGESTFLAGS:
++	nametag = RPMTAG_SUGGESTNAME;
++	break;
++    case RPMTAG_SUPPLEMENTFLAGS:
++	nametag = RPMTAG_SUPPLEMENTNAME;
++	break;
++    case RPMTAG_ENHANCEFLAGS:
++	nametag = RPMTAG_ENHANCENAME;
++	break;
+     case RPMTAG_PROVIDEFLAGS:
+ 	nametag = RPMTAG_PROVIDENAME;
+ 	break;
+diff --git a/build/reqprov.c b/build/reqprov.c
+index a368f42..c270af6 100644
+--- a/build/reqprov.c
++++ b/build/reqprov.c
+@@ -81,6 +81,30 @@ int addReqProv(Package pkg, rpmTagVal tagN,
+ 	extra = Flags & RPMSENSE_TRIGGER;
+ 	dsp = &pkg->triggers;
+ 	break;
++    case RPMTAG_RECOMMENDNAME:
++	versiontag = RPMTAG_RECOMMENDVERSION;
++	flagtag = RPMTAG_RECOMMENDFLAGS;
++	extra = Flags & _ALL_REQUIRES_MASK;
++	dsp = &pkg->recommends;
++	break;
++    case RPMTAG_SUGGESTNAME:
++	versiontag = RPMTAG_SUGGESTVERSION;
++	flagtag = RPMTAG_SUGGESTFLAGS;
++	extra = Flags & _ALL_REQUIRES_MASK;
++	dsp = &pkg->suggests;
++	break;
++    case RPMTAG_SUPPLEMENTNAME:
++	versiontag = RPMTAG_SUPPLEMENTVERSION;
++	flagtag = RPMTAG_SUPPLEMENTFLAGS;
++	extra = Flags & _ALL_REQUIRES_MASK;
++	dsp = &pkg->supplements;
++	break;
++    case RPMTAG_ENHANCENAME:
++	versiontag = RPMTAG_ENHANCEVERSION;
++	flagtag = RPMTAG_ENHANCEFLAGS;
++	extra = Flags & _ALL_REQUIRES_MASK;
++	dsp = &pkg->enhances;
++	break;
+     case RPMTAG_REQUIRENAME:
+     default:
+ 	tagN = RPMTAG_REQUIRENAME;
+diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h
+index a9e4c7c..0a1977f 100644
+--- a/build/rpmbuild_internal.h
++++ b/build/rpmbuild_internal.h
+@@ -93,6 +93,10 @@ struct Package_s {
+     rpmds ds;			/*!< Requires: N = EVR */
+     rpmds requires;
+     rpmds provides;
++    rpmds recommends;
++    rpmds suggests;
++    rpmds supplements;
++    rpmds enhances;
+     rpmds conflicts;
+     rpmds obsoletes;
+     rpmds triggers;
+diff --git a/build/spec.c b/build/spec.c
+index 703ec78..7ae2120 100644
+--- a/build/spec.c
++++ b/build/spec.c
+@@ -139,6 +139,11 @@ static Package freePackage(Package pkg)
+     pkg->ds = rpmdsFree(pkg->ds);
+     pkg->requires = rpmdsFree(pkg->requires);
+     pkg->provides = rpmdsFree(pkg->provides);
++    pkg->recommends = rpmdsFree(pkg->recommends);
++    pkg->suggests = rpmdsFree(pkg->suggests);
++    pkg->supplements = rpmdsFree(pkg->supplements);
++    pkg->enhances = rpmdsFree(pkg->enhances);
++
+     pkg->conflicts = rpmdsFree(pkg->conflicts);
+     pkg->obsoletes = rpmdsFree(pkg->obsoletes);
+     pkg->triggers = rpmdsFree(pkg->triggers);
+diff --git a/lib/rpmds.c b/lib/rpmds.c
+index 7a51167..1e5dda0 100644
+--- a/lib/rpmds.c
++++ b/lib/rpmds.c
+@@ -52,6 +52,22 @@ static int dsType(rpmTagVal tag,
+ 	t = "Requires";
+ 	evr = RPMTAG_REQUIREVERSION;
+ 	f = RPMTAG_REQUIREFLAGS;
++    } else if (tag == RPMTAG_SUPPLEMENTNAME) {
++	t = "Supplements";
++	evr = RPMTAG_SUPPLEMENTVERSION;
++	f = RPMTAG_SUPPLEMENTFLAGS;
++    } else if (tag == RPMTAG_ENHANCENAME) {
++	t = "Enhances";
++	evr = RPMTAG_ENHANCEVERSION;
++	f = RPMTAG_ENHANCEFLAGS;
++    } else if (tag == RPMTAG_RECOMMENDNAME) {
++	t = "Recommends";
++	evr = RPMTAG_RECOMMENDVERSION;
++	f = RPMTAG_RECOMMENDFLAGS;
++    } else if (tag == RPMTAG_SUGGESTNAME) {
++	t = "Suggests";
++	evr = RPMTAG_SUGGESTVERSION;
++	f = RPMTAG_SUGGESTFLAGS;
+     } else if (tag == RPMTAG_CONFLICTNAME) {
+ 	t = "Conflicts";
+ 	evr = RPMTAG_CONFLICTVERSION;
+diff --git a/lib/rpmtag.h b/lib/rpmtag.h
+index 64b03f1..b943229 100644
+--- a/lib/rpmtag.h
++++ b/lib/rpmtag.h
+@@ -217,14 +217,14 @@ typedef enum rpmTag_e {
+     RPMTAG_PRETRANSPROG		= 1153,	/* s[] */
+     RPMTAG_POSTTRANSPROG	= 1154,	/* s[] */
+     RPMTAG_DISTTAG		= 1155,	/* s */
+-    RPMTAG_SUGGESTSNAME		= 1156,	/* s[] extension (unimplemented) */
+-#define	RPMTAG_SUGGESTS RPMTAG_SUGGESTSNAME	/* s[] (unimplemented) */
+-    RPMTAG_SUGGESTSVERSION	= 1157,	/* s[] extension (unimplemented) */
+-    RPMTAG_SUGGESTSFLAGS	= 1158,	/* i[] extension (unimplemented) */
+-    RPMTAG_ENHANCESNAME		= 1159,	/* s[] extension placeholder (unimplemented) */
+-#define	RPMTAG_ENHANCES RPMTAG_ENHANCESNAME	/* s[] (unimplemented) */
+-    RPMTAG_ENHANCESVERSION	= 1160,	/* s[] extension placeholder (unimplemented) */
+-    RPMTAG_ENHANCESFLAGS	= 1161,	/* i[] extension placeholder (unimplemented) */
++    RPMTAG_OLDSUGGESTSNAME	= 1156,	/* s[] (unimplemented) */
++#define	RPMTAG_OLDSUGGESTS RPMTAG_OLDSUGGESTSNAME /* s[] (unimplemented) */
++    RPMTAG_OLDSUGGESTSVERSION	= 1157,	/* s[] (unimplemented) */
++    RPMTAG_OLDSUGGESTSFLAGS	= 1158,	/* i[] (unimplemented) */
++    RPMTAG_OLDENHANCESNAME		= 1159,	/* s[] (unimplemented) */
++#define	RPMTAG_OLDENHANCES RPMTAG_OLDENHANCESNAME /* s[] (unimplemented) */
++    RPMTAG_OLDENHANCESVERSION	= 1160,	/* s[] (unimplemented) */
++    RPMTAG_OLDENHANCESFLAGS	= 1161,	/* i[] (unimplemented) */
+     RPMTAG_PRIORITY		= 1162, /* i[] extension placeholder (unimplemented) */
+     RPMTAG_CVSID		= 1163, /* s (unimplemented) */
+ #define	RPMTAG_SVNID	RPMTAG_CVSID	/* s (unimplemented) */
+@@ -261,6 +261,7 @@ typedef enum rpmTag_e {
+     RPMTAG_BUILDOBSOLETES	= 1194, /* internal (unimplemented) */
+     RPMTAG_DBINSTANCE		= 1195, /* i extension */
+     RPMTAG_NVRA			= 1196, /* s extension */
++
+     /* tags 1997-4999 reserved */
+     RPMTAG_FILENAMES		= 5000, /* s[] extension */
+     RPMTAG_FILEPROVIDE		= 5001, /* s[] extension */
+@@ -307,6 +308,26 @@ typedef enum rpmTag_e {
+     RPMTAG_OBSOLETENEVRS	= 5043, /* s[] extension */
+     RPMTAG_CONFLICTNEVRS	= 5044, /* s[] extension */
+     RPMTAG_FILENLINKS		= 5045,	/* i[] extension */
++    RPMTAG_RECOMMENDNAME	= 5046,	/* s[] */
++#define	RPMTAG_RECOMMENDS RPMTAG_RECOMMENDNAME	/* s[] */
++    RPMTAG_RECOMMENDVERSION	= 5047,	/* s[] */
++    RPMTAG_RECOMMENDFLAGS	= 5048,	/* i[] */
++    RPMTAG_SUGGESTNAME		= 5049,	/* s[] */
++#define	RPMTAG_SUGGESTS RPMTAG_SUGGESTNAME	/* s[] */
++    RPMTAG_SUGGESTVERSION	= 5050,	/* s[] extension */
++    RPMTAG_SUGGESTFLAGS		= 5051,	/* i[] extension */
++    RPMTAG_SUPPLEMENTNAME	= 5052,	/* s[] */
++#define	RPMTAG_SUPPLEMENTS RPMTAG_SUPPLEMENTNAME /* s[] */
++    RPMTAG_SUPPLEMENTVERSION	= 5053,	/* s[] */
++    RPMTAG_SUPPLEMENTFLAGS	= 5054,	/* i[] */
++    RPMTAG_ENHANCENAME		= 5055,	/* s[] */
++#define	RPMTAG_ENHANCES RPMTAG_ENHANCENAME	/* s[] */
++    RPMTAG_ENHANCEVERSION	= 5056,	/* s[] */
++    RPMTAG_ENHANCEFLAGS		= 5057,	/* i[] */
++    RPMTAG_RECOMMENDNEVRS	= 5058, /* s[] extension */
++    RPMTAG_SUGGESTNEVRS		= 5059, /* s[] extension */
++    RPMTAG_SUPPLEMENTNEVRS	= 5060, /* s[] extension */
++    RPMTAG_ENHANCENEVRS		= 5061, /* s[] extension */
+ 
+     RPMTAG_FIRSTFREE_TAG	/*!< internal */
+ } rpmTag;
+diff --git a/lib/tagexts.c b/lib/tagexts.c
+index 29b2bae..e940310 100644
+--- a/lib/tagexts.c
++++ b/lib/tagexts.c
+@@ -761,6 +761,26 @@ static int requirenevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
+     return depnevrsTag(h, td, hgflags, RPMTAG_REQUIRENAME);
+ }
+ 
++static int recommendnevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
++{
++    return depnevrsTag(h, td, hgflags, RPMTAG_RECOMMENDNAME);
++}
++
++static int suggestnevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
++{
++    return depnevrsTag(h, td, hgflags, RPMTAG_SUGGESTNAME);
++}
++
++static int supplementnevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
++{
++    return depnevrsTag(h, td, hgflags, RPMTAG_SUPPLEMENTNAME);
++}
++
++static int enhancenevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
++{
++    return depnevrsTag(h, td, hgflags, RPMTAG_ENHANCENAME);
++}
++
+ static int providenevrsTag(Header h, rpmtd td, headerGetFlags hgflags)
+ {
+     return depnevrsTag(h, td, hgflags, RPMTAG_PROVIDENAME);
+@@ -823,6 +843,10 @@ static const struct headerTagFunc_s rpmHeaderTagExtensions[] = {
+     { RPMTAG_EPOCHNUM,		epochnumTag },
+     { RPMTAG_INSTFILENAMES,	instfilenamesTag },
+     { RPMTAG_REQUIRENEVRS,	requirenevrsTag },
++    { RPMTAG_RECOMMENDNEVRS,	recommendnevrsTag},
++    { RPMTAG_SUGGESTNEVRS,	suggestnevrsTag},
++    { RPMTAG_SUPPLEMENTNEVRS,	supplementnevrsTag},
++    { RPMTAG_ENHANCENEVRS,	enhancenevrsTag},
+     { RPMTAG_PROVIDENEVRS,	providenevrsTag },
+     { RPMTAG_OBSOLETENEVRS,	obsoletenevrsTag },
+     { RPMTAG_CONFLICTNEVRS,	conflictnevrsTag },
+diff --git a/rpmpopt.in b/rpmpopt.in
+index 805599e..036ab4e 100644
+--- a/rpmpopt.in
++++ b/rpmpopt.in
+@@ -67,6 +67,19 @@ rpm	alias --requires	--qf \
+ 	--POPTdesc=$"list capabilities required by package(s)"
+ rpm	alias -R --requires
+ 
++rpm	alias --recommends	--qf \
++  "[%|VERBOSE?{%{RECOMMENDFLAGS:deptype}: }:{}|%{RECOMMENDNEVRS}\n]" \
++	--POPTdesc=$"list capabilities recommended by package(s)"
++rpm	alias --suggests	--qf \
++  "[%|VERBOSE?{%{SUGGESTFLAGS:deptype}: }:{}|%{SUGGESTNEVRS}\n]" \
++	--POPTdesc=$"list capabilities suggested by package(s)"
++rpm	alias --supplements	--qf \
++  "[%|VERBOSE?{%{SUPPLEMENTFLAGS:deptype}: }:{}|%{SUPPLEMENTNEVRS}\n]" \
++	--POPTdesc=$"list capabilities supplemented by package(s)"
++rpm	alias --enhances	--qf \
++  "[%|VERBOSE?{%{ENHANCEFLAGS:deptype}: }:{}|%{ENHANCENEVRS}\n]" \
++	--POPTdesc=$"list capabilities enhanced by package(s)"
++
+ rpm	alias --info --qf '\
+ Name        : %{NAME}\n\
+ %|EPOCH?{Epoch       : %{EPOCH}\n}|\
+diff --git a/tests/data/SPECS/deptest.spec b/tests/data/SPECS/deptest.spec
+index cb4cbbd..7c47f6d 100644
+--- a/tests/data/SPECS/deptest.spec
++++ b/tests/data/SPECS/deptest.spec
+@@ -10,6 +10,10 @@ BuildArch:	noarch
+ %{?provs:Provides: %{provs}}
+ %{?cfls:Conflicts: %{cfls}}
+ %{?obs:Obsoletes: %{obs}}
++%{?recs:Recommends: %{recs}}
++%{?sugs:Suggests: %{sugs}}
++%{?sups:Supplements: %{sups}}
++%{?ens:Enhances: %{ens}}
+ 
+ %description
+ %{summary}
+diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
+index 6230903..c4c954c 100644
+--- a/tests/rpmbuild.at
++++ b/tests/rpmbuild.at
+@@ -185,3 +185,25 @@ lrwxrwxrwx /opt/globtest/linkgood
+ ],
+ [])
+ AT_CLEANUP
++
++# ------------------------------
++# Check if weak and reverse requires can be built
++AT_SETUP([Weak and reverse requires])
++AT_KEYWORDS([build])
++AT_CHECK([
++
++runroot rpmbuild -bb --quiet \
++	--define "pkg weakdeps" \
++	--define "recs foo > 1.2.3" \
++	--define "sugs bar >= 0.1.2" \
++	--define "sups baz" \
++	--define "ens zap = 3" \
++	  /data/SPECS/deptest.spec
++
++runroot rpm -qp --qf "[%{supplementname}\n]" /build/RPMS/noarch/deptest-weakdeps-1.0-1.noarch.rpm
++],
++[0],
++[baz
++],
++[ignore])
++AT_CLEANUP
+diff --git a/tests/rpmgeneral.at b/tests/rpmgeneral.at
+index 13131e2..80cca63 100644
+--- a/tests/rpmgeneral.at
++++ b/tests/rpmgeneral.at
+@@ -79,6 +79,11 @@ DISTTAG
+ DISTURL
+ DSAHEADER
+ E
++ENHANCEFLAGS
++ENHANCENAME
++ENHANCENEVRS
++ENHANCES
++ENHANCEVERSION
+ EPOCH
+ EPOCHNUM
+ EVR
+@@ -199,6 +204,11 @@ PROVIDES
+ PROVIDEVERSION
+ PUBKEYS
+ R
++RECOMMENDFLAGS
++RECOMMENDNAME
++RECOMMENDNEVRS
++RECOMMENDS
++RECOMMENDVERSION
+ RECONTEXTS
+ RELEASE
+ REMOVETID
+@@ -219,7 +229,17 @@ SOURCE
+ SOURCEPACKAGE
+ SOURCEPKGID
+ SOURCERPM
++SUGGESTFLAGS
++SUGGESTNAME
++SUGGESTNEVRS
++SUGGESTS
++SUGGESTVERSION
+ SUMMARY
++SUPPLEMENTFLAGS
++SUPPLEMENTNAME
++SUPPLEMENTNEVRS
++SUPPLEMENTS
++SUPPLEMENTVERSION
+ TRIGGERCONDS
+ TRIGGERFLAGS
+ TRIGGERINDEX
diff --git a/meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch b/meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch
new file mode 100644
index 0000000..8d84cf8
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm-4.11.2/use-pkgconfig-for-python.patch
@@ -0,0 +1,38 @@
+
+Use pkgconfig to get the correct include paths
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Signed-off-by: Ronan Le Martret <ronan.lemartret@open.eurogiciel.org>
+
+diff --git a/configure.ac b/configure.ac
+index e97f727..8179f44 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -540,10 +540,10 @@ esac],
+ 
+ AS_IF([test "$enable_python" = yes],[
+   AM_PATH_PYTHON([2.6],[
+-    WITH_PYTHON_INCLUDE=`${PYTHON} -c 'from distutils.sysconfig import *; import sys; sys.stdout.write(get_python_inc())'`
++    WITH_PYTHON_INCLUDE=$(${PKG_CONFIG} --cflags-only-I  python)
+     WITH_PYTHON_SUBPACKAGE=1
+     save_CPPFLAGS="$CPPFLAGS"
+-    CPPFLAGS="$CPPFLAGS -I$WITH_PYTHON_INCLUDE"
++    CPPFLAGS="$CPPFLAGS $WITH_PYTHON_INCLUDE"
+     AC_CHECK_HEADER([Python.h],[],
+       [AC_MSG_ERROR([missing Python.h])
+       ])
+diff --git a/python/Makefile.am b/python/Makefile.am
+index fff51ae..f37cb9d 100644
+--- a/python/Makefile.am
++++ b/python/Makefile.am
+@@ -4,7 +4,7 @@ EXTRA_DIST = rpm/__init__.py rpm/transaction.py
+ 
+ AM_CPPFLAGS = -I$(top_builddir)/include/
+ AM_CPPFLAGS += -I$(top_srcdir)/python
+-AM_CPPFLAGS += -I@WITH_PYTHON_INCLUDE@
++AM_CPPFLAGS += @WITH_PYTHON_INCLUDE@
+ 
+ pkgpyexec_LTLIBRARIES = _rpmmodule.la _rpmbmodule.la _rpmsmodule.la
+ pkgpyexec_DATA = rpm/__init__.py rpm/transaction.py
diff --git a/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch b/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
new file mode 100644
index 0000000..23bc336
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch
@@ -0,0 +1,49 @@
+From 64851c6622aff64787a9fcea26cccde183b7c743 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Tue, 11 Nov 2014 16:28:22 +0800
+Subject: [PATCH] using poptParseArgvString to parse the
+ _gpg_check_password_cmd
+
+Upstream-Status: Pending
+
+Both __gpg_check_password_cmd and __gpg_sign_cmd include "%{_gpg_name}", but
+strace shows that gpg_name has a quote when run _gpg_check_password,
+but not when run __gpg_sign_cmd; for example, if gpg_name is "tester"
+
+    execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose",
+    "--passphrase-fd", "3", "-u", "\"tester\"", "-so", "-"], [/* 20 vars */]) = 0
+
+    execve("/usr/bin/gpg", ["gpg", "--batch", "--no-verbose", "--no-armor",
+    "--passphrase-fd", "3", "--no-secmem-warning", "-u", "tester", "-sbo"..,) = 0
+
+it can be fixed by removing the quote around %{gpg_name} when define
+__gpg_check_password_cmd in macros/macros, like below, but if gpg_name includes
+space, it will not work.
+
+     %__gpg_check_password_cmd       %{__gpg} \
+        gpg --batch --no-verbose --passphrase-fd 3 -u %{_gpg_name} -so -
+
+The poptParseArgvString function is used to parse _gpg_sign_cmd, so using
+poptParseArgvString to parse __gpg_check_password_cmd to fix this issue.
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ rpmdb/signature.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rpmdb/signature.c b/rpmdb/signature.c
+index c35e0ab..016e8d1 100644
+--- a/rpmdb/signature.c
++++ b/rpmdb/signature.c
+@@ -529,7 +529,7 @@ int rpmCheckPassPhrase(const char * passPhrase)
+   		(void) setenv("GNUPGHOME", gpg_path, 1);
+ 
+ 	    cmd = rpmExpand("%{?__gpg_check_password_cmd}", NULL);
+-	    rc = argvSplit(&av, cmd, NULL);
++	    rc = poptParseArgvString(cmd, NULL, (const char ***)&av);
+ 	    if (!rc)
+ 		rc = execve(av[0], (char *const *)av+1, environ);
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/rpm/rpm/dbconvert.patch b/meta/recipes-devtools/rpm/rpm/dbconvert.patch
new file mode 100644
index 0000000..1fdbf09
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/dbconvert.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Inappropriate
+
+Hack to prevent unneeded demo app from building on older libc
+where it will break the build
+
+Index: rpm-5.4.14/tools/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/tools/Makefile.am
++++ rpm-5.4.14/tools/Makefile.am
+@@ -29,7 +29,7 @@ EXTRA_PROGRAMS = nix-copy-closure nix-en
+ 	xiu-instantiate xiu-store
+ noinst_PROGRAMS =
+ 
+-EXTRA_PROGRAMS += augtool cudftool dbconvert debugedit \
++EXTRA_PROGRAMS += augtool cudftool debugedit \
+ 	nix-build nix-channel nix-collect-garbage \
+ 	nix-log2xml nix-prefetch-url nix-pull nix-push \
+ 	xiu-echo xiu-hash \
+@@ -64,7 +64,7 @@ pkgbin_PROGRAMS =	\
+ 	rpmcache rpmdigest rpmrepo rpmspecdump \
+ 	rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
+ if WITH_DB
+-pkgbin_PROGRAMS +=	dbconvert
++pkgbin_PROGRAMS +=	
+ endif
+ dist_man_MANS =		rpmgrep.1
+ 
diff --git a/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch b/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
new file mode 100644
index 0000000..beef5ed
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/debugedit-segv.patch
@@ -0,0 +1,98 @@
+During the recalculation of the buildid, it's necessary to change the word
+back to the original endian.  However, if we do this in-place, we've also
+affected the headers that we're also working on.  The side effect of this is
+we can no longer rely on 'sh_type' as it may have been changed.
+
+This patch ensures that any time we translate the loaded data to the machine
+format, we only do it in a backup copy and never the original copy.
+
+Note: in all other places a backup copy was used, just not buildid processing.
+
+Also the process (...) function was modified to verify the data is not
+NULL as well.  This is an extra check and is not strictly necessary.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/tools/debugedit.c
+===================================================================
+--- rpm-5.4.14.orig/tools/debugedit.c
++++ rpm-5.4.14/tools/debugedit.c
+@@ -1445,21 +1445,24 @@ handle_build_id (DSO *dso, Elf_Data *bui
+     auto inline void process (const void *data, size_t size)
+     {
+       memchunk chunk = { .data = (void *) data, .size = size };
+-      hashFunctionContextUpdateMC (&ctx, &chunk);
++      if (data != NULL && size != 0)
++        hashFunctionContextUpdateMC (&ctx, &chunk);
+     }
+     union
+     {
+       GElf_Ehdr ehdr;
+       GElf_Phdr phdr;
+       GElf_Shdr shdr;
+-    } u;
+-    Elf_Data x = { .d_version = EV_CURRENT, .d_buf = &u };
++    } u1, u2;
++    Elf_Data src  = { .d_version = EV_CURRENT, .d_buf = &u1 };
++    Elf_Data dest = { .d_version = EV_CURRENT, .d_buf = &u2 };
+ 
+-    x.d_type = ELF_T_EHDR;
+-    x.d_size = sizeof u.ehdr;
+-    u.ehdr = dso->ehdr;
+-    u.ehdr.e_phoff = u.ehdr.e_shoff = 0;
+-    if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
++    src.d_type = ELF_T_EHDR;
++    src.d_size = sizeof u1.ehdr;
++    dest.d_size = sizeof u2.ehdr;
++    u1.ehdr = dso->ehdr;
++    u1.ehdr.e_phoff = u1.ehdr.e_shoff = 0;
++    if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
+       {
+       bad:
+ 	fprintf (stderr, "Failed to compute header checksum: %s\n",
+@@ -1467,29 +1470,31 @@ handle_build_id (DSO *dso, Elf_Data *bui
+ 	exit (1);
+       }
+ 
+-    x.d_type = ELF_T_PHDR;
+-    x.d_size = sizeof u.phdr;
++    src.d_type = ELF_T_PHDR;
++    src.d_size = sizeof u1.phdr;
++    dest.d_size = sizeof u2.phdr;
+     for (i = 0; i < dso->ehdr.e_phnum; ++i)
+       {
+-	if (gelf_getphdr (dso->elf, i, &u.phdr) == NULL)
++	if (gelf_getphdr (dso->elf, i, &u1.phdr) == NULL)
+ 	  goto bad;
+-	if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
++	if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
+ 	  goto bad;
+-	process (x.d_buf, x.d_size);
++	process (dest.d_buf, dest.d_size);
+       }
+ 
+-    x.d_type = ELF_T_SHDR;
+-    x.d_size = sizeof u.shdr;
++    src.d_type = ELF_T_SHDR;
++    src.d_size = sizeof u1.shdr;
++    dest.d_size = sizeof u2.shdr;
+     for (i = 0; i < dso->ehdr.e_shnum; ++i)
+       if (dso->scn[i] != NULL)
+ 	{
+-	  u.shdr = dso->shdr[i];
+-	  u.shdr.sh_offset = 0;
+-	  if (elf64_xlatetom (&x, &x, dso->ehdr.e_ident[EI_DATA]) == NULL)
++	  u1.shdr = dso->shdr[i];
++	  u1.shdr.sh_offset = 0;
++	  if (elf64_xlatetom (&dest, &src, dso->ehdr.e_ident[EI_DATA]) == NULL)
+ 	    goto bad;
+-	  process (x.d_buf, x.d_size);
++	  process (dest.d_buf, dest.d_size);
+ 
+-	  if (u.shdr.sh_type != SHT_NOBITS)
++	  if (u1.shdr.sh_type != SHT_NOBITS)
+ 	    {
+ 	      Elf_Data *d = elf_rawdata (dso->scn[i], NULL);
+ 	      if (d == NULL)
diff --git a/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch b/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch
new file mode 100644
index 0000000..f7c3100
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/debugedit-valid-file-to-fix-segment-fault.patch
@@ -0,0 +1,65 @@
+debugedit: fix segment fault while file's bss offset have a large number
+
+While ELF_C_RDWR_MMAP was used, elf_begin invoked mmap() to map file
+into memory. While the file's bss Offset has a large number, elf_update
+caculated file size by __elf64_updatenull_wrlock and the size was
+enlarged.
+
+In this situation, elf_update invoked ftruncate to enlarge the file,
+and memory size (elf->maximum_size) also was incorrectly updated.
+There was segment fault in elf_end which invoked munmap with the
+length is the enlarged file size, not the mmap's length.
+
+Before the above operations, invoke elf_begin/elf_update/elf_end
+with ELF_C_RDWR and ELF_F_LAYOUT set to enlarge the above file, it
+could make sure the file is safe for the following elf operations.
+
+Upstream-Status: Pending
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tools/debugedit.c | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+Index: rpm-5.4.14/tools/debugedit.c
+===================================================================
+--- rpm-5.4.14.orig/tools/debugedit.c
++++ rpm-5.4.14/tools/debugedit.c
+@@ -1525,6 +1525,28 @@ handle_build_id (DSO *dso, Elf_Data *bui
+   }
+ }
+ 
++/* It avoided the segment fault while file's bss offset have a large number.
++   See https://bugzilla.redhat.com/show_bug.cgi?id=1019707
++       https://bugzilla.redhat.com/show_bug.cgi?id=1020842 for detail. */
++void valid_file(int fd)
++{
++  Elf *elf = elf_begin (fd, ELF_C_RDWR, NULL);
++  if (elf == NULL)
++  {
++    error (1, 0, "elf_begin: %s", elf_errmsg (-1));
++    return;
++  }
++
++  elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT);
++
++  if (elf_update (elf, ELF_C_WRITE) < 0)
++    error (1, 0, "elf_update: %s", elf_errmsg (-1));
++
++  elf_end (elf);
++
++  return;
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -1621,6 +1643,9 @@ main (int argc, char *argv[])
+       exit (1);
+     }
+ 
++  /* Make sure the file is valid. */
++  valid_file(fd);
++
+   dso = fdopen_dso (fd, file);
+   if (dso == NULL)
+     exit (1);
diff --git a/meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch b/meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch
new file mode 100644
index 0000000..976af48
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/fstack-protector-configure-check.patch
@@ -0,0 +1,21 @@
+Some options checked in this loop are needing linking to find out
+if the option can be used or not e.g. -fstack-protector which needs
+libssp to be staged and available for compiler to link against
+Therefore we change the compile only check to compile and link check
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: rpm-5.4.14/configure.ac
+===================================================================
+--- rpm-5.4.14.orig/configure.ac
++++ rpm-5.4.14/configure.ac
+@@ -201,7 +201,7 @@ dnl # GNU GCC (usually "gcc")
+  my_save_cflags="$CFLAGS"
+  CFLAGS=$c
+  AC_MSG_CHECKING([whether GCC supports $c])
+- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
++ AC_LINK_IFELSE([AC_LANG_PROGRAM([])],
+     [AC_MSG_RESULT([yes])]
+     [my_cflags=$c],
+     [AC_MSG_RESULT([no])]
diff --git a/meta/recipes-devtools/rpm/rpm/header-include-fix.patch b/meta/recipes-devtools/rpm/rpm/header-include-fix.patch
new file mode 100644
index 0000000..5ffb187
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/header-include-fix.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+Index: rpm-5.4.14/rpmdb/rpmdb.h
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/rpmdb.h
++++ rpm-5.4.14/rpmdb/rpmdb.h
+@@ -9,6 +9,7 @@
+ 
+ #include <assert.h>
+ #include <mire.h>
++#include <errno.h>
+ 
+ #include <rpmtypes.h>
+ #include <rpmtag.h>	/* XXX Header typedef */
+Index: rpm-5.4.14/rpmdb/rpmtag.h
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/rpmtag.h
++++ rpm-5.4.14/rpmdb/rpmtag.h
+@@ -7,6 +7,7 @@
+ 
+ #include <rpmiotypes.h>
+ #include <rpmsw.h>
++#include <stdint.h>
+ 
+ #ifdef __cplusplus
+ extern "C" {
diff --git a/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch b/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch
new file mode 100644
index 0000000..8fab9eb
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/makefile-am-exec-hook.patch
@@ -0,0 +1,33 @@
+rpm: Resolve parallel install issue when installing lua
+
+When lua is being installed on some systems that are being run with high levels
+of parallelization there are cases where install-data-am and install-exec-hook
+are processed at the same or a very short time apart. This causes
+install-pkgbinPROGRAMS, which is a dependency of both, to be run at around the
+same time This sometimes causes file contention and will sometimes be in a state
+where install-exec-hook is looking for a file that is being installed or both
+install-pkgbinPROGRAMS being run are installing the same file and fail because
+it cannon create a new file.
+
+This patch allows install-exec-hook to be called by install-data-am instead of
+install-exec-am. It also removed the dependency in install-data-hook on
+install-pkgbinPROGRAMS. This means install-pkgbinPROGRAMS will only be run once
+so there whould be any file contention.
+
+Upstream-Status: Pending
+
+Signed-off-by: Morgan Little <morgan.little@windriver.com>
+
+Index: rpm-5.4.14/lua/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/lua/Makefile.am
++++ rpm-5.4.14/lua/Makefile.am
+@@ -326,7 +326,7 @@ clean-local:
+ # XXX Build & install as rpmlua/rpmluac with hardlinks to lua/luac post install.
+ # XXX CVS has lua/luac sub-directories in the Attic that collide with the
+ # XXX lua/luac executable names when using cvs update.
+-install-exec-hook:	install-pkgbinPROGRAMS
++install-data-hook:	
+ 	mkdir -p $(DESTDIR)$(pkgbindir)
+ 	$(__RM) -f $(DESTDIR)$(pkgbindir)/lua
+ 	$(__LN) $(DESTDIR)$(pkgbindir)/rpmlua $(DESTDIR)$(pkgbindir)/lua
diff --git a/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch b/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch
new file mode 100644
index 0000000..410623f
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/no-ldflags-in-pkgconfig.patch
@@ -0,0 +1,14 @@
+Don't put LDFLAGS into the Libs.private, all it generally contains is a linker
+hash selection (harmless) and the absolute path to the libdir in the sysroot
+(actively harmful).
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/scripts/rpm.pc.in b/scripts/rpm.pc.in
+index 8293471..2ea469c 100644
+--- a/scripts/rpm.pc.in
++++ b/scripts/rpm.pc.in
+@@ -17 +17 @@ Libs: -L${libdir} -lrpmbuild${suffix} -lrpm${suffix} -lrpmdb${suffix} -lrpmio${s
+-Libs.private: @LDFLAGS@ @LIBS@
++Libs.private: @LIBS@
diff --git a/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh b/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh
new file mode 100755
index 0000000..b72c9f0
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/perfile_rpmdeps.sh
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+: ${RPMDEPS:=rpmdeps}
+
+process() {
+	while read file_name ; do
+		printf "%s\t" ${file_name}
+		if [ ! -d $file_name ]; then
+			printf "%s " $($RPMDEPS $1 $file_name | sed -e 's,rpmlib(.*,,' -e 's,\([<>\=]\+ \+[^ ]*\),(\1),g')
+		fi
+		printf "\n"
+	done
+}
+
+usage() {
+	echo "$0 {-P|--provides} {-R|--requires} FILE ..."
+}
+
+while [ $# -gt 0 ]; do
+   case "$1" in
+	--rpmdeps)
+		RPMDEPS=$2
+		shift
+		shift
+		;;
+	-R|--requires)
+		process_type=--requires
+		shift
+		;;
+	-P|--provides)
+		process_type=--provides
+		shift
+		;;
+	*)
+		break;
+		;;
+   esac
+done
+
+if [ -z "$process_type" ]; then
+	usage
+	exit 1
+fi
+
+if [ $# -gt 0 ]; then
+	find "$@" | process $process_type
+	exit $?
+fi
+
+process $process_type
diff --git a/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch b/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch
new file mode 100644
index 0000000..a538a60
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/python-rpm-rpmsense.patch
@@ -0,0 +1,33 @@
+rpmmodule.c: Export a few additional RPMSENSE values
+
+We want to see the RPMSENSE_SCRIPT values for use with SMART.  We also
+want to see the MISSINGOK value so we can avoid recommended packages causing
+failures.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/python/rpmmodule.c
+===================================================================
+--- rpm-5.4.14.orig/python/rpmmodule.c
++++ rpm-5.4.14/python/rpmmodule.c
+@@ -494,12 +494,16 @@ void init_rpm(void)
+     REGISTER_ENUM(RPMSENSE_EQUAL);
+     REGISTER_ENUM(RPMSENSE_NOTEQUAL);
+     REGISTER_ENUM(RPMSENSE_FIND_REQUIRES);
+-#if defined(RPM_VENDOR_MANDRIVA)
++#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
+     REGISTER_ENUM(RPMSENSE_PREREQ);
+     REGISTER_ENUM(RPMSENSE_SCRIPT_PRE);
+     REGISTER_ENUM(RPMSENSE_SCRIPT_POST);
+     REGISTER_ENUM(RPMSENSE_SCRIPT_PREUN);
+-    REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN)
++    REGISTER_ENUM(RPMSENSE_SCRIPT_POSTUN);
++#endif
++
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
++    REGISTER_ENUM(RPMSENSE_MISSINGOK);
+ #endif
+ 
+     REGISTER_ENUM(RPMDEPS_FLAG_NOUPGRADE);
diff --git a/meta/recipes-devtools/rpm/rpm/pythondeps.sh b/meta/recipes-devtools/rpm/rpm/pythondeps.sh
new file mode 100755
index 0000000..083b174
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/pythondeps.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+[ $# -ge 1 ] || {
+    cat > /dev/null
+    exit 0
+}
+
+case $1 in
+-R|--requires)
+    shift
+    grep "/usr/\(lib[^/]*\|share\)/python[^/]*/" >/dev/null && echo "python"
+    exit 0
+    ;;
+esac
+
+exit 0
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-CVE-2013-6435.patch b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2013-6435.patch
new file mode 100644
index 0000000..b107e8f
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2013-6435.patch
@@ -0,0 +1,109 @@
+From 08105acda1da63d32fbb18596a3d6c3e0aa106d1 Mon Sep 17 00:00:00 2001
+From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
+Date: Wed, 10 Jun 2015 14:36:56 +0000
+Subject: [PATCH 2/2] rpm: CVE-2013-6435
+
+Upstream-Status: Backport
+
+Reference:
+https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2013-6435
+
+Description:
+It was found that RPM wrote file contents to the target installation
+directory under a temporary name, and verified its cryptographic signature
+only after the temporary file has been written completely. Under certain
+conditions, the system interprets the unverified temporary file contents
+and extracts commands from it. This could allow an attacker to modify
+signed RPM files in such a way that they would execute code chosen
+by the attacker during package installation.
+
+Original Patch:
+https://bugzilla.redhat.com/attachment.cgi?id=956207
+
+Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
+---
+ lib/fsm.c     |  2 +-
+ rpmio/rpmio.c | 18 ++++++++++++++----
+ 2 files changed, 15 insertions(+), 5 deletions(-)
+
+diff --git a/lib/fsm.c b/lib/fsm.c
+index 1ee7e67..094eb1d 100644
+--- a/lib/fsm.c
++++ b/lib/fsm.c
+@@ -726,7 +726,7 @@ static int expandRegular(FSM_t fsm, rpmpsm psm, rpmcpio_t archive, int nodigest)
+ {
+     FD_t wfd = NULL;
+     const struct stat * st = &fsm->sb;
+-    rpm_loff_t left = st->st_size;
++    rpm_loff_t left = rpmfiFSizeIndex(fsmGetFi(fsm), fsm->ix);
+     const unsigned char * fidigest = NULL;
+     pgpHashAlgo digestalgo = 0;
+     int rc = 0;
+diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
+index cd223e8..0b12e31 100644
+--- a/rpmio/rpmio.c
++++ b/rpmio/rpmio.c
+@@ -1309,15 +1309,19 @@ int Fclose(FD_t fd)
+  * - bzopen:	[1-9] is block size (modulo 100K)
+  * - bzopen:	's' is smallmode
+  * - HACK:	'.' terminates, rest is type of I/O
++ * -            'U' sets *mode to zero (no permissions) instead of 0666
+  */
+ static void cvtfmode (const char *m,
+ 				char *stdio, size_t nstdio,
+ 				char *other, size_t nother,
+-				const char **end, int * f)
++				const char **end, int *f, mode_t *mode)
+ {
+     int flags = 0;
+     char c;
+ 
++    if (mode)
++    *mode = 0666;
++
+     switch (*m) {
+     case 'a':
+ 	flags |= O_WRONLY | O_CREAT | O_APPEND;
+@@ -1357,6 +1361,10 @@ static void cvtfmode (const char *m,
+ 	    if (--nstdio > 0) *stdio++ = c;
+ 	    continue;
+ 	    break;
++	case 'U':
++	    if (mode)
++		*mode = 0;
++	    break;
+ 	default:
+ 	    if (--nother > 0) *other++ = c;
+ 	    continue;
+@@ -1385,7 +1393,8 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd));
+     if (fd == NULL || fmode == NULL)
+ 	return NULL;
+ 
+-    cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL);
++    cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, NULL,
++        NULL);
+     if (stdio[0] == '\0')
+ 	return NULL;
+     zstdio[0] = '\0';
+@@ -1436,7 +1445,7 @@ FD_t Fopen(const char *path, const char *fmode)
+ {
+     char stdio[20], other[20];
+     const char *end = NULL;
+-    mode_t perms = 0666;
++    mode_t perms;
+     int flags = 0;
+     FD_t fd;
+ 
+@@ -1444,7 +1453,8 @@ FD_t Fopen(const char *path, const char *fmode)
+ 	return NULL;
+ 
+     stdio[0] = '\0';
+-    cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags);
++    cvtfmode(fmode, stdio, sizeof(stdio), other, sizeof(other), &end, &flags,
++        &perms);
+     if (stdio[0] == '\0')
+ 	return NULL;
+ 
+-- 
+1.8.4.5
+
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch
new file mode 100644
index 0000000..bf1795c
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-CVE-2014-8118.patch
@@ -0,0 +1,43 @@
+From 71c812edf1431a9967bd99ba6ffa6ab89eb7ec7c Mon Sep 17 00:00:00 2001
+From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
+Date: Wed, 10 Jun 2015 12:56:55 +0000
+Subject: [PATCH 1/2] rpm: CVE-2014-8118
+
+Upstream-Status: Backport
+
+Reference:
+https://bugzilla.redhat.com/show_bug.cgi?id=1168715
+
+Description:
+It was found that RPM could encounter an integer overflow,
+leading to a stack-based overflow, while parsing a crafted
+CPIO header in the payload section of an RPM file.  This could
+allow an attacker to modify signed RPM files in such a way that
+they would execute code chosen by the attacker during package
+installation.
+
+Original Patch:
+https://bugzilla.redhat.com/attachment.cgi?id=962159
+
+Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
+---
+ lib/cpio.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/lib/cpio.c b/lib/cpio.c
+index 382eeb6..74ddd9c 100644
+--- a/lib/cpio.c
++++ b/lib/cpio.c
+@@ -296,6 +296,9 @@ int rpmcpioHeaderRead(rpmcpio_t cpio, char ** path, struct stat * st)
+     st->st_rdev = makedev(major, minor);
+ 
+     GET_NUM_FIELD(hdr.namesize, nameSize);
++    if (nameSize <= 0 || nameSize > 4096) {
++        return CPIOERR_BAD_HEADER;
++    }
+ 
+     *path = xmalloc(nameSize + 1);
+     read = Fread(*path, nameSize, 1, cpio->fd);
+-- 
+1.8.4.5
+
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch b/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
new file mode 100644
index 0000000..8771235
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-autogen.patch
@@ -0,0 +1,25 @@
+Remove the sanity checking from the rpm autogen.sh.  This is required because
+we may have slightly different, but yet compatible versions.  If we do end
+up breaking things, we'll deal with it at that time.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/syck/autogen.sh
+===================================================================
+--- rpm-5.4.14.orig/syck/autogen.sh
++++ rpm-5.4.14/syck/autogen.sh
+@@ -34,12 +34,6 @@ libtoolize () {
+     eval $_libtoolize $_libtoolize_args
+ }
+ 
+-#   requirements sanity check
+-[ "`automake   --version | head -1`" != "$AMV" ] && echo "$USAGE" # && exit 1
+-[ "`autoconf   --version | head -1`" != "$ACV" ] && echo "$USAGE" # && exit 1
+-[ "`libtoolize --version | head -1`" != "$LTV" ] && echo "$USAGE" # && exit 1
+-[ "`gettextize --version | head -1 | sed -e 's;^.*/\\(gettextize\\);\\1;'`" != "$GTT" ] && echo "$USAGE" # && exit 1
+-
+ echo "---> generate files via GNU libtool (libtoolize)"
+ libtoolize --quiet --copy --force --install
+ echo "---> generate files via GNU autoconf (aclocal, autoheader)"
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch b/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch
new file mode 100644
index 0000000..41ab498
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-canonarch.patch
@@ -0,0 +1,136 @@
+lib/rpmrc.c: Update --target processing to support full GNU canonical arch
+
+Prior to this patch, when using --target, RPM supported the format:
+  <arch>
+  <arch>-<os>
+  <arch>-<os>-gnu
+  <arch>-<arbitrary items>-<os>
+  <arch>-<arbitrary items>-<os>-gnu
+
+This patch changes the list of supported items to:
+  <arch>
+  <arch>-<os>
+  <arch>-<os>-gnu
+  <arch>-<vendor>-<os>
+  <arch>-<vendor>-<os>-<extension>
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -925,8 +925,8 @@ static void getMachineInfo(int type, /*@
+ 
+ static void rpmRebuildTargetVars(const char ** target, const char ** canontarget)
+ {
+-
+-    char *ca = NULL, *co = NULL, *ct = NULL;
++    /* ca = arch, cv = vendor, co = os, ce = extension, ct = canon target */
++    char *ca = NULL, *cv = NULL, *co = NULL, *ce = NULL, *ct = NULL;
+     int x;
+ 
+     /* Rebuild the compat table to recalculate the current target arch.  */
+@@ -936,23 +936,60 @@ static void rpmRebuildTargetVars(const c
+     rpmSetTables(RPM_MACHTABLE_BUILDARCH, RPM_MACHTABLE_BUILDOS);
+ 
+     if (target && *target) {
++	/* GNU canonical format is:
++	 *  <arch>-<vendor>-<os>[-extension]
++	 *
++	 * We support the both the GNU canonical format
++	 * as well as the traditional RPM formats: 
++	 *  <arch>
++	 *  <arch>-<os>[-gnu]
++	 */
+ 	char *c;
+ 	/* Set arch and os from specified build target */
+ 	ca = xstrdup(*target);
+-	if ((c = strchr(ca, '-')) != NULL) {
++	if ((c = strchr(ca, '-')) == NULL) {
++	    /* Format is <arch> */
++	    ;
++	} else {
+ 	    *c++ = '\0';
+-	    
+-	    if ((co = strrchr(c, '-')) == NULL) {
+-		co = c;
++	    cv = c;
++
++	    if ((c = strchr(c, '-')) == NULL) {
++		/* Format is <arch>-<os> */
++		co = cv;
++		cv = NULL;
+ 	    } else {
+-		if (!xstrcasecmp(co, "-gnu"))
+-		    *co = '\0';
+-		if ((co = strrchr(c, '-')) == NULL)
+-		    co = c;
+-		else
+-		    co++;
++		*c++ = '\0';
++		co = c;
++
++		if ((c = strchr(c, '-')) == NULL) {
++		    /* Might be:
++		     *  <arch>-<vendor>-<os>
++		     *  <arch>-<os>-gnu
++		     */
++		    if (!xstrcasecmp(co, "gnu")) {
++			/* Format was <arch>-<os>-gnu */
++			ce = co;
++			co = cv;
++			cv = NULL;
++		    }
++		} else {
++		    /* Format was <arch>-<vendor>-<os>-<extension> */
++		    *c++ = '\0';
++		    ce = c;
++		}
+ 	    }
++	    if (cv != NULL) cv = xstrdup(cv);
+ 	    if (co != NULL) co = xstrdup(co);
++	    if (ce != NULL) {
++		/* We need to prefix it with a "-" */
++		char * lce = NULL;
++
++		lce = xmalloc(strlen(ce) + sizeof("-"));
++		sprintf(lce, "-%s", ce);
++
++		ce = lce;
++	    }
+ 	}
+     } else {
+ 	const char *a = NULL;
+@@ -995,8 +1032,16 @@ static void rpmRebuildTargetVars(const c
+     addMacro(NULL, "_target", NULL, ct, RMIL_RPMRC);
+     delMacro(NULL, "_target_cpu");
+     addMacro(NULL, "_target_cpu", NULL, ca, RMIL_RPMRC);
++    if (cv) {
++	delMacro(NULL, "_target_vendor");
++	addMacro(NULL, "_target_vendor", NULL, cv, RMIL_RPMRC);
++    }
+     delMacro(NULL, "_target_os");
+     addMacro(NULL, "_target_os", NULL, co, RMIL_RPMRC);
++    if (ce) {
++	delMacro(NULL, "_gnu");
++	addMacro(NULL, "_gnu", NULL, ce, RMIL_RPMRC);
++    }
+ 
+     if (canontarget)
+ 	*canontarget = ct;
+@@ -1004,8 +1049,12 @@ static void rpmRebuildTargetVars(const c
+ 	ct = _free(ct);
+     ca = _free(ca);
+     /*@-usereleased@*/
++    cv = _free(cv);
++    /*@-usereleased@*/
+     co = _free(co);
+     /*@=usereleased@*/
++    ce = _free(ce);
++    /*@-usereleased@*/
+ }
+ 
+ void rpmFreeRpmrc(void)
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch b/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch
new file mode 100644
index 0000000..3986030
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-check-rootpath-reasonableness.patch
@@ -0,0 +1,96 @@
+rpm: check if the argument(rootpath) exists or be writable
+
+When user execute the command "rpm -qai --root=$dir",if $dir doesn't
+exist or is unwritable as result of making a typo in rootpath,then
+it will create dirent $dir and subdirectory.
+So we should add the check function to fix it before creating relational
+subdirectory,and warn the incorrect rootpath to user. It just checks the
+rootpath reasonableness when the user input the argument(--root=/-r=).
+
+Upstream-Status: Pending
+
+Signed-off-by: Zhixiong Chi <zchi@windriver.com>
+---
+ rpmqv.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 45 insertions(+)
+
+diff --git a/rpmqv.c b/rpmqv.c
+index 40c42bd..88d85ab 100644
+--- a/rpmqv.c
++++ b/rpmqv.c
+@@ -206,6 +206,8 @@ static struct poptOption optionsTable[] = {
+    POPT_TABLEEND
+ };
+ 
++static int _rpmqv_rootpath_state = 0;
++
+ #ifdef __MINT__
+ /* MiNT cannot dynamically increase the stack.  */
+ long _stksize = 64 * 1024L;
+@@ -427,6 +429,41 @@ static void integrity_check(const char *progname, enum modes progmode_num)
+ }
+ #endif
+ 
++/*check if the rootdir is writable or exists */
++int access_file(const char *rootdir)
++{
++    int ret,rootdir_len;
++
++    if(rootdir == NULL) {
++        return;
++    }
++
++    rootdir_len = strlen(rootdir);
++    /*make sure that dirent argument trailing is "/" */
++    if(!(rootdir_len && rootdir[rootdir_len - 1] == '/')){
++        char *t = (char *)malloc(rootdir_len + 2);
++        *t = '\0';
++        (void)stpcpy(stpcpy(t,rootdir),"/");
++        ret = access(t,F_OK|W_OK);
++        free(t);
++    }else{
++        ret = access(rootdir,F_OK|W_OK);
++    }
++    return ret;
++}
++
++/*check if input the argument "--root/-r"  */
++void check_argument_root(int argc,char * const argv[])
++{
++    int i;
++    for (i = 0; i < argc; i++) {
++        if(strncmp(argv[i],"--root=",7) == 0 || strncmp(argv[i],"-r=",3) == 0) {
++            _rpmqv_rootpath_state = 1;
++            break;
++        }
++    }
++}
++
+ /*@-bounds@*/ /* LCL: segfault */
+ /*@-mods@*/ /* FIX: shrug */
+ #if !defined(__GLIBC__) && !defined(__LCLINT__)
+@@ -476,6 +513,8 @@ int main(int argc, const char ** argv)
+     int xx;
+ #endif
+ 	
++    check_argument_root(argc,(char *const *)argv);
++
+ #if !defined(__GLIBC__) && !defined(__LCLINT__)
+     environ = envp;
+ #else
+@@ -715,6 +754,12 @@ int main(int argc, const char ** argv)
+ 		argerror(_("arguments to --root (-r) must begin with a /"));
+ 	    break;
+ 	}
++        if (_rpmqv_rootpath_state) {
++            if (access_file(rpmioRootDir)) {
++                fprintf(stderr, _("Invalid directory:%s, ensure it exists or be writable\n"),rpmioRootDir);
++                exit(EXIT_FAILURE);
++            }
++        }
+     }
+ 
+ #if defined(RPM_VENDOR_OPENPKG) /* integrity-checking */
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch b/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch
new file mode 100644
index 0000000..c869376
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-db-reduce.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [configuration]
+
+Change cache size to reduce the usage of disk space from 62MB to 26MB. 
+
+Signed-off-by: Mei Lei <lei.mei@intel.com>
+
+Index: rpm-5.4.14/rpmdb/DB_CONFIG.in
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in
++++ rpm-5.4.14/rpmdb/DB_CONFIG.in
+@@ -29,7 +29,7 @@ set_thread_count 64
+ 
+ # ================ Memory Pool
+ #XXX initializing dbenv with set_cachesize has unimplemented prerequsites
+-#set_cachesize 0 1048576 0 
++set_cachesize 0 1048576 0 
+ set_mp_mmapsize 268435456
+ 
+ # ================ Locking
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch b/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch
new file mode 100644
index 0000000..77020a3
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-db5-or-db6.patch
@@ -0,0 +1,162 @@
+Support both db5 and db6.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/configure.ac
+===================================================================
+--- rpm.orig/configure.ac
++++ rpm/configure.ac
+@@ -547,8 +547,6 @@ else
+     MYPATH=$PATH
+ fi
+ 
+-DBXY=db60
+-
+ AC_PATH_PROG(__BASH, bash, %{_bindir}/bash, $MYPATH)
+ AC_PATH_PROG(__BZIP2, bzip2, %{_bindir}/bzip2, $MYPATH)
+ AC_PATH_PROG(__CAT, cat, /bin/cat, $MYPATH)
+@@ -560,22 +558,6 @@ AC_PATH_PROG(__CMAKE, cmake, %{_bindir}/
+ AC_PATH_PROG(__CPIO, cpio, /bin/cpio, $MYPATH)
+ AC_PATH_PROG(__CURL, curl, %{_bindir}/curl, $MYPATH)
+ AC_PATH_PROG(__CVS, cvs, %{_bindir}/cvs, $MYPATH)
+-AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH)
+-AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH)
+-AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH)
+-AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH)
+-AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH)
+-AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH)
+-AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH)
+-AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH)
+-AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH)
+-AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH)
+-AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH)
+-AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH)
+-AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH)
+-AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH)
+-AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH)
+-AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH)
+ AC_PATH_PROG(__DIFF, diff, /bin/diff, $MYPATH)
+ AC_PATH_PROG(__DITTO, ditto, %{_bindir}/ditto, $MYPATH)
+ AC_PATH_PROG(__FILE, file, %{_bindir}/file, $MYPATH)
+@@ -1604,13 +1586,18 @@ RPM_CHECK_LIB(
+ 
+ dnl # Berkeley-DB & SQLite
+ DBLIBSRCS=""
++DBXY=db
++
+ # XXX won't handle --includedir override
+-CPPFLAGS="${CPPFLAGS} -I${prefix}/include/${DBXY}"
++CPPFLAGS_save="${CPPFLAGS}"
++CPPFLAGS="${CPPFLAGS_save} -I${prefix}/include/db-6.0"
++with_db_save="${with_db}"
+ RPM_CHECK_LIB(
+     [Berkeley-DB], [db],
+     [db-6.0], [db_create], [db.h],
+-    [yes,external], [db3],
++    [yes,external], [db6],
+     [ DBLIBSRCS="$DBLIBSRCS db3.c"
++      DBXY=db60
+       AM_CONDITIONAL(WITH_DB, [ true ])
+       AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ])
+       if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
+@@ -1619,10 +1606,32 @@ RPM_CHECK_LIB(
+           WITH_DB_SUBDIR=""
+       fi
+     ],
+-    [ AM_CONDITIONAL(WITH_DB, [ false ])
+-      AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ])
++    [ # Reset a few variables to fresh
++      with_db="${with_db_save}"
++      CPPFLAGS="${CPPFLAGS_save} -I${prefix}/include/db-5.3"
++      RPM_CHECK_LIB(
++        [Berkeley-DB], [db],
++        [db-5.3], [db_create], [db.h],
++        [yes,external], [db53],
++        [ DBLIBSRCS="$DBLIBSRCS db3.c"
++          DBXY=db53
++          AM_CONDITIONAL(WITH_DB, [ true ])
++          AM_CONDITIONAL(WITH_DB_INTERNAL, [ test ".$RPM_CHECK_LIB_LOCATION" = .internal ])
++          if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
++              AC_DEFINE(HAVE_DB_H, 1, [Have <db.h> header])
++          else
++              WITH_DB_SUBDIR=""
++          fi
++        ],
++        [ AM_CONDITIONAL(WITH_DB, [ false ])
++          AM_CONDITIONAL(WITH_DB_INTERNAL, [ false ])
++        ])
+     ])
+ 
++if test ".$ac_cv_lib_db_6_0_db_create" != .yes -a ".$ac_cv_lib_db_5_3_db_create" != .yes; then
++    CPPFLAGS="${CPPFLAGS_save}"
++fi
++
+ dnl # Sqlite external
+ RPM_CHECK_LIB(
+     [SQLite], [sqlite],
+@@ -1633,10 +1642,11 @@ RPM_CHECK_LIB(
+ 
+ dnl # Sqlite 3.7.0.1 from db-5.1.19
+ dnl XXX error: `db3' is already registered with AC_CONFIG_SUBDIRS.
++if test ".$ac_cv_lib_db_6_0_db_create" = .yes; then
+ RPM_CHECK_LIB(
+     [Berkeley-DB (+SQLite3)], [dbsql],
+     [db_sql-6.0], [sqlite3_open], [dbsql.h],
+-    [yes,external], [db3/sql],
++    [yes,external], [db6/sql],
+     [
+       AM_CONDITIONAL(WITH_DBSQL, [ true ])
+       AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library])
+@@ -1650,12 +1660,50 @@ RPM_CHECK_LIB(
+     ], [
+       AM_CONDITIONAL(WITH_DBSQL, [ false ])
+     ])
++elif test ".$ac_cv_lib_db_5_3_db_create" = .yes; then
++RPM_CHECK_LIB(
++    [Berkeley-DB (+SQLite3)], [dbsql],
++    [db_sql-5.3], [sqlite3_open], [dbsql.h],
++    [yes,external], [db53/sql],
++    [
++      AM_CONDITIONAL(WITH_DBSQL, [ true ])
++      AC_DEFINE(WITH_SQLITE, 1, [Define as 1 if building with SQLite library])
++      if test ".$RPM_CHECK_LIB_LOCATION" = .internal; then
++        WITH_DB_CPPFLAGS="${WITH_DB_CPPFLAGS} -I\$(top_srcdir)/db/sql/generated"
++        WITH_DB_LIBS="${WITH_DBSQL_LIBS}"
++        DBLIBSRCS="$DBLIBSRCS sqlite.c"
++      else
++        WITH_DBSQL_SUBDIR=""
++      fi
++    ], [
++      AM_CONDITIONAL(WITH_DBSQL, [ false ])
++    ])
++else
++AM_CONDITIONAL(WITH_DBSQL, [ false ])
++fi
+ 
+ DBLIBOBJS=`echo $DBLIBSRCS | sed -e "s/\.c/\.lo/g"`
+ 
+ AC_SUBST(DBLIBSRCS)
+ AC_SUBST(DBLIBOBJS)
+ 
++AC_PATH_PROG(__DB_ARCHIVE, ${DBXY}_archive, %{_bindir}/${DBXY}_archive, $MYPATH)
++AC_PATH_PROG(__DB_CHECKPOINT, ${DBXY}_checkpoint, %{_bindir}/${DBXY}_checkpoint, $MYPATH)
++AC_PATH_PROG(__DB_DEADLOCK, ${DBXY}_deadlock, %{_bindir}/${DBXY}_deadlock, $MYPATH)
++AC_PATH_PROG(__DB_DUMP, ${DBXY}_dump, %{_bindir}/${DBXY}_dump, $MYPATH)
++AC_PATH_PROG(__DB_HOTBACKUP, ${DBXY}_hotbackup, %{_bindir}/${DBXY}_hotbackup, $MYPATH)
++AC_PATH_PROG(__DB_LOAD, ${DBXY}_load, %{_bindir}/${DBXY}_load, $MYPATH)
++AC_PATH_PROG(__DB_LOG_VERIFY, ${DBXY}_log_verify, %{_bindir}/${DBXY}_log_verify, $MYPATH)
++AC_PATH_PROG(__DB_PRINTLOG, ${DBXY}_printlog, %{_bindir}/${DBXY}_printlog, $MYPATH)
++AC_PATH_PROG(__DB_RECOVER, ${DBXY}_recover, %{_bindir}/${DBXY}_recover, $MYPATH)
++AC_PATH_PROG(__DB_REPLICATE, ${DBXY}_replicate, %{_bindir}/${DBXY}_replicate, $MYPATH)
++AC_PATH_PROG(__DBSQL, ${DBXY}sql, %{_bindir}/${DBXY}sql, $MYPATH)
++AC_PATH_PROG(__DB_SQL_CODEGEN, ${DBXY}_sql_codegen, %{_bindir}/${DBXY}_sql_codegen, $MYPATH)
++AC_PATH_PROG(__DB_STAT, ${DBXY}_stat, %{_bindir}/${DBXY}_stat, $MYPATH)
++AC_PATH_PROG(__DB_TUNER, ${DBXY}_tuner, %{_bindir}/${DBXY}_tuner, $MYPATH)
++AC_PATH_PROG(__DB_UPGRADE, ${DBXY}_upgrade, %{_bindir}/${DBXY}_upgrade, $MYPATH)
++AC_PATH_PROG(__DB_VERIFY, ${DBXY}_verify, %{_bindir}/${DBXY}_verify, $MYPATH)
++
+ AC_ARG_WITH(db-largefile, AS_HELP_STRING([--with-db-largefile], [build Berkeley-DB with LARGEFILE support]))
+ AC_ARG_WITH(db-mutex,     AS_HELP_STRING([--with-db-mutex=ARG], [build Berkeley-DB with MUTEX type ARG]))
+ 
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch b/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch
new file mode 100644
index 0000000..16b8e30
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-db_buffer_small.patch
@@ -0,0 +1,77 @@
+In certain cases with BerkleyDB 5.3.x we are getting the error:
+
+db3.c:1443: dbcursor->pget(-30999): BDB0063 DB_BUFFER_SMALL: User memory too small for return value
+
+See https://bugs.launchpad.net/rpm/+bug/934420 for more information.
+
+It appears to be some type of a bug in the BerkleyDB 5.3.x.  In an attempt
+to workaround the problem, when we encounter this situation we attempt
+to adjust the size of the mmap buffer until the call works, or we
+end up trying 10 times.  The new size is either the updated vp->size
+from the failed pget call, or the previous size + 1024.
+
+If DBI debugging is enabled, additional diagnostics are printed, otherwise
+a basic retry and success message is added to show that the failure was
+resolved.
+
+Upstream-Status: Inappropriate (workaround)
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/rpmdb/rpmdb.c
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/rpmdb.c
++++ rpm-5.4.14/rpmdb/rpmdb.c
+@@ -2212,8 +2212,12 @@ static int rpmmiGet(dbiIndex dbi, DBC *
+ 	vp->flags |= DB_DBT_USERMEM;
+ 	rc = dbiGet(dbi, dbcursor, kp, vp, flags);
+ 	if (rc == DB_BUFFER_SMALL) {
++	    int retry = 0;
++	    size_t origlen = vp->size;
+ 	    size_t uhlen = vp->size;
+-	    void * uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off);
++	    void * uh;
++retry_get:
++	    uh = mmap(NULL, uhlen, _prot, _flags, _fdno, _off);
+ 	    if (uh == NULL || uh == (void *)-1)
+ 		fprintf(stderr,
+ 		    "==> mmap(%p[%u], 0x%x, 0x%x, %d, 0x%x) error(%d): %s\n",
+@@ -2235,6 +2239,25 @@ static int rpmmiGet(dbiIndex dbi, DBC *
+ 		if (munmap(uh, uhlen) != 0)
+ 		    fprintf(stderr, "==> munmap(%p[%u]) error(%d): %s\n",
+                 	uh, (unsigned)uhlen, errno, strerror(errno));
++	        /* We want to be sure to limit the number of retry attempts to avoid a loop! */
++	        if (rc == DB_BUFFER_SMALL && retry < 10) {
++		   /* If we got a largr vp-size back, use that, otherwise increment the size by 1k */
++	           uhlen = vp->size > uhlen ? vp->size : uhlen + 1024;
++		   retry++;
++	           if ((dbi)->dbi_debug)
++	               fprintf(stderr, "==> DB_BUFFER_SMALL orig requested (%d), configured (%d), forcing larger buffer (%d), new size (%d)\n",
++	                    origlen, vp->ulen, uhlen, vp->size);
++	           else
++	               fprintf(stderr, "==> retry (%d) db3cpget (%d)\n", retry, uhlen);
++	           goto retry_get;
++	        }
++	    }
++	    if (retry) {
++	        if ((dbi)->dbi_debug)
++	           fprintf(stderr, "==> success orig requested (%d), configured buffer (%d), buffer (%d), size after dbiGet (%d)\n",
++			origlen, vp->ulen, uhlen, vp->size);
++	        else
++	           fprintf(stderr, "==> success\n");
+ 	    }
+ 	}
+     } else
+Index: rpm-5.4.14/rpmdb/db3.c
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/db3.c
++++ rpm-5.4.14/rpmdb/db3.c
+@@ -1509,7 +1509,7 @@ assert(db != NULL);
+ #endif
+     }
+ 
+-DBIDEBUG(dbi, (stderr, "<-- %s(%p,%p,%p,%p,%p,0x%x) rc %d %s%s\n", __FUNCTION__, dbi, dbcursor, key, pkey, data, flags, rc, _DBCFLAGS(flags), _KEYDATA(key, pkey, data, NULL)));
++DBIDEBUG(dbi, (stderr, "<-- %s(%p,%p,%p,%p,%p,0x%x) rc %d %s%s\n", __FUNCTION__, dbi, dbcursor, key, pkey, data, flags, rc, _DBCFLAGS(flags), _KEYDATA(key, pkey, rc == DB_BUFFER_SMALL ? NULL : data, NULL)));
+     return rc;
+ }
+ /*@=mustmod@*/
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
new file mode 100644
index 0000000..2eb6e0f
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-debug-platform.patch
@@ -0,0 +1,65 @@
+Debug the platform score generation...
+
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -465,6 +465,8 @@ static rpmRC rpmPlatform(const char * pl
+ 
+     rc = (rpmRC) rpmiobSlurp(platform, &iob);
+ 
++    fprintf(stderr, "D: rpmPlatform file %s\n", platform);
++
+     if (rc || iob == NULL) {
+ 	rc = RPMRC_FAIL;
+ 	goto exit;
+@@ -486,6 +488,7 @@ static rpmRC rpmPlatform(const char * pl
+ 	    while (--t > p && xisspace(*t))
+ 		*t = '\0';
+ 	    if (t > p) {
++		fprintf(stderr, "D: rpmPlatform mireAppend REGEX %s\n", p);
+ 		xx = mireAppend(RPMMIRE_REGEX, 0, p, NULL, &mi_re, &mi_nre);
+ 	    }
+ 	    continue;
+@@ -503,6 +506,11 @@ static rpmRC rpmPlatform(const char * pl
+ 		_gnu = rpmExpand("-", cvog->gnu, NULL);
+ 
+ 	    addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
++	    fprintf(stderr, "D: rpmPlatform addMacro %s-%s-%s(%s)\n",
++	    	rpmExpand("%{_platform_cpu}", NULL),
++		rpmExpand("%{_platform_vendor}", NULL),
++		rpmExpand("%{_platform_os}", NULL),
++		rpmExpand("%{_platform_gnu}", NULL));
+ #else
+ 	    addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
+ 	    addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
+@@ -510,6 +518,7 @@ static rpmRC rpmPlatform(const char * pl
+ #endif
+ 	}
+ 
++	fprintf(stderr, "D: rpmPlatform mireAppend STRCMP %s -- ", p);
+ #if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */
+ #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
+ 	/* do not use vendor and GNU attribution */
+@@ -519,6 +528,7 @@ static rpmRC rpmPlatform(const char * pl
+ 		(cvog && *cvog->gnu ? "-" : NULL),
+ 		(cvog ? cvog->gnu : NULL), NULL);
+ #endif
++	fprintf(stderr, "%s\n", p);
+ 	xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
+ 	p = _free(p);
+ #endif
+@@ -688,9 +698,12 @@ int rpmPlatformScore(const char * platfo
+ 
+     if ((mire = (miRE) mi_re) != NULL)
+     for (i = 0; i < mi_nre; i++) {
+-	if (mireRegexec(mire + i, platform, 0) >= 0)
++	if (mireRegexec(mire + i, platform, 0) >= 0) {
++	    fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, i + 1);
+ 	    return (i + 1);
++	}
+     }
++    fprintf(stderr, "D: rpmPlatformScore %s (%d)\n", platform, 0);
+     return 0;
+ }
+ /*@=onlytrans@*/
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-disable-Wno-override-init.patch b/meta/recipes-devtools/rpm/rpm/rpm-disable-Wno-override-init.patch
new file mode 100644
index 0000000..8b5f8d6
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-disable-Wno-override-init.patch
@@ -0,0 +1,32 @@
+From 70d881873b443c9bad502db9665595455d4f0ac9 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 8 Jul 2014 07:41:10 +0800
+Subject: [PATCH] configure.ac: disable -Wno-override-init
+
+Fixed rpm-native.do_configure error on CentOS 5.x:
+
+cc1: error: unrecognized command line option "-Wno-override-init"
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index adeffe0..6746b4c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -163,7 +163,7 @@ AC_ARG_ENABLE(build-warnings,
+ # XXX gcc-4.2 on Mac OS X hasn't
+ #            CFLAGS="$CFLAGS -Wno-unused-but-set-variable"
+ # XXX rpmio/set.c needs this
+-            CFLAGS="$CFLAGS -Wno-override-init"
++#            CFLAGS="$CFLAGS -Wno-override-init"
+         elif test ".`$CC -V 2>&1 | grep 'Sun C'`" != .; then
+             dnl # Sun Studio (usually "cc")
+             CFLAGS="$CFLAGS -v"
+--
+1.8.2.1
+
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch b/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch
new file mode 100644
index 0000000..b1db6ff
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-fileclass.patch
@@ -0,0 +1,36 @@
+rpmfc.c:  Always generate per-file information
+
+Even when the per-file dependency generate is disabled, we want to generate
+per file classification and other associated data.
+
+Note: this is a temporary workaround.  Eventually we will want to have a way
+to seed per-file dependency and other information in order to generate a
+package from previously determined information.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/rpmfc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmfc.c
++++ rpm-5.4.14/lib/rpmfc.c
+@@ -1734,7 +1734,6 @@ rpmRC rpmfcGenerateDepends(void * _spec,
+ 	/* ... then generate dependencies using %{__find_requires} et al. */
+ 	rc = rpmfcGenerateDependsHelper(spec, pkg, fi);
+ 	printDeps(pkg->header);
+-	return rc;
+     }
+ 
+     /* Generate scriptlet Dependencies. */
+@@ -1762,8 +1761,8 @@ rpmRC rpmfcGenerateDepends(void * _spec,
+     av[ac] = NULL;
+ 
+     fc = rpmfcNew();
+-    fc->skipProv = !pkg->autoProv;
+-    fc->skipReq = !pkg->autoReq;
++    fc->skipProv = !pkg->autoProv || !internaldeps;
++    fc->skipReq = !pkg->autoReq || !internaldeps;
+     fc->tracked = 0;
+ 
+     {	const char * buildRootURL;
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch b/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch
new file mode 100644
index 0000000..27a0a8d
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-fix-logio-cp.patch
@@ -0,0 +1,30 @@
+Occasionally the cp -p fails with a non-zero return code.  This will cause
+the system abort the build.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/rpmdb/Makefile.am
+===================================================================
+--- rpm.orig/rpmdb/Makefile.am
++++ rpm/rpmdb/Makefile.am
+@@ -234,11 +234,14 @@ lcov-report:
+ #lcov-upload: lcov
+ #	rsync -rvz -e ssh --delete lcov/* ???
+ 
++$(builddir)/logio_recover_template: $(srcdir)/logio_recover_template
++	@if test ".$(builddir)" != ".$(srcdir)"; then \
++		cp -fp $(srcdir)/logio_recover_template \
++		      $(builddir)/logio_recover_template ; \
++	 fi
++
+ logio_BUILT = logio_auto.c logio_autop.c logio_auto.h logio_template
+-$(logio_BUILT):	logio.awk logio.src logio_recover_template
+-	@test -e $(builddir)/logio_recover_template || \
+-		cp -p $(srcdir)/logio_recover_template \
+-		      $(builddir)/logio_recover_template
++$(logio_BUILT):	logio.awk logio.src $(builddir)/logio_recover_template
+ 	@rm -f $(logio_BUILT)
+ 	@$(AWK) -f $(srcdir)/logio.awk \
+ 		-v header_file=logio_auto.h \
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch
new file mode 100644
index 0000000..5deb232
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-hardlink-segfault-fix.patch
@@ -0,0 +1,43 @@
+We need to sanity check that the nlink size and our linksLeft counter
+do match. If an rpm is badly constructed with identical inode values
+for multiple hardlinked files, such an rpm will otherwise access memory
+out of array bounds and cause memory corruption and crashes.
+
+The fix is to add in the sanity check and exit if bad circumstances
+are found. We need to fix the caller to check the return code too.
+
+RP 2014/6/10
+
+Upstream-Status: Pending
+
+Index: rpm-5.4.14/lib/fsm.c
+===================================================================
+--- rpm-5.4.14.orig/lib/fsm.c
++++ rpm-5.4.14/lib/fsm.c
+@@ -495,6 +495,11 @@ static int saveHardLink(/*@special@*/ /*
+     }
+ 
+     if (fsm->goal == IOSM_PKGBUILD) --fsm->li->linksLeft;
++    if (fsm->li->linksLeft > st->st_nlink) {
++	rpmlog(RPMLOG_ERR, _("Corrupted hardlinks found (count %d does not match %d), exiting.\n"), fsm->li->linksLeft, st->st_nlink);
++	return -1;
++    }
++
+     fsm->li->filex[fsm->li->linksLeft] = fsm->ix;
+     /*@-observertrans -dependenttrans@*/
+     fsm->li->nsuffix[fsm->li->linksLeft] = fsm->nsuffix;
+@@ -1878,8 +1883,13 @@ if (!(fsmGetFi(fsm)->mapflags & IOSM_PAY
+ 	fsm->postpone = iosmFileActionSkipped(fsm->action);
+ 	if (fsm->goal == IOSM_PKGINSTALL || fsm->goal == IOSM_PKGBUILD) {
+ 	    /*@-evalorder@*/ /* FIX: saveHardLink can modify fsm */
+-	    if (S_ISREG(st->st_mode) && st->st_nlink > 1)
++	    if (S_ISREG(st->st_mode) && st->st_nlink > 1) {
+ 		fsm->postpone = saveHardLink(fsm);
++		if (fsm->postpone < 0) {
++		    rc = RPMRC_FAIL;
++		    break;
++		}
++	    }
+ 	    /*@=evalorder@*/
+ 	}
+ if (fsmGetFi(fsm)->mapflags & IOSM_PAYLOAD_LIST) fsm->postpone = 1;
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
new file mode 100644
index 0000000..042e412
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-libsql-fix.patch
@@ -0,0 +1,22 @@
+During installation, the libtool relink attempts to link to -lrpm...
+The problem is that it hasn't been installed yet!  So small change causes
+the libtool to instead use the build version.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/lib/Makefile.am
++++ rpm-5.4.14/lib/Makefile.am
+@@ -120,6 +120,9 @@ librpm.la: $(librpm_la_OBJECTS) $(librpm
+ #libsql_la_SOURCES	= libsql.c
+ #libsql_la_LIBADD	= librpm.la $(RPMDB_LDADD_COMMON)
+ 
++# pkglib libraries needs to have usrlib libraries already installed!
++install-pkglibLTLIBRARIES: install-usrlibLTLIBRARIES
++
+ install-data-hook:
+ if !ENABLE_BUILD_LAFILES
+ 	-for l in $(usrlib_LTLIBRARIES); do \
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch b/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch
new file mode 100644
index 0000000..3153f7a
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-log-auto-rm.patch
@@ -0,0 +1,15 @@
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: rpm-5.4.14/rpmdb/DB_CONFIG.in
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/DB_CONFIG.in
++++ rpm-5.4.14/rpmdb/DB_CONFIG.in
+@@ -4,6 +4,7 @@ set_data_dir .
+ set_create_dir .
+ set_lg_dir ./log
+ set_tmp_dir ./tmp
++set_flags db_log_autoremove on
+ 
+ # -- thread_count must be >= 8
+ set_thread_count 64
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch b/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch
new file mode 100644
index 0000000..790a662
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-lsb-compatibility.patch
@@ -0,0 +1,24 @@
+Enable platform tag matching workaround in OE.
+
+When installing some LSB packages the 'platform' field in the package
+appears to be invalid.  Instead of relying solely on the platform comparison
+we also want to generate a perceived platform based on the valid rpm contents
+of arch and os.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/depends.c
+===================================================================
+--- rpm-5.4.14.orig/lib/depends.c
++++ rpm-5.4.14/lib/depends.c
+@@ -595,7 +595,7 @@ int rpmtsAddInstallElement(rpmts ts, Hea
+ 	    platform = rpmExpand(arch, "-unknown-", os, NULL);
+ 
+ 	rc = rpmPlatformScore(platform, platpat, nplatpat);
+-#if defined(RPM_VENDOR_MANDRIVA)
++#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE)
+ 	/*
+ 	 * If no match on platform tag, we'll try again with arch tag
+ 	 * in case platform tag is inconsistent with it, which is the case
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-lua-fix-print.patch b/meta/recipes-devtools/rpm/rpm/rpm-lua-fix-print.patch
new file mode 100644
index 0000000..7ab49e9
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-lua-fix-print.patch
@@ -0,0 +1,104 @@
+Lua 'print' statement is not working properly inside of RPM 5
+
+The print statement should capture the output and send it to the script
+processing engine, and not display it directly to the screen.
+
+This patch is from: http://rpm5.org/cvs/patchset?cn=17671
+
+Upstream-Status: backport (patchset 17671 from rpm5.org)
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/CHANGES
+===================================================================
+--- rpm-5.4.14.orig/CHANGES
++++ rpm-5.4.14/CHANGES
+@@ -1,3 +1,4 @@
++    - jbj: lua: fix: resurrect output capture with lua-5.2.
+     - jbj: verify: fix: broken logic for %ghost avoidance (Mark Hatle).
+ 
+ 5.4.13 -> 5.4.14:
+Index: rpm-5.4.14/rpmio/rpmlua.c
+===================================================================
+--- rpm-5.4.14.orig/rpmio/rpmlua.c
++++ rpm-5.4.14/rpmio/rpmlua.c
+@@ -175,7 +175,7 @@ rpmlua rpmluaNew(void)
+     };
+     /*@=readonlytrans =nullassign @*/
+     /*@observer@*/ /*@unchecked@*/
+-    const luaL_Reg *lib = lualibs;
++    const luaL_Reg *lib;
+     char *path_buf;
+     char *path_next;
+     char *path;
+@@ -190,31 +190,34 @@ rpmlua rpmluaNew(void)
+ 
+     luaL_openlibs(L);
+ 
+-    for (; lib->name; lib++) {
++    for (lib = lualibs; lib->name; lib++) {
+ 	luaL_requiref(L, lib->name, lib->func, 1);
++	lua_pop(L, 1);
+     }
+ 
+     {	const char * _lua_path = rpmGetPath(rpmluaPath, NULL);
+  	if (_lua_path != NULL) {
++#if defined(LUA_GLOBALSINDEX)
+ 	    lua_pushliteral(L, "LUA_PATH");
+ 	    lua_pushstring(L, _lua_path);
++	    lua_rawset(L, LUA_GLOBALSINDEX);
++#else
++	    lua_pushstring(L, _lua_path);
++	    lua_setglobal(L, "LUA_PATH");
++#endif
+ 	    _lua_path = _free(_lua_path);
+ 	}
+     }
+ 
+ #if defined(LUA_GLOBALSINDEX)
+-    lua_rawset(L, LUA_GLOBALSINDEX);
+-#else
+-    lua_pushglobaltable(L);
+-#endif
+     lua_pushliteral(L, "print");
+     lua_pushcfunction(L, rpm_print);
+-
+-#if defined(LUA_GLOBALSINDEX)
+     lua_rawset(L, LUA_GLOBALSINDEX);
+ #else
+-    lua_pushglobaltable(L);
++    lua_pushcfunction(L, rpm_print);
++    lua_setglobal(L, "print");
+ #endif
++
+     rpmluaSetData(lua, "lua", lua);
+ 
+     /* load all standard RPM Lua script files */
+@@ -351,6 +354,9 @@ void rpmluaSetVar(rpmlua _lua, rpmluav v
+ #if defined(LUA_GLOBALSINDEX)
+ 	if (lua->pushsize == 0)
+ 	    lua_pushvalue(L, LUA_GLOBALSINDEX);
++#else
++	if (lua->pushsize == 0)
++	    lua_pushglobaltable(L);
+ #endif
+ 	if (pushvar(L, var->keyType, &var->key) != -1) {
+ 	    if (pushvar(L, var->valueType, &var->value) != -1)
+@@ -1039,14 +1045,15 @@ static int rpm_print (lua_State *L)
+     lua_getglobal(L, "tostring");
+     for (i = 1; i <= n; i++) {
+ 	const char *s;
++	size_t l;
+ 	lua_pushvalue(L, -1);  /* function to be called */
+ 	lua_pushvalue(L, i);   /* value to print */
+ 	lua_call(L, 1, 1);
+-	s = lua_tostring(L, -1);  /* get result */
++	s = lua_tolstring(L, -1, &l);  /* get result */
+ 	if (s == NULL)
+ 	    return luaL_error(L, "`tostring' must return a string to `print'");
+ 	if (lua->storeprint) {
+-	    size_t sl = lua_rawlen(L, -1);
++	    size_t sl = l;
+ 	    if ((size_t)(lua->printbufused+sl+1) > lua->printbufsize) {
+ 		lua->printbufsize += sl+512;
+ 		lua->printbuf = (char *) xrealloc(lua->printbuf, lua->printbufsize);
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-lua.patch b/meta/recipes-devtools/rpm/rpm/rpm-lua.patch
new file mode 100644
index 0000000..a9930d6
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-lua.patch
@@ -0,0 +1,33 @@
+Add support for cross compiling lua
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/configure.ac
+===================================================================
+--- rpm-5.4.14.orig/configure.ac
++++ rpm-5.4.14/configure.ac
+@@ -121,6 +121,9 @@ AC_PROG_YACC
+ 
+ AC_PATH_PROG(AS, as, as)
+ 
++CC_FOR_BUILD=${CC_FOR_BUILD-\$(CC)}
++AC_SUBST(CC_FOR_BUILD)
++
+ dnl # GCC specifics
+ AC_PROG_GCC_TRADITIONAL
+ AC_ARG_ENABLE(build-pic,
+Index: rpm-5.4.14/lua/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/lua/Makefile.am
++++ rpm-5.4.14/lua/Makefile.am
+@@ -41,7 +41,7 @@ rpmluac_LDADD = liblua.la
+ 
+ # --- bin2c doesn't need anything but a compiler
+ bin2c$(EXEEXT):  bin2c.c
+-	$(CC) -o $@ $<
++	$(CC_FOR_BUILD) -o $@ $<
+ 
+ liblua_la_SOURCES =
+ liblua_la_CFLAGS = @WITH_LUA_SUBDIR_DEF@
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch b/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch
new file mode 100644
index 0000000..07a0cfa
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-macros.in-disable-external-key-server.patch
@@ -0,0 +1,27 @@
+disable external key server
+
+Upstream-Status: Pending
+
+When RPM experiences a signed package, with a signature that it does NOT know.
+By default it will send the -fingerprint- (and only the 16 digit fingerprint) to
+an external HKP server, trying to get the key down.
+
+This is probably not a reasonable default behavior for the system to do, instead
+it should simply fail the key lookup.  If someone wants to enable the HKP server
+it's easy enough to do by enabling the necessary macros.
+
+Signed-off-by: yzhu1 <yanjun.zhu@windriver.com>
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+--- a/macros/macros.in
++++ b/macros/macros.in
+@@ -546,8 +546,8 @@ $_arbitrary_tags_tests	Foo:Bar
+ # Horowitz Key Protocol server configuration
+ #
+ #%_hkp_keyserver         hkp://keys.n3npq.net
+-%_hkp_keyserver         hkp://pool.sks-keyservers.net
+-%_hkp_keyserver_query   %{_hkp_keyserver}/pks/lookup?op=get&search=
++#%_hkp_keyserver         hkp://pool.sks-keyservers.net
++#%_hkp_keyserver_query   %{_hkp_keyserver}/pks/lookup?op=get&search=
+ 
+ 
+ %_nssdb_path	/etc/pki/nssdb
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-macros.patch b/meta/recipes-devtools/rpm/rpm/rpm-macros.patch
new file mode 100644
index 0000000..c7ab2d2
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-macros.patch
@@ -0,0 +1,64 @@
+macros/macros.in: Revert settings to the same as RPM 5.4.0
+
+Enable a reasonable set of rpmdeps dependency helper macros.  These sets
+were used by RPM 5.4.0.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/macros/macros.in
+===================================================================
+--- rpm-5.4.14.orig/macros/macros.in
++++ rpm-5.4.14/macros/macros.in
+@@ -1022,7 +1022,7 @@ $_arbitrary_tags_tests	Foo:Bar
+ 
+ #==============================================================================
+ # ---- rpmbuild macros.
+-#%%{load:%{_usrlibrpm}/macros.rpmbuild}
++%{load:%{_usrlibrpm}/macros.rpmbuild}
+ 
+ #------------------------------------------------------------------------
+ # cmake(...) configuration
+@@ -1038,15 +1038,15 @@ $_arbitrary_tags_tests	Foo:Bar
+ 
+ #------------------------------------------------------------------------
+ # perl(...) configuration
+-#%%{load:%{_usrlibrpm}/macros.d/perl}
++%{load:%{_usrlibrpm}/macros.d/perl}
+ 
+ #------------------------------------------------------------------------
+ # python(...) configuration.
+-#%%{load:%{_usrlibrpm}/macros.d/python}
++%{load:%{_usrlibrpm}/macros.d/python}
+ 
+ #------------------------------------------------------------------------
+ # php(...) configuration.
+-#%%{load:%{_usrlibrpm}/macros.d/php}
++%{load:%{_usrlibrpm}/macros.d/php}
+ 
+ #------------------------------------------------------------------------
+ # java(...) configuration.
+@@ -1054,11 +1054,11 @@ $_arbitrary_tags_tests	Foo:Bar
+ 
+ #------------------------------------------------------------------------
+ # libtool(...) configuration.
+-#%%{load:%{_usrlibrpm}/macros.d/libtool}
++%{load:%{_usrlibrpm}/macros.d/libtool}
+ 
+ #------------------------------------------------------------------------
+ # pkgconfig(...) configuration.
+-#%%{load:%{_usrlibrpm}/macros.d/pkgconfig}
++%{load:%{_usrlibrpm}/macros.d/pkgconfig}
+ 
+ #------------------------------------------------------------------------
+ # mono(...) configuration.
+@@ -1070,7 +1070,7 @@ $_arbitrary_tags_tests	Foo:Bar
+ 
+ #------------------------------------------------------------------------
+ # tcl(...) configuration.
+-#%%{load:%{_usrlibrpm}/macros.d/tcl}
++%{load:%{_usrlibrpm}/macros.d/tcl}
+ 
+ #------------------------------------------------------------------------
+ # typelib(...) configuration.
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch b/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch
new file mode 100644
index 0000000..ab6ed2c
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-no-loopmsg.patch
@@ -0,0 +1,19 @@
+lib/order.c: Make the dependency loop messages into debug msgs
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/order.c
+===================================================================
+--- rpm-5.4.14.orig/lib/order.c
++++ rpm-5.4.14/lib/order.c
+@@ -2175,7 +2175,7 @@ rescan:
+ 		const char * dp;
+ 		rpmlogLvl msglvl = (anaconda || (rpmtsDFlags(ts) & RPMDEPS_FLAG_DEPLOOPS))
+ 			? RPMLOG_WARNING : RPMLOG_ERR;
+-#if defined(RPM_VENDOR_MANDRIVA) /* loop-detection-optional-loglevel */
++#if defined(RPM_VENDOR_MANDRIVA) || defined(RPM_VENDOR_OE) /* loop-detection-optional-loglevel */
+ 		// Report loops as debug-level message by default (7 = RPMLOG_DEBUG), overridable
+ 		msglvl = rpmExpandNumeric("%{?_loop_detection_loglevel}%{?!_loop_detection_loglevel:7}");
+ #endif
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch b/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch
new file mode 100644
index 0000000..5818229
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-no-perl-urpm.patch
@@ -0,0 +1,47 @@
+Disable perl-URPM support
+
+This causes a configure failure when perl-URPM is not used.
+
+| configure.ac:1159: required file `perl-URPM/Makefile.PL.in' not found
+| configure.ac:1159: required file `perl-URPM/Makefile.in' not found
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/configure.ac
+===================================================================
+--- rpm-5.4.14.orig/configure.ac
++++ rpm-5.4.14/configure.ac
+@@ -1186,30 +1186,10 @@ AC_SUBST(WITH_PERL_SUBDIR)
+ AC_SUBST(WITH_PERL_SUBPACKAGE)
+ AC_SUBST(WITH_PERL_LIBS)
+ 
+-dnl # optional Perl-URPM language bindings
++dnl # disable Perl-URPM language bindings
+ WITH_PERL_URPM_SUBDIR=""
+ WITH_PERL_URPM_SUBPACKAGE=0
+ WITH_PERL_URPM_LIBS=""
+-if test ".$WITH_PTHREADS" = .yes; then
+-    WITH_PERL_URPM_LIBS="$LIBS"
+-fi
+-AC_ARG_WITH(perl-urpm, AS_HELP_STRING([--with-perl-urpm], [build with Perl URPM language bindings]), [
+-    if test ".$withval" != .no; then
+-	PERL_URPM_INSTALLDIRS=""
+-	   if test "$withval" == "vendor"; then
+-		    PERL_URPM_INSTALLDIRS="'INSTALLDIRS'	=> 'vendor',"
+-	    fi
+-	    if test "$withval" == "site"; then
+-		    PERL_URPM_INSTALLDIRS="'INSTALLDIRS'     => 'site',"
+-	    fi
+-	    AC_DEFINE_UNQUOTED([PERL_URPM_INSTALLDIRS], [$PERL_URPM_INSTALLDIRS], [Perl install directory (vendor/site)])
+-	    AC_SUBST(PERL_URPM_INSTALLDIRS)
+-        WITH_PERL_URPM_SUBDIR=perl-URPM
+-        WITH_PERL_URPM_SUBPACKAGE=1
+-        AC_CONFIG_FILES([perl-URPM/Makefile.PL])
+-        AC_CONFIG_FILES([perl-URPM/Makefile])
+-    fi
+-])
+ AC_SUBST(WITH_PERL_URPM_SUBDIR)
+ AC_SUBST(WITH_PERL_URPM_SUBPACKAGE)
+ AC_SUBST(WITH_PERL_URPM_LIBS)
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch b/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch
new file mode 100644
index 0000000..07d586a
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-opendb-before-verifyscript-to-avoid-null-point.patch
@@ -0,0 +1,24 @@
+rpm: opendb before rpmverifyscript to avoid null point input
+
+If the command is "rpm -V" and the return value of (headerIsEntry(h, RPMTAG_VERIFYSCRIPT) 
+|| headerIsEntry(h, RPMTAG_SANITYCHECK)) located in /lib/verify.c is true, it will call
+rpmpsmStage function(rpmVerifyScript->rpmpsmScriptStage->rpmpsmStage) and occur segment
+fault because of null point(rpmtsGetRdb(ts) == NULL and rpmtsGetRdb(ts)->db_txn).
+So we open rpmdb to avoid bad input when find headerIsEntry true.
+
+Upstream-Status: Pending
+
+Signed-off-by: Zhixiong Chi <zhixiong.chi@windriver.com>
+Index: rpm-5.4.14/lib/verify.c
+===================================================================
+--- rpm-5.4.14.orig/lib/verify.c	2015-07-22 22:09:59.992895355 +0800
++++ rpm-5.4.14/lib/verify.c	2015-08-13 10:20:33.752177906 +0800
+@@ -613,6 +613,8 @@
+ 	{
+ 	    FD_t fdo = fdDup(STDOUT_FILENO);
+ 
++	    rpmtsOpenDB(ts, O_RDONLY);            /*Open the DB to avoid null point input in function rpmpsmStage()*/
++
+ 	    rc = rpmfiSetHeader(fi, h);
+ 	    if ((rc = rpmVerifyScript(qva, ts, fi, fdo)) != 0)
+ 		ec += rc;
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch b/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch
new file mode 100644
index 0000000..691aba9
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-ossp-uuid.patch
@@ -0,0 +1,23 @@
+Fix integration of ossp-uuid
+
+We need to avoid including the util-linux uuid library, instead
+we need ossp-uuid.  There is a related hack in do_configure to
+make sure that we use the right .pc file as well.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/configure.ac
+===================================================================
+--- rpm-5.4.14.orig/configure.ac
++++ rpm-5.4.14/configure.ac
+@@ -1951,7 +1951,7 @@ grep -v 'define HAVE_UNISTD_H' confdefs.
+ esac
+ RPM_CHECK_LIB(
+     [OSSP uuid], [uuid],
+-    [ossp-uuid uuid], [uuid_import], [uuid.h],
++    [ossp-uuid], [uuid_import], [uuid.h],
+     [no,external:none], [],
+     [ dnl # enable OSSP uuid native API support for embedded Lua
+       if test ".$WITH_LUA" = .yes; then
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch b/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
new file mode 100644
index 0000000..c15e124
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-packageorigin.patch
@@ -0,0 +1,25 @@
+Add the ability to query the packageorigin
+
+Written by jbj at rpm5.org
+
+Upstream-Status: Inappropriate [not author]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/rpmdb/hdrfmt.c
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/hdrfmt.c
++++ rpm-5.4.14/rpmdb/hdrfmt.c
+@@ -2409,8 +2409,10 @@ static int pkgoriginTag(Header h, HE_t h
+     int rc = 1;
+ 
+     he->tag = RPMTAG_PACKAGEORIGIN;
+-    if (!headerGet(h, he, HEADERGET_NOEXTENSION)
+-     && (origin = headerGetOrigin(h)) != NULL)
++    /* XXX two sources for tag data: what search precedence? */
++    if (headerGet(h, he, HEADERGET_NOEXTENSION))
++	rc = 0;
++    else if ((origin = headerGetOrigin(h)) != NULL)
+     {
+ 	he->t = RPM_STRING_TYPE;
+ 	he->p.str = xstrdup(origin);
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch b/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch
new file mode 100644
index 0000000..9cd02a0
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-payload-use-hashed-inode.patch
@@ -0,0 +1,146 @@
+If we run builds on a filesystem with 64 bit inodes like XFS, we need to
+map the inode numbers to something 32 bit since the cpio header only allows
+for 32 bit inode values. If we don't do this:
+
+#define SET_NUM_FIELD(phys, val, space) \
+        sprintf(space, "%8.8lx", (unsigned long) (val)); \
+        memcpy(phys, space, 8)
+
+from cpio.c will print larger that 8 character values and then truncate the 
+LSBs. This generates cpio files where hardlinked files may have the same
+inode number. The resulting rpms are then corrupted.
+
+There is a separate patch for the crash the identical inode numbers causes
+when extracting the rpm.
+
+Patch taken from http://git.pld-linux.org/?p=packages/rpm.git;a=commitdiff;h=10526c23aac60b7b636e4c93862887dbef8e8f15
+
+RP 2014/6/10
+
+Upstream-Status: Pending
+
+Index: rpm-5.4.14/build/files.c
+===================================================================
+--- rpm-5.4.14.orig/build/files.c
++++ rpm-5.4.14/build/files.c
+@@ -1328,6 +1328,26 @@ static rpmuint32_t getDigestAlgo(Header
+     return dalgo;
+ }
+ 
++static int isHardLink(FileListRec flp, FileListRec tlp)
++{
++    return ((S_ISREG(flp->fl_mode) && S_ISREG(tlp->fl_mode)) &&
++            ((flp->fl_nlink > 1) && (flp->fl_nlink == tlp->fl_nlink)) &&
++            (flp->fl_ino == tlp->fl_ino) &&
++            (flp->fl_dev == tlp->fl_dev));
++}
++
++static int seenHardLink(FileList fl, FileListRec flp, ino_t *fileid)
++{
++    FileListRec ilp;
++    for (ilp = fl->fileList; ilp < flp; ilp++) {
++        if (isHardLink(flp, ilp)) {
++            *fileid = ilp - fl->fileList;
++            return 1;
++        }
++    }
++    return 0;
++}
++
+ /**
+  * Add file entries to header.
+  * @todo Should directories have %doc/%config attributes? (#14531)
+@@ -1374,6 +1394,7 @@ memset(buf, 0, sizeof(buf));	/* XXX valg
+ 
+     for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) {
+ 	const char *s;
++	ino_t fileid = flp - fl->fileList;
+ 
+  	/* Merge duplicate entries. */
+ 	while (i < (fl->fileListRecsUsed - 1) &&
+@@ -1436,6 +1457,13 @@ memset(buf, 0, sizeof(buf));	/* XXX valg
+ 	/* Leave room for both dirname and basename NUL's */
+ 	dpathlen += (strlen(flp->diskURL) + 2);
+ 
++	/* Excludes and dupes have been filtered out by now. */
++	if (S_ISREG(flp->fl_mode)) {
++	    if (flp->fl_nlink == 1 || !seenHardLink(fl, flp, &fileid)) {
++		fl->totalFileSize += flp->fl_size;
++	    }
++	}
++
+ 	/*
+ 	 * Make the header, the OLDFILENAMES will get converted to a 
+ 	 * compressed file list write before we write the actual package to
+@@ -1518,7 +1546,11 @@ memset(buf, 0, sizeof(buf));	/* XXX valg
+ 
+ 	/* XXX Hash instead of 64b->32b truncate to prevent aliasing. */
+ 	{   ino_t _ino = flp->fl_ino;
++	/* don't use hash here, as hash collisions which happen on large packages
++	   cause bus errors in rpmbuild
+ 	    ui32 = hashFunctionString(0, &_ino, sizeof(_ino));
++	*/
++	    ui32 = fileid + 1;
+ 	}
+ 	he->tag = RPMTAG_FILEINODES;
+ 	he->t = RPM_UINT32_TYPE;
+@@ -1751,39 +1783,6 @@ if (_rpmbuildFlags & 4) {
+ 		IOSM_MAP_TYPE | IOSM_MAP_MODE | IOSM_MAP_UID | IOSM_MAP_GID;
+ 	if (isSrc)
+ 	    fi->fmapflags[i] |= IOSM_FOLLOW_SYMLINKS;
+-
+-	if (S_ISREG(flp->fl_mode)) {
+-	    int bingo = 1;
+-	    /* Hard links need be tallied only once. */
+-	    if (flp->fl_nlink > 1) {
+-		FileListRec jlp = flp + 1;
+-		int j = i + 1;
+-		for (; (unsigned)j < fi->fc; j++, jlp++) {
+-		    /* follow outer loop logic */
+-		    while (((jlp - fl->fileList) < (fl->fileListRecsUsed - 1)) &&
+-			    !strcmp(jlp->fileURL, jlp[1].fileURL))
+-			jlp++;
+-		    if (jlp->flags & RPMFILE_EXCLUDE) {
+-			j--;
+-			/*@innercontinue@*/ continue;
+-		    }
+-		    if (jlp->flags & RPMFILE_GHOST)
+-		        /*@innercontinue@*/ continue;
+-		    if (!S_ISREG(jlp->fl_mode))
+-			/*@innercontinue@*/ continue;
+-		    if (flp->fl_nlink != jlp->fl_nlink)
+-			/*@innercontinue@*/ continue;
+-		    if (flp->fl_ino != jlp->fl_ino)
+-			/*@innercontinue@*/ continue;
+-		    if (flp->fl_dev != jlp->fl_dev)
+-			/*@innercontinue@*/ continue;
+-		    bingo = 0;	/* don't tally hardlink yet. */
+-		    /*@innerbreak@*/ break;
+-		}
+-	    }
+-	    if (bingo)
+-		fl->totalFileSize += flp->fl_size;
+-	}
+     }
+ 
+     ui32 = fl->totalFileSize;
+Index: rpm-5.4.14/lib/fsm.c
+===================================================================
+--- rpm-5.4.14.orig/lib/fsm.c
++++ rpm-5.4.14/lib/fsm.c
+@@ -904,6 +904,7 @@ int fsmMapAttrs(IOSM_t fsm)
+ 
+     if (fi && i >= 0 && i < (int) fi->fc) {
+ 	mode_t perms = (S_ISDIR(st->st_mode) ? fi->dperms : fi->fperms);
++	ino_t finalInode = (fi->finodes ? (ino_t)fi->finodes[i] : 0);
+ 	mode_t finalMode = (fi->fmodes ? (mode_t)fi->fmodes[i] : perms);
+ 	dev_t finalRdev = (dev_t)(fi->frdevs ? fi->frdevs[i] : 0);
+ 	rpmuint32_t finalMtime = (fi->fmtimes ? fi->fmtimes[i] : 0);
+@@ -943,6 +944,7 @@ int fsmMapAttrs(IOSM_t fsm)
+ 	    if ((S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
+ 	    && st->st_nlink == 0)
+ 		st->st_nlink = 1;
++	    st->st_ino = finalInode;
+ 	    st->st_rdev = finalRdev;
+ 	    st->st_mtime = finalMtime;
+ 	}
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch b/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch
new file mode 100644
index 0000000..5d182ad
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-pkgconfigdeps.patch
@@ -0,0 +1,37 @@
+pkgconfigdeps.sh: Change to restricting pkgconfig to the local directory
+
+Using PKG_CONFIG_PATH will allow pkg-config to fall back to the system paths,
+we don't want this as it may lead to inaccurate results in some corner cases.
+
+PKG_CONFIG_LIBDIR will ensure pkg-config stays within the install directory.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/scripts/pkgconfigdeps.sh
+===================================================================
+--- rpm-5.4.14.orig/scripts/pkgconfigdeps.sh
++++ rpm-5.4.14/scripts/pkgconfigdeps.sh
+@@ -18,8 +18,8 @@ case $1 in
+     *.pc)
+ 	# Query the dependencies of the package.
+ 	DIR=`dirname ${filename}`
+-	PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
+-	export PKG_CONFIG_PATH
++	PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig"
++	export PKG_CONFIG_LIBDIR
+ 	$pkgconfig --print-provides "$filename" 2> /dev/null | while read n r v ; do
+ 	    [ -n "$n" ] || continue
+ 	    # We have a dependency.  Make a note that we need the pkgconfig
+@@ -42,8 +42,8 @@ case $1 in
+ 	[ -n "$oneshot" ] && echo "$oneshot"; oneshot=""
+ 	# Query the dependencies of the package.
+ 	DIR=`dirname ${filename}`
+-	PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
+-	export PKG_CONFIG_PATH
++	PKG_CONFIG_LIBDIR="$DIR:$DIR/../../share/pkgconfig"
++	export PKG_CONFIG_LIBDIR
+ 	$pkgconfig --print-requires "$filename" 2> /dev/null | while read n r v ; do
+ 	    [ -n "$n" ] || continue
+ 	    if  [ -n "$r" ] && [ -n "$v" ]; then
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch
new file mode 100644
index 0000000..f26a6e7
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform-file-fix.patch
@@ -0,0 +1,28 @@
+Don't add the first line of /etc/rpm/platform to the list of patterns
+to match when computing an arch score, use it just for getting
+information about the platform (cpu/vendor/os). Fixes #3864.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -510,6 +510,7 @@ static rpmRC rpmPlatform(const char * pl
+ #endif
+ 	}
+ 
++#if !defined(RPM_VENDOR_OE) /* Skip the explicit-platform */
+ #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
+ 	/* do not use vendor and GNU attribution */
+ 	p = rpmExpand("%{_host_cpu}-%{_host_os}", NULL);
+@@ -520,7 +521,8 @@ static rpmRC rpmPlatform(const char * pl
+ #endif
+ 	xx = mireAppend(RPMMIRE_STRCMP, 0, p, NULL, &mi_re, &mi_nre);
+ 	p = _free(p);
+-	
++#endif
++
+ 	init_platform++;
+     }
+     rc = (init_platform ? RPMRC_OK : RPMRC_FAIL);
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
new file mode 100644
index 0000000..11fd039
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform.patch
@@ -0,0 +1,137 @@
+Fix up platform and related sysinfo file loading.
+
+Upstream-Status: Pending
+
+This ensures that RPM knows the compatible set of package types at all times.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/depends.c
+===================================================================
+--- rpm-5.4.14.orig/lib/depends.c
++++ rpm-5.4.14/lib/depends.c
+@@ -250,7 +250,7 @@ static int rpmtsAddUpgrades(rpmts ts, rp
+ 	    he->p.ptr = _free(he->p.ptr);
+ 	}
+ 
+-#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
+ 	/*
+ 	 * If we're capable of installing multiple colors
+ 	 * but at least one of the packages are white (0), we
+@@ -507,7 +507,7 @@ assert(lastx >= 0 && lastx < ts->orderCo
+     return 0;
+ }
+ 
+-#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
+ /* Is "compat" compatible w/ arch? */
+ int _isCompatibleArch(const char * arch, const char * compat)
+ {
+@@ -663,7 +663,7 @@ assert(he->p.str != NULL);
+ 
+ 	    if (arch == NULL || (parch = rpmteA(p)) == NULL)
+ 		continue;
+-#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) && !defined(RPM_VENDOR_OE)
+ 	    /* XXX hackery for alias matching. */
+ 	    if (!_isCompatibleArch(arch, parch))
+ 		continue;
+@@ -829,6 +829,12 @@ int rpmtsAddEraseElement(rpmts ts, Heade
+     return rc;
+ }
+ 
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
++#define _ETC_RPM_SYSINFO        "%{_etcrpm}/sysinfo"
++#else
++#define _ETC_RPM_SYSINFO        SYSCONFIGDIR "/sysinfo"
++#endif
++
+ /*@only@*/ /*@null@*/ /*@unchecked@*/
+ static char *sysinfo_path = NULL;
+ 
+@@ -1311,7 +1317,7 @@ retry:
+ 	sysinfo_path = rpmExpand("%{?_rpmds_sysinfo_path}", NULL);
+ 	if (!(sysinfo_path != NULL && *sysinfo_path == '/')) {
+ 	    sysinfo_path = _free(sysinfo_path);
+-	    sysinfo_path = xstrdup(SYSCONFIGDIR "/sysinfo");
++	    sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL);
+ 	}
+     }
+ 
+Index: rpm-5.4.14/lib/rpmds.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmds.c
++++ rpm-5.4.14/lib/rpmds.c
+@@ -1759,7 +1759,7 @@ int rpmdsSysinfo(rpmPRCO PRCO, const cha
+ /*@-observertrans @*/
+ 	    _sysinfo_path = _free(_sysinfo_path);
+ /*@=observertrans @*/
+-	    _sysinfo_path = xstrdup(_ETC_RPM_SYSINFO);
++	    _sysinfo_path = rpmExpand(_ETC_RPM_SYSINFO, NULL);
+ 	}
+     }
+ /*@=modobserver@*/
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -38,7 +38,13 @@
+ static const char * configTarget = NULL;
+ 
+ /*@observer@*/ /*@unchecked@*/
+-static const char * platform = SYSCONFIGDIR "/platform";
++#if defined(RPM_VENDOR_WINDRIVER)
++#define _ETC_RPM_PLATFORM        "%{_etcrpm}/platform"
++#else
++#define _ETC_RPM_PLATFORM        SYSCONFIGDIR "/platform"
++#endif
++
++static const char * _platform = NULL;
+ 
+ /*@only@*/ /*@relnull@*/ /*@unchecked@*/
+ void * platpat = NULL;
+@@ -694,16 +700,17 @@ static void defaultMachine(/*@out@*/ con
+     int rc;
+ 
+     while (!gotDefaults) {
+-#if defined(RPM_VENDOR_WINDRIVER)
+-	const char * _platform = rpmGetPath(__etcrpm, "/platform", NULL);
+-#else
+-	const char * _platform = platform;
+-#endif
++	if (_platform == NULL) {
++	    _platform = rpmExpand("%{?_rpmrc_platform_path}", NULL);
++	    /* XXX may need to validate path existence somewhen. */
++	    if (!(_platform != NULL && *_platform == '/')) {
++		_platform = _free(_platform);
++		_platform = rpmExpand(_ETC_RPM_PLATFORM, NULL);
++	    }
++	}
+ 	CVOG_t cvog = NULL;
+ #if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */
+ 	const char *cp;
+-#endif
+-#if defined(RPM_VENDOR_OPENPKG) /* larger-utsname */
+ 	/* utsname fields on some platforms (like HP-UX) are very small
+ 	   (just about 8 characters). This is too small for OpenPKG, so cheat! */
+ 	rc = uname(&un_real);
+@@ -780,9 +787,7 @@ static void defaultMachine(/*@out@*/ con
+ 	if (cp != NULL && cp != _platform)
+ 	    cp = _free(cp);
+ #endif
+-#if defined(RPM_VENDOR_WINDRIVER)
+ 	_platform = _free(_platform);
+-#endif
+ 
+ 	if (configTarget && !parseCVOG(configTarget, &cvog) && cvog != NULL) {
+ 	    gotDefaults = 1;
+@@ -1101,6 +1106,8 @@ int rpmReadConfigFiles(/*@unused@*/ cons
+ 
+ #ifdef PREMACROFILES
+     if (rpmReadRC(PREMACROFILES)) return -1;
++#else
++    if (rpmReadRC(NULL)) return -1;
+ #endif
+ 
+     /* Reset umask to its default umask(2) value. */
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
new file mode 100644
index 0000000..fed54e5
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-platform2.patch
@@ -0,0 +1,105 @@
+Fix up platform and related sysinfo file loading (part 2).
+
+Upstream-Status: Pending
+
+We need to ensure that we set the _gnu flag somehow.  We do this by reading
+from the platform file, and setting a new _platform_gnu and related vars.
+
+The default values of _host_cpu, _host_vendor and _host_os are changed to
+reference either the automatically determined _target_... or _platform_...
+values.  The macros file uses the configure time defaults in _platform_...
+versions have not been defined.  This preserves existing behavior, but
+ensures reasonable defaults are always available.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -328,10 +328,15 @@ static void setDefaults(void)
+ 	/*@modifies rpmGlobalMacroContext, internalState @*/
+ {
+ 
+-#if defined(RPM_VENDOR_WINDRIVER)
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
+     addMacro(NULL, "_usrlibrpm", NULL, __usrlibrpm, RMIL_DEFAULT);
+     addMacro(NULL, "_etcrpm", NULL, __etcrpm, RMIL_DEFAULT);
+     addMacro(NULL, "_vendor", NULL, "%{?_host_vendor}%{!?_host_vendor:wrs}", RMIL_DEFAULT);
++
++    addMacro(NULL, "_host_cpu", NULL, "%{?_platform_cpu}%{!?_platform_cpu:%{?_target_cpu}}", RMIL_DEFAULT);
++    addMacro(NULL, "_host_vendor", NULL, "%{?_platform_vendor}%{!?_platform_cpu:%{?_target_vendor}}", RMIL_DEFAULT);
++    addMacro(NULL, "_host_os", NULL, "%{?_platform_os}%{!?_platform_os:%{?_target_os}}", RMIL_DEFAULT);
++    addMacro(NULL, "_host_gnu", NULL, "%{?_platform_gnu}%{!?_platform_gnu:%{?_gnu}}", RMIL_DEFAULT);
+ #endif
+ 
+     addMacro(NULL, "_usr", NULL, USRPREFIX, RMIL_DEFAULT);
+@@ -487,9 +492,22 @@ static rpmRC rpmPlatform(const char * pl
+ 	}
+ 
+ 	if (!parseCVOG(p, &cvog) && cvog != NULL) {
++#if defined(RPM_VENDOR_OE)
++	    char * _gnu = NULL;
++
++	    addMacro(NULL, "_platform_cpu", NULL, cvog->cpu, -1);
++	    addMacro(NULL, "_platform_vendor", NULL, cvog->vendor, -1);
++	    addMacro(NULL, "_platform_os", NULL, cvog->os, -1);
++
++	    if (cvog->gnu && cvog->gnu[0] != '\0')
++		_gnu = rpmExpand("-", cvog->gnu, NULL);
++
++	    addMacro(NULL, "_platform_gnu", NULL, (_gnu ? _gnu : ""), -1);
++#else
+ 	    addMacro(NULL, "_host_cpu", NULL, cvog->cpu, -1);
+ 	    addMacro(NULL, "_host_vendor", NULL, cvog->vendor, -1);
+ 	    addMacro(NULL, "_host_os", NULL, cvog->os, -1);
++#endif
+ 	}
+ 
+ #if defined(RPM_VENDOR_OPENPKG) /* explicit-platform */
+Index: rpm-5.4.14/macros/macros.in
+===================================================================
+--- rpm-5.4.14.orig/macros/macros.in
++++ rpm-5.4.14/macros/macros.in
+@@ -900,9 +900,9 @@ $_arbitrary_tags_tests	Foo:Bar
+ %_os			@RPMCANONOS@
+ %_gnu			@RPMCANONGNU@
+ 
+-%_host_platform		%{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}
+-%_build_platform	%{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_gnu}
+-%_target_platform	%{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_gnu}
++%_host_platform		%{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
++%_build_platform	%{_build_cpu}-%{_build_vendor}-%{_build_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
++%_target_platform	%{_target_cpu}-%{_target_vendor}-%{_target_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}
+ 
+ #==============================================================================
+ # ---- configure macros.
+@@ -945,9 +945,10 @@ $_arbitrary_tags_tests	Foo:Bar
+ %_build_os		%{_host_os}
+ %_host			@host@
+ %_host_alias		@host_alias@%{nil}
+-%_host_cpu		@host_cpu@
+-%_host_vendor		@host_vendor@
+-%_host_os		@host_os@
++%_host_cpu		%{?_platform_cpu}%{!?_platform_cpu:%{_arch}}
++%_host_vendor		%{?_platform_vendor}%{!?_platform_vendor:%{_vendor}}
++%_host_os		%{?_platform_os}%{!?_platform_os:%{_os}}
++%_host_gnu		%{?_platform_gnu}%{!?_platform_gnu:%{_gnu}}
+ %_target		%{_host}
+ %_target_alias		%{_host_alias}
+ %_target_cpu		%{_host_cpu}
+Index: rpm-5.4.14/python/rpmmodule.c
+===================================================================
+--- rpm-5.4.14.orig/python/rpmmodule.c
++++ rpm-5.4.14/python/rpmmodule.c
+@@ -65,8 +65,8 @@ static PyObject * archScore(PyObject * s
+     if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &arch))
+ 	return NULL;
+ 
+-#if defined(RPM_VENDOR_WINDRIVER)
+-    platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_gnu}", NULL);
++#if defined(RPM_VENDOR_WINDRIVER) || defined(RPM_VENDOR_OE)
++    platform = rpmExpand(arch, "-%{_host_vendor}", "-%{_host_os}%{?_host_gnu}%{!?_host_gnu:%{?_gnu}}", NULL);
+ #else
+     platform = rpmExpand(arch, "-", "%{_vendor}", "-", "%{_os}", NULL);
+ #endif
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch b/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch
new file mode 100644
index 0000000..07d407d
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-py-init.patch
@@ -0,0 +1,27 @@
+python/rpmmodules.c: Change the way the python module loads the RPM config
+
+In order to support the RPM_VENDOR_WINDRIVER enhancement of dynamic
+runtime relocation paths, we need to call rpmcliInit instead of 
+rpmReadConfigFiles.  The rpmcliInit will end up calling rpmReadConfigFiles
+after the necessary relocation processing (if enabled).
+
+Code derived from changes suggested by Paul Eggleton.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/python/rpmmodule.c
+===================================================================
+--- rpm-5.4.14.orig/python/rpmmodule.c
++++ rpm-5.4.14/python/rpmmodule.c
+@@ -392,7 +392,8 @@ void init_rpm(void)
+     if (Py_AtExit(rpm_exithook) == -1)
+ 	return;
+ 
+-    rpmReadConfigFiles(NULL, NULL);
++    const char *argv[1] = {"rpmmodule", 0};
++    rpmcliInit(1, argv, NULL);
+ 
+     d = PyModule_GetDict(m);
+ 
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch b/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
new file mode 100644
index 0000000..a810123
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
@@ -0,0 +1,24 @@
+chroot: realpath is required before expanding _dbpath
+
+_usr turned out to be a relative path to support dyanmic config, but it's
+being used somewhere as a indicator to locate substrings, so we must get
+the real path of it in advance.
+
+Upstream-Status: Inappropriate (OpenEmbedded specific)
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+
+diff -urpN a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c
+--- a/rpmio/rpmrpc.c
++++ b/rpmio/rpmrpc.c
+@@ -257,7 +257,9 @@ int Open(const char * path, int flags, m
+     /* XXX if the open(2) fails, try to strip a possible chroot(2) prefix. */
+     if (fdno < 0 && errno == ENOENT) {
+ 	const char *dbpath = rpmExpand("%{?_dbpath}/", NULL);
+-	const char * fn = strstr(path + 1, dbpath);
++	char resolved_dbpath[PATH_MAX];
++	realpath(dbpath, resolved_dbpath);
++	const char * fn = strstr(path + 1, resolved_dbpath);
+ 	if (fn)
+ 	    fdno = open(fn, flags, mode);
+ 	dbpath = _free(dbpath);
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch b/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch
new file mode 100644
index 0000000..59fe524
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-reloc-macros.patch
@@ -0,0 +1,31 @@
+macros: Use dyanmic config vs hard coded settings
+
+When the dynamic, runtime relocation is enables we need to make sure that the 
+RPM macro file does not override the dynamic settings.  Fix this by forcing the
+dynamic version to be used in all cases.
+
+Upstream-Status: Inappropriate (OpenEmbedded specific)
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/macros/macros.in
+===================================================================
+--- rpm-5.4.14.orig/macros/macros.in
++++ rpm-5.4.14/macros/macros.in
+@@ -27,11 +27,12 @@
+ #==============================================================================
+ # ---- filesystem macros.
+ #
+-%_usr			@usrprefix@
++%_usr			%{_usrlibrpm}/../..
+ %_usrsrc		%{_usr}/src
+-%_var			@varprefix@
+-%_usrlibrpm		@USRLIBRPM@
+-%_etcrpm		@SYSCONFIGDIR@
++%_var			%{_usr}/../var
++# The dynamic relocation code sets the following two items
++#%_usrlibrpm		@USRLIBRPM@
++#%_etcrpm		@SYSCONFIGDIR@
+ 
+ %__objext		@objext@
+ %__libext		@libext@
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch b/meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch
new file mode 100644
index 0000000..769016b
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-remove-sykcparse-decl.patch
@@ -0,0 +1,14 @@
+Index: rpm-5.4.14/syck/lib/syck.h
+===================================================================
+--- rpm-5.4.14.orig/syck/lib/syck.h
++++ rpm-5.4.14/syck/lib/syck.h
+@@ -621,9 +621,6 @@ long syck_seq_count( SyckNode *seq )
+  */
+ void syckerror( char *msg )
+ 	/*@*/;
+-int syckparse( void * )
+-	/*@globals fileSystem @*/
+-	/*@modifies fileSystem @*/;
+ /* XXX union YYSTYPE *sycklval has issues on Mac OS X. */
+ int sycklex( void *_sycklval, SyckParser *parser )
+ 	/*@modifies _sycklval, parser @*/;
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch b/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
new file mode 100644
index 0000000..56a243d
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-resolvedep.patch
@@ -0,0 +1,40 @@
+lib/rpmts.c: Ensure that we check both providename and filepaths
+
+When looking up a missing dependencies, such as /bin/sh, we need to lookup
+in both the providename and filepaths DB, not just the filepaths DB.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/rpmts.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmts.c
++++ rpm-5.4.14/lib/rpmts.c
+@@ -410,8 +410,8 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __
+ 	if (sdb == NULL)
+ 	    continue;
+ 
+-	/* Look for a matching Provides: in suggested universe. */
+-	rpmtag = (*keyp == '/' ? RPMTAG_FILEPATHS : RPMTAG_PROVIDENAME);
++	rpmtag = RPMTAG_PROVIDENAME;
++       do {
+ 	mi = rpmmiInit(sdb, rpmtag, keyp, keylen);
+ 	while ((h = rpmmiNext(mi)) != NULL) {
+ 	    size_t hnamelen;
+@@ -446,6 +446,15 @@ fprintf(stderr, "--> %s(%p,%p,%p)\n", __
+ 	    bhnamelen = hnamelen;
+ 	}
+ 	mi = rpmmiFree(mi);
++
++	if (bh == NULL && *keyp == '/' && rpmtag == RPMTAG_PROVIDENAME) {
++	   rpmtag = RPMTAG_FILEPATHS;
++	   continue;
++        }
++
++        break;
++      } while (1);
++
+     }
+ 
+     /* Is there a suggested resolution? */
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch
new file mode 100644
index 0000000..d8feed7
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-rpmpgp-fix.patch
@@ -0,0 +1,67 @@
+rpmpgp.c: Add missing if defs around crypto implementations
+
+Without these, the system will error trying to find the correct crypto 
+library to use.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm/rpmio/rpmpgp.c
+===================================================================
+--- rpm.orig/rpmio/rpmpgp.c
++++ rpm/rpmio/rpmpgp.c
+@@ -1339,16 +1339,26 @@ int pgpExportPubkey(pgpDig dig)
+ {
+     int rc = 0;		/* assume failure */
+ 
++#if defined(WITH_BEECRYPT)
+     if (pgpImplVecs == &rpmbcImplVecs)
+ 	rc = rpmbcExportPubkey(dig);
++#endif
++#if defined(WITH_SSL)
+     if (pgpImplVecs == &rpmsslImplVecs)
+ 	rc = rpmsslExportPubkey(dig);
++#endif
++#if defined(WITH_NSS)
+     if (pgpImplVecs == &rpmnssImplVecs)
+ 	rc = rpmnssExportPubkey(dig);
++#endif
++#if defined(WITH_GCRYPT)
+     if (pgpImplVecs == &rpmgcImplVecs)
+ 	rc = rpmgcExportPubkey(dig);
++#endif
++#if defined(WITH_TOMCRYPT)
+     if (pgpImplVecs == &rpmltcImplVecs)
+ 	rc = rpmltcExportPubkey(dig);
++#endif
+     return rc;
+ }
+ 
+@@ -1356,16 +1366,26 @@ int pgpExportSignature(pgpDig dig, DIGES
+ {
+     int rc = 0;		/* assume failure */
+ 
++#if defined(WITH_BEECRYPT)
+     if (pgpImplVecs == &rpmbcImplVecs)
+ 	rc = rpmbcExportSignature(dig, ctx);
++#endif
++#if defined(WITH_SSL)
+     if (pgpImplVecs == &rpmsslImplVecs)
+ 	rc = rpmsslExportSignature(dig, ctx);
++#endif
++#if defined(WITH_NSS)
+     if (pgpImplVecs == &rpmnssImplVecs)
+ 	rc = rpmnssExportSignature(dig, ctx);
++#endif
++#if defined(WITH_GCRYPT)
+     if (pgpImplVecs == &rpmgcImplVecs)
+ 	rc = rpmgcExportSignature(dig, ctx);
++#endif
++#if defined(WITH_TOMCRYPT)
+     if (pgpImplVecs == &rpmltcImplVecs)
+ 	rc = rpmltcExportSignature(dig, ctx);
++#endif
+     return rc;
+ }
+ 
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch b/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch
new file mode 100644
index 0000000..f825372
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-scriptletexechelper.patch
@@ -0,0 +1,160 @@
+Enable a cross-install scriptlet helper.
+
+The helper is called from outside of the chroot with the arguments:
+
+<root> <prog> <script> <arg1> [<arg2> ... <argN>]
+
+The helper script is used by oe-core to facilitate shell script actions that
+can not be run from within a chroot on a foreign target system during a
+cross install.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/psm.c
+===================================================================
+--- rpm-5.4.14.orig/lib/psm.c
++++ rpm-5.4.14/lib/psm.c
+@@ -806,6 +806,10 @@ static rpmRC runScript(rpmpsm psm, Heade
+     int xx;
+     int i;
+ 
++#ifdef RPM_VENDOR_OE
++    const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++#endif
++    
+     if (psm->sstates != NULL && ix >= 0 && ix < RPMSCRIPT_MAX)
+ 	ssp = psm->sstates + ix;
+     if (ssp != NULL)
+@@ -872,14 +876,29 @@ assert(he->p.str != NULL);
+ 		(F_ISSET(psm, UNORDERED) ? "a" : ""));
+ 
+     if (Phe->p.argv == NULL) {
+-	argv = (const char **) alloca(5 * sizeof(*argv));
+-	argv[0] = "/bin/sh";
+-	argc = 1;
++	argv = (const char **) alloca(7 * sizeof(*argv));
++	argc = 0;
++    } else {
++	argv = (const char **) alloca((Phe->c + 6) * sizeof(*argv));
++	argc = 0;
++    }
++
++#ifdef RPM_VENDOR_OE
++    if (scriptletWrapper && *scriptletWrapper) {
++	argv[argc++] = scriptletWrapper;
++	argv[argc] = rpmtsRootDir(ts);
++	if (!argv[argc] || !*argv[argc])
++	   argv[argc] = "/";
++	argc++;
++    }
++#endif
++
++    if (Phe->p.argv == NULL) {
++	argv[argc++] = "/bin/sh";
+ 	ldconfig_done = 0;
+     } else {
+-	argv = (const char **) alloca((Phe->c + 4) * sizeof(*argv));
+-	memcpy(argv, Phe->p.argv, Phe->c * sizeof(*argv));
+-	argc = Phe->c;
++	memcpy((argv + argc), Phe->p.argv, Phe->c * sizeof(*argv));
++	argc += Phe->c;
+ 	ldconfig_done = (ldconfig_path && !strcmp(argv[0], ldconfig_path)
+ 		? 1 : 0);
+     }
+@@ -930,7 +949,12 @@ assert(he->p.str != NULL);
+ 	    goto exit;
+ 
+ 	if (rpmIsDebug() &&
+-	    (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash")))
++	    (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))
++#ifdef RPM_VENDOR_OE
++	    || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/sh"))
++	    || (scriptletWrapper && *scriptletWrapper && !strcmp(argv[1], "/bin/bash"))
++#endif
++	   )
+ 	{
+ 	    static const char set_x[] = "set -x\n";
+ 	    nw = Fwrite(set_x, sizeof(set_x[0]), sizeof(set_x)-1, fd);
+@@ -1065,12 +1089,22 @@ assert(he->p.str != NULL);
+ 
+ 	{   const char * rootDir = rpmtsRootDir(ts);
+ 	    if (!rpmtsChrootDone(ts) && rootDir != NULL &&
++#ifdef RPM_VENDOR_OE
++		!(scriptletWrapper && *scriptletWrapper) &&
++#endif
+ 		!(rootDir[0] == '/' && rootDir[1] == '\0'))
+ 	    {
+ 		/*@-modobserver@*/
+ 		xx = Chroot(rootDir);
+ 		/*@=modobserver@*/
+ 	    }
++#ifdef RPM_VENDOR_OE
++	    if (!rpmtsChrootDone(ts) && rootDir != NULL &&
++		(scriptletWrapper && *scriptletWrapper) &&
++		!(rootDir[0] == '/' && rootDir[1] == '\0'))
++		xx = Chdir(rootDir);
++	    else 
++#endif
+ 	    xx = Chdir("/");
+ 	    rpmlog(RPMLOG_DEBUG, D_("%s: %s(%s)\texecv(%s) pid %d\n"),
+ 			psm->stepName, sln, NVRA,
+@@ -2985,6 +3019,13 @@ assert(psm->te != NULL);
+     case PSM_SCRIPT:	/* Run current package scriptlets. */
+ 	/* XXX running %verifyscript/%sanitycheck doesn't have psm->te */
+     {	rpmtxn _parent = (psm && psm->te ? psm->te->txn : NULL);
++
++#ifdef RPM_VENDOR_OE
++        const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++	if (scriptletWrapper && *scriptletWrapper)
++	     rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
++#endif
++
+ 	xx = rpmtxnBegin(rpmtsGetRdb(ts), _parent, NULL);
+ 	rc = runInstScript(psm);
+ 	if (rc)
+@@ -2992,11 +3033,24 @@ assert(psm->te != NULL);
+ 	else
+ 	     xx = rpmtxnCommit(rpmtsGetRdb(ts)->db_txn);
+ 	rpmtsGetRdb(ts)->db_txn = NULL;
++#ifdef RPM_VENDOR_OE
++	if (scriptletWrapper && *scriptletWrapper)
++	     rc = rpmpsmNext(psm, PSM_CHROOT_IN);
++#endif
+     }	break;
+     case PSM_TRIGGERS:
+ 	/* Run triggers in other package(s) this package sets off. */
+ 	if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST)	break;
++#ifdef RPM_VENDOR_OE
++        const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++	if (scriptletWrapper && *scriptletWrapper)
++	     rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
++#endif
+ 	rc = runTriggers(psm);
++#ifdef RPM_VENDOR_OE
++	if (scriptletWrapper && *scriptletWrapper)
++	     rc = rpmpsmNext(psm, PSM_CHROOT_IN);
++#endif
+ 	break;
+     case PSM_IMMED_TRIGGERS:
+ 	/* Run triggers in this package other package(s) set off. */
+@@ -3006,7 +3060,18 @@ assert(psm->te != NULL);
+ 	    F_SET(psm, GOTTRIGGERS);
+ 	}
+ 	if (psm->triggers != NULL)
++#ifdef RPM_VENDOR_OE
++	{
++            const char * scriptletWrapper = rpmExpand("%{?_cross_scriptlet_wrapper}", NULL);
++	    if (scriptletWrapper && *scriptletWrapper)
++	         rc = rpmpsmNext(psm, PSM_CHROOT_OUT);
++#endif
+ 	    rc = runImmedTriggers(psm);
++#ifdef RPM_VENDOR_OE
++	    if (scriptletWrapper && *scriptletWrapper)
++	         rc = rpmpsmNext(psm, PSM_CHROOT_IN);
++	}
++#endif
+ 	break;
+ 
+     case PSM_RPMIO_FLAGS:
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch b/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch
new file mode 100644
index 0000000..ec38b95
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-showrc.patch
@@ -0,0 +1,26 @@
+Workaround for a memory leak in --showrc.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: rpm-5.4.14/lib/rpmrc.c
+===================================================================
+--- rpm-5.4.14.orig/lib/rpmrc.c
++++ rpm-5.4.14/lib/rpmrc.c
+@@ -1228,11 +1228,15 @@ int rpmShowRC(FILE * fp)
+ 		if (DNEVR != NULL)
+ 		    fprintf(fp, "    %s\n", DNEVR+2);
+ 	    }
++#if 0
+ 	    (void)rpmdsFree(ds);
+ 	    ds = NULL;
++#endif
+ 	    fprintf(fp, "\n");
+ 	}
++#if 0
+ 	PRCO = rpmdsFreePRCO(PRCO);
++#endif
+     }
+ 
+     if (rpmIsVerbose()) {
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch b/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch
new file mode 100644
index 0000000..683275c
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-tag-generate-endian-conversion-fix.patch
@@ -0,0 +1,50 @@
+fix a endian incompatible error in generating rpm tag
+
+A flaw was found in the way rpm generating arbitrary tags, which leads to a
+incorrect query result, this issue is introduced by a incompatible endianess
+when the generating process is executed on different architectures.
+
+This patch resolves it by taking the byte order that host uses.
+
+Upstream-Status: Pending
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+---
+ tagname.c |   16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+Index: rpm-5.4.14/rpmdb/tagname.c
+===================================================================
+--- rpm-5.4.14.orig/rpmdb/tagname.c
++++ rpm-5.4.14/rpmdb/tagname.c
+@@ -3,6 +3,19 @@
+  */
+ 
+ #include "system.h"
++#include <endian.h>
++
++/* Don't redefine this macro if it already exists */
++#ifndef le32toh
++#ifdef __USE_BSD
++#include <byteswap.h>
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++#define le32toh(x) (x)
++#else
++#define le32toh(x) __bswap_32(x)
++#endif
++#endif /* __USE_BSD */
++#endif /* le32toh */
+ 
+ #include <rpmio_internal.h>	/* XXX DIGEST_CTX, xtolower, xstrcasecmp */
+ #include <rpmmacro.h>
+@@ -152,7 +165,10 @@ static rpmTag _tagGenerate(const char *s
+     xx = rpmDigestUpdate(ctx, s, nb);
+     xx = rpmDigestFinal(ctx, &digest, &digestlen, 0);
+     if (digest && digestlen > 4) {
++	/* The tag is stored in a uniform byte order for cross-endian compatibility.
++	   Swap to the host uses. */
+ 	memcpy(&tag, digest + (digestlen - 4), 4);
++	tag = le32toh(tag);
+ 	tag = (rpmTag) (tag & 0x3fffffff);
+ 	tag = (rpmTag) (tag | 0x40000000);
+     }
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch b/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch
new file mode 100644
index 0000000..cb85beb
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-tools-mtree-LDFLAGS.patch
@@ -0,0 +1,24 @@
+Source: None
+Upstream-Status: Pending
+Author: Khem Raj <raj.khem@gmail.com>
+Date: 2011-03-03
+Description:
+This patch fixes build issue found when compiling rpm-native on ubuntu
+11.04-alpha. Problem is that linker does not get correct set of dependent
+libraries when linking mtree binary which results in undefined symbols
+in librpmio.so. This patch adds correct flags to mtree_LDADD to account
+for rpmio deps
+
+Index: rpm-5.4.14/tools/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/tools/Makefile.am
++++ rpm-5.4.14/tools/Makefile.am
+@@ -186,7 +186,7 @@ grep_LDADD =		$(RPMIO_LDADD_COMMON)
+ 
+ mtree_SOURCES =		rpmmtree.c
+ mtree_LDFLAGS =		@LDFLAGS_STATIC@ $(LDFLAGS)
+-mtree_LDADD =		$(RPM_LDADD_COMMON)
++mtree_LDADD =		$(RPMIO_LDADD_COMMON)
+ 
+ rpmrepo_SOURCES =	rpmrepo.c
+ rpmrepo_CPPFLAGS =	$(AM_CPPFLAGS) -I$(top_srcdir)/scripts -I$(top_builddir)/scripts $(CPPFLAGS)
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch b/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch
new file mode 100644
index 0000000..713f84e
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-uuid-include.patch
@@ -0,0 +1,40 @@
+A patch to fix a problem when compiling with uuid.
+
+When attempting to build with uuid and all tests compiling will error because
+uuid.h doesn't exist in the rpm tarball. Fix this by changing the include to
+use the one in ossp which solves the issue. 
+
+The recipe already depends on ossp so ossp/uuid.h will be there when rpm-native
+is built.
+
+Upstream-Status: Pending
+
+Signed-off-by: Morgan Little <morgan.little@windriver.com>
+
+
+Index: rpm-5.4.14/lua/local/luuid.c
+===================================================================
+--- rpm-5.4.14.orig/lua/local/luuid.c
++++ rpm-5.4.14/lua/local/luuid.c
+@@ -21,7 +21,7 @@
+ 
+ #ifdef LUA_USE_UUID
+ 
+-#include "uuid.h"
++#include <ossp/uuid.h>
+ 
+ /*  Lua method: <uuid> = uuid.generate(<version>[, <uuid-namespace>, <data>])  */
+ static int luuid_generate(lua_State *L)
+Index: rpm-5.4.14/rpmio/rpmuuid.c
+===================================================================
+--- rpm-5.4.14.orig/rpmio/rpmuuid.c
++++ rpm-5.4.14/rpmio/rpmuuid.c
+@@ -16,7 +16,7 @@
+ #include "rpmlog.h"
+ #include "rpmuuid.h"
+ #ifdef WITH_UUID
+-#include "uuid.h"
++#include <ossp/uuid.h>
+ #endif
+ #include "debug.h"
+ 
diff --git a/meta/recipes-devtools/rpm/rpm/rpm2cpio b/meta/recipes-devtools/rpm/rpm/rpm2cpio
new file mode 100755
index 0000000..6bcef6a
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm2cpio
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Prevent gawk >= 4.0.x from getting funny ideas wrt UTF in printf()
+LANG=C
+
+pkg=$1
+if [ "$pkg" = "" -o ! -e "$pkg" ]; then
+    echo "no package supplied" 1>&2
+   exit 1
+fi
+
+leadsize=96
+o=`expr $leadsize + 8`
+set `od -j $o -N 8 -t u1 $pkg`
+il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
+dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
+# echo "sig il: $il dl: $dl"
+
+sigsize=`expr 8 + 16 \* $il + $dl`
+o=`expr $o + $sigsize + \( 8 - \( $sigsize \% 8 \) \) \% 8 + 8`
+set `od -j $o -N 8 -t u1 $pkg`
+il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
+dl=`expr 256 \* \( 256 \* \( 256 \* $6 + $7 \) + $8 \) + $9`
+# echo "hdr il: $il dl: $dl"
+
+hdrsize=`expr 8 + 16 \* $il + $dl`
+o=`expr $o + $hdrsize`
+comp=`dd if=$pkg ibs=$o skip=1 count=1 2>/dev/null | dd bs=3 count=1 2> /dev/null`
+
+gz="`echo . | awk '{ printf("%c%c", 0x1f, 0x8b); }'`"
+lzma="`echo . | awk '{ printf("%cLZ", 0xff); }'`"
+xz="`echo . | awk '{ printf("%c7z", 0xfd); }'`"
+case "$comp" in
+    BZh)      dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 ;;
+    "$gz"*)   dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip ;;
+    "$xz"*)   dd if="$pkg" ibs=$o skip=1 2>/dev/null | xzcat ;;
+    "$lzma"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | unlzma ;;
+    *)        echo "Unrecognized rpm file: $pkg"; exit 1 ;;
+esac
diff --git a/meta/recipes-devtools/rpm/rpm/rpmatch.patch b/meta/recipes-devtools/rpm/rpm/rpmatch.patch
new file mode 100644
index 0000000..20d13aa
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpmatch.patch
@@ -0,0 +1,42 @@
+Add configure check for rpmatch() and 
+creates a compatable macro if it is not provided by the C library.
+
+This is needed for uclibc since it does not have the above function
+implemented.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: rpm-5.4.14/configure.ac
+===================================================================
+--- rpm-5.4.14.orig/configure.ac
++++ rpm-5.4.14/configure.ac
+@@ -943,7 +943,7 @@ AC_CHECK_FUNCS([dnl
+     ftok getaddrinfo getattrlist getcwd getdelim getline getmode getnameinfo dnl
+     getpassphrase getxattr getwd iconv inet_aton lchflags lchmod lchown dnl
+     lgetxattr lsetxattr lutimes madvise mempcpy mkdtemp mkstemp mtrace dnl
+-    posix_fadvise posix_fallocate putenv realpath regcomp secure_getenv __secure_getenv dnl
++    posix_fadvise posix_fallocate putenv realpath regcomp rpmatch secure_getenv __secure_getenv dnl
+     setattrlist setenv setlocale setmode setxattr dnl
+     sigaddset sigdelset sigemptyset sighold sigrelse sigpause dnl
+     sigprocmask sigsuspend sigaction dnl
+Index: rpm-5.4.14/system.h
+===================================================================
+--- rpm-5.4.14.orig/system.h
++++ rpm-5.4.14/system.h
+@@ -353,6 +353,14 @@ extern int _tolower(int) __THROW	/*@*/;
+ #include <libgen.h>
+ #endif
+ 
++#ifndef HAVE_RPMATCH
++#define rpmatch(line) \
++	( (line == NULL)? -1 : \
++	  (*line == 'y' || *line == 'Y')? 1 : \
++	  (*line == 'n' || *line == 'N')? 0 : \
++	  -1 )
++#endif
++
+ /* -- Retrofit glibc __progname */
+ #if defined __GLIBC__ && __GLIBC__ >= 2
+ #if __GLIBC_MINOR__ >= 1
diff --git a/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch b/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch
new file mode 100644
index 0000000..9bdd1d4
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpmdeps-oecore.patch
@@ -0,0 +1,194 @@
+Add an "rpmdeps-oecore" binary which allows batch processing of individual file
+dependencies in a similar manner to rpmdeps --provides --requires -v, prefixing
+each line of output with the filename that has the dependency.
+
+This is much faster than individually calling rpmdeps on each file.
+
+This binary is used by package.bbclass.
+
+Upstream-Status: Inappropriate [OE Specific]
+
+RP 2012/2/7
+
+---
+ tools/Makefile.am      |    6 ++-
+ tools/rpmdeps-oecore.c |  147 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 152 insertions(+), 1 deletions(-)
+ create mode 100644 tools/rpmdeps-oecore.c
+
+Index: rpm-5.4.14/tools/Makefile.am
+===================================================================
+--- rpm-5.4.14.orig/tools/Makefile.am
++++ rpm-5.4.14/tools/Makefile.am
+@@ -62,7 +62,7 @@ pkgbin_PROGRAMS =	\
+ 	@WITH_AUGEAS_AUGTOOL@ chroot cp @WITH_CUDF_CUDFTOOL@ find mtree \
+ 	@WITH_SEMANAGE_SEMODULE@ wget \
+ 	rpmcache rpmdigest rpmrepo rpmspecdump \
+-	rpmcmp rpmdeps sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
++	rpmcmp rpmdeps rpmdeps-oecore sqlite3 @WITH_KEYUTILS_RPMKEY@ @WITH_LIBELF_DEBUGEDIT@
+ if WITH_DB
+ pkgbin_PROGRAMS +=	dbconvert
+ endif
+@@ -172,6 +172,10 @@ rpmdeps_SOURCES =	rpmdeps.c
+ rpmdeps_LDFLAGS =	@LDFLAGS_STATIC@ $(LDFLAGS)
+ rpmdeps_LDADD =		$(RPM_LDADD_COMMON)
+ 
++rpmdeps_oecore_SOURCES =  rpmdeps-oecore.c
++rpmdeps_oecore_LDFLAGS =  @LDFLAGS_STATIC@ $(LDFLAGS)
++rpmdeps_oecore_LDADD =    $(RPM_LDADD_COMMON)
++
+ rpmdigest_SOURCES =	rpmdigest.c
+ rpmdigest_LDFLAGS =	@LDFLAGS_STATIC@ $(LDFLAGS)
+ rpmdigest_LDADD =	$(RPMIO_LDADD_COMMON)
+Index: rpm-5.4.14/tools/rpmdeps-oecore.c
+===================================================================
+--- /dev/null
++++ rpm-5.4.14/tools/rpmdeps-oecore.c
+@@ -0,0 +1,147 @@
++#include "system.h"
++const char *__progname;
++
++#include <rpmio.h>
++#include <rpmiotypes.h>
++#include <rpmcb.h>
++#include <argv.h>
++#include <rpmtypes.h>
++#include <rpmtag.h>
++
++#include <rpmds.h>
++#define   _RPMFC_INTERNAL     /* XXX for debugging */
++#include <rpmfc.h>
++
++#include <rpmcli.h>
++
++#include "debug.h"
++
++/*@unchecked@*/
++char *progname;
++
++#define   RPMDEP_RPMFC        1
++
++static int rpmdepPrint(char *filename, rpmds ds, FILE * fp)
++{
++    if (fp == NULL) fp = stderr;
++
++    ds = rpmdsInit(ds);
++    while (rpmdsNext(ds) >= 0) {
++  fprintf(fp, "%s %s: %s\n", filename, rpmdsType(ds), rpmdsDNEVR(ds)+2);
++    }
++    return 0;
++}
++
++static struct poptOption optionsTable[] = {
++
++ { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0,
++  N_("Common options:"),
++  NULL }, 
++
++   POPT_AUTOALIAS
++   POPT_AUTOHELP
++   POPT_TABLEEND
++};
++
++
++int
++main(int argc, char *argv[])
++{
++    poptContext optCon;
++    ARGV_t av = NULL;
++    rpmfc fc = NULL;
++    FILE * fp = NULL;
++    int flags = 0;
++    int ac = 0;
++    int ec = 1;
++    int xx;
++    int i;
++    char buf[BUFSIZ];
++    int nddict;
++    const char * s;
++    char * se;
++    const char * fn;
++    const char * N;
++    const char * EVR;
++    evrFlags Flags;
++    unsigned char deptype;
++    int ix;
++    rpmds ds;
++
++/*@-modobserver@*/
++    if ((progname = strrchr(argv[0], '/')) != NULL)
++  progname++;
++    else
++  progname = argv[0];
++/*@=modobserver@*/
++
++    optCon = rpmcliInit(argc, argv, optionsTable);
++    if (optCon == NULL)
++  goto exit;
++
++    av = poptGetArgs(optCon);
++    ac = argvCount(av);
++
++    if (ac == 0) {
++  av = NULL;
++  xx = argvFgets(&av, NULL);
++  ac = argvCount(av);
++    }
++
++    /* Make sure file names are sorted. */
++    xx = argvSort(av, NULL);
++
++    /* Build file class dictionary. */
++    fc = rpmfcNew();
++    xx = rpmfcClassify(fc, av, NULL);
++
++    /* Build file/package dependency dictionary. */
++    xx = rpmfcApply(fc);
++
++    /* Generate per-file indices into package dependencies. */
++    nddict = argvCount(fc->ddict);
++
++    for (i = 0; i < nddict; i++) {
++  s = fc->ddict[i];
++
++  /* Parse out (file#,deptype,N,EVR,Flags) */
++  ix = strtol(s, &se, 10);
++  assert(se != NULL);
++  deptype = *se++;
++  se++;
++  N = se;
++  while (*se && *se != ' ')
++      se++;
++  *se++ = '\0';
++  EVR = se;
++  while (*se && *se != ' ')
++      se++;
++  *se++ = '\0';
++  Flags = strtol(se, NULL, 16);
++
++  switch (deptype) {
++  default:
++      /*@switchbreak@*/ break;
++  case 'P':   
++      ds = rpmdsSingle(RPMTAG_PROVIDENAME, N, EVR, Flags);
++      rpmdepPrint((char *)fc->fn[ix], ds, stdout);
++      (void)rpmdsFree(ds);
++      ds = NULL;
++      /*@switchbreak@*/ break;
++  case 'R':
++      ds = rpmdsSingle(RPMTAG_REQUIRENAME, N, EVR, Flags);
++      rpmdepPrint((char *)fc->fn[ix], ds, stdout);
++      (void)rpmdsFree(ds);
++      ds = NULL;
++      /*@switchbreak@*/ break;
++  }
++    }
++
++    fc = rpmfcFree(fc);
++
++    ec = 0;
++
++exit:
++    optCon = rpmcliFini(optCon);
++    return ec;
++}
diff --git a/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch b/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch
new file mode 100644
index 0000000..f08bd68
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpmqv_cc_b_gone.patch
@@ -0,0 +1,32 @@
+rpm: compile rpmqv.c instead of rpmqv.cc
+
+Some versions of gcc, 4.4.5 for example, will put a reference to __gxx_personality_v0
+into rpm.o and rpmbuild.o.  This means we must link with g++, and the Makefile we
+generate does not.
+
+So, go back to using rpmqv.c (which is currently identical to rpmqv.cc).
+
+Upstream-Status: Inappropriate [other]
+
+   When linking with g++ is really necessary, the upstream package will do that.
+
+Signed-off-by: Joe Slater <joe.slater@windriver.com>
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -127,13 +127,13 @@ rpm_SOURCES =		build.c
+ rpm_LDFLAGS =		@LDFLAGS_STATIC@ $(LDFLAGS)
+ rpm_LDADD =		rpm.o $(myLDADD)
+ rpm.o:	$(top_srcdir)/rpmqv.c
+-	$(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $(top_srcdir)/rpmqv.cc
++	$(COMPILE) -DIAM_RPMBT -DIAM_RPMDB -DIAM_RPMEIU -DIAM_RPMK -DIAM_RPMQV -o $@ -c $(top_srcdir)/rpmqv.c
+ 
+ rpmbuild_SOURCES =	build.c
+ rpmbuild_LDFLAGS =	@LDFLAGS_STATIC@ $(LDFLAGS)
+ rpmbuild_LDADD =	rpmbuild.o $(myLDADD)
+ rpmbuild.o: $(top_srcdir)/rpmqv.c
+-	$(COMPILE) -DIAM_RPMBT -o $@ -c $(top_srcdir)/rpmqv.cc
++	$(COMPILE) -DIAM_RPMBT -o $@ -c $(top_srcdir)/rpmqv.c
+ 
+ .PHONY:	splint
+ splint:
diff --git a/meta/recipes-devtools/rpm/rpm/uclibc-support.patch b/meta/recipes-devtools/rpm/rpm/uclibc-support.patch
new file mode 100644
index 0000000..8870adb
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/uclibc-support.patch
@@ -0,0 +1,63 @@
+Define the x* wrappers for uclibc as well
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: rpm-5.4.14/rpmio/rpmio.h
+===================================================================
+--- rpm-5.4.14.orig/rpmio/rpmio.h
++++ rpm-5.4.14/rpmio/rpmio.h
+@@ -23,7 +23,8 @@
+  */
+ /*@{*/
+ #if !defined(__LCLINT__) && !defined(__UCLIBC__) && defined(__GLIBC__) && \
+-	(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))
++	(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && \
++	!defined(__UCLIBC__)
+ #define USE_COOKIE_SEEK_POINTER 1
+ typedef _IO_off64_t 	_libio_off_t;
+ typedef _libio_off_t *	_libio_pos_t;
+Index: rpm-5.4.14/system.h
+===================================================================
+--- rpm-5.4.14.orig/system.h
++++ rpm-5.4.14/system.h
+@@ -481,7 +481,7 @@ extern void muntrace (void)
+ #endif /* defined(__LCLINT__) */
+ 
+ /* Memory allocation via macro defs to get meaningful locations from mtrace() */
+-#if defined(__GNUC__)
++#if defined(__GNUC__) || defined(__UCLIBC__)
+ #define	xmalloc(_size) 		(malloc(_size) ? : vmefail(_size))
+ #define	xcalloc(_nmemb, _size)	(calloc((_nmemb), (_size)) ? : vmefail(_size))
+ #define	xrealloc(_ptr, _size)	(realloc((_ptr), (_size)) ? : vmefail(_size))
+Index: rpm-5.4.14/lib/librpm.vers
+===================================================================
+--- rpm-5.4.14.orig/lib/librpm.vers
++++ rpm-5.4.14/lib/librpm.vers
+@@ -405,6 +405,10 @@ LIBRPM_0
+     specedit;
+     strict_erasures;
+     XrpmtsiInit;
++    xmalloc;
++    xrealloc;
++    xcalloc;
++    xstrdup;
+   local:
+     *;
+ };
+Index: rpm-5.4.14/rpmio/librpmio.vers
+===================================================================
+--- rpm-5.4.14.orig/rpmio/librpmio.vers
++++ rpm-5.4.14/rpmio/librpmio.vers
+@@ -1056,6 +1056,10 @@ LIBRPMIO_0
+     mongo_write_concern_set_mode;
+     mongo_write_concern_set_w;
+     mongo_write_concern_set_wtimeout;
++    xmalloc;
++    xrealloc;
++    xcalloc;
++    xstrdup;
+   local:
+     *;
+ };
diff --git a/meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch b/meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch
new file mode 100644
index 0000000..71045ae
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch
@@ -0,0 +1,38 @@
+From 9e7b72ee0c994609975981e135fc18d0387aefb6 Mon Sep 17 00:00:00 2001
+From: jbj <jbj>
+Date: Wed, 14 May 2014 21:19:41 +0000
+Subject: [PATCH] - verify: fix: broken logic for %ghost avoidance (Mark
+ Hatle).
+
+Upstream-Status: Backport
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+---
+ CHANGES      | 1 +
+ lib/verify.c | 3 +--
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+Index: rpm-5.4.14/CHANGES
+===================================================================
+--- rpm-5.4.14.orig/CHANGES
++++ rpm-5.4.14/CHANGES
+@@ -1,3 +1,5 @@
++    - jbj: verify: fix: broken logic for %ghost avoidance (Mark Hatle).
++
+ 5.4.13 -> 5.4.14:
+     - mooney: use __sun instead of __sun__ in #define (lp#1243472).
+     - mooney: rpmconstant: ensure linkage w Oracle Studio 12.3 (lp#1243469).
+Index: rpm-5.4.14/lib/verify.c
+===================================================================
+--- rpm-5.4.14.orig/lib/verify.c
++++ rpm-5.4.14/lib/verify.c
+@@ -588,8 +588,7 @@ uint32_t fc = rpmfiFC(fi);
+ 	    continue;
+ 
+ 	/* If not verifying %ghost, skip ghost files. */
+-	/* XXX the broken!!! logic disables %ghost queries always. */
+-	if (!(FF_ISSET(qva->qva_fflags, GHOST) && FF_ISSET(fflags, GHOST)))
++	if (!FF_ISSET(qva->qva_fflags, GHOST) && FF_ISSET(fflags, GHOST))
+ 	    continue;
+ 
+ 	/* Gather per-file data into a carrier. */
diff --git a/meta/recipes-devtools/rpm/rpm_4.11.2.bb b/meta/recipes-devtools/rpm/rpm_4.11.2.bb
new file mode 100644
index 0000000..210c943
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm_4.11.2.bb
@@ -0,0 +1,137 @@
+SUMMARY = "The RPM package management system"
+DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
+package management system capable of installing, uninstalling, \
+verifying, querying, and updating software packages. Each software \
+package consists of an archive of files along with information about \
+the package like its version, a description, etc."
+
+SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
+DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
+development files will simplify the process of writing programs that \
+manipulate RPM packages and databases. These files are intended to \
+simplify the process of creating graphical package managers or any \
+other tools that need an intimate knowledge of RPM packages in order \
+to function."
+
+SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages"
+DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \
+written in the Python programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+HOMEPAGE = "http://www.rpm.org"
+LICENSE = "GPL-2.0+"
+LIC_FILES_CHKSUM ??= "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+DEPENDS = "db libxml2 xz findutils file popt nss bzip2 elfutils patch attr zlib acl gzip make binutils python"
+
+SRC_URI += "http://rpm.org/releases/rpm-4.11.x/${BP}.tar.bz2 \
+            file://use-pkgconfig-for-python.patch \
+            file://remove-db3-from-configure.patch \
+            file://add_RPMSENSE_MISSINGOK_to_rpmmodule.patch \
+            file://support-suggests-tag.patch \
+            file://remove-dir-check.patch \
+            file://disable_shortcircuited.patch \
+            file://fix_libdir.patch \
+            file://rpm-scriptetexechelp.patch \
+            file://pythondeps.sh \
+            file://rpm-CVE-2014-8118.patch \
+            file://rpm-CVE-2013-6435.patch \
+           "
+
+SRC_URI[md5sum] = "876ac9948a88367054f8ddb5c0e87173"
+SRC_URI[sha256sum] = "403f8de632b33846ce5746f429c21a60f40dff9dcb56f1b4118f37a0652a48d4"
+
+PR = "r1"
+
+inherit autotools
+inherit pythonnative
+inherit pkgconfig
+inherit gettext
+
+EXTRA_OECONF += "--host=${HOST_SYS} \
+                 --program-prefix= \
+                 --prefix=${prefix} \
+                 --exec-prefix=${prefix} \
+                 --bindir=${prefix}/bin \
+                 --sbindir=${prefix}/sbin \
+                 --sysconfdir=${sysconfdir} \
+                 --datadir=${prefix}/share \
+                 --includedir=${prefix}/include \
+                 --libdir=${prefix}/lib \
+                 --libexecdir=${prefix}/libexec \
+                 --localstatedir=${localstatedir} \
+                 --sharedstatedir=${prefix}/com \
+                 --mandir=${mandir} \
+                 --infodir=${infodir} \
+                 --disable-dependency-tracking \
+                 --with-acl \
+                 --without-lua \
+                 --without-cap \
+                 --enable-shared \
+                 --enable-python \
+                 --with-external-db \
+                "
+
+CPPFLAGS_append = " `pkg-config --cflags nss`"
+LDFLAGS_append = " -Wl,-Bsymbolic-functions -ffunction-sections"
+CCFLAGS_append = " -fPIC "
+CXXFLAGS_append = " -fPIC "
+CFLAGS_append = " -fPIC -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE "
+
+do_configure_prepend() {
+    rm -rf sqlite
+    rm -f m4/libtool.m4
+    rm -f m4/lt*.m4
+    rm -rf db3/configure*
+}
+
+do_install_append() {
+    mv ${D}/${base_bindir}/rpm ${D}/${bindir}/
+    rmdir ${D}/${base_bindir}
+    rm -f ${D}${prefix}/lib/*.la
+    rm -f ${D}${prefix}/lib/rpm-plugins/*.la
+    rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.{a,la}
+    rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.{a,la}
+    rm -fr ${D}/var
+    install -d ${D}${prefix}/lib/rpm/bin
+    ln -s ../debugedit ${D}${prefix}/lib/rpm/bin/debugedit
+    ln -s ../rpmdeps ${D}${prefix}/lib/rpm/bin/rpmdeps-oecore
+    install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
+}
+
+pkg_postinst_${PN}() {
+
+    [ "x\$D" == "x" ] && ldconfig
+    test -f ${localstatedir}/lib/rpm/Packages || rpm --initdb
+    rm -f ${localstatedir}/lib/rpm/Filemd5s \
+          ${localstatedir}/lib/rpm/Filedigests \
+          ${localstatedir}/lib/rpm/Requireversion \
+          ${localstatedir}/lib/rpm/Provideversion
+
+}
+
+pkg_postrm_${PN}() {
+    [ "x\$D" == "x" ] && ldconfig
+
+}
+
+PACKAGES += "python-${PN}"
+PROVIDES += "python-rpm"
+
+FILES_${PN} +=  "${libdir}/rpm \
+                 ${libdir}/rpm-plugins/exec.so \
+                "
+RDEPENDS_${PN} = "base-files run-postinsts"
+RDEPENDS_${PN}_class-native = ""
+
+FILES_${PN}-dbg += "${libdir}/rpm/.debug/* \
+                    ${libdir}/rpm-plugins/.debug/* \
+                    ${libdir}/python2.7/site-packages/rpm/.debug/* \
+                   "
+
+FILES_${PN}-dev += "${libdir}/python2.7/site-packages/rpm/*.la"
+
+FILES_python-${PN} = "${libdir}/python2.7/site-packages/rpm/*"
+RDEPENDS_python-${PN} = "${PN} python"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb b/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
new file mode 100644
index 0000000..8903f3b
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
@@ -0,0 +1,528 @@
+SUMMARY = "The RPM package management system"
+DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
+package management system capable of installing, uninstalling, \
+verifying, querying, and updating software packages. Each software \
+package consists of an archive of files along with information about \
+the package like its version, a description, etc."
+
+SUMMARY_${PN}-libs = "Libraries for manipulating RPM packages"
+DESCRIPTION_${PN}-libs = "This package contains the RPM shared libraries."
+
+SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
+DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
+development files will simplify the process of writing programs that \
+manipulate RPM packages and databases. These files are intended to \
+simplify the process of creating graphical package managers or any \
+other tools that need an intimate knowledge of RPM packages in order \
+to function."
+
+SUMMARY_${PN}-common = "Common RPM paths, scripts, documentation and configuration"
+DESCRIPTION_${PN}-common = "The rpm-common package contains paths, scripts, documentation \
+and configuration common between RPM Package Manager."
+
+SUMMARY_${PN}-build = "Scripts and executable programs used to build packages"
+DESCRIPTION_${PN}-build = "The rpm-build packagec ontains the scripts and executable programs \
+that are used to build packages using the RPM Package Manager."
+
+SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages"
+DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \
+written in the Python programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+SUMMARY_perl-module-rpm = "Perl bindings for apps which will manipulate RPM packages"
+DESCRIPTION_perl-modules-rpm = "The perl-modules-rpm package contains a module that permits applications \
+written in the Perl programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+SUMMARY_perl-module-rpm-dev = "Development components for perl bindings"
+DESCRIPTION_perl-modules-rpm-dev = "Development items such as man pages for use with the Perl \
+language bindings."
+
+HOMEPAGE = "http://rpm5.org/"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+DEPENDS = "libpcre attr acl popt ossp-uuid file byacc-native"
+
+S = "${WORKDIR}/rpm"
+
+# Apply various fixups that are unique to the CVS environment
+do_fixup_unpack () {
+	ln -sf ../syck ${S}/syck || :
+	ln -sf ../lua ${S}/lua || :
+	ln ${S}/rpmqv.c ${S}/rpmqv.cc || :
+}
+
+addtask fixup_unpack after do_unpack before do_patch
+
+# This recipe is really designed for development... to Try out the latest
+# community work in progress.
+DEFAULT_PREFERENCE = "-1"
+
+# rpm2cpio is a shell script, which is part of the rpm src.rpm.  It is needed
+# in order to extract the distribution SRPM into a format we can extract...
+SRC_URI = "cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=rpm \
+	   cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=syck \
+	   cvs://anonymous@rpm5.org/cvs;tag=rpm-5_4;module=lua \
+	   file://rpm-log-auto-rm.patch \
+	   file://rpm-db-reduce.patch \
+	   file://perfile_rpmdeps.sh \
+	   file://rpm-autogen.patch \
+	   file://rpm-libsql-fix.patch \
+	   file://header-include-fix.patch \
+	   file://rpm-platform.patch \
+	   file://rpm-showrc.patch \
+	   file://rpm-tools-mtree-LDFLAGS.patch \
+	   file://rpm-fileclass.patch \
+	   file://rpm-canonarch.patch \
+	   file://rpm-no-loopmsg.patch \
+	   file://rpm-scriptletexechelper.patch \
+	   file://pythondeps.sh \
+	   file://rpmdeps-oecore.patch \
+	   file://rpm-resolvedep.patch \
+	   file://rpm-no-perl-urpm.patch \
+	   file://rpm-macros.patch \
+	   file://rpm-lua.patch \
+	   file://rpm-ossp-uuid.patch \
+	   file://rpm-packageorigin.patch \
+	   file://rpm-pkgconfigdeps.patch \
+	   file://uclibc-support.patch \
+	   file://rpmatch.patch \
+	   file://fstack-protector-configure-check.patch \
+	   file://dbconvert.patch \
+	   file://rpm-uuid-include.patch \
+	   file://makefile-am-exec-hook.patch \
+	   file://rpm-db_buffer_small.patch \
+	   file://rpm-py-init.patch \
+	   file://python-rpm-rpmsense.patch \
+	   file://rpm-reloc-macros.patch \
+	   file://rpm-platform2.patch \
+	   file://rpm-remove-sykcparse-decl.patch \
+	   file://debugedit-segv.patch \
+	   file://debugedit-valid-file-to-fix-segment-fault.patch \
+	   file://rpm-platform-file-fix.patch \
+	   file://rpm-lsb-compatibility.patch \
+	   file://rpm-tag-generate-endian-conversion-fix.patch \
+	   file://rpm-hardlink-segfault-fix.patch \
+	   file://rpm-payload-use-hashed-inode.patch \
+	   file://rpm-fix-logio-cp.patch \
+	   file://rpm-db5-or-db6.patch \
+	   file://rpm-rpmpgp-fix.patch \
+	   file://rpm-disable-Wno-override-init.patch \
+	   file://rpm-realpath.patch \
+	  "
+
+# Uncomment the following line to enable platform score debugging
+# This is useful when identifying issues with Smart being unable
+# to process certain package feeds.
+#SRC_URI += "file://rpm-debug-platform.patch"
+
+inherit autotools gettext
+
+acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java"
+
+# Specify the default rpm macros in terms of adjustable variables
+rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros"
+rpm_macros_class-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:~/.oerpmmacros"
+rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/poky/macros:%{_usrlibrpm}/poky/%{_target}/macros:~/.oerpmmacros"
+
+# sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux
+
+# Note: perl and sqlite w/o db specified does not currently work.
+#       tcl, augeas, nss, gcrypt, xar and keyutils support is untested.
+PACKAGECONFIG ??= "db bzip2 zlib beecrypt openssl libelf python"
+
+PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2,"
+PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz,"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
+PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar,"
+
+WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \
+		--with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
+		--with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
+		--without-pythonembed"
+PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python,"
+
+# Perl modules are not built, but they could be enabled fairly easily
+# the perl module creation and installation would need to be patched.
+# (currently has host perl contamination issues)
+WITH_PERL = "--with-perl --without-perlembed --without-perl-urpm"
+WITHOUT_PERL = "--without-perl --without-perl-urpm"
+PACKAGECONFIG[perl] = "${WITH_PERL},${WITHOUT_PERL},perl,"
+
+# The --with-dbsql will only tell RPM to check for support, db
+# may or may not be built w/ the dbsql support.
+WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated"
+PACKAGECONFIG[db] = "${WITH_DB},--without-db,db,"
+
+PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3,"
+
+PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--without-beecrypt,beecrypt,"
+PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl,"
+PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss,"
+PACKAGECONFIG[gcrypt] = "--with-gcrypt,--without-gcrypt,gcrypt,"
+PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils,"
+PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils,"
+
+WITH_SELINUX = "--with-selinux --with-sepol --with-semanage"
+WITHOUT_SELINUX = "--without-selinux --without-sepol --without-semanage"
+PACKAGECONFIG[selinux] = "${WITH_SELINUX},${WITHOUT_SELINUX},libselinux,"
+
+WITH_NEON = "--with-neon --with-libproxy --with-expat --without-gssapi"
+WITHOUT_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi"
+PACKAGECONFIG[neon] = "${WITH_NEON},${WITHOUT_NEON},neon expat,"
+
+PACKAGECONFIG[lua] = "--with-lua,--without-lua,expat,"
+PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl,"
+
+PACKAGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas,"
+
+EXTRA_OECONF += "--verbose \
+		--sysconfdir=${sysconfdir} \
+		--with-file \
+		--with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \
+		--with-syck=internal \
+		--without-readline \
+		--without-libtasn1 \
+		--without-pakchois \
+		--without-gnutls \
+		--with-pcre \
+		--enable-utf8 \
+		--with-uuid \
+		--with-attr \
+		--with-acl \
+		--with-popt=external \
+		--with-pthreads \
+		--without-cudf \
+		--without-ficl \
+		--without-aterm \
+		--without-nix \
+		--without-bash \
+		--without-rc \
+		--without-js \
+		--without-gpsee \
+		--without-ruby \
+		--without-squirrel \
+		--with-build-extlibdep \
+		--with-build-maxextlibdep \
+		--without-valgrind \
+		--disable-openmp \
+		--enable-build-pic \
+		--enable-build-versionscript \
+		--enable-build-warnings \
+		--enable-build-debug \
+		--enable-maintainer-mode \
+		--with-path-macros=${rpm_macros} \
+		--with-path-lib=${libdir}/rpm \
+		--with-bugreport=http://bugzilla.yoctoproject.org \
+		--program-prefix= \
+		YACC=byacc"
+
+CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE"
+
+LDFLAGS_append_libc-uclibc = "-lrt -lpthread"
+
+PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm-dbg python-rpm-staticdev python-rpm-dev python-rpm perl-module-rpm perl-module-rpm-dev ${PN}-locale"
+
+SOLIBS = "5.4.so"
+
+# Based on %files section in the rpm.spec
+
+FILES_${PN} =  "${bindir}/rpm \
+		${bindir}/rpmconstant \
+		${libdir}/rpm/rpm.* \
+		${libdir}/rpm/tgpg \
+		${libdir}/rpm/macros \
+		${libdir}/rpm/rpmpopt \
+		${libdir}/rpm/rpm2cpio \
+		${libdir}/rpm/vcheck \
+		${libdir}/rpm/helpers \
+		${libdir}/rpm/qf \
+		${libdir}/rpm/cpuinfo.yaml \
+		${libdir}/rpm/bin/mtree \
+		${libdir}/rpm/bin/rpmkey \
+		${libdir}/rpm/bin/rpmrepo \
+		${libdir}/rpm/bin/rpmrepo.real \
+		${libdir}/rpm/bin/rpmspecdump \
+		${libdir}/rpm/bin/rpmspecdump.real \
+		${libdir}/rpm/bin/wget \
+		${localstatedir}/cache \
+		${localstatedir}/cache/rpm \
+		${localstatedir}/cache/wdj \
+		${localstatedir}/lib \
+		${localstatedir}/lib/rpm \
+		${localstatedir}/lib/wdj \
+		${bindir}/rpm.real \
+		${bindir}/rpmconstant.real \
+		${bindir}/rpm2cpio.real \
+		"
+
+FILES_${PN}-dbg += "${libdir}/rpm/.debug \
+		${libdir}/rpm/bin/.debug \
+		"
+
+FILES_${PN}-common = "${bindir}/rpm2cpio \
+		${bindir}/gendiff \
+		${sysconfdir}/rpm \
+		${localstatedir}/spool/repackage \
+		"
+
+FILES_${PN}-libs = "${libdir}/librpm-*.so \
+		${libdir}/librpmconstant-*.so \
+		${libdir}/librpmdb-*.so \
+		${libdir}/librpmio-*.so \
+		${libdir}/librpmmisc-*.so \
+		${libdir}/librpmbuild-*.so \
+		"
+
+FILES_${PN}-build = "${prefix}/src/rpm \
+		${bindir}/rpmbuild \
+		${bindir}/rpmbuild.real \
+		${libdir}/rpm/brp-* \
+		${libdir}/rpm/check-files \
+		${libdir}/rpm/cross-build \
+		${libdir}/rpm/find-debuginfo.sh \
+		${libdir}/rpm/find-lang.sh \
+		${libdir}/rpm/find-prov.pl \
+		${libdir}/rpm/find-provides.perl \
+		${libdir}/rpm/find-req.pl \
+		${libdir}/rpm/find-requires.perl \
+		${libdir}/rpm/getpo.sh \
+		${libdir}/rpm/http.req \
+		${libdir}/rpm/javadeps.sh \
+		${libdir}/rpm/mono-find-provides \
+		${libdir}/rpm/mono-find-requires \
+		${libdir}/rpm/executabledeps.sh \
+		${libdir}/rpm/libtooldeps.sh \
+		${libdir}/rpm/osgideps.pl \
+		${libdir}/rpm/perldeps.pl \
+		${libdir}/rpm/perl.prov \
+		${libdir}/rpm/perl.req \
+		${libdir}/rpm/php.prov \
+		${libdir}/rpm/php.req \
+		${libdir}/rpm/pkgconfigdeps.sh \
+		${libdir}/rpm/pythondeps.sh \
+		${libdir}/rpm/bin/debugedit \
+		${libdir}/rpm/bin/debugedit.real \
+		${libdir}/rpm/bin/rpmcache \
+		${libdir}/rpm/bin/rpmcache.real \
+		${libdir}/rpm/bin/rpmcmp \
+		${libdir}/rpm/bin/rpmcmp.real \
+		${libdir}/rpm/bin/rpmdeps \
+		${libdir}/rpm/bin/rpmdeps.real \
+		${libdir}/rpm/bin/rpmdeps-oecore \
+		${libdir}/rpm/bin/rpmdeps-oecore.real \
+		${libdir}/rpm/bin/rpmdigest \
+		${libdir}/rpm/bin/rpmdigest.real \
+		${libdir}/rpm/bin/abi-compliance-checker.pl \
+		${libdir}/rpm/bin/api-sanity-autotest.pl \
+		${libdir}/rpm/bin/chroot \
+		${libdir}/rpm/bin/cp \
+		${libdir}/rpm/bin/dbsql \
+		${libdir}/rpm/bin/find \
+		${libdir}/rpm/bin/install-sh \
+		${libdir}/rpm/bin/lua \
+		${libdir}/rpm/bin/luac \
+		${libdir}/rpm/bin/mkinstalldirs \
+		${libdir}/rpm/bin/rpmlua \
+		${libdir}/rpm/bin/rpmluac \
+		${libdir}/rpm/bin/sqlite3 \
+		${libdir}/rpm/macros.d/cmake \
+		${libdir}/rpm/macros.d/java \
+		${libdir}/rpm/macros.d/libtool \
+		${libdir}/rpm/macros.d/mandriva \
+		${libdir}/rpm/macros.d/mono \
+		${libdir}/rpm/macros.d/perl \
+		${libdir}/rpm/macros.d/php \
+		${libdir}/rpm/macros.d/pkgconfig \
+		${libdir}/rpm/macros.d/python \
+		${libdir}/rpm/macros.d/ruby \
+		${libdir}/rpm/macros.d/selinux \
+		${libdir}/rpm/macros.d/tcl \
+		${libdir}/rpm/macros.rpmbuild \
+		${libdir}/rpm/u_pkg.sh \
+		${libdir}/rpm/vpkg-provides.sh \
+		${libdir}/rpm/vpkg-provides2.sh \
+		${libdir}/rpm/perfile_rpmdeps.sh \
+		"
+RDEPENDS_${PN} = "base-files run-postinsts"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-build = "file bash perl"
+
+RDEPENDS_python-rpm = "${PN}"
+
+FILES_python-rpm-dbg = "${libdir}/python*/site-packages/rpm/.debug/_*"
+FILES_python-rpm-dev = "${libdir}/python*/site-packages/rpm/*.la"
+FILES_python-rpm-staticdev = "${libdir}/python*/site-packages/rpm/*.a"
+FILES_python-rpm = "${libdir}/python*/site-packages/rpm"
+
+FILES_perl-module-rpm = "${libdir}/perl/*/* \
+		"
+
+FILES_perl-module-rpm-dev = "${prefix}/share/man/man3/RPM* \
+		"
+
+RDEPENDS_${PN}-dev += "bash"
+
+FILES_${PN}-dev = "${includedir}/rpm \
+		${libdir}/librpm.la \
+		${libdir}/librpm.so \
+		${libdir}/librpmconstant.la \
+		${libdir}/librpmconstant.so \
+		${libdir}/librpmdb.la \
+		${libdir}/librpmdb.so \
+		${libdir}/librpmio.la \
+		${libdir}/librpmio.so \
+		${libdir}/librpmmisc.la \
+		${libdir}/librpmmisc.so \
+		${libdir}/librpmbuild.la \
+		${libdir}/librpmbuild.so \
+		${libdir}/rpm/lib/liblua.la \
+		${libdir}/pkgconfig/rpm.pc \
+		${libdir}/rpm/rpmdb_loadcvt \
+		"
+
+FILES_${PN}-staticdev = " \
+		${libdir}/librpm.a \
+		${libdir}/librpmconstant.a \
+		${libdir}/librpmdb.a \
+		${libdir}/librpmio.a \
+		${libdir}/librpmmisc.a \
+		${libdir}/librpmbuild.a \
+		${libdir}/rpm/lib/liblua.a \
+		"
+
+do_configure() {
+	# Disable tests!
+	echo "all:" > ${S}/tests/Makefile.am
+	sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in
+
+	( cd ${S}; ${S}/autogen.sh )
+
+	# NASTY hack to make sure configure files the right pkg-config file...
+	sed -e 's/pkg-config --exists uuid/pkg-config --exists ossp-uuid/g' \
+	    -e 's/pkg-config uuid/pkg-config ossp-uuid/g' -i ${S}/configure
+
+	( cd ${S}/syck ; set +e ; rm -- -l* ; make distclean ) || :
+
+	export varprefix=${localstatedir}
+	oe_runconf
+}
+
+do_install_append() {
+	sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
+	sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
+	sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
+	sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros
+	sed -i -e 's,^#%_openall_before_chroot.*,%_openall_before_chroot\t1,' ${D}/${libdir}/rpm/macros
+
+	# Enable Debian style arbitrary tags...
+	sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros
+
+	install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
+	install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
+
+	# Remove unpackaged files (based on list in rpm.spec)
+	rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
+
+	rm -f ${D}/${mandir}/man8/rpmcache.8*
+	rm -f ${D}/${mandir}/man8/rpmgraph.8*
+	rm -f ${D}/${mandir}/*/man8/rpmcache.8*
+	rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
+	rm -rf ${D}/${mandir}/{fr,ko}
+
+	rm -f ${D}/${includedir}/popt.h
+	rm -f ${D}/${libdir}/libpopt.*
+	rm -f ${D}/${libdir}/pkgconfig/popt.pc
+	rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
+	rm -f ${D}/${mandir}/man3/popt.3
+
+	rm -f ${D}/${mandir}/man1/xar.1*
+	rm -f ${D}/${bindir}/xar
+	rm -rf ${D}/${includedir}/xar
+	rm -f ${D}/${libdir}/libxar*
+
+	rm -f ${D}/${bindir}/lz*
+	rm -f ${D}/${bindir}/unlzma
+	rm -f ${D}/${bindir}/unxz
+	rm -f ${D}/${bindir}/xz*
+	rm -rf ${D}/${includedir}/lzma*
+	rm -f ${D}/${mandir}/man1/lz*.1
+	rm -f ${D}/${libdir}/pkgconfig/liblzma*
+
+	rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.{a,la}
+	rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.{a,la}
+
+	#find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
+	#	-o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
+	#find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
+
+	# We don't want the default macro set
+	rm -rf ${D}/${libdir}/rpm/{i[3456]86*,athlon*,pentium*,x86_64*,alpha*,sparc*,ia64*,ppc*,s390*,armv[34][lb]*,armv[345]*,mips*,noarch*}
+
+	rm -f ${D}/${libdir}/rpm/dbconvert.sh
+
+	rm -f ${D}/${libdir}/rpm/libsqldb.*
+
+	# We don't want, nor need the Mandriva multiarch items
+	rm -f ${D}/${bindir}/multiarch-dispatch
+	rm -f ${D}/${bindir}/multiarch-platform
+	rm -f ${D}/${libdir}/rpm/check-multiarch-files
+	rm -f ${D}/${libdir}/rpm/mkmultiarch
+	rm -f ${D}/${includedir}/multiarch-dispatch.h
+
+	rm -f ${D}/${libdir}/rpm/gstreamer.sh
+	rm -f ${D}/${libdir}/rpm/gem_helper.rb
+	rm -f ${D}/${libdir}/rpm/rubygems.rb
+	rm -f ${D}/${libdir}/rpm/kmod-deps.sh
+	rm -f ${D}/${libdir}/rpm/pythoneggs.py
+	rm -f ${D}/${libdir}/rpm/macros.d/kernel
+	rm -f ${D}/${libdir}/rpm/macros.d/gstreamer
+	rm -f ${D}/${libdir}/rpm/bin/mgo
+	rm -f ${D}/${libdir}/rpm/bin/dbconvert
+	rm -f ${D}/${libdir}/rpm/bin/pom2spec
+
+	rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj
+	rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl
+
+}
+
+add_native_wrapper() {
+        create_wrapper ${D}/${bindir}/rpm \
+		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+        create_wrapper ${D}/${bindir}/rpm2cpio \
+		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+        create_wrapper ${D}/${bindir}/rpmbuild \
+		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+        create_wrapper ${D}/${bindir}/rpmconstant \
+		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+	for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do
+        	create_wrapper $rpm_binary \
+			RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+			RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+			RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+	done
+}
+
+do_install_append_class-native() {
+	add_native_wrapper
+}
+
+do_install_append_class-nativesdk() {
+	add_native_wrapper
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.14.bb b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
new file mode 100644
index 0000000..1f9a4bd
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm_5.4.14.bb
@@ -0,0 +1,516 @@
+SUMMARY = "The RPM package management system"
+DESCRIPTION = "The RPM Package Manager (RPM) is a powerful command line driven \
+package management system capable of installing, uninstalling, \
+verifying, querying, and updating software packages. Each software \
+package consists of an archive of files along with information about \
+the package like its version, a description, etc."
+
+RECIPE_NO_UPDATE_REASON = "5.4.15 has a package database issue: http://lists.openembedded.org/pipermail/openembedded-core/2015-August/109187.html"
+
+SUMMARY_${PN}-libs = "Libraries for manipulating RPM packages"
+DESCRIPTION_${PN}-libs = "This package contains the RPM shared libraries."
+
+SUMMARY_${PN}-dev = "Development files for manipulating RPM packages"
+DESCRIPTION_${PN}-dev = "This package contains the RPM C library and header files. These \
+development files will simplify the process of writing programs that \
+manipulate RPM packages and databases. These files are intended to \
+simplify the process of creating graphical package managers or any \
+other tools that need an intimate knowledge of RPM packages in order \
+to function."
+
+SUMMARY_${PN}-common = "Common RPM paths, scripts, documentation and configuration"
+DESCRIPTION_${PN}-common = "The rpm-common package contains paths, scripts, documentation \
+and configuration common between RPM Package Manager."
+
+SUMMARY_${PN}-build = "Scripts and executable programs used to build packages"
+DESCRIPTION_${PN}-build = "The rpm-build packagec ontains the scripts and executable programs \
+that are used to build packages using the RPM Package Manager."
+
+SUMMARY_python-rpm = "Python bindings for apps which will manupulate RPM packages"
+DESCRIPTION_python-rpm = "The rpm-python package contains a module that permits applications \
+written in the Python programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+SUMMARY_perl-module-rpm = "Perl bindings for apps which will manipulate RPM packages"
+DESCRIPTION_perl-modules-rpm = "The perl-modules-rpm package contains a module that permits applications \
+written in the Perl programming language to use the interface \
+supplied by the RPM Package Manager libraries."
+
+HOMEPAGE = "http://rpm5.org/"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+DEPENDS = "libpcre attr acl popt ossp-uuid file byacc-native"
+
+# rpm2cpio is a shell script, which is part of the rpm src.rpm.  It is needed
+# in order to extract the distribution SRPM into a format we can extract...
+SRC_URI = "http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.14-0.20131024.src.rpm;extract=rpm-5.4.14.tar.gz \
+	   file://rpm-log-auto-rm.patch \
+	   file://rpm-db-reduce.patch \
+	   file://perfile_rpmdeps.sh \
+	   file://rpm-autogen.patch \
+	   file://rpm-libsql-fix.patch \
+	   file://header-include-fix.patch \
+	   file://rpm-platform.patch \
+	   file://rpm-showrc.patch \
+	   file://rpm-tools-mtree-LDFLAGS.patch \
+	   file://rpm-fileclass.patch \
+	   file://rpm-canonarch.patch \
+	   file://rpm-no-loopmsg.patch \
+	   file://rpm-scriptletexechelper.patch \
+	   file://pythondeps.sh \
+	   file://rpmdeps-oecore.patch \
+	   file://rpm-resolvedep.patch \
+	   file://rpm-no-perl-urpm.patch \
+	   file://rpm-macros.patch \
+	   file://rpm-lua.patch \
+	   file://rpm-ossp-uuid.patch \
+	   file://rpm-packageorigin.patch \
+	   file://rpm-pkgconfigdeps.patch \
+	   file://uclibc-support.patch \
+	   file://rpmatch.patch \
+	   file://fstack-protector-configure-check.patch \
+	   file://dbconvert.patch \
+	   file://rpm-uuid-include.patch \
+	   file://makefile-am-exec-hook.patch \
+	   file://rpm-db_buffer_small.patch \
+	   file://rpm-py-init.patch \
+	   file://python-rpm-rpmsense.patch \
+	   file://rpm-reloc-macros.patch \
+	   file://rpm-platform2.patch \
+	   file://rpm-remove-sykcparse-decl.patch \
+	   file://debugedit-segv.patch \
+	   file://debugedit-valid-file-to-fix-segment-fault.patch \
+	   file://rpm-platform-file-fix.patch \
+	   file://rpm-lsb-compatibility.patch \
+	   file://rpm-tag-generate-endian-conversion-fix.patch \
+	   file://verify-fix-broken-logic-for-ghost-avoidance-Mark-Hat.patch \
+	   file://rpm-hardlink-segfault-fix.patch \
+	   file://rpm-payload-use-hashed-inode.patch \
+	   file://rpm-fix-logio-cp.patch \
+	   file://rpm-db5-or-db6.patch \
+	   file://rpm-disable-Wno-override-init.patch \
+	   file://rpmqv_cc_b_gone.patch \
+	   file://rpm-realpath.patch \
+	   file://0001-using-poptParseArgvString-to-parse-the-_gpg_check_pa.patch \
+	   file://no-ldflags-in-pkgconfig.patch \
+	   file://rpm-lua-fix-print.patch \
+	   file://rpm-check-rootpath-reasonableness.patch \
+	   file://rpm-macros.in-disable-external-key-server.patch \
+	   file://rpm-opendb-before-verifyscript-to-avoid-null-point.patch \
+	  "
+
+# Uncomment the following line to enable platform score debugging
+# This is useful when identifying issues with Smart being unable
+# to process certain package feeds.
+#SRC_URI += "file://rpm-debug-platform.patch"
+
+SRC_URI[md5sum] = "25093d399a0b5d1342d24900a91b347d"
+SRC_URI[sha256sum] = "676e3ab41f72e3b504e04109cfb565a300742f56a7da084f202013b30eeae467"
+
+inherit autotools gettext
+
+acpaths = "-I ${S}/db/dist/aclocal -I ${S}/db/dist/aclocal_java"
+
+# Specify the default rpm macros in terms of adjustable variables
+rpm_macros = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:%{_etcrpm}/macros.*:%{_etcrpm}/macros:%{_etcrpm}/%{_target}/macros:~/.oerpmmacros"
+rpm_macros_class-native = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
+rpm_macros_class-nativesdk = "%{_usrlibrpm}/macros:%{_usrlibrpm}/${DISTRO}/macros:%{_usrlibrpm}/${DISTRO}/%{_target}/macros:~/.oerpmmacros"
+
+# sqlite lua tcl augeas nss gcrypt neon xz xar keyutils perl selinux
+
+# Note: perl and sqlite w/o db specified does not currently work.
+#       tcl, augeas, nss, gcrypt, xar and keyutils support is untested.
+PACKAGECONFIG ??= "db bzip2 zlib beecrypt openssl libelf python"
+
+PACKAGECONFIG[bzip2] = "--with-bzip2,--without-bzip2,bzip2,"
+PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz,"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
+PACKAGECONFIG[xar] = "--with-xar,--without-xar,xar,"
+
+WITH_PYTHON = " --with-python=${PYTHON_BASEVERSION} \
+		--with-python-inc-dir=${STAGING_INCDIR}/python${PYTHON_BASEVERSION} \
+		--with-python-lib-dir=${libdir}/python${PYTHON_BASEVERSION}/site-packages \
+		--without-pythonembed"
+PACKAGECONFIG[python] = "${WITH_PYTHON},--without-python,python,"
+
+# Perl modules are not built, but they could be enabled fairly easily
+# the perl module creation and installation would need to be patched.
+# (currently has host perl contamination issues)
+WITH_PERL = "--with-perl --without-perlembed --without-perl-urpm"
+WITHOUT_PERL = "--without-perl --without-perl-urpm"
+PACKAGECONFIG[perl] = "${WITH_PERL},${WITHOUT_PERL},perl,"
+
+# The --with-dbsql will only tell RPM to check for support, db
+# may or may not be built w/ the dbsql support.
+WITH_DB = "--with-db --with-dbsql --without-db-tools-integrated"
+PACKAGECONFIG[db] = "${WITH_DB},--without-db,db,"
+
+PACKAGECONFIG[sqlite] = "--with-sqlite,--without-sqlite,sqlite3,"
+
+PACKAGECONFIG[beecrypt] = "--with-beecrypt=external,--without-beecrypt,beecrypt,"
+PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl,"
+PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss,"
+PACKAGECONFIG[gcrypt] = "--with-gcrypt,--without-gcrypt,gcrypt,"
+PACKAGECONFIG[keyutils] = "--with-keyutils,--without-keyutils,keyutils,"
+PACKAGECONFIG[libelf] = "--with-libelf,--without-libelf,elfutils,"
+
+WITH_SELINUX = "--with-selinux --with-sepol --with-semanage"
+WITHOUT_SELINUX = "--without-selinux --without-sepol --without-semanage"
+PACKAGECONFIG[selinux] = "${WITH_SELINUX},${WITHOUT_SELINUX},libselinux,"
+
+WITH_NEON = "--with-neon --with-libproxy --with-expat --without-gssapi"
+WITHOUT_NEON = "--without-neon --without-libproxy --without-expat --without-gssapi"
+PACKAGECONFIG[neon] = "${WITH_NEON},${WITHOUT_NEON},neon expat,"
+
+PACKAGECONFIG[lua] = "--with-lua,--without-lua,expat,"
+PACKAGECONFIG[tcl] = "--with-tcl,--without-tcl,tcl,"
+
+PACKAGECONFIG[augeas] = "--with-augeas,--without-augeas,augeas,"
+
+EXTRA_OECONF += "--verbose \
+		--sysconfdir=${sysconfdir} \
+		--with-file \
+		--with-path-magic=%{_usrlibrpm}/../../share/misc/magic.mgc \
+		--with-syck=internal \
+		--without-readline \
+		--without-libtasn1 \
+		--without-pakchois \
+		--without-gnutls \
+		--with-pcre \
+		--enable-utf8 \
+		--with-uuid \
+		--with-attr \
+		--with-acl \
+		--with-popt=external \
+		--with-pthreads \
+		--without-cudf \
+		--without-ficl \
+		--without-aterm \
+		--without-nix \
+		--without-bash \
+		--without-rc \
+		--without-js \
+		--without-gpsee \
+		--without-ruby \
+		--without-squirrel \
+		--with-build-extlibdep \
+		--with-build-maxextlibdep \
+		--without-valgrind \
+		--disable-openmp \
+		--enable-build-pic \
+		--enable-build-versionscript \
+		--enable-build-warnings \
+		--enable-build-debug \
+		--enable-maintainer-mode \
+		--with-path-macros=${rpm_macros} \
+		--with-path-lib=${libdir}/rpm \
+		--with-bugreport=http://bugzilla.yoctoproject.org \
+		--program-prefix= \
+		YACC=byacc"
+
+CFLAGS_append = " -DRPM_VENDOR_WINDRIVER -DRPM_VENDOR_POKY -DRPM_VENDOR_OE"
+
+LDFLAGS_append_libc-uclibc = "-lrt -lpthread"
+
+PACKAGES = "${PN}-dbg ${PN} ${PN}-doc ${PN}-libs ${PN}-dev ${PN}-staticdev ${PN}-common ${PN}-build python-rpm perl-module-rpm ${PN}-locale"
+
+SOLIBS = "5.4.so"
+
+# Based on %files section in the rpm.spec
+
+FILES_${PN} =  "${bindir}/rpm \
+		${bindir}/rpmconstant \
+		${libdir}/rpm/rpm.* \
+		${libdir}/rpm/tgpg \
+		${libdir}/rpm/macros \
+		${libdir}/rpm/rpmpopt \
+		${libdir}/rpm/rpm2cpio \
+		${libdir}/rpm/vcheck \
+		${libdir}/rpm/helpers \
+		${libdir}/rpm/qf \
+		${libdir}/rpm/cpuinfo.yaml \
+		${libdir}/rpm/bin/mtree \
+		${libdir}/rpm/bin/rpmkey \
+		${libdir}/rpm/bin/rpmrepo \
+		${libdir}/rpm/bin/rpmrepo.real \
+		${libdir}/rpm/bin/rpmspecdump \
+		${libdir}/rpm/bin/rpmspecdump.real \
+		${libdir}/rpm/bin/wget \
+		${localstatedir}/cache \
+		${localstatedir}/cache/rpm \
+		${localstatedir}/cache/wdj \
+		${localstatedir}/lib \
+		${localstatedir}/lib/rpm \
+		${localstatedir}/lib/wdj \
+		${bindir}/rpm.real \
+		${bindir}/rpmconstant.real \
+		${bindir}/rpm2cpio.real \
+		"
+
+FILES_${PN}-dbg += "${libdir}/rpm/.debug \
+		${libdir}/rpm/bin/.debug \
+		${libdir}/python*/site-packages/rpm/.debug/_* \
+		"
+
+FILES_${PN}-common = "${bindir}/rpm2cpio \
+		${bindir}/gendiff \
+		${sysconfdir}/rpm \
+		${localstatedir}/spool/repackage \
+		"
+
+FILES_${PN}-libs = "${libdir}/librpm-*.so \
+		${libdir}/librpmconstant-*.so \
+		${libdir}/librpmdb-*.so \
+		${libdir}/librpmio-*.so \
+		${libdir}/librpmmisc-*.so \
+		${libdir}/librpmbuild-*.so \
+		"
+
+FILES_${PN}-build = "${prefix}/src/rpm \
+		${bindir}/rpmbuild \
+		${bindir}/rpmbuild.real \
+		${libdir}/rpm/brp-* \
+		${libdir}/rpm/check-files \
+		${libdir}/rpm/cross-build \
+		${libdir}/rpm/find-debuginfo.sh \
+		${libdir}/rpm/find-lang.sh \
+		${libdir}/rpm/find-prov.pl \
+		${libdir}/rpm/find-provides.perl \
+		${libdir}/rpm/find-req.pl \
+		${libdir}/rpm/find-requires.perl \
+		${libdir}/rpm/getpo.sh \
+		${libdir}/rpm/http.req \
+		${libdir}/rpm/javadeps.sh \
+		${libdir}/rpm/mono-find-provides \
+		${libdir}/rpm/mono-find-requires \
+		${libdir}/rpm/executabledeps.sh \
+		${libdir}/rpm/libtooldeps.sh \
+		${libdir}/rpm/osgideps.pl \
+		${libdir}/rpm/perldeps.pl \
+		${libdir}/rpm/perl.prov \
+		${libdir}/rpm/perl.req \
+		${libdir}/rpm/php.prov \
+		${libdir}/rpm/php.req \
+		${libdir}/rpm/pkgconfigdeps.sh \
+		${libdir}/rpm/pythondeps.sh \
+		${libdir}/rpm/bin/debugedit \
+		${libdir}/rpm/bin/debugedit.real \
+		${libdir}/rpm/bin/rpmcache \
+		${libdir}/rpm/bin/rpmcache.real \
+		${libdir}/rpm/bin/rpmcmp \
+		${libdir}/rpm/bin/rpmcmp.real \
+		${libdir}/rpm/bin/rpmdeps \
+		${libdir}/rpm/bin/rpmdeps.real \
+		${libdir}/rpm/bin/rpmdeps-oecore \
+		${libdir}/rpm/bin/rpmdeps-oecore.real \
+		${libdir}/rpm/bin/rpmdigest \
+		${libdir}/rpm/bin/rpmdigest.real \
+		${libdir}/rpm/bin/abi-compliance-checker.pl \
+		${libdir}/rpm/bin/api-sanity-autotest.pl \
+		${libdir}/rpm/bin/chroot \
+		${libdir}/rpm/bin/cp \
+		${libdir}/rpm/bin/dbsql \
+		${libdir}/rpm/bin/find \
+		${libdir}/rpm/bin/install-sh \
+		${libdir}/rpm/bin/lua \
+		${libdir}/rpm/bin/luac \
+		${libdir}/rpm/bin/mkinstalldirs \
+		${libdir}/rpm/bin/rpmlua \
+		${libdir}/rpm/bin/rpmluac \
+		${libdir}/rpm/bin/sqlite3 \
+		${libdir}/rpm/macros.d/cmake \
+		${libdir}/rpm/macros.d/java \
+		${libdir}/rpm/macros.d/libtool \
+		${libdir}/rpm/macros.d/mandriva \
+		${libdir}/rpm/macros.d/mono \
+		${libdir}/rpm/macros.d/perl \
+		${libdir}/rpm/macros.d/php \
+		${libdir}/rpm/macros.d/pkgconfig \
+		${libdir}/rpm/macros.d/python \
+		${libdir}/rpm/macros.d/ruby \
+		${libdir}/rpm/macros.d/selinux \
+		${libdir}/rpm/macros.d/tcl \
+		${libdir}/rpm/macros.rpmbuild \
+		${libdir}/rpm/u_pkg.sh \
+		${libdir}/rpm/vpkg-provides.sh \
+		${libdir}/rpm/vpkg-provides2.sh \
+		${libdir}/rpm/perfile_rpmdeps.sh \
+		"
+RDEPENDS_${PN} = "base-files run-postinsts"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-build = "file bash perl"
+
+RDEPENDS_python-rpm = "${PN}"
+
+FILES_python-rpm = "${libdir}/python*/site-packages/rpm"
+PROVIDES += "python-rpm"
+
+FILES_perl-module-rpm = "${libdir}/perl/*/* \
+		"
+
+RDEPENDS_${PN}-dev += "bash"
+
+FILES_${PN}-dev = "${includedir}/rpm \
+		${libdir}/librpm.la \
+		${libdir}/librpm.so \
+		${libdir}/librpmconstant.la \
+		${libdir}/librpmconstant.so \
+		${libdir}/librpmdb.la \
+		${libdir}/librpmdb.so \
+		${libdir}/librpmio.la \
+		${libdir}/librpmio.so \
+		${libdir}/librpmmisc.la \
+		${libdir}/librpmmisc.so \
+		${libdir}/librpmbuild.la \
+		${libdir}/librpmbuild.so \
+		${libdir}/rpm/lib/liblua.la \
+		${libdir}/pkgconfig/rpm.pc \
+		${libdir}/rpm/rpmdb_loadcvt \
+		"
+
+FILES_${PN}-staticdev = " \
+		${libdir}/librpm.a \
+		${libdir}/librpmconstant.a \
+		${libdir}/librpmdb.a \
+		${libdir}/librpmio.a \
+		${libdir}/librpmmisc.a \
+		${libdir}/librpmbuild.a \
+		${libdir}/rpm/lib/liblua.a \
+		${libdir}/python*/site-packages/rpm/*.a \
+		"
+
+do_configure() {
+	# Disable tests!
+	echo "all:" > ${S}/tests/Makefile.am
+	sed -e 's/@__MKDIR_P@/%{__mkdir} -p/' -i ${S}/macros/macros.in
+
+	( cd ${S}; ${S}/autogen.sh )
+
+	# NASTY hack to make sure configure files the right pkg-config file...
+	sed -e 's/pkg-config --exists uuid/pkg-config --exists ossp-uuid/g' \
+	    -e 's/pkg-config uuid/pkg-config ossp-uuid/g' -i ${S}/configure
+
+	( cd ${S}/syck ; set +e ; rm -- -l* ; make distclean ) || :
+
+	export varprefix=${localstatedir}
+	oe_runconf
+}
+
+do_install_append() {
+	sed -i -e 's,%__scriptlet_requires,#%%__scriptlet_requires,' ${D}/${libdir}/rpm/macros
+	sed -i -e 's,%__perl_provides,#%%__perl_provides,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
+	sed -i -e 's,%__perl_requires,#%%__perl_requires,' ${D}/${libdir}/rpm/macros ${D}/${libdir}/rpm/macros.d/*
+	sed -i -e 's,%_repackage_all_erasures[^_].*,%_repackage_all_erasures 0,' ${D}/${libdir}/rpm/macros
+	sed -i -e 's,^#%_openall_before_chroot.*,%_openall_before_chroot\t1,' ${D}/${libdir}/rpm/macros
+
+	# Enable Debian style arbitrary tags...
+	sed -i -e 's,%_arbitrary_tags[^_].*,%_arbitrary_tags %{_arbitrary_tags_debian},' ${D}/${libdir}/rpm/macros
+
+	install -m 0755 ${WORKDIR}/pythondeps.sh ${D}/${libdir}/rpm/pythondeps.sh
+	install -m 0755 ${WORKDIR}/perfile_rpmdeps.sh ${D}/${libdir}/rpm/perfile_rpmdeps.sh
+
+	# Remove unpackaged files (based on list in rpm.spec)
+	rm -f ${D}/${libdir}/rpm/{Specfile.pm,cpanflute,cpanflute2,rpmdiff,rpmdiff.cgi,sql.prov,sql.req,tcl.req,trpm}
+
+	rm -f ${D}/${mandir}/man8/rpmcache.8*
+	rm -f ${D}/${mandir}/man8/rpmgraph.8*
+	rm -f ${D}/${mandir}/*/man8/rpmcache.8*
+	rm -f ${D}/${mandir}/*/man8/rpmgraph.8*
+	rm -rf ${D}/${mandir}/{fr,ko}
+
+	rm -f ${D}/${includedir}/popt.h
+	rm -f ${D}/${libdir}/libpopt.*
+	rm -f ${D}/${libdir}/pkgconfig/popt.pc
+	rm -f ${D}/${datadir}/locale/*/LC_MESSAGES/popt.mo
+	rm -f ${D}/${mandir}/man3/popt.3
+
+	rm -f ${D}/${mandir}/man1/xar.1*
+	rm -f ${D}/${bindir}/xar
+	rm -rf ${D}/${includedir}/xar
+	rm -f ${D}/${libdir}/libxar*
+
+	rm -f ${D}/${bindir}/lz*
+	rm -f ${D}/${bindir}/unlzma
+	rm -f ${D}/${bindir}/unxz
+	rm -f ${D}/${bindir}/xz*
+	rm -rf ${D}/${includedir}/lzma*
+	rm -f ${D}/${mandir}/man1/lz*.1
+	rm -f ${D}/${libdir}/pkgconfig/liblzma*
+
+	rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/*.{a,la}
+	rm -f ${D}/${libdir}/python%{with_python_version}/site-packages/rpm/*.{a,la}
+
+	#find ${D}/${libdir}/perl5 -type f -a \( -name perllocal.pod -o -name .packlist \
+	#	-o \( -name '*.bs' -a -empty \) \) -exec rm -f {} ';'
+	#find ${D}/${libdir}/perl5 -type d -depth -exec rmdir {} 2>/dev/null ';'
+
+	# We don't want the default macro set
+	rm -rf ${D}/${libdir}/rpm/{i[3456]86*,athlon*,pentium*,x86_64*,alpha*,sparc*,ia64*,ppc*,s390*,armv[34][lb]*,armv[345]*,mips*,noarch*}
+
+	rm -f ${D}/${libdir}/rpm/dbconvert.sh
+
+	rm -f ${D}/${libdir}/rpm/libsqldb.*
+
+	# We don't want, nor need the Mandriva multiarch items
+	rm -f ${D}/${bindir}/multiarch-dispatch
+	rm -f ${D}/${bindir}/multiarch-platform
+	rm -f ${D}/${libdir}/rpm/check-multiarch-files
+	rm -f ${D}/${libdir}/rpm/mkmultiarch
+	rm -f ${D}/${includedir}/multiarch-dispatch.h
+
+	rm -f ${D}/${libdir}/rpm/gstreamer.sh
+	rm -f ${D}/${libdir}/rpm/gem_helper.rb
+	rm -f ${D}/${libdir}/rpm/rubygems.rb
+	rm -f ${D}/${libdir}/rpm/kmod-deps.sh
+	rm -f ${D}/${libdir}/rpm/pythoneggs.py
+	rm -f ${D}/${libdir}/rpm/macros.d/kernel
+	rm -f ${D}/${libdir}/rpm/macros.d/gstreamer
+	rm -f ${D}/${libdir}/rpm/bin/mgo
+	rm -f ${D}/${libdir}/rpm/bin/dbconvert
+	rm -f ${D}/${libdir}/rpm/bin/pom2spec
+
+	rm -rf ${D}/var/lib/wdj ${D}/var/cache/wdj
+	rm -f ${D}/${libdir}/rpm/bin/api-sanity-checker.pl
+
+}
+
+add_native_wrapper() {
+        create_wrapper ${D}/${bindir}/rpm \
+		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+        create_wrapper ${D}/${bindir}/rpm2cpio \
+		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+        create_wrapper ${D}/${bindir}/rpmbuild \
+		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+        create_wrapper ${D}/${bindir}/rpmconstant \
+		RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+		RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+		RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+
+	for rpm_binary in ${D}/${libdir}/rpm/bin/rpm* ${D}/${libdir}/rpm/bin/debugedit; do
+        	create_wrapper $rpm_binary \
+			RPM_USRLIBRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('libdir', True), d.getVar('bindir', True))}/rpm \
+			RPM_ETCRPM='$'{RPM_ETCRPM-'`dirname $''realpath`'/${@os.path.relpath(d.getVar('sysconfdir', True), d.getVar('bindir', True))}/rpm} \
+			RPM_LOCALEDIRRPM='`dirname $''realpath`'/${@os.path.relpath(d.getVar('datadir', True), d.getVar('bindir', True))}/locale
+	done
+}
+
+do_install_append_class-native() {
+	add_native_wrapper
+}
+
+do_install_append_class-nativesdk() {
+	add_native_wrapper
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c b/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
new file mode 100644
index 0000000..7f4caf9
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpmresolve/rpmresolve.c
@@ -0,0 +1,424 @@
+/* OpenEmbedded RPM resolver utility
+
+  Written by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+  Copyright 2012 Intel Corporation
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License version 2 as
+  published by the Free Software Foundation.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License along
+  with this program; if not, write to the Free Software Foundation, Inc.,
+  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+*/
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+#include <rpmdb.h>
+#include <rpmtypes.h>
+#include <rpmtag.h>
+#include <rpmts.h>
+#include <rpmmacro.h>
+#include <rpmcb.h>
+#include <rpmlog.h>
+#include <argv.h>
+#include <mire.h>
+
+int debugmode;
+FILE *outf;
+
+int getPackageStr(rpmts ts, const char *NVRA, rpmTag tag, char **value)
+{
+    int rc = -1;
+    rpmmi mi = rpmtsInitIterator(ts, RPMTAG_NVRA, NVRA, 0);
+    Header h;
+    if ((h = rpmmiNext(mi)) != NULL) {
+        HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he));
+        he->tag = tag;
+        rc = (headerGet(h, he, 0) != 1);
+        if(rc==0)
+            *value = strdup((char *)he->p.ptr);
+    }
+    (void)rpmmiFree(mi);
+    return rc;
+}
+
+int loadTs(rpmts **ts, int *tsct, const char *dblistfn)
+{
+    int count = 0;
+    int sz = 5;
+    int rc = 0;
+    int listfile = 1;
+    struct stat st_buf;
+
+    rc = stat(dblistfn, &st_buf);
+    if(rc != 0) {
+        perror("stat");
+        return 1;
+    }
+    if(S_ISDIR(st_buf.st_mode))
+        listfile = 0;
+
+    if(listfile) {
+        if(debugmode)
+            printf("DEBUG: reading database list file '%s'\n", dblistfn);
+        *ts = malloc(sz * sizeof(rpmts));
+        FILE *f = fopen(dblistfn, "r" );
+        if(f) {
+            char line[2048];
+            while(fgets(line, sizeof(line), f)) {
+                int len = strlen(line) - 1;
+                if(len > 0)
+                    // Trim trailing whitespace
+                    while(len > 0 && isspace(line[len]))
+                        line[len--] = '\0';
+
+                if(len > 0) {
+                    // Expand array if needed
+                    if(count == sz) {
+                        sz += 5;
+                        *ts = (rpmts *)realloc(*ts, sz);
+                    }
+
+                    if(debugmode)
+                        printf("DEBUG: opening database '%s'\n", line);
+                    char *dbpathm = malloc(strlen(line) + 10);
+                    sprintf(dbpathm, "_dbpath %s", line);
+                    rpmDefineMacro(NULL, dbpathm, RMIL_CMDLINE);
+                    free(dbpathm);
+
+                    rpmts tsi = rpmtsCreate();
+                    (*ts)[count] = tsi;
+                    rc = rpmtsOpenDB(tsi, O_RDONLY);
+                    if( rc ) {
+                        fprintf(stderr, "Failed to open database %s\n", line);
+                        rc = -1;
+                        break;
+                    }
+
+                    count++;
+                }
+            }
+            fclose(f);
+            *tsct = count;
+        }
+        else {
+            perror(dblistfn);
+            rc = -1;
+        }
+    }
+    else {
+        if(debugmode)
+            printf("DEBUG: opening database '%s'\n", dblistfn);
+        // Load from single database
+        *ts = malloc(sizeof(rpmts));
+        char *dbpathm = malloc(strlen(dblistfn) + 10);
+        sprintf(dbpathm, "_dbpath %s", dblistfn);
+        rpmDefineMacro(NULL, dbpathm, RMIL_CMDLINE);
+        free(dbpathm);
+
+        rpmts tsi = rpmtsCreate();
+        (*ts)[0] = tsi;
+        rc = rpmtsOpenDB(tsi, O_RDONLY);
+        if( rc ) {
+            fprintf(stderr, "Failed to open database %s\n", dblistfn);
+            rc = -1;
+        }
+        *tsct = 1;
+    }
+
+    return rc;
+}
+
+int processPackages(rpmts *ts, int tscount, const char *packagelistfn, int ignoremissing)
+{
+    int rc = 0;
+    int count = 0;
+    int sz = 100;
+    int i = 0;
+    int missing = 0;
+
+    FILE *f = fopen(packagelistfn, "r" );
+    if(f) {
+        char line[255];
+        while(fgets(line, sizeof(line), f)) {
+            int len = strlen(line) - 1;
+            if(len > 0)
+                // Trim trailing whitespace
+                while(len > 0 && isspace(line[len]))
+                    line[len--] = '\0';
+
+            if(len > 0) {
+                int found = 0;
+                for(i=0; i<tscount; i++) {
+                    ARGV_t keys = NULL;
+                    rpmdb db = rpmtsGetRdb(ts[i]);
+                    rc = rpmdbMireApply(db, RPMTAG_NAME,
+                                RPMMIRE_STRCMP, line, &keys);
+                    if (keys) {
+                        int nkeys = argvCount(keys);
+                        if( nkeys == 1 ) {
+                            char *value = NULL;
+                            rc = getPackageStr(ts[i], keys[0], RPMTAG_PACKAGEORIGIN, &value);
+                            if(rc == 0)
+                                fprintf(outf, "%s\n", value);
+                            else
+                                fprintf(stderr, "Failed to get package origin for %s\n", line);
+                            found = 1;
+                        }
+                        else if( nkeys > 1 ) {
+                            int keyindex = 0;
+                            fprintf(stderr, "Multiple matches for %s:\n", line);
+                            for( keyindex=0; keyindex<nkeys; keyindex++) {
+                                char *value = NULL;
+                                rc = getPackageStr(ts[i], keys[keyindex], RPMTAG_PACKAGEORIGIN, &value);
+                                if(rc == 0)
+                                    fprintf(stderr, "  %s\n", value);
+                                else
+                                    fprintf(stderr, "  (%s)\n", keys[keyindex]);
+                            }
+                        }
+                    }
+                    if(found)
+                        break;
+                }
+
+                if( !found ) {
+                    if( ignoremissing ) {
+                        fprintf(stderr, "Unable to resolve package %s - ignoring\n", line);
+                    }
+                    else {
+                        fprintf(stderr, "Unable to resolve package %s\n", line);
+                        missing = 1;
+                    }
+                }
+            }
+            count++;
+        }
+        fclose(f);
+
+        if( missing ) {
+            fprintf(stderr, "ERROR: some packages were missing\n");
+            rc = 1;
+        }
+    }
+    else {
+        perror(packagelistfn);
+        rc = -1;
+    }
+
+    return rc;
+}
+
+int lookupProvider(rpmts ts, const char *req, char **provider)
+{
+    int rc = 0;
+    rpmmi provmi = rpmtsInitIterator(ts, RPMTAG_PROVIDENAME, req, 0);
+    if(provmi) {
+        Header h;
+        if ((h = rpmmiNext(provmi)) != NULL) {
+            HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he));
+            he->tag = RPMTAG_NAME;
+            rc = (headerGet(h, he, 0) != 1);
+            if(rc==0)
+                *provider = strdup((char *)he->p.ptr);
+        }
+        (void)rpmmiFree(provmi);
+    }
+    else {
+        rc = -1;
+    }
+    return rc;
+}
+
+int printDepList(rpmts *ts, int tscount)
+{
+    int rc = 0;
+
+    if( tscount > 1 )
+        fprintf(stderr, ">1 database specified with dependency list, using first only\n");
+
+    /* Get list of names */
+    rpmdb db = rpmtsGetRdb(ts[0]);
+    ARGV_t names = NULL;
+    rc = rpmdbMireApply(db, RPMTAG_NAME,
+                RPMMIRE_STRCMP, NULL, &names);
+    int nnames = argvCount(names);
+
+    /* Get list of NVRAs */
+    ARGV_t keys = NULL;
+    rc = rpmdbMireApply(db, RPMTAG_NVRA,
+                RPMMIRE_STRCMP, NULL, &keys);
+    if (keys) {
+        int i, j;
+        HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he));
+        int nkeys = argvCount(keys);
+        for(i=0; i<nkeys; i++) {
+            rpmmi mi = rpmtsInitIterator(ts[0], RPMTAG_NVRA, keys[i], 0);
+            Header h;
+            if ((h = rpmmiNext(mi)) != NULL) {
+                /* Get name of package */
+                he->tag = RPMTAG_NAME;
+                rc = (headerGet(h, he, 0) != 1);
+                char *name = strdup((char *)he->p.ptr);
+                /* Get its requires */
+                he->tag = RPMTAG_REQUIRENAME;
+                if (rc = (headerGet(h, he, 0) != 1)) {
+                    if (debugmode) {
+                        printf("DEBUG: %s requires null\n", name);
+                    }
+                    rc = 0;
+                    continue;
+                }
+                ARGV_t reqs = (ARGV_t)he->p.ptr;
+                /* Get its requireflags */
+                he->tag = RPMTAG_REQUIREFLAGS;
+                rc = (headerGet(h, he, 0) != 1);
+                rpmuint32_t *reqflags = (rpmuint32_t *)he->p.ui32p;
+                for(j=0; j<he->c; j++) {
+                    int k;
+                    char *prov = NULL;
+                    for(k=0; k<nnames; k++) {
+                        if(strcmp(names[k], reqs[j]) == 0) {
+                            prov = names[k];
+                            break;
+                        }
+                    }
+                    if(prov) {
+                        if((int)reqflags[j] & 0x80000)
+                            fprintf(outf, "%s|%s [REC]\n", name, prov);
+                        else
+                            fprintf(outf, "%s|%s\n", name, prov);
+                    }
+                    else {
+                        rc = lookupProvider(ts[0], reqs[j], &prov);
+                        if(rc==0 && prov) {
+                            if((int)reqflags[j] & 0x80000)
+                                fprintf(outf, "%s|%s [REC]\n", name, prov);
+                            else
+                                fprintf(outf, "%s|%s\n", name, prov);
+                            free(prov);
+                        }
+                    }
+                }
+                free(name);
+            }
+            (void)rpmmiFree(mi);
+        }
+    }
+
+    return rc;
+}
+
+void usage()
+{
+    fprintf(stderr, "OpenEmbedded rpm resolver utility\n");
+    fprintf(stderr, "syntax: rpmresolve [-i] [-d] [-t] <dblistfile> <packagelistfile>\n");
+}
+
+int main(int argc, char **argv)
+{
+    rpmts *ts = NULL;
+    int tscount = 0;
+    int rc = 0;
+    int i;
+    int c;
+    int ignoremissing = 0;
+    int deplistmode = 0;
+    char *outfile = NULL;
+
+    debugmode = 0;
+    outf = stdout;
+
+    opterr = 0;
+    while ((c = getopt (argc, argv, "itdo:")) != -1) {
+        switch (c) {
+            case 'i':
+                ignoremissing = 1;
+                break;
+            case 't':
+                deplistmode = 1;
+                break;
+            case 'd':
+                debugmode = 1;
+                break;
+            case 'o':
+                outfile = strdup(optarg);
+                break;
+            case '?':
+                if(isprint(optopt))
+                    fprintf(stderr, "Unknown option `-%c'.\n", optopt);
+                else
+                    fprintf(stderr, "Unknown option character `\\x%x'.\n",
+                        optopt);
+                usage();
+                return 1;
+            default:
+                abort();
+        }
+    }
+
+    if( argc - optind < 1 ) {
+        usage();
+        return 1;
+    }
+
+    if( outfile ) {
+        if(debugmode)
+            printf("DEBUG: Using output file %s\n", outfile);
+        outf = fopen(outfile, "w");
+    }
+
+    const char *dblistfn = argv[optind];
+
+    rpmcliInit(argc, argv, NULL);
+
+    if(debugmode)
+        rpmSetVerbosity(RPMLOG_DEBUG);
+
+    rpmDefineMacro(NULL, "__dbi_txn create nofsync", RMIL_CMDLINE);
+
+    rc = loadTs(&ts, &tscount, dblistfn);
+    if( rc )
+        return 1;
+    if( tscount == 0 ) {
+        fprintf(stderr, "Please specify database list file or database location\n");
+        return 1;
+    }
+
+    if(deplistmode) {
+        rc = printDepList(ts, tscount);
+    }
+    else {
+        if( argc - optind < 2 ) {
+            fprintf(stderr, "Please specify package list file\n");
+        }
+        else {
+            const char *pkglistfn = argv[optind+1];
+            rc = processPackages(ts, tscount, pkglistfn, ignoremissing);
+        }
+    }
+
+    for(i=0; i<tscount; i++)
+        (void) rpmtsCloseDB(ts[i]);
+    free(ts);
+
+    if( outfile ) {
+        fclose(outf);
+        free(outfile);
+    }
+
+    return rc;
+}
diff --git a/meta/recipes-devtools/rpm/rpmresolve_1.0.bb b/meta/recipes-devtools/rpm/rpmresolve_1.0.bb
new file mode 100644
index 0000000..04a55fd
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpmresolve_1.0.bb
@@ -0,0 +1,29 @@
+SUMMARY = "OpenEmbedded RPM resolver utility"
+DESCRIPTION = "OpenEmbedded RPM resolver - performs RPM database lookups in batches to avoid \
+ repeated invocations of rpm on the command line."
+DEPENDS = "rpm"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+PR = "r2"
+
+SRC_URI = "file://rpmresolve.c"
+
+S = "${WORKDIR}"
+
+do_compile() {
+	${CC} ${CFLAGS} -ggdb -I${STAGING_INCDIR}/rpm ${LDFLAGS} rpmresolve.c -o rpmresolve -lrpmbuild -lrpm -lrpmio -lrpmdb -lpopt
+}
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 rpmresolve ${D}${bindir}
+}
+
+do_install_append_class-native() {
+	create_wrapper ${D}/${bindir}/rpmresolve \
+			RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
+			RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
+			RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/rsync/files/acinclude.m4 b/meta/recipes-devtools/rsync/files/acinclude.m4
new file mode 100644
index 0000000..735b41d
--- /dev/null
+++ b/meta/recipes-devtools/rsync/files/acinclude.m4
@@ -0,0 +1,95 @@
+dnl verbatim renamed from aclocal.m4 in rsync_3.0.7
+dnl 07/06/2010 - qhe
+
+dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
+dnl if the cache file is inconsistent with the current host,
+dnl target and build system types, execute CMD or print a default
+dnl error message.
+AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
+    AC_REQUIRE([AC_CANONICAL_SYSTEM])
+    AC_MSG_CHECKING([config.cache system type])
+    if { test x"${ac_cv_host_system_type+set}" = x"set" &&
+         test x"$ac_cv_host_system_type" != x"$host"; } ||
+       { test x"${ac_cv_build_system_type+set}" = x"set" &&
+         test x"$ac_cv_build_system_type" != x"$build"; } ||
+       { test x"${ac_cv_target_system_type+set}" = x"set" &&
+         test x"$ac_cv_target_system_type" != x"$target"; }; then
+	AC_MSG_RESULT([different])
+	ifelse($#, 1, [$1],
+		[AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
+    else
+	AC_MSG_RESULT([same])
+    fi
+    ac_cv_host_system_type="$host"
+    ac_cv_build_system_type="$build"
+    ac_cv_target_system_type="$target"
+])
+
+dnl Check for socklen_t: historically on BSD it is an int, and in
+dnl POSIX 1g it is a type of its own, but some platforms use different
+dnl types for the argument to getsockopt, getpeername, etc.  So we
+dnl have to test to find something that will work.
+
+dnl This is no good, because passing the wrong pointer on C compilers is
+dnl likely to only generate a warning, not an error.  We don't call this at
+dnl the moment.
+
+AC_DEFUN([TYPE_SOCKLEN_T],
+[
+   AC_CHECK_TYPE([socklen_t], ,[
+      AC_MSG_CHECKING([for socklen_t equivalent])
+      AC_CACHE_VAL([rsync_cv_socklen_t_equiv],
+      [
+         # Systems have either "struct sockaddr *" or
+         # "void *" as the second argument to getpeername
+         rsync_cv_socklen_t_equiv=
+         for arg2 in "struct sockaddr" void; do
+            for t in int size_t unsigned long "unsigned long"; do
+               AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+
+                  int getpeername (int, $arg2 *, $t *);
+               ],[
+                  $t len;
+                  getpeername(0,0,&len);
+               ],[
+                  rsync_cv_socklen_t_equiv="$t"
+                  break
+               ])
+            done
+         done
+
+         if test "x$rsync_cv_socklen_t_equiv" = x; then
+            AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+         fi
+      ])
+      AC_MSG_RESULT($rsync_cv_socklen_t_equiv)
+      AC_DEFINE_UNQUOTED(socklen_t, $rsync_cv_socklen_t_equiv,
+			[type to use in place of socklen_t if not defined])],
+      [#include <sys/types.h>
+#include <sys/socket.h>])
+])
+
+dnl AC_HAVE_TYPE(TYPE,INCLUDES)
+AC_DEFUN([AC_HAVE_TYPE], [
+AC_REQUIRE([AC_HEADER_STDC])
+cv=`echo "$1" | sed 'y%./+- %__p__%'`
+AC_MSG_CHECKING(for $1)
+AC_CACHE_VAL([ac_cv_type_$cv],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+AC_INCLUDES_DEFAULT
+$2]],
+[[$1 foo;]])],
+[eval "ac_cv_type_$cv=yes"],
+[eval "ac_cv_type_$cv=no"]))dnl
+ac_foo=`eval echo \\$ac_cv_type_$cv`
+AC_MSG_RESULT($ac_foo)
+if test "$ac_foo" = yes; then
+  ac_tr_hdr=HAVE_`echo $1 | sed 'y%abcdefghijklmnopqrstuvwxyz./- %ABCDEFGHIJKLMNOPQRSTUVWXYZ____%'`
+if false; then
+	AC_CHECK_TYPES($1)
+fi
+  AC_DEFINE_UNQUOTED($ac_tr_hdr, 1, [Define if you have type `$1'])
+fi
+])
diff --git a/meta/recipes-devtools/rsync/files/rsyncd.conf b/meta/recipes-devtools/rsync/files/rsyncd.conf
new file mode 100644
index 0000000..845f5b3
--- /dev/null
+++ b/meta/recipes-devtools/rsync/files/rsyncd.conf
@@ -0,0 +1,15 @@
+# /etc/rsyncd.conf
+
+# Minimal configuration file for rsync daemon
+# See rsync(1) and rsyncd.conf(5) man pages for help
+
+# This file is required by rsync --daemon
+pid file = /var/run/rsyncd.pid
+use chroot = yes
+read only = yes
+
+# Simple example for enabling your own local rsync server
+#[everything]
+#	path = /
+#	comment = Everything except /etc exposed
+#	exclude = /etc
diff --git a/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch b/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch
new file mode 100644
index 0000000..f054452
--- /dev/null
+++ b/meta/recipes-devtools/rsync/rsync-2.6.9/rsync-2.6.9-fname-obo.patch
@@ -0,0 +1,70 @@
+Upstream-Status: Backport [ The patch is rsync-2.6.9 specific ]
+
+The patch is from https://issues.rpath.com/browse/RPL-1647 and is used to
+address http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2007-4091
+
+Date:   Tue May 10 10:07:36 2011 +0800
+Dexuan Cui <dexuan.cui@intel.com>
+
+diff --git a/sender.c b/sender.c
+index 6fcaa65..053a8f1 100644
+--- a/sender.c
++++ b/sender.c
+@@ -123,6 +123,7 @@ void successful_send(int ndx)
+ 	char fname[MAXPATHLEN];
+ 	struct file_struct *file;
+ 	unsigned int offset;
++	size_t l = 0;
+ 
+ 	if (ndx < 0 || ndx >= the_file_list->count)
+ 		return;
+@@ -133,6 +134,20 @@ void successful_send(int ndx)
+ 				    file->dir.root, "/", NULL);
+ 	} else
+ 		offset = 0;
++
++	l = offset + 1;
++	if (file) {
++		if (file->dirname)
++			l += strlen(file->dirname);
++		if (file->basename)
++			l += strlen(file->basename);
++	}
++
++	if (l >= sizeof(fname)) {
++		rprintf(FERROR, "Overlong pathname\n");
++		exit_cleanup(RERR_FILESELECT);
++	}
++
+ 	f_name(file, fname + offset);
+ 	if (remove_source_files) {
+ 		if (do_unlink(fname) == 0) {
+@@ -224,6 +239,7 @@ void send_files(struct file_list *flist, int f_out, int f_in)
+ 	enum logcode log_code = log_before_transfer ? FLOG : FINFO;
+ 	int f_xfer = write_batch < 0 ? batch_fd : f_out;
+ 	int i, j;
++	size_t l = 0;
+ 
+ 	if (verbose > 2)
+ 		rprintf(FINFO, "send_files starting\n");
+@@ -259,6 +275,20 @@ void send_files(struct file_list *flist, int f_out, int f_in)
+ 				fname[offset++] = '/';
+ 		} else
+ 			offset = 0;
++
++		l = offset + 1;
++		if (file) {
++			if (file->dirname)
++				l += strlen(file->dirname);
++			if (file->basename)
++				l += strlen(file->basename);
++		}
++
++		if (l >= sizeof(fname)) {
++			rprintf(FERROR, "Overlong pathname\n");
++			exit_cleanup(RERR_FILESELECT);
++		}
++
+ 		fname2 = f_name(file, fname + offset);
+ 
+ 		if (verbose > 2)
diff --git a/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf b/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf
new file mode 100644
index 0000000..845f5b3
--- /dev/null
+++ b/meta/recipes-devtools/rsync/rsync-2.6.9/rsyncd.conf
@@ -0,0 +1,15 @@
+# /etc/rsyncd.conf
+
+# Minimal configuration file for rsync daemon
+# See rsync(1) and rsyncd.conf(5) man pages for help
+
+# This file is required by rsync --daemon
+pid file = /var/run/rsyncd.pid
+use chroot = yes
+read only = yes
+
+# Simple example for enabling your own local rsync server
+#[everything]
+#	path = /
+#	comment = Everything except /etc exposed
+#	exclude = /etc
diff --git a/meta/recipes-devtools/rsync/rsync-3.1.1/0001-Complain-if-an-inc-recursive-path-is-not-right-for-i.patch b/meta/recipes-devtools/rsync/rsync-3.1.1/0001-Complain-if-an-inc-recursive-path-is-not-right-for-i.patch
new file mode 100644
index 0000000..5ece542
--- /dev/null
+++ b/meta/recipes-devtools/rsync/rsync-3.1.1/0001-Complain-if-an-inc-recursive-path-is-not-right-for-i.patch
@@ -0,0 +1,135 @@
+From 962f8b90045ab331fc04c9e65f80f1a53e68243b Mon Sep 17 00:00:00 2001
+From: Wayne Davison <wayned@samba.org>
+Date: Wed, 31 Dec 2014 12:41:03 -0800
+Subject: [PATCH] Complain if an inc-recursive path is not right for its dir.
+ This ensures that a malicious sender can't use a just-sent symlink as a
+ trasnfer path.
+
+Upstream-Status: BackPort
+
+Fix the CVE-2014-9512, rsync 3.1.1 allows remote attackers to write to arbitrary
+files via a symlink attack on a file in the synchronization path.
+
+BackPort and fix this patch to make it able to apply to source code
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ flist.c | 22 ++++++++++++++++++++--
+ io.c    |  2 +-
+ main.c  |  4 ++--
+ rsync.c |  2 +-
+ proto.h | 2 +-
+ 6 files changed, 31 insertions(+), 8 deletions(-)
+
+diff --git a/flist.c b/flist.c
+index c24672e..92e4b65 100644
+--- a/flist.c
++++ b/flist.c
+@@ -2435,8 +2435,9 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
+ 	return flist;
+ }
+ 
+-struct file_list *recv_file_list(int f)
++struct file_list *recv_file_list(int f, int dir_ndx)
+ {
++	const char *good_dirname = NULL;
+ 	struct file_list *flist;
+ 	int dstart, flags;
+ 	int64 start_read;
+@@ -2492,6 +2493,23 @@ struct file_list *recv_file_list(int f)
+ 		flist_expand(flist, 1);
+ 		file = recv_file_entry(f, flist, flags);
+ 
++		if (inc_recurse) {
++			static const char empty_dir[] = "\0";
++			const char *cur_dir = file->dirname ? file->dirname : empty_dir;
++			if (relative_paths && *cur_dir == '/')
++				cur_dir++;
++			if (cur_dir != good_dirname) {
++				const char *d = dir_ndx >= 0 ? f_name(dir_flist->files[dir_ndx], NULL) : empty_dir;
++				if (strcmp(cur_dir, d) != 0) {
++					rprintf(FERROR,
++						"ABORTING due to invalid dir prefix from sender: %s (should be: %s)\n",
++						cur_dir, d);
++					exit_cleanup(RERR_PROTOCOL);
++				}
++				good_dirname = cur_dir;
++			}
++		}
++
+ 		if (S_ISREG(file->mode)) {
+ 			/* Already counted */
+ 		} else if (S_ISDIR(file->mode)) {
+@@ -2615,7 +2633,7 @@ void recv_additional_file_list(int f)
+ 			rprintf(FINFO, "[%s] receiving flist for dir %d\n",
+ 				who_am_i(), ndx);
+ 		}
+-		flist = recv_file_list(f);
++		flist = recv_file_list(f, ndx);
+ 		flist->parent_ndx = ndx;
+ 	}
+ }
+diff --git a/io.c b/io.c
+index b9a9bd0..a868fa9 100644
+--- a/io.c
++++ b/io.c
+@@ -1685,7 +1685,7 @@ void wait_for_receiver(void)
+ 				rprintf(FINFO, "[%s] receiving flist for dir %d\n",
+ 					who_am_i(), ndx);
+ 			}
+-			flist = recv_file_list(iobuf.in_fd);
++			flist = recv_file_list(iobuf.in_fd, ndx);
+ 			flist->parent_ndx = ndx;
+ #ifdef SUPPORT_HARD_LINKS
+ 			if (preserve_hard_links)
+diff --git a/main.c b/main.c
+index e7a13f7..713b818 100644
+--- a/main.c
++++ b/main.c
+@@ -1009,7 +1009,7 @@ static void do_server_recv(int f_in, int f_out, int argc, char *argv[])
+ 		filesfrom_fd = -1;
+ 	}
+ 
+-	flist = recv_file_list(f_in);
++	flist = recv_file_list(f_in, -1);
+ 	if (!flist) {
+ 		rprintf(FERROR,"server_recv: recv_file_list error\n");
+ 		exit_cleanup(RERR_FILESELECT);
+@@ -1183,7 +1183,7 @@ int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[])
+ 
+ 	if (write_batch && !am_server)
+ 		start_write_batch(f_in);
+-	flist = recv_file_list(f_in);
++	flist = recv_file_list(f_in, -1);
+ 	if (inc_recurse && file_total == 1)
+ 		recv_additional_file_list(f_in);
+ 
+diff --git a/rsync.c b/rsync.c
+index 68ff6b1..c3ecc51 100644
+--- a/rsync.c
++++ b/rsync.c
+@@ -364,7 +364,7 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr,
+ 		}
+ 		/* Send all the data we read for this flist to the generator. */
+ 		start_flist_forward(ndx);
+-		flist = recv_file_list(f_in);
++		flist = recv_file_list(f_in, ndx);
+ 		flist->parent_ndx = ndx;
+ 		stop_flist_forward();
+ 	}
+diff --git a/proto.h b/proto.h
+index 22fc539..247c558 100644
+--- a/proto.h
++++ b/proto.h
+@@ -89,7 +89,7 @@ struct file_struct *make_file(const char *fname, struct file_list *flist,
+ void unmake_file(struct file_struct *file);
+ void send_extra_file_list(int f, int at_least);
+ struct file_list *send_file_list(int f, int argc, char *argv[]);
+-struct file_list *recv_file_list(int f);
++struct file_list *recv_file_list(int f, int dir_ndx);
+ void recv_additional_file_list(int f);
+ int flist_find(struct file_list *flist, struct file_struct *f);
+ int flist_find_ignore_dirness(struct file_list *flist, struct file_struct *f);
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/rsync/rsync-3.1.1/rsync.git-eac858085.patch b/meta/recipes-devtools/rsync/rsync-3.1.1/rsync.git-eac858085.patch
new file mode 100644
index 0000000..1fcac49
--- /dev/null
+++ b/meta/recipes-devtools/rsync/rsync-3.1.1/rsync.git-eac858085.patch
@@ -0,0 +1,101 @@
+From eac858085e3ac94ec0ab5061d11f52652c90a869 Mon Sep 17 00:00:00 2001
+From: Wayne Davison <wayned@samba.org>
+Date: Mon, 11 May 2015 12:36:20 -0700
+Subject: [PATCH 1/1] Add compat flag to allow proper seed checksum order.
+ Fixes the equivalent of librsync's CVE-2014-8242 issue.
+
+Upstream-Status: Backport
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ checksum.c | 17 +++++++++++++----
+ compat.c   |  5 +++++
+ options.c  |  1 +
+ 3 files changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/checksum.c b/checksum.c
+index a1c2aa2..933b514 100644
+--- a/checksum.c
++++ b/checksum.c
+@@ -23,6 +23,7 @@
+ 
+ extern int checksum_seed;
+ extern int protocol_version;
++extern int proper_seed_order;
+ 
+ /*
+   a simple 32 bit checksum that can be upadted from either end
+@@ -54,10 +55,18 @@ void get_checksum2(char *buf, int32 len, char *sum)
+ 	if (protocol_version >= 30) {
+ 		uchar seedbuf[4];
+ 		md5_begin(&m);
+-		md5_update(&m, (uchar *)buf, len);
+-		if (checksum_seed) {
+-			SIVALu(seedbuf, 0, checksum_seed);
+-			md5_update(&m, seedbuf, 4);
++		if (proper_seed_order) {
++			if (checksum_seed) {
++				SIVALu(seedbuf, 0, checksum_seed);
++				md5_update(&m, seedbuf, 4);
++			}
++			md5_update(&m, (uchar *)buf, len);
++		} else {
++			md5_update(&m, (uchar *)buf, len);
++			if (checksum_seed) {
++				SIVALu(seedbuf, 0, checksum_seed);
++				md5_update(&m, seedbuf, 4);
++			}
+ 		}
+ 		md5_result(&m, (uchar *)sum);
+ 	} else {
+diff --git a/compat.c b/compat.c
+index 2454937..f89d466 100644
+--- a/compat.c
++++ b/compat.c
+@@ -27,6 +27,7 @@ int inc_recurse = 0;
+ int compat_flags = 0;
+ int use_safe_inc_flist = 0;
+ int want_xattr_optim = 0;
++int proper_seed_order = 0;
+ 
+ extern int am_server;
+ extern int am_sender;
+@@ -78,6 +79,7 @@ int filesfrom_convert = 0;
+ #define CF_SYMLINK_ICONV (1<<2)
+ #define CF_SAFE_FLIST	 (1<<3)
+ #define CF_AVOID_XATTR_OPTIM (1<<4)
++#define CF_CHKSUM_SEED_FIX (1<<5)
+ 
+ static const char *client_info;
+ 
+@@ -271,12 +273,15 @@ void setup_protocol(int f_out,int f_in)
+ 				compat_flags |= CF_SAFE_FLIST;
+ 			if (local_server || strchr(client_info, 'x') != NULL)
+ 				compat_flags |= CF_AVOID_XATTR_OPTIM;
++			if (local_server || strchr(client_info, 'C') != NULL)
++				compat_flags |= CF_CHKSUM_SEED_FIX;
+ 			write_byte(f_out, compat_flags);
+ 		} else
+ 			compat_flags = read_byte(f_in);
+ 		/* The inc_recurse var MUST be set to 0 or 1. */
+ 		inc_recurse = compat_flags & CF_INC_RECURSE ? 1 : 0;
+ 		want_xattr_optim = protocol_version >= 31 && !(compat_flags & CF_AVOID_XATTR_OPTIM);
++		proper_seed_order = compat_flags & CF_CHKSUM_SEED_FIX ? 1 : 0;
+ 		if (am_sender) {
+ 			receiver_symlink_times = am_server
+ 			    ? strchr(client_info, 'L') != NULL
+diff --git a/options.c b/options.c
+index 19c2b7d..4128b59 100644
+--- a/options.c
++++ b/options.c
+@@ -2503,6 +2503,7 @@ void server_options(char **args, int *argc_p)
+ #endif
+ 		argstr[x++] = 'f'; /* flist I/O-error safety support */
+ 		argstr[x++] = 'x'; /* xattr hardlink optimization not desired */
++		argstr[x++] = 'C'; /* support checksum seed order fix */
+ 	}
+ 
+ 	if (x >= (int)sizeof argstr) { /* Not possible... */
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/rsync/rsync.inc b/meta/recipes-devtools/rsync/rsync.inc
new file mode 100644
index 0000000..c65f270
--- /dev/null
+++ b/meta/recipes-devtools/rsync/rsync.inc
@@ -0,0 +1,23 @@
+SUMMARY = "File synchronization tool"
+HOMEPAGE = "http://rsync.samba.org/"
+BUGTRACKER = "http://rsync.samba.org/bugzilla.html"
+SECTION = "console/network"
+
+# GPLv2+ (<< 3.0.0), GPLv3+ (>= 3.0.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+# needs to add acl and attr
+DEPENDS = "popt"
+
+SRC_URI = "http://rsync.samba.org/ftp/rsync/src/rsync-${PV}.tar.gz \
+           file://rsyncd.conf"
+
+inherit autotools
+
+do_install_append() {
+	install -d ${D}${sysconfdir}
+	install -m 0644 ${WORKDIR}/rsyncd.conf ${D}${sysconfdir}
+}
+
+EXTRA_OEMAKE='STRIP=""'
diff --git a/meta/recipes-devtools/rsync/rsync_2.6.9.bb b/meta/recipes-devtools/rsync/rsync_2.6.9.bb
new file mode 100644
index 0000000..6854c77
--- /dev/null
+++ b/meta/recipes-devtools/rsync/rsync_2.6.9.bb
@@ -0,0 +1,28 @@
+SUMMARY = "File synchronization tool"
+HOMEPAGE = "http://rsync.samba.org/"
+BUGTRACKER = "http://rsync.samba.org/bugzilla.html"
+SECTION = "console/network"
+
+# needs to add acl and attr
+DEPENDS = "popt"
+
+SRC_URI = "http://rsync.samba.org/ftp/rsync/src/rsync-${PV}.tar.gz \
+           file://rsync-2.6.9-fname-obo.patch \
+           file://rsyncd.conf"
+
+SRC_URI[md5sum] = "996d8d8831dbca17910094e56dcb5942"
+SRC_URI[sha256sum] = "ca437301becd890e73300bc69a39189ff1564baa761948ff149b3dd7bde633f9"
+
+inherit autotools
+
+do_install_append() {
+	install -d ${D}${sysconfdir}
+	install -m 0644 ${WORKDIR}/rsyncd.conf ${D}${sysconfdir}
+}
+
+EXTRA_OEMAKE='STRIP=""'
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6d5a9d4c4d3af25cd68fd83e8a8cb09c"
+
+PR = "r4"
diff --git a/meta/recipes-devtools/rsync/rsync_3.1.1.bb b/meta/recipes-devtools/rsync/rsync_3.1.1.bb
new file mode 100644
index 0000000..c74cdda
--- /dev/null
+++ b/meta/recipes-devtools/rsync/rsync_3.1.1.bb
@@ -0,0 +1,30 @@
+require rsync.inc
+
+
+SRC_URI += "file://acinclude.m4 \
+            file://0001-Complain-if-an-inc-recursive-path-is-not-right-for-i.patch \
+            file://rsync.git-eac858085.patch \
+"
+
+SRC_URI[md5sum] = "43bd6676f0b404326eee2d63be3cdcfe"
+SRC_URI[sha256sum] = "7de4364fcf5fe42f3bdb514417f1c40d10bbca896abe7e7f2c581c6ea08a2621"
+
+PACKAGECONFIG ??= "acl attr"
+PACKAGECONFIG[acl] = "--enable-acl-support,--disable-acl-support,acl,"
+PACKAGECONFIG[attr] = "--enable-xattr-support,--disable-xattr-support,attr,"
+
+# rsync 3.0 uses configure.sh instead of configure, and
+# makefile checks the existence of configure.sh
+do_configure_prepend () {
+	rm -f ${S}/configure ${S}/configure.sh
+	cp -f ${WORKDIR}/acinclude.m4 ${S}/
+
+	# By default, if crosscompiling, rsync disables a number of
+	# capabilities, hardlinking symlinks and special files (i.e. devices)
+	export rsync_cv_can_hardlink_special=yes
+	export rsync_cv_can_hardlink_symlink=yes
+}
+
+do_configure_append () {
+	cp -f ${S}/configure ${S}/configure.sh
+}
diff --git a/meta/recipes-devtools/ruby/ruby.inc b/meta/recipes-devtools/ruby/ruby.inc
new file mode 100644
index 0000000..17aa789
--- /dev/null
+++ b/meta/recipes-devtools/ruby/ruby.inc
@@ -0,0 +1,38 @@
+SUMMARY = "An interpreter of object-oriented scripting language"
+DESCRIPTION = "Ruby is an interpreted scripting language for quick \
+and easy object-oriented programming. It has many features to process \
+text files and to do system management tasks (as in Perl). \
+It is simple, straight-forward, and extensible. \
+"
+HOMEPAGE = "http://www.ruby-lang.org/"
+SECTION = "devel/ruby"
+LICENSE = "Ruby | BSD | GPLv2"
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=837b32593517ae48b9c3b5c87a5d288c \
+    file://BSDL;md5=19aaf65c88a40b508d17ae4be539c4b5\
+    file://GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263\
+    file://LEGAL;md5=c440adb575ba4e6e2344c2630b6a5584\
+"
+
+DEPENDS = "ruby-native zlib openssl tcl libyaml db gdbm readline"
+DEPENDS_class-native = "libyaml-native"
+
+SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "http://cache.ruby-lang.org/pub/ruby/${SHRT_VER}/ruby-${PV}.tar.gz \
+           file://extmk.patch \
+"
+
+inherit autotools
+
+
+# This snippet lets compiled extensions which rely on external libraries,
+# such as zlib, compile properly.  If we don't do this, then when extmk.rb
+# runs, it uses the native libraries instead of the target libraries, and so
+# none of the linking operations succeed -- which makes extconf.rb think
+# that the libraries aren't available and hence that the extension can't be
+# built.
+
+do_configure_prepend() {
+    sed -i "s#%%TARGET_CFLAGS%%#$TARGET_CFLAGS#; s#%%TARGET_LDFLAGS%%#$TARGET_LDFLAGS#" ${S}/common.mk
+    rm -rf ${S}/ruby/
+}
diff --git a/meta/recipes-devtools/ruby/ruby/extmk.patch b/meta/recipes-devtools/ruby/ruby/extmk.patch
new file mode 100644
index 0000000..8b68450
--- /dev/null
+++ b/meta/recipes-devtools/ruby/ruby/extmk.patch
@@ -0,0 +1,13 @@
+diff -ru ruby-1.8.7-p248.orig/ext/extmk.rb ruby-1.8.7-p248/ext/extmk.rb
+--- ruby-1.8.7-p248.orig/ext/extmk.rb	2009-12-24 03:01:58.000000000 -0600
++++ ruby-1.8.7-p248/ext/extmk.rb	2010-02-12 15:55:27.370061558 -0600
+@@ -354,8 +354,8 @@
+   $ruby = '$(topdir)/miniruby' + EXEEXT
+ end
+ $ruby << " -I'$(topdir)'"
++$ruby << " -I'$(top_srcdir)/lib'"
+ unless CROSS_COMPILING
+-  $ruby << " -I'$(top_srcdir)/lib'"
+   $ruby << " -I'$(extout)/$(arch)' -I'$(extout)/common'" if $extout
+   $ruby << " -I./- -I'$(top_srcdir)/ext' -rpurelib.rb"
+   ENV["RUBYLIB"] = "-"
diff --git a/meta/recipes-devtools/ruby/ruby_2.2.2.bb b/meta/recipes-devtools/ruby/ruby_2.2.2.bb
new file mode 100644
index 0000000..78c943c
--- /dev/null
+++ b/meta/recipes-devtools/ruby/ruby_2.2.2.bb
@@ -0,0 +1,42 @@
+require ruby.inc
+
+SRC_URI[md5sum] = "326e99ddc75381c7b50c85f7089f3260"
+SRC_URI[sha256sum] = "5ffc0f317e429e6b29d4a98ac521c3ce65481bfd22a8cf845fa02a7b113d9b44"
+
+# it's unknown to configure script, but then passed to extconf.rb
+# maybe it's not really needed as we're hardcoding the result with
+# 0001-socket-extconf-hardcode-wide-getaddr-info-test-outco.patch
+UNKNOWN_CONFIGURE_WHITELIST += "--enable-wide-getaddrinfo"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
+
+PACKAGECONFIG[valgrind] = "--with-valgrind=yes, --with-valgrind=no, valgrind"
+PACKAGECONFIG[gpm] = "--with-gmp=yes, --with-gmp=no, gmp"
+PACKAGECONFIG[ipv6] = ",--enable-wide-getaddrinfo,"
+
+EXTRA_OECONF = "\
+    --disable-versioned-paths \
+    --disable-rpath \
+    --disable-dtrace \
+    --enable-shared \
+    --enable-load-relative \
+"
+
+EXTRA_OEMAKE = " \
+    LIBRUBYARG='-lruby-static' \
+"
+
+do_install() {
+    oe_runmake 'DESTDIR=${D}' install
+}
+
+FILES_${PN} += "${datadir}/rubygems \
+                ${datadir}/ri"
+
+FILES_${PN}-dbg += "${libdir}/ruby/*/.debug \
+                    ${libdir}/ruby/*/*/.debug \
+                    ${libdir}/ruby/*/*/*/.debug \
+                    ${libdir}/ruby/*/*/*/*/.debug"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
new file mode 100755
index 0000000..53a8e1d
--- /dev/null
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts
@@ -0,0 +1,92 @@
+#!/bin/sh
+#
+# Copyright 2007 Openedhand Ltd.
+#
+# Author: Richard Purdie <rpurdie@openedhand.com>
+#
+
+# The following script will run all the scriptlets found in #SYSCONFDIR#/deb-postinsts,
+# #SYSCONFDIR#/ipk-postinsts or #SYSCONFDIR#/rpm-posinsts.
+
+# the order of this list is important, do not change!
+backend_list="rpm deb ipk"
+
+pm_installed=false
+
+for pm in $backend_list; do
+	pi_dir="#SYSCONFDIR#/$pm-postinsts"
+
+	[ -d $pi_dir ] && break
+
+	case $pm in
+		"deb")
+			if [ -s "#LOCALSTATEDIR#/lib/dpkg/status" ]; then
+				pm_installed=true
+				break
+			fi
+			;;
+
+		"ipk")
+			if [ -s "/var/lib/opkg/status" ]; then
+				pm_installed=true
+				break
+			fi
+			;;
+	esac
+done
+
+remove_rcsd_link () {
+	if [ -n "`which update-rc.d`" ]; then
+		update-rc.d -f run-postinsts remove
+	fi
+}
+
+if [ -z "$pi_dir" ]; then
+	remove_rcsd_link
+	exit 0
+fi
+
+[ -e #SYSCONFDIR#/default/postinst ] && . #SYSCONFDIR#/default/postinst
+
+if [ "$POSTINST_LOGGING" = "1" ]; then
+	rm -f $LOGFILE
+	append_log=">>$LOGFILE 2>&1"
+fi
+
+exec_postinst_scriptlets() {
+	for i in `ls $pi_dir`; do
+		i=$pi_dir/$i
+		echo "Running postinst $i..."
+		[ "$POSTINST_LOGGING" = "1" ] && eval echo "Running postinst $i..." $append_log
+		if [ -x $i ]; then
+			eval sh -c $i $append_log
+			rm $i
+		else
+			echo "ERROR: postinst $i failed."
+			[ "$POSTINST_LOGGING" = "1" ] && eval echo "ERROR: postinst $i failed." $append_log
+			remove_pi_dir=0
+		fi
+	done
+}
+
+remove_pi_dir=1
+if $pm_installed; then
+	case $pm in
+		"ipk")
+			eval opkg configure $append_log
+			;;
+
+		"deb")
+			eval dpkg --configure -a $append_log
+			;;
+	esac
+else
+	exec_postinst_scriptlets
+fi
+
+# since all postinstalls executed successfully, remove the postinstalls directory
+# and the rcS.d link
+if [ $remove_pi_dir = 1 ]; then
+	rm -rf $pi_dir
+	remove_rcsd_link
+fi
diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init
new file mode 100644
index 0000000..473a1f7
--- /dev/null
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.init
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+run-postinsts
diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service
new file mode 100644
index 0000000..85a0439
--- /dev/null
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts/run-postinsts.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Run pending postinsts
+DefaultDependencies=no
+After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
+Before=sysinit.target
+ConditionPathExistsGlob=#SYSCONFDIR#/*-postinsts
+
+[Service]
+Type=oneshot
+ExecStart=#SBINDIR#/run-postinsts
+ExecStartPost=#BASE_BINDIR#/systemctl disable run-postinsts.service
+RemainAfterExit=No
+TimeoutSec=0
+
+[Install]
+WantedBy=sysinit.target
diff --git a/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb b/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
new file mode 100644
index 0000000..11c94e5
--- /dev/null
+++ b/meta/recipes-devtools/run-postinsts/run-postinsts_1.0.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Runs postinstall scripts on first boot of the target device"
+SECTION = "devel"
+PR = "r9"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://run-postinsts \
+           file://run-postinsts.init \
+           file://run-postinsts.service"
+
+S = "${WORKDIR}"
+
+inherit allarch systemd update-rc.d
+
+INITSCRIPT_NAME = "run-postinsts"
+INITSCRIPT_PARAMS = "start 99 S ."
+
+SYSTEMD_SERVICE_${PN} = "run-postinsts.service"
+
+do_configure() {
+	:
+}
+
+do_compile () {
+	:
+}
+
+do_install() {
+	install -d ${D}${sbindir}
+	install -m 0755 ${WORKDIR}/run-postinsts ${D}${sbindir}/
+
+	install -d ${D}${sysconfdir}/init.d/
+	install -m 0755 ${WORKDIR}/run-postinsts.init ${D}${sysconfdir}/init.d/run-postinsts
+
+	install -d ${D}${systemd_unitdir}/system/
+	install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system/
+
+	sed -i -e 's:#SYSCONFDIR#:${sysconfdir}:g' \
+               -e 's:#SBINDIR#:${sbindir}:g' \
+               -e 's:#BASE_BINDIR#:${base_bindir}:g' \
+               -e 's:#LOCALSTATEDIR#:${localstatedir}:g' \
+               ${D}${sbindir}/run-postinsts \
+               ${D}${systemd_unitdir}/system/run-postinsts.service
+}
diff --git a/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch b/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch
new file mode 100644
index 0000000..1f39b03
--- /dev/null
+++ b/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/autohell.patch
@@ -0,0 +1,61 @@
+Patch obtained from OpenEmbedded.
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- sgml-common-0.6.3/bin/Makefile.am~autohell.patch	2001-01-30 15:42:21.000000000 +0100
++++ sgml-common-0.6.3/bin/Makefile.am	2004-06-17 11:51:11.000000000 +0200
+@@ -1,6 +1,5 @@
+ primitive_scripts = sgmlwhich
+ 
+-bindir = $(prefix)/bin
+ bin_SCRIPTS = install-catalog $(primitive_scripts)
+ 
+ EXTRA_DIST =  install-catalog.in $(primitive_scripts)
+--- /dev/null	2003-09-23 19:59:22.000000000 +0200
++++ sgml-common-0.6.3/bin/sgmlwhich.in	2004-06-17 11:51:11.000000000 +0200
+@@ -0,0 +1,7 @@
++#!/bin/sh
++# Location of the main configuration file for consistency with non-LSB platforms
++# Send any comments to Eric Bischoff <eric@caldera.de>
++# This program is under GPL license. See LICENSE file for details.
++
++echo "@sysconfdir@/sgml/sgml.conf"
++# Simple, isn't it? ;-)
+--- /dev/null	2003-09-23 19:59:22.000000000 +0200
++++ sgml-common-0.6.3/config/sgml.conf.in	2004-06-17 11:51:11.000000000 +0200
+@@ -0,0 +1,2 @@
++SGML_BASE_DIR=@datadir@/sgml
++SGML_CATALOGS_DIR=@sysconfdir@/sgml
+--- sgml-common-0.6.3/configure.in~autohell.patch	2001-05-25 18:40:54.000000000 +0200
++++ sgml-common-0.6.3/configure.in	2004-06-17 11:53:22.000000000 +0200
+@@ -3,11 +3,6 @@
+ 
+ AM_INIT_AUTOMAKE(sgml-common, 0.6.3)
+ 
+-docdir='$(prefix)/doc'
+-AC_SUBST(docdir)
+-
+-dnl Checks for programs.
+-
+ dnl Checks for libraries.
+ 
+ dnl Checks for header files.
+@@ -18,6 +13,5 @@
+ 
+ AC_OUTPUT(Makefile \
+           bin/Makefile bin/install-catalog \
+-          config/Makefile \
+-          doc/Makefile doc/HTML/Makefile doc/man/Makefile doc/refentry/Makefile \
++          config/Makefile config/sgml.conf bin/sgmlwhich \
+           sgml-iso-entities/Makefile xml-iso-entities/Makefile)
+
+--- sgml-common-0.6.3/Makefile.am~no-docs	2001-05-25 18:22:01.000000000 +0200
++++ sgml-common-0.6.3/Makefile.am	2004-06-17 11:49:09.000000000 +0200
+@@ -1,4 +1,4 @@
+-SUBDIRS = bin config doc sgml-iso-entities xml-iso-entities
++SUBDIRS = bin config sgml-iso-entities xml-iso-entities
+ 
+ sgmlcodir = $(prefix)/share/sgml
+ sgmlco_DATA = xml.dcl
diff --git a/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch b/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch
new file mode 100644
index 0000000..54b3f54
--- /dev/null
+++ b/meta/recipes-devtools/sgml-common/sgml-common-0.6.3/license.patch
@@ -0,0 +1,29 @@
+The COPYING file sgml-common ships with is just a symlink to
+/usr/share/automake/COPYING, which means we can't verify it
+using our normal means. We workaround this by using this patch
+to create our own license file. 
+
+Upstream was notified about this on 2011-01-24. When upgrading
+this recipe, this should be fixed and you should remove this
+patch.
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN sgml-common-0.6.3.orig/LICENSE-GPLv2 sgml-common-0.6.3/LICENSE-GPLv2
+--- sgml-common-0.6.3.orig/LICENSE-GPLv2	1969-12-31 16:00:00.000000000 -0800
++++ sgml-common-0.6.3/LICENSE-GPLv2	2011-01-28 17:05:17.299528001 -0800
+@@ -0,0 +1,12 @@
++Copyright (C) 1997 Christian Schwarz <schwarz@debian.org>.
++Copyright (C) 2001-2004 Ardo van Rangelrooij <ardo@debian.org>
++
++This is free software; you may redistribute it and/or modify it under
++the terms of the GNU General Public License as published by the Free
++Software Foundation; either version 2, or (at your option) any later
++version.
++
++This is distributed in the hope that 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.
diff --git a/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb b/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb
new file mode 100644
index 0000000..5975365
--- /dev/null
+++ b/meta/recipes-devtools/sgml-common/sgml-common-native_0.6.3.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Base utilities for working with SGML and XML"
+DESCRIPTION = "The sgml-common package gathers very basic \
+stuff necessary to work with SGML and XML, such as xml.dcl, \
+a SGML declaration of XML; iso-entities, a list of the basic \
+SGML ISO entities; and install-catalog, a script used to \
+add entries to (or remove entries from) centralized catalogs \
+whose entries are pointers to SGML open catalogs, \
+as defined by OASIS."
+HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
+LICENSE = "GPLv2+"
+# See the comments in license.patch when upgrading this recipe.
+# This is inteded to be a temporary workaround.
+LIC_FILES_CHKSUM = "file://LICENSE-GPLv2;md5=ab8a50abe86dfc859e148baae043c89b"
+SECTION = "base"
+
+PR = "r1"
+
+require sgml-common_${PV}.bb
+inherit native
+
+S = "${WORKDIR}/sgml-common-${PV}"
+
+SYSROOT_PREPROCESS_FUNCS += "sgml_common_native_mangle"
+SSTATEPOSTINSTFUNCS += "sgml_common_sstate_postinst"
+CLEANFUNCS += "sgml_common_sstate_clean"
+
+
+do_install_append() {
+	# install-catalog script contains hard-coded references to
+	# {sysconfdir}. Change it to ${D}${sysconfdir}.
+	sed -i -e "s|${sysconfdir}/sgml|${D}${sysconfdir}/sgml|g" ${D}${bindir}/install-catalog
+
+	${D}${bindir}/install-catalog \
+		--add ${D}${sysconfdir}/sgml/sgml-ent.cat \
+		${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
+
+	# The sgml-docbook.cat will be regenerated by sstate_postinst
+	rm -f ${D}${sysconfdir}/sgml/sgml-docbook.cat
+}
+
+sgml_common_native_mangle () {
+	# Revert back to ${sysconfdir} path in install-catalog
+	sed -i -e "s|${D}${sysconfdir}/sgml|${sysconfdir}/sgml|g" ${SYSROOT_DESTDIR}${STAGING_BINDIR}/install-catalog
+	# Change path from ${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog to ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog in sgml-ent.cat
+	sed -i -e "s|${D}${datadir}/sgml/sgml-iso-entities-8879.1986/catalog|${datadir}/sgml/sgml-iso-entities-8879.1986/catalog|g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/sgml-ent.cat
+	# Remove ${D} path from catalog file created by install-catalog script
+	sed -i -e "s|${D}||g" ${SYSROOT_DESTDIR}${sysconfdir}/sgml/catalog
+}
+
+sgml_common_sstate_postinst() {
+	if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
+	then
+		${bindir}/install-catalog --add ${sysconfdir}/sgml/sgml-docbook.cat ${sysconfdir}/sgml/sgml-ent.cat
+		if [ -e ${sysconfdir}/sgml/sgml-docbook.bak ]; then
+			for catalog in `awk '{print $2}' ${sysconfdir}/sgml/sgml-docbook.bak`; do
+				if [ ! `grep $catalog ${sysconfdir}/sgml/sgml-docbook.cat 1> /dev/null 2>&1` ]; then
+					${bindir}/install-catalog \
+						--add ${sysconfdir}/sgml/sgml-docbook.cat $catalog
+				fi
+			done
+		fi
+	fi
+}
+
+sgml_common_sstate_clean () {
+	# Ensure that the catalog file sgml-docbook.cat is properly
+	# updated when the package is removed from sstate cache.
+	if [ -f ${sysconfdir}/sgml/sgml-docbook.cat ]; then
+		sed -i '/\/sgml\/sgml-ent.cat/d' ${sysconfdir}/sgml/sgml-docbook.cat
+	fi
+}
diff --git a/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb b/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb
new file mode 100644
index 0000000..6098673
--- /dev/null
+++ b/meta/recipes-devtools/sgml-common/sgml-common_0.6.3.bb
@@ -0,0 +1,68 @@
+SUMMARY = "Base utilities for working with SGML and XML"
+DESCRIPTION = "The sgml-common package gathers very basic \
+stuff necessary to work with SGML and XML, such as xml.dcl, \
+a SGML declaration of XML; iso-entities, a list of the basic \
+SGML ISO entities; and install-catalog, a script used to \
+add entries to (or remove entries from) centralized catalogs \
+whose entries are pointers to SGML open catalogs, \
+as defined by OASIS."
+HOMEPAGE = "http://sources.redhat.com/docbook-tools/"
+LICENSE = "GPLv2+"
+# See the comments in license.patch when upgrading this recipe.
+# This is inteded to be a temporary workaround.
+LIC_FILES_CHKSUM = "file://LICENSE-GPLv2;md5=ab8a50abe86dfc859e148baae043c89b"
+SECTION = "base"
+
+PR = "r1"
+
+SRC_URI = "ftp://sources.redhat.com/pub/docbook-tools/new-trials/SOURCES/sgml-common-${PV}.tgz \
+           file://autohell.patch \
+           file://license.patch"
+
+SRC_URI[md5sum] = "103c9828f24820df86e55e7862e28974"
+SRC_URI[sha256sum] = "7dc418c1d361123ffc5e45d61f1b97257940a8eb35d0bfbbc493381cc5b1f959"
+
+inherit autotools
+
+do_compile_append() {
+	# install-catalog script contains hardcoded references to /etc/sgml
+	sed -i -e 's|\([ "]\+\)/etc/sgml|\1${sysconfdir}/sgml|g' bin/install-catalog
+}
+
+FILES_${PN} += "${datadir}/sgml"
+
+pkg_postinst_${PN}() {
+    if [ "x$D" = "x" ]; then
+	install-catalog \
+		--add ${sysconfdir}/sgml/sgml-ent.cat \
+		${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
+
+	install-catalog \
+		--add ${sysconfdir}/sgml/sgml-docbook.cat \
+		${sysconfdir}/sgml/sgml-ent.cat
+    else
+	if ! grep -q ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog $D${sysconfdir}/sgml/sgml-ent.cat; then
+	    echo "CATALOG ${datadir}/sgml/sgml-iso-entities-8879.1986/catalog" >> $D${sysconfdir}/sgml/sgml-ent.cat
+	fi
+	if ! grep -q ${sysconfdir}/sgml/sgml-ent.cat $D${sysconfdir}/sgml/catalog; then
+	    echo "CATALOG ${sysconfdir}/sgml/sgml-ent.cat" >> $D${sysconfdir}/sgml/catalog
+	fi
+
+	if ! grep -q ${sysconfdir}/sgml/sgml-ent.cat $D${sysconfdir}/sgml/sgml-docbook.cat; then
+	    echo "CATALOG ${sysconfdir}/sgml/sgml-ent.cat" >> $D${sysconfdir}/sgml/sgml-docbook.cat
+	fi
+	if ! grep -q ${sysconfdir}/sgml/sgml-docbook.cat $D${sysconfdir}/sgml/catalog; then
+	    echo "CATALOG ${sysconfdir}/sgml/sgml-docbook.cat" >> $D${sysconfdir}/sgml/catalog
+	fi
+    fi
+}
+
+pkg_postrm_${PN}() {
+	install-catalog \
+		--remove ${sysconfdir}/sgml/sgml-ent.cat \
+		${datadir}/sgml/sgml-iso-entities-8879.1986/catalog
+
+	install-catalog \
+		--remove ${sysconfdir}/sgml/sgml-docbook.cat \
+		${sysconfdir}/sgml/sgml-ent.cat
+}
diff --git a/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb b/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb
new file mode 100644
index 0000000..5e3460f
--- /dev/null
+++ b/meta/recipes-devtools/sgmlspl/sgmlspl-native_git.bb
@@ -0,0 +1,20 @@
+SUMMARY = "A simple post-processor for SGMLS and NSGMLS"
+HOMEPAGE = "https://github.com/gitpan/SGMLSpm"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
+
+SRC_URI = "git://github.com/gitpan/SGMLSpm \
+          "
+
+SRCREV = "71595b9b5e36bfc00046995e058926bd27793fef"
+
+PV = "1.1+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit native cpan
+
+do_install_append() {
+    ln -s sgmlspl.pl ${D}${bindir}/sgmlspl
+}
diff --git a/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
new file mode 100644
index 0000000..497b282
--- /dev/null
+++ b/meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb
@@ -0,0 +1,37 @@
+# Note, we can probably remove the lzma option as it has be replaced with xz,
+# and I don't think the kernel supports it any more.
+SUMMARY = "Tools for manipulating SquashFS filesystems"
+SECTION = "base"
+LICENSE = "GPL-2 & PD"
+LIC_FILES_CHKSUM = "file://../COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://../../7zC.txt;beginline=12;endline=16;md5=2056cd6d919ebc3807602143c7449a7c \
+"
+DEPENDS = "attr zlib xz lzo lz4"
+
+PV = "4.3+gitr${SRCPV}"
+SRCREV = "9c1db6d13a51a2e009f0027ef336ce03624eac0d"
+SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https \
+           http://downloads.sourceforge.net/sevenzip/lzma465.tar.bz2;name=lzma \
+"
+SRC_URI[lzma.md5sum] = "29d5ffd03a5a3e51aef6a74e9eafb759"
+SRC_URI[lzma.sha256sum] = "c935fd04dd8e0e8c688a3078f3675d699679a90be81c12686837e0880aa0fa1e"
+
+S = "${WORKDIR}/git/squashfs-tools"
+
+# EXTRA_OEMAKE is typically: -e MAKEFLAGS=
+# the -e causes problems as CFLAGS is modified in the Makefile, so
+# we redefine EXTRA_OEMAKE here
+EXTRA_OEMAKE = "MAKEFLAGS= LZMA_SUPPORT=1 LZMA_DIR=../.. XZ_SUPPORT=1 LZO_SUPPORT=1 LZ4_SUPPORT=1"
+
+do_compile() {
+	oe_runmake mksquashfs unsquashfs
+}
+do_install () {
+	install -d ${D}${sbindir}
+	install -m 0755 mksquashfs ${D}${sbindir}/
+	install -m 0755 unsquashfs ${D}${sbindir}/
+}
+
+ARM_INSTRUCTION_SET = "arm"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/strace/strace/0001-Add-linux-aarch64-arch_regs.h.patch b/meta/recipes-devtools/strace/strace/0001-Add-linux-aarch64-arch_regs.h.patch
new file mode 100644
index 0000000..0853959
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/0001-Add-linux-aarch64-arch_regs.h.patch
@@ -0,0 +1,25 @@
+From f85854131c8265f2eb59c714dcea5c4b3dc09bed Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen.kooi@linaro.org>
+Date: Wed, 15 Apr 2015 14:29:37 +0200
+Subject: [PATCH] Add linux/aarch64/arch_regs.h
+
+It is missing from the tarball, but it is present in git for v4.10
+
+Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
+Upstream-Status: Pending
+---
+ linux/aarch64/arch_regs.h | 2 ++
+ 1 file changed, 2 insertions(+)
+ create mode 100644 linux/aarch64/arch_regs.h
+
+diff --git a/linux/aarch64/arch_regs.h b/linux/aarch64/arch_regs.h
+new file mode 100644
+index 0000000..9a5e33e
+--- /dev/null
++++ b/linux/aarch64/arch_regs.h
+@@ -0,0 +1,2 @@
++extern uint64_t *const aarch64_sp_ptr;
++extern uint32_t *const arm_sp_ptr;
+-- 
+1.9.3
+
diff --git a/meta/recipes-devtools/strace/strace/Include-linux-ioctl.h-for-_IOC_-macros.patch b/meta/recipes-devtools/strace/strace/Include-linux-ioctl.h-for-_IOC_-macros.patch
new file mode 100644
index 0000000..d9346a8
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/Include-linux-ioctl.h-for-_IOC_-macros.patch
@@ -0,0 +1,69 @@
+Upstream-Status: Backport
+
+  http://sourceforge.net/p/strace/code/ci/3460dc486d333231998de0f19918204aacee9ae3
+
+Expected to be released officially as part of strace 4.11
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+From 3460dc486d333231998de0f19918204aacee9ae3 Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sat, 28 Mar 2015 18:40:13 +0100
+Subject: [PATCH] Include <linux/ioctl.h> for _IOC_* macros
+
+Fix a compilation failure with musl libc.
+
+* evdev.c: Include <linux/ioctl.h>.
+* ioctl.c: Include <linux/ioctl.h> instead of <asm/ioctl.h>.
+* ioctlsort.c: Likewise.
+
+Reported-by: Dima Krasner <dima@dimakrasner.com>
+Acked-by: Mike Frysinger <vapier@gentoo.org>
+---
+ evdev.c     | 2 ++
+ ioctl.c     | 2 +-
+ ioctlsort.c | 2 +-
+ 3 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/evdev.c b/evdev.c
+index 9a7430d..e06f9c1 100644
+--- a/evdev.c
++++ b/evdev.c
+@@ -28,6 +28,8 @@
+ 
+ #include "defs.h"
+ 
++#include <linux/ioctl.h>
++
+ #ifdef HAVE_LINUX_INPUT_H
+ #include <linux/input.h>
+ #include "xlat/evdev_abs.h"
+diff --git a/ioctl.c b/ioctl.c
+index 46f8334..c67d048 100644
+--- a/ioctl.c
++++ b/ioctl.c
+@@ -29,7 +29,7 @@
+  */
+ 
+ #include "defs.h"
+-#include <asm/ioctl.h>
++#include <linux/ioctl.h>
+ #include "xlat/ioctl_dirs.h"
+ 
+ #ifdef HAVE_LINUX_INPUT_H
+diff --git a/ioctlsort.c b/ioctlsort.c
+index 333556c..9c31691 100644
+--- a/ioctlsort.c
++++ b/ioctlsort.c
+@@ -33,7 +33,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+-#include <asm/ioctl.h>
++#include <linux/ioctl.h>
+ 
+ struct ioctlent {
+ 	const char *info;
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/strace/strace/Include-sys-stat.h-for-S_I-macros.patch b/meta/recipes-devtools/strace/strace/Include-sys-stat.h-for-S_I-macros.patch
new file mode 100644
index 0000000..0b072fe
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/Include-sys-stat.h-for-S_I-macros.patch
@@ -0,0 +1,52 @@
+Upstream-Status: Backport
+
+  http://sourceforge.net/p/strace/code/ci/d34e00b293942b1012ddc49ed3ab379a32337611
+
+Expected to be released officially as part of strace 4.11
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+
+From d34e00b293942b1012ddc49ed3ab379a32337611 Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Sat, 28 Mar 2015 18:21:09 +0100
+Subject: [PATCH] Include <sys/stat.h> for S_I* macros
+
+Fix a compilation failure with musl libc.
+
+* mknod.c: Include <sys/stat.h>.
+* printmode.c: Likewise.
+
+Reported-by: Dima Krasner <dima@dimakrasner.com>
+Acked-by: Mike Frysinger <vapier@gentoo.org>
+---
+ mknod.c     | 1 +
+ printmode.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/mknod.c b/mknod.c
+index 07e9a45..1463232 100644
+--- a/mknod.c
++++ b/mknod.c
+@@ -1,6 +1,7 @@
+ #include "defs.h"
+ 
+ #include <fcntl.h>
++#include <sys/stat.h>
+ 
+ #ifdef MAJOR_IN_SYSMACROS
+ # include <sys/sysmacros.h>
+diff --git a/printmode.c b/printmode.c
+index 4df1b9f..a721936 100644
+--- a/printmode.c
++++ b/printmode.c
+@@ -1,6 +1,7 @@
+ #include "defs.h"
+ 
+ #include <fcntl.h>
++#include <sys/stat.h>
+ 
+ #include "xlat/modetypes.h"
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/strace/strace/Makefile-ptest.patch b/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
new file mode 100644
index 0000000..f360301
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/Makefile-ptest.patch
@@ -0,0 +1,53 @@
+strace: Add ptest
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Gabriel Barbu <gabriel.barbu@enea.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ configure.ac      |  2 +-
+ tests/Makefile.am | 18 ++++++++++++++++++
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index e73958c..5f0dfee 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -6,7 +6,7 @@ AC_INIT([strace],
+ AC_CONFIG_SRCDIR([strace.c])
+ AC_CONFIG_AUX_DIR([.])
+ AC_CONFIG_HEADERS([config.h])
+-AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip silent-rules parallel-tests])
++AM_INIT_AUTOMAKE([foreign dist-xz no-dist-gzip silent-rules serial-tests])
+ AM_MAINTAINER_MODE
+ AC_CANONICAL_HOST
+ 
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index ff5e136..984bdb6 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -101,3 +101,21 @@ EXTRA_DIST = init.sh run.sh \
+ 	     $(TESTS)
+ 
+ CLEANFILES = $(TESTS:=.tmp)
++
++buildtest-TESTS: $(check_PROGRAMS) $(TESTS)
++
++install-ptest:
++	install $(BUILDDIR)/strace $(DESTDIR)
++	install "$(srcdir)/.."/strace-log-merge $(DESTDIR)
++	install -d $(DESTDIR)/$(TESTDIR)
++	cp $(BUILDDIR)/$(TESTDIR)/Makefile $(DESTDIR)/$(TESTDIR)
++	sed -i -e 's/^Makefile:/_Makefile:/' $(DESTDIR)/$(TESTDIR)/Makefile
++	sed -i -e 's/bash/sh/' $(DESTDIR)/$(TESTDIR)/Makefile
++	for file in $(check_PROGRAMS); do \
++		install $(BUILDDIR)/$(TESTDIR)/$$file $(DESTDIR)/$(TESTDIR); \
++	done
++	for file in $(EXTRA_DIST); do \
++		install $(srcdir)/$$file $(DESTDIR)/$(TESTDIR); \
++		sed -i -e 's/$${srcdir=.}/./g' $(DESTDIR)/$(TESTDIR)/$$file; \
++	done
++	for i in net net-fd scm_rights-fd sigaction; do sed -i -e 's/$$srcdir/./g' $(DESTDIR)/$(TESTDIR)/$$i.test; done
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/strace/strace/git-version-gen b/meta/recipes-devtools/strace/strace/git-version-gen
new file mode 100755
index 0000000..8fee74e
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/git-version-gen
@@ -0,0 +1,225 @@
+#!/bin/sh
+# Print a version string.
+scriptversion=2012-12-31.23; # UTC
+
+# Copyright (C) 2007-2013 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 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/>.
+
+# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
+# It may be run two ways:
+# - from a git repository in which the "git describe" command below
+#   produces useful output (thus requiring at least one signed tag)
+# - from a non-git-repo directory containing a .tarball-version file, which
+#   presumes this script is invoked like "./git-version-gen .tarball-version".
+
+# In order to use intra-version strings in your project, you will need two
+# separate generated version string files:
+#
+# .tarball-version - present only in a distribution tarball, and not in
+#   a checked-out repository.  Created with contents that were learned at
+#   the last time autoconf was run, and used by git-version-gen.  Must not
+#   be present in either $(srcdir) or $(builddir) for git-version-gen to
+#   give accurate answers during normal development with a checked out tree,
+#   but must be present in a tarball when there is no version control system.
+#   Therefore, it cannot be used in any dependencies.  GNUmakefile has
+#   hooks to force a reconfigure at distribution time to get the value
+#   correct, without penalizing normal development with extra reconfigures.
+#
+# .version - present in a checked-out repository and in a distribution
+#   tarball.  Usable in dependencies, particularly for files that don't
+#   want to depend on config.h but do want to track version changes.
+#   Delete this file prior to any autoconf run where you want to rebuild
+#   files to pick up a version string change; and leave it stale to
+#   minimize rebuild time after unrelated changes to configure sources.
+#
+# As with any generated file in a VC'd directory, you should add
+# /.version to .gitignore, so that you don't accidentally commit it.
+# .tarball-version is never generated in a VC'd directory, so needn't
+# be listed there.
+#
+# Use the following line in your configure.ac, so that $(VERSION) will
+# automatically be up-to-date each time configure is run (and note that
+# since configure.ac no longer includes a version string, Makefile rules
+# should not depend on configure.ac for version updates).
+#
+# AC_INIT([GNU project],
+#         m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+#         [bug-project@example])
+#
+# Then use the following lines in your Makefile.am, so that .version
+# will be present for dependencies, and so that .version and
+# .tarball-version will exist in distribution tarballs.
+#
+# EXTRA_DIST = $(top_srcdir)/.version
+# BUILT_SOURCES = $(top_srcdir)/.version
+# $(top_srcdir)/.version:
+#	echo $(VERSION) > $@-t && mv $@-t $@
+# dist-hook:
+#	echo $(VERSION) > $(distdir)/.tarball-version
+
+
+me=$0
+
+version="git-version-gen $scriptversion
+
+Copyright 2011 Free Software Foundation, Inc.
+There is NO warranty.  You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+
+usage="\
+Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT]
+Print a version string.
+
+Options:
+
+   --prefix           prefix of git tags (default 'v')
+   --fallback         fallback version to use if \"git --version\" fails
+
+   --help             display this help and exit
+   --version          output version information and exit
+
+Running without arguments will suffice in most cases."
+
+prefix=v
+fallback=
+
+while test $# -gt 0; do
+  case $1 in
+    --help) echo "$usage"; exit 0;;
+    --version) echo "$version"; exit 0;;
+    --prefix) shift; prefix="$1";;
+    --fallback) shift; fallback="$1";;
+    -*)
+      echo "$0: Unknown option '$1'." >&2
+      echo "$0: Try '--help' for more information." >&2
+      exit 1;;
+    *)
+      if test "x$tarball_version_file" = x; then
+        tarball_version_file="$1"
+      elif test "x$tag_sed_script" = x; then
+        tag_sed_script="$1"
+      else
+        echo "$0: extra non-option argument '$1'." >&2
+        exit 1
+      fi;;
+  esac
+  shift
+done
+
+if test "x$tarball_version_file" = x; then
+    echo "$usage"
+    exit 1
+fi
+
+tag_sed_script="${tag_sed_script:-s/x/x/}"
+
+nl='
+'
+
+# Avoid meddling by environment variable of the same name.
+v=
+v_from_git=
+
+# First see if there is a tarball-only version file.
+# then try "git describe", then default.
+if test -f $tarball_version_file
+then
+    v=`cat $tarball_version_file` || v=
+    case $v in
+        *$nl*) v= ;; # reject multi-line output
+        [0-9]*) ;;
+        *) v= ;;
+    esac
+    test "x$v" = x \
+        && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
+fi
+
+if test "x$v" != x
+then
+    : # use $v
+# Otherwise, if there is at least one git commit involving the working
+# directory, and "git describe" output looks sensible, use that to
+# derive a version string.
+elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
+    && v=`git describe --abbrev=4 --match="$prefix*" HEAD 2>/dev/null \
+          || git describe --abbrev=4 HEAD 2>/dev/null` \
+    && v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
+    && case $v in
+         $prefix[0-9]*) ;;
+         *) (exit 1) ;;
+       esac
+then
+    # Is this a new git that lists number of commits since the last
+    # tag or the previous older version that did not?
+    #   Newer: v6.10-77-g0f8faeb
+    #   Older: v6.10-g0f8faeb
+    case $v in
+        *-*-*) : git describe is okay three part flavor ;;
+        *-*)
+            : git describe is older two part flavor
+            # Recreate the number of commits and rewrite such that the
+            # result is the same as if we were using the newer version
+            # of git describe.
+            vtag=`echo "$v" | sed 's/-.*//'`
+            commit_list=`git rev-list "$vtag"..HEAD 2>/dev/null` \
+                || { commit_list=failed;
+                     echo "$0: WARNING: git rev-list failed" 1>&2; }
+            numcommits=`echo "$commit_list" | wc -l`
+            v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
+            test "$commit_list" = failed && v=UNKNOWN
+            ;;
+    esac
+
+    # Change the first '-' to a '.', so version-comparing tools work properly.
+    # Remove the "g" in git describe's output string, to save a byte.
+    v=`echo "$v" | sed 's/-/.0./;s/\(.*\)-g/\1-/'`;
+    v_from_git=1
+elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
+    v=UNKNOWN
+else
+    v=$fallback
+fi
+
+v=`echo "$v" |sed "s/^$prefix//"`
+
+# Test whether to append the "-dirty" suffix only if the version
+# string we're using came from git.  I.e., skip the test if it's "UNKNOWN"
+# or if it came from .tarball-version.
+if test "x$v_from_git" != x; then
+  # Don't declare a version "dirty" merely because a time stamp has changed.
+  git update-index --refresh > /dev/null 2>&1
+
+  dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
+  case "$dirty" in
+      '') ;;
+      *) # Append the suffix only if there isn't one already.
+          case $v in
+            *-dirty) ;;
+            *) v="$v-dirty" ;;
+          esac ;;
+  esac
+fi
+
+# Omit the trailing newline, so that m4_esyscmd can use the result directly.
+echo "$v" | tr -d "$nl"
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/meta/recipes-devtools/strace/strace/run-ptest b/meta/recipes-devtools/strace/strace/run-ptest
new file mode 100755
index 0000000..133cf92
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -C tests -k runtest-TESTS
diff --git a/meta/recipes-devtools/strace/strace/strace-add-configure-options.patch b/meta/recipes-devtools/strace/strace/strace-add-configure-options.patch
new file mode 100644
index 0000000..e48e4b3
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace/strace-add-configure-options.patch
@@ -0,0 +1,57 @@
+Add options "aio" and "acl" to enable/disable libaio and acl support.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ configure.ac |   26 ++++++++++++++++++++++++++
+ 1 file changed, 26 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index e73958c..9099370 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -270,6 +270,18 @@ AC_CHECK_HEADERS(m4_normalize([
+ 	sys/vfs.h
+ 	sys/xattr.h
+ ]))
++
++AC_ARG_ENABLE([acl],
++	[AS_HELP_STRING([--enable-acl], [turn on acl support])],
++	[case $enableval in
++	yes)
++		AC_CHECK_HEADERS([sys/acl.h])
++		;;
++	no)  ;;
++	*)   AC_MSG_ERROR([bad value $enableval for aio option]) ;;
++	esac]
++)
++
+ AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
+                  [], [], [#include <stddef.h>
+ #include <sys/socket.h>
+@@ -745,6 +757,20 @@ if test "x$ac_cv_lib_dl_dladdr" = xyes; then
+ fi
+ AC_SUBST(dl_LIBS)
+ 
++AC_ARG_ENABLE([aio],
++	[AS_HELP_STRING([--enable-aio], [turn on libaio support])],
++	[case $enableval in
++	yes)
++	AC_CHECK_HEADERS([libaio.h], [
++		AC_CHECK_MEMBERS([struct iocb.u.c.flags],,, [#include <libaio.h>])
++		AC_CHECK_DECLS([IO_CMD_PWRITE, IO_CMD_PWRITEV],,, [#include <libaio.h>])
++	])
++	;;
++	no)  ;;
++	*)   AC_MSG_ERROR([bad value $enableval for aio option]) ;;
++	esac]
++)
++
+ AC_PATH_PROG([PERL], [perl])
+ 
+ dnl stack trace with libunwind
+--
+1.9.1
+
diff --git a/meta/recipes-devtools/strace/strace_4.10.bb b/meta/recipes-devtools/strace/strace_4.10.bb
new file mode 100644
index 0000000..20b7e3d
--- /dev/null
+++ b/meta/recipes-devtools/strace/strace_4.10.bb
@@ -0,0 +1,52 @@
+SUMMARY = "System call tracing tool"
+HOMEPAGE = "http://strace.sourceforge.net"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=124500c21e856f0912df29295ba104c7"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/strace/strace-${PV}.tar.xz \
+           file://0001-Add-linux-aarch64-arch_regs.h.patch \
+           file://git-version-gen \
+           file://strace-add-configure-options.patch \
+           file://Makefile-ptest.patch \
+           file://run-ptest \
+           file://Include-sys-stat.h-for-S_I-macros.patch \
+           file://Include-linux-ioctl.h-for-_IOC_-macros.patch \
+          "
+
+SRC_URI[md5sum] = "107a5be455493861189e9b57a3a51912"
+SRC_URI[sha256sum] = "e6180d866ef9e76586b96e2ece2bfeeb3aa23f5cc88153f76e9caedd65e40ee2"
+
+inherit autotools ptest bluetooth
+RDEPENDS_${PN}-ptest += "make coreutils grep gawk"
+
+PACKAGECONFIG_class-target ??= "\
+    libaio ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+"
+
+PACKAGECONFIG[libaio] = "--enable-aio,--disable-aio,libaio"
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
+PACKAGECONFIG[libunwind] = "--with-libunwind, --without-libunwind, libunwind"
+PACKAGECONFIG[bluez] = "ac_cv_header_bluetooth_bluetooth_h=yes,ac_cv_header_bluetooth_bluetooth_h=no,${BLUEZ}"
+
+TESTDIR = "tests"
+
+do_configure_prepend() {
+	cp ${WORKDIR}/git-version-gen ${S}
+}
+
+do_install_append() {
+	# We don't ship strace-graph here because it needs perl
+	rm ${D}${bindir}/strace-graph
+}
+
+do_compile_ptest() {
+	oe_runmake -C ${TESTDIR} buildtest-TESTS OS=linux ARCH="${TARGET_ARCH}"
+}
+
+do_install_ptest() {
+	oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR}
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/subversion/subversion-1.8.13/disable_macos.patch b/meta/recipes-devtools/subversion/subversion-1.8.13/disable_macos.patch
new file mode 100644
index 0000000..ec3be49
--- /dev/null
+++ b/meta/recipes-devtools/subversion/subversion-1.8.13/disable_macos.patch
@@ -0,0 +1,68 @@
+These tests don't work in cross compiling, just disable them for now, we don't
+build subversion on OS-X at this time.
+
+RP 1014/7/16
+
+Upstream-Status: Pending [needs a rewrite to support a cache value]
+
+Index: subversion-1.8.9/build/ac-macros/macosx.m4
+===================================================================
+--- subversion-1.8.9.orig/build/ac-macros/macosx.m4	2012-11-26 03:04:27.000000000 +0000
++++ subversion-1.8.9/build/ac-macros/macosx.m4	2014-07-16 12:28:58.357300403 +0000
+@@ -24,21 +24,7 @@
+ AC_DEFUN(SVN_LIB_MACHO_ITERATE,
+ [
+   AC_MSG_CHECKING([for Mach-O dynamic module iteration functions])
+-  AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+-    #include <mach-o/dyld.h>
+-    #include <mach-o/loader.h>
+-  ]],[[
+-    const struct mach_header *header = _dyld_get_image_header(0);
+-    const char *name = _dyld_get_image_name(0);
+-    if (name && header) return 0;
+-    return 1;
+-  ]])],[
+-    AC_DEFINE([SVN_HAVE_MACHO_ITERATE], [1],
+-              [Is Mach-O low-level _dyld API available?])
+-    AC_MSG_RESULT([yes])
+-  ],[
+     AC_MSG_RESULT([no])
+-  ])
+ ])
+ 
+ dnl SVN_LIB_MACOS_PLIST
+@@ -46,34 +32,7 @@
+ AC_DEFUN(SVN_LIB_MACOS_PLIST,
+ [
+   AC_MSG_CHECKING([for Mac OS property list utilities])
+-
+-  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+-    #include <AvailabilityMacros.h>
+-    #if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) \
+-     || !defined(MAC_OS_X_VERSION_10_0) \
+-     || (MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_0)
+-    #error ProperyList API unavailable.
+-    #endif
+-  ]],[[]])],[
+-    dnl ### Hack.  We should only need to pass the -framework options when
+-    dnl linking libsvn_subr, since it is the only library that uses Keychain.
+-    dnl
+-    dnl Unfortunately, libtool 1.5.x doesn't track transitive dependencies for
+-    dnl OS X frameworks like it does for normal libraries, so we need to
+-    dnl explicitly pass the option to all the users of libsvn_subr to allow
+-    dnl static builds to link successfully.
+-    dnl
+-    dnl This does mean that all executables we link will be linked directly
+-    dnl to these frameworks - even when building shared libraries - but that
+-    dnl shouldn't cause any problems.
+-
+-    LIBS="$LIBS -framework CoreFoundation"
+-    AC_DEFINE([SVN_HAVE_MACOS_PLIST], [1],
+-              [Is Mac OS property list API available?])
+-    AC_MSG_RESULT([yes])
+-  ],[
+     AC_MSG_RESULT([no])
+-  ])
+ ])
+ 
+ dnl SVN_LIB_MACOS_KEYCHAIN
diff --git a/meta/recipes-devtools/subversion/subversion-1.8.13/libtool2.patch b/meta/recipes-devtools/subversion/subversion-1.8.13/libtool2.patch
new file mode 100644
index 0000000..5cd572b
--- /dev/null
+++ b/meta/recipes-devtools/subversion/subversion-1.8.13/libtool2.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+--- a/configure.ac	2011-10-20 21:56:02.230663987 +0200
++++ b/configure.ac	2011-08-17 15:01:30.000000000 +0200
+@@ -227,8 +227,8 @@
+   LIBTOOL="$sh_libtool"
+   SVN_LIBTOOL="$sh_libtool"
+ else
+-  sh_libtool="$abs_builddir/libtool"
+-  SVN_LIBTOOL="\$(SHELL) $sh_libtool"
++  sh_libtool="$abs_builddir/$host_alias-libtool"
++  SVN_LIBTOOL="\$(SHELL) \$(abs_builddir)/$host_alias-libtool"
+ fi
+ AC_SUBST(SVN_LIBTOOL)
+ 
diff --git a/meta/recipes-devtools/subversion/subversion-1.8.13/serf.m4-Regex-modified-to-allow-D-in-paths.patch b/meta/recipes-devtools/subversion/subversion-1.8.13/serf.m4-Regex-modified-to-allow-D-in-paths.patch
new file mode 100644
index 0000000..140e522
--- /dev/null
+++ b/meta/recipes-devtools/subversion/subversion-1.8.13/serf.m4-Regex-modified-to-allow-D-in-paths.patch
@@ -0,0 +1,32 @@
+From f1b6e49f12a18eabe88eb732b578a16281d09499 Mon Sep 17 00:00:00 2001
+From: Jose Lamego <jose.a.lamego@linux.intel.com>
+Date: Thu, 2 Jul 2015 11:37:43 +0000
+Subject: [PATCH] serf.m4: Regex modified to allow '-D' in paths
+
+Upstream-Status: Accepted
+
+The patch is merged by subversion upstream with replacing '[[:space:]]' with ' '.
+
+http://svn.apache.org/viewvc/subversion/trunk/build/ac-macros/serf.m4?r1=1594156&r2=1689824  
+
+Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
+---
+ build/ac-macros/serf.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/ac-macros/serf.m4 b/build/ac-macros/serf.m4
+index ae11e75..ff8cbae 100644
+--- a/build/ac-macros/serf.m4
++++ b/build/ac-macros/serf.m4
+@@ -143,7 +143,7 @@ AC_DEFUN(SVN_SERF_PKG_CONFIG,
+         if $PKG_CONFIG $serf_major --atleast-version=$serf_check_version; then
+           AC_MSG_RESULT([yes])
+           serf_found=yes
+-          SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_major --cflags | $SED -e 's/-D[^ ]*//g'`]
++          SVN_SERF_INCLUDES=[`$PKG_CONFIG $serf_major --cflags | $SED -e 's/[[:space:]]-D[^ ]*//g' -e 's/^-D[^ ]*//g'`]
+           SVN_SERF_LIBS=`$PKG_CONFIG $serf_major --libs` 
+           break
+         else
+-- 
+1.8.4.5
+
diff --git a/meta/recipes-devtools/subversion/subversion_1.8.13.bb b/meta/recipes-devtools/subversion/subversion_1.8.13.bb
new file mode 100644
index 0000000..f843b95
--- /dev/null
+++ b/meta/recipes-devtools/subversion/subversion_1.8.13.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Subversion (svn) version control system client"
+SECTION = "console/network"
+DEPENDS = "apr-util serf sqlite3 file"
+RDEPENDS_${PN} = "serf"
+LICENSE = "Apache-2"
+HOMEPAGE = "http://subversion.tigris.org"
+
+BBCLASSEXTEND = "native"
+
+inherit gettext pythonnative
+
+SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
+           file://libtool2.patch \
+           file://disable_macos.patch \
+           file://serf.m4-Regex-modified-to-allow-D-in-paths.patch \
+"
+SRC_URI[md5sum] = "4413417b529d7bdf82f74e50df02e88b"
+SRC_URI[sha256sum] = "1099cc68840753b48aedb3a27ebd1e2afbcc84ddb871412e5d500e843d607579"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1c2f0119e478700b5428e26386cff923"
+
+PACKAGECONFIG[sasl] = "--with-sasl,--without-sasl,cyrus-sasl"
+PACKAGECONFIG[gnome-keyring] = "--with-gnome-keyring,--without-gnome-keyring,glib-2.0 gnome-keyring"
+
+EXTRA_OECONF = " \
+                --without-berkeley-db --without-apxs \
+                --without-swig --with-apr=${STAGING_BINDIR_CROSS} \
+                --with-apr-util=${STAGING_BINDIR_CROSS} \
+                --disable-keychain \
+                ac_cv_path_RUBY=none"
+
+inherit autotools
+
+export LDFLAGS += " -L${STAGING_LIBDIR} "
+CPPFLAGS += "-P"
+BUILD_CPPFLAGS += "-P"
+
+acpaths = "-I build/ -I build/ac-macros/"
+
+do_configure_prepend () {
+	rm -f ${S}/libtool
+	rm -f ${S}/build/libtool.m4 ${S}/build/ltmain.sh ${S}/build/ltoptions.m4 ${S}/build/ltsugar.m4 ${S}/build/ltversion.m4 ${S}/build/lt~obsolete.m4
+	rm -f ${S}/aclocal.m4
+	sed -i -e 's:with_sasl="/usr/local":with_sasl="${STAGING_DIR}":' ${S}/build/ac-macros/sasl.m4
+}
+
+#| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_local/libsvn_ra_local-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_repos/libsvn_repos-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| /usr/bin/ld: cannot find -lsvn_delta-1| collect2: ld returned 1 exit status| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_svn/libsvn_ra_svn-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'| x86_64-linux-libtool: install: warning: `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/build/subversion/libsvn_ra_serf/libsvn_ra_serf-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'
+#| x86_64-linux-libtool: install: error: relink `libsvn_ra_serf-1.la' with the above command before installing it
+#| x86_64-linux-libtool: install: warning: `../../subversion/libsvn_repos/libsvn_repos-1.la' has not been installed in `/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/sysroots/x86_64-linux/usr/lib'
+#| /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-qa-logrotate/build/build/tmp/work/x86_64-linux/subversion-native/1.8.9-r0/subversion-1.8.9/build-outputs.mk:1090: recipe for target 'install-serf-lib' failed
+#| make: *** [install-serf-lib] Error 1
+PARALLEL_MAKEINST = ""
diff --git a/meta/recipes-devtools/swabber/swabber-native_git.bb b/meta/recipes-devtools/swabber/swabber-native_git.bb
new file mode 100644
index 0000000..2f313bb
--- /dev/null
+++ b/meta/recipes-devtools/swabber/swabber-native_git.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Tool to monitor and report on host system file usage"
+HOMEPAGE = "http://git.yoctoproject.org/cgit/cgit.cgi/swabber"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+SRCREV = "2d1fe36fb0a4fdaae8823a9818a6785182d75e66"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/swabber"
+
+inherit native
+
+do_configure () {
+	:
+}
+
+do_install() {
+  oe_runmake 'DESTDIR=${D}' install
+}
diff --git a/meta/recipes-devtools/swig/swig.inc b/meta/recipes-devtools/swig/swig.inc
new file mode 100644
index 0000000..9821fa5
--- /dev/null
+++ b/meta/recipes-devtools/swig/swig.inc
@@ -0,0 +1,63 @@
+DESCRIPTION = "SWIG - Simplified Wrapper and Interface Generator"
+HOMEPAGE = "http://swig.sourceforge.net/"
+LICENSE = "BSD & GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e7807a6282784a7dde4c846626b08fc6 \
+                    file://LICENSE-GPL;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://LICENSE-UNIVERSITIES;md5=8ce9dcc8f7c994de4a408b205c72ba08"
+
+SECTION = "devel"
+
+DEPENDS = "libpcre python"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
+
+inherit autotools pythonnative
+
+EXTRA_OECONF = " \
+    --with-python=${PYTHON} \
+    --without-allegrocl \
+    --without-android \
+    --without-boost \
+    --without-chicken \
+    --without-clisp \
+    --without-csharp \
+    --without-d \
+    --without-gcj \
+    --without-go \
+    --without-guile \
+    --without-java \
+    --without-lua \
+    --without-mzscheme \
+    --without-ocaml \
+    --without-octave \
+    --without-perl5 \
+    --without-pike \
+    --without-php \
+    --without-python3 \
+    --without-r \
+    --without-ruby \
+    --without-tcl \
+"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_configure() {
+    install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/Tools/config
+    install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/Tools/config
+    install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+    install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+    oe_runconf
+}
+
+do_install_append_class-nativesdk() {
+    cd ${D}${bindir}
+    ln -s swig swig2.0
+}
+
+def swiglib_relpath(d):
+    swiglib = d.getVar('datadir', True) + "/" + d.getVar('BPN', True) + "/" + d.getVar('PV', True)
+    return os.path.relpath(swiglib, d.getVar('bindir', True))
+
+do_install_append_class-native() {
+    create_wrapper ${D}${bindir}/swig SWIG_LIB='`dirname $''realpath`'/${@swiglib_relpath(d)}
+}
diff --git a/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch b/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch
new file mode 100644
index 0000000..81df3e2
--- /dev/null
+++ b/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch
@@ -0,0 +1,69 @@
+From a4a0440a644c6c5e5da096efe3cf05ba309a284f Mon Sep 17 00:00:00 2001
+From: "NODA, Kai" <nodakai@gmail.com>
+Date: Sun, 22 Apr 2012 17:01:02 +0900
+Subject: [PATCH] Use /proc/self/exe for "swig -swiglib" on non-Win32
+ platforms.
+
+If it wasn't found, then fall back to a fixed string just as before.
+
+Upstream-Status: Submitted
+http://sourceforge.net/mailarchive/message.php?msg_id=29179733
+
+---
+ Source/Modules/main.cxx |   24 ++++++++++++++++++++++--
+ 1 file changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx
+index d2f5d3b..cbb0a12 100644
+--- a/Source/Modules/main.cxx
++++ b/Source/Modules/main.cxx
+@@ -26,6 +26,11 @@ char cvsroot_main_cxx[] = "$Id$";
+ #include "cparse.h"
+ #include <ctype.h>
+ #include <limits.h>		// for INT_MAX
++#ifndef _WIN32
++#include <cstddef>
++#include <unistd.h>		// for readlink
++#include <sys/stat.h>		// for stat
++#endif
+ 
+ // Global variables
+ 
+@@ -902,9 +907,9 @@ int SWIG_main(int argc, char *argv[], Language *l) {
+ 
+   // Check for SWIG_LIB environment variable
+   if ((c = getenv("SWIG_LIB")) == (char *) 0) {
++    char *p;
+ #if defined(_WIN32)
+     char buf[MAX_PATH];
+-    char *p;
+     if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) {
+       *(p + 1) = '\0';
+       SwigLib = NewStringf("%sLib", buf); // Native windows installation path
+@@ -914,7 +919,22 @@ int SWIG_main(int argc, char *argv[], Language *l) {
+     if (Len(SWIG_LIB_WIN_UNIX) > 0)
+       SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw)
+ #else
+-    SwigLib = NewString(SWIG_LIB);
++    char buf[PATH_MAX];
++    if (0 < ::readlink("/proc/self/exe", buf, sizeof(buf)) &&
++        (p = ::strstr(buf, "/bin/swig"))) {
++        int major, minor, patch;
++        const int ret = ::sscanf(VERSION, "%d.%d.%d", &major, &minor, &patch);
++        if (3 == ret) {
++            const ::ptrdiff_t dir_part_len = p - buf;
++            ::snprintf(p, PATH_MAX - dir_part_len, "/share/swig/%d.%d.%d", major, minor, patch);
++            struct ::stat stat_res;
++            if (0 == ::stat(buf, &stat_res) && S_ISDIR(stat_res.st_mode)) {
++                SwigLib = NewString(buf);
++            }
++        }
++    }
++    if (NULL == SwigLib)
++        SwigLib = NewString(SWIG_LIB);
+ #endif
+   } else {
+     SwigLib = NewString(c);
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch b/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
new file mode 100644
index 0000000..1b1128a
--- /dev/null
+++ b/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
@@ -0,0 +1,64 @@
+From 5c4d6d8538994d5fe9b3b46bfafaf0a605e3bda6 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen.kooi@linaro.org>
+Date: Tue, 17 Jun 2014 08:18:17 +0200
+Subject: [PATCH] configure: use pkg-config for pcre detection
+
+Signed-off-by: Koen Kooi <koen.kooi@linaro.org>
+Upstream-Status: pending
+---
+ configure.ac | 38 +++++++-------------------------------
+ 1 file changed, 7 insertions(+), 31 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0c984b7..6edcec1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -70,38 +70,14 @@ AC_MSG_RESULT([$with_pcre])
+ 
+ dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script
+ if test x"${with_pcre}" = xyes ; then
+-  AC_MSG_CHECKING([whether to use local PCRE])
+-  local_pcre_config=no
+-  if test -z $PCRE_CONFIG; then
+-    if test -f `pwd`/pcre/pcre-swig-install/bin/pcre-config; then
+-      PCRE_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre-config
+-      local_pcre_config=$PCRE_CONFIG
+-    fi
+-  fi
+-  AC_MSG_RESULT([$local_pcre_config])
+-fi
+-AS_IF([test "x$with_pcre" != xno],
+-  [AX_PATH_GENERIC([pcre],
+-    [], dnl Minimal version of PCRE we need -- accept any
+-    [], dnl custom sed script for version parsing is not needed
+-    [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
+-     LIBS="$LIBS $PCRE_LIBS"
+-     CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
+-    ],
+-    [AC_MSG_FAILURE([
+-        Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions)
+-        library package. This dependency is needed for configure to complete,
+-        Either:
+-        - Install the PCRE developer package on your system (preferred approach).
+-        - Download the PCRE source tarball, build and install on your system
+-          as you would for any package built from source distribution.
+-        - Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically
+-          link against. Run 'Tools/pcre-build.sh --help' for instructions.
+-          (quite easy and does not require privileges to install PCRE on your system)
+-        - Use configure --without-pcre to disable regular expressions support in SWIG
+-          (not recommended).])
+-    ])
++  PKG_CHECK_MODULES([PCRE], [libpcre], [
++    AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
++    LIBS="$LIBS $PCRE_LIBS"
++    CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
++  ], [
++    AC_MSG_WARN([$PCRE_PKG_ERRORS])
+   ])
++fi
+ 
+ 
+ dnl CCache
+-- 
+1.9.3
+
diff --git a/meta/recipes-devtools/swig/swig_3.0.6.bb b/meta/recipes-devtools/swig/swig_3.0.6.bb
new file mode 100644
index 0000000..2a0917e
--- /dev/null
+++ b/meta/recipes-devtools/swig/swig_3.0.6.bb
@@ -0,0 +1,8 @@
+require ${BPN}.inc
+
+SRC_URI += "file://0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch \
+            file://0001-configure-use-pkg-config-for-pcre-detection.patch \
+           "
+SRC_URI[md5sum] = "df43ae271642bcfa61c1e59f970f9963"
+SRC_URI[sha256sum] = "c67f63ea11956106e4cda66416d5020330dc4ce2ee45057d39a9494ce33eca05"
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch b/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch
new file mode 100644
index 0000000..3ab7875
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/0001-linux-syslinux-support-ext2-3-4-device.patch
@@ -0,0 +1,84 @@
+From 60f3833ab2b5899771b4eab654e88f9888b99501 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:01:55 +0800
+Subject: [PATCH 1/9] linux/syslinux: support ext2/3/4 device
+
+* Support ext2/3/4 deivce.
+* The open_ext2_fs() checks whether it is an ext2/3/4 device,
+  do the ext2/3/4 installation (install_to_ext2()) if yes, otherwise go
+  on to the fat/ntfs.
+* The ext2/3/4 support doesn't require root privileges since it doesn't need
+  mount (but write permission is required).
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 36 ++++++++++++++++++++++++++++++++++++
+ 1 file changed, 36 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 912de71..36fc202 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -256,6 +256,23 @@ int do_open_file(char *name)
+     return fd;
+ }
+ 
++/*
++ * Check whether the device contains an ext2, ext3 or ext4 fs and open it if
++ * true.
++ * return value:
++ * 0: Everything is OK
++ * 1: Not an ext2, ext3 or ext4
++ * -1: unexpected error
++ */
++static int open_ext2_fs(const char *device, const char *subdir)
++{
++}
++
++/* The install func for ext2, ext3 and ext4 */
++static int install_to_ext2(const char *device, int dev_fd, const char *subdir)
++{
++}
++
+ int main(int argc, char *argv[])
+ {
+     static unsigned char sectbuf[SECTOR_SIZE];
+@@ -313,6 +330,24 @@ int main(int argc, char *argv[])
+ 	die("can't combine an offset with a block device");
+     }
+ 
++    /*
++     * Check if it is an ext2, ext3 or ext4
++     */
++    rv = open_ext2_fs(opt.device, subdir);
++    if (rv == 0) {
++        if (install_to_ext2(opt.device, dev_fd, subdir)) {
++            fprintf(stderr, "%s: installation failed\n", opt.device);
++            exit(1);
++        }
++        return 0;
++    /* Unexpected errors */
++    } else if (rv == -1) {
++        exit(1);
++    }
++
++    /* Reset rv */
++    rv = 0;
++
+     xpread(dev_fd, sectbuf, SECTOR_SIZE, opt.offset);
+     fsync(dev_fd);
+ 
+@@ -322,6 +357,7 @@ int main(int argc, char *argv[])
+      */
+     if ((errmsg = syslinux_check_bootsect(sectbuf, &fs_type))) {
+ 	fprintf(stderr, "%s: %s\n", opt.device, errmsg);
++	fprintf(stderr, "%s: supported fs: fat/ntfs/ext2/ex3/ext4\n", program);
+ 	exit(1);
+     }
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch b/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch
new file mode 100644
index 0000000..77cf060
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/0002-linux-syslinux-implement-open_ext2_fs.patch
@@ -0,0 +1,141 @@
+From 07fb737fb60c08eaaa41989d531fc23009523546 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:09:18 +0800
+Subject: [PATCH 2/9] linux/syslinux: implement open_ext2_fs()
+
+The open_ext2_fs() checks whether it is an ext2/ext3/ext4 device, and
+return:
+0: It is an ext2, ext3 or ext4.
+1: Not an ext2, ext3 or ext4.
+-1: unexpected error.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/Makefile   |  2 +-
+ linux/syslinux.c | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 81 insertions(+), 1 deletion(-)
+
+diff --git a/linux/Makefile b/linux/Makefile
+index 11667e1..ac1ac58 100644
+--- a/linux/Makefile
++++ b/linux/Makefile
+@@ -51,7 +51,7 @@ spotless: clean
+ installer: syslinux syslinux-nomtools
+ 
+ syslinux: $(OBJS)
+-	$(CC) $(LDFLAGS) -o $@ $^
++	$(CC) $(LDFLAGS) -o $@ $^ -lext2fs
+ 
+ syslinux-nomtools: syslinux
+ 	ln -f $< $@
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 36fc202..cc4e7da 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -72,6 +72,7 @@
+ #include "syslxfs.h"
+ #include "setadv.h"
+ #include "syslxopt.h" /* unified options */
++#include <ext2fs/ext2fs.h>
+ 
+ extern const char *program;	/* Name of program */
+ 
+@@ -82,6 +83,9 @@ char *mntpath = NULL;		/* Path on which to mount */
+ int loop_fd = -1;		/* Loop device */
+ #endif
+ 
++ext2_filsys     e2fs = NULL;    /* Ext2/3/4 filesystem */
++ext2_ino_t      root, cwd;      /* The root and cwd of e2fs */
++
+ void __attribute__ ((noreturn)) die(const char *msg)
+ {
+     fprintf(stderr, "%s: %s\n", program, msg);
+@@ -266,6 +270,82 @@ int do_open_file(char *name)
+  */
+ static int open_ext2_fs(const char *device, const char *subdir)
+ {
++    int         retval;
++    int         open_flag = EXT2_FLAG_RW, mount_flags;
++    ext2_ino_t  dirino;
++    char        opt_string[40];
++
++    if (opt.offset) {
++        sprintf(opt_string, "offset=%llu", (unsigned long long)opt.offset);
++        retval = ext2fs_open2(device, opt_string, open_flag, 0, 0, unix_io_manager, &e2fs);
++    } else
++        retval = ext2fs_open(device, open_flag, 0, 0, unix_io_manager, &e2fs);
++    if (retval) {
++        /* It might not be an extN fs, so we need check magic firstly */
++        if (retval == EXT2_ET_BAD_MAGIC) {
++            /* Do nothing, return silently */
++            return 1;
++        } else {
++            fprintf(stderr, "%s: error while trying to open: %s\n",
++                program, device);
++            return -1;
++        }
++    }
++
++    /* Stop if it is mounted */
++    retval = ext2fs_check_if_mounted(device, &mount_flags);
++    if (retval) {
++        fprintf(stderr, "%s: ext2fs_check_if_mount() error on %s\n",
++                program, device);
++        goto fail;
++    }
++
++    if (mount_flags & EXT2_MF_MOUNTED) {
++        fprintf(stderr, "%s: %s is mounted\n", program, device);
++        goto fail;
++    }
++
++    e2fs->default_bitmap_type = EXT2FS_BMAP64_RBTREE;
++
++    /* Read the inode map */
++    retval = ext2fs_read_inode_bitmap(e2fs);
++    if (retval) {
++        fprintf(stderr, "%s: while reading inode bitmap: %s\n",
++                program, device);
++        goto fail;
++    }
++
++    /* Read the block map */
++    retval = ext2fs_read_block_bitmap(e2fs);
++    if (retval) {
++        fprintf(stderr, "%s: while reading block bitmap: %s\n",
++                program, device);
++        goto fail;
++    }
++
++    root = cwd = EXT2_ROOT_INO;
++    /* Check the subdir */
++    if (strcmp(subdir, "/")) {
++	retval = ext2fs_namei(e2fs, root, cwd, subdir, &dirino);
++        if (retval) {
++            fprintf(stderr, "%s: failed to find dir %s on %s\n",
++                program, subdir, device);
++            goto fail;
++        }
++
++        retval = ext2fs_check_directory(e2fs, dirino);
++        if (retval) {
++            fprintf(stderr, "%s: failed to cd to: %s\n", program, subdir);
++                goto fail;
++        }
++        cwd = dirino;
++    }
++
++    return 0;
++
++fail:
++    (void) ext2fs_close(e2fs);
++    return -1;
+ }
+ 
+ /* The install func for ext2, ext3 and ext4 */
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch b/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch
new file mode 100644
index 0000000..84ba105
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/0003-linux-syslinux-implement-install_to_ext2.patch
@@ -0,0 +1,116 @@
+From 64d856b243812907068776b204a003a3a8fa122a Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:17:42 +0800
+Subject: [PATCH 3/9] linux/syslinux: implement install_to_ext2()
+
+* The handle_adv_on_ext() checks whether we only need update adv.
+* The write_to_ext() installs files (ldlinux.sys or ldlinux.c32) to the
+  device.
+* The install_bootblock() installs the boot block.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 79 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index cc4e7da..45f080d 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -346,11 +346,90 @@ static int open_ext2_fs(const char *device, const char *subdir)
+ fail:
+     (void) ext2fs_close(e2fs);
+     return -1;
++
++}
++
++/*
++ * Install the boot block on the specified device.
++ * Must be run AFTER file installed.
++ */
++int install_bootblock(int fd, const char *device)
++{
++}
++
++static int handle_adv_on_ext(void)
++{
++}
++
++/* Write files, adv, boot sector */
++static int write_to_ext(const char *filename, const char *str, int length,
++                        int i_flags, int dev_fd, const char *subdir)
++{
+ }
+ 
+ /* The install func for ext2, ext3 and ext4 */
+ static int install_to_ext2(const char *device, int dev_fd, const char *subdir)
+ {
++    int         retval;
++    ext2_ino_t  oldino;
++
++    const char *file = "ldlinux.sys";
++    const char *oldfile = "extlinux.sys";
++    const char *c32file = "ldlinux.c32";
++
++    /* Handle the adv */
++    if (handle_adv_on_ext() < 0) {
++        fprintf(stderr, "%s: error while handling ADV on %s\n",
++                program, device);
++        retval = 1;
++        goto fail;
++    }
++
++    /* Return if only need update the adv */
++    if (opt.update_only == -1) {
++        return ext2fs_close(e2fs);
++    }
++
++    /* Write ldlinux.sys, adv, boot sector */
++    retval = write_to_ext(file, (const char _force *)boot_image,
++                boot_image_len, EXT2_IMMUTABLE_FL, dev_fd, subdir);
++    if (retval) {
++        fprintf(stderr, "%s: ERROR: while writing: %s.\n",
++                program, file);
++        goto fail;
++    }
++
++    /* Write ldlinux.c32 */
++    retval = write_to_ext(c32file,
++                (const char _force *)syslinux_ldlinuxc32,
++                syslinux_ldlinuxc32_len, 0, dev_fd, subdir);
++    if (retval) {
++        fprintf(stderr, "%s: ERROR: while writing: %s.\n",
++                program, c32file);
++        goto fail;
++    }
++
++    /* Look if we have the extlinux.sys and remove it*/
++    retval = ext2fs_namei(e2fs, root, cwd, oldfile, &oldino);
++    if (retval == 0) {
++        retval = ext2fs_unlink(e2fs, cwd, oldfile, oldino, 0);
++        if (retval) {
++            fprintf(stderr, "%s: ERROR: failed to unlink: %s\n",
++                program, oldfile);
++            goto fail;
++        }
++    } else {
++        retval = 0;
++    }
++
++    sync();
++    retval = install_bootblock(dev_fd, device);
++    close(dev_fd);
++    sync();
++
++fail:
++    (void) ext2fs_close(e2fs);
++    return retval;
+ }
+ 
+ int main(int argc, char *argv[])
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch b/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch
new file mode 100644
index 0000000..64b56d9
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch
@@ -0,0 +1,91 @@
+From 35d3842cc4b930c5102eed2921e0189b7f4fd069 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:43:37 +0800
+Subject: [PATCH 4/9] linux/syslinux: add ext_file_read() and ext_file_write()
+
+Will use them to read and write on the extX device.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 62 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 45f080d..247c86a 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -349,6 +349,68 @@ fail:
+ 
+ }
+ 
++/* Read from an ext2_file */
++static int ext_file_read(ext2_file_t e2_file, void *buf, size_t count,
++                        off_t offset, const char *msg)
++{
++    int                 retval;
++    char                *ptr = (char *) buf;
++    unsigned int        got = 0;
++    size_t              done = 0;
++
++    /* Always lseek since e2_file is uncontrolled by this func */
++    if (ext2fs_file_lseek(e2_file, offset, EXT2_SEEK_SET, NULL)) {
++        fprintf(stderr, "%s: ext2fs_file_lseek() failed.\n",
++            program);
++        return -1;
++    }
++
++    while (1) {
++        retval = ext2fs_file_read(e2_file, ptr, count, &got);
++        if (retval) {
++            fprintf(stderr, "%s: error while reading %s\n",
++                    program, msg);
++            return -1;
++        }
++        count -= got;
++        ptr += got;
++        done += got;
++        if (got == 0 || count == 0)
++            break;
++    }
++
++    return done;
++}
++
++/* Write to an ext2_file */
++static int ext_file_write(ext2_file_t e2_file, const void *buf, size_t count,
++                        off_t offset)
++{
++    const char          *ptr = (const char *) buf;
++    unsigned int        written = 0;
++    size_t              done = 0;
++
++    /* Always lseek since e2_file is uncontrolled by this func */
++    if (ext2fs_file_lseek(e2_file, offset, EXT2_SEEK_SET, NULL)) {
++            fprintf(stderr, "%s: ext2fs_file_lseek() failed.\n",
++                program);
++            return -1;
++    }
++
++    while (count > 0) {
++        if (ext2fs_file_write(e2_file, ptr, count, &written)) {
++            fprintf(stderr, "%s: failed to write syslinux adv.\n",
++                    program);
++            return -1;
++        }
++        count -= written;
++        ptr += written;
++        done += written;
++    }
++
++    return done;
++}
++
+ /*
+  * Install the boot block on the specified device.
+  * Must be run AFTER file installed.
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch b/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch
new file mode 100644
index 0000000..829e7c4
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/0005-linux-syslinux-implement-handle_adv_on_ext.patch
@@ -0,0 +1,127 @@
+From cdb980b37f40dc2c41891434c7736e49da53756e Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 16:47:52 +0800
+Subject: [PATCH 5/9] linux/syslinux: implement handle_adv_on_ext()
+
+It reads adv if found on the device, or resets syslinux_adv, or update
+the adv if update adv only.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 97 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index 247c86a..de5d272 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -421,6 +421,103 @@ int install_bootblock(int fd, const char *device)
+ 
+ static int handle_adv_on_ext(void)
+ {
++    int                 i, retval, found_file;
++    int                 need_close = 2; /* 2 means no need extra close */
++    char                *filenames[2] = {"ldlinux.sys", "extlinux.sys"};
++    char                *filename;
++    ext2_ino_t          newino;
++    ext2_file_t         e2_file;
++    struct ext2_inode   inode;
++
++    for (i = 0; i < 2; i++) {
++        filename = filenames[i];
++        found_file = 0;
++        retval = ext2fs_namei(e2fs, root, cwd, filename, &newino);
++        if (retval == 0) {
++            found_file = 1;
++        } else
++            continue;
++
++        need_close = i;
++
++        retval = ext2fs_file_open(e2fs, newino, EXT2_FLAG_RW, &e2_file);
++        if (retval) {
++            fprintf(stderr, "%s: failed to open %s\n",
++                program, filename);
++            goto fail;
++        }
++
++        retval = ext2fs_read_inode(e2fs, newino, &inode);
++        if (retval) {
++            fprintf(stderr, "%s: error while reading inode: %u, file: %s\n",
++                program, newino, filename);
++            goto fail;
++        }
++
++        /* Check the size to see if too small to read */
++        if (inode.i_size < 2 * ADV_SIZE) {
++            if (opt.update_only == -1) {
++                fprintf(stderr, "%s: failed to write auxilliary data\n\
++                        the size of %s is too small (need --update)?\n",
++                        program, filename);
++                retval = -1;
++                goto fail;
++            }
++            syslinux_reset_adv(syslinux_adv);
++            found_file = 0;
++            break;
++        }
++
++        /* Read the adv */
++        retval = ext_file_read(e2_file, syslinux_adv, 2 * ADV_SIZE,
++                        inode.i_size - 2 * ADV_SIZE, "ADV");
++        if (retval == -1)
++                goto fail;
++        if (retval == 2 * ADV_SIZE) {
++            retval = syslinux_validate_adv(syslinux_adv);
++            /* Read the adv successfully */
++            if (retval == 0)
++                break;
++        }
++
++        /* Close the file if reaches here, otherwise we leave the file
++         * open in case we need write it */
++        need_close = 2;
++        retval = ext2fs_file_close(e2_file);
++        if (retval) {
++            fprintf(stderr, "%s: error while closing %s\n",
++                program, filename);
++            return retval;
++        }
++    }
++
++    if (!found_file) {
++        if (opt.update_only == -1) {
++            fprintf(stderr, "%s: no ldlinux.sys or extlinux.sys found on the device\n",
++                program);
++            return -1;
++        }
++        syslinux_reset_adv(syslinux_adv);
++    }
++
++    /* The modify_adv will reset the adv if opt.reset_adv */
++    if (modify_adv() < 0) {
++        fprintf(stderr, "%s: error while modifying adv\n", program);
++        retval = -1;
++        goto fail;
++    }
++
++    /* Write adv if update_only == -1 and found file */
++    if (opt.update_only == -1 && found_file) {
++        if (ext_file_write(e2_file, syslinux_adv, 2 * ADV_SIZE ,
++                        inode.i_size - 2 * ADV_SIZE) == -1)
++                goto fail;
++    }
++
++fail:
++    if (need_close != 2)
++        (void) ext2fs_file_close(e2_file);
++    return retval;
+ }
+ 
+ /* Write files, adv, boot sector */
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch b/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch
new file mode 100644
index 0000000..cba8725
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch
@@ -0,0 +1,215 @@
+From 922e56c10e36d876777580c84daef9a66bea6525 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 31 Dec 2014 17:20:43 +0800
+Subject: [PATCH 6/9] linux/syslinux: implement write_to_ext() and add
+ syslinuxext.c
+
+* The write_to_ext() write file to the extX device, and handle the boot
+  sector.
+* The syslinuxext.c is used for placing the code which are used by
+  extlinux and syslinux (which is syslinux_patch_bootsect()).
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ libinstaller/syslinuxext.c |   7 +++
+ libinstaller/syslinuxext.h |   5 ++
+ linux/Makefile             |   3 +-
+ linux/syslinux.c           | 118 +++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 132 insertions(+), 1 deletion(-)
+ create mode 100644 libinstaller/syslinuxext.c
+ create mode 100644 libinstaller/syslinuxext.h
+
+diff --git a/libinstaller/syslinuxext.c b/libinstaller/syslinuxext.c
+new file mode 100644
+index 0000000..bb54cef
+--- /dev/null
++++ b/libinstaller/syslinuxext.c
+@@ -0,0 +1,7 @@
++#define _GNU_SOURCE
++
++/* Patch syslinux_bootsect */
++void syslinux_patch_bootsect(int dev_fd)
++{
++}
++
+diff --git a/libinstaller/syslinuxext.h b/libinstaller/syslinuxext.h
+new file mode 100644
+index 0000000..8abd8b9
+--- /dev/null
++++ b/libinstaller/syslinuxext.h
+@@ -0,0 +1,5 @@
++#ifndef EXT2_SUPER_OFFSET
++#define EXT2_SUPER_OFFSET 1024
++#endif
++
++void syslinux_patch_bootsect(int dev_fd);
+diff --git a/linux/Makefile b/linux/Makefile
+index ac1ac58..3b23867 100644
+--- a/linux/Makefile
++++ b/linux/Makefile
+@@ -30,7 +30,8 @@ SRCS     = syslinux.c \
+            ../libinstaller/syslxmod.c \
+ 	   ../libinstaller/bootsect_bin.c \
+ 	   ../libinstaller/ldlinuxc32_bin.c \
+-	   ../libinstaller/ldlinux_bin.c
++	   ../libinstaller/ldlinux_bin.c \
++	   ../libinstaller/syslinuxext.c
+ OBJS	 = $(patsubst %.c,%.o,$(notdir $(SRCS)))
+ 
+ .SUFFIXES: .c .o .i .s .S
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index de5d272..f0c97a8 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -46,6 +46,7 @@
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/mount.h>
++#include <time.h>
+ 
+ #include "linuxioctl.h"
+ 
+@@ -72,6 +73,7 @@
+ #include "syslxfs.h"
+ #include "setadv.h"
+ #include "syslxopt.h" /* unified options */
++#include "syslinuxext.h"
+ #include <ext2fs/ext2fs.h>
+ 
+ extern const char *program;	/* Name of program */
+@@ -419,6 +421,12 @@ int install_bootblock(int fd, const char *device)
+ {
+ }
+ 
++/* Construct the boot file map */
++int ext_construct_sectmap_fs(ext2_filsys fs, ext2_ino_t newino,
++                                sector_t *sectors, int nsect)
++{
++}
++
+ static int handle_adv_on_ext(void)
+ {
+     int                 i, retval, found_file;
+@@ -524,6 +532,116 @@ fail:
+ static int write_to_ext(const char *filename, const char *str, int length,
+                         int i_flags, int dev_fd, const char *subdir)
+ {
++    ext2_ino_t          newino;
++    struct ext2_inode   inode;
++    int                 retval, i, modbytes, nsect;
++    ext2_file_t         e2_file;
++    sector_t            *sectors;
++
++    /* Remove it if it is already exists */
++    retval = ext2fs_namei(e2fs, root, cwd, filename, &newino);
++    if (retval == 0) {
++        retval = ext2fs_unlink(e2fs, cwd, filename, newino, 0);
++        if (retval) {
++            fprintf(stderr, "%s: failed to unlink: %s\n", program, filename);
++            return retval;
++        }
++    }
++
++    /* Create new inode */
++    retval = ext2fs_new_inode(e2fs, cwd, 010755, 0, &newino);
++    if (retval) {
++        fprintf(stderr, "%s: ERROR: failed to create inode for: %s\n",
++                program, filename);
++        return retval;
++    }
++
++    /* Link the inode and the filename */
++    retval = ext2fs_link(e2fs, cwd, filename, newino, EXT2_FT_REG_FILE);
++    if (retval) {
++        fprintf(stderr, "%s: ERROR: failed to link inode for: %s.\n",
++                program, filename);
++        return retval;
++    }
++
++    if (ext2fs_test_inode_bitmap2(e2fs->inode_map, newino))
++       fprintf(stderr, "%s: warning: inode already set %s.\n",
++            program, filename);
++
++        ext2fs_inode_alloc_stats2(e2fs, newino, +1, 0);
++        memset(&inode, 0, sizeof(inode));
++	inode.i_mode = LINUX_S_IFREG | LINUX_S_IRUSR | LINUX_S_IRGRP
++                        | LINUX_S_IROTH;
++	inode.i_flags |= i_flags;
++        inode.i_atime = inode.i_ctime = inode.i_mtime =
++            e2fs->now ? e2fs->now : time(0);
++        inode.i_links_count = 1;
++        if (e2fs->super->s_feature_incompat &
++            EXT3_FEATURE_INCOMPAT_EXTENTS) {
++            struct ext3_extent_header *eh;
++
++            eh = (struct ext3_extent_header *) &inode.i_block[0];
++            eh->eh_depth = 0;
++            eh->eh_entries = 0;
++            eh->eh_magic = ext2fs_cpu_to_le16(EXT3_EXT_MAGIC);
++            i = (sizeof(inode.i_block) - sizeof(*eh)) /
++                sizeof(struct ext3_extent);
++            eh->eh_max = ext2fs_cpu_to_le16(i);
++            inode.i_flags |= EXT4_EXTENTS_FL;
++    }
++
++    retval = ext2fs_write_new_inode(e2fs, newino, &inode);
++    if (retval) {
++        fprintf(stderr, "%s: ERROR: while writting inode %d.\n",
++                program, newino);
++        return 1;
++    }
++
++    retval = ext2fs_file_open(e2fs, newino, EXT2_FILE_WRITE, &e2_file);
++    if (retval) {
++        fprintf(stderr, "%s: ERROR: failed to open %s.\n",
++                program, filename);
++        return 1;
++    }
++
++    /* Write to file */
++    if (ext_file_write(e2_file, str, length, 0) == -1)
++        goto fail;
++
++    if (strcmp(filename, "ldlinux.sys") == 0) {
++        /* Write ADV */
++        if (ext_file_write(e2_file, syslinux_adv, 2 * ADV_SIZE,
++                boot_image_len) == -1)
++            goto fail;
++
++        /* Patch syslinux_bootsect */
++        syslinux_patch_bootsect(dev_fd);
++
++        /* Patch ldlinux.sys */
++        nsect = (boot_image_len + SECTOR_SIZE - 1) >> SECTOR_SHIFT;
++        nsect += 2;                        /* Two sectors for the ADV */
++        sectors = alloca(sizeof(sector_t) * nsect);
++        memset(sectors, 0, nsect * sizeof *sectors);
++        /* The sectors will be modified and used by syslinux_patch() */
++        retval = ext_construct_sectmap_fs(e2fs, newino, sectors, nsect);
++        if (retval)
++            goto fail;
++
++        /* Create the modified image in memory */
++        modbytes = syslinux_patch(sectors, nsect, opt.stupid_mode,
++                            opt.raid_mode, subdir, NULL);
++
++        /* Rewrite the first modbytes of ldlinux.sys */
++        if (ext_file_write(e2_file, str, modbytes, 0) == -1) {
++            fprintf(stderr, "%s: ERROR: failed to patch %s.\n", program,
++                    filename);
++            goto fail;
++        }
++    }
++
++fail:
++    (void) ext2fs_file_close(e2_file);
++    return retval;
+ }
+ 
+ /* The install func for ext2, ext3 and ext4 */
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch b/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch
new file mode 100644
index 0000000..3913811
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch
@@ -0,0 +1,84 @@
+From a95b831e18dd123f859bc5e6c4cecdcc0184ee37 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 2 Jan 2015 12:18:02 +0800
+Subject: [PATCH 7/9] linux/syslinux: implement ext_construct_sectmap_fs()
+
+The ext_construct_sectmap_fs() constucts the sector according to the
+bmap.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 50 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index f0c97a8..c741750 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -421,10 +421,60 @@ int install_bootblock(int fd, const char *device)
+ {
+ }
+ 
++/* The file's block count */
++int block_count = 0;
++static int get_block_count(ext2_filsys fs EXT2FS_ATTR((unused)),
++			     blk64_t *blocknr EXT2FS_ATTR((unused)),
++			     e2_blkcnt_t blockcnt EXT2FS_ATTR((unused)),
++			     blk64_t ref_block EXT2FS_ATTR((unused)),
++			     int ref_offset EXT2FS_ATTR((unused)),
++			     void *private EXT2FS_ATTR((unused)))
++{
++    block_count++;
++    return 0;
++}
++
+ /* Construct the boot file map */
+ int ext_construct_sectmap_fs(ext2_filsys fs, ext2_ino_t newino,
+                                 sector_t *sectors, int nsect)
+ {
++    blk64_t             pblk, blksize, blk = 0;
++    sector_t            sec;
++    unsigned int        i;
++    int                 retval;
++
++    blksize = fs->blocksize;
++    blksize >>= SECTOR_SHIFT;
++
++    /* Get the total blocks no. */
++    retval = ext2fs_block_iterate3(fs, newino, BLOCK_FLAG_READ_ONLY,
++            NULL, get_block_count, NULL);
++    if (retval) {
++        fprintf(stderr, "%s: ERROR: ext2fs_block_iterate3() failed.\n", program);
++        return -1;
++    }
++
++    while (nsect) {
++        if (block_count-- == 0)
++            break;
++
++        /* Get the physical block no. (bmap) */
++        retval = ext2fs_bmap2(fs, newino, 0, 0, 0, blk, 0, &pblk);
++        if (retval) {
++            fprintf(stderr, "%s: ERROR: ext2fs_bmap2() failed.\n", program);
++            return -1;
++        }
++
++        blk++;
++        sec = (sector_t)pblk * blksize;
++        for (i = 0; i < blksize; i++) {
++            *sectors++ = sec++;
++            if (! --nsect)
++                break;
++        }
++    }
++
++    return 0;
+ }
+ 
+ static int handle_adv_on_ext(void)
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch b/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch
new file mode 100644
index 0000000..2400c98
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch
@@ -0,0 +1,427 @@
+From 78d76b87a4b855e6b661ae457283a63f385c04c9 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 2 Jan 2015 12:26:46 +0800
+Subject: [PATCH 8/9] libinstaller/syslinuxext: implement
+ syslinux_patch_bootsect()
+
+Move the related from extlinux/main.c to libinstaller/syslinuxext.c, the
+syslinux_patch_bootsect() are used by both extlinux/main.c and
+linux/syslinux.c.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ extlinux/Makefile          |   3 +-
+ extlinux/main.c            | 167 +-------------------------------------------
+ libinstaller/syslinuxext.c | 170 +++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 175 insertions(+), 165 deletions(-)
+
+diff --git a/extlinux/Makefile b/extlinux/Makefile
+index 02d1db5..90dd92f 100644
+--- a/extlinux/Makefile
++++ b/extlinux/Makefile
+@@ -31,7 +31,8 @@ SRCS     = main.c \
+ 	   ../libinstaller/advio.c \
+ 	   ../libinstaller/bootsect_bin.c \
+ 	   ../libinstaller/ldlinuxc32_bin.c \
+-	   ../libinstaller/ldlinux_bin.c
++	   ../libinstaller/ldlinux_bin.c \
++	   ../libinstaller/syslinuxext.c
+ OBJS	 = $(patsubst %.c,%.o,$(notdir $(SRCS)))
+ 
+ .SUFFIXES: .c .o .i .s .S
+diff --git a/extlinux/main.c b/extlinux/main.c
+index 09740bd..6fe026e 100644
+--- a/extlinux/main.c
++++ b/extlinux/main.c
+@@ -60,6 +60,7 @@
+ #include "setadv.h"
+ #include "syslxopt.h" /* unified options */
+ #include "mountinfo.h"
++#include "syslinuxext.h"
+ 
+ #ifdef DEBUG
+ # define dprintf printf
+@@ -67,10 +68,6 @@
+ # define dprintf(...) ((void)0)
+ #endif
+ 
+-#ifndef EXT2_SUPER_OFFSET
+-#define EXT2_SUPER_OFFSET 1024
+-#endif
+-
+ /* Since we have unused 2048 bytes in the primary AG of an XFS partition,
+  * we will use the first 0~512 bytes starting from 2048 for the Syslinux
+  * boot sector.
+@@ -92,136 +89,6 @@ static char subvol[BTRFS_SUBVOL_MAX];
+ 			  - 2*ADV_SIZE)
+ 
+ /*
+- * Get the size of a block device
+- */
+-static uint64_t get_size(int devfd)
+-{
+-    uint64_t bytes;
+-    uint32_t sects;
+-    struct stat st;
+-
+-#ifdef BLKGETSIZE64
+-    if (!ioctl(devfd, BLKGETSIZE64, &bytes))
+-	return bytes;
+-#endif
+-    if (!ioctl(devfd, BLKGETSIZE, &sects))
+-	return (uint64_t) sects << 9;
+-    else if (!fstat(devfd, &st) && st.st_size)
+-	return st.st_size;
+-    else
+-	return 0;
+-}
+-
+-/*
+- * Get device geometry and partition offset
+- */
+-struct geometry_table {
+-    uint64_t bytes;
+-    struct hd_geometry g;
+-};
+-
+-static int sysfs_get_offset(int devfd, unsigned long *start)
+-{
+-    struct stat st;
+-    char sysfs_name[128];
+-    FILE *f;
+-    int rv;
+-
+-    if (fstat(devfd, &st))
+-	return -1;
+-
+-    if ((size_t)snprintf(sysfs_name, sizeof sysfs_name,
+-			 "/sys/dev/block/%u:%u/start",
+-			 major(st.st_rdev), minor(st.st_rdev))
+-	>= sizeof sysfs_name)
+-	return -1;
+-
+-    f = fopen(sysfs_name, "r");
+-    if (!f)
+-	return -1;
+-
+-    rv = fscanf(f, "%lu", start);
+-    fclose(f);
+-
+-    return (rv == 1) ? 0 : -1;
+-}
+-
+-/* Standard floppy disk geometries, plus LS-120.  Zipdisk geometry
+-   (x/64/32) is the final fallback.  I don't know what LS-240 has
+-   as its geometry, since I don't have one and don't know anyone that does,
+-   and Google wasn't helpful... */
+-static const struct geometry_table standard_geometries[] = {
+-    {360 * 1024, {2, 9, 40, 0}},
+-    {720 * 1024, {2, 9, 80, 0}},
+-    {1200 * 1024, {2, 15, 80, 0}},
+-    {1440 * 1024, {2, 18, 80, 0}},
+-    {1680 * 1024, {2, 21, 80, 0}},
+-    {1722 * 1024, {2, 21, 80, 0}},
+-    {2880 * 1024, {2, 36, 80, 0}},
+-    {3840 * 1024, {2, 48, 80, 0}},
+-    {123264 * 1024, {8, 32, 963, 0}},	/* LS120 */
+-    {0, {0, 0, 0, 0}}
+-};
+-
+-int get_geometry(int devfd, uint64_t totalbytes, struct hd_geometry *geo)
+-{
+-    struct floppy_struct fd_str;
+-    struct loop_info li;
+-    struct loop_info64 li64;
+-    const struct geometry_table *gp;
+-    int rv = 0;
+-
+-    memset(geo, 0, sizeof *geo);
+-
+-    if (!ioctl(devfd, HDIO_GETGEO, geo)) {
+-	goto ok;
+-    } else if (!ioctl(devfd, FDGETPRM, &fd_str)) {
+-	geo->heads = fd_str.head;
+-	geo->sectors = fd_str.sect;
+-	geo->cylinders = fd_str.track;
+-	geo->start = 0;
+-	goto ok;
+-    }
+-
+-    /* Didn't work.  Let's see if this is one of the standard geometries */
+-    for (gp = standard_geometries; gp->bytes; gp++) {
+-	if (gp->bytes == totalbytes) {
+-	    memcpy(geo, &gp->g, sizeof *geo);
+-	    goto ok;
+-	}
+-    }
+-
+-    /* Didn't work either... assign a geometry of 64 heads, 32 sectors; this is
+-       what zipdisks use, so this would help if someone has a USB key that
+-       they're booting in USB-ZIP mode. */
+-
+-    geo->heads = opt.heads ? : 64;
+-    geo->sectors = opt.sectors ? : 32;
+-    geo->cylinders = totalbytes / (geo->heads * geo->sectors << SECTOR_SHIFT);
+-    geo->start = 0;
+-
+-    if (!opt.sectors && !opt.heads) {
+-	fprintf(stderr,
+-		"Warning: unable to obtain device geometry (defaulting to %d heads, %d sectors)\n"
+-		"         (on hard disks, this is usually harmless.)\n",
+-		geo->heads, geo->sectors);
+-	rv = 1;			/* Suboptimal result */
+-    }
+-
+-ok:
+-    /* If this is a loopback device, try to set the start */
+-    if (!ioctl(devfd, LOOP_GET_STATUS64, &li64))
+-	geo->start = li64.lo_offset >> SECTOR_SHIFT;
+-    else if (!ioctl(devfd, LOOP_GET_STATUS, &li))
+-	geo->start = (unsigned int)li.lo_offset >> SECTOR_SHIFT;
+-    else if (!sysfs_get_offset(devfd, &geo->start)) {
+-	/* OK */
+-    }
+-
+-    return rv;
+-}
+-
+-/*
+  * Query the device geometry and put it into the boot sector.
+  * Map the file and put the map in the boot sector and file.
+  * Stick the "current directory" inode number into the file.
+@@ -231,11 +98,8 @@ ok:
+ static int patch_file_and_bootblock(int fd, const char *dir, int devfd)
+ {
+     struct stat dirst, xdst;
+-    struct hd_geometry geo;
+     sector_t *sectp;
+-    uint64_t totalbytes, totalsectors;
+     int nsect;
+-    struct fat_boot_sector *sbs;
+     char *dirpath, *subpath, *xdirpath;
+     int rv;
+ 
+@@ -279,33 +143,8 @@ static int patch_file_and_bootblock(int fd, const char *dir, int devfd)
+     /* Now subpath should contain the path relative to the fs base */
+     dprintf("subpath = %s\n", subpath);
+ 
+-    totalbytes = get_size(devfd);
+-    get_geometry(devfd, totalbytes, &geo);
+-
+-    if (opt.heads)
+-	geo.heads = opt.heads;
+-    if (opt.sectors)
+-	geo.sectors = opt.sectors;
+-
+-    /* Patch this into a fake FAT superblock.  This isn't because
+-       FAT is a good format in any way, it's because it lets the
+-       early bootstrap share code with the FAT version. */
+-    dprintf("heads = %u, sect = %u\n", geo.heads, geo.sectors);
+-
+-    sbs = (struct fat_boot_sector *)syslinux_bootsect;
+-
+-    totalsectors = totalbytes >> SECTOR_SHIFT;
+-    if (totalsectors >= 65536) {
+-	set_16(&sbs->bsSectors, 0);
+-    } else {
+-	set_16(&sbs->bsSectors, totalsectors);
+-    }
+-    set_32(&sbs->bsHugeSectors, totalsectors);
+-
+-    set_16(&sbs->bsBytesPerSec, SECTOR_SIZE);
+-    set_16(&sbs->bsSecPerTrack, geo.sectors);
+-    set_16(&sbs->bsHeads, geo.heads);
+-    set_32(&sbs->bsHiddenSecs, geo.start);
++    /* Patch syslinux_bootsect */
++    syslinux_patch_bootsect(devfd);
+ 
+     /* Construct the boot file map */
+ 
+diff --git a/libinstaller/syslinuxext.c b/libinstaller/syslinuxext.c
+index bb54cef..5a4423b 100644
+--- a/libinstaller/syslinuxext.c
++++ b/libinstaller/syslinuxext.c
+@@ -1,7 +1,177 @@
+ #define _GNU_SOURCE
+ 
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <getopt.h>
++#include <ext2fs/ext2fs.h>
++
++#include "linuxioctl.h"
++#include "syslinux.h"
++#include "syslxint.h"
++#include "syslxopt.h"
++
++/*
++ * Get the size of a block device
++ */
++static uint64_t get_size(int dev_fd)
++{
++    uint64_t bytes;
++    uint32_t sects;
++    struct stat st;
++
++#ifdef BLKGETSIZE64
++    if (!ioctl(dev_fd, BLKGETSIZE64, &bytes))
++	return bytes;
++#endif
++    if (!ioctl(dev_fd, BLKGETSIZE, &sects))
++	return (uint64_t) sects << 9;
++    else if (!fstat(dev_fd, &st) && st.st_size)
++	return st.st_size;
++    else
++	return 0;
++}
++
++/*
++ * Get device geometry and partition offset
++ */
++static struct geometry_table {
++    uint64_t bytes;
++    struct hd_geometry g;
++};
++
++static int sysfs_get_offset(int dev_fd, unsigned long *start)
++{
++    struct stat st;
++    char sysfs_name[128];
++    FILE *f;
++    int rv;
++
++    if (fstat(dev_fd, &st))
++	return -1;
++
++    if ((size_t)snprintf(sysfs_name, sizeof sysfs_name,
++			 "/sys/dev/block/%u:%u/start",
++			 major(st.st_rdev), minor(st.st_rdev))
++	>= sizeof sysfs_name)
++	return -1;
++
++    f = fopen(sysfs_name, "r");
++    if (!f)
++	return -1;
++
++    rv = fscanf(f, "%lu", start);
++    fclose(f);
++
++    return (rv == 1) ? 0 : -1;
++}
++
++/* Standard floppy disk geometries, plus LS-120.  Zipdisk geometry
++   (x/64/32) is the final fallback.  I don't know what LS-240 has
++   as its geometry, since I don't have one and don't know anyone that does,
++   and Google wasn't helpful... */
++static const struct geometry_table standard_geometries[] = {
++    {360 * 1024, {2, 9, 40, 0}},
++    {720 * 1024, {2, 9, 80, 0}},
++    {1200 * 1024, {2, 15, 80, 0}},
++    {1440 * 1024, {2, 18, 80, 0}},
++    {1680 * 1024, {2, 21, 80, 0}},
++    {1722 * 1024, {2, 21, 80, 0}},
++    {2880 * 1024, {2, 36, 80, 0}},
++    {3840 * 1024, {2, 48, 80, 0}},
++    {123264 * 1024, {8, 32, 963, 0}},	/* LS120 */
++    {0, {0, 0, 0, 0}}
++};
++
++static int get_geometry(int dev_fd, uint64_t totalbytes, struct hd_geometry *geo)
++{
++    struct floppy_struct fd_str;
++    struct loop_info li;
++    struct loop_info64 li64;
++    const struct geometry_table *gp;
++    int rv = 0;
++
++    memset(geo, 0, sizeof *geo);
++
++    if (!ioctl(dev_fd, HDIO_GETGEO, geo)) {
++	goto ok;
++    } else if (!ioctl(dev_fd, FDGETPRM, &fd_str)) {
++	geo->heads = fd_str.head;
++	geo->sectors = fd_str.sect;
++	geo->cylinders = fd_str.track;
++	geo->start = 0;
++	goto ok;
++    }
++
++    /* Didn't work.  Let's see if this is one of the standard geometries */
++    for (gp = standard_geometries; gp->bytes; gp++) {
++	if (gp->bytes == totalbytes) {
++	    memcpy(geo, &gp->g, sizeof *geo);
++	    goto ok;
++	}
++    }
++
++    /* Didn't work either... assign a geometry of 64 heads, 32 sectors; this is
++       what zipdisks use, so this would help if someone has a USB key that
++       they're booting in USB-ZIP mode. */
++
++    geo->heads = opt.heads ? : 64;
++    geo->sectors = opt.sectors ? : 32;
++    geo->cylinders = totalbytes / (geo->heads * geo->sectors << SECTOR_SHIFT);
++    geo->start = 0;
++
++    if (!opt.sectors && !opt.heads) {
++	fprintf(stderr,
++		"Warning: unable to obtain device geometry (defaulting to %d heads, %d sectors)\n"
++		"         (on hard disks, this is usually harmless.)\n",
++		geo->heads, geo->sectors);
++	rv = 1;			/* Suboptimal result */
++    }
++
++ok:
++    /* If this is a loopback device, try to set the start */
++    if (!ioctl(dev_fd, LOOP_GET_STATUS64, &li64))
++	geo->start = li64.lo_offset >> SECTOR_SHIFT;
++    else if (!ioctl(dev_fd, LOOP_GET_STATUS, &li))
++	geo->start = (unsigned int)li.lo_offset >> SECTOR_SHIFT;
++    else if (!sysfs_get_offset(dev_fd, &geo->start)) {
++	/* OK */
++    }
++
++    return rv;
++}
++
++
+ /* Patch syslinux_bootsect */
+ void syslinux_patch_bootsect(int dev_fd)
+ {
++    uint64_t totalbytes, totalsectors;
++    struct hd_geometry geo;
++    struct fat_boot_sector *sbs;
++
++    totalbytes = get_size(dev_fd);
++    get_geometry(dev_fd, totalbytes, &geo);
++
++    if (opt.heads)
++	geo.heads = opt.heads;
++    if (opt.sectors)
++	geo.sectors = opt.sectors;
++
++    /* Patch this into a fake FAT superblock.  This isn't because
++       FAT is a good format in any way, it's because it lets the
++       early bootstrap share code with the FAT version. */
++    sbs = (struct fat_boot_sector *)syslinux_bootsect;
++
++    totalsectors = totalbytes >> SECTOR_SHIFT;
++    if (totalsectors >= 65536) {
++	set_16(&sbs->bsSectors, 0);
++    } else {
++	set_16(&sbs->bsSectors, totalsectors);
++    }
++    set_32(&sbs->bsHugeSectors, totalsectors);
++
++    set_16(&sbs->bsBytesPerSec, SECTOR_SIZE);
++    set_16(&sbs->bsSecPerTrack, geo.sectors);
++    set_16(&sbs->bsHeads, geo.heads);
++    set_32(&sbs->bsHiddenSecs, geo.start);
+ }
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch b/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch
new file mode 100644
index 0000000..cd89d92
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/0009-linux-syslinux-implement-install_bootblock.patch
@@ -0,0 +1,50 @@
+From 76c465e87312dbc6cffd05427f1f4d2ebdee4f13 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 2 Jan 2015 12:28:35 +0800
+Subject: [PATCH 9/9] linux/syslinux: implement install_bootblock()
+
+Refer to the install_bootblock() in extlinux/main.c to make
+linux/syslinux.c's install_bootblock() which only supports ext2/3/4.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+Tested-by: Du Dolpher <dolpher.du@intel.com>
+---
+ linux/syslinux.c | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/linux/syslinux.c b/linux/syslinux.c
+index c741750..917f83a 100755
+--- a/linux/syslinux.c
++++ b/linux/syslinux.c
+@@ -419,6 +419,26 @@ static int ext_file_write(ext2_file_t e2_file, const void *buf, size_t count,
+  */
+ int install_bootblock(int fd, const char *device)
+ {
++    struct ext2_super_block sb;
++
++    if (xpread(fd, &sb, sizeof sb, EXT2_SUPER_OFFSET + opt.offset) != sizeof sb) {
++        perror("reading superblock");
++        return 1;
++    }
++
++    if (sb.s_magic != EXT2_SUPER_MAGIC) {
++        fprintf(stderr,
++                "no ext2/3/4 superblock found on %s\n", device);
++        return 1;
++    }
++
++    if (xpwrite(fd, syslinux_bootsect, syslinux_bootsect_len, 0)
++        != (signed)syslinux_bootsect_len) {
++        perror("writing bootblock");
++        return 1;
++    }
++
++    return 0;
+ }
+ 
+ /* The file's block count */
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch b/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch
new file mode 100644
index 0000000..312b1e8
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/syslinux-fix-parallel-building-issue.patch
@@ -0,0 +1,35 @@
+syslinux-native: fix parallel building issue
+
+There might be an error when parallel build:
+
+[snip]
+cp: cannot create directory `tmp/sysroots/x86_64-linux/usr/share/
+syslinux/com32/include/gplinclude': No such file or directory
+make[4]: *** [install] Error 1
+make[3]: *** [gpllib] Error 2
+[snip]
+
+This is a potential issue. In ${S}/com32/gpllib/Makefile file,
+install target wants to copy $(SRC)/../gplinclude to
+$(INSTALLROOT)$(COM32DIR)/include/ directory, but in ${S}/com32/lib/Makefile
+file, the install target will remove $(INSTALLROOT)$(COM32DIR)/include
+directory. We need to do com32/lib first.
+
+The patch make com32/gpllib depends on com32/lib to fix this issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ com32/Makefile |    1 +
+ 1 file changed, 1 insertion(+)
+
+Index: syslinux-6.03/com32/Makefile
+===================================================================
+--- syslinux-6.03.orig/com32/Makefile
++++ syslinux-6.03/com32/Makefile
+@@ -21,3 +21,4 @@ rosh: lib libutil
+ samples: libutil elflink/ldlinux
+ sysdump: lib libutil libupload gpllib
+ lua/src: cmenu modules
++gpllib: lib
diff --git a/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch b/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch
new file mode 100644
index 0000000..c0714b5
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/syslinux-libupload-depend-lib.patch
@@ -0,0 +1,34 @@
+From 490fc3bbd65c2c252c1fdf3da0fac9898aa9eea6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 15 Aug 2014 21:09:16 -0700
+Subject: [PATCH] com32/Makefile: fix parallel issue
+
+Fixed:
+cp -r syslinux-6.01/com32/libupload/*.h image/usr/share/syslinux/com32/include/
+[snip]
+rm -rf image/usr/share/syslinux/com32/include
+[snip]
+cp: cannot create regular file `image/usr/share/syslinux/com32/include/serial.h': No such file or directory
+
+The cp is happened in the "libupload" dir, while "rm -fr" is happend in
+"lib" dir, let "libupload" depend "lib" will fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ com32/Makefile |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/com32/Makefile b/com32/Makefile
+index 9a1721b..f172db2 100644
+--- a/com32/Makefile
++++ b/com32/Makefile
+@@ -21,3 +21,4 @@ rosh: lib libutil
+ samples: libutil elflink/ldlinux
+ sysdump: libupload gpllib
+ gpllib: lib
++libupload: lib
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch b/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch
new file mode 100644
index 0000000..7c003e1
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux/syslinux-remove-clean-script.patch
@@ -0,0 +1,17 @@
+This script try to call git submodule, since we are downloading
+the tarball it seems in-correct to do this.
+
+Upstream-Status: Inappropriate [OE-Specific]
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Index: syslinux-6.03/efi/Makefile
+===================================================================
+--- syslinux-6.03.orig/efi/Makefile
++++ syslinux-6.03/efi/Makefile
+@@ -101,7 +101,6 @@ tidy dist:
+ 	rm -f *.so *.o wrapper
+ 	find . \( -name \*.o -o -name \*.a -o -name .\*.d -o -name \*.tmp \) -print0 | \
+ 		xargs -0r rm -f
+-	$(topdir)/efi/clean-gnu-efi.sh $(EFI_SUBARCH) $(objdir)
+ 
+ clean: tidy
+ 
diff --git a/meta/recipes-devtools/syslinux/syslinux_6.03.bb b/meta/recipes-devtools/syslinux/syslinux_6.03.bb
new file mode 100644
index 0000000..ef9ae2f
--- /dev/null
+++ b/meta/recipes-devtools/syslinux/syslinux_6.03.bb
@@ -0,0 +1,89 @@
+SUMMARY = "Multi-purpose linux bootloader"
+HOMEPAGE = "http://syslinux.zytor.com/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+                    file://README;beginline=35;endline=41;md5=558f2c71cb1fb9ba511ccd4858e48e8a"
+
+# If you really want to run syslinux, you need mtools.  We just want the
+# ldlinux.* stuff for now, so skip mtools-native
+DEPENDS = "nasm-native util-linux e2fsprogs"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/boot/syslinux/syslinux-${PV}.tar.xz \
+           file://syslinux-fix-parallel-building-issue.patch \
+           file://syslinux-libupload-depend-lib.patch \
+           file://syslinux-remove-clean-script.patch \
+           file://0001-linux-syslinux-support-ext2-3-4-device.patch \
+           file://0002-linux-syslinux-implement-open_ext2_fs.patch \
+           file://0003-linux-syslinux-implement-install_to_ext2.patch \
+           file://0004-linux-syslinux-add-ext_file_read-and-ext_file_write.patch \
+           file://0005-linux-syslinux-implement-handle_adv_on_ext.patch \
+           file://0006-linux-syslinux-implement-write_to_ext-and-add-syslin.patch \
+           file://0007-linux-syslinux-implement-ext_construct_sectmap_fs.patch \
+           file://0008-libinstaller-syslinuxext-implement-syslinux_patch_bo.patch \
+           file://0009-linux-syslinux-implement-install_bootblock.patch \
+           "
+
+SRC_URI[md5sum] = "92a253df9211e9c20172796ecf388f13"
+SRC_URI[sha256sum] = "26d3986d2bea109d5dc0e4f8c4822a459276cf021125e8c9f23c3cca5d8c850e"
+
+COMPATIBLE_HOST = '(x86_64|i.86).*-(linux|freebsd.*)'
+# Don't let the sanity checker trip on the 32 bit real mode BIOS binaries
+INSANE_SKIP_${PN}-misc = "arch"
+INSANE_SKIP_${PN}-chain = "arch"
+
+EXTRA_OEMAKE = " \
+	BINDIR=${bindir} SBINDIR=${sbindir} LIBDIR=${libdir} \
+	DATADIR=${datadir} MANDIR=${mandir} INCDIR=${includedir} \
+"
+# syslinux uses $LD for linking, strip `-Wl,' so it can work
+export LDFLAGS = "`echo $LDFLAGS | sed 's/-Wl,//g'`"
+
+do_configure() {
+	# drop win32 targets or build fails
+	sed -e 's,win32/\S*,,g' -i Makefile
+
+	# clean installer executables included in source tarball
+	oe_runmake clean firmware="efi32" EFIINC="${includedir}"
+	# NOTE: There is a temporary work around above to specify
+	#	the efi32 as the firmware else the pre-built bios
+	#	files get erased contrary to the doc/distib.txt
+	#	In the future this should be "bios" and not "efi32".
+}
+
+do_compile() {
+	# Make sure the recompile is OK.
+	# Though the ${B} should always exist, still check it before find and rm.
+	[ -d "${B}" ] && find ${B} -name '.*.d' -type f -exec rm -f {} \;
+
+	# Rebuild only the installer; keep precompiled bootloaders
+	# as per author's request (doc/distrib.txt)
+	oe_runmake CC="${CC} ${CFLAGS}" LDFLAGS="${LDFLAGS}" firmware="bios" installer
+}
+
+do_install() {
+	oe_runmake CC="${CC} ${CFLAGS}" install INSTALLROOT="${D}" firmware="bios"
+
+	install -d ${D}${datadir}/syslinux/
+	install -m 644 ${S}/bios/core/ldlinux.sys ${D}${datadir}/syslinux/
+	install -m 644 ${S}/bios/core/ldlinux.bss ${D}${datadir}/syslinux/
+	install -m 755 ${S}/bios/linux/syslinux-nomtools ${D}${bindir}/
+}
+
+PACKAGES += "${PN}-nomtools ${PN}-extlinux ${PN}-mbr ${PN}-chain ${PN}-pxelinux ${PN}-isolinux ${PN}-misc"
+
+RDEPENDS_${PN} += "mtools"
+RDEPENDS_${PN}-nomtools += "libext2fs"
+RDEPENDS_${PN}-misc += "perl"
+
+FILES_${PN} = "${bindir}/syslinux"
+FILES_${PN}-nomtools = "${bindir}/syslinux-nomtools"
+FILES_${PN}-extlinux = "${sbindir}/extlinux"
+FILES_${PN}-mbr = "${datadir}/${BPN}/mbr.bin"
+FILES_${PN}-chain = "${datadir}/${BPN}/chain.c32"
+FILES_${PN}-isolinux = "${datadir}/${BPN}/isolinux.bin"
+FILES_${PN}-pxelinux = "${datadir}/${BPN}/pxelinux.0"
+FILES_${PN}-dev += "${datadir}/${BPN}/com32/lib*${SOLIBS} ${datadir}/${BPN}/com32/include ${datadir}/${BPN}/com32/com32.ld"
+FILES_${PN}-staticdev += "${datadir}/${BPN}/com32/lib*.a ${libdir}/${BPN}/com32/lib*.a"
+FILES_${PN}-misc = "${datadir}/${BPN}/* ${libdir}/${BPN}/* ${bindir}/*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch b/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch
new file mode 100644
index 0000000..5d70456
--- /dev/null
+++ b/meta/recipes-devtools/tcf-agent/tcf-agent/fix_ranlib.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate [poky-specific fix]
+
+--- a/Makefile.inc
++++ b/Makefile.inc
+@@ -57,6 +57,9 @@
+   ifeq ($(NO_UUID),)
+     LIBS += -luuid
+   endif
++  ifneq ($(RANLIB),)
++    RANLIB += $@
++  endif
+ endif
+ 
+ ifneq ($(OPSYS),Windows)
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
new file mode 100755
index 0000000..6303280
--- /dev/null
+++ b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.init
@@ -0,0 +1,75 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          tcf-agent
+# Default-Start:     3 5
+# Default-Stop:      0 1 2 6
+# Short-Description: Target Communication Framework agent
+### END INIT INFO
+
+DAEMON_PATH=/usr/sbin/tcf-agent
+DAEMON_NAME=`basename $DAEMON_PATH`
+
+. /etc/init.d/functions
+
+test -x $DAEMON_PATH || exit 0
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+export PATH
+
+RETVAL=0
+
+case "$1" in
+    start)
+        echo -n "Starting $DAEMON_NAME: "
+        $DAEMON_PATH -d -L- -l0
+        RETVAL=$?
+        if [ $RETVAL -eq 0 ] ; then
+            echo "OK"
+            touch /var/lock/subsys/$DAEMON_NAME
+        else
+            echo "FAIL"
+        fi
+        ;;
+
+    stop)
+        echo -n "Stopping $DAEMON_NAME: "
+        count=0
+        while [ -n "`/bin/pidof $DAEMON_PATH`" -a $count -lt 10 ] ; do
+            killproc $DAEMON_PATH >& /dev/null
+            sleep 1
+            RETVAL=$?
+            if [ $RETVAL != 0 -o -n "`/bin/pidof $DAEMON_PATH`" ] ; then
+                sleep 3
+            fi
+            count=`expr $count + 1`
+        done
+        rm -f /var/lock/subsys/$DAEMON_NAME
+        if [ -n "`/bin/pidof $DAEMON_PATH`" ] ; then
+            echo "FAIL"
+        else
+            echo "OK"
+        fi
+        ;;
+
+    restart)
+        $0 stop
+        sleep 1
+        $0 start
+        ;;
+
+    status)
+        status $DAEMON_NAME
+        RETVAL=$?
+        ;;
+
+    condrestart)
+        [ -f /var/lock/subsys/$DAEMON_NAME ] && $0 restart
+        ;;
+
+    *)
+        echo "usage: $0 { start | stop | status | restart | condrestart | status }"
+        ;;
+esac
+
+exit $RETVAL
+
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
new file mode 100644
index 0000000..fd9a6c4
--- /dev/null
+++ b/meta/recipes-devtools/tcf-agent/tcf-agent/tcf-agent.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Target Communication Framework agent
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=@SBINDIR@/tcf-agent -d -L- -l0
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb b/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
new file mode 100644
index 0000000..f8fd390
--- /dev/null
+++ b/meta/recipes-devtools/tcf-agent/tcf-agent_git.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Target Communication Framework for the Eclipse IDE"
+HOMEPAGE = "http://wiki.eclipse.org/TCF"
+BUGTRACKER = "https://bugs.eclipse.org/bugs/"
+
+LICENSE = "EPL-1.0 | EDL-1.0"
+LIC_FILES_CHKSUM = "file://edl-v10.html;md5=522a390a83dc186513f0500543ad3679"
+
+SRCREV = "b9a735e9c7cf82f80d412b7ab15d08b89d5a4ccc"
+PV = "1.3.0+git${SRCPV}"
+
+SRC_URI = "git://git.eclipse.org/gitroot/tcf/org.eclipse.tcf.agent.git;branch=1.3_mars_bugfix \
+           file://fix_ranlib.patch \
+           file://tcf-agent.init \
+           file://tcf-agent.service \
+          "
+
+DEPENDS = "util-linux openssl"
+RDEPENDS_${PN} = "bash"
+
+S = "${WORKDIR}/git/agent"
+
+inherit update-rc.d systemd
+
+SYSTEMD_SERVICE_${PN} = "tcf-agent.service"
+
+INITSCRIPT_NAME = "tcf-agent"
+INITSCRIPT_PARAMS = "start 99 3 5 . stop 20 0 1 2 6 ."
+
+# mangling needed for make
+MAKE_ARCH = "`echo ${TARGET_ARCH} | sed s,i.86,i686,`"
+MAKE_OS = "`echo ${TARGET_OS} | sed s,^linux.*,GNU/Linux,`"
+
+EXTRA_OEMAKE = "MACHINE=${MAKE_ARCH} OPSYS=${MAKE_OS} 'CC=${CC}' 'AR=${AR}'"
+
+# They don't build on ARM and we don't need them actually.
+CFLAGS += "-DSERVICE_RunControl=0 -DSERVICE_Breakpoints=0 \
+    -DSERVICE_Memory=0 -DSERVICE_Registers=0 -DSERVICE_MemoryMap=0 \
+    -DSERVICE_StackTrace=0 -DSERVICE_Symbols=0 -DSERVICE_LineNumbers=0 \
+    -DSERVICE_Expressions=0"
+
+do_install() {
+	oe_runmake install INSTALLROOT=${D}
+	install -d ${D}${sysconfdir}/init.d/
+	install -m 0755 ${WORKDIR}/tcf-agent.init ${D}${sysconfdir}/init.d/tcf-agent
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/tcf-agent.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tcf-agent.service
+}
+
diff --git a/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch b/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch
new file mode 100644
index 0000000..c8530e1
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tcl/alter-includedir.patch
@@ -0,0 +1,76 @@
+Lets install the include header and private header files into 
+usr/include/tcl8.6 when version of tcl is 8.6.x
+
+Upstream-Status: Inappropriate [Configuration Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmai.com>
+
+Fixed the TCL_INCLUDE_SPEC
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.in  |    2 +-
+ configure    |    4 ++--
+ configure.in |    4 ++--
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 97b983b..dc2a4df 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -53,7 +53,7 @@ DLL_INSTALL_DIR		= @DLL_INSTALL_DIR@
+ SCRIPT_INSTALL_DIR	= $(INSTALL_ROOT)$(TCL_LIBRARY)
+ 
+ # Directory in which to install the include file tcl.h:
+-INCLUDE_INSTALL_DIR	= $(INSTALL_ROOT)$(includedir)
++INCLUDE_INSTALL_DIR	= $(INSTALL_ROOT)$(includedir)/tcl$(VERSION)
+ 
+ # Path to the private tcl header dir:
+ PRIVATE_INCLUDE_DIR	= @PRIVATE_INCLUDE_DIR@
+diff --git a/configure b/configure
+index 3e78b49..24b3f92 100755
+--- a/configure
++++ b/configure
+@@ -19134,7 +19134,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+ 
+ TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+-PRIVATE_INCLUDE_DIR='$(includedir)'
++PRIVATE_INCLUDE_DIR='$(includedir)/tcl$(VERSION)'
+ HTML_DIR='$(DISTDIR)/html'
+ 
+ # Note:  in the following variable, it's important to use the absolute
+@@ -19293,7 +19293,7 @@ TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}"
+ TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}"
+ 
+ # Install time header dir can be set via --includedir
+-eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
++eval "TCL_INCLUDE_SPEC=\"-I${includedir}/tcl${VERSION}\""
+ 
+ #------------------------------------------------------------------------
+ # tclConfig.sh refers to this by a different name
+diff --git a/configure.in b/configure.in
+index 0e28b14..62d9b41 100755
+--- a/configure.in
++++ b/configure.in
+@@ -791,7 +791,7 @@ eval "TCL_LIB_FILE=libtcl${LIB_SUFFIX}"
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+ 
+ TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+-PRIVATE_INCLUDE_DIR='$(includedir)'
++PRIVATE_INCLUDE_DIR='$(includedir)/tcl$(VERSION)'
+ HTML_DIR='$(DISTDIR)/html'
+ 
+ # Note:  in the following variable, it's important to use the absolute
+@@ -912,7 +912,7 @@ TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}"
+ TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}"
+ 
+ # Install time header dir can be set via --includedir
+-eval "TCL_INCLUDE_SPEC=\"-I${includedir}\""
++eval "TCL_INCLUDE_SPEC=\"-I${includedir}/tcl${VERSION}\""
+ 
+ #------------------------------------------------------------------------
+ # tclConfig.sh refers to this by a different name
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-devtools/tcltk/tcl/fix-configure.patch b/meta/recipes-devtools/tcltk/tcl/fix-configure.patch
new file mode 100644
index 0000000..b692a0e
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tcl/fix-configure.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Pending
+
+Index: unix/tcl.m4
+===================================================================
+--- tcl8.4.11/unix.orig/tcl.m4
++++ tcl8.4.11/unix/tcl.m4
+@@ -845,7 +845,7 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [
+ 	    # results, and the version is kept in special file).
+ 	
+ 	    if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+-		system=MP-RAS-`awk '{print $3}' /etc/.relid'`
++		system=MP-RAS-`awk '{print $3}' /etc/.relid`
+ 	    fi
+ 	    if test "`uname -s`" = "AIX" ; then
+ 		system=AIX-`uname -v`.`uname -r`
+@@ -2250,7 +2250,7 @@ AC_DEFUN(SC_BLOCKING_STYLE, [
+ 	    # results, and the version is kept in special file).
+ 	
+ 	    if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+-		system=MP-RAS-`awk '{print $3}' /etc/.relid'`
++		system=MP-RAS-`awk '{print $3}' /etc/.relid`
+ 	    fi
+ 	    if test "`uname -s`" = "AIX" ; then
+ 		system=AIX-`uname -v`.`uname -r`
+Index: unix/configure
+===================================================================
+--- tcl8.4.11/unix.orig/configure
++++ tcl8.4.11/unix/configure
+@@ -2130,7 +2130,7 @@ echo "configure:2121: checking system ve
+ 	    # results, and the version is kept in special file).
+ 	
+ 	    if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+-		system=MP-RAS-`awk '{print }' /etc/.relid'`
++		system=MP-RAS-`awk '{print }' /etc/.relid`
+ 	    fi
+ 	    if test "`uname -s`" = "AIX" ; then
+ 		system=AIX-`uname -v`.`uname -r`
+@@ -7608,7 +7608,7 @@ echo "configure:7600: checking FIONBIO v
+ 	    # results, and the version is kept in special file).
+ 	
+ 	    if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+-		system=MP-RAS-`awk '{print }' /etc/.relid'`
++		system=MP-RAS-`awk '{print }' /etc/.relid`
+ 	    fi
+ 	    if test "`uname -s`" = "AIX" ; then
+ 		system=AIX-`uname -v`.`uname -r`
diff --git a/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch b/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch
new file mode 100644
index 0000000..be27341
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tcl/fix_issue_with_old_distro_glibc.patch
@@ -0,0 +1,39 @@
+Upstream-Status: inappropriate [embedded specific]
+
+Fixes tcl target recipe build on old distros which have glibc older than 2.14
+
+| + echo 'NOTE: make  DESTDIR=/srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image install'
+| NOTE: make  DESTDIR=/srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image install
+| + make  DESTDIR=/srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image install
+| Making directory /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image/usr/lib
+| Installing message catalogs
+| Making directory /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image/usr/share/man
+| tclsh: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/tcl8.5.11/unix/libtcl8.5.so)
+| Making directory /srv/home/nitin/builds/build-gcc47/tmp/work/x86_64-poky-linux/tcl-8.5.11-r5/image/usr/bin
+| make: *** [install-msgs] Error 1
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/04/26
+
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in	2013-11-10 23:38:01.787425628 -0800
++++ unix/Makefile.in	2013-11-10 23:37:59.807425578 -0800
+@@ -686,7 +686,7 @@
+ # tcltest executable gets the build directory burned into its ld search path.
+ # This keeps tcltest from picking up an already installed version of the Tcl
+ # library.
+-SHELL_ENV =	@LD_LIBRARY_PATH_VAR@=`pwd`:${@LD_LIBRARY_PATH_VAR@} \
++SHELL_ENV =	@LD_LIBRARY_PATH_VAR@=${@LD_LIBRARY_PATH_VAR@} \
+ 		TCLLIBPATH="@abs_builddir@/pkgs" \
+ 		TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"
+ 
+@@ -712,7 +712,7 @@
+ 	$(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+ 
+ gdb-test: ${TCLTEST_EXE}
+-	@echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
++	@echo "set env @LD_LIBRARY_PATH_VAR@=$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
+ 	@echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
+ 	@echo "set args $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) -singleproc 1" >> gdb.run
+ 	$(GDB) ${TCLTEST_EXE} --command=gdb.run
diff --git a/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch b/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch
new file mode 100644
index 0000000..c60eb75
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tcl/fix_non_native_build_issue.patch
@@ -0,0 +1,64 @@
+Upstream-Status: Pending
+
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in	2013-11-10 23:37:34.243424934 -0800
++++ unix/Makefile.in	2013-11-10 23:37:34.243424934 -0800
+@@ -709,23 +709,23 @@
+ test: test-tcl test-packages
+ 
+ test-tcl: ${TCLTEST_EXE}
+-	$(SHELL_ENV) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
++	$(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+ 
+ gdb-test: ${TCLTEST_EXE}
+ 	@echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run
+ 	@echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run
+ 	@echo "set args $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) -singleproc 1" >> gdb.run
+-	$(GDB) ./${TCLTEST_EXE} --command=gdb.run
++	$(GDB) ${TCLTEST_EXE} --command=gdb.run
+ 	rm gdb.run
+ 
+ # Useful target to launch a built tcltest with the proper path,...
+ runtest: ${TCLTEST_EXE}
+-	$(SHELL_ENV) ./${TCLTEST_EXE}
++	$(SHELL_ENV) ${TCLTEST_EXE}
+ 
+ # Useful target for running the test suite with an unwritable current
+ # directory...
+ ro-test: ${TCLTEST_EXE}
+-	echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ./${TCLTEST_EXE}
++	echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | $(SHELL_ENV) ${TCLTEST_EXE}
+ 
+ # The following target generates the shared libraries in dltest/ that are used
+ # for testing; they are included as part of the "tcltest" target (via the
+@@ -743,23 +743,23 @@
+ # This target can be used to run tclsh from the build directory
+ # via `make shell SCRIPT=/tmp/foo.tcl`
+ shell: ${TCL_EXE}
+-	$(SHELL_ENV) ./${TCL_EXE} $(SCRIPT)
++	$(SHELL_ENV) ${TCL_EXE} $(SCRIPT)
+ 
+ # This target can be used to run tclsh inside either gdb or insight
+ gdb: ${TCL_EXE}
+-	$(SHELL_ENV) $(GDB) ./${TCL_EXE}
++	$(SHELL_ENV) $(GDB) ${TCL_EXE}
+ 
+ valgrind: ${TCL_EXE} ${TCLTEST_EXE}
+-	$(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind $(TESTFLAGS)
++	$(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 -constraints valgrind $(TESTFLAGS)
+ 
+ valgrindshell: ${TCL_EXE}
+-	$(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ./${TCL_EXE} $(SCRIPT)
++	$(SHELL_ENV) $(VALGRIND) $(VALGRINDARGS) ${TCL_EXE} $(SCRIPT)
+ 
+ trace-shell: ${TCL_EXE}
+-	$(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCL_EXE} $(SCRIPT)
++	$(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ${TCL_EXE} $(SCRIPT)
+ 
+ trace-test: ${TCLTEST_EXE}
+-	$(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ./${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
++	$(SHELL_ENV) ${TRACE} $(TRACE_OPTS) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS)
+ 
+ #--------------------------------------------------------------------------
+ # Installation rules
diff --git a/meta/recipes-devtools/tcltk/tcl/no_packages.patch b/meta/recipes-devtools/tcltk/tcl/no_packages.patch
new file mode 100644
index 0000000..ab6cc43
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tcl/no_packages.patch
@@ -0,0 +1,53 @@
+tcl 8.6.0 builds by default a number of packages that are not needed in Yocto.
+This patch changes the makefile so that these packages are not built by default.
+
+Upstream-Status:Inappropriate [embedded specific]
+
+Signed-off-by: Bogdan Marinescu <bogdan.a.marinescu@intel.com>
+
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in	2013-11-10 23:38:12.235425891 -0800
++++ unix/Makefile.in	2013-11-10 23:38:12.231425891 -0800
+@@ -611,7 +611,7 @@
+ # Start of rules
+ #--------------------------------------------------------------------------
+ 
+-all: binaries libraries doc packages
++all: binaries libraries doc
+ 
+ binaries: ${LIB_FILE} $(STUB_LIB_FILE) ${TCL_EXE}
+ 
+@@ -653,12 +653,12 @@
+ #tclConfig.h: $(UNIX_DIR)/tclConfig.h.in
+ #	$(SHELL) config.status
+ 
+-clean: clean-packages
++clean:
+ 	rm -f *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
+ 		errors ${TCL_EXE} ${TCLTEST_EXE} lib.exp Tcl @DTRACE_HDR@
+ 	cd dltest ; $(MAKE) clean
+ 
+-distclean: distclean-packages clean
++distclean: clean
+ 	rm -rf Makefile config.status config.cache config.log tclConfig.sh \
+ 		tclConfig.h *.plist Tcl.framework tcl.pc
+ 	cd dltest ; $(MAKE) distclean
+@@ -706,7 +706,7 @@
+ # tcltest, ie:
+ #	% make test TESTFLAGS="-verbose bps -file fileName.test"
+ 
+-test: test-tcl test-packages
++test: test-tcl
+ 
+ test-tcl: ${TCLTEST_EXE}
+ 	$(SHELL_ENV) ${TCLTEST_EXE} $(TOP_DIR)/tests/all.tcl $(TESTFLAGS)
+@@ -771,7 +771,7 @@
+ INSTALL_DEV_TARGETS = install-headers
+ INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@
+ INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_TARGETS) \
+-		  $(INSTALL_PACKAGE_TARGETS) $(INSTALL_EXTRA_TARGETS)
++		  $(INSTALL_EXTRA_TARGETS)
+ 
+ install: $(INSTALL_TARGETS)
+ 
diff --git a/meta/recipes-devtools/tcltk/tcl/run-ptest b/meta/recipes-devtools/tcltk/tcl/run-ptest
new file mode 100644
index 0000000..dadba65
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tcl/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+for i in `ls tests/*.test |awk -F/ '{print $2}'`; \
+    do TCL_LIBRARY=library ./tcltest tests/all.tcl -file $i >$i.tmp 2>&1; \
+    grep -q "^Files with failing tests:" $i.tmp; \
+    if [ $? -eq 0 ]; then echo "FAIL: $i"; \
+    else echo "PASS: $i"; rm -f $i.tmp; fi; \
+done
diff --git a/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch b/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch
new file mode 100644
index 0000000..96276ea
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tcl/tcl-add-soname.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Pending
+
+Index: unix/configure
+===================================================================
+--- unix.orig/configure	2013-09-19 13:17:13.000000000 -0700
++++ unix/configure	2013-11-11 00:20:51.519490342 -0800
+@@ -7599,6 +7599,9 @@
+ 	    # get rid of the warnings.
+ 	    #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
+ 
++	    # following line added by CW for Debian GNU/Linux
++	    TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\${TCL_LIB_FILE}.0"
++
+ 	    SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ 	    DL_OBJS="tclLoadDl.o"
+ 	    DL_LIBS="-ldl"
+Index: unix/tcl.m4
+===================================================================
+--- unix.orig/tcl.m4	2013-09-19 13:17:13.000000000 -0700
++++ unix/tcl.m4	2013-11-11 00:17:24.263485123 -0800
+@@ -1415,6 +1415,9 @@
+ 	    # get rid of the warnings.
+ 	    #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
+ 
++	    # following line added by CW for Debian GNU/Linux
++	    TCL_SHLIB_LD_EXTRAS="-Wl,-soname,\${TCL_LIB_FILE}.0"
++
+ 	    SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
+ 	    DL_OBJS="tclLoadDl.o"
+ 	    DL_LIBS="-ldl"
+Index: unix/Makefile.in
+===================================================================
+--- unix.orig/Makefile.in	2013-09-19 13:17:13.000000000 -0700
++++ unix/Makefile.in	2013-11-11 00:20:32.423489861 -0800
+@@ -796,7 +796,10 @@
+ 	    done;
+ 	@echo "Installing $(LIB_FILE) to $(DLL_INSTALL_DIR)/"
+ 	@@INSTALL_LIB@
+-	@chmod 555 "$(DLL_INSTALL_DIR)/$(LIB_FILE)"
++	mv "$(DLL_INSTALL_DIR)"/$(LIB_FILE) "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0
++	ln -sf $(LIB_FILE).0 "$(DLL_INSTALL_DIR)"/$(LIB_FILE)
++	ln -sf "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0 ./
++	@chmod 555 "$(DLL_INSTALL_DIR)"/$(LIB_FILE).0
+ 	@echo "Installing ${TCL_EXE} as $(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
+ 	@$(INSTALL_PROGRAM) ${TCL_EXE} "$(BIN_INSTALL_DIR)/tclsh$(VERSION)${EXE_SUFFIX}"
+ 	@echo "Installing tclConfig.sh to $(CONFIG_INSTALL_DIR)/"
diff --git a/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch b/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch
new file mode 100644
index 0000000..16f7c80
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tcl/tcl-remove-hardcoded-install-path.patch
@@ -0,0 +1,47 @@
+From 6efc98774681795712073c2b91e5e9d1763239b8 Mon Sep 17 00:00:00 2001
+From: "Song.Li" <Song.Li@windriver.com>
+Date: Wed, 1 Aug 2012 19:05:51 +0800
+Subject: [PATCH] tcl:install tcl to lib64 instead of lib on 64bit target
+
+Remove hardcoded library install path. Change $(prefix)/lib/ to ${libdir}.
+
+[YOCTO #2876]
+
+This is not a bug, but libraries should be installed into directory .../lib/.
+On 64bit target that should be lib64/.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Song.Li <Song.Li@windriver.com>
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ configure |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: unix/configure
+===================================================================
+--- unix.orig/configure	2013-11-10 23:38:33.643426430 -0800
++++ unix/configure	2013-11-10 23:39:51.347428387 -0800
+@@ -19134,7 +19134,7 @@
+ 
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+ 
+-TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
++TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+ PRIVATE_INCLUDE_DIR='$(includedir)'
+ HTML_DIR='$(DISTDIR)/html'
+ 
+Index: unix/configure.in
+===================================================================
+--- unix.orig/configure.in	2013-11-10 23:20:50.000000000 -0800
++++ unix/configure.in	2013-11-10 23:39:41.199428131 -0800
+@@ -790,7 +790,7 @@
+ 
+ eval "TCL_LIB_FILE=${TCL_LIB_FILE}"
+ 
+-TCL_LIBRARY='$(prefix)/lib/tcl$(VERSION)'
++TCL_LIBRARY='$(libdir)/tcl$(VERSION)'
+ PRIVATE_INCLUDE_DIR='$(includedir)'
+ HTML_DIR='$(DISTDIR)/html'
+ 
diff --git a/meta/recipes-devtools/tcltk/tcl_8.6.4.bb b/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
new file mode 100644
index 0000000..8e92b3e
--- /dev/null
+++ b/meta/recipes-devtools/tcltk/tcl_8.6.4.bb
@@ -0,0 +1,102 @@
+SUMMARY = "Tool Command Language"
+HOMEPAGE = "http://tcl.sourceforge.net"
+SECTION = "devel/tcltk"
+
+# http://www.tcl.tk/software/tcltk/license.html
+LICENSE = "tcl & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://../license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+    file://../compat/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+    file://../library/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+    file://../macosx/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+    file://../tests/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+    file://../win/license.terms;md5=058f6229798281bbcac4239c788cfa38 \
+"
+
+DEPENDS = "tcl-native zlib"
+
+BASE_SRC_URI = "${SOURCEFORGE_MIRROR}/tcl/${BPN}${PV}-src.tar.gz \
+                file://tcl-add-soname.patch"
+SRC_URI = "${BASE_SRC_URI} \
+           file://fix_non_native_build_issue.patch \
+           file://fix_issue_with_old_distro_glibc.patch \
+           file://no_packages.patch \
+           file://tcl-remove-hardcoded-install-path.patch \
+           file://alter-includedir.patch \
+           file://run-ptest \
+"
+SRC_URI[md5sum] = "d7cbb91f1ded1919370a30edd1534304"
+SRC_URI[sha256sum] = "9e6ed94c981c1d0c5f5fefb8112d06c6bf4d050a7327e95e71d417c416519c8d"
+
+SRC_URI_class-native = "${BASE_SRC_URI}"
+
+S = "${WORKDIR}/${BPN}${PV}/unix"
+
+VER = "${PV}"
+
+inherit autotools ptest binconfig
+
+DEPENDS_class-native = "zlib-native"
+
+EXTRA_OECONF = "--enable-threads --disable-rpath --libdir=${libdir}"
+
+do_configure() {
+	cd ${S}
+	gnu-configize
+	cd ${B}
+	oe_runconf
+}
+
+do_compile_prepend() {
+	echo > ${S}/../compat/fixstrtod.c
+}
+
+do_install() {
+	autotools_do_install install-private-headers
+	ln -sf ./tclsh${VER} ${D}${bindir}/tclsh
+	ln -sf tclsh8.6 ${D}${bindir}/tclsh${VER}
+	sed -i "s+-L${B}+-L${STAGING_LIBDIR}+g" tclConfig.sh
+	sed -i "s+${WORKDIR}+${STAGING_INCDIR}+g" tclConfig.sh
+	sed -i "s,-L${libdir},-L=${libdir},g" tclConfig.sh
+	sed -i "s,-I${includedir},-I=${includedir},g" tclConfig.sh
+	install -d ${D}${bindir_crossscripts}
+	install -m 0755 tclConfig.sh ${D}${bindir_crossscripts}
+	install -m 0755 tclConfig.sh ${D}${libdir}
+	cd ..
+	for dir in compat generic unix; do
+		install -d ${D}${includedir}/${BPN}${VER}/$dir
+		install -m 0644 ${S}/../$dir/*.h ${D}${includedir}/${BPN}${VER}/$dir/
+	done
+}
+
+SYSROOT_PREPROCESS_FUNCS += "tcl_sysroot_preprocess"
+tcl_sysroot_preprocess () {
+	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+}
+
+PACKAGES =+ "tcl-lib"
+FILES_tcl-lib = "${libdir}/libtcl8.6.so.*"
+FILES_${PN} += "${libdir}/tcl${VER} ${libdir}/tcl8.6 ${libdir}/tcl8"
+FILES_${PN}-dev += "${libdir}/tclConfig.sh ${libdir}/tclooConfig.sh"
+
+# isn't getting picked up by shlibs code
+RDEPENDS_${PN} += "tcl-lib"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}-ptest += "libgcc"
+
+BBCLASSEXTEND = "native"
+
+do_compile_ptest() {
+	oe_runmake tcltest
+}
+
+do_install_ptest() {
+	cp ${B}/tcltest ${D}${PTEST_PATH}
+	cp -r ${S}/../library ${D}${PTEST_PATH}
+	cp -r ${S}/../tests ${D}${PTEST_PATH}
+}
+
+# Fix some paths that might be used by Tcl extensions
+BINCONFIG_GLOB = "*Config.sh"
+
+# Fix the path in sstate
+SSTATE_SCAN_FILES += "*Config.sh"
diff --git a/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch b/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch
new file mode 100644
index 0000000..ff745d4
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3/alternate_rpc_ports.patch
@@ -0,0 +1,158 @@
+Add ability to specify rcp port numbers
+
+In order to run more than one unfs server on a host system, you must
+be able to specify alternate rpc port numbers.
+
+Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c |   44 +++++++++++++++++++++++++++++++-------------
+ mount.c  |    4 ++--
+ 2 files changed, 33 insertions(+), 15 deletions(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -78,6 +78,8 @@ int opt_testconfig = FALSE;
+ struct in_addr opt_bind_addr;
+ int opt_readable_executables = FALSE;
+ char *opt_pid_file = NULL;
++int nfs_prog = NFS3_PROGRAM;
++int mount_prog = MOUNTPROG;
+ 
+ /* Register with portmapper? */
+ int opt_portmapper = TRUE;
+@@ -206,7 +208,7 @@ static void parse_options(int argc, char
+ {
+ 
+     int opt = 0;
+-    char *optstring = "bcC:de:hl:m:n:prstTuwi:";
++    char *optstring = "bcC:de:hl:m:n:prstTuwi:x:y:";
+ 
+     while (opt != -1) {
+ 	opt = getopt(argc, argv, optstring);
+@@ -261,8 +263,24 @@ static void parse_options(int argc, char
+ 		printf
+ 		    ("\t-r          report unreadable executables as readable\n");
+ 		printf("\t-T          test exports file and exit\n");
++		printf("\t-x <port>   alternate NFS RPC port\n");
++		printf("\t-y <port>   alternate MOUNTD RPC port\n");
+ 		exit(0);
+ 		break;
++	    case 'x':
++		nfs_prog = strtol(optarg, NULL, 10);
++		if (nfs_prog == 0) {
++		    fprintf(stderr, "Invalid NFS RPC port\n");
++		    exit(1);
++		}
++		break;
++	    case 'y':
++		mount_prog = strtol(optarg, NULL, 10);
++		if (mount_prog == 0) {
++		    fprintf(stderr, "Invalid MOUNTD RPC port\n");
++		    exit(1);
++		}
++		break;
+ 	    case 'l':
+ 		opt_bind_addr.s_addr = inet_addr(optarg);
+ 		if (opt_bind_addr.s_addr == (unsigned) -1) {
+@@ -347,12 +365,12 @@ void daemon_exit(int error)
+ #endif				       /* WIN32 */
+ 
+     if (opt_portmapper) {
+-	svc_unregister(MOUNTPROG, MOUNTVERS1);
+-	svc_unregister(MOUNTPROG, MOUNTVERS3);
++	svc_unregister(mount_prog, MOUNTVERS1);
++	svc_unregister(mount_prog, MOUNTVERS3);
+     }
+ 
+     if (opt_portmapper) {
+-	svc_unregister(NFS3_PROGRAM, NFS_V3);
++	svc_unregister(nfs_prog, NFS_V3);
+     }
+ 
+     if (error == SIGSEGV)
+@@ -657,13 +675,13 @@ static void mountprog_3(struct svc_req *
+ static void register_nfs_service(SVCXPRT * udptransp, SVCXPRT * tcptransp)
+ {
+     if (opt_portmapper) {
+-	pmap_unset(NFS3_PROGRAM, NFS_V3);
++	pmap_unset(nfs_prog, NFS_V3);
+     }
+ 
+     if (udptransp != NULL) {
+ 	/* Register NFS service for UDP */
+ 	if (!svc_register
+-	    (udptransp, NFS3_PROGRAM, NFS_V3, nfs3_program_3,
++	    (udptransp, nfs_prog, NFS_V3, nfs3_program_3,
+ 	     opt_portmapper ? IPPROTO_UDP : 0)) {
+ 	    fprintf(stderr, "%s\n",
+ 		    "unable to register (NFS3_PROGRAM, NFS_V3, udp).");
+@@ -674,7 +692,7 @@ static void register_nfs_service(SVCXPRT
+     if (tcptransp != NULL) {
+ 	/* Register NFS service for TCP */
+ 	if (!svc_register
+-	    (tcptransp, NFS3_PROGRAM, NFS_V3, nfs3_program_3,
++	    (tcptransp, nfs_prog, NFS_V3, nfs3_program_3,
+ 	     opt_portmapper ? IPPROTO_TCP : 0)) {
+ 	    fprintf(stderr, "%s\n",
+ 		    "unable to register (NFS3_PROGRAM, NFS_V3, tcp).");
+@@ -686,14 +704,14 @@ static void register_nfs_service(SVCXPRT
+ static void register_mount_service(SVCXPRT * udptransp, SVCXPRT * tcptransp)
+ {
+     if (opt_portmapper) {
+-	pmap_unset(MOUNTPROG, MOUNTVERS1);
+-	pmap_unset(MOUNTPROG, MOUNTVERS3);
++	pmap_unset(mount_prog, MOUNTVERS1);
++	pmap_unset(mount_prog, MOUNTVERS3);
+     }
+ 
+     if (udptransp != NULL) {
+ 	/* Register MOUNT service (v1) for UDP */
+ 	if (!svc_register
+-	    (udptransp, MOUNTPROG, MOUNTVERS1, mountprog_3,
++	    (udptransp, mount_prog, MOUNTVERS1, mountprog_3,
+ 	     opt_portmapper ? IPPROTO_UDP : 0)) {
+ 	    fprintf(stderr, "%s\n",
+ 		    "unable to register (MOUNTPROG, MOUNTVERS1, udp).");
+@@ -702,7 +720,7 @@ static void register_mount_service(SVCXP
+ 
+ 	/* Register MOUNT service (v3) for UDP */
+ 	if (!svc_register
+-	    (udptransp, MOUNTPROG, MOUNTVERS3, mountprog_3,
++	    (udptransp, mount_prog, MOUNTVERS3, mountprog_3,
+ 	     opt_portmapper ? IPPROTO_UDP : 0)) {
+ 	    fprintf(stderr, "%s\n",
+ 		    "unable to register (MOUNTPROG, MOUNTVERS3, udp).");
+@@ -713,7 +731,7 @@ static void register_mount_service(SVCXP
+     if (tcptransp != NULL) {
+ 	/* Register MOUNT service (v1) for TCP */
+ 	if (!svc_register
+-	    (tcptransp, MOUNTPROG, MOUNTVERS1, mountprog_3,
++	    (tcptransp, mount_prog, MOUNTVERS1, mountprog_3,
+ 	     opt_portmapper ? IPPROTO_TCP : 0)) {
+ 	    fprintf(stderr, "%s\n",
+ 		    "unable to register (MOUNTPROG, MOUNTVERS1, tcp).");
+@@ -722,7 +740,7 @@ static void register_mount_service(SVCXP
+ 
+ 	/* Register MOUNT service (v3) for TCP */
+ 	if (!svc_register
+-	    (tcptransp, MOUNTPROG, MOUNTVERS3, mountprog_3,
++	    (tcptransp, mount_prog, MOUNTVERS3, mountprog_3,
+ 	     opt_portmapper ? IPPROTO_TCP : 0)) {
+ 	    fprintf(stderr, "%s\n",
+ 		    "unable to register (MOUNTPROG, MOUNTVERS3, tcp).");
+--- a/mount.c
++++ b/mount.c
+@@ -155,8 +155,8 @@ mountres3 *mountproc_mnt_3_svc(dirpath *
+     /* error out if not version 3 */
+     if (rqstp->rq_vers != 3) {
+ 	logmsg(LOG_INFO,
+-	       "%s attempted mount with unsupported protocol version",
+-	       inet_ntoa(get_remote(rqstp)));
++	       "%s attempted mount with unsupported protocol version: %i",
++	       inet_ntoa(get_remote(rqstp)), rqstp->rq_vers);
+ 	result.fhs_status = MNT3ERR_INVAL;
+ 	return &result;
+     }
diff --git a/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch b/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch
new file mode 100644
index 0000000..aada014
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3/fix_compile_warning.patch
@@ -0,0 +1,25 @@
+daemon.c: Check exit code of chdir()
+
+Stop the compile warning and fix the code to act on a chdir() failure.
+If this one does fail something is very, very wrong.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -964,7 +964,8 @@ int main(int argc, char **argv)
+ 	sigaction(SIGALRM, &act, NULL);
+ 
+ 	/* don't make directory we started in busy */
+-	chdir("/");
++	if(chdir("/") < 0)
++	    daemon_exit(0);
+ 
+ 	/* detach from terminal */
+ 	if (opt_detach) {
diff --git a/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch b/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch
new file mode 100644
index 0000000..46b187e
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3/fix_pid_race_parent_writes_child_pid.patch
@@ -0,0 +1,61 @@
+daemon.c: Fix race window for writing of the pid file
+
+The parent process should write the pid file such that the pid file
+will can be checked immediately following exit of the fork from the
+parent.
+
+This allows external monitoring applications to watch the daemon
+without having to add sleep calls to wait for the pid file be written
+on a busy system.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c |   12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -153,7 +153,7 @@ int get_socket_type(struct svc_req *rqst
+ /*
+  * write current pid to a file
+  */
+-static void create_pid_file(void)
++static void create_pid_file(int pid)
+ {
+     char buf[16];
+     int fd, res, len;
+@@ -175,7 +175,7 @@ static void create_pid_file(void)
+     }
+ #endif
+ 
+-    sprintf(buf, "%i\n", backend_getpid());
++    sprintf(buf, "%i\n", pid);
+     len = strlen(buf);
+ 
+     res = backend_pwrite(fd, buf, len, 0);
+@@ -970,6 +970,10 @@ int main(int argc, char **argv)
+ 	    fprintf(stderr, "could not fork into background\n");
+ 	    daemon_exit(0);
+ 	}
++	if (pid)
++	    create_pid_file(pid);
++    } else {
++	create_pid_file(backend_getpid());
+     }
+ #endif				       /* WIN32 */
+ 
+@@ -1006,8 +1010,10 @@ int main(int argc, char **argv)
+ 	/* no umask to not screw up create modes */
+ 	umask(0);
+ 
++#ifdef WIN32
+ 	/* create pid file if wanted */
+-	create_pid_file();
++	create_pid_file(backend_getpid());
++#endif
+ 
+ 	/* initialize internal stuff */
+ 	fh_cache_init();
diff --git a/meta/recipes-devtools/unfs3/unfs3/fix_warnings.patch b/meta/recipes-devtools/unfs3/unfs3/fix_warnings.patch
new file mode 100644
index 0000000..cda8655
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3/fix_warnings.patch
@@ -0,0 +1,53 @@
+exports.*: fix warnings.
+
+Fix these warnings:
+lex.yy.c:1207: warning: 'yyunput' defined but not used
+lex.yy.c:1248: warning: 'input' defined but not used
+exports.y: In function 'set_hostname':
+exports.y:334: warning: large integer implicitly truncated to unsigned type
+exports.y: In function 'set_ipaddr':
+exports.y:350: warning: large integer implicitly truncated to unsigned type
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ Config/exports.l |    3 +++
+ Config/exports.y |    6 ++++--
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+--- a/Config/exports.l
++++ b/Config/exports.l
+@@ -48,6 +48,9 @@ NETCOMP [0-9]{1,2}
+ NET {IP}"/"{NETCOMP}
+ OLDNET {IP}"/"{IP}
+ 
++%option nounput
++%option noinput
++
+ %%
+ 
+ ^{WHITE}*\n		{ /* eat empty line */ }
+--- a/Config/exports.y
++++ b/Config/exports.y
+@@ -331,7 +331,8 @@ static void set_hostname(const char *nam
+ 	if (ent) {
+ 		memcpy(&cur_host.addr, ent->h_addr_list[0],
+ 		       sizeof(struct in_addr));
+-		cur_host.mask.s_addr = ~0UL;
++		cur_host.mask.s_addr = 0;
++		cur_host.mask.s_addr = ~cur_host.mask.s_addr;
+ 	} else {
+ 		logmsg(LOG_CRIT, "could not resolve hostname '%s'", name);
+ 		e_error = TRUE;
+@@ -347,7 +348,8 @@ static void set_ipaddr(const char *addr)
+ 	
+ 	if (!inet_aton(addr, &cur_host.addr))
+ 		e_error = TRUE;
+-	cur_host.mask.s_addr = ~0UL;
++	cur_host.mask.s_addr = 0;
++	cur_host.mask.s_addr = ~cur_host.mask.s_addr;
+ }
+ 
+ /*
diff --git a/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch b/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch
new file mode 100644
index 0000000..219dd35
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3/relative_max_socket_path_len.patch
@@ -0,0 +1,74 @@
+nfs.c: Allow max sa.sun_path for a localdomain socket with the user nfs-server
+
+There is a hard limit for the kernel of 108 characters for a
+localdomain socket name.  To avoid problems with the user nfs
+server it should maximize the number of characters by using
+a relative path on the server side.
+
+Previously the nfs-server used the absolute path name passed to
+the sa.sunpath arg for binding the socket and this has caused
+problems for both the X server and UST binaries which make
+heavy use of named sockets with long names.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ nfs.c |   29 +++++++++++++++++++++++++++--
+ 1 file changed, 27 insertions(+), 2 deletions(-)
+
+--- a/nfs.c
++++ b/nfs.c
+@@ -672,6 +672,7 @@ SYMLINK3res *nfsproc3_symlink_3_svc(SYML
+ }
+ 
+ #ifndef WIN32
++static char pathbuf_tmp[NFS_MAXPATHLEN + NFS_MAXNAMLEN + 1];
+ 
+ /*
+  * create Unix socket
+@@ -680,17 +681,41 @@ static int mksocket(const char *path, mo
+ {
+     int res, sock;
+     struct sockaddr_un addr;
++    unsigned int len = strlen(path);
+ 
+     sock = socket(PF_UNIX, SOCK_STREAM, 0);
+-    addr.sun_family = AF_UNIX;
+-    strcpy(addr.sun_path, path);
+     res = sock;
+     if (res != -1) {
++	addr.sun_family = AF_UNIX;
++	if (len < sizeof(addr.sun_path) -1) {
++	    strcpy(addr.sun_path, path);
++	} else {
++	    char *ptr;
++	    res = -1;
++	    if (len >= sizeof(path))
++		goto out;
++	    strcpy(pathbuf_tmp, path);
++	    ptr = strrchr(pathbuf_tmp,'/');
++	    if (ptr) {
++		*ptr = '\0';
++		ptr++;
++		if (chdir(pathbuf_tmp))
++		    goto out;
++	    } else {
++		ptr = pathbuf_tmp;
++	    }
++	    if (strlen(ptr) >= sizeof(addr.sun_path))
++		goto out;
++	    strcpy(addr.sun_path, ptr);
++	}
+ 	umask(~mode);
+ 	res =
+ 	    bind(sock, (struct sockaddr *) &addr,
+ 		 sizeof(addr.sun_family) + strlen(addr.sun_path));
+ 	umask(0);
++out:
++	if (chdir("/"))
++	    fprintf(stderr, "Internal failure to chdir /\n");
+ 	close(sock);
+     }
+     return res;
diff --git a/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch b/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
new file mode 100644
index 0000000..e6d8953
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3/rename_fh_cache.patch
@@ -0,0 +1,64 @@
+From: Jason Wessel <jason.wessel@windriver.com>
+Date: Sat, 23 Feb 2013 08:49:08 -0600
+Subject: [PATCH] fh_cache: fix statle nfs handle on rename problem
+
+The following test case fails with modern linunx kernels which cache
+the renamed inode.
+
+  % mkdir a;mkdir b;mv b a/;ls -l a
+  ls: a/b: Stale NFS file handle
+
+The issue is that nfserver was not updating the fh_cache with the new
+location of the inode, when it moves directories.
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ fh_cache.c |   12 ++++++++++++
+ fh_cache.h |    1 +
+ nfs.c      |    2 ++
+ 3 files changed, 15 insertions(+)
+
+--- a/fh_cache.c
++++ b/fh_cache.c
+@@ -199,6 +199,18 @@ static char *fh_cache_lookup(uint32 dev,
+ }
+ 
+ /*
++ * update a fh inode cache for an operation like rename
++ */
++void fh_cache_update(nfs_fh3 fh, char *path)
++{
++    unfs3_fh_t *obj = (void *) fh.data.data_val;
++    backend_statstruct buf;
++
++    if (backend_lstat(path, &buf) != -1) {
++	fh_cache_add(obj->dev, buf.st_ino, path);
++    }
++}
++/*
+  * resolve a filename into a path
+  * cache-using wrapper for fh_decomp_raw
+  */
+--- a/fh_cache.h
++++ b/fh_cache.h
+@@ -19,5 +19,6 @@ unfs3_fh_t fh_comp(const char *path, str
+ unfs3_fh_t *fh_comp_ptr(const char *path, struct svc_req *rqstp, int need_dir);
+ 
+ char *fh_cache_add(uint32 dev, uint64 ino, const char *path);
++void fh_cache_update(nfs_fh3 fh, char *path);
+ 
+ #endif
+--- a/nfs.c
++++ b/nfs.c
+@@ -876,6 +876,8 @@ RENAME3res *nfsproc3_rename_3_svc(RENAME
+ 	    res = backend_rename(from_obj, to_obj);
+ 	    if (res == -1)
+ 		result.status = rename_err();
++	    /* Update the fh_cache with moved inode value */
++	    fh_cache_update(argp->to.dir, to_obj);
+ 	}
+     }
+ 
diff --git a/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch b/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch
new file mode 100644
index 0000000..b3521c6
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3/tcp_no_delay.patch
@@ -0,0 +1,56 @@
+daemon.c: Add option for tcp no delay
+
+Allow the NFS tcp sockets to conditionally use TCP_NODELAY
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ daemon.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/daemon.c
++++ b/daemon.c
+@@ -17,6 +17,7 @@
+ #ifndef WIN32
+ #include <sys/socket.h>
+ #include <netinet/in.h>
++#include <netinet/tcp.h>
+ #include <arpa/inet.h>
+ #include <syslog.h>
+ #else				       /* WIN32 */
+@@ -75,6 +76,7 @@ unsigned int opt_mount_port = NFS_PORT;
+ int opt_singleuser = FALSE;
+ int opt_brute_force = FALSE;
+ int opt_testconfig = FALSE;
++int opt_tcp_nodelay = FALSE;
+ struct in_addr opt_bind_addr;
+ int opt_readable_executables = FALSE;
+ char *opt_pid_file = NULL;
+@@ -208,7 +210,7 @@ static void parse_options(int argc, char
+ {
+ 
+     int opt = 0;
+-    char *optstring = "bcC:de:hl:m:n:prstTuwi:x:y:";
++    char *optstring = "bcC:de:hl:m:Nn:prstTuwi:x:y:";
+ 
+     while (opt != -1) {
+ 	opt = getopt(argc, argv, optstring);
+@@ -295,6 +297,9 @@ static void parse_options(int argc, char
+ 		    exit(1);
+ 		}
+ 		break;
++	    case 'N':
++		opt_tcp_nodelay = TRUE;
++		break;
+ 	    case 'n':
+ 		opt_nfs_port = strtol(optarg, NULL, 10);
+ 		if (opt_nfs_port == 0) {
+@@ -802,6 +807,8 @@ static SVCXPRT *create_tcp_transport(uns
+ 	sin.sin_addr.s_addr = opt_bind_addr.s_addr;
+ 	sock = socket(PF_INET, SOCK_STREAM, 0);
+ 	setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (const char *) &on, sizeof(on));
++	if (opt_tcp_nodelay)
++	    setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on));
+ 	if (bind(sock, (struct sockaddr *) &sin, sizeof(struct sockaddr))) {
+ 	    perror("bind");
+ 	    fprintf(stderr, "Couldn't bind to tcp port %d\n", port);
diff --git a/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch b/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch
new file mode 100644
index 0000000..6f64dd5
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3/unfs3_parallel_build.patch
@@ -0,0 +1,37 @@
+Fix parallel build dependency issue
+
+If building with make -j2 the lib.a will not get built in time.
+
+Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Submitted http://sourceforge.net/p/unfs3/bugs/5/
+
+---
+ Config/Makefile.in |    3 +++
+ Makefile.in        |    3 ++-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -29,7 +29,8 @@ DESTDIR =
+ 
+ VPATH = $(srcdir)
+ 
+-all: subdirs unfsd$(EXEEXT)
++all: subdirs
++	$(MAKE) unfsd$(EXEEXT)
+ 
+ unfsd$(EXEEXT): $(OBJS) $(CONFOBJ) $(EXTRAOBJ)
+ 	$(CC) -o $@ $(OBJS) $(CONFOBJ) $(EXTRAOBJ) $(LDFLAGS)
+--- a/Config/Makefile.in
++++ b/Config/Makefile.in
+@@ -16,6 +16,9 @@ lib.a: $(OBJS)
+ 	$(AR) crs lib.a $(OBJS)
+ 
+ y.tab.h y.tab.c: $(srcdir)/exports.y
++y.tab.h: y.tab.c
++
++y.tab.c: $(srcdir)/exports.y
+ 	$(YACC) -d $(srcdir)/exports.y
+ 
+ y.tab.o: y.tab.c $(srcdir)/exports.h $(top_srcdir)/nfs.h $(top_srcdir)/mount.h $(top_srcdir)/daemon.h
diff --git a/meta/recipes-devtools/unfs3/unfs3_0.9.22.r490.bb b/meta/recipes-devtools/unfs3/unfs3_0.9.22.r490.bb
new file mode 100644
index 0000000..45cf545
--- /dev/null
+++ b/meta/recipes-devtools/unfs3/unfs3_0.9.22.r490.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Userspace NFS server v3 protocol"
+SECTION = "console/network"
+LICENSE = "unfs3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=9475885294e17c0cc0067820d042792e"
+
+# SVN support for upstream version check isn't implemented yet
+RECIPE_UPSTREAM_VERSION = "0.9.22.r495"
+RECIPE_UPSTREAM_DATE = "Feb 05, 2015"
+CHECK_DATE = "Jun 10, 2015"
+
+DEPENDS = "flex-native bison-native flex"
+DEPENDS_append_class-nativesdk += "flex-nativesdk"
+
+SRC_URI[md5sum] = "3687acc4ee992e536472365dd99712a7"
+SRC_URI[sha256sum] = "274b43ada9c6eea1da26eb7010d72889c5278984ba0b50dff4e093057d4d64f8"
+
+MOD_PV = "490"
+S = "${WORKDIR}/trunk"
+SRC_URI = "svn://svn.code.sf.net/p/unfs3/code;module=trunk;rev=${MOD_PV} \
+           file://unfs3_parallel_build.patch \
+           file://alternate_rpc_ports.patch \
+           file://fix_pid_race_parent_writes_child_pid.patch \
+           file://fix_compile_warning.patch \
+           file://rename_fh_cache.patch \
+           file://relative_max_socket_path_len.patch \
+           file://fix_warnings.patch \
+           file://tcp_no_delay.patch \
+          "
+BBCLASSEXTEND = "native nativesdk"
+
+inherit autotools
+
+# Turn off these header detects else the inode search
+# will walk entire file systems and this is a real problem
+# if you have 2 TB of files to walk in your file system
+CACHED_CONFIGUREVARS = "ac_cv_header_mntent_h=no ac_cv_header_sys_mnttab_h=no"
diff --git a/meta/recipes-devtools/unifdef/unifdef_2.10.bb b/meta/recipes-devtools/unifdef/unifdef_2.10.bb
new file mode 100644
index 0000000..b8a0079
--- /dev/null
+++ b/meta/recipes-devtools/unifdef/unifdef_2.10.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Selectively remove #ifdef statements from sources"
+SECTION = "devel"
+LICENSE = "BSD-2-Clause"
+
+LIC_FILES_CHKSUM = "file://unifdef.c;endline=32;md5=2cc23f0382a6f560f6a9ecf4e040c0da"
+
+SRC_URI = "http://dotat.at/prog/${BPN}/${BP}.tar.xz"
+SRC_URI[md5sum] = "bb5d895e5ebbba5c5cc0c2771cf97ebe"
+SRC_URI[sha256sum] = "3b9b2b6b1952e9b9c1b9f734edec270689a35bdbf33ae66b50e19b2ed0d2df06"
+
+do_install() {
+	oe_runmake install DESTDIR=${D} prefix=${prefix}
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/vala/vala.inc b/meta/recipes-devtools/vala/vala.inc
new file mode 100644
index 0000000..63056fd
--- /dev/null
+++ b/meta/recipes-devtools/vala/vala.inc
@@ -0,0 +1,18 @@
+SUMMARY = "C#-like programming language for easing GObject programming"
+DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
+Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
+SECTION = "devel"
+DEPENDS = "bison-native flex-native libxslt-native glib-2.0"
+BBCLASSEXTEND = "native"
+HOMEPAGE = "http://vala-project.org"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+
+SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+
+SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/${BPN}/${SHRT_VER}/${BP}.tar.xz"
+inherit autotools pkgconfig
+
+FILES_${PN} += "${datadir}/${BPN}-${SHRT_VER}/vapi ${libdir}/${BPN}-${SHRT_VER}/"
+FILES_${PN}-doc += "${datadir}/devhelp"
+FILES_${PN}-dbg += "${libdir}/${BPN}-${SHRT_VER}/.debug"
diff --git a/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch b/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch
new file mode 100644
index 0000000..ac9dc8c
--- /dev/null
+++ b/meta/recipes-devtools/vala/vala/0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch
@@ -0,0 +1,55 @@
+From 2460d7b79f7e90dcfeebde5e9c53d9b6798a1f3c Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Tue, 21 Feb 2012 17:12:50 +0100
+Subject: [PATCH] git-version-gen: don't append -dirty if we're not in git
+ repo
+
+* for example if we have some dirty directory and we unpack clean vala tarball in it, then it will append -dirty
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Upstream-Status: Inappropriate [OE-Specific]
+---
+ build-aux/git-version-gen |   25 ++++++++++++++-----------
+ 1 files changed, 14 insertions(+), 11 deletions(-)
+
+diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
+index 0fa6faa..1d1f9d2 100755
+--- a/build-aux/git-version-gen
++++ b/build-aux/git-version-gen
+@@ -126,18 +126,21 @@ fi
+ 
+ v=`echo "$v" |sed 's/^v//'`
+ 
+-# Don't declare a version "dirty" merely because a time stamp has changed.
+-git status > /dev/null 2>&1
++if test -d .git
++then
++	# Don't declare a version "dirty" merely because a time stamp has changed.
++	git status > /dev/null 2>&1
+ 
+-dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
+-case "$dirty" in
+-    '') ;;
+-    *) # Append the suffix only if there isn't one already.
+-	case $v in
+-	  *-dirty) ;;
+-	  *) v="$v-dirty" ;;
+-	esac ;;
+-esac
++	dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
++	case "$dirty" in
++	    '') ;;
++	    *) # Append the suffix only if there isn't one already.
++		case $v in
++		  *-dirty) ;;
++		  *) v="$v-dirty" ;;
++		esac ;;
++	esac
++fi
+ 
+ # Omit the trailing newline, so that m4_esyscmd can use the result directly.
+ echo "$v" | tr -d '\012'
+-- 
+1.7.8.4
+
diff --git a/meta/recipes-devtools/vala/vala_0.28.0.bb b/meta/recipes-devtools/vala/vala_0.28.0.bb
new file mode 100644
index 0000000..120906c
--- /dev/null
+++ b/meta/recipes-devtools/vala/vala_0.28.0.bb
@@ -0,0 +1,6 @@
+require ${BPN}.inc
+
+SRC_URI += " file://0001-git-version-gen-don-t-append-dirty-if-we-re-not-in-g.patch"
+
+SRC_URI[md5sum] = "8d4ceac3451a0d5497e7be38e5e4c2ad"
+SRC_URI[sha256sum] = "0d9e3bd3f82145664875f7c29b2f544ba92d2814f75412948f774c0727fc977f"
diff --git a/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-Enable-rt_sigpending-syscall-on-ppc64-linux.patch b/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-Enable-rt_sigpending-syscall-on-ppc64-linux.patch
new file mode 100644
index 0000000..56bb5f5
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/0001-valgrind-Enable-rt_sigpending-syscall-on-ppc64-linux.patch
@@ -0,0 +1,35 @@
+From 1a8006f56342dae9f7100a3c33d80873676e0404 Mon Sep 17 00:00:00 2001
+From: Li Zhou <li.zhou@windriver.com>
+Date: Mon, 24 Aug 2015 03:55:18 -0400
+Subject: [PATCH] valgrind: Enable rt_sigpending syscall on ppc64 linux
+
+New Revision: 15133
+Enable rt_sigpending syscall on ppc64 linux.
+Patch from Thomas Huth <thuth@redhat.com>
+
+Get the patch from valgrind upstream:
+http://valgrind.10908.n7.nabble.com/Valgrind-r15133-in-trunk-NEWS-coregrind-m-syswrap-syswrap-ppc64-linux-c-td54589.html
+
+Upstream-Status: backport
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ coregrind/m_syswrap/syswrap-ppc64-linux.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c
+index 5946ee1..8aaa1d7 100644
+--- a/coregrind/m_syswrap/syswrap-ppc64-linux.c
++++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c
+@@ -887,7 +887,7 @@ static SyscallTableEntry syscall_table[] = {
+    LINXY(__NR_rt_sigaction,      sys_rt_sigaction),       // 173
+    LINXY(__NR_rt_sigprocmask,    sys_rt_sigprocmask),     // 174
+ 
+-// _____(__NR_rt_sigpending,     sys_rt_sigpending),      // 175
++   LINXY(__NR_rt_sigpending,     sys_rt_sigpending),      // 175
+    LINXY(__NR_rt_sigtimedwait,   sys_rt_sigtimedwait),    // 176
+    LINXY(__NR_rt_sigqueueinfo,   sys_rt_sigqueueinfo),    // 177
+    LINX_(__NR_rt_sigsuspend,     sys_rt_sigsuspend),      // 178
+-- 
+1.9.1
+
diff --git a/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch b/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch
new file mode 100644
index 0000000..07774f3
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/Added-support-for-PPC-instructions-mfatbu-mfatbl.patch
@@ -0,0 +1,96 @@
+From 0bf4b0ac18d1ea41b32ad781d214b295ca1998f3 Mon Sep 17 00:00:00 2001
+From: Aneesh Bansal <aneesh.bansal@freescale.com>
+Date: Mon, 21 Nov 2011 17:31:39 +0530
+Subject: [PATCH] Added support for PPC instructions mfatbu, mfatbl.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aneesh Bansal <aneesh.bansal@freescale.com>
+---
+Currently Valgrind 3.7.0 does not have support for PPC instructions mfatbu and mfatbl. When we run a USDPAA application with VALGRIND, the following error is given by valgrind :
+dis_proc_ctl(ppc)(mfspr,SPR)(0x20F)
+disInstr(ppc): unhandled instruction: 0x7C0F82A6
+
+
+ VEX/priv/guest_ppc_defs.h    |    2 ++
+ VEX/priv/guest_ppc_helpers.c |   18 ++++++++++++++++++
+ VEX/priv/guest_ppc_toIR.c    |   22 ++++++++++++++++++++++
+ 3 files changed, 42 insertions(+), 0 deletions(-)
+
+diff --git a/VEX/priv/guest_ppc_defs.h b/VEX/priv/guest_ppc_defs.h
+index dd3c62e..11a34aa 100644
+--- a/VEX/priv/guest_ppc_defs.h
++++ b/VEX/priv/guest_ppc_defs.h
+@@ -146,6 +146,8 @@ extern UInt ppc32g_dirtyhelper_MFSPR_268_269 ( UInt );
+ 
+ extern UInt ppc32g_dirtyhelper_MFSPR_287 ( void );
+ 
++extern UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt );
++
+ extern void ppc32g_dirtyhelper_LVS ( VexGuestPPC32State* gst,
+                                      UInt vD_idx, UInt sh,
+                                      UInt shift_right );
+diff --git a/VEX/priv/guest_ppc_helpers.c b/VEX/priv/guest_ppc_helpers.c
+index 11aa428..b49ea3f 100644
+--- a/VEX/priv/guest_ppc_helpers.c
++++ b/VEX/priv/guest_ppc_helpers.c
+@@ -119,6 +119,24 @@ UInt ppc32g_dirtyhelper_MFSPR_287 ( void )
+ #  endif
+ }
+ 
++/* CALLED FROM GENERATED CODE */
++/* DIRTY HELPER (non-referentially transparent) */
++UInt ppc32g_dirtyhelper_MFSPR_526_527 ( UInt r527 )
++{
++#  if defined(__powerpc__) || defined(_AIX)
++   UInt spr;
++   if (r527) {
++      __asm__ __volatile__("mfspr %0,527" : "=b"(spr));
++   } else {
++      __asm__ __volatile__("mfspr %0,526" : "=b"(spr));
++   }
++   return spr;
++#  else
++   return 0;
++#  endif
++}
++
++
+ 
+ /* CALLED FROM GENERATED CODE */
+ /* DIRTY HELPER (reads guest state, writes guest mem) */
+diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c
+index f8d220d..37c8974 100644
+--- a/VEX/priv/guest_ppc_toIR.c
++++ b/VEX/priv/guest_ppc_toIR.c
+@@ -5657,6 +5657,28 @@ static Bool dis_proc_ctl ( VexAbiInfo* vbi, UInt theInstr )
+          break;
+       }
+ 
++
++      case 526 /* 0x20E */:
++      case 527 /* 0x20F */: {
++         UInt     arg  = SPR==526 ? 0 : 1;
++         IRTemp   val  = newTemp(Ity_I32);
++         IRExpr** args = mkIRExprVec_1( mkU32(arg) );
++         IRDirty* d    = unsafeIRDirty_1_N(
++                            val,
++                            0/*regparms*/,
++                            "ppc32g_dirtyhelper_MFSPR_526_527",
++                            fnptr_to_fnentry
++                               (vbi, &ppc32g_dirtyhelper_MFSPR_526_527),
++                            args
++                         );
++         /* execute the dirty call, dumping the result in val. */
++         stmt( IRStmt_Dirty(d) );
++         putIReg( rD_addr,
++                  mkWidenFrom32(ty, mkexpr(val), False/*unsigned*/) );
++         DIP("mfspr r%u,%u", rD_addr, (UInt)SPR);
++         break;
++      }
++
+       default:
+          vex_printf("dis_proc_ctl(ppc)(mfspr,SPR)(0x%x)\n", SPR);
+          return False;
+-- 
+1.7.0.4
diff --git a/meta/recipes-devtools/valgrind/valgrind/add-ptest.patch b/meta/recipes-devtools/valgrind/valgrind/add-ptest.patch
new file mode 100644
index 0000000..225f843
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/add-ptest.patch
@@ -0,0 +1,243 @@
+Modify vg_test wrapper to support PTEST formats
+
+Change the valgrind regression test script vg_regtest to
+support the yocto ptest stdout reporting format.  The commit adds
+'--yocto-ptest' as an optional argument to vg_regtest, which alters
+the output to use the ptest infrastructure reporting format:
+    "[PASS|SKIP|FAIL]: testname"
+instead of valgrind's internal test reporting format.  Without the added
+option, --yocto-ptest, the valgrind regression test output is unchanged.
+
+Enforce 30 seconds limit for the test.
+This resume execution of the remaining tests when valgrind hangs.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+
+diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in
+index 224385f..3e0383b 100755
+--- a/tests/vg_regtest.in
++++ b/tests/vg_regtest.in
+@@ -39,11 +39,11 @@
+ #               --valgrind.)
+ #   --keep-unfiltered: keep a copy of the unfiltered output/error output
+ #     of each test by adding an extension .unfiltered.out
+-#
+ #   --outer-valgrind: run this valgrind under the given outer valgrind.
+ #     This valgrind must be configured with --enable-inner.
+ #   --outer-tool: tool to use by the outer valgrind (default memcheck).
+ #   --outer-args: use this as outer tool args.
++#   --yocto-ptest: output in yocto ptest format
+ #
+ # The easiest way is to run all tests in valgrind/ with (assuming you installed
+ # in $PREFIX):
+@@ -126,7 +126,7 @@ use strict;
+ my $usage="\n"
+      . "Usage:\n"
+      . "   vg_regtest [--all, --valgrind, --valgrind-lib, --keep-unfiltered\n"
+-     . "                 --outer-valgrind, --outer-tool, --outer-args]\n"
++     . "                 --outer-valgrind, --outer-tool, --outer-args, --yocto-ptest]\n"
+      . "   Use EXTRA_REGTEST_OPTS to supply extra args for all tests\n"
+      . "\n";
+ 
+@@ -170,6 +170,7 @@ my $outer_args;
+ 
+ my $valgrind_lib = "$tests_dir/.in_place";
+ my $keepunfiltered = 0;
++my $yoctoptest = 0;
+ 
+ # default filter is the one named "filter_stderr" in the test's directory
+ my $default_stderr_filter = "filter_stderr";
+@@ -226,6 +227,8 @@ sub process_command_line()
+                 $valgrind_lib = $1;
+             } elsif ($arg =~ /^--keep-unfiltered$/) {
+                 $keepunfiltered = 1;
++            } elsif ($arg =~ /^--yocto-ptest$/) {
++                $yoctoptest = 1;
+             } else {
+                 die $usage;
+             }
+@@ -340,13 +343,28 @@ sub read_vgtest_file($)
+ #----------------------------------------------------------------------------
+ # Since most of the program time is spent in system() calls, need this to
+ # propagate a Ctrl-C enabling us to quit.
+-sub mysystem($) 
++# Enforce 30 seconds limit for the test.
++# This resume execution of the remaining tests if valgrind hangs.
++sub mysystem($)
+ {
+-    my $exit_code = system($_[0]);
+-    ($exit_code == 2) and exit 1;      # 2 is SIGINT
+-    return $exit_code;
++    my $exit_code=0;
++    eval {
++        local $SIG{'ALRM'} = sub { die "timed out\n" };
++        alarm(30);
++        $exit_code = system($_[0]);
++        alarm (0);
++        ($exit_code == 2) and die "SIGINT\n";   # 2 is SIGINT
++    };
++    if ($@) {
++        if ($@ eq "timed out\n") {
++            print "timed out\n";
++            return 1;
++        }
++        if ($@ eq "SIGINT\n") {
++            exit 1;
++        }
++    }
+ }
+-
+ # if $keepunfiltered, copies $1 to $1.unfiltered.out
+ # renames $0 tp $1
+ sub filtered_rename($$) 
+@@ -394,19 +412,21 @@ sub do_diffs($$$$)
+                 # A match;  remove .out and any previously created .diff files.
+                 unlink("$name.$mid.out");
+                 unlink(<$name.$mid.diff*>);
+-                return;
++                return 0;
+             }
+         }
+     }
+     # If we reach here, none of the .exp files matched.
+-    print "*** $name failed ($mid) ***\n";
++    print "*** $name failed ($mid) ***\n" if ($yoctoptest == 0) ;
+     push(@failures, sprintf("%-40s ($mid)", "$fullname"));
+     $num_failures{$mid}++;
++    return 1;
+ }
+ 
+ sub do_one_test($$) 
+ {
+     my ($dir, $vgtest) = @_;
++    my $diffStatus = 0;
+     $vgtest =~ /^(.*)\.vgtest/;
+     my $name = $1;
+     my $fullname = "$dir/$name"; 
+@@ -425,7 +445,11 @@ sub do_one_test($$)
+         } elsif (256 == $prereq_res) {
+             # Nb: weird Perl-ism -- exit code of '1' is seen by Perl as 256...
+             # Prereq failed, skip.
+-            printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
++            if ($yoctoptest == 0) {
++                printf("%-16s (skipping, prereq failed: $prereq)\n", "$name:");
++            } else {
++                printf("SKIP: $fullname\n");
++            }
+             return;
+         } else {
+             # Bad prereq; abort.
+@@ -438,7 +462,7 @@ sub do_one_test($$)
+     if (defined $progB) {
+         # If there is a progB, let's start it in background:
+         printf("%-16s valgrind $extraopts $vgopts $prog $args (progB: $progB $argsB)\n",
+-               "$name:");
++               "$name:") if ($yoctoptest == 0);
+         # progB.done used to detect child has finished. See below.
+         # Note: redirection of stdout and stderr is before $progB to allow argsB
+         # to e.g. redirect stdoutB to stderrB
+@@ -452,7 +476,8 @@ sub do_one_test($$)
+                      . "touch progB.done)  &");
+         }
+     } else {
+-        printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:");
++        printf("%-16s valgrind $extraopts $vgopts $prog $args\n", "$name:")
++            if ($yoctoptest == 0);
+     }
+  
+     # Pass the appropriate --tool option for the directory (can be overridden
+@@ -487,7 +512,7 @@ sub do_one_test($$)
+     # Find all the .stdout.exp files.  If none, use /dev/null.
+     my @stdout_exps = <$name.stdout.exp*>;
+     @stdout_exps = ( "/dev/null" ) if (0 == scalar @stdout_exps);
+-    do_diffs($fullname, $name, "stdout", \@stdout_exps); 
++    $diffStatus |= do_diffs($fullname, $name, "stdout", \@stdout_exps);
+ 
+     # Filter stderr
+     $stderr_filter_args = $name if (! defined $stderr_filter_args);
+@@ -496,7 +521,7 @@ sub do_one_test($$)
+     # Find all the .stderr.exp files.  At least one must exist.
+     my @stderr_exps = <$name.stderr.exp*>;
+     (0 != scalar @stderr_exps) or die "Could not find `$name.stderr.exp*'\n";
+-    do_diffs($fullname, $name, "stderr", \@stderr_exps); 
++    $diffStatus |= do_diffs($fullname, $name, "stderr", \@stderr_exps);
+ 
+     if (defined $progB) {
+         # wait for the child to be finished
+@@ -520,7 +545,7 @@ sub do_one_test($$)
+         # Find all the .stdoutB.exp files.  If none, use /dev/null.
+         my @stdoutB_exps = <$name.stdoutB.exp*>;
+         @stdoutB_exps = ( "/dev/null" ) if (0 == scalar @stdoutB_exps);
+-        do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps); 
++        $diffStatus |= do_diffs($fullname, $name, "stdoutB", \@stdoutB_exps);
+         
+         # Filter stderr
+         $stderrB_filter_args = $name if (! defined $stderrB_filter_args);
+@@ -529,7 +554,7 @@ sub do_one_test($$)
+         # Find all the .stderrB.exp files.  At least one must exist.
+         my @stderrB_exps = <$name.stderrB.exp*>;
+         (0 != scalar @stderrB_exps) or die "Could not find `$name.stderrB.exp*'\n";
+-        do_diffs($fullname, $name, "stderrB", \@stderrB_exps); 
++        $diffStatus |= do_diffs($fullname, $name, "stderrB", \@stderrB_exps);
+     }
+ 
+     # Maybe do post-test check
+@@ -541,7 +566,7 @@ sub do_one_test($$)
+ 	    # Find all the .post.exp files.  If none, use /dev/null.
+ 	    my @post_exps = <$name.post.exp*>;
+ 	    @post_exps = ( "/dev/null" ) if (0 == scalar @post_exps);
+-	    do_diffs($fullname, $name, "post", \@post_exps);
++	    $diffStatus |= do_diffs($fullname, $name, "post", \@post_exps);
+ 	}
+     }
+  
+@@ -550,6 +575,13 @@ sub do_one_test($$)
+             print("(cleanup operation failed: $cleanup)\n");
+     }
+ 
++    if ($yoctoptest == 1) {
++        if ($diffStatus == 0) {
++            print("PASS: $fullname\n");
++        } else {
++            print("FAIL: $fullname\n");
++        }
++    }
+     $num_tests_done++;
+ }
+ 
+@@ -589,7 +621,7 @@ sub test_one_dir($$)
+     my $found_tests = (0 != (grep { $_ =~ /\.vgtest$/ } @fs));
+ 
+     if ($found_tests) {
+-        print "-- Running  tests in $full_dir $dashes\n";
++        print "-- Running  tests in $full_dir $dashes\n" if ($yoctoptest == 0);
+     }
+     foreach my $f (@fs) {
+         if (-d $f) {
+@@ -599,7 +631,7 @@ sub test_one_dir($$)
+         }
+     }
+     if ($found_tests) {
+-        print "-- Finished tests in $full_dir $dashes\n";
++        print "-- Finished tests in $full_dir $dashes\n" if ($yoctoptest == 0);
+     }
+ 
+     chdir("..");
+@@ -625,10 +657,12 @@ sub summarise_results
+            $num_failures{"stdout"},   plural($num_failures{"stdout"}),
+            $num_failures{"stderrB"},  plural($num_failures{"stderrB"}),
+            $num_failures{"stdoutB"},  plural($num_failures{"stdoutB"}),
+-           $num_failures{"post"},     plural($num_failures{"post"}));
++           $num_failures{"post"},     plural($num_failures{"post"}))
++               if ($yoctoptest == 0);
+ 
+     foreach my $failure (@failures) {
+-        print "$failure\n";
++        print "$failure\n"
++           if ($yoctoptest == 0);
+     }
+     print "\n";
+ }
diff --git a/meta/recipes-devtools/valgrind/valgrind/enable.building.on.4.x.kernel.patch b/meta/recipes-devtools/valgrind/valgrind/enable.building.on.4.x.kernel.patch
new file mode 100644
index 0000000..300f2f1
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/enable.building.on.4.x.kernel.patch
@@ -0,0 +1,37 @@
+Enable building valgrind on host with 4.x kernel.
+
+For OpenEmbedded builds we should be checking something like
+OLDEST_KERNEL instead of `uname -r`, but this is good enough for now.
+
+Building on 4.x* currently fails with:
+  configure:5556: checking for the kernel version
+  configure:5579: result: unsupported (4.0.0-rc3-00111-gaffb817)
+  configure:5581: error: Valgrind works on kernels 2.4, 2.6
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- valgrind-3.9.0/configure.ac.orig	2015-03-13 19:17:01.247310868 +0100
++++ valgrind-3.9.0/configure.ac	2015-03-13 19:19:27.388316108 +0100
+@@ -276,9 +276,9 @@
+         kernel=`uname -r`
+ 
+         case "${kernel}" in
+-             2.6.*|3.*) 
+-        	    AC_MSG_RESULT([2.6.x/3.x family (${kernel})])
+-        	    AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x or Linux 3.x])
++             2.6.*|3.*|4.*) 
++        	    AC_MSG_RESULT([2.6.x/3.x/4.x family (${kernel})])
++        	    AC_DEFINE([KERNEL_2_6], 1, [Define to 1 if you're using Linux 2.6.x or Linux 3.x or Linux 4.x])
+         	    ;;
+ 
+              2.4.*) 
+@@ -288,7 +288,7 @@
+ 
+              *) 
+         	    AC_MSG_RESULT([unsupported (${kernel})])
+-        	    AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6])
++        	    AC_MSG_ERROR([Valgrind works on kernels 2.4, 2.6, 3.x, 4.x])
+         	    ;;
+         esac
+ 
diff --git a/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch b/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
new file mode 100644
index 0000000..b054d05
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/fixed-perl-path.patch
@@ -0,0 +1,53 @@
+this is a temporary patch to workaround cross compilation.
+otherwise @PERL@ will be replaced to perl-native binary,
+this creates unusable scripts and fails FILERDEPENDS mechanism
+(esp. rpm)
+
+a better fix would need:
+ 1. configure.ac should differentiate PERL and HOSTPERL
+ 2. optionally remove ${STAGING_DIR} in #! line before do_install
+
+8/31/2010 - created by Qing He <qing.he@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+diff --git a/cachegrind/cg_annotate.in b/cachegrind/cg_annotate.in
+index 9dc9565..cc4ef05 100644
+--- a/cachegrind/cg_annotate.in
++++ b/cachegrind/cg_annotate.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+ 
+ ##--------------------------------------------------------------------##
+ ##--- Cachegrind's annotator.                       cg_annotate.in ---##
+diff --git a/cachegrind/cg_diff.in b/cachegrind/cg_diff.in
+index 951066e..84c2dde 100644
+--- a/cachegrind/cg_diff.in
++++ b/cachegrind/cg_diff.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+ 
+ ##--------------------------------------------------------------------##
+ ##--- Cachegrind's differencer.                         cg_diff.in ---##
+diff --git a/massif/ms_print.in b/massif/ms_print.in
+index e6ffdbf..fb45906 100755
+--- a/massif/ms_print.in
++++ b/massif/ms_print.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+ 
+ ##--------------------------------------------------------------------##
+ ##--- Massif's results printer                         ms_print.in ---##
+diff --git a/perf/vg_perf.in b/perf/vg_perf.in
+index 2188a31..83ad024 100644
+--- a/perf/vg_perf.in
++++ b/perf/vg_perf.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+ ##--------------------------------------------------------------------##
+ ##--- Valgrind performance testing script                  vg_perf ---##
+ ##--------------------------------------------------------------------##
diff --git a/meta/recipes-devtools/valgrind/valgrind/force-nostabs.patch b/meta/recipes-devtools/valgrind/valgrind/force-nostabs.patch
new file mode 100644
index 0000000..849dfc5
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/force-nostabs.patch
@@ -0,0 +1,42 @@
+Suppress building ptest apps with the -gstabs option
+
+Force the configure tests for -gstabs compiler support to fail so that
+the regression tests don't try to build with the -gstabs option.
+Otherwise, the valgrind build when ptest is enabled fails with the
+error:
+    Stabs debuginfo not supported:
+    ../package/usr/lib/valgrind/ptest/memcheck/tests/deep_templates
+    ERROR: Function failed: split_and_strip_files
+
+Upstream-Status: Inappropriate [gstabs support is appropriate upstream,
+        but not for this distro]
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index 755dfb9..cc8b5e1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1743,22 +1743,7 @@ AM_CONDITIONAL(DWARF4, test x$ac_have_dwarf4 = xyes)
+ CFLAGS=$safe_CFLAGS
+ 
+ 
+-# does this compiler support -gstabs ?
+-
+-AC_MSG_CHECKING([if gcc accepts -gstabs])
+-
+-safe_CFLAGS=$CFLAGS
+-CFLAGS="-gstabs"
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+-  return 0;
+-]])], [
+-ac_have_gstabs=yes
+-AC_MSG_RESULT([yes])
+-], [
+ ac_have_gstabs=no
+-AC_MSG_RESULT([no])
+-])
+-CFLAGS=$safe_CFLAGS
+ AM_CONDITIONAL([HAVE_GSTABS], [test x$ac_have_gstabs = xyes])
+ 
+ 
diff --git a/meta/recipes-devtools/valgrind/valgrind/glibc.patch b/meta/recipes-devtools/valgrind/valgrind/glibc.patch
new file mode 100644
index 0000000..863499d
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/glibc.patch
@@ -0,0 +1,44 @@
+Backport of glibc 2.19 and 2.20 and 2.21 support.
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Index: valgrind-3.10.1/configure.ac
+===================================================================
+--- valgrind-3.10.1.orig/configure.ac
++++ valgrind-3.10.1/configure.ac
+@@ -1018,6 +1018,34 @@ case "${GLIBC_VERSION}" in
+ 	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ 	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
++     2.19)
++	AC_MSG_RESULT(2.19 family)
++	AC_DEFINE([GLIBC_2_19], 1, [Define to 1 if you're using glibc 2.19.x])
++	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	;;
++     2.20)
++	AC_MSG_RESULT(2.20 family)
++	AC_DEFINE([GLIBC_2_20], 1, [Define to 1 if you're using glibc 2.20.x])
++	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	;;
++     2.21)
++	AC_MSG_RESULT(2.21 family)
++	AC_DEFINE([GLIBC_2_21], 1, [Define to 1 if you're using glibc 2.21.x])
++	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	;;
++     2.22)
++	AC_MSG_RESULT(2.22 family)
++	AC_DEFINE([GLIBC_2_22], 1, [Define to 1 if you're using glibc 2.22.x])
++	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	;;
+      darwin)
+ 	AC_MSG_RESULT(Darwin)
+ 	AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
diff --git a/meta/recipes-devtools/valgrind/valgrind/pass-maltivec-only-if-it-supported.patch b/meta/recipes-devtools/valgrind/valgrind/pass-maltivec-only-if-it-supported.patch
new file mode 100644
index 0000000..f8167cb
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/pass-maltivec-only-if-it-supported.patch
@@ -0,0 +1,68 @@
+Upstream-Status: Backport
+
+r14566 | florian | 2014-09-24 17:02:54 -0500 (Wed, 24 Sep 2014) | 4 lines
+
+The testbuckets none/tests/ppc{32,64} did not build in case the
+toolchain did not support -maltivec -mabi=altivec.
+This should work now. Fixes BZ #338731
+
+Index: none/tests/ppc32/Makefile.am
+===================================================================
+--- a/none/tests/ppc32/Makefile.am	(revision 14565)
++++ b/none/tests/ppc32/Makefile.am	(revision 14566)
+@@ -72,8 +72,12 @@
+ allexec_CFLAGS		= $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
+ 
+ if HAS_ALTIVEC
++BUILD_FLAG_ALTIVEC = -maltivec
++BUILD_FLAG_ABI_ALTIVEC = -mabi=altivec
+ ALTIVEC_FLAG = -DHAS_ALTIVEC
+ else
++BUILD_FLAG_ALTIVEC =
++BUILD_FLAG_ABI_ALTIVEC =
+ ALTIVEC_FLAG =
+ endif
+ 
+@@ -101,11 +105,12 @@
+ ISA_2_07_FLAG =
+ endif
+ 
+-jm_insns_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames -maltivec \
+-			@FLAG_M32@ $(ALTIVEC_FLAG)
++jm_insns_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames \
++			@FLAG_M32@ $(ALTIVEC_FLAG) $(BUILD_FLAG_ALTIVEC)
+ 
+-testVMX_CFLAGS  = $(AM_CFLAGS) -O -g -Wall -maltivec -mabi=altivec -DALTIVEC \
+-			-DGCC_COMPILER @FLAG_M32@
++testVMX_CFLAGS  = $(AM_CFLAGS) -O -g -Wall -DALTIVEC \
++			-DGCC_COMPILER @FLAG_M32@  $(BUILD_FLAG_ALTIVEC) \
++			$(BUILD_FLAG_ABI_ALTIVEC)
+ 
+ test_isa_2_06_part1_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(VSX_FLAG) \
+ 			@FLAG_M32@ $(ALTIVEC_FLAG) $(BUILD_FLAG_VSX)
+Index: none/tests/ppc64/Makefile.am
+===================================================================
+--- a/none/tests/ppc64/Makefile.am	(revision 14565)
++++ b/none/tests/ppc64/Makefile.am	(revision 14566)
+@@ -50,8 +50,10 @@
+ allexec_CFLAGS		= $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
+ 
+ if HAS_ALTIVEC
++BUILD_FLAG_ALTIVEC = -maltivec
+ ALTIVEC_FLAG = -DHAS_ALTIVEC
+ else
++BUILD_FLAG_ALTIVEC =
+ ALTIVEC_FLAG =
+ endif
+ 
+@@ -88,8 +90,8 @@
+ test_isa_2_06_part3_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(VSX_FLAG) \
+ 			@FLAG_M64@ $(ALTIVEC_FLAG) $(BUILD_FLAG_VSX)
+ 
+-jm_insns_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames -maltivec \
+-			@FLAG_M64@ $(ALTIVEC_FLAG)
++jm_insns_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames \
++			@FLAG_M64@ $(ALTIVEC_FLAG) $(BUILD_FLAG_ALTIVEC)
+ 
+ test_dfp1_CFLAGS = $(AM_CFLAGS) -Winline -Wall -O -g -mregnames $(DFP_FLAG) \
+ 			@FLAG_M64@ $(BUILD_FLAGS_DFP)
diff --git a/meta/recipes-devtools/valgrind/valgrind/remove-arm-variant-specific.patch b/meta/recipes-devtools/valgrind/valgrind/remove-arm-variant-specific.patch
new file mode 100644
index 0000000..2319ab9
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/remove-arm-variant-specific.patch
@@ -0,0 +1,66 @@
+Remove arm tests that don't compile
+
+Upstream-Status: Pending
+
+Corrects the original commit for the patch that removed ARM ptest CFLAGS
+settings. Since the flags could be set by a user, the flags should
+be kept in place during compilation.  By keeping the original up-stream
+CFLAGS for the tests, then additional tests successfully compile
+for all tested ARM tunings.
+
+However, there were still two tests listed below that did not compile
+for any beaglebone tuning that is valid for valgrind. With the updated
+patch, the set of excluded ARM ptests and their respective build
+failures are:
+  intdiv - fails for all beaglebone tunings with 2 errors:
+  {standard input}:(40 or 41): Error: selected processor does not
+       support Thumb mode `udiv r3,r9,r10'
+  {standard input}:(72 or 73): Error: selected processor does not
+       support Thumb mode `sdiv r3,r9,r10'
+
+  vcvt_fixed_float_VFP - fails for all beaglebone tunings in one of
+  two ways:
+    with neon tuning (-mfpu=neon) fails with Internal Compiler Error
+    without neon tuning fails with 3 errors:
+    {standard input}:33: Error: selected FPU does not support
+      instruction -- `vcvt.f32.s32 s15,s15,#1'
+    {standard input}:58: Error: selected FPU does not support
+      instruction -- `vcvt.f32.s32 s15,s15,#32'
+    {standard input}:136: Error: selected FPU does not support
+      instruction -- `vcvt.f32.u32 s15,s15,#1'
+
+After applying this commit, the valgrind ARM ptests compile without
+errors for tunings:
+  armv7[t][hf][b][-neon] cortexa8[t][hf][-neon]
+where the tuning [option] was successfully compiled, both with
+and without the 'option', and in combination with all other options.
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+Index: valgrind-3.10.1/none/tests/arm/Makefile.am
+===================================================================
+--- valgrind-3.10.1.orig/none/tests/arm/Makefile.am	2015-05-19 15:11:59.224842927 -0500
++++ valgrind-3.10.1/none/tests/arm/Makefile.am	2015-05-19 15:14:20.808847028 -0500
+@@ -17,9 +17,13 @@
+ 	vfp.stdout.exp vfp.stderr.exp vfp.vgtest \
+ 	vfpv4_fma.stdout.exp vfpv4_fma.stderr.exp vfpv4_fma.vgtest
+ 
++# Remove the following tests which cause compiler errors for all tunings
++#  available for beagle bone (see remove-arm-variant-specific.patch):
++#	intdiv
++#	vcvt_fixed_float_VFP
++
+ check_PROGRAMS = \
+ 	allexec \
+-	intdiv \
+ 	ldrt \
+ 	ldrt_arm \
+ 	neon128 \
+@@ -27,7 +31,6 @@
+ 	v6intARM \
+ 	v6intThumb \
+ 	v6media \
+-	vcvt_fixed_float_VFP \
+ 	vfp \
+ 	vfpv4_fma
+ 
diff --git a/meta/recipes-devtools/valgrind/valgrind/remove-ppc-tests-failing-build.patch b/meta/recipes-devtools/valgrind/valgrind/remove-ppc-tests-failing-build.patch
new file mode 100644
index 0000000..1c640ff
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/remove-ppc-tests-failing-build.patch
@@ -0,0 +1,75 @@
+Remove test apps not building with ppc and PTEST
+
+For mpc8316-rdb in none/tests/ppc32, the oe compiler options are
+inconsistent with the imposed test compiler options generating errors
+as follows:
+test_isa_2_07_part1
+test_isa_2_07_part2
+test_tm
+test_touch_tm
+    : unrecognized command line option '-mhtm'
+
+jm-insns
+testVMX
+    : AltiVec not supported in this target
+
+For the following tests, their inline assembler is inconsistent with
+the ppce300c3 variant:
+round.c:393
+power5+_round.c:98
+    : impossible constraint in 'asm'
+
+For the following tests, with both mpc8316-rdb and with qemuppc bsp,
+the inline assember is inconsistent with the oe compiler machine
+tuning:
+In memcheck/tests/ppc32
+ power_ISA2_05.c:56
+In none/tests/ppc32
+ test_dfp1.c:85
+ test_dfp2.c:160
+ test_dfp3.c:157
+ test_dfp4.c:73
+ test_dfp5.c:73
+    : impossible constraint in 'asm'
+
+Upstream-Status: Pending
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+Index: valgrind-3.10.0/memcheck/tests/ppc32/Makefile.am
+===================================================================
+--- valgrind-3.10.0.orig/memcheck/tests/ppc32/Makefile.am
++++ valgrind-3.10.0/memcheck/tests/ppc32/Makefile.am
+@@ -7,8 +7,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
+ 	power_ISA2_05.stderr.exp power_ISA2_05.stdout.exp power_ISA2_05.vgtest \
+ 	power_ISA2_05.stdout.exp_Without_FPPO
+ 
+-check_PROGRAMS = \
+-	power_ISA2_05
++check_PROGRAMS = 
+ 
+ power_ISA2_05_CFLAGS = $(AM_CFLAGS) $(WERROR) -Winline -Wall -Wshadow -g \
+ 		-I$(top_srcdir)/include @FLAG_M32@
+Index: valgrind-3.10.0/none/tests/ppc32/Makefile.am
+===================================================================
+--- valgrind-3.10.0.orig/none/tests/ppc32/Makefile.am
++++ valgrind-3.10.0/none/tests/ppc32/Makefile.am
+@@ -52,16 +52,8 @@ check_PROGRAMS = \
+ 	allexec \
+ 	bug129390-ppc32 \
+ 	bug139050-ppc32 \
+-	ldstrev lsw jm-insns mftocrf mcrfs round test_fx test_gx \
+-	testVMX twi tw xlc_dbl_u32 power5+_round power6_bcmp \
+-	test_isa_2_06_part1 \
+-	test_isa_2_06_part2 \
+-	test_isa_2_06_part3 \
+-	test_dfp1 test_dfp2 test_dfp3 test_dfp4 test_dfp5 \
+-	test_isa_2_07_part1 \
+-	test_isa_2_07_part2 \
+-	test_tm \
+-	test_touch_tm \
++	ldstrev lsw mftocrf mcrfs test_fx test_gx \
++	twi tw xlc_dbl_u32 power6_bcmp \
+ 	ldst_multiple \
+ 	data-cache-instructions
+ 
diff --git a/meta/recipes-devtools/valgrind/valgrind/run-ptest b/meta/recipes-devtools/valgrind/valgrind/run-ptest
new file mode 100755
index 0000000..f9a72ec
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/run-ptest
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# run-ptest - 'ptest' test infrastructure shell script that
+#   wraps the valgrind regression script vg_regtest. 
+#   Must be run in the /usr/lib/valgrind/ptest directory. 
+#
+# Dave Lerner <dave.lerner@windriver.com>
+###############################################################
+VALGRINDLIB=@libdir@/valgrind
+tests/vg_regtest --all \
+    --valgrind=/usr/bin/valgrind --valgrind-lib=$VALGRINDLIB \
+	--yocto-ptest
diff --git a/meta/recipes-devtools/valgrind/valgrind/sepbuildfix.patch b/meta/recipes-devtools/valgrind/valgrind/sepbuildfix.patch
new file mode 100644
index 0000000..5db0ef8
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/sepbuildfix.patch
@@ -0,0 +1,235 @@
+Fix out of tree builds. The paths to these files need to be fully specified in
+the out of tree build case. glibc-2.X.supp is a generated file so the full path
+is deliberately not specified in that case.
+
+RP 2013/03/23
+
+Upstream-Status: Pending
+
+Index: valgrind-3.9.0/configure.ac
+===================================================================
+--- valgrind-3.9.0.orig/configure.ac
++++ valgrind-3.9.0/configure.ac
+@@ -325,26 +325,26 @@ case "${host_os}" in
+ 	     9.*)
+ 		  AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard])
+ 		  AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version])
+-		  DEFAULT_SUPP="darwin9.supp ${DEFAULT_SUPP}"
+-		  DEFAULT_SUPP="darwin9-drd.supp ${DEFAULT_SUPP}"
++		  DEFAULT_SUPP="$srcdir/darwin9.supp ${DEFAULT_SUPP}"
++		  DEFAULT_SUPP="$srcdir/darwin9-drd.supp ${DEFAULT_SUPP}"
+ 		  ;;
+ 	     10.*)
+ 		  AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard])
+ 		  AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version])
+-		  DEFAULT_SUPP="darwin10.supp ${DEFAULT_SUPP}"
+-		  DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++		  DEFAULT_SUPP="$srcdir/darwin10.supp ${DEFAULT_SUPP}"
++		  DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ 		  ;;
+ 	     11.*)
+ 		  AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion])
+ 		  AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version])
+-		  DEFAULT_SUPP="darwin11.supp ${DEFAULT_SUPP}"
+-		  DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++		  DEFAULT_SUPP="$srcdir/darwin11.supp ${DEFAULT_SUPP}"
++		  DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ 		  ;;
+ 	     12.*)
+ 		  AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion])
+ 		  AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version])
+-		  DEFAULT_SUPP="darwin12.supp ${DEFAULT_SUPP}"
+-		  DEFAULT_SUPP="darwin10-drd.supp ${DEFAULT_SUPP}"
++		  DEFAULT_SUPP="$srcdir/darwin12.supp ${DEFAULT_SUPP}"
++		  DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}"
+ 		  ;;
+              *) 
+ 		  AC_MSG_RESULT([unsupported (${kernel})])
+@@ -799,124 +799,124 @@ case "${GLIBC_VERSION}" in
+      2.2)
+ 	AC_MSG_RESULT(2.2 family)
+ 	AC_DEFINE([GLIBC_2_2], 1, [Define to 1 if you're using glibc 2.2.x])
+-	DEFAULT_SUPP="glibc-2.2.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.2.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.2-LinuxThreads-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+ 
+      2.3)
+ 	AC_MSG_RESULT(2.3 family)
+ 	AC_DEFINE([GLIBC_2_3], 1, [Define to 1 if you're using glibc 2.3.x])
+-	DEFAULT_SUPP="glibc-2.3.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.3.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+ 
+      2.4)
+ 	AC_MSG_RESULT(2.4 family)
+ 	AC_DEFINE([GLIBC_2_4], 1, [Define to 1 if you're using glibc 2.4.x])
+-	DEFAULT_SUPP="glibc-2.4.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.4.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+ 
+      2.5)
+ 	AC_MSG_RESULT(2.5 family)
+ 	AC_DEFINE([GLIBC_2_5], 1, [Define to 1 if you're using glibc 2.5.x])
+-	DEFAULT_SUPP="glibc-2.5.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.5.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.6)
+ 	AC_MSG_RESULT(2.6 family)
+ 	AC_DEFINE([GLIBC_2_6], 1, [Define to 1 if you're using glibc 2.6.x])
+-	DEFAULT_SUPP="glibc-2.6.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.6.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.7)
+ 	AC_MSG_RESULT(2.7 family)
+ 	AC_DEFINE([GLIBC_2_7], 1, [Define to 1 if you're using glibc 2.7.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.8)
+ 	AC_MSG_RESULT(2.8 family)
+ 	AC_DEFINE([GLIBC_2_8], 1, [Define to 1 if you're using glibc 2.8.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.9)
+ 	AC_MSG_RESULT(2.9 family)
+ 	AC_DEFINE([GLIBC_2_9], 1, [Define to 1 if you're using glibc 2.9.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.10)
+ 	AC_MSG_RESULT(2.10 family)
+ 	AC_DEFINE([GLIBC_2_10], 1, [Define to 1 if you're using glibc 2.10.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.11)
+ 	AC_MSG_RESULT(2.11 family)
+ 	AC_DEFINE([GLIBC_2_11], 1, [Define to 1 if you're using glibc 2.11.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+         ;;
+      2.12)
+ 	AC_MSG_RESULT(2.12 family)
+ 	AC_DEFINE([GLIBC_2_12], 1, [Define to 1 if you're using glibc 2.12.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.13)
+ 	AC_MSG_RESULT(2.13 family)
+ 	AC_DEFINE([GLIBC_2_13], 1, [Define to 1 if you're using glibc 2.13.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.14)
+ 	AC_MSG_RESULT(2.14 family)
+ 	AC_DEFINE([GLIBC_2_14], 1, [Define to 1 if you're using glibc 2.14.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.15)
+ 	AC_MSG_RESULT(2.15 family)
+ 	AC_DEFINE([GLIBC_2_15], 1, [Define to 1 if you're using glibc 2.15.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.16)
+ 	AC_MSG_RESULT(2.16 family)
+ 	AC_DEFINE([GLIBC_2_16], 1, [Define to 1 if you're using glibc 2.16.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.17)
+ 	AC_MSG_RESULT(2.17 family)
+ 	AC_DEFINE([GLIBC_2_17], 1, [Define to 1 if you're using glibc 2.17.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      2.18)
+ 	AC_MSG_RESULT(2.18 family)
+ 	AC_DEFINE([GLIBC_2_18], 1, [Define to 1 if you're using glibc 2.18.x])
+ 	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+-	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
+      darwin)
+ 	AC_MSG_RESULT(Darwin)
+@@ -926,7 +926,7 @@ case "${GLIBC_VERSION}" in
+      bionic)
+ 	AC_MSG_RESULT(Bionic)
+ 	AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
+-	DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="$srcdir/bionic.supp ${DEFAULT_SUPP}"
+ 	;;
+ 
+      *)
+@@ -943,11 +943,11 @@ AC_SUBST(GLIBC_VERSION)
+ # attempt to detect whether such libraries are installed on the
+ # build machine (or even if any X facilities are present); just
+ # add the suppressions antidisirregardless.
+-DEFAULT_SUPP="xfree-4.supp ${DEFAULT_SUPP}"
+-DEFAULT_SUPP="xfree-3.supp ${DEFAULT_SUPP}"
++DEFAULT_SUPP="$srcdir/xfree-4.supp ${DEFAULT_SUPP}"
++DEFAULT_SUPP="$srcdir/xfree-3.supp ${DEFAULT_SUPP}"
+ 
+ # Add glibc and X11 suppressions for exp-sgcheck
+-DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
++DEFAULT_SUPP="$srcdir/exp-sgcheck.supp ${DEFAULT_SUPP}"
+ 
+ 
+ #----------------------------------------------------------------------------
diff --git a/meta/recipes-devtools/valgrind/valgrind/valgrind-remove-rpath.patch b/meta/recipes-devtools/valgrind/valgrind/valgrind-remove-rpath.patch
new file mode 100644
index 0000000..f72e9ca
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind/valgrind-remove-rpath.patch
@@ -0,0 +1,25 @@
+
+Upstream-Status: Inappropriate [embedded config]
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: valgrind-3.10.0/none/tests/Makefile.am
+===================================================================
+--- valgrind-3.10.0.orig/none/tests/Makefile.am
++++ valgrind-3.10.0/none/tests/Makefile.am
+@@ -280,7 +280,6 @@ threaded_fork_LDADD	= -lpthread
+ threadederrno_LDADD	= -lpthread
+ tls_SOURCES		= tls.c tls2.c
+ tls_DEPENDENCIES	= tls.so tls2.so
+-tls_LDFLAGS		= -Wl,-rpath,$(abs_top_builddir)/none/tests
+ tls_LDADD		= tls.so tls2.so -lpthread
+ tls_so_SOURCES		= tls_so.c
+ tls_so_DEPENDENCIES	= tls2.so
+@@ -288,7 +287,7 @@ if VGCONF_OS_IS_DARWIN
+  tls_so_LDFLAGS		= -dynamic -dynamiclib -all_load -fpic
+  tls_so_LDADD		= `pwd`/tls2.so
+ else
+- tls_so_LDFLAGS		= -Wl,-rpath,$(abs_top_builddir)/none/tests -shared -fPIC
++ tls_so_LDFLAGS		= -shared -fPIC
+  tls_so_LDADD		= tls2.so
+ endif
+ tls_so_CFLAGS		= $(AM_CFLAGS) -fPIC
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
new file mode 100644
index 0000000..86ba979
--- /dev/null
+++ b/meta/recipes-devtools/valgrind/valgrind_3.10.1.bb
@@ -0,0 +1,105 @@
+SUMMARY = "Valgrind memory debugger and instrumentation framework"
+HOMEPAGE = "http://valgrind.org/"
+BUGTRACKER = "http://valgrind.org/support/bug_reports.html"
+LICENSE = "GPLv2 & GPLv2+ & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c46082167a314d785d012a244748d803 \
+                    file://include/pub_tool_basics.h;beginline=1;endline=29;md5=e7071929a50d4b0fc27a3014b315b0f7 \
+                    file://include/valgrind.h;beginline=1;endline=56;md5=92df8a1bde56fe2af70931ff55f6622f \
+                    file://COPYING.DOCS;md5=8fdeb5abdb235a08e76835f8f3260215"
+
+X11DEPENDS = "virtual/libx11"
+DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${X11DEPENDS}', '', d)} \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'boost', '', d)} \
+        "
+
+SRC_URI = "http://www.valgrind.org/downloads/valgrind-${PV}.tar.bz2 \
+           file://fixed-perl-path.patch \
+           file://Added-support-for-PPC-instructions-mfatbu-mfatbl.patch \
+           file://sepbuildfix.patch \
+           file://glibc.patch \
+           file://force-nostabs.patch \
+           file://remove-arm-variant-specific.patch \
+           file://remove-ppc-tests-failing-build.patch \
+           file://valgrind-remove-rpath.patch \
+           file://enable.building.on.4.x.kernel.patch \
+           file://add-ptest.patch \
+           file://pass-maltivec-only-if-it-supported.patch \
+           file://run-ptest \
+           file://0001-valgrind-Enable-rt_sigpending-syscall-on-ppc64-linux.patch \
+          "
+
+SRC_URI[md5sum] = "60ddae962bc79e7c95cfc4667245707f"
+SRC_URI[sha256sum] = "fa253dc26ddb661b6269df58144eff607ea3f76a9bcfe574b0c7726e1dfcb997"
+
+COMPATIBLE_HOST = '(i.86|x86_64|mips|powerpc|powerpc64).*-linux'
+COMPATIBLE_HOST_armv7a = 'arm.*-linux'
+
+PR = "r1"
+
+inherit autotools ptest
+
+EXTRA_OECONF = "--enable-tls --without-mpicc"
+EXTRA_OECONF_armv7a = "--enable-tls -host=armv7-none-linux-gnueabi --without-mpicc"
+EXTRA_OECONF += "${@['--enable-only32bit','--enable-only64bit'][d.getVar('SITEINFO_BITS', True) != '32']}"
+EXTRA_OEMAKE = "-w"
+
+do_install_append () {
+    install -m 644 ${B}/default.supp ${D}/${libdir}/valgrind/
+}
+
+RDEPENDS_${PN} += "perl"
+
+FILES_${PN}-dbg += "${libdir}/${PN}/*/.debug/*"
+
+# valgrind needs debug information for ld.so at runtime in order to
+# redirect functions like strlen.
+RRECOMMENDS_${PN} += "${TCLIBC}-dbg"
+
+RDEPENDS_${PN}-ptest += " sed perl glibc-utils perl-module-file-glob"
+
+do_compile_ptest() {
+    oe_runmake check CFLAGS="${CFLAGS} -O0" CXXFLAGS="${CXXFLAGS} -O0"
+}
+
+
+do_install_ptest() {
+    chmod +x ${B}/tests/vg_regtest
+
+    # The test application binaries are not automatically installed.
+    # Grab them from the build directory.
+    #
+    # The regression tests require scripts and data files that are not
+    # copied to the build directory.  They must be copied from the
+    # source directory. 
+    saved_dir=$PWD
+    for parent_dir in ${S} ${B} ; do
+        cd $parent_dir
+
+        # exclude shell or the package won't install
+        rm -rf none/tests/shell* 2>/dev/null
+
+        subdirs="tests cachegrind/tests callgrind/tests drd/tests helgrind/tests massif/tests memcheck/tests none/tests"
+
+        # Get the vg test scripts, filters, and expected files
+        for dir in $subdirs ; do
+            find $dir | cpio -pvdu ${D}${PTEST_PATH}
+        done
+        cd $saved_dir
+    done
+
+    # clean out build artifacts before building the rpm
+    find ${D}${PTEST_PATH} \
+         \( -name "Makefile*" \
+        -o -name "*.o" \
+        -o -name "*.c" \
+        -o -name "*.S" \
+        -o -name "*.h" \) \
+        -exec rm {} \;
+
+    # needed by massif tests
+    cp ${B}/massif/ms_print ${D}${PTEST_PATH}/massif/ms_print
+
+    # handle multilib
+    sed -i s:@libdir@:${libdir}:g ${D}${PTEST_PATH}/run-ptest
+}
+
diff --git a/meta/recipes-devtools/xmlto/files/catalog.xml b/meta/recipes-devtools/xmlto/files/catalog.xml
new file mode 100644
index 0000000..6b8833d
--- /dev/null
+++ b/meta/recipes-devtools/xmlto/files/catalog.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+<delegateSystem systemIdStartString="http://docbook.org/xml/" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//ELEMENTS DocBook" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//DTD DocBook XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//DTD XML Exchange Table Model 19990315" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//DTD CALS Table Model XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//ELEMENTS DocBk XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBook XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//ENTITIES DocBook" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//ENTITIES DocBk XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Norman Walsh//DTD DocBk XML" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//Normal Walsh//Exchange Table Model 19960430" catalog="./docbook-xml.xml"/>
+<delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/" catalog="./docbook-xml.xml"/>
+<delegatePublic publicIdStartString="-//OASIS//DTD DocBook CALS Table Model" catalog="./docbook-xml.xml"/>
+<delegateURI uriStartString="http://docbook.sourceforge.net/release/xsl/" catalog="./docbook-xsl.xml"/>
+<delegateSystem systemIdStartString="http://docbook.sourceforge.net/release/xsl/" catalog="./docbook-xsl.xml"/>
+</catalog>
diff --git a/meta/recipes-devtools/xmlto/xmlto-0.0.26/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch b/meta/recipes-devtools/xmlto/xmlto-0.0.26/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch
new file mode 100644
index 0000000..6d547a6
--- /dev/null
+++ b/meta/recipes-devtools/xmlto/xmlto-0.0.26/configure.in-drop-the-test-of-xmllint-and-xsltproc.patch
@@ -0,0 +1,30 @@
+configure.in: drop the test of xmllint and xsltproc
+
+The test is unnecessary, the xmllint and xsltproc were explicitly
+added to RDEPENDS.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.in b/configure.in
+--- a/configure.in
++++ b/configure.in
+@@ -42,10 +42,10 @@ AC_ARG_VAR([LOCALE], [Name and path of the `locale' program.])
+ AC_PATH_PROG([LOCALE], [locale], [locale])
+ 
+ AC_ARG_VAR([XMLLINT], [Name and path of the `xmllint' program.])
+-AC_PATH_PROG([XMLLINT], [xmllint], [xmllint])
++dnl AC_PATH_PROG([XMLLINT], [xmllint], [xmllint])
+ 
+ AC_ARG_VAR([XSLTPROC], [Name and path of the `xsltproc' program.])
+-AC_PATH_PROG([XSLTPROC], [xsltproc], [xsltproc])
++dnl AC_PATH_PROG([XSLTPROC], [xsltproc], [xsltproc])
+ 
+ dnl
+ dnl toolchains
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-devtools/xmlto/xmlto_0.0.26.bb b/meta/recipes-devtools/xmlto/xmlto_0.0.26.bb
new file mode 100644
index 0000000..a7a0183
--- /dev/null
+++ b/meta/recipes-devtools/xmlto/xmlto_0.0.26.bb
@@ -0,0 +1,38 @@
+SUMMARY = "A shell-script tool for converting XML files to various formats"
+HOMEPAGE = "https://fedorahosted.org/xmlto/"
+SECTION = "docs/xmlto"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+SRC_URI = "https://fedorahosted.org/releases/x/m/xmlto/xmlto-${PV}.tar.gz \
+           file://configure.in-drop-the-test-of-xmllint-and-xsltproc.patch \
+           file://catalog.xml \
+"
+SRC_URI[md5sum] = "0cca8be787ba01e00c618cb390c988b9"
+SRC_URI[sha256sum] = "cfd8d2a26077be1d5566dfe22dd66099ae4f4600dea97d6e113a2cc5b8708977"
+
+inherit autotools
+
+# xmlto needs getopt/xmllint/xsltproc/bash at runtime
+RDEPENDS_${PN} = "docbook-xml-dtd4 \
+                  docbook-xsl-stylesheets \
+                  util-linux \
+                  libxml2 \
+                  bash \
+"
+RDEPENDS_${PN}_append_class-target = " \
+                  libxslt-bin \
+"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF_append = " XMLLINT=xmllint XSLTPROC=xsltproc"
+
+do_install_append() {
+    install -d ${D}${sysconfdir}/xml/
+    install -m 755  ${WORKDIR}/catalog.xml ${D}${sysconfdir}/xml/catalog.xml
+    create_wrapper ${D}/${bindir}/xmlto XML_CATALOG_FILES=${sysconfdir}/xml/catalog.xml
+}
+
+do_populate_sysroot[rdeptask] = "do_populate_sysroot"
diff --git a/meta/recipes-devtools/yasm/yasm_1.3.0.bb b/meta/recipes-devtools/yasm/yasm_1.3.0.bb
new file mode 100644
index 0000000..78702ed
--- /dev/null
+++ b/meta/recipes-devtools/yasm/yasm_1.3.0.bb
@@ -0,0 +1,14 @@
+SUMMARY = "x86 (SSE) assembler supporting NASM and GAS-syntaxes"
+LICENSE = "BSD"
+HOMEPAGE = "http://www.tortall.net/projects/yasm/"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a12d8903508fb6bfd49d8d82c6170dd9"
+
+SRC_URI = "http://www.tortall.net/projects/yasm/releases/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "fc9e586751ff789b34b1f21d572d96af"
+SRC_URI[sha256sum] = "3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f"
+
+inherit autotools gettext
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb b/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
new file mode 100644
index 0000000..021c058
--- /dev/null
+++ b/meta/recipes-devtools/zisofs-tools/zisofs-tools-native_1.0.8.bb
@@ -0,0 +1,20 @@
+# zisofs-tools-native OE build file
+# Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+SUMMARY = "Utilities for creating compressed CD-ROM filesystems"
+HOMEPAGE = "http://freecode.com/projects/zisofs-tools"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "zlib-native"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/zisofs-tools/zisofs-tools-${PV}.tar.bz2/2d0ed8c9a1f60b45f949b136f9be1f6c/zisofs-tools-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "2d0ed8c9a1f60b45f949b136f9be1f6c"
+SRC_URI[sha256sum] = "ae4e53e4914934d41660248fb59d3c8761f1f1fd180d5ec993c17ddb3afd04f3"
+
+inherit native
+
+do_install() {
+	oe_runmake install INSTALLROOT=${D} bindir=${bindir}
+}
diff --git a/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch b/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch
new file mode 100644
index 0000000..53ae28b
--- /dev/null
+++ b/meta/recipes-extended/at/at/0001-remove-glibc-assumption.patch
@@ -0,0 +1,57 @@
+From 7f811d9c4ebc9444e613e251c31d6bf537a24dc1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 16:35:30 -0700
+Subject: [PATCH] remove glibc assumption
+
+glibc time.h header has an undocumented __isleap macro
+that we are using anf musl is missing it.
+Since it is undocumented & does not appear
+on any other libc, stop using it and just define the macro in
+locally  instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ parsetime.y | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/parsetime.y b/parsetime.y
+index 7005e88..324e6d3 100644
+--- a/parsetime.y
++++ b/parsetime.y
+@@ -8,6 +8,9 @@
+ 
+ #define YYDEBUG 1
+ 
++#define is_leap_year(y) \
++    ((y) % 4 == 0 && ((y) % 100 != 0 || (y) % 400 == 0))
++
+ struct tm exectm;
+ static int isgmt;
+ static int yearspec;
+@@ -217,8 +220,8 @@ date            : month_name day_number
+ 				 mnum == 12) && dnum > 31)
+ 			    || ((mnum ==  4 || mnum ==  6 || mnum ==  9 ||
+ 			         mnum == 11) && dnum > 30)
+-			    || (mnum ==  2 && dnum > 29 &&  __isleap(ynum+1900))
+-			    || (mnum ==  2 && dnum > 28 && !__isleap(ynum+1900))
++			    || (mnum ==  2 && dnum > 29 &&  is_leap_year(ynum+1900))
++			    || (mnum ==  2 && dnum > 28 && !is_leap_year(ynum+1900))
+ 			   )
+ 			{
+ 			    yyerror("Error in day of month");
+@@ -261,8 +264,8 @@ date            : month_name day_number
+ 				 mnum == 12) && dnum > 31)
+ 			    || ((mnum ==  4 || mnum ==  6 || mnum ==  9 ||
+ 			         mnum == 11) && dnum > 30)
+-			    || (mnum ==  2 && dnum > 29 &&  __isleap(ynum+1900))
+-			    || (mnum ==  2 && dnum > 28 && !__isleap(ynum+1900))
++			    || (mnum ==  2 && dnum > 29 &&  is_leap_year(ynum+1900))
++			    || (mnum ==  2 && dnum > 28 && !is_leap_year(ynum+1900))
+ 			   )
+ 			{
+ 			    yyerror("Error in day of month");
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/at/at/atd.init b/meta/recipes-extended/at/at/atd.init
new file mode 100644
index 0000000..eca379b
--- /dev/null
+++ b/meta/recipes-extended/at/at/atd.init
@@ -0,0 +1,45 @@
+#!/bin/sh
+#
+# Starts at daemon
+#
+
+umask 077
+
+# Source function library.
+. /etc/init.d/functions
+
+start() {
+	echo -n "Starting atd: "
+	start-stop-daemon --start --quiet --pidfile /var/run/atd.pid --background --exec /usr/sbin/atd -- -f
+	echo "OK"
+}
+stop() {
+	echo -n "Stopping atd: "
+	start-stop-daemon --stop --quiet --pidfile /var/run/atd.pid
+	echo "OK"
+}
+restart() {
+	stop
+	start
+}
+
+case "$1" in
+  start)
+	start
+	;;
+  stop)
+	stop
+	;;
+  restart|reload)
+	restart
+	;;
+  status)
+	status /usr/sbin/atd
+	;;
+  *)
+	echo $"Usage: $0 {start|stop|restart|status}"
+	exit 1
+esac
+
+exit $?
+
diff --git a/meta/recipes-extended/at/at/atd.service b/meta/recipes-extended/at/at/atd.service
new file mode 100644
index 0000000..6dc8445
--- /dev/null
+++ b/meta/recipes-extended/at/at/atd.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Job spooling tools
+After=syslog.target
+
+[Service]
+ExecStart=@SBINDIR@/atd -f
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-extended/at/at/configure-add-enable-pam.patch b/meta/recipes-extended/at/at/configure-add-enable-pam.patch
new file mode 100644
index 0000000..1e5efef
--- /dev/null
+++ b/meta/recipes-extended/at/at/configure-add-enable-pam.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+--- at-3.1.12/configure.ac	2011-06-23 14:51:03.653572945 +0800
++++ at-3.1.12/configure.ac.new	2011-06-27 16:12:14.903572945 +0800
+@@ -81,10 +81,18 @@
+ AC_FUNC_VPRINTF
+ AC_FUNC_GETLOADAVG
+ AC_CHECK_FUNCS(getcwd mktime strftime setreuid setresuid sigaction waitpid)
++
++AC_ARG_WITH([pam],
++  [AS_HELP_STRING([--without-pam], [without PAM support])])
++
++if test "x$with_pam" != xno; then
+ AC_CHECK_HEADERS(security/pam_appl.h, [
+   PAMLIB="-lpam"
+-  AC_DEFINE(HAVE_PAM, 1, [Define to 1 for PAM support])
+-])
++  AC_DEFINE(HAVE_PAM, 1, [Define to 1 for PAM support])],
++   [if test "x$with_pam" = xyes; then
++   AC_MSG_ERROR([PAM selected but security/pam_misc.h not found])
++   fi])
++fi
+
+ dnl Checking for programs
+
diff --git a/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch b/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch
new file mode 100644
index 0000000..d5ef003
--- /dev/null
+++ b/meta/recipes-extended/at/at/file_replacement_with_gplv2.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate [licensing]
+
+posixtm.[ch] files are replaced with gplv2 version from these locations:
+
+http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/posixtm.c;hb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba
+http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/posixtm.h;hb=5661ab9d49512b4cf3c19caa11bb581d8ce561ba 
+
+update the Copyright file information to reflect the replaced files.
+
+Date: 2010/08/31
+Nitin A Kamble nitin.a.kamble@intel.com
+
+Index: at-3.1.12/Copyright
+===================================================================
+--- at-3.1.12.orig/Copyright
++++ at-3.1.12/Copyright
+@@ -31,10 +31,10 @@ The files posixtm.c and posixtm.h have t
+    Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004,
+    2005, 2006, 2007 Free Software Foundation Inc.
+ 
+-   This program is free software: you can redistribute it and/or modify
++   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.
++   the Free Software Foundation; either version 2, or (at your option)
++   any later version.
+ 
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/meta/recipes-extended/at/at/fix_parallel_build_error.patch b/meta/recipes-extended/at/at/fix_parallel_build_error.patch
new file mode 100644
index 0000000..66ff3e1
--- /dev/null
+++ b/meta/recipes-extended/at/at/fix_parallel_build_error.patch
@@ -0,0 +1,28 @@
+make -j was failing sometimesa like this
+| ccache i586-poky-linux-gcc -march=i586 --sysroot=/home/nitin/build/build0/tmp/sysroots/i586-poky-linux -I. -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types -o atd atd.o daemon.o  -lfl  -lpam -Wl,-O1 -Wl,--as-needed
+| parsetime.l:5:19: fatal error: y.tab.h: No such file or directory
+| compilation terminated.
+| make: *** [lex.yy.o] Error 1
+| make: *** Waiting for unfinished jobs....
+
+Fixed the issue by adding a dependency in the makefile.
+Nitin <nitin.a.kamble@intel.com>
+2010/09/02
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: at-3.1.12/Makefile.in
+===================================================================
+--- at-3.1.12.orig/Makefile.in
++++ at-3.1.12/Makefile.in
+@@ -83,6 +83,8 @@ y.tab.c y.tab.h: parsetime.y
+ lex.yy.c: parsetime.l
+ 	$(LEX) -i parsetime.l
+ 
++parsetime.l: y.tab.h
++
+ atrun: atrun.in
+ 	configure
+ 
diff --git a/meta/recipes-extended/at/at/makefile-fix-parallel.patch b/meta/recipes-extended/at/at/makefile-fix-parallel.patch
new file mode 100644
index 0000000..932a4c0
--- /dev/null
+++ b/meta/recipes-extended/at/at/makefile-fix-parallel.patch
@@ -0,0 +1,35 @@
+From 150b63a936af71b992a3a7b0fc2d2497e51fc800 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 28 Jan 2015 23:52:00 -0800
+Subject: [PATCH] Makefile: fix for parallel build
+
+Fixed:
+y.tab.c:1001:0: error: unterminated #if
+
+Let "$(YACC) -d parsetime.y" only run once will fix the problem.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 2a9b918..aa7c04a 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -75,7 +75,9 @@ at: $(ATOBJECTS)
+ atd: $(RUNOBJECTS)
+ 	$(CC) $(LDFLAGS) -o atd $(RUNOBJECTS) $(LIBS) $(PAMLIB)
+ 
+-y.tab.c y.tab.h: parsetime.y
++y.tab.h: y.tab.c
++
++y.tab.c: parsetime.y
+ 	$(YACC) -d parsetime.y
+ 
+ lex.yy.c: parsetime.l
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/at/at/pam.conf.patch b/meta/recipes-extended/at/at/pam.conf.patch
new file mode 100644
index 0000000..b5ceb9a
--- /dev/null
+++ b/meta/recipes-extended/at/at/pam.conf.patch
@@ -0,0 +1,27 @@
+oe doesn't support "@include", use the concrete directive instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+Index: at-3.1.15/pam.conf
+===================================================================
+--- at-3.1.15.orig/pam.conf
++++ at-3.1.15/pam.conf
+@@ -1,10 +1,11 @@
+ #
+ # The PAM configuration file for the at daemon
+ #
++ 
++auth    required    pam_env.so
++auth    include     common-auth
++account include     common-account
++session include     common-session-noninteractive
++session required    pam_limits.so
++session required    pam_loginuid.so
+ 
+-auth	required	pam_env.so
+-@include common-auth
+-@include common-account
+-session    required   pam_loginuid.so
+-@include common-session-noninteractive
+-session    required   pam_limits.so
diff --git a/meta/recipes-extended/at/at/posixtm.c b/meta/recipes-extended/at/at/posixtm.c
new file mode 100644
index 0000000..5514ba4
--- /dev/null
+++ b/meta/recipes-extended/at/at/posixtm.c
@@ -0,0 +1,328 @@
+/* Parse dates for touch and date.
+
+   Copyright (C) 1989, 1990, 1991, 1998, 2000, 2001, 2002, 2003, 2004,
+   2005, 2006, 2007 Free Software Foundation Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Yacc-based version written by Jim Kingdon and David MacKenzie.
+   Rewritten by Jim Meyering.  */
+
+#include <config.h>
+
+#include "posixtm.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <string.h>
+
+#if USE_UNLOCKED_IO
+# include "unlocked-io.h"
+#endif
+
+/* ISDIGIT differs from isdigit, as follows:
+   - Its arg may be any int or unsigned int; it need not be an unsigned char
+     or EOF.
+   - It's typically faster.
+   POSIX says that only '0' through '9' are digits.  Prefer ISDIGIT to
+   isdigit unless it's important to use the locale's definition
+   of `digit' even when the host does not conform to POSIX.  */
+#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
+
+time_t mktime ();
+
+/*
+  POSIX requires:
+
+  touch -t [[CC]YY]mmddhhmm[.ss] FILE...
+    8, 10, or 12 digits, followed by optional .ss
+    (PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS)
+
+  touch mmddhhmm[YY] FILE... (obsoleted by POSIX 1003.1-2001)
+    8 or 10 digits, YY (if present) must be in the range 69-99
+    (PDS_TRAILING_YEAR | PDS_PRE_2000)
+
+  date mmddhhmm[[CC]YY]
+    8, 10, or 12 digits
+    (PDS_TRAILING_YEAR | PDS_CENTURY)
+
+*/
+
+static int
+year (struct tm *tm, const int *digit_pair, size_t n, unsigned int syntax_bits)
+{
+  switch (n)
+    {
+    case 1:
+      tm->tm_year = *digit_pair;
+      /* Deduce the century based on the year.
+	 POSIX requires that 00-68 be interpreted as 2000-2068,
+	 and that 69-99 be interpreted as 1969-1999.  */
+      if (digit_pair[0] <= 68)
+	{
+	  if (syntax_bits & PDS_PRE_2000)
+	    return 1;
+	  tm->tm_year += 100;
+	}
+      break;
+
+    case 2:
+      if (! (syntax_bits & PDS_CENTURY))
+	return 1;
+      tm->tm_year = digit_pair[0] * 100 + digit_pair[1] - 1900;
+      break;
+
+    case 0:
+      {
+	time_t now;
+	struct tm *tmp;
+
+	/* Use current year.  */
+	time (&now);
+	tmp = localtime (&now);
+	if (! tmp)
+	  return 1;
+	tm->tm_year = tmp->tm_year;
+      }
+      break;
+
+    default:
+      abort ();
+    }
+
+  return 0;
+}
+
+static int
+posix_time_parse (struct tm *tm, const char *s, unsigned int syntax_bits)
+{
+  const char *dot = NULL;
+  int pair[6];
+  int *p;
+  size_t i;
+
+  size_t s_len = strlen (s);
+  size_t len = (((syntax_bits & PDS_SECONDS) && (dot = strchr (s, '.')))
+		? (size_t) (dot - s)
+		: s_len);
+
+  if (len != 8 && len != 10 && len != 12)
+    return 1;
+
+  if (dot)
+    {
+      if (!(syntax_bits & PDS_SECONDS))
+	return 1;
+
+      if (s_len - len != 3)
+	return 1;
+    }
+
+  for (i = 0; i < len; i++)
+    if (!ISDIGIT (s[i]))
+      return 1;
+
+  len /= 2;
+  for (i = 0; i < len; i++)
+    pair[i] = 10 * (s[2*i] - '0') + s[2*i + 1] - '0';
+
+  p = pair;
+  if (syntax_bits & PDS_LEADING_YEAR)
+    {
+      if (year (tm, p, len - 4, syntax_bits))
+	return 1;
+      p += len - 4;
+      len = 4;
+    }
+
+  /* Handle 8 digits worth of `MMDDhhmm'.  */
+  tm->tm_mon = *p++ - 1;
+  tm->tm_mday = *p++;
+  tm->tm_hour = *p++;
+  tm->tm_min = *p++;
+  len -= 4;
+
+  /* Handle any trailing year.  */
+  if (syntax_bits & PDS_TRAILING_YEAR)
+    {
+      if (year (tm, p, len, syntax_bits))
+	return 1;
+    }
+
+  /* Handle seconds.  */
+  if (!dot)
+    {
+      tm->tm_sec = 0;
+    }
+  else
+    {
+      int seconds;
+
+      ++dot;
+      if (!ISDIGIT (dot[0]) || !ISDIGIT (dot[1]))
+	return 1;
+      seconds = 10 * (dot[0] - '0') + dot[1] - '0';
+
+      tm->tm_sec = seconds;
+    }
+
+  return 0;
+}
+
+/* Parse a POSIX-style date, returning true if successful.  */
+
+bool
+posixtime (time_t *p, const char *s, unsigned int syntax_bits)
+{
+  struct tm tm0
+#ifdef lint
+  /* Placate gcc-4's -Wuninitialized.
+     posix_time_parse fails to set all of tm0 only when it returns
+     nonzero (due to year() returning nonzero), and in that case,
+     this code doesn't use the tm0 at all.  */
+    = { 0, }
+#endif
+    ;
+  struct tm tm1;
+  struct tm const *tm;
+  time_t t;
+
+  if (posix_time_parse (&tm0, s, syntax_bits))
+    return false;
+
+  tm1 = tm0;
+  tm1.tm_isdst = -1;
+  t = mktime (&tm1);
+
+  if (t != (time_t) -1)
+    tm = &tm1;
+  else
+    {
+      /* mktime returns -1 for errors, but -1 is also a valid time_t
+	 value.  Check whether an error really occurred.  */
+      tm = localtime (&t);
+      if (! tm)
+	return false;
+    }
+
+  /* Reject dates like "September 31" and times like "25:61".  */
+  if ((tm0.tm_year ^ tm->tm_year)
+      | (tm0.tm_mon ^ tm->tm_mon)
+      | (tm0.tm_mday ^ tm->tm_mday)
+      | (tm0.tm_hour ^ tm->tm_hour)
+      | (tm0.tm_min ^ tm->tm_min)
+      | (tm0.tm_sec ^ tm->tm_sec))
+    return false;
+
+  *p = t;
+  return true;
+}
+
+#ifdef TEST_POSIXTIME
+/*
+    Test mainly with syntax_bits == 13
+    (aka: (PDS_LEADING_YEAR | PDS_CENTURY | PDS_SECONDS))
+
+    This test data assumes Universal Time, e.g., TZ="UTC0".
+
+    This test data also assumes that time_t is signed and is at least
+    39 bits wide, so that it can represent all years from 0000 through
+    9999.  A host with 32-bit signed time_t can represent only time
+    stamps in the range 1901-12-13 20:45:52 through 2038-01-18
+    03:14:07 UTC, assuming POSIX time_t with no leap seconds, so test
+    cases outside this range will not work on such a host.
+
+    Also, the first two lines of test data assume that the current
+    year is 2002.
+
+BEGIN-DATA
+12131415.16     13   1039788916 Fri Dec 13 14:15:16 2002
+12131415.16     13   1039788916 Fri Dec 13 14:15:16 2002
+000001010000.00 13 -62167132800 Sun Jan  1 00:00:00 0000
+190112132045.52 13  -2147483648 Fri Dec 13 20:45:52 1901
+190112132045.53 13  -2147483647 Fri Dec 13 20:45:53 1901
+190112132046.52 13  -2147483588 Fri Dec 13 20:46:52 1901
+190112132145.52 13  -2147480048 Fri Dec 13 21:45:52 1901
+190112142045.52 13  -2147397248 Sat Dec 14 20:45:52 1901
+190201132045.52 13  -2144805248 Mon Jan 13 20:45:52 1902
+196912312359.59 13           -1 Wed Dec 31 23:59:59 1969
+197001010000.00 13            0 Thu Jan  1 00:00:00 1970
+197001010000.01 13            1 Thu Jan  1 00:00:01 1970
+197001010001.00 13           60 Thu Jan  1 00:01:00 1970
+197001010100.00 13         3600 Thu Jan  1 01:00:00 1970
+197001020000.00 13        86400 Fri Jan  2 00:00:00 1970
+197002010000.00 13      2678400 Sun Feb  1 00:00:00 1970
+197101010000.00 13     31536000 Fri Jan  1 00:00:00 1971
+197001000000.00 13            * *
+197000010000.00 13            * *
+197001010000.60 13            * *
+197001010060.00 13            * *
+197001012400.00 13            * *
+197001320000.00 13            * *
+197013010000.00 13            * *
+203801190314.06 13   2147483646 Tue Jan 19 03:14:06 2038
+203801190314.07 13   2147483647 Tue Jan 19 03:14:07 2038
+203801190314.08 13   2147483648 Tue Jan 19 03:14:08 2038
+999912312359.59 13 253402300799 Fri Dec 31 23:59:59 9999
+1112131415      13   1323785700 Tue Dec 13 14:15:00 2011
+1112131415.16   13   1323785716 Tue Dec 13 14:15:16 2011
+201112131415.16 13   1323785716 Tue Dec 13 14:15:16 2011
+191112131415.16 13  -1831974284 Wed Dec 13 14:15:16 1911
+203712131415.16 13   2144326516 Sun Dec 13 14:15:16 2037
+3712131415.16   13   2144326516 Sun Dec 13 14:15:16 2037
+6812131415.16   13   3122633716 Thu Dec 13 14:15:16 2068
+6912131415.16   13     -1590284 Sat Dec 13 14:15:16 1969
+7012131415.16   13     29945716 Sun Dec 13 14:15:16 1970
+1213141599       2    945094500 Mon Dec 13 14:15:00 1999
+1213141500       2    976716900 Wed Dec 13 14:15:00 2000
+END-DATA
+
+*/
+
+# define MAX_BUFF_LEN 1024
+
+int
+main (void)
+{
+  char buff[MAX_BUFF_LEN + 1];
+
+  buff[MAX_BUFF_LEN] = 0;
+  while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
+    {
+      char time_str[MAX_BUFF_LEN];
+      unsigned int syntax_bits;
+      time_t t;
+      if (sscanf (buff, "%s %u", time_str, &syntax_bits) != 2)
+	printf ("*\n");
+      else
+	{
+	  printf ("%-15s %2u ", time_str, syntax_bits);
+	  if (posixtime (&t, time_str, syntax_bits))
+	    printf ("%12ld %s", (long int) t, ctime (&t));
+	  else
+	    printf ("%12s %s", "*", "*\n");
+	}
+    }
+  exit (0);
+
+}
+#endif
+
+/*
+Local Variables:
+compile-command: "gcc -DTEST_POSIXTIME -g -O -Wall -W posixtm.c"
+End:
+*/
diff --git a/meta/recipes-extended/at/at/posixtm.h b/meta/recipes-extended/at/at/posixtm.h
new file mode 100644
index 0000000..e91749d
--- /dev/null
+++ b/meta/recipes-extended/at/at/posixtm.h
@@ -0,0 +1,37 @@
+/* Parse dates for touch and date.
+
+   Copyright (C) 1998, 2003, 2005, 2007 Free Software Foundation Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Yacc-based version written by Jim Kingdon and David MacKenzie.
+   Rewritten by Jim Meyering.  */
+
+#ifndef POSIXTM_H_
+# define POSIXTM_H_
+
+# include <stdbool.h>
+# include <time.h>
+
+/* POSIX Date Syntax flags.  */
+# define PDS_LEADING_YEAR 1
+# define PDS_TRAILING_YEAR 2
+# define PDS_CENTURY 4
+# define PDS_SECONDS 8
+# define PDS_PRE_2000 16
+
+bool posixtime (time_t *p, const char *s, unsigned int syntax_bits);
+
+#endif
diff --git a/meta/recipes-extended/at/at_3.1.16.bb b/meta/recipes-extended/at/at_3.1.16.bb
new file mode 100644
index 0000000..0512bcb
--- /dev/null
+++ b/meta/recipes-extended/at/at_3.1.16.bb
@@ -0,0 +1,69 @@
+SUMMARY = "Delayed job execution and batch processing"
+DESCRIPTION = "At allows for commands to be run at a particular time.  Batch will execute commands when \
+the system load levels drop to a particular level."
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
+DEPENDS = "flex flex-native \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+
+RDEPENDS_${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)} \
+"
+
+PAM_DEPS = "libpam libpam-runtime pam-plugin-env pam-plugin-limits"
+
+RCONFLICTS_${PN} = "atd"
+RREPLACES_${PN} = "atd"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/a/at/at_${PV}.orig.tar.gz \
+    file://fix_parallel_build_error.patch \
+    file://posixtm.c \
+    file://posixtm.h \
+    file://file_replacement_with_gplv2.patch \
+    file://atd.init \
+    file://atd.service \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+    file://makefile-fix-parallel.patch \
+    file://0001-remove-glibc-assumption.patch \
+    "
+
+PAM_SRC_URI = "file://pam.conf.patch \
+               file://configure-add-enable-pam.patch"
+
+SRC_URI[md5sum] = "d05da75d9b75d93917ffb16ab48b1e19"
+SRC_URI[sha256sum] = "cb9af59c6a54edce9536ba629841055409d1f89d8ae26494727a97141fb4d5c1"
+
+EXTRA_OECONF += "ac_cv_path_SENDMAIL=/bin/true \
+                 --with-daemon_username=root \
+                 --with-daemon_groupname=root \
+                 --with-jobdir=/var/spool/at/jobs \
+                 --with-atspool=/var/spool/at/spool \
+                 ac_cv_header_security_pam_appl_h=${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', 'no', d)} "
+
+inherit autotools-brokensep systemd update-rc.d
+
+INITSCRIPT_NAME = "atd"
+INITSCRIPT_PARAMS = "defaults"
+
+SYSTEMD_SERVICE_${PN} = "atd.service"
+
+
+do_compile_prepend () {
+	cp -f ${WORKDIR}/posixtm.[ch] ${S}
+}
+
+do_install () {
+	oe_runmake -e "IROOT=${D}" install
+
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755    ${WORKDIR}/atd.init		${D}${sysconfdir}/init.d/atd
+
+	# install systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/atd.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/atd.service
+
+	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+		install -D -m 0644 ${WORKDIR}/${BP}/pam.conf ${D}${sysconfdir}/pam.d/atd
+	fi
+}
diff --git a/meta/recipes-extended/augeas/augeas.inc b/meta/recipes-extended/augeas/augeas.inc
new file mode 100644
index 0000000..23d12ca
--- /dev/null
+++ b/meta/recipes-extended/augeas/augeas.inc
@@ -0,0 +1,30 @@
+SUMMARY = "Augeas configuration API"
+HOMEPAGE = "http://augeas.net/"
+BUGTRACKER = "https://fedorahosted.org/augeas/report/1"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bbb461211a33b134d42ed5ee802b37ff"
+
+SRC_URI = "http://download.augeas.net/${BP}.tar.gz \
+           file://add-missing-argz-conditional.patch \
+           file://sepbuildfix.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+          "
+
+DEPENDS = "readline libxml2"
+
+inherit autotools pkgconfig
+
+PACKAGES =+ "${PN}-lenses lib${BPN}"
+
+FILES_${PN}-lenses = "${datadir}/augeas/lenses"
+FILES_lib${BPN} = "${libdir}/lib*${SOLIBS}"
+
+RDEPENDS_lib${BPN} += "${PN}-lenses"
+RRECOMMENDS_lib${BPN} += "${PN}"
+
+LEAD_SONAME = "libaugeas.so"
+
+do_install_append() {
+	rm -fr ${D}${datadir}/vim
+}
diff --git a/meta/recipes-extended/augeas/augeas/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/augeas/augeas/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..9a19876
--- /dev/null
+++ b/meta/recipes-extended/augeas/augeas/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: augeas-1.2.0/gnulib/lib/Makefile.am
+===================================================================
+--- augeas-1.2.0.orig/gnulib/lib/Makefile.am
++++ augeas-1.2.0/gnulib/lib/Makefile.am
+@@ -463,7 +463,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
diff --git a/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch b/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch
new file mode 100644
index 0000000..abbdbaa
--- /dev/null
+++ b/meta/recipes-extended/augeas/augeas/add-missing-argz-conditional.patch
@@ -0,0 +1,20 @@
+Add missing GL_GENERATE_ARGZ_H conditional
+
+- GL_GENERATE_ARGZ_H is used in gnulib/lib/Makefile.am
+
+Upstream-Status: Pending
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: augeas-1.0.0/configure.ac
+===================================================================
+--- augeas-1.0.0.orig/configure.ac
++++ augeas-1.0.0/configure.ac
+@@ -55,6 +55,8 @@ AC_ARG_WITH([failmalloc],
+ 
+ AM_CONDITIONAL([WITH_FAILMALLOC], [test x$with_failmalloc != xno])
+ 
++AM_CONDITIONAL([GL_GENERATE_ARGZ_H], [test -n "$ARGZ_H"])
++
+ dnl --enable-debug=(yes|no)
+ AC_ARG_ENABLE([debug],
+               [AC_HELP_STRING([--enable-debug=no/yes],
diff --git a/meta/recipes-extended/augeas/augeas/sepbuildfix.patch b/meta/recipes-extended/augeas/augeas/sepbuildfix.patch
new file mode 100644
index 0000000..b82a3ee
--- /dev/null
+++ b/meta/recipes-extended/augeas/augeas/sepbuildfix.patch
@@ -0,0 +1,22 @@
+Ensure that builds in separate builddirs (${B} != ${S}) correctly install the 
+lenses files.
+
+Upstream-Status: Pending
+
+RP 2013/4/17
+
+Index: augeas-1.0.0/Makefile.am
+===================================================================
+--- augeas-1.0.0.orig/Makefile.am	2012-11-02 15:20:11.000000000 +0000
++++ augeas-1.0.0/Makefile.am	2013-04-17 10:36:24.033400125 +0000
+@@ -5,8 +5,8 @@
+ lensdir=$(datadir)/augeas/lenses/dist
+ lenstestdir=$(datadir)/augeas/lenses/dist/tests
+ 
+-dist_lens_DATA=$(wildcard lenses/*.aug)
+-dist_lenstest_DATA=$(wildcard lenses/tests/*.aug)
++dist_lens_DATA=$(wildcard $(top_srcdir)/lenses/*.aug)
++dist_lenstest_DATA=$(wildcard $(top_srcdir)lenses/tests/*.aug)
+ 
+ EXTRA_DIST=augeas.spec build/aux/move-if-change Makefile.am HACKING
+ 
diff --git a/meta/recipes-extended/augeas/augeas_1.4.0.bb b/meta/recipes-extended/augeas/augeas_1.4.0.bb
new file mode 100644
index 0000000..1064ad4
--- /dev/null
+++ b/meta/recipes-extended/augeas/augeas_1.4.0.bb
@@ -0,0 +1,4 @@
+require augeas.inc
+
+SRC_URI[md5sum] = "a2536a9c3d744dc09d234228fe4b0c93"
+SRC_URI[sha256sum] = "659fae7ac229029e60a869a3b88c616cfd51cf2fba286cdfe3af3a052cb35b30"
diff --git a/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch b/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch
new file mode 100644
index 0000000..91341ee
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-3.2.48/build-tests.patch
@@ -0,0 +1,44 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Upstream-Status: Pending
+---
+diff -dNaur bash-3.2.48/Makefile.in.orig bash-3.2.48/Makefile.in
+--- bash-3.2.48/Makefile.in.orig	2006-08-17 23:03:35.000000000 +0500
++++ bash-3.2.48/Makefile.in	2013-07-02 20:20:07.512709327 +0500
+@@ -803,17 +803,31 @@
+ 	fi
+ 
+ recho$(EXEEXT):		$(SUPPORT_SRC)recho.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) -o $@ $<
+ 
+ zecho$(EXEEXT):		$(SUPPORT_SRC)zecho.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) -o $@ $<
+ 
+ printenv$(EXEEXT):	$(SUPPORT_SRC)printenv.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) -o $@ $<
+ 
+-test tests check:	force $(Program) $(TESTS_SUPPORT)
++test tests check:
++	@$(MAKE) install-test
++	@$(MAKE) runtest
++
++install-test: buildtest
++ifeq ($(origin INSTALL_TEST_DIR), undefined)
+ 	@-test -d tests || mkdir tests
+ 	@cp $(TESTS_SUPPORT) tests
++else
++	@-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
++	@cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
++	@cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
++endif
++
++buildtest: force $(Program) $(TESTS_SUPPORT)
++
++runtest:
+ 	@( cd $(srcdir)/tests && \
+ 		PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
+ 
diff --git a/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch b/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch
new file mode 100644
index 0000000..ee756dc
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-3.2.48/dont-include-target-CFLAGS-in-host-LDFLAGS.patch
@@ -0,0 +1,33 @@
+From 933bd886af49667e88e2385409449ab598813dab Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Wed, 15 Jul 2015 00:54:33 -0700
+Subject: [PATCH] dont include target CFLAGS in host LDFLAGS
+
+Building the host tool 'mkbuiltins' will fail if the target CFLAGS
+contains an option which isn't supported by the host's gcc. To prevent
+the issue, define LDFLAGS_FOR_BUILD based on CFLAGS_FOR_BUILD instead
+of CFLAGS.
+
+Upstream-Status: Inappropriate [required for bash 3.2.57 (GPLv2) recipe only]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ builtins/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builtins/Makefile.in b/builtins/Makefile.in
+index e027f7a..ebfddf3 100644
+--- a/builtins/Makefile.in
++++ b/builtins/Makefile.in
+@@ -63,7 +63,7 @@ LOCAL_DEFS = @LOCAL_DEFS@
+ 
+ LIBS = @LIBS@
+ LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS)
+-LDFLAGS_FOR_BUILD = $(LDFLAGS)
++LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ $(LOCAL_LDFLAGS) $(CFLAGS_FOR_BUILD)
+ LOCAL_LDFLAGS = @LOCAL_LDFLAGS@
+ #LIBS_FOR_BUILD = @LIBS_FOR_BUILD@
+ LIBS_FOR_BUILD = $(LIBS)
+-- 
+1.9.1
+
diff --git a/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch b/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch
new file mode 100644
index 0000000..c4229a7
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-3.2.48/mkbuiltins_have_stringize.patch
@@ -0,0 +1,29 @@
+On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by
+the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers
+use the STRING() macro from unistd.h. A header in the bash sources overrides
+the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the
+wrappers to generate calls to 'xread' and 'xopen', which do not exist,
+resulting in a failure to link.
+
+Assume we have stringize support when cross-compiling, which works around the
+issue.
+
+It may be best for upstream to either give up on supporting compilers without
+stringize support, or to not define STRING() at all when FORTIFY_SOURCES is
+defined, letting the unistd.h one be used, instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+--- bash-4.2.orig/builtins/mkbuiltins.c
++++ bash-4.2/builtins/mkbuiltins.c
+@@ -28,6 +28,7 @@
+ #  define HAVE_STDLIB_H
+
+ #  define HAVE_RENAME
++#  define HAVE_STRINGIZE
+ #endif /* CROSS_COMPILING */
+
+ #if defined (HAVE_UNISTD_H)
diff --git a/meta/recipes-extended/bash/bash-3.2.48/run-ptest b/meta/recipes-extended/bash/bash-3.2.48/run-ptest
new file mode 100644
index 0000000..8dd3b99
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-3.2.48/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k THIS_SH=/bin/bash BUILD_DIR=. runtest
diff --git a/meta/recipes-extended/bash/bash-3.2.48/test-output.patch b/meta/recipes-extended/bash/bash-3.2.48/test-output.patch
new file mode 100644
index 0000000..2b09b7d
--- /dev/null
+++ b/meta/recipes-extended/bash/bash-3.2.48/test-output.patch
@@ -0,0 +1,25 @@
+Add FAIL/PASS output to test output.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/tests/run-all b/tests/run-all
+--- a/tests/run-all	1999-10-08 17:07:46.000000000 +0200
++++ b/tests/run-all	2012-10-27 21:04:18.663331887 +0200
+@@ -22,7 +22,15 @@
+ 	case $x in
+ 	$0|run-minimal|run-gprof)	;;
+ 	*.orig|*~) ;;
+-	*)	echo $x ; sh $x ;;
++    *)  echo $x
++         output=`sh $x`
++         if [ -n "$output" ]; then
++             echo "$output"
++             echo "FAIL: $x"
++         else
++             echo "PASS: $x"
++         fi
++         ;;
+ 	esac
+ done
+ 
diff --git a/meta/recipes-extended/bash/bash.inc b/meta/recipes-extended/bash/bash.inc
new file mode 100644
index 0000000..c06f157
--- /dev/null
+++ b/meta/recipes-extended/bash/bash.inc
@@ -0,0 +1,60 @@
+SUMMARY = "An sh-compatible command language interpreter"
+HOMEPAGE = "http://tiswww.case.edu/php/chet/bash/bashtop.html"
+SECTION = "base/shell"
+
+DEPENDS = "ncurses bison-native"
+
+inherit autotools gettext texinfo update-alternatives ptest
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+EXTRA_OECONF = "--enable-job-control"
+
+# If NON_INTERACTIVE_LOGIN_SHELLS is defined, all login shells read the
+# startup files, even if they are not interactive.
+# This is what other major distros do. And this is what we wanted. See bug#5359 and bug#7137.
+CFLAGS += "-DNON_INTERACTIVE_LOGIN_SHELLS"
+
+ALTERNATIVE_${PN} = "sh"
+ALTERNATIVE_LINK_NAME[sh] = "${base_bindir}/sh"
+ALTERNATIVE_TARGET[sh] = "${base_bindir}/bash"
+ALTERNATIVE_PRIORITY = "100"
+
+RDEPENDS_${PN} += "base-files"
+RDEPENDS_${PN}_class-nativesdk = ""
+RDEPENDS_${PN}-ptest += "make"
+
+do_configure_prepend () {
+	if [ ! -e ${S}/acinclude.m4 ]; then
+		cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+	fi
+}
+
+do_compile_ptest () {
+	oe_runmake buildtest
+}
+
+do_install_append () {
+	# Move /usr/bin/bash to /bin/bash, if need
+	if [ "${base_bindir}" != "${bindir}" ]; then
+		mkdir -p ${D}${base_bindir}
+		mv ${D}${bindir}/bash ${D}${base_bindir}
+	fi
+}
+do_install_append_class-target () {
+	# Clean host path in bashbug
+	sed -i -e "s,${STAGING_DIR_TARGET},,g" ${D}${bindir}/bashbug
+}
+
+do_install_ptest () {
+	make INSTALL_TEST_DIR=${D}${PTEST_PATH}/tests install-test
+	cp ${B}/Makefile ${D}${PTEST_PATH}
+        sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile
+}
+
+pkg_postinst_${PN} () {
+	grep -q "^${base_bindir}/bash$" $D${sysconfdir}/shells || echo ${base_bindir}/bash >> $D${sysconfdir}/shells
+}
+
+pkg_postrm_${PN} () {
+	printf "$(grep -v "^${base_bindir}/bash$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+}
diff --git a/meta/recipes-extended/bash/bash/build-tests.patch b/meta/recipes-extended/bash/bash/build-tests.patch
new file mode 100644
index 0000000..73a81b6
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/build-tests.patch
@@ -0,0 +1,55 @@
+Add 'ptest' target to Makefile, to run tests without checking dependencies.
+
+Upstream-Status: Pending
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 24 +++++++++++++++++++-----
+ 1 file changed, 19 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -848,20 +848,34 @@ maybe-clean:
+ 	fi
+ 
+ recho$(EXEEXT):		$(SUPPORT_SRC)recho.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)recho.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+ 
+ zecho$(EXEEXT):		$(SUPPORT_SRC)zecho.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)zecho.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+ 
+ printenv$(EXEEXT):	$(SUPPORT_SRC)printenv.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)printenv.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+ 
+ xcase$(EXEEXT):	$(SUPPORT_SRC)xcase.c
+-	@$(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) ${LDFLAGS_FOR_BUILD} -o $@ $(SUPPORT_SRC)xcase.c ${LIBS_FOR_BUILD}
++	@$(CC) $(CCFLAGS) ${LDFLAGS} -o $@ $<
+ 
+-test tests check:	force $(Program) $(TESTS_SUPPORT)
++test tests check:
++	@$(MAKE) install-test
++	@$(MAKE) runtest
++
++install-test: buildtest
++ifeq ($(origin INSTALL_TEST_DIR), undefined)
+ 	@-test -d tests || mkdir tests
+ 	@cp $(TESTS_SUPPORT) tests
++else
++	@-test -d $(INSTALL_TEST_DIR) || mkdir -p $(INSTALL_TEST_DIR)
++	@cp -r $(srcdir)/tests/* $(INSTALL_TEST_DIR)/
++	@cp $(TESTS_SUPPORT) $(INSTALL_TEST_DIR)
++endif
++
++buildtest: force $(Program) $(TESTS_SUPPORT)
++
++runtest:
+ 	@( cd $(srcdir)/tests && \
+ 		PATH=$(BUILD_DIR)/tests:$$PATH THIS_SH=$(THIS_SH) $(SHELL) ${TESTSCRIPT} )
+ 
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-extended/bash/bash/execute_cmd.patch b/meta/recipes-extended/bash/bash/execute_cmd.patch
new file mode 100644
index 0000000..81f8f0a
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/execute_cmd.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+--- execute_cmd.c.orig	Fri Jun  3 13:34:42 2011
++++ execute_cmd.c	Fri Jun  3 13:36:41 2011
+@@ -2202,7 +2202,11 @@
+   /* If the `lastpipe' option is set with shopt, and job control is not
+      enabled, execute the last element of non-async pipelines in the
+      current shell environment. */
+-  if (lastpipe_opt && job_control == 0 && asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
++  if (lastpipe_opt && 
++#if defined(JOB_CONTROL)
++		job_control == 0 && 
++#endif
++		asynchronous == 0 && pipe_out == NO_PIPE && prev > 0)
+     {
+       lstdin = move_to_high_fd (0, 0, 255);
+       if (lstdin > 0)
diff --git a/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch b/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
new file mode 100644
index 0000000..a9391d6
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/mkbuiltins_have_stringize.patch
@@ -0,0 +1,26 @@
+On hosts with FORTIFY_SOURCES, stringize support is required, as it's used by
+the macros to wrap functions (e.g. read and open in unistd.h). Those wrappers
+use the STRING() macro from unistd.h. A header in the bash sources overrides
+the unistd.h macro to 'x' when HAVE_STRINGIZE is not defined, causing the
+wrappers to generate calls to 'xread' and 'xopen', which do not exist,
+resulting in a failure to link.
+
+Assume we have stringize support when cross-compiling, which works around the
+issue.
+
+It may be best for upstream to either give up on supporting compilers without
+stringize support, or to not define STRING() at all when FORTIFY_SOURCES is
+defined, letting the unistd.h one be used, instead.
+
+Upstream-Status: Pending
+
+--- bash-4.2.orig/builtins/mkbuiltins.c
++++ bash-4.2/builtins/mkbuiltins.c
+@@ -28,6 +28,7 @@
+ #  define HAVE_STDLIB_H
+
+ #  define HAVE_RENAME
++#  define HAVE_STRINGIZE
+ #endif /* CROSS_COMPILING */
+
+ #if defined (HAVE_UNISTD_H)
diff --git a/meta/recipes-extended/bash/bash/run-ptest b/meta/recipes-extended/bash/bash/run-ptest
new file mode 100644
index 0000000..e3f8133
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k THIS_SH=/bin/bash BUILD_DIR=. srcdir=.  runtest
diff --git a/meta/recipes-extended/bash/bash/test-output.patch b/meta/recipes-extended/bash/bash/test-output.patch
new file mode 100644
index 0000000..2b09b7d
--- /dev/null
+++ b/meta/recipes-extended/bash/bash/test-output.patch
@@ -0,0 +1,25 @@
+Add FAIL/PASS output to test output.
+
+Signed-off-by: Björn Stenberg <bjst@enea.com>
+Upstream-Status: Pending
+---
+diff -uNr a/tests/run-all b/tests/run-all
+--- a/tests/run-all	1999-10-08 17:07:46.000000000 +0200
++++ b/tests/run-all	2012-10-27 21:04:18.663331887 +0200
+@@ -22,7 +22,15 @@
+ 	case $x in
+ 	$0|run-minimal|run-gprof)	;;
+ 	*.orig|*~) ;;
+-	*)	echo $x ; sh $x ;;
++    *)  echo $x
++         output=`sh $x`
++         if [ -n "$output" ]; then
++             echo "$output"
++             echo "FAIL: $x"
++         else
++             echo "PASS: $x"
++         fi
++         ;;
+ 	esac
+ done
+ 
diff --git a/meta/recipes-extended/bash/bash_3.2.48.bb b/meta/recipes-extended/bash/bash_3.2.48.bb
new file mode 100644
index 0000000..d42b292
--- /dev/null
+++ b/meta/recipes-extended/bash/bash_3.2.48.bb
@@ -0,0 +1,46 @@
+require bash.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd5d9bcabd8ed5a54a01ce8d183d592a"
+
+PR = "r11"
+
+SRC_URI = "${GNU_MIRROR}/bash/bash-${PV}.tar.gz;name=tarball \
+           ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-049;apply=yes;striplevel=0;name=patch049 \
+           ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-050;apply=yes;striplevel=0;name=patch050 \
+           ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-051;apply=yes;striplevel=0;name=patch051 \
+           ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-052;apply=yes;striplevel=0;name=patch052 \
+           ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-053;apply=yes;striplevel=0;name=patch053 \
+           ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-054;apply=yes;striplevel=0;name=patch054 \
+           ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-055;apply=yes;striplevel=0;name=patch055 \
+           ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-056;apply=yes;striplevel=0;name=patch056 \
+           ${GNU_MIRROR}/bash/bash-3.2-patches/bash32-057;apply=yes;striplevel=0;name=patch057 \
+           file://mkbuiltins_have_stringize.patch \
+           file://build-tests.patch \
+           file://test-output.patch \
+           file://run-ptest \
+           file://dont-include-target-CFLAGS-in-host-LDFLAGS.patch \
+          "
+
+SRC_URI[tarball.md5sum] = "338dcf975a93640bb3eaa843ca42e3f8"
+SRC_URI[tarball.sha256sum] = "128d281bd5682ba5f6953122915da71976357d7a76490d266c9173b1d0426348"
+SRC_URI[patch049.md5sum] = "af571a2d164d5abdcae4499e94e8892c"
+SRC_URI[patch049.sha256sum] = "b1217ed94bdb95dc878fa5cabbf8a164435eb0d9da23a392198f48566ee34a2f"
+SRC_URI[patch050.md5sum] = "8443d4385d73ec835abe401d90591377"
+SRC_URI[patch050.sha256sum] = "081bb03c580ecee63ba03b40beb3caf509eca29515b2e8dd3c078503609a1642"
+SRC_URI[patch051.md5sum] = "15c6653042e9814aa87120098fc7a849"
+SRC_URI[patch051.sha256sum] = "354886097cd95b4def77028f32ee01e2e088d58a98184fede9d3ce9320e218ef"
+SRC_URI[patch052.md5sum] = "691023a944bbb9003cc92ad462d91fa1"
+SRC_URI[patch052.sha256sum] = "a0eccf9ceda50871db10d21efdd74b99e35efbd55c970c400eeade012816bb61"
+SRC_URI[patch053.md5sum] = "eb97d1c9230a55283d9dac69d3de2e46"
+SRC_URI[patch053.sha256sum] = "fe6f0e96e0b966eaed9fb5e930ca12891f4380f30f9e0a773d200ff2063a864e"
+SRC_URI[patch054.md5sum] = "1107744058c43b247f597584b88ba0a6"
+SRC_URI[patch054.sha256sum] = "c6dab911e85688c542ce75afc175dbb4e5011de5102758e19a4a80dac1e79359"
+SRC_URI[patch055.md5sum] = "05d201176d3499e2dfa4a73d09d42f05"
+SRC_URI[patch055.sha256sum] = "c0e816700837942ed548da74e5917f74b70cbbbb10c9f2caf73e8e06a0713d0a"
+SRC_URI[patch056.md5sum] = "222eaa3a2c26f54a15aa5e08817a534a"
+SRC_URI[patch056.sha256sum] = "063a8d8d74e4407bf07a32b965b8ef6d213a66abdb6af26cc3584a437a56bbb4"
+SRC_URI[patch057.md5sum] = "47d98e3e042892495c5efe54ec6e5913"
+SRC_URI[patch057.sha256sum] = "5fc689394d515990f5ea74e2df765fc6e5e42ca44b4591b2c6f9be4b0cadf0f0"
+
+PARALLEL_MAKE = ""
diff --git a/meta/recipes-extended/bash/bash_4.3.30.bb b/meta/recipes-extended/bash/bash_4.3.30.bb
new file mode 100644
index 0000000..811e61c
--- /dev/null
+++ b/meta/recipes-extended/bash/bash_4.3.30.bb
@@ -0,0 +1,46 @@
+require bash.inc
+
+# GPLv2+ (< 4.0), GPLv3+ (>= 4.0)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/bash/${BP}.tar.gz;name=tarball \
+           ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-031;apply=yes;striplevel=0;name=patch031 \
+           ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-032;apply=yes;striplevel=0;name=patch032 \
+           ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-033;apply=yes;striplevel=0;name=patch033 \
+           ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-034;apply=yes;striplevel=0;name=patch034 \
+           ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-035;apply=yes;striplevel=0;name=patch035 \
+           ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-036;apply=yes;striplevel=0;name=patch036 \
+           ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-037;apply=yes;striplevel=0;name=patch037 \
+           ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-038;apply=yes;striplevel=0;name=patch038 \
+           ${GNU_MIRROR}/bash/bash-4.3-patches/bash43-039;apply=yes;striplevel=0;name=patch039 \
+           file://execute_cmd.patch;striplevel=0 \
+           file://mkbuiltins_have_stringize.patch \
+           file://build-tests.patch \
+           file://test-output.patch \
+           file://run-ptest \
+           "
+
+SRC_URI[tarball.md5sum] = "a27b3ee9be83bd3ba448c0ff52b28447"
+SRC_URI[tarball.sha256sum] = "317881019bbf2262fb814b7dd8e40632d13c3608d2f237800a8828fbb8a640dd"
+
+SRC_URI[patch031.md5sum] = "236df1ac1130a033ed0dbe2d2115f28f"
+SRC_URI[patch031.sha256sum] = "cd529f59dd0f2fdd49d619fe34691da6f0affedf87cc37cd460a9f3fe812a61d"
+SRC_URI[patch032.md5sum] = "2360f7e79cfb28526f80021025ea5909"
+SRC_URI[patch032.sha256sum] = "889357d29a6005b2c3308ca5b6286cb223b5e9c083219e5db3156282dd554f4a"
+SRC_URI[patch033.md5sum] = "b551c4ee7b8713759e4143499d0bbd48"
+SRC_URI[patch033.sha256sum] = "fb2a7787a13fbe027a7335aca6eb3c21cdbd813e9edc221274b6a9d8692eaa16"
+SRC_URI[patch034.md5sum] = "c9a56fbe0348e05a886dff97f2872b74"
+SRC_URI[patch034.sha256sum] = "f1694f04f110defe1330a851cc2768e7e57ddd2dfdb0e3e350ca0e3c214ff889"
+SRC_URI[patch035.md5sum] = "e564e8ab44ed1ca3a4e315a9f6cabdc9"
+SRC_URI[patch035.sha256sum] = "370d85e51780036f2386dc18c5efe996eba8e652fc1973f0f4f2ab55a993c1e3"
+SRC_URI[patch036.md5sum] = "b00ff66c41a7c0f06e191200981980b0"
+SRC_URI[patch036.sha256sum] = "ac5f82445b36efdb543dbfae64afed63f586d7574b833e9aa9cd5170bc5fd27c"
+SRC_URI[patch037.md5sum] = "be2a7b05f6ae560313f3c9d5f7127bda"
+SRC_URI[patch037.sha256sum] = "33f170dd7400ab3418d749c55c6391b1d161ef2de7aced1873451b3a3fca5813"
+SRC_URI[patch038.md5sum] = "61e0522830b24fbe8c0d1b010f132470"
+SRC_URI[patch038.sha256sum] = "adbeaa500ca7a82535f0e88d673661963f8a5fcdc7ad63445e68bf5b49786367"
+SRC_URI[patch039.md5sum] = "a4775487abe958536751c8ce53cdf6f9"
+SRC_URI[patch039.sha256sum] = "ab94dced2215541097691f60c3eb323cc28ef2549463e6a5334bbcc1e61e74ec"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-extended/bc/bc_1.06.bb b/meta/recipes-extended/bc/bc_1.06.bb
new file mode 100644
index 0000000..d8c8a86
--- /dev/null
+++ b/meta/recipes-extended/bc/bc_1.06.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Arbitrary precision calculator language"
+HOMEPAGE = "http://www.gnu.org/software/bc/bc.html"
+
+LICENSE = "GPLv2+ & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://COPYING.LIB;md5=d8045f3b8f929c1cb29a1e3fd737b499 \
+                    file://bc/bcdefs.h;endline=31;md5=46dffdaf10a99728dd8ce358e45d46d8 \
+                    file://dc/dc.h;endline=25;md5=2f9c558cdd80e31b4d904e48c2374328 \
+                    file://lib/number.c;endline=31;md5=99434a0898abca7784acfd36b8191199"
+
+SECTION = "base"
+DEPENDS = "flex"
+PR = "r3"
+
+SRC_URI = "${GNU_MIRROR}/bc/bc-${PV}.tar.gz \
+           file://fix-segment-fault.patch "
+
+SRC_URI[md5sum] = "d44b5dddebd8a7a7309aea6c36fda117"
+SRC_URI[sha256sum] = "4ef6d9f17c3c0d92d8798e35666175ecd3d8efac4009d6457b5c99cea72c0e33"
+
+inherit autotools texinfo update-alternatives
+
+ALTERNATIVE_${PN} = "dc"
+ALTERNATIVE_PRIORITY = "100"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/bc/files/fix-segment-fault.patch b/meta/recipes-extended/bc/files/fix-segment-fault.patch
new file mode 100644
index 0000000..20c0da2
--- /dev/null
+++ b/meta/recipes-extended/bc/files/fix-segment-fault.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+when run command such as 'echo "a = 13" | bc -l', it segmentation faults.
+This patch is from http://www.mail-archive.com/blfs-support@linuxfromscratch.org/msg04602.html.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+--- bc-1.06/lib/number.c.orig	2003-09-26 21:14:02.000000000 +0000
++++ bc-1.06/lib/number.c	2003-09-26 21:14:26.000000000 +0000
+@@ -34,6 +34,7 @@
+ #include <number.h>
+ #include <assert.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <ctype.h>/* Prototypes needed for external utility routines. */
+ 
+ #define bc_rt_warn rt_warn
+--- bc-1.06/bc/load.c.orig	2003-09-26 21:14:14.000000000 +0000
++++ bc-1.06/bc/load.c	2003-09-26 21:14:26.000000000 +0000
+@@ -156,7 +156,7 @@
+   long  label_no;
+   long  vaf_name;	/* variable, array or function number. */
+   long  func;
+-  program_counter save_adr;
++  static program_counter save_adr;
+ 
+   /* Initialize. */
+   str = code;
diff --git a/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch b/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch
new file mode 100644
index 0000000..fee368d
--- /dev/null
+++ b/meta/recipes-extended/blktool/blktool/0001-fix-typos-in-manpage.patch
@@ -0,0 +1,40 @@
+From 9cb1667f9d3a9bcfc3b83466cd8d3b79f0554ff0 Mon Sep 17 00:00:00 2001
+From: Azat Khuzhin <a3at.mail@gmail.com>
+Date: Wed, 8 Jul 2015 01:37:09 +0300
+Subject: [PATCH 1/3] fix typos in manpage
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ blktool.8 | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/blktool.8 b/blktool.8
+index a1f5c96..45b7724 100644
+--- a/blktool.8
++++ b/blktool.8
+@@ -191,7 +191,7 @@ Query or set device bus state (0 off, 1 on, 2 tristate)
+ Query the detected (or overridden, via -t) device class.
+ Typically this will result in 'ATA' or 'SCSI' for most devices.
+ Detection is based on device major; thus your SATA device may appear as
+-'SCSI'.
++\&'SCSI'.
+ 
+ .TP
+ .B cd-speed
+@@ -237,7 +237,7 @@ Omitting the on/off argument will print the current state.
+ 
+ .TP
+ .B media
+-Lock in (or unlock) a removeable device.
++Lock in (or unlock) a removable device.
+ 
+ .TP
+ .B multiple-count
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch b/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch
new file mode 100644
index 0000000..d08aba5
--- /dev/null
+++ b/meta/recipes-extended/blktool/blktool/0002-fix-string-error.patch
@@ -0,0 +1,31 @@
+From ddb1071da2c78d8155aab62e9f0d46f69500200f Mon Sep 17 00:00:00 2001
+From: Azat Khuzhin <a3at.mail@gmail.com>
+Date: Wed, 8 Jul 2015 01:42:24 +0300
+Subject: [PATCH 2/3] fix string error
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/util.c b/util.c
+index 1f3a9ca..2ccf56a 100644
+--- a/util.c
++++ b/util.c
+@@ -28,7 +28,7 @@ void pdie(const char *msg, int perr)
+ 	if (perr)
+ 		perror(msg);
+ 	else
+-		fprintf(stderr, msg);
++		fprintf(stderr, "%s", msg);
+ 	if (blkdev >= 0)
+ 		close(blkdev);
+ 	exit(1);
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch b/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch
new file mode 100644
index 0000000..d7ed0b9
--- /dev/null
+++ b/meta/recipes-extended/blktool/blktool/0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch
@@ -0,0 +1,78 @@
+From 68faa63aaad81f4a289e4a03173ab4cf798deb53 Mon Sep 17 00:00:00 2001
+From: Azat Khuzhin <a3at.mail@gmail.com>
+Date: Sat, 1 Nov 2014 22:24:32 +0300
+Subject: [PATCH 3/3] Fix 3-d argument for BLKROSET it must be 'const int *'
+
+Most of *SET ioctls have int type for 3-d argument, except BLKROSET.
+So add bc_arg_type enum, build it into bool_comand and install arg_type
+to bc_arg_int_ptr for BLKROSET only.
+
+Debian-bug-id: 641164
+Link: https://bugs.debian.org/641164
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/b/blktool/blktool_4-7.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
+
+---
+ blktool.c | 11 +++++++++--
+ blktool.h |  7 +++++++
+ 2 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/blktool.c b/blktool.c
+index fbefecd..221a195 100644
+--- a/blktool.c
++++ b/blktool.c
+@@ -85,7 +85,7 @@ static struct bool_command bool_cmd_tbl[] = {
+ 	{ { DEF_BOOL("pio-data"), dc_ata, DEF_HDIO(32BIT) },
+ 	  "16-bit", "32-bit" },
+ 	{ { DEF_BOOL("readonly"), dc_any, IOCNAME(BLKROGET), IOCNAME(BLKROSET) },
+-	  DEF_BOOLSTR },
++	  DEF_BOOLSTR, bc_arg_int_ptr },
+ 	{ { DEF_BOOL("unmask-irq"), dc_ata, DEF_HDIO(UNMASKINTR) },
+ 	  DEF_BOOLSTR },
+ 	{ { "wcache", ct_bool, handle_wcache, dc_any,
+@@ -171,7 +171,14 @@ static void handle_bool(int argc, char **argv, struct command *cmd)
+ 
+ 	} else if ((argc == 4) && (cmd->write_ioctl_name != NULL)) {
+ 		do_32 = parse_bool(argc, argv, bcm);
+-		if (ioctl(blkdev, cmd->write_ioctl, do_32))
++		
++		int ret;
++		if (bcm->arg_type == bc_arg_int_ptr) {
++			ret = ioctl(blkdev, cmd->write_ioctl, &do_32);
++		} else {
++			ret = ioctl(blkdev, cmd->write_ioctl, do_32);
++		}
++		if (ret)
+ 			pdie(cmd->write_ioctl_name, 1);
+ 	}
+ 	else {
+diff --git a/blktool.h b/blktool.h
+index fce4387..85add83 100644
+--- a/blktool.h
++++ b/blktool.h
+@@ -85,11 +85,18 @@ struct command {
+ 	const char		*write_ioctl_name;
+ };
+ 
++enum bc_arg_type {
++	bc_arg_int,
++	bc_arg_int_ptr,
++};
++
+ struct bool_command {
+ 	struct command		cmd;
+ 
+ 	const char		*str_false;
+ 	const char		*str_true;
++
++	enum bc_arg_type arg_type;
+ };
+ 
+ struct class_operations {
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/blktool/blktool_4-7.bb b/meta/recipes-extended/blktool/blktool_4-7.bb
new file mode 100644
index 0000000..679196b
--- /dev/null
+++ b/meta/recipes-extended/blktool/blktool_4-7.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Tune low-level block device parameters"
+DESCRIPTION = "blktool is used for querying and/or changing settings \
+of a block device. It is like hdparm but a more general tool, as it \
+works on SCSI, IDE and SATA devices."
+HOMEPAGE = "http://packages.debian.org/unstable/admin/blktool"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://blktool.c;beginline=7;endline=8;md5=a5e798ea98fd50972088968a15e5f373"
+
+DEPENDS = "glib-2.0"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/b/blktool/blktool_4.orig.tar.gz;name=tarball \
+           file://0001-fix-typos-in-manpage.patch \
+           file://0002-fix-string-error.patch \
+           file://0003-Fix-3-d-argument-for-BLKROSET-it-must-be-const-int.patch \
+          "
+
+SRC_URI[tarball.md5sum] = "62edc09c9908107e69391c87f4f3fd40"
+SRC_URI[tarball.sha256sum] = "b1e6d5912546d2a4b704ec65c2b9664aa3b4663e7d800e06803330335a2cb764"
+
+S = "${WORKDIR}/${BPN}-4.orig"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-extended/byacc/byacc.inc b/meta/recipes-extended/byacc/byacc.inc
new file mode 100644
index 0000000..f9f8d6b
--- /dev/null
+++ b/meta/recipes-extended/byacc/byacc.inc
@@ -0,0 +1,21 @@
+SUMMARY = "Berkeley LALR Yacc parser generator"
+DESCRIPTION = "A parser generator utility that reads a grammar specification from a file and generates an LR(1) \
+parser for it.  The parsers consist of a set of LALR(1) parsing tables and a driver routine written in the C \
+programming language."
+SECTION = "devel"
+LICENSE = "PD"
+
+SRC_URI = "ftp://invisible-island.net/byacc/byacc-${PV}.tgz \
+           file://byacc-open.patch"
+
+EXTRA_OECONF += "--program-transform-name='s,^,b,'"
+
+BBCLASSEXTEND = "native"
+
+inherit autotools
+
+do_configure() {
+	install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}
+	install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}
+	oe_runconf
+}
diff --git a/meta/recipes-extended/byacc/byacc/byacc-open.patch b/meta/recipes-extended/byacc/byacc/byacc-open.patch
new file mode 100644
index 0000000..9160543
--- /dev/null
+++ b/meta/recipes-extended/byacc/byacc/byacc-open.patch
@@ -0,0 +1,13 @@
+diff --git a/main.c b/main.c
+index 620ce3f..82071a4 100644
+--- a/main.c
++++ b/main.c
+@@ -526,7 +526,7 @@ my_mkstemp(char *temp)
+     }
+     if ((name = tempnam(dname, fname)) != 0)
+     {
+-	fd = open(name, O_CREAT | O_EXCL | O_RDWR);
++      fd = open(name, O_CREAT | O_EXCL | O_RDWR, 0666);
+ 	strcpy(temp, name);
+     }
+     else
diff --git a/meta/recipes-extended/byacc/byacc_20150711.bb b/meta/recipes-extended/byacc/byacc_20150711.bb
new file mode 100644
index 0000000..e5b5451
--- /dev/null
+++ b/meta/recipes-extended/byacc/byacc_20150711.bb
@@ -0,0 +1,11 @@
+# Sigh. This is one of those places where everyone licenses it differently. Someone
+# even apply UCB to it (Free/Net/OpenBSD). The maintainer states that:
+# "I've found no reliable source which states that byacc must bear a UCB copyright."
+# Setting to PD as this is what the upstream has it as.
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://package/debian/copyright;md5=c52fb2d1b3f75b3b7534927807a1b714"
+require byacc.inc
+
+SRC_URI[md5sum] = "2700401030583c4e9169ac7ea7d08de8"
+SRC_URI[sha256sum] = "c354e4ee14c4a1bf11e55dde9275011d14887ef066406a088b6fa56caf039248"
diff --git a/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am b/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am
new file mode 100644
index 0000000..1d163b6
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2-1.0.6/Makefile.am
@@ -0,0 +1,71 @@
+
+lib_LTLIBRARIES = libbz2.la
+
+libbz2_la_SOURCES = blocksort.c  \
+                    huffman.c    \
+                    crctable.c   \
+                    randtable.c  \
+                    compress.c   \
+                    decompress.c \
+                    bzlib.c
+
+bin_PROGRAMS = bzip2 bzip2recover
+
+bzip2_SOURCES = bzip2.c
+bzip2_LDADD = libbz2.la
+bzip2_DEPENDENCIES = libbz2.la
+
+include_HEADERS = bzlib.h
+
+bzip2recover_SOURCES = bzip2recover.c
+bzip2recover_LDADD = libbz2.la
+bzip2recover_DEPENDENCIES = libbz2.la
+
+bin_SCRIPTS = bzgrep bzmore bzdiff
+
+man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1
+EXTRA_DIST = $(man_MANS)
+
+runtest:
+	./bzip2 -1  < sample1.ref > sample1.rb2
+	./bzip2 -2  < sample2.ref > sample2.rb2
+	./bzip2 -3  < sample3.ref > sample3.rb2
+	./bzip2 -d  < sample1.bz2 > sample1.tst
+	./bzip2 -d  < sample2.bz2 > sample2.tst
+	./bzip2 -ds < sample3.bz2 > sample3.tst
+	@if cmp sample1.bz2 sample1.rb2; then echo "PASS: sample1 compress";\
+	else echo "FAIL: sample1 compress"; fi
+	@if cmp sample2.bz2 sample2.rb2; then echo "PASS: sample2 compress";\
+	else echo "FAIL: sample2 compress"; fi
+	@if cmp sample3.bz2 sample3.rb2; then echo "PASS: sample3 compress";\
+	else echo "FAIL: sample3 compress"; fi
+	@if cmp sample1.tst sample1.ref; then echo "PASS: sample1 decompress";\
+	else echo "FAIL: sample1 decompress"; fi
+	@if cmp sample2.tst sample2.ref; then echo "PASS: sample2 decompress";\
+	else echo "FAIL: sample2 decompress"; fi
+	@if cmp sample3.tst sample3.ref; then echo "PASS: sample3 decompress";\
+	else echo "FAIL: sample3 decompress"; fi
+
+install-ptest:
+	cp $(srcdir)/Makefile		$(DESTDIR)/
+	cp $(srcdir)/sample1.ref	$(DESTDIR)/
+	cp $(srcdir)/sample2.ref	$(DESTDIR)/
+	cp $(srcdir)/sample3.ref	$(DESTDIR)/
+	cp $(srcdir)/sample1.bz2	$(DESTDIR)/
+	cp $(srcdir)/sample2.bz2	$(DESTDIR)/
+	cp $(srcdir)/sample3.bz2	$(DESTDIR)/
+	ln -s $(bindir)/bzip2		$(DESTDIR)/bzip2
+
+install-exec-hook:
+	ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT)
+	ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT)
+	ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT)
+	ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT)
+	ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT)
+	ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT)
+
+install-data-hook:
+	echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1
+	echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1
+	echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1
+	echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1
diff --git a/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac b/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac
new file mode 100644
index 0000000..47ee576
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2-1.0.6/configure.ac
@@ -0,0 +1,14 @@
+AC_PREREQ([2.57])
+
+AC_INIT(bzip2, 2.0.5, , libXrender)
+AM_INIT_AUTOMAKE(foreign)
+AM_MAINTAINER_MODE
+
+#AM_CONFIG_HEADER(config.h)
+
+# Check for progs
+AC_PROG_CC
+AC_PROG_LIBTOOL
+
+AC_OUTPUT([Makefile])
+
diff --git a/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest b/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest
new file mode 100644
index 0000000..3b20fce
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2-1.0.6/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest
diff --git a/meta/recipes-extended/bzip2/bzip2_1.0.6.bb b/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
new file mode 100644
index 0000000..233fe4c
--- /dev/null
+++ b/meta/recipes-extended/bzip2/bzip2_1.0.6.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Very high-quality data compression program"
+DESCRIPTION = "bzip2 compresses files using the Burrows-Wheeler block-sorting text compression algorithm, and \
+Huffman coding. Compression is generally considerably better than that achieved by more conventional \
+LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors."
+HOMEPAGE = "http://www.bzip.org/"
+SECTION = "console/utils"
+LICENSE = "bzip2"
+LIC_FILES_CHKSUM = "file://LICENSE;beginline=8;endline=37;md5=40d9d1eb05736d1bfc86cfdd9106e6b2"
+PR = "r5"
+
+SRC_URI = "http://www.bzip.org/${PV}/${BP}.tar.gz \
+           file://configure.ac;subdir=${BP} \
+           file://Makefile.am;subdir=${BP} \
+           file://run-ptest"
+
+SRC_URI[md5sum] = "00b516f4704d4a7cb50a1d97e6e8e15b"
+SRC_URI[sha256sum] = "a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd"
+
+PACKAGES =+ "libbz2"
+
+CFLAGS_append = " -fPIC -fpic -Winline -fno-strength-reduce -D_FILE_OFFSET_BITS=64"
+
+inherit autotools update-alternatives ptest
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "bunzip2 bzcat"
+
+#install binaries to bzip2-native under sysroot for replacement-native
+EXTRA_OECONF_append_class-native = " --bindir=${STAGING_BINDIR_NATIVE}/${PN}"
+
+do_install_ptest () {
+	cp -f ${B}/Makefile ${D}${PTEST_PATH}/Makefile
+	sed -i -e "s|^Makefile:|_Makefile:|" ${D}${PTEST_PATH}/Makefile
+}
+
+FILES_libbz2 = "${libdir}/lib*${SOLIBS}"
+
+PROVIDES_append_class-native = " bzip2-replacement-native"
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb b/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb
new file mode 100644
index 0000000..7fd34aa
--- /dev/null
+++ b/meta/recipes-extended/chkconfig/chkconfig-alternatives-native_1.3.59.bb
@@ -0,0 +1,43 @@
+require recipes-extended/chkconfig/chkconfig_1.3.58.bb
+
+SUMMARY = "${SUMMARY_chkconfig-alternatives}"
+DESCRIPTION = "${DESCRIPTION_chkconfig-alternatives}"
+DEPENDS = ""
+PROVIDES += "virtual/update-alternatives-native"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+# The sysroot branch is 1.3.59 + some git commits from master + --sysroot
+# support for alternatives.
+SRC_URI = "git://github.com/kergoth/chkconfig;branch=sysroot"
+S = "${WORKDIR}/git"
+
+SRCREV = "cd437ecbd8986c894442f8fce1e0061e20f04dee"
+PV = "1.3.59+${SRCPV}"
+
+inherit native
+
+# We want our native recipes to build using the target paths rather than paths
+# into the sysroot, as we may use them to construct the rootfs. As such, we
+# only adjust the paths to match the metadata for the target, not native.
+obey_variables () {
+	sed -i 's,ALTERNATIVES_ROOT,OPKG_OFFLINE_ROOT,' alternatives.c
+}
+
+do_compile () {
+	oe_runmake alternatives
+}
+
+do_install () {
+	install -d ${D}${sysconfdir}/alternatives \
+	           ${D}${localstatedir}/lib/alternatives
+
+	install -D -m 0755 alternatives ${D}${bindir}/alternatives
+	install -D -m 0644 alternatives.8 ${D}${mandir}/man8/alternatives.8
+
+	ln -s alternatives ${D}${bindir}/update-alternatives
+	ln -s alternatives.8 ${D}${mandir}/man8/update-alternatives.8
+}
+
+do_install_append_linuxstdbase() {
+	rm -rf ${D}${libdir}/lsb
+}
diff --git a/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb b/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb
new file mode 100644
index 0000000..488847a
--- /dev/null
+++ b/meta/recipes-extended/chkconfig/chkconfig_1.3.58.bb
@@ -0,0 +1,65 @@
+SUMMARY = "A system tool for maintaining the /etc/rc*.d hierarchy"
+DESCRIPTION = "Chkconfig is a basic system utility.  It updates and queries runlevel \
+information for system services.  Chkconfig manipulates the numerous \
+symbolic links in /etc/rc.d, to relieve system administrators of some \
+of the drudgery of manually editing the symbolic links."
+
+RECIPE_NO_UPDATE_REASON = "Version 1.5 requires selinux"
+
+HOMEPAGE = "http://fedorahosted.org/releases/c/h/chkconfig"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5574c6965ae5f583e55880e397fbb018"
+
+DEPENDS = "libnewt popt"
+PROVIDES += "virtual/update-alternatives"
+
+PR = "r7"
+
+SRC_URI = "http://fedorahosted.org/releases/c/h/chkconfig/${BPN}-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "c2039ca67f2749fe0c06ef7c6f8ee246"
+SRC_URI[sha256sum] = "18b497d25b2cada955c72810e45fcad8280d105f17cf45e2970f18271211de68"
+
+inherit gettext
+
+# Makefile uses RPM_OPT_FLAGS to construct CFLAGS
+#
+EXTRA_OEMAKE = "\
+    'RPM_OPT_FLAGS=${CFLAGS}' \
+    'LDFLAGS=${LDFLAGS}' \
+    'BINDIR=${base_sbindir}' \
+    'SBINDIR=${sbindir}' \
+    'MANDIR=${mandir}' \
+    'ALTDIR=${localstatedir}/lib/alternatives' \
+    'ALTDATADIR=${sysconfdir}/alternatives' \
+"
+
+do_unpack[postfuncs] += "obey_variables"
+do_unpack[vardeps] += "obey_variables"
+obey_variables () {
+	sed -i -e 's,/etc,${sysconfdir},; s,/lib/systemd,${base_libdir}/systemd,' ${S}/leveldb.h
+	sed -i -e 's,/etc/alternatives,${sysconfdir}/alternatives,' \
+	       -e 's,/var/lib/alternatives,${localstatedir}/lib/alternatives,' \
+	       -e 's,/usr/share/locale,${datadir}/locale,' ${S}/alternatives.c
+}
+
+do_install() {
+	oe_runmake 'DESTDIR=${D}' 'INSTALLNLSDIR=${D}${datadir}/locale' \
+		'BINDIR=${sbindir}' install
+	install -d ${D}${sysconfdir}/chkconfig.d
+}
+
+PACKAGES =+ "${PN}-alternatives ${PN}-alternatives-doc"
+SUMMARY_${PN}-alternatives = "Maintain symbolic links determining default commands"
+DESCRIPTION_${PN}-alternatives = "alternatives creates, removes, maintains and displays \
+information about the symbolic links comprising the alternatives system."
+SUMMARY_${PN}-alternatives-doc = "${SUMMARY_${PN}-alternatives} - Documentation files"
+DESCRIPTION_${PN}-alternatives-doc = "${DESCRIPTION_${PN}-alternatives}  \
+This package contains documentation."
+RPROVIDES_${PN}-alternatives += "update-alternatives"
+RCONFLICTS_${PN}-alternatives = "update-alternatives-opkg update-alternatives-dpkg"
+FILES_${PN}-alternatives = "${sbindir}/alternatives ${sbindir}/update-alternatives \
+			    ${sysconfdir}/alternatives ${localstatedir}/lib/alternatives"
+FILES_${PN}-alternatives-doc = "${mandir}/man8/alternatives.8 \
+                                ${mandir}/man8/update-alternatives.8"
diff --git a/meta/recipes-extended/cpio/cpio-2.11/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/cpio/cpio-2.11/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..6ae2139
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio-2.11/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: cpio-2.11/gnu/Makefile.am
+===================================================================
+--- cpio-2.11.orig/gnu/Makefile.am
++++ cpio-2.11/gnu/Makefile.am
+@@ -734,7 +734,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
diff --git a/meta/recipes-extended/cpio/cpio-2.11/cpio-CVE-2015-1197.patch b/meta/recipes-extended/cpio/cpio-2.11/cpio-CVE-2015-1197.patch
new file mode 100644
index 0000000..b54afb8
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio-2.11/cpio-CVE-2015-1197.patch
@@ -0,0 +1,154 @@
+Description: CVE-2015-1197
+ Apply patch by Vitezslav Cizek of SuSE to fix CVE-2015-1197.
+ Upstream is dormant or no longer existing. To restore the old
+ behaviour use --extract-over-symlinks (Closes: #774669)
+ This issue has been discovered by Alexander Cherepanov.
+Author: Vitezslav Cizek <vcizek@suse.cz>
+Bug-Debian: https://bugs.debian.org/774669
+
+Upstream-Status: Backport
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+--- cpio-2.11+dfsg.orig/doc/cpio.1
++++ cpio-2.11+dfsg/doc/cpio.1
+@@ -22,6 +22,7 @@ cpio \- copy files to and from archives
+ [\-\-owner=[user][:.][group]] [\-\-no-preserve-owner] [\-\-message=message]
+ [\-\-force\-local] [\-\-no\-absolute\-filenames] [\-\-sparse]
+ [\-\-only\-verify\-crc] [\-\-to\-stdout] [\-\-quiet] [\-\-rsh-command=command]
++[\-\-extract\-over\-symlinks]
+ [\-\-help] [\-\-version] [pattern...] [< archive]
+ 
+ .B cpio
+--- cpio-2.11+dfsg.orig/src/copyin.c
++++ cpio-2.11+dfsg/src/copyin.c
+@@ -700,6 +700,51 @@ copyin_link (struct cpio_file_stat *file
+   free (link_name);
+ }
+ 
++
++static int
++path_contains_symlink(char *path)
++{
++  struct stat st;
++  char *slash;
++  char *nextslash;
++
++  /* we got NULL pointer or empty string */
++  if (!path || !*path) {
++    return false;
++  }
++
++  slash = path;
++
++  while ((nextslash = strchr(slash + 1, '/')) != NULL) {
++    slash = nextslash;
++    *slash = '\0';
++
++    if (lstat(path, &st) != 0) {
++      if (errno == ELOOP) {
++        /* ELOOP - too many symlinks */
++        *slash = '/';
++        return true;
++      } else if (errno == ENOMEM) {
++        /* No memory for lstat - terminate */
++        xalloc_die();
++      } else {
++        /* cannot lstat path - give up */
++        *slash = '/';
++        return false;
++      }
++    }
++
++    if (S_ISLNK(st.st_mode)) {
++      *slash = '/';
++      return true;
++    }
++
++    *slash = '/';
++  }
++
++  return false;
++}
++
+ static void
+ copyin_file (struct cpio_file_stat *file_hdr, int in_file_des)
+ {
+@@ -1471,6 +1516,23 @@ process_copy_in ()
+ 	{
+ 	  /* Copy the input file into the directory structure.  */
+ 
++          /* Can we write files over symlinks? */
++          if (!extract_over_symlinks)
++            {
++              if (path_contains_symlink(file_hdr.c_name))
++                {
++                  /* skip the file */
++                  /*
++                  fprintf(stderr, "Can't write over symlinks. Skipping %s\n", file_hdr.c_name);
++                  tape_toss_input (in_file_des, file_hdr.c_filesize);
++                  tape_skip_padding (in_file_des, file_hdr.c_filesize);
++                  continue;
++                  */
++                  /* terminate */
++	          error (1, 0, _("Can't write over symlinks: %s\n"), file_hdr.c_name);
++                }
++            }
++
+ 	  /* Do we need to rename the file? */
+ 	  if (rename_flag || rename_batch_file)
+ 	    {
+--- cpio-2.11+dfsg.orig/src/extern.h
++++ cpio-2.11+dfsg/src/extern.h
+@@ -95,6 +95,7 @@ extern char input_is_special;
+ extern char output_is_special;
+ extern char input_is_seekable;
+ extern char output_is_seekable;
++extern bool extract_over_symlinks;
+ extern int (*xstat) ();
+ extern void (*copy_function) ();
+ 
+--- cpio-2.11+dfsg.orig/src/global.c
++++ cpio-2.11+dfsg/src/global.c
+@@ -187,6 +187,9 @@ bool to_stdout_option = false;
+ /* The name this program was run with.  */
+ char *program_name;
+ 
++/* Extract files over symbolic links */
++bool extract_over_symlinks;
++
+ /* A pointer to either lstat or stat, depending on whether
+    dereferencing of symlinks is done for input files.  */
+ int (*xstat) ();
+--- cpio-2.11+dfsg.orig/src/main.c
++++ cpio-2.11+dfsg/src/main.c
+@@ -57,7 +57,8 @@ enum cpio_options {
+   FORCE_LOCAL_OPTION,            
+   DEBUG_OPTION,                  
+   BLOCK_SIZE_OPTION,             
+-  TO_STDOUT_OPTION
++  TO_STDOUT_OPTION,
++  EXTRACT_OVER_SYMLINKS
+ };
+ 
+ const char *program_authors[] =
+@@ -222,6 +223,8 @@ static struct argp_option options[] = {
+    N_("Create leading directories where needed"), GRID+1 },
+   {"no-preserve-owner", NO_PRESERVE_OWNER_OPTION, 0, 0,
+    N_("Do not change the ownership of the files"), GRID+1 },
++  {"extract-over-symlinks", EXTRACT_OVER_SYMLINKS, 0, 0,
++   N_("Force writing over symbolic links"), GRID+1 },
+   {"unconditional", 'u', NULL, 0,
+    N_("Replace all files unconditionally"), GRID+1 },
+   {"sparse", SPARSE_OPTION, NULL, 0,
+@@ -412,6 +415,10 @@ crc newc odc bin ustar tar (all-caps als
+       no_chown_flag = true;
+       break;
+ 
++    case EXTRACT_OVER_SYMLINKS:		        /* --extract-over-symlinks */
++      extract_over_symlinks = true;
++      break;
++
+     case 'o':		/* Copy-out mode.  */
+       if (copy_function != 0)
+ 	error (PAXEXIT_FAILURE, 0, _("Mode already defined"));
diff --git a/meta/recipes-extended/cpio/cpio-2.11/fix-memory-overrun.patch b/meta/recipes-extended/cpio/cpio-2.11/fix-memory-overrun.patch
new file mode 100644
index 0000000..89cd3cf
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio-2.11/fix-memory-overrun.patch
@@ -0,0 +1,220 @@
+cpio: Fix memory overrun on reading improperly created link records
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+http://git.savannah.gnu.org/cgit/cpio.git/commit/?id=746f3ff670dcfcdd28fcc990e79cd6fccc7ae48d
+
+  * src/copyin.c (get_link_name): New function.
+  (list_file, copyin_link): use get_link_name
+
+  * tests/symlink-bad-length.at: New file.
+  * tests/symlink-long.at: New file.
+  * tests/Makefile.am: Add new files.
+  * tests/testsuite.at: Likewise.
+
+  See http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
+
+Upstream-Status: Backport
+
+Signed-off-by: Sergey Poznyakoff <gray@gnu.org.ua>
+
+diff -Nurp cpio-2.11.orig/src/copyin.c cpio-2.11/src/copyin.c
+--- cpio-2.11.orig/src/copyin.c	2010-02-15 18:02:23.000000000 +0800
++++ cpio-2.11/src/copyin.c	2014-12-08 13:14:04.355547508 +0800
+@@ -126,6 +126,28 @@ tape_skip_padding (int in_file_des, off_
+ }
+ 
+ 
++static char *
++get_link_name (struct cpio_file_stat *file_hdr, int in_file_des)
++{
++  off_t n = file_hdr->c_filesize + 1;
++  char *link_name;
++
++  if (n == 0 || n > SIZE_MAX)
++    {
++      error (0, 0, _("%s: stored filename length too big"), file_hdr->c_name);
++      link_name = NULL;
++    }
++  else
++    {
++      link_name = xmalloc (n);
++      tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
++      link_name[file_hdr->c_filesize] = '\0';
++      tape_skip_padding (in_file_des, file_hdr->c_filesize);
++    }
++  return link_name;
++}
++
++
+ static void
+ list_file(struct cpio_file_stat* file_hdr, int in_file_des)
+ {
+@@ -136,21 +158,16 @@ list_file(struct cpio_file_stat* file_hd
+ 	{
+ 	  if (archive_format != arf_tar && archive_format != arf_ustar)
+ 	    {
+-	      char *link_name = NULL;	/* Name of hard and symbolic links.  */
+-
+-	      link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1);
+-	      link_name[file_hdr->c_filesize] = '\0';
+-	      tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
+-	      long_format (file_hdr, link_name);
+-	      free (link_name);
+-	      tape_skip_padding (in_file_des, file_hdr->c_filesize);
+-	      return;
++	      char *link_name = get_link_name (file_hdr, in_file_des);
++	      if (link_name)
++		{
++		  long_format (file_hdr, link_name);
++		  free (link_name);
++		}
+ 	    }
+ 	  else
+-	    {
+ 	      long_format (file_hdr, file_hdr->c_tar_linkname);
+-	      return;
+-	    }
++	  return;
+ 	}
+       else
+ #endif
+@@ -650,10 +667,7 @@ copyin_link(struct cpio_file_stat *file_
+ 
+   if (archive_format != arf_tar && archive_format != arf_ustar)
+     {
+-      link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1);
+-      link_name[file_hdr->c_filesize] = '\0';
+-      tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
+-      tape_skip_padding (in_file_des, file_hdr->c_filesize);
++      link_name = get_link_name (file_hdr, in_file_des);
+     }
+   else
+     {
+diff -Nurp cpio-2.11.orig/tests/Makefile.am cpio-2.11/tests/Makefile.am
+--- cpio-2.11.orig/tests/Makefile.am	2010-02-15 18:02:23.000000000 +0800
++++ cpio-2.11/tests/Makefile.am	2014-12-08 13:14:49.931545727 +0800
+@@ -52,6 +52,8 @@ TESTSUITE_AT = \
+  setstat04.at\
+  setstat05.at\
+  symlink.at\
++ symlink-bad-length.at\
++ symlink-long.at\
+  version.at
+ 
+ TESTSUITE = $(srcdir)/testsuite
+diff -Nurp cpio-2.11.orig/tests/symlink-bad-length.at cpio-2.11/tests/symlink-bad-length.at
+--- cpio-2.11.orig/tests/symlink-bad-length.at	1970-01-01 08:00:00.000000000 +0800
++++ cpio-2.11/tests/symlink-bad-length.at	2014-12-08 13:17:45.979538847 +0800
+@@ -0,0 +1,49 @@
++# Process this file with autom4te to create testsuite.  -*- Autotest -*-
++# Copyright (C) 2014 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301 USA.
++
++# Cpio v2.11 did segfault with badly set symlink length.
++# References:
++# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
++
++AT_SETUP([symlink-bad-length])
++AT_KEYWORDS([symlink-long copyout])
++
++AT_DATA([ARCHIVE.base64],
++[x3EjAIBAtIEtJy8nAQAAAHRUYW0FAAAADQBGSUxFAABzb21lIGNvbnRlbnQKAMdxIwBgQ/+hLScv
++JwEAAAB0VEhuBQD/////TElOSwAARklMRcdxAAAAAAAAAAAAAAEAAAAAAAAACwAAAAAAVFJBSUxF
++UiEhIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
++])
++
++AT_CHECK([
++base64 -d ARCHIVE.base64 > ARCHIVE || AT_SKIP_TEST
++cpio -ntv < ARCHIVE
++test $? -eq 2
++],
++[0],
++[-rw-rw-r--   1 10029    10031          13 Nov 25 13:52 FILE
++],[cpio: LINK: stored filename length too big
++cpio: premature end of file
++])
++
++AT_CLEANUP
+diff -Nurp cpio-2.11.orig/tests/symlink-long.at cpio-2.11/tests/symlink-long.at
+--- cpio-2.11.orig/tests/symlink-long.at	1970-01-01 08:00:00.000000000 +0800
++++ cpio-2.11/tests/symlink-long.at	2014-12-08 13:17:57.219538408 +0800
+@@ -0,0 +1,46 @@
++# Process this file with autom4te to create testsuite.  -*- Autotest -*-
++# Copyright (C) 2014 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301 USA.
++
++# Cpio v2.11.90 changed the way symlink name is read from archive.
++# References:
++# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
++
++AT_SETUP([symlink-long])
++AT_KEYWORDS([symlink-long copyout])
++
++AT_CHECK([
++
++# len(dirname) > READBUFSIZE
++dirname=
++for i in {1..52}; do
++    dirname="xxxxxxxxx/$dirname"
++    mkdir "$dirname"
++done
++ln -s "$dirname" x || AT_SKIP_TEST
++
++echo x | cpio -o > ar
++list=`cpio -tv < ar | sed 's|.*-> ||'`
++test "$list" = "$dirname" && echo success || echo fail
++],
++[0],
++[success
++],[2 blocks
++2 blocks
++])
++
++AT_CLEANUP
+diff -Nurp cpio-2.11.orig/tests/testsuite.at cpio-2.11/tests/testsuite.at
+--- cpio-2.11.orig/tests/testsuite.at	2010-02-15 18:02:23.000000000 +0800
++++ cpio-2.11/tests/testsuite.at	2014-12-08 13:15:13.515544805 +0800
+@@ -31,6 +31,8 @@ m4_include([version.at])
+ 
+ m4_include([inout.at])
+ m4_include([symlink.at])
++m4_include([symlink-bad-length.at])
++m4_include([symlink-long.at])
+ m4_include([interdir.at])
+ 
+ m4_include([setstat01.at])
diff --git a/meta/recipes-extended/cpio/cpio-2.11/remove-gets.patch b/meta/recipes-extended/cpio/cpio-2.11/remove-gets.patch
new file mode 100644
index 0000000..b4d113d
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio-2.11/remove-gets.patch
@@ -0,0 +1,20 @@
+ISO C11 removes the specification of gets() from the C language, eglibc 2.16+ removed it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: cpio-2.11/gnu/stdio.in.h
+===================================================================
+--- cpio-2.11.orig/gnu/stdio.in.h	2012-07-04 12:13:43.133066247 -0700
++++ cpio-2.11/gnu/stdio.in.h	2012-07-04 12:14:10.189067564 -0700
+@@ -138,8 +138,10 @@
+ /* It is very rare that the developer ever has full control of stdin,
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
++#if defined gets
+ #undef gets
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
++#endif
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/meta/recipes-extended/cpio/cpio-2.11/statdef.patch b/meta/recipes-extended/cpio/cpio-2.11/statdef.patch
new file mode 100644
index 0000000..a6b8e82
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio-2.11/statdef.patch
@@ -0,0 +1,17 @@
+Avoid multiple stat definitions
+Patch taken from cpio mailing list posting 2010-03-19
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN cpio-2.11.orig/src/filetypes.h cpio-2.11/src/filetypes.h
+--- cpio-2.11.orig/src/filetypes.h	2010-02-12 02:19:23.000000000 -0800
++++ cpio-2.11/src/filetypes.h	2010-07-23 13:17:25.000000000 -0700
+@@ -82,4 +82,6 @@
+ #define lstat stat
+ #endif
+ int lstat ();
++#ifndef stat
+ int stat ();
++#endif
diff --git a/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch b/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch
new file mode 100644
index 0000000..49a7cf5
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio-2.8/avoid_heap_overflow.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624]
+
+This patch avoids heap overflow reported by :
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624
+
+This is a clean patch for the GPLv2 tar recipe.
+
+the GPLv2 tar recipe patch is also applicable to this GPLv2 cpio 
+recipe, as they share code.
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25
+
+Index: tar-1.17/lib/rtapelib.c
+===================================================================
+--- tar-1.17.orig/lib/rtapelib.c
++++ tar-1.17/lib/rtapelib.c
+@@ -570,7 +570,7 @@ rmt_read__ (int handle, char *buffer, si
+ 
+   sprintf (command_buffer, "R%lu\n", (unsigned long) length);
+   if (do_command (handle, command_buffer) == -1
+-      || (status = get_status (handle)) == SAFE_READ_ERROR)
++      || ((status = get_status (handle)) == SAFE_READ_ERROR) || (status > length))
+     return SAFE_READ_ERROR;
+ 
+   for (counter = 0; counter < status; counter += rlen, buffer += rlen)
diff --git a/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch b/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch
new file mode 100644
index 0000000..0148e70
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio-2.8/fix-memory-overrun.patch
@@ -0,0 +1,217 @@
+cpio: Fix memory overrun on reading improperly created link records
+
+Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
+
+http://git.savannah.gnu.org/cgit/cpio.git/commit/?id=746f3ff670dcfcdd28fcc990e79cd6fccc7ae48d
+
+  * src/copyin.c (get_link_name): New function.
+  (list_file, copyin_link): use get_link_name
+
+  * tests/symlink-bad-length.at: New file.
+  * tests/symlink-long.at: New file.
+  * tests/Makefile.am: Add new files.
+  * tests/testsuite.at: Likewise.
+
+  See http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
+
+Upstream-Status: Backport
+
+Signed-off-by: Sergey Poznyakoff <gray@gnu.org.ua>
+
+diff -Nurp cpio-2.8.orig/src/copyin.c cpio-2.8/src/copyin.c
+--- cpio-2.8.orig/src/copyin.c	2007-06-07 19:58:03.000000000 +0800
++++ cpio-2.8/src/copyin.c	2014-12-08 11:30:01.159791484 +0800
+@@ -126,6 +126,28 @@ tape_skip_padding (int in_file_des, int
+ }
+ 
+ 
++static char *
++get_link_name (struct cpio_file_stat *file_hdr, int in_file_des)
++{
++  off_t n = file_hdr->c_filesize + 1;
++  char *link_name;
++
++  if (n == 0 || n > SIZE_MAX)
++    {
++      error (0, 0, _("%s: stored filename length too big"), file_hdr->c_name);
++      link_name = NULL;
++    }
++  else
++    {
++      link_name = xmalloc (n);
++      tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
++      link_name[file_hdr->c_filesize] = '\0';
++      tape_skip_padding (in_file_des, file_hdr->c_filesize);
++    }
++  return link_name;
++}
++
++
+ static void
+ list_file(struct cpio_file_stat* file_hdr, int in_file_des)
+ {
+@@ -136,21 +158,16 @@ list_file(struct cpio_file_stat* file_hd
+ 	{
+ 	  if (archive_format != arf_tar && archive_format != arf_ustar)
+ 	    {
+-	      char *link_name = NULL;	/* Name of hard and symbolic links.  */
+-
+-	      link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1);
+-	      link_name[file_hdr->c_filesize] = '\0';
+-	      tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
+-	      long_format (file_hdr, link_name);
+-	      free (link_name);
+-	      tape_skip_padding (in_file_des, file_hdr->c_filesize);
+-	      return;
++	      char *link_name = get_link_name (file_hdr, in_file_des);
++	      if (link_name)
++		{
++		  long_format (file_hdr, link_name);
++		  free (link_name);
++		}
+ 	    }
+ 	  else
+-	    {
+ 	      long_format (file_hdr, file_hdr->c_tar_linkname);
+-	      return;
+-	    }
++	  return;
+ 	}
+       else
+ #endif
+@@ -732,10 +749,7 @@ copyin_link(struct cpio_file_stat *file_
+ 
+   if (archive_format != arf_tar && archive_format != arf_ustar)
+     {
+-      link_name = (char *) xmalloc ((unsigned int) file_hdr->c_filesize + 1);
+-      link_name[file_hdr->c_filesize] = '\0';
+-      tape_buffered_read (link_name, in_file_des, file_hdr->c_filesize);
+-      tape_skip_padding (in_file_des, file_hdr->c_filesize);
++      link_name = get_link_name (file_hdr, in_file_des);
+     }
+   else
+     {
+diff -Nurp cpio-2.8.orig/tests/Makefile.am cpio-2.8/tests/Makefile.am
+--- cpio-2.8.orig/tests/Makefile.am	2006-10-24 18:32:13.000000000 +0800
++++ cpio-2.8/tests/Makefile.am	2014-12-08 11:30:52.387789482 +0800
+@@ -45,6 +45,8 @@ TESTSUITE_AT = \
+  testsuite.at\
+  inout.at\
+  symlink.at\
++ symlink-bad-length.at\
++ symlink-long.at\
+  version.at
+ 
+ TESTSUITE = $(srcdir)/testsuite
+diff -Nurp cpio-2.8.orig/tests/symlink-bad-length.at cpio-2.8/tests/symlink-bad-length.at
+--- cpio-2.8.orig/tests/symlink-bad-length.at	1970-01-01 08:00:00.000000000 +0800
++++ cpio-2.8/tests/symlink-bad-length.at	2014-12-08 11:33:25.283783507 +0800
+@@ -0,0 +1,49 @@
++# Process this file with autom4te to create testsuite.  -*- Autotest -*-
++# Copyright (C) 2014 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301 USA.
++
++# Cpio v2.11 did segfault with badly set symlink length.
++# References:
++# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
++
++AT_SETUP([symlink-bad-length])
++AT_KEYWORDS([symlink-long copyout])
++
++AT_DATA([ARCHIVE.base64],
++[x3EjAIBAtIEtJy8nAQAAAHRUYW0FAAAADQBGSUxFAABzb21lIGNvbnRlbnQKAMdxIwBgQ/+hLScv
++JwEAAAB0VEhuBQD/////TElOSwAARklMRcdxAAAAAAAAAAAAAAEAAAAAAAAACwAAAAAAVFJBSUxF
++UiEhIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
++AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
++])
++
++AT_CHECK([
++base64 -d ARCHIVE.base64 > ARCHIVE || AT_SKIP_TEST
++cpio -ntv < ARCHIVE
++test $? -eq 2
++],
++[0],
++[-rw-rw-r--   1 10029    10031          13 Nov 25 13:52 FILE
++],[cpio: LINK: stored filename length too big
++cpio: premature end of file
++])
++
++AT_CLEANUP
+diff -Nurp cpio-2.8.orig/tests/symlink-long.at cpio-2.8/tests/symlink-long.at
+--- cpio-2.8.orig/tests/symlink-long.at	1970-01-01 08:00:00.000000000 +0800
++++ cpio-2.8/tests/symlink-long.at	2014-12-08 11:34:28.807781024 +0800
+@@ -0,0 +1,46 @@
++# Process this file with autom4te to create testsuite.  -*- Autotest -*-
++# Copyright (C) 2014 Free Software Foundation, Inc.
++
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 3, or (at your option)
++# any later version.
++
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
++# 02110-1301 USA.
++
++# Cpio v2.11.90 changed the way symlink name is read from archive.
++# References:
++# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
++
++AT_SETUP([symlink-long])
++AT_KEYWORDS([symlink-long copyout])
++
++AT_CHECK([
++
++# len(dirname) > READBUFSIZE
++dirname=
++for i in {1..52}; do
++    dirname="xxxxxxxxx/$dirname"
++    mkdir "$dirname"
++done
++ln -s "$dirname" x || AT_SKIP_TEST
++
++echo x | cpio -o > ar
++list=`cpio -tv < ar | sed 's|.*-> ||'`
++test "$list" = "$dirname" && echo success || echo fail
++],
++[0],
++[success
++],[2 blocks
++2 blocks
++])
++
++AT_CLEANUP
+diff -Nurp cpio-2.8.orig/tests/testsuite.at cpio-2.8/tests/testsuite.at
+--- cpio-2.8.orig/tests/testsuite.at	2006-10-24 18:32:13.000000000 +0800
++++ cpio-2.8/tests/testsuite.at	2014-12-08 11:34:56.515779942 +0800
+@@ -31,3 +31,5 @@ m4_include([version.at])
+ 
+ m4_include([inout.at])
+ m4_include([symlink.at])
++m4_include([symlink-bad-length.at])
++m4_include([symlink-long.at])
diff --git a/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch b/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch
new file mode 100644
index 0000000..e16585d
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio-2.8/m4extensions.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Define AC_USE_SYSTEM_EXTENSIONS only if it was previously undefined.
+# This is needed to configure correctly with newer versions of autoconf.
+
+diff -urN cpio-2.8.orig/m4/extensions.m4 cpio-2.8/m4/extensions.m4
+--- cpio-2.8.orig/m4/extensions.m4	2006-10-12 04:34:45.000000000 -0700
++++ cpio-2.8/m4/extensions.m4	2010-07-23 14:37:36.000000000 -0700
+@@ -1,4 +1,4 @@
+-# serial 4  -*- Autoconf -*-
++# serial 5  -*- Autoconf -*-
+ # Enable extensions on systems that normally disable them.
+ 
+ # Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+@@ -16,6 +16,7 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
++m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [], [
+ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+ [
+   AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+@@ -48,7 +49,7 @@
+     AC_DEFINE([__EXTENSIONS__])
+   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+   AC_DEFINE([_TANDEM_SOURCE])
+-])
++])])
+ 
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
diff --git a/meta/recipes-extended/cpio/cpio-2.8/statdef.patch b/meta/recipes-extended/cpio/cpio-2.8/statdef.patch
new file mode 100644
index 0000000..a00799f
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio-2.8/statdef.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Avoid multiple stat definitions
+# Patch taken from cpio mailing list posting 2010-03-19
+
+diff -urN cpio-2.11.orig/src/filetypes.h cpio-2.11/src/filetypes.h
+--- cpio-2.11.orig/src/filetypes.h	2010-02-12 02:19:23.000000000 -0800
++++ cpio-2.11/src/filetypes.h	2010-07-23 13:17:25.000000000 -0700
+@@ -82,4 +82,6 @@
+ #define lstat stat
+ #endif
+ int lstat ();
++#ifndef stat
+ int stat ();
++#endif
diff --git a/meta/recipes-extended/cpio/cpio_2.11.bb b/meta/recipes-extended/cpio/cpio_2.11.bb
new file mode 100644
index 0000000..c5d92bf
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio_2.11.bb
@@ -0,0 +1,15 @@
+include cpio_v2.inc
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
+
+PR = "r5"
+
+SRC_URI += "file://remove-gets.patch \
+        file://fix-memory-overrun.patch \
+        file://cpio-CVE-2015-1197.patch \
+        file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+        "
+
+SRC_URI[md5sum] = "1112bb6c45863468b5496ba128792f6c"
+SRC_URI[sha256sum] = "601b1d774cd6e4cd39416203c91ec59dbd65dd27d79d75e1a9b89497ea643978"
diff --git a/meta/recipes-extended/cpio/cpio_2.8.bb b/meta/recipes-extended/cpio/cpio_2.8.bb
new file mode 100644
index 0000000..3f97dbe
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio_2.8.bb
@@ -0,0 +1,17 @@
+require cpio_v2.inc
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b7f772ea3a2489231cb4872656cac34b"
+
+PR = "r4"
+
+SRC_URI += "file://m4extensions.patch \
+	    file://avoid_heap_overflow.patch \
+	    file://fix-memory-overrun.patch \
+	   "
+
+SRC_URI[md5sum] = "0caa356e69e149fb49b76bacc64615a1"
+SRC_URI[sha256sum] = "1b203248874c3b5a728b351f06513e5282f73e0170b7f207fbf8c39f28f6b4ad"
+
+# Required to build with gcc 4.3 and later:
+CFLAGS += "-fgnu89-inline"
diff --git a/meta/recipes-extended/cpio/cpio_v2.inc b/meta/recipes-extended/cpio/cpio_v2.inc
new file mode 100644
index 0000000..93de4bb
--- /dev/null
+++ b/meta/recipes-extended/cpio/cpio_v2.inc
@@ -0,0 +1,40 @@
+SUMMARY = "GNU cpio is a program to manage archives of files"
+DESCRIPTION = "GNU cpio is a tool for creating and extracting archives, or copying files from one place to \
+another. It handles a number of cpio formats as well as reading and writing tar files."
+HOMEPAGE = "http://www.gnu.org/software/cpio/"
+SECTION = "base"
+
+DEPENDS = "texinfo-native"
+
+SRC_URI = "${GNU_MIRROR}/cpio/cpio-${PV}.tar.gz \
+    file://statdef.patch \
+    "
+
+inherit autotools gettext texinfo
+
+S = "${WORKDIR}/cpio-${PV}"
+
+EXTRA_OECONF += "DEFAULT_RMT_DIR=${base_sbindir}"
+
+do_install () {
+    autotools_do_install
+    install -d ${D}${base_bindir}/
+    mv "${D}${bindir}/cpio" "${D}${base_bindir}/cpio"
+    rmdir ${D}${bindir}/
+}
+
+PACKAGES =+ "${PN}-rmt"
+
+FILES_${PN}-rmt = "${base_sbindir}/rmt*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "cpio"
+ALTERNATIVE_${PN}-rmt = "rmt"
+
+ALTERNATIVE_LINK_NAME[cpio] = "${base_bindir}/cpio"
+
+ALTERNATIVE_PRIORITY[rmt] = "50"
+ALTERNATIVE_LINK_NAME[rmt] = "${base_sbindir}/rmt"
diff --git a/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch b/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch
new file mode 100644
index 0000000..adbe7df
--- /dev/null
+++ b/meta/recipes-extended/cracklib/cracklib/0001-packlib.c-support-dictionary-byte-order-dependent.patch
@@ -0,0 +1,339 @@
+From 8a6e43726ad0ae41bd1cc2c248d91deb31459357 Mon Sep 17 00:00:00 2001
+From: Lei Maohui <leimaohui@cn.fujitsu.com>
+Date: Tue, 9 Jun 2015 11:11:48 +0900
+Subject: [PATCH] packlib.c: support dictionary byte order dependent
+
+The previous dict files are NOT byte-order independent, in fact they are
+probably ARCHITECTURE SPECIFIC.
+Create the dict files in big endian, and convert to host endian while
+load them. This could fix the endian issue on multiple platform.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+
+We can't use the endian.h, htobe* and be*toh functions because they are
+not available on older versions of glibc, such as that found in RHEL
+5.9.
+
+Change to checking endian and directly calling bswap_* as defined in
+byteswap.h.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Signed-off-by: Lei Maohui <leimaohui@cn.fujitsu.com>
+---
+ lib/packlib.c | 214 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 210 insertions(+), 4 deletions(-)
+
+diff --git a/lib/packlib.c b/lib/packlib.c
+index f851424..3aac805 100644
+--- a/lib/packlib.c
++++ b/lib/packlib.c
+@@ -16,6 +16,12 @@
+ #ifdef HAVE_STDINT_H
+ #include <stdint.h>
+ #endif
++
++#ifndef _BSD_SOURCE
++#define _BSD_SOURCE             /* See feature_test_macros(7) */
++#endif
++#include <endian.h>
++#include <byteswap.h>
+ #include "packer.h"
+ 
+ static const char vers_id[] = "packlib.c : v2.3p2 Alec Muffett 18 May 1993";
+@@ -45,6 +51,185 @@ typedef struct
+     char data_get[NUMWORDS][MAXWORDLEN];
+ } PWDICT64;
+ 
++enum{
++    en_is32,
++    en_is64
++};
++
++static int
++IheaderHostToBigEndian(char *pHeader, int nBitType)
++{
++    if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader;
++
++        pHeader64->pih_magic = bswap_64(pHeader64->pih_magic);
++        pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords);
++        pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen);
++        pHeader64->pih_pad = bswap_16(pHeader64->pih_pad);
++
++#if DEBUG
++        printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n",
++          pHeader64->pih_magic, pHeader64->pih_numwords,
++          pHeader64->pih_blocklen, pHeader64->pih_pad);
++#endif
++    }
++    else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        struct pi_header *pHeader32 = (struct pi_header*)pHeader;
++
++        pHeader32->pih_magic = bswap_32(pHeader32->pih_magic);
++        pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords);
++        pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen);
++        pHeader32->pih_pad = bswap_16(pHeader32->pih_pad);
++
++#if DEBUG
++        printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n",
++          pHeader32->pih_magic, pHeader32->pih_numwords,
++          pHeader32->pih_blocklen, pHeader32->pih_pad);
++#endif
++    }
++    else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++        return (-1);
++    }
++
++    return 0;
++}
++
++static int
++IheaderBigEndianToHost(char *pHeader, int nBitType)
++{
++    if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        struct pi_header64 *pHeader64 = (struct pi_header64*)pHeader;
++
++        pHeader64->pih_magic = bswap_64(pHeader64->pih_magic);
++        pHeader64->pih_numwords = bswap_64(pHeader64->pih_numwords);
++        pHeader64->pih_blocklen = bswap_16(pHeader64->pih_blocklen);
++        pHeader64->pih_pad = bswap_16(pHeader64->pih_pad);
++
++#if DEBUG
++        printf("Header64: magic %x, numwords %x, blocklen %x, pad %x\n",
++          pHeader64->pih_magic, pHeader64->pih_numwords,
++          pHeader64->pih_blocklen, pHeader64->pih_pad);
++#endif
++    }
++    else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        struct pi_header *pHeader32 = (struct pi_header*)pHeader;
++
++        pHeader32->pih_magic = bswap_32(pHeader32->pih_magic);
++        pHeader32->pih_numwords = bswap_32(pHeader32->pih_numwords);
++        pHeader32->pih_blocklen = bswap_16(pHeader32->pih_blocklen);
++        pHeader32->pih_pad = bswap_16(pHeader32->pih_pad);
++
++#if DEBUG
++        printf("Header32: magic %x, numwords %x, blocklen %x, pad %x\n",
++            pHeader32->pih_magic, pHeader32->pih_numwords,
++            pHeader32->pih_blocklen, pHeader32->pih_pad);
++#endif
++    }
++    else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++        return (-1);
++    }
++
++    return 0;
++}
++
++static int
++HwmsHostToBigEndian(char *pHwms, int nLen,int nBitType)
++{
++    int i = 0;
++
++    if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        uint64_t *pHwms64 = (uint64_t*)pHwms;
++
++        for (i = 0; i < nLen / sizeof(uint64_t); i++)
++        {
++            *pHwms64 = bswap_64(*pHwms64);
++            *pHwms64++;
++        }
++
++    }
++    else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        uint32_t *pHwms32 = (uint32_t*)pHwms;
++
++        for (i = 0; i < nLen / sizeof(uint32_t); i++)
++        {
++            *pHwms32 = bswap_32(*pHwms32);
++            *pHwms32++;
++        }
++
++    }
++    else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++        return (-1);
++    }
++
++#if DEBUG
++    for (i = 0; i < nLen; i+=8)
++    {
++        printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n",
++            nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF,
++            pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF,
++            pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF);
++    }
++#endif
++
++    return 0;
++}
++
++static int
++HwmsBigEndianToHost(char *pHwms, int nLen, int nBitType)
++{
++    int i = 0;
++
++    if (nBitType == en_is64 && __BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        uint64_t *pHwms64 = (uint64_t*)pHwms;
++
++        for (i = 0; i < nLen / sizeof(uint64_t); i++)
++        {
++            *pHwms64++ = bswap_64(*pHwms64);
++        }
++
++    }
++    else if (nBitType == en_is32 && __BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        uint32_t *pHwms32 = (uint32_t*)pHwms;
++
++        for (i = 0; i < nLen / sizeof(uint32_t); i++)
++        {
++            *pHwms32 = bswap_32(*pHwms32);
++            *pHwms32++;
++        }
++
++    }
++    else if (__BYTE_ORDER == __LITTLE_ENDIAN)
++    {
++        fprintf(stderr, "Neither 32 or 64: %d\n", nBitType);
++        return (-1);
++    }
++
++#if DEBUG
++    for (i = 0; i < nLen; i+=8)
++    {
++        printf("hwms%s: %02X %02X %02X %02X %02X %02X %02X %02X\n",
++            nBitType==en_is64?"64":"32", pHwms[i+0]&0xFF, pHwms[i+1]&0xFF,
++            pHwms[i+2]&0xFF, pHwms[i+3]&0xFF, pHwms[i+4]&0xFF,
++            pHwms[i+5]&0xFF, pHwms[i+6]&0xFF, pHwms[i+7]&0xFF);
++    }
++#endif
++
++    return 0;
++}
+ 
+ static int
+ _PWIsBroken64(FILE *ifp)
+@@ -57,6 +242,7 @@ _PWIsBroken64(FILE *ifp)
+        return 0;
+     }
+ 
++    IheaderBigEndianToHost((char *) &pdesc64.header, en_is64);
+     return (pdesc64.header.pih_magic == PIH_MAGIC);
+ }
+ 
+@@ -149,7 +335,11 @@ PWOpen(prefix, mode)
+ 	pdesc.header.pih_blocklen = NUMWORDS;
+ 	pdesc.header.pih_numwords = 0;
+ 
+-	fwrite((char *) &pdesc.header, sizeof(pdesc.header), 1, ifp);
++	struct pi_header tmpheader32;
++
++	memcpy(&tmpheader32,  &pdesc.header, sizeof(pdesc.header));
++	IheaderHostToBigEndian((char *) &tmpheader32, en_is32);
++	fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, ifp);
+     } else
+     {
+ 	pdesc.flags &= ~PFOR_WRITE;
+@@ -173,6 +363,7 @@ PWOpen(prefix, mode)
+ 	    return NULL;
+ 	}
+ 
++        IheaderBigEndianToHost((char *) &pdesc.header, en_is32);
+         if ((pdesc.header.pih_magic == 0) || (pdesc.header.pih_numwords == 0))
+         {
+             /* uh-oh. either a broken "64-bit" file or a garbage file. */
+@@ -195,6 +386,7 @@ PWOpen(prefix, mode)
+ 		}
+                 return NULL;
+             }
++            IheaderBigEndianToHost((char *) &pdesc64.header, en_is64);
+             if (pdesc64.header.pih_magic != PIH_MAGIC)
+             {
+                 /* nope, not "64-bit" after all */
+@@ -290,6 +482,7 @@ PWOpen(prefix, mode)
+                 {
+                     pdesc.flags &= ~PFOR_USEHWMS;
+                 }
++                HwmsBigEndianToHost((char*)pdesc64.hwms, sizeof(pdesc64.hwms), en_is64);
+                 for (i = 0; i < sizeof(pdesc.hwms) / sizeof(pdesc.hwms[0]); i++)
+                 {
+                     pdesc.hwms[i] = pdesc64.hwms[i];
+@@ -299,6 +492,7 @@ PWOpen(prefix, mode)
+ 	    {
+ 		pdesc.flags &= ~PFOR_USEHWMS;
+ 	    }
++	    HwmsBigEndianToHost((char*)pdesc.hwms, sizeof(pdesc.hwms), en_is32);
+ #if DEBUG
+             for (i=1; i<=0xff; i++)
+             {
+@@ -332,7 +526,11 @@ PWClose(pwp)
+ 	    return (-1);
+ 	}
+ 
+-	if (!fwrite((char *) &pwp->header, sizeof(pwp->header), 1, pwp->ifp))
++	struct pi_header tmpheader32;
++
++	memcpy(&tmpheader32,  &pwp->header, sizeof(pwp->header));
++	IheaderHostToBigEndian((char *) &tmpheader32, en_is32);
++	if (!fwrite((char *) &tmpheader32, sizeof(tmpheader32), 1, pwp->ifp))
+ 	{
+ 	    fprintf(stderr, "index magic fwrite failed\n");
+ 	    return (-1);
+@@ -351,7 +549,12 @@ PWClose(pwp)
+ 	    	printf("hwm[%02x] = %d\n", i, pwp->hwms[i]);
+ #endif
+ 	    }
+-	    fwrite(pwp->hwms, 1, sizeof(pwp->hwms), pwp->wfp);
++
++	    PWDICT tmp_pwp;
++
++	    memcpy(&tmp_pwp, pwp, sizeof(PWDICT));
++	    HwmsHostToBigEndian(tmp_pwp.hwms, sizeof(tmp_pwp.hwms), en_is32);
++	    fwrite(tmp_pwp.hwms, 1, sizeof(tmp_pwp.hwms), pwp->wfp);
+ 	}
+     }
+ 
+@@ -405,7 +608,8 @@ PutPW(pwp, string)
+ 
+ 	datum = (uint32_t) ftell(pwp->dfp);
+ 
+-	fwrite((char *) &datum, sizeof(datum), 1, pwp->ifp);
++	uint32_t tmpdatum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum;
++	fwrite((char *) &tmpdatum, sizeof(tmpdatum), 1, pwp->ifp);
+ 
+ 	fputs(pwp->data_put[0], pwp->dfp);
+ 	putc(0, pwp->dfp);
+@@ -464,6 +668,7 @@ GetPW(pwp, number)
+            perror("(index fread failed)");
+            return NULL;
+        }
++       datum64 = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_64(datum64) : datum64;
+        datum = datum64;
+     } else {
+        if (fseek(pwp->ifp, sizeof(struct pi_header) + (thisblock * sizeof(uint32_t)), 0))
+@@ -477,6 +682,7 @@ GetPW(pwp, number)
+            perror("(index fread failed)");
+            return NULL;
+        }
++       datum = (__BYTE_ORDER == __LITTLE_ENDIAN) ? bswap_32(datum) : datum;
+     }
+ 
+ 	int r = 1;
+-- 
+1.8.4.2
+
diff --git a/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch b/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch
new file mode 100644
index 0000000..6210e82
--- /dev/null
+++ b/meta/recipes-extended/cracklib/cracklib/0002-craklib-fix-testnum-and-teststr-failed.patch
@@ -0,0 +1,53 @@
+From 06f9a88b5dd5597f9198ea0cb34f5e96f180e6e3 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Sat, 27 Apr 2013 16:02:30 +0800
+Subject: [PATCH] craklib:fix testnum and teststr failed
+
+Error log:
+...
+$ ./testnum
+(null).pwd.gz: No such file or directory
+PWOpen: No such file or directory
+
+$ ./util/teststr
+(null).pwd.gz: No such file or directory
+PWOpen: No such file or directory
+...
+Set DEFAULT_CRACKLIB_DICT as the path of  PWOpen
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+ util/testnum.c |    2 +-
+ util/teststr.c |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/util/testnum.c b/util/testnum.c
+index ae2246d..ca210ff 100644
+--- a/util/testnum.c
++++ b/util/testnum.c
+@@ -20,7 +20,7 @@ main ()
+     PWDICT *pwp;
+     char buffer[STRINGSIZE];
+ 
+-    if (!(pwp = PWOpen (NULL, "r")))
++    if (!(pwp = PWOpen (DEFAULT_CRACKLIB_DICT, "r")))
+     {
+ 	perror ("PWOpen");
+ 	return (-1);
+diff --git a/util/teststr.c b/util/teststr.c
+index 2a31fa4..9fb9cda 100644
+--- a/util/teststr.c
++++ b/util/teststr.c
+@@ -15,7 +15,7 @@ main ()
+     PWDICT *pwp;
+     char buffer[STRINGSIZE];
+ 
+-    if (!(pwp = PWOpen (NULL, "r")))
++    if (!(pwp = PWOpen (DEFAULT_CRACKLIB_DICT, "r")))
+     {
+ 	perror ("PWOpen");
+ 	return (-1);
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-extended/cracklib/cracklib_2.9.5.bb b/meta/recipes-extended/cracklib/cracklib_2.9.5.bb
new file mode 100644
index 0000000..c0ffe33
--- /dev/null
+++ b/meta/recipes-extended/cracklib/cracklib_2.9.5.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Password strength checker library"
+HOMEPAGE = "http://sourceforge.net/projects/cracklib"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
+
+DEPENDS = "cracklib-native zlib python"
+RDEPEND_${PN}-python += "python"
+
+PACKAGES += "${PN}-python"
+
+EXTRA_OECONF = "--with-python --libdir=${base_libdir}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/cracklib/cracklib-${PV}.tar.gz \
+           file://0001-packlib.c-support-dictionary-byte-order-dependent.patch \
+           file://0002-craklib-fix-testnum-and-teststr-failed.patch"
+
+SRC_URI[md5sum] = "376790a95c1fb645e59e6e9803c78582"
+SRC_URI[sha256sum] = "59ab0138bc8cf90cccb8509b6969a024d5e58d2d02bcbdccbb9ba9b88be3fa33"
+
+inherit autotools gettext pythonnative python-dir
+
+do_install_append_class-target() {
+	create-cracklib-dict -o ${D}${datadir}/cracklib/pw_dict ${D}${datadir}/cracklib/cracklib-small
+}
+
+do_install_append() {
+	src_dir="${D}${base_libdir}/${PYTHON_DIR}/site-packages"
+	rm -f $src_dir/*.pyo
+	rm -f $src_dir/test_cracklib.py
+	# Move python files from ${base_libdir} to ${libdir} since used --libdir=${base_libdir}
+	install -d -m 0755 ${D}${PYTHON_SITEPACKAGES_DIR}/
+	mv $src_dir/* ${D}${PYTHON_SITEPACKAGES_DIR}
+	rm -fr ${D}${base_libdir}/${PYTHON_DIR}
+}
+
+BBCLASSEXTEND = "native nativesdk"
+
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}/cracklib.py \
+	${PYTHON_SITEPACKAGES_DIR}/_cracklib.so \
+    "
+FILES_${PN}-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/_cracklib.so"
+FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/_cracklib.a \
+	${PYTHON_SITEPACKAGES_DIR}/_cracklib.la \
+    "
diff --git a/meta/recipes-extended/cronie/cronie/crond.init b/meta/recipes-extended/cronie/cronie/crond.init
new file mode 100755
index 0000000..53b8514
--- /dev/null
+++ b/meta/recipes-extended/cronie/cronie/crond.init
@@ -0,0 +1,58 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: crond crontab
+# Default-Start:  2345
+# Default-Stop:   016
+# Short-Description: run cron daemon
+# Description: cron is a standard UNIX program that runs user-specified
+#              programs at periodic scheduled times. vixie cron adds a
+#              number of features to the basic UNIX cron, including better
+#              security and more powerful configuration options.
+### END INIT INFO
+
+CROND=/usr/sbin/crond
+CONFIG=/etc/sysconfig/crond
+
+[ -f $CONFIG ] || exit 1
+[ -x $CROND ] || exit 1
+
+. $CONFIG
+
+# Source function library.
+. /etc/init.d/functions
+
+case "$1" in
+  start)
+    echo -n "Starting crond: "
+    start-stop-daemon --start --quiet --exec $CROND -- $CRONDARGS
+    RETVAL=$?
+    if [ $RETVAL -eq 0 ] ; then
+        echo "OK"
+    else
+        echo "FAIL"
+    fi
+    ;;
+  stop)
+    echo -n "Stopping crond: "
+    start-stop-daemon --stop --quiet --pidfile /var/run/crond.pid
+    RETVAL=$?
+    if [ $RETVAL -eq 0 ] ; then
+        echo "OK"
+    else
+        echo "FAIL"
+    fi
+    ;;
+  status)
+    status crond
+    exit $?
+    ;;
+  restart)
+    $0 stop && sleep 1 && $0 start
+    ;;
+  *)
+    echo "Usage: /etc/init.d/crond {start|stop|status|restart}"
+    exit 1
+esac
+
+exit 0
+
diff --git a/meta/recipes-extended/cronie/cronie/crond.service b/meta/recipes-extended/cronie/cronie/crond.service
new file mode 100644
index 0000000..d435a6e
--- /dev/null
+++ b/meta/recipes-extended/cronie/cronie/crond.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Periodic Command Scheduler
+
+[Service]
+EnvironmentFile=/etc/sysconfig/crond
+ExecStart=@SBINDIR@/crond -n $CRONDARGS
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-extended/cronie/cronie/crond_pam_config.patch b/meta/recipes-extended/cronie/cronie/crond_pam_config.patch
new file mode 100644
index 0000000..675872c
--- /dev/null
+++ b/meta/recipes-extended/cronie/cronie/crond_pam_config.patch
@@ -0,0 +1,19 @@
+password-auth is the Fedora's common pam configure file, use oe common pam
+configure files instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+--- cronie-1.4.7/pam/crond.orig	2010-12-16 16:59:02.000000000 +0800
++++ cronie-1.4.7/pam/crond	2011-07-20 09:47:16.080819203 +0800
+@@ -4,7 +4,7 @@
+ #
+ # No PAM authentication called, auth modules not needed
+ account    required   pam_access.so
+-account    include    password-auth
++account    include    common-account
+ session    required   pam_loginuid.so
+-session    include    password-auth
+-auth       include    password-auth
++session    include    common-session-noninteractive
++auth       include    common-auth
diff --git a/meta/recipes-extended/cronie/cronie/crontab b/meta/recipes-extended/cronie/cronie/crontab
new file mode 100644
index 0000000..22c4feb
--- /dev/null
+++ b/meta/recipes-extended/cronie/cronie/crontab
@@ -0,0 +1,14 @@
+# /etc/crontab: system-wide crontab
+# Unlike any other crontab you don't have to run the `crontab'
+# command to install the new version when you edit this file
+# and files in /etc/cron.d. These files also have username fields,
+# that none of the other crontabs do.
+
+SHELL=/bin/sh
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+
+#  m  h  dom mon dow user	command
+#  1  *     * * *    root        cd / && run-parts /etc/cron.hourly
+# 30  7     * * *    root        cd / && run-parts /etc/cron.daily
+# 42  7     * * 7    root        cd / && run-parts /etc/cron.weekly
+# 55  7     1 * *    root        cd / && run-parts /etc/cron.monthly
diff --git a/meta/recipes-extended/cronie/cronie_1.5.0.bb b/meta/recipes-extended/cronie/cronie_1.5.0.bb
new file mode 100644
index 0000000..38bd593
--- /dev/null
+++ b/meta/recipes-extended/cronie/cronie_1.5.0.bb
@@ -0,0 +1,81 @@
+SUMMARY = "Cron daemon for executing programs at set times"
+DESCRIPTION = "Cronie contains the standard UNIX daemon crond that runs \
+specified programs at scheduled times and related tools. It is based on the \
+original cron and has security and configuration enhancements like the \
+ability to use pam and SELinux."
+HOMEPAGE = "https://fedorahosted.org/cronie/"
+BUGTRACKER = "mmaslano@redhat.com"
+
+# Internet Systems Consortium License
+LICENSE = "ISC & BSD-3-Clause & BSD-2-Clause & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=dd2a592170760e1386c769e1043b3722 \
+                    file://src/cron.c;endline=20;md5=b425c334265026177128353a142633b4 \
+                    file://src/popen.c;beginline=3;endline=31;md5=edd50742d8def712e9472dba353668a9"
+
+SECTION = "utils"
+
+SRC_URI = "https://fedorahosted.org/releases/c/r/cronie/cronie-${PV}.tar.gz \
+           file://crond.init \
+           file://crontab \
+           file://crond.service \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
+
+PAM_SRC_URI = "file://crond_pam_config.patch"
+PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid"
+
+SRC_URI[md5sum] = "9db75e1884d83a45e002d145c6c54d45"
+SRC_URI[sha256sum] = "9cf0e3f4f5042a9c09413d62c8e0c055e12401f70b112465f0f81f2c84ebfb3f"
+
+inherit autotools update-rc.d useradd systemd
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+
+PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
+PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,${PAM_DEPS}"
+
+INITSCRIPT_NAME = "crond"
+INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ."
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system crontab"
+
+SYSTEMD_SERVICE_${PN} = "crond.service"
+
+do_install_append () {
+	install -d ${D}${sysconfdir}/sysconfig/
+	install -d ${D}${sysconfdir}/init.d/
+	install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond
+	install -m 0755 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond
+
+	# install systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+	       -e 's,@SBINDIR@,${sbindir},g' \
+	       ${D}${systemd_unitdir}/system/crond.service
+
+	# below are necessary for a complete cron environment
+	install -d ${D}${localstatedir}/spool/cron
+	install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/
+	mkdir -p ${D}${sysconfdir}/cron.d
+	mkdir -p ${D}${sysconfdir}/cron.hourly
+	mkdir -p ${D}${sysconfdir}/cron.daily
+	mkdir -p ${D}${sysconfdir}/cron.weekly
+	mkdir -p ${D}${sysconfdir}/cron.monthly
+	touch ${D}${sysconfdir}/cron.deny
+
+	# below setting is necessary to allow normal user using crontab
+
+	# setgid for crontab binary
+	chown root:crontab ${D}${bindir}/crontab
+	chmod 2755 ${D}${bindir}/crontab
+
+	# allow 'crontab' group write to /var/spool/cron
+	chown root:crontab ${D}${localstatedir}/spool/cron
+	chmod 770 ${D}${localstatedir}/spool/cron
+
+	chmod 600 ${D}${sysconfdir}/crontab
+}
+
+FILES_${PN} += "${sysconfdir}/cron*"
+CONFFILES_${PN} += "${sysconfdir}/crontab"
diff --git a/meta/recipes-extended/cups/cups.inc b/meta/recipes-extended/cups/cups.inc
new file mode 100644
index 0000000..57cdf26
--- /dev/null
+++ b/meta/recipes-extended/cups/cups.inc
@@ -0,0 +1,123 @@
+SUMMARY = "An Internet printing system for Unix"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & LGPLv2"
+DEPENDS = "gnutls libpng jpeg dbus dbus-glib zlib libusb"
+
+SRC_URI = "http://www.cups.org/software/${PV}/${BP}-source.tar.bz2 \
+           file://use_echo_only_in_init.patch \
+           file://0001-don-t-try-to-run-generated-binaries.patch \
+           file://cups_serverbin.patch \
+           file://cups.socket \
+           file://cups.path \
+           file://cups.service \
+	  "
+
+LEAD_SONAME = "libcupsdriver.so"
+
+CLEANBROKEN = "1"
+
+inherit autotools-brokensep binconfig useradd systemd
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system lpadmin"
+
+SYSTEMD_SERVICE_${PN} = "cups.socket cups.path cups.service"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl"
+PACKAGECONFIG[pam] = "--enable-pam, --disable-pam, libpam"
+
+EXTRA_OECONF = " \
+               --enable-gnutls \
+               --enable-dbus \
+               --enable-browsing \
+               --disable-gssapi \
+               --enable-debug \
+               --disable-relro \
+               --enable-libusb \
+               --without-php \
+               --without-perl \
+               --without-python \
+               --without-java \
+               "
+
+EXTRA_AUTORECONF += "--exclude=autoheader"
+
+do_compile () {
+	echo "all:"    >  man/Makefile
+	echo "libs:" >> man/Makefile
+	echo "install:" >> man/Makefile
+	echo "install-data:" >> man/Makefile
+	echo "install-exec:" >> man/Makefile
+	echo "install-headers:" >> man/Makefile
+	echo "install-libs:" >> man/Makefile
+
+	oe_runmake
+}
+
+do_install () {
+	oe_runmake "DSTROOT=${D}" install
+
+	# Remove /var/run from package as cupsd will populate it on startup
+	rm -fr ${D}/${localstatedir}/run
+	rmdir ${D}/${libdir}/${BPN}/driver
+
+	# Remove sysinit script and symlinks if sysvinit is not in DISTRO_FEATURES
+	if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','false','true',d)}; then
+	    rm -rf ${D}${sysconfdir}/init.d/
+	    rm -rf ${D}${sysconfdir}/rc*
+	fi
+
+	# Install systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/cups.socket ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/cups.path ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/cups.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/cups.service
+}
+
+python do_package_append() {
+    import subprocess
+    # Change permissions back the way they were, they probably had a reason...
+    workdir = d.getVar('WORKDIR', True)
+    subprocess.call('chmod 0511 %s/install/cups/var/run/cups/certs' % workdir, shell=True)
+}
+
+PACKAGES =+ "${PN}-lib ${PN}-libimage"
+
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'procps', '', d)}"
+FILES_${PN} += "${libdir}/cups/backend \
+		${libdir}/cups/cgi-bin \
+		${libdir}/cups/filter \
+		${libdir}/cups/monitor \
+		${libdir}/cups/notifier \
+		${libdir}/cups/daemon \
+	       "
+
+FILES_${PN}-lib = "${libdir}/libcups.so.*"
+
+FILES_${PN}-libimage = "${libdir}/libcupsimage.so.*"
+
+FILES_${PN}-dbg += "${libdir}/cups/backend/.debug \
+                    ${libdir}/cups/cgi-bin/.debug \
+                    ${libdir}/cups/filter/.debug \
+                    ${libdir}/cups/monitor/.debug \
+                    ${libdir}/cups/notifier/.debug \
+                    ${libdir}/cups/daemon/.debug \
+                   "
+
+#package the html for the webgui inside the main packages (~1MB uncompressed)
+
+FILES_${PN} += "${datadir}/doc/cups/images \
+                ${datadir}/doc/cups/*html \
+                ${datadir}/doc/cups/*.css \
+                ${datadir}/icons/ \
+               "
+CONFFILES_${PN} += "${sysconfdir}/cups/cupsd.conf"
+
+SYSROOT_PREPROCESS_FUNCS += "cups_sysroot_preprocess"
+cups_sysroot_preprocess () {
+	sed -i ${SYSROOT_DESTDIR}${bindir_crossscripts}/cups-config -e 's:cups_datadir=.*:cups_datadir=${datadir}/cups:' -e 's:cups_serverbin=.*:cups_serverbin=${libdir}/cups:'
+}
diff --git a/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch b/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch
new file mode 100644
index 0000000..5379eb6
--- /dev/null
+++ b/meta/recipes-extended/cups/cups/0001-don-t-try-to-run-generated-binaries.patch
@@ -0,0 +1,69 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+From 90069586167b930befce7303aea57078f04b4ed8 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Sun, 30 Jan 2011 16:37:27 +0100
+Subject: [PATCH] don't try to run generated binaries
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+---
+ ppdc/Makefile |   30 +++++++++++++++---------------
+ 1 files changed, 15 insertions(+), 15 deletions(-)
+
+Index: cups-2.0.0/ppdc/Makefile
+===================================================================
+--- cups-2.0.0.orig/ppdc/Makefile
++++ cups-2.0.0/ppdc/Makefile
+@@ -242,8 +242,8 @@ genstrings:		genstrings.o libcupsppdc.a
+ 	$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \
+ 		libcupsppdc.a ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \
+ 		$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
+-	echo Generating localization strings...
+-	./genstrings >sample.c
++#	echo Generating localization strings...
++#	./genstrings >sample.c
+ 
+ 
+ #
+@@ -260,9 +260,9 @@ ppdc-static:		ppdc.o libcupsppdc.a ../cu
+ 	$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdc-static ppdc.o libcupsppdc.a \
+ 		../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ 		$(COMMONLIBS) $(LIBZ)
+-	echo Testing PPD compiler...
+-	./ppdc-static -l en,fr -I ../data foo.drv
+-	./ppdc-static -l en,fr -z -I ../data foo.drv
++#	echo Testing PPD compiler...
++#	./ppdc-static -l en,fr -I ../data foo.drv
++#	./ppdc-static -l en,fr -z -I ../data foo.drv
+ 
+ 
+ #
+@@ -288,17 +288,17 @@ ppdi-static:		ppdc-static ppdi.o libcups
+ 	$(CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdi-static ppdi.o libcupsppdc.a \
+ 		../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ 		$(COMMONLIBS) $(LIBZ)
+-	echo Testing PPD importer...
+-	$(RM) -r ppd ppd2 sample-import.drv
+-	./ppdc-static -l en -I ../data sample.drv
+-	./ppdi-static -I ../data -o sample-import.drv ppd/*
+-	./ppdc-static -l en -I ../data -d ppd2 sample-import.drv
+-	if diff -r ppd ppd2 >/dev/null; then \
+-		echo PPD import OK; \
+-	else \
+-		echo PPD import FAILED; \
+-		exit 1; \
+-	fi
++#	echo Testing PPD importer...
++#	$(RM) -r ppd ppd2 sample-import.drv
++#	./ppdc-static -l en -I ../data sample.drv
++#	./ppdi-static -I ../data -o sample-import.drv ppd/*
++#	./ppdc-static -l en -I ../data -d ppd2 sample-import.drv
++#	if diff -r ppd ppd2 >/dev/null; then \
++#		echo PPD import OK; \
++#	else \
++#		echo PPD import FAILED; \
++#		exit 1; \
++#	fi
+ 
+ 
+ #
diff --git a/meta/recipes-extended/cups/cups/cups.path b/meta/recipes-extended/cups/cups/cups.path
new file mode 100644
index 0000000..de8cc57
--- /dev/null
+++ b/meta/recipes-extended/cups/cups/cups.path
@@ -0,0 +1,8 @@
+[Unit]
+Description=CUPS Printer Service Spool
+
+[Path]
+PathExistsGlob=/var/spool/cups/d*
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-extended/cups/cups/cups.service b/meta/recipes-extended/cups/cups/cups.service
new file mode 100644
index 0000000..7d3e839
--- /dev/null
+++ b/meta/recipes-extended/cups/cups/cups.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=CUPS Printing Service
+
+[Service]
+ExecStart=@SBINDIR@/cupsd -f
+PrivateTmp=true
+
+[Install]
+Also=cups.socket cups.path
+WantedBy=printer.target
diff --git a/meta/recipes-extended/cups/cups/cups.socket b/meta/recipes-extended/cups/cups/cups.socket
new file mode 100644
index 0000000..3314870
--- /dev/null
+++ b/meta/recipes-extended/cups/cups/cups.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=CUPS Printing Service Sockets
+
+[Socket]
+ListenStream=/var/run/cups/cups.sock
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta/recipes-extended/cups/cups/cups_serverbin.patch b/meta/recipes-extended/cups/cups/cups_serverbin.patch
new file mode 100644
index 0000000..f7b44a7
--- /dev/null
+++ b/meta/recipes-extended/cups/cups/cups_serverbin.patch
@@ -0,0 +1,32 @@
+Make CUPS_SERVERBIN relative to libdir otherwise on 64bit arches
+e.g. ppc64 where base libdir is lib64 this does not go well
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Inappropriate [OE config specific]
+
+Index: cups-1.4.6/config-scripts/cups-directories.m4
+===================================================================
+--- cups-1.4.6.orig/config-scripts/cups-directories.m4	2009-04-12 16:04:51.000000000 -0700
++++ cups-1.4.6/config-scripts/cups-directories.m4	2012-07-21 12:12:05.896405923 -0700
+@@ -397,7 +397,7 @@
+ 	*)
+ 		# All others
+ 		INSTALL_SYSV="install-sysv"
+-		CUPS_SERVERBIN="$exec_prefix/lib/cups"
++		CUPS_SERVERBIN="$libdir/cups"
+ 		;;
+ esac
+ 
+Index: cups-1.4.6/configure
+===================================================================
+--- cups-1.4.6.orig/configure	2012-07-21 12:13:34.512405950 -0700
++++ cups-1.4.6/configure	2012-07-21 12:14:05.724406017 -0700
+@@ -11181,7 +11181,7 @@
+ 	*)
+ 		# All others
+ 		INSTALL_SYSV="install-sysv"
+-		CUPS_SERVERBIN="$exec_prefix/lib/cups"
++		CUPS_SERVERBIN="$libdir/cups"
+ 		;;
+ esac
+ 
diff --git a/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch b/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch
new file mode 100644
index 0000000..696f137
--- /dev/null
+++ b/meta/recipes-extended/cups/cups/use_echo_only_in_init.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Index: cups-1.6.1/scheduler/cups.sh.in
+===================================================================
+--- cups-1.6.1.orig/scheduler/cups.sh.in
++++ cups-1.6.1/scheduler/cups.sh.in
+@@ -67,7 +67,7 @@ case "`uname`" in
+ 		ECHO_ERROR=:
+ 		;;
+ 
+-	Linux*)
++	DisableLinux*)
+ 		IS_ON=/bin/true
+ 		if test -f /etc/init.d/functions; then
+ 			. /etc/init.d/functions
diff --git a/meta/recipes-extended/cups/cups_2.0.4.bb b/meta/recipes-extended/cups/cups_2.0.4.bb
new file mode 100644
index 0000000..bad73b3
--- /dev/null
+++ b/meta/recipes-extended/cups/cups_2.0.4.bb
@@ -0,0 +1,6 @@
+require cups.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=6c5a350596fba02754bd96eb6df3afd0"
+
+SRC_URI[md5sum] = "f5c847d9a4fac6c4c66fb0526a7afaae"
+SRC_URI[sha256sum] = "e1d5e68d9f24faca317aeaebc164c34102813bc0f1d69c00b3a59b49c49f4abd"
diff --git a/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb b/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb
new file mode 100644
index 0000000..43ea3ce
--- /dev/null
+++ b/meta/recipes-extended/cwautomacros/cwautomacros_20110201.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Collection of autoconf m4 macros"
+SECTION = "base"
+HOMEPAGE = "http://sourceforge.net/projects/cwautomacros.berlios/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=eb723b61539feef013de476e68b5c50a"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}.berlios/${BP}.tar.bz2"
+SRC_URI[md5sum] = "074afcb50d0a8bff10786a2954b2b02d"
+SRC_URI[sha256sum] = "3115603b891f3a163c0bbb5fea2f3742113a183fa6745ee5e89e5f6d0e9f6121"
+
+do_configure() {
+	:
+}
+
+do_install() {
+	oe_runmake CWAUTOMACROSPREFIX=${D}${prefix} install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch b/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..cc05d1d
--- /dev/null
+++ b/meta/recipes-extended/diffutils/diffutils-2.8.1/diffutils_fix_for_automake-1.12.patch
@@ -0,0 +1,27 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.ac:90: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| /srv/home/nitin/builds/build-gcc47/tmp/work/i586-poky-linux/diffutils-2.8.1-r4/diffutils-2.8.1/m4/prereq.m4:110: jm_PREREQ_QUOTEARG is expanded from...
+| configure.ac:90: the top level
+| autom4te: m4 failed with exit status: 1
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: diffutils-2.8.1/m4/prereq.m4
+===================================================================
+--- diffutils-2.8.1.orig/m4/prereq.m4
++++ diffutils-2.8.1/m4/prereq.m4
+@@ -115,7 +115,6 @@ AC_DEFUN([jm_PREREQ_QUOTEARG],
+   AC_HEADER_STDC
+   AC_C_BACKSLASH_A
+   AC_MBSTATE_T
+-  AM_C_PROTOTYPES
+ ])
+ 
+ AC_DEFUN([jm_PREREQ_REGEX],
diff --git a/meta/recipes-extended/diffutils/diffutils-3.3/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/diffutils/diffutils-3.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..ba1a4ba
--- /dev/null
+++ b/meta/recipes-extended/diffutils/diffutils-3.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest b/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest
new file mode 100644
index 0000000..695c5e8
--- /dev/null
+++ b/meta/recipes-extended/diffutils/diffutils-3.3/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C tests check-TESTS
diff --git a/meta/recipes-extended/diffutils/diffutils.inc b/meta/recipes-extended/diffutils/diffutils.inc
new file mode 100644
index 0000000..243341a
--- /dev/null
+++ b/meta/recipes-extended/diffutils/diffutils.inc
@@ -0,0 +1,18 @@
+SUMMARY = "Diffutils contains tools used for finding differences between files"
+DESCRIPTION = "Diffutils contains the GNU diff, diff3, \
+sdiff, and cmp utilities. These programs are usually \
+used for creating patch files."
+SECTION = "base"
+
+inherit autotools texinfo update-alternatives gettext
+
+# diffutils assumes non-glibc compilation with uclibc and
+# this causes it to generate its own implementations of
+# standard functionality.  regex.c actually breaks compilation
+# because it uses __mempcpy, there are other things (TBD:
+# see diffutils.mk in buildroot)
+EXTRA_OECONF_libc-uclibc = "--without-included-regex"
+
+ALTERNATIVE_${PN} = "diff cmp"
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/meta/recipes-extended/diffutils/diffutils_2.8.1.bb b/meta/recipes-extended/diffutils/diffutils_2.8.1.bb
new file mode 100644
index 0000000..bf425bb
--- /dev/null
+++ b/meta/recipes-extended/diffutils/diffutils_2.8.1.bb
@@ -0,0 +1,16 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+require diffutils.inc
+
+PR = "r7.0"
+
+SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.gz \
+           file://diffutils_fix_for_automake-1.12.patch"
+
+SRC_URI[md5sum] = "71f9c5ae19b60608f6c7f162da86a428"
+SRC_URI[sha256sum] = "c5001748b069224dd98bf1bb9ee877321c7de8b332c8aad5af3e2a7372d23f5a"
+
+do_configure_prepend () {
+	chmod u+w ${S}/po/Makefile.in.in
+}
diff --git a/meta/recipes-extended/diffutils/diffutils_3.3.bb b/meta/recipes-extended/diffutils/diffutils_3.3.bb
new file mode 100644
index 0000000..5008690
--- /dev/null
+++ b/meta/recipes-extended/diffutils/diffutils_3.3.bb
@@ -0,0 +1,37 @@
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+require diffutils.inc
+
+SRC_URI = "${GNU_MIRROR}/diffutils/diffutils-${PV}.tar.xz \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           file://run-ptest \
+"
+
+EXTRA_OECONF += "--without-libsigsegv-prefix"
+
+do_configure_prepend () {
+	# Need to remove gettext macros with weird mix of versions
+	for i in codeset.m4 gettext_gl.m4 intlmacosx.m4 inttypes-pri.m4 lib-ld_gl.m4 lib-prefix_gl.m4 po_gl.m4 ssize_t.m4 wchar_t.m4 wint_t.m4; do
+		rm -f ${S}/m4/$i
+	done
+}
+
+SRC_URI[md5sum] = "99180208ec2a82ce71f55b0d7389f1b3"
+SRC_URI[sha256sum] = "a25e89a8ab65fded1731e4186be1bb25cda967834b6df973599cdcd5abdfc19c"
+
+inherit ptest
+
+do_install_ptest() {
+	t=${D}${PTEST_PATH}
+	install -D ${S}/build-aux/test-driver $t/build-aux/test-driver
+	cp -r ${S}/tests $t/
+	install ${B}/tests/Makefile $t/tests/
+	sed -e 's|^Makefile:|_Makefile:|' \
+	    -e 's|bash|sh|' \
+	    -e 's|^top_srcdir = \(.*\)|top_srcdir = ..\/|' \
+	    -e 's|^srcdir = \(.*\)|srcdir = .|' \
+	    -e 's|"`$(built_programs)`"|diff|' \
+	    -e 's|gawk|awk|g' \
+	    -i $t/tests/Makefile
+}
diff --git a/meta/recipes-extended/ed/ed_0.5.bb b/meta/recipes-extended/ed/ed_0.5.bb
new file mode 100644
index 0000000..143e636
--- /dev/null
+++ b/meta/recipes-extended/ed/ed_0.5.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Line-oriented text editor"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6ddd5335ef96fb858a138230af773710 \
+                    file://main.c;beginline=1;endline=17;md5=36d4b85e5ae9028e918d1cc775c2475e"
+
+PR = "r2"
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/ed/ed-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "4ee21e9dcc9b5b6012c23038734e1632"
+SRC_URI[sha256sum] = "edef2bbde0fbf0d88232782a0eded323f483a0519d6fde9a3b1809056fd35f3e"
+
+inherit autotools texinfo
+
+EXTRA_OECONF = "'CC=${CC}' 'CXX=${CXX}' 'CFLAGS=${CFLAGS}' 'CXXFLAGS=${CXXFLAGS}' 'CPPFLAGS=${CPPFLAGS}' 'LDFLAGS=${LDFLAGS}'"
+
+CONFIGUREOPTS := "${@d.getVar('CONFIGUREOPTS', True).replace('--disable-dependency-tracking', ' ')}"
+CONFIGUREOPTS := "${@d.getVar('CONFIGUREOPTS', True).replace('--disable-silent-rules', ' ')}"
+
+
diff --git a/meta/recipes-extended/ed/ed_1.9.bb b/meta/recipes-extended/ed/ed_1.9.bb
new file mode 100644
index 0000000..8e94eed
--- /dev/null
+++ b/meta/recipes-extended/ed/ed_1.9.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Line-oriented text editor"
+HOMEPAGE = "http://www.gnu.org/software/ed/"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
+                    file://ed.h;endline=20;md5=375a20cc2545ac1115eeb7b323c60ae3 \
+                    file://main.c;endline=17;md5=14dbb325c1f2d4daf50e0aa5c5038e96"
+
+SECTION = "base"
+
+# LSB states that ed should be in /bin/
+bindir = "${base_bindir}"
+
+SRC_URI = "${GNU_MIRROR}/ed/ed-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "565b6d1d5a9a8816b9b304fc4ed9405d"
+SRC_URI[sha256sum] = "d5b372cfadf073001823772272fceac2cfa87552c5cd5a8efc1c8aae61f45a88"
+
+inherit texinfo
+
+do_configure() {
+	${S}/configure
+}
+
+do_install() {
+	oe_runmake 'DESTDIR=${D}' install
+	# Info dir listing isn't interesting at this point so remove it if it exists.
+	if [ -e "${D}${infodir}/dir" ]; then
+		rm -f ${D}${infodir}/dir
+	fi
+}
diff --git a/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch b/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch
new file mode 100644
index 0000000..bf66267
--- /dev/null
+++ b/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch
@@ -0,0 +1,19 @@
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Inappropriate
+(default automake behavior incompatible with ptest)
+
+diff -ruN a/configure.ac b/configure.ac
+--- a/configure.ac	2014-05-28 18:19:13.513980977 +0200
++++ b/configure.ac	2014-05-28 18:19:21.129660215 +0200
+@@ -2,7 +2,7 @@
+ AC_INIT(ethtool, 3.14, netdev@vger.kernel.org)
+ AC_PREREQ(2.52)
+ AC_CONFIG_SRCDIR([ethtool.c])
+-AM_INIT_AUTOMAKE([gnu])
++AM_INIT_AUTOMAKE([gnu serial-tests])
+ AC_CONFIG_HEADERS([ethtool-config.h])
+ 
+ AM_MAINTAINER_MODE
diff --git a/meta/recipes-extended/ethtool/ethtool/run-ptest b/meta/recipes-extended/ethtool/ethtool/run-ptest
new file mode 100644
index 0000000..1e245da
--- /dev/null
+++ b/meta/recipes-extended/ethtool/ethtool/run-ptest
@@ -0,0 +1,2 @@
+#!/bin/sh
+make -k runtest-TESTS
diff --git a/meta/recipes-extended/ethtool/ethtool_4.0.bb b/meta/recipes-extended/ethtool/ethtool_4.0.bb
new file mode 100644
index 0000000..13f2b1c
--- /dev/null
+++ b/meta/recipes-extended/ethtool/ethtool_4.0.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Display or change ethernet card settings"
+DESCRIPTION = "A small utility for examining and tuning the settings of your ethernet-based network interfaces."
+HOMEPAGE = "http://www.kernel.org/pub/software/network/ethtool/"
+SECTION = "console/network"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://ethtool.c;beginline=4;endline=17;md5=c19b30548c582577fc6b443626fc1216"
+
+SRC_URI = "${KERNELORG_MIRROR}/software/network/ethtool/ethtool-${PV}.tar.gz \
+           file://run-ptest \
+           file://avoid_parallel_tests.patch \
+           "
+
+SRC_URI[md5sum] = "0a1c78787c7dcf077016ed86372a472f"
+SRC_URI[sha256sum] = "e200516727cc9583e8b63fd6e72f667f9ed41bb4f0577ff4803b60c64cfd1dbc"
+
+inherit autotools ptest
+RDEPENDS_${PN}-ptest += "make"
+
+do_compile_ptest() {
+   oe_runmake buildtest-TESTS
+}
+
+do_install_ptest () {
+   cp ${B}/Makefile                 ${D}${PTEST_PATH}
+   install ${B}/test-cmdline        ${D}${PTEST_PATH}
+   install ${B}/test-features       ${D}${PTEST_PATH}
+   install ${B}/ethtool             ${D}${PTEST_PATH}/ethtool
+   sed -i 's/^Makefile/_Makefile/'  ${D}${PTEST_PATH}/Makefile
+}
diff --git a/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch b/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch
new file mode 100644
index 0000000..2076e44
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.2.31/findutils-fix-doc-build-error.patch
@@ -0,0 +1,53 @@
+From 33cba24cba7b0973a702e9627bd5b93962948ae4 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Tue, 17 Sep 2013 16:11:16 +0800
+Subject: [PATCH] findutils: fix doc build error
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ doc/find.texi |    6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/doc/find.texi b/doc/find.texi
+index 5b5f0cf..b3d9c6b 100644
+--- a/doc/find.texi
++++ b/doc/find.texi
+@@ -63,7 +63,7 @@ translation approved by the Foundation.
+
+ @page
+ @vskip 0pt plus 1filll
+-@insertcopying{}
++@insertcopying
+ @end titlepage
+
+ @contents
+@@ -1466,6 +1466,7 @@ no output is ever sent to it.
+ * Escapes::
+ * Format Directives::
+ * Time Formats::
++* Formatting Flags::
+ @end menu
+
+ @node Escapes
+@@ -1534,7 +1535,6 @@ from the novel you are reading.
+ * Size Directives::
+ * Location Directives::
+ * Time Directives::
+-* Formatting Flags::
+ @end menu
+
+ @node Name Directives
+@@ -1780,7 +1780,7 @@ setting the TZ environment variable).  This is a GNU extension.
+ @end table
+
+ @node Formatting Flags
+-@subsubsection Formatting Flags
++@subsection Formatting Flags
+
+ The @samp{%m} and @samp{%d} directives support the @samp{#}, @samp{0}
+ and @samp{+} flags, but the other directives do not, even if they
+--
+1.7.4.1
+
diff --git a/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch b/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..2d0ddb4
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.2.31/findutils_fix_for_automake-1.12.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:75: error: automatic de-ANSI-fication support has been removed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: findutils-4.2.31/configure.in
+===================================================================
+--- findutils-4.2.31.orig/configure.in
++++ findutils-4.2.31/configure.in
+@@ -72,7 +72,6 @@ dnl gl_EARLY calls AC_GNU_SOURCE anyway.
+ 
+ 
+ AC_ISC_POSIX
+-AM_C_PROTOTYPES
+ 
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
diff --git a/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch b/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
new file mode 100644
index 0000000..65bd642
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils-4.2.31/gnulib-extension.patch
@@ -0,0 +1,56 @@
+Upstream-Status: Inappropriate [legacy version]
+
+the old AC_USE_SYSTEM_EXTENSIONS won't work with AC_GNU_SOURCE
+
+against 4.2.31
+07/08/2010 - qhe
+
+diff --git a/gnulib/m4/extensions.m4 b/gnulib/m4/extensions.m4
+index 143a9e5..0f27ceb 100644
+--- a/gnulib/m4/extensions.m4
++++ b/gnulib/m4/extensions.m4
+@@ -12,44 +12,6 @@
+ # enough in this area it's likely we'll need to redefine
+ # AC_USE_SYSTEM_EXTENSIONS for quite some time.
+ 
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+-  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+-  AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+-  AC_REQUIRE([AC_GNU_SOURCE])
+-  AC_REQUIRE([AC_AIX])
+-  AC_REQUIRE([AC_MINIX])
+-
+-  AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris.  */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+-  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+-    [ac_cv_safe_to_define___extensions__],
+-    [AC_COMPILE_IFELSE(
+-       [AC_LANG_PROGRAM([
+-#	  define __EXTENSIONS__ 1
+-	  AC_INCLUDES_DEFAULT])],
+-       [ac_cv_safe_to_define___extensions__=yes],
+-       [ac_cv_safe_to_define___extensions__=no])])
+-  test $ac_cv_safe_to_define___extensions__ = yes &&
+-    AC_DEFINE([__EXTENSIONS__])
+-  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+-  AC_DEFINE([_TANDEM_SOURCE])
+-])
+-
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
diff --git a/meta/recipes-extended/findutils/findutils.inc b/meta/recipes-extended/findutils/findutils.inc
new file mode 100644
index 0000000..37c84cc
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils.inc
@@ -0,0 +1,24 @@
+SUMMARY = "find, locate, and xargs binaries"
+DESCRIPTION = "The GNU Find Utilities are the basic directory searching utilities of the GNU operating system. \
+These programs are typically used in conjunction with other programs to provide modular and powerful directory \
+search and file locating capabilities to other commands."
+HOMEPAGE = "http://www.gnu.org/software/findutils/"
+BUGTRACKER = "http://savannah.gnu.org/bugs/?group=findutils"
+SECTION = "console/utils"
+
+
+SRC_URI = "ftp://alpha.gnu.org/gnu/${BPN}/${BP}.tar.gz"
+
+inherit autotools gettext texinfo update-alternatives
+
+ALTERNATIVE_${PN} = "find xargs"
+ALTERNATIVE_PRIORITY = "100"
+
+# diffutils assumes non-glibc compilation with uclibc and
+# this causes it to generate its own implementations of
+# standard functionality.  regex.c actually breaks compilation
+# because it uses __mempcpy, there are other things (TBD:
+# see diffutils.mk in buildroot)
+EXTRA_OECONF_libc-uclibc = "--without-included-regex"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..8729e1b
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: findutils-4.5.14/gl/lib/Makefile.am
+===================================================================
+--- findutils-4.5.14.orig/gl/lib/Makefile.am
++++ findutils-4.5.14/gl/lib/Makefile.am
+@@ -1220,7 +1220,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
diff --git a/meta/recipes-extended/findutils/findutils_4.2.31.bb b/meta/recipes-extended/findutils/findutils_4.2.31.bb
new file mode 100644
index 0000000..7dee018
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils_4.2.31.bb
@@ -0,0 +1,14 @@
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+PR = "r4"
+
+require findutils.inc
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BP}.tar.gz \
+           file://gnulib-extension.patch \
+           file://findutils_fix_for_automake-1.12.patch \
+           file://findutils-fix-doc-build-error.patch \
+           "
+
+SRC_URI[md5sum] = "a0e31a0f18a49709bf5a449867c8049a"
+SRC_URI[sha256sum] = "e0d34b8faca0b3cca0703f6c6b498afbe72f0ba16c35980c10ec9ef7724d6204"
diff --git a/meta/recipes-extended/findutils/findutils_4.5.14.bb b/meta/recipes-extended/findutils/findutils_4.5.14.bb
new file mode 100644
index 0000000..a58a82f
--- /dev/null
+++ b/meta/recipes-extended/findutils/findutils_4.5.14.bb
@@ -0,0 +1,17 @@
+require findutils.inc
+
+# GPLv2+ (<< 4.2.32), GPLv3+ (>= 4.2.32)
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
+ 
+DEPENDS = "bison-native"
+
+SRC_URI += "file://0001-Unset-need_charset_alias-when-building-for-musl.patch"
+
+SRC_URI[md5sum] = "a8a8176282fd28e8d1234c84d847fa66"
+SRC_URI[sha256sum] = "0de3cf625a5c9f154eee3171e072515ffdde405244dd00502af617ac57b73ae2"
+
+# http://savannah.gnu.org/bugs/?27299
+CACHED_CONFIGUREVARS += "${@bb.utils.contains('DISTRO_FEATURES', 'libc-posix-clang-wchar', 'gl_cv_func_wcwidth_works=yes', '', d)}"
+
+EXTRA_OECONF += "ac_cv_path_SORT=${bindir}/sort"
diff --git a/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb b/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb
new file mode 100644
index 0000000..790c981
--- /dev/null
+++ b/meta/recipes-extended/foomatic/foomatic-filters_4.0.17.bb
@@ -0,0 +1,37 @@
+SUMMARY = "OpenPrinting printer support - filters"
+DESCRIPTION = "Foomatic is a printer database designed to make it easier to set up \
+common printers for use with UNIX-like operating systems.\
+It provides the "glue" between a print spooler (like CUPS or lpr) and \
+the printer, by processing files sent to the printer. \
+ \
+This package consists of filters used by the printer spoolers \
+to convert the incoming PostScript data into the printer's native \
+format using a printer-specific, but spooler-independent PPD file. \
+"
+
+DEPENDS += "cups perl libxml2"
+PR = "r1"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/foomatic-filters-${PV}/COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+SRC_URI = "http://www.openprinting.org/download/foomatic/foomatic-filters-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "b05f5dcbfe359f198eef3df5b283d896"
+SRC_URI[sha256sum] = "a2e2e53e502571e88eeb9010c45a0d54671f15707ee104f5c9c22b59ea7a33e3"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--disable-file-converter-check --with-file-converter=texttops"
+
+do_configure_prepend() {
+    export PERL="${bindir}/env perl"
+    export CUPS_SERVERBIN=${exec_prefix}/lib/cups       # /usr/lib NOT libdir
+}
+
+do_install_append_linuxstdbase() {
+    install -d ${D}${exec_prefix}/lib/cups/filter
+    ln -sf ${bindir}/foomatic-rip ${D}${exec_prefix}/lib/cups/filter
+}
+
+FILES_${PN} += "${exec_prefix}/lib/cups/ ${exec_prefix}/lib/ppr/"
diff --git a/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch b/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..b3e7987
--- /dev/null
+++ b/meta/recipes-extended/gawk/gawk-3.1.5/gawk-3.1.5_fix_for_automake-1.12.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.ac:127: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| configure.ac:127: the top level
+| autom4te: m4 failed with exit status: 1
+...
+| Makefile.am:27: error: automatic de-ANSI-fication support has been removed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: gawk-3.1.5/configure.ac
+===================================================================
+--- gawk-3.1.5.orig/configure.ac
++++ gawk-3.1.5/configure.ac
+@@ -124,7 +124,6 @@ fi
+ 
+ dnl check for C compiler for automake
+ AM_PROG_CC_STDC
+-AM_C_PROTOTYPES
+ 
+ dnl Cygwin doesn't like to get libs with full paths
+ dnl since that overrides linking against DLLs.
+Index: gawk-3.1.5/Makefile.am
+===================================================================
+--- gawk-3.1.5.orig/Makefile.am
++++ gawk-3.1.5/Makefile.am
+@@ -24,7 +24,7 @@
+ ## process this file with automake to produce Makefile.in
+ 
+ # Automatic de-ANSI-fication if needed, make .bz2 files also.
+-AUTOMAKE_OPTIONS = ansi2knr dist-bzip2
++AUTOMAKE_OPTIONS = dist-bzip2
+ 
+ # This undocumented variable insures that aclocal runs
+ # correctly after changing configure.ac
diff --git a/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest b/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest
new file mode 100644
index 0000000..d23f0bf
--- /dev/null
+++ b/meta/recipes-extended/gawk/gawk-4.1.3/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+cd test
+for i in `grep -vE "@|^$|#|Gt-dummy" Maketests |awk -F: '{print $1}'`; \
+  do LC_ALL=${GAWKLOCALE:-C} LANG=${GAWKLOCALE:-C} srcdir=`pwd` AWK=gawk CMP=cmp \
+  make -f Maketests $i >$i.tmp 2>&1; \
+  grep -q "Error" $i.tmp; \
+  if [ $? -eq 0 ]; then echo "FAIL: $i"; \
+  else echo "PASS: $i"; rm -f $i.tmp; fi; \
+done
diff --git a/meta/recipes-extended/gawk/gawk_3.1.5.bb b/meta/recipes-extended/gawk/gawk_3.1.5.bb
new file mode 100644
index 0000000..c7af4a9
--- /dev/null
+++ b/meta/recipes-extended/gawk/gawk_3.1.5.bb
@@ -0,0 +1,42 @@
+SUMMARY = "GNU awk text processing utility"
+DESCRIPTION = "The GNU version of awk, a text processing utility. \
+Awk interprets a special-purpose programming language to do \
+quick and easy text pattern matching and reformatting jobs."
+HOMEPAGE = "www.gnu.org/software/gawk"
+BUGTRACKER  = "bug-gawk@gnu.org"
+SECTION = "console/utils"
+
+# gawk <= 3.1.5: GPLv2
+# gawk >= 3.1.6: GPLv3
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+RDEPENDS_gawk += "gawk-common"
+RDEPENDS_pgawk += "gawk-common"
+PR = "r2"
+
+SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
+	file://gawk-3.1.5_fix_for_automake-1.12.patch"
+
+SRC_URI[md5sum] = "4760325489479cac17fe0114b8f62f30"
+SRC_URI[sha256sum] = "463dcb9d0ca398b1d4f5a332f6cd9cec56441265fca616f2ea1b44d459e9f0f8"
+
+inherit autotools gettext texinfo update-alternatives
+
+PACKAGES += "gawk-common pgawk"
+
+FILES_${PN} = "${bindir}/gawk* ${bindir}/igawk"
+FILES_gawk-common += "${datadir}/awk/* ${libdir}/gawk/awk/*"
+FILES_pgawk = "${bindir}/pgawk*"
+FILES_${PN}-dbg += "${libdir}/gawk/awk/.debug"
+
+ALTERNATIVE_${PN} = "awk"
+ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
+ALTERNATIVE_PRIORITY = "100"
+
+CFLAGS += "-D PROTOTYPES"
+
+do_install_append() {
+	# remove the link since we don't package it
+	rm ${D}${bindir}/awk
+}
diff --git a/meta/recipes-extended/gawk/gawk_4.1.3.bb b/meta/recipes-extended/gawk/gawk_4.1.3.bb
new file mode 100644
index 0000000..d1a88e4
--- /dev/null
+++ b/meta/recipes-extended/gawk/gawk_4.1.3.bb
@@ -0,0 +1,47 @@
+SUMMARY = "GNU awk text processing utility"
+DESCRIPTION = "The GNU version of awk, a text processing utility. \
+Awk interprets a special-purpose programming language to do \
+quick and easy text pattern matching and reformatting jobs."
+HOMEPAGE = "https://www.gnu.org/software/gawk/"
+BUGTRACKER  = "bug-gawk@gnu.org"
+SECTION = "console/utils"
+
+# gawk <= 3.1.5: GPLv2
+# gawk >= 3.1.6: GPLv3
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+DEPENDS += "readline"
+
+PACKAGECONFIG[mpfr] = "--with-mpfr,--without-mpfr, mpfr"
+
+SRC_URI = "${GNU_MIRROR}/gawk/gawk-${PV}.tar.gz \
+           file://run-ptest \
+"
+
+SRC_URI[md5sum] = "55d37f4069502677f25d1340df8eec97"
+SRC_URI[sha256sum] = "524effa5b9ecd4ed940f2581c5d3c1df4e4bd7e6f768aa033c1916f47dfc6e29"
+
+inherit autotools gettext texinfo update-alternatives
+
+FILES_${PN} += "${datadir}/awk"
+FILES_${PN}-dev += "${libdir}/${BPN}/*.la"
+FILES_${PN}-dbg += "${libexecdir}/awk/.debug"
+
+ALTERNATIVE_${PN} = "awk"
+ALTERNATIVE_TARGET[awk] = "${bindir}/gawk"
+ALTERNATIVE_PRIORITY = "100"
+
+do_install_append() {
+	# remove the link since we don't package it
+	rm ${D}${bindir}/awk
+}
+
+inherit ptest
+
+do_install_ptest() {
+	mkdir ${D}${PTEST_PATH}/test
+	for i in `grep -vE "@|^$|#|Gt-dummy" ${S}/test/Maketests |awk -F: '{print $1}'` Maketests; \
+	  do cp ${S}/test/$i* ${D}${PTEST_PATH}/test; \
+	done
+}
diff --git a/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h
new file mode 100644
index 0000000..a05de29
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/aarch64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h
new file mode 100644
index 0000000..e8772cd
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/arm/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h
new file mode 100644
index 0000000..359097f
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/armeb/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch b/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch
new file mode 100644
index 0000000..d97d4ec
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/base-genht.c-add-a-preprocessor-define-to-allow-fope.patch
@@ -0,0 +1,36 @@
+base/genht.c: add a preprocessor define to allow fopen calling
+
+The commit in upstream:
+http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=773c69e46e70bdd5482676437dafd2ca83397643
+
+Replace all fopen calls with gp_fopen and add a preprocessor define so
+that any unintential calls directly to fopen will cause an error.
+
+Only exceptions are those in the platform specific code, and mkromfs.c.
+This patch add a preprocessor define to allow fopen calling in base/genht.c.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ base/genht.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/base/genht.c b/base/genht.c
+index 4b04085..cc82fff 100644
+--- a/base/genht.c
++++ b/base/genht.c
+@@ -16,6 +16,10 @@
+ 
+ /* Generate C code for compiling halftones into ROM. */
+ #include "malloc_.h"
++
++/* prevent gp.h from defining fopen */
++#define fopen fopen
++
+ #include "stdio_.h"
+ #include "string_.h"
+ #include "gscdefs.h"
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch b/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch
new file mode 100644
index 0000000..a1c9368
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/cups-no-gcrypt.patch
@@ -0,0 +1,31 @@
+Subject: [PATCH] Don't build-depend on libgcrypt, as nothing is used from it
+
+Backported from http://www.cups.org/strfiles.php/3308/cups-no-gcrypt.patch
+
+This addresses the cryto dependency seen during build.
+
+Upstream-Status: Backport
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+
+Rebase the patch to ghostscript-9.15
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ cups/libs/cups/http-private.h | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/cups/libs/cups/http-private.h b/cups/libs/cups/http-private.h
+index 99a85c3..a674852 100644
+--- a/cups/libs/cups/http-private.h
++++ b/cups/libs/cups/http-private.h
+@@ -80,7 +80,6 @@ typedef int socklen_t;
+ #  elif defined HAVE_GNUTLS
+ #    include <gnutls/gnutls.h>
+ #    include <gnutls/x509.h>
+-#    include <gcrypt.h>
+ #  elif defined(HAVE_CDSASSL)
+ #    include <CoreFoundation/CoreFoundation.h>
+ #    include <Security/Security.h>
+-- 
+1.9.1
+
diff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch
new file mode 100644
index 0000000..e28a949
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-genarch.patch
@@ -0,0 +1,28 @@
+Import patch from windriver linux for cross compilation, and split patches
+into oe way under different directories such as i586, powerpc etc according 
+to Richard's opinion.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+# Author: Chi Xu <chi.xu@windriver.com>
+# Date: Feb 26 2010
+# Summary: Generate arch.h for ppc32
+#
+
+diff -Nru ghostscript-8.64.orig/base/lib.mak ghostscript-8.64/base/lib.mak
+--- ghostscript-8.64.orig/base/lib.mak	2010-02-10 10:30:02.000000000 +0800
++++ ghostscript-8.64/base/lib.mak	2010-02-10 10:56:21.000000000 +0800
+@@ -67,8 +67,8 @@
+ stdpre_h=$(GLSRC)stdpre.h $(stdpn_h)
+ stdint__h=$(GLSRC)stdint_.h $(std_h)
+ 
+-$(GLGEN)arch.h : $(GENARCH_XE)
+-	$(EXP)$(GENARCH_XE) $(GLGEN)arch.h $(TARGET_ARCH_FILE)
++##$(GLGEN)arch.h : $(GENARCH_XE)
++##	$(EXP)$(GENARCH_XE) $(GLGEN)arch.h $(TARGET_ARCH_FILE)
+ 
+ # Platform interfaces
+ 
diff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch
new file mode 100644
index 0000000..bc29be5
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.02-prevent_recompiling.patch
@@ -0,0 +1,100 @@
+ust use commands provided by ghostscript-native, preventing recompile them when
+compile ghostscript.
+Way to enable cross compile.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+
+diff --git a/base/unix-aux.mak b/base/unix-aux.mak
+index a91fb26..c991d11 100644
+--- a/base/unix-aux.mak
++++ b/base/unix-aux.mak
+@@ -69,46 +69,46 @@ $(GLOBJ)gp_sysv.$(OBJ): $(GLSRC)gp_sysv.c $(stdio__h) $(time__h) $(AK)\
+  $(MAKEDIRS)
+ 	$(GLCC) $(GLO_)gp_sysv.$(OBJ) $(C_) $(GLSRC)gp_sysv.c
+ 
+-# -------------------------- Auxiliary programs --------------------------- #
+-
+-$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(MAKEDIRS)
+-	$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c $(AUXEXTRALIBS)
+-
+-# On the RS/6000 (at least), compiling genarch.c with gcc with -O
+-# produces a buggy executable.
+-$(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) $(MAKEDIRS)
+-	$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS)
+-
+-$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(MAKEDIRS)
+-	$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS)
+-
+-$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(MAKEDIRS)
+-	$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS)
+-
+-$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(MAKEDIRS)
+-	$(CCAUX_) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c $(AUXEXTRALIBS)
+-
+-# To get GS to use the system zlib, you remove/hide the gs/zlib directory
+-# which means that the mkromfs build can't find the zlib source it needs.
+-# So it's split into two targets, one using the zlib source directly.....
+-MKROMFS_OBJS_0=$(MKROMFS_ZLIB_OBJS) $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
+- $(AUX)gscdefs.$(OBJ) $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
+- $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) $(AUX)memento.$(OBJ)
+-
+-$(MKROMFS_XE)_0: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_0) $(MAKEDIRS)
+-	$(CCAUX_) $(GENOPT) $(CFLAGS) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_0 $(MKROMFS_OBJS_0) $(AUXEXTRALIBS)
+-
+-# .... and one using the zlib library linked via the command line
+-MKROMFS_OBJS_1=$(AUX)gscdefs.$(OBJ) \
+- $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
+- $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
+- $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ)
+-
+-$(MKROMFS_XE)_1: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_1) $(MAKEDIRS)
+-	$(CCAUX_) $(GENOPT) $(CFLAGS) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_1 $(MKROMFS_OBJS_1) $(AUXEXTRALIBS)
+-
+-$(MKROMFS_XE): $(MKROMFS_XE)_$(SHARE_ZLIB) $(MAKEDIRS)
+-	$(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE)
++## -------------------------- Auxiliary programs --------------------------- #
++#
++#$(ECHOGS_XE): $(GLSRC)echogs.c $(AK) $(stdpre_h) $(MAKEDIRS)
++#	$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(ECHOGS_XE) $(GLSRC)echogs.c $(AUXEXTRALIBS)
++#
++## On the RS/6000 (at least), compiling genarch.c with gcc with -O
++## produces a buggy executable.
++#$(GENARCH_XE): $(GLSRC)genarch.c $(AK) $(GENARCH_DEPS) $(MAKEDIRS)
++#	$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENARCH_XE) $(GLSRC)genarch.c $(AUXEXTRALIBS)
++#
++#$(GENCONF_XE): $(GLSRC)genconf.c $(AK) $(GENCONF_DEPS) $(MAKEDIRS)
++#	$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENCONF_XE) $(GLSRC)genconf.c $(AUXEXTRALIBS)
++#
++#$(GENDEV_XE): $(GLSRC)gendev.c $(AK) $(GENDEV_DEPS) $(MAKEDIRS)
++#	$(CCAUX_) $(I_)$(GLSRCDIR)$(_I) $(O_)$(GENDEV_XE) $(GLSRC)gendev.c $(AUXEXTRALIBS)
++#
++#$(GENHT_XE): $(GLSRC)genht.c $(AK) $(GENHT_DEPS) $(MAKEDIRS)
++#	$(CCAUX_) $(GENHT_CFLAGS) $(O_)$(GENHT_XE) $(GLSRC)genht.c $(AUXEXTRALIBS)
++#
++## To get GS to use the system zlib, you remove/hide the gs/zlib directory
++## which means that the mkromfs build can't find the zlib source it needs.
++## So it's split into two targets, one using the zlib source directly.....
++#MKROMFS_OBJS_0=$(MKROMFS_ZLIB_OBJS) $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
++# $(AUX)gscdefs.$(OBJ) $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
++# $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ) $(AUX)memento.$(OBJ)
++#
++#$(MKROMFS_XE)_0: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_0) $(MAKEDIRS)
++#	$(CCAUX_) $(GENOPT) $(CFLAGS) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_0 $(MKROMFS_OBJS_0) $(AUXEXTRALIBS)
++#
++## .... and one using the zlib library linked via the command line
++#MKROMFS_OBJS_1=$(AUX)gscdefs.$(OBJ) \
++# $(AUX)gpmisc.$(OBJ) $(AUX)gp_getnv.$(OBJ) \
++# $(AUX)gp_unix.$(OBJ) $(AUX)gp_unifs.$(OBJ) $(AUX)gp_unifn.$(OBJ) \
++# $(AUX)gp_stdia.$(OBJ) $(AUX)gsutil.$(OBJ)
++#
++#$(MKROMFS_XE)_1: $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS_1) $(MAKEDIRS)
++#	$(CCAUX_) $(GENOPT) $(CFLAGS) $(I_)$(GLSRCDIR)$(_I) $(I_)$(GLOBJ)$(_I) $(I_)$(ZSRCDIR)$(_I) $(GLSRC)mkromfs.c $(O_)$(MKROMFS_XE)_1 $(MKROMFS_OBJS_1) $(AUXEXTRALIBS)
++#
++#$(MKROMFS_XE): $(MKROMFS_XE)_$(SHARE_ZLIB) $(MAKEDIRS)
++#	$(CP_) $(MKROMFS_XE)_$(SHARE_ZLIB) $(MKROMFS_XE)
+ 
+ # Query the environment to construct gconfig_.h.
+ # These are all defined conditionally (except the JasPER one), so that
diff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
new file mode 100644
index 0000000..797b894
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.15-parallel-make.patch
@@ -0,0 +1,40 @@
+From be1e1b33191afdcfe3c2ecc4ff3e361a5859e9c6 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Fri, 30 Jan 2015 00:40:22 -0800
+Subject: [PATCH] contrib.mak: fix for parallel build
+
+Fixed:
+rm: cannot remove `/usr/share/ghostscript/9.15/lib': Is a directory
+
+Create lib before install to fix the race issue.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ contrib/contrib.mak |    2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/contrib/contrib.mak b/contrib/contrib.mak
+index 08a80d1..de2e20d 100644
+--- a/contrib/contrib.mak
++++ b/contrib/contrib.mak
+@@ -947,6 +947,7 @@ $(DEVOBJ)dviprlib.$(OBJ) : $(JAPSRC)dviprlib.c $(JAPSRC)dviprlib.h
+ 	$(DEVCC) $(O_)$@ $(C_) $(JAPSRC)dviprlib.c
+ 
+ extra-dmprt-install:
++	mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib
+ 	$(INSTALL_DATA) $(JAPSRC)dmp_init.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
+ 	$(INSTALL_DATA) $(JAPSRC)dmp_site.ps $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
+ 	$(INSTALL_DATA) $(JAPSRC)escp_24.src $(DESTDIR)$(gsdatadir)$(D)lib || exit 1
+@@ -1088,6 +1089,7 @@ $(DEVOBJ)gdevalps.$(OBJ) : $(JAPSRC)gdevalps.c $(PDEVH)
+ ### ----------------- Additional .upp files ---------------- ###
+ 
+ extra-upp-install:
++	mkdir -p $(DESTDIR)$(gsdatadir)$(D)lib
+ 	for f in $(CONTRIBSRC)uniprint$(D)*.upp; do \
+ 	    $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)$(D)lib || exit 1; \
+ 	done
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch
new file mode 100644
index 0000000..d786482
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-9.16-Werror-return-type.patch
@@ -0,0 +1,30 @@
+From 5d5c83c89be0cff29dde2267fa168e6f7146be8c Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Mon, 4 May 2015 22:31:48 -0700
+Subject: [PATCH] base/gendev.c: fix for -Werror=return-type
+
+Fixed:
+base/gendev.c:80:1: error: return type defaults to 'int' [-Werror=return-type]
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ base/gendev.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/base/gendev.c b/base/gendev.c
+index 68a745f..8058b5a 100644
+--- a/base/gendev.c
++++ b/base/gendev.c
+@@ -77,6 +77,7 @@ static const char *indent_item = "";
+ /* Forward definitions */
+ void add_entry(config *, const char *, const char *, bool);
+ 
++int
+ main(int argc, char *argv[])
+ {
+     config conf;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/ghostscript/ghostscript/ghostscript-native-fix-disable-system-libtiff.patch b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-native-fix-disable-system-libtiff.patch
new file mode 100644
index 0000000..9158117
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/ghostscript-native-fix-disable-system-libtiff.patch
@@ -0,0 +1,37 @@
+ghostscript-native:fix disable-system-libtiff
+
+Modify configure to add the check to make sure
+ghostscrip could work while system-libtiff is
+disabled.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+ configure.ac | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -1055,6 +1055,7 @@ Disabling tiff output devices.])
+ esac
+ 
+ if test $SHARE_LIBTIFF -eq 0; then
++    if test -e $LIBTIFFDIR/configure; then
+       echo
+       echo "Running libtiff configure script..."
+       olddir=`pwd`
+@@ -1069,6 +1070,10 @@ if test $SHARE_LIBTIFF -eq 0; then
+       cd "$olddir"
+       echo
+       echo "Continuing with Ghostscript configuration..."
++    else
++      AC_MSG_NOTICE([Could not find local copy of libtiff.
++Disabling tiff output devices.])
++    fi
+ fi
+ 
+ AC_SUBST(SHARE_LIBTIFF)
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h
new file mode 100644
index 0000000..5817b7a
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/i586/objarch.h
@@ -0,0 +1,41 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
+
diff --git a/meta/recipes-extended/ghostscript/ghostscript/i686 b/meta/recipes-extended/ghostscript/ghostscript/i686
new file mode 120000
index 0000000..87aaca5
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/i686
@@ -0,0 +1 @@
+i586
\ No newline at end of file
diff --git a/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h
new file mode 100644
index 0000000..63232fd
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/microblazeeb/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h
new file mode 100644
index 0000000..3ec8101
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/microblazeel/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 4
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h
new file mode 100644
index 0000000..b8b637c
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/mips/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 4
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h
new file mode 100644
index 0000000..0d0a16b
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/mips64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h
new file mode 100644
index 0000000..a05de29
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/mips64el/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h
new file mode 100644
index 0000000..a05de29
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/mips64eln32/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h
new file mode 100644
index 0000000..0d0a16b
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/mips64n32/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h
new file mode 100644
index 0000000..29f90dd
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/mipsel/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 4
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h
new file mode 100644
index 0000000..359097f
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/powerpc/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 4
+#define ARCH_ALIGN_PTR_MOD 4
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 2
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 4
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h
new file mode 100644
index 0000000..0d0a16b
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/powerpc64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 1
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h b/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h
new file mode 100644
index 0000000..a05de29
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript/x86-64/objarch.h
@@ -0,0 +1,40 @@
+/* Parameters derived from machine and compiler architecture. */
+/* This file is generated mechanically by genarch.c. */
+
+	 /* ---------------- Scalar alignments ---------------- */
+
+#define ARCH_ALIGN_SHORT_MOD 2
+#define ARCH_ALIGN_INT_MOD 4
+#define ARCH_ALIGN_LONG_MOD 8
+#define ARCH_ALIGN_PTR_MOD 8
+#define ARCH_ALIGN_FLOAT_MOD 4
+#define ARCH_ALIGN_DOUBLE_MOD 8
+
+	 /* ---------------- Scalar sizes ---------------- */
+
+#define ARCH_LOG2_SIZEOF_CHAR 0
+#define ARCH_LOG2_SIZEOF_SHORT 1
+#define ARCH_LOG2_SIZEOF_INT 2
+#define ARCH_LOG2_SIZEOF_LONG 3
+#define ARCH_LOG2_SIZEOF_LONG_LONG 3
+#define ARCH_SIZEOF_GX_COLOR_INDEX 8
+#define ARCH_SIZEOF_PTR 8
+#define ARCH_SIZEOF_FLOAT 4
+#define ARCH_SIZEOF_DOUBLE 8
+#define ARCH_FLOAT_MANTISSA_BITS 24
+#define ARCH_DOUBLE_MANTISSA_BITS 53
+
+	 /* ---------------- Unsigned max values ---------------- */
+
+#define ARCH_MAX_UCHAR ((unsigned char)0xff + (unsigned char)0)
+#define ARCH_MAX_USHORT ((unsigned short)0xffff + (unsigned short)0)
+#define ARCH_MAX_UINT ((unsigned int)~0 + (unsigned int)0)
+#define ARCH_MAX_ULONG ((unsigned long)~0L + (unsigned long)0)
+
+	 /* ---------------- Miscellaneous ---------------- */
+
+#define ARCH_IS_BIG_ENDIAN 0
+#define ARCH_PTRS_ARE_SIGNED 0
+#define ARCH_FLOATS_ARE_IEEE 1
+#define ARCH_ARITH_RSHIFT 2
+#define ARCH_DIV_NEG_POS_TRUNCATES 1
diff --git a/meta/recipes-extended/ghostscript/ghostscript_9.16.bb b/meta/recipes-extended/ghostscript/ghostscript_9.16.bb
new file mode 100644
index 0000000..ec4acc6
--- /dev/null
+++ b/meta/recipes-extended/ghostscript/ghostscript_9.16.bb
@@ -0,0 +1,103 @@
+SUMMARY = "The GPL Ghostscript PostScript/PDF interpreter"
+DESCRIPTION = "Ghostscript is used for PostScript/PDF preview and printing.  Usually as \
+a back-end to a program such as ghostview, it can display PostScript and PDF \
+documents in an X11 environment. \
+\
+Furthermore, it can render PostScript and PDF files as graphics to be printed \
+on non-PostScript printers. Supported printers include common \
+dot-matrix, inkjet and laser models. \
+"
+HOMEPAGE = "http://www.ghostscript.com"
+SECTION = "console/utils"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b17cea54743435ab2a581c237bea294a"
+
+DEPENDS = "ghostscript-native tiff jpeg fontconfig cups"
+DEPENDS_class-native = ""
+
+SRC_URI_BASE = "http://downloads.ghostscript.com/public/ghostscript-${PV}.tar.gz \
+                file://ghostscript-9.15-parallel-make.patch \
+                file://ghostscript-9.16-Werror-return-type.patch \
+"
+
+SRC_URI = "${SRC_URI_BASE} \
+           file://ghostscript-9.02-prevent_recompiling.patch \
+           file://ghostscript-9.02-genarch.patch \
+           file://objarch.h \
+           file://cups-no-gcrypt.patch \
+           "
+
+SRC_URI_class-native = "${SRC_URI_BASE} \
+                        file://ghostscript-native-fix-disable-system-libtiff.patch \
+                        file://base-genht.c-add-a-preprocessor-define-to-allow-fope.patch \
+                        "
+
+SRC_URI[md5sum] = "829319325bbdb83f5c81379a8f86f38f"
+SRC_URI[sha256sum] = "746d77280cca8afdd3d4c2c1389e332ed9b0605bd107bcaae1d761b061d1a68d"
+
+EXTRA_OECONF = "--without-x --with-system-libtiff --without-jbig2dec \
+                --with-fontpath=${datadir}/fonts \
+                --without-libidn --with-cups-serverbin=${exec_prefix}/lib/cups \
+                --with-cups-datadir=${datadir}/cups \
+                ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--enable-little-endian', '--enable-big-endian', d)} \
+                "
+
+EXTRA_OECONF_append_mips = " --with-large_color_index=0"
+EXTRA_OECONF_append_mipsel = " --with-large_color_index=0"
+
+# Explicity disable libtiff, fontconfig,
+# freetype, cups for ghostscript-native
+EXTRA_OECONF_class-native = "--without-x --with-system-libtiff=no \
+                             --without-jbig2dec \
+                             --with-fontpath=${datadir}/fonts \
+                             --without-libidn --disable-fontconfig \
+                             --disable-freetype --disable-cups"
+
+# This has been fixed upstream but for now we need to subvert the check for time.h
+# http://bugs.ghostscript.com/show_bug.cgi?id=692443
+# http://bugs.ghostscript.com/show_bug.cgi?id=692426
+CFLAGS += "-DHAVE_SYS_TIME_H=1"
+BUILD_CFLAGS += "-DHAVE_SYS_TIME_H=1"
+
+inherit autotools
+
+do_configure_prepend () {
+	mkdir -p obj
+	mkdir -p soobj
+	if [ -e ${WORKDIR}/objarch.h ]; then
+		cp ${WORKDIR}/objarch.h obj/arch.h
+	fi
+}
+
+do_configure_append () {
+	# copy tools from the native ghostscript build
+	if [ "${PN}" != "ghostscript-native" ]; then
+		mkdir -p obj/aux soobj
+		for i in genarch genconf mkromfs echogs gendev genht; do
+			cp ${STAGING_BINDIR_NATIVE}/ghostscript-${PV}/$i obj/aux/$i
+		done
+	fi
+}
+
+do_install_append () {
+    mkdir -p ${D}${datadir}/ghostscript/${PV}/
+    cp -r ${S}/Resource ${D}${datadir}/ghostscript/${PV}/
+    cp -r ${S}/iccprofiles ${D}${datadir}/ghostscript/${PV}/
+}
+
+do_compile_class-native () {
+    mkdir -p obj
+    for i in genarch genconf mkromfs echogs gendev genht; do
+        oe_runmake obj/aux/$i
+    done
+}
+
+do_install_class-native () {
+    install -d ${D}${bindir}/ghostscript-${PV}
+    for i in genarch genconf mkromfs echogs gendev genht; do
+        install -m 755 obj/aux/$i ${D}${bindir}/ghostscript-${PV}/$i
+    done
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/gperf/gperf.inc b/meta/recipes-extended/gperf/gperf.inc
new file mode 100644
index 0000000..a8ce230
--- /dev/null
+++ b/meta/recipes-extended/gperf/gperf.inc
@@ -0,0 +1,22 @@
+DESCRIPTION = "GNU gperf is a perfect hash function generator"
+HOMEPAGE = "http://www.gnu.org/software/gperf"
+SUMMARY  = "Generate a perfect hash function from a set of keywords"
+LICENSE  = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://src/main.cc;beginline=8;endline=19;md5=dec8f611845d047387ed56b5b85fa99b"
+
+SRC_URI  = "${GNU_MIRROR}/gperf/gperf-${PV}.tar.gz"
+
+inherit autotools
+
+# autoreconf couldn't find acinclude.m4 when stepping into subdirectory. Instead of
+# duplicating acinclude.m4 in every subdirectory, use absolute include path to aclocal
+EXTRA_AUTORECONF += " -I ${S}"
+
+do_configure_prepend() {
+        if [ ! -e ${S}/acinclude.m4 ]; then
+                cat ${S}/aclocal.m4 > ${S}/acinclude.m4
+        fi
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/gperf/gperf_3.0.3.bb b/meta/recipes-extended/gperf/gperf_3.0.3.bb
new file mode 100644
index 0000000..7728861
--- /dev/null
+++ b/meta/recipes-extended/gperf/gperf_3.0.3.bb
@@ -0,0 +1,10 @@
+require gperf.inc
+
+LICENSE  = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a5f84abb0070adf8a0925d7d534b6e0a \
+                    file://src/main.cc;beginline=8;endline=19;md5=72a3034a19e72f08ee48ef8244a121fd"
+
+PR = "r1"
+
+SRC_URI[md5sum] = "cc20e58975a38075440423c8fb85fd00"
+SRC_URI[sha256sum] = "63287527c8d9e27e801cf0804436f3494bd569db05d49dcdd2a942ae72fa9055"
diff --git a/meta/recipes-extended/gperf/gperf_3.0.4.bb b/meta/recipes-extended/gperf/gperf_3.0.4.bb
new file mode 100644
index 0000000..64003fc
--- /dev/null
+++ b/meta/recipes-extended/gperf/gperf_3.0.4.bb
@@ -0,0 +1,5 @@
+require gperf.inc
+
+
+SRC_URI[md5sum] = "c1f1db32fb6598d6a93e6e88796a8632"
+SRC_URI[sha256sum] = "767112a204407e62dbc3106647cf839ed544f3cf5d0f0523aaa2508623aad63e"
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/Makevars b/meta/recipes-extended/grep/grep-2.5.1a/Makevars
new file mode 100644
index 0000000..8b09f53
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/Makevars
@@ -0,0 +1,25 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch b/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch
new file mode 100644
index 0000000..5a4149c
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/fix-for-texinfo-5.1.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [Poky Specific this is gplv2 version]
+
+Signed-off-by Saul Wold <sgw@linux.intel.com>
+
+Index: grep-2.5.1a/doc/grep.texi
+===================================================================
+--- grep-2.5.1a.orig/doc/grep.texi
++++ grep-2.5.1a/doc/grep.texi
+@@ -288,7 +288,7 @@ This version number should be included i
+ Print a usage message briefly summarizing these command-line options
+ and the bug-reporting address, then exit.
+ 
+-@itemx --binary-files=@var{type}
++@item --binary-files=@var{type}
+ @opindex --binary-files
+ @cindex binary files
+ If the first few bytes of a file indicate that the file contains binary
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch b/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch
new file mode 100644
index 0000000..3b91520
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/fix64-int-to-pointer.patch
@@ -0,0 +1,17 @@
+Always use locale.h as HAVE_LOCALE_H is no longer handled by ./configure
+Upstream-Status: Inappropriate [ old version that will not be maintained ]
+Signed-off-by: Alex DAMIAN <alexandru.damian@intel.com>
+
+diff --recursive --unified grep-2.5.1a-orig/lib/hard-locale.c grep-2.5.1a/lib/hard-locale.c
+--- grep-2.5.1a-orig/lib/hard-locale.c	2001-03-04 07:33:12.000000000 +0200
++++ grep-2.5.1a/lib/hard-locale.c	2013-03-11 17:05:52.086444891 +0200
+@@ -38,9 +38,7 @@
+ # endif
+ #endif
+ 
+-#if HAVE_LOCALE_H
+ # include <locale.h>
+-#endif
+ 
+ #if HAVE_STRING_H
+ # include <string.h>
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch b/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch
new file mode 100644
index 0000000..5746335
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/gettext.patch
@@ -0,0 +1,15 @@
+Enable operation with later versions of gettext.
+
+Upstream-Status: Inappropriate
+RP 2012/10/19
+
+Index: grep-2.5.1a/configure.in
+===================================================================
+--- grep-2.5.1a.orig/configure.in	2012-10-19 12:57:51.646970204 +0000
++++ grep-2.5.1a/configure.in	2012-10-19 12:59:49.946968803 +0000
+@@ -140,4 +140,4 @@
+ 	AC_CHECK_LIB(pcre, pcre_exec)
+ fi
+ 
+-AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile; echo timestamp > stamp-h])
++AC_OUTPUT(Makefile lib/Makefile lib/posix/Makefile src/Makefile tests/Makefile po/Makefile.in intl/Makefile doc/Makefile m4/Makefile vms/Makefile bootstrap/Makefile, [echo timestamp > stamp-h])
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch b/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch
new file mode 100644
index 0000000..059d068
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/grep-CVE-2012-5667.patch
@@ -0,0 +1,32 @@
+The patch to fix CVE-2012-5667
+Reference: https://bugzilla.redhat.com/attachment.cgi?id=686605&action=diff
+
+Multiple integer overflows in GNU Grep before 2.11 might allow
+context-dependent attackers to execute arbitrary code via vectors
+involving a long input line that triggers a heap-based buffer overflow.
+
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2012-5667
+
+Upstream-Status: Inappropriate [other]
+This version of GNU Grep has been abandoned upstream and they are no longer
+accepting patches.  This is not a backport.
+
+Signed-off-by Ming Liu <ming.liu@windriver.com>
+---
+ grep.c |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/src/grep.c	2013-05-15 13:39:33.359191769 +0800
++++ a/src/grep.c	2013-05-15 13:50:22.609191882 +0800
+@@ -306,6 +306,11 @@ fillbuf (size_t save, struct stats const
+   int cc = 1;
+   char *readbuf;
+   size_t readsize;
++  const size_t max_save = INT_MAX / 2;
++
++  /* Limit the amount of saved data to INT_MAX to fix CVE-2012-5667 */
++  if (save > max_save)
++     error (2, 0, _("line too long"));
+ 
+   /* Offset from start of buffer to start of old stuff
+      that we want to save.  */
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch b/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch
new file mode 100644
index 0000000..327ee56
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/grep-egrep-fgrep-Fix-LSB-NG-cases.patch
@@ -0,0 +1,1342 @@
+From c884dd12ec062569335702848fc5f29f436c28fa Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Mon, 25 May 2015 10:15:57 +0900
+Subject: [PATCH] grep egrep fgrep: Fix LSB NG cases.
+
+The LSB core test requires grep egrep and fgrep can
+perform pattern matching in searches without regard
+to case if -i option is specified.
+
+Upstream-Status: backport.
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ lib/posix/regex.h |   4 +
+ src/dfa.c         |  22 +-
+ src/grep.c        |  96 ++++---
+ src/search.c      | 833 +++++++++++++++++++++++++++++++++++++++++++++---------
+ 4 files changed, 768 insertions(+), 187 deletions(-)
+
+diff --git a/lib/posix/regex.h b/lib/posix/regex.h
+index 63c2fef..7bb2b0e 100644
+--- a/lib/posix/regex.h
++++ b/lib/posix/regex.h
+@@ -109,6 +109,10 @@ typedef unsigned long int reg_syntax_t;
+    If not set, \{, \}, {, and } are literals.  */
+ #define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+ 
++/* If this bit is set, then ignore case when matching.
++   If not set, then case is significant.  */
++#define RE_ICASE (RE_INVALID_INTERVAL_ORD << 1)
++
+ /* If this bit is set, +, ? and | aren't recognized as operators.
+    If not set, they are.  */
+ #define RE_LIMITED_OPS (RE_INTERVALS << 1)
+diff --git a/src/dfa.c b/src/dfa.c
+index 590bfa7..27c876a 100644
+--- a/src/dfa.c
++++ b/src/dfa.c
+@@ -414,7 +414,7 @@ update_mb_len_index (unsigned char const *p, int len)
+ 
+ /* This function fetch a wide character, and update cur_mb_len,
+    used only if the current locale is a multibyte environment.  */
+-static wchar_t
++static wint_t
+ fetch_wc (char const *eoferr)
+ {
+   wchar_t wc;
+@@ -423,7 +423,7 @@ fetch_wc (char const *eoferr)
+       if (eoferr != 0)
+ 	dfaerror (eoferr);
+       else
+-	return -1;
++	return WEOF;
+     }
+ 
+   cur_mb_len = mbrtowc(&wc, lexptr, lexleft, &mbs);
+@@ -459,7 +459,7 @@ fetch_wc (char const *eoferr)
+ static void
+ parse_bracket_exp_mb ()
+ {
+-  wchar_t wc, wc1, wc2;
++  wint_t wc, wc1, wc2;
+ 
+   /* Work area to build a mb_char_classes.  */
+   struct mb_char_classes *work_mbc;
+@@ -496,7 +496,7 @@ parse_bracket_exp_mb ()
+     work_mbc->invert = 0;
+   do
+     {
+-      wc1 = -1; /* mark wc1 is not initialized".  */
++      wc1 = WEOF; /* mark wc1 is not initialized".  */
+ 
+       /* Note that if we're looking at some other [:...:] construct,
+ 	 we just treat it as a bunch of ordinary characters.  We can do
+@@ -586,7 +586,7 @@ parse_bracket_exp_mb ()
+ 		      work_mbc->coll_elems[work_mbc->ncoll_elems++] = elem;
+ 		    }
+  		}
+-	      wc = -1;
++	      wc1 = wc = WEOF;
+ 	    }
+ 	  else
+ 	    /* We treat '[' as a normal character here.  */
+@@ -600,7 +600,7 @@ parse_bracket_exp_mb ()
+ 	    wc = fetch_wc(("Unbalanced ["));
+ 	}
+ 
+-      if (wc1 == -1)
++      if (wc1 == WEOF)
+ 	wc1 = fetch_wc(_("Unbalanced ["));
+ 
+       if (wc1 == L'-')
+@@ -630,17 +630,17 @@ parse_bracket_exp_mb ()
+ 	    }
+ 	  REALLOC_IF_NECESSARY(work_mbc->range_sts, wchar_t,
+ 			       range_sts_al, work_mbc->nranges + 1);
+-	  work_mbc->range_sts[work_mbc->nranges] = wc;
++	  work_mbc->range_sts[work_mbc->nranges] = (wchar_t)wc;
+ 	  REALLOC_IF_NECESSARY(work_mbc->range_ends, wchar_t,
+ 			       range_ends_al, work_mbc->nranges + 1);
+-	  work_mbc->range_ends[work_mbc->nranges++] = wc2;
++	  work_mbc->range_ends[work_mbc->nranges++] = (wchar_t)wc2;
+ 	}
+-      else if (wc != -1)
++      else if (wc != WEOF)
+ 	/* build normal characters.  */
+ 	{
+ 	  REALLOC_IF_NECESSARY(work_mbc->chars, wchar_t, chars_al,
+ 			       work_mbc->nchars + 1);
+-	  work_mbc->chars[work_mbc->nchars++] = wc;
++	  work_mbc->chars[work_mbc->nchars++] = (wchar_t)wc;
+ 	}
+     }
+   while ((wc = wc1) != L']');
+@@ -2552,6 +2552,8 @@ match_mb_charset (struct dfa *d, int s, position pos, int index)
+     }
+ 
+   /* match with a character?  */
++  if (case_fold)
++    wc = towlower (wc);
+   for (i = 0; i<work_mbc->nchars; i++)
+     {
+       if (wc == work_mbc->chars[i])
+diff --git a/src/grep.c b/src/grep.c
+index 2fb2fac..3fd4b47 100644
+--- a/src/grep.c
++++ b/src/grep.c
+@@ -30,6 +30,12 @@
+ # include <sys/time.h>
+ # include <sys/resource.h>
+ #endif
++#if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
++/* We can handle multibyte string.  */
++# define MBS_SUPPORT
++# include <wchar.h>
++# include <wctype.h>
++#endif
+ #include <stdio.h>
+ #include "system.h"
+ #include "getopt.h"
+@@ -255,19 +261,6 @@ reset (int fd, char const *file, struct stats *stats)
+   bufbeg[-1] = eolbyte;
+   bufdesc = fd;
+ 
+-  if (fstat (fd, &stats->stat) != 0)
+-    {
+-      error (0, errno, "fstat");
+-      return 0;
+-    }
+-  if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
+-    return 0;
+-#ifndef DJGPP
+-  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode)))
+-#else
+-  if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
+-#endif
+-    return 0;
+   if (S_ISREG (stats->stat.st_mode))
+     {
+       if (file)
+@@ -558,33 +551,6 @@ prline (char const *beg, char const *lim, int sep)
+     {
+       size_t match_size;
+       size_t match_offset;
+-      if(match_icase)
+-        {
+-	  /* Yuck, this is tricky */
+-          char *buf = (char*) xmalloc (lim - beg);
+-	  char *ibeg = buf;
+-	  char *ilim = ibeg + (lim - beg);
+-	  int i;
+-	  for (i = 0; i < lim - beg; i++)
+-	    ibeg[i] = tolower (beg[i]);
+-	  while ((match_offset = (*execute) (ibeg, ilim-ibeg, &match_size, 1))
+-		 != (size_t) -1)
+-	    {
+-	      char const *b = beg + match_offset;
+-	      if (b == lim)
+-		break;
+-	      fwrite (beg, sizeof (char), match_offset, stdout);
+-	      printf ("\33[%sm", grep_color);
+-	      fwrite (b, sizeof (char), match_size, stdout);
+-	      fputs ("\33[00m", stdout);
+-	      beg = b + match_size;
+-	      ibeg = ibeg + match_offset + match_size;
+-	    }
+-	  fwrite (beg, 1, lim - beg, stdout);
+-	  free (buf);
+-	  lastout = lim;
+-	  return;
+-	}
+       while (lim-beg && (match_offset = (*execute) (beg, lim - beg, &match_size, 1))
+ 	     != (size_t) -1)
+ 	{
+@@ -601,6 +567,7 @@ prline (char const *beg, char const *lim, int sep)
+ 	  fputs ("\33[00m", stdout);
+ 	  beg = b + match_size;
+ 	}
++      fputs ("\33[K", stdout);
+     }
+   fwrite (beg, 1, lim - beg, stdout);
+   if (ferror (stdout))
+@@ -623,7 +590,7 @@ prpending (char const *lim)
+       size_t match_size;
+       --pending;
+       if (outleft
+-	  || (((*execute) (lastout, nl - lastout, &match_size, 0) == (size_t) -1)
++	  || (((*execute) (lastout, nl + 1 - lastout, &match_size, 0) == (size_t) -1)
+ 	      == !out_invert))
+ 	prline (lastout, nl + 1, '-');
+       else
+@@ -895,6 +862,19 @@ grepfile (char const *file, struct stats *stats)
+     }
+   else
+     {
++      if (stat (file, &stats->stat) != 0)
++        {
++          suppressible_error (file, errno);
++          return 1;
++        }
++      if (directories == SKIP_DIRECTORIES && S_ISDIR (stats->stat.st_mode))
++        return 1;
++#ifndef DJGPP
++      if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode) || S_ISSOCK(stats->stat.st_mode) || S_ISFIFO(stats->stat.st_mode)))
++#else
++      if (devices == SKIP_DEVICES && (S_ISCHR(stats->stat.st_mode) || S_ISBLK(stats->stat.st_mode)))
++#endif
++        return 1;
+       while ((desc = open (file, O_RDONLY)) < 0 && errno == EINTR)
+ 	continue;
+ 
+@@ -1681,9 +1661,6 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"))
+ 	  out_invert ^= 1;
+ 	  match_lines = match_words = 0;
+ 	}
+-      else
+-	/* Strip trailing newline. */
+-        --keycc;
+     }
+   else
+     if (optind < argc)
+@@ -1697,6 +1674,37 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"))
+   if (!install_matcher (matcher) && !install_matcher ("default"))
+     abort ();
+ 
++#ifdef MBS_SUPPORT
++  if (MB_CUR_MAX != 1 && match_icase)
++    {
++      wchar_t wc;
++      mbstate_t cur_state, prev_state;
++      int i, len = strlen(keys);
++
++      memset(&cur_state, 0, sizeof(mbstate_t));
++      for (i = 0; i <= len ;)
++	{
++	  size_t mbclen;
++	  mbclen = mbrtowc(&wc, keys + i, len - i, &cur_state);
++	  if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
++	    {
++	      /* An invalid sequence, or a truncated multibyte character.
++		 We treat it as a singlebyte character.  */
++	      mbclen = 1;
++	    }
++	  else
++	    {
++	      if (iswupper((wint_t)wc))
++		{
++		  wc = towlower((wint_t)wc);
++		  wcrtomb(keys + i, wc, &cur_state);
++		}
++	    }
++	  i += mbclen;
++	}
++    }
++#endif /* MBS_SUPPORT */
++
+   (*compile)(keys, keycc);
+ 
+   if ((argc - optind > 1 && !no_filenames) || with_filenames)
+diff --git a/src/search.c b/src/search.c
+index 7bd233f..3c6a485 100644
+--- a/src/search.c
++++ b/src/search.c
+@@ -18,9 +18,13 @@
+ 
+ /* Written August 1992 by Mike Haertel. */
+ 
++#ifndef _GNU_SOURCE
++# define _GNU_SOURCE 1
++#endif
+ #ifdef HAVE_CONFIG_H
+ # include <config.h>
+ #endif
++#include <assert.h>
+ #include <sys/types.h>
+ #if defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H && defined HAVE_MBRTOWC
+ /* We can handle multibyte string.  */
+@@ -31,7 +35,7 @@
+ 
+ #include "system.h"
+ #include "grep.h"
+-#include "regex.h"
++#include <regex.h>
+ #include "dfa.h"
+ #include "kwset.h"
+ #include "error.h"
+@@ -39,6 +43,9 @@
+ #ifdef HAVE_LIBPCRE
+ # include <pcre.h>
+ #endif
++#ifdef HAVE_LANGINFO_CODESET
++# include <langinfo.h>
++#endif
+ 
+ #define NCHAR (UCHAR_MAX + 1)
+ 
+@@ -70,9 +77,10 @@ static kwset_t kwset;
+    call the regexp matcher at all. */
+ static int kwset_exact_matches;
+ 
+-#if defined(MBS_SUPPORT)
+-static char* check_multibyte_string PARAMS ((char const *buf, size_t size));
+-#endif
++/* UTF-8 encoding allows some optimizations that we can't otherwise
++   assume in a multibyte encoding. */
++static int using_utf8;
++
+ static void kwsinit PARAMS ((void));
+ static void kwsmusts PARAMS ((void));
+ static void Gcompile PARAMS ((char const *, size_t));
+@@ -84,6 +92,15 @@ static void Pcompile PARAMS ((char const *, size_t ));
+ static size_t Pexecute PARAMS ((char const *, size_t, size_t *, int));
+ 
+ void
++check_utf8 (void)
++{
++#ifdef HAVE_LANGINFO_CODESET
++  if (strcmp (nl_langinfo (CODESET), "UTF-8") == 0)
++    using_utf8 = 1;
++#endif
++}
++
++void
+ dfaerror (char const *mesg)
+ {
+   error (2, 0, mesg);
+@@ -141,38 +158,6 @@ kwsmusts (void)
+     }
+ }
+ 
+-#ifdef MBS_SUPPORT
+-/* This function allocate the array which correspond to "buf".
+-   Then this check multibyte string and mark on the positions which
+-   are not singlebyte character nor the first byte of a multibyte
+-   character.  Caller must free the array.  */
+-static char*
+-check_multibyte_string(char const *buf, size_t size)
+-{
+-  char *mb_properties = malloc(size);
+-  mbstate_t cur_state;
+-  int i;
+-  memset(&cur_state, 0, sizeof(mbstate_t));
+-  memset(mb_properties, 0, sizeof(char)*size);
+-  for (i = 0; i < size ;)
+-    {
+-      size_t mbclen;
+-      mbclen = mbrlen(buf + i, size - i, &cur_state);
+-
+-      if (mbclen == (size_t) -1 || mbclen == (size_t) -2 || mbclen == 0)
+-	{
+-	  /* An invalid sequence, or a truncated multibyte character.
+-	     We treat it as a singlebyte character.  */
+-	  mbclen = 1;
+-	}
+-      mb_properties[i] = mbclen;
+-      i += mbclen;
+-    }
+-
+-  return mb_properties;
+-}
+-#endif
+-
+ static void
+ Gcompile (char const *pattern, size_t size)
+ {
+@@ -181,7 +166,8 @@ Gcompile (char const *pattern, size_t size)
+   size_t total = size;
+   char const *motif = pattern;
+ 
+-  re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE);
++  check_utf8 ();
++  re_set_syntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE | (match_icase ? RE_ICASE : 0));
+   dfasyntax (RE_SYNTAX_GREP | RE_HAT_LISTS_NOT_NEWLINE, match_icase, eolbyte);
+ 
+   /* For GNU regex compiler we have to pass the patterns separately to detect
+@@ -218,6 +204,10 @@ Gcompile (char const *pattern, size_t size)
+       motif = sep;
+     } while (sep && total != 0);
+ 
++  /* Strip trailing newline. */
++  if (size && pattern[size - 1] == '\n')
++    size--;
++
+   /* In the match_words and match_lines cases, we use a different pattern
+      for the DFA matcher that will quickly throw out cases that won't work.
+      Then if DFA succeeds we do some hairy stuff using the regex matcher
+@@ -233,7 +223,7 @@ Gcompile (char const *pattern, size_t size)
+       static char const line_end[] = "\\)$";
+       static char const word_beg[] = "\\(^\\|[^[:alnum:]_]\\)\\(";
+       static char const word_end[] = "\\)\\([^[:alnum:]_]\\|$\\)";
+-      char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end);
++      char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end);
+       size_t i;
+       strcpy (n, match_lines ? line_beg : word_beg);
+       i = strlen (n);
+@@ -257,14 +247,15 @@ Ecompile (char const *pattern, size_t size)
+   size_t total = size;
+   char const *motif = pattern;
+ 
++  check_utf8 ();
+   if (strcmp (matcher, "awk") == 0)
+     {
+-      re_set_syntax (RE_SYNTAX_AWK);
++      re_set_syntax (RE_SYNTAX_AWK | (match_icase ? RE_ICASE : 0));
+       dfasyntax (RE_SYNTAX_AWK, match_icase, eolbyte);
+     }
+   else
+     {
+-      re_set_syntax (RE_SYNTAX_POSIX_EGREP);
++      re_set_syntax (RE_SYNTAX_POSIX_EGREP | (match_icase ? RE_ICASE : 0));
+       dfasyntax (RE_SYNTAX_POSIX_EGREP, match_icase, eolbyte);
+     }
+ 
+@@ -301,6 +292,10 @@ Ecompile (char const *pattern, size_t size)
+       motif = sep;
+     } while (sep && total != 0);
+ 
++  /* Strip trailing newline. */
++  if (size && pattern[size - 1] == '\n')
++    size--;
++
+   /* In the match_words and match_lines cases, we use a different pattern
+      for the DFA matcher that will quickly throw out cases that won't work.
+      Then if DFA succeeds we do some hairy stuff using the regex matcher
+@@ -316,7 +311,7 @@ Ecompile (char const *pattern, size_t size)
+       static char const line_end[] = ")$";
+       static char const word_beg[] = "(^|[^[:alnum:]_])(";
+       static char const word_end[] = ")([^[:alnum:]_]|$)";
+-      char *n = malloc (sizeof word_beg - 1 + size + sizeof word_end);
++      char *n = xmalloc (sizeof word_beg - 1 + size + sizeof word_end);
+       size_t i;
+       strcpy (n, match_lines ? line_beg : word_beg);
+       i = strlen(n);
+@@ -339,15 +334,34 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+   char eol = eolbyte;
+   int backref, start, len;
+   struct kwsmatch kwsm;
+-  size_t i;
++  size_t i, ret_val;
++  static int use_dfa;
++  static int use_dfa_checked = 0;
+ #ifdef MBS_SUPPORT
+-  char *mb_properties = NULL;
++  int mb_cur_max = MB_CUR_MAX;
++  mbstate_t mbs;
++  memset (&mbs, '\0', sizeof (mbstate_t));
+ #endif /* MBS_SUPPORT */
+ 
++  if (!use_dfa_checked)
++    {
++      char *grep_use_dfa = getenv ("GREP_USE_DFA");
++      if (!grep_use_dfa)
++	{
+ #ifdef MBS_SUPPORT
+-  if (MB_CUR_MAX > 1 && kwset)
+-    mb_properties = check_multibyte_string(buf, size);
++	  /* Turn off DFA when processing multibyte input. */
++	  use_dfa = (MB_CUR_MAX == 1);
++#else
++	  use_dfa = 1;
+ #endif /* MBS_SUPPORT */
++	}
++      else
++	{
++	  use_dfa = atoi (grep_use_dfa);
++	}
++
++      use_dfa_checked = 1;
++    }
+ 
+   buflim = buf + size;
+ 
+@@ -358,47 +372,120 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ 	  if (kwset)
+ 	    {
+ 	      /* Find a possible match using the KWset matcher. */
+-	      size_t offset = kwsexec (kwset, beg, buflim - beg, &kwsm);
++#ifdef MBS_SUPPORT
++	      size_t bytes_left = 0;
++#endif /* MBS_SUPPORT */
++	      size_t offset;
++#ifdef MBS_SUPPORT
++	      /* kwsexec doesn't work with match_icase and multibyte input. */
++	      if (match_icase && mb_cur_max > 1)
++		/* Avoid kwset */
++		offset = 0;
++	      else
++#endif /* MBS_SUPPORT */
++	      offset = kwsexec (kwset, beg, buflim - beg, &kwsm);
+ 	      if (offset == (size_t) -1)
+-		{
++	        goto failure;
+ #ifdef MBS_SUPPORT
+-		  if (MB_CUR_MAX > 1)
+-		    free(mb_properties);
+-#endif
+-		  return (size_t)-1;
++	      if (mb_cur_max > 1 && !using_utf8)
++		{
++		  bytes_left = offset;
++		  while (bytes_left)
++		    {
++		      size_t mlen = mbrlen (beg, bytes_left, &mbs);
++		      if (mlen == (size_t) -1 || mlen == 0)
++			{
++			  /* Incomplete character: treat as single-byte. */
++			  memset (&mbs, '\0', sizeof (mbstate_t));
++			  beg++;
++			  bytes_left--;
++			  continue;
++			}
++
++		      if (mlen == (size_t) -2)
++			/* Offset points inside multibyte character:
++			 * no good. */
++			break;
++
++		      beg += mlen;
++		      bytes_left -= mlen;
++		    }
+ 		}
++	      else
++#endif /* MBS_SUPPORT */
+ 	      beg += offset;
+ 	      /* Narrow down to the line containing the candidate, and
+ 		 run it through DFA. */
+ 	      end = memchr(beg, eol, buflim - beg);
+ 	      end++;
+ #ifdef MBS_SUPPORT
+-	      if (MB_CUR_MAX > 1 && mb_properties[beg - buf] == 0)
++	      if (mb_cur_max > 1 && bytes_left)
+ 		continue;
+-#endif
++#endif /* MBS_SUPPORT */
+ 	      while (beg > buf && beg[-1] != eol)
+ 		--beg;
+-	      if (kwsm.index < kwset_exact_matches)
+-		goto success;
+-	      if (dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
++	      if (
++#ifdef MBS_SUPPORT
++		  !(match_icase && mb_cur_max > 1) &&
++#endif /* MBS_SUPPORT */
++		  (kwsm.index < kwset_exact_matches))
++		goto success_in_beg_and_end;
++	      if (use_dfa &&
++		  dfaexec (&dfa, beg, end - beg, &backref) == (size_t) -1)
+ 		continue;
+ 	    }
+ 	  else
+ 	    {
+ 	      /* No good fixed strings; start with DFA. */
+-	      size_t offset = dfaexec (&dfa, beg, buflim - beg, &backref);
++#ifdef MBS_SUPPORT
++	      size_t bytes_left = 0;
++#endif /* MBS_SUPPORT */
++	      size_t offset = 0;
++	      if (use_dfa)
++		offset = dfaexec (&dfa, beg, buflim - beg, &backref);
+ 	      if (offset == (size_t) -1)
+ 		break;
+ 	      /* Narrow down to the line we've found. */
++#ifdef MBS_SUPPORT
++	      if (mb_cur_max > 1 && !using_utf8)
++		{
++		  bytes_left = offset;
++		  while (bytes_left)
++		    {
++		      size_t mlen = mbrlen (beg, bytes_left, &mbs);
++		      if (mlen == (size_t) -1 || mlen == 0)
++			{
++			  /* Incomplete character: treat as single-byte. */
++			  memset (&mbs, '\0', sizeof (mbstate_t));
++			  beg++;
++			  bytes_left--;
++			  continue;
++			}
++
++		      if (mlen == (size_t) -2)
++			/* Offset points inside multibyte character:
++			 * no good. */
++			break;
++
++		      beg += mlen;
++		      bytes_left -= mlen;
++		    }
++		}
++	      else
++#endif /* MBS_SUPPORT */
+ 	      beg += offset;
+ 	      end = memchr (beg, eol, buflim - beg);
+ 	      end++;
++#ifdef MBS_SUPPORT
++	      if (mb_cur_max > 1 && bytes_left)
++		continue;
++#endif /* MBS_SUPPORT */
+ 	      while (beg > buf && beg[-1] != eol)
+ 		--beg;
+ 	    }
+ 	  /* Successful, no backreferences encountered! */
+-	  if (!backref)
+-	    goto success;
++	  if (use_dfa && !backref)
++	    goto success_in_beg_and_end;
+ 	}
+       else
+ 	end = beg + size;
+@@ -413,14 +500,11 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ 				       end - beg - 1, &(patterns[i].regs))))
+ 	    {
+ 	      len = patterns[i].regs.end[0] - start;
+-	      if (exact)
+-		{
+-		  *match_size = len;
+-		  return start;
+-		}
++	      if (exact && !match_words)
++	        goto success_in_start_and_len;
+ 	      if ((!match_lines && !match_words)
+ 		  || (match_lines && len == end - beg - 1))
+-		goto success;
++		goto success_in_beg_and_end;
+ 	      /* If -w, check if the match aligns with word boundaries.
+ 		 We do this iteratively because:
+ 		 (a) the line may contain more than one occurence of the
+@@ -431,10 +515,114 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ 	      if (match_words)
+ 		while (start >= 0)
+ 		  {
+-		    if ((start == 0 || !WCHAR ((unsigned char) beg[start - 1]))
+-			&& (len == end - beg - 1
+-			    || !WCHAR ((unsigned char) beg[start + len])))
+-		      goto success;
++		    int lword_match = 0;
++		    if (start == 0)
++		      lword_match = 1;
++		    else
++		      {
++			assert (start > 0);
++#ifdef MBS_SUPPORT
++			if (mb_cur_max > 1)
++			  {
++			    const char *s;
++			    size_t mr;
++			    wchar_t pwc;
++
++			    /* Locate the start of the multibyte character
++			       before the match position (== beg + start). */
++			    if (using_utf8)
++			      {
++				/* UTF-8 is a special case: scan backwards
++				   until we find a 7-bit character or a
++				   lead byte. */
++				s = beg + start - 1;
++				while (s > buf
++				       && (unsigned char) *s >= 0x80
++				       && (unsigned char) *s <= 0xbf)
++				  --s;
++			      }
++			    else
++			      {
++				/* Scan forwards to find the start of the
++				   last complete character before the
++				   match position.  */
++				size_t bytes_left = start - 1;
++				s = beg;
++				while (bytes_left > 0)
++				  {
++				    mr = mbrlen (s, bytes_left, &mbs);
++				    if (mr == (size_t) -1 || mr == 0)
++				      {
++					memset (&mbs, '\0', sizeof (mbs));
++					s++;
++					bytes_left--;
++					continue;
++				      }
++				    if (mr == (size_t) -2)
++				      {
++					memset (&mbs, '\0', sizeof (mbs));
++					break;
++				      }
++				    s += mr;
++				    bytes_left -= mr;
++				  }
++			      }
++			    mr = mbrtowc (&pwc, s, beg + start - s, &mbs);
++			    if (mr == (size_t) -2 || mr == (size_t) -1 ||
++				mr == 0)
++			      {
++				memset (&mbs, '\0', sizeof (mbstate_t));
++				lword_match = 1;
++			      }
++			    else if (!(iswalnum (pwc) || pwc == L'_')
++				     && mr == beg + start - s)
++			      lword_match = 1;
++			  }
++			else
++#endif /* MBS_SUPPORT */
++			if (!WCHAR ((unsigned char) beg[start - 1]))
++			  lword_match = 1;
++		      }
++
++		    if (lword_match)
++		      {
++			int rword_match = 0;
++			if (start + len == end - beg - 1)
++			  rword_match = 1;
++			else
++			  {
++#ifdef MBS_SUPPORT
++			    if (mb_cur_max > 1)
++			      {
++				wchar_t nwc;
++				int mr;
++
++				mr = mbtowc (&nwc, beg + start + len,
++					     end - beg - start - len - 1);
++				if (mr <= 0)
++				  {
++				    memset (&mbs, '\0', sizeof (mbstate_t));
++				    rword_match = 1;
++				  }
++				else if (!iswalnum (nwc) && nwc != L'_')
++				  rword_match = 1;
++			      }
++			    else
++#endif /* MBS_SUPPORT */
++			    if (!WCHAR ((unsigned char) beg[start + len]))
++			      rword_match = 1;
++			  }
++
++			if (rword_match)
++			  {
++			    if (!exact)
++			      /* Returns the whole line. */
++			      goto success_in_beg_and_end;
++			    else
++			      /* Returns just this word match. */
++			      goto success_in_start_and_len;
++			  }
++		      }
+ 		    if (len > 0)
+ 		      {
+ 			/* Try a shorter length anchored at the same place. */
+@@ -461,26 +649,154 @@ EGexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ 	    }
+ 	} /* for Regex patterns.  */
+     } /* for (beg = end ..) */
+-#ifdef MBS_SUPPORT
+-  if (MB_CUR_MAX > 1 && mb_properties)
+-    free (mb_properties);
+-#endif /* MBS_SUPPORT */
++
++ failure:
+   return (size_t) -1;
+ 
+- success:
+-#ifdef MBS_SUPPORT
+-  if (MB_CUR_MAX > 1 && mb_properties)
+-    free (mb_properties);
+-#endif /* MBS_SUPPORT */
+-  *match_size = end - beg;
+-  return beg - buf;
++ success_in_beg_and_end:
++  len = end - beg;
++  start = beg - buf;
++  /* FALLTHROUGH */
++
++ success_in_start_and_len:
++  *match_size = len;
++  return start;
+ }
+ 
++#ifdef MBS_SUPPORT
++static int f_i_multibyte; /* whether we're using the new -Fi MB method */
++static struct
++{
++  wchar_t **patterns;
++  size_t count, maxlen;
++  unsigned char *match;
++} Fimb;
++#endif
++
+ static void
+ Fcompile (char const *pattern, size_t size)
+ {
++  int mb_cur_max = MB_CUR_MAX;
+   char const *beg, *lim, *err;
+ 
++  check_utf8 ();
++#ifdef MBS_SUPPORT
++  /* Support -F -i for UTF-8 input. */
++  if (match_icase && mb_cur_max > 1)
++    {
++      mbstate_t mbs;
++      wchar_t *wcpattern = xmalloc ((size + 1) * sizeof (wchar_t));
++      const char *patternend = pattern;
++      size_t wcsize;
++      kwset_t fimb_kwset = NULL;
++      char *starts = NULL;
++      wchar_t *wcbeg, *wclim;
++      size_t allocated = 0;
++
++      memset (&mbs, '\0', sizeof (mbs));
++# ifdef __GNU_LIBRARY__
++      wcsize = mbsnrtowcs (wcpattern, &patternend, size, size, &mbs);
++      if (patternend != pattern + size)
++	wcsize = (size_t) -1;
++# else
++      {
++	char *patterncopy = xmalloc (size + 1);
++
++	memcpy (patterncopy, pattern, size);
++	patterncopy[size] = '\0';
++	patternend = patterncopy;
++	wcsize = mbsrtowcs (wcpattern, &patternend, size, &mbs);
++	if (patternend != patterncopy + size)
++	  wcsize = (size_t) -1;
++	free (patterncopy);
++      }
++# endif
++      if (wcsize + 2 <= 2)
++	{
++fimb_fail:
++	  free (wcpattern);
++	  free (starts);
++	  if (fimb_kwset)
++	    kwsfree (fimb_kwset);
++	  free (Fimb.patterns);
++	  Fimb.patterns = NULL;
++	}
++      else
++	{
++	  if (!(fimb_kwset = kwsalloc (NULL)))
++	    error (2, 0, _("memory exhausted"));
++
++	  starts = xmalloc (mb_cur_max * 3);
++	  wcbeg = wcpattern;
++	  do
++	    {
++	      int i;
++	      size_t wclen;
++
++	      if (Fimb.count >= allocated)
++		{
++		  if (allocated == 0)
++		    allocated = 128;
++		  else
++		    allocated *= 2;
++		  Fimb.patterns = xrealloc (Fimb.patterns,
++					    sizeof (wchar_t *) * allocated);
++		}
++	      Fimb.patterns[Fimb.count++] = wcbeg;
++	      for (wclim = wcbeg;
++		   wclim < wcpattern + wcsize && *wclim != L'\n'; ++wclim)
++		*wclim = towlower (*wclim);
++	      *wclim = L'\0';
++	      wclen = wclim - wcbeg;
++	      if (wclen > Fimb.maxlen)
++		Fimb.maxlen = wclen;
++	      if (wclen > 3)
++		wclen = 3;
++	      if (wclen == 0)
++		{
++		  if ((err = kwsincr (fimb_kwset, "", 0)) != 0)
++		    error (2, 0, err);
++		}
++	      else
++		for (i = 0; i < (1 << wclen); i++)
++		  {
++		    char *p = starts;
++		    int j, k;
++
++		    for (j = 0; j < wclen; ++j)
++		      {
++			wchar_t wc = wcbeg[j];
++			if (i & (1 << j))
++			  {
++			    wc = towupper (wc);
++			    if (wc == wcbeg[j])
++			      continue;
++			  }
++			k = wctomb (p, wc);
++			if (k <= 0)
++			  goto fimb_fail;
++			p += k;
++		      }
++		    if ((err = kwsincr (fimb_kwset, starts, p - starts)) != 0)
++		      error (2, 0, err);
++		  }
++	      if (wclim < wcpattern + wcsize)
++		++wclim;
++	      wcbeg = wclim;
++	    }
++	  while (wcbeg < wcpattern + wcsize);
++	  f_i_multibyte = 1;
++	  kwset = fimb_kwset;
++	  free (starts);
++	  Fimb.match = xmalloc (Fimb.count);
++	  if ((err = kwsprep (kwset)) != 0)
++	    error (2, 0, err);
++	  return;
++	}
++    }
++#endif /* MBS_SUPPORT */
++
++
+   kwsinit ();
+   beg = pattern;
+   do
+@@ -499,6 +815,76 @@ Fcompile (char const *pattern, size_t size)
+     error (2, 0, err);
+ }
+ 
++#ifdef MBS_SUPPORT
++static int
++Fimbexec (const char *buf, size_t size, size_t *plen, int exact)
++{
++  size_t len, letter, i;
++  int ret = -1;
++  mbstate_t mbs;
++  wchar_t wc;
++  int patterns_left;
++
++  assert (match_icase && f_i_multibyte == 1);
++  assert (MB_CUR_MAX > 1);
++
++  memset (&mbs, '\0', sizeof (mbs));
++  memset (Fimb.match, '\1', Fimb.count);
++  letter = len = 0;
++  patterns_left = 1;
++  while (patterns_left && len <= size)
++    {
++      size_t c;
++
++      patterns_left = 0;
++      if (len < size)
++	{
++	  c = mbrtowc (&wc, buf + len, size - len, &mbs);
++	  if (c + 2 <= 2)
++	    return ret;
++
++	  wc = towlower (wc);
++	}
++      else
++	{
++	  c = 1;
++	  wc = L'\0';
++	}
++
++      for (i = 0; i < Fimb.count; i++)
++	{
++	  if (Fimb.match[i])
++	    {
++	      if (Fimb.patterns[i][letter] == L'\0')
++		{
++		  /* Found a match. */
++		  *plen = len;
++		  if (!exact && !match_words)
++		    return 0;
++		  else
++		    {
++		      /* For -w or exact look for longest match.  */
++		      ret = 0;
++		      Fimb.match[i] = '\0';
++		      continue;
++		    }
++		}
++
++	      if (Fimb.patterns[i][letter] == wc)
++		patterns_left = 1;
++	      else
++		Fimb.match[i] = '\0';
++	    }
++	}
++
++      len += c;
++      letter++;
++    }
++
++  return ret;
++}
++#endif /* MBS_SUPPORT */
++
+ static size_t
+ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
+ {
+@@ -506,88 +892,268 @@ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
+   register size_t len;
+   char eol = eolbyte;
+   struct kwsmatch kwsmatch;
++  size_t ret_val;
+ #ifdef MBS_SUPPORT
+-  char *mb_properties;
+-  if (MB_CUR_MAX > 1)
+-    mb_properties = check_multibyte_string (buf, size);
++  int mb_cur_max = MB_CUR_MAX;
++  mbstate_t mbs;
++  memset (&mbs, '\0', sizeof (mbstate_t));
++  const char *last_char = NULL;
+ #endif /* MBS_SUPPORT */
+ 
+-  for (beg = buf; beg <= buf + size; ++beg)
++  for (beg = buf; beg < buf + size; ++beg)
+     {
+-      size_t offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch);
++      size_t offset;
++      offset = kwsexec (kwset, beg, buf + size - beg, &kwsmatch);
++
+       if (offset == (size_t) -1)
+-	{
++	goto failure;
+ #ifdef MBS_SUPPORT
+-	  if (MB_CUR_MAX > 1)
+-	    free(mb_properties);
+-#endif /* MBS_SUPPORT */
+-	  return offset;
++      if (mb_cur_max > 1 && !using_utf8)
++	{
++	  size_t bytes_left = offset;
++	  while (bytes_left)
++	    {
++	      size_t mlen = mbrlen (beg, bytes_left, &mbs);
++
++	      last_char = beg;
++	      if (mlen == (size_t) -1 || mlen == 0)
++		{
++		  /* Incomplete character: treat as single-byte. */
++		  memset (&mbs, '\0', sizeof (mbstate_t));
++		  beg++;
++		  bytes_left--;
++		  continue;
++		}
++
++	      if (mlen == (size_t) -2)
++		/* Offset points inside multibyte character: no good. */
++		break;
++
++	      beg += mlen;
++	      bytes_left -= mlen;
++	    }
++
++	  if (bytes_left)
++	    continue;
+ 	}
+-#ifdef MBS_SUPPORT
+-      if (MB_CUR_MAX > 1 && mb_properties[offset+beg-buf] == 0)
+-	continue; /* It is a part of multibyte character.  */
++      else
+ #endif /* MBS_SUPPORT */
+       beg += offset;
+-      len = kwsmatch.size[0];
+-      if (exact)
+-	{
+-	  *match_size = len;
+ #ifdef MBS_SUPPORT
+-	  if (MB_CUR_MAX > 1)
+-	    free (mb_properties);
++      /* For f_i_multibyte, the string at beg now matches first 3 chars of
++	 one of the search strings (less if there are shorter search strings).
++	 See if this is a real match.  */
++      if (f_i_multibyte
++	  && Fimbexec (beg, buf + size - beg, &kwsmatch.size[0], exact))
++	goto next_char;
+ #endif /* MBS_SUPPORT */
+-	  return beg - buf;
+-	}
++      len = kwsmatch.size[0];
++      if (exact && !match_words)
++	goto success_in_beg_and_len;
+       if (match_lines)
+ 	{
+ 	  if (beg > buf && beg[-1] != eol)
+-	    continue;
++	    goto next_char;
+ 	  if (beg + len < buf + size && beg[len] != eol)
+-	    continue;
++	    goto next_char;
+ 	  goto success;
+ 	}
+       else if (match_words)
+-	for (try = beg; len; )
+-	  {
+-	    if (try > buf && WCHAR((unsigned char) try[-1]))
+-	      break;
+-	    if (try + len < buf + size && WCHAR((unsigned char) try[len]))
+-	      {
+-		offset = kwsexec (kwset, beg, --len, &kwsmatch);
+-		if (offset == (size_t) -1)
+-		  {
++	{
++	  while (len)
++	    {
++	      int word_match = 0;
++	      if (beg > buf)
++		{
+ #ifdef MBS_SUPPORT
+-		    if (MB_CUR_MAX > 1)
+-		      free (mb_properties);
++		  if (mb_cur_max > 1)
++		    {
++		      const char *s;
++		      int mr;
++		      wchar_t pwc;
++
++		      if (using_utf8)
++			{
++			  s = beg - 1;
++			  while (s > buf
++				 && (unsigned char) *s >= 0x80
++				 && (unsigned char) *s <= 0xbf)
++			    --s;
++			}
++		      else
++			s = last_char;
++		      mr = mbtowc (&pwc, s, beg - s);
++		      if (mr <= 0)
++			memset (&mbs, '\0', sizeof (mbstate_t));
++		      else if ((iswalnum (pwc) || pwc == L'_')
++			       && mr == (int) (beg - s))
++			goto next_char;
++		    }
++		  else
+ #endif /* MBS_SUPPORT */
+-		    return offset;
+-		  }
+-		try = beg + offset;
+-		len = kwsmatch.size[0];
+-	      }
+-	    else
+-	      goto success;
+-	  }
++		  if (WCHAR ((unsigned char) beg[-1]))
++		    goto next_char;
++		}
++#ifdef MBS_SUPPORT
++	      if (mb_cur_max > 1)
++		{
++		  wchar_t nwc;
++		  int mr;
++
++		  mr = mbtowc (&nwc, beg + len, buf + size - beg - len);
++		  if (mr <= 0)
++		    {
++		      memset (&mbs, '\0', sizeof (mbstate_t));
++		      word_match = 1;
++		    }
++		  else if (!iswalnum (nwc) && nwc != L'_')
++		    word_match = 1;
++		}
++	      else
++#endif /* MBS_SUPPORT */
++		if (beg + len >= buf + size || !WCHAR ((unsigned char) beg[len]))
++		  word_match = 1;
++	      if (word_match)
++		{
++		  if (!exact)
++		    /* Returns the whole line now we know there's a word match. */
++		    goto success;
++		  else
++		    /* Returns just this word match. */
++		    goto success_in_beg_and_len;
++		}
++	      if (len > 0)
++		{
++		  /* Try a shorter length anchored at the same place. */
++		  --len;
++		  offset = kwsexec (kwset, beg, len, &kwsmatch);
++
++		  if (offset == -1)
++		    goto next_char; /* Try a different anchor. */
++#ifdef MBS_SUPPORT
++		  if (mb_cur_max > 1 && !using_utf8)
++		    {
++		      size_t bytes_left = offset;
++		      while (bytes_left)
++			{
++			  size_t mlen = mbrlen (beg, bytes_left, &mbs);
++
++			  last_char = beg;
++			  if (mlen == (size_t) -1 || mlen == 0)
++			    {
++			      /* Incomplete character: treat as single-byte. */
++			      memset (&mbs, '\0', sizeof (mbstate_t));
++			      beg++;
++			      bytes_left--;
++			      continue;
++			    }
++
++			  if (mlen == (size_t) -2)
++			    {
++			      /* Offset points inside multibyte character:
++			       * no good. */
++			      break;
++			    }
++
++			  beg += mlen;
++			  bytes_left -= mlen;
++			}
++
++		      if (bytes_left)
++			{
++			  memset (&mbs, '\0', sizeof (mbstate_t));
++			  goto next_char; /* Try a different anchor. */
++			}
++		    }
++		  else
++#endif /* MBS_SUPPORT */
++		  beg += offset;
++#ifdef MBS_SUPPORT
++		  /* The string at beg now matches first 3 chars of one of
++		     the search strings (less if there are shorter search
++		     strings).  See if this is a real match.  */
++		  if (f_i_multibyte
++		      && Fimbexec (beg, len - offset, &kwsmatch.size[0],
++				   exact))
++		    goto next_char;
++#endif /* MBS_SUPPORT */
++		  len = kwsmatch.size[0];
++		}
++	    }
++	}
+       else
+ 	goto success;
+-    }
+-
++next_char:;
+ #ifdef MBS_SUPPORT
+-  if (MB_CUR_MAX > 1)
+-    free (mb_properties);
++      /* Advance to next character.  For MB_CUR_MAX == 1 case this is handled
++	 by ++beg above.  */
++      if (mb_cur_max > 1)
++	{
++	  if (using_utf8)
++	    {
++	      unsigned char c = *beg;
++	      if (c >= 0xc2)
++		{
++		  if (c < 0xe0)
++		    ++beg;
++		  else if (c < 0xf0)
++		    beg += 2;
++		  else if (c < 0xf8)
++		    beg += 3;
++		  else if (c < 0xfc)
++		    beg += 4;
++		  else if (c < 0xfe)
++		    beg += 5;
++		}
++	    }
++	  else
++	    {
++	      size_t l = mbrlen (beg, buf + size - beg, &mbs);
++
++	      last_char = beg;
++	      if (l + 2 >= 2)
++		beg += l - 1;
++	      else
++		memset (&mbs, '\0', sizeof (mbstate_t));
++	    }
++	}
+ #endif /* MBS_SUPPORT */
++    }
++
++ failure:
+   return -1;
+ 
+  success:
++#ifdef MBS_SUPPORT
++  if (mb_cur_max > 1 && !using_utf8)
++    {
++      end = beg + len;
++      while (end < buf + size)
++	{
++	  size_t mlen = mbrlen (end, buf + size - end, &mbs);
++	  if (mlen == (size_t) -1 || mlen == (size_t) -2 || mlen == 0)
++	    {
++	      memset (&mbs, '\0', sizeof (mbstate_t));
++	      mlen = 1;
++	    }
++	  if (mlen == 1 && *end == eol)
++	    break;
++
++	  end += mlen;
++	}
++    }
++  else
++#endif /* MBS_SUPPORT */
+   end = memchr (beg + len, eol, (buf + size) - (beg + len));
++
+   end++;
+   while (buf < beg && beg[-1] != eol)
+     --beg;
+-  *match_size = end - beg;
+-#ifdef MBS_SUPPORT
+-  if (MB_CUR_MAX > 1)
+-    free (mb_properties);
+-#endif /* MBS_SUPPORT */
++  len = end - beg;
++  /* FALLTHROUGH */
++
++ success_in_beg_and_len:
++  *match_size = len;
+   return beg - buf;
+ }
+ 
+@@ -701,8 +1267,9 @@ Pexecute (char const *buf, size_t size, size_t *match_size, int exact)
+       char eol = eolbyte;
+       if (!exact)
+ 	{
+-	  end = memchr (end, eol, buflim - end);
+-	  end++;
++	  while (end < buflim)
++	    if (*end++ == eol)
++	      break;
+ 	  while (buf < beg && beg[-1] != eol)
+ 	    --beg;
+ 	}
+-- 
+1.8.4.2
+
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch b/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..3ccce5f
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/grep_fix_for_automake-1.12.patch
@@ -0,0 +1,52 @@
+Upstream-Status: Pending
+
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:33: error: automatic de-ANSI-fication support has been removed
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/aclocal-1.12/protos.m4:12: AM_C_PROTOTYPES is expanded from...
+| configure.in:33: the top level
+| autom4te: m4 failed with exit status: 1
+...
+| lib/Makefile.am:2: error: automatic de-ANSI-fication support has been removed
+| src/Makefile.am:2: error: automatic de-ANSI-fication support has been removed
+| autoreconf: automake failed with exit status: 1
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/04
+
+Index: grep-2.5.1a/configure.in
+===================================================================
+--- grep-2.5.1a.orig/configure.in
++++ grep-2.5.1a/configure.in
+@@ -30,7 +30,6 @@ AC_PROG_RANLIB
+ 
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_SYS_LARGEFILE
+-AM_C_PROTOTYPES
+ AC_TYPE_SIZE_T
+ AC_CHECK_TYPE(ssize_t, int)
+ AC_C_CONST
+Index: grep-2.5.1a/lib/Makefile.am
+===================================================================
+--- grep-2.5.1a.orig/lib/Makefile.am
++++ grep-2.5.1a/lib/Makefile.am
+@@ -1,5 +1,5 @@
+ #
+-AUTOMAKE_OPTIONS = ../src/ansi2knr
++AUTOMAKE_OPTIONS = 
+ 
+ SUBDIRS = posix
+ 
+Index: grep-2.5.1a/src/Makefile.am
+===================================================================
+--- grep-2.5.1a.orig/src/Makefile.am
++++ grep-2.5.1a/src/Makefile.am
+@@ -1,5 +1,5 @@
+ ## Process this file with automake to create Makefile.in
+-AUTOMAKE_OPTIONS = ansi2knr no-dependencies
++AUTOMAKE_OPTIONS = no-dependencies
+ 
+ LN = ln
+ 
diff --git a/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch b/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
new file mode 100644
index 0000000..de054fc
--- /dev/null
+++ b/meta/recipes-extended/grep/grep-2.5.1a/uclibc-fix.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Fix to use mempcpy instead of __mempcpy. This is needed for uclibc which
+# doesn't define __mempcpy, only mempcpy. Since both uclibc and glibc have
+# mempcpy, we'll just use that instead.
+# Patch source: OpenEmbedded
+
+Index: grep-2.5.1/intl/localealias.c
+===================================================================
+--- grep-2.5.1.orig/intl/localealias.c	2002-03-14 00:39:06.000000000 +1100
++++ grep-2.5.1/intl/localealias.c	2007-05-17 13:53:58.000000000 +1000
+@@ -65,7 +65,7 @@
+ # define strcasecmp __strcasecmp
+ 
+ # ifndef mempcpy
+-#  define mempcpy __mempcpy
++#  error "mempcpy not detected"
+ # endif
+ # define HAVE_MEMPCPY	1
+ # define HAVE___FSETLOCKING	1
+Index: grep-2.5.1/lib/getopt.c
+===================================================================
+--- grep-2.5.1.orig/lib/getopt.c	2001-03-04 16:33:12.000000000 +1100
++++ grep-2.5.1/lib/getopt.c	2007-05-17 13:51:44.000000000 +1000
+@@ -326,7 +326,7 @@
+ 	nonoption_flags_len = nonoption_flags_max_len = 0;
+       else
+ 	{
+-	  memset (__mempcpy (new_str, __getopt_nonoption_flags,
++	  memset (mempcpy (new_str, __getopt_nonoption_flags,
+ 			     nonoption_flags_max_len),
+ 		  '\0', top + 1 - nonoption_flags_max_len);
+ 	  nonoption_flags_max_len = top + 1;
+@@ -437,7 +437,7 @@
+ 	      if (__getopt_nonoption_flags == NULL)
+ 		nonoption_flags_max_len = -1;
+ 	      else
+-		memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
++		memset (mempcpy (__getopt_nonoption_flags, orig_str, len),
+ 			'\0', nonoption_flags_max_len - len);
+ 	    }
+ 	}
+Index: grep-2.5.1/lib/regex.c
+===================================================================
+--- grep-2.5.1.orig/lib/regex.c	2001-04-03 04:04:45.000000000 +1000
++++ grep-2.5.1/lib/regex.c	2007-05-17 13:51:48.000000000 +1000
+@@ -7842,7 +7842,7 @@
+       if (msg_size > errbuf_size)
+         {
+ #if defined HAVE_MEMPCPY || defined _LIBC
+-	  *((char *) __mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
++	  *((char *) mempcpy (errbuf, msg, errbuf_size - 1)) = '\0';
+ #else
+           memcpy (errbuf, msg, errbuf_size - 1);
+           errbuf[errbuf_size - 1] = 0;
diff --git a/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..ba1a4ba
--- /dev/null
+++ b/meta/recipes-extended/grep/grep/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/grep/grep/grep-fix-CVE-2015-1345.patch b/meta/recipes-extended/grep/grep/grep-fix-CVE-2015-1345.patch
new file mode 100644
index 0000000..e88a988
--- /dev/null
+++ b/meta/recipes-extended/grep/grep/grep-fix-CVE-2015-1345.patch
@@ -0,0 +1,154 @@
+Upstream-Status: Backport
+
+Backport patch to fix CVE-2015-1345.
+http://git.savannah.gnu.org/cgit/grep.git/commit/?id=83a95bd
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From 83a95bd8c8561875b948cadd417c653dbe7ef2e2 Mon Sep 17 00:00:00 2001
+From: Yuliy Pisetsky <ypisetsky@fb.com>
+Date: Thu, 1 Jan 2015 15:36:55 -0800
+Subject: [PATCH] grep -F: fix a heap buffer (read) overrun
+
+grep's read buffer is often filled to its full size, except when
+reading the final buffer of a file.  In that case, the number of
+bytes read may be far less than the size of the buffer.  However, for
+certain unusual pattern/text combinations, grep -F would mistakenly
+examine bytes in that uninitialized region of memory when searching
+for a match.  With carefully chosen inputs, one can cause grep -F to
+read beyond the end of that buffer altogether.  This problem arose via
+commit v2.18-90-g73893ff with the introduction of a more efficient
+heuristic using what is now the memchr_kwset function. The use of
+that function in bmexec_trans could leave TP much larger than EP,
+and the subsequent call to bm_delta2_search would mistakenly access
+beyond end of the main input read buffer.
+
+* src/kwset.c (bmexec_trans): When TP reaches or exceeds EP,
+do not call bm_delta2_search.
+* tests/kwset-abuse: New file.
+* tests/Makefile.am (TESTS): Add it.
+* THANKS.in: Update.
+* NEWS (Bug fixes): Mention it.
+
+Prior to this patch, this command would trigger a UMR:
+
+  printf %0360db 0 | valgrind src/grep -F $(printf %019dXb 0)
+
+  Use of uninitialised value of size 8
+     at 0x4142BE: bmexec_trans (kwset.c:657)
+     by 0x4143CA: bmexec (kwset.c:678)
+     by 0x414973: kwsexec (kwset.c:848)
+     by 0x414DC4: Fexecute (kwsearch.c:128)
+     by 0x404E2E: grepbuf (grep.c:1238)
+     by 0x4054BF: grep (grep.c:1417)
+     by 0x405CEB: grepdesc (grep.c:1645)
+     by 0x405EC1: grep_command_line_arg (grep.c:1692)
+     by 0x4077D4: main (grep.c:2570)
+
+See the accompanying test for how to trigger the heap buffer overrun.
+
+Thanks to Nima Aghdaii for testing and finding numerous
+ways to break early iterations of this patch.
+---
+ NEWS              |  5 +++++
+ THANKS.in         |  1 +
+ src/kwset.c       |  2 ++
+ tests/Makefile.am |  1 +
+ tests/kwset-abuse | 32 ++++++++++++++++++++++++++++++++
+ 5 files changed, 41 insertions(+)
+ create mode 100755 tests/kwset-abuse
+
+diff --git a/NEWS b/NEWS
+index 975440d..3835d8d 100644
+--- a/NEWS
++++ b/NEWS
+@@ -2,6 +2,11 @@ GNU grep NEWS                                    -*- outline -*-
+ 
+ * Noteworthy changes in release ?.? (????-??-??) [?]
+ 
++** Bug fixes
++
++  grep no longer reads from uninitialized memory or from beyond the end
++  of the heap-allocated input buffer.
++
+ 
+ * Noteworthy changes in release 2.21 (2014-11-23) [stable]
+ 
+diff --git a/THANKS.in b/THANKS.in
+index aeaf516..624478d 100644
+--- a/THANKS.in
++++ b/THANKS.in
+@@ -62,6 +62,7 @@ Michael Aichlmayr                   mikla@nx.com
+ Miles Bader                         miles@ccs.mt.nec.co.jp
+ Mirraz Mirraz                       mirraz1@rambler.ru
+ Nelson H. F. Beebe                  beebe@math.utah.edu
++Nima Aghdaii                        naghdaii@fb.com
+ Olaf Kirch                          okir@ns.lst.de
+ Paul Kimoto                         kimoto@spacenet.tn.cornell.edu
+ Péter Radics                        mitchnull@gmail.com
+diff --git a/src/kwset.c b/src/kwset.c
+index 4003c8d..376f7c3 100644
+--- a/src/kwset.c
++++ b/src/kwset.c
+@@ -643,6 +643,8 @@ bmexec_trans (kwset_t kwset, char const *text, size_t size)
+                     if (! tp)
+                       return -1;
+                     tp++;
++                    if (ep <= tp)
++                      break;
+                   }
+               }
+           }
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 2cba2cd..0508cd2 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -75,6 +75,7 @@ TESTS =						\
+   inconsistent-range				\
+   invalid-multibyte-infloop			\
+   khadafy					\
++  kwset-abuse					\
+   long-line-vs-2GiB-read			\
+   match-lines					\
+   max-count-overread				\
+diff --git a/tests/kwset-abuse b/tests/kwset-abuse
+new file mode 100755
+index 0000000..6d8ec0c
+--- /dev/null
++++ b/tests/kwset-abuse
+@@ -0,0 +1,32 @@
++#! /bin/sh
++# Evoke a segfault in a hard-to-reach code path of kwset.c.
++# This bug affected grep versions 2.19 through 2.21.
++#
++# Copyright (C) 2015 Free Software Foundation, Inc.
++#
++# This program is free software: you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation, either version 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/>.
++
++. "${srcdir=.}/init.sh"; path_prepend_ ../src
++
++fail=0
++
++# This test case chooses a haystack of size 260,000, since prodding
++# with gdb showed a reallocation slightly larger than that in fillbuf.
++# To reach the buggy code, the needle must have length < 1/11 that of
++# the haystack, and 10,000 is a nice round number that fits the bill.
++printf '%0260000dXy\n' 0 | grep -F $(printf %010000dy 0)
++
++test $? = 1 || fail=1
++
++Exit $fail
+-- 
+2.4.1
+
diff --git a/meta/recipes-extended/grep/grep_2.21.bb b/meta/recipes-extended/grep/grep_2.21.bb
new file mode 100644
index 0000000..3661098
--- /dev/null
+++ b/meta/recipes-extended/grep/grep_2.21.bb
@@ -0,0 +1,42 @@
+SUMMARY = "GNU grep utility"
+HOMEPAGE = "http://savannah.gnu.org/projects/grep/"
+BUGTRACKER = "http://savannah.gnu.org/bugs/?group=grep"
+SECTION = "console/utils"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8006d9c814277c1bfc4ca22af94b59ee"
+
+SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.xz \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           file://grep-fix-CVE-2015-1345.patch \
+          "
+
+SRC_URI[md5sum] = "43c48064d6409862b8a850db83c8038a"
+SRC_URI[sha256sum] = "5244a11c00dee8e7e5e714b9aaa053ac6cbfa27e104abee20d3c778e4bb0e5de"
+
+inherit autotools gettext texinfo
+
+EXTRA_OECONF = "--disable-perl-regexp"
+
+do_configure_prepend () {
+	rm -f ${S}/m4/init.m4
+}
+
+do_install () {
+	autotools_do_install
+	install -d ${D}${base_bindir}
+	mv ${D}${bindir}/grep ${D}${base_bindir}/grep
+	mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
+	mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
+	rmdir ${D}${bindir}/
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "grep egrep fgrep"
+ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
+ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
+ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/meta/recipes-extended/grep/grep_2.5.1a.bb b/meta/recipes-extended/grep/grep_2.5.1a.bb
new file mode 100644
index 0000000..5a2da28
--- /dev/null
+++ b/meta/recipes-extended/grep/grep_2.5.1a.bb
@@ -0,0 +1,56 @@
+SUMMARY = "Pattern matching utilities"
+DESCRIPTION = "The GNU versions of commonly used grep utilities.  The grep command searches one or more input \
+files for lines containing a match to a specified pattern."
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+PR = "r2"
+
+SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.bz2 \
+           file://uclibc-fix.patch \
+           file://grep_fix_for_automake-1.12.patch \
+           file://gettext.patch \
+           file://fix64-int-to-pointer.patch \
+           file://Makevars \
+           file://grep-CVE-2012-5667.patch \
+           file://fix-for-texinfo-5.1.patch \
+           file://grep-egrep-fgrep-Fix-LSB-NG-cases.patch \
+          "
+
+SRC_URI[md5sum] = "52202fe462770fa6be1bb667bd6cf30c"
+SRC_URI[sha256sum] = "38c8a2bb9223d1fb1b10bdd607cf44830afc92fd451ac4cd07619bf92bdd3132"
+
+inherit autotools gettext texinfo
+
+EXTRA_OECONF_INCLUDED_REGEX = "--without-included-regex"
+EXTRA_OECONF_INCLUDED_REGEX_libc-musl = "--with-included-regex"
+
+EXTRA_OECONF = "--disable-perl-regexp \
+                ${EXTRA_OECONF_INCLUDED_REGEX}"
+
+CFLAGS += "-D PROTOTYPES"
+do_configure_prepend () {
+	rm -f ${S}/m4/init.m4
+	cp -f ${WORKDIR}/Makevars ${S}/po/
+}
+
+do_install () {
+	autotools_do_install
+	install -d ${D}${base_bindir}
+	mv ${D}${bindir}/grep ${D}${base_bindir}/grep
+	mv ${D}${bindir}/egrep ${D}${base_bindir}/egrep
+	mv ${D}${bindir}/fgrep ${D}${base_bindir}/fgrep
+	rmdir ${D}${bindir}/
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "grep egrep fgrep"
+ALTERNATIVE_LINK_NAME[grep] = "${base_bindir}/grep"
+ALTERNATIVE_LINK_NAME[egrep] = "${base_bindir}/egrep"
+ALTERNATIVE_LINK_NAME[fgrep] = "${base_bindir}/fgrep"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch b/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch
new file mode 100644
index 0000000..559ae72
--- /dev/null
+++ b/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-fix-bindir.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+---
+ Makefile.sub |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/contrib/groffer/Makefile.sub
++++ b/contrib/groffer/Makefile.sub
+@@ -38,16 +38,16 @@ groffer: groffer.sh groffer2.sh version.
+ 	$(RM) $@;
+ 	sed \
+             -e "s|@g@|$(g)|g" \
+-	    -e "s|@BINDIR@|$(DESTDIR)$(bindir)|g" \
++	    -e "s|@BINDIR@|$(bindir)|g" \
+ 	    -e "s|@libdir@|$(DESTDIR)$(libdir)|g" \
+ 	    -e "s|@VERSION@|$(version)$(revision)|g" \
+ 	    $(srcdir)/groffer.sh >$@;
+ 	chmod +x $@
+ 
+ install_data: groffer
+-	-test -d $(DESTDIR)$(bindir) || $(mkinstalldirs) $(DESTDIR)$(bindir)
+-	-$(RM) $(DESTDIR)$(bindir)/groffer
+-	$(INSTALL_SCRIPT) groffer $(DESTDIR)$(bindir)/groffer
++	-test -d $(bindir) || $(mkinstalldirs) $(bindir)
++	-$(RM) $(bindir)/groffer
++	$(INSTALL_SCRIPT) groffer $(bindir)/groffer
+ 	-test -d $(DESTDIR)$(libdir)/groff/groffer || \
+           $(mkinstalldirs) $(DESTDIR)$(libdir)/groff/groffer
+ 	-$(RM) $(DESTDIR)$(libdir)/groff/groffer/groffer2.sh
+@@ -58,7 +58,7 @@ install_data: groffer
+ 	$(DESTDIR)$(libdir)/groff/groffer/version.sh
+ 
+ uninstall_sub:
+-	-$(RM) $(DESTDIR)$(bindir)/groffer
++	-$(RM) $(bindir)/groffer
+ 	-$(RM) $(DESTDIR)$(libdir)/groff/groffer/groffer2.sh
+ 	-$(RM) $(DESTDIR)$(libdir)/groff/groffer/version.sh
+ 	-rmdir $(DESTDIR)$(libdir)/groff/groffer
diff --git a/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch b/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch
new file mode 100644
index 0000000..c24eff9
--- /dev/null
+++ b/meta/recipes-extended/groff/groff-1.18.1.4/groff-1.18.1.4-remove-mom.patch
@@ -0,0 +1,39 @@
+
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ groff-1.18.1.4/Makefile.in |    7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -460,27 +460,22 @@ OTHERDIRS=\
+   src/roff/grog \
+   src/roff/nroff \
+   contrib/mm \
+   contrib/pic2graph \
+   contrib/eqn2graph \
+-  contrib/groffer \
+-  contrib/mom \
+-  doc
++  contrib/groffer
+ ALLDIRS=$(INCDIRS) $(LIBDIRS) $(PROGDIRS) \
+   $(DEVDIRS) $(OTHERDEVDIRS) $(TTYDEVDIRS) $(OTHERDIRS)
+ EXTRADIRS=\
+   font/devps/generate \
+   font/devdvi/generate \
+   font/devlj4/generate \
+-  src/xditview \
+   doc
+ NOMAKEDIRS=\
+   arch/djgpp \
+   contrib/mm/examples \
+   contrib/mm/mm \
+-  contrib/mom/examples \
+-  contrib/mom/momdoc \
+   src/libs/snprintf
+ DISTDIRS=\
+   $(INCDIRS) $(LIBDIRS) $(PROGDIRS) $(DEVDIRS) $(OTHERDEVDIRS) \
+   $(ALLTTYDEVDIRS) $(OTHERDIRS) $(EXTRADIRS) $(NOMAKEDIRS)
+ TARGETS=all install install_bin install_data clean distclean mostlyclean \
diff --git a/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch b/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch
new file mode 100644
index 0000000..e3f1aa6
--- /dev/null
+++ b/meta/recipes-extended/groff/groff-1.18.1.4/man-local.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: groff-1.18.1.4/tmac/man.local
+===================================================================
+--- groff-1.18.1.4.orig/tmac/man.local	2000-10-26 22:15:17.000000000 +0800
++++ groff-1.18.1.4/tmac/man.local	2010-08-24 14:17:52.070006664 +0800
+@@ -1,2 +1,27 @@
+ .\" This file is loaded after an-old.tmac.
+ .\" Put any local modifications to an-old.tmac here.
++.
++.if n \{\
++.  \" Debian: Map \(oq to ' rather than ` in nroff mode for devices other
++.  \" than utf8.
++.  if !'\*[.T]'utf8' \
++.    tr \[oq]'
++.
++.  \" Debian: Disable the use of SGR (ANSI colour) escape sequences by
++.  \" grotty.
++.  if '\V[GROFF_SGR]'' \
++.    output x X tty: sgr 0
++.
++.  \" Debian: Map \- to the Unicode HYPHEN-MINUS character, to make
++.  \" searching in man pages easier.
++.  if '\*[.T]'utf8' \
++.    char \- \N'45'
++.
++.  \" Debian: Many UTF-8 man pages use "-" instead of "\-" for dashes such
++.  \" as those in command-line options. This is a bug in those pages, but
++.  \" too many fonts are missing the Unicode HYPHEN character, so we render
++.  \" this as the ASCII-compatible HYPHEN-MINUS instead.
++.  if '\*[.T]'utf8' \
++.    char - \N'45'
++.\}
++
diff --git a/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch b/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch
new file mode 100644
index 0000000..409c1a5
--- /dev/null
+++ b/meta/recipes-extended/groff/groff-1.18.1.4/mdoc-local.patch
@@ -0,0 +1,36 @@
+
+Upstream-Status: Inappropriate [embedded]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: groff-1.18.1.4/tmac/mdoc.local
+===================================================================
+--- groff-1.18.1.4.orig/tmac/mdoc.local	2001-03-23 08:17:51.000000000 +0800
++++ groff-1.18.1.4/tmac/mdoc.local	2010-08-24 14:20:22.014006846 +0800
+@@ -1,2 +1,26 @@
+ .\" This file is loaded after doc.tmac.
+ .\" Put any local modifications to doc.tmac here.
++.
++.if n \{\
++.  \" Debian: Map \(oq to ' rather than ` in nroff mode for devices other
++.  \" than utf8.
++.  if !'\*[.T]'utf8' \
++.    tr \[oq]'
++.
++.  \" Debian: Disable the use of SGR (ANSI colour) escape sequences by
++.  \" grotty.
++.  if '\V[GROFF_SGR]'' \
++.    output x X tty: sgr 0
++.
++.  \" Debian: Map \- to the Unicode HYPHEN-MINUS character, to make
++.  \" searching in man pages easier.
++.  if '\*[.T]'utf8' \
++.    char \- \N'45'
++.
++.  \" Debian: Many UTF-8 man pages use "-" instead of "\-" for dashes such
++.  \" as those in command-line options. This is a bug in those pages, but
++.  \" too many fonts are missing the Unicode HYPHEN character, so we render
++.  \" this as the ASCII-compatible HYPHEN-MINUS instead.
++.  if '\*[.T]'utf8' \
++.    char - \N'45'
++.\}
diff --git a/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..b61b432
--- /dev/null
+++ b/meta/recipes-extended/groff/groff-1.22.3/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: groff-1.22.3/src/libs/gnulib/lib/Makefile.am
+===================================================================
+--- groff-1.22.3.orig/src/libs/gnulib/lib/Makefile.am
++++ groff-1.22.3/src/libs/gnulib/lib/Makefile.am
+@@ -113,7 +113,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
diff --git a/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch b/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch
new file mode 100644
index 0000000..c73328a
--- /dev/null
+++ b/meta/recipes-extended/groff/groff-1.22.3/groff-1.22.2-correct-man.local-install-path.patch
@@ -0,0 +1,34 @@
+Correct the install path of man.local to fix following error:
+    /yocto/build/tmp/sysroots/x86_64-linux/usr/share/groff/1.22.2/tmac/an-old.tmac:690: warning: can't find macro file `man.local'
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+Upstream-Status: Pending
+
+diff --git a/tmac/Makefile.sub b/tmac/Makefile.sub
+index 1506232..f1468c5 100644
+--- a/tmac/Makefile.sub
++++ b/tmac/Makefile.sub
+@@ -121,9 +121,9 @@ install_data: $(NORMALFILES) $(SPECIALFILES) man.local \
+ 	  $(RM) $(DESTDIR)$(mdocdir)/$$f; \
+ 	  $(INSTALL_DATA) $$f-s $(DESTDIR)$(mdocdir)/$$f; \
+ 	done
+-	-test -f $(DESTDIR)$(localtmacdir)/man.local \
++	-test -f $(DESTDIR)$(tmacdir)/man.local \
+ 	  || $(INSTALL_DATA) $(srcdir)/man.local \
+-	       $(DESTDIR)$(localtmacdir)/man.local
++	       $(DESTDIR)$(tmacdir)/man.local
+ 	-test -f $(DESTDIR)$(localtmacdir)/mdoc.local \
+ 	  || $(INSTALL_DATA) mdoc.local-s $(DESTDIR)$(localtmacdir)/mdoc.local
+ 
+@@ -164,9 +164,9 @@ uninstall_sub:
+ 	$(RM) $(DESTDIR)$(tmacdir)/$(tmac_s_prefix)s.tmac
+ 	$(RM) $(DESTDIR)$(tmacdir)/$(tmac_an_prefix)an.tmac
+ 	$(RM) $(DESTDIR)$(tmacdir)/www.tmac
+-	-if cmp -s $(DESTDIR)$(localtmacdir)/man.local \
++	-if cmp -s $(DESTDIR)$(tmacdir)/man.local \
+ 	           $(srcdir)/man.local; then \
+-	  $(RM) $(DESTDIR)$(localtmacdir)/man.local; \
++	  $(RM) $(DESTDIR)$(tmacdir)/man.local; \
+ 	fi
+ 	-if cmp -s $(DESTDIR)$(localtmacdir)/mdoc.local \
+ 	           $(srcdir)/mdoc.local; then \
diff --git a/meta/recipes-extended/groff/groff_1.18.1.4.bb b/meta/recipes-extended/groff/groff_1.18.1.4.bb
new file mode 100644
index 0000000..bd786a3
--- /dev/null
+++ b/meta/recipes-extended/groff/groff_1.18.1.4.bb
@@ -0,0 +1,49 @@
+SUMMARY = "GNU Troff software"
+DESCRIPTION = "The groff (GNU troff) software is a typesetting package which reads plain text mixed with \
+formatting commands and produces formatted output."
+SECTION = "console/utils"
+HOMEPAGE = "http://www.gnu.org/software/groff/"
+LICENSE = "GPLv2"
+PR = "r1"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e43fc16fccd8519fba405f0a0ff6e8a3"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/old/${BP}.tar.gz \
+          file://groff-1.18.1.4-remove-mom.patch;striplevel=1 \
+          file://man-local.patch \
+          file://mdoc-local.patch \
+          file://groff-1.18.1.4-fix-bindir.patch \
+" 
+
+inherit autotools texinfo
+
+EXTRA_OECONF="--without-x --prefix=${D} --exec-prefix=${D} --bindir=${D}${bindir} --datadir=${D}${datadir} --mandir=${D}${datadir}/man --infodir=${D}${datadir}info --with-appresdir=${D}${datadir}"
+
+SRC_URI[md5sum] = "ceecb81533936d251ed015f40e5f7287"
+SRC_URI[sha256sum] = "ff3c7c3b6cae5e8cc5062a144de5eff0022e8e970e1774529cc2d5dde46ce50d"
+PARALLEL_MAKE = ""
+
+do_configure (){
+    oe_runconf
+}
+
+do_install_append() {
+	# Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
+	# for target as /usr/bin/perl, so fix it to /usr/bin/perl.
+	for i in afmtodit mmroff; do
+		if [ -f ${D}${bindir}/$i ]; then
+			sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
+		fi
+	done
+
+	mkdir -p ${D}${sysconfdir}/groff
+	cp -rf ${D}${datadir}/groff/site-tmac/* ${D}${sysconfdir}/groff/
+	cp -rf ${D}${datadir}/groff/site-tmac/* ${D}${datadir}/groff/${PV}/tmac/
+}
+
+pkg_postinst_${PN}() {
+	ln -s tbl $D${bindir}/gtbl
+	echo "export GROFF_FONT_PATH=/usr/share/groff/${PV}/font" >> $D${sysconfdir}/profile
+	echo "export GROFF_TMAC_PATH=/usr/share/groff/${PV}/tmac" >> $D${sysconfdir}/profile
+}
+
diff --git a/meta/recipes-extended/groff/groff_1.22.3.bb b/meta/recipes-extended/groff/groff_1.22.3.bb
new file mode 100644
index 0000000..4bffa81
--- /dev/null
+++ b/meta/recipes-extended/groff/groff_1.22.3.bb
@@ -0,0 +1,70 @@
+SUMMARY = "GNU Troff software"
+DESCRIPTION = "The groff (GNU troff) software is a typesetting package which reads plain text mixed with \
+formatting commands and produces formatted output."
+SECTION = "base"
+HOMEPAGE = "http://www.gnu.org/software/groff/"
+LICENSE = "GPLv3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "${GNU_MIRROR}/groff/groff-${PV}.tar.gz \
+	file://groff-1.22.2-correct-man.local-install-path.patch \
+	file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+"
+
+SRC_URI[md5sum] = "cc825fa64bc7306a885f2fb2268d3ec5"
+SRC_URI[sha256sum] = "3a48a9d6c97750bfbd535feeb5be0111db6406ddb7bb79fc680809cda6d828a5"
+
+DEPENDS = "groff-native"
+DEPENDS_class-native = ""
+RDEPENDS_${PN} += "perl sed"
+
+inherit autotools texinfo
+
+EXTRA_OECONF = "--without-x"
+PARALLEL_MAKE = ""
+
+do_configure_prepend() {
+	if [ "${BUILD_SYS}" != "${HOST_SYS}" ]; then
+		sed -i \
+		    -e '/^GROFFBIN=/s:=.*:=${STAGING_BINDIR_NATIVE}/groff:' \
+		    -e '/^TROFFBIN=/s:=.*:=${STAGING_BINDIR_NATIVE}/troff:' \
+		    -e '/^GROFF_BIN_PATH=/s:=.*:=${STAGING_BINDIR_NATIVE}:' \
+		    -e '/^GROFF_BIN_DIR=/s:=.*:=${STAGING_BINDIR_NATIVE}:' \
+		    ${S}/contrib/*/Makefile.sub \
+		    ${S}/doc/Makefile.in \
+		    ${S}/doc/Makefile.sub
+	fi
+}
+
+do_configure_append() {
+    # generate gnulib configure script
+    olddir=`pwd`
+    cd ${S}/src/libs/gnulib/
+    ACLOCAL="$ACLOCAL" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed."
+    cd ${olddir}
+}
+
+do_install_append() {
+	# Some distros have both /bin/perl and /usr/bin/perl, but we set perl location
+	# for target as /usr/bin/perl, so fix it to /usr/bin/perl.
+	for i in afmtodit mmroff gropdf pdfmom grog; do
+		if [ -f ${D}${bindir}/$i ]; then
+			sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/$i
+		fi
+	done
+	if [ -e ${D}${libdir}/charset.alias ]; then
+		rm -rf ${D}${libdir}/charset.alias
+	fi
+}
+
+do_install_append_class-native() {
+	create_cmdline_wrapper ${D}/${bindir}/groff \
+		-F${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/font \
+		-M${STAGING_DIR_NATIVE}${datadir_native}/groff/${PV}/tmac
+}
+
+FILES_${PN} += "${libdir}/${BPN}/site-tmac \
+                ${libdir}/${BPN}/groffer/"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch b/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch
new file mode 100644
index 0000000..d9e8d21
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip-1.3.12/dup-def-fix.patch
@@ -0,0 +1,48 @@
+gzip uses gnulib, whose header conflict with glibc. This patch rename some function to avoid conflict.
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gzip-1.3.12/gzip.c
+===================================================================
+--- gzip-1.3.12.orig/gzip.c	2010-08-13 10:29:38.000000000 +0800
++++ gzip-1.3.12/gzip.c	2010-08-13 10:29:44.000000000 +0800
+@@ -1637,7 +1637,7 @@
+ 	}
+       }
+ 
+-    if (futimens (ofd, ofname, timespec) != 0)
++    if (futimens_gnulib (ofd, ofname, timespec) != 0)
+       {
+ 	int e = errno;
+ 	WARN ((stderr, "%s: ", program_name));
+Index: gzip-1.3.12/lib/utimens.c
+===================================================================
+--- gzip-1.3.12.orig/lib/utimens.c	2010-08-13 10:33:47.000000000 +0800
++++ gzip-1.3.12/lib/utimens.c	2010-08-13 10:34:02.000000000 +0800
+@@ -75,7 +75,7 @@
+    Return 0 on success, -1 (setting errno) on failure.  */
+ 
+ int
+-futimens (int fd ATTRIBUTE_UNUSED,
++futimens_gnulib (int fd ATTRIBUTE_UNUSED,
+ 	  char const *file, struct timespec const timespec[2])
+ {
+   /* Some Linux-based NFS clients are buggy, and mishandle time stamps
+@@ -185,5 +185,5 @@
+ int
+ utimens (char const *file, struct timespec const timespec[2])
+ {
+-  return futimens (-1, file, timespec);
++  return futimens_gnulib (-1, file, timespec);
+ }
+Index: gzip-1.3.12/lib/utimens.h
+===================================================================
+--- gzip-1.3.12.orig/lib/utimens.h	2010-08-13 10:14:57.000000000 +0800
++++ gzip-1.3.12/lib/utimens.h	2010-08-13 10:21:45.000000000 +0800
+@@ -1,3 +1,3 @@
+ #include <time.h>
+-int futimens (int, char const *, struct timespec const [2]);
++int futimens_gnulib (int, char const *, struct timespec const [2]);
+ int utimens (char const *, struct timespec const [2]);
diff --git a/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch b/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch
new file mode 100644
index 0000000..6b2f698
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip-1.3.12/m4-extensions-fix.patch
@@ -0,0 +1,56 @@
+remove AC_USE_SYSTEM_EXTENSIONS to fix the autoconf error "AC_REQUIRE: circular
+dependency of AC_GNU_SOURCE"
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Upstream-Status: Inappropriate [licensing]
+
+Index: gzip-1.3.12/m4/extensions.m4
+===================================================================
+--- gzip-1.3.12.orig/m4/extensions.m4	2010-08-16 14:18:16.000000000 +0800
++++ gzip-1.3.12/m4/extensions.m4	2010-08-16 14:21:54.000000000 +0800
+@@ -12,44 +12,6 @@
+ # enough in this area it's likely we'll need to redefine
+ # AC_USE_SYSTEM_EXTENSIONS for quite some time.
+ 
+-# AC_USE_SYSTEM_EXTENSIONS
+-# ------------------------
+-# Enable extensions on systems that normally disable them,
+-# typically due to standards-conformance issues.
+-AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+-[
+-  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+-  AC_BEFORE([$0], [AC_RUN_IFELSE])
+-
+-  AC_REQUIRE([AC_GNU_SOURCE])
+-  AC_REQUIRE([AC_AIX])
+-  AC_REQUIRE([AC_MINIX])
+-
+-  AH_VERBATIM([__EXTENSIONS__],
+-[/* Enable extensions on Solaris.  */
+-#ifndef __EXTENSIONS__
+-# undef __EXTENSIONS__
+-#endif
+-#ifndef _POSIX_PTHREAD_SEMANTICS
+-# undef _POSIX_PTHREAD_SEMANTICS
+-#endif
+-#ifndef _TANDEM_SOURCE
+-# undef _TANDEM_SOURCE
+-#endif])
+-  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+-    [ac_cv_safe_to_define___extensions__],
+-    [AC_COMPILE_IFELSE(
+-       [AC_LANG_PROGRAM([
+-#	  define __EXTENSIONS__ 1
+-	  AC_INCLUDES_DEFAULT])],
+-       [ac_cv_safe_to_define___extensions__=yes],
+-       [ac_cv_safe_to_define___extensions__=no])])
+-  test $ac_cv_safe_to_define___extensions__ = yes &&
+-    AC_DEFINE([__EXTENSIONS__])
+-  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+-  AC_DEFINE([_TANDEM_SOURCE])
+-])
+-
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
diff --git a/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch b/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch
new file mode 100644
index 0000000..92863d6
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip-1.6/wrong-path-fix.patch
@@ -0,0 +1,31 @@
+fix MakeMaker issues with using wrong SHELL/GREP
+
+A set of substitution is being processed to all target scripts with sed by
+replacing some key words with the detected values at configure time, this
+is exactly not compliant with cross compling, and will cause missing path
+errors at run time like:
+"/usr/bin/zgrep: line 230: /usr/bin/grep: No such file or directory"
+
+Fixed by removing unneeded substitution and using real runtime paths
+instead.
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+
+Upstream-Status: Pending
+
+Index: gzip-1.3.12/Makefile.am
+===================================================================
+diff -urpN a/Makefile.am b/Makefile.am
+--- a/Makefile.am	2013-11-30 10:06:09.402234871 +0800
++++ b/Makefile.am	2013-11-30 10:13:42.952236025 +0800
+@@ -81,9 +81,8 @@ gzip.doc.gz: gzip.doc $(bin_PROGRAMS)
+ SUFFIXES = .in
+ .in:
+ 	$(AM_V_GEN)sed \
+-		-e 's|/bin/sh|$(SHELL)|g' \
+ 		-e 's|[@]bindir@|'\''$(bindir)'\''|g' \
+-		-e 's|[@]GREP@|$(GREP)|g' \
++		-e 's|[@]GREP@|$(base_bindir)/grep|g' \
+ 		-e 's|[@]VERSION@|$(VERSION)|g' \
+ 		$(srcdir)/$@.in >$@-t \
+ 	  && chmod a+x $@-t \
diff --git a/meta/recipes-extended/gzip/gzip.inc b/meta/recipes-extended/gzip/gzip.inc
new file mode 100644
index 0000000..94480ec
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip.inc
@@ -0,0 +1,29 @@
+SUMMARY = "Standard GNU compressor"
+DESCRIPTION = "GNU Gzip is a popular data compression program originally written by Jean-loup Gailly for the GNU \
+project. Mark Adler wrote the decompression part"
+HOMEPAGE = "http://www.gnu.org/software/gzip/"
+SECTION = "console/utils"
+# change to GPLv3+ in 2007/07. Previous GPLv2 version is 1.3.12
+
+inherit autotools texinfo
+
+EXTRA_OEMAKE_class-target = "GREP=${base_bindir}/grep"
+
+do_install_append () {
+	# Rename and move files into /bin (FHS), which is typical place for gzip
+	install -d ${D}${base_bindir}
+	mv ${D}${bindir}/gunzip ${D}${base_bindir}/gunzip
+	mv ${D}${bindir}/gzip ${D}${base_bindir}/gzip
+	mv ${D}${bindir}/zcat ${D}${base_bindir}/zcat
+	mv ${D}${bindir}/uncompress ${D}${base_bindir}/uncompress
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "gunzip gzip zcat"
+ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip"
+ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip"
+ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/meta/recipes-extended/gzip/gzip_1.3.12.bb b/meta/recipes-extended/gzip/gzip_1.3.12.bb
new file mode 100644
index 0000000..e406282
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip_1.3.12.bb
@@ -0,0 +1,15 @@
+require gzip.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+                    file://gzip.h;endline=22;md5=c0934ad1900d927f86556153d4c76d23 \
+                    file://lzw.h;endline=19;md5=c273e09a02edd9801cc74d39683049e9 "
+
+SRC_URI = "${GNU_MIRROR}/gzip/gzip-${PV}.tar.gz \
+           file://m4-extensions-fix.patch \
+           file://dup-def-fix.patch"
+
+SRC_URI[md5sum] = "b5bac2d21840ae077e0217bc5e4845b1"
+SRC_URI[sha256sum] = "3f565be05f7f3d1aff117c030eb7c738300510b7d098cedea796ca8e4cd587af"
+
+PR = "r2"
diff --git a/meta/recipes-extended/gzip/gzip_1.6.bb b/meta/recipes-extended/gzip/gzip_1.6.bb
new file mode 100644
index 0000000..b347f0b
--- /dev/null
+++ b/meta/recipes-extended/gzip/gzip_1.6.bb
@@ -0,0 +1,17 @@
+require gzip.inc
+
+LICENSE = "GPLv3+"
+
+SRC_URI = "${GNU_MIRROR}/gzip/${BP}.tar.gz"
+SRC_URI_append_class-target = " file://wrong-path-fix.patch"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://gzip.h;beginline=8;endline=20;md5=6e47caaa630e0c8bf9f1bc8d94a8ed0e"
+
+PROVIDES_append_class-native = " gzip-replacement-native"
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "38603cb2843bf5681ff41aab3bcd6a20"
+SRC_URI[sha256sum] = "97eb83b763d9e5ad35f351fe5517e6b71521d7aac7acf3e3cacdb6b1496d8f7e"
diff --git a/meta/recipes-extended/hdparm/hdparm_9.48.bb b/meta/recipes-extended/hdparm/hdparm_9.48.bb
new file mode 100644
index 0000000..8267fd9
--- /dev/null
+++ b/meta/recipes-extended/hdparm/hdparm_9.48.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utility for viewing/manipulating IDE disk drive/driver parameters"
+DESCRIPTION = "hdparm is a Linux shell utility for viewing \
+and manipulating various IDE drive and driver parameters."
+SECTION = "console/utils"
+LICENSE = "BSD"
+LICENSE_wiper = "GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=910a8a42c962d238619c75fdb78bdb24 \
+                    file://debian/copyright;md5=a82d7ba3ade9e8ec902749db98c592f3 \
+                    file://wiper/GPLv2.txt;md5=fcb02dc552a041dee27e4b85c7396067 \
+                    file://wiper/wiper.sh;beginline=7;endline=31;md5=b7bc642addc152ea307505bf1a296f09"
+
+
+PACKAGES =+ "wiper"
+
+FILES_wiper = "${bindir}/wiper.sh"
+
+RDEPENDS_wiper = "bash gawk stat"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/hdparm/${BP}.tar.gz "
+
+SRC_URI[md5sum] = "213efdbe7471fad3408198918e164354"
+SRC_URI[sha256sum] = "ce97b4a71cb04146f54cf6f69787e7f97ddfda9836dc803b459d3b3df3a4fbee"
+
+EXTRA_OEMAKE += 'STRIP="echo"'
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "hdparm"
+ALTERNATIVE_LINK_NAME[hdparm] = "${base_sbindir}/hdparm"
+ALTERNATIVE_PRIORITY = "100"
+
+do_install () {
+	install -d ${D}/${base_sbindir} ${D}/${mandir}/man8 ${D}/${bindir}
+	oe_runmake 'DESTDIR=${D}' 'sbindir=${base_sbindir}' install
+	cp ${S}/wiper/wiper.sh ${D}/${bindir}
+}
diff --git a/meta/recipes-extended/images/core-image-full-cmdline.bb b/meta/recipes-extended/images/core-image-full-cmdline.bb
new file mode 100644
index 0000000..4d69073
--- /dev/null
+++ b/meta/recipes-extended/images/core-image-full-cmdline.bb
@@ -0,0 +1,12 @@
+DESCRIPTION = "A console-only image with more full-featured Linux system \
+functionality installed."
+
+IMAGE_FEATURES += "splash ssh-server-openssh"
+
+IMAGE_INSTALL = "\
+    packagegroup-core-boot \
+    packagegroup-core-full-cmdline \
+    ${CORE_IMAGE_EXTRA_INSTALL} \
+    "
+
+inherit core-image
diff --git a/meta/recipes-extended/images/core-image-kernel-dev.bb b/meta/recipes-extended/images/core-image-kernel-dev.bb
new file mode 100644
index 0000000..6b636ed
--- /dev/null
+++ b/meta/recipes-extended/images/core-image-kernel-dev.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "A development image that builds the kernel and packages that are \
+sensitive to kernel updates and version changes"
+
+# Could also be core-image-basic, but we'll keep this small for now
+require recipes-core/images/core-image-minimal.bb
+
+KERNEL_DEV_UTILS ?= "dropbear connman"
+KERNEL_DEV_TOOLS ?= "packagegroup-core-tools-profile packagegroup-core-buildessential kernel-devsrc"
+KERNEL_DEV_MODULE ?= "kernel-modules"
+
+CORE_IMAGE_EXTRA_INSTALL += "${KERNEL_DEV_MODULE} \
+                             ${KERNEL_DEV_UTILS} \
+                             ${KERNEL_DEV_TOOLS} \
+                            "
+
+# We need extra space for things like kernel builds, etc.
+IMAGE_ROOTFS_EXTRA_SPACE_append += "+ 3000000"
+
+# Let's define our own subset to test, we can later add a on-target kernel build even!
+DEFAULT_TEST_SUITES = "ping ssh df connman syslog scp date dmesg parselogs"
diff --git a/meta/recipes-extended/images/core-image-lsb-dev.bb b/meta/recipes-extended/images/core-image-lsb-dev.bb
new file mode 100644
index 0000000..d2dc9e2
--- /dev/null
+++ b/meta/recipes-extended/images/core-image-lsb-dev.bb
@@ -0,0 +1,7 @@
+require core-image-lsb.bb
+
+DESCRIPTION = "Basic image without X support suitable for development work. It \
+can be used for customization and implementations that conform to Linux \
+Standard Base (LSB)."
+
+IMAGE_FEATURES += "dev-pkgs"
diff --git a/meta/recipes-extended/images/core-image-lsb-sdk.bb b/meta/recipes-extended/images/core-image-lsb-sdk.bb
new file mode 100644
index 0000000..c3b6e7c
--- /dev/null
+++ b/meta/recipes-extended/images/core-image-lsb-sdk.bb
@@ -0,0 +1,9 @@
+require core-image-lsb.bb
+
+DESCRIPTION = "Basic image without X support suitable for Linux Standard Base \
+(LSB) implementations. It includes the full meta-toolchain, plus development \
+headers and libraries to form a standalone SDK."
+
+IMAGE_FEATURES += "tools-sdk dev-pkgs tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks"
+
+IMAGE_INSTALL += "kernel-devsrc"
diff --git a/meta/recipes-extended/images/core-image-lsb.bb b/meta/recipes-extended/images/core-image-lsb.bb
new file mode 100644
index 0000000..ab61c6e
--- /dev/null
+++ b/meta/recipes-extended/images/core-image-lsb.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "An image containing packages that are required to conform \
+to the Linux Standard Base (LSB) specification."
+
+IMAGE_FEATURES += "splash ssh-server-openssh hwcodecs package-management"
+
+IMAGE_INSTALL = "\
+    ${CORE_IMAGE_BASE_INSTALL} \
+    packagegroup-core-full-cmdline \
+    packagegroup-core-lsb \
+    "
+
+inherit core-image distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "pam"
diff --git a/meta/recipes-extended/images/core-image-testmaster-initramfs.bb b/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
new file mode 100644
index 0000000..563260d
--- /dev/null
+++ b/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
@@ -0,0 +1,19 @@
+DESCRIPTION = "Small image capable of booting a device with custom install scripts, \
+adding a second rootfs, used for testing."
+
+# use -testfs live-install scripts
+PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install-testfs initramfs-live-install-efi-testfs busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "core-image-testmaster-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+BAD_RECOMMENDATIONS += "busybox-syslog"
diff --git a/meta/recipes-extended/images/core-image-testmaster.bb b/meta/recipes-extended/images/core-image-testmaster.bb
new file mode 100644
index 0000000..78295c5
--- /dev/null
+++ b/meta/recipes-extended/images/core-image-testmaster.bb
@@ -0,0 +1,18 @@
+DESCRIPTION = "A master image to be deployed on a target useful for testing other images"
+
+IMAGE_FEATURES += "ssh-server-openssh package-management"
+
+inherit core-image
+
+# the deploy code requires bash and
+# normal linux utilities not busybox ones
+IMAGE_INSTALL += "\
+    bash coreutils util-linux tar gzip bzip2 kmod \
+    python-modules python-misc \
+    e2fsprogs e2fsprogs-mke2fs parted \
+    "
+# we need a particular initramfs for live images
+# that pulls custom install scripts which take
+# care of partitioning for us
+INITRD_IMAGE = "core-image-testmaster-initramfs"
+
diff --git a/meta/recipes-extended/images/wic-image-minimal.bb b/meta/recipes-extended/images/wic-image-minimal.bb
new file mode 100644
index 0000000..073c569
--- /dev/null
+++ b/meta/recipes-extended/images/wic-image-minimal.bb
@@ -0,0 +1,14 @@
+SUMMARY = "An example of partitioned image."
+
+IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP}"
+
+IMAGE_FSTYPES = "wic.bz2"
+RM_OLD_IMAGE = "1"
+
+# core-image-minimal is referenced in .wks, so we need its rootfs
+# to be ready before our rootfs
+do_rootfs[depends] += "core-image-minimal:do_rootfs"
+
+IMAGE_ROOTFS_EXTRA_SPACE = "2000"
+
+inherit image
diff --git a/meta/recipes-extended/images/wic-image-minimal.wks b/meta/recipes-extended/images/wic-image-minimal.wks
new file mode 100644
index 0000000..29cd8f2
--- /dev/null
+++ b/meta/recipes-extended/images/wic-image-minimal.wks
@@ -0,0 +1,10 @@
+# short-description: Example of partitioned image with complex layout
+# long-description: This image contains boot partition and 3 rootfs partitions
+# created from core-image-minimal and wic-image-minimal image recipes.
+
+part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
+part / --source rootfs --ondisk sda --fstype=ext2 --label platform --align 1024
+part /core --source rootfs --rootfs-dir=core-image-minimal --ondisk sda --fstype=ext2 --label core --align 1024
+part /backup --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext2 --label backup --align 1024
+
+bootloader  --timeout=0  --append="rootwait console=tty0"
diff --git a/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch b/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
new file mode 100644
index 0000000..ab609e2
--- /dev/null
+++ b/meta/recipes-extended/iptables/iptables/0001-configure-Add-option-to-enable-disable-libnfnetlink.patch
@@ -0,0 +1,47 @@
+From 5c47cf5061b852c02178f01e23690bfe38a99d93 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 17 Mar 2013 11:21:35 -0700
+Subject: [PATCH] configure: Add option to enable/disable libnfnetlink
+
+This changes the configure behaviour from autodetecting
+for libnfnetlink to having an option to disable it explicitly
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ configure.ac |   11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ba616ab..ce2d315 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -53,6 +53,9 @@ AC_ARG_ENABLE([libipq],
+ AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
+ 	[Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
+ 	[pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
++AC_ARG_ENABLE([libnfnetlink],
++	AS_HELP_STRING([--disable-libnfnetlink], [Do not use netfilter netlink library]),
++	[enable_libnfnetlink="$enableval"], [enable_libnfnetlink="yes"])
+ 
+ libiptc_LDFLAGS2="";
+ AX_CHECK_LINKER_FLAGS([-Wl,--no-as-needed],
+@@ -89,9 +92,11 @@ AM_CONDITIONAL([ENABLE_LARGEFILE], [test "$enable_largefile" = "yes"])
+ AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
+ AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
+ 
+-PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
+-	[nfnetlink=1], [nfnetlink=0])
+-AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
++AS_IF([test "x$enable_libnfnetlink" = "xyes"], [
++  PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0])
++  ])
++
++AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "x$enable_libnfnetlink" = "xyes"])
+ 
+ regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
+ 	-Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch b/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch
new file mode 100644
index 0000000..7a003d9
--- /dev/null
+++ b/meta/recipes-extended/iptables/iptables/0001-fix-build-with-musl.patch
@@ -0,0 +1,89 @@
+From 7c07b7fd4fdd7844dd032af822306f08e4422c34 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 20:47:29 -0700
+Subject: [PATCH] fix build with musl
+
+Add needed headers they are just not needed for glibc6+ but also
+for musl
+Define additional TCOPTS if not there
+
+u_initX types are in sys/types.h be explicit about it
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ extensions/libxt_TCPOPTSTRIP.c           | 15 +++++++++++++++
+ include/libiptc/ipt_kernel_headers.h     | 12 ------------
+ include/linux/netfilter_ipv4/ip_tables.h |  1 +
+ 3 files changed, 16 insertions(+), 12 deletions(-)
+
+diff --git a/extensions/libxt_TCPOPTSTRIP.c b/extensions/libxt_TCPOPTSTRIP.c
+index 6897857..8a170b2 100644
+--- a/extensions/libxt_TCPOPTSTRIP.c
++++ b/extensions/libxt_TCPOPTSTRIP.c
+@@ -12,6 +12,21 @@
+ #ifndef TCPOPT_MD5SIG
+ #	define TCPOPT_MD5SIG 19
+ #endif
++#ifndef TCPOPT_MAXSEG
++#	define TCPOPT_MAXSEG 2
++#endif
++#ifndef TCPOPT_WINDOW
++#	define TCPOPT_WINDOW 3
++#endif
++#ifndef TCPOPT_SACK_PERMITTED
++#	define TCPOPT_SACK_PERMITTED 4
++#endif
++#ifndef TCPOPT_SACK
++#	define TCPOPT_SACK 5
++#endif
++#ifndef TCPOPT_TIMESTAMP
++#	define TCPOPT_TIMESTAMP 8
++#endif
+ 
+ enum {
+ 	O_STRIP_OPTION = 0,
+diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h
+index 18861fe..a5963e9 100644
+--- a/include/libiptc/ipt_kernel_headers.h
++++ b/include/libiptc/ipt_kernel_headers.h
+@@ -5,7 +5,6 @@
+ 
+ #include <limits.h>
+ 
+-#if defined(__GLIBC__) && __GLIBC__ == 2
+ #include <netinet/ip.h>
+ #include <netinet/in.h>
+ #include <netinet/ip_icmp.h>
+@@ -13,15 +12,4 @@
+ #include <netinet/udp.h>
+ #include <net/if.h>
+ #include <sys/types.h>
+-#else /* libc5 */
+-#include <sys/socket.h>
+-#include <linux/ip.h>
+-#include <linux/in.h>
+-#include <linux/if.h>
+-#include <linux/icmp.h>
+-#include <linux/tcp.h>
+-#include <linux/udp.h>
+-#include <linux/types.h>
+-#include <linux/in6.h>
+-#endif
+ #endif
+diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
+index 57fd82a..4807246 100644
+--- a/include/linux/netfilter_ipv4/ip_tables.h
++++ b/include/linux/netfilter_ipv4/ip_tables.h
+@@ -15,6 +15,7 @@
+ #ifndef _IPTABLES_H
+ #define _IPTABLES_H
+ 
++#include <sys/types.h>
+ #include <linux/types.h>
+ 
+ #include <linux/netfilter_ipv4.h>
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch b/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch
new file mode 100644
index 0000000..24ee29e
--- /dev/null
+++ b/meta/recipes-extended/iptables/iptables/types.h-add-defines-that-are-required-for-if_packet.patch
@@ -0,0 +1,49 @@
+From 19593491f43b70c1a71c3b9b8f4ff4fd14500014 Mon Sep 17 00:00:00 2001
+From: Bruce Ashfield <bruce.ashfield@windriver.com>
+Date: Fri, 23 Mar 2012 14:27:20 -0400
+Subject: [PATCH] types.h: add defines that are required for if_packet.h
+
+The iptables local linux/types.h overrides the kernel/sysroot
+types.h. As such, we need to provide some defines that are required
+to build against 3.2+ kernel headers.
+
+ifndef protection is provided for the defines to ensure that
+configuration that already have these defines are still buildable.
+
+This commit is temporary until a new version of iptables can be
+used that contains the defines.
+
+This is similar to the commit in the iptables git repository:
+
+  https://git.netfilter.org/cgi-bin/gitweb.cgi?p=iptables.git;a=commit;h=dbe77cc974cee656eae37e75039dd1a410a4535b
+
+Upstream-Status: Backport
+
+Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
+---
+ include/linux/types.h |   10 ++++++++++
+ 1 files changed, 10 insertions(+), 0 deletions(-)
+
+diff --git a/include/linux/types.h b/include/linux/types.h
+index 8b483c8..ebf6432 100644
+--- a/include/linux/types.h
++++ b/include/linux/types.h
+@@ -34,5 +34,15 @@ typedef __u64 __bitwise __be64;
+ typedef __u16 __bitwise __sum16;
+ typedef __u32 __bitwise __wsum;
+ 
++#ifndef __aligned_u64
++#define __aligned_u64 __u64 __attribute__((aligned(8)))
++#endif
++#ifndef __aligned_be64
++#define __aligned_be64 __be64 __attribute__((aligned(8)))
++#endif
++#ifndef __aligned_le64
++#define __aligned_le64 __le64 __attribute__((aligned(8)))
++#endif
++
+ #endif /*  __ASSEMBLY__ */
+ #endif /* _LINUX_TYPES_H */
+-- 
+1.7.0.4
+
diff --git a/meta/recipes-extended/iptables/iptables_1.4.21.bb b/meta/recipes-extended/iptables/iptables_1.4.21.bb
new file mode 100644
index 0000000..31c017b
--- /dev/null
+++ b/meta/recipes-extended/iptables/iptables_1.4.21.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Tools for managing kernel packet filtering capabilities"
+DESCRIPTION = "iptables is the userspace command line program used to configure and control network packet \
+filtering code in Linux."
+HOMEPAGE = "http://www.netfilter.org/"
+BUGTRACKER = "http://bugzilla.netfilter.org/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263\
+                    file://iptables/iptables.c;beginline=13;endline=25;md5=c5cffd09974558cf27d0f763df2a12dc"
+
+RRECOMMENDS_${PN} = "kernel-module-x-tables \
+                     kernel-module-ip-tables \
+                     kernel-module-iptable-filter \
+                     kernel-module-iptable-nat \
+                     kernel-module-nf-defrag-ipv4 \
+                     kernel-module-nf-conntrack \
+                     kernel-module-nf-conntrack-ipv4 \
+                     kernel-module-nf-nat \
+                     kernel-module-ipt-masquerade"
+FILES_${PN} =+ "${libdir}/xtables/ ${datadir}/xtables"
+FILES_${PN}-dbg =+ "${libdir}/xtables/.debug"
+
+SRC_URI = "http://netfilter.org/projects/iptables/files/iptables-${PV}.tar.bz2 \
+           file://types.h-add-defines-that-are-required-for-if_packet.patch \
+           file://0001-configure-Add-option-to-enable-disable-libnfnetlink.patch \
+           file://0001-fix-build-with-musl.patch \
+          "
+
+SRC_URI[md5sum] = "536d048c8e8eeebcd9757d0863ebb0c0"
+SRC_URI[sha256sum] = "52004c68021da9a599feed27f65defcfb22128f7da2c0531c0f75de0f479d3e0"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--with-kernel=${STAGING_INCDIR} \
+               "
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)} \
+                 "
+
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+
+# libnfnetlink recipe is in meta-networking layer
+PACKAGECONFIG[libnfnetlink] = "--enable-libnfnetlink,--disable-libnfnetlink,libnfnetlink"
+
+do_configure_prepend() {
+	# Remove some libtool m4 files
+	# Keep ax_check_linker_flags.m4 which belongs to autoconf-archive.
+	rm -f libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4
+}
diff --git a/meta/recipes-extended/iputils/files/debian/targets.diff b/meta/recipes-extended/iputils/files/debian/targets.diff
new file mode 100644
index 0000000..2cb5576
--- /dev/null
+++ b/meta/recipes-extended/iputils/files/debian/targets.diff
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [disable feature]
+
+Index: iputils-s20121221/Makefile
+===================================================================
+--- iputils-s20121221.orig/Makefile
++++ iputils-s20121221/Makefile
+@@ -106,7 +106,7 @@ endif
+ endif
+ 
+ # -------------------------------------
+-IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
++IPV4_TARGETS=tracepath ping clockdiff arping
+ IPV6_TARGETS=tracepath6 traceroute6 ping6
+ TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
+ 
diff --git a/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff b/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff
new file mode 100644
index 0000000..d3b1886
--- /dev/null
+++ b/meta/recipes-extended/iputils/files/debian/use_gethostbyname2.diff
@@ -0,0 +1,31 @@
+Upstream-Status: Pending [from other distro Debian]
+
+Index: iputils-s20121221/tracepath.c
+===================================================================
+--- iputils-s20121221.orig/tracepath.c
++++ iputils-s20121221/tracepath.c
+@@ -370,9 +370,9 @@ main(int argc, char **argv)
+ 	}
+ #endif
+ 
+-	he = gethostbyname(p);
++	he = gethostbyname2(argv[0], AF_INET);
+ 	if (he == NULL) {
+-		herror("gethostbyname");
++		herror("gethostbyname2");
+ 		exit(1);
+ 	}
+ 
+Index: iputils-s20121221/ping.c
+===================================================================
+--- iputils-s20121221.orig/ping.c
++++ iputils-s20121221/ping.c
+@@ -279,7 +279,7 @@ main(int argc, char **argv)
+ #else
+ 			idn = target;
+ #endif
+-			hp = gethostbyname(idn);
++			hp = gethostbyname2(idn, AF_INET);
+ 			if (!hp) {
+ 				fprintf(stderr, "ping: unknown host %s\n", target);
+ 				exit(2);
diff --git a/meta/recipes-extended/iputils/files/fix-build-command-line-argument-with-gnutls.patch b/meta/recipes-extended/iputils/files/fix-build-command-line-argument-with-gnutls.patch
new file mode 100644
index 0000000..b9cd82e
--- /dev/null
+++ b/meta/recipes-extended/iputils/files/fix-build-command-line-argument-with-gnutls.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Backport
+
+From 568e990d30fc7e9416e0a6f8c74ea5013921eaec Mon Sep 17 00:00:00 2001
+From: Arjan van de Ven <arjanvandeven@gmail.com>
+Date: Wed, 16 Jan 2013 03:12:15 +0900
+Subject: [PATCH] ping6: Fix build command line argument with gnutls.
+
+The ping6 command can use either openssl or gnutls...
+and the Makefile has a bunch of setup for defining which of the two to use.
+
+Unfortunately, the final -D define on the commandline to enable gnutls
+inside the ping6.c file didn't actually make it onto the gcc
+commandline.
+This patch adds the $(DEF_CRYPTO) Makefile variable to fix this gap.
+
+Signed-off-by: Arjan van de Ven <arjanvandeven@gmail.com>
+Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
+---
+ Makefile |    2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index c62d9df..89249f5 100644
+--- a/Makefile
++++ b/Makefile
+@@ -149,7 +149,7 @@ LIB_clockdiff = $(LIB_CAP)
+ DEF_ping_common = $(DEF_CAP) $(DEF_IDN)
+ DEF_ping  = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS)
+ LIB_ping  = $(LIB_CAP) $(LIB_IDN)
+-DEF_ping6 = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_ENABLE_PING6_RTHDR)
++DEF_ping6 = $(DEF_CAP) $(DEF_IDN) $(DEF_WITHOUT_IFADDRS) $(DEF_ENABLE_PING6_RTHDR) $(DEF_CRYPTO)
+ LIB_ping6 = $(LIB_CAP) $(LIB_IDN) $(LIB_RESOLV) $(LIB_CRYPTO)
+ 
+ ping: ping_common.o
+-- 
+1.7.2.5
+
diff --git a/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch b/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch
new file mode 100644
index 0000000..92bf946
--- /dev/null
+++ b/meta/recipes-extended/iputils/files/nsgmls-path-fix.patch
@@ -0,0 +1,27 @@
+Fix nsgmls path issue
+
+Upstream-Status: Pending
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Index: iputils-s20101006/doc/Makefile
+===================================================================
+--- iputils-s20101006.orig/doc/Makefile	2011-09-13 20:42:27.000000000 +0800
++++ iputils-s20101006/doc/Makefile	2011-09-13 21:01:52.000000000 +0800
+@@ -27,10 +27,15 @@
+ # docbook2man produces utterly ugly output and I did not find
+ # any way to customize this but hacking backend perl script a little.
+ # Well, hence...
++# nsgmls seems append path to search directory according to the sysid path.
++# e.g. if input ../index.db, it would search $search_directory/../ rather than
++# $search_directory, which leads searching failure. Fixing nsgmls probably
++# introduce some side effects, so use this ugly hack: running nsgmls in current
++# directory, and running docbook2man in tmp directory.
+ 
+ $(MANFILES): index.db
+ 	@-mkdir tmp.db2man
+-	@set -e; cd tmp.db2man; nsgmls ../$< | sgmlspl ../docbook2man-spec.pl ;	mv $@ ..
++	@set -e; nsgmls $< >tmp.db2man/output; cd tmp.db2man; cat output | sgmlspl ../docbook2man-spec.pl ;	mv $@ ..
+ 	@-rm -rf tmp.db2man
+ 
+ clean:
diff --git a/meta/recipes-extended/iputils/iputils_s20121221.bb b/meta/recipes-extended/iputils/iputils_s20121221.bb
new file mode 100644
index 0000000..e87a32a
--- /dev/null
+++ b/meta/recipes-extended/iputils/iputils_s20121221.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Network monitoring tools"
+DESCRIPTION = "Utilities for the IP protocol, including traceroute6, \
+tracepath, tracepath6, ping, ping6 and arping."
+HOMEPAGE = "http://www.skbuff.net/iputils"
+SECTION = "console/network"
+
+LICENSE = "BSD & GPLv2+"
+
+LIC_FILES_CHKSUM = "file://ping.c;beginline=1;endline=35;md5=f9ceb201733e9a6cf8f00766dd278d82 \
+                    file://tracepath.c;beginline=1;endline=10;md5=0ecea2bf60bff2f3d840096d87647f3d \
+                    file://arping.c;beginline=1;endline=11;md5=fe84301b5c2655c950f8b92a057fafa6 \
+                    file://tftpd.c;beginline=1;endline=32;md5=28834bf8a91a5b8a92755dbee709ef96 "
+
+DEPENDS = "gnutls docbook-utils-native sgmlspl-native libcap"
+
+
+SRC_URI = "http://www.skbuff.net/iputils/${BPN}-${PV}.tar.bz2 \
+           file://debian/use_gethostbyname2.diff \
+           file://debian/targets.diff \
+           file://nsgmls-path-fix.patch \
+           file://fix-build-command-line-argument-with-gnutls.patch \
+          "
+
+SRC_URI[md5sum] = "6072aef64205720dd1893b375e184171"
+SRC_URI[sha256sum] = "450f549fc5b620c23c5929aa6d54b7ddfc7ee1cb1e8efdc5e8bb21d8d0c5319f"
+
+do_compile () {
+	oe_runmake 'CC=${CC} -D_GNU_SOURCE' VPATH="${STAGING_LIBDIR}:${STAGING_DIR_HOST}/${base_libdir}" all man
+}
+
+do_install () {
+	install -m 0755 -d ${D}${base_bindir} ${D}${mandir}/man8
+	# SUID root programs
+	install -m 4555 ping ${D}${base_bindir}/ping
+	install -m 4555 ping6 ${D}${base_bindir}/ping6
+	install -m 4555 traceroute6 ${D}${base_bindir}/
+	install -m 4555 clockdiff ${D}${base_bindir}/
+	# Other programgs
+	for i in arping tracepath tracepath6; do
+	  install -m 0755 $i ${D}${base_bindir}/
+	done
+	# Manual pages for things we build packages for
+	for i in tracepath.8 traceroute6.8 ping.8 arping.8; do
+	  install -m 0644 doc/$i ${D}${mandir}/man8/ || true
+	done
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}-ping = "ping"
+ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping"
+
+ALTERNATIVE_${PN}-ping6 = "ping6"
+ALTERNATIVE_LINK_NAME[ping6] = "${base_bindir}/ping6"
+
+PACKAGES += "${PN}-ping ${PN}-ping6 ${PN}-arping ${PN}-tracepath ${PN}-tracepath6 ${PN}-traceroute6 ${PN}-clockdiff"
+
+ALLOW_EMPTY_${PN} = "1"
+RDEPENDS_${PN} += "${PN}-ping ${PN}-ping6 ${PN}-arping ${PN}-tracepath ${PN}-tracepath6 ${PN}-traceroute6 ${PN}-clockdiff"
+
+FILES_${PN}	= ""
+FILES_${PN}-ping = "${base_bindir}/ping.${BPN}"
+FILES_${PN}-ping6 = "${base_bindir}/ping6.${BPN}"
+FILES_${PN}-arping = "${base_bindir}/arping"
+FILES_${PN}-tracepath = "${base_bindir}/tracepath"
+FILES_${PN}-tracepath6 = "${base_bindir}/tracepath6"
+FILES_${PN}-traceroute6	= "${base_bindir}/traceroute6"
+FILES_${PN}-clockdiff = "${base_bindir}/clockdiff"
+FILES_${PN}-doc	= "${mandir}/man8"
diff --git a/meta/recipes-extended/less/less_479.bb b/meta/recipes-extended/less/less_479.bb
new file mode 100644
index 0000000..618954b
--- /dev/null
+++ b/meta/recipes-extended/less/less_479.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Text file viewer similar to more"
+DESCRIPTION = "Less is a program similar to more, i.e. a terminal \
+based program for viewing text files and the output from other \
+programs. Less offers many features beyond those that more does."
+HOMEPAGE = "http://www.greenwoodsoftware.com/"
+SECTION = "console/utils"
+
+# (GPLv2+ (<< 418), GPLv3+ (>= 418)) | less
+# Including email author giving permissing to use BSD
+#
+# From: Mark Nudelman <markn@greenwoodsoftware.com>
+# To: Elizabeth Flanagan <elizabeth.flanagan@intel.com
+# Date: 12/19/11
+#
+# Hi Elizabeth,
+# Using a generic BSD license for less is fine with me.
+# Thanks,
+#
+# --Mark
+#
+
+LICENSE = "GPLv3+ | BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://LICENSE;md5=48c26a307f91af700e1f00585f215aaf"
+DEPENDS = "ncurses"
+
+SRC_URI = "http://www.greenwoodsoftware.com/${BPN}/${BPN}-${PV}.tar.gz \
+	  "
+
+SRC_URI[md5sum] = "049f51ccfe2686009c6ce943eeb4bbaf"
+SRC_URI[sha256sum] = "5bf06cb30ee2a2bd1f79f39aa91e46444e7cb19b48c95c4992fa63cfe4527a80"
+
+inherit autotools update-alternatives
+
+do_install () {
+        oe_runmake 'bindir=${D}${bindir}' 'mandir=${D}${mandir}' install
+}
+
+ALTERNATIVE_${PN} = "less"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-extended/libaio/libaio/00_arches.patch b/meta/recipes-extended/libaio/libaio/00_arches.patch
new file mode 100644
index 0000000..9d6447d
--- /dev/null
+++ b/meta/recipes-extended/libaio/libaio/00_arches.patch
@@ -0,0 +1,607 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+from openembedded, added by Qing He <qing.he@intel.com>
+
+Index: libaio-0.3.110/src/syscall-m68k.h
+===================================================================
+--- /dev/null
++++ libaio-0.3.110/src/syscall-m68k.h
+@@ -0,0 +1,78 @@
++#define __NR_io_setup		241
++#define __NR_io_destroy		242
++#define __NR_io_getevents	243
++#define __NR_io_submit		244
++#define __NR_io_cancel		245
++
++#define io_syscall1(type,fname,sname,atype,a) \
++type fname(atype a) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++__asm__ __volatile__ ("trap  #0" \
++		      : "+d" (__res) \
++		      : "d" (__a)  ); \
++return (type) __res; \
++}
++
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
++type fname(atype a,btype b) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++__asm__ __volatile__ ("trap  #0" \
++		      : "+d" (__res) \
++		      : "d" (__a), "d" (__b) \
++		     ); \
++return (type) __res; \
++}
++
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
++type fname(atype a,btype b,ctype c) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++__asm__ __volatile__ ("trap  #0" \
++		      : "+d" (__res) \
++		      : "d" (__a), "d" (__b), \
++			"d" (__c) \
++		     ); \
++return (type) __res; \
++}
++
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
++type fname (atype a, btype b, ctype c, dtype d) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++register long __d __asm__ ("%d4") = (long)(d); \
++__asm__ __volatile__ ("trap  #0" \
++		      : "+d" (__res) \
++		      : "d" (__a), "d" (__b), \
++			"d" (__c), "d" (__d)  \
++		     ); \
++return (type) __res; \
++}
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
++{ \
++register long __res __asm__ ("%d0") = __NR_##sname; \
++register long __a __asm__ ("%d1") = (long)(a); \
++register long __b __asm__ ("%d2") = (long)(b); \
++register long __c __asm__ ("%d3") = (long)(c); \
++register long __d __asm__ ("%d4") = (long)(d); \
++register long __e __asm__ ("%d5") = (long)(e); \
++__asm__ __volatile__ ("trap  #0" \
++		      : "+d" (__res) \
++		      : "d" (__a), "d" (__b), \
++			"d" (__c), "d" (__d), "d" (__e)  \
++		     ); \
++return (type) __res; \
++}
++
+Index: libaio-0.3.110/src/syscall.h
+===================================================================
+--- libaio-0.3.110.orig/src/syscall.h
++++ libaio-0.3.110/src/syscall.h
+@@ -28,6 +28,12 @@
+ #include "syscall-sparc.h"
+ #elif defined(__aarch64__)
+ #include "syscall-arm64.h"
++#elif defined(__m68k__)
++#include "syscall-m68k.h"
++#elif defined(__hppa__)
++#include "syscall-parisc.h"
++#elif defined(__mips__)
++#include "syscall-mips.h"
+ #else
+ #warning "using generic syscall method"
+ #include "syscall-generic.h"
+Index: libaio-0.3.110/src/syscall-mips.h
+===================================================================
+--- /dev/null
++++ libaio-0.3.110/src/syscall-mips.h
+@@ -0,0 +1,223 @@
++/*
++ * This file is subject to the terms and conditions of the GNU General Public
++ * License.  See the file "COPYING" in the main directory of this archive
++ * for more details.
++ *
++ * Copyright (C) 1995, 96, 97, 98, 99, 2000 by Ralf Baechle
++ * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
++ *
++ * Changed system calls macros _syscall5 - _syscall7 to push args 5 to 7 onto
++ * the stack. Robin Farine for ACN S.A, Copyright (C) 1996 by ACN S.A
++ */
++
++#ifndef _MIPS_SIM_ABI32
++#define _MIPS_SIM_ABI32			1
++#define _MIPS_SIM_NABI32		2
++#define _MIPS_SIM_ABI64			3
++#endif
++
++#if _MIPS_SIM == _MIPS_SIM_ABI32
++
++/*
++ * Linux o32 style syscalls are in the range from 4000 to 4999.
++ */
++#define __NR_Linux			4000
++#define __NR_io_setup			(__NR_Linux + 241)
++#define __NR_io_destroy			(__NR_Linux + 242)
++#define __NR_io_getevents		(__NR_Linux + 243)
++#define __NR_io_submit			(__NR_Linux + 244)
++#define __NR_io_cancel			(__NR_Linux + 245)
++
++#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
++
++#if _MIPS_SIM == _MIPS_SIM_ABI64
++
++/*
++ * Linux 64-bit syscalls are in the range from 5000 to 5999.
++ */
++#define __NR_Linux			5000
++#define __NR_io_setup			(__NR_Linux + 200)
++#define __NR_io_destroy			(__NR_Linux + 201)
++#define __NR_io_getevents		(__NR_Linux + 202)
++#define __NR_io_submit			(__NR_Linux + 203)
++#define __NR_io_cancel			(__NR_Linux + 204)
++#endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
++
++#if _MIPS_SIM == _MIPS_SIM_NABI32
++
++/*
++ * Linux N32 syscalls are in the range from 6000 to 6999.
++ */
++#define __NR_Linux			6000
++#define __NR_io_setup			(__NR_Linux + 200)
++#define __NR_io_destroy			(__NR_Linux + 201)
++#define __NR_io_getevents		(__NR_Linux + 202)
++#define __NR_io_submit			(__NR_Linux + 203)
++#define __NR_io_cancel			(__NR_Linux + 204)
++#endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
++
++#define io_syscall1(type,fname,sname,atype,a) \
++type fname(atype a) \
++{ \
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
++	register unsigned long __a3 asm("$7"); \
++	unsigned long __v0; \
++	\
++	__asm__ volatile ( \
++	".set\tnoreorder\n\t" \
++	"li\t$2, %3\t\t\t# " #fname "\n\t" \
++	"syscall\n\t" \
++	"move\t%0, $2\n\t" \
++	".set\treorder" \
++	: "=&r" (__v0), "=r" (__a3) \
++	: "r" (__a0), "i" (__NR_##sname) \
++	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++	  "memory"); \
++	\
++	if (__a3 == 0) \
++		return (type) __v0; \
++	return (type) -1; \
++}
++
++#define io_syscall2(type,fname,sname,atype,a,btype,b) \
++type fname(atype a, btype b) \
++{ \
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
++	register unsigned long __a1 asm("$5") = (unsigned long) b; \
++	register unsigned long __a3 asm("$7"); \
++	unsigned long __v0; \
++	\
++	__asm__ volatile ( \
++	".set\tnoreorder\n\t" \
++	"li\t$2, %4\t\t\t# " #fname "\n\t" \
++	"syscall\n\t" \
++	"move\t%0, $2\n\t" \
++	".set\treorder" \
++	: "=&r" (__v0), "=r" (__a3) \
++	: "r" (__a0), "r" (__a1), "i" (__NR_##sname) \
++	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++	  "memory"); \
++	\
++	if (__a3 == 0) \
++		return (type) __v0; \
++	return (type) -1; \
++}
++
++#define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
++type fname(atype a, btype b, ctype c) \
++{ \
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
++	register unsigned long __a1 asm("$5") = (unsigned long) b; \
++	register unsigned long __a2 asm("$6") = (unsigned long) c; \
++	register unsigned long __a3 asm("$7"); \
++	unsigned long __v0; \
++	\
++	__asm__ volatile ( \
++	".set\tnoreorder\n\t" \
++	"li\t$2, %5\t\t\t# " #fname "\n\t" \
++	"syscall\n\t" \
++	"move\t%0, $2\n\t" \
++	".set\treorder" \
++	: "=&r" (__v0), "=r" (__a3) \
++	: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
++	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++	  "memory"); \
++	\
++	if (__a3 == 0) \
++		return (type) __v0; \
++	return (type) -1; \
++}
++
++#define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
++type fname(atype a, btype b, ctype c, dtype d) \
++{ \
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
++	register unsigned long __a1 asm("$5") = (unsigned long) b; \
++	register unsigned long __a2 asm("$6") = (unsigned long) c; \
++	register unsigned long __a3 asm("$7") = (unsigned long) d; \
++	unsigned long __v0; \
++	\
++	__asm__ volatile ( \
++	".set\tnoreorder\n\t" \
++	"li\t$2, %5\t\t\t# " #fname "\n\t" \
++	"syscall\n\t" \
++	"move\t%0, $2\n\t" \
++	".set\treorder" \
++	: "=&r" (__v0), "+r" (__a3) \
++	: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname) \
++	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++	  "memory"); \
++	\
++	if (__a3 == 0) \
++		return (type) __v0; \
++	return (type) -1; \
++}
++
++#if (_MIPS_SIM == _MIPS_SIM_ABI32)
++
++/*
++ * Using those means your brain needs more than an oil change ;-)
++ */
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname(atype a, btype b, ctype c, dtype d, etype e) \
++{ \
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
++	register unsigned long __a1 asm("$5") = (unsigned long) b; \
++	register unsigned long __a2 asm("$6") = (unsigned long) c; \
++	register unsigned long __a3 asm("$7") = (unsigned long) d; \
++	unsigned long __v0; \
++	\
++	__asm__ volatile ( \
++	".set\tnoreorder\n\t" \
++	"lw\t$2, %6\n\t" \
++	"subu\t$29, 32\n\t" \
++	"sw\t$2, 16($29)\n\t" \
++	"li\t$2, %5\t\t\t# " #fname "\n\t" \
++	"syscall\n\t" \
++	"move\t%0, $2\n\t" \
++	"addiu\t$29, 32\n\t" \
++	".set\treorder" \
++	: "=&r" (__v0), "+r" (__a3) \
++	: "r" (__a0), "r" (__a1), "r" (__a2), "i" (__NR_##sname), \
++	  "m" ((unsigned long)e) \
++	: "$2", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++	  "memory"); \
++	\
++	if (__a3 == 0) \
++		return (type) __v0; \
++	return (type) -1; \
++}
++
++#endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
++
++#if (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64)
++
++#define io_syscall5(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d,etype,e) \
++type fname (atype a,btype b,ctype c,dtype d,etype e) \
++{ \
++	register unsigned long __a0 asm("$4") = (unsigned long) a; \
++	register unsigned long __a1 asm("$5") = (unsigned long) b; \
++	register unsigned long __a2 asm("$6") = (unsigned long) c; \
++	register unsigned long __a3 asm("$7") = (unsigned long) d; \
++	register unsigned long __a4 asm("$8") = (unsigned long) e; \
++	unsigned long __v0; \
++	\
++	__asm__ volatile ( \
++	".set\tnoreorder\n\t" \
++	"li\t$2, %6\t\t\t# " #fname "\n\t" \
++	"syscall\n\t" \
++	"move\t%0, $2\n\t" \
++	".set\treorder" \
++	: "=&r" (__v0), "+r" (__a3) \
++	: "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a4), "i" (__NR_##sname) \
++	: "$2", "$9", "$10", "$11", "$12", "$13", "$14", "$15", "$24", \
++	  "memory"); \
++	\
++	if (__a3 == 0) \
++		return (type) __v0; \
++	return (type) -1; \
++}
++
++#endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
++
+Index: libaio-0.3.110/src/syscall-parisc.h
+===================================================================
+--- /dev/null
++++ libaio-0.3.110/src/syscall-parisc.h
+@@ -0,0 +1,146 @@
++/*
++ * Linux system call numbers.
++ *
++ * Cary Coutant says that we should just use another syscall gateway
++ * page to avoid clashing with the HPUX space, and I think he's right:
++ * it will would keep a branch out of our syscall entry path, at the
++ * very least.  If we decide to change it later, we can ``just'' tweak
++ * the LINUX_GATEWAY_ADDR define at the bottom and make __NR_Linux be
++ * 1024 or something.  Oh, and recompile libc. =)
++ *
++ * 64-bit HPUX binaries get the syscall gateway address passed in a register
++ * from the kernel at startup, which seems a sane strategy.
++ */
++
++#define __NR_Linux                0
++#define __NR_io_setup           (__NR_Linux + 215)
++#define __NR_io_destroy         (__NR_Linux + 216)
++#define __NR_io_getevents       (__NR_Linux + 217)
++#define __NR_io_submit          (__NR_Linux + 218)
++#define __NR_io_cancel          (__NR_Linux + 219)
++
++#define SYS_ify(syscall_name)   __NR_##syscall_name
++
++/* Assume all syscalls are done from PIC code just to be
++ * safe. The worst case scenario is that you lose a register
++ * and save/restore r19 across the syscall. */
++#define PIC
++
++/* Definition taken from glibc 2.3.3
++ * sysdeps/unix/sysv/linux/hppa/sysdep.h
++ */
++
++#ifdef PIC
++/* WARNING: CANNOT BE USED IN A NOP! */
++# define K_STW_ASM_PIC	"       copy %%r19, %%r4\n"
++# define K_LDW_ASM_PIC	"       copy %%r4, %%r19\n"
++# define K_USING_GR4	"%r4",
++#else
++# define K_STW_ASM_PIC	" \n"
++# define K_LDW_ASM_PIC	" \n"
++# define K_USING_GR4
++#endif
++
++/* GCC has to be warned that a syscall may clobber all the ABI
++   registers listed as "caller-saves", see page 8, Table 2
++   in section 2.2.6 of the PA-RISC RUN-TIME architecture
++   document. However! r28 is the result and will conflict with
++   the clobber list so it is left out. Also the input arguments
++   registers r20 -> r26 will conflict with the list so they
++   are treated specially. Although r19 is clobbered by the syscall
++   we cannot say this because it would violate ABI, thus we say
++   r4 is clobbered and use that register to save/restore r19
++   across the syscall. */
++
++#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
++			 "%r20", "%r29", "%r31"
++
++#undef K_INLINE_SYSCALL
++#define K_INLINE_SYSCALL(name, nr, args...)	({			\
++	long __sys_res;							\
++	{								\
++		register unsigned long __res __asm__("r28");		\
++		K_LOAD_ARGS_##nr(args)					\
++		/* FIXME: HACK stw/ldw r19 around syscall */		\
++		__asm__ volatile(					\
++			K_STW_ASM_PIC					\
++			"	ble  0x100(%%sr2, %%r0)\n"		\
++			"	ldi %1, %%r20\n"			\
++			K_LDW_ASM_PIC					\
++			: "=r" (__res)					\
++			: "i" (SYS_ify(name)) K_ASM_ARGS_##nr		\
++			: "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr	\
++		);							\
++		__sys_res = (long)__res;				\
++	}								\
++	__sys_res;							\
++})
++
++#define K_LOAD_ARGS_0()
++#define K_LOAD_ARGS_1(r26)					\
++	register unsigned long __r26 __asm__("r26") = (unsigned long)(r26);   \
++	K_LOAD_ARGS_0()
++#define K_LOAD_ARGS_2(r26,r25)					\
++	register unsigned long __r25 __asm__("r25") = (unsigned long)(r25);   \
++	K_LOAD_ARGS_1(r26)
++#define K_LOAD_ARGS_3(r26,r25,r24)				\
++	register unsigned long __r24 __asm__("r24") = (unsigned long)(r24);   \
++	K_LOAD_ARGS_2(r26,r25)
++#define K_LOAD_ARGS_4(r26,r25,r24,r23)				\
++	register unsigned long __r23 __asm__("r23") = (unsigned long)(r23);   \
++	K_LOAD_ARGS_3(r26,r25,r24)
++#define K_LOAD_ARGS_5(r26,r25,r24,r23,r22)			\
++	register unsigned long __r22 __asm__("r22") = (unsigned long)(r22);   \
++	K_LOAD_ARGS_4(r26,r25,r24,r23)
++#define K_LOAD_ARGS_6(r26,r25,r24,r23,r22,r21)			\
++	register unsigned long __r21 __asm__("r21") = (unsigned long)(r21);   \
++	K_LOAD_ARGS_5(r26,r25,r24,r23,r22)
++
++/* Even with zero args we use r20 for the syscall number */
++#define K_ASM_ARGS_0
++#define K_ASM_ARGS_1 K_ASM_ARGS_0, "r" (__r26)
++#define K_ASM_ARGS_2 K_ASM_ARGS_1, "r" (__r25)
++#define K_ASM_ARGS_3 K_ASM_ARGS_2, "r" (__r24)
++#define K_ASM_ARGS_4 K_ASM_ARGS_3, "r" (__r23)
++#define K_ASM_ARGS_5 K_ASM_ARGS_4, "r" (__r22)
++#define K_ASM_ARGS_6 K_ASM_ARGS_5, "r" (__r21)
++
++/* The registers not listed as inputs but clobbered */
++#define K_CLOB_ARGS_6
++#define K_CLOB_ARGS_5 K_CLOB_ARGS_6, "%r21"
++#define K_CLOB_ARGS_4 K_CLOB_ARGS_5, "%r22"
++#define K_CLOB_ARGS_3 K_CLOB_ARGS_4, "%r23"
++#define K_CLOB_ARGS_2 K_CLOB_ARGS_3, "%r24"
++#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
++#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
++
++#define io_syscall1(type,fname,sname,type1,arg1)			\
++type fname(type1 arg1)							\
++{									\
++    return K_INLINE_SYSCALL(sname, 1, arg1);				\
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2)		\
++type fname(type1 arg1, type2 arg2)					\
++{									\
++    return K_INLINE_SYSCALL(sname, 2, arg1, arg2);			\
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3)	\
++type fname(type1 arg1, type2 arg2, type3 arg3)				\
++{									\
++    return K_INLINE_SYSCALL(sname, 3, arg1, arg2, arg3);		\
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4)		\
++{									\
++    return K_INLINE_SYSCALL(sname, 4, arg1, arg2, arg3, arg4);		\
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5)	\
++{									\
++    return K_INLINE_SYSCALL(sname, 5, arg1, arg2, arg3, arg4, arg5);	\
++}
++
+Index: libaio-0.3.110/src/syscall-arm.h
+===================================================================
+--- libaio-0.3.110.orig/src/syscall-arm.h
++++ libaio-0.3.110/src/syscall-arm.h
+@@ -114,3 +114,119 @@ type fname(type1 arg1, type2 arg2, type3
+   return (type) __res_r0;						\
+ }
+ 
++/*
++ *  linux/include/asm-arm/unistd.h
++ *
++ *  Copyright (C) 2001-2005 Russell King
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License version 2 as
++ * published by the Free Software Foundation.
++ *
++ * Please forward _all_ changes to this file to rmk@arm.linux.org.uk,
++ * no matter what the change is.  Thanks!
++ */
++
++#define __NR_OABI_SYSCALL_BASE	0x900000
++
++#if defined(__thumb__) || defined(__ARM_EABI__)
++#define __NR_SYSCALL_BASE	0
++#else
++#define __NR_SYSCALL_BASE	__NR_OABI_SYSCALL_BASE
++#endif
++
++#define __NR_io_setup			(__NR_SYSCALL_BASE+243)
++#define __NR_io_destroy			(__NR_SYSCALL_BASE+244)
++#define __NR_io_getevents		(__NR_SYSCALL_BASE+245)
++#define __NR_io_submit			(__NR_SYSCALL_BASE+246)
++#define __NR_io_cancel			(__NR_SYSCALL_BASE+247)
++
++#define __sys2(x) #x
++#define __sys1(x) __sys2(x)
++
++#if defined(__thumb__) || defined(__ARM_EABI__)
++#define __SYS_REG(name) register long __sysreg __asm__("r7") = __NR_##name;
++#define __SYS_REG_LIST(regs...) "r" (__sysreg) , ##regs
++#define __syscall(name) "swi\t0"
++#else
++#define __SYS_REG(name)
++#define __SYS_REG_LIST(regs...) regs
++#define __syscall(name) "swi\t" __sys1(__NR_##name) ""
++#endif
++
++#define io_syscall1(type,fname,sname,type1,arg1)			\
++type fname(type1 arg1) {						\
++  __SYS_REG(sname)							\
++  register long __r0 __asm__("r0") = (long)arg1;			\
++  register long __res_r0 __asm__("r0");					\
++  __asm__ __volatile__ (						\
++  __syscall(sname)							\
++	: "=r" (__res_r0)						\
++	: __SYS_REG_LIST( "0" (__r0) )					\
++	: "memory" );							\
++  return (type) __res_r0;						\
++}
++
++#define io_syscall2(type,fname,sname,type1,arg1,type2,arg2)		\
++type fname(type1 arg1,type2 arg2) {					\
++  __SYS_REG(sname)							\
++  register long __r0 __asm__("r0") = (long)arg1;			\
++  register long __r1 __asm__("r1") = (long)arg2;			\
++  register long __res_r0 __asm__("r0");					\
++  __asm__ __volatile__ (						\
++  __syscall(sname)							\
++	: "=r" (__res_r0)						\
++	: __SYS_REG_LIST( "0" (__r0), "r" (__r1) )			\
++	: "memory" );							\
++  return (type) __res_r0;						\
++}
++
++#define io_syscall3(type,fname,sname,type1,arg1,type2,arg2,type3,arg3)	\
++type fname(type1 arg1,type2 arg2,type3 arg3) {				\
++  __SYS_REG(sname)							\
++  register long __r0 __asm__("r0") = (long)arg1;			\
++  register long __r1 __asm__("r1") = (long)arg2;			\
++  register long __r2 __asm__("r2") = (long)arg3;			\
++  register long __res_r0 __asm__("r0");					\
++  __asm__ __volatile__ (						\
++  __syscall(sname)							\
++	: "=r" (__res_r0)						\
++	: __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2) )		\
++	: "memory" );							\
++  return (type) __res_r0;						\
++}
++
++#define io_syscall4(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4)\
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4) {		\
++  __SYS_REG(sname)							\
++  register long __r0 __asm__("r0") = (long)arg1;			\
++  register long __r1 __asm__("r1") = (long)arg2;			\
++  register long __r2 __asm__("r2") = (long)arg3;			\
++  register long __r3 __asm__("r3") = (long)arg4;			\
++  register long __res_r0 __asm__("r0");					\
++  __asm__ __volatile__ (						\
++  __syscall(sname)							\
++	: "=r" (__res_r0)						\
++	: __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2), "r" (__r3) ) \
++	: "memory" );							\
++  return (type) __res_r0;						\
++}
++
++#define io_syscall5(type,fname,sname,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5)	\
++type fname(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) {\
++  __SYS_REG(sname)							\
++  register long __r0 __asm__("r0") = (long)arg1;			\
++  register long __r1 __asm__("r1") = (long)arg2;			\
++  register long __r2 __asm__("r2") = (long)arg3;			\
++  register long __r3 __asm__("r3") = (long)arg4;			\
++  register long __r4 __asm__("r4") = (long)arg5;			\
++  register long __res_r0 __asm__("r0");					\
++  __asm__ __volatile__ (						\
++  __syscall(sname)							\
++	: "=r" (__res_r0)						\
++	: __SYS_REG_LIST( "0" (__r0), "r" (__r1), "r" (__r2),		\
++			  "r" (__r3), "r" (__r4) )			\
++	: "memory" );							\
++  return (type) __res_r0;						\
++}
++
diff --git a/meta/recipes-extended/libaio/libaio/destdir.patch b/meta/recipes-extended/libaio/libaio/destdir.patch
new file mode 100644
index 0000000..dad9601
--- /dev/null
+++ b/meta/recipes-extended/libaio/libaio/destdir.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+from openembedded, added by Qing He <qing.he@intel.com>
+
+Index: libaio-0.3.106/Makefile
+===================================================================
+--- libaio-0.3.106.orig/Makefile	2004-02-26 07:25:10.000000000 -0800
++++ libaio-0.3.106/Makefile	2006-10-14 09:19:07.000000000 -0700
+@@ -15,7 +15,7 @@
+ 	@$(MAKE) -C src
+ 
+ install:
+-	@$(MAKE) -C src install prefix=$(prefix) includedir=$(includedir) libdir=$(libdir)
++	@$(MAKE) -C src install prefix=$(DESTDIR)$(prefix) includedir=$(DESTDIR)$(includedir) libdir=$(DESTDIR)$(libdir)
+ 
+ 
+ clean:
diff --git a/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch b/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch
new file mode 100644
index 0000000..bba7e55
--- /dev/null
+++ b/meta/recipes-extended/libaio/libaio/generic-arch-dectection-for-padding-defines.patch
@@ -0,0 +1,65 @@
+From: Nathan Rossi <nathan.rossi@xilinx.com>
+Date: Tue, 27 Jan 2015 14:59:35 +1000
+Subject: [PATCH] Generic arch dectection for padding defines
+
+When available use the GNU C defines for endian and bitwidth to
+determine the padding required. This reduces the need to define the
+padding selection for every architecture.
+
+Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
+Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
+Upstream-Status: Backport
+---
+ src/libaio.h | 16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/src/libaio.h b/src/libaio.h
+index 1223146..4a4e0f5 100644
+--- a/src/libaio.h
++++ b/src/libaio.h
+@@ -52,14 +52,18 @@ typedef enum io_iocb_cmd {
+ /* little endian, 32 bits */
+ #if defined(__i386__) || (defined(__arm__) && !defined(__ARMEB__)) || \
+     defined(__sh__) || defined(__bfin__) || defined(__MIPSEL__) || \
+-    defined(__cris__)
++    defined(__cris__) || \
++    (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++         __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 4)
+ #define PADDED(x, y)	x; unsigned y
+ #define PADDEDptr(x, y)	x; unsigned y
+ #define PADDEDul(x, y)	unsigned long x; unsigned y
+ 
+ /* little endian, 64 bits */
+ #elif defined(__ia64__) || defined(__x86_64__) || defined(__alpha__) || \
+-      (defined(__aarch64__) && defined(__AARCH64EL__))
++      (defined(__aarch64__) && defined(__AARCH64EL__)) || \
++      (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++          __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __SIZEOF_LONG__ == 8)
+ #define PADDED(x, y)	x, y
+ #define PADDEDptr(x, y)	x
+ #define PADDEDul(x, y)	unsigned long x
+@@ -67,7 +71,9 @@ typedef enum io_iocb_cmd {
+ /* big endian, 64 bits */
+ #elif defined(__powerpc64__) || defined(__s390x__) || \
+       (defined(__sparc__) && defined(__arch64__)) || \
+-      (defined(__aarch64__) && defined(__AARCH64EB__))
++      (defined(__aarch64__) && defined(__AARCH64EB__)) || \
++      (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++           __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 8)
+ #define PADDED(x, y)	unsigned y; x
+ #define PADDEDptr(x,y)	x
+ #define PADDEDul(x, y)	unsigned long x
+@@ -76,7 +82,9 @@ typedef enum io_iocb_cmd {
+ #elif defined(__PPC__) || defined(__s390__) || \
+       (defined(__arm__) && defined(__ARMEB__)) || \
+       defined(__sparc__) || defined(__MIPSEB__) || defined(__m68k__) || \
+-      defined(__hppa__) || defined(__frv__) || defined(__avr32__)
++      defined(__hppa__) || defined(__frv__) || defined(__avr32__) || \
++      (defined(__GNUC__) && defined(__BYTE_ORDER__) && \
++           __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ && __SIZEOF_LONG__ == 4)
+ #define PADDED(x, y)	unsigned y; x
+ #define PADDEDptr(x, y)	unsigned y; x
+ #define PADDEDul(x, y)	unsigned y; unsigned long x
+-- 
+2.1.1
+
diff --git a/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch b/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch
new file mode 100644
index 0000000..9c6850c
--- /dev/null
+++ b/meta/recipes-extended/libaio/libaio/libaio_fix_for_mips_syscalls.patch
@@ -0,0 +1,62 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Phil Staub <Phil.Staub@windriver.com>
+
+Index: libaio-0.3.109/src/syscall-mips.h
+===================================================================
+--- libaio-0.3.109.orig/src/syscall-mips.h
++++ libaio-0.3.109/src/syscall-mips.h
+@@ -76,7 +76,7 @@ type fname(atype a) \
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #define io_syscall2(type,fname,sname,atype,a,btype,b) \
+@@ -100,7 +100,7 @@ type fname(atype a, btype b) \
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #define io_syscall3(type,fname,sname,atype,a,btype,b,ctype,c) \
+@@ -125,7 +125,7 @@ type fname(atype a, btype b, ctype c) \
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #define io_syscall4(type,fname,sname,atype,a,btype,b,ctype,c,dtype,d) \
+@@ -150,7 +150,7 @@ type fname(atype a, btype b, ctype c, dt
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #if (_MIPS_SIM == _MIPS_SIM_ABI32)
+@@ -186,7 +186,7 @@ type fname(atype a, btype b, ctype c, dt
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #endif /* (_MIPS_SIM == _MIPS_SIM_ABI32) */
+@@ -216,7 +216,7 @@ type fname (atype a,btype b,ctype c,dtyp
+ 	\
+ 	if (__a3 == 0) \
+ 		return (type) __v0; \
+-	return (type) -1; \
++	return (type) (-(__v0)); \
+ }
+ 
+ #endif /* (_MIPS_SIM == _MIPS_SIM_NABI32) || (_MIPS_SIM == _MIPS_SIM_ABI64) */
diff --git a/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch b/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
new file mode 100644
index 0000000..508f5a1
--- /dev/null
+++ b/meta/recipes-extended/libaio/libaio/libaio_fix_for_x32.patch
@@ -0,0 +1,61 @@
+Upstream-Status: Pending
+
+Properly load arguments 5 an 6 for x86-64 syscall
+Use asm ("r10") and asm ("r8") to load arguments 5 an 6 for x86-64
+syscall so that it works with both x32 and x86-64.
+
+Received this patch from H.J. Lu <hjl.tools@gmail.com>
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/12/02
+
+--- libaio-0.3.109/src/syscall-x86_64.h.x32	2009-10-09 11:17:02.000000000 -0700
++++ libaio-0.3.109/src/syscall-x86_64.h	2011-12-02 09:09:07.537603224 -0800
+@@ -1,8 +1,18 @@
++#ifndef __NR_io_setup
+ #define __NR_io_setup		206
++#endif
++#ifndef __NR_io_destroy
+ #define __NR_io_destroy		207
++#endif
++#ifndef __NR_io_getevents
+ #define __NR_io_getevents	208
++#endif
++#ifndef __NR_io_submit
+ #define __NR_io_submit		209
++#endif
++#ifndef __NR_io_cancel
+ #define __NR_io_cancel		210
++#endif
+ 
+ #define __syscall_clobber "r11","rcx","memory" 
+ #define __syscall "syscall"
+@@ -42,10 +52,11 @@ return __res;								\
+ type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4)		\
+ {									\
+ long __res;								\
+-__asm__ volatile ("movq %5,%%r10 ;" __syscall				\
++register long __a4 asm ("r10") = (long) arg4;				\
++__asm__ volatile (__syscall						\
+ 	: "=a" (__res)							\
+ 	: "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)),	\
+-	  "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
++	  "d" ((long)(arg3)),"r" (__a4)); \
+ return __res;								\
+ } 
+ 
+@@ -54,10 +65,11 @@ return __res;								\
+ type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5)	\
+ {									\
+ long __res;								\
+-__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall		\
++register long __a4 asm ("r10") = (long) arg4;				\
++register long __a5 asm ("r8") = (long) arg5;				\
++__asm__ volatile ( __syscall						\
+ 	: "=a" (__res)							\
+ 	: "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)),	\
+-	  "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) :	\
+-	__syscall_clobber,"r8","r10" );					\
++	  "d" ((long)(arg3)),"r" (__a4),"r" (__a5));			\
+ return __res;								\
+ }
diff --git a/meta/recipes-extended/libaio/libaio_0.3.110.bb b/meta/recipes-extended/libaio/libaio_0.3.110.bb
new file mode 100644
index 0000000..cbe29ce
--- /dev/null
+++ b/meta/recipes-extended/libaio/libaio_0.3.110.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Asynchronous I/O library"
+DESCRIPTION = "Asynchronous input/output library that uses the kernels native interface"
+HOMEPAGE = "http://lse.sourceforge.net/io/aio.html"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8045f3b8f929c1cb29a1e3fd737b499"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/liba/libaio/libaio_${PV}.orig.tar.gz \
+           file://generic-arch-dectection-for-padding-defines.patch \
+           file://00_arches.patch \
+           file://destdir.patch \
+           file://libaio_fix_for_x32.patch \
+           file://libaio_fix_for_mips_syscalls.patch \
+"
+
+SRC_URI[md5sum] = "2a35602e43778383e2f4907a4ca39ab8"
+SRC_URI[sha256sum] = "e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e"
+
+EXTRA_OEMAKE =+ "prefix=${prefix} includedir=${includedir} libdir=${libdir}"
+# Need libc for stack-protector's __stack_chk_fail_local() bounce function
+LDFLAGS_append_x86 = " -lc"
+
+do_configure () {
+    sed -i 's#LINK_FLAGS=.*#LINK_FLAGS=$(LDFLAGS)#' src/Makefile
+}
+
+do_install () {
+    oe_runmake install DESTDIR=${D}
+}
diff --git a/meta/recipes-extended/libarchive/libarchive/0001-Add-ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS-option.patch b/meta/recipes-extended/libarchive/libarchive/0001-Add-ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS-option.patch
new file mode 100644
index 0000000..4ca779c
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/0001-Add-ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS-option.patch
@@ -0,0 +1,151 @@
+From 59357157706d47c365b2227739e17daba3607526 Mon Sep 17 00:00:00 2001
+From: Alessandro Ghedini <alessandro@ghedini.me>
+Date: Sun, 1 Mar 2015 12:07:45 +0100
+Subject: [PATCH] Add ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS option
+
+This fixes a directory traversal in the cpio tool.
+
+
+Upstream-Status: backport
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ cpio/bsdcpio.1                           |    3 ++-
+ cpio/cpio.c                              |    2 ++
+ libarchive/archive.h                     |    2 ++
+ libarchive/archive_write_disk.3          |    3 +++
+ libarchive/archive_write_disk_posix.c    |   14 +++++++++++---
+ libarchive/test/test_write_disk_secure.c |   23 +++++++++++++++++++++++
+ 6 files changed, 43 insertions(+), 4 deletions(-)
+
+diff --git a/cpio/bsdcpio.1 b/cpio/bsdcpio.1
+index f966aa0..e52546e 100644
+--- a/cpio/bsdcpio.1
++++ b/cpio/bsdcpio.1
+@@ -156,7 +156,8 @@ See above for description.
+ .It Fl Fl insecure
+ (i and p mode only)
+ Disable security checks during extraction or copying.
+-This allows extraction via symbolic links and path names containing
++This allows extraction via symbolic links, absolute paths,
++and path names containing
+ .Sq ..
+ in the name.
+ .It Fl J , Fl Fl xz
+diff --git a/cpio/cpio.c b/cpio/cpio.c
+index 0acde11..b267e9b 100644
+--- a/cpio/cpio.c
++++ b/cpio/cpio.c
+@@ -171,6 +171,7 @@ main(int argc, char *argv[])
+ 	cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER;
+ 	cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS;
+ 	cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT;
++	cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
+ 	cpio->extract_flags |= ARCHIVE_EXTRACT_PERM;
+ 	cpio->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
+ 	cpio->extract_flags |= ARCHIVE_EXTRACT_ACL;
+@@ -256,6 +257,7 @@ main(int argc, char *argv[])
+ 		case OPTION_INSECURE:
+ 			cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_SYMLINKS;
+ 			cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT;
++			cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS;
+ 			break;
+ 		case 'L': /* GNU cpio */
+ 			cpio->option_follow_links = 1;
+diff --git a/libarchive/archive.h b/libarchive/archive.h
+index 1f0fc38..ef635ac 100644
+--- a/libarchive/archive.h
++++ b/libarchive/archive.h
+@@ -649,6 +649,8 @@ __LA_DECL int archive_read_set_passphrase_callback(struct archive *,
+ /* Default: Do not use HFS+ compression if it was not compressed. */
+ /* This has no effect except on Mac OS v10.6 or later. */
+ #define	ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED	(0x8000)
++/* Default: Do not reject entries with absolute paths */
++#define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000)
+ 
+ __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
+ 		     int flags);
+diff --git a/libarchive/archive_write_disk.3 b/libarchive/archive_write_disk.3
+index fa925cc..a2e7afa 100644
+--- a/libarchive/archive_write_disk.3
++++ b/libarchive/archive_write_disk.3
+@@ -177,6 +177,9 @@ The default is to not refuse such paths.
+ Note that paths ending in
+ .Pa ..
+ always cause an error, regardless of this flag.
++.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
++Refuse to extract an absolute path.
++The default is to not refuse such paths.
+ .It Cm ARCHIVE_EXTRACT_SPARSE
+ Scan data for blocks of NUL bytes and try to recreate them with holes.
+ This results in sparse files, independent of whether the archive format
+diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
+index ab3bdac..c1290eb 100644
+--- a/libarchive/archive_write_disk_posix.c
++++ b/libarchive/archive_write_disk_posix.c
+@@ -2509,8 +2509,9 @@ cleanup_pathname_win(struct archive_write_disk *a)
+ /*
+  * Canonicalize the pathname.  In particular, this strips duplicate
+  * '/' characters, '.' elements, and trailing '/'.  It also raises an
+- * error for an empty path, a trailing '..' or (if _SECURE_NODOTDOT is
+- * set) any '..' in the path.
++ * error for an empty path, a trailing '..', (if _SECURE_NODOTDOT is
++ * set) any '..' in the path or (if ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
++ * is set) if the path is absolute.
+  */
+ static int
+ cleanup_pathname(struct archive_write_disk *a)
+@@ -2529,8 +2530,15 @@ cleanup_pathname(struct archive_write_disk *a)
+ 	cleanup_pathname_win(a);
+ #endif
+ 	/* Skip leading '/'. */
+-	if (*src == '/')
++	if (*src == '/') {
++		if (a->flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {
++			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
++			                  "Path is absolute");
++			return (ARCHIVE_FAILED);
++		}
++
+ 		separator = *src++;
++	}
+ 
+ 	/* Scan the pathname one element at a time. */
+ 	for (;;) {
+diff --git a/libarchive/test/test_write_disk_secure.c b/libarchive/test/test_write_disk_secure.c
+index 31c5bfd..2c94206 100644
+--- a/libarchive/test/test_write_disk_secure.c
++++ b/libarchive/test/test_write_disk_secure.c
+@@ -178,6 +178,29 @@ DEFINE_TEST(test_write_disk_secure)
+ 	assert(S_ISDIR(st.st_mode));
+ 	archive_entry_free(ae);
+ 
++	/*
++	 * Without security checks, we should be able to
++	 * extract an absolute path.
++	 */
++	assert((ae = archive_entry_new()) != NULL);
++	archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++	archive_entry_set_mode(ae, S_IFREG | 0777);
++	assert(0 == archive_write_header(a, ae));
++	assert(0 == archive_write_finish_entry(a));
++	assertFileExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++	assert(0 == unlink("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp"));
++
++	/* But with security checks enabled, this should fail. */
++	assert(archive_entry_clear(ae) != NULL);
++	archive_entry_copy_pathname(ae, "/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++	archive_entry_set_mode(ae, S_IFREG | 0777);
++	archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS);
++	failure("Extracting an absolute path should fail here.");
++	assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae));
++	archive_entry_free(ae);
++	assert(0 == archive_write_finish_entry(a));
++	assertFileNotExists("/tmp/libarchive_test-test_write_disk_secure-absolute_path.tmp");
++
+ 	assertEqualInt(ARCHIVE_OK, archive_write_free(a));
+ 
+ 	/* Test the entries on disk. */
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch b/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch
new file mode 100644
index 0000000..126f80e
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/libarchive-CVE-2013-0211.patch
@@ -0,0 +1,38 @@
+From 2f55d6bd308ea61975558c2469ae349dba297e89 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sat, 22 Feb 2014 14:35:59 +0800
+Subject: [PATCH] Fix CVE-2013-0211
+
+This patch comes from:https://github.com/libarchive/libarchive/commit/22531545514043e04633e1c015c7540b9de9dbe4
+
+Upstream-Status: Backport
+
+Signed-off-by: Baogen shang <baogen.shang@windriver.com>
+
+Update the patch because of uprev on 20140222
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ libarchive/archive_write.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c
+index a3d1a33..a323588 100644
+--- a/libarchive/archive_write.c
++++ b/libarchive/archive_write.c
+@@ -671,8 +671,12 @@ static ssize_t
+ _archive_write_data(struct archive *_a, const void *buff, size_t s)
+ {
+ 	struct archive_write *a = (struct archive_write *)_a;
++	const size_t max_write = INT_MAX;
+ 	archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC,
+ 	    ARCHIVE_STATE_DATA, "archive_write_data");
++	/* In particular, this catches attempts to pass negative values. */
++	if (s > max_write)
++		s = max_write;
+ 	archive_clear_error(&a->archive);
+ 	return ((a->format_write_data)(a, buff, s));
+ }
+-- 
+1.8.2.1
+
diff --git a/meta/recipes-extended/libarchive/libarchive/mkdir.patch b/meta/recipes-extended/libarchive/libarchive/mkdir.patch
new file mode 100644
index 0000000..509a295
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/mkdir.patch
@@ -0,0 +1,45 @@
+Add missing mkdir calls so that out-of-tree builds work.
+
+Upstream-Status: Submitted (https://github.com/libarchive/libarchive/pull/534)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index 3fa2d22..5ecca52 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -508,6 +508,7 @@ libarchive_test_LDADD= $(LTLIBICONV)
+ # Building it automatically provides a sanity-check on libarchive_test_SOURCES
+ # above.
+ libarchive/test/list.h: Makefile
++	$(MKDIR_P) libarchive/test
+ 	cat $(top_srcdir)/libarchive/test/test_*.c | grep DEFINE_TEST > libarchive/test/list.h
+ 
+ libarchive_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test LRZIP=NOCONFIG
+@@ -835,6 +836,7 @@ bsdtar_test_CPPFLAGS=\
+ 	$(PLATFORMCPPFLAGS)
+ 
+ tar/test/list.h: Makefile
++	$(MKDIR_P) tar/test
+ 	cat $(top_srcdir)/tar/test/test_*.c | grep DEFINE_TEST > tar/test/list.h
+ 
+ if BUILD_BSDTAR
+@@ -975,6 +977,7 @@ bsdcpio_test_CPPFLAGS= \
+ bsdcpio_test_LDADD=libarchive_fe.la
+ 
+ cpio/test/list.h: Makefile
++	$(MKDIR_P) cpio/test
+ 	cat $(top_srcdir)/cpio/test/test_*.c | grep DEFINE_TEST > cpio/test/list.h
+ 
+ if BUILD_BSDCPIO
+diff --git a/configure.ac b/configure.ac
+index 38bd299..7bdb00c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -102,6 +102,7 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_LIBTOOL_WIN32_DLL
+ AC_PROG_LIBTOOL
+ AC_CHECK_TOOL([STRIP],[strip])
++AC_PROG_MKDIR_P
+ 
+ #
+ # Options for building bsdtar.
diff --git a/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch b/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch
new file mode 100644
index 0000000..346af91
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/pkgconfig.patch
@@ -0,0 +1,25 @@
+Use pkg-config for the libxml2 dependency, not the -config script.
+
+Upstream-Status: Pending
+
+RP 2014/5/22
+
+Index: libarchive-3.1.2/configure.ac
+===================================================================
+--- libarchive-3.1.2.orig/configure.ac	2013-02-09 17:23:03.000000000 +0000
++++ libarchive-3.1.2/configure.ac	2014-05-13 15:26:45.446499108 +0000
+@@ -329,10 +329,10 @@
+   AS_HELP_STRING([--without-expat], [Don't build support for xar through expat]))
+ 
+ if test "x$with_xml2" != "xno"; then
+-  AC_PATH_PROG([XML2_CONFIG], [xml2-config],, [${PATH}])
+-  if test "x$XML2_CONFIG" != "x"; then
+-    CPPFLAGS="${CPPFLAGS} `${XML2_CONFIG} --cflags`"
+-    LIBS="${LIBS} `${XML2_CONFIG} --libs`"
++  PKG_CHECK_MODULES(PKG_XML2, [libxml-2.0],,)
++  if test "x$PKG_XML2_CFLAGS" != "x"; then
++    CPPFLAGS="${CPPFLAGS} ${PKG_XML2_CFLAGS}"
++    LIBS="${LIBS} ${PKG_XML2_LIBS}"
+     AC_CHECK_LIB(xml2,xmlInitParser,[true],AC_MSG_FAILURE(Missing xml2 library))
+   else
+     AC_CHECK_LIB(xml2,xmlInitParser)
diff --git a/meta/recipes-extended/libarchive/libarchive_3.1.2.bb b/meta/recipes-extended/libarchive/libarchive_3.1.2.bb
new file mode 100644
index 0000000..aaa3255
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive_3.1.2.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Support for reading various archive formats"
+DESCRIPTION = "C library and command-line tools for reading and writing tar, cpio, zip, ISO, and other archive formats"
+HOMEPAGE = "http://www.libarchive.org/"
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b4e3ffd607d6686c6cb2f63394370841"
+
+DEPENDS = "e2fsprogs-native"
+
+PACKAGECONFIG ?= "libxml2 zlib bz2"
+
+PACKAGECONFIG_append_class-target = "\
+	${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
+	${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)} \
+	${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'largefile', '', d)} \
+"
+
+PACKAGECONFIG_append_class-nativesdk = " largefile"
+
+PACKAGECONFIG[acl] = "--enable-acl,--disable-acl,acl,"
+PACKAGECONFIG[xattr] = "--enable-xattr,--disable-xattr,attr,"
+PACKAGECONFIG[largefile] = "--enable-largefile,--disable-largefile,,"
+PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib,"
+PACKAGECONFIG[bz2] = "--with-bz2lib,--without-bz2lib,bzip2,"
+PACKAGECONFIG[xz] = "--with-lzmadec --with-lzma,--without-lzmadec --without-lzma,xz,"
+PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl,"
+PACKAGECONFIG[libxml2] = "--with-xml2,--without-xml2,libxml2,"
+PACKAGECONFIG[expat] = "--with-expat,--without-expat,expat,"
+PACKAGECONFIG[lzo] = "--with-lzo2,--without-lzo2,lzo,"
+PACKAGECONFIG[nettle] = "--with-nettle,--without-nettle,nettle,"
+
+SRC_URI = "http://libarchive.org/downloads/libarchive-${PV}.tar.gz \
+           file://libarchive-CVE-2013-0211.patch \
+           file://pkgconfig.patch \
+           file://0001-Add-ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS-option.patch \
+           file://mkdir.patch \
+           "
+
+SRC_URI[md5sum] = "efad5a503f66329bb9d2f4308b5de98a"
+SRC_URI[sha256sum] = "eb87eacd8fe49e8d90c8fdc189813023ccc319c5e752b01fb6ad0cc7b2c53d5e"
+
+inherit autotools lib_package pkgconfig
+
+CPPFLAGS += "-I${WORKDIR}/extra-includes"
+
+do_configure[cleandirs] += "${WORKDIR}/extra-includes"
+do_configure_prepend() {
+	# We just need the headers for some type constants, so no need to
+	# build all of e2fsprogs for the target
+	cp -R ${STAGING_INCDIR_NATIVE}/ext2fs ${WORKDIR}/extra-includes/
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch b/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch
new file mode 100644
index 0000000..3476bb9
--- /dev/null
+++ b/meta/recipes-extended/libidn/libidn/avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Inappropriate 
+
+automake 1.12.x has deprecated AM_PROG_MKDIR_P , and throws a warning for that,
+and the warnings are treated as errors because of the -Werror parameter.
+
+These AM_PROG_MKDIR_P are coming from gettext, and the latest gettext code has not 
+eliminated these deprecated macros yet. So disable the treatment of warnings
+as errors until gettext is updated to remove the deprecated macros.
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/07/10
+
+Index: libidn-1.24/configure.ac
+===================================================================
+--- libidn-1.24.orig/configure.ac
++++ libidn-1.24/configure.ac
+@@ -23,7 +23,7 @@ AC_COPYRIGHT([Copyright (c) 2002-2011 Si
+ AC_CONFIG_AUX_DIR([build-aux])
+ AC_CONFIG_MACRO_DIR([m4])
+ AC_CONFIG_HEADERS(config.h)
+-AM_INIT_AUTOMAKE([1.10 -Wall -Werror -Wno-override])
++AM_INIT_AUTOMAKE([1.10 -Wall -Wno-override])
+ AM_SILENT_RULES([yes])
+ 
+ # Library code modified:                              REVISION++
diff --git a/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch b/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch
new file mode 100644
index 0000000..0863530
--- /dev/null
+++ b/meta/recipes-extended/libidn/libidn/dont-depend-on-help2man.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurdd libidn-1.26/doc/Makefile.am libidn-1.26/doc/Makefile.am
+--- libidn-1.26/doc/Makefile.am	2012-09-18 11:25:45.000000000 +0300
++++ libidn-1.26/doc/Makefile.am	2013-02-08 07:41:24.591431462 +0200
+@@ -49,15 +49,9 @@
+
+ # Man pages.
+
+-dist_man_MANS = idn.1 $(gdoc_MANS)
++dist_man_MANS = $(gdoc_MANS)
+ MAINTAINERCLEANFILES = $(dist_man_MANS)
+
+-idn.1: $(top_srcdir)/src/idn.c $(top_srcdir)/src/idn.ggo \
+-		$(top_srcdir)/configure.ac
+-	$(HELP2MAN) \
+-		--name="Internationalized Domain Names command line tool" \
+-		--output=$@ $(top_builddir)/src/idn$(EXEEXT)
+-
+ # GDOC
+
+ GDOC_BIN = $(srcdir)/gdoc
diff --git a/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch b/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..20afd25
--- /dev/null
+++ b/meta/recipes-extended/libidn/libidn/libidn_fix_for_automake-1.12.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+This patch fixes following issue with automake 1.12
+
+| automake: warnings are treated as errors
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libidn.la': linking libtool libraries using a non-POSIX
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/03
+
+Index: libidn-1.24/configure.ac
+===================================================================
+--- libidn-1.24.orig/configure.ac
++++ libidn-1.24/configure.ac
+@@ -34,6 +34,10 @@ AC_SUBST(LT_CURRENT, 17)
+ AC_SUBST(LT_REVISION, 7)
+ AC_SUBST(LT_AGE, 6)
+ 
++# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
++m4_pattern_allow([AM_PROG_AR])
++AM_PROG_AR
++
+ AC_PROG_CC
+ gl_EARLY
+ lgl_EARLY
diff --git a/meta/recipes-extended/libidn/libidn_0.6.14.bb b/meta/recipes-extended/libidn/libidn_0.6.14.bb
new file mode 100644
index 0000000..4df1d08
--- /dev/null
+++ b/meta/recipes-extended/libidn/libidn_0.6.14.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Internationalized Domain Name support library"
+DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group."
+HOMEPAGE = "http://www.gnu.org/software/libidn/"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+                    file://COPYING.LIB;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                    file://lib/idna.h;beginline=6;endline=18;md5=1336e848ca7b8e25767c3c7e8fa38a89 \
+                    file://src/idn.c;beginline=6;endline=18;md5=56c89e359652a71cda128d75f0ffdac4"
+PR = "r1"
+
+inherit pkgconfig autotools gettext texinfo
+
+SRC_URI = "http://alpha.gnu.org/gnu/libidn/${BPN}-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "040f012a45feb56168853998bb87ad4d"
+SRC_URI[sha256sum] = "98910c2ad664bdf4eed2c2fff88e24f8882636ec9d26669366ff03b469c05ae3"
+
+do_configure_prepend() {
+	# this version of libidn copies AC_USE_SYSTEM_EXTENSIONS from 
+	# autoconf CVS because atm the autoconf it uses is a bit old
+	# now with cross autotool, that macro is already there and this
+	# local definition causes circular dependency. Actually AC_GNU_SOURCE
+	# is identical to AC_USE_SYSTEM_EXTENSIONS. So remove all local
+	# references to the latter here.
+	sed -i -e "/AC_REQUIRE(\[gl_USE_SYSTEM_EXTENSIONS/d" ${S}/lib/gl/m4/gnulib-comp.m4
+	rm -f ${S}/lib/gl/m4/extensions.m4
+}
+
+do_install_append() {
+	rm -rf ${D}${libdir}/Libidn.dll
+	rm -rf ${D}${datadir}/emacs
+}
diff --git a/meta/recipes-extended/libidn/libidn_1.30.bb b/meta/recipes-extended/libidn/libidn_1.30.bb
new file mode 100644
index 0000000..7234747
--- /dev/null
+++ b/meta/recipes-extended/libidn/libidn_1.30.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Internationalized Domain Name support library"
+DESCRIPTION = "Implementation of the Stringprep, Punycode and IDNA specifications defined by the IETF Internationalized Domain Names (IDN) working group."
+HOMEPAGE = "http://www.gnu.org/software/libidn/"
+SECTION = "libs"
+LICENSE = "(LGPLv2.1+ | LGPLv3) & GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=df4be47940a91ee69556f5f71eed4aec \
+                    file://COPYING.LESSERv2;md5=4fbd65380cdd255951079008b364516c \
+                    file://COPYING.LESSERv3;md5=e6a600fd5e1d9cbde2d983680233ad02 \
+                    file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYINGv3;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://lib/idna.h;endline=21;md5=7c0b3828d1b153663be9a04ad4f7975f \
+                    file://src/idn.c;endline=20;md5=f4235f2a2cb2b65786b2979fb3cf7fbf"
+
+inherit pkgconfig autotools gettext texinfo
+
+SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \
+           file://libidn_fix_for_automake-1.12.patch \
+           file://avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch \
+           file://dont-depend-on-help2man.patch \
+"
+
+SRC_URI[md5sum] = "b17edc8551cd31cc5f14c82a9dabf58e"
+SRC_URI[sha256sum] = "39b9fc94d74081c185757b12e0891ce5a22db55268e7d1bb24533ff4432eb053"
+
+# command tool is under GPLv3+, while libidn itself is under LGPLv2.1+ or LGPLv3
+# so package command into a separate package
+PACKAGES =+ "idn"
+FILES_idn = "${bindir}/*"
+
+EXTRA_OECONF = "--disable-csharp"
+
+do_install_append() {
+	rm -rf ${D}${datadir}/emacs
+}
diff --git a/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch b/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch
new file mode 100644
index 0000000..4a785d3
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/libtirpc-0.2.1-fortify.patch
@@ -0,0 +1,26 @@
+Fix a possible overflow (reported by _FORTIFY_SOURCE=2)
+
+Ported from Gentoo
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libtirpc-0.2.1/src/getrpcport.c
+===================================================================
+--- libtirpc-0.2.1.orig/src/getrpcport.c
++++ libtirpc-0.2.1/src/getrpcport.c
+@@ -54,11 +54,11 @@ getrpcport(host, prognum, versnum, proto
+ 
+ 	if ((hp = gethostbyname(host)) == NULL)
+ 		return (0);
++	if (hp->h_length != sizeof(addr.sin_addr.s_addr))
++		return (0);
+ 	memset(&addr, 0, sizeof(addr));
+ 	addr.sin_family = AF_INET;
+ 	addr.sin_port =  0;
+-	if (hp->h_length > sizeof(addr))
+-	  hp->h_length = sizeof(addr);
+ 	memcpy(&addr.sin_addr.s_addr, hp->h_addr, (size_t)hp->h_length);
+ 	/* Inconsistent interfaces need casts! :-( */
+ 	return (pmap_getport(&addr, (u_long)prognum, (u_long)versnum, 
diff --git a/meta/recipes-extended/libtirpc/libtirpc/remove-des-uclibc.patch b/meta/recipes-extended/libtirpc/libtirpc/remove-des-uclibc.patch
new file mode 100644
index 0000000..d003348
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc/remove-des-uclibc.patch
@@ -0,0 +1,38 @@
+uclibc does not provide des functionality unlike eglibc so lets disable ssl support
+
+Upstream-Status: Inappropriate [uclibc specific]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libtirpc-0.2.3/src/rpc_soc.c
+===================================================================
+--- libtirpc-0.2.3.orig/src/rpc_soc.c	2013-03-10 16:00:51.355282153 -0700
++++ libtirpc-0.2.3/src/rpc_soc.c	2013-03-10 16:00:51.703282148 -0700
+@@ -520,6 +520,7 @@
+ 	    (resultproc_t) rpc_wrap_bcast, "udp");
+ }
+ 
++#if 0
+ /*
+  * Create the client des authentication object. Obsoleted by
+  * authdes_seccreate().
+@@ -551,6 +552,7 @@
+ 	dummy = authdes_seccreate(servername, window, NULL, ckey);
+ 	return (dummy);
+ }
++#endif
+ 
+ /*
+  * Create a client handle for a unix connection. Obsoleted by clnt_vc_create()
+Index: libtirpc-0.2.3/src/Makefile.am
+===================================================================
+--- libtirpc-0.2.3.orig/src/Makefile.am	2013-03-10 16:00:51.355282153 -0700
++++ libtirpc-0.2.3/src/Makefile.am	2013-03-10 16:00:51.703282148 -0700
+@@ -50,7 +50,7 @@
+         rpc_callmsg.c rpc_generic.c rpc_soc.c rpcb_clnt.c rpcb_prot.c \
+         rpcb_st_xdr.c svc.c svc_auth.c svc_dg.c svc_auth_unix.c svc_auth_none.c \
+         svc_generic.c svc_raw.c svc_run.c svc_simple.c svc_vc.c getpeereid.c \
+-        auth_time.c auth_des.c authdes_prot.c
++        auth_time.c
+ 
+ ## XDR
+ libtirpc_la_SOURCES += xdr.c xdr_rec.c xdr_array.c xdr_float.c xdr_mem.c xdr_reference.c xdr_stdio.c
diff --git a/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb b/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb
new file mode 100644
index 0000000..3edf002
--- /dev/null
+++ b/meta/recipes-extended/libtirpc/libtirpc_0.2.5.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Transport-Independent RPC library"
+DESCRIPTION = "Libtirpc is a port of Suns Transport-Independent RPC library to Linux"
+SECTION = "libs/network"
+HOMEPAGE = "http://sourceforge.net/projects/libtirpc/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=183075&atid=903784"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f835cce8852481e4b2bbbdd23b5e47f3 \
+                    file://src/netname.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24"
+
+DEPENDS += "xz-native"
+PROVIDES = "virtual/librpc"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.bz2;name=libtirpc \
+           ${GENTOO_MIRROR}/${BPN}-glibc-nfs.tar.xz;name=glibc-nfs \
+           file://libtirpc-0.2.1-fortify.patch \
+          "
+
+SRC_URI_append_libc-uclibc = " file://remove-des-uclibc.patch"
+
+SRC_URI[libtirpc.md5sum] = "8cd41a5ef5a9b50d0fb6abb98af15368"
+SRC_URI[libtirpc.sha256sum] = "62f9de7c2c8686c568757730e1fef66502a0e00d6cacf33546d0267984e002db"
+SRC_URI[glibc-nfs.md5sum] = "5ae500b9d0b6b72cb875bc04944b9445"
+SRC_URI[glibc-nfs.sha256sum] = "2677cfedf626f3f5a8f6e507aed5bb8f79a7453b589d684dbbc086e755170d83"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-gssapi"
+
+do_configure_prepend () {
+        cp -r ${S}/../tirpc ${S}
+}
+
+do_install_append() {
+        chown root:root ${D}${sysconfdir}/netconfig
+}
diff --git a/meta/recipes-extended/libuser/libuser_0.62.bb b/meta/recipes-extended/libuser/libuser_0.62.bb
new file mode 100644
index 0000000..c4ed459
--- /dev/null
+++ b/meta/recipes-extended/libuser/libuser_0.62.bb
@@ -0,0 +1,30 @@
+SUMMARY = "user and group account administration library"
+DESCRIPTION = "The libuser library implements a standardized interface for manipulating and administering user \
+and group accounts"
+HOMEPAGE = "https://fedorahosted.org/libuser/"
+BUGTRACKER = "https://fedorahosted.org/libuser/newticket"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
+                    file://lib/user.h;endline=19;md5=76b301f63c39fa992062395efbdc9558 \
+                    file://samples/testuser.c;endline=19;md5=3b87fa660fa3f4a6bb31d624afe30ba1"
+
+SECTION = "base"
+
+SRC_URI = "https://fedorahosted.org/releases/l/i/libuser/libuser-${PV}.tar.xz \
+           "
+
+SRC_URI[md5sum] = "63e5e5c551e99dc5302b40b80bd6d4f2"
+SRC_URI[sha256sum] = "a58ff4fabb01a25043b142185a33eeea961109dd60d4b40b6a9df4fa3cace20b"
+
+DEPENDS = "popt libpam glib-2.0 xz-native docbook-utils-native linuxdoc-tools-native python"
+
+inherit autotools gettext pythonnative python-dir pkgconfig
+
+EXTRA_OEMAKE = "PYTHON_CPPFLAGS=-I${STAGING_INCDIR}/${PYTHON_DIR}"
+
+PACKAGES += "${PN}-python "
+
+FILES_${PN}-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug"
+FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
+
diff --git a/meta/recipes-extended/lighttpd/lighttpd/0001-mod_cgi-buffers-data-without-bound.patch b/meta/recipes-extended/lighttpd/lighttpd/0001-mod_cgi-buffers-data-without-bound.patch
new file mode 100644
index 0000000..a9df174
--- /dev/null
+++ b/meta/recipes-extended/lighttpd/lighttpd/0001-mod_cgi-buffers-data-without-bound.patch
@@ -0,0 +1,387 @@
+From e6ccbab5d42b110ac4f6ce1f72cb1e9ccbe4400a Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Tue, 16 Jun 2015 19:02:38 +0900
+Subject: [PATCH] mod_cgi buffers data without bound so fix it
+
+Upstream-Status: Submitted [http://redmine.lighttpd.net/issues/1264]
+
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+
+Update context for 1.4.36.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ doc/config/lighttpd.conf |   8 ++
+ src/mod_cgi.c            | 188 ++++++++++++++++++++++++++++++++++++++++++++---
+ 2 files changed, 187 insertions(+), 9 deletions(-)
+
+diff --git a/doc/config/lighttpd.conf b/doc/config/lighttpd.conf
+index 60b0ae1..9c101a7 100644
+--- a/doc/config/lighttpd.conf
++++ b/doc/config/lighttpd.conf
+@@ -375,6 +375,14 @@ server.upload-dirs = ( "/var/tmp" )
+ ##
+ #######################################################################
+ 
++#######################################################################
++##
++##
++## maximum bytes in send_raw before backing off [KByte]
++##  cgi.high-waterlevel        = 10240
++## minimum bytes in send_raw to disable backoff [KByte]
++##  cgi.low-waterlevel         = 5120
++#######################################################################
+ 
+ #######################################################################
+ ##
+diff --git a/src/mod_cgi.c b/src/mod_cgi.c
+index 01b1877..7c67eb5 100644
+--- a/src/mod_cgi.c
++++ b/src/mod_cgi.c
+@@ -38,6 +38,10 @@
+ 
+ #include "version.h"
+ 
++/* for output logs */
++char msgbuf[2048];
++
++
+ enum {EOL_UNSET, EOL_N, EOL_RN};
+ 
+ typedef struct {
+@@ -53,9 +57,19 @@ typedef struct {
+ 	size_t size;
+ } buffer_pid_t;
+ 
++struct handler_ctx;
++
++typedef struct {
++	struct handler_ctx **hctx;
++	size_t used;
++	size_t size;
++} buffer_ctx_t;
++
+ typedef struct {
+ 	array *cgi;
+ 	unsigned short execute_x_only;
++	unsigned int high_waterlevel; /* maximum bytes in send_raw before backing off */
++	unsigned int low_waterlevel;  /* minimum bytes in send_raw to disable backoff */
+ } plugin_config;
+ 
+ typedef struct {
+@@ -68,9 +82,11 @@ typedef struct {
+ 	plugin_config **config_storage;
+ 
+ 	plugin_config conf;
++
++	buffer_ctx_t cgi_ctx;
+ } plugin_data;
+ 
+-typedef struct {
++typedef struct handler_ctx {
+ 	pid_t pid;
+ 	int fd;
+ 	int fde_ndx; /* index into the fd-event buffer */
+@@ -78,11 +94,16 @@ typedef struct {
+ 	connection *remote_conn;  /* dumb pointer */
+ 	plugin_data *plugin_data; /* dumb pointer */
+ 
++	int throttling;        /* 1=waiting for send_raw buffer to drain */
++	off_t high_waterlevel; /* maximum bytes in send_raw before backing off */
++	off_t low_waterlevel;  /* minimum bytes in send_raw to disable backoff */
++	off_t bytes_in_buffer;
++
+ 	buffer *response;
+ 	buffer *response_header;
+ } handler_ctx;
+ 
+-static handler_ctx * cgi_handler_ctx_init(void) {
++static handler_ctx * cgi_handler_ctx_init(plugin_data *p) {
+ 	handler_ctx *hctx = calloc(1, sizeof(*hctx));
+ 
+ 	force_assert(hctx);
+@@ -90,13 +111,26 @@ static handler_ctx * cgi_handler_ctx_init(void) {
+ 	hctx->response = buffer_init();
+ 	hctx->response_header = buffer_init();
+ 
++	hctx->throttling = 0;
++	hctx->high_waterlevel = (off_t)p->conf.high_waterlevel * 1024;
++	hctx->low_waterlevel  = (off_t)p->conf.low_waterlevel  * 1024;
++	if (hctx->low_waterlevel >= hctx->high_waterlevel) {
++	    hctx->low_waterlevel = hctx->high_waterlevel * 3 / 4; /* 75% */
++	}
++	hctx->bytes_in_buffer = 0;
++
+ 	return hctx;
+ }
+ 
+-static void cgi_handler_ctx_free(handler_ctx *hctx) {
++static void cgi_handler_ctx_free(server *srv, handler_ctx *hctx) {
+ 	buffer_free(hctx->response);
+ 	buffer_free(hctx->response_header);
+ 
++	/* to avoid confusion */
++	if (hctx->throttling) {
++	    log_error_write(srv, __FILE__, __LINE__, "s", "unthrottled");
++	}
++
+ 	free(hctx);
+ }
+ 
+@@ -154,6 +188,8 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
+ 	config_values_t cv[] = {
+ 		{ "cgi.assign",                  NULL, T_CONFIG_ARRAY, T_CONFIG_SCOPE_CONNECTION },       /* 0 */
+ 		{ "cgi.execute-x-only",          NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },     /* 1 */
++		{ "cgi.high-waterlevel",         NULL, T_CONFIG_INT,   T_CONFIG_SCOPE_CONNECTION },       /* 2 */
++		{ "cgi.low-waterlevel",          NULL, T_CONFIG_INT,   T_CONFIG_SCOPE_CONNECTION },       /* 3 */
+ 		{ NULL,                          NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET}
+ 	};
+ 
+@@ -169,9 +205,13 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
+ 
+ 		s->cgi    = array_init();
+ 		s->execute_x_only = 0;
++		s->high_waterlevel = 0; /* 0 == disabled */
++		s->low_waterlevel  = 0;
+ 
+ 		cv[0].destination = s->cgi;
+ 		cv[1].destination = &(s->execute_x_only);
++		cv[2].destination = &(s->high_waterlevel);
++		cv[3].destination = &(s->low_waterlevel);
+ 
+ 		p->config_storage[i] = s;
+ 
+@@ -184,6 +224,51 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
+ }
+ 
+ 
++static void cgi_recount_bytes_in_buffer(handler_ctx *hctx)
++{
++	chunkqueue *cq = hctx->remote_conn->write_queue;
++	hctx->bytes_in_buffer = chunkqueue_length(cq) - chunkqueue_written(cq);
++}
++
++
++static void cgi_throttling_control(server *srv, handler_ctx *hctx)
++{
++	cgi_recount_bytes_in_buffer(hctx);
++
++#ifdef DEBUG
++	sprintf(msgbuf, "throttling=%d, chars=%llu, high=%llu, low=%llu",
++		hctx->throttling, hctx->bytes_in_buffer,
++		hctx->high_waterlevel, hctx->low_waterlevel);
++	log_error_write(srv, __FILE__, __LINE__, "ss",
++			"(debug) throttling control,", msgbuf);
++#endif
++
++	if (hctx->throttling) {
++		sprintf(msgbuf, "throttling; chars in queue=%llu,"
++			" low-waterlevel=%llu, high-waterlevel=%llu",
++			hctx->bytes_in_buffer,
++			hctx->low_waterlevel, hctx->high_waterlevel);
++		log_error_write(srv, __FILE__, __LINE__, "s", msgbuf);
++		if (hctx->bytes_in_buffer <= hctx->low_waterlevel) {
++			fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
++			hctx->throttling = 0;
++			log_error_write(srv, __FILE__, __LINE__, "s", "unthrottled");
++		}
++	} else {
++		if (hctx->high_waterlevel != 0 &&
++			hctx->high_waterlevel <= hctx->bytes_in_buffer) {
++			fdevent_event_del(srv->ev, &(hctx->fde_ndx), hctx->fd);
++			hctx->throttling = 1;
++			sprintf(msgbuf, "throttled; chars in queue=%llu,"
++				" low-waterlevel=%llu, high-waterlevel=%llu",
++				hctx->bytes_in_buffer,
++				hctx->low_waterlevel, hctx->high_waterlevel);
++			log_error_write(srv, __FILE__, __LINE__, "s", msgbuf);
++		}
++	}
++}
++
++
+ static int cgi_pid_add(server *srv, plugin_data *p, pid_t pid) {
+ 	int m = -1;
+ 	size_t i;
+@@ -230,6 +315,39 @@ static int cgi_pid_del(server *srv, plugin_data *p, pid_t pid) {
+ 	return 0;
+ }
+ 
++
++static void cgi_ctx_add(plugin_data *p, handler_ctx *hctx) {
++	buffer_ctx_t *r = &(p->cgi_ctx);
++
++	if (r->size == 0) {
++		r->size = 16;
++		r->hctx = malloc(sizeof(*r->hctx) * r->size);
++	} else if (r->used == r->size) {
++		r->size += 16;
++		r->hctx = realloc(r->hctx, sizeof(*r->hctx) * r->size);
++	}
++
++	r->hctx[r->used++] = hctx;
++}
++
++static void cgi_ctx_del(plugin_data *p, handler_ctx *hctx) {
++	size_t i;
++	buffer_ctx_t *r = &(p->cgi_ctx);
++
++	for (i = 0; i < r->used; i++) {
++		if (r->hctx[i] == hctx) break;
++	}
++
++	if (i != r->used) {
++		/* found */
++
++		if (i != r->used - 1) {
++			r->hctx[i] = r->hctx[r->used - 1];
++		}
++		r->used--;
++	}
++}
++
+ static int cgi_response_parse(server *srv, connection *con, plugin_data *p, buffer *in) {
+ 	char *ns;
+ 	const char *s;
+@@ -380,6 +498,14 @@ static int cgi_demux_response(server *srv, handler_ctx *hctx) {
+ 
+ 		buffer_commit(hctx->response, n);
+ 
++#ifdef DEBUG
++		sprintf(msgbuf, "n=%d, bytes_out=%llu, bytes_in=%llu", n,
++			(unsigned long long)con->write_queue->bytes_out,
++			(unsigned long long)con->write_queue->bytes_in);
++		log_error_write(srv, __FILE__, __LINE__, "ss",
++				"(debug) read,", msgbuf);
++#endif
++
+ 		/* split header from body */
+ 
+ 		if (con->file_started == 0) {
+@@ -503,7 +629,20 @@ static int cgi_demux_response(server *srv, handler_ctx *hctx) {
+ 			}
+ 		} else {
+ 			http_chunk_append_buffer(srv, con, hctx->response);
++#ifdef DEBUG
++			sprintf(msgbuf, "n=%d, bytes_out=%llu, bytes_in=%llu, limit=%llu", n,
++				(unsigned long long)con->write_queue->bytes_out,
++				(unsigned long long)con->write_queue->bytes_in,
++				(unsigned long long)hctx->high_waterlevel);
++			log_error_write(srv, __FILE__, __LINE__,
++					"ss", "(debug) append,", msgbuf);
++#endif
+ 			joblist_append(srv, con);
++
++			cgi_throttling_control(srv, hctx);
++			if (hctx->throttling) {
++				return FDEVENT_HANDLED_NOT_FINISHED;
++			}
+ 		}
+ 
+ #if 0
+@@ -553,8 +692,9 @@ static handler_t cgi_connection_close(server *srv, handler_ctx *hctx) {
+ 	con->plugin_ctx[p->id] = NULL;
+ 
+ 	/* is this a good idea ? */
+-	cgi_handler_ctx_free(hctx);
+-
++	cgi_ctx_del(p, hctx);
++	cgi_handler_ctx_free(srv, hctx);
++	
+ 	/* if waitpid hasn't been called by response.c yet, do it here */
+ 	if (pid) {
+ 		/* check if the CGI-script is already gone */
+@@ -1105,7 +1245,8 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
+ 		con->mode = p->id;
+ 		buffer_reset(con->physical.path);
+ 
+-		hctx = cgi_handler_ctx_init();
++		hctx = cgi_handler_ctx_init(p);
++		cgi_ctx_add(p, hctx);
+ 
+ 		hctx->remote_conn = con;
+ 		hctx->plugin_data = p;
+@@ -1114,6 +1255,11 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
+ 		hctx->fde_ndx = -1;
+ 
+ 		con->plugin_ctx[p->id] = hctx;
++#ifdef DEBUG
++		sprintf(msgbuf, "hctx=%p, con=%p", (void*)hctx, (void*)con);
++		log_error_write(srv, __FILE__, __LINE__, "ss",
++				"(debug) hctx generated, ", msgbuf);
++#endif
+ 
+ 		fdevent_register(srv->ev, hctx->fd, cgi_handle_fdevent, hctx);
+ 		fdevent_event_set(srv->ev, &(hctx->fde_ndx), hctx->fd, FDEVENT_IN);
+@@ -1128,7 +1274,8 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
+ 
+ 			close(hctx->fd);
+ 
+-			cgi_handler_ctx_free(hctx);
++			cgi_ctx_del(p, hctx);
++			cgi_handler_ctx_free(srv, hctx);
+ 
+ 			con->plugin_ctx[p->id] = NULL;
+ 
+@@ -1153,6 +1300,8 @@ static int mod_cgi_patch_connection(server *srv, connection *con, plugin_data *p
+ 
+ 	PATCH(cgi);
+ 	PATCH(execute_x_only);
++	PATCH(high_waterlevel);
++	PATCH(low_waterlevel);
+ 
+ 	/* skip the first, the global context */
+ 	for (i = 1; i < srv->config_context->used; i++) {
+@@ -1170,6 +1319,10 @@ static int mod_cgi_patch_connection(server *srv, connection *con, plugin_data *p
+ 				PATCH(cgi);
+ 			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.execute-x-only"))) {
+ 				PATCH(execute_x_only);
++			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.high-waterlevel"))) {
++				PATCH(high_waterlevel);
++			} else if (buffer_is_equal_string(du->key, CONST_STR_LEN("cgi.low-waterlevel"))) {
++				PATCH(low_waterlevel);
+ 			}
+ 		}
+ 	}
+@@ -1222,6 +1375,21 @@ URIHANDLER_FUNC(cgi_is_handled) {
+ TRIGGER_FUNC(cgi_trigger) {
+ 	plugin_data *p = p_d;
+ 	size_t ndx;
++
++	for (ndx = 0; ndx < p->cgi_ctx.used; ndx++) {
++		handler_ctx *hctx = p->cgi_ctx.hctx[ndx];
++#ifdef DEBUG
++		connection *con = hctx->remote_conn;
++	
++		sprintf(msgbuf, "hctx=%p, con=%p, bytes_in_buffer=%llu",
++			(void*)hctx, (void*)con,
++			(unsigned long long)hctx->bytes_in_buffer);
++		log_error_write(srv, __FILE__, __LINE__, "ss",
++				"(debug) found using ctx,", msgbuf);
++#endif
++		cgi_throttling_control(srv, hctx);
++	}
++
+ 	/* the trigger handle only cares about lonely PID which we have to wait for */
+ #ifndef __WIN32
+ 
+@@ -1330,7 +1498,8 @@ SUBREQUEST_FUNC(mod_cgi_handle_subrequest) {
+ 			log_error_write(srv, __FILE__, __LINE__, "sds", "cgi close failed ", hctx->fd, strerror(errno));
+ 		}
+ 
+-		cgi_handler_ctx_free(hctx);
++		cgi_ctx_del(p, hctx);
++		cgi_handler_ctx_free(srv, hctx);
+ 
+ 		con->plugin_ctx[p->id] = NULL;
+ 
+@@ -1362,7 +1531,8 @@ SUBREQUEST_FUNC(mod_cgi_handle_subrequest) {
+ 			log_error_write(srv, __FILE__, __LINE__, "sds", "cgi close failed ", hctx->fd, strerror(errno));
+ 		}
+ 
+-		cgi_handler_ctx_free(hctx);
++		cgi_ctx_del(p, hctx);
++		cgi_handler_ctx_free(srv, hctx);
+ 
+ 		con->plugin_ctx[p->id] = NULL;
+ 		return HANDLER_FINISHED;
diff --git a/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd b/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd
new file mode 100644
index 0000000..f5f1c37
--- /dev/null
+++ b/meta/recipes-extended/lighttpd/lighttpd/index.html.lighttpd
@@ -0,0 +1 @@
+<html><body><h1>It works!</h1></body></html>
diff --git a/meta/recipes-extended/lighttpd/lighttpd/lighttpd b/meta/recipes-extended/lighttpd/lighttpd/lighttpd
new file mode 100644
index 0000000..bf89a60
--- /dev/null
+++ b/meta/recipes-extended/lighttpd/lighttpd/lighttpd
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/sbin/lighttpd
+NAME=lighttpd
+DESC="Lighttpd Web Server"
+OPTS="-f /etc/lighttpd.conf"
+
+case "$1" in
+  start)
+	echo -n "Starting $DESC: "
+	start-stop-daemon --start -x "$DAEMON" -- $OPTS
+	echo "$NAME."
+	;;
+  stop)
+	echo -n "Stopping $DESC: "
+	start-stop-daemon --stop -x "$DAEMON"
+	echo "$NAME."
+	;;
+  restart|force-reload)
+	echo -n "Restarting $DESC: "
+	start-stop-daemon --stop -x "$DAEMON"
+	sleep 1
+	start-stop-daemon --start -x "$DAEMON" -- $OPTS
+	echo "$NAME."
+	;;
+  *)
+	N=/etc/init.d/$NAME
+	echo "Usage: $N {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf b/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf
new file mode 100644
index 0000000..6e8402d
--- /dev/null
+++ b/meta/recipes-extended/lighttpd/lighttpd/lighttpd.conf
@@ -0,0 +1,331 @@
+# lighttpd configuration file
+#
+# use it as a base for lighttpd 1.0.0 and above
+#
+# $Id: lighttpd.conf,v 1.7 2004/11/03 22:26:05 weigon Exp $
+
+############ Options you really have to take care of ####################
+
+## modules to load
+# at least mod_access and mod_accesslog should be loaded
+# all other module should only be loaded if really neccesary
+# - saves some time
+# - saves memory
+server.modules              = (
+#                               "mod_rewrite",
+#                               "mod_redirect",
+#                               "mod_alias",
+                                "mod_access",
+#                               "mod_cml",
+#                               "mod_trigger_b4_dl",
+#                               "mod_auth",
+#                               "mod_status",
+#                               "mod_setenv",
+#                               "mod_fastcgi",
+#                               "mod_proxy",
+#                               "mod_simple_vhost",
+#                               "mod_evhost",
+#                               "mod_userdir",
+#                               "mod_cgi",
+#                               "mod_compress",
+#                               "mod_ssi",
+#                               "mod_usertrack",
+#                               "mod_expire",
+#                               "mod_secdownload",
+#                               "mod_rrdtool",
+#				"mod_webdav",
+                                "mod_accesslog" )
+
+## a static document-root, for virtual-hosting take look at the
+## server.virtual-* options
+server.document-root        = "/www/pages/"
+
+## where to send error-messages to
+server.errorlog             = "/www/logs/lighttpd.error.log"
+
+# files to check for if .../ is requested
+index-file.names            = ( "index.php", "index.html",
+                                "index.htm", "default.htm" )
+
+## set the event-handler (read the performance section in the manual)
+# server.event-handler = "freebsd-kqueue" # needed on OS X
+
+# mimetype mapping
+mimetype.assign             = (
+  ".pdf"          =>      "application/pdf",
+  ".sig"          =>      "application/pgp-signature",
+  ".spl"          =>      "application/futuresplash",
+  ".class"        =>      "application/octet-stream",
+  ".ps"           =>      "application/postscript",
+  ".torrent"      =>      "application/x-bittorrent",
+  ".dvi"          =>      "application/x-dvi",
+  ".gz"           =>      "application/x-gzip",
+  ".pac"          =>      "application/x-ns-proxy-autoconfig",
+  ".swf"          =>      "application/x-shockwave-flash",
+  ".tar.gz"       =>      "application/x-tgz",
+  ".tgz"          =>      "application/x-tgz",
+  ".tar"          =>      "application/x-tar",
+  ".zip"          =>      "application/zip",
+  ".mp3"          =>      "audio/mpeg",
+  ".m3u"          =>      "audio/x-mpegurl",
+  ".wma"          =>      "audio/x-ms-wma",
+  ".wax"          =>      "audio/x-ms-wax",
+  ".ogg"          =>      "application/ogg",
+  ".wav"          =>      "audio/x-wav",
+  ".gif"          =>      "image/gif",
+  ".jpg"          =>      "image/jpeg",
+  ".jpeg"         =>      "image/jpeg",
+  ".png"          =>      "image/png",
+  ".xbm"          =>      "image/x-xbitmap",
+  ".xpm"          =>      "image/x-xpixmap",
+  ".xwd"          =>      "image/x-xwindowdump",
+  ".css"          =>      "text/css",
+  ".html"         =>      "text/html",
+  ".htm"          =>      "text/html",
+  ".js"           =>      "text/javascript",
+  ".asc"          =>      "text/plain",
+  ".c"            =>      "text/plain",
+  ".cpp"          =>      "text/plain",
+  ".log"          =>      "text/plain",
+  ".conf"         =>      "text/plain",
+  ".text"         =>      "text/plain",
+  ".txt"          =>      "text/plain",
+  ".dtd"          =>      "text/xml",
+  ".xml"          =>      "text/xml",
+  ".mpeg"         =>      "video/mpeg",
+  ".mpg"          =>      "video/mpeg",
+  ".mov"          =>      "video/quicktime",
+  ".qt"           =>      "video/quicktime",
+  ".avi"          =>      "video/x-msvideo",
+  ".asf"          =>      "video/x-ms-asf",
+  ".asx"          =>      "video/x-ms-asf",
+  ".wmv"          =>      "video/x-ms-wmv",
+  ".bz2"          =>      "application/x-bzip",
+  ".tbz"          =>      "application/x-bzip-compressed-tar",
+  ".tar.bz2"      =>      "application/x-bzip-compressed-tar"
+ )
+
+# Use the "Content-Type" extended attribute to obtain mime type if possible
+#mimetype.use-xattr        = "enable"
+
+
+## send a different Server: header
+## be nice and keep it at lighttpd
+# server.tag                 = "lighttpd"
+
+#### accesslog module
+accesslog.filename          = "/www/logs/access.log"
+debug.log-request-handling = "enable"
+
+
+
+
+## deny access the file-extensions
+#
+# ~    is for backupfiles from vi, emacs, joe, ...
+# .inc is often used for code includes which should in general not be part
+#      of the document-root
+url.access-deny             = ( "~", ".inc" )
+
+$HTTP["url"] =~ "\.pdf$" {
+  server.range-requests = "disable"
+}
+
+##
+# which extensions should not be handle via static-file transfer
+#
+# .php, .pl, .fcgi are most often handled by mod_fastcgi or mod_cgi
+static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
+
+######### Options that are good to be but not neccesary to be changed #######
+
+## bind to port (default: 80)
+#server.port                = 81
+
+## bind to localhost (default: all interfaces)
+#server.bind                = "grisu.home.kneschke.de"
+
+## error-handler for status 404
+#server.error-handler-404   = "/error-handler.html"
+#server.error-handler-404   = "/error-handler.php"
+
+## to help the rc.scripts
+#server.pid-file            = "/var/run/lighttpd.pid"
+
+
+###### virtual hosts
+##
+##  If you want name-based virtual hosting add the next three settings and load
+##  mod_simple_vhost
+##
+## document-root =
+##   virtual-server-root + virtual-server-default-host + virtual-server-docroot
+## or
+##   virtual-server-root + http-host + virtual-server-docroot
+##
+#simple-vhost.server-root   = "/home/weigon/wwwroot/servers/"
+#simple-vhost.default-host  = "grisu.home.kneschke.de"
+#simple-vhost.document-root = "/pages/"
+
+
+##
+## Format: <errorfile-prefix><status-code>.html
+## -> ..../status-404.html for 'File not found'
+#server.errorfile-prefix    = "/home/weigon/projects/lighttpd/doc/status-"
+
+## virtual directory listings
+#dir-listing.activate       = "enable"
+
+## enable debugging
+#debug.log-request-header   = "enable"
+#debug.log-response-header  = "enable"
+#debug.log-request-handling = "enable"
+#debug.log-file-not-found   = "enable"
+
+### only root can use these options
+#
+# chroot() to directory (default: no chroot() )
+#server.chroot              = "/"
+
+## change uid to <uid> (default: don't care)
+#server.username            = "wwwrun"
+
+## change uid to <uid> (default: don't care)
+#server.groupname           = "wwwrun"
+
+#### compress module
+#compress.cache-dir         = "/tmp/lighttpd/cache/compress/"
+#compress.filetype          = ("text/plain", "text/html")
+
+#### proxy module
+## read proxy.txt for more info
+#proxy.server               = ( ".php" =>
+#                               ( "localhost" =>
+#                                 (
+#                                   "host" => "192.168.0.101",
+#                                   "port" => 80
+#                                 )
+#                               )
+#                             )
+
+#### fastcgi module
+## read fastcgi.txt for more info
+## for PHP don't forget to set cgi.fix_pathinfo = 1 in the php.ini
+#fastcgi.server             = ( ".php" =>
+#                               ( "localhost" =>
+#                                 (
+#                                   "socket" => "/tmp/php-fastcgi.socket",
+#                                   "bin-path" => "/usr/local/bin/php"
+#                                 )
+#                               )
+#                            )
+
+#### CGI module
+#cgi.assign                 = ( ".pl"  => "/usr/bin/perl",
+#                               ".cgi" => "/usr/bin/perl" )
+#
+
+#### SSL engine
+#ssl.engine                 = "enable"
+#ssl.pemfile                = "server.pem"
+
+#### status module
+#status.status-url          = "/server-status"
+#status.config-url          = "/server-config"
+
+#### auth module
+## read authentication.txt for more info
+#auth.backend               = "plain"
+#auth.backend.plain.userfile = "lighttpd.user"
+#auth.backend.plain.groupfile = "lighttpd.group"
+
+#auth.backend.ldap.hostname = "localhost"
+#auth.backend.ldap.base-dn  = "dc=my-domain,dc=com"
+#auth.backend.ldap.filter   = "(uid=$)"
+
+#auth.require               = ( "/server-status" =>
+#                               (
+#                                 "method"  => "digest",
+#                                 "realm"   => "download archiv",
+#                                 "require" => "user=jan"
+#                               ),
+#                               "/server-config" =>
+#                               (
+#                                 "method"  => "digest",
+#                                 "realm"   => "download archiv",
+#                                 "require" => "valid-user"
+#                               )
+#                             )
+
+#### url handling modules (rewrite, redirect, access)
+#url.rewrite                = ( "^/$"             => "/server-status" )
+#url.redirect               = ( "^/wishlist/(.+)" => "http://www.123.org/$1" )
+
+#### both rewrite/redirect support back reference to regex conditional using %n
+#$HTTP["host"] =~ "^www\.(.*)" {
+#  url.redirect            = ( "^/(.*)" => "http://%1/$1" )
+#}
+
+#
+# define a pattern for the host url finding
+# %% => % sign
+# %0 => domain name + tld
+# %1 => tld
+# %2 => domain name without tld
+# %3 => subdomain 1 name
+# %4 => subdomain 2 name
+#
+#evhost.path-pattern        = "/home/storage/dev/www/%3/htdocs/"
+
+#### expire module
+#expire.url                 = ( "/buggy/" => "access 2 hours", "/asdhas/" => "access plus 1 seconds 2 minutes")
+
+#### ssi
+#ssi.extension              = ( ".shtml" )
+
+#### rrdtool
+#rrdtool.binary             = "/usr/bin/rrdtool"
+#rrdtool.db-name            = "/var/www/lighttpd.rrd"
+
+#### setenv
+#setenv.add-request-header  = ( "TRAV_ENV" => "mysql://user@host/db" )
+#setenv.add-response-header = ( "X-Secret-Message" => "42" )
+
+## for mod_trigger_b4_dl
+# trigger-before-download.gdbm-filename = "/home/weigon/testbase/trigger.db"
+# trigger-before-download.memcache-hosts = ( "127.0.0.1:11211" )
+# trigger-before-download.trigger-url = "^/trigger/"
+# trigger-before-download.download-url = "^/download/"
+# trigger-before-download.deny-url = "http://127.0.0.1/index.html"
+# trigger-before-download.trigger-timeout = 10
+
+## for mod_cml
+## don't forget to add index.cml to server.indexfiles
+# cml.extension               = ".cml"
+# cml.memcache-hosts          = ( "127.0.0.1:11211" )
+
+#### variable usage:
+## variable name without "." is auto prefixed by "var." and becomes "var.bar"
+#bar = 1
+#var.mystring = "foo"
+
+## integer add
+#bar += 1
+## string concat, with integer cast as string, result: "www.foo1.com"
+#server.name = "www." + mystring + var.bar + ".com"
+## array merge
+#index-file.names = (foo + ".php") + index-file.names
+#index-file.names += (foo + ".php")
+
+#### include
+#include /etc/lighttpd/lighttpd-inc.conf
+## same as above if you run: "lighttpd -f /etc/lighttpd/lighttpd.conf"
+#include "lighttpd-inc.conf"
+
+#### include_shell
+#include_shell "echo var.a=1"
+## the above is same as:
+#var.a=1
+
+# include other config file fragments from lighttpd.d subdir
+include_shell "find /etc/lighttpd.d -maxdepth 1 -name '*.conf' -exec cat {} \;" 
diff --git a/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service b/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service
new file mode 100644
index 0000000..66a907a
--- /dev/null
+++ b/meta/recipes-extended/lighttpd/lighttpd/lighttpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Lightning Fast Webserver With Light System Requirements
+After=network.target
+
+[Service]
+ExecStartPre=@SBINDIR@/lighttpd -t -f @SYSCONFDIR@/lighttpd.conf
+ExecStart=@SBINDIR@/lighttpd -D -f @SYSCONFDIR@/lighttpd.conf
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch b/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch
new file mode 100644
index 0000000..e395f92
--- /dev/null
+++ b/meta/recipes-extended/lighttpd/lighttpd/pkgconfig.patch
@@ -0,0 +1,33 @@
+Use pkg-config for pcre dependency instead of -config script.
+
+Upstream-Status: Pending
+
+RP 2014/5/22
+
+
+Index: lighttpd-1.4.35/configure.ac
+===================================================================
+--- lighttpd-1.4.35.orig/configure.ac	2014-03-06 14:08:00.000000000 +0000
++++ lighttpd-1.4.35/configure.ac	2014-05-13 16:58:30.758471169 +0000
+@@ -309,16 +309,14 @@
+ AC_MSG_RESULT([$WITH_PCRE])
+ 
+ if test "$WITH_PCRE" != "no"; then
+-  AC_PATH_PROG(PCRECONFIG, pcre-config)
+-
+-  if test x"$PCRECONFIG" != x; then
+-    PCRE_LIB=`$PCRECONFIG --libs`
+-    CPPFLAGS="$CPPFLAGS `$PCRECONFIG --cflags`"
++  PKG_CHECK_MODULES(PCREPKG, [libpcre], [
++    PCRE_LIB=${PCREPKG_LIBS}
++    CPPFLAGS="$CPPFLAGS ${PCREPKG_CFLAGS}"
+     AC_DEFINE([HAVE_LIBPCRE], [1], [libpcre])
+     AC_DEFINE([HAVE_PCRE_H], [1], [pcre.h])
+-  else
++  ], [
+      AC_MSG_ERROR([pcre-config not found, install the pcre-devel package or build with --without-pcre])
+-  fi
++  ])
+ fi
+ 
+ AC_SUBST(PCRE_LIB)
diff --git a/meta/recipes-extended/lighttpd/lighttpd_1.4.36.bb b/meta/recipes-extended/lighttpd/lighttpd_1.4.36.bb
new file mode 100644
index 0000000..67b6e37
--- /dev/null
+++ b/meta/recipes-extended/lighttpd/lighttpd_1.4.36.bb
@@ -0,0 +1,77 @@
+SUMMARY = "Lightweight high-performance web server"
+HOMEPAGE = "http://www.lighttpd.net/"
+BUGTRACKER = "http://redmine.lighttpd.net/projects/lighttpd/issues"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e4dac5c6ab169aa212feb5028853a579"
+
+SECTION = "net"
+DEPENDS = "zlib libpcre"
+RDEPENDS_${PN} += " \
+               lighttpd-module-access \
+               lighttpd-module-accesslog \
+               lighttpd-module-indexfile \
+               lighttpd-module-dirlisting \
+               lighttpd-module-staticfile \
+"
+
+SRC_URI = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${PV}.tar.xz \
+        file://index.html.lighttpd \
+        file://lighttpd.conf \
+        file://lighttpd \
+        file://lighttpd.service \
+        file://pkgconfig.patch \
+        file://0001-mod_cgi-buffers-data-without-bound.patch \
+        "
+
+SRC_URI[md5sum] = "1843daffcb018aa528f6d15d43544654"
+SRC_URI[sha256sum] = "897ab6b1cc7bd51671f8af759e7846245fbbca0685c30017e93a5882a9ac1a53"
+
+PACKAGECONFIG ??= "openssl"
+PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl"
+
+EXTRA_OECONF = " \
+             --without-bzip2 \
+             --without-ldap \
+             --without-lua \
+             --without-memcache \
+             --with-pcre \
+             --without-webdav-props \
+             --without-webdav-locks \
+             --disable-static \
+"
+
+inherit autotools pkgconfig update-rc.d gettext systemd
+
+INITSCRIPT_NAME = "lighttpd"
+INITSCRIPT_PARAMS = "defaults 70"
+
+SYSTEMD_SERVICE_${PN} = "lighttpd.service"
+
+do_install_append() {
+	install -d ${D}${sysconfdir}/init.d ${D}${sysconfdir}/lighttpd.d ${D}/www/pages/dav
+	install -m 0755 ${WORKDIR}/lighttpd ${D}${sysconfdir}/init.d
+	install -m 0644 ${WORKDIR}/lighttpd.conf ${D}${sysconfdir}
+	install -m 0644 ${WORKDIR}/index.html.lighttpd ${D}/www/pages/index.html
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/lighttpd.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' \
+		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
+		-e 's,@BASE_BINDIR@,${base_bindir},g' \
+		${D}${systemd_unitdir}/system/lighttpd.service
+	#For FHS compliance, create symbolic links to /var/log and /var/tmp for logs and temporary data
+	ln -sf ${localstatedir}/log ${D}/www/logs
+	ln -sf ${localstatedir}/tmp ${D}/www/var
+}
+
+FILES_${PN} += "${sysconfdir} /www"
+
+CONFFILES_${PN} = "${sysconfdir}/lighttpd.conf"
+
+PACKAGES_DYNAMIC += "^lighttpd-module-.*"
+
+python populate_packages_prepend () {
+    lighttpd_libdir = d.expand('${libdir}')
+    do_split_packages(d, lighttpd_libdir, '^mod_(.*)\.so$', 'lighttpd-module-%s', 'Lighttpd module for %s', extra_depends='')
+}
diff --git a/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch b/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
new file mode 100644
index 0000000..2e931a2
--- /dev/null
+++ b/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch
@@ -0,0 +1,147 @@
+From 68f29ab490cf987aa34b5f4caf1784b58a021308 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 17 Feb 2015 21:08:07 -0800
+Subject: [PATCH] Act as the "mv" command when rotate log
+
+Act as the "mv" command when rotate log, first rename, if failed, then
+read and write.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ logrotate.c |   71 +++++++++++++++++++++++++++++++++++++++++++++++++----------
+ 1 file changed, 59 insertions(+), 12 deletions(-)
+
+diff --git a/logrotate.c b/logrotate.c
+index d3deb6a..cf8bf2c 100644
+--- a/logrotate.c
++++ b/logrotate.c
+@@ -1157,6 +1157,53 @@ int findNeedRotating(struct logInfo *log, int logNum, int force)
+     return 0;
+ }
+ 
++/* Act as the "mv" command, if rename failed, then read the old file and
++ * write to new file. The function which invokes the mvFile will use
++ * the strerror(errorno) to handle the error message, so we don't have
++ * to print the error message here */
++
++int mvFile (char *oldName, char *newName, struct logInfo *log, acl_type acl)
++{
++    struct stat sbprev;
++    int fd_old, fd_new, n;
++    char buf[BUFSIZ];
++
++    /* Do the rename first */
++    if (!rename(oldName, newName))
++        return 0;
++
++    /* If the errno is EXDEV, then read old file, write newfile and
++     * remove the oldfile */
++    if (errno == EXDEV) {
++        /* Open the old file to read */
++        if ((fd_old = open(oldName, O_RDONLY)) < 0)
++            return 1;
++
++        /* Create the file to write, keep the same attribute as the old file */
++        if (stat(oldName, &sbprev))
++            return 1;
++        else {
++            if ((fd_new = createOutputFile(newName,
++                O_WRONLY | O_CREAT | O_TRUNC, &sbprev, acl, 0)) < 0 )
++                return 1;
++        }
++
++        /* Read and write */
++        while ((n = read(fd_old, buf, BUFSIZ)) > 0)
++            if (write(fd_new, buf, n) != n)
++                return 1;
++
++        if ((close(fd_old) < 0) ||
++            removeLogFile(oldName, log) ||
++            (close(fd_new) < 0))
++            return 1;
++
++        return 0;
++    }
++
++    return 1;
++}
++
+ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+ 		       struct logNames *rotNames)
+ {
+@@ -1523,15 +1570,15 @@ int prerotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+ 		}
+ 
+ 	    message(MESS_DEBUG,
+-		    "renaming %s to %s (rotatecount %d, logstart %d, i %d), \n",
++		    "moving %s to %s (rotatecount %d, logstart %d, i %d), \n",
+ 		    oldName, newName, rotateCount, logStart, i);
+ 
+-	    if (!debug && rename(oldName, newName)) {
++	    if (!debug && mvFile(oldName, newName, log, prev_acl)) {
+ 		if (errno == ENOENT) {
+ 		    message(MESS_DEBUG, "old log %s does not exist\n",
+ 			    oldName);
+ 		} else {
+-		    message(MESS_ERROR, "error renaming %s to %s: %s\n",
++		    message(MESS_ERROR, "error moving %s to %s: %s\n",
+ 			    oldName, newName, strerror(errno));
+ 		    hasErrors = 1;
+ 		}
+@@ -1669,21 +1716,21 @@ int rotateSingleLog(struct logInfo *log, int logNum, struct logState *state,
+ 				return 1;
+ 			}
+ 
+-			message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
++			message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum],
+ 				tmpFilename);
+-			if (!debug && !hasErrors && rename(log->files[logNum], tmpFilename)) {
+-			message(MESS_ERROR, "failed to rename %s to %s: %s\n",
++			if (!debug && !hasErrors && mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
++			message(MESS_ERROR, "failed to move %s to %s: %s\n",
+ 				log->files[logNum], tmpFilename,
+ 				strerror(errno));
+ 				hasErrors = 1;
+ 			}
+ 		}
+ 		else {
+-			message(MESS_DEBUG, "renaming %s to %s\n", log->files[logNum],
++			message(MESS_DEBUG, "moving %s to %s\n", log->files[logNum],
+ 				rotNames->finalName);
+ 			if (!debug && !hasErrors &&
+-			rename(log->files[logNum], rotNames->finalName)) {
+-				message(MESS_ERROR, "failed to rename %s to %s: %s\n",
++			mvFile(log->files[logNum], rotNames->finalName, log, prev_acl)) {
++				message(MESS_ERROR, "failed to move %s to %s: %s\n",
+ 					log->files[logNum], tmpFilename,
+ 					strerror(errno));
+ 					hasErrors = 1;
+@@ -2063,7 +2110,7 @@ int rotateLogSet(struct logInfo *log, int force)
+     return hasErrors;
+ }
+ 
+-static int writeState(char *stateFilename)
++static int writeState(struct logInfo *log, char *stateFilename)
+ {
+ 	struct logState *p;
+ 	FILE *f;
+@@ -2227,7 +2274,7 @@ static int writeState(char *stateFilename)
+ 		fclose(f);
+ 
+ 	if (error == 0) {
+-		if (rename(tmpFilename, stateFilename)) {
++		if (mvFile(tmpFilename, stateFilename, log, prev_acl)) {
+ 			unlink(tmpFilename);
+ 			error = 1;
+ 			message(MESS_ERROR, "error renaming temp state file %s\n",
+@@ -2525,7 +2572,7 @@ int main(int argc, const char **argv)
+ 		rc |= rotateLogSet(log, force);
+ 
+ 	if (!debug)
+-		rc |= writeState(stateFile);
++		rc |= writeState(log, stateFile);
+ 
+ 	return (rc != 0);
+ }
diff --git a/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch b/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
new file mode 100644
index 0000000..793d702
--- /dev/null
+++ b/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch
@@ -0,0 +1,32 @@
+Disable the check for different filesystems
+
+The logrotate supports rotate log across different filesystems now, so
+disable the check for different filesystems.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ config.c |    9 ---------
+ 1 file changed, 9 deletions(-)
+
+diff --git a/config.c b/config.c
+index dbbf563..64e66f6 100644
+--- a/config.c
++++ b/config.c
+@@ -1493,15 +1493,6 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
+ 							goto error;
+ 						}
+ 					}
+-
+-					if (sb.st_dev != sb2.st_dev
+-						&& !(newlog->flags & (LOG_FLAG_COPYTRUNCATE | LOG_FLAG_COPY | LOG_FLAG_TMPFILENAME))) {
+-						message(MESS_ERROR,
+-							"%s:%d olddir %s and log file %s "
+-							"are on different devices\n", configFile,
+-							lineNum, newlog->oldDir, newlog->files[i]);
+-						goto error;
+-					}
+ 				}
+ 			}
+ 
diff --git a/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch b/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
new file mode 100644
index 0000000..50d037d
--- /dev/null
+++ b/meta/recipes-extended/logrotate/logrotate/update-the-manual.patch
@@ -0,0 +1,38 @@
+From e0b0fe30e9c49234994a20a86aacfaf80e690087 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 17 Feb 2015 21:14:37 -0800
+Subject: [PATCH] Update the manual
+
+Update the manual for rotating on different filesystems.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ logrotate.8 |   10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/logrotate.8 b/logrotate.8
+index e4e5f48..84407d0 100644
+--- a/logrotate.8
++++ b/logrotate.8
+@@ -405,12 +405,10 @@ Do not rotate the log if it is empty (this overrides the \fBifempty\fR option).
+ 
+ .TP
+ \fBolddir \fIdirectory\fR
+-Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR must be
+-on the same physical device as the log file being rotated, unless \fBcopy\fR,
+-\fBcopytruncate\fR or \fBrenamecopy\fR option is used. The \fIdirectory\fR
+-is assumed to be relative to the directory holding the log file
+-unless an absolute path name is specified. When this option is used all
+-old versions of the log end up in \fIdirectory\fR.  This option may be
++Logs are moved into \fIdirectory\fR for rotation. The \fIdirectory\fR
++is assumed to be relative to the directory holding the log file unless
++an absolute path name is specified. When this option is used all old
++versions of the log end up in \fIdirectory\fR. This option may be
+ overridden by the \fBnoolddir\fR option.
+ 
+ .TP
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/logrotate/logrotate_3.9.1.bb b/meta/recipes-extended/logrotate/logrotate_3.9.1.bb
new file mode 100644
index 0000000..7d0a159
--- /dev/null
+++ b/meta/recipes-extended/logrotate/logrotate_3.9.1.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Rotates, compresses, removes and mails system log files"
+SECTION = "console/utils"
+HOMEPAGE = "https://fedorahosted.org/logrotate/"
+LICENSE = "GPLv2"
+
+# TODO: logrotate 3.8.8 adds autotools/automake support, update recipe to use it.
+# TODO: Document coreutils dependency. Why not RDEPENDS? Why not busybox?
+
+DEPENDS="coreutils popt"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
+
+SRC_URI = "https://fedorahosted.org/releases/l/o/logrotate/logrotate-${PV}.tar.gz \
+           file://act-as-mv-when-rotate.patch \
+           file://update-the-manual.patch \
+           file://disable-check-different-filesystems.patch \
+            "
+
+SRC_URI[md5sum] = "4492b145b6d542e4a2f41e77fa199ab0"
+SRC_URI[sha256sum] = "022769e3288c80981559a8421703c88e8438b447235e36dd3c8e97cd94c52545"
+
+PACKAGECONFIG ?= "\
+    ${@bb.utils.contains('DISTRO_FEATURES', 'acl', 'acl', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
+"
+
+PACKAGECONFIG[acl] = ",,acl"
+PACKAGECONFIG[selinux] = ",,libselinux"
+
+CONFFILES_${PN} += "${localstatedir}/lib/logrotate.status \
+		    ${sysconfdir}/logrotate.conf"
+
+# If RPM_OPT_FLAGS is unset, it adds -g itself rather than obeying our
+# optimization variables, so use it rather than EXTRA_CFLAGS.
+EXTRA_OEMAKE = "\
+    LFS= \
+    OS_NAME='${OS_NAME}' \
+    'CC=${CC}' \
+    'RPM_OPT_FLAGS=${CFLAGS}' \
+    'EXTRA_LDFLAGS=${LDFLAGS}' \
+    ${@bb.utils.contains('PACKAGECONFIG', 'acl', 'WITH_ACL=yes', '', d)} \
+    ${@bb.utils.contains('PACKAGECONFIG', 'selinux', 'WITH_SELINUX=yes', '', d)} \
+"
+
+# OS_NAME in the makefile defaults to `uname -s`. The behavior for
+# freebsd/netbsd is questionable, so leave it as Linux, which only sets
+# INSTALL=install and BASEDIR=/usr.
+OS_NAME = "Linux"
+
+do_compile_prepend() {
+    # Make sure the recompile is OK
+    rm -f ${B}/.depend
+}
+
+do_install(){
+    oe_runmake install DESTDIR=${D} PREFIX=${D} MANDIR=${mandir} BINDIR=${bindir}
+    mkdir -p ${D}${sysconfdir}/logrotate.d
+    mkdir -p ${D}${sysconfdir}/cron.daily
+    mkdir -p ${D}${localstatedir}/lib
+    install -p -m 644 examples/logrotate-default ${D}${sysconfdir}/logrotate.conf
+    install -p -m 755 examples/logrotate.cron ${D}${sysconfdir}/cron.daily/logrotate
+    touch ${D}${localstatedir}/lib/logrotate.status
+}
diff --git a/meta/recipes-extended/lsb/lsb/init-functions b/meta/recipes-extended/lsb/lsb/init-functions
new file mode 100755
index 0000000..7c1dce2
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsb/init-functions
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+# LSB initscript functions, as defined in the LSB Spec 1.1.0
+#
+# Lawrence Lim <llim@core.com> - Tue, 26 June 2007
+# Updated to the latest LSB 3.1 spec
+# http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic_lines.txt
+
+start_daemon () {
+	/etc/core-lsb/lsb_start_daemon "$@"
+}
+
+killproc () {
+	/etc/core-lsb/lsb_killproc "$@"
+}
+
+pidofproc () {
+	/etc/core-lsb/lsb_pidofproc "$@"
+}
+
+log_success_msg () {
+	/etc/core-lsb/lsb_log_message success "$@"
+}
+
+log_failure_msg () {
+	/etc/core-lsb/lsb_log_message failure "$@"
+}
+
+log_warning_msg () {
+	/etc/core-lsb/lsb_log_message warning "$@"
+}
+
+# int log_begin_message (char *message)
+log_begin_msg () {
+	if [ -z "$1" ]; then
+		return 1
+	fi
+	echo " * $@"
+}
+
+
+log_end_msg () {
+	/etc/core-lsb/lsb_log_message end "$@"
+}
diff --git a/meta/recipes-extended/lsb/lsb/lsb_killproc b/meta/recipes-extended/lsb/lsb/lsb_killproc
new file mode 100755
index 0000000..866c1a9
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsb/lsb_killproc
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+LSB=LSB-1.1 killproc $*
+exit $?
diff --git a/meta/recipes-extended/lsb/lsb/lsb_log_message b/meta/recipes-extended/lsb/lsb/lsb_log_message
new file mode 100755
index 0000000..10343b0
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsb/lsb_log_message
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+ACTION=$1
+shift
+
+case "$ACTION" in
+  success)
+  	echo -n $*
+	success "$*"
+	echo
+	;;
+  failure)
+  	echo -n $*
+	failure "$*"
+	echo
+	;;
+  warning)
+  	echo -n $*
+	warning "$*"
+	echo
+	;;
+  *)
+  	;;
+esac
+exit 0
diff --git a/meta/recipes-extended/lsb/lsb/lsb_pidofproc b/meta/recipes-extended/lsb/lsb/lsb_pidofproc
new file mode 100755
index 0000000..6d1fd0f
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsb/lsb_pidofproc
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+pidofproc $*
+exit $?
diff --git a/meta/recipes-extended/lsb/lsb/lsb_start_daemon b/meta/recipes-extended/lsb/lsb/lsb_start_daemon
new file mode 100755
index 0000000..de62c23
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsb/lsb_start_daemon
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+. /etc/init.d/functions
+
+nice=
+force=
+pidfile=
+user=
+check=
+RETVAL=
+while [ "$1" != "${1##[-+]}" ]; do
+	case $1 in
+	     -f)
+	     	force="--force"
+		shift
+		;;
+	     -n)
+	     	nice=$2
+		shift 2
+		;;
+	     -p)
+		pidfile="--pidfile $2"
+		shift 2
+		;;
+	     -u)
+	        user="--user $2"
+		shift 2
+		;;
+	     -c)
+	        check="--check $2"
+		shift 2
+		;;
+	      *)     
+ 		echo "Unknown Option $1"
+ 		echo "Options are:"
+ 		echo "-f" 
+		echo "-p {pidfile}"
+		echo "-n [+/-nicelevel]"
+		echo "-u {user}"
+		echo "-c {base}"
+	        exit 1;;	
+	esac
+done
+LSB=LSB-1.1 daemon ${force:-} ${nice:-} ${pidfile:-} ${user:-} ${check:-} $*
+exit $?
diff --git a/meta/recipes-extended/lsb/lsb_4.1.bb b/meta/recipes-extended/lsb/lsb_4.1.bb
new file mode 100644
index 0000000..6215b62
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsb_4.1.bb
@@ -0,0 +1,127 @@
+SUMMARY = "LSB support for OpenEmbedded"
+SECTION = "console/utils"
+HOMEPAGE = "http://prdownloads.sourceforge.net/lsb"
+LICENSE = "GPLv2+"
+PR = "r2"
+
+LSB_CORE = "lsb-core-${TARGET_ARCH}"
+LSB_CORE_x86 = "lsb-core-ia32"
+LSB_CORE_x86-64 = "lsb-core-amd64"
+RPROVIDES_${PN} += "${LSB_CORE}"
+
+# lsb_release needs getopt
+RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_getopt}"
+
+LIC_FILES_CHKSUM = "file://README;md5=12da544b1a3a5a1795a21160b49471cf"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/lsb/lsb_release/1.4/lsb-release-1.4.tar.gz \
+           file://init-functions \
+           file://lsb_killproc \
+           file://lsb_log_message \
+           file://lsb_pidofproc \
+           file://lsb_start_daemon \
+           "
+
+SRC_URI[md5sum] = "30537ef5a01e0ca94b7b8eb6a36bb1e4"
+SRC_URI[sha256sum] = "99321288f8d62e7a1d485b7c6bdccf06766fb8ca603c6195806e4457fdf17172"
+S = "${WORKDIR}/lsb-release-1.4"
+
+CLEANBROKEN = "1"
+
+do_install(){
+	oe_runmake install prefix=${D}  mandir=${D}/${datadir}/man/ DESTDIR=${D}
+
+	# this 2 dirs are needed by package lsb-dist-checker
+	mkdir -p ${D}${sysconfdir}/opt
+	mkdir -p ${D}${localstatedir}/opt
+
+	mkdir -p ${D}${base_bindir}
+	mkdir -p ${D}/${baselib}
+	mkdir -p ${D}${sysconfdir}/lsb-release.d
+	printf "LSB_VERSION=\"core-4.1-noarch:" > ${D}${sysconfdir}/lsb-release
+
+	if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+		printf "core-4.1-ia32" >>  ${D}${sysconfdir}/lsb-release
+	else
+		printf "core-4.1-${TARGET_ARCH}" >>  ${D}${sysconfdir}/lsb-release
+	fi
+	echo "\"" >> ${D}${sysconfdir}/lsb-release
+	echo "DISTRIB_ID=${DISTRO}" >> ${D}${sysconfdir}/lsb-release
+	echo "DISTRIB_RELEASE=${DISTRO_VERSION}" >> ${D}${sysconfdir}/lsb-release
+	if [ -n "${DISTRO_CODENAME}" ]; then
+		echo "DISTRIB_CODENAME=${DISTRO_CODENAME}" >> ${D}${sysconfdir}/lsb-release
+	fi
+	echo "DISTRIB_DESCRIPTION=\"${DISTRO_NAME} ${DISTRO_VERSION}\"" >> ${D}${sysconfdir}/lsb-release
+
+	if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+		mkdir -p ${D}${sysconfdir}/lsb-release.d
+		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+		touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-noarch
+		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ia32
+		touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ia32
+	elif [ "${TARGET_ARCH}" = "x86_64" ];then
+		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-amd64
+		touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-amd64
+	fi
+	if [ "${TARGET_ARCH}" = "powerpc" ];then
+		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc32
+		touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc32
+	elif [ "${TARGET_ARCH}" = "powerpc64" ];then
+		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-noarch
+		touch ${D}${sysconfdir}/lsb-release.d/graphics-${PV}-ppc64
+		touch ${D}${sysconfdir}/lsb-release.d/desktop-${PV}-ppc64
+	fi
+}
+
+do_install_append(){
+       install -d ${D}${sysconfdir}/core-lsb
+       for i in lsb_killproc lsb_log_message lsb_pidofproc lsb_start_daemon
+       do
+           install -m 0755 ${WORKDIR}/${i} ${D}${sysconfdir}/core-lsb
+       done
+
+       install -d ${D}/lib/lsb
+       install -m 0755 ${WORKDIR}/init-functions ${D}/lib/lsb
+
+       # creat links for LSB test
+       install -d ${D}/usr/lib/lsb
+       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/install_initd
+       ln -sf ${sbindir}/chkconfig ${D}/usr/lib/lsb/remove_initd
+
+       if [ "${TARGET_ARCH}" = "x86_64" ];then
+	       cd ${D}
+               if [ "${baselib}" != "lib64" ]; then
+                   ln -sf ${baselib} lib64
+               fi
+	       cd ${D}/${baselib}
+               ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.2
+               ln -sf ld-linux-x86-64.so.2 ld-lsb-x86-64.so.3
+       fi
+       if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+	       cd ${D}/${baselib}
+               ln -sf ld-linux.so.2 ld-lsb.so.2
+               ln -sf ld-linux.so.2 ld-lsb.so.3
+       fi
+
+       if [ "${TARGET_ARCH}" = "powerpc64" ];then
+               cd ${D}
+               if [ "${baselib}" != "lib64" ]; then
+                   ln -sf ${baselib} lib64
+               fi
+               cd ${D}/${baselib}
+               ln -sf ld64.so.1 ld-lsb-ppc64.so.2
+               ln -sf ld64.so.1 ld-lsb-ppc64.so.3
+       fi
+       if [ "${TARGET_ARCH}" = "powerpc" ];then
+	       cd ${D}/${baselib}
+               ln -sf ld.so.1 ld-lsb-ppc32.so.2
+               ln -sf ld.so.1 ld-lsb-ppc32.so.3
+       fi
+}
+FILES_${PN} += "/lib64 \
+                /usr/lib/lsb \
+                ${base_libdir}/lsb/* \
+                /lib/lsb/* \
+               "
diff --git a/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch b/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch
new file mode 100644
index 0000000..0809c9b
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsbinitscripts/0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Pending
+
+Subject: functions: avoid exit 1 which causes init scripts to fail
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ rc.d/init.d/functions | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
+index 6850046..11223f7 100644
+--- a/rc.d/init.d/functions
++++ b/rc.d/init.d/functions
+@@ -597,5 +597,5 @@ if [ "$_use_systemctl" = "1" ]; then
+ 	fi
+ fi
+ 
+-strstr "$(cat /proc/cmdline)" "rc.debug" && set -x
++strstr "$(cat /proc/cmdline)" "rc.debug" && set -x || true
+ 
+-- 
+2.1.0
+
diff --git a/meta/recipes-extended/lsb/lsbinitscripts/functions.patch b/meta/recipes-extended/lsb/lsbinitscripts/functions.patch
new file mode 100644
index 0000000..a756d04
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsbinitscripts/functions.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: initscripts-9.43/rc.d/init.d/functions
+===================================================================
+--- initscripts-9.43.orig/rc.d/init.d/functions
++++ initscripts-9.43/rc.d/init.d/functions
+@@ -13,6 +13,7 @@ umask 022
+ PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+ export PATH
+ 
++
+ if [ $PPID -ne 1 -a -z "$SYSTEMCTL_SKIP_REDIRECT" ] && \
+ 		( /bin/mountpoint -q /cgroup/systemd || /bin/mountpoint -q /sys/fs/cgroup/systemd ) ; then
+         case "$0" in
+@@ -54,7 +55,7 @@ systemctl_redirect () {
+ [ -z "${COLUMNS:-}" ] && COLUMNS=80
+ 
+ if [ -z "${CONSOLETYPE:-}" ]; then
+-  if [ -c "/dev/stderr" -a -r "/dev/stderr" ]; then
++  if [ -c "/dev/stderr" -a -r "/dev/stderr" -a -e /sbin/consoletype ]; then
+     CONSOLETYPE="$(/sbin/consoletype < /dev/stderr 2>/dev/null)"
+   else
+     CONSOLETYPE="serial"
diff --git a/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb b/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb
new file mode 100644
index 0000000..6db667c
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsbinitscripts_9.64.bb
@@ -0,0 +1,32 @@
+SUMMARY = "SysV init scripts which are only used in an LSB image"
+SECTION = "base"
+LICENSE = "GPLv2"
+DEPENDS = "popt glib-2.0"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ebf4e8b49780ab187d51bd26aaa022c6"
+
+S="${WORKDIR}/initscripts-${PV}"
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/initscripts/initscripts-${PV}.tar.bz2/9cce2ae1009750e84be37c09a028757e/initscripts-${PV}.tar.bz2 \
+           file://functions.patch \
+           file://0001-functions-avoid-exit-1-which-causes-init-scripts-to-.patch \
+          " 
+
+SRC_URI[md5sum] = "9cce2ae1009750e84be37c09a028757e"
+SRC_URI[sha256sum] = "48b59ce8157cfc58bbd4b1dfa58ad1087245761ae11c2033b66ae3864ea7e1cf"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "functions"
+ALTERNATIVE_LINK_NAME[functions] = "${sysconfdir}/init.d/functions"
+
+# Since we are only taking the patched version of functions, no need to
+# configure or compile anything so do not execute these
+do_configure[noexec] = "1" 
+do_compile[noexec] = "1" 
+
+do_install(){
+	install -d ${D}${sysconfdir}/init.d/
+	install -m 0644 ${S}/rc.d/init.d/functions ${D}${sysconfdir}/init.d/functions
+	sed -i 's,${base_bindir}/mountpoint,${bindir}/mountpoint,g' ${D}${sysconfdir}/init.d/functions
+}
diff --git a/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh b/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
new file mode 100644
index 0000000..b9971a1
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsbtest/LSB_Test.sh
@@ -0,0 +1,526 @@
+#!/bin/sh
+
+# Copyright (C) 2012 Wind River Systems, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+WORK_DIR="/opt/lsb-test"
+
+if [ `id -u` -ne 0 ]
+then
+	cat << EOF
+	In order to install and run LSB testsuite, you need administrator privileges.
+	You are currently running this script as an unprivileged user.
+
+EOF
+	exit 1
+fi
+
+ARCH=`uname -m`
+if [ ${ARCH} != "i686" ] && [ ${ARCH} != "x86_64" ] && [ ${ARCH} != "ppc" ] && [ ${ARCH} != "ppc64" ]
+then
+	echo "Error: Unsupported architecture"
+	exit 1
+fi
+
+which rpm
+if [ $? -ne 0 ]
+then
+	echo "No rpm command found"
+	exit 1
+fi
+
+RET=0
+
+cd ${WORK_DIR} || exit 1
+# Step 1: Download the LSB Packages
+echo ""
+echo "Download LSB packages..."
+echo ""
+
+if [ ! -e ./packages_list ]
+then
+	echo "Error: Could not find packages list" >&2
+	exit 1
+fi
+
+. ./packages_list
+
+PACKAGES_DIR="/var/opt/lsb/test/manager/packages/ftp.linuxfoundation.org/pub/lsb"
+
+BASE_PACKAGES_DIR="${PACKAGES_DIR}/base/${LSB_RELEASE}/binary"
+RUNTIME_BASE_PACKAGES_DIR="${PACKAGES_DIR}/test_suites/released-all/binary/runtime"
+RUNTIME_PACKAGES_DIR="${PACKAGES_DIR}/test_suites/${LSB_RELEASE}/binary/runtime"
+APP_PACKAGES_DIR="${PACKAGES_DIR}/app-battery/${LSB_RELEASE}/${LSB_ARCH}"
+APP_TESTFILES_DIR="${PACKAGES_DIR}/app-battery/tests"
+SNAPSHOTS_TESTFILES_DIR="${PACKAGES_DIR}/snapshots/appbat/tests"
+
+if [ ! -d ${PACKAGES_DIR} ]
+then
+	mkdir -p ${PACKAGES_DIR}
+fi
+
+if [ ! -d ${BASE_PACKAGES_DIR} ]
+then
+	mkdir -p ${BASE_PACKAGES_DIR}
+fi
+
+if [ ! -d ${RUNTIME_BASE_PACKAGES_DIR} ]
+then
+	mkdir -p ${RUNTIME_BASE_PACKAGES_DIR}
+fi
+
+if [ ! -d ${RUNTIME_PACKAGES_DIR} ]
+then
+	mkdir -p ${RUNTIME_PACKAGES_DIR}
+fi
+
+if [ ! -d ${APP_PACKAGES_DIR} ]
+then
+	mkdir -p ${APP_PACKAGES_DIR}
+fi
+
+if [ ! -d ${APP_TESTFILES_DIR} ]
+then
+	mkdir -p ${APP_TESTFILES_DIR}
+fi
+
+# Official download server list. You can replace them with your own server.
+SERVER_IPADDR="140.211.169.23"
+SERVER_NAME="ftp.linuxfoundation.org"
+
+if ! `grep -F -q "${SERVER_NAME}" /etc/hosts`; then
+	echo "${SERVER_IPADDR}	${SERVER_NAME}	${SERVER_NAME}" >> /etc/hosts
+fi
+
+#ping -c 5 ${SERVER_NAME}
+#if [ $? -ne 0 ]
+#then
+#	echo "The server: ${SERVER_NAME} is unreachable"
+#	exit 1
+#fi
+
+SERVER1="\
+	http://${SERVER_NAME}/pub/lsb/base/${LSB_RELEASE}/binary"
+SERVER2="\
+	http://${SERVER_NAME}/pub/lsb/test_suites/released-all/binary/runtime"
+SERVER3="\
+	http://${SERVER_NAME}/pub/lsb/test_suites/${LSB_RELEASE}/binary/runtime"
+SERVER4="\
+	http://${SERVER_NAME}/pub/lsb/app-battery/${LSB_RELEASE}/${LSB_ARCH}"
+SERVER5="\
+	http://${SERVER_NAME}/pub/lsb/app-battery/tests"
+
+# We using "curl" as a download tool, "wget" is an alternative.
+CURL=`which curl`
+WGET=`which wget`
+if [ ! -z ${CURL} ]
+then
+	DOWNLOAD_CMD="${CURL} -R -L -f --retry 3 --retry-delay 4 --connect-timeout 180 --compressed -C - -o"
+elif [ ! -z ${WGET} ]
+then
+	DOWNLOAD_CMD="${WGET} -c -t 5 -O"
+else
+	echo "Can not find a download tool, please install curl or wget."
+	exit 1
+fi
+
+cd ${BASE_PACKAGES_DIR}
+for pkg in ${BASE_PACKAGES_LIST}; do
+	if [ ! -f ${pkg} ]
+	then
+		#${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER1}/${pkg} > /dev/null 2>&1
+		${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER1}/${pkg}
+		if [ $? -eq 0 ]
+		then
+			mv -f ${pkg}".#part" ${pkg}
+			echo "Download ${pkg} successfully."
+		else
+			echo "Download ${pkg} failed."
+			RET=1
+		fi
+	fi
+done
+
+cd ${RUNTIME_BASE_PACKAGES_DIR}
+for pkg in ${RUNTIME_BASE_PACKAGES_LIST}; do
+	if [ ! -f ${pkg} ]
+	then
+		#${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER2}/${pkg} > /dev/null 2>&1
+		${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER2}/${pkg}
+		if [ $? -eq 0 ]
+		then
+			mv -f ${pkg}".#part" ${pkg}
+			echo "Download ${pkg} successfully."
+		else
+			echo "Download ${pkg} failed."
+			RET=1
+		fi
+	fi
+done
+
+cd ${RUNTIME_PACKAGES_DIR}
+for pkg in ${RUNTIME_PACKAGES_LIST}; do
+	if [ ! -f ${pkg} ]
+	then
+		#${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER3}/${pkg} > /dev/null 2>&1
+		${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER3}/${pkg}
+		if [ $? -eq 0 ]
+		then
+			mv -f ${pkg}".#part" ${pkg}
+			echo "Download ${pkg} successfully."
+		else
+			echo "Download ${pkg} failed."
+			RET=1
+		fi
+	fi
+done
+
+cd ${APP_PACKAGES_DIR}
+for pkg in ${APP_PACKAGES_LIST}; do
+	if [ ! -f ${pkg} ]
+	then
+		#${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER4}/${pkg} > /dev/null 2>&1
+		${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER4}/${pkg}
+		if [ $? -eq 0 ]
+		then
+			mv -f ${pkg}".#part" ${pkg}
+			echo "Download ${pkg} successfully."
+		else
+			echo "Download ${pkg} failed."
+			RET=1
+		fi
+	fi
+done
+
+cd ${APP_TESTFILES_DIR}
+for pkg in ${APP_TESTFILES_LIST}; do
+	if [ ! -f ${pkg} ]
+	then
+		#${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER5}/${pkg} > /dev/null 2>&1
+		${DOWNLOAD_CMD} ${pkg}".#part" ${SERVER5}/${pkg}
+		if [ $? -eq 0 ]
+		then
+			mv -f ${pkg}".#part" ${pkg}
+			echo "Download ${pkg} successfully."
+		else
+			echo "Download ${pkg} failed."
+			RET=1
+		fi
+	fi
+done
+
+if [ ${RET} -ne 0 ]
+then
+	echo "Download some packages failed. Please download them again."
+	exit 1
+fi
+
+# Step 2: Install the LSB Packages
+echo ""
+echo "Install LSB packages..."
+echo ""
+
+# Kill lighttpd
+ps aux | grep "lighttpd" | grep -v -q "grep"
+if [ $? -eq 0 ]
+then
+	killall lighttpd >/dev/null 2>&1
+fi
+
+# Start avahi-daemon
+ps aux | grep "avahi-daemon" | grep -v -q "grep"
+if [ $? -ne 0 ]
+then
+	/etc/init.d/avahi-daemon start >/dev/null 2>&1
+fi
+
+LSB_START_CMD="/opt/lsb/test/manager/bin/dist-checker-start.pl"
+LSB_STOP_CMD="/opt/lsb/test/manager/bin/dist-checker-stop.pl"
+
+PLATFORM_FILE="/etc/rpm/platform"
+
+RPM_INSTALL_CMD="rpm --quiet --nodeps --replacepkgs --nosignature -i"
+RPM_INSTALL_CMD_NOSCRIPTS="rpm --quiet --nodeps --replacepkgs --noscripts --nosignature -i"
+
+# If the lsb has been started, stop it first.
+if [ -x ${LSB_STOP_CMD} ]
+then
+	${LSB_STOP_CMD}
+fi
+
+if [ ! -d /etc/rpm ]
+then
+	mkdir -p /etc/rpm
+fi
+
+if [ ! -f ${PLATFORM_FILE} ]
+then
+	touch ${PLATFORM_FILE}
+fi
+
+if ! `grep -F -q "noarch-suse" ${PLATFORM_FILE}`; then
+	if [ ${ARCH} = i686 ];then
+		echo "i486-suse" >> ${PLATFORM_FILE}
+		echo "i486-noarch" >> ${PLATFORM_FILE}
+		echo "i486-pc" >> ${PLATFORM_FILE}
+		echo "noarch-suse" >> ${PLATFORM_FILE}
+	elif [ ${ARCH} = x86_64 ]; then
+		echo "i486-suse" >> ${PLATFORM_FILE}
+		echo "i486-noarch" >> ${PLATFORM_FILE}
+		echo "i486-pc" >> ${PLATFORM_FILE}
+		echo "i486-.*-linux.*" >> ${PLATFORM_FILE}
+		echo "noarch-suse" >> ${PLATFORM_FILE}
+		echo "${ARCH}-suse" >> ${PLATFORM_FILE}
+		echo "${ARCH}-noarch" >> ${PLATFORM_FILE}
+		echo "${ARCH}-pc" >> ${PLATFORM_FILE}
+	else
+		echo "${ARCH}-suse" >> ${PLATFORM_FILE}
+		echo "${ARCH}-noarch" >> ${PLATFORM_FILE}
+		echo "${ARCH}-pc" >> ${PLATFORM_FILE}
+		echo "noarch-suse" >> ${PLATFORM_FILE}
+	fi
+fi
+
+if [ -d ${BASE_PACKAGES_DIR} ]
+then
+	cd ${BASE_PACKAGES_DIR}
+	for pkg in ${BASE_PACKAGES_LIST}
+	do
+		rpm --quiet -q ${pkg%\.*}
+		if [ $? -ne 0 ]; then
+			$RPM_INSTALL_CMD ${pkg}
+		fi
+	done
+fi
+
+if [ -d ${RUNTIME_BASE_PACKAGES_DIR} ]
+then
+	cd ${RUNTIME_BASE_PACKAGES_DIR}
+	for pkg in ${RUNTIME_BASE_PACKAGES_LIST}
+	do
+		rpm --quiet -q ${pkg%\.*}
+		if [ $? -ne 0 ]; then
+			$RPM_INSTALL_CMD ${pkg}
+		fi
+	done
+fi
+
+if [ -d ${RUNTIME_PACKAGES_DIR} ]
+then
+	cd ${RUNTIME_PACKAGES_DIR}
+	for pkg in ${RUNTIME_PACKAGES_LIST}
+	do
+		rpm --quiet -q ${pkg%\.*}
+		if [ $? -ne 0 ]; then
+			$RPM_INSTALL_CMD ${pkg}
+		fi
+	done
+fi
+
+if [ -d ${APP_PACKAGES_DIR} ]
+then
+	cd ${APP_PACKAGES_DIR}
+	for pkg in ${APP_PACKAGES_LIST}
+	do
+		echo "${pkg}" | grep -q "apache\|xpdf"
+		if [ $? -eq 0 ]
+		then
+			rpm --quiet -q ${pkg%\.*}
+			if [ $? -ne 0 ]; then
+				$RPM_INSTALL_CMD_NOSCRIPTS ${pkg}
+			fi
+		else
+			rpm --quiet -q ${pkg%\.*}
+			if [ $? -ne 0 ]; then
+				$RPM_INSTALL_CMD ${pkg}
+			fi
+		fi
+	done
+fi
+
+if [ ! -d ${SNAPSHOTS_TESTFILES_DIR} ]
+then
+	mkdir -p ${SNAPSHOTS_TESTFILES_DIR}
+fi
+
+if [ -d ${APP_TESTFILES_DIR} ]
+then
+	cd ${APP_TESTFILES_DIR}
+	for pkg in ${APP_TESTFILES_LIST}
+	do
+		cp -f ${pkg} ${SNAPSHOTS_TESTFILES_DIR}
+	done
+fi
+
+cd ${WORK_DIR}
+
+# Step 3: Set environment
+echo ""
+echo "Set environment..."
+echo ""
+
+check ()
+{
+	if [ $? -eq 0 ]
+	then
+		echo "PASS"
+	else 
+		echo "FAIL"
+		exit 1
+	fi
+}
+
+echo ""
+echo "---------------------------------"
+echo "Create the Dirnames on target"
+
+if [ ! -d /etc/rpm/sysinfo ]
+then
+	mkdir -p /etc/rpm/sysinfo
+fi
+
+cat > /etc/rpm/sysinfo/Dirnames << EOF
+/etc/opt/lsb
+/home/tet/LSB.tools
+/opt/lsb-tet3-lite/lib/ksh
+/opt/lsb-tet3-lite/lib/perl
+/opt/lsb-tet3-lite/lib/posix_sh
+/opt/lsb-tet3-lite/lib/tet3
+/opt/lsb-tet3-lite/lib/xpg3sh
+/opt/lsb/appbat/lib/python2.4/site-packages/qm
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/external
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/external/DocumentTemplate
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/test
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/test/classes
+/opt/lsb/appbat/lib/python2.4/site-packages/qm/test/web
+/opt/lsb/test/doc
+/opt/lsb/test/lib
+/opt/lsb/test/qm/diagnostics
+/opt/lsb/test/qm/doc
+/opt/lsb/test/qm/doc/test/html
+/opt/lsb/test/qm/doc/test/print
+/opt/lsb/test/qm/dtml
+/opt/lsb/test/qm/dtml/test
+/opt/lsb/test/qm/messages/test
+/opt/lsb/test/qm/tutorial/test/tdb
+/opt/lsb/test/qm/tutorial/test/tdb/QMTest
+/opt/lsb/test/qm/web
+/opt/lsb/test/qm/web/images
+/opt/lsb/test/qm/web/stylesheets
+/opt/lsb/test/qm/xml
+/opt/lsb/test/share
+/usr/share/doc/lsb-runtime-test
+/var/opt/lsb
+/opt/lsb/test/desktop
+/opt/lsb/test/desktop/fontconfig
+/opt/lsb/test/desktop/freetype
+/opt/lsb/test/desktop/gtkvts
+/opt/lsb/test/desktop/libpng
+/opt/lsb/test/desktop/qt3
+/opt/lsb/test/desktop/xft
+/opt/lsb/test/desktop/xml
+/opt/lsb/test/desktop/xrender
+
+
+EOF
+
+if [ -f /etc/rpm/sysinfo/Dirnames ]
+then
+	echo "Success to creat Dirnames file"
+else 
+	echo "Fail to creat Dirnames file"
+fi
+
+[ -x /sbin/ldconfig ] && {
+echo ""
+echo "---------------------------------"
+echo "Update cache"
+/sbin/ldconfig
+check;
+}
+
+# Check loop device
+if [ ! -b /dev/loop0 ]
+then
+	insmod /lib/modules/`uname -r`/kernel/drivers/block/loop.ko
+	if [ $? != 0 ];then
+		echo "Insmod loop.ko failed."
+	fi
+fi
+
+# Resolve localhost
+LOCALHOST=`hostname`
+if ! `grep -F -q "$LOCALHOST" /etc/hosts`; then
+	echo "127.0.0.1	$LOCALHOST" >> /etc/hosts
+fi
+
+# Workaround to add part of locales for LSB test
+localedef -i de_DE -f ISO-8859-1 de_DE
+localedef -i de_DE -f ISO-8859-15 de_DE.ISO-8859-15
+localedef -i de_DE -f UTF-8 de_DE.UTF-8
+localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro
+localedef -i en_HK -f ISO-8859-1 en_HK
+localedef -i en_PH -f ISO-8859-1 en_PH
+localedef -i en_US -f ISO-8859-15 en_US.ISO-8859-15
+localedef -i en_US -f ISO-8859-1 en_US.ISO-8859-1
+localedef -i en_US -f ISO-8859-1 en_US
+localedef -i en_US -f UTF-8 en_US.UTF-8
+localedef -i en_US -f ISO-8859-1 en_US.ISO8859-1
+localedef -i es_MX -f ISO-8859-1 es_MX
+localedef -i fr_FR -f ISO-8859-1 fr_FR
+localedef -i it_IT -f ISO-8859-1 it_IT
+localedef -i ja_JP -f EUC-JP ja_JP.eucjp
+localedef -i se_NO -f UTF-8 se_NO.UTF-8
+localedef -i ta_IN -f UTF-8 ta_IN
+localedef -i es_ES -f ISO-8859-1 es_ES
+localedef -i fr_FR@euro -f ISO-8859-1 fr_FR@euro
+localedef -i is_IS -f UTF-8 is_IS.UTF-8
+localedef -i zh_TW -f BIG5 zh_TW.BIG5
+localedef -i en_US -f ISO-8859-15 en_US.ISO-8859-15
+
+echo ""
+echo "Installation done!"
+echo ""
+
+# Step 4: Start LSB test
+if [ -x ${LSB_START_CMD} ]
+then
+	${LSB_START_CMD}
+fi
+
+echo "---------------------------------"
+echo "Run all the certification version of LSB Tests"
+echo "---------------------------------"
+
+LSB_DIST_CHECKER="/opt/lsb/test/manager/utils/dist-checker.pl"
+SESSION="${WORK_DIR}/session"
+if [ ! -e ${SESSION} ]
+then
+	echo "Error: Could not find session file."
+	echo "You must run LSB test from webbrower."
+	exit 1
+fi
+
+if [ -x ${LSB_DIST_CHECKER} ]
+then
+	${LSB_DIST_CHECKER} -v2 -f ${SESSION}
+	check
+fi
+
+echo ""
+echo "LSB test complete. Please check the log file in /var/opt/lsb/test/manager/results/"
+echo ""
+
diff --git a/meta/recipes-extended/lsb/lsbtest/packages_list b/meta/recipes-extended/lsb/lsbtest/packages_list
new file mode 100644
index 0000000..27d8352
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsbtest/packages_list
@@ -0,0 +1,50 @@
+LSB_RELEASE="released-4.1.0"
+LSB_ARCH="lsbarch"
+
+BASE_PACKAGES_LIST="lsb-setup-4.1.0-1.noarch.rpm"
+
+RUNTIME_BASE_PACKAGES_LIST="lsb-dist-checker-5.0.0.1-1.targetarch.rpm \
+	lsb-tet3-lite-3.7-27.lsb5.targetarch.rpm \
+	lsb-tet3-lite-devel-3.7-27.lsb5.targetarch.rpm \
+	lsb-xvfb-1.2.0-22.targetarch.rpm \
+	"
+
+RUNTIME_PACKAGES_LIST="lsb-cmdchk-4.1.4-5.targetarch.rpm \
+	lsb-libchk-4.1.4-5.targetarch.rpm \
+	lsb-qm-2.2-12.lsb4.targetarch.rpm \
+	lsb-task-dist-testkit-4.1.9-1.noarch.rpm \
+	lsb-test-core-4.1.15-1.targetarch.rpm \
+	lsb-test-cpp-t2c-4.1.0-1.targetarch.rpm \
+	lsb-test-desktop-4.1.9-1.targetarch.rpm \
+	lsb-test-desktop-t2c-4.1.3-3.targetarch.rpm \
+	lsb-test-libstdcpp-4.1.0-18.lsb4.targetarch.rpm \
+	lsb-test-olver-core-4.1.4-1.targetarch.rpm \
+	lsb-test-perl-4.1.8-1.noarch.rpm \
+	lsb-test-printing-4.1.2-1.targetarch.rpm \
+	lsb-test-python-4.1.5-1.targetarch.rpm \
+	lsb-test-qt3-azov-4.1.1-3.targetarch.rpm \
+	lsb-test-qt4-azov-4.1.3-1.targetarch.rpm \
+	lsb-test-xts5-5.1.5-45.lsb4.targetarch.rpm \
+	lsb-test-alsa-t2c-4.1.0-1.targetarch.rpm \
+	lsb-test-core-t2c-4.1.2-3.targetarch.rpm \
+	lsb-test-xml2-azov-4.1.0-1.targetarch.rpm \
+	"
+
+APP_PACKAGES_LIST="lsb-python-2.4.6-7.lsb4.targetarch.rpm \
+	lsb-apache-2.2.14-8.lsb4.targetarch.rpm \
+	lsb-tcl-8.5.7-8.lsb4.targetarch.rpm \
+	lsb-expect-5.43.0-13.lsb4.targetarch.rpm \
+	lsb-groff-1.20.1-7.lsb4.targetarch.rpm \
+	lsb-raptor-1.4.19-5.lsb4.targetarch.rpm \
+	lsb-xpdf-1.01-14.lsb4.targetarch.rpm \
+	lsb-samba-3.4.3-9.lsb4.targetarch.rpm \
+	lsb-rsync-3.0.6-6.lsb4.targetarch.rpm \
+	"
+
+APP_TESTFILES_LIST="expect-tests.tar \
+	tcl-tests.tar \
+	raptor-tests.tar \
+	test1.pdf \
+	test2.pdf \
+	"
+
diff --git a/meta/recipes-extended/lsb/lsbtest/session b/meta/recipes-extended/lsb/lsbtest/session
new file mode 100644
index 0000000..85ca2ef
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsbtest/session
@@ -0,0 +1,194 @@
+[GENERAL]
+VERBOSE_LEVEL:   1
+ARCHITECTURE:    targetarch
+USE_INTERNET:    1
+STD_VERSION:     LSB 4.1
+STD_PROFILE:     no
+[cmdchk]
+RUN: 1
+VERSION: local|*
+
+[libchk]
+RUN: 1
+VERSION: local|*
+
+[alsa-t2c]
+RUN: 1
+VERSION: local|*
+
+[alsa-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/alsa-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/alsa-t2c/results
+
+[core]
+RUN: 1
+VERSION: local|*
+
+[core|local|*]
+AUTOREPLY_PROVIDES_BASH: n
+AUTOREPLY_TESTRUN_PATH: /home/tet/test_sets
+AUTOREPLY_PERSON: Automated
+AUTOREPLY_KERNEL_NAME: vmlinuz
+AUTOREPLY_INSTALL_LSBPAM_CONF: y
+AUTOREPLY_PROVIDES_C_SHELL: n
+AUTOREPLY_ORGANISATION: N/A
+AUTOREPLY_SET_PASS_MIN_DAYS: y
+AUTOREPLY_PROVIDES_SYSV_INIT: 
+AUTOREPLY_ISNTALL_DEVS: y
+AUTOREPLY_SUPPORTS_FILE_CMD: y
+AUTOREPLY_TEST_SYSTEM: Distribution Checker
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/core/tet/test_sets
+AUTOREPLY_SUPPORTS_NLS: n
+AUTOREPLY_SUPPORTS_PROCESS_ACCOUNTING: n
+AUTOREPLY_PATH_TO_RC.D: 
+AUTOREPLY_ALLOWS_MAKEDEV: n
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/core/tet/test_sets/results
+
+[core-t2c]
+RUN: 1
+VERSION: local|*
+
+[core-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/core-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/core-t2c/results
+
+[cpp-t2c]
+RUN: 1
+VERSION: local|*
+
+[cpp-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/cpp-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/cpp-t2c/results
+
+[desktop]
+RUN: 1
+VERSION: local|*
+
+[desktop|local|*]
+AUTOREPLY_DESKTOP_ENVIRONMENT: [default]
+AUTOREPLY_PERSON: Automated
+AUTOREPLY_X_CLIENT_HOSTNAME: 
+AUTOREPLY_TEST_SYSTEM: Distribution Checker
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/desktop
+AUTOREPLY_X11_FONT_PATH: [default]
+AUTOREPLY_SHOW_SUMMARY_REPORT: 
+AUTOREPLY_ORGANISATION: N/A
+AUTOREPLY_XVFB_DISPLAY: [default]
+
+[desktop-t2c]
+RUN: 1
+VERSION: local|*
+
+[desktop-t2c|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/desktop-t2c
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/desktop-t2c/results
+
+[libstdcpp]
+RUN: 1
+VERSION: local|*
+
+[libstdcpp|local|*]
+AUTOREPLY_TEST_SYSTEM: Distribution Checker
+AUTOREPLY_PERSON: Automated
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/libstdcpp_4.1.0
+AUTOREPLY_ORGANISATION: N/A
+AUTOREPLY_GNU_TRIPLET: 
+
+[olver]
+RUN: 1
+VERSION: local|*
+
+[olver|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/olver-core
+AUTOREPLY_RESULTS_DIR: /var/opt/lsb/test/olver-core
+
+[perl]
+RUN: 1
+VERSION: local|*
+
+[perl|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/perl
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/perl/results
+
+[printing]
+RUN: 1
+VERSION: local|*
+
+[printing|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/printing
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/printing/results
+
+[python]
+RUN: 1
+VERSION: local|*
+
+[python|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/python
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/python/results
+
+[qt3-azov]
+RUN: 1
+VERSION: local|*
+
+[qt3-azov|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/qt3-azov
+AUTOREPLY_X11_FONT_PATH: [default]
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/qt3-azov/results
+
+[qt4-azov]
+RUN: 1
+VERSION: local|*
+
+[qt4-azov|local|*]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/qt4-azov
+AUTOREPLY_X11_FONT_PATH: [default]
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/qt4-azov/results
+
+[xml2-azov]
+RUN: 1
+VERSION: local|*
+
+[xts5]
+RUN: 1
+VERSION: local|*
+
+[xts5|local|*]
+AUTOREPLY_XT_FONTPATH_GOOD: [default]
+AUTOREPLY_TESTSUITE_DIR: /opt/lsb/test/xts5
+AUTOREPLY_XVFB_DISPLAY: [default]
+AUTOREPLY_RESULTS_DIR: /opt/lsb/test/xts5/xts5/results
+AUTOREPLY_XT_FONTPATH: [default]
+AUTOREPLY_X_CLIENT_HOSTNAME: 
+
+[apache]
+RUN: 1
+VERSION: local|*
+
+[expect]
+RUN: 1
+VERSION: local|*
+
+[groff]
+RUN: 1
+VERSION: local|*
+
+[raptor]
+RUN: 1
+VERSION: local|*
+
+[rsync]
+RUN: 1
+VERSION: local|*
+
+[samba]
+RUN: 1
+VERSION: local|*
+
+[tcl]
+RUN: 1
+VERSION: local|*
+
+[xpdf]
+RUN: 1
+VERSION: local|*
+
diff --git a/meta/recipes-extended/lsb/lsbtest_1.0.bb b/meta/recipes-extended/lsb/lsbtest_1.0.bb
new file mode 100644
index 0000000..ea12502
--- /dev/null
+++ b/meta/recipes-extended/lsb/lsbtest_1.0.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Automates Linux Standard Base (LSB) tests"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://LSB_Test.sh;beginline=3;endline=16;md5=7063bb54b04719df0716b513447f4fc0"
+
+SRC_URI = "file://LSB_Test.sh \
+		   file://packages_list \
+		   file://session \
+		   "
+RDEPENDS_${PN} = "rpm"
+
+S = "${WORKDIR}"
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 ${S}/LSB_Test.sh ${D}${bindir}
+	install -d  ${D}/opt/lsb-test
+	install -m 0644 ${S}/packages_list ${D}/opt/lsb-test/packages_list
+	install -m 0644 ${S}/session ${D}/opt/lsb-test/session
+	if [ "${TARGET_ARCH}" = "i586" ] || [ "${TARGET_ARCH}" = "i686" ];then
+		sed -i -e 's/lsbarch/ia32/g' -e 's/targetarch/i486/g' ${D}/opt/lsb-test/packages_list
+		sed -i -e 's/targetarch/x86/g' ${D}/opt/lsb-test/session
+	fi
+	if [ "${TARGET_ARCH}" = "x86_64" ];then
+		sed -i -e 's/lsbarch/amd64/g' -e 's/targetarch/x86_64/g' ${D}/opt/lsb-test/packages_list
+		sed -i -e 's/targetarch/x86-64/g' ${D}/opt/lsb-test/session
+	fi
+	if [ "${TARGET_ARCH}" = "powerpc" ];then
+		sed -i -e 's/lsbarch/ppc32/g' -e 's/targetarch/ppc/g' ${D}/opt/lsb-test/packages_list
+		sed -i -e 's/targetarch/PPC32/g' ${D}/opt/lsb-test/session
+	fi
+
+	# For a ppc64 target. the default userspace is 32b.
+	# Therefore, only change the lsbarch and targetarch
+	# in the package_list when MLIB=lib64 is being used.
+	# Otherwise, by default, the ppc32 LSB packages
+	# will be downloaded by LSB_Test.sh
+	if [ "${TARGET_ARCH}" = "powerpc64" ];then
+		if [ "${PN}" != "${BPN}" ];then
+			sed -i -e 's/lsbarch/ppc64/g' -e 's/targetarch/ppc64/g' ${D}/opt/lsb-test/packages_list
+			sed -i -e 's/targetarch/PPC64/g' ${D}/opt/lsb-test/session
+		fi
+	fi
+}
+
+FILES_${PN} += "/opt/lsb-test/* \
+               "
diff --git a/meta/recipes-extended/lsof/lsof_4.89.bb b/meta/recipes-extended/lsof/lsof_4.89.bb
new file mode 100644
index 0000000..9b7de9a
--- /dev/null
+++ b/meta/recipes-extended/lsof/lsof_4.89.bb
@@ -0,0 +1,57 @@
+SUMMARY = "LiSt Open Files tool"
+DESCRIPTION = "Lsof is a Unix-specific diagnostic tool. \
+Its name stands for LiSt Open Files, and it does just that."
+SECTION = "devel"
+LICENSE = "BSD"
+
+SRC_URI = "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "1b9cd34f3fb86856a125abbf2be3a386"
+SRC_URI[sha256sum] = "81ac2fc5fdc944793baf41a14002b6deb5a29096b387744e28f8c30a360a3718"
+
+LOCALSRC = "file://${WORKDIR}/lsof_${PV}/lsof_${PV}_src.tar"
+S = "${WORKDIR}/lsof_${PV}_src"
+
+LIC_FILES_CHKSUM = "file://${S}/00README;beginline=645;endline=679;md5=964df275d26429ba3b39dbb9f205172a"
+
+python do_unpack () {
+    # temporarily change S for unpack
+    # of lsof_${PV}
+    s = d.getVar('S', False)
+    d.setVar('S', '${WORKDIR}/lsof_${PV}')
+    bb.build.exec_func('base_do_unpack', d)
+    # temporarily change SRC_URI for unpack
+    # of lsof_${PV}_src
+    src_uri = d.getVar('SRC_URI', False)
+    d.setVar('SRC_URI', '${LOCALSRC}')
+    d.setVar('S', s)
+    bb.build.exec_func('base_do_unpack', d)
+    d.setVar('SRC_URI', src_uri)
+}
+
+export LSOF_INCLUDE = "${STAGING_INCDIR}"
+
+do_configure () {
+	export LSOF_AR="${AR} cr"
+	export LSOF_RANLIB="${RANLIB}"
+        if [ "x${GLIBCVERSION}" != "x" ];then
+                LINUX_CLIB=`echo ${GLIBCVERSION} |sed -e 's,\.,,g'`
+                LINUX_CLIB="-DGLIBCV=${LINUX_CLIB}"
+                export LINUX_CLIB
+        fi
+	yes | ./Configure linux
+}
+
+export I = "${STAGING_INCDIR}"
+export L = "${STAGING_INCDIR}"
+export EXTRA_OEMAKE = ""
+
+do_compile () {
+	oe_runmake 'CC=${CC}' 'CFGL=${LDFLAGS} -L./lib -llsof' 'DEBUG=' 'INCL=${CFLAGS}'
+}
+
+do_install () {
+	install -d ${D}${sbindir} ${D}${mandir}/man8
+	install -m 4755 lsof ${D}${sbindir}/lsof
+	install -m 0644 lsof.8 ${D}${mandir}/man8/lsof.8
+}
diff --git a/meta/recipes-extended/ltp/ltp/0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch b/meta/recipes-extended/ltp/ltp/0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch
new file mode 100644
index 0000000..1b4d232
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch
@@ -0,0 +1,202 @@
+From 9751a6526cffcdf4e3dc2cb33641259a7be00e19 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sat, 7 Dec 2013 18:24:32 +0100
+Subject: [PATCH] Rename runtests_noltp.sh script so have unique name
+
+* they are installed in the same target path
+  /opt/ltp/testcases/bin/runtests_noltp.sh
+  and overwrite each other in non-deterministic way
+  when multiple processes are used in "make install"
+
+  ./temp/log.do_install:install -m 00775
+    "ltp/20120903-r2/ltp-20120903/testcases/kernel/containers/sysvipc/runtests_noltp.sh"
+    "ltp/20120903-r2/image/opt/ltp/testcases/bin/runtests_noltp.sh"
+  ./temp/log.do_install:install -m 00775
+    "ltp/20120903-r2/ltp-20120903/testcases/kernel/containers/utsname/runtests_noltp.sh"
+    "ltp/20120903-r2/image/opt/ltp/testcases/bin/runtests_noltp.sh"
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ .../kernel/containers/sysvipc/runipctests_noltp.sh | 31 ++++++++++++++++
+ .../kernel/containers/sysvipc/runtests_noltp.sh    | 31 ----------------
+ .../kernel/containers/utsname/runtests_noltp.sh    | 41 ----------------------
+ .../kernel/containers/utsname/runutstests_noltp.sh | 41 ++++++++++++++++++++++
+ 4 files changed, 72 insertions(+), 72 deletions(-)
+ create mode 100644 testcases/kernel/containers/sysvipc/runipctests_noltp.sh
+ delete mode 100644 testcases/kernel/containers/sysvipc/runtests_noltp.sh
+ delete mode 100755 testcases/kernel/containers/utsname/runtests_noltp.sh
+ create mode 100755 testcases/kernel/containers/utsname/runutstests_noltp.sh
+
+diff --git a/testcases/kernel/containers/sysvipc/runipctests_noltp.sh b/testcases/kernel/containers/sysvipc/runipctests_noltp.sh
+new file mode 100644
+index 0000000..84f398f
+--- /dev/null
++++ b/testcases/kernel/containers/sysvipc/runipctests_noltp.sh
+@@ -0,0 +1,31 @@
++#!/bin/sh
++################################################################################
++##                                                                            ##
++## Copyright (c) International Business Machines  Corp., 2007                 ##
++##                                                                            ##
++## This program is free software;  you can redistribute it and#or modify      ##
++## it under the terms of the GNU General Public License as published by       ##
++## the Free Software Foundation; either version 2 of the License, or          ##
++## (at your option) any later version.                                        ##
++##                                                                            ##
++## This program is distributed in the hope that it will be useful, but        ##
++## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
++## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
++## for more details.                                                          ##
++##                                                                            ##
++## You should have received a copy of the GNU General Public License          ##
++## along with this program;  if not, write to the Free Software               ##
++## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
++##                                                                            ##
++################################################################################
++
++exit_code=0
++echo "sysvipc tests"
++for type in none clone unshare; do
++      echo "**sysvipc $type"
++      ./shmnstest_noltp $type
++      if [ $? -ne 0 ]; then
++              exit_code=$?
++      fi
++done
++exit $exit_code
+diff --git a/testcases/kernel/containers/sysvipc/runtests_noltp.sh b/testcases/kernel/containers/sysvipc/runtests_noltp.sh
+deleted file mode 100644
+index 84f398f..0000000
+--- a/testcases/kernel/containers/sysvipc/runtests_noltp.sh
++++ /dev/null
+@@ -1,31 +0,0 @@
+-#!/bin/sh
+-################################################################################
+-##                                                                            ##
+-## Copyright (c) International Business Machines  Corp., 2007                 ##
+-##                                                                            ##
+-## This program is free software;  you can redistribute it and#or modify      ##
+-## it under the terms of the GNU General Public License as published by       ##
+-## the Free Software Foundation; either version 2 of the License, or          ##
+-## (at your option) any later version.                                        ##
+-##                                                                            ##
+-## This program is distributed in the hope that it will be useful, but        ##
+-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
+-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
+-## for more details.                                                          ##
+-##                                                                            ##
+-## You should have received a copy of the GNU General Public License          ##
+-## along with this program;  if not, write to the Free Software               ##
+-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
+-##                                                                            ##
+-################################################################################
+-
+-exit_code=0
+-echo "sysvipc tests"
+-for type in none clone unshare; do
+-      echo "**sysvipc $type"
+-      ./shmnstest_noltp $type
+-      if [ $? -ne 0 ]; then
+-              exit_code=$?
+-      fi
+-done
+-exit $exit_code
+diff --git a/testcases/kernel/containers/utsname/runtests_noltp.sh b/testcases/kernel/containers/utsname/runtests_noltp.sh
+deleted file mode 100755
+index 43cb7e2..0000000
+--- a/testcases/kernel/containers/utsname/runtests_noltp.sh
++++ /dev/null
+@@ -1,41 +0,0 @@
+-#!/bin/sh
+-################################################################################
+-##                                                                            ##
+-## Copyright (c) International Business Machines  Corp., 2007                 ##
+-##                                                                            ##
+-## This program is free software;  you can redistribute it and#or modify      ##
+-## it under the terms of the GNU General Public License as published by       ##
+-## the Free Software Foundation; either version 2 of the License, or          ##
+-## (at your option) any later version.                                        ##
+-##                                                                            ##
+-## This program is distributed in the hope that it will be useful, but        ##
+-## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
+-## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
+-## for more details.                                                          ##
+-##                                                                            ##
+-## You should have received a copy of the GNU General Public License          ##
+-## along with this program;  if not, write to the Free Software               ##
+-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
+-##                                                                            ##
+-################################################################################
+-
+-oldhostname=`hostname`
+-exit_code=0
+-echo "unshare tests"
+-for i in `seq 1 5`; do
+-	echo "test $i (unshare)"
+-	./utstest_noltp unshare $i
+-	if [ $? -ne 0 ]; then
+-		exit_code=$?
+-	fi
+-done
+-echo "clone tests"
+-for i in `seq 1 5`; do
+-	echo "test $i (clone)"
+-	./utstest_noltp clone $i
+-	if [ $? -ne 0 ]; then
+-		exit_code=$?
+-	fi
+-done
+-hostname "$oldhostname"
+-exit $exit_code
+diff --git a/testcases/kernel/containers/utsname/runutstests_noltp.sh b/testcases/kernel/containers/utsname/runutstests_noltp.sh
+new file mode 100755
+index 0000000..43cb7e2
+--- /dev/null
++++ b/testcases/kernel/containers/utsname/runutstests_noltp.sh
+@@ -0,0 +1,41 @@
++#!/bin/sh
++################################################################################
++##                                                                            ##
++## Copyright (c) International Business Machines  Corp., 2007                 ##
++##                                                                            ##
++## This program is free software;  you can redistribute it and#or modify      ##
++## it under the terms of the GNU General Public License as published by       ##
++## the Free Software Foundation; either version 2 of the License, or          ##
++## (at your option) any later version.                                        ##
++##                                                                            ##
++## This program is distributed in the hope that it will be useful, but        ##
++## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
++## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
++## for more details.                                                          ##
++##                                                                            ##
++## You should have received a copy of the GNU General Public License          ##
++## along with this program;  if not, write to the Free Software               ##
++## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA    ##
++##                                                                            ##
++################################################################################
++
++oldhostname=`hostname`
++exit_code=0
++echo "unshare tests"
++for i in `seq 1 5`; do
++	echo "test $i (unshare)"
++	./utstest_noltp unshare $i
++	if [ $? -ne 0 ]; then
++		exit_code=$?
++	fi
++done
++echo "clone tests"
++for i in `seq 1 5`; do
++	echo "test $i (clone)"
++	./utstest_noltp clone $i
++	if [ $? -ne 0 ]; then
++		exit_code=$?
++	fi
++done
++hostname "$oldhostname"
++exit $exit_code
+-- 
+1.8.4.3
+
diff --git a/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch b/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch
new file mode 100644
index 0000000..905eafb
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/0001-ltp-vma03-fix-the-alginment-of-page-size.patch
@@ -0,0 +1,34 @@
+From 243881d71d2d49027c3dc15fe27ebe7f4ee68700 Mon Sep 17 00:00:00 2001
+From: Chuang Dong <Chuang.Dong@windriver.com>
+Date: Wed, 10 Jun 2015 09:51:09 +0800
+Subject: [PATCH] ltp: vma03 fix the alginment of page size
+
+the offset the param of mmap2() doesn't align the page size, but,
+this param allow must be a multiple of the page size as returned
+by sysconf(_SC_PAGE_SIZE).meanwhile offset * 4096 must be a
+multiple of the system page size, so modify the input param of offset
+pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
+
+Upstream-Status: Submitted
+
+Signed-off-by: Chuang Dong <Chuang.Dong@windriver.com>
+---
+ testcases/kernel/mem/vma/vma03.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/testcases/kernel/mem/vma/vma03.c b/testcases/kernel/mem/vma/vma03.c
+index 6af9960..b86d7ce 100644
+--- a/testcases/kernel/mem/vma/vma03.c
++++ b/testcases/kernel/mem/vma/vma03.c
+@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
+ 		if (fd == -1)
+ 			tst_brkm(TBROK | TERRNO, NULL, "open %s", TESTFILE);
+ 
+-		pgoff = ULONG_MAX - 1;
++		pgoff = (ULONG_MAX - 1)&(~((pgsz-1)>>12));
+ 		map = mmap2(NULL, pgsz, PROT_READ | PROT_WRITE, MAP_PRIVATE,
+ 			    fd, pgoff);
+ 		if (map == MAP_FAILED)
+-- 
+1.8.5.2.233.g932f7e4
+
diff --git a/meta/recipes-extended/ltp/ltp/add-knob-for-numa.patch b/meta/recipes-extended/ltp/ltp/add-knob-for-numa.patch
new file mode 100644
index 0000000..064f00a
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/add-knob-for-numa.patch
@@ -0,0 +1,39 @@
+[PATCH] add knob to control whether numa support should be checked
+
+Upstream-Status: Pending
+
+otherwise the random dependency will be generated
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ configure.ac                                       |   10 +-
+diff --git a/configure.ac b/configure.ac
+index 9f397e7..1357256 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -142,6 +142,12 @@ else
+     AC_SUBST([WITH_REALTIME_TESTSUITE],["no"])
+ fi
+ 
++AC_ARG_WITH([numa],
++  AC_HELP_STRING([--without-numa],
++    [without the numa support]),
++  [],[with_numa=yes],
++)
++
+ AC_CONFIG_SUBDIRS([utils/ffsb-6.0-rc2])
+ 
+ # END testsuites knobs
+@@ -159,7 +165,9 @@ LTP_CHECK_SIGNAL
+ LTP_CHECK_SYSCALL_EVENTFD
+ LTP_CHECK_SYSCALL_KEYCTL
+ LTP_CHECK_SYSCALL_MODIFY_LDT
++if test "x$with_numa" = xyes; then
+ LTP_CHECK_SYSCALL_NUMA
++fi
+ LTP_CHECK_SYSCALL_QUOTACTL
+ LTP_CHECK_SYSCALL_SIGNALFD
+ LTP_CHECK_SYSCALL_UNSHARE
+-- 
+1.9.1
+
diff --git a/meta/recipes-extended/ltp/ltp/add-knob-for-tirpc.patch b/meta/recipes-extended/ltp/ltp/add-knob-for-tirpc.patch
new file mode 100644
index 0000000..36ff4c7
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/add-knob-for-tirpc.patch
@@ -0,0 +1,37 @@
+[PATCH] add knob to control whether tirpc support should be checked
+
+Upstream-Status: Pending
+
+tirpc support is broken upstream. in the meantime, allow to disable tirpc.
+
+Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
+---
+ configure.ac |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -98,6 +98,13 @@ if test "x$with_python" = xyes; then
+ else
+     AC_SUBST([WITH_PYTHON],["no"])
+ fi
++
++# TI RPC
++AC_ARG_WITH([tirpc],
++  AC_HELP_STRING([--without-tirpc],
++    [without libtirpc support]),
++  [],[with_tirpc=yes],
++)
+ # END tools knobs
+ 
+ # Testsuites knobs
+@@ -182,7 +189,9 @@ LTP_CHECK_RENAMEAT
+ LTP_CHECK_FALLOCATE
+ LTP_CHECK_SYSCALL_FCNTL
+ LTP_CHECK_SYSCALL_PERF_EVENT_OPEN
++if test "x$with_tirpc" = xyes; then
+ LTP_CHECK_TIRPC
++fi
+ LTP_CHECK_TEE
+ LTP_CHECK_SPLICE
+ LTP_CHECK_VMSPLICE
diff --git a/meta/recipes-extended/ltp/ltp/ltp-Do-not-link-against-libfl.patch b/meta/recipes-extended/ltp/ltp/ltp-Do-not-link-against-libfl.patch
new file mode 100644
index 0000000..20fd4c3
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/ltp-Do-not-link-against-libfl.patch
@@ -0,0 +1,31 @@
+From 5bda9c0af56869c6ff2c25d38ea087179c946bc6 Mon Sep 17 00:00:00 2001
+From: Chong Lu <Chong.Lu@windriver.com>
+Date: Tue, 11 Mar 2014 14:47:22 +0800
+Subject: [PATCH] ltp: Don't link against libfl
+
+We have already defined yywrap function in scan.l file. After this, we no longer need to
+link against libfl and so no longer get errors about undefined references to yylex.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ pan/Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pan/Makefile b/pan/Makefile
+index 4cc6466..a4b575b 100644
+--- a/pan/Makefile
++++ b/pan/Makefile
+@@ -31,7 +31,7 @@ CPPFLAGS		+= -Wno-error
+ 
+ CPPFLAGS		+= -I$(abs_srcdir)
+ 
+-LDLIBS			+= -lm $(LEXLIB)
++LDLIBS			+= -lm
+ 
+ LFLAGS			+= -l
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/ltp/ltp/make-setregid02-work.patch b/meta/recipes-extended/ltp/ltp/make-setregid02-work.patch
new file mode 100644
index 0000000..4836010
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp/make-setregid02-work.patch
@@ -0,0 +1,61 @@
+[PATCH] make setregid02 work
+
+Upstream-Status: Inappropriate [configuration]
+
+there is no "nobody" group in oe-core, the user "nobody" belongs to
+"nogroup" group, so replace nobody with nogroup to make the test pass
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ testcases/kernel/syscalls/setregid/setregid02.c | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/testcases/kernel/syscalls/setregid/setregid02.c b/testcases/kernel/syscalls/setregid/setregid02.c
+index 8058627..866bee4 100644
+--- a/testcases/kernel/syscalls/setregid/setregid02.c
++++ b/testcases/kernel/syscalls/setregid/setregid02.c
+@@ -41,7 +41,7 @@ static gid_t neg_one = -1;
+ 
+ static struct passwd *ltpuser;
+ 
+-static struct group nobody, root, bin;
++static struct group nogroup, root, bin;
+ 
+ /*
+  * The following structure contains all test data.  Each structure in the array
+@@ -57,17 +57,17 @@ struct test_data_t {
+ 	char *test_msg;
+ } test_data[] = {
+ 	{
+-	&neg_one, &root.gr_gid, EPERM, &nobody, &nobody,
++	&neg_one, &root.gr_gid, EPERM, &nogroup, &nogroup,
+ 		    "After setregid(-1, root),"}, {
+-	&neg_one, &bin.gr_gid, EPERM, &nobody, &nobody,
++	&neg_one, &bin.gr_gid, EPERM, &nogroup, &nogroup,
+ 		    "After setregid(-1, bin)"}, {
+-	&root.gr_gid, &neg_one, EPERM, &nobody, &nobody,
++	&root.gr_gid, &neg_one, EPERM, &nogroup, &nogroup,
+ 		    "After setregid(root,-1),"}, {
+-	&bin.gr_gid, &neg_one, EPERM, &nobody, &nobody,
++	&bin.gr_gid, &neg_one, EPERM, &nogroup, &nogroup,
+ 		    "After setregid(bin, -1),"}, {
+-	&root.gr_gid, &bin.gr_gid, EPERM, &nobody, &nobody,
++	&root.gr_gid, &bin.gr_gid, EPERM, &nogroup, &nogroup,
+ 		    "After setregid(root, bin)"}, {
+-	&bin.gr_gid, &root.gr_gid, EPERM, &nobody, &nobody,
++	&bin.gr_gid, &root.gr_gid, EPERM, &nogroup, &nogroup,
+ 		    "After setregid(bin, root),"}
+ };
+ 
+@@ -165,7 +165,7 @@ static void setup(void)
+ } while (0)
+ 
+ 	GET_GID(root);
+-	GET_GID(nobody);
++	GET_GID(nogroup);
+ 	GET_GID(bin);
+ 
+ 	TEST_PAUSE;
+-- 
+1.9.1
+
diff --git a/meta/recipes-extended/ltp/ltp_20150420.bb b/meta/recipes-extended/ltp/ltp_20150420.bb
new file mode 100644
index 0000000..108ebf1
--- /dev/null
+++ b/meta/recipes-extended/ltp/ltp_20150420.bb
@@ -0,0 +1,86 @@
+SUMMARY = "Linux Test Project"
+DESCRIPTION = "The Linux Test Project is a joint project with SGI, IBM, OSDL, and Bull with a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The Linux Test Project is a collection of tools for testing the Linux kernel and related features."
+HOMEPAGE = "http://ltp.sourceforge.net"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & GPLv2+ & LGPLv2+ & LGPLv2.1+ & BSD-2-Clause"
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+    file://testcases/kernel/controllers/freezer/COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+    file://testcases/kernel/controllers/freezer/run_freezer.sh;beginline=5;endline=17;md5=86a61d2c042d59836ffb353a21456498 \
+    file://testcases/kernel/hotplug/memory_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
+    file://testcases/kernel/hotplug/cpu_hotplug/COPYING;md5=e04a2e542b2b8629bf9cd2ba29b0fe41 \
+    file://testcases/open_posix_testsuite/COPYING;md5=216e43b72efbe4ed9017cc19c4c68b01 \
+    file://testcases/realtime/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+    file://tools/netpipe-2.4/COPYING;md5=9e3781bb5fe787aa80e1f51f5006b6fa \
+    file://tools/netpipe-2.4-ipv6/COPYING;md5=9e3781bb5fe787aa80e1f51f5006b6fa \
+    file://tools/top-LTP/proc/COPYING;md5=aefc88eb8a41672fbfcfe6b69ab8c49c \
+    file://tools/pounder21/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+    file://utils/benchmark/kernbench-0.42/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+    file://utils/ffsb-6.0-rc2/COPYING;md5=c46082167a314d785d012a244748d803 \
+"
+
+DEPENDS = "attr libaio libcap acl openssl zip-native"
+SRCREV = "77d0b7fd0148ce657c5a25060667e978c07662a0"
+
+SRC_URI = "git://github.com/linux-test-project/ltp.git \
+    file://0001-Rename-runtests_noltp.sh-script-so-have-unique-name.patch \
+    file://ltp-Do-not-link-against-libfl.patch \
+    file://make-setregid02-work.patch \
+    file://add-knob-for-numa.patch \
+    file://add-knob-for-tirpc.patch \
+    file://0001-ltp-vma03-fix-the-alginment-of-page-size.patch \
+"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+export prefix = "/opt/ltp"
+export exec_prefix = "/opt/ltp"
+
+PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl,"
+EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4"
+EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite "
+# ltp network/rpc test cases ftbfs when libtirpc is found
+EXTRA_OECONF += " --without-tirpc "
+
+# The makefiles make excessive use of make -C and several include testcases.mk
+# which triggers a build of the syscall header. To reproduce, build ltp,
+# then delete the header, then "make -j XX" and watch regen.sh run multiple
+# times. Its easier to generate this once here instead.
+do_compile_prepend () {
+	( make -C ${B}/testcases/kernel include/linux_syscall_numbers.h )
+}
+
+do_install(){
+    install -d ${D}/opt/ltp/
+    oe_runmake DESTDIR=${D} SKIP_IDCHECK=1 install
+
+    # Copy POSIX test suite into ${D}/opt/ltp/testcases by manual
+    cp -r testcases/open_posix_testsuite ${D}/opt/ltp/testcases
+}
+
+RDEPENDS_${PN} = "perl e2fsprogs-mke2fs python-core libaio bash gawk expect"
+
+FILES_${PN}-dbg += "\
+    /opt/ltp/runtest/.debug \
+    /opt/ltp/testcases/*/.debug \
+    /opt/ltp/testcases/*/*/.debug \
+    /opt/ltp/testcases/*/*/*/.debug \
+    /opt/ltp/scenario_groups/.debug \
+    /opt/ltp/testscripts/.debug \
+    /opt/ltp/testscripts/open_posix_testsuite/.debug \
+"
+
+FILES_${PN}-staticdev += "/opt/ltp/lib/libmem.a"
+
+FILES_${PN} += "/opt/ltp/* /opt/ltp/runtest/* /opt/ltp/scenario_groups/* /opt/ltp/testcases/bin/* /opt/ltp/testcases/bin/*/bin/* /opt/ltp/testscripts/* /opt/ltp/testcases/open_posix_testsuite/* /opt/ltp/testcases/open_posix_testsuite/conformance/* /opt/ltp/testcases/open_posix_testsuite/Documentation/* /opt/ltp/testcases/open_posix_testsuite/functional/* /opt/ltp/testcases/open_posix_testsuite/include/* /opt/ltp/testcases/open_posix_testsuite/scripts/* /opt/ltp/testcases/open_posix_testsuite/stress/* /opt/ltp/testcases/open_posix_testsuite/tools/*"
+
+# Avoid generated binaries stripping. Otherwise some of the ltp tests such as ldd01 & nm01 fails
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+# However, test_arch_stripped is already stripped, so...
+INSANE_SKIP_${PN} += "already-stripped"
+
diff --git a/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch b/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch
new file mode 100644
index 0000000..77da333
--- /dev/null
+++ b/meta/recipes-extended/mailx/files/0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch
@@ -0,0 +1,59 @@
+From: Luk Claes <luk@debian.org>
+Date: Sat, 4 Jul 2009 10:54:53 +0200
+Subject: Don't reuse weak symbol optopt to fix FTBFS on mips*
+
+This patch is taken from 
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ getopt.c |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/getopt.c b/getopt.c
+index 83ce628..82e983c 100644
+--- a/getopt.c
++++ b/getopt.c
+@@ -43,7 +43,7 @@ typedef	int	ssize_t;
+ char	*optarg;
+ int	optind = 1;
+ int	opterr = 1;
+-int	optopt;
++int	optoptc;
+ 
+ static void
+ error(const char *s, int c)
+@@ -69,7 +69,7 @@ error(const char *s, int c)
+ 		*bp++ = *s++;
+ 	while (*msg)
+ 		*bp++ = *msg++;
+-	*bp++ = optopt;
++	*bp++ = optoptc;
+ 	*bp++ = '\n';
+ 	write(2, buf, bp - buf);
+ 	ac_free(buf);
+@@ -101,13 +101,13 @@ getopt(int argc, char *const argv[], const char *optstring)
+ 		}
+ 		curp = &argv[optind][1];
+ 	}
+-	optopt = curp[0] & 0377;
++	optoptc = curp[0] & 0377;
+ 	while (optstring[0]) {
+ 		if (optstring[0] == ':') {
+ 			optstring++;
+ 			continue;
+ 		}
+-		if ((optstring[0] & 0377) == optopt) {
++		if ((optstring[0] & 0377) == optoptc) {
+ 			if (optstring[1] == ':') {
+ 				if (curp[1] != '\0') {
+ 					optarg = (char *)&curp[1];
+@@ -127,7 +127,7 @@ getopt(int argc, char *const argv[], const char *optstring)
+ 					optind++;
+ 				optarg = 0;
+ 			}
+-			return optopt;
++			return optoptc;
+ 		}
+ 		optstring++;
+ 	}
diff --git a/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch b/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch
new file mode 100644
index 0000000..6bad433
--- /dev/null
+++ b/meta/recipes-extended/mailx/files/0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch
@@ -0,0 +1,41 @@
+From: Hilko Bengen <bengen@debian.org>
+Date: Wed, 27 Apr 2011 00:18:42 +0200
+Subject: Patched out SSL2 support since it is no longer supported by OpenSSL.
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ mailx.1   |    2 +-
+ openssl.c |    4 +---
+ 2 files changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/mailx.1 b/mailx.1
+index 417ea04..a02e430 100644
+--- a/mailx.1
++++ b/mailx.1
+@@ -3575,7 +3575,7 @@ Only applicable if SSL/TLS support is built using OpenSSL.
+ .TP
+ .B ssl-method
+ Selects a SSL/TLS protocol version;
+-valid values are `ssl2', `ssl3', and `tls1'.
++valid values are `ssl3', and `tls1'.
+ If unset, the method is selected automatically,
+ if possible.
+ .TP
+diff --git a/openssl.c b/openssl.c
+index b4e33fc..44fe4e5 100644
+--- a/openssl.c
++++ b/openssl.c
+@@ -216,9 +216,7 @@ ssl_select_method(const char *uhp)
+ 
+ 	cp = ssl_method_string(uhp);
+ 	if (cp != NULL) {
+-		if (equal(cp, "ssl2"))
+-			method = SSLv2_client_method();
+-		else if (equal(cp, "ssl3"))
++		if (equal(cp, "ssl3"))
+ 			method = SSLv3_client_method();
+ 		else if (equal(cp, "tls1"))
+ 			method = TLSv1_client_method();
diff --git a/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch b/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch
new file mode 100644
index 0000000..13b73ae
--- /dev/null
+++ b/meta/recipes-extended/mailx/files/0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch
@@ -0,0 +1,25 @@
+From: Hilko Bengen <bengen@debian.org>
+Date: Sat, 14 Apr 2012 20:22:43 +0200
+Subject: Fixed Lintian warning (warning: macro `N' not defined)
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ mailx.1 |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mailx.1 b/mailx.1
+index a02e430..b0723bd 100644
+--- a/mailx.1
++++ b/mailx.1
+@@ -3781,7 +3781,7 @@ you could examine the first message by giving the command:
+ .sp
+ .fi
+ which might cause
+-.N mailx
++.I mailx
+ to respond with, for example:
+ .nf
+ .sp
diff --git a/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch b/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch
new file mode 100644
index 0000000..5d61645
--- /dev/null
+++ b/meta/recipes-extended/mailx/files/0011-outof-Introduce-expandaddr-flag.patch
@@ -0,0 +1,70 @@
+From 9984ae5cb0ea0d61df1612b06952a61323c083d9 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 11:13:38 +0100
+Subject: [PATCH 1/4] outof: Introduce expandaddr flag
+
+Document that address expansion is disabled unless the expandaddr
+binary option is set.
+
+This has been assigned CVE-2014-7844 for BSD mailx, but it is not
+a vulnerability in Heirloom mailx because this feature was documented.
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ mailx.1 | 14 ++++++++++++++
+ names.c |  3 +++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/mailx.1 b/mailx.1
+index 70a7859..22a171b 100644
+--- a/mailx.1
++++ b/mailx.1
+@@ -656,6 +656,14 @@ but any reply returned to the machine
+ will have the system wide alias expanded
+ as all mail goes through sendmail.
+ .SS "Recipient address specifications"
++If the
++.I expandaddr
++option is not set (the default), recipient addresses must be names of
++local mailboxes or Internet mail addresses.
++.PP
++If the
++.I expandaddr
++option is set, the following rules apply:
+ When an address is used to name a recipient
+ (in any of To, Cc, or Bcc),
+ names of local mail folders
+@@ -2391,6 +2399,12 @@ and exits immediately.
+ If this option is set,
+ \fImailx\fR starts even with an empty mailbox.
+ .TP
++.B expandaddr
++Causes
++.I mailx
++to expand message recipient addresses, as explained in the section,
++Recipient address specifications.
++.TP
+ .B flipr
+ Exchanges the
+ .I Respond
+diff --git a/names.c b/names.c
+index 66e976b..c69560f 100644
+--- a/names.c
++++ b/names.c
+@@ -268,6 +268,9 @@ outof(struct name *names, FILE *fo, struct header *hp)
+ 	FILE *fout, *fin;
+ 	int ispipe;
+ 
++	if (value("expandaddr") == NULL)
++		return names;
++
+ 	top = names;
+ 	np = names;
+ 	time(&now);
+-- 
+1.9.3
+
+
diff --git a/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch b/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch
new file mode 100644
index 0000000..8cdbfd8
--- /dev/null
+++ b/meta/recipes-extended/mailx/files/0012-unpack-Disable-option-processing-for-email-addresses.patch
@@ -0,0 +1,79 @@
+From e34e2ac67b80497080ebecccec40c3b61456167d Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 11:14:06 +0100
+Subject: [PATCH 2/4] unpack: Disable option processing for email addresses
+ when calling sendmail
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ extern.h  | 2 +-
+ names.c   | 8 ++++++--
+ sendout.c | 2 +-
+ 3 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/extern.h b/extern.h
+index 6b85ba0..8873fe8 100644
+--- a/extern.h
++++ b/extern.h
+@@ -396,7 +396,7 @@ struct name *outof(struct name *names, FILE *fo, struct header *hp);
+ int is_fileaddr(char *name);
+ struct name *usermap(struct name *names);
+ struct name *cat(struct name *n1, struct name *n2);
+-char **unpack(struct name *np);
++char **unpack(struct name *smopts, struct name *np);
+ struct name *elide(struct name *names);
+ int count(struct name *np);
+ struct name *delete_alternates(struct name *np);
+diff --git a/names.c b/names.c
+index c69560f..45bbaed 100644
+--- a/names.c
++++ b/names.c
+@@ -549,7 +549,7 @@ cat(struct name *n1, struct name *n2)
+  * Return an error if the name list won't fit.
+  */
+ char **
+-unpack(struct name *np)
++unpack(struct name *smopts, struct name *np)
+ {
+ 	char **ap, **top;
+ 	struct name *n;
+@@ -564,7 +564,7 @@ unpack(struct name *np)
+ 	 * the terminating 0 pointer.  Additional spots may be needed
+ 	 * to pass along -f to the host mailer.
+ 	 */
+-	extra = 2;
++	extra = 3 + count(smopts);
+ 	extra++;
+ 	metoo = value("metoo") != NULL;
+ 	if (metoo)
+@@ -581,6 +581,10 @@ unpack(struct name *np)
+ 		*ap++ = "-m";
+ 	if (verbose)
+ 		*ap++ = "-v";
++	for (; smopts != NULL; smopts = smopts->n_flink)
++		if ((smopts->n_type & GDEL) == 0)
++			*ap++ = smopts->n_name;
++	*ap++ = "--";
+ 	for (; n != NULL; n = n->n_flink)
+ 		if ((n->n_type & GDEL) == 0)
+ 			*ap++ = n->n_name;
+diff --git a/sendout.c b/sendout.c
+index 7b7f2eb..c52f15d 100644
+--- a/sendout.c
++++ b/sendout.c
+@@ -835,7 +835,7 @@ start_mta(struct name *to, struct name *mailargs, FILE *input,
+ #endif	/* HAVE_SOCKETS */
+ 
+ 	if ((smtp = value("smtp")) == NULL) {
+-		args = unpack(cat(mailargs, to));
++		args = unpack(mailargs, to);
+ 		if (debug || value("debug")) {
+ 			printf(catgets(catd, CATSET, 181,
+ 					"Sendmail arguments:"));
+-- 
+1.9.3
+
+
diff --git a/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch b/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch
new file mode 100644
index 0000000..5558d86
--- /dev/null
+++ b/meta/recipes-extended/mailx/files/0013-fio.c-Unconditionally-require-wordexp-support.patch
@@ -0,0 +1,113 @@
+From 2bae8ecf04ec2ba6bb9f0af5b80485dd0edb427d Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 12:48:25 +0100
+Subject: [PATCH 3/4] fio.c: Unconditionally require wordexp support
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ fio.c | 67 +++++--------------------------------------------------------------
+ 1 file changed, 5 insertions(+), 62 deletions(-)
+
+diff --git a/fio.c b/fio.c
+index 65e8f10..1529236 100644
+--- a/fio.c
++++ b/fio.c
+@@ -43,12 +43,15 @@ static char sccsid[] = "@(#)fio.c	2.76 (gritter) 9/16/09";
+ #endif /* not lint */
+ 
+ #include "rcv.h"
++
++#ifndef HAVE_WORDEXP
++#error wordexp support is required
++#endif
++
+ #include <sys/stat.h>
+ #include <sys/file.h>
+ #include <sys/wait.h>
+-#ifdef	HAVE_WORDEXP
+ #include <wordexp.h>
+-#endif	/* HAVE_WORDEXP */
+ #include <unistd.h>
+ 
+ #if defined (USE_NSS)
+@@ -481,7 +484,6 @@ next:
+ static char *
+ globname(char *name)
+ {
+-#ifdef	HAVE_WORDEXP
+ 	wordexp_t we;
+ 	char *cp;
+ 	sigset_t nset;
+@@ -527,65 +529,6 @@ globname(char *name)
+ 	}
+ 	wordfree(&we);
+ 	return cp;
+-#else	/* !HAVE_WORDEXP */
+-	char xname[PATHSIZE];
+-	char cmdbuf[PATHSIZE];		/* also used for file names */
+-	int pid, l;
+-	char *cp, *shell;
+-	int pivec[2];
+-	extern int wait_status;
+-	struct stat sbuf;
+-
+-	if (pipe(pivec) < 0) {
+-		perror("pipe");
+-		return name;
+-	}
+-	snprintf(cmdbuf, sizeof cmdbuf, "echo %s", name);
+-	if ((shell = value("SHELL")) == NULL)
+-		shell = SHELL;
+-	pid = start_command(shell, 0, -1, pivec[1], "-c", cmdbuf, NULL);
+-	if (pid < 0) {
+-		close(pivec[0]);
+-		close(pivec[1]);
+-		return NULL;
+-	}
+-	close(pivec[1]);
+-again:
+-	l = read(pivec[0], xname, sizeof xname);
+-	if (l < 0) {
+-		if (errno == EINTR)
+-			goto again;
+-		perror("read");
+-		close(pivec[0]);
+-		return NULL;
+-	}
+-	close(pivec[0]);
+-	if (wait_child(pid) < 0 && WTERMSIG(wait_status) != SIGPIPE) {
+-		fprintf(stderr, catgets(catd, CATSET, 81,
+-				"\"%s\": Expansion failed.\n"), name);
+-		return NULL;
+-	}
+-	if (l == 0) {
+-		fprintf(stderr, catgets(catd, CATSET, 82,
+-					"\"%s\": No match.\n"), name);
+-		return NULL;
+-	}
+-	if (l == sizeof xname) {
+-		fprintf(stderr, catgets(catd, CATSET, 83,
+-				"\"%s\": Expansion buffer overflow.\n"), name);
+-		return NULL;
+-	}
+-	xname[l] = 0;
+-	for (cp = &xname[l-1]; *cp == '\n' && cp > xname; cp--)
+-		;
+-	cp[1] = '\0';
+-	if (strchr(xname, ' ') && stat(xname, &sbuf) < 0) {
+-		fprintf(stderr, catgets(catd, CATSET, 84,
+-				"\"%s\": Ambiguous.\n"), name);
+-		return NULL;
+-	}
+-	return savestr(xname);
+-#endif	/* !HAVE_WORDEXP */
+ }
+ 
+ /*
+-- 
+1.9.3
+
+
diff --git a/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch b/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch
new file mode 100644
index 0000000..f65cfa8
--- /dev/null
+++ b/meta/recipes-extended/mailx/files/0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch
@@ -0,0 +1,30 @@
+From 73fefa0c1ac70043ec84f2d8b8f9f683213f168d Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Mon, 17 Nov 2014 13:11:32 +0100
+Subject: [PATCH 4/4] globname: Invoke wordexp with WRDE_NOCMD (CVE-2004-2771)
+
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+---
+ fio.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/fio.c b/fio.c
+index 1529236..774a204 100644
+--- a/fio.c
++++ b/fio.c
+@@ -497,7 +497,7 @@ globname(char *name)
+ 	sigemptyset(&nset);
+ 	sigaddset(&nset, SIGCHLD);
+ 	sigprocmask(SIG_BLOCK, &nset, NULL);
+-	i = wordexp(name, &we, 0);
++	i = wordexp(name, &we, WRDE_NOCMD);
+ 	sigprocmask(SIG_UNBLOCK, &nset, NULL);
+ 	switch (i) {
+ 	case 0:
+-- 
+1.9.3
+
+
diff --git a/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch b/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch
new file mode 100644
index 0000000..2b59914
--- /dev/null
+++ b/meta/recipes-extended/mailx/files/0015-usr-sbin-sendmail.patch
@@ -0,0 +1,38 @@
+Description: Sendmail is at /usr/sbin/sendmail
+ As per Debian Policy §11.6
+Author: Ryan Kavanagh <rak@debian.org>
+Origin: Debian
+Forwarded: no
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: heirloom-mailx-12.5/Makefile
+===================================================================
+This patch is taken from
+ftp://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-5.debian.tar.xz
+
+Upstream-Status: Inappropriate [upstream is dead]
+
+--- heirloom-mailx-12.5.orig/Makefile	2011-04-26 17:23:22.000000000 -0400
++++ heirloom-mailx-12.5/Makefile	2015-01-27 13:20:04.733542801 -0500
+@@ -13,7 +13,7 @@
+ 
+ MAILRC		= $(SYSCONFDIR)/nail.rc
+ MAILSPOOL	= /var/mail
+-SENDMAIL	= /usr/lib/sendmail
++SENDMAIL	= /usr/sbin/sendmail
+ 
+ DESTDIR		=
+ 
+Index: heirloom-mailx-12.5/mailx.1
+===================================================================
+--- heirloom-mailx-12.5.orig/mailx.1	2015-01-27 13:18:49.000000000 -0500
++++ heirloom-mailx-12.5/mailx.1	2015-01-27 13:20:32.382336867 -0500
+@@ -4922,7 +4922,7 @@
+ which just acts as a proxy.
+ .PP
+ \fIMailx\fR immediately contacts the SMTP server (or
+-.IR \%/usr/lib/sendmail )
++.IR \%/usr/sbin/sendmail )
+ even when operating in
+ .I disconnected
+ mode.
diff --git a/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch b/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch
new file mode 100644
index 0000000..b74fd04
--- /dev/null
+++ b/meta/recipes-extended/mailx/files/explicitly.disable.krb5.support.patch
@@ -0,0 +1,46 @@
+krb5 support is autodetected from sysroot making builds undeterministic
+feel free to improve this to support explicitly enabling/disabling it
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- a/makeconfig	2013-07-21 15:06:11.177792334 +0200
++++ b/makeconfig	2013-07-21 15:07:20.028793994 +0200
+@@ -424,36 +424,6 @@
+ }
+ !
+ 
+-<$tmp2.c link_check gssapi 'for GSSAPI in libgss' \
+-		'#define USE_GSSAPI' '-lgss' ||
+-	<$tmp2.c link_check gssapi 'for GSSAPI in libgssapi_krb5' \
+-			'#define USE_GSSAPI' '-lgssapi_krb5' ||
+-		link_check gssapi 'for GSSAPI in libgssapi_krb5, old-style' \
+-				'#define USE_GSSAPI
+-#define GSSAPI_OLD_STYLE' '-lgssapi_krb5' <<\! || \
+-			link_check gssapi 'for GSSAPI in libgssapi' \
+-				'#define USE_GSSAPI
+-#define	GSSAPI_REG_INCLUDE' '-lgssapi' <<\%
+-#include <gssapi/gssapi.h>
+-#include <gssapi/gssapi_generic.h>
+-
+-int main(void)
+-{
+-	gss_import_name(0, 0, gss_nt_service_name, 0);
+-	gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
+-	return 0;
+-}
+-!
+-#include <gssapi.h>
+-
+-int main(void)
+-{
+-	gss_import_name(0, 0, GSS_C_NT_HOSTBASED_SERVICE, 0);
+-	gss_init_sec_context(0,0,0,0,0,0,0,0,0,0,0,0,0);
+-	return 0;
+-}
+-%
+-
+ cat >$tmp2.c <<\!
+ #include "config.h"
+ #ifdef HAVE_NL_LANGINFO
diff --git a/meta/recipes-extended/mailx/mailx_12.5-5.bb b/meta/recipes-extended/mailx/mailx_12.5-5.bb
new file mode 100644
index 0000000..ffa9049
--- /dev/null
+++ b/meta/recipes-extended/mailx/mailx_12.5-5.bb
@@ -0,0 +1,43 @@
+SUMMARY = "mailx is the traditional command-line-mode mail user agent"
+
+DESCRIPTION = "Mailx is derived from Berkeley Mail and is intended provide the \
+functionality of the POSIX mailx command with additional support \
+for MIME, IMAP, POP3, SMTP, and S/MIME."
+
+HOMEPAGE = "http://heirloom.sourceforge.net/mailx.html"
+SECTION = "console/network"
+LICENSE = "BSD & MPL-1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4202a0a62910cf94f7af8a3436a2a2dd"
+
+DEPENDS = "openssl"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/h/heirloom-mailx/heirloom-mailx_12.5.orig.tar.gz;name=archive \
+           file://0001-Don-t-reuse-weak-symbol-optopt-to-fix-FTBFS-on-mips.patch \
+           file://0002-Patched-out-SSL2-support-since-it-is-no-longer-suppo.patch \
+           file://0003-Fixed-Lintian-warning-warning-macro-N-not-defined.patch \
+           file://0011-outof-Introduce-expandaddr-flag.patch \
+           file://0012-unpack-Disable-option-processing-for-email-addresses.patch \
+           file://0013-fio.c-Unconditionally-require-wordexp-support.patch \
+           file://0014-globname-Invoke-wordexp-with-WRDE_NOCMD.patch \
+           file://0015-usr-sbin-sendmail.patch \
+           file://explicitly.disable.krb5.support.patch \
+          "
+
+SRC_URI[archive.md5sum] = "29a6033ef1412824d02eb9d9213cb1f2"
+SRC_URI[archive.sha256sum] = "015ba4209135867f37a0245d22235a392b8bbed956913286b887c2e2a9a421ad"
+
+S = "${WORKDIR}/heirloom-mailx-12.5"
+
+inherit autotools-brokensep
+
+CFLAGS_append = " -D_BSD_SOURCE -DDEBIAN -I${S}/EXT"
+
+# "STRIP=true" means that 'true' command will be used to 'strip' files which will achieve the effect of not stripping them
+# mailx's Makefile doesn't allow a more straightforward way to avoid stripping
+EXTRA_OEMAKE = "SENDMAIL=${sbindir}/sendmail IPv6=-DHAVE_IPv6_FUNCS PREFIX=/usr UCBINSTALL=/usr/bin/install STRIP=true"
+
+# The makeconfig can't run parallelly, otherwise the checking results
+# might be incorrect and lead to errors:
+# fio.c:56:17: fatal error: ssl.h: No such file or directory
+# #include <ssl.h>
+PARALLEL_MAKE = ""
diff --git a/meta/recipes-extended/man-pages/man-pages_4.02.bb b/meta/recipes-extended/man-pages/man-pages_4.02.bb
new file mode 100644
index 0000000..1b90a44
--- /dev/null
+++ b/meta/recipes-extended/man-pages/man-pages_4.02.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Linux man-pages"
+DESCRIPTION = "The Linux man-pages project documents the Linux kernel and C library interfaces that are employed by user programs"
+SECTION = "console/utils"
+HOMEPAGE = "http://www.kernel.org/pub/linux/docs/man-pages"
+LICENSE = "GPLv2+"
+
+LIC_FILES_CHKSUM = "file://README;md5=8f2a3d43057d458e5066714980567a60"
+SRC_URI = "${KERNELORG_MIRROR}/linux/docs/${BPN}/Archive/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "93df3279798a3345bb2c709584c83639"
+SRC_URI[sha256sum] = "42324f9ed47c89a43cb37b6bb0d5fbcad44838eee45cd394e181c98d038c49ff"
+
+RDEPENDS_${PN} = "man"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+        oe_runmake install DESTDIR=${D}
+}
+
+# Only deliveres man-pages so FILES_${PN} gets everything
+FILES_${PN}-doc = ""
+FILES_${PN} = "${mandir}/*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE_${PN} = "passwd.5 getspnam.3"
+ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
+ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
diff --git a/meta/recipes-extended/man/man/configure_sed.patch b/meta/recipes-extended/man/man/configure_sed.patch
new file mode 100644
index 0000000..d49e683
--- /dev/null
+++ b/meta/recipes-extended/man/man/configure_sed.patch
@@ -0,0 +1,32 @@
+man: replace ',' with '#'
+
+Sometimes, the parameters of CC/BUILD_CC contains the ',', which
+cause the sed command failed, so replace the ',' with '#'
+
+Upstream-Status: Pending
+
+Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ configure | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 9f62cf9..9a565ae 100755
+--- a/configure
++++ b/configure
+@@ -1321,9 +1321,9 @@ do
+   echo "Creating $infile from $infile.in"
+   sed -e '
+ s,@version@,$version,
+-s,@CC@,$CC,
++s#@CC@#$CC#
+ s,@EXEEXT@,$EXEEXT,
+-s,@BUILD_CC@,$BUILD_CC,
++s#@BUILD_CC@#$BUILD_CC#
+ s,@INSTALL@,$INSTALL,
+ s,@DEFS@,$DEFS,
+ s,@LIBS@,$LIBS,
+-- 
+1.9.1
+
diff --git a/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch b/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch
new file mode 100644
index 0000000..6f834bd
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5g-nonrootbuild.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -u -r man-1.5g.old/configure man-1.5g/configure
+--- man-1.5g.old/configure	Wed Apr  7 04:16:05 1999
++++ man-1.5g/configure	Mon May 15 15:22:44 2000
+@@ -791,7 +791,7 @@
+     read mode
+     if test "$mode" != ""; then man_mode=$mode; fi
+   fi
+-  man_install_flags="-m $man_mode -o $man_user -g $man_group"
++  man_install_flags=""
+ fi
+ 
+ # What sections do we anticipate?
diff --git a/meta/recipes-extended/man/man/man-1.5h1-gencat.patch b/meta/recipes-extended/man/man/man-1.5h1-gencat.patch
new file mode 100644
index 0000000..044b14c
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5h1-gencat.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- gencat/genlib.c	2006-08-02 20:11:44.000000000 +0200
++++ gencat/genlib.c.oden	2008-12-21 19:18:50.000000000 +0100
+@@ -47,6 +47,7 @@ up-to-date.  Many thanks.
+ 01/14/91   4 nazgul	Off by one on number specified entries
+ */
+ 
++#undef _GNU_SOURCE
+ #include <stdio.h>
+ #include <stdlib.h>
+ #ifdef SYSV
diff --git a/meta/recipes-extended/man/man/man-1.5h1-make.patch b/meta/recipes-extended/man/man/man-1.5h1-make.patch
new file mode 100644
index 0000000..8631eb2
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5h1-make.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5g/man/Makefile.in.mike	Fri Apr  9 13:35:54 1999
++++ man-1.5g/man/Makefile.in	Fri Apr  9 13:36:45 1999
+@@ -1,8 +1,8 @@
+ # only executed from a subdir
+ MAN1 = man whatis apropos
+-MAN5 = man.conf
++MAN5 = man.config
+ MAN8 = makewhatis
+-ALL = man.1 whatis.1 apropos.1 man.conf.5
++ALL = man.1 whatis.1 apropos.1 man.config.5
+ MAYBE8 = makewhatis
+ 
+ .SUFFIXES: .man .1 .5 .8
diff --git a/meta/recipes-extended/man/man/man-1.5i2-initial.patch b/meta/recipes-extended/man/man/man-1.5i2-initial.patch
new file mode 100644
index 0000000..fe56c07
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5i2-initial.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5i2/src/makewhatis.sh.initial	Tue Jul  3 15:38:39 2001
++++ man-1.5i2/src/makewhatis.sh	Tue Jul  3 15:39:39 2001
+@@ -81,8 +81,10 @@
+ 	continue;;
+     -s) setsections=1
+ 	continue;;
+-    -u) findarg="-newer /var/cache/man/whatis"
+-	update=1
++    -u) if [ -e /var/cache/man/whatis ]; then
++	  findarg="-newer /var/cache/man/whatis"
++	  update=1
++	fi
+ 	continue;;
+     -v) verbose=1
+ 	continue;;
diff --git a/meta/recipes-extended/man/man/man-1.5i2-newline.patch b/meta/recipes-extended/man/man/man-1.5i2-newline.patch
new file mode 100644
index 0000000..611df5d
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5i2-newline.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- src/man.c	2008-12-21 19:17:31.000000000 +0100
++++ src/man.c.oden	2008-12-21 19:17:38.000000000 +0100
+@@ -391,7 +391,7 @@ again:
+ 	  beg++;
+ 
+      end = beg;
+-     while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0')
++     while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\0' && (end-buf)<BUFSIZE)
+ 	  end++;		/* note that buf is NUL-terminated */
+      *end = '\0';
+ 
diff --git a/meta/recipes-extended/man/man/man-1.5i2-overflow.patch b/meta/recipes-extended/man/man/man-1.5i2-overflow.patch
new file mode 100644
index 0000000..52d2881
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5i2-overflow.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5i2/src/man.c.overflow	Mon Jun 25 00:01:45 2001
++++ man-1.5i2/src/man.c	Mon Jun 25 00:01:45 2001
+@@ -381,6 +381,9 @@
+ 	  strcat(name, "/");
+ 	  strcat(name, beg);
+      }
++     /* If this is too long, bad things have already happened. *
++      * we should quit IMMEDIATELY.                            */
++     if(strlen(name)>sizeof(ultname)) _exit(1);
+ 
+      goto again;
+ }
diff --git a/meta/recipes-extended/man/man/man-1.5j-i18n.patch b/meta/recipes-extended/man/man/man-1.5j-i18n.patch
new file mode 100644
index 0000000..2ae09c0
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5j-i18n.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/msgs/inst.sh.i18n	Wed Apr 25 10:40:50 2001
++++ man-1.5j/msgs/inst.sh	Wed Apr 25 10:41:17 2001
+@@ -27,8 +27,7 @@
+ for j in $M; do
+   if [ -f $j ]; then
+     i=`echo $j | sed -e 's/mess.//; s/.cat//'`
+-    dest=`echo $locdir | sed -e "s/%N/man/; s/%L/$i/"`
+-    dest=${PREFIX}$dest
++    dest=${PREFIX}/`echo $locdir | sed -e "s/%N/man/; s/%L/$i/"`
+     echo "mkdir -p `dirname $dest`"
+     mkdir -p `dirname $dest`;
+     echo "install -c -m 644 $j $dest"
diff --git a/meta/recipes-extended/man/man/man-1.5j-nocache.patch b/meta/recipes-extended/man/man/man-1.5j-nocache.patch
new file mode 100644
index 0000000..751dddd
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5j-nocache.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/src/man.conf.in.nocache	Thu Nov 22 15:07:12 2001
++++ man-1.5j/src/man.conf.in	Thu Nov 22 15:07:12 2001
+@@ -81,6 +81,9 @@
+ # 
+ #NOCACHE
+ #
++# NOCACHE keeps man from creating cache pages
++NOCACHE
++#
+ # Useful paths - note that COL should not be defined when
+ # NROFF is defined as "groff -Tascii" or "groff -Tlatin1";
+ # not only is it superfluous, but it actually damages the output.
diff --git a/meta/recipes-extended/man/man/man-1.5j-utf8.patch b/meta/recipes-extended/man/man/man-1.5j-utf8.patch
new file mode 100644
index 0000000..33d3e4c
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5j-utf8.patch
@@ -0,0 +1,61 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/configure.utf8	Thu Nov 22 15:02:35 2001
++++ man-1.5j/configure	Thu Nov 22 15:03:15 2001
+@@ -408,9 +408,9 @@
+   Fgawk=/bin/gawk
+   Fawk=/bin/gawk
+   Fmawk=missing
+-  troff=""
+-  nroff=""
+-  jnroff=""
++  troff=/usr/bin/troff
++  nroff=/usr/bin/nroff
++  jnroff=/usr/bin/nroff
+   eqn=""
+   neqn=""
+   jneqn=""
+@@ -453,6 +453,8 @@
+     done
+   done
+   Fgroff=/usr/bin/groff
++  Fnroff=/usr/bin/nroff
++  Fjnroff=/usr/bin/nroff
+   Fgeqn=/usr/bin/geqn
+   Fgtbl=/usr/bin/gtbl
+   Fcol=/usr/bin/col
+@@ -485,25 +487,25 @@
+   then
+     if test $Fnroff = "missing"
+     then
+-      nroff="nroff -Tlatin1 -mandoc"
++      nroff="nroff -Tutf8 -mandoc"
+     else
+-      nroff="$Fnroff -Tlatin1 -mandoc"
++      nroff="$Fnroff -Tutf8 -mandoc"
+     fi
+     troff="troff -mandoc"
+     echo "Warning: could not find groff"
+   else
+     if test $Fnroff = "missing"
+     then
+-      nroff="$Fgroff -Tlatin1 -mandoc"
++      nroff="$Fgroff -Tutf8 -mandoc"
+     else
+-      nroff="$Fnroff -Tlatin1 -mandoc"
++      nroff="$Fnroff -Tutf8 -mandoc"
+     fi
+     troff="$Fgroff -Tps -mandoc"
+-    jnroff="$Fgroff -Tnippon -mandocj"
++    jnroff="$Fjnroff -Tutf8 -mandocj"
+   fi
+   eqn="$Fgeqn -Tps"
+-  neqn="$Fgeqn -Tlatin1"
+-  jneqn="$Fgeqn -Tnippon"
++  neqn="$Fgeqn -Tutf8"
++  jneqn="$Fgeqn -Tutf8"
+   tbl="$Fgtbl"
+   col="$Fcol"
+   vgrind="$Fvgrind"
diff --git a/meta/recipes-extended/man/man/man-1.5k-confpath.patch b/meta/recipes-extended/man/man/man-1.5k-confpath.patch
new file mode 100644
index 0000000..b5746c2
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5k-confpath.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- configure	2006-05-01 19:56:14.000000000 +0200
++++ configure.oden	2008-12-21 19:16:50.000000000 +0100
+@@ -198,7 +198,7 @@
+     confdir="${confprefix}/share/misc"
+   fi
+ fi
+-conffilename="man.conf"
++conffilename="man.config"
+ 
+ if test "$RANDOM" = "$RANDOM"; then
+   # Plain old Bourne shell.
diff --git a/meta/recipes-extended/man/man/man-1.5k-nonascii.patch b/meta/recipes-extended/man/man/man-1.5k-nonascii.patch
new file mode 100644
index 0000000..d662d9b
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5k-nonascii.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- ./src/apropos.sh.nonascii	2001-11-23 00:30:42.000000000 +0100
++++ ./src/apropos.sh	2002-08-13 15:44:53.000000000 +0200
+@@ -18,9 +18,9 @@
+ 
+ # When man pages in your favorite locale look to grep like binary files
+ # (and you use GNU grep) you may want to add the 'a' option to *grepopt1.
+-aproposgrepopt1='i'
++aproposgrepopt1='ia'
+ aproposgrepopt2=''
+-whatisgrepopt1='iw'
++whatisgrepopt1='iwa'
+ whatisgrepopt2='^'
+ grepopt1=$%apropos_or_whatis%grepopt1
+ grepopt2=$%apropos_or_whatis%grepopt2
diff --git a/meta/recipes-extended/man/man/man-1.5k-sofix.patch b/meta/recipes-extended/man/man/man-1.5k-sofix.patch
new file mode 100644
index 0000000..50b9252
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5k-sofix.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5j/src/man.c.sofix	Thu Nov 22 14:51:44 2001
++++ man-1.5j/src/man.c	Thu Nov 22 14:52:44 2001
+@@ -300,7 +300,7 @@
+ 
+      if (strlen(name0) >= sizeof(ultname))
+ 	     return name0;
+-     strcpy(ultname, name0);
++     strncpy(ultname, name0, BUFSIZE-32);
+      name = ultname;
+ 
+ again:
+@@ -332,7 +332,7 @@
+ 	   * .so files - we could glob for all possible extensions,
+ 	   * for now: only try .gz
+ 	   */
+-	  else if (fp == NULL && get_expander(".gz") &&
++	  if (fp == NULL && get_expander(".gz") &&
+ 		   strlen(name)+strlen(".gz") < BUFSIZE) {
+ 	       strcat(name, ".gz");
+ 	       fp = fopen (name, "r");
diff --git a/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch b/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch
new file mode 100644
index 0000000..0512999
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5m2-bug11621.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- ./configure.ad	2003-12-11 19:17:10.000000000 +0100
++++ ./configure	2003-12-11 19:17:27.000000000 +0100
+@@ -26,7 +26,7 @@
+ # (Indeed, -r may cause the terminal to get into funny states.
+ # Very inconvenient. For viewing pages in strange locales, set LC_*.)
+ #
+-DEFAULTLESSOPT="-is"
++DEFAULTLESSOPT="-isr"
+ #
+ # Note that not creating any cat directories (/var/cache/man or so)
+ # and not making man suid or sgid is recommended.
diff --git a/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch b/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch
new file mode 100644
index 0000000..bc97f56
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5m2-buildroot.patch
@@ -0,0 +1,52 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- ./configure.less	2003-12-11 19:18:15.000000000 +0100
++++ ./configure	2003-12-11 19:20:03.000000000 +0100
+@@ -401,18 +401,13 @@
+ 
+ if test "$ans" = "false"
+ then
+-  for i in more less cmp cat awk gawk mawk
+-  do
+-    eval F$i="missing"
+-    for j in $DEFPATH
+-    do
+-      if test -f $j/$i
+-      then
+-	eval F$i=$j/$i
+-	break
+-      fi
+-    done
+-  done
++  Fmore=/bin/more
++  Fless=/usr/bin/less
++  Fcmp=/usr/bin/cmp
++  Fcat=/bin/cat
++  Fgawk=/bin/gawk
++  Fawk=/bin/gawk
++  Fmawk=missing
+   troff=""
+   nroff=""
+   jnroff=""
+@@ -457,6 +452,19 @@
+       fi
+     done
+   done
++  Fgroff=/usr/bin/groff
++  Fgeqn=/usr/bin/geqn
++  Fgtbl=/usr/bin/gtbl
++  Fcol=/usr/bin/col
++  Fgrefer=/usr/bin/grefer
++  Fgpic=/usr/bin/gpic
++  Fmore=/bin/more
++  Fless=/usr/bin/less
++  Fcmp=/usr/bin/cmp
++  Fcat=/bin/cat
++  Fgawk=/bin/gawk
++
++
+   for i in eqn tbl refer pic
+   do
+     if test `eval echo \\$Fg$i` = "missing"
diff --git a/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch b/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch
new file mode 100644
index 0000000..c85ff1d
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5m2-no-color-for-printing.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5m2/configure.color	2006-09-16 18:27:37.000000000 +0200
++++ man-1.5m2/configure	2006-09-16 18:28:44.000000000 +0200
+@@ -539,6 +539,8 @@
+     troff="$troff -c"
+     nroff="$nroff -c"
+     jnroff="$jnroff -c"
++else
++    troff="$troff -c"
+ fi
+ 
+ if [ x$default = x ]; then
diff --git a/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch b/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch
new file mode 100644
index 0000000..8af78ea
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5m2-sigpipe.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.5m2/src/util.c_sigpipe	2006-12-09 13:43:21.000000000 +0100
++++ man-1.5m2/src/util.c	2006-12-09 13:53:13.000000000 +0100
+@@ -116,11 +116,14 @@
+ static int
+ system1 (const char *command) {
+ 	void (*prev_handler)(int) = signal (SIGINT,catch_int);
++	signal (SIGPIPE,SIG_IGN);
+ 	int ret = system(command);
+ 
+ 	/* child terminated with signal? */
+ 	if (WIFSIGNALED(ret) &&
+-	    (WTERMSIG(ret) == SIGINT || WTERMSIG(ret) == SIGQUIT))
++	    (WTERMSIG(ret) == SIGINT ||
++		 WTERMSIG(ret) == SIGPIPE ||
++		 WTERMSIG(ret) == SIGQUIT))
+ 		exit(1);
+ 
+ 	/* or we caught an interrupt? */
+@@ -128,6 +131,7 @@
+ 		exit(1);
+ 
+ 	signal(SIGINT,prev_handler);
++	signal(SIGPIPE,SIG_DFL);
+ 	return ret;
+ }
+ 
diff --git a/meta/recipes-extended/man/man/man-1.5m2-tv_fhs.patch b/meta/recipes-extended/man/man/man-1.5m2-tv_fhs.patch
new file mode 100644
index 0000000..fe66d759
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.5m2-tv_fhs.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man/Makefile.in	2008-12-21 19:19:33.000000000 +0100
++++ man/Makefile.in.oden	2008-12-21 19:19:39.000000000 +0100
+@@ -34,6 +34,15 @@
+ 	for i in $(MAN8); \
+ 		do if test -f $$i.8; then $(INSTALL) $$i.8 $(mandir)/man8/$$i.@man8ext@; fi; done
+ 
++install-l10n: $(ALL)
++	mkdir -p $(mandir)/$(SLANG)/man1 $(mandir)/$(SLANG)/man5 $(mandir)/$(SLANG)/man8
++	for i in $(MAN1); \
++		do $(INSTALL) $$i.1 $(mandir)/$(SLANG)/man1/$$i.@man1ext@; done
++	for i in $(MAN5); \
++		do $(INSTALL) $$i.5 $(mandir)/$(SLANG)/man5/$$i.@man5ext@; done
++	for i in $(MAN8); \
++		do if test -f $$i.8; then $(INSTALL) $$i.8 $(mandir)/$(SLANG)/man8/$$i.@man8ext@; fi; done
++
+ clean:
+ 	rm -f core *.in *.@man1ext@ *.@man5ext@ *.@man8ext@ *~
+ 
+@@ -49,7 +58,7 @@
+ 	@for i in @languages@; do if test -d $$i; then echo; \
+ 		echo "==== Installing the `cat $$i.txt` man pages. ===="; \
+ 		cd $$i; SLANG=/$$i; if test $$SLANG = /en; then SLANG= ; fi; \
+-		export SLANG; make -f ../Makefile install; cd ..; \
++		export SLANG; make -f ../Makefile install-l10n; cd ..; \
+ 		else echo "==== No $$i man pages found. ===="; fi; done
+ 
+ cleansubdirs:
diff --git a/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch b/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch
new file mode 100644
index 0000000..e321325
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.6e-i18n_whatis.patch
@@ -0,0 +1,145 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -Naur man-1.6e.orig/src/apropos.sh man-1.6e/src/apropos.sh
+--- man-1.6e.orig/src/apropos.sh	2007-05-18 13:49:31.000000000 -0300
++++ man-1.6e/src/apropos.sh	2007-05-18 14:24:33.000000000 -0300
+@@ -60,16 +60,56 @@
+     esac
+ done
+ 
++# list of languages to look for
++LANG_LIST=`echo $LANGUAGE:$LC_ALL:$LC_MESSAGES:$LANG | tr ':' ' '`
++DIR_LIST=""
++for d in /var/cache/man $manpath /usr/lib
++do
++    for l in $LANG_LIST
++    do
++        if [ -d $d/$l ]
++        then
++            # check that the path is not already in the list
++            if ! echo "$DIR_LIST" | grep " $d/$l\b" > /dev/null
++            then
++                DIR_LIST="$DIR_LIST $d/$l"
++            fi
++        fi
++    done
++    DIR_LIST="$DIR_LIST $d"
++    # check that the path is not already in the list
++    if ! echo "$DIR_LIST" | grep " $d\b" > /dev/null
++    then
++        DIR_LIST="$DIR_LIST $d/$l"
++    fi
++done
++
+ while [ "$1" != "" ]
+ do
+     found=0
+-    for d in /var/cache/man $manpath /usr/lib
++    # in order not to display lines in more than one language for
++    # a same man page; we check that a given man page name
++    # hasn't already been displayed
++    BAZ=""
++    for d in $DIR_LIST
+     do
+         if [ -f $d/whatis ]
+         then
+-            if grep -"$grepopt1" "$grepopt2""$1" $d/whatis
++            if FOO=`grep -"$grepopt1" "$grepopt2""$1" $d/whatis`
+             then
+-                found=1
++                # the LC_ALL=C is needed in case the text is
++                # in a different encoding than the locale
++                BAR=`echo -e "$FOO" | LC_ALL=C sed 's/ - .*$//' | tr ' []' '_' | sort -u`
++                for i in $BAR
++                do
++                    if ! echo "$BAZ" | grep "$i" > /dev/null
++                    then
++                        BAZ="$BAZ $i"
++                        i="^`echo $i | sed 's:_\+:\\\(\[_ \]\\\|\\\[\\\|\\\]\\\)\\\+:g'`"
++                        echo -e "$FOO" | grep "$i"
++                        found=1
++                    fi
++                done
+ # Some people are satisfied with a single occurrence
+ # But it is better to give all
+ #               break
+diff -Naur man-1.6e.orig/src/makewhatis.sh man-1.6e/src/makewhatis.sh
+--- man-1.6e.orig/src/makewhatis.sh	2007-05-18 13:49:31.000000000 -0300
++++ man-1.6e/src/makewhatis.sh	2007-05-18 13:50:07.000000000 -0300
+@@ -41,12 +41,32 @@
+ 
+ program=`basename $0`
+ 
++# this allows to define language specific values fro NAME, DESCRIPTION
++# if not defined, using those default values
++if [ -z "$MAN_NAME" ]
++then
++	MAN_NAME="ИМЕ|NOM|JMÉNO|NAVN|ΟΝΟΜΑ|NOMBRE|NIME|IZENA|NIMI|IME|\
++NÉV|NOME|名前|이름|NAAM|NAZWA|NUME|ИМЯ|MENO|НАЗВА|名称|名稱"
++fi
++if [ -z "$MAN_DESCRIPTION" ]
++then
++	MAN_DESCRIPTION="ОПИСАНИЕ|DESCRIPCIÓ|POPIS|BESKRIVELSE|BESCHREIBUNG|\
++ΠΕΡΙΓΡΑΦΗ|DESCRIPCIÓN|KIRJELDUS|AZALPENA|KUVAUS|OPIS|LEÍRÁS|DESCRIZIONE|\
++説明|설명|BESCHRIJVING|DESCRIÇÃO|DESCRIERE|ОПИС|描述"
++fi
++# make them into awk regexp
++MAN_NAME="^(${MAN_NAME})";
++MAN_DESCRIPTION="^(${MAN_DESCRIPTION})";
++
+ # In case both /usr/man and /usr/share/man exist, the former is local
+ # and should be first.
+ # It is a bug to add /var/cache/man to DEFCATPATH.
+ dm=
+ for d in /usr/share/man /usr/man /usr/X11R6/man /usr/local/man
+ do
++    if [ -n "$LANG" -a -d "$d/$LANG" ]; then
++	if [ x$dm = x ]; then dm="$d/$LANG"; else dm=$dm:"$d/$LANG"; fi
++    fi
+     if [ -d $d ]; then
+ 	if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi
+     fi
+@@ -55,6 +75,9 @@
+ dc=
+ for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat /usr/share/man /usr/man
+ do
++    if [ -n "$LANG" -a -d "$d/$LANG" ]; then
++	if [ x$dc = x ]; then dm="$d/$LANG"; else dm=$dc:"$d/$LANG"; fi
++    fi
+     if [ -d $d ]; then
+ 	if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi
+     fi
+@@ -194,7 +217,7 @@
+ 	    section=$i
+ 	    curdir=$mandir/${pages}$i
+ 	    export section verbose curdir
+-	    find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | $AWK '
++	    find $mandir/${pages}$i/. -name '*' $findarg0 $findarg -print | LC_ALL=C $AWK -v MAN_NAME="$MAN_NAME" -v MAN_DESCRIPTION="$MAN_DESCRIPTION" '
+ 
+ 	    function readline() {
+ 	      if (use_zcat || use_bzcat) {
+@@ -261,13 +284,7 @@
+ 		gsub(/.\b/, "");
+ 		if (($1 ~ /^\.[Ss][Hh]/ &&
+ 		  ($2 ~ /[Nn][Aa][Mm][Ee]/ ||
+-		   $2 ~ /^JMÉNO/ || $2 ~ /^NAVN/ || $2 ~ /^NUME/ ||
+-		   $2 ~ /^BEZEICHNUNG/ || $2 ~ /^NOMBRE/ ||
+-		   $2 ~ /^NIMI/ || $2 ~ /^NOM/ || $2 ~ /^IME/ ||
+-		   $2 ~ /^N[ÉE]V/ || $2 ~ /^NAMA/ || $2 ~ /^̾Á°/ ||
+-		   $2 ~ /^̾¾Î/ || $2 ~ /^À̸§/ || $2 ~ /^NAZWA/ ||
+-		   $2 ~ /^îáú÷áîéå/ || $2 ~ /^Ãû³Æ/ || $2 ~ /^¦WºÙ/ ||
+-		   $2 ~ /^NOME/ || $2 ~ /^NAAM/ || $2 ~ /^ÈÌÅ/)) ||
++		   $2 ~ MAN_NAME )) ||
+ 		  (pages == "cat" && $1 ~ /^NAME/)) {
+ 		    if (!insh) {
+ 		      insh = 1;
+@@ -278,6 +295,7 @@
+ 		  if ($1 ~ /^\.[Ss][HhYS]/ ||
+ 		    (pages == "cat" &&
+ 		    ($1 ~ /^S[yYeE]/ || $1 ~ /^DESCRIPTION/ ||
++		     $1 ~ MAN_DESCRIPTION ||
+ 		     $1 ~ /^COMMAND/ || $1 ~ /^OVERVIEW/ ||
+ 		     $1 ~ /^STRUCTURES/ || $1 ~ /^INTRODUCTION/ ||
+ 		     $0 ~ /^[^ ]/))) {
diff --git a/meta/recipes-extended/man/man/man-1.6e-mandirs.patch b/meta/recipes-extended/man/man/man-1.6e-mandirs.patch
new file mode 100644
index 0000000..b240064
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.6e-mandirs.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.6e.orig/src/man.conf.in	2005-08-20 20:26:06.000000000 -0300
++++ man-1.6e/src/man.conf.in	2007-05-18 10:30:29.000000000 -0300
+@@ -36,11 +36,12 @@
+ #
+ # Every automatically generated MANPATH includes these fields
+ #
+-MANPATH	/usr/man
+ MANPATH	/usr/share/man
++MANPATH	/usr/X11R6/man
+ MANPATH	/usr/local/man
+ MANPATH	/usr/local/share/man
+-MANPATH	/usr/X11R6/man
++MANPATH	/usr/kerberos/man
++MANPATH	/usr/man
+ #
+ # Uncomment if you want to include one of these by default
+ #
+@@ -67,6 +68,9 @@
+ MANPATH_MAP	/usr/X11R6/bin		/usr/X11R6/man
+ MANPATH_MAP	/usr/bin/X11		/usr/X11R6/man
+ MANPATH_MAP	/usr/bin/mh		/usr/share/man
++MANPATH_MAP	/usr/kerberos/bin		/usr/kerberos/man
++MANPATH_MAP	/usr/kerberos/sbin		/usr/kerberos/man
++
+ #
+ # NOAUTOPATH keeps man from automatically adding directories that look like
+ # manual page directories to the path.
diff --git a/meta/recipes-extended/man/man/man-1.6e-new_sections.patch b/meta/recipes-extended/man/man/man-1.6e-new_sections.patch
new file mode 100644
index 0000000..fb9773c
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.6e-new_sections.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+--- man-1.6e.orig/configure	2006-05-01 14:56:14.000000000 -0300
++++ man-1.6e/configure	2007-05-18 14:35:43.000000000 -0300
+@@ -960,7 +960,7 @@
+ 
+ # What sections do we anticipate?
+ 
+-tmpsections="1 1p 8 2 3 3p 4 5 6 7 9 0p tcl n l p o"
++tmpsections="1 1p 8 2 3 3p 3pm 4 5 6 7 9 0p tcl n l p o"
+ 
+ if [ x$default = x ]; then
+   echo ""
diff --git a/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch b/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch
new file mode 100644
index 0000000..1d1cb0c
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.6e-ro_usr.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: man-1.6f/src/makewhatis.sh
+===================================================================
+--- man-1.6f.orig/src/makewhatis.sh	2010-12-29 13:42:34.000000000 -0800
++++ man-1.6f/src/makewhatis.sh	2010-12-29 13:42:35.667428347 -0800
+@@ -124,7 +124,7 @@
+ 	continue;;
+     -s) setsections=1
+ 	continue;;
+-    -u) findarg="-ctime 0"
++    -u) findarg="-newer /var/cache/man/whatis"
+ 	update=1
+ 	continue;;
+     -v) verbose=1
+@@ -165,14 +165,7 @@
+ # first truncate all the whatis files that will be created new,
+ # then only update - we might visit the same directory twice
+ if [ x$update = x ]; then
+-   for pages in man cat
+-   do
+-      eval path="\$$pages"path
+-      for mandir in $path
+-      do
+-	 cp /dev/null $mandir/whatis
+-      done
+-   done
++   cp /dev/null /var/cache/man/whatis
+ fi
+ 
+ for pages in man cat
diff --git a/meta/recipes-extended/man/man/man-1.6e-security.patch b/meta/recipes-extended/man/man/man-1.6e-security.patch
new file mode 100644
index 0000000..312a882
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.6e-security.patch
@@ -0,0 +1,62 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -Naur man-1.6e.orig/src/makewhatis.sh man-1.6e/src/makewhatis.sh
+--- man-1.6e.orig/src/makewhatis.sh	2006-07-19 01:58:08.000000000 -0300
++++ man-1.6e/src/makewhatis.sh	2007-05-18 10:18:31.000000000 -0300
+@@ -45,7 +45,7 @@
+ # and should be first.
+ # It is a bug to add /var/cache/man to DEFCATPATH.
+ dm=
+-for d in /usr/man /usr/share/man /usr/X11R6/man /usr/local/man
++for d in /usr/share/man /usr/man /usr/X11R6/man /usr/local/man
+ do
+     if [ -d $d ]; then
+ 	if [ x$dm = x ]; then dm=$d; else dm=$dm:$d; fi
+@@ -53,7 +53,7 @@
+ done
+ DEFMANPATH=$dm
+ dc=
+-for d in /usr/man/preformat /usr/man /usr/share/man/preformat /usr/share/man
++for d in /var/cache/man /usr/share/man/preformat /usr/man/preformat /usr/share/man /usr/man
+ do
+     if [ -d $d ]; then
+ 	if [ x$dc = x ]; then dc=$d; else dc=$dc:$d; fi
+@@ -76,12 +76,12 @@
+ # We try here to be careful (and avoid preconstructed symlinks)
+ # in case makewhatis is run as root, by creating a subdirectory of /tmp.
+ 
+-TMPFILEDIR=/tmp/whatis.tmp.dir.$$
+-rm -rf $TMPFILEDIR
+-if ! mkdir -m 0700 $TMPFILEDIR; then
+-    echo Could not create $TMPFILEDIR
+-    exit 1;
++TMPFILEDIR=`mktemp -d /tmp/makewhatisXXXXXX`
++if [ $? -ne 0 ]; then
++   echo "$0: Can't create temp file, exiting..."
++   exit 1
+ fi
++chmod 0700 $TMPFILEDIR
+ TMPFILE=$TMPFILEDIR/w
+ 
+ # make sure TMPFILEDIR is deleted if program is killed or terminates
+diff -Naur man-1.6e.orig/src/man.c man-1.6e/src/man.c
+--- man-1.6e.orig/src/man.c	2006-05-01 17:34:22.000000000 -0300
++++ man-1.6e/src/man.c	2007-05-18 10:11:33.000000000 -0300
+@@ -1234,7 +1234,6 @@
+ #endif
+ 
+ 
+-#if 0
+      {
+ 	/* There are no known cases of buffer overflow caused by
+ 	   excessively long environment variables. In case you find one,
+@@ -1257,7 +1256,6 @@
+ 	   MAN_ICONV_PATH, MAN_ICONV_OPT, MAN_ICONV_INPUT_CHARSET,
+ 	   MAN_ICONV_OUTPUT_CHARSET, NLSPATH, PATH */
+      }
+-#endif
+ 
+ 
+ #ifndef __FreeBSD__ 
diff --git a/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch b/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch
new file mode 100644
index 0000000..568f742
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.6e-use_i18n_vars_in_a_std_way.patch
@@ -0,0 +1,160 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -Naur man-1.6e.orig/catopen/catopen.c man-1.6e/catopen/catopen.c
+--- man-1.6e.orig/catopen/catopen.c	2005-08-20 20:26:06.000000000 -0300
++++ man-1.6e/catopen/catopen.c	2007-05-18 11:31:05.000000000 -0300
+@@ -9,22 +9,63 @@
+ extern char *index (const char *, int);         /* not always in <string.h> */
+ extern char *my_malloc(int);	/* in util.c */
+ 
++/* if the program has sgid/suid privileges then getenv doesn't return
++ * NLSPATH; so we set here a good default value.
++ */
+ #ifndef DEFAULT_NLSPATH
+ # if __GLIBC__ >= 2
+-#  define DEFAULT_NLSPATH "/usr/share/locale/%L/%N"
++#  define DEFAULT_NLSPATH "/usr/share/locale/%L/%N:/usr/share/locale/%l_%t/%N:/usr/share/locale/%l/%N"
+ # else
+ #  define DEFAULT_NLSPATH "/usr/lib/locale/%N/%L"
+ # endif
+ #endif
+ 
+-static nl_catd my_catopenpath(char *name, char *path);
++static nl_catd my_catopenpath(char *name, char *path, char *lang);
+ 
+ static				/* this source included in gripes.c */
+ nl_catd
+ my_catopen(char *name, int oflag) {
+-  nl_catd fd;
++  nl_catd fd = (nl_catd) -1;
++
++  /* using first the my_catopenpath, which looks with LANGUAGE
++   * and only if it fails ressort to catopen, it gives better i18n
++   */
++  {
++    char *nlspath, *lang, *s;
+ 
+-  fd = catopen(name, oflag);
++    /*
++     * "If NLSPATH does not exist in the environment, or if a
++     * message catalog cannot be opened in any of the paths specified
++     * by NLSPATH, then an implementation defined default path is used"
++     */
++    nlspath = getenv("NLSPATH");
++    if (!nlspath)
++      nlspath = DEFAULT_NLSPATH;
++ 
++    lang = getenv("LANGUAGE");
++    if (!lang)
++      lang = getenv("LC_ALL");
++    if (!lang)
++      lang = getenv("LC_MESSAGES");
++    if (!lang)
++      lang = getenv("LANG");
++    if (!lang)
++      lang = "";
++ 
++    while(*lang && (fd == (nl_catd) -1)) {
++      s = index(lang, ':');
++      if (s) *s = 0;
++        fd = my_catopenpath(name, nlspath, lang);
++      if (s) lang=s+1;
++      else lang = "";
++    }
++    if (fd == (nl_catd) -1)
++      fd = my_catopenpath(name, nlspath, "en");
++  }
++
++  /* still not found, use the system catopen */
++  if (fd == (nl_catd) -1)
++    fd = catopen(name, oflag);
+ 
+   if (fd == (nl_catd) -1 && oflag) {
+     oflag = 0;
+@@ -32,8 +73,6 @@
+   }
+ 
+   if (fd == (nl_catd) -1) {
+-    char *nlspath;
+-
+     /* The libc catopen fails - let us see if we can do better */
+     /* The quotes below are from X/Open, XPG 1987, Vol. 3. */
+ 
+@@ -58,17 +97,6 @@
+ #endif
+     }
+ 
+-    /*
+-     * "If NLSPATH does not exist in the environment, or if a
+-     * message catalog cannot be opened in any of the paths specified
+-     * by NLSPATH, then an implementation defined default path is used"
+-     */
+-
+-    nlspath = getenv("NLSPATH");
+-    if (nlspath)
+-      fd = my_catopenpath(name, nlspath);
+-    if (fd == (nl_catd) -1)
+-      fd = my_catopenpath(name, DEFAULT_NLSPATH);
+   }
+   return fd;
+ }
+@@ -90,15 +118,13 @@
+  *
+  */
+ static nl_catd
+-my_catopenpath(char *name, char *nlspath) {
+-  int fd;
++my_catopenpath(char *name, char *nlspath, char *lang) {
+   nl_catd cfd = (nl_catd) -1;
+-  char *path0, *path, *s, *file, *lang, *lang_l, *lang_t, *lang_c;
++  char *path0, *path, *s, *file, *lang_l, *lang_t, *lang_c;
+   int langsz, namesz, sz, lang_l_sz, lang_t_sz, lang_c_sz;
+ 
+   namesz = strlen(name);
+ 
+-  lang = getenv("LANG");
+   if (!lang)
+     lang = "";
+   langsz = strlen(lang);
+@@ -194,14 +220,9 @@
+       path = s+1;
+     } else
+       path = 0;
+-    fd = open(file, O_RDONLY);
+-    if (fd != -1) {
+-      /* we found the right catalog - but we don't know the
+-	 type of nl_catd, so close it again and ask libc */
+-      close(fd);
+-      cfd = catopen(file, 0);
+-      break;
+-    }
++	cfd = catopen(file, 0);
++	if (cfd != (nl_catd) -1)
++			break;
+   }
+ 
+   free(path0);
+diff -Naur man-1.6e.orig/src/manpath.c man-1.6e/src/manpath.c
+--- man-1.6e.orig/src/manpath.c	2006-08-03 18:18:33.000000000 -0300
++++ man-1.6e/src/manpath.c	2007-05-18 11:02:48.000000000 -0300
+@@ -282,13 +282,14 @@
+ 		/* We cannot use "lang = setlocale(LC_MESSAGES, NULL)" or so:
+ 		   the return value of setlocale is an opaque string. */
+ 		/* POSIX prescribes the order: LC_ALL, LC_MESSAGES, LANG */
+-		if((lang = getenv("LC_ALL")) != NULL)
++	        /* LANGUAGE is GNU/Linux and overrules all */
++		if((lang = getenv("LANGUAGE")) != NULL)
+ 			split2(dir, lang, add_to_mandirlist_x, perrs);
+-		if((lang = getenv("LC_MESSAGES")) != NULL)
++		else if((lang = getenv("LC_ALL")) != NULL)
+ 			split2(dir, lang, add_to_mandirlist_x, perrs);
+-		if((lang = getenv("LANG")) != NULL)
++		else if((lang = getenv("LC_MESSAGES")) != NULL)
+ 			split2(dir, lang, add_to_mandirlist_x, perrs);
+-		if((lang = getenv("LANGUAGE")) != NULL)
++		else if((lang = getenv("LANG")) != NULL)
+ 			split2(dir, lang, add_to_mandirlist_x, perrs);
+ 		add_to_mandirlist_x(dir, 0, perrs);
+ 	}
diff --git a/meta/recipes-extended/man/man/man-1.6e-whatis2.patch b/meta/recipes-extended/man/man/man-1.6e-whatis2.patch
new file mode 100644
index 0000000..fc4ed31
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.6e-whatis2.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: man-1.6f/src/makewhatis.sh
+===================================================================
+--- man-1.6f.orig/src/makewhatis.sh	2010-12-29 13:51:45.000000000 -0800
++++ man-1.6f/src/makewhatis.sh	2010-12-29 13:59:35.399799412 -0800
+@@ -164,10 +164,15 @@
+ fi
+ catpath=`echo ${catpath} | tr : ' '`
+ 
++#WHATIS_DIR=$DESTDIR/var/cache/man/`echo $here|sed -e 's!.*/man/!!g'`
++WHATIS_DIR=$DESTDIR/var/cache/man/$LANG
++[[ -d $WHATIS_DIR ]] || mkdir -p $WHATIS_DIR/
++
+ # first truncate all the whatis files that will be created new,
+ # then only update - we might visit the same directory twice
+ if [ x$update = x ]; then
+-   cp /dev/null /var/cache/man/whatis
++   mkdir -p $WHATIS_DIR/
++   /bin/echo -n > $WHATIS_DIR/whatis
+ fi
+ 
+ for pages in man cat
+@@ -180,13 +185,7 @@
+ 	echo "about to enter $mandir" > /dev/stderr
+      fi
+ 
+-     # kludge for Slackware's /usr/man/preformat
+-     if [ $mandir = /usr/man/preformat ]
+-     then
+-	mandir1=/usr/man
+-     else
+-	mandir1=$mandir
+-     fi
++     mandir1=$WHATIS_DIR
+ 
+      # if $mandir is on a readonly partition, and the whatis file
+      # is not a symlink, then let's skip trying to update it
+@@ -207,11 +206,6 @@
+ 	fi
+      fi
+ 
+-     if [ -s ${mandir}/whatis -a $pages = man -a x$update = x ]; then
+-	if [ x$verbose != x ]; then
+-	   echo skipping $mandir - we did it already > /dev/stderr
+-	fi
+-     else      
+        here=`pwd`
+        cd $mandir
+        for i in $sections
+@@ -447,7 +447,6 @@
+
+        chmod 644 ${mandir1}/whatis
+        rm $TMPFILE
+-     fi
+    done
+ done
diff --git a/meta/recipes-extended/man/man/man-1.6g-whatis3.patch b/meta/recipes-extended/man/man/man-1.6g-whatis3.patch
new file mode 100644
index 0000000..6334456
--- /dev/null
+++ b/meta/recipes-extended/man/man/man-1.6g-whatis3.patch
@@ -0,0 +1,20 @@
+Do not use absolute path for awk while getting the path of awk
+when running makewhatis.
+This can avoid errors if path of awk changes.
+
+Upstream-Status: Submitted [man-1.6g]
+
+Signed-off-by: Jian Liu <jian.liu@windriver.com>
+
+diff -Nur man-1.6g.orig/src/makewhatis.sh man-1.6g/src/makewhatis.sh
+--- man-1.6g.orig/src/makewhatis.sh	2015-02-25 16:13:12.657611419 +0800
++++ man-1.6g/src/makewhatis.sh	2015-02-25 16:14:49.334694815 +0800
+@@ -67,7 +67,7 @@
+ # but that leads to problems and bugs.
+
+ # AWK=/usr/bin/gawk
+-AWK=@awk@
++AWK=`which awk`
+
+ # Find a place for our temporary files. If security is not a concern, use
+ #	TMPFILE=/tmp/whatis$$; TMPFILEDIR=none
diff --git a/meta/recipes-extended/man/man/man.1.gz b/meta/recipes-extended/man/man/man.1.gz
new file mode 100644
index 0000000..c368045
--- /dev/null
+++ b/meta/recipes-extended/man/man/man.1.gz
Binary files differ
diff --git a/meta/recipes-extended/man/man/man.7.gz b/meta/recipes-extended/man/man/man.7.gz
new file mode 100644
index 0000000..e85af82
--- /dev/null
+++ b/meta/recipes-extended/man/man/man.7.gz
Binary files differ
diff --git a/meta/recipes-extended/man/man/man.conf b/meta/recipes-extended/man/man/man.conf
new file mode 100644
index 0000000..fc10be2
--- /dev/null
+++ b/meta/recipes-extended/man/man/man.conf
@@ -0,0 +1,141 @@
+#
+# Generated automatically from man.conf.in by the
+# configure script.
+#
+# man.conf from man-1.5p
+#
+# For more information about this file, see the man pages man(1)
+# and man.conf(5).
+#
+# This file is read by man to configure the default manpath (also used
+# when MANPATH contains an empty substring), to find out where the cat
+# pages corresponding to given man pages should be stored,
+# and to map each PATH element to a manpath element.
+# It may also record the pathname of the man binary. [This is unused.]
+# The format is:
+#
+# MANBIN		pathname
+# MANPATH		manpath_element	[corresponding_catdir]
+# MANPATH_MAP		path_element	manpath_element
+#
+# If no catdir is given, it is assumed to be equal to the mandir
+# (so that this dir has both man1 etc. and cat1 etc. subdirs).
+# This is the traditional Unix setup.
+# Certain versions of the FSSTND recommend putting formatted versions
+# of /usr/.../man/manx/page.x into /var/catman/.../catx/page.x.
+# The keyword FSSTND will cause this behaviour.
+# Certain versions of the FHS recommend putting formatted versions of
+# /usr/.../share/man/[locale/]manx/page.x into
+# /var/cache/man/.../[locale/]catx/page.x.
+# The keyword FHS will cause this behaviour (and overrides FSSTND).
+# Explicitly given catdirs override.
+#
+# FSSTND
+FHS
+#
+# This file is also read by man in order to find how to call nroff, less, etc.,
+# and to determine the correspondence between extensions and decompressors.
+#
+# MANBIN		/usr/local/bin/man
+#
+# Every automatically generated MANPATH includes these fields
+#
+MANPATH	/usr/man
+MANPATH	/usr/share/man
+MANPATH	/usr/local/man
+MANPATH	/usr/local/share/man
+MANPATH	/usr/X11R6/man
+#
+# Uncomment if you want to include one of these by default
+#
+# MANPATH	/opt/*/man
+# MANPATH	/usr/lib/*/man
+# MANPATH	/usr/share/*/man
+# MANPATH	/usr/kerberos/man
+#
+# Set up PATH to MANPATH mapping
+#
+# If people ask for "man foo" and have "/dir/bin/foo" in their PATH
+# and the docs are found in "/dir/man", then no mapping is required.
+#
+# The below mappings are superfluous when the right hand side is
+# in the mandatory manpath already, but will keep man from statting
+# lots of other nearby files and directories.
+#
+MANPATH_MAP	/bin			/usr/share/man
+MANPATH_MAP	/sbin			/usr/share/man
+MANPATH_MAP	/usr/bin		/usr/share/man
+MANPATH_MAP	/usr/sbin		/usr/share/man
+MANPATH_MAP	/usr/local/bin		/usr/local/share/man
+MANPATH_MAP	/usr/local/sbin		/usr/local/share/man
+MANPATH_MAP	/usr/X11R6/bin		/usr/X11R6/man
+MANPATH_MAP	/usr/bin/X11		/usr/X11R6/man
+MANPATH_MAP	/usr/bin/mh		/usr/share/man
+#
+# NOAUTOPATH keeps man from automatically adding directories that look like
+# manual page directories to the path.
+#
+#NOAUTOPATH
+#
+# NOCACHE keeps man from creating cache pages ("cat pages")
+# (generally one enables/disable cat page creation by creating/deleting
+# the directory they would live in - man never does mkdir)
+# 
+#NOCACHE
+#
+# Useful paths - note that COL should not be defined when
+# NROFF is defined as "groff -Tascii" or "groff -Tlatin1";
+# not only is it superfluous, but it actually damages the output.
+# For use with utf-8, NROFF should be "nroff -mandoc" without -T option.
+# (Maybe - but today I need -Tlatin1 to prevent double conversion to utf8.)
+#
+# If you have a new troff (version 1.18.1?) and its colored output
+# causes problems, add the -c option to TROFF, NROFF, JNROFF.
+#
+TROFF		/usr/bin/groff -Tps -mandoc
+NROFF		/usr/bin/nroff -Tlatin1 -mandoc
+JNROFF		/usr/bin/groff -Tnippon -mandocj
+EQN		/usr/bin/eqn -Tps
+NEQN		/usr/bin/eqn -Tlatin1
+JNEQN		/usr/bin/eqn -Tnippon
+TBL		/usr/bin/tbl
+# COL		/usr/bin/col
+REFER		/usr/bin/refer
+PIC		/usr/bin/pic
+VGRIND		
+GRAP		
+PAGER		/usr/bin/less -isR
+CAT		/bin/cat
+#
+# The command "man -a xyzzy" will show all man pages for xyzzy.
+# When CMP is defined man will try to avoid showing the same
+# text twice. (But compressed pages compare unequal.)
+#
+CMP		/usr/bin/cmp -s
+#
+# Compress cat pages
+#
+COMPRESS	/bin/bzip2
+COMPRESS_EXT	.bz2
+#
+# Default manual sections (and order) to search if -S is not specified
+# and the MANSECT environment variable is not set.
+#
+MANSECT		1:1p:8:2:3:3p:4:5:6:7:9:0p:tcl:n:l:p:o
+#
+# Default options to use when man is invoked without options
+# This is mainly for the benefit of those that think -a should be the default
+# Note that some systems have /usr/man/allman, causing pages to be shown twice.
+#
+#MANDEFOPTIONS	-a
+#
+# Decompress with given decompressor when input file has given extension
+# The command given must act as a filter.
+#
+.gz		/bin/gunzip -c
+.bz2		/usr/bin/bunzip2 -c
+.xz		/usr/bin/unxz -c
+.z		
+.Z		/bin/zcat
+.F		
+.Y		
diff --git a/meta/recipes-extended/man/man/manpath.5.gz b/meta/recipes-extended/man/man/manpath.5.gz
new file mode 100644
index 0000000..c012ff8
--- /dev/null
+++ b/meta/recipes-extended/man/man/manpath.5.gz
Binary files differ
diff --git a/meta/recipes-extended/man/man_1.6g.bb b/meta/recipes-extended/man/man_1.6g.bb
new file mode 100644
index 0000000..fa4736b
--- /dev/null
+++ b/meta/recipes-extended/man/man_1.6g.bb
@@ -0,0 +1,84 @@
+SUMMARY = "Online documentation tools"
+DESCRIPTION = "A set of documentation tools: man, apropos and whatis"
+SECTION = "console/utils"
+HOMEPAGE = "http://primates.ximian.com/~flucifredi/man"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+PR = "r1"
+
+DEPENDS = "groff less"
+
+def compress_pkg(d):
+    if "compress_doc" in (d.getVar("INHERIT", True) or "").split():
+         compress = d.getVar("DOC_COMPRESS", True)
+         if compress == "gz":
+             return "gzip"
+         elif compress == "bz2":
+             return "bzip2"
+         elif compress == "xz":
+             return "xz"
+    return ""
+
+RDEPENDS_${PN} += "${@compress_pkg(d)}"
+
+SRC_URI = "http://pkgs.fedoraproject.org/lookaside/pkgs/man2html/${BP}.tar.gz/ba154d5796928b841c9c69f0ae376660/${BP}.tar.gz \
+           file://man-1.5k-confpath.patch;striplevel=0 \
+           file://man-1.5h1-make.patch \
+           file://man-1.5k-nonascii.patch \
+           file://man-1.6e-security.patch \
+           file://man-1.6e-mandirs.patch \
+           file://man-1.5m2-bug11621.patch \
+           file://man-1.5k-sofix.patch \
+           file://man-1.5m2-buildroot.patch \
+           file://man-1.6e-ro_usr.patch \
+           file://man-1.5i2-newline.patch;striplevel=0 \
+           file://man-1.5j-utf8.patch \
+           file://man-1.5i2-overflow.patch \
+           file://man-1.5j-nocache.patch \
+           file://man-1.5i2-initial.patch \
+           file://man-1.5h1-gencat.patch;striplevel=0 \
+           file://man-1.5g-nonrootbuild.patch \
+           file://man-1.5m2-tv_fhs.patch;striplevel=0 \
+           file://man-1.5j-i18n.patch \
+           file://man-1.6e-whatis2.patch \
+           file://man-1.6e-use_i18n_vars_in_a_std_way.patch \
+           file://man-1.5m2-no-color-for-printing.patch \
+           file://man-1.5m2-sigpipe.patch \
+           file://man-1.6e-i18n_whatis.patch \
+           file://man-1.6e-new_sections.patch \
+           file://man.1.gz;unpack=false \
+           file://man.7.gz;unpack=false \
+           file://man.conf \
+           file://manpath.5.gz;unpack=false \
+           file://man-1.6g-whatis3.patch \
+           file://configure_sed.patch \
+"
+
+SRC_URI[md5sum] = "ba154d5796928b841c9c69f0ae376660"
+SRC_URI[sha256sum] = "ccdcb8c3f4e0080923d7e818f0e4a202db26c46415eaef361387c20995b8959f"
+
+CFLAGS += "-DSYSV"
+
+do_configure () {
+        ${S}/configure -default -confdir /etc +sgid +fhs +lang all
+}
+
+
+do_install() {
+        oe_runmake install DESTDIR=${D}
+}
+
+do_install_append(){
+	mkdir -p  ${D}${sysconfdir}
+        mkdir -p ${D}${datadir}/man/man5
+        mkdir -p ${D}${datadir}/man/man7
+	cp ${WORKDIR}/man.conf ${D}${sysconfdir}/man.config
+        cp ${WORKDIR}/man.1.gz ${D}${datadir}/man/man1/
+        cp ${WORKDIR}/man.7.gz ${D}${datadir}/man/man7/
+        cp ${WORKDIR}/manpath.5.gz ${D}${datadir}/man/man5/
+}
+
+
+RDEPENDS_${PN} = "less groff"
+FILES_${PN} += "${datadir}/locale ${sysconfdir}/man.config"
diff --git a/meta/recipes-extended/mc/mc/mc-CTRL.patch b/meta/recipes-extended/mc/mc/mc-CTRL.patch
new file mode 100644
index 0000000..ee4ba9f
--- /dev/null
+++ b/meta/recipes-extended/mc/mc/mc-CTRL.patch
@@ -0,0 +1,31 @@
+Fix build with musl by ensuring CTRL is defined.
+
+musl does not define CTRL in <termios.h>, we could include <sys/ttydefaults.h>
+explicitly but it's easier just to ensure CTRL is defined.
+
+This patch is taken from Sabotage Linux, the license statement for patches and
+build scripts in Sabotage Linux says:
+
+    To the extent possible under law, Christian Neukirchen has waived
+    all copyright and related or neighboring rights to this work.
+
+    http://creativecommons.org/publicdomain/zero/1.0/
+
+Therefore this should be good to include in OpenEmbedded.
+
+Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
+
+Upstream-Status: Accepted (should be included in v4.8.14)
+
+diff -u mc-4.8.1.7.org/lib/tty/tty-ncurses.c mc-4.8.1.7/lib/tty/tty-ncurses.c
+--- mc-4.8.1.7.org/lib/tty/tty-ncurses.c
++++ mc-4.8.1.7/lib/tty/tty-ncurses.c
+@@ -65,7 +65,7 @@
+ 
+ /*** file scope macro definitions ****************************************************************/
+ 
+-#if defined(_AIX) && !defined(CTRL)
++#if !defined(CTRL)
+ #define CTRL(x) ((x) & 0x1f)
+ #endif
+ 
diff --git a/meta/recipes-extended/mc/mc_4.7.5.2.bb b/meta/recipes-extended/mc/mc_4.7.5.2.bb
new file mode 100644
index 0000000..b47eb02
--- /dev/null
+++ b/meta/recipes-extended/mc/mc_4.7.5.2.bb
@@ -0,0 +1,49 @@
+SUMMARY = "Midnight Commander is an ncurses based file manager"
+HOMEPAGE = "http://www.midnight-commander.org/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+SECTION = "console/utils"
+DEPENDS = "ncurses glib-2.0"
+RDEPENDS_${PN} = "ncurses-terminfo"
+
+PR = "r3"
+
+SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
+           file://mc-CTRL.patch \
+           "
+
+SRC_URI[md5sum] = "bdae966244496cd4f6d282d80c9cf3c6"
+SRC_URI[sha256sum] = "a68338862bb30017eb65ed569a58e80ab66ae8cef11c886440c9e9f4d1efc6ab"
+
+inherit autotools gettext pkgconfig
+
+EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x --without-samba"
+
+FILES_${PN}-dbg += "${libexecdir}/mc/.debug/"
+
+do_install_append () {
+	sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
+	sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
+}
+
+PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers-python ${BPN}-helpers ${BPN}-fish"
+
+SUMMARY_${BPN}-helpers-perl = "Midnight Commander Perl-based helper scripts"
+FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs.d/apt+ \
+                             ${libexecdir}/mc/extfs.d/deb ${libexecdir}/mc/extfs.d/deba \
+                             ${libexecdir}/mc/extfs.d/debd ${libexecdir}/mc/extfs.d/dpkg+ \
+                             ${libexecdir}/mc/extfs.d/mailfs ${libexecdir}/mc/extfs.d/patchfs \ 
+                             ${libexecdir}/mc/extfs.d/rpms+ ${libexecdir}/mc/extfs.d/ulib \ 
+                             ${libexecdir}/mc/extfs.d/uzip"
+RDEPENDS_${BPN}-helpers-perl = "perl"
+
+SUMMARY_${BPN}-helpers-python = "Midnight Commander Python-based helper scripts"
+FILES_${BPN}-helpers-python = "${libexecdir}/mc/extfs.d/s3+ ${libexecdir}/mc/extfs.d/uc1541"
+RDEPENDS_${BPN}-helpers-python = "python"
+
+SUMMARY_${BPN}-helpers = "Midnight Commander shell helper scripts"
+FILES_${BPN}-helpers = "${libexecdir}/mc/extfs.d/* ${libexecdir}/mc/ext.d/*"
+
+SUMMARY_${BPN}-fish = "Midnight Commander Fish scripts"
+FILES_${BPN}-fish = "${libexecdir}/mc/fish"
+
diff --git a/meta/recipes-extended/mc/mc_4.8.14.bb b/meta/recipes-extended/mc/mc_4.8.14.bb
new file mode 100644
index 0000000..3b6c2ff
--- /dev/null
+++ b/meta/recipes-extended/mc/mc_4.8.14.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Midnight Commander is an ncurses based file manager"
+HOMEPAGE = "http://www.midnight-commander.org/"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=270bbafe360e73f9840bd7981621f9c2"
+SECTION = "console/utils"
+DEPENDS = "ncurses glib-2.0 util-linux"
+RDEPENDS_${PN} = "ncurses-terminfo"
+
+SRC_URI = "http://www.midnight-commander.org/downloads/${BPN}-${PV}.tar.bz2 \
+           "
+
+SRC_URI[md5sum] = "fe1cb75643c2bd4df64bbcf2dab76905"
+SRC_URI[sha256sum] = "61fd0fd2280c3d09d7e0aec8ab001fc89dad8e4fd9941f386414667b55152ec5"
+
+inherit autotools gettext pkgconfig
+
+#
+# Both Samba (smb) and sftp require package delivered from meta-openembedded
+#
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[smb] = "--enable-vfs-smb,--disable-vfs-smb,samba,"
+PACKAGECONFIG[sftp] = "--enable-vfs-sftp,--disable-vfs-sftp,libssh2,"
+
+EXTRA_OECONF = "--with-screen=ncurses --without-gpm-mouse --without-x"
+
+FILES_${PN}-dbg += "${libexecdir}/mc/.debug/"
+
+do_install_append () {
+	sed -i -e '1s,#!.*perl,#!${bindir}/env perl,' ${D}${libexecdir}/mc/extfs.d/*
+	sed -i -e '1s,#!.*python,#!${bindir}/env python,' ${D}${libexecdir}/mc/extfs.d/*
+}
+
+PACKAGES =+ "${BPN}-helpers-perl ${BPN}-helpers-python ${BPN}-helpers ${BPN}-fish"
+
+SUMMARY_${BPN}-helpers-perl = "Midnight Commander Perl-based helper scripts"
+FILES_${BPN}-helpers-perl = "${libexecdir}/mc/extfs.d/a+ ${libexecdir}/mc/extfs.d/apt+ \
+                             ${libexecdir}/mc/extfs.d/deb ${libexecdir}/mc/extfs.d/deba \
+                             ${libexecdir}/mc/extfs.d/debd ${libexecdir}/mc/extfs.d/dpkg+ \
+                             ${libexecdir}/mc/extfs.d/mailfs ${libexecdir}/mc/extfs.d/patchfs \ 
+                             ${libexecdir}/mc/extfs.d/rpms+ ${libexecdir}/mc/extfs.d/ulib \ 
+                             ${libexecdir}/mc/extfs.d/uzip"
+RDEPENDS_${BPN}-helpers-perl = "perl"
+
+SUMMARY_${BPN}-helpers-python = "Midnight Commander Python-based helper scripts"
+FILES_${BPN}-helpers-python = "${libexecdir}/mc/extfs.d/s3+ ${libexecdir}/mc/extfs.d/uc1541"
+RDEPENDS_${BPN}-helpers-python = "python"
+
+SUMMARY_${BPN}-helpers = "Midnight Commander shell helper scripts"
+FILES_${BPN}-helpers = "${libexecdir}/mc/extfs.d/* ${libexecdir}/mc/ext.d/*"
+
+SUMMARY_${BPN}-fish = "Midnight Commander Fish scripts"
+FILES_${BPN}-fish = "${libexecdir}/mc/fish"
diff --git a/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch b/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch
new file mode 100644
index 0000000..df70b1c
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/0001-Fix-typo-in-comparision.patch
@@ -0,0 +1,86 @@
+From 18d360d74271a066a849bc1fba4f10dbb23ed251 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Sep 2015 08:17:42 +0000
+Subject: [PATCH] Fix typo in comparision
+
+error: comparison of array 'devnm' equal to a null pointer is always false
+
+User bitwise '&' operator as it is a mask
+
+Fixes
+error: use of logical '&&' with constant operand
+
+Remove extraneous parens
+
+error: equality comparison with extraneous parentheses
+
+Remove dead code
+
+restripe.c:465:21: error: explicitly assigning value of variable of type 'int' to itself
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ mdmon.h       | 2 +-
+ mdopen.c      | 2 +-
+ restripe.c    | 3 ---
+ super-intel.c | 2 +-
+ 4 files changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/mdmon.h b/mdmon.h
+index aa750c6..0b08c3d 100644
+--- a/mdmon.h
++++ b/mdmon.h
+@@ -101,7 +101,7 @@ static inline int is_resync_complete(struct mdinfo *array)
+ 		break;
+ 	case 10:
+ 		l = array->array.layout;
+-		ncopies = (l & 0xff) * ((l >> 8) && 0xff);
++		ncopies = (l & 0xff) * ((l >> 8) & 0xff);
+ 		sync_size = array->component_size * array->array.raid_disks;
+ 		sync_size /= ncopies;
+ 		break;
+diff --git a/mdopen.c b/mdopen.c
+index 28410f4..c5ee2a6 100644
+--- a/mdopen.c
++++ b/mdopen.c
+@@ -318,7 +318,7 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
+ 	else if (num < 0) {
+ 		/* need to choose a free number. */
+ 		char *_devnm = find_free_devnm(use_mdp);
+-		if (devnm == NULL) {
++		if (_devnm == NULL) {
+ 			pr_err("No avail md devices - aborting\n");
+ 			return -1;
+ 		}
+diff --git a/restripe.c b/restripe.c
+index 4d92190..cfe9666 100644
+--- a/restripe.c
++++ b/restripe.c
+@@ -461,9 +461,6 @@ int raid6_check_disks(int data_disks, int start, int chunk_size,
+ 			curr_broken_disk = diskD;
+ 		}
+ 
+-		if((Px == 0) && (Qx == 0))
+-			curr_broken_disk = curr_broken_disk;
+-
+ 		if(curr_broken_disk >= data_disks + 2)
+ 			broken_status = 2;
+ 
+diff --git a/super-intel.c b/super-intel.c
+index 3f812d6..1838012 100644
+--- a/super-intel.c
++++ b/super-intel.c
+@@ -10027,7 +10027,7 @@ enum imsm_reshape_type imsm_analyze_change(struct supertype *st,
+ 				geo->size = max_size;
+ 		}
+ 
+-		if ((direction == ROLLBACK_METADATA_CHANGES)) {
++		if (direction == ROLLBACK_METADATA_CHANGES) {
+ 			/* accept size for rollback only
+ 			*/
+ 		} else {
+-- 
+2.5.1
+
diff --git a/meta/recipes-extended/mdadm/files/gcc-4.9.patch b/meta/recipes-extended/mdadm/files/gcc-4.9.patch
new file mode 100644
index 0000000..54bf1d7
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/gcc-4.9.patch
@@ -0,0 +1,22 @@
+super-intel.c:5063:2: error: right-hand operand of comma expression has no effect [-Werror=unused-value]
+  snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
+  ^
+cc1: all warnings being treated as errors
+make: *** [super-intel.o] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: mdadm-3.3/super-intel.c
+===================================================================
+--- mdadm-3.3.orig/super-intel.c	2014-05-02 15:08:21.154319651 -0700
++++ mdadm-3.3/super-intel.c	2014-05-02 15:09:31.470985794 -0700
+@@ -5060,7 +5060,7 @@
+ 	spare->cache_size = mpb->cache_size,
+ 	spare->pwr_cycle_count = __cpu_to_le32(1),
+ 
+-	snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
++	(void)snprintf((char *) spare->sig, MAX_SIGNATURE_LENGTH,
+ 		 MPB_SIGNATURE MPB_VERSION_RAID0);
+ 
+ 	for (d = super->disks; d; d = d->next) {
diff --git a/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch b/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch
new file mode 100644
index 0000000..3b3db0a
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/mdadm-3.2.2_fix_for_x32.patch
@@ -0,0 +1,23 @@
+Upstream-Status: pending
+
+By hardcoding CC's definition in the Makefile, all the gcc parameters 
+set by tune settings are lost. Causing compile failure with x32 toolchain
+
+As the bitbake defined CC is good, there is no need to redfine CC in the 
+make file, hence making the CC definition in the Makefile conditional.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/07
+
+Index: mdadm-3.3/Makefile
+===================================================================
+--- mdadm-3.3.orig/Makefile	2013-09-03 07:47:47.000000000 +0300
++++ mdadm-3.3/Makefile	2013-10-16 16:44:23.542295487 +0300
+@@ -41,7 +41,7 @@
+ 
+ KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
+ 
+-CC = $(CROSS_COMPILE)gcc
++CC ?= $(CROSS_COMPILE)gcc
+ CXFLAGS ?= -ggdb
+ CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
+ ifdef WARN_UNUSED
diff --git a/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch b/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
new file mode 100644
index 0000000..c656d07
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/mdadm-3.3.2_x32_abi_time_t.patch
@@ -0,0 +1,25 @@
+When try to print time_t values as a long int it causes an error because time_t
+data type in x32 ABI is long long int.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+Index: mdadm-3.3.4/monitor.c
+===================================================================
+--- mdadm-3.3.4.orig/monitor.c
++++ mdadm-3.3.4/monitor.c
+@@ -257,9 +257,12 @@ static int read_and_act(struct active_ar
+ 			mdi->curr_state = read_dev_state(mdi->state_fd);
+ 		}
+ 	}
+-
+ 	gettimeofday(&tv, NULL);
++#if defined(__x86_64__) && defined(__ILP32__)
++	dprintf("(%d): %lld.%06lld state:%s prev:%s action:%s prev: %s start:%llu\n",
++#else
+ 	dprintf("(%d): %ld.%06ld state:%s prev:%s action:%s prev: %s start:%llu\n",
++#endif
+ 		a->info.container_member,
+ 		tv.tv_sec, tv.tv_usec,
+ 		array_states[a->curr_state],
diff --git a/meta/recipes-extended/mdadm/files/run-ptest b/meta/recipes-extended/mdadm/files/run-ptest
new file mode 100644
index 0000000..5b27609
--- /dev/null
+++ b/meta/recipes-extended/mdadm/files/run-ptest
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+./test &>./test.log
+if [ $? -eq 0 ]
+then
+	echo "PASS: mdadm"
+	rm test.log
+else
+	echo "FAIL: mdadm"
+fi
diff --git a/meta/recipes-extended/mdadm/mdadm_3.3.4.bb b/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
new file mode 100644
index 0000000..1198167
--- /dev/null
+++ b/meta/recipes-extended/mdadm/mdadm_3.3.4.bb
@@ -0,0 +1,71 @@
+SUMMARY = "Tool for managing software RAID under Linux"
+HOMEPAGE = "http://www.kernel.org/pub/linux/utils/raid/mdadm/"
+
+# Some files are GPLv2+ while others are GPLv2.
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://mdmon.c;beginline=4;endline=18;md5=af7d8444d9c4d3e5c7caac0d9d34039d \
+                    file://mdadm.h;beglinlne=4;endline=22;md5=462bc9936ac0d3da110191a3f9994161"
+
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/raid/mdadm/${BPN}-${PV}.tar.xz \
+           file://mdadm-3.2.2_fix_for_x32.patch \
+           file://gcc-4.9.patch \
+           file://mdadm-3.3.2_x32_abi_time_t.patch \
+           file://0001-Fix-typo-in-comparision.patch \
+           file://run-ptest \
+	  "
+SRC_URI[md5sum] = "7ca8b114710f98f53f20c5787b674a09"
+SRC_URI[sha256sum] = "8ae5f45306b873190e91f410709b00e51997b633c072b33f8efd9f7df022ca68"
+
+CFLAGS += "-fno-strict-aliasing"
+
+inherit autotools-brokensep
+
+EXTRA_OEMAKE = "CHECK_RUN_DIR=0"
+# PPC64 and MIPS64 uses long long for u64 in the kernel, but powerpc's asm/types.h
+# prevents 64-bit userland from seeing this definition, instead defaulting
+# to u64 == long in userspace. Define __SANE_USERSPACE_TYPES__ to get
+# int-ll64.h included
+EXTRA_OEMAKE_append_powerpc64 = ' CFLAGS=-D__SANE_USERSPACE_TYPES__'
+EXTRA_OEMAKE_append_mips64 = ' CFLAGS=-D__SANE_USERSPACE_TYPES__'
+EXTRA_OEMAKE_append_mips64n32 = ' CFLAGS=-D__SANE_USERSPACE_TYPES__'
+
+do_compile() {
+	oe_runmake
+}
+
+do_install() {
+	export STRIP=""
+	autotools_do_install
+}
+
+FILES_${PN} += "${base_libdir}/udev/rules.d/*.rules"
+
+inherit ptest
+
+do_compile_ptest() {
+	oe_runmake test
+}
+
+do_install_ptest() {
+	cp -a ${S}/tests ${D}${PTEST_PATH}/tests
+	cp ${S}/test ${D}${PTEST_PATH}
+	sed -e 's!sleep 0.*!sleep 1!g; s!/var/tmp!/!g' -i ${D}${PTEST_PATH}/test
+	ln -s /sbin/mdadm ${D}${PTEST_PATH}/mdadm
+	for prg in test_stripe swap_super raid6check
+	do
+		install -D -m 755 $prg ${D}${PTEST_PATH}/
+	done
+}
+RDEPENDS_${PN}-ptest += "bash"
+RRECOMMENDS_${PN}-ptest += " \
+    coreutils \
+    util-linux \
+    kernel-module-loop \
+    kernel-module-linear \
+    kernel-module-raid0 \
+    kernel-module-raid1 \
+    kernel-module-raid10 \
+    kernel-module-raid456 \
+"
diff --git a/meta/recipes-extended/mingetty/mingetty_1.08.bb b/meta/recipes-extended/mingetty/mingetty_1.08.bb
new file mode 100644
index 0000000..3c16228
--- /dev/null
+++ b/meta/recipes-extended/mingetty/mingetty_1.08.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Compact getty terminal handler for virtual consoles only"
+SECTION = "console/utils"
+HOMEPAGE = "http://sourceforge.net/projects/mingetty/"
+LICENSE = "GPLv2"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=0c56db0143f4f80c369ee3af7425af6e"
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "2a75ad6487ff271424ffc00a64420990"
+SRC_URI[sha256sum] = "0f55c90ba4faa913d91ef99cbf5cb2eb4dbe2780314c3bb17953f849c8cddd17"
+
+# substitute our CFLAGS for "-O2 -Wall -W -pipe"
+#
+EXTRA_OEMAKE = "CC='${CC}' \
+                CFLAGS='${CFLAGS} -D_GNU_SOURCE'"
+
+do_install(){
+    install -d ${D}${mandir}/man8 ${D}/${base_sbindir}
+    oe_runmake install DESTDIR=${D}
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "getty"
+ALTERNATIVE_LINK_NAME[getty] = "${base_sbindir}/getty"
+ALTERNATIVE_TARGET[getty] = "${base_sbindir}/mingetty"
+ALTERNATIVE_PRIORITY = "10"
diff --git a/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch b/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch
new file mode 100644
index 0000000..fec67fd
--- /dev/null
+++ b/meta/recipes-extended/minicom/minicom/0001-Fix-build-issus-surfaced-due-to-musl.patch
@@ -0,0 +1,47 @@
+From d62a5862e26ed3fc58d789efe9c40ca6c911d36b Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 22:35:31 +0000
+Subject: [PATCH] Fix build issus surfaced due to musl
+
+src/getsdir.h:28:14: error: 'MAXNAMLEN' undeclared here (not in a function)
+   char fname[MAXNAMLEN + 1];  /* filename + terminating null */
+
+src/dial.c:352:22: error: 'KIOCSOUND' undeclared (first use in this function)
+|      ioctl(consolefd, KIOCSOUND, k);
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/dial.c    | 2 +-
+ src/getsdir.c | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/dial.c b/src/dial.c
+index a90c1d2..bf02574 100644
+--- a/src/dial.c
++++ b/src/dial.c
+@@ -39,7 +39,7 @@
+ #include "intl.h"
+ 
+ #ifdef VC_MUSIC
+-#  if defined(__GLIBC__)
++#  if defined(__GLIBC__) || defined(__linux__)
+ #    include <sys/ioctl.h>
+ #    include <sys/kd.h>
+ #    include <sys/time.h>
+diff --git a/src/getsdir.c b/src/getsdir.c
+index 2195b27..b61a361 100644
+--- a/src/getsdir.c
++++ b/src/getsdir.c
+@@ -30,6 +30,7 @@
+ #include <string.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/param.h>
+ #include <errno.h>
+ 
+ #include "getsdir.h"
+-- 
+2.5.1
+
diff --git a/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch b/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch
new file mode 100644
index 0000000..bd8261c
--- /dev/null
+++ b/meta/recipes-extended/minicom/minicom/0001-fix-minicom-h-v-return-value-is-not-0.patch
@@ -0,0 +1,35 @@
+Subject: [PATCH] fix minicom -h/-v return value is not 0
+
+Upstream-Status: Pending
+
+Signed-off-by: Lu Chong <Chong.Lu@windriver.com>
+
+---
+ src/minicom.c |    6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+diff --git a/src/minicom.c b/src/minicom.c
+index e1a557b..730da7c 100644
+--- a/src/minicom.c
++++ b/src/minicom.c
+@@ -1166,15 +1166,13 @@ int main(int argc, char **argv)
+ 	         "modify it under the terms of the GNU General Public License\n"
+                  "as published by the Free Software Foundation; either version\n"
+                  "2 of the License, or (at your option) any later version.\n\n");
+-          exit(1);
+-          break;
++          exit(0);
+         case 's': /* setup mode */
+           dosetup = 1;
+           break;
+         case 'h':
+           helpthem();
+-          exit(1);
+-          break;
++          exit(0);
+         case 'p': /* Pseudo terminal to use. */
+           if (strncmp(optarg, "/dev/", 5) == 0)
+             optarg += 5;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch b/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch
new file mode 100644
index 0000000..f5c0889
--- /dev/null
+++ b/meta/recipes-extended/minicom/minicom/allow.to.disable.lockdev.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- a/configure.in	2013-02-06 18:18:13.000000000 +0100
++++ b/configure.in	2013-07-21 15:31:27.614828894 +0200
+@@ -40,7 +40,13 @@
+ fi
+ 
+ PKG_PROG_PKG_CONFIG
+-if test -n "$PKG_CONFIG"; then
++
++AC_ARG_ENABLE([lockdev],
++        AS_HELP_STRING([--enable-lockdev],
++                       [Enable lockdev support (def: enabled)]),
++        [], [enable_lockdev="yes"])
++
++if test -n "$PKG_CONFIG" && test "x$enable_lockdev" = xyes; then
+ 	PKG_CHECK_MODULES([LOCKDEV], [lockdev], AC_DEFINE([HAVE_LOCKDEV],[1],[Define if you have lockdev]),[:])
+ fi
+ 
diff --git a/meta/recipes-extended/minicom/minicom_2.7.bb b/meta/recipes-extended/minicom/minicom_2.7.bb
new file mode 100644
index 0000000..1575cfb
--- /dev/null
+++ b/meta/recipes-extended/minicom/minicom_2.7.bb
@@ -0,0 +1,26 @@
+SUMMARY = "Text-based modem control and terminal emulation program"
+DESCRIPTION = "Minicom is a text-based modem control and terminal emulation program for Unix-like operating systems"
+SECTION = "console/network"
+DEPENDS = "ncurses virtual/libiconv"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=420477abc567404debca0a2a1cb6b645 \
+                    file://src/minicom.h;beginline=1;endline=12;md5=a58838cb709f0db517f4e42730c49e81"
+
+SRC_URI = "https://alioth.debian.org/frs/download.php/latestfile/3/${BP}.tar.gz \
+           file://allow.to.disable.lockdev.patch \
+           file://0001-fix-minicom-h-v-return-value-is-not-0.patch \
+           file://0001-Fix-build-issus-surfaced-due-to-musl.patch \
+          "
+
+SRC_URI[md5sum] = "7044ca3e291268c33294f171d426dc2d"
+SRC_URI[sha256sum] = "9ac3a663b82f4f5df64114b4792b9926b536c85f59de0f2d2b321c7626a904f4"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lockdev] = "--enable-lockdev,--disable-lockdev,lockdev"
+
+inherit autotools gettext pkgconfig
+
+do_install() {
+	for d in doc extras man lib src; do make -C $d DESTDIR=${D} install; done
+}
+
diff --git a/meta/recipes-extended/mktemp/files/disable-strip.patch b/meta/recipes-extended/mktemp/files/disable-strip.patch
new file mode 100644
index 0000000..e06869e
--- /dev/null
+++ b/meta/recipes-extended/mktemp/files/disable-strip.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [configuration]
+
+diff --git a/Makefile.in b/Makefile.in
+index 37b3cc9..f1026f3 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -95,7 +95,7 @@ install-dirs:
+ 	    $(DESTDIR)$(mandir)/man1
+ 
+ install-binaries: $(PROG)
+-	$(INSTALL) -m 0555 -s $(PROG) $(DESTDIR)$(bindir)/$(PROG)
++	$(INSTALL) -m 0555 $(PROG) $(DESTDIR)$(bindir)/$(PROG)
+ 
+ install-man:
+ 	$(INSTALL) -m 0444 $(srcdir)/mktemp.$(mantype) \
diff --git a/meta/recipes-extended/mktemp/files/fix-parallel-make.patch b/meta/recipes-extended/mktemp/files/fix-parallel-make.patch
new file mode 100644
index 0000000..f3b6dcc
--- /dev/null
+++ b/meta/recipes-extended/mktemp/files/fix-parallel-make.patch
@@ -0,0 +1,24 @@
+This fixes the parallel make install failure
+
+Upstream-Status: Accepted
+http://www.gratisoft.us/bugzilla/show_bug.cgi?id=528
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: mktemp-1.7/Makefile.in
+===================================================================
+--- mktemp-1.7.orig/Makefile.in
++++ mktemp-1.7/Makefile.in
+@@ -94,10 +94,10 @@ install-dirs:
+ 	$(SHELL) $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) \
+ 	    $(DESTDIR)$(mandir)/man1
+ 
+-install-binaries: $(PROG)
++install-binaries: install-dirs $(PROG)
+ 	$(INSTALL) -m 0555 $(PROG) $(DESTDIR)$(bindir)/$(PROG)
+ 
+-install-man:
++install-man: install-dirs
+ 	$(INSTALL) -m 0444 $(srcdir)/mktemp.$(mantype) \
+ 	    $(DESTDIR)$(mandir)/man1/mktemp.1
+ 
diff --git a/meta/recipes-extended/mktemp/mktemp_1.7.bb b/meta/recipes-extended/mktemp/mktemp_1.7.bb
new file mode 100644
index 0000000..fe238ee
--- /dev/null
+++ b/meta/recipes-extended/mktemp/mktemp_1.7.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Enables safe temporary file creation from shell scripts"
+HOMEPAGE = "http://www.mktemp.org/"
+BUGTRACKER = "http://www.mktemp.org/bugs"
+SECTION = "console/utils"
+LICENSE = "ISC"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=430680f6322a1eb87199b5e01a82c0d4"
+
+PR = "r3"
+
+SRC_URI = "ftp://ftp.mktemp.org/pub/mktemp/${BPN}-${PV}.tar.gz \
+        file://disable-strip.patch \
+        file://fix-parallel-make.patch \
+        "
+
+SRC_URI[md5sum] = "787bbed9fa2ee8e7645733c0e8e65172"
+SRC_URI[sha256sum] = "8e94b9e1edf866b2609545da65b627996ac5d158fda071e492bddb2f4a482675"
+
+inherit autotools update-alternatives
+
+EXTRA_OECONF = "--with-libc"
+
+do_install_append () {
+	install -d ${D}${base_bindir}
+	mv ${D}${bindir}/mktemp ${D}${base_bindir}/mktemp
+	rmdir ${D}${bindir}
+}
+
+ALTERNATIVE_${PN} = "mktemp"
+ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp"
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN}-doc = "mktemp.1"
+ALTERNATIVE_PRIORITY_${PN}-doc = "300"
+ALTERNATIVE_LINK_NAME[mktemp.1] = "${mandir}/man1/mktemp.1"
diff --git a/meta/recipes-extended/msmtp/msmtp_1.6.2.bb b/meta/recipes-extended/msmtp/msmtp_1.6.2.bb
new file mode 100644
index 0000000..f9bf563
--- /dev/null
+++ b/meta/recipes-extended/msmtp/msmtp_1.6.2.bb
@@ -0,0 +1,30 @@
+SUMMARY = "msmtp is an SMTP client"
+DESCRIPTION = "A sendmail replacement for use in MTAs like mutt"
+HOMEPAGE = "http://msmtp.sourceforge.net/"
+SECTION = "console/network"
+
+LICENSE = "GPLv3"
+DEPENDS = "zlib gnutls"
+
+#COPYING or Licence
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI = "http://sourceforge.net/projects/msmtp/files/msmtp/${PV}/${BPN}-${PV}.tar.xz \
+          "
+
+SRC_URI[md5sum] = "3baca93c7e5f1aa9d36a2e5b38739ab9"
+SRC_URI[sha256sum] = "2f6ecd7cbfadf548fd55205bd24cb63b84bcbb1185efed917dd7800595a48789"
+
+inherit gettext autotools update-alternatives pkgconfig
+
+EXTRA_OECONF += "--without-libsecret --without-libgsasl --without-libidn"
+
+ALTERNATIVE_${PN} = "sendmail"
+ALTERNATIVE_TARGET[sendmail] = "${bindir}/msmtp"
+ALTERNATIVE_LINK_NAME[sendmail] = "${sbindir}/sendmail"
+ALTERNATIVE_PRIORITY = "100"
+
+pkg_postinst_${PN}_linuxstdbase () {
+	# /usr/lib/sendmial is required by LSB core test
+	[ ! -L $D/usr/lib/sendmail ] && ln -sf ${sbindir}/sendmail $D/usr/lib/
+}
diff --git a/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch b/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
new file mode 100644
index 0000000..06f8142
--- /dev/null
+++ b/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch
@@ -0,0 +1,32 @@
+From 81814dc2b14843009193efd307d814c26baa61f0 Mon Sep 17 00:00:00 2001
+From: Jiri Popelka <jpopelka@redhat.com>
+Date: Wed, 7 Dec 2011 19:14:09 +0100
+Subject: [PATCH] ifconfig interface:0 del <IP> will remove the aliased IP on IA64
+
+Upstream-Status: Backport
+
+commit 81814dc2b14843009193efd307d814c26baa61f0 from
+git://git.code.sf.net/p/net-tools/code
+
+---
+ ifconfig.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/ifconfig.c b/ifconfig.c
+index bc405c6..dae8922 100644
+--- a/ifconfig.c
++++ b/ifconfig.c
+@@ -890,7 +890,9 @@ int main(int argc, char **argv)
+ 		    continue;
+ 		}
+ 		
+-		memcpy(&ip, &sin.sin_addr.s_addr, sizeof(unsigned long));
++		/* Clear "ip" in case sizeof(unsigned long) > sizeof(sin.sin_addr.s_addr) */
++		ip = 0;
++		memcpy(&ip, &sin.sin_addr.s_addr, sizeof(sin.sin_addr.s_addr));
+ 		
+ 		if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) {
+ 		    fprintf(stderr, _("Interface %s not initialized\n"),
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/net-tools/net-tools/net-tools-config.h b/meta/recipes-extended/net-tools/net-tools/net-tools-config.h
new file mode 100644
index 0000000..6d39c2a
--- /dev/null
+++ b/meta/recipes-extended/net-tools/net-tools/net-tools-config.h
@@ -0,0 +1,75 @@
+/*
+* config.h	Automatically generated configuration includefile
+*
+* NET-TOOLS	A collection of programs that form the base set of the
+*		NET-3 Networking Distribution for the LINUX operating
+*		system.
+*
+*		DO  NOT  EDIT  DIRECTLY
+*
+*/
+
+/* 
+ * 
+ * Internationalization
+ * 
+ * The net-tools package has currently been translated to French,
+ * German and Brazilian Portugese.  Other translations are, of
+ * course, welcome.  Answer `n' here if you have no support for
+ * internationalization on your system.
+ * 
+ */
+#define I18N 1
+
+/* 
+ * 
+ * Protocol Families.
+ * 
+ */
+#define HAVE_AFUNIX 1
+#define HAVE_AFINET 1
+#define HAVE_AFINET6 1
+#define HAVE_AFIPX 0
+#define HAVE_AFATALK 0
+#define HAVE_AFAX25 0
+#define HAVE_AFNETROM 1
+#define HAVE_AFROSE 0
+#define HAVE_AFX25 0
+#define HAVE_AFECONET 0
+#define HAVE_AFDECnet 0
+#define HAVE_AFASH 0
+
+/* 
+ * 
+ * Device Hardware types.
+ * 
+ */
+#define HAVE_HWETHER 1
+#define HAVE_HWARC 1
+#define HAVE_HWSLIP 1
+#define HAVE_HWPPP 1
+#define HAVE_HWTUNNEL 1
+#define HAVE_HWSTRIP 0
+#define HAVE_HWTR 0
+#define HAVE_HWAX25 0
+#define HAVE_HWROSE 0
+#define HAVE_HWNETROM 1
+#define HAVE_HWX25 0
+#define HAVE_HWFR 1
+#define HAVE_HWSIT 0
+#define HAVE_HWFDDI 0
+#define HAVE_HWHIPPI 0
+#define HAVE_HWASH 0
+#define HAVE_HWHDLCLAPB 0
+#define HAVE_HWIRDA 1
+#define HAVE_HWEC 0
+#define HAVE_HWIB 0
+
+/* 
+ * 
+ * Other Features.
+ * 
+ */
+#define HAVE_FW_MASQUERADE 1
+#define HAVE_IP_TOOLS 1
+#define HAVE_MII 1
diff --git a/meta/recipes-extended/net-tools/net-tools/net-tools-config.make b/meta/recipes-extended/net-tools/net-tools/net-tools-config.make
new file mode 100644
index 0000000..ec516f2
--- /dev/null
+++ b/meta/recipes-extended/net-tools/net-tools/net-tools-config.make
@@ -0,0 +1,36 @@
+I18N=1
+HAVE_AFUNIX=1
+HAVE_AFINET=1
+HAVE_AFINET6=1
+# HAVE_AFIPX=0
+# HAVE_AFATALK=0
+# HAVE_AFAX25=0
+HAVE_AFNETROM=1
+# HAVE_AFROSE=0
+# HAVE_AFX25=0
+# HAVE_AFECONET=0
+# HAVE_AFDECnet=0
+# HAVE_AFASH=0
+HAVE_HWETHER=1
+HAVE_HWARC=1
+HAVE_HWSLIP=1
+HAVE_HWPPP=1
+HAVE_HWTUNNEL=1
+HAVE_HWSTRIP=1
+HAVE_HWTR=1
+# HAVE_HWAX25=0
+# HAVE_HWROSE=0
+HAVE_HWNETROM=1
+# HAVE_HWX25=0
+HAVE_HWFR=1
+# HAVE_HWSIT=0
+# HAVE_HWFDDI=0
+# HAVE_HWHIPPI=0
+# HAVE_HWASH=0
+# HAVE_HWHDLCLAPB=0
+HAVE_HWIRDA=1
+# HAVE_HWEC=0
+# HAVE_HWIB=0
+HAVE_FW_MASQUERADE=1
+HAVE_IP_TOOLS=1
+HAVE_MII=1
diff --git a/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
new file mode 100644
index 0000000..aefc1e6
--- /dev/null
+++ b/meta/recipes-extended/net-tools/net-tools_1.60-26.bb
@@ -0,0 +1,89 @@
+SUMMARY = "Basic networking tools"
+DESCRIPTION = "A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system"
+HOMEPAGE = "http://net-tools.berlios.de/"
+BUGTRACKER = "http://bugs.debian.org/net-tools"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+                    file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba"
+
+SRC_URI = "http://snapshot.debian.org/archive/debian/20050312T000000Z/pool/main/n/${BPN}/${BPN}_1.60.orig.tar.gz;name=tarball \
+           http://snapshot.debian.org/archive/debian//20150831T093342Z/pool/main/n/${BPN}/${BPN}_${PV}.diff.gz;apply=no;name=patch \
+           file://net-tools-config.h \
+           file://net-tools-config.make \
+           file://ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch \
+	   "
+
+S = "${WORKDIR}/net-tools-1.60"
+
+SRC_URI[tarball.md5sum] = "ecaf37acb5b5daff4bdda77785fd916d"
+SRC_URI[tarball.sha256sum] = "ec67967cf7b1a3a3828a84762fbc013ac50ee5dc9aa3095d5c591f302c2de0f5"
+
+SRC_URI[patch.md5sum] = "ea3592f49ac8380962bc4d9b66c7e7e9"
+SRC_URI[patch.sha256sum] = "aeeeafaff68866a446f01bb639d4e0146a60af34dcd20e31a3e46585022fc76c"
+
+inherit gettext
+
+# The Makefile is lame, no parallel build
+PARALLEL_MAKE = ""
+
+# Unlike other Debian packages, net-tools *.diff.gz contains another series of
+# patches maintained by quilt. So manually apply them before applying other local
+# patches. Also remove all temp files before leaving, because do_patch() will pop 
+# up all previously applied patches in the start
+nettools_do_patch() {
+	cd ${S}
+	quilt pop -a || true
+	if [ -d ${S}/.pc-nettools ]; then
+		rm -rf ${S}/.pc
+		mv ${S}/.pc-nettools ${S}/.pc
+		QUILT_PATCHES=${S}/debian/patches quilt pop -a
+		rm -rf ${S}/.pc ${S}/debian
+	fi
+	patch -p1 < ${WORKDIR}/${BPN}_${PV}.diff	
+	QUILT_PATCHES=${S}/debian/patches quilt push -a
+	mv ${S}/.pc ${S}/.pc-nettools
+}
+
+do_unpack[cleandirs] += "${S}"
+
+# We invoke base do_patch at end, to incorporate any local patch
+python do_patch() {
+    bb.build.exec_func('nettools_do_patch', d)
+    bb.build.exec_func('patch_do_patch', d)
+}
+
+do_configure() {
+	# net-tools has its own config mechanism requiring "make config"
+	# we pre-generate desired options and copy to source directory instead
+	cp ${WORKDIR}/net-tools-config.h    ${S}/config.h
+	cp ${WORKDIR}/net-tools-config.make ${S}/config.make
+}
+
+do_compile() {
+	# net-tools use COPTS/LOPTS to allow adding custom options
+	export COPTS="$CFLAGS"
+	export LOPTS="$LDFLAGS"
+	unset CFLAGS
+	unset LDFLAGS
+
+	oe_runmake
+}
+
+do_install() {
+	oe_runmake 'BASEDIR=${D}' install
+}
+
+inherit update-alternatives
+
+base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach"
+base_bindir_progs  = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname"
+
+ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}"
+python __anonymous() {
+	for prog in d.getVar('base_sbindir_progs', True).split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
+	for prog in d.getVar('base_bindir_progs', True).split():
+		d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+}
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/meta/recipes-extended/newt/files/cross_ar.patch b/meta/recipes-extended/newt/files/cross_ar.patch
new file mode 100644
index 0000000..03007aa
--- /dev/null
+++ b/meta/recipes-extended/newt/files/cross_ar.patch
@@ -0,0 +1,58 @@
+Fix cross link using autoconf detected AR
+
+If building on 32bit host and creating 64bit libraries, the target
+package builds should not invoke the 32bit hosts's ar.  Specifically
+you will get an error message like:
+
+x86_64-linux-gcc    -m64 --sysroot=/opt/qemux86-64/tmp/sysroots/qemux86-64 -g -o test test.o libnewt.a -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -lslang
+libnewt.a: could not read symbols: Archive has no index; run ranlib to add one
+collect2: error: ld returned 1 exit status
+
+Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in  | 3 ++-
+ configure.ac | 4 ++++
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -7,6 +7,7 @@ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+ CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@ 
+ GNU_LD = @GNU_LD@
++AR = @AR@
+ 
+ VERSION = @VERSION@
+ TAG = r$(subst .,-,$(VERSION))
+@@ -109,7 +110,7 @@ whiptcl.$(SOEXT): $(WHIPTCLOBJS) $(LIBNEWTSH)
+ 	$(CC) -shared $(SHCFLAGS) $(LDFLAGS) -o whiptcl.$(SOEXT) $(WHIPTCLOBJS) -L. -lnewt  $(LIBTCL) -lpopt $(LIBS)
+ 
+ $(LIBNEWT): $(LIBOBJS)
+-	ar rv $@ $^
++	$(AR) rv $@ $^
+ 
+ newt.o $(SHAREDDIR)/newt.o: newt.c Makefile
+ 
+diff --git a/configure.ac b/configure.ac
+index 92e6da8..cd83d57 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -15,6 +15,10 @@ AC_PROG_INSTALL
+ AC_PROG_LN_S
+ AC_PROG_GREP
+ AC_SYS_LARGEFILE
++AN_MAKEVAR([AR], [AC_PROG_AR])
++AN_PROGRAM([ar], [AC_PROG_AR])
++AC_DEFUN([AC_PROG_AR], [AC_CHECK_TOOL(AR, ar, :)])
++AC_PROG_AR
+ 
+ # Are we using GNU ld?
+ AC_MSG_CHECKING([for GNU ld])
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch b/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch
new file mode 100644
index 0000000..b0a1e8c
--- /dev/null
+++ b/meta/recipes-extended/newt/files/fix_SHAREDDIR.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Pending
+
+Author: dexuan.cui@intel.com
+Date: Fri Apr 15 16:17:39 CST 2011
+
+The patch fixes a parallel-make issue: when generating $(SHAREDDIR)/%.o, we should
+ensure the directory ${SHAREDDIR} exists.
+
+We need to push the patch to upstream.
+
+Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -128,12 +128,12 @@ $(SHAREDDIR):
+ 
+ sharedlib: $(LIBNEWTSH)
+ 
+-$(LIBNEWTSH): $(SHAREDDIR) $(SHAREDOBJS)
++$(LIBNEWTSH): $(SHAREDOBJS)
+ 	$(CC) -shared -o $(LIBNEWTSH) $(SHLIBFLAGS) $(SHAREDOBJS) $(LDFLAGS) $(LIBS)
+ 	ln -fs $(LIBNEWTSONAME) libnewt.$(SOEXT)
+ 	ln -fs $(LIBNEWTSH) $(LIBNEWTSONAME)
+ 
+-$(SHAREDDIR)/%.o : %.c
++$(SHAREDDIR)/%.o : %.c $(SHAREDDIR)
+ 	$(CC) $(SHCFLAGS) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
+ 
+ install: $(LIBNEWT) install-sh whiptail
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-extended/newt/files/remove_slang_include.patch b/meta/recipes-extended/newt/files/remove_slang_include.patch
new file mode 100644
index 0000000..a2634ec
--- /dev/null
+++ b/meta/recipes-extended/newt/files/remove_slang_include.patch
@@ -0,0 +1,16 @@
+
+Upstream-Status: Pending
+
+Index: git/Makefile.in
+===================================================================
+--- git.orig/Makefile.in
++++ git/Makefile.in
+@@ -5,7 +5,7 @@ CC = @CC@
+ CPP = @CPP@
+ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+-CPPFLAGS = -D_GNU_SOURCE -I/usr/include/slang @CPPFLAGS@ 
++CPPFLAGS = -D_GNU_SOURCE @CPPFLAGS@ 
+ GNU_LD = @GNU_LD@
+ 
+ VERSION = @VERSION@
diff --git a/meta/recipes-extended/newt/libnewt-python_0.52.18.bb b/meta/recipes-extended/newt/libnewt-python_0.52.18.bb
new file mode 100644
index 0000000..94a41a3
--- /dev/null
+++ b/meta/recipes-extended/newt/libnewt-python_0.52.18.bb
@@ -0,0 +1,29 @@
+require recipes-extended/newt/libnewt_${PV}.bb
+
+SUMMARY .= " - python"
+DEPENDS = "libnewt python"
+RDEPENDS_${PN} += "python-core"
+
+inherit pythonnative python-dir
+
+EXTRA_OECONF += "--with-python"
+EXTRA_OEMAKE += "PYTHONVERS=${PYTHON_DIR}"
+
+
+do_compile () {
+	VERSION="$(sed -n 's/^VERSION = //p' Makefile)"
+	oe_runmake _snack.so
+}
+
+do_install () {
+	install -d ${D}${PYTHON_SITEPACKAGES_DIR}
+	install -m 0755 ${PYTHON_DIR}/_snack.so ${D}${PYTHON_SITEPACKAGES_DIR}/
+	install -m 0644 snack.py ${D}${PYTHON_SITEPACKAGES_DIR}/
+}
+
+PACKAGES_remove = "whiptail"
+
+FILES_${PN} = "${PYTHON_SITEPACKAGES_DIR}/*"
+FILES_${PN}-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/newt/libnewt_0.52.18.bb b/meta/recipes-extended/newt/libnewt_0.52.18.bb
new file mode 100644
index 0000000..302e418
--- /dev/null
+++ b/meta/recipes-extended/newt/libnewt_0.52.18.bb
@@ -0,0 +1,56 @@
+SUMMARY = "A library for text mode user interfaces"
+
+DESCRIPTION = "Newt is a programming library for color text mode, widget based user \
+interfaces.  Newt can be used to add stacked windows, entry widgets, \
+checkboxes, radio buttons, labels, plain text fields, scrollbars, \
+etc., to text mode user interfaces.  This package also contains the \
+shared library needed by programs built with newt, as well as a \
+/usr/bin/dialog replacement called whiptail.  Newt is based on the \
+slang library."
+
+HOMEPAGE = "https://fedorahosted.org/newt/"
+SECTION = "libs"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+# slang needs to be >= 2.2
+DEPENDS = "slang popt"
+
+SRC_URI = "https://fedorahosted.org/releases/n/e/newt/newt-${PV}.tar.gz \
+           file://remove_slang_include.patch \
+           file://fix_SHAREDDIR.patch \
+           file://cross_ar.patch \
+"
+
+SRC_URI[md5sum] = "685721bee1a318570704b19dcf31d268"
+SRC_URI[sha256sum] = "771b0e634ede56ae6a6acd910728bb5832ac13ddb0d1d27919d2498dab70c91e"
+
+S = "${WORKDIR}/newt-${PV}"
+
+EXTRA_OECONF = "--without-tcl --without-python"
+
+inherit autotools-brokensep
+
+CLEANBROKEN = "1"
+
+export STAGING_INCDIR
+export STAGING_LIBDIR
+
+export BUILD_SYS
+export HOST_SYS
+
+PACKAGES_prepend = "whiptail "
+
+do_configure_prepend() {
+    sh autogen.sh
+}
+
+do_compile_prepend() {
+    # Make sure the recompile is OK
+    rm -f ${B}/.depend
+}
+
+FILES_whiptail = "${bindir}/whiptail"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb b/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
new file mode 100644
index 0000000..1d7e608
--- /dev/null
+++ b/meta/recipes-extended/packagegroups/packagegroup-core-full-cmdline.bb
@@ -0,0 +1,162 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Standard full-featured Linux system"
+DESCRIPTION = "Package group bringing in packages needed for a more traditional full-featured Linux system"
+PR = "r6"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+PACKAGES = "\
+    packagegroup-core-full-cmdline \
+    packagegroup-core-full-cmdline-libs \
+    packagegroup-core-full-cmdline-utils \
+    packagegroup-core-full-cmdline-extended \
+    packagegroup-core-full-cmdline-dev-utils \
+    packagegroup-core-full-cmdline-multiuser \
+    packagegroup-core-full-cmdline-initscripts \
+    packagegroup-core-full-cmdline-sys-services \
+    "
+
+python __anonymous () {
+    # For backwards compatibility after rename
+    namemap = {}
+    namemap["packagegroup-core-full-cmdline"] = "packagegroup-core-basic"
+    namemap["packagegroup-core-full-cmdline-libs"] = "packagegroup-core-basic-libs"
+    namemap["packagegroup-core-full-cmdline-utils"] = "packagegroup-core-basic-utils"
+    namemap["packagegroup-core-full-cmdline-extended"] = "packagegroup-core-basic-extended"
+    namemap["packagegroup-core-full-cmdline-dev-utils"] = "packagegroup-core-dev-utils"
+    namemap["packagegroup-core-full-cmdline-multiuser"] = "packagegroup-core-multiuser"
+    namemap["packagegroup-core-full-cmdline-initscripts"] = "packagegroup-core-initscripts"
+    namemap["packagegroup-core-full-cmdline-sys-services"] = "packagegroup-core-sys-services"
+
+    packages = d.getVar("PACKAGES", True).split()
+    for pkg in packages:
+        if pkg.endswith('-dev'):
+            mapped = namemap.get(pkg[:-4], None)
+            if mapped:
+                mapped += '-dev'
+        elif pkg.endswith('-dbg'):
+            mapped = namemap.get(pkg[:-4], None)
+            if mapped:
+                mapped += '-dbg'
+        else:
+            mapped = namemap.get(pkg, None)
+
+        if mapped:
+            oldtaskname = mapped.replace("packagegroup-core", "task-core")
+            mapstr = " %s %s" % (mapped, oldtaskname)
+            d.appendVar("RPROVIDES_%s" % pkg, mapstr)
+            d.appendVar("RREPLACES_%s" % pkg, mapstr)
+            d.appendVar("RCONFLICTS_%s" % pkg, mapstr)
+}
+
+
+RDEPENDS_packagegroup-core-full-cmdline = "\
+    packagegroup-core-full-cmdline-libs \
+    packagegroup-core-full-cmdline-utils \
+    packagegroup-core-full-cmdline-extended \
+    packagegroup-core-full-cmdline-dev-utils \
+    packagegroup-core-full-cmdline-multiuser \
+    packagegroup-core-full-cmdline-initscripts \
+    packagegroup-core-full-cmdline-sys-services \
+    "
+
+RDEPENDS_packagegroup-core-full-cmdline-libs = "\
+    glib-2.0 \
+    "
+
+RDEPENDS_packagegroup-core-full-cmdline-utils = "\
+    bash \
+    acl \
+    attr \
+    bc \
+    coreutils \
+    cpio \
+    e2fsprogs \
+    ed \
+    file \
+    findutils \
+    gawk \
+    gmp \
+    grep \
+    makedevs \
+    mc \
+    mc-fish \
+    mc-helpers \
+    mc-helpers-perl \
+    mc-helpers-python \
+    mktemp \
+    ncurses \
+    net-tools \
+    pax \
+    popt \
+    procps \
+    psmisc \
+    sed \
+    tar \
+    time \
+    util-linux \
+    zlib \
+    "
+
+RDEPENDS_packagegroup-core-full-cmdline-extended = "\
+    iproute2 \
+    iputils \
+    iptables \
+    module-init-tools \
+    openssl \
+    "
+
+RDEPENDS_packagegroup-core-full-cmdline-dev-utils = "\
+    byacc \
+    diffutils \
+    m4 \
+    make \
+    patch \
+    "
+
+VIRTUAL-RUNTIME_initscripts ?= "initscripts"
+VIRTUAL-RUNTIME_init_manager ?= "sysvinit"
+VIRTUAL-RUNTIME_login_manager ?= "busybox"
+VIRTUAL-RUNTIME_syslog ?= "sysklogd"
+RDEPENDS_packagegroup-core-full-cmdline-initscripts = "\
+    ${VIRTUAL-RUNTIME_initscripts} \
+    ${VIRTUAL-RUNTIME_init_manager} \
+    ethtool \
+    ${VIRTUAL-RUNTIME_login_manager} \
+    ${VIRTUAL-RUNTIME_syslog} \
+    "
+
+RDEPENDS_packagegroup-core-full-cmdline-multiuser = "\
+    cracklib \
+    gzip \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libuser', '', d)} \
+    shadow \
+    sudo \
+    "
+
+RDEPENDS_packagegroup-core-full-cmdline-sys-services = "\
+    at \
+    bzip2 \
+    cronie \
+    dbus \
+    dbus-glib \
+    python-dbus \
+    elfutils \
+    gzip \
+    less \
+    libcap \
+    libevent \
+    logrotate \
+    nfs-utils \
+    pciutils \
+    libpcre \
+    rpcbind \
+    sysfsutils \
+    tcp-wrappers \
+    tzdata \
+    "
+
diff --git a/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
new file mode 100644
index 0000000..ce82385
--- /dev/null
+++ b/meta/recipes-extended/packagegroups/packagegroup-core-lsb.bb
@@ -0,0 +1,278 @@
+#
+# Copyright (C) 2010 Intel Corporation
+#
+
+SUMMARY = "Linux Standard Base (LSB)"
+DESCRIPTION = "Packages required to satisfy the Linux Standard Base (LSB) specification"
+PR = "r10"
+LICENSE = "MIT"
+
+inherit packagegroup distro_features_check
+
+# The libxt, libxtst and others require x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+#
+# We will skip parsing this packagegeoup for non-glibc systems
+#
+python __anonymous () {
+    if d.getVar('TCLIBC', True) != "glibc":
+        raise bb.parse.SkipPackage("incompatible with %s C library" %
+                                   d.getVar('TCLIBC', True))
+}
+
+PACKAGES = "\
+    packagegroup-core-lsb \
+    packagegroup-core-sys-extended \
+    packagegroup-core-db \
+    packagegroup-core-perl \
+    packagegroup-core-python \
+    packagegroup-core-tcl \
+    packagegroup-core-lsb-misc \
+    packagegroup-core-lsb-core \
+    packagegroup-core-lsb-perl \
+    packagegroup-core-lsb-python \
+    packagegroup-core-lsb-desktop \
+    packagegroup-core-lsb-runtime-add \
+    "
+
+
+RDEPENDS_packagegroup-core-lsb = "\
+    packagegroup-core-sys-extended \
+    packagegroup-core-db \
+    packagegroup-core-perl \
+    packagegroup-core-python \
+    packagegroup-core-tcl \
+    packagegroup-core-lsb-misc \
+    packagegroup-core-lsb-core \
+    packagegroup-core-lsb-perl \
+    packagegroup-core-lsb-python \
+    packagegroup-core-lsb-desktop \
+    packagegroup-core-lsb-runtime-add \
+    "
+
+
+RDEPENDS_packagegroup-core-sys-extended = "\
+    curl \
+    dhcp-client \
+    hdparm \
+    lighttpd \
+    libaio \
+    lrzsz \
+    lzo \
+    mc \
+    mc-fish \
+    mc-helpers \
+    mc-helpers-perl \
+    mc-helpers-python \
+    mdadm \
+    minicom \
+    neon \
+    parted \
+    ${PTH} \
+    quota \
+    screen \
+    setserial \
+    sysstat \
+    udev-extraconf \
+    unzip \
+    watchdog \
+    wget \
+    which \
+    xinetd \
+    zip \
+    "
+
+RDEPENDS_packagegroup-core-db = "\
+    db \
+    sqlite3 \
+    "
+
+RDEPENDS_packagegroup-core-perl = "\
+    gdbm \
+    perl \
+    zlib \
+    "
+
+
+RDEPENDS_packagegroup-core-python = "\
+    expat \
+    gdbm \
+    gmp \
+    ncurses \
+    openssl \
+    python \
+    readline \
+    zip \
+    "
+
+RDEPENDS_packagegroup-core-tcl = "\
+    tcl \
+    "
+
+# Miscellaneous packages required by LSB (or LSB tests)
+RDEPENDS_packagegroup-core-lsb-misc = "\
+    chkconfig \
+    gettext \
+    gettext-runtime \
+    groff \
+    lsbinitscripts \
+    lsbtest \
+    lsof \
+    strace \
+    libusb1 \
+    usbutils \
+    rpm \
+    "
+
+SUMMARY_packagegroup-core-lsb-core = "LSB Core"
+DESCRIPTION_packagegroup-core-lsb-core = "Packages required to support commands/libraries \
+    specified in the LSB Core specification"
+RDEPENDS_packagegroup-core-lsb-core = "\
+    at \
+    bash \
+    bc \
+    binutils \
+    binutils-symlinks \
+    coreutils \
+    cpio \
+    cronie \
+    cups \
+    diffutils \
+    ed \
+    glibc-utils \
+    elfutils \
+    file \
+    findutils \
+    fontconfig-utils \
+    foomatic-filters \
+    gawk \
+    ghostscript \
+    grep \
+    gzip \
+    localedef \
+    lsb \
+    m4 \
+    mailx \
+    make \
+    man \
+    man-pages \
+    mktemp \
+    msmtp \
+    patch \
+    pax \
+    procps \
+    psmisc \
+    sed \
+    shadow \
+    tar \
+    time \
+    util-linux \
+    xdg-utils \
+    \
+    glibc \
+    libgcc \
+    libpam \
+    libxml2 \
+    ncurses \
+    zlib \
+    nspr \
+    libpng12 \
+    nss \
+"
+
+SUMMARY_packagegroup-core-lsb-perl = "LSB Runtime Languages (Perl)"
+DESCRIPTION_packagegroup-core-lsb-perl = "Packages required to support libraries \
+    specified in the LSB Runtime languages specification (Perl parts)"
+RDEPENDS_packagegroup-core-lsb-perl = "\
+    perl \
+    perl-modules \
+    perl-misc \
+    perl-pod \
+    perl-dev \
+    perl-doc \
+"
+
+SUMMARY_packagegroup-core-lsb-python = "LSB Runtime Languages (Python)"
+DESCRIPTION_packagegroup-core-lsb-python = "Packages required to support libraries \
+    specified in the LSB Runtime languages specification (Python parts)"
+RDEPENDS_packagegroup-core-lsb-python = "\
+    python \
+    python-modules \
+    python-misc \
+"
+
+def get_libqt3(d):
+    if 'linuxstdbase' in d.getVar('DISTROOVERRIDES', False) or "":
+        if 'qt3' in d.getVar('BBFILE_COLLECTIONS', False) or "":
+            return 'libqt-mt3'
+
+        bb.warn('The meta-qt3 layer should be added, this layer provides Qt 3.x' \
+                'libraries. Its intended use is for passing LSB tests as Qt3 is' \
+                'a requirement for LSB.')
+    return ''
+
+QT4PKGS = " \
+    libqtcore4 \
+    libqtgui4 \
+    libqtsql4 \
+    libqtsvg4 \
+    libqtxml4 \
+    libqtnetwork4 \
+    qt4-plugin-sqldriver-sqlite \
+    ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "libqtopengl4", "", d)} \
+    "
+QT4PKGS_mips64 = ""
+QT4PKGS_mips64n32 = ""
+
+SUMMARY_packagegroup-core-lsb-desktop = "LSB Desktop"
+DESCRIPTION_packagegroup-core-lsb-desktop = "Packages required to support libraries \
+    specified in the LSB Desktop specification"
+RDEPENDS_packagegroup-core-lsb-desktop = "\
+    libxt \
+    libxxf86vm \
+    libdrm \
+    libglu \
+    libxi \
+    libxtst \
+    libx11-locale \
+    xorg-minimal-fonts \
+    gdk-pixbuf-loader-ico \
+    gdk-pixbuf-loader-bmp \
+    gdk-pixbuf-loader-ani \
+    gdk-pixbuf-xlib \
+    liberation-fonts \
+    gtk+ \
+    atk \
+    libasound \
+    ${QT4PKGS} \
+    ${@get_libqt3(d)} \
+"
+
+RDEPENDS_packagegroup-core-lsb-runtime-add = "\
+    ldd \
+    pam-plugin-wheel \
+    e2fsprogs-mke2fs \
+    mkfontdir \
+    liburi-perl \
+    libxml-parser-perl \
+    libxml-perl \
+    libxml-sax-perl \
+    glibc-localedatas \
+    glibc-gconvs \
+    glibc-charmaps \
+    glibc-binaries \
+    glibc-localedata-posix \
+    glibc-extra-nss \
+    glibc-pcprofile \
+    libclass-isa-perl \
+    libenv-perl \
+    libdumpvalue-perl \
+    libfile-checktree-perl \
+    libi18n-collate-perl \
+    libpod-plainer-perl \
+"
+
+PTH = "pth"
+PTH_libc-uclibc = ""
+
diff --git a/meta/recipes-extended/pam/libpam/99_pam b/meta/recipes-extended/pam/libpam/99_pam
new file mode 100644
index 0000000..97e990d
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/99_pam
@@ -0,0 +1 @@
+d root root 0755 /var/run/sepermit none
diff --git a/meta/recipes-extended/pam/libpam/crypt_configure.patch b/meta/recipes-extended/pam/libpam/crypt_configure.patch
new file mode 100644
index 0000000..bec82a5
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/crypt_configure.patch
@@ -0,0 +1,31 @@
+This patch fixes a case where it find crypt defined in libc (musl) but
+not in specified libraries then it ends up assigning
+
+LIBCRYPT="-l" which then goes into makefile cause all sort of problems
+e.g.
+
+ld: cannot find -l-m32
+| collect2: error: ld returned 1 exit status
+
+The reason is that -l appears on commandline with out any library and
+compiler treats the next argument as library name whatever it is.
+
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: Linux-PAM-1.1.6/configure.in
+===================================================================
+--- Linux-PAM-1.1.6.org/configure.ac
++++ Linux-PAM-1.1.6/configure.ac
+@@ -400,7 +400,9 @@ AS_IF([test "x$ac_cv_header_xcrypt_h" =
+   [crypt_libs="crypt"])
+ 
+ BACKUP_LIBS=$LIBS
+-AC_SEARCH_LIBS([crypt],[$crypt_libs], LIBCRYPT="-l$ac_lib", LIBCRYPT="")
++AC_SEARCH_LIBS([crypt],[$crypt_libs],
++	       [test "$ac_cv_search_crypt" = "none required" ||
++		LIBCRYPT="$ac_cv_search_crypt"])
+ AC_CHECK_FUNCS(crypt_r crypt_gensalt_r)
+ LIBS=$BACKUP_LIBS
+ AC_SUBST(LIBCRYPT)
diff --git a/meta/recipes-extended/pam/libpam/fixsepbuild.patch b/meta/recipes-extended/pam/libpam/fixsepbuild.patch
new file mode 100644
index 0000000..8a9c3b2
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/fixsepbuild.patch
@@ -0,0 +1,24 @@
+Fix the build error when a separate build directory is used:
+
+Making install in xtestsmake[1]: Entering directory `/media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/build/xtests'/usr/bin/install -c -d /media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/image/usr/share/Linux-PAM/xtestsfor file in run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd tst-pam_dispatch5.pamd tst-pam_cracklib1.pamd tst-pam_cracklib2.pamd tst-pam_unix1.pamd tst-pam_unix2.pamd tst-pam_unix3.pamd tst-pam_unix4.pamd tst-pam_unix1.sh tst-pam_unix2.sh tst-pam_unix3.sh tst-pam_unix4.sh access.conf tst-pam_access1.pamd tst-pam_access1.sh tst-pam_access2.pamd tst-pam_access2.sh tst-pam_access3.pamd tst-pam_access3.sh tst-pam_access4.pamd tst-pam_access4.sh limits.conf tst-pam_limits1.pamd tst-pam_limits1.sh tst-pam_succeed_if1.pamd tst-pam_succeed_if1.sh group.conf tst-pam_group1.pamd tst-pam_group1.sh tst-pam_authfail.pamd tst-pam_authsucceed.pamd tst-pam_substack1.pamd tst-pam_substack1a.pamd tst-pam_substack1.sh tst-pam_substack2.pamd tst-pam_substack2a.pamd tst-pam_substack2.sh tst-pam_substack3.pamd tst-pam_substack3a.pamd tst-pam_substack3.sh tst-pam_substack4.pamd tst-pam_substack4a.pamd tst-pam_substack4.sh tst-pam_substack5.pamd tst-pam_substack5a.pamd tst-pam_substack5.sh tst-pam_assemble_line1.pamd tst-pam_assemble_line1.sh tst-pam_pwhistory1.pamd tst-pam_pwhistory1.sh tst-pam_time1.pamd time.conf ; do \/usr/bin/install -c $file /media/build1/poky/build1/tmp/work/i586-poky-linux/libpam/1.1.6-r2/image/usr/share/Linux-PAM/xtests ; \	done
+/usr/bin/install: cannot stat `run-xtests.sh': No such file or directory
+/usr/bin/install: cannot stat `tst-pam_dispatch1.pamd': No such file or directory
+/usr/bin/install: cannot stat `tst-pam_dispatch2.pamd': No such file or directory
+
+Upstream-Status: Pending
+
+RP 2013/03/21
+
+Index: Linux-PAM-1.1.6/xtests/Makefile.am
+===================================================================
+--- Linux-PAM-1.1.6.orig/xtests/Makefile.am	2013-03-08 12:26:30.360266000 +0000
++++ Linux-PAM-1.1.6/xtests/Makefile.am	2013-03-21 11:39:58.557166650 +0000
+@@ -59,7 +59,7 @@
+ install_xtests:
+ 	$(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests
+ 	for file in $(EXTRA_DIST) ; do \
+-		$(INSTALL) $$file $(DESTDIR)$(pkgdatadir)/xtests ; \
++		$(INSTALL) $(srcdir)/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
+ 	done
+ 	for file in $(XTESTS); do \
+ 		$(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
diff --git a/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch b/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch
new file mode 100644
index 0000000..680029a
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/libpam-xtests-remove-bash-dependency.patch
@@ -0,0 +1,226 @@
+From 555407ff6e2f742df64ae93859f14a0fc1397829 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Fri, 12 Sep 2014 05:35:05 -0400
+Subject: [PATCH] libpam/xtests: remove bash dependency
+
+There's not bash specific syntax in the xtest scripts:
+
+  # after below patches applied:
+  $ cd Linux-PAM-1.1.6/xtests
+  $ checkbashisms *.sh
+  No output
+
+Just remove the runtime dependency to bash.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ xtests/run-xtests.sh             |    2 +-
+ xtests/tst-pam_access1.sh        |    2 +-
+ xtests/tst-pam_access2.sh        |    2 +-
+ xtests/tst-pam_access3.sh        |    2 +-
+ xtests/tst-pam_access4.sh        |    2 +-
+ xtests/tst-pam_assemble_line1.sh |    2 +-
+ xtests/tst-pam_group1.sh         |    2 +-
+ xtests/tst-pam_limits1.sh        |    2 +-
+ xtests/tst-pam_pwhistory1.sh     |    2 +-
+ xtests/tst-pam_substack1.sh      |    2 +-
+ xtests/tst-pam_substack2.sh      |    2 +-
+ xtests/tst-pam_substack3.sh      |    2 +-
+ xtests/tst-pam_substack4.sh      |    2 +-
+ xtests/tst-pam_substack5.sh      |    2 +-
+ xtests/tst-pam_succeed_if1.sh    |    2 +-
+ xtests/tst-pam_unix1.sh          |    2 +-
+ xtests/tst-pam_unix2.sh          |    2 +-
+ xtests/tst-pam_unix3.sh          |    2 +-
+ xtests/tst-pam_unix4.sh          |    2 +-
+ 19 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/xtests/run-xtests.sh b/xtests/run-xtests.sh
+index 3a89057..1cf8684 100755
+--- a/xtests/run-xtests.sh
++++ b/xtests/run-xtests.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ SRCDIR=$1
+ shift 1
+diff --git a/xtests/tst-pam_access1.sh b/xtests/tst-pam_access1.sh
+index 180d256..70521d2 100755
+--- a/xtests/tst-pam_access1.sh
++++ b/xtests/tst-pam_access1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ /usr/sbin/groupadd tstpamaccess
+ /usr/sbin/useradd -G tstpamaccess -p '!!' tstpamaccess1
+diff --git a/xtests/tst-pam_access2.sh b/xtests/tst-pam_access2.sh
+index 0a30275..7e3e60f 100755
+--- a/xtests/tst-pam_access2.sh
++++ b/xtests/tst-pam_access2.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ /usr/sbin/groupadd tstpamaccess
+ /usr/sbin/useradd -p '!!' tstpamaccess2
+diff --git a/xtests/tst-pam_access3.sh b/xtests/tst-pam_access3.sh
+index 348e0c3..3630e2e 100755
+--- a/xtests/tst-pam_access3.sh
++++ b/xtests/tst-pam_access3.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ /usr/sbin/useradd -p '!!' tstpamaccess3
+ ./tst-pam_access3
+diff --git a/xtests/tst-pam_access4.sh b/xtests/tst-pam_access4.sh
+index 61e7b44..4538df4 100755
+--- a/xtests/tst-pam_access4.sh
++++ b/xtests/tst-pam_access4.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ /usr/sbin/useradd -p '!!' tstpamaccess4
+ ./tst-pam_access4
+diff --git a/xtests/tst-pam_assemble_line1.sh b/xtests/tst-pam_assemble_line1.sh
+index 248d47e..dc2a675 100755
+--- a/xtests/tst-pam_assemble_line1.sh
++++ b/xtests/tst-pam_assemble_line1.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ exec ./tst-pam_authfail tst-pam_assemble_line1
+diff --git a/xtests/tst-pam_group1.sh b/xtests/tst-pam_group1.sh
+index b76377f..44faca9 100755
+--- a/xtests/tst-pam_group1.sh
++++ b/xtests/tst-pam_group1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ /usr/sbin/groupadd tstpamgrpg
+ /usr/sbin/useradd -p '!!' tstpamgrp
+diff --git a/xtests/tst-pam_limits1.sh b/xtests/tst-pam_limits1.sh
+index 4faa822..32c021d 100755
+--- a/xtests/tst-pam_limits1.sh
++++ b/xtests/tst-pam_limits1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ /usr/sbin/useradd -p '!!' tstpamlimits
+ ./tst-pam_limits1
+diff --git a/xtests/tst-pam_pwhistory1.sh b/xtests/tst-pam_pwhistory1.sh
+index ddb3b8b..0f212e2 100644
+--- a/xtests/tst-pam_pwhistory1.sh
++++ b/xtests/tst-pam_pwhistory1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ /usr/sbin/useradd tstpampwhistory
+ ./tst-pam_pwhistory1
+diff --git a/xtests/tst-pam_substack1.sh b/xtests/tst-pam_substack1.sh
+index 5260175..f1b72a7 100755
+--- a/xtests/tst-pam_substack1.sh
++++ b/xtests/tst-pam_substack1.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ exec ./tst-pam_authfail tst-pam_substack1
+diff --git a/xtests/tst-pam_substack2.sh b/xtests/tst-pam_substack2.sh
+index c02f597..3804fa7 100755
+--- a/xtests/tst-pam_substack2.sh
++++ b/xtests/tst-pam_substack2.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ exec ./tst-pam_authsucceed tst-pam_substack2
+diff --git a/xtests/tst-pam_substack3.sh b/xtests/tst-pam_substack3.sh
+index 0e572aa..aa48e8e 100755
+--- a/xtests/tst-pam_substack3.sh
++++ b/xtests/tst-pam_substack3.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ exec ./tst-pam_authsucceed tst-pam_substack3
+diff --git a/xtests/tst-pam_substack4.sh b/xtests/tst-pam_substack4.sh
+index a3ef08a..958a07a 100755
+--- a/xtests/tst-pam_substack4.sh
++++ b/xtests/tst-pam_substack4.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ exec ./tst-pam_authsucceed tst-pam_substack4
+diff --git a/xtests/tst-pam_substack5.sh b/xtests/tst-pam_substack5.sh
+index e2714fd..7e0da74 100755
+--- a/xtests/tst-pam_substack5.sh
++++ b/xtests/tst-pam_substack5.sh
+@@ -1,3 +1,3 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ exec ./tst-pam_authfail tst-pam_substack5
+diff --git a/xtests/tst-pam_succeed_if1.sh b/xtests/tst-pam_succeed_if1.sh
+index a643b2e..58e57b4 100755
+--- a/xtests/tst-pam_succeed_if1.sh
++++ b/xtests/tst-pam_succeed_if1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ /usr/sbin/useradd -p '!!' tstpamtest
+ /usr/sbin/useradd -p '!!' pamtest
+diff --git a/xtests/tst-pam_unix1.sh b/xtests/tst-pam_unix1.sh
+index f75bd84..72deac0 100755
+--- a/xtests/tst-pam_unix1.sh
++++ b/xtests/tst-pam_unix1.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ /usr/sbin/useradd -p '!!' tstpamunix
+ ./tst-pam_unix1
+diff --git a/xtests/tst-pam_unix2.sh b/xtests/tst-pam_unix2.sh
+index 7093155..c04d6e6 100755
+--- a/xtests/tst-pam_unix2.sh
++++ b/xtests/tst-pam_unix2.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ # pamunix0 = 0aXKZztA.d1KY
+ /usr/sbin/useradd -p 0aXKZztA.d1KY  tstpamunix
+diff --git a/xtests/tst-pam_unix3.sh b/xtests/tst-pam_unix3.sh
+index ef4a07c..b52db2b 100755
+--- a/xtests/tst-pam_unix3.sh
++++ b/xtests/tst-pam_unix3.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ # pamunix01 = 0aXKZztA.d1KYIuFXArmd2jU
+ /usr/sbin/useradd -p 0aXKZztA.d1KYIuFXArmd2jU tstpamunix
+diff --git a/xtests/tst-pam_unix4.sh b/xtests/tst-pam_unix4.sh
+index 787c2f9..e7976fd 100755
+--- a/xtests/tst-pam_unix4.sh
++++ b/xtests/tst-pam_unix4.sh
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!/bin/sh
+ 
+ # pamunix01 = 0aXKZztA.d1KYIuFXArmd2jU
+ /usr/sbin/useradd -p 0aXKZztA.d1KYIuFXArmd2jU tstpamunix
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/pam/libpam/libpam-xtests.patch b/meta/recipes-extended/pam/libpam/libpam-xtests.patch
new file mode 100644
index 0000000..be68745
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/libpam-xtests.patch
@@ -0,0 +1,35 @@
+This patch is used to create a new sub package libpam-xtests to do more checks.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+--- Linux-PAM-1.1.4/xtests/Makefile.am.orig	2011-07-19 17:00:09.619980001 +0800
++++ Linux-PAM-1.1.4/xtests/Makefile.am	2011-07-19 16:54:00.229979998 +0800
+@@ -7,7 +7,7 @@
+ AM_LDFLAGS = -L$(top_builddir)/libpam -lpam \
+ 	-L$(top_builddir)/libpam_misc -lpam_misc
+ 
+-CLEANFILES = *~ $(XTESTS)
++CLEANFILES = *~
+ 
+ EXTRA_DIST = run-xtests.sh tst-pam_dispatch1.pamd tst-pam_dispatch2.pamd \
+ 	tst-pam_dispatch3.pamd tst-pam_dispatch4.pamd \
+@@ -51,3 +51,18 @@
+ 
+ xtests: $(XTESTS) run-xtests.sh
+ 	"$(srcdir)"/run-xtests.sh "$(srcdir)" ${XTESTS} ${NOSRCTESTS}
++
++all: $(XTESTS)
++
++install: install_xtests
++
++install_xtests:
++	$(INSTALL) -d $(DESTDIR)$(pkgdatadir)/xtests
++	for file in $(EXTRA_DIST) ; do \
++		$(INSTALL) $$file $(DESTDIR)$(pkgdatadir)/xtests ; \
++	done
++	for file in $(XTESTS); do \
++		$(INSTALL) .libs/$$file $(DESTDIR)$(pkgdatadir)/xtests ; \
++	done
++
++.PHONY: all install_xtests
diff --git a/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch b/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch
new file mode 100644
index 0000000..5e551ac
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/pam-no-innetgr.patch
@@ -0,0 +1,97 @@
+innetgr may not be there so make sure that when innetgr is not present
+then we inform about it and not use it.
+
+-Khem
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: Linux-PAM-1.1.3/modules/pam_group/pam_group.c
+===================================================================
+--- Linux-PAM-1.1.3.orig/modules/pam_group/pam_group.c
++++ Linux-PAM-1.1.3/modules/pam_group/pam_group.c
+@@ -659,7 +659,11 @@ static int check_account(pam_handle_t *p
+ 	}
+ 	/* If buffer starts with @, we are using netgroups */
+ 	if (buffer[0] == '@')
+-	  good &= innetgr (&buffer[1], NULL, user, NULL);
++#ifdef HAVE_INNETGR
++           good &= innetgr (&buffer[1], NULL, user, NULL);
++#else
++           pam_syslog (pamh, LOG_ERR, "pam_group does not have netgroup support");
++#endif
+ 	/* otherwise, if the buffer starts with %, it's a UNIX group */
+ 	else if (buffer[0] == '%')
+           good &= pam_modutil_user_in_group_nam_nam(pamh, user, &buffer[1]);
+Index: Linux-PAM-1.1.3/modules/pam_time/pam_time.c
+===================================================================
+--- Linux-PAM-1.1.3.orig/modules/pam_time/pam_time.c
++++ Linux-PAM-1.1.3/modules/pam_time/pam_time.c
+@@ -555,9 +555,13 @@ check_account(pam_handle_t *pamh, const
+ 	  }
+ 	  /* If buffer starts with @, we are using netgroups */
+ 	  if (buffer[0] == '@')
+-	    good &= innetgr (&buffer[1], NULL, user, NULL);
++#ifdef HAVE_INNETGR
++	       good &= innetgr (&buffer[1], NULL, user, NULL);
++#else
++	       pam_syslog (pamh, LOG_ERR, "pam_time does not have netgroup support");
++#endif
+ 	  else
+-	    good &= logic_field(pamh, user, buffer, count, is_same);
++	       good &= logic_field(pamh, user, buffer, count, is_same);
+ 	  D(("with user: %s", good ? "passes":"fails" ));
+ 
+ 	  /* here we get the time field */
+Index: Linux-PAM-1.1.3/modules/pam_succeed_if/pam_succeed_if.c
+===================================================================
+--- Linux-PAM-1.1.3.orig/modules/pam_succeed_if/pam_succeed_if.c
++++ Linux-PAM-1.1.3/modules/pam_succeed_if/pam_succeed_if.c
+@@ -231,18 +231,27 @@ evaluate_notingroup(pam_handle_t *pamh,
+ }
+ /* Return PAM_SUCCESS if the (host,user) is in the netgroup. */
+ static int
+-evaluate_innetgr(const char *host, const char *user, const char *group)
++evaluate_innetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ 	if (innetgr(group, host, user, NULL) == 1)
+ 		return PAM_SUCCESS;
++#else
++        pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support");
++#endif
++
+ 	return PAM_AUTH_ERR;
+ }
+ /* Return PAM_SUCCESS if the (host,user) is NOT in the netgroup. */
+ static int
+-evaluate_notinnetgr(const char *host, const char *user, const char *group)
++evaluate_notinnetgr(const pam_handle_t* pamh, const char *host, const char *user, const char *group)
+ {
++#ifdef HAVE_INNETGR
+ 	if (innetgr(group, host, user, NULL) == 0)
+ 		return PAM_SUCCESS;
++#else
++	pam_syslog (pamh, LOG_ERR, "pam_succeed_if does not have netgroup support");
++#endif
+ 	return PAM_AUTH_ERR;
+ }
+ 
+@@ -361,14 +370,14 @@ evaluate(pam_handle_t *pamh, int debug,
+ 		const void *rhost;
+ 		if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS)
+ 			rhost = NULL;
+-		return evaluate_innetgr(rhost, user, right);
++		return evaluate_innetgr(pamh, rhost, user, right);
+ 	}
+ 	/* (Rhost, user) is not in this group. */
+ 	if (strcasecmp(qual, "notinnetgr") == 0) {
+ 		const void *rhost;
+ 		if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS)
+ 			rhost = NULL;
+-		return evaluate_notinnetgr(rhost, user, right);
++		return evaluate_notinnetgr(pamh, rhost, user, right);
+ 	}
+ 	/* Fail closed. */
+ 	return PAM_SERVICE_ERR;
diff --git a/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch b/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch
new file mode 100644
index 0000000..f1834f6
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/pam-security-abstract-securetty-handling.patch
@@ -0,0 +1,200 @@
+Description: extract the securetty logic for use with the "nullok_secure" option
+ introduced in the "055_pam_unix_nullok_secure" patch.
+
+Upstream-Status: Pending
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+===================================================================
+diff -urpN a/modules/pam_securetty/Makefile.am b/modules/pam_securetty/Makefile.am
+--- a/modules/pam_securetty/Makefile.am	2013-07-05 11:08:23.224483237 +0800
++++ b/modules/pam_securetty/Makefile.am	2013-07-05 11:15:21.304486456 +0800
+@@ -24,6 +24,10 @@ endif
+ securelib_LTLIBRARIES = pam_securetty.la
+ pam_securetty_la_LIBADD = -L$(top_builddir)/libpam -lpam
+ 
++pam_securetty_la_SOURCES =	\
++	pam_securetty.c		\
++	tty_secure.c
++
+ if ENABLE_REGENERATE_MAN
+ noinst_DATA = README
+ README: pam_securetty.8.xml
+diff -urpN a/modules/pam_securetty/pam_securetty.c b/modules/pam_securetty/pam_securetty.c
+--- a/modules/pam_securetty/pam_securetty.c	2013-07-05 11:07:50.064483568 +0800
++++ b/modules/pam_securetty/pam_securetty.c	2013-07-05 11:12:23.994483344 +0800
+@@ -1,7 +1,5 @@
+ /* pam_securetty module */
+ 
+-#define SECURETTY_FILE "/etc/securetty"
+-#define TTY_PREFIX     "/dev/"
+ #define CMDLINE_FILE   "/proc/cmdline"
+ #define CONSOLEACTIVE_FILE	"/sys/class/tty/console/active"
+ 
+@@ -40,6 +38,9 @@
+ #include <security/pam_modutil.h>
+ #include <security/pam_ext.h>
+ 
++extern int _pammodutil_tty_secure(const pam_handle_t *pamh,
++                                  const char *uttyname);
++
+ #define PAM_DEBUG_ARG       0x0001
+ #define PAM_NOCONSOLE_ARG   0x0002
+ 
+@@ -73,11 +74,7 @@ securetty_perform_check (pam_handle_t *p
+     const char *username;
+     const char *uttyname;
+     const void *void_uttyname;
+-    char ttyfileline[256];
+-    char ptname[256];
+-    struct stat ttyfileinfo;
+     struct passwd *user_pwd;
+-    FILE *ttyfile;
+ 
+     /* log a trail for debugging */
+     if (ctrl & PAM_DEBUG_ARG) {
+@@ -105,50 +102,7 @@ securetty_perform_check (pam_handle_t *p
+ 	return PAM_SERVICE_ERR;
+     }
+ 
+-    /* The PAM_TTY item may be prefixed with "/dev/" - skip that */
+-    if (strncmp(TTY_PREFIX, uttyname, sizeof(TTY_PREFIX)-1) == 0) {
+-	uttyname += sizeof(TTY_PREFIX)-1;
+-    }
+-
+-    if (stat(SECURETTY_FILE, &ttyfileinfo)) {
+-	pam_syslog(pamh, LOG_NOTICE, "Couldn't open %s: %m", SECURETTY_FILE);
+-	return PAM_SUCCESS; /* for compatibility with old securetty handling,
+-			       this needs to succeed.  But we still log the
+-			       error. */
+-    }
+-
+-    if ((ttyfileinfo.st_mode & S_IWOTH) || !S_ISREG(ttyfileinfo.st_mode)) {
+-	/* If the file is world writable or is not a
+-	   normal file, return error */
+-	pam_syslog(pamh, LOG_ERR,
+-		   "%s is either world writable or not a normal file",
+-		   SECURETTY_FILE);
+-	return PAM_AUTH_ERR;
+-    }
+-
+-    ttyfile = fopen(SECURETTY_FILE,"r");
+-    if (ttyfile == NULL) { /* Check that we opened it successfully */
+-	pam_syslog(pamh, LOG_ERR, "Error opening %s: %m", SECURETTY_FILE);
+-	return PAM_SERVICE_ERR;
+-    }
+-
+-    if (isdigit(uttyname[0])) {
+-	snprintf(ptname, sizeof(ptname), "pts/%s", uttyname);
+-    } else {
+-	ptname[0] = '\0';
+-    }
+-
+-    retval = 1;
+-
+-    while ((fgets(ttyfileline, sizeof(ttyfileline)-1, ttyfile) != NULL)
+-	   && retval) {
+-	if (ttyfileline[strlen(ttyfileline) - 1] == '\n')
+-	    ttyfileline[strlen(ttyfileline) - 1] = '\0';
+-
+-	retval = ( strcmp(ttyfileline, uttyname)
+-		   && (!ptname[0] || strcmp(ptname, uttyname)) );
+-    }
+-    fclose(ttyfile);
++    retval = _pammodutil_tty_secure(pamh, uttyname);
+ 
+     if (retval && !(ctrl & PAM_NOCONSOLE_ARG)) {
+         FILE *cmdlinefile;
+diff -urpN a/modules/pam_securetty/tty_secure.c b/modules/pam_securetty/tty_secure.c
+--- a/modules/pam_securetty/tty_secure.c	1970-01-01 08:30:00.000000000 +0830
++++ b/modules/pam_securetty/tty_secure.c	2013-07-05 11:14:21.534482900 +0800
+@@ -0,0 +1,90 @@
++/*
++ * A function to determine if a particular line is in /etc/securetty
++ */
++
++
++#define SECURETTY_FILE "/etc/securetty"
++#define TTY_PREFIX     "/dev/"
++
++/* This function taken out of pam_securetty by Sam Hartman
++ * <hartmans@debian.org>*/
++/*
++ * by Elliot Lee <sopwith@redhat.com>, Red Hat Software.
++ * July 25, 1996.
++ * Slight modifications AGM. 1996/12/3
++ */
++
++#include <unistd.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <security/pam_modules.h>
++#include <stdarg.h>
++#include <syslog.h>
++#include <sys/syslog.h>
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <ctype.h>
++#include <security/pam_modutil.h>
++#include <security/pam_ext.h>
++
++extern int _pammodutil_tty_secure(const pam_handle_t *pamh,
++                                  const char *uttyname);
++
++int _pammodutil_tty_secure(const pam_handle_t *pamh, const char *uttyname)
++{
++    int retval = PAM_AUTH_ERR;
++    char ttyfileline[256];
++    char ptname[256];
++    struct stat ttyfileinfo;
++    FILE *ttyfile;
++    /* The PAM_TTY item may be prefixed with "/dev/" - skip that */
++    if (strncmp(TTY_PREFIX, uttyname, sizeof(TTY_PREFIX)-1) == 0)
++	uttyname += sizeof(TTY_PREFIX)-1;
++
++    if (stat(SECURETTY_FILE, &ttyfileinfo)) {
++	pam_syslog(pamh, LOG_NOTICE, "Couldn't open %s: %m",
++	           SECURETTY_FILE);
++	return PAM_SUCCESS; /* for compatibility with old securetty handling,
++			       this needs to succeed.  But we still log the
++			       error. */
++    }
++
++    if ((ttyfileinfo.st_mode & S_IWOTH) || !S_ISREG(ttyfileinfo.st_mode)) {
++	/* If the file is world writable or is not a
++	   normal file, return error */
++	pam_syslog(pamh, LOG_ERR,
++	           "%s is either world writable or not a normal file",
++	           SECURETTY_FILE);
++	return PAM_AUTH_ERR;
++    }
++
++    ttyfile = fopen(SECURETTY_FILE,"r");
++    if(ttyfile == NULL) { /* Check that we opened it successfully */
++	pam_syslog(pamh, LOG_ERR, "Error opening %s: %m", SECURETTY_FILE);
++	return PAM_SERVICE_ERR;
++    }
++
++    if (isdigit(uttyname[0])) {
++	snprintf(ptname, sizeof(ptname), "pts/%s", uttyname);
++    } else {
++	ptname[0] = '\0';
++    }
++
++    retval = 1;
++
++    while ((fgets(ttyfileline,sizeof(ttyfileline)-1, ttyfile) != NULL) 
++	   && retval) {
++	if(ttyfileline[strlen(ttyfileline) - 1] == '\n')
++	    ttyfileline[strlen(ttyfileline) - 1] = '\0';
++	retval = ( strcmp(ttyfileline,uttyname)
++	           && (!ptname[0] || strcmp(ptname, uttyname)) );
++    }
++    fclose(ttyfile);
++
++    if(retval) {
++	retval = PAM_AUTH_ERR;
++    }
++
++    return retval;
++}
diff --git a/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch b/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch
new file mode 100644
index 0000000..3241e82
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/pam-unix-nullok-secure.patch
@@ -0,0 +1,240 @@
+From 9bdc197474795f2d000c2bc04f58f7cef8898f21 Mon Sep 17 00:00:00 2001
+From: Amarnath Valluri <amarnath.valluri@intel.com>
+Date: Wed, 15 Jul 2015 13:07:20 +0300
+Subject: [PATCH] Debian patch to add a new 'nullok_secure' option to pam_unix,
+ which accepts users with null passwords only when the applicant is connected
+ from a tty listed in /etc/securetty.
+
+Authors: Sam Hartman <hartmans@debian.org>,
+         Steve Langasek <vorlon@debian.org>
+
+Upstream-Status: Pending
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+
+v2:
+	- Forward ported from v1.1.6 to v1.2.1
+
+Signed-off-by: Amarnath Valluri <amarnath.valluri@intel.com>
+---
+ modules/pam_unix/Makefile.am    |  3 ++-
+ modules/pam_unix/README         | 11 ++++++++++-
+ modules/pam_unix/pam_unix.8     |  9 ++++++++-
+ modules/pam_unix/pam_unix.8.xml | 19 ++++++++++++++++++-
+ modules/pam_unix/support.c      | 40 +++++++++++++++++++++++++++++++++++-----
+ modules/pam_unix/support.h      |  8 ++++++--
+ 6 files changed, 79 insertions(+), 11 deletions(-)
+
+diff --git a/modules/pam_unix/Makefile.am b/modules/pam_unix/Makefile.am
+index 56ed591..9a372ac 100644
+--- a/modules/pam_unix/Makefile.am
++++ b/modules/pam_unix/Makefile.am
+@@ -30,7 +30,8 @@ if HAVE_VERSIONING
+   pam_unix_la_LDFLAGS += -Wl,--version-script=$(srcdir)/../modules.map
+ endif
+ pam_unix_la_LIBADD = $(top_builddir)/libpam/libpam.la \
+-	@LIBCRYPT@ @LIBSELINUX@ $(NIS_LIBS)
++	@LIBCRYPT@ @LIBSELINUX@ $(NIS_LIBS) \
++	../pam_securetty/tty_secure.lo
+ 
+ securelib_LTLIBRARIES = pam_unix.la
+ 
+diff --git a/modules/pam_unix/README b/modules/pam_unix/README
+index 3935dba..7880d91 100644
+--- a/modules/pam_unix/README
++++ b/modules/pam_unix/README
+@@ -67,7 +67,16 @@ nullok
+ 
+     The default action of this module is to not permit the user access to a
+     service if their official password is blank. The nullok argument overrides
+-    this default.
++    this default and allows any user with a blank password to access the
++    service.
++
++nullok_secure
++
++    The default action of this module is to not permit the user access to a
++    service if their official password is blank. The nullok_secure argument
++    overrides this default and allows any user with a blank password to access
++    the service as long as the value of PAM_TTY is set to one of the values
++    found in /etc/securetty.
+ 
+ try_first_pass
+ 
+diff --git a/modules/pam_unix/pam_unix.8 b/modules/pam_unix/pam_unix.8
+index 339178b..a4bd906 100644
+--- a/modules/pam_unix/pam_unix.8
++++ b/modules/pam_unix/pam_unix.8
+@@ -92,7 +92,14 @@ Turns off informational messages namely messages about session open and close vi
+ .RS 4
+ The default action of this module is to not permit the user access to a service if their official password is blank\&. The
+ \fBnullok\fR
+-argument overrides this default\&.
++argument overrides this default and allows any user with a blank password to access the service\&.
++.RE
++.PP
++\fBnullok_secure\fR
++.RS 4
++The default action of this module is to not permit the user access to a service if their official password is blank\&. The
++\fBnullok_secure\fR
++argument overrides this default and allows any user with a blank password to access the service as long as the value of PAM_TTY is set to one of the values found in /etc/securetty\&.
+ .RE
+ .PP
+ \fBtry_first_pass\fR
+diff --git a/modules/pam_unix/pam_unix.8.xml b/modules/pam_unix/pam_unix.8.xml
+index a8b64bb..1ced6f4 100644
+--- a/modules/pam_unix/pam_unix.8.xml
++++ b/modules/pam_unix/pam_unix.8.xml
+@@ -159,7 +159,24 @@
+           <para>
+             The default action of this module is to not permit the
+             user access to a service if their official password is blank.
+-            The <option>nullok</option> argument overrides this default.
++            The <option>nullok</option> argument overrides this default
++            and allows any user with a blank password to access the
++            service.
++          </para>
++        </listitem>
++      </varlistentry>
++      <varlistentry>
++        <term>
++          <option>nullok_secure</option>
++        </term>
++        <listitem>
++          <para>
++            The default action of this module is to not permit the
++            user access to a service if their official password is blank.
++            The <option>nullok_secure</option> argument overrides this
++            default and allows any user with a blank password to access
++            the service as long as the value of PAM_TTY is set to one of
++            the values found in /etc/securetty.
+           </para>
+         </listitem>
+       </varlistentry>
+diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c
+index abccd82..2361957 100644
+--- a/modules/pam_unix/support.c
++++ b/modules/pam_unix/support.c
+@@ -189,13 +189,22 @@ int _set_ctrl(pam_handle_t *pamh, int flags, int *remember, int *rounds,
+ 	/* now parse the arguments to this module */
+ 
+ 	for (; argc-- > 0; ++argv) {
++		int sl;
+ 
+ 		D(("pam_unix arg: %s", *argv));
+ 
+ 		for (j = 0; j < UNIX_CTRLS_; ++j) {
+-			if (unix_args[j].token
+-			    && !strncmp(*argv, unix_args[j].token, strlen(unix_args[j].token))) {
+-				break;
++			if (unix_args[j].token) {
++				sl = strlen(unix_args[j].token);
++				if (unix_args[j].token[sl-1] == '=') {
++					/* exclude argument from comparison */
++					if (!strncmp(*argv, unix_args[j].token, sl))
++						break;
++				} else {
++				/* compare full strings */
++					if (!strcmp(*argv, unix_args[j].token))
++						break;
++				}
+ 			}
+ 		}
+ 
+@@ -566,6 +575,7 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd,
+     if (child == 0) {
+ 	static char *envp[] = { NULL };
+ 	const char *args[] = { NULL, NULL, NULL, NULL };
++	int nullok = off(UNIX__NONULL, ctrl);
+ 
+ 	/* XXX - should really tidy up PAM here too */
+ 
+@@ -593,7 +603,16 @@ static int _unix_run_helper_binary(pam_handle_t *pamh, const char *passwd,
+ 	/* exec binary helper */
+ 	args[0] = CHKPWD_HELPER;
+ 	args[1] = user;
+-	if (off(UNIX__NONULL, ctrl)) {	/* this means we've succeeded */
++	if (on(UNIX_NULLOK_SECURE, ctrl)) {
++		const void *uttyname;
++		retval = pam_get_item(pamh, PAM_TTY, &uttyname);
++		if (retval != PAM_SUCCESS || uttyname == NULL
++			|| _pammodutil_tty_secure(pamh, (const char *)uttyname) != PAM_SUCCESS) {
++			nullok = 0;
++		}
++	}
++
++	if (nullok) {
+ 	  args[2]="nullok";
+ 	} else {
+ 	  args[2]="nonull";
+@@ -678,6 +697,17 @@ _unix_blankpasswd (pam_handle_t *pamh, unsigned int ctrl, const char *name)
+ 	if (on(UNIX__NONULL, ctrl))
+ 		return 0;	/* will fail but don't let on yet */
+ 
++	if (on(UNIX_NULLOK_SECURE, ctrl)) {
++		int retval2;
++		const void *uttyname;
++		retval2 = pam_get_item(pamh, PAM_TTY, &uttyname);
++		if (retval2 != PAM_SUCCESS || uttyname == NULL)
++			return 0;
++
++		if (_pammodutil_tty_secure(pamh, (const char *)uttyname) != PAM_SUCCESS)
++			return 0;
++	}
++
+ 	/* UNIX passwords area */
+ 
+ 	retval = get_pwd_hash(pamh, name, &pwd, &salt);
+@@ -764,7 +794,7 @@ int _unix_verify_password(pam_handle_t * pamh, const char *name
+ 			}
+ 		}
+ 	} else {
+-		retval = verify_pwd_hash(p, salt, off(UNIX__NONULL, ctrl));
++		retval = verify_pwd_hash(p, salt, _unix_blankpasswd(pamh, ctrl, name));
+ 	}
+ 
+ 	if (retval == PAM_SUCCESS) {
+diff --git a/modules/pam_unix/support.h b/modules/pam_unix/support.h
+index 3729ce0..43cdbea 100644
+--- a/modules/pam_unix/support.h
++++ b/modules/pam_unix/support.h
+@@ -99,8 +99,9 @@ typedef struct {
+ #define UNIX_MIN_PASS_LEN        27	/* min length for password */
+ #define UNIX_QUIET		 28	/* Don't print informational messages */
+ #define UNIX_DES                 29     /* DES, default */
++#define UNIX_NULLOK_SECURE       30     /* NULL passwords allowed only on secure ttys */
+ /* -------------- */
+-#define UNIX_CTRLS_              30	/* number of ctrl arguments defined */
++#define UNIX_CTRLS_              31	/* number of ctrl arguments defined */
+ 
+ #define UNIX_DES_CRYPT(ctrl)	(off(UNIX_MD5_PASS,ctrl)&&off(UNIX_BIGCRYPT,ctrl)&&off(UNIX_SHA256_PASS,ctrl)&&off(UNIX_SHA512_PASS,ctrl)&&off(UNIX_BLOWFISH_PASS,ctrl))
+ 
+@@ -118,7 +119,7 @@ static const UNIX_Ctrls unix_args[UNIX_CTRLS_] =
+ /* UNIX_NOT_SET_PASS */    {"not_set_pass",    _ALL_ON_,                0100, 0},
+ /* UNIX__PRELIM */         {NULL,              _ALL_ON_^(0600),         0200, 0},
+ /* UNIX__UPDATE */         {NULL,              _ALL_ON_^(0600),         0400, 0},
+-/* UNIX__NONULL */         {NULL,              _ALL_ON_,               01000, 0},
++/* UNIX__NONULL */         {NULL,              _ALL_ON_^(02000000000),   01000, 0},
+ /* UNIX__QUIET */          {NULL,              _ALL_ON_,               02000, 0},
+ /* UNIX_USE_AUTHTOK */     {"use_authtok",     _ALL_ON_,               04000, 0},
+ /* UNIX_SHADOW */          {"shadow",          _ALL_ON_,              010000, 0},
+@@ -139,6 +140,7 @@ static const UNIX_Ctrls unix_args[UNIX_CTRLS_] =
+ /* UNIX_MIN_PASS_LEN */    {"minlen=",		_ALL_ON_,         0400000000, 0},
+ /* UNIX_QUIET */           {"quiet",           _ALL_ON_,         01000000000, 0},
+ /* UNIX_DES */             {"des",             _ALL_ON_^(0260420000),      0, 1},
++/* UNIX_NULLOK_SECURE */   {"nullok_secure",   _ALL_ON_^(01000),  02000000000, 0},
+ };
+ 
+ #define UNIX_DEFAULTS  (unix_args[UNIX__NONULL].flag)
+@@ -171,6 +173,8 @@ extern int _unix_read_password(pam_handle_t * pamh
+ 			,const char *prompt2
+ 			,const char *data_name
+ 			,const void **pass);
++extern int _pammodutil_tty_secure(const pam_handle_t *pamh,
++         const char *uttyname);
+ 
+ extern int _unix_run_verify_binary(pam_handle_t *pamh,
+ 			unsigned int ctrl, const char *user, int *daysleft);
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/pam/libpam/pam.d/common-account b/meta/recipes-extended/pam/libpam/pam.d/common-account
new file mode 100644
index 0000000..316b173
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/pam.d/common-account
@@ -0,0 +1,25 @@
+#
+# /etc/pam.d/common-account - authorization settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authorization modules that define
+# the central access policy for use on the system.  The default is to
+# only deny service to users whose accounts are expired in /etc/shadow.
+#
+# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
+# To take advantage of this, it is recommended that you configure any
+# local modules either before or after the default block, and use
+# pam-auth-update to manage selection of other modules.  See
+# pam-auth-update(8) for details.
+#
+
+# here are the per-package modules (the "Primary" block)
+account	[success=1 new_authtok_reqd=done default=ignore]	pam_unix.so 
+# here's the fallback if no module succeeds
+account	requisite			pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+account	required			pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+# end of pam-auth-update config
diff --git a/meta/recipes-extended/pam/libpam/pam.d/common-auth b/meta/recipes-extended/pam/libpam/pam.d/common-auth
new file mode 100644
index 0000000..460b69f
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/pam.d/common-auth
@@ -0,0 +1,18 @@
+#
+# /etc/pam.d/common-auth - authentication settings common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of the authentication modules that define
+# the central authentication scheme for use on the system
+# (e.g., /etc/shadow, LDAP, Kerberos, etc.).  The default is to use the
+# traditional Unix authentication mechanisms.
+
+# here are the per-package modules (the "Primary" block)
+auth	[success=1 default=ignore]	pam_unix.so nullok_secure
+# here's the fallback if no module succeeds
+auth	requisite			pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+auth	required			pam_permit.so
+# and here are more per-package modules (the "Additional" block)
diff --git a/meta/recipes-extended/pam/libpam/pam.d/common-password b/meta/recipes-extended/pam/libpam/pam.d/common-password
new file mode 100644
index 0000000..3896057
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/pam.d/common-password
@@ -0,0 +1,26 @@
+#
+# /etc/pam.d/common-password - password-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define the services to be
+# used to change user passwords.  The default is pam_unix.
+
+# Explanation of pam_unix options:
+#
+# The "sha512" option enables salted SHA512 passwords.  Without this option,
+# the default is Unix crypt.  Prior releases used the option "md5".
+#
+# The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in
+# login.defs.
+#
+# See the pam_unix manpage for other options.
+
+# here are the per-package modules (the "Primary" block)
+password	[success=1 default=ignore]	pam_unix.so obscure sha512
+# here's the fallback if no module succeeds
+password	requisite			pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+password	required			pam_permit.so
+# and here are more per-package modules (the "Additional" block)
diff --git a/meta/recipes-extended/pam/libpam/pam.d/common-session b/meta/recipes-extended/pam/libpam/pam.d/common-session
new file mode 100644
index 0000000..a4a551f
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/pam.d/common-session
@@ -0,0 +1,19 @@
+#
+# /etc/pam.d/common-session - session-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of sessions of *any* kind (both interactive and
+# non-interactive).
+#
+
+# here are the per-package modules (the "Primary" block)
+session	[default=1]			pam_permit.so
+# here's the fallback if no module succeeds
+session	requisite			pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session	required			pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+session	required	pam_unix.so
diff --git a/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive b/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive
new file mode 100644
index 0000000..b110bb2
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/pam.d/common-session-noninteractive
@@ -0,0 +1,19 @@
+#
+# /etc/pam.d/common-session-noninteractive - session-related modules
+# common to all non-interactive services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define tasks to be performed
+# at the start and end of all non-interactive sessions.
+#
+
+# here are the per-package modules (the "Primary" block)
+session	[default=1]			pam_permit.so
+# here's the fallback if no module succeeds
+session	requisite			pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+session	required			pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+session	required	pam_unix.so 
diff --git a/meta/recipes-extended/pam/libpam/pam.d/other b/meta/recipes-extended/pam/libpam/pam.d/other
new file mode 100644
index 0000000..ec970ec
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam/pam.d/other
@@ -0,0 +1,24 @@
+#
+# /etc/pam.d/other - specify the PAM fallback behaviour
+#
+# Note that this file is used for any unspecified service; for example
+#if /etc/pam.d/cron  specifies no session modules but cron calls
+#pam_open_session, the session module out of /etc/pam.d/other is
+#used.  
+
+# We use pam_warn.so to generate syslog notes that the 'other'
+#fallback rules are being used (as a hint to suggest you should setup
+#specific PAM rules for the service and aid to debugging). Then to be
+#secure, deny access to all services by default. 
+
+auth       required     pam_warn.so
+auth       required     pam_deny.so
+
+account    required     pam_warn.so
+account    required     pam_deny.so
+
+password   required     pam_warn.so
+password   required     pam_deny.so
+
+session    required     pam_warn.so
+session    required     pam_deny.so
diff --git a/meta/recipes-extended/pam/libpam_1.2.1.bb b/meta/recipes-extended/pam/libpam_1.2.1.bb
new file mode 100644
index 0000000..ac3097e
--- /dev/null
+++ b/meta/recipes-extended/pam/libpam_1.2.1.bb
@@ -0,0 +1,169 @@
+SUMMARY = "Linux-PAM (Pluggable Authentication Modules)"
+DESCRIPTION = "Linux-PAM (Pluggable Authentication Modules for Linux), a flexible mechanism for authenticating users"
+HOMEPAGE = "https://fedorahosted.org/linux-pam/"
+BUGTRACKER = "https://fedorahosted.org/linux-pam/newticket"
+SECTION = "base"
+# PAM is dual licensed under GPL and BSD.
+# /etc/pam.d comes from Debian libpam-runtime in 2009-11 (at that time
+# libpam-runtime-1.0.1 is GPLv2+), by openembedded
+LICENSE = "GPLv2+ | BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7eb5c1bf854e8881005d673599ee74d3"
+
+SRC_URI = "http://linux-pam.org/library/Linux-PAM-${PV}.tar.bz2 \
+           file://99_pam \
+           file://pam.d/common-account \
+           file://pam.d/common-auth \
+           file://pam.d/common-password \
+           file://pam.d/common-session \
+           file://pam.d/common-session-noninteractive \
+           file://pam.d/other \
+           file://libpam-xtests.patch \
+           file://fixsepbuild.patch \
+           file://pam-security-abstract-securetty-handling.patch \
+           file://pam-unix-nullok-secure.patch \
+           file://libpam-xtests-remove-bash-dependency.patch \
+           file://crypt_configure.patch \
+          "
+
+SRC_URI[md5sum] = "9dc53067556d2dd567808fd509519dd6"
+SRC_URI[sha256sum] = "342b1211c0d3b203a7df2540a5b03a428a087bd8a48c17e49ae268f992b334d9"
+
+SRC_URI_append_libc-uclibc = " file://pam-no-innetgr.patch"
+SRC_URI_append_libc-musl = " file://pam-no-innetgr.patch"
+
+DEPENDS = "bison flex flex-native cracklib"
+
+EXTRA_OECONF = "--with-db-uniquename=_pam \
+                --includedir=${includedir}/security \
+                --libdir=${base_libdir} \
+                --disable-nis \
+                --disable-regenerate-docu \
+		--disable-prelude"
+
+CFLAGS_append = " -fPIC "
+
+PR = "r5"
+
+S = "${WORKDIR}/Linux-PAM-${PV}"
+
+inherit autotools gettext pkgconfig
+
+PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit,"
+
+PACKAGES += "${PN}-runtime ${PN}-xtests"
+FILES_${PN} = "${base_libdir}/lib*${SOLIBS}"
+FILES_${PN}-dbg += "${base_libdir}/security/.debug \
+                    ${base_libdir}/security/pam_filter/.debug \
+                    ${datadir}/Linux-PAM/xtests/.debug"
+
+FILES_${PN}-dev += "${base_libdir}/security/*.la ${base_libdir}/*.la ${base_libdir}/lib*${SOLIBSDEV}"
+FILES_${PN}-runtime = "${sysconfdir}"
+FILES_${PN}-xtests = "${datadir}/Linux-PAM/xtests"
+
+PACKAGES_DYNAMIC += "^${MLPREFIX}pam-plugin-.*"
+
+def get_multilib_bit(d):
+    baselib = d.getVar('baselib', True) or ''
+    return baselib.replace('lib', '')
+
+libpam_suffix = "suffix${@get_multilib_bit(d)}"
+
+RPROVIDES_${PN} += "${PN}-${libpam_suffix}"
+RPROVIDES_${PN}-runtime += "${PN}-runtime-${libpam_suffix}"
+
+RDEPENDS_${PN}-runtime = "${PN}-${libpam_suffix} \
+    ${MLPREFIX}pam-plugin-deny-${libpam_suffix} \
+    ${MLPREFIX}pam-plugin-permit-${libpam_suffix} \
+    ${MLPREFIX}pam-plugin-warn-${libpam_suffix} \
+    ${MLPREFIX}pam-plugin-unix-${libpam_suffix} \
+    "
+RDEPENDS_${PN}-xtests = "${PN}-${libpam_suffix} \
+    ${MLPREFIX}pam-plugin-access-${libpam_suffix} \
+    ${MLPREFIX}pam-plugin-debug-${libpam_suffix} \
+    ${MLPREFIX}pam-plugin-cracklib-${libpam_suffix} \
+    ${MLPREFIX}pam-plugin-pwhistory-${libpam_suffix} \
+    ${MLPREFIX}pam-plugin-succeed-if-${libpam_suffix} \
+    ${MLPREFIX}pam-plugin-time-${libpam_suffix} \
+    coreutils"
+
+# FIXME: Native suffix breaks here, disable it for now
+RRECOMMENDS_${PN} = "${PN}-runtime-${libpam_suffix}"
+RRECOMMENDS_${PN}_class-native = ""
+
+python populate_packages_prepend () {
+    def pam_plugin_append_file(pn, dir, file):
+        nf = os.path.join(dir, file)
+        of = d.getVar('FILES_' + pn, True)
+        if of:
+            nf = of + " " + nf
+        d.setVar('FILES_' + pn, nf)
+
+    def pam_plugin_hook(file, pkg, pattern, format, basename):
+        pn = d.getVar('PN', True)
+        libpam_suffix = d.getVar('libpam_suffix', True)
+
+        rdeps = d.getVar('RDEPENDS_' + pkg, True)
+        if rdeps:
+            rdeps = rdeps + " " + pn + "-" + libpam_suffix
+        else:
+            rdeps = pn + "-" + libpam_suffix
+        d.setVar('RDEPENDS_' + pkg, rdeps)
+
+        provides = d.getVar('RPROVIDES_' + pkg, True)
+        if provides:
+            provides = provides + " " + pkg + "-" + libpam_suffix
+        else:
+            provides = pkg + "-" + libpam_suffix
+        d.setVar('RPROVIDES_' + pkg, provides)
+
+    mlprefix = d.getVar('MLPREFIX', True) or ''
+    dvar = bb.data.expand('${WORKDIR}/package', d, True)
+    pam_libdir = d.expand('${base_libdir}/security')
+    pam_sbindir = d.expand('${sbindir}')
+    pam_filterdir = d.expand('${base_libdir}/security/pam_filter')
+    pam_pkgname = mlprefix + 'pam-plugin%s'
+
+    do_split_packages(d, pam_libdir, '^pam(.*)\.so$', pam_pkgname,
+                      'PAM plugin for %s', hook=pam_plugin_hook, extra_depends='')
+    pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_chkpwd')
+    pam_plugin_append_file('%spam-plugin-unix' % mlprefix, pam_sbindir, 'unix_update')
+    pam_plugin_append_file('%spam-plugin-tally' % mlprefix, pam_sbindir, 'pam_tally')
+    pam_plugin_append_file('%spam-plugin-tally2' % mlprefix, pam_sbindir, 'pam_tally2')
+    pam_plugin_append_file('%spam-plugin-timestamp' % mlprefix, pam_sbindir, 'pam_timestamp_check')
+    pam_plugin_append_file('%spam-plugin-mkhomedir' % mlprefix, pam_sbindir, 'mkhomedir_helper')
+    pam_plugin_append_file('%spam-plugin-console' % mlprefix, pam_sbindir, 'pam_console_apply')
+    do_split_packages(d, pam_filterdir, '^(.*)$', 'pam-filter-%s', 'PAM filter for %s', extra_depends='')
+}
+
+do_install() {
+	autotools_do_install
+
+	# don't install /var/run when populating rootfs. Do it through volatile
+	rm -rf ${D}${localstatedir}
+	install -d ${D}${sysconfdir}/default/volatiles
+	install -m 0644 ${WORKDIR}/99_pam ${D}${sysconfdir}/default/volatiles
+
+	install -d ${D}${sysconfdir}/pam.d/
+	install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
+
+	# The lsb requires unix_chkpwd has setuid permission
+	chmod 4755 ${D}${sbindir}/unix_chkpwd
+
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		echo "session optional pam_systemd.so" >> ${D}${sysconfdir}/pam.d/common-session
+	fi
+}
+
+python do_pam_sanity () {
+    if not bb.utils.contains('DISTRO_FEATURES', 'pam', True, False, d):
+        bb.warn("Building libpam but 'pam' isn't in DISTRO_FEATURES, PAM won't work correctly")
+}
+addtask pam_sanity before do_configure
+
+BBCLASSEXTEND = "nativesdk native"
+
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-auth"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-password"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-session-noninteractive"
+CONFFILES_${PN}-runtime += "${sysconfdir}/pam.d/common-account"
diff --git a/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch b/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch
new file mode 100644
index 0000000..b0376ce
--- /dev/null
+++ b/meta/recipes-extended/parted/files/0001-Include-fcntl.h-in-platform_defs.h.patch
@@ -0,0 +1,29 @@
+From d78dd087c4ec4715aab5fe115668e726046ecd76 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 18:16:05 -0700
+Subject: [PATCH] Include fcntl.h in /platform_defs.h
+
+exposed when compiling using musl
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libparted/fs/xfs/platform_defs.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libparted/fs/xfs/platform_defs.h b/libparted/fs/xfs/platform_defs.h
+index 2b55752..32bd3d3 100644
+--- a/libparted/fs/xfs/platform_defs.h
++++ b/libparted/fs/xfs/platform_defs.h
+@@ -42,6 +42,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ #include <sys/param.h>
+ #include <sys/types.h>
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..ba1a4ba
--- /dev/null
+++ b/meta/recipes-extended/parted/files/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/parted/files/Makefile b/meta/recipes-extended/parted/files/Makefile
new file mode 100644
index 0000000..ee90be0
--- /dev/null
+++ b/meta/recipes-extended/parted/files/Makefile
@@ -0,0 +1,285 @@
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+
+am__tty_colors = \
+$(am__tty_colors_dummy); \
+test "X$(AM_COLOR_TESTS)" != Xno \
+&& test "X$$TERM" != Xdumb \
+&& { test "X$(AM_COLOR_TESTS)" = Xalways || test -t 1 2>/dev/null; } \
+&& { \
+  am__color_tests=yes; \
+  red=''; \
+  grn=''; \
+  lgn=''; \
+  blu=''; \
+  mgn=''; \
+  brg=''; \
+  std=''; \
+}
+
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+am__rst_section = { sed 'p;s/./=/g;' && echo; }
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+am__check_pre = \
+$(am__sh_e_setup);					\
+$(am__vpath_adj_setup) $(am__vpath_adj)			\
+$(am__tty_colors);					\
+srcdir=$(srcdir); export srcdir;			\
+am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;		\
+test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?;	\
+if test -f "./$$f"; then dir=./;			\
+elif test -f "$$f"; then dir=;				\
+else dir="$(srcdir)/"; fi;				\
+tst=$$dir$$f; log='$@'; 				\
+if test -n '$(DISABLE_HARD_ERRORS)'; then		\
+  am__enable_hard_errors=no; 				\
+else							\
+  am__enable_hard_errors=yes; 				\
+fi; 							\
+$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
+
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:.log=.log)
+TEST_LOGS = $(am__test_logs2:.sh.log=.log)
+SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver
+SH_LOG_COMPILE = $(SH_LOG_COMPILER)
+
+am__set_b = \
+  case '$@' in \
+    */*) \
+      case '$*' in \
+        */*) b='$*';; \
+          *) b=`echo '$@' | sed 's/\.log$$//'`; \
+       esac;; \
+    *) \
+      b='$*';; \
+  esac
+
+MKDIR_P = /bin/mkdir -p
+SHELL = /bin/bash
+VERSION = 3.1
+PACKAGE_STRING = GNU parted 3.1
+PACKAGE_BUGREPORT = bug-parted@gnu.org
+abs_srcdir = $(PWD)
+abs_top_builddir = $(PWD)/..
+abs_top_srcdir = $(PWD)/..
+srcdir = .
+top_srcdir = ..
+subdir = tests
+SH_LOG_COMPILER = $(SHELL)
+
+TESTS = \
+  help-version.sh \
+  t0000-basic.sh \
+  t0001-tiny.sh \
+  t0010-script-no-ctrl-chars.sh \
+  t0100-print.sh \
+  t0101-print-empty.sh \
+  t0200-gpt.sh \
+  t0201-gpt.sh \
+  t0202-gpt-pmbr.sh \
+  t0203-gpt-tiny-device-abort.sh \
+  t0203-gpt-shortened-device-primary-valid.sh \
+  t0205-gpt-list-clobbers-pmbr.sh \
+  t0206-gpt-print-with-corrupt-primary-clobbers-pmbr.sh \
+  t0207-IEC-binary-notation.sh \
+  t0208-mkpart-end-in-IEC.sh \
+  t0209-gpt-pmbr_boot.sh \
+  t0210-gpt-resized-partition-entry-array.sh \
+  t0211-gpt-rewrite-header.sh \
+  t0212-gpt-many-partitions.sh \
+  t0220-gpt-msftres.sh \
+  t0250-gpt.sh \
+  t0280-gpt-corrupt.sh \
+  t0300-dos-on-gpt.sh \
+  t0400-loop-clobber-infloop.sh \
+  t0500-dup-clobber.sh \
+  t0501-duplicate.sh \
+  t1100-busy-label.sh \
+  t1101-busy-partition.sh \
+  t1700-probe-fs.sh \
+  t2200-dos-label-recog.sh \
+  t2201-pc98-label-recog.sh \
+  t2300-dos-label-extended-bootcode.sh \
+  t2310-dos-extended-2-sector-min-offset.sh \
+  t2400-dos-hfs-partition-type.sh \
+  t2500-probe-corrupt-hfs.sh \
+  t3000-resize-fs.sh \
+  t3200-type-change.sh \
+  t3300-palo-prep.sh \
+  t3310-flags.sh \
+  t3400-whole-disk-FAT-partition.sh \
+  t4000-sun-raid-type.sh \
+  t4001-sun-vtoc.sh \
+  t4100-msdos-partition-limits.sh \
+  t4100-dvh-partition-limits.sh \
+  t4100-msdos-starting-sector.sh \
+  t4200-partprobe.sh \
+  t4300-nilfs2-tiny.sh \
+  t5000-tags.sh \
+  t6000-dm.sh \
+  t6001-psep.sh \
+  t6100-mdraid-partitions.sh \
+  t7000-scripting.sh \
+  t8000-loop.sh \
+  t8001-loop-blkpg.sh \
+  t9010-big-sector.sh \
+  t9020-alignment.sh \
+  t9021-maxima.sh \
+  t9022-one-unit-snap.sh \
+  t9023-value-lt-one.sh \
+  t9030-align-check.sh \
+  t9040-many-partitions.sh \
+  t9041-undetected-in-use-16th-partition.sh \
+  t9042-dos-partition-limit.sh \
+  t9050-partition-table-types.sh
+
+TESTS_ENVIRONMENT = \
+  export					\
+  abs_top_builddir='$(abs_top_builddir)'	\
+  abs_top_srcdir='$(abs_top_srcdir)'		\
+  abs_srcdir='$(abs_srcdir)'			\
+  built_programs=parted				\
+  srcdir='$(srcdir)'				\
+  top_srcdir='$(top_srcdir)'			\
+  VERSION=$(VERSION)				\
+  ; 9>&2
+
+.SUFFIXES: .log
+
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+	@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+	ws='[ 	]'; \
+	results=`for b in $$bases; do echo $$b.trs; done`; \
+	test -n "$$results" || results=/dev/null; \
+	all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+	pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+	fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+	skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+	xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+	xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+	error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+	if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+	  success=true; \
+	else \
+	  success=false; \
+	fi; \
+	br='==================='; br=$$br$$br$$br$$br; \
+	result_count () \
+	{ \
+	    if test x"$$1" = x"--maybe-color"; then \
+	      maybe_colorize=yes; \
+	    elif test x"$$1" = x"--no-color"; then \
+	      maybe_colorize=no; \
+	    else \
+	      echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+	    fi; \
+	    shift; \
+	    desc=$$1 count=$$2; \
+	    if test $$maybe_colorize = yes && test $$count -gt 0; then \
+	      color_start=$$3 color_end=$$std; \
+	    else \
+	      color_start= color_end=; \
+	    fi; \
+	    echo "$${color_start}# $$desc $$count$${color_end}"; \
+	}; \
+	create_testsuite_report () \
+	{ \
+	  result_count $$1 "TOTAL:" $$all   "$$brg"; \
+	  result_count $$1 "PASS: " $$pass  "$$grn"; \
+	  result_count $$1 "SKIP: " $$skip  "$$blu"; \
+	  result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+	  result_count $$1 "FAIL: " $$fail  "$$red"; \
+	  result_count $$1 "XPASS:" $$xpass "$$red"; \
+	  result_count $$1 "ERROR:" $$error "$$mgn"; \
+	}; \
+	{								\
+	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\
+	    $(am__rst_title);						\
+	  create_testsuite_report --no-color;				\
+	  echo;								\
+	  echo ".. contents:: :depth: 2";				\
+	  echo;								\
+	  for i in $$bases; do						\
+	    if grep "^$$ws*:copy-in-global-log:$$ws*no$$ws*$$" $$i.trs \
+	         >/dev/null; then continue; \
+	    fi; \
+	    glob_res=`sed -n -e "s/$$ws*$$//" \
+	                     -e "s/^$$ws*:global-test-result:$$ws*//p" \
+		        $$i.trs`; \
+	    test -n "$$glob_res" || glob_res=RUN; \
+	    echo "$$glob_res: $$i" | $(am__rst_section); \
+	    if test ! -r $$i.log; then \
+	      echo "fatal: making $@: $$i.log is unreadable" >&2; \
+	      exit 1; \
+	    fi; \
+	    cat $$i.log; echo; \
+	  done;	\
+	} >$(TEST_SUITE_LOG).tmp;					\
+	mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);			\
+	if $$success; then						\
+	  col="$$grn";							\
+	 else								\
+	  col="$$red";							\
+	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
+	fi;								\
+	echo "$${col}$$br$${std}"; 					\
+	echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";	\
+	echo "$${col}$$br$${std}"; 					\
+	create_testsuite_report --maybe-color;				\
+	echo "$$col$$br$$std";						\
+	if $$success; then :; else					\
+	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\
+	  if test -n "$(PACKAGE_BUGREPORT)"; then			\
+	    echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}";	\
+	  fi;								\
+	  echo "$$col$$br$$std";					\
+	fi;								\
+	$$success || exit 1
+
+check-TESTS:
+	@if test $@ != recheck; then \
+	   list='$(RECHECK_LOGS)'; \
+	   test -z "$$list" || rm -f $$list; \
+	 fi
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@ws='[ 	]'; \
+	log_list='' trs_list=''; $(am__set_TESTS_bases); \
+	for i in $$bases; do \
+	  if test -z "$$log_list"; then \
+	    log_list="$$i.log"; \
+	  else \
+	    log_list="$$log_list $$i.log"; \
+	  fi; \
+	  if test -z "$$trs_list"; then \
+	    trs_list="$$i.trs"; \
+	  else \
+	    trs_list="$$trs_list $$i.trs"; \
+	  fi; \
+	done; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"
+
+.sh.log:
+	@p='$<'; \
+	$(am__set_b); \
+	$(am__check_pre) $(SH_LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) -- $(SH_LOG_COMPILE) "$$tst"
diff --git a/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch b/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
new file mode 100644
index 0000000..68ab715
--- /dev/null
+++ b/meta/recipes-extended/parted/files/fix-compile-failure-while-dis.patch
@@ -0,0 +1,57 @@
+From 060e74354774d36d2c11ef08e3e7ea9b9b6e23fb Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Thu, 13 Nov 2014 11:29:33 +0800
+Subject: [PATCH] libparted/arch/linux.c: fix compile failure while
+ --disable-device-mapper
+
+While --disable-device-mapper, the MACRO ENABLE_DEVICE_MAPPER is
+undef, but it missed to scope some device mapper functions.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ libparted/arch/linux.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
+index 6fd73c5..2afa479 100644
+--- a/libparted/arch/linux.c
++++ b/libparted/arch/linux.c
+@@ -2320,6 +2320,7 @@ zasprintf (const char *format, ...)
+ static char *
+ dm_canonical_path (PedDevice const *dev)
+ {
++#ifdef ENABLE_DEVICE_MAPPER
+         LinuxSpecific const *arch_specific = LINUX_SPECIFIC (dev);
+ 
+         /* Get map name from devicemapper */
+@@ -2337,6 +2338,7 @@ dm_canonical_path (PedDevice const *dev)
+         dm_task_destroy (task);
+         return dev_name;
+ err:
++#endif
+         return NULL;
+ }
+ 
+@@ -2957,13 +2959,15 @@ _disk_sync_part_table (PedDisk* disk)
+                                                unsigned long long *start,
+                                                unsigned long long *length);
+ 
+-
++#ifdef ENABLE_DEVICE_MAPPER
+         if (disk->dev->type == PED_DEVICE_DM) {
+                 add_partition = _dm_add_partition;
+                 remove_partition = _dm_remove_partition;
+                 resize_partition = _dm_resize_partition;
+                 get_partition_start_and_length = _dm_get_partition_start_and_length;
+-        } else {
++        } else
++#endif
++        {
+                 add_partition = _blkpg_add_partition;
+                 remove_partition = _blkpg_remove_partition;
+ #ifdef BLKPG_RESIZE_PARTITION
+-- 
+1.9.1
+
diff --git a/meta/recipes-extended/parted/files/fix-doc-mandir.patch b/meta/recipes-extended/parted/files/fix-doc-mandir.patch
new file mode 100644
index 0000000..0711d4e
--- /dev/null
+++ b/meta/recipes-extended/parted/files/fix-doc-mandir.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Submitted [bug-parted@gnu.org]
+
+| for po in `ls -1 ./*.pt_BR.po 2>/dev/null`; do \
+| 		make $(basename ${po%.pt_BR.po}); \
+| 	done
+| Makefile:904: *** Recursive variable `mandir' references itself (eventually).  Stop.
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+
+--- parted-3.1/doc/po4a.mk.orig	2012-03-15 14:09:11.555831872 +0100
++++ parted-3.1/doc/po4a.mk	2012-03-15 14:10:44.243830985 +0100
+@@ -23,7 +23,7 @@
+ # threshold is 80%), it won't be distributed, and the build won't fail.
+ #
+ 
+-mandir = $(mandir)/$(lang)
++mandir := $(mandir)/$(lang)
+ 
+ # Inform automake that we want to install some man pages in section 1, 5
+ # and 8.
diff --git a/meta/recipes-extended/parted/files/no_check.patch b/meta/recipes-extended/parted/files/no_check.patch
new file mode 100644
index 0000000..58d8db4
--- /dev/null
+++ b/meta/recipes-extended/parted/files/no_check.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate [configuration]
+
+If check is detected, it makes the builds non-determinstic so just force
+it to be disabled.
+
+RP - 4/11/08
+
+Index: parted-1.9.0/configure.ac
+===================================================================
+--- parted-1.9.0.orig/configure.ac	2009-07-23 18:52:08.000000000 +0100
++++ parted-1.9.0/configure.ac	2010-02-02 14:13:56.013905093 +0000
+@@ -477,7 +477,7 @@
+ AM_CONDITIONAL([BUILD_LINUX], [test "$OS" = linux])
+ 
+ dnl check for "check", unit testing library/header
+-PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no)
++have_check=no
+ if test "$have_check" != "yes"; then
+     AC_MSG_RESULT([Unable to locate check version 0.9.3 or higher: not building])
+ fi
diff --git a/meta/recipes-extended/parted/files/run-ptest b/meta/recipes-extended/parted/files/run-ptest
new file mode 100644
index 0000000..695c5e8
--- /dev/null
+++ b/meta/recipes-extended/parted/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C tests check-TESTS
diff --git a/meta/recipes-extended/parted/files/syscalls.patch b/meta/recipes-extended/parted/files/syscalls.patch
new file mode 100644
index 0000000..e9bbe9a
--- /dev/null
+++ b/meta/recipes-extended/parted/files/syscalls.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Pending
+
+---
+ libparted/arch/linux.c |   13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+Index: parted-1.9.0/libparted/arch/linux.c
+===================================================================
+--- parted-1.9.0.orig/libparted/arch/linux.c	2009-07-23 18:52:08.000000000 +0100
++++ parted-1.9.0/libparted/arch/linux.c	2010-02-02 14:14:16.523904768 +0000
+@@ -17,6 +17,8 @@
+ 
+ #define PROC_DEVICES_BUFSIZ 16384
+ 
++#include <linux/version.h>
++
+ #include <config.h>
+ #include <arch/linux.h>
+ 
+@@ -1477,12 +1479,14 @@
+ 
+ #if SIZEOF_OFF_T < 8
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+ static _syscall5(int,_llseek,
+                  unsigned int, fd,
+                  unsigned long, offset_high,
+                  unsigned long, offset_low,
+                  loff_t*, result,
+                  unsigned int, origin)
++#endif
+ 
+ loff_t
+ llseek (unsigned int fd, loff_t offset, unsigned int whence)
+@@ -1490,11 +1494,20 @@
+         loff_t result;
+         int retval;
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
+         retval = _llseek(fd,
+                          ((unsigned long long)offset) >> 32,
+                          ((unsigned long long)offset) & 0xffffffff,
+                          &result,
+                          whence);
++#else
++ 	retval = syscall(__NR__llseek, fd,
++			 ((unsigned long long)offset) >> 32,
++                         ((unsigned long long)offset) & 0xffffffff,
++                          &result,
++			 whence);
++#endif
++
+         return (retval==-1 ? (loff_t) retval : result);
+ }
+ 
diff --git a/meta/recipes-extended/parted/parted_3.2.bb b/meta/recipes-extended/parted/parted_3.2.bb
new file mode 100644
index 0000000..ff8ae09
--- /dev/null
+++ b/meta/recipes-extended/parted/parted_3.2.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Disk partition editing/resizing utility"
+HOMEPAGE = "http://www.gnu.org/software/parted/parted.html"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2f31b266d3440dd7ee50f92cf67d8e6c"
+SECTION = "console/tools"
+DEPENDS = "ncurses readline util-linux"
+PR = "r1"
+
+SRC_URI = "${GNU_MIRROR}/parted/parted-${PV}.tar.xz \
+           file://no_check.patch \
+           file://syscalls.patch \
+           file://fix-doc-mandir.patch \
+           file://fix-compile-failure-while-dis.patch \
+           file://0001-Include-fcntl.h-in-platform_defs.h.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           file://run-ptest \
+           file://Makefile \
+"
+
+SRC_URI[md5sum] = "0247b6a7b314f8edeb618159fa95f9cb"
+SRC_URI[sha256sum] = "858b589c22297cacdf437f3baff6f04b333087521ab274f7ab677cb8c6bb78e4"
+
+EXTRA_OECONF = "--disable-device-mapper"
+
+inherit autotools pkgconfig gettext texinfo ptest
+
+BBCLASSEXTEND = "native"
+
+do_compile_ptest() {
+	oe_runmake -C tests print-align print-max dup-clobber duplicate fs-resize
+}
+
+do_install_ptest() {
+	t=${D}${PTEST_PATH}
+	mkdir $t/build-aux
+	cp ${S}/build-aux/test-driver $t/build-aux/
+	cp -r ${S}/tests $t
+	cp ${WORKDIR}/Makefile $t/tests/
+	sed -i "s|^VERSION.*|VERSION = ${PV}|g" $t/tests/Makefile
+	for i in print-align print-max dup-clobber duplicate fs-resize; \
+	  do cp ${B}/tests/.libs/$i $t/tests/; \
+	done
+	sed -e 's| ../parted||' -i $t/tests/*.sh
+}
+
+RDEPENDS_${PN}-ptest = "bash coreutils perl util-linux-losetup python"
diff --git a/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch b/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch
new file mode 100644
index 0000000..88779c3
--- /dev/null
+++ b/meta/recipes-extended/pax/pax/fix_for_compile_with_gcc-4.6.0.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+This patch fixes this compiler error with gcc 4.6.0
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/05/08
+
+| fts.c: In function 'pax_fts_set':
+| fts.c:469:7: error: parameter 'sp' set but not used [-Werror=unused-but-set-parameter]
+| cc1: all warnings being treated as errors
+| 
+| make[2]: *** [fts.o] Error 1
+
+Index: pax-3.4/lib/fts.c
+===================================================================
+--- pax-3.4.orig/lib/fts.c
++++ pax-3.4/lib/fts.c
+@@ -466,7 +466,7 @@ name:		t = sp->fts_path + NAPPEND(p->fts
+ /* ARGSUSED */
+ int
+ fts_set(sp, p, instr)
+-	FTS *sp;
++	FTS __attribute__((__unused__)) *sp;
+ 	FTSENT *p;
+ 	int instr;
+ {
diff --git a/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch b/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch
new file mode 100644
index 0000000..80878f3
--- /dev/null
+++ b/meta/recipes-extended/pax/pax/pax-3.4_fix_for_x32.patch
@@ -0,0 +1,185 @@
+Upstream-Status: Pending
+
+Author: H.J. Lu <hjl.tools@gmail.com>
+Date:   Tue Dec 6 10:34:53 2011 -0800
+
+    Fix pax-3.4 build for x32
+    
+    off_t is 8byte for x32.  We need to check both _FILE_OFFSET_BITS and
+    size of off_t to see if file offset is 64bit.  This patch adds
+    AC_CHECK_SIZEOF(off_t) and checks SIZEOF_OFF_T == 8.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/06
+
+Index: pax-3.4/configure.in
+===================================================================
+--- pax-3.4.orig/configure.in
++++ pax-3.4/configure.in
+@@ -33,4 +33,7 @@ dnl Checks for header files.
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+ 
++AC_CHECK_SIZEOF(off_t)
++AC_CHECK_SIZEOF(long)
++
+ AC_OUTPUT([Makefile lib/Makefile src/Makefile])
+Index: pax-3.4/src/ar_io.c
+===================================================================
+--- pax-3.4.orig/src/ar_io.c
++++ pax-3.4/src/ar_io.c
+@@ -378,7 +378,8 @@ ar_close(void)
+ 	 * could have written anything yet.
+ 	 */
+ 	if (frmt == NULL) {
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ 		(void)fprintf(listf, "%s: unknown format, %qu bytes skipped.\n",
+ #else
+ 		(void)fprintf(listf, "%s: unknown format, %lu bytes skipped.\n",
+@@ -391,7 +392,8 @@ ar_close(void)
+ 
+ 	if (strcmp(NM_CPIO, argv0) == 0)
+ 		(void)fprintf(listf,
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ 		    "%qu blocks\n",
+ #else
+ 		    "%lu blocks\n",
+@@ -399,7 +401,8 @@ ar_close(void)
+ 			(rdcnt ? rdcnt : wrcnt) / 5120);
+ 	else if (strcmp(NM_TAR, argv0) != 0)
+ 		(void)fprintf(listf,
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ 		    "%s: %s vol %d, %lu files, %qu bytes read, %qu bytes written.\n",
+ #else
+ 		    "%s: %s vol %d, %lu files, %lu bytes read, %lu bytes written.\n",
+Index: pax-3.4/src/cpio.c
+===================================================================
+--- pax-3.4.orig/src/cpio.c
++++ pax-3.4/src/cpio.c
+@@ -218,7 +218,8 @@ rd_ln_nm (ARCHD *arcn)
+ 	 */
+ 	if ((arcn->sb.st_size == 0) ||
+ 	    (arcn->sb.st_size >= (off_t) sizeof(arcn->ln_name))) {
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ 		paxwarn (1, "Cpio link name length is invalid: %qu",
+ 			 arcn->sb.st_size);
+ #else
+Index: pax-3.4/src/gen_subs.c
+===================================================================
+--- pax-3.4.orig/src/gen_subs.c
++++ pax-3.4/src/gen_subs.c
+@@ -133,7 +133,8 @@ ls_list (ARCHD *arcn, time_t now, FILE *
+    * print device id's for devices, or sizes for other nodes
+    */
+   if ((arcn->type == PAX_CHR) || (arcn->type == PAX_BLK))
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+     (void) fprintf (fp, "%4lu,%4lu ", (unsigned long) MAJOR (sbp->st_rdev),
+ 		    (unsigned long) MINOR (sbp->st_rdev));
+ #else
+@@ -142,7 +143,8 @@ ls_list (ARCHD *arcn, time_t now, FILE *
+ #endif
+   else
+     {
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+       (void) fprintf (fp, "%9qu ", sbp->st_size);
+ #else
+       (void) fprintf (fp, "%9lu ", sbp->st_size);
+@@ -334,7 +336,8 @@ ul_asc (u_long val, char *str, int len, 
+   return (0);
+ }
+ 
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ /*
+  * asc_uqd()
+  *	convert hex/octal character string into a u_quad_t. We do not have to
+Index: pax-3.4/src/options.c
+===================================================================
+--- pax-3.4.orig/src/options.c
++++ pax-3.4/src/options.c
+@@ -1545,7 +1545,8 @@ str_offt (char *val)
+   char *expr;
+   off_t num, t;
+ 
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+   num = strtoq (val, &expr, 0);
+   if ((num == LONG_LONG_MAX) || (num <= 0) || (expr == val))
+ #else
+Index: pax-3.4/src/tar.c
+===================================================================
+--- pax-3.4.orig/src/tar.c
++++ pax-3.4/src/tar.c
+@@ -58,7 +58,8 @@
+ static unsigned long tar_chksm (char *, int);
+ static char *name_split (char *, int);
+ static int ul_oct (u_long, char *, int, int);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ static int uqd_oct (u_quad_t, char *, int, int);
+ #endif
+ 
+@@ -196,7 +197,8 @@ ul_oct (u_long val, register char *str, 
+   return (0);
+ }
+ 
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+ /*
+  * uqd_oct()
+  *	convert an u_quad_t to an octal string. one of many oddball field
+@@ -427,7 +429,8 @@ tar_rd (ARCHD *arcn, char *buf)
+ 			       0xfff);
+   arcn->sb.st_uid = (uid_t) asc_ul (hd->uid, sizeof (hd->uid), OCT);
+   arcn->sb.st_gid = (gid_t) asc_ul (hd->gid, sizeof (hd->gid), OCT);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+   arcn->sb.st_size = (off_t) asc_uqd (hd->size, sizeof (hd->size), OCT);
+ #else
+   arcn->sb.st_size = (off_t) asc_ul (hd->size, sizeof (hd->size), OCT);
+@@ -659,7 +662,8 @@ tar_wr (register ARCHD * arcn)
+        * data follows this file, so set the pad
+        */
+       hd->linkflag = AREGTYPE;
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+       if (uqd_oct ((u_quad_t) arcn->sb.st_size, hd->size,
+ 		   sizeof (hd->size), 1))
+ #else
+@@ -834,7 +838,8 @@ ustar_rd (ARCHD *arcn, char *buf)
+    */
+   arcn->sb.st_mode = (mode_t) (asc_ul (hd->mode, sizeof (hd->mode), OCT) &
+ 			       0xfff);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+   arcn->sb.st_size = (off_t) asc_uqd (hd->size, sizeof (hd->size), OCT);
+ #else
+   arcn->sb.st_size = (off_t) asc_ul (hd->size, sizeof (hd->size), OCT);
+@@ -1081,7 +1086,8 @@ ustar_wr (register ARCHD * arcn)
+       else
+ 	hd->typeflag = REGTYPE;
+       arcn->pad = TAR_PAD (arcn->sb.st_size);
+-#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64
++#if (SIZEOF_LONG == 4 && SIZEOF_OFF_T == 8) \
++    || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS == 64)
+       if (uqd_oct ((u_quad_t) arcn->sb.st_size, hd->size,
+ 		   sizeof (hd->size), 3))
+ 	{
diff --git a/meta/recipes-extended/pax/pax_3.4.bb b/meta/recipes-extended/pax/pax_3.4.bb
new file mode 100644
index 0000000..ad04871
--- /dev/null
+++ b/meta/recipes-extended/pax/pax_3.4.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Portable Archive eXchange"
+DESCRIPTION = "pax (Portable Archive eXchange) is the POSIX standard archive tool"
+HOMEPAGE = "http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/bin/pax/"
+BUGTRACKER = "http://www.openbsd.org/query-pr.html"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4b0b674dfdc56daa3832d4069b820ea0 \
+                    file://src/pax.h;endline=40;md5=309d3e241c1d82069228e5a51e9b8d60 \
+                    file://src/cpio.h;endline=40;md5=c3b4bbff6133a83387968617bbae8ac4 \
+                    file://lib/vis.h;endline=40;md5=b283f759abd4a5ad7e014b80f51fc053"
+
+SECTION = "base"
+PR = "r2"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.bz2/fbd9023b590b45ac3ade95870702a0d6/${BP}.tar.bz2 \
+	file://fix_for_compile_with_gcc-4.6.0.patch \
+	file://pax-3.4_fix_for_x32.patch"
+
+SRC_URI[md5sum] = "fbd9023b590b45ac3ade95870702a0d6"
+SRC_URI[sha256sum] = "ac3c06048e02828077cf7757d3d142241429238893b91d529af29a2e8cc5623b"
+
+inherit autotools
diff --git a/meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb b/meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb
new file mode 100644
index 0000000..0330981
--- /dev/null
+++ b/meta/recipes-extended/pbzip2/pbzip2_1.1.12.bb
@@ -0,0 +1,28 @@
+SUMMARY = "PBZIP2 is a parallel implementation of bzip2"
+DESCRIPTION = "PBZIP2 is a parallel implementation of the bzip2 block-sorting \
+file compressor that uses pthreads and achieves near-linear speedup on SMP \
+machines. The output of this version is fully compatible with bzip2 v1.0.2 or \
+newer (ie: anything compressed with pbzip2 can be decompressed with bzip2)."
+HOMEPAGE = "http://compression.ca/pbzip2/"
+SECTION = "console/utils"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4c4f2edec9679d5abef3514a816b54a4"
+
+DEPENDS = "bzip2"
+DEPENDS_append_class-native = " bzip2-replacement-native"
+
+SRC_URI = "https://launchpad.net/${BPN}/1.1/${PV}/+download/${BP}.tar.gz"
+
+SRC_URI[md5sum] = "91a4911b13305850423840eb0fa6f4f9"
+SRC_URI[sha256sum] = "573bb358a5a7d3bf5f42f881af324cedf960c786e8d66dd03d448ddd8a0166ee"
+
+do_configure[noexec] = "1"
+
+EXTRA_OEMAKE = "CXX='${CXX} ${CXXFLAGS}' LDFLAGS='${LDFLAGS}'"
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 pbzip2 ${D}${bindir}/
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb b/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb
new file mode 100644
index 0000000..170e7ec
--- /dev/null
+++ b/meta/recipes-extended/perl/libconvert-asn1-perl_0.27.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Convert::ASN1 - Perl ASN.1 Encode/Decode library"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README.md;beginline=91;endline=97;md5=ceff7fd286eb6d8e8e0d3d23e096a63f"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/Convert-ASN1-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "68723e96be0b258a9e20480276e8a62c"
+SRC_URI[sha256sum] = "74a4a78ae0c5e973100ac0a8f203a110f76fb047b79dae4fc1fd7d6814d3d58a"
+
+S = "${WORKDIR}/Convert-ASN1-${PV}"
+
+inherit cpan
+
+EXTRA_PERLFLAGS = "-I ${PERLHOSTLIB}"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/perl/libtimedate-perl_2.30.bb b/meta/recipes-extended/perl/libtimedate-perl_2.30.bb
new file mode 100644
index 0000000..c8fcde4
--- /dev/null
+++ b/meta/recipes-extended/perl/libtimedate-perl_2.30.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Perl modules useful for manipulating date and time information"
+SECTION = "libs"
+# You can redistribute it and/or modify it under the same terms as Perl itself.
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README;beginline=21;md5=576b7cb41e5e821501a01ed66f0f9d9e"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GB/GBARR/TimeDate-${PV}.tar.gz"
+
+S = "${WORKDIR}/TimeDate-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
+
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN} += "perl-module-carp perl-module-exporter perl-module-strict perl-module-time-local"
+
+SRC_URI[md5sum] = "b1d91153ac971347aee84292ed886c1c"
+SRC_URI[sha256sum] = "75bd254871cb5853a6aa0403ac0be270cdd75c9d1b6639f18ecba63c15298e86"
diff --git a/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb b/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb
new file mode 100644
index 0000000..9a9e710
--- /dev/null
+++ b/meta/recipes-extended/perl/libxml-namespacesupport-perl_1.11.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Perl module for supporting simple generic namespaces"
+DESCRIPTION = "XML::NamespaceSupport offers a simple way to process namespace-based XML names. \
+                It also helps maintain a prefix-to-namespace URI map, and provides a number of \
+                basic checks. "
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://META.yml;beginline=22;endline=22;md5=3b2b564dae8b9af9e8896e85c07dcbe5"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/P/PE/PERIGRIN/XML-NamespaceSupport-${PV}.tar.gz"
+SRC_URI[md5sum] = "222cca76161cd956d724286d36b607da"
+SRC_URI[sha256sum] = "6d8151f0a3f102313d76b64bfd1c2d9ed46bfe63a16f038e7d860fda287b74ea"
+
+
+S = "${WORKDIR}/XML-NamespaceSupport-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND="native"
+
diff --git a/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb b/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb
new file mode 100644
index 0000000..14a3370
--- /dev/null
+++ b/meta/recipes-extended/perl/libxml-sax-base-perl_1.08.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Base class SAX Drivers and Filters"
+DESCRIPTION = "This module has a very simple task - to be a base class for \
+PerlSAX drivers and filters. It's default behaviour is to pass \
+the input directly to the output unchanged. It can be useful to \
+use this module as a base class so you don't have to, for example, \
+implement the characters() callback."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+RDEPENDS_${PN} += "perl-module-extutils-makemaker"
+
+LIC_FILES_CHKSUM = "file://dist.ini;endline=5;md5=8f9c9a55340aefaee6e9704c88466446"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GR/GRANTM/XML-SAX-Base-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "38c8c3247dfd080712596118d70dbe32"
+SRC_URI[sha256sum] = "666270318b15f88b8427e585198abbc19bc2e6ccb36dc4c0a4f2d9807330219e"
+
+S = "${WORKDIR}/XML-SAX-Base-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb b/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb
new file mode 100644
index 0000000..45d3966
--- /dev/null
+++ b/meta/recipes-extended/perl/libxml-sax-perl_0.99.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Perl module for using and building Perl SAX2 XML processors"
+DESCRIPTION = "XML::SAX consists of several framework classes for using and \
+building Perl SAX2 XML parsers, filters, and drivers.  It is designed \ 
+around the need to be able to "plug in" different SAX parsers to an \
+application without requiring programmer intervention.  Those of you \
+familiar with the DBI will be right at home.  Some of the designs \
+come from the Java JAXP specification (SAX part), only without the \
+javaness."
+
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+DEPENDS += "libxml-namespacesupport-perl-native"
+RDEPENDS_${PN} += "libxml-namespacesupport-perl libxml-sax-base-perl perl-module-file-temp"
+PR = "r2"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=65c4cd8f39c24c7135ed70dacbcb09e3"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/G/GR/GRANTM/XML-SAX-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "290f5375ae87fdebfdb5bc3854019f24"
+SRC_URI[sha256sum] = "32b04b8e36b6cc4cfc486de2d859d87af5386dd930f2383c49347050d6f5ad84"
+
+S = "${WORKDIR}/XML-SAX-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/pigz/pigz.inc b/meta/recipes-extended/pigz/pigz.inc
new file mode 100644
index 0000000..cb8991d
--- /dev/null
+++ b/meta/recipes-extended/pigz/pigz.inc
@@ -0,0 +1,39 @@
+SUMMARY = "A parallel implementation of gzip"
+DESCRIPTION = "pigz, which stands for parallel implementation of gzip, is a \
+fully functional replacement for gzip that exploits multiple processors and \
+multiple cores to the hilt when compressing data. pigz was written by Mark \
+Adler, and uses the zlib and pthread libraries."
+HOMEPAGE = "http://zlib.net/pigz/"
+SECTION = "console/utils"
+LICENSE = "Zlib & Apache-2.0"
+
+SRC_URI = "http://zlib.net/${BPN}/${BP}.tar.gz"
+
+PROVIDES_class-native += "gzip-native"
+
+DEPENDS = "zlib"
+
+inherit update-alternatives
+
+do_install_class-target() {
+	# Install files into /bin (FHS), which is typical place for gzip
+	install -d ${D}${base_bindir}
+	install ${B}/pigz ${D}${base_bindir}/pigz
+	ln -nsf pigz ${D}${base_bindir}/unpigz
+	ln -nsf pigz ${D}${base_bindir}/pigzcat
+}
+
+do_install() {
+	install -d ${D}${bindir}
+	install ${B}/pigz ${D}${bindir}/gzip
+	ln -nsf gzip ${D}${bindir}/gunzip
+	ln -nsf gzip ${D}${bindir}/zcat
+}
+
+ALTERNATIVE_PRIORITY = "80"
+ALTERNATIVE_${PN} = "gunzip gzip zcat"
+ALTERNATIVE_${PN}_class-nativesdk = ""
+ALTERNATIVE_LINK_NAME[gunzip] = "${base_bindir}/gunzip"
+ALTERNATIVE_LINK_NAME[gzip] = "${base_bindir}/gzip"
+ALTERNATIVE_LINK_NAME[zcat] = "${base_bindir}/zcat"
+ALTERNATIVE_TARGET = "${base_bindir}/pigz"
diff --git a/meta/recipes-extended/pigz/pigz/link-order.patch b/meta/recipes-extended/pigz/pigz/link-order.patch
new file mode 100644
index 0000000..4becc0e
--- /dev/null
+++ b/meta/recipes-extended/pigz/pigz/link-order.patch
@@ -0,0 +1,38 @@
+This patch avoids underlinking issues since we pass -lz via LDFLAGS but it appears
+before pigz.o which needs symbols from libz however due to order linker happily discards libz
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: pigz-2.3.3/Makefile
+===================================================================
+--- pigz-2.3.3.orig/Makefile	2015-01-19 20:12:31.000000000 -0800
++++ pigz-2.3.3/Makefile	2015-01-28 09:11:50.266669184 -0800
+@@ -5,7 +5,7 @@
+ # use gcc and gmake on Solaris
+ 
+ pigz: pigz.o yarn.o try.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
+-	$(CC) $(LDFLAGS) -o pigz $^ -lpthread -lm
++	$(CC) -o pigz $^ $(LDFLAGS) -lz -lpthread -lm
+ 	ln -f pigz unpigz
+ 
+ pigz.o: pigz.c yarn.h try.h ${ZOPFLI}deflate.h ${ZOPFLI}util.h
+@@ -35,7 +35,7 @@
+ dev: pigz pigzt pigzn
+ 
+ pigzt: pigzt.o yarnt.o try.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
+-	$(CC) $(LDFLAGS) -o pigzt $^ -lpthread -lm
++	$(CC) -o pigzt $^ $(LDFLAGS) -lz -lpthread -lm
+ 
+ pigzt.o: pigz.c yarn.h try.h
+ 	$(CC) $(CFLAGS) -DDEBUG -g -c -o pigzt.o pigz.c
+@@ -44,7 +44,7 @@
+ 	$(CC) $(CFLAGS) -DDEBUG -g -c -o yarnt.o yarn.c
+ 
+ pigzn: pigzn.o tryn.o ${ZOPFLI}deflate.o ${ZOPFLI}blocksplitter.o ${ZOPFLI}tree.o ${ZOPFLI}lz77.o ${ZOPFLI}cache.o ${ZOPFLI}hash.o ${ZOPFLI}util.o ${ZOPFLI}squeeze.o ${ZOPFLI}katajainen.o
+-	$(CC) $(LDFLAGS) -o pigzn $^ -lm
++	$(CC) -o pigzn $^ $(LDFLAGS) -lz -lm
+ 
+ pigzn.o: pigz.c try.h
+ 	$(CC) $(CFLAGS) -DDEBUG -DNOTHREAD -g -c -o pigzn.o pigz.c
diff --git a/meta/recipes-extended/pigz/pigz_2.3.3.bb b/meta/recipes-extended/pigz/pigz_2.3.3.bb
new file mode 100644
index 0000000..080be2b
--- /dev/null
+++ b/meta/recipes-extended/pigz/pigz_2.3.3.bb
@@ -0,0 +1,12 @@
+require pigz.inc
+LIC_FILES_CHKSUM = "file://pigz.c;beginline=7;endline=21;md5=a21d4075cb00ab4ca17fce5e7534ca95"
+
+SRC_URI += "file://link-order.patch"
+
+SRC_URI[md5sum] = "01d7a16cce77929cc1a78aa1bdfb68cb"
+SRC_URI[sha256sum] = "4e8b67b432ce7907575a549f3e1cac4709781ba0f6b48afea9f59369846b509c"
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/meta/recipes-extended/procps/procps/fix-configure.patch b/meta/recipes-extended/procps/procps/fix-configure.patch
new file mode 100644
index 0000000..934ae80
--- /dev/null
+++ b/meta/recipes-extended/procps/procps/fix-configure.patch
@@ -0,0 +1,19 @@
+
+exec_prefix is /usr default in OE-Core
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Index: procps-ng-3.3.10/configure.ac
+===================================================================
+--- procps-ng-3.3.10.orig/configure.ac
++++ procps-ng-3.3.10/configure.ac
+@@ -70,7 +70,7 @@ AC_FUNC_MMAP
+ AC_FUNC_REALLOC
+ AC_FUNC_STRTOD
+ 
+-usrbin_execdir='${exec_prefix}/usr/bin'
++usrbin_execdir='${exec_prefix}/bin'
+ AC_SUBST([usrbin_execdir])
+ 
+ AM_GNU_GETTEXT_VERSION([0.14.1])
diff --git a/meta/recipes-extended/procps/procps/sysctl.conf b/meta/recipes-extended/procps/procps/sysctl.conf
new file mode 100644
index 0000000..34e7488
--- /dev/null
+++ b/meta/recipes-extended/procps/procps/sysctl.conf
@@ -0,0 +1,64 @@
+# This configuration file is taken from Debian.
+#
+# /etc/sysctl.conf - Configuration file for setting system variables
+# See sysctl.conf (5) for information.
+#
+
+#kernel.domainname = example.com
+
+# Uncomment the following to stop low-level messages on console
+#kernel.printk = 4 4 1 7
+
+##############################################################3
+# Functions previously found in netbase
+#
+
+# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
+# Turn on Source Address Verification in all interfaces to
+# prevent some spoofing attacks
+net.ipv4.conf.default.rp_filter=1
+net.ipv4.conf.all.rp_filter=1
+
+# Uncomment the next line to enable TCP/IP SYN cookies
+#net.ipv4.tcp_syncookies=1
+
+# Uncomment the next line to enable packet forwarding for IPv4
+#net.ipv4.ip_forward=1
+
+# Uncomment the next line to enable packet forwarding for IPv6
+#net.ipv6.conf.all.forwarding=1
+
+
+###################################################################
+# Additional settings - these settings can improve the network
+# security of the host and prevent against some network attacks
+# including spoofing attacks and man in the middle attacks through
+# redirection. Some network environments, however, require that these
+# settings are disabled so review and enable them as needed.
+#
+# Ignore ICMP broadcasts
+#net.ipv4.icmp_echo_ignore_broadcasts = 1
+#
+# Ignore bogus ICMP errors
+#net.ipv4.icmp_ignore_bogus_error_responses = 1
+#
+# Do not accept ICMP redirects (prevent MITM attacks)
+#net.ipv4.conf.all.accept_redirects = 0
+#net.ipv6.conf.all.accept_redirects = 0
+# _or_
+# Accept ICMP redirects only for gateways listed in our default
+# gateway list (enabled by default)
+# net.ipv4.conf.all.secure_redirects = 1
+#
+# Do not send ICMP redirects (we are not a router)
+#net.ipv4.conf.all.send_redirects = 0
+#
+# Do not accept IP source route packets (we are not a router)
+#net.ipv4.conf.all.accept_source_route = 0
+#net.ipv6.conf.all.accept_source_route = 0
+#
+# Log Martian Packets
+#net.ipv4.conf.all.log_martians = 1
+#
+
+#kernel.shmmax = 141762560
diff --git a/meta/recipes-extended/procps/procps_3.3.10.bb b/meta/recipes-extended/procps/procps_3.3.10.bb
new file mode 100644
index 0000000..dcfaba7
--- /dev/null
+++ b/meta/recipes-extended/procps/procps_3.3.10.bb
@@ -0,0 +1,67 @@
+SUMMARY = "System and process monitoring utilities"
+DESCRIPTION = "Procps contains a set of system utilities that provide system information about processes using \
+the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, and skill."
+HOMEPAGE = "https://gitorious.org/procps"
+SECTION = "base"
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM="file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                  file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \
+                 "
+
+DEPENDS = "ncurses"
+
+inherit autotools gettext pkgconfig update-alternatives
+
+SRC_URI = "http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-${PV}.tar.xz \
+           file://fix-configure.patch \
+           file://sysctl.conf \
+          "
+
+SRC_URI[md5sum] = "1fb7f3f6bf92ce6c5c9ed9949ae858fe"
+SRC_URI[sha256sum] = "a02e6f98974dfceab79884df902ca3df30b0e9bad6d76aee0fb5dce17f267f04"
+
+S = "${WORKDIR}/procps-ng-${PV}"
+
+EXTRA_OECONF = "--enable-skill --disable-modern-top"
+
+CPPFLAGS += "-I${S}"
+
+do_install_append () {
+	install -d ${D}${base_bindir}
+	[ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
+	install -d ${D}${base_sbindir}
+	[ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done
+        if [ "${base_sbindir}" != "${sbindir}" ]; then
+                rmdir ${D}${sbindir}
+        fi
+
+        install -d ${D}${sysconfdir}
+        install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf
+        if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+                install -d ${D}${sysconfdir}/sysctl.d
+                ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf
+        fi
+}
+
+CONFFILES_${PN} = "${sysconfdir}/sysctl.conf"
+
+bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime"
+base_bindir_progs += "kill pidof ps watch"
+base_sbindir_progs += "sysctl"
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}"
+
+ALTERNATIVE_${PN}-doc = "kill.1 uptime.1"
+ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
+ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
+
+python __anonymous() {
+    for prog in d.getVar('base_bindir_progs', True).split():
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
+
+    for prog in d.getVar('base_sbindir_progs', True).split():
+        d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
+}
+
diff --git a/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch b/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch
new file mode 100644
index 0000000..e57d60f
--- /dev/null
+++ b/meta/recipes-extended/psmisc/files/0001-Typo-in-fuser-makes-M-on-all-the-time.patch
@@ -0,0 +1,46 @@
+From 3638cc55b4d08851faba46635d737b24d016665b Mon Sep 17 00:00:00 2001
+From: Brad Jorsch <anomie@users.sourceforge.net>
+Date: Fri, 28 Feb 2014 21:55:02 +1100
+Subject: [PATCH] Typo in fuser makes -M on all the time
+
+Brad found that fuser had the -M option on all the time.
+A simple but significant typo caused this, thanks the the patch.
+
+Bug-Debian: http://bugs.debian.org/740275
+
+Upstream-Status: Backport
+
+Signed-off-by: Craig Small <csmall@enc.com.au>
+---
+ ChangeLog   | 4 ++++
+ src/fuser.c | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index fd1cccf..e5f784c 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++Changes in 22.22
++================
++	* Fixed typo in fuser which has -M on Debian #740275
++
+ Changes in 22.21
+ ================
+ 	* Missing comma in fuser(1) added Debian #702391
+diff --git a/src/fuser.c b/src/fuser.c
+index b485f65..389b302 100644
+--- a/src/fuser.c
++++ b/src/fuser.c
+@@ -1174,7 +1174,7 @@ int main(int argc, char *argv[])
+ 		usage(_("No process specification given"));
+ 
+ 	/* Check if -M flag was used and if so check mounts */
+-	if (opts * OPT_ISMOUNTPOINT) {
++	if (opts & OPT_ISMOUNTPOINT) {
+ 	    check_mountpoints(&mounts, &names_head, &names_tail);
+ 	}
+ 
+-- 
+1.8.4.2
+
diff --git a/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch b/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch
new file mode 100644
index 0000000..c8afcac
--- /dev/null
+++ b/meta/recipes-extended/psmisc/files/0002-Include-limits.h-for-PATH_MAX.patch
@@ -0,0 +1,29 @@
+From aa66afecd8ba9cc4139f25ab15ec315173413a7d Mon Sep 17 00:00:00 2001
+From: Paul Barker <paul@paulbarker.me.uk>
+Date: Wed, 20 Aug 2014 10:31:37 +0000
+Subject: [PATCH] Include <limits.h> for PATH_MAX
+
+When building against musl libc, PATH_MAX is defined in <limits.h>.
+
+Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
+
+Upstream-Status: Accepted (Should be in next release after 22.21)
+---
+ src/pstree.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/pstree.c b/src/pstree.c
+index 071e6c4..0d28260 100644
+--- a/src/pstree.c
++++ b/src/pstree.c
+@@ -41,6 +41,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
++#include <limits.h>
+ 
+ #include "i18n.h"
+ #include "comm.h"
+-- 
+2.0.4
+
diff --git a/meta/recipes-extended/psmisc/psmisc.inc b/meta/recipes-extended/psmisc/psmisc.inc
new file mode 100644
index 0000000..68e0656
--- /dev/null
+++ b/meta/recipes-extended/psmisc/psmisc.inc
@@ -0,0 +1,44 @@
+SUMMARY = "Utilities for managing processes on your system"
+DESCRIPTION = "The psmisc package contains utilities for managing processes on your \
+system: pstree, killall and fuser.  The pstree command displays a tree \
+structure of all of the running processes on your system.  The killall \
+command sends a specified signal (SIGTERM if nothing is specified) to \
+processes identified by name.  The fuser command identifies the PIDs \
+of processes that are using specified files or filesystems."
+SECTION = "base"
+DEPENDS = "ncurses virtual/libintl"
+LICENSE = "GPLv2"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/psmisc/psmisc-${PV}.tar.gz"
+
+S = "${WORKDIR}/psmisc-${PV}"
+
+inherit autotools gettext
+
+ALLOW_EMPTY_${PN} = "1"
+
+PACKAGES =+ "fuser fuser-doc killall killall-doc pstree pstree-doc"
+PACKAGES += "psmisc-extras"
+
+FILES_${PN} = ""
+RDEPENDS_${PN} = "fuser killall pstree"
+
+FILES_fuser = "${bindir}/fuser.${BPN}"
+FILES_fuser-doc = "${mandir}/man1/fuser*"
+
+FILES_killall = "${bindir}/killall.${BPN}"
+FILES_killall-doc = "${mandir}/man1/killall*"
+
+FILES_pstree = "${bindir}/pstree"
+FILES_pstree-doc = "${mandir}/man1/pstree*"
+
+FILES_psmisc-extras = "${bindir}"
+FILES_psmisc-extras-doc = "${mandir}"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "90"
+
+ALTERNATIVE_killall = "killall"
+
+ALTERNATIVE_fuser = "fuser"
diff --git a/meta/recipes-extended/psmisc/psmisc_22.21.bb b/meta/recipes-extended/psmisc/psmisc_22.21.bb
new file mode 100644
index 0000000..66aba9e
--- /dev/null
+++ b/meta/recipes-extended/psmisc/psmisc_22.21.bb
@@ -0,0 +1,10 @@
+require psmisc.inc
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"
+
+SRC_URI[md5sum] = "935c0fd6eb208288262b385fa656f1bf"
+SRC_URI[sha256sum] = "97323cad619210845b696d7d722c383852b2acb5c49b5b0852c4f29c77a8145a"
+
+SRC_URI += "file://0001-Typo-in-fuser-makes-M-on-all-the-time.patch \
+            file://0002-Include-limits.h-for-PATH_MAX.patch \
+            "
diff --git a/meta/recipes-extended/quota/quota/config-tcpwrappers.patch b/meta/recipes-extended/quota/quota/config-tcpwrappers.patch
new file mode 100644
index 0000000..5f47fbd
--- /dev/null
+++ b/meta/recipes-extended/quota/quota/config-tcpwrappers.patch
@@ -0,0 +1,75 @@
+Upstream-Status: Pending
+
+--- quota-tools.orig/configure.in
++++ quota-tools/configure.in
+@@ -151,33 +151,46 @@ AC_SUBST(QUOTA_NETLINK_PROG)
+ AC_SUBST(NETLINKLIBS)
+
+ AC_SEARCH_LIBS(gethostbyname, nsl)
+-AC_MSG_CHECKING(for host_access in -lwrap)
+-AC_CACHE_VAL(ac_cv_lib_wrap_main,
+-	saved_LIBS="$LIBS"
+-	LIBS="$LIBS -lwrap"
+-	[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+-	#include <stdio.h>
+-	#include <sys/types.h>
+-	#include <sys/socket.h>
+-	#include <netinet/in.h>
+-	#include <tcpd.h>
+-	struct request_info request;
+-	int deny_severity, allow_severity;]],[[hosts_access(&request);]])],
+-	dnl We always restore LIBS as we add -lwrap in the next check
+-	[ac_cv_lib_wrap_main=yes; LIBS="$saved_LIBS"; AC_MSG_RESULT(yes)],
+-	[ac_cv_lib_wrap_main=no; LIBS="$saved_LIBS"; AC_MSG_RESULT(no)])
+-	])
+
+-if test ${ac_cv_lib_wrap_main} = yes; then
+-	AC_CHECK_HEADER(tcpd.h,, [
+-		echo 'ERROR: could not find tcpd.h - missing TCP wrappers package'
+-		exit 1
+-	])
+-	LIBS="$LIBS -lwrap"
+-	AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad])
+-	COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS"
++AC_ARG_WITH(tcpwrappers,
++	[  --with-tcpwrappers=[yes/no/try]   Use hosts.allow and hosts.deny for access checking of rpc.rquota [default=yes, if available.]],
++	,
++	with_tcpwrappers="try")
++
++if test "x$with_tcpwrappers" != xno; then
++	AC_MSG_CHECKING(for host_access in -lwrap)
++	AC_CACHE_VAL(ac_cv_lib_wrap_main,
++		saved_LIBS="$LIBS"
++		LIBS="$LIBS -lwrap"
++		[AC_LINK_IFELSE([AC_LANG_PROGRAM([[
++		#include <stdio.h>
++		#include <sys/types.h>
++		#include <sys/socket.h>
++		#include <netinet/in.h>
++		#include <tcpd.h>
++		struct request_info request;
++		int deny_severity, allow_severity;]],[[hosts_access(&request);]])],
++		dnl We always restore LIBS as we add -lwrap in the next try
++		[ac_cv_lib_wrap_main=yes; LIBS="$saved_LIBS"; AC_MSG_RESULT(yes)],
++		[ac_cv_lib_wrap_main=no; LIBS="$saved_LIBS"; AC_MSG_RESULT(no)])
++		])
++
++	if test "x$ac_cv_lib_wrap_main" = xyes; then
++		AC_CHECK_HEADER(tcpd.h,, [
++			if test "x$with_tcpwrappers" != xtry; then
++				AC_MSG_ERROR([could not find tcpd.h - missing TCP wrappers package])
++			fi
++		])
++
++		LIBS="$LIBS -lwrap"
++		AC_DEFINE([HOSTS_ACCESS], 1, [Use hosts.allow and hosts.deny for access checking of rpc.rquotad])
++		COMPILE_OPTS="$COMPILE_OPTS HOSTS_ACCESS"
++	elif test "x$with_tcpwrappers" != xtry; then
++		AC_MSG_ERROR([could not find libwrap - missing TCP wrappers package])
++	fi
+ fi
+
++
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+ AC_C_INLINE
diff --git a/meta/recipes-extended/quota/quota/fcntl.patch b/meta/recipes-extended/quota/quota/fcntl.patch
new file mode 100644
index 0000000..27e60fd
--- /dev/null
+++ b/meta/recipes-extended/quota/quota/fcntl.patch
@@ -0,0 +1,113 @@
+Include fcntl.h to pacify compiler errors on musl
+like
+
+error: unknown type name 'loff_t'
+Cover rpc headers under proper conditional
+Dont use __P its undefined
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ndex: quota-tools/quota.h
+===================================================================
+Index: quota-tools/quota.h
+===================================================================
+--- quota-tools.orig/quota.h
++++ quota-tools/quota.h
+@@ -165,6 +165,6 @@ enum {
+ 	#endif
+ #endif
+ 
+-long quotactl __P((int, const char *, qid_t, caddr_t));
++long quotactl (int, const char *, qid_t, caddr_t);
+ 
+ #endif /* _QUOTA_ */
+Index: quota-tools/quotacheck.c
+===================================================================
+--- quota-tools.orig/quotacheck.c
++++ quota-tools/quotacheck.c
+@@ -19,6 +19,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <errno.h>
++#include <fcntl.h>
+ 
+ #include <sys/stat.h>
+ #include <sys/types.h>
+Index: quota-tools/quotaio.c
+===================================================================
+--- quota-tools.orig/quotaio.c
++++ quota-tools/quotaio.c
+@@ -12,6 +12,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <stdlib.h>
++#include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+Index: quota-tools/dqblk_v2.h
+===================================================================
+--- quota-tools.orig/dqblk_v2.h
++++ quota-tools/dqblk_v2.h
+@@ -7,6 +7,7 @@
+ #ifndef GUARD_DQBLK_V2_H
+ #define GUARD_DQBLK_V2_H
+ 
++#include <fcntl.h>
+ #include <sys/types.h>
+ #include "quota_tree.h"
+ 
+Index: quota-tools/quotaops.c
+===================================================================
+--- quota-tools.orig/quotaops.c
++++ quota-tools/quotaops.c
+@@ -34,7 +34,9 @@
+ 
+ #include "config.h"
+ 
++#if defined(RPC)
+ #include <rpc/rpc.h>
++#endif
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/file.h>
+Index: quota-tools/rquota_client.c
+===================================================================
+--- quota-tools.orig/rquota_client.c
++++ quota-tools/rquota_client.c
+@@ -19,7 +19,9 @@
+ 
+ #include "config.h"
+ 
++#if defined(RPC)
+ #include <rpc/rpc.h>
++#endif
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/stat.h>
+@@ -35,7 +37,9 @@
+ #include <stdint.h>
+ 
+ #include "mntopt.h"
++#if defined(RPC)
+ #include "rquota.h"
++#endif
+ #include "common.h"
+ #include "quotaio.h"
+ #include "quotasys.h"
+Index: quota-tools/setquota.c
+===================================================================
+--- quota-tools.orig/setquota.c
++++ quota-tools/setquota.c
+@@ -7,7 +7,9 @@
+ 
+ #include "config.h"
+ 
++#if defined(RPC)
+ #include <rpc/rpc.h>
++#endif
+ #include <sys/types.h>
+ #include <errno.h>
+ #include <stdio.h>
diff --git a/meta/recipes-extended/quota/quota/remove_non_posix_types.patch b/meta/recipes-extended/quota/quota/remove_non_posix_types.patch
new file mode 100644
index 0000000..5442d98
--- /dev/null
+++ b/meta/recipes-extended/quota/quota/remove_non_posix_types.patch
@@ -0,0 +1,185 @@
+Use proper C99 integer types
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: quota-tools/bylabel.c
+===================================================================
+--- quota-tools.orig/bylabel.c
++++ quota-tools/bylabel.c
+@@ -20,6 +20,7 @@
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <unistd.h>
++#include <stdint.h>
+ 
+ #include "bylabel.h"
+ #include "common.h"
+@@ -37,32 +38,32 @@ static struct uuidCache_s {
+ 
+ #define EXT2_SUPER_MAGIC	0xEF53
+ struct ext2_super_block {
+-	u_char s_dummy1[56];
+-	u_char s_magic[2];
+-	u_char s_dummy2[46];
+-	u_char s_uuid[16];
+-	u_char s_volume_name[16];
++	uint8_t s_dummy1[56];
++	uint8_t s_magic[2];
++	uint8_t s_dummy2[46];
++	uint8_t s_uuid[16];
++	uint8_t s_volume_name[16];
+ };
+ 
+-#define ext2magic(s)	((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8))
++#define ext2magic(s)	((uint32_t) s.s_magic[0] + (((uint32_t) s.s_magic[1]) << 8))
+ 
+ #define XFS_SUPER_MAGIC "XFSB"
+ #define XFS_SUPER_MAGIC2 "BSFX"
+ struct xfs_super_block {
+-	u_char s_magic[4];
+-	u_char s_dummy[28];
+-	u_char s_uuid[16];
+-	u_char s_dummy2[60];
+-	u_char s_fsname[12];
++	uint8_t s_magic[4];
++	uint8_t s_dummy[28];
++	uint8_t s_uuid[16];
++	uint8_t s_dummy2[60];
++	uint8_t s_fsname[12];
+ };
+ 
+ #define REISER_SUPER_MAGIC	"ReIsEr2Fs"
+ struct reiserfs_super_block {
+-	u_char s_dummy1[52];
+-	u_char s_magic[10];
+-	u_char s_dummy2[22];
+-	u_char s_uuid[16];
+-	u_char s_volume_name[16];
++	uint8_t s_dummy1[52];
++	uint8_t s_magic[10];
++	uint8_t s_dummy2[22];
++	uint8_t s_uuid[16];
++	uint8_t s_volume_name[16];
+ };
+ 
+ static inline unsigned short swapped(unsigned short a)
+@@ -222,7 +223,7 @@ static char *get_spec_by_x(int n, const
+ 	return NULL;
+ }
+ 
+-static u_char fromhex(char c)
++static uint8_t fromhex(char c)
+ {
+ 	if (isdigit(c))
+ 		return (c - '0');
+@@ -234,7 +235,7 @@ static u_char fromhex(char c)
+ 
+ static char *get_spec_by_uuid(const char *s)
+ {
+-	u_char uuid[16];
++	uint8_t uuid[16];
+ 	int i;
+ 
+ 	if (strlen(s) != 36 || s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-')
+Index: quota-tools/quot.c
+===================================================================
+--- quota-tools.orig/quot.c
++++ quota-tools/quot.c
+@@ -47,6 +47,7 @@
+ #include <utmp.h>
+ #include <pwd.h>
+ #include <grp.h>
++#include <stdint.h>
+ 
+ #include "pot.h"
+ #include "quot.h"
+@@ -56,8 +57,8 @@
+ #include "quotasys.h"
+ 
+ #define	TSIZE	500
+-static __uint64_t sizes[TSIZE];
+-static __uint64_t overflow;
++static uint64_t sizes[TSIZE];
++static uint64_t overflow;
+ 
+ static int aflag;
+ static int cflag;
+@@ -72,7 +73,7 @@ static time_t now;
+ char *progname;
+ 
+ static void mounttable(void);
+-static char *idname(__uint32_t, int);
++static char *idname(uint32_t, int);
+ static void report(const char *, const char *, int);
+ static void creport(const char *, const char *);
+ 
+@@ -173,7 +174,7 @@ static int qcmp(du_t * p1, du_t * p2)
+ static void creport(const char *file, const char *fsdir)
+ {
+ 	int i;
+-	__uint64_t t = 0;
++	uint64_t t = 0;
+ 
+ 	printf(_("%s (%s):\n"), file, fsdir);
+ 	for (i = 0; i < TSIZE - 1; i++)
+@@ -219,7 +220,7 @@ static void report(const char *file, con
+ 	}
+ }
+ 
+-static idcache_t *getnextent(int type, __uint32_t id, int byid)
++static idcache_t *getnextent(int type, uint32_t id, int byid)
+ {
+ 	struct passwd *pw;
+ 	struct group  *gr;
+@@ -240,7 +241,7 @@ static idcache_t *getnextent(int type, _
+ 	return &idc;
+ }
+ 
+-static char *idname(__uint32_t id, int type)
++static char *idname(uint32_t id, int type)
+ {
+ 	idcache_t *ncp, *idp;
+ 	static idcache_t nc[2][NID];
+@@ -286,8 +287,8 @@ static void acctXFS(xfs_bstat_t *p)
+ {
+ 	register du_t *dp;
+ 	du_t **hp;
+-	__uint64_t size;
+-	__uint32_t i, id;
++	uint64_t size;
++	uint32_t i, id;
+ 
+ 	if ((p->bs_mode & S_IFMT) == 0)
+ 		return;
+Index: quota-tools/quot.h
+===================================================================
+--- quota-tools.orig/quot.h
++++ quota-tools/quot.h
+@@ -35,18 +35,18 @@
+ #define	SEC24HR	(60*60*24)	/* seconds per day */
+ 
+ typedef struct {
+-	__uint32_t id;
++	uint32_t id;
+ 	char name[UT_NAMESIZE + 1];
+ } idcache_t;
+ 
+ typedef struct du {
+ 	struct du *next;
+-	__uint64_t blocks;
+-	__uint64_t blocks30;
+-	__uint64_t blocks60;
+-	__uint64_t blocks90;
+-	__uint64_t nfiles;
+-	__uint32_t id;
++	uint64_t blocks;
++	uint64_t blocks30;
++	uint64_t blocks60;
++	uint64_t blocks90;
++	uint64_t nfiles;
++	uint32_t id;
+ } du_t;
+ 
+ #define	NDU	60000
diff --git a/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch b/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch
new file mode 100644
index 0000000..9ca2ffc
--- /dev/null
+++ b/meta/recipes-extended/quota/quota/replace_getrpcbynumber_r.patch
@@ -0,0 +1,20 @@
+Replace getrpcbynumber_r with getrpcbynumber
+musl and uclibc dont implement it
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: quota-tools/svc_socket.c
+===================================================================
+--- quota-tools.orig/svc_socket.c
++++ quota-tools/svc_socket.c
+@@ -55,7 +55,8 @@ static int svc_socket (u_long number, in
+ 	addr.sin_family = AF_INET;
+ 
+ 	if (!port) {
+-		ret = getrpcbynumber_r(number, &rpcbuf, rpcdata, sizeof(rpcdata), &rpcp);
++		rpcp = getrpcbynumber(number);
++		ret = 0;
+ 		if (ret == 0 && rpcp != NULL) {
+ 			/* First try name */
+ 			ret = getservbyname_r(rpcp->r_name, proto, &servbuf, servdata,
diff --git a/meta/recipes-extended/quota/quota_4.02.bb b/meta/recipes-extended/quota/quota_4.02.bb
new file mode 100644
index 0000000..124b0a3
--- /dev/null
+++ b/meta/recipes-extended/quota/quota_4.02.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Tools for monitoring & limiting user disk usage per filesystem"
+SECTION = "base"
+HOMEPAGE = "http://sourceforge.net/projects/linuxquota/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=18136&atid=118136"
+LICENSE = "BSD & GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://quota.c;beginline=1;endline=33;md5=331c7d77744bfe0ad24027f0651028ec \
+                    file://rquota_server.c;beginline=1;endline=20;md5=fe7e0d7e11c6f820f8fa62a5af71230f \
+                    file://svc_socket.c;beginline=1;endline=17;md5=24d5a8792da45910786eeac750be8ceb"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/linuxquota/quota-tools/${PV}/quota-${PV}.tar.gz \
+           file://config-tcpwrappers.patch \
+           file://fcntl.patch \
+           file://remove_non_posix_types.patch \
+	   "
+SRC_URI_append_libc-musl = " file://replace_getrpcbynumber_r.patch"
+
+SRC_URI[md5sum] = "a8a5df262261e659716ccad2a5d6df0d"
+SRC_URI[sha256sum] = "f4c2f48abf94bbdc396df33d276f2e9d19af58c232cb85eef9c174a747c33795"
+
+S = "${WORKDIR}/quota-tools"
+
+DEPENDS = "gettext-native e2fsprogs"
+
+inherit autotools-brokensep gettext pkgconfig
+
+CFLAGS += "-I=${includedir}/tirpc"
+LDFLAGS += "-ltirpc"
+ASNEEDED = ""
+EXTRA_OEMAKE += 'STRIP=""'
+
+PACKAGECONFIG ??= "tcp-wrappers rpc bsd"
+PACKAGECONFIG_libc-musl = "tcp-wrappers rpc"
+
+PACKAGECONFIG[tcp-wrappers] = "--with-tcpwrappers,--without-tcpwrappers,tcp-wrappers"
+PACKAGECONFIG[rpc] = "--enable-rpc=yes,--enable-rpc=no,libtirpc"
+PACKAGECONFIG[bsd] = "--enable-bsd_behaviour=yes,--enable-bsd_behaviour=no,"
+
+do_install() {
+	oe_runmake ROOTDIR=${D} install
+}
diff --git a/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch b/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch
new file mode 100644
index 0000000..eeef9f1
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch
@@ -0,0 +1,221 @@
+From 2a44d862233f2126581e290d568e1c8b8f2eb9f5 Mon Sep 17 00:00:00 2001
+From: Carlo Landmeter <clandmeter@gmail.com>
+Date: Thu, 19 Feb 2015 15:28:45 +0000
+Subject: [PATCH] Avoid use of glibc sys/cdefs.h header
+
+Upstream-Status: Pending
+---
+ src/check_bound.c  |    2 +-
+ src/pmap_svc.c     |   10 +++++-----
+ src/rpcb_svc.c     |   10 +++++-----
+ src/rpcb_svc_4.c   |   14 +++++++-------
+ src/rpcb_svc_com.c |   46 +++++++++++++++++++++++-----------------------
+ src/rpcbind.c      |   12 ++++++------
+ src/util.c         |    2 +-
+ src/warmstart.c    |    4 ++--
+ 8 files changed, 50 insertions(+), 50 deletions(-)
+
+diff --git a/src/check_bound.c b/src/check_bound.c
+index c70b845..5d21730 100644
+--- a/src/check_bound.c
++++ b/src/check_bound.c
+@@ -70,7 +70,7 @@ static struct fdlist *fdhead;	/* Link list of the check fd's */
+ static struct fdlist *fdtail;
+ static char *nullstring = "";
+ 
+-static bool_t check_bound __P((struct fdlist *, char *uaddr));
++static bool_t check_bound (struct fdlist *, char *uaddr);
+ 
+ /*
+  * Returns 1 if the given address is bound for the given addr & transport
+diff --git a/src/pmap_svc.c b/src/pmap_svc.c
+index ad28b93..9c7d409 100644
+--- a/src/pmap_svc.c
++++ b/src/pmap_svc.c
+@@ -60,11 +60,11 @@ static	char sccsid[] = "@(#)pmap_svc.c 1.23 89/04/05 Copyr 1984 Sun Micro";
+ #include "rpcbind.h"
+ #include "xlog.h"
+ #include <rpc/svc_soc.h> /* svc_getcaller routine definition */
+-static struct pmaplist *find_service_pmap __P((rpcprog_t, rpcvers_t,
+-					       rpcprot_t));
+-static bool_t pmapproc_change __P((struct svc_req *, SVCXPRT *, u_long));
+-static bool_t pmapproc_getport __P((struct svc_req *, SVCXPRT *));
+-static bool_t pmapproc_dump __P((struct svc_req *, SVCXPRT *));
++static struct pmaplist *find_service_pmap (rpcprog_t, rpcvers_t,
++					       rpcprot_t);
++static bool_t pmapproc_change (struct svc_req *, SVCXPRT *, u_long);
++static bool_t pmapproc_getport (struct svc_req *, SVCXPRT *);
++static bool_t pmapproc_dump (struct svc_req *, SVCXPRT *);
+ 
+ /*
+  * Called for all the version 2 inquiries.
+diff --git a/src/rpcb_svc.c b/src/rpcb_svc.c
+index bd92201..6c7f7fe 100644
+--- a/src/rpcb_svc.c
++++ b/src/rpcb_svc.c
+@@ -53,10 +53,10 @@
+ #include "rpcbind.h"
+ #include "xlog.h"
+ 
+-static void *rpcbproc_getaddr_3_local __P((void *, struct svc_req *, SVCXPRT *,
+-					   rpcvers_t));
+-static void *rpcbproc_dump_3_local __P((void *, struct svc_req *, SVCXPRT *,
+-					rpcvers_t));
++static void *rpcbproc_getaddr_3_local (void *, struct svc_req *, SVCXPRT *,
++					   rpcvers_t);
++static void *rpcbproc_dump_3_local (void *, struct svc_req *, SVCXPRT *,
++					rpcvers_t);
+ 
+ /*
+  * Called by svc_getreqset. There is a separate server handle for
+@@ -75,7 +75,7 @@ rpcb_service_3(struct svc_req *rqstp, SVCXPRT *transp)
+ 	} argument;
+ 	char *result;
+ 	xdrproc_t xdr_argument, xdr_result;
+-	void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++	void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+ 	rpcprog_t setprog = 0;
+ 
+ 	rpcbs_procinfo(RPCBVERS_3_STAT, rqstp->rq_proc);
+diff --git a/src/rpcb_svc_4.c b/src/rpcb_svc_4.c
+index b673452..6764c0a 100644
+--- a/src/rpcb_svc_4.c
++++ b/src/rpcb_svc_4.c
+@@ -54,13 +54,13 @@
+ #include "rpcbind.h"
+ #include "xlog.h"
+ 
+-static void *rpcbproc_getaddr_4_local __P((void *, struct svc_req *, SVCXPRT *,
+-				      rpcvers_t));
+-static void *rpcbproc_getversaddr_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++static void *rpcbproc_getaddr_4_local (void *, struct svc_req *, SVCXPRT *,
++				      rpcvers_t);
++static void *rpcbproc_getversaddr_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+ static void *rpcbproc_getaddrlist_4_local
+-	__P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
+-static void free_rpcb_entry_list __P((rpcb_entry_list_ptr *));
+-static void *rpcbproc_dump_4_local __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++	(void *, struct svc_req *, SVCXPRT *, rpcvers_t);
++static void free_rpcb_entry_list (rpcb_entry_list_ptr *);
++static void *rpcbproc_dump_4_local (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+ 
+ /*
+  * Called by svc_getreqset. There is a separate server handle for
+@@ -78,7 +78,7 @@ rpcb_service_4(struct svc_req *rqstp, SVCXPRT *transp)
+ 	} argument;
+ 	char *result;
+ 	xdrproc_t xdr_argument, xdr_result;
+-	void *(*local) __P((void *, struct svc_req *, SVCXPRT *, rpcvers_t));
++	void *(*local) (void *, struct svc_req *, SVCXPRT *, rpcvers_t);
+ 	rpcprog_t setprog = 0;
+ 
+ 	rpcbs_procinfo(RPCBVERS_4_STAT, rqstp->rq_proc);
+diff --git a/src/rpcb_svc_com.c b/src/rpcb_svc_com.c
+index ff9ce6b..8aef9e5 100644
+--- a/src/rpcb_svc_com.c
++++ b/src/rpcb_svc_com.c
+@@ -100,29 +100,29 @@ struct finfo {
+ static struct finfo     FINFO[NFORWARD];
+ 
+ 
+-static bool_t xdr_encap_parms __P((XDR *, struct encap_parms *));
+-static bool_t xdr_rmtcall_args __P((XDR *, struct r_rmtcall_args *));
+-static bool_t xdr_rmtcall_result __P((XDR *, struct r_rmtcall_args *));
+-static bool_t xdr_opaque_parms __P((XDR *, struct r_rmtcall_args *));
+-static int find_rmtcallfd_by_netid __P((char *));
+-static SVCXPRT *find_rmtcallxprt_by_fd __P((int));
+-static int forward_register __P((u_int32_t, struct netbuf *, int, char *,
+-    rpcproc_t, rpcvers_t, u_int32_t *));
+-static struct finfo *forward_find __P((u_int32_t));
+-static int free_slot_by_xid __P((u_int32_t));
+-static int free_slot_by_index __P((int));
+-static int netbufcmp __P((struct netbuf *, struct netbuf *));
+-static struct netbuf *netbufdup __P((struct netbuf *));
+-static void netbuffree __P((struct netbuf *));
+-static int check_rmtcalls __P((struct pollfd *, int));
+-static void xprt_set_caller __P((SVCXPRT *, struct finfo *));
+-static void send_svcsyserr __P((SVCXPRT *, struct finfo *));
+-static void handle_reply __P((int, SVCXPRT *));
+-static void find_versions __P((rpcprog_t, char *, rpcvers_t *, rpcvers_t *));
+-static rpcblist_ptr find_service __P((rpcprog_t, rpcvers_t, char *));
+-static char *getowner __P((SVCXPRT *, char *, size_t));
+-static int add_pmaplist __P((RPCB *));
+-static int del_pmaplist __P((RPCB *));
++static bool_t xdr_encap_parms (XDR *, struct encap_parms *);
++static bool_t xdr_rmtcall_args (XDR *, struct r_rmtcall_args *);
++static bool_t xdr_rmtcall_result (XDR *, struct r_rmtcall_args *);
++static bool_t xdr_opaque_parms (XDR *, struct r_rmtcall_args *);
++static int find_rmtcallfd_by_netid (char *);
++static SVCXPRT *find_rmtcallxprt_by_fd (int);
++static int forward_register (u_int32_t, struct netbuf *, int, char *,
++    rpcproc_t, rpcvers_t, u_int32_t *);
++static struct finfo *forward_find (u_int32_t);
++static int free_slot_by_xid (u_int32_t);
++static int free_slot_by_index (int);
++static int netbufcmp (struct netbuf *, struct netbuf *);
++static struct netbuf *netbufdup (struct netbuf *);
++static void netbuffree (struct netbuf *);
++static int check_rmtcalls (struct pollfd *, int);
++static void xprt_set_caller (SVCXPRT *, struct finfo *);
++static void send_svcsyserr (SVCXPRT *, struct finfo *);
++static void handle_reply (int, SVCXPRT *);
++static void find_versions (rpcprog_t, char *, rpcvers_t *, rpcvers_t *);
++static rpcblist_ptr find_service (rpcprog_t, rpcvers_t, char *);
++static char *getowner (SVCXPRT *, char *, size_t);
++static int add_pmaplist (RPCB *);
++static int del_pmaplist (RPCB *);
+ 
+ /*
+  * Set a mapping of program, version, netid
+diff --git a/src/rpcbind.c b/src/rpcbind.c
+index 045daa1..137011b 100644
+--- a/src/rpcbind.c
++++ b/src/rpcbind.c
+@@ -135,13 +135,13 @@ char *tcp_uaddr;	/* Universal TCP address */
+ static char servname[] = "rpcbind";
+ static char superuser[] = "superuser";
+ 
+-int main __P((int, char *[]));
++int main (int, char *[]);
+ 
+-static int init_transport __P((struct netconfig *));
+-static void rbllist_add __P((rpcprog_t, rpcvers_t, struct netconfig *,
+-			     struct netbuf *));
+-static void terminate __P((int));
+-static void parseargs __P((int, char *[]));
++static int init_transport (struct netconfig *);
++static void rbllist_add (rpcprog_t, rpcvers_t, struct netconfig *,
++			     struct netbuf *);
++static void terminate (int);
++static void parseargs (int, char *[]);
+ 
+ int
+ main(int argc, char *argv[])
+diff --git a/src/util.c b/src/util.c
+index a6c835b..33b9e4f 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -70,7 +70,7 @@ static struct sockaddr_in *local_in4;
+ static struct sockaddr_in6 *local_in6;
+ #endif
+ 
+-static int bitmaskcmp __P((void *, void *, void *, int));
++static int bitmaskcmp (void *, void *, void *, int);
+ 
+ /*
+  * For all bits set in "mask", compare the corresponding bits in
+diff --git a/src/warmstart.c b/src/warmstart.c
+index b6eb73e..42dd3af 100644
+--- a/src/warmstart.c
++++ b/src/warmstart.c
+@@ -58,8 +58,8 @@
+ #define	PMAPFILE	RPCBIND_STATEDIR "/portmap.xdr"
+ #endif
+ 
+-static bool_t write_struct __P((char *, xdrproc_t, void *));
+-static bool_t read_struct __P((char *, xdrproc_t, void *));
++static bool_t write_struct (char *, xdrproc_t, void *);
++static bool_t read_struct (char *, xdrproc_t, void *);
+ 
+ static bool_t
+ write_struct(char *filename, xdrproc_t structproc, void *list)
diff --git a/meta/recipes-extended/rpcbind/rpcbind/0001-uclibc-nss.patch b/meta/recipes-extended/rpcbind/rpcbind/0001-uclibc-nss.patch
new file mode 100644
index 0000000..afa55f3
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/0001-uclibc-nss.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Pending
+
+From b8f0d7b7318ba344c25785d6f5cf3f8de98012d4 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Tue, 2 Feb 2010 09:36:03 +0000
+Subject: [PATCH 1/2] uclibc-nss
+
+---
+ src/rpcbind.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/src/rpcbind.c b/src/rpcbind.c
+index 525ffba..1fe1a60 100644
+--- a/src/rpcbind.c
++++ b/src/rpcbind.c
+@@ -67,7 +67,11 @@
+ #include <pwd.h>
+ #include <string.h>
+ #include <errno.h>
++#if defined(__UCLIBC__)
++#define __nss_configure_lookup(x,y)
++#else
+ #include <nss.h>
++#endif
+ #include "config.h"
+ #include "rpcbind.h"
+ 
+-- 
+1.6.6.1
+
diff --git a/meta/recipes-extended/rpcbind/rpcbind/init.d b/meta/recipes-extended/rpcbind/rpcbind/init.d
new file mode 100644
index 0000000..67499aa
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/init.d
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+# start/stop rpcbind daemon.
+
+### BEGIN INIT INFO
+# Provides:          rpcbind
+# Required-Start:    $network
+# Required-Stop:     $network
+# Default-Start:     S 2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: RPC portmapper replacement
+# Description:       rpcbind is a server that converts RPC (Remote
+#                    Procedure Call) program numbers into DARPA
+#                    protocol port numbers. It must be running in
+#                    order to make RPC calls. Services that use
+#                    RPC include NFS and NIS.
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+test -f /sbin/rpcbind || exit 0
+
+OPTIONS=""
+if [ -f /etc/default/rpcbind ]
+then
+    . /etc/default/rpcbind
+elif [ -f /etc/rpcbind.conf ]
+then
+    . /etc/rpcbind.conf
+fi
+
+start ()
+{
+    echo -n "Starting rpcbind daemon..."
+    if pidof /sbin/rpcbind >/dev/null; then
+        echo "already running."
+        exit 0
+    fi
+    start-stop-daemon --start --quiet --exec /sbin/rpcbind -- "$@"
+    if [ $? -eq 0 ]; then
+        echo "done."
+    else
+        echo "failed."
+    fi
+}
+
+stop ()
+{
+    echo "Stopping rpcbind daemon..."
+    if ! pidof /sbin/rpcbind >/dev/null; then
+        echo "not running."
+        return 0
+    fi
+    start-stop-daemon --stop --quiet --exec /sbin/rpcbind
+    if [ $? -eq 0 ]; then
+        echo "done."
+    else
+        echo "failed."
+    fi
+}
+
+case "$1" in
+    start)
+        start $OPTIONS
+        ;;
+    stop)
+        stop
+        ;;
+    force-reload)
+        stop
+        start $OPTIONS
+        ;;
+    restart)
+        stop
+        start $OPTIONS
+        ;;
+    status)
+        status /sbin/rpcbind
+        ;;
+    *)
+        echo "Usage: /etc/init.d/rpcbind {start|stop|force-reload|restart|status}"
+        exit 1
+        ;;
+esac
+
+exit $?
diff --git a/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch b/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
new file mode 100644
index 0000000..9c72a1b
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/musl-sunrpc.patch
@@ -0,0 +1,29 @@
+The musl implementation of getaddrinfo and getservbyname does not
+aliases. As a workaround we use "sunprc" instead of "portmapper"
+
+ported from alpine linux
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: rpcbind-0.2.2/src/rpcbind.c
+===================================================================
+--- rpcbind-0.2.2.orig/src/rpcbind.c
++++ rpcbind-0.2.2/src/rpcbind.c
+@@ -491,7 +491,7 @@ init_transport(struct netconfig *nconf)
+ 			if ((aicode = getaddrinfo(hosts[nhostsbak],
+ 			    servname, &hints, &res)) != 0) {
+ 			  if ((aicode = getaddrinfo(hosts[nhostsbak],
+-						    "portmapper", &hints, &res)) != 0) {
++						    "sunrpc", &hints, &res)) != 0) {
+ 				syslog(LOG_ERR,
+ 				    "cannot get local address for %s: %s",
+ 				    nconf->nc_netid, gai_strerror(aicode));
+@@ -564,7 +564,7 @@ init_transport(struct netconfig *nconf)
+ 		if ((strcmp(nconf->nc_netid, "local") != 0) &&
+ 		    (strcmp(nconf->nc_netid, "unix") != 0)) {
+ 			if ((aicode = getaddrinfo(NULL, servname, &hints, &res))!= 0) {
+-			  if ((aicode = getaddrinfo(NULL, "portmapper", &hints, &res))!= 0) {
++			  if ((aicode = getaddrinfo(NULL, "sunrpc", &hints, &res))!= 0) {
+ 			  printf("cannot get local address for %s: %s",  nconf->nc_netid, gai_strerror(aicode));
+ 			  syslog(LOG_ERR,
+ 				    "cannot get local address for %s: %s",
diff --git a/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch b/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch
new file mode 100644
index 0000000..84fc974
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/remove-sys-queue.patch
@@ -0,0 +1,22 @@
+musl does not provide this header and here is reasoning
+http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_sys.2Fqueue.h_not_included_.3F
+
+So include it only when __GLIBC__ is defined which is true for uclibc and glibc
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+Index: rpcbind-0.2.2/src/util.c
+===================================================================
+--- rpcbind-0.2.2.orig/src/util.c
++++ rpcbind-0.2.2/src/util.c
+@@ -41,7 +41,9 @@
+ 
+ #include <sys/types.h>
+ #include <sys/socket.h>
++#ifdef __GLIBC__
+ #include <sys/queue.h>
++#endif
+ #include <net/if.h>
+ #include <netinet/in.h>
+ #include <ifaddrs.h>
diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf
new file mode 100644
index 0000000..2a4dfbc
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.conf
@@ -0,0 +1,3 @@
+# Optional arguments passed to rpcbind.
+#
+RPCBIND_OPTS=""
diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
new file mode 100644
index 0000000..b3ae254
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=RPC Bind Service
+Requires=rpcbind.socket
+
+[Service]
+Type=forking
+EnvironmentFile=-@SYSCONFDIR@/rpcbind.conf
+ExecStart=@SBINDIR@/rpcbind -w $RPCBIND_OPTS
+SuccessExitStatus=2
+
+[Install]
+Also=rpcbind.socket
diff --git a/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket
new file mode 100644
index 0000000..d63c1d9
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind/rpcbind.socket
@@ -0,0 +1,8 @@
+[Unit]
+Description=RPCbind Server Activation Socket
+
+[Socket]
+ListenStream=/var/run/rpcbind.sock
+
+[Install]
+WantedBy=sockets.target
diff --git a/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb b/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb
new file mode 100644
index 0000000..3336021
--- /dev/null
+++ b/meta/recipes-extended/rpcbind/rpcbind_0.2.3.bb
@@ -0,0 +1,73 @@
+SUMMARY = "Universal Addresses to RPC Program Number Mapper"
+DESCRIPTION = "The rpcbind utility is a server that converts RPC \
+               program numbers into universal addresses."
+SECTION = "console/network"
+HOMEPAGE = "http://sourceforge.net/projects/rpcbind/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=201237&atid=976751"
+DEPENDS = "libtirpc quota"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b46486e4c4a416602693a711bb5bfa39 \
+                    file://src/rpcinfo.c;beginline=1;endline=27;md5=f8a8cd2cb25ac5aa16767364fb0e3c24"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/rpcbind/rpcbind-${PV}.tar.bz2 \
+           file://init.d \
+           file://0001-Avoid-use-of-glibc-sys-cdefs.h-header.patch \
+           file://remove-sys-queue.patch \
+           ${UCLIBCPATCHES} \
+           ${MUSLPATCHES} \
+           file://rpcbind.conf \
+           file://rpcbind.socket \
+           file://rpcbind.service \
+          "
+MUSLPATCHES_libc-musl = "file://musl-sunrpc.patch"
+
+UCLIBCPATCHES_libc-uclibc = "file://0001-uclibc-nss.patch \
+                            "
+UCLIBCPATCHES ?= ""
+MUSLPATCHES ?= ""
+
+SRC_URI[md5sum] = "c8875246b2688a1adfbd6ad43480278d"
+SRC_URI[sha256sum] = "9897823a9d820ea011d9ea02054d5ab99469b9ca5346265fee380713c8fed27b"
+
+inherit autotools update-rc.d systemd pkgconfig
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers"
+
+INITSCRIPT_NAME = "rpcbind"
+INITSCRIPT_PARAMS = "start 12 2 3 4 5 . stop 60 0 1 6 ."
+
+SYSTEMD_SERVICE_${PN} = "rpcbind.service"
+
+inherit useradd
+
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --no-create-home --home-dir / \
+                       --shell /bin/false --user-group rpc"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/, \
+                          --without-systemdsystemunitdir, \
+                          systemd \
+"
+
+EXTRA_OECONF += " --enable-warmstarts --with-rpcuser=rpc"
+
+do_install_append () {
+	mv ${D}${bindir} ${D}${sbindir}
+
+	install -d ${D}${sysconfdir}/init.d
+	sed -e 's,/etc/,${sysconfdir}/,g' \
+		-e 's,/sbin/,${sbindir}/,g' \
+		${WORKDIR}/init.d > ${D}${sysconfdir}/init.d/rpcbind
+	chmod 0755 ${D}${sysconfdir}/init.d/rpcbind
+
+	install -m 0755 ${WORKDIR}/rpcbind.conf ${D}${sysconfdir}
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/rpcbind.socket ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/rpcbind.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@SBINDIR@,${sbindir},g' \
+		-e 's,@SYSCONFDIR@,${sysconfdir},g' \
+		${D}${systemd_unitdir}/system/rpcbind.service
+}
diff --git a/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch b/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch
new file mode 100644
index 0000000..40ecef0
--- /dev/null
+++ b/meta/recipes-extended/screen/screen/0001-fix-for-multijob-build.patch
@@ -0,0 +1,58 @@
+Upstream-Status: Backport
+
+Backport patch to fix parallel build failure and update context to make patch
+coulde be applied.
+
+http://git.savannah.gnu.org/cgit/screen.git/commit?id=c0de6dd
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From c0de6dd7970b2c7b426a5c39dcbc31c2bef87232 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= <amade@asmblr.net>
+Date: Thu, 2 Jan 2014 18:18:06 +0100
+Subject: [PATCH] fix for multijob build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+make sure that comm.sh script generates comm.h header before doing
+anything else
+
+Signed-off-by: Amadeusz Sławiński <amade@asmblr.net>
+---
+ Makefile.in | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index ce86cbc..dea16d8 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -298,7 +298,7 @@ search.o: layout.h viewport.h canvas.h search.c config.h screen.h os.h osdef.h a
+  comm.h layer.h term.h image.h display.h window.h mark.h extern.h
+ tty.o: layout.h viewport.h canvas.h tty.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
+  layer.h term.h image.h display.h window.h extern.h
+-term.o: layout.h viewport.h canvas.h term.c term.h
++term.o: layout.h viewport.h canvas.h term.c term.h comm.h
+ window.o: layout.h viewport.h canvas.h window.c config.h screen.h os.h osdef.h ansi.h acls.h \
+  comm.h layer.h term.h image.h display.h window.h extern.h logfile.h
+ utmp.o: layout.h viewport.h canvas.h utmp.c config.h screen.h os.h osdef.h ansi.h acls.h \
+@@ -324,7 +324,7 @@ canvas.o: layout.h viewport.h canvas.h canvas.c config.h screen.h os.h osdef.h a
+  comm.h layer.h term.h image.h display.h window.h extern.h \
+  braille.h
+ comm.o: layout.h viewport.h canvas.h comm.c config.h acls.h comm.h
+-kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h
++kmapdef.o: layout.h viewport.h canvas.h kmapdef.c config.h comm.h
+ acls.o: layout.h viewport.h canvas.h acls.c config.h screen.h os.h osdef.h ansi.h acls.h comm.h \
+  layer.h term.h image.h display.h window.h extern.h
+ braille.o: layout.h viewport.h canvas.h braille.c config.h screen.h os.h osdef.h ansi.h acls.h \
+@@ -350,7 +350,7 @@ layout.o: layout.h viewport.h canvas.h layout.c config.h screen.h os.h osdef.h a
+ viewport.o: layout.h viewport.h canvas.h viewport.c config.h screen.h os.h osdef.h ansi.h acls.h \
+  comm.h layer.h term.h image.h display.h window.h extern.h \
+  braille.h
+-list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h
+-list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h
+-list_window.o: list_generic.h list_window.c window.h layer.h screen.h osdef.h
++list_generic.o: list_generic.h list_generic.c layer.h screen.h osdef.h comm.h
++list_display.o: list_generic.h list_display.c layer.h screen.h osdef.h comm.h
++list_window.o: list_generic.h list_window.c window.h layer.h screen.h osdef.h comm.h
+ 
diff --git a/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch b/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch
new file mode 100644
index 0000000..b5d71cc
--- /dev/null
+++ b/meta/recipes-extended/screen/screen/0002-comm.h-now-depends-on-term.h.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Backport
+
+Backport from:
+
+http://git.savannah.gnu.org/cgit/screen.git/commit/?id=39c5f1c
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From 39c5f1c76f1fcef4b5958bf828a63f53426b6984 Mon Sep 17 00:00:00 2001
+From: Mike Gerwitz <mike@mikegerwitz.com>
+Date: Tue, 24 Dec 2013 22:16:31 -0500
+Subject: [PATCH] comm.h now depends on term.h
+
+---
+ src/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index e791e79..d4f7c0b 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -113,7 +113,7 @@ term.h: term.c term.sh
+ 
+ kmapdef.c: term.h
+ 
+-comm.h: comm.c comm.sh config.h
++comm.h: comm.c comm.sh config.h term.h
+ 	AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
+ 
+ docs:
+-- 
+2.4.1
+
diff --git a/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch b/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch
new file mode 100644
index 0000000..e184aa1
--- /dev/null
+++ b/meta/recipes-extended/screen/screen/Avoid-mis-identifying-systems-as-SVR4.patch
@@ -0,0 +1,57 @@
+From 79afb676904653403145fda9e1a6a9d3ea1cb22a Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 11:10:32 +0300
+Subject: [PATCH 4/4] Avoid mis-identifying systems as SVR4
+
+Linux can be misdetected as SVR4 because it has
+libelf installed. This leads to linking with libelf, even though no
+symbols from that library were actually used, and to a workaround for
+a buggy getlogin() being enabled.
+
+It is not documented which exact SVR4 system had the bug that the
+workaround was added for, so all I could do is make an educated guess
+at the #defines its compiler would be likely to set.
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index dc928ae..65439ce 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -179,14 +179,24 @@ AC_EGREP_CPP(yes,
+ #endif
+ ], LIBS="$LIBS -lsocket -linet";seqptx=1)
+ 
++AC_CHECKING(SVR4)
++AC_EGREP_CPP(yes,
++[main () {
++#if defined(SVR4) || defined(__SVR4)
++  yes;
++#endif
++], AC_NOTE(- you have a SVR4 system) AC_DEFINE(SVR4) svr4=1)
++if test -n "$svr4" ; then
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lelf"
+ AC_CHECKING(SVR4)
+ AC_TRY_LINK([#include <utmpx.h>
+ ],,
+-[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN),
+-[AC_CHECK_HEADER(elf.h, AC_DEFINE(SVR4) AC_DEFINE(BUGGYGETLOGIN))])]
++[AC_CHECK_HEADER(dwarf.h, AC_DEFINE(BUGGYGETLOGIN),
++[AC_CHECK_HEADER(elf.h, AC_DEFINE(BUGGYGETLOGIN))])]
+ ,LIBS="$oldlibs")
++fi
++
+ AC_CHECK_HEADERS([stropts.h string.h strings.h])
+ 
+ AC_CHECKING(for Solaris 2.x)
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch b/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch
new file mode 100644
index 0000000..248bf08
--- /dev/null
+++ b/meta/recipes-extended/screen/screen/Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch
@@ -0,0 +1,137 @@
+From cd0f7f10a3fffbc60fe55eb200474d13fe1da65b Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 10:34:29 +0300
+Subject: [PATCH 2/4] Provide cross compile alternatives for AC_TRY_RUN
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 32 ++++++++++++++++++++------------
+ 1 file changed, 20 insertions(+), 12 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 27690a6..ce89f56 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -348,7 +348,8 @@ main()
+   exit(0);
+ }
+ ], AC_NOTE(- your fifos are usable) fifo=1,
+-AC_NOTE(- your fifos are not usable))
++AC_NOTE(- your fifos are not usable),
++AC_NOTE(- skipping check because we are cross compiling; assuming fifos are usable) fifo=1)
+ rm -f /tmp/conftest*
+ 
+ if test -n "$fifo"; then
+@@ -396,7 +397,8 @@ main()
+   exit(0);
+ }
+ ], AC_NOTE(- your implementation is ok), 
+-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
++AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1,
++AC_NOTE(- skipping check because we are cross compiling; assuming fifo implementation is ok))
+ rm -f /tmp/conftest*
+ fi
+ 
+@@ -458,7 +460,8 @@ main()
+   exit(0);
+ }
+ ], AC_NOTE(- your sockets are usable) sock=1,
+-AC_NOTE(- your sockets are not usable))
++AC_NOTE(- your sockets are not usable),
++AC_NOTE(- skipping check because we are cross compiling; assuming sockets are usable) sock=1)
+ rm -f /tmp/conftest*
+ 
+ if test -n "$sock"; then
+@@ -497,7 +500,8 @@ main()
+ }
+ ],AC_NOTE(- you are normal),
+ AC_NOTE(- unix domain sockets are not kept in the filesystem)
+-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
++AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1,
++AC_NOTE(- skipping check because we are cross compiling; assuming sockets are normal))
+ rm -f /tmp/conftest*
+ fi
+ 
+@@ -624,7 +628,8 @@ main()
+   exit(0);
+ }
+ ],AC_NOTE(- select is ok),
+-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
++AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN),
++AC_NOTE(- skipping check because we are cross compiling; assuming select is ok))
+ 
+ dnl
+ dnl    ****  termcap or terminfo  ****
+@@ -666,7 +671,8 @@ main()
+ {
+  exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
+ }], AC_NOTE(- you use the termcap database),
+-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
++AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO),
++AC_NOTE(- skipping check because we are cross compiling; assuming terminfo database is used) AC_DEFINE(TERMINFO))
+ AC_CHECKING(ospeed)
+ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
+ 
+@@ -801,7 +807,8 @@ main()
+     else
+       AC_NOTE(- can't determine - assume ptys are world accessable)
+     fi
+-  ]
++  ],
++  AC_NOTE(- skipping check because we are cross compiling; assuming ptys are world accessable)
+ )
+ rm -f conftest_grp
+ fi
+@@ -885,7 +892,7 @@ AC_EGREP_CPP(yes,
+ #endif
+ ], load=1)
+ fi
+-if test -z "$load" ; then
++if test -z "$load" && test "$cross_compiling" = no ; then
+ AC_CHECKING(for kernelfile)
+ for core in /unix /vmunix /dynix /hp-ux /xelos /dev/ksyms /kernel/unix /kernel/genunix /unicos /mach /netbsd /386bsd /dgux /bsd /stand/vmunix; do
+   if test -f $core || test -c $core; then
+@@ -1078,7 +1085,7 @@ main()
+ #endif
+   exit(0);
+ }
+-],,AC_DEFINE(SYSVSIGS))
++],,AC_DEFINE(SYSVSIGS),:)
+ 
+ fi
+ 
+@@ -1158,7 +1165,7 @@ main() {
+   if (strncmp(buf, "cdedef", 6))
+     exit(1);
+   exit(0); /* libc version works properly.  */
+-}], AC_DEFINE(USEBCOPY))
++}], AC_DEFINE(USEBCOPY),,:)
+ 
+ AC_TRY_RUN([
+ #define bcopy(s,d,l) memmove(d,s,l)
+@@ -1173,7 +1180,8 @@ main() {
+   if (strncmp(buf, "cdedef", 6))
+     exit(1);
+   exit(0); /* libc version works properly.  */
+-}], AC_DEFINE(USEMEMMOVE))
++}], AC_DEFINE(USEMEMMOVE),,
++  AC_NOTE(- skipping check because we are cross compiling; use memmove) AC_DEFINE(USEMEMMOVE))
+ 
+ 
+ AC_TRY_RUN([
+@@ -1189,7 +1197,7 @@ main() {
+   if (strncmp(buf, "cdedef", 6))
+     exit(1);
+   exit(0); /* libc version works properly.  */
+-}], AC_DEFINE(USEMEMCPY))
++}], AC_DEFINE(USEMEMCPY),,:)
+ 
+ AC_SYS_LONG_FILE_NAMES
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch b/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch
new file mode 100644
index 0000000..cc62c12
--- /dev/null
+++ b/meta/recipes-extended/screen/screen/Remove-redundant-compiler-sanity-checks.patch
@@ -0,0 +1,65 @@
+From 73b726c25f94c1b15514ed9249b927afdfbbfb94 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 10:30:40 +0300
+Subject: [PATCH 1/4] Remove redundant compiler sanity checks
+
+AC_PROG_CC already performs sanity checks. And unlike the removed
+checks, it does so in a way that supports cross compilation.
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 27 ---------------------------
+ 1 file changed, 27 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ffe2e37..27690a6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -48,31 +48,6 @@ AC_PROG_GCC_TRADITIONAL
+ AC_ISC_POSIX
+ AC_USE_SYSTEM_EXTENSIONS
+ 
+-AC_TRY_RUN(main(){exit(0);},,[
+-if test $CC != cc ; then
+-AC_NOTE(Your $CC failed - restarting with CC=cc)
+-AC_NOTE()
+-CC=cc
+-export CC
+-exec $0 $configure_args
+-fi
+-])
+-
+-AC_TRY_RUN(main(){exit(0);},,
+-exec 5>&2
+-eval $ac_link
+-AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;)
+-AC_NOTE($ac_compile)
+-AC_MSG_ERROR(Can't run the compiler - sorry))
+-
+-AC_TRY_RUN([
+-main()
+-{
+-  int __something_strange_();
+-  __something_strange_(0);
+-}
+-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
+-
+ AC_PROG_AWK
+ 
+ AC_PROG_INSTALL
+@@ -1300,8 +1275,6 @@ fi
+ dnl Ptx bug workaround -- insert -lc after -ltermcap
+ test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq"
+ 
+-AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.))
+-
+ ETCSCREENRC=
+ AC_MSG_CHECKING(for the global screenrc file)
+ AC_ARG_WITH(sys-screenrc, [  --with-sys-screenrc=path to the global screenrc file], [ ETCSCREENRC="${withval}" ])
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch b/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch
new file mode 100644
index 0000000..d7e55a4
--- /dev/null
+++ b/meta/recipes-extended/screen/screen/Skip-host-file-system-checks-when-cross-compiling.patch
@@ -0,0 +1,135 @@
+From d0b20e4cacc60ad62a2150ce07388cb5a25c2040 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Fri, 7 Aug 2015 11:09:01 +0300
+Subject: [PATCH 3/4] Skip host file system checks when cross-compiling
+
+Modified from patch by Maarten ter Huurne.
+
+Upstream-Status: Submitted [http://savannah.gnu.org/bugs/?43223]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 23 +++++++++++++++++++----
+ 1 file changed, 19 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index ce89f56..dc928ae 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -85,7 +85,7 @@ AC_ARG_ENABLE(socket-dir,
+ dnl
+ dnl    ****  special unix variants  ****
+ dnl
+-if test -n "$ISC"; then
++if test "$cross_compiling" = no && test -n "$ISC" ; then
+   AC_DEFINE(ISC) LIBS="$LIBS -linet"
+ fi
+ 
+@@ -96,10 +96,11 @@ dnl AC_DEFINE(OSF1)	# this disables MIPS again....
+ dnl fi
+ dnl fi
+ 
+-if test -f /sysV68 ; then
++if test "$cross_compiling" = no && test -f /sysV68 ; then
+ AC_DEFINE(sysV68)
+ fi
+ 
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for MIPS)
+ if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then
+ oldlibs="$LIBS"
+@@ -123,6 +124,7 @@ AC_DEFINE(USE_WAIT2) LIBS="$LIBS -lbsd" ; CC="$CC -I/usr/include/bsd"
+ ))
+ fi
+ fi
++fi
+ 
+ 
+ AC_CHECKING(for Ultrix)
+@@ -132,7 +134,7 @@ AC_EGREP_CPP(yes,
+ #endif
+ ], ULTRIX=1)
+ 
+-if test -f /usr/lib/libpyr.a ; then
++if test "$cross_compiling" = no && test -f /usr/lib/libpyr.a ; then
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lpyr"
+ AC_CHECKING(Pyramid OSX)
+@@ -679,17 +681,21 @@ AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))
+ dnl
+ dnl    ****  PTY specific things  ****
+ dnl
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for /dev/ptc)
+ if test -r /dev/ptc; then
+ AC_DEFINE(HAVE_DEV_PTC)
+ fi
++fi
+ 
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for SVR4 ptys)
+ sysvr4ptys=
+ if test -c /dev/ptmx ; then
+ AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS)
+ sysvr4ptys=1])
+ fi
++fi
+ 
+ AC_CHECK_FUNCS(getpt)
+ 
+@@ -699,6 +705,7 @@ AC_CHECK_FUNCS(openpty,,
+ [AC_CHECK_LIB(util,openpty, [AC_DEFINE(HAVE_OPENPTY)] [LIBS="$LIBS -lutil"])])
+ fi
+ 
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for ptyranges)
+ if test -d /dev/ptym ; then
+ pdir='/dev/ptym'
+@@ -722,6 +729,7 @@ p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g'  | sort -u | tr -d '\
+ AC_DEFINE_UNQUOTED(PTYRANGE0,"$p0")
+ AC_DEFINE_UNQUOTED(PTYRANGE1,"$p1")
+ fi
++fi
+ 
+ dnl    ****  pty mode/group handling ****
+ dnl
+@@ -869,14 +877,16 @@ fi
+ dnl
+ dnl    ****  loadav  ****
+ dnl
++if test "$cross_compiling" = no ; then
+ AC_CHECKING(for libutil(s))
+ test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils"
+ test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil"
++fi
+ 
+ AC_CHECKING(getloadavg)
+ AC_TRY_LINK(,[getloadavg((double *)0, 0);],
+ AC_DEFINE(LOADAV_GETLOADAVG) load=1,
+-if test -f /usr/lib/libkvm.a ; then
++if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then
+ olibs="$LIBS"
+ LIBS="$LIBS -lkvm"
+ AC_CHECKING(getloadavg with -lkvm)
+@@ -1094,13 +1104,18 @@ dnl    ****  libraries  ****
+ dnl
+ 
+ AC_CHECKING(for crypt and sec libraries)
++if test "$cross_compiling" = no ; then
+ test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d"
++fi
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lcrypt"
+ AC_CHECKING(crypt)
+ AC_TRY_LINK(,,,LIBS="$oldlibs")
++if test "$cross_compiling" = no ; then
+ test -f /lib/libsec.a || test -f /usr/lib/libsec.a && LIBS="$LIBS -lsec"
+ test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow"
++fi
++
+ oldlibs="$LIBS"
+ LIBS="$LIBS -lsun"
+ AC_CHECKING(IRIX sun library)
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/screen/screen/fix-parallel-make.patch b/meta/recipes-extended/screen/screen/fix-parallel-make.patch
new file mode 100644
index 0000000..e0caf5d
--- /dev/null
+++ b/meta/recipes-extended/screen/screen/fix-parallel-make.patch
@@ -0,0 +1,19 @@
+This fixes the parallel make install failure
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: screen-4.0.3/Makefile.in
+===================================================================
+--- screen-4.0.3.orig/Makefile.in
++++ screen-4.0.3/Makefile.in
+@@ -70,7 +70,7 @@ screen: $(OFILES)
+ .c.o:
+ 	$(CC) -c -I. -I$(srcdir) $(M_CFLAGS) $(DEFS) $(OPTIONS) $(CFLAGS) $<
+ 
+-install_bin: .version screen
++install_bin: .version screen installdirs
+ 	-if [ -f $(DESTDIR)$(bindir)/$(SCREEN) ] && [ ! -f $(DESTDIR)$(bindir)/$(SCREEN).old ]; \
+ 		then mv $(DESTDIR)$(bindir)/$(SCREEN) $(DESTDIR)$(bindir)/$(SCREEN).old; fi
+ 	$(INSTALL_PROGRAM) screen $(DESTDIR)$(bindir)/$(SCREEN)
diff --git a/meta/recipes-extended/screen/screen/screen.pam b/meta/recipes-extended/screen/screen/screen.pam
new file mode 100644
index 0000000..ff657fa
--- /dev/null
+++ b/meta/recipes-extended/screen/screen/screen.pam
@@ -0,0 +1,2 @@
+#%PAM-1.0
+auth       include      common-auth
diff --git a/meta/recipes-extended/screen/screen_4.3.1.bb b/meta/recipes-extended/screen/screen_4.3.1.bb
new file mode 100644
index 0000000..92457af
--- /dev/null
+++ b/meta/recipes-extended/screen/screen_4.3.1.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Multiplexing terminal manager"
+DESCRIPTION = "Screen is a full-screen window manager \
+that multiplexes a physical terminal between several \
+processes, typically interactive shells."
+HOMEPAGE = "http://www.gnu.org/software/screen/"
+BUGTRACKER = "https://savannah.gnu.org/bugs/?func=additem&group=screen"
+
+SECTION = "console/utils"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://screen.h;endline=26;md5=3971142989289a8198a544220703c2bf"
+
+DEPENDS = "ncurses \
+          ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} = "base-files"
+
+SRC_URI = "${GNU_MIRROR}/screen/screen-${PV}.tar.gz \
+           file://fix-parallel-make.patch \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'file://screen.pam', '', d)} \
+           file://Remove-redundant-compiler-sanity-checks.patch \
+           file://Provide-cross-compile-alternatives-for-AC_TRY_RUN.patch \
+           file://Skip-host-file-system-checks-when-cross-compiling.patch \
+           file://Avoid-mis-identifying-systems-as-SVR4.patch \
+           file://0001-fix-for-multijob-build.patch \
+           file://0002-comm.h-now-depends-on-term.h.patch \
+          "
+
+SRC_URI[md5sum] = "5bb3b0ff2674e29378c31ad3411170ad"
+SRC_URI[sha256sum] = "fa4049f8aee283de62e283d427f2cfd35d6c369b40f7f45f947dbfd915699d63"
+
+inherit autotools texinfo
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[utempter] = "ac_cv_header_utempter_h=yes,ac_cv_header_utempter_h=no,libutempter,"
+
+EXTRA_OECONF = "--with-pty-mode=0620 --with-pty-group=5 \
+               ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)}"
+
+do_install_append () {
+	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+		install -D -m 644 ${WORKDIR}/screen.pam ${D}/${sysconfdir}/pam.d/screen
+	fi
+}
+
+pkg_postinst_${PN} () {
+	grep -q "^${bindir}/screen$" $D${sysconfdir}/shells || echo ${bindir}/screen >> $D${sysconfdir}/shells
+}
+
+pkg_postrm_${PN} () {
+	printf "$(grep -v "^${bindir}/screen$" $D${sysconfdir}/shells)\n" > $D${sysconfdir}/shells
+}
diff --git a/meta/recipes-extended/sed/sed-4.1.2/Makevars b/meta/recipes-extended/sed/sed-4.1.2/Makevars
new file mode 100644
index 0000000..8b09f53
--- /dev/null
+++ b/meta/recipes-extended/sed/sed-4.1.2/Makevars
@@ -0,0 +1,25 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
diff --git a/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch b/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch
new file mode 100644
index 0000000..836551e
--- /dev/null
+++ b/meta/recipes-extended/sed/sed-4.1.2/fix_return_type.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Change the getline return type to match its declaration.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -urN sed-4.1.2-orig/lib/getline.c sed-4.1.2/lib/getline.c
+--- sed-4.1.2-orig/lib/getline.c	2010-08-31 08:47:50.070094024 +0800
++++ sed-4.1.2/lib/getline.c	2010-08-31 08:48:50.982178172 +0800
+@@ -30,7 +30,7 @@
+    necessary.  Returns the number of characters read (not including the
+    null terminator), or -1 on error or EOF.  */
+ 
+-size_t
++ssize_t
+ getline (lineptr, n, stream)
+      char **lineptr;
+      size_t *n;
diff --git a/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch b/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..8059406
--- /dev/null
+++ b/meta/recipes-extended/sed/sed-4.1.2/sed-4.1.2_fix_for_automake-1.12.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Pending
+
+automake-1.12.x has deprecated use of @mkdir_p@, fix the issue by using @MKDIR_P@ instead.
+
+Avoid this build issue:
+| make[1]: mkdir_p@: Command not found
+| make[1]: *** [install-data-yes] Error 127
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/07/13
+
+Index: sed-4.1.2/intl/Makefile.in
+===================================================================
+--- sed-4.1.2.orig/intl/Makefile.in
++++ sed-4.1.2/intl/Makefile.in
+@@ -40,7 +40,7 @@ subdir = intl
+ INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+ mkinstalldirs = $(mkdir_p)
+-mkdir_p = @mkdir_p@
++mkdir_p = @MKDIR_P@
+ 
+ l = @INTL_LIBTOOL_SUFFIX_PREFIX@
+ 
+Index: sed-4.1.2/po/Makefile.in.in
+===================================================================
+--- sed-4.1.2.orig/po/Makefile.in.in
++++ sed-4.1.2/po/Makefile.in.in
+@@ -29,7 +29,7 @@ gettextsrcdir = $(datadir)/gettext/po
+ INSTALL = /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/bin/install -c
+ INSTALL_DATA = ${INSTALL} -m 644
+ mkinstalldirs = $(mkdir_p)
+-mkdir_p = @mkdir_p@
++mkdir_p = @MKDIR_P@
+ 
+ CC = i586-poky-linux-gcc  -m32   -march=i586 --sysroot=/srv/home/nitin/builds2/build0/tmp/sysroots/qemux86
+ GMSGFMT = /srv/home/nitin/builds2/build0/tmp/sysroots/x86_64-linux/usr/bin/msgfmt
diff --git a/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..ba1a4ba
--- /dev/null
+++ b/meta/recipes-extended/sed/sed-4.2.2/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,33 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/gnulib.mk b/lib/gnulib.mk
+index e1d74db..c0e92dd 100644
+--- a/lib/gnulib.mk
++++ b/lib/gnulib.mk
+@@ -1882,7 +1882,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/sed/sed-4.2.2/run-ptest b/meta/recipes-extended/sed/sed-4.2.2/run-ptest
new file mode 100644
index 0000000..7c0f627
--- /dev/null
+++ b/meta/recipes-extended/sed/sed-4.2.2/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make -C testsuite -k runtest-TESTS
diff --git a/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch b/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch
new file mode 100644
index 0000000..105e8b7
--- /dev/null
+++ b/meta/recipes-extended/sed/sed-4.2.2/sed-add-ptest.patch
@@ -0,0 +1,66 @@
+sed: add ptest
+
+ptest needs buildtest-TESTS and runtest-TESTS targets.
+serial-tests is required to generate those targets.
+
+And fix following error after add serial-tests.
+
+[snip]
+help2man: can't get `--help' info from ../sed/sed
+make[2]: *** [sed.1] Error 2
+[snip]
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ configure.ac          |    2 +-
+ doc/Makefile.am       |    2 +-
+ testsuite/Makefile.am |    6 ++++++
+ 3 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9d33ec9..4f0c532 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -4,7 +4,7 @@ AC_CONFIG_AUX_DIR(build-aux)
+ AC_CONFIG_SRCDIR([sed/sed.c])
+ AM_CONFIG_HEADER(config.h:config_h.in)
+ AC_PREREQ(2.60)
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([serial-tests])
+ 
+ SED_FEATURE_VERSION=4.2.2
+ AC_DEFINE_UNQUOTED(SED_FEATURE_VERSION, "$SED_FEATURE_VERSION",
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index af6975c..6fd8c9a 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -25,7 +25,7 @@ $(srcdir)/s-texi: sed-in.texi $(srcdir)/groupify.sed
+ 	fi
+ 	echo stamp > $(srcdir)/s-texi
+ 
+-sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x
++_sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x
+ 	$(HELP2MAN) --name "stream editor for filtering and transforming text" \
+ 	  -p sed --include $(srcdir)/sed.x -o $(srcdir)/sed.1 $(SED) 
+ 
+diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
+index d80e72c..b05f01e 100644
+--- a/testsuite/Makefile.am
++++ b/testsuite/Makefile.am
+@@ -99,5 +99,11 @@ EXTRA_DIST = \
+ # automake makes `check' depend on $(TESTS).  Declare
+ # dummy targets for $(TESTS) so that make does not complain.
+ 
++install-ptest:
++	cd $(BUILDDIR); tar -cf - $(TESTDIR) --exclude *.o | ( cd $(DESTDIR) && tar -xf - )
++	for i in $(EXTRA_DIST) tst-regex2.c; do install $(srcdir)/$$i $(DESTDIR)/$(TESTDIR); done
++	sed -e 's/^Makefile:/_Makefile:/' -e 's/^srcdir = \(.*\)/srcdir = ./' -e 's/bash/sh/' -i $(DESTDIR)/$(TESTDIR)/Makefile
++	for i in `grep -rl "../sed/sed" $(DESTDIR)/$(TESTDIR)`; do sed -e 's/..\/sed\/sed/sed/' -i $$i; done
++
+ .PHONY: $(SEDTESTS)
+ $(SEDTESTS):
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/sed/sed_4.1.2.bb b/meta/recipes-extended/sed/sed_4.1.2.bb
new file mode 100644
index 0000000..40e3a53
--- /dev/null
+++ b/meta/recipes-extended/sed/sed_4.1.2.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Stream EDitor (text filtering utility)"
+HOMEPAGE = "http://www.gnu.org/software/sed/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://sed/sed.h;beginline=1;endline=17;md5=e00ffd1837f298439a214fd197f6a407"
+SECTION = "console/utils"
+PR = "r7"
+
+SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \
+           file://fix_return_type.patch \
+           file://sed-4.1.2_fix_for_automake-1.12.patch \
+           file://Makevars"
+
+SRC_URI[md5sum] = "928f0e06422f414091917401f1a834d0"
+SRC_URI[sha256sum] = "638e837ba765d5da0a30c98b57c2953cecea96827882f594612acace93ceeeab"
+
+inherit autotools texinfo update-alternatives gettext
+
+do_configure_prepend () {
+	cp ${WORKDIR}/Makevars ${S}/po/
+}
+
+do_install () {
+	autotools_do_install
+	install -d ${D}${base_bindir}
+	if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
+	    mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+	    rmdir ${D}${bindir}/
+	fi
+}
+
+ALTERNATIVE_${PN} = "sed"
+ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed"
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/meta/recipes-extended/sed/sed_4.2.2.bb b/meta/recipes-extended/sed/sed_4.2.2.bb
new file mode 100644
index 0000000..5aa7d8a
--- /dev/null
+++ b/meta/recipes-extended/sed/sed_4.2.2.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Stream EDitor (text filtering utility)"
+HOMEPAGE = "http://www.gnu.org/software/sed/"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
+                    file://sed/sed.h;beginline=1;endline=17;md5=767ab3a06d7584f6fd0469abaec4412f"
+SECTION = "console/utils"
+
+SRC_URI = "${GNU_MIRROR}/sed/sed-${PV}.tar.gz \
+           file://sed-add-ptest.patch \
+	   file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           file://run-ptest \
+"
+
+SRC_URI[md5sum] = "4111de4faa3b9848a0686b2f260c5056"
+SRC_URI[sha256sum] = "fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff"
+
+inherit autotools texinfo update-alternatives gettext ptest
+RDEPENDS_${PN}-ptest += "make ${PN}"
+RRECOMMENDS_${PN}-ptest_append_libc-glibc = " locale-base-ru-ru"
+
+EXTRA_OECONF = "--disable-acl \
+                ${@bb.utils.contains('PTEST_ENABLED', '1', '--enable-regex-tests', '', d)}"
+
+do_install () {
+	autotools_do_install
+	install -d ${D}${base_bindir}
+	if [ ! ${D}${bindir} -ef ${D}${base_bindir} ]; then
+	    mv ${D}${bindir}/sed ${D}${base_bindir}/sed
+	    rmdir ${D}${bindir}/
+	fi
+}
+
+ALTERNATIVE_${PN} = "sed"
+ALTERNATIVE_LINK_NAME[sed] = "${base_bindir}/sed"
+ALTERNATIVE_PRIORITY = "100"
+
+TESTDIR = "testsuite"
+
+do_compile_ptest() {
+	oe_runmake -C ${TESTDIR} buildtest-TESTS
+}
+
+do_install_ptest() {
+	oe_runmake -C ${TESTDIR} install-ptest BUILDDIR=${B} DESTDIR=${D}${PTEST_PATH} TESTDIR=${TESTDIR}
+}
+
diff --git a/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch b/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch
new file mode 100644
index 0000000..828b95a
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/0001-Do-not-read-login.defs-before-doing-chroot.patch
@@ -0,0 +1,46 @@
+From 170c25c8e0b5c3dc2615d1db94c8d24a13ff99bf Mon Sep 17 00:00:00 2001
+From: Peter Kjellerstedt <pkj@axis.com>
+Date: Thu, 11 Sep 2014 15:11:23 +0200
+Subject: [PATCH] Do not read login.defs before doing chroot()
+
+If "useradd --root <root> ..." was used, the login.defs file would still
+be read from /etc/login.defs instead of <root>/etc/login.defs. This was
+due to getdef_ulong() being called before process_root_flag().
+
+Upstream-Status: Submitted [http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2014-September/010446.html]
+
+Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
+---
+ src/useradd.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/useradd.c b/src/useradd.c
+index a8a1f76..e1ebf50 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -1993,9 +1993,11 @@ int main (int argc, char **argv)
+ #endif				/* USE_PAM */
+ #endif				/* ACCT_TOOLS_SETUID */
+ 
++#ifdef ENABLE_SUBIDS
+ 	/* Needed for userns check */
+-	uid_t uid_min = (uid_t) getdef_ulong ("UID_MIN", 1000UL);
+-	uid_t uid_max = (uid_t) getdef_ulong ("UID_MAX", 60000UL);
++	uid_t uid_min;
++	uid_t uid_max;
++#endif
+ 
+ 	/*
+ 	 * Get my name so that I can use it to report errors.
+@@ -2026,6 +2028,8 @@ int main (int argc, char **argv)
+ 	is_shadow_grp = sgr_file_present ();
+ #endif
+ #ifdef ENABLE_SUBIDS
++	uid_min = (uid_t) getdef_ulong ("UID_MIN", 1000UL);
++	uid_max = (uid_t) getdef_ulong ("UID_MAX", 60000UL);
+ 	is_sub_uid = sub_uid_file_present () && !rflg &&
+ 	    (!user_id || (user_id <= uid_max && user_id >= uid_min));
+ 	is_sub_gid = sub_gid_file_present () && !rflg &&
+-- 
+1.9.0
+
diff --git a/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch b/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
new file mode 100644
index 0000000..85dde8e
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
@@ -0,0 +1,109 @@
+Upstream-Status: Inappropriate [OE specific]
+
+Subject: useradd.c: create parent directories when necessary
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/useradd.c |   72 +++++++++++++++++++++++++++++++++++++++------------------
+ 1 file changed, 49 insertions(+), 23 deletions(-)
+
+diff --git a/src/useradd.c b/src/useradd.c
+index 4bd969d..cb5dd6c 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -1893,6 +1893,35 @@ static void usr_update (void)
+ }
+ 
+ /*
++ * mkdir_p - create directories, including parent directories when needed
++ *
++ * similar to `mkdir -p'
++ */
++void mkdir_p(const char *path) {
++	int len = strlen(path);
++	char newdir[len + 1];
++	mode_t mode = 0755;
++	int i = 0;
++
++	if (path[i] == '\0') {
++		return;
++	}
++
++	/* skip the leading '/' */
++	i++;
++
++	while(path[i] != '\0') {
++		if (path[i] == '/') {
++			strncpy(newdir, path, i);
++			newdir[i] = '\0';
++			mkdir(newdir, mode);
++		}
++		i++;
++	}
++	mkdir(path, mode);
++}
++
++/*
+  * create_home - create the user's home directory
+  *
+  *	create_home() creates the user's home directory if it does not
+@@ -1907,36 +1936,33 @@ static void create_home (void)
+ 			fail_exit (E_HOMEDIR);
+ 		}
+ #endif
+-		/* XXX - create missing parent directories.  --marekm */
+-		if (mkdir (user_home, 0) != 0) {
+-			fprintf (stderr,
+-			         _("%s: cannot create directory %s\n"),
+-			         Prog, user_home);
+-#ifdef WITH_AUDIT
+-			audit_logger (AUDIT_ADD_USER, Prog,
+-			              "adding home directory",
+-			              user_name, (unsigned int) user_id,
+-			              SHADOW_AUDIT_FAILURE);
+-#endif
+-			fail_exit (E_HOMEDIR);
+-		}
+-		chown (user_home, user_id, user_gid);
+-		chmod (user_home,
+-		       0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
+-		home_added = true;
++		mkdir_p(user_home);
++	}
++	if (access (user_home, F_OK) != 0) {
+ #ifdef WITH_AUDIT
+ 		audit_logger (AUDIT_ADD_USER, Prog,
+ 		              "adding home directory",
+ 		              user_name, (unsigned int) user_id,
+-		              SHADOW_AUDIT_SUCCESS);
++		              SHADOW_AUDIT_FAILURE);
+ #endif
+-#ifdef WITH_SELINUX
+-		/* Reset SELinux to create files with default contexts */
+-		if (reset_selinux_file_context () != 0) {
+-			fail_exit (E_HOMEDIR);
+-		}
++		fail_exit (E_HOMEDIR);
++	}
++	chown (user_home, user_id, user_gid);
++	chmod (user_home,
++	       0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
++	home_added = true;
++#ifdef WITH_AUDIT
++	audit_logger (AUDIT_ADD_USER, Prog,
++		      "adding home directory",
++		      user_name, (unsigned int) user_id,
++		      SHADOW_AUDIT_SUCCESS);
+ #endif
++#ifdef WITH_SELINUX
++	/* Reset SELinux to create files with default contexts */
++	if (reset_selinux_file_context () != 0) {
++		fail_exit (E_HOMEDIR);
+ 	}
++#endif
+ }
+ 
+ /*
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch b/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
new file mode 100644
index 0000000..68da25f
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch
@@ -0,0 +1,201 @@
+Upstream-Status: Inappropriate [OE specific]
+
+Allow for setting password in clear text.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/Makefile.am |    8 ++++----
+ src/groupadd.c  |    8 +++++++-
+ src/groupmod.c  |    8 +++++++-
+ src/useradd.c   |    9 +++++++--
+ src/usermod.c   |    8 +++++++-
+ 5 files changed, 32 insertions(+), 9 deletions(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 25e288d..856b087 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -88,10 +88,10 @@ chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT)
+ chsh_LDADD     = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
+ chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT)
+ gpasswd_LDADD  = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
+-groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
++groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
+ groupdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
+ groupmems_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX)
+-groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
++groupmod_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
+ grpck_LDADD    = $(LDADD) $(LIBSELINUX)
+ grpconv_LDADD  = $(LDADD) $(LIBSELINUX)
+ grpunconv_LDADD = $(LDADD) $(LIBSELINUX)
+@@ -111,9 +111,9 @@ su_SOURCES     = \
+ 	suauth.c
+ su_LDADD       = $(LDADD) $(LIBPAM) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
+ sulogin_LDADD  = $(LDADD) $(LIBCRYPT)
+-useradd_LDADD  = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR)
++useradd_LDADD  = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) $(LIBCRYPT)
+ userdel_LDADD  = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE)
+-usermod_LDADD  = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR)
++usermod_LDADD  = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX) $(LIBSEMANAGE) $(LIBACL) $(LIBATTR) $(LIBCRYPT)
+ vipw_LDADD     = $(LDADD) $(LIBSELINUX)
+ 
+ install-am: all-am
+diff --git a/src/groupadd.c b/src/groupadd.c
+index f716f57..4e28c26 100644
+--- a/src/groupadd.c
++++ b/src/groupadd.c
+@@ -124,6 +124,7 @@ static /*@noreturn@*/void usage (int status)
+ 	(void) fputs (_("  -o, --non-unique              allow to create groups with duplicate\n"
+ 	                "                                (non-unique) GID\n"), usageout);
+ 	(void) fputs (_("  -p, --password PASSWORD       use this encrypted password for the new group\n"), usageout);
++	(void) fputs (_("  -P, --clear-password PASSWORD use this clear password for the new group\n"), usageout);
+ 	(void) fputs (_("  -r, --system                  create a system account\n"), usageout);
+ 	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), usageout);
+ 	(void) fputs ("\n", usageout);
+@@ -387,12 +388,13 @@ static void process_flags (int argc, char **argv)
+ 		{"key",        required_argument, NULL, 'K'},
+ 		{"non-unique", no_argument,       NULL, 'o'},
+ 		{"password",   required_argument, NULL, 'p'},
++		{"clear-password", required_argument, NULL, 'P'},
+ 		{"system",     no_argument,       NULL, 'r'},
+ 		{"root",       required_argument, NULL, 'R'},
+ 		{NULL, 0, NULL, '\0'}
+ 	};
+ 
+-	while ((c = getopt_long (argc, argv, "fg:hK:op:rR:",
++	while ((c = getopt_long (argc, argv, "fg:hK:op:P:rR:",
+ 		                 long_options, NULL)) != -1) {
+ 		switch (c) {
+ 		case 'f':
+@@ -444,6 +446,10 @@ static void process_flags (int argc, char **argv)
+ 			pflg = true;
+ 			group_passwd = optarg;
+ 			break;
++		case 'P':
++			pflg = true;
++			group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++			break;
+ 		case 'r':
+ 			rflg = true;
+ 			break;
+diff --git a/src/groupmod.c b/src/groupmod.c
+index d9d3807..68f49d1 100644
+--- a/src/groupmod.c
++++ b/src/groupmod.c
+@@ -127,6 +127,7 @@ static void usage (int status)
+ 	(void) fputs (_("  -o, --non-unique              allow to use a duplicate (non-unique) GID\n"), usageout);
+ 	(void) fputs (_("  -p, --password PASSWORD       change the password to this (encrypted)\n"
+ 	                "                                PASSWORD\n"), usageout);
++	(void) fputs (_("  -P, --clear-password PASSWORD change the password to this clear PASSWORD\n"), usageout);
+ 	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), usageout);
+ 	(void) fputs ("\n", usageout);
+ 	exit (status);
+@@ -375,10 +376,11 @@ static void process_flags (int argc, char **argv)
+ 		{"new-name",   required_argument, NULL, 'n'},
+ 		{"non-unique", no_argument,       NULL, 'o'},
+ 		{"password",   required_argument, NULL, 'p'},
++		{"clear-password", required_argument, NULL, 'P'},
+ 		{"root",       required_argument, NULL, 'R'},
+ 		{NULL, 0, NULL, '\0'}
+ 	};
+-	while ((c = getopt_long (argc, argv, "g:hn:op:R:",
++	while ((c = getopt_long (argc, argv, "g:hn:op:P:R:",
+ 		                 long_options, NULL)) != -1) {
+ 		switch (c) {
+ 		case 'g':
+@@ -405,6 +407,10 @@ static void process_flags (int argc, char **argv)
+ 			group_passwd = optarg;
+ 			pflg = true;
+ 			break;
++		case 'P':
++			group_passwd = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++			pflg = true;
++			break;
+ 		case 'R': /* no-op, handled in process_root_flag () */
+ 			break;
+ 		default:
+diff --git a/src/useradd.c b/src/useradd.c
+index b3bd451..4416f90 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -773,6 +773,7 @@ static void usage (int status)
+ 	(void) fputs (_("  -o, --non-unique              allow to create users with duplicate\n"
+ 	                "                                (non-unique) UID\n"), usageout);
+ 	(void) fputs (_("  -p, --password PASSWORD       encrypted password of the new account\n"), usageout);
++	(void) fputs (_("  -P, --clear-password PASSWORD clear password of the new account\n"), usageout);
+ 	(void) fputs (_("  -r, --system                  create a system account\n"), usageout);
+ 	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), usageout);
+ 	(void) fputs (_("  -s, --shell SHELL             login shell of the new account\n"), usageout);
+@@ -1047,6 +1048,7 @@ static void process_flags (int argc, char **argv)
+ 			{"no-user-group",  no_argument,       NULL, 'N'},
+ 			{"non-unique",     no_argument,       NULL, 'o'},
+ 			{"password",       required_argument, NULL, 'p'},
++			{"clear-password", required_argument, NULL, 'P'},
+ 			{"system",         no_argument,       NULL, 'r'},
+ 			{"root",           required_argument, NULL, 'R'},
+ 			{"shell",          required_argument, NULL, 's'},
+@@ -1059,9 +1061,9 @@ static void process_flags (int argc, char **argv)
+ 		};
+ 		while ((c = getopt_long (argc, argv,
+ #ifdef WITH_SELINUX
+-		                         "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:UZ:",
++		                         "b:c:d:De:f:g:G:hk:K:lmMNop:P:rR:s:u:UZ:",
+ #else				/* !WITH_SELINUX */
+-		                         "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:U",
++		                         "b:c:d:De:f:g:G:hk:K:lmMNop:P:rR:s:u:U",
+ #endif				/* !WITH_SELINUX */
+ 		                         long_options, NULL)) != -1) {
+ 			switch (c) {
+@@ -1227,6 +1229,9 @@ static void process_flags (int argc, char **argv)
+ 				}
+ 				user_pass = optarg;
+ 				break;
++			case 'P': /* set clear text password */
++				user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++				break;
+ 			case 'r':
+ 				rflg = true;
+ 				break;
+diff --git a/src/usermod.c b/src/usermod.c
+index e7d4351..b79f7a3 100644
+--- a/src/usermod.c
++++ b/src/usermod.c
+@@ -419,6 +419,7 @@ static /*@noreturn@*/void usage (int status)
+ 	                "                                new location (use only with -d)\n"), usageout);
+ 	(void) fputs (_("  -o, --non-unique              allow using duplicate (non-unique) UID\n"), usageout);
+ 	(void) fputs (_("  -p, --password PASSWORD       use encrypted password for the new password\n"), usageout);
++	(void) fputs (_("  -P, --clear-password PASSWORD use clear password for the new password\n"), usageout);
+ 	(void) fputs (_("  -R, --root CHROOT_DIR         directory to chroot into\n"), usageout);
+ 	(void) fputs (_("  -s, --shell SHELL             new login shell for the user account\n"), usageout);
+ 	(void) fputs (_("  -u, --uid UID                 new UID for the user account\n"), usageout);
+@@ -996,6 +997,7 @@ static void process_flags (int argc, char **argv)
+ 			{"move-home",    no_argument,       NULL, 'm'},
+ 			{"non-unique",   no_argument,       NULL, 'o'},
+ 			{"password",     required_argument, NULL, 'p'},
++			{"clear-password", required_argument, NULL, 'P'},
+ 			{"root",         required_argument, NULL, 'R'},
+ 			{"shell",        required_argument, NULL, 's'},
+ 			{"uid",          required_argument, NULL, 'u'},
+@@ -1012,7 +1014,7 @@ static void process_flags (int argc, char **argv)
+ 			{NULL, 0, NULL, '\0'}
+ 		};
+ 		while ((c = getopt_long (argc, argv,
+-		                         "ac:d:e:f:g:G:hl:Lmop:R:s:u:U"
++		                         "ac:d:e:f:g:G:hl:Lmop:P:R:s:u:U"
+ #ifdef ENABLE_SUBIDS
+ 		                         "v:w:V:W:"
+ #endif				/* ENABLE_SUBIDS */
+@@ -1112,6 +1114,10 @@ static void process_flags (int argc, char **argv)
+ 				user_pass = optarg;
+ 				pflg = true;
+ 				break;
++			case 'P':
++				user_pass = pw_encrypt (optarg, crypt_make_salt (NULL, NULL));
++				pflg = true;
++				break;
+ 			case 'R': /* no-op, handled in process_root_flag () */
+ 				break;
+ 			case 's':
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch b/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch
new file mode 100644
index 0000000..185590c
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch
@@ -0,0 +1,41 @@
+From 2cb54158b80cdbd97ca3b36df83f9255e923ae3f Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@aura-online.co.uk>
+Date: Sat, 23 Aug 2014 09:46:39 +0100
+Subject: [PATCH] Check size of uid_t and gid_t using AC_CHECK_SIZEOF
+
+This built-in check is simpler than the previous method and, most
+importantly, works when cross-compiling.
+
+Upstream-Status: Accepted
+[https://github.com/shadow-maint/shadow/commit/2cb54158b80cdbd97ca3b36df83f9255e923ae3f]
+
+Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
+---
+ configure.in | 14 ++++----------
+ 1 file changed, 4 insertions(+), 10 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 1a3f841..4a4d6d0 100644
+--- a/configure.in
++++ b/configure.in
+@@ -335,16 +335,10 @@ if test "$enable_subids" != "no"; then
+ 	dnl
+ 	dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc
+ 	dnl
+-	AC_RUN_IFELSE([AC_LANG_SOURCE([
+-#include <sys/types.h>
+-int main(void) {
+-	uid_t u;
+-	gid_t g;
+-	return (sizeof u < 4) || (sizeof g < 4);
+-}
+-	])], [id32bit="yes"], [id32bit="no"])
+-
+-	if test "x$id32bit" = "xyes"; then
++	AC_CHECK_SIZEOF([uid_t],, [#include "sys/types.h"])
++	AC_CHECK_SIZEOF([gid_t],, [#include "sys/types.h"])
++
++	if test "$ac_cv_sizeof_uid_t" -ge 4 && test "$ac_cv_sizeof_gid_t" -ge 4; then
+ 		AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.])
+ 		enable_subids="yes"
+ 	else
diff --git a/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch b/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
new file mode 100644
index 0000000..4fa3d18
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Inappropriate [OE specific]
+
+commonio.c: fix unexpected open failure in chroot environment
+
+When using commands with '-R <newroot>' option in our pseudo environment,
+we would usually get the 'Pemission Denied' error. This patch serves as
+a workaround to this problem.
+
+Note that this patch doesn't change the logic in the code, it just expands
+the codes.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ lib/commonio.c |   16 ++++++++++++----
+ 1 file changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/lib/commonio.c b/lib/commonio.c
+index cc536bf..51cafd9 100644
+--- a/lib/commonio.c
++++ b/lib/commonio.c
+@@ -613,10 +613,18 @@ int commonio_open (struct commonio_db *db, int mode)
+ 	db->cursor = NULL;
+ 	db->changed = false;
+ 
+-	fd = open (db->filename,
+-	             (db->readonly ? O_RDONLY : O_RDWR)
+-	           | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
+-	saved_errno = errno;
++	if (db->readonly) {
++		fd = open (db->filename,
++			   (true ? O_RDONLY : O_RDWR)
++			   | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
++		saved_errno = errno;
++	} else {
++		fd = open (db->filename,
++			   (false ? O_RDONLY : O_RDWR)
++			   | O_NOCTTY | O_NONBLOCK | O_NOFOLLOW);
++		saved_errno = errno;
++	}
++
+ 	db->fp = NULL;
+ 	if (fd >= 0) {
+ #ifdef WITH_TCB
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/shadow/files/disable-syslog.patch b/meta/recipes-extended/shadow/files/disable-syslog.patch
new file mode 100644
index 0000000..1943fd6
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/disable-syslog.patch
@@ -0,0 +1,34 @@
+Disable use of syslog to prevent sysroot user and group additions from
+writing entries to the host's syslog. This patch should only be used
+with the shadow-native recipe.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+diff -urN shadow-4.1.4.3.orig//src/groupadd.c shadow-4.1.4.3/src/groupadd.c
+--- shadow-4.1.4.3.orig//src/groupadd.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3/src/groupadd.c	2012-04-05 10:05:59.440001758 -0700
+@@ -34,6 +34,9 @@
+ 
+ #ident "$Id: groupadd.c 3015 2009-06-05 22:16:56Z nekral-guest $"
+ 
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <ctype.h>
+ #include <fcntl.h>
+ #include <getopt.h>
+diff -urN shadow-4.1.4.3.orig//src/useradd.c shadow-4.1.4.3/src/useradd.c
+--- shadow-4.1.4.3.orig//src/useradd.c	2011-02-13 09:58:16.000000000 -0800
++++ shadow-4.1.4.3/src/useradd.c	2012-04-05 10:06:25.076001315 -0700
+@@ -34,6 +34,9 @@
+ 
+ #ident "$Id: useradd.c 3015 2009-06-05 22:16:56Z nekral-guest $"
+ 
++/* Disable use of syslog since we're running this command against a sysroot */
++#undef USE_SYSLOG
++
+ #include <assert.h>
+ #include <ctype.h>
+ #include <errno.h>
diff --git a/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch b/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch
new file mode 100644
index 0000000..02cb91a
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+Subject: fix installation failure with subids disabled
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/Makefile.am |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 25e288d..076f8ef 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -52,7 +52,10 @@ usbin_PROGRAMS = \
+ noinst_PROGRAMS = id sulogin
+ 
+ suidbins       = su
+-suidubins      = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap
++suidubins      = chage chfn chsh expiry gpasswd newgrp passwd
++if ENABLE_SUBIDS
++suidubins += newgidmap newuidmap
++endif
+ if ACCT_TOOLS_SETUID
+ 	suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod
+ endif
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot b/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot
new file mode 100644
index 0000000..8a68dd3
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/login.defs_shadow-sysroot
@@ -0,0 +1,386 @@
+#
+# /etc/login.defs - Configuration control definitions for the shadow package.
+#
+#	$Id: login.defs 3038 2009-07-23 20:41:35Z nekral-guest $
+#
+
+#
+# Delay in seconds before being allowed another attempt after a login failure
+# Note: When PAM is used, some modules may enfore a minimal delay (e.g.
+#       pam_unix enforces a 2s delay)
+#
+FAIL_DELAY		3
+
+#
+# Enable logging and display of /var/log/faillog login failure info.
+#
+#FAILLOG_ENAB		yes
+
+#
+# Enable display of unknown usernames when login failures are recorded.
+#
+LOG_UNKFAIL_ENAB	no
+
+#
+# Enable logging of successful logins
+#
+LOG_OK_LOGINS		no
+
+#
+# Enable logging and display of /var/log/lastlog login time info.
+#
+#LASTLOG_ENAB		yes
+
+#
+# Enable checking and display of mailbox status upon login.
+#
+# Disable if the shell startup files already check for mail
+# ("mailx -e" or equivalent).
+#
+##MAIL_CHECK_ENAB		yes
+
+#
+# Enable additional checks upon password changes.
+#
+#OBSCURE_CHECKS_ENAB	yes
+
+#
+# Enable checking of time restrictions specified in /etc/porttime.
+#
+#PORTTIME_CHECKS_ENAB	yes
+
+#
+# Enable setting of ulimit, umask, and niceness from passwd gecos field.
+#
+#QUOTAS_ENAB		yes
+
+#
+# Enable "syslog" logging of su activity - in addition to sulog file logging.
+# SYSLOG_SG_ENAB does the same for newgrp and sg.
+#
+SYSLOG_SU_ENAB		yes
+SYSLOG_SG_ENAB		yes
+
+#
+# If defined, either full pathname of a file containing device names or
+# a ":" delimited list of device names.  Root logins will be allowed only
+# upon these devices.
+#
+CONSOLE		/etc/securetty
+#CONSOLE	console:tty01:tty02:tty03:tty04
+
+#
+# If defined, all su activity is logged to this file.
+#
+#SULOG_FILE	/var/log/sulog
+
+#
+# If defined, ":" delimited list of "message of the day" files to
+# be displayed upon login.
+#
+#MOTD_FILE	/etc/motd
+#MOTD_FILE	/etc/motd:/usr/lib/news/news-motd
+
+#
+# If defined, this file will be output before each login prompt.
+#
+#ISSUE_FILE	/etc/issue
+
+#
+# If defined, file which maps tty line to TERM environment parameter.
+# Each line of the file is in a format something like "vt100  tty01".
+#
+#TTYTYPE_FILE	/etc/ttytype
+
+#
+# If defined, login failures will be logged here in a utmp format.
+# last, when invoked as lastb, will read /var/log/btmp, so...
+#
+#FTMP_FILE	/var/log/btmp
+
+#
+# If defined, name of file whose presence which will inhibit non-root
+# logins.  The contents of this file should be a message indicating
+# why logins are inhibited.
+#
+#NOLOGINS_FILE	/etc/nologin
+
+#
+# If defined, the command name to display when running "su -".  For
+# example, if this is defined as "su" then a "ps" will display the
+# command is "-su".  If not defined, then "ps" would display the
+# name of the shell actually being run, e.g. something like "-sh".
+#
+SU_NAME		su
+
+#
+# *REQUIRED*
+#   Directory where mailboxes reside, _or_ name of file, relative to the
+#   home directory.  If you _do_ define both, #MAIL_DIR takes precedence.
+#
+#MAIL_DIR	/var/spool/mail
+MAIL_FILE	.mail
+
+#
+# If defined, file which inhibits all the usual chatter during the login
+# sequence.  If a full pathname, then hushed mode will be enabled if the
+# user's name or shell are found in the file.  If not a full pathname, then
+# hushed mode will be enabled if the file exists in the user's home directory.
+#
+HUSHLOGIN_FILE	.hushlogin
+#HUSHLOGIN_FILE	/etc/hushlogins
+
+#
+# If defined, either a TZ environment parameter spec or the
+# fully-rooted pathname of a file containing such a spec.
+#
+#ENV_TZ		TZ=CST6CDT
+#ENV_TZ		/etc/tzname
+
+#
+# If defined, an HZ environment parameter spec.
+#
+# for Linux/x86
+#ENV_HZ		HZ=100
+# For Linux/Alpha...
+#ENV_HZ		HZ=1024
+
+#
+# *REQUIRED*  The default PATH settings, for superuser and normal users.
+#
+# (they are minimal, add the rest in the shell startup files)
+ENV_SUPATH	PATH=/sbin:/bin:/usr/sbin:/usr/bin
+ENV_PATH	PATH=/bin:/usr/bin
+
+#
+# Terminal permissions
+#
+#	TTYGROUP	Login tty will be assigned this group ownership.
+#	TTYPERM		Login tty will be set to this permission.
+#
+# If you have a "write" program which is "setgid" to a special group
+# which owns the terminals, define TTYGROUP to the group number and
+# TTYPERM to 0620.  Otherwise leave TTYGROUP commented out and assign
+# TTYPERM to either 622 or 600.
+#
+TTYGROUP	tty
+TTYPERM		0600
+
+#
+# Login configuration initializations:
+#
+#	ERASECHAR	Terminal ERASE character ('\010' = backspace).
+#	KILLCHAR	Terminal KILL character ('\025' = CTRL/U).
+#	ULIMIT		Default "ulimit" value.
+#
+# The ERASECHAR and KILLCHAR are used only on System V machines.
+# The ULIMIT is used only if the system supports it.
+# (now it works with setrlimit too; ulimit is in 512-byte units)
+#
+# Prefix these values with "0" to get octal, "0x" to get hexadecimal.
+#
+ERASECHAR	0177
+KILLCHAR	025
+#ULIMIT		2097152
+
+# Default initial "umask" value for non-PAM enabled systems.
+# UMASK is also used by useradd and newusers to set the mode of new home
+# directories.
+# 022 is the default value, but 027, or even 077, could be considered
+# better for privacy. There is no One True Answer here: each sysadmin
+# must make up her mind.
+UMASK		022
+
+#
+# Password aging controls:
+#
+#	PASS_MAX_DAYS	Maximum number of days a password may be used.
+#	PASS_MIN_DAYS	Minimum number of days allowed between password changes.
+#	PASS_MIN_LEN	Minimum acceptable password length.
+#	PASS_WARN_AGE	Number of days warning given before a password expires.
+#
+PASS_MAX_DAYS	99999
+PASS_MIN_DAYS	0
+#PASS_MIN_LEN	5
+PASS_WARN_AGE	7
+
+#
+# If "yes", the user must be listed as a member of the first gid 0 group
+# in /etc/group (called "root" on most Linux systems) to be able to "su"
+# to uid 0 accounts.  If the group doesn't exist or is empty, no one
+# will be able to "su" to uid 0.
+#
+#SU_WHEEL_ONLY	no
+
+#
+# If compiled with cracklib support, where are the dictionaries
+#
+#CRACKLIB_DICTPATH	/var/cache/cracklib/cracklib_dict
+
+#
+# Min/max values for automatic uid selection in useradd
+#
+UID_MIN			 1000
+UID_MAX			60000
+# System accounts
+SYS_UID_MIN		  101
+SYS_UID_MAX		  999
+
+#
+# Min/max values for automatic gid selection in groupadd
+#
+GID_MIN			 1000
+GID_MAX			60000
+# System accounts
+SYS_GID_MIN		  101
+SYS_GID_MAX		  999
+
+#
+# Max number of login retries if password is bad
+#
+LOGIN_RETRIES		5
+
+#
+# Max time in seconds for login
+#
+LOGIN_TIMEOUT		60
+
+#
+# Maximum number of attempts to change password if rejected (too easy)
+#
+#PASS_CHANGE_TRIES	5
+
+#
+# Warn about weak passwords (but still allow them) if you are root.
+#
+#PASS_ALWAYS_WARN	yes
+
+#
+# Number of significant characters in the password for crypt().
+# Default is 8, don't change unless your crypt() is better.
+# Ignored if MD5_CRYPT_ENAB set to "yes".
+#
+#PASS_MAX_LEN		8
+
+#
+# Require password before chfn/chsh can make any changes.
+#
+#CHFN_AUTH		yes
+
+#
+# Which fields may be changed by regular users using chfn - use
+# any combination of letters "frwh" (full name, room number, work
+# phone, home phone).  If not defined, no changes are allowed.
+# For backward compatibility, "yes" = "rwh" and "no" = "frwh".
+# 
+CHFN_RESTRICT		rwh
+
+#
+# Password prompt (%s will be replaced by user name).
+#
+# XXX - it doesn't work correctly yet, for now leave it commented out
+# to use the default which is just "Password: ".
+#LOGIN_STRING		"%s's Password: "
+
+#
+# Only works if compiled with MD5_CRYPT defined:
+# If set to "yes", new passwords will be encrypted using the MD5-based
+# algorithm compatible with the one used by recent releases of FreeBSD.
+# It supports passwords of unlimited length and longer salt strings.
+# Set to "no" if you need to copy encrypted passwords to other systems
+# which don't understand the new algorithm.  Default is "no".
+#
+# Note: If you use PAM, it is recommended to use a value consistent with
+# the PAM modules configuration.
+#
+# This variable is deprecated. You should use ENCRYPT_METHOD.
+#
+#MD5_CRYPT_ENAB	no
+
+#
+# Only works if compiled with ENCRYPTMETHOD_SELECT defined:
+# If set to MD5 , MD5-based algorithm will be used for encrypting password
+# If set to SHA256, SHA256-based algorithm will be used for encrypting password
+# If set to SHA512, SHA512-based algorithm will be used for encrypting password
+# If set to DES, DES-based algorithm will be used for encrypting password (default)
+# Overrides the MD5_CRYPT_ENAB option
+#
+# Note: If you use PAM, it is recommended to use a value consistent with
+# the PAM modules configuration.
+#
+#ENCRYPT_METHOD DES
+
+#
+# Only works if ENCRYPT_METHOD is set to SHA256 or SHA512.
+#
+# Define the number of SHA rounds.
+# With a lot of rounds, it is more difficult to brute forcing the password.
+# But note also that it more CPU resources will be needed to authenticate
+# users.
+#
+# If not specified, the libc will choose the default number of rounds (5000).
+# The values must be inside the 1000-999999999 range.
+# If only one of the MIN or MAX values is set, then this value will be used.
+# If MIN > MAX, the highest value will be used.
+#
+# SHA_CRYPT_MIN_ROUNDS 5000
+# SHA_CRYPT_MAX_ROUNDS 5000
+
+#
+# List of groups to add to the user's supplementary group set
+# when logging in on the console (as determined by the CONSOLE
+# setting).  Default is none.
+#
+# Use with caution - it is possible for users to gain permanent
+# access to these groups, even when not logged in on the console.
+# How to do it is left as an exercise for the reader...
+#
+#CONSOLE_GROUPS		floppy:audio:cdrom
+
+#
+# Should login be allowed if we can't cd to the home directory?
+# Default in no.
+#
+DEFAULT_HOME	yes
+
+#
+# If this file exists and is readable, login environment will be
+# read from it.  Every line should be in the form name=value.
+#
+#ENVIRON_FILE	/etc/environment
+
+#
+# If defined, this command is run when removing a user.
+# It should remove any at/cron/print jobs etc. owned by
+# the user to be removed (passed as the first argument).
+#
+#USERDEL_CMD	/usr/sbin/userdel_local
+
+#
+# Enable setting of the umask group bits to be the same as owner bits
+# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is
+# the same as gid, and username is the same as the primary group name.
+#
+# This also enables userdel to remove user groups if no members exist.
+#
+USERGROUPS_ENAB yes
+
+#
+# If set to a non-nul number, the shadow utilities will make sure that
+# groups never have more than this number of users on one line.
+# This permit to support split groups (groups split into multiple lines,
+# with the same group ID, to avoid limitation of the line length in the
+# group file).
+#
+# 0 is the default value and disables this feature.
+#
+#MAX_MEMBERS_PER_GROUP	0
+
+#
+# If useradd should create home directories for users by default (non
+# system users only)
+# This option is overridden with the -M or -m flags on the useradd command
+# line.
+#
+CREATE_HOME     yes
+
diff --git a/meta/recipes-extended/shadow/files/login_defs_pam.sed b/meta/recipes-extended/shadow/files/login_defs_pam.sed
new file mode 100644
index 0000000..0a1f3be
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/login_defs_pam.sed
@@ -0,0 +1,32 @@
+/^FAILLOG_ENAB/b comment
+/^LASTLOG_ENAB/b comment
+/^MAIL_CHECK_ENAB/b comment
+/^OBSCURE_CHECKS_ENAB/b comment
+/^PORTTIME_CHECKS_ENAB/b comment
+/^QUOTAS_ENAB/b comment
+/^MOTD_FILE/b comment
+/^FTMP_FILE/b comment
+/^NOLOGINS_FILE/b comment
+/^ENV_HZ/b comment
+/^ENV_TZ/b comment
+/^PASS_MIN_LEN/b comment
+/^SU_WHEEL_ONLY/b comment
+/^CRACKLIB_DICTPATH/b comment
+/^PASS_CHANGE_TRIES/b comment
+/^PASS_ALWAYS_WARN/b comment
+/^PASS_MAX_LEN/b comment
+/^PASS_MIN_LEN/b comment
+/^CHFN_AUTH/b comment
+/^CHSH_AUTH/b comment
+/^ISSUE_FILE/b comment
+/^LOGIN_STRING/b comment
+/^ULIMIT/b comment
+/^ENVIRON_FILE/b comment
+
+b exit
+
+: comment
+  s:^:#:
+
+: exit
+
diff --git a/meta/recipes-extended/shadow/files/pam.d/chfn b/meta/recipes-extended/shadow/files/pam.d/chfn
new file mode 100644
index 0000000..baf7698
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/pam.d/chfn
@@ -0,0 +1,14 @@
+#
+# The PAM configuration file for the Shadow `chfn' service
+#
+
+# This allows root to change user infomation without being
+# prompted for a password
+auth		sufficient	pam_rootok.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+auth       include      common-auth
+account    include      common-account
+session    include      common-session
diff --git a/meta/recipes-extended/shadow/files/pam.d/chpasswd b/meta/recipes-extended/shadow/files/pam.d/chpasswd
new file mode 100644
index 0000000..9e3efa6
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/pam.d/chpasswd
@@ -0,0 +1,4 @@
+# The PAM configuration file for the Shadow 'chpasswd' service
+#
+
+password   include      common-password
diff --git a/meta/recipes-extended/shadow/files/pam.d/chsh b/meta/recipes-extended/shadow/files/pam.d/chsh
new file mode 100644
index 0000000..8fb169f
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/pam.d/chsh
@@ -0,0 +1,19 @@
+#
+# The PAM configuration file for the Shadow `chsh' service
+#
+
+# This will not allow a user to change their shell unless
+# their current one is listed in /etc/shells. This keeps
+# accounts with special shells from changing them.
+auth       required   pam_shells.so
+
+# This allows root to change user shell without being
+# prompted for a password
+auth		sufficient	pam_rootok.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+auth       include      common-auth
+account    include      common-account
+session    include      common-session
diff --git a/meta/recipes-extended/shadow/files/pam.d/login b/meta/recipes-extended/shadow/files/pam.d/login
new file mode 100644
index 0000000..b340058
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/pam.d/login
@@ -0,0 +1,81 @@
+#
+# The PAM configuration file for the Shadow `login' service
+#
+
+# Enforce a minimal delay in case of failure (in microseconds).
+# (Replaces the `FAIL_DELAY' setting from login.defs)
+# Note that other modules may require another minimal delay. (for example,
+# to disable any delay, you should add the nodelay option to pam_unix)
+auth       optional   pam_faildelay.so  delay=3000000
+
+# Outputs an issue file prior to each login prompt (Replaces the
+# ISSUE_FILE option from login.defs). Uncomment for use
+# auth       required   pam_issue.so issue=/etc/issue
+
+# Disallows root logins except on tty's listed in /etc/securetty
+# (Replaces the `CONSOLE' setting from login.defs)
+# Note that it is included as a "requisite" module. No password prompts will
+# be displayed if this module fails to avoid having the root password
+# transmitted on unsecure ttys.
+# You can change it to a "required" module if you think it permits to
+# guess valid user names of your system (invalid user names are considered
+# as possibly being root).
+auth       [success=ok ignore=ignore user_unknown=ignore default=die]  pam_securetty.so
+
+# Disallows other than root logins when /etc/nologin exists
+# (Replaces the `NOLOGINS_FILE' option from login.defs)
+auth       requisite  pam_nologin.so
+
+# This module parses environment configuration file(s)
+# and also allows you to use an extended config
+# file /etc/security/pam_env.conf.
+# 
+# parsing /etc/environment needs "readenv=1"
+session       required   pam_env.so readenv=1
+
+# Standard Un*x authentication.
+auth       include      common-auth
+
+# This allows certain extra groups to be granted to a user
+# based on things like time of day, tty, service, and user.
+# Please edit /etc/security/group.conf to fit your needs
+# (Replaces the `CONSOLE_GROUPS' option in login.defs)
+auth       optional   pam_group.so
+
+# Uncomment and edit /etc/security/time.conf if you need to set
+# time restrainst on logins.
+# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
+# as well as /etc/porttime)
+# account    requisite  pam_time.so
+
+# Uncomment and edit /etc/security/access.conf if you need to
+# set access limits.
+# (Replaces /etc/login.access file)
+# account  required       pam_access.so
+
+# Sets up user limits according to /etc/security/limits.conf
+# (Replaces the use of /etc/limits in old login)
+session    required   pam_limits.so
+
+# Prints the last login info upon succesful login
+# (Replaces the `LASTLOG_ENAB' option from login.defs)
+session    optional   pam_lastlog.so
+
+# Prints the motd upon succesful login
+# (Replaces the `MOTD_FILE' option in login.defs)
+session    optional   pam_motd.so
+
+# Prints the status of the user's mailbox upon succesful login
+# (Replaces the `MAIL_CHECK_ENAB' option from login.defs). 
+#
+# This also defines the MAIL environment variable
+# However, userdel also needs MAIL_DIR and MAIL_FILE variables
+# in /etc/login.defs to make sure that removing a user 
+# also removes the user's mail spool file.
+# See comments in /etc/login.defs
+session    optional   pam_mail.so standard
+
+# Standard Un*x account and session
+account    include      common-account
+password   include      common-password
+session    include      common-session
diff --git a/meta/recipes-extended/shadow/files/pam.d/newusers b/meta/recipes-extended/shadow/files/pam.d/newusers
new file mode 100644
index 0000000..4aa3dde
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/pam.d/newusers
@@ -0,0 +1,4 @@
+# The PAM configuration file for the Shadow 'newusers' service
+#
+
+password   include      common-password
diff --git a/meta/recipes-extended/shadow/files/pam.d/passwd b/meta/recipes-extended/shadow/files/pam.d/passwd
new file mode 100644
index 0000000..f534992
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/pam.d/passwd
@@ -0,0 +1,5 @@
+#
+# The PAM configuration file for the Shadow `passwd' service
+#
+
+password   include      common-password
diff --git a/meta/recipes-extended/shadow/files/pam.d/su b/meta/recipes-extended/shadow/files/pam.d/su
new file mode 100644
index 0000000..8d590a3
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/pam.d/su
@@ -0,0 +1,57 @@
+#
+# The PAM configuration file for the Shadow `su' service
+#
+
+# This allows root to su without passwords (normal operation)
+auth       sufficient pam_rootok.so
+
+# Uncomment this to force users to be a member of group root
+# before they can use `su'. You can also add "group=foo"
+# to the end of this line if you want to use a group other
+# than the default "root" (but this may have side effect of
+# denying "root" user, unless she's a member of "foo" or explicitly
+# permitted earlier by e.g. "sufficient pam_rootok.so").
+# (Replaces the `SU_WHEEL_ONLY' option from login.defs)
+# auth       required   pam_wheel.so
+
+# Uncomment this if you want wheel members to be able to
+# su without a password.
+# auth       sufficient pam_wheel.so trust
+
+# Uncomment this if you want members of a specific group to not
+# be allowed to use su at all.
+# auth       required   pam_wheel.so deny group=nosu
+
+# Uncomment and edit /etc/security/time.conf if you need to set
+# time restrainst on su usage.
+# (Replaces the `PORTTIME_CHECKS_ENAB' option from login.defs
+# as well as /etc/porttime)
+# account    requisite  pam_time.so
+
+# This module parses environment configuration file(s)
+# and also allows you to use an extended config
+# file /etc/security/pam_env.conf.
+# 
+# parsing /etc/environment needs "readenv=1"
+session       required   pam_env.so readenv=1
+
+# Defines the MAIL environment variable
+# However, userdel also needs MAIL_DIR and MAIL_FILE variables
+# in /etc/login.defs to make sure that removing a user 
+# also removes the user's mail spool file.
+# See comments in /etc/login.defs
+#
+# "nopen" stands to avoid reporting new mail when su'ing to another user
+session    optional   pam_mail.so nopen
+
+# Sets up user limits, please uncomment and read /etc/security/limits.conf
+# to enable this functionality.
+# (Replaces the use of /etc/limits in old login)
+# session    required   pam_limits.so
+
+# The standard Unix authentication modules, used with
+# NIS (man nsswitch) as well as normal /etc/passwd and
+# /etc/shadow entries.
+auth       include      common-auth
+account    include      common-account
+session    include      common-session
diff --git a/meta/recipes-extended/shadow/files/securetty b/meta/recipes-extended/shadow/files/securetty
new file mode 100644
index 0000000..2be341a
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/securetty
@@ -0,0 +1,238 @@
+# /etc/securetty: list of terminals on which root is allowed to login.
+# See securetty(5) and login(1).
+console
+
+# Standard serial ports
+ttyS0
+ttyS1
+ttyS2
+ttyS3
+
+# ARM AMBA SoCs
+ttyAM0
+ttyAM1
+ttyAM2
+ttyAM3
+ttyAMA0
+ttyAMA1
+ttyAMA2
+ttyAMA3
+
+# QCOM Socs
+ttyHSL0
+ttyHSL1
+ttyHSL2
+ttyHSL3
+ttyMSM0
+ttyMSM1
+ttyMSM2
+
+# Samsung ARM SoCs
+ttySAC0
+ttySAC1
+ttySAC2
+ttySAC3
+
+# STM SoCs
+ttyAS0
+ttyAS1
+ttyAS2
+ttyAS3
+
+# TI OMAP SoCs
+ttyO0
+ttyO1
+ttyO2
+ttyO3
+
+# Xilinx Zynq SoC
+ttyPS0
+ttyPS1
+
+# USB dongles
+ttyUSB0
+ttyUSB1
+ttyUSB2
+
+# USB serial gadget
+ttyGS0
+
+# PowerMac
+ttyPZ0
+ttyPZ1
+ttyPZ2
+ttyPZ3
+
+# Embedded MPC platforms
+ttyPSC0
+ttyPSC1
+ttyPSC2
+ttyPSC3
+ttyPSC4
+ttyPSC5
+
+# PA-RISC mux ports
+ttyB0
+ttyB1
+
+# Standard hypervisor virtual console
+hvc0
+
+# Oldstyle Xen console
+xvc0
+
+# Standard consoles
+tty1
+tty2
+tty3
+tty4
+tty5
+tty6
+tty7
+tty8
+tty9
+tty10
+tty11
+tty12
+tty13
+tty14
+tty15
+tty16
+tty17
+tty18
+tty19
+tty20
+tty21
+tty22
+tty23
+tty24
+tty25
+tty26
+tty27
+tty28
+tty29
+tty30
+tty31
+tty32
+tty33
+tty34
+tty35
+tty36
+tty37
+tty38
+tty39
+tty40
+tty41
+tty42
+tty43
+tty44
+tty45
+tty46
+tty47
+tty48
+tty49
+tty50
+tty51
+tty52
+tty53
+tty54
+tty55
+tty56
+tty57
+tty58
+tty59
+tty60
+tty61
+tty62
+tty63
+
+# Local X displays (allows empty passwords with pam_unix's nullok_secure)
+pts/0
+pts/1
+pts/2
+pts/3
+
+# Embedded Freescale i.MX ports
+ttymxc0
+ttymxc1
+ttymxc2
+ttymxc3
+ttymxc4
+ttymxc5
+
+# Freescale lpuart ports
+ttyLP0
+ttyLP1
+ttyLP2
+ttyLP3
+ttyLP4
+ttyLP5
+
+# Standard serial ports, with devfs
+tts/0
+tts/1
+
+# Standard consoles, with devfs
+vc/1
+vc/2
+vc/3
+vc/4
+vc/5
+vc/6
+vc/7
+vc/8
+vc/9
+vc/10
+vc/11
+vc/12
+vc/13
+vc/14
+vc/15
+vc/16
+vc/17
+vc/18
+vc/19
+vc/20
+vc/21
+vc/22
+vc/23
+vc/24
+vc/25
+vc/26
+vc/27
+vc/28
+vc/29
+vc/30
+vc/31
+vc/32
+vc/33
+vc/34
+vc/35
+vc/36
+vc/37
+vc/38
+vc/39
+vc/40
+vc/41
+vc/42
+vc/43
+vc/44
+vc/45
+vc/46
+vc/47
+vc/48
+vc/49
+vc/50
+vc/51
+vc/52
+vc/53
+vc/54
+vc/55
+vc/56
+vc/57
+vc/58
+vc/59
+vc/60
+vc/61
+vc/62
+vc/63
diff --git a/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch b/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch
new file mode 100644
index 0000000..a7bb0a9
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/shadow-4.1.3-dots-in-usernames.patch
@@ -0,0 +1,27 @@
+# commit message copied from openembedded:
+#    commit 246c80637b135f3a113d319b163422f98174ee6c
+#    Author: Khem Raj <raj.khem@gmail.com>
+#    Date:   Wed Jun 9 13:37:03 2010 -0700
+#
+#    shadow-4.1.4.2: Add patches to support dots in login id.
+#    
+#    Signed-off-by: Khem Raj <raj.khem@gmail.com>
+#
+# comment added by Kevin Tian <kevin.tian@intel.com>, 2010-08-11
+
+Upstream-Status: Pending
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Index: shadow-4.1.4.2/libmisc/chkname.c
+===================================================================
+--- shadow-4.1.4.2.orig/libmisc/chkname.c	2009-04-28 12:14:04.000000000 -0700
++++ shadow-4.1.4.2/libmisc/chkname.c	2010-06-03 17:43:20.638973857 -0700
+@@ -61,6 +61,7 @@ static bool is_valid_name (const char *n
+ 		      ( ('0' <= *name) && ('9' >= *name) ) ||
+ 		      ('_' == *name) ||
+ 		      ('-' == *name) ||
++		      ('.' == *name) ||
+ 		      ( ('$' == *name) && ('\0' == *(name + 1)) )
+ 		     )) {
+ 			return false;
diff --git a/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch b/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch
new file mode 100644
index 0000000..15f8044
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/shadow-update-pam-conf.patch
@@ -0,0 +1,91 @@
+The system-auth in the configure files is from Fedora which put all the 4 pam type rules
+in one file.
+In yocto it obey the way with Debian/Ubuntu, and the names are common-auth, common-account,
+common-password and common-session.
+So update them with oe way.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kang Kai <kai.kang@windriver.com>
+
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/chage shadow-4.1.4.3/etc/pam.d/chage
+--- shadow-4.1.4.3/etc/pam.d.orig/chage	2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/chage	2011-07-20 19:03:08.964844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth		sufficient	pam_rootok.so
+ account		required	pam_permit.so
+-password	include		system-auth
++password	include		common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/chgpasswd shadow-4.1.4.3/etc/pam.d/chgpasswd
+--- shadow-4.1.4.3/etc/pam.d.orig/chgpasswd	2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/chgpasswd	2011-07-20 19:03:26.544844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth		sufficient	pam_rootok.so
+ account		required	pam_permit.so
+-password	include		system-auth
++password	include		common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupadd shadow-4.1.4.3/etc/pam.d/groupadd
+--- shadow-4.1.4.3/etc/pam.d.orig/groupadd	2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupadd	2011-07-20 19:04:08.124844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth		sufficient	pam_rootok.so
+ account		required	pam_permit.so
+-password	include		system-auth
++password	include		common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupdel shadow-4.1.4.3/etc/pam.d/groupdel
+--- shadow-4.1.4.3/etc/pam.d.orig/groupdel	2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupdel	2011-07-20 19:04:26.114844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth		sufficient	pam_rootok.so
+ account		required	pam_permit.so
+-password	include		system-auth
++password	include		common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupmems shadow-4.1.4.3/etc/pam.d/groupmems
+--- shadow-4.1.4.3/etc/pam.d.orig/groupmems	2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupmems	2011-07-20 19:04:35.074844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth		sufficient	pam_rootok.so
+ account		required	pam_permit.so
+-password	include		system-auth
++password	include		common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/groupmod shadow-4.1.4.3/etc/pam.d/groupmod
+--- shadow-4.1.4.3/etc/pam.d.orig/groupmod	2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/groupmod	2011-07-20 19:04:44.864844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth		sufficient	pam_rootok.so
+ account		required	pam_permit.so
+-password	include		system-auth
++password	include		common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/useradd shadow-4.1.4.3/etc/pam.d/useradd
+--- shadow-4.1.4.3/etc/pam.d.orig/useradd	2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/useradd	2011-07-20 19:07:26.244844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth		sufficient	pam_rootok.so
+ account		required	pam_permit.so
+-password	include		system-auth
++password	include		common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/userdel shadow-4.1.4.3/etc/pam.d/userdel
+--- shadow-4.1.4.3/etc/pam.d.orig/userdel	2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/userdel	2011-07-20 19:07:35.734844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth		sufficient	pam_rootok.so
+ account		required	pam_permit.so
+-password	include		system-auth
++password	include		common-password
+diff -Nur shadow-4.1.4.3/etc/pam.d.orig/usermod shadow-4.1.4.3/etc/pam.d/usermod
+--- shadow-4.1.4.3/etc/pam.d.orig/usermod	2011-07-20 19:02:27.384844958 +0800
++++ shadow-4.1.4.3/etc/pam.d/usermod	2011-07-20 19:07:42.024844958 +0800
+@@ -1,4 +1,4 @@
+ #%PAM-1.0
+ auth		sufficient	pam_rootok.so
+ account		required	pam_permit.so
+-password	include		system-auth
++password	include		common-password
diff --git a/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch b/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch
new file mode 100644
index 0000000..37dc153
--- /dev/null
+++ b/meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+usermod: fix compilation failure with subids disabled
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/usermod.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/usermod.c b/src/usermod.c
+index e7d4351..685b50a 100644
+--- a/src/usermod.c
++++ b/src/usermod.c
+@@ -1360,7 +1360,7 @@ static void process_flags (int argc, char **argv)
+ 		         Prog, (unsigned long) user_newid);
+ 		exit (E_UID_IN_USE);
+ 	}
+-
++#ifdef ENABLE_SUBIDS
+ 	if (   (vflg || Vflg)
+ 	    && !is_sub_uid) {
+ 		fprintf (stderr,
+@@ -1376,6 +1376,7 @@ static void process_flags (int argc, char **argv)
+ 		         Prog, sub_gid_dbname (), "-w", "-W");
+ 		exit (E_USAGE);
+ 	}
++#endif
+ }
+ 
+ /*
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb b/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
new file mode 100644
index 0000000..c78f888
--- /dev/null
+++ b/meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Provider of the machine specific securetty file"
+SECTION = "base utils"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+PR = "r3"
+
+SRC_URI = "file://securetty"
+
+S = "${WORKDIR}"
+
+# Since SERIAL_CONSOLES is likely to be set from the machine configuration
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install () {
+	# Ensure we add a suitable securetty file to the package that has
+	# most common embedded TTYs defined.
+	install -d ${D}${sysconfdir}
+	install -m 0400 ${WORKDIR}/securetty ${D}${sysconfdir}/securetty
+	if [ ! -z "${SERIAL_CONSOLES}" ]; then
+		# Our SERIAL_CONSOLES contains a baud rate and sometimes extra
+		# options as well. The following pearl :) takes that and converts
+		# it into newline-separated tty's and appends them into
+		# securetty. So if a machine has a weird looking console device
+		# node (e.g. ttyAMA0) that securetty does not know, it will get
+		# appended to securetty and root logins will be allowed on that
+		# console.
+		tmp="${SERIAL_CONSOLES}"
+		for entry in $tmp ; do
+			ttydev=`echo "$entry" | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
+			if ! grep -q $ttydev ${D}${sysconfdir}/securetty; then
+				echo $ttydev >> ${D}${sysconfdir}/securetty
+			fi
+		done
+	fi
+}
diff --git a/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb b/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
new file mode 100644
index 0000000..697569c
--- /dev/null
+++ b/meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Shadow utils requirements for useradd.bbclass"
+HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
+BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
+SECTION = "base utils"
+LICENSE = "BSD | Artistic-1.0"
+LIC_FILES_CHKSUM = "file://login.defs_shadow-sysroot;md5=25e2f2de4dfc8f966ac5cdfce45cd7d5"
+
+DEPENDS = "base-passwd"
+
+PR = "r3"
+
+# The sole purpose of this recipe is to provide the /etc/login.defs
+# file for the target sysroot - needed so the shadow-native utilities
+# can add custom users/groups for recipes that use inherit useradd.
+SRC_URI = "file://login.defs_shadow-sysroot"
+
+SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79"
+SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778"
+
+S = "${WORKDIR}"
+
+do_install() {
+	install -d ${D}${sysconfdir}
+	install -p -m 755 ${S}/login.defs_shadow-sysroot ${D}${sysconfdir}/login.defs
+}
+
+sysroot_stage_all() {
+	sysroot_stage_dir ${D} ${SYSROOT_DESTDIR}
+}
+
+# don't create any packages
+# otherwise: dbus-dev depends on shadow-sysroot-dev which depends on shadow-sysroot 
+# and this has another copy of /etc/login.defs already provided by shadow
+PACKAGES = ""
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
new file mode 100644
index 0000000..4313ffe
--- /dev/null
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -0,0 +1,196 @@
+SUMMARY = "Tools to change and administer password and group data"
+HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
+BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
+SECTION = "base/utils"
+LICENSE = "BSD | Artistic-1.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ed80ff1c2b40843cf5768e5229cf16e5 \
+                    file://src/passwd.c;beginline=8;endline=30;md5=d83888ea14ae61951982d77125947661"
+
+DEPENDS = "shadow-native"
+DEPENDS_class-native = ""
+DEPENDS_class-nativesdk = ""
+
+SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.xz \
+           file://shadow-4.1.3-dots-in-usernames.patch \
+           file://usermod-fix-compilation-failure-with-subids-disabled.patch \
+           file://fix-installation-failure-with-subids-disabled.patch \
+           file://0001-Do-not-read-login.defs-before-doing-chroot.patch \
+           file://check_size_of_uid_t_and_gid_t_using_AC_CHECK_SIZEOF.patch \
+           ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \
+           "
+
+SRC_URI_append_class-target = " \
+           file://login_defs_pam.sed \
+           file://shadow-update-pam-conf.patch \
+           "
+
+SRC_URI_append_class-native = " \
+           file://disable-syslog.patch \
+           file://allow-for-setting-password-in-clear-text.patch \
+           file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \
+           file://0001-useradd.c-create-parent-directories-when-necessary.patch \
+           "
+SRC_URI_append_class-nativesdk = " \
+           file://disable-syslog.patch \
+           "
+
+SRC_URI[md5sum] = "2bfafe7d4962682d31b5eba65dba4fc8"
+SRC_URI[sha256sum] = "3b0893d1476766868cd88920f4f1231c4795652aa407569faff802bcda0f3d41"
+
+# Additional Policy files for PAM
+PAM_SRC_URI = "file://pam.d/chfn \
+               file://pam.d/chpasswd \
+               file://pam.d/chsh \
+               file://pam.d/login \
+               file://pam.d/newusers \
+               file://pam.d/passwd \
+               file://pam.d/su"
+
+inherit autotools gettext
+
+EXTRA_OECONF += "--without-audit \
+                 --without-libcrack \
+                 --without-selinux \
+                 --with-group-name-max-length=24 \
+                 --enable-subordinate-ids=yes \
+                 ${NSCDOPT}"
+
+NSCDOPT = ""
+NSCDOPT_class-native = "--without-nscd"
+NSCDOPT_class-nativesdk = "--without-nscd"
+NSCDOPT_libc-uclibc = " --without-nscd"
+NSCDOPT_libc-glibc = "${@bb.utils.contains('DISTRO_FEATURES', 'libc-spawn', '--with-nscd', '--without-nscd', d)}"
+          
+PAM_PLUGINS = "libpam-runtime \
+               pam-plugin-faildelay \
+               pam-plugin-securetty \
+               pam-plugin-nologin \
+               pam-plugin-env \
+               pam-plugin-group \
+               pam-plugin-limits \
+               pam-plugin-lastlog \
+               pam-plugin-motd \
+               pam-plugin-mail \
+               pam-plugin-shells \
+               pam-plugin-rootok"
+
+PACKAGECONFIG = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_class-nativesdk = ""
+PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,${PAM_PLUGINS}"
+PACKAGECONFIG[attr] = "--with-attr,--without-attr,attr"
+PACKAGECONFIG[acl] = "--with-acl,--without-acl,acl"
+
+RDEPENDS_${PN} = "shadow-securetty \
+                  base-passwd \
+                  util-linux-sulogin"
+RDEPENDS_${PN}_class-native = ""
+RDEPENDS_${PN}_class-nativesdk = ""
+
+do_install() {
+	oe_runmake DESTDIR="${D}" sbindir="${base_sbindir}" usbindir="${sbindir}" install
+
+	# Info dir listing isn't interesting at this point so remove it if it exists.
+	if [ -e "${D}${infodir}/dir" ]; then
+		rm -f ${D}${infodir}/dir
+	fi
+
+	# Enable CREATE_HOME by default.
+	sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs
+
+	# As we are on an embedded system, ensure the users mailbox is in
+	# ~/ not /var/spool/mail by default, as who knows where or how big
+	# /var is. The system MDA will set this later anyway.
+	sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs
+	sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs
+
+	# Disable checking emails.
+	sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs
+
+	# Comment out SU_NAME to work correctly with busybox
+	# See Bug#5359 and Bug#7173
+	sed -i 's:^SU_NAME:#SU_NAME:g' ${D}${sysconfdir}/login.defs
+
+	# Use proper encryption for passwords
+	sed -i 's/^#ENCRYPT_METHOD.*$/ENCRYPT_METHOD SHA512/' ${D}${sysconfdir}/login.defs
+
+	# Now we don't have a mail system. Disable mail creation for now.
+	sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd
+	sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd
+
+	# Use users group by default
+	sed -i 's,^GROUP=1000,GROUP=100,g' ${D}${sysconfdir}/default/useradd
+}
+
+do_install_append() {
+	# Ensure that the image has as a /var/spool/mail dir so shadow can
+	# put mailboxes there if the user reconfigures shadow to its
+	# defaults (see sed below).
+	install -d ${D}${localstatedir}/spool/mail
+
+	if [ -e ${WORKDIR}/pam.d ]; then
+		install -d ${D}${sysconfdir}/pam.d/
+		install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
+		# Remove defaults that are not used when supporting PAM.
+		sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs
+	fi
+
+	install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir} 
+
+	# Move binaries to the locations we want
+	rm ${D}${sbindir}/vigr
+	ln -sf vipw.${BPN} ${D}${base_sbindir}/vigr
+	if [ "${sbindir}" != "${base_sbindir}" ]; then
+		mv ${D}${sbindir}/vipw ${D}${base_sbindir}/vipw
+	fi
+	if [ "${bindir}" != "${base_bindir}" ]; then
+		mv ${D}${bindir}/login ${D}${base_bindir}/login
+		mv ${D}${bindir}/su ${D}${base_bindir}/su
+	fi
+
+	# Handle link properly after rename, otherwise missing files would
+	# lead rpm failed dependencies.
+	ln -sf newgrp.${BPN} ${D}${bindir}/sg
+}
+
+PACKAGES =+ "${PN}-base"
+FILES_${PN}-base = "\
+    ${base_bindir}/login.shadow \
+    ${base_bindir}/su.shadow \
+    ${bindir}/sg \
+    ${bindir}/newgrp.shadow \
+    ${bindir}/groups.shadow \
+    ${sysconfdir}/pam.d/login \
+    ${sysconfdir}/pam.d/su \
+    ${sysconfdir}/login.defs \
+"
+RDEPENDS_${PN} += "${PN}-base"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "200"
+
+ALTERNATIVE_${PN} = "passwd chfn chsh chpasswd vipw vigr"
+ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
+ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
+ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
+
+ALTERNATIVE_${PN}-base = "newgrp groups login su"
+ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
+ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
+
+ALTERNATIVE_${PN}-doc = "passwd.5 getspnam.3 groups.1"
+ALTERNATIVE_LINK_NAME[passwd.5] = "${mandir}/man5/passwd.5"
+ALTERNATIVE_LINK_NAME[getspnam.3] = "${mandir}/man3/getspnam.3"
+ALTERNATIVE_LINK_NAME[groups.1] = "${mandir}/man1/groups.1"
+
+pkg_postinst_${PN} () {
+	if [ "x$D" != "x" ]; then
+	  rootarg="--root $D"
+	else
+	  rootarg=""
+	fi
+
+	pwconv $rootarg || exit 1
+	grpconv $rootarg || exit 1
+}
diff --git a/meta/recipes-extended/shadow/shadow_4.2.1.bb b/meta/recipes-extended/shadow/shadow_4.2.1.bb
new file mode 100644
index 0000000..5675cb8
--- /dev/null
+++ b/meta/recipes-extended/shadow/shadow_4.2.1.bb
@@ -0,0 +1,10 @@
+require shadow.inc
+
+# Build falsely assumes that if --enable-libpam is set, we don't need to link against
+# libcrypt. This breaks chsh.
+BUILD_LDFLAGS_append_class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', bb.utils.contains('DISTRO_FEATURES', 'libc-crypt',  '-lcrypt', '', d), '', d)}"
+
+BBCLASSEXTEND = "native nativesdk"
+
+
+
diff --git a/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch b/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch
new file mode 100644
index 0000000..57ebfe4
--- /dev/null
+++ b/meta/recipes-extended/slang/slang/0001-Fix-error-conflicting-types-for-posix_close.patch
@@ -0,0 +1,39 @@
+From 96eb7e29822151823a66a1eb59f1fa4aead5ae08 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 06:33:21 +0000
+Subject: [PATCH] Fix  error: conflicting types for 'posix_close'
+
+Exposed while compiling on musl
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/slposio.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/slposio.c b/src/slposio.c
+index 9ce9697..9ff9bfe 100644
+--- a/src/slposio.c
++++ b/src/slposio.c
+@@ -363,7 +363,7 @@ static int posix_close_fd (int *fd)
+    return 0;
+ }
+ 
+-static int posix_close (SLFile_FD_Type *f)
++static int posix_closex (SLFile_FD_Type *f)
+ {
+    int status = do_close (f);
+ 
+@@ -1001,7 +1001,7 @@ static SLang_Intrin_Fun_Type Fd_Name_Table [] =
+    MAKE_INTRINSIC_2("write", posix_write, V, F, B),
+    MAKE_INTRINSIC_1("dup_fd", posix_dup, V, F),
+    MAKE_INTRINSIC_2("dup2_fd", posix_dup2, I, F, I),
+-   MAKE_INTRINSIC_1("close", posix_close, I, F),
++   MAKE_INTRINSIC_1("close", posix_closex, I, F),
+    MAKE_INTRINSIC_1("_close", posix_close_fd, I, I),
+ #if defined(TTYNAME_R)
+    MAKE_INTRINSIC_0("ttyname", posix_ttyname, V),
+-- 
+2.5.1
+
diff --git a/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch b/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch
new file mode 100644
index 0000000..2ea1ffd
--- /dev/null
+++ b/meta/recipes-extended/slang/slang/change-char-type-to-signed-char-in-macros.patch
@@ -0,0 +1,218 @@
+slang: change char type to signed char in macros
+
+C language has 3 distinct char types:
+         char
+         unsigned char
+         signed char
+A char has the same range of values as signed char on X86,
+but same as unsigned char on ARM which made Slang's typecast()
+and array_sort() unable to work for char value on ARM, since
+Slang is assuming "char" as "signed char".
+
+Now we change "char" as "signed char" explicitly in
+util/mkslarith2.sl, and use it to regenerate src/slarith2.inc
+
+Upstream-Status: Submitted
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ src/slarith2.inc       |   72 ++++++++++++++++++++++++-------------------------
+ src/util/mkslarith2.sl |    2 -
+ 2 files changed, 37 insertions(+), 37 deletions(-)
+
+--- a/src/util/mkslarith2.sl
++++ b/src/util/mkslarith2.sl
+@@ -1,7 +1,7 @@
+ #!/usr/bin/env slsh
+ 
+ private variable CTypes =
+-  ["char", "unsigned char", "short", "unsigned short", "int", "unsigned int",
++  ["signed char", "unsigned char", "short", "unsigned short", "int", "unsigned int",
+    "long", "unsigned long", "long long", "unsigned long long",
+    "float", "double", "long double"];
+ private variable Is_Int_Type =
+--- a/src/slarith2.inc
++++ b/src/slarith2.inc
+@@ -1,43 +1,43 @@
+ /* DO NOT EDIT -- this file was generated by src/util/mkslarith2.sl */
+-/* ------------ char ---------- */
+-DEFUN_1(copy_char_to_char,char,char)
++/* ------------ signed char ---------- */
++DEFUN_1(copy_char_to_char,signed char,signed char)
+ #define char_to_char	NULL
+ #define copy_char_to_uchar	copy_char_to_char
+ #define char_to_uchar	NULL
+-DEFUN_1(copy_char_to_short,char,short)
++DEFUN_1(copy_char_to_short,signed char,short)
+ #define char_to_short	NULL
+-DEFUN_1(copy_char_to_ushort,char,unsigned short)
++DEFUN_1(copy_char_to_ushort,signed char,unsigned short)
+ #define char_to_ushort	NULL
+-DEFUN_1(copy_char_to_int,char,int)
+-DEFUN_2(char_to_int,char,int,copy_char_to_int)
+-DEFUN_1(copy_char_to_uint,char,unsigned int)
+-DEFUN_2(char_to_uint,char,unsigned int,copy_char_to_uint)
+-DEFUN_1(copy_char_to_long,char,long)
+-DEFUN_2(char_to_long,char,long,copy_char_to_long)
+-DEFUN_1(copy_char_to_ulong,char,unsigned long)
+-DEFUN_2(char_to_ulong,char,unsigned long,copy_char_to_ulong)
++DEFUN_1(copy_char_to_int,signed char,int)
++DEFUN_2(char_to_int,signed char,int,copy_char_to_int)
++DEFUN_1(copy_char_to_uint,signed char,unsigned int)
++DEFUN_2(char_to_uint,signed char,unsigned int,copy_char_to_uint)
++DEFUN_1(copy_char_to_long,signed char,long)
++DEFUN_2(char_to_long,signed char,long,copy_char_to_long)
++DEFUN_1(copy_char_to_ulong,signed char,unsigned long)
++DEFUN_2(char_to_ulong,signed char,unsigned long,copy_char_to_ulong)
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_char_to_llong,char,long long)
+-DEFUN_2(char_to_llong,char,long long,copy_char_to_llong)
++DEFUN_1(copy_char_to_llong,signed char,long long)
++DEFUN_2(char_to_llong,signed char,long long,copy_char_to_llong)
+ #endif /* defined(HAVE_LONG_LONG) */
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_char_to_ullong,char,unsigned long long)
+-DEFUN_2(char_to_ullong,char,unsigned long long,copy_char_to_ullong)
++DEFUN_1(copy_char_to_ullong,signed char,unsigned long long)
++DEFUN_2(char_to_ullong,signed char,unsigned long long,copy_char_to_ullong)
+ #endif /* defined(HAVE_LONG_LONG) */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_char_to_float,char,float)
+-DEFUN_2(char_to_float,char,float,copy_char_to_float)
++DEFUN_1(copy_char_to_float,signed char,float)
++DEFUN_2(char_to_float,signed char,float,copy_char_to_float)
+ #endif /* SLANG_HAS_FLOAT */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_char_to_double,char,double)
+-DEFUN_2(char_to_double,char,double,copy_char_to_double)
++DEFUN_1(copy_char_to_double,signed char,double)
++DEFUN_2(char_to_double,signed char,double,copy_char_to_double)
+ #endif /* SLANG_HAS_FLOAT */
+ #if defined(HAVE_LONG_DOUBLE)
+-DEFUN_1(copy_char_to_ldouble,char,long double)
+-DEFUN_2(char_to_ldouble,char,long double,copy_char_to_ldouble)
++DEFUN_1(copy_char_to_ldouble,signed char,long double)
++DEFUN_2(char_to_ldouble,signed char,long double,copy_char_to_ldouble)
+ #endif /* defined(HAVE_LONG_DOUBLE) */
+ #if SLANG_HAS_FLOAT
+-TO_DOUBLE_FUN(char_to_one_double,char)
++TO_DOUBLE_FUN(char_to_one_double,signed char)
+ #endif
+ 
+ /* ------------ unsigned char ---------- */
+@@ -82,7 +82,7 @@ TO_DOUBLE_FUN(uchar_to_one_double,unsign
+ #endif
+ 
+ /* ------------ short ---------- */
+-DEFUN_1(copy_short_to_char,short,char)
++DEFUN_1(copy_short_to_char,short,signed char)
+ #define short_to_char	NULL
+ DEFUN_1(copy_short_to_uchar,short,unsigned char)
+ #define short_to_uchar	NULL
+@@ -123,7 +123,7 @@ TO_DOUBLE_FUN(short_to_one_double,short)
+ #endif
+ 
+ /* ------------ unsigned short ---------- */
+-DEFUN_1(copy_ushort_to_char,unsigned short,char)
++DEFUN_1(copy_ushort_to_char,unsigned short,signed char)
+ #define ushort_to_char	NULL
+ DEFUN_1(copy_ushort_to_uchar,unsigned short,unsigned char)
+ #define ushort_to_uchar	NULL
+@@ -164,7 +164,7 @@ TO_DOUBLE_FUN(ushort_to_one_double,unsig
+ #endif
+ 
+ /* ------------ int ---------- */
+-DEFUN_1(copy_int_to_char,int,char)
++DEFUN_1(copy_int_to_char,int,signed char)
+ #define int_to_char	NULL
+ DEFUN_1(copy_int_to_uchar,int,unsigned char)
+ #define int_to_uchar	NULL
+@@ -205,7 +205,7 @@ TO_DOUBLE_FUN(int_to_one_double,int)
+ #endif
+ 
+ /* ------------ unsigned int ---------- */
+-DEFUN_1(copy_uint_to_char,unsigned int,char)
++DEFUN_1(copy_uint_to_char,unsigned int,signed char)
+ #define uint_to_char	NULL
+ DEFUN_1(copy_uint_to_uchar,unsigned int,unsigned char)
+ #define uint_to_uchar	NULL
+@@ -246,7 +246,7 @@ TO_DOUBLE_FUN(uint_to_one_double,unsigne
+ #endif
+ 
+ /* ------------ long ---------- */
+-DEFUN_1(copy_long_to_char,long,char)
++DEFUN_1(copy_long_to_char,long,signed char)
+ #define long_to_char	NULL
+ DEFUN_1(copy_long_to_uchar,long,unsigned char)
+ #define long_to_uchar	NULL
+@@ -287,7 +287,7 @@ TO_DOUBLE_FUN(long_to_one_double,long)
+ #endif
+ 
+ /* ------------ unsigned long ---------- */
+-DEFUN_1(copy_ulong_to_char,unsigned long,char)
++DEFUN_1(copy_ulong_to_char,unsigned long,signed char)
+ #define ulong_to_char	NULL
+ DEFUN_1(copy_ulong_to_uchar,unsigned long,unsigned char)
+ #define ulong_to_uchar	NULL
+@@ -329,7 +329,7 @@ TO_DOUBLE_FUN(ulong_to_one_double,unsign
+ 
+ /* ------------ long long ---------- */
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_llong_to_char,long long,char)
++DEFUN_1(copy_llong_to_char,long long,signed char)
+ #define llong_to_char	NULL
+ DEFUN_1(copy_llong_to_uchar,long long,unsigned char)
+ #define llong_to_uchar	NULL
+@@ -372,7 +372,7 @@ TO_DOUBLE_FUN(llong_to_one_double,long l
+ 
+ /* ------------ unsigned long long ---------- */
+ #if defined(HAVE_LONG_LONG)
+-DEFUN_1(copy_ullong_to_char,unsigned long long,char)
++DEFUN_1(copy_ullong_to_char,unsigned long long,signed char)
+ #define ullong_to_char	NULL
+ DEFUN_1(copy_ullong_to_uchar,unsigned long long,unsigned char)
+ #define ullong_to_uchar	NULL
+@@ -415,7 +415,7 @@ TO_DOUBLE_FUN(ullong_to_one_double,unsig
+ 
+ /* ------------ float ---------- */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_float_to_char,float,char)
++DEFUN_1(copy_float_to_char,float,signed char)
+ #define float_to_char	NULL
+ DEFUN_1(copy_float_to_uchar,float,unsigned char)
+ #define float_to_uchar	NULL
+@@ -458,7 +458,7 @@ TO_DOUBLE_FUN(float_to_one_double,float)
+ 
+ /* ------------ double ---------- */
+ #if SLANG_HAS_FLOAT
+-DEFUN_1(copy_double_to_char,double,char)
++DEFUN_1(copy_double_to_char,double,signed char)
+ #define double_to_char	NULL
+ DEFUN_1(copy_double_to_uchar,double,unsigned char)
+ #define double_to_uchar	NULL
+@@ -501,7 +501,7 @@ TO_DOUBLE_FUN(double_to_one_double,doubl
+ 
+ /* ------------ long double ---------- */
+ #if defined(HAVE_LONG_DOUBLE)
+-DEFUN_1(copy_ldouble_to_char,long double,char)
++DEFUN_1(copy_ldouble_to_char,long double,signed char)
+ #define ldouble_to_char	NULL
+ DEFUN_1(copy_ldouble_to_uchar,long double,unsigned char)
+ #define ldouble_to_uchar	NULL
+@@ -545,7 +545,7 @@ TO_DOUBLE_FUN(ldouble_to_one_double,long
+ #if SLANG_HAS_FLOAT
+ static To_Double_Fun_Table_Type To_Double_Fun_Table [MAX_ARITHMETIC_TYPES] =
+ {
+-   {sizeof(char), char_to_one_double},
++   {sizeof(signed char), char_to_one_double},
+    {sizeof(unsigned char), uchar_to_one_double},
+    {sizeof(short), short_to_one_double},
+    {sizeof(unsigned short), ushort_to_one_double},
+@@ -583,7 +583,7 @@ static To_Double_Fun_Table_Type To_Doubl
+ 
+ static Binary_Matrix_Type Binary_Matrix [MAX_ARITHMETIC_TYPES][MAX_ARITHMETIC_TYPES] =
+ {
+-   /* char */
++   /* signed char */
+    {
+      {(FVOID_STAR)copy_char_to_char, char_to_char},
+      {(FVOID_STAR)copy_char_to_uchar, char_to_uchar},
diff --git a/meta/recipes-extended/slang/slang/fix-check-pcre.patch b/meta/recipes-extended/slang/slang/fix-check-pcre.patch
new file mode 100644
index 0000000..0c1553a
--- /dev/null
+++ b/meta/recipes-extended/slang/slang/fix-check-pcre.patch
@@ -0,0 +1,108 @@
+fix the pcre existence checking
+
+when check if there is pcre, the configure file always check
+the host dir. now we make it work by adding correct prefix for
+cross-compile environment.
+
+When enable pcre-module, we see a QA warning because rpaths
+hardcoded into the build, rpaths are not needed, so lets turn
+this off.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ configure |   60 ++++++------------------------------------------------------
+ 1 files changed, 6 insertions(+), 54 deletions(-)
+
+diff --git a/configure b/configure
+index f1586c3..d22814f 100755
+--- a/configure
++++ b/configure
+@@ -6991,6 +6991,7 @@ $as_echo_n "checking for the pcre library and header files ... " >&6; }
+ 	 /usr/include/pcre,/usr/lib \
+ 	 /usr/pcre/include,/usr/pcre/lib \
+ 	 /usr/include,/usr/lib \
++	 /usr/include,/usr/lib64 \
+ 	 /opt/include/pcre,/opt/lib \
+ 	 /opt/pcre/include,/opt/pcre/lib \
+ 	 /opt/include,/opt/lib"
+@@ -7021,14 +7022,14 @@ $as_echo_n "checking for the pcre library and header files ... " >&6; }
+         xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'`
+ 	xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'`
+ 	found=0
+-	if test -r $xincdir/$xincfile
++	if test -r $PKG_CONFIG_SYSROOT_DIR/$xincdir/$xincfile
+ 	then
+ 	  for E in $exts
+ 	  do
+-	    if test -r "$xlibdir/$xlibfile.$E"
++	    if test -r "$PKG_CONFIG_SYSROOT_DIR/$xlibdir/$xlibfile.$E"
+ 	    then
+-	      jd_pcre_include_dir="$xincdir"
+-	      jd_pcre_library_dir="$xlibdir"
++	      jd_pcre_include_dir="$PKG_CONFIG_SYSROOT_DIR/$xincdir"
++	      jd_pcre_library_dir="$PKG_CONFIG_SYSROOT_DIR/$xlibdir"
+ 	      jd_with_pcre_library="yes"
+ 	      found=1
+ 	      break
+@@ -7054,56 +7055,7 @@ $as_echo "yes: $jd_pcre_library_dir and $jd_pcre_include_dir" >&6; }
+     then
+       PCRE_LIB=""
+     else
+-
+-if test "X$jd_pcre_library_dir" != "X"
+-then
+-  if test "X$RPATH" = "X"
+-  then
+-
+-case "$host_os" in
+-  *linux*|*solaris* )
+-    if test "X$GCC" = Xyes
+-    then
+-      if test "X$ac_R_nospace" = "Xno"
+-      then
+-        RPATH="-Wl,-R,"
+-      else
+-        RPATH="-Wl,-R"
+-      fi
+-    else
+-      if test "X$ac_R_nospace" = "Xno"
+-      then
+-        RPATH="-R "
+-      else
+-	RPATH="-R"
+-      fi
+-    fi
+-  ;;
+-  *osf*|*openbsd*)
+-    if test "X$GCC" = Xyes
+-    then
+-      RPATH="-Wl,-rpath,"
+-    else
+-      RPATH="-rpath "
+-    fi
+-  ;;
+-  *netbsd*)
+-    if test "X$GCC" = Xyes
+-    then
+-      RPATH="-Wl,-R"
+-    fi
+-  ;;
+-esac
+-
+-    if test "X$RPATH" != "X"
+-    then
+-      RPATH="$RPATH$jd_pcre_library_dir"
+-    fi
+-  else
+-    RPATH="$RPATH:$jd_pcre_library_dir"
+-  fi
+-fi
+-
++      RPATH=""
+     fi
+ 
+     PCRE_INC=-I$jd_pcre_include_dir
+-- 
+1.7.4.1
+
diff --git a/meta/recipes-extended/slang/slang/rpathfix.patch b/meta/recipes-extended/slang/slang/rpathfix.patch
new file mode 100644
index 0000000..50cac92
--- /dev/null
+++ b/meta/recipes-extended/slang/slang/rpathfix.patch
@@ -0,0 +1,70 @@
+Without this patch we see rpaths hardcoded into the build which results in QA
+warnings. These rpaths are not needed so lets turn this off.
+
+Upstream-Status: Inappropriate
+(but could be turned into a proper configure option)
+
+RP 2012/03/14
+
+Index: slang-2.2.4/configure
+===================================================================
+--- slang-2.2.4.orig/configure	2012-03-14 23:40:01.283560679 +0000
++++ slang-2.2.4/configure	2012-03-14 23:41:18.023558900 +0000
+@@ -6081,56 +6081,7 @@
+ ELF_CFLAGS="$ELF_CFLAGS $IEEE_CFLAGS"
+ CFLAGS="$CFLAGS $IEEE_CFLAGS"
+ 
+-
+-if test "X$libdir" != "X"
+-then
+-  if test "X$RPATH" = "X"
+-  then
+-
+-case "$host_os" in
+-  *linux*|*solaris* )
+-    if test "X$GCC" = Xyes
+-    then
+-      if test "X$ac_R_nospace" = "Xno"
+-      then
+-        RPATH="-Wl,-R,"
+-      else
+-        RPATH="-Wl,-R"
+-      fi
+-    else
+-      if test "X$ac_R_nospace" = "Xno"
+-      then
+-        RPATH="-R "
+-      else
+-	RPATH="-R"
+-      fi
+-    fi
+-  ;;
+-  *osf*|*openbsd*)
+-    if test "X$GCC" = Xyes
+-    then
+-      RPATH="-Wl,-rpath,"
+-    else
+-      RPATH="-rpath "
+-    fi
+-  ;;
+-  *netbsd*)
+-    if test "X$GCC" = Xyes
+-    then
+-      RPATH="-Wl,-R"
+-    fi
+-  ;;
+-esac
+-
+-    if test "X$RPATH" != "X"
+-    then
+-      RPATH="$RPATH$libdir"
+-    fi
+-  else
+-    RPATH="$RPATH:$libdir"
+-  fi
+-fi
+-
++RPATH=""
+ 
+ # The cast to long int works around a bug in the HP C Compiler
+ # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
diff --git a/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch b/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch
new file mode 100644
index 0000000..958fe98
--- /dev/null
+++ b/meta/recipes-extended/slang/slang/slang-fix-the-iconv-existence-checking.patch
@@ -0,0 +1,116 @@
+From 4588f4a0287787788eb86fb16f326cbaa7454e1d Mon Sep 17 00:00:00 2001
+From: Zheng Junling <zhengjunling@huawei.com>
+Date: Mon, 16 Jun 2014 12:51:25 +0000
+Subject: [PATCH] slang: fix the iconv existence checking
+
+When checking whether there is iconv, the configure file always check 
+the host env.
+
+Now we make it working properly by adding correct prefix for cross-
+compiling environment.
+
+When enabling iconv-module, we see a QA warning because rpaths hardcoded
+into the build. And rpaths are not needed, so let's turn this off.
+
+This patch is generated by referencing the existing "fix-check-pcre"
+patch.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Zheng Junling <zhengjunling@huawei.com>
+---
+ configure | 60 ++++++------------------------------------------------------
+ 1 file changed, 6 insertions(+), 54 deletions(-)
+
+diff --git a/configure b/configure
+index 7a96256..91632f3 100755
+--- a/configure
++++ b/configure
+@@ -7909,6 +7909,7 @@ $as_echo_n "checking for the iconv library and header files ... " >&6; }
+ 	 /usr/include/iconv,/usr/lib \
+ 	 /usr/iconv/include,/usr/iconv/lib \
+ 	 /usr/include,/usr/lib \
++	 /usr/include,/usr/lib64 \
+ 	 /opt/include/iconv,/opt/lib \
+ 	 /opt/iconv/include,/opt/iconv/lib \
+ 	 /opt/include,/opt/lib"
+@@ -7939,14 +7940,14 @@ $as_echo_n "checking for the iconv library and header files ... " >&6; }
+         xincdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $1}'`
+ 	xlibdir=`echo $include_and_lib | tr ',' ' ' | awk '{print $2}'`
+ 	found=0
+-	if test -r $xincdir/$xincfile
++	if test -r $PKG_CONFIG_SYSROOT_DIR/$xincdir/$xincfile
+ 	then
+ 	  for E in $exts
+ 	  do
+-	    if test -r "$xlibdir/$xlibfile.$E"
++	    if test -r "$PKG_CONFIG_SYSROOT_DIR/$xlibdir/$xlibfile.$E"
+ 	    then
+-	      jd_iconv_include_dir="$xincdir"
+-	      jd_iconv_library_dir="$xlibdir"
++	      jd_iconv_include_dir="$PKG_CONFIG_SYSROOT_DIR/$xincdir"
++	      jd_iconv_library_dir="$PKG_CONFIG_SYSROOT_DIR/$xlibdir"
+ 	      jd_with_iconv_library="yes"
+ 	      found=1
+ 	      break
+@@ -7972,56 +7973,7 @@ $as_echo "yes: $jd_iconv_library_dir and $jd_iconv_include_dir" >&6; }
+     then
+       ICONV_LIB=""
+     else
+-
+-if test "X$jd_iconv_library_dir" != "X"
+-then
+-  if test "X$RPATH" = "X"
+-  then
+-
+-case "$host_os" in
+-  *linux*|*solaris* )
+-    if test "X$GCC" = Xyes
+-    then
+-      if test "X$ac_R_nospace" = "Xno"
+-      then
+-        RPATH="-Wl,-R,"
+-      else
+-        RPATH="-Wl,-R"
+-      fi
+-    else
+-      if test "X$ac_R_nospace" = "Xno"
+-      then
+-        RPATH="-R "
+-      else
+-	RPATH="-R"
+-      fi
+-    fi
+-  ;;
+-  *osf*|*openbsd*)
+-    if test "X$GCC" = Xyes
+-    then
+-      RPATH="-Wl,-rpath,"
+-    else
+-      RPATH="-rpath "
+-    fi
+-  ;;
+-  *netbsd*)
+-    if test "X$GCC" = Xyes
+-    then
+-      RPATH="-Wl,-R"
+-    fi
+-  ;;
+-esac
+-
+-    if test "X$RPATH" != "X"
+-    then
+-      RPATH="$RPATH$jd_iconv_library_dir"
+-    fi
+-  else
+-    RPATH="$RPATH:$jd_iconv_library_dir"
+-  fi
+-fi
+-
++      RPATH=""
+     fi
+ 
+     ICONV_INC=-I$jd_iconv_include_dir
+-- 
+1.8.3.4
+
diff --git a/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch b/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch
new file mode 100644
index 0000000..420001b
--- /dev/null
+++ b/meta/recipes-extended/slang/slang/sprintf-bug-concerning-8-bit-characters.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Backport
+
+From 3a05d1a920140e9f2c72791c12f664213feb46df Mon Sep 17 00:00:00 2001
+From: Manfred Hanke <Manfred.Hanke@tngtech.com>
+Date: Thu, 20 Jun 2013 10:24:12 +0200
+Subject: [PATCH] sprintf bug (concerning %c for 8-bit character in non-UTF8
+ mode) fixed
+
+char *str points to SLuchar_Type utf8_buf[], which had too small scope
+
+src/test/strops.sl failed in the following environment:
+ - compiler:  gcc (Debian 4.7.2-5) 4.7.2
+ - CFLAGS:    -g -O2
+ - libc:      GNU C Library (Debian EGLIBC 2.13-38) stable release version 2.13
+ - kernel:    3.2.0-4-686-pae #1 SMP Debian 3.2.39-2 i686 GNU/Linux
+---
+ src/slstrops.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/slstrops.c b/src/slstrops.c
+index ce6acb0..cbbbb01 100644
+--- a/src/slstrops.c
++++ b/src/slstrops.c
+@@ -1884,6 +1884,7 @@ static char *SLdo_sprintf (char *fmt) /*{{{*/
+ #endif
+    unsigned char uch;
+    int use_long = 0, use_alt_format = 0;
++   SLuchar_Type utf8_buf[SLUTF8_MAX_MBLEN+1];
+ 
+    while (1)
+      {
+@@ -2071,7 +2072,6 @@ static char *SLdo_sprintf (char *fmt) /*{{{*/
+ #endif
+ 	       {
+ 		  SLwchar_Type wc;
+-		  SLuchar_Type utf8_buf[SLUTF8_MAX_MBLEN+1];
+ 
+ 		  if (-1 == SLang_pop_wchar (&wc))
+ 		    return out;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/slang/slang_2.2.4.bb b/meta/recipes-extended/slang/slang_2.2.4.bb
new file mode 100644
index 0000000..5122f53
--- /dev/null
+++ b/meta/recipes-extended/slang/slang_2.2.4.bb
@@ -0,0 +1,54 @@
+SUMMARY = "The shared library for the S-Lang extension language"
+
+DESCRIPTION = "S-Lang is an interpreted language and a programming library.  The \
+S-Lang language was designed so that it can be easily embedded into \
+a program to provide the program with a powerful extension language. \
+The S-Lang library, provided in this package, provides the S-Lang \
+extension language.  S-Lang's syntax resembles C, which makes it easy \
+to recode S-Lang procedures in C if you need to."
+
+HOMEPAGE = "http://www.jedsoft.org/slang/"
+SECTION = "libs"
+DEPENDS = "pcre"
+PR = "r12"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a52a18a472d4f7e45479b06563717c02"
+
+
+SRC_URI = "ftp://space.mit.edu/pub/davis/slang/v2.2/slang-${PV}.tar.bz2 \
+           file://rpathfix.patch \
+           file://fix-check-pcre.patch \
+           file://change-char-type-to-signed-char-in-macros.patch \
+           file://sprintf-bug-concerning-8-bit-characters.patch \
+           file://slang-fix-the-iconv-existence-checking.patch \
+           file://0001-Fix-error-conflicting-types-for-posix_close.patch \
+          "
+
+inherit autotools-brokensep
+
+CLEANBROKEN = "1"
+
+SRC_URI[md5sum] = "7fcfd447e378f07dd0c0bae671fe6487"
+SRC_URI[sha256sum] = "9a8257a9a2a55099af858b13338dc8f3a06dd2069f46f0df2c9c3bb84a01d5db"
+
+EXTRA_OECONF += " --without-z --without-png --without-onig --x-includes=${STAGING_DIR_HOST}/usr/include/X11 --x-libraries=${STAGING_DIR_HOST}/usr/lib"
+
+do_configure_prepend() {
+    # slang keeps configure.ac and rest of autoconf files in autoconf/ directory
+    # we have to go there to be able to run gnu-configize cause it expects configure.{in,ac}
+    # to be present. Resulting files land in autoconf/autoconf/ so we need to move them.
+    cd ${S}/autoconf && gnu-configize --force && mv autoconf/config.* .
+    cd ${B}
+}
+
+do_install() {
+	oe_runmake install DESTDIR=${D} -e 'INST_LIB_DIR=${STAGING_DIR_HOST}/usr/lib'
+}
+
+FILES_${PN} += "${libdir}/${BPN}/v2/modules/ ${datadir}/slsh/"
+FILES_${PN}-dbg += "${libdir}/${BPN}/v2/modules/.debug"
+
+PARALLEL_MAKE = ""
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch b/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch
new file mode 100644
index 0000000..032995d
--- /dev/null
+++ b/meta/recipes-extended/stat/stat-3.3/fix-error-return.patch
@@ -0,0 +1,16 @@
+This patch fixies the wrong return code of stat -h.
+
+Upstream-Status: Pending
+Signed-off-by: Zhangle Yang <zhangle.yang@windriver.com>
+
+--- stat-3.3/stat.c.orig	2013-08-22 10:49:45.000000000 +0800
++++ stat-3.3/stat.c	2013-08-22 10:50:31.000000000 +0800
+@@ -845,7 +845,7 @@
+     fprintf(stderr, "\t\t%%S - Security ID in SE-Linux\n");
+     fprintf(stderr, "\t\t%%C - Security context in SE-Linux\n");
+     fprintf(stderr, "\t\t%%d - Free file nodes in file system\n");
+-    exit(1);
++    exit(0);
+ }
+   
+ 
diff --git a/meta/recipes-extended/stat/stat_3.3.bb b/meta/recipes-extended/stat/stat_3.3.bb
new file mode 100644
index 0000000..651831e
--- /dev/null
+++ b/meta/recipes-extended/stat/stat_3.3.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Command line file status display utility"
+DESCRIPTION = "Displays all information about a file that the stat() call provides and all information about a filesystem that statfs() provides."
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=39886b077fd072e876e5c4c16310b631 \
+                    file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SRC_URI = "http://www.ibiblio.org/pub/Linux/utils/file/${BP}.tar.gz \
+           file://fix-error-return.patch"
+
+SRC_URI[md5sum] = "37e247e8e400ad9205f1b0500b728fd3"
+SRC_URI[sha256sum] = "7071f0384a423a938dd542c1f08547a02824f6359acd3ef3f944b2c4c2d1ee09"
+
+do_install() {
+	install -d ${D}${base_bindir} ${D}${mandir}/man1
+	install -m 755 stat ${D}${base_bindir}/stat.stat
+	install -m 644 stat.1 ${D}${mandir}/man1
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "stat"
+ALTERNATIVE_PRIORITY[stat] = "200"
+ALTERNATIVE_LINK_NAME[stat] = "${base_bindir}/stat"
+ALTERNATIVE_TARGET[stat] = "${base_bindir}/stat.stat"
+
+ALTERNATIVE_${PN}-doc = "stat.1"
+ALTERNATIVE_LINK_NAME[stat.1] = "${mandir}/man1/stat.1"
+
+BBCLASSEXTEND = "native"
+
diff --git a/meta/recipes-extended/stress/files/texinfo.patch b/meta/recipes-extended/stress/files/texinfo.patch
new file mode 100644
index 0000000..5ac5951
--- /dev/null
+++ b/meta/recipes-extended/stress/files/texinfo.patch
@@ -0,0 +1,79 @@
+--- a/doc/stress.texi
++++ b/doc/stress.texi
+@@ -62,47 +62,47 @@
+ 
+ @table @samp
+ @item -?
+-@itemx --help
++@item --help
+ Show help information.
+ 
+-@itemx --version
++@item --version
+ Show version information.
+ 
+ @item -v
+-@itemx --verbose
++@item --verbose
+ Turn up verbosity.
+ 
+ @item -q
+-@itemx --quiet
++@item --quiet
+ Turn down verbosity.
+ 
+ @item -n
+-@itemx --dry-run
++@item --dry-run
+ Show what would have been done.
+ 
+ @item -t @var{secs}
+-@itemx --timeout @var{secs}
++@item --timeout @var{secs}
+ Time out after @var{secs} seconds.
+ 
+-@itemx --backoff @var{usecs}
++@item --backoff @var{usecs}
+ Wait for factor of @var{usecs} microseconds before starting work.
+ 
+ @item -c @var{forks}
+-@itemx --cpu @var{forks}
++@item --cpu @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{sqrt()}.
+ 
+ @item -i @var{forks}
+-@itemx --io @var{forks}
++@item --io @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{sync()}.
+ 
+ @item -m @var{forks}
+-@itemx --vm @var{forks}
++@item --vm @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{malloc()}.
+ 
+-@itemx --vm-bytes @var{bytes}
++@item --vm-bytes @var{bytes}
+ Allocate @var{bytes} number of bytes.  The default is 1.
+ 
+-@itemx --vm-hang
++@item --vm-hang
+ Instruct each vm hog process to go to sleep after allocating memory.  This
+ contrasts with their normal behavior, which is to free the memory and
+ reallocate @emph{ad infinitum}.  This is useful for simulating low memory
+@@ -114,13 +114,13 @@
+ @end example
+ 
+ @item -d @var{forks}
+-@itemx --hdd @var{forks}
++@item --hdd @var{forks}
+ Spawn @var{forks} processes each spinning on @samp{write()}.
+ 
+-@itemx --hdd-bytes @var{bytes}
++@item --hdd-bytes @var{bytes}
+ Write @var{bytes} number of bytes.  The default is 1GB.
+ 
+-@itemx --hdd-noclean
++@item --hdd-noclean
+ Do not unlink file(s) to which random ASCII data is written.
+ 
+ @end table
diff --git a/meta/recipes-extended/stress/stress_1.0.4.bb b/meta/recipes-extended/stress/stress_1.0.4.bb
new file mode 100644
index 0000000..4b7e4ba
--- /dev/null
+++ b/meta/recipes-extended/stress/stress_1.0.4.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "Deliberately simple workload generator for POSIX systems. It \
+imposes a configurable amount of CPU, memory, I/O, and disk stress on the system."
+HOMEPAGE = "http://people.seas.harvard.edu/~apw/stress/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "http://people.seas.harvard.edu/~apw/${BPN}/${BP}.tar.gz \
+           file://texinfo.patch \
+           "
+
+SRC_URI[md5sum] = "890a4236dd1656792f3ef9a190cf99ef"
+SRC_URI[sha256sum] = "057e4fc2a7706411e1014bf172e4f94b63a12f18412378fca8684ca92408825b"
+
+inherit autotools
diff --git a/meta/recipes-extended/sudo/files/sudo.pam b/meta/recipes-extended/sudo/files/sudo.pam
new file mode 100644
index 0000000..5bc26e7
--- /dev/null
+++ b/meta/recipes-extended/sudo/files/sudo.pam
@@ -0,0 +1,6 @@
+#%PAM-1.0
+auth       include      common-auth
+account    include      common-account
+password   include      common-password
+session    required     pam_keyinit.so revoke
+session    required     pam_limits.so
diff --git a/meta/recipes-extended/sudo/sudo.inc b/meta/recipes-extended/sudo/sudo.inc
new file mode 100644
index 0000000..a25876b
--- /dev/null
+++ b/meta/recipes-extended/sudo/sudo.inc
@@ -0,0 +1,40 @@
+SUMMARY = "Provide limited super user privileges to specific users"
+DESCRIPTION = "Sudo (superuser do) allows a system administrator to give certain users (or groups of users) the ability to run some (or all) commands as root while logging all commands and arguments."
+HOMEPAGE = "http://www.sudo.ws"
+BUGTRACKER = "http://www.sudo.ws/bugs/"
+SECTION = "admin"
+LICENSE = "ISC & BSD & Zlib"
+LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=c16e542408abda013d672be8eb88d174 \
+                    file://plugins/sudoers/redblack.c;beginline=1;endline=41;md5=cfe41112f96c19a074934d128f45c693 \
+                    file://lib/util/reallocarray.c;beginline=3;endline=16;md5=85b0905b795d4d58bf2e00635649eec6 \
+                    file://lib/util/fnmatch.c;beginline=3;endline=27;md5=67f83ee9bd456557397082f8f1be0efd \
+                    file://lib/util/getcwd.c;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \
+                    file://lib/util/glob.c;beginline=6;endline=31;md5=5872733146b9eb0deb79e1f664815b85 \
+                    file://lib/util/snprintf.c;beginline=6;endline=34;md5=c82c1b3a5c32e08545c9ec5d71e41e50 \
+                    file://include/sudo_queue.h;beginline=5;endline=27;md5=449af4cc57fc7d46f42090608ba3e681 \
+                    file://lib/util/inet_pton.c;beginline=3;endline=17;md5=3970ab0518ab79cbd0bafb697f10b33a"
+
+inherit autotools
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib"
+
+CONFFILES_${PN} = "${sysconfdir}/sudoers"
+
+EXTRA_OECONF = "--with-editor=/bin/vi --with-env-editor"
+
+EXTRA_OECONF_append_libc-musl = " --disable-hardening "
+
+# mksigname/mksiglist are used on build host to generate source files
+do_compile_prepend () {
+	oe_runmake SSP_CFLAGS="" SSP_LDFLAGS="" CC="$BUILD_CC" CFLAGS="$BUILD_CFLAGS" CPPFLAGS="$BUILD_CPPFLAGS -I${S}/include -I${S} -I${B}"  -C lib/util mksigname mksiglist
+}
+
+# Explicitly create ${localstatedir}/lib before do_install to ensure
+# the directory is accessible by all users. Otherwise the mkinstalldirs
+# script (from sudo) will recursively create ${localstatedir}/lib/sudo
+# and then chmod each directory with 0700 permissions, which isn't what
+# we want (i.e, users would not be able to access /var/lib).
+do_install_prepend (){
+	mkdir -p ${D}/${localstatedir}/lib
+}
diff --git a/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch b/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch
new file mode 100644
index 0000000..eb36cd4
--- /dev/null
+++ b/meta/recipes-extended/sudo/sudo/0001-Include-sys-types.h-for-id_t-definition.patch
@@ -0,0 +1,34 @@
+From 386e2c2fa2ab2e02ef71c268a57205139be329ab Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 07:07:49 +0000
+Subject: [PATCH] Include sys/types.h for id_t definition
+
+/sudo_util.h:219:14: error: unknown type name 'id_t'
+ __dso_public id_t sudo_strtoid_v1(const char *str, const char *sep,
+ char **endp, const char **errstr);
+               ^
+	       make[1]: *** [preserve_fds.o] Error 1
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ include/sudo_util.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/sudo_util.h b/include/sudo_util.h
+index 89c9f89..ac0855a 100644
+--- a/include/sudo_util.h
++++ b/include/sudo_util.h
+@@ -17,6 +17,8 @@
+ #ifndef SUDO_UTIL_H
+ #define SUDO_UTIL_H
+ 
++#include <sys/types.h>
++
+ #ifdef HAVE_STDBOOL_H
+ # include <stdbool.h>
+ #else
+-- 
+2.5.1
+
diff --git a/meta/recipes-extended/sudo/sudo/0001-Use-correct-path-to-init.d-and-tmpfiles.d-files.patch b/meta/recipes-extended/sudo/sudo/0001-Use-correct-path-to-init.d-and-tmpfiles.d-files.patch
new file mode 100644
index 0000000..2418689
--- /dev/null
+++ b/meta/recipes-extended/sudo/sudo/0001-Use-correct-path-to-init.d-and-tmpfiles.d-files.patch
@@ -0,0 +1,31 @@
+The makefile uses top_srcdir to find files that were created by configure, when
+it should use top_builddir.
+
+Upstream-Status: Submitted (http://bugzilla.sudo.ws/show_bug.cgi?id=708)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+---
+ src/Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/Makefile.in b/src/Makefile.in
+index f009e10..7acfb2d 100644
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -165,11 +165,11 @@ install-dirs:
+ 
+ install-rc: install-dirs
+ 	if [ -n "$(INIT_SCRIPT)" ]; then \
+-	    $(INSTALL) $(INSTALL_OWNER) -m 0755 $(top_srcdir)/init.d/$(INIT_SCRIPT) $(DESTDIR)$(INIT_DIR)/sudo; \
++	    $(INSTALL) $(INSTALL_OWNER) -m 0755 $(top_builddir)/init.d/$(INIT_SCRIPT) $(DESTDIR)$(INIT_DIR)/sudo; \
+ 	    rm -f $(DESTDIR)$(RC_LINK); \
+ 	    ln -s $(INIT_DIR)/sudo $(DESTDIR)$(RC_LINK); \
+ 	elif test -n "$(tmpfiles_d)"; then \
+-	    $(INSTALL) $(INSTALL_OWNER) -m 0644 $(top_srcdir)/init.d/sudo.conf $(DESTDIR)$(tmpfiles_d)/sudo.conf; \
++	    $(INSTALL) $(INSTALL_OWNER) -m 0644 $(top_builddir)/init.d/sudo.conf $(DESTDIR)$(tmpfiles_d)/sudo.conf; \
+ 	fi
+ 
+ install-binaries: install-dirs $(PROGS)
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/sudo/sudo_1.8.14p3.bb b/meta/recipes-extended/sudo/sudo_1.8.14p3.bb
new file mode 100644
index 0000000..6b3cd6d
--- /dev/null
+++ b/meta/recipes-extended/sudo/sudo_1.8.14p3.bb
@@ -0,0 +1,36 @@
+require sudo.inc
+
+SRC_URI = "http://ftp.sudo.ws/sudo/dist/sudo-${PV}.tar.gz \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
+           file://0001-Use-correct-path-to-init.d-and-tmpfiles.d-files.patch \
+           file://0001-Include-sys-types.h-for-id_t-definition.patch \
+           "
+
+PAM_SRC_URI = "file://sudo.pam"
+
+SRC_URI[md5sum] = "93dbd1e47c136179ff1b01494c1c0e75"
+SRC_URI[sha256sum] = "a8a697cbb113859058944850d098464618254804cf97961dee926429f00a1237"
+
+DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
+RDEPENDS_${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}"
+
+EXTRA_OECONF += " \
+             ac_cv_type_rsize_t=no \
+             ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)} \
+             ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '--enable-tmpfiles.d=${libdir}/tmpfiles.d', '--disable-tmpfiles.d', d)} \
+             "
+
+do_install_append () {
+	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" = "pam" ]; then
+		install -D -m 664 ${WORKDIR}/sudo.pam ${D}/${sysconfdir}/pam.d/sudo
+	fi
+
+	chmod 4111 ${D}${bindir}/sudo
+	chmod 0440 ${D}${sysconfdir}/sudoers
+
+	# Explicitly remove the ${localstatedir}/run directory to avoid QA error
+	rmdir -p --ignore-fail-on-non-empty ${D}${localstatedir}/run/sudo
+}
+
+FILES_${PN} += "${libdir}/tmpfiles.d"
+FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/*.la"
diff --git a/meta/recipes-extended/sysklogd/files/no-strip-install.patch b/meta/recipes-extended/sysklogd/files/no-strip-install.patch
new file mode 100644
index 0000000..00fba71
--- /dev/null
+++ b/meta/recipes-extended/sysklogd/files/no-strip-install.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: sysklogd-1.5/Makefile
+===================================================================
+--- sysklogd-1.5.orig/Makefile	2009-06-09 13:02:41.000000000 +0200
++++ sysklogd-1.5/Makefile	2009-06-09 13:03:06.000000000 +0200
+@@ -127,8 +127,8 @@
+ 	rm -f syslogd klogd ksym syslog_tst oops_test TAGS tsyslogd tklogd
+ 
+ install_exec: syslogd klogd
+-	${INSTALL} -m 500 -s syslogd ${BINDIR}/syslogd
+-	${INSTALL} -m 500 -s klogd ${BINDIR}/klogd
++	${INSTALL} -m 500 syslogd ${BINDIR}/syslogd
++	${INSTALL} -m 500 klogd ${BINDIR}/klogd
+ 
+ install_man:
+ 	${INSTALL} -m ${MAN_PERMS} sysklogd.8 ${MANDIR}/man8/sysklogd.8
diff --git a/meta/recipes-extended/sysklogd/files/no-vectorization.patch b/meta/recipes-extended/sysklogd/files/no-vectorization.patch
new file mode 100644
index 0000000..c1cc042
--- /dev/null
+++ b/meta/recipes-extended/sysklogd/files/no-vectorization.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate
+
+The compiler should not be generating vectorized instructions on this target.
+This is a work around until I can determine why this is occuring on this
+particular recipe
+
+Index: sysklogd-1.5/Makefile
+===================================================================
+--- sysklogd-1.5.orig/Makefile
++++ sysklogd-1.5/Makefile
+@@ -20,7 +20,8 @@
+ CC= gcc
+ #SKFLAGS= -g -DSYSV -Wall
+ #LDFLAGS= -g
+-SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce
++SKFLAGS= $(RPM_OPT_FLAGS) -O3 -DSYSV -fomit-frame-pointer -Wall -fno-strength-reduce \
++	-fno-tree-vectorize
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+ # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+ # $(shell getconf LFS_SKFLAGS)
diff --git a/meta/recipes-extended/sysklogd/files/sysklogd b/meta/recipes-extended/sysklogd/files/sysklogd
new file mode 100755
index 0000000..258f882
--- /dev/null
+++ b/meta/recipes-extended/sysklogd/files/sysklogd
@@ -0,0 +1,151 @@
+#! /bin/sh
+# /etc/init.d/sysklogd: start the system log daemon.
+
+### BEGIN INIT INFO
+# Provides:             sysklogd
+# Required-Start:       $remote_fs $time
+# Required-Stop:        $remote_fs $time
+# Should-Start:         $network
+# Should-Stop:          $network
+# Default-Start:        2 3 4 5
+# Default-Stop:         0 1 6
+# Short-Description:    System logger
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+pidfile_syslogd=/var/run/syslogd.pid
+pidfile_klogd=/var/run/klogd.pid
+binpath_syslogd=/sbin/syslogd
+binpath_klogd=/sbin/klogd
+
+test -x $binpath || exit 0
+
+test ! -r /etc/default/syslogd || . /etc/default/syslogd
+
+create_xconsole()
+{
+    # Only proceed if /dev/xconsole is used at all
+    if ! grep -q '^[^#].*/dev/xconsole' /etc/syslog.conf
+    then
+	return
+    fi
+
+    if [ ! -e /dev/xconsole ]; then
+	mknod -m 640 /dev/xconsole p
+    else
+	chmod 0640 /dev/xconsole
+    fi
+    chown root:adm /dev/xconsole
+    test ! -x /sbin/restorecon || /sbin/restorecon /dev/xconsole
+}
+
+log_begin_msg () {
+    echo -n $1
+}
+
+log_end_msg () {
+    echo $1
+}
+
+log_success_msg () {
+    echo $1
+}
+
+running()
+{
+    # No pidfile, probably no daemon present
+    #
+    if [ ! -f $pidfile ]
+    then
+	return 1
+    fi
+
+    pid=`cat $pidfile_syslogd`
+
+    # No pid, probably no daemon present
+    #
+    if [ -z "$pid" ]
+    then
+	return 1
+    fi
+
+    if [ ! -d /proc/$pid ]
+    then
+	return 1
+    fi
+
+    cmd=`cat /proc/$pid/cmdline | tr "\000" "\n"|head -n 1`
+
+    # No syslogd?
+    #
+    if [ "$cmd" != "$binpath" ]
+    then
+	return 1
+    fi
+
+    return 0
+}
+
+case "$1" in
+  start)
+    log_begin_msg "Starting system log daemon..."
+    create_xconsole
+    start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD
+    log_end_msg $?
+    log_begin_msg "Starting kernel log daemon..."
+    start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+    log_end_msg $?
+    ;;
+  stop)
+    log_begin_msg "Stopping system log daemon..."
+    start-stop-daemon --stop --quiet --pidfile $pidfile_syslogd --name syslogd
+    log_end_msg $?
+    log_begin_msg "Stopping kernel log daemon..."
+    start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+    log_end_msg $?
+    ;;
+  reload|force-reload)
+    log_begin_msg "Reloading system log daemon..."
+    start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile_syslogd --name syslogd
+    log_end_msg $?
+    log_begin_msg "Reloading kernel log daemon..."
+    start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+    start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+    log_end_msg $?
+    ;;
+  restart)
+    log_begin_msg "Restarting system log daemon..."
+    start-stop-daemon --stop --retry 5 --quiet --pidfile $pidfile_syslogd --name syslogd
+    start-stop-daemon --start --quiet --pidfile $pidfile_syslogd --name syslogd --startas $binpath_syslogd -- $SYSLOGD
+    log_end_msg $?
+    log_begin_msg "Reloading kernel log daemon..."
+    start-stop-daemon --stop --quiet --retry 3 --exec $binpath_klogd --pidfile $pidfile_klogd
+    start-stop-daemon --start --quiet --pidfile $pidfile_klogd --name klogd --startas $binpath_klogd -- $KLOGD
+    log_end_msg $?
+    ;;
+  reload-or-restart)
+    if running
+    then
+	$0 reload
+    else
+	$0 start
+    fi
+    ;;
+  status)
+    status syslogd
+    RETVAL=$?
+    status klogd
+    rval=$?
+    [ $RETVAL -eq 0 ] && exit $rval
+    exit $RETVAL
+    ;;
+  *)
+    log_success_msg "Usage: /etc/init.d/sysklogd {start|stop|reload|restart|force-reload|reload-or-restart|status}"
+    exit 1
+esac
+
+exit 0
diff --git a/meta/recipes-extended/sysklogd/files/syslog.conf b/meta/recipes-extended/sysklogd/files/syslog.conf
new file mode 100644
index 0000000..0849de1
--- /dev/null
+++ b/meta/recipes-extended/sysklogd/files/syslog.conf
@@ -0,0 +1,71 @@
+#  /etc/syslog.conf	Configuration file for syslogd.
+#
+#  Ported from debian by Yu Ke <ke.yu@intel.com>
+#
+
+#
+# First some standard logfiles.  Log by facility.
+#
+
+auth,authpriv.*			/var/log/auth.log
+*.*;auth,authpriv.none		-/var/log/syslog
+#cron.*				/var/log/cron.log
+daemon.*			-/var/log/daemon.log
+kern.*				-/var/log/kern.log
+lpr.*				-/var/log/lpr.log
+mail.*				-/var/log/mail.log
+user.*				-/var/log/user.log
+
+#
+# Logging for the mail system.  Split it up so that
+# it is easy to write scripts to parse these files.
+#
+mail.info			-/var/log/mail.info
+mail.warn			-/var/log/mail.warn
+mail.err			/var/log/mail.err
+
+# Logging for INN news system
+#
+news.crit			/var/log/news.crit
+news.err			/var/log/news.err
+news.notice			-/var/log/news.notice
+
+#
+# Some `catch-all' logfiles.
+#
+*.=debug;\
+auth,authpriv.none;\
+news.none;mail.none	-/var/log/debug
+
+*.=info;*.=notice;*.=warn;\
+auth,authpriv.none;\
+cron,daemon.none;\
+mail,news.none		-/var/log/messages
+
+#
+# Emergencies are sent to everybody logged in.
+#
+*.emerg				*
+
+#
+# I like to have messages displayed on the console, but only on a virtual
+# console I usually leave idle.
+#
+#daemon,mail.*;\
+#news.=crit;news.=err;news.=notice;\
+#*.=debug;*.=info;\
+#*.=notice;*.=warn	/dev/tty8
+
+# The named pipe /dev/xconsole is for the `xconsole' utility.  To use it,
+# you must invoke `xconsole' with the `-file' option:
+#
+#    $ xconsole -file /dev/xconsole [...]
+#
+# NOTE: adjust the list below, or you'll go crazy if you have a reasonably
+#      busy site..
+#
+daemon.*;mail.*;\
+news.err;\
+*.=debug;*.=info;\
+*.=notice;*.=warn	|/dev/xconsole
+
diff --git a/meta/recipes-extended/sysklogd/sysklogd.inc b/meta/recipes-extended/sysklogd/sysklogd.inc
new file mode 100644
index 0000000..bcf8aa7
--- /dev/null
+++ b/meta/recipes-extended/sysklogd/sysklogd.inc
@@ -0,0 +1,58 @@
+SUMMARY = "System Log Daemons"
+DESCRIPTION = "The sysklogd package implements two system log daemons: syslogd, klogd"
+HOMEPAGE = "http://www.infodrom.org/projects/sysklogd/"
+SECTION = "base"
+
+LICENSE = "GPLv2+ & BSD"
+LICENSE_syslogd = "BSD"
+LICENSE_klogd = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \
+                    file://syslogd.c;beginline=2;endline=15;md5=77ffb2fec48c46d7ca0abb2d5813e7fd \
+                    file://klogd.c;beginline=2;endline=19;md5=7e87ed0ae6142de079bce738c10c899d \
+                   "
+
+inherit update-rc.d update-alternatives
+
+SRC_URI = "http://www.infodrom.org/projects/sysklogd/download/sysklogd-${PV}.tar.gz \
+           file://no-strip-install.patch \
+           file://sysklogd \
+           file://syslog.conf \
+           "
+
+SRC_URI_append_e500v2 = " file://no-vectorization.patch"
+
+INITSCRIPT_NAME = "syslog"
+CONFFILES_${PN} = "${sysconfdir}/syslog.conf.${BPN}"
+
+CFLAGS_append = " -DSYSV"
+
+do_install () {
+	install -d ${D}${mandir}/man8 \
+			${D}${mandir}/man5 \
+			${D}${base_sbindir}
+	oe_runmake 'BINDIR=${D}${base_sbindir}' \
+			'MANDIR=${D}${mandir}' install
+	install -d ${D}${sysconfdir}
+	install -m 644 ${WORKDIR}/syslog.conf ${D}${sysconfdir}/syslog.conf
+	install -d ${D}${sysconfdir}/init.d
+	install -m 755 ${WORKDIR}/sysklogd ${D}${sysconfdir}/init.d/syslog
+}
+
+# sysklogd package has no internal systemd support, so we weigh busybox's
+# sysklogd utility over it in case of systemd
+ALTERNATIVE_PRIORITY = "${@bb.utils.contains('DISTRO_FEATURES','systemd','10','100',d)}"
+
+ALTERNATIVE_${PN} = "syslogd klogd syslog-init syslog-conf"
+
+ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd"
+ALTERNATIVE_LINK_NAME[klogd] = "${base_sbindir}/klogd"
+ALTERNATIVE_LINK_NAME[syslog-init] = "${sysconfdir}/init.d/syslog"
+ALTERNATIVE_LINK_NAME[syslog-conf] = "${sysconfdir}/syslog.conf"
+
+pkg_prerm_${PN} () {
+	if test "x$D" = "x"; then
+	if test "$1" = "upgrade" -o "$1" = "remove"; then
+		/etc/init.d/syslog stop
+	fi
+	fi
+}
diff --git a/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb b/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb
new file mode 100644
index 0000000..975ecc2
--- /dev/null
+++ b/meta/recipes-extended/sysklogd/sysklogd_1.5.1.bb
@@ -0,0 +1,4 @@
+require sysklogd.inc
+
+SRC_URI[md5sum] = "c70599ab0d037fde724f7210c2c8d7f8"
+SRC_URI[sha256sum] = "5166c185ae23c92e8b9feee66a6e3d0bc944bf673112f53e3ecf62e08ce7c201"
diff --git a/meta/recipes-extended/sysstat/sysstat.inc b/meta/recipes-extended/sysstat/sysstat.inc
new file mode 100644
index 0000000..5c761fa
--- /dev/null
+++ b/meta/recipes-extended/sysstat/sysstat.inc
@@ -0,0 +1,55 @@
+SUMMARY = "System performance tools"
+DESCRIPTION = "The sysstat utilities are a collection of performance monitoring tools for Linux."
+HOMEPAGE = "http://sebastien.godard.pagesperso-orange.fr/"
+LICENSE = "GPLv2+"
+SECTION = "console/utils"
+
+SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/sysstat-${PV}.tar.xz \
+           file://99_sysstat \
+           file://sysstat.service \
+          "
+
+DEPENDS += "base-passwd"
+
+inherit autotools-brokensep gettext systemd
+
+EXTRA_OECONF += "--disable-sensors"
+EXTRA_OEMAKE += 'LFLAGS=""'
+
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "sysstat.service"
+SYSTEMD_AUTO_ENABLE = "enable"
+
+do_configure_prepend() {
+    export sa_lib_dir=${libdir}/sa
+}
+
+do_install() {
+	autotools_do_install
+
+	# don't install /var/log/sa when populating rootfs. Do it through volatile
+
+	rm -rf ${D}/var
+	install -d ${D}/etc/default/volatiles
+	install -m 0644 ${WORKDIR}/99_sysstat ${D}/etc/default/volatiles
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/sysstat.service ${D}${systemd_unitdir}/system
+	sed -i -e 's#@LIBDIR@#${libdir}#g' ${D}${systemd_unitdir}/system/sysstat.service
+}
+
+pkg_postinst_${PN} () {
+        if [ -n "$D" ]; then
+                exit 0
+        fi
+        if [ -e /etc/init.d/populate-volatile.sh ]; then
+                /etc/init.d/populate-volatile.sh update
+        fi
+}
+
+
+FILES_${PN} += "${libdir}/sa"
+FILES_${PN}-dbg += "${libdir}/sa/.debug/"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+LDFLAGS_append_libc-uclibc = " -lintl"
diff --git a/meta/recipes-extended/sysstat/sysstat/99_sysstat b/meta/recipes-extended/sysstat/sysstat/99_sysstat
new file mode 100644
index 0000000..0b0ec30
--- /dev/null
+++ b/meta/recipes-extended/sysstat/sysstat/99_sysstat
@@ -0,0 +1 @@
+d root root 0755 /var/log/sa none
diff --git a/meta/recipes-extended/sysstat/sysstat/sysstat.service b/meta/recipes-extended/sysstat/sysstat/sysstat.service
new file mode 100644
index 0000000..aff0710
--- /dev/null
+++ b/meta/recipes-extended/sysstat/sysstat/sysstat.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Resets System Activity Logs
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+User=root
+ExecStart=@LIBDIR@/sa/sa1 --boot
+
+[Install]
+WantedBy=multi-user.target
+
diff --git a/meta/recipes-extended/sysstat/sysstat_11.1.5.bb b/meta/recipes-extended/sysstat/sysstat_11.1.5.bb
new file mode 100644
index 0000000..69d2ec2
--- /dev/null
+++ b/meta/recipes-extended/sysstat/sysstat_11.1.5.bb
@@ -0,0 +1,7 @@
+require sysstat.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+SRC_URI[md5sum] = "4d8e6e72d057189a1660462a678d9ada"
+SRC_URI[sha256sum] = "feb3a90d86ffd69cf5b88144a8876ae05bd42384f559676f08100671589fa2bb"
+
diff --git a/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch b/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch
new file mode 100644
index 0000000..da2ae3c
--- /dev/null
+++ b/meta/recipes-extended/tar/tar-1.17/avoid_heap_overflow.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Inappropriate [bugfix: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624]
+
+This patch avoids heap overflow reported by :
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0624
+
+This is a clean patch for the GPLv2 tar recipe.
+
+Nitin A Kamble <nitin.a.kamble@intel.com> 2011/04/25
+
+Index: tar-1.17/lib/rtapelib.c
+===================================================================
+--- tar-1.17.orig/lib/rtapelib.c
++++ tar-1.17/lib/rtapelib.c
+@@ -570,7 +570,7 @@ rmt_read__ (int handle, char *buffer, si
+ 
+   sprintf (command_buffer, "R%lu\n", (unsigned long) length);
+   if (do_command (handle, command_buffer) == -1
+-      || (status = get_status (handle)) == SAFE_READ_ERROR)
++      || ((status = get_status (handle)) == SAFE_READ_ERROR) || (status > length))
+     return SAFE_READ_ERROR;
+ 
+   for (counter = 0; counter < status; counter += rlen, buffer += rlen)
diff --git a/meta/recipes-extended/tar/tar-1.17/gcc43build.patch b/meta/recipes-extended/tar/tar-1.17/gcc43build.patch
new file mode 100644
index 0000000..f8059a0
--- /dev/null
+++ b/meta/recipes-extended/tar/tar-1.17/gcc43build.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Fix errors when built with gcc 4.3
+# Patch taken from Debian bug #452096
+
+diff -urN tar-1.17.orig/lib/argp-fmtstream.h tar-1.17/lib/argp-fmtstream.h
+--- tar-1.17.orig/lib/argp-fmtstream.h	2006-01-11 12:24:05.000000000 -0800
++++ tar-1.17/lib/argp-fmtstream.h	2010-07-22 22:36:12.000000000 -0700
+@@ -198,7 +198,11 @@
+ #endif
+ 
+ #ifndef ARGP_FS_EI
+-#define ARGP_FS_EI extern inline
++ #if defined __GNUC_STDC_INLINE__
++   #define ARGP_FS_EI extern inline __attribute__((__gnu_inline__))
++ #else
++   #define ARGP_FS_EI extern inline
++ #endif
+ #endif
+ 
+ ARGP_FS_EI size_t
+diff -urN tar-1.17.orig/lib/argp.h tar-1.17/lib/argp.h
+--- tar-1.17.orig/lib/argp.h	2007-03-30 00:09:11.000000000 -0700
++++ tar-1.17/lib/argp.h	2010-07-22 22:38:44.000000000 -0700
+@@ -580,7 +580,11 @@
+ # endif
+ 
+ # ifndef ARGP_EI
+-#  define ARGP_EI extern __inline__
++#  if defined __GNUC_STDC_INLINE__
++#    define ARGP_EI extern __inline__ __attribute__((__gnu_inline__))
++#  else
++#    define ARGP_EI extern __inline__
++#  endif
+ # endif
+ 
+ ARGP_EI void
diff --git a/meta/recipes-extended/tar/tar-1.17/m4extensions.patch b/meta/recipes-extended/tar/tar-1.17/m4extensions.patch
new file mode 100644
index 0000000..30534c2
--- /dev/null
+++ b/meta/recipes-extended/tar/tar-1.17/m4extensions.patch
@@ -0,0 +1,30 @@
+Upstream-Status: Inappropriate [licensing]
+
+# Define AC_USE_SYSTEM_EXTENSIONS only if it was previously undefined.
+# This is needed to configure correctly with newer versions of autoconf.
+
+--- tar-1.17/m4/extensions.m4.orig	2010-07-22 22:21:35.000000000 -0700
++++ tar-1.17/m4/extensions.m4	2010-07-22 22:23:41.000000000 -0700
+@@ -1,4 +1,4 @@
+-# serial 4  -*- Autoconf -*-
++# serial 5  -*- Autoconf -*-
+ # Enable extensions on systems that normally disable them.
+ 
+ # Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+@@ -16,6 +16,7 @@
+ # ------------------------
+ # Enable extensions on systems that normally disable them,
+ # typically due to standards-conformance issues.
++m4_ifdef([AC_USE_SYSTEM_EXTENSIONS], [], [
+ AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+ [
+   AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+@@ -48,7 +49,7 @@
+     AC_DEFINE([__EXTENSIONS__])
+   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+   AC_DEFINE([_TANDEM_SOURCE])
+-])
++])])
+ 
+ # gl_USE_SYSTEM_EXTENSIONS
+ # ------------------------
diff --git a/meta/recipes-extended/tar/tar.inc b/meta/recipes-extended/tar/tar.inc
new file mode 100644
index 0000000..b339c43
--- /dev/null
+++ b/meta/recipes-extended/tar/tar.inc
@@ -0,0 +1,50 @@
+SUMMARY = "GNU file archiving program"
+DESCRIPTION = "GNU tar saves many files together into a single tape \
+or disk archive, and can restore individual files from the archive."
+HOMEPAGE = "http://www.gnu.org/software/tar/"
+SECTION = "base"
+
+SRC_URI = "${GNU_MIRROR}/tar/tar-${PV}.tar.bz2"
+
+inherit autotools gettext texinfo
+
+EXTRA_OECONF += "DEFAULT_RMT_DIR=${base_sbindir}"
+
+# Let aclocal use the relative path for the m4 file rather than the
+# absolute since tar has a lot of m4 files, otherwise there might
+# be an "Argument list too long" error when it is built in a long/deep
+# directory.
+acpaths = "-I ./m4"
+
+do_install () {
+    autotools_do_install
+    ln -s tar ${D}${bindir}/gtar
+}
+
+do_install_append_class-target() {
+    install -d ${D}${base_bindir}
+    mv ${D}${bindir}/tar ${D}${base_bindir}/tar
+    mv ${D}${bindir}/gtar ${D}${base_bindir}/gtar
+    rmdir ${D}${bindir}/
+}
+
+PACKAGES =+ "${PN}-rmt"
+
+FILES_${PN}-rmt = "${base_sbindir}/rmt*"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "tar"
+ALTERNATIVE_${PN}-rmt = "rmt"
+ALTERNATIVE_${PN}_class-nativesdk = ""
+ALTERNATIVE_${PN}-rmt_class-nativesdk = ""
+
+ALTERNATIVE_LINK_NAME[tar] = "${base_bindir}/tar"
+ALTERNATIVE_LINK_NAME[rmt] = "${base_sbindir}/rmt"
+
+PROVIDES_append_class-native = " tar-replacement-native"
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-extended/tar/tar/remove-gets.patch b/meta/recipes-extended/tar/tar/remove-gets.patch
new file mode 100644
index 0000000..0b8be39
--- /dev/null
+++ b/meta/recipes-extended/tar/tar/remove-gets.patch
@@ -0,0 +1,22 @@
+ISO C11 removes the specification of gets() from the C language, eglibc 2.16+ removed it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: tar-1.27/gnu/stdio.in.h
+===================================================================
+--- tar-1.27.orig/gnu/stdio.in.h	2013-06-29 08:54:26.000000000 +0300
++++ tar-1.27/gnu/stdio.in.h	2013-10-16 15:22:46.977204737 +0300
+@@ -710,10 +710,12 @@
+ /* It is very rare that the developer ever has full control of stdin,
+    so any use of gets warrants an unconditional warning; besides, C11
+    removed it.  */
++#if defined gets
+ #undef gets
+ #if HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
++#endif
+ 
+ 
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
diff --git a/meta/recipes-extended/tar/tar_1.17.bb b/meta/recipes-extended/tar/tar_1.17.bb
new file mode 100644
index 0000000..b9ca206
--- /dev/null
+++ b/meta/recipes-extended/tar/tar_1.17.bb
@@ -0,0 +1,14 @@
+require tar.inc
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+PR = "r3"
+
+SRC_URI += "file://m4extensions.patch \
+    file://gcc43build.patch \
+    file://avoid_heap_overflow.patch \
+    "
+
+SRC_URI[md5sum] = "c6c4f1c075dbf0f75c29737faa58f290"
+SRC_URI[sha256sum] = "19f9021dda51a16295e4706e80870e71f87107675e51c176a491eba0fc4ca492"
diff --git a/meta/recipes-extended/tar/tar_1.28.bb b/meta/recipes-extended/tar/tar_1.28.bb
new file mode 100644
index 0000000..8816000
--- /dev/null
+++ b/meta/recipes-extended/tar/tar_1.28.bb
@@ -0,0 +1,12 @@
+require tar.inc
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[acl] = "--with-posix-acls, --without-posix-acls, acl,"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+SRC_URI += "file://remove-gets.patch \
+           "
+SRC_URI[md5sum] = "8f32b2bc1ed7ddf4cf4e4a39711341b0"
+SRC_URI[sha256sum] = "60e4bfe0602fef34cd908d91cf638e17eeb09394d7b98c2487217dc4d3147562"
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff
new file mode 100644
index 0000000..16d6719
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/00_man_quoting.diff
@@ -0,0 +1,77 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5	1995-01-30 19:51:47.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5	2004-04-09 16:59:45.000000000 +0200
+@@ -173,7 +173,7 @@
+ Patterns like these can be used when the machine has different internet
+ addresses with different internet hostnames.  Service providers can use
+ this facility to offer FTP, GOPHER or WWW archives with internet names
+-that may even belong to different organizations. See also the `twist'
++that may even belong to different organizations. See also the `twist\'
+ option in the hosts_options(5) document. Some systems (Solaris,
+ FreeBSD) can have more than one internet address on one physical
+ interface; with other systems you may have to resort to SLIP or PPP
+@@ -236,10 +236,10 @@
+ Before accepting a client request, the wrappers can use the IDENT
+ service to find out that the client did not send the request at all.
+ When the client host provides IDENT service, a negative IDENT lookup
+-result (the client matches `UNKNOWN@host') is strong evidence of a host
++result (the client matches `UNKNOWN@host\') is strong evidence of a host
+ spoofing attack.
+ .PP
+-A positive IDENT lookup result (the client matches `KNOWN@host') is
++A positive IDENT lookup result (the client matches `KNOWN@host\') is
+ less trustworthy. It is possible for an intruder to spoof both the
+ client connection and the IDENT lookup, although doing so is much
+ harder than spoofing just a client connection. It may also be that
+diff -ruN tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5
+--- tcp_wrappers_7.6.orig/hosts_options.5	1994-12-28 17:42:29.000000000 +0100
++++ tcp_wrappers_7.6/hosts_options.5	2004-04-09 16:59:49.000000000 +0200
+@@ -124,7 +124,7 @@
+ value is taken.
+ .SH MISCELLANEOUS
+ .IP "banners /some/directory"
+-Look for a file in `/some/directory' with the same name as the daemon
++Look for a file in `/some/directory\' with the same name as the daemon
+ process (for example in.telnetd for the telnet service), and copy its
+ contents to the client. Newline characters are replaced by
+ carriage-return newline, and %<letter> sequences are expanded (see
+diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8
+--- tcp_wrappers_7.6.orig/tcpdmatch.8	1996-02-11 17:01:36.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.8	2004-04-09 17:00:49.000000000 +0200
+@@ -26,7 +26,7 @@
+ A daemon process name. Typically, the last component of a daemon
+ executable pathname.
+ .IP client
+-A host name or network address, or one of the `unknown' or `paranoid'
++A host name or network address, or one of the `unknown\' or `paranoid\'
+ wildcard patterns.
+ .sp
+ When a client host name is specified, \fItcpdmatch\fR gives a
+@@ -37,13 +37,13 @@
+ .PP
+ Optional information specified with the \fIdaemon@server\fR form:
+ .IP server
+-A host name or network address, or one of the `unknown' or `paranoid'
+-wildcard patterns. The default server name is `unknown'.
++A host name or network address, or one of the `unknown\' or `paranoid\'
++wildcard patterns. The default server name is `unknown\'.
+ .PP
+ Optional information specified with the \fIuser@client\fR form:
+ .IP user
+ A client user identifier. Typically, a login name or a numeric userid.
+-The default user name is `unknown'.
++The default user name is `unknown\'.
+ .SH OPTIONS
+ .IP -d
+ Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current
+@@ -70,7 +70,7 @@
+ .ti +5
+ tcpdmatch in.telnetd paranoid
+ .PP
+-On some systems, daemon names have no `in.' prefix, or \fItcpdmatch\fR
++On some systems, daemon names have no `in.\' prefix, or \fItcpdmatch\fR
+ may need some help to locate the inetd configuration file.
+ .SH FILES
+ .PP
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch
new file mode 100644
index 0000000..9a735bf
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/01_man_portability.patch
@@ -0,0 +1,250 @@
+Upstream-Status: Backport
+
+diff -ruNp tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3
+--- tcp_wrappers_7.6.orig/hosts_access.3	2005-03-09 18:30:25.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.3	2005-03-09 18:27:03.000000000 +0100
+@@ -3,7 +3,7 @@
+ hosts_access, hosts_ctl, request_init, request_set \- access control library
+ .SH SYNOPSIS
+ .nf
+-#include "tcpd.h"
++#include <tcpd.h>
+ 
+ extern int allow_severity;
+ extern int deny_severity;
+diff -ruNp tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5	2005-03-09 18:30:25.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5	2005-03-09 18:30:18.000000000 +0100
+@@ -8,9 +8,9 @@ name, host name/address) patterns.  Exam
+ impatient reader is encouraged to skip to the EXAMPLES section for a
+ quick introduction.
+ .PP
+-An extended version of the access control language is described in the
+-\fIhosts_options\fR(5) document. The extensions are turned on at
+-program build time by building with -DPROCESS_OPTIONS.
++The extended version of the access control language is described in the
++\fIhosts_options\fR(5) document. \fBNote that this language supersedes
++the meaning of \fIshell_command\fB as documented below.\fR
+ .PP
+ In the following text, \fIdaemon\fR is the the process name of a
+ network daemon process, and \fIclient\fR is the name and/or address of
+@@ -346,8 +346,8 @@ in.tftpd: LOCAL, .my.domain
+ /etc/hosts.deny:
+ .in +3
+ .nf
+-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
+-	/usr/ucb/mail -s %d-%h root) &
++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
++	/usr/bin/mail -s %d-%h root) &
+ .fi
+ .PP
+ The safe_finger command comes with the tcpd wrapper and should be
+@@ -383,6 +383,7 @@ that shouldn\'t.  All problems are repor
+ .fi
+ .SH SEE ALSO
+ .nf
++hosts_options(5) extended syntax.
+ tcpd(8) tcp/ip daemon wrapper program.
+ tcpdchk(8), tcpdmatch(8), test programs.
+ .SH BUGS
+diff -ruNp tcp_wrappers_7.6.orig/hosts_options.5 tcp_wrappers_7.6/hosts_options.5
+--- tcp_wrappers_7.6.orig/hosts_options.5	2005-03-09 18:30:24.000000000 +0100
++++ tcp_wrappers_7.6/hosts_options.5	2005-03-09 18:27:03.000000000 +0100
+@@ -2,10 +2,8 @@
+ .SH NAME
+ hosts_options \- host access control language extensions
+ .SH DESCRIPTION
+-This document describes optional extensions to the language described
+-in the hosts_access(5) document. The extensions are enabled at program
+-build time. For example, by editing the Makefile and turning on the 
+-PROCESS_OPTIONS compile-time option.
++This document describes extensions to the language described
++in the hosts_access(5) document.
+ .PP
+ The extensible language uses the following format:
+ .sp
+@@ -58,12 +56,12 @@ Notice the leading dot on the domain nam
+ Execute, in a child process, the specified shell command, after
+ performing the %<letter> expansions described in the hosts_access(5)
+ manual page.  The command is executed with stdin, stdout and stderr
+-connected to the null device, so that it won\'t mess up the
++connected to the null device, so that it won't mess up the
+ conversation with the client host. Example:
+ .sp
+ .nf
+ .ti +3
+-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
+ .fi
+ .sp
+ executes, in a background child process, the shell command "safe_finger
+diff -ruNp tcp_wrappers_7.6.orig/inetcf.c tcp_wrappers_7.6/inetcf.c
+--- tcp_wrappers_7.6.orig/inetcf.c	1997-02-12 02:13:24.000000000 +0100
++++ tcp_wrappers_7.6/inetcf.c	2005-03-09 18:27:03.000000000 +0100
+@@ -26,13 +26,17 @@ extern void exit();
+   * guesses. Shorter names follow longer ones.
+   */
+ char   *inet_files[] = {
++#if 0
+     "/private/etc/inetd.conf",		/* NEXT */
+     "/etc/inet/inetd.conf",		/* SYSV4 */
+     "/usr/etc/inetd.conf",		/* IRIX?? */
++#endif
+     "/etc/inetd.conf",			/* BSD */
++#if 0
+     "/etc/net/tlid.conf",		/* SYSV4?? */
+     "/etc/saf/tlid.conf",		/* SYSV4?? */
+     "/etc/tlid.conf",			/* SYSV4?? */
++#endif
+     0,
+ };
+ 
+diff -ruNp tcp_wrappers_7.6.orig/tcpd.8 tcp_wrappers_7.6/tcpd.8
+--- tcp_wrappers_7.6.orig/tcpd.8	1996-02-21 16:39:16.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.8	2005-03-09 18:27:03.000000000 +0100
+@@ -12,7 +12,11 @@ The program supports both 4.3BSD-style s
+ TLI.  Functionality may be limited when the protocol underneath TLI is
+ not an internet protocol.
+ .PP
+-Operation is as follows: whenever a request for service arrives, the
++There are two possible modes of operation: execution of \fItcpd\fP
++before a service started by \fIinetd\fP, or linking a daemon with
++the \fIlibwrap\fP shared library as documented in the \fIhosts_access\fR(3)
++manual page. Operation when started by \fIinetd\fP
++is as follows: whenever a request for service arrives, the
+ \fIinetd\fP daemon is tricked into running the \fItcpd\fP program
+ instead of the desired server. \fItcpd\fP logs the request and does
+ some additional checks. When all is well, \fItcpd\fP runs the
+@@ -88,11 +92,11 @@ configuration files.
+ .sp
+ .in +5
+ # mkdir /other/place
+-# mv /usr/etc/in.fingerd /other/place
+-# cp tcpd /usr/etc/in.fingerd
++# mv /usr/sbin/in.fingerd /other/place
++# cp tcpd /usr/sbin/in.fingerd
+ .fi
+ .PP
+-The example assumes that the network daemons live in /usr/etc. On some
++The example assumes that the network daemons live in /usr/sbin. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, or have
+ no `in.\' prefix to their name.
+ .SH EXAMPLE 2
+@@ -101,35 +105,34 @@ are left in their original place.
+ .PP
+ In order to monitor access to the \fIfinger\fR service, perform the
+ following edits on the \fIinetd\fR configuration file (usually 
+-\fI/etc/inetd.conf\fR or \fI/etc/inet/inetd.conf\fR):
++\fI/etc/inetd.conf\fR):
+ .nf
+ .sp
+ .ti +5
+-finger  stream  tcp  nowait  nobody  /usr/etc/in.fingerd  in.fingerd
++finger  stream  tcp  nowait  nobody  /usr/sbin/in.fingerd  in.fingerd
+ .sp
+ becomes:
+ .sp
+ .ti +5
+-finger  stream  tcp  nowait  nobody  /some/where/tcpd     in.fingerd
++finger  stream  tcp  nowait  nobody  /usr/sbin/tcpd     in.fingerd
+ .sp
+ .fi
+ .PP
+-The example assumes that the network daemons live in /usr/etc. On some
++The example assumes that the network daemons live in /usr/sbin. On some
+ systems, network daemons live in /usr/sbin or in /usr/libexec, the
+ daemons have no `in.\' prefix to their name, or there is no userid
+ field in the inetd configuration file.
+ .PP
+ Similar changes will be needed for the other services that are to be
+ covered by \fItcpd\fR.  Send a `kill -HUP\' to the \fIinetd\fR(8)
+-process to make the changes effective. AIX users may also have to
+-execute the `inetimp\' command.
++process to make the changes effective.
+ .SH EXAMPLE 3
+ In the case of daemons that do not live in a common directory ("secret"
+ or otherwise), edit the \fIinetd\fR configuration file so that it
+ specifies an absolute path name for the process name field. For example:
+ .nf
+ .sp
+-    ntalk  dgram  udp  wait  root  /some/where/tcpd  /usr/local/lib/ntalkd
++    ntalk  dgram  udp  wait  root  /usr/sbin/tcpd  /usr/local/lib/ntalkd
+ .sp
+ .fi
+ .PP
+@@ -164,6 +167,7 @@ The default locations of the host access
+ .SH SEE ALSO
+ .na
+ .nf
++hosts_access(3), functions provided by the libwrap library.
+ hosts_access(5), format of the tcpd access control tables.
+ syslog.conf(5), format of the syslogd control file.
+ inetd.conf(5), format of the inetd control file.
+diff -ruNp tcp_wrappers_7.6.orig/tcpdchk.8 tcp_wrappers_7.6/tcpdchk.8
+--- tcp_wrappers_7.6.orig/tcpdchk.8	1995-01-08 17:00:31.000000000 +0100
++++ tcp_wrappers_7.6/tcpdchk.8	2005-03-09 18:27:03.000000000 +0100
+@@ -9,8 +9,8 @@ tcpdchk [-a] [-d] [-i inet_conf] [-v]
+ potential and real problems it can find. The program examines the
+ \fItcpd\fR access control files (by default, these are
+ \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR), and compares the
+-entries in these files against entries in the \fIinetd\fR or \fItlid\fR
+-network configuration files.
++entries in these files against entries in the \fIinetd\fR
++network configuration file.
+ .PP
+ \fItcpdchk\fR reports problems such as non-existent pathnames; services
+ that appear in \fItcpd\fR access control rules, but are not controlled
+@@ -26,14 +26,13 @@ problem.
+ .SH OPTIONS
+ .IP -a
+ Report access control rules that permit access without an explicit
+-ALLOW keyword. This applies only when the extended access control
+-language is enabled (build with -DPROCESS_OPTIONS).
++ALLOW keyword.
+ .IP -d
+ Examine \fIhosts.allow\fR and \fIhosts.deny\fR files in the current
+ directory instead of the default ones.
+ .IP "-i inet_conf"
+ Specify this option when \fItcpdchk\fR is unable to find your
+-\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when
++\fIinetd.conf\fR network configuration file, or when
+ you suspect that the program uses the wrong one.
+ .IP -v
+ Display the contents of each access control rule.  Daemon lists, client
+@@ -54,7 +53,6 @@ tcpdmatch(8), explain what tcpd would do
+ hosts_access(5), format of the tcpd access control tables.
+ hosts_options(5), format of the language extensions.
+ inetd.conf(5), format of the inetd control file.
+-tlid.conf(5), format of the tlid control file.
+ .SH AUTHORS
+ .na
+ .nf
+diff -ruNp tcp_wrappers_7.6.orig/tcpdmatch.8 tcp_wrappers_7.6/tcpdmatch.8
+--- tcp_wrappers_7.6.orig/tcpdmatch.8	2005-03-09 18:30:24.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.8	2005-03-09 18:27:03.000000000 +0100
+@@ -13,7 +13,7 @@ request for service.  Examples are given
+ The program examines the \fItcpd\fR access control tables (default
+ \fI/etc/hosts.allow\fR and \fI/etc/hosts.deny\fR) and prints its
+ conclusion.  For maximal accuracy, it extracts additional information
+-from your \fIinetd\fR or \fItlid\fR network configuration file.
++from your \fIinetd\fR network configuration file.
+ .PP
+ When \fItcpdmatch\fR finds a match in the access control tables, it
+ identifies the matched rule. In addition, it displays the optional
+@@ -50,7 +50,7 @@ Examine \fIhosts.allow\fR and \fIhosts.d
+ directory instead of the default ones.
+ .IP "-i inet_conf"
+ Specify this option when \fItcpdmatch\fR is unable to find your
+-\fIinetd.conf\fR or \fItlid.conf\fR network configuration file, or when
++\fIinetd.conf\fR network configuration file, or when
+ you suspect that the program uses the wrong one.
+ .SH EXAMPLES
+ To predict how \fItcpd\fR would handle a telnet request from the local
+@@ -86,7 +86,6 @@ tcpdchk(8), tcpd configuration checker
+ hosts_access(5), format of the tcpd access control tables.
+ hosts_options(5), format of the language extensions.
+ inetd.conf(5), format of the inetd control file.
+-tlid.conf(5), format of the tlid control file.
+ .SH AUTHORS
+ .na
+ .nf
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch
new file mode 100644
index 0000000..9e18802
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/05_wildcard_matching.patch
@@ -0,0 +1,105 @@
+Upstream-Status: Backport
+
+See https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=17847
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5	2004-04-10 18:54:33.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5	2004-04-10 18:54:27.000000000 +0200
+@@ -89,6 +89,10 @@
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
++.IP \(bu
++Wildcards `*\' and `?\' can be used to match hostnames or IP addresses.  This
++method of matching cannot be used in conjunction with `net/mask\' matching,
++hostname matching beginning with `.\' or IP address matching ending with `.\'.
+ .SH WILDCARDS
+ The access control language supports explicit wildcards:
+ .IP ALL
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c	1997-02-12 02:13:23.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.c	2004-04-10 18:52:21.000000000 +0200
+@@ -289,6 +289,11 @@
+ {
+     int     n;
+ 
++#ifndef DISABLE_WILDCARD_MATCHING
++    if (strchr(tok, '*') || strchr(tok,'?')) {  /* contains '*' or '?' */
++        return (match_pattern_ylo(string,tok)); 	       
++    } else 
++#endif    
+     if (tok[0] == '.') {			/* suffix */
+ 	n = strlen(string) - strlen(tok);
+ 	return (n > 0 && STR_EQ(tok, string + n));
+@@ -329,3 +334,71 @@
+     }
+     return ((addr & mask) == net);
+ }
++
++#ifndef DISABLE_WILDCARD_MATCHING
++/* Note: this feature has been adapted in a pretty straightforward way
++   from Tatu Ylonen's last SSH version under free license by 
++   Pekka Savola <pekkas@netcore.fi>.
++
++   Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
++*/
++
++/* Returns true if the given string matches the pattern (which may contain
++   ? and * as wildcards), and zero if it does not match. */
++	  
++int match_pattern_ylo(const char *s, const char *pattern)
++{
++  while (1)
++    {
++      /* If at end of pattern, accept if also at end of string. */
++      if (!*pattern)
++        return !*s;
++
++      /* Process '*'. */
++      if (*pattern == '*')
++        {
++	  /* Skip the asterisk. */
++	  pattern++;
++
++	  /* If at end of pattern, accept immediately. */
++          if (!*pattern)
++            return 1;
++
++	  /* If next character in pattern is known, optimize. */
++          if (*pattern != '?' && *pattern != '*')
++            {
++	      /* Look instances of the next character in pattern, and try
++		 to match starting from those. */
++              for (; *s; s++)
++                if (*s == *pattern &&
++                    match_pattern_ylo(s + 1, pattern + 1))
++                  return 1;
++	      /* Failed. */
++              return 0;
++            }
++
++	  /* Move ahead one character at a time and try to match at each
++	     position. */
++          for (; *s; s++)
++            if (match_pattern_ylo(s, pattern))
++              return 1;
++	  /* Failed. */
++          return 0;
++        }
++
++      /* There must be at least one more character in the string.  If we are
++	 at the end, fail. */
++      if (!*s)
++        return 0;
++
++      /* Check if the next character of the string is acceptable. */
++      if (*pattern != '?' && *pattern != *s)
++	return 0;
++      
++      /* Move to the next character, both in string and in pattern. */
++      s++;
++      pattern++;
++    }
++  /*NOTREACHED*/
++}
++#endif /* DISABLE_WILDCARD_MATCHING */
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
new file mode 100644
index 0000000..725f4b5
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/06_fix_gethostbyname.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+
+* Mon Feb  5 2001 Preston Brown <pbrown@redhat.com>
+- fix gethostbyname to work better with dot "." notation (#16949)
+
+--- tcp_wrappers_7.6/socket.c.fixgethostbyname	Fri Mar 21 13:27:25 1997
++++ tcp_wrappers_7.6/socket.c	Mon Feb  5 14:09:40 2001
+@@ -52,7 +52,8 @@
+ char   *name;
+ {
+     char    dot_name[MAXHOSTNAMELEN + 1];
+-
++    struct hostent *hp;
++    
+     /*
+      * Don't append dots to unqualified names. Such names are likely to come
+      * from local hosts files or from NIS.
+@@ -61,8 +62,12 @@
+     if (strchr(name, '.') == 0 || strlen(name) >= MAXHOSTNAMELEN - 1) {
+ 	return (gethostbyname(name));
+     } else {
+-	sprintf(dot_name, "%s.", name);
+-	return (gethostbyname(dot_name));
++        sprintf(dot_name, "%s.", name);
++        hp = gethostbyname(dot_name);
++	if (hp)
++	    return hp;
++	else
++	    return (gethostbyname(name));
+     }
+ }
+ 
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch
new file mode 100644
index 0000000..96d47c3
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/10_usagi-ipv6.patch
@@ -0,0 +1,1255 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/fix_options.c tcp_wrappers_7.6/fix_options.c
+--- tcp_wrappers_7.6.orig/fix_options.c	1997-04-08 02:29:19.000000000 +0200
++++ tcp_wrappers_7.6/fix_options.c	2004-04-10 19:07:43.000000000 +0200
+@@ -11,6 +11,9 @@
+ 
+ #include <sys/types.h>
+ #include <sys/param.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <netinet/in_systm.h>
+ #include <netinet/ip.h>
+@@ -41,6 +44,22 @@
+     unsigned int opt;
+     int     optlen;
+     struct in_addr dummy;
++#ifdef INET6
++    struct sockaddr_storage ss;
++    int sslen;
++
++    /*
++     * check if this is AF_INET socket
++     * XXX IPv6 support?
++     */
++    sslen = sizeof(ss);
++    if (getsockname(fd, (struct sockaddr *)&ss, &sslen) < 0) {
++	syslog(LOG_ERR, "getpeername: %m");
++	clean_exit(request);
++    }
++    if (ss.ss_family != AF_INET)
++	return;
++#endif
+ 
+     if ((ip = getprotobyname("ip")) != 0)
+ 	ipproto = ip->p_proto;
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5	2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5	2004-04-10 19:07:43.000000000 +0200
+@@ -85,11 +85,18 @@
+ for daemon process names or for client user names.
+ .IP \(bu
+ An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
+-`net/mask\' pair. A host address is matched if `net\' is equal to the
++`net/mask\' pair. An IPv4 host address is matched if `net\' is equal to the
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
+ .IP \(bu
++An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a
++`[net]/prefixlen\' pair. An IPv6 host address is matched if
++`prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the
++address. For example, the [net]/prefixlen pattern
++`[3ffe:505:2:1::]/64\' matches every address in the range
++`3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'.
++.IP \(bu
+ Wildcards `*\' and `?\' can be used to match hostnames or IP addresses.  This
+ method of matching cannot be used in conjunction with `net/mask\' matching,
+ hostname matching beginning with `.\' or IP address matching ending with `.\'.
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c	2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c	2004-04-10 19:07:43.000000000 +0200
+@@ -24,7 +24,13 @@
+ /* System libraries. */
+ 
+ #include <sys/types.h>
++#ifdef INT32_T
++    typedef uint32_t u_int32_t;
++#endif
+ #include <sys/param.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -33,6 +39,9 @@
+ #include <errno.h>
+ #include <setjmp.h>
+ #include <string.h>
++#ifdef INET6
++#include <netdb.h>
++#endif
+ 
+ extern char *fgets();
+ extern int errno;
+@@ -82,6 +91,10 @@
+ static int host_match();
+ static int string_match();
+ static int masked_match();
++#ifdef INET6
++static int masked_match4();
++static int masked_match6();
++#endif
+ 
+ /* Size of logical line buffer. */
+ 
+@@ -289,6 +302,13 @@
+ {
+     int     n;
+ 
++#ifdef INET6
++    /* convert IPv4 mapped IPv6 address to IPv4 address */
++    if (STRN_EQ(string, "::ffff:", 7)
++      && dot_quad_addr(string + 7) != INADDR_NONE) {
++      string += 7;
++    }
++#endif    
+ #ifndef DISABLE_WILDCARD_MATCHING
+     if (strchr(tok, '*') || strchr(tok,'?')) {  /* contains '*' or '?' */
+         return (match_pattern_ylo(string,tok)); 	       
+@@ -304,20 +324,72 @@
+     } else if (tok[(n = strlen(tok)) - 1] == '.') {	/* prefix */
+ 	return (STRN_EQ(tok, string, n));
+     } else {					/* exact match */
++#ifdef INET6
++	struct addrinfo hints, *res;
++	struct sockaddr_in6 pat, addr;
++	int len, ret;
++	char ch;
++
++	len = strlen(tok);
++	if (*tok == '[' && tok[len - 1] == ']') {
++	    ch = tok[len - 1];
++	    tok[len - 1] = '\0';
++	    memset(&hints, 0, sizeof(hints));
++	    hints.ai_family = AF_INET6;
++	    hints.ai_socktype = SOCK_STREAM;
++	    hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++	    if ((ret = getaddrinfo(tok + 1, NULL, &hints, &res)) == 0) {
++		memcpy(&pat, res->ai_addr, sizeof(pat));
++		freeaddrinfo(res);
++	    }
++	    tok[len - 1] = ch;
++	    if (ret != 0 || getaddrinfo(string, NULL, &hints, &res) != 0)
++		return NO;
++	    memcpy(&addr, res->ai_addr, sizeof(addr));
++	    freeaddrinfo(res);
++#ifdef NI_WITHSCOPEID
++	    if (pat.sin6_scope_id != 0 &&
++		addr.sin6_scope_id != pat.sin6_scope_id)
++		return NO;
++#endif
++	    return (!memcmp(&pat.sin6_addr, &addr.sin6_addr,
++			    sizeof(struct in6_addr)));
++	    return (ret);
++	}
++#endif
+ 	return (STR_EQ(tok, string));
+     }
+ }
+ 
+ /* masked_match - match address against netnumber/netmask */
+ 
++#ifdef INET6
+ static int masked_match(net_tok, mask_tok, string)
+ char   *net_tok;
+ char   *mask_tok;
+ char   *string;
+ {
++    return (masked_match4(net_tok, mask_tok, string) ||
++	    masked_match6(net_tok, mask_tok, string));
++}
++
++static int masked_match4(net_tok, mask_tok, string)
++#else
++static int masked_match(net_tok, mask_tok, string)
++#endif
++char   *net_tok;
++char   *mask_tok;
++char   *string;
++{
++#ifdef INET6
++    u_int32_t net;
++    u_int32_t mask;
++    u_int32_t addr;
++#else
+     unsigned long net;
+     unsigned long mask;
+     unsigned long addr;
++#endif
+ 
+     /*
+      * Disallow forms other than dotted quad: the treatment that inet_addr()
+@@ -329,12 +401,78 @@
+ 	return (NO);
+     if ((net = dot_quad_addr(net_tok)) == INADDR_NONE
+ 	|| (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) {
++#ifndef INET6
+ 	tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok);
++#endif
+ 	return (NO);				/* not tcpd_jump() */
+     }
+     return ((addr & mask) == net);
+ }
+ 
++#ifdef INET6
++static int masked_match6(net_tok, mask_tok, string)
++char   *net_tok;
++char   *mask_tok;
++char   *string;
++{
++    struct addrinfo hints, *res;
++    struct sockaddr_in6 net, addr;
++    u_int32_t mask;
++    int len, mask_len, i = 0;
++    char ch;
++
++    memset(&hints, 0, sizeof(hints));
++    hints.ai_family = AF_INET6;
++    hints.ai_socktype = SOCK_STREAM;
++    hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++    if (getaddrinfo(string, NULL, &hints, &res) != 0)
++	return NO;
++    memcpy(&addr, res->ai_addr, sizeof(addr));
++    freeaddrinfo(res);
++
++    if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) {
++	if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE
++	 || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE)
++	    return (NO);
++	return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]);
++    }
++
++    /* match IPv6 address against netnumber/prefixlen */
++    len = strlen(net_tok);
++    if (*net_tok != '[' || net_tok[len - 1] != ']')
++	return NO;
++    ch = net_tok[len - 1];
++    net_tok[len - 1] = '\0';
++    if (getaddrinfo(net_tok + 1, NULL, &hints, &res) != 0) {
++	net_tok[len - 1] = ch;
++	return NO;
++    }
++    memcpy(&net, res->ai_addr, sizeof(net));
++    freeaddrinfo(res);
++    net_tok[len - 1] = ch;
++    if ((mask_len = atoi(mask_tok)) < 0 || mask_len > 128)
++	return NO;
++
++#ifdef NI_WITHSCOPEID
++    if (net.sin6_scope_id != 0 && addr.sin6_scope_id != net.sin6_scope_id)
++	return NO;
++#endif
++    while (mask_len > 0) {
++	if (mask_len < 32) {
++	    mask = htonl(~(0xffffffff >> mask_len));
++	    if ((*(u_int32_t *)&addr.sin6_addr.s6_addr[i] & mask) != (*(u_int32_t *)&net.sin6_addr.s6_addr[i] & mask))
++		return NO;
++	    break;
++	}
++	if (*(u_int32_t *)&addr.sin6_addr.s6_addr[i] != *(u_int32_t *)&net.sin6_addr.s6_addr[i])
++	    return NO;
++	i += 4;
++	mask_len -= 32;
++    }
++    return YES;
++}
++#endif /* INET6 */
++
+ #ifndef DISABLE_WILDCARD_MATCHING
+ /* Note: this feature has been adapted in a pretty straightforward way
+    from Tatu Ylonen's last SSH version under free license by 
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile	1997-03-21 19:27:21.000000000 +0100
++++ tcp_wrappers_7.6/Makefile	2004-04-10 19:22:44.000000000 +0200
+@@ -21,7 +21,7 @@
+ 	@echo "	dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
+ 	@echo "	linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
+ 	@echo "	ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
+-	@echo "	sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
++	@echo "	sunos40 sunos5 solaris8 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
+ 	@echo "	uts215 uxp"
+ 	@echo
+ 	@echo "If none of these match your environment, edit the system"
+@@ -131,20 +131,34 @@
+ 	NETGROUP=-DNETGROUP TLI= SYSTYPE="-systype bsd43" all
+ 
+ # Freebsd and linux by default have no NIS.
+-386bsd netbsd bsdos:
++386bsd bsdos:
+ 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+ 	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+ 	EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
+ 
+ freebsd:
+ 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++	LIBS="-L/usr/local/v6/lib -linet6" \
+ 	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
+-	EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
++	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" \
++	VSYSLOG= all
++
++netbsd:
++	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
++	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DINET6 -Dss_family=__ss_family -Dss_len=__ss_len" VSYSLOG= all
+ 
+ linux:
+ 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+-	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
+-	NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
++	LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++	NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \
++	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
++
++gnu:
++	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++	LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++	NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \
++	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all
+ 
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -196,6 +210,13 @@
+ 	NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \
+ 	BUGS="$(BUGS) -DSOLARIS_24_GETHOSTBYNAME_BUG" all
+ 
++# SunOS 5.8 is another SYSV4 variant, but has IPv6 support
++solaris8:
++	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
++	LIBS="-lsocket -lnsl" RANLIB=echo ARFLAGS=rv VSYSLOG= \
++	NETGROUP=-DNETGROUP AUX_OBJ=setenv.o TLI=-DTLI \
++	EXTRA_CFLAGS="-DINET6 -DNO_CLONE_DEVICE -DINT32_T" all
++
+ # Generic SYSV40
+ esix sysv4:
+ 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c
+--- tcp_wrappers_7.6.orig/misc.c	1996-02-11 17:01:30.000000000 +0100
++++ tcp_wrappers_7.6/misc.c	2004-04-10 19:07:43.000000000 +0200
+@@ -58,9 +58,31 @@
+ {
+     char   *cp;
+ 
++#ifdef INET6
++    int bracket = 0;
++
++    for (cp = string; cp && *cp; cp++) {
++	switch (*cp) {
++	case '[':
++	    bracket++;
++	    break;
++	case ']':
++	    bracket--;
++	    break;
++	default:
++	    if (bracket == 0 && *cp == delimiter) {
++		*cp++ = 0;
++		return cp;
++	    }
++	    break;
++	}
++    }
++    return (NULL);
++#else
+     if ((cp = strchr(string, delimiter)) != 0)
+ 	*cp++ = 0;
+     return (cp);
++#endif
+ }
+ 
+ /* dot_quad_addr - convert dotted quad to internal form */
+diff -ruN tcp_wrappers_7.6.orig/refuse.c tcp_wrappers_7.6/refuse.c
+--- tcp_wrappers_7.6.orig/refuse.c	1994-12-28 17:42:40.000000000 +0100
++++ tcp_wrappers_7.6/refuse.c	2004-04-10 19:07:43.000000000 +0200
+@@ -25,7 +25,12 @@
+ void    refuse(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++    syslog(deny_severity, "refused connect from %s (%s)",
++	   eval_client(request), eval_hostaddr(request->client));
++#else
+     syslog(deny_severity, "refused connect from %s", eval_client(request));
++#endif
+     clean_exit(request);
+     /* NOTREACHED */
+ }
+diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c	1995-01-02 16:11:34.000000000 +0100
++++ tcp_wrappers_7.6/rfc931.c	2004-04-10 19:07:43.000000000 +0200
+@@ -68,20 +68,50 @@
+ /* rfc931 - return remote user name, given socket structures */
+ 
+ void    rfc931(rmt_sin, our_sin, dest)
++#ifdef INET6
++struct sockaddr *rmt_sin;
++struct sockaddr *our_sin;
++#else
+ struct sockaddr_in *rmt_sin;
+ struct sockaddr_in *our_sin;
++#endif
+ char   *dest;
+ {
+     unsigned rmt_port;
+     unsigned our_port;
++#ifdef INET6
++    struct sockaddr_storage rmt_query_sin;
++    struct sockaddr_storage our_query_sin;
++    int alen;
++#else
+     struct sockaddr_in rmt_query_sin;
+     struct sockaddr_in our_query_sin;
++#endif
+     char    user[256];			/* XXX */
+     char    buffer[512];		/* XXX */
+     char   *cp;
+     char   *result = unknown;
+     FILE   *fp;
+ 
++#ifdef INET6
++    /* address family must be the same */
++    if (rmt_sin->sa_family != our_sin->sa_family) {
++	STRN_CPY(dest, result, STRING_LENGTH);
++	return;
++    }
++    switch (our_sin->sa_family) {
++    case AF_INET:
++	alen = sizeof(struct sockaddr_in);
++	break;
++    case AF_INET6:
++	alen = sizeof(struct sockaddr_in6);
++	break;
++    default:
++	STRN_CPY(dest, result, STRING_LENGTH);
++	return;
++    }
++#endif
++
+     /*
+      * Use one unbuffered stdio stream for writing to and for reading from
+      * the RFC931 etc. server. This is done because of a bug in the SunOS
+@@ -92,7 +122,11 @@
+      * sockets.
+      */
+ 
++#ifdef INET6
++    if ((fp = fsocket(our_sin->sa_family, SOCK_STREAM, 0)) != 0) {
++#else
+     if ((fp = fsocket(AF_INET, SOCK_STREAM, 0)) != 0) {
++#endif
+ 	setbuf(fp, (char *) 0);
+ 
+ 	/*
+@@ -112,6 +146,25 @@
+ 	     * addresses from the query socket.
+ 	     */
+ 
++#ifdef INET6
++	    memcpy(&our_query_sin, our_sin, alen);
++	    memcpy(&rmt_query_sin, rmt_sin, alen);
++	    switch (our_sin->sa_family) {
++	    case AF_INET:
++		((struct sockaddr_in *)&our_query_sin)->sin_port = htons(ANY_PORT);
++		((struct sockaddr_in *)&rmt_query_sin)->sin_port = htons(RFC931_PORT);
++		break;
++	    case AF_INET6:
++		((struct sockaddr_in6 *)&our_query_sin)->sin6_port = htons(ANY_PORT);
++		((struct sockaddr_in6 *)&rmt_query_sin)->sin6_port = htons(RFC931_PORT);
++		break;
++	    }
++
++	    if (bind(fileno(fp), (struct sockaddr *) & our_query_sin,
++		     alen) >= 0 &&
++		connect(fileno(fp), (struct sockaddr *) & rmt_query_sin,
++			alen) >= 0) {
++#else
+ 	    our_query_sin = *our_sin;
+ 	    our_query_sin.sin_port = htons(ANY_PORT);
+ 	    rmt_query_sin = *rmt_sin;
+@@ -121,6 +174,7 @@
+ 		     sizeof(our_query_sin)) >= 0 &&
+ 		connect(fileno(fp), (struct sockaddr *) & rmt_query_sin,
+ 			sizeof(rmt_query_sin)) >= 0) {
++#endif
+ 
+ 		/*
+ 		 * Send query to server. Neglect the risk that a 13-byte
+@@ -129,8 +183,13 @@
+ 		 */
+ 
+ 		fprintf(fp, "%u,%u\r\n",
++#ifdef INET6
++			ntohs(((struct sockaddr_in *)rmt_sin)->sin_port),
++			ntohs(((struct sockaddr_in *)our_sin)->sin_port));
++#else
+ 			ntohs(rmt_sin->sin_port),
+ 			ntohs(our_sin->sin_port));
++#endif
+ 		fflush(fp);
+ 
+ 		/*
+@@ -144,8 +203,13 @@
+ 		    && ferror(fp) == 0 && feof(fp) == 0
+ 		    && sscanf(buffer, "%u , %u : USERID :%*[^:]:%255s",
+ 			      &rmt_port, &our_port, user) == 3
++#ifdef INET6
++		    && ntohs(((struct sockaddr_in *)rmt_sin)->sin_port) == rmt_port
++		    && ntohs(((struct sockaddr_in *)our_sin)->sin_port) == our_port) {
++#else
+ 		    && ntohs(rmt_sin->sin_port) == rmt_port
+ 		    && ntohs(our_sin->sin_port) == our_port) {
++#endif
+ 
+ 		    /*
+ 		     * Strip trailing carriage return. It is part of the
+diff -ruN tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c
+--- tcp_wrappers_7.6.orig/scaffold.c	1997-03-21 19:27:24.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.c	2004-04-10 19:07:43.000000000 +0200
+@@ -25,7 +25,9 @@
+ #define	INADDR_NONE	(-1)		/* XXX should be 0xffffffff */
+ #endif
+ 
++#ifndef INET6
+ extern char *malloc();
++#endif
+ 
+ /* Application-specific. */
+ 
+@@ -39,6 +41,7 @@
+ int     deny_severity = LOG_WARNING;
+ int     rfc931_timeout = RFC931_TIMEOUT;
+ 
++#ifndef INET6
+ /* dup_hostent - create hostent in one memory block */
+ 
+ static struct hostent *dup_hostent(hp)
+@@ -73,9 +76,46 @@
+     }
+     return (&hb->host);
+ }
++#endif
+ 
+ /* find_inet_addr - find all addresses for this host, result to free() */
+ 
++#ifdef INET6
++struct addrinfo *find_inet_addr(host)
++char   *host;
++{
++    struct addrinfo hints, *res;
++
++    memset(&hints, 0, sizeof(hints));
++    hints.ai_family = PF_UNSPEC;
++    hints.ai_socktype = SOCK_STREAM;
++    hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++    if (getaddrinfo(host, NULL, &hints, &res) == 0)
++	return (res);
++
++    memset(&hints, 0, sizeof(hints));
++    hints.ai_family = PF_UNSPEC;
++    hints.ai_socktype = SOCK_STREAM;
++    hints.ai_flags = AI_PASSIVE | AI_CANONNAME;
++    if (getaddrinfo(host, NULL, &hints, &res) != 0) {
++	tcpd_warn("%s: host not found", host);
++	return (0);
++    }
++    if (res->ai_family != AF_INET6 && res->ai_family != AF_INET) {
++	tcpd_warn("%d: not an internet host", res->ai_family);
++	freeaddrinfo(res);
++	return (0);
++    }
++    if (!res->ai_canonname) {
++	tcpd_warn("%s: hostname alias", host);
++	tcpd_warn("(cannot obtain official name)", res->ai_canonname);
++    } else if (STR_NE(host, res->ai_canonname)) {
++	tcpd_warn("%s: hostname alias", host);
++	tcpd_warn("(official name: %.*s)", STRING_LENGTH, res->ai_canonname);
++    }
++    return (res);
++}
++#else
+ struct hostent *find_inet_addr(host)
+ char   *host;
+ {
+@@ -118,6 +158,7 @@
+     }
+     return (dup_hostent(hp));
+ }
++#endif
+ 
+ /* check_dns - give each address thorough workout, return address count */
+ 
+@@ -125,8 +166,13 @@
+ char   *host;
+ {
+     struct request_info request;
++#ifdef INET6
++    struct sockaddr_storage sin;
++    struct addrinfo *hp, *res;
++#else
+     struct sockaddr_in sin;
+     struct hostent *hp;
++#endif
+     int     count;
+     char   *addr;
+ 
+@@ -134,11 +180,18 @@
+ 	return (0);
+     request_init(&request, RQ_CLIENT_SIN, &sin, 0);
+     sock_methods(&request);
++#ifndef INET6
+     memset((char *) &sin, 0, sizeof(sin));
+     sin.sin_family = AF_INET;
++#endif
+ 
++#ifdef INET6
++    for (res = hp, count = 0; res; res = res->ai_next, count++) {
++	memcpy(&sin, res->ai_addr, res->ai_addrlen);
++#else
+     for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
+ 	memcpy((char *) &sin.sin_addr, addr, sizeof(sin.sin_addr));
++#endif
+ 
+ 	/*
+ 	 * Force host name and address conversions. Use the request structure
+@@ -151,7 +204,11 @@
+ 	    tcpd_warn("host address %s->name lookup failed",
+ 		      eval_hostaddr(request.client));
+     }
++#ifdef INET6
++    freeaddrinfo(hp);
++#else
+     free((char *) hp);
++#endif
+     return (count);
+ }
+ 
+diff -ruN tcp_wrappers_7.6.orig/scaffold.h tcp_wrappers_7.6/scaffold.h
+--- tcp_wrappers_7.6.orig/scaffold.h	1994-12-31 18:19:20.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.h	2004-04-10 19:07:43.000000000 +0200
+@@ -4,6 +4,10 @@
+   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+   */
+ 
++#ifdef INET6
++extern struct addrinfo *find_inet_addr();
++#else
+ extern struct hostent *find_inet_addr();
++#endif
+ extern int check_dns();
+ extern int check_path();
+diff -ruN tcp_wrappers_7.6.orig/socket.c tcp_wrappers_7.6/socket.c
+--- tcp_wrappers_7.6.orig/socket.c	2004-04-10 19:22:58.000000000 +0200
++++ tcp_wrappers_7.6/socket.c	2004-04-10 19:07:43.000000000 +0200
+@@ -24,13 +24,22 @@
+ #include <sys/types.h>
+ #include <sys/param.h>
+ #include <sys/socket.h>
++#ifdef INT32_T
++typedef uint32_t u_int32_t;
++#endif
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #include <stdio.h>
+ #include <syslog.h>
+ #include <string.h>
+ 
++#ifdef INET6
++#ifndef NI_WITHSCOPEID
++#define NI_WITHSCOPEID	0
++#endif
++#else
+ extern char *inet_ntoa();
++#endif
+ 
+ /* Local stuff. */
+ 
+@@ -79,8 +88,13 @@
+ void    sock_host(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++    static struct sockaddr_storage client;
++    static struct sockaddr_storage server;
++#else
+     static struct sockaddr_in client;
+     static struct sockaddr_in server;
++#endif
+     int     len;
+     char    buf[BUFSIZ];
+     int     fd = request->fd;
+@@ -109,7 +123,11 @@
+ 	memset(buf, 0 sizeof(buf));
+ #endif
+     }
++#ifdef INET6
++    request->client->sin = (struct sockaddr *)&client;
++#else
+     request->client->sin = &client;
++#endif
+ 
+     /*
+      * Determine the server binding. This is used for client username
+@@ -122,7 +140,11 @@
+ 	tcpd_warn("getsockname: %m");
+ 	return;
+     }
++#ifdef INET6
++    request->server->sin = (struct sockaddr *)&server;
++#else
+     request->server->sin = &server;
++#endif
+ }
+ 
+ /* sock_hostaddr - map endpoint address to printable form */
+@@ -130,10 +152,26 @@
+ void    sock_hostaddr(host)
+ struct host_info *host;
+ {
++#ifdef INET6
++    struct sockaddr *sin = host->sin;
++    int salen;
++
++    if (!sin)
++	return;
++#ifdef SIN6_LEN
++    salen = sin->sa_len;
++#else
++    salen = (sin->sa_family == AF_INET) ? sizeof(struct sockaddr_in)
++					: sizeof(struct sockaddr_in6);
++#endif
++    getnameinfo(sin, salen, host->addr, sizeof(host->addr),
++		NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
++#else
+     struct sockaddr_in *sin = host->sin;
+ 
+     if (sin != 0)
+ 	STRN_CPY(host->addr, inet_ntoa(sin->sin_addr), sizeof(host->addr));
++#endif
+ }
+ 
+ /* sock_hostname - map endpoint address to host name */
+@@ -141,6 +179,160 @@
+ void    sock_hostname(host)
+ struct host_info *host;
+ {
++#ifdef INET6
++    struct sockaddr *sin = host->sin;
++    struct sockaddr_in sin4;
++    struct addrinfo hints, *res, *res0 = NULL;
++    int salen, alen, err = 1;
++    char *ap = NULL, *rap, hname[NI_MAXHOST];
++
++    if (sin != NULL) {
++	if (sin->sa_family == AF_INET6) {
++	    struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sin;
++
++	    if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) {
++		memset(&sin4, 0, sizeof(sin4));
++#ifdef SIN6_LEN
++		sin4.sin_len = sizeof(sin4);
++#endif
++		sin4.sin_family = AF_INET;
++		sin4.sin_port = sin6->sin6_port;
++		sin4.sin_addr.s_addr = *(u_int32_t *)&sin6->sin6_addr.s6_addr[12];
++		sin = (struct sockaddr *)&sin4;
++	    }
++	}
++	switch (sin->sa_family) {
++	case AF_INET:
++	    ap = (char *)&((struct sockaddr_in *)sin)->sin_addr;
++	    alen = sizeof(struct in_addr);
++	    salen = sizeof(struct sockaddr_in);
++	    break;
++	case AF_INET6:
++	    ap = (char *)&((struct sockaddr_in6 *)sin)->sin6_addr;
++	    alen = sizeof(struct in6_addr);
++	    salen = sizeof(struct sockaddr_in6);
++	    break;
++	default:
++	    break;
++	}
++	if (ap)
++	    err = getnameinfo(sin, salen, hname, sizeof(hname),
++			      NULL, 0, NI_WITHSCOPEID | NI_NAMEREQD);
++    }
++    if (!err) {
++
++	STRN_CPY(host->name, hname, sizeof(host->name));
++
++	/* reject numeric addresses */
++	memset(&hints, 0, sizeof(hints));
++	hints.ai_family = sin->sa_family;
++	hints.ai_socktype = SOCK_STREAM;
++	hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST;
++	if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) {
++	    freeaddrinfo(res0);
++	    res0 = NULL;
++	    tcpd_warn("host name/name mismatch: "
++		      "reverse lookup results in non-FQDN %s",
++		      host->name);
++	    strcpy(host->name, paranoid);	/* name is bad, clobber it */
++	}
++	err = !err;
++    }
++    if (!err) {
++	/* we are now sure that this is non-numeric */
++
++	/*
++	 * Verify that the address is a member of the address list returned
++	 * by gethostbyname(hostname).
++	 * 
++	 * Verify also that gethostbyaddr() and gethostbyname() return the same
++	 * hostname, or rshd and rlogind may still end up being spoofed.
++	 * 
++	 * On some sites, gethostbyname("localhost") returns "localhost.domain".
++	 * This is a DNS artefact. We treat it as a special case. When we
++	 * can't believe the address list from gethostbyname("localhost")
++	 * we're in big trouble anyway.
++	 */
++
++	memset(&hints, 0, sizeof(hints));
++	hints.ai_family = sin->sa_family;
++	hints.ai_socktype = SOCK_STREAM;
++	hints.ai_flags = AI_PASSIVE | AI_CANONNAME;
++	if (getaddrinfo(host->name, NULL, &hints, &res0) != 0) {
++
++	    /*
++	     * Unable to verify that the host name matches the address. This
++	     * may be a transient problem or a botched name server setup.
++	     */
++
++	    tcpd_warn("can't verify hostname: getaddrinfo(%s, %s) failed",
++		      host->name,
++		      (sin->sa_family == AF_INET) ? "AF_INET" : "AF_INET6");
++
++	} else if ((res0->ai_canonname == NULL
++		    || STR_NE(host->name, res0->ai_canonname))
++		   && STR_NE(host->name, "localhost")) {
++
++	    /*
++	     * The gethostbyaddr() and gethostbyname() calls did not return
++	     * the same hostname. This could be a nameserver configuration
++	     * problem. It could also be that someone is trying to spoof us.
++	     */
++
++	    tcpd_warn("host name/name mismatch: %s != %.*s",
++		      host->name, STRING_LENGTH,
++		      (res0->ai_canonname == NULL) ? "" : res0->ai_canonname);
++
++	} else {
++
++	    /*
++	     * The address should be a member of the address list returned by
++	     * gethostbyname(). We should first verify that the h_addrtype
++	     * field is AF_INET, but this program has already caused too much
++	     * grief on systems with broken library code.
++	     */
++
++	    for (res = res0; res; res = res->ai_next) {
++		if (res->ai_family != sin->sa_family)
++		    continue;
++		switch (res->ai_family) {
++		case AF_INET:
++		    rap = (char *)&((struct sockaddr_in *)res->ai_addr)->sin_addr;
++		    break;
++		case AF_INET6:
++		    /* need to check scope_id */
++		    if (((struct sockaddr_in6 *)sin)->sin6_scope_id !=
++		        ((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id) {
++			continue;
++		    }
++		    rap = (char *)&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr;
++		    break;
++		default:
++		    continue;
++		}
++		if (memcmp(rap, ap, alen) == 0) {
++		    freeaddrinfo(res0);
++		    return;			/* name is good, keep it */
++		}
++	    }
++
++	    /*
++	     * The host name does not map to the initial address. Perhaps
++	     * someone has messed up. Perhaps someone compromised a name
++	     * server.
++	     */
++
++	    getnameinfo(sin, salen, hname, sizeof(hname),
++			NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID);
++	    tcpd_warn("host name/address mismatch: %s != %.*s",
++		      hname, STRING_LENGTH,
++		      (res0->ai_canonname == NULL) ? "" : res0->ai_canonname);
++	}
++	strcpy(host->name, paranoid);		/* name is bad, clobber it */
++	if (res0)
++	    freeaddrinfo(res0);
++    }
++#else /* INET6 */
+     struct sockaddr_in *sin = host->sin;
+     struct hostent *hp;
+     int     i;
+@@ -220,6 +412,7 @@
+ 	}
+ 	strcpy(host->name, paranoid);		/* name is bad, clobber it */
+     }
++#endif /* INET6 */
+ }
+ 
+ /* sock_sink - absorb unreceived IP datagram */
+@@ -228,7 +421,11 @@
+ int     fd;
+ {
+     char    buf[BUFSIZ];
++#ifdef INET6
++    struct sockaddr_storage sin;
++#else
+     struct sockaddr_in sin;
++#endif
+     int     size = sizeof(sin);
+ 
+     /*
+diff -ruN tcp_wrappers_7.6.orig/tcpd.c tcp_wrappers_7.6/tcpd.c
+--- tcp_wrappers_7.6.orig/tcpd.c	1996-02-11 17:01:33.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.c	2004-04-10 19:07:43.000000000 +0200
+@@ -120,7 +120,12 @@
+ 
+     /* Report request and invoke the real daemon program. */
+ 
++#ifdef INET6
++    syslog(allow_severity, "connect from %s (%s)",
++	   eval_client(&request), eval_hostaddr(request.client));
++#else
+     syslog(allow_severity, "connect from %s", eval_client(&request));
++#endif
+     closelog();
+     (void) execv(path, argv);
+     syslog(LOG_ERR, "error: cannot execute %s: %m", path);
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c	1997-02-12 02:13:25.000000000 +0100
++++ tcp_wrappers_7.6/tcpdchk.c	2004-04-10 19:07:43.000000000 +0200
+@@ -22,6 +22,9 @@
+ 
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#ifdef INET6
++#include <sys/socket.h>
++#endif
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -397,6 +400,31 @@
+     }
+ }
+ 
++#ifdef INET6
++static int is_inet6_addr(pat)
++    char *pat;
++{
++    struct addrinfo hints, *res;
++    int len, ret;
++    char ch;
++
++    if (*pat != '[')
++	return (0);
++    len = strlen(pat);
++    if ((ch = pat[len - 1]) != ']')
++	return (0);
++    pat[len - 1] = '\0';
++    memset(&hints, 0, sizeof(hints));
++    hints.ai_family = AF_INET6;
++    hints.ai_socktype = SOCK_STREAM;
++    hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++    if ((ret = getaddrinfo(pat + 1, NULL, &hints, &res)) == 0)
++	freeaddrinfo(res);
++    pat[len - 1] = ch;
++    return (ret == 0);
++}
++#endif
++
+ /* check_host - criticize host pattern */
+ 
+ static int check_host(pat)
+@@ -423,14 +451,27 @@
+ #endif
+ #endif
+     } else if (mask = split_at(pat, '/')) {	/* network/netmask */
++#ifdef INET6
++	int mask_len;
++
++	if ((dot_quad_addr(pat) == INADDR_NONE
++	    || dot_quad_addr(mask) == INADDR_NONE)
++	    && (!is_inet6_addr(pat)
++		|| ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
++#else
+ 	if (dot_quad_addr(pat) == INADDR_NONE
+ 	    || dot_quad_addr(mask) == INADDR_NONE)
++#endif
+ 	    tcpd_warn("%s/%s: bad net/mask pattern", pat, mask);
+     } else if (STR_EQ(pat, "FAIL")) {		/* obsolete */
+ 	tcpd_warn("FAIL is no longer recognized");
+ 	tcpd_warn("(use EXCEPT or DENY instead)");
+     } else if (reserved_name(pat)) {		/* other reserved */
+ 	 /* void */ ;
++#ifdef INET6
++    } else if (is_inet6_addr(pat)) { /* IPv6 address */
++	addr_count = 1;
++#endif
+     } else if (NOT_INADDR(pat)) {		/* internet name */
+ 	if (pat[strlen(pat) - 1] == '.') {
+ 	    tcpd_warn("%s: domain or host name ends in dot", pat);
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h	1996-03-19 16:22:25.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h	2004-04-10 19:07:43.000000000 +0200
+@@ -11,7 +11,11 @@
+ struct host_info {
+     char    name[STRING_LENGTH];	/* access via eval_hostname(host) */
+     char    addr[STRING_LENGTH];	/* access via eval_hostaddr(host) */
++#ifdef INET6
++    struct sockaddr *sin;		/* socket address or 0 */
++#else
+     struct sockaddr_in *sin;		/* socket address or 0 */
++#endif
+     struct t_unitdata *unit;		/* TLI transport address or 0 */
+     struct request_info *request;	/* for shared information */
+ };
+diff -ruN tcp_wrappers_7.6.orig/tcpdmatch.c tcp_wrappers_7.6/tcpdmatch.c
+--- tcp_wrappers_7.6.orig/tcpdmatch.c	1996-02-11 17:01:36.000000000 +0100
++++ tcp_wrappers_7.6/tcpdmatch.c	2004-04-10 19:07:43.000000000 +0200
+@@ -57,7 +57,11 @@
+ int     argc;
+ char  **argv;
+ {
++#ifdef INET6
++    struct addrinfo hints, *hp, *res;
++#else
+     struct hostent *hp;
++#endif
+     char   *myname = argv[0];
+     char   *client;
+     char   *server;
+@@ -68,8 +72,13 @@
+     int     ch;
+     char   *inetcf = 0;
+     int     count;
++#ifdef INET6
++    struct sockaddr_storage server_sin;
++    struct sockaddr_storage client_sin;
++#else
+     struct sockaddr_in server_sin;
+     struct sockaddr_in client_sin;
++#endif
+     struct stat st;
+ 
+     /*
+@@ -172,13 +181,20 @@
+     if (NOT_INADDR(server) == 0 || HOSTNAME_KNOWN(server)) {
+ 	if ((hp = find_inet_addr(server)) == 0)
+ 	    exit(1);
++#ifndef INET6
+ 	memset((char *) &server_sin, 0, sizeof(server_sin));
+ 	server_sin.sin_family = AF_INET;
++#endif
+ 	request_set(&request, RQ_SERVER_SIN, &server_sin, 0);
+ 
++#ifdef INET6
++	for (res = hp, count = 0; res; res = res->ai_next, count++) {
++	    memcpy(&server_sin, res->ai_addr, res->ai_addrlen);
++#else
+ 	for (count = 0; (addr = hp->h_addr_list[count]) != 0; count++) {
+ 	    memcpy((char *) &server_sin.sin_addr, addr,
+ 		   sizeof(server_sin.sin_addr));
++#endif
+ 
+ 	    /*
+ 	     * Force evaluation of server host name and address. Host name
+@@ -194,7 +210,11 @@
+ 	    fprintf(stderr, "Please specify an address instead\n");
+ 	    exit(1);
+ 	}
++#ifdef INET6
++	freeaddrinfo(hp);
++#else
+ 	free((char *) hp);
++#endif
+     } else {
+ 	request_set(&request, RQ_SERVER_NAME, server, 0);
+     }
+@@ -208,6 +228,18 @@
+ 	tcpdmatch(&request);
+ 	exit(0);
+     }
++#ifdef INET6
++    memset(&hints, 0, sizeof(hints));
++    hints.ai_family = AF_INET6;
++    hints.ai_socktype = SOCK_STREAM;
++    hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST;
++    if (getaddrinfo(client, NULL, &hints, &res) == 0) {
++	freeaddrinfo(res);
++	request_set(&request, RQ_CLIENT_ADDR, client, 0);
++	tcpdmatch(&request);
++	exit(0);
++    }
++#endif
+ 
+     /*
+      * Perhaps they are testing special client hostname patterns that aren't
+@@ -229,6 +261,34 @@
+      */
+     if ((hp = find_inet_addr(client)) == 0)
+ 	exit(1);
++#ifdef INET6
++    request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
++
++    for (res = hp, count = 0; res; res = res->ai_next, count++) {
++	memcpy(&client_sin, res->ai_addr, res->ai_addrlen);
++
++	/*
++	 * getnameinfo() doesn't do reverse lookup against link-local
++	 * address.  So, we pass through host name evaluation against
++	 * such addresses.
++	 */
++	if (res->ai_family != AF_INET6 ||
++	    !IN6_IS_ADDR_LINKLOCAL(&((struct sockaddr_in6 *)res->ai_addr)->sin6_addr)) {
++	    /*
++	     * Force evaluation of client host name and address. Host name
++	     * conflicts will be reported while eval_hostname() does its job.
++	     */
++	    request_set(&request, RQ_CLIENT_NAME, "", RQ_CLIENT_ADDR, "", 0);
++	    if (STR_EQ(eval_hostname(request.client), unknown))
++		tcpd_warn("host address %s->name lookup failed",
++			  eval_hostaddr(request.client));
++	}
++	tcpdmatch(&request);
++	if (res->ai_next)
++	    printf("\n");
++    }
++    freeaddrinfo(hp);
++#else
+     memset((char *) &client_sin, 0, sizeof(client_sin));
+     client_sin.sin_family = AF_INET;
+     request_set(&request, RQ_CLIENT_SIN, &client_sin, 0);
+@@ -250,6 +310,7 @@
+ 	    printf("\n");
+     }
+     free((char *) hp);
++#endif
+     exit(0);
+ }
+ 
+diff -ruN tcp_wrappers_7.6.orig/tli.c tcp_wrappers_7.6/tli.c
+--- tcp_wrappers_7.6.orig/tli.c	1997-03-21 19:27:26.000000000 +0100
++++ tcp_wrappers_7.6/tli.c	2004-04-10 19:07:43.000000000 +0200
+@@ -65,8 +65,13 @@
+ void    tli_host(request)
+ struct request_info *request;
+ {
++#ifdef INET6
++    static struct sockaddr_storage client;
++    static struct sockaddr_storage server;
++#else
+     static struct sockaddr_in client;
+     static struct sockaddr_in server;
++#endif
+ 
+     /*
+      * If we discover that we are using an IP transport, pretend we never
+@@ -76,14 +81,29 @@
+ 
+     tli_endpoints(request);
+     if ((request->config = tli_transport(request->fd)) != 0
++#ifdef INET6
++	&& (STR_EQ(request->config->nc_protofmly, "inet") ||
++	    STR_EQ(request->config->nc_protofmly, "inet6"))) {
++#else
+ 	&& STR_EQ(request->config->nc_protofmly, "inet")) {
++#endif
+ 	if (request->client->unit != 0) {
++#ifdef INET6
++	    client = *(struct sockaddr_storage *) request->client->unit->addr.buf;
++	    request->client->sin = (struct sockaddr *) &client;
++#else
+ 	    client = *(struct sockaddr_in *) request->client->unit->addr.buf;
+ 	    request->client->sin = &client;
++#endif
+ 	}
+ 	if (request->server->unit != 0) {
++#ifdef INET6
++	    server = *(struct sockaddr_storage *) request->server->unit->addr.buf;
++	    request->server->sin = (struct sockaddr *) &server;
++#else
+ 	    server = *(struct sockaddr_in *) request->server->unit->addr.buf;
+ 	    request->server->sin = &server;
++#endif
+ 	}
+ 	tli_cleanup(request);
+ 	sock_methods(request);
+@@ -187,7 +207,15 @@
+     }
+     while (config = getnetconfig(handlep)) {
+ 	if (stat(config->nc_device, &from_config) == 0) {
++#ifdef NO_CLONE_DEVICE
++	/*
++	 * If the network devices are not cloned (as is the case for
++	 * Solaris 8 Beta), we must compare the major device numbers.
++	 */
++	    if (major(from_config.st_rdev) == major(from_client.st_rdev))
++#else
+ 	    if (minor(from_config.st_rdev) == major(from_client.st_rdev))
++#endif
+ 		break;
+ 	}
+     }
+diff -ruN tcp_wrappers_7.6.orig/update.c tcp_wrappers_7.6/update.c
+--- tcp_wrappers_7.6.orig/update.c	1994-12-28 17:42:56.000000000 +0100
++++ tcp_wrappers_7.6/update.c	2004-04-10 19:07:43.000000000 +0200
+@@ -46,10 +46,18 @@
+ 	    request->fd = va_arg(ap, int);
+ 	    continue;
+ 	case RQ_CLIENT_SIN:
++#ifdef INET6
++	    request->client->sin = va_arg(ap, struct sockaddr *);
++#else
+ 	    request->client->sin = va_arg(ap, struct sockaddr_in *);
++#endif
+ 	    continue;
+ 	case RQ_SERVER_SIN:
++#ifdef INET6
++	    request->server->sin = va_arg(ap, struct sockaddr *);
++#else
+ 	    request->server->sin = va_arg(ap, struct sockaddr_in *);
++#endif
+ 	    continue;
+ 
+ 	    /*
+diff -ruN tcp_wrappers_7.6.orig/workarounds.c tcp_wrappers_7.6/workarounds.c
+--- tcp_wrappers_7.6.orig/workarounds.c	1996-03-19 16:22:26.000000000 +0100
++++ tcp_wrappers_7.6/workarounds.c	2004-04-10 19:07:43.000000000 +0200
+@@ -166,11 +166,22 @@
+ int    *len;
+ {
+     int     ret;
++#ifdef INET6
++    struct sockaddr *sin = sa;
++#else
+     struct sockaddr_in *sin = (struct sockaddr_in *) sa;
++#endif
+ 
+     if ((ret = getpeername(sock, sa, len)) >= 0
++#ifdef INET6
++	&& ((sin->su_si.si_family == AF_INET6
++	     && IN6_IS_ADDR_UNSPECIFIED(&sin->su_sin6.sin6_addr))
++	    || (sin->su_si.si_family == AF_INET
++		&& sin->su_sin.sin_addr.s_addr == 0))) {
++#else
+ 	&& sa->sa_family == AF_INET
+ 	&& sin->sin_addr.s_addr == 0) {
++#endif
+ 	errno = ENOTCONN;
+ 	return (-1);
+     } else {
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch
new file mode 100644
index 0000000..226106f
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_tcpd_blacklist.patch
@@ -0,0 +1,153 @@
+Upstream-Status: Backport
+
+Path: news.porcupine.org!news.porcupine.org!not-for-mail
+From: Wietse Venema <wietse@((no)(spam)(please))wzv.win.tue.nl>
+Newsgroups: comp.mail.sendmail,comp.security.unix
+Subject: TCP Wrapper Blacklist Extension
+Followup-To: poster
+Date: 8 Sep 1997 18:53:13 -0400
+Organization: Wietse's hangout while on sabattical in the USA
+Lines: 147
+Sender: wietse@spike.porcupine.org
+Message-ID: <5v1vkp$h4f$1@spike.porcupine.org>
+NNTP-Posting-Host: spike.porcupine.org
+Xref: news.porcupine.org comp.mail.sendmail:3541 comp.security.unix:7158
+
+The patch below adds a new host pattern to the TCP Wrapper access
+control language. Instead of a host name or address pattern, you
+can specify an external /file/name with host name or address
+patterns.   The feature can be used recursively.
+
+The /file/name extension makes it easy to blacklist bad sites, for
+example, to block unwanted electronic mail when libwrap is linked
+into sendmail.  Adding hosts to a simple text file is much easier
+than having to edit a more complex hosts.allow/deny file.
+
+I developed this a year or so ago as a substitute for NIS netgroups.
+At that time, I did not consider it of sufficient interest for
+inclusion in the TCP Wrapper distribution. How times have changed.
+
+The patch is relative to TCP Wrappers version 7.6. The main archive
+site is ftp://ftp.win.tue.nl/pub/security/tcp_wrappers_7.6.tar.gz
+
+Thanks to the Debian LINUX folks for expressing their interest in
+this patch.
+
+	Wietse
+
+
+[diff updated by Md]
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5	2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5	2004-04-10 19:28:01.000000000 +0200
+@@ -97,6 +97,13 @@
+ `[3ffe:505:2:1::]/64\' matches every address in the range
+ `3ffe:505:2:1::\' through `3ffe:505:2:1:ffff:ffff:ffff:ffff\'.
+ .IP \(bu
++A string that begins with a `/\' character is treated as a file
++name. A host name or address is matched if it matches any host name
++or address pattern listed in the named file. The file format is
++zero or more lines with zero or more host name or address patterns
++separated by whitespace.  A file name pattern can be used anywhere
++a host name or address pattern can be used.
++.IP \(bu
+ Wildcards `*\' and `?\' can be used to match hostnames or IP addresses.  This
+ method of matching cannot be used in conjunction with `net/mask\' matching,
+ hostname matching beginning with `.\' or IP address matching ending with `.\'.
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c	2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c	2004-04-10 19:27:05.000000000 +0200
+@@ -253,6 +253,26 @@
+     }
+ }
+ 
++/* hostfile_match - look up host patterns from file */
++
++static int hostfile_match(path, host)
++char   *path;
++struct hosts_info *host;
++{
++    char    tok[BUFSIZ];
++    int     match = NO;
++    FILE   *fp;
++
++    if ((fp = fopen(path, "r")) != 0) {
++	while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
++	     /* void */ ;
++	fclose(fp);
++    } else if (errno != ENOENT) {
++	tcpd_warn("open %s: %m", path);
++    }
++    return (match);
++}
++
+ /* host_match - match host name and/or address against pattern */
+ 
+ static int host_match(tok, host)
+@@ -280,6 +300,8 @@
+ 	tcpd_warn("netgroup support is disabled");	/* not tcpd_jump() */
+ 	return (NO);
+ #endif
++    } else if (tok[0] == '/') {			/* /file hack */
++	return (hostfile_match(tok, host));
+     } else if (STR_EQ(tok, "KNOWN")) {		/* check address and name */
+ 	char   *name = eval_hostname(host);
+ 	return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c	2004-04-10 19:28:09.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c	2004-04-10 19:27:05.000000000 +0200
+@@ -353,6 +353,8 @@
+ {
+     if (pat[0] == '@') {
+ 	tcpd_warn("%s: daemon name begins with \"@\"", pat);
++    } else if (pat[0] == '/') {
++	tcpd_warn("%s: daemon name begins with \"/\"", pat);
+     } else if (pat[0] == '.') {
+ 	tcpd_warn("%s: daemon name begins with dot", pat);
+     } else if (pat[strlen(pat) - 1] == '.') {
+@@ -385,6 +387,8 @@
+ {
+     if (pat[0] == '@') {			/* @netgroup */
+ 	tcpd_warn("%s: user name begins with \"@\"", pat);
++    } else if (pat[0] == '/') {
++	tcpd_warn("%s: user name begins with \"/\"", pat);
+     } else if (pat[0] == '.') {
+ 	tcpd_warn("%s: user name begins with dot", pat);
+     } else if (pat[strlen(pat) - 1] == '.') {
+@@ -430,8 +434,13 @@
+ static int check_host(pat)
+ char   *pat;
+ {
++    char    buf[BUFSIZ];
+     char   *mask;
+     int     addr_count = 1;
++    FILE   *fp;
++    struct tcpd_context saved_context;
++    char   *cp;
++    char   *wsp = " \t\r\n";
+ 
+     if (pat[0] == '@') {			/* @netgroup */
+ #ifdef NO_NETGRENT
+@@ -450,6 +459,21 @@
+ 	tcpd_warn("netgroup support disabled");
+ #endif
+ #endif
++    } else if (pat[0] == '/') {			/* /path/name */
++	if ((fp = fopen(pat, "r")) != 0) {
++	    saved_context = tcpd_context;
++	    tcpd_context.file = pat;
++	    tcpd_context.line = 0;
++	    while (fgets(buf, sizeof(buf), fp)) {
++		tcpd_context.line++;
++		for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
++		    check_host(cp);
++	    }
++	    tcpd_context = saved_context;
++	    fclose(fp);
++	} else if (errno != ENOENT) {
++	    tcpd_warn("open %s: %m", pat);
++	}
+     } else if (mask = split_at(pat, '/')) {	/* network/netmask */
+ #ifdef INET6
+ 	int mask_len;
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch
new file mode 100644
index 0000000..260e8d3
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/11_usagi_fix.patch
@@ -0,0 +1,47 @@
+Upstream-Status: Backport
+
+diff -uN tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.new/hosts_access.c
+--- tcp_wrappers_7.6/hosts_access.c	Mon May 20 14:00:56 2002
++++ tcp_wrappers_7.6.new/hosts_access.c	Mon May 20 14:25:05 2002
+@@ -448,6 +448,15 @@
+     int len, mask_len, i = 0;
+     char ch;
+ 
++    /*
++     * Behavior of getaddrinfo() against IPv4-mapped IPv6 address is
++     * different between KAME and Solaris8.  While KAME returns
++     * AF_INET6, Solaris8 returns AF_INET.  So, we avoid this here.
++     */
++    if (STRN_EQ(string, "::ffff:", 7)
++	&& dot_quad_addr(string + 7) != INADDR_NONE)
++	return (masked_match4(net_tok, mask_tok, string + 7));
++
+     memset(&hints, 0, sizeof(hints));
+     hints.ai_family = AF_INET6;
+     hints.ai_socktype = SOCK_STREAM;
+@@ -457,13 +466,6 @@
+     memcpy(&addr, res->ai_addr, sizeof(addr));
+     freeaddrinfo(res);
+ 
+-    if (IN6_IS_ADDR_V4MAPPED(&addr.sin6_addr)) {
+-	if ((*(u_int32_t *)&net.sin6_addr.s6_addr[12] = dot_quad_addr(net_tok)) == INADDR_NONE
+-	 || (mask = dot_quad_addr(mask_tok)) == INADDR_NONE)
+-	    return (NO);
+-	return ((*(u_int32_t *)&addr.sin6_addr.s6_addr[12] & mask) == *(u_int32_t *)&net.sin6_addr.s6_addr[12]);
+-    }
+-
+     /* match IPv6 address against netnumber/prefixlen */
+     len = strlen(net_tok);
+     if (*net_tok != '[' || net_tok[len - 1] != ']')
+diff -uN tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.new/socket.c
+--- tcp_wrappers_7.6/socket.c	Mon May 20 13:48:35 2002
++++ tcp_wrappers_7.6.new/socket.c	Mon May 20 14:22:27 2002
+@@ -228,7 +228,7 @@
+ 	hints.ai_family = sin->sa_family;
+ 	hints.ai_socktype = SOCK_STREAM;
+ 	hints.ai_flags = AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST;
+-	if ((err = getaddrinfo(host->name, NULL, &hints, &res0) == 0)) {
++	if ((err = getaddrinfo(host->name, NULL, &hints, &res0)) == 0) {
+ 	    freeaddrinfo(res0);
+ 	    res0 = NULL;
+ 	    tcpd_warn("host name/name mismatch: "
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch
new file mode 100644
index 0000000..e8289e4
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/12_makefile_config.patch
@@ -0,0 +1,83 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile	2003-08-21 01:43:39.000000000 +0200
++++ tcp_wrappers_7.6/Makefile	2003-08-21 01:43:35.000000000 +0200
+@@ -45,7 +45,7 @@
+ #
+ # SysV.4 Solaris 2.x OSF AIX
+ #REAL_DAEMON_DIR=/usr/sbin
+-#
++REAL_DAEMON_DIR=/usr/sbin
+ # BSD 4.4
+ #REAL_DAEMON_DIR=/usr/libexec
+ #
+@@ -512,6 +519,7 @@
+ # (examples: allow, deny, banners, twist and spawn).
+ # 
+ #STYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
++STYLE = -DPROCESS_OPTIONS
+ 
+ ################################################################
+ # Optional: Changing the default disposition of logfile records
+@@ -535,6 +543,7 @@
+ # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
+ 
+ FACILITY= LOG_MAIL	# LOG_MAIL is what most sendmail daemons use
++FACILITY= LOG_DAEMON
+ 
+ # The syslog priority at which successful connections are logged.
+ 
+@@ -631,6 +640,7 @@
+ # lookups altogether, see the next section.
+ 
+ PARANOID= -DPARANOID
++PARANOID=
+ 
+ ########################################
+ # Optional: turning off hostname lookups
+@@ -644,6 +654,7 @@
+ # mode (see previous section) and comment out the following definition.
+ 
+ HOSTNAME= -DALWAYS_HOSTNAME
++HOSTNAME=
+ 
+ #############################################
+ # Optional: Turning on host ADDRESS checking
+@@ -670,6 +681,7 @@
+ # Solaris 2.x, and Linux. See your system documentation for details.
+ #
+ # KILL_OPT= -DKILL_IP_OPTIONS
++KILL_OPT= -DKILL_IP_OPTIONS
+ 
+ ## End configuration options
+ ############################
+@@ -677,9 +689,10 @@
+ # Protection against weird shells or weird make programs.
+ 
+ SHELL	= /bin/sh
+-.c.o:;	$(CC) $(CFLAGS) -c $*.c
++.c.o:;	$(CC) $(CFLAGS) -o $*.o -c $*.c
+ 
+-CFLAGS	= -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
++COPTS	= -O2 -g
++CFLAGS	= $(COPTS) -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
+ 	$(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+ 	-DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+ 	-DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
+@@ -712,10 +725,11 @@
+ 
+ config-check:
+ 	@set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
+-	@set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
+-	if cmp cflags /tmp/cflags.$$$$ ; \
+-	then rm /tmp/cflags.$$$$ ; \
+-	else mv /tmp/cflags.$$$$ cflags ; \
++	@set +e; echo $(CFLAGS) >cflags.new ; \
++	if cmp cflags cflags.new ; \
++	then rm cflags.new ; \
++	else mv cflags.new cflags ; \
+ 	fi >/dev/null 2>/dev/null
++	@if [ ! -d shared ]; then mkdir shared; fi
+ 
+ $(LIB):	$(LIB_OBJ)
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch
new file mode 100644
index 0000000..bd1396b
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/13_shlib_weaksym.patch
@@ -0,0 +1,255 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/Makefile tcp_wrappers_7.6/Makefile
+--- tcp_wrappers_7.6.orig/Makefile	2004-05-02 15:37:59.000000000 +0200
++++ tcp_wrappers_7.6/Makefile	2004-05-02 15:31:09.000000000 +0200
+@@ -150,15 +150,15 @@
+ 
+ linux:
+ 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+-	LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++	LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
+ 	NETGROUP="-DNETGROUP" TLI= VSYSLOG= BUGS= \
+-	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
++	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len" all
+ 
+ gnu:
+ 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+-	LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ= \
++	LIBS=-lnsl RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
+ 	NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= \
+-	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR" all
++	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT" all
+ 
+ # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
+ hpux hpux8 hpux9 hpux10:
+@@ -713,7 +713,22 @@
+ 
+ LIB	= libwrap.a
+ 
+-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
++shared/%.o: %.c
++	$(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
++
++SOMAJOR = 0
++SOMINOR = 7.6
++
++SHLIB		= shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
++SHLIBSOMAJ	= shared/libwrap.so.$(SOMAJOR)
++SHLIBSO		= shared/libwrap.so
++SHLIBFLAGS	= -Lshared -lwrap
++
++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
++SHCFLAGS = -fPIC -shared -D_REENTRANT
++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
++
++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+ 
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
+ 
+@@ -731,27 +746,33 @@
+ 	$(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
+ 	-$(RANLIB) $(LIB)
+ 
+-tcpd:	tcpd.o $(LIB)
+-	$(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
++$(SHLIB): $(SHLIB_OBJ)
++	rm -f $(SHLIB)
++	$(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++	ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
++	ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
++
++tcpd:	tcpd.o $(SHLIB)
++	$(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+ 
+ miscd:	miscd.o $(LIB)
+ 	$(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
+ 
+-safe_finger: safe_finger.o $(LIB)
+-	$(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
++safe_finger: safe_finger.o $(SHLIB)
++	$(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+ 
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+ 
+-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
+-	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
++	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+ 
+-try-from: try-from.o fakelog.o $(LIB)
+-	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
++try-from: try-from.o fakelog.o $(SHLIB)
++	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+ 
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+ 
+-tcpdchk: $(TCPDCHK_OBJ) $(LIB)
+-	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
++	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
+ 
+ shar:	$(KIT)
+ 	@shar $(KIT)
+@@ -767,7 +788,9 @@
+ 
+ clean:
+ 	rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
++	libwrap*.so* \
+ 	cflags
++	rm -rf shared/
+ 
+ tidy:	clean
+ 	chmod -R a+r .
+@@ -913,5 +936,6 @@
+ update.o: mystdarg.h
+ update.o: tcpd.h
+ vfprintf.o: cflags
++weak_symbols.o: tcpd.h
+ workarounds.o: cflags
+ workarounds.o: tcpd.h
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h	2004-05-02 15:37:59.000000000 +0200
++++ tcp_wrappers_7.6/tcpd.h	2004-05-02 15:37:49.000000000 +0200
+@@ -4,6 +4,15 @@
+   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
+   */
+ 
++#ifndef _TCPWRAPPERS_TCPD_H
++#define _TCPWRAPPERS_TCPD_H
++
++/* Need definitions of struct sockaddr_in and FILE. */
++#include <netinet/in.h>
++#include <stdio.h>
++
++__BEGIN_DECLS
++
+ /* Structure to describe one communications endpoint. */
+ 
+ #define STRING_LENGTH	128		/* hosts, users, processes */
+@@ -29,10 +38,10 @@
+     char    pid[10];			/* access via eval_pid(request) */
+     struct host_info client[1];		/* client endpoint info */
+     struct host_info server[1];		/* server endpoint info */
+-    void  (*sink) ();			/* datagram sink function or 0 */
+-    void  (*hostname) ();		/* address to printable hostname */
+-    void  (*hostaddr) ();		/* address to printable address */
+-    void  (*cleanup) ();		/* cleanup function or 0 */
++    void  (*sink) (int);		/* datagram sink function or 0 */
++    void  (*hostname) (struct host_info *); /* address to printable hostname */
++    void  (*hostaddr) (struct host_info *); /* address to printable address */
++    void  (*cleanup) (struct request_info *); /* cleanup function or 0 */
+     struct netconfig *config;		/* netdir handle */
+ };
+ 
+@@ -70,20 +79,27 @@
+ #define fromhost sock_host		/* no TLI support needed */
+ #endif
+ 
+-extern int hosts_access();		/* access control */
+-extern void shell_cmd();		/* execute shell command */
+-extern char *percent_x();		/* do %<char> expansion */
+-extern void rfc931();			/* client name from RFC 931 daemon */
+-extern void clean_exit();		/* clean up and exit */
+-extern void refuse();			/* clean up and exit */
+-extern char *xgets();			/* fgets() on steroids */
+-extern char *split_at();		/* strchr() and split */
+-extern unsigned long dot_quad_addr();	/* restricted inet_addr() */
++extern int hosts_access(struct request_info *request);	/* access control */
++extern void shell_cmd(char *);		/* execute shell command */
++extern char *percent_x(char *, int, char *, struct request_info *);
++					/* do %<char> expansion */
++extern void rfc931(struct sockaddr *, struct sockaddr *, char *);
++					/* client name from RFC 931 daemon */
++extern void clean_exit(struct request_info *);	/* clean up and exit */
++extern void refuse(struct request_info *);	/* clean up and exit */
++extern char *xgets(char *, int, FILE *);	/* fgets() on steroids */
++extern char *split_at(char *, int);		/* strchr() and split */
++extern unsigned long dot_quad_addr(char *);	/* restricted inet_addr() */
+ 
+ /* Global variables. */
+ 
++#ifdef HAVE_WEAKSYMS
++extern int allow_severity __attribute__ ((weak)); /* for connection logging */
++extern int deny_severity __attribute__ ((weak)); /* for connection logging */
++#else
+ extern int allow_severity;		/* for connection logging */
+ extern int deny_severity;		/* for connection logging */
++#endif
+ extern char *hosts_allow_table;		/* for verification mode redirection */
+ extern char *hosts_deny_table;		/* for verification mode redirection */
+ extern int hosts_access_verbose;	/* for verbose matching mode */
+@@ -98,6 +114,8 @@
+ #ifdef __STDC__
+ extern struct request_info *request_init(struct request_info *,...);
+ extern struct request_info *request_set(struct request_info *,...);
++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr,
++		char *client_user);
+ #else
+ extern struct request_info *request_init();	/* initialize request */
+ extern struct request_info *request_set();	/* update request structure */
+@@ -121,20 +139,23 @@
+   * host_info structures serve as caches for the lookup results.
+   */
+ 
+-extern char *eval_user();		/* client user */
+-extern char *eval_hostname();		/* printable hostname */
+-extern char *eval_hostaddr();		/* printable host address */
+-extern char *eval_hostinfo();		/* host name or address */
+-extern char *eval_client();		/* whatever is available */
+-extern char *eval_server();		/* whatever is available */
++extern char *eval_user(struct request_info *);	/* client user */
++extern char *eval_hostname(struct host_info *);	/* printable hostname */
++extern char *eval_hostaddr(struct host_info *);	/* printable host address */
++extern char *eval_hostinfo(struct host_info *);	/* host name or address */
++extern char *eval_client(struct request_info *);/* whatever is available */
++extern char *eval_server(struct request_info *);/* whatever is available */
+ #define eval_daemon(r)	((r)->daemon)	/* daemon process name */
+ #define eval_pid(r)	((r)->pid)	/* process id */
+ 
+ /* Socket-specific methods, including DNS hostname lookups. */
+ 
+-extern void sock_host();		/* look up endpoint addresses */
+-extern void sock_hostname();		/* translate address to hostname */
+-extern void sock_hostaddr();		/* address to printable address */
++/* look up endpoint addresses */
++extern void sock_host(struct request_info *);
++/* translate address to hostname */
++extern void sock_hostname(struct host_info *);
++/* address to printable address */
++extern void sock_hostaddr(struct host_info *);
+ #define sock_methods(r) \
+ 	{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
+ 
+@@ -182,7 +203,7 @@
+   * behavior.
+   */
+ 
+-extern void process_options();		/* execute options */
++extern void process_options(char *, struct request_info *);/* execute options */
+ extern int dry_run;			/* verification flag */
+ 
+ /* Bug workarounds. */
+@@ -221,3 +242,7 @@
+ #define strtok	my_strtok
+ extern char *my_strtok();
+ #endif
++
++__END_DECLS
++
++#endif
+diff -ruN tcp_wrappers_7.6.orig/weak_symbols.c tcp_wrappers_7.6/weak_symbols.c
+--- tcp_wrappers_7.6.orig/weak_symbols.c	1970-01-01 01:00:00.000000000 +0100
++++ tcp_wrappers_7.6/weak_symbols.c	2004-05-02 15:31:09.000000000 +0200
+@@ -0,0 +1,11 @@
++ /*
++  * @(#) weak_symbols.h 1.5 99/12/29 23:50
++  * 
++  * Author: Anthony Towns <ajt@debian.org>
++  */
++
++#ifdef HAVE_WEAKSYMS
++#include <syslog.h>
++int deny_severity = LOG_WARNING;
++int allow_severity = SEVERITY; 
++#endif
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch
new file mode 100644
index 0000000..eb5685c
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/14_cidr_support.patch
@@ -0,0 +1,68 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5	2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5	2003-08-21 03:15:31.000000000 +0200
+@@ -90,6 +90,10 @@
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
+ .IP \(bu
++An expression of the form `n.n.n.n/mm' is interpreted as a
++`net/masklength' pair, where `mm' is the number of consecutive `1'
++bits in the netmask applied to the `n.n.n.n' address.
++.IP \(bu
+ An expression of the form `[n:n:n:n:n:n:n:n]/m\' is interpreted as a
+ `[net]/prefixlen\' pair. An IPv6 host address is matched if
+ `prefixlen\' bits of `net\' is equal to the `prefixlen\' bits of the
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.c tcp_wrappers_7.6/hosts_access.c
+--- tcp_wrappers_7.6.orig/hosts_access.c	2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.c	2003-08-21 03:09:30.000000000 +0200
+@@ -417,7 +417,8 @@
+     if ((addr = dot_quad_addr(string)) == INADDR_NONE)
+ 	return (NO);
+     if ((net = dot_quad_addr(net_tok)) == INADDR_NONE
+-	|| (mask = dot_quad_addr(mask_tok)) == INADDR_NONE) {
++	|| ((mask = dot_quad_addr(mask_tok)) == INADDR_NONE
++	    && (mask = cidr_mask_addr(mask_tok)) == 0)) {
+ #ifndef INET6
+ 	tcpd_warn("bad net/mask expression: %s/%s", net_tok, mask_tok);
+ #endif
+diff -ruN tcp_wrappers_7.6.orig/misc.c tcp_wrappers_7.6/misc.c
+--- tcp_wrappers_7.6.orig/misc.c	2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/misc.c	2003-08-21 03:09:30.000000000 +0200
+@@ -107,3 +107,17 @@
+     }
+     return (runs == 4 ? inet_addr(str) : INADDR_NONE);
+ }
++
++/* cidr_mask_addr - convert cidr netmask length to internal form */
++
++unsigned long cidr_mask_addr(str)
++char   *str;
++{
++    int     maskbits;
++
++    maskbits = atoi(str);
++    if (maskbits < 1 || maskbits > 32)
++	return (0);
++    return htonl(0xFFFFFFFF << (32 - maskbits));
++}
++
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c	2003-08-21 03:15:36.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c	2003-08-21 03:09:30.000000000 +0200
+@@ -497,12 +497,12 @@
+ 	int mask_len;
+ 
+ 	if ((dot_quad_addr(pat) == INADDR_NONE
+-	    || dot_quad_addr(mask) == INADDR_NONE)
++	    || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0)
+ 	    && (!is_inet6_addr(pat)
+ 		|| ((mask_len = atoi(mask)) < 0 || mask_len > 128)))
+ #else
+ 	if (dot_quad_addr(pat) == INADDR_NONE
+-	    || dot_quad_addr(mask) == INADDR_NONE)
++	    || dot_quad_addr(mask) == INADDR_NONE && cidr_mask_addr(mask) == 0)
+ #endif
+ 	    tcpd_warn("%s/%s: bad net/mask pattern", pat, mask);
+     } else if (STR_EQ(pat, "FAIL")) {		/* obsolete */
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch
new file mode 100644
index 0000000..3ca6874
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/15_match_clarify.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5	2004-04-25 12:17:59.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.5	2004-04-25 12:17:53.000000000 +0200
+@@ -89,6 +89,8 @@
+ bitwise AND of the address and the `mask\'. For example, the net/mask
+ pattern `131.155.72.0/255.255.254.0\' matches every address in the
+ range `131.155.72.0\' through `131.155.73.255\'.
++`255.255.255.255\' is not a valid mask value, so a single host can be
++matched just by its IP.
+ .IP \(bu
+ An expression of the form `n.n.n.n/mm' is interpreted as a
+ `net/masklength' pair, where `mm' is the number of consecutive `1'
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch
new file mode 100644
index 0000000..3087377
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/expand_remote_port.patch
@@ -0,0 +1,73 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/eval.c tcp_wrappers_7.6/eval.c
+--- tcp_wrappers_7.6.orig/eval.c	1995-01-30 19:51:46.000000000 +0100
++++ tcp_wrappers_7.6/eval.c	2004-11-04 13:59:01.000000000 +0100
+@@ -98,6 +98,28 @@
+     }
+ }
+ 
++/* eval_port - return string with the port */
++char   *eval_port(saddr)
++#ifdef INET6
++struct sockaddr *saddr;
++#else
++struct sockaddr_in *saddr;
++#endif
++{
++    static char port[16];
++    if (saddr != 0) {
++        sprintf(port, "%u",
++#ifdef INET6
++            ntohs(((struct sockaddr_in *)saddr)->sin_port));
++#else
++            ntohs(saddr->sin_port));
++#endif
++    } else {
++	strcpy(port, "0");
++    }
++    return (port);
++}
++
+ /* eval_client - return string with as much about the client as we know */
+ 
+ char   *eval_client(request)
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.5 tcp_wrappers_7.6/hosts_access.5
+--- tcp_wrappers_7.6.orig/hosts_access.5	2004-11-04 13:17:45.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.5	2004-11-04 13:55:32.000000000 +0100
+@@ -175,6 +175,8 @@
+ unavailable.
+ .IP "%n (%N)"
+ The client (server) host name (or "unknown" or "paranoid").
++.IP "%r (%R)"
++The clients (servers) port number (or "0").
+ .IP %p
+ The daemon process id.
+ .IP %s
+diff -ruN tcp_wrappers_7.6.orig/percent_x.c tcp_wrappers_7.6/percent_x.c
+--- tcp_wrappers_7.6.orig/percent_x.c	1994-12-28 17:42:38.000000000 +0100
++++ tcp_wrappers_7.6/percent_x.c	2004-11-04 13:19:29.000000000 +0100
+@@ -63,6 +63,8 @@
+ 		ch == 'n' ? eval_hostname(request->client) :
+ 		ch == 'N' ? eval_hostname(request->server) :
+ 		ch == 'p' ? eval_pid(request) :
++		ch == 'r' ? eval_port(request->client->sin) :
++		ch == 'R' ? eval_port(request->server->sin) :
+ 		ch == 's' ? eval_server(request) :
+ 		ch == 'u' ? eval_user(request) :
+ 		ch == '%' ? "%" : (tcpd_warn("unrecognized %%%c", ch), "");
+diff -ruN tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h	2004-11-04 13:17:45.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h	2004-11-04 13:19:13.000000000 +0100
+@@ -145,6 +145,11 @@
+ extern char *eval_hostinfo(struct host_info *);	/* host name or address */
+ extern char *eval_client(struct request_info *);/* whatever is available */
+ extern char *eval_server(struct request_info *);/* whatever is available */
++#ifdef INET6
++extern char *eval_port(struct sockaddr *);
++#else
++extern char *eval_port(struct sockaddr_in *);
++#endif
+ #define eval_daemon(r)	((r)->daemon)	/* daemon process name */
+ #define eval_pid(r)	((r)->pid)	/* process id */
+ 
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch
new file mode 100644
index 0000000..4cc554f
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/have_strerror.patch
@@ -0,0 +1,21 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/percent_m.c tcp_wrappers_7.6/percent_m.c
+--- tcp_wrappers_7.6.orig/percent_m.c	1994-12-28 17:42:37.000000000 +0100
++++ tcp_wrappers_7.6/percent_m.c	2003-08-21 02:45:31.000000000 +0200
+@@ -29,11 +29,15 @@
+ 
+     while (*bp = *cp)
+ 	if (*cp == '%' && cp[1] == 'm') {
++#ifdef HAVE_STRERROR
++	    strcpy(bp, strerror(errno));
++#else
+ 	    if (errno < sys_nerr && errno > 0) {
+ 		strcpy(bp, sys_errlist[errno]);
+ 	    } else {
+ 		sprintf(bp, "Unknown error %d", errno);
+ 	    }
++#endif
+ 	    bp += strlen(bp);
+ 	    cp += 2;
+ 	} else {
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
new file mode 100644
index 0000000..3ba214d
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/ldflags.patch
@@ -0,0 +1,45 @@
+Upstream-Status: Backport
+
+Index: tcp_wrappers_7.6.orig/Makefile
+===================================================================
+--- tcp_wrappers_7.6.orig.orig/Makefile	2009-04-06 10:55:47.000000000 +0000
++++ tcp_wrappers_7.6.orig/Makefile	2009-04-06 10:57:04.000000000 +0000
+@@ -748,31 +748,31 @@
+ 
+ $(SHLIB): $(SHLIB_OBJ)
+ 	rm -f $(SHLIB)
+-	$(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
++	$(CC) $(LDFLAGS) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
+ 	ln -sf $(notdir $(SHLIB)) $(SHLIBSOMAJ)
+ 	ln -sf $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
+ 
+ tcpd:	tcpd.o $(SHLIB)
+-	$(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
++	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
+ 
+ miscd:	miscd.o $(LIB)
+-	$(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
++	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
+ 
+ safe_finger: safe_finger.o $(SHLIB)
+-	$(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
++	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
+ 
+ TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
+ 
+ tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
+-	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
++	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
+ 
+ try-from: try-from.o fakelog.o $(SHLIB)
+-	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
++	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
+ 
+ TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
+ 
+ tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
+-	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
++	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
+ 
+ shar:	$(KIT)
+ 	@shar $(KIT)
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch
new file mode 100644
index 0000000..7973525
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/makefile-fix-parallel.patch
@@ -0,0 +1,54 @@
+From daf89d272e51b2153015ce7f54ab0b86182e64c1 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 28 Jan 2015 18:50:23 -0800
+Subject: [PATCH] Makefile: fix for parallel build
+
+Fixed:
+make: *** No rule to make target `cflags', needed by `tcpd.o'.  Stop.
+
+Let "cflags" depend on config-check which generates cflgas will fix the
+problem.
+
+Also fixed:
+Fatal error: can't create shared/hosts_access.o: No such file or directory
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index fe5e732..f468751 100644
+--- a/Makefile
++++ b/Makefile
+@@ -714,6 +714,7 @@ KIT	= README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
+ LIB	= libwrap.a
+ 
+ shared/%.o: %.c
++	[ -d shared ] || mkdir -p shared
+ 	$(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
+ 
+ SOMAJOR = 0
+@@ -730,6 +731,8 @@ SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
+ 
+ all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
+ 
++cflags: config-check
++
+ # Invalidate all object files when the compiler options (CFLAGS) have changed.
+ 
+ config-check:
+@@ -739,7 +742,7 @@ config-check:
+ 	then rm cflags.new ; \
+ 	else mv cflags.new cflags ; \
+ 	fi >/dev/null 2>/dev/null
+-	@if [ ! -d shared ]; then mkdir shared; fi
++	@[ -d shared ] || mkdir -p shared
+ 
+ $(LIB):	$(LIB_OBJ)
+ 	rm -f $(LIB)
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch
new file mode 100644
index 0000000..19bd7d3
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/man_fromhost.patch
@@ -0,0 +1,23 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/hosts_access.3 tcp_wrappers_7.6/hosts_access.3
+--- tcp_wrappers_7.6.orig/hosts_access.3	2004-04-25 00:10:48.000000000 +0200
++++ tcp_wrappers_7.6/hosts_access.3	2004-04-25 00:09:36.000000000 +0200
+@@ -14,6 +14,9 @@
+ struct request_info *request_set(request, key, value, ..., 0)
+ struct request_info *request;
+ 
++void fromhost(request)
++struct request_info *request;
++
+ int hosts_access(request)
+ struct request_info *request;
+ 
+@@ -60,6 +63,7 @@
+ is available, host names and client user names are looked up on demand,
+ using the request structure as a cache.  hosts_access() returns zero if
+ access should be denied.
++fromhost() must be called before hosts_access().
+ .PP
+ hosts_ctl() is a wrapper around the request_init() and hosts_access()
+ routines with a perhaps more convenient interface (though it does not
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch
new file mode 100644
index 0000000..7650600
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rename_strings_variable.patch
@@ -0,0 +1,35 @@
+STRINGS name conflicts with variable for strings tools (e.g. i586-oe-linux-strings)
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- tcp_wrappers_7.6/Makefile.orig	2013-04-18 23:41:58.277981740 +0200
++++ tcp_wrappers_7.6/Makefile	2013-04-18 23:42:42.513978966 +0200
+@@ -309,7 +309,7 @@
+ pyramid:
+ 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
+ 	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ="environ.o vfprintf.o" \
+-	STRINGS="-Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy" \
++	STRINGS_FLAGS="-Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy" \
+ 	NETGROUP="-DNETGROUP -DUSE_GETDOMAIN" TLI= all
+ 
+ # Untested.
+@@ -419,7 +419,7 @@
+ # Uncomment the following if your C library does not provide the
+ # strchr/strrchr/memcmp routines, but comes with index/rindex/bcmp.
+ #
+-#STRINGS= -Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy
++#STRINGS_FLAGS= -Dstrchr=index -Dstrrchr=rindex -Dmemcmp=bcmp -Dno_memcpy
+ 
+ #################################################################
+ # System dependencies: selection of non-default object libraries.
+@@ -690,7 +690,7 @@
+ 	$(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
+ 	-DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
+ 	-DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
+-	$(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
++	$(UCHAR) $(TABLES) $(STRINGS_FLAGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
+ 	$(VSYSLOG) $(HOSTNAME)
+ 
+ LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
new file mode 100644
index 0000000..5875b81
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/restore_sigalarm.patch
@@ -0,0 +1,39 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c	2004-08-29 18:40:08.000000000 +0200
++++ tcp_wrappers_7.6/rfc931.c	2004-08-29 18:40:02.000000000 +0200
+@@ -92,6 +92,8 @@
+     char   *cp;
+     char   *result = unknown;
+     FILE   *fp;
++    unsigned saved_timeout;
++    struct sigaction nact, oact;
+ 
+ #ifdef INET6
+     /* address family must be the same */
+@@ -134,7 +136,12 @@
+ 	 */
+ 
+ 	if (setjmp(timebuf) == 0) {
+-	    signal(SIGALRM, timeout);
++	    /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
++	    saved_timeout = alarm(0);
++	    nact.sa_handler = timeout;
++	    nact.sa_flags = 0;
++	    (void) sigemptyset(&nact.sa_mask);
++	    (void) sigaction(SIGALRM, &nact, &oact);
+ 	    alarm(rfc931_timeout);
+ 
+ 	    /*
+@@ -223,6 +230,10 @@
+ 	    }
+ 	    alarm(0);
+ 	}
++	/* Restore SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
++	(void) sigaction(SIGALRM, &oact, NULL);
++	if (saved_timeout > 0)
++	    alarm(saved_timeout);
+ 	fclose(fp);
+     }
+     STRN_CPY(dest, result, STRING_LENGTH);
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff
new file mode 100644
index 0000000..723f4f1
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/rfc931.diff
@@ -0,0 +1,41 @@
+Upstream-Status: Backport
+
+diff -ruNp tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c
+--- tcp_wrappers_7.6.orig/scaffold.c	2005-03-09 18:22:04.000000000 +0100
++++ tcp_wrappers_7.6/scaffold.c	2005-03-09 18:20:47.000000000 +0100
+@@ -237,10 +237,17 @@ struct request_info *request;
+ 
+ /* ARGSUSED */
+ 
+-void    rfc931(request)
+-struct request_info *request;
++void    rfc931(rmt_sin, our_sin, dest)
++#ifdef INET6
++struct sockaddr *rmt_sin;
++struct sockaddr *our_sin;
++#else
++struct sockaddr_in *rmt_sin;
++struct sockaddr_in *our_sin;
++#endif
++char   *dest;
+ {
+-    strcpy(request->user, unknown);
++    strcpy(dest, unknown);
+ }
+ 
+ /* check_path - examine accessibility */
+diff -ruNp tcp_wrappers_7.6.orig/tcpd.h tcp_wrappers_7.6/tcpd.h
+--- tcp_wrappers_7.6.orig/tcpd.h	2005-03-09 18:22:04.000000000 +0100
++++ tcp_wrappers_7.6/tcpd.h	2005-03-09 18:21:23.000000000 +0100
+@@ -83,7 +83,11 @@ extern int hosts_access(struct request_i
+ extern void shell_cmd(char *);		/* execute shell command */
+ extern char *percent_x(char *, int, char *, struct request_info *);
+ 					/* do %<char> expansion */
++#ifdef INET6
+ extern void rfc931(struct sockaddr *, struct sockaddr *, char *);
++#else
++extern void rfc931(struct sockaddr_in *, struct sockaddr_in *, char *);
++#endif
+ 					/* client name from RFC 931 daemon */
+ extern void clean_exit(struct request_info *);	/* clean up and exit */
+ extern void refuse(struct request_info *);	/* clean up and exit */
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8 b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8
new file mode 100644
index 0000000..875616b
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.8
@@ -0,0 +1,34 @@
+.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
+.SH NAME
+safe_finger \- finger client wrapper that protects against nasty stuff
+from finger servers
+.SH SYNOPSIS
+.B safe_finger [finger_options]
+.SH DESCRIPTION
+The
+.B safe_finger
+command protects against nasty stuff from finger servers. Use this
+program for automatic reverse finger probes from the
+.B tcp_wrapper
+.B (tcpd)
+, not the raw finger command. The
+.B safe_finger
+command makes sure that the finger client is not run with root
+privileges. It also runs the finger client with a defined PATH
+environment.
+.B safe_finger
+will also protect you from problems caused by the output of some
+finger servers. The problem: some programs may react to stuff in
+the first column. Other programs may get upset by thrash anywhere
+on a line. File systems may fill up as the finger server keeps
+sending data. Text editors may bomb out on extremely long lines.
+The finger server may take forever because it is somehow wedged.
+.B safe_finger
+takes care of all this badness.
+.SH SEE ALSO
+.BR hosts_access (5),
+.BR hosts_options (5),
+.BR tcpd (8)
+.SH AUTHOR
+Wietse Venema, Eindhoven University of Technology, The Netherlands.
+
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch
new file mode 100644
index 0000000..fc2afee
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/safe_finger.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Backport
+
+--- tcp-wrappers-7.6-ipv6.1.orig/safe_finger.c
++++ tcp-wrappers-7.6-ipv6.1/safe_finger.c
+@@ -26,21 +26,24 @@
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <pwd.h>
++#include <syslog.h>
+ 
+ extern void exit();
+ 
+ /* Local stuff */
+ 
+-char    path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
++char    path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
+ 
+ #define	TIME_LIMIT	60		/* Do not keep listinging forever */
+ #define	INPUT_LENGTH	100000		/* Do not keep listinging forever */
+ #define	LINE_LENGTH	128		/* Editors can choke on long lines */
+ #define	FINGER_PROGRAM	"finger"	/* Most, if not all, UNIX systems */
+ #define	UNPRIV_NAME	"nobody"	/* Preferred privilege level */
+-#define	UNPRIV_UGID	32767		/* Default uid and gid */
++#define	UNPRIV_UGID	65534		/* Default uid and gid */
+ 
+ int     finger_pid;
++int	allow_severity = SEVERITY;
++int	deny_severity = LOG_WARNING;
+ 
+ void    cleanup(sig)
+ int     sig;
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch
new file mode 100644
index 0000000..9d7ea04
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/sig_fix.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Backport
+
+* Mon Feb 10 2003 Harald Hoyer <harald@redhat.de> 7.6-29
+- added security patch tcp_wrappers-7.6-sig.patch
+
+--- tcp_wrappers_7.6/hosts_access.c.sig	2003-02-10 16:18:31.000000000 +0100
++++ tcp_wrappers_7.6/hosts_access.c	2003-02-10 16:50:38.000000000 +0100
+@@ -66,6 +66,7 @@
+ 
+ #define	YES		1
+ #define	NO		0
++#define ERR             -1
+ 
+  /*
+   * These variables are globally visible so that they can be redirected in
+@@ -129,9 +129,9 @@
+ 	return (verdict == AC_PERMIT);
+     if (table_match(hosts_allow_table, request))
+ 	return (YES);
+-    if (table_match(hosts_deny_table, request))
+-	return (NO);
+-    return (YES);
++    if (table_match(hosts_deny_table, request) == NO)
++	return (YES);
++    return (NO);
+ }
+ 
+ /* table_match - match table entries with (daemon, client) pair */
+@@ -175,6 +175,7 @@
+ 	(void) fclose(fp);
+     } else if (errno != ENOENT) {
+ 	tcpd_warn("cannot open %s: %m", table);
++	match = ERR;
+     }
+     if (match) {
+ 	if (hosts_access_verbose > 1)
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch
new file mode 100644
index 0000000..76dd634
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/siglongjmp.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Backport
+
+diff -ruNp tcp_wrappers_7.6.orig/rfc931.c tcp_wrappers_7.6/rfc931.c
+--- tcp_wrappers_7.6.orig/rfc931.c	2004-08-29 18:42:25.000000000 +0200
++++ tcp_wrappers_7.6/rfc931.c	2004-08-29 18:41:04.000000000 +0200
+@@ -33,7 +33,7 @@ static char sccsid[] = "@(#) rfc931.c 1.
+ 
+ int     rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
+ 
+-static jmp_buf timebuf;
++static sigjmp_buf timebuf;
+ 
+ /* fsocket - open stdio stream on top of socket */
+ 
+@@ -62,7 +62,7 @@ int     protocol;
+ static void timeout(sig)
+ int     sig;
+ {
+-    longjmp(timebuf, sig);
++    siglongjmp(timebuf, sig);
+ }
+ 
+ /* rfc931 - return remote user name, given socket structures */
+@@ -135,7 +135,7 @@ char   *dest;
+ 	 * Set up a timer so we won't get stuck while waiting for the server.
+ 	 */
+ 
+-	if (setjmp(timebuf) == 0) {
++	if (sigsetjmp(timebuf, 0) == 0) {
+ 	    /* Save SIGALRM timer and handler. Sudheer Abdul-Salam, SUN. */
+ 	    saved_timeout = alarm(0);
+ 	    nact.sa_handler = timeout;
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch
new file mode 100644
index 0000000..8e46df8
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/socklen_t.patch
@@ -0,0 +1,59 @@
+commit 88b6984ef0bf3b703c1c851092662b95e91db1ff
+Author: farrah rashid <farrah.rashid@windriver.com>
+Date:   Tue Feb 12 09:53:50 2013 -0500
+
+    tcp-wrappers Support for building with glibc
+    
+    Added support for socklen_t type to len argument passed to socket related
+    calls. This fixes a bug that causes tcp wrappers to fail when using sshd.
+    
+    Upstream-Status: Pending
+    
+    Signed-off-by: farrah rashid <farrah.rashid@windriver.com>
+
+diff --git a/fix_options.c b/fix_options.c
+index 7473adf..fe2b442 100644
+--- a/fix_options.c
++++ b/fix_options.c
+@@ -38,7 +38,12 @@ struct request_info *request;
+ #ifdef IP_OPTIONS
+     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
+     char    lbuf[BUFFER_SIZE], *lp;
+-    int     optsize = sizeof(optbuf), ipproto;
++#ifdef __GLIBC__
++    socklen_t  optsize = sizeof(optbuf);
++#else
++    int     optsize = sizeof(optbuf);
++#endif
++    int ipproto;
+     struct protoent *ip;
+     int     fd = request->fd;
+     unsigned int opt;
+diff --git a/socket.c b/socket.c
+index 4b2c575..a0d2987 100644
+--- a/socket.c
++++ b/socket.c
+@@ -95,7 +95,11 @@ struct request_info *request;
+     static struct sockaddr_in client;
+     static struct sockaddr_in server;
+ #endif
++#ifdef __GLIBC__
++    socklen_t  len;
++#else
+     int     len;
++#endif
+     char    buf[BUFSIZ];
+     int     fd = request->fd;
+ 
+@@ -426,7 +430,11 @@ int     fd;
+ #else
+     struct sockaddr_in sin;
+ #endif
++#ifdef __GLIBC__
++    socklen_t  size = sizeof(sin);
++#else
+     int     size = sizeof(sin);
++#endif
+ 
+     /*
+      * Eat up the not-yet received datagram. Some systems insist on a
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch
new file mode 100644
index 0000000..be29bdc
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/tcpdchk_libwrapped.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Backport
+
+diff -ruN tcp_wrappers_7.6.orig/tcpdchk.c tcp_wrappers_7.6/tcpdchk.c
+--- tcp_wrappers_7.6.orig/tcpdchk.c	2003-08-21 02:50:37.000000000 +0200
++++ tcp_wrappers_7.6/tcpdchk.c	2003-08-21 02:50:33.000000000 +0200
+@@ -53,6 +53,24 @@
+ #include "inetcf.h"
+ #include "scaffold.h"
+ 
++/* list of programs which are known to be linked with libwrap in debian */
++static const char *const libwrap_programs[] = {
++    "portmap", "mountd", "statd", "ugidd",
++    "redir", "rlinetd",
++    "sshd",
++    "atftpd",
++    "diald",
++    "esound",
++    "gdm", "gnome-session",
++    "icecast", "icecast_admin", "icecast_client", "icecast_source",
++    "mysqld",
++    "ntop",
++    "pptpd",
++    "rquotad",
++    "sendmail", "smail",
++    NULL
++};
++
+  /*
+   * Stolen from hosts_access.c...
+   */
+@@ -147,8 +165,8 @@
+     /*
+      * These are not run from inetd but may have built-in access control.
+      */
+-    inet_set("portmap", WR_NOT);
+-    inet_set("rpcbind", WR_NOT);
++    for (c = 0; libwrap_programs[c]; c++)
++	inet_set(libwrap_programs[c], WR_YES);
+ 
+     /*
+      * Check accessibility of access control files.
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8 b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8
new file mode 100644
index 0000000..9c8f305
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers-7.6/try-from.8
@@ -0,0 +1,28 @@
+.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
+.SH NAME
+try-from \- test program for the tcp_wrapper
+.SH SYNOPSIS
+.B try-from
+.SH DESCRIPTION
+The
+.B try-from
+command can be called via a remote shell command to find out
+if the hostname and address are properly recognized
+by the
+.B tcp_wrapper
+library, if username lookup works, and (SysV only) if the TLI
+on top of IP heuristics work. Diagnostics are reported through
+.BR syslog (3)
+and redirected to stderr.
+
+Example:
+
+rsh host /some/where/try-from
+
+.SH SEE ALSO
+.BR hosts_access (5),
+.BR hosts_options (5),
+.BR tcpd (8)
+.SH AUTHOR
+Wietse Venema, Eindhoven University of Technology, The Netherlands.
+
diff --git a/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb b/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
new file mode 100644
index 0000000..2630478
--- /dev/null
+++ b/meta/recipes-extended/tcp-wrappers/tcp-wrappers_7.6.bb
@@ -0,0 +1,128 @@
+SUMMARY = "Security tool that is a wrapper for TCP daemons"
+DESCRIPTION = "Tools for monitoring and filtering incoming requests for tcp \
+               services."
+SECTION = "console/network"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://DISCLAIMER;md5=071bd69cb78b18888ea5e3da5c3127fa"
+PR ="r10"
+
+
+PACKAGES = "${PN}-dbg libwrap libwrap-doc libwrap-dev libwrap-staticdev ${PN} ${PN}-doc"
+FILES_libwrap = "${base_libdir}/lib*${SOLIBS}"
+FILES_libwrap-doc = "${mandir}/man3 ${mandir}/man5"
+FILES_libwrap-dev = "${libdir}/lib*${SOLIBSDEV} ${includedir}"
+FILES_libwrap-staticdev = "${libdir}/lib*.a"
+FILES_${PN} = "${sbindir}"
+FILES_${PN}-doc = "${mandir}/man8"
+
+SRC_URI = "ftp://ftp.porcupine.org/pub/security/tcp_wrappers_${PV}.tar.gz \
+           file://00_man_quoting.diff \
+           file://01_man_portability.patch \
+           file://05_wildcard_matching.patch \
+           file://06_fix_gethostbyname.patch \
+           file://10_usagi-ipv6.patch \
+           file://11_tcpd_blacklist.patch \
+           file://11_usagi_fix.patch \
+           file://12_makefile_config.patch \
+           file://13_shlib_weaksym.patch \
+           file://14_cidr_support.patch \
+           file://15_match_clarify.patch \
+           file://expand_remote_port.patch \
+           file://have_strerror.patch \
+           file://man_fromhost.patch \
+           file://restore_sigalarm.patch \
+           file://rfc931.diff \
+           file://safe_finger.patch \
+           file://sig_fix.patch \
+           file://siglongjmp.patch \
+           file://socklen_t.patch \
+           file://tcpdchk_libwrapped.patch \
+           file://ldflags.patch \
+           file://rename_strings_variable.patch \
+           file://try-from.8 \
+           file://safe_finger.8 \
+           file://makefile-fix-parallel.patch \
+           "
+
+SRC_URI[md5sum] = "e6fa25f71226d090f34de3f6b122fb5a"
+SRC_URI[sha256sum] = "9543d7adedf78a6de0b221ccbbd1952e08b5138717f4ade814039bb489a4315d"
+
+S = "${WORKDIR}/tcp_wrappers_${PV}"
+
+EXTRA_OEMAKE = "'CC=${CC}' \
+                'AR=${AR}' \
+                'RANLIB=${RANLIB}' \
+                'REAL_DAEMON_DIR=${sbindir}' \
+                'STYLE=-DPROCESS_OPTIONS' \
+                'FACILITY=LOG_DAEMON' \
+                'SEVERITY=LOG_INFO' \
+                'BUGS=' \
+                'VSYSLOG=' \
+                'RFC931_TIMEOUT=10' \
+                'ACCESS=-DHOSTS_ACCESS' \
+                'KILL_OPT=-DKILL_IP_OPTIONS' \
+                'UMASK=-DDAEMON_UMASK=022' \
+                'NETGROUP=${EXTRA_OEMAKE_NETGROUP}' \
+                'LIBS=-lnsl' \
+                'ARFLAGS=rv' \
+                'AUX_OBJ=weak_symbols.o' \
+                'TLI=' \
+                'COPTS=' \
+                'EXTRA_CFLAGS=${CFLAGS} -DSYS_ERRLIST_DEFINED -DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT -DINET6=1 -Dss_family=__ss_family -Dss_len=__ss_len'"
+
+EXTRA_OEMAKE_NETGROUP = "-DNETGROUP -DUSE_GETDOMAIN"
+EXTRA_OEMAKE_NETGROUP_libc-uclibc = "-DUSE_GETDOMAIN"
+
+do_compile () {
+	oe_runmake 'TABLES=-DHOSTS_DENY=\"${sysconfdir}/hosts.deny\" -DHOSTS_ALLOW=\"${sysconfdir}/hosts.allow\"' \
+		   all
+}
+
+BINS = "safe_finger tcpd tcpdchk try-from tcpdmatch"
+MANS3 = "hosts_access"
+MANS5 = "hosts_options"
+MANS8 = "tcpd tcpdchk tcpdmatch"
+do_install () {
+	oe_libinstall -a libwrap ${D}${libdir}
+	oe_libinstall -C shared -so libwrap ${D}${base_libdir}
+
+	if [ "${libdir}" != "${base_libdir}" ] ; then
+		rel_lib_prefix=`echo ${libdir} | sed 's,\(^/\|\)[^/][^/]*,..,g'`
+		libname=`readlink ${D}${base_libdir}/libwrap.so | xargs basename`
+		ln -s ${rel_lib_prefix}${base_libdir}/${libname} ${D}${libdir}/libwrap.so
+		rm -f ${D}${base_libdir}/libwrap.so
+	fi
+
+	install -d ${D}${sbindir}
+	for b in ${BINS}; do
+		install -m 0755 $b ${D}${sbindir}/ || exit 1
+	done
+
+	install -d ${D}${mandir}/man3
+	for m in ${MANS3}; do
+		install -m 0644 $m.3 ${D}${mandir}/man3/ || exit 1
+	done
+
+	install -d ${D}${mandir}/man5
+	for m in ${MANS5}; do
+		install -m 0644 $m.5 ${D}${mandir}/man5/ || exit 1
+	done
+
+	install -d ${D}${mandir}/man8
+	for m in ${MANS8}; do
+		install -m 0644 $m.8 ${D}${mandir}/man8/ || exit 1
+	done
+
+	install -m 0644 ${WORKDIR}/try-from.8 ${D}${mandir}/man8/
+	install -m 0644 ${WORKDIR}/safe_finger.8 ${D}${mandir}/man8/
+
+	install -d ${D}${includedir}
+	install -m 0644 tcpd.h ${D}${includedir}/
+
+	install -d ${D}${sysconfdir}
+	touch ${D}${sysconfdir}/hosts.allow
+	touch ${D}${sysconfdir}/hosts.deny
+}
+
+FILES_${PN} += "${sysconfdir}/hosts.allow ${sysconfdir}/hosts.deny"
diff --git a/meta/recipes-extended/texi2html/texi2html_5.0.bb b/meta/recipes-extended/texi2html/texi2html_5.0.bb
new file mode 100644
index 0000000..eac289e
--- /dev/null
+++ b/meta/recipes-extended/texi2html/texi2html_5.0.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Perl script that converts Texinfo to HTML"
+HOMEPAGE    = "http://www.nongnu.org/texi2html/"
+SECTION     = "console/utils"
+LICENSE     = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+PR = "r2"
+
+SRC_URI     = "${SAVANNAH_GNU_MIRROR}/texi2html/${BPN}-${PV}.tar.bz2 \
+               "
+
+SRC_URI[md5sum] = "f15ac876fcdc8be865b16535f480aa54"
+SRC_URI[sha256sum] = "e8a98b0ee20c495a6ab894398a065ef580272dbd5a15b1b19e8bd1bc89d9f9fa"
+
+inherit autotools gettext texinfo
+
+do_configure_prepend() {
+	# autotools_do_configure updates po/Makefile.in.in, we also need
+	# update po_document.
+	cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_document/
+	cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_messages/
+}
+
+do_install_append () {
+	sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/texi2html
+}
+
+FILES_${PN}-doc += "${datadir}/texinfo"
diff --git a/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb b/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb
new file mode 100644
index 0000000..b5420a3
--- /dev/null
+++ b/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy-native.bb
@@ -0,0 +1,30 @@
+DESCRIPTION = "Fake version of the texinfo utility suite"
+SECTION = "console/utils"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d6bb62e73ca8b901d3f2e9d71542f4bb"
+DEPENDS = ""
+PV = "1.0"
+
+SRC_URI = "file://template.py file://COPYING"
+
+S = "${WORKDIR}"
+
+NATIVE_PACKAGE_PATH_SUFFIX = "/${PN}"
+
+inherit native
+
+do_install_name() {
+    FILENAME="${D}${bindir}/$1"
+    # Using ln causes problems with rm_work
+    cp -T "${S}/template.py" "$FILENAME"
+    chmod +x $FILENAME
+}
+
+do_install() {
+    mkdir -p "${D}${bindir}"
+    for i in makeinfo pod2texi texi2dvi pdftexi2dvi texindex texi2pdf \
+             txixml2texi texi2any install-info ginstall-info \
+             update-info-dir; do
+        do_install_name $i
+    done
+}
diff --git a/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING b/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING
new file mode 100644
index 0000000..531cbe7
--- /dev/null
+++ b/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/COPYING
@@ -0,0 +1,19 @@
+Copyright (c) 2014 Intel Corp.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py b/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py
new file mode 100644
index 0000000..8b7033e
--- /dev/null
+++ b/meta/recipes-extended/texinfo-dummy-native/texinfo-dummy/template.py
@@ -0,0 +1,122 @@
+#! /usr/bin/env python2.7
+
+# template.py (and other filenames)
+# By Max Eliaser (max.eliaser@intel.com)
+
+# Copyright (c) 2014 Intel Corp.
+
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+# This program acts like a dummy version of the texinfo utilities, creating
+# the right output files but leaving them blank. It will parse out the name
+# of the executable from argv[0] and emulate the corresponding program, so
+# multiple copies of this script will exist under different names.
+
+import sys, os
+
+olong = "--output="
+Elong = "--macro-expand="
+
+
+this_binary = sys.argv[0].split ("/")[-1]
+
+# To be outputted if functionality that hasn't been stubbed yet is invoked.
+stub_msg = """
+This stand-in version of %s is not yet fully capable of emulating the real
+version from the GNU texinfo suite. If you see this message, file a bug report
+with details on the recipe that failed.
+""" % this_binary
+
+# Autotools setups query the version, so this is actually necessary. Some of
+# them (lookin' at you, glibc) actually look for the substring "GNU texinfo,"
+# so we put that substring in there without actually telling a lie.
+version_str = """ %s (fake texinfo, emulating GNU texinfo) 5.2
+ 
+Super amazing version which is totally not fake in any way whatsoever.
+Copyright (C) 2014 Intel Corp. Distributed under the terms of the MIT
+license.
+""" % this_binary
+
+simple_binaries = "pod2texi texi2dvi pdftexi2dvi texindex texi2pdf \
+                   txixml2texi install-info ginstall-info \
+                   update-info-dir".split ()
+
+# These utilities use a slightly different set of options and flags.
+complex_binaries = "makeinfo texi2any".split ()
+
+valid_binaries = simple_binaries + complex_binaries
+
+# For generating blank output files.
+def touch_file (path):
+    f = open (path, "w")
+    f.close ()
+
+assert this_binary in valid_binaries, \
+       this_binary + " is not one of " + ', '.join (valid_binaries)
+
+if "--version" in sys.argv:
+    print version_str
+    sys.exit (0)
+
+# For debugging
+log_interceptions = False
+if log_interceptions:
+    f = open ("/tmp/intercepted_" + this_binary, "a")
+    f.write (' '.join ([this_binary] + sys.argv[1:]) + '\n')
+    f.close ()
+
+# Look through the options and flags, and if necessary, touch any output
+# files.
+arg_idx = 1
+while arg_idx < len (sys.argv):
+    arg = sys.argv [arg_idx]
+    
+    if arg == "--":
+        break
+    
+    # Something like -I . can result in a need for this (specifically the .)
+    elif len (arg) < 2:
+        pass
+    
+    # Check if -o or --output is specified. These can be used at most once.
+    elif arg[0] == '-' and arg[1] != '-' and arg[len (arg) - 1] == 'o':
+        touch_file (sys.argv[arg_idx + 1])
+        sys.exit (0)
+    elif arg.startswith (olong):
+        touch_file (arg.split ("=")[1])
+        sys.exit (0)
+    
+    # Check for functionality that isn't implemented yet.
+    else:
+        assert arg[0] != '-' or arg[1] == '-' or 'E' not in arg or \
+               this_binary in simple_binaries, \
+               "-E option not yet supported" + stub_msg
+        
+        assert not arg.startswith (Elong), \
+               Elong[:-1] + " option not yet supported" + stub_msg
+    
+    arg_idx += 1
+
+# The -o/--output option overrides the default. For makeinfo and texi2any,
+# that default is to look for a @setfilename command in the input file.
+# Otherwise, printing nothing to stdout and then exiting should suffice.
+assert this_binary in simple_binaries, \
+       "Don't know how to get default output file name from input file!" + \
+       stub_msg
+
diff --git a/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch b/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch
new file mode 100644
index 0000000..f4d6660
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo-4.8/check-locale-h.patch
@@ -0,0 +1,28 @@
+fix the macro check
+
+Upstream-Status: Pending
+
+configure does not check if locale.h exists, but check setlocale,
+if setlocale exist, the locale.h should exist.
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ lib/system.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/system.h b/lib/system.h
+index 946eb3c..c70037b 100644
+--- a/lib/system.h
++++ b/lib/system.h
+@@ -42,7 +42,7 @@ extern char *substring (const char *, const char *);
+ #include <ctype.h>
+ 
+ /* All systems nowadays probably have these functions, but ... */
+-#ifdef HAVE_LOCALE_H
++#ifdef HAVE_SETLOCALE
+ #include <locale.h>
+ #endif
+ #ifndef HAVE_SETLOCALE
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch b/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch
new file mode 100644
index 0000000..81ebe26
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo-4.8/do-compile-native-tools.patch
@@ -0,0 +1,49 @@
+From 458e9450cecf703f55536e609365162719585900 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Wed, 10 Sep 2014 17:03:29 +0800
+Subject: [PATCH] do not compile host tools, since we have native
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ configure.ac | 23 +----------------------
+ 1 file changed, 1 insertion(+), 22 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b46130d..cf58654 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -90,28 +90,7 @@ AC_CANONICAL_BUILD
+ # $native_tools is also added to SUBDIRS in the main Makefile.am,
+ # so that make compiles the native tools first.
+ #
+-if test "$cross_compiling" = no; then
+-  native_tools=
+-else
+-  native_tools=tools
+-  test -d "$native_tools" || mkdir "$native_tools"
+-  confdir=`(cd "$srcdir";pwd)`
+-  # Make sure the secondary configure won't fail with
+-  # "error: source directory already configured".
+-  rm -f config.status
+-  AC_MSG_NOTICE([[Doing configure of native tools (${build}).]])
+-  cd "$native_tools" || exit 1
+-  # Run secondary configure in alternate environment or
+-  # it gets the wrong CC etc.  env -i gives this build host configure
+-  # a clean environment.
+-  env -i CC="${BUILD_CC}" AR="${BUILD_AR}" RANLIB="${BUILD_RANLIB}" \
+-      PATH="${PATH}" \
+-      tools_only=1 \
+-    ${confdir}/configure --build=${build} --host=${build} \
+-                         --disable-rpath --disable-nls
+-  cd .. || exit 1
+-  AC_MSG_NOTICE([[Continuing with main configure (${host}).]])
+-fi
++native_tools=
+ AC_SUBST(native_tools)
+ AM_CONDITIONAL(TOOLS_ONLY, [[test "x$tools_only" = x1]])
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch b/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch
new file mode 100644
index 0000000..2297051
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo-4.8/using-native-makeinfo.patch
@@ -0,0 +1,24 @@
+From 9b0df7d6d3c18cfac82c291d60a5357d1bc8d9d0 Mon Sep 17 00:00:00 2001
+From: "Roy.Li" <rongqing.li@windriver.com>
+Date: Wed, 10 Sep 2014 17:10:03 +0800
+Subject: [PATCH] using native makeinfo
+
+Upstream-Status: Pending
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ doc/Makefile.am                                |   2 +-
+
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index 63df818..b6ceb34 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -19,7 +19,7 @@ man_MANS = info.1 infokey.1 install-info.1 makeinfo.1 texindex.1 texi2dvi.1 \
+ 
+ # Use the programs built in our distribution, taking account of possible
+ # cross-compiling.
+-MAKEINFO = $(top_builddir)/$(native_tools)/makeinfo/makeinfo
++MAKEINFO = makeinfo
+ INSTALL_INFO = $(top_builddir)/$(native_tools)/util/install-info
+ 
+ TXI_XLATE = txi-cs.tex txi-de.tex txi-en.tex txi-es.tex txi-fr.tex \
diff --git a/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..c7338aa
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: texinfo-5.2/gnulib/lib/Makefile.am
+===================================================================
+--- texinfo-5.2.orig/gnulib/lib/Makefile.am
++++ texinfo-5.2/gnulib/lib/Makefile.am
+@@ -378,7 +378,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
diff --git a/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch b/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch
new file mode 100644
index 0000000..ab6f165
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo/disable-native-tools.patch
@@ -0,0 +1,43 @@
+We already DEPEND on the native texinfo being present before building so
+there isn't any need to try and build the required native texinfo binaries
+before cross-compiling. This simplifies the recipe somewhat!
+
+Upstream-Status: Inappropriate oe specific
+
+Signed-off-by: Joshua Lock <josh@linux.intel.com>
+
+Index: texinfo-4.13/configure.ac
+===================================================================
+--- texinfo-4.13.orig/configure.ac
++++ texinfo-4.13/configure.ac
+@@ -100,29 +100,7 @@ AC_CANONICAL_BUILD
+ # $native_tools is also added to SUBDIRS in the main Makefile.am,
+ # so that make compiles the native tools first.
+ #
+-if test "$cross_compiling" = no; then
+-  native_tools=
+-else
+-  native_tools=tools
+-  test -d "$native_tools" || mkdir "$native_tools"
+-  confdir=`(cd "$srcdir";pwd)`
+-  # Make sure the secondary configure won't fail with
+-  # "error: source directory already configured".
+-  rm -f config.status
+-  AC_MSG_NOTICE([[Doing configure of native tools (${build}).]])
+-  cd "$native_tools" || exit 1
+-  # Run secondary configure in alternate environment or
+-  # it gets the wrong CC etc.
+-  # env -i gives this build host configure a clean environment;
+-  # consequently, we have to re-initialize $PATH.
+-  env -i CC="$BUILD_CC" AR="$BUILD_AR" RANLIB="$BUILD_RANLIB" \
+-      PATH="$PATH" \
+-      tools_only=1 \
+-    ${confdir}/configure --build=${build} --host=${build} \
+-                         --disable-rpath --disable-nls
+-  cd .. || exit 1
+-  AC_MSG_NOTICE([[Continuing with main configure (${host}).]])
+-fi
++native_tools=
+ AC_SUBST(native_tools)
+ AM_CONDITIONAL(TOOLS_ONLY, [[test "x$tools_only" = x1]])
+ 
diff --git a/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch b/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
new file mode 100644
index 0000000..0ce47ec
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo/dont-depend-on-help2man.patch
@@ -0,0 +1,64 @@
+From 6f1f3912fcb900b3a3e6cbe3360306fade333497 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 6 Aug 2015 14:55:08 +0300
+Subject: [PATCH] dont-depend-on-help2man
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+---
+ doc/Makefile.am |  2 +-
+ man/Makefile.am | 12 ++++++------
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/doc/Makefile.am b/doc/Makefile.am
+index 7198a6b..4bba550 100644
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -40,7 +40,7 @@ refcard_files = refcard/Makefile refcard/txicmdcheck \
+ # Include our texinfo.tex, not Automake's.
+ EXTRA_DIST = epsf.tex texinfo.tex \
+              fdl.texi \
+-	     $(man_MANS) $(TXI_XLATE) \
++	     $(TXI_XLATE) \
+ 	     $(refcard_files)
+ 
+ if INSTALL_WARNINGS
+diff --git a/man/Makefile.am b/man/Makefile.am
+index a08d603..bdfc9a4 100644
+--- a/man/Makefile.am
++++ b/man/Makefile.am
+@@ -13,24 +13,24 @@
+ # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ 
+ # These are generated using help2man.
+-man_MANS = install-info.1 makeinfo.1 texindex.1 texi2dvi.1
++#man_MANS = install-info.1 makeinfo.1 texindex.1 texi2dvi.1
+ 
+ # These require the build in info/, thus can't do if we failed to find a
+ # terminal library.
+ if HAVE_TERMLIBS
+-man_MANS += info.1
++#man_MANS += info.1
+ endif
+ 
+ # These are hand-written.
+-man_MANS += info.5 texinfo.5
++#man_MANS += info.5 texinfo.5
+ 
+ # This is generated by pod2man, but let's just run it by hand.
+-man_MANS += pod2texi.1
++#man_MANS += pod2texi.1
+ 
+ # These are just .so's to the common program.
+-man_MANS += texi2any.1 texi2pdf.1 pdftexi2dvi.1
++#man_MANS += texi2any.1 texi2pdf.1 pdftexi2dvi.1
+ 
+-EXTRA_DIST = $(man_MANS) ginfo.h2m
++EXTRA_DIST = ginfo.h2m
+ 
+ # Maintainers should be able to regenerate.
+ MAINTAINERCLEANFILES = $(man_MANS)
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/texinfo/texinfo/link-zip.patch b/meta/recipes-extended/texinfo/texinfo/link-zip.patch
new file mode 100644
index 0000000..0b6e9fd
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo/link-zip.patch
@@ -0,0 +1,16 @@
+install-info uses symbols from zlib so must link against it.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joshua Lock <josh@linux.intel.com>
+
+Index: texinfo-5.1/install-info/Makefile.am
+===================================================================
+--- texinfo-5.1.orig/install-info/Makefile.am
++++ texinfo-5.1/install-info/Makefile.am
+@@ -34,4 +34,4 @@ AM_CPPFLAGS = 					\
+   -I$(top_srcdir)/gnulib/lib			\
+   -I$(top_builddir)/gnulib/lib			\
+   -DLOCALEDIR=\"$(localedir)\"
+-LDADD = $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL)
++LDADD = $(top_builddir)/gnulib/lib/libgnu.a $(LIBINTL) -lz
diff --git a/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch b/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
new file mode 100644
index 0000000..41bd220
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo/texinfo-4.12-zlib.patch
@@ -0,0 +1,233 @@
+From 20e1d8a9481dc13dd1d4d168b90e0ed2ff097b98 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Thu, 6 Aug 2015 14:29:57 +0300
+Subject: [PATCH] texinfo-4.12-zlib
+
+Upstream-Status: Pending
+---
+ install-info/Makefile.in    |  2 +-
+ install-info/install-info.c | 67 +++++++++++++++++++++++++++------------------
+ 2 files changed, 42 insertions(+), 27 deletions(-)
+
+diff --git a/install-info/Makefile.in b/install-info/Makefile.in
+index ad73abb..eaa2153 100644
+--- a/install-info/Makefile.in
++++ b/install-info/Makefile.in
+@@ -241,7 +241,7 @@ am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
+ PROGRAMS = $(bin_PROGRAMS)
+ am_ginstall_info_OBJECTS = install-info.$(OBJEXT)
+ ginstall_info_OBJECTS = $(am_ginstall_info_OBJECTS)
+-ginstall_info_LDADD = $(LDADD)
++ginstall_info_LDADD = $(LDADD) -lz
+ am__DEPENDENCIES_1 =
+ ginstall_info_DEPENDENCIES = $(top_builddir)/gnulib/lib/libgnu.a \
+ 	$(am__DEPENDENCIES_1)
+diff --git a/install-info/install-info.c b/install-info/install-info.c
+index b454c15..4e39122 100644
+--- a/install-info/install-info.c
++++ b/install-info/install-info.c
+@@ -22,6 +22,7 @@
+ #include <getopt.h>
+ #include <regex.h>
+ #include <argz.h>
++#include <zlib.h>
+ 
+ #define TAB_WIDTH 8
+ 
+@@ -684,15 +685,15 @@ The first time you invoke Info you start off looking at this node.\n\
+    
+    Return either stdin reading the file, or a non-stdin pipe reading
+    the output of the compression program.  */
+-FILE *
++void *
+ open_possibly_compressed_file (char *filename,
+     void (*create_callback) (char *),
+-    char **opened_filename, char **compression_program) 
++    char **opened_filename, char **compression_program, int *is_pipe) 
+ {
+   char *local_opened_filename, *local_compression_program;
+   int nread;
+   char data[13];
+-  FILE *f;
++  gzFile *f;
+ 
+   /* We let them pass NULL if they don't want this info, but it's easier
+      to always determine it.  */
+@@ -700,48 +701,48 @@ open_possibly_compressed_file (char *filename,
+     opened_filename = &local_opened_filename;
+ 
+   *opened_filename = filename;
+-  f = fopen (*opened_filename, FOPEN_RBIN);
++  f = gzopen (*opened_filename, FOPEN_RBIN);
+   if (!f)
+     {
+       *opened_filename = concat (filename, ".gz", "");
+-      f = fopen (*opened_filename, FOPEN_RBIN);
++      f = gzopen (*opened_filename, FOPEN_RBIN);
+     }
+   if (!f)
+     {
+       free (*opened_filename);
+       *opened_filename = concat (filename, ".xz", "");
+-      f = fopen (*opened_filename, FOPEN_RBIN);
++      f = gzopen (*opened_filename, FOPEN_RBIN);
+     }
+   if (!f)
+     {
+       free (*opened_filename);
+       *opened_filename = concat (filename, ".bz2", "");
+-      f = fopen (*opened_filename, FOPEN_RBIN);
++      f = gzopen (*opened_filename, FOPEN_RBIN);
+     }
+   if (!f)
+     {
+       free (*opened_filename);
+       *opened_filename = concat (filename, ".lz", "");
+-      f = fopen (*opened_filename, FOPEN_RBIN);
++      f = gzopen (*opened_filename, FOPEN_RBIN);
+     }
+   if (!f)
+     {
+      free (*opened_filename);
+      *opened_filename = concat (filename, ".lzma", "");
+-     f = fopen (*opened_filename, FOPEN_RBIN);
++     f = gzopen (*opened_filename, FOPEN_RBIN);
+     }
+ #ifdef __MSDOS__
+   if (!f)
+     {
+       free (*opened_filename);
+       *opened_filename = concat (filename, ".igz", "");
+-      f = fopen (*opened_filename, FOPEN_RBIN);
++      f = gzopen (*opened_filename, FOPEN_RBIN);
+     }
+   if (!f)
+     {
+       free (*opened_filename);
+       *opened_filename = concat (filename, ".inz", "");
+-      f = fopen (*opened_filename, FOPEN_RBIN);
++      f = gzopen (*opened_filename, FOPEN_RBIN);
+     }
+ #endif /* __MSDOS__ */
+   if (!f)
+@@ -757,7 +758,7 @@ open_possibly_compressed_file (char *filename,
+           (*create_callback) (filename);
+ 
+           /* And try opening it again.  */
+-          f = fopen (*opened_filename, FOPEN_RBIN);
++          f = gzopen (*opened_filename, FOPEN_RBIN);
+           if (!f)
+             return 0;
+         }
+@@ -767,12 +768,12 @@ open_possibly_compressed_file (char *filename,
+ 
+   /* Read first few bytes of file rather than relying on the filename.
+      If the file is shorter than this it can't be usable anyway.  */
+-  nread = fread (data, sizeof (data), 1, f);
+-  if (nread != 1)
++  nread = gzread (f, data, sizeof (data));
++  if (nread != sizeof (data))
+     {
+       /* Empty files don't set errno.  Calling code can check for
+          this, so make sure errno == 0 just in case it isn't already. */
+-      if (nread == 0)
++      if (nread >= 0)
+         errno = 0;
+       return 0;
+     }
+@@ -838,35 +839,40 @@ open_possibly_compressed_file (char *filename,
+     *compression_program = NULL;
+ 
+   /* Seek back over the magic bytes.  */
+-  if (fseek (f, 0, 0) < 0)
++  if (gzseek (f, 0, SEEK_SET) == -1)
+     return 0;
+ 
+   if (*compression_program)
+     { /* It's compressed, so open a pipe.  */
++      FILE *p;
+       char *command = concat (*compression_program, " -d", "");
+ 
+-      if (fclose (f) < 0)
++      if (gzclose (f) < 0)
+         return 0;
+-      f = freopen (*opened_filename, FOPEN_RBIN, stdin);
+-      if (!f)
++      p = freopen (*opened_filename, FOPEN_RBIN, stdin);
++      if (!p)
+         return 0;
+-      f = popen (command, "r");
+-      if (!f)
++      p = popen (command, "r");
++      if (!p)
+         {
+           /* Used for error message in calling code. */
+           *opened_filename = command;
+           return 0;
+         }
++      else
++        *is_pipe = 1;
++      return p;
+     }
+   else
+     {
+-#if O_BINARY
++#if 0 && O_BINARY
+       /* Since this is a text file, and we opened it in binary mode,
+          switch back to text mode.  */
+       f = freopen (*opened_filename, "r", f);
+       if (! f)
+ 	return 0;
+ #endif
++      *is_pipe = 0;
+     }
+ 
+   return f;
+@@ -885,7 +891,8 @@ readfile (char *filename, int *sizep,
+     void (*create_callback) (char *), char **opened_filename,
+     char **compression_program)
+ {
+-  FILE *f;
++  void *f;
++  int pipe_p;
+   int filled = 0;
+   int data_size = 8192;
+   char *data = xmalloc (data_size);
+@@ -893,14 +900,20 @@ readfile (char *filename, int *sizep,
+   /* If they passed the space for the file name to return, use it.  */
+   f = open_possibly_compressed_file (filename, create_callback,
+                                      opened_filename,
+-                                     compression_program);
++                                     compression_program,
++                                     &pipe_p);
+ 
+   if (!f)
+     return 0;
+ 
+   for (;;)
+     {
+-      int nread = fread (data + filled, 1, data_size - filled, f);
++      int nread;
++
++      if (pipe_p)
++        nread = fread (data + filled, 1, data_size - filled, f);
++      else
++        nread = gzread (f, data + filled, data_size - filled);
+       if (nread < 0)
+         return 0;
+       if (nread == 0)
+@@ -919,8 +932,10 @@ readfile (char *filename, int *sizep,
+   /* We need to close the stream, since on some systems the pipe created
+      by popen is simulated by a temporary file which only gets removed
+      inside pclose.  */
+-  if (f != stdin)
++  if (pipe_p)
+     pclose (f);
++  else
++    gzclose (f);
+ 
+   *sizep = filled;
+   return data;
+-- 
+2.1.4
+
diff --git a/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch b/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch
new file mode 100644
index 0000000..5b7f32d
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo/use_host_makedoc.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [cross build specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: texinfo-5.1/info/Makefile.am
+===================================================================
+--- texinfo-5.1.orig/info/Makefile.am
++++ texinfo-5.1/info/Makefile.am
+@@ -76,7 +76,7 @@ cmd_sources = $(srcdir)/session.c $(srcd
+ # more than once.
+ funs.h: makedoc$(EXEEXT) $(cmd_sources)
+ 	rm -f $(generated_sources)
+-	$(top_builddir)/$(native_tools)/info/makedoc $(cmd_sources)
++	makedoc $(cmd_sources)
+ 
+ # The following hack is necessary to hint make before the automatic
+ # dependencies are built.
diff --git a/meta/recipes-extended/texinfo/texinfo_4.8.bb b/meta/recipes-extended/texinfo/texinfo_4.8.bb
new file mode 100644
index 0000000..13678e0
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo_4.8.bb
@@ -0,0 +1,55 @@
+SUMMARY = "Documentation system for on-line information and printed output"
+DESCRIPTION = "Texinfo is a documentation system that can produce both \
+online information and printed output from a single source file. The \
+GNU Project uses the Texinfo file format for most of its documentation."
+HOMEPAGE = "http://www.gnu.org/software/texinfo/"
+SECTION = "console/utils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+PROVIDES_append_class-native = " texinfo-4.8-replacement-native"
+
+DEPENDS = "zlib ncurses texinfo-4.8-replacement-native"
+DEPENDS_class-native = "zlib-native ncurses-native"
+
+TARGET_PATCH = "file://use_host_makedoc.patch \
+           file://using-native-makeinfo.patch \
+"
+TARGET_PATCH_class-native = ""
+
+SRC_URI = "${GNU_MIRROR}/texinfo/${BP}.tar.gz \
+           file://check-locale-h.patch \
+           file://do-compile-native-tools.patch \
+           ${TARGET_PATCH} \
+          "
+
+SRC_URI[md5sum] = "4e9a1a591ed236003d0d4b008bf07eef"
+SRC_URI[sha256sum] = "1f3cdeebe65fdf510f55d765ab1031b54416aa5bc2635b6a54ef9bcb2367c917"
+
+tex_texinfo = "texmf/tex/texinfo"
+
+inherit gettext autotools
+
+do_install_append() {
+	mkdir -p ${D}${datadir}/${tex_texinfo}
+	install -p -m644 ${S}/doc/texinfo.tex ${S}/doc/txi-??.tex ${D}${datadir}/${tex_texinfo}
+}
+
+do_install_append_class-native() {
+	install -m 755 info/makedoc ${D}${bindir}
+	install -m 755 makeinfo/makeinfo ${D}${bindir}
+}
+
+PACKAGES += "info info-doc"
+
+FILES_info = "${bindir}/info ${bindir}/infokey ${bindir}/install-info"
+FILES_info-doc = "${infodir}/info.info ${infodir}/dir ${infodir}/info-*.info \
+                  ${mandir}/man1/info.1* ${mandir}/man5/info.5* \
+                  ${mandir}/man1/infokey.1* ${mandir}/man1/install-info.1*"
+
+FILES_${PN} = "${bindir}/makeinfo ${bindir}/texi* ${bindir}/pdftexi2dvi ${bindir}/pod2texi ${datadir}/texinfo"
+FILES_${PN}-doc = "${infodir}/texinfo* \
+                   ${datadir}/${tex_texinfo} \
+                   ${mandir}/man1 ${mandir}/man5"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/texinfo/texinfo_6.0.bb b/meta/recipes-extended/texinfo/texinfo_6.0.bb
new file mode 100644
index 0000000..8fb715a
--- /dev/null
+++ b/meta/recipes-extended/texinfo/texinfo_6.0.bb
@@ -0,0 +1,82 @@
+SUMMARY = "Documentation system for on-line information and printed output"
+DESCRIPTION = "Texinfo is a documentation system that can produce both \
+online information and printed output from a single source file. The \
+GNU Project uses the Texinfo file format for most of its documentation."
+HOMEPAGE = "http://www.gnu.org/software/texinfo/"
+SECTION = "console/utils"
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+PROVIDES_append_class-native = " texinfo-replacement-native"
+
+def compress_pkg(d):
+    if "compress_doc" in (d.getVar("INHERIT", True) or "").split():
+         compress = d.getVar("DOC_COMPRESS", True)
+         if compress == "gz":
+             return "gzip"
+         elif compress == "bz2":
+             return "bzip2"
+         elif compress == "xz":
+             return "xz"
+    return ""
+
+RDEPENDS_info += "${@compress_pkg(d)}"
+
+DEPENDS = "zlib ncurses texinfo-replacement-native"
+DEPENDS_class-native = "zlib-native ncurses-native"
+
+TARGET_PATCH = "file://use_host_makedoc.patch"
+TARGET_PATCH_class-native = ""
+
+SRC_URI = "${GNU_MIRROR}/texinfo/${BP}.tar.gz \
+           file://texinfo-4.12-zlib.patch \
+           file://disable-native-tools.patch \
+           file://link-zip.patch \
+           file://dont-depend-on-help2man.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+           ${TARGET_PATCH} \
+          "
+
+SRC_URI[md5sum] = "e1a2ef5dce5018b53f0f6eed45b247a7"
+SRC_URI[sha256sum] = "83d3183290f34e7f958d209d0b20022c6fe9e921eb6fe94c27d988827d4878d2"
+
+tex_texinfo = "texmf/tex/texinfo"
+
+inherit gettext autotools
+
+do_configure_prepend () {
+	# autotools_do_configure updates po/Makefile.in.in, we also need
+	# update po_document.
+	cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po_document/
+}
+
+do_compile_prepend() {
+	if [ -d tools ];then
+		oe_runmake -C tools/gnulib/lib
+	fi
+}
+
+do_install_append() {
+	mkdir -p ${D}${datadir}/${tex_texinfo}
+	install -p -m644 ${S}/doc/texinfo.tex ${S}/doc/txi-??.tex ${D}${datadir}/${tex_texinfo}
+	sed -i -e '1s,#!.*perl,#! ${USRBINPATH}/env perl,' ${D}${bindir}/texi2any ${D}${bindir}/pod2texi
+}
+
+do_install_append_class-native() {
+	install -m 755 info/makedoc ${D}${bindir}
+}
+
+PACKAGES += "info info-doc"
+
+FILES_info = "${bindir}/info ${bindir}/infokey ${bindir}/install-info"
+FILES_info-doc = "${infodir}/info.info* ${infodir}/dir ${infodir}/info-*.info* \
+                  ${mandir}/man1/info.1* ${mandir}/man5/info.5* \
+                  ${mandir}/man1/infokey.1* ${mandir}/man1/install-info.1*"
+
+FILES_${PN} = "${bindir}/makeinfo ${bindir}/texi* ${bindir}/pdftexi2dvi ${bindir}/pod2texi ${datadir}/texinfo"
+RDEPENDS_${PN} = "perl"
+FILES_${PN}-doc = "${infodir}/texinfo* \
+                   ${datadir}/${tex_texinfo} \
+                   ${mandir}/man1 ${mandir}/man5"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/time/time-1.7/debian.patch b/meta/recipes-extended/time/time-1.7/debian.patch
new file mode 100644
index 0000000..23ea0e3
--- /dev/null
+++ b/meta/recipes-extended/time/time-1.7/debian.patch
@@ -0,0 +1,1301 @@
+Upstream-Status: Backport
+
+--- time-1.7.orig/configure.in
++++ time-1.7/configure.in
+@@ -1,11 +1,8 @@
+ dnl Process this file with autoconf to produce a configure script.
+ AC_INIT(time.c)
+-VERSION=1.7
+-AC_SUBST(VERSION)
+-PACKAGE=time
+-AC_SUBST(PACKAGE)
++AM_INIT_AUTOMAKE(time, 1.7)
+ 
+-AC_ARG_PROGRAM
++AM_MAINTAINER_MODE
+ 
+ dnl Checks for programs.
+ AC_PROG_CC
+@@ -15,7 +12,7 @@
+ dnl Checks for header files.
+ AC_HEADER_STDC
+ AC_HEADER_SYS_WAIT
+-AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h)
++AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h sys/resource.h)
+ 
+ dnl Checks for typedefs, structures, and compiler characteristics.
+ AC_C_CONST
+--- time-1.7.orig/version.texi
++++ time-1.7/version.texi
+@@ -1,3 +1,3 @@
+-@set UPDATED 12 June 1996
++@set UPDATED 9 May 2002
+ @set EDITION 1.7
+ @set VERSION 1.7
+--- time-1.7.orig/time.c
++++ time-1.7/time.c
+@@ -147,6 +147,10 @@
+   NULL
+ };
+ 
++
++/* If true, do not show the exit message */
++static boolean quiet;
++
+ /* If true, show an English description next to each statistic.  */
+ static boolean verbose;
+ 
+@@ -172,6 +176,7 @@
+   {"help", no_argument, NULL, 'h'},
+   {"output-file", required_argument, NULL, 'o'},
+   {"portability", no_argument, NULL, 'p'},
++  {"quiet", no_argument,NULL, 'q'},
+   {"verbose", no_argument, NULL, 'v'},
+   {"version", no_argument, NULL, 'V'},
+   {NULL, no_argument, NULL, 0}
+@@ -333,7 +338,8 @@
+   else if (WIFSIGNALED (resp->waitstatus))
+     fprintf (fp, "Command terminated by signal %d\n",
+ 	     WTERMSIG (resp->waitstatus));
+-  else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus))
++  else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus)
++	   && !quiet)
+     fprintf (fp, "Command exited with non-zero status %d\n",
+ 	     WEXITSTATUS (resp->waitstatus));
+ 
+@@ -523,6 +529,7 @@
+   char *format;			/* Format found in environment.  */
+ 
+   /* Initialize the option flags.  */
++  quiet = false;
+   verbose = false;
+   outfile = NULL;
+   outfp = stderr;
+@@ -536,7 +543,7 @@
+   if (format)
+     output_format = format;
+ 
+-  while ((optc = getopt_long (argc, argv, "+af:o:pvV", longopts, (int *) 0))
++  while ((optc = getopt_long (argc, argv, "+af:o:pqvV", longopts, (int *) 0))
+ 	 != EOF)
+     {
+       switch (optc)
+@@ -555,6 +562,9 @@
+ 	case 'p':
+ 	  output_format = posix_format;
+ 	  break;
++	case 'q':
++	  quiet = true;
++	  break;
+ 	case 'v':
+ 	  verbose = true;
+ 	  break;
+@@ -642,9 +652,9 @@
+   fflush (outfp);
+ 
+   if (WIFSTOPPED (res.waitstatus))
+-    exit (WSTOPSIG (res.waitstatus));
++    exit (WSTOPSIG (res.waitstatus) + 128);
+   else if (WIFSIGNALED (res.waitstatus))
+-    exit (WTERMSIG (res.waitstatus));
++    exit (WTERMSIG (res.waitstatus) + 128);
+   else if (WIFEXITED (res.waitstatus))
+     exit (WEXITSTATUS (res.waitstatus));
+ }
+@@ -657,7 +667,7 @@
+   fprintf (stream, "\
+ Usage: %s [-apvV] [-f format] [-o file] [--append] [--verbose]\n\
+        [--portability] [--format=format] [--output=file] [--version]\n\
+-       [--help] command [arg...]\n",
++       [--quiet] [--help] command [arg...]\n",
+ 	   program_name);
+   exit (status);
+ }
+--- time-1.7.orig/resuse.h
++++ time-1.7/resuse.h
+@@ -36,19 +36,8 @@
+ # include <sys/rusage.h>
+ #else
+ # define TV_MSEC tv_usec / 1000
+-# if HAVE_WAIT3
++# if HAVE_SYS_RESOURCE_H
+ #  include <sys/resource.h>
+-# else
+-/* Process resource usage structure.  */
+-struct rusage
+-{
+-  struct timeval ru_utime;	/* User time used.  */
+-  struct timeval ru_stime;	/* System time used.  */
+-  int ru_maxrss, ru_ixrss, ru_idrss, ru_isrss,
+-  ru_minflt, ru_majflt, ru_nswap, ru_inblock, 
+-  ru_oublock, ru_msgsnd, ru_msgrcv, ru_nsignals,
+-  ru_nvcsw, ru_nivcsw;
+-};
+ # endif
+ #endif
+ 
+--- time-1.7.orig/time.texi
++++ time-1.7/time.texi
+@@ -11,6 +11,12 @@
+ @finalout
+ @end iftex
+ 
++@dircategory Individual utilities
++@direntry
++* time: (time).                     Run programs and summarize
++                                    system resource usage.
++@end direntry
++
+ @ifinfo
+ This file documents the the GNU @code{time} command for running programs
+ and summarizing the system resources they use.
+@@ -185,6 +191,10 @@
+ sys %S
+ @end example
+ 
++@item -q
++@itemx --quiet
++Suppress non-zero error code from the executed program.
++
+ @item -v
+ @itemx --verbose
+ @cindex format
+--- time-1.7.orig/time.info
++++ time-1.7/time.info
+@@ -1,5 +1,10 @@
+-This is Info file ./time.info, produced by Makeinfo-1.55 from the input
+-file time.texi.
++This is time.info, produced by makeinfo version 4.1 from time.texi.
++
++INFO-DIR-SECTION Individual utilities
++START-INFO-DIR-ENTRY
++* time: (time).                     Run programs and summarize
++                                    system resource usage.
++END-INFO-DIR-ENTRY
+ 
+    This file documents the the GNU `time' command for running programs
+ and summarizing the system resources they use.
+@@ -31,7 +36,7 @@
+ 
+ * Resource Measurement::  Measuring program resource use.
+ 
+- -- The Detailed Node Listing --
++ --- The Detailed Node Listing ---
+ 
+ Measuring Program Resource Use
+ 
+@@ -58,14 +63,14 @@
+    The `time' command runs another program, then displays information
+ about the resources used by that program, collected by the system while
+ the program was running.  You can select which information is reported
+-and the format in which it is shown (*note Setting Format::.), or have
++and the format in which it is shown (*note Setting Format::), or have
+ `time' save the information in a file instead of displaying it on the
+-screen (*note Redirecting::.).
++screen (*note Redirecting::).
+ 
+    The resources that `time' can report on fall into the general
+ categories of time, memory, and I/O and IPC calls.  Some systems do not
+ provide much information about program resource use; `time' reports
+-unavailable information as zero values (*note Accuracy::.).
++unavailable information as zero values (*note Accuracy::).
+ 
+    The format of the `time' command is:
+ 
+@@ -132,6 +137,10 @@
+           user %U
+           sys %S
+ 
++`-q'
++`--quiet'
++     Suppress non-zero error code from the executed program.
++
+ `-v'
+ `--verbose'
+      Use the built-in verbose format, which displays each available
+@@ -174,7 +183,7 @@
+    The resource specifiers, which are a superset of those recognized by
+ the `tcsh' builtin `time' command, are listed below.  Not all resources
+ are measured by all versions of Unix, so some of the values might be
+-reported as zero (*note Accuracy::.).
++reported as zero (*note Accuracy::).
+ 
+ * Menu:
+ 
+@@ -308,11 +317,11 @@
+ `-o FILE'
+ `--output=FILE'
+      Write the resource use statistics to FILE.  By default, this
+-     *overwrites* the file, destroying the file's previous contents.
++     _overwrites_ the file, destroying the file's previous contents.
+ 
+ `-a'
+ `--append'
+-     *Append* the resource use information to the output file instead
++     _Append_ the resource use information to the output file instead
+      of overwriting it.  This option is only useful with the `-o' or
+      `--output' option.
+ 
+@@ -437,7 +446,7 @@
+ 
+ `-a'
+ `--append'
+-     *Append* the resource use information to the output file instead
++     _Append_ the resource use information to the output file instead
+      of overwriting it.
+ 
+ `-f FORMAT'
+@@ -462,17 +471,17 @@
+ 
+ 
+ Tag Table:
+-Node: Top934
+-Node: Resource Measurement1725
+-Node: Setting Format3678
+-Node: Format String4907
+-Node: Time Resources6214
+-Node: Memory Resources6844
+-Node: I/O Resources7549
+-Node: Command Info8747
+-Node: Redirecting8964
+-Node: Examples9754
+-Node: Accuracy12064
+-Node: Invoking time13586
++Node: Top1115
++Node: Resource Measurement1908
++Node: Setting Format3858
++Node: Format String5164
++Node: Time Resources6470
++Node: Memory Resources7100
++Node: I/O Resources7805
++Node: Command Info9003
++Node: Redirecting9220
++Node: Examples10010
++Node: Accuracy12320
++Node: Invoking time13842
+ 
+ End Tag Table
+--- time-1.7.orig/time.html
++++ time-1.7/time.html
+@@ -0,0 +1,1021 @@
++<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
++                      "http://www.w3.org/TR/html40/loose.dtd">
++<HTML>
++<!-- Created on September, 1 2003 by texi2html 1.66 -->
++<!--
++Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
++            Karl Berry  <karl@freefriends.org>
++            Olaf Bachmann <obachman@mathematik.uni-kl.de>
++            and many others.
++Maintained by: Many creative people <dev@texi2html.cvshome.org>
++Send bugs and suggestions to <users@texi2html.cvshome.org>
++
++-->
++<HEAD>
++<TITLE>Measuring Program Resource Use</TITLE>
++
++<META NAME="description" CONTENT="Measuring Program Resource Use">
++<META NAME="keywords" CONTENT="Measuring Program Resource Use">
++<META NAME="resource-type" CONTENT="document">
++<META NAME="distribution" CONTENT="global">
++<META NAME="Generator" CONTENT="texi2html 1.66">
++
++</HEAD>
++
++<BODY LANG="en" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
++
++<A NAME="SEC_Top"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>Measuring Program Resource Use</H1>
++
++<P>
++
++This file documents the the GNU <CODE>time</CODE> command for running programs
++and summarizing the system resources they use.
++This is edition 1.7, for version 1.7.
++</P>
++<P>
++
++</P>
++<TABLE BORDER="0" CELLSPACING="0">
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC1">1. Measuring Program Resource Use</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Measuring program resource use.</TD></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP"> -- The Detailed Node Listing ---
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">Measuring Program Resource Use
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC2">1.1 Setting the Output Format</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Selecting the information reported by <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC3">1.2 The Format String</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The information <CODE>time</CODE> can report.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC8">1.3 Redirecting Output</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Writing the information to a file.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC9">1.4 Examples</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Examples of using <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC10">1.5 Accuracy</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Limitations on the accuracy of <CODE>time</CODE> output.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Summary of the options to the <CODE>time</CODE> command.</TD></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">The Format String
++</TH></TR>
++<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
++</TH></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC4">1.2.1 Time Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC5">1.2.2 Memory Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC6">1.2.3 I/O Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC7">1.2.4 Command Info</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++</TABLE>
++<P>
++
++<HR SIZE=1>
++<A NAME="SEC1"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC2"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<A NAME="Resource Measurement"></A>
++<H1> 1. Measuring Program Resource Use </H1>
++<!--docid::SEC1::-->
++<P>
++
++The <CODE>time</CODE> command runs another program, then displays information
++about the resources used by that program, collected by the system while
++the program was running.  You can select which information is reported
++and the format in which it is shown (see section <A HREF="time.html#SEC2">1.1 Setting the Output Format</A>), or have
++<CODE>time</CODE> save the information in a file instead of displaying it on the
++screen (see section <A HREF="time.html#SEC8">1.3 Redirecting Output</A>).
++</P>
++<P>
++
++The resources that <CODE>time</CODE> can report on fall into the general
++categories of time, memory, and I/O and IPC calls.  Some systems do not
++provide much information about program resource use; <CODE>time</CODE>
++reports unavailable information as zero values (see section <A HREF="time.html#SEC10">1.5 Accuracy</A>).
++</P>
++<P>
++
++The format of the <CODE>time</CODE> command is:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>time [option<small>...</small>] <VAR>command</VAR> [<VAR>arg</VAR><small>...</small>]
++</pre></td></tr></table><P>
++
++<A NAME="IDX1"></A>
++<CODE>time</CODE> runs the program <VAR>command</VAR>, with any given arguments
++<VAR>arg</VAR><small>...</small>.  When <VAR>command</VAR> finishes, <CODE>time</CODE> displays
++information about resources used by <VAR>command</VAR>.
++</P>
++<P>
++
++Here is an example of using <CODE>time</CODE> to measure the time and other
++resources used by running the program <CODE>grep</CODE>:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time grep nobody /etc/aliases
++nobody:/dev/null
++etc-files:nobody
++misc-group:nobody
++0.07user 0.50system 0:06.69elapsed 8%CPU (0avgtext+489avgdata 324maxresident)k
++46inputs+7outputs (43major+251minor)pagefaults 0swaps
++</pre></td></tr></table><P>
++
++Mail suggestions and bug reports for GNU <CODE>time</CODE> to
++<CODE>bug-gnu-utils@prep.ai.mit.edu</CODE>.  Please include the version of
++<CODE>time</CODE>, which you can get by running `<SAMP>time --version</SAMP>', and the
++operating system and C compiler you used.
++</P>
++<P>
++
++<TABLE BORDER="0" CELLSPACING="0">
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC2">1.1 Setting the Output Format</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Selecting the information reported by <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC3">1.2 The Format String</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The information <CODE>time</CODE> can report.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC8">1.3 Redirecting Output</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Writing the information to a file.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC9">1.4 Examples</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Examples of using <CODE>time</CODE>.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC10">1.5 Accuracy</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Limitations on the accuracy of <CODE>time</CODE> output.</TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Summary of the options to the <CODE>time</CODE> command.</TD></TR>
++</TABLE>
++<P>
++
++<A NAME="Setting Format"></A>
++<HR SIZE="6">
++<A NAME="SEC2"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC3"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.1 Setting the Output Format </H2>
++<!--docid::SEC2::-->
++<P>
++
++<CODE>time</CODE> uses a <EM>format string</EM> to determine which information to
++display about the resources used by the command it runs.  See section <A HREF="time.html#SEC3">1.2 The Format String</A>, for the interpretation of the format string contents.
++</P>
++<P>
++
++You can specify a format string with the command line options listed
++below.  If no format is specified on the command line, but the
++<CODE>TIME</CODE> environment variable is set, its value is used as the format
++string.  Otherwise, the default format built into <CODE>time</CODE> is used:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>%Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
++%Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps
++</pre></td></tr></table><P>
++
++The command line options to set the format are:
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>-f <VAR>format</VAR></CODE>
++<DD><DT><CODE>--format=<VAR>format</VAR></CODE>
++<DD>Use <VAR>format</VAR> as the format string.
++<P>
++
++</P>
++<DT><CODE>-p</CODE>
++<DD><DT><CODE>--portability</CODE>
++<DD>Use the following format string, for conformance with POSIX standard
++1003.2:
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>real %e
++user %U
++sys %S
++</pre></td></tr></table><P>
++
++</P>
++<DT><CODE>-q</CODE>
++<DD><DT><CODE>--quiet</CODE>
++<DD>Suppress non-zero error code from the executed program.
++<P>
++
++</P>
++<DT><CODE>-v</CODE>
++<DD><DT><CODE>--verbose</CODE>
++<DD><A NAME="IDX2"></A>
++Use the built-in verbose format, which displays each available piece of
++information on the program's resource use on its own line, with an
++English description of its meaning.
++</DL>
++<P>
++
++<A NAME="Format String"></A>
++<HR SIZE="6">
++<A NAME="SEC3"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC2"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC4"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.2 The Format String </H2>
++<!--docid::SEC3::-->
++<P>
++
++<A NAME="IDX3"></A>
++<A NAME="IDX4"></A>
++The <EM>format string</EM> controls the contents of the <CODE>time</CODE> output.
++It consists of <EM>resource specifiers</EM> and <EM>escapes</EM>, interspersed
++with plain text.
++</P>
++<P>
++
++A backslash introduces an <EM>escape</EM>, which is translated
++into a single printing character upon output.  The valid escapes are
++listed below.  An invalid escape is output as a question mark followed
++by a backslash.
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>\t</CODE>
++<DD>a tab character
++<P>
++
++</P>
++<DT><CODE>\n</CODE>
++<DD>a newline
++<P>
++
++</P>
++<DT><CODE>\\</CODE>
++<DD>a literal backslash
++</DL>
++<P>
++
++<CODE>time</CODE> always prints a newline after printing the resource use
++information, so normally format strings do not end with a newline
++character (or `<SAMP>\n</SAMP>').
++</P>
++<P>
++
++A resource specifier consists of a percent sign followed by another
++character.  An invalid resource specifier is output as a question mark
++followed by the invalid character.  Use `<SAMP>%%</SAMP>' to output a literal
++percent sign.
++</P>
++<P>
++
++The resource specifiers, which are a superset of those recognized by the
++<CODE>tcsh</CODE> builtin <CODE>time</CODE> command, are listed below.  Not all
++resources are measured by all versions of Unix, so some of the values
++might be reported as zero (see section <A HREF="time.html#SEC10">1.5 Accuracy</A>).
++</P>
++<P>
++
++<TABLE BORDER="0" CELLSPACING="0">
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC4">1.2.1 Time Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC5">1.2.2 Memory Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC6">1.2.3 I/O Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC7">1.2.4 Command Info</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
++</TABLE>
++<P>
++
++<A NAME="Time Resources"></A>
++<HR SIZE="6">
++<A NAME="SEC4"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC3"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC5"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.1 Time Resources </H3>
++<!--docid::SEC4::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>E</CODE>
++<DD>Elapsed real (wall clock) time used by the process, in
++[hours:]minutes:seconds.
++<P>
++
++</P>
++<DT><CODE>e</CODE>
++<DD>Elapsed real (wall clock) time used by the process, in
++seconds.
++<P>
++
++</P>
++<DT><CODE>S</CODE>
++<DD>Total number of CPU-seconds used by the system on behalf of the process
++(in kernel mode), in seconds.
++<P>
++
++</P>
++<DT><CODE>U</CODE>
++<DD>Total number of CPU-seconds that the process used directly (in user
++mode), in seconds.
++<P>
++
++</P>
++<DT><CODE>P</CODE>
++<DD>Percentage of the CPU that this job got.  This is just user + system
++times divied by the total running time.
++</DL>
++<P>
++
++<A NAME="Memory Resources"></A>
++<HR SIZE="6">
++<A NAME="SEC5"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC4"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC6"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.2 Memory Resources </H3>
++<!--docid::SEC5::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>M</CODE>
++<DD>Maximum resident set size of the process during its lifetime, in
++Kilobytes.
++<P>
++
++</P>
++<DT><CODE>t</CODE>
++<DD>Average resident set size of the process, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>K</CODE>
++<DD>Average total (data+stack+text) memory use of the process, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>D</CODE>
++<DD>Average size of the process's unshared data area, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>p</CODE>
++<DD>Average size of the process's unshared stack, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>X</CODE>
++<DD>Average size of the process's shared text, in Kilobytes.
++<P>
++
++</P>
++<DT><CODE>Z</CODE>
++<DD>System's page size, in bytes.  This is a per-system constant, but
++varies between systems.
++</DL>
++<P>
++
++<A NAME="I/O Resources"></A>
++<HR SIZE="6">
++<A NAME="SEC6"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC5"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC7"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.3 I/O Resources </H3>
++<!--docid::SEC6::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>F</CODE>
++<DD>Number of major, or I/O-requiring, page faults that occurred while the
++process was running.  These are faults where the page has actually
++migrated out of primary memory.
++<P>
++
++</P>
++<DT><CODE>R</CODE>
++<DD>Number of minor, or recoverable, page faults.  These are pages that are
++not valid (so they fault) but which have not yet been claimed by other
++virtual pages.  Thus the data in the page is still valid but the system
++tables must be updated.
++<P>
++
++</P>
++<DT><CODE>W</CODE>
++<DD>Number of times the process was swapped out of main memory.
++<P>
++
++</P>
++<DT><CODE>c</CODE>
++<DD>Number of times the process was context-switched involuntarily (because
++the time slice expired).
++<P>
++
++</P>
++<DT><CODE>w</CODE>
++<DD>Number of times that the program was context-switched voluntarily, for
++instance while waiting for an I/O operation to complete.
++<P>
++
++</P>
++<DT><CODE>I</CODE>
++<DD>Number of file system inputs by the process.
++<P>
++
++</P>
++<DT><CODE>O</CODE>
++<DD>Number of file system outputs by the process.
++<P>
++
++</P>
++<DT><CODE>r</CODE>
++<DD>Number of socket messages received by the process.
++<P>
++
++</P>
++<DT><CODE>s</CODE>
++<DD>Number of socket messages sent by the process.
++<P>
++
++</P>
++<DT><CODE>k</CODE>
++<DD>Number of signals delivered to the process.
++</DL>
++<P>
++
++<A NAME="Command Info"></A>
++<HR SIZE="6">
++<A NAME="SEC7"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC6"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC8"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H3> 1.2.4 Command Info </H3>
++<!--docid::SEC7::-->
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>C</CODE>
++<DD>Name and command line arguments of the command being timed.
++<P>
++
++</P>
++<DT><CODE>x</CODE>
++<DD>Exit status of the command.
++</DL>
++<P>
++
++<A NAME="Redirecting"></A>
++<HR SIZE="6">
++<A NAME="SEC8"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC7"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC9"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.3 Redirecting Output </H2>
++<!--docid::SEC8::-->
++<P>
++
++By default, <CODE>time</CODE> writes the resource use statistics to the
++standard error stream.  The options below make it write the statistics
++to a file instead.  Doing this can be useful if the program you're
++running writes to the standard error or you're running <CODE>time</CODE>
++noninteractively or in the background.
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>-o <VAR>file</VAR></CODE>
++<DD><DT><CODE>--output=<VAR>file</VAR></CODE>
++<DD>Write the resource use statistics to <VAR>file</VAR>.  By default, this
++<EM>overwrites</EM> the file, destroying the file's previous contents.
++<P>
++
++</P>
++<DT><CODE>-a</CODE>
++<DD><DT><CODE>--append</CODE>
++<DD><EM>Append</EM> the resource use information to the output file instead
++of overwriting it.  This option is only useful with the `<SAMP>-o</SAMP>' or
++`<SAMP>--output</SAMP>' option.
++</DL>
++<P>
++
++<A NAME="Examples"></A>
++<HR SIZE="6">
++<A NAME="SEC9"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC8"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC10"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.4 Examples </H2>
++<!--docid::SEC9::-->
++<P>
++
++Run the command `<SAMP>wc /etc/hosts</SAMP>' and show the default information:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time wc /etc/hosts
++      35     111    1134 /etc/hosts
++0.00user 0.01system 0:00.04elapsed 25%CPU (0avgtext+0avgdata 0maxresident)k
++1inputs+1outputs (0major+0minor)pagefaults 0swaps
++</pre></td></tr></table><P>
++
++Run the command `<SAMP>ls -Fs</SAMP>' and show just the user, system, and
++wall-clock time:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time -f &quot;\t%E real,\t%U user,\t%S sys&quot; ls -Fs
++total 16
++1 account/      1 db/           1 mail/         1 run/
++1 backups/      1 emacs/        1 msgs/         1 rwho/
++1 crash/        1 games/        1 preserve/     1 spool/
++1 cron/         1 log/          1 quotas/       1 tmp/
++        0:00.03 real,   0.00 user,      0.01 sys
++</pre></td></tr></table><P>
++
++Edit the file `<TT>.bashrc</TT>' and have <CODE>time</CODE> append the elapsed time
++and number of signals to the file `<TT>log</TT>', reading the format string
++from the environment variable <CODE>TIME</CODE>:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ export TIME=&quot;\t%E,\t%k&quot; # If using bash or ksh
++eg$ setenv TIME &quot;\t%E,\t%k&quot; # If using csh or tcsh
++eg$ time -a -o log emacs .bashrc
++eg$ cat log
++        0:16.55,        726
++</pre></td></tr></table><P>
++
++Run the command `<SAMP>sleep 4</SAMP>' and show all of the information about it
++verbosely:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time -v sleep 4
++        Command being timed: &quot;sleep 4&quot;
++        User time (seconds): 0.00
++        System time (seconds): 0.05
++        Percent of CPU this job got: 1%
++        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.26
++        Average shared text size (kbytes): 36
++        Average unshared data size (kbytes): 24
++        Average stack size (kbytes): 0
++        Average total size (kbytes): 60
++        Maximum resident set size (kbytes): 32
++        Average resident set size (kbytes): 24
++        Major (requiring I/O) page faults: 3
++        Minor (reclaiming a frame) page faults: 0
++        Voluntary context switches: 11
++        Involuntary context switches: 0
++        Swaps: 0
++        File system inputs: 3
++        File system outputs: 1
++        Socket messages sent: 0
++        Socket messages received: 0
++        Signals delivered: 1
++        Page size (bytes): 4096
++        Exit status: 0
++</pre></td></tr></table><P>
++
++<A NAME="Accuracy"></A>
++<HR SIZE="6">
++<A NAME="SEC10"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC9"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC11"> &gt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.5 Accuracy </H2>
++<!--docid::SEC10::-->
++<P>
++
++The elapsed time is not collected atomically with the execution of the
++program; as a result, in bizarre circumstances (if the <CODE>time</CODE>
++command gets stopped or swapped out in between when the program being
++timed exits and when <CODE>time</CODE> calculates how long it took to run), it
++could be much larger than the actual execution time.
++</P>
++<P>
++
++When the running time of a command is very nearly zero, some values
++(e.g., the percentage of CPU used) may be reported as either zero (which
++is wrong) or a question mark.
++</P>
++<P>
++
++Most information shown by <CODE>time</CODE> is derived from the <CODE>wait3</CODE>
++system call.  The numbers are only as good as those returned by
++<CODE>wait3</CODE>.  Many systems do not measure all of the resources that
++<CODE>time</CODE> can report on; those resources are reported as zero.  The
++systems that measure most or all of the resources are based on 4.2 or
++4.3BSD.  Later BSD releases use different memory management code that
++measures fewer resources.
++</P>
++<P>
++
++On systems that do not have a <CODE>wait3</CODE> call that returns status
++information, the <CODE>times</CODE> system call is used instead.  It provides
++much less information than <CODE>wait3</CODE>, so on those systems <CODE>time</CODE>
++reports most of the resources as zero.
++</P>
++<P>
++
++The `<SAMP>%I</SAMP>' and `<SAMP>%O</SAMP>' values are allegedly only &quot;real&quot; input
++and output and do not include those supplied by caching devices.  The
++meaning of &quot;real&quot; I/O reported by `<SAMP>%I</SAMP>' and `<SAMP>%O</SAMP>' may be
++muddled for workstations, especially diskless ones.
++</P>
++<P>
++
++<A NAME="Invoking time"></A>
++<HR SIZE="6">
++<A NAME="SEC11"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC10"> &lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H2> 1.6 Running the <CODE>time</CODE> Command </H2>
++<!--docid::SEC11::-->
++<P>
++
++The format of the <CODE>time</CODE> command is:
++</P>
++<P>
++
++<TABLE><tr><td>&nbsp;</td><td class=example><pre>time [option<small>...</small>] <VAR>command</VAR> [<VAR>arg</VAR><small>...</small>]
++</pre></td></tr></table><P>
++
++<A NAME="IDX5"></A>
++<CODE>time</CODE> runs the program <VAR>command</VAR>, with any given arguments
++<VAR>arg</VAR><small>...</small>.  When <VAR>command</VAR> finishes, <CODE>time</CODE> displays
++information about resources used by <VAR>command</VAR> (on the standard error
++output, by default).  If <VAR>command</VAR> exits with non-zero status or is
++terminated by a signal, <CODE>time</CODE> displays a warning message and the
++exit status or signal number.
++</P>
++<P>
++
++Options to <CODE>time</CODE> must appear on the command line before
++<VAR>command</VAR>.  Anything on the command line after <VAR>command</VAR> is
++passed as arguments to <VAR>command</VAR>.
++</P>
++<P>
++
++</P>
++<DL COMPACT>
++<DT><CODE>-o <VAR>file</VAR></CODE>
++<DD><DT><CODE>--output=<VAR>file</VAR></CODE>
++<DD>Write the resource use statistics to <VAR>file</VAR>.
++<P>
++
++</P>
++<DT><CODE>-a</CODE>
++<DD><DT><CODE>--append</CODE>
++<DD><EM>Append</EM> the resource use information to the output file instead
++of overwriting it.
++<P>
++
++</P>
++<DT><CODE>-f <VAR>format</VAR></CODE>
++<DD><DT><CODE>--format=<VAR>format</VAR></CODE>
++<DD>Use <VAR>format</VAR> as the format string.
++<P>
++
++</P>
++<DT><CODE>--help</CODE>
++<DD>Print a summary of the command line options to <CODE>time</CODE> and exit.
++<P>
++
++</P>
++<DT><CODE>-p</CODE>
++<DD><DT><CODE>--portability</CODE>
++<DD>Use the POSIX format.
++<P>
++
++</P>
++<DT><CODE>-v</CODE>
++<DD><DT><CODE>--verbose</CODE>
++<DD><A NAME="IDX6"></A>
++Use the built-in verbose format.
++<P>
++
++</P>
++<DT><CODE>-V</CODE>
++<DD><DT><CODE>--version</CODE>
++<DD><A NAME="IDX7"></A>
++Print the version number of <CODE>time</CODE> and exit.
++</DL>
++<P>
++
++<HR SIZE="6">
++<A NAME="SEC_Contents"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>Table of Contents</H1>
++<BLOCKQUOTE>
++<A NAME="TOC1" HREF="time.html#SEC1">1. Measuring Program Resource Use</A>
++<BR>
++<BLOCKQUOTE>
++<A NAME="TOC2" HREF="time.html#SEC2">1.1 Setting the Output Format</A>
++<BR>
++<A NAME="TOC3" HREF="time.html#SEC3">1.2 The Format String</A>
++<BR>
++<BLOCKQUOTE>
++<A NAME="TOC4" HREF="time.html#SEC4">1.2.1 Time Resources</A>
++<BR>
++<A NAME="TOC5" HREF="time.html#SEC5">1.2.2 Memory Resources</A>
++<BR>
++<A NAME="TOC6" HREF="time.html#SEC6">1.2.3 I/O Resources</A>
++<BR>
++<A NAME="TOC7" HREF="time.html#SEC7">1.2.4 Command Info</A>
++<BR>
++</BLOCKQUOTE>
++<A NAME="TOC8" HREF="time.html#SEC8">1.3 Redirecting Output</A>
++<BR>
++<A NAME="TOC9" HREF="time.html#SEC9">1.4 Examples</A>
++<BR>
++<A NAME="TOC10" HREF="time.html#SEC10">1.5 Accuracy</A>
++<BR>
++<A NAME="TOC11" HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A>
++<BR>
++</BLOCKQUOTE>
++</BLOCKQUOTE>
++<HR SIZE=1>
++<A NAME="SEC_OVERVIEW"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>Short Table of Contents</H1>
++<BLOCKQUOTE>
++<A NAME="TOC1" HREF="time.html#SEC1">1. Measuring Program Resource Use</A>
++<BR>
++
++</BLOCKQUOTE>
++<HR SIZE=1>
++<A NAME="SEC_About"></A>
++<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
++<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
++<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
++</TR></TABLE>
++<H1>About this document</H1>
++This document was generated
++by 
++using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
++<P></P>
++The buttons in the navigation panels have the following meaning:
++<P></P>
++<table border = "1">
++<TR>
++<TH> Button </TH>
++<TH> Name </TH>
++<TH> Go to </TH>
++<TH> From 1.2.3 go to</TH>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &lt; ] </TD>
++<TD ALIGN="CENTER">
++Back
++</TD>
++<TD>
++previous section in reading order
++</TD>
++<TD>
++1.2.2
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &gt; ] </TD>
++<TD ALIGN="CENTER">
++Forward
++</TD>
++<TD>
++next section in reading order
++</TD>
++<TD>
++1.2.4
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &lt;&lt; ] </TD>
++<TD ALIGN="CENTER">
++FastBack
++</TD>
++<TD>
++beginning of this chapter or previous chapter
++</TD>
++<TD>
++1
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ Up ] </TD>
++<TD ALIGN="CENTER">
++Up
++</TD>
++<TD>
++up section
++</TD>
++<TD>
++1.2
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ &gt;&gt; ] </TD>
++<TD ALIGN="CENTER">
++FastForward
++</TD>
++<TD>
++next chapter
++</TD>
++<TD>
++2
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [Top] </TD>
++<TD ALIGN="CENTER">
++Top
++</TD>
++<TD>
++cover (top) of document
++</TD>
++<TD>
++ &nbsp; 
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [Contents] </TD>
++<TD ALIGN="CENTER">
++Contents
++</TD>
++<TD>
++table of contents
++</TD>
++<TD>
++ &nbsp; 
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [Index] </TD>
++<TD ALIGN="CENTER">
++Index
++</TD>
++<TD>
++concept index
++</TD>
++<TD>
++ &nbsp; 
++</TD>
++</TR>
++<TR>
++<TD ALIGN="CENTER">
++ [ ? ] </TD>
++<TD ALIGN="CENTER">
++About
++</TD>
++<TD>
++this page
++</TD>
++<TD>
++ &nbsp; 
++</TD>
++</TR>
++</TABLE>
++    <P>
++      where the <STRONG> Example </STRONG> assumes that the current position
++      is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of
++      the following structure:</P>
++    <UL>
++      <LI> 1. Section One
++        <UL>
++          <LI>1.1 Subsection One-One
++            <UL>
++              <LI>...</LI>
++            </UL>
++          <LI>1.2 Subsection One-Two
++            <UL>
++              <LI>1.2.1 Subsubsection One-Two-One</LI>
++              <LI>1.2.2 Subsubsection One-Two-Two</LI>
++              <LI>1.2.3 Subsubsection One-Two-Three &nbsp; &nbsp;
++                <STRONG>&lt;== Current Position </STRONG></LI>
++              <LI>1.2.4 Subsubsection One-Two-Four</LI>
++            </UL>
++          </LI>
++          <LI>1.3 Subsection One-Three
++            <UL>
++              <LI>...</LI>
++            </UL>
++          </LI>
++          <LI>1.4 Subsection One-Four</LI>
++        </UL>
++      </LI>
++    </UL>
++
++<HR SIZE=1>
++<BR>
++<FONT SIZE="-1">
++This document was generated
++by <I>root</I> on <I>September, 1 2003</I>
++using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
++</FONT>
++
++</BODY>
++</HTML>
diff --git a/meta/recipes-extended/time/time.inc b/meta/recipes-extended/time/time.inc
new file mode 100644
index 0000000..8586217
--- /dev/null
+++ b/meta/recipes-extended/time/time.inc
@@ -0,0 +1,12 @@
+SUMMARY = "Tool that measures CPU resources"
+DESCRIPTION = "time measures many of the CPU resources, such as time and \
+memory, that other programs use."
+HOMEPAGE = "http://www.gnu.org/software/time/"
+SECTION = "utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b"
+
+inherit texinfo update-alternatives
+
+ALTERNATIVE_${PN} = "time"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-extended/time/time_1.7.bb b/meta/recipes-extended/time/time_1.7.bb
new file mode 100644
index 0000000..92c5353
--- /dev/null
+++ b/meta/recipes-extended/time/time_1.7.bb
@@ -0,0 +1,11 @@
+require time.inc
+
+PR = "r2"
+
+SRC_URI = "${GNU_MIRROR}/time/time-${PV}.tar.gz \
+	   file://debian.patch"
+
+SRC_URI[md5sum] = "e38d2b8b34b1ca259cf7b053caac32b3"
+SRC_URI[sha256sum] = "e37ea79a253bf85a85ada2f7c632c14e481a5fd262a362f6f4fd58e68601496d"
+
+inherit autotools
diff --git a/meta/recipes-extended/tzcode/tzcode-native_2015f.bb b/meta/recipes-extended/tzcode/tzcode-native_2015f.bb
new file mode 100644
index 0000000..a8865a3
--- /dev/null
+++ b/meta/recipes-extended/tzcode/tzcode-native_2015f.bb
@@ -0,0 +1,25 @@
+# note that we allow for us to use data later than our code version
+#
+DESCRIPTION = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
+LICENSE = "PD & BSD"
+
+LIC_FILES_CHKSUM = "file://${WORKDIR}/README;md5=d0ff93a73dd5bc3c6e724bb4343760f6"
+
+SRC_URI =" ftp://ftp.iana.org/tz/releases/tzcode${PV}.tar.gz;name=tzcode \
+           ftp://ftp.iana.org/tz/releases/tzdata2015f.tar.gz;name=tzdata"
+
+SRC_URI[tzcode.md5sum] = "19578d432ba8b92f73406a17a9bc268d"
+SRC_URI[tzcode.sha256sum] = "0c95e0a42bb61141f790f4f5f204b954d7654c894aa54a594a215d6f38de84ae"
+SRC_URI[tzdata.md5sum] = "e3b82732d20e973e48af1c6f13df9a1d"
+SRC_URI[tzdata.sha256sum] = "959f81b541e042ecb13c50097d264ae92ff03a57979c478dbcf24d5da242531d"
+
+S = "${WORKDIR}"
+
+inherit native
+
+do_install () {
+        install -d ${D}${bindir}/
+        install -m 755 zic ${D}${bindir}/
+        install -m 755 zdump ${D}${bindir}/
+        install -m 755 tzselect ${D}${bindir}/
+}
diff --git a/meta/recipes-extended/tzdata/tzdata_2015f.bb b/meta/recipes-extended/tzdata/tzdata_2015f.bb
new file mode 100644
index 0000000..7cda40d
--- /dev/null
+++ b/meta/recipes-extended/tzdata/tzdata_2015f.bb
@@ -0,0 +1,207 @@
+DESCRIPTION = "Timezone data"
+HOMEPAGE = "http://www.iana.org/time-zones"
+SECTION = "base"
+LICENSE = "PD & BSD"
+LIC_FILES_CHKSUM = "file://asia;beginline=2;endline=3;md5=996a9811747aa48db91ed239e5b355a1"
+DEPENDS = "tzcode-native"
+
+SRC_URI = "ftp://ftp.iana.org/tz/releases/tzdata${PV}.tar.gz;name=tzdata"
+
+SRC_URI[tzdata.md5sum] = "e3b82732d20e973e48af1c6f13df9a1d"
+SRC_URI[tzdata.sha256sum] = "959f81b541e042ecb13c50097d264ae92ff03a57979c478dbcf24d5da242531d"
+
+inherit allarch
+
+RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarctica \
+             timezone-arctic timezone-asia timezone-atlantic \
+             timezone-australia timezone-europe timezone-indian \
+             timezone-iso3166.tab timezone-pacific timezone-zone.tab"
+
+S = "${WORKDIR}"
+
+DEFAULT_TIMEZONE ?= "Universal"
+
+TZONES= "africa antarctica asia australasia europe northamerica southamerica  \
+         factory etcetera backward systemv \
+        "
+# pacificnew 
+
+do_compile () {
+        for zone in ${TZONES}; do \
+            ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo -L /dev/null \
+                -y ${S}/yearistype.sh ${S}/${zone} ; \
+            ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/posix -L /dev/null \
+                -y ${S}/yearistype.sh ${S}/${zone} ; \
+            ${STAGING_BINDIR_NATIVE}/zic -d ${WORKDIR}${datadir}/zoneinfo/right -L ${S}/leapseconds \
+                -y ${S}/yearistype.sh ${S}/${zone} ; \
+        done
+}
+
+do_install () {
+        install -d ${D}/$exec_prefix ${D}${datadir}/zoneinfo
+        cp -pPR ${S}/$exec_prefix ${D}/
+        # libc is removing zoneinfo files from package
+        cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo
+        cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo
+
+        # Install default timezone
+        if [ -e ${D}${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ]; then
+            install -d ${D}${sysconfdir}
+            echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
+            ln -s ${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
+        else
+            bberror "DEFAULT_TIMEZONE is set to an invalid value."
+            exit 1
+        fi
+
+        chown -R root:root ${D}
+}
+
+pkg_postinst_${PN} () {
+	etc_lt="$D${sysconfdir}/localtime"
+	src="$D${sysconfdir}/timezone"
+
+	if [ -e ${src} ] ; then
+		tz=$(sed -e 's:#.*::' -e 's:[[:space:]]*::g' -e '/^$/d' "${src}")
+	fi
+	
+	if [ -z "${tz}" ] ; then
+		exit 0
+	fi
+	
+	if [ ! -e "$D${datadir}/zoneinfo/${tz}" ] ; then
+		echo "You have an invalid TIMEZONE setting in ${src}"
+		echo "Your ${etc_lt} has been reset to Universal; enjoy!"
+		tz="Universal"
+		echo "Updating ${etc_lt} with $D${datadir}/zoneinfo/${tz}"
+		if [ -L ${etc_lt} ] ; then
+			rm -f "${etc_lt}"
+		fi
+		ln -s "${datadir}/zoneinfo/${tz}" "${etc_lt}"
+	fi
+}
+
+# Packages primarily organized by directory with a major city
+# in most time zones in the base package
+
+PACKAGES = "tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \
+    tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
+    tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific"
+
+FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*"
+RPROVIDES_tzdata-africa = "tzdata-africa"
+
+FILES_tzdata-americas += "${datadir}/zoneinfo/America/*  \
+                ${datadir}/zoneinfo/US/*                \
+                ${datadir}/zoneinfo/Brazil/*            \
+                ${datadir}/zoneinfo/Canada/*            \
+                ${datadir}/zoneinfo/Mexico/*            \
+                ${datadir}/zoneinfo/Chile/*"
+RPROVIDES_tzdata-americas = "tzdata-americas"
+
+FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*"
+RPROVIDES_tzdata-antarctica = "tzdata-antarctica"
+
+FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*"
+RPROVIDES_tzdata-arctic = "tzdata-arctic"
+
+FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/*        \
+                ${datadir}/zoneinfo/Indian/*            \
+                ${datadir}/zoneinfo/Mideast/*"
+RPROVIDES_tzdata-asia = "tzdata-asia"
+
+FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*"
+RPROVIDES_tzdata-atlantic = "tzdata-atlantic"
+
+FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*"
+RPROVIDES_tzdata-australia = "tzdata-australia"
+
+FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*"
+RPROVIDES_tzdata-europe = "tzdata-europe"
+
+FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*"
+RPROVIDES_tzdata-pacific = "tzdata-pacific"
+
+FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*"
+RPROVIDES_tzdata-posix = "tzdata-posix"
+
+FILES_tzdata-right += "${datadir}/zoneinfo/right/*"
+RPROVIDES_tzdata-right = "tzdata-right"
+
+
+FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba           \
+                ${datadir}/zoneinfo/Egypt                \
+                ${datadir}/zoneinfo/Eire                 \
+                ${datadir}/zoneinfo/Factory              \
+                ${datadir}/zoneinfo/GB-Eire              \
+                ${datadir}/zoneinfo/Hongkong             \
+                ${datadir}/zoneinfo/Iceland              \
+                ${datadir}/zoneinfo/Iran                 \
+                ${datadir}/zoneinfo/Israel               \
+                ${datadir}/zoneinfo/Jamaica              \
+                ${datadir}/zoneinfo/Japan                \
+                ${datadir}/zoneinfo/Kwajalein            \
+                ${datadir}/zoneinfo/Libya                \
+                ${datadir}/zoneinfo/Navajo               \
+                ${datadir}/zoneinfo/Poland               \
+                ${datadir}/zoneinfo/Portugal             \
+                ${datadir}/zoneinfo/Singapore            \
+                ${datadir}/zoneinfo/Turkey"
+RPROVIDES_tzdata-misc = "tzdata-misc"
+
+
+FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu     \
+                ${datadir}/zoneinfo/America/Anchorage    \
+                ${datadir}/zoneinfo/America/Los_Angeles  \
+                ${datadir}/zoneinfo/America/Denver       \
+                ${datadir}/zoneinfo/America/Chicago      \
+                ${datadir}/zoneinfo/America/New_York     \
+                ${datadir}/zoneinfo/America/Caracas      \
+                ${datadir}/zoneinfo/America/Sao_Paulo    \
+                ${datadir}/zoneinfo/Europe/London        \
+                ${datadir}/zoneinfo/Europe/Paris         \
+                ${datadir}/zoneinfo/Africa/Cairo         \
+                ${datadir}/zoneinfo/Europe/Moscow        \
+                ${datadir}/zoneinfo/Asia/Dubai           \
+                ${datadir}/zoneinfo/Asia/Karachi         \
+                ${datadir}/zoneinfo/Asia/Dhaka           \
+                ${datadir}/zoneinfo/Asia/Bankok          \
+                ${datadir}/zoneinfo/Asia/Hong_Kong       \
+                ${datadir}/zoneinfo/Asia/Tokyo           \
+                ${datadir}/zoneinfo/Australia/Darwin     \
+                ${datadir}/zoneinfo/Australia/Adelaide   \
+                ${datadir}/zoneinfo/Australia/Brisbane   \
+                ${datadir}/zoneinfo/Australia/Sydney     \
+                ${datadir}/zoneinfo/Pacific/Noumea       \
+                ${datadir}/zoneinfo/CET                  \
+                ${datadir}/zoneinfo/CST6CDT              \
+                ${datadir}/zoneinfo/EET                  \
+                ${datadir}/zoneinfo/EST                  \
+                ${datadir}/zoneinfo/EST5EDT              \
+                ${datadir}/zoneinfo/GB                   \
+                ${datadir}/zoneinfo/GMT                  \
+                ${datadir}/zoneinfo/GMT+0                \
+                ${datadir}/zoneinfo/GMT-0                \
+                ${datadir}/zoneinfo/GMT0                 \
+                ${datadir}/zoneinfo/Greenwich            \
+                ${datadir}/zoneinfo/HST                  \
+                ${datadir}/zoneinfo/MET                  \
+                ${datadir}/zoneinfo/MST                  \
+                ${datadir}/zoneinfo/MST7MDT              \
+                ${datadir}/zoneinfo/NZ                   \
+                ${datadir}/zoneinfo/NZ-CHAT              \
+                ${datadir}/zoneinfo/PRC                  \
+                ${datadir}/zoneinfo/PST8PDT              \
+                ${datadir}/zoneinfo/ROC                  \
+                ${datadir}/zoneinfo/ROK                  \
+                ${datadir}/zoneinfo/UCT                  \
+                ${datadir}/zoneinfo/UTC                  \
+                ${datadir}/zoneinfo/Universal            \
+                ${datadir}/zoneinfo/W-SU                 \
+                ${datadir}/zoneinfo/WET                  \
+                ${datadir}/zoneinfo/Zulu                 \
+                ${datadir}/zoneinfo/zone.tab             \
+                ${datadir}/zoneinfo/iso3166.tab          \
+                ${datadir}/zoneinfo/Etc/*"
+
+CONFFILES_${PN} += "${sysconfdir}/timezone ${sysconfdir}/localtime"
diff --git a/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch b/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch
new file mode 100644
index 0000000..9ba3c1d
--- /dev/null
+++ b/meta/recipes-extended/unzip/unzip/06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch
@@ -0,0 +1,402 @@
+From: Giovanni Scafora <giovanni.archlinux.org>
+Subject: unzip files encoded with non-latin, non-unicode file names
+Last-Update: 2015-02-11
+
+Upstream-Status: Backport
+
+Updated 2015-02-11 by Marc Deslauriers <marc.deslauriers@canonical.com>
+to fix buffer overflow in charset_to_intern()
+
+Signed-off-by: Marc Deslauriers <marc.deslauriers@canonical.com>
+
+Index: unzip-6.0/unix/unix.c
+===================================================================
+--- unzip-6.0.orig/unix/unix.c	2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unix/unix.c	2015-02-11 09:18:04.902081319 -0500
+@@ -30,6 +30,9 @@
+ #define UNZIP_INTERNAL
+ #include "unzip.h"
+ 
++#include <iconv.h>
++#include <langinfo.h>
++
+ #ifdef SCO_XENIX
+ #  define SYSNDIR
+ #else  /* SCO Unix, AIX, DNIX, TI SysV, Coherent 4.x, ... */
+@@ -1874,3 +1877,102 @@
+     }
+ }
+ #endif /* QLZIP */
++
++
++typedef struct {
++    char *local_charset;
++    char *archive_charset;
++} CHARSET_MAP;
++
++/* A mapping of local <-> archive charsets used by default to convert filenames
++ * of DOS/Windows Zip archives. Currently very basic. */
++static CHARSET_MAP dos_charset_map[] = {
++    { "ANSI_X3.4-1968", "CP850" },
++    { "ISO-8859-1", "CP850" },
++    { "CP1252", "CP850" },
++    { "UTF-8", "CP866" },
++    { "KOI8-R", "CP866" },
++    { "KOI8-U", "CP866" },
++    { "ISO-8859-5", "CP866" }
++};
++
++char OEM_CP[MAX_CP_NAME] = "";
++char ISO_CP[MAX_CP_NAME] = "";
++
++/* Try to guess the default value of OEM_CP based on the current locale.
++ * ISO_CP is left alone for now. */
++void init_conversion_charsets()
++{
++    const char *local_charset;
++    int i;
++
++    /* Make a guess only if OEM_CP not already set. */ 
++    if(*OEM_CP == '\0') {
++    	local_charset = nl_langinfo(CODESET);
++    	for(i = 0; i < sizeof(dos_charset_map)/sizeof(CHARSET_MAP); i++)
++    		if(!strcasecmp(local_charset, dos_charset_map[i].local_charset)) {
++    			strncpy(OEM_CP, dos_charset_map[i].archive_charset,
++    					sizeof(OEM_CP));
++    			break;
++    		}
++    }
++}
++
++/* Convert a string from one encoding to the current locale using iconv().
++ * Be as non-intrusive as possible. If error is encountered during covertion
++ * just leave the string intact. */
++static void charset_to_intern(char *string, char *from_charset)
++{
++    iconv_t cd;
++    char *s,*d, *buf;
++    size_t slen, dlen, buflen;
++    const char *local_charset;
++
++    if(*from_charset == '\0')
++    	return;
++
++    buf = NULL;
++    local_charset = nl_langinfo(CODESET);
++
++    if((cd = iconv_open(local_charset, from_charset)) == (iconv_t)-1)
++        return;
++
++    slen = strlen(string);
++    s = string;
++
++    /*  Make sure OUTBUFSIZ + 1 never ends up smaller than FILNAMSIZ
++     *  as this function also gets called with G.outbuf in fileio.c
++     */
++    buflen = FILNAMSIZ;
++    if (OUTBUFSIZ + 1 < FILNAMSIZ)
++    {
++        buflen = OUTBUFSIZ + 1;
++    }
++
++    d = buf = malloc(buflen);
++    if(!d)
++    	goto cleanup;
++
++    bzero(buf,buflen);
++    dlen = buflen - 1;
++
++    if(iconv(cd, &s, &slen, &d, &dlen) == (size_t)-1)
++    	goto cleanup;
++    strncpy(string, buf, buflen);
++
++    cleanup:
++    free(buf);
++    iconv_close(cd);
++}
++
++/* Convert a string from OEM_CP to the current locale charset. */
++inline void oem_intern(char *string)
++{
++    charset_to_intern(string, OEM_CP);
++}
++
++/* Convert a string from ISO_CP to the current locale charset. */
++inline void iso_intern(char *string)
++{
++    charset_to_intern(string, ISO_CP);
++}
+Index: unzip-6.0/unix/unxcfg.h
+===================================================================
+--- unzip-6.0.orig/unix/unxcfg.h	2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unix/unxcfg.h	2015-02-11 08:46:43.671324260 -0500
+@@ -228,4 +228,30 @@
+ /* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */
+ /*    and notfirstcall are used by do_wild().                          */
+ 
++
++#define MAX_CP_NAME 25 
++   
++#ifdef SETLOCALE
++#  undef SETLOCALE
++#endif
++#define SETLOCALE(category, locale) setlocale(category, locale)
++#include <locale.h>
++   
++#ifdef _ISO_INTERN
++#  undef _ISO_INTERN
++#endif
++#define _ISO_INTERN(str1) iso_intern(str1)
++
++#ifdef _OEM_INTERN
++#  undef _OEM_INTERN
++#endif
++#ifndef IZ_OEM2ISO_ARRAY
++#  define IZ_OEM2ISO_ARRAY
++#endif
++#define _OEM_INTERN(str1) oem_intern(str1)
++
++void iso_intern(char *);
++void oem_intern(char *);
++void init_conversion_charsets(void);
++   
+ #endif /* !__unxcfg_h */
+Index: unzip-6.0/unzip.c
+===================================================================
+--- unzip-6.0.orig/unzip.c	2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unzip.c	2015-02-11 08:46:43.675324290 -0500
+@@ -327,11 +327,21 @@
+   -2  just filenames but allow -h/-t/-z  -l  long Unix \"ls -l\" format\n\
+                                          -v  verbose, multi-page format\n";
+ 
++#ifndef UNIX
+ static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\
+   -h  print header line       -t  print totals for listed files or for all\n\
+   -z  print zipfile comment   -T  print file times in sortable decimal format\
+ \n  -C  be case-insensitive   %s\
+   -x  exclude filenames that follow from listing\n";
++#else /* UNIX */
++static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\
++  -h  print header line       -t  print totals for listed files or for all\n\
++  -z  print zipfile comment  %c-T%c print file times in sortable decimal format\
++\n %c-C%c be case-insensitive   %s\
++  -x  exclude filenames that follow from listing\n\
++  -O CHARSET  specify a character encoding for DOS, Windows and OS/2 archives\n\
++  -I CHARSET  specify a character encoding for UNIX and other archives\n";
++#endif /* !UNIX */
+ #ifdef MORE
+    static ZCONST char Far ZipInfoUsageLine4[] =
+      "  -M  page output through built-in \"more\"\n";
+@@ -664,6 +674,17 @@
+   -U  use escapes for all non-ASCII Unicode  -UU ignore any Unicode fields\n\
+   -C  match filenames case-insensitively     -L  make (some) names \
+ lowercase\n %-42s  -V  retain VMS version numbers\n%s";
++#elif (defined UNIX)
++static ZCONST char Far UnzipUsageLine4[] = "\
++modifiers:\n\
++  -n  never overwrite existing files         -q  quiet mode (-qq => quieter)\n\
++  -o  overwrite files WITHOUT prompting      -a  auto-convert any text files\n\
++  -j  junk paths (do not make directories)   -aa treat ALL files as text\n\
++  -U  use escapes for all non-ASCII Unicode  -UU ignore any Unicode fields\n\
++  -C  match filenames case-insensitively     -L  make (some) names \
++lowercase\n %-42s  -V  retain VMS version numbers\n%s\
++  -O CHARSET  specify a character encoding for DOS, Windows and OS/2 archives\n\
++  -I CHARSET  specify a character encoding for UNIX and other archives\n\n";
+ #else /* !VMS */
+ static ZCONST char Far UnzipUsageLine4[] = "\
+ modifiers:\n\
+@@ -802,6 +823,10 @@
+ #endif /* UNICODE_SUPPORT */
+ 
+ 
++#ifdef UNIX
++    init_conversion_charsets();
++#endif
++
+ #if (defined(__IBMC__) && defined(__DEBUG_ALLOC__))
+     extern void DebugMalloc(void);
+ 
+@@ -1335,6 +1360,11 @@
+     argc = *pargc;
+     argv = *pargv;
+ 
++#ifdef UNIX
++    extern char OEM_CP[MAX_CP_NAME];
++    extern char ISO_CP[MAX_CP_NAME];
++#endif
++    
+     while (++argv, (--argc > 0 && *argv != NULL && **argv == '-')) {
+         s = *argv + 1;
+         while ((c = *s++) != 0) {    /* "!= 0":  prevent Turbo C warning */
+@@ -1516,6 +1546,35 @@
+                     }
+                     break;
+ #endif  /* MACOS */
++#ifdef UNIX
++    			case ('I'):
++                    if (negative) {
++                        Info(slide, 0x401, ((char *)slide,
++                          "error:  encodings can't be negated"));
++                        return(PK_PARAM);
++    				} else {
++    					if(*s) { /* Handle the -Icharset case */
++    						/* Assume that charsets can't start with a dash to spot arguments misuse */
++    						if(*s == '-') { 
++    	                        Info(slide, 0x401, ((char *)slide,
++        		                  "error:  a valid character encoding should follow the -I argument"));
++    	                        return(PK_PARAM); 
++    						}
++    						strncpy(ISO_CP, s, sizeof(ISO_CP));
++    					} else { /* -I charset */
++    						++argv;
++    						if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++    	                        Info(slide, 0x401, ((char *)slide,
++        		                  "error:  a valid character encoding should follow the -I argument"));
++    	                        return(PK_PARAM); 
++    						}
++    						s = *argv;
++    						strncpy(ISO_CP, s, sizeof(ISO_CP));
++    					}
++    					while(*(++s)); /* No params straight after charset name */
++    				}
++    				break;
++#endif /* ?UNIX */
+                 case ('j'):    /* junk pathnames/directory structure */
+                     if (negative)
+                         uO.jflag = FALSE, negative = 0;
+@@ -1591,6 +1650,35 @@
+                     } else
+                         ++uO.overwrite_all;
+                     break;
++#ifdef UNIX
++    			case ('O'):
++                    if (negative) {
++                        Info(slide, 0x401, ((char *)slide,
++                          "error:  encodings can't be negated"));
++                        return(PK_PARAM);
++    				} else {
++    					if(*s) { /* Handle the -Ocharset case */
++    						/* Assume that charsets can't start with a dash to spot arguments misuse */
++    						if(*s == '-') { 
++    	                        Info(slide, 0x401, ((char *)slide,
++        		                  "error:  a valid character encoding should follow the -I argument"));
++    	                        return(PK_PARAM); 
++    						}
++    						strncpy(OEM_CP, s, sizeof(OEM_CP));
++    					} else { /* -O charset */
++    						++argv;
++    						if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++    	                        Info(slide, 0x401, ((char *)slide,
++        		                  "error:  a valid character encoding should follow the -O argument"));
++    	                        return(PK_PARAM); 
++    						}
++    						s = *argv;
++    						strncpy(OEM_CP, s, sizeof(OEM_CP));
++    					}
++    					while(*(++s)); /* No params straight after charset name */
++    				}
++    				break;
++#endif /* ?UNIX */
+                 case ('p'):    /* pipes:  extract to stdout, no messages */
+                     if (negative) {
+                         uO.cflag = FALSE;
+Index: unzip-6.0/unzpriv.h
+===================================================================
+--- unzip-6.0.orig/unzpriv.h	2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/unzpriv.h	2015-02-11 08:46:43.675324290 -0500
+@@ -3008,7 +3008,7 @@
+          !(((islochdr) || (isuxatt)) && \
+            ((hostver) == 25 || (hostver) == 26 || (hostver) == 40))) || \
+         (hostnum) == FS_HPFS_ || \
+-        ((hostnum) == FS_NTFS_ && (hostver) == 50)) { \
++        ((hostnum) == FS_NTFS_ /* && (hostver) == 50 */ )) { \
+         _OEM_INTERN((string)); \
+     } else { \
+         _ISO_INTERN((string)); \
+Index: unzip-6.0/zipinfo.c
+===================================================================
+--- unzip-6.0.orig/zipinfo.c	2015-02-11 08:46:43.675324290 -0500
++++ unzip-6.0/zipinfo.c	2015-02-11 08:46:43.675324290 -0500
+@@ -457,6 +457,10 @@
+     int    tflag_slm=TRUE, tflag_2v=FALSE;
+     int    explicit_h=FALSE, explicit_t=FALSE;
+ 
++#ifdef UNIX
++    extern char OEM_CP[MAX_CP_NAME];
++    extern char ISO_CP[MAX_CP_NAME];
++#endif
+ 
+ #ifdef MACOS
+     uO.lflag = LFLAG;         /* reset default on each call */
+@@ -501,6 +505,35 @@
+                             uO.lflag = 0;
+                     }
+                     break;
++#ifdef UNIX
++    			case ('I'):
++                    if (negative) {
++                        Info(slide, 0x401, ((char *)slide,
++                          "error:  encodings can't be negated"));
++                        return(PK_PARAM);
++    				} else {
++    					if(*s) { /* Handle the -Icharset case */
++    						/* Assume that charsets can't start with a dash to spot arguments misuse */
++    						if(*s == '-') { 
++    	                        Info(slide, 0x401, ((char *)slide,
++        		                  "error:  a valid character encoding should follow the -I argument"));
++    	                        return(PK_PARAM); 
++    						}
++    						strncpy(ISO_CP, s, sizeof(ISO_CP));
++    					} else { /* -I charset */
++    						++argv;
++    						if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++    	                        Info(slide, 0x401, ((char *)slide,
++        		                  "error:  a valid character encoding should follow the -I argument"));
++    	                        return(PK_PARAM); 
++    						}
++    						s = *argv;
++    						strncpy(ISO_CP, s, sizeof(ISO_CP));
++    					}
++    					while(*(++s)); /* No params straight after charset name */
++    				}
++    				break;
++#endif /* ?UNIX */
+                 case 'l':      /* longer form of "ls -l" type listing */
+                     if (negative)
+                         uO.lflag = -2, negative = 0;
+@@ -521,6 +554,35 @@
+                         G.M_flag = TRUE;
+                     break;
+ #endif
++#ifdef UNIX
++    			case ('O'):
++                    if (negative) {
++                        Info(slide, 0x401, ((char *)slide,
++                          "error:  encodings can't be negated"));
++                        return(PK_PARAM);
++    				} else {
++    					if(*s) { /* Handle the -Ocharset case */
++    						/* Assume that charsets can't start with a dash to spot arguments misuse */
++    						if(*s == '-') { 
++    	                        Info(slide, 0x401, ((char *)slide,
++        		                  "error:  a valid character encoding should follow the -I argument"));
++    	                        return(PK_PARAM); 
++    						}
++    						strncpy(OEM_CP, s, sizeof(OEM_CP));
++    					} else { /* -O charset */
++    						++argv;
++    						if(!(--argc > 0 && *argv != NULL && **argv != '-')) {
++    	                        Info(slide, 0x401, ((char *)slide,
++        		                  "error:  a valid character encoding should follow the -O argument"));
++    	                        return(PK_PARAM); 
++    						}
++    						s = *argv;
++    						strncpy(OEM_CP, s, sizeof(OEM_CP));
++    					}
++    					while(*(++s)); /* No params straight after charset name */
++    				}
++    				break;
++#endif /* ?UNIX */
+                 case 's':      /* default:  shorter "ls -l" type listing */
+                     if (negative)
+                         uO.lflag = -2, negative = 0;
diff --git a/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch b/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch
new file mode 100644
index 0000000..e137f0d
--- /dev/null
+++ b/meta/recipes-extended/unzip/unzip/09-cve-2014-8139-crc-overflow.patch
@@ -0,0 +1,52 @@
+From: sms
+Subject: Fix CVE-2014-8139: CRC32 verification heap-based overflow
+Bug-Debian: http://bugs.debian.org/773722
+
+The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz
+
+Upstream-Status: Backport
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+--- a/extract.c
++++ b/extract.c
+@@ -298,6 +298,8 @@
+ #ifndef SFX
+    static ZCONST char Far InconsistEFlength[] = "bad extra-field entry:\n \
+      EF block length (%u bytes) exceeds remaining EF data (%u bytes)\n";
++   static ZCONST char Far TooSmallEBlength[] = "bad extra-field entry:\n \
++     EF block length (%u bytes) invalid (< %d)\n";
+    static ZCONST char Far InvalidComprDataEAs[] =
+      " invalid compressed data for EAs\n";
+ #  if (defined(WIN32) && defined(NTSD_EAS))
+@@ -2023,7 +2025,8 @@
+         ebID = makeword(ef);
+         ebLen = (unsigned)makeword(ef+EB_LEN);
+ 
+-        if (ebLen > (ef_len - EB_HEADSIZE)) {
++        if (ebLen > (ef_len - EB_HEADSIZE))
++        {
+            /* Discovered some extra field inconsistency! */
+             if (uO.qflag)
+                 Info(slide, 1, ((char *)slide, "%-22s ",
+@@ -2158,11 +2161,19 @@
+                 }
+                 break;
+             case EF_PKVMS:
+-                if (makelong(ef+EB_HEADSIZE) !=
++                if (ebLen < 4)
++                {
++                    Info(slide, 1,
++                     ((char *)slide, LoadFarString(TooSmallEBlength),
++                     ebLen, 4));
++                }
++                else if (makelong(ef+EB_HEADSIZE) !=
+                     crc32(CRCVAL_INITIAL, ef+(EB_HEADSIZE+4),
+                           (extent)(ebLen-4)))
++                {
+                     Info(slide, 1, ((char *)slide,
+                       LoadFarString(BadCRC_EAs)));
++                }
+                 break;
+             case EF_PKW32:
+             case EF_PKUNIX:
diff --git a/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch b/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch
new file mode 100644
index 0000000..edc7d51
--- /dev/null
+++ b/meta/recipes-extended/unzip/unzip/10-cve-2014-8140-test-compr-eb.patch
@@ -0,0 +1,33 @@
+From: sms
+Subject: Fix CVE-2014-8140: out-of-bounds write issue in test_compr_eb()
+Bug-Debian: http://bugs.debian.org/773722
+
+The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz
+
+Upstream-Status: Backport
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+--- a/extract.c
++++ b/extract.c
+@@ -2232,10 +2232,17 @@
+     if (compr_offset < 4)                /* field is not compressed: */
+         return PK_OK;                    /* do nothing and signal OK */
+ 
++    /* Return no/bad-data error status if any problem is found:
++     *    1. eb_size is too small to hold the uncompressed size
++     *       (eb_ucsize).  (Else extract eb_ucsize.)
++     *    2. eb_ucsize is zero (invalid).  2014-12-04 SMS.
++     *    3. eb_ucsize is positive, but eb_size is too small to hold
++     *       the compressed data header.
++     */
+     if ((eb_size < (EB_UCSIZE_P + 4)) ||
+-        ((eb_ucsize = makelong(eb+(EB_HEADSIZE+EB_UCSIZE_P))) > 0L &&
+-         eb_size <= (compr_offset + EB_CMPRHEADLEN)))
+-        return IZ_EF_TRUNC;               /* no compressed data! */
++     ((eb_ucsize = makelong( eb+ (EB_HEADSIZE+ EB_UCSIZE_P))) == 0L) ||
++     ((eb_ucsize > 0L) && (eb_size <= (compr_offset + EB_CMPRHEADLEN))))
++        return IZ_EF_TRUNC;             /* no/bad compressed data! */
+ 
+     if (
+ #ifdef INT_16BIT
diff --git a/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch b/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch
new file mode 100644
index 0000000..d0c1db3
--- /dev/null
+++ b/meta/recipes-extended/unzip/unzip/11-cve-2014-8141-getzip64data.patch
@@ -0,0 +1,144 @@
+From: sms
+Subject: Fix CVE-2014-8141: out-of-bounds read issues in getZip64Data()
+Bug-Debian: http://bugs.debian.org/773722
+
+The patch comes from unzip_6.0-8+deb7u2.debian.tar.gz
+
+Upstream-Status: Backport
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+
+
+--- a/fileio.c
++++ b/fileio.c
+@@ -176,6 +176,8 @@
+ #endif
+ static ZCONST char Far ExtraFieldTooLong[] =
+   "warning:  extra field too long (%d).  Ignoring...\n";
++static ZCONST char Far ExtraFieldCorrupt[] =
++  "warning:  extra field (type: 0x%04x) corrupt.  Continuing...\n";
+ 
+ #ifdef WINDLL
+    static ZCONST char Far DiskFullQuery[] =
+@@ -2295,7 +2297,12 @@
+             if (readbuf(__G__ (char *)G.extra_field, length) == 0)
+                 return PK_EOF;
+             /* Looks like here is where extra fields are read */
+-            getZip64Data(__G__ G.extra_field, length);
++            if (getZip64Data(__G__ G.extra_field, length) != PK_COOL)
++            {
++                Info(slide, 0x401, ((char *)slide,
++                 LoadFarString( ExtraFieldCorrupt), EF_PKSZ64));
++                error = PK_WARN;
++            }
+ #ifdef UNICODE_SUPPORT
+             G.unipath_filename = NULL;
+             if (G.UzO.U_flag < 2) {
+--- a/process.c
++++ b/process.c
+@@ -1,5 +1,5 @@
+ /*
+-  Copyright (c) 1990-2009 Info-ZIP.  All rights reserved.
++  Copyright (c) 1990-2014 Info-ZIP.  All rights reserved.
+ 
+   See the accompanying file LICENSE, version 2009-Jan-02 or later
+   (the contents of which are also included in unzip.h) for terms of use.
+@@ -1901,48 +1901,82 @@
+     and a 4-byte version of disk start number.
+     Sets both local header and central header fields.  Not terribly clever,
+     but it means that this procedure is only called in one place.
++
++    2014-12-05 SMS.
++    Added checks to ensure that enough data are available before calling
++    makeint64() or makelong().  Replaced various sizeof() values with
++    simple ("4" or "8") constants.  (The Zip64 structures do not depend
++    on our variable sizes.)  Error handling is crude, but we should now
++    stay within the buffer.
+   ---------------------------------------------------------------------------*/
+ 
++#define Z64FLGS 0xffff
++#define Z64FLGL 0xffffffff
++
+     if (ef_len == 0 || ef_buf == NULL)
+         return PK_COOL;
+ 
+     Trace((stderr,"\ngetZip64Data: scanning extra field of length %u\n",
+       ef_len));
+ 
+-    while (ef_len >= EB_HEADSIZE) {
++    while (ef_len >= EB_HEADSIZE)
++    {
+         eb_id = makeword(EB_ID + ef_buf);
+         eb_len = makeword(EB_LEN + ef_buf);
+ 
+-        if (eb_len > (ef_len - EB_HEADSIZE)) {
+-            /* discovered some extra field inconsistency! */
++        if (eb_len > (ef_len - EB_HEADSIZE))
++        {
++            /* Extra block length exceeds remaining extra field length. */
+             Trace((stderr,
+               "getZip64Data: block length %u > rest ef_size %u\n", eb_len,
+               ef_len - EB_HEADSIZE));
+             break;
+         }
+-        if (eb_id == EF_PKSZ64) {
+-
++        if (eb_id == EF_PKSZ64)
++        {
+           int offset = EB_HEADSIZE;
+ 
+-          if (G.crec.ucsize == 0xffffffff || G.lrec.ucsize == 0xffffffff){
+-            G.lrec.ucsize = G.crec.ucsize = makeint64(offset + ef_buf);
+-            offset += sizeof(G.crec.ucsize);
++          if ((G.crec.ucsize == Z64FLGL) || (G.lrec.ucsize == Z64FLGL))
++          {
++            if (offset+ 8 > ef_len)
++              return PK_ERR;
++
++            G.crec.ucsize = G.lrec.ucsize = makeint64(offset + ef_buf);
++            offset += 8;
+           }
+-          if (G.crec.csize == 0xffffffff || G.lrec.csize == 0xffffffff){
+-            G.csize = G.lrec.csize = G.crec.csize = makeint64(offset + ef_buf);
+-            offset += sizeof(G.crec.csize);
++
++          if ((G.crec.csize == Z64FLGL) || (G.lrec.csize == Z64FLGL))
++          {
++            if (offset+ 8 > ef_len)
++              return PK_ERR;
++
++            G.csize = G.crec.csize = G.lrec.csize = makeint64(offset + ef_buf);
++            offset += 8;
+           }
+-          if (G.crec.relative_offset_local_header == 0xffffffff){
++
++          if (G.crec.relative_offset_local_header == Z64FLGL)
++          {
++            if (offset+ 8 > ef_len)
++              return PK_ERR;
++
+             G.crec.relative_offset_local_header = makeint64(offset + ef_buf);
+-            offset += sizeof(G.crec.relative_offset_local_header);
++            offset += 8;
+           }
+-          if (G.crec.disk_number_start == 0xffff){
++
++          if (G.crec.disk_number_start == Z64FLGS)
++          {
++            if (offset+ 4 > ef_len)
++              return PK_ERR;
++
+             G.crec.disk_number_start = (zuvl_t)makelong(offset + ef_buf);
+-            offset += sizeof(G.crec.disk_number_start);
++            offset += 4;
+           }
++#if 0
++          break;                /* Expect only one EF_PKSZ64 block. */
++#endif /* 0 */
+         }
+ 
+-        /* Skip this extra field block */
++        /* Skip this extra field block. */
+         ef_buf += (eb_len + EB_HEADSIZE);
+         ef_len -= (eb_len + EB_HEADSIZE);
+     }
diff --git a/meta/recipes-extended/unzip/unzip/avoid-strip.patch b/meta/recipes-extended/unzip/unzip/avoid-strip.patch
new file mode 100644
index 0000000..8f30e42
--- /dev/null
+++ b/meta/recipes-extended/unzip/unzip/avoid-strip.patch
@@ -0,0 +1,50 @@
+Upstream-Status: Pending
+
+unix/Makefile: remove hard coded strip commands
+
+Remove the hard coded strip commands, both LF2 (used in linking) and
+STRIP used alone.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur unzip60.orig/unix/configure unzip60/unix/configure
+--- unzip60.orig/unix/configure	2009-04-16 14:25:12.000000000 -0500
++++ unzip60/unix/configure	2011-06-21 11:23:36.822849960 -0500
+@@ -17,7 +17,7 @@
+ IZ_BZIP2=${3}
+ CFLAGS="${CFLAGS} -I. -DUNIX"
+ LFLAGS1=""
+-LFLAGS2="-s"
++LFLAGS2=""
+ LN="ln -s"
+ 
+ CFLAGS_OPT=''
+diff -ur unzip60.orig/unix/Makefile unzip60/unix/Makefile
+--- unzip60.orig/unix/Makefile	2009-01-18 16:41:18.000000000 -0600
++++ unzip60/unix/Makefile	2011-06-21 11:12:22.900003388 -0500
+@@ -52,7 +52,7 @@
+ CF = $(CFLAGS) $(CF_NOOPT)
+ LFLAGS1 =
+ LF = -o unzip$E $(LFLAGS1)
+-LF2 = -s
++LF2 = 
+ 
+ # UnZipSFX flags
+ SL = -o unzipsfx$E $(LFLAGS1)
+@@ -70,7 +70,7 @@
+ CHMOD = chmod
+ BINPERMS = 755
+ MANPERMS = 644
+-STRIP = strip
++STRIP =
+ E =
+ O = .o
+ M = unix
+@@ -776,7 +776,6 @@
+ #
+ gcc:		unix_make
+ 	$(MAKE) unzips CC=gcc LD=gcc CFLAGS="-O3" LF2=""
+-	$(STRIP) $(UNZIPS)
+ 
+ # Heurikon HK68 (68010), UniPlus+ System V 5.0, Green Hills C-68000
+ hk68:		unix_make
diff --git a/meta/recipes-extended/unzip/unzip/define-ldflags.patch b/meta/recipes-extended/unzip/unzip/define-ldflags.patch
new file mode 100644
index 0000000..659c6e3
--- /dev/null
+++ b/meta/recipes-extended/unzip/unzip/define-ldflags.patch
@@ -0,0 +1,18 @@
+Pass LDFLAGS to the linker 
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikhail Durnev <Mikhail_Durnev@mentor.com>
+
+diff -Naur old/unix/configure new/unix/configure
+--- old/unix/configure	2014-01-13 21:59:27.000000000 +1100
++++ new/unix/configure	2014-01-14 16:36:02.000000000 +1100
+@@ -16,7 +16,7 @@
+ CFLAGSR=${CFLAGS}
+ IZ_BZIP2=${3}
+ CFLAGS="${CFLAGS} -I. -DUNIX"
+-LFLAGS1=""
++LFLAGS1=${LDFLAGS}
+ LFLAGS2=""
+ LN="ln -s"
+ 
diff --git a/meta/recipes-extended/unzip/unzip/unzip-6.0_overflow3.diff b/meta/recipes-extended/unzip/unzip/unzip-6.0_overflow3.diff
new file mode 100644
index 0000000..0a0bfbb
--- /dev/null
+++ b/meta/recipes-extended/unzip/unzip/unzip-6.0_overflow3.diff
@@ -0,0 +1,45 @@
+From 190040ebfcf5395a6ccedede2cc9343d34f0a108 Mon Sep 17 00:00:00 2001
+From: mancha <mancha1 AT zoho DOT com>
+Date: Wed, 11 Feb 2015
+Subject: Info-ZIP UnZip buffer overflow
+
+Upstream-Status: Backport
+
+By carefully crafting a corrupt ZIP archive with "extra fields" that
+purport to have compressed blocks larger than the corresponding
+uncompressed blocks in STORED no-compression mode, an attacker can
+trigger a heap overflow that can result in application crash or
+possibly have other unspecified impact.
+
+This patch ensures that when extra fields use STORED mode, the
+"compressed" and uncompressed block sizes match.
+
+Signed-off-by: mancha <mancha1 AT zoho DOT com>
+---
+ extract.c |    8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+--- a/extract.c
++++ b/extract.c
+@@ -2217,6 +2217,7 @@ static int test_compr_eb(__G__ eb, eb_si
+     ulg eb_ucsize;
+     uch *eb_ucptr;
+     int r;
++    ush method;
+ 
+     if (compr_offset < 4)                /* field is not compressed: */
+         return PK_OK;                    /* do nothing and signal OK */
+@@ -2226,6 +2227,13 @@ static int test_compr_eb(__G__ eb, eb_si
+          eb_size <= (compr_offset + EB_CMPRHEADLEN)))
+         return IZ_EF_TRUNC;               /* no compressed data! */
+ 
++    method = makeword(eb + (EB_HEADSIZE + compr_offset));
++    if ((method == STORED) &&
++        (eb_size - compr_offset - EB_CMPRHEADLEN != eb_ucsize))
++	return PK_ERR;			  /* compressed & uncompressed
++					   * should match in STORED
++					   * method */
++
+     if (
+ #ifdef INT_16BIT
+         (((ulg)(extent)eb_ucsize) != eb_ucsize) ||
diff --git a/meta/recipes-extended/unzip/unzip_6.0.bb b/meta/recipes-extended/unzip/unzip_6.0.bb
new file mode 100644
index 0000000..4a0a713
--- /dev/null
+++ b/meta/recipes-extended/unzip/unzip_6.0.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Utilities for extracting and viewing files in .zip archives"
+HOMEPAGE = "http://www.info-zip.org"
+SECTION = "console/utils"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=94caec5a51ef55ef711ee4e8b1c69e29"
+PE = "1"
+PR = "r5"
+
+SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/unzip60.tgz \
+	file://avoid-strip.patch \
+	file://define-ldflags.patch \
+	file://06-unzip60-alt-iconv-utf8_CVE-2015-1315.patch \
+	file://unzip-6.0_overflow3.diff \
+	file://09-cve-2014-8139-crc-overflow.patch \
+	file://10-cve-2014-8140-test-compr-eb.patch \
+	file://11-cve-2014-8141-getzip64data.patch \
+"
+
+SRC_URI[md5sum] = "62b490407489521db863b523a7f86375"
+SRC_URI[sha256sum] = "036d96991646d0449ed0aa952e4fbe21b476ce994abc276e49d30e686708bd37"
+S = "${WORKDIR}/unzip60"
+
+# Makefile uses CF_NOOPT instead of CFLAGS.  We lifted the values from
+# Makefile and add CFLAGS.  Optimization will be overriden by unzip
+# configure to be -O3.
+#
+EXTRA_OEMAKE += "STRIP=true LF2='' \
+                'CF_NOOPT=-I. -Ibzip2 -DUNIX ${CFLAGS}'"
+
+export LD = "${CC}"
+LD_class-native = "${CC}"
+
+do_compile() {
+        oe_runmake -f unix/Makefile generic
+}
+
+do_install() {
+        oe_runmake -f unix/Makefile install prefix=${D}${prefix}
+	install -d ${D}${mandir}
+	mv ${D}${prefix}/man/* ${D}${mandir}
+	rmdir ${D}${prefix}/man/
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+
+ALTERNATIVE_${PN} = "unzip"
+ALTERNATIVE_LINK_NAME[unzip] = "${bindir}/unzip"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch b/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch
new file mode 100644
index 0000000..14ab9c5
--- /dev/null
+++ b/meta/recipes-extended/watchdog/watchdog/fix-ping-failure.patch
@@ -0,0 +1,79 @@
+Fix ping mode failure
+
+Upstream-Status: Pending  
+
+When watchdog works on ping mode, the system will be rebooted since
+watchdog can not receive the expected ECOREPLY on a setting interval.
+
+Ping mode uses a raw socket to send a ECO packet, then uses select()
+to wait and recvfrom() to receive the ECOREPLY packet, if select()
+shows the data is ready, and the data is not the expected ECOREPLY,
+and waiting time is not overdue, it will continue use select() and
+recvfrom().
+
+Problem is that the raw socket can receive any icmp packets, if we do
+not set filters, and there are many icmp packets on socket, this
+program will not find its interested ECOREPLY packet in a special
+interval, which makes the ping mode fail.
+
+
+Other program is that watchdog sometime can not reach the call of
+recvfrom to try to receive packets since tv_sec of struct timeval
+of select parameter is 0.
+
+The timeout of select() is the result of ping interval minusing the
+time of calling gettimeofday spending, when ping interval is 1 second,
+and the call of gettimeofday() spends several useconds, the tv_sec of
+struct timeval of select parameter must be 0, at that condition, we
+should it is valid of tv_sec of struct timeval of select parameter be 0 
+
+Signed-off-by: Roy.Li <rongqing.li@windriver.com>
+---
+ src/net.c      |    2 +-
+ src/watchdog.c |    5 ++++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+Index: watchdog-5.14/src/watchdog.c
+===================================================================
+--- watchdog-5.14.orig/src/watchdog.c
++++ watchdog-5.14/src/watchdog.c
+@@ -24,6 +24,7 @@
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <linux/oom.h>
++#include <linux/icmp.h>
+ #include <linux/watchdog.h>
+ #include <string.h>
+ 
+Index: watchdog-5.14/src/net.c
+===================================================================
+--- watchdog-5.14.orig/src/net.c
++++ watchdog-5.14/src/net.c
+@@ -11,7 +11,8 @@
+ #include <errno.h>
+ #include <sys/time.h>
+ #include <netinet/ip.h>
+-#include <netinet/ip_icmp.h>
++#include <linux/icmp.h>
++//#include <netinet/ip_icmp.h>
+ #include <fcntl.h>
+ #include <string.h>
+ #include <unistd.h>		/* for gethostname() etc */
+@@ -179,6 +180,9 @@ int open_netcheck(struct list *tlist)
+ {
+ 	struct list *act;
+ 	int hold = 0;
++	struct icmp_filter filt;
++	filt.data = ~(1<<ICMP_ECHOREPLY);
++
+ 
+ 	if (tlist != NULL) {
+ 		for (act = tlist; act != NULL; act = act->next) {
+@@ -202,6 +206,7 @@ int open_netcheck(struct list *tlist)
+ 			    fatal_error(EX_SYSERR, "error opening socket (%s)", strerror(errno));
+ 			}
+ 
++			setsockopt(net->sock_fp, SOL_RAW, ICMP_FILTER, (char*)&filt, sizeof(filt));
+ 			/* this is necessary for broadcast pings to work */
+ 			(void)setsockopt(net->sock_fp, SOL_SOCKET, SO_BROADCAST, (char *)&hold, sizeof(hold));
+ 
diff --git a/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch b/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch
new file mode 100644
index 0000000..2fad3a1
--- /dev/null
+++ b/meta/recipes-extended/watchdog/watchdog/fixsepbuild.patch
@@ -0,0 +1,27 @@
+Fix out of tree build support:
+
+| installing /etc/watchdog.conf
+|  /bin/mkdir -p '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man5'
+|  /bin/mkdir -p '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man8'
+|  /usr/bin/install -c -m 644 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/watchdog.conf.5 '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man5'
+|  /usr/bin/install -c -m 644 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/watchdog.8 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/wd_keepalive.8 /media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/watchdog-5.13/wd_identify.8 '/media/build1/poky/build/tmp/work/i586-poky-linux/watchdog/5.13-r0/image/usr/share/man/man8'
+| /usr/bin/install: cannot stat `watchdog.conf': No such file or directory
+| make[2]: *** [install-etc-local] Error 1
+
+Upstream-Status: Pending
+
+RP 2013/03/21
+
+Index: watchdog-5.13/Makefile.am
+===================================================================
+--- watchdog-5.13.orig/Makefile.am	2013-02-01 11:15:44.000000000 +0000
++++ watchdog-5.13/Makefile.am	2013-03-21 11:59:35.637139031 +0000
+@@ -16,7 +16,7 @@
+ 	else \
+ 	        echo "installing $(CONFIG_FILENAME)"; \
+ 		$(mkinstalldirs) `dirname $(DESTDIR)$(CONFIG_FILENAME)`; \
+-	        $(INSTALL_DATA) watchdog.conf $(DESTDIR)$(CONFIG_FILENAME); \
++	        $(INSTALL_DATA) $(srcdir)/watchdog.conf $(DESTDIR)$(CONFIG_FILENAME); \
+ 	fi
+ 
+ install-data-local: install-etc-local
diff --git a/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch b/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch
new file mode 100644
index 0000000..36f2968
--- /dev/null
+++ b/meta/recipes-extended/watchdog/watchdog/watchdog-conf.patch
@@ -0,0 +1,11 @@
+--- watchdog-5.13.orig/watchdog.conf	2013-02-01 12:15:44.000000000 +0100
++++ watchdog-5.13/watchdog.conf	2014-11-13 10:59:43.233943000 +0100
+@@ -20,7 +20,7 @@
+ #test-binary		= 
+ #test-timeout		= 
+ 
+-#watchdog-device	= /dev/watchdog
++watchdog-device	= /dev/watchdog
+ 
+ # Defaults compiled into the binary
+ #temperature-device	=
diff --git a/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch b/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch
new file mode 100644
index 0000000..0fa8ee9
--- /dev/null
+++ b/meta/recipes-extended/watchdog/watchdog/watchdog-init.patch
@@ -0,0 +1,53 @@
+--- watchdog-5.13.orig/redhat/watchdog.init	2014-11-12 17:18:39.125943000 +0100
++++ watchdog-5.13/redhat/watchdog.init	2014-11-12 18:27:36.189943000 +0100
+@@ -7,7 +7,7 @@
+ #                 Henning P. Schmiedehausen <hps@tanstaafl.de>
+ 
+ # Source function library.
+-. /etc/rc.d/init.d/functions
++. /etc/init.d/functions
+ 
+ [ -x /usr/sbin/watchdog -a -e /etc/watchdog.conf ] || exit 0
+ 
+@@ -23,22 +23,22 @@
+ 
+ start() {
+ 
+-	echo -n $"Starting $prog: "
++	echo -n "Starting $prog: "
+ 	if [ -n "$(pidofproc $prog)" ]; then
+-		echo -n $"$prog: already running"
+-		echo_failure
++		echo -n "$prog: already running "
++		failure
+ 		echo
+ 		return 1
+ 	fi
+ 	if [ "$VERBOSE" = "yes" ]; then
+-	    daemon /usr/sbin/${prog} -v
++	    /usr/sbin/${prog} -v
+ 	else
+-	    daemon /usr/sbin/${prog}
++	    /usr/sbin/${prog}
+         fi
+ 	RETVAL=$?
+ 	[ $RETVAL -eq 0 ] && touch $lockfile
+-	[ $RETVAL -eq 0 ] && echo_success
+-	[ $RETVAL -ne 0 ] && echo_failure
++	[ $RETVAL -eq 0 ] && success
++	[ $RETVAL -ne 0 ] && failure
+ 	echo
+ 	return $RETVAL
+ }
+@@ -50,8 +50,10 @@
+ 	# and reboot the box.
+ 	killproc $prog -TERM
+ 	RETVAL=$?
+-	echo
+ 	[ $RETVAL -eq 0 ] && rm -f $lockfile $pidfile
++	[ $RETVAL -eq 0 ] && success
++	[ $RETVAL -ne 0 ] && failure
++	echo
+ 	return $RETVAL
+ }
+ 
diff --git a/meta/recipes-extended/watchdog/watchdog_5.14.bb b/meta/recipes-extended/watchdog/watchdog_5.14.bb
new file mode 100644
index 0000000..9ec0a8e
--- /dev/null
+++ b/meta/recipes-extended/watchdog/watchdog_5.14.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Software watchdog"
+DESCRIPTION = "Watchdog is a daemon that checks if your system is still \
+working. If programs in user space are not longer executed \
+it will reboot the system."
+HOMEPAGE = "http://watchdog.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=172030&atid=860194"
+
+LICENSE = "GPL-2.0+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ecc0551bf54ad97f6b541720f84d6569"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/watchdog/watchdog-${PV}.tar.gz \
+           file://fixsepbuild.patch \
+	   file://fix-ping-failure.patch \
+	   file://watchdog-init.patch \
+	   file://watchdog-conf.patch"
+
+SRC_URI[md5sum] = "5b2dba0c593942f4acc100bca0d560c4"
+SRC_URI[sha256sum] = "620b2f49e9879f2e85c73d4c1f422f9101e6b38e824fea2414befd8bb6866ad1"
+
+inherit autotools
+inherit update-rc.d
+
+INITSCRIPT_NAME = "watchdog.sh"
+INITSCRIPT_PARAMS = "start 15 1 2 3 4 5 . stop 85 0 6 ."
+
+RRECOMMENDS_${PN} = "kernel-module-softdog"
+
+do_install_append() {
+	install -D ${S}/redhat/watchdog.init ${D}/${sysconfdir}/init.d/watchdog.sh
+}
diff --git a/meta/recipes-extended/wget/wget.inc b/meta/recipes-extended/wget/wget.inc
new file mode 100644
index 0000000..049b898
--- /dev/null
+++ b/meta/recipes-extended/wget/wget.inc
@@ -0,0 +1,24 @@
+SUMMARY = "Console URL download utility supporting HTTP, FTP, etc"
+HOMEPAGE = "https://www.gnu.org/software/wget/"
+SECTION = "console/network"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+DEPENDS = "gnutls zlib libpcre"
+
+INC_PR = "r16"
+
+inherit autotools gettext texinfo update-alternatives pkgconfig
+
+EXTRA_OECONF = "--enable-ipv6 --with-ssl=gnutls --disable-rpath --disable-iri \
+                --without-libgnutls-prefix ac_cv_header_uuid_uuid_h=no"
+
+ALTERNATIVE_${PN} = "wget"
+ALTERNATIVE_${PN}_class-nativesdk = ""
+ALTERNATIVE_PRIORITY = "100"
+
+RRECOMMENDS_${PN} += "ca-certificates"
+
+BBCLASSEXTEND += "nativesdk"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libuuid] = "--with-libuuid, --without-libuuid,util-linux"
diff --git a/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..0b3c6f5
--- /dev/null
+++ b/meta/recipes-extended/wget/wget/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: wget-1.16.3/lib/Makefile.am
+===================================================================
+--- wget-1.16.3.orig/lib/Makefile.am
++++ wget-1.16.3/lib/Makefile.am
+@@ -846,7 +846,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
diff --git a/meta/recipes-extended/wget/wget/fix_makefile.patch b/meta/recipes-extended/wget/wget/fix_makefile.patch
new file mode 100644
index 0000000..eaa2e7e
--- /dev/null
+++ b/meta/recipes-extended/wget/wget/fix_makefile.patch
@@ -0,0 +1,18 @@
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: wget-1.12/configure.ac
+===================================================================
+--- wget-1.12.orig/configure.ac	2009-09-22 09:39:49.000000000 -0700
++++ wget-1.12/configure.ac	2011-10-19 20:32:53.714812160 -0700
+@@ -177,7 +177,7 @@
+ dnl Gettext
+ dnl
+ AM_GNU_GETTEXT([external],[need-ngettext])
+-AM_GNU_GETTEXT_VERSION([0.17])
++AM_GNU_GETTEXT_VERSION([0.18])
+ 
+ AC_PROG_RANLIB
+ 
diff --git a/meta/recipes-extended/wget/wget_1.16.3.bb b/meta/recipes-extended/wget/wget_1.16.3.bb
new file mode 100644
index 0000000..5c34a42
--- /dev/null
+++ b/meta/recipes-extended/wget/wget_1.16.3.bb
@@ -0,0 +1,9 @@
+SRC_URI = "${GNU_MIRROR}/wget/wget-${PV}.tar.gz \
+           file://fix_makefile.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+          "
+
+SRC_URI[md5sum] = "f61d9011b99f824106a5d5a05dd0f63d"
+SRC_URI[sha256sum] = "9f1c6d09d7148c1c2d9fd0ea655dcf4dcc407deb2db32d4126251ca0245cb670"
+
+require wget.inc
diff --git a/meta/recipes-extended/which/which-2.18/automake-foreign.patch b/meta/recipes-extended/which/which-2.18/automake-foreign.patch
new file mode 100644
index 0000000..495cdc6
--- /dev/null
+++ b/meta/recipes-extended/which/which-2.18/automake-foreign.patch
@@ -0,0 +1,28 @@
+Subject: [PATCH] automake foreign strictness
+
+Use foreign strictness to avoid automake errors.
+
+Upstream-Status: Inappropriate [upstream no longer active]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac |    5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b30b6f5..bd3222c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,6 +1,7 @@
+ dnl Process this file with autoconf to produce a configure script.
+-AC_INIT(which.c)
+-AM_INIT_AUTOMAKE(which, 2.18)
++AC_INIT([which],[2.18])
++AC_CONFIG_SRCDIR(which.c)
++AM_INIT_AUTOMAKE([foreign])
+ AM_CONFIG_HEADER(config.h)
+ AM_MAINTAINER_MODE
+ 
+-- 
+1.7.1
+
diff --git a/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch b/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch
new file mode 100644
index 0000000..fb9b1a4
--- /dev/null
+++ b/meta/recipes-extended/which/which-2.18/fix_name_conflict_group_member.patch
@@ -0,0 +1,53 @@
+Upstream-Status: Inappropriate [this is 2.18(GPLv2) specific]
+
+# glibc also implements the function group_member. To avoid name conflict,
+# here let us append a "_" to which's version.
+#
+# Signed-off-by Dexuan Cui <dexuan.cui@intel.com>, 2010-08-20
+# (this patch is licensed under GPLv2)
+
+--- which-2.18/bash.c
++++ which-2.18/bash.c
+@@ -45,7 +45,12 @@
+  * - changed all occurences of 'gid_t' into 'GID_T'.
+  * - exported functions needed in which.c
+  */
+-static int group_member (GID_T gid);
++
++/*
++ * glibc also implements the function group_member. To avoid name conflict,
++ * here let us append a "_" to which's version.
++ */
++static int _group_member (GID_T gid);
+ static char* extract_colon_unit (char const* string, int *p_index);
+ 
+ /*===========================================================================
+@@ -200,8 +205,8 @@
+ 
+ /* From bash-2.05b / general.c / line 805 */
+ /* Return non-zero if GID is one that we have in our groups list. */
+-int
+-group_member (GID_T gid)
++static int
++_group_member (GID_T gid)
+ {
+ #if defined (HAVE_GETGROUPS)
+   register int i;
+@@ -290,7 +295,7 @@
+     return (X_BIT (u_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS;
+ 
+   /* Otherwise, if we are in the owning group, the group permissions apply. */
+-  if (group_member (finfo.st_gid))
++  if (_group_member (finfo.st_gid))
+     return (X_BIT (g_mode_bits (finfo.st_mode))) ? (FS_EXISTS | FS_EXECABLE) : FS_EXISTS;
+ 
+   /* Otherwise, if we are in the other group, the other permissions apply. */
+@@ -331,7 +336,7 @@
+ /* Given a string containing units of information separated by colons,
+    return the next one pointed to by (P_INDEX), or NULL if there are no more.
+    Advance (P_INDEX) to the character after the colon. */
+-char*
++static char*
+ extract_colon_unit (char const* string, int* p_index)
+ {
+   int i, start, len;
diff --git a/meta/recipes-extended/which/which-2.21/automake.patch b/meta/recipes-extended/which/which-2.21/automake.patch
new file mode 100644
index 0000000..4d0f2e4
--- /dev/null
+++ b/meta/recipes-extended/which/which-2.21/automake.patch
@@ -0,0 +1,19 @@
+Update autoconf prologue to use "foreign" strictness.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index d974461..a20dfa8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1,7 +1,7 @@
+ dnl Process this file with autoconf to produce a configure script.
+ AC_INIT([which], [2.21])
+ AC_CONFIG_SRCDIR(which.c)
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+ AM_CONFIG_HEADER(config.h)
+ AM_MAINTAINER_MODE
+ 
+
diff --git a/meta/recipes-extended/which/which_2.18.bb b/meta/recipes-extended/which/which_2.18.bb
new file mode 100644
index 0000000..eb6cc99
--- /dev/null
+++ b/meta/recipes-extended/which/which_2.18.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Displays the full path of shell commands"
+DESCRIPTION = "Which is a utility that prints out the full path of the \
+executables that bash(1) would execute when the passed \
+program names would have been entered on the shell prompt. \
+It does this by using the exact same algorithm as bash."
+SECTION = "libs"
+HOMEPAGE = "http://carlo17.home.xs4all.nl/which/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+PR = "r2"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/which/which-2.18.tar.gz/42d51938e48b91f6e19fabf216f5c3e9/which-${PV}.tar.gz \
+           file://fix_name_conflict_group_member.patch \
+           file://automake-foreign.patch \
+"
+
+SRC_URI[md5sum] = "42d51938e48b91f6e19fabf216f5c3e9"
+SRC_URI[sha256sum] = "9445cd7e02ec0c26a44fd56098464ded064ba5d93dd2e15ec12410ba56b2e544"
+
+DEPENDS = "cwautomacros-native"
+
+inherit autotools texinfo update-alternatives
+
+do_configure_prepend() {
+	OLD="@ACLOCAL_CWFLAGS@"
+	NEW="-I ${STAGING_DIR_NATIVE}/${datadir}/cwautomacros/m4"
+	sed -i "s#${OLD}#${NEW}#g" `grep -rl ${OLD} ${S}`
+}
+
+ALTERNATIVE_${PN} = "which"
+ALTERNATIVE_PRIORITY = "100"
+
diff --git a/meta/recipes-extended/which/which_2.21.bb b/meta/recipes-extended/which/which_2.21.bb
new file mode 100644
index 0000000..a7687f6
--- /dev/null
+++ b/meta/recipes-extended/which/which_2.21.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Displays the full path of shell commands"
+DESCRIPTION = "Which is a utility that prints out the full path of the \
+executables that bash(1) would execute when the passed \
+program names would have been entered on the shell prompt. \
+It does this by using the exact same algorithm as bash."
+SECTION = "libs"
+HOMEPAGE = "http://carlo17.home.xs4all.nl/which/"
+
+LICENSE = "GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\
+                    file://which.c;beginline=1;endline=17;md5=a9963693af2272e7a8df6f231164e7a2"
+DEPENDS     = "cwautomacros-native"
+
+inherit autotools texinfo update-alternatives
+
+PR = "r3"
+
+EXTRA_OECONF = "--disable-iberty"
+
+SRC_URI = "${GNU_MIRROR}/which/which-${PV}.tar.gz \
+           file://automake.patch \
+           "
+
+SRC_URI[md5sum] = "097ff1a324ae02e0a3b0369f07a7544a"
+SRC_URI[sha256sum] = "f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad"
+
+do_configure_prepend() {
+	sed -i -e 's%@ACLOCAL_CWFLAGS@%-I ${STAGING_DIR_NATIVE}/usr/share/cwautomacros/m4%g' ${S}/Makefile.am ${S}/tilde/Makefile.am
+}
+
+ALTERNATIVE_${PN} = "which"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch b/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch
new file mode 100644
index 0000000..4cd1baf
--- /dev/null
+++ b/meta/recipes-extended/xdg-utils/xdg-utils/0001-Reinstate-xdg-terminal.patch
@@ -0,0 +1,672 @@
+From 174aa7206f4b308d4d2292bb8067a07d8cc715c0 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Tue, 29 Apr 2014 07:29:32 +0200
+Subject: [PATCH] Reinstate xdg-terminal
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+
+Upstream-Status: Inappropriate [Revert]
+---
+ scripts/Makefile.in  |   6 +-
+ scripts/xdg-terminal | 622 +++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 625 insertions(+), 3 deletions(-)
+ create mode 100755 scripts/xdg-terminal
+
+diff --git a/scripts/Makefile.in b/scripts/Makefile.in
+index 2c7d2ac..bef10d1 100644
+--- a/scripts/Makefile.in
++++ b/scripts/Makefile.in
+@@ -20,11 +20,11 @@ SCRIPTS		= \
+     xdg-open \
+     xdg-email \
+     xdg-screensaver \
+-    xdg-settings
++    xdg-settings \
++    xdg-terminal
+ #    xdg-su
+ #    xdg-copy \
+ #    xdg-file-dialog
+-#    xdg-terminal
+ 
+ MANPAGES=	$(SCRIPTS:%=man/%.1)
+ WEBPAGES=	$(SCRIPTS:%=%.html)
+@@ -42,7 +42,7 @@ release:	scripts html man
+ 	rm -f xdg-*.in *~ HACKING generate-help-script.awk
+ 	rm -rf desc/
+ 	rm -rf xsl/
+-	rm -f xdg-file-dialog xdg-su xdg-copy xdg-terminal
++	rm -f xdg-file-dialog xdg-su xdg-copy
+ 
+ distclean: clean
+ 	rm -f Makefile
+diff --git a/scripts/xdg-terminal b/scripts/xdg-terminal
+new file mode 100755
+index 0000000..4bd9205
+--- /dev/null
++++ b/scripts/xdg-terminal
+@@ -0,0 +1,622 @@
++#!/bin/sh
++#---------------------------------------------
++#   xdg-terminal
++#
++#   Utility script to open the registered terminal emulator
++#
++#   Refer to the usage() function below for usage.
++#
++#   Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org>
++#   Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org>
++#   Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
++#
++#   LICENSE:
++#
++#   Permission is hereby granted, free of charge, to any person obtaining a
++#   copy of this software and associated documentation files (the "Software"),
++#   to deal in the Software without restriction, including without limitation
++#   the rights to use, copy, modify, merge, publish, distribute, sublicense,
++#   and/or sell copies of the Software, and to permit persons to whom the
++#   Software is furnished to do so, subject to the following conditions:
++#
++#   The above copyright notice and this permission notice shall be included
++#   in all copies or substantial portions of the Software.
++#
++#   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
++#   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++#   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++#   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
++#   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
++#   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
++#   OTHER DEALINGS IN THE SOFTWARE.
++#
++#---------------------------------------------
++
++manualpage()
++{
++cat << _MANUALPAGE
++Name
++
++   xdg-terminal - opens the user's preferred terminal emulator application
++
++Synopsis
++
++   xdg-terminal [command]
++
++   xdg-terminal { --help | --manual | --version }
++
++Description
++
++   xdg-terminal opens the user's preferred terminal emulator application. If
++   a command is provided the command will be executed by the shell within the
++   newly opened terminal window.
++
++   xdg-terminal is for use inside a desktop session only. It is not
++   recommended to use xdg-terminal as root.
++
++Options
++
++   --help
++           Show command synopsis.
++
++   --manual
++           Show this manual page.
++
++   --version
++           Show the xdg-utils version information.
++
++Exit Codes
++
++   An exit code of 0 indicates success while a non-zero exit code indicates
++   failure. The following failure codes can be returned:
++
++   1
++           Error in command line syntax.
++
++   3
++           A required tool could not be found.
++
++   4
++           The action failed.
++
++Examples
++
++ xdg-terminal
++
++   Opens the user's default terminal emulator, just starting an interactive
++   shell.
++
++ xdg-terminal top
++
++   Opens the user's default terminal emulator and lets it run the top
++   executable.
++_MANUALPAGE
++}
++
++usage()
++{
++cat << _USAGE
++   xdg-terminal - opens the user's preferred terminal emulator application
++
++Synopsis
++
++   xdg-terminal [command]
++
++   xdg-terminal { --help | --manual | --version }
++
++_USAGE
++}
++
++#@xdg-utils-common@
++
++#----------------------------------------------------------------------------
++#   Common utility functions included in all XDG wrapper scripts
++#----------------------------------------------------------------------------
++
++DEBUG()
++{
++  [ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && return 0;
++  [ ${XDG_UTILS_DEBUG_LEVEL} -lt $1 ] && return 0;
++  shift
++  echo "$@" >&2
++}
++
++# This handles backslashes but not quote marks.
++first_word()
++{
++    read first rest
++    echo "$first"
++}
++
++#-------------------------------------------------------------
++# map a binary to a .desktop file
++binary_to_desktop_file()
++{
++    search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
++    binary="`which "$1"`"
++    binary="`readlink -f "$binary"`"
++    base="`basename "$binary"`"
++    IFS=:
++    for dir in $search; do
++        unset IFS
++        [ "$dir" ] || continue
++        [ -d "$dir/applications" ] || [ -d "$dir/applnk" ] || continue
++        for file in "$dir"/applications/*.desktop "$dir"/applications/*/*.desktop "$dir"/applnk/*.desktop "$dir"/applnk/*/*.desktop; do
++            [ -r "$file" ] || continue
++            # Check to make sure it's worth the processing.
++            grep -q "^Exec.*$base" "$file" || continue
++            # Make sure it's a visible desktop file (e.g. not "preferred-web-browser.desktop").
++            grep -Eq "^(NoDisplay|Hidden)=true" "$file" && continue
++            command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`"
++            command="`which "$command"`"
++            if [ x"`readlink -f "$command"`" = x"$binary" ]; then
++                # Fix any double slashes that got added path composition
++                echo "$file" | sed -e 's,//*,/,g'
++                return
++            fi
++        done
++    done
++}
++
++#-------------------------------------------------------------
++# map a .desktop file to a binary
++## FIXME: handle vendor dir case
++desktop_file_to_binary()
++{
++    search="${XDG_DATA_HOME:-$HOME/.local/share}:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}"
++    desktop="`basename "$1"`"
++    IFS=:
++    for dir in $search; do
++        unset IFS
++        [ "$dir" ] && [ -d "$dir/applications" ] || continue
++        file="$dir/applications/$desktop"
++        [ -r "$file" ] || continue
++        # Remove any arguments (%F, %f, %U, %u, etc.).
++        command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`"
++        command="`which "$command"`"
++        readlink -f "$command"
++        return
++    done
++}
++
++#-------------------------------------------------------------
++# Exit script on successfully completing the desired operation
++
++exit_success()
++{
++    if [ $# -gt 0 ]; then
++        echo "$@"
++        echo
++    fi
++
++    exit 0
++}
++
++
++#-----------------------------------------
++# Exit script on malformed arguments, not enough arguments
++# or missing required option.
++# prints usage information
++
++exit_failure_syntax()
++{
++    if [ $# -gt 0 ]; then
++        echo "xdg-terminal: $@" >&2
++        echo "Try 'xdg-terminal --help' for more information." >&2
++    else
++        usage
++        echo "Use 'man xdg-terminal' or 'xdg-terminal --manual' for additional info."
++    fi
++
++    exit 1
++}
++
++#-------------------------------------------------------------
++# Exit script on missing file specified on command line
++
++exit_failure_file_missing()
++{
++    if [ $# -gt 0 ]; then
++        echo "xdg-terminal: $@" >&2
++    fi
++
++    exit 2
++}
++
++#-------------------------------------------------------------
++# Exit script on failure to locate necessary tool applications
++
++exit_failure_operation_impossible()
++{
++    if [ $# -gt 0 ]; then
++        echo "xdg-terminal: $@" >&2
++    fi
++
++    exit 3
++}
++
++#-------------------------------------------------------------
++# Exit script on failure returned by a tool application
++
++exit_failure_operation_failed()
++{
++    if [ $# -gt 0 ]; then
++        echo "xdg-terminal: $@" >&2
++    fi
++
++    exit 4
++}
++
++#------------------------------------------------------------
++# Exit script on insufficient permission to read a specified file
++
++exit_failure_file_permission_read()
++{
++    if [ $# -gt 0 ]; then
++        echo "xdg-terminal: $@" >&2
++    fi
++
++    exit 5
++}
++
++#------------------------------------------------------------
++# Exit script on insufficient permission to write a specified file
++
++exit_failure_file_permission_write()
++{
++    if [ $# -gt 0 ]; then
++        echo "xdg-terminal: $@" >&2
++    fi
++
++    exit 6
++}
++
++check_input_file()
++{
++    if [ ! -e "$1" ]; then
++        exit_failure_file_missing "file '$1' does not exist"
++    fi
++    if [ ! -r "$1" ]; then
++        exit_failure_file_permission_read "no permission to read file '$1'"
++    fi
++}
++
++check_vendor_prefix()
++{
++    file_label="$2"
++    [ -n "$file_label" ] || file_label="filename"
++    file=`basename "$1"`
++    case "$file" in
++       [[:alpha:]]*-*)
++         return
++         ;;
++    esac
++
++    echo "xdg-terminal: $file_label '$file' does not have a proper vendor prefix" >&2
++    echo 'A vendor prefix consists of alpha characters ([a-zA-Z]) and is terminated' >&2
++    echo 'with a dash ("-"). An example '"$file_label"' is '"'example-$file'" >&2
++    echo "Use --novendor to override or 'xdg-terminal --manual' for additional info." >&2
++    exit 1
++}
++
++check_output_file()
++{
++    # if the file exists, check if it is writeable
++    # if it does not exists, check if we are allowed to write on the directory
++    if [ -e "$1" ]; then
++        if [ ! -w "$1" ]; then
++            exit_failure_file_permission_write "no permission to write to file '$1'"
++        fi
++    else
++        DIR=`dirname "$1"`
++        if [ ! -w "$DIR" ] || [ ! -x "$DIR" ]; then
++            exit_failure_file_permission_write "no permission to create file '$1'"
++        fi
++    fi
++}
++
++#----------------------------------------
++# Checks for shared commands, e.g. --help
++
++check_common_commands()
++{
++    while [ $# -gt 0 ] ; do
++        parm="$1"
++        shift
++
++        case "$parm" in
++            --help)
++            usage
++            echo "Use 'man xdg-terminal' or 'xdg-terminal --manual' for additional info."
++            exit_success
++            ;;
++
++            --manual)
++            manualpage
++            exit_success
++            ;;
++
++            --version)
++            echo "xdg-terminal 1.1.0 rc1"
++            exit_success
++            ;;
++        esac
++    done
++}
++
++check_common_commands "$@"
++
++[ -z "${XDG_UTILS_DEBUG_LEVEL}" ] && unset XDG_UTILS_DEBUG_LEVEL;
++if [ ${XDG_UTILS_DEBUG_LEVEL-0} -lt 1 ]; then
++    # Be silent
++    xdg_redirect_output=" > /dev/null 2> /dev/null"
++else
++    # All output to stderr
++    xdg_redirect_output=" >&2"
++fi
++
++#--------------------------------------
++# Checks for known desktop environments
++# set variable DE to the desktop environments name, lowercase
++
++detectDE()
++{
++    # see https://bugs.freedesktop.org/show_bug.cgi?id=34164
++    unset GREP_OPTIONS
++
++    if [ -n "${XDG_CURRENT_DESKTOP}" ]; then
++      case "${XDG_CURRENT_DESKTOP}" in
++         ENLIGHTENMENT)
++           DE=enlightenment;
++           ;;
++         GNOME)
++           DE=gnome;
++           ;;
++         KDE)
++           DE=kde;
++           ;;
++         LXDE)
++           DE=lxde;
++           ;;
++         MATE)
++           DE=mate;
++           ;;
++         XFCE)
++           DE=xfce
++           ;;
++      esac
++    fi
++
++    if [ x"$DE" = x"" ]; then
++      # classic fallbacks
++      if [ x"$KDE_FULL_SESSION" != x"" ]; then DE=kde;
++      elif [ x"$GNOME_DESKTOP_SESSION_ID" != x"" ]; then DE=gnome;
++      elif [ x"$MATE_DESKTOP_SESSION_ID" != x"" ]; then DE=mate;
++      elif `dbus-send --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.GetNameOwner string:org.gnome.SessionManager > /dev/null 2>&1` ; then DE=gnome;
++      elif xprop -root _DT_SAVE_MODE 2> /dev/null | grep ' = \"xfce4\"$' >/dev/null 2>&1; then DE=xfce;
++      elif xprop -root 2> /dev/null | grep -i '^xfce_desktop_window' >/dev/null 2>&1; then DE=xfce
++      elif echo $DESKTOP | grep -q '^Enlightenment'; then DE=enlightenment;
++      fi
++    fi
++
++    if [ x"$DE" = x"" ]; then
++      # fallback to checking $DESKTOP_SESSION
++      case "$DESKTOP_SESSION" in
++         gnome)
++           DE=gnome;
++           ;;
++         LXDE|Lubuntu)
++           DE=lxde; 
++           ;;
++         MATE)
++           DE=mate;
++           ;;
++         xfce|xfce4|'Xfce Session')
++           DE=xfce;
++           ;;
++      esac
++    fi
++
++    if [ x"$DE" = x"" ]; then
++      # fallback to uname output for other platforms
++      case "$(uname 2>/dev/null)" in 
++        Darwin)
++          DE=darwin;
++          ;;
++      esac
++    fi
++
++    if [ x"$DE" = x"gnome" ]; then
++      # gnome-default-applications-properties is only available in GNOME 2.x
++      # but not in GNOME 3.x
++      which gnome-default-applications-properties > /dev/null 2>&1  || DE="gnome3"
++    fi
++}
++
++#----------------------------------------------------------------------------
++# kfmclient exec/openURL can give bogus exit value in KDE <= 3.5.4
++# It also always returns 1 in KDE 3.4 and earlier
++# Simply return 0 in such case
++
++kfmclient_fix_exit_code()
++{
++    version=`LC_ALL=C.UTF-8 kde-config --version 2>/dev/null | grep '^KDE'`
++    major=`echo $version | sed 's/KDE.*: \([0-9]\).*/\1/'`
++    minor=`echo $version | sed 's/KDE.*: [0-9]*\.\([0-9]\).*/\1/'`
++    release=`echo $version | sed 's/KDE.*: [0-9]*\.[0-9]*\.\([0-9]\).*/\1/'`
++    test "$major" -gt 3 && return $1
++    test "$minor" -gt 5 && return $1
++    test "$release" -gt 4 && return $1
++    return 0
++}
++
++terminal_kde()
++{
++    terminal=`kreadconfig --file kdeglobals --group General --key TerminalApplication --default konsole`
++
++    terminal_exec=`which $terminal 2>/dev/null`
++
++    if [ -x "$terminal_exec" ]; then
++        if [ x"$1" = x"" ]; then
++            $terminal_exec
++        else
++            $terminal_exec -e "$1"
++        fi
++
++        if [ $? -eq 0 ]; then
++            exit_success
++        else
++            exit_failure_operation_failed
++        fi
++    else
++        exit_failure_operation_impossible "configured terminal program '$terminal' not found or not executable"
++    fi
++}
++
++terminal_gnome()
++{
++    term_exec_key="/desktop/gnome/applications/terminal/exec"
++    term_exec_arg_key="/desktop/gnome/applications/terminal/exec_arg"
++
++    term_exec=`gconftool-2 --get ${term_exec_key}`
++    term_exec_arg=`gconftool-2 --get ${term_exec_arg_key}`
++
++    terminal_exec=`which $term_exec 2>/dev/null`
++
++    if [ -x "$terminal_exec" ]; then
++        if [ x"$1" = x"" ]; then
++            $terminal_exec
++        else
++            if [ x"$term_exec_arg" = x"" ]; then
++                $terminal_exec "$1"
++            else
++                $terminal_exec "$term_exec_arg" "$1"
++            fi
++        fi
++
++        if [ $? -eq 0 ]; then
++            exit_success
++        else
++            exit_failure_operation_failed
++        fi
++    else
++        exit_failure_operation_impossible "configured terminal program '$term_exec' not found or not executable"
++    fi
++}
++
++terminal_xfce()
++{
++    if [ x"$1" = x"" ]; then
++        exo-open --launch TerminalEmulator
++    else
++        exo-open --launch TerminalEmulator "$1"
++    fi
++
++    if [ $? -eq 0 ]; then
++        exit_success
++    else
++        exit_failure_operation_failed
++    fi
++}
++
++terminal_generic()
++{
++    # if $TERM is a known non-command, use hard-coded fallbacks
++    if [ x"$TERM" = x"" ] || [ x"$TERM" = x"linux" ] || [ x"$TERM" = x"vt100" ]; then
++        TERM=xterm
++    fi
++
++    terminal_exec=`which $TERM 2>/dev/null`
++
++    if [ -x "$terminal_exec" ]; then
++        if [ x"$1" = x"" ]; then
++            $terminal_exec
++        else
++            # screen and urxvt won't do their own parsing of quoted arguments
++            if [ x"$TERM" = x"screen" ]; then
++                # screen has an incompatible meaning for -e
++                sh -c "exec $terminal_exec $1"
++            elif [ x"$TERM" = x"urxvt" ] || [ x"$TERM" = x"rxvt-unicode" ] || [ x"$TERM" = x"rxvt" ]; then
++                #TODO: Use whatever mechanism dash supports to test for
++                #      rxvt-* to match things like rxvt-unicode-256color
++                sh -c "exec $terminal_exec -e $1"
++            else
++                $terminal_exec -e "$1"
++            fi
++        fi
++
++        if [ $? -eq 0 ]; then
++            exit_success
++        else
++            exit_failure_operation_failed
++        fi
++    else
++        exit_failure_operation_impossible "configured terminal program '$TERM' not found or not executable"
++    fi
++}
++
++terminal_lxde()
++{
++    if which lxterminal &>/dev/null; then
++        if [ x"$1" = x"" ]; then
++            lxterminal
++        else
++            lxterminal -e "$1"
++        fi
++    else
++        terminal_generic "$1"
++    fi
++}
++
++#[ x"$1" != x"" ] || exit_failure_syntax
++
++command=
++while [ $# -gt 0 ] ; do
++    parm="$1"
++    shift
++
++    case "$parm" in
++      -*)
++        exit_failure_syntax "unexpected option '$parm'"
++        ;;
++
++      *)
++        if [ -n "$command" ] ; then
++            exit_failure_syntax "unexpected argument '$parm'"
++        fi
++        command="$parm"
++        ;;
++    esac
++done
++
++detectDE
++
++if [ x"$DE" = x"" ]; then
++    DE=generic
++fi
++
++case "$DE" in
++    kde)
++    terminal_kde "$command"
++    ;;
++
++    gnome*)
++    terminal_gnome "$command"
++    ;;
++
++    xfce)
++    terminal_xfce "$command"
++    ;;
++
++    lxde)
++    terminal_lxde "$command"
++    ;;
++
++    generic)
++    terminal_generic "$command"
++    ;;
++
++    *)
++    exit_failure_operation_impossible "no terminal emulator available"
++    ;;
++esac
+-- 
+1.9.0
+
diff --git a/meta/recipes-extended/xdg-utils/xdg-utils_1.1.0-rc1.bb b/meta/recipes-extended/xdg-utils/xdg-utils_1.1.0-rc1.bb
new file mode 100644
index 0000000..46f1e3c
--- /dev/null
+++ b/meta/recipes-extended/xdg-utils/xdg-utils_1.1.0-rc1.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Basic desktop integration functions"
+
+DESCRIPTION = "The xdg-utils package is a set of simple scripts that provide basic \
+desktop integration functions for any Free Desktop, such as Linux. \
+They are intended to provide a set of defacto standards. \
+The following scripts are provided at this time: \
+xdg-desktop-icon \     
+xdg-desktop-menu \  
+xdg-email \ 
+xdg-icon-resource \
+xdg-mime \       
+xdg-open \     
+xdg-screensaver \ 
+xdg-terminal \
+"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=a5367a90934098d6b05af3b746405014"
+
+SRC_URI = "http://portland.freedesktop.org/download/${BPN}-${PV}.tar.gz \
+           file://0001-Reinstate-xdg-terminal.patch \
+          "
+
+SRC_URI[md5sum] = "fadf5e7a08e0526fc60dbe3e5b7ef8d6"
+SRC_URI[sha256sum] = "7b05558ae4bb8ede356863cae8c42e3e012aa421bf9d45130a570fd209d79102"
+
+inherit autotools-brokensep distro_features_check
+
+# The xprop requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+RDEPENDS_${PN} += "xprop"
diff --git a/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch b/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch
new file mode 100644
index 0000000..cd6e6c1
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/Disable-services-from-inetd.conf-if-a-service-with-t.patch
@@ -0,0 +1,86 @@
+Upstream-Status: Pending [from other distro Debian]
+
+From d588b6530e1382a624898b3f4307f636c72c80a9 Mon Sep 17 00:00:00 2001
+From: Pierre Habouzit <madcoder@debian.org>
+Date: Wed, 28 Nov 2007 10:13:08 +0100
+Subject: [PATCH] Disable services from inetd.conf if a service with the same id exists.
+
+  This way, if a service is enabled in /etc/xinetd* _and_ in
+/etc/inetd.conf, the one (even if disabled) from /etc/xinetd* takes
+precedence.
+
+Signed-off-by: Pierre Habouzit <madcoder@debian.org>
+---
+ xinetd/inet.c |   22 +++++++++++++++++++---
+ 1 files changed, 19 insertions(+), 3 deletions(-)
+
+diff --git a/xinetd/inet.c b/xinetd/inet.c
+index 1cb2ba2..8caab45 100644
+--- a/xinetd/inet.c
++++ b/xinetd/inet.c
+@@ -23,6 +23,8 @@
+ #include "parsesup.h"
+ #include "nvlists.h"
+ 
++static psi_h iter ;
++
+ static int get_next_inet_entry( int fd, pset_h sconfs, 
+                           struct service_config *defaults);
+ 
+@@ -32,12 +34,15 @@ void parse_inet_conf_file( int fd, struct configuration *confp )
+    struct service_config *default_config = CNF_DEFAULTS( confp );
+    
+    line_count = 0;
++   iter = psi_create (sconfs);
+ 
+    for( ;; )
+    {   
+       if (get_next_inet_entry(fd, sconfs, default_config) == -2)
+          break;
+    }
++
++   psi_destroy(iter);
+ }
+ 
+ static int get_next_inet_entry( int fd, pset_h sconfs, 
+@@ -46,7 +51,7 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+    char *p;
+    str_h strp;
+    char *line = next_line(fd);
+-   struct service_config *scp;
++   struct service_config *scp, *tmp;
+    unsigned u, i;
+    const char *func = "get_next_inet_entry";
+    char *name = NULL, *rpcvers = NULL, *rpcproto = NULL;
+@@ -405,7 +410,16 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+    SC_SPECIFY( scp, A_SOCKET_TYPE );
+    SC_SPECIFY( scp, A_WAIT );
+ 
+-   if( ! pset_add(sconfs, scp) )
++   for ( tmp = SCP( psi_start( iter ) ) ; tmp ; tmp = SCP( psi_next(iter)) ){
++      if (EQ(SC_ID(scp), SC_ID(tmp))) {
++         parsemsg(LOG_DEBUG, func, "removing duplicate service %s", SC_NAME(scp));
++         sc_free(scp);
++         scp = NULL;
++         break;
++      }
++   }
++
++   if( scp && ! pset_add(sconfs, scp) )
+    {
+       out_of_memory( func );
+       pset_destroy(args);
+@@ -414,7 +428,9 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+    }
+ 
+    pset_destroy(args);
+-   parsemsg( LOG_DEBUG, func, "added service %s", SC_NAME(scp));
++   if (scp) {
++      parsemsg( LOG_DEBUG, func, "added service %s", SC_NAME(scp));
++   }
+    return 0;
+ }
+ 
+-- 
+1.5.3.6.2040.g15e6
+
diff --git a/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch b/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch
new file mode 100644
index 0000000..8e59cdc
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/Various-fixes-from-the-previous-maintainer.patch
@@ -0,0 +1,79 @@
+Upstream-Status: Pending [from other distro Debian]
+
+From a3410b0bc81ab03a889d9ffc14e351badf8372f1 Mon Sep 17 00:00:00 2001
+From: Pierre Habouzit <madcoder@debian.org>
+Date: Mon, 26 Nov 2007 16:02:04 +0100
+Subject: [PATCH] Various fixes from the previous maintainer.
+
+---
+ xinetd/child.c   |   20 +++++++++++++++++---
+ xinetd/service.c |    8 ++++----
+ 2 files changed, 21 insertions(+), 7 deletions(-)
+
+diff --git a/xinetd/child.c b/xinetd/child.c
+index 89ee54c..48e9615 100644
+--- a/xinetd/child.c
++++ b/xinetd/child.c
+@@ -284,6 +284,7 @@ void child_process( struct server *serp )
+    connection_s            *cp  = SERVER_CONNECTION( serp ) ;
+    struct service_config   *scp = SVC_CONF( sp ) ;
+    const char              *func = "child_process" ;
++   int                     fd, null_fd;
+ 
+    signal_default_state();
+ 
+@@ -296,9 +297,22 @@ void child_process( struct server *serp )
+    signals_pending[0] = -1;
+    signals_pending[1] = -1;
+ 
+-   Sclose(0);
+-   Sclose(1);
+-   Sclose(2);
++   if ( ( null_fd = open( "/dev/null", O_RDONLY ) ) == -1 )
++   {
++      msg( LOG_ERR, func, "open('/dev/null') failed: %m") ;
++      _exit( 1 ) ;
++   }
++
++   for ( fd = 0 ; fd <= MAX_PASS_FD ; fd++ )
++   {
++      if ( fd != null_fd && dup2( null_fd, fd ) == -1 )
++      {
++         msg( LOG_ERR, func, "dup2(%d, %d) failed: %m") ;
++         _exit( 1 ) ;
++      }
++   }
++   if ( null_fd > MAX_PASS_FD )
++      (void) Sclose( null_fd ) ;
+ 
+ 
+ #ifdef DEBUG_SERVER
+diff --git a/xinetd/service.c b/xinetd/service.c
+index 3d68d78..0132d6c 100644
+--- a/xinetd/service.c
++++ b/xinetd/service.c
+@@ -745,8 +745,8 @@ static status_e failed_service(struct service *sp,
+                return FAILED;
+ 
+             if ( last == NULL ) {
+-               last = SAIN( calloc( 1, sizeof(union xsockaddr) ) );
+-	       SVC_LAST_DGRAM_ADDR(sp) = (union xsockaddr *)last;
++	    SVC_LAST_DGRAM_ADDR(sp) =  SAIN( calloc( 1, sizeof(union xsockaddr) ) );
++	    last = SAIN( SVC_LAST_DGRAM_ADDR(sp) );
+             }
+ 
+             (void) time( &current_time ) ;
+@@ -772,8 +772,8 @@ static status_e failed_service(struct service *sp,
+                return FAILED;
+ 
+ 	    if( last == NULL ) {
+-               last = SAIN6(calloc( 1, sizeof(union xsockaddr) ) );
+-	       SVC_LAST_DGRAM_ADDR( sp ) = (union xsockaddr *)last;
++	    SVC_LAST_DGRAM_ADDR(sp) = SAIN6(calloc( 1, sizeof(union xsockaddr) ) );
++            last = SAIN6(SVC_LAST_DGRAM_ADDR(sp));
+             }
+ 
+             (void) time( &current_time ) ;
+-- 
+1.5.3.6.2040.g15e6
+
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch b/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch
new file mode 100644
index 0000000..0542dbe
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd-CVE-2013-4342.patch
@@ -0,0 +1,32 @@
+xinetd: CVE-2013-4342
+
+xinetd does not enforce the user and group configuration directives
+for TCPMUX services, which causes these services to be run as root
+and makes it easier for remote attackers to gain privileges by
+leveraging another vulnerability in a service.
+http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2013-4342
+
+the patch come from:
+https://bugzilla.redhat.com/attachment.cgi?id=799732&action=diff
+
+Signed-off-by: Li Wang <li.wang@windriver.com>
+---
+ xinetd/builtins.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xinetd/builtins.c b/xinetd/builtins.c
+index 3b85579..34a5bac 100644
+--- a/xinetd/builtins.c
++++ b/xinetd/builtins.c
+@@ -617,7 +617,7 @@ static void tcpmux_handler( const struct server *serp )
+    if( SC_IS_INTERNAL( scp ) ) {
+       SC_INTERNAL(scp, nserp);
+    } else {
+-      exec_server(nserp);
++      child_process(nserp);
+    }
+ }
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch b/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch
new file mode 100644
index 0000000..2365ca1
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch
@@ -0,0 +1,112 @@
+Upstream-Status: Pending [from other distro Debian]
+
+From f44b218ccc779ab3f4aed072390ccf129d94b58d Mon Sep 17 00:00:00 2001
+From: David Madore <david@pleiades.stars>
+Date: Mon, 24 Mar 2008 12:45:36 +0100
+Subject: [PATCH] xinetd should be able to listen on IPv6 even in -inetd_compat mode
+
+xinetd does not bind to IPv6 addresses (and does not seem to have an
+option to do so) when used in -inetd_compat mode.  As current inetd's
+are IPv6-aware, this is a problem: this means xinetd cannot be used as
+a drop-in inetd replacement.
+
+The attached patch is a suggestion: it adds a -inetd_ipv6 global
+option that, if used, causes inetd-compatibility lines to have an
+implicit "IPv6" option.  Perhaps this is not the best solution, but
+there should definitely be a way to get inetd.conf to be read in
+IPv6-aware mode.
+---
+ xinetd/confparse.c |    1 +
+ xinetd/inet.c      |   17 +++++++++++++++++
+ xinetd/options.c   |    3 +++
+ xinetd/xinetd.man  |    6 ++++++
+ 4 files changed, 27 insertions(+), 0 deletions(-)
+
+diff --git a/xinetd/confparse.c b/xinetd/confparse.c
+index db9f431..d7b0bcc 100644
+--- a/xinetd/confparse.c
++++ b/xinetd/confparse.c
+@@ -40,6 +40,7 @@
+ #include "inet.h"
+ #include "main.h"
+ 
++extern int inetd_ipv6;
+ extern int inetd_compat;
+ 
+ /*
+diff --git a/xinetd/inet.c b/xinetd/inet.c
+index 8caab45..2e617ae 100644
+--- a/xinetd/inet.c
++++ b/xinetd/inet.c
+@@ -25,6 +25,8 @@
+ 
+ static psi_h iter ;
+ 
++extern int inetd_ipv6;
++
+ static int get_next_inet_entry( int fd, pset_h sconfs, 
+                           struct service_config *defaults);
+ 
+@@ -360,6 +362,21 @@ static int get_next_inet_entry( int fd, pset_h sconfs,
+          }
+          SC_SERVER_ARGV(scp)[u] = p;
+       }
++
++      /* Set the IPv6 flag if we were passed the -inetd_ipv6 option */
++      if ( inetd_ipv6 )
++      {
++         nvp = nv_find_value( service_flags, "IPv6" );
++         if ( nvp == NULL )
++         {
++            parsemsg( LOG_WARNING, func, "inetd.conf - Bad foo %s", name ) ;
++            pset_destroy(args);
++            sc_free(scp);
++            return -1;
++         }
++         M_SET(SC_XFLAGS(scp), nvp->value);
++      }
++
+       /* Set the reuse flag, as this is the default for inetd */
+       nvp = nv_find_value( service_flags, "REUSE" );
+       if ( nvp == NULL )
+diff --git a/xinetd/options.c b/xinetd/options.c
+index b058b6a..dc2f3a0 100644
+--- a/xinetd/options.c
++++ b/xinetd/options.c
+@@ -30,6 +30,7 @@ int logprocs_option ;
+ unsigned logprocs_option_arg ;
+ int stayalive_option=0;
+ char *program_name ;
++int inetd_ipv6 = 0 ;
+ int inetd_compat = 0 ;
+ int dont_fork = 0;
+ 
+@@ -128,6 +129,8 @@ int opt_recognize( int argc, char *argv[] )
+             fprintf(stderr, "\n");
+             exit(0);
+          }
++         else if ( strcmp ( &argv[ arg ][ 1 ], "inetd_ipv6" ) == 0 )
++            inetd_ipv6 = 1;
+          else if ( strcmp ( &argv[ arg ][ 1 ], "inetd_compat" ) == 0 )
+             inetd_compat = 1;
+       }
+diff --git a/xinetd/xinetd.man b/xinetd/xinetd.man
+index c76c3c6..c9dd803 100644
+--- a/xinetd/xinetd.man
++++ b/xinetd/xinetd.man
+@@ -106,6 +106,12 @@ This option causes xinetd to read /etc/inetd.conf in addition to the
+ standard xinetd config files.  /etc/inetd.conf is read after the
+ standard xinetd config files.
+ .TP
++.BI \-inetd_ipv6
++This option causes xinetd to bind to IPv6 (AF_INET6) addresses for
++inetd compatibility lines (see previous option).  This only affects
++how /etc/inetd.conf is interpreted and thus only has any effect if
++the \-inetd_compat option is also used.
++.TP
+ .BI \-cc " interval"
+ This option instructs
+ .B xinetd
+-- 
+1.5.5.rc0.127.gb4337
+
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd.conf b/meta/recipes-extended/xinetd/xinetd/xinetd.conf
new file mode 100644
index 0000000..9e6ea25
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd.conf
@@ -0,0 +1,11 @@
+# Simple configuration file for xinetd
+#
+# Some defaults, and include /etc/xinetd.d/
+
+defaults
+{
+
+
+}
+
+includedir /etc/xinetd.d
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd.default b/meta/recipes-extended/xinetd/xinetd/xinetd.default
new file mode 100644
index 0000000..20a38e3
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd.default
@@ -0,0 +1,12 @@
+# Default settings for xinetd. This file is sourced by /bin/sh from
+# /etc/init.d/xinetd
+
+# enable xinetd Inetd compat mode
+INETD_COMPAT=Yes
+
+# Options to pass to xinetd
+#
+# -stayalive comes by default : it can be removed if xinetd is expected
+# not to start when no service is configured
+#
+XINETD_OPTS="-stayalive"
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd.init b/meta/recipes-extended/xinetd/xinetd/xinetd.init
new file mode 100644
index 0000000..777c2c8
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd.init
@@ -0,0 +1,64 @@
+#!/bin/sh
+#
+# /etc/init.d/xinetd  --  script to start and stop xinetd.
+
+# Source function library.
+. /etc/init.d/functions
+
+if test -f /etc/default/xinetd; then
+	. /etc/default/xinetd
+fi
+
+
+test -x /usr/sbin/xinetd || exit 0
+
+checkportmap () {
+  if grep "^[^ *#]" /etc/xinetd.conf | grep -q 'rpc/'; then
+    if ! rpcinfo -u localhost portmapper >/dev/null 2>&1; then
+      echo
+      echo "WARNING: portmapper inactive - RPC services unavailable!"
+      echo "    Commenting out or removing the RPC services from"
+      echo "    the /etc/xinetd.conf file will remove this message."
+      echo
+    fi
+  fi
+} 
+
+case "$1" in
+    start)
+        checkportmap
+	echo -n "Starting internet superserver: xinetd"
+	start-stop-daemon --start --quiet --background --exec /usr/sbin/xinetd -- -pidfile /var/run/xinetd.pid $XINETD_OPTS
+	echo "."
+	;;
+    stop)
+	echo -n "Stopping internet superserver: xinetd"
+	start-stop-daemon --stop --signal 3 --quiet --exec /usr/sbin/xinetd
+	echo "."
+	;;
+    status)
+	status /usr/sbin/xinetd;
+	exit $?
+	;;
+    reload)
+	echo -n "Reloading internet superserver configuration: xinetd"
+	start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd
+	echo "."
+	;;
+    force-reload)
+	echo "$0 force-reload: Force Reload is deprecated"
+	echo -n "Forcefully reloading internet superserver configuration: xinetd"
+	start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/xinetd
+	echo "."
+	;;
+    restart)
+	$0 stop
+	$0 start
+	;;
+    *)
+	echo "Usage: /etc/init.d/xinetd {start|stop|status|reload|force-reload|restart}"
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd.service b/meta/recipes-extended/xinetd/xinetd/xinetd.service
new file mode 100644
index 0000000..d5fdc5b
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd/xinetd.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Xinetd A Powerful Replacement For Inetd
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/xinetd.pid
+EnvironmentFile=-/etc/sysconfig/xinetd
+ExecStart=@SBINDIR@/xinetd -stayalive -pidfile /var/run/xinetd.pid "$EXTRAOPTIONS"
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta/recipes-extended/xinetd/xinetd_2.3.15.bb b/meta/recipes-extended/xinetd/xinetd_2.3.15.bb
new file mode 100644
index 0000000..ffc03e5
--- /dev/null
+++ b/meta/recipes-extended/xinetd/xinetd_2.3.15.bb
@@ -0,0 +1,68 @@
+SUMMARY = "Socket-based service activation daemon"
+HOMEPAGE = "https://github.com/xinetd-org/xinetd"
+
+# xinetd is a BSD-like license
+# Apple and Gentoo say BSD here.
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=8ad8615198542444f84d28a6cf226dd8"
+
+DEPENDS = ""
+PR = "r2"
+
+SRC_URI = "git://github.com/xinetd-org/xinetd.git;protocol=https \
+      file://xinetd.init \
+      file://xinetd.conf \
+      file://xinetd.default \
+      file://Various-fixes-from-the-previous-maintainer.patch \
+      file://Disable-services-from-inetd.conf-if-a-service-with-t.patch \
+      file://xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch \
+      file://xinetd-CVE-2013-4342.patch \
+      file://xinetd.service \
+      "
+
+SRCREV = "68bb9ab9e9f214ad8a2322f28ac1d6733e70bc24"
+
+S = "${WORKDIR}/git"
+
+inherit autotools update-rc.d systemd
+
+SYSTEMD_SERVICE_${PN} = "xinetd.service"
+
+INITSCRIPT_NAME = "xinetd"
+INITSCRIPT_PARAMS = "defaults"
+
+EXTRA_OECONF="--disable-nls"
+
+PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG[tcp-wrappers] = "--with-libwrap,,tcp-wrappers"
+
+do_configure() {
+	# Looks like configure.in is broken, so we are skipping
+	# rebuilding configure and are just using the shipped one
+	( cd ${S}; gnu-configize --force )
+	oe_runconf
+}
+
+do_install() {
+	# Same here, the Makefile does some really stupid things,
+	# but since we only want two files why not override
+	# do_install from autotools and doing it ourselfs?
+	install -d "${D}${sbindir}"
+	install -d "${D}${sysconfdir}/init.d"
+	install -d "${D}${sysconfdir}/xinetd.d"
+	install -d "${D}${sysconfdir}/default"
+	install -m 644 "${WORKDIR}/xinetd.conf" "${D}${sysconfdir}"
+	install -m 755 "${WORKDIR}/xinetd.init" "${D}${sysconfdir}/init.d/xinetd"
+	install -m 644 "${WORKDIR}/xinetd.default" "${D}${sysconfdir}/default/xinetd"
+	install -m 755 "${B}/xinetd/xinetd" "${D}${sbindir}"
+	install -m 755 "${B}/xinetd/itox" "${D}${sbindir}"
+
+	# Install systemd unit files
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/xinetd.service ${D}${systemd_unitdir}/system
+	sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+	       -e 's,@SBINDIR@,${sbindir},g' \
+	       ${D}${systemd_unitdir}/system/xinetd.service
+}
+
+CONFFILES_${PN} = "${sysconfdir}/xinetd.conf"
diff --git a/meta/recipes-extended/xz/xz_5.2.1.bb b/meta/recipes-extended/xz/xz_5.2.1.bb
new file mode 100644
index 0000000..e0ae48f
--- /dev/null
+++ b/meta/recipes-extended/xz/xz_5.2.1.bb
@@ -0,0 +1,36 @@
+SUMMARY = "Utilities for managing LZMA compressed files"
+HOMEPAGE = "http://tukaani.org/xz/"
+SECTION = "base"
+
+# The source includes bits of PD, GPLv2, GPLv3, LGPLv2.1+, but the only file
+# which is GPLv3 is an m4 macro which isn't shipped in any of our packages,
+# and the LGPL bits are under lib/, which appears to be used for libgnu, which
+# appears to be used for DOS builds. So we're left with GPLv2+ and PD.
+LICENSE = "GPLv2+ & GPLv3+ & LGPLv2.1+ & PD"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_${PN}-dev = "GPLv2+"
+LICENSE_${PN}-staticdev = "GPLv2+"
+LICENSE_${PN}-doc = "GPLv2+"
+LICENSE_${PN}-dbg = "GPLv2+"
+LICENSE_${PN}-locale = "GPLv2+"
+LICENSE_liblzma = "PD"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c475b6c7dca236740ace4bba553e8e1c \
+                    file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://COPYING.LGPLv2.1;md5=4fbd65380cdd255951079008b364516c \
+                    file://lib/getopt.c;endline=23;md5=2069b0ee710572c03bb3114e4532cd84 "
+
+SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.gz"
+SRC_URI[md5sum] = "3e44c766c3fb4f19e348e646fcd5778a"
+SRC_URI[sha256sum] = "b918b6648076e74f8d7ae19db5ee663df800049e187259faf5eb997a7b974681"
+
+inherit autotools gettext
+
+PACKAGES =+ "liblzma"
+
+FILES_liblzma = "${libdir}/liblzma*${SOLIBS}"
+
+BBCLASSEXTEND = "native nativesdk"
+
+export CONFIG_SHELL="/bin/sh"
diff --git a/meta/recipes-extended/zip/zip.inc b/meta/recipes-extended/zip/zip.inc
new file mode 100644
index 0000000..6221c5e
--- /dev/null
+++ b/meta/recipes-extended/zip/zip.inc
@@ -0,0 +1,26 @@
+SUMMARY = "Compressor/archiver for creating and modifying .zip files"
+HOMEPAGE = "http://www.info-zip.org"
+SECTION = "console/utils"
+
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=04d43c5d70b496c032308106e26ae17d"
+
+SRC_URI = "ftp://ftp.info-zip.org/pub/infozip/src/zip${@d.getVar('PV',1).replace('.', '')}.tgz"
+
+EXTRA_OEMAKE = "'CC=${CC}' 'BIND=${CC}' 'AS=${CC} -c' 'CPP=${CPP}' \
+		'CFLAGS=-I. -DUNIX ${CFLAGS}' 'INSTALL=install' \
+		'BINFLAGS=0755' 'INSTALL_D=install -d'"
+
+do_compile() {
+	oe_runmake -f unix/Makefile flags IZ_BZIP2=no_such_directory
+	sed -i 's#LFLAGS1=""#LFLAGS1="${LDFLAGS}"#' flags
+	oe_runmake -f unix/Makefile generic IZ_BZIP2=no_such_directory
+}
+
+do_install() {
+	oe_runmake -f unix/Makefile prefix=${D}${prefix} \
+		   BINDIR=${D}${bindir} MANDIR=${D}${mandir}/man1 \
+		   install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-extended/zip/zip_3.0.bb b/meta/recipes-extended/zip/zip_3.0.bb
new file mode 100644
index 0000000..1e96110
--- /dev/null
+++ b/meta/recipes-extended/zip/zip_3.0.bb
@@ -0,0 +1,15 @@
+require zip.inc
+
+PR="r2"
+
+# zip-2.32 still uses directory name of zip-2.30
+S = "${WORKDIR}/zip30"
+
+SRC_URI[md5sum] = "7b74551e63f8ee6aab6fbc86676c0d37"
+SRC_URI[sha256sum] = "f0e8bb1f9b7eb0b01285495a2699df3a4b766784c1765a8f1aeedf63c0806369"
+
+# zip.inc sets CFLAGS, but what Makefile actually uses is
+# CFLAGS_NOOPT.  It will also force -O3 optimization, overriding
+# whatever we set.
+#
+EXTRA_OEMAKE_append = " 'CFLAGS_NOOPT=-I. -DUNIX ${CFLAGS}'"
diff --git a/meta/recipes-gnome/epiphany/epiphany_3.16.3.bb b/meta/recipes-gnome/epiphany/epiphany_3.16.3.bb
new file mode 100644
index 0000000..506fb25
--- /dev/null
+++ b/meta/recipes-gnome/epiphany/epiphany_3.16.3.bb
@@ -0,0 +1,24 @@
+SUMMARY = "WebKit based web browser for GNOME"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+DEPENDS = "libsoup-2.4 webkitgtk gtk+3 iso-codes ca-certificates avahi libnotify gcr libwnck3 \
+	   gsettings-desktop-schemas gnome-desktop3"
+
+inherit gnomebase gsettings
+SRC_URI += "file://0001-yelp.m4-drop-the-check-for-itstool.patch"
+SRC_URI[archive.md5sum] = "3296af4532b8019775f4b40d21a341ae"
+SRC_URI[archive.sha256sum] = "d527f1770779ec22d955aeb13b148a846a26144e433ff0480c981af80e2390b1"
+
+EXTRA_OECONF += " --disable-nss --with-distributor-name=${DISTRO}"
+
+do_configure_prepend() {
+    touch ${S}/gnome-doc-utils.make
+    sed -i -e s:help::g ${S}/Makefile.am
+}
+
+FILES_${PN} += "${datadir}/appdata ${datadir}/dbus-1 ${datadir}/gnome-shell/search-providers"
+FILES_${PN}-dbg += "${libdir}/epiphany/*/web-extensions/.debug/libephywebextension.so"
+RDEPENDS_${PN} = "iso-codes adwaita-icon-theme"
+RRECOMMENDS_${PN} = "ca-certificates"
+
diff --git a/meta/recipes-gnome/epiphany/files/0001-yelp.m4-drop-the-check-for-itstool.patch b/meta/recipes-gnome/epiphany/files/0001-yelp.m4-drop-the-check-for-itstool.patch
new file mode 100644
index 0000000..2585d7f
--- /dev/null
+++ b/meta/recipes-gnome/epiphany/files/0001-yelp.m4-drop-the-check-for-itstool.patch
@@ -0,0 +1,33 @@
+From 30f03a256efe375a4d5c3a24bf4168ebf380e3ab Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 30 Jul 2015 15:13:23 +0300
+Subject: [PATCH] yelp.m4: drop the check for itstool
+
+It isn't used for anything during build, so there's no need to provide
+it as a recipe.
+
+Upstream-Status: Inappropriate [tarball-specific issue]
+---
+ m4/yelp.m4 | 6 ------
+ 1 file changed, 6 deletions(-)
+
+diff --git a/m4/yelp.m4 b/m4/yelp.m4
+index 5db847f..1b6ede4 100644
+--- a/m4/yelp.m4
++++ b/m4/yelp.m4
+@@ -27,12 +27,6 @@ AC_ARG_WITH([help-dir],
+ HELP_DIR="$with_help_dir"
+ AC_SUBST(HELP_DIR)
+ 
+-AC_ARG_VAR([ITSTOOL], [Path to the `itstool` command])
+-AC_CHECK_PROG([ITSTOOL], [itstool], [itstool])
+-if test x"$ITSTOOL" = x; then
+-  AC_MSG_ERROR([itstool not found])
+-fi
+-
+ AC_ARG_VAR([XMLLINT], [Path to the `xmllint` command])
+ AC_CHECK_PROG([XMLLINT], [xmllint], [xmllint])
+ if test x"$XMLLINT" = x; then
+-- 
+2.1.4
+
diff --git a/meta/recipes-gnome/gcr/gcr_3.16.0.bb b/meta/recipes-gnome/gcr/gcr_3.16.0.bb
new file mode 100644
index 0000000..8b5b6e4
--- /dev/null
+++ b/meta/recipes-gnome/gcr/gcr_3.16.0.bb
@@ -0,0 +1,18 @@
+SUMMARY = "A library for bits of crypto UI and parsing etc"
+HOMEPAGE = "http://www.gnome.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605"
+
+DEPENDS = "gtk+3 p11-kit glib-2.0 libgcrypt vala"
+
+inherit autotools gnomebase gtk-icon-cache gtk-doc
+
+SRC_URI[archive.md5sum] = "d5835680be0b6a838e02a528d5378d9c"
+SRC_URI[archive.sha256sum] = "ecfe8df41cc88158364bb15addc670b11e539fe844742983629ba2323888d075"
+
+FILES_${PN} += " \
+    ${datadir}/dbus-1 \
+    ${datadir}/gcr-3 \
+"
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-pixops-Be-more-careful-about-integer-overflow.patch b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-pixops-Be-more-careful-about-integer-overflow.patch
new file mode 100644
index 0000000..fe7c1d5
--- /dev/null
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/0001-pixops-Be-more-careful-about-integer-overflow.patch
@@ -0,0 +1,89 @@
+From ffec86ed5010c5a2be14f47b33bcf4ed3169a199 Mon Sep 17 00:00:00 2001
+From: Matthias Clasen <mclasen@redhat.com>
+Date: Mon, 13 Jul 2015 00:33:40 -0400
+Subject: [PATCH] pixops: Be more careful about integer overflow
+
+Our loader code is supposed to handle out-of-memory and overflow
+situations gracefully, reporting errors instead of aborting. But
+if you load an image at a specific size, we also execute our
+scaling code, which was not careful enough about overflow in some
+places.
+
+This commit makes the scaling code silently return if it fails to
+allocate filter tables. This is the best we can do, since
+gdk_pixbuf_scale() is not taking a GError.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=752297
+
+Upstream-Status: backport
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ gdk-pixbuf/pixops/pixops.c |   22 +++++++++++++++++-----
+ 1 file changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/gdk-pixbuf/pixops/pixops.c b/gdk-pixbuf/pixops/pixops.c
+index 29a1c14..ce51745 100644
+--- a/gdk-pixbuf/pixops/pixops.c
++++ b/gdk-pixbuf/pixops/pixops.c
+@@ -1272,7 +1272,16 @@ make_filter_table (PixopsFilter *filter)
+   int i_offset, j_offset;
+   int n_x = filter->x.n;
+   int n_y = filter->y.n;
+-  int *weights = g_new (int, SUBSAMPLE * SUBSAMPLE * n_x * n_y);
++  gsize n_weights;
++  int *weights;
++
++  n_weights = SUBSAMPLE * SUBSAMPLE * n_x * n_y;
++  if (n_weights / (SUBSAMPLE * SUBSAMPLE * n_x) != n_y)
++    return NULL; /* overflow, bail */
++
++  weights = g_try_new (int, n_weights);
++  if (!weights)
++    return NULL; /* overflow, bail */
+ 
+   for (i_offset=0; i_offset < SUBSAMPLE; i_offset++)
+     for (j_offset=0; j_offset < SUBSAMPLE; j_offset++)
+@@ -1347,8 +1356,11 @@ pixops_process (guchar         *dest_buf,
+   if (x_step == 0 || y_step == 0)
+     return; /* overflow, bail out */
+ 
+-  line_bufs = g_new (guchar *, filter->y.n);
+   filter_weights = make_filter_table (filter);
++  if (!filter_weights)
++    return; /* overflow, bail out */
++
++  line_bufs = g_new (guchar *, filter->y.n);
+ 
+   check_shift = check_size ? get_check_shift (check_size) : 0;
+ 
+@@ -1468,7 +1480,7 @@ tile_make_weights (PixopsFilterDimension *dim,
+ 		   double                 scale)
+ {
+   int n = ceil (1 / scale + 1);
+-  double *pixel_weights = g_new (double, SUBSAMPLE * n);
++  double *pixel_weights = g_malloc_n (sizeof (double) * SUBSAMPLE, n);
+   int offset;
+   int i;
+ 
+@@ -1526,7 +1538,7 @@ bilinear_magnify_make_weights (PixopsFilterDimension *dim,
+     }
+ 
+   dim->n = n;
+-  dim->weights = g_new (double, SUBSAMPLE * n);
++  dim->weights = g_malloc_n (sizeof (double) * SUBSAMPLE, n);
+ 
+   pixel_weights = dim->weights;
+ 
+@@ -1617,7 +1629,7 @@ bilinear_box_make_weights (PixopsFilterDimension *dim,
+ 			   double                 scale)
+ {
+   int n = ceil (1/scale + 3.0);
+-  double *pixel_weights = g_new (double, SUBSAMPLE * n);
++  double *pixel_weights = g_malloc_n (sizeof (double) * SUBSAMPLE, n);
+   double w;
+   int offset, i;
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/extending-libinstall-dependencies.patch b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/extending-libinstall-dependencies.patch
new file mode 100644
index 0000000..edbdced
--- /dev/null
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/extending-libinstall-dependencies.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Pending
+
+This patch fixes parallel install issue that lib libpixbufloader-png.la
+depends on libgdk_pixbuf-2.0.la which will be regenerated during insta-
+llation, if libgdk_pixbuf-2.0.la is regenerating and at the same time
+libpixbufloader-png.la links it, the error will happen.
+
+Error message is:
+* usr/bin/ld: cannot find -lgdk_pixbuf-2.0
+* collect2: ld returned 1 exit status
+
+Make an explicit dependency to the libs install targets would fix this
+issue.
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ gdk-pixbuf/Makefile.am |    1 +
+ libdeps.mk             |    3 +++
+ 2 files changed, 4 insertions(+), 0 deletions(-)
+ create mode 100644 libdeps.mk
+
+diff --git a/gdk-pixbuf/Makefile.am b/gdk-pixbuf/Makefile.am
+index 95a93a8..db44cae 100644
+--- a/gdk-pixbuf/Makefile.am
++++ b/gdk-pixbuf/Makefile.am
+@@ -783,3 +783,4 @@ loaders.cache:
+ endif
+ 
+ -include $(top_srcdir)/git.mk
++-include $(top_srcdir)/libdeps.mk
+diff --git a/libdeps.mk b/libdeps.mk
+new file mode 100644
+index 0000000..d7a10a8
+--- /dev/null
++++ b/libdeps.mk
+@@ -0,0 +1,3 @@
++# Extending dependencies of install-loaderLTLIBRARIES:
++# The $(lib-LTLIBRARIES) is needed by relinking $(loader_LTLIBRARIES)
++install-loaderLTLIBRARIES: install-libLTLIBRARIES
+-- 
+1.7.6.1
+
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch
new file mode 100644
index 0000000..70146c6
--- /dev/null
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/fatal-loader.patch
@@ -0,0 +1,79 @@
+If an environment variable is specified set the return value from main() to
+non-zero if the loader had errors (missing libraries, generally).
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c
+index a9ca015..395674a 100644
+--- a/gdk-pixbuf/queryloaders.c
++++ b/gdk-pixbuf/queryloaders.c
+@@ -146,7 +146,7 @@ write_loader_info (GString *contents, const char *path, GdkPixbufFormat *info)
+         g_string_append_c (contents, '\n');
+ }
+ 
+-static void
++static gboolean
+ query_module (GString *contents, const char *dir, const char *file)
+ {
+         char *path;
+@@ -155,6 +155,7 @@ query_module (GString *contents, const char *dir, const char *file)
+         void                    (*fill_vtable)   (GdkPixbufModule *module);
+         gpointer fill_info_ptr;
+         gpointer fill_vtable_ptr;
++        gboolean ret = TRUE;
+ 
+         if (g_path_is_absolute (file))
+                 path = g_strdup (file);
+@@ -204,10 +205,13 @@ query_module (GString *contents, const char *dir, const char *file)
+                                    g_module_error());
+                 else
+                         g_fprintf (stderr, "Cannot load loader %s\n", path);
++                ret = FALSE;
+         }
+         if (module)
+                 g_module_close (module);
+         g_free (path);
++
++        return ret;
+ }
+ 
+ #ifdef G_OS_WIN32
+@@ -257,6 +261,7 @@ int main (int argc, char **argv)
+         GString *contents;
+         gchar *cache_file = NULL;
+         gint first_file = 1;
++        gboolean success = TRUE;
+ 
+ #ifdef G_OS_WIN32
+         gchar *libdir;
+@@ -360,7 +365,8 @@ int main (int argc, char **argv)
+                                 gint len = strlen (dent);
+                                 if (len > SOEXT_LEN &&
+                                     strcmp (dent + len - SOEXT_LEN, SOEXT) == 0) {
+-                                        query_module (contents, path, dent);
++                                        if (!query_module (contents, path, dent))
++                                                success = FALSE;
+                                 }
+                         }
+                         g_dir_close (dir);
+@@ -378,7 +384,8 @@ int main (int argc, char **argv)
+                         infilename = g_locale_to_utf8 (infilename,
+                                                        -1, NULL, NULL, NULL);
+ #endif
+-                        query_module (contents, cwd, infilename);
++                        if (!query_module (contents, cwd, infilename))
++                                success = FALSE;
+                 }
+                 g_free (cwd);
+         }
+@@ -394,5 +401,8 @@ int main (int argc, char **argv)
+         else
+                 g_print ("%s\n", contents->str);
+ 
+-        return 0;
++        if (g_getenv ("GDK_PIXBUF_FATAL_LOADER"))
++                return success ? 0 : 1;
++        else
++                return 0;
+ }
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/hardcoded_libtool.patch b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/hardcoded_libtool.patch
new file mode 100644
index 0000000..ecca62a
--- /dev/null
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/hardcoded_libtool.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: gdk-pixbuf-2.22.1/configure.ac
+===================================================================
+--- gdk-pixbuf-2.22.1.orig/configure.ac	2010-11-26 09:06:34.000000000 +0800
++++ gdk-pixbuf-2.22.1/configure.ac	2010-11-26 09:07:33.000000000 +0800
+@@ -287,7 +287,7 @@
+ case $enable_explicit_deps in
+   auto)
+     export SED
+-    deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
++    deplibs_check_method=`(./$host_alias-libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
+     if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then
+       enable_explicit_deps=yes
+     else
+@@ -484,7 +484,7 @@
+     dnl Now we check to see if our libtool supports shared lib deps
+     dnl (in a rather ugly way even)
+     if $dynworks; then
+-        pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
++        pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} ./$host_alias-libtool --config"
+         pixbuf_deplibs_check=`$pixbuf_libtool_config | \
+             grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
+             sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
+@@ -957,7 +957,7 @@
+ # We are using gmodule-no-export now, but I'm leaving the stripping
+ # code in place for now, since pango and atk still require gmodule.
+ export SED
+-export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++export_dynamic=`(./$host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ if test -n "$export_dynamic"; then
+   GDK_PIXBUF_DEP_LIBS=`echo $GDK_PIXBUF_DEP_LIBS | sed -e "s/$export_dynamic//"`
+ fi
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/run-ptest b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/run-ptest
new file mode 100644
index 0000000..8f90723
--- /dev/null
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf/run-ptest
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+gnome-desktop-testing-runner gdk-pixbuf
diff --git a/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb
new file mode 100644
index 0000000..07c2dce
--- /dev/null
+++ b/meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.30.8.bb
@@ -0,0 +1,97 @@
+SUMMARY = "Image loading library for GTK+"
+HOMEPAGE = "http://www.gtk.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+                    file://gdk-pixbuf/gdk-pixbuf.h;endline=26;md5=72b39da7cbdde2e665329fef618e1d6b"
+
+SECTION = "libs"
+
+DEPENDS = "glib-2.0"
+DEPENDS_append_linuxstdbase = " virtual/libx11"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+           file://hardcoded_libtool.patch \
+           file://extending-libinstall-dependencies.patch \
+           file://run-ptest \
+           file://fatal-loader.patch \
+           file://0001-pixops-Be-more-careful-about-integer-overflow.patch \
+           "
+
+SRC_URI[md5sum] = "4fed0d54432f1b69fc6e66e608bd5542"
+SRC_URI[sha256sum] = "4853830616113db4435837992c0aebd94cbb993c44dc55063cee7f72a7bef8be"
+
+inherit autotools pkgconfig gettext pixbufcache ptest-gnome
+
+LIBV = "2.10.0"
+
+GDK_PIXBUF_LOADERS ?= "png jpeg"
+
+PACKAGECONFIG ??= "${GDK_PIXBUF_LOADERS}"
+PACKAGECONFIG_linuxstdbase = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} ${GDK_PIXBUF_LOADERS}"
+PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
+
+PACKAGECONFIG[png] = "--with-libpng,--without-libpng,libpng"
+PACKAGECONFIG[jpeg] = "--with-libjpeg,--without-libjpeg,jpeg"
+PACKAGECONFIG[tiff] = "--with-libtiff,--without-libtiff,tiff"
+PACKAGECONFIG[jpeg2000] = "--with-libjasper,--without-libjasper,jasper"
+
+# Use GIO to sniff image format instead of trying all loaders
+PACKAGECONFIG[gio-sniff] = "--enable-gio-sniffing,--disable-gio-sniffing,,shared-mime-info"
+PACKAGECONFIG[x11] = "--with-x11,--without-x11,virtual/libx11"
+
+EXTRA_OECONF = "--disable-introspection"
+
+PACKAGES =+ "${PN}-xlib"
+
+FILES_${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
+ALLOW_EMPTY_${PN}-xlib = "1"
+
+FILES_${PN} = "${bindir}/gdk-pixbuf-query-loaders \
+	${bindir}/gdk-pixbuf-pixdata \
+	${libdir}/lib*.so.*"
+
+FILES_${PN}-dev += " \
+	${bindir}/gdk-pixbuf-csource \
+	${includedir}/* \
+	${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.la \
+"
+
+FILES_${PN}-dbg += " \
+        ${libdir}/.debug/* \
+	${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/.debug/* \
+"
+
+PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*"
+PACKAGES_DYNAMIC_class-native = ""
+
+python populate_packages_prepend () {
+    postinst_pixbufloader = d.getVar("postinst_pixbufloader", True)
+
+    loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders')
+
+    packages = ' '.join(do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
+    d.setVar('PIXBUF_PACKAGES', packages)
+
+    # The test suite exercises all the loaders, so ensure they are all
+    # dependencies of the ptest package.
+    d.appendVar("RDEPENDS_gdk-pixbuf-ptest", " " + packages)
+}
+
+do_install_append_class-native() {
+	find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
+
+	create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
+
+	create_wrapper ${D}/${bindir}/gdk-pixbuf-pixdata \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
+
+	create_wrapper ${D}/${bindir}/gdk-pixbuf-query-loaders \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
+		GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
+}
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.16.2.bb b/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.16.2.bb
new file mode 100644
index 0000000..1f2f06c
--- /dev/null
+++ b/meta/recipes-gnome/gnome-desktop/gnome-desktop3_3.16.2.bb
@@ -0,0 +1,21 @@
+SUMMARY = "GNOME library for reading .desktop files"
+SECTION = "x11/gnome"
+LICENSE = "GPLv2 & LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.LIB;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+BPN = "gnome-desktop"
+
+inherit gnome pkgconfig
+SRC_URI[archive.md5sum] = "ab5bf4cc94ad63639f42adcc1542b1f0"
+SRC_URI[archive.sha256sum] = "3a8f196b46eb9dbd3ba2afb8fb5fef6a8825539d449a02181311242e22227bd0"
+
+DEPENDS += "gsettings-desktop-schemas gconf libxrandr virtual/libx11 gtk+3 glib-2.0 gnome-doc-utils gnome-common startup-notification iso-codes"
+
+EXTRA_OECONF = "--disable-desktop-docs"
+
+PACKAGES =+ "libgnome-desktop3"
+FILES_libgnome-desktop3 = "${libdir}/lib*${SOLIBS} ${datadir}/libgnome-desktop*/pnp.ids ${datadir}/gnome/*xml"
+
+RRECOMMENDS_libgnome-desktop3 += "gsettings-desktop-schemas"
+
diff --git a/meta/recipes-gnome/gnome/adwaita-icon-theme/Create-symlinks-when-installing-cursors.patch b/meta/recipes-gnome/gnome/adwaita-icon-theme/Create-symlinks-when-installing-cursors.patch
new file mode 100644
index 0000000..446f9c9
--- /dev/null
+++ b/meta/recipes-gnome/gnome/adwaita-icon-theme/Create-symlinks-when-installing-cursors.patch
@@ -0,0 +1,178 @@
+Create symlinks when installing cursors
+
+This cuts down the installed size by ~11MB.
+
+Upstream-Status: Backport
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+From 1e8c0dd0a2de5e1d5ff60ff11f131e88510c7f50 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?=
+ =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com>
+Date: Sat, 16 May 2015 07:49:19 +0000
+Subject: [PATCH] Create symlinks when installing cursors
+
+Also support creating symlinks for W32 cursors (including L and XL variants).
+
+https://bugzilla.gnome.org/show_bug.cgi?id=749223
+---
+ Makefile.am  | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ configure.ac | 24 ++++++++++++++++
+ 2 files changed, 117 insertions(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index fed3972..4d00268 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -6,6 +6,17 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+ 
+ cursordir = $(datadir)/icons/Adwaita/cursors
+ cursor_DATA = $(wildcard $(srcdir)/Adwaita/cursors/*)
++if ENABLE_L_XL_VARIANTS
++cursorldir = $(datadir)/icons/Adwaita-Large/cursors
++cursorl_DATA = $(wildcard $(srcdir)/Adwaita-Large/cursors/*)
++cursorxldir = $(datadir)/icons/Adwaita-ExtraLarge/cursors
++cursorxl_DATA = $(wildcard $(srcdir)/Adwaita-ExtraLarge/cursors/*)
++else
++cursorldir =
++cursorl_DATA =
++cursorxldir =
++cursorxl_DATA =
++endif
+ 
+ theme_in_files = index.theme.in.in
+ theme_DATA = $(theme_in_files:.theme.in.in=.theme)
+@@ -99,6 +110,88 @@ install-data-local:
+ 	fi
+ 
+ install-data-hook:
++	cd $(DESTDIR)$(cursordir) && \
++	if test "x$(enable_w32_cursors)" = "xyes"; \
++	then \
++		cur=.cur && \
++		ani=.ani; \
++	else \
++		cur= && \
++		ani= ; \
++	fi; \
++	if test "x$(enable_l_xl_variants)" = "xyes"; \
++	then \
++		themedirs="$(cursordir) $(cursorldir) $(cursorxldir)"; \
++	else \
++		themedirs="$(cursordir)"; \
++	fi; \
++	for d in $$themedirs; \
++	do \
++		cd $(DESTDIR)$$d && \
++		echo Creating symlinks in $(DESTDIR)$$d && \
++		$(LN_S) -f  dotbox$$cur			draped_box$$cur && \
++		$(LN_S) -f  dotbox$$cur			icon$$cur && \
++		$(LN_S) -f  dotbox$$cur			target$$cur && \
++		$(LN_S) -f  dotbox$$cur			dot_box_mask$$cur && \
++		$(LN_S) -f  X_cursor$$cur		pirate$$cur && \
++		$(LN_S) -f  left_ptr_watch$$ani		08e8e1c95fe2fc01f976f1e063a24ccd$$ani && \
++		$(LN_S) -f  left_ptr_watch$$ani		3ecb610c1bf2410f44200f48c40d3599$$ani && \
++		$(LN_S) -f  left_ptr$$cur		arrow$$cur && \
++		$(LN_S) -f  left_ptr$$cur		top_left_arrow$$cur && \
++		$(LN_S) -f  right_ptr$$cur		draft_large$$cur && \
++		$(LN_S) -f  right_ptr$$cur		draft_small$$cur && \
++		$(LN_S) -f  move$$cur			4498f0e0c1937ffe01fd06f973665830$$cur && \
++		$(LN_S) -f  move$$cur			9081237383d90e509aa00f00170e968f$$cur && \
++		$(LN_S) -f  copy$$cur			1081e37283d90000800003c07f3ef6bf$$cur && \
++		$(LN_S) -f  copy$$cur			6407b0e94181790501fd1e167b474872$$cur && \
++		$(LN_S) -f  cross$$cur			cross_reverse$$cur && \
++		$(LN_S) -f  cross$$cur			diamond_cross$$cur && \
++		$(LN_S) -f  hand1$$cur			grab$$cur && \
++		$(LN_S) -f  hand2$$cur			9d800788f1b08800ae810202380a0822$$cur && \
++		$(LN_S) -f  hand2$$cur			e29285e634086352946a0e7090d73106$$cur && \
++		$(LN_S) -f  hand2$$cur			hand$$cur && \
++		$(LN_S) -f  grabbing$$cur		fleur$$cur && \
++		$(LN_S) -f  question_arrow$$cur		d9ce0ab605698f320427677b458ad60b$$cur && \
++		$(LN_S) -f  question_arrow$$cur		5c6cd98b3f3ebcb1f9c7f1c204630408$$cur && \
++		$(LN_S) -f  question_arrow$$cur		help$$cur && \
++		$(LN_S) -f  question_arrow$$cur		left_ptr_help$$cur && \
++		$(LN_S) -f  link$$cur			3085a0e285430894940527032f8b26df$$cur && \
++		$(LN_S) -f  link$$cur			640fb0e74195791501fd1ed57b41487f$$cur && \
++		$(LN_S) -f  crossed_circle$$cur		03b6e0fcb3499374a867c041f52298f0$$cur && \
++		$(LN_S) -f  fd_double_arrow$$cur	fcf1c3c7cd4491d801f1e1c78f100000$$cur && \
++		$(LN_S) -f  bd_double_arrow$$cur	c7088f0f3e6c8088236ef8e1e3e70000$$cur && \
++		$(LN_S) -f  sb_h_double_arrow$$cur 	h_double_arrow$$cur && \
++		$(LN_S) -f  sb_h_double_arrow$$cur	14fef782d02440884392942c11205230$$cur && \
++		$(LN_S) -f  h_double_arrow$$cur		028006030e0e7ebffc7f7070c0600140$$cur && \
++		$(LN_S) -f  sb_v_double_arrow$$cur 	double_arrow$$cur && \
++		$(LN_S) -f  sb_v_double_arrow$$cur 	v_double_arrow$$cur && \
++		$(LN_S) -f  sb_v_double_arrow$$cur	2870a09082c103050810ffdffffe0204$$cur && \
++		$(LN_S) -f  v_double_arrow$$cur		00008160000006810000408080010102$$cur && \
++		$(LN_S) -f  left_ptr$$cur		default$$cur && \
++		$(LN_S) -f  hand$$cur			pointer$$cur && \
++		$(LN_S) -f  left_ptr_watch$$ani		progress$$ani && \
++		$(LN_S) -f  watch$$ani			wait$$ani && \
++		$(LN_S) -f  cross$$cur			crosshair$$cur && \
++		$(LN_S) -f  xterm$$cur			text$$cur && \
++		$(LN_S) -f  dnd-link$$cur		alias$$cur && \
++		$(LN_S) -f  dnd-copy$$cur		copy$$cur && \
++		$(LN_S) -f  dnd-none$$cur		no-drop$$cur && \
++		$(LN_S) -f  crossed_circle$$cur		not-allowed$$cur && \
++		$(LN_S) -f  sb_h_double_arrow$$cur	col-resize$$cur && \
++		$(LN_S) -f  sb_v_double_arrow$$cur	row-resize$$cur && \
++		$(LN_S) -f  top_side$$cur		n-resize$$cur && \
++		$(LN_S) -f  right_side$$cur		e-resize$$cur && \
++		$(LN_S) -f  bottom_side$$cur		s-resize$$cur && \
++		$(LN_S) -f  left_side$$cur		w-resize$$cur && \
++		$(LN_S) -f  top_right_corner$$cur	ne-resize$$cur && \
++		$(LN_S) -f  top_left_corner$$cur	nw-resize$$cur && \
++		$(LN_S) -f  bottom_right_corner$$cur	se-resize$$cur && \
++		$(LN_S) -f  bottom_left_corner$$cur	sw-resize$$cur && \
++		$(LN_S) -f  sb_h_double_arrow$$cur	ew-resize$$cur && \
++		$(LN_S) -f  sb_v_double_arrow$$cur	ns-resize$$cur && \
++		$(LN_S) -f  fd_double_arrow$$cur	nesw-resize$$cur && \
++		$(LN_S) -f  bd_double_arrow$$cur	nwse-resize$$cur; \
++	done
+ 	if test -z "$(DESTDIR)" && test -n "$(GTK_UPDATE_ICON_CACHE)" ; then \
+ 		$(GTK_UPDATE_ICON_CACHE) -q $(DESTDIR)$(themedir); \
+ 	fi
+diff --git a/configure.ac b/configure.ac
+index 9e4d8a0..312b24c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -31,6 +31,7 @@ AC_SUBST([render_sizes], ["8x8 16x16 22x22 24x24 32x32 48x48 256x256"])
+ AC_SUBST([symbolic_render_sizes], [""])
+ AC_SUBST([install_sizes], ["8x8 16x16 22x22 24x24 32x32 48x48 64x64 96x96 256x256"])
+ 
++AC_PROG_LN_S
+ AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache)
+ 
+ # need git, icontool, and inkscape for rendering
+@@ -56,6 +57,29 @@ if test "x$GTK_ENCODE_SYMBOLIC_SVG" = "xfalse"; then
+ fi
+ AC_SUBST(symbolic_encode_sizes)
+ 
++AC_ARG_ENABLE([w32-cursors],
++  [AS_HELP_STRING([--enable-w32-cursors],
++    [Make and install Windows cursors (.cur and .ani) instead of X cursors])],
++  [case "${enableval}" in
++    yes) enable_w32_cursors=yes ;;
++    no)  enable_w32_cursors=no ;;
++    *) AC_MSG_ERROR([bad value ${enableval} for --enable-w32-cursors]) ;;
++   esac],
++  [enable_w32_cursors=no])
++AC_SUBST(enable_w32_cursors)
++
++AC_ARG_ENABLE([l-xl-variants],
++  [AS_HELP_STRING([--enable-l-xl-variants],
++    [Also make and install Large and Extra Large Windows cursor versions])],
++  [case "${enableval}" in
++    yes) enable_l_xl_variants=yes ;;
++    no)  enable_l_xl_variants=no ;;
++    *) AC_MSG_ERROR([bad value ${enableval} for --enable-l-xl-variants]) ;;
++   esac],
++  [enable_l_xl_variants=no])
++AC_SUBST(enable_l_xl_variants)
++AM_CONDITIONAL([ENABLE_L_XL_VARIANTS], [test x$enable_l_xl_variants = xyes])
++
+ AC_CONFIG_FILES([
+ Makefile
+ adwaita-icon-theme.pc
+-- 
+2.1.4
+
diff --git a/meta/recipes-gnome/gnome/adwaita-icon-theme_3.16.2.1.bb b/meta/recipes-gnome/gnome/adwaita-icon-theme_3.16.2.1.bb
new file mode 100644
index 0000000..526e699
--- /dev/null
+++ b/meta/recipes-gnome/gnome/adwaita-icon-theme_3.16.2.1.bb
@@ -0,0 +1,34 @@
+SUMMARY = "GTK+ icon theme"
+HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/adwaita-icon-theme/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "x11/gnome"
+
+LICENSE = "LGPL-3.0 | CC-BY-SA-3.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c84cac88e46fc07647ea07e6c24eeb7c"
+
+inherit allarch autotools pkgconfig gettext gtk-icon-cache
+
+DEPENDS += "intltool-native"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+           file://Create-symlinks-when-installing-cursors.patch \
+          "
+
+SRC_URI[md5sum] = "9ef86952c947aa27a1a888b7735d60b3"
+SRC_URI[sha256sum] = "b4556dfbf555d4fac12d4d5c12f7519de0d43ec42a1b649611439a50bf7acb96"
+
+do_install_append() {
+	# Build uses gtk-encode-symbolic-svg to create png versions:
+        # no need to store the svgs anymore.
+	rm -f ${D}${prefix}/share/icons/Adwaita/scalable/*/*-symbolic.svg \
+	      ${D}${prefix}/share/icons/Adwaita/scalable/*/*-symbolic-rtl.svg
+}
+
+PACKAGES = "${PN}-cursors ${PN}-symbolic ${PN}-hires ${PN}"
+
+FILES_${PN}-cursors = "${prefix}/share/icons/Adwaita/cursors/"
+FILES_${PN}-symbolic = "${prefix}/share/icons/Adwaita/*/*/*.symbolic.png"
+FILES_${PN}-hires = "${prefix}/share/icons/Adwaita/256x256/"
+FILES_${PN} = "${prefix}/share/icons/Adwaita/ \
+               ${prefix}/share/pkgconfig/adwaita-icon-theme.pc"
diff --git a/meta/recipes-gnome/gnome/gconf/remove_plus_from_invalid_characters_list.patch b/meta/recipes-gnome/gnome/gconf/remove_plus_from_invalid_characters_list.patch
new file mode 100644
index 0000000..59a7ca7
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gconf/remove_plus_from_invalid_characters_list.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+Remove '+' from invalid characters list
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: GConf-3.2.5/gconf/gconf-backend.c
+===================================================================
+--- GConf-3.2.5.orig/gconf/gconf-backend.c
++++ GConf-3.2.5/gconf/gconf-backend.c
+@@ -37,7 +37,7 @@ static const char invalid_chars[] =
+   /* Space is common in user names (and thus home directories) on Windows */
+   " "
+ #endif
+-  "\t\r\n\"$&<>,+=#!()'|{}[]?~`;%\\";
++  "\t\r\n\"$&<>,=#!()'|{}[]?~`;%\\";
+ 
+ static gboolean
+ gconf_address_valid (const char  *address,
diff --git a/meta/recipes-gnome/gnome/gconf/unable-connect-dbus.patch b/meta/recipes-gnome/gnome/gconf/unable-connect-dbus.patch
new file mode 100644
index 0000000..f758a4b
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gconf/unable-connect-dbus.patch
@@ -0,0 +1,95 @@
+Fixes errors such as this in the rootfs generation:
+
+(gconftool-2.real:10095): GConf-WARNING **: Client failed to connect to the D-BUS daemon:
+Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From b0895e1998ebc83ab030ec0f17c0685439f5b404 Mon Sep 17 00:00:00 2001
+From: Ray Strode <rstrode@redhat.com>
+Date: Mon, 15 Apr 2013 09:57:34 -0400
+Subject: [PATCH] dbus: Don't spew to console when unable to connect to dbus
+ daemon
+
+Instead pass the error up for the caller to decide what to do.
+
+This prevent untrappable warning messages from showing up at the
+console if gconftool --makefile-install-rule is called.
+---
+ gconf/gconf-dbus.c |   24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/gconf/gconf-dbus.c b/gconf/gconf-dbus.c
+index 5610fcf..048e3ea 100644
+--- a/gconf/gconf-dbus.c
++++ b/gconf/gconf-dbus.c
+@@ -105,7 +105,7 @@ static GHashTable     *engines_by_db = NULL;
+ static GHashTable     *engines_by_address = NULL;
+ static gboolean        dbus_disconnected = FALSE;
+ 
+-static gboolean     ensure_dbus_connection      (void);
++static gboolean     ensure_dbus_connection      (GError **error);
+ static gboolean     ensure_service              (gboolean          start_if_not_found,
+ 						 GError          **err);
+ static gboolean     ensure_database             (GConfEngine      *conf,
+@@ -383,7 +383,7 @@ gconf_engine_detach (GConfEngine *conf)
+ }
+ 
+ static gboolean
+-ensure_dbus_connection (void)
++ensure_dbus_connection (GError **err)
+ {
+   DBusError error;
+ 
+@@ -392,7 +392,9 @@ ensure_dbus_connection (void)
+ 
+   if (dbus_disconnected)
+     {
+-      g_warning ("The connection to DBus was broken. Can't reinitialize it.");
++      g_set_error (err, GCONF_ERROR,
++                   GCONF_ERROR_NO_SERVER,
++                   "The connection to DBus was broken. Can't reinitialize it.");
+       return FALSE;
+     }
+ 
+@@ -402,7 +404,10 @@ ensure_dbus_connection (void)
+   
+   if (!global_conn) 
+     {
+-      g_warning ("Client failed to connect to the D-BUS daemon:\n%s", error.message);
++      g_set_error (err, GCONF_ERROR,
++                   GCONF_ERROR_NO_SERVER,
++                   "Client failed to connect to the D-BUS daemon:\n%s",
++                   error.message);
+       
+       dbus_error_free (&error);
+       return FALSE;
+@@ -431,13 +436,8 @@ ensure_service (gboolean  start_if_not_found,
+ 
+   if (global_conn == NULL)
+     {
+-      if (!ensure_dbus_connection ())
+-	{
+-	  g_set_error (err, GCONF_ERROR,
+-		       GCONF_ERROR_NO_SERVER,
+-		       _("No D-BUS daemon running\n"));
+-	  return FALSE;
+-	}
++      if (!ensure_dbus_connection (err))
++        return FALSE;
+ 
+       g_assert (global_conn != NULL);
+     }
+@@ -2512,7 +2512,7 @@ gconf_ping_daemon (void)
+ {
+   if (global_conn == NULL)
+   {
+-    if (!ensure_dbus_connection ())
++    if (!ensure_dbus_connection (NULL))
+     {
+       return FALSE;
+     }
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-gnome/gnome/gconf_3.2.6.bb b/meta/recipes-gnome/gnome/gconf_3.2.6.bb
new file mode 100644
index 0000000..17fdafa
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gconf_3.2.6.bb
@@ -0,0 +1,60 @@
+SUMMARY = "GNOME configuration system"
+SECTION = "x11/gnome"
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605"
+
+DEPENDS = "glib-2.0 dbus dbus-glib libxml2 intltool-native gobject-introspection-stub"
+DEPENDS_class-native = "glib-2.0-native dbus-native dbus-glib-native libxml2-native intltool-native gnome-common-native gobject-introspection-stub-native"
+
+
+inherit gnomebase gtk-doc gettext
+
+SRC_URI = "${GNOME_MIRROR}/GConf/${@gnome_verdir("${PV}")}/GConf-${PV}.tar.xz;name=archive \
+           file://remove_plus_from_invalid_characters_list.patch \
+           file://unable-connect-dbus.patch \
+"
+
+SRC_URI[archive.md5sum] = "2b16996d0e4b112856ee5c59130e822c"
+SRC_URI[archive.sha256sum] = "1912b91803ab09a5eed34d364bf09fe3a2a9c96751fde03a4e0cfa51a04d784c"
+
+S = "${WORKDIR}/GConf-${PV}"
+
+EXTRA_OECONF = "--enable-shared --disable-static --enable-debug=yes \
+                --disable-introspection --disable-orbit --with-openldap=no --disable-gtk"
+
+# Disable PolicyKit by default
+PACKAGECONFIG ??= ""
+# We really don't want PolicyKit for native or uclibc
+PACKAGECONFIG_class-native = ""
+PACKAGECONFIG_libc-uclibc = ""
+
+PACKAGECONFIG[policykit] = "--enable-defaults-service,--disable-defaults-service,polkit"
+
+do_install_append() {
+	# this directory need to be created to avoid an Error 256 at gdm launch
+	install -d ${D}${sysconfdir}/gconf/gconf.xml.system
+
+	# this stuff is unusable
+	rm -f ${D}${libdir}/GConf/*/*.*a
+	rm -f ${D}${libdir}/gio/*/*.*a
+}
+
+do_install_append_class-native() {
+	create_wrapper ${D}/${bindir}/gconftool-2 \
+		GCONF_BACKEND_DIR=${STAGING_LIBDIR_NATIVE}/GConf/2
+}
+
+# disable dbus-x11 when x11 isn't in DISTRO_FEATURES
+RDEPENDS_${PN} += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'dbus-x11', '', d)}"
+RDEPENDS_${PN}_class-native = ""
+
+FILES_${PN} += "${libdir}/GConf/* \
+                ${libdir}/gio/*/*.so \
+                ${datadir}/polkit* \
+                ${datadir}/dbus-1/services/*.service \
+                ${datadir}/dbus-1/system-services/*.service \
+               "
+FILES_${PN}-dbg += "${libdir}/*/*/.debug"
+FILES_${PN}-dev += "${datadir}/sgml/gconf/gconf-1.0.dtd"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-gnome/gnome/gnome-common_3.14.0.bb b/meta/recipes-gnome/gnome/gnome-common_3.14.0.bb
new file mode 100644
index 0000000..80b7033
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gnome-common_3.14.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Common macros for building GNOME applications"
+HOMEPAGE = "http://www.gnome.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SECTION = "x11/gnome"
+inherit gnomebase allarch
+
+SRC_URI[archive.md5sum] = "ba58c61d0d81b7c3ff8452c620513a9d"
+SRC_URI[archive.sha256sum] = "4c00242f781bb441289f49dd80ed1d895d84de0c94bfc2c6818a104c9e39262c"
+
+EXTRA_AUTORECONF = ""
+DEPENDS = ""
+
+FILES_${PN} += "${datadir}/aclocal"
+FILES_${PN}-dev = ""
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-gnome/gnome/gnome-doc-utils.inc b/meta/recipes-gnome/gnome/gnome-doc-utils.inc
new file mode 100644
index 0000000..9587506
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gnome-doc-utils.inc
@@ -0,0 +1,33 @@
+SUMMARY = "A collection of documentation utilities for the Gnome project"
+DESCRIPTION = "The GNOME Documentation Build Utilities (gnome-doc- \
+utils) were created to make it easier for application developers to \
+include and create documentation in their releases. They include the \
+xml2po tool which makes it easier to translate and keep up to date \
+translations of documentation."
+LICENSE = "GPLv2 & LGPLv2.1"
+DEPENDS = "libxml2 libxslt libxslt-native gnome-doc-utils-native glib-2.0"
+DEPENDS_class-native = "libxml2-native libxslt-native intltool-native glib-2.0-native"
+
+inherit gnomebase gettext python-dir pythonnative autotools-brokensep
+
+CLEANBROKEN = "1"
+
+EXTRA_OECONF += "--disable-scrollkeeper"
+
+do_install_append() {
+	mkdir -p  ${D}${datadir}/xml/gnome/xslt/
+	cp -pPr ${S}/xslt/* ${D}${datadir}/xml/gnome/xslt/
+
+	chown -R root:root ${D}
+}
+
+do_install_append_class-native () {
+	sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/xml2po
+}
+
+FILES_${PN} += "${datadir}/xml* ${PYTHON_SITEPACKAGES_DIR}/*"
+
+RDEPENDS_${PN} = "bash"
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-gnome/gnome/gnome-doc-utils/sysrooted-pkg-config.patch b/meta/recipes-gnome/gnome/gnome-doc-utils/sysrooted-pkg-config.patch
new file mode 100644
index 0000000..416d698
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gnome-doc-utils/sysrooted-pkg-config.patch
@@ -0,0 +1,35 @@
+In cross environment we have to prepend the sysroot to the path found by
+pkgconfig since the path returned from pkgconfig does not have sysroot prefixed
+it ends up using the files from host system. Now usually people have gnome installed
+so the build succeeds but if you dont have gnome installed on build host then
+it wont find the files on host system and packages using gnome-doc-utils wont
+compile.
+
+This should work ok with non sysrooted builds too since in those cases PKG_CONFIG_SYSROOT_DIR
+will be empty
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: gnome-doc-utils-0.20.10/tools/gnome-doc-utils.make
+===================================================================
+--- gnome-doc-utils-0.20.10.orig/tools/gnome-doc-utils.make
++++ gnome-doc-utils-0.20.10/tools/gnome-doc-utils.make
+@@ -133,11 +133,11 @@ _DOC_ABS_SRCDIR = @abs_srcdir@
+ _xml2po ?= `which xml2po`
+ _xml2po_mode = $(if $(DOC_ID),mallard,docbook)
+ 
+-_db2html ?= `$(PKG_CONFIG) --variable db2html gnome-doc-utils`
+-_db2omf  ?= `$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
+-_chunks  ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
+-_credits ?= `$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
+-_ids ?= $(shell $(PKG_CONFIG) --variable xmldir gnome-doc-utils)/gnome/xslt/docbook/utils/ids.xsl
++_db2html ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable db2html gnome-doc-utils`
++_db2omf  ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable db2omf gnome-doc-utils`
++_chunks  ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/chunks.xsl
++_credits ?= ${PKG_CONFIG_SYSROOT_DIR}`$(PKG_CONFIG) --variable xmldir gnome-doc-utils`/gnome/xslt/docbook/utils/credits.xsl
++_ids ?= ${PKG_CONFIG_SYSROOT_DIR}$(shell $(PKG_CONFIG) --variable xmldir gnome-doc-utils)/gnome/xslt/docbook/utils/ids.xsl
+ 
+ if ENABLE_SK
+ _ENABLE_SK = true
diff --git a/meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch b/meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch
new file mode 100644
index 0000000..0e196c0
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gnome-doc-utils/use-usr-bin-env-for-python-in-xml2po.patch
@@ -0,0 +1,30 @@
+We can't use #!/full/path/to/python -u as this can be longer than shebang
+allows for.  In order to be appropraite for upstream more work would be
+needed to make sure that the main xml2po code doesn't rely on python
+being invoked with -u (force stdin/out/err to be used raw).
+
+Upstream-Status: Inappropriate [Would break behavior on Windows]
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: gnome-doc-utils-0.20.10/xml2po/xml2po/Makefile.am
+===================================================================
+--- gnome-doc-utils-0.20.10.orig/xml2po/xml2po/Makefile.am
++++ gnome-doc-utils-0.20.10/xml2po/xml2po/Makefile.am
+@@ -7,7 +7,6 @@ CLEANFILES = xml2po
+ 
+ xml2po: xml2po.py.in
+ 	$(AM_V_GEN)sed -e "s/^VERSION =.*/VERSION = \"@VERSION@\"/" \
+-	    -e "s+^#!.*python.*+#!$(PYTHON)+" \
+ 	  < $(srcdir)/xml2po.py.in > xml2po
+ 	$(AM_V_at)chmod +x xml2po
+ 
+Index: gnome-doc-utils-0.20.10/xml2po/xml2po/xml2po.py.in
+===================================================================
+--- gnome-doc-utils-0.20.10.orig/xml2po/xml2po/xml2po.py.in
++++ gnome-doc-utils-0.20.10/xml2po/xml2po/xml2po.py.in
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -u
++#!/usr/bin/env python
+ # -*- encoding: utf-8 -*-
+ # Copyright (c) 2004, 2005, 2006 Danilo Šegan <danilo@gnome.org>.
+ # Copyright (c) 2009 Claude Paroz <claude@2xlibre.net>.
diff --git a/meta/recipes-gnome/gnome/gnome-doc-utils/xsltproc_nonet.patch b/meta/recipes-gnome/gnome/gnome-doc-utils/xsltproc_nonet.patch
new file mode 100644
index 0000000..9346494
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gnome-doc-utils/xsltproc_nonet.patch
@@ -0,0 +1,95 @@
+This adds the -nonet option to xsltproc invocations, which fixes
+compile errors when building the gnome-doc-utils docs.
+
+Upstream-Status: Inappropriate [configuration]
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: gnome-doc-utils-0.20.10/doc/xslt/Makefile.am
+===================================================================
+--- gnome-doc-utils-0.20.10.orig/doc/xslt/Makefile.am
++++ gnome-doc-utils-0.20.10/doc/xslt/Makefile.am
+@@ -21,14 +21,14 @@ all: $(xsldoc_docs) $(xsldoc_xmls)
+ 
+ $(xsldoc_docs): $(xsldoc_xsls) xsldoc.awk xsldoc-fill.xsl
+ 	$(AM_V_GEN)$(GDU_AWK) -f "$(srcdir)/xsldoc.awk" "$(filter %/$(basename $(notdir $@)).xsl,$(xsldoc_xsls))" \
+-	| xsltproc -o "$@" \
++	| xsltproc -nonet -o "$@" \
+ 	--stringparam basename "$(basename $(notdir $@))" \
+ 	--stringparam xsl_file "$(filter %/$(basename $(notdir $@)).xsl,$(xsldoc_xsls))" \
+ 	"$(srcdir)/xsldoc-fill.xsl" -
+ 
+ $(xsldoc_xmls): xsldoc-docbook.xsl
+ $(xsldoc_xmls): C/%.xml : C/%.xsldoc
+-	$(AM_V_GEN)xsltproc -o "$@" \
++	$(AM_V_GEN)xsltproc -nonet -o "$@" \
+ 	--stringparam basename "$(basename $(notdir $@))" \
+ 	--stringparam xsl_file "$(filter %/$(basename $(notdir $@)).xsl,$(xsldoc_xsls))" \
+ 	"$(srcdir)/xsldoc-docbook.xsl" "$<"
+@@ -62,7 +62,7 @@ gnome-doc-xslt-check-includes:
+ gnome-doc-xslt-check-xsldoc: $(xsldoc_docs)
+ 	@echo "Running xsldoc checks";
+ 	@(echo "<xsldoc>"; cat $(xsldoc_docs); echo "</xsldoc>") \
+-	| xsltproc "$(srcdir)/xsldoc-check.xsl" - 1> /dev/null
++	| xsltproc -nonet "$(srcdir)/xsldoc-check.xsl" - 1> /dev/null
+ 
+ .PHONY: clean-xsldoc
+ clean-local: clean_xsldoc
+Index: gnome-doc-utils-0.20.10/tools/gnome-doc-utils.make
+===================================================================
+--- gnome-doc-utils-0.20.10.orig/tools/gnome-doc-utils.make
++++ gnome-doc-utils-0.20.10/tools/gnome-doc-utils.make
+@@ -37,7 +37,7 @@ $(DOC_H_FILE): $(DOC_H_DOCS);
+ 	list='$(DOC_H_DOCS)'; for doc in $$list; do \
+ 	  xmlpath="`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`:$(srcdir)/`echo $$doc | sed -e 's/^\(.*\/\).*/\1/' -e '/\//!s/.*//'`"; \
+ 	  if ! test -f "$$doc"; then doc="$(srcdir)/$$doc"; fi; \
+-	  xsltproc --path "$$xmlpath" $(_credits) $$doc; \
++	  xsltproc -nonet --path "$$xmlpath" $(_credits) $$doc; \
+ 	done | sort | uniq \
+ 	  | awk 'BEGIN{s=""}{n=split($$0,w,"<");if(s!=""&&s!=substr(w[1],1,length(w[1])-1)){print s};if(n>1){print $$0;s=""}else{s=$$0}};END{if(s!=""){print s}}' \
+ 	  | sed -e 's/\\/\\\\/' -e 's/"/\\"/' -e 's/\(.*\)/\t"\1",/' >> $@.tmp
+@@ -50,7 +50,7 @@ $(DOC_H_FILE): $(DOC_H_DOCS);
+ 	  docid=`echo "$$doc" | sed -e 's/.*\/\([^/]*\)\.xml/\1/' \
+ 	    | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`; \
+ 	  echo $$xmlpath; \
+-	  ids=`xsltproc --xinclude --path "$$xmlpath" $(_ids) $$doc`; \
++	  ids=`xsltproc -nonet --xinclude --path "$$xmlpath" $(_ids) $$doc`; \
+ 	  for id in $$ids; do \
+ 	    echo '#define HELP_'`echo $$docid`'_'`echo $$id \
+ 	      | sed -e 's/[^a-zA-Z_]/_/g' | tr 'a-z' 'A-Z'`' "'$$id'"' >> $@.tmp; \
+@@ -197,7 +197,7 @@ $(_DOC_OMF_DB) : $(DOC_MODULE)-%.omf : %
+ 	  echo "The file '$(_skcontentslist)' does not exist." >&2;		\
+ 	  echo "Please check your ScrollKeeper installation." >&2;		\
+ 	  exit 1; }
+-	$(GDU_V_DB2OMF)xsltproc -o $@ $(call db2omf_args,$@,$<,'docbook') || { rm -f "$@"; exit 1; }
++	$(GDU_V_DB2OMF)xsltproc -nonet -o $@ $(call db2omf_args,$@,$<,'docbook') || { rm -f "$@"; exit 1; }
+ 
+ ## @ _DOC_OMF_HTML
+ ## The OMF files for HTML output
+@@ -212,7 +212,7 @@ if ENABLE_SK
+ 	  echo "Please check your ScrollKeeper installation." >&2;		\
+ 	  exit 1; }
+ endif
+-	$(GDU_V_DB2OMF)xsltproc -o $@ $(call db2omf_args,$@,$<,'xhtml') || { rm -f "$@"; exit 1; }
++	$(GDU_V_DB2OMF)xsltproc -nonet -o $@ $(call db2omf_args,$@,$<,'xhtml') || { rm -f "$@"; exit 1; }
+ 
+ ## @ _DOC_OMF_ALL
+ ## All OMF output files to be built
+@@ -267,7 +267,7 @@ _DOC_C_FIGURES = $(if $(DOC_FIGURES),
+ ## All HTML documentation in the C locale
+ # FIXME: probably have to shell escape to determine the file names
+ _DOC_C_HTML = $(foreach f,						\
+-	$(shell xsltproc --xinclude 					\
++	$(shell xsltproc -nonet --xinclude 					\
+ 	  --stringparam db.chunk.basename "$(DOC_MODULE)"		\
+ 	  $(_chunks) "C/$(DOC_MODULE).xml"),				\
+ 	C/$(f).xhtml)
+@@ -393,7 +393,7 @@ _DOC_HTML_ALL = $(if $(filter html HTML,
+ _DOC_HTML_TOPS = $(foreach lc,C $(_DOC_REAL_LINGUAS),$(lc)/$(DOC_MODULE).xhtml)
+ 
+ $(_DOC_HTML_TOPS): $(_DOC_C_DOCS) $(_DOC_LC_DOCS)
+-	$(GDU_V_DB2HTM)xsltproc -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".xhtml" $(_db2html) $(patsubst %.xhtml,%.xml,$@)
++	$(GDU_V_DB2HTM)xsltproc -nonet -o $@ --xinclude --param db.chunk.chunk_top "false()" --stringparam db.chunk.basename "$(DOC_MODULE)" --stringparam db.chunk.extension ".xhtml" $(_db2html) $(patsubst %.xhtml,%.xml,$@)
+ 
+ 
+ ################################################################################
diff --git a/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.10.bb b/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.10.bb
new file mode 100644
index 0000000..78cc005
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.10.bb
@@ -0,0 +1,11 @@
+require gnome-doc-utils.inc
+LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=eb723b61539feef013de476e68b5c50a \
+		    file://COPYING.LGPL;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+SRC_URI += "file://xsltproc_nonet.patch \
+            file://use-usr-bin-env-for-python-in-xml2po.patch \
+            file://sysrooted-pkg-config.patch \
+           "
+
+SRC_URI[archive.md5sum] = "3c64ad7bacd617b04999e4a168afaac5"
+SRC_URI[archive.sha256sum] = "cb0639ffa9550b6ddf3b62f3b1add92fb92ab4690d351f2353cffe668be8c4a6"
diff --git a/meta/recipes-gnome/gnome/gnome-mime-data/pkgconfig.patch b/meta/recipes-gnome/gnome/gnome-mime-data/pkgconfig.patch
new file mode 100644
index 0000000..0903425
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gnome-mime-data/pkgconfig.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: gnome-mime-data-2.18.0/Makefile.am
+===================================================================
+--- gnome-mime-data-2.18.0.orig/Makefile.am	2009-06-11 17:27:48.000000000 +0100
++++ gnome-mime-data-2.18.0/Makefile.am	2009-06-11 17:27:59.000000000 +0100
+@@ -1,6 +1,6 @@
+ SUBDIRS = man po
+ 
+-pkgconfigdir = $(datadir)/pkgconfig
++pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = gnome-mime-data-2.0.pc
+ 
+ NULL=
diff --git a/meta/recipes-gnome/gnome/gnome-mime-data_2.18.0.bb b/meta/recipes-gnome/gnome/gnome-mime-data_2.18.0.bb
new file mode 100644
index 0000000..a31eb55
--- /dev/null
+++ b/meta/recipes-gnome/gnome/gnome-mime-data_2.18.0.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Base MIME and Application database for GNOME"
+HOMEPAGE = "http://www.gnome.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://check-mime.pl;endline=26;md5=a95b63c92c33d4ca1af61a315888f450"
+
+inherit gnomebase mime
+PR = "r4"
+
+SRC_URI += "file://pkgconfig.patch"
+
+SRC_URI[archive.md5sum] = "541858188f80090d12a33b5a7c34d42c"
+SRC_URI[archive.sha256sum] = "37196b5b37085bbcd45c338c36e26898fe35dd5975295f69f48028b1e8436fd7"
+GNOME_COMPRESS_TYPE="bz2"
+
+DEPENDS += "shared-mime-info intltool-native"
+RDEPENDS_${PN} = "shared-mime-info"
diff --git a/meta/recipes-gnome/gnome/libart-lgpl/libart_lgpl-2.3.21-crosscompile.patch b/meta/recipes-gnome/gnome/libart-lgpl/libart_lgpl-2.3.21-crosscompile.patch
new file mode 100644
index 0000000..0261f58
--- /dev/null
+++ b/meta/recipes-gnome/gnome/libart-lgpl/libart_lgpl-2.3.21-crosscompile.patch
@@ -0,0 +1,84 @@
+Taken from portage
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+From e1443c945a4cf67096d8c27721aadd7368382b3f Mon Sep 17 00:00:00 2001
+From: Gilles Dartiguelongue <eva@gentoo.org>
+Date: Tue, 6 Apr 2010 15:22:25 +0200
+Subject: [PATCH 2/2] gentoo: use ISO types for fixed type size
+
+---
+ Makefile.am  |   11 ++---------
+ art_config.h |    5 +++++
+ configure.in |   10 ----------
+ 3 files changed, 7 insertions(+), 19 deletions(-)
+ create mode 100644 art_config.h
+
+diff --git a/Makefile.am b/Makefile.am
+index 95952da..6aa2fe3 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,13 +2,6 @@ check_PROGRAMS = testart testuta
+ 
+ bin_SCRIPTS = \
+ 	libart2-config
+-	
+-noinst_SCRIPTS = gen_art_config.sh
+-
+-BUILT_SOURCES = art_config.h
+-
+-art_config.h:
+-	./gen_art_config.sh > art_config.h
+ 
+ EXTRA_DIST = 			\
+ 	libart.def		\
+@@ -173,5 +166,5 @@ install-data-local: install-ms-lib install-libtool-import-lib
+ 
+ uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
+ 
+-CLEANFILES = $(BUILT_SOURCES) $(bin_SCRIPTS)
+-DISTCLEANFILES = $(BUILT_SOURCES) $(bin_SCRIPTS)
++CLEANFILES = $(bin_SCRIPTS)
++DISTCLEANFILES = $(bin_SCRIPTS)
+diff --git a/art_config.h b/art_config.h
+new file mode 100644
+index 0000000..5985f1f
+--- a/art_config.h
++++ b/art_config.h
+@@ -0,0 +1,5 @@
++#include <stdint.h>
++
++typedef uint8_t art_u8;
++typedef uint16_t art_u16;
++typedef uint32_t art_u32;
+diff --git a/configure.in b/configure.in
+index e4804f7..ddcac4f 100644
+--- a/configure.in
++++ b/configure.in
+@@ -92,15 +92,6 @@ AC_FUNC_ALLOCA
+ 
+ AC_C_BIGENDIAN
+ 
+-AC_CHECK_SIZEOF(char)
+-AC_SUBST(ART_SIZEOF_CHAR, $ac_cv_sizeof_char)
+-AC_CHECK_SIZEOF(short)
+-AC_SUBST(ART_SIZEOF_SHORT, $ac_cv_sizeof_short)
+-AC_CHECK_SIZEOF(int)
+-AC_SUBST(ART_SIZEOF_INT, $ac_cv_sizeof_int)
+-AC_CHECK_SIZEOF(long)
+-AC_SUBST(ART_SIZEOF_LONG, $ac_cv_sizeof_long)
+-
+ AC_CONFIG_FILES([
+ libart-features.h
+ Makefile
+@@ -109,6 +100,5 @@ libart-2.0-uninstalled.pc
+ libart-zip])
+ 
+ AC_CONFIG_FILES([libart-config],[chmod +x libart-config])
+-AC_CONFIG_FILES([gen_art_config.sh],[chmod +x gen_art_config.sh])
+ 
+ AC_OUTPUT
+-- 
+1.7.0.4
+
diff --git a/meta/recipes-gnome/gnome/libart-lgpl_2.3.21.bb b/meta/recipes-gnome/gnome/libart-lgpl_2.3.21.bb
new file mode 100644
index 0000000..95581b2
--- /dev/null
+++ b/meta/recipes-gnome/gnome/libart-lgpl_2.3.21.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Library of functions for 2D graphics"
+SECTION = "x11/gnome"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
+PR = "r2"
+
+# can't use gnome.oeclass due to _ in filename
+SRC_URI = "${GNOME_MIRROR}/libart_lgpl/2.3/libart_lgpl-${PV}.tar.bz2 \
+           file://libart_lgpl-2.3.21-crosscompile.patch \
+          "
+
+SRC_URI[md5sum] = "08559ff3c67fd95d57b0c5e91a6b4302"
+SRC_URI[sha256sum] = "fdc11e74c10fc9ffe4188537e2b370c0abacca7d89021d4d303afdf7fd7476fa"
+
+inherit autotools pkgconfig
+
+DEPENDS = ""
+
+FILES_${PN} = "${libdir}/*.so.*"
+FILES_${PN}-dev += "${bindir}/libart2-config"
+
+S = "${WORKDIR}/libart_lgpl-${PV}"
diff --git a/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.16.1.bb b/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.16.1.bb
new file mode 100644
index 0000000..f2f2c75
--- /dev/null
+++ b/meta/recipes-gnome/gsettings-desktop-schemas/gsettings-desktop-schemas_3.16.1.bb
@@ -0,0 +1,13 @@
+SUMMARY = "GNOME desktop-wide GSettings schemas"
+HOMEPAGE = "http://live.gnome.org/gsettings-desktop-schemas"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "glib-2.0 intltool-native gobject-introspection-stub-native"
+
+inherit gnomebase gsettings gettext
+
+SRC_URI[archive.md5sum] = "baebbcf3c20591f98876e42fb0a3fd35"
+SRC_URI[archive.sha256sum] = "74fe9fdad510c8a6666febeceb7ebafc581ef990b3afcc8c1e8b5d90b24b3461"
diff --git a/meta/recipes-gnome/gtk+/gtk+.inc b/meta/recipes-gnome/gtk+/gtk+.inc
new file mode 100644
index 0000000..be5273d
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+.inc
@@ -0,0 +1,97 @@
+SUMMARY = "Multi-platform toolkit for creating GUIs"
+DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
+set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
+HOMEPAGE = "http://www.gtk.org"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
+
+SECTION = "libs"
+
+inherit distro_features_check
+ANY_OF_DISTRO_FEATURES = "directfb x11"
+
+X11DEPENDS = "virtual/libx11 libxext libxcursor libxrandr libxdamage libxrender libxcomposite"
+DEPENDS = "glib-2.0 pango atk jpeg libpng gdk-pixbuf-native docbook-utils-native \
+ cairo gdk-pixbuf"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
+"
+
+PACKAGECONFIG[x11] = "--with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}"
+# without --with-gdktarget=directfb it will check for cairo-xlib which isn't available without X11 DISTRO_FEATURE
+PACKAGECONFIG[directfb] = "--with-gdktarget=directfb,,directfb"
+
+inherit autotools gtk-doc pkgconfig update-alternatives gtk-immodules-cache
+
+PACKAGES += "libgail gtk-demo"
+
+FILES_${PN} = "${bindir}/gtk-update-icon-cache-2.0 \
+	${bindir}/gtk-query-immodules-2.0 \
+	${libdir}/lib*${SOLIBS} \
+	${datadir}/themes ${sysconfdir} \
+	${libdir}/gtk-2.0/${LIBV}/engines/libpixmap.so"
+
+FILES_${PN}-dev += " \
+        ${datadir}/gtk-2.0/include \
+	${libdir}/gtk-2.0/include \
+	${libdir}/gtk-2.0/modules/*.la \
+	${libdir}/gtk-2.0/${LIBV}/loaders/*.la \
+	${libdir}/gtk-2.0/${LIBV}/immodules/*.la \
+	${libdir}/gtk-2.0/${LIBV}/printbackends/*.la \
+	${libdir}/gtk-2.0/${LIBV}/engines/*.la \
+	${bindir}/gtk-builder-convert"
+
+FILES_${PN}-dbg += " \
+	${libdir}/gtk-2.0/modules/.debug/* \
+        ${libdir}/gtk-2.0/${LIBV}/loaders/.debug/* \
+	${libdir}/gtk-2.0/${LIBV}/immodules/.debug/* \
+	${libdir}/gtk-2.0/${LIBV}/engines/.debug/* \
+	${libdir}/gtk-2.0/${LIBV}/printbackends/.debug/*"
+
+FILES_gtk-demo = " \
+ ${datadir}/gtk-2.0/demo/* \
+ ${bindir}/gtk-demo \
+ "
+
+FILES_libgail = " \
+	${libdir}/gtk-2.0/modules/libgail.so \
+	${libdir}/gtk-2.0/modules/libferret.so \
+	"
+
+GTKBASE_RRECOMMENDS ?= "liberation-fonts gdk-pixbuf-loader-png gdk-pixbuf-loader-jpeg gdk-pixbuf-loader-gif gdk-pixbuf-loader-xpm shared-mime-info"
+GTKGLIBC_RRECOMMENDS ?= "${GTKBASE_RRECOMMENDS} glibc-gconv-iso8859-1"
+
+RRECOMMENDS_${PN} = "${GTKBASE_RRECOMMENDS}"
+RRECOMMENDS_${PN}_libc-glibc = "${GTKGLIBC_RRECOMMENDS}"
+
+ALTERNATIVE_${PN} = "gtk-update-icon-cache"
+ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-2.0"
+
+do_install () {
+	autotools_do_install
+
+	install -d ${D}${sysconfdir}/gtk-2.0
+
+	mkdir -p ${D}${libdir}/gtk-2.0/include
+	install -m 0644 gdk/gdkconfig.h ${D}${libdir}/gtk-2.0/include/gdkconfig.h
+
+	install -m 0644 ${S}/gtk/gtkfilechooserprivate.h ${D}${includedir}/gtk-2.0/gtk/
+	install -m 0644 ${S}/gtk/gtkfilechooserutils.h   ${D}${includedir}/gtk-2.0/gtk/
+	install -m 0644 ${S}/gtk/gtkfilesystemmodel.h    ${D}${includedir}/gtk-2.0/gtk/
+
+	mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-2.0
+}
+
+SYSROOT_PREPROCESS_FUNCS += "gtk_sysroot_preprocess"
+
+gtk_sysroot_preprocess () {
+	if [ -e ${D}${bindir}/gtk-builder-convert ]; then
+		install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+		install -m 755 ${D}${bindir}/gtk-builder-convert ${SYSROOT_DESTDIR}${bindir_crossscripts}/
+	fi
+}
+
diff --git a/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch b/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch
new file mode 100644
index 0000000..74e479f
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+/doc-fixes.patch
@@ -0,0 +1,22 @@
+There are issues building the gtk+ tutorial and faq documentation.
+Since they were removed in gtk+ upstream and are superfluous in
+embedded applications, just don't build them.
+
+Thanks to Joshua Lock for suggesting this approach.
+
+Signed-off-by: Scott Garman <scott.a.garman@intel.com>
+
+Upstream-Status: Inappropriate [embedded specific]
+
+diff -urN gtk+-2.22.1.orig/docs/Makefile.am gtk+-2.22.1/docs/Makefile.am
+--- gtk+-2.22.1.orig/docs/Makefile.am	2010-11-15 04:13:09.000000000 -0800
++++ gtk+-2.22.1/docs/Makefile.am	2011-02-23 19:25:16.914815097 -0800
+@@ -1,7 +1,7 @@
+ ## Process this file with automake to produce Makefile.in
+ include $(top_srcdir)/Makefile.decl
+ 
+-SUBDIRS = tutorial faq reference tools
++SUBDIRS = reference tools
+ 
+ EXTRA_DIST += \
+ 	defsformat.txt			\
diff --git a/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch b/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch
new file mode 100644
index 0000000..1ae728e
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+/hardcoded_libtool.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Updated to apply to gtk+-2.24.15
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd gtk+-2.24.15/configure.ac gtk+-2.24.15/configure.ac
+--- gtk+-2.24.15/configure.ac	2013-01-12 20:52:54.000000000 +0200
++++ gtk+-2.24.15/configure.ac	2013-02-12 21:33:30.689925967 +0200
+@@ -415,7 +415,7 @@
+ case $enable_explicit_deps in
+   auto)
+     export SED
+-    deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
++    deplibs_check_method=`(./$host_alias-libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
+     if test "x$deplibs_check_method" '!=' xpass_all || test "x$enable_static" = xyes ; then
+       enable_explicit_deps=yes
+     else
+@@ -774,7 +774,7 @@
+     dnl Now we check to see if our libtool supports shared lib deps
+     dnl (in a rather ugly way even)
+     if $dynworks; then
+-        module_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
++        module_libtool_config="${CONFIG_SHELL-/bin/sh} $host_alias-libtool --config"
+         module_deplibs_check=`$module_libtool_config | \
+             grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
+             sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
+@@ -1574,7 +1574,7 @@
+ # We are using gmodule-no-export now, but I'm leaving the stripping
+ # code in place for now, since pango and atk still require gmodule.
+ export SED
+-export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++export_dynamic=`($host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ if test -n "$export_dynamic"; then
+   GDK_DEP_LIBS=`echo $GDK_DEP_LIBS | sed -e "s/$export_dynamic//"`
+   GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"`
diff --git a/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch b/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch
new file mode 100644
index 0000000..96e1f5f
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+/strict-prototypes.patch
@@ -0,0 +1,24 @@
+Fixes
+
+include/gtk-2.0/gtk/gtkitemfactory.h:47:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
+ typedef void (*GtkItemFactoryCallback)  ();
+
+gcc5 has -Wstrict-prototypes on by default for -Werror so this becomes a build failure for consumers
+of this header e.g. matchbox-panel-2
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Index: gtk+-2.24.27/gtk/gtkitemfactory.h
+===================================================================
+--- gtk+-2.24.27.orig/gtk/gtkitemfactory.h
++++ gtk+-2.24.27/gtk/gtkitemfactory.h
+@@ -44,7 +44,7 @@ typedef void	(*GtkPrintFunc)		   (gpoint
+  * (Note that if we are included from a C++ program () will mean
+  * (void) so an explicit cast will be needed.)
+  */
+-typedef	void	(*GtkItemFactoryCallback)  ();
++typedef	void	(*GtkItemFactoryCallback)  (void);
+ typedef	void	(*GtkItemFactoryCallback1) (gpointer		 callback_data,
+ 					    guint		 callback_action,
+ 					    GtkWidget		*widget);
diff --git a/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff b/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff
new file mode 100644
index 0000000..340d120
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+/toggle-font.diff
@@ -0,0 +1,102 @@
+Upstream-Status: Pending
+
+Index: gtk/gtkcellrenderertoggle.c
+===================================================================
+--- gtk/gtkcellrenderertoggle.c.orig	2010-06-22 18:11:33.000000000 +0800
++++ gtk/gtkcellrenderertoggle.c	2010-06-22 18:11:43.000000000 +0800
+@@ -71,6 +71,8 @@
+   PROP_INDICATOR_SIZE
+ };
+ 
++/* This is a hard-coded default which promptly gets overridden by a size
++   calculated from the font size. */
+ #define TOGGLE_WIDTH 13
+ 
+ static guint toggle_cell_signals[LAST_SIGNAL] = { 0 };
+@@ -80,8 +82,9 @@
+ typedef struct _GtkCellRendererTogglePrivate GtkCellRendererTogglePrivate;
+ struct _GtkCellRendererTogglePrivate
+ {
+-  gint indicator_size;
+-
++  gint indicator_size; /* This is the real size */
++  gint override_size; /* This is the size set from the indicator-size property */
++  GtkWidget *cached_widget;
+   guint inconsistent : 1;
+ };
+ 
+@@ -104,6 +107,7 @@
+   GTK_CELL_RENDERER (celltoggle)->ypad = 2;
+ 
+   priv->indicator_size = TOGGLE_WIDTH;
++  priv->override_size = 0;
+   priv->inconsistent = FALSE;
+ }
+ 
+@@ -210,7 +214,7 @@
+       g_value_set_boolean (value, celltoggle->radio);
+       break;
+     case PROP_INDICATOR_SIZE:
+-      g_value_set_int (value, priv->indicator_size);
++      g_value_set_int (value, priv->override_size ? priv->override_size : priv->indicator_size);
+       break;
+     default:
+       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -245,7 +249,7 @@
+       celltoggle->radio = g_value_get_boolean (value);
+       break;
+     case PROP_INDICATOR_SIZE:
+-      priv->indicator_size = g_value_get_int (value);
++      priv->override_size = g_value_get_int (value);
+       break;
+     default:
+       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+@@ -273,6 +277,27 @@
+ }
+ 
+ static void
++on_widget_style_set (GtkWidget *widget, GtkStyle *previous, gpointer user_data)
++{
++  GtkCellRendererTogglePrivate *priv = user_data;
++  PangoContext *context;
++  PangoFontMetrics *metrics;
++  int height;
++  
++  context = gtk_widget_get_pango_context (widget);
++  metrics = pango_context_get_metrics (context,
++                                       widget->style->font_desc,
++                                       pango_context_get_language (context));
++
++  height = pango_font_metrics_get_ascent (metrics) +
++    pango_font_metrics_get_descent (metrics);
++  
++  pango_font_metrics_unref (metrics);
++  
++  priv->indicator_size = PANGO_PIXELS (height * 0.85);
++}
++
++static void
+ gtk_cell_renderer_toggle_get_size (GtkCellRenderer *cell,
+ 				   GtkWidget       *widget,
+ 				   GdkRectangle    *cell_area,
+@@ -287,6 +312,20 @@
+ 
+   priv = GTK_CELL_RENDERER_TOGGLE_GET_PRIVATE (cell);
+ 
++  if (priv->override_size) {
++    priv->indicator_size = priv->override_size;
++  } else if (priv->cached_widget != widget) {
++    if (priv->cached_widget) {
++      g_object_remove_weak_pointer (widget, &priv->cached_widget);
++      g_signal_handlers_disconnect_by_func (priv->cached_widget, on_widget_style_set, priv);
++    }
++    priv->cached_widget = widget;
++    g_object_add_weak_pointer (widget, &priv->cached_widget);
++    g_signal_connect (widget, "style-set", on_widget_style_set, priv);
++    
++    on_widget_style_set (widget, NULL, priv);
++  }
++
+   calc_width = (gint) cell->xpad * 2 + priv->indicator_size;
+   calc_height = (gint) cell->ypad * 2 + priv->indicator_size;
+ 
diff --git a/meta/recipes-gnome/gtk+/gtk+/xsettings.patch b/meta/recipes-gnome/gtk+/gtk+/xsettings.patch
new file mode 100644
index 0000000..d0a970a
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+/xsettings.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+Index: gtk+-2.21.2/gdk/x11/gdkevents-x11.c
+===================================================================
+--- gtk+-2.21.2.orig/gdk/x11/gdkevents-x11.c	2010-06-22 17:28:04.000000000 +0800
++++ gtk+-2.21.2/gdk/x11/gdkevents-x11.c	2010-06-22 17:28:06.000000000 +0800
+@@ -3062,10 +3062,9 @@
+ {
+   GdkScreenX11 *screen = data;
+   
+-  if (xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent))
+-    return GDK_FILTER_REMOVE;
+-  else
+-    return GDK_FILTER_CONTINUE;
++  xsettings_client_process_event (screen->xsettings_client, (XEvent *)xevent);
++
++  return GDK_FILTER_CONTINUE;
+ }
+ 
+ static Bool
diff --git a/meta/recipes-gnome/gtk+/gtk+3.inc b/meta/recipes-gnome/gtk+/gtk+3.inc
new file mode 100644
index 0000000..f29f0d3
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+3.inc
@@ -0,0 +1,111 @@
+SUMMARY = "Multi-platform toolkit for creating GUIs"
+DESCRIPTION = "GTK+ is a multi-platform toolkit for creating graphical user interfaces. Offering a complete \
+set of widgets, GTK+ is suitable for projects ranging from small one-off projects to complete application suites."
+HOMEPAGE = "http://www.gtk.org"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "libs"
+
+DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \
+           docbook-utils-native gdk-pixbuf-native libepoxy"
+
+LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
+
+inherit autotools pkgconfig gtk-doc update-alternatives gtk-immodules-cache gsettings
+
+# This should be in autotools.bbclass, but until something elses uses it putting
+# it here avoids rebuilding everything.
+export PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
+
+do_configure_prepend() {
+    # Do this because the configure script is running ./libtool directly
+    rm -f libtool
+    ln -s ${TARGET_PREFIX}libtool libtool
+}
+
+EXTRA_OECONF += " \
+                 --disable-glibtest \
+                 --disable-xinerama \
+                 --enable-modules \
+                 --disable-cups \
+                 --disable-introspection \
+"
+
+PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "x11", "", d)} \
+                   ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "wayland", "", d)}"
+
+PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes"
+PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland libxkbcommon virtual/mesa"
+
+do_install_append() {
+	mv ${D}${bindir}/gtk-update-icon-cache ${D}${bindir}/gtk-update-icon-cache-3.0
+}
+
+PACKAGES =+ "${PN}-demo"
+LIBV = "3.0.0"
+
+FILES_${PN}-demo = "${bindir}/gtk3-demo \
+                    ${bindir}/gtk3-demo-application \
+                    ${bindir}/gtk3-icon-browser \
+                    ${bindir}/gtk3-widget-factory \
+                    ${datadir}/gtk-3.0/demo \
+                    ${datadir}/applications/gtk3-demo.desktop \
+                    ${datadir}/applications/gtk3-icon-browser.desktop \
+                    ${datadir}/applications/gtk3-widget-factory.desktop \
+                    ${datadir}/icons/hicolor/*/apps/gtk3-demo*.png \
+                    ${datadir}/icons/hicolor/*/apps/gtk3-widget-factory*.png"
+
+# The demo uses PNG files and mime type sniffing, so ensure that these
+# dependencies are present.
+RDEPENDS_${PN}-demo += "gdk-pixbuf-loader-png shared-mime-info"
+
+FILES_${PN} = "${bindir}/gtk-update-icon-cache-3.0 \
+               ${bindir}/gtk-query-immodules-3.0 \
+               ${bindir}/gtk-launch \
+               ${libdir}/lib*${SOLIBS} \
+               ${datadir}/themes ${sysconfdir} ${datadir}/glib-2.0/schemas/ \
+               ${libdir}/gtk-3.0/${LIBV}/engines/libpixmap.so \
+               ${libdir}/gtk-3.0/modules/*.so"
+
+FILES_${PN}-dev += " \
+                    ${datadir}/gtk-3.0/gtkbuilder.rng \
+                    ${datadir}/gtk-3.0/include \
+                    ${libdir}/gtk-3.0/include \
+                    ${libdir}/gtk-3.0/${LIBV}/loaders/*.la \
+                    ${libdir}/gtk-3.0/${LIBV}/immodules/*.la \
+                    ${libdir}/gtk-3.0/3.0.0/printbackends/*.la \
+                    ${libdir}/gtk-3.0/${LIBV}/engines/*.la \
+                    ${libdir}/gtk-3.0/modules/*.la \
+                    ${bindir}/gtk-builder-convert \
+                    ${bindir}/gtk-encode-symbolic-svg"
+
+FILES_${PN}-dbg += " \
+                    ${libdir}/gtk-3.0/${LIBV}/loaders/.debug \
+                    ${libdir}/gtk-3.0/${LIBV}/immodules/.debug \
+                    ${libdir}/gtk-3.0/${LIBV}/engines/.debug \
+                    ${libdir}/gtk-3.0/${LIBV}/printbackends/.debug \
+                    ${libdir}/gtk-3.0/modules/.debug"
+
+RRECOMMENDS_${PN} = "adwaita-icon-theme-symbolic"
+
+PACKAGES_DYNAMIC += "^gtk3-immodule-.* ^gtk3-printbackend-.*"
+
+ALTERNATIVE_${PN} = "gtk-update-icon-cache"
+ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0"
+
+python populate_packages_prepend () {
+    import os.path
+
+    gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}')
+    immodules_root = os.path.join(gtk_libdir, 'immodules')
+    printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+
+    immodules = do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s')
+    if immodules:
+        d.setVar("GTKIMMODULES_PACKAGES", " ".join(immodules))
+
+    do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s')
+
+    if (d.getVar('DEBIAN_NAMES', 1)):
+        d.setVar('PKG_${PN}', '${MLPREFIX}libgtk-3.0')
+}
+
diff --git a/meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch b/meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch
new file mode 100644
index 0000000..32d8a84
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+3/Dont-force-csd.patch
@@ -0,0 +1,118 @@
+window: Check if we can use CSD before enabling them
+
+Upstream-Status: Backport
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+From c5e5ee67490e7e7af56052d8f8beb75db002c2f1 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@gnome.org>
+Date: Wed, 3 Jun 2015 14:07:29 +0100
+Subject: window: Check if we can use CSD before enabling them
+
+The change in 03213b9509fc1df16c66194ea168aed6c15110e9 changed the rules
+as to when CSD can be enabled, but it also unconditionally enables CSD
+with the implicit assumption that client-side shadows were the real
+issue, and that we could work around that by drawing our own borders.
+This also means that setting a titlebar for a GtkWindow will enable CSD
+unconditionally.
+
+In reality, some window managers (like Matchbox) *only* support
+server-side decorations, and will ignore all hints to the contrary, to
+the point of drawing decorations at random locations on top of the
+window.
+
+Since CSD are enabled unconditionally, the GTK_CSD environment variable
+is also not a suitable escape hatch.
+
+In the grand tradition of asking ourselves if we should do something
+just because we can, we should split the environment checks from the
+checks on what the user requested; by doing that, we can also check
+when enabling client-side decorations, and ideally bail out if needed.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=750343
+
+diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
+index 423c6bd..9fe882f 100644
+--- a/gtk/gtkwindow.c
++++ b/gtk/gtkwindow.c
+@@ -4056,6 +4056,32 @@ gtk_window_supports_client_shadow (GtkWindow *window)
+   return TRUE;
+ }
+ 
++static gboolean
++gtk_window_can_use_csd (GtkWindow *window)
++{
++  const gchar *csd_env;
++
++#ifdef GDK_WINDOWING_BROADWAY
++  if (GDK_IS_BROADWAY_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
++    return TRUE;
++#endif
++
++#ifdef GDK_WINDOWING_WAYLAND
++  if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
++    return TRUE;
++#endif
++
++#ifdef GDK_WINDOWING_MIR
++  if (GDK_IS_MIR_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
++    return TRUE;
++#endif
++
++  csd_env = g_getenv ("GTK_CSD");
++
++  /* If GTK_CSD is unset we default to CSD support */
++  return csd_env == NULL || (strcmp (csd_env, "1") == 0);
++}
++
+ static void
+ gtk_window_enable_csd (GtkWindow *window)
+ {
+@@ -4063,6 +4089,10 @@ gtk_window_enable_csd (GtkWindow *window)
+   GtkWidget *widget = GTK_WIDGET (window);
+   GdkVisual *visual;
+ 
++  /* If the environment does not support CSD, then there's no point in enabling them */
++  if (!gtk_window_can_use_csd (window))
++    return;
++
+   /* We need a visual with alpha for client shadows */
+   if (priv->use_client_shadow)
+     {
+@@ -5839,7 +5869,6 @@ static gboolean
+ gtk_window_should_use_csd (GtkWindow *window)
+ {
+   GtkWindowPrivate *priv = window->priv;
+-  const gchar *csd_env;
+ 
+   if (priv->csd_requested)
+     return TRUE;
+@@ -5850,24 +5879,7 @@ gtk_window_should_use_csd (GtkWindow *window)
+   if (priv->type == GTK_WINDOW_POPUP)
+     return FALSE;
+ 
+-#ifdef GDK_WINDOWING_BROADWAY
+-  if (GDK_IS_BROADWAY_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
+-    return TRUE;
+-#endif
+-
+-#ifdef GDK_WINDOWING_WAYLAND
+-  if (GDK_IS_WAYLAND_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
+-    return TRUE;
+-#endif
+-
+-#ifdef GDK_WINDOWING_MIR
+-  if (GDK_IS_MIR_DISPLAY (gtk_widget_get_display (GTK_WIDGET (window))))
+-    return TRUE;
+-#endif
+-
+-  csd_env = g_getenv ("GTK_CSD");
+-
+-  return (g_strcmp0 (csd_env, "1") == 0);
++  return gtk_window_can_use_csd (window);
+ }
+ 
+ static void
+-- 
+cgit v0.10.2
+
diff --git a/meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch b/meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch
new file mode 100644
index 0000000..3b4beeb
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+3/hardcoded_libtool.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+Index: gtk+-3.8.2/configure.ac
+===================================================================
+--- gtk+-3.8.2.orig/configure.ac
++++ gtk+-3.8.2/configure.ac
+@@ -531,7 +531,7 @@ AC_MSG_CHECKING([Whether to write depend
+ case $enable_explicit_deps in
+   auto)
+     export SED
+-    deplibs_check_method=`(./libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
++    deplibs_check_method=`(./$host_alias-libtool --config; echo 'eval echo \"$deplibs_check_method\"') | sh`
+     if test "x$deplibs_check_method" != xpass_all || test "x$enable_static" = xyes ; then
+       enable_explicit_deps=yes
+     else
+@@ -793,7 +793,7 @@ else
+     dnl Now we check to see if our libtool supports shared lib deps
+     dnl (in a rather ugly way even)
+     if $dynworks; then
+-        module_libtool_config="${CONFIG_SHELL-/bin/sh} ./libtool --config"
++        module_libtool_config="${CONFIG_SHELL-/bin/sh} ./$host_alias-libtool --config"
+         module_deplibs_check=`$module_libtool_config | \
+             grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
+             sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
+@@ -1528,7 +1528,7 @@ fi
+ # We are using gmodule-no-export now, but I'm leaving the stripping
+ # code in place for now, since pango and atk still require gmodule.
+ export SED
+-export_dynamic=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
++export_dynamic=`(./$host_alias-libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
+ if test -n "$export_dynamic"; then
+   GDK_DEP_LIBS=`echo $GDK_DEP_LIBS | sed -e "s/$export_dynamic//"`
+   GTK_DEP_LIBS=`echo $GTK_DEP_LIBS | sed -e "s/$export_dynamic//"`
diff --git a/meta/recipes-gnome/gtk+/gtk+3_3.16.6.bb b/meta/recipes-gnome/gtk+/gtk+3_3.16.6.bb
new file mode 100644
index 0000000..1d736a4
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+3_3.16.6.bb
@@ -0,0 +1,18 @@
+require gtk+3.inc
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
+           file://hardcoded_libtool.patch \
+           file://Dont-force-csd.patch \
+          "
+
+SRC_URI[md5sum] = "fc59e5c8b5a4585b60623dd708df400b"
+SRC_URI[sha256sum] = "4d12726d0856a968b41802ae5c5971d7e9bac532717e309d3f81b9989da5ffbe"
+
+S = "${WORKDIR}/gtk+-${PV}"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
+                    file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
+                    file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
+                    file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
diff --git a/meta/recipes-gnome/gtk+/gtk+_2.24.28.bb b/meta/recipes-gnome/gtk+/gtk+_2.24.28.bb
new file mode 100644
index 0000000..e343773
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk+_2.24.28.bb
@@ -0,0 +1,34 @@
+require gtk+.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+                    file://gtk/gtk.h;endline=27;md5=c59e0b4490dd135a5726ebf851f9b17f \
+                    file://gdk/gdk.h;endline=27;md5=07db285ec208fb3e0bf7d861b0614202 \
+                    file://tests/testgtk.c;endline=27;md5=262db5db5f776f9863e56df31423e24c"
+SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-${PV}.tar.xz \
+           file://xsettings.patch \
+           file://hardcoded_libtool.patch \
+           file://toggle-font.diff;striplevel=0 \
+           file://doc-fixes.patch \
+           file://strict-prototypes.patch \
+	  "
+
+SRC_URI[md5sum] = "bfacf87b2ea67e4e5c7866a9003e6526"
+SRC_URI[sha256sum] = "b2c6441e98bc5232e5f9bba6965075dcf580a8726398f7374d39f90b88ed4656"
+
+EXTRA_OECONF = "--enable-xkb --disable-glibtest --disable-cups --disable-xinerama"
+
+LIBV = "2.10.0"
+
+PACKAGES_DYNAMIC += "^gtk-immodule-.* ^gtk-printbackend-.*"
+
+python populate_packages_prepend () {
+    gtk_libdir = d.expand('${libdir}/gtk-2.0/${LIBV}')
+    immodules_root = os.path.join(gtk_libdir, 'immodules')
+    printmodules_root = os.path.join(gtk_libdir, 'printbackends');
+
+    d.setVar('GTKIMMODULES_PACKAGES', ' '.join(do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s')))
+    do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s')
+
+    if (d.getVar('DEBIAN_NAMES', True)):
+        d.setVar('PKG_${PN}', '${MLPREFIX}libgtk-2.0')
+}
diff --git a/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.16.6.bb b/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.16.6.bb
new file mode 100644
index 0000000..cba3815
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk-icon-utils-native_3.16.6.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Native icon utils for GTK+"
+DESCRIPTION = "gtk-update-icon-cache and gtk-encode-symbolic-svg built from GTK+ natively, for build time and on-host postinst script execution."
+SECTION = "libs"
+
+DEPENDS = "glib-2.0-native gdk-pixbuf-native librsvg-native"
+
+LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar.xz \
+          file://Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch"
+SRC_URI[md5sum] = "fc59e5c8b5a4585b60623dd708df400b"
+SRC_URI[sha256sum] = "4d12726d0856a968b41802ae5c5971d7e9bac532717e309d3f81b9989da5ffbe"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2 \
+                    file://gtk/gtk.h;endline=25;md5=1d8dc0fccdbfa26287a271dce88af737 \
+                    file://gdk/gdk.h;endline=25;md5=c920ce39dc88c6f06d3e7c50e08086f2 \
+                    file://tests/testgtk.c;endline=25;md5=cb732daee1d82af7a2bf953cf3cf26f1"
+
+S = "${WORKDIR}/gtk+-${PV}"
+
+inherit pkgconfig native
+
+PKG_CONFIG_FOR_BUILD = "${STAGING_BINDIR_NATIVE}/pkg-config-native"
+
+do_configure() {
+	# Quite ugly but defines enough to compile the tools.
+	if ! test -f gtk/config.h; then
+		echo "#define GETTEXT_PACKAGE \"gtk30\"" >> gtk/config.h
+		echo "#define HAVE_UNISTD_H 1" >> gtk/config.h
+		echo "#define HAVE_FTW_H 1" >> gtk/config.h
+	fi
+	if ! test -f gdk/config.h; then
+		touch gdk/config.h
+	fi
+}
+
+do_compile() {
+	${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
+		${S}/gtk/updateiconcache.c \
+		$(${PKG_CONFIG_FOR_BUILD} --cflags --libs gdk-pixbuf-2.0) \
+		-o gtk-update-icon-cache
+
+	${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} \
+		${S}/gtk/encodesymbolic.c \
+		$(${PKG_CONFIG_FOR_BUILD} --cflags --libs gio-2.0 gdk-pixbuf-2.0) \
+		-o gtk-encode-symbolic-svg
+}
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 ${B}/gtk-update-icon-cache ${D}${bindir}
+	install -m 0755 ${B}/gtk-encode-symbolic-svg ${D}${bindir}
+
+	create_wrapper ${D}/${bindir}/gtk-update-icon-cache \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
+	create_wrapper ${D}/${bindir}/gtk-encode-symbolic-svg \
+		GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/2.10.0/loaders.cache
+}
+
+# Prevent bitbake from optimizing away the native librsvg sysroot population
+do_populate_sysroot_setscene[depends] += "librsvg-native:do_populate_sysroot_setscene"
diff --git a/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch b/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch
new file mode 100644
index 0000000..237f803
--- /dev/null
+++ b/meta/recipes-gnome/gtk+/gtk-icon-utils/Remove-Gdk-dependency-from-gtk-encode-symbolic-svg.patch
@@ -0,0 +1,102 @@
+From 4d09ff324419fe4e671233044e424378da53969b Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 9 Jun 2015 14:20:30 +0300
+Subject: [PATCH] Remove Gdk-dependency from gtk-encode-symbolic-svg
+
+Building gtk-encode-symbolic-svg without building Gdk is useful
+as only the icon tools are needed on the native build: this makes
+native build much faster and requires much less dependencies.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ gtk/encodesymbolic.c | 36 ++++++++++--------------------------
+ 1 file changed, 10 insertions(+), 26 deletions(-)
+
+diff --git a/gtk/encodesymbolic.c b/gtk/encodesymbolic.c
+index 9f7d015..1f07563 100644
+--- a/gtk/encodesymbolic.c
++++ b/gtk/encodesymbolic.c
+@@ -19,7 +19,6 @@
+ 
+ #include <glib.h>
+ #include <gdk-pixbuf/gdk-pixdata.h>
+-#include <gdk/gdk.h>
+ #include <glib/gi18n.h>
+ 
+ #ifdef HAVE_UNISTD_H
+@@ -43,30 +42,18 @@ static GdkPixbuf *
+ load_symbolic_svg (char *file_data, gsize file_len,
+                    int width,
+                    int height,
+-                   const GdkRGBA  *fg,
+-                   const GdkRGBA  *success_color,
+-                   const GdkRGBA  *warning_color,
+-                   const GdkRGBA  *error_color,
++                   const char *css_fg,
++                   const char *css_success,
++                   const char *css_warning,
++                   const char *css_error,
+                    GError        **error)
+ {
+   GInputStream *stream;
+   GdkPixbuf *pixbuf;
+-  gchar *css_fg;
+-  gchar *css_success;
+-  gchar *css_warning;
+-  gchar *css_error;
+   gchar *data;
+   gchar *svg_width, *svg_height;
+   gchar *escaped_file_data;
+ 
+-  css_fg = gdk_rgba_to_string (fg);
+-
+-  css_success = css_warning = css_error = NULL;
+-
+-  css_warning = gdk_rgba_to_string (warning_color);
+-  css_error = gdk_rgba_to_string (error_color);
+-  css_success = gdk_rgba_to_string (success_color);
+-
+   /* Fetch size from the original icon */
+   stream = g_memory_input_stream_new_from_data (file_data, file_len, NULL);
+   pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, error);
+@@ -105,10 +92,6 @@ load_symbolic_svg (char *file_data, gsize file_len,
+                       "</svg>",
+                       NULL);
+   g_free (escaped_file_data);
+-  g_free (css_fg);
+-  g_free (css_warning);
+-  g_free (css_error);
+-  g_free (css_success);
+   g_free (svg_width);
+   g_free (svg_height);
+ 
+@@ -167,7 +150,8 @@ make_symbolic_pixbuf (char *file,
+                       GError        **error)
+ 
+ {
+-  GdkRGBA r = { 1,0,0,1}, g = {0,1,0,1};
++  const char r[] = "rgba(255,0,0,1)";
++  const char g[] = "rgba(0,255,0,1)";
+   GdkPixbuf *loaded;
+   GdkPixbuf *pixbuf;
+   int plane;
+@@ -196,10 +180,10 @@ make_symbolic_pixbuf (char *file,
+        * the "rest", as all color fractions should add up to 1.
+        */
+       loaded = load_symbolic_svg (file_data, file_len, width, height,
+-                                  &g,
+-                                  plane == 0 ? &r : &g,
+-                                  plane == 1 ? &r : &g,
+-                                  plane == 2 ? &r : &g,
++                                  g,
++                                  plane == 0 ? r : g,
++                                  plane == 1 ? r : g,
++                                  plane == 2 ? r : g,
+                                   error);
+       if (loaded == NULL)
+         return NULL;
+-- 
+2.1.4
+
diff --git a/meta/recipes-gnome/gtk-doc-stub/gtk-doc-stub_git.bb b/meta/recipes-gnome/gtk-doc-stub/gtk-doc-stub_git.bb
new file mode 100644
index 0000000..40f3243
--- /dev/null
+++ b/meta/recipes-gnome/gtk-doc-stub/gtk-doc-stub_git.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Stub implementation of gtk-doc"
+DESCRIPTION = "Stub implementation of gtk-doc, as we don't want to build the API documentation"
+SECTION = "x11/base"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+PROVIDES = "gtk-doc gobject-introspection-stub"
+
+SRCREV = "1dea266593edb766d6d898c79451ef193eb17cfa"
+PV = "1.1+git${SRCPV}"
+
+SRC_URI = "git://git.gnome.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools
+
+FILES_${PN} += "${datadir}"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/glib-2.32.patch b/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/glib-2.32.patch
new file mode 100644
index 0000000..f0b878d
--- /dev/null
+++ b/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/glib-2.32.patch
@@ -0,0 +1,23 @@
+From 8d49a386f467cbf8e0842d2218126f643e50f834 Mon Sep 17 00:00:00 2001
+From: Dominique Leuenberger <dimstar@opensuse.org>
+Date: Sun, 27 Nov 2011 14:24:57 +0000
+Subject: Fix build with glib 2.31: Only glib.h can be #include'd. Fixes bug #664914
+
+Upstream-Status: Backport
+
+---
+diff --git a/engines/clearlooks/src/animation.c b/engines/clearlooks/src/animation.c
+index 1f7a41f..56a9286 100644
+--- a/engines/clearlooks/src/animation.c
++++ b/engines/clearlooks/src/animation.c
+@@ -28,7 +28,7 @@
+ #include "animation.h"
+ 
+ #ifdef HAVE_WORKING_ANIMATION
+-#include <glib/gtimer.h>
++#include <glib.h>
+ 
+ struct _AnimationInfo {
+ 	GTimer *timer;
+--
+cgit v0.9.0.2
diff --git a/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/substitute-tests.patch b/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/substitute-tests.patch
new file mode 100644
index 0000000..5c557ba
--- /dev/null
+++ b/meta/recipes-gnome/gtk-engines/gtk-engines-2.20.2/substitute-tests.patch
@@ -0,0 +1,37 @@
+Upstream-Status: Pending
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd gtk-engines-2.20.2/configure.ac gtk-engines-2.20.2/configure.ac
+--- gtk-engines-2.20.2/configure.ac	2010-10-01 15:42:37.000000000 +0300
++++ gtk-engines-2.20.2/configure.ac	2013-08-20 02:50:27.930510565 +0300
+@@ -166,6 +166,9 @@
+
+ AC_SUBST(DEVELOPMENT_CFLAGS)
+
++AC_SUBST([exported_symbols_tests], [[$(EXPORTED_SYMBOLS_TESTS)]])
++AC_SUBST([torture_test_tests], [[$(TORTURE_TEST_TESTS)]])
++
+ AM_CONFIG_HEADER([engines/support/config.h])
+
+ AC_CONFIG_FILES([
+diff -Nurd gtk-engines-2.20.2/test/Makefile.am gtk-engines-2.20.2/test/Makefile.am
+--- gtk-engines-2.20.2/test/Makefile.am	2010-09-19 18:18:21.000000000 +0300
++++ gtk-engines-2.20.2/test/Makefile.am	2013-08-20 02:50:36.842510865 +0300
+@@ -66,7 +66,7 @@
+ # Prefix with exported_
+ EXPORTED_SYMBOLS_TESTS = $(patsubst %,exported_%,$(BUILD_ENGINES))
+
+-TESTS += $(EXPORTED_SYMBOLS_TESTS)
++TESTS += @exported_symbols_tests@
+
+
+ #############################################################
+@@ -88,7 +88,7 @@
+ TORTURE_TEST_TESTS = torture_buildin $(patsubst %,torture_%,$(TORTURE_TEST_ENGINES))
+
+ # Add TORTURE_TEST_ENGINES to list of tests
+-TESTS += $(TORTURE_TEST_TESTS)
++TESTS += @torture_test_tests@
+
+ # Possible other tests:
+ #  - An extensive theme switch tests that loads/unloads the engine
diff --git a/meta/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb b/meta/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb
new file mode 100644
index 0000000..c30454c
--- /dev/null
+++ b/meta/recipes-gnome/gtk-engines/gtk-engines_2.20.2.bb
@@ -0,0 +1,49 @@
+SUMMARY = "GTK+ theme engines"
+HOMEPAGE = "http://www.gnome.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+SECTION = "x11/base"
+DEPENDS = "intltool-native gtk+"
+
+PR = "r3"
+
+PACKAGES += "${PN}-schemas"
+PACKAGES_DYNAMIC += "^gtk-engine-.* ^gtk-theme-.*"
+
+RDEPENDS_gtk-theme-redmond = "gtk-engine-redmond95"
+RDEPENDS_gtk-theme-metal = "gtk-engine-metal"
+RDEPENDS_gtk-theme-mist = "gtk-engine-mist"
+RDEPENDS_gtk-theme-crux = "gtk-engine-crux-engine"
+RDEPENDS_gtk-theme-lighthouseblue = "gtk-engine-lighthouseblue"
+RDEPENDS_gtk-theme-thinice = "gtk-engine-thinice"
+RDEPENDS_gtk-theme-industrial = "gtk-engine-industrial"
+RDEPENDS_gtk-theme-clearlooks = "gtk-engine-clearlooks"
+
+FILES_${PN} = ""
+FILES_${PN}-dev += "${libdir}/gtk-2.0/*/engines/*.la"
+FILES_${PN}-dbg += "${libdir}/gtk-2.0/*/engines/.debug"
+FILES_${PN}-schemas = "${datadir}/gtk-engines/*.xml"
+
+CFLAGS_prepend = "-DHAVE_ANIMATION "
+
+RDEPENDS_${PN}-dev = ""
+
+inherit gnomebase
+GNOME_COMPRESS_TYPE="bz2"
+
+python populate_packages_prepend() {
+    engines_root = os.path.join(d.getVar('libdir', True), "gtk-2.0/2.10.0/engines")
+    themes_root = os.path.join(d.getVar('datadir', True), "themes")
+
+    do_split_packages(d, engines_root, '^lib(.*)\.so$', 'gtk-engine-%s', 'GTK %s theme engine', extra_depends='')
+    do_split_packages(d, themes_root, '(.*)', 'gtk-theme-%s', 'GTK theme %s', allow_dirs=True, extra_depends='')
+    # TODO: mark theme packages as arch all
+}
+
+SRC_URI += "file://glib-2.32.patch \
+            file://substitute-tests.patch"
+SRC_URI[archive.md5sum] = "5deb287bc6075dc21812130604c7dc4f"
+SRC_URI[archive.sha256sum] = "15b680abca6c773ecb85253521fa100dd3b8549befeecc7595b10209d62d66b5"
diff --git a/meta/recipes-gnome/gtk-theme-torturer/gtk-theme-torturer_git.bb b/meta/recipes-gnome/gtk-theme-torturer/gtk-theme-torturer_git.bb
new file mode 100644
index 0000000..889fd89
--- /dev/null
+++ b/meta/recipes-gnome/gtk-theme-torturer/gtk-theme-torturer_git.bb
@@ -0,0 +1,21 @@
+SUMMARY = "GTK+ Theme benchmark program"
+DEPENDS = "gtk+"
+HOMEPAGE = "http://wiki.laptop.org/go/GTK_for_OLPC"
+SECTION = "devel"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://appwindow.c;endline=13;md5=8c09920de460c7ea1f64ee56986aabd9"
+
+SRCREV = "99962ae39bb5aadb31929b25c58e1a053f9c9545"
+PV = "0.0.0+git${SRCPV}"
+
+SRC_URI = "git://dev.laptop.org/projects/soc-gtk/"
+S = "${WORKDIR}/git/gtk-theme-torturer"
+
+CFLAGS += "-Wl,-rpath-link,${STAGING_LIBDIR}"
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 torturer ${D}${bindir}
+}
+
+
diff --git a/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.15.bb b/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.15.bb
new file mode 100644
index 0000000..a704632
--- /dev/null
+++ b/meta/recipes-gnome/hicolor-icon-theme/hicolor-icon-theme_0.15.bb
@@ -0,0 +1,14 @@
+SUMMARY = "Default icon theme that all icon themes automatically inherit from"
+HOMEPAGE = "http://icon-theme.freedesktop.org/wiki/HicolorTheme"
+BUGTRACKER = "https://bugs.freedesktop.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f08a446809913fc9b3c718f0eaea0426"
+
+SRC_URI = "http://icon-theme.freedesktop.org/releases/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "6aa2b3993a883d85017c7cc0cfc0fb73"
+SRC_URI[sha256sum] = "9cc45ac3318c31212ea2d8cb99e64020732393ee7630fa6c1810af5f987033cc"
+
+inherit allarch autotools
+
+FILES_${PN} += "${datadir}/icons"
diff --git a/meta/recipes-gnome/json-glib/json-glib_1.0.4.bb b/meta/recipes-gnome/json-glib/json-glib_1.0.4.bb
new file mode 100644
index 0000000..4908ac0
--- /dev/null
+++ b/meta/recipes-gnome/json-glib/json-glib_1.0.4.bb
@@ -0,0 +1,18 @@
+SUMMARY = "JSON-GLib implements a full JSON parser using GLib and GObject"
+DESCRIPTION = "Use JSON-GLib it is possible to parse and generate valid JSON\
+ data structures, using a DOM-like API. JSON-GLib also offers GObject \
+integration, providing the ability to serialize and deserialize GObject \
+instances to and from JSON data types."
+HOMEPAGE = "http://live.gnome.org/JsonGlib"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+DEPENDS = "glib-2.0"
+
+SRC_URI[archive.md5sum] = "3131b0417ecde3da1ae72acceaa375cf"
+SRC_URI[archive.sha256sum] = "80f3593cb6bd13f1465828e46a9f740e2e9bd3cd2257889442b3e62bd6de05cd"
+
+inherit gnomebase gettext lib_package
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-gnome/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch b/meta/recipes-gnome/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch
new file mode 100644
index 0000000..db96e63
--- /dev/null
+++ b/meta/recipes-gnome/libffi/libffi/0001-mips-Use-compiler-internal-define-for-linux.patch
@@ -0,0 +1,32 @@
+From a5efaa96fd934eb245c234a5275fcf62698ef986 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 2 Apr 2015 21:38:03 -0700
+Subject: [PATCH] mips: Use compiler internal define for linux
+
+__linux__ is defined by compiler when building for
+linux platforms, lets use it
+
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/mips/ffitarget.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mips/ffitarget.h b/src/mips/ffitarget.h
+index 717d659..6faa358 100644
+--- a/src/mips/ffitarget.h
++++ b/src/mips/ffitarget.h
+@@ -32,7 +32,7 @@
+ #error "Please do not include ffitarget.h directly into your source.  Use ffi.h instead."
+ #endif
+ 
+-#ifdef linux
++#ifdef __linux__
+ # include <asm/sgidefs.h>
+ #elif defined(__rtems__)
+ /*
+-- 
+2.1.4
+
diff --git a/meta/recipes-gnome/libffi/libffi/fix-libffi.la-location.patch b/meta/recipes-gnome/libffi/libffi/fix-libffi.la-location.patch
new file mode 100644
index 0000000..775bffc
--- /dev/null
+++ b/meta/recipes-gnome/libffi/libffi/fix-libffi.la-location.patch
@@ -0,0 +1,18 @@
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: libffi-3.0.13/Makefile.am
+===================================================================
+--- libffi-3.0.13.orig/Makefile.am
++++ libffi-3.0.13/Makefile.am
+@@ -98,7 +98,7 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
+ 
+ MAKEOVERRIDES=
+ 
+-toolexeclib_LTLIBRARIES = libffi.la
++lib_LTLIBRARIES = libffi.la
+ noinst_LTLIBRARIES = libffi_convenience.la
+ 
+ libffi_la_SOURCES = src/prep_cif.c src/types.c \
diff --git a/meta/recipes-gnome/libffi/libffi_3.2.1.bb b/meta/recipes-gnome/libffi/libffi_3.2.1.bb
new file mode 100644
index 0000000..fd916ca
--- /dev/null
+++ b/meta/recipes-gnome/libffi/libffi_3.2.1.bb
@@ -0,0 +1,26 @@
+SUMMARY = "A portable foreign function interface library"
+DESCRIPTION = "The `libffi' library provides a portable, high level programming interface to various calling \
+conventions.  This allows a programmer to call any function specified by a call interface description at run \
+time. FFI stands for Foreign Function Interface.  A foreign function interface is the popular name for the \
+interface that allows code written in one language to call code written in another language.  The `libffi' \
+library really only provides the lowest, machine dependent layer of a fully featured foreign function interface.  \
+A layer must exist above `libffi' that handles type conversions for values passed between the two languages."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3610bb17683a0089ed64055416b2ae1b"
+
+SRC_URI = "ftp://sourceware.org/pub/libffi/${BP}.tar.gz \
+           file://fix-libffi.la-location.patch \
+	   file://0001-mips-Use-compiler-internal-define-for-linux.patch \
+	   "
+
+SRC_URI[md5sum] = "83b89587607e3eb65c70d361f13bab43"
+SRC_URI[sha256sum] = "d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37"
+
+EXTRA_OECONF += "--disable-builddir"
+
+inherit autotools texinfo
+
+FILES_${PN}-dev += "${libdir}/libffi-${PV}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-gnome/libglade/libglade-2.6.4/glade-cruft.patch b/meta/recipes-gnome/libglade/libglade-2.6.4/glade-cruft.patch
new file mode 100644
index 0000000..c5d5864
--- /dev/null
+++ b/meta/recipes-gnome/libglade/libglade-2.6.4/glade-cruft.patch
@@ -0,0 +1,102 @@
+Upstream-Status: Pending
+
+diff -ur libglade-2.4.0~/configure.in libglade-2.4.0/configure.in
+--- libglade-2.4.0~/configure.in	2004-05-17 12:38:31.000000000 +0100
++++ libglade-2.4.0/configure.in	2004-07-28 16:53:09.000000000 +0100
+@@ -147,6 +147,18 @@
+ AM_CONDITIONAL(HAVE_PYTHON, $have_python)
+ AC_SUBST(PYTHON)
+ 
++AC_MSG_CHECKING([for cruft in libgtk])
++AC_TRY_LINK([
++#include <gtk/gtk.h>
++#include <stdio.h>
++],      [ gtk_tree_get_type (); return 0; ],
++        [ AC_MSG_RESULT(yes)
++          have_cruft=yes ],
++        [ AC_MSG_RESULT(no)
++	  AC_DEFINE(DISABLE_CRUFT,,[leave out support for old, broken widgets])
++          have_cruft=no ])
++AC_SUBST(DISABLE_CRUFT)
++
+ dnl add debugging options ...
+ changequote(,)dnl
+ if test "x$GCC" = xyes; then
+Only in libglade-2.4.0: configure.in.orig
+diff -ur libglade-2.4.0~/glade/glade-gtk.c libglade-2.4.0/glade/glade-gtk.c
+--- libglade-2.4.0~/glade/glade-gtk.c	2004-03-13 13:47:35.000000000 +0000
++++ libglade-2.4.0/glade/glade-gtk.c	2004-07-28 16:53:52.000000000 +0100
+@@ -213,6 +213,8 @@
+ 	gtk_clist_column_titles_hide (GTK_CLIST (w));
+ }
+ 
++#ifndef DISABLE_CRUFT
++
+ static void
+ tree_set_selection_mode (GladeXML *xml, GtkWidget *w,
+ 			 const char *name, const char *value)
+@@ -238,6 +240,8 @@
+     gtk_tree_set_view_lines (GTK_TREE (w), BOOL (value));
+ }
+ 
++#endif
++
+ static void
+ list_set_selection_mode (GladeXML *xml, GtkWidget *w,
+ 			 const char *name, const char *value)
+@@ -254,6 +258,7 @@
+     gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (w), BOOL (value));
+ }
+ 
++#ifndef DISABLE_CRUFT
+ static void
+ text_set_text (GladeXML *xml, GtkWidget *w,
+ 	       const char *name, const char *value)
+@@ -262,6 +267,7 @@
+ 
+     gtk_editable_insert_text (GTK_EDITABLE (w), value, -1, &pos);
+ }
++#endif
+ 
+ static void
+ radio_menu_item_set_group (GladeXML *xml, GtkWidget *w,
+@@ -1125,13 +1131,17 @@
+     glade_register_custom_prop (GTK_TYPE_CLIST, "selection_mode", clist_set_selection_mode);
+     glade_register_custom_prop (GTK_TYPE_CLIST, "shadow_type", clist_set_shadow_type);
+     glade_register_custom_prop (GTK_TYPE_CLIST, "show_titles", clist_set_show_titles);
++#ifndef DISABLE_CRUFT
+     glade_register_custom_prop (GTK_TYPE_TREE, "selection_mode", tree_set_selection_mode);
+     glade_register_custom_prop (GTK_TYPE_TREE, "view_mode", tree_set_view_mode);
+     glade_register_custom_prop (GTK_TYPE_TREE, "view_line", tree_set_view_line);
++#endif
+     glade_register_custom_prop (GTK_TYPE_LIST, "selection_mode", list_set_selection_mode);
+     glade_register_custom_prop (GTK_TYPE_CHECK_MENU_ITEM, "always_show_toggle",
+ 				check_menu_item_set_always_show_toggle);
++#ifndef DISABLE_CRUFT
+     glade_register_custom_prop (GTK_TYPE_TEXT, "text", text_set_text);
++#endif
+     glade_register_custom_prop (GTK_TYPE_RADIO_MENU_ITEM, "group",
+ 				radio_menu_item_set_group);
+     glade_register_custom_prop (GTK_TYPE_TOOLBAR, "tooltips", toolbar_set_tooltips);
+@@ -1288,8 +1298,10 @@
+ 			   glade_standard_build_children, NULL);
+     glade_register_widget (GTK_TYPE_TEAROFF_MENU_ITEM, glade_standard_build_widget,
+ 			   NULL, NULL);
++#ifndef DISABLE_CRUFT
+     glade_register_widget (GTK_TYPE_TEXT, glade_standard_build_widget,
+ 			   NULL, NULL);
++#endif
+     glade_register_widget (GTK_TYPE_TEXT_VIEW, glade_standard_build_widget,
+ 			   NULL, NULL);
+     glade_register_widget (GTK_TYPE_TIPS_QUERY, glade_standard_build_widget,
+@@ -1304,8 +1316,10 @@
+ 			   glade_standard_build_children, NULL);
+     glade_register_widget (GTK_TYPE_TOOL_BUTTON, glade_standard_build_widget,
+ 			   NULL, NULL);
++#ifndef DISABLE_CRUFT
+     glade_register_widget (GTK_TYPE_TREE, glade_standard_build_widget,
+ 			   NULL, NULL);
++#endif
+     glade_register_widget (GTK_TYPE_TREE_VIEW, glade_standard_build_widget,
+ 			   NULL, NULL);
+     glade_register_widget (GTK_TYPE_VBUTTON_BOX, glade_standard_build_widget,
diff --git a/meta/recipes-gnome/libglade/libglade-2.6.4/no-xml2.patch b/meta/recipes-gnome/libglade/libglade-2.6.4/no-xml2.patch
new file mode 100644
index 0000000..dc4c092
--- /dev/null
+++ b/meta/recipes-gnome/libglade/libglade-2.6.4/no-xml2.patch
@@ -0,0 +1,501 @@
+Upstream-Status: Inappropriate [configuration]
+
+diff -urN libglade-2.4.2.orig/configure.in libglade-2.4.2/configure.in
+--- libglade-2.4.2.orig/configure.in	2005-02-11 12:42:58.000000000 +0100
++++ libglade-2.4.2/configure.in	2005-03-22 01:22:00.000000000 +0100
+@@ -52,11 +52,33 @@
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ 
+ PKG_CHECK_MODULES(LIBGLADE, [dnl
+-  libxml-2.0 >= required_libxml_version dnl
+   atk >= required_atk_version dnl
+   gtk+-2.0 >= required_gtk_version dnl
+   glib-2.0 >= required_glib_version])
+ 
++disable_xml2=no
++AC_ARG_WITH([libxml2],
++  AC_HELP_STRING([--without-libxml2], [Don't use libxml2, use Glib's GMarkupParser instead]),
++  [disable_xml2=yes],
++  [disable_xml2=no])
++
++AC_MSG_CHECKING([if we are using libxml2])
++if test "x$disable_xml2" == "xno"; then
++  AC_MSG_RESULT(yes)
++  PKG_CHECK_MODULES(XML2, libxml-2.0 >= 2.4.10)
++  PKGCFG_REQUIRE_LIBXML2="libxml-2.0"
++  LIBGLADE_CFLAGS="$LIBGLADE_CFLAGS $XML2_CFLAGS"
++  LIBGLADE_LIBS="$LIBGLADE_LIBS $XML2_LIBS"
++else
++  LIBGLADE_CFLAGS="$LIBGLADE_CFLAGS -DUSE_GMARKUP_PARSER"
++  PKGCFG_REQUIRE_LIBXML2=""
++  AC_MSG_RESULT(no)
++fi
++
++AC_SUBST(XML2_LIBS)
++AC_SUBST(XML2_CFLAGS)
++AC_SUBST(PKGCFG_REQUIRE_LIBXML2)
++
+ AC_MSG_CHECKING([for native Win32])
+ case "$host" in
+   *-*-mingw*)
+@@ -116,6 +138,21 @@
+   fi
+ fi
+ 
++if test "x$disable_xml2" == "xyes"; then
++  echo "*****************************************************"
++  echo "  You chose to disable libxml2 and use Glib's"
++  echo "  GMarkupParser instead." 
++  echo  
++  echo "  Please bear in mind that using libglade with"
++  echo "  GMarkupParser is an experimental feature only."
++  echo
++  echo "  Please post problems or success stories to"
++  echo "  the glade-devel mailing list. Thank you."
++  echo "*****************************************************"
++fi
++
++
++
+ GTK_DOC_CHECK(1.0)
+ 
+ dnl gettext stuff ... there is no message catalog for libglade -- libglade
+diff -urN libglade-2.4.2.orig/glade/glade-parser.c libglade-2.4.2/glade/glade-parser.c
+--- libglade-2.4.2.orig/glade/glade-parser.c	2004-11-11 11:56:13.000000000 +0100
++++ libglade-2.4.2/glade/glade-parser.c	2005-03-22 01:20:00.000000000 +0100
+@@ -34,7 +34,15 @@
+ #  define dgettext(Domain, String) (String)
+ #endif
+ 
+-#include <libxml/parser.h>
++#ifdef USE_GMARKUP_PARSER
++#  include <zlib.h>
++#else
++#  include <libxml/parser.h>
++#endif
++
++#ifdef USE_GMARKUP_PARSER
++#  define xmlChar gchar
++#endif
+ 
+ #include "glade-parser.h"
+ #include "glade-private.h"
+@@ -508,7 +516,9 @@
+     case PARSER_START:
+ 	if (!strcmp(name, "glade-interface")) {
+ 	    state->state = PARSER_GLADE_INTERFACE;
+-#if 0
++
++#ifndef USE_GMARKUP_PARSER
++ #if 0
+ 	    /* check for correct XML namespace */
+ 	    for (i = 0; attrs && attrs[i] != NULL; i += 2) {
+ 		if (!strcmp(attrs[i], "xmlns") &&
+@@ -518,7 +528,9 @@
+ 		    g_warning("unknown attribute `%s' for <glade-interface>",
+ 			      attrs[i]);
+ 	    }
++ #endif
+ #endif
++
+ 	} else {
+ 	    g_warning("Expected <glade-interface>.  Got <%s>.", name);
+ 	    state->prev_state = state->state;
+@@ -1063,12 +1075,18 @@
+     }
+ }
+ 
++#ifndef USE_GMARKUP_PARSER
++
+ static xmlEntityPtr
+ glade_parser_get_entity(GladeParseState *state, const xmlChar *name)
+ {
+     return xmlGetPredefinedEntity(name);
+ }
+ 
++#endif /* !defined(USE_GMARKUP_PARSER) */
++
++#ifndef USE_GMARKUP_PARSER
++
+ static void
+ glade_parser_warning(GladeParseState *state, const char *msg, ...)
+ {
+@@ -1079,6 +1097,10 @@
+     va_end(args);
+ }
+ 
++#endif /* !defined(USE_GMARKUP_PARSER) */
++
++#ifndef USE_GMARKUP_PARSER
++
+ static void
+ glade_parser_error(GladeParseState *state, const char *msg, ...)
+ {
+@@ -1089,6 +1111,10 @@
+     va_end(args);
+ }
+ 
++#endif /* !defined(USE_GMARKUP_PARSER) */
++
++#ifndef USE_GMARKUP_PARSER
++
+ static void
+ glade_parser_fatal_error(GladeParseState *state, const char *msg, ...)
+ {
+@@ -1099,6 +1125,10 @@
+     va_end(args);
+ }
+ 
++#endif /* !defined(USE_GMARKUP_PARSER) */
++
++#ifndef USE_GMARKUP_PARSER
++
+ static xmlSAXHandler glade_parser = {
+     (internalSubsetSAXFunc)NULL,                       /* internalSubset */
+     (isStandaloneSAXFunc)NULL,                         /* isStandalone */
+@@ -1126,6 +1156,82 @@
+     (fatalErrorSAXFunc)glade_parser_fatal_error,       /* fatalError */
+ };
+ 
++#else /* USE_GMARKUP_PARSER */
++
++static void
++glade_parser_start_element_wrapper(GMarkupParseContext *context,
++                                   const gchar         *name, 
++                                   const gchar        **attr_names,
++                                   const gchar        **attr_values,
++                                   gpointer             state,
++                                   GError             **error)
++{
++    guint i = 0;
++
++    /* Pack attribute names/values from two separate
++     *  arrays (GMarkupParser style) into one single
++     *  array (libxml SAXParser style). This is not
++     *  very efficient, but we do it to make the
++     *  GMarkupParser code as little invasive as
++     *  possible. */
++
++    while (attr_names[i] != NULL) {
++      ++i;
++    }
++
++    if (1)
++    {
++        const gchar *attr[(i*2)+1];
++        guint j, k;
++       
++        for (j=0, k=0;  k < i;  j += 2)
++        {
++            attr[j] = attr_names[k];
++            attr[j+1] = attr_values[k];
++            ++k;
++        }
++        attr[i*2] = NULL;
++
++        glade_parser_start_element((GladeParseState*)state, name, attr);
++    }
++}
++
++static void
++glade_parser_end_element_wrapper(GMarkupParseContext *context, 
++                                 const gchar         *name,
++                                 gpointer             state,
++                                 GError             **err)
++{
++    glade_parser_end_element((GladeParseState*)state, name);
++}
++
++static void
++glade_parser_characters_wrapper(GMarkupParseContext *context, 
++                                const gchar         *chars, 
++                                gsize                len,
++                                gpointer             state,
++                                GError             **err)
++{
++    glade_parser_characters((GladeParseState*)state, chars, (int) len);
++}
++
++static void
++glade_parser_error(GMarkupParseContext *context, GError *err, gpointer data)
++{
++    g_log("Glade-Parser", G_LOG_LEVEL_CRITICAL, "%s", err->message);
++}
++
++static const GMarkupParser   glade_parser = {
++    glade_parser_start_element_wrapper,  /* element open   */
++    glade_parser_end_element_wrapper,    /* element close  */
++    glade_parser_characters_wrapper,     /* text content   */
++    NULL,                                /* passthrough    */
++    glade_parser_error,                  /* parse error    */
++};
++
++#endif /* USE_GMARKUP_PARSER */
++
++
+ static void
+ widget_info_free(GladeWidgetInfo *info)
+ {
+@@ -1191,6 +1297,9 @@
+  *
+  * Returns: the GladeInterface structure for the XML file.
+  */
++
++#ifndef USE_GMARKUP_PARSER
++
+ GladeInterface *
+ glade_parser_parse_file(const gchar *file, const gchar *domain)
+ {
+@@ -1222,6 +1331,31 @@
+     return state.interface;
+ }
+ 
++#else /* defined(USE_GMARKUP_PARSER) */
++
++GladeInterface *
++glade_parser_parse_file(const gchar *file, const gchar *domain)
++{
++    GladeInterface  *interface;
++    GError          *err     = NULL;
++    gchar           *content = NULL;
++    gsize            clen;
++
++    if (!g_file_get_contents(file, &content, &clen, &err)) {
++        g_warning("could not load glade file: %s", err->message);
++        g_error_free(err);
++        return NULL;
++    }
++
++    interface = glade_parser_parse_buffer(content, (gint) clen, domain);
++
++    g_free(content);
++
++    return interface;
++}
++
++#endif /* USE_GMARKUP_PARSER */
++
+ /**
+  * glade_parser_parse_buffer
+  * @buffer: a buffer in memory containing XML data.
+@@ -1237,6 +1371,9 @@
+  *
+  * Returns: the GladeInterface structure for the XML buffer.
+  */
++
++#ifndef USE_GMARKUP_PARSER
++
+ GladeInterface *
+ glade_parser_parse_buffer(const gchar *buffer, gint len, const gchar *domain)
+ {
+@@ -1263,6 +1400,161 @@
+     return state.interface;
+ }
+ 
++#else /* defined(USE_GMARKUP_PARSER) */
++
++
++static GladeInterface *
++glade_parser_parse_buffer_internal(const gchar *buffer, gint len, const gchar *domain)
++{
++	GMarkupParseContext  *context;
++	GladeParseState       state = { 0 };
++	GError               *err   = NULL;
++
++	state.interface = NULL;
++	if (domain)
++		state.domain = domain;
++	else
++		state.domain = textdomain(NULL);
++
++	/* FIXME: This strstr() is not safe, as it ignores the len
++	 *        argument and assumes the buffer is NUL-terminated */
++	if (strstr(buffer, "<?xml") == NULL) {
++		g_warning("No XML header found in document!");
++		return NULL;
++	}
++
++	context = g_markup_parse_context_new(&glade_parser, (GMarkupParseFlags) 0, &state, NULL);
++
++	glade_parser_start_document(&state);
++
++	if (!g_markup_parse_context_parse(context, buffer, (gssize) len, &err)) {
++		g_warning("document not well formed: %s", err->message);
++		g_error_free(err);
++		if (state.interface)
++			glade_interface_destroy (state.interface);
++		return NULL;
++	}
++
++	glade_parser_end_document(&state);
++
++	if (state.state != PARSER_FINISH) {
++		g_warning("did not finish in PARSER_FINISH state!");
++
++		if (state.interface)
++			glade_interface_destroy(state.interface);
++
++		return NULL;
++	}
++
++	return state.interface;
++}
++
++struct _gzip_rfc1952_hdr
++{
++	guint8	id1, id2, cm, flags;
++	guint32 mtime;
++	guint8  xflags;
++	guint8  os;
++};
++
++static GladeInterface *
++glade_parser_parse_gzipped_buffer(const gchar *buffer, gint len, const gchar *domain)
++{
++	struct _gzip_rfc1952_hdr *hdr = (struct _gzip_rfc1952_hdr*)buffer;
++	struct z_stream_s         zstream;
++	GladeInterface           *interface;
++	const guint8             *cbuf;              /* start of compressed data */
++	guint8                   *decompress_buf;
++	gulong                    decompress_len = 0;
++	gint                      ret;
++
++	g_assert(hdr != NULL && hdr->id1 == 0x1f && hdr->id2 == 0x8b);
++
++	if (hdr->cm != Z_DEFLATED) {
++		g_warning("Unknown decompression method %u", (guint) hdr->cm);
++		return NULL;
++	}
++
++	/* Uncompressed size (modulo 2^32) is last
++	 *  4 bytes of gzipped file, and little endian.
++	 *  See RFC 1952 */
++	decompress_len = GUINT32_FROM_LE(*((guint32*)(((guint8*)buffer) + len - 4)));
++
++	/* paranoid mode: glade files > 5MB are unlikely */
++	g_return_val_if_fail(decompress_len < 5*1024*1024, NULL);
++
++	decompress_buf = g_malloc0(decompress_len + 1); /* +1 for NUL-terminator */
++
++	/* find start of compressed data, skipping header stuff */
++	cbuf = (guint8*)buffer + 10;
++	if (hdr->flags & 0x04) {
++		guint16 xlen = GUINT16_FROM_LE(*((guint16*)cbuf));
++		cbuf += xlen + 2;
++	}
++	if (hdr->flags & 0x08) {
++		guint16 onamelen = strlen(cbuf);
++		cbuf += onamelen + 1;
++	}
++	if (hdr->flags & 0x10) {
++		guint16 commentlen = strlen(cbuf);
++		cbuf += commentlen + 1;
++	}
++	if (hdr->flags & 0x02)
++	{
++		cbuf += 2; /* skip header CRC16 */
++	}
++
++	zstream.next_in  = (void*)cbuf;
++	zstream.avail_in = (uLongf) len - ((void*)cbuf-(void*)buffer) - 4 - 4 +1; 
++	zstream.next_out = decompress_buf;
++	zstream.avail_out= decompress_len;
++	zstream.zalloc   = Z_NULL;
++	zstream.zfree    = Z_NULL;
++	zstream.opaque   = Z_NULL;
++
++	ret = inflateInit2(&zstream, -MAX_WBITS);
++
++	if (ret != Z_OK) {
++		g_warning("inflateInit2() failed. zlib error code: %d", ret);
++		g_free(decompress_buf);
++		return NULL;
++	}
++
++	ret = inflate(&zstream, Z_FINISH);
++
++	if (ret != Z_STREAM_END) {
++		g_warning("zlib decompression failed. zlib error code: %d", ret);
++		g_free(decompress_buf);
++		return NULL;
++	}
++
++	interface = glade_parser_parse_buffer_internal(decompress_buf, decompress_len, domain);
++
++	g_free(decompress_buf);
++
++	return interface;
++}
++
++GladeInterface *
++glade_parser_parse_buffer(const gchar *buffer, gint len, const gchar *domain)
++{
++	g_return_val_if_fail(buffer != NULL, NULL);
++	g_return_val_if_fail(len > 0, NULL);
++
++	/* Check if buffer is gzipped */
++	if (buffer[0] == 0x1f && buffer[1] == (gchar)0x8b) {
++		return glade_parser_parse_gzipped_buffer(buffer, len, domain);
++	}
++
++	/* Buffer is cleartext. */
++	return glade_parser_parse_buffer_internal(buffer, len, domain);
++}
++
++#endif /* USE_GMARKUP_PARSER */
++
++
++#ifndef USE_GMARKUP_PARSER
++
+ static void
+ dump_widget(xmlNode *parent, GladeWidgetInfo *info, gint indent)
+ {
+@@ -1382,6 +1674,8 @@
+ 	xmlNodeAddContent(widget, "  ");
+ }
+ 
++#endif /* !defined(USE_GMARKUP_PARSER) */
++
+ /**
+  * glade_interface_dump
+  * @interface: the GladeInterface
+@@ -1390,6 +1684,9 @@
+  * This function dumps the contents of a GladeInterface into a file as
+  * XML.  It is intended mainly as a debugging tool.
+  */
++
++#ifndef USE_GMARKUP_PARSER
++
+ void
+ glade_interface_dump(GladeInterface *interface, const gchar *filename)
+ {
+@@ -1428,6 +1725,17 @@
+     xmlFreeDoc(doc);
+ }
+ 
++#else /* defined(USE_GMARKUP_PARSER) */
++
++void
++glade_interface_dump(GladeInterface *interface, const gchar *filename)
++{
++    g_warning("glade_interface_dump() is only available with libxml2.");
++}
++
++#endif /* USE_GMARKUP_PARSER */
++
++
+ #if 0
+ int
+ main(int argc, char **argv) {
+diff -urN libglade-2.4.2.orig/libglade-2.0.pc.in libglade-2.4.2/libglade-2.0.pc.in
+--- libglade-2.4.2.orig/libglade-2.0.pc.in	2001-12-12 15:28:23.000000000 +0100
++++ libglade-2.4.2/libglade-2.0.pc.in	2005-03-22 01:20:00.000000000 +0100
+@@ -11,7 +11,7 @@
+ Name: Libglade
+ Description: a library for dynamically loading GLADE interface files
+ Version: @VERSION@
+-Requires: gtk+-2.0 libxml-2.0
++Requires: gtk+-2.0 @PKGCFG_REQUIRE_LIBXML2@
+ Libs: -L${libdir} -lglade-2.0
+ Cflags: -I${includedir}/libglade-2.0
+ 
diff --git a/meta/recipes-gnome/libglade/libglade-2.6.4/python_environment.patch b/meta/recipes-gnome/libglade/libglade-2.6.4/python_environment.patch
new file mode 100644
index 0000000..b5b2ec4
--- /dev/null
+++ b/meta/recipes-gnome/libglade/libglade-2.6.4/python_environment.patch
@@ -0,0 +1,14 @@
+Using @PYTHON@ for this path would result in the build system python being 
+referred to. Instead we want to locate python from the environment.
+
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN libglade-2.6.4-orig//libglade-convert.in libglade-2.6.4/libglade-convert.in
+--- libglade-2.6.4-orig//libglade-convert.in	2011-09-22 10:18:28.991164003 +0800
++++ libglade-2.6.4/libglade-convert.in	2011-09-22 10:18:55.431164003 +0800
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python
+ # -*- mode: python -*-
+ 
+ # yes, this requires python 2.x and an XML parser module (eg. PyExpat)
diff --git a/meta/recipes-gnome/libglade/libglade_2.6.4.bb b/meta/recipes-gnome/libglade/libglade_2.6.4.bb
new file mode 100644
index 0000000..15267ca
--- /dev/null
+++ b/meta/recipes-gnome/libglade/libglade_2.6.4.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Runtime support for the GTK+ interface builder"
+HOMEPAGE = "http://library.gnome.org/devel/libglade/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2 & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605 \
+                    file://glade/glade.h;endline=22;md5=a04f461c964ba4b57a172d1fbcd8f8fc \
+                    file://glade/glade-gtk.c;endline=22;md5=766f993433e2642fec87936d319990ff"
+
+SECTION = "libs"
+PR = "r5"
+DEPENDS = "zlib gdk-pixbuf gtk+"
+
+inherit autotools pkgconfig gnomebase gtk-doc
+GNOME_COMPRESS_TYPE="bz2"
+
+SRC_URI += "file://glade-cruft.patch file://no-xml2.patch file://python_environment.patch"
+
+SRC_URI[archive.md5sum] = "d1776b40f4e166b5e9c107f1c8fe4139"
+SRC_URI[archive.sha256sum] = "64361e7647839d36ed8336d992fd210d3e8139882269bed47dc4674980165dec"
+
+EXTRA_OECONF += "--without-libxml2"
+
+CFLAGS += "-lz"
+
+PACKAGES += " ${PN}-data"
+FILES_${PN} = "${libdir}/lib*.so.*"
+FILES_${PN}-data = "${datadir}/xml/libglade/glade-2.0.dtd"
+FILES_${PN}-dev += "${bindir}/libglade-convert"
+#RDEPENDS_${PN} = "${PN}-data"
diff --git a/meta/recipes-gnome/libnotify/libnotify_0.7.6.bb b/meta/recipes-gnome/libnotify/libnotify_0.7.6.bb
new file mode 100644
index 0000000..41d188c
--- /dev/null
+++ b/meta/recipes-gnome/libnotify/libnotify_0.7.6.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Library for sending desktop notifications to a notification daemon"
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+DEPENDS = "dbus gtk+3 dbus-glib"
+
+inherit gnomebase gtk-doc
+
+SRC_URI[archive.md5sum] = "a4997019d08f46f3bf57b78e6f795a59"
+SRC_URI[archive.sha256sum] = "0ef61ca400d30e28217979bfa0e73a7406b19c32dd76150654ec5b2bdf47d837"
+
+# there were times, we had two versions of libnotify (oe-core libnotify:0.6.x /
+# meta-gnome libnotify3: 0.7.x)
+PROVIDES += "libnotify3"
+RPROVIDES_${PN} += "libnotify3"
+RCONFLICTS_${PN} += "libnotify3"
+RREPLACES_${PN} += "libnotify3"
diff --git a/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch b/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch
new file mode 100644
index 0000000..e6af481
--- /dev/null
+++ b/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch
@@ -0,0 +1,63 @@
+From 1c38d570b33f2b036d4fa47e929bb2b3264e38bd Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Tue, 11 Aug 2015 16:25:38 +0300
+Subject: [PATCH] configure: add option to enable/disable use of GTK+
+
+Distro packagers like predictability and automatically detected optional
+dependencies are not predicable.  Add a --with-gtk3 option (default to "auto")
+for forcibly controlling whether GTK+ will be used or not.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=712693]
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+Forward-ported to 2.40.10
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index bf77f3a..ca77de8 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -128,17 +128,22 @@ AC_CHECK_FUNCS(strtok_r)
+ # GTK
+ # ===========================================================================
+ 
+-PKG_CHECK_MODULES([GTK3],[gtk+-3.0 >= $GTK3_REQUIRED],[have_gtk_3=yes],[have_gtk_3=no])
+-
+ GTK3_BINARY_VERSION=
+ 
+-if test "$have_gtk_3" = "yes"; then
+-    GTK3_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`"
++AC_MSG_CHECKING([whether to use GTK+ 3])
++AC_ARG_WITH([gtk3],
++  [AS_HELP_STRING([--without-gtk3],[Don't build GTK+3 tools (default=auto)])],
++  [],[PKG_CHECK_EXISTS([gtk+-3.0 >= $GTK3_REQUIRED],[with_gtk3=yes],[with_gtk3=no])])
++AC_MSG_RESULT([$with_gtk3])
++
++if test "$with_gtk3" = "yes"; then
++  PKG_CHECK_MODULES(GTK3, [gtk+-3.0 >= $GTK3_REQUIRED])
++  GTK3_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`"
+ fi
+ 
+ AC_SUBST([GTK3_BINARY_VERSION])
+ 
+-AM_CONDITIONAL([HAVE_GTK_3],[test "$have_gtk_3" = "yes"])
++AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk3" = "yes"])
+ 
+ dnl ===========================================================================
+ dnl GDK-Pixbuf SVG loader
+@@ -289,6 +294,6 @@ librsvg-$VERSION
+ 	Build introspectable bindings:  ${found_introspection}
+ 	Build Vala bindings:            ${enable_vala}
+ 	Build GdkPixbuf loader:         ${enable_pixbuf_loader}
+-        GTK+ $GTK3_REQUIRED or later:           ${have_gtk_3}
++        GTK+ $GTK3_REQUIRED or later:           ${with_gtk_3}
+ 	Build miscellaenous tools:      ${build_misc_tools}
+ "
+-- 
+2.1.4
+
diff --git a/meta/recipes-gnome/librsvg/librsvg_2.40.10.bb b/meta/recipes-gnome/librsvg/librsvg_2.40.10.bb
new file mode 100644
index 0000000..a8b0e4f
--- /dev/null
+++ b/meta/recipes-gnome/librsvg/librsvg_2.40.10.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Library for rendering SVG files"
+HOMEPAGE = "http://ftp.gnome.org/pub/GNOME/sources/librsvg/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://rsvg.h;beginline=3;endline=24;md5=20b4113c4909bbf0d67e006778302bc6"
+
+SECTION = "x11/utils"
+DEPENDS = "cairo gdk-pixbuf glib-2.0 libcroco libxml2 pango"
+BBCLASSEXTEND = "native"
+
+inherit autotools pkgconfig gnomebase gtk-doc pixbufcache
+
+SRC_URI += "file://gtk-option.patch"
+
+SRC_URI[archive.md5sum] = "fadebe2e799ab159169ee3198415ff85"
+SRC_URI[archive.sha256sum] = "965c807438ce90b204e930ff80c92eba1606a2f6fd5ccfd09335c99896dd3479"
+
+EXTRA_OECONF = "--disable-introspection --disable-vala"
+
+# The older ld (2.22) on the host (Centos 6.5) doesn't have the
+# -Bsymbolic-functions option, we can disable it for native.
+EXTRA_OECONF_append_class-native = " --enable-Bsymbolic=auto"
+
+PACKAGECONFIG ??= "gdkpixbuf"
+# The gdk-pixbuf loader
+PACKAGECONFIG[gdkpixbuf] = "--enable-pixbuf-loader,--disable-pixbuf-loader,gdk-pixbuf-native"
+# GTK+ test application (rsvg-view)
+PACKAGECONFIG[gtk] = "--with-gtk3,--without-gtk3,gtk+3"
+
+do_install_append() {
+	# Loadable modules don't need .a or .la on Linux
+	rm -f ${D}${libdir}/gdk-pixbuf-2.0/*/loaders/*.a ${D}${libdir}/gdk-pixbuf-2.0/*/loaders/*.la
+}
+
+PACKAGES =+ "librsvg-gtk rsvg"
+FILES_${PN} = "${libdir}/*.so.*"
+FILES_${PN}-dbg += "${libdir}/gdk-pixbuf-2.0/*/loaders/.debug"
+FILES_rsvg = "${bindir}/rsvg* \
+	      ${datadir}/pixmaps/svg-viewer.svg \
+	      ${datadir}/themes"
+FILES_librsvg-gtk = "${libdir}/gdk-pixbuf-2.0/*/*/*.so"
+
+PIXBUF_PACKAGES = "librsvg-gtk"
+
+PIXBUFCACHE_SYSROOT_DEPS_append_class-native = " harfbuzz-native:do_populate_sysroot_setscene pango-native:do_populate_sysroot_setscene icu-native:do_populate_sysroot_setscene"
diff --git a/meta/recipes-gnome/libsecret/libsecret_0.18.2.bb b/meta/recipes-gnome/libsecret/libsecret_0.18.2.bb
new file mode 100644
index 0000000..cebc83b
--- /dev/null
+++ b/meta/recipes-gnome/libsecret/libsecret_0.18.2.bb
@@ -0,0 +1,12 @@
+SUMMARY = "libsecret is a library for storing and retrieving passwords and other secrets"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=23c2a5e0106b99d75238986559bb5fc6"
+
+inherit gnomebase gtk-doc
+
+DEPENDS = "glib-2.0 libgcrypt"
+
+EXTRA_OECONF += "--disable-manpages"
+
+SRC_URI[archive.md5sum] = "23cdf8267d11a26f88f0dbec1e2022ad"
+SRC_URI[archive.sha256sum] = "12fd288b012e1b2b1b54d586cd4c6507885715534644b4534b7ef7d7079ba443"
diff --git a/meta/recipes-gnome/libwnck/libwnck3_3.14.0.bb b/meta/recipes-gnome/libwnck/libwnck3_3.14.0.bb
new file mode 100644
index 0000000..d0f5175
--- /dev/null
+++ b/meta/recipes-gnome/libwnck/libwnck3_3.14.0.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Window navigation construction toolkit"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+BPN = "libwnck"
+
+SECTION = "x11/libs"
+DEPENDS = "gobject-introspection-stub gtk+3 gdk-pixbuf-native libxres"
+
+PACKAGECONFIG ??= "startup-notification"
+PACKAGECONFIG[startup-notification] = "--enable-startup-notification,--disable-startup-notification,startup-notification"
+
+inherit gnomebase
+SRC_URI[archive.md5sum] = "4538672e0d775fadedf10abeb8020047"
+SRC_URI[archive.sha256sum] = "f5080076346609b4c36394b879f3a86b92ced3b90a37cb54c8e9a14f00e7921c"
diff --git a/meta/recipes-graphics/builder/builder_0.1.bb b/meta/recipes-graphics/builder/builder_0.1.bb
new file mode 100644
index 0000000..bb729fc
--- /dev/null
+++ b/meta/recipes-graphics/builder/builder_0.1.bb
@@ -0,0 +1,33 @@
+SUMMARY = "New user to do specific job"
+DESCRIPTION = "This recipe create a new user named ${PN}, who is used for specific jobs like building. The task can be auto started via mini X"
+SECTION = "x11"
+PR = "r6"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://builder_hob_start.sh;endline=5;md5=84796c3c41785d86100fdabcbdade00e"
+
+SRC_URI = "file://builder_hob_start.sh \
+           file://please_wait_dialog.py \
+          "
+
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} = "mini-x-session"
+
+inherit useradd
+
+# builder user password is "builder"
+BUILDER_PASSWORD ?= ".gLibiNXn0P12"
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--system --create-home \
+                       --groups video,tty,audio \
+                       --password ${BUILDER_PASSWORD} \
+                       --user-group builder"
+
+do_install () {
+	install -d -m 755 ${D}${sysconfdir}/mini_x/session.d
+	install -p -m 755 builder_hob_start.sh ${D}${sysconfdir}/mini_x/session.d/
+
+	chown  builder.builder ${D}${sysconfdir}/mini_x/session.d/builder_hob_start.sh
+        install -p -m 755 please_wait_dialog.py ${D}${sysconfdir}/mini_x
+}
+
diff --git a/meta/recipes-graphics/builder/files/builder_hob_start.sh b/meta/recipes-graphics/builder/files/builder_hob_start.sh
new file mode 100644
index 0000000..b394b09
--- /dev/null
+++ b/meta/recipes-graphics/builder/files/builder_hob_start.sh
@@ -0,0 +1,37 @@
+#!/bin/sh
+#This script will be called via mini X session on behalf of file owner, after
+#installed in /etc/mini_x/session.d/. Any auto start jobs including X apps can
+#be put here
+
+# start hob here
+export PSEUDO_PREFIX=/usr
+export PSEUDO_LOCALSTATEDIR=/home/builder/pseudo
+export PSEUDO_LIBDIR=/usr/lib/pseudo/lib64
+export GIT_PROXY_COMMAND=/home/builder/poky/scripts/oe-git-proxy
+
+#start pcmanfm in daemon mode to allow asynchronous launch
+pcmanfm -d&
+
+#register handlers for some file types
+if [ ! -d /home/builder/.local/share/applications ]; then
+    mkdir -p /home/builder/.local/share/applications/
+    #register folders to open with PCManFM filemanager
+    xdg-mime default pcmanfm.desktop inode/directory
+
+    #register html links and files with epiphany
+    xdg-mime default epiphany.desktop x-scheme-handler/http
+    xdg-mime default epiphany.desktop x-scheme-handler/https
+    xdg-mime default epiphany.desktop text/html
+
+    #register text files with leafpad text editor
+    xdg-mime default leafpad.desktop text/plain
+fi
+
+cd /home/builder/poky
+. ./oe-init-build-env
+
+hob &
+
+matchbox-terminal&
+
+/etc/mini_x/please_wait_dialog.py &
diff --git a/meta/recipes-graphics/builder/files/please_wait_dialog.py b/meta/recipes-graphics/builder/files/please_wait_dialog.py
new file mode 100644
index 0000000..fd2381b
--- /dev/null
+++ b/meta/recipes-graphics/builder/files/please_wait_dialog.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+import glib
+import gtk
+ 
+def destroy_window_cb(widget, event):
+    gtk.main_quit()
+ 
+def all_done_cb():
+    gtk.main_quit()
+ 
+def dialogue_ui():
+    window = gtk.Window()
+    window.set_title("Please wait...")
+    window.connect("delete-event", destroy_window_cb)
+    window.show()
+    window.set_border_width(12)
+ 
+    msg = "Please wait while BitBake initializes Hob"
+    label = gtk.Label(msg)
+    label.show()
+    window.add(label)
+ 
+    glib.timeout_add_seconds(10, all_done_cb)
+ 
+if __name__ == "__main__":
+    dialogue_ui()
+    gtk.main()
+
diff --git a/meta/recipes-graphics/cairo/cairo-fpu.inc b/meta/recipes-graphics/cairo/cairo-fpu.inc
new file mode 100644
index 0000000..ef72e89
--- /dev/null
+++ b/meta/recipes-graphics/cairo/cairo-fpu.inc
@@ -0,0 +1,6 @@
+
+def get_cairo_fpu_setting(bb, d):
+    if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+        return "--disable-some-floating-point"
+    return ""
+
diff --git a/meta/recipes-graphics/cairo/cairo.inc b/meta/recipes-graphics/cairo/cairo.inc
new file mode 100644
index 0000000..1e45318
--- /dev/null
+++ b/meta/recipes-graphics/cairo/cairo.inc
@@ -0,0 +1,45 @@
+SUMMARY = "The Cairo 2D vector graphics library"
+DESCRIPTION = "Cairo is a multi-platform library providing anti-aliased \
+vector-based rendering for multiple target backends. Paths consist \
+of line segments and cubic splines and can be rendered at any width \
+with various join and cap styles. All colors may be specified with \
+optional translucence (opacity/alpha) and combined using the \
+extended Porter/Duff compositing algebra as found in the X Render \
+Extension."
+HOMEPAGE = "http://cairographics.org"
+BUGTRACKER = "http://bugs.freedesktop.org"
+SECTION = "libs"
+LICENSE = "MPL-1 & LGPLv2.1 & GPLv3+"
+LICENSE_${PN} = "MPL-1 & LGPLv2.1"
+LICENSE_${PN}-dev = "MPL-1 & LGPLv2.1"
+LICENSE_${PN}-gobject = "MPL-1 & LGPLv2.1"
+LICENSE_${PN}-perf-utils = "GPLv3+"
+X11DEPENDS = "virtual/libx11 libsm libxrender libxext"
+DEPENDS = "libpng fontconfig pixman glib-2.0 zlib"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 xcb', '', d)} \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)}"
+
+PACKAGECONFIG[x11] = "--with-x=yes -enable-xlib,--with-x=no --disable-xlib,${X11DEPENDS}"
+PACKAGECONFIG[xcb] = "--enable-xcb,--disable-xcb,libxcb"
+PACKAGECONFIG[directfb] = "--enable-directfb=yes,,directfb"
+PACKAGECONFIG[valgrind] = "--enable-valgrind=yes,--disable-valgrind,valgrind"
+PACKAGECONFIG[egl] = "--enable-egl=yes,--disable-egl,virtual/egl"
+PACKAGECONFIG[glesv2] = "--enable-glesv2,--disable-glesv2,virtual/libgles2"
+
+#check for TARGET_FPU=soft and inform configure of the result so it can disable some floating points 
+require cairo-fpu.inc
+EXTRA_OECONF += "${@get_cairo_fpu_setting(bb, d)} \
+                 --enable-tee \
+                "
+
+inherit autotools pkgconfig
+
+# We don't depend on binutils so we need to disable this
+export ac_cv_lib_bfd_bfd_openr="no"
+# Ensure we don't depend on LZO
+export ac_cv_lib_lzo2_lzo2a_decompress="no"
+
+BBCLASSEXTEND = "native"
+
+CFLAGS += "-ffat-lto-objects"
diff --git a/meta/recipes-graphics/cairo/cairo_1.14.2.bb b/meta/recipes-graphics/cairo/cairo_1.14.2.bb
new file mode 100644
index 0000000..3817dbf
--- /dev/null
+++ b/meta/recipes-graphics/cairo/cairo_1.14.2.bb
@@ -0,0 +1,43 @@
+require cairo.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e73e999e0c72b5ac9012424fa157ad77"
+
+SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "e1cdfaf1c6c995c4d4c54e07215b0118"
+SRC_URI[sha256sum] = "c919d999ddb1bbbecd4bbe65299ca2abd2079c7e13d224577895afa7005ecceb"
+
+PACKAGES =+ "cairo-gobject cairo-script-interpreter cairo-perf-utils"
+
+SUMMARY_${PN} = "The Cairo 2D vector graphics library"
+DESCRIPTION_${PN} = "Cairo is a multi-platform library providing anti-aliased \
+vector-based rendering for multiple target backends. Paths consist \
+of line segments and cubic splines and can be rendered at any width \
+with various join and cap styles. All colors may be specified with \
+optional translucence (opacity/alpha) and combined using the \
+extended Porter/Duff compositing algebra as found in the X Render \
+Extension."
+
+SUMMARY_cairo-gobject = "The Cairo library GObject wrapper library"
+DESCRIPTION_cairo-gobject = "A GObject wrapper library for the Cairo API."
+
+SUMMARY_cairo-script-interpreter = "The Cairo library script interpreter"
+DESCRIPTION_cairo-script-interpreter = "The Cairo script interpreter implements \
+CairoScript.  CairoScript is used by tracing utilities to enable the ability \
+to replay rendering."
+
+DESCRIPTION_cairo-perf-utils = "The Cairo library performance utilities"
+
+FILES_${PN} = "${libdir}/libcairo.so.*"
+FILES_${PN}-dev += "${libdir}/cairo/*.so"
+FILES_${PN}-gobject = "${libdir}/libcairo-gobject.so.*"
+FILES_${PN}-script-interpreter = "${libdir}/libcairo-script-interpreter.so.*"
+FILES_${PN}-perf-utils = "${bindir}/cairo-trace ${libdir}/cairo/*.la ${libdir}/cairo/libcairo-trace.so.*"
+
+do_install_append () {
+	rm -rf ${D}${bindir}/cairo-sphinx
+	rm -rf ${D}${libdir}/cairo/cairo-fdr*
+	rm -rf ${D}${libdir}/cairo/cairo-sphinx*
+	rm -rf ${D}${libdir}/cairo/.debug/cairo-fdr*
+	rm -rf ${D}${libdir}/cairo/.debug/cairo-sphinx*
+}
diff --git a/meta/recipes-graphics/clutter/clutter-1.0.inc b/meta/recipes-graphics/clutter/clutter-1.0.inc
new file mode 100644
index 0000000..da21cee
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-1.0.inc
@@ -0,0 +1,48 @@
+SUMMARY = "Graphics library for creating hardware-accelerated user interfaces"
+HOMEPAGE = "http://www.clutter-project.org/"
+LICENSE = "LGPLv2.1+"
+
+inherit clutter ptest-gnome
+
+DEPENDS = "pango glib-2.0 json-glib atk udev cogl-1.0"
+PACKAGE_BEFORE_PN += "${PN}-examples"
+AUTOTOOLS_AUXDIR = "${S}/build"
+
+EDEPENDS_X11 = "virtual/libx11 libxi libxfixes"
+EDEPENDS_GLX = "virtual/libgl"
+EDEPENDS_EGL = "virtual/egl"
+EDEPENDS_WAYLAND = "wayland libxkbcommon gdk-pixbuf"
+
+EDEPENDS_EVDEV = "libxkbcommon"
+ERDEPENDS_EVDEV = "xkeyboard-config"
+
+# Disable pretty much everything, override in platform specific set up
+EXTRA_OECONF += "--disable-introspection	\
+	     	 --disable-quartz-backend	\
+	     	 --disable-win32-backend	\
+	     	 --disable-gdk-backend		\
+	     	 --disable-cex100-backend	\
+	     	 --disable-tslib-input		\
+	    	"
+
+PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,${EDEPENDS_X11}"
+PACKAGECONFIG[glx] = ",,${EDEPENDS_X11} ${EDEPENDS_GLX}"
+PACKAGECONFIG[egl] = "--enable-egl-backend,--disable-egl-backend,${EDEPENDS_EGL}"
+PACKAGECONFIG[evdev] = "--enable-evdev-input,--disable-evdev-input,${EDEPENDS_EVDEV},${ERDEPENDS_EVDEV}"
+PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,${EDEPENDS_WAYLAND}"
+PACKAGECONFIG[wayland-compositor] = "--enable-wayland-compositor,--disable-wayland-compositor,wayland"
+
+# Default configuration, distros might want to override
+PACKAGECONFIG ??= "egl \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glx x11', '', d)}"
+
+FILES_${PN}-dbg += "${libdir}/clutter/examples/.debug"
+FILES_${PN}-examples = "${libdir}/clutter/examples"
+
+FILES_${PN}-dbg += "${libexecdir}/installed-tests/.debug"
+
+do_configure_prepend() {
+	# see https://bugzilla.gnome.org/show_bug.cgi?id=661128 for this
+	touch -t 200001010000 ${S}/po/clutter-1.0.pot
+}
diff --git a/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch b/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch
new file mode 100644
index 0000000..3b6a70e
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-1.0/install-examples.patch
@@ -0,0 +1,18 @@
+Install the examples to $libdir/clutter/.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Upstream-Status: Inappropriate
+
+diff --git a/examples/Makefile.am b/examples/Makefile.am
+index 4b9b449..232cd19 100644
+--- a/examples/Makefile.am
++++ b/examples/Makefile.am
+@@ -38,6 +38,7 @@ AM_CPPFLAGS = \
+ 	-I$(top_srcdir)/clutter \
+ 	-I$(top_builddir)/clutter
+ 
+-noinst_PROGRAMS = $(all_examples)
++exampledir = $(pkglibdir)/examples
++example_PROGRAMS = $(all_examples)
+ 
+ EXTRA_DIST = redhand.png
diff --git a/meta/recipes-graphics/clutter/clutter-1.0/run-installed-tests-with-tap-output.patch b/meta/recipes-graphics/clutter/clutter-1.0/run-installed-tests-with-tap-output.patch
new file mode 100644
index 0000000..f5c18c5
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-1.0/run-installed-tests-with-tap-output.patch
@@ -0,0 +1,32 @@
+From 668e1d14af13249384ab324c7d79ec4147f07e48 Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 27 Apr 2015 20:12:33 +0300
+Subject: [PATCH] Run installed tests with tap output
+
+Configure output from installed-tests to be TAP compliant such that
+gnome-desktop-testing-runner properly interprets the results.
+
+Upstream-Status: Pending
+
+Signed-off-by: Tim Orling <TicoTimo@gmail.com>
+---
+ build/autotools/glib-tap.mk | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/build/autotools/glib-tap.mk b/build/autotools/glib-tap.mk
+index 7c5f82b..844e17e 100644
+--- a/build/autotools/glib-tap.mk
++++ b/build/autotools/glib-tap.mk
+@@ -127,7 +127,8 @@ installed_test_meta_DATA = $(installed_testcases:=.test)
+ %.test: %$(EXEEXT) Makefile
+ 	$(AM_V_GEN) (echo '[Test]' > $@.tmp; \
+ 	echo 'Type=session' >> $@.tmp; \
+-	echo 'Exec=env G_ENABLE_DIAGNOSTIC=0 CLUTTER_ENABLE_DIAGNOSTIC=0 $(installed_testdir)/$<' >> $@.tmp; \
++	echo 'Exec=env G_ENABLE_DIAGNOSTIC=0 CLUTTER_ENABLE_DIAGNOSTIC=0 $(installed_testdir)/$< --tap' >> $@.tmp; \
++	echo 'Output=TAP' >> $@.tmp; \
+ 	mv $@.tmp $@)
+ 
+ CLEANFILES += $(installed_test_meta_DATA)
+-- 
+2.1.4
+
diff --git a/meta/recipes-graphics/clutter/clutter-1.0/run-ptest b/meta/recipes-graphics/clutter/clutter-1.0/run-ptest
new file mode 100644
index 0000000..98877e5
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-1.0/run-ptest
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+gnome-desktop-testing-runner clutter
diff --git a/meta/recipes-graphics/clutter/clutter-1.0_1.22.4.bb b/meta/recipes-graphics/clutter/clutter-1.0_1.22.4.bb
new file mode 100644
index 0000000..418cdfd
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-1.0_1.22.4.bb
@@ -0,0 +1,10 @@
+require clutter-1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+SRC_URI[archive.md5sum] = "26494256c980d49703a553916e3083cd"
+SRC_URI[archive.sha256sum] = "1d77ce16025f87667a1d00dc4fa617a1935156f63fd17635fdadf138866c9e1e"
+
+SRC_URI += "file://install-examples.patch \
+            file://run-installed-tests-with-tap-output.patch \
+            file://run-ptest"
diff --git a/meta/recipes-graphics/clutter/clutter-gst-3.0.inc b/meta/recipes-graphics/clutter/clutter-gst-3.0.inc
new file mode 100644
index 0000000..d4fed71
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-gst-3.0.inc
@@ -0,0 +1,18 @@
+SUMMARY = "GStreamer integration library for Clutter"
+HOMEPAGE = "http://www.clutter-project.org/"
+LICENSE = "LGPLv2+"
+
+inherit clutter
+
+SRC_URI += "file://0001-Install-example-binary-needed-for-core-image-clutter.patch"
+
+DEPENDS = "gstreamer1.0-plugins-base gstreamer1.0-plugins-bad clutter-1.0"
+RDEPENDS_${PN} += "gstreamer1.0-meta-base"
+PACKAGES  =+ "${PN}-examples"
+
+EXTRA_OECONF += "--disable-introspection"
+
+FILES_${PN}          += "${libdir}/gstreamer-1.0/lib*.so"
+FILES_${PN}-dev      += "${libdir}/gstreamer-1.0/*.la"
+FILES_${PN}-dbg      += "${libdir}/gstreamer-1.0/.debug/lib*.so"
+FILES_${PN}-examples  = "${bindir}/video-player ${bindir}/video-sink"
diff --git a/meta/recipes-graphics/clutter/clutter-gst-3.0/0001-Install-example-binary-needed-for-core-image-clutter.patch b/meta/recipes-graphics/clutter/clutter-gst-3.0/0001-Install-example-binary-needed-for-core-image-clutter.patch
new file mode 100644
index 0000000..0b26b99
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-gst-3.0/0001-Install-example-binary-needed-for-core-image-clutter.patch
@@ -0,0 +1,33 @@
+From d77c711277bf075ce0545c19b322f040c49c778a Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 30 Apr 2015 12:19:13 +0300
+Subject: [PATCH] Install example binary needed for core-image-clutter
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+Imported from clutter-gst-1.8 package, git://git.openembedded.org/openembedded,
+commit ae28ee3f7a060b9e0d13154a84f2444a98490b5b, updated for clutter-gst 3.0
+
+Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+---
+ examples/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/examples/Makefile.am b/examples/Makefile.am
+index bfbc1b5..09655e3 100644
+--- a/examples/Makefile.am
++++ b/examples/Makefile.am
+@@ -1,6 +1,6 @@
+ NULL = #
+ 
+-noinst_PROGRAMS = camera-player video-player video-sink video-sink-navigation video-content
++bin_PROGRAMS = camera-player video-player video-sink video-sink-navigation video-content
+ 
+ AM_CPPFLAGS = -I$(top_srcdir) \
+ 		$(MAINTAINER_CFLAGS) \
+-- 
+2.1.4
+
diff --git a/meta/recipes-graphics/clutter/clutter-gst-3.0/enable-tests.patch b/meta/recipes-graphics/clutter/clutter-gst-3.0/enable-tests.patch
new file mode 100644
index 0000000..b3aec39
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-gst-3.0/enable-tests.patch
@@ -0,0 +1,23 @@
+Install example binary needed for core-image-clutter
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+Imported from clutter-gst-1.8 package, git://git.openembedded.org/openembedded,
+commit ae28ee3f7a060b9e0d13154a84f2444a98490b5b, updated for clutter-gst 1.6
+
+Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
+
+Index: git/examples/Makefile.am
+===================================================================
+--- git.orig/examples/Makefile.am	2011-01-31 10:14:23.000000000 +0800
++++ git/examples/Makefile.am	2011-01-31 10:14:34.000000000 +0800
+@@ -1,6 +1,6 @@
+ NULL = #
+ 
+-noinst_PROGRAMS = video-player video-sink video-sink-navigation
++bin_PROGRAMS = video-player video-sink video-sink-navigation
+ 
+ INCLUDES = -I$(top_srcdir) \
+ 	   $(MAINTAINER_CFLAGS) \
diff --git a/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.8.bb b/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.8.bb
new file mode 100644
index 0000000..319a955
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-gst-3.0_3.0.8.bb
@@ -0,0 +1,7 @@
+require clutter-gst-3.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+                    file://clutter-gst/clutter-gst.h;beginline=1;endline=24;md5=95baacba194e814c110ea3bdf25ddbf4"
+
+SRC_URI[archive.md5sum] = "f7d97f96e7cca82f38317d1734d5dadb"
+SRC_URI[archive.sha256sum] = "582e85b88482e16f7ec719363e38fadf84fab4d4baaa21e5227a454b824f135c"
diff --git a/meta/recipes-graphics/clutter/clutter-gtk-1.0.inc b/meta/recipes-graphics/clutter/clutter-gtk-1.0.inc
new file mode 100644
index 0000000..45898b4
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-gtk-1.0.inc
@@ -0,0 +1,12 @@
+SUMMARY = "Library for embedding a Clutter canvas in a GTK+ application"
+HOMEPAGE = "http://www.clutter-project.org/"
+LICENSE = "LGPLv2+"
+
+inherit clutter
+
+DEPENDS = "clutter-1.0 gtk+3"
+PACKAGES  =+ "${PN}-examples"
+AUTOTOOLS_AUXDIR = "${S}/build"
+
+EXTRA_OECONF += "--disable-introspection"
+
diff --git a/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.6.2.bb b/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.6.2.bb
new file mode 100644
index 0000000..530ea18
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-gtk-1.0_1.6.2.bb
@@ -0,0 +1,6 @@
+require clutter-gtk-1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+SRC_URI[archive.md5sum] = "557d814c3e70cc3a2d1cf3816919b14f"
+SRC_URI[archive.sha256sum] = "bbd03dfa9a20102d5cdb440513b0a035933da557ad7e9da31546034de2daf069"
diff --git a/meta/recipes-graphics/cogl/cogl-1.0.inc b/meta/recipes-graphics/cogl/cogl-1.0.inc
new file mode 100644
index 0000000..3da31c8
--- /dev/null
+++ b/meta/recipes-graphics/cogl/cogl-1.0.inc
@@ -0,0 +1,70 @@
+SUMMARY = "Modern 3D graphics API with associated utility APIs"
+HOMEPAGE = "http://wiki.clutter-project.org/wiki/Cogl"
+LICENSE = "MIT"
+
+inherit clutter
+
+DEPENDS = "glib-2.0 gdk-pixbuf"
+PACKAGES =+ "${PN}-examples \
+             libcogl libcogl-gles2 libcogl-pango libcogl-path \
+            "
+AUTOTOOLS_AUXDIR = "${S}/build"
+
+# Extra DEPENDS for PACKAGECONFIG
+EDEPENDS_GL = "virtual/libgl libdrm"
+EDEPENDS_GLES2 = "virtual/libgles2"
+EDEPENDS_KMS = "libdrm virtual/egl"
+EDEPENDS_EGL = "virtual/egl"
+EDEPENDS_X11 = "virtual/libx11 libxcomposite libxfixes libxi libxrandr"
+EDEPENDS_WAYLAND = "virtual/mesa wayland"
+
+# Extra RDEPENDS for PACKAGECONFIG
+# This has to be explictly listed, because cogl dlopens the backends
+ERDEPENDS_GL    = "libgl"
+ERDEPENDS_GLES2 = "libgles2"
+
+# GLESv1 is rarely tested, so disable it
+EXTRA_OECONF += "--disable-introspection	\
+	       	 --enable-examples-install	\
+	       	 --enable-debug		 	\
+	       	 --disable-gles1		\
+	         --disable-cairo                \
+	    	"
+
+# OpenGL/GLX
+PACKAGECONFIG[glx] = "--enable-gl --enable-glx,--disable-gl --disable-glx,${EDEPENDS_GL} ${EDEPENDS_X11},${ERDEPENDS_GL}"
+
+# GLESv2
+PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,${EDEPENDS_GLES2}, ${ERDEPENDS_GLES2}"
+
+# EGL backends
+PACKAGECONFIG[egl-kms] = "--enable-kms-egl-platform,--disable-kms-egl-platform,${EDEPENDS_KMS}"
+PACKAGECONFIG[egl-null] = "--enable-null-egl-platform,--disable-null-egl-platform"
+PACKAGECONFIG[egl-x11] = "--enable-xlib-egl-platform,--disable-xlib-egl-platform,${EDEPENDS_X11} ${EDEPENDS_EGL}"
+PACKAGECONFIG[egl-wayland] = "--enable-wayland-egl-platform,--disable-wayland-egl-platform,${EDEPENDS_WAYLAND}"
+
+# Wayland (server-side)
+PACKAGECONFIG[wayland-server] = "--enable-wayland-egl-server,--disable-wayland-egl-server,${EDEPENDS_WAYLAND}"
+
+# Support rendering text directly with Pango
+PACKAGECONFIG[cogl-pango] = "--enable-cogl-pango,--disable-cogl-pango,pango"
+
+# Respect the DISTRO_FEATURES to pull in GLX or Wayland as appropriate by
+# default.
+PACKAGECONFIG ??= "cogl-pango gles2 \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'egl-wayland', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'glx egl-x11', '', d)} \
+                   "
+
+
+FILES_${PN}-examples = "${bindir}/* ${datadir}/cogl/examples-data/*"
+FILES_libcogl = "${libdir}/libcogl${SOLIBS}"
+FILES_libcogl-gles2 = "${libdir}/libcogl-gles2${SOLIBS}"
+FILES_libcogl-pango = "${libdir}/libcogl-pango${SOLIBS}"
+
+FILES_libcogl-path = "${libdir}/libcogl-path${SOLIBS}"
+
+# For backwards compatibility after Debian-renaming
+RPROVIDES_libcogl = "cogl-1.0"
+RCONFLICTS_libcogl = "cogl-1.0"
+RREPLACES_libcogl = "cogl-1.0"
diff --git a/meta/recipes-graphics/cogl/cogl-1.0/cogl-framebuffer-gl-Work-again-on-GLESv2.patch b/meta/recipes-graphics/cogl/cogl-1.0/cogl-framebuffer-gl-Work-again-on-GLESv2.patch
new file mode 100644
index 0000000..8e83957
--- /dev/null
+++ b/meta/recipes-graphics/cogl/cogl-1.0/cogl-framebuffer-gl-Work-again-on-GLESv2.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Backport
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+
+From f8cce5f6cb2958a4074f87cd345bfe46e0dda6e1 Mon Sep 17 00:00:00 2001
+From: "Jasper St. Pierre" <jstpierre@mecheye.net>
+Date: Mon, 20 Apr 2015 12:08:29 -0700
+Subject: cogl-framebuffer-gl: Work again on GLESv2
+
+
+diff --git a/cogl/driver/gl/cogl-framebuffer-gl.c b/cogl/driver/gl/cogl-framebuffer-gl.c
+index 793b10b..609cfb3 100644
+--- a/cogl/driver/gl/cogl-framebuffer-gl.c
++++ b/cogl/driver/gl/cogl-framebuffer-gl.c
+@@ -107,6 +107,12 @@
+ #ifndef GL_PACK_INVERT_MESA
+ #define GL_PACK_INVERT_MESA 0x8758
+ #endif
++#ifndef GL_BACK_LEFT
++#define GL_BACK_LEFT				0x0402
++#endif
++#ifndef GL_BACK_RIGHT
++#define GL_BACK_RIGHT				0x0403
++#endif
+ 
+ #ifndef GL_COLOR
+ #define GL_COLOR 0x1800
+@@ -245,6 +251,9 @@ _cogl_framebuffer_gl_flush_stereo_mode_state (CoglFramebuffer *framebuffer)
+   if (framebuffer->type == COGL_FRAMEBUFFER_TYPE_OFFSCREEN)
+     return;
+ 
++  if (!ctx->glDrawBuffer)
++    return;
++
+   /* The one-shot default draw buffer setting in _cogl_framebuffer_gl_bind
+    * must have already happened. If not it would override what we set here. */
+   g_assert (ctx->was_bound_to_onscreen);
+-- 
+cgit v0.10.2
+
diff --git a/meta/recipes-graphics/cogl/cogl-1.0_1.20.0.bb b/meta/recipes-graphics/cogl/cogl-1.0_1.20.0.bb
new file mode 100644
index 0000000..d20b814
--- /dev/null
+++ b/meta/recipes-graphics/cogl/cogl-1.0_1.20.0.bb
@@ -0,0 +1,8 @@
+require cogl-1.0.inc
+
+SRC_URI += "file://cogl-framebuffer-gl-Work-again-on-GLESv2.patch"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=1b1a508d91d25ca607c83f92f3e31c84"
+SRC_URI[archive.md5sum] = "5b28897194d9ff76a574a9493d1f7ee0"
+SRC_URI[archive.sha256sum] = "729e35495829e7d31fafa3358e47b743ba21a2b08ff9b6cd28fb74c0de91192b"
+
diff --git a/meta/recipes-graphics/directfb/directfb-examples/configure.in-Fix-string-argument-syntax.patch b/meta/recipes-graphics/directfb/directfb-examples/configure.in-Fix-string-argument-syntax.patch
new file mode 100644
index 0000000..0717ea6
--- /dev/null
+++ b/meta/recipes-graphics/directfb/directfb-examples/configure.in-Fix-string-argument-syntax.patch
@@ -0,0 +1,28 @@
+From 88077ed156a714f32bb408f422278d61611ffd41 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Sat, 26 Jul 2014 16:57:46 -0300
+Subject: [PATCH] configure.in: Fix string argument syntax
+
+Upstream-Status: Submitted
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ configure.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index bfe1b82..e939bbd 100644
+--- a/configure.in
++++ b/configure.in
+@@ -65,7 +65,7 @@ fi)
+ 
+ DIRECTFB_REQUIRED_VERSION=1.4.14
+ 
+-PKG_CHECK_MODULES(DIRECTFB, directfb >= $DIRECTFB_REQUIRED_VERSION,[ WATER=`$PKG_CONFIG --variable=water directfb` ],
++PKG_CHECK_MODULES([DIRECTFB], directfb >= $DIRECTFB_REQUIRED_VERSION,[ WATER=`$PKG_CONFIG --variable=water directfb` ],
+ 	AC_MSG_ERROR([$DIRECTFB_PKG_ERRORS
+ *** DirectFB $DIRECTFB_REQUIRED_VERSION or newer is required. The latest version
+ *** of DirectFB is available from http://www.directfb.org/.]))
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-graphics/directfb/directfb-examples_1.7.0.bb b/meta/recipes-graphics/directfb/directfb-examples_1.7.0.bb
new file mode 100644
index 0000000..9c3e8bf
--- /dev/null
+++ b/meta/recipes-graphics/directfb/directfb-examples_1.7.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Example DirectFB applications"
+DESCRIPTION = "The DirectFB-examples package contains a set of simple DirectFB \
+      applications that can be used to test and demonstrate various DirectFB \
+      features"
+DEPENDS = "directfb"
+SECTION = "libs"
+LICENSE = "MIT"
+
+SRC_URI = " \
+           http://www.directfb.org/downloads/Extras/DirectFB-examples-${PV}.tar.gz \
+           file://configure.in-Fix-string-argument-syntax.patch \
+          "
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ecf6fd2b19915afc4da56043926ca18f"
+
+S = "${WORKDIR}/DirectFB-examples-${PV}"
+
+inherit autotools pkgconfig
+
+SRC_URI[md5sum] = "8b60c867af295481c32a8c7fc5802307"
+SRC_URI[sha256sum] = "9a2104cc4da8123c8371813551b66b943198979f745cbebc034bb5e10844122a"
diff --git a/meta/recipes-graphics/directfb/directfb.inc b/meta/recipes-graphics/directfb/directfb.inc
new file mode 100644
index 0000000..446aaea
--- /dev/null
+++ b/meta/recipes-graphics/directfb/directfb.inc
@@ -0,0 +1,80 @@
+SUMMARY = "Graphics abstraction library for the Linux Framebuffer Device"
+DESCRIPTION = "DirectFB is a thin library that provides developers \
+with hardware graphics acceleration, input device handling and \
+abstraction, an integrated windowing system with support for \
+translucent windows and multiple display layers on top of the \
+Linux framebuffer device."
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=dcf3c825659e82539645da41a7908589"
+
+HOMEPAGE = "http://directfb.org"
+DEPENDS = "jpeg libpng freetype zlib tslib sysfsutils"
+
+SRC_URI = "http://www.directfb.org/downloads/Core/DirectFB-1.7/DirectFB-${PV}.tar.gz \
+           file://configurefix.patch \
+           file://fusion.patch \
+           file://bashism.patch \
+           file://0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch \
+          "
+
+S = "${WORKDIR}/DirectFB-${PV}"
+
+LDFLAGS_append =" -lts -lm"
+
+BINCONFIG = "${bindir}/directfb-config"
+
+inherit autotools binconfig-disabled pkgconfig
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[jpeg2000] = "--enable-jpeg2000,--disable-jpeg2000,jasper"
+PACKAGECONFIG[drmkms] = "--enable-drmkms,--disable-drmkms,libdrm"
+PACKAGECONFIG[tiff] = "--enable-tiff,--disable-tiff,tiff"
+PACKAGECONFIG[webp] = "--enable-webp,--disable-webp,libwebp"
+
+EXTRA_OECONF = "\
+  --with-gfxdrivers=none \
+  --enable-freetype=yes \
+  --enable-zlib \
+  --disable-imlib2 \
+  --disable-mesa \
+  --disable-sdl \
+  --disable-vnc \
+  --disable-x11 \
+"
+
+#Once -fno-omit-frame-pointer option of gcc is added into TARGET_CLFAGS as default
+#this will cause directfb build failure on x86 arch, so filter out it.
+TARGET_CFLAGS_remove_x86 = "-fno-omit-frame-pointer"
+
+#PACKAGES_DYNAMIC += "^directfb-inputdrivers-.*"
+#
+#python populate_packages_prepend () {
+#    inputdrivers_libdir = d.expand('${libdir}/directfb-${RV}/inputdrivers')
+#    do_split_packages(d, inputdrivers_libdir, '*.so$', 'directfb-inputdrivers-%s', 'Directfb plugin for %s')
+#}
+
+# NOTE: monolithic packaging for now, should improve that eventually
+
+
+
+FILES_${PN}-dbg += "\
+  ${libdir}/directfb-${RV}/*/*/.debug/*.so \
+  ${libdir}/directfb-${RV}/*/.debug/*.so \
+"
+
+FILES_${PN}-dev += "\
+  ${bindir}/directfb-config \
+  ${libdir}/directfb-${RV}/systems/*.la \
+  ${libdir}/directfb-${RV}/inputdrivers/*.la \
+  ${libdir}/directfb-${RV}/interfaces/*/*.la \
+  ${libdir}/directfb-${RV}/wm/*.la \
+"
+
+FILES_${PN} += "\
+  ${libdir}/directfb-${RV}/systems/*.so \
+  ${libdir}/directfb-${RV}/inputdrivers/*.so \
+  ${libdir}/directfb-${RV}/interfaces/*/*.so \
+  ${libdir}/directfb-${RV}/wm/*.so \
+  ${datadir}/directfb-${PV} \
+"
diff --git a/meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch b/meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch
new file mode 100644
index 0000000..76e0f75
--- /dev/null
+++ b/meta/recipes-graphics/directfb/directfb/0001-gfx-direct-Aboid-usng-VLAs-and-printf-formats.patch
@@ -0,0 +1,61 @@
+From f43ef44806ffb8e3b35d99070dde9b6cc1714d3d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 8 Sep 2015 21:32:20 +0000
+Subject: [PATCH] gfx,direct: Aboid usng VLAs and printf formats
+
+VLAs are flagged by clang when using non-POD types, therefore replace
+the usage with alloca which is exact same allocation on stack
+
+ __attribute__((__format__ (__printf__))) is not portable as used here
+ therefore disable the check for clang here, we lose no functionality
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ lib/direct/util.h | 2 +-
+ src/gfx/util.cpp  | 8 ++++----
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/lib/direct/util.h b/lib/direct/util.h
+index 72941e9..8e7fa4a 100644
+--- a/lib/direct/util.h
++++ b/lib/direct/util.h
+@@ -98,7 +98,7 @@
+ #define D_CONST_FUNC
+ #endif
+ 
+-#if __GNUC__ >= 3
++#if __GNUC__ >= 3 && !defined __clang__
+ #define D_FORMAT_PRINTF(n)         __attribute__((__format__ (__printf__, n, n+1)))
+ #define D_FORMAT_VPRINTF(n)        __attribute__((__format__ (__printf__, n, 0)))
+ #else
+diff --git a/src/gfx/util.cpp b/src/gfx/util.cpp
+index 40032bc..d1015d4 100644
+--- a/src/gfx/util.cpp
++++ b/src/gfx/util.cpp
+@@ -294,8 +294,8 @@ dfb_gfx_copy_regions_stereo( CoreSurface           *source,
+ {
+      unsigned int i, n = 0;
+      DFBRectangle rect = { 0, 0, source->config.size.w, source->config.size.h };
+-     DFBRectangle rects[num];
+-     DFBPoint     points[num];
++     DFBRectangle *rects =  (DFBRectangle*)alloca( sizeof(struct DFBRectangle) * num);
++     DFBPoint *points =  (DFBPoint*)alloca( sizeof(struct DFBPoint) * num);
+ 
+      for (i=0; i<num; i++) {
+           DFB_REGION_ASSERT( &regions[i] );
+@@ -351,8 +351,8 @@ dfb_gfx_copy_regions_client( CoreSurface             *source,
+ {
+      unsigned int             i, n = 0;
+      DFBRectangle             rect = { 0, 0, source->config.size.w, source->config.size.h };
+-     DFBRectangle             rects[num];
+-     DFBPoint                 points[num];
++     DFBRectangle            *rects =  (DFBRectangle*)alloca( sizeof(struct DFBRectangle) * num);
++     DFBPoint                *points =  (DFBPoint*)alloca( sizeof(struct DFBPoint) * num);
+      CoreGraphicsStateClient *client = _client ? _client : &StateClient::Get()->client;
+      CardState               *state  = client->state;
+      CardState                backup;
+-- 
+2.5.1
+
diff --git a/meta/recipes-graphics/directfb/directfb/bashism.patch b/meta/recipes-graphics/directfb/directfb/bashism.patch
new file mode 100644
index 0000000..2ef4e93
--- /dev/null
+++ b/meta/recipes-graphics/directfb/directfb/bashism.patch
@@ -0,0 +1,18 @@
+${x//y/} is a bash syntax. Replace with something dash compatible
+
+RP 2015/5/3
+Upstream-Status: Pending
+
+Index: DirectFB-1.7.7/configure.in
+===================================================================
+--- DirectFB-1.7.7.orig/configure.in
++++ DirectFB-1.7.7/configure.in
+@@ -2696,7 +2696,7 @@ AM_CONDITIONAL(BUILD_TOOLS, test "$with_
+ AM_CONDITIONAL(CROSS_COMPILING, test "$cross_compiling" = "yes")
+ 
+ CFLAGS="$CFLAGS $DFB_INTERNAL_CFLAGS"
+-CXXFLAGS="$CXXFLAGS ${CFLAGS//-Werror-implicit-function-declaration/}"
++CXXFLAGS="$CXXFLAGS $(printf '%s\n' "$CFLAGS" | sed 's/-Werror-implicit-function-declaration//g')"
+ DFB_LDFLAGS="$LDFLAGS $ZLIB_LIBS"
+ 
+ CFLAGS="$CFLAGS $CFLAGS_STD"
diff --git a/meta/recipes-graphics/directfb/directfb/configurefix.patch b/meta/recipes-graphics/directfb/directfb/configurefix.patch
new file mode 100644
index 0000000..dd8c019
--- /dev/null
+++ b/meta/recipes-graphics/directfb/directfb/configurefix.patch
@@ -0,0 +1,60 @@
+Libtool needs these set correctly else we end up with pointless rpaths
+such as the QA warnings:
+
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfblayer contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbmaster contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/mkdgifft contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbdump contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbinput contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbfx contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbscreen contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/mkdgiff contains probably-redundant RPATH /usr/libWARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbinspector contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/mkdfiff contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbinfo contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbpenmount contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/bin/dfbg contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libfusion-1.4.so.6 contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libdirectfb-1.4.so.6.0.9 contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libdirectfb-1.4.so.6 contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/libfusion-1.4.so.6.0.9 contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/systems/libdirectfb_fbdev.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/systems/libdirectfb_devmem.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/systems/libdirectfb_dummy.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_v4l.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_gif.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/ICoreResourceManager/libicoreresourcemanager_test.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_jpeg.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_png.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_dfiff.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_gif.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBFont/libidirectfbfont_ft2.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/interfaces/IDirectFBFont/libidirectfbfont_dgiff.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/wm/libdirectfbwm_default.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_zytronic.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_penmount.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_linux_input.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_serialmouse.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_mutouch.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_tslib.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_joystick.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_sonypi.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_lirc.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_wm97xx_ts.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_ps2mouse.so contains probably-redundant RPATH /usr/lib
+WARNING: QA Issue: directfb: /work/i586-poky-linux/directfb-1.4.15-r1/packages-split/directfb/usr/lib/directfb-1.4-6/inputdrivers/libdirectfb_keyboard.so contains probably-redundant RPATH /usr/lib
+
+Upstream-Status: Pending
+
+RP 2012/03/16
+
+Index: DirectFB-1.4.15/configure.in
+===================================================================
+--- DirectFB-1.4.15.orig/configure.in	2012-03-16 13:32:23.692402879 +0000
++++ DirectFB-1.4.15/configure.in	2012-03-16 13:33:22.312400960 +0000
+@@ -97,13 +97,6 @@
+ AC_CHECK_SIZEOF(long long)
+ AC_CHECK_FUNCS(fork)
+ 
+-
+-## Work around libstuhl during cross build...
+-if test "$host" != "$build"; then
+-  sys_lib_dlsearch_path_spec=""
+-  sys_lib_search_path_spec=""
+-fi
+-
+ AC_PATH_PROGS(PERL, perl5 perl)
+ 
+ AC_PATH_PROG(MAN2HTML, man2html, no)
diff --git a/meta/recipes-graphics/directfb/directfb/fusion.patch b/meta/recipes-graphics/directfb/directfb/fusion.patch
new file mode 100644
index 0000000..1f81a67
--- /dev/null
+++ b/meta/recipes-graphics/directfb/directfb/fusion.patch
@@ -0,0 +1,36 @@
+directfb: Fix for hangs in direct_test, fusion_skirmish on exit
+
+Upstream-Status: Pending
+Signed-off-by: Lauren Post <lauren.post@freescale.com>
+
+--- a/lib/fusion/fusion.c	2013-01-18 22:57:11.000000000 +0800
++++ b/lib/fusion/fusion.c	2013-07-04 10:42:56.502699119 +0800
+@@ -2853,9 +2853,14 @@
+           direct_mutex_lock( &world->event_dispatcher_mutex );
+ 
+           while (1) {
+-               if (!world->event_dispatcher_buffers)
++               if (!world->event_dispatcher_buffers){
+                     direct_waitqueue_wait( &world->event_dispatcher_cond, &world->event_dispatcher_mutex );
+-
++                    if (world->dispatch_stop) {
++                         D_DEBUG_AT( Fusion_Main_Dispatch, "  -> IGNORING (dispatch_stop!)\n" );
++                         direct_mutex_unlock( &world->event_dispatcher_mutex );
++                         return NULL;
++                    }
++               }
+                buf = (FusionEventDispatcherBuffer *)world->event_dispatcher_buffers;
+                D_MAGIC_ASSERT( buf, FusionEventDispatcherBuffer );
+ 
+@@ -2872,6 +2877,11 @@
+ //D_INFO("waiting...\n");
+                     D_ASSERT( buf->read_pos == buf->write_pos );
+                     direct_waitqueue_wait( &world->event_dispatcher_cond, &world->event_dispatcher_mutex );
++		      if (world->dispatch_stop) {
++                         D_DEBUG_AT( Fusion_Main_Dispatch, "  -> IGNORING (dispatch_stop!)\n" );
++                         direct_mutex_unlock( &world->event_dispatcher_mutex );
++                         return NULL;
++                    }
+                }
+ 
+                buf = (FusionEventDispatcherBuffer *)world->event_dispatcher_buffers;
diff --git a/meta/recipes-graphics/directfb/directfb_1.7.7.bb b/meta/recipes-graphics/directfb/directfb_1.7.7.bb
new file mode 100644
index 0000000..c6c070e
--- /dev/null
+++ b/meta/recipes-graphics/directfb/directfb_1.7.7.bb
@@ -0,0 +1,8 @@
+require directfb.inc
+
+RV = "1.7-7"
+
+LEAD_SONAME = "libdirectfb-1.7.so.0"
+
+SRC_URI[md5sum] = "152cf1863b1a3a28aa1370e9053440bf"
+SRC_URI[sha256sum] = "b785c638dc31b8fe3a7c81be1475c89b2255ab3d67b777c747d3fbc52f8027a3"
diff --git a/meta/recipes-graphics/drm/libdrm/installtests.patch b/meta/recipes-graphics/drm/libdrm/installtests.patch
new file mode 100644
index 0000000..1175dae
--- /dev/null
+++ b/meta/recipes-graphics/drm/libdrm/installtests.patch
@@ -0,0 +1,23 @@
+tests: also install tests app
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index bf1987f..d909e19 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -27,10 +27,11 @@ AM_CPPFLAGS = \
+ 
+ LDADD = $(top_builddir)/libdrm.la
+ 
+-check_PROGRAMS = \
++bin_PROGRAMS = \
+ 	dristat \
+ 	drmstat
+ 
++check_PROGRAMS =
+ if HAVE_NOUVEAU
+ SUBDIRS += nouveau
+ endif
diff --git a/meta/recipes-graphics/drm/libdrm_2.4.62.bb b/meta/recipes-graphics/drm/libdrm_2.4.62.bb
new file mode 100644
index 0000000..ea6305e
--- /dev/null
+++ b/meta/recipes-graphics/drm/libdrm_2.4.62.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Userspace interface to the kernel DRM services"
+DESCRIPTION = "The runtime library for accessing the kernel DRM services.  DRM \
+stands for \"Direct Rendering Manager\", which is the kernel portion of the \
+\"Direct Rendering Infrastructure\" (DRI).  DRI is required for many hardware \
+accelerated OpenGL drivers."
+HOMEPAGE = "http://dri.freedesktop.org"
+SECTION = "x11/base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71"
+PROVIDES = "drm"
+DEPENDS = "libpthread-stubs udev libpciaccess"
+
+SRC_URI = "http://dri.freedesktop.org/libdrm/${BP}.tar.bz2 \
+           file://installtests.patch "
+SRC_URI[md5sum] = "c9291bae0e5ca65d1483821d3698d3ab"
+SRC_URI[sha256sum] = "906c294bdbe1c94c3ca084305d61a6e5a8367f3b4986e6cc13b1e9b3f75931dc"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF += "--disable-cairo-tests \
+                 --enable-omap-experimental-api \
+                 --enable-install-test-programs \
+                 --disable-manpages \
+                 --disable-valgrind \
+                "
+
+ALLOW_EMPTY_${PN}-drivers = "1"
+PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-radeon ${PN}-nouveau ${PN}-omap \
+             ${PN}-intel ${PN}-exynos ${PN}-kms ${PN}-freedreno"
+
+RRECOMMENDS_${PN}-drivers = "${PN}-radeon ${PN}-nouveau ${PN}-omap ${PN}-intel \
+                             ${PN}-exynos ${PN}-freedreno"
+
+FILES_${PN}-tests = "${bindir}/dr* ${bindir}/mode* ${bindir}/*test"
+FILES_${PN}-radeon = "${libdir}/libdrm_radeon.so.*"
+FILES_${PN}-nouveau = "${libdir}/libdrm_nouveau.so.*"
+FILES_${PN}-omap = "${libdir}/libdrm_omap.so.*"
+FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
+FILES_${PN}-exynos = "${libdir}/libdrm_exynos.so.*"
+FILES_${PN}-kms = "${libdir}/libkms*.so.*"
+FILES_${PN}-freedreno = "${libdir}/libdrm_freedreno.so.*"
+
diff --git a/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb b/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb
new file mode 100644
index 0000000..455d31e
--- /dev/null
+++ b/meta/recipes-graphics/eglinfo/eglinfo-fb_1.0.0.bb
@@ -0,0 +1,6 @@
+EGLINFO_PLATFORM ?= "fb"
+EGLINFO_BINARY_NAME ?= "eglinfo-fb"
+
+include eglinfo.inc
+
+SUMMARY += "(Framebuffer version)"
diff --git a/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb b/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb
new file mode 100644
index 0000000..3427fdf
--- /dev/null
+++ b/meta/recipes-graphics/eglinfo/eglinfo-x11_1.0.0.bb
@@ -0,0 +1,12 @@
+EGLINFO_PLATFORM ?= "x11"
+EGLINFO_BINARY_NAME ?= "eglinfo-x11"
+
+include eglinfo.inc
+
+DEPENDS += "virtual/libx11"
+
+inherit distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SUMMARY += "(X11 version)"
diff --git a/meta/recipes-graphics/eglinfo/eglinfo.inc b/meta/recipes-graphics/eglinfo/eglinfo.inc
new file mode 100644
index 0000000..b87688a
--- /dev/null
+++ b/meta/recipes-graphics/eglinfo/eglinfo.inc
@@ -0,0 +1,27 @@
+SUMMARY = "Utility for printing information EGL and its client APIs (OpenGL, OpenGL ES, OpenVG)"
+SECTION = "graphics"
+LICENSE = "Zlib"
+HOMEPAGE = "https://github.com/dv1/eglinfo"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=8d4f33bc3add976f7dfae85dab66f03c"
+
+DEPENDS = "virtual/egl"
+
+SRC_URI = "git://github.com/dv1/eglinfo.git;branch=master"
+SRCREV = "4b317648ec6cf39556a9e5d8078f605bc0edd5de"
+
+S = "${WORKDIR}/git"
+
+inherit waf
+
+# BSP layers should add .bbappend files for the -x11 and -fb .bb recipes, which
+# append the respective EGL/OpenGLES/OpenVG libraries to DEPENDS and set
+# EGL_DEVICE as appropriate.
+EGLINFO_DEVICE ?= "generic"
+
+EXTRA_OECONF = "--platform=${EGLINFO_PLATFORM} \
+                --device=${EGLINFO_DEVICE} \
+                --sysroot ${STAGING_DIR_TARGET}"
+
+do_install_append() {
+	mv ${D}/${bindir}/eglinfo ${D}/${bindir}/${EGLINFO_BINARY_NAME}
+}
diff --git a/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch b/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch
new file mode 100644
index 0000000..fca1e65
--- /dev/null
+++ b/meta/recipes-graphics/fontconfig/fontconfig/revert-static-pkgconfig.patch
@@ -0,0 +1,20 @@
+Revert part of http://cgit.freedesktop.org/fontconfig/commit/fontconfig.pc.in?id=338ffe6b886ad4ba86ff471cb59c4a5e5ffbe408
+We really dont do static linking so its not going to cause issues for us but as such this is harming us by adding absolute
+paths into -I options into fontconfig.pc which is them prepended with sysroot when read back by cross pkg-config and
+we end up with -I <sysroot>/<sysroot>/usr/include/fontconfig in CFLAGS of clients which depend on it. one such example
+is matchbox-panel-2 and it was working fine with gcc < 5 because it tolerated non-existing paths in -I flags but gcc-5
+gently refuses and rightly so.
+
+Upstream-Status: Inappropriate [OE-Specific]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: fontconfig-2.11.93/fontconfig.pc.in
+===================================================================
+--- fontconfig-2.11.93.orig/fontconfig.pc.in
++++ fontconfig-2.11.93/fontconfig.pc.in
+@@ -15,4 +15,4 @@ Requires: @PKGCONFIG_REQUIRES@
+ Requires.private: @PKGCONFIG_REQUIRES_PRIVATELY@
+ Libs: -L${libdir} -lfontconfig
+ Libs.private: @EXPAT_LIBS@ @FREETYPE_LIBS@ @ICONV_LIBS@ @LIBXML2_LIBS@
+-Cflags: -I${includedir} @EXPAT_CFLAGS@ @FREETYPE_CFLAGS@ @ICONV_CFLAGS@ @LIBXML2_CFLAGS@
++Cflags: -I${includedir}
diff --git a/meta/recipes-graphics/fontconfig/fontconfig_2.11.94.bb b/meta/recipes-graphics/fontconfig/fontconfig_2.11.94.bb
new file mode 100644
index 0000000..9bbff20
--- /dev/null
+++ b/meta/recipes-graphics/fontconfig/fontconfig_2.11.94.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Generic font configuration library"
+DESCRIPTION = "Fontconfig is a font configuration and customization library, which \
+does not depend on the X Window System. It is designed to locate \
+fonts within the system and select them according to requirements \
+specified by applications. \
+Fontconfig is not a rasterization library, nor does it impose a \
+particular rasterization library on the application. The X-specific \
+library 'Xft' uses fontconfig along with freetype to specify and \
+rasterize fonts."
+
+HOMEPAGE = "http://www.fontconfig.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=fontconfig"
+
+LICENSE = "MIT-style & MIT & PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7a0449e9bc5370402a94c00204beca3d \
+                    file://src/fcfreetype.c;endline=45;md5=5d9513e3196a1fbfdfa94051c09dfc84 \
+                    file://src/fccache.c;beginline=1199;endline=1214;md5=0326cfeb4a7333dd4dd25fbbc4b9f27f"
+
+SECTION = "libs"
+
+DEPENDS = "expat freetype zlib"
+
+SRC_URI = "http://fontconfig.org/release/fontconfig-${PV}.tar.gz \
+           file://revert-static-pkgconfig.patch \
+           "
+SRC_URI[md5sum] = "479be870c7f83f15f87bac085b61d641"
+SRC_URI[sha256sum] = "73f6d323c7bcfbde25d78397675191d55b8f4139132c6a9444410f3a2d8a9a95"
+
+PACKAGES =+ "fontconfig-utils"
+FILES_${PN} =+ "${datadir}/xml/*"
+FILES_fontconfig-utils = "${bindir}/*"
+
+# Work around past breakage in debian.bbclass
+RPROVIDES_fontconfig-utils = "libfontconfig-utils"
+RREPLACES_fontconfig-utils = "libfontconfig-utils"
+RCONFLICTS_fontconfig-utils = "libfontconfig-utils"
+DEBIAN_NOAUTONAME_fontconfig-utils = "1"
+
+inherit autotools pkgconfig
+
+FONTCONFIG_CACHE_DIR ?= "${localstatedir}/cache/fontconfig"
+
+EXTRA_OECONF = " --disable-docs --with-default-fonts=${datadir}/fonts --with-cache-dir=${FONTCONFIG_CACHE_DIR}"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-graphics/freetype/freetype_2.6.bb b/meta/recipes-graphics/freetype/freetype_2.6.bb
new file mode 100644
index 0000000..70599c6
--- /dev/null
+++ b/meta/recipes-graphics/freetype/freetype_2.6.bb
@@ -0,0 +1,60 @@
+SUMMARY = "Freetype font rendering library"
+DESCRIPTION = "FreeType is a software font engine that is designed to be small, efficient, \
+highly customizable, and portable while capable of producing high-quality output (glyph \
+images). It can be used in graphics libraries, display servers, font conversion tools, text \
+image generation tools, and many other products as well."
+HOMEPAGE = "http://www.freetype.org/"
+BUGTRACKER = "https://savannah.nongnu.org/bugs/?group=freetype"
+
+LICENSE = "FreeType | GPLv2+"
+LIC_FILES_CHKSUM = "file://docs/LICENSE.TXT;md5=c017ff17fc6f0794adf93db5559ccd56 \
+                    file://docs/FTL.TXT;md5=d479e83797f699fe873b38dadd0fcd4c \
+                    file://docs/GPLv2.TXT;md5=8ef380476f642c20ebf40fecb0add2ec"
+
+SECTION = "libs"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/freetype/freetype-${PV}.tar.bz2"
+SRC_URI[md5sum] = "5682890cb0267f6671dd3de6eabd3e69"
+SRC_URI[sha256sum] = "8469fb8124764f85029cc8247c31e132a2c5e51084ddce2a44ea32ee4ae8347e"
+
+BINCONFIG = "${bindir}/freetype-config"
+
+inherit autotools-brokensep pkgconfig binconfig-disabled multilib_header
+
+LIBTOOL = "${S}/builds/unix/${HOST_SYS}-libtool"
+EXTRA_OEMAKE = "'LIBTOOL=${LIBTOOL}'"
+EXTRA_OEMAKE_class-native = ""
+EXTRA_OECONF = "--without-zlib --without-bzip2 CC_BUILD='${BUILD_CC}'"
+TARGET_CPPFLAGS += "-D_FILE_OFFSET_BITS=64"
+
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[pixmap] = "--with-png,--without-png,libpng"
+# This results in a circular dependency so enabling is non-trivial
+PACKAGECONFIG[harfbuzz] = "--with-harfbuzz,--without-harfbuzz,harfbuzz"
+
+do_configure() {
+	cd builds/unix
+	libtoolize --force --copy
+	aclocal -I .
+	gnu-configize --force
+	autoconf
+	cd ${S}
+	oe_runconf
+}
+
+do_configure_class-native() {
+	(cd builds/unix && gnu-configize) || die "failure running gnu-configize"
+	oe_runconf
+}
+
+do_compile_prepend() {
+	${BUILD_CC} -o objs/apinames src/tools/apinames.c
+}
+
+do_install_append() {
+	oe_multilib_header freetype2/config/ftconfig.h
+}
+
+BBCLASSEXTEND = "native"
+
diff --git a/meta/recipes-graphics/fstests/fstests_git.bb b/meta/recipes-graphics/fstests/fstests_git.bb
new file mode 100644
index 0000000..95c33f4
--- /dev/null
+++ b/meta/recipes-graphics/fstests/fstests_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Various benchmarning tests for X"
+HOMEPAGE = "http://www.o-hand.com"
+SECTION = "devel"
+LICENSE = "Zlib"
+DEPENDS = "pango libxext libxft virtual/libx11 gtk+"
+
+SRCREV = "e5939ff608b95cdd4d0ab0e1935781ab9a276ac0"
+PV = "0.1+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+LIC_FILES_CHKSUM = "file://test-pango-gdk.c;endline=24;md5=1ee74ec851ecda57eb7ac6cc180f7655"
+
+S = "${WORKDIR}/git/tests"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-graphics/glew/glew/autotools.patch b/meta/recipes-graphics/glew/glew/autotools.patch
new file mode 100644
index 0000000..7dfe087
--- /dev/null
+++ b/meta/recipes-graphics/glew/glew/autotools.patch
@@ -0,0 +1,149 @@
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: glew/Makefile.am
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ glew/Makefile.am	2009-12-02 00:30:23.296641663 +0100
+@@ -0,0 +1,5 @@
++
++ACLOCAL_AMFLAGS = -I m4 --install
++
++SUBDIRS = include src
++
+Index: glew/configure.ac
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ glew/configure.ac	2009-12-02 00:30:23.296641663 +0100
+@@ -0,0 +1,67 @@
++#                                               -*- Autoconf -*-
++# Process this file with autoconf to produce a configure script.
++
++AC_PREREQ([2.62])
++AC_INIT([glew], [1.9.0], [BUG-REPORT-ADDRESS])
++AC_CONFIG_SRCDIR([src/glew.c])
++AC_CONFIG_HEADERS([config.h])
++AM_INIT_AUTOMAKE([-Wall -Werror foreign])
++AC_CONFIG_MACRO_DIR([m4])
++
++LT_INIT
++
++# Checks for programs.
++AC_PROG_CC
++AC_PROG_INSTALL
++AC_PROG_LN_S
++
++# Checks for libraries.
++
++# Checks for header files.
++AC_CHECK_HEADERS([inttypes.h stddef.h stdint.h stdlib.h string.h])
++
++# Checks for typedefs, structures, and compiler characteristics.
++AC_TYPE_INT32_T
++AC_TYPE_INT64_T
++AC_TYPE_UINT64_T
++AC_CHECK_TYPES([ptrdiff_t])
++
++# Checks for library functions.
++AC_FUNC_MALLOC
++AC_CHECK_FUNCS([strtol])
++
++# Check for pkgconfig libs
++
++PKG_CHECK_MODULES([X11], [x11])
++AC_SUBST([X11_LIBS])
++AC_SUBST([X11_CFLAGS])
++
++PKG_CHECK_MODULES([XMU], [xmu])
++AC_SUBST([XMU_LIBS])
++AC_SUBST([XMU_CFLAGS])
++
++PKG_CHECK_MODULES([XI], [xi])
++AC_SUBST([XI_LIBS])
++AC_SUBST([XI_CFLAGS])
++
++PKG_CHECK_MODULES([XEXT], [xext])
++AC_SUBST([XEXT_LIBS])
++AC_SUBST([XEXT_CFLAGS])
++
++# Check for GLU is enough and imples gl so no doubled -lGL in LDFLAGS
++PKG_CHECK_MODULES([GLU], [glu])
++AC_SUBST([GLU_LIBS])
++AC_SUBST([GLU_CFLAGS])
++
++# ENABLE option for Multiple Rendering Contexts support
++AC_CHECK_ENABLE_GLEWMX
++
++# for now we use the same version as the package, but that should be avoided
++# in the future
++
++AC_SUBST([LIBGLEW_SO_VERSION], [1:9:0])
++
++AC_CONFIG_FILES([Makefile
++                 include/Makefile
++                 src/Makefile])
++AC_OUTPUT
+Index: glew/src/Makefile.am
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ glew/src/Makefile.am	2009-12-02 00:33:48.690786110 +0100
+@@ -0,0 +1,35 @@
++
++AM_CPPFLAGS = -I$(top_srcdir)/include
++
++if ENABLE_GLEWMX
++AM_CPPFLAGS += -DGLEW_MX
++endif
++
++AM_CFLAGS = @X11_CFLAGS@ \
++            @XMU_CFLAGS@ \
++            @XI_CFLAGS@ \
++            @XEXT_CFLAGS@ \
++            @GLU_CFLAGS@
++
++lib_LTLIBRARIES = libGLEW.la
++
++libGLEW_la_SOURCES = glew.c
++
++libGLEW_la_LIBADD = @X11_LIBS@ \
++                    @XMU_LIBS@ \
++                    @XI_LIBS@ \
++                    @XEXT_LIBS@ \
++                    @GLU_LIBS@
++
++libGLEW_la_LDFLAGS = -version-number @LIBGLEW_SO_VERSION@
++
++bin_PROGRAMS = glewinfo visualinfo
++
++glewinfo_SOURCES = glewinfo.c
++
++glewinfo_LDADD = libGLEW.la
++
++visualinfo_SOURCES =  visualinfo.c
++
++visualinfo_LDADD = libGLEW.la
++
+Index: glew/m4/glewmx.m4
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ glew/m4/glewmx.m4	2009-12-02 00:30:23.296641663 +0100
+@@ -0,0 +1,11 @@
++
++AC_DEFUN([AC_CHECK_ENABLE_GLEWMX],[
++AC_MSG_CHECKING([whether to include Multiple Rendering Contexts support])
++AC_ARG_ENABLE([glewmx],
++   [AS_HELP_STRING([--enable-glewmx], [enable GLEW Multiple Rendering Contexts (default is no)])],
++   [ENABLE_GLEWMX="$enableval"],
++   [ENABLE_GLEWMX="no"])
++AC_MSG_RESULT([${ENABLE_GLEWMX}])
++AM_CONDITIONAL([ENABLE_GLEWMX], [test x"${ENABLE_GLEWMX}" = "xyes"])
++])
++
+Index: glew/include/Makefile.am
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ glew/include/Makefile.am	2009-12-02 00:30:23.296641663 +0100
+@@ -0,0 +1,3 @@
++
++nobase_include_HEADERS = GL/glew.h  GL/glxew.h  GL/wglew.h
++
diff --git a/meta/recipes-graphics/glew/glew/fix-glew.pc-install.patch b/meta/recipes-graphics/glew/glew/fix-glew.pc-install.patch
new file mode 100644
index 0000000..70a99ae
--- /dev/null
+++ b/meta/recipes-graphics/glew/glew/fix-glew.pc-install.patch
@@ -0,0 +1,46 @@
+
+We maintain the autotools configure.ac and Makefile.am, to correctly
+provide the glew.pc, the following patch is needed.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: glew-1.11.0/Makefile.am
+===================================================================
+--- glew-1.11.0.orig/Makefile.am
++++ glew-1.11.0/Makefile.am
+@@ -3,3 +3,5 @@ ACLOCAL_AMFLAGS = -I m4 --install
+ 
+ SUBDIRS = include src
+ 
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = glew.pc
+Index: glew-1.11.0/configure.ac
+===================================================================
+--- glew-1.11.0.orig/configure.ac
++++ glew-1.11.0/configure.ac
+@@ -66,5 +66,6 @@ AC_SUBST([LIBGLEW_SO_VERSION], [1:9:0])
+ 
+ AC_CONFIG_FILES([Makefile
+                  include/Makefile
+-                 src/Makefile])
++                 src/Makefile
++                 glew.pc])
+ AC_OUTPUT
+Index: glew-1.11.0/glew.pc.in
+===================================================================
+--- glew-1.11.0.orig/glew.pc.in
++++ glew-1.11.0/glew.pc.in
+@@ -5,7 +5,7 @@ includedir=${prefix}/include/GL
+ 
+ Name: glew
+ Description: The OpenGL Extension Wrangler library
+-Version: @version@
+-Cflags: -I${includedir} @cflags@
+-Libs: -L${libdir} -l@libname@
+-Requires: @requireslib@
++Version: @VERSION@
++Cflags: -I${includedir} @CFLAGS@
++Libs: -L${libdir} -lGLEW
++Requires: glu
diff --git a/meta/recipes-graphics/glew/glew/glew_fix_for_automake-1.12.patch b/meta/recipes-graphics/glew/glew/glew_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..0707efb
--- /dev/null
+++ b/meta/recipes-graphics/glew/glew/glew_fix_for_automake-1.12.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+This patch fixes following issue with automake 1.12
+
+| automake: warnings are treated as errors
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: warning: 'libGLEW.la': linking libtool libraries using a non-POSIX
+| /srv/home/nitin/builds/build-gcc47/tmp/sysroots/x86_64-linux/usr/share/automake-1.12/am/ltlibrary.am: archiver requires 'AM_PROG_AR' in 'configure.ac'
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/03
+
+Index: glew-1.7.0/configure.ac
+===================================================================
+--- glew-1.7.0.orig/configure.ac
++++ glew-1.7.0/configure.ac
+@@ -14,6 +14,9 @@ LT_INIT
+ AC_PROG_CC
+ AC_PROG_INSTALL
+ AC_PROG_LN_S
++# automake 1.12 seems to require this, but automake 1.11 doesn't recognize it
++m4_pattern_allow([AM_PROG_AR])
++AM_PROG_AR
+ 
+ # Checks for libraries.
+ 
diff --git a/meta/recipes-graphics/glew/glew_1.12.0.bb b/meta/recipes-graphics/glew/glew_1.12.0.bb
new file mode 100644
index 0000000..eb28c4d
--- /dev/null
+++ b/meta/recipes-graphics/glew/glew_1.12.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "OpenGL extension loading library"
+DESCRIPTION = "The OpenGL Extension Wrangler Library (GLEW) is a cross-platform open-source C/C++ extension loading library."
+HOMEPAGE = "http://glew.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=67586"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2ac251558de685c6b9478d89be3149c2"
+
+DEPENDS = "virtual/libx11 virtual/libgl libglu libxext libxi libxmu"
+
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/glew/glew/${PV}/glew-${PV}.tgz \
+           file://autotools.patch \
+           file://glew_fix_for_automake-1.12.patch \
+           file://fix-glew.pc-install.patch \
+          "
+
+SRC_URI[md5sum] = "01246c7ecd135d99be031aa63f86dca1"
+SRC_URI[sha256sum] = "af58103f4824b443e7fa4ed3af593b8edac6f3a7be3b30911edbc7344f48e4bf"
+
+inherit autotools lib_package pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-graphics/harfbuzz/harfbuzz_1.0.2.bb b/meta/recipes-graphics/harfbuzz/harfbuzz_1.0.2.bb
new file mode 100644
index 0000000..670bd98
--- /dev/null
+++ b/meta/recipes-graphics/harfbuzz/harfbuzz_1.0.2.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Text shaping library"
+DESCRIPTION = "HarfBuzz is an OpenType text shaping engine."
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/HarfBuzz"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=HarfBuzz"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e021dd6dda6ff1e6b1044002fc662b9b \
+                    file://src/hb-ucdn/COPYING;md5=994ba0f1295f15b4bda4999a5bbeddef \
+"
+
+SECTION = "libs"
+
+SRC_URI = "http://www.freedesktop.org/software/harfbuzz/release/${BP}.tar.bz2"
+SRC_URI[md5sum] = "e74f644045fe42c38a2641fc1e82a800"
+SRC_URI[sha256sum] = "beb3caf8654010fcdca61c810a3a7532237fc567ee4271deb674b5efbbe3b466"
+
+inherit autotools pkgconfig lib_package
+
+DEPENDS = "glib-2.0 cairo freetype"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF = "--with-glib --with-freetype --with-cairo --without-graphite2"
+
+PACKAGECONFIG ??= "icu"
+PACKAGECONFIG[icu] = "--with-icu,--without-icu,icu"
+
+PACKAGES =+ "${PN}-icu ${PN}-icu-dbg ${PN}-icu-dev"
+
+FILES_${PN}-icu = "${libdir}/libharfbuzz-icu.so.*"
+FILES_${PN}-icu-dbg = "${libdir}/.debug/libharfbuzz-icu.so*"
+FILES_${PN}-icu-dev = "${libdir}/libharfbuzz-icu.la \
+                       ${libdir}/libharfbuzz-icu.so \
+                       ${libdir}/pkgconfig/harfbuzz-icu.pc \
+"
diff --git a/meta/recipes-graphics/images/core-image-clutter.bb b/meta/recipes-graphics/images/core-image-clutter.bb
new file mode 100644
index 0000000..b0f25cf
--- /dev/null
+++ b/meta/recipes-graphics/images/core-image-clutter.bb
@@ -0,0 +1,13 @@
+DESCRIPTION = "An image with support for the Open GL-based toolkit Clutter, \
+which enables development of rich and animated graphical user interfaces."
+
+IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-dropbear"
+
+LICENSE = "MIT"
+
+IMAGE_INSTALL = "\
+    ${CORE_IMAGE_BASE_INSTALL} \
+    packagegroup-core-clutter-core \
+    "
+
+inherit core-image
diff --git a/meta/recipes-graphics/images/core-image-directfb.bb b/meta/recipes-graphics/images/core-image-directfb.bb
new file mode 100644
index 0000000..5641195
--- /dev/null
+++ b/meta/recipes-graphics/images/core-image-directfb.bb
@@ -0,0 +1,17 @@
+SUMMARY = "An image that uses DirectFB instead of X11"
+LICENSE = "MIT"
+
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+inherit core-image distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "directfb"
+CONFLICT_DISTRO_FEATURES = "x11"
+
+IMAGE_INSTALL += "\
+	${CORE_IMAGE_BASE_INSTALL} \
+	packagegroup-core-full-cmdline \
+	packagegroup-core-directfb \
+"
diff --git a/meta/recipes-graphics/images/core-image-weston.bb b/meta/recipes-graphics/images/core-image-weston.bb
new file mode 100644
index 0000000..52e271d
--- /dev/null
+++ b/meta/recipes-graphics/images/core-image-weston.bb
@@ -0,0 +1,11 @@
+SUMMARY = "A very basic Wayland image with a terminal"
+
+IMAGE_FEATURES += "splash package-management ssh-server-dropbear hwcodecs"
+
+LICENSE = "MIT"
+
+inherit core-image distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "wayland"
+
+CORE_IMAGE_BASE_INSTALL += "weston weston-init weston-examples gtk+3-demo clutter-1.0-examples"
diff --git a/meta/recipes-graphics/images/core-image-x11.bb b/meta/recipes-graphics/images/core-image-x11.bb
new file mode 100644
index 0000000..8455bb8
--- /dev/null
+++ b/meta/recipes-graphics/images/core-image-x11.bb
@@ -0,0 +1,9 @@
+SUMMARY = "A very basic X11 image with a terminal"
+
+IMAGE_FEATURES += "splash package-management x11-base"
+
+LICENSE = "MIT"
+
+inherit core-image distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch b/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch
new file mode 100644
index 0000000..674c8e8
--- /dev/null
+++ b/meta/recipes-graphics/libepoxy/libepoxy/0001-select-platforms-based-on-configuration-results.patch
@@ -0,0 +1,128 @@
+From 3a93150bc0aec86afdb7d053247dc2448925e09a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Wed, 6 May 2015 10:45:22 +0200
+Subject: [PATCH 1/2] select platforms based on configuration results
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream-Status: Submitted [1]
+
+[1] https://github.com/anholt/libepoxy/pull/52
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.ac          | 13 +++++--------
+ src/dispatch_common.c |  9 ++++++---
+ src/dispatch_common.h |  9 +++++----
+ 3 files changed, 16 insertions(+), 15 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a52fc58..bdd70da 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -58,6 +58,10 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
+ # uintptr_t to a void *") by default.  Kill that.
+ XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
+ 
++PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
++
++AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
++
+ has_znow=yes
+ 
+ case $host_os in
+@@ -86,7 +90,7 @@ case $host_os in
+         ;;
+     *)
+         build_egl=yes
+-        build_glx=yes
++        build_glx=$x11
+         build_wgl=no
+         # On platforms with dlopen, we load everything dynamically and
+         # don't link against a specific window system or GL implementation.
+@@ -144,13 +148,6 @@ esac
+ 
+ AC_SUBST([VISIBILITY_CFLAGS])
+ 
+-PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
+-if test x$x11 = xno -a x$build_glx = xyes; then
+-    AC_MSG_ERROR([libX11 headers (libx11-dev) required to build with GLX support])
+-fi
+-
+-AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
+-
+ PKG_CHECK_MODULES(GL, [gl], [gl=yes], [gl=no])
+ 
+ AC_CONFIG_FILES([
+diff --git a/src/dispatch_common.c b/src/dispatch_common.c
+index 4e34d6e..2ab84ed 100644
+--- a/src/dispatch_common.c
++++ b/src/dispatch_common.c
+@@ -615,10 +615,13 @@ epoxy_get_proc_address(const char *name)
+ #elif defined(__APPLE__)
+     return epoxy_gl_dlsym(name);
+ #else
++#if PLATFORM_HAS_GLX
+     if (epoxy_current_context_is_glx()) {
+         return glXGetProcAddressARB((const GLubyte *)name);
+-    } else {
++    } else
++#endif /* PLATFORM_HAS_GLX */
+ #if PLATFORM_HAS_EGL
++    {
+         GLenum egl_api = epoxy_egl_get_current_gl_context_api();
+ 
+         switch (egl_api) {
+@@ -628,10 +631,10 @@ epoxy_get_proc_address(const char *name)
+         case EGL_NONE:
+             break;
+         }
+-#endif
+     }
++#endif /* PLATFORM_HAS_EGL */
+     errx(1, "Couldn't find current GLX or EGL context.\n");
+-#endif
++#endif /* _WIN32 | __APPLE__*/
+ }
+ 
+ void
+diff --git a/src/dispatch_common.h b/src/dispatch_common.h
+index 6b8503a..82681e4 100644
+--- a/src/dispatch_common.h
++++ b/src/dispatch_common.h
+@@ -21,12 +21,13 @@
+  * IN THE SOFTWARE.
+  */
+ 
++#include <config.h>
+ #include <stdbool.h>
+ 
+ #ifdef _WIN32
+ #define PLATFORM_HAS_EGL 0
+ #define PLATFORM_HAS_GLX 0
+-#define PLATFORM_HAS_WGL 1
++#define PLATFORM_HAS_WGL BUILD_WGL
+ #define EPOXY_IMPORTEXPORT __declspec(dllexport)
+ #elif defined(__APPLE__)
+ #define PLATFORM_HAS_EGL 0
+@@ -34,13 +35,13 @@
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #elif defined(ANDROID)
+-#define PLATFORM_HAS_EGL 1
++#define PLATFORM_HAS_EGL BUILD_EGL
+ #define PLATFORM_HAS_GLX 0
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #else
+-#define PLATFORM_HAS_EGL 1
+-#define PLATFORM_HAS_GLX 1
++#define PLATFORM_HAS_EGL BUILD_EGL
++#define PLATFORM_HAS_GLX BUILD_GLX
+ #define PLATFORM_HAS_WGL 0
+ #define EPOXY_IMPORTEXPORT
+ #endif
+-- 
+1.9.3
+
diff --git a/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch b/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
new file mode 100644
index 0000000..262d684
--- /dev/null
+++ b/meta/recipes-graphics/libepoxy/libepoxy/0002-add-an-option-to-disable-glx-support.patch
@@ -0,0 +1,42 @@
+From 24868cbfb9dda5f6929dd277c47d35df016e8754 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Wed, 6 May 2015 11:05:48 +0200
+Subject: [PATCH 2/2] add an option to disable glx support
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+this option would help us in yocto to get deterministic build results
+
+Upstream-Status: Submitted [1]
+
+[1] https://github.com/anholt/libepoxy/pull/52
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ configure.ac | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index bdd70da..6c7153d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -58,7 +58,14 @@ AC_CHECK_HEADER([KHR/khrplatform.h],
+ # uintptr_t to a void *") by default.  Kill that.
+ XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-int-conversion])
+ 
+-PKG_CHECK_MODULES(X11, [x11], [x11=yes], [x11=no])
++AC_ARG_ENABLE([glx],
++                [AS_HELP_STRING([--disable-glx],
++				[disable if you don't want x11/glx support])],
++                [],
++                [enable_glx=yes]
++             )
++
++PKG_CHECK_MODULES(X11, [x11], [x11=$enable_glx], [x11=no])
+ 
+ AM_CONDITIONAL(HAVE_X11, test x$x11 = xyes)
+ 
+-- 
+1.9.3
+
diff --git a/meta/recipes-graphics/libepoxy/libepoxy/no-need-for-python3.patch b/meta/recipes-graphics/libepoxy/libepoxy/no-need-for-python3.patch
new file mode 100644
index 0000000..4b8fea5
--- /dev/null
+++ b/meta/recipes-graphics/libepoxy/libepoxy/no-need-for-python3.patch
@@ -0,0 +1,20 @@
+There is no need to use python3 by this package (the python scripts
+that are using during configuration only need python2.7+)
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Gary Thomas <gary@mlbassoc.com>
+--
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -40,7 +40,7 @@ m4_ifndef([XORG_MACROS_VERSION],
+ XORG_MACROS_VERSION(1.8)
+ XORG_DEFAULT_OPTIONS
+ 
+-AC_CHECK_PROGS([PYTHON], [python3 python2 python])
++AC_CHECK_PROGS([PYTHON], [python2 python])
+ 
+ # Initialize libtool
+ AC_DISABLE_STATIC
diff --git a/meta/recipes-graphics/libepoxy/libepoxy_git.bb b/meta/recipes-graphics/libepoxy/libepoxy_git.bb
new file mode 100644
index 0000000..ad17293
--- /dev/null
+++ b/meta/recipes-graphics/libepoxy/libepoxy_git.bb
@@ -0,0 +1,25 @@
+SUMMARY = "OpenGL function pointer management library"
+HOMEPAGE = "https://github.com/anholt/libepoxy/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=58ef4c80d401e07bd9ee8b6b58cf464b"
+
+
+SRC_URI = " \
+    git://github.com/anholt/libepoxy.git \
+    file://0001-select-platforms-based-on-configuration-results.patch \
+    file://0002-add-an-option-to-disable-glx-support.patch \
+    file://no-need-for-python3.patch \
+"
+SRCREV="e2c33af5bfcfc9d168f9e776156dd47c33f428b3"
+PV = "1.3.1"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+DEPENDS = "util-macros virtual/egl"
+
+PACKAGECONFIG[x11] = "--enable-glx, --disable-glx, virtual/libx11"
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
diff --git a/meta/recipes-graphics/libfakekey/libfakekey_git.bb b/meta/recipes-graphics/libfakekey/libfakekey_git.bb
new file mode 100644
index 0000000..c60ddea
--- /dev/null
+++ b/meta/recipes-graphics/libfakekey/libfakekey_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Library for converting characters to X key-presses"
+DESCRIPTION = "libfakekey is a simple library for converting UTF-8 characters into 'fake' X \
+key-presses."
+HOMEPAGE = "http://matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://src/libfakekey.c;endline=30;md5=602b5ccd48f64407510867f3373b448c"
+
+DEPENDS = "libxtst"
+SECTION = "x11/wm"
+
+SRCREV = "e327ff049b8503af2dadffa84370a0860b9fb682"
+PV = "0.0+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig gettext distro_features_check
+
+# The libxtst requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-graphics/libmatchbox/libmatchbox/libpng.patch b/meta/recipes-graphics/libmatchbox/libmatchbox/libpng.patch
new file mode 100644
index 0000000..8cd507f
--- /dev/null
+++ b/meta/recipes-graphics/libmatchbox/libmatchbox/libpng.patch
@@ -0,0 +1,69 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 19c3d242034748b3c60765683e1ff4e2df970205 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Tue, 10 Dec 2013 11:37:32 +0000
+Subject: [PATCH] configure: improve libpng detection
+
+Instead of looking for "libpng12" explicitly though pkg-config and then falling
+back to library hunting, just use pkg-config to find "libpng" which is provided
+by both libpng12 and libpng16.
+
+This also makes the libpng detection deterministic.
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ configure.ac | 29 +++++------------------------
+ 1 file changed, 5 insertions(+), 24 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 8a28076..65d7c79 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -34,7 +34,7 @@ AC_ARG_ENABLE(jpeg,
+   enable_jpeg=$enableval, enable_jpeg=no)
+ 
+ AC_ARG_ENABLE(png,
+-  [  --disable-png           disable png support [default=no]],
++  [  --disable-png           disable PNG support [default=enabled]],
+      enable_png=$enableval, enable_png=yes )
+ 
+ AC_ARG_ENABLE(doxygen-docs,     
+@@ -156,29 +156,10 @@ fi
+ dnl ------ Check for PNG ---------------------------------------------------
+ 
+ if test x$enable_png != xno; then
+-  AC_MSG_CHECKING(for libpng12)
+-  if test x$PKG_CONFIG != xno && $PKG_CONFIG --exists libpng12; then 
+-        AC_MSG_RESULT(yes)
+-        PNG_LIBS=`$PKG_CONFIG --libs libpng12`
+-	PNG_CFLAGS=`$PKG_CONFIG --cflags libpng12`
+-        AC_DEFINE(USE_PNG, [1], [Use Png])
+-	SUPPORTS_PNG=1
+-	PNG_REQUIRED="libpng12"
+-  else
+-	AC_MSG_RESULT(no)
+-        # AC_CHECK_HEADERS(png.h, [ have_png_h="yes" ], [ have_png_h="no" ] )
+-        AC_CHECK_LIB([png], [png_create_read_struct], [have_png="yes"], [have_png="no"])
+-
+-        if test x$have_png=xyes && test x$have_png_h=xyes; then 
+-            AC_DEFINE(USE_PNG, [1], [Use Png])
+-	    SUPPORTS_PNG=1
+-            PNG_LIBS="-lpng -lz"
+-            MB_EXTRA_LIBS="$MB_EXTRA_LIBS $PNG_LIBS"
+-        else
+-	    AC_MSG_WARN([*** Cannot find PNG, disabling support])
+-            enable_png=no
+-	fi
+-  fi
++  PKG_CHECK_MODULES(PNG, libpng)
++  AC_DEFINE(USE_PNG, [1], [Use PNG])
++  SUPPORTS_PNG=1
++  PNG_REQUIRED="libpng"
+ fi
+ 
+ 
+-- 
+1.8.5
+
diff --git a/meta/recipes-graphics/libmatchbox/libmatchbox_1.11.bb b/meta/recipes-graphics/libmatchbox/libmatchbox_1.11.bb
new file mode 100644
index 0000000..f2eb675
--- /dev/null
+++ b/meta/recipes-graphics/libmatchbox/libmatchbox_1.11.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Matchbox window manager core library"
+SECTION = "x11/libs"
+HOMEPAGE = "http://matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.com/"
+
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
+                    file://libmb/mbexp.c;endline=20;md5=28c0aef3b23e308464f5dae6a11b0d2f \
+                    file://libmb/mbdotdesktop.c;endline=21;md5=5a287156b3207e851c1d68d09c439b51"
+
+DEPENDS = "virtual/libx11 libxext"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/matchbox/${BPN}/${PV}/${BPN}-${PV}.tar.bz2 \
+           file://libpng.patch"
+
+SRC_URI[md5sum] = "fc6cc807f55a3e7c752d8013176875d7"
+SRC_URI[sha256sum] = "254cab52e304a3512c8df4be59d690cf3921bbb68a28ede7fe26b93534217b53"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGECONFIG ??= "jpeg png xft xsettings"
+PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
+PACKAGECONFIG[pango] = "--enable-pango,--disable-pango,pango"
+PACKAGECONFIG[png] = "--enable-png,--disable-png,libpng"
+PACKAGECONFIG[xft] = "--enable-xft,--disable-xft,libxft"
+PACKAGECONFIG[xsettings] = "--enable-xsettings,--disable-xsettings,libxsettings-client"
diff --git a/meta/recipes-graphics/libsdl/libsdl-1.2.15/configure_tweak.patch b/meta/recipes-graphics/libsdl/libsdl-1.2.15/configure_tweak.patch
new file mode 100644
index 0000000..3f97639
--- /dev/null
+++ b/meta/recipes-graphics/libsdl/libsdl-1.2.15/configure_tweak.patch
@@ -0,0 +1,1111 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: SDL-1.2.15/configure.in
+===================================================================
+--- SDL-1.2.15.orig/configure.in
++++ SDL-1.2.15/configure.in
+@@ -48,9 +48,9 @@ AC_CONFIG_AUX_DIR([build-scripts])
+ dnl AC_CANONICAL_HOST
+ AC_C_BIGENDIAN
+ if test x$ac_cv_c_bigendian = xyes; then
+-    AC_DEFINE(SDL_BYTEORDER, 4321)
++    AC_DEFINE(SDL_BYTEORDER, 4321, "Byte Order")
+ else
+-    AC_DEFINE(SDL_BYTEORDER, 1234)
++    AC_DEFINE(SDL_BYTEORDER, 1234, "Byte Order")
+ fi
+ 
+ dnl Check for tools
+@@ -134,7 +134,7 @@ AC_ARG_ENABLE(libc,
+ AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
+               , enable_libc=yes)
+ if test x$enable_libc = xyes; then
+-    AC_DEFINE(HAVE_LIBC)
++    AC_DEFINE(HAVE_LIBC,1,"")
+ 
+     dnl Check for C library headers
+     AC_HEADER_STDC
+@@ -145,7 +145,7 @@ if test x$enable_libc = xyes; then
+     if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then
+         AC_CHECK_TYPE(int64_t)
+         if test x$ac_cv_type_int64_t = xyes; then
+-            AC_DEFINE(SDL_HAS_64BIT_TYPE)
++            AC_DEFINE(SDL_HAS_64BIT_TYPE,1,"")
+         fi
+         have_inttypes=yes
+     fi
+@@ -161,11 +161,11 @@ if test x$enable_libc = xyes; then
+ 
+     AC_FUNC_MEMCMP
+     if test x$ac_cv_func_memcmp_working = xyes; then
+-        AC_DEFINE(HAVE_MEMCMP)
++        AC_DEFINE(HAVE_MEMCMP,1,"")
+     fi
+     AC_FUNC_STRTOD
+     if test x$ac_cv_func_strtod = xyes; then
+-        AC_DEFINE(HAVE_STRTOD)
++        AC_DEFINE(HAVE_STRTOD,1,"")
+     fi
+     AC_CHECK_FUNC(mprotect,
+         AC_TRY_COMPILE([
+@@ -191,40 +191,40 @@ if test x$have_inttypes != xyes; then
+     AC_CHECK_SIZEOF(long, 4)
+     AC_CHECK_SIZEOF(long long, 8)
+     if test x$ac_cv_sizeof_char = x1; then
+-        AC_DEFINE(int8_t, signed char)
+-        AC_DEFINE(uint8_t, unsigned char)
++        AC_DEFINE(int8_t, signed char,"")
++        AC_DEFINE(uint8_t, unsigned char,"")
+     fi
+     if test x$ac_cv_sizeof_short = x2; then
+-        AC_DEFINE(int16_t, signed short)
+-        AC_DEFINE(uint16_t, unsigned short)
++        AC_DEFINE(int16_t, signed short,"")
++        AC_DEFINE(uint16_t, unsigned short,"")
+     else
+         if test x$ac_cv_sizeof_int = x2; then
+-            AC_DEFINE(int16_t, signed int)
+-            AC_DEFINE(uint16_t, unsigned int)
++            AC_DEFINE(int16_t, signed int,"")
++            AC_DEFINE(uint16_t, unsigned int,"")
+         fi
+     fi
+     if test x$ac_cv_sizeof_int = x4; then
+-        AC_DEFINE(int32_t, signed int)
+-        AC_DEFINE(uint32_t, unsigned int)
++        AC_DEFINE(int32_t, signed int,"")
++        AC_DEFINE(uint32_t, unsigned int,"")
+     else
+         if test x$ac_cv_sizeof_long = x4; then
+-            AC_DEFINE(int32_t, signed long)
+-            AC_DEFINE(uint32_t, unsigned long)
++            AC_DEFINE(int32_t, signed long,"")
++            AC_DEFINE(uint32_t, unsigned long,"")
+         fi
+     fi
+     if test x$ac_cv_sizeof_long = x8; then
+-        AC_DEFINE(int64_t, signed long)
+-        AC_DEFINE(uint64_t, unsigned long)
+-        AC_DEFINE(SDL_HAS_64BIT_TYPE)
++        AC_DEFINE(int64_t, signed long,"")
++        AC_DEFINE(uint64_t, unsigned long,"")
++        AC_DEFINE(SDL_HAS_64BIT_TYPE,"")
+     else
+         if test x$ac_cv_sizeof_long_long = x8; then
+-            AC_DEFINE(int64_t, signed long long)
+-            AC_DEFINE(uint64_t, unsigned long long)
+-            AC_DEFINE(SDL_HAS_64BIT_TYPE)
++            AC_DEFINE(int64_t, signed long long,"")
++            AC_DEFINE(uint64_t, unsigned long long,"")
++            AC_DEFINE(SDL_HAS_64BIT_TYPE,"")
+         fi
+     fi
+-    AC_DEFINE(size_t, unsigned int)
+-    AC_DEFINE(uintptr_t, unsigned long)
++    AC_DEFINE(size_t, unsigned int,"")
++    AC_DEFINE(uintptr_t, unsigned long,"")
+ fi
+ 
+ # Standard C sources
+@@ -245,25 +245,25 @@ AC_ARG_ENABLE(audio,
+ AC_HELP_STRING([--enable-audio], [Enable the audio subsystem [[default=yes]]]),
+               , enable_audio=yes)
+ if test x$enable_audio != xyes; then
+-    AC_DEFINE(SDL_AUDIO_DISABLED)
++    AC_DEFINE(SDL_AUDIO_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(video,
+ AC_HELP_STRING([--enable-video], [Enable the video subsystem [[default=yes]]]),
+               , enable_video=yes)
+ if test x$enable_video != xyes; then
+-    AC_DEFINE(SDL_VIDEO_DISABLED)
++    AC_DEFINE(SDL_VIDEO_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(events,
+ AC_HELP_STRING([--enable-events], [Enable the events subsystem [[default=yes]]]),
+               , enable_events=yes)
+ if test x$enable_events != xyes; then
+-    AC_DEFINE(SDL_EVENTS_DISABLED)
++    AC_DEFINE(SDL_EVENTS_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(joystick,
+ AC_HELP_STRING([--enable-joystick], [Enable the joystick subsystem [[default=yes]]]),
+               , enable_joystick=yes)
+ if test x$enable_joystick != xyes; then
+-    AC_DEFINE(SDL_JOYSTICK_DISABLED)
++    AC_DEFINE(SDL_JOYSTICK_DISABLED,1,"")
+ else
+     SOURCES="$SOURCES $srcdir/src/joystick/*.c"
+ fi
+@@ -271,43 +271,43 @@ AC_ARG_ENABLE(cdrom,
+ AC_HELP_STRING([--enable-cdrom], [Enable the cdrom subsystem [[default=yes]]]),
+               , enable_cdrom=yes)
+ if test x$enable_cdrom != xyes; then
+-    AC_DEFINE(SDL_CDROM_DISABLED)
++    AC_DEFINE(SDL_CDROM_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(threads,
+ AC_HELP_STRING([--enable-threads], [Enable the threading subsystem [[default=yes]]]),
+               , enable_threads=yes)
+ if test x$enable_threads != xyes; then
+-    AC_DEFINE(SDL_THREADS_DISABLED)
++    AC_DEFINE(SDL_THREADS_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(timers,
+ AC_HELP_STRING([--enable-timers], [Enable the timer subsystem [[default=yes]]]),
+               , enable_timers=yes)
+ if test x$enable_timers != xyes; then
+-    AC_DEFINE(SDL_TIMERS_DISABLED)
++    AC_DEFINE(SDL_TIMERS_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(file,
+ AC_HELP_STRING([--enable-file], [Enable the file subsystem [[default=yes]]]),
+               , enable_file=yes)
+ if test x$enable_file != xyes; then
+-    AC_DEFINE(SDL_FILE_DISABLED)
++    AC_DEFINE(SDL_FILE_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(loadso,
+ AC_HELP_STRING([--enable-loadso], [Enable the shared object loading subsystem [[default=yes]]]),
+               , enable_loadso=yes)
+ if test x$enable_loadso != xyes; then
+-    AC_DEFINE(SDL_LOADSO_DISABLED)
++    AC_DEFINE(SDL_LOADSO_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(cpuinfo,
+ AC_HELP_STRING([--enable-cpuinfo], [Enable the cpuinfo subsystem [[default=yes]]]),
+               , enable_cpuinfo=yes)
+ if test x$enable_cpuinfo != xyes; then
+-    AC_DEFINE(SDL_CPUINFO_DISABLED)
++    AC_DEFINE(SDL_CPUINFO_DISABLED,1,"")
+ fi
+ AC_ARG_ENABLE(assembly,
+ AC_HELP_STRING([--enable-assembly], [Enable assembly routines [[default=yes]]]),
+               , enable_assembly=yes)
+ if test x$enable_assembly = xyes; then
+-    AC_DEFINE(SDL_ASSEMBLY_ROUTINES)
++    AC_DEFINE(SDL_ASSEMBLY_ROUTINES,1,"")
+ fi
+ 
+ dnl See if the OSS audio interface is supported
+@@ -335,12 +335,12 @@ AC_HELP_STRING([--enable-oss], [support
+               int arg = SNDCTL_DSP_SETFRAGMENT;
+             ],[
+             have_oss=yes
+-            AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H)
++            AC_DEFINE(SDL_AUDIO_DRIVER_OSS_SOUNDCARD_H,1,"")
+             ])
+         fi
+         AC_MSG_RESULT($have_oss)
+         if test x$have_oss = xyes; then
+-            AC_DEFINE(SDL_AUDIO_DRIVER_OSS)
++            AC_DEFINE(SDL_AUDIO_DRIVER_OSS,1,"")
+             SOURCES="$SOURCES $srcdir/src/audio/dsp/*.c"
+             SOURCES="$SOURCES $srcdir/src/audio/dma/*.c"
+             have_audio=yes
+@@ -407,7 +407,7 @@ CheckDMEDIA()
+         AC_MSG_RESULT($have_dmedia)
+         # Set up files for the audio library
+         if test x$have_dmedia = xyes; then
+-            AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA)
++            AC_DEFINE(SDL_AUDIO_DRIVER_DMEDIA,1,"")
+             SOURCES="$SOURCES $srcdir/src/audio/dmedia/*.c"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laudio"
+             have_audio=yes
+@@ -444,7 +444,7 @@ CheckMME()
+         AC_MSG_RESULT($have_mme)
+         # Set up files for the audio library
+         if test x$have_mme = xyes; then
+-            AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO)
++            AC_DEFINE(SDL_AUDIO_DRIVER_MMEAUDIO,1,"")
+             SOURCES="$SOURCES $srcdir/src/audio/mme/*.c"
+             EXTRA_CFLAGS="$EXTRA_CFLAGS $MME_CFLAGS"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MME_LIBS"
+@@ -467,7 +467,7 @@ AC_HELP_STRING([--enable-esd-shared], [d
+                           , enable_esd_shared=yes)
+             esd_lib=[`find_lib "libesd.so.*" "$ESD_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+ 
+-            AC_DEFINE(SDL_AUDIO_DRIVER_ESD)
++            AC_DEFINE(SDL_AUDIO_DRIVER_ESD,1,"")
+             SOURCES="$SOURCES $srcdir/src/audio/esd/*.c"
+             EXTRA_CFLAGS="$EXTRA_CFLAGS $ESD_CFLAGS"
+             if test x$have_loadso != xyes && \
+@@ -477,7 +477,7 @@ AC_HELP_STRING([--enable-esd-shared], [d
+             if test x$have_loadso = xyes && \
+                test x$enable_esd_shared = xyes && test x$esd_lib != x; then
+                 echo "-- dynamic libesd -> $esd_lib"
+-                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib")
++                AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ESD_DYNAMIC, "$esd_lib", "")
+             else
+                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ESD_LIBS"
+             fi
+@@ -564,7 +564,7 @@ AC_HELP_STRING([--enable-arts-shared], [
+                               , enable_arts_shared=yes)
+                 arts_lib=[`find_lib "libartsc.so.*" "$ARTS_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
+ 
+-                AC_DEFINE(SDL_AUDIO_DRIVER_ARTS)
++                AC_DEFINE(SDL_AUDIO_DRIVER_ARTS,, "")
+                 SOURCES="$SOURCES $srcdir/src/audio/arts/*.c"
+                 EXTRA_CFLAGS="$EXTRA_CFLAGS $ARTS_CFLAGS"
+                 if test x$have_loadso != xyes && \
+@@ -574,7 +574,7 @@ AC_HELP_STRING([--enable-arts-shared], [
+                 if test x$have_loadso = xyes && \
+                    test x$enable_arts_shared = xyes && test x$arts_lib != x; then
+                     echo "-- dynamic libartsc -> $arts_lib"
+-                    AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib")
++                    AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_ARTS_DYNAMIC, "$arts_lib",1,"")
+                 else
+                     EXTRA_LDFLAGS="$EXTRA_LDFLAGS $ARTS_LIBS"
+                 fi
+@@ -634,7 +634,7 @@ AC_HELP_STRING([--enable-nas-shared], [d
+                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $NAS_LIBS"
+             fi
+ 
+-            AC_DEFINE(SDL_AUDIO_DRIVER_NAS)
++            AC_DEFINE(SDL_AUDIO_DRIVER_NAS,1,"")
+             SOURCES="$SOURCES $srcdir/src/audio/nas/*.c"
+             EXTRA_CFLAGS="$EXTRA_CFLAGS $NAS_CFLAGS"
+             have_audio=yes
+@@ -649,7 +649,7 @@ CheckDiskAudio()
+ AC_HELP_STRING([--enable-diskaudio], [support the disk writer audio driver [[default=yes]]]),
+                   , enable_diskaudio=yes)
+     if test x$enable_audio = xyes -a x$enable_diskaudio = xyes; then
+-        AC_DEFINE(SDL_AUDIO_DRIVER_DISK)
++        AC_DEFINE(SDL_AUDIO_DRIVER_DISK,1,"")
+         SOURCES="$SOURCES $srcdir/src/audio/disk/*.c"
+     fi
+ }
+@@ -661,7 +661,7 @@ CheckDummyAudio()
+ AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=yes]]]),
+                   , enable_dummyaudio=yes)
+     if test x$enable_audio = xyes -a x$enable_dummyaudio = xyes; then
+-        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY)
++        AC_DEFINE(SDL_AUDIO_DRIVER_DUMMY,1,"")
+         SOURCES="$SOURCES $srcdir/src/audio/dummy/*.c"
+     fi
+ }
+@@ -677,7 +677,7 @@ AC_HELP_STRING([--enable-mintaudio], [su
+         AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
+         if test x$have_mint_falcon_hdr = xyes; then
+             mintaudio=yes
+-            AC_DEFINE(SDL_AUDIO_DRIVER_MINT)
++            AC_DEFINE(SDL_AUDIO_DRIVER_MINT,1,"")
+             SOURCES="$SOURCES $srcdir/src/audio/mint/*.c"
+             SOURCES="$SOURCES $srcdir/src/audio/mint/*.S"
+             have_audio=yes
+@@ -746,7 +746,7 @@ AC_HELP_STRING([--enable-nasm], [use nas
+         CompileNASM unquoted-sections || NASM=""
+ 
+         if test "x$NASM" != x -a "x$NASM" != x'"$NASM"'; then
+-            AC_DEFINE(SDL_HERMES_BLITTERS)
++            AC_DEFINE(SDL_HERMES_BLITTERS,1,"")
+             SOURCES="$SOURCES $srcdir/src/hermes/*.asm"
+             NASMFLAGS="$NASMFLAGS -I $srcdir/src/hermes/"
+ 
+@@ -840,9 +840,9 @@ AC_HELP_STRING([--enable-altivec], [use
+         CFLAGS="$save_CFLAGS"
+ 
+         if test x$have_gcc_altivec = xyes; then
+-            AC_DEFINE(SDL_ALTIVEC_BLITTERS)
++            AC_DEFINE(SDL_ALTIVEC_BLITTERS,1,"")
+             if test x$have_altivec_h_hdr = xyes; then
+-              AC_DEFINE(HAVE_ALTIVEC_H)
++              AC_DEFINE(HAVE_ALTIVEC_H,1,"")
+             fi
+             EXTRA_CFLAGS="$EXTRA_CFLAGS $altivec_CFLAGS"
+         fi
+@@ -920,7 +920,7 @@ AC_HELP_STRING([--enable-ipod], [configu
+ 
+     if test x$enable_ipod = xyes; then
+         EXTRA_CFLAGS="$EXTRA_CFLAGS -DIPOD"
+-        AC_DEFINE(SDL_VIDEO_DRIVER_IPOD)
++        AC_DEFINE(SDL_VIDEO_DRIVER_IPOD,1,"")
+         SOURCES="$SOURCES $srcdir/src/video/ipod/*.c"
+     fi
+ }
+@@ -954,7 +954,7 @@ CheckNANOX()
+             EXTRA_CFLAGS="$EXTRA_CFLAGS -DENABLE_NANOX_DIRECT_FB"
+         fi
+ 
+-        AC_DEFINE(SDL_VIDEO_DRIVER_NANOX)
++        AC_DEFINE(SDL_VIDEO_DRIVER_NANOX,1,"")
+         SOURCES="$SOURCES $srcdir/src/video/nanox/*.c"
+         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lnano-X"
+         have_video=yes
+@@ -1020,7 +1020,7 @@ AC_HELP_STRING([--enable-x11-shared], [d
+             CFLAGS="$CFLAGS $X_CFLAGS"
+             LDFLAGS="$LDFLAGS $X_LIBS"
+ 
+-            AC_DEFINE(SDL_VIDEO_DRIVER_X11)
++            AC_DEFINE(SDL_VIDEO_DRIVER_X11,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
+             EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
+ 
+@@ -1042,8 +1042,8 @@ AC_HELP_STRING([--enable-x11-shared], [d
+                test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
+                 echo "-- dynamic libX11 -> $x11_lib"
+                 echo "-- dynamic libX11ext -> $x11ext_lib"
+-                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
+-                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
++                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib","")
++                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib","")
+             else
+                 enable_x11_shared=no
+                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
+@@ -1060,20 +1060,20 @@ AC_HELP_STRING([--enable-dga], [allow us
+ AC_HELP_STRING([--enable-video-dga], [use DGA 2.0 video driver [[default=yes]]]),
+                   , enable_video_dga=yes)
+             if test x$enable_dga = xyes -a x$enable_video_dga = xyes; then
+-                AC_DEFINE(SDL_VIDEO_DRIVER_DGA)
++                AC_DEFINE(SDL_VIDEO_DRIVER_DGA,1,"")
+                 SOURCES="$SOURCES $srcdir/src/video/dga/*.c"
+             fi
+             AC_ARG_ENABLE(video-x11-dgamouse,
+ AC_HELP_STRING([--enable-video-x11-dgamouse], [use X11 DGA for mouse events [[default=yes]]]),
+                           , enable_video_x11_dgamouse=yes)
+             if test x$enable_dga = xyes -a x$enable_video_x11_dgamouse = xyes; then
+-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE)
++                AC_DEFINE(SDL_VIDEO_DRIVER_X11_DGAMOUSE,1,"")
+             fi
+             AC_ARG_ENABLE(video-x11-vm,
+ AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
+                           , enable_video_x11_vm=yes)
+             if test x$enable_video_x11_vm = xyes; then
+-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE)
++                AC_DEFINE(SDL_VIDEO_DRIVER_X11_VIDMODE,1,"")
+                 SOURCES="$SOURCES $srcdir/src/video/Xext/Xxf86vm/*.c"
+             fi
+             AC_ARG_ENABLE(video-x11-xv,
+@@ -1087,14 +1087,14 @@ AC_HELP_STRING([--enable-video-x11-xv],
+ AC_HELP_STRING([--enable-video-x11-xinerama], [enable X11 Xinerama support [[default=yes]]]),
+                             , enable_video_x11_xinerama=yes)
+             if test x$enable_video_x11_xinerama = xyes; then
+-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA)
++                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINERAMA,1,"")
+                 SOURCES="$SOURCES $srcdir/src/video/Xext/Xinerama/*.c"
+             fi
+             AC_ARG_ENABLE(video-x11-xme,
+ AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [[default=yes]]]),
+                             , enable_video_x11_xme=yes)
+             if test x$enable_video_x11_xme = xyes; then
+-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME)
++                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME,1,"")
+                 SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c"
+             fi
+             AC_ARG_ENABLE(video-x11-xrandr,
+@@ -1111,8 +1111,8 @@ AC_HELP_STRING([--enable-video-x11-xrand
+                     if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
+                         echo "-- dynamic libXrender -> $xrender_lib"
+                         echo "-- dynamic libXrandr -> $xrandr_lib"
+-                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
+-                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib")
++                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib","")
++                        AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib","")
+                         definitely_enable_video_x11_xrandr=yes
+                     else
+                         AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
+@@ -1125,7 +1125,7 @@ AC_HELP_STRING([--enable-video-x11-xrand
+                 fi
+             fi
+             if test x$definitely_enable_video_x11_xrandr = xyes; then
+-                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
++                AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR,1,"")
+             fi
+         fi
+     fi
+@@ -1152,7 +1152,7 @@ AC_HELP_STRING([--enable-video-photon],
+         ])
+         AC_MSG_RESULT($video_photon)
+         if test x$video_photon = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON)
++            AC_DEFINE(SDL_VIDEO_DRIVER_PHOTON,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/photon/*.c"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lph"
+             have_video=yes
+@@ -1166,7 +1166,7 @@ dnl Set up the BWindow video driver if e
+ CheckBWINDOW()
+ {
+     if test x$enable_video = xyes; then
+-        AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW)
++        AC_DEFINE(SDL_VIDEO_DRIVER_BWINDOW,1,"")
+         SOURCES="$SOURCES $srcdir/src/video/bwindow/*.cc"
+         have_video=yes
+     fi
+@@ -1189,7 +1189,7 @@ AC_HELP_STRING([--enable-video-carbon],
+         ])
+         AC_MSG_RESULT($have_carbon)
+         if test x$have_carbon = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX)
++            AC_DEFINE(SDL_VIDEO_DRIVER_TOOLBOX,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/maccommon/*.c"
+             SOURCES="$SOURCES $srcdir/src/video/macrom/*.c"
+             have_video=yes
+@@ -1218,7 +1218,7 @@ AC_HELP_STRING([--enable-video-cocoa], [
+         AC_MSG_RESULT($have_cocoa)
+         CFLAGS="$save_CFLAGS"
+         if test x$have_cocoa = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ)
++            AC_DEFINE(SDL_VIDEO_DRIVER_QUARTZ,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/quartz/*.m"
+             have_video=yes
+         fi
+@@ -1245,7 +1245,7 @@ AC_HELP_STRING([--enable-video-fbcon], [
+         AC_MSG_RESULT($video_fbcon)
+         if test x$video_fbcon = xyes; then
+             AC_CHECK_FUNCS(getpagesize)
+-            AC_DEFINE(SDL_VIDEO_DRIVER_FBCON)
++            AC_DEFINE(SDL_VIDEO_DRIVER_FBCON,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/fbcon/*.c"
+             have_video=yes
+         fi
+@@ -1296,7 +1296,7 @@ AC_HELP_STRING([--enable-video-directfb]
+         AC_MSG_RESULT($video_directfb)
+ 
+         if test x$video_directfb = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB)
++            AC_DEFINE(SDL_VIDEO_DRIVER_DIRECTFB,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/directfb/*.c"
+             EXTRA_CFLAGS="$EXTRA_CFLAGS $DIRECTFB_CFLAGS"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DIRECTFB_LIBS"
+@@ -1323,7 +1323,7 @@ AC_HELP_STRING([--enable-video-ps2gs], [
+         ])
+         AC_MSG_RESULT($video_ps2gs)
+         if test x$video_ps2gs = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS)
++            AC_DEFINE(SDL_VIDEO_DRIVER_PS2GS,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/ps2gs/*.c"
+             have_video=yes
+         fi
+@@ -1376,7 +1376,7 @@ AC_HELP_STRING([--enable-video-ggi], [us
+         ])
+         AC_MSG_RESULT($video_ggi)
+         if test x$video_ggi = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_GGI)
++            AC_DEFINE(SDL_VIDEO_DRIVER_GGI,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/ggi/*.c"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lggi -lgii -lgg"
+             have_video=yes
+@@ -1406,7 +1406,7 @@ AC_HELP_STRING([--enable-video-svga], [u
+         ])
+         AC_MSG_RESULT($video_svga)
+         if test x$video_svga = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB)
++            AC_DEFINE(SDL_VIDEO_DRIVER_SVGALIB,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/svga/*.c"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvga"
+             have_video=yes
+@@ -1438,7 +1438,7 @@ AC_HELP_STRING([--enable-video-vgl], [us
+         ])
+         AC_MSG_RESULT($video_vgl)
+         if test x$video_vgl = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_VGL)
++            AC_DEFINE(SDL_VIDEO_DRIVER_VGL,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/vgl/*.c"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lvgl"
+             have_video=yes
+@@ -1466,7 +1466,7 @@ AC_HELP_STRING([--enable-video-wscons],
+         ])
+         AC_MSG_RESULT($video_wscons)
+         if test x$video_wscons = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS)
++            AC_DEFINE(SDL_VIDEO_DRIVER_WSCONS,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/wscons/*.c"
+             have_video=yes
+         fi
+@@ -1491,7 +1491,7 @@ AC_HELP_STRING([--enable-video-aalib], [
+         ])
+         AC_MSG_RESULT($video_aalib)
+         if test x$video_aalib = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_AALIB)
++            AC_DEFINE(SDL_VIDEO_DRIVER_AALIB,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/aalib/*.c"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -laa"
+             have_video=yes
+@@ -1553,7 +1553,7 @@ AC_HELP_STRING([--enable-video-qtopia],
+         CXXFLAGS="$OLD_CXX"
+         AC_MSG_RESULT($video_qtopia)
+         if test x$video_qtopia = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA)
++            AC_DEFINE(SDL_VIDEO_DRIVER_QTOPIA,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/qtopia/*.cc"
+             SDLMAIN_SOURCES="$srcdir/src/main/qtopia/*.cc"
+             SDLMAIN_LDFLAGS="-static"
+@@ -1583,7 +1583,7 @@ AC_HELP_STRING([--enable-video-picogui],
+         ])
+         AC_MSG_RESULT($video_picogui)
+         if test x$video_picogui = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI)
++            AC_DEFINE(SDL_VIDEO_DRIVER_PICOGUI,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/picogui/*.c"
+             SDL_LIBS="$SDL_LIBS -lpgui"
+             have_video=yes
+@@ -1607,7 +1607,7 @@ AC_HELP_STRING([--enable-video-xbios], [
+     video_xbios=no
+     if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
+         video_xbios=yes
+-        AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS)
++        AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS,1,"")
+         SOURCES="$SOURCES $srcdir/src/video/xbios/*.c"
+         have_video=yes
+     fi
+@@ -1625,7 +1625,7 @@ AC_HELP_STRING([--enable-video-gem], [us
+         AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
+         if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
+             video_gem=yes
+-            AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
++            AC_DEFINE(SDL_VIDEO_DRIVER_GEM,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
+             SDL_LIBS="$SDL_LIBS -lgem"
+             have_video=yes
+@@ -1640,7 +1640,7 @@ CheckDummyVideo()
+ AC_HELP_STRING([--enable-video-dummy], [use dummy video driver [[default=yes]]]),
+                   , enable_video_dummy=yes)
+     if test x$enable_video_dummy = xyes; then
+-        AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY)
++        AC_DEFINE(SDL_VIDEO_DRIVER_DUMMY,1,"")
+         SOURCES="$SOURCES $srcdir/src/video/dummy/*.c"
+         have_video=yes
+     fi
+@@ -1667,8 +1667,8 @@ CheckOpenGLX11()
+         ])
+         AC_MSG_RESULT($video_opengl)
+         if test x$video_opengl = xyes; then
+-            AC_DEFINE(SDL_VIDEO_OPENGL)
+-            AC_DEFINE(SDL_VIDEO_OPENGL_GLX)
++            AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
++            AC_DEFINE(SDL_VIDEO_OPENGL_GLX,1,"")
+         fi
+     fi
+ }
+@@ -1687,7 +1687,7 @@ CheckOpenGLQNX()
+         ])
+         AC_MSG_RESULT($video_opengl)
+         if test x$video_opengl = xyes; then
+-            AC_DEFINE(SDL_VIDEO_OPENGL)
++            AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
+         fi
+     fi
+@@ -1697,8 +1697,8 @@ dnl Check for Win32 OpenGL
+ CheckWIN32GL()
+ {
+     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+-        AC_DEFINE(SDL_VIDEO_OPENGL)
+-        AC_DEFINE(SDL_VIDEO_OPENGL_WGL)
++        AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
++        AC_DEFINE(SDL_VIDEO_OPENGL_WGL,1,"")
+     fi
+ }
+ 
+@@ -1706,7 +1706,7 @@ dnl Check for BeOS OpenGL
+ CheckBeGL()
+ {
+     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+-        AC_DEFINE(SDL_VIDEO_OPENGL)
++        AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
+         EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lGL"
+     fi
+ }
+@@ -1715,7 +1715,7 @@ dnl Check for MacOS OpenGL
+ CheckMacGL()
+ {
+     if test x$enable_video = xyes -a x$enable_video_opengl = xyes; then
+-        AC_DEFINE(SDL_VIDEO_OPENGL)
++        AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
+         case "$host" in
+             *-*-darwin*)
+                 if test x$enable_video_cocoa = xyes; then
+@@ -1747,8 +1747,8 @@ CheckAtariOSMesa()
+             OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
+             OSMESA_LIBS=`$OSMESA_CONFIG --libs`
+         fi
+-        AC_DEFINE(SDL_VIDEO_OPENGL)
+-        AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
++        AC_DEFINE(SDL_VIDEO_OPENGL,1,"")
++        AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA,1,"")
+         SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS"
+         SDL_LIBS="$SDL_LIBS $OSMESA_LIBS"
+ 
+@@ -1758,7 +1758,7 @@ AC_HELP_STRING([--enable-osmesa-shared],
+         if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
+             # Dynamic linking
+             if test "x$have_osmesa_hdr" = "xyes"; then
+-                AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC)
++                AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC,1,"")
+             fi
+         fi
+     fi
+@@ -1792,7 +1792,7 @@ AC_HELP_STRING([--enable-input-events],
+         ])
+         AC_MSG_RESULT($use_input_events)
+         if test x$use_input_events = xyes; then
+-            AC_DEFINE(SDL_INPUT_LINUXEV)
++            AC_DEFINE(SDL_INPUT_LINUXEV,1,"")
+         fi
+     fi
+ }
+@@ -1814,7 +1814,7 @@ AC_HELP_STRING([--enable-input-tslib], [
+         ])
+         AC_MSG_RESULT($enable_input_tslib)
+         if test x$enable_input_tslib = xyes; then
+-            AC_DEFINE(SDL_INPUT_TSLIB)
++            AC_DEFINE(SDL_INPUT_TSLIB,1,"")
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lts"
+         fi
+     fi
+@@ -1837,7 +1837,7 @@ AC_HELP_STRING([--enable-pth], [use GNU
+         AC_MSG_CHECKING(pth)
+         AC_MSG_RESULT($use_pth)
+         if test "x$use_pth" = xyes; then
+-            AC_DEFINE(SDL_THREAD_PTH)
++            AC_DEFINE(SDL_THREAD_PTH,1,"")
+             SOURCES="$SOURCES $srcdir/src/thread/pth/*.c"
+             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
+             SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`"
+@@ -1943,7 +1943,7 @@ AC_HELP_STRING([--enable-pthread-sem], [
+ 
+         # Do futher testing if we have pthread support...
+         if test x$use_pthreads = xyes; then
+-            AC_DEFINE(SDL_THREAD_PTHREAD)
++            AC_DEFINE(SDL_THREAD_PTHREAD,1,"")
+             EXTRA_CFLAGS="$EXTRA_CFLAGS $pthread_cflags"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $pthread_lib"
+             SDL_CFLAGS="$SDL_CFLAGS $pthread_cflags"
+@@ -1965,7 +1965,7 @@ AC_HELP_STRING([--enable-pthread-sem], [
+                   pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+                 ],[
+                 has_recursive_mutexes=yes
+-                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX)
++                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX,1,"")
+                 ])
+             fi
+             if test x$has_recursive_mutexes = xno; then
+@@ -1976,7 +1976,7 @@ AC_HELP_STRING([--enable-pthread-sem], [
+                   pthread_mutexattr_setkind_np(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+                 ],[
+                 has_recursive_mutexes=yes
+-                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP)
++                AC_DEFINE(SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP,1,"")
+                 ])
+             fi
+             AC_MSG_RESULT($has_recursive_mutexes)
+@@ -2065,7 +2065,7 @@ AC_HELP_STRING([--enable-stdio-redirect]
+     fi
+ 
+     if test x$enable_video = xyes; then
+-        AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB)
++        AC_DEFINE(SDL_VIDEO_DRIVER_WINDIB,1,"")
+         SOURCES="$SOURCES $srcdir/src/video/wincommon/*.c"
+         SOURCES="$SOURCES $srcdir/src/video/windib/*.c"
+         have_video=yes
+@@ -2087,7 +2087,7 @@ AC_HELP_STRING([--enable-directx], [use
+             have_directx=yes
+         fi
+         if test x$enable_video = xyes -a x$have_directx = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW)
++            AC_DEFINE(SDL_VIDEO_DRIVER_DDRAW,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/windx5/*.c"
+             have_video=yes
+         fi
+@@ -2118,7 +2118,7 @@ AC_HELP_STRING([--enable-sdl-dlopen], [u
+             AC_CHECK_LIB(c, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS",
+                AC_CHECK_LIB(dl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -ldl",
+                   AC_CHECK_LIB(ltdl, dlopen, EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lltdl")))
+-            AC_DEFINE(SDL_LOADSO_DLOPEN)
++            AC_DEFINE(SDL_LOADSO_DLOPEN,1,"")
+             SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
+             have_loadso=yes
+         fi
+@@ -2135,7 +2135,7 @@ AC_HELP_STRING([--enable-atari-ldg], [us
+         AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
+         AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
+         if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
+-            AC_DEFINE(SDL_LOADSO_LDG)
++            AC_DEFINE(SDL_LOADSO_LDG,1,"")
+             SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
+             SDL_LIBS="$SDL_LIBS -lldg -lgem"
+             have_loadso=yes
+@@ -2266,11 +2266,11 @@ CheckUSBHID()
+             have_machine_joystick=yes
+             ])
+             if test x$have_machine_joystick = xyes; then
+-                AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H)
++                AC_DEFINE(SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H,1,"")
+             fi
+             AC_MSG_RESULT($have_machine_joystick)
+ 
+-            AC_DEFINE(SDL_JOYSTICK_USBHID)
++            AC_DEFINE(SDL_JOYSTICK_USBHID,1,"")
+             SOURCES="$SOURCES $srcdir/src/joystick/bsd/*.c"
+             EXTRA_CFLAGS="$EXTRA_CFLAGS $USB_CFLAGS"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $USB_LIBS"
+@@ -2289,7 +2289,7 @@ AC_HELP_STRING([--enable-clock_gettime],
+     if test x$enable_clock_gettime = xyes; then
+         AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=yes)
+         if test x$have_clock_gettime = xyes; then
+-            AC_DEFINE(HAVE_CLOCK_GETTIME)
++            AC_DEFINE(HAVE_CLOCK_GETTIME,1,"")
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lrt"
+         fi
+     fi
+@@ -2320,7 +2320,7 @@ case "$host" in
+         CheckIPod
+         # Set up files for the timer library
+         if test x$enable_timers = xyes; then
+-            AC_DEFINE(SDL_TIMER_UNIX)
++            AC_DEFINE(SDL_TIMER_UNIX,1,"")
+             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+             have_timers=yes
+         fi
+@@ -2386,17 +2386,17 @@ case "$host" in
+         if test x$enable_audio = xyes; then
+           case $ARCH in
+             sysv5|solaris|hpux)
+-                AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
++                AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO,1,"")
+                 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
+                 have_audio=yes
+             ;;
+             netbsd|openbsd)
+-                AC_DEFINE(SDL_AUDIO_DRIVER_BSD)
++                AC_DEFINE(SDL_AUDIO_DRIVER_BSD,1,"")
+                 SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
+                 have_audio=yes
+             ;;
+             aix)
+-                AC_DEFINE(SDL_AUDIO_DRIVER_PAUD)
++                AC_DEFINE(SDL_AUDIO_DRIVER_PAUD,1,"")
+                 SOURCES="$SOURCES $srcdir/src/audio/paudio/*.c"
+                 have_audio=yes
+             ;;
+@@ -2406,7 +2406,7 @@ case "$host" in
+         if test x$enable_joystick = xyes; then
+           case $ARCH in
+             linux)
+-                AC_DEFINE(SDL_JOYSTICK_LINUX)
++                AC_DEFINE(SDL_JOYSTICK_LINUX,1,"")
+                 SOURCES="$SOURCES $srcdir/src/joystick/linux/*.c"
+                 have_joystick=yes
+             ;;
+@@ -2416,32 +2416,32 @@ case "$host" in
+         if test x$enable_cdrom = xyes; then
+           case $ARCH in
+             linux|solaris)
+-                AC_DEFINE(SDL_CDROM_LINUX)
++                AC_DEFINE(SDL_CDROM_LINUX,1,"")
+                 SOURCES="$SOURCES $srcdir/src/cdrom/linux/*.c"
+                 have_cdrom=yes
+             ;;
+             *freebsd*)
+-                AC_DEFINE(SDL_CDROM_FREEBSD)
++                AC_DEFINE(SDL_CDROM_FREEBSD,1,"")
+                 SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c"
+                 have_cdrom=yes
+             ;;
+             *openbsd*|*netbsd*)
+-                AC_DEFINE(SDL_CDROM_OPENBSD)
++                AC_DEFINE(SDL_CDROM_OPENBSD,1,"")
+                 SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c"
+                 have_cdrom=yes
+             ;;
+             bsdi)
+-                AC_DEFINE(SDL_CDROM_BSDI)
++                AC_DEFINE(SDL_CDROM_BSDI,1,"")
+                 SOURCES="$SOURCES $srcdir/src/cdrom/bsdi/*.c"
+                 have_cdrom=yes
+             ;;
+             aix)
+-                AC_DEFINE(SDL_CDROM_AIX)
++                AC_DEFINE(SDL_CDROM_AIX,1,"")
+                 SOURCES="$SOURCES $srcdir/src/cdrom/aix/*.c"
+                 have_cdrom=yes
+             ;;
+             osf)
+-                AC_DEFINE(SDL_CDROM_OSF)
++                AC_DEFINE(SDL_CDROM_OSF,1,"")
+                 SOURCES="$SOURCES $srcdir/src/cdrom/osf/*.c"
+                 have_cdrom=yes
+             ;;
+@@ -2449,7 +2449,7 @@ case "$host" in
+         fi
+         # Set up files for the thread library
+         if test x$enable_threads = xyes -a x$use_pthreads != xyes -a x$use_pth != xyes -a x$ARCH = xirix; then
+-            AC_DEFINE(SDL_THREAD_SPROC)
++            AC_DEFINE(SDL_THREAD_SPROC,1,"")
+             SOURCES="$SOURCES $srcdir/src/thread/irix/*.c"
+             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
+             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
+@@ -2457,7 +2457,7 @@ case "$host" in
+         fi
+         # Set up files for the timer library
+         if test x$enable_timers = xyes; then
+-            AC_DEFINE(SDL_TIMER_UNIX)
++            AC_DEFINE(SDL_TIMER_UNIX,1,"")
+             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+             have_timers=yes
+         fi
+@@ -2476,20 +2476,20 @@ case "$host" in
+         CheckPTHREAD
+         # Set up files for the audio library
+         if test x$enable_audio = xyes; then
+-            AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO)
++            AC_DEFINE(SDL_AUDIO_DRIVER_QNXNTO,1,"")
+             SOURCES="$SOURCES $srcdir/src/audio/nto/*.c"
+             EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lasound"
+             have_audio=yes
+         fi
+         # Set up files for the cdrom library
+         if test x$enable_cdrom = xyes; then
+-            AC_DEFINE(SDL_CDROM_QNX)
++            AC_DEFINE(SDL_CDROM_QNX,1,"")
+             SOURCES="$SOURCES $srcdir/src/cdrom/qnx/*.c"
+             have_cdrom=yes
+         fi
+         # Set up files for the timer library
+         if test x$enable_timers = xyes; then
+-            AC_DEFINE(SDL_TIMER_UNIX)
++            AC_DEFINE(SDL_TIMER_UNIX,1,"")
+             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+             have_timers=yes
+         fi
+@@ -2514,29 +2514,29 @@ case "$host" in
+         CheckNASM
+         # Set up files for the audio library
+         if test x$enable_audio = xyes; then
+-            AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT)
++            AC_DEFINE(SDL_AUDIO_DRIVER_WAVEOUT,1,"")
+             SOURCES="$SOURCES $srcdir/src/audio/windib/*.c"
+             if test x$have_directx = xyes; then
+-                AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND)
++                AC_DEFINE(SDL_AUDIO_DRIVER_DSOUND,1,"")
+                 SOURCES="$SOURCES $srcdir/src/audio/windx5/*.c"
+             fi
+             have_audio=yes
+         fi
+         # Set up files for the joystick library
+         if test x$enable_joystick = xyes; then
+-            AC_DEFINE(SDL_JOYSTICK_WINMM)
++            AC_DEFINE(SDL_JOYSTICK_WINMM,1,"")
+             SOURCES="$SOURCES $srcdir/src/joystick/win32/*.c"
+             have_joystick=yes
+         fi
+         # Set up files for the cdrom library
+         if test x$enable_cdrom = xyes; then
+-            AC_DEFINE(SDL_CDROM_WIN32)
++            AC_DEFINE(SDL_CDROM_WIN32,1,"")
+             SOURCES="$SOURCES $srcdir/src/cdrom/win32/*.c"
+             have_cdrom=yes
+         fi
+         # Set up files for the thread library
+         if test x$enable_threads = xyes; then
+-            AC_DEFINE(SDL_THREAD_WIN32)
++            AC_DEFINE(SDL_THREAD_WIN32,1,"")
+             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_sysmutex.c"
+             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_syssem.c"
+             SOURCES="$SOURCES $srcdir/src/thread/win32/SDL_systhread.c"
+@@ -2545,13 +2545,13 @@ case "$host" in
+         fi
+         # Set up files for the timer library
+         if test x$enable_timers = xyes; then
+-            AC_DEFINE(SDL_TIMER_WIN32)
++            AC_DEFINE(SDL_TIMER_WIN32,1,"")
+             SOURCES="$SOURCES $srcdir/src/timer/win32/*.c"
+             have_timers=yes
+         fi
+         # Set up files for the shared object loading library
+         if test x$enable_loadso = xyes; then
+-            AC_DEFINE(SDL_LOADSO_WIN32)
++            AC_DEFINE(SDL_LOADSO_WIN32,1,"")
+             SOURCES="$SOURCES $srcdir/src/loadso/win32/*.c"
+             have_loadso=yes
+         fi
+@@ -2622,25 +2622,25 @@ case "$host" in
+         CheckBeGL
+         # Set up files for the audio library
+         if test x$enable_audio = xyes; then
+-            AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO)
++            AC_DEFINE(SDL_AUDIO_DRIVER_BAUDIO,1,"")
+             SOURCES="$SOURCES $srcdir/src/audio/baudio/*.cc"
+             have_audio=yes
+         fi
+         # Set up files for the joystick library
+         if test x$enable_joystick = xyes; then
+-            AC_DEFINE(SDL_JOYSTICK_BEOS)
++            AC_DEFINE(SDL_JOYSTICK_BEOS,1,"")
+             SOURCES="$SOURCES $srcdir/src/joystick/beos/*.cc"
+             have_joystick=yes
+         fi
+         # Set up files for the cdrom library
+         if test x$enable_cdrom = xyes; then
+-            AC_DEFINE(SDL_CDROM_BEOS)
++            AC_DEFINE(SDL_CDROM_BEOS,1,"")
+             SOURCES="$SOURCES $srcdir/src/cdrom/beos/*.cc"
+             have_cdrom=yes
+         fi
+         # Set up files for the thread library
+         if test x$enable_threads = xyes; then
+-            AC_DEFINE(SDL_THREAD_BEOS)
++            AC_DEFINE(SDL_THREAD_BEOS,1,"")
+             SOURCES="$SOURCES $srcdir/src/thread/beos/*.c"
+             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_sysmutex.c"
+             SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syscond.c"
+@@ -2648,7 +2648,7 @@ case "$host" in
+         fi
+         # Set up files for the timer library
+         if test x$enable_timers = xyes; then
+-            AC_DEFINE(SDL_TIMER_BEOS)
++            AC_DEFINE(SDL_TIMER_BEOS,1,"")
+             SOURCES="$SOURCES $srcdir/src/timer/beos/*.c"
+             have_timers=yes
+         fi
+@@ -2656,11 +2656,11 @@ case "$host" in
+         if test x$enable_loadso = xyes; then
+             case "$host" in
+                 *-*-beos*)
+-                    AC_DEFINE(SDL_LOADSO_BEOS)
++                    AC_DEFINE(SDL_LOADSO_BEOS,1,"")
+                     SOURCES="$SOURCES $srcdir/src/loadso/beos/*.c"
+                 ;;
+                 *-*-haiku*)
+-                    AC_DEFINE(SDL_LOADSO_DLOPEN)
++                    AC_DEFINE(SDL_LOADSO_DLOPEN,1,"")
+                     SOURCES="$SOURCES $srcdir/src/loadso/dlopen/*.c"
+                 ;;
+             esac    
+@@ -2696,7 +2696,7 @@ case "$host" in
+         # Set up files for the shared object loading library
+         # (this needs to be done before the dynamic X11 check)
+         if test x$enable_loadso = xyes -a x$have_dlopen != xyes; then
+-            AC_DEFINE(SDL_LOADSO_DLCOMPAT)
++            AC_DEFINE(SDL_LOADSO_DLCOMPAT,1,"")
+             SOURCES="$SOURCES $srcdir/src/loadso/macosx/*.c"
+             have_loadso=yes
+         fi
+@@ -2714,26 +2714,26 @@ case "$host" in
+ 
+         # Set up files for the audio library
+         if test x$enable_audio = xyes; then
+-            AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO)
++            AC_DEFINE(SDL_AUDIO_DRIVER_COREAUDIO,1,"")
+             SOURCES="$SOURCES $srcdir/src/audio/macosx/*.c"
+             have_audio=yes
+         fi
+         # Set up files for the joystick library
+         if test x$enable_joystick = xyes; then
+-            AC_DEFINE(SDL_JOYSTICK_IOKIT)
++            AC_DEFINE(SDL_JOYSTICK_IOKIT,1,"")
+             SOURCES="$SOURCES $srcdir/src/joystick/darwin/*.c"
+             have_joystick=yes
+             need_iokit_framework=yes
+         fi
+         # Set up files for the cdrom library
+         if test x$enable_cdrom = xyes; then
+-            AC_DEFINE(SDL_CDROM_MACOSX)
++            AC_DEFINE(SDL_CDROM_MACOSX,1,"")
+             SOURCES="$SOURCES $srcdir/src/cdrom/macosx/*.c"
+             have_cdrom=yes
+         fi
+         # Set up files for the timer library
+         if test x$enable_timers = xyes; then
+-            AC_DEFINE(SDL_TIMER_UNIX)
++            AC_DEFINE(SDL_TIMER_UNIX,1,"")
+             SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+             have_timers=yes
+         fi
+@@ -2775,30 +2775,30 @@ case "$host" in
+         # Set up files for the audio library
+         if test x$enable_threads = xyes -a x$enable_pth = xyes; then
+             if test x$enable_audio = xyes; then
+-                AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
++                AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO,1,"")
+                 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
+                 have_audio=yes
+             fi
+         fi
+         # Set up files for the joystick library
+         if test x$enable_joystick = xyes; then
+-            AC_DEFINE(SDL_JOYSTICK_MINT)
++            AC_DEFINE(SDL_JOYSTICK_MINT,1,"")
+             SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
+             have_joystick=yes
+         fi
+         # Set up files for the cdrom library
+         if test x$enable_cdrom = xyes; then
+-            AC_DEFINE(SDL_CDROM_MINT)
++            AC_DEFINE(SDL_CDROM_MINT,1,"")
+             SOURCES="$SOURCES $srcdir/src/cdrom/mint/*.c"
+             have_cdrom=yes
+         fi
+         # Set up files for the timer library
+         if test x$enable_timers = xyes; then
+             if test x$enable_threads = xyes -a x$enable_pth = xyes; then
+-                AC_DEFINE(SDL_TIMER_UNIX)
++                AC_DEFINE(SDL_TIMER_UNIX,1,"")
+                 SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
+             else
+-                AC_DEFINE(SDL_TIMER_MINT)
++                AC_DEFINE(SDL_TIMER_MIN,1,""T)
+                 SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
+                 SOURCES="$SOURCES $srcdir/src/timer/mint/*.S"
+             fi
+@@ -2811,20 +2811,20 @@ case "$host" in
+         CheckPTHREAD
+         # Set up files for the video library
+         if test x$enable_video = xyes; then
+-            AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS)
++            AC_DEFINE(SDL_VIDEO_DRIVER_RISCOS,1,"")
+             SOURCES="$SOURCES $srcdir/src/video/riscos/*.c"
+             SOURCES="$SOURCES $srcdir/src/video/riscos/*.S"
+             have_video=yes
+         fi
+         # Set up files for the joystick library
+         if test x$enable_joystick = xyes; then
+-            AC_DEFINE(SDL_JOYSTICK_RISCOS)
++            AC_DEFINE(SDL_JOYSTICK_RISCOS,1,"")
+             SOURCES="$SOURCES $srcdir/src/joystick/riscos/*.c"
+             have_joystick=yes
+         fi
+         # Set up files for the timer library
+         if test x$enable_timers = xyes; then
+-            AC_DEFINE(SDL_TIMER_RISCOS)
++            AC_DEFINE(SDL_TIMER_RISCOS,1,"")
+             SOURCES="$SOURCES $srcdir/src/timer/riscos/*.c"
+             have_timers=yes
+         fi
+@@ -2846,31 +2846,31 @@ CheckWarnAll
+ if test x$enable_joystick = xyes; then
+   if test x$have_joystick != xyes; then
+     # Wants joystick subsystem, but doesn't have a platform-specific backend...
+-    AC_DEFINE(SDL_JOYSTICK_DUMMY)
++    AC_DEFINE(SDL_JOYSTICK_DUMMY,1,"")
+     SOURCES="$SOURCES $srcdir/src/joystick/dummy/*.c"
+   fi
+ fi
+ if test x$have_cdrom != xyes; then
+     if test x$enable_cdrom = xyes; then
+-        AC_DEFINE(SDL_CDROM_DISABLED)
++        AC_DEFINE(SDL_CDROM_DISABLED,1,"")
+     fi
+     SOURCES="$SOURCES $srcdir/src/cdrom/dummy/*.c"
+ fi
+ if test x$have_threads != xyes; then
+     if test x$enable_threads = xyes; then
+-        AC_DEFINE(SDL_THREADS_DISABLED)
++        AC_DEFINE(SDL_THREADS_DISABLED,1,"")
+     fi
+     SOURCES="$SOURCES $srcdir/src/thread/generic/*.c"
+ fi
+ if test x$have_timers != xyes; then
+     if test x$enable_timers = xyes; then
+-        AC_DEFINE(SDL_TIMERS_DISABLED)
++        AC_DEFINE(SDL_TIMERS_DISABLED,1,"")
+     fi
+     SOURCES="$SOURCES $srcdir/src/timer/dummy/*.c"
+ fi
+ if test x$have_loadso != xyes; then
+     if test x$enable_loadso = xyes; then
+-        AC_DEFINE(SDL_LOADSO_DISABLED)
++        AC_DEFINE(SDL_LOADSO_DISABLED,1,"")
+     fi
+     SOURCES="$SOURCES $srcdir/src/loadso/dummy/*.c"
+ fi
diff --git a/meta/recipes-graphics/libsdl/libsdl-1.2.15/libsdl-1.2.15-xdata32.patch b/meta/recipes-graphics/libsdl/libsdl-1.2.15/libsdl-1.2.15-xdata32.patch
new file mode 100644
index 0000000..f98b927
--- /dev/null
+++ b/meta/recipes-graphics/libsdl/libsdl-1.2.15/libsdl-1.2.15-xdata32.patch
@@ -0,0 +1,19 @@
+libX11-1.5.99.901 has changed prototype of _XData32
+
+Upstream-Status: Backport
+<http://bugzilla.libsdl.org/show_bug.cgi?id=1769>
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+diff -r b6b2829cd7ef src/video/x11/SDL_x11sym.h
+--- a/src/video/x11/SDL_x11sym.h	Wed Feb 27 15:20:31 2013 -0800
++++ b/src/video/x11/SDL_x11sym.h	Wed Mar 27 16:07:23 2013 +0100
+@@ -165,7 +165,7 @@
+  */
+ #ifdef LONG64
+ SDL_X11_MODULE(IO_32BIT)
+-SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
++SDL_X11_SYM(int,_XData32,(Display *dpy,register _Xconst long *data,unsigned len),(dpy,data,len),return)
+ SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,len),)
+ #endif
+
diff --git a/meta/recipes-graphics/libsdl/libsdl-1.2.15/pkgconfig.patch b/meta/recipes-graphics/libsdl/libsdl-1.2.15/pkgconfig.patch
new file mode 100644
index 0000000..913baa9
--- /dev/null
+++ b/meta/recipes-graphics/libsdl/libsdl-1.2.15/pkgconfig.patch
@@ -0,0 +1,187 @@
+Rather than code which doesn't even work properly when cross compiling,
+lets just use pkg-config instead. Its a little simpler.
+
+RP 2014/6/20
+
+Upstream-Status: Pending
+
+Index: SDL-1.2.15/sdl.m4
+===================================================================
+--- SDL-1.2.15.orig/sdl.m4
++++ SDL-1.2.15/sdl.m4
+@@ -12,174 +12,8 @@ dnl Test for SDL, and define SDL_CFLAGS
+ dnl
+ AC_DEFUN([AM_PATH_SDL],
+ [dnl 
+-dnl Get the cflags and libraries from the sdl-config script
+-dnl
+-AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
+-            sdl_prefix="$withval", sdl_prefix="")
+-AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
+-            sdl_exec_prefix="$withval", sdl_exec_prefix="")
+-AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
+-		    , enable_sdltest=yes)
+-
+-  if test x$sdl_exec_prefix != x ; then
+-    sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
+-    if test x${SDL_CONFIG+set} != xset ; then
+-      SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+-    fi
+-  fi
+-  if test x$sdl_prefix != x ; then
+-    sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
+-    if test x${SDL_CONFIG+set} != xset ; then
+-      SDL_CONFIG=$sdl_prefix/bin/sdl-config
+-    fi
+-  fi
+-
+-  as_save_PATH="$PATH"
+-  if test "x$prefix" != xNONE; then
+-    PATH="$prefix/bin:$prefix/usr/bin:$PATH"
+-  fi
+-  AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
+-  PATH="$as_save_PATH"
+   min_sdl_version=ifelse([$1], ,0.11.0,$1)
+-  AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
+-  no_sdl=""
+-  if test "$SDL_CONFIG" = "no" ; then
+-    no_sdl=yes
+-  else
+-    SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
+-    SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
+-
+-    sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
+-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+-    sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
+-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+-    sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
+-           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+-    if test "x$enable_sdltest" = "xyes" ; then
+-      ac_save_CFLAGS="$CFLAGS"
+-      ac_save_CXXFLAGS="$CXXFLAGS"
+-      ac_save_LIBS="$LIBS"
+-      CFLAGS="$CFLAGS $SDL_CFLAGS"
+-      CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+-      LIBS="$LIBS $SDL_LIBS"
+-dnl
+-dnl Now check if the installed SDL is sufficiently new. (Also sanity
+-dnl checks the results of sdl-config to some extent
+-dnl
+-      rm -f conf.sdltest
+-      AC_TRY_RUN([
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include "SDL.h"
+-
+-char*
+-my_strdup (char *str)
+-{
+-  char *new_str;
+-  
+-  if (str)
+-    {
+-      new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
+-      strcpy (new_str, str);
+-    }
+-  else
+-    new_str = NULL;
+-  
+-  return new_str;
+-}
+-
+-int main (int argc, char *argv[])
+-{
+-  int major, minor, micro;
+-  char *tmp_version;
+-
+-  /* This hangs on some systems (?)
+-  system ("touch conf.sdltest");
+-  */
+-  { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
+-
+-  /* HP/UX 9 (%@#!) writes to sscanf strings */
+-  tmp_version = my_strdup("$min_sdl_version");
+-  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+-     printf("%s, bad version string\n", "$min_sdl_version");
+-     exit(1);
+-   }
+-
+-   if (($sdl_major_version > major) ||
+-      (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
+-      (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
+-    {
+-      return 0;
+-    }
+-  else
+-    {
+-      printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
+-      printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
+-      printf("*** best to upgrade to the required version.\n");
+-      printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
+-      printf("*** to point to the correct copy of sdl-config, and remove the file\n");
+-      printf("*** config.cache before re-running configure\n");
+-      return 1;
+-    }
+-}
+-
+-],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+-       CFLAGS="$ac_save_CFLAGS"
+-       CXXFLAGS="$ac_save_CXXFLAGS"
+-       LIBS="$ac_save_LIBS"
+-     fi
+-  fi
+-  if test "x$no_sdl" = x ; then
+-     AC_MSG_RESULT(yes)
+-     ifelse([$2], , :, [$2])     
+-  else
+-     AC_MSG_RESULT(no)
+-     if test "$SDL_CONFIG" = "no" ; then
+-       echo "*** The sdl-config script installed by SDL could not be found"
+-       echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
+-       echo "*** your path, or set the SDL_CONFIG environment variable to the"
+-       echo "*** full path to sdl-config."
+-     else
+-       if test -f conf.sdltest ; then
+-        :
+-       else
+-          echo "*** Could not run SDL test program, checking why..."
+-          CFLAGS="$CFLAGS $SDL_CFLAGS"
+-          CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
+-          LIBS="$LIBS $SDL_LIBS"
+-          AC_TRY_LINK([
+-#include <stdio.h>
+-#include "SDL.h"
+-
+-int main(int argc, char *argv[])
+-{ return 0; }
+-#undef  main
+-#define main K_and_R_C_main
+-],      [ return 0; ],
+-        [ echo "*** The test program compiled, but did not run. This usually means"
+-          echo "*** that the run-time linker is not finding SDL or finding the wrong"
+-          echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
+-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
+-          echo "*** is required on your system"
+-	  echo "***"
+-          echo "*** If you have an old version installed, it is best to remove it, although"
+-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+-        [ echo "*** The test program failed to compile or link. See the file config.log for the"
+-          echo "*** exact error that occured. This usually means SDL was incorrectly installed"
+-          echo "*** or that you have moved SDL since it was installed. In the latter case, you"
+-          echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
+-          CFLAGS="$ac_save_CFLAGS"
+-          CXXFLAGS="$ac_save_CXXFLAGS"
+-          LIBS="$ac_save_LIBS"
+-       fi
+-     fi
+-     SDL_CFLAGS=""
+-     SDL_LIBS=""
+-     ifelse([$3], , :, [$3])
+-  fi
++  PKG_CHECK_MODULES([SDL], [sdl >= $min_sdl_version])
+   AC_SUBST(SDL_CFLAGS)
+   AC_SUBST(SDL_LIBS)
+-  rm -f conf.sdltest
+ ])
diff --git a/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb b/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
new file mode 100644
index 0000000..266bd42
--- /dev/null
+++ b/meta/recipes-graphics/libsdl/libsdl_1.2.15.bb
@@ -0,0 +1,67 @@
+SUMMARY = "Simple DirectMedia Layer"
+DESCRIPTION = "Simple DirectMedia Layer is a cross-platform multimedia \
+library designed to provide low level access to audio, keyboard, mouse, \
+joystick, 3D hardware via OpenGL, and 2D video framebuffer."
+HOMEPAGE = "http://www.libsdl.org"
+BUGTRACKER = "http://bugzilla.libsdl.org/"
+
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=27818cd7fd83877a8e3ef82b82798ef4"
+
+PROVIDES = "virtual/libsdl"
+
+DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl libglu', '', d)} \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxext libxrandr libxrender', '', d)} \
+           tslib"
+DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
+
+PR = "r3"
+
+SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
+           file://configure_tweak.patch \
+           file://libsdl-1.2.15-xdata32.patch \
+           file://pkgconfig.patch \
+          "
+
+S = "${WORKDIR}/SDL-${PV}"
+
+SRC_URI[md5sum] = "9d96df8417572a2afb781a7c4c811a85"
+SRC_URI[sha256sum] = "d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00"
+
+BINCONFIG = "${bindir}/sdl-config"
+
+inherit autotools lib_package binconfig-disabled pkgconfig
+
+EXTRA_OECONF = "--disable-static --enable-cdrom --enable-threads --enable-timers \
+                --enable-file --disable-oss --disable-esd --disable-arts \
+                --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+                --disable-mintaudio --disable-nasm --disable-video-dga \
+                --disable-video-fbcon --disable-video-ps2gs --disable-video-ps3 \
+                --disable-xbios --disable-gem --disable-video-dummy \
+                --enable-input-events --enable-input-tslib --enable-pthreads \
+                ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', '--enable-video-directfb', '--disable-video-directfb', d)} \
+                ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '--enable-video-opengl', '--disable-video-opengl', d)} \
+                ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '--enable-video-x11', '--disable-video-x11', d)} \
+                --disable-video-svga \
+                --disable-video-picogui --disable-video-qtopia --enable-sdl-dlopen \
+                --disable-rpath \
+                --disable-pulseaudio"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)}"
+PACKAGECONFIG[alsa] = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib,"
+
+EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
+
+do_configure_prepend() {
+        # Remove old libtool macros.
+        MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
+        for i in ${MACROS}; do
+               rm -f ${S}/acinclude/$i
+        done
+        export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
+}
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.0.3.bb b/meta/recipes-graphics/libsdl2/libsdl2_2.0.3.bb
new file mode 100644
index 0000000..97f64f3
--- /dev/null
+++ b/meta/recipes-graphics/libsdl2/libsdl2_2.0.3.bb
@@ -0,0 +1,63 @@
+SUMMARY = "Simple DirectMedia Layer"
+DESCRIPTION = "Simple DirectMedia Layer is a cross-platform multimedia \
+library designed to provide low level access to audio, keyboard, mouse, \
+joystick, 3D hardware via OpenGL, and 2D video framebuffer."
+HOMEPAGE = "http://www.libsdl.org"
+BUGTRACKER = "http://bugzilla.libsdl.org/"
+
+SECTION = "libs"
+
+LICENSE = "Zlib"
+LIC_FILES_CHKSUM = "file://COPYING.txt;md5=67dcb7fae16952557bc5f96e9eb5d188"
+
+PROVIDES = "virtual/libsdl2"
+
+DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
+
+SRC_URI = "http://www.libsdl.org/release/SDL2-${PV}.tar.gz"
+
+S = "${WORKDIR}/SDL2-${PV}"
+
+SRC_URI[md5sum] = "fe6c61d2e9df9ef570e7e80c6e822537"
+SRC_URI[sha256sum] = "a5a69a6abf80bcce713fa873607735fe712f44276a7f048d60a61bb2f6b3c90c"
+
+inherit autotools lib_package binconfig pkgconfig
+
+EXTRA_OECONF = "--disable-oss --disable-esd --disable-arts \
+                --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
+                --disable-video-dummy \
+                --enable-pthreads \
+                --enable-sdl-dlopen \
+                --disable-rpath"
+
+# opengl packageconfig factored out to make it easy for distros
+# and BSP layers to pick either (desktop) opengl, gles2, or no GL
+PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'opengl', '', d)}"
+
+PACKAGECONFIG ??= " \
+    ${PACKAGECONFIG_GL} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+"
+PACKAGECONFIG[alsa]       = "--enable-alsa --disable-alsatest,--disable-alsa,alsa-lib,"
+PACKAGECONFIG[directfb]   = "--enable-video-directfb --disable-video-directfb,directfb"
+PACKAGECONFIG[gles2]      = "--enable-video-opengles,--disable-video-opengles,virtual/libgles2"
+PACKAGECONFIG[opengl]     = "--enable-video-opengl,--disable-video-opengl,virtual/libgl"
+PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
+PACKAGECONFIG[tslib]      = "--enable-input-tslib,--disable-input-tslib,tslib"
+PACKAGECONFIG[wayland]    = "--enable-video-wayland,--disable-video-wayland,wayland"
+PACKAGECONFIG[x11]        = "--enable-video-x11,--disable-video-x11,virtual/libx11 libxext libxrandr libxrender"
+
+EXTRA_AUTORECONF += "--include=acinclude --exclude=autoheader"
+
+do_configure_prepend() {
+        # Remove old libtool macros.
+        MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
+        for i in ${MACROS}; do
+               rm -f ${S}/acinclude/$i
+        done
+        export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
+}
diff --git a/meta/recipes-graphics/libxsettings-client/libxsettings-client/MIT-style-license b/meta/recipes-graphics/libxsettings-client/libxsettings-client/MIT-style-license
new file mode 100644
index 0000000..628de98
--- /dev/null
+++ b/meta/recipes-graphics/libxsettings-client/libxsettings-client/MIT-style-license
@@ -0,0 +1,22 @@
+/*
+ * Copyright © 2001 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  Red Hat makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author:  Owen Taylor, Red Hat, Inc.
+ */
diff --git a/meta/recipes-graphics/libxsettings-client/libxsettings-client/disable_Os_option.patch b/meta/recipes-graphics/libxsettings-client/libxsettings-client/disable_Os_option.patch
new file mode 100644
index 0000000..64b7efa
--- /dev/null
+++ b/meta/recipes-graphics/libxsettings-client/libxsettings-client/disable_Os_option.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [configuration]
+
+Do not set Os optimization in target APP CFLAGS, since it may have potential
+error if "--enable-target-optspace" is not set when configuring GCC.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -ruN Xsettings-client-0.10-orig/configure.ac Xsettings-client-0.10/configure.ac
+--- Xsettings-client-0.10-orig/configure.ac	2010-09-21 14:01:47.000000000 +0800
++++ Xsettings-client-0.10/configure.ac	2010-09-21 14:02:01.000000000 +0800
+@@ -3,7 +3,7 @@
+ AM_INIT_AUTOMAKE(Xsettings-client, 0.10)
+ AM_CONFIG_HEADER(config.h)
+ 
+-CFLAGS="-Os -Wall"
++CFLAGS="-O2 -Wall"
+ 
+ # Checks for programs.
+ AC_PROG_CC
diff --git a/meta/recipes-graphics/libxsettings-client/libxsettings-client/link-x11.patch b/meta/recipes-graphics/libxsettings-client/libxsettings-client/link-x11.patch
new file mode 100644
index 0000000..d08d0d5
--- /dev/null
+++ b/meta/recipes-graphics/libxsettings-client/libxsettings-client/link-x11.patch
@@ -0,0 +1,13 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: Xsettings-client-0.10/Makefile.am
+===================================================================
+--- Xsettings-client-0.10.orig/Makefile.am	2008-02-07 14:49:54.000000000 +0000
++++ Xsettings-client-0.10/Makefile.am	2008-02-07 14:50:00.000000000 +0000
+@@ -9,4 +9,4 @@
+ 
+ libXsettings_client_la_SOURCES= $(source_c) $(source_h)
+ 
+-libXsettings_client_la_LIBADD      = @X_LIBS@
+\ No newline at end of file
++libXsettings_client_la_LIBADD      = @X_LIBS@ -lX11
diff --git a/meta/recipes-graphics/libxsettings-client/libxsettings-client/obsolete_automake_macros.patch b/meta/recipes-graphics/libxsettings-client/libxsettings-client/obsolete_automake_macros.patch
new file mode 100644
index 0000000..905d08e
--- /dev/null
+++ b/meta/recipes-graphics/libxsettings-client/libxsettings-client/obsolete_automake_macros.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Pending
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd Xsettings-client-0.10/configure.ac Xsettings-client-0.10/configure.ac
+--- Xsettings-client-0.10/configure.ac	2003-03-28 12:39:51.000000000 +0200
++++ Xsettings-client-0.10/configure.ac	2013-01-11 07:37:21.491597743 +0200
+@@ -1,7 +1,7 @@
+ # Process this file with autoconf to produce a configure script.
+ AC_INIT(xsettings-client.c)
+ AM_INIT_AUTOMAKE(Xsettings-client, 0.10)
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+
+ CFLAGS="-Os -Wall"
diff --git a/meta/recipes-graphics/libxsettings-client/libxsettings-client_0.10.bb b/meta/recipes-graphics/libxsettings-client/libxsettings-client_0.10.bb
new file mode 100644
index 0000000..670d9fc
--- /dev/null
+++ b/meta/recipes-graphics/libxsettings-client/libxsettings-client_0.10.bb
@@ -0,0 +1,41 @@
+SUMMARY = "utility functions for the Xsettings protocol"
+DESCRIPTION = "Libraries used for applications making use of the Xsettings configuration \
+setting propagation protocol. Controls setting of double click timeout, drag-and-drop \
+threshold, and default foreground and background colors for all applications running within a \
+desktop."
+HOMEPAGE = "http://matchbox-project.org/sources/optional-dependencies/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+SECTION = "x/libs"
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7cfac9d2d4dc3694cc7eb605cf32a69b \
+                    file://xsettings-client.h;endline=22;md5=7cfac9d2d4dc3694cc7eb605cf32a69b \
+                    file://xsettings-common.h;endline=22;md5=7cfac9d2d4dc3694cc7eb605cf32a69b"
+DEPENDS = "virtual/libx11"
+
+PR = "r5"
+
+headers = "xsettings-common.h xsettings-client.h"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/matchbox/optional-dependencies/Xsettings-client-0.10.tar.gz \
+        file://MIT-style-license \
+        file://link-x11.patch;apply=yes \
+        file://disable_Os_option.patch \
+        file://obsolete_automake_macros.patch \
+"
+
+SRC_URI[md5sum] = "c14aa9db6c097e0306dac97fb7da1add"
+SRC_URI[sha256sum] = "f274a4bc969ae192994a856b7f786c6fce96bae77f96c1c2b71dd97599e06e43"
+
+S = "${WORKDIR}/Xsettings-client-0.10"
+
+inherit autotools gettext distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+do_configure_prepend() {
+    # This package doesn't ship with its own COPYING file and
+    # autotools will install a GPLv2 one instead of the actual MIT-style license here.
+    # Add the correct license here to avoid confusion.
+    cp -f ${WORKDIR}/MIT-style-license ${S}/COPYING
+}
+
diff --git a/meta/recipes-graphics/matchbox-session/matchbox-session/matchbox-session b/meta/recipes-graphics/matchbox-session/matchbox-session/matchbox-session
new file mode 100644
index 0000000..4d6caa0
--- /dev/null
+++ b/meta/recipes-graphics/matchbox-session/matchbox-session/matchbox-session
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# Very simple session manager for matchbox tools
+#
+
+# Uncomment below to enable parsing of debian menu entrys
+# export MB_USE_DEB_MENUS=1 
+
+if [ -e $HOME/.matchbox/session ]
+then
+exec $HOME/.matchbox/session
+fi
+
+if [ -e /etc/matchbox/session ]
+then
+exec /etc/matchbox/session
+fi
+
+# Default files to run if $HOME/.matchbox/session or /etc/matchbox/session
+# dont exist. 
+
+matchbox-desktop &
+matchbox-panel &
+exec matchbox-window-manager $@
diff --git a/meta/recipes-graphics/matchbox-session/matchbox-session_0.1.bb b/meta/recipes-graphics/matchbox-session/matchbox-session_0.1.bb
new file mode 100644
index 0000000..cbaf054
--- /dev/null
+++ b/meta/recipes-graphics/matchbox-session/matchbox-session_0.1.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Custom Matchbox session files"
+HOMEPAGE = "http://www.matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://matchbox-session;endline=20;md5=180f1c169a15d059a56c30094f6fb5ea"
+
+SECTION = "x11"
+RCONFLICTS_${PN} = "matchbox-common"
+
+SRC_URI = "file://matchbox-session"
+S = "${WORKDIR}"
+
+PR = "r4"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "x-session-manager"
+ALTERNATIVE_TARGET[x-session-manager] = "${bindir}/matchbox-session"
+ALTERNATIVE_PRIORITY = "100"
+
+do_install() {
+	install -d ${D}/${bindir}
+	install -m 0755 ${S}/matchbox-session ${D}/${bindir}
+}
diff --git a/meta/recipes-graphics/matchbox-wm/matchbox-wm/kbdconfig b/meta/recipes-graphics/matchbox-wm/matchbox-wm/kbdconfig
new file mode 100644
index 0000000..239da8f
--- /dev/null
+++ b/meta/recipes-graphics/matchbox-wm/matchbox-wm/kbdconfig
@@ -0,0 +1,42 @@
+#
+# This is an example keyboard config file for matchbox
+#
+# You can edit this file or change per user by copying to 
+#  ~/.matchbox/kbdconfig
+#
+# Se the matchbox manual for more info ( http://projects.o-hand.com/matchbox )
+
+### Window operation short cuts 
+
+<Alt>n=next
+<Alt>p=prev
+<Alt>c=close
+<Alt>d=desktop
+<Alt>m=!matchbox-remote -mbmenu
+
+### App launching.
+
+<ctrl><alt>x=!xterm
+<ctrl><alt>r=!rxvt
+
+### poky additions
+
+XF86Calendar=!$contacts
+telephone=!$dates
+XF86Start=!matchbox-remote -desktop
+F2=!matchbox-remote -mbmenu
+
+#XF86Mail=!$tasks
+#Escape=close
+
+### windows style key shortcuts
+
+<alt>Tab=next
+<alt><shift>Tab=prev
+
+<alt>space=taskmenu
+<alt>escape=!matchbox-remote -mbmenu
+<alt>f4=close
+
+f11=fullscreen
+
diff --git a/meta/recipes-graphics/matchbox-wm/matchbox-wm_git.bb b/meta/recipes-graphics/matchbox-wm/matchbox-wm_git.bb
new file mode 100644
index 0000000..422d255
--- /dev/null
+++ b/meta/recipes-graphics/matchbox-wm/matchbox-wm_git.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Matchbox lightweight window manager"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://src/wm.h;endline=21;md5=a7e844465edbcf79c282369f93caa835 \
+                    file://src/main.c;endline=21;md5=3e5d9f832b527b0d72dbe8e3c4c60b95 \
+                    file://src/wm.c;endline=21;md5=8dc9d24477d87ef5dfbc2e4927146aab"
+
+SECTION = "x11/wm"
+DEPENDS = "libmatchbox virtual/libx11 libxext libxrender startup-notification expat gconf libxcursor libxfixes"
+
+SRCREV = "29544f0e61cc281fc60061443a537271e1081b78"
+PV = "1.2+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/matchbox-window-manager \
+           file://kbdconfig"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+FILES_${PN} = "${bindir}/* \
+               ${datadir}/matchbox \
+               ${sysconfdir}/matchbox \
+               ${datadir}/themes/blondie/matchbox \
+               ${datadir}/themes/Default/matchbox \
+               ${datadir}/themes/MBOpus/matchbox"
+
+EXTRA_OECONF = " --enable-startup-notification \
+                 --disable-xrm \
+                 --enable-expat \
+                 --with-expat-lib=${STAGING_LIBDIR} \
+                 --with-expat-includes=${STAGING_INCDIR}"
+
+do_install_prepend() {
+	install ${WORKDIR}/kbdconfig ${S}/data/kbdconfig
+}
diff --git a/meta/recipes-graphics/menu-cache/menu-cache_1.0.0.bb b/meta/recipes-graphics/menu-cache/menu-cache_1.0.0.bb
new file mode 100644
index 0000000..ab909f7
--- /dev/null
+++ b/meta/recipes-graphics/menu-cache/menu-cache_1.0.0.bb
@@ -0,0 +1,16 @@
+SUMMARY = "Library for caching application menus"
+DESCRIPTION = "A library creating and utilizing caches to speed up freedesktop.org application menus"
+HOMEPAGE = "http://lxde.sourceforge.net/"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0964c689fcf4c21c6797ea87408416b6"
+
+SECTION = "x11/libs"
+DEPENDS = "glib-2.0 intltool-native libfm-extra"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lxde/menu-cache-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "4a8e6c1a86d5e64ec725d850a4abfbad"
+SRC_URI[sha256sum] = "ff7df437bbfd3119c5f662c6d209b98f15de03a7203308c6b56a4c1e1d419aaf"
+
+inherit autotools gettext pkgconfig gtk-doc
diff --git a/meta/recipes-graphics/mesa/libglu_9.0.0.bb b/meta/recipes-graphics/mesa/libglu_9.0.0.bb
new file mode 100644
index 0000000..010998d
--- /dev/null
+++ b/meta/recipes-graphics/mesa/libglu_9.0.0.bb
@@ -0,0 +1,30 @@
+SUMMARY = "The OpenGL utility toolkit"
+DESCRIPTION = "GLU is a utility toolkit used with OpenGL implementations"
+
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://include/GL/glu.h;endline=29;md5=6b79c570f644363b356456e7d44471d9 \
+                    file://src/libtess/tess.c;endline=29;md5=6b79c570f644363b356456e7d44471d9"
+
+# Epoch as this used to be part of mesa
+PE = "2"
+PR = "0"
+
+SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/glu/glu-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "be9249132ff49275461cf92039083030"
+SRC_URI[sha256sum] = "1f7ad0d379a722fcbd303aa5650c6d7d5544fde83196b42a73d1193568a4df12"
+
+S = "${WORKDIR}/glu-${PV}"
+
+DEPENDS = "virtual/libgl"
+
+inherit autotools pkgconfig distro_features_check
+
+# Requires libGL.so which is provided by mesa when x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+# Remove the mesa-glu dependency in mesa-glu-dev, as mesa-glu is empty
+RDEPENDS_${PN}-dev = ""
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch b/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
new file mode 100644
index 0000000..93ee9c2
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0001-mesa-demos-Add-missing-data-files.patch
@@ -0,0 +1,624 @@
+From b695c3a3fa3f4cd48c13aa26542110de27075518 Mon Sep 17 00:00:00 2001
+From: Drew Moseley <drew_moseley@mentor.com>
+Date: Mon, 12 May 2014 15:22:32 -0400
+Subject: [PATCH 1/9] mesa-demos: Add missing data files.
+
+Add some data files that are present in the git repository:
+   http://cgit.freedesktop.org/mesa/demos/tree/?id=mesa-demos-8.1.0
+but not in the release tarball
+   ftp://ftp.freedesktop.org/pub/mesa/demos/8.1.0/mesa-demos-8.1.0.tar.bz2
+
+Upstream-Status: Backport
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/fpglsl/depth-read.glsl      |   4 +
+ src/fpglsl/infinite-loop.glsl   |   7 +
+ src/glsl/CH11-bumpmaptex.frag   |  47 +++++++
+ src/glsl/blinking-teapot.frag   |  31 +++++
+ src/glsl/blinking-teapot.vert   |  16 +++
+ src/glsl/convolution.frag       |  21 +++
+ src/glsl/simplex-noise.glsl     | 279 ++++++++++++++++++++++++++++++++++++++++
+ src/glsl/skinning.vert          |  24 ++++
+ src/perf/glslstateschange1.frag |  19 +++
+ src/perf/glslstateschange1.vert |  14 ++
+ src/perf/glslstateschange2.frag |  17 +++
+ src/perf/glslstateschange2.vert |  14 ++
+ src/vpglsl/infinite-loop.glsl   |   8 ++
+ 13 files changed, 501 insertions(+)
+ create mode 100644 src/fpglsl/depth-read.glsl
+ create mode 100644 src/fpglsl/infinite-loop.glsl
+ create mode 100644 src/glsl/CH11-bumpmaptex.frag
+ create mode 100644 src/glsl/blinking-teapot.frag
+ create mode 100644 src/glsl/blinking-teapot.vert
+ create mode 100644 src/glsl/convolution.frag
+ create mode 100644 src/glsl/simplex-noise.glsl
+ create mode 100644 src/glsl/skinning.vert
+ create mode 100644 src/perf/glslstateschange1.frag
+ create mode 100644 src/perf/glslstateschange1.vert
+ create mode 100644 src/perf/glslstateschange2.frag
+ create mode 100644 src/perf/glslstateschange2.vert
+ create mode 100644 src/vpglsl/infinite-loop.glsl
+
+diff --git a/src/fpglsl/depth-read.glsl b/src/fpglsl/depth-read.glsl
+new file mode 100644
+index 0000000..86d298e
+--- /dev/null
++++ b/src/fpglsl/depth-read.glsl
+@@ -0,0 +1,4 @@
++void main()
++{
++   gl_FragColor = gl_FragCoord.zzzz;
++}
+diff --git a/src/fpglsl/infinite-loop.glsl b/src/fpglsl/infinite-loop.glsl
+new file mode 100644
+index 0000000..c6dc6ee
+--- /dev/null
++++ b/src/fpglsl/infinite-loop.glsl
+@@ -0,0 +1,7 @@
++void main() {
++   vec4 sum = vec4(0);
++   for (int i = 1; i != 2; i += 2) {
++      sum += vec4(0.1, 0.1, 0.1, 0.1);
++   }
++   gl_FragColor = sum;
++}
+diff --git a/src/glsl/CH11-bumpmaptex.frag b/src/glsl/CH11-bumpmaptex.frag
+new file mode 100644
+index 0000000..b5dabb4
+--- /dev/null
++++ b/src/glsl/CH11-bumpmaptex.frag
+@@ -0,0 +1,47 @@
++//
++// Fragment shader for procedural bumps
++//
++// Authors: John Kessenich, Randi Rost
++//
++// Copyright (c) 2002-2006 3Dlabs Inc. Ltd. 
++//
++// See 3Dlabs-License.txt for license information
++//
++// Texture mapping/modulation added by Brian Paul
++//
++
++varying vec3 LightDir;
++varying vec3 EyeDir;
++
++uniform float BumpDensity;     // = 16.0
++uniform float BumpSize;        // = 0.15
++uniform float SpecularFactor;  // = 0.5
++
++uniform sampler2D Tex;
++
++void main()
++{
++    vec3 ambient = vec3(0.25);
++    vec3 litColor;
++    vec2 c = BumpDensity * gl_TexCoord[0].st;
++    vec2 p = fract(c) - vec2(0.5);
++
++    float d, f;
++    d = p.x * p.x + p.y * p.y;
++    f = inversesqrt(d + 1.0);
++
++    if (d >= BumpSize)
++        { p = vec2(0.0); f = 1.0; }
++
++    vec3 SurfaceColor = texture2D(Tex, gl_TexCoord[0].st).xyz;
++
++    vec3 normDelta = vec3(p.x, p.y, 1.0) * f;
++    litColor = SurfaceColor * (ambient + max(dot(normDelta, LightDir), 0.0));
++    vec3 reflectDir = reflect(LightDir, normDelta);
++    
++    float spec = max(dot(EyeDir, reflectDir), 0.0);
++    spec *= SpecularFactor;
++    litColor = min(litColor + spec, vec3(1.0));
++
++    gl_FragColor = vec4(litColor, 1.0);
++}
+diff --git a/src/glsl/blinking-teapot.frag b/src/glsl/blinking-teapot.frag
+new file mode 100644
+index 0000000..0db060b
+--- /dev/null
++++ b/src/glsl/blinking-teapot.frag
+@@ -0,0 +1,31 @@
++#extension GL_ARB_uniform_buffer_object : enable
++
++layout(std140) uniform colors0
++{
++    float DiffuseCool;
++    float DiffuseWarm;
++    vec3  SurfaceColor;
++    vec3  WarmColor;
++    vec3  CoolColor;
++    vec4  some[8];
++};
++
++varying float NdotL;
++varying vec3  ReflectVec;
++varying vec3  ViewVec;
++
++void main (void)
++{
++
++    vec3 kcool    = min(CoolColor + DiffuseCool * SurfaceColor, 1.0);
++    vec3 kwarm    = min(WarmColor + DiffuseWarm * SurfaceColor, 1.0);
++    vec3 kfinal   = mix(kcool, kwarm, NdotL);
++
++    vec3 nreflect = normalize(ReflectVec);
++    vec3 nview    = normalize(ViewVec);
++
++    float spec    = max(dot(nreflect, nview), 0.0);
++    spec          = pow(spec, 32.0);
++
++    gl_FragColor = vec4 (min(kfinal + spec, 1.0), 1.0);
++}
+diff --git a/src/glsl/blinking-teapot.vert b/src/glsl/blinking-teapot.vert
+new file mode 100644
+index 0000000..397d733
+--- /dev/null
++++ b/src/glsl/blinking-teapot.vert
+@@ -0,0 +1,16 @@
++vec3 LightPosition = vec3(0.0, 10.0, 4.0); 
++ 
++varying float NdotL;
++varying vec3  ReflectVec;
++varying vec3  ViewVec;
++ 
++void main(void)
++{
++    vec3 ecPos      = vec3 (gl_ModelViewMatrix * gl_Vertex);
++    vec3 tnorm      = normalize(gl_NormalMatrix * gl_Normal);
++    vec3 lightVec   = normalize(LightPosition - ecPos);
++    ReflectVec      = normalize(reflect(-lightVec, tnorm));
++    ViewVec         = normalize(-ecPos);
++    NdotL           = (dot(lightVec, tnorm) + 1.0) * 0.5;
++    gl_Position     = ftransform();
++}
+diff --git a/src/glsl/convolution.frag b/src/glsl/convolution.frag
+new file mode 100644
+index 0000000..e49b8ac
+--- /dev/null
++++ b/src/glsl/convolution.frag
+@@ -0,0 +1,21 @@
++
++const int KernelSize = 9;
++
++//texture offsets
++uniform vec2 Offset[KernelSize];
++//convolution kernel
++uniform vec4 KernelValue[KernelSize];
++uniform sampler2D srcTex;
++uniform vec4 ScaleFactor;
++uniform vec4 BaseColor;
++
++void main(void)
++{
++    int i;
++    vec4 sum = vec4(0.0);
++    for (i = 0; i < KernelSize; ++i) {
++        vec4 tmp = texture2D(srcTex, gl_TexCoord[0].st + Offset[i]);
++        sum += tmp * KernelValue[i];
++    }
++    gl_FragColor = sum * ScaleFactor + BaseColor;
++}
+diff --git a/src/glsl/simplex-noise.glsl b/src/glsl/simplex-noise.glsl
+new file mode 100644
+index 0000000..b6833cb
+--- /dev/null
++++ b/src/glsl/simplex-noise.glsl
+@@ -0,0 +1,279 @@
++//
++// Description : Array and textureless GLSL 2D/3D/4D simplex
++// noise functions.
++// Author : Ian McEwan, Ashima Arts.
++// Maintainer : ijm
++// Lastmod : 20110223
++// License : Copyright (C) 2011 Ashima Arts. All rights reserved.
++// Distributed under the Artistic License 2.0; See LICENCE file.
++//
++
++#define NORMALIZE_GRADIENTS
++#undef USE_CIRCLE
++#define COLLAPSE_SORTNET
++
++float permute(float x0,vec3 p) {
++  float x1 = mod(x0 * p.y, p.x);
++  return floor( mod( (x1 + p.z) *x0, p.x ));
++  }
++vec2 permute(vec2 x0,vec3 p) {
++  vec2 x1 = mod(x0 * p.y, p.x);
++  return floor( mod( (x1 + p.z) *x0, p.x ));
++  }
++vec3 permute(vec3 x0,vec3 p) {
++  vec3 x1 = mod(x0 * p.y, p.x);
++  return floor( mod( (x1 + p.z) *x0, p.x ));
++  }
++vec4 permute(vec4 x0,vec3 p) {
++  vec4 x1 = mod(x0 * p.y, p.x);
++  return floor( mod( (x1 + p.z) *x0, p.x ));
++  }
++
++uniform vec4 pParam;
++// Example
++// const vec4 pParam = vec4( 17.* 17., 34., 1., 7.);
++
++float taylorInvSqrt(float r)
++  {
++  return ( 0.83666002653408 + 0.7*0.85373472095314 - 0.85373472095314 * r );
++  }
++
++float simplexNoise2(vec2 v)
++  {
++  const vec2 C = vec2(0.211324865405187134, // (3.0-sqrt(3.0))/6.;
++                      0.366025403784438597); // 0.5*(sqrt(3.0)-1.);
++  const vec3 D = vec3( 0., 0.5, 2.0) * 3.14159265358979312;
++// First corner
++  vec2 i = floor(v + dot(v, C.yy) );
++  vec2 x0 = v - i + dot(i, C.xx);
++
++// Other corners
++  vec2 i1 = (x0.x > x0.y) ? vec2(1.,0.) : vec2(0.,1.) ;
++
++   // x0 = x0 - 0. + 0. * C
++  vec2 x1 = x0 - i1 + 1. * C.xx ;
++  vec2 x2 = x0 - 1. + 2. * C.xx ;
++
++// Permutations
++  i = mod(i, pParam.x);
++  vec3 p = permute( permute(
++             i.y + vec3(0., i1.y, 1. ), pParam.xyz)
++           + i.x + vec3(0., i1.x, 1. ), pParam.xyz);
++
++#ifndef USE_CIRCLE
++// ( N points uniformly over a line, mapped onto a diamond.)
++  vec3 x = fract(p / pParam.w) ;
++  vec3 h = 0.5 - abs(x) ;
++
++  vec3 sx = vec3(lessThan(x,D.xxx)) *2. -1.;
++  vec3 sh = vec3(lessThan(h,D.xxx));
++
++  vec3 a0 = x + sx*sh;
++  vec2 p0 = vec2(a0.x,h.x);
++  vec2 p1 = vec2(a0.y,h.y);
++  vec2 p2 = vec2(a0.z,h.z);
++
++#ifdef NORMALISE_GRADIENTS
++  p0 *= taylorInvSqrt(dot(p0,p0));
++  p1 *= taylorInvSqrt(dot(p1,p1));
++  p2 *= taylorInvSqrt(dot(p2,p2));
++#endif
++
++  vec3 g = 2.0 * vec3( dot(p0, x0), dot(p1, x1), dot(p2, x2) );
++#else
++// N points around a unit circle.
++  vec3 phi = D.z * mod(p,pParam.w) /pParam.w ;
++  vec4 a0 = sin(phi.xxyy+D.xyxy);
++  vec2 a1 = sin(phi.zz +D.xy);
++  vec3 g = vec3( dot(a0.xy, x0), dot(a0.zw, x1), dot(a1.xy, x2) );
++#endif
++// mix
++  vec3 m = max(0.5 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.);
++  m = m*m ;
++  return 1.66666* 70.*dot(m*m, g);
++  }
++
++float simplexNoise3(vec3 v)
++  {
++  const vec2 C = vec2(1./6. , 1./3. ) ;
++  const vec4 D = vec4(0., 0.5, 1.0, 2.0);
++
++// First corner
++  vec3 i = floor(v + dot(v, C.yyy) );
++  vec3 x0 = v - i + dot(i, C.xxx) ;
++  
++// Other corners
++#ifdef COLLAPSE_SORTNET
++  vec3 g = vec3( greaterThan( x0.xyz, x0.yzx) );
++  vec3 l = vec3( lessThanEqual( x0.xyz, x0.yzx) );
++
++  vec3 i1 = g.xyz * l.zxy;
++  vec3 i2 = max( g.xyz, l.zxy);
++#else
++// Keeping this clean - let the compiler optimize.
++  vec3 q1;
++  q1.x = max(x0.x, x0.y);
++  q1.y = min(x0.x, x0.y);
++  q1.z = x0.z;
++
++  vec3 q2;
++  q2.x = max(q1.x,q1.z);
++  q2.z = min(q1.x,q1.z);
++  q2.y = q1.y;
++
++  vec3 q3;
++  q3.y = max(q2.y, q2.z);
++  q3.z = min(q2.y, q2.z);
++  q3.x = q2.x;
++
++  vec3 i1 = vec3(equal(q3.xxx, x0));
++  vec3 i2 = i1 + vec3(equal(q3.yyy, x0));
++#endif
++
++   // x0 = x0 - 0. + 0. * C
++  vec3 x1 = x0 - i1 + 1. * C.xxx;
++  vec3 x2 = x0 - i2 + 2. * C.xxx;
++  vec3 x3 = x0 - 1. + 3. * C.xxx;
++
++// Permutations
++  i = mod(i, pParam.x );
++  vec4 p = permute( permute( permute(
++             i.z + vec4(0., i1.z, i2.z, 1. ), pParam.xyz)
++           + i.y + vec4(0., i1.y, i2.y, 1. ), pParam.xyz)
++           + i.x + vec4(0., i1.x, i2.x, 1. ), pParam.xyz);
++
++// Gradients
++// ( N*N points uniformly over a square, mapped onto a octohedron.)
++  float n_ = 1.0/pParam.w ;
++  vec3 ns = n_ * D.wyz - D.xzx ;
++
++  vec4 j = p - pParam.w*pParam.w*floor(p * ns.z *ns.z); // mod(p,N*N)
++
++  vec4 x_ = floor(j * ns.z) ;
++  vec4 y_ = floor(j - pParam.w * x_ ) ; // mod(j,N)
++
++  vec4 x = x_ *ns.x + ns.yyyy;
++  vec4 y = y_ *ns.x + ns.yyyy;
++  vec4 h = 1. - abs(x) - abs(y);
++
++  vec4 b0 = vec4( x.xy, y.xy );
++  vec4 b1 = vec4( x.zw, y.zw );
++
++  vec4 s0 = vec4(lessThan(b0,D.xxxx)) *2. -1.;
++  vec4 s1 = vec4(lessThan(b1,D.xxxx)) *2. -1.;
++  vec4 sh = vec4(lessThan(h, D.xxxx));
++
++  vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;
++  vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;
++
++  vec3 p0 = vec3(a0.xy,h.x);
++  vec3 p1 = vec3(a0.zw,h.y);
++  vec3 p2 = vec3(a1.xy,h.z);
++  vec3 p3 = vec3(a1.zw,h.w);
++
++#ifdef NORMALISE_GRADIENTS
++  p0 *= taylorInvSqrt(dot(p0,p0));
++  p1 *= taylorInvSqrt(dot(p1,p1));
++  p2 *= taylorInvSqrt(dot(p2,p2));
++  p3 *= taylorInvSqrt(dot(p3,p3));
++#endif
++
++// Mix
++  vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.);
++  m = m * m;
++//used to be 64.
++  return 48.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),
++                                dot(p2,x2), dot(p3,x3) ) );
++  }
++
++vec4 grad4(float j, vec4 ip)
++  {
++  const vec4 ones = vec4(1.,1.,1.,-1.);
++  vec4 p,s;
++
++  p.xyz = floor( fract (vec3(j) * ip.xyz) *pParam.w) * ip.z -1.0;
++  p.w = 1.5 - dot(abs(p.xyz), ones.xyz);
++  s = vec4(lessThan(p,vec4(0.)));
++  p.xyz = p.xyz + (s.xyz*2.-1.) * s.www;
++
++  return p;
++  }
++
++float simplexNoise4(vec4 v)
++  {
++  const vec2 C = vec2( 0.138196601125010504, // (5 - sqrt(5))/20 G4
++                        0.309016994374947451); // (sqrt(5) - 1)/4 F4
++// First corner
++  vec4 i = floor(v + dot(v, C.yyyy) );
++  vec4 x0 = v - i + dot(i, C.xxxx);
++
++// Other corners
++
++// Force existance of strict total ordering in sort.
++  vec4 q0 = floor(x0 * 1024.0) + vec4( 0., 1./4., 2./4. , 3./4.);
++  vec4 q1;
++  q1.xy = max(q0.xy,q0.zw); // x:z y:w
++  q1.zw = min(q0.xy,q0.zw);
++
++  vec4 q2;
++  q2.xz = max(q1.xz,q1.yw); // x:y z:w
++  q2.yw = min(q1.xz,q1.yw);
++  
++  vec4 q3;
++  q3.y = max(q2.y,q2.z); // y:z
++  q3.z = min(q2.y,q2.z);
++  q3.xw = q2.xw;
++
++  vec4 i1 = vec4(lessThanEqual(q3.xxxx, q0));
++  vec4 i2 = vec4(lessThanEqual(q3.yyyy, q0));
++  vec4 i3 = vec4(lessThanEqual(q3.zzzz, q0));
++
++   // x0 = x0 - 0. + 0. * C
++  vec4 x1 = x0 - i1 + 1. * C.xxxx;
++  vec4 x2 = x0 - i2 + 2. * C.xxxx;
++  vec4 x3 = x0 - i3 + 3. * C.xxxx;
++  vec4 x4 = x0 - 1. + 4. * C.xxxx;
++
++// Permutations
++  i = mod(i, pParam.x );
++  float j0 = permute( permute( permute( permute (
++              i.w, pParam.xyz) + i.z, pParam.xyz)
++            + i.y, pParam.xyz) + i.x, pParam.xyz);
++  vec4 j1 = permute( permute( permute( permute (
++             i.w + vec4(i1.w, i2.w, i3.w, 1. ), pParam.xyz)
++           + i.z + vec4(i1.z, i2.z, i3.z, 1. ), pParam.xyz)
++           + i.y + vec4(i1.y, i2.y, i3.y, 1. ), pParam.xyz)
++           + i.x + vec4(i1.x, i2.x, i3.x, 1. ), pParam.xyz);
++// Gradients
++// ( N*N*N points uniformly over a cube, mapped onto a 4-octohedron.)
++  vec4 ip = pParam ;
++  ip.xy *= pParam.w ;
++  ip.x *= pParam.w ;
++  ip = vec4(1.,1.,1.,2.) / ip ;
++
++  vec4 p0 = grad4(j0, ip);
++  vec4 p1 = grad4(j1.x, ip);
++  vec4 p2 = grad4(j1.y, ip);
++  vec4 p3 = grad4(j1.z, ip);
++  vec4 p4 = grad4(j1.w, ip);
++
++#ifdef NORMALISE_GRADIENTS
++  p0 *= taylorInvSqrt(dot(p0,p0));
++  p1 *= taylorInvSqrt(dot(p1,p1));
++  p2 *= taylorInvSqrt(dot(p2,p2));
++  p3 *= taylorInvSqrt(dot(p3,p3));
++  p4 *= taylorInvSqrt(dot(p4,p4));
++#endif
++
++// Mix
++  vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.);
++  vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.);
++  m0 = m0 * m0;
++  m1 = m1 * m1;
++  return 32. * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
++               + dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
++
++  }
++
++
++
+diff --git a/src/glsl/skinning.vert b/src/glsl/skinning.vert
+new file mode 100644
+index 0000000..28970ee
+--- /dev/null
++++ b/src/glsl/skinning.vert
+@@ -0,0 +1,24 @@
++// Vertex weighting/blendin shader
++// Brian Paul
++// 4 Nov 2008
++
++uniform mat4 mat0, mat1;
++attribute float weight;
++
++void main() 
++{
++   // simple diffuse shading
++   // Note that we should really transform the normal vector along with
++   // the postion below... someday.
++   vec3 lightVec = vec3(0, 0, 1);
++   vec3 norm = gl_NormalMatrix * gl_Normal;
++   float dot = 0.2 + max(0.0, dot(norm, lightVec));
++   gl_FrontColor = vec4(dot);
++
++   // compute sum of weighted transformations
++   vec4 pos0 = mat0 * gl_Vertex;
++   vec4 pos1 = mat1 * gl_Vertex;
++   vec4 pos = mix(pos0, pos1, weight);
++
++   gl_Position = gl_ModelViewProjectionMatrix * pos;
++}
+diff --git a/src/perf/glslstateschange1.frag b/src/perf/glslstateschange1.frag
+new file mode 100644
+index 0000000..0839436
+--- /dev/null
++++ b/src/perf/glslstateschange1.frag
+@@ -0,0 +1,19 @@
++// Multi-texture fragment shader
++// Brian Paul
++
++// Composite second texture over first.
++// We're assuming the 2nd texture has a meaningful alpha channel.
++
++uniform sampler2D tex1;
++uniform sampler2D tex2;
++uniform vec4 UniV1;
++uniform vec4 UniV2;
++
++void main()
++{
++   vec4 t3;
++   vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
++   vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
++   t3 = mix(t1, t2, t2.w);
++   gl_FragColor = t3 + UniV1 + UniV2;
++}
+diff --git a/src/perf/glslstateschange1.vert b/src/perf/glslstateschange1.vert
+new file mode 100644
+index 0000000..cef50db
+--- /dev/null
++++ b/src/perf/glslstateschange1.vert
+@@ -0,0 +1,14 @@
++// Multi-texture vertex shader
++// Brian Paul
++
++
++attribute vec4 TexCoord0, TexCoord1;
++attribute vec4 VertCoord;
++
++void main()
++{
++   gl_TexCoord[0] = TexCoord0;
++   gl_TexCoord[1] = TexCoord1;
++   // note: may use gl_Vertex or VertCoord here for testing:
++   gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
++}
+diff --git a/src/perf/glslstateschange2.frag b/src/perf/glslstateschange2.frag
+new file mode 100644
+index 0000000..0df0319
+--- /dev/null
++++ b/src/perf/glslstateschange2.frag
+@@ -0,0 +1,17 @@
++// Multi-texture fragment shader
++// Brian Paul
++
++// Composite second texture over first.
++// We're assuming the 2nd texture has a meaningful alpha channel.
++
++uniform sampler2D tex1;
++uniform sampler2D tex2;
++uniform vec4 UniV1;
++uniform vec4 UniV2;
++
++void main()
++{
++   vec4 t1 = texture2D(tex1, gl_TexCoord[0].xy);
++   vec4 t2 = texture2D(tex2, gl_TexCoord[1].xy);
++   gl_FragColor = t1 + t2 + UniV1 + UniV2;
++}
+diff --git a/src/perf/glslstateschange2.vert b/src/perf/glslstateschange2.vert
+new file mode 100644
+index 0000000..cef50db
+--- /dev/null
++++ b/src/perf/glslstateschange2.vert
+@@ -0,0 +1,14 @@
++// Multi-texture vertex shader
++// Brian Paul
++
++
++attribute vec4 TexCoord0, TexCoord1;
++attribute vec4 VertCoord;
++
++void main()
++{
++   gl_TexCoord[0] = TexCoord0;
++   gl_TexCoord[1] = TexCoord1;
++   // note: may use gl_Vertex or VertCoord here for testing:
++   gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
++}
+diff --git a/src/vpglsl/infinite-loop.glsl b/src/vpglsl/infinite-loop.glsl
+new file mode 100644
+index 0000000..bc7ae4b
+--- /dev/null
++++ b/src/vpglsl/infinite-loop.glsl
+@@ -0,0 +1,8 @@
++void main() {
++   gl_Position = gl_Vertex;
++   vec4 sum = vec4(0);
++   for (int i = 1; i != 2; i += 2) {
++      sum += vec4(0.1, 0.1, 0.1, 0.1);
++   }
++   gl_FrontColor = sum;
++}
+-- 
+2.0.0
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch b/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch
new file mode 100644
index 0000000..c96af12
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch
@@ -0,0 +1,54 @@
+From 36829a8d7ad2888515fbee95c2a70b3d636d7538 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 9 Jul 2014 14:30:33 +0200
+Subject: [PATCH 2/9] Correctly implement with AC_WITH(glut) so that
+ --without-glut works.
+
+---
+ configure.ac | 26 +++++++++++++++-----------
+ 1 file changed, 15 insertions(+), 11 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c4ee12b..9445424 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -67,21 +67,25 @@ DEMO_CFLAGS="$DEMO_CFLAGS $GL_CFLAGS"
+ DEMO_LIBS="$DEMO_LIBS $GL_LIBS"
+ 
+ dnl Check for GLUT
+-GLUT_CFLAGS=""
+-GLUT_LIBS=-lglut
+-glut_enabled=yes
++glut_enabled=no
+ AC_ARG_WITH([glut],
+ 	[AS_HELP_STRING([--with-glut=DIR],
+ 			[glut install directory])],
+ 	[GLUT_CFLAGS="-I$withval/include"
+-	 GLUT_LIBS="-L$withval/lib -lglut"])
+-AC_CHECK_HEADER([GL/glut.h],
+-		[],
+-		[glut_enabled=no])
+-AC_CHECK_LIB([glut],
+-		[glutInit],
+-		[],
+-		[glut_enabled=no])
++	 GLUT_LIBS="-L$withval/lib -lglut"],
++	[GLUT_CFLAGS=""
++	 GLUT_LIBS="-lglut"]
++        )
++AS_IF([test "x$with_glut" != xno],
++      [AC_CHECK_HEADER([GL/glut.h],
++                       [],
++                       [glut_enabled=no])
++       AC_CHECK_LIB([glut],
++                    [glutInit],
++                    [],
++                    [glut_enabled=no])
++       glut_enabled=yes
++])
+ 
+ dnl Check for FreeGLUT 2.6 or later
+ AC_EGREP_HEADER([glutInitContextProfile],
+-- 
+2.0.0
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch b/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
new file mode 100644
index 0000000..6b58c2b
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch
@@ -0,0 +1,424 @@
+From b25e9c675cf560b8b037dc855c6b3b1d09957867 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Wed, 9 Jul 2014 14:23:41 +0200
+Subject: [PATCH 3/9] configure: Allow to disable demos which require GLEW or
+ GLU
+
+* in some systems without X11 support we don't have GLEW, but
+  mesa-demos are still useful
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure.ac                  | 49 ++++++++++++++++++++---------
+ src/Makefile.am               | 14 ++++++---
+ src/demos/Makefile.am         | 73 ++++++++++++++++++++++++-------------------
+ src/egl/Makefile.am           |  8 +++--
+ src/egl/opengles1/Makefile.am | 44 +++++++++++++++-----------
+ src/egl/opengles2/Makefile.am | 33 ++++++++++---------
+ 6 files changed, 135 insertions(+), 86 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 9445424..bc4c8d1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -93,25 +93,44 @@ AC_EGREP_HEADER([glutInitContextProfile],
+ 		[AC_DEFINE(HAVE_FREEGLUT)],
+ 		[])
+ 
+-dnl Check for GLEW
+-PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4])
+-DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
+-DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
++AC_ARG_ENABLE([glew],
++    [AS_HELP_STRING([--enable-glew],
++        [build demos which require glew @<:@default=yes@:>@])],
++    [enable_glew="$enableval"],
++    [enable_glew=yes]
++)
++
++if test "x$enable_glew" = xyes; then
++    dnl Check for GLEW
++    PKG_CHECK_MODULES(GLEW, [glew >= 1.5.4], [glew_enabled=yes], [glew_enabled=no])
++    DEMO_CFLAGS="$DEMO_CFLAGS $GLEW_CFLAGS"
++    DEMO_LIBS="$DEMO_LIBS $GLEW_LIBS"
++fi
+ 
+ # LIBS was set by AC_CHECK_LIB above
+ LIBS=""
+ 
+-PKG_CHECK_MODULES(GLU, [glu], [],
+-		  [AC_CHECK_HEADER([GL/glu.h],
+-				   [],
+-		  		   AC_MSG_ERROR([GLU not found]))
+-		   AC_CHECK_LIB([GLU],
+-				[gluBeginCurve],
+-				[GLU_LIBS=-lGLU],
+-				AC_MSG_ERROR([GLU required])) ])
++AC_ARG_ENABLE([glu],
++    [AS_HELP_STRING([--enable-glu],
++        [build demos which require glu @<:@default=yes@:>@])],
++    [enable_glu="$enableval"],
++    [enable_glu=yes]
++)
+ 
+-DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
+-DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
++if test "x$enable_glu" = xyes; then
++    PKG_CHECK_MODULES(GLU, [glu], [glu_enabled=yes],
++                     [AC_CHECK_HEADER([GL/glu.h],
++                                      [],
++                                      AC_MSG_ERROR([GLU not found]))
++                      AC_CHECK_LIB([GLU],
++                                   [gluBeginCurve],
++                                   [GLU_LIBS=-lGLU
++				    glu_enabled=yes],
++                                   AC_MSG_ERROR([GLU required])) ])
++
++    DEMO_CFLAGS="$DEMO_CFLAGS $GLU_CFLAGS"
++    DEMO_LIBS="$DEMO_LIBS $GLU_LIBS"
++fi
+ 
+ AC_ARG_ENABLE([egl],
+     [AS_HELP_STRING([--enable-egl],
+@@ -304,6 +323,8 @@ AC_SUBST([WAYLAND_CFLAGS])
+ AC_SUBST([WAYLAND_LIBS])
+ 
+ 
++AM_CONDITIONAL(HAVE_GLU, test "x$glu_enabled" = "xyes")
++AM_CONDITIONAL(HAVE_GLEW, test "x$glew_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_EGL, test "x$egl_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV1, test "x$glesv1_enabled" = "xyes")
+ AM_CONDITIONAL(HAVE_GLESV2, test "x$glesv2_enabled" = "xyes")
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 1647d64..754c47c 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -23,14 +23,18 @@
+ #    Eric Anholt <eric@anholt.net>
+ 
++if HAVE_GLEW
++UTIL = util
++endif
++
+ SUBDIRS = \
+-	util \
++	$(UTIL) \
+ 	data \
+ 	demos \
+ 	egl \
+ 	fp \
+ 	fpglsl \
+ 	glsl \
+-        gs \
++	gs \
+ 	objviewer \
+ 	osdemos \
+ 	perf \
+@@ -40,8 +39,12 @@ SUBDIRS = \
+ 	slang \
+ 	tests \
+ 	tools \
+-	trivial \
+-	vp \
+-	vpglsl \
+ 	wgl \
+ 	xdemos
++
++if HAVE_GLEW
++SUBDIRS += \
++	vp \
++	vpglsl \
++	trivial
++endif
+diff --git a/src/demos/Makefile.am b/src/demos/Makefile.am
+index 41603fa..ab1e3ab 100644
+--- a/src/demos/Makefile.am
++++ b/src/demos/Makefile.am
+@@ -30,91 +30,100 @@ AM_LDFLAGS = \
+ 	$(DEMO_LIBS) \
+ 	$(GLUT_LIBS)
+ 
++bin_PROGRAMS =
++
+ if HAVE_GLUT
+-bin_PROGRAMS = \
++if HAVE_GLEW
++bin_PROGRAMS += \
+ 	arbfplight \
+ 	arbfslight \
+ 	arbocclude \
+ 	arbocclude2 \
+-	bounce \
+-	clearspd \
+ 	copypix \
+ 	cubemap \
+ 	cuberender \
+ 	dinoshade \
+-	dissolve \
+-	drawpix \
+ 	engine \
+ 	fbo_firecube \
+ 	fbotexture \
+-	fire \
+ 	fogcoord \
+ 	fplight \
+ 	fslight \
++	gloss \
++	isosurf \
++	multiarb \
++	paltex \
++	pointblast \
++	projtex \
++	shadowtex \
++	spriteblast \
++	stex3d \
++	textures \
++	vao_demo \
++	winpos
++
++copypix_LDADD = ../util/libutil.la
++cubemap_LDADD = ../util/libutil.la
++cuberender_LDADD = ../util/libutil.la
++engine_LDADD = ../util/libutil.la
++fbo_firecube_LDADD = ../util/libutil.la
++gloss_LDADD = ../util/libutil.la
++isosurf_LDADD = ../util/libutil.la
++multiarb_LDADD = ../util/libutil.la
++projtex_LDADD = ../util/libutil.la
++textures_LDADD = ../util/libutil.la
++winpos_LDADD = ../util/libutil.la
++endif
++
++if HAVE_GLU
++bin_PROGRAMS += \
++	bounce \
++	clearspd \
++	dissolve \
++	drawpix \
++	fire \
+ 	gamma \
+ 	gearbox \
+ 	gears \
+ 	geartrain \
+ 	glinfo \
+-	gloss \
+ 	gltestperf \
+ 	ipers \
+-	isosurf \
+ 	lodbias \
+ 	morph3d \
+-	multiarb \
+-	paltex \
+ 	pixeltest \
+-	pointblast \
+-	projtex \
+ 	ray \
+ 	readpix \
+ 	reflect \
+ 	renormal \
+-	shadowtex \
+ 	singlebuffer \
+ 	spectex \
+-	spriteblast \
+-	stex3d \
+ 	teapot \
+ 	terrain \
+ 	tessdemo \
+ 	texcyl \
+ 	texenv \
+-	textures \
+ 	trispd \
+ 	tunnel2 \
+-	tunnel \
+-	vao_demo \
+-	winpos
+-endif
++	tunnel
+ 
+ tunnel_SOURCES = \
+ 	tunnel.c \
+ 	tunneldat.h
+ 
+-copypix_LDADD = ../util/libutil.la
+-cubemap_LDADD = ../util/libutil.la
+-cuberender_LDADD = ../util/libutil.la
+-drawpix_LDADD = ../util/libutil.la
+ dissolve_LDADD = ../util/libutil.la
+-engine_LDADD = ../util/libutil.la
+-fbo_firecube_LDADD = ../util/libutil.la
++drawpix_LDADD = ../util/libutil.la
+ fire_LDADD = ../util/libutil.la
+-gloss_LDADD = ../util/libutil.la
+ ipers_LDADD = ../util/libutil.la
+-isosurf_LDADD = ../util/libutil.la
+ lodbias_LDADD = ../util/libutil.la
+-multiarb_LDADD = ../util/libutil.la
+-projtex_LDADD = ../util/libutil.la
+ readpix_LDADD = ../util/libutil.la
+ reflect_LDADD = ../util/libutil.la
+ teapot_LDADD = ../util/libutil.la
+ texcyl_LDADD = ../util/libutil.la
+-textures_LDADD = ../util/libutil.la
+ tunnel_LDADD = ../util/libutil.la
+ tunnel2_LDADD = ../util/libutil.la
+-winpos_LDADD = ../util/libutil.la
++endif
++endif
+ 
+ EXTRA_DIST = \
+ 	README
+diff --git a/src/egl/Makefile.am b/src/egl/Makefile.am
+index d64a49e..4fe1ca8 100644
+--- a/src/egl/Makefile.am
++++ b/src/egl/Makefile.am
+@@ -24,8 +24,12 @@
+ 
+ SUBDIRS = \
+ 	eglut \
+-	opengl \
+-	openvg \
+ 	opengles1 \
+ 	opengles2 \
+ 	oes_vg
++
++if HAVE_GLU
++SUBDIRS += \
++	opengl \
++	openvg
++endif
+diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
+index 7a9828d..3455e75 100644
+--- a/src/egl/opengles1/Makefile.am
++++ b/src/egl/opengles1/Makefile.am
+@@ -36,28 +36,43 @@ AM_LDFLAGS = \
+ 	$(EGL_LIBS) \
+ 	-lm
+ 
++noinst_PROGRAMS =
++
+ if HAVE_EGL
+ if HAVE_GLESV1
+-noinst_PROGRAMS = \
+-	bindtex \
+-	clear \
++noinst_PROGRAMS += \
+ 	drawtex_screen \
++	gears_screen \
++	torus_screen \
++	tri_screen
++
++drawtex_screen_SOURCES = drawtex.c
++gears_screen_SOURCES = gears.c
++torus_screen_SOURCES = torus.c
++tri_screen_SOURCES = tri.c
++
++drawtex_screen_LDADD = ../eglut/libeglut_screen.la
++gears_screen_LDADD = ../eglut/libeglut_screen.la
++torus_screen_LDADD = ../eglut/libeglut_screen.la
++tri_screen_LDADD = ../eglut/libeglut_screen.la
++
++if HAVE_X11
++noinst_PROGRAMS += \
++	clear
++
++bin_PROGRAMS = \
++	bindtex \
+ 	drawtex_x11 \
+ 	eglfbdev \
+ 	es1_info \
+-	gears_screen \
+ 	gears_x11 \
+ 	msaa \
+ 	pbuffer\
+ 	render_tex \
+ 	texture_from_pixmap \
+-	torus_screen \
+ 	torus_x11 \
+-	tri_screen \
+ 	tri_x11 \
+ 	two_win
+-endif
+-endif
+ 
+ bindtex_LDADD = $(X11_LIBS)
+ es1_info_LDADD = $(X11_LIBS)
+@@ -71,22 +86,15 @@ two_win_LDADD = $(X11_LIBS)
+ clear_LDADD = ../eglut/libeglut_x11.la $(EGL_LIBS) $(X11_LIBS)
+ clear_LDFLAGS =
+ 
+-drawtex_screen_SOURCES = drawtex.c
+-gears_screen_SOURCES = gears.c
+-torus_screen_SOURCES = torus.c
+-tri_screen_SOURCES = tri.c
+-
+ drawtex_x11_SOURCES = drawtex.c
+ gears_x11_SOURCES = gears.c
+ torus_x11_SOURCES = torus.c
+ tri_x11_SOURCES = tri.c
+ 
+-drawtex_screen_LDADD = ../eglut/libeglut_screen.la
+-gears_screen_LDADD = ../eglut/libeglut_screen.la
+-torus_screen_LDADD = ../eglut/libeglut_screen.la
+-tri_screen_LDADD = ../eglut/libeglut_screen.la
+-
+ drawtex_x11_LDADD = ../eglut/libeglut_x11.la
+ gears_x11_LDADD = ../eglut/libeglut_x11.la
+ torus_x11_LDADD = ../eglut/libeglut_x11.la
+ tri_x11_LDADD = ../eglut/libeglut_x11.la
++endif
++endif
++endif
+diff --git a/src/egl/opengles2/Makefile.am b/src/egl/opengles2/Makefile.am
+index 41c1b80..74af460 100644
+--- a/src/egl/opengles2/Makefile.am
++++ b/src/egl/opengles2/Makefile.am
+@@ -36,26 +36,29 @@ AM_LDFLAGS = \
+ if HAVE_EGL
+ if HAVE_GLESV2
+ bin_PROGRAMS = \
+-	es2_info \
+-	es2gears_screen \
+-	es2gears_x11 \
+-	es2tri
++	es2gears_screen
++
++es2gears_screen_SOURCES = es2gears.c
++es2gears_screen_LDADD = ../eglut/libeglut_screen.la
++
+ if HAVE_WAYLAND
+ bin_PROGRAMS += es2gears_wayland
+-endif
+-endif
+-endif
+ 
+-es2_info_LDADD = $(X11_LIBS)
+-es2tri_LDADD = $(X11_LIBS)
++es2gears_wayland_SOURCES = es2gears.c
++es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
++endif
+ 
+-es2gears_screen_SOURCES = es2gears.c
++if HAVE_X11
++bin_PROGRAMS += \
++	es2tri \
++	es2_info \
++	es2gears_x11
+ 
++es2_info_LDADD = $(X11_LIBS)
+ es2gears_x11_SOURCES = es2gears.c
+-
+-es2gears_screen_LDADD = ../eglut/libeglut_screen.la
+-
+ es2gears_x11_LDADD = ../eglut/libeglut_x11.la
++es2tri_LDADD = $(X11_LIBS)
++endif
++endif
++endif
+ 
+-es2gears_wayland_SOURCES = es2gears.c
+-es2gears_wayland_LDADD = ../eglut/libeglut_wayland.la
+-- 
+2.0.0
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch b/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
new file mode 100644
index 0000000..f77b97f
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch
@@ -0,0 +1,234 @@
+From 5e10108d76a59abac21c7e540bcfd2ddaccca2cb Mon Sep 17 00:00:00 2001
+From: Drew Moseley <drew_moseley@mentor.com>
+Date: Fri, 9 May 2014 11:50:24 -0400
+Subject: [PATCH 4/9] Use DEMOS_DATA_DIR to locate data files
+
+Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=78496]
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+---
+ src/glsl/bezier.c           |  2 +-
+ src/glsl/blinking-teapot.c  |  4 ++--
+ src/glsl/brick.c            |  4 ++--
+ src/glsl/bump.c             |  6 +++---
+ src/glsl/convolutions.c     |  2 +-
+ src/glsl/mandelbrot.c       |  4 ++--
+ src/glsl/multitex.c         |  4 ++--
+ src/glsl/simplex-noise.c    |  2 +-
+ src/glsl/skinning.c         |  4 ++--
+ src/glsl/texdemo1.c         |  8 ++++----
+ src/glsl/toyball.c          |  4 ++--
+ src/objviewer/objview.c     | 12 ++++++------
+ src/perf/glslstateschange.c |  8 ++++----
+ 13 files changed, 32 insertions(+), 32 deletions(-)
+
+diff --git a/src/glsl/bezier.c b/src/glsl/bezier.c
+index 0b56bc1..e01603d 100644
+--- a/src/glsl/bezier.c
++++ b/src/glsl/bezier.c
+@@ -13,7 +13,7 @@
+ #include "glut_wrap.h"
+ #include "shaderutil.h"
+ 
+-static const char *filename = "bezier.geom";
++static const char *filename = DEMOS_DATA_DIR "bezier.geom";
+ 
+ static GLuint fragShader;
+ static GLuint vertShader;
+diff --git a/src/glsl/blinking-teapot.c b/src/glsl/blinking-teapot.c
+index e3bf24d..7662b1f 100644
+--- a/src/glsl/blinking-teapot.c
++++ b/src/glsl/blinking-teapot.c
+@@ -63,8 +63,8 @@ init_opengl (void)
+      exit(1);
+   }     
+ 
+-  vshad_id = CompileShaderFile (GL_VERTEX_SHADER, "blinking-teapot.vert");
+-  fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, "blinking-teapot.frag");
++  vshad_id = CompileShaderFile (GL_VERTEX_SHADER, DEMOS_DATA_DIR "blinking-teapot.vert");
++  fshad_id = CompileShaderFile (GL_FRAGMENT_SHADER, DEMOS_DATA_DIR "blinking-teapot.frag");
+   prog_id = LinkShaders (vshad_id, fshad_id);
+ 
+   UseProgram (prog_id);
+diff --git a/src/glsl/brick.c b/src/glsl/brick.c
+index 3021856..fe5f190 100644
+--- a/src/glsl/brick.c
++++ b/src/glsl/brick.c
+@@ -14,8 +14,8 @@
+ #include "shaderutil.h"
+ 
+ 
+-static char *FragProgFile = "CH06-brick.frag";
+-static char *VertProgFile = "CH06-brick.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH06-brick.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH06-brick.vert";
+ 
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/glsl/bump.c b/src/glsl/bump.c
+index 59f62cd..3a1b20a 100644
+--- a/src/glsl/bump.c
++++ b/src/glsl/bump.c
+@@ -15,9 +15,9 @@
+ #include "readtex.h"
+ 
+ 
+-static char *FragProgFile = "CH11-bumpmap.frag";
+-static char *FragTexProgFile = "CH11-bumpmaptex.frag";
+-static char *VertProgFile = "CH11-bumpmap.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH11-bumpmap.frag";
++static char *FragTexProgFile = DEMOS_DATA_DIR "CH11-bumpmaptex.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH11-bumpmap.vert";
+ static char *TextureFile = DEMOS_DATA_DIR "tile.rgb";
+ 
+ /* program/shader objects */
+diff --git a/src/glsl/convolutions.c b/src/glsl/convolutions.c
+index a120cfe..9312f00 100644
+--- a/src/glsl/convolutions.c
++++ b/src/glsl/convolutions.c
+@@ -340,7 +340,7 @@ static void init(void)
+ 
+    menuInit();
+    readTexture(textureLocation);
+-   createProgram("convolution.vert", "convolution.frag");
++   createProgram(DEMOS_DATA_DIR "convolution.vert", DEMOS_DATA_DIR "convolution.frag");
+ 
+    glEnable(GL_TEXTURE_2D);
+    glClearColor(1.0, 1.0, 1.0, 1.0);
+diff --git a/src/glsl/mandelbrot.c b/src/glsl/mandelbrot.c
+index 31ede1d..ab34a0f 100644
+--- a/src/glsl/mandelbrot.c
++++ b/src/glsl/mandelbrot.c
+@@ -14,8 +14,8 @@
+ #include "shaderutil.h"
+ 
+ 
+-static char *FragProgFile = "CH18-mandel.frag";
+-static char *VertProgFile = "CH18-mandel.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH18-mandel.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH18-mandel.vert";
+ 
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/glsl/multitex.c b/src/glsl/multitex.c
+index 262ea50..546bd27 100644
+--- a/src/glsl/multitex.c
++++ b/src/glsl/multitex.c
+@@ -35,8 +35,8 @@
+ 
+ static const char *Demo = "multitex";
+ 
+-static const char *VertFile = "multitex.vert";
+-static const char *FragFile = "multitex.frag";
++static const char *VertFile = DEMOS_DATA_DIR "multitex.vert";
++static const char *FragFile = DEMOS_DATA_DIR "multitex.frag";
+ 
+ static const char *TexFiles[2] = 
+    {
+diff --git a/src/glsl/simplex-noise.c b/src/glsl/simplex-noise.c
+index 13fdd5d..885f01e 100644
+--- a/src/glsl/simplex-noise.c
++++ b/src/glsl/simplex-noise.c
+@@ -169,7 +169,7 @@ SpecialKey(int key, int x, int y)
+ static void
+ Init(void)
+ {
+-   const char *filename = "simplex-noise.glsl";
++   const char *filename = DEMOS_DATA_DIR "simplex-noise.glsl";
+    char noiseText[10000];
+    FILE *f;
+    int len;
+diff --git a/src/glsl/skinning.c b/src/glsl/skinning.c
+index bf38d77..536d475 100644
+--- a/src/glsl/skinning.c
++++ b/src/glsl/skinning.c
+@@ -20,8 +20,8 @@
+ #define M_PI 3.1415926535
+ #endif
+ 
+-static char *FragProgFile = "skinning.frag";
+-static char *VertProgFile = "skinning.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "skinning.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "skinning.vert";
+ 
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/glsl/texdemo1.c b/src/glsl/texdemo1.c
+index 6cde239..a082342 100644
+--- a/src/glsl/texdemo1.c
++++ b/src/glsl/texdemo1.c
+@@ -35,11 +35,11 @@
+ 
+ static const char *Demo = "texdemo1";
+ 
+-static const char *ReflectVertFile = "reflect.vert";
+-static const char *CubeFragFile = "cubemap.frag";
++static const char *ReflectVertFile = DEMOS_DATA_DIR "reflect.vert";
++static const char *CubeFragFile = DEMOS_DATA_DIR "cubemap.frag";
+ 
+-static const char *SimpleVertFile = "simple.vert";
+-static const char *SimpleTexFragFile = "shadowtex.frag";
++static const char *SimpleVertFile = DEMOS_DATA_DIR "simple.vert";
++static const char *SimpleTexFragFile = DEMOS_DATA_DIR "shadowtex.frag";
+ 
+ static const char *GroundImage = DEMOS_DATA_DIR "tile.rgb";
+ 
+diff --git a/src/glsl/toyball.c b/src/glsl/toyball.c
+index 5f27951..4e7e832 100644
+--- a/src/glsl/toyball.c
++++ b/src/glsl/toyball.c
+@@ -14,8 +14,8 @@
+ #include "shaderutil.h"
+ 
+ 
+-static char *FragProgFile = "CH11-toyball.frag";
+-static char *VertProgFile = "CH11-toyball.vert";
++static char *FragProgFile = DEMOS_DATA_DIR "CH11-toyball.frag";
++static char *VertProgFile = DEMOS_DATA_DIR "CH11-toyball.vert";
+ 
+ /* program/shader objects */
+ static GLuint fragShader;
+diff --git a/src/objviewer/objview.c b/src/objviewer/objview.c
+index 6def726..78a6acf 100644
+--- a/src/objviewer/objview.c
++++ b/src/objviewer/objview.c
+@@ -162,12 +162,12 @@ init_model(void)
+ static void
+ init_skybox(void)
+ {
+-   SkyboxTex = LoadSkyBoxCubeTexture("alpine_east.rgb",
+-                                     "alpine_west.rgb",
+-                                     "alpine_up.rgb",
+-                                     "alpine_down.rgb",
+-                                     "alpine_south.rgb",
+-                                     "alpine_north.rgb");
++   SkyboxTex = LoadSkyBoxCubeTexture(DEMOS_DATA_DIR "alpine_east.rgb",
++                                     DEMOS_DATA_DIR "alpine_west.rgb",
++                                     DEMOS_DATA_DIR "alpine_up.rgb",
++                                     DEMOS_DATA_DIR "alpine_down.rgb",
++                                     DEMOS_DATA_DIR "alpine_south.rgb",
++                                     DEMOS_DATA_DIR "alpine_north.rgb");
+    glmSpecularTexture(Model, SkyboxTex);
+ }
+ 
+diff --git a/src/perf/glslstateschange.c b/src/perf/glslstateschange.c
+index 7422b78..dbf8332 100644
+--- a/src/perf/glslstateschange.c
++++ b/src/perf/glslstateschange.c
+@@ -33,10 +33,10 @@
+ #include "glmain.h"
+ #include "common.h"
+ 
+-static const char *VertFile1 = "glslstateschange1.vert";
+-static const char *FragFile1 = "glslstateschange1.frag";
+-static const char *VertFile2 = "glslstateschange2.vert";
+-static const char *FragFile2 = "glslstateschange2.frag";
++static const char *VertFile1 = DEMOS_DATA_DIR "glslstateschange1.vert";
++static const char *FragFile1 = DEMOS_DATA_DIR "glslstateschange1.frag";
++static const char *VertFile2 = DEMOS_DATA_DIR "glslstateschange2.vert";
++static const char *FragFile2 = DEMOS_DATA_DIR "glslstateschange2.frag";
+ static struct uniform_info Uniforms1[] = {
+    { "tex1",  1, GL_SAMPLER_2D, { 0, 0, 0, 0 }, -1 },
+    { "tex2",  1, GL_SAMPLER_2D, { 1, 0, 0, 0 }, -1 },
+-- 
+2.0.0
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch b/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch
new file mode 100644
index 0000000..aac2a37
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch
@@ -0,0 +1,267 @@
+From 453353a221de9c64479f4372565d2cd8591b36cc Mon Sep 17 00:00:00 2001
+From: Frank Binns <frank.binns@imgtec.com>
+Date: Fri, 29 Jun 2012 11:26:04 +0100
+Subject: [PATCH 5/9] Fix build when EGL_MESA_screen_surface extension isn't
+ present
+
+The EGL demos won't build against EGL implementations that don't support
+the EGL_MESA_screen_surface extension. Fix this, in most cases, by
+wrapping relevant bits of code in #ifdef EGL_MESA_screen_surface.
+
+Signed-off-by: Frank Binns <frank.binns@imgtec.com>
+
+Applied and fixed up in Yocto by...
+
+Integrated-by: Tom Zanussi <tom.zanussi@linux.intel.com>
+
+Upstream-Status: Pending
+---
+ src/egl/eglut/eglut.c        |  9 +++++++--
+ src/egl/eglut/eglut_screen.c | 14 ++++++++++++++
+ src/egl/opengl/demo1.c       |  2 ++
+ src/egl/opengl/demo2.c       |  7 ++++++-
+ src/egl/opengl/demo3.c       |  7 ++++++-
+ 5 files changed, 35 insertions(+), 4 deletions(-)
+
+diff --git a/src/egl/eglut/eglut.c b/src/egl/eglut/eglut.c
+index 2ee6f15..f6a2ad4 100644
+--- a/src/egl/eglut/eglut.c
++++ b/src/egl/eglut/eglut.c
+@@ -76,8 +76,9 @@ _eglutNow(void)
+ static void
+ _eglutDestroyWindow(struct eglut_window *win)
+ {
+-   if (_eglut->surface_type != EGL_PBUFFER_BIT &&
+-       _eglut->surface_type != EGL_SCREEN_BIT_MESA)
++
++   if (_eglut->surface_type == EGL_WINDOW_BIT ||
++       _eglut->surface_type == EGL_PIXMAP_BIT)
+       eglDestroySurface(_eglut->dpy, win->surface);
+ 
+    _eglutNativeFiniWindow(win);
+@@ -175,7 +176,9 @@ _eglutCreateWindow(const char *title, int x, int y, int w, int h)
+             win->config, win->native.u.pixmap, NULL);
+       break;
+    case EGL_PBUFFER_BIT:
++#ifdef EGL_MESA_screen_surface
+    case EGL_SCREEN_BIT_MESA:
++#endif
+       win->surface = win->native.u.surface;
+       break;
+    default:
+@@ -289,8 +292,10 @@ eglutDestroyWindow(int win)
+    if (window->index != win)
+       return;
+ 
++#ifdef EGL_MESA_screen_surface
+    /* XXX it causes some bug in st/egl KMS backend */
+    if ( _eglut->surface_type != EGL_SCREEN_BIT_MESA)
++#endif
+       eglMakeCurrent(_eglut->dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+ 
+    _eglutDestroyWindow(_eglut->current);
+diff --git a/src/egl/eglut/eglut_screen.c b/src/egl/eglut/eglut_screen.c
+index 021a8f1..094a4e2 100644
+--- a/src/egl/eglut/eglut_screen.c
++++ b/src/egl/eglut/eglut_screen.c
+@@ -35,26 +35,33 @@
+ 
+ #define MAX_MODES 100
+ 
++#ifdef EGL_MESA_screen_surface
+ static EGLScreenMESA kms_screen;
+ static EGLModeMESA kms_mode;
+ static EGLint kms_width, kms_height;
++#endif
+ 
+ void
+ _eglutNativeInitDisplay(void)
+ {
++#ifdef EGL_MESA_screen_surface
+    _eglut->native_dpy = EGL_DEFAULT_DISPLAY;
+    _eglut->surface_type = EGL_SCREEN_BIT_MESA;
++#endif
+ }
+ 
+ void
+ _eglutNativeFiniDisplay(void)
+ {
++#ifdef EGL_MESA_screen_surface
+    kms_screen = 0;
+    kms_mode = 0;
+    kms_width = 0;
+    kms_height = 0;
++#endif
+ }
+ 
++#ifdef EGL_MESA_screen_surface
+ static void
+ init_kms(void)
+ {
+@@ -94,19 +101,23 @@ init_kms(void)
+    kms_width = width;
+    kms_height = height;
+ }
++#endif
+ 
+ void
+ _eglutNativeInitWindow(struct eglut_window *win, const char *title,
+                        int x, int y, int w, int h)
+ {
++#ifdef EGL_MESA_screen_surface
+    EGLint surf_attribs[16];
+    EGLint i;
++#endif
+    const char *exts;
+ 
+    exts = eglQueryString(_eglut->dpy, EGL_EXTENSIONS);
+    if (!exts || !strstr(exts, "EGL_MESA_screen_surface"))
+       _eglutFatal("EGL_MESA_screen_surface is not supported\n");
+ 
++#ifdef EGL_MESA_screen_surface
+    init_kms();
+ 
+    i = 0;
+@@ -128,14 +139,17 @@ _eglutNativeInitWindow(struct eglut_window *win, const char *title,
+ 
+    win->native.width = kms_width;
+    win->native.height = kms_height;
++#endif
+ }
+ 
+ void
+ _eglutNativeFiniWindow(struct eglut_window *win)
+ {
++#ifdef EGL_MESA_screen_surface
+    eglShowScreenSurfaceMESA(_eglut->dpy,
+          kms_screen, EGL_NO_SURFACE, 0);
+    eglDestroySurface(_eglut->dpy, win->native.u.surface);
++#endif
+ }
+ 
+ void
+diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
+index d892734..3a3564c 100644
+--- a/src/egl/opengl/demo1.c
++++ b/src/egl/opengl/demo1.c
+@@ -18,6 +18,7 @@
+ static void
+ TestScreens(EGLDisplay dpy)
+ {
++#ifdef EGL_MESA_screen_surface
+ #define MAX 8
+    EGLScreenMESA screens[MAX];
+    EGLint numScreens;
+@@ -28,6 +29,7 @@ TestScreens(EGLDisplay dpy)
+    for (i = 0; i < numScreens; i++) {
+       printf(" Screen %d handle: %d\n", i, (int) screens[i]);
+    }
++#endif
+ }
+ 
+ /**
+diff --git a/src/egl/opengl/demo2.c b/src/egl/opengl/demo2.c
+index 505b474..bfef59e 100644
+--- a/src/egl/opengl/demo2.c
++++ b/src/egl/opengl/demo2.c
+@@ -16,6 +16,7 @@
+ 
+ /*#define FRONTBUFFER*/
+ 
++#ifdef EGL_MESA_screen_surface
+ static void _subset_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2,
+                           GLfloat r, GLfloat g, GLfloat b)
+ {
+@@ -95,12 +96,13 @@ TestScreens(EGLDisplay dpy)
+       printf(" Screen %d handle: %d\n", i, (int) screens[i]);
+    }
+ }
+-
++#endif
+ 
+ int
+ main(int argc, char *argv[])
+ {
+    int maj, min;
++#ifdef EGL_MESA_screen_surface
+    EGLContext ctx;
+    EGLSurface pbuffer, screen_surf;
+    EGLConfig configs[10];
+@@ -115,6 +117,7 @@ main(int argc, char *argv[])
+    EGLModeMESA mode;
+    EGLScreenMESA screen;
+    EGLint count;
++#endif
+ 
+    EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+    assert(d);
+@@ -132,6 +135,7 @@ main(int argc, char *argv[])
+       exit(1);
+    }
+ 
++#ifdef EGL_MESA_screen_surface
+    eglGetConfigs(d, configs, 10, &numConfigs);
+    printf("Got %d EGL configs:\n", numConfigs);
+    for (i = 0; i < numConfigs; i++) {
+@@ -211,6 +215,7 @@ main(int argc, char *argv[])
+    eglDestroySurface(d, pbuffer);
+    eglDestroyContext(d, ctx);
+    eglTerminate(d);
++#endif
+ 
+    return 0;
+ }
+diff --git a/src/egl/opengl/demo3.c b/src/egl/opengl/demo3.c
+index f84ca23..31b5d8b 100644
+--- a/src/egl/opengl/demo3.c
++++ b/src/egl/opengl/demo3.c
+@@ -46,7 +46,7 @@ GLubyte OpenGL_bits[] = {
+    0x3e, 0x00, 0x00, 0xf8, 0x0c, 0x00, 
+ };
+ 
+-
++#ifdef EGL_MESA_screen_surface
+ static void Init(void)
+ {
+ 
+@@ -551,11 +551,13 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height)
+       fclose(f);
+    }
+ }
++#endif
+ 
+ int
+ main(int argc, char *argv[])
+ {
+    int maj, min;
++#ifdef EGL_MESA_screen_surface
+    EGLContext ctx;
+    EGLSurface screen_surf;
+    EGLConfig configs[10];
+@@ -566,6 +568,7 @@ main(int argc, char *argv[])
+    const GLubyte *bitmap;
+    EGLint screenAttribs[32];
+    EGLint i;
++#endif
+ 
+    EGLDisplay d = eglGetDisplay(EGL_DEFAULT_DISPLAY);
+    assert(d);
+@@ -583,6 +586,7 @@ main(int argc, char *argv[])
+       exit(1);
+    }
+ 
++#ifdef EGL_MESA_screen_surface
+    eglGetConfigs(d, configs, 10, &numConfigs);
+    eglGetScreensMESA(d, &screen, 1, &count);
+    eglGetModesMESA(d, screen, &mode, 1, &count);
+@@ -642,6 +646,7 @@ main(int argc, char *argv[])
+    eglDestroySurface(d, screen_surf);
+    eglDestroyContext(d, ctx);
+    eglTerminate(d);
++#endif
+ 
+    return 0;
+ }
+-- 
+2.0.0
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch b/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch
new file mode 100644
index 0000000..12e0805
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch
@@ -0,0 +1,41 @@
+From 6a19dba1d275579c73e7763b0554410ff4e1e650 Mon Sep 17 00:00:00 2001
+From: Frank Binns <frank.binns@imgtec.com>
+Date: Fri, 29 Jun 2012 12:00:26 +0100
+Subject: [PATCH 6/9] Query display for EGL_MESA_screen_surface extension
+ before using it
+
+This code makes heavy use of the EGL_MESA_screen_surface extension so
+check the display to determine if it's supported by the underlying EGL
+implementation. If it doesn't then bail.
+
+Signed-off-by: Frank Binns <frank.binns@imgtec.com>
+
+Applied and fixed up in Yocto by...
+
+Integrated-by: Tom Zanussi <tom.zanussi@linux.intel.com>
+
+Upstream-Status: Pending
+---
+ src/egl/opengl/demo1.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/egl/opengl/demo1.c b/src/egl/opengl/demo1.c
+index 3a3564c..06e2138 100644
+--- a/src/egl/opengl/demo1.c
++++ b/src/egl/opengl/demo1.c
+@@ -110,6 +110,12 @@ main(int argc, char *argv[])
+    printf("EGL version = %d.%d\n", maj, min);
+    printf("EGL_VENDOR = %s\n", eglQueryString(d, EGL_VENDOR));
+ 
++   if (!strstr(eglQueryString(d, EGL_EXTENSIONS),
++               "EGL_MESA_screen_surface")) {
++      printf("EGL_MESA_screen_surface is not supported\n");
++      exit(1);
++   }
++
+    eglGetConfigs(d, NULL, 0, &numConfigs);
+    configs = malloc(sizeof(*configs) *numConfigs);
+    eglGetConfigs(d, configs, numConfigs, &numConfigs);
+-- 
+2.0.0
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch b/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
new file mode 100644
index 0000000..89d2fac
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0007-Install-few-more-test-programs.patch
@@ -0,0 +1,74 @@
+From d930b2da57f7c9efb80c8cef8f8adad15bbbc0d3 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 10 Jul 2014 14:30:52 +0200
+Subject: [PATCH 7/9] Install few more test programs
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/egl/opengl/Makefile.am    |  2 +-
+ src/egl/opengles1/Makefile.am | 10 ++++------
+ src/egl/openvg/Makefile.am    |  2 +-
+ 3 files changed, 6 insertions(+), 8 deletions(-)
+
+diff --git a/src/egl/opengl/Makefile.am b/src/egl/opengl/Makefile.am
+index 0c7228f..87b2f1a 100644
+--- a/src/egl/opengl/Makefile.am
++++ b/src/egl/opengl/Makefile.am
+@@ -50,7 +50,7 @@ endif
+ endif
+ 
+ if HAVE_EGL
+-noinst_PROGRAMS = \
++bin_PROGRAMS = \
+ 	demo1 \
+ 	demo2 \
+ 	demo3 \
+diff --git a/src/egl/opengles1/Makefile.am b/src/egl/opengles1/Makefile.am
+index 3455e75..516e516 100644
+--- a/src/egl/opengles1/Makefile.am
++++ b/src/egl/opengles1/Makefile.am
+@@ -36,11 +36,11 @@ AM_LDFLAGS = \
+ 	$(EGL_LIBS) \
+ 	-lm
+ 
+-noinst_PROGRAMS =
++bin_PROGRAMS =
+ 
+ if HAVE_EGL
+ if HAVE_GLESV1
+-noinst_PROGRAMS += \
++bin_PROGRAMS += \
+ 	drawtex_screen \
+ 	gears_screen \
+ 	torus_screen \
+@@ -57,10 +57,8 @@ torus_screen_LDADD = ../eglut/libeglut_screen.la
+ tri_screen_LDADD = ../eglut/libeglut_screen.la
+ 
+ if HAVE_X11
+-noinst_PROGRAMS += \
+-	clear
+-
+-bin_PROGRAMS = \
++bin_PROGRAMS += \
++	clear \
+ 	bindtex \
+ 	drawtex_x11 \
+ 	eglfbdev \
+diff --git a/src/egl/openvg/Makefile.am b/src/egl/openvg/Makefile.am
+index 7318a43..b545225 100644
+--- a/src/egl/openvg/Makefile.am
++++ b/src/egl/openvg/Makefile.am
+@@ -49,7 +49,7 @@ endif
+ 
+ if HAVE_EGL
+ if HAVE_VG
+-noinst_PROGRAMS = \
++bin_PROGRAMS = \
+ 	lion_screen \
+ 	sp_screen \
+ 	$(EGL_X11_DEMOS)
+-- 
+2.0.0
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch b/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch
new file mode 100644
index 0000000..a608575
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch
@@ -0,0 +1,101 @@
+From 0b6f95f9b8ece22e9856c150e4be29fd86eaf546 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 10 Jul 2014 14:29:27 +0200
+Subject: [PATCH 8/9] glsl, perf: Add few missing .glsl, .vert, .frag files to
+ EXTRA_DATA
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/fpglsl/Makefile.am |  2 ++
+ src/glsl/Makefile.am   | 10 ++++++++--
+ src/perf/Makefile.am   |  6 ++++++
+ src/vpglsl/Makefile.am |  1 +
+ 4 files changed, 17 insertions(+), 2 deletions(-)
+
+diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
+index 47c1039..fd43c91 100644
+--- a/src/fpglsl/Makefile.am
++++ b/src/fpglsl/Makefile.am
+@@ -39,10 +39,12 @@ noinst_PROGRAMS = \
+ endif
+ 
+ EXTRA_DIST = \
++	depth-read.glsl \
+ 	dowhile2.glsl \
+ 	dowhile.glsl \
+ 	forbreak.glsl \
+ 	for.glsl \
++	infinite-loop.glsl \
+ 	mov.glsl \
+ 	mov-imm.glsl \
+ 	simpleif.glsl \
+diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
+index 4faa8db..079a29d 100644
+--- a/src/glsl/Makefile.am
++++ b/src/glsl/Makefile.am
+@@ -37,7 +37,7 @@ AM_LDFLAGS = \
+ if HAVE_GLUT
+ bin_PROGRAMS = \
+ 	array \
+-        bezier \
++	bezier \
+ 	bitmap \
+ 	brick \
+ 	bump \
+@@ -123,12 +123,16 @@ EXTRA_DIST = \
+ 	CH06-brick.vert \
+ 	CH11-bumpmap.frag \
+ 	CH11-bumpmap.vert \
++	CH11-bumpmaptex.frag \
+ 	CH11-toyball.frag \
+ 	CH11-toyball.vert \
+ 	CH18-mandel.frag \
+ 	CH18-mandel.vert \
+-        bezier.geom \
++	bezier.geom \
+ 	brick.shtest \
++	blinking-teapot.frag \
++	blinking-teapot.vert \
++	convolution.frag \
+ 	convolution.vert \
+ 	cubemap.frag \
+ 	mandelbrot.shtest \
+@@ -138,5 +142,7 @@ EXTRA_DIST = \
+ 	reflect.vert \
+ 	shadowtex.frag \
+ 	simple.vert \
++	simplex-noise.glsl \
+ 	skinning.frag \
++	skinning.vert \
+ 	toyball.shtest
+diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
+index 5363c58..c5cca8d 100644
+--- a/src/perf/Makefile.am
++++ b/src/perf/Makefile.am
+@@ -57,3 +57,9 @@ bin_PROGRAMS = \
+ endif
+ 
+ glslstateschange_LDADD = libperf.la ../util/libutil.la
++
++EXTRA_DIST = \
++	glslstateschange1.frag \
++	glslstateschange1.vert \
++	glslstateschange2.frag \
++	glslstateschange2.vert
+diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
+index 4a85ed4..48b08f4 100644
+--- a/src/vpglsl/Makefile.am
++++ b/src/vpglsl/Makefile.am
+@@ -44,6 +44,7 @@ EXTRA_DIST = \
+ 	func2.glsl \
+ 	ifelse.glsl \
+ 	if.glsl \
++	infinite-loop.glsl \
+ 	mov.glsl \
+ 	nestedifs.glsl \
+ 	nestedswizzle.glsl \
+-- 
+2.0.0
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch b/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch
new file mode 100644
index 0000000..1262dee
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos/0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch
@@ -0,0 +1,73 @@
+From c8c3de5417d6b6c7d7579c528c0cab718f4bfdb6 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Thu, 10 Jul 2014 14:48:12 +0200
+Subject: [PATCH 9/9] glsl, perf: Install .glsl, .vert, .frag files
+
+Upstream-Status: Pending
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/fpglsl/Makefile.am | 3 ++-
+ src/glsl/Makefile.am   | 3 ++-
+ src/perf/Makefile.am   | 3 ++-
+ src/vpglsl/Makefile.am | 3 ++-
+ 4 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/src/fpglsl/Makefile.am b/src/fpglsl/Makefile.am
+index fd43c91..2bf51de 100644
+--- a/src/fpglsl/Makefile.am
++++ b/src/fpglsl/Makefile.am
+@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
+ 	fp-tri
+ endif
+ 
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ 	depth-read.glsl \
+ 	dowhile2.glsl \
+ 	dowhile.glsl \
+diff --git a/src/glsl/Makefile.am b/src/glsl/Makefile.am
+index 079a29d..f66ec29 100644
+--- a/src/glsl/Makefile.am
++++ b/src/glsl/Makefile.am
+@@ -118,7 +118,8 @@ vert_or_frag_only_LDADD = ../util/libutil.la
+ vert_tex_LDADD = ../util/libutil.la
+ vsraytrace_LDADD = ../util/libutil.la
+ 
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ 	CH06-brick.frag \
+ 	CH06-brick.vert \
+ 	CH11-bumpmap.frag \
+diff --git a/src/perf/Makefile.am b/src/perf/Makefile.am
+index c5cca8d..140256d 100644
+--- a/src/perf/Makefile.am
++++ b/src/perf/Makefile.am
+@@ -58,7 +58,8 @@ endif
+ 
+ glslstateschange_LDADD = libperf.la ../util/libutil.la
+ 
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ 	glslstateschange1.frag \
+ 	glslstateschange1.vert \
+ 	glslstateschange2.frag \
+diff --git a/src/vpglsl/Makefile.am b/src/vpglsl/Makefile.am
+index 48b08f4..5526867 100644
+--- a/src/vpglsl/Makefile.am
++++ b/src/vpglsl/Makefile.am
+@@ -38,7 +38,8 @@ noinst_PROGRAMS = \
+ 	vp-tris
+ endif
+ 
+-EXTRA_DIST = \
++demosdatadir=$(datadir)/$(PACKAGE)/
++dist_demosdata_DATA= \
+ 	for.glsl \
+ 	func.glsl \
+ 	func2.glsl \
+-- 
+2.0.0
+
diff --git a/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb b/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
new file mode 100644
index 0000000..e451642
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-demos_8.2.0.bb
@@ -0,0 +1,57 @@
+SUMMARY = "Mesa demo applications"
+DESCRIPTION = "This package includes the demonstration application, such as glxgears. \
+These applications can be used for Mesa validation and benchmarking."
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11"
+
+LICENSE = "MIT & PD"
+LIC_FILES_CHKSUM = "file://src/xdemos/glxgears.c;beginline=1;endline=20;md5=914225785450eff644a86c871d3ae00e \
+                    file://src/xdemos/glxdemo.c;beginline=1;endline=8;md5=b01d5ab1aee94d35b7efaa2ef48e1a06"
+
+SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/demos/${PV}/${BPN}-${PV}.tar.bz2 \
+    file://0001-mesa-demos-Add-missing-data-files.patch \
+    file://0002-Correctly-implement-with-AC_WITH-glut-so-that-withou.patch \
+    file://0003-configure-Allow-to-disable-demos-which-require-GLEW-.patch \
+    file://0004-Use-DEMOS_DATA_DIR-to-locate-data-files.patch \
+    file://0005-Fix-build-when-EGL_MESA_screen_surface-extension-isn.patch \
+    file://0006-Query-display-for-EGL_MESA_screen_surface-extension-.patch \
+    file://0007-Install-few-more-test-programs.patch \
+    file://0008-glsl-perf-Add-few-missing-.glsl-.vert-.frag-files-to.patch \
+    file://0009-glsl-perf-Install-.glsl-.vert-.frag-files.patch \
+"
+SRC_URI[md5sum] = "72613a2c8c013716db02e3ff59d29061"
+SRC_URI[sha256sum] = "e4bfecb5816ddd4b7b37c1bc876b63f1f7f06fda5879221a9774d0952f90ba92"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ?= "drm osmesa freetype2 gbm egl gles1 gles2 \
+                  ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 glew glu', '', d)}"
+
+# The Wayland code doesn't work with Wayland 1.0, so disable it for now
+#${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}"
+
+EXTRA_OECONF = "--with-system-data-files"
+
+PACKAGECONFIG[drm] = "--enable-libdrm,--disable-libdrm,libdrm"
+PACKAGECONFIG[egl] = "--enable-egl,--disable-egl,virtual/egl"
+PACKAGECONFIG[freetype2] = "--enable-freetype2,--disable-freetype2,freetype"
+PACKAGECONFIG[gbm] = "--enable-gbm,--disable-gbm,virtual/libgl"
+PACKAGECONFIG[gles1] = "--enable-gles1,--disable-gles1,virtual/libgles1"
+PACKAGECONFIG[gles2] = "--enable-gles2,--disable-gles2,virtual/libgles2"
+PACKAGECONFIG[glut] = "--with-glut=${STAGING_EXECPREFIXDIR},--without-glut,"
+PACKAGECONFIG[osmesa] = "--enable-osmesa,--disable-osmesa,"
+PACKAGECONFIG[vg] = "--enable-vg,--disable-vg,virtual/libopenvg"
+PACKAGECONFIG[wayland] = "--enable-wayland,--disable-wayland,virtual/libgl wayland"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11"
+PACKAGECONFIG[glew] = "--enable-glew,--disable-glew,glew"
+PACKAGECONFIG[glu] = "--enable-glu,--disable-glu,virtual/libgl"
+
+do_install_append() {
+	# it can be completely empty when all PACKAGECONFIG options are disabled
+	rmdir --ignore-fail-on-non-empty ${D}${bindir}
+
+	if [ -f ${D}${bindir}/clear ]; then
+        	mv ${D}${bindir}/clear ${D}${bindir}/clear.mesa-demos
+	fi
+}
diff --git a/meta/recipes-graphics/mesa/mesa-gl_10.6.3.bb b/meta/recipes-graphics/mesa/mesa-gl_10.6.3.bb
new file mode 100644
index 0000000..fc2bca9
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa-gl_10.6.3.bb
@@ -0,0 +1,13 @@
+require mesa_${PV}.bb
+
+SUMMARY += " (OpenGL only, no EGL/GLES)"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/mesa:"
+
+PROVIDES = "virtual/libgl virtual/mesa"
+
+S = "${WORKDIR}/mesa-${PV}"
+
+PACKAGECONFIG ??= "dri ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-graphics/mesa/mesa.inc b/meta/recipes-graphics/mesa/mesa.inc
new file mode 100644
index 0000000..af7a2c4
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa.inc
@@ -0,0 +1,185 @@
+SUMMARY = "A free implementation of the OpenGL API"
+DESCRIPTION = "Mesa is an open-source implementation of the OpenGL specification - \
+a system for rendering interactive 3D graphics.  \
+A variety of device drivers allows Mesa to be used in many different environments \
+ranging from software emulation to complete hardware acceleration for modern GPUs. \
+Mesa is used as part of the overall Direct Rendering Infrastructure and X.org \
+environment."
+
+HOMEPAGE = "http://mesa3d.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://docs/license.html;md5=6a23445982a7a972ac198e93cc1cb3de"
+
+PE = "2"
+
+DEPENDS = "expat makedepend-native flex-native bison-native libxml2-native udev"
+
+PROVIDES = "virtual/libgl virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa"
+
+inherit autotools pkgconfig pythonnative gettext distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "opengl"
+
+EXTRA_OECONF = "--enable-shared-glapi"
+
+PACKAGECONFIG ??= "egl gles dri \
+		${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}\
+		${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)}\
+		"
+
+X11_DEPS = "xf86driproto glproto virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
+PACKAGECONFIG[x11] = "--enable-glx-tls,--disable-glx,${X11_DEPS}"
+PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc"
+PACKAGECONFIG[wayland] = ",,wayland"
+
+DRIDRIVERS = "swrast"
+DRIDRIVERS_append_x86 = ",radeon,r200,nouveau,i965,i915"
+DRIDRIVERS_append_x86-64 = ",radeon,r200,nouveau,i965,i915"
+PACKAGECONFIG[dri] = "--enable-dri --with-dri-drivers=${DRIDRIVERS}, --disable-dri, dri2proto libdrm"
+PACKAGECONFIG[dri3] = "--enable-dri3, --disable-dri3, dri3proto presentproto libxshmfence"
+
+EXTRA_OECONF += "--enable-gbm"
+
+PACKAGECONFIG[gles] = "--enable-gles1 --enable-gles2, --disable-gles1 --disable-gles2"
+
+EGL_PLATFORMS  = "drm"
+EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'x11', ',x11', '', d)}"
+EGL_PLATFORMS .="${@bb.utils.contains('PACKAGECONFIG', 'wayland', ',wayland', '', d)}"
+PACKAGECONFIG[egl] = "--enable-egl --with-egl-platforms=${EGL_PLATFORMS}, --disable-egl"
+
+GALLIUMDRIVERS = "swrast"
+GALLIUMDRIVERS_LLVM33 = "${@bb.utils.contains('PACKAGECONFIG', 'r600', 'radeonsi,r600', '', d)}"
+PACKAGECONFIG[r600] = ""
+GALLIUMDRIVERS_LLVM33_ENABLED = "${@base_version_less_or_equal('MESA_LLVM_RELEASE', '3.2', False, len('${GALLIUMDRIVERS_LLVM33}') > 0, d)}"
+GALLIUMDRIVERS_LLVM = "r300,svga,nouveau${@',${GALLIUMDRIVERS_LLVM33}' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
+GALLIUMDRIVERS_append_x86 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
+GALLIUMDRIVERS_append_x86-64 = "${@bb.utils.contains('PACKAGECONFIG', 'gallium-llvm', ',${GALLIUMDRIVERS_LLVM}', '', d)}"
+# keep --with-gallium-drivers separate, because when only one of gallium versions is enabled, other 2 were adding --without-gallium-drivers
+PACKAGECONFIG[gallium]      = "--with-gallium-drivers=${GALLIUMDRIVERS}, --without-gallium-drivers"
+MESA_LLVM_RELEASE ?= "3.3"
+PACKAGECONFIG[gallium-llvm] = "--enable-gallium-llvm --enable-llvm-shared-libs, --disable-gallium-llvm, llvm${MESA_LLVM_RELEASE} \
+                               ${@'elfutils' if ${GALLIUMDRIVERS_LLVM33_ENABLED} else ''}"
+export WANT_LLVM_RELEASE = "${MESA_LLVM_RELEASE}"
+PACKAGECONFIG[xa]  = "--enable-xa, --disable-xa"
+
+# llvmpipe is slow if compiled with -fomit-frame-pointer (e.g. -O2)
+FULL_OPTIMIZATION_append = " -fno-omit-frame-pointer"
+
+# Multiple virtual/gl providers being built breaks staging
+EXCLUDE_FROM_WORLD = "1"
+
+# Remove the mesa dependency on mesa-dev, as mesa is empty
+RDEPENDS_${PN}-dev = ""
+
+PACKAGES =+ "libegl-mesa libegl-mesa-dev \
+             libosmesa libosmesa-dev \
+             libgl-mesa libgl-mesa-dev \
+             libglapi libglapi-dev \
+             libgbm libgbm-dev \
+             libgles1-mesa libgles1-mesa-dev \
+             libgles2-mesa libgles2-mesa-dev \
+             libgles3-mesa libgles3-mesa-dev \
+             libwayland-egl libwayland-egl-dev \
+             libxvmcsoftpipe libxvmcsoftpipe-dev \
+             libxatracker libxatracker-dev \
+             mesa-megadriver \
+            "
+
+do_install_append () {
+    # Drivers never need libtool .la files
+    rm -f ${D}${libdir}/dri/*.la
+    rm -f ${D}${libdir}/egl/*.la
+    rm -f ${D}${libdir}/gallium-pipe/*.la
+    rm -f ${D}${libdir}/gbm/*.la
+    
+    # it was packaged in libdricore9.1.3-1 and preventing upgrades when debian.bbclass was used 
+    rm -f ${D}${sysconfdir}/drirc
+}
+
+# For the packages that make up the OpenGL interfaces, inject variables so that
+# they don't get Debian-renamed (which would remove the -mesa suffix), and
+# RPROVIDEs/RCONFLICTs on the generic libgl name.
+python __anonymous() {
+    pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
+    for p in (("egl", "libegl", "libegl1"),
+              ("dri", "libgl", "libgl1"),
+              ("gles", "libgles1", "libglesv1-cm1"),
+              ("gles", "libgles2", "libglesv2-2"),
+              ("gles", "libgles3",)):
+        if not p[0] in pkgconfig:
+            continue
+        fullp = p[1] + "-mesa"
+        pkgs = " ".join(p[1:])
+        d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
+        d.appendVar("RREPLACES_" + fullp, pkgs)
+        d.appendVar("RPROVIDES_" + fullp, pkgs)
+        d.appendVar("RCONFLICTS_" + fullp, pkgs)
+        
+        # For -dev, the first element is both the Debian and original name
+        fullp += "-dev"
+        pkgs = p[1] + "-dev"
+        d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1")
+        d.appendVar("RREPLACES_" + fullp, pkgs)
+        d.appendVar("RPROVIDES_" + fullp, pkgs)
+        d.appendVar("RCONFLICTS_" + fullp, pkgs)
+}
+
+python mesa_populate_packages() {
+    pkgs = ['mesa', 'mesa-dev', 'mesa-dbg']
+    for pkg in pkgs:
+        d.setVar("RPROVIDES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+        d.setVar("RCONFLICTS_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+        d.setVar("RREPLACES_%s" % pkg, pkg.replace("mesa", "mesa-dri", 1))
+
+    import re
+    dri_drivers_root = os.path.join(d.getVar('libdir', True), "dri")
+    dri_pkgs = os.listdir(d.getVar('PKGD', True) + dri_drivers_root)
+    lib_name = d.expand("${MLPREFIX}mesa-megadriver")
+    for p in dri_pkgs:
+        m = re.match('^(.*)_dri\.so$', p)
+        if m:
+            pkg_name = " ${MLPREFIX}mesa-driver-%s" % legitimize_package_name(m.group(1))
+            d.appendVar("RPROVIDES_%s" % lib_name, pkg_name)
+            d.appendVar("RCONFLICTS_%s" % lib_name, pkg_name)
+            d.appendVar("RREPLACES_%s" % lib_name, pkg_name)
+
+    pipe_drivers_root = os.path.join(d.getVar('libdir', True), "gallium-pipe")
+    do_split_packages(d, pipe_drivers_root, '^pipe_(.*)\.so$', 'mesa-driver-pipe-%s', 'Mesa %s pipe driver', extra_depends='')
+}
+
+PACKAGESPLITFUNCS_prepend = "mesa_populate_packages "
+
+PACKAGES_DYNAMIC += "^mesa-driver-.*"
+
+FILES_${PN}-dbg += "${libdir}/dri/.debug/*"
+FILES_${PN} += "${sysconfdir}/drirc"
+FILES_mesa-megadriver = "${libdir}/dri/*"
+FILES_libegl-mesa = "${libdir}/libEGL.so.*"
+FILES_libgbm = "${libdir}/libgbm.so.*"
+FILES_libgles1-mesa = "${libdir}/libGLESv1*.so.*"
+FILES_libgles2-mesa = "${libdir}/libGLESv2.so.*"
+FILES_libgl-mesa = "${libdir}/libGL.so.*"
+FILES_libglapi = "${libdir}/libglapi.so.*"
+FILES_libosmesa = "${libdir}/libOSMesa.so.*"
+FILES_libwayland-egl = "${libdir}/libwayland-egl.so.*"
+FILES_libxvmcsoftpipe = "${libdir}/libXvMCsoftpipe.so.*"
+FILES_libxatracker = "${libdir}/libxatracker.so.*"
+
+FILES_${PN}-dev = "${libdir}/pkgconfig/dri.pc"
+FILES_libegl-mesa-dev = "${libdir}/libEGL.* ${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc"
+FILES_libgbm-dev = "${libdir}/libgbm.* ${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h"
+FILES_libgl-mesa-dev = "${libdir}/libGL.* ${includedir}/GL ${libdir}/pkgconfig/gl.pc"
+FILES_libglapi-dev = "${libdir}/libglapi.*"
+FILES_libgles1-mesa-dev = "${libdir}/libGLESv1*.* ${includedir}/GLES ${libdir}/pkgconfig/glesv1*.pc"
+FILES_libgles2-mesa-dev = "${libdir}/libGLESv2.* ${includedir}/GLES2 ${libdir}/pkgconfig/glesv2.pc"
+FILES_libgles3-mesa-dev = "${includedir}/GLES3"
+FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/osmesa.h ${libdir}/pkgconfig/osmesa.pc"
+FILES_libwayland-egl-dev = "${libdir}/pkgconfig/wayland-egl.pc ${libdir}/libwayland-egl.*"
+FILES_libxvmcsoftpipe-dev = "${libdir}/libXvMCsoftpipe.so ${libdir}/libXvMCsoftpipe.la"
+FILES_libxatracker-dev = "${libdir}/libxatracker.so ${libdir}/libxatracker.la \
+                          ${includedir}/xa_tracker.h ${includedir}/xa_composite.h ${includedir}/xa_context.h \
+                          ${libdir}/pkgconfig/xatracker.pc"
+
+FILES_${PN}-dbg += "${libdir}/dri/.debug/* ${libdir}/egl/.debug/* ${libdir}/gbm/.debug/* ${libdir}/gallium-pipe/.debug"
diff --git a/meta/recipes-graphics/mesa/mesa_10.6.3.bb b/meta/recipes-graphics/mesa/mesa_10.6.3.bb
new file mode 100644
index 0000000..8c55064
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa_10.6.3.bb
@@ -0,0 +1,14 @@
+require ${BPN}.inc
+
+SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/mesa-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "553e525d2f20ed48fca8f1ec3176fd83"
+SRC_URI[sha256sum] = "58592e07c350cd2e8969b73fa83048c657a39fe2f13f3b88f5e5818fe2e4676d"
+
+#because we cannot rely on the fact that all apps will use pkgconfig,
+#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
+do_install_append() {
+    if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
+        sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
+    fi
+}
diff --git a/meta/recipes-graphics/mesa/mesa_git.bb b/meta/recipes-graphics/mesa/mesa_git.bb
new file mode 100644
index 0000000..c034517
--- /dev/null
+++ b/meta/recipes-graphics/mesa/mesa_git.bb
@@ -0,0 +1,22 @@
+require ${BPN}.inc
+
+DEFAULT_PREFERENCE = "-1"
+
+SRCREV = "ea0d1f575c214c09ba3df12644a960e86e031766"
+PV = "10.5.4+git${SRCPV}"
+
+SRC_URI = "git://anongit.freedesktop.org/git/mesa/mesa;branch=10.5"
+
+S = "${WORKDIR}/git"
+
+DEPENDS += "python-mako-native"
+
+inherit pythonnative
+
+#because we cannot rely on the fact that all apps will use pkgconfig,
+#make eglplatform.h independent of MESA_EGL_NO_X11_HEADER
+do_install_append() {
+    if ${@bb.utils.contains('PACKAGECONFIG', 'egl', 'true', 'false', d)}; then
+        sed -i -e 's/^#if defined(MESA_EGL_NO_X11_HEADERS)$/#if defined(MESA_EGL_NO_X11_HEADERS) || ${@bb.utils.contains('PACKAGECONFIG', 'x11', '0', '1', d)}/' ${D}${includedir}/EGL/eglplatform.h
+    fi
+}
diff --git a/meta/recipes-graphics/mini-x-session/files/mini-x-session b/meta/recipes-graphics/mini-x-session/files/mini-x-session
new file mode 100644
index 0000000..dca655a
--- /dev/null
+++ b/meta/recipes-graphics/mini-x-session/files/mini-x-session
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# Very simple session manager for Mini X
+#
+
+# Uncomment below to enable parsing of debian menu entrys
+# export MB_USE_DEB_MENUS=1 
+
+if [ -e $HOME/.mini_x/session ]
+then
+exec $HOME/.mini_x/session
+fi
+
+if [ -e /etc/mini_x/session ]
+then
+exec /etc/mini_x/session
+fi
+
+MINI_X_SESSION_DIR=/etc/mini_x/session.d
+if [ -d "$MINI_X_SESSION_DIR" ]; then
+	# Execute session file on behalf of file owner
+	find $MINI_X_SESSION_DIR -type f | while read SESSIONFILE; do
+		set +e
+		USERNAME=`stat -c %U $SESSIONFILE`
+		# Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211]
+#		su -l -c '$SESSIONFILE&' $USERNAME
+		sudo -b -i -u $USERNAME $SESSIONFILE&
+		set -e
+	done
+fi
+
+# This resolution is big enough for hob2's max window size.
+xrandr -s 1024x768
+
+# Default files to run if $HOME/.mini_x/session or /etc/mini_x/session
+# dont exist. 
+
+matchbox-terminal&
+exec matchbox-window-manager
diff --git a/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb b/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb
new file mode 100644
index 0000000..4e89d63
--- /dev/null
+++ b/meta/recipes-graphics/mini-x-session/mini-x-session_0.1.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Very simple session manager for X"
+HOMEPAGE = "http://www.yoctoproject.org"
+BUGTRACKER = "http://bugzilla.pokylinux.org"
+
+PR = "r4"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://mini-x-session;endline=5;md5=b6430bffbcf05f9760e72938826b7487"
+
+SECTION = "x11"
+RCONFLICTS_${PN} = "matchbox-common"
+
+SRC_URI = "file://mini-x-session"
+S = "${WORKDIR}"
+
+RDEPENDS_${PN} = "sudo"
+
+inherit update-alternatives
+
+ALTERNATIVE_${PN} = "x-session-manager"
+ALTERNATIVE_TARGET[x-session-manager] = "${bindir}/mini-x-session"
+ALTERNATIVE_PRIORITY = "50"
+
+do_install() {
+	install -d ${D}/${bindir}
+	install -m 0755 ${S}/mini-x-session ${D}/${bindir}
+}
diff --git a/meta/recipes-graphics/mx/mx-1.0/fix-build-dir.patch b/meta/recipes-graphics/mx/mx-1.0/fix-build-dir.patch
new file mode 100644
index 0000000..3c8a832
--- /dev/null
+++ b/meta/recipes-graphics/mx/mx-1.0/fix-build-dir.patch
@@ -0,0 +1,46 @@
+Fix build for S != B
+
+This patch is specific to version 1.4.x
+Upstream-Status: Submitted @ https://github.com/clutter-project/mx/issues/81
+Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
+--
+Index: git/docs/reference/libmx-gtk/Makefile.am
+===================================================================
+--- git.orig/docs/reference/libmx-gtk/Makefile.am	2013-05-08 15:07:02.027154788 +0100
++++ git/docs/reference/libmx-gtk/Makefile.am	2013-05-08 15:14:33.684318650 +0100
+@@ -1,3 +1,6 @@
++EXTRA_DIST=
++CLEANFILES=
++
+ ## Process this file with automake to produce Makefile.in
+ 
+ # We require automake 1.6 at least.
+@@ -77,7 +80,7 @@
+ GTKDOC_LIBS=$(MX_LIBS) $(top_builddir)/mx-gtk/libmx-gtk-$(MX_API_VERSION).la
+ 
+ # This includes the standard gtk-doc make rules, copied by gtkdocize.
+-include $(top_srcdir)/gtk-doc.make
++include $(top_builddir)/gtk-doc.make
+ 
+ # Other files to distribute
+ EXTRA_DIST += version.xml.in
+Index: git/docs/reference/libmx/Makefile.am
+===================================================================
+--- git.orig/docs/reference/libmx/Makefile.am	2013-05-08 15:07:02.027154788 +0100
++++ git/docs/reference/libmx/Makefile.am	2013-05-08 15:14:24.456378135 +0100
+@@ -1,3 +1,6 @@
++EXTRA_DIST=
++CLEANFILES=
++
+ ## Process this file with automake to produce Makefile.in
+ 
+ # We require automake 1.6 at least.
+@@ -106,7 +109,7 @@
+ GTKDOC_LIBS=$(MX_LIBS) $(top_builddir)/mx/libmx-$(MX_API_VERSION).la
+ 
+ # This includes the standard gtk-doc make rules, copied by gtkdocize.
+-include $(top_srcdir)/gtk-doc.make
++include $(top_builddir)/gtk-doc.make
+ 
+ # Other files to distribute
+ EXTRA_DIST += version.xml.in
diff --git a/meta/recipes-graphics/mx/mx-1.0/fix-test-includes.patch b/meta/recipes-graphics/mx/mx-1.0/fix-test-includes.patch
new file mode 100644
index 0000000..82c93dd
--- /dev/null
+++ b/meta/recipes-graphics/mx/mx-1.0/fix-test-includes.patch
@@ -0,0 +1,20 @@
+Fix missing include directory when building tests
+
+This patch is currently required for all versions of mx
+Upstream-Status: Submitted @ https://github.com/clutter-project/mx/issues/82
+Signed-off-by: Tomas Frydrych <tomas@sleepfive.com>
+--
+Index: git/tests/Makefile.am
+===================================================================
+--- git.orig/tests/Makefile.am	2013-05-08 15:18:56.918596425 +0100
++++ git/tests/Makefile.am	2013-05-08 15:23:26.864781401 +0100
+@@ -10,7 +10,8 @@
+ 
+ INCLUDES = \
+ 	-I$(top_srcdir) \
+-	-I$(top_builddir)
++	-I$(top_builddir)\
++	-I$(top_builddir)/mx
+ 
+ noinst_PROGRAMS = 			\
+ 	test-deform-texture		\
diff --git a/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb b/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb
new file mode 100644
index 0000000..ce35b61
--- /dev/null
+++ b/meta/recipes-graphics/mx/mx-1.0_1.4.7.bb
@@ -0,0 +1,14 @@
+require mx.inc
+
+# The 1.4.7 tag does not build against cogl 1.14, pull in a revision with a fix
+SRCREV = "9b1db6b8060bd00b121a692f942404a24ae2960f"
+PV = "1.4.7+git${SRCPV}"
+
+SRC_URI = "git://github.com/clutter-project/mx.git;branch=mx-1.4 \
+	   file://fix-build-dir.patch \
+	   file://fix-test-includes.patch \
+	  "
+S = "${WORKDIR}/git"
+
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \
+                    file://mx/mx-widget.c;beginline=8;endline=20;md5=13bba3c973a72414a701e1e87b5ee879"
diff --git a/meta/recipes-graphics/mx/mx.inc b/meta/recipes-graphics/mx/mx.inc
new file mode 100644
index 0000000..ee7f186
--- /dev/null
+++ b/meta/recipes-graphics/mx/mx.inc
@@ -0,0 +1,21 @@
+SUMMARY = "Clutter based UI widget library"
+LICENSE = "LGPLv2.1"
+
+inherit clutter autotools-brokensep
+
+DEPENDS = "clutter-1.0 dbus-glib gdk-pixbuf"
+
+SRC_URI = "http://source.clutter-project.org/sources/mx/${@get_verdir("${PV}")}/mx-${PV}.tar.xz"
+
+EXTRA_OECONF = "--disable-introspection		\
+	        --disable-gtk-doc		\
+	        --disable-gtk-widgets		\
+		--with-dbus			\
+		--with-winsys=none		\
+		--without-clutter-imcontext	\
+		--without-clutter-gesture	\
+		--without-startup-notification	\
+		--without-glade			\
+	       "
+
+FILES_${PN} += "${datadir}"
diff --git a/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb b/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb
new file mode 100644
index 0000000..9d67e5f
--- /dev/null
+++ b/meta/recipes-graphics/packagegroups/packagegroup-core-clutter.bb
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2007 OpenedHand Ltd.
+#
+
+SUMMARY = "Clutter package groups"
+LICENSE = "MIT"
+
+PR = "r6"
+
+inherit packagegroup
+
+PACKAGES = "\
+    ${PN}-core \
+    "
+
+SUMMARY_${PN}-core = "Clutter graphics library"
+RDEPENDS_${PN}-core = "\
+    clutter-1.0 \
+    clutter-gst-3.0 \
+    clutter-gtk-1.0 \
+    "
diff --git a/meta/recipes-graphics/packagegroups/packagegroup-core-directfb.bb b/meta/recipes-graphics/packagegroups/packagegroup-core-directfb.bb
new file mode 100644
index 0000000..53dc0ae
--- /dev/null
+++ b/meta/recipes-graphics/packagegroups/packagegroup-core-directfb.bb
@@ -0,0 +1,17 @@
+SUMMARY = "DirectFB without X11"
+LICENSE = "MIT"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup
+
+TOUCH = ' ${@bb.utils.contains("MACHINE_FEATURES", "touchscreen", "tslib tslib-calibrate tslib-tests", "",d)}'
+
+RDEPENDS_${PN} = " \
+		directfb \
+		directfb-examples \
+		pango \
+		pango-modules \
+		fontconfig \
+		${TOUCH} \
+"
diff --git a/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb b/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb
new file mode 100644
index 0000000..17301a0
--- /dev/null
+++ b/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Basic X11 session"
+DESCRIPTION = "Packages required to set up a basic working X11 session"
+LICENSE = "MIT"
+PR = "r1"
+
+inherit packagegroup distro_features_check
+# rdepends on matchbox-wm
+REQUIRED_DISTRO_FEATURES = "x11"
+
+RDEPENDS_${PN} = "\
+    packagegroup-core-x11-xserver \
+    packagegroup-core-x11-utils \
+    dbus \
+    pointercal \
+    matchbox-terminal \
+    matchbox-wm \
+    mini-x-session \
+    liberation-fonts \
+    "
diff --git a/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb b/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb
new file mode 100644
index 0000000..c53f1b7
--- /dev/null
+++ b/meta/recipes-graphics/packagegroups/packagegroup-core-x11-xserver.bb
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2011 Intel Corporation
+#
+
+SUMMARY = "X11 display server"
+LICENSE = "MIT"
+PR = "r40"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup distro_features_check
+# rdepends on XSERVER
+REQUIRED_DISTRO_FEATURES = "x11"
+
+XSERVER ?= "xserver-xorg xf86-video-fbdev xf86-input-evdev"
+XSERVERCODECS ?= ""
+
+RDEPENDS_${PN} = "\
+    ${XSERVER} \
+    ${XSERVERCODECS} \
+    "
diff --git a/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb b/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
new file mode 100644
index 0000000..3537d8c
--- /dev/null
+++ b/meta/recipes-graphics/packagegroups/packagegroup-core-x11.bb
@@ -0,0 +1,34 @@
+#
+# Copyright (C) 2011 Intel Corporation
+#
+
+LICENSE = "MIT"
+PR = "r40"
+
+inherit packagegroup distro_features_check
+# rdepends on x11-common
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGES = "${PN} ${PN}-utils"
+
+# xserver-common, x11-common
+VIRTUAL-RUNTIME_xserver_common ?= "x11-common"
+
+# elsa, xserver-nodm-init
+VIRTUAL-RUNTIME_graphical_init_manager ?= "xserver-nodm-init"
+
+SUMMARY = "X11 display server and basic utilities"
+RDEPENDS_${PN} = "\
+    ${PN}-xserver \
+    ${PN}-utils \
+    "
+
+SUMMARY_${PN}-utils = "X11 basic utilities and init"
+RDEPENDS_${PN}-utils = "\
+    ${VIRTUAL-RUNTIME_xserver_common} \
+    ${VIRTUAL-RUNTIME_graphical_init_manager} \
+    xauth \
+    xhost \
+    xset \
+    xrandr \
+    "
diff --git a/meta/recipes-graphics/pango/pango.inc b/meta/recipes-graphics/pango/pango.inc
new file mode 100644
index 0000000..df0fdf6
--- /dev/null
+++ b/meta/recipes-graphics/pango/pango.inc
@@ -0,0 +1,99 @@
+SUMMARY = "Framework for layout and rendering of internationalized text"
+DESCRIPTION = "Pango is a library for laying out and rendering of text, \
+with an emphasis on internationalization. Pango can be used anywhere \
+that text layout is needed, though most of the work on Pango so far has \
+been done in the context of the GTK+ widget toolkit. Pango forms the \
+core of text and font handling for GTK+-2.x."
+HOMEPAGE = "http://www.pango.org/"
+BUGTRACKER = "http://bugzilla.gnome.org"
+SECTION = "libs"
+LICENSE = "LGPLv2.0+"
+
+X11DEPENDS = "virtual/libx11 libxft"
+DEPENDS = "glib-2.0 fontconfig freetype zlib virtual/libiconv cairo harfbuzz qemu-native"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'ptest', '', d)}"
+
+PACKAGECONFIG[x11] = "--with-xft,--without-xft,${X11DEPENDS}"
+PACKAGECONFIG[ptest] = "--enable-installed-tests,--disable-installed-tests,glib-2.0-native"
+
+BBCLASSEXTEND = "native"
+DEPENDS_class-native = "glib-2.0-native cairo-native harfbuzz-native"
+
+PACKAGES_DYNAMIC += "^pango-module-.*"
+
+RRECOMMENDS_${PN} = "pango-module-basic-fc"
+
+inherit gnomebase gtk-doc qemu ptest
+
+# Create a pango-modules package
+ALLOW_EMPTY_${BPN}-modules = "1"
+PACKAGES += "${BPN}-modules"
+RRECOMMENDS_${BPN}-modules =  "${@" ".join([p for p in d.getVar('PACKAGES', True).split() if p.find("pango-module") != -1])}"
+
+
+EXTRA_AUTORECONF = ""
+
+# seems to go wrong with default cflags
+FULL_OPTIMIZATION_arm = "-O2"
+
+EXTRA_OECONF = "--disable-introspection \
+		--enable-explicit-deps=no \
+	        --disable-debug \
+	        --with-mlprefix=${MLPREFIX}"
+
+LEAD_SONAME = "libpango-1.0*"
+LIBV = "1.8.0"
+
+pango_postinst() {
+if ! [ -e $D${sysconfdir}/pango ] ; then
+	mkdir -p $D${sysconfdir}/pango
+fi
+
+if [ -n "$D" ]; then
+	${@qemu_run_binary(d, '$D','${bindir}/${MLPREFIX}pango-querymodules')} \
+		$D${libdir}/pango/${LIBV}/modules/*.so \
+		> $D${sysconfdir}/pango/${MLPREFIX}pango.modules 2>/dev/null
+
+	[ $? -ne 0 ] && exit 1
+
+	sed -i -e "s:$D::" $D${sysconfdir}/pango/${MLPREFIX}pango.modules
+
+	exit 0
+else
+	${bindir}/${MLPREFIX}pango-querymodules > /etc/pango/${MLPREFIX}pango.modules
+fi
+}
+
+# This binary needs to be compiled for the host architecture.  This isn't pretty!
+do_compile_prepend () {
+	if ${@base_contains('DISTRO_FEATURES', 'ptest', 'true', 'false', d)}; then
+		make CC="${BUILD_CC}" CFLAGS="" AM_CPPFLAGS="$(pkg-config-native --cflags glib-2.0)" gen_all_unicode_LDADD="$(pkg-config-native --libs glib-2.0)" -C ${B}/tests gen-all-unicode
+	fi
+}
+
+do_install_append () {
+	if [ "${MLPREFIX}" != "" ]; then
+		mv ${D}/${bindir}/pango-querymodules ${D}/${bindir}/${MLPREFIX}pango-querymodules 
+	fi
+}
+
+
+python populate_packages_prepend () {
+    pango_postinst = d.getVar("pango_postinst", True)
+
+    modules_root = d.expand('${libdir}/pango/${LIBV}/modules')
+
+    do_split_packages(d, modules_root, '^pango-(.*)\.so$', 'pango-module-%s', 'Pango module %s', pango_postinst)
+}
+
+FILES_${PN} = "${sysconfdir}/pango/* ${bindir}/* ${libdir}/libpango*${SOLIBS}"
+FILES_${PN}-dbg += "${libdir}/pango/${LIBV}/modules/.debug"
+FILES_${PN}-dev += "${libdir}/pango/${LIBV}/modules/*.la"
+
+FILES_${PN}-ptest += "${libexecdir}/installed-tests/* \
+                      ${datadir}/installed-tests/pango"
+FILES_${PN}-dbg += "${libexecdir}/installed-tests/.debug"
+
+RDEPENDS_${PN}-ptest += "gnome-desktop-testing liberation-fonts"
diff --git a/meta/recipes-graphics/pango/pango/multilib-fix-clean.patch b/meta/recipes-graphics/pango/pango/multilib-fix-clean.patch
new file mode 100644
index 0000000..ad414dd
--- /dev/null
+++ b/meta/recipes-graphics/pango/pango/multilib-fix-clean.patch
@@ -0,0 +1,75 @@
+Upstream-Status: Pending
+
+Updated to apply to pango-1.32.5
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd pango-1.32.5/configure.ac pango-1.32.5/configure.ac
+--- pango-1.32.5/configure.ac	2012-12-07 04:43:25.000000000 +0200
++++ pango-1.32.5/configure.ac	2013-01-09 08:27:40.328516792 +0200
+@@ -213,6 +213,11 @@
+
+ AC_SUBST(PANGO_DEBUG_FLAGS)
+
++AC_ARG_WITH(mlprefix,
++            AC_HELP_STRING([--with-mlprefix=<ARG>], [multilib prefix]),
++            mlprefix_str=$withval, mlprefix_str="")
++AC_DEFINE_UNQUOTED([MLPREFIX], ["$mlprefix_str"], [multilib prefix.])
++
+ AC_ARG_ENABLE(rebuilds,
+               [AC_HELP_STRING([--disable-rebuilds],
+                               [disable all source autogeneration rules])],,
+diff -Nurd pango-1.32.5/pango/modules.c pango-1.32.5/pango/modules.c
+--- pango-1.32.5/pango/modules.c	2012-12-17 20:27:56.000000000 +0200
++++ pango-1.32.5/pango/modules.c	2013-01-09 08:31:16.336512052 +0200
+@@ -555,11 +555,11 @@
+       files = g_new (char *, 3);
+
+       files[0] = g_build_filename (pango_get_sysconf_subdirectory (),
+-                                   "pango.modules",
++                                   MLPREFIX "pango.modules",
+                                    NULL);
+       files[1] = g_build_filename (pango_get_lib_subdirectory (),
+                                    MODULE_VERSION,
+-                                   "modules.cache",
++                                   MLPREFIX "modules.cache",
+                                    NULL);
+       files[2] = NULL;
+     }
+@@ -674,7 +674,8 @@
+       if (!no_module_warning)
+	{
+	  gchar *filename = g_build_filename (pango_get_sysconf_subdirectory (),
+-					      "pango.modules",
++/* For multilib case, keep multiple config file for different libs */
++					      MLPREFIX "pango.modules",
+					      NULL);
+	  g_critical ("No modules found:\n"
+		      "No builtin or dynamically loaded modules were found.\n"
+diff -Nurd pango-1.32.5/pango/modules.c.rej pango-1.32.5/pango/modules.c.rej
+--- pango-1.32.5/pango/modules.c.rej	1970-01-01 02:00:00.000000000 +0200
++++ pango-1.32.5/pango/modules.c.rej	2013-01-09 08:27:40.328516792 +0200
+@@ -0,0 +1,12 @@
++--- pango/modules.c	2010-09-22 03:37:01.000000000 +0800
+++++ pango/modules.c	2012-05-08 21:21:02.000000000 +0800
++@@ -529,7 +529,8 @@
++
++   if (!file_str)
++     file_str = g_build_filename (pango_get_sysconf_subdirectory (),
++-				 "pango.modules",
+++/* For multilib case, keep multiple config file for different libs */
+++				 MLPREFIX "pango.modules",
++ 				 NULL);
++
++   files = pango_split_file_list (file_str);
+diff -Nurd pango-1.32.5/pango/querymodules.c pango-1.32.5/pango/querymodules.c
+--- pango-1.32.5/pango/querymodules.c	2012-08-28 15:27:18.000000000 +0300
++++ pango-1.32.5/pango/querymodules.c	2013-01-09 08:31:47.828511359 +0200
+@@ -304,7 +304,7 @@
+
+       cache_file = g_build_filename (pango_get_lib_subdirectory (),
+                                      MODULE_VERSION,
+-                                     "modules.cache",
++                                     MLPREFIX "modules.cache",
+                                      NULL);
+       err = NULL;
+       if (!g_file_set_contents (cache_file, contents->str, -1, &err))
diff --git a/meta/recipes-graphics/pango/pango/run-ptest b/meta/recipes-graphics/pango/pango/run-ptest
new file mode 100644
index 0000000..fa87a75
--- /dev/null
+++ b/meta/recipes-graphics/pango/pango/run-ptest
@@ -0,0 +1,3 @@
+#! /bin/sh
+
+gnome-desktop-testing-runner pango
diff --git a/meta/recipes-graphics/pango/pango_1.36.8.bb b/meta/recipes-graphics/pango/pango_1.36.8.bb
new file mode 100644
index 0000000..f4e4250
--- /dev/null
+++ b/meta/recipes-graphics/pango/pango_1.36.8.bb
@@ -0,0 +1,10 @@
+require pango.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
+
+SRC_URI += "file://run-ptest \
+            file://multilib-fix-clean.patch \
+"
+
+SRC_URI[archive.md5sum] = "217a9a753006275215fa9fa127760ece"
+SRC_URI[archive.sha256sum] = "18dbb51b8ae12bae0ab7a958e7cf3317c9acfc8a1e1103ec2f147164a0fc2d07"
diff --git a/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-missing-include-of-Xutil.h.patch b/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-missing-include-of-Xutil.h.patch
new file mode 100644
index 0000000..c27cc04
--- /dev/null
+++ b/meta/recipes-graphics/piglit/piglit/0001-tests-Fix-missing-include-of-Xutil.h.patch
@@ -0,0 +1,28 @@
+Upstream-Status: Backport
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+From e40e0a25f996d2e205c4bdec2c8a5cc7f74e5065 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Mon, 15 Jun 2015 16:25:30 -0300
+Subject: tests: Fix missing include of Xutil.h
+
+The EGL tests rely on Xutil.h being included. Some EGL implementation
+does not explitly include it by default and then the build fails.
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+Reviewed-by: Neil Roberts <neil@linux.intel.com>
+
+diff --git a/tests/egl/egl-configless-context.c b/tests/egl/egl-configless-context.c
+index 0504a26..154b55c 100644
+--- a/tests/egl/egl-configless-context.c
++++ b/tests/egl/egl-configless-context.c
+@@ -32,6 +32,7 @@
+ /* Chunks of code in this file are taken from egl-util.c */
+ 
+ #include <X11/Xlib.h>
++#include <X11/Xutil.h>
+ 
+ #include "piglit-util-gl.h"
+ #include "piglit-util-egl.h"
+-- 
+cgit v0.10.2
diff --git a/meta/recipes-graphics/piglit/piglit_git.bb b/meta/recipes-graphics/piglit/piglit_git.bb
new file mode 100644
index 0000000..0d825c9
--- /dev/null
+++ b/meta/recipes-graphics/piglit/piglit_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "OpenGL driver testing framework"
+LICENSE = "MIT & LGPLv2+ & GPLv3 & GPLv2+ & BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b2beded7103a3d8a442a2a0391d607b0"
+
+SRC_URI = "git://anongit.freedesktop.org/piglit \
+           file://0001-tests-Fix-missing-include-of-Xutil.h.patch"
+
+# From 2014/12/04
+SRCREV = "126c7d049b8f32e541625d5a35fbc5f5e4e7fbf8"
+# (when PV goes above 1.0 remove the trailing r)
+PV = "1.0+gitr${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+DEPENDS = "virtual/libx11 libxrender waffle virtual/libgl libglu python-mako-native python-numpy-native"
+
+inherit cmake pythonnative distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[freeglut] = "-DPIGLIT_USE_GLUT=1,-DPIGLIT_USE_GLUT=0,freeglut,"
+
+do_configure_prepend() {
+   if [ "${@bb.utils.contains('PACKAGECONFIG', 'freeglut', 'yes', 'no', d)}" = "no" ]; then
+        sed -i -e "/^#.*include <GL\/freeglut_ext.h>$/d" ${S}/src/piglit/glut_wrap.h
+        sed -i -e "/^#.*include.*<GL\/glut.h>$/d" ${S}/src/piglit/glut_wrap.h
+   fi
+}
+
+FILES_${PN}-dbg += "${libdir}/piglit/*/.debug/"
+
+RDEPENDS_${PN} = "waffle python python-mako python-json python-subprocess \
+	python-argparse python-importlib python-unixadmin \
+	python-multiprocessing python-textutils python-netserver python-shell \
+	mesa-demos bash \
+	"
+
+INSANE_SKIP_${PN} += "dev-so"
diff --git a/meta/recipes-graphics/pong-clock/pong-clock/pong-clock-no-flicker.c b/meta/recipes-graphics/pong-clock/pong-clock/pong-clock-no-flicker.c
new file mode 100644
index 0000000..41cebc5
--- /dev/null
+++ b/meta/recipes-graphics/pong-clock/pong-clock/pong-clock-no-flicker.c
@@ -0,0 +1,410 @@
+/*
+ * Pong Clock - A clock that plays pong. 
+ *             See http://mocoloco.com/archives/001766.php for the inspiration.
+ *
+ * Copyright (C) 2005 Matthew Allum
+ *
+ * Author: Matthew Allum mallum@openedhand.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <stdlib.h>
+#include <time.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <signal.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xatom.h>
+
+/* Tweak values for different hw setups */
+
+#define FPS          50
+#define RESX         40
+#define RESY         40
+#define TO_MISS_SECS 55
+#define BALLDX       16
+#define BALLDY       4
+
+
+typedef struct PongClock
+{
+  Display *xdpy;
+  int      xscreen;
+  Window   xwin, xwin_root;
+  Pixmap   backbuffer;
+  GC       xgc;
+  int      xwin_width, xwin_height;
+  int      pixelw, pixelh;
+
+  int      ball_x, ball_y, ball_dx, ball_dy;
+  int      bata_y, batb_y;
+  Bool     bata_to_miss, batb_to_miss;
+
+} 
+PongClock;
+
+void
+get_time(int *hour, int *min, int *sec)
+{
+  struct timeval   tv;
+  struct tm       *localTime = NULL; 
+  time_t           actualTime;
+
+  gettimeofday(&tv, 0);
+  actualTime = tv.tv_sec;
+  localTime = localtime(&actualTime);
+
+  if (hour)
+    *hour = localTime->tm_hour;
+  
+  if (min)
+    *min  = localTime->tm_min;
+
+  if (sec)
+    *sec  = localTime->tm_sec;
+}
+
+void
+draw_rect (PongClock *pong_clock, 
+	   int        x,
+	   int        y,
+	   int        width,
+	   int        height)
+{
+  XFillRectangle (pong_clock->xdpy,
+		  pong_clock->backbuffer,
+		  pong_clock->xgc,
+		  x * pong_clock->pixelw,
+		  y * pong_clock->pixelh,
+		  width * pong_clock->pixelw,
+		  height * pong_clock->pixelh);
+}
+
+void
+draw_field (PongClock *pong_clock)
+{
+  int i;
+
+  draw_rect (pong_clock, 0, 0, RESX+1, 1);  
+  draw_rect (pong_clock, 0, RESY-1, RESX+1, 1);  
+
+  for (i=0; i < RESY/2; i++)
+    draw_rect (pong_clock, (RESX/2)-1, i*2, 2, 1);  
+}
+
+void
+draw_digit (PongClock *pong_clock, 
+	    int        x,
+	    int        y,
+	    int        digit)
+{
+  int digits[] = { 0x1f8c63f, 0x1f21086, 0x1f0fe1f, 0x1f87e1f, 0x1087e31,
+		   0x1f87c3f, 0x1f8fc3f, 0x84421f,  0x1f8fe3f, 0x1087e3f };
+
+  XRectangle rects[5*5];
+  int i,j,k;
+
+  i = 0;
+
+  for (k=0; k<5; k++) 
+    for (j=0; j<5; j++)	
+      if (digits[digit] & (1 << ((k*5)+j)))
+	{
+	  rects[i].x      = (x + j) * pong_clock->pixelw; 
+	  rects[i].y      = (y + k) * pong_clock->pixelh; 
+	  rects[i].width  = pong_clock->pixelw;
+	  rects[i].height = pong_clock->pixelh;  
+	  i++;
+	}
+
+  XFillRectangles (pong_clock->xdpy,
+		   pong_clock->backbuffer,
+		   pong_clock->xgc,
+		   rects, i);
+} 
+
+void
+draw_time (PongClock *pong_clock)
+{
+  int hour, min;
+
+  get_time(&hour, &min, NULL);
+
+  draw_digit (pong_clock, 
+	      (RESX/2) - 14,
+	      5,
+	      hour / 10 );
+
+  draw_digit (pong_clock, 
+	      (RESX/2) - 8,
+	      5,
+	      hour % 10 );
+
+  draw_digit (pong_clock, 
+	      (RESX/2) + 3,
+	      5,
+	      min / 10 );
+
+  draw_digit (pong_clock, 
+	      (RESX/2) + 9,
+	      5,
+	      min % 10 );
+}
+
+void
+draw_bat_and_ball (PongClock *pong_clock)
+{
+  /* ball */
+
+  XFillRectangle (pong_clock->xdpy,
+		  pong_clock->backbuffer,
+		  pong_clock->xgc,
+		  pong_clock->ball_x,
+		  pong_clock->ball_y,
+		  pong_clock->pixelw,
+		  pong_clock->pixelh);
+
+  /* bat a */
+
+  XFillRectangle (pong_clock->xdpy,
+		  pong_clock->backbuffer,
+		  pong_clock->xgc,
+		  0,
+		  pong_clock->bata_y - (2 * pong_clock->pixelh),
+		  pong_clock->pixelw,
+		  pong_clock->pixelh * 5);
+
+  /* bat b */
+
+  XFillRectangle (pong_clock->xdpy,
+		  pong_clock->backbuffer,
+		  pong_clock->xgc,
+		  (pong_clock->xwin_width - pong_clock->pixelw),
+		  pong_clock->batb_y - (2 * pong_clock->pixelh),
+		  pong_clock->pixelw,
+		  pong_clock->pixelh * 5);
+
+}
+
+void
+update_state (PongClock *pong_clock)
+{
+  int sec, min, hour;
+
+  get_time(&hour, &min, &sec);
+
+  /* Check ball is on field and no ones dues to miss a shot.
+  */
+  if ( (pong_clock->ball_x < 0 && !pong_clock->bata_to_miss) 
+      || (pong_clock->ball_x > (pong_clock->xwin_width - pong_clock->pixelw)
+	  && !pong_clock->batb_to_miss) )
+    pong_clock->ball_dx *= -1;
+
+  if ((pong_clock->ball_y < pong_clock->pixelh)
+      || pong_clock->ball_y > (pong_clock->xwin_height - (2*pong_clock->pixelh)))
+    pong_clock->ball_dy *= -1; 
+
+  pong_clock->ball_x += pong_clock->ball_dx;
+  pong_clock->ball_y += pong_clock->ball_dy;
+
+  /* Set up someone to miss if we getting close to an hour or min. 
+   */
+  if (sec > TO_MISS_SECS)
+    {
+      if (min == 59)
+	pong_clock->batb_to_miss = True;	
+      else
+	pong_clock->bata_to_miss = True;
+    }
+  else
+    {
+      /* Reset the game */
+      if (pong_clock->bata_to_miss)
+	{
+	  pong_clock->bata_to_miss = False;
+	  pong_clock->ball_y = pong_clock->bata_y; 
+	  pong_clock->ball_x = pong_clock->pixelw; 
+	  pong_clock->ball_dx *= -1;
+	}
+
+      if (pong_clock->batb_to_miss)
+	{
+	  pong_clock->batb_to_miss = False;
+	  pong_clock->ball_y = pong_clock->batb_y; 
+	  pong_clock->ball_x = pong_clock->xwin_width - pong_clock->pixelw;
+	  pong_clock->ball_dx *= -1; 
+	}
+    }
+
+  /* Keep bats on field and only move in not setup to miss */
+  if (pong_clock->ball_y >= (3*pong_clock->pixelh)
+      && pong_clock->ball_y <=  (pong_clock->xwin_height - (5*pong_clock->pixelh)))
+  {
+    if (!pong_clock->batb_to_miss) 
+      pong_clock->batb_y = pong_clock->ball_y;
+
+    if (!pong_clock->bata_to_miss)
+      pong_clock->bata_y = pong_clock->ball_y;
+  }
+}
+
+void
+draw_frame (PongClock *pong_clock)
+{
+  update_state (pong_clock);
+
+  /* Clear playfield */
+  XSetForeground (pong_clock->xdpy,
+		  pong_clock->xgc,
+		  BlackPixel(pong_clock->xdpy, 
+			     pong_clock->xscreen));
+
+  XFillRectangle (pong_clock->xdpy,
+		  pong_clock->backbuffer,
+		  pong_clock->xgc,
+		  0, 0,
+		  pong_clock->xwin_width, 
+		  pong_clock->xwin_height);
+
+  XSetForeground (pong_clock->xdpy,
+		  pong_clock->xgc,
+		  WhitePixel(pong_clock->xdpy, 
+			     pong_clock->xscreen));
+
+  draw_field (pong_clock);
+
+  draw_time (pong_clock);
+
+  draw_bat_and_ball (pong_clock);
+
+  /* flip 'backbuffer' */
+  XSetWindowBackgroundPixmap (pong_clock->xdpy, 
+			      pong_clock->xwin,
+			      pong_clock->backbuffer);
+  XClearWindow(pong_clock->xdpy, pong_clock->xwin);
+
+  XSync(pong_clock->xdpy, False);
+}
+
+int
+main (int argc, char **argv)
+{
+  XGCValues  gcv;
+  Atom       atoms_WINDOW_STATE, atoms_WINDOW_STATE_FULLSCREEN;
+  PongClock *pong_clock;
+
+  pong_clock = malloc(sizeof(PongClock));
+  memset(pong_clock, 0, sizeof(PongClock));
+
+  if ((pong_clock->xdpy = XOpenDisplay(getenv("DISPLAY"))) == NULL) {
+    fprintf(stderr, "Cannot connect to X server on display %s.",
+	    getenv("DISPLAY"));
+    exit(-1);
+  }
+
+  pong_clock->xscreen     = DefaultScreen(pong_clock->xdpy);
+  pong_clock->xwin_root   = DefaultRootWindow(pong_clock->xdpy);
+  pong_clock->xwin_width  = DisplayWidth(pong_clock->xdpy, 
+					 pong_clock->xscreen);
+  pong_clock->xwin_height = DisplayHeight(pong_clock->xdpy, 
+					  pong_clock->xscreen);
+
+  pong_clock->pixelw  = pong_clock->xwin_width  / RESX;
+  pong_clock->pixelh  = pong_clock->xwin_height / RESY;
+
+  pong_clock->ball_x = 0; 
+  pong_clock->ball_y = pong_clock->xwin_height / 2; 
+
+  pong_clock->ball_dx = BALLDX; 
+  pong_clock->ball_dy = BALLDY; 
+
+  pong_clock->batb_y = pong_clock->bata_y = pong_clock->ball_y;
+
+  gcv.background = BlackPixel(pong_clock->xdpy, 
+			      pong_clock->xscreen);
+  gcv.foreground = WhitePixel(pong_clock->xdpy, 
+			      pong_clock->xscreen);
+  gcv.graphics_exposures = False;
+
+  pong_clock->xgc = XCreateGC (pong_clock->xdpy, pong_clock->xwin_root, 
+			       GCForeground|GCBackground|GCGraphicsExposures,
+			       &gcv);
+
+  atoms_WINDOW_STATE
+    = XInternAtom(pong_clock->xdpy, "_NET_WM_STATE",False);
+  atoms_WINDOW_STATE_FULLSCREEN
+    = XInternAtom(pong_clock->xdpy, "_NET_WM_STATE_FULLSCREEN",False);
+
+  pong_clock->xwin = XCreateSimpleWindow(pong_clock->xdpy, 
+					 pong_clock->xwin_root, 
+					 0, 0,
+					 pong_clock->xwin_width, 
+					 pong_clock->xwin_height, 
+					 0,
+					 WhitePixel(pong_clock->xdpy, 
+						    pong_clock->xscreen),
+					 BlackPixel(pong_clock->xdpy, 
+						    pong_clock->xscreen));
+
+  pong_clock->backbuffer = XCreatePixmap(pong_clock->xdpy, 
+					 pong_clock->xwin_root,
+					 pong_clock->xwin_width, 
+					 pong_clock->xwin_height, 
+					 DefaultDepth(pong_clock->xdpy, 
+						      pong_clock->xscreen));
+
+  XSelectInput(pong_clock->xdpy, pong_clock->xwin, KeyPressMask);
+  
+
+  /* Set the hints for fullscreen */
+  XChangeProperty(pong_clock->xdpy, 
+		  pong_clock->xwin, 
+		  atoms_WINDOW_STATE, 
+		  XA_ATOM, 
+		  32, 
+		  PropModeReplace, 
+		  (unsigned char *) &atoms_WINDOW_STATE_FULLSCREEN, 1);
+
+  XMapWindow(pong_clock->xdpy, pong_clock->xwin);
+  
+  while (True) 
+    {
+      struct timeval timeout;
+      XEvent         xev;
+
+      timeout.tv_sec  = 0;
+      timeout.tv_usec = 1000000 / FPS; 
+      select (0, NULL, NULL, NULL, &timeout);
+
+      draw_frame (pong_clock);
+
+      XFlush(pong_clock->xdpy);
+
+      if (XPending(pong_clock->xdpy))
+	{
+	  if (XCheckMaskEvent(pong_clock->xdpy, 
+			      KeyPressMask,
+			      &xev))
+	    exit(-1);
+	}
+    }
+}
diff --git a/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb b/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb
new file mode 100644
index 0000000..0e1a792
--- /dev/null
+++ b/meta/recipes-graphics/pong-clock/pong-clock_1.0.bb
@@ -0,0 +1,22 @@
+SUMMARY = "A clock combined with a game of pong"
+LICENSE = "GPLv2+"
+DEPENDS = "virtual/libx11 xdmcp xau"
+
+inherit distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "file://pong-clock-no-flicker.c"
+
+LIC_FILES_CHKSUM = "file://pong-clock-no-flicker.c;beginline=1;endline=23;md5=dd248d50f73f746d1ee78586b0b2ebd3"
+
+S = "${WORKDIR}"
+
+do_compile () {
+	${CC} -o pong-clock pong-clock-no-flicker.c `pkg-config --cflags --libs x11 xau xdmcp`
+}
+
+do_install () {
+	install -d ${D}${bindir}
+	install -m 0755 pong-clock ${D}${bindir}
+}
diff --git a/meta/recipes-graphics/startup-notification/startup-notification-0.12/obsolete_automake_macros.patch b/meta/recipes-graphics/startup-notification/startup-notification-0.12/obsolete_automake_macros.patch
new file mode 100644
index 0000000..9e86f2b
--- /dev/null
+++ b/meta/recipes-graphics/startup-notification/startup-notification-0.12/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [https://bugs.freedesktop.org/show_bug.cgi?id=59097]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd startup-notification-0.12/configure.in startup-notification-0.12/configure.in
+--- startup-notification-0.12/configure.in	2011-05-16 17:29:20.000000000 +0300
++++ startup-notification-0.12/configure.in	2013-01-07 06:00:48.921905409 +0200
+@@ -3,7 +3,7 @@
+ AC_CONFIG_SRCDIR(libsn/sn-launchee.c)
+
+ AM_INIT_AUTOMAKE
+-AM_CONFIG_HEADER(config.h)
++AC_CONFIG_HEADERS(config.h)
+
+ # Honor aclocal flags
+ AC_SUBST(ACLOCAL_AMFLAGS, "\${ACLOCAL_FLAGS}")
diff --git a/meta/recipes-graphics/startup-notification/startup-notification_0.12.bb b/meta/recipes-graphics/startup-notification/startup-notification_0.12.bb
new file mode 100644
index 0000000..6c1b93c
--- /dev/null
+++ b/meta/recipes-graphics/startup-notification/startup-notification_0.12.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Enables monitoring and display of application startup"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/startup-notification/"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=Specifications"
+
+# most files are under MIT, but libsn/sn-util.c is under LGPL, the
+# effective license is LGPL
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a2ae2cd47d6d2f238410f5364dfbc0f2 \
+                    file://libsn/sn-util.c;endline=18;md5=18a14dc1825d38e741d772311fea9ee1 \
+                    file://libsn/sn-common.h;endline=23;md5=6d05bc0ebdcf5513a6e77cb26e8cd7e2 \
+                    file://test/test-boilerplate.h;endline=23;md5=923e706b2a70586176eead261cc5bb98"
+
+PR = "r2"
+
+SECTION = "libs"
+
+
+DEPENDS = "virtual/libx11 libsm xcb-util"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "http://www.freedesktop.org/software/startup-notification/releases/${BPN}-${PV}.tar.gz \
+           file://obsolete_automake_macros.patch \
+"
+
+SRC_URI[md5sum] = "2cd77326d4dcaed9a5a23a1232fb38e9"
+SRC_URI[sha256sum] = "3c391f7e930c583095045cd2d10eb73a64f085c7fde9d260f2652c7cb3cfbe4a"
diff --git a/meta/recipes-graphics/tslib/tslib/ts.conf b/meta/recipes-graphics/tslib/tslib/ts.conf
new file mode 100644
index 0000000..1b0da93
--- /dev/null
+++ b/meta/recipes-graphics/tslib/tslib/ts.conf
@@ -0,0 +1,25 @@
+# Uncomment if you wish to use the linux input layer event interface
+module_raw input
+
+# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d
+# module_raw collie
+
+# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860
+# module_raw corgi
+
+# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface
+# module_raw ucb1x00
+
+# Uncomment if you're using an HP iPaq h3600 or similar
+# module_raw h3600
+
+# Uncomment if you're using a Hitachi Webpad
+# module_raw mk712
+
+# Uncomment if you're using an IBM Arctic II
+# module_raw arctic2
+
+module pthres pmin=1
+module variance delta=30
+module dejitter delta=100
+module linear
diff --git a/meta/recipes-graphics/tslib/tslib/tslib.sh b/meta/recipes-graphics/tslib/tslib/tslib.sh
new file mode 100644
index 0000000..7068e8d
--- /dev/null
+++ b/meta/recipes-graphics/tslib/tslib/tslib.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [ -e /dev/input/touchscreen0 ]; then
+    TSLIB_TSDEVICE=/dev/input/touchscreen0
+
+    export TSLIB_TSDEVICE
+fi
+
diff --git a/meta/recipes-graphics/tslib/tslib_1.1.bb b/meta/recipes-graphics/tslib/tslib_1.1.bb
new file mode 100644
index 0000000..6d8c7dd
--- /dev/null
+++ b/meta/recipes-graphics/tslib/tslib_1.1.bb
@@ -0,0 +1,53 @@
+SUMMARY = "An abstraction layer for touchscreen panel events"
+DESCRIPTION = "Tslib is an abstraction layer for touchscreen panel \
+events, as well as a filter stack for the manipulation of those events. \
+Tslib is generally used on embedded devices to provide a common user \
+space interface to touchscreen functionality."
+HOMEPAGE = "http://tslib.berlios.de/"
+
+AUTHOR = "Russell King w/ plugins by Chris Larson et. al."
+SECTION = "base"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f30a9716ef3762e3467a2f62bf790f0a"
+
+SRC_URI = "https://github.com/kergoth/tslib/releases/download/${PV}/tslib-${PV}.tar.xz;downloadfilename=tslib-${PV}.tar.xz \
+           file://ts.conf \
+           file://tslib.sh \
+"
+
+SRC_URI[md5sum] = "14771f8607b341bb4b297819d37e837d"
+SRC_URI[sha256sum] = "fe35e5f710ea933b118f710e2ce4403ac076fe69926b570333867d4de082a51c"
+
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--enable-shared --disable-h3600 --enable-input --disable-corgi --disable-collie --disable-mk712 --disable-arctic2 --disable-ucb1x00"
+
+do_install_prepend() {
+	install -m 0644 ${WORKDIR}/ts.conf ${S}/etc/ts.conf
+}
+
+do_install_append() {
+	install -d ${D}${sysconfdir}/profile.d/
+	install -m 0755 ${WORKDIR}/tslib.sh ${D}${sysconfdir}/profile.d/
+}
+
+# People should consider using udev's /dev/input/touchscreen0 symlink
+# instead of detect-stylus
+#RDEPENDS_tslib-conf_weird-machine = "detect-stylus"
+RPROVIDES_tslib-conf = "libts-0.0-conf"
+
+PACKAGES =+ "tslib-conf tslib-tests tslib-calibrate"
+DEBIAN_NOAUTONAME_tslib-conf = "1"
+DEBIAN_NOAUTONAME_tslib-tests = "1"
+DEBIAN_NOAUTONAME_tslib-calibrate = "1"
+
+RDEPENDS_${PN} = "tslib-conf"
+RRECOMMENDS_${PN} = "pointercal"
+
+FILES_${PN}-dbg += "${libdir}/ts/.debug*"
+FILES_${PN}-dev += "${libdir}/ts/*.la"
+FILES_tslib-conf = "${sysconfdir}/ts.conf ${sysconfdir}/profile.d/tslib.sh ${datadir}/tslib"
+FILES_${PN} = "${libdir}/*.so.* ${libdir}/ts/*.so*"
+FILES_tslib-calibrate += "${bindir}/ts_calibrate"
+FILES_tslib-tests = "${bindir}/ts_harvest ${bindir}/ts_print ${bindir}/ts_print_raw ${bindir}/ts_test"
diff --git a/meta/recipes-graphics/ttf-fonts/liberation-fonts/30-liberation-aliases.conf b/meta/recipes-graphics/ttf-fonts/liberation-fonts/30-liberation-aliases.conf
new file mode 100644
index 0000000..0609450
--- /dev/null
+++ b/meta/recipes-graphics/ttf-fonts/liberation-fonts/30-liberation-aliases.conf
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+<!-- conf.d/sub-pixel.conf -->
+<fontconfig>
+	<alias>
+		<family>sans-serif</family>
+		<accept><family>Liberation Sans</family></accept>
+	</alias>
+	<alias>
+		<family>serif</family>
+		<accept><family>Liberation Serif</family></accept>
+	</alias>
+	<alias>
+		<family>monospace</family>
+		<accept><family>Liberation Mono</family></accept>
+	</alias>
+</fontconfig>
diff --git a/meta/recipes-graphics/ttf-fonts/liberation-fonts_1.04.bb b/meta/recipes-graphics/ttf-fonts/liberation-fonts_1.04.bb
new file mode 100644
index 0000000..bda82e7
--- /dev/null
+++ b/meta/recipes-graphics/ttf-fonts/liberation-fonts_1.04.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Liberation(tm) Fonts"
+DESCRIPTION = "The Liberation(tm) Fonts is a font family originally \
+created by Ascender(c) which aims at metric compatibility with \
+Arial, Times New Roman, Courier New."
+HOMEPAGE = "https://fedorahosted.org/liberation-fonts/"
+BUGTRACKER = "https://bugzilla.redhat.com/"
+
+RECIPE_NO_UPDATE_REASON = "2.x depends on fontforge package, which is not yet provided in oe-core"
+
+SECTION = "x11/fonts"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+PR = "r4"
+PE = "1"
+
+inherit allarch fontcache
+
+FONT_PACKAGES = "${PN}"
+
+SRC_URI = "https://fedorahosted.org/releases/l/i/liberation-fonts/liberation-fonts-${PV}.tar.gz \
+           file://30-liberation-aliases.conf"
+
+SRC_URI[md5sum] = "4846797ef0fc70b0cbaede2514677c58"
+SRC_URI[sha256sum] = "0e0d0957c85b758561a3d4aef4ebcd2c39959e5328429d96ae106249d83531a1"
+
+do_install () {
+	install -d ${D}${datadir}/fonts/ttf/
+	for i in *.ttf; do
+		install -m 0644 $i ${D}${prefix}/share/fonts/ttf/${i}
+	done
+
+	install -d ${D}${sysconfdir}/fonts/conf.d/
+	install -m 0644 ${WORKDIR}/30-liberation-aliases.conf ${D}${sysconfdir}/fonts/conf.d/
+
+	install -d ${D}${prefix}/share/doc/${BPN}/
+	install -m 0644 License.txt ${D}${datadir}/doc/${BPN}/
+}
+
+PACKAGES = "${PN}"
+FILES_${PN} += "${sysconfdir} ${datadir}"
diff --git a/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb b/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb
new file mode 100644
index 0000000..b2e4cef
--- /dev/null
+++ b/meta/recipes-graphics/ttf-fonts/ttf-bitstream-vera_1.10.bb
@@ -0,0 +1,38 @@
+SUMMARY = "The Bitstream Vera fonts - TTF Edition"
+DESCRIPTION = "The Bitstream Vera fonts include four monospace and sans \
+faces (normal, oblique, bold, bold oblique) and two serif faces (normal \
+and bold).  In addition Fontconfig/Xft2 can artificially oblique the \
+serif faces for you: this loses hinting and distorts the faces slightly, \
+but is visibly different than normal and bold, and reasonably pleasing."
+SECTION = "x11/fonts"
+LICENSE = "BitstreamVera"
+LIC_FILES_CHKSUM = "file://COPYRIGHT.TXT;md5=27d7484b1e18d0ee4ce538644a3f04be"
+PR = "r7"
+
+inherit fontcache
+
+FONT_PACKAGES = "${PN}"
+
+SRC_URI = "${GNOME_MIRROR}/ttf-bitstream-vera/1.10/ttf-bitstream-vera-${PV}.tar.bz2" 
+
+do_install () { 
+        install -d ${D}${prefix}/share/fonts/ttf/ 
+        for i in *.ttf; do 
+                install -m 644 $i ${D}${prefix}/share/fonts/ttf/${i} 
+        done 
+
+	# fontconfig ships this too.  not sure what to do about it.
+        #install -d ${D}${sysconfdir}/fonts 
+        #install -m 644 local.conf ${D}${sysconfdir}/fonts/local.conf 
+
+
+        install -d ${D}${prefix}/share/doc/${BPN}/
+        for i in *.TXT; do 
+                install -m 644 $i ${D}${prefix}/share/doc/${BPN}/$i
+        done 
+} 
+
+FILES_${PN} = "/etc ${datadir}/fonts"
+
+SRC_URI[md5sum] = "bb22bd5b4675f5dbe17c6963d8c00ed6"
+SRC_URI[sha256sum] = "db5b27df7bbb318036ebdb75acd3e98f1bd6eb6608fb70a67d478cd243d178dc"
diff --git a/meta/recipes-graphics/waffle/waffle_1.5.1.bb b/meta/recipes-graphics/waffle/waffle_1.5.1.bb
new file mode 100644
index 0000000..b8aa05a
--- /dev/null
+++ b/meta/recipes-graphics/waffle/waffle_1.5.1.bb
@@ -0,0 +1,33 @@
+SUMMARY = "cross-platform C library to defer selection of GL API and of window system"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=4c5154407c2490750dd461c50ad94797 \
+                    file://include/waffle/waffle.h;endline=24;md5=61dbf8697f61c78645e75a93c585b1bf"
+
+SRC_URI = "http://waffle-gl.org/files/release/${BPN}-${PV}/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "c0d802bc3d0aba87c51e423a3a8bdd69"
+SRC_URI[sha256sum] = "cbab0e926515064e818bf089a5af04be33307e5f40d07659fb40d59b2bfe20aa"
+
+inherit cmake distro_features_check lib_package
+
+# This should be overridden per-machine to reflect the capabilities of the GL
+# stack.
+PACKAGECONFIG ??= "glx"
+
+# libx11 requires x11 in DISTRO_FEATURES.
+REQUIRED_DISTRO_FEATURES = "${@bb.utils.contains('PACKAGECONFIG', 'glx', 'x11', '', d)}"
+
+# I say virtual/libgl, actually wants gl.pc
+PACKAGECONFIG[glx] = "-Dwaffle_has_glx=1,-Dwaffle_has_glx=0,virtual/libgl libx11"
+
+# I say virtual/libgl, actually wants wayland-egl.pc, egl.pc, and the wayland
+# DISTRO_FEATURE.
+PACKAGECONFIG[wayland] = "-Dwaffle_has_wayland=1,-Dwaffle_has_wayland=0,virtual/libgl wayland"
+
+# I say virtual/libgl, actually wants gbm.pc egl.pc
+PACKAGECONFIG[gbm] = "-Dwaffle_has_gbm=1,-Dwaffle_has_gbm=0,virtual/libgl udev"
+
+# I say virtual/libgl, actually wants egl.pc
+PACKAGECONFIG[x11-egl] = "-Dwaffle_has_x11_egl=1,-Dwaffle_has_x11_egl=0,virtual/libgl libxcb"
+
+FILES_${PN}-dev += "${datadir}/cmake/Modules/FindWaffle.cmake \
+                    ${libdir}/cmake/Waffle/"
diff --git a/meta/recipes-graphics/wayland/libinput/libinput-configure.ac-add-arg-with-libunwind.patch b/meta/recipes-graphics/wayland/libinput/libinput-configure.ac-add-arg-with-libunwind.patch
new file mode 100644
index 0000000..df5ebcc
--- /dev/null
+++ b/meta/recipes-graphics/wayland/libinput/libinput-configure.ac-add-arg-with-libunwind.patch
@@ -0,0 +1,50 @@
+From cc6fce587f2628c8b342764e06fb0fc27c1e8274 Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 3 Aug 2015 20:33:44 -0700
+Subject: [PATCH] configure.ac: add arg --with-libunwind
+
+Add arg --with-libunwind for configure so it's optional to check
+libunwind, which is helpfull to make deterministic builds.
+
+Upstream-Status: Submitted [wayland-devel]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ configure.ac | 19 ++++++++++++++-----
+ 1 file changed, 14 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 314b0d4..242d251 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -60,13 +60,22 @@ PKG_PROG_PKG_CONFIG()
+ PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0])
+ PKG_CHECK_MODULES(LIBUDEV, [libudev])
+ PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
+-PKG_CHECK_MODULES(LIBUNWIND,
++
++AC_ARG_WITH(libunwind,
++            AS_HELP_STRING([--without-libunwind],[Do not use libunwind]))
++
++AS_IF([test "x$with_libunwind" != "xno"],
++	[PKG_CHECK_MODULES(LIBUNWIND,
+ 		  [libunwind],
+ 		  [HAVE_LIBUNWIND=yes],
+-		  [HAVE_LIBUNWIND=no])
+-if test "x$HAVE_LIBUNWIND" = "xyes"; then
+-	AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
+-fi
++		  [HAVE_LIBUNWIND=no])],
++	[HAVE_LIBUNWIND=no])
++
++AS_IF([test "x$HAVE_LIBUNWIND" = "xyes"],
++	[AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])],
++	[AS_IF([test "x$with_libunwind" = "xyes"],
++		[AC_MSG_ERROR([libunwind requested but not found])])])
++
+ AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$HAVE_LIBUNWIND" = xyes])
+ AC_PATH_PROG(ADDR2LINE, [addr2line])
+ if test "x$ADDR2LINE" != "x"; then
+-- 
+2.3.5
+
diff --git a/meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch b/meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch
new file mode 100644
index 0000000..97c63bd
--- /dev/null
+++ b/meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch
@@ -0,0 +1,72 @@
+This is a workaround upstream suggests for use with kernel 4.1.
+
+Upstream-Status: Inappropriate [temporary work-around]
+Signed-Off-By: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+
+From: Peter Hutterer <peter.hutterer@who-t.net>
+Date: Mon Aug 3 18:23:12 PDT 2015
+Subject: [PATCH v3 libinput] touchpad: serial synaptics need to fake new touches on TRIPLETAP
+
+On the 4.1 kernels synaptics pretends to have 3 slots (the serial fw only does
+2). This was added to avoid cursor jumps but has since been reverted for 4.2
+(kernel commit dbf3c37086, 4.1.3 is still buggy). In some cases a TRIPLETAP
+may be triggered without slot 2 ever activating.
+
+While there are still those kernels out there, work around this bug by opening
+a new touch point where none exists if the fake finger count exceeds the slot
+count.
+
+Reported-by: Jan Alexander Steffens <jan.steffens at gmail.com>
+Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
+Tested-by: Jan Alexander Steffens <jan.steffens at gmail.com>
+Reviewed-by: Hans de Goede <hdegoede at redhat.com>
+---
+Changes to v2:
+- split out the handling instead of having a tmp state variable, see Hans'
+  comments from v2
+
+Mainly sending this to the list again so I have a link to point people to.
+If you're on 4.1.x add this patch to your distribution package.
+
+ src/evdev-mt-touchpad.c | 22 ++++++++++++++++------
+ 1 file changed, 16 insertions(+), 6 deletions(-)
+
+diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
+index a683d9a..5ef03d5 100644
+--- a/src/evdev-mt-touchpad.c
++++ b/src/evdev-mt-touchpad.c
+@@ -369,13 +369,23 @@ tp_restore_synaptics_touches(struct tp_dispatch *tp,
+ 	for (i = 0; i < tp->num_slots; i++) {
+ 		struct tp_touch *t = tp_get_touch(tp, i);
+ 
+-		if (t->state != TOUCH_END)
++		switch(t->state) {
++		case TOUCH_HOVERING:
++		case TOUCH_BEGIN:
++		case TOUCH_UPDATE:
+ 			continue;
+-
+-		/* new touch, move it through begin to update immediately */
+-		tp_new_touch(tp, t, time);
+-		tp_begin_touch(tp, t, time);
+-		t->state = TOUCH_UPDATE;
++		case TOUCH_NONE:
++			/* new touch, move it through to begin immediately */
++			tp_new_touch(tp, t, time);
++			tp_begin_touch(tp, t, time);
++			break;
++		case TOUCH_END:
++			/* touch just ended ,we need need to restore it to update */
++			tp_new_touch(tp, t, time);
++			tp_begin_touch(tp, t, time);
++			t->state = TOUCH_UPDATE;
++			break;
++		}
+ 	}
+ }
+ 
+-- 
+2.4.3
+
diff --git a/meta/recipes-graphics/wayland/libinput_0.21.0.bb b/meta/recipes-graphics/wayland/libinput_0.21.0.bb
new file mode 100644
index 0000000..ac5a249
--- /dev/null
+++ b/meta/recipes-graphics/wayland/libinput_0.21.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Library to handle input devices in Wayland compositors"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libinput/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2184aef38ff137ed33ce9a63b9d1eb8f"
+
+DEPENDS = "libevdev udev mtdev"
+
+SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BP}.tar.xz \
+           file://libinput-configure.ac-add-arg-with-libunwind.patch \
+           file://touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch \
+"
+SRC_URI[md5sum] = "f91d8f4ced986f1ae16d52ea02bc7837"
+SRC_URI[sha256sum] = "7cce7a9e510dfe5c4a19ad00e9350808d4f59f8611fd2b5e87213c507283f550"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind"
+PACKAGECONFIG[gui] = "--enable-event-gui,--disable-event-gui,cairo gtk+3"
+
+FILES_${PN} += "${libdir}/udev/"
+FILES_${PN}-dbg += "${libdir}/udev/.debug"
diff --git a/meta/recipes-graphics/wayland/mtdev_1.1.5.bb b/meta/recipes-graphics/wayland/mtdev_1.1.5.bb
new file mode 100644
index 0000000..ccd0ebb
--- /dev/null
+++ b/meta/recipes-graphics/wayland/mtdev_1.1.5.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Multitouch Protocol Translation Library"
+
+DESCRIPTION = "mtdev is a library which transforms all variants of kernel \
+multitouch events to the slotted type B protocol. The events put into mtdev may \
+be from any MT device, specifically type A without contact tracking, type A with \
+contact tracking, or type B with contact tracking"
+
+HOMEPAGE = "http://bitmath.org/code/mtdev/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea6bd0268bb0fcd6b27698616ceee5d6"
+
+SRC_URI = "http://bitmath.org/code/${BPN}/${BP}.tar.bz2"
+SRC_URI[md5sum] = "52c9610b6002f71d1642dc1a1cca5ec1"
+SRC_URI[sha256sum] = "6677d5708a7948840de734d8b4675d5980d4561171c5a8e89e54adf7a13eba7f"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-graphics/wayland/wayland/always-build-scanner.patch b/meta/recipes-graphics/wayland/wayland/always-build-scanner.patch
new file mode 100644
index 0000000..5e0e6bf
--- /dev/null
+++ b/meta/recipes-graphics/wayland/wayland/always-build-scanner.patch
@@ -0,0 +1,105 @@
+build: always build wayland-scanner
+
+The previous idiom for building a cross-compiled Wayland is to build once for
+the build host (with --enable-scanner --disable-libraries) to get a
+wayland-scanner binary that can then be used in a cross-compile (with
+--disable-scanner).  The problem with this is that the cross wayland is missing
+a wayland-scanner binary, which means you then can't do any Wayland development
+on the target.
+
+Instead, always build wayland-scanner for the target and change
+--enable/disable-scanner to --with/without-host-scanner.  Normal builds use the
+default of --without-host-scanner and run the wayland-scanner it just built, and
+cross-compiled builds pass --with-host-scanner to use a previously built host
+scanner but still get a wayland-scanner to install.
+
+(a theoretically neater solution would be to build two scanners if required (one
+to run and one to install), but automake makes this overly complicated)
+
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+Upstream-Status: Submitted
+
+diff --git a/Makefile.am b/Makefile.am
+index c19494f..c2d929b 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -64,16 +64,17 @@ nodist_libwayland_client_la_SOURCES =		\
+ 
+ pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
+ 
+-if ENABLE_SCANNER
+-wayland_scanner = $(top_builddir)/wayland-scanner
+ bin_PROGRAMS = wayland-scanner
+ wayland_scanner_SOURCES = src/scanner.c
+ wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(AM_CFLAGS)
+ wayland_scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
+-$(BUILT_SOURCES) : wayland-scanner
+ pkgconfig_DATA += src/wayland-scanner.pc
+-else
++
++if HOST_SCANNER
+ wayland_scanner = wayland-scanner
++else
++$(BUILT_SOURCES) : wayland-scanner
++wayland_scanner = $(top_builddir)/wayland-scanner
+ endif
+ 
+ protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
+diff --git a/configure.ac b/configure.ac
+index c2a804e..de0b02f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -65,11 +65,11 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
+ 	      [[#include <time.h>]])
+ AC_CHECK_HEADERS([execinfo.h])
+ 
+-AC_ARG_ENABLE([scanner],
+-              [AC_HELP_STRING([--disable-scanner],
+-                              [Disable compilation of wayland-scanner])],
+-              [],
+-              [enable_scanner=yes])
++AC_ARG_WITH([host-scanner],
++            [AC_HELP_STRING([--with-host-scanner],
++                            [Use a host wayland-scanner])],
++            [],
++            [with_host_scanner=no])
+ 
+ AC_ARG_ENABLE([documentation],
+ 	      [AC_HELP_STRING([--disable-documentation],
+@@ -77,25 +77,23 @@ AC_ARG_ENABLE([documentation],
+ 	      [],
+ 	      [enable_documentation=yes])
+ 
+-AM_CONDITIONAL(ENABLE_SCANNER, test "x$enable_scanner" = xyes)
++AM_CONDITIONAL(HOST_SCANNER, test "x$with_host_scanner" = xyes)
+ 
+ AC_ARG_WITH(icondir, [  --with-icondir=<dir>    Look for cursor icons here],
+ 		     [  ICONDIR=$withval],
+ 		     [  ICONDIR=${datadir}/icons])
+ AC_SUBST([ICONDIR])
+ 
+-if test "x$enable_scanner" = "xyes"; then
+-	PKG_CHECK_MODULES(EXPAT, [expat], [],
+-		[AC_CHECK_HEADERS(expat.h, [],
+-			[AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
+-		 SAVE_LIBS="$LIBS"
+-		 AC_SEARCH_LIBS(XML_ParserCreate, expat, [],
+-			[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
+-		 EXPAT_LIBS="$LIBS"
+-		 LIBS="$SAVE_LIBS"
+-		 AC_SUBST(EXPAT_LIBS)
+-		])
+-fi
++PKG_CHECK_MODULES(EXPAT, [expat], [],
++	[AC_CHECK_HEADERS(expat.h, [],
++		[AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
++	 SAVE_LIBS="$LIBS"
++	 AC_SEARCH_LIBS(XML_ParserCreate, expat, [],
++		[AC_MSG_ERROR([Can't find expat library. Please install expat.])])
++	 EXPAT_LIBS="$LIBS"
++	 LIBS="$SAVE_LIBS"
++	 AC_SUBST(EXPAT_LIBS)
++	])
+ 
+ AC_PATH_PROG(XSLTPROC, xsltproc)
+ AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
diff --git a/meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch b/meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch
new file mode 100644
index 0000000..cd8bc55
--- /dev/null
+++ b/meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch
@@ -0,0 +1,50 @@
+disable macro checks not used for scanner
+
+We only build wayland-native for the scanner, so disable the bits we don't
+actually need. This avoid build issue on older distro such as Centos 5.x:
+| error: 'O_CLOEXEC' undeclared (first use in this function)
+| error: sys/timerfd.h: No such file or directory
+| error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
+| error: 'TFD_CLOEXEC' undeclared (first use in this function)
+| error: 'SFD_CLOEXEC' undeclared (first use in this function)
+
+Upstream-Status: Pending
+
+Signed-off-by: Ting Liu <b28495@freescale.com>
+---
+ configure.ac | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+--- a/configure.ac
++++ b/configure.ac
+@@ -41,16 +41,16 @@ AC_SUBST(GCC_CFLAGS)
+ 
+ AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate])
+ 
+-AC_CHECK_DECL(SFD_CLOEXEC,[],
+-	      [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland")],
+-	      [[#include <sys/signalfd.h>]])
+-AC_CHECK_DECL(TFD_CLOEXEC,[],
+-	      [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland")],
+-	      [[#include <sys/timerfd.h>]])
+-AC_CHECK_DECL(CLOCK_MONOTONIC,[],
+-	      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland")],
+-	      [[#include <time.h>]])
+-AC_CHECK_HEADERS([execinfo.h])
++##AC_CHECK_DECL(SFD_CLOEXEC,[],
++#	      [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland")],
++#	      [[#include <sys/signalfd.h>]])
++#AC_CHECK_DECL(TFD_CLOEXEC,[],
++#	      [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland")],
++#	      [[#include <sys/timerfd.h>]])
++#AC_CHECK_DECL(CLOCK_MONOTONIC,[],
++#	      [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland")],
++#	      [[#include <time.h>]])
++#AC_CHECK_HEADERS([execinfo.h])
+ 
+ AC_ARG_ENABLE([scanner],
+               [AC_HELP_STRING([--disable-scanner],
+-- 
+1.8.3.2
+
diff --git a/meta/recipes-graphics/wayland/wayland_1.8.1.bb b/meta/recipes-graphics/wayland/wayland_1.8.1.bb
new file mode 100644
index 0000000..0f9a0aa
--- /dev/null
+++ b/meta/recipes-graphics/wayland/wayland_1.8.1.bb
@@ -0,0 +1,45 @@
+SUMMARY = "Wayland, a protocol between a compositor and clients"
+DESCRIPTION = "Wayland is a protocol for a compositor to talk to its clients \
+as well as a C library implementation of that protocol. The compositor can be \
+a standalone display server running on Linux kernel modesetting and evdev \
+input devices, an X application, or a wayland client itself. The clients can \
+be traditional applications, X servers (rootless or fullscreen) or other \
+display servers."
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1d4476a7d98dd5691c53d4d43a510c72 \
+                    file://src/wayland-server.c;endline=21;md5=079ae21dbf98ada52ec23744851b0a5c"
+
+SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+           file://always-build-scanner.patch"
+SRC_URI[md5sum] = "6e877877c3e04cfb865cfcd0733c9ab1"
+SRC_URI[sha256sum] = "f17c938d1c24fd0a10f650a623a2775d329db3168b5732e498b08388ec776fc8"
+
+SRC_URI_append_class-native = " \
+    file://disable-macro-checks-not-used-for-scanner.patch \
+    "
+EXTRA_OECONF_class-native = "--disable-documentation"
+
+inherit autotools pkgconfig
+
+BBCLASSEXTEND = "native nativesdk"
+
+DEPENDS = "expat libffi wayland-native"
+
+EXTRA_OECONF = "--disable-documentation --with-host-scanner"
+
+# Wayland installs a M4 macro for other projects to use, which uses the target
+# pkg-config to find files.  Replace pkg-config with pkg-config-native.
+do_install_append_class-native() {
+  sed -e 's,PKG_CHECK_MODULES(.*),,g' \
+      -e 's,$PKG_CONFIG,pkg-config-native,g' \
+      -i ${D}/${datadir}/aclocal/wayland-scanner.m4
+}
+
+sysroot_stage_all_append_class-target () {
+	rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4
+	cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/
+}
+
+FILES_${PN} = "${libdir}/*${SOLIBS}"
+FILES_${PN}-dev += "${bindir} ${datadir}/wayland"
diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
new file mode 100644
index 0000000..38b78bc
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Startup script for the Weston Wayland compositor"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+
+SRC_URI = "file://init"
+
+S = "${WORKDIR}"
+
+do_install() {
+	install -d ${D}/${sysconfdir}/init.d
+	install -m755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+}
+
+inherit allarch update-rc.d
+
+RDEPENDS_${PN} = "weston kbd"
+
+INITSCRIPT_NAME = "weston"
+INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
diff --git a/meta/recipes-graphics/wayland/weston-init/init b/meta/recipes-graphics/wayland/weston-init/init
new file mode 100644
index 0000000..2e938f4
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/init
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: weston
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+### END INIT INFO
+
+if test -e /etc/default/weston ; then
+        . /etc/default/weston
+fi
+
+killproc() {
+        pid=`/bin/pidof $1`
+        [ "$pid" != "" ] && kill $pid
+}
+
+read CMDLINE < /proc/cmdline
+for x in $CMDLINE; do
+        case $x in
+        weston=false)
+		echo "Weston disabled"
+		exit 0;
+                ;;
+        esac
+done
+
+case "$1" in
+  start)
+        . /etc/profile
+
+        # This is all a nasty hack
+        if test -z "$XDG_RUNTIME_DIR"; then
+                export XDG_RUNTIME_DIR=/run/user/root
+                mkdir --parents $XDG_RUNTIME_DIR
+                chmod 0700 $XDG_RUNTIME_DIR
+        fi
+
+        openvt -s weston -- $OPTARGS
+  ;;
+
+  stop)
+        echo "Stopping Weston"
+        killproc weston
+  ;;
+
+  restart)
+	$0 stop
+        sleep 1
+        $0 start
+  ;;
+
+  *)
+        echo "usage: $0 { start | stop | restart }"
+  ;;
+esac
+
+exit 0
diff --git a/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
new file mode 100644
index 0000000..148848d
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
@@ -0,0 +1,80 @@
+From c22e90365d89346258394833cbcad03ff32b2e27 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 May 2015 20:56:00 -0700
+Subject: [PATCH weston] make error() portable
+
+error() is not posix but gnu extension so may not be available on all
+kind of systemsi e.g. musl.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ configure.ac        |  2 ++
+ src/weston-error.h  | 20 ++++++++++++++++++++
+ src/weston-launch.c |  2 +-
+ 3 files changed, 23 insertions(+), 1 deletion(-)
+ create mode 100644 src/weston-error.h
+
+diff --git a/configure.ac b/configure.ac
+index 263fc22..f52cd62 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -57,6 +57,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
+ 	      [[#include <time.h>]])
+ AC_CHECK_HEADERS([execinfo.h])
+ 
++AC_CHECK_HEADERS([error.h])
++
+ AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
+ 
+ COMPOSITOR_MODULES="wayland-server >= 1.7.93 pixman-1 >= 0.25.2"
+diff --git a/src/weston-error.h b/src/weston-error.h
+new file mode 100644
+index 0000000..2089d02
+--- /dev/null
++++ b/src/weston-error.h
+@@ -0,0 +1,20 @@
++#ifndef _WESTON_ERROR_H
++#define _WESTON_ERROR_H
++
++#if defined(HAVE_ERROR_H)
++#include <error.h>
++#else
++#include <err.h>
++#include <string.h>
++#define _weston_error(S, E, F, ...) do { \
++	if (E) \
++		err(S, F ": %s", ##__VA_ARGS__, strerror(E)); \
++	else \
++		err(S, F, ##__VA_ARGS__); \
++} while(0)
++
++#define error _weston_error
++#endif
++
++#endif
++
+diff --git a/src/weston-launch.c b/src/weston-launch.c
+index 10c66de..3e6d30a 100644
+--- a/src/weston-launch.c
++++ b/src/weston-launch.c
+@@ -30,7 +30,6 @@
+ #include <poll.h>
+ #include <errno.h>
+ 
+-#include <error.h>
+ #include <getopt.h>
+ 
+ #include <sys/types.h>
+@@ -56,6 +55,7 @@
+ #endif
+ 
+ #include "weston-launch.h"
++#include "weston-error.h"
+ 
+ #define DRM_MAJOR 226
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-graphics/wayland/weston/disable-wayland-scanner-pkg-check.patch b/meta/recipes-graphics/wayland/weston/disable-wayland-scanner-pkg-check.patch
new file mode 100644
index 0000000..68ba38b
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/disable-wayland-scanner-pkg-check.patch
@@ -0,0 +1,17 @@
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -501,12 +501,6 @@ if test "x$have_lcms" = xyes; then
+ fi
+ AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
+ 
+-AC_PATH_PROG([wayland_scanner], [wayland-scanner])
+-if test x$wayland_scanner = x; then
+-	PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
+-	wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
+-fi
+-
+ AC_CONFIG_FILES([Makefile src/version.h src/weston.pc])
+ 
+ AM_CONDITIONAL([HAVE_GIT_REPO], [test -f $srcdir/.git/logs/HEAD])
diff --git a/meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch b/meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch
new file mode 100644
index 0000000..35e6d6f
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch
@@ -0,0 +1,43 @@
+weston-1.5.0/configure.ac: make lcms explicitly configurable
+
+The lcms package is outside of openembedded-core, so make it
+explicitly configurable. Make it deterministic, so that if lcms
+dependencies are missing, autoconf throws a fatal error. Follow
+upstream style to make it more likely to be merged.
+
+Upstream-Status: Pending
+
+Index: weston-1.5.0/configure.ac
+===================================================================
+--- weston-1.5.0.orig/configure.ac
++++ weston-1.5.0/configure.ac
+@@ -491,12 +491,24 @@ AC_ARG_ENABLE(demo-clients-install,
+ 			     enable_demo_clients_install=no)
+ AM_CONDITIONAL(INSTALL_DEMO_CLIENTS, [test "x$enable_demo_clients_install" = "xyes"])
+ 
+-PKG_CHECK_MODULES(LCMS, lcms2,
+-                  [have_lcms=yes], [have_lcms=no])
+-if test "x$have_lcms" = xyes; then
+-       AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
++AC_ARG_ENABLE(lcms,
++              AS_HELP_STRING([--disable-lcms],
++                             [Disable lcms support]),,
++              enable_lcms=auto)
++AM_CONDITIONAL(HAVE_LCMS, [test "x$enable_lcms" = xyes])
++if test "x$enable_lcms" != "xno"; then
++        PKG_CHECK_MODULES(LCMS, 
++                         lcms2,
++                         [have_lcms=yes],
++                         [have_lcms=no])
++        if test "x$have_lcms" = "xno" -a "x$enable_lcms" = "xyes"; then
++          AC_MSG_ERROR([lcms support explicitly requested, but lcms couldn't be found])
++        fi
++        if test "x$have_lcms" = "xyes"; then
++                enable_lcms=yes
++                AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
++        fi
+ fi
+-AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
+ 
+ AC_PATH_PROG([wayland_scanner], [wayland-scanner])
+ if test x$wayland_scanner = x; then
diff --git a/meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch b/meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch
new file mode 100644
index 0000000..ad07d4f
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch
@@ -0,0 +1,37 @@
+
+The libwebp package is outside of openembedded-core, so make it
+explicitly configurable. Make it deterministic, so that if libwebp 
+dependencies are missing, autoconf throws a fatal error.
+
+Upstream-Status: Pending
+
+Index: weston-1.5.0/configure.ac
+===================================================================
+--- weston-1.5.0.orig/configure.ac
++++ weston-1.5.0/configure.ac
+@@ -268,9 +268,22 @@ fi
+ 
+ PKG_CHECK_MODULES(PIXMAN, [pixman-1])
+ PKG_CHECK_MODULES(PNG, [libpng])
+-PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])
+-AS_IF([test "x$have_webp" = "xyes"],
+-      [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
++AC_ARG_ENABLE(webp,
++              AS_HELP_STRING([--disable-webp],
++                             [Disable libwebp support]),,
++              enable_webp=auto)
++AM_CONDITIONAL(HAVE_WEBP, [test "x$enable_webp" = xyes])
++AS_IF([test "x$enable_webp" != "xno"],
++    PKG_CHECK_MODULES(WEBP,
++                     [libwebp],
++                     [have_webp=yes],
++                     [have_webp=no])
++    AS_IF([test "x$have_webp" = "xno" -a "x$enable_webp" = "xyes"],
++        AC_MSG_ERROR([libwebp support explicitly request, but lipwebp could not be found]))
++    AS_IF([test "x$have_webp" = "xyes"],
++        [enable_webp=yes]
++        [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
++)
+ 
+ AC_ARG_ENABLE(vaapi-recorder, [  --enable-vaapi-recorder],,
+ 	      enable_vaapi_recorder=auto)
diff --git a/meta/recipes-graphics/wayland/weston/parallelmake.patch b/meta/recipes-graphics/wayland/weston/parallelmake.patch
new file mode 100644
index 0000000..42b5efb
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/parallelmake.patch
@@ -0,0 +1,40 @@
+Backport two patches from upstream to fix parallel builds
+
+- mkdir races (2eff22b8e6f6e5255a1915c33dfd91cecf02cbbc)
+- weston.desktop race (315476fa7b1f1c44c1b35116036df54ac5cb9a03)
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/Makefile.am b/Makefile.am
+index 5819b19..ff13b19 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -20,7 +20,7 @@ weston.ini : $(srcdir)/weston.ini.in
+ 		$< > $@
+ 
+ ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in
+-	$(AM_V_GEN)$(SED) \
++	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
+ 		-e 's|@bindir[@]|$(bindir)|g' \
+ 		-e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
+ 		-e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
+@@ -29,7 +29,7 @@ ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in
+ 		$< > $@
+ 
+ tests/weston-ivi.ini : $(srcdir)/ivi-shell/weston.ini.in
+-	$(AM_V_GEN)$(SED) \
++	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
+ 		-e 's|@bindir[@]|$(bindir)|g' \
+ 		-e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
+ 		-e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
+@@ -179,8 +179,7 @@ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = src/weston.pc
+ 
+ wayland_sessiondir = $(datadir)/wayland-sessions
+-wayland_session_DATA = src/weston.desktop
+-dist_wayland_session_DATA = $(wayland_session_DATA)
++dist_wayland_session_DATA = src/weston.desktop
+ 
+ westonincludedir = $(includedir)/weston
+ westoninclude_HEADERS =				\
diff --git a/meta/recipes-graphics/wayland/weston/weston.desktop b/meta/recipes-graphics/wayland/weston/weston.desktop
new file mode 100644
index 0000000..1086ae8
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/weston.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+Name=Weston
+Comment=Wayland Compostitor
+Exec=weston
+Icon=weston
+Terminal=false
+Categories=Utility;
diff --git a/meta/recipes-graphics/wayland/weston/weston.png b/meta/recipes-graphics/wayland/weston/weston.png
new file mode 100644
index 0000000..ea8b7e0
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/weston.png
Binary files differ
diff --git a/meta/recipes-graphics/wayland/weston_1.8.0.bb b/meta/recipes-graphics/wayland/weston_1.8.0.bb
new file mode 100644
index 0000000..342c604
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston_1.8.0.bb
@@ -0,0 +1,94 @@
+SUMMARY = "Weston, a Wayland compositor"
+DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=275efac2559a224527bd4fd593d38466 \
+                    file://src/compositor.c;endline=23;md5=a9793f1edc8d1a4c344ca8ae252352fb"
+
+SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
+           file://weston.png \
+           file://weston.desktop \
+           file://make-lcms-explicitly-configurable.patch \
+           file://make-libwebp-explicitly-configurable.patch \
+           file://0001-make-error-portable.patch \
+           file://parallelmake.patch \
+"
+SRC_URI[md5sum] = "24cb8a7ed0535b4fc3642643988dab36"
+SRC_URI[sha256sum] = "8963e69f328e815cec42c58046c4af721476c7541bb7d9edc71740fada5ad312"
+
+inherit autotools pkgconfig useradd
+
+DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
+DEPENDS += "wayland libinput virtual/egl pango"
+
+EXTRA_OECONF = "--enable-setuid-install \
+                --disable-xwayland \
+                --enable-simple-clients \
+                --enable-clients \
+                --enable-demo-clients-install \
+                --disable-rpi-compositor \
+                --disable-rdp-compositor \
+                "
+
+EXTRA_OECONF_append_qemux86 = "\
+		WESTON_NATIVE_BACKEND=fbdev-backend.so \
+		"
+EXTRA_OECONF_append_qemux86-64 = "\
+		WESTON_NATIVE_BACKEND=fbdev-backend.so \
+		"
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'launch', '', d)} \
+                  "
+#
+# Compositor choices
+#
+# Weston on KMS
+PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev"
+# Weston on Wayland (nested Weston)
+PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa"
+# Weston on X11
+PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
+# Headless Weston
+PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor"
+# Weston on framebuffer
+PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev"
+# weston-launch
+PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,libpam drm"
+# VA-API desktop recorder
+PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva"
+# Weston with EGL support
+PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl"
+# Weston with cairo glesv2 support
+PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo"
+# Weston with lcms support
+PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms"
+# Weston with webp support
+PACKAGECONFIG[webp] = "--enable-webp,--disable-webp,libwebp"
+# Weston with unwinding support
+PACKAGECONFIG[libunwind] = "--enable-libunwind,--disable-libunwind,libunwind"
+
+do_install_append() {
+	# Weston doesn't need the .la files to load modules, so wipe them
+	rm -f ${D}/${libdir}/weston/*.la
+
+	# If X11, ship a desktop file to launch it
+	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" = "x11" ]; then
+		install -d ${D}${datadir}/applications
+		install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
+
+		install -d ${D}${datadir}/icons/hicolor/48x48/apps
+		install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
+        fi
+}
+
+PACKAGES += "${PN}-examples"
+
+FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}"
+FILES_${PN}-examples = "${bindir}/*"
+
+RDEPENDS_${PN} += "xkeyboard-config"
+RRECOMMENDS_${PN} = "liberation-fonts"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system weston-launch"
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults
new file mode 100644
index 0000000..f5b69dd
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xdefaults
@@ -0,0 +1,3 @@
+Rxvt*scrollBar_right: true
+Rxvt*font: xft:Mono:pixelsize=9
+
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xserver b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xserver
new file mode 100644
index 0000000..73570df
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xserver
@@ -0,0 +1,12 @@
+#!/bin/sh
+#
+
+XSERVER=/usr/bin/Xorg
+
+. /etc/profile
+
+ARGS=" -br -pn"
+
+DISPLAY=':0'
+
+exec xinit /etc/X11/Xsession -- $XSERVER $DISPLAY $ARGS $*
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession
new file mode 100644
index 0000000..0b73127
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+if [ -x /usr/bin/dbus-launch ]; then
+    # As this is the X session script, always start a new DBus session.
+    eval `dbus-launch --sh-syntax --exit-with-session </dev/null`
+    echo "D-BUS per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
+fi
+
+. /etc/profile
+
+if [ -f $HOME/.profile ]; then
+    . $HOME/.profile
+fi
+
+SYSSESSIONDIR=/etc/X11/Xsession.d
+
+export CLUTTER_DISABLE_MIPMAPPED_TEXT=1
+
+for SESSIONFILE in $SYSSESSIONDIR/*; do
+    set +e
+    case "$SESSIONFILE" in
+        *.sh)
+            . "$SESSIONFILE"
+            ;;
+        *.shbg)
+            "$SESSIONFILE" &
+            ;;
+        *~)
+            # Ignore backup files
+            ;;
+        *)
+            "$SESSIONFILE"
+            ;;
+    esac
+    set -e
+done
+
+exit 0
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh
new file mode 100644
index 0000000..a9d102c
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/12keymap.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# kdrive 1.4 does not have default keymap in server
+#xmodmap - </etc/X11/default.xmodmap
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh
new file mode 100644
index 0000000..91594b9
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh
@@ -0,0 +1,13 @@
+# Minimal/stub implementation of the XDG Base Directory specification.
+# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+#
+# Wayland needs XDG_RUNTIME_DIR, so set it to /tmp.  This isn't compliant with
+# the specification (wrong mode, wrong owner) but it's mostly sufficient.
+#
+# In the ideal case where SystemD is booting and userspace is initiated by a
+# SystemD user session this will have been set already, so don't overwrite it.
+
+if [ -z "$XGD_RUNTIME_DIR" ]; then
+	XDG_RUNTIME_DIR="/tmp"
+        export XDG_RUNTIME_DIR
+fi
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/89xdgautostart.sh b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/89xdgautostart.sh
new file mode 100644
index 0000000..3d7008c
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/89xdgautostart.sh
@@ -0,0 +1,7 @@
+XDGAUTOSTART=/etc/xdg/autostart
+if [ -d $XDGAUTOSTART ]; then
+    for SCRIPT in $XDGAUTOSTART/*; do
+        CMD=`grep ^Exec= $SCRIPT | cut -d '=' -f 2`
+        $CMD &
+    done
+fi
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh
new file mode 100644
index 0000000..b936ded
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/90XWindowManager.sh
@@ -0,0 +1,7 @@
+if [ -x $HOME/.Xsession ]; then
+    exec $HOME/.Xsession
+elif [ -x /usr/bin/x-session-manager ]; then
+    exec /usr/bin/x-session-manager
+else
+    exec /usr/bin/x-window-manager
+fi
diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap b/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap
new file mode 100644
index 0000000..05a13fa
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common/etc/X11/default.xmodmap
@@ -0,0 +1,260 @@
+keycode   8 =
+keycode   9 = Escape
+keycode  10 = 1 exclam
+keycode  11 = 2 at
+keycode  12 = 3 numbersign
+keycode  13 = 4 dollar
+keycode  14 = 5 percent
+keycode  15 = 6 asciicircum
+keycode  16 = 7 ampersand braceleft
+keycode  17 = 8 asterisk bracketleft
+keycode  18 = 9 parenleft bracketright
+keycode  19 = 0 parenright braceright
+keycode  20 = minus underscore backslash
+keycode  21 = equal plus
+keycode  22 = BackSpace
+keycode  23 = Tab
+keycode  24 = q Q q
+keycode  25 = w W w
+keycode  26 = e E
+keycode  27 = r R r
+keycode  28 = t T t
+keycode  29 = y Y y
+keycode  30 = u U u
+keycode  31 = i I i
+keycode  32 = o O o
+keycode  33 = p P p
+keycode  34 = bracketleft braceleft
+keycode  35 = bracketright braceright asciitilde
+keycode  36 = Return
+keycode  37 = Control_L
+keycode  38 = a A
+keycode  39 = s S s
+keycode  40 = d D
+keycode  41 = f F
+keycode  42 = g G g
+keycode  43 = h H h
+keycode  44 = j J j
+keycode  45 = k K k
+keycode  46 = l L l
+keycode  47 = semicolon colon
+keycode  48 = apostrophe quotedbl
+keycode  49 = grave asciitilde
+keycode  50 = Shift_L
+keycode  51 = backslash bar
+keycode  52 = z Z z
+keycode  53 = x X x
+keycode  54 = c C
+keycode  55 = v V v
+keycode  56 = b B
+keycode  57 = n N n
+keycode  58 = m M m
+keycode  59 = comma less
+keycode  60 = period greater
+keycode  61 = slash question
+keycode  62 = Shift_R
+keycode  63 = KP_Multiply
+keycode  64 = Alt_L
+keycode  65 = space
+keycode  66 = Caps_Lock
+keycode  67 = F1 F11
+keycode  68 = F2 F12
+keycode  69 = F3 F13
+keycode  70 = F4 F14
+keycode  71 = F5 F15
+keycode  72 = F6 F16
+keycode  73 = F7 F17
+keycode  74 = F8 F18
+keycode  75 = F9 F19
+keycode  76 = F10 F20
+keycode  77 = Num_Lock
+keycode  78 = Scroll_Lock
+keycode  79 = KP_7
+keycode  80 = KP_8
+keycode  81 = KP_9
+keycode  82 = KP_Subtract
+keycode  83 = KP_4
+keycode  84 = KP_5
+keycode  85 = KP_6
+keycode  86 = KP_Add
+keycode  87 = KP_1
+keycode  88 = KP_2
+keycode  89 = KP_3
+keycode  90 = KP_0
+keycode  91 = KP_Decimal
+keycode  92 =
+keycode  93 =
+keycode  94 = less greater bar
+keycode  95 = F11
+keycode  96 = F12
+keycode  97 =
+keycode  98 =
+keycode  99 =
+keycode 100 =
+keycode 101 =
+keycode 102 =
+keycode 103 =
+keycode 104 = KP_Enter
+keycode 105 = Control_R
+keycode 106 = KP_Divide
+keycode 107 =
+keycode 108 = Mode_switch
+keycode 109 = Break
+keycode 110 = Home
+keycode 111 = Up
+keycode 112 = Prior
+keycode 113 = Left
+keycode 114 = Right
+keycode 115 = End
+keycode 116 = Down
+keycode 117 = Next
+keycode 118 = Insert
+keycode 119 = Delete
+keycode 120 = Menu
+keycode 121 = F13
+keycode 122 = F14
+keycode 123 = Help
+keycode 124 = Execute
+keycode 125 = F17
+keycode 126 = KP_Subtract
+keycode 127 = Pause
+keycode 128 =
+keycode 129 =
+keycode 130 =
+keycode 131 =
+keycode 132 =
+keycode 133 =
+keycode 134 =
+keycode 135 =
+keycode 136 =
+keycode 137 =
+keycode 138 =
+keycode 139 =
+keycode 140 =
+keycode 141 =
+keycode 142 =
+keycode 143 =
+keycode 144 =
+keycode 145 =
+keycode 146 =
+keycode 147 =
+keycode 148 =
+keycode 149 =
+keycode 150 =
+keycode 151 =
+keycode 152 =
+keycode 153 =
+keycode 154 =
+keycode 155 =
+keycode 156 =
+keycode 157 =
+keycode 158 =
+keycode 159 =
+keycode 160 =
+keycode 161 =
+keycode 162 =
+keycode 163 =
+keycode 164 =
+keycode 165 =
+keycode 166 =
+keycode 167 =
+keycode 168 =
+keycode 169 =
+keycode 170 =
+keycode 171 =
+keycode 172 =
+keycode 173 =
+keycode 174 =
+keycode 175 =
+keycode 176 =
+keycode 177 =
+keycode 178 =
+keycode 179 =
+keycode 180 =
+keycode 181 =
+keycode 182 =
+keycode 183 =
+keycode 184 =
+keycode 185 =
+keycode 186 =
+keycode 187 =
+keycode 188 =
+keycode 189 =
+keycode 190 =
+keycode 191 =
+keycode 192 =
+keycode 193 =
+keycode 194 =
+keycode 195 =
+keycode 196 =
+keycode 197 =
+keycode 198 =
+keycode 199 =
+keycode 200 =
+keycode 201 =
+keycode 202 =
+keycode 203 =
+keycode 204 =
+keycode 205 =
+keycode 206 =
+keycode 207 =
+keycode 208 =
+keycode 209 =
+keycode 210 =
+keycode 211 =
+keycode 212 =
+keycode 213 =
+keycode 214 =
+keycode 215 =
+keycode 216 =
+keycode 217 =
+keycode 218 =
+keycode 219 =
+keycode 220 =
+keycode 221 =
+keycode 222 =
+keycode 223 =
+keycode 224 =
+keycode 225 =
+keycode 226 =
+keycode 227 =
+keycode 228 =
+keycode 229 =
+keycode 230 =
+keycode 231 =
+keycode 232 =
+keycode 233 =
+keycode 234 =
+keycode 235 =
+keycode 236 =
+keycode 237 =
+keycode 238 =
+keycode 239 =
+keycode 240 =
+keycode 241 =
+keycode 242 =
+keycode 243 =
+keycode 244 =
+keycode 245 =
+keycode 246 =
+keycode 247 =
+keycode 248 =
+keycode 249 =
+keycode 250 =
+keycode 251 =
+keycode 252 =
+keycode 253 =
+keycode 254 =
+
+add shift = Shift_L
+add shift = Shift_R
+add shift = Menu
+add lock = Caps_Lock
+add control = Control_L
+add control = Control_R
+add mod1 = Alt_L
+add mod2 = Num_Lock
+!mod3      
+add mod4 = Mode_switch
+!mod5      
+
diff --git a/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch b/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch
new file mode 100644
index 0000000..eff975e
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common/gplv2-license.patch
@@ -0,0 +1,355 @@
+COPYING: add GPLv2 license file
+
+this is a local file recipe and the license file is missing.In order
+to pass the license checksum checking, the license file is needed. So
+this patch add the GPLv2 license file.
+
+Upstream-Status: Inappropriate [licensing]
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+diff --git a/COPYING b/COPYING
+new file mode 100644
+index 0000000..d511905
+--- /dev/null
++++ b/COPYING
+@@ -0,0 +1,339 @@
++		    GNU GENERAL PUBLIC LICENSE
++		       Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++			    Preamble
++
++  The licenses for most software are designed to take away your
++freedom to share and change it.  By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users.  This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it.  (Some other Free Software Foundation software is covered by
++the GNU Lesser General Public License instead.)  You can apply it to
++your programs, too.
++
++  When we speak of free software, we are referring to freedom, not
++price.  Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++  To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++  For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have.  You must make sure that they, too, receive or can get the
++source code.  And you must show them these terms so they know their
++rights.
++
++  We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++  Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software.  If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++  Finally, any free program is threatened constantly by software
++patents.  We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary.  To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++  The precise terms and conditions for copying, distribution and
++modification follow.
++
++		    GNU GENERAL PUBLIC LICENSE
++   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++  0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License.  The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language.  (Hereinafter, translation is included without limitation in
++the term "modification".)  Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope.  The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++  1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++  2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++    a) You must cause the modified files to carry prominent notices
++    stating that you changed the files and the date of any change.
++
++    b) You must cause any work that you distribute or publish, that in
++    whole or in part contains or is derived from the Program or any
++    part thereof, to be licensed as a whole at no charge to all third
++    parties under the terms of this License.
++
++    c) If the modified program normally reads commands interactively
++    when run, you must cause it, when started running for such
++    interactive use in the most ordinary way, to print or display an
++    announcement including an appropriate copyright notice and a
++    notice that there is no warranty (or else, saying that you provide
++    a warranty) and that users may redistribute the program under
++    these conditions, and telling the user how to view a copy of this
++    License.  (Exception: if the Program itself is interactive but
++    does not normally print such an announcement, your work based on
++    the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole.  If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works.  But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++  3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++    a) Accompany it with the complete corresponding machine-readable
++    source code, which must be distributed under the terms of Sections
++    1 and 2 above on a medium customarily used for software interchange; or,
++
++    b) Accompany it with a written offer, valid for at least three
++    years, to give any third party, for a charge no more than your
++    cost of physically performing source distribution, a complete
++    machine-readable copy of the corresponding source code, to be
++    distributed under the terms of Sections 1 and 2 above on a medium
++    customarily used for software interchange; or,
++
++    c) Accompany it with the information you received as to the offer
++    to distribute corresponding source code.  (This alternative is
++    allowed only for noncommercial distribution and only if you
++    received the program in object code or executable form with such
++    an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it.  For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable.  However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++  4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License.  Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++  5. You are not required to accept this License, since you have not
++signed it.  However, nothing else grants you permission to modify or
++distribute the Program or its derivative works.  These actions are
++prohibited by law if you do not accept this License.  Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++  6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions.  You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++  7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License.  If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all.  For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices.  Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++  8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded.  In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++  9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time.  Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number.  If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation.  If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++  10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission.  For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this.  Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++			    NO WARRANTY
++
++  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++		     END OF TERMS AND CONDITIONS
++
++	    How to Apply These Terms to Your New Programs
++
++  If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++  To do so, attach the following notices to the program.  It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++    <one line to give the program's name and a brief idea of what it does.>
++    Copyright (C) <year>  <name of author>
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation; either version 2 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License along
++    with this program; if not, write to the Free Software Foundation, Inc.,
++    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++    Gnomovision version 69, Copyright (C) year name of author
++    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++    This is free software, and you are welcome to redistribute it
++    under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License.  Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary.  Here is a sample; alter the names:
++
++  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++  `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++  <signature of Ty Coon>, 1 April 1989
++  Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs.  If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library.  If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.
diff --git a/meta/recipes-graphics/x11-common/x11-common_0.1.bb b/meta/recipes-graphics/x11-common/x11-common_0.1.bb
new file mode 100644
index 0000000..156b329
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common_0.1.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Common X11 scripts and configuration files"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+SECTION = "x11"
+PR = "r47"
+
+inherit distro_features_check
+# rdepends on xdypinfo xmodmap xinit
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "file://etc \
+           file://gplv2-license.patch"
+
+S = "${WORKDIR}"
+
+do_install() {
+	cp -R ${S}/etc ${D}${sysconfdir}
+	chmod -R 755 ${D}${sysconfdir}
+	find ${D}${sysconfdir} -type f -name \*~ -exec rm -rf {} \;
+}
+
+RDEPENDS_${PN} = "dbus-x11 xmodmap xdpyinfo xtscal xinit formfactor"
+
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init.bb b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
new file mode 100644
index 0000000..b68d40e
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Simple Xserver Init Script (no dm)"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+SECTION = "x11"
+PR = "r31"
+
+SRC_URI = "file://xserver-nodm \
+           file://Xusername \
+           file://gplv2-license.patch \
+           file://xserver-nodm.service \
+           file://xserver-nodm.conf \
+"
+
+S = "${WORKDIR}"
+
+# Since we refer to ROOTLESS_X which is normally enabled per-machine
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit update-rc.d systemd
+
+do_install() {
+    install -d ${D}${sysconfdir}/init.d
+    install xserver-nodm ${D}${sysconfdir}/init.d
+
+    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+        install -d ${D}${sysconfdir}/default
+        install xserver-nodm.conf ${D}${sysconfdir}/default/xserver-nodm
+        install -d ${D}${systemd_unitdir}/system
+        install -m 0644 ${WORKDIR}/xserver-nodm.service ${D}${systemd_unitdir}/system
+        if [ "${ROOTLESS_X}" = "1" ] ; then
+            sed -i 's!^HOME=.*!HOME=/home/xuser!' ${D}${sysconfdir}/default/xserver-nodm
+            sed -i 's!^User=.*!User=xuser!' ${D}${systemd_unitdir}/system/xserver-nodm.service
+        else
+            sed -i 's!^HOME=.*!HOME=${ROOT_HOME}!' ${D}${sysconfdir}/default/xserver-nodm
+            sed -i '/^User=/d' ${D}${systemd_unitdir}/system/xserver-nodm.service
+        fi
+    fi
+
+    if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
+        if [ "${ROOTLESS_X}" = "1" ] ; then
+            install -d ${D}${sysconfdir}/X11
+            install Xusername ${D}${sysconfdir}/X11
+        fi
+    fi
+}
+
+RDEPENDS_${PN} = "${@base_conditional('ROOTLESS_X', '1', 'xuser-account', '', d)}"
+
+INITSCRIPT_NAME = "xserver-nodm"
+INITSCRIPT_PARAMS = "start 9 5 . stop 20 0 1 2 3 6 ."
+SYSTEMD_SERVICE_${PN} = "xserver-nodm.service"
+
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername b/meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername
new file mode 100644
index 0000000..7060e5e
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/Xusername
@@ -0,0 +1 @@
+xuser
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/gplv2-license.patch b/meta/recipes-graphics/x11-common/xserver-nodm-init/gplv2-license.patch
new file mode 100644
index 0000000..eff975e
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/gplv2-license.patch
@@ -0,0 +1,355 @@
+COPYING: add GPLv2 license file
+
+this is a local file recipe and the license file is missing.In order
+to pass the license checksum checking, the license file is needed. So
+this patch add the GPLv2 license file.
+
+Upstream-Status: Inappropriate [licensing]
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+diff --git a/COPYING b/COPYING
+new file mode 100644
+index 0000000..d511905
+--- /dev/null
++++ b/COPYING
+@@ -0,0 +1,339 @@
++		    GNU GENERAL PUBLIC LICENSE
++		       Version 2, June 1991
++
++ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
++ Everyone is permitted to copy and distribute verbatim copies
++ of this license document, but changing it is not allowed.
++
++			    Preamble
++
++  The licenses for most software are designed to take away your
++freedom to share and change it.  By contrast, the GNU General Public
++License is intended to guarantee your freedom to share and change free
++software--to make sure the software is free for all its users.  This
++General Public License applies to most of the Free Software
++Foundation's software and to any other program whose authors commit to
++using it.  (Some other Free Software Foundation software is covered by
++the GNU Lesser General Public License instead.)  You can apply it to
++your programs, too.
++
++  When we speak of free software, we are referring to freedom, not
++price.  Our General Public Licenses are designed to make sure that you
++have the freedom to distribute copies of free software (and charge for
++this service if you wish), that you receive source code or can get it
++if you want it, that you can change the software or use pieces of it
++in new free programs; and that you know you can do these things.
++
++  To protect your rights, we need to make restrictions that forbid
++anyone to deny you these rights or to ask you to surrender the rights.
++These restrictions translate to certain responsibilities for you if you
++distribute copies of the software, or if you modify it.
++
++  For example, if you distribute copies of such a program, whether
++gratis or for a fee, you must give the recipients all the rights that
++you have.  You must make sure that they, too, receive or can get the
++source code.  And you must show them these terms so they know their
++rights.
++
++  We protect your rights with two steps: (1) copyright the software, and
++(2) offer you this license which gives you legal permission to copy,
++distribute and/or modify the software.
++
++  Also, for each author's protection and ours, we want to make certain
++that everyone understands that there is no warranty for this free
++software.  If the software is modified by someone else and passed on, we
++want its recipients to know that what they have is not the original, so
++that any problems introduced by others will not reflect on the original
++authors' reputations.
++
++  Finally, any free program is threatened constantly by software
++patents.  We wish to avoid the danger that redistributors of a free
++program will individually obtain patent licenses, in effect making the
++program proprietary.  To prevent this, we have made it clear that any
++patent must be licensed for everyone's free use or not licensed at all.
++
++  The precise terms and conditions for copying, distribution and
++modification follow.
++
++		    GNU GENERAL PUBLIC LICENSE
++   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
++
++  0. This License applies to any program or other work which contains
++a notice placed by the copyright holder saying it may be distributed
++under the terms of this General Public License.  The "Program", below,
++refers to any such program or work, and a "work based on the Program"
++means either the Program or any derivative work under copyright law:
++that is to say, a work containing the Program or a portion of it,
++either verbatim or with modifications and/or translated into another
++language.  (Hereinafter, translation is included without limitation in
++the term "modification".)  Each licensee is addressed as "you".
++
++Activities other than copying, distribution and modification are not
++covered by this License; they are outside its scope.  The act of
++running the Program is not restricted, and the output from the Program
++is covered only if its contents constitute a work based on the
++Program (independent of having been made by running the Program).
++Whether that is true depends on what the Program does.
++
++  1. You may copy and distribute verbatim copies of the Program's
++source code as you receive it, in any medium, provided that you
++conspicuously and appropriately publish on each copy an appropriate
++copyright notice and disclaimer of warranty; keep intact all the
++notices that refer to this License and to the absence of any warranty;
++and give any other recipients of the Program a copy of this License
++along with the Program.
++
++You may charge a fee for the physical act of transferring a copy, and
++you may at your option offer warranty protection in exchange for a fee.
++
++  2. You may modify your copy or copies of the Program or any portion
++of it, thus forming a work based on the Program, and copy and
++distribute such modifications or work under the terms of Section 1
++above, provided that you also meet all of these conditions:
++
++    a) You must cause the modified files to carry prominent notices
++    stating that you changed the files and the date of any change.
++
++    b) You must cause any work that you distribute or publish, that in
++    whole or in part contains or is derived from the Program or any
++    part thereof, to be licensed as a whole at no charge to all third
++    parties under the terms of this License.
++
++    c) If the modified program normally reads commands interactively
++    when run, you must cause it, when started running for such
++    interactive use in the most ordinary way, to print or display an
++    announcement including an appropriate copyright notice and a
++    notice that there is no warranty (or else, saying that you provide
++    a warranty) and that users may redistribute the program under
++    these conditions, and telling the user how to view a copy of this
++    License.  (Exception: if the Program itself is interactive but
++    does not normally print such an announcement, your work based on
++    the Program is not required to print an announcement.)
++
++These requirements apply to the modified work as a whole.  If
++identifiable sections of that work are not derived from the Program,
++and can be reasonably considered independent and separate works in
++themselves, then this License, and its terms, do not apply to those
++sections when you distribute them as separate works.  But when you
++distribute the same sections as part of a whole which is a work based
++on the Program, the distribution of the whole must be on the terms of
++this License, whose permissions for other licensees extend to the
++entire whole, and thus to each and every part regardless of who wrote it.
++
++Thus, it is not the intent of this section to claim rights or contest
++your rights to work written entirely by you; rather, the intent is to
++exercise the right to control the distribution of derivative or
++collective works based on the Program.
++
++In addition, mere aggregation of another work not based on the Program
++with the Program (or with a work based on the Program) on a volume of
++a storage or distribution medium does not bring the other work under
++the scope of this License.
++
++  3. You may copy and distribute the Program (or a work based on it,
++under Section 2) in object code or executable form under the terms of
++Sections 1 and 2 above provided that you also do one of the following:
++
++    a) Accompany it with the complete corresponding machine-readable
++    source code, which must be distributed under the terms of Sections
++    1 and 2 above on a medium customarily used for software interchange; or,
++
++    b) Accompany it with a written offer, valid for at least three
++    years, to give any third party, for a charge no more than your
++    cost of physically performing source distribution, a complete
++    machine-readable copy of the corresponding source code, to be
++    distributed under the terms of Sections 1 and 2 above on a medium
++    customarily used for software interchange; or,
++
++    c) Accompany it with the information you received as to the offer
++    to distribute corresponding source code.  (This alternative is
++    allowed only for noncommercial distribution and only if you
++    received the program in object code or executable form with such
++    an offer, in accord with Subsection b above.)
++
++The source code for a work means the preferred form of the work for
++making modifications to it.  For an executable work, complete source
++code means all the source code for all modules it contains, plus any
++associated interface definition files, plus the scripts used to
++control compilation and installation of the executable.  However, as a
++special exception, the source code distributed need not include
++anything that is normally distributed (in either source or binary
++form) with the major components (compiler, kernel, and so on) of the
++operating system on which the executable runs, unless that component
++itself accompanies the executable.
++
++If distribution of executable or object code is made by offering
++access to copy from a designated place, then offering equivalent
++access to copy the source code from the same place counts as
++distribution of the source code, even though third parties are not
++compelled to copy the source along with the object code.
++
++  4. You may not copy, modify, sublicense, or distribute the Program
++except as expressly provided under this License.  Any attempt
++otherwise to copy, modify, sublicense or distribute the Program is
++void, and will automatically terminate your rights under this License.
++However, parties who have received copies, or rights, from you under
++this License will not have their licenses terminated so long as such
++parties remain in full compliance.
++
++  5. You are not required to accept this License, since you have not
++signed it.  However, nothing else grants you permission to modify or
++distribute the Program or its derivative works.  These actions are
++prohibited by law if you do not accept this License.  Therefore, by
++modifying or distributing the Program (or any work based on the
++Program), you indicate your acceptance of this License to do so, and
++all its terms and conditions for copying, distributing or modifying
++the Program or works based on it.
++
++  6. Each time you redistribute the Program (or any work based on the
++Program), the recipient automatically receives a license from the
++original licensor to copy, distribute or modify the Program subject to
++these terms and conditions.  You may not impose any further
++restrictions on the recipients' exercise of the rights granted herein.
++You are not responsible for enforcing compliance by third parties to
++this License.
++
++  7. If, as a consequence of a court judgment or allegation of patent
++infringement or for any other reason (not limited to patent issues),
++conditions are imposed on you (whether by court order, agreement or
++otherwise) that contradict the conditions of this License, they do not
++excuse you from the conditions of this License.  If you cannot
++distribute so as to satisfy simultaneously your obligations under this
++License and any other pertinent obligations, then as a consequence you
++may not distribute the Program at all.  For example, if a patent
++license would not permit royalty-free redistribution of the Program by
++all those who receive copies directly or indirectly through you, then
++the only way you could satisfy both it and this License would be to
++refrain entirely from distribution of the Program.
++
++If any portion of this section is held invalid or unenforceable under
++any particular circumstance, the balance of the section is intended to
++apply and the section as a whole is intended to apply in other
++circumstances.
++
++It is not the purpose of this section to induce you to infringe any
++patents or other property right claims or to contest validity of any
++such claims; this section has the sole purpose of protecting the
++integrity of the free software distribution system, which is
++implemented by public license practices.  Many people have made
++generous contributions to the wide range of software distributed
++through that system in reliance on consistent application of that
++system; it is up to the author/donor to decide if he or she is willing
++to distribute software through any other system and a licensee cannot
++impose that choice.
++
++This section is intended to make thoroughly clear what is believed to
++be a consequence of the rest of this License.
++
++  8. If the distribution and/or use of the Program is restricted in
++certain countries either by patents or by copyrighted interfaces, the
++original copyright holder who places the Program under this License
++may add an explicit geographical distribution limitation excluding
++those countries, so that distribution is permitted only in or among
++countries not thus excluded.  In such case, this License incorporates
++the limitation as if written in the body of this License.
++
++  9. The Free Software Foundation may publish revised and/or new versions
++of the General Public License from time to time.  Such new versions will
++be similar in spirit to the present version, but may differ in detail to
++address new problems or concerns.
++
++Each version is given a distinguishing version number.  If the Program
++specifies a version number of this License which applies to it and "any
++later version", you have the option of following the terms and conditions
++either of that version or of any later version published by the Free
++Software Foundation.  If the Program does not specify a version number of
++this License, you may choose any version ever published by the Free Software
++Foundation.
++
++  10. If you wish to incorporate parts of the Program into other free
++programs whose distribution conditions are different, write to the author
++to ask for permission.  For software which is copyrighted by the Free
++Software Foundation, write to the Free Software Foundation; we sometimes
++make exceptions for this.  Our decision will be guided by the two goals
++of preserving the free status of all derivatives of our free software and
++of promoting the sharing and reuse of software generally.
++
++			    NO WARRANTY
++
++  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
++REPAIR OR CORRECTION.
++
++  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
++POSSIBILITY OF SUCH DAMAGES.
++
++		     END OF TERMS AND CONDITIONS
++
++	    How to Apply These Terms to Your New Programs
++
++  If you develop a new program, and you want it to be of the greatest
++possible use to the public, the best way to achieve this is to make it
++free software which everyone can redistribute and change under these terms.
++
++  To do so, attach the following notices to the program.  It is safest
++to attach them to the start of each source file to most effectively
++convey the exclusion of warranty; and each file should have at least
++the "copyright" line and a pointer to where the full notice is found.
++
++    <one line to give the program's name and a brief idea of what it does.>
++    Copyright (C) <year>  <name of author>
++
++    This program is free software; you can redistribute it and/or modify
++    it under the terms of the GNU General Public License as published by
++    the Free Software Foundation; either version 2 of the License, or
++    (at your option) any later version.
++
++    This program is distributed in the hope that it will be useful,
++    but WITHOUT ANY WARRANTY; without even the implied warranty of
++    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++    GNU General Public License for more details.
++
++    You should have received a copy of the GNU General Public License along
++    with this program; if not, write to the Free Software Foundation, Inc.,
++    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++
++Also add information on how to contact you by electronic and paper mail.
++
++If the program is interactive, make it output a short notice like this
++when it starts in an interactive mode:
++
++    Gnomovision version 69, Copyright (C) year name of author
++    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
++    This is free software, and you are welcome to redistribute it
++    under certain conditions; type `show c' for details.
++
++The hypothetical commands `show w' and `show c' should show the appropriate
++parts of the General Public License.  Of course, the commands you use may
++be called something other than `show w' and `show c'; they could even be
++mouse-clicks or menu items--whatever suits your program.
++
++You should also get your employer (if you work as a programmer) or your
++school, if any, to sign a "copyright disclaimer" for the program, if
++necessary.  Here is a sample; alter the names:
++
++  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
++  `Gnomovision' (which makes passes at compilers) written by James Hacker.
++
++  <signature of Ty Coon>, 1 April 1989
++  Ty Coon, President of Vice
++
++This General Public License does not permit incorporating your program into
++proprietary programs.  If your program is a subroutine library, you may
++consider it more useful to permit linking proprietary applications with the
++library.  If this is what you want to do, use the GNU Lesser General
++Public License instead of this License.
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
new file mode 100755
index 0000000..bfa0a8d
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm
@@ -0,0 +1,65 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: xserver
+# Required-Start: $local_fs $remote_fs dbus
+# Required-Stop: $local_fs $remote_fs
+# Default-Start:     5
+# Default-Stop:      0 1 2 3 6
+### END INIT INFO
+
+killproc() {            # kill the named process(es)
+        pid=`/bin/pidof $1`
+        [ "$pid" != "" ] && kill $pid
+}
+
+read CMDLINE < /proc/cmdline
+for x in $CMDLINE; do
+        case $x in
+        x11=false)
+		echo "X Server disabled" 
+		exit 0;
+                ;;
+        esac
+done
+
+case "$1" in
+  start)
+       . /etc/profile
+       username=root
+       echo "Starting Xserver"
+       if [ -f /etc/X11/Xusername ]; then
+           username=`cat /etc/X11/Xusername`
+           # setting for rootless X
+           chmod o+w /var/log
+           chmod g+r /dev/tty[0-3]
+           # hidraw device is probably needed
+           if [ -e /dev/hidraw0 ]; then
+               chmod o+rw /dev/hidraw*
+           fi
+       fi
+       # Using su rather than sudo as latest 1.8.1 cause failure [YOCTO #1211]
+       su -l -c '/etc/X11/Xserver&' $username 
+       # Wait for the desktop to say its finished loading
+       # before loading the rest of the system
+       # dbus-wait org.matchbox_project.desktop Loaded
+  ;;
+
+  stop)
+        echo "Stopping XServer"
+        killproc xinit
+        sleep 1
+        chvt 1 &
+  ;;
+
+  restart)
+	$0 stop
+        $0 start
+  ;;
+
+  *)
+        echo "usage: $0 { start | stop | restart }"
+  ;;
+esac
+
+exit 0
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf
new file mode 100644
index 0000000..3c0582a
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf
@@ -0,0 +1 @@
+HOME=/home/root
diff --git a/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service
new file mode 100644
index 0000000..62d979f
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Xserver startup without a display manager
+
+[Service]
+User=root
+EnvironmentFile=/etc/default/xserver-nodm
+ExecStart=/etc/X11/Xserver
+
+[Install]
+Alias=display-manager.service
diff --git a/meta/recipes-graphics/x11vnc/files/endian-fix.patch b/meta/recipes-graphics/x11vnc/files/endian-fix.patch
new file mode 100644
index 0000000..f2a538b
--- /dev/null
+++ b/meta/recipes-graphics/x11vnc/files/endian-fix.patch
@@ -0,0 +1,24 @@
+libvncserver: replace LIBVNCSERVER_WORDS_BIGENDIAN with WORDS_BIGENDIAN
+
+since macro AC_C_BIGENDIAN is used in autoconf and WORDS_BIGENDIAN is
+automatically set for different arch, it is better to use WORDS_BIGENDIAN
+instead of LIBVNCSERVER_WORDS_BIGENDIAN, which cuase issue in mips.
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+Upstream-Status: Pending
+
+diff --git a/libvncserver/main.c b/libvncserver/main.c
+index b6bd930..8bbb7bf 100644
+--- a/libvncserver/main.c
++++ b/libvncserver/main.c
+@@ -47,7 +47,7 @@ static MUTEX(extMutex);
+ 
+ static int rfbEnableLogging=1;
+ 
+-#ifdef LIBVNCSERVER_WORDS_BIGENDIAN
++#ifdef WORDS_BIGENDIAN
+ char rfbEndianTest = (1==0);
+ #else
+ char rfbEndianTest = (1==1);
+
diff --git a/meta/recipes-graphics/x11vnc/files/starting-fix.patch b/meta/recipes-graphics/x11vnc/files/starting-fix.patch
new file mode 100644
index 0000000..f62e405
--- /dev/null
+++ b/meta/recipes-graphics/x11vnc/files/starting-fix.patch
@@ -0,0 +1,25 @@
+"-gui" & "-rfbport" require "wish" installed, or else x11vnc fails to start.
+Removing these 2 parameters makes x11vnc works well on poky sato image.
+
+Add also -skip_lockkeys option to ignore all Caps_Lock, Shift_Lock, Num_Lock,
+Scroll_Lock keysyms received from viewers, in order to leave the lock state on
+the server side unchanged. Yet, the keys will appear correctly.
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: x11vnc-0.9.12/x11vnc/x11vnc.desktop
+===================================================================
+--- x11vnc-0.9.12.orig/x11vnc/x11vnc.desktop	2011-03-03 10:33:18.000000000 +0800
++++ x11vnc-0.9.12/x11vnc/x11vnc.desktop	2011-03-03 10:35:20.000000000 +0800
+@@ -1,7 +1,7 @@
+ [Desktop Entry]
+ Name=X11VNC Server
+ Comment=Share this desktop by VNC
+-Exec=x11vnc -gui tray=setpass -rfbport PROMPT -bg -o %%HOME/.x11vnc.log.%%VNCDISPLAY
++Exec=x11vnc -bg -rfbport 5900 -skip_lockkeys -o %%HOME/.x11vnc.log.%%VNCDISPLAY
+ Icon=computer
+ Terminal=false
+ Type=Application
diff --git a/meta/recipes-graphics/x11vnc/x11vnc_0.9.13.bb b/meta/recipes-graphics/x11vnc/x11vnc_0.9.13.bb
new file mode 100644
index 0000000..ec0241f
--- /dev/null
+++ b/meta/recipes-graphics/x11vnc/x11vnc_0.9.13.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Exports your X session on-the-fly via VNC"
+HOMEPAGE = "http://www.karlrunge.com/x11vnc/"
+
+SECTION = "x11/utils"
+AUTHOR = "Karl Runge"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=361b6b837cad26c6900a926b62aada5f \
+                    file://x11vnc/x11vnc.h;endline=33;md5=6f95dc6535467d7ee1563fd434fb372e"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libvncserver/x11vnc/${PV}/x11vnc-${PV}.tar.gz\
+           file://starting-fix.patch \
+           file://endian-fix.patch "
+
+SRC_URI[md5sum] = "a372ec4fe8211221547b1c108cf56e4c"
+SRC_URI[sha256sum] = "f6829f2e629667a5284de62b080b13126a0736499fe47cdb447aedb07a59f13b"
+
+DEPENDS = "openssl virtual/libx11 libxext jpeg zlib libxfixes libxrandr libxdamage libxtst"
+
+inherit autotools-brokensep distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)}"
+PACKAGECONFIG[avahi] = "--with-avahi,--without-avahi,avahi"
+PACKAGECONFIG[xinerama] = "--with-xinerama,--without-xinerama,libxinerama"
diff --git a/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme-0.1.1/fix_watch_cursor.patch b/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme-0.1.1/fix_watch_cursor.patch
new file mode 100644
index 0000000..cfac55c
--- /dev/null
+++ b/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme-0.1.1/fix_watch_cursor.patch
@@ -0,0 +1,17 @@
+Fix typo in Makefile
+
+Upstream-Status: Pending
+
+Index: xcursor-transparent-theme-0.1.1/cursors/Makefile.am
+===================================================================
+--- xcursor-transparent-theme-0.1.1.orig/cursors/Makefile.am	2013-03-07 22:25:04.001435305 +0000
++++ xcursor-transparent-theme-0.1.1/cursors/Makefile.am	2013-03-07 22:25:04.061435302 +0000
+@@ -79,7 +79,7 @@
+ 	ul_angle \
+ 	ur_angle \
+ 	v_double_arrow \
+-	watcha \
++	watch \
+ 	xterm  
+ 
+ CURSOR_DIR = $(datadir)/icons/xcursor-transparent/cursors
diff --git a/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme-0.1.1/use-relative-symlinks.patch b/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme-0.1.1/use-relative-symlinks.patch
new file mode 100644
index 0000000..5028fd6
--- /dev/null
+++ b/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme-0.1.1/use-relative-symlinks.patch
@@ -0,0 +1,25 @@
+Use relative symlink for link rather than absolute path which 
+doesn't work well in DESTDIR setting.
+
+Also fix out of tree builds to use correct srcdir.
+
+Upstream-Status: Pending
+
+RP 2013/3/8
+
+Index: xcursor-transparent-theme-0.1.1/cursors/Makefile.am
+===================================================================
+--- xcursor-transparent-theme-0.1.1.orig/cursors/Makefile.am	2013-03-07 22:25:03.933435307 +0000
++++ xcursor-transparent-theme-0.1.1/cursors/Makefile.am	2013-03-07 22:25:27.293434755 +0000
+@@ -88,9 +88,9 @@
+ 
+ install-data-local:
+ 	$(mkinstalldirs) $(DESTDIR)$(CURSOR_DIR); 
+-	$(INSTALL_DATA) $(CURSOR_REAL) $(DESTDIR)$(CURSOR_DIR)/ 
++	$(INSTALL_DATA) $(srcdir)/$(CURSOR_REAL) $(DESTDIR)$(CURSOR_DIR)/
+ 	for CURSOR in $(CURSOR_NAMES); do \
+ 		echo '-- Installing cursor '$$CURSOR; \
+-		ln -s $(DESTDIR)$(CURSOR_DIR)/transp $(DESTDIR)$(CURSOR_DIR)/$$CURSOR; \
++		ln -s transp $(DESTDIR)$(CURSOR_DIR)/$$CURSOR; \
+ 	done
+ 
diff --git a/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb b/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb
new file mode 100644
index 0000000..5e668ab
--- /dev/null
+++ b/meta/recipes-graphics/xcursor-transparent-theme/xcursor-transparent-theme_0.1.1.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Transparent X11 cursor theme for touchscreens"
+HOMEPAGE = "http://www.matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+SECTION = "x11/base"
+PR = "r4"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/matchbox/utils/xcursor-transparent-theme-${PV}.tar.gz \
+	   file://use-relative-symlinks.patch \
+	   file://fix_watch_cursor.patch"
+
+SRC_URI[md5sum] = "7b0c623049d4aab20600d6473f8aab23"
+SRC_URI[sha256sum] = "b26adf2d503d01299718390ae39dab4691a67220de09423be0364e9a060bf7e4"
+FILES_${PN} = "${datadir}/icons/xcursor-transparent/cursors/*"
+
+inherit autotools allarch
diff --git a/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput b/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
new file mode 100644
index 0000000..9633fc5
--- /dev/null
+++ b/meta/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
@@ -0,0 +1 @@
+# replace with valid machine specific pointercal.xinput
diff --git a/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb b/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
new file mode 100644
index 0000000..65348c3
--- /dev/null
+++ b/meta/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Touchscreen calibration data from xinput-calibrator"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r7"
+
+SRC_URI = "file://pointercal.xinput"
+S = "${WORKDIR}"
+
+do_install() {
+    # Only install file if it has a contents
+    if [ -s ${S}/pointercal.xinput ] &&\
+       [ ! -n "$(head -n1 ${S}/pointercal.xinput|grep "replace.*pointercal\.xinput")" ]; then
+        install -d ${D}${sysconfdir}/
+        install -m 0644 ${S}/pointercal.xinput ${D}${sysconfdir}/
+    fi
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+CONFFILES_${PN} = "${sysconfdir}/pointercal.xinput"
diff --git a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh
new file mode 100644
index 0000000..5290726
--- /dev/null
+++ b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/30xinput_calibrate.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+. /etc/formfactor/config
+
+if [ "$HAVE_TOUCHSCREEN" = "1" ]; then
+	/usr/bin/xinput_calibrator_once.sh
+fi
diff --git a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch
new file mode 100644
index 0000000..8698292
--- /dev/null
+++ b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator/Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch
@@ -0,0 +1,66 @@
+Upstream-Status: Pending
+
+From 14734a93bd3fc323325459e24b04795422e395e6 Mon Sep 17 00:00:00 2001
+From: Laurentiu Palcu <laurentiu.palcu@intel.com>
+Date: Mon, 1 Jul 2013 15:38:02 +0300
+Subject: [PATCH] Allow xinput_calibrator_pointercal.sh to be run as normal
+ user
+
+Allow normal user to create their own pointercal.xinput files that
+override the system pointercal file in /etc.
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+---
+ scripts/xinput_calibrator_pointercal.sh |   33 +++++++++++++++++++++----------
+ 1 file changed, 23 insertions(+), 10 deletions(-)
+
+diff --git a/scripts/xinput_calibrator_pointercal.sh b/scripts/xinput_calibrator_pointercal.sh
+index fccb197..0ada7da 100755
+--- a/scripts/xinput_calibrator_pointercal.sh
++++ b/scripts/xinput_calibrator_pointercal.sh
+@@ -11,19 +11,32 @@
+ PATH="/usr/bin:$PATH"
+ 
+ BINARY="xinput_calibrator"
+-CALFILE="/etc/pointercal.xinput"
+-LOGFILE="/var/log/xinput_calibrator.pointercal.log"
++SYS_CALFILE="/etc/pointercal.xinput"
++USER_CALFILE="$HOME/.pointercal/pointercal.xinput"
+ 
+-if [ -e $CALFILE ] ; then
+-  if grep replace $CALFILE ; then
+-    echo "Empty calibration file found, removing it"
+-    rm $CALFILE
+-  else
+-    echo "Using calibration data stored in $CALFILE"
+-    . $CALFILE && exit 0
+-  fi
++if [ "$USER" = "root" ]; then
++  LOGFILE="/var/log/xinput_calibrator.pointercal.log"
++  CALFILES="$SYS_CALFILE"
++else
++  LOGFILE="$HOME/.pointercal/xinput_calibrator.pointercal.log"
++  CALFILES="$USER_CALFILE $SYS_CALFILE"
++  mkdir -p "$HOME/.pointercal"
+ fi
+ 
++for CALFILE in $CALFILES; do
++  if [ -e $CALFILE ]; then
++    if grep replace $CALFILE ; then
++      echo "Empty calibration file found, removing it"
++      rm $CALFILE 2>/dev/null || true
++    else
++      echo "Using calibration data stored in $CALFILE"
++      . $CALFILE && exit 0
++    fi
++  fi
++done
++
++[ "$USER" != "root" ] && CALFILE=$USER_CALFILE
++
+ CALDATA=`$BINARY --output-type xinput -v | tee $LOGFILE | grep '    xinput set' | sed 's/^    //g; s/$/;/g'`
+ if [ ! -z "$CALDATA" ] ; then
+   echo $CALDATA > $CALFILE
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
new file mode 100644
index 0000000..a9de3d7
--- /dev/null
+++ b/meta/recipes-graphics/xinput-calibrator/xinput-calibrator_git.bb
@@ -0,0 +1,37 @@
+SUMMARY = "Touchscreen calibration program for X11"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/xinput_calibrator"
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://src/calibrator.cpp;endline=22;md5=1bcba08f67cdb56f34021557898e4b5a"
+DEPENDS = "virtual/libx11 libxi"
+
+PV = "0.7.5+git${SRCPV}"
+PR = "r6"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRCREV = "c01c5af807cb4b0157b882ab07a893df9a810111"
+SRC_URI = "git://github.com/tias/xinput_calibrator.git \
+           file://30xinput_calibrate.sh \
+           file://Allow-xinput_calibrator_pointercal.sh-to-be-run-as-n.patch"
+
+S = "${WORKDIR}/git"
+
+# force native X11 ui as we don't have gtk+ in DEPENDS
+EXTRA_OECONF += "--with-gui=x11"
+
+do_install_append() {
+    install -d ${D}${bindir}
+    install -m 0755 ${S}/scripts/xinput_calibrator_pointercal.sh ${D}${bindir}/xinput_calibrator_once.sh
+
+    install -d ${D}${sysconfdir}/X11/Xsession.d/
+    install -m 0755 ${WORKDIR}/30xinput_calibrate.sh ${D}${sysconfdir}/X11/Xsession.d/
+
+    install -d ${D}${sysconfdir}/xdg/autostart
+    sed -e 's,^Exec=.*,Exec=${bindir}/xinput_calibrator_once.sh,' ${S}/scripts/xinput_calibrator.desktop > ${D}${sysconfdir}/xdg/autostart/xinput_calibrator.desktop
+}
+
+FILES_${PN} += "${sysconfdir}/xdg/autostart"
+RDEPENDS_${PN} = "xinput formfactor"
+RRECOMMENDS_${PN} = "pointercal-xinput"
diff --git a/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb b/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb
new file mode 100644
index 0000000..a453e24
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/mkfontdir_1.0.7.bb
@@ -0,0 +1,22 @@
+require xorg-app-common.inc
+
+SUMMARY = "A program to create an index of X font files in a directory"
+
+DESCRIPTION = "For each directory argument, mkfontdir reads all of the \
+font files in the directory. The font names and related data are written \
+out to the files \"fonts.dir\", \"fonts.scale\", and \"fonts.alias\".  \
+The X server and font server use these files to find the available font \
+files."
+
+PE = "1"
+PR = "${INC_PR}.0"
+
+RDEPENDS_${PN} += "mkfontscale"
+RDEPENDS_${PN}_class-native += "mkfontscale-native"
+
+BBCLASSEXTEND = "native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b4fcf2b90cadbfc15009b9e124dc3a3f"
+
+SRC_URI[md5sum] = "18c429148c96c2079edda922a2b67632"
+SRC_URI[sha256sum] = "56d52a482df130484e51fd066d1b6eda7c2c02ddbc91fe6e2be1b9c4e7306530"
diff --git a/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb b/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb
new file mode 100644
index 0000000..31cf186
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/mkfontscale_1.1.2.bb
@@ -0,0 +1,18 @@
+require xorg-app-common.inc
+
+SUMMARY = "A program to create an index of scalable font files for X"
+
+DESCRIPTION = "For each directory argument, mkfontscale reads all of the \
+scalable font files in the directory. For every font file found, an X11 \
+font name (XLFD) is generated, and is written together with the file \
+name to a file fonts.scale in the directory.  The resulting fonts.scale \
+is used by the mkfontdir program."
+
+DEPENDS = "util-macros-native zlib libfontenc freetype xproto"
+
+BBCLASSEXTEND = "native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=2e0d129d05305176d1a790e0ac1acb7f"
+
+SRC_URI[md5sum] = "9bdd6ebfa62b1bbd474906ac86a40fd8"
+SRC_URI[sha256sum] = "8c6d5228af885477b9aec60ca6f172578e7d2de42234357af62fb00439453f20"
diff --git a/meta/recipes-graphics/xorg-app/rgb_1.0.6.bb b/meta/recipes-graphics/xorg-app/rgb_1.0.6.bb
new file mode 100644
index 0000000..8726804
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/rgb_1.0.6.bb
@@ -0,0 +1,16 @@
+require xorg-app-common.inc
+
+SUMMARY = "X11 color name database"
+DESCRIPTION = "This package includes both the list mapping X color names \
+to RGB values (rgb.txt) and, if configured to use a database for color \
+lookup, the rgb program to convert the text file into the binary database \
+format."
+
+DEPENDS += " xproto util-macros"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ef598adbe241bd0b0b9113831f6e249a"
+PE = "1"
+
+SRC_URI[md5sum] = "eab5bbd7642e5c784429307ec210d198"
+SRC_URI[sha256sum] = "bbca7c6aa59939b9f6a0fb9fff15dfd62176420ffd4ae30c8d92a6a125fbe6b0"
+
+FILES_${PN} += "${datadir}/X11"
diff --git a/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb b/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb
new file mode 100644
index 0000000..4e93558
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/x11perf_1.6.0.bb
@@ -0,0 +1,19 @@
+require xorg-app-common.inc
+
+SUMMARY = "X11 server performance test program"
+
+DESCRIPTION = "The x11perf program runs one or more performance tests \
+and reports how fast an X server can execute the tests."
+
+
+DEPENDS += "libxmu libxrender libxft libxext fontconfig"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=428ca4d67a41fcd4fc3283dce9bbda7e \
+                    file://x11perf.h;endline=24;md5=29555066baf406a105ff917ac25b2d01"
+
+PE = "1"
+
+FILES_${PN} += "${libdir}/X11/x11perfcomp/*"
+
+SRC_URI[md5sum] = "f0b24e4d8beb622a419e8431e1c03cd7"
+SRC_URI[sha256sum] = "e87098dec1947572d70c62697a7b70bde1ab5668237d4660080eade6bc096751"
diff --git a/meta/recipes-graphics/xorg-app/xauth_1.0.9.bb b/meta/recipes-graphics/xorg-app/xauth_1.0.9.bb
new file mode 100644
index 0000000..b173f4f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xauth_1.0.9.bb
@@ -0,0 +1,12 @@
+require xorg-app-common.inc
+SUMMARY = "X authority utilities"
+DESCRIPTION = "X application to edit and display the authorization \
+information used in connecting to the X server."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5ec74dd7ea4d10c4715a7c44f159a40b"
+
+DEPENDS += "libxau libxext libxmu"
+PE = "1"
+
+SRC_URI[md5sum] = "7d6003f32838d5b688e2c8a131083271"
+SRC_URI[sha256sum] = "56ce1523eb48b1f8a4f4244fe1c3d8e6af1a3b7d4b0e6063582421b0b68dc28f"
diff --git a/meta/recipes-graphics/xorg-app/xdpyinfo/disable-xkb.patch b/meta/recipes-graphics/xorg-app/xdpyinfo/disable-xkb.patch
new file mode 100644
index 0000000..1e8199c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xdpyinfo/disable-xkb.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+Index: xdpyinfo-1.3.0/configure.ac
+===================================================================
+--- xdpyinfo-1.3.0.orig/configure.ac	2011-10-21 21:34:21.000000000 -0700
++++ xdpyinfo-1.3.0/configure.ac	2011-11-28 20:06:56.554056935 -0800
+@@ -47,11 +47,15 @@
+ 	AC_CHECK_HEADERS([X11/extensions/multibuf.h X11/extensions/XShm.h],,,[#include <X11/Xlib.h>])
+ 	CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
+ 
++AC_ARG_ENABLE(xkb, AC_HELP_STRING([--disable-xkb], [Disable XKB support]),
++	XKB="$enableval", XKB="yes")
++if test "x$XKB" = "xyes" ; then
+ PKG_CHECK_MODULES(DPY_XKB, x11,
+ 	[SAVE_CPPFLAGS="$CPPFLAGS"
+ 	CPPFLAGS="$CPPFLAGS $DPY_XKB_CFLAGS $DPY_X11_CFLAGS"
+ 	AC_CHECK_HEADERS([X11/extensions/XKB.h X11/XKBlib.h],,,[#include <X11/Xlib.h>])
+ 	CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
++fi
+ 
+ PKG_CHECK_MODULES(DPY_XF86VIDMODE, xxf86vm,
+ 	[SAVE_CPPFLAGS="$CPPFLAGS"
diff --git a/meta/recipes-graphics/xorg-app/xdpyinfo_1.3.2.bb b/meta/recipes-graphics/xorg-app/xdpyinfo_1.3.2.bb
new file mode 100644
index 0000000..af04bb6
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xdpyinfo_1.3.2.bb
@@ -0,0 +1,20 @@
+require xorg-app-common.inc
+
+SUMMARY = "Display information utility for X"
+
+DESCRIPTION = "Xdpyinfo is a utility for displaying information about an \
+X server. It is used to examine the capabilities of a server, the \
+predefined values for various parameters used in communicating between \
+clients and the server, and the different types of screens and visuals \
+that are available."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=f3d09e6b9e203a1af489e16c708f4fb3"
+DEPENDS += "libxtst libxext libxxf86vm libxxf86dga libxxf86misc libxi libxrender libxinerama libdmx libxau libxcomposite"
+PE = "1"
+
+SRC_URI += "file://disable-xkb.patch"
+
+SRC_URI[md5sum] = "8809037bd48599af55dad81c508b6b39"
+SRC_URI[sha256sum] = "30238ed915619e06ceb41721e5f747d67320555cc38d459e954839c189ccaf51"
+
+EXTRA_OECONF = "--disable-xkb"
diff --git a/meta/recipes-graphics/xorg-app/xev/diet-x11.patch b/meta/recipes-graphics/xorg-app/xev/diet-x11.patch
new file mode 100644
index 0000000..6130959
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xev/diet-x11.patch
@@ -0,0 +1,82 @@
+Upstream-Status: Inappropriate [disable feature]
+
+---
+ xev.c |   16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+Index: xev-1.2.0/xev.c
+===================================================================
+--- xev-1.2.0.orig/xev.c
++++ xev-1.2.0/xev.c
+@@ -116,7 +116,7 @@ do_KeyPress (XEvent *eventp)
+     nbytes = XLookupString (e, str, 256, &ks, NULL);
+ 
+     /* not supposed to call XmbLookupString on a key release event */
+-    if (e->type == KeyPress && xic) {
++    /*if (e->type == KeyPress && xic) {
+         do {
+             nmbbytes = XmbLookupString (xic, e, buf, bsize - 1, &ks, &status);
+             buf[nmbbytes] = '\0';
+@@ -126,7 +126,7 @@ do_KeyPress (XEvent *eventp)
+                 buf = realloc (buf, bsize);
+             }
+         } while (status == XBufferOverflow);
+-    }
++    }*/
+ 
+     if (ks == NoSymbol)
+ 	ksname = "NoSymbol";
+@@ -156,7 +156,7 @@ do_KeyPress (XEvent *eventp)
+     }
+ 
+     /* not supposed to call XmbLookupString on a key release event */
+-    if (e->type == KeyPress && xic) {
++    /*if (e->type == KeyPress && xic) {
+         printf ("    XmbLookupString gives %d bytes: ", nmbbytes);
+         if (nmbbytes > 0) {
+            dump (buf, nmbbytes);
+@@ -164,7 +164,7 @@ do_KeyPress (XEvent *eventp)
+         } else {
+     	   printf ("\n");
+         }
+-    }
++    } */
+ 
+     printf ("    XFilterEvent returns: %s\n",
+ 	    XFilterEvent (eventp, e->window) ? "True" : "False");
+@@ -1015,7 +1015,7 @@ main (int argc, char **argv)
+         fprintf (stderr, "%s:  XSetLocaleModifiers failed\n", ProgramName);
+     }
+ 
+-    xim = XOpenIM (dpy, NULL, NULL, NULL);
++    /*xim = XOpenIM (dpy, NULL, NULL, NULL);
+     if (xim == NULL) {
+         fprintf (stderr, "%s:  XOpenIM failed\n", ProgramName);
+     }
+@@ -1042,7 +1042,7 @@ main (int argc, char **argv)
+             }
+             XFree (xim_styles);
+         }
+-    }
++	}*/
+ 
+     screen = DefaultScreen (dpy);
+ 
+@@ -1109,7 +1109,7 @@ main (int argc, char **argv)
+ 	printf ("Outer window is 0x%lx, inner window is 0x%lx\n", w, subw);
+     }
+ 
+-    if (xim && xim_style) {
++    /*if (xim && xim_style) {
+         xic = XCreateIC (xim,
+                          XNInputStyle, xim_style,
+                          XNClientWindow, w,
+@@ -1119,7 +1119,7 @@ main (int argc, char **argv)
+         if (xic == NULL) {
+             fprintf (stderr, "XCreateIC failed\n");
+         }
+-    }
++    }*/
+ 
+     have_rr = XRRQueryExtension (dpy, &rr_event_base, &rr_error_base);
+     if (have_rr) {
diff --git a/meta/recipes-graphics/xorg-app/xev_1.2.2.bb b/meta/recipes-graphics/xorg-app/xev_1.2.2.bb
new file mode 100644
index 0000000..f151b57
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xev_1.2.2.bb
@@ -0,0 +1,18 @@
+require xorg-app-common.inc
+
+SUMMARY = "X Event Viewer"
+DESCRIPTION = "Xev creates a window and then asks the X server to send it events \
+whenever anything happens to the window (such as it being moved, resized, \
+typed in, clicked in, etc.). You can also attach it to an existing window."
+
+LIC_FILES_CHKSUM = "file://xev.c;beginline=1;endline=33;md5=577c99421f1803b891d2c79097ae4682"
+LICENSE = "MIT"
+
+PE = "1"
+
+DEPENDS += "libxrandr xproto"
+
+SRC_URI += "file://diet-x11.patch"
+
+SRC_URI[md5sum] = "249bdde90f01c0d861af52dc8fec379e"
+SRC_URI[sha256sum] = "d94ae62a6c1af56c2961d71f5782076ac4116f0fa4e401420ac7e0db33dc314f"
diff --git a/meta/recipes-graphics/xorg-app/xeyes_1.1.1.bb b/meta/recipes-graphics/xorg-app/xeyes_1.1.1.bb
new file mode 100644
index 0000000..84d0cb8
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xeyes_1.1.1.bb
@@ -0,0 +1,14 @@
+require xorg-app-common.inc
+
+SUMMARY = "X11 eyes that follow the mouse cursor demo"
+DESCRIPTION = "Xeyes is a small X11 application that shows a pair of eyes that move to \
+follow the location of the mouse cursor around the screen."
+
+PE = "1"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3ea51b365051ac32d1813a7dbaa4bfc6"
+
+SRC_URI[md5sum] = "a3035dcecdbdb89e864177c080924981"
+SRC_URI[sha256sum] = "975e98680cd59e1f9439016386609546ed08c284d0f05a95276f96aca6e8a521"
+
+DEPENDS += "libxau libxt libxext libxmu libxrender"
diff --git a/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb b/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb
new file mode 100644
index 0000000..825737f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xhost_1.0.7.bb
@@ -0,0 +1,17 @@
+require xorg-app-common.inc
+
+SUMMARY = "Server access control program for X"
+
+DESCRIPTION = "The xhost program is used to add and delete host names or \
+user names to the list allowed to make connections to the X server. In \
+the case of hosts, this provides a rudimentary form of privacy control \
+and security. Environments which require more sophisticated measures \
+should implement the user-based mechanism or use the hooks in the \
+protocol for passing other authentication data to the server."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8fbed71dddf48541818cef8079124199"
+DEPENDS += "libxmu libxau"
+PE = "1"
+
+SRC_URI[md5sum] = "f5d490738b148cb7f2fe760f40f92516"
+SRC_URI[sha256sum] = "93e619ee15471f576cfb30c663e18f5bc70aca577a63d2c2c03f006a7837c29a"
diff --git a/meta/recipes-graphics/xorg-app/xinit_1.3.4.bb b/meta/recipes-graphics/xorg-app/xinit_1.3.4.bb
new file mode 100644
index 0000000..9318518
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xinit_1.3.4.bb
@@ -0,0 +1,20 @@
+require xorg-app-common.inc
+
+SUMMARY = "X Window System initializer"
+
+DESCRIPTION = "The xinit program is used to start the X Window System \
+server and a first client program on systems that cannot start X \
+directly from /etc/init or in environments that use multiple window \
+systems. When this first client exits, xinit will kill the X server and \
+then terminate."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=18f01e7b39807bebe2b8df101a039b68"
+
+PE = "1"
+
+SRC_URI[md5sum] = "4e928452dfaf73851413a2d8b8c76388"
+SRC_URI[sha256sum] = "75d88d7397a07e01db253163b7c7a00b249b3d30e99489f2734cac9a0c7902b3"
+
+EXTRA_OECONF = "ac_cv_path_MCOOKIE=${bindir}/mcookie"
+
+RDEPENDS_${PN} += "util-linux-mcookie"
diff --git a/meta/recipes-graphics/xorg-app/xinput_1.6.1.bb b/meta/recipes-graphics/xorg-app/xinput_1.6.1.bb
new file mode 100644
index 0000000..5befcc8
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xinput_1.6.1.bb
@@ -0,0 +1,14 @@
+require xorg-app-common.inc
+
+SUMMARY = "Runtime configuration and test of XInput devices"
+
+DESCRIPTION = "Xinput is an utility for configuring and testing XInput devices"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=881525f89f99cad39c9832bcb72e6fa5"
+
+DEPENDS += " libxi libxrandr libxinerama"
+
+
+SRC_URI[md5sum] = "305980ac78a6954e306a14d80a54c441"
+SRC_URI[sha256sum] = "b7632d0f228a8a6be93b09857ea413940fcf44091e60f4a0fe9f5fd82efd871f"
+
diff --git a/meta/recipes-graphics/xorg-app/xkbcomp_1.3.0.bb b/meta/recipes-graphics/xorg-app/xkbcomp_1.3.0.bb
new file mode 100644
index 0000000..efac069
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xkbcomp_1.3.0.bb
@@ -0,0 +1,19 @@
+require xorg-app-common.inc
+
+SUMMARY = "A program to compile XKB keyboard description"
+
+DESCRIPTION = "The xkbcomp keymap compiler converts a description of an \
+XKB keymap into one of several output formats. The most common use for \
+xkbcomp is to create a compiled keymap file (.xkm extension) which can \
+be read directly by XKB-capable X servers or utilities."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=08436e4f4476964e2e2dd7e7e41e076a"
+
+PR = "${INC_PR}.0"
+
+DEPENDS += "libxkbfile"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "0012a8e3092cddf7f87b250f96bb38c5"
+SRC_URI[sha256sum] = "cfac973778fabf5216121ad60b7af8ab74ce7513af0f9260cf8c5309e1622b2a"
diff --git a/meta/recipes-graphics/xorg-app/xmodmap_1.0.9.bb b/meta/recipes-graphics/xorg-app/xmodmap_1.0.9.bb
new file mode 100644
index 0000000..2deac6a
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xmodmap_1.0.9.bb
@@ -0,0 +1,17 @@
+require xorg-app-common.inc
+
+SUMMARY = "Utility for modifying keymaps and pointer button mappings in X"
+
+DESCRIPTION = "The xmodmap program is used to edit and display the \
+keyboard modifier map and keymap table that are used by client \
+applications to convert event keycodes into keysyms. It is usually run \
+from the user's session startup script to configure the keyboard \
+according to personal tastes."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=272c17e96370e1e74773fa22d9989621"
+
+PE = "1"
+
+SRC_URI[md5sum] = "723f02d3a5f98450554556205f0a9497"
+SRC_URI[sha256sum] = "b7b0e5cc5f10d0fb6d2d6ea4f00c77e8ac0e847cc5a73be94cd86139ac4ac478"
diff --git a/meta/recipes-graphics/xorg-app/xorg-app-common.inc b/meta/recipes-graphics/xorg-app/xorg-app-common.inc
new file mode 100644
index 0000000..3529cb2
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xorg-app-common.inc
@@ -0,0 +1,17 @@
+SUMMARY = "X application"
+HOMEPAGE = "http://www.x.org/"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11/apps"
+LICENSE = "MIT-X"
+DEPENDS = "util-macros-native virtual/libx11"
+
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+INC_PR = "r8"
+
+SRC_URI = "${XORG_MIRROR}/individual/app/${BPN}-${PV}.tar.bz2"
+
+inherit autotools pkgconfig distro_features_check
+
+FILES_${PN} += " ${libdir}/X11/${BPN} ${datadir}/X11/app-defaults/"
diff --git a/meta/recipes-graphics/xorg-app/xprop_1.2.2.bb b/meta/recipes-graphics/xorg-app/xprop_1.2.2.bb
new file mode 100644
index 0000000..d78bf0451
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xprop_1.2.2.bb
@@ -0,0 +1,18 @@
+require xorg-app-common.inc
+
+SUMMARY = "Utility to display window and font properties of an X server"
+
+DESCRIPTION = "The xprop utility is for displaying window and font \
+properties in an X server. One window or font is selected using the \
+command line arguments or possibly in the case of a window, by clicking \
+on the desired window. A list of properties is then given, possibly with \
+formatting information."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e226ab8db88ac0bc0391673be40c9f91"
+
+DEPENDS += "libxmu"
+
+PE = "1"
+
+SRC_URI[md5sum] = "fae3d2fda07684027a643ca783d595cc"
+SRC_URI[sha256sum] = "9bee88b1025865ad121f72d32576dd3027af1446774aa8300cce3c261d869bc6"
diff --git a/meta/recipes-graphics/xorg-app/xrandr_1.4.3.bb b/meta/recipes-graphics/xorg-app/xrandr_1.4.3.bb
new file mode 100644
index 0000000..41bd420
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xrandr_1.4.3.bb
@@ -0,0 +1,15 @@
+require xorg-app-common.inc
+
+SUMMARY = "XRandR: X Resize, Rotate and Reflect extension command"
+
+DESCRIPTION = "Xrandr is used to set the size, orientation and/or \
+reflection of the outputs for a screen. It can also set the screen \
+size."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fe1608bdb33cf8c62a4438f7d34679b3"
+DEPENDS += "libxrandr libxrender"
+PE = "1"
+
+SRC_URI[md5sum] = "441fdb98d2abc6051108b7075d948fc7"
+SRC_URI[sha256sum] = "7154ac3486b86923692f2d6cdb2991a2ee72bc32af2c4379a6f1c068f204be1b"
diff --git a/meta/recipes-graphics/xorg-app/xset/disable-xkb.patch b/meta/recipes-graphics/xorg-app/xset/disable-xkb.patch
new file mode 100644
index 0000000..97d13a3
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xset/disable-xkb.patch
@@ -0,0 +1,26 @@
+add "-disable-xkb" option
+
+Upstream-Status: Pending
+
+Rebase for 1.2.1 by: Yu Ke <ke.yu@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 81c3ae4..26601bf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,11 +52,15 @@ PKG_CHECK_MODULES(SET_XEXT, xext,
+ 	AC_CHECK_HEADERS([X11/extensions/dpms.h X11/extensions/MITMisc.h],,,[#include <X11/Xlib.h>])
+ 	CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
+ 
++AC_ARG_ENABLE(xkb, AC_HELP_STRING([--disable-xkb], [Disable XKB support]),
++		XKB="$enableval", XKB="yes")
++if test "x$XKB" = "xyes" ; then
+ PKG_CHECK_MODULES(SET_XKB, x11,
+ 	[SAVE_CPPFLAGS="$CPPFLAGS"
+ 	CPPFLAGS="$CPPFLAGS $SET_XKB_CFLAGS $SET_X11_CFLAGS"
+ 	AC_CHECK_HEADERS([X11/XKBlib.h],,,[#include <X11/Xlib.h>])
+ 	CPPFLAGS="$SAVE_CPPFLAGS"],[echo "not found"])
++fi
+ 
+ AC_ARG_WITH(xf86misc, AC_HELP_STRING([--without-xf86misc],[Disable xf86misc support.]),
+                 [USE_XF86MISC="$withval"], [USE_XF86MISC="yes"])
diff --git a/meta/recipes-graphics/xorg-app/xset_1.2.3.bb b/meta/recipes-graphics/xorg-app/xset_1.2.3.bb
new file mode 100644
index 0000000..f683b76
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xset_1.2.3.bb
@@ -0,0 +1,19 @@
+require xorg-app-common.inc
+
+SUMMARY = "Utility for setting various user preference options of the display"
+
+DESCRIPTION = "xset is a utility that is used to set various user \
+preference options of the display."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bea81cc9827cdf1af0e12c2b8228cf8d"
+DEPENDS += "libxext libxxf86misc libxmu libxau"
+PE = "1"
+
+SRC_URI += "file://disable-xkb.patch"
+
+SRC_URI[md5sum] = "dcd227388b57487d543cab2fd7a602d7"
+SRC_URI[sha256sum] = "4382f4fb29b88647e13f3b4bc29263134270747fc159cfc5f7e3af23588c8063"
+
+CFLAGS += "-D_GNU_SOURCE"
+EXTRA_OECONF = "--disable-xkb --without-fontcache"
diff --git a/meta/recipes-graphics/xorg-app/xvinfo_1.1.3.bb b/meta/recipes-graphics/xorg-app/xvinfo_1.1.3.bb
new file mode 100644
index 0000000..2965ef7
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xvinfo_1.1.3.bb
@@ -0,0 +1,14 @@
+require xorg-app-common.inc
+
+SUMMARY = "Print out X-Video extension adaptor information"
+
+DESCRIPTION = "xvinfo prints out the capabilities of any video adaptors \
+associated with the display that are accessible through the X-Video \
+extension."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b664101ad7a1dc758a4c4109bf978e68"
+DEPENDS += " libxv"
+PE = "1"
+
+SRC_URI[md5sum] = "558360176b718dee3c39bc0648c0d10c"
+SRC_URI[sha256sum] = "9fba8b68daf53863e66d5004fa9c703fcecf69db4d151ea2d3d885d621e6e5eb"
diff --git a/meta/recipes-graphics/xorg-app/xwininfo_1.1.3.bb b/meta/recipes-graphics/xorg-app/xwininfo_1.1.3.bb
new file mode 100644
index 0000000..7a45241
--- /dev/null
+++ b/meta/recipes-graphics/xorg-app/xwininfo_1.1.3.bb
@@ -0,0 +1,15 @@
+require xorg-app-common.inc
+
+SUMMARY = "Window information utility for X"
+
+DESCRIPTION = "Xwininfo is a utility for displaying information about \
+windows.  Information may include window position, size, color depth, \
+and a number of other items."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=78976cd3115f6faf615accc4e094d90e"
+DEPENDS += "libxext libxmu"
+
+PE = "0"
+
+SRC_URI[md5sum] = "b777bafb674555e48fd8437618270931"
+SRC_URI[sha256sum] = "218eb0ea95bd8de7903dfaa26423820c523ad1598be0751d2d8b6a2c23b23ff8"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.9.2.bb b/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.9.2.bb
new file mode 100644
index 0000000..66428df
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-input-evdev_2.9.2.bb
@@ -0,0 +1,20 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- event devices (evdev) input driver"
+
+DESCRIPTION = "evdev is an Xorg input driver for Linux's generic event \
+devices. It therefore supports all input devices that the kernel knows \
+about, including most mice and keyboards. \
+\
+The evdev driver can serve as both a pointer and a keyboard input \
+device, and may be used as both the core keyboard and the core pointer. \
+Multiple input devices are supported by multiple instances of this \
+driver, with one Load directive for evdev in the Module section of your \
+xorg.conf for each input device that will use this driver. "
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=fefe33b1cf0cacba0e72e3b0fa0f0e16"
+
+DEPENDS += "mtdev libevdev"
+
+SRC_URI[md5sum] = "99eebf171e6c7bffc42d4fc430d47454"
+SRC_URI[sha256sum] = "792329b531afc6928ccda94e4b51a5520d4ddf8ef9a00890a5d0d31898acefec"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.8.1.bb b/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.8.1.bb
new file mode 100644
index 0000000..6fe51ac
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_1.8.1.bb
@@ -0,0 +1,13 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- keyboard input driver"
+
+DESCRIPTION = "keyboard is an Xorg input driver for keyboards. The \
+driver supports the standard OS-provided keyboard interface.  The driver \
+functions as a keyboard input device, and may be used as the X server's \
+core keyboard."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea2099d24ac9e316a6d4b9f20b3d4e10"
+
+SRC_URI[md5sum] = "96ccc43d389b970afbd3893875dfd678"
+SRC_URI[sha256sum] = "1ac8ff39bf9da7d2fc7fd6c24515726e8138340c0518ab8c606e008cf93ca211"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_git.bb b/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_git.bb
new file mode 100644
index 0000000..dfb08f7
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-input-keyboard_git.bb
@@ -0,0 +1,16 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- keyboard input driver"
+
+DESCRIPTION = "keyboard is an Xorg input driver for keyboards. The \
+driver supports the standard OS-provided keyboard interface.  The driver \
+functions as a keyboard input device, and may be used as the X server's \
+core keyboard."
+
+SRCREV = "3e28d68b50d291938734e9684b8296ca864f3892"
+PV = "1.3.2+git${SRCPV}"
+PR = "${INC_PR}.0"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/driver/xf86-input-keyboard"
+S = "${WORKDIR}/git"
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-input-mouse/unbreak.patch b/meta/recipes-graphics/xorg-driver/xf86-input-mouse/unbreak.patch
new file mode 100644
index 0000000..6930864
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-input-mouse/unbreak.patch
@@ -0,0 +1,21 @@
+Unbreak the linux mouse driver by using config.h
+
+RP - 4/11/07
+
+Upstream-Status: Pending
+
+Index: git/src/lnx_mouse.c
+===================================================================
+--- git.orig/src/lnx_mouse.c	2008-11-04 23:46:05.000000000 +0000
++++ git/src/lnx_mouse.c	2008-11-04 23:46:15.000000000 +0000
+@@ -3,8 +3,8 @@
+  * Copyright 1999 by The XFree86 Project, Inc.
+  */
+ 
+-#ifdef HAVE_XORG_CONFIG_H
+-#include <xorg-config.h>
++#ifdef HAVE_CONFIG_H
++#include <config.h>
+ #endif
+ 
+ #include <X11/X.h>
diff --git a/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.1.bb b/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.1.bb
new file mode 100644
index 0000000..1f0b78a
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-input-mouse_1.9.1.bb
@@ -0,0 +1,15 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- mouse input driver"
+
+DESCRIPTION = "mouse is an Xorg input driver for mice. The driver \
+supports most available mouse types and interfaces.  The mouse driver \
+functions as a pointer input device, and may be used as the X server's \
+core pointer. Multiple mice are supported by multiple instances of this \
+driver."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=90ea9f90d72b6d9327dede5ffdb2a510"
+
+SRC_URI[md5sum] = "77085b649c5c0b333565ba562f573951"
+SRC_URI[sha256sum] = "3485d375779c08406f0789feedde15933dc703158a086ddac638598f479fc5ce"
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-input-mouse_git.bb b/meta/recipes-graphics/xorg-driver/xf86-input-mouse_git.bb
new file mode 100644
index 0000000..d79a2e4
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-input-mouse_git.bb
@@ -0,0 +1,18 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- mouse input driver"
+
+DESCRIPTION = "mouse is an Xorg input driver for mice. The driver \
+supports most available mouse types and interfaces.  The mouse driver \
+functions as a pointer input device, and may be used as the X server's \
+core pointer. Multiple mice are supported by multiple instances of this \
+driver."
+
+SRCREV = "ea5cfe804e112f320f14ad896c7802d53551d3e6"
+PV = "1.3.0+git${SRCPV}"
+PR = "${INC_PR}.0"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/driver/xf86-input-mouse \
+           file://unbreak.patch"
+S = "${WORKDIR}/git"
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.8.2.bb b/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.8.2.bb
new file mode 100644
index 0000000..19c122f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_1.8.2.bb
@@ -0,0 +1,18 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- synaptics touchpad input driver"
+
+DESCRIPTION = "synaptics is an Xorg input driver for the touchpads from \
+Synaptics Incorporated. Even though these touchpads (by default, \
+operating in a compatibility mode emulating a standard mouse) can be \
+handled by the normal evdev or mouse drivers, this driver allows more \
+advanced features of the touchpad to become available."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=55aacd3535a741824955c5eb8f061398"
+
+SRC_URI[md5sum] = "8ed68e8cc674dd61adb280704764aafb"
+SRC_URI[sha256sum] = "7b0e164ebd02a680e0c695955e783059f37edb0c2656398e0a972adc8e698c80"
+
+DEPENDS += "libxi mtdev libxtst libevdev"
+
+FILES_${PN} += "${datadir}/X11/xorg.conf.d"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_git.bb b/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_git.bb
new file mode 100644
index 0000000..140f633
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-input-synaptics_git.bb
@@ -0,0 +1,18 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- synaptics touchpad input driver"
+
+DESCRIPTION = "synaptics is an Xorg input driver for the touchpads from \
+Synaptics Incorporated. Even though these touchpads (by default, \
+operating in a compatibility mode emulating a standard mouse) can be \
+handled by the normal evdev or mouse drivers, this driver allows more \
+advanced features of the touchpad to become available."
+
+SRCREV = "934bc0012f948c52aadc8eda912f7728fb7394a2"
+PV = "0.15.2+git${SRCPV}"
+PR = "${INC_PR}.1"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/driver/xf86-input-synaptics"
+S = "${WORKDIR}/git"
+
+DEPENDS += "libxi mtdev libxtst"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-input-vmmouse_13.1.0.bb b/meta/recipes-graphics/xorg-driver/xf86-input-vmmouse_13.1.0.bb
new file mode 100644
index 0000000..8615b48
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-input-vmmouse_13.1.0.bb
@@ -0,0 +1,26 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- VMWare mouse input driver"
+DESCRIPTION = "The vmmouse driver enables support for the special VMMouse \
+protocol that is provided by VMware virtual machines to give absolute \
+pointer positioning. The vmmouse driver is capable of falling back to the \
+standard 'mouse' driver if a VMware virtual machine is not detected."
+
+SRC_URI[md5sum] = "85e2e464b7219c495ad3a16465c226ed"
+SRC_URI[sha256sum] = "0af558957ac1be1b2863712c2475de8f4d7f14921fd01ded2e2fde4921b19319"
+
+RDEPENDS_${PN} += "xf86-input-mouse"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=622841c068a9d7625fbfe7acffb1a8fc"
+
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+do_install_append () {
+	# We don't care about hal
+	rm -rf ${D}${datadir}/hal/
+	rm -rf ${D}${libdir}/hal/
+}
+
+EXTRA_OECONF = "--with-udev-rules-dir=${nonarch_base_libdir}/udev/rules.d"
+
+FILES_${PN} += "${nonarch_base_libdir}/udev/rules.d/ ${datadir}/X11/xorg.conf.d"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-cirrus_1.5.3.bb b/meta/recipes-graphics/xorg-driver/xf86-video-cirrus_1.5.3.bb
new file mode 100644
index 0000000..c498477
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-cirrus_1.5.3.bb
@@ -0,0 +1,13 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- cirrus display driver"
+DESCRIPTION = "cirrus is an Xorg driver for Cirrus Logic VGA adapters. These \
+devices are not so common in the wild anymore, but QEMU can emulate one, so \
+the driver is still useful."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6ddc7ca860dc5fd014e7f160ea699295"
+
+SRC_URI[md5sum] = "7d7dfd4cdc42aa8b6e923510fa00ad2b"
+SRC_URI[sha256sum] = "edc87b20a55259126b5239b5c1ef913419eab7ded0ed12ae9ae989460d7351ab"
+
+DEPENDS += "libpciaccess"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.4.bb b/meta/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.4.bb
new file mode 100644
index 0000000..52e9bd1
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.4.bb
@@ -0,0 +1,9 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- fbdev display driver"
+DESCRIPTION = "fbdev is an Xorg driver for framebuffer devices. This is a non-accelerated driver."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8cbd99fff773f92e844948f74ef0df8"
+
+SRC_URI[md5sum] = "3931c0e19d441cc576dc088f9eb9fd73"
+SRC_URI[sha256sum] = "9dd4b326498223abbfdf786089a46ea3db4fa6bbd341308eb48a9e00bc3fd51b"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-intel/always_include_xorg_server.h.patch b/meta/recipes-graphics/xorg-driver/xf86-video-intel/always_include_xorg_server.h.patch
new file mode 100644
index 0000000..8a5dd39
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-intel/always_include_xorg_server.h.patch
@@ -0,0 +1,24 @@
+Include xorg-server.h to fix build errors seen with glibc 2.20
+
+In file included from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/string.h:634:0,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/work/i586-oe-linux/xf86-video-intel/2_2.99.912-r0/xf86-video-intel-2.99.912/src/backlight.c:39:
+/home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
+ strndup(const char *str, size_t n);
+ ^
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: xf86-video-intel-2.99.912/src/backlight.c
+===================================================================
+--- xf86-video-intel-2.99.912.orig/src/backlight.c	2014-04-09 10:41:18.000000000 -0700
++++ xf86-video-intel-2.99.912/src/backlight.c	2014-08-28 18:52:25.524070587 -0700
+@@ -29,6 +29,7 @@
+ #include "config.h"
+ #endif
+ 
++#include <xorg-server.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/stat.h>
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-intel/disable-x11-dri3.patch b/meta/recipes-graphics/xorg-driver/xf86-video-intel/disable-x11-dri3.patch
new file mode 100644
index 0000000..dda508d
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-intel/disable-x11-dri3.patch
@@ -0,0 +1,17 @@
+These modules are only used for tests that don't get installed, and the
+automatic detection without explicit dependencies means that a build can find
+e.g. xshmfence at configure time but then it's been removed from the sysroot by
+the time compile happens.
+
+As the tests don't get installed, just disable the checks.
+
+Upstream-Status: Inappropriate [OE-specific]
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index bd654f3..78a0e0d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -251 +251 @@ fi
+-PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
++#PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm], [x11_dri3="yes"], [x11_dri3="no"])
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch b/meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch
new file mode 100644
index 0000000..589d52e
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-intel/sna-Protect-against-ABI-breakage-in-recent-versions-.patch
@@ -0,0 +1,70 @@
+From 7fe2b2948652443ff43d907855bd7a051d54d309 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Thu, 19 Mar 2015 23:14:17 +0000
+Subject: [PATCH] sna: Protect against ABI breakage in recent versions of
+ libdrm
+
+commit 7fe2b2948652443ff43d907855bd7a051d54d309 upstream.
+
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+Upstream-Status: Backport
+Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
+
+diff --git a/src/sna/kgem.c b/src/sna/kgem.c
+index 11f0828f2bbc..6f16cbac87f2 100644
+--- a/src/sna/kgem.c
++++ b/src/sna/kgem.c
+@@ -182,6 +182,15 @@ struct local_i915_gem_caching {
+ #define LOCAL_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_SET_CACHING, struct local_i915_gem_caching)
+ #define LOCAL_IOCTL_I915_GEM_GET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_GET_CACHING, struct local_i915_gem_caching)
+ 
++struct local_i915_gem_mmap {
++	uint32_t handle;
++	uint32_t pad;
++	uint64_t offset;
++	uint64_t size;
++	uint64_t addr_ptr;
++};
++#define LOCAL_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct local_i915_gem_mmap)
++
+ struct local_i915_gem_mmap2 {
+ 	uint32_t handle;
+ 	uint32_t pad;
+@@ -514,15 +523,15 @@ retry_wc:
+ 
+ static void *__kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo)
+ {
+-	struct drm_i915_gem_mmap mmap_arg;
++	struct local_i915_gem_mmap arg;
+ 	int err;
+ 
+ retry:
+-	VG_CLEAR(mmap_arg);
+-	mmap_arg.handle = bo->handle;
+-	mmap_arg.offset = 0;
+-	mmap_arg.size = bytes(bo);
+-	if ((err = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg))) {
++	VG_CLEAR(arg);
++	arg.handle = bo->handle;
++	arg.offset = 0;
++	arg.size = bytes(bo);
++	if ((err = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP, &arg))) {
+ 		assert(err != EINVAL);
+ 
+ 		if (__kgem_throttle_retire(kgem, 0))
+@@ -536,10 +545,10 @@ retry:
+ 		return NULL;
+ 	}
+ 
+-	VG(VALGRIND_MAKE_MEM_DEFINED(mmap_arg.addr_ptr, bytes(bo)));
++	VG(VALGRIND_MAKE_MEM_DEFINED(arg.addr_ptr, bytes(bo)));
+ 
+ 	DBG(("%s: caching CPU vma for %d\n", __FUNCTION__, bo->handle));
+-	return bo->map__cpu = (void *)(uintptr_t)mmap_arg.addr_ptr;
++	return bo->map__cpu = (void *)(uintptr_t)arg.addr_ptr;
+ }
+ 
+ static int gem_write(int fd, uint32_t handle,
+-- 
+2.4.4
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-intel/udev-fstat.patch b/meta/recipes-graphics/xorg-driver/xf86-video-intel/udev-fstat.patch
new file mode 100644
index 0000000..0e675ee
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-intel/udev-fstat.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 12af8a575d1518d40416f83195049157c3a062a5 Mon Sep 17 00:00:00 2001
+From: Chris Wilson <chris@chris-wilson.co.uk>
+Date: Tue, 24 Feb 2015 15:25:40 +0000
+Subject: sna: udev integration depends on fstat and sys/stat.h
+
+src/sna/sna_driver.c: In function 'sna_handle_uevents':
+src/sna/sna_driver.c:759:2: error: implicit declaration of function 'fstat' [-Werror=implicit-function-declaration]
+
+Also take the opportunity to include udev support in the configure
+summary.
+
+Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
+
+diff --git a/configure.ac b/configure.ac
+index 7476e2b..de3a4b3 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -197,11 +197,15 @@ AC_ARG_ENABLE(udev,
+ 
+ if test "x$UDEV" != "xno"; then
+ 	PKG_CHECK_MODULES(UDEV, [libudev], [udev="yes"], [udev="no"])
++	AC_CHECK_HEADERS([sys/stat.h], [], [udev="no"])
+ 	if test "x$UDEV" = "xyes" -a "x$udev" != "xyes"; then
+ 		AC_MSG_ERROR([udev support requested but not found (libudev)])
+ 	fi
+ 	if test "x$udev" = "xyes"; then
+ 		AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
++		udev_msg=" yes"
++	else
++		udev_msg=" no"
+ 	fi
+ fi
+ 
+@@ -911,6 +915,7 @@ echo "  Support for Kernel Mode Setting? $KMS"
+ echo "  Support for legacy User Mode Setting (for i810)? $UMS"
+ echo "  Support for Direct Rendering Infrastructure:$dri_msg"
+ echo "  Support for Xv motion compensation (XvMC and libXvMC):$xvmc_msg"
++echo "  Support for display hotplug notifications (udev):$udev_msg"
+ echo "  Build additional tools and utilities?$tools_msg"
+ if test -n "$xp_msg"; then
+ echo "  Experimental support:$xp_msg"
+diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
+index 8c0d0b5..bc20ef0 100644
+--- a/src/sna/sna_driver.c
++++ b/src/sna/sna_driver.c
+@@ -740,6 +740,8 @@ sna_wakeup_handler(WAKEUPHANDLER_ARGS_DECL)
+ }
+ 
+ #if HAVE_UDEV
++#include <sys/stat.h>
++
+ static void
+ sna_handle_uevents(int fd, void *closure)
+ {
+-- 
+cgit v0.10.2
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb b/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb
new file mode 100644
index 0000000..a2f1456
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-intel_2.99.917.bb
@@ -0,0 +1,40 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- Intel integrated graphics chipsets driver"
+
+DESCRIPTION = "intel is an Xorg driver for Intel integrated graphics \
+chipsets. The driver supports depths 8, 15, 16 and 24. On some chipsets, \
+the driver supports hardware accelerated 3D via the Direct Rendering \
+Infrastructure (DRI)."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=8730ad58d11c7bbad9a7066d69f7808e"
+
+SRC_URI += "file://disable-x11-dri3.patch \
+            file://always_include_xorg_server.h.patch \
+            file://sna-Protect-against-ABI-breakage-in-recent-versions-.patch \
+            file://udev-fstat.patch \
+           "
+
+SRC_URI[md5sum] = "fa196a66e52c0c624fe5d350af7a5e7b"
+SRC_URI[sha256sum] = "00b781eea055582820a123c47b62411bdf6aabf4f03dc0568faec55faf9667c9"
+
+DEPENDS += "virtual/libx11 drm libpciaccess pixman"
+
+PACKAGECONFIG ??= "xvmc sna udev ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'dri dri1 dri2', '', d)}"
+
+PACKAGECONFIG[dri] = "--enable-dri,--disable-dri"
+PACKAGECONFIG[dri1] = "--enable-dri1,--disable-dri1,xf86driproto"
+PACKAGECONFIG[dri2] = "--enable-dri2,--disable-dri2,dri2proto"
+PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto"
+PACKAGECONFIG[sna] = "--enable-sna,--disable-sna"
+PACKAGECONFIG[uxa] = "--enable-uxa,--disable-uxa"
+PACKAGECONFIG[udev] = "--enable-udev,--disable-udev,udev"
+PACKAGECONFIG[xvmc] = "--enable-xvmc,--disable-xvmc,libxvmc xcb-util"
+PACKAGECONFIG[tools] = "--enable-tools,--disable-tools,libxinerama libxrandr libxdamage libxfixes libxcursor libxtst libxext libxrender"
+
+# --enable-kms-only option is required by ROOTLESS_X
+EXTRA_OECONF += '${@base_conditional( "ROOTLESS_X", "1", " --enable-kms-only", "", d )}'
+
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+FILES_${PN} += "${datadir}/polkit-1"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omap/0001-drmmode_output_dpms-Replace-logical-with-bitwise-ope.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omap/0001-drmmode_output_dpms-Replace-logical-with-bitwise-ope.patch
new file mode 100644
index 0000000..41e77d3
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omap/0001-drmmode_output_dpms-Replace-logical-with-bitwise-ope.patch
@@ -0,0 +1,31 @@
+From fc653ca3b36435aea281ae409fb90f85e1bc0d81 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 08:44:13 +0000
+Subject: [freedreno][PATCH] drmmode_output_dpms: Replace logical && with bitwise &
+ operation
+
+This is a mask calculation so bitbwise & should have been used
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ src/drmmode_display.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/drmmode_display.c b/src/drmmode_display.c
+index c3cf4f8..eb54b59 100644
+--- a/src/drmmode_display.c
++++ b/src/drmmode_display.c
+@@ -777,7 +777,7 @@ drmmode_output_dpms(xf86OutputPtr output, int mode)
+ 
+ 	for (i = 0; i < koutput->count_props; i++) {
+ 		props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
+-		if (props && (props->flags && DRM_MODE_PROP_ENUM)) {
++		if (props && (props->flags & DRM_MODE_PROP_ENUM)) {
+ 			if (!strcmp(props->name, "DPMS")) {
+ 				mode_id = koutput->props[i];
+ 				drmModeFreeProperty(props);
+-- 
+2.5.1
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.3.bb b/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.3.bb
new file mode 100644
index 0000000..76682ed
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omap_0.4.3.bb
@@ -0,0 +1,43 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- Texas Instruments OMAP framebuffer driver"
+
+SUMMARY = "X.Org X server -- TI OMAP integrated graphics chipsets driver"
+
+DESCRIPTION = "Open-source X.org graphics driver for TI OMAP graphics \
+Currently relies on a closed-source submodule for EXA acceleration on \
+the following chipsets: \
+  + OMAP3430 \
+  + OMAP3630 \
+  + OMAP4430 \
+  + OMAP4460 \
+  + OMAP5430 \
+  + OMAP5432 \
+\
+NOTE: this driver is work in progress..  you probably don't want to try \
+and use it yet.  The API/ABI between driver and kernel, and driver and \
+acceleration submodules is not stable yet.  This driver requires the \
+omapdrm kernel driver w/ GEM support. \
+"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=10ce5de3b111315ea652a5f74ec0c602"
+DEPENDS += "virtual/libx11 libdrm xf86driproto"
+
+SRC_URI += "file://0001-drmmode_output_dpms-Replace-logical-with-bitwise-ope.patch"
+
+SRC_URI[md5sum] = "be35daf6fa4b75092cc4a8978c437bc5"
+SRC_URI[sha256sum] = "db1e0e69fd4c4c8fdca5ef2cb0447bccd7518a718495876a6904bef57b39986d"
+
+CFLAGS += " -I${STAGING_INCDIR}/xorg "
+
+# Use overlay 2 on omap3 to enable other apps to use overlay 1 (e.g. dmai or omapfbplay)
+do_compile_prepend_armv7a () {
+        sed -i -e s:fb1:fb2:g ${S}/src/omap_xv.c
+}
+
+python () {
+    if not bb.utils.contains ('DISTRO_FEATURES', 'opengl', True, False, d):
+        raise bb.parse.SkipPackage("'opengl' not in DISTRO_FEATURES")
+}
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch
new file mode 100644
index 0000000..c4cf16e
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch
@@ -0,0 +1,35 @@
+From 28c006c94e57ea71df11ec4fff79d7ffcfc4860f Mon Sep 17 00:00:00 2001
+From: Far McKon <FarMcKon@buglabs.net>
+Date: Tue, 3 May 2011 20:59:04 +0300
+Subject: [PATCH] Prevents omapfb from from crashing when pixelclock of 0 is
+ sent to it.
+
+Due to a Linux design bug it is easy to get a pixelclock set to zero
+when changing displays at runtime.
+---
+ src/omapfb-output.c | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/src/omapfb-output.c b/src/omapfb-output.c
+index f8b4db3..4d59265 100644
+--- a/src/omapfb-output.c
++++ b/src/omapfb-output.c
+@@ -125,8 +125,13 @@ OMAPFBOutputGetModes(xf86OutputPtr output)
+ 	/* Only populate the native (current) mode */
+ 	mode = calloc(1, sizeof(DisplayModeRec));
+ 	mode->type      |= M_T_PREFERRED;
+-	mode->Clock = PICOS2KHZ(ofb->state_info.pixclock);
+-	mode->SynthClock = PICOS2KHZ(ofb->state_info.pixclock);
++	if (ofb->state_info.pixclock == 0) {
++		mode->Clock = 0;
++		mode->SynthClock = 0;
++	} else {
++		mode->Clock = PICOS2KHZ(ofb->state_info.pixclock);
++		mode->SynthClock = PICOS2KHZ(ofb->state_info.pixclock);
++	}
+ 	mode->HDisplay   = ofb->state_info.xres;
+ 	mode->HSyncStart = mode->HDisplay
+ 	                  + ofb->state_info.right_margin;
+-- 
+2.1.4
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch
new file mode 100644
index 0000000..9fb01d4
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch
@@ -0,0 +1,41 @@
+From 8fb7d0f99d4afbb574b30cb4f1e66a8f89d94ad5 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 12:04:36 +0100
+Subject: [PATCH 1/6] Revert "Set a large CRTC upper limit to not prune larger
+ resolutions"
+
+Picture is garbled after switching resolutions, so revert it.
+Virtual size too big, revert the commit 9c4d7592dcb7dc20a48a6f941d9d94bd73d34153.
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-crtc.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/omapfb-crtc.c b/src/omapfb-crtc.c
+index 9aaa52f..cbeff35 100644
+--- a/src/omapfb-crtc.c
++++ b/src/omapfb-crtc.c
+@@ -190,13 +190,13 @@ OMAPFBCRTCInit(ScrnInfoPtr pScrn)
+ 	 * In practise, this doesn't seem to be supported.
+ 	 * (no way to setup the overlay offset/base address)
+ 	 */
+-	 /* FIXME: figure out what makes sense here. A known max resolution?
+-	  * framebuffer size?
+-	  */
+ 	xf86CrtcSetSizeRange(pScrn,
+-	                     8, 8, 2048, 2048);
++	                     8, 8,
++	                     ofb->state_info.xres_virtual,
++	                     ofb->state_info.yres_virtual);
+ 
+ 	ofb->crtc = xf86CrtcCreate(pScrn, &OMAPFBCrtcFuncs);
++
+ }
+ 
+ 
+-- 
+1.8.0
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch
new file mode 100644
index 0000000..683a989
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch
@@ -0,0 +1,32 @@
+From 855c333ac0d16350f895f1d1b9391e9cbb0b6db4 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 13:27:20 +0100
+Subject: [PATCH 2/6] Revert "Set virtual size when configuring framebuffer"
+
+Virtual size too big, so revert it.
+
+This reverts commit 2653ef07883fbd1a5e7025f9300cf89b79ba429a.
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-crtc.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/omapfb-crtc.c b/src/omapfb-crtc.c
+index cbeff35..9655db2 100644
+--- a/src/omapfb-crtc.c
++++ b/src/omapfb-crtc.c
+@@ -98,8 +98,6 @@ OMAPFBCrtcCommitChangeMode (xf86CrtcPtr crtc)
+ 	v = ofb->state_info;
+ 	v.xres = mode->HDisplay;
+ 	v.yres = mode->VDisplay;
+-	v.xres_virtual = crtc->scrn->virtualX;
+-	v.yres_virtual = crtc->scrn->virtualY;
+ 	v.activate = FB_ACTIVATE_NOW;
+ 	v.pixclock = KHZ2PICOS(mode->Clock ? mode->Clock : 56000);
+ 	v.left_margin = mode->HTotal - mode->HSyncEnd;
+-- 
+1.8.0
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch
new file mode 100644
index 0000000..67ea7c1
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0003-force-plain-mode.patch
@@ -0,0 +1,31 @@
+From 252f44c072d3447a32127fc9afe5d0d40f3c510e Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 13:20:20 +0100
+Subject: [PATCH 3/6] force 'plain' mode
+
+The new DSS mode breaks XV, so force plain mode
+
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-driver.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
+index 018e040..48aa09c 100644
+--- a/src/omapfb-driver.c
++++ b/src/omapfb-driver.c
+@@ -326,7 +326,7 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
+ 	OMAPFBProbeController(ofb->ctrl_name);
+ 
+ 	/* Do we have the DSS kernel API? */
+-	if (stat(SYSFS_DSS_DIR, &st) == 0) {
++	if (0) { //stat(SYSFS_DSS_DIR, &st) == 0) {
+ 		ofb->dss = TRUE;
+ 	} else {
+ 		ofb->dss = FALSE;
+-- 
+1.8.0
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch
new file mode 100644
index 0000000..b0ac9a4
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0004-blacklist-tv-out.patch
@@ -0,0 +1,33 @@
+From cfa46b67f59115f6d8ef9414af60380749ff3eb3 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Wed, 26 Jan 2011 13:21:12 +0100
+Subject: [PATCH 4/6] blacklist tv out
+
+The tv-out gets added last and the driver tries to reconfigure dvi to TV resolutions, which fails. so blacklist it
+
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/omapfb-output-dss.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/omapfb-output-dss.c b/src/omapfb-output-dss.c
+index 6cc52de..83cb711 100644
+--- a/src/omapfb-output-dss.c
++++ b/src/omapfb-output-dss.c
+@@ -205,6 +205,10 @@ OMAPFBDSSOutputDetect (xf86OutputPtr output)
+ 	if(ofb->timings[idx][0] == '\0')
+ 		return XF86OutputStatusDisconnected;
+ 
++	// Hack to disable the tv out
++	if (strncmp(output->name, "tv", 2) == 0)
++		return XF86OutputStatusDisconnected;
++
+ 	return XF86OutputStatusConnected;
+ }
+ 
+-- 
+1.8.0
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch
new file mode 100644
index 0000000..67b2840
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0005-Attempt-to-fix-VRFB.patch
@@ -0,0 +1,325 @@
+From 8b1f697a60e35ab82fffdabfaefdb45e9a9df379 Mon Sep 17 00:00:00 2001
+From: Eino-Ville Talvala <talvala@stanford.edu>
+Date: Tue, 23 Aug 2011 18:37:01 +0200
+Subject: [PATCH 5/6] Attempt to fix VRFB
+
+Upstream-Status: Pending
+
+http://dominion.thruhere.net/git/cgit.cgi/xf86-video-omapfb/commit/?h=koen/fixups&id=6833fc9f795265e4943d248103fbaf3463b515d6
+
+Signed-off-by: Sebastian Krzyszkowiak <dos@dosowisko.net>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/image-format-conversions.c |  4 +--
+ src/image-format-conversions.h |  2 +-
+ src/omapfb-driver.c            | 28 +++++++++++++---
+ src/omapfb-xv-blizzard.c       |  1 +
+ src/omapfb-xv-generic.c        | 72 +++++++++++++++++++++++++++++++++---------
+ src/omapfb-xv.c                |  3 ++
+ 6 files changed, 88 insertions(+), 22 deletions(-)
+
+diff --git a/src/image-format-conversions.c b/src/image-format-conversions.c
+index dcefa9b..d43427d 100644
+--- a/src/image-format-conversions.c
++++ b/src/image-format-conversions.c
+@@ -38,13 +38,13 @@
+ #include "image-format-conversions.h"
+ 
+ /* Basic line-based copy for packed formats */
+-void packed_line_copy(int w, int h, int stride, uint8_t *src, uint8_t *dest)
++void packed_line_copy(int w, int h, int src_stride, int dst_stride, uint8_t *src, uint8_t *dest)
+ {
+ 	int i;
+ 	int len = w * 2;
+ 	for (i = 0; i < h; i++)
+ 	{
+-		memcpy(dest + i * len, src + i * stride, len);
++		memcpy(dest + i * dst_stride, src + i * src_stride, len);
+ 	}
+ }
+ 
+diff --git a/src/image-format-conversions.h b/src/image-format-conversions.h
+index 584896a..ba7caf2 100644
+--- a/src/image-format-conversions.h
++++ b/src/image-format-conversions.h
+@@ -27,7 +27,7 @@
+ #include <stdint.h>
+ 
+ /* Basic line-based copy for packed formats */
+-void packed_line_copy(int w, int h, int stride, uint8_t *src, uint8_t *dest);
++void packed_line_copy(int w, int h, int src_stride, int dst_stride, uint8_t *src, uint8_t *dest);
+ 
+ /* Basic C implementation of YV12/I420 to UYVY conversion */
+ void uv12_to_uyvy(int w, int h, int y_pitch, int uv_pitch, uint8_t *y_p, uint8_t *u_p, uint8_t *v_p, uint8_t *dest);
+diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
+index 48aa09c..07989f5 100644
+--- a/src/omapfb-driver.c
++++ b/src/omapfb-driver.c
+@@ -66,6 +66,7 @@
+ #define OMAPFB_VERSION 1000
+ #define OMAPFB_DRIVER_NAME "OMAPFB"
+ #define OMAPFB_NAME "omapfb"
++#define ENFORCE_MODES
+ 
+ static Bool OMAPFBProbe(DriverPtr drv, int flags);
+ static Bool OMAPFBPreInit(ScrnInfoPtr pScrn, int flags);
+@@ -105,11 +106,13 @@ static SymTabRec OMAPFBChipsets[] = {
+ typedef enum {
+ 	OPTION_ACCELMETHOD,
+ 	OPTION_FB,
++	OPTION_ROTATE,
+ } FBDevOpts;
+ 
+ static const OptionInfoRec OMAPFBOptions[] = {
+ 	{ OPTION_ACCELMETHOD,	"AccelMethod",	OPTV_STRING,	{0},	FALSE },
+ 	{ OPTION_FB,		"fb",		OPTV_STRING,	{0},	FALSE },
++	{ OPTION_ROTATE,	"rotation",	OPTV_STRING,	{0},	FALSE },
+ 	{ -1,			NULL,		OPTV_NONE,	{0},	FALSE }
+ };
+ 
+@@ -286,6 +289,7 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
+ {
+ 	OMAPFBPtr ofb;
+ 	EntityInfoPtr pEnt;
++	char *rotate;
+ 	rgb zeros = { 0, 0, 0 };
+ 	struct stat st;
+ 
+@@ -379,6 +383,8 @@ OMAPFBPreInit(ScrnInfoPtr pScrn, int flags)
+ 	pScrn->progClock = TRUE;
+ 	pScrn->chipset   = "omapfb";
+ 	
++	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Rotate test version 0.02\n");
++	
+ 	/* Start with configured virtual size */
+ 	pScrn->virtualX = pScrn->display->virtualX;
+ 	pScrn->virtualY = pScrn->display->virtualY;
+@@ -496,12 +502,21 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 	ofb->CloseScreen = pScreen->CloseScreen;
+ 	pScreen->CloseScreen = OMAPFBCloseScreen;
+ 
++	/* Enforce the default mode (this is silly I guess) */
++#ifdef ENFORCE_MODES
++	//xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Enforcing modes\n");
++	//set_mode(ofb, &ofb->default_mode);
++	//pScrn->displayWidth = ofb->fixed_info.line_length /
++	//  (ofb->state_info.bits_per_pixel>>3); //ofb->state_info.xres;
++#endif
++
+ 	/* Map our framebuffer memory */
++	ofb->mem_info.size = ofb->fixed_info.line_length * ofb->state_info.yres;
+ 	ofb->fb = mmap (NULL, ofb->mem_info.size,
+ 	                PROT_READ | PROT_WRITE, MAP_SHARED,
+ 	                ofb->fd, 0);
+-	if (ofb->fb == NULL) {
+-		xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed\n");
++	if (ofb->fb == MAP_FAILED) {
++		xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
+ 		return FALSE;
+ 	}
+ 
+@@ -578,8 +593,13 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 	} else if (!ofb->dss) {
+ 
+ 		ofb->plane_info.enabled = 1;
+-		ofb->plane_info.out_width = ofb->state_info.xres;
+-		ofb->plane_info.out_height = ofb->state_info.yres;
++		if (ofb->state_info.rotate == 0 || ofb->state_info.rotate == 2) {
++			ofb->plane_info.out_width = ofb->state_info.xres;
++			ofb->plane_info.out_height = ofb->state_info.yres;
++		} else {
++			ofb->plane_info.out_width = ofb->state_info.yres;
++			ofb->plane_info.out_height = ofb->state_info.xres;
++		}
+ 
+ 		if (ioctl (ofb->fd, OMAPFB_SETUP_PLANE, &ofb->plane_info)) {
+ 			xf86DrvMsg(scrnIndex, X_ERROR,
+diff --git a/src/omapfb-xv-blizzard.c b/src/omapfb-xv-blizzard.c
+index 406ffc6..b71d2aa 100644
+--- a/src/omapfb-xv-blizzard.c
++++ b/src/omapfb-xv-blizzard.c
+@@ -220,6 +220,7 @@ int OMAPFBXVPutImageBlizzard (ScrnInfoPtr pScrn,
+ 			packed_line_copy(src_w & ~3,
+ 			                 src_h & ~3,
+ 			                 ((src_w + 1) & ~1) * 2,
++					 ofb->port->fixed_info.line_length,
+ 			                 (uint8_t*)buf,
+ 			                 (uint8_t*)ofb->port->fb);
+ 			break;
+diff --git a/src/omapfb-xv-generic.c b/src/omapfb-xv-generic.c
+index e6f89fe..b33f344 100644
+--- a/src/omapfb-xv-generic.c
++++ b/src/omapfb-xv-generic.c
+@@ -62,7 +62,7 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
+ {
+ 	OMAPFBPtr ofb = OMAPFB(pScrn);
+ 
+-	/* The memory size is already set in OMAPFBXVQueryImageAttributes */
++	/* The memory size is already set before we get here */
+ 	if (ioctl(ofb->port->fd, OMAPFB_SETUP_MEM, &ofb->port->mem_info) != 0) {
+ 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ 		           "Failed to allocate video plane memory\n");
+@@ -73,19 +73,20 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
+ 	ofb->port->fb = mmap (NULL, ofb->port->mem_info.size,
+ 	                PROT_READ | PROT_WRITE, MAP_SHARED,
+ 	                ofb->port->fd, 0);
+-	if (ofb->port->fb == NULL) {
++	if (ofb->port->fb == MAP_FAILED) {
+ 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ 		           "Mapping video memory failed\n");
+ 		return XvBadAlloc;
+ 	}
+ 
+ 	/* Update the state info */
++	/* Let's not - it's bad
+ 	if (ioctl (ofb->port->fd, FBIOGET_VSCREENINFO, &ofb->port->state_info))
+ 	{
+ 		xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
+ 		return XvBadAlloc;
+ 	}
+-
++	*/
+ 	return Success;
+ }
+ 
+@@ -93,6 +94,7 @@ int OMAPXVAllocPlane(ScrnInfoPtr pScrn)
+ int OMAPXVSetupVideoPlane(ScrnInfoPtr pScrn)
+ {
+ 	OMAPFBPtr ofb = OMAPFB(pScrn);
++	int ret;
+ 
+ 	if (ioctl (ofb->port->fd, FBIOPUT_VSCREENINFO, &ofb->port->state_info))
+ 	{
+@@ -104,6 +106,31 @@ int OMAPXVSetupVideoPlane(ScrnInfoPtr pScrn)
+ 		xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
+ 		return XvBadAlloc;
+ 	}
++	/* Changing rotation/nonstd flags can change the fixed info! */
++	if (ioctl (ofb->port->fd, FBIOGET_FSCREENINFO, &ofb->port->fixed_info))
++	{
++		xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
++		return XvBadAlloc;
++	}
++	/* Correct fixed info requires recalculation of needed memory */
++	ofb->port->mem_info.size = ofb->port->fixed_info.line_length * ofb->port->state_info.yres;
++
++	/* Allocate buffer memory */
++	ret = OMAPXVAllocPlane(pScrn);
++	if (ret != Success)
++		return ret;
++
++	/* Workaround for reset of mode after memory allo */
++	if (ioctl (ofb->port->fd, FBIOPUT_VSCREENINFO, &ofb->port->state_info))
++	{
++		xf86Msg(X_ERROR, "%s: setting state info failed\n", __FUNCTION__);
++		return XvBadAlloc;
++	}
++	if (ioctl (ofb->port->fd, FBIOGET_VSCREENINFO, &ofb->port->state_info))
++	{
++		xf86Msg(X_ERROR, "%s: Reading state info failed\n", __FUNCTION__);
++		return XvBadAlloc;
++	}
+ 
+ 	if(ioctl(ofb->port->fd, OMAPFB_SETUP_PLANE,
+ 	   &ofb->port->plane_info) != 0) {
+@@ -124,6 +151,8 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+                              DrawablePtr pDraw)
+ {
+ 	OMAPFBPtr ofb = OMAPFB(pScrn);
++	short drw_temp;
++	short rot_xres, rot_yres;
+ 
+ 	if (!ofb->port->plane_info.enabled
+ 	 || ofb->port->update_window.x != src_x
+@@ -163,13 +192,6 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ 			return Success;
+ 		}
+ 
+-		/* If we don't have the plane running, enable it */
+-		if (!ofb->port->plane_info.enabled) {
+-			ret = OMAPXVAllocPlane(pScrn);
+-			if (ret != Success)
+-				return ret;
+-		}
+-
+ 		/* Set up the state info, xres and yres will be used for
+ 		 * scaling to the values in the plane info struct
+ 		 */
+@@ -179,12 +201,31 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ 		ofb->port->state_info.yres_virtual = 0;
+ 		ofb->port->state_info.xoffset = 0;
+ 		ofb->port->state_info.yoffset = 0;
+-		ofb->port->state_info.rotate = 0;
++		//ofb->port->state_info.rotate = 0;
+ 		ofb->port->state_info.grayscale = 0;
+ 		ofb->port->state_info.activate = FB_ACTIVATE_NOW;
+ 		ofb->port->state_info.bits_per_pixel = 0;
+ 		ofb->port->state_info.nonstd = xv_to_omapfb_format(image);
+ 
++		/* Plane info does not rotate with state_info */
++		if (ofb->port->state_info.rotate == 1 ||
++		  ofb->port->state_info.rotate == 3) {
++			drw_temp = drw_x;
++			drw_x = drw_y;
++			drw_y = drw_temp;
++
++			drw_temp = drw_w;
++			drw_w = drw_h;
++			drw_h = drw_temp;
++
++			rot_xres = ofb->port->state_info.yres;
++			rot_yres = ofb->port->state_info.xres;
++		} else {
++			rot_xres = ofb->port->state_info.xres;
++			rot_yres = ofb->port->state_info.yres;
++		}
++
++
+ 		/* Set up the video plane info */
+ 		ofb->port->plane_info.enabled = 1;
+ 		ofb->port->plane_info.pos_x = drw_x;
+@@ -193,13 +234,13 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ 		ofb->port->plane_info.out_height = drw_h & ~15;
+ 
+ 		/* Cap output to screen size */
+-		if (ofb->port->plane_info.out_width > ofb->state_info.xres) {
++		if (ofb->port->plane_info.out_width > rot_xres) {
+ 			ofb->port->plane_info.pos_x = 0;
+-			ofb->port->plane_info.out_width = ofb->state_info.xres;
++			ofb->port->plane_info.out_width = rot_xres;
+ 		}
+-		if (ofb->port->plane_info.out_height > ofb->state_info.yres) {
++		if (ofb->port->plane_info.out_height > rot_yres) {
+ 			ofb->port->plane_info.pos_y = 0;
+-			ofb->port->plane_info.out_height = ofb->state_info.yres;
++			ofb->port->plane_info.out_height = rot_yres;
+ 		}
+ 
+ 		ret = OMAPXVSetupVideoPlane(pScrn);
+@@ -223,6 +264,7 @@ int OMAPFBXVPutImageGeneric (ScrnInfoPtr pScrn,
+ 			packed_line_copy(src_w & ~15,
+ 			                 src_h & ~15,
+ 			                 ((src_w + 1) & ~1) * 2,
++			                 ofb->port->fixed_info.line_length,
+ 			                 (uint8_t*)buf,
+ 			                 (uint8_t*)ofb->port->fb);
+ 			break;
+diff --git a/src/omapfb-xv.c b/src/omapfb-xv.c
+index 1df651e..0fee2c6 100644
+--- a/src/omapfb-xv.c
++++ b/src/omapfb-xv.c
+@@ -169,8 +169,11 @@ static int OMAPFBXVQueryImageAttributes (ScrnInfoPtr pScrn,
+ 	h = *height;
+ 
+ 	w = (w + 1) & ~1;
++
++	/* Can't calculate these here - don't know line length
+ 	ofb->port->mem_info.size = w << 1;
+ 	ofb->port->mem_info.size *= h;
++	*/
+ 
+ 	return size;
+ }
+-- 
+1.8.0
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch
new file mode 100644
index 0000000..d567299
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0006-omapfb-port-to-new-xserver-video-API.patch
@@ -0,0 +1,272 @@
+From 803ecf2909949e6152f4a81b6cbb92a4430679ac Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 23 Nov 2012 00:31:06 +0100
+Subject: [PATCH 6/6] omapfb: port to new xserver video API
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/compat-api.h    | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/omapfb-driver.c | 41 ++++++++++++-----------
+ 2 files changed, 118 insertions(+), 19 deletions(-)
+ create mode 100644 src/compat-api.h
+
+diff --git a/src/compat-api.h b/src/compat-api.h
+new file mode 100644
+index 0000000..b1591b1
+--- /dev/null
++++ b/src/compat-api.h
+@@ -0,0 +1,96 @@
++/*
++ * Copyright 2012 Red Hat, Inc.
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice (including the next
++ * paragraph) shall be included in all copies or substantial portions of the
++ * Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ *
++ * Author: Dave Airlie <airlied@redhat.com>
++ */
++
++/* this file provides API compat between server post 1.13 and pre it,
++   it should be reused inside as many drivers as possible */
++#ifndef COMPAT_API_H
++#define COMPAT_API_H
++
++#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
++#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
++#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
++#endif
++
++#ifndef XF86_HAS_SCRN_CONV
++#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
++#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
++#endif
++
++#ifndef XF86_SCRN_INTERFACE
++
++#define SCRN_ARG_TYPE int
++#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)]
++
++#define SCREEN_ARG_TYPE int
++#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)]
++
++#define SCREEN_INIT_ARGS_DECL int index, ScreenPtr pScreen, int argc, char **argv
++
++#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
++#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
++
++#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen
++#define CLOSE_SCREEN_ARGS scrnIndex, pScreen
++
++#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
++
++#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
++
++#define FREE_SCREEN_ARGS_DECL int arg, int flags
++#define FREE_SCREEN_ARGS(x) (x)->scrnIndex, 0
++
++#define VT_FUNC_ARGS_DECL int arg, int flags
++#define VT_FUNC_ARGS(flags) pScrn->scrnIndex, (flags)
++
++#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
++#else
++#define SCRN_ARG_TYPE ScrnInfoPtr
++#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1)
++
++#define SCREEN_ARG_TYPE ScreenPtr
++#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1)
++
++#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv
++
++#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask
++#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
++
++#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen
++#define CLOSE_SCREEN_ARGS pScreen
++
++#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
++#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
++
++#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
++#define FREE_SCREEN_ARGS(x) (x)
++
++#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
++#define VT_FUNC_ARGS(flags) pScrn
++
++#define XF86_ENABLEDISABLEFB_ARG(x) (x)
++
++#endif
++
++#endif
+diff --git a/src/omapfb-driver.c b/src/omapfb-driver.c
+index 07989f5..486ffa4 100644
+--- a/src/omapfb-driver.c
++++ b/src/omapfb-driver.c
+@@ -44,6 +44,8 @@
+ 
+ #include "exa.h"
+ 
++#include "compat-api.h"
++
+ #ifdef HAVE_XEXTPROTO_71
+ #include <X11/extensions/dpmsconst.h>
+ #else
+@@ -70,10 +72,10 @@
+ 
+ static Bool OMAPFBProbe(DriverPtr drv, int flags);
+ static Bool OMAPFBPreInit(ScrnInfoPtr pScrn, int flags);
+-static Bool OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv);
+-static Bool OMAPFBEnterVT(int scrnIndex, int flags);
+-static void OMAPFBLeaveVT(int scrnIndex, int flags);
+-static Bool OMAPFBSwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
++static Bool OMAPFBScreenInit(SCREEN_INIT_ARGS_DECL);
++static Bool OMAPFBEnterVT(VT_FUNC_ARGS_DECL);
++static void OMAPFBLeaveVT(VT_FUNC_ARGS_DECL);
++static Bool OMAPFBSwitchMode(SWITCH_MODE_ARGS_DECL);
+ 
+ static Bool
+ OMAPFBEnsureRec(ScrnInfoPtr pScrn)
+@@ -481,7 +483,7 @@ OMAPFBXvScreenInit(ScreenPtr pScreen)
+ }
+ 
+ static Bool
+-OMAPFBCloseScreen(int scrnIndex, ScreenPtr pScreen)
++OMAPFBCloseScreen(CLOSE_SCREEN_ARGS_DECL)
+ {
+ 	ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ 	OMAPFBPtr ofb = OMAPFB(pScrn);
+@@ -490,11 +492,11 @@ OMAPFBCloseScreen(int scrnIndex, ScreenPtr pScreen)
+ 
+ 	pScreen->CloseScreen = ofb->CloseScreen;
+ 	
+-	return (*pScreen->CloseScreen)(scrnIndex, pScreen);
++	return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
+ }
+ 
+ static Bool
+-OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
++OMAPFBScreenInit(SCREEN_INIT_ARGS_DECL)
+ {
+ 	ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ 	OMAPFBPtr ofb = OMAPFB(pScrn);
+@@ -516,7 +518,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 	                PROT_READ | PROT_WRITE, MAP_SHARED,
+ 	                ofb->fd, 0);
+ 	if (ofb->fb == MAP_FAILED) {
+-		xf86DrvMsg(scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
++		xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Mapping framebuffer memory failed, wanted %d bytes.\n", ofb->mem_info.size);
+ 		return FALSE;
+ 	}
+ 
+@@ -526,7 +528,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 	/* Only support TrueColor for now */
+ 	if (!miSetVisualTypes(pScrn->depth, TrueColorMask,
+ 		pScrn->rgbBits, pScrn->defaultVisual)) {
+-		xf86DrvMsg(scrnIndex, X_ERROR, "visual type setup failed"
++		xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "visual type setup failed"
+ 		           " for %d bits per pixel [1]\n",
+ 		           pScrn->bitsPerPixel);
+ 		return FALSE;
+@@ -534,7 +536,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 
+ 	/* Set up pixmap depth information */
+ 	if (!miSetPixmapDepths()) {
+-		xf86DrvMsg(scrnIndex,X_ERROR,"pixmap depth setup failed\n");
++		xf86DrvMsg(pScrn->scrnIndex,X_ERROR,"pixmap depth setup failed\n");
+ 		return FALSE;
+ 	}
+ 
+@@ -546,7 +548,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 	                  pScrn->virtualY, pScrn->xDpi,
+ 	                  pScrn->yDpi, pScrn->displayWidth,
+ 	                  pScrn->bitsPerPixel)) {
+-		xf86DrvMsg(scrnIndex, X_ERROR, "fbScreenInit failed\n");
++		xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbScreenInit failed\n");
+ 		return FALSE;
+ 	}
+ 
+@@ -567,7 +569,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 
+ 	/* Initialize XRender fallbacks */
+ 	if (!fbPictureInit(pScreen, NULL, 0)) {
+-		xf86DrvMsg(scrnIndex, X_ERROR, "fbPictureInit failed\n");
++		xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "fbPictureInit failed\n");
+ 		return FALSE;
+ 	}
+ 	
+@@ -579,7 +581,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 
+ 	/* Initialize default colormap */
+ 	if (!miCreateDefColormap(pScreen)) {
+-		xf86DrvMsg(scrnIndex, X_ERROR,
++		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ 		           "creating default colormap failed\n");
+ 		return FALSE;
+ 	}
+@@ -589,7 +591,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 		/* This is non-fatal since we might be running against older
+ 		 * kernel driver in which case we only do basic 2D stuff...
+ 		 */
+-		xf86DrvMsg(scrnIndex, X_ERROR, "Reading plane info failed\n");
++		xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Reading plane info failed\n");
+ 	} else if (!ofb->dss) {
+ 
+ 		ofb->plane_info.enabled = 1;
+@@ -602,7 +604,7 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 		}
+ 
+ 		if (ioctl (ofb->fd, OMAPFB_SETUP_PLANE, &ofb->plane_info)) {
+-			xf86DrvMsg(scrnIndex, X_ERROR,
++			xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ 			            "%s: Plane setup failed: %s\n",
+ 			            __FUNCTION__, strerror(errno));
+ 			return FALSE;
+@@ -645,9 +647,10 @@ OMAPFBScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+ 	return TRUE;
+ }
+ 
+-static Bool OMAPFBSwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
++static Bool OMAPFBSwitchMode(SWITCH_MODE_ARGS_DECL)
+ {
+-	return xf86SetSingleMode (xf86Screens[scrnIndex], mode, RR_Rotate_0);
++	SCRN_INFO_PTR(arg);
++	return xf86SetSingleMode (pScrn, mode, RR_Rotate_0);
+ }
+ 
+ void
+@@ -699,14 +702,14 @@ OMAPFBPrintCapabilities(ScrnInfoPtr pScrn,
+ /*** Unimplemented: */
+ 
+ static Bool
+-OMAPFBEnterVT(int scrnIndex, int flags)
++OMAPFBEnterVT(VT_FUNC_ARGS_DECL)
+ {
+ 	xf86Msg(X_NOT_IMPLEMENTED, "%s\n", __FUNCTION__);
+ 	return TRUE;
+ }
+ 
+ static void
+-OMAPFBLeaveVT(int scrnIndex, int flags)
++OMAPFBLeaveVT(VT_FUNC_ARGS_DECL)
+ {
+ 	xf86Msg(X_NOT_IMPLEMENTED, "%s\n", __FUNCTION__);
+ }
+-- 
+1.8.0
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0007-always_include_xorg_server.h.patch b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0007-always_include_xorg_server.h.patch
new file mode 100644
index 0000000..dc0b9b3
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb/0007-always_include_xorg_server.h.patch
@@ -0,0 +1,48 @@
+Fix errors with glibc 2.20
+
+In file included from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/string.h:634:0,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/os.h:53,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/misc.h:115,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/xf86str.h:37,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/xf86.h:44,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/work/i586-oe-linux/xf86-video-omapfb/2_0.1.1+gitrAUTOINC+28c006c94e-r21.7/git/src/omapfb-xv-blizzard.c:33:
+/home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
+ strndup(const char *str, size_t n);
+ ^
+In file included from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/string.h:634:0,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/os.h:53,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/misc.h:115,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/xf86str.h:37,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/xf86.h:44,
+                 from /home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/work/i586-oe-linux/xf86-video-omapfb/2_0.1.1+gitrAUTOINC+28c006c94e-r21.7/git/src/omapfb-xv-generic.c:28:
+/home/ubuntu/work/upstream/openembedded-core/build/tmp-glibc/sysroots/qemux86/usr/include/xorg/os.h:579:1: error: expected identifier or '(' before '__extension__'
+ strndup(const char *str, size_t n);
+ ^
+
+Singed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: git/src/omapfb-xv-blizzard.c
+===================================================================
+--- git.orig/src/omapfb-xv-blizzard.c	2014-08-28 05:16:25.684070587 -0700
++++ git/src/omapfb-xv-blizzard.c	2014-08-28 19:05:39.440070587 -0700
+@@ -30,6 +30,7 @@
+  *  -
+  */
+ 
++#include <xorg-server.h>
+ #include "xf86.h"
+ #include "xf86_OSlib.h"
+ #include "xf86xv.h"
+Index: git/src/omapfb-xv-generic.c
+===================================================================
+--- git.orig/src/omapfb-xv-generic.c	2014-08-28 05:16:25.684070587 -0700
++++ git/src/omapfb-xv-generic.c	2014-08-28 19:05:51.780070587 -0700
+@@ -25,6 +25,7 @@
+  * Generic functions for the XV driver
+  */
+ 
++#include <xorg-server.h>
+ #include "xf86.h"
+ #include "xf86_OSlib.h"
+ #include "xf86xv.h"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb
new file mode 100644
index 0000000..0eeb870
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-omapfb_git.bb
@@ -0,0 +1,35 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- Texas Instruments OMAP framebuffer driver"
+
+DESCRIPTION = "omapfb driver supports the basic Texas Instruments OMAP \
+framebuffer."
+
+LICENSE = "MIT-X & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=63e2cbac53863f60e2f43343fb34367f"
+DEPENDS += "virtual/libx11"
+
+SRCREV = "33e36c12dde336edbdd34626dd8adfcaebc8fbb8"
+PR = "${INC_PR}.7"
+PV = "0.1.1+gitr${SRCPV}"
+
+SRC_URI = "git://anonscm.debian.org/collab-maint/xf86-video-omapfb.git \
+  file://0001-Prevents-omapfb-from-from-crashing-when-pixelclock-o.patch \
+  file://0001-Revert-Set-a-large-CRTC-upper-limit-to-not-prune-lar.patch \
+  file://0002-Revert-Set-virtual-size-when-configuring-framebuffer.patch \
+  file://0003-force-plain-mode.patch \
+  file://0004-blacklist-tv-out.patch \
+  file://0005-Attempt-to-fix-VRFB.patch \
+  file://0006-omapfb-port-to-new-xserver-video-API.patch \
+  file://0007-always_include_xorg_server.h.patch \
+"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF_armv7a = " --enable-neon "
+CFLAGS += " -I${STAGING_INCDIR}/xorg "
+
+# Use overlay 2 on omap3 to enable other apps to use overlay 1 (e.g. dmai or omapfbplay)
+do_compile_prepend_armv7a () {
+        sed -i -e s:fb1:fb2:g ${S}/src/omapfb-xv.c
+}
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-vesa_2.3.4.bb b/meta/recipes-graphics/xorg-driver/xf86-video-vesa_2.3.4.bb
new file mode 100644
index 0000000..fa251b5
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-vesa_2.3.4.bb
@@ -0,0 +1,21 @@
+require xorg-driver-video.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a1f0610ebdc6f314a9fa5102a8c5c1b0"
+
+SUMMARY = "X.Org X server -- Generic Vesa video driver"
+
+DESCRIPTION = "vesa is an Xorg driver for generic VESA video cards. It \
+can drive most VESA-compatible video cards, but only makes use of the \
+basic standard VESA core that is common to these cards. The driver \
+supports depths 8, 15 16 and 24."
+
+PR = "${INC_PR}.0"
+
+DEPENDS += "virtual/libx11 randrproto libpciaccess"
+
+COMPATIBLE_HOST = '(i.86|x86_64).*-linux'
+
+RRECOMMENDS_${PN} += "xserver-xorg-module-libint10"
+
+SRC_URI[md5sum] = "a893c37c589f7a31cea929a5d896a0e2"
+SRC_URI[sha256sum] = "7bddf4d879dd6f67088ecb203a31e12334aab980174bd0909930a21f32e251c1"
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch b/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch
new file mode 100644
index 0000000..6039d08
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-vmware/0002-add-option-for-vmwgfx.patch
@@ -0,0 +1,98 @@
+Upstream-Status:Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From f103d6f570671c649ccd7b225e6d6c9f14371888 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 25 Jun 2014 16:16:44 +0100
+Subject: [PATCH 2/2] add option for vmwgfx
+
+---
+ configure.ac |   49 ++++++++++++++++++++-----------------------------
+ 1 file changed, 20 insertions(+), 29 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index be40ed7..8e15307 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -64,6 +64,13 @@ AC_ARG_ENABLE(vmwarectrl-client,
+                              [VMWARECTRL=$enableval], [VMWARECTRL=no])
+ AM_CONDITIONAL(BUILD_VMWARECTRL, [test "x$VMWARECTRL" = xyes])
+ 
++# Define a configure option to build the vmwgfx driver
++AC_ARG_ENABLE(vmwgfx,
++              AS_HELP_STRING([--disable-vmwgfx],
++                             [Disable vmwgfx driver (KMS/3D) (default: enabled)]),
++                             [VMWGFX="$enableval"], [VMWGFX="yes"])
++AM_CONDITIONAL(BUILD_VMWGFX, test "x$VMWGFX" = xyes)
++
+ # Store the list of server defined optional extensions in REQUIRED_MODULES
+ XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
+ XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
+@@ -85,11 +92,6 @@ PKG_CHECK_EXISTS([xorg-server >= 1.4.99],
+                  [AC_DEFINE([HAVE_XORG_SERVER_1_5_0], 1,
+                  [Has version 1.5.0 or greater of the Xserver])])
+ 
+-PKG_CHECK_EXISTS([xorg-server >= 1.7.0],
+-                 [AC_DEFINE([HAVE_XORG_SERVER_1_7_0], 1,
+-                 [Has version 1.7.0 or greater of the Xserver])
+-		 BUILD_VMWGFX=yes],[BUILD_VMWGFX=no])
+-
+ PKG_CHECK_EXISTS([xorg-server >= 1.12.0],
+                  [AC_DEFINE([HAVE_XORG_SERVER_1_12_0], 1,
+                  [Has version 1.12.0 or greater of the Xserver])])
+@@ -114,39 +116,28 @@ AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
+ 
+ AC_SUBST([moduledir])
+ 
+-if test x$BUILD_VMWGFX = xyes; then
+-	PKG_CHECK_MODULES([LIBDRM], [libdrm],[],[BUILD_VMWGFX=no])
+-fi
+-if test x$BUILD_VMWGFX = xyes; then
+-#
+-# Early versions of mesa 10 forgot to bump the XA major version number in
+-# the xa_tracker.h header
+-#
+-	PKG_CHECK_MODULES([XATRACKER], [xatracker >= 0.4.0],
+-			  [PKG_CHECK_EXISTS([xatracker = 2.0.0],
+-	                  [AC_DEFINE([HAVE_XA_2], 1,
+-               		  [Has version 2 of XA])])],
+-			  [BUILD_VMWGFX=no])
+-#
+-# Check for prime.
+-#
++AC_MSG_CHECKING([whether to build Kernel Mode Setting and 3D])
++if test x$VMWGFX = xyes; then
++	PKG_CHECK_MODULES([LIBDRM], [libdrm])
++	# Check for prime.
+ 	PKG_CHECK_EXISTS([libdrm >= 2.4.38],
+ 			 [AC_DEFINE([HAVE_LIBDRM_2_4_38], 1,
+ 			 [Has version 2.4.38 or greater of libdrm])])
+-fi
+ 
+-DRIVER_NAME=vmware
+-AC_SUBST([DRIVER_NAME])
+-
+-AC_MSG_CHECKING([whether to build Kernel Mode Setting and 3D])
+-if test x$BUILD_VMWGFX = xyes; then
+-	AC_MSG_RESULT([yes])
++	# Early versions of mesa 10 forgot to bump the XA major version number
++	# in the xa_tracker.h header
++	PKG_CHECK_MODULES([XATRACKER], [xatracker >= 0.4.0],
++			  [PKG_CHECK_EXISTS([xatracker = 2.0.0],
++	                  [AC_DEFINE([HAVE_XA_2], 1,
++               		  [Has version 2 of XA])])])
+         AC_DEFINE([BUILD_VMWGFX], 1, [Building the vmwgfx driver path])
++	AC_MSG_RESULT([yes])
+ else
+ 	AC_MSG_RESULT([no])
+ fi
+ 
+-AM_CONDITIONAL(BUILD_VMWGFX, test "x$BUILD_VMWGFX" = xyes)
++DRIVER_NAME=vmware
++AC_SUBST([DRIVER_NAME])
+ 
+ AC_CONFIG_FILES([
+                 Makefile
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.1.0.bb b/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.1.0.bb
new file mode 100644
index 0000000..89b98ee
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xf86-video-vmware_13.1.0.bb
@@ -0,0 +1,18 @@
+require xorg-driver-video.inc
+
+SUMMARY = "X.Org X server -- VMware SVGA display driver"
+
+DESCRIPTION = "vmware is an Xorg driver for VMware virtual video cards."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=5fcd7d437a959a15fbee8707747c6b53"
+
+DEPENDS += "virtual/libx11 xineramaproto videoproto libpciaccess"
+
+SRC_URI += "file://0002-add-option-for-vmwgfx.patch"
+
+SRC_URI[md5sum] = "0cba22fed4cb639d5c4276f7892c543d"
+SRC_URI[sha256sum] = "3c1d244e4b1b77e92126957965cdc9fb82de4c215c0706a3a8aaff6939e4a0cc"
+
+COMPATIBLE_HOST = '(i.86.*-linux|x86_64.*-linux)'
+
+EXTRA_OECONF += "--disable-vmwgfx"
diff --git a/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc b/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
new file mode 100644
index 0000000..7ddd1c7
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xorg-driver-common.inc
@@ -0,0 +1,41 @@
+SUMMARY = "X driver"
+HOMEPAGE = "http://www.x.org"
+BUGTRACKER = "https://bugs.freedesktop.org"
+SECTION = "x11/drivers"
+LICENSE = "MIT-X"
+
+PE = "2"
+INC_PR = "r21"
+
+DEPENDS = "virtual/xserver xproto randrproto util-macros"
+
+SRC_URI = "${XORG_MIRROR}/individual/driver/${BPN}-${PV}.tar.bz2"
+
+FILES_${PN} += " ${libdir}/xorg/modules/drivers/*.so"
+FILES_${PN}-dbg += " ${libdir}/xorg/modules/drivers/.debug"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/xserver
+REQUIRED_DISTRO_FEATURES = "x11"
+
+# FIXME: We don't want to include the libtool archives (*.la) from modules
+# directory, as they serve no useful purpose. Upstream should fix Makefile.am
+do_install_append() {
+	find ${D}${libdir}/xorg/modules -regex ".*\.la$" | xargs rm -f --
+}
+
+# Function to add the relevant ABI dependency to drivers, which should be called
+# from a PACKAGEFUNC.
+def _add_xorg_abi_depends(d, name):
+    # Map of ABI names exposed in the dependencies to pkg-config variables
+    abis = {
+      "video": "abi_videodrv",
+      "input": "abi_xinput"
+    }
+
+    output = os.popen("pkg-config xorg-server --variable=%s" % abis[name]).read()
+    mlprefix = d.getVar('MLPREFIX', True) or ''
+    abi = "%sxorg-abi-%s-%s" % (mlprefix, name, output.split(".")[0])
+
+    pn = d.getVar("PN", True)
+    d.appendVar('RDEPENDS_' + pn, ' ' + abi)
diff --git a/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc b/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc
new file mode 100644
index 0000000..fbec064
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xorg-driver-input.inc
@@ -0,0 +1,11 @@
+include xorg-driver-common.inc
+
+DEPENDS += "inputproto kbproto "
+
+python add_xorg_abi_depends() {
+    _add_xorg_abi_depends(d, "input")
+}
+PACKAGEFUNCS =+ "add_xorg_abi_depends"
+
+FILES_${PN} += " ${libdir}/xorg/modules/input/*.so"
+FILES_${PN}-dbg += " ${libdir}/xorg/modules/input/.debug"
diff --git a/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc b/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc
new file mode 100644
index 0000000..38281e0
--- /dev/null
+++ b/meta/recipes-graphics/xorg-driver/xorg-driver-video.inc
@@ -0,0 +1,8 @@
+include xorg-driver-common.inc
+
+DEPENDS =+ "renderproto videoproto xextproto fontsproto"
+
+python add_xorg_abi_depends() {
+    _add_xorg_abi_depends(d, "video")
+}
+PACKAGEFUNCS =+ "add_xorg_abi_depends"
diff --git a/meta/recipes-graphics/xorg-font/encodings/nocompiler.patch b/meta/recipes-graphics/xorg-font/encodings/nocompiler.patch
new file mode 100644
index 0000000..f330c18
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/encodings/nocompiler.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Inappropriate [configuration]
+
+XORG_DEFAULT_OPTIONS pulls in the following dependency chains:
+
+XORG_CWARNFLAGS -> AC_PROG_CC_C99
+XORG_STRICT_OPTION -> AC_PROG_CC_C99, XORG_CWARNFLAGS
+XORG_MANPAGE_SECTIONS -> AC_CANONICAL_HOST -> Checks host 
+
+each of which triggers the use of the host compiler. As an "all"
+architecture package, it shouldn't need a compiler (and doesn't).
+
+RP 17/5/2011
+
+Index: encodings-1.0.4/configure.ac
+===================================================================
+--- encodings-1.0.4.orig/configure.ac	2011-05-17 23:36:19.505095876 +0100
++++ encodings-1.0.4/configure.ac	2011-05-17 23:54:14.935096128 +0100
+@@ -4,12 +4,12 @@
+ AM_INIT_AUTOMAKE([foreign dist-bzip2])
+ AM_MAINTAINER_MODE
+ 
+-# Require xorg-macros: XORG_DEFAULT_OPTIONS
+ m4_ifndef([XORG_MACROS_VERSION],
+ 	  [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+ XORG_MACROS_VERSION(1.3)
+-XORG_DEFAULT_OPTIONS
+-
++XORG_RELEASE_VERSION
++XORG_CHANGELOG
++XORG_INSTALL
+ AC_PROG_INSTALL
+ 
+ # Require X.Org's font util macros 1.2 or later
diff --git a/meta/recipes-graphics/xorg-font/encodings_1.0.4.bb b/meta/recipes-graphics/xorg-font/encodings_1.0.4.bb
new file mode 100644
index 0000000..90846d8
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/encodings_1.0.4.bb
@@ -0,0 +1,22 @@
+SUMMARY = "The Xorg font encoding files"
+
+DESCRIPTION = "The encodings that map to specific characters for a \
+number of Xorg and common fonts."
+
+require xorg-font-common.inc
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9da93f2daf2d5572faa2bfaf0dbd9e76"
+PE = "1"
+PR = "${INC_PR}.1"
+
+DEPENDS = "mkfontscale-native font-util-native"
+RDEPENDS_${PN} = ""
+
+SRC_URI += "file://nocompiler.patch"
+
+inherit allarch
+
+EXTRA_OECONF += "--with-encodingsdir=${datadir}/fonts/X11/encodings"
+
+SRC_URI[md5sum] = "0f2d6546d514c5cc4ecf78a60657a5c1"
+SRC_URI[sha256sum] = "ced6312988a45d23812c2ac708b4595f63fd7a49c4dcd9f66bdcd50d1057d539"
diff --git a/meta/recipes-graphics/xorg-font/font-alias-1.0.3/nocompiler.patch b/meta/recipes-graphics/xorg-font/font-alias-1.0.3/nocompiler.patch
new file mode 100644
index 0000000..0b9fb8c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/font-alias-1.0.3/nocompiler.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Inappropriate [configuration]
+
+XORG_DEFAULT_OPTIONS pulls in the following dependency chains:
+
+XORG_CWARNFLAGS -> AC_PROG_CC_C99
+XORG_STRICT_OPTION -> AC_PROG_CC_C99, XORG_CWARNFLAGS
+XORG_MANPAGE_SECTIONS -> AC_CANONICAL_HOST -> Checks host 
+
+each of which triggers the use of the host compiler. As an "all"
+architecture package, it shouldn't need a compiler (and doesn't).
+
+RP 17/5/2011
+
+diff -uNr font-alias-1.0.3.orig//configure.ac font-alias-1.0.3/configure.ac
+--- font-alias-1.0.3.orig//configure.ac	2011-05-18 21:29:18.378258643 +0200
++++ font-alias-1.0.3/configure.ac	2011-05-18 21:32:06.865258593 +0200
+@@ -28,12 +28,12 @@
+ AM_INIT_AUTOMAKE([foreign dist-bzip2])
+ AM_MAINTAINER_MODE
+ 
+-# Require xorg-macros: XORG_DEFAULT_OPTIONS
+ m4_ifndef([XORG_MACROS_VERSION],
+ 	  [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
+ XORG_MACROS_VERSION(1.3)
+-XORG_DEFAULT_OPTIONS
+-
++XORG_RELEASE_VERSION
++XORG_CHANGELOG
++XORG_INSTALL
+ AC_PROG_INSTALL
+ 
+ XORG_FONTROOTDIR
diff --git a/meta/recipes-graphics/xorg-font/font-alias_1.0.3.bb b/meta/recipes-graphics/xorg-font/font-alias_1.0.3.bb
new file mode 100644
index 0000000..15e1015
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/font-alias_1.0.3.bb
@@ -0,0 +1,24 @@
+SUMMARY = "X font aliases"
+
+require xorg-font-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bf0158b89be493d523d69d9f29265038 \
+                    file://cyrillic/fonts.alias;md5=f40795b0640d6785826aecd3b16f6124 \
+                    file://75dpi/fonts.alias;md5=6bc48023f2ae7f3bfc105db7b0ee6b49 \
+                    file://misc/fonts.alias;md5=a8ec05d528431d4c9703b55a7efd67a8 \
+                    file://100dpi/fonts.alias;md5=85bebd6ca213aa656c301a72eb4397cb"
+
+SRC_URI += "file://nocompiler.patch"
+
+DEPENDS = "util-macros-native font-util-native"
+RDEPENDS_${PN} = "encodings font-util"
+RDEPENDS_${PN}_class-native = "font-util-native"
+
+inherit allarch
+
+PE = "1"
+PR = "${INC_PR}.3"
+
+SRC_URI[md5sum] = "6d25f64796fef34b53b439c2e9efa562"
+SRC_URI[sha256sum] = "8b453b2aae1cfa8090009ca037037b8c5e333550651d5a158b7264ce1d472c9a"
diff --git a/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb b/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb
new file mode 100644
index 0000000..2285124
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/font-util_1.3.1.bb
@@ -0,0 +1,25 @@
+SUMMARY = "X.Org font package creation/installation utilities"
+
+require xorg-font-common.inc
+
+#Unicode is MIT
+LICENSE = "BSD & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5df208ec65eb84ce5bb8d82d8f3b9675 \
+                    file://ucs2any.c;endline=28;md5=8357dc567fc628bd12696f15b2a33bcb \
+                    file://bdftruncate.c;endline=26;md5=4f82ffc101a1b165eae9c6998abff937 \
+                    file://map-ISO8859-1;beginline=9;endline=23;md5=1cecb984063248f29ffe5c46f5c04f34"
+
+DEPENDS = "encodings util-macros"
+DEPENDS_class-native = "util-macros-native"
+RDEPENDS_${PN} = "mkfontdir mkfontscale encodings"
+RDEPENDS_${PN}_class-native = "mkfontdir-native mkfontscale-native"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "23756dab809f9ec5011bb27fb2c3c7d6"
+SRC_URI[sha256sum] = "aa7ebdb0715106dd255082f2310dbaa2cd7e225957c2a77d719720c7cc92b921"
+
+SYSROOT_PREPROCESS_FUNCS += "fontutil_sysroot_preprocess"
+fontutil_sysroot_preprocess () {
+	sysroot_stage_dir ${D}${datadir}/fonts/ ${SYSROOT_DESTDIR}${datadir}/fonts/
+}
diff --git a/meta/recipes-graphics/xorg-font/xorg-font-common.inc b/meta/recipes-graphics/xorg-font/xorg-font-common.inc
new file mode 100644
index 0000000..d5267f5
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-font-common.inc
@@ -0,0 +1,42 @@
+HOMEPAGE = "http://www.x.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
+
+SECTION = "x11/fonts"
+LICENSE = "MIT-X"
+
+DEPENDS = " encodings font-alias font-util-native mkfontdir-native mkfontscale-native"
+RDEPENDS_${PN} = "encodings font-util font-alias"
+
+XORG_PN = "${BPN}"
+INC_PR = "r2"
+
+
+SRC_URI = "${XORG_MIRROR}/individual/font/${XORG_PN}-${PV}.tar.bz2"
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+inherit autotools pkgconfig distro_features_check
+
+# The mkfontscale-native requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OEMAKE += "FCCACHE=/bin/true UTIL_DIR=${STAGING_DIR_TARGET}\$\(MAPFILES_PATH\)"
+
+do_install_append() {
+	find ${D}${libdir}/X11/fonts -type f -name fonts.dir | xargs rm -f
+	find ${D}${libdir}/X11/fonts -type f -name fonts.scale | xargs rm -f
+	find ${D}${datadir}/fonts/X11 -type f -name fonts.dir | xargs rm -f
+	find ${D}${datadir}/fonts/X11 -type f -name fonts.scale | xargs rm -f	
+}
+
+FILES_${PN} += " ${libdir}/X11/fonts ${datadir}"
+
+pkg_postinst_${PN} () {
+        for fontdir in `find $D/usr/lib/X11/fonts -type d`; do
+                mkfontdir $fontdir
+                mkfontscale $fontdir
+        done
+        for fontdir in `find $D/usr/share/fonts/X11 -type d`; do
+                mkfontdir $fontdir
+                mkfontscale $fontdir
+        done
+}
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb
new file mode 100644
index 0000000..9bcd1b2
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Xorg minimal fonts data"
+DESCRIPTION = "Minimal fonts required by X.org."
+HOMEPAGE = "http://www.x.org"
+
+SECTION = "x11/fonts"
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://../misc/fonts.dir;md5=82a143d94d6a974aafe97132d2d519ab \
+                    file://../misc/cursor.pcf.gz;md5=40bc81001fef4c21ca08df4305014a2a"
+
+SRC_URI = "file://misc"
+
+PE = "1"
+PR = "r2"
+
+inherit allarch distro_features_check
+
+# The font-alias requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+S = "${WORKDIR}/misc"
+
+PACKAGES = "${PN}"
+FILES_${PN} = "${libdir}/X11/ ${datadir}/fonts/X11/"
+RDEPENDS_${PN} += "font-alias"
+
+do_install() {
+	install -d ${D}/${datadir}/fonts/X11/misc
+	install -m 0644 ${S}/* ${D}/${datadir}/fonts/X11/misc/
+	install -d ${D}/${libdir}/X11
+	ln -sf ${datadir}/fonts/X11/ ${D}/${libdir}/X11/fonts -s
+}
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-1.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-1.pcf.gz
new file mode 100644
index 0000000..8bc8570
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-1.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-10.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-10.pcf.gz
new file mode 100644
index 0000000..8fa8290
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-10.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-11.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-11.pcf.gz
new file mode 100644
index 0000000..bb1c5e1
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-11.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-13.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-13.pcf.gz
new file mode 100644
index 0000000..842fa1b
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-13.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-14.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-14.pcf.gz
new file mode 100644
index 0000000..cd119b6
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-14.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-15.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-15.pcf.gz
new file mode 100644
index 0000000..25fe84a
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-15.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-16.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-16.pcf.gz
new file mode 100644
index 0000000..e362c70
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-16.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-2.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-2.pcf.gz
new file mode 100644
index 0000000..176a759
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-2.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-3.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-3.pcf.gz
new file mode 100644
index 0000000..a4faf1a
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-3.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-4.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-4.pcf.gz
new file mode 100644
index 0000000..96ddd15
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-4.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-5.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-5.pcf.gz
new file mode 100644
index 0000000..541a2ad
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-5.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-7.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-7.pcf.gz
new file mode 100644
index 0000000..a4986f4
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-7.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-8.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-8.pcf.gz
new file mode 100644
index 0000000..3f89abe
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-8.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-9.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-9.pcf.gz
new file mode 100644
index 0000000..432b536
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-ISO8859-9.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-KOI8-R.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-KOI8-R.pcf.gz
new file mode 100644
index 0000000..e7fcb89
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13-KOI8-R.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gz
new file mode 100644
index 0000000..2df6355
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-1.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-1.pcf.gz
new file mode 100644
index 0000000..a263c5d
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-1.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-10.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-10.pcf.gz
new file mode 100644
index 0000000..a1a7d37
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-10.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-13.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-13.pcf.gz
new file mode 100644
index 0000000..a148e99
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-13.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-14.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-14.pcf.gz
new file mode 100644
index 0000000..8791b8c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-14.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-15.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-15.pcf.gz
new file mode 100644
index 0000000..8604508
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-15.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-16.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-16.pcf.gz
new file mode 100644
index 0000000..f28b1f1
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-16.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-2.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-2.pcf.gz
new file mode 100644
index 0000000..fd1e6cf
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-2.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-3.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-3.pcf.gz
new file mode 100644
index 0000000..672b759
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-3.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-4.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-4.pcf.gz
new file mode 100644
index 0000000..d90a433
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-4.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-5.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-5.pcf.gz
new file mode 100644
index 0000000..775e7c1
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-5.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-7.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-7.pcf.gz
new file mode 100644
index 0000000..ac12fd9
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-7.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-8.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-8.pcf.gz
new file mode 100644
index 0000000..42bbd522
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-8.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-9.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-9.pcf.gz
new file mode 100644
index 0000000..690d31f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B-ISO8859-9.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gz
new file mode 100644
index 0000000..d4c3184
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13B.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-1.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-1.pcf.gz
new file mode 100644
index 0000000..884b513
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-1.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-10.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-10.pcf.gz
new file mode 100644
index 0000000..cbb1a9d
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-10.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-13.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-13.pcf.gz
new file mode 100644
index 0000000..78c8580
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-13.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-14.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-14.pcf.gz
new file mode 100644
index 0000000..0e90f3e
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-14.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-15.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-15.pcf.gz
new file mode 100644
index 0000000..bd1273e
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-15.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-16.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-16.pcf.gz
new file mode 100644
index 0000000..5100b42
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-16.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-2.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-2.pcf.gz
new file mode 100644
index 0000000..ec5bbed
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-2.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-3.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-3.pcf.gz
new file mode 100644
index 0000000..06c835e
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-3.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-4.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-4.pcf.gz
new file mode 100644
index 0000000..478541c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-4.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-5.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-5.pcf.gz
new file mode 100644
index 0000000..1c593ce
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-5.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-7.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-7.pcf.gz
new file mode 100644
index 0000000..335cf5f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-7.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-9.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-9.pcf.gz
new file mode 100644
index 0000000..099423e
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O-ISO8859-9.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gz
new file mode 100644
index 0000000..4a546dd
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/6x13O.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gz b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gz
new file mode 100644
index 0000000..72eb72b
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/cursor.pcf.gz
Binary files differ
diff --git a/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/fonts.dir b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/fonts.dir
new file mode 100644
index 0000000..0a2718f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-font/xorg-minimal-fonts/misc/fonts.dir
@@ -0,0 +1,410 @@
+409
+10x20-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
+10x20-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-10
+10x20-ISO8859-11.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-11
+10x20-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-13
+10x20-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-14
+10x20-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-15
+10x20-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-16
+10x20-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-2
+10x20-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-3
+10x20-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-4
+10x20-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-5
+10x20-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-7
+10x20-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-8
+10x20-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-9
+10x20-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-koi8-r
+10x20.pcf.gz -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
+12x13ja.pcf.gz -misc-fixed-medium-r-normal-ja-13-120-75-75-c-120-iso10646-1
+12x24.pcf.gz -sony-fixed-medium-r-normal--24-170-100-100-c-120-iso8859-1
+12x24rk.pcf.gz -sony-fixed-medium-r-normal--24-170-100-100-c-120-jisx0201.1976-0
+18x18ja.pcf.gz -misc-fixed-medium-r-normal-ja-18-120-100-100-c-180-iso10646-1
+18x18ko.pcf.gz -misc-fixed-medium-r-normal-ko-18-120-100-100-c-180-iso10646-1
+4x6-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-1
+4x6-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-10
+4x6-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-13
+4x6-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-14
+4x6-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-15
+4x6-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-16
+4x6-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-2
+4x6-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-3
+4x6-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-4
+4x6-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-5
+4x6-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-7
+4x6-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-8
+4x6-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso8859-9
+4x6-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-koi8-r
+4x6.pcf.gz -misc-fixed-medium-r-normal--6-60-75-75-c-40-iso10646-1
+5x7-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-1
+5x7-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-10
+5x7-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-13
+5x7-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-14
+5x7-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-15
+5x7-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-16
+5x7-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-2
+5x7-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-3
+5x7-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-4
+5x7-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-5
+5x7-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-7
+5x7-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-8
+5x7-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso8859-9
+5x7-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-koi8-r
+5x7.pcf.gz -misc-fixed-medium-r-normal--7-70-75-75-c-50-iso10646-1
+5x8-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-1
+5x8-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-10
+5x8-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-13
+5x8-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-14
+5x8-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-15
+5x8-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-16
+5x8-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-2
+5x8-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-3
+5x8-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-4
+5x8-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-5
+5x8-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-7
+5x8-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-8
+5x8-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso8859-9
+5x8-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-koi8-r
+5x8.pcf.gz -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso10646-1
+6x10-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1
+6x10-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-10
+6x10-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-13
+6x10-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-14
+6x10-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-15
+6x10-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-16
+6x10-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-2
+6x10-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-3
+6x10-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-4
+6x10-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-5
+6x10-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-7
+6x10-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-8
+6x10-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-9
+6x10-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-koi8-r
+6x10.pcf.gz -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso10646-1
+6x12-ISO8859-1.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-1
+6x12-ISO8859-10.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-10
+6x12-ISO8859-13.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-13
+6x12-ISO8859-14.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-14
+6x12-ISO8859-15.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-15
+6x12-ISO8859-16.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-16
+6x12-ISO8859-2.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-2
+6x12-ISO8859-3.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-3
+6x12-ISO8859-4.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-4
+6x12-ISO8859-5.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-5
+6x12-ISO8859-7.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-7
+6x12-ISO8859-8.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-8
+6x12-ISO8859-9.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso8859-9
+6x12-KOI8-R.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-koi8-r
+6x12.pcf.gz -misc-fixed-medium-r-semicondensed--12-110-75-75-c-60-iso10646-1
+6x13-ISO8859-1.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-1
+6x13-ISO8859-10.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-10
+6x13-ISO8859-11.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-11
+6x13-ISO8859-13.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-13
+6x13-ISO8859-14.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-14
+6x13-ISO8859-15.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-15
+6x13-ISO8859-16.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-16
+6x13-ISO8859-2.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-2
+6x13-ISO8859-3.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-3
+6x13-ISO8859-4.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-4
+6x13-ISO8859-5.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-5
+6x13-ISO8859-7.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-7
+6x13-ISO8859-8.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-8
+6x13-ISO8859-9.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso8859-9
+6x13-KOI8-R.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-koi8-r
+6x13.pcf.gz -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
+6x13B-ISO8859-1.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-1
+6x13B-ISO8859-10.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-10
+6x13B-ISO8859-13.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-13
+6x13B-ISO8859-14.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-14
+6x13B-ISO8859-15.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-15
+6x13B-ISO8859-16.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-16
+6x13B-ISO8859-2.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-2
+6x13B-ISO8859-3.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-3
+6x13B-ISO8859-4.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-4
+6x13B-ISO8859-5.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-5
+6x13B-ISO8859-7.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-7
+6x13B-ISO8859-8.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-8
+6x13B-ISO8859-9.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso8859-9
+6x13B.pcf.gz -misc-fixed-bold-r-semicondensed--13-120-75-75-c-60-iso10646-1
+6x13O-ISO8859-1.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-1
+6x13O-ISO8859-10.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-10
+6x13O-ISO8859-13.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-13
+6x13O-ISO8859-14.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-14
+6x13O-ISO8859-15.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-15
+6x13O-ISO8859-16.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-16
+6x13O-ISO8859-2.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-2
+6x13O-ISO8859-3.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-3
+6x13O-ISO8859-4.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-4
+6x13O-ISO8859-5.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-5
+6x13O-ISO8859-7.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-7
+6x13O-ISO8859-9.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso8859-9
+6x13O.pcf.gz -misc-fixed-medium-o-semicondensed--13-120-75-75-c-60-iso10646-1
+6x9-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-1
+6x9-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-10
+6x9-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-13
+6x9-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-14
+6x9-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-15
+6x9-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-16
+6x9-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-2
+6x9-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-3
+6x9-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-4
+6x9-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-5
+6x9-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-7
+6x9-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-8
+6x9-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso8859-9
+6x9-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-koi8-r
+6x9.pcf.gz -misc-fixed-medium-r-normal--9-90-75-75-c-60-iso10646-1
+7x13-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
+7x13-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-10
+7x13-ISO8859-11.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-11
+7x13-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-13
+7x13-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-14
+7x13-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-15
+7x13-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-16
+7x13-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-2
+7x13-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-3
+7x13-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-4
+7x13-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-5
+7x13-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-7
+7x13-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-8
+7x13-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-9
+7x13-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-koi8-r
+7x13.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso10646-1
+7x13B-ISO8859-1.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-1
+7x13B-ISO8859-10.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-10
+7x13B-ISO8859-11.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-11
+7x13B-ISO8859-13.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-13
+7x13B-ISO8859-14.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-14
+7x13B-ISO8859-15.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-15
+7x13B-ISO8859-16.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-16
+7x13B-ISO8859-2.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-2
+7x13B-ISO8859-3.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-3
+7x13B-ISO8859-4.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-4
+7x13B-ISO8859-5.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-5
+7x13B-ISO8859-7.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-7
+7x13B-ISO8859-8.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-8
+7x13B-ISO8859-9.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso8859-9
+7x13B.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-70-iso10646-1
+7x13O-ISO8859-1.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-1
+7x13O-ISO8859-10.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-10
+7x13O-ISO8859-11.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-11
+7x13O-ISO8859-13.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-13
+7x13O-ISO8859-14.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-14
+7x13O-ISO8859-15.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-15
+7x13O-ISO8859-16.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-16
+7x13O-ISO8859-2.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-2
+7x13O-ISO8859-3.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-3
+7x13O-ISO8859-4.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-4
+7x13O-ISO8859-5.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-5
+7x13O-ISO8859-7.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-7
+7x13O-ISO8859-9.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso8859-9
+7x13O.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-70-iso10646-1
+7x14-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-1
+7x14-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-10
+7x14-ISO8859-11.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-11
+7x14-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-13
+7x14-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-14
+7x14-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-15
+7x14-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-16
+7x14-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-2
+7x14-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-3
+7x14-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-4
+7x14-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-5
+7x14-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-7
+7x14-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-8
+7x14-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso8859-9
+7x14-JISX0201.1976-0.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-jisx0201.1976-0
+7x14-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-koi8-r
+7x14.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1
+7x14B-ISO8859-1.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-1
+7x14B-ISO8859-10.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-10
+7x14B-ISO8859-11.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-11
+7x14B-ISO8859-13.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-13
+7x14B-ISO8859-14.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-14
+7x14B-ISO8859-15.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-15
+7x14B-ISO8859-16.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-16
+7x14B-ISO8859-2.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-2
+7x14B-ISO8859-3.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-3
+7x14B-ISO8859-4.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-4
+7x14B-ISO8859-5.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-5
+7x14B-ISO8859-7.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-7
+7x14B-ISO8859-8.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-8
+7x14B-ISO8859-9.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso8859-9
+7x14B.pcf.gz -misc-fixed-bold-r-normal--14-130-75-75-c-70-iso10646-1
+8x13-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1
+8x13-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-10
+8x13-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-13
+8x13-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-14
+8x13-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-15
+8x13-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-16
+8x13-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-2
+8x13-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-3
+8x13-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-4
+8x13-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-5
+8x13-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-7
+8x13-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-8
+8x13-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-9
+8x13-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-koi8-r
+8x13.pcf.gz -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1
+8x13B-ISO8859-1.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1
+8x13B-ISO8859-10.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-10
+8x13B-ISO8859-13.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-13
+8x13B-ISO8859-14.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-14
+8x13B-ISO8859-15.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-15
+8x13B-ISO8859-16.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-16
+8x13B-ISO8859-2.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-2
+8x13B-ISO8859-3.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-3
+8x13B-ISO8859-4.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-4
+8x13B-ISO8859-5.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-5
+8x13B-ISO8859-7.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-7
+8x13B-ISO8859-8.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-8
+8x13B-ISO8859-9.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-9
+8x13B.pcf.gz -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso10646-1
+8x13O-ISO8859-1.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-1
+8x13O-ISO8859-10.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-10
+8x13O-ISO8859-13.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-13
+8x13O-ISO8859-14.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-14
+8x13O-ISO8859-15.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-15
+8x13O-ISO8859-16.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-16
+8x13O-ISO8859-2.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-2
+8x13O-ISO8859-3.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-3
+8x13O-ISO8859-4.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-4
+8x13O-ISO8859-5.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-5
+8x13O-ISO8859-7.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-7
+8x13O-ISO8859-9.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso8859-9
+8x13O.pcf.gz -misc-fixed-medium-o-normal--13-120-75-75-c-80-iso10646-1
+8x16.pcf.gz -sony-fixed-medium-r-normal--16-120-100-100-c-80-iso8859-1
+8x16rk.pcf.gz -sony-fixed-medium-r-normal--16-120-100-100-c-80-jisx0201.1976-0
+9x15-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-1
+9x15-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-10
+9x15-ISO8859-11.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-11
+9x15-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-13
+9x15-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-14
+9x15-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-15
+9x15-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-16
+9x15-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-2
+9x15-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-3
+9x15-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-4
+9x15-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-5
+9x15-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-7
+9x15-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-8
+9x15-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso8859-9
+9x15-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-koi8-r
+9x15.pcf.gz -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
+9x15B-ISO8859-1.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1
+9x15B-ISO8859-10.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-10
+9x15B-ISO8859-11.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-11
+9x15B-ISO8859-13.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-13
+9x15B-ISO8859-14.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-14
+9x15B-ISO8859-15.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-15
+9x15B-ISO8859-16.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-16
+9x15B-ISO8859-2.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-2
+9x15B-ISO8859-3.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-3
+9x15B-ISO8859-4.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-4
+9x15B-ISO8859-5.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-5
+9x15B-ISO8859-7.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-7
+9x15B-ISO8859-8.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-8
+9x15B-ISO8859-9.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-9
+9x15B.pcf.gz -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso10646-1
+9x18-ISO8859-1.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-1
+9x18-ISO8859-10.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-10
+9x18-ISO8859-11.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-11
+9x18-ISO8859-13.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-13
+9x18-ISO8859-14.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-14
+9x18-ISO8859-15.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-15
+9x18-ISO8859-16.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-16
+9x18-ISO8859-2.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-2
+9x18-ISO8859-3.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-3
+9x18-ISO8859-4.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-4
+9x18-ISO8859-5.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-5
+9x18-ISO8859-7.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-7
+9x18-ISO8859-8.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-8
+9x18-ISO8859-9.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso8859-9
+9x18-KOI8-R.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-koi8-r
+9x18.pcf.gz -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
+9x18B-ISO8859-1.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-1
+9x18B-ISO8859-10.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-10
+9x18B-ISO8859-13.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-13
+9x18B-ISO8859-14.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-14
+9x18B-ISO8859-15.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-15
+9x18B-ISO8859-16.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-16
+9x18B-ISO8859-2.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-2
+9x18B-ISO8859-3.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-3
+9x18B-ISO8859-4.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-4
+9x18B-ISO8859-5.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-5
+9x18B-ISO8859-7.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-7
+9x18B-ISO8859-8.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-8
+9x18B-ISO8859-9.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso8859-9
+9x18B.pcf.gz -misc-fixed-bold-r-normal--18-120-100-100-c-90-iso10646-1
+arabic24.pcf.gz -arabic-newspaper-medium-r-normal--32-246-100-100-p-137-iso10646-1
+clB6x10.pcf.gz -schumacher-clean-bold-r-normal--10-100-75-75-c-60-iso646.1991-irv
+clB6x12.pcf.gz -schumacher-clean-bold-r-normal--12-120-75-75-c-60-iso646.1991-irv
+clB8x10.pcf.gz -schumacher-clean-bold-r-normal--10-100-75-75-c-80-iso646.1991-irv
+clB8x12.pcf.gz -schumacher-clean-bold-r-normal--12-120-75-75-c-80-iso646.1991-irv
+clB8x13.pcf.gz -schumacher-clean-bold-r-normal--13-130-75-75-c-80-iso646.1991-irv
+clB8x14.pcf.gz -schumacher-clean-bold-r-normal--14-140-75-75-c-80-iso646.1991-irv
+clB8x16.pcf.gz -schumacher-clean-bold-r-normal--16-160-75-75-c-80-iso646.1991-irv
+clB8x8.pcf.gz -schumacher-clean-bold-r-normal--8-80-75-75-c-80-iso646.1991-irv
+clB9x15.pcf.gz -schumacher-clean-bold-r-normal--15-150-75-75-c-90-iso646.1991-irv
+clI6x12.pcf.gz -schumacher-clean-medium-i-normal--12-120-75-75-c-60-iso646.1991-irv
+clI8x8.pcf.gz -schumacher-clean-medium-i-normal--8-80-75-75-c-80-iso646.1991-irv
+clR4x6.pcf.gz -schumacher-clean-medium-r-normal--6-60-75-75-c-40-iso646.1991-irv
+clR5x10.pcf.gz -schumacher-clean-medium-r-normal--10-100-75-75-c-50-iso646.1991-irv
+clR5x6.pcf.gz -schumacher-clean-medium-r-normal--6-60-75-75-c-50-iso646.1991-irv
+clR5x8.pcf.gz -schumacher-clean-medium-r-normal--8-80-75-75-c-50-iso646.1991-irv
+clR6x10.pcf.gz -schumacher-clean-medium-r-normal--10-100-75-75-c-60-iso646.1991-irv
+clR6x12-ISO8859-1.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-1
+clR6x12-ISO8859-10.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-10
+clR6x12-ISO8859-13.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-13
+clR6x12-ISO8859-14.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-14
+clR6x12-ISO8859-15.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-15
+clR6x12-ISO8859-16.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-16
+clR6x12-ISO8859-2.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-2
+clR6x12-ISO8859-3.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-3
+clR6x12-ISO8859-4.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-4
+clR6x12-ISO8859-5.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-5
+clR6x12-ISO8859-7.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-7
+clR6x12-ISO8859-8.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-8
+clR6x12-ISO8859-9.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso8859-9
+clR6x12-KOI8-R.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-koi8-r
+clR6x12.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-60-iso10646-1
+clR6x13.pcf.gz -schumacher-clean-medium-r-normal--13-130-75-75-c-60-iso646.1991-irv
+clR6x6.pcf.gz -schumacher-clean-medium-r-normal--6-60-75-75-c-60-iso646.1991-irv
+clR6x8.pcf.gz -schumacher-clean-medium-r-normal--8-80-75-75-c-60-iso646.1991-irv
+clR7x10.pcf.gz -schumacher-clean-medium-r-normal--10-100-75-75-c-70-iso646.1991-irv
+clR7x12.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-70-iso646.1991-irv
+clR7x14.pcf.gz -schumacher-clean-medium-r-normal--14-140-75-75-c-70-iso646.1991-irv
+clR7x8.pcf.gz -schumacher-clean-medium-r-normal--8-80-75-75-c-70-iso646.1991-irv
+clR8x10.pcf.gz -schumacher-clean-medium-r-normal--10-100-75-75-c-80-iso646.1991-irv
+clR8x12.pcf.gz -schumacher-clean-medium-r-normal--12-120-75-75-c-80-iso646.1991-irv
+clR8x13.pcf.gz -schumacher-clean-medium-r-normal--13-130-75-75-c-80-iso646.1991-irv
+clR8x14.pcf.gz -schumacher-clean-medium-r-normal--14-140-75-75-c-80-iso646.1991-irv
+clR8x16.pcf.gz -schumacher-clean-medium-r-normal--16-160-75-75-c-80-iso646.1991-irv
+clR8x8.pcf.gz -schumacher-clean-medium-r-normal--8-80-75-75-c-80-iso646.1991-irv
+clR9x15.pcf.gz -schumacher-clean-medium-r-normal--15-150-75-75-c-90-iso646.1991-irv
+cu-alt12.pcf.gz -mutt-clearlyu alternate glyphs-medium-r-normal--17-120-100-100-p-122-iso10646-1
+cu-arabic12.pcf.gz -mutt-clearlyu arabic extra-medium-r-normal--17-120-100-100-p-101-fontspecific-0
+cu-devnag12.pcf.gz -mutt-clearlyu devangari extra-medium-r-normal--17-120-100-100-p-105-fontspecific-0
+cu-lig12.pcf.gz -mutt-clearlyu ligature-medium-r-normal--17-120-100-100-p-141-fontspecific-0
+cu-pua12.pcf.gz -mutt-clearlyu pua-medium-r-normal--17-120-100-100-p-110-iso10646-1
+cu12.pcf.gz -mutt-clearlyu-medium-r-normal--17-120-100-100-p-123-iso10646-1
+cuarabic12.pcf.gz -mutt-clearlyu arabic-medium-r-normal--17-120-100-100-p-93-iso10646-1
+cudevnag12.pcf.gz -mutt-clearlyu devanagari-medium-r-normal--15-120-90-90-p-104-fontspecific-0
+cursor.pcf.gz cursor
+deccurs.pcf.gz decw$cursor
+decsess.pcf.gz decw$session
+gb16fs.pcf.gz -isas-fangsong ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0
+gb16st.pcf.gz -isas-song ti-medium-r-normal--16-160-72-72-c-160-gb2312.1980-0
+gb24st.pcf.gz -isas-song ti-medium-r-normal--24-240-72-72-c-240-gb2312.1980-0
+hanglg16.pcf.gz -daewoo-gothic-medium-r-normal--16-120-100-100-c-160-ksc5601.1987-0
+hanglm16.pcf.gz -daewoo-mincho-medium-r-normal--16-120-100-100-c-160-ksc5601.1987-0
+hanglm24.pcf.gz -daewoo-mincho-medium-r-normal--24-170-100-100-c-240-ksc5601.1987-0
+jiskan16.pcf.gz -jis-fixed-medium-r-normal--16-150-75-75-c-160-jisx0208.1983-0
+jiskan24.pcf.gz -jis-fixed-medium-r-normal--24-230-75-75-c-240-jisx0208.1983-0
+k14.pcf.gz -misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0
+micro.pcf.gz micro
+nil2.pcf.gz -misc-nil-medium-r-normal--2-20-75-75-c-10-misc-fontspecific
+olcursor.pcf.gz -sun-open look cursor-----12-120-75-75-p-160-sunolcursor-1
+olgl10.pcf.gz -sun-open look glyph-----10-100-75-75-p-101-sunolglyph-1
+olgl12.pcf.gz -sun-open look glyph-----12-120-75-75-p-113-sunolglyph-1
+olgl14.pcf.gz -sun-open look glyph-----14-140-75-75-p-128-sunolglyph-1
+olgl19.pcf.gz -sun-open look glyph-----19-190-75-75-p-154-sunolglyph-1
diff --git a/meta/recipes-graphics/xorg-lib/libdmx_1.1.3.bb b/meta/recipes-graphics/xorg-lib/libdmx_1.1.3.bb
new file mode 100644
index 0000000..e623cee
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libdmx_1.1.3.bb
@@ -0,0 +1,20 @@
+require xorg-lib-common.inc
+
+SUMMARY = "DMX: Distributed Multihead X extension library"
+
+DESCRIPTION = "The DMX extension provides support for communication with \
+and control of Xdmx(1) server. Attributes of the Xdmx(1) server and of \
+the back-end screens attached to the server can be queried and modified \
+via this protocol."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a3c3499231a8035efd0e004cfbd3b72a \
+                    file://src/dmx.c;endline=33;md5=c43f19af03c7c8619cadc9724ed9afe1"
+
+DEPENDS += "libxext dmxproto"
+
+PE = "1"
+
+SRC_URI[md5sum] = "ba983eba5a9f05d152a0725b8e863151"
+SRC_URI[sha256sum] = "c97da36d2e56a2d7b6e4f896241785acc95e97eb9557465fd66ba2a155a7b201"
+
diff --git a/meta/recipes-graphics/xorg-lib/libfontenc_1.1.3.bb b/meta/recipes-graphics/xorg-lib/libfontenc_1.1.3.bb
new file mode 100644
index 0000000..a181f05
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libfontenc_1.1.3.bb
@@ -0,0 +1,17 @@
+SUMMARY = "X font encoding library"
+
+DESCRIPTION = "libfontenc is a library which helps font libraries \
+portably determine and deal with different encodings of fonts."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=96254c20ab81c63e65b26f0dbcd4a1c1"
+
+DEPENDS += "zlib xproto font-util"
+PE = "1"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "0920924c3a9ebc1265517bdd2f9fde50"
+SRC_URI[sha256sum] = "70588930e6fc9542ff38e0884778fbc6e6febf21adbab92fd8f524fe60aefd21"
diff --git a/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb b/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb
new file mode 100644
index 0000000..5049b7e
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libice_1.0.9.bb
@@ -0,0 +1,27 @@
+SUMMARY = "ICE: Inter-Client Exchange library"
+
+DESCRIPTION = "The Inter-Client Exchange (ICE) protocol provides a \
+generic framework for building protocols on top of reliable, byte-stream \
+transport connections. It provides basic mechanisms for setting up and \
+shutting down connections, for performing authentication, for \
+negotiating versions, and for reporting errors. "
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d162b1b3c6fa812da9d804dcf8584a93"
+
+DEPENDS += "xproto xtrans"
+PROVIDES = "ice"
+
+PE = "1"
+
+XORG_PN = "libICE"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "addfb1e897ca8079531669c7c7711726"
+SRC_URI[sha256sum] = "8f7032f2c1c64352b5423f6b48a8ebdc339cc63064af34d66a6c9aa79759e202"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[arc4] = "ac_cv_lib_bsd_arc4random_buf=yes,ac_cv_lib_bsd_arc4random_buf=no,libbsd"
diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess/0001-Include-config.h-before-anything-else-in-.c.patch b/meta/recipes-graphics/xorg-lib/libpciaccess/0001-Include-config.h-before-anything-else-in-.c.patch
new file mode 100644
index 0000000..e92fc0d
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libpciaccess/0001-Include-config.h-before-anything-else-in-.c.patch
@@ -0,0 +1,187 @@
+From b14696a55796e739624bbda4f772427032efff2a Mon Sep 17 00:00:00 2001
+From: Julien Cristau <jcristau@debian.org>
+Date: Sun, 26 Apr 2015 15:20:57 +0200
+Subject: [PATCH 1/4] Include config.h before anything else in *.c
+
+Debian bug#749008 <https://bugs.debian.org/749008>
+
+Reported-by: Michael Tautschnig <mt@debian.org>
+Signed-off-by: Julien Cristau <jcristau@debian.org>
+Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+---
+Upstream-Status: Backport
+
+ src/common_capability.c  | 3 +++
+ src/common_init.c        | 3 +++
+ src/common_interface.c   | 3 +++
+ src/common_io.c          | 3 +++
+ src/common_iterator.c    | 3 +++
+ src/common_map.c         | 3 +++
+ src/common_vgaarb_stub.c | 3 +++
+ src/linux_devmem.c       | 5 +++--
+ src/openbsd_pci.c        | 3 +++
+ src/solx_devfs.c         | 3 +++
+ src/x86_pci.c            | 4 +++-
+ 11 files changed, 33 insertions(+), 3 deletions(-)
+
+diff --git a/src/common_capability.c b/src/common_capability.c
+index 488743d..15d395d 100644
+--- a/src/common_capability.c
++++ b/src/common_capability.c
+@@ -31,6 +31,9 @@
+  *
+  * \author Ian Romanick <idr@us.ibm.com>
+  */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+ #include <stdlib.h>
+ #include <stdio.h>
+diff --git a/src/common_init.c b/src/common_init.c
+index b1c0c3e..f7b59bd 100644
+--- a/src/common_init.c
++++ b/src/common_init.c
+@@ -28,6 +28,9 @@
+  *
+  * \author Ian Romanick <idr@us.ibm.com>
+  */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+ #include <stdlib.h>
+ #include <errno.h>
+diff --git a/src/common_interface.c b/src/common_interface.c
+index 59778cf..cb95e90 100644
+--- a/src/common_interface.c
++++ b/src/common_interface.c
+@@ -28,6 +28,9 @@
+  *
+  * \author Ian Romanick <idr@us.ibm.com>
+  */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/src/common_io.c b/src/common_io.c
+index f5c9e45..e9586ad 100644
+--- a/src/common_io.c
++++ b/src/common_io.c
+@@ -22,6 +22,9 @@
+  * Author:
+  *	Adam Jackson <ajax@redhat.com>
+  */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/src/common_iterator.c b/src/common_iterator.c
+index ccf656d..2beb180 100644
+--- a/src/common_iterator.c
++++ b/src/common_iterator.c
+@@ -28,6 +28,9 @@
+  *
+  * \author Ian Romanick <idr@us.ibm.com>
+  */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/src/common_map.c b/src/common_map.c
+index 8757151..f1854bb 100644
+--- a/src/common_map.c
++++ b/src/common_map.c
+@@ -21,6 +21,9 @@
+  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+  * DEALINGS IN THE SOFTWARE.
+  */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+ #include <sys/types.h>
+ #include <sys/mman.h>
+diff --git a/src/common_vgaarb_stub.c b/src/common_vgaarb_stub.c
+index 9394273..c1708f6 100644
+--- a/src/common_vgaarb_stub.c
++++ b/src/common_vgaarb_stub.c
+@@ -23,6 +23,9 @@
+  * OTHER DEALINGS IN THE SOFTWARE.
+  *
+  */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+ #include <stdio.h>
+ #include "pciaccess.h"
+diff --git a/src/linux_devmem.c b/src/linux_devmem.c
+index 10e3bde..0d0567c 100644
+--- a/src/linux_devmem.c
++++ b/src/linux_devmem.c
+@@ -32,8 +32,9 @@
+  *
+  * \author Ian Romanick <idr@us.ibm.com>
+  */
+-
+-#define _GNU_SOURCE
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+ #include <stdlib.h>
+ #include <string.h>
+diff --git a/src/openbsd_pci.c b/src/openbsd_pci.c
+index 4d1b5cd..b8ce318 100644
+--- a/src/openbsd_pci.c
++++ b/src/openbsd_pci.c
+@@ -13,6 +13,9 @@
+  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+  */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+ #include <sys/param.h>
+ #include <sys/ioctl.h>
+diff --git a/src/solx_devfs.c b/src/solx_devfs.c
+index f572393..cf96467 100644
+--- a/src/solx_devfs.c
++++ b/src/solx_devfs.c
+@@ -25,6 +25,9 @@
+ /*
+  * Solaris devfs interfaces
+  */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+ #include <stdlib.h>
+ #include <strings.h>
+diff --git a/src/x86_pci.c b/src/x86_pci.c
+index 49c1cab..32daa04 100644
+--- a/src/x86_pci.c
++++ b/src/x86_pci.c
+@@ -18,8 +18,10 @@
+  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+  */
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
+ 
+-#define _GNU_SOURCE
+ #include <unistd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+-- 
+2.1.4
+
diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess/0002-Fix-quoting-issue.patch b/meta/recipes-graphics/xorg-lib/libpciaccess/0002-Fix-quoting-issue.patch
new file mode 100644
index 0000000..16d69a8
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libpciaccess/0002-Fix-quoting-issue.patch
@@ -0,0 +1,34 @@
+From 765e0a38cb8c40f8865af5cb356ffe6039ffb08f Mon Sep 17 00:00:00 2001
+From: Thomas Klausner <wiz@NetBSD.org>
+Date: Sun, 22 Mar 2015 21:38:23 +0100
+Subject: [PATCH 2/4] Fix quoting issue.
+
+m4 has '[]' as quoting characters, so if we want '[]' to
+end up in the configure script, we need to quote them again.
+
+Reported by Greg Troxel <gdt@ir.bbn.com>.
+
+Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
+Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+---
+Upstream-Status: Backport
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index e67e9e1..888330b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -76,7 +76,7 @@ case $host_os in
+ 		;;
+ 	*netbsd*)
+ 		case $host in
+-		*i[3-9]86*)
++		*i[[3-9]]86*)
+ 			PCIACCESS_LIBS="$PCIACCESS_LIBS -li386"
+ 			;;
+ 		*x86_64*|*amd64*)
+-- 
+2.1.4
+
diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess/0003-linux_sysfs.c-Include-limits.h-for-PATH_MAX.patch b/meta/recipes-graphics/xorg-lib/libpciaccess/0003-linux_sysfs.c-Include-limits.h-for-PATH_MAX.patch
new file mode 100644
index 0000000..f513c8e
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libpciaccess/0003-linux_sysfs.c-Include-limits.h-for-PATH_MAX.patch
@@ -0,0 +1,32 @@
+From 6bd2f7f92eae713663f4e13f6e2cb23526607b8c Mon Sep 17 00:00:00 2001
+From: Felix Janda <felix.janda@posteo.de>
+Date: Fri, 1 May 2015 16:36:50 +0200
+Subject: [PATCH 3/4] linux_sysfs.c: Include <limits.h> for PATH_MAX
+
+Fixes compilation with musl libc.
+
+Tested-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+Signed-off-by: Felix Janda <felix.janda@posteo.de>
+Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
+---
+Upstream-Status: Backport
+
+ src/linux_sysfs.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
+index 50d94cf..3f95e53 100644
+--- a/src/linux_sysfs.c
++++ b/src/linux_sysfs.c
+@@ -45,6 +45,7 @@
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
++#include <limits.h>
+ #include <sys/mman.h>
+ #include <dirent.h>
+ #include <errno.h>
+-- 
+2.1.4
+
diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess/0004-Don-t-include-sys-io.h-on-arm.patch b/meta/recipes-graphics/xorg-lib/libpciaccess/0004-Don-t-include-sys-io.h-on-arm.patch
new file mode 100644
index 0000000..f532858
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libpciaccess/0004-Don-t-include-sys-io.h-on-arm.patch
@@ -0,0 +1,28 @@
+From b6df5202306bd71158b482f25ca2e6919645d4dd Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 4 Jun 2015 20:55:06 -0700
+Subject: [PATCH 4/4] Don't include sys/io.h on arm
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/linux_sysfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c
+index 3f95e53..1e3aad3 100644
+--- a/src/linux_sysfs.c
++++ b/src/linux_sysfs.c
+@@ -50,7 +50,7 @@
+ #include <dirent.h>
+ #include <errno.h>
+ 
+-#if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
++#if defined(__i386__) || defined(__x86_64__)
+ #include <sys/io.h>
+ #else
+ #define inb(x) -1
+-- 
+2.1.4
+
diff --git a/meta/recipes-graphics/xorg-lib/libpciaccess_0.13.4.bb b/meta/recipes-graphics/xorg-lib/libpciaccess_0.13.4.bb
new file mode 100644
index 0000000..ffa6a60
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libpciaccess_0.13.4.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Generic PCI access library for X"
+
+DESCRIPTION = "libpciaccess provides functionality for X to access the \
+PCI bus and devices in a platform-independent way."
+
+require xorg-lib-common.inc
+
+SRC_URI += "\
+            file://0001-Include-config.h-before-anything-else-in-.c.patch \
+            file://0002-Fix-quoting-issue.patch \
+            file://0003-linux_sysfs.c-Include-limits.h-for-PATH_MAX.patch \
+            file://0004-Don-t-include-sys-io.h-on-arm.patch \
+"
+
+SRC_URI[md5sum] = "ace78aec799b1cf6dfaea55d3879ed9f"
+SRC_URI[sha256sum] = "07f864654561e4ac8629a0ef9c8f07fbc1f8592d1b6c418431593e9ba2cf2fcf"
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=277aada5222b9a22fbf3471ff3687068"
+
+REQUIRED_DISTRO_FEATURES = ""
diff --git a/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.3.bb b/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.3.bb
new file mode 100644
index 0000000..5514c7f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libpthread-stubs_0.3.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Library that provides weak aliases for pthread functions"
+DESCRIPTION = "This library provides weak aliases for pthread functions \
+not provided in libc or otherwise available by default."
+HOMEPAGE = "http://xcb.freedesktop.org"
+BUGTRACKER = "http://bugs.freedesktop.org/buglist.cgi?product=XCB"
+SECTION = "x11/libs"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6edc1fea03d959f0c2d743fe5ca746ad"
+
+#DEPENDS = "xcb-proto xproto libxau libxslt-native"
+# DEPENDS += "xsltproc-native gperf-native"
+
+ALLOW_EMPTY_${PN} = "1"
+
+SRC_URI = "http://xcb.freedesktop.org/dist/libpthread-stubs-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "e8fa31b42e13f87e8f5a7a2b731db7ee"
+SRC_URI[sha256sum] = "35b6d54e3cc6f3ba28061da81af64b9a92b7b757319098172488a660e3d87299"
+
+inherit autotools pkgconfig
+
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb b/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb
new file mode 100644
index 0000000..1925136
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libsm_1.2.2.bb
@@ -0,0 +1,28 @@
+SUMMARY = "SM: Session Management library"
+
+DESCRIPTION = "The Session Management Library (SMlib) is a low-level \"C\" \
+language interface to XSMP.  The purpose of the X Session Management \
+Protocol (XSMP) is to provide a uniform mechanism for users to save and \
+restore their sessions.  A session is a group of clients, each of which \
+has a particular state."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c0fb37f44e02bdbde80546024400728d"
+
+DEPENDS += "libice xproto xtrans"
+
+# libSM can work without libuuid, we explicitly disable it to break the following circular dependency
+# when DISTRO_FEATURES contains 'systemd' and 'x11'.
+# systemd -> dbus -> libsm -> util-linux -> systemd
+EXTRA_OECONF += "--without-libuuid"
+
+PE = "1"
+
+XORG_PN = "libSM"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "499a7773c65aba513609fe651853c5f3"
+SRC_URI[sha256sum] = "0baca8c9f5d934450a70896c4ad38d06475521255ca63b717a6510fdb6e287bd"
diff --git a/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.3.bb b/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.3.bb
new file mode 100644
index 0000000..c0d0148
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11-diet_1.6.3.bb
@@ -0,0 +1,19 @@
+require libx11.inc
+
+DESCRIPTION += " Support for XCMS and XLOCALE is disabled in \
+this version."
+
+SRC_URI += "file://X18NCMSstubs.diff \
+            file://fix-disable-xlocale.diff \
+            file://fix-utf8-wrong-define.patch \
+           "
+
+RPROVIDES_${PN}-dev = "libx11-dev"
+RPROVIDES_${PN}-locale = "libx11-locale"
+
+SRC_URI[md5sum] = "2e36b73f8a42143142dda8129f02e4e0"
+SRC_URI[sha256sum] = "cf31a7c39f2f52e8ebd0db95640384e63451f9b014eed2bb7f5de03e8adc8111"
+
+EXTRA_OECONF += "--disable-xlocale"
+
+PACKAGECONFIG ??= ""
diff --git a/meta/recipes-graphics/xorg-lib/libx11.inc b/meta/recipes-graphics/xorg-lib/libx11.inc
new file mode 100644
index 0000000..b04eafb
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11.inc
@@ -0,0 +1,41 @@
+SUMMARY = "Xlib: C Language X Interface library"
+
+DESCRIPTION = "This package provides a client interface to the X Window \
+System, otherwise known as 'Xlib'.  It provides a complete API for the \
+basic functions of the window system."
+
+require xorg-lib-common.inc
+
+inherit siteinfo
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/libx11:"
+
+PE = "1"
+
+PROVIDES = "virtual/libx11"
+
+XORG_PN = "libX11"
+LICENSE = "MIT & MIT-style & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=172255dee66bb0151435b2d5d709fcf7"
+
+DEPENDS += "xproto xextproto xtrans libxcb kbproto inputproto"
+DEPENDS += "xproto-native"
+
+EXTRA_OECONF += "--with-keysymdefdir=${STAGING_INCDIR}/X11/ --disable-xf86bigfont"
+EXTRA_OEMAKE += 'CWARNFLAGS=""'
+
+PACKAGECONFIG ??= "xcms"
+PACKAGECONFIG[xcms] = "--enable-xcms,--disable-xcms"
+
+# src/util/makekeys is built natively but needs -D_GNU_SOURCE defined.
+CPPFLAGS_FOR_BUILD += "-D_GNU_SOURCE"
+
+PACKAGES =+ "${PN}-xcb"
+
+FILES_${PN} += "${datadir}/X11/XKeysymDB ${datadir}/X11/XErrorDB ${datadir}/X11/Xcms.txt"
+FILES_${PN}-xcb += "${libdir}/libX11-xcb.so.*"
+FILES_${PN}-locale += "${datadir}/X11/locale ${libdir}/X11/locale"
+
+# Multiple libx11 derivatives from from this file and are selected by virtual/libx11
+# A world build should only build the correct version, not all of them.
+EXCLUDE_FROM_WORLD = "1"
diff --git a/meta/recipes-graphics/xorg-lib/libx11/X18NCMSstubs.diff b/meta/recipes-graphics/xorg-lib/libx11/X18NCMSstubs.diff
new file mode 100644
index 0000000..744cedc
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11/X18NCMSstubs.diff
@@ -0,0 +1,520 @@
+Upstream-Status: Pending
+
+Upstream-Status: Inappropriate [configuration]
+Index: libX11-1.3/src/imConv.c
+===================================================================
+--- libX11-1.3.orig/src/imConv.c
++++ libX11-1.3/src/imConv.c
+@@ -83,6 +83,7 @@ static const struct SubstRec SubstTable[
+  * from UCS char to specified charset char.
+  * This converter is needed for _XimGetCharCode subroutine.
+  */
++#ifdef XLOCALE
+ XPointer
+ _XimGetLocaleCode (
+     _Xconst char*	encoding_name)
+@@ -96,6 +97,7 @@ _XimGetLocaleCode (
+     }
+     return cvt;
+ }
++#endif
+ 
+ /*
+  * Returns the locale dependent representation of a keysym.
+@@ -106,6 +108,7 @@ _XimGetLocaleCode (
+  * terminating NUL byte. Return 0 if the keysym is not representable in the
+  * locale
+  */
++#ifdef XLOCALE
+ /*ARGSUSED*/
+ int
+ _XimGetCharCode (
+@@ -135,6 +138,7 @@ _XimGetCharCode (
+         buf[count]= '\0';
+     return count;
+ }
++#endif
+ 
+ #ifdef XKB
+ static int lookup_string(
+Index: libX11-1.3/src/X18NCMSstubs.c
+===================================================================
+--- /dev/null
++++ libX11-1.3/src/X18NCMSstubs.c
+@@ -0,0 +1,428 @@
++/*
++ * X18NCMSstubs.c
++ * - Provides stubs and dummy funcs needed when Xcms and XLocale stuff removed
++ *
++ * Copyright © 2003 Matthew Allum
++ *
++ * Permission to use, copy, modify, distribute, and sell this software and its
++ * documentation for any purpose is hereby granted without fee, provided that
++ * the above copyright notice appear in all copies and that both that
++ * copyright notice and this permission notice appear in supporting
++ * documentation, and that the name of Matthew Allum not be used in
++ * advertising or publicity pertaining to distribution of the software without
++ * specific, written prior permission.  Keith Packard and Compaq makes no
++ * representations about the suitability of this software for any purpose.  It
++ * is provided "as is" without express or implied warranty.
++ *
++ * MATTHEW ALLUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS 
++ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, 
++ * IN NO EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
++ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
++ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
++ * PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#include <stdlib.h>
++#include "Xlibint.h"
++#include "Xlcint.h"
++#include <X11/Xlocale.h>
++#include <X11/Xos.h>
++#ifdef WIN32
++#undef close
++#endif
++#include <X11/Xutil.h>
++#include "XlcPubI.h"
++
++#include "Xcmsint.h" 		/* for XcmsCCC type  */
++#include "XlcPubI.h"            /* for XLCd type */
++#include "config.h"
++
++#if ! XLOCALE
++
++Bool
++XSupportsLocale()
++{
++  return False; 		
++}
++
++char *
++XSetLocaleModifiers(
++    const char *modifiers)
++{
++  return NULL;
++}
++
++XLCd
++_XOpenLC(
++    char *name)
++{
++  return NULL;
++}
++
++XLCd
++_XlcCurrentLC()
++{
++  return NULL;
++}
++
++void
++_XlcVaToArgList(
++    va_list var,
++    int count,
++    XlcArgList *args_ret)
++{
++  return;
++}
++
++void
++_XlcCountVaList(
++    va_list var,
++    int *count_ret)
++{
++  return;
++}
++
++void
++_XCloseLC(
++    XLCd lcd)
++{
++  return;
++}
++
++int
++_XlcConvert(
++    XlcConv conv,
++    XPointer *from,
++    int *from_left,
++    XPointer *to,
++    int *to_left,
++    XPointer *args,
++    int num_args)
++{
++  return 0;
++}
++
++/* XIM Stubs */
++
++XPointer
++_XimGetLocaleCode ( _Xconst char* encoding_name )
++{
++  return NULL;
++}
++
++int
++_XimGetCharCode (
++    XPointer            ucs_conv,
++    KeySym              keysym,
++    unsigned char*      buf,
++    int                 nbytes)
++{
++  return 0;
++}
++
++/* Xrm Stubs */
++
++XrmMethods
++_XrmInitParseInfo(
++    XPointer *state)
++{
++    return (XrmMethods) NULL;
++}
++
++/* Xwc Stubs */
++
++int
++XwcTextExtents(
++    XFontSet            font_set,
++    _Xconst wchar_t    *text,
++    int                 text_len,
++    XRectangle         *overall_ink_extents,
++    XRectangle         *overall_logical_extents)
++{
++  return 0;
++}
++
++void 
++XwcDrawString(Display *display,
++	      Drawable d,
++	      XFontSet font_set,
++	      GC gc,
++	      int x, int y,
++	      _Xconst wchar_t *string,
++	      int num_wchars)
++{
++  ;
++}
++
++void
++XwcDrawText(
++    Display            *dpy,
++    Drawable            d,
++    GC                  gc,
++    int                 x,
++    int                 y,
++    XwcTextItem        *text_items,
++    int                 nitems)
++{
++  ;
++}
++
++void
++XwcDrawImageString(
++    Display            *dpy,
++    Drawable            d,
++    XFontSet            font_set,
++    GC                  gc,
++    int                 x,
++    int                 y,
++    _Xconst wchar_t    *text,
++    int                 text_len)
++{
++  ;
++}
++
++int
++XwcTextEscapement(
++    XFontSet            font_set,
++    _Xconst wchar_t    *text,
++    int                 text_len)
++{
++  return 0;
++}
++
++Status
++XwcTextPerCharExtents(
++    XFontSet            font_set,
++    _Xconst wchar_t    *text,
++    int                 text_len,
++    XRectangle         *ink_extents_buffer,
++    XRectangle         *logical_extents_buffer,
++    int                 buffer_size,
++    int                *num_chars,
++    XRectangle         *max_ink_extents,
++    XRectangle         *max_logical_extents)
++{
++  return(XcmsFailure);
++}
++
++int
++XwcTextPropertyToTextList(
++    Display *dpy,
++    const XTextProperty *text_prop,
++    wchar_t ***list_ret,
++    int *count_ret)
++{
++  return 0;
++}
++
++int
++XwcTextListToTextProperty(
++    Display *dpy,
++    wchar_t **list,
++    int count,
++    XICCEncodingStyle style,
++    XTextProperty *text_prop)
++{
++  return 0;
++}
++
++void
++XwcFreeStringList(wchar_t **list)
++{
++  return;
++}
++
++
++void XmbSetWMProperties (        /* Actually from mbWMProps.c */
++    Display *dpy,
++    Window w,
++    _Xconst char *windowName,
++    _Xconst char *iconName,
++    char **argv,
++    int argc,
++    XSizeHints *sizeHints,
++    XWMHints *wmHints,
++    XClassHint *classHints)
++{
++  return;
++}
++
++int
++XmbTextPropertyToTextList(
++    Display *dpy,
++    const XTextProperty *text_prop,
++    char ***list_ret,
++    int *count_ret)
++{
++  return XLocaleNotSupported;
++}
++
++int
++XmbTextListToTextProperty(
++    Display *dpy,
++    char **list,
++    int count,
++    XICCEncodingStyle style,
++    XTextProperty *text_prop)
++{
++  return XLocaleNotSupported;
++}
++
++int
++XmbTextExtents(
++    XFontSet        font_set,
++    _Xconst char   *text,
++    int             text_len,
++    XRectangle     *overall_ink_extents,
++    XRectangle     *overall_logical_extents)
++{
++  return 0;
++}
++
++void
++XmbDrawText(
++    Display            *dpy,
++    Drawable            d,
++    GC                  gc,
++    int                 x,
++    int                 y,
++    XmbTextItem        *text_items,
++    int                 nitems)
++{
++  ;
++}
++
++void
++XmbDrawString(
++    Display            *dpy,
++    Drawable            d,
++    XFontSet            font_set,
++    GC                  gc,
++    int                 x,
++    int                 y,
++    _Xconst char       *text,
++    int                 text_len)
++{
++  ;
++}
++
++void
++XmbDrawImageString(
++    Display            *dpy,
++    Drawable            d,
++    XFontSet            font_set,
++    GC                  gc,
++    int                 x,
++    int                 y,
++    _Xconst char       *text,
++    int                 text_len)
++{
++  ;
++}
++
++int
++XmbTextEscapement(
++    XFontSet        font_set,
++    _Xconst char   *text,
++    int             text_len)
++{
++  return 0;
++}
++
++Status
++XmbTextPerCharExtents(
++    XFontSet        font_set,
++    _Xconst char   *text,
++    int             text_len,
++    XRectangle     *ink_extents_buffer,
++    XRectangle     *logical_extents_buffer,
++    int             buffer_size,
++    int            *num_chars,
++    XRectangle     *max_ink_extents,
++    XRectangle     *max_logical_extents)
++{
++  return 0;
++}
++
++unsigned int
++KeySymToUcs4(KeySym keysym)
++{
++  return 0;
++}
++
++#endif 
++
++#if ! XCMS
++
++XcmsCCC 
++XcmsCCCOfColormap(dpy, cmap)
++    Display *dpy;
++    Colormap cmap;
++{
++  return NULL;
++}
++
++Status
++_XcmsResolveColorString (
++    XcmsCCC ccc,
++    const char **color_string,
++    XcmsColor *pColor_exact_return,
++    XcmsColorFormat result_format)
++{
++  return(XcmsFailure);
++}
++
++void
++_XcmsUnresolveColor(
++    XcmsCCC ccc,
++    XcmsColor *pColor)
++{
++  return;
++}
++
++void
++_XUnresolveColor(
++    XcmsCCC ccc,
++    XColor *pXColor)
++{
++  return;
++}
++
++XcmsCmapRec *
++_XcmsAddCmapRec(dpy, cmap, windowID, visual)
++    Display *dpy;
++    Colormap cmap;
++    Window windowID;
++    Visual *visual;
++{
++  return NULL;
++}
++
++void
++_XcmsRGB_to_XColor(
++    XcmsColor *pColors,
++    XColor *pXColors,
++    unsigned int nColors)
++{
++  return;
++}
++
++XcmsCmapRec *
++_XcmsCopyCmapRecAndFree(
++    Display *dpy,
++    Colormap src_cmap,
++    Colormap copy_cmap)
++{
++  return NULL;
++}
++
++void
++_XcmsDeleteCmapRec(
++    Display *dpy,
++    Colormap cmap)
++{
++  return;
++}
++
++#endif
+Index: libX11-1.3/src/Makefile.am
+===================================================================
+--- libX11-1.3.orig/src/Makefile.am
++++ libX11-1.3/src/Makefile.am
+@@ -335,6 +335,8 @@ if THRSTUBS
+ libX11_la_SOURCES+=UIThrStubs.c
+ endif
+ 
++libX11_la_SOURCES+=X18NCMSstubs.c
++
+ x11datadir = @X11_DATADIR@
+ x11data_DATA = XKeysymDB XErrorDB
+ 
+@@ -342,6 +344,7 @@ EXTRA_DIST = \
+ 	$(x11data_DATA) \
+ 	os2Stubs.c \
+-	UIThrStubs.c 
++	UIThrStubs.c \
++	X18NCMSstubs.c
+ 
+ if XCB
+ libX11_la_SOURCES += \
+Index: libX11-1.3/src/locking.c
+===================================================================
+--- libX11-1.3.orig/src/locking.c
++++ libX11-1.3/src/locking.c
+@@ -66,7 +66,9 @@ in this Software without prior written a
+ #define NUM_FREE_CVLS 4
+ 
+ /* in lcWrap.c */
++#ifdef XLOCALE
+ extern LockInfoPtr _Xi18n_lock;
++#endif
+ 
+ #ifdef WIN32
+ static DWORD _X_TlsIndex = (DWORD)-1;
+@@ -594,9 +596,11 @@ Status XInitThreads(void)
+     _Xglobal_lock = &global_lock;
+     xmutex_init(_Xglobal_lock->lock);
+     xmutex_set_name(_Xglobal_lock->lock, "Xlib global");
++#ifdef XLOCALE
+     _Xi18n_lock = &i18n_lock;
+     xmutex_init(_Xi18n_lock->lock);
+     xmutex_set_name(_Xi18n_lock->lock, "Xlib i18n");
++#endif
+     _XLockMutex_fn = _XLockMutex;
+     _XUnlockMutex_fn = _XUnlockMutex;
+     _XCreateMutex_fn = _XCreateMutex;
diff --git a/meta/recipes-graphics/xorg-lib/libx11/disable_tests.patch b/meta/recipes-graphics/xorg-lib/libx11/disable_tests.patch
new file mode 100644
index 0000000..c1b6cde
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11/disable_tests.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+Update for 1.6.1
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+diff -Nurd libX11-1.5.0/nls/Makefile.am libX11-1.5.0/nls/Makefile.am
+--- libX11-1.5.0/nls/Makefile.am	2012-06-02 09:37:18.000000000 +0300
++++ libX11-1.5.0/nls/Makefile.am	2013-01-02 16:10:24.960156131 +0200
+@@ -36,11 +36,6 @@
+         < locale.dir.l1 > locale.dir.l2
+	cat locale.dir.l2 locale.dir.l1 > locale.dir
+
+-if HAVE_PERL
+-LOG_COMPILER = $(PERL)
+-TESTS = compose-check.pl
+-endif HAVE_PERL
+-
+
+ # Per-locale data files
diff --git a/meta/recipes-graphics/xorg-lib/libx11/fix-disable-xlocale.diff b/meta/recipes-graphics/xorg-lib/libx11/fix-disable-xlocale.diff
new file mode 100644
index 0000000..a7c3984
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11/fix-disable-xlocale.diff
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+--- libX11-X11R7.0-1.0.0/src/Font.c.orig	2006-03-12 18:35:42.000000000 +0100
++++ libX11-X11R7.0-1.0.0/src/Font.c	2006-03-12 18:40:27.000000000 +0100
+@@ -701,7 +701,11 @@
+     }
+     if (l - 2 - (p - charset) < 0)
+ 	return 0;
++#ifdef XLOCALE
+     if (_XlcNCompareISOLatin1(name + l - 2 - (p - charset), charset, p - charset))
++#else
++    if (strncasecmp(name + l - 2 - (p - charset), charset, p - charset))
++#endif
+ 	return 0;
+     if (strlen(p + 1) + l - 1 >= sizeof(buf) - 1)
+ 	return 0;
diff --git a/meta/recipes-graphics/xorg-lib/libx11/fix-utf8-wrong-define.patch b/meta/recipes-graphics/xorg-lib/libx11/fix-utf8-wrong-define.patch
new file mode 100644
index 0000000..c6347f5
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11/fix-utf8-wrong-define.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+Signed-off-by: Xiaofeng Yan <xiaofeng.yan@windriver.com>
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- libX11-X11R7.0-1.0.0/include/X11/Xlib.h~fix-utf8-wrong-define
++++ libX11-X11R7.0-1.0.0/include/X11/Xlib.h
+@@ -103,7 +103,7 @@
+ 
+ /* API mentioning "UTF8" or "utf8" is an XFree86 extension, introduced in
+    November 2000. Its presence is indicated through the following macro. */
+-#define X_HAVE_UTF8_STRING 1
++#undef X_HAVE_UTF8_STRING
+ 
+ typedef char *XPointer;
+ 
diff --git a/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch b/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch
new file mode 100644
index 0000000..f2abf7c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11/libX11-Add-missing-NULL-check.patch
@@ -0,0 +1,72 @@
+From 4d85d5f3bd8afac893738fd88e19d8cb5cf998ff Mon Sep 17 00:00:00 2001
+From: Drew Moseley <drew_moseley@mentor.com>
+Date: Sun, 27 Jul 2014 13:10:07 -0400
+Subject: [PATCH] libX11: Add missing NULL check on im and im->methods
+
+Upstream-Status: Backport (c827edcd1c4a7f920aa25208083b5b58d60d2b44)
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+
+---
+ src/xlibi18n/ICWrap.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff -ru libX11-1.6.2-orig/src/xlibi18n/ICWrap.c libX11-1.6.2/src/xlibi18n/ICWrap.c
+--- libX11-1.6.2-orig/src/xlibi18n/ICWrap.c	2014-07-27 13:38:29.586666449 -0400
++++ libX11-1.6.2/src/xlibi18n/ICWrap.c	2014-07-27 13:41:39.671609030 -0400
+@@ -169,7 +169,7 @@
+     va_list var;
+     int     total_count;
+     XIMArg *args;
+-    char   *ret;
++    char   *ret = NULL;
+ 
+     /*
+      * so count the stuff dangling here
+@@ -185,7 +185,8 @@
+     _XIMVaToNestedList(var, total_count, &args);
+     va_end(var);
+ 
+-    ret = (*im->methods->set_values) (im, args);
++    if (im && im->methods)
++	ret = (*im->methods->set_values) (im, args);
+     Xfree(args);
+     return ret;
+ }
+@@ -196,7 +197,7 @@
+     va_list var;
+     int     total_count;
+     XIMArg *args;
+-    char   *ret;
++    char   *ret = NULL;
+ 
+     /*
+      * so count the stuff dangling here
+@@ -212,7 +213,8 @@
+     _XIMVaToNestedList(var, total_count, &args);
+     va_end(var);
+ 
+-    ret = (*im->methods->get_values) (im, args);
++    if (im && im->methods)
++	ret = (*im->methods->get_values) (im, args);
+     Xfree(args);
+     return ret;
+ }
+@@ -228,7 +230,7 @@
+     va_list var;
+     int     total_count;
+     XIMArg *args;
+-    XIC     ic;
++    XIC     ic = NULL;
+ 
+     /*
+      * so count the stuff dangling here
+@@ -244,7 +246,8 @@
+     _XIMVaToNestedList(var, total_count, &args);
+     va_end(var);
+ 
+-    ic = (XIC) (*im->methods->create_ic) (im, args);
++    if (im && im->methods)
++	ic = (XIC) (*im->methods->create_ic) (im, args);
+     Xfree(args);
+     if (ic) {
+ 	ic->core.next = im->core.ic_chain;
diff --git a/meta/recipes-graphics/xorg-lib/libx11_1.6.3.bb b/meta/recipes-graphics/xorg-lib/libx11_1.6.3.bb
new file mode 100644
index 0000000..8e531c7
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libx11_1.6.3.bb
@@ -0,0 +1,11 @@
+require libx11.inc
+inherit gettext
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI += "file://disable_tests.patch \
+            file://libX11-Add-missing-NULL-check.patch \
+           "
+
+SRC_URI[md5sum] = "2e36b73f8a42143142dda8129f02e4e0"
+SRC_URI[sha256sum] = "cf31a7c39f2f52e8ebd0db95640384e63451f9b014eed2bb7f5de03e8adc8111"
diff --git a/meta/recipes-graphics/xorg-lib/libxau_1.0.8.bb b/meta/recipes-graphics/xorg-lib/libxau_1.0.8.bb
new file mode 100644
index 0000000..2ef8bfa
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxau_1.0.8.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Xau: X Authority Database library"
+
+DESCRIPTION = "libxau provides the main interfaces to the X11 \
+authorisation handling, which controls authorisation for X connections, \
+both client-side and server-side."
+
+require xorg-lib-common.inc
+
+inherit gettext
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7908e342491198401321cec1956807ec"
+
+DEPENDS += " xproto"
+PROVIDES = "xau"
+
+PE = "1"
+
+XORG_PN = "libXau"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "685f8abbffa6d145c0f930f00703b21b"
+SRC_URI[sha256sum] = "fdd477320aeb5cdd67272838722d6b7d544887dfe7de46e1e7cc0c27c2bea4f2"
diff --git a/meta/recipes-graphics/xorg-lib/libxcalibrate/fix-xcb.patch b/meta/recipes-graphics/xorg-lib/libxcalibrate/fix-xcb.patch
new file mode 100644
index 0000000..d614883
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxcalibrate/fix-xcb.patch
@@ -0,0 +1,29 @@
+Upstream-Status: Pending
+
+There is no extra reply data and if we say not to disgard it, xcb
+throws fatal asserts.
+
+RP - 26/11/09
+
+Index: git/xcalibrate.c
+===================================================================
+--- git.orig/xcalibrate.c	2009-11-26 08:11:48.000000000 +0000
++++ git/xcalibrate.c	2009-11-26 08:09:55.000000000 +0000
+@@ -216,7 +216,7 @@
+   req->reqType = info->codes->major_opcode;
+   req->xCalibrateReqType = X_XCalibrateRawMode;
+   req->on = enable;
+-  if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) 
++  if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) 
+     {
+       UnlockDisplay (dpy);
+       SyncHandle ();
+@@ -240,7 +240,7 @@
+   req->xCalibrateReqType = X_XCalibrateScreenToCoord;
+   req->x = *x;
+   req->y = *y;
+-  if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) 
++  if (!_XReply (dpy, (xReply *) &rep, 0, xTrue)) 
+     {
+       UnlockDisplay (dpy);
+       SyncHandle ();
diff --git a/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb b/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb
new file mode 100644
index 0000000..455e869
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxcalibrate_git.bb
@@ -0,0 +1,22 @@
+SUMMARY = "XCalibrate: Touchscreen calibration library"
+
+DESCRIPTION = "libXCalibrate is a library for performing touchscreen \
+calibration with the kdrive tslib touchscreen driver."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://xcalibrate.h;endline=21;md5=fa572df6439f0f235f2612f370f153d7 \
+                    file://xcalibrate.c;endline=21;md5=fa572df6439f0f235f2612f370f153d7"
+
+DEPENDS = "virtual/libx11 calibrateproto libxext"
+
+SRCREV = "209d83af61ed38a002c8096377deac292b3e396c"
+PV = "0.0+git${SRCPV}"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/lib/libXCalibrate \
+           file://fix-xcb.patch"
+
+S = "${WORKDIR}/git"
+
+FILES_${PN}-locale += "${datadir}/X11/locale"
diff --git a/meta/recipes-graphics/xorg-lib/libxcb.inc b/meta/recipes-graphics/xorg-lib/libxcb.inc
new file mode 100644
index 0000000..fe31f20
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxcb.inc
@@ -0,0 +1,30 @@
+SUMMARY = "XCB: The X protocol C binding library"
+DESCRIPTION = "The X protocol C-language Binding (XCB) is a replacement \
+for Xlib featuring a small footprint, latency hiding, direct access to \
+the protocol, improved threading support, and extensibility."
+HOMEPAGE = "http://xcb.freedesktop.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=XCB"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SECTION = "x11/libs"
+LICENSE = "MIT-X"
+
+DEPENDS = "xcb-proto xproto libxau xcb-proto-native libpthread-stubs"
+
+SRC_URI = "http://xcb.freedesktop.org/dist/libxcb-${PV}.tar.bz2 \
+           file://xcbincludedir.patch \
+           file://disable-check.patch"
+
+PACKAGES_DYNAMIC = "^libxcb-.*"
+
+FILES_${PN} = "${libdir}/libxcb.so.*"
+
+inherit autotools pkgconfig pythonnative distro_features_check
+
+# The libxau and others requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+python populate_packages_prepend () {
+    do_split_packages(d, '${libdir}', '^libxcb-(.*)\.so\..*$', 'libxcb-%s', 'XCB library module for %s', allow_links=True)
+}
diff --git a/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch b/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch
new file mode 100644
index 0000000..5641c0f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxcb/disable-check.patch
@@ -0,0 +1,25 @@
+The "check" package is checked for without an explicit enable/disable option,
+which can lead to non-deterministic build issues with both check and libxslt.
+
+As the unit test suite is minimal at present, simply disable the test suite.  In
+the future if the test suite is expanded this can be made conditional on the
+ptest DISTRO_FEATURE.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+
+diff --git a/configure.ac b/configure.ac
+index 6d7c9a5..22cceb9 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -21,7 +21,8 @@ AC_USE_SYSTEM_EXTENSIONS
+ 
+ AM_PATH_PYTHON([2.6])
+ 
+-PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=yes], [HAVE_CHECK=no])
++dnl PKG_CHECK_MODULES(CHECK, [check >= 0.9.4], [HAVE_CHECK=yes], [HAVE_CHECK=no])
++HAVE_CHECK=no
+ AM_CONDITIONAL(HAVE_CHECK, test x$HAVE_CHECK = xyes)
+ 
+ AC_CONFIG_HEADERS([src/config.h])
diff --git a/meta/recipes-graphics/xorg-lib/libxcb/xcbincludedir.patch b/meta/recipes-graphics/xorg-lib/libxcb/xcbincludedir.patch
new file mode 100644
index 0000000..46297c3
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxcb/xcbincludedir.patch
@@ -0,0 +1,28 @@
+As pkg-config --variable doesn't respect the sysroot, add the pkg-config sysroot
+to the beginning of variables that are used later on the host.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 94da4f7..d29cd6a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -64,7 +64,7 @@ AC_SUBST(NEEDED)
+ 
+ # Find the xcb-proto protocol descriptions
+ AC_MSG_CHECKING(XCBPROTO_XCBINCLUDEDIR)
+-XCBPROTO_XCBINCLUDEDIR=`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
++XCBPROTO_XCBINCLUDEDIR=$PKG_CONFIG_SYSROOT_DIR/`$PKG_CONFIG --variable=xcbincludedir xcb-proto`
+ AC_MSG_RESULT($XCBPROTO_XCBINCLUDEDIR)
+ AC_SUBST(XCBPROTO_XCBINCLUDEDIR)
+ 
+@@ -74,7 +74,7 @@ AC_SUBST(XCBPROTO_VERSION)
+ 
+ # Find the xcbgen Python package
+ AC_MSG_CHECKING(XCBPROTO_XCBPYTHONDIR)
+-XCBPROTO_XCBPYTHONDIR=`$PKG_CONFIG --variable=pythondir xcb-proto`
++XCBPROTO_XCBPYTHONDIR=$PKG_CONFIG_SYSROOT_DIR/`$PKG_CONFIG --variable=pythondir xcb-proto`
+ AC_MSG_RESULT($XCBPROTO_XCBPYTHONDIR)
+ AC_SUBST(XCBPROTO_XCBPYTHONDIR)
+ 
diff --git a/meta/recipes-graphics/xorg-lib/libxcb_1.11.bb b/meta/recipes-graphics/xorg-lib/libxcb_1.11.bb
new file mode 100644
index 0000000..c162702
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxcb_1.11.bb
@@ -0,0 +1,10 @@
+include libxcb.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7"
+
+
+DEPENDS += "libxdmcp"
+
+SRC_URI[md5sum] = "5a873ebd383d1a60612dd6ec6b42c781"
+SRC_URI[sha256sum] = "03635d70045b9ede90778e67516135828a57de87ac508f987024f43c03620ff7"
diff --git a/meta/recipes-graphics/xorg-lib/libxcb_git.bb b/meta/recipes-graphics/xorg-lib/libxcb_git.bb
new file mode 100644
index 0000000..186636e
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxcb_git.bb
@@ -0,0 +1,10 @@
+DEFAULT_PREFERENCE = "-1"
+
+include libxcb.inc
+
+SRCREV = "625ed596cae6dd8175aeb6cb6f26784928042f22"
+PV = "1.1.90.1+gitr${SRCPV}"
+PR = "r1"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xcb/libxcb"
+S = "${WORKDIR}/git"
diff --git a/meta/recipes-graphics/xorg-lib/libxcomposite/change-include-order.patch b/meta/recipes-graphics/xorg-lib/libxcomposite/change-include-order.patch
new file mode 100644
index 0000000..60331f6
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxcomposite/change-include-order.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Inappropriate [configuration]
+
+This patch makes the build use its own Xcomposite.h over rather than an
+older Xcomposite.h that might already be installed in the staging dir.
+
+Index: libXcomposite-0.4.3/src/Makefile.am
+===================================================================
+--- libXcomposite-0.4.3.orig/src/Makefile.am	2010-06-30 22:42:53.000000000 -0700
++++ libXcomposite-0.4.3/src/Makefile.am	2010-11-23 23:09:34.544322930 -0800
+@@ -19,7 +19,7 @@
+ #  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ #  PERFORMANCE OF THIS SOFTWARE.
+ 
+-AM_CFLAGS = $(CWARNFLAGS) $(XCOMPOSITE_CFLAGS) $(XFIXES_CFLAGS)
++AM_CFLAGS = -I$(top_srcdir)/include $(CWARNFLAGS) $(XCOMPOSITE_CFLAGS) $(XFIXES_CFLAGS)
+ AM_CPPFLAGS = -I$(top_srcdir)/include
+ 
+ lib_LTLIBRARIES = libXcomposite.la
diff --git a/meta/recipes-graphics/xorg-lib/libxcomposite_0.4.4.bb b/meta/recipes-graphics/xorg-lib/libxcomposite_0.4.4.bb
new file mode 100644
index 0000000..7025719
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxcomposite_0.4.4.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Xcomposite: X Composite extension library"
+
+DESCRIPTION = "The composite extension provides three related \
+mechanisms: per-hierarchy storage, automatic shadow update, and external \
+parent.  In per-hierarchy storage, the rendering of an entire hierarchy \
+of windows is redirected to off-screen storage.  In automatic shadow \
+update, when a hierarchy is rendered off-screen, the X server provides \
+an automatic mechanism for presenting those contents within the parent \
+window.  In external parent, a mechanism for providing redirection of \
+compositing transformations through a client."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3f2907aad541f6f226fbc58cc1b3cdf1"
+
+DEPENDS += " compositeproto virtual/libx11 libxfixes libxext"
+PROVIDES = "xcomposite"
+BBCLASSEXTEND = "native"
+
+PE = "1"
+
+XORG_PN = "libXcomposite"
+
+SRC_URI += " file://change-include-order.patch"
+
+SRC_URI[md5sum] = "f7a218dcbf6f0848599c6c36fc65c51a"
+SRC_URI[sha256sum] = "ede250cd207d8bee4a338265c3007d7a68d5aca791b6ac41af18e9a2aeb34178"
diff --git a/meta/recipes-graphics/xorg-lib/libxcursor_1.1.14.bb b/meta/recipes-graphics/xorg-lib/libxcursor_1.1.14.bb
new file mode 100644
index 0000000..a8e4f24
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxcursor_1.1.14.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Xcursor: X Cursor management library"
+
+DESCRIPTION = "Xcursor is a simple library designed to help locate and \
+load cursors. Cursors can be loaded from files or memory. A library of \
+common cursors exists which map to the standard X cursor names. Cursors \
+can exist in several sizes and the library automatically picks the best \
+size."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8902e6643f7bcd7793b23dcd5d8031a4"
+
+DEPENDS += "libxrender libxfixes"
+BBCLASSEXTEND = "native"
+
+PE = "1"
+
+XORG_PN = "libXcursor"
+
+SRC_URI[md5sum] = "1e7c17afbbce83e2215917047c57d1b3"
+SRC_URI[sha256sum] = "9bc6acb21ca14da51bda5bc912c8955bc6e5e433f0ab00c5e8bef842596c33df"
diff --git a/meta/recipes-graphics/xorg-lib/libxdamage_1.1.4.bb b/meta/recipes-graphics/xorg-lib/libxdamage_1.1.4.bb
new file mode 100644
index 0000000..c3d7004
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxdamage_1.1.4.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Xdamage: X Damage extension library"
+
+DESCRIPTION = "'Damage' is a term that describes changes make to pixel \
+contents of windows and pixmaps.  Damage accumulates as drawing occurs \
+in the drawable.  Each drawing operation 'damages' one or more \
+rectangular areas within the drawable.  The rectangles are guaranteed to \
+include the set of pixels modified by each operation, but may include \
+significantly more than just those pixels.  The DAMAGE extension allows \
+applications to either receive the raw rectangles as a stream of events, \
+or to have them partially processed within the X server to reduce the \
+amount of data transmitted as well as reduce the processing latency once \
+the repaint operation has started."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9fe101f30dd24134cf43146863241868"
+
+DEPENDS += "virtual/libx11 damageproto libxfixes"
+PROVIDES = "xdamage"
+BBCLASSEXTEND = "native"
+
+PE = "1"
+
+XORG_PN = "libXdamage"
+
+SRC_URI[md5sum] = "0cf292de2a9fa2e9a939aefde68fd34f"
+SRC_URI[sha256sum] = "7c3fe7c657e83547f4822bfde30a90d84524efb56365448768409b77f05355ad"
diff --git a/meta/recipes-graphics/xorg-lib/libxdmcp_1.1.2.bb b/meta/recipes-graphics/xorg-lib/libxdmcp_1.1.2.bb
new file mode 100644
index 0000000..f4e30d9
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxdmcp_1.1.2.bb
@@ -0,0 +1,29 @@
+SUMMARY = "XDMCP: X Display Manager Control Protocol library"
+
+DESCRIPTION = "The purpose of the X Display Manager Control Protocol \
+(XDMCP) is to provide a uniform mechanism for an autonomous display to \
+request login service from a remote host. An X terminal (screen, \
+keyboard, mouse, processor, network interface) is a prime example of an \
+autonomous display."
+
+require xorg-lib-common.inc
+
+inherit gettext
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d559fb26e129626022e052a5e6e0e123"
+
+DEPENDS += "xproto"
+PROVIDES = "xdmcp"
+
+PE = "1"
+
+XORG_PN = "libXdmcp"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "18aa5c1279b01f9d18e3299969665b2e"
+SRC_URI[sha256sum] = "81fe09867918fff258296e1e1e159f0dc639cb30d201c53519f25ab73af4e4e2"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[arc4] = "ac_cv_lib_bsd_arc4random_buf=yes,ac_cv_lib_bsd_arc4random_buf=no,libbsd"
diff --git a/meta/recipes-graphics/xorg-lib/libxext_1.3.3.bb b/meta/recipes-graphics/xorg-lib/libxext_1.3.3.bb
new file mode 100644
index 0000000..efa8b65
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxext_1.3.3.bb
@@ -0,0 +1,26 @@
+SUMMARY = "XExt: X Extension library"
+
+DESCRIPTION = "libXext provides an X Window System client interface to \
+several extensions to the X protocol.  The supported protocol extensions \
+are DOUBLE-BUFFER, DPMS, Extended-Visual-Information, LBX, MIT_SHM, \
+MIT_SUNDRY-NONSTANDARD, Multi-Buffering, SECURITY, SHAPE, SYNC, TOG-CUP, \
+XC-APPGROUP, XC-MISC, XTEST.  libXext also provides a small set of \
+utility functions to aid authors of client APIs for X protocol \
+extensions."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=879ce266785414bd1cbc3bc2f4d9d7c8"
+
+DEPENDS += "xproto virtual/libx11 xextproto libxau libxdmcp"
+PROVIDES = "xext"
+
+PE = "1"
+
+XORG_PN = "libXext"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "52df7c4c1f0badd9f82ab124fb32eb97"
+SRC_URI[sha256sum] = "b518d4d332231f313371fdefac59e3776f4f0823bcb23cf7c7305bfb57b16e35"
diff --git a/meta/recipes-graphics/xorg-lib/libxext_git.bb b/meta/recipes-graphics/xorg-lib/libxext_git.bb
new file mode 100644
index 0000000..b799186
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxext_git.bb
@@ -0,0 +1,24 @@
+require xorg-lib-common.inc
+
+SUMMARY = "XExt: X Extension library"
+
+DESCRIPTION = "libXext provides an X Window System client interface to \
+several extensions to the X protocol.  The supported protocol extensions \
+are DOUBLE-BUFFER, DPMS, Extended-Visual-Information, LBX, MIT_SHM, \
+MIT_SUNDRY-NONSTANDARD, Multi-Buffering, SECURITY, SHAPE, SYNC, TOG-CUP, \
+XC-APPGROUP, XC-MISC, XTEST.  libXext also provides a small set of \
+utility functions to aid authors of client APIs for X protocol \
+extensions."
+
+DEPENDS += "xproto virtual/libx11 xextproto libxau libxdmcp"
+PROVIDES = "xext"
+SRCREV = "d1f3bc77a48c8e42771579e3fdf3370b35d3209d"
+PE = "1"
+PV = "1.0.99.1+gitr${SRCPV}"
+
+XORG_PN = "libXext"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/lib/${XORG_PN}"
+S = "${WORKDIR}/git/"
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-graphics/xorg-lib/libxfixes_5.0.1.bb b/meta/recipes-graphics/xorg-lib/libxfixes_5.0.1.bb
new file mode 100644
index 0000000..6e2740c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxfixes_5.0.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "XFixes: X Fixes extension library"
+
+DESCRIPTION = "X applications have often needed to work around various \
+shortcomings in the core X window system.  This extension is designed to \
+provide the minimal server-side support necessary to eliminate problems \
+caused by these workarounds."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3c1ce42c334a6f5cccb0277556a053e0"
+
+DEPENDS += "virtual/libx11 xproto fixesproto xextproto"
+
+PE = "1"
+
+XORG_PN = "libXfixes"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "b985b85f8b9386c85ddcfe1073906b4d"
+SRC_URI[sha256sum] = "63bec085084fa3caaee5180490dd871f1eb2020ba9e9b39a30f93693ffc34767"
diff --git a/meta/recipes-graphics/xorg-lib/libxfont_1.5.1.bb b/meta/recipes-graphics/xorg-lib/libxfont_1.5.1.bb
new file mode 100644
index 0000000..1b6e33c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxfont_1.5.1.bb
@@ -0,0 +1,22 @@
+SUMMARY = "XFont: X Font rasterisation library"
+
+DESCRIPTION = "libXfont provides various services for X servers, most \
+notably font selection and rasterisation (through external libraries \
+such as freetype)."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a46c8040f2f737bcd0c435feb2ab1c2c"
+
+DEPENDS += "freetype xtrans fontsproto libfontenc zlib"
+PROVIDES = "xfont"
+
+PE = "1"
+
+XORG_PN = "libXfont"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "96f76ba94b4c909230bac1e2dcd551c4"
+SRC_URI[sha256sum] = "b70898527c73f9758f551bbab612af611b8a0962202829568d94f3edf4d86098"
diff --git a/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb b/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb
new file mode 100644
index 0000000..a967cdc
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxft_2.3.2.bb
@@ -0,0 +1,33 @@
+SUMMARY = "XFt: X FreeType libary"
+
+DESCRIPTION = "Xft was designed to provide good support for scalable \
+fonts, and to do so efficiently.  Unlike the core fonts system, it \
+supports features such as anti-aliasing and sub-pixel rasterisation. \
+Perhaps more importantly, it gives applications full control over the \
+way glyphs are rendered, making fine typesetting and WYSIWIG display \
+possible. Finally, it allows applications to use fonts that are not \
+installed system-wide for displaying documents with embedded fonts.  Xft \
+is not compatible with the core fonts system: usage of Xft requires \
+fairly extensive changes to toolkits (user-interface libraries)."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=90b90b60eb30f65fc9c2673d7cf59e24"
+
+DEPENDS += "virtual/libx11 libxrender freetype fontconfig"
+PROVIDES = "xft"
+
+PE = "1"
+
+SRC_URI[md5sum] = "331b3a2a3a1a78b5b44cfbd43f86fcfe"
+SRC_URI[sha256sum] = "f5a3c824761df351ca91827ac221090943ef28b248573486050de89f4bfcdc4c"
+
+XORG_PN = "libXft"
+
+BBCLASSEXTEND = "native"
+
+python () {
+        if d.getVar('DEBIAN_NAMES', True):
+            d.setVar('PKG_${PN}', '${MLPREFIX}libxft2')
+}
diff --git a/meta/recipes-graphics/xorg-lib/libxi_1.7.4.bb b/meta/recipes-graphics/xorg-lib/libxi_1.7.4.bb
new file mode 100644
index 0000000..07033a3
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxi_1.7.4.bb
@@ -0,0 +1,21 @@
+require xorg-lib-common.inc
+
+SUMMARY = "XI: X Input extension library"
+
+DESCRIPTION = "libxi is an extension to the X11 protocol to support \
+input devices other than the core X keyboard and pointer.  It allows \
+client programs to select input from these devices independently from \
+each other and independently from the core devices."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=17b064789fab936a1c58c4e13d965b0f \
+                    file://src/XIGetDevFocus.c;endline=23;md5=cdfb0d435a33ec57ea0d1e8e395b729f"
+
+DEPENDS += "libxext inputproto libxfixes"
+
+PE = "1"
+
+XORG_PN = "libXi"
+
+SRC_URI[md5sum] = "9c4a69c34b19ec1e4212e849549544cb"
+SRC_URI[sha256sum] = "2cffc2686618dc1803725636cd92b36342c512dc60a7a35cba34bf7192a42244"
diff --git a/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb b/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb
new file mode 100644
index 0000000..027c804
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb
@@ -0,0 +1,20 @@
+require xorg-lib-common.inc
+
+SUMMARY = "Xinerama: Xinerama extension library"
+
+DESCRIPTION = "Xinerama is a simple library designed to interface the \
+Xinerama Extension for retrieving information about physical output \
+devices which may be combined into a single logical X screen."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6f4f634d1643a2e638bba3fcd19c2536 \
+                    file://src/Xinerama.c;beginline=2;endline=25;md5=fcef273bfb66339256411dd06ea79c02"
+
+DEPENDS += "libxext xineramaproto"
+PROVIDES = "xinerama"
+PE = "1"
+
+XORG_PN = "libXinerama"
+
+SRC_URI[md5sum] = "9336dc46ae3bf5f81c247f7131461efd"
+SRC_URI[sha256sum] = "7a45699f1773095a3f821e491cbd5e10c887c5a5fce5d8d3fced15c2ff7698e2"
diff --git a/meta/recipes-graphics/xorg-lib/libxkbcommon_0.5.0.bb b/meta/recipes-graphics/xorg-lib/libxkbcommon_0.5.0.bb
new file mode 100644
index 0000000..a166b57
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxkbcommon_0.5.0.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Generic XKB keymap library"
+DESCRIPTION = "libxkbcommon is a keymap compiler and support library which \
+processes a reduced subset of keymaps as defined by the XKB specification."
+HOMEPAGE = "http://www.xkbcommon.org"
+LIC_FILES_CHKSUM = "file://COPYING;md5=09457b156e3155972abebcaaaa0cb434"
+LICENSE = "MIT & MIT-style"
+
+DEPENDS = "util-macros flex-native bison-native"
+
+SRC_URI = "http://xkbcommon.org/download/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "2e1faeafcc609c30af3a561a91e84158"
+SRC_URI[sha256sum] = "90bd7824742b9a6f52a6cf80e2cadd6f5349cf600a358d08260772615b89d19c"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-docs"
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,libxcb xkeyboard-config,"
diff --git a/meta/recipes-graphics/xorg-lib/libxkbfile_1.0.9.bb b/meta/recipes-graphics/xorg-lib/libxkbfile_1.0.9.bb
new file mode 100644
index 0000000..39a344c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxkbfile_1.0.9.bb
@@ -0,0 +1,18 @@
+SUMMARY = "XKB: X Keyboard File manipulation library"
+
+DESCRIPTION = "libxkbfile provides an interface to read and manipulate \
+description files for XKB, the X11 keyboard configuration extension."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8be7367f7e5d605a426f76bb37d4d61f"
+
+DEPENDS += "virtual/libx11 kbproto"
+
+PE = "1"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "4a4cfeaf24dab1b991903455d6d7d404"
+SRC_URI[sha256sum] = "51817e0530961975d9513b773960b4edd275f7d5c72293d5a151ed4f42aeb16a"
diff --git a/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb b/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb
new file mode 100644
index 0000000..003baec
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxmu_1.1.2.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Xmu and Xmuu: X Miscellaneous Utility libraries"
+
+DESCRIPTION = "The Xmu Library is a collection of miscellaneous (some \
+might say random) utility functions that have been useful in building \
+various applications and widgets. This library is required by the Athena \
+Widgets. A subset of the functions that do not rely on the Athena \
+Widgets (libXaw) or X Toolkit Instrinsics (libXt) are provided in a \
+second library, libXmuu."
+
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=def3d8e4e9c42004f1941fa22f01dc18"
+
+DEPENDS += "libxt libxext"
+PROVIDES = "xmu"
+
+PE = "1"
+
+XORG_PN = "libXmu"
+
+LEAD_SONAME = "libXmu"
+
+PACKAGES =+ "libxmuu"
+
+FILES_libxmuu = "${libdir}/libXmuu.so.*"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "41d92ab627dfa06568076043f3e089e4"
+SRC_URI[sha256sum] = "756edc7c383254eef8b4e1b733c3bf1dc061b523c9f9833ac7058378b8349d0b"
diff --git a/meta/recipes-graphics/xorg-lib/libxpm_3.5.11.bb b/meta/recipes-graphics/xorg-lib/libxpm_3.5.11.bb
new file mode 100644
index 0000000..545874c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxpm_3.5.11.bb
@@ -0,0 +1,27 @@
+require xorg-lib-common.inc
+
+# libxpm requires xgettext to build
+inherit gettext
+
+SUMMARY = "Xpm: X Pixmap extension library"
+
+DESCRIPTION = "libXpm provides support and common operation for the XPM \
+pixmap format, which is commonly used in legacy X applications.  XPM is \
+an extension of the monochrome XBM bitmap specificied in the X \
+protocol."
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=51f4270b012ecd4ab1a164f5f4ed6cf7"
+DEPENDS += "libxext libsm libxt"
+PE = "1"
+
+XORG_PN = "libXpm"
+
+PACKAGES =+ "sxpm cxpm"
+FILES_cxpm = "${bindir}/cxpm"
+FILES_sxpm = "${bindir}/sxpm"
+
+SRC_URI[md5sum] = "769ee12a43611cdebd38094eaf83f3f0"
+SRC_URI[sha256sum] = "c5bdafa51d1ae30086fac01ab83be8d47fe117b238d3437f8e965434090e041c"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-graphics/xorg-lib/libxrandr_1.5.0.bb b/meta/recipes-graphics/xorg-lib/libxrandr_1.5.0.bb
new file mode 100644
index 0000000..abbbae5
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxrandr_1.5.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "XRandR: X Resize, Rotate and Reflect extension library"
+
+DESCRIPTION = "The X Resize, Rotate and Reflect Extension, called RandR \
+for short, brings the ability to resize, rotate and reflect the root \
+window of a screen. It is based on the X Resize and Rotate Extension as \
+specified in the Proceedings of the 2001 Usenix Technical Conference \
+[RANDR]."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c9d1a2118a6cd5727521db8e7a2fee69"
+
+DEPENDS += "virtual/libx11 randrproto libxrender libxext"
+
+PE = "1"
+
+XORG_PN = "libXrandr"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "309762867e41c6fd813da880d8a1bc93"
+SRC_URI[sha256sum] = "6f864959b7fc35db11754b270d71106ef5b5cf363426aa58589cb8ac8266de58"
diff --git a/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb b/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb
new file mode 100644
index 0000000..9fde040
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb
@@ -0,0 +1,23 @@
+SUMMARY = "XRender: X Rendering Extension library"
+
+DESCRIPTION = "The X Rendering Extension (Render) introduces digital \
+image composition as the foundation of a new rendering model within the \
+X Window System. Rendering geometric figures is accomplished by \
+client-side tessellation into either triangles or trapezoids.  Text is \
+drawn by loading glyphs into the server and rendering sets of them."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8bc71986d3b9b3639f6dfd6fac8f196"
+
+DEPENDS += "virtual/libx11 renderproto xproto xdmcp"
+
+PE = "1"
+
+XORG_PN = "libXrender"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "5db92962b124ca3a8147daae4adbd622"
+SRC_URI[sha256sum] = "fc2fe57980a14092426dffcd1f2d9de0987b9d40adea663bd70d6342c0e9be1a"
diff --git a/meta/recipes-graphics/xorg-lib/libxres_1.0.7.bb b/meta/recipes-graphics/xorg-lib/libxres_1.0.7.bb
new file mode 100644
index 0000000..8c04c44
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxres_1.0.7.bb
@@ -0,0 +1,20 @@
+SUMMARY = "XRes: X Resource extension library"
+
+DESCRIPTION = "libXRes provides an X Window System client interface to \
+the Resource extension to the X protocol.  The Resource extension allows \
+for X clients to see and monitor the X resource usage of various clients \
+(pixmaps, et al)."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=8c89441a8df261bdc56587465e13c7fa"
+
+DEPENDS += "libxext resourceproto"
+
+PE = "1"
+
+XORG_PN = "libXres"
+
+SRC_URI[md5sum] = "45ef29206a6b58254c81bea28ec6c95f"
+SRC_URI[sha256sum] = "26899054aa87f81b17becc68e8645b240f140464cf90c42616ebb263ec5fa0e5"
diff --git a/meta/recipes-graphics/xorg-lib/libxscrnsaver_1.2.2.bb b/meta/recipes-graphics/xorg-lib/libxscrnsaver_1.2.2.bb
new file mode 100644
index 0000000..354e5de
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxscrnsaver_1.2.2.bb
@@ -0,0 +1,23 @@
+require xorg-lib-common.inc
+
+SUMMARY = "Xscrnsaver: X Screen Saver extension library"
+
+DESCRIPTION = "The X Window System provides support for changing the \
+image on a display screen after a user-settable period of inactivity to \
+avoid burning the cathode ray tube phosphors. However, no interfaces are \
+provided for the user to control the image that is drawn. This extension \
+allows an external \"screen saver\" client to detect when the alternate \
+image is to be displayed and to provide the graphics."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=21fd154ee757813632ada871a34113fb"
+
+DEPENDS += "libxext scrnsaverproto"
+PROVIDES = "libxss"
+RREPLACES_${PN} = "libxss"
+PE = "1"
+
+XORG_PN = "libXScrnSaver"
+
+SRC_URI[md5sum] = "7a773b16165e39e938650bcc9027c1d5"
+SRC_URI[sha256sum] = "8ff1efa7341c7f34bcf9b17c89648d6325ddaae22e3904e091794e0b4426ce1d"
diff --git a/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb b/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb
new file mode 100644
index 0000000..ae34b1f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxshmfence_1.2.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Shared memory 'SyncFence' synchronization primitive"
+
+DESCRIPTION = "This library offers a CPU-based synchronization primitive compatible \
+with the X SyncFence objects that can be shared between processes \
+using file descriptor passing."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=47e508ca280fde97906eacb77892c3ac"
+
+DEPENDS += "virtual/libx11"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "66662e76899112c0f99e22f2fc775a7e"
+SRC_URI[sha256sum] = "d21b2d1fd78c1efbe1f2c16dae1cb23f8fd231dcf891465b8debe636a9054b0c"
diff --git a/meta/recipes-graphics/xorg-lib/libxt/libxt_fix_for_x32.patch b/meta/recipes-graphics/xorg-lib/libxt/libxt_fix_for_x32.patch
new file mode 100644
index 0000000..ce6c756
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxt/libxt_fix_for_x32.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Pending
+
+This fixes compilation with x32 toolchain.
+
+Received this patch from H.J. Lu <hjl.tools@gmail.com>
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/1
+
+
+--- libXt-1.1.1/include/X11/Xtos.h.x32	2011-02-08 07:56:40.000000000 -0800
++++ libXt-1.1.1/include/X11/Xtos.h	2011-11-30 17:19:27.473349770 -0800
+@@ -62,7 +62,7 @@ SOFTWARE.
+     defined(__sparc64__) || \
+     defined(__s390x__) || \
+     (defined(__hppa__) && defined(__LP64__)) || \
+-    defined(__amd64__) || defined(amd64) || \
++    ((defined(__amd64__) || defined(amd64)) && defined(__LP64__)) || \
+     defined(__powerpc64__) || \
+     (defined(sgi) && (_MIPS_SZLONG == 64))
+ #define LONG64
diff --git a/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb b/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb
new file mode 100644
index 0000000..c1ed0bb
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxt_1.1.5.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Xt: X Toolkit Intrinsics library"
+
+DESCRIPTION = "The Intrinsics are a programming library tailored to the \
+special requirements of user interface construction within a network \
+window system, specifically the X Window System. The Intrinsics and a \
+widget set make up an X Toolkit. The Intrinsics provide the base \
+mechanism necessary to build a wide variety of interoperating widget \
+sets and application environments. The Intrinsics are a layer on top of \
+Xlib, the C Library X Interface. They extend the fundamental \
+abstractions provided by the X Window System while still remaining \
+independent of any particular user interface policy or style."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6565b1e0094ea1caae0971cc4035f343"
+
+
+DEPENDS += "util-linux libxcb libsm virtual/libx11 kbproto libxdmcp"
+PROVIDES = "xt"
+
+PE = "1"
+
+XORG_PN = "libXt"
+
+SRC_URI +=  "file://libxt_fix_for_x32.patch"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF += "--disable-xkb"
+
+SRC_URI[md5sum] = "8f5b5576fbabba29a05f3ca2226f74d3"
+SRC_URI[sha256sum] = "46eeb6be780211fdd98c5109286618f6707712235fdd19df4ce1e6954f349f1a"
diff --git a/meta/recipes-graphics/xorg-lib/libxtst_1.2.2.bb b/meta/recipes-graphics/xorg-lib/libxtst_1.2.2.bb
new file mode 100644
index 0000000..1b0bcf3
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxtst_1.2.2.bb
@@ -0,0 +1,20 @@
+require xorg-lib-common.inc
+
+SUMMARY = "XTest: X Test extension library"
+
+DESCRIPTION = "This extension is a minimal set of client and server \
+extensions required to completely test the X11 server with no user \
+intervention."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bb4f89972c3869f617f61c1a79ad1952 \
+                    file://src/XTest.c;beginline=2;endline=32;md5=b1c8c9dff842b4d5b89ca5fa32c40e99"
+
+DEPENDS += "libxext recordproto inputproto libxi"
+PROVIDES = "xtst"
+PE = "1"
+
+XORG_PN = "libXtst"
+
+SRC_URI[md5sum] = "25c6b366ac3dc7a12c5d79816ce96a59"
+SRC_URI[sha256sum] = "ef0a7ffd577e5f1a25b1663b375679529663a1880151beaa73e9186c8309f6d9"
diff --git a/meta/recipes-graphics/xorg-lib/libxv_1.0.10.bb b/meta/recipes-graphics/xorg-lib/libxv_1.0.10.bb
new file mode 100644
index 0000000..f02b8b6
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxv_1.0.10.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Xv: X Video extension library"
+
+DESCRIPTION = "libXv provides an X Window System client interface to the \
+X Video extension to the X protocol. The X Video extension allows for \
+accelerated drawing of videos.  Hardware adaptors are exposed to \
+clients, which may draw in a number of colourspaces, including YUV."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=827da9afab1f727f2a66574629e0f39c"
+
+DEPENDS += "libxext videoproto"
+
+XORG_PN = "libXv"
+
+SRC_URI[md5sum] = "e0af49d7d758b990e6fef629722d4aca"
+SRC_URI[sha256sum] = "55fe92f8686ce8612e2c1bfaf58c057715534419da700bda8d517b1d97914525"
diff --git a/meta/recipes-graphics/xorg-lib/libxvmc_1.0.9.bb b/meta/recipes-graphics/xorg-lib/libxvmc_1.0.9.bb
new file mode 100644
index 0000000..41e8498
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxvmc_1.0.9.bb
@@ -0,0 +1,19 @@
+SUMMARY = "XvMC: X Video Motion Compensation extension library"
+
+DESCRIPTION = "XvMC extends the X Video extension (Xv) and enables \
+hardware rendered motion compensation support."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0a207f08d4961489c55046c9a5e500da \
+                    file://wrapper/XvMCWrapper.c;endline=26;md5=5151daa8172a3f1bb0cb0e0ff157d9de"
+
+DEPENDS += "libxext libxv videoproto"
+
+PE = "1"
+
+XORG_PN = "libXvMC"
+
+SRC_URI[md5sum] = "eba6b738ed5fdcd8f4203d7c8a470c79"
+SRC_URI[sha256sum] = "0703d7dff6ffc184f1735ca5d4eb9dbb402b522e08e008f2f96aee16c40a5756"
diff --git a/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.4.bb b/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.4.bb
new file mode 100644
index 0000000..695a396
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxxf86dga_1.1.4.bb
@@ -0,0 +1,19 @@
+require xorg-lib-common.inc
+
+SUMMARY = "XFree86-DGA: XFree86 Direct Graphics Access extension library"
+
+DESCRIPTION = "libXxf86dga provides the XFree86-DGA extension, which \
+allows direct graphics access to a framebuffer-like region, and also \
+allows relative mouse reporting, et al.  It is mainly used by games and \
+emulators for games."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=abb99ac125f84f424a4278153988e32f"
+
+DEPENDS += "libxext xf86dgaproto"
+
+PE = "1"
+
+SRC_URI[md5sum] = "d7dd9b9df336b7dd4028b6b56542ff2c"
+SRC_URI[sha256sum] = "8eecd4b6c1df9a3704c04733c2f4fa93ef469b55028af5510b25818e2456c77e"
+
+XORG_PN = "libXxf86dga"
diff --git a/meta/recipes-graphics/xorg-lib/libxxf86misc_1.0.3.bb b/meta/recipes-graphics/xorg-lib/libxxf86misc_1.0.3.bb
new file mode 100644
index 0000000..af6f1f7
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxxf86misc_1.0.3.bb
@@ -0,0 +1,20 @@
+SUMMARY = "XFree86-Misc: XFree86 miscellaneous extension library"
+
+DESCRIPTION = "The XFree86-Misc extension, provides a means to access \
+input device configuration settings specific to the XFree86/Xorg DDX."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=27c91ecc435bd3d2bfad868914c94b45"
+
+DEPENDS += "libxext xf86miscproto"
+PROVIDES = "xxf86misc"
+
+PE = "1"
+
+XORG_PN = "libXxf86misc"
+
+SRC_URI[md5sum] = "6bc0bf78909fd71021c466c793d4385c"
+SRC_URI[sha256sum] = "563f4200862efd3334c33a669e0a0aae5bab31f3998db75b87a99a697cc26b5b"
+
diff --git a/meta/recipes-graphics/xorg-lib/libxxf86vm_1.1.4.bb b/meta/recipes-graphics/xorg-lib/libxxf86vm_1.1.4.bb
new file mode 100644
index 0000000..35f87d2
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxxf86vm_1.1.4.bb
@@ -0,0 +1,20 @@
+SUMMARY = "XFree86-VM: XFree86 video mode extension library"
+
+DESCRIPTION = "libXxf86vm provides an interface to the \
+XFree86-VidModeExtension extension, which allows client applications to \
+get and set video mode timings in extensive detail.  It is used by the \
+xvidtune program in particular."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fa0b9c462d8f2f13eba26492d42ea63d"
+
+DEPENDS += "libxext xf86vidmodeproto"
+
+PE = "1"
+
+XORG_PN = "libXxf86vm"
+
+SRC_URI[md5sum] = "298b8fff82df17304dfdb5fe4066fe3a"
+SRC_URI[sha256sum] = "afee27f93c5f31c0ad582852c0fb36d50e4de7cd585fcf655e278a633d85cd57"
diff --git a/meta/recipes-graphics/xorg-lib/pixman/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch b/meta/recipes-graphics/xorg-lib/pixman/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
new file mode 100644
index 0000000..4569dca
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/pixman/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
@@ -0,0 +1,144 @@
+From a0f53e1dbb3851bb0f0efcfdbd565b05e4be9cac Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
+Date: Thu, 23 Aug 2012 18:10:57 +0200
+Subject: [PATCH 1/2] ARM: qemu related workarounds in cpu features detection
+ code
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This was ported from meta-oe's patch [1]. The original pixman patch is found
+at [2].
+
+[1] http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-graphics/xorg-lib/pixman-0.26.2/0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch
+[2] http://lists.freedesktop.org/archives/pixman/2011-January/000906.html
+
+Upstream-Status: Inappropriate [other] qemu fix
+
+Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
+---
+ pixman/pixman-arm.c |   82 ++++++++++++++++++++++++++++++++++++++++----------
+ 1 files changed, 65 insertions(+), 17 deletions(-)
+
+diff --git a/pixman/pixman-arm.c b/pixman/pixman-arm.c
+index 23374e4..d98bda6 100644
+--- a/pixman/pixman-arm.c
++++ b/pixman/pixman-arm.c
+@@ -129,16 +129,35 @@ detect_cpu_features (void)
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <sys/mman.h>
++#include <sys/utsname.h>
+ #include <fcntl.h>
+ #include <string.h>
+ #include <elf.h>
+ 
++/*
++ * The whole CPU capabilities detection is a bit ugly: when running in
++ * userspace qemu, we see /proc/self/auxv from the host system. To make
++ * everything even worse, the size of each value is 64-bit when running
++ * on a 64-bit host system. So the data is totally bogus because we expect
++ * 32-bit values. As AT_PLATFORM value is used as a pointer, it may cause
++ * segfault (null pointer dereference on x86-64 host). So in order to be
++ * on a safe side, we require that AT_PLATFORM value is found only once,
++ * and it has non-zero value (this is still not totally reliable for a big
++ * endian 64-bit host system running qemu and may theoretically fail).
++ */
++#define ARM_HWCAP_VFP 64
++#define ARM_HWCAP_IWMMXT 512
++#define ARM_HWCAP_NEON 4096
++
+ static arm_cpu_features_t
+ detect_cpu_features (void)
+ {
+     arm_cpu_features_t features = 0;
+     Elf32_auxv_t aux;
+     int fd;
++    uint32_t hwcap = 0;
++    const char *plat = NULL;
++    int plat_cnt = 0;
+ 
+     fd = open ("/proc/self/auxv", O_RDONLY);
+     if (fd >= 0)
+@@ -147,32 +166,61 @@ detect_cpu_features (void)
+ 	{
+ 	    if (aux.a_type == AT_HWCAP)
+ 	    {
+-		uint32_t hwcap = aux.a_un.a_val;
+-
+-		/* hardcode these values to avoid depending on specific
+-		 * versions of the hwcap header, e.g. HWCAP_NEON
+-		 */
+-		if ((hwcap & 64) != 0)
+-		    features |= ARM_VFP;
+-		if ((hwcap & 512) != 0)
+-		    features |= ARM_IWMMXT;
+-		/* this flag is only present on kernel 2.6.29 */
+-		if ((hwcap & 4096) != 0)
+-		    features |= ARM_NEON;
++		hwcap = aux.a_un.a_val;
+ 	    }
+ 	    else if (aux.a_type == AT_PLATFORM)
+ 	    {
+-		const char *plat = (const char*) aux.a_un.a_val;
+-
+-		if (strncmp (plat, "v7l", 3) == 0)
++		plat = (const char*) aux.a_un.a_val;
++		plat_cnt++;
++	    }
++	}
++	close (fd);
++	if (plat == NULL || plat_cnt != 1 || *plat != 'v')
++	{
++	    /*
++	     * Something seems to be really wrong, most likely we are
++	     * running under qemu. Let's use machine type from "uname" for
++	     * CPU capabilities detection:
++	     * http://www.mail-archive.com/qemu-devel at nongnu.org/msg22212.html
++	     */
++	    struct utsname u;
++	    hwcap = 0; /* clear hwcap, because it is bogus */
++	    if (uname (&u) == 0)
++	    {
++		if (strcmp (u.machine, "armv7l") == 0)
++		{
+ 		    features |= (ARM_V7 | ARM_V6);
+-		else if (strncmp (plat, "v6l", 3) == 0)
++		    hwcap |= ARM_HWCAP_VFP;  /* qemu is supposed to emulate vfp */
++		    hwcap |= ARM_HWCAP_NEON; /* qemu is supposed to emulate neon */
++		}
++		else if (strcmp (u.machine, "armv6l") == 0)
++		{
+ 		    features |= ARM_V6;
++		    hwcap |= ARM_HWCAP_VFP;  /* qemu is supposed to emulate vfp */
++		}
+ 	    }
+ 	}
+-	close (fd);
++	else if (strncmp (plat, "v7l", 3) == 0)
++	{
++	    features |= (ARM_V7 | ARM_V6);
++	}
++	else if (strncmp (plat, "v6l", 3) == 0)
++	{
++	    features |= ARM_V6;
++	}
+     }
+ 
++    /* hardcode these values to avoid depending on specific
++     * versions of the hwcap header, e.g. HWCAP_NEON
++     */
++    if ((hwcap & ARM_HWCAP_VFP) != 0)
++        features |= ARM_VFP;
++    if ((hwcap & ARM_HWCAP_IWMMXT) != 0)
++        features |= ARM_IWMMXT;
++    /* this flag is only present on kernel 2.6.29 */
++    if ((hwcap & ARM_HWCAP_NEON) != 0)
++        features |= ARM_NEON;
++
+     return features;
+ }
+ 
+-- 
+1.7.6.5
+
diff --git a/meta/recipes-graphics/xorg-lib/pixman/asm_include.patch b/meta/recipes-graphics/xorg-lib/pixman/asm_include.patch
new file mode 100644
index 0000000..b52a570
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/pixman/asm_include.patch
@@ -0,0 +1,29 @@
+Fixes errors like
+
+Assembler messages:
+Fatal error: can't create .libs/pixman-mips-dspr2-asm.o: No such file or directory
+
+it works with glibc because it uses gcc fixed-headers but thats not right.
+
+We move the include under C block
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+Index: pixman-0.32.6/pixman/pixman-private.h
+===================================================================
+--- pixman-0.32.6.orig/pixman/pixman-private.h
++++ pixman-0.32.6/pixman/pixman-private.h
+@@ -1,4 +1,3 @@
+-#include <float.h>
+ 
+ #ifndef PIXMAN_PRIVATE_H
+ #define PIXMAN_PRIVATE_H
+@@ -17,6 +16,8 @@
+ 
+ #ifndef __ASSEMBLER__
+ 
++#include <float.h>
++
+ #ifndef PACKAGE
+ #  error config.h must be included before pixman-private.h
+ #endif
diff --git a/meta/recipes-graphics/xorg-lib/pixman/mips-export-revert.patch b/meta/recipes-graphics/xorg-lib/pixman/mips-export-revert.patch
new file mode 100644
index 0000000..14a5fd2
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/pixman/mips-export-revert.patch
@@ -0,0 +1,22 @@
+Revert a commit in pixman 0.32.6 which breaks compliation on MIPS machines with
+errors such as:
+
+pixman-0.32.6/pixman/pixman-mips-dspr2-asm.S:4267:
+Error: invalid operands `mflo $14,$ac3'
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+--- b/pixman/pixman-mips-dspr2-asm.h
++++ a/pixman/pixman-mips-dspr2-asm.h
+@@ -72,10 +72,7 @@
+ #define LEAF_MIPS32R2(symbol)                           \
+                 .globl  symbol;                         \
+                 .align  2;                              \
+-#ifdef __ELF__
+-                .hidden symbol;                         \
+                 .type   symbol, @function;              \
+-#endif
+                 .ent    symbol, 0;                      \
+ symbol:         .frame  sp, 0, ra;                      \
+                 .set    push;                           \
diff --git a/meta/recipes-graphics/xorg-lib/pixman_0.32.6.bb b/meta/recipes-graphics/xorg-lib/pixman_0.32.6.bb
new file mode 100644
index 0000000..eae59b6
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/pixman_0.32.6.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Pixman: Pixel Manipulation library"
+
+DESCRIPTION = "Pixman provides a library for manipulating pixel regions \
+-- a set of Y-X banded rectangles, image compositing using the \
+Porter/Duff model and implicit mask generation for geometric primitives \
+including trapezoids, triangles, and rectangles."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style & PD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=14096c769ae0cbb5fcb94ec468be11b3 \
+                    file://pixman/pixman-matrix.c;endline=25;md5=ba6e8769bfaaee2c41698755af04c4be \
+                    file://pixman/pixman-arm-neon-asm.h;endline=24;md5=9a9cc1e51abbf1da58f4d9528ec9d49b \
+                   "
+DEPENDS += "zlib libpng"
+BBCLASSEXTEND = "native nativesdk"
+
+PE = "1"
+
+IWMMXT = "--disable-arm-iwmmxt"
+LOONGSON_MMI = "--disable-loongson-mmi"
+NEON = " --disable-arm-neon "
+NEON_class-nativesdk = " --disable-arm-neon "
+NEON_armv7a = " "
+NEON_armv7a-vfp-neon = " "
+
+EXTRA_OECONF = "--disable-gtk ${IWMMXT} ${LOONGSON_MMI} ${NEON}"
+EXTRA_OECONF_class-native = "--disable-gtk"
+
+SRC_URI += "\
+            file://0001-ARM-qemu-related-workarounds-in-cpu-features-detecti.patch \
+            file://mips-export-revert.patch \
+	    file://asm_include.patch \
+"
+
+SRC_URI[md5sum] = "8a9e8f14743a39cf303803f369c1f344"
+SRC_URI[sha256sum] = "201fc0d7d6bc0017496f2bd27b3ca14224aea0df6b624c5ee2dc0307a4ff14a4"
+
+REQUIRED_DISTRO_FEATURES = ""
diff --git a/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb b/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb
new file mode 100644
index 0000000..91464b6
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/xcb-util-image_0.4.0.bb
@@ -0,0 +1,10 @@
+require xcb-util.inc
+
+DEPENDS += "xcb-util"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://image/xcb_image.c;endline=24;md5=eafdf965cfb89955fdedf75054223fb4 \
+                    file://image/xcb_image.h;beginline=4;endline=27;md5=48cd25ae55e7de525fe1e1a3a7672e1c"
+
+SRC_URI[md5sum] = "08fe8ffecc8d4e37c0ade7906b3f4c87"
+SRC_URI[sha256sum] = "2db96a37d78831d643538dd1b595d7d712e04bdccf8896a5e18ce0f398ea2ffc"
\ No newline at end of file
diff --git a/meta/recipes-graphics/xorg-lib/xcb-util-keysyms_0.4.0.bb b/meta/recipes-graphics/xorg-lib/xcb-util-keysyms_0.4.0.bb
new file mode 100644
index 0000000..bca64ed
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/xcb-util-keysyms_0.4.0.bb
@@ -0,0 +1,9 @@
+require xcb-util.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://keysyms/keysyms.c;endline=30;md5=2f8de023ed823bb92f0b47900574ea9e \
+					"
+SRC_URI[md5sum] = "1022293083eec9e62d5659261c29e367"
+SRC_URI[sha256sum] = "0ef8490ff1dede52b7de533158547f8b454b241aa3e4dcca369507f66f216dd9"
+
+
diff --git a/meta/recipes-graphics/xorg-lib/xcb-util-renderutil_0.3.9.bb b/meta/recipes-graphics/xorg-lib/xcb-util-renderutil_0.3.9.bb
new file mode 100644
index 0000000..25c22e5
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/xcb-util-renderutil_0.3.9.bb
@@ -0,0 +1,10 @@
+require xcb-util.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://renderutil/glyph.c;endline=24;md5=c517c483b8d726234ec94f9169236661 \
+					file://renderutil/util.c;endline=20;md5=6e0bfc44fb13298c0f4694eb70dc80d4 \
+					file://renderutil/xcb_renderutil.h;endline=24;md5=d0ddab3052dd4949c93cfcb0891c96df \
+					"
+
+SRC_URI[md5sum] = "468b119c94da910e1291f3ffab91019a"
+SRC_URI[sha256sum] = "c6e97e48fb1286d6394dddb1c1732f00227c70bd1bedb7d1acabefdd340bea5b"
diff --git a/meta/recipes-graphics/xorg-lib/xcb-util-wm_0.4.1.bb b/meta/recipes-graphics/xorg-lib/xcb-util-wm_0.4.1.bb
new file mode 100644
index 0000000..39f1383
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/xcb-util-wm_0.4.1.bb
@@ -0,0 +1,11 @@
+require xcb-util.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://ewmh/ewmh.c.m4;endline=27;md5=63fd80552d7dc886f4eb267610d5bb9d \
+					file://ewmh/xcb_ewmh.h.m4;beginline=4;endline=30;md5=73b589f90ef90b4a43998955daad5cd8 \
+					file://icccm/icccm.c;endline=28;md5=e2b3240a0c197e8977adde2a5cf18d50 \
+					file://icccm/xcb_icccm.h;beginline=4;endline=31;md5=393772b7b07b9868d479d538238c1d8a \
+					"
+
+SRC_URI[md5sum] = "87b19a1cd7bfcb65a24e36c300e03129"
+SRC_URI[sha256sum] = "28bf8179640eaa89276d2b0f1ce4285103d136be6c98262b6151aaee1d3c2a3f"
diff --git a/meta/recipes-graphics/xorg-lib/xcb-util.inc b/meta/recipes-graphics/xorg-lib/xcb-util.inc
new file mode 100644
index 0000000..99d04f9
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/xcb-util.inc
@@ -0,0 +1,23 @@
+SUMMARY = "XCB: The X protocol C binding utilities"
+DESCRIPTION = "The xcb-util module provides a number of libraries which \
+sit on top of libxcb, the core X protocol library, and some of the \
+extension libraries. These experimental libraries provide convenience \
+functions and interfaces which make the raw X protocol more usable. Some \
+of the libraries also provide client-side code which is not strictly \
+part of the X protocol but which have traditionally been provided by \
+Xlib."
+HOMEPAGE = "http://xcb.freedesktop.org/XcbUtil/"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=XCB"
+
+LICENSE = "MIT"
+
+SECTION = "x11/libs"
+
+DEPENDS = "libxcb"
+DEPENDS += "gperf-native"
+
+SRC_URI = "http://xcb.freedesktop.org/dist/${BPN}-${PV}.tar.bz2"
+
+inherit autotools pkgconfig distro_features_check
+
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-graphics/xorg-lib/xcb-util_0.4.0.bb b/meta/recipes-graphics/xorg-lib/xcb-util_0.4.0.bb
new file mode 100644
index 0000000..206f07a
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/xcb-util_0.4.0.bb
@@ -0,0 +1,8 @@
+require xcb-util.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://src/xcb_aux.c;endline=30;md5=ae305b9c2a38f9ba27060191046a6460 \
+                    file://src/xcb_event.h;endline=27;md5=627be355aee59e1b8ade80d5bd90fad9"
+
+SRC_URI[md5sum] = "2e97feed81919465a04ccc71e4073313"
+SRC_URI[sha256sum] = "46e49469cb3b594af1d33176cd7565def2be3fa8be4371d62271fabb5eae50e9"
diff --git a/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.15.bb b/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.15.bb
new file mode 100644
index 0000000..f416990
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/xkeyboard-config_2.15.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Keyboard configuration database for X Window"
+
+DESCRIPTION = "The non-arch keyboard configuration database for X \
+Window.  The goal is to provide the consistent, well-structured, \
+frequently released open source of X keyboard configuration data for X \
+Window System implementations.  The project is targeted to XKB-based \
+systems."
+
+HOMEPAGE = "http://freedesktop.org/wiki/Software/XKeyboardConfig"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xkeyboard-config"
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0e7f21ca7db975c63467d2e7624a12f9"
+
+SRC_URI = "${XORG_MIRROR}/individual/data/xkeyboard-config/${BPN}-${PV}.tar.bz2"
+SRC_URI[md5sum] = "4af1deeb7c5f4cad62e65957d98d6758"
+SRC_URI[sha256sum] = "0e443cf7ca2f0b40846472c029647a05933fc705d611e1478c4db8a48a6f38bf"
+
+SECTION = "x11/libs"
+DEPENDS = "intltool-native virtual/gettext util-macros libxslt-native"
+
+EXTRA_OECONF = "--with-xkb-rules-symlink=xorg --disable-runtime-deps"
+
+FILES_${PN} += "${datadir}/X11/xkb"
+
+inherit autotools pkgconfig gettext
+
+do_install_append () {
+    install -d ${D}${datadir}/X11/xkb/compiled
+    cd ${D}${datadir}/X11/xkb/rules && ln -sf base xorg
+}
diff --git a/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc b/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
new file mode 100644
index 0000000..09df010
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/xorg-lib-common.inc
@@ -0,0 +1,26 @@
+HOMEPAGE = "http://www.x.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
+
+SECTION = "x11/libs"
+LICENSE = "MIT-X"
+DEPENDS = "util-macros"
+
+XORG_PN = "${BPN}"
+
+SRC_URI = "${XORG_MIRROR}/individual/lib/${XORG_PN}-${PV}.tar.bz2"
+
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+inherit autotools distro_features_check pkgconfig
+
+EXTRA_OECONF = "--disable-specs --without-groff --without-ps2pdf --without-fop"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[xmlto] = "--with-xmlto, --without-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+
+UNKNOWN_CONFIGURE_WHITELIST += "--enable-malloc0returnsnull --disable-malloc0returnsnull \
+                                --disable-specs --without-groff --without-ps2pdf --without-fop \
+                                --without-xmlto --with-xmlto \
+"
+
+REQUIRED_DISTRO_FEATURES ?= "x11"
diff --git a/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb b/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb
new file mode 100644
index 0000000..d5b7f1a
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/xtrans_1.3.5.bb
@@ -0,0 +1,24 @@
+SUMMARY = "XTrans: X Transport library"
+
+DESCRIPTION = "The X Transport Interface is intended to combine all \
+system and transport specific code into a single place.  This API should \
+be used by all libraries, clients and servers of the X Window System. \
+Use of this API should allow the addition of new types of transports and \
+support for new platforms without making any changes to the source \
+except in the X Transport Interface code."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=49347921d4d5268021a999f250edc9ca"
+
+PE = "1"
+
+RDEPENDS_${PN}-dev = ""
+
+inherit gettext
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "c5ba432dd1514d858053ffe9f4737dd8"
+SRC_URI[sha256sum] = "adbd3b36932ce4c062cd10f57d78a156ba98d618bdb6f50664da327502bc8301"
diff --git a/meta/recipes-graphics/xorg-proto/bigreqsproto_1.1.2.bb b/meta/recipes-graphics/xorg-proto/bigreqsproto_1.1.2.bb
new file mode 100644
index 0000000..f798a43
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/bigreqsproto_1.1.2.bb
@@ -0,0 +1,16 @@
+require xorg-proto-common.inc
+
+PE = "1"
+
+SUMMARY = "BigReqs: X Big Requests extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the \
+BIG-REQUESTS extension, used to send larger requests that usual in order \
+to avoid fragmentation."
+
+BBCLASSEXTEND = "native nativesdk"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b12715630da6f268d0d3712ee1a504f4"
+
+SRC_URI[md5sum] = "1a05fb01fa1d5198894c931cf925c025"
+SRC_URI[sha256sum] = "462116ab44e41d8121bfde947321950370b285a5316612b8fce8334d50751b1e"
diff --git a/meta/recipes-graphics/xorg-proto/calibrateproto/fix.patch b/meta/recipes-graphics/xorg-proto/calibrateproto/fix.patch
new file mode 100644
index 0000000..ff8cb25
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/calibrateproto/fix.patch
@@ -0,0 +1,42 @@
+Upstream-Status: Pending
+
+Add missing length fields to the replies. Without these, sanity checking in recent X
+breaks things.
+
+RP 11/2/10
+
+
+Index: git/xcalibrateproto.h
+===================================================================
+--- git.orig/xcalibrateproto.h	2010-02-11 11:47:45.711985932 +0000
++++ git/xcalibrateproto.h	2010-02-11 11:40:21.000000000 +0000
+@@ -67,13 +67,13 @@
+     BYTE    type;   /* X_Reply */
+     BYTE    pad1;
+     CARD16  sequenceNumber B16;
++    CARD32  length;
+     CARD32  status;
+     CARD32  pad2 B32;
+     CARD32  pad3 B32;
+     CARD32  pad4 B32;
+     CARD32  pad5 B32;
+     CARD32  pad6 B32;
+-    CARD32  pad7 B32;
+ } xXCalibrateRawModeReply;
+ 
+ #define sz_xXCalibrateRawModeReply	32
+@@ -92,13 +92,13 @@
+     BYTE    type;   /* X_Reply */
+     BYTE    pad1;
+     CARD16  sequenceNumber B16;
++    CARD32  length;
+     CARD32  x;
+     CARD32  y;
+     CARD32  pad2 B32;
+     CARD32  pad3 B32;
+     CARD32  pad4 B32;
+     CARD32  pad5 B32;
+-    CARD32  pad6 B32;
+ } xXCalibrateScreenToCoordReply;
+ 
+ #define sz_xXCalibrateScreenToCoordReply	32
diff --git a/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb b/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb
new file mode 100644
index 0000000..b88d157
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/calibrateproto_git.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XCalibrate: Touchscreen calibration headers"
+
+DESCRIPTION = "This package provides the wire protocol for the \
+Touchscreen calibration extension."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://xcalibratewire.h;endline=23;md5=7f86ef7b03cce6c4c9ebd59d20ca485f \
+                    file://xcalibrateproto.h;endline=23;md5=e4490491edcc171ca24f98569ee580db"
+
+SRCREV = "1da6fd1e2c7a49648245c98481fabea8b9690a8c"
+
+PV = "0.0+git${SRCPV}"
+PR = "r2"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/calibrateproto \
+           file://fix.patch;apply=yes"
+S = "${WORKDIR}/git"
diff --git a/meta/recipes-graphics/xorg-proto/compositeproto_0.4.2.bb b/meta/recipes-graphics/xorg-proto/compositeproto_0.4.2.bb
new file mode 100644
index 0000000..adfee26
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/compositeproto_0.4.2.bb
@@ -0,0 +1,21 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xcomposite: X composite extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X \
+composite extension.  The X composite extension provides three related \
+mechanisms for compositing and off-screen storage."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2c4bfe136f4a4418ea2f2a96b7c8f3c5 \
+                    file://composite.h;endline=43;md5=cbd44d4079053aa75930ed2f02b92926"
+
+RCONFLICTS_${PN} = "compositeext"
+BBCLASSEXTEND = "native"
+
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "98482f65ba1e74a08bf5b056a4031ef0"
+SRC_URI[sha256sum] = "049359f0be0b2b984a8149c966dd04e8c58e6eade2a4a309cf1126635ccd0cfc"
+
diff --git a/meta/recipes-graphics/xorg-proto/damageproto_1.2.1.bb b/meta/recipes-graphics/xorg-proto/damageproto_1.2.1.bb
new file mode 100644
index 0000000..75d0268
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/damageproto_1.2.1.bb
@@ -0,0 +1,20 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xdamage: X Damage extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the DAMAGE \
+extension.  The DAMAGE extension allows applications to receive \
+information about changes made to pixel contents of windows and \
+pixmaps."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d5f5a2de65c3a84cbde769f07a769608 \
+                    file://damagewire.h;endline=23;md5=4a4501a592dbc7de5ce89255e50d0296"
+
+RCONFLICTS_${PN} = "damageext"
+BBCLASSEXTEND = "native"
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "998e5904764b82642cc63d97b4ba9e95"
+SRC_URI[sha256sum] = "5c7c112e9b9ea8a9d5b019e5f17d481ae20f766cb7a4648360e7c1b46fc9fc5b"
diff --git a/meta/recipes-graphics/xorg-proto/dmxproto_2.3.1.bb b/meta/recipes-graphics/xorg-proto/dmxproto_2.3.1.bb
new file mode 100644
index 0000000..d960e5d
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/dmxproto_2.3.1.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "DMX: Distributed Multihead extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the DMX \
+extension.  The DMX extension provides support for communication with \
+and control of Xdmx server.  Attributes of the Xdmx server and of the \
+back-end screens attached to the server can be queried and modified via \
+this protocol."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=a3c3499231a8035efd0e004cfbd3b72a \
+                    file://dmxproto.h;endline=32;md5=ab8509955c3dd4c65fac728e1b367bc4"
+
+PE = "1"
+
+SRC_URI[md5sum] = "4ee175bbd44d05c34d43bb129be5098a"
+SRC_URI[sha256sum] = "e72051e6a3e06b236d19eed56368117b745ca1e1a27bdc50fd51aa375bea6509"
diff --git a/meta/recipes-graphics/xorg-proto/dri2proto_2.8.bb b/meta/recipes-graphics/xorg-proto/dri2proto_2.8.bb
new file mode 100644
index 0000000..f4c40c5
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/dri2proto_2.8.bb
@@ -0,0 +1,15 @@
+require xorg-proto-common.inc
+
+SUMMARY = "DRI2: Direct Rendering Infrastructure 2 headers"
+
+DESCRIPTION = "This package provides the wire protocol for the Direct \
+Rendering Ifnrastructure 2.  DIR is required for may hardware \
+accelerated OpenGL drivers."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=2e396fa91834f8786032cad2da5638f3 \
+                    file://dri2proto.h;endline=31;md5=22f28bf68d01b533f26195e94b3ed8ca"
+
+
+SRC_URI[md5sum] = "b2721d5d24c04d9980a0c6540cb5396a"
+SRC_URI[sha256sum] = "f9b55476def44fc7c459b2537d17dbc731e36ed5d416af7ca0b1e2e676f8aa04"
diff --git a/meta/recipes-graphics/xorg-proto/dri2proto_git.bb b/meta/recipes-graphics/xorg-proto/dri2proto_git.bb
new file mode 100644
index 0000000..9074f48
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/dri2proto_git.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "DRI2: Direct Rendering Infrastructure 2 headers"
+
+DESCRIPTION = "This package provides the wire protocol for the Direct \
+Rendering Ifnrastructure 2.  DIR is required for may hardware \
+accelerated OpenGL drivers."
+
+SRCREV = "66c56ab10d917e3f47f93178d7eac6430970d3c4"
+PV = "1.99.3+git${SRCPV}"
+PR = "r2"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/dri2proto"
+
+LIC_FILES_CHKSUM="file://COPYING;md5=2e396fa91834f8786032cad2da5638f3"
+
+S = "${WORKDIR}/git"
+
diff --git a/meta/recipes-graphics/xorg-proto/dri3proto_1.0.bb b/meta/recipes-graphics/xorg-proto/dri3proto_1.0.bb
new file mode 100644
index 0000000..bed97b3
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/dri3proto_1.0.bb
@@ -0,0 +1,14 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Direct Rendering Infrastructure 3 Extension"
+
+DESCRIPTION = "The DRI3 extension provides mechanisms to translate between direct \
+rendered buffers and X pixmaps. When combined with the Present extension, \
+a complete direct rendering solution for OpenGL is provided."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://dri3proto.h;endline=21;md5=ac90d1d416be3cb13e1d3c88cd5166bf"
+
+
+SRC_URI[md5sum] = "a3d2cbe60a9ca1bf3aea6c93c817fee3"
+SRC_URI[sha256sum] = "01be49d70200518b9a6b297131f6cc71f4ea2de17436896af153226a774fc074"
diff --git a/meta/recipes-graphics/xorg-proto/fixesproto_5.0.bb b/meta/recipes-graphics/xorg-proto/fixesproto_5.0.bb
new file mode 100644
index 0000000..39fb88d
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/fixesproto_5.0.bb
@@ -0,0 +1,22 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFixes: X Fixes extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Fixes \
+extension.  This extension is designed to provide server-side support \
+for application work arounds to shortcomings in the core X window \
+system."
+
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=262a7a87da56e66dd639bf7334a110c6 \
+                    file://xfixesproto.h;endline=43;md5=c3a9ee6db3532ed0d44dea266cfc97f4"
+
+RCONFLICTS_${PN} = "fixesext"
+PR = "r1"
+PE = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "e7431ab84d37b2678af71e29355e101d"
+SRC_URI[sha256sum] = "ba2f3f31246bdd3f2a0acf8bd3b09ba99cab965c7fb2c2c92b7dc72870e424ce"
diff --git a/meta/recipes-graphics/xorg-proto/fontsproto_2.1.3.bb b/meta/recipes-graphics/xorg-proto/fontsproto_2.1.3.bb
new file mode 100644
index 0000000..27fc281
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/fontsproto_2.1.3.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFont: X Font rasterisation headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Font \
+rasterisation extensions.  These extensions are used to control \
+server-side font configurations."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c3e48aa9ce868c8e90f0401db41c11a2 \
+                    file://FSproto.h;endline=44;md5=d2e58e27095e5ea7d4ad456ccb91986c"
+
+PE = "1"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI[md5sum] = "36934d00b00555eaacde9f091f392f97"
+SRC_URI[sha256sum] = "259046b0dd9130825c4a4c479ba3591d6d0f17a33f54e294b56478729a6e5ab8"
diff --git a/meta/recipes-graphics/xorg-proto/glproto_1.4.17.bb b/meta/recipes-graphics/xorg-proto/glproto_1.4.17.bb
new file mode 100644
index 0000000..eb03d33
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/glproto_1.4.17.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "OpenGL: X OpenGL extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the \
+OpenGL-related extensions, used to enable the rendering of applications \
+using OpenGL."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d44ed0146997856304dfbb512a59a8de \
+                    file://glxproto.h;beginline=4;endline=32;md5=6b79c570f644363b356456e7d44471d9"
+
+PE = "1"
+
+BBCLASSEXTEND = "nativesdk"
+
+SRC_URI[md5sum] = "5565f1b0facf4a59c2778229c1f70d10"
+SRC_URI[sha256sum] = "adaa94bded310a2bfcbb9deb4d751d965fcfe6fb3a2f6d242e2df2d6589dbe40"
diff --git a/meta/recipes-graphics/xorg-proto/inputproto_2.3.1.bb b/meta/recipes-graphics/xorg-proto/inputproto_2.3.1.bb
new file mode 100644
index 0000000..7e8e0c1
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/inputproto_2.3.1.bb
@@ -0,0 +1,20 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XI: X Input extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Input \
+extension.  The extension supports input devices other then the core X \
+keyboard and pointer."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e562cc0f6587b961f032211d8160f31e \
+                    file://XI2proto.h;endline=48;md5=1ac1581e61188da2885cc14ff49b20be"
+
+PE = "1"
+
+inherit gettext
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "6caebead4b779ba031727f66a7ffa358"
+SRC_URI[sha256sum] = "5a47ee62053a6acef3a83f506312494be1461068d0b9269d818839703b95c1d1"
diff --git a/meta/recipes-graphics/xorg-proto/inputproto_git.bb b/meta/recipes-graphics/xorg-proto/inputproto_git.bb
new file mode 100644
index 0000000..6520f3b
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/inputproto_git.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XI: X Input extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Input \
+extension.  The extension supports input devices other then the core X \
+keyboard and pointer."
+
+PR = "r1"
+PE = "1"
+SRCREV = "7203036522ba9d4b224d282d6afc2d0b947711ee"
+PV = "1.9.99.12+git${SRCPV}"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/inputproto"
+S = "${WORKDIR}/git"
+
+inherit gettext
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-graphics/xorg-proto/kbproto_1.0.7.bb b/meta/recipes-graphics/xorg-proto/kbproto_1.0.7.bb
new file mode 100644
index 0000000..46f5c92
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/kbproto_1.0.7.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XKB: X Keyboard extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X \
+Keyboard extension.  This extension is used to control options related \
+to keyboard handling and layout."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7dd6ea99e2a83a552c02c80963623c38 \
+                    file://XKBproto.h;beginline=1;endline=25;md5=5744eeff407aeb6e7a1346eebab486a2"
+
+PE = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "94afc90c1f7bef4a27fdd59ece39c878"
+SRC_URI[sha256sum] = "f882210b76376e3fa006b11dbd890e56ec0942bc56e65d1249ff4af86f90b857"
diff --git a/meta/recipes-graphics/xorg-proto/presentproto_git.bb b/meta/recipes-graphics/xorg-proto/presentproto_git.bb
new file mode 100644
index 0000000..dbb6f32
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/presentproto_git.bb
@@ -0,0 +1,24 @@
+require xorg-proto-common.inc
+
+SUMMARY = "This package provides the basic headers for the X Window System"
+DESCRIPTION = "The Present extension provides a way for applications to update their \
+               window contents from a pixmap in a well defined fashion, synchronizing \
+               with the display refresh and potentially using a more efficient \
+               mechanism than copying the contents of the source pixmap.\
+              "
+
+LICENSE = "GPLv2"
+
+SRCREV = "24f3a56e541b0a9e6c6ee76081f441221a120ef9"
+PV = "1.0+git${SRCPV}"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=47e508ca280fde97906eacb77892c3ac"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xorg/proto/presentproto"
+S = "${WORKDIR}/git"
+
+PR = "r1"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-graphics/xorg-proto/randrproto_1.5.0.bb b/meta/recipes-graphics/xorg-proto/randrproto_1.5.0.bb
new file mode 100644
index 0000000..b59e525
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/randrproto_1.5.0.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XRandR: X Resize, Rotate and Reflect extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Resize, \
+Rotate and Reflect extension.  This extension provides the ability to \
+resize, rotate and reflect the root window of a screen."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=00426d41bd3d9267cf9bbb2df9323a5e \
+                    file://randrproto.h;endline=30;md5=3885957c6048fdf3310ac8ba54ca2c3f"
+
+RCONFLICTS_${PN} = "randrext"
+PE = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "a46765c8dcacb7114c821baf0df1e797"
+SRC_URI[sha256sum] = "4c675533e79cd730997d232c8894b6692174dce58d3e207021b8f860be498468"
diff --git a/meta/recipes-graphics/xorg-proto/recordproto_1.14.2.bb b/meta/recipes-graphics/xorg-proto/recordproto_1.14.2.bb
new file mode 100644
index 0000000..ad2317c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/recordproto_1.14.2.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XRecord: X Record extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Record \
+extension.  This extension is used to record and play back event \
+sequences."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=575827a0f554bbed332542976d5f3d40 \
+                    file://recordproto.h;endline=19;md5=1cbb0dd45a0b060ff833901620a3e738"
+
+RCONFLICTS_${PN} = "recordext"
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "1b4e5dede5ea51906f1530ca1e21d216"
+SRC_URI[sha256sum] = "a777548d2e92aa259f1528de3c4a36d15e07a4650d0976573a8e2ff5437e7370"
diff --git a/meta/recipes-graphics/xorg-proto/renderproto_0.11.1.bb b/meta/recipes-graphics/xorg-proto/renderproto_0.11.1.bb
new file mode 100644
index 0000000..ff800ec
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/renderproto_0.11.1.bb
@@ -0,0 +1,21 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XRender: X rendering Extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X \
+Rendering extension.  This is the basis the image composition within the \
+X window system."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f826d99765196352e6122a406cf0d024 \
+                    file://renderproto.h;beginline=4;endline=24;md5=3e5e2851dad240b0a3a27c4776b4fd1f"
+
+RCONFLICTS_${PN} = "renderext"
+PR = "r1"
+PE = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "a914ccc1de66ddeb4b611c6b0686e274"
+SRC_URI[sha256sum] = "06735a5b92b20759204e4751ecd6064a2ad8a6246bb65b3078b862a00def2537"
+
diff --git a/meta/recipes-graphics/xorg-proto/resourceproto_1.2.0.bb b/meta/recipes-graphics/xorg-proto/resourceproto_1.2.0.bb
new file mode 100644
index 0000000..08b610a
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/resourceproto_1.2.0.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XRes: X Resource extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X \
+Resource extension.  XRes provides an interface that allows X clients to \
+see and monitor X resource usage of various clients."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=604859305e662503077240fee8c77d97"
+
+RCONFLICTS_${PN} = "resourceext"
+
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "cfdb57dae221b71b2703f8e2980eaaf4"
+SRC_URI[sha256sum] = "3c66003a6bdeb0f70932a9ed3cf57cc554234154378d301e0c5cfa189d8f6818"
+
diff --git a/meta/recipes-graphics/xorg-proto/scrnsaverproto_1.2.2.bb b/meta/recipes-graphics/xorg-proto/scrnsaverproto_1.2.2.bb
new file mode 100644
index 0000000..ab07f51
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/scrnsaverproto_1.2.2.bb
@@ -0,0 +1,19 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xscrnsaver: X Screen Saver extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Screen \
+Saver extension.  This extension allows an external \"screen saver\" \
+client to detect when the alternative image is to be displayed and to \
+provide the graphics."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eed49b78b15b436c933b6b8b054e3901 \
+                    file://saverproto.h;endline=26;md5=a84c0637305159f3c0ab173aaeede48d"
+
+PE = "1"
+
+EXTRA_OECONF_append = " --enable-specs=no"
+
+SRC_URI[md5sum] = "edd8a73775e8ece1d69515dd17767bfb"
+SRC_URI[sha256sum] = "8bb70a8da164930cceaeb4c74180291660533ad3cc45377b30a795d1b85bcd65"
diff --git a/meta/recipes-graphics/xorg-proto/videoproto_2.3.2.bb b/meta/recipes-graphics/xorg-proto/videoproto_2.3.2.bb
new file mode 100644
index 0000000..53aa759
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/videoproto_2.3.2.bb
@@ -0,0 +1,14 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xv: X Video extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the X Video \
+extension.  This extension alows for accerlated drawing of videos."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ce3472a119a864085fa4155cb0979a7b"
+
+PE = "1"
+
+SRC_URI[md5sum] = "e658641595327d3990eab70fdb55ca8b"
+SRC_URI[sha256sum] = "8dae168cb820fcd32f564879afb3f24d27c176300d9af66819a18265539bd4b6"
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto.inc b/meta/recipes-graphics/xorg-proto/xcb-proto.inc
new file mode 100644
index 0000000..2e1b57b
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xcb-proto.inc
@@ -0,0 +1,25 @@
+SUMMARY = "XCB: The X protocol C binding headers"
+DESCRIPTION = "Function prototypes for the X protocol C-language Binding \
+(XCB).  XCB is a replacement for Xlib featuring a small footprint, \
+latency hiding, direct access to the protocol, improved threading \
+support, and extensibility."
+HOMEPAGE = "http://xcb.freedesktop.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=XCB"
+
+SECTION = "x11/libs"
+LICENSE = "MIT-X"
+
+SRC_URI = "http://xcb.freedesktop.org/dist/xcb-proto-${PV}.tar.bz2"
+
+inherit autotools pkgconfig pythonnative
+
+PACKAGES += "python-xcbgen"
+
+FILES_${PN}-dev += "${datadir}/xcb/*.xml ${datadir}/xcb/*.xsd"
+FILES_python-xcbgen = "${libdir}/python*"
+
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+DEPENDS_append_class-native = " python-native"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.11.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_1.11.bb
new file mode 100644
index 0000000..5bc5a11
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.11.bb
@@ -0,0 +1,9 @@
+include xcb-proto.inc
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7 \
+                    file://src/dri2.xml;beginline=2;endline=28;md5=f8763b13ff432e8597e0d610cf598e65"
+
+
+SRC_URI[md5sum] = "6bf2797445dc6d43e9e4707c082eff9c"
+SRC_URI[sha256sum] = "b4aceee6502a0ce45fc39b33c541a2df4715d00b72e660ebe8c5bb444771e32e"
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_git.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_git.bb
new file mode 100644
index 0000000..2ea4d04
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xcb-proto_git.bb
@@ -0,0 +1,9 @@
+DEFAULT_PREFERENCE = "-1"
+
+include xcb-proto.inc
+SRCREV = "d81ca233e98be8fa59e8c90d262c0516944c5a66"
+PV = "1.2+gitr${SRCPV}"
+PR = "r4"
+
+SRC_URI = "git://anongit.freedesktop.org/git/xcb/proto"
+S = "${WORKDIR}/git"
diff --git a/meta/recipes-graphics/xorg-proto/xcmiscproto_1.2.2.bb b/meta/recipes-graphics/xorg-proto/xcmiscproto_1.2.2.bb
new file mode 100644
index 0000000..0751b94
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xcmiscproto_1.2.2.bb
@@ -0,0 +1,17 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XC-MISC: X XC-Miscellaneous extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the XC-MISC \
+extension, which is used to get details of XID allocations within the \
+server."
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=09d83047c15994e05db29b423ed6662e"
+
+PE = "1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "5f4847c78e41b801982c8a5e06365b24"
+SRC_URI[sha256sum] = "b13236869372256c36db79ae39d54214172677fb79e9cdc555dceec80bd9d2df"
diff --git a/meta/recipes-graphics/xorg-proto/xextproto_7.3.0.bb b/meta/recipes-graphics/xorg-proto/xextproto_7.3.0.bb
new file mode 100644
index 0000000..dd0bd95
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xextproto_7.3.0.bb
@@ -0,0 +1,24 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XExt: X Extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for several X \
+extensions.  These protocol extensions include DOUBLE-BUFFER, DPMS, \
+Extended-Visual-Information, LBX, MIT_SHM, MIT_SUNDRY-NONSTANDARD, \
+Multi-Buffering, SECURITY, SHAPE, SYNC, TOG-CUP, XC-APPGROUP, XC-MISC, \
+XTEST.  In addition a small set of utility functions are also \
+available."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=86f273291759d0ba2a22585cd1c06c53"
+
+PE = "1"
+
+inherit gettext
+
+EXTRA_OECONF_append = " --enable-specs=no"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "70c90f313b4b0851758ef77b95019584"
+SRC_URI[sha256sum] = "f3f4b23ac8db9c3a9e0d8edb591713f3d70ef9c3b175970dd8823dfc92aa5bb0"
diff --git a/meta/recipes-graphics/xorg-proto/xf86dgaproto_2.1.bb b/meta/recipes-graphics/xorg-proto/xf86dgaproto_2.1.bb
new file mode 100644
index 0000000..86f3ce3
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xf86dgaproto_2.1.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFree86-DGA: XFree86 Direct Graphics Access extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the XFree86 \
+Direct Graphics Access extension. This extension allows direct graphics \
+access to a framebuffer-like region, as well as relative mouse \
+reporting."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e01e66e4b317088cf869bc98e6af4fb6"
+
+RCONFLICTS_${PN} = "xxf86dgaext"
+PR = "r2"
+PE = "1"
+
+SRC_URI[md5sum] = "a036dc2fcbf052ec10621fd48b68dbb1"
+SRC_URI[sha256sum] = "ac5ef65108e1f2146286e53080975683dae49fc94680042e04bd1e2010e99050"
diff --git a/meta/recipes-graphics/xorg-proto/xf86driproto_2.1.1.bb b/meta/recipes-graphics/xorg-proto/xf86driproto_2.1.1.bb
new file mode 100644
index 0000000..b3f9210
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xf86driproto_2.1.1.bb
@@ -0,0 +1,17 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFree86-DRI: XFree86 Direct Rendering Infrastructure extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the XFree86 \
+Direct Rendering Infrastructure extension.  The XFree86-DRI extension is \
+used to organize direct rendering support or 3D clients and help \
+arbitrate requests."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ef103b9d951e39ff7e23d386e2011fa3 \
+                    file://xf86driproto.h;endline=35;md5=42be3d8e6d429ab79172572bb0cff544"
+
+PE = "1"
+
+SRC_URI[md5sum] = "1d716d0dac3b664e5ee20c69d34bc10e"
+SRC_URI[sha256sum] = "9c4b8d7221cb6dc4309269ccc008a22753698ae9245a398a59df35f1404d661f"
diff --git a/meta/recipes-graphics/xorg-proto/xf86miscproto_0.9.3.bb b/meta/recipes-graphics/xorg-proto/xf86miscproto_0.9.3.bb
new file mode 100644
index 0000000..d4663ea
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xf86miscproto_0.9.3.bb
@@ -0,0 +1,17 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFree86-Misc: XFree86 miscellaneous extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the XFree \
+miscellaneous extension.  The XFree86-Misc extension provides a means to \
+access input device configuration settings specific to the XFree86/Xorg \
+DDX."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e01e66e4b317088cf869bc98e6af4fb6"
+
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "ca63bbb31cf5b7f37b2237e923ff257a"
+SRC_URI[sha256sum] = "45b8ec6a4a8ca21066dce117e09dcc88539862e616e60fb391de05b36f63b095"
diff --git a/meta/recipes-graphics/xorg-proto/xf86vidmodeproto_2.3.1.bb b/meta/recipes-graphics/xorg-proto/xf86vidmodeproto_2.3.1.bb
new file mode 100644
index 0000000..0f31900
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xf86vidmodeproto_2.3.1.bb
@@ -0,0 +1,18 @@
+require xorg-proto-common.inc
+
+SUMMARY = "XFree86-VM: XFree86 video mode extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the XFree86 \
+video mode extension.  This extension allows client applications to get \
+and set video mode timings."
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=499be2ff387a42f84628c35f311f1502"
+
+RCONFLICTS_${PN} = "xxf86vmext"
+
+PR = "r1"
+PE = "1"
+
+SRC_URI[md5sum] = "e793ecefeaecfeabd1aed6a01095174e"
+SRC_URI[sha256sum] = "45d9499aa7b73203fd6b3505b0259624afed5c16b941bd04fcf123e5de698770"
diff --git a/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb b/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb
new file mode 100644
index 0000000..d00774e
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xineramaproto_1.2.1.bb
@@ -0,0 +1,17 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xinerama: Xinerama extension headers"
+
+DESCRIPTION = "This package provides the wire protocol for the Xinerama \
+extension.  This extension is used for retrieving information about \
+physical output devices which may be combined into a single logical X \
+screen."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3e397a5326c83d5d0ebf5b3f87163ac6 \
+                    file://panoramiXproto.h;endline=24;md5=098e0bc089368a988092b3cbda617a57"
+
+PE = "1"
+
+SRC_URI[md5sum] = "9959fe0bfb22a0e7260433b8d199590a"
+SRC_URI[sha256sum] = "977574bb3dc192ecd9c55f59f991ec1dff340be3e31392c95deff423da52485b"
diff --git a/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc b/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc
new file mode 100644
index 0000000..7a417c9
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc
@@ -0,0 +1,26 @@
+SUMMARY = "X protocol headers: ${XORG_PN}"
+HOMEPAGE = "http://www.x.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
+
+SECTION = "x11/libs"
+LICENSE = "MIT-X"
+
+XORG_PN = "${BPN}"
+
+SRC_URI = "${XORG_MIRROR}/individual/proto/${XORG_PN}-${PV}.tar.bz2"
+
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+DEPENDS = "util-macros"
+
+inherit autotools pkgconfig
+EXTRA_OECONF = "--without-fop"
+
+UNKNOWN_CONFIGURE_WHITELIST += "--without-fop --without-xmlto --with-xmlto"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[xmlto] = "--with-xmlto, --without-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+
+# ${PN} is empty so we need to tweak -dev and -dbg package dependencies
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
diff --git a/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch b/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch
new file mode 100644
index 0000000..540ad27
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xproto/xproto_fix_for_x32.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+Don't always define LONG64 for AMD64
+    
+X32 defines __amd64__/amd64 with 32bit long.  We should simply check
+__LP64__ before defining LONG64 without checking __amd64__/amd64.
+
+This fixes compilation with x32 toolchain.
+
+Received this patch from H.J. Lu <hjl.tools@gmail.com>
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> 2011/12/1
+
+--- xproto-7.0.22/Xmd.h.x32	2009-07-11 04:19:50.000000000 -0700
++++ xproto-7.0.22/Xmd.h	2011-11-30 17:14:19.290395893 -0800
+@@ -62,7 +62,6 @@ SOFTWARE.
+      defined(__ia64__) || defined(ia64) || \
+      defined(__sparc64__) || \
+      defined(__s390x__) || \
+-     defined(__amd64__) || defined(amd64) || \
+      defined(__powerpc64__)
+ #  define LONG64				/* 32/64-bit architecture */
+ # endif
diff --git a/meta/recipes-graphics/xorg-proto/xproto_7.0.28.bb b/meta/recipes-graphics/xorg-proto/xproto_7.0.28.bb
new file mode 100644
index 0000000..7427a7d
--- /dev/null
+++ b/meta/recipes-graphics/xorg-proto/xproto_7.0.28.bb
@@ -0,0 +1,20 @@
+require xorg-proto-common.inc
+
+SUMMARY = "Xlib: C Language X interface headers"
+
+DESCRIPTION = "This package provides the basic headers for the X Window \
+System."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b9e051107d5628966739a0b2e9b32676"
+
+PE = "1"
+
+SRC_URI += "file://xproto_fix_for_x32.patch"
+
+EXTRA_OECONF_append = " --enable-specs=no"
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI[md5sum] = "3ce2f230c5d8fa929f326ad1f0fa40a8"
+SRC_URI[sha256sum] = "29e85568d1f68ceef8a2c081dad9bc0e5500a53cfffde24b564dc43d46ddf6ca"
+
diff --git a/meta/recipes-graphics/xorg-util/gccmakedep_1.0.3.bb b/meta/recipes-graphics/xorg-util/gccmakedep_1.0.3.bb
new file mode 100644
index 0000000..ccf2f4b
--- /dev/null
+++ b/meta/recipes-graphics/xorg-util/gccmakedep_1.0.3.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Program to create dependencies in makefiles"
+
+DESCRIPTION = "The gccmakedep program calls 'gcc -M' to output makefile \
+rules describing the dependencies of each sourcefile, so that make knows \
+which object files must be recompiled when a dependency has changed."
+
+require xorg-util-common.inc
+LIC_FILES_CHKSUM = "file://Makefile.am;endline=20;md5=23c277396d690413245ebb89b18c5d4d"
+DESCRIPTION = "create dependencies in makefiles using 'gcc -M'"
+DEPENDS = "util-macros"
+RDEPENDS_${PN} = "gcc"
+
+PR = "r3"
+PE = "1"
+
+SRC_URI[md5sum] = "127ddb6131eb4a56fdf6644a63ade788"
+SRC_URI[sha256sum] = "f9e2e7a590e27f84b6708ab7a81e546399b949bf652fb9b95193e0e543e6a548"
\ No newline at end of file
diff --git a/meta/recipes-graphics/xorg-util/makedepend_1.0.5.bb b/meta/recipes-graphics/xorg-util/makedepend_1.0.5.bb
new file mode 100644
index 0000000..84a967a
--- /dev/null
+++ b/meta/recipes-graphics/xorg-util/makedepend_1.0.5.bb
@@ -0,0 +1,21 @@
+require xorg-util-common.inc
+
+SUMMARY = "create dependencies in makefiles"
+
+DESCRIPTION = "The makedepend program reads each sourcefile in sequence \
+and parses it like a C-preprocessor, processing \
+all #include, #define,  #undef, #ifdef, #ifndef, #endif, #if, #elif \
+and #else directives so that it can correctly tell which #include, \
+directives would be used in a compilation. Any #include, directives \
+can reference files having other #include directives, and parsing will \
+occur in these files as well."
+
+DEPENDS = "xproto util-macros"
+PE = "1"
+
+BBCLASSEXTEND = "native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=43a6eda34b48ee821b3b66f4f753ce4f"
+
+SRC_URI[md5sum] = "efb2d7c7e22840947863efaedc175747"
+SRC_URI[sha256sum] = "503903d41fb5badb73cb70d7b3740c8b30fe1cc68c504d3b6a85e6644c4e5004"
diff --git a/meta/recipes-graphics/xorg-util/util-macros_1.19.0.bb b/meta/recipes-graphics/xorg-util/util-macros_1.19.0.bb
new file mode 100644
index 0000000..26cf50f
--- /dev/null
+++ b/meta/recipes-graphics/xorg-util/util-macros_1.19.0.bb
@@ -0,0 +1,19 @@
+SUMMARY = "X autotools macros"
+
+DESCRIPTION = "M4 autotools macros used by various X.org programs."
+
+require xorg-util-common.inc
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=1970511fddd439b07a6ba789d28ff662"
+
+PE = "1"
+
+SRC_URI[md5sum] = "40e1caa49a71a26e0aa68ddd00203717"
+SRC_URI[sha256sum] = "0d4df51b29023daf2f63aebf3ebc638ea88efedfd560ab5866741ab3f92acaa1"
+
+# ${PN} is empty so we need to tweak -dev and -dbg package dependencies
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-graphics/xorg-util/xorg-util-common.inc b/meta/recipes-graphics/xorg-util/xorg-util-common.inc
new file mode 100644
index 0000000..18d022c
--- /dev/null
+++ b/meta/recipes-graphics/xorg-util/xorg-util-common.inc
@@ -0,0 +1,13 @@
+HOMEPAGE = "http://www.x.org"
+BUGTRACKER = "https://bugs.freedesktop.org/enter_bug.cgi?product=xorg"
+
+SECTION = "x11/utils"
+LICENSE = "MIT-X"
+
+XORG_PN = "${BPN}"
+
+SRC_URI = "${XORG_MIRROR}/individual/util/${XORG_PN}-${PV}.tar.gz"
+
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/10-preload-modules.conf b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/10-preload-modules.conf
new file mode 100644
index 0000000..7ceb6fd
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/10-preload-modules.conf
@@ -0,0 +1,9 @@
+Section "Module"
+    Load "fbdevhw"
+    Load "fb"
+    Load "shadow"
+    Load "shadowfb"
+    Load "vbe"
+    Load "vgahw"
+EndSection
+
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf
new file mode 100644
index 0000000..629ae21
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuarm/xorg.conf
@@ -0,0 +1,69 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Generic Keyboard"
+    Driver        "evdev"
+    Option        "CoreKeyboard"
+    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+    Option        "XkbRules"    "xorg"
+    Option        "XkbModel"    "evdev"
+    Option        "XkbLayout"    "us"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Configured Mouse"
+    Driver        "mouse"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/mice"
+    Option        "Protocol"        "ImPS/2"
+    Option        "ZAxisMapping"        "4 5"
+    Option        "Emulate3Buttons"    "true"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Qemu Tablet"
+    Driver        "evdev"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/touchscreen0"
+    Option        "USB"           "on"
+EndSection
+
+Section "Device"
+    Identifier    "Graphics Controller"
+    Driver        "fbdev"
+EndSection
+
+Section "Monitor"
+    Identifier    "Generic Monitor"
+    Option        "DPMS"
+    # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+    Modeline "1024x600_60.00"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
+    # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+    ModeLine "640x480"    25.2  640  656  752  800    480  490  492  525 -hsync -vsync
+    # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+    ModeLine "640x480"    31.5  640  664  704  832    480  489  491  520 -hsync -vsync
+    # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+    ModeLine "640x480"    31.5  640  656  720  840    480  481  484  500 -hsync -vsync
+    # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+    ModeLine "640x480"    36.0  640  696  752  832    480  481  484  509 -hsync -vsync
+EndSection
+
+Section "Screen"
+    Identifier    "Default Screen"
+    Device        "Graphics Controller"
+    Monitor        "Generic Monitor"
+    SubSection "Display"
+        Modes     "640x480"
+    EndSubSection
+EndSection
+
+Section "ServerLayout"
+    Identifier    "Default Layout"
+    Screen        "Default Screen"
+    InputDevice    "Generic Keyboard"
+    # InputDevice    "Configured Mouse"
+    InputDevice    "QEMU Tablet"
+    Option         "AllowEmptyInput" "no"
+EndSection
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf
new file mode 100644
index 0000000..e6c8b51
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips/xorg.conf
@@ -0,0 +1,70 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Generic Keyboard"
+    Driver        "evdev"
+    Option        "CoreKeyboard"
+    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+    Option        "XkbRules"    "xorg"
+    Option        "XkbModel"    "evdev"
+    Option        "XkbLayout"    "us"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Configured Mouse"
+    Driver        "mouse"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/mice"
+    Option        "Protocol"        "ImPS/2"
+    Option        "ZAxisMapping"        "4 5"
+    Option        "Emulate3Buttons"    "true"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Qemu Tablet"
+    Driver        "evdev"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/touchscreen0"
+    Option        "USB"           "on"
+EndSection
+
+Section "Device"
+    Identifier    "Graphics Controller"
+    Driver        "fbdev"
+EndSection
+
+Section "Monitor"
+    Identifier    "Generic Monitor"
+    Option        "DPMS"
+    # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+    Modeline "1024x600_60.00"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
+    # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+    ModeLine "640x480"    25.2  640  656  752  800    480  490  492  525 -hsync -vsync
+    # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+    ModeLine "640x480"    31.5  640  664  704  832    480  489  491  520 -hsync -vsync
+    # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+    ModeLine "640x480"    31.5  640  656  720  840    480  481  484  500 -hsync -vsync
+    # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+    ModeLine "640x480"    36.0  640  696  752  832    480  481  484  509 -hsync -vsync
+EndSection
+
+Section "Screen"
+    Identifier    "Default Screen"
+    Device        "Graphics Controller"
+    Monitor        "Generic Monitor"
+    DefaultDepth  16
+    SubSection "Display"
+        Modes     "640x480"
+    EndSubSection
+EndSection
+
+Section "ServerLayout"
+    Identifier    "Default Layout"
+    Screen        "Default Screen"
+    InputDevice    "Generic Keyboard"
+    # InputDevice    "Configured Mouse"
+    InputDevice    "QEMU Tablet"
+    Option         "AllowEmptyInput" "no"
+EndSection
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf
new file mode 100644
index 0000000..629ae21
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemumips64/xorg.conf
@@ -0,0 +1,69 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Generic Keyboard"
+    Driver        "evdev"
+    Option        "CoreKeyboard"
+    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+    Option        "XkbRules"    "xorg"
+    Option        "XkbModel"    "evdev"
+    Option        "XkbLayout"    "us"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Configured Mouse"
+    Driver        "mouse"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/mice"
+    Option        "Protocol"        "ImPS/2"
+    Option        "ZAxisMapping"        "4 5"
+    Option        "Emulate3Buttons"    "true"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Qemu Tablet"
+    Driver        "evdev"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/touchscreen0"
+    Option        "USB"           "on"
+EndSection
+
+Section "Device"
+    Identifier    "Graphics Controller"
+    Driver        "fbdev"
+EndSection
+
+Section "Monitor"
+    Identifier    "Generic Monitor"
+    Option        "DPMS"
+    # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+    Modeline "1024x600_60.00"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
+    # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+    ModeLine "640x480"    25.2  640  656  752  800    480  490  492  525 -hsync -vsync
+    # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+    ModeLine "640x480"    31.5  640  664  704  832    480  489  491  520 -hsync -vsync
+    # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+    ModeLine "640x480"    31.5  640  656  720  840    480  481  484  500 -hsync -vsync
+    # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+    ModeLine "640x480"    36.0  640  696  752  832    480  481  484  509 -hsync -vsync
+EndSection
+
+Section "Screen"
+    Identifier    "Default Screen"
+    Device        "Graphics Controller"
+    Monitor        "Generic Monitor"
+    SubSection "Display"
+        Modes     "640x480"
+    EndSubSection
+EndSection
+
+Section "ServerLayout"
+    Identifier    "Default Layout"
+    Screen        "Default Screen"
+    InputDevice    "Generic Keyboard"
+    # InputDevice    "Configured Mouse"
+    InputDevice    "QEMU Tablet"
+    Option         "AllowEmptyInput" "no"
+EndSection
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf
new file mode 100644
index 0000000..629ae21
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemuppc/xorg.conf
@@ -0,0 +1,69 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Generic Keyboard"
+    Driver        "evdev"
+    Option        "CoreKeyboard"
+    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+    Option        "XkbRules"    "xorg"
+    Option        "XkbModel"    "evdev"
+    Option        "XkbLayout"    "us"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Configured Mouse"
+    Driver        "mouse"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/mice"
+    Option        "Protocol"        "ImPS/2"
+    Option        "ZAxisMapping"        "4 5"
+    Option        "Emulate3Buttons"    "true"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Qemu Tablet"
+    Driver        "evdev"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/touchscreen0"
+    Option        "USB"           "on"
+EndSection
+
+Section "Device"
+    Identifier    "Graphics Controller"
+    Driver        "fbdev"
+EndSection
+
+Section "Monitor"
+    Identifier    "Generic Monitor"
+    Option        "DPMS"
+    # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+    Modeline "1024x600_60.00"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
+    # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+    ModeLine "640x480"    25.2  640  656  752  800    480  490  492  525 -hsync -vsync
+    # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+    ModeLine "640x480"    31.5  640  664  704  832    480  489  491  520 -hsync -vsync
+    # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+    ModeLine "640x480"    31.5  640  656  720  840    480  481  484  500 -hsync -vsync
+    # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+    ModeLine "640x480"    36.0  640  696  752  832    480  481  484  509 -hsync -vsync
+EndSection
+
+Section "Screen"
+    Identifier    "Default Screen"
+    Device        "Graphics Controller"
+    Monitor        "Generic Monitor"
+    SubSection "Display"
+        Modes     "640x480"
+    EndSubSection
+EndSection
+
+Section "ServerLayout"
+    Identifier    "Default Layout"
+    Screen        "Default Screen"
+    InputDevice    "Generic Keyboard"
+    # InputDevice    "Configured Mouse"
+    InputDevice    "QEMU Tablet"
+    Option         "AllowEmptyInput" "no"
+EndSection
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf
new file mode 100644
index 0000000..629ae21
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemush4/xorg.conf
@@ -0,0 +1,69 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Generic Keyboard"
+    Driver        "evdev"
+    Option        "CoreKeyboard"
+    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+    Option        "XkbRules"    "xorg"
+    Option        "XkbModel"    "evdev"
+    Option        "XkbLayout"    "us"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Configured Mouse"
+    Driver        "mouse"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/mice"
+    Option        "Protocol"        "ImPS/2"
+    Option        "ZAxisMapping"        "4 5"
+    Option        "Emulate3Buttons"    "true"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Qemu Tablet"
+    Driver        "evdev"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/touchscreen0"
+    Option        "USB"           "on"
+EndSection
+
+Section "Device"
+    Identifier    "Graphics Controller"
+    Driver        "fbdev"
+EndSection
+
+Section "Monitor"
+    Identifier    "Generic Monitor"
+    Option        "DPMS"
+    # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+    Modeline "1024x600_60.00"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
+    # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+    ModeLine "640x480"    25.2  640  656  752  800    480  490  492  525 -hsync -vsync
+    # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+    ModeLine "640x480"    31.5  640  664  704  832    480  489  491  520 -hsync -vsync
+    # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+    ModeLine "640x480"    31.5  640  656  720  840    480  481  484  500 -hsync -vsync
+    # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+    ModeLine "640x480"    36.0  640  696  752  832    480  481  484  509 -hsync -vsync
+EndSection
+
+Section "Screen"
+    Identifier    "Default Screen"
+    Device        "Graphics Controller"
+    Monitor        "Generic Monitor"
+    SubSection "Display"
+        Modes     "640x480"
+    EndSubSection
+EndSection
+
+Section "ServerLayout"
+    Identifier    "Default Layout"
+    Screen        "Default Screen"
+    InputDevice    "Generic Keyboard"
+    # InputDevice    "Configured Mouse"
+    InputDevice    "QEMU Tablet"
+    Option         "AllowEmptyInput" "no"
+EndSection
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf
new file mode 100644
index 0000000..bbda9ea
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86-64/xorg.conf
@@ -0,0 +1,64 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Generic Keyboard"
+    Driver        "evdev"
+    Option        "CoreKeyboard"
+    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+    Option        "XkbRules"    "xorg"
+    Option        "XkbModel"    "evdev"
+    Option        "XkbLayout"    "us"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Configured Mouse"
+    Driver        "vmmouse"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/mice"
+    Option        "Protocol"        "ImPS/2"
+    Option        "ZAxisMapping"        "4 5"
+    Option        "Emulate3Buttons"    "true"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Qemu Tablet"
+    Driver        "evdev"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/touchscreen0"
+    Option        "USB"           "on"
+EndSection
+
+Section "Monitor"
+    Identifier    "Generic Monitor"
+    Option        "DPMS"
+    # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+    Modeline "1024x600_60.00"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
+    # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+    ModeLine "640x480"    25.2  640  656  752  800    480  490  492  525 -hsync -vsync
+    # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+    ModeLine "640x480"    31.5  640  664  704  832    480  489  491  520 -hsync -vsync
+    # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+    ModeLine "640x480"    31.5  640  656  720  840    480  481  484  500 -hsync -vsync
+    # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+    ModeLine "640x480"    36.0  640  696  752  832    480  481  484  509 -hsync -vsync
+EndSection
+
+Section "Screen"
+    Identifier    "Default Screen"
+    Device        "Graphics Controller"
+    Monitor        "Generic Monitor"
+    SubSection "Display"
+        Modes     "640x480"
+    EndSubSection
+EndSection
+
+Section "ServerLayout"
+    Identifier    "Default Layout"
+    Screen        "Default Screen"
+    InputDevice    "Generic Keyboard"
+    # InputDevice    "Configured Mouse"
+    InputDevice    "QEMU Tablet"
+    Option         "AllowEmptyInput" "no"
+EndSection
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf
new file mode 100644
index 0000000..bbda9ea
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/qemux86/xorg.conf
@@ -0,0 +1,64 @@
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Generic Keyboard"
+    Driver        "evdev"
+    Option        "CoreKeyboard"
+    Option        "Device"      "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
+    Option        "XkbRules"    "xorg"
+    Option        "XkbModel"    "evdev"
+    Option        "XkbLayout"    "us"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Configured Mouse"
+    Driver        "vmmouse"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/mice"
+    Option        "Protocol"        "ImPS/2"
+    Option        "ZAxisMapping"        "4 5"
+    Option        "Emulate3Buttons"    "true"
+EndSection
+
+Section "InputDevice"
+    Identifier    "Qemu Tablet"
+    Driver        "evdev"
+    Option        "CorePointer"
+    Option        "Device"        "/dev/input/touchscreen0"
+    Option        "USB"           "on"
+EndSection
+
+Section "Monitor"
+    Identifier    "Generic Monitor"
+    Option        "DPMS"
+    # 1024x600 59.85 Hz (CVT) hsync: 37.35 kHz; pclk: 49.00 MHz
+    Modeline "1024x600_60.00"   49.00  1024 1072 1168 1312  600 603 613 624 -hsync +vsync
+    # 640x480 @ 60Hz (Industry standard) hsync: 31.5kHz
+    ModeLine "640x480"    25.2  640  656  752  800    480  490  492  525 -hsync -vsync
+    # 640x480 @ 72Hz (VESA) hsync: 37.9kHz
+    ModeLine "640x480"    31.5  640  664  704  832    480  489  491  520 -hsync -vsync
+    # 640x480 @ 75Hz (VESA) hsync: 37.5kHz
+    ModeLine "640x480"    31.5  640  656  720  840    480  481  484  500 -hsync -vsync
+    # 640x480 @ 85Hz (VESA) hsync: 43.3kHz
+    ModeLine "640x480"    36.0  640  696  752  832    480  481  484  509 -hsync -vsync
+EndSection
+
+Section "Screen"
+    Identifier    "Default Screen"
+    Device        "Graphics Controller"
+    Monitor        "Generic Monitor"
+    SubSection "Display"
+        Modes     "640x480"
+    EndSubSection
+EndSection
+
+Section "ServerLayout"
+    Identifier    "Default Layout"
+    Screen        "Default Screen"
+    InputDevice    "Generic Keyboard"
+    # InputDevice    "Configured Mouse"
+    InputDevice    "QEMU Tablet"
+    Option         "AllowEmptyInput" "no"
+EndSection
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config/xorg.conf
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
new file mode 100644
index 0000000..e07c204
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xf86-config_0.1.bb
@@ -0,0 +1,31 @@
+SUMMARY = "X.Org X server configuration file"
+HOMEPAGE = "http://www.x.org"
+SECTION = "x11/base"
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PR = "r33"
+
+SRC_URI = "file://xorg.conf"
+
+SRC_URI_append_libc-musl = "\
+          file://10-preload-modules.conf \
+"
+
+S = "${WORKDIR}"
+
+CONFFILES_${PN} = "${sysconfdir}/X11/xorg.conf"
+CONFFILES_${PN}_append_libc-musl = " ${sysconfdir}/X11/xorg.conf.d/10-preload-modules.conf"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+ALLOW_EMPTY_${PN} = "1"
+
+do_install () {
+	if test -s ${WORKDIR}/xorg.conf; then
+		install -d ${D}/${sysconfdir}/X11
+		install -m 0644 ${WORKDIR}/xorg.conf ${D}/${sysconfdir}/X11/
+	fi
+}
+
+do_install_append_libc-musl () {
+	install -Dm 0644 ${WORKDIR}/10-preload-modules.conf ${D}/${sysconfdir}/X11/xorg.conf.d/10-preload-modules.conf
+}
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
new file mode 100644
index 0000000..cc1c02b
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg.inc
@@ -0,0 +1,170 @@
+SUMMARY = "The X.Org X server"
+HOMEPAGE = "http://www.x.org"
+SECTION = "x11/base"
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5df87950af51ac2c5822094553ea1880"
+
+# xf86-*-* packages depend on an X server built with the xfree86 DDX
+# so we have a virtual to represent that:
+# deprecated, we should use virtual/xserver instead
+PROVIDES = "virtual/xserver-xf86"
+
+# Other packages tend to just care that there is *an* X server:
+PROVIDES += "virtual/xserver"
+
+PE = "2"
+INC_PR = "r8"
+
+XORG_PN = "xorg-server"
+SRC_URI = "${XORG_MIRROR}/individual/xserver/${XORG_PN}-${PV}.tar.bz2"
+SRC_URI += "file://macro_tweak.patch"
+
+S = "${WORKDIR}/${XORG_PN}-${PV}"
+
+inherit autotools pkgconfig
+
+PROTO_DEPS = "randrproto renderproto fixesproto damageproto xextproto xproto xf86dgaproto xf86miscproto xf86vidmodeproto compositeproto recordproto resourceproto videoproto scrnsaverproto  xineramaproto fontsproto kbproto inputproto bigreqsproto xcmiscproto presentproto"
+LIB_DEPS = "pixman libxfont xtrans libxau libxext libxdmcp libdrm libxkbfile libpciaccess openssl libgcrypt"
+DEPENDS = "${PROTO_DEPS} ${LIB_DEPS} font-util"
+
+# Split out some modules and extensions from the main package
+# These aren't needed for basic operations and only take up space:
+#  32.0k   libdri.so
+#  91.0k   libexa.so
+#  336.0k  libglx.so
+#  1360k   libint10.so
+#  180.0k  libwfb.so
+#  320.0k  libxaa.so
+#  124.0k  libxf1bpp.so
+#  84.0k   libxf4bpp.so
+#          librecord.so
+#          libextmod.so
+#          libdbe.so
+
+PACKAGES =+ "${PN}-security-policy \
+             ${PN}-sdl \
+             ${PN}-fbdev \
+             ${PN}-xvfb \
+             ${PN}-utils \
+             ${PN}-xephyr \
+             ${PN}-xwayland \
+             ${PN}-multimedia-modules \
+             ${PN}-extension-dri \
+             ${PN}-extension-dri2 \
+             ${PN}-extension-glx \
+             ${PN}-extension-record \
+             ${PN}-extension-extmod \
+             ${PN}-extension-dbe \
+             ${PN}-module-libint10 \
+             ${PN}-module-libafb \
+             ${PN}-module-libwfb  \
+             ${PN}-module-libmfb \
+             ${PN}-module-libcfb \
+             ${PN}-module-exa \
+             ${PN}-module-xaa \
+             ${PN}-module-libxf1bpp \
+             ${PN}-module-libxf4bpp \
+             xf86-video-modesetting"
+
+SUMMARY_xf86-video-modesetting = "X.Org X server -- modesetting display driver"
+INSANE_SKIP_xf86-video-modesetting = "xorg-driver-abi"
+
+RRECOMMENDS_${PN} += "${PN}-security-policy xkeyboard-config rgb xserver-xf86-config xkbcomp"
+RDEPENDS_${PN}-xvfb += "xkeyboard-config"
+RDEPENDS_${PN}-module-exa = "${PN} (= ${EXTENDPKGV})"
+
+FILES_${PN} = "${bindir} ${libdir}/X11/Options ${libdir}/X11/Cards ${libdir}/X11/getconfig ${libdir}/X11/etc ${libdir}/modules/*.so ${libdir}/xorg/modules/*.so /etc/X11 ${libdir}/xorg/protocol.txt ${datadir}/X11/xorg.conf.d"
+FILES_${PN}-dev += "${libdir}/xorg/modules/*.la ${libdir}/xorg/modules/*/*.la"
+FILES_${PN}-doc += "${libdir}/X11/doc ${datadir}/X11/xkb/compiled/README.compiled ${localstatedir}/lib/xkb/README.compiled"
+FILES_${PN}-dbg += "${libdir}/xorg/modules/.debug \
+                    ${libdir}/xorg/modules/*/.debug \
+                    ${libdir}/xorg/modules/*/*/.debug \
+                    "
+FILES_${PN}-security-policy += "${libdir}/xserver/SecurityPolicy"
+FILES_${PN}-sdl = "${bindir}/Xsdl"
+FILES_${PN}-fbdev = "${bindir}/Xfbdev"
+FILES_${PN}-xvfb = "${bindir}/Xvfb"
+FILES_${PN}-utils = "${bindir}/scanpci ${bindir}/pcitweak ${bindir}/ioport ${bindir}/in[bwl] ${bindir}/out[bwl] ${bindir}/mmap[rw] ${bindir}/gtf ${bindir}/getconfig ${bindir}/getconfig.pl"
+FILES_${PN}-xephyr = "${bindir}/Xephyr"
+FILES_${PN}-xwayland = "${bindir}/Xwayland"
+FILES_${PN}-multimedia-modules = "${libdir}/xorg/modules/multimedia/*drv*"
+FILES_${PN}-extension-dri = "${libdir}/xorg/modules/extensions/libdri.so"
+FILES_${PN}-extension-dri2 = "${libdir}/xorg/modules/extensions/libdri2.so"
+FILES_${PN}-extension-glx = "${libdir}/xorg/modules/extensions/libglx.so"
+FILES_${PN}-extension-record = "${libdir}/xorg/modules/extensions/librecord.so"
+FILES_${PN}-extension-extmod = "${libdir}/xorg/modules/extensions/libextmod.so"
+FILES_${PN}-extension-dbe = "${libdir}/xorg/modules/extensions/libdbe.so"
+FILES_${PN}-module-libint10 = "${libdir}/xorg/modules/libint10.so"
+FILES_${PN}-module-libafb = "${libdir}/xorg/modules/libafb.so"
+FILES_${PN}-module-libwfb = "${libdir}/xorg/modules/libwfb.so"
+FILES_${PN}-module-libmfb = "${libdir}/xorg/modules/libmfb.so"
+FILES_${PN}-module-libcfb = "${libdir}/xorg/modules/libcfb.so"
+FILES_${PN}-module-exa = "${libdir}/xorg/modules/libexa.so"
+FILES_${PN}-module-xaa = "${libdir}/xorg/modules/libxaa.so"
+FILES_${PN}-module-libxf1bpp = "${libdir}/xorg/modules/libxf1bpp.so"
+FILES_${PN}-module-libxf4bpp = "${libdir}/xorg/modules/libxf4bpp.so"
+FILES_xf86-video-modesetting = "${libdir}/xorg/modules/drivers/modesetting_drv.so"
+
+EXTRA_OECONF += "--with-fop=no \
+                 --with-pic \
+                 --disable-static \
+                 --disable-record \
+                 --disable-dmx \
+                 --disable-xnest \
+                 --enable-xvfb \
+                 --enable-composite \
+                 --without-dtrace \
+                 --with-int10=x86emu \
+                 --sysconfdir=/etc/X11 \
+                 --localstatedir=/var \
+                 --with-xkb-output=/var/lib/xkb \
+                 --with-sha1=libcrypto \
+"
+
+PACKAGECONFIG ??= "dri2 udev ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'dri glx', '', d)} \
+                   ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "xwayland", "", d)} \
+"
+
+PACKAGECONFIG[udev] = "--enable-config-udev,--disable-config-udev,udev"
+PACKAGECONFIG[dri] = "--enable-dri,--disable-dri,glproto virtual/mesa xf86driproto"
+PACKAGECONFIG[dri2] = "--enable-dri2,--disable-dri2,dri2proto"
+# DRI3 requires xshmfence to also be enabled
+PACKAGECONFIG[dri3] = "--enable-dri3,--disable-dri3,dri3proto"
+PACKAGECONFIG[glx] = "--enable-glx --enable-glx-tls,--disable-glx,glproto virtual/libgl virtual/libx11"
+PACKAGECONFIG[unwind] = "--enable-libunwind,--disable-libunwind,libunwind"
+PACKAGECONFIG[xshmfence] = "--enable-xshmfence,--disable-xshmfence,libxshmfence"
+PACKAGECONFIG[xmlto] = "--with-xmlto, --without-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+PACKAGECONFIG[systemd-logind] = "--enable-systemd-logind=yes,--enable-systemd-logind=no,dbus,"
+PACKAGECONFIG[xinerama] = "--enable-xinerama,--disable-xinerama,xineramaproto"
+PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland,wayland libepoxy"
+
+do_install_append () {
+	# Its assumed base-files creates this for us
+	rmdir ${D}${localstatedir}/log/
+}
+
+# Add runtime provides for the ABI versions of the video and input subsystems,
+# so that drivers can depend on the relevant version.
+python populate_packages_prepend() {
+    import subprocess
+
+    # Set PKG_CONFIG_PATH so pkg-config looks at the .pc files that are going
+    # into the new package, not the staged ones.
+    newenv = dict(os.environ)
+    newenv["PKG_CONFIG_PATH"] = d.expand("${PKGD}${libdir}/pkgconfig/")
+
+    def get_abi(name):
+        abis = {
+          "video": "abi_videodrv",
+          "input": "abi_xinput"
+        }
+        p = subprocess.Popen(args="pkg-config --variable=%s xorg-server" % abis[name],
+                             shell=True, env=newenv, stdout=subprocess.PIPE)
+        output = p.communicate()[0]
+        mlprefix = d.getVar('MLPREFIX', True) or ''
+        return "%sxorg-abi-%s-%s" % (mlprefix, name, output.split(".")[0])
+
+    pn = d.getVar("PN", True)
+    d.appendVar("RPROVIDES_" + pn, " " + get_abi("input"))
+    d.appendVar("RPROVIDES_" + pn, " " + get_abi("video"))
+}
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-use-__GLIBC__-guard-for-glibc-specific-code.patch b/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-use-__GLIBC__-guard-for-glibc-specific-code.patch
new file mode 100644
index 0000000..21e4ed4
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg/0001-use-__GLIBC__-guard-for-glibc-specific-code.patch
@@ -0,0 +1,31 @@
+From f242740f6488a25e6ca84968b0e2319a9a3975b4 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 20:52:50 -0700
+Subject: [PATCH] use __GLIBC__ guard for glibc specific code
+
+Using __linux__ is a tad bit wrong assumption since
+linux != glibc
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ hw/xfree86/os-support/xf86_OSlib.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/hw/xfree86/os-support/xf86_OSlib.h b/hw/xfree86/os-support/xf86_OSlib.h
+index eb0a338..c366ffc 100644
+--- a/hw/xfree86/os-support/xf86_OSlib.h
++++ b/hw/xfree86/os-support/xf86_OSlib.h
+@@ -178,7 +178,7 @@
+ #include <sys/types.h>
+ #include <assert.h>
+ 
+-#ifdef __linux__
++#ifdef __GLIBC__
+ #include <termio.h>
+ #else                           /* __GLIBC__ */
+ #include <termios.h>
+-- 
+2.1.4
+
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch b/meta/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch
new file mode 100644
index 0000000..ec0eea6
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg/macro_tweak.patch
@@ -0,0 +1,25 @@
+This is the revised version of files/macro_tweak.patch for
+xorg-server 1.8.99.904 and newer.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yu Ke <ke.yu@intel.com>
+
+diff --git a/xorg-server.m4 b/xorg-server.m4
+index bdecf62..040fdb8 100644
+--- a/xorg-server.m4
++++ b/xorg-server.m4
+@@ -28,10 +28,12 @@ dnl
+ # Checks for the $1 define in xorg-server.h (from the sdk).  If it
+ # is defined, then add $1 to $REQUIRED_MODULES.
+ 
++m4_pattern_allow(PKG_CONFIG_SYSROOT_DIR)
++
+ AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
+ 	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+ 	SAVE_CFLAGS="$CFLAGS"
+-	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
++	CFLAGS="$CFLAGS -I$PKG_CONFIG_SYSROOT_DIR`$PKG_CONFIG --variable=sdkdir xorg-server`"
+ 	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include "xorg-server.h"
+ #if !defined $1
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.17.2.bb b/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.17.2.bb
new file mode 100644
index 0000000..3039d30
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-xorg_1.17.2.bb
@@ -0,0 +1,28 @@
+require xserver-xorg.inc
+
+SRC_URI += "file://0001-use-__GLIBC__-guard-for-glibc-specific-code.patch \
+           "
+SRC_URI[md5sum] = "397e405566651150490ff493e463f1ad"
+SRC_URI[sha256sum] = "f61120612728f2c5034671d0ca3e2273438c60aba93b3dda4a8aa40e6a257993"
+
+# These extensions are now integrated into the server, so declare the migration
+# path for in-place upgrades.
+
+RREPLACES_${PN} =  "${PN}-extension-dri \
+                    ${PN}-extension-dri2 \
+                    ${PN}-extension-record \
+                    ${PN}-extension-extmod \
+                    ${PN}-extension-dbe \
+                   "
+RPROVIDES_${PN} =  "${PN}-extension-dri \
+                    ${PN}-extension-dri2 \
+                    ${PN}-extension-record \
+                    ${PN}-extension-extmod \
+                    ${PN}-extension-dbe \
+                   "
+RCONFLICTS_${PN} = "${PN}-extension-dri \
+                    ${PN}-extension-dri2 \
+                    ${PN}-extension-record \
+                    ${PN}-extension-extmod \
+                    ${PN}-extension-dbe \
+                   "
diff --git a/meta/recipes-graphics/xrestop/xrestop_0.4.bb b/meta/recipes-graphics/xrestop/xrestop_0.4.bb
new file mode 100644
index 0000000..ce5df03
--- /dev/null
+++ b/meta/recipes-graphics/xrestop/xrestop_0.4.bb
@@ -0,0 +1,24 @@
+SUMMARY = "XRes: A top-like resource usage tool for X"
+
+DESCRIPTION = "top-like statistics of X11 server resource usage by clients"
+
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/xrestop"
+BUGTRACKER = "https://bugs.freedesktop.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://xrestop.c;endline=18;md5=730876c30f0d8a928676bcd1242a3b35"
+
+SECTION = "x11/utils"
+PR = "r3"
+
+DEPENDS = "libxres libxext virtual/libx11 ncurses"
+
+SRC_URI = "http://downloads.yoctoproject.org/releases/xrestop/xrestop-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "d8a54596cbaf037e62b80c4585a3ca9b"
+SRC_URI[sha256sum] = "67c2fc94a7ecedbaae0d1837e82e93d1d98f4a6d759828860e552119af3ce257"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh b/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh
new file mode 100644
index 0000000..fa43617
--- /dev/null
+++ b/meta/recipes-graphics/xtscal/xtscal/30xTs_Calibrate.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+. /etc/formfactor/config
+
+if [ "$HAVE_TOUCHSCREEN" = "1" ]; then
+	n=1
+	while [ ! -z $TSLIB_TSDEVICE ] && [ ! -f /etc/pointercal ] && [ $n -le 5 ]
+	do
+	   /usr/bin/xtscal
+	   sleep 1
+	   n=$(($n+1))
+	done
+fi
diff --git a/meta/recipes-graphics/xtscal/xtscal/change-cross.patch b/meta/recipes-graphics/xtscal/xtscal/change-cross.patch
new file mode 100644
index 0000000..1da7717
--- /dev/null
+++ b/meta/recipes-graphics/xtscal/xtscal/change-cross.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+--- tmp/main.c.orig	2007-01-02 15:39:54.000000000 +0000
++++ tmp/main.c	2007-01-02 15:39:54.000000000 +0000
+@@ -131,9 +131,10 @@
+ {
+   XRenderFillRectangles (dpy, PictOpSrc, pict, &rect_color, rectangles, 2);
+ 
+-  XFillArc (dpy, crosshair_w, crosshair_gc, (CROSSHAIR_SIZE / 2) - (WIDTH / 2) - 1, 
+-	    (CROSSHAIR_SIZE / 2) - (WIDTH / 2) - 1,
+-	    WIDTH + 1, WIDTH + 1, 0, 360 * 64);
++  XFillRectangle (dpy, crosshair_w, crosshair_gc,
++		  (CROSSHAIR_SIZE / 2) - (WIDTH / 2),
++		  (CROSSHAIR_SIZE / 2) - (WIDTH / 2),
++		  WIDTH, WIDTH);
+ }
+ 
+ void
diff --git a/meta/recipes-graphics/xtscal/xtscal/cleanup.patch b/meta/recipes-graphics/xtscal/xtscal/cleanup.patch
new file mode 100644
index 0000000..f7b0854
--- /dev/null
+++ b/meta/recipes-graphics/xtscal/xtscal/cleanup.patch
@@ -0,0 +1,621 @@
+---
+ Makefile.am  |    9 --
+ configure.ac |    3 
+ gpe-dist.am  |   12 ---
+ h3600_ts.h   |  216 -----------------------------------------------------------
+ main.c       |  210 ++-------------------------------------------------------
+ xtscal.in    |   19 -----
+ 6 files changed, 14 insertions(+), 455 deletions(-)
+
+Upstream-Status: Pending
+
+Index: xtscal-0.6.3/xtscal.in
+===================================================================
+--- xtscal-0.6.3.orig/xtscal.in	2004-09-10 20:10:36.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,19 +0,0 @@
+-#!/bin/sh
+-
+-module_id() {
+-    # Get model name
+-    echo `grep "^Hardware" /proc/cpuinfo | sed -e "s/.*: *//" | tr a-z A-Z`
+-}
+-
+-case `module_id` in
+-	"HP IPAQ H3100" | "HP IPAQ H3800" )
+-		ARGS="-rotate 90" ;;
+-	"HP IPAQ H3600" | "HP IPAQ H3700" | "HP IPAQ H3900" | *COLLIE | *POODLE)
+-		ARGS="-rotate 270" ;;
+-	# H2200: works without rotation
+-esac
+-
+-# the things we do for autoconf
+-prefix=@prefix@
+-exec_prefix=@exec_prefix@
+-exec @libexecdir@/xtscal.bin $ARGS $*
+Index: xtscal-0.6.3/main.c
+===================================================================
+--- xtscal-0.6.3.orig/main.c	2007-07-01 01:12:52.000000000 +0100
++++ xtscal-0.6.3/main.c	2007-07-01 01:12:55.000000000 +0100
+@@ -22,12 +22,10 @@
+ #include <X11/Xlib.h>
+ 
+ #include <X11/extensions/Xrender.h>
+-#include <X11/extensions/Xrandr.h>
+ #include <X11/Xft/Xft.h>
+ #include <X11/extensions/xcalibrate.h>
+ #include <X11/keysym.h>
+ 
+-#include "h3600_ts.h"
+ #include "calibrate.h"
+ 
+ Display *dpy;
+@@ -45,15 +43,11 @@ XftColor xftcol;
+ XftDraw *xftdraw;
+ XftFont *xftfont;
+ int screen_x, screen_y;
+-int ts_fd;
+ int samples;
+ Pixmap bg_pixmap;
+ int flag_debug;
+-int rotation = 0;
+ int error_base, event_base;
+ 
+-int using_xcalibrate;
+-
+ int moving;
+ 
+ #define CROSSHAIR_SIZE	25
+@@ -63,7 +57,6 @@ int moving;
+ #define ENOUGH 5
+ #define MAX_SAMPLES 40
+ 
+-#define RAW_DEVICE "/dev/h3600_tsraw"
+ #define FONTNAME "sans-10"
+ 
+ struct point 
+@@ -287,12 +280,8 @@ sort_by_y (const void* a, const void *b)
+ void
+ set_calibration (calibration *cal)
+ {
+-  TS_CAL tc;
+-  int xtrans, ytrans, xscale, yscale, xyscale, yxscale;
+   calibration ocal = *cal;
+ 
+-  if (using_xcalibrate)
+-    {
+       FILE *fp;
+       if (flag_debug)
+ 	printf ("constants are: %d %d %d %d %d %d %d\n", cal->a[1], cal->a[2], cal->a[0], cal->a[4], cal->a[5], cal->a[3], cal->a[6]);
+@@ -304,29 +293,6 @@ set_calibration (calibration *cal)
+ 	}
+       fprintf (fp, "%d %d %d %d %d %d %d\n", cal->a[1], cal->a[2], cal->a[0], cal->a[4], cal->a[5], cal->a[3], cal->a[6]);
+       fclose (fp); 
+-      return;
+-    }
+-
+-  xtrans = cal->a[0] / cal->a[6];
+-  ytrans = cal->a[3] / cal->a[6];
+-  xscale = cal->a[1] * 256 / cal->a[6];
+-  yscale = cal->a[5] * 256 / cal->a[6];
+-  xyscale = cal->a[2] * 256 / cal->a[6];
+-  yxscale = cal->a[4] * 256 / cal->a[6];
+-  
+-  tc.xtrans = xtrans;
+-  tc.ytrans = ytrans;
+-  tc.xscale = xscale;
+-  tc.yscale = yscale;
+-  tc.xyswap = 0;
+-
+-  printf ("%d %d %d %d %d\n", tc.xscale, tc.xtrans, tc.yscale, tc.ytrans, tc.xyswap);
+-
+-  if (ioctl (ts_fd, TS_SET_CAL, (void *)&tc) != 0)
+-    {
+-      perror ("TS_SET_CAL");
+-      exit (1);
+-    }
+ }
+ 
+ void
+@@ -398,80 +364,13 @@ handle_ts_event (int x, int y, int press
+ }
+ 
+ void
+-read_ts (void)
+-{
+-  TS_EVENT ts_ev;
+-  int r;
+-
+-  r = read (ts_fd, &ts_ev, sizeof (ts_ev));
+-  if (r == sizeof (ts_ev))
+-    handle_ts_event (ts_ev.x, ts_ev.y, ts_ev.pressure);
+-}
+-
+-void
+-do_cal (char **args)
+-{
+-  TS_CAL tc;
+-
+-  tc.xscale = atoi (args[0]);
+-  tc.xtrans = atoi (args[1]);
+-  tc.yscale = atoi (args[2]);
+-  tc.ytrans = atoi (args[3]);
+-  tc.xyswap = atoi (args[4]);
+-
+-  if (flag_debug)
+-    fprintf (stderr, "setting: %d %d %d %d %d\n", 
+-	     tc.xtrans, tc.ytrans, tc.xscale, tc.yscale, tc.xyswap);
+-    
+-  if (ioctl (ts_fd, TS_SET_CAL, (void *)&tc) != 0)
+-    {
+-      perror ("TS_SET_CAL");
+-      exit (1);
+-    }
+-  
+-  exit (0);
+-}
+-
+-void
+-show_cal (void)
+-{
+-  TS_CAL tc;
+-
+-  if (ioctl (ts_fd, TS_GET_CAL, (void *)&tc) != 0)
+-    {
+-      perror ("TS_GET_CAL");
+-      exit (1);
+-    }
+-
+-  printf ("%d %d %d %d %d\n", tc.xscale, tc.xtrans, tc.yscale, tc.ytrans, tc.xyswap);
+-}
+-
+-void
+ usage (const char *name)
+ {
+-  fprintf (stderr, "usage: %s -view\n", name);
+-  fprintf (stderr, "       %s [-rotate <0 | 90 | 180 | 270>]\n", name);
+-  fprintf (stderr, "       %s -cal <xs> <xt> <ys> <yt> <xyswap>\n", name);
+-
++  fprintf (stderr, "usage: %s [-debug]\n", name);
+   exit (1);
+ }
+ 
+ int
+-xrr_supported (void)
+-{
+-  int xrr_event_base, xrr_error_base;
+-  int xrr_major, xrr_minor;
+-
+-  if (XRRQueryExtension (dpy, &xrr_event_base, &xrr_error_base) == False
+-      || XRRQueryVersion (dpy, &xrr_major, &xrr_minor) == 0
+-      || xrr_major != 1
+-      || xrr_minor < 1)
+-    return 0;
+-
+-  return 1;
+-}
+-
+-int
+ main (int argc, char *argv[])
+ {
+   XSetWindowAttributes attributes;
+@@ -480,31 +379,11 @@ main (int argc, char *argv[])
+   int max_fd;
+   GC bg_gc;
+   int i;
+-  int have_xrandr;
+ 
+   for (i = 1; i < argc; i++)
+     {
+-      if (!strcmp (argv[i], "-view"))
+-	{
+-	  show_cal ();
+-	  exit (0);
+-	}
+-      else if (!strcmp (argv[i], "-debug"))
++      if (!strcmp (argv[i], "-debug"))
+ 	flag_debug = 1;
+-      else if (!strcmp (argv[i], "-cal"))
+-	{
+-	  if (argc > (i + 5))
+-	    do_cal (argv + i + 1);
+-	  else
+-	    usage (argv[0]);
+-	}
+-      else if (!strcmp (argv[i], "-rotate"))
+-	{
+-	  if (argc > (i + 1))
+-	    rotation = atoi (argv[++i]);
+-	  else
+-	    usage (argv[0]);
+-	}
+       else
+ 	usage (argv[0]);
+     }
+@@ -531,48 +410,11 @@ main (int argc, char *argv[])
+ 	  fprintf (stderr, "failed to set raw mode: error %d\n", r);
+ 	  exit (1);
+ 	}
+-
+-      using_xcalibrate = 1;
+-    }
+-
+-  have_xrandr = xrr_supported ();
+-  if (have_xrandr)
+-    {
+-      XRRScreenConfiguration *rr_screen;
+-      Rotation current_rotation;
+-
+-      if (flag_debug)
+-	fprintf (stderr, "XRANDR is supported\n");
+-
+-      rr_screen = XRRGetScreenInfo (dpy, RootWindow (dpy, screen));
+-
+-      XRRRotations (dpy, screen, &current_rotation);
+-
+-      XRRFreeScreenConfigInfo (rr_screen);
+-
+-      if (flag_debug)
+-	fprintf (stderr, "Current RANDR rotation is %d\n", current_rotation);
+-
+-      switch (current_rotation)
+-	{
+-	case RR_Rotate_270:
+-	  rotation += 90;
+-	case RR_Rotate_180:
+-	  rotation += 90;
+-	case RR_Rotate_90:
+-	  rotation += 90;
+-	  rotation %= 360;
+-	case RR_Rotate_0:
+-	  break;
+-	default:
+-	  fprintf (stderr, "Unknown RANDR rotation: %d\n", current_rotation);
+-	  break;
+-	}
+     }
+   else
+     {
+-      if (flag_debug)
+-	fprintf (stderr, "XRANDR not supported\n");
++      perror ("XCALIBRATE extension missing");
++      exit (1);
+     }
+ 
+   attributes.override_redirect = flag_debug ? False : True;
+@@ -666,45 +508,17 @@ main (int argc, char *argv[])
+ 
+   for (i = 0; i < NR_POINTS; i++)
+     {
+-      switch (rotation)
+-	{
+-	case 0:
+-	  cal.xfb[i] = cal.xscr[i];
+-	  cal.yfb[i] = cal.yscr[i];
+-	  break;
+-	case 90:
+-	  cal.xfb[i] = cal.yscr[i];
+-	  cal.yfb[i] = screen_x - cal.xscr[i];
+-	  break;
+-	case 180:
+-	  cal.xfb[i] = screen_x - cal.xscr[i];
+-	  cal.yfb[i] = screen_y - cal.yscr[i];
+-	  break;
+-	case 270:
+-	  cal.xfb[i] = screen_y - cal.yscr[i];
+-	  cal.yfb[i] = cal.xscr[i];
+-	  break;
+-	}
++      cal.xfb[i] = cal.xscr[i];
++      cal.yfb[i] = cal.yscr[i];
++      XCalibrateScreenToCoord (dpy, &cal.xfb[i], &cal.yfb[i]);
+ 
+       if (flag_debug)
+-	printf ("rotation %d: (%d,%d) -> (%d,%d)\n", rotation, 
++	printf ("rotation conversion: (%d,%d) -> (%d,%d)\n",
+ 		cal.xscr[i], cal.yscr[i], cal.xfb[i], cal.yfb[i]);
+     }
+ 
+   next_event ();
+ 
+-  if (!using_xcalibrate)
+-    {
+-      ts_fd = open (RAW_DEVICE, O_RDONLY);
+-      if (ts_fd < 0)
+-	{
+-	  perror (RAW_DEVICE);
+-	  exit (1);
+-	}
+-    }
+-
+-  max_fd = (xfd > ts_fd) ? xfd : ts_fd;
+-
+   for (;;)
+     {
+       fd_set fds;
+@@ -713,12 +527,8 @@ main (int argc, char *argv[])
+ 
+       FD_ZERO (&fds);
+       FD_SET (xfd, &fds);
+-      if (ts_fd != -1)
+-	FD_SET (ts_fd, &fds);
+ 
+-      select (max_fd + 1, &fds, NULL, NULL, NULL);
+-      
+-      if (ts_fd != -1 && FD_ISSET (ts_fd, &fds))
+-	read_ts ();
++      select (xfd + 1, &fds, NULL, NULL, NULL);
+     }
+ }
++
+Index: xtscal-0.6.3/configure.ac
+===================================================================
+--- xtscal-0.6.3.orig/configure.ac	2004-09-10 20:11:12.000000000 +0100
++++ xtscal-0.6.3/configure.ac	2007-07-01 01:12:55.000000000 +0100
+@@ -9,8 +9,7 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2])
+ # Checks for programs.
+ AC_PROG_CC
+ 
+-PKG_CHECK_MODULES(XTSCAL, x11 xft xext xrandr xcalibrate)
++PKG_CHECK_MODULES(XTSCAL, x11 xft xext xcalibrate)
+ 
+ AC_CONFIG_FILES([Makefile])
+-AC_CONFIG_FILES([xtscal])
+ AC_OUTPUT
+Index: xtscal-0.6.3/gpe-dist.am
+===================================================================
+--- xtscal-0.6.3.orig/gpe-dist.am	2004-06-02 23:07:13.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,12 +0,0 @@
+-CVSTAG := $(shell echo $(PACKAGE)-$(VERSION) | tr [a-z.] [A-Z_])
+-
+-dist-upload: dist
+-	scp $(PACKAGE)-$(VERSION).tar.bz2 $(USER)@handhelds.org:/home/ftp/pub/projects/gpe/source/
+-
+-tag:
+-	cvs tag $(CVSTAG)
+-
+-retag:
+-	cvs tag -F $(CVSTAG)
+-
+-source: tag dist-upload
+Index: xtscal-0.6.3/h3600_ts.h
+===================================================================
+--- xtscal-0.6.3.orig/h3600_ts.h	2003-07-05 17:27:10.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,216 +0,0 @@
+-/*
+-*
+-* Driver for the H3600 Touch Screen and other Atmel controlled devices.
+-*
+-* Copyright 2000 Compaq Computer Corporation.
+-*
+-* Use consistent with the GNU GPL is permitted,
+-* provided that this copyright notice is
+-* preserved in its entirety in all copies and derived works.
+-*
+-* COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
+-* AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
+-* FITNESS FOR ANY PARTICULAR PURPOSE.
+-*
+-* Author: Charles Flynn.
+-*
+-*/
+-
+-
+-#ifndef __H3600_TS_H__
+-#define __H3600_TS_H__
+-
+-#include <linux/ioctl.h>
+-
+-enum h3600_ts_minor_devices {
+-	TS_MINOR    = 0,
+-	TSRAW_MINOR = 1,
+-	KEY_MINOR   = 2
+-};
+-
+-typedef struct h3600_ts_calibration {
+-        int xscale;
+-        int xtrans;
+-        int yscale;
+-        int ytrans;
+-        int xyswap;
+-} TS_CAL;
+-
+-typedef struct h3600_ts_event {
+-        unsigned short pressure;
+-        unsigned short x;
+-        unsigned short y;
+-        unsigned short pad;
+-} TS_EVENT;
+-
+-/* Deprecated - do not use */
+-typedef struct h3600_ts_return {
+-        unsigned short pressure;
+-        unsigned short x;
+-        unsigned short y;
+-        unsigned short pad;
+-} TS_RET;
+-
+-enum power_button_mode {
+-   PBM_SUSPEND           = 0,
+-   PBM_GENERATE_KEYPRESS = 1
+-};
+-
+-
+-/* ++++++++++++++ +++++++++++++++++++++++++++++++++++++ */
+-
+-typedef struct therm_dev {
+-	short data;
+-} THERM_DEV;
+-
+-#define H3600_BATT_CHEM_ALKALINE        0x01
+-#define H3600_BATT_CHEM_NICD            0x02
+-#define H3600_BATT_CHEM_NIMH            0x03
+-#define H3600_BATT_CHEM_LION            0x04
+-#define H3600_BATT_CHEM_LIPOLY          0x05
+-#define H3600_BATT_CHEM_NOT_INSTALLED   0x06
+-#define H3600_BATT_CHEM_UNKNOWN         0xff
+-
+-/* These should match the apm_bios.h definitions */
+-#define H3600_AC_STATUS_AC_OFFLINE	0x00
+-#define H3600_AC_STATUS_AC_ONLINE	0x01
+-#define H3600_AC_STATUS_AC_BACKUP	0x02   /* What does this mean? */
+-#define H3600_AC_STATUS_AC_UNKNOWN	0xff
+-
+-/* These bitfields are rarely "or'd" together */
+-#define H3600_BATT_STATUS_HIGH		0x01
+-#define H3600_BATT_STATUS_LOW		0x02
+-#define H3600_BATT_STATUS_CRITICAL	0x04
+-#define H3600_BATT_STATUS_CHARGING	0x08
+-#define H3600_BATT_STATUS_CHARGE_MAIN   0x10
+-#define H3600_BATT_STATUS_DEAD          0x20   /* Battery will not charge */
+-#define H3600_BATT_NOT_INSTALLED        0x20   /* For expansion pack batteries */
+-#define H3600_BATT_STATUS_FULL          0x40   /* Battery fully charged (and connected to AC) */
+-#define H3600_BATT_STATUS_NOBATT	0x80
+-#define H3600_BATT_STATUS_UNKNOWN	0xff
+-
+-struct battery_data {
+-	unsigned char  chemistry;
+-	unsigned char  status;
+-	unsigned short voltage;    /* Voltage for battery #0; unknown for battery #1 */
+-	unsigned short percentage; /* Percentage of full charge */
+-	unsigned short life;       /* Life remaining in minutes */
+-};
+-
+-struct h3600_battery {
+-        unsigned char       ac_status;
+-	unsigned char       battery_count;  /* How many batteries we have */
+-	struct battery_data battery[2];
+-};
+-
+-/* -------- EEPROM and SPI Interfaces ---------------*/
+-
+-#define EEPROM_RD_BUFSIZ 6	/* EEPROM reads are 16 bits */
+-#define EEPROM_WR_BUFSIZ 5	/* Allow room for 8bit 'addr' field in buffer*/ 
+-#define SPI_RD_BUFSIZ	 16	/* SPI reads are 8 bits */
+-#define SPI_WR_BUFSIZ	 7
+-
+-/* The EEPROM is where internal programs are stored on the Amtel.
+-   You probably don't want to read or write these values */
+-
+-typedef struct h3600_eeprom_read_request {
+-	unsigned char addr;    /* 8bit Address Offset 0-255 */
+-	unsigned char len;     /* Number of 16bit words to read 0-128  */
+-	unsigned short buff[EEPROM_RD_BUFSIZ];
+-} EEPROM_READ;
+-
+-typedef struct h3600_eeprom_write_request {
+-	unsigned char len;	/* used only to compute the number of bytes to send */
+-	unsigned char addr;    /* 0-128  */
+-	unsigned short buff[EEPROM_WR_BUFSIZ];
+-} EEPROM_WRITE;
+-
+-/* The SPI bus connects to EEPROMs located on sleeves plugged into
+-   the iPAQ.  You may want to read these values  */
+-
+-typedef struct h3600_spi_read_request {
+-	unsigned short addr;    /* 16bit Address Offset 0-128 */
+-	unsigned char len;      /* Number of bytes to read */
+-	unsigned char buff[SPI_RD_BUFSIZ];
+-} SPI_READ;
+-
+-#define SPI_READ_STATUS_BYTE  0xffff   /* Use this address to read the status byte */
+-
+-typedef struct h3600_spi_write_request {
+-	unsigned short len;	/* used only to compute the number of bytes to send */
+-	unsigned short addr;	/* this 16bit address accesses a single byte */
+-	unsigned char  buff[SPI_WR_BUFSIZ];
+-} SPI_WRITE;
+-
+-
+-/* -------- end of EEPROM and SPI Interfaces ---------------*/
+-
+-/* User space structures for IOCTL calls */
+-
+-typedef struct h3600_ts_version {
+-	unsigned char host_version[8];	/* ascii "x.yy" */
+-	unsigned char pack_version[8];	/* ascii "x.yy" */
+-	unsigned char boot_type;		/* TODO ?? */
+-} VER_RET;
+-
+-typedef struct h3600_ts_led {
+-        unsigned char OffOnBlink;       /* 0=off 1=on 2=Blink */
+-        unsigned char TotalTime;        /* Units of 5 seconds */
+-        unsigned char OnTime;           /* units of 100m/s */
+-        unsigned char OffTime;          /* units of 100m/s */
+-} LED_IN;
+-
+-enum flite_mode {
+-        FLITE_MODE1 = 1,
+-	FLITE_AUTO_MODE   = 1,     /* for reference only */
+-	FLITE_MANUAL_MODE = 2,     /* Use this normally? */
+-	FLITE_GET_LIGHT_SENSOR = 3 /* Returns light reading in "brightness" field */
+-};
+-enum flite_pwr {
+-        FLITE_PWR_OFF = 0,
+-        FLITE_PWR_ON  = 1
+-};
+-
+-typedef struct h3600_ts_flite {
+-        unsigned char mode;
+-        unsigned char pwr;
+-        unsigned char brightness;
+-} FLITE_IN;
+-
+-/*************************** Updated "universal" structures *******************/
+-
+-/* Sets backlight for both H3100 and H3600 models - technically "frontlight" for H3600 */
+-struct h3600_ts_backlight {
+-	enum flite_pwr power;          /* 0 = off, 1 = on */
+-	unsigned char  brightness;     /* 0 - 255         */
+-};
+-
+-struct h3600_ts_contrast {            /* Only useful on H3100 model */
+-	unsigned char contrast;       /* 0 - 255 */
+-};
+-
+-/* IOCTL cmds  user or kernel space */
+-
+-/* Use 'f' as magic number */
+-#define IOC_H3600_TS_MAGIC  'f'
+-
+-/* TODO: Some of these IOWR values are just plain wrong */
+-#define GET_VERSION		_IOR(IOC_H3600_TS_MAGIC,  1, struct h3600_ts_version )
+-#define READ_EEPROM		_IOWR(IOC_H3600_TS_MAGIC, 2, struct h3600_eeprom_read_request)
+-#define WRITE_EEPROM		_IOWR(IOC_H3600_TS_MAGIC, 3, struct h3600_eeprom_write_request)
+-#define GET_THERMAL		_IOR(IOC_H3600_TS_MAGIC,  4, struct therm_dev)
+-#define LED_ON			_IOW(IOC_H3600_TS_MAGIC,  5, struct h3600_ts_led)
+-#define GET_BATTERY_STATUS	_IOR(IOC_H3600_TS_MAGIC,  6, struct h3600_battery)
+-#define FLITE_ON		_IOW(IOC_H3600_TS_MAGIC,  7, struct h3600_ts_flite)
+-#define READ_SPI		_IOWR(IOC_H3600_TS_MAGIC, 8, struct h3600_spi_read_request)
+-#define WRITE_SPI		_IOWR(IOC_H3600_TS_MAGIC, 9, struct h3600_spi_write_request)
+-#define TS_GET_CAL		_IOR(IOC_H3600_TS_MAGIC, 10, struct h3600_ts_calibration)
+-#define TS_SET_CAL		_IOW(IOC_H3600_TS_MAGIC, 11, struct h3600_ts_calibration)
+-
+-/* New IOCTL interfaces - defined to be more user friendly */
+-#define TS_GET_BACKLIGHT        _IOR(IOC_H3600_TS_MAGIC, 20, struct h3600_ts_backlight)
+-#define TS_SET_BACKLIGHT        _IOW(IOC_H3600_TS_MAGIC, 20, struct h3600_ts_backlight)
+-#define TS_GET_CONTRAST         _IOR(IOC_H3600_TS_MAGIC, 21, struct h3600_ts_contrast)
+-#define TS_SET_CONTRAST         _IOW(IOC_H3600_TS_MAGIC, 21, struct h3600_ts_contrast)
+-
+-#endif
+Index: xtscal-0.6.3/Makefile.am
+===================================================================
+--- xtscal-0.6.3.orig/Makefile.am	2004-06-02 23:07:13.000000000 +0100
++++ xtscal-0.6.3/Makefile.am	2007-07-02 12:51:02.000000000 +0100
+@@ -1,11 +1,8 @@
+-libexec_PROGRAMS = xtscal.bin
+-bin_SCRIPTS = xtscal
++bin_PROGRAMS = xtscal
+ 
+-xtscal_bin_SOURCES = main.c calibrate.c calibrate.h h3600_ts.h
++xtscal_SOURCES = main.c calibrate.c calibrate.h
+ 
+-xtscal_bin_LDADD = @XTSCAL_LIBS@
++xtscal_LDADD = @XTSCAL_LIBS@
+ 
+ INCLUDES = @XTSCAL_CFLAGS@ -DNR_POINTS=5
+ 
+-include gpe-dist.am
+-
diff --git a/meta/recipes-graphics/xtscal/xtscal/dso_linking_change_build_fix.patch b/meta/recipes-graphics/xtscal/xtscal/dso_linking_change_build_fix.patch
new file mode 100644
index 0000000..3e4533f
--- /dev/null
+++ b/meta/recipes-graphics/xtscal/xtscal/dso_linking_change_build_fix.patch
@@ -0,0 +1,27 @@
+after gcc linking has changed, all the libraries must be explicitely specified 
+This patch avoids this linking error:
+
+| ccache i586-poky-linux-gcc -march=i586 --sysroot=/disk0/pokybuild/build1/tmp/sysroots/i586-poky-linux  -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o xtscal main.o calibrate.o -lX11 -lXft -lXext -lXcalibrate^M
+| /disk0/pokybuild/build1/tmp/sysroots/x86_64-linux/usr/libexec/i586-poky-linux/gcc/i586-poky-linux/4.5.1/ld: ^?: invalid DSO for symbol `XRenderChangePicture' definition^M
+| /disk0/pokybuild/build1/tmp/sysroots/i586-poky-linux/usr/lib/libXrender.so.1: could not read symbols: Bad value^M
+| collect2: ld returned 1 exit status^M
+| make: *** [xtscal] Error 1
+
+Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2011/01/11
+
+Upstream-Status: Pending
+
+Index: xtscal-0.6.3/configure.ac
+===================================================================
+--- xtscal-0.6.3.orig/configure.ac
++++ xtscal-0.6.3/configure.ac
+@@ -9,7 +9,7 @@ AM_INIT_AUTOMAKE([foreign dist-bzip2])
+ # Checks for programs.
+ AC_PROG_CC
+ 
+-PKG_CHECK_MODULES(XTSCAL, x11 xft xext xcalibrate)
++PKG_CHECK_MODULES(XTSCAL, x11 xft xext xcalibrate xrender)
+ 
+ AC_CONFIG_FILES([Makefile])
+ AC_OUTPUT
diff --git a/meta/recipes-graphics/xtscal/xtscal_0.6.3.bb b/meta/recipes-graphics/xtscal/xtscal_0.6.3.bb
new file mode 100644
index 0000000..4bfddf0
--- /dev/null
+++ b/meta/recipes-graphics/xtscal/xtscal_0.6.3.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Touchscreen calibration utility"
+
+DESCRIPTION = "Basic touchscreen calibration utility"
+
+HOMEPAGE = "http://gpe.linuxtogo.org"
+BUGTRACKER = "http://bugs.linuxtogo.org"
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://main.c;endline=10;md5=8721bcb08ae9f24e5fe4c82941873c87"
+
+SECTION = "x11/base"
+
+DEPENDS = "virtual/libx11 libxft libxcalibrate"
+
+PR = "r13"
+
+SRC_URI = "${GPE_MIRROR}/xtscal-${PV}.tar.bz2 \
+           file://change-cross.patch \
+           file://cleanup.patch \
+           file://dso_linking_change_build_fix.patch \
+           file://30xTs_Calibrate.sh"
+
+SRC_URI[md5sum] = "9bcab80b474d5454477d1ca166a68c34"
+SRC_URI[sha256sum] = "27b9dc2203de9b1706ca39fa6ca80ecab8807909ec901c4a345b8e41178800a1"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+do_install_append() {
+    install -d ${D}${sysconfdir}/X11/Xsession.d/
+    install -m 0755 ${WORKDIR}/30xTs_Calibrate.sh ${D}${sysconfdir}/X11/Xsession.d/
+}
diff --git a/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb b/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb
new file mode 100644
index 0000000..9b3c9e0
--- /dev/null
+++ b/meta/recipes-graphics/xvideo-tests/xvideo-tests_git.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Simple XVideo test application"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://src/test-xvideo.c;beginline=1;endline=20;md5=6ae3b4c3c2ff9e51dbbc35bb237afa00"
+DEPENDS = "libxv"
+
+SRCREV = "f8f320d0254c09ce483fc1d8ee99ecf5bc940965"
+PV = "0.1+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/test-xvideo"
+
+S = "${WORKDIR}/git"
+
+inherit autotools distro_features_check
+
+# The libxv requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-kernel/blktrace/blktrace/ldflags.patch b/meta/recipes-kernel/blktrace/blktrace/ldflags.patch
new file mode 100644
index 0000000..037d161
--- /dev/null
+++ b/meta/recipes-kernel/blktrace/blktrace/ldflags.patch
@@ -0,0 +1,93 @@
+blktrace: obey LDFLAGS
+
+Upstream-Status: Pending
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+
+the patch was imported from meta-mentor layer on yoctoproject git server
+http://git.yoctoproject.org/cgit/cgit.cgi/meta-mentor as of commit id
+aed463414e2e2bf8ca44ba54ee5973e7ed599e57
+
+Signed-off-by: Fahad Usman <fahad_usman@mentor.com>
+---
+ Makefile          |   11 ++++++-----
+ btreplay/Makefile |    3 ++-
+ btt/Makefile      |    3 ++-
+ 3 files changed, 10 insertions(+), 7 deletions(-)
+
+--- git.orig/Makefile
++++ git/Makefile
+@@ -1,5 +1,6 @@
+ CC	= gcc
+ CFLAGS	= -Wall -O2 -g -W
++LDFLAGS =
+ ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ PROGS	= blkparse blktrace verify_blkparse blkrawverify blkiomon
+ LIBS	= -lpthread
+@@ -23,19 +24,19 @@ btreplay/btreplay:
+ 	$(CC) -o $*.o -c $(ALL_CFLAGS) $<
+ 
+ blkparse: blkparse.o blkparse_fmt.o rbtree.o act_mask.o
+-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
++	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+ 
+ blktrace: blktrace.o act_mask.o
+-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
++	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
+ 
+ verify_blkparse: verify_blkparse.o
+-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
++	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+ 
+ blkrawverify: blkrawverify.o
+-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^)
++	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+ 
+ blkiomon: blkiomon.o rbtree.o
+-	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) -lrt
++	$(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) -lrt $(LDFLAGS)
+ 
+ $(PROGS): | depend
+ 
+--- git.orig/btreplay/Makefile
++++ git/btreplay/Makefile
+@@ -7,6 +7,7 @@
+ 
+ CC	= gcc
+ CFLAGS	= -Wall -W -O2 -g
++LDFLAGS =
+ INCS	= -I. -I.. -I../btt
+ OCFLAGS	= -UCOUNT_IOS -UDEBUG -DNDEBUG
+ XCFLAGS	= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+@@ -32,10 +33,10 @@ clean: docsclean
+	$(CC) $(CFLAGS) -c -o $*.o $<
+
+ btrecord: btrecord.o
+-	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^)
++	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LDFLAGS)
+ 
+ btreplay: btreplay.o
+-	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
++	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
+ 
+ depend:
+ 	@$(CC) -MM $(CFLAGS) *.c 1> .depend
+--- git.orig/btt/Makefile
++++ git/btt/Makefile
+@@ -7,6 +7,7 @@
+ 
+ CC	= gcc
+ CFLAGS	= -Wall -W -O2 -g
++LDFLAGS =
+ INCS	= -I. -I..
+ XCFLAGS	= -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+ override CFLAGS += $(INCS) $(XCFLAGS)
+@@ -38,7 +39,7 @@ clean: docsclean
+ 	$(CC) $(CFLAGS) -c -o $*.o $<
+ 
+ btt: $(OBJS)
+-	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
++	$(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS) $(LDFLAGS)
+ 
+ ifneq ($(wildcard .depend),)
+ include .depend
diff --git a/meta/recipes-kernel/blktrace/blktrace_git.bb b/meta/recipes-kernel/blktrace/blktrace_git.bb
new file mode 100644
index 0000000..5b0be42
--- /dev/null
+++ b/meta/recipes-kernel/blktrace/blktrace_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Generates traces of I/O traffic on block devices"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
+
+DEPENDS = "libaio"
+
+SRCREV = "43fc870ce04e963def45dfc0d1ed4ea21ef10d4b"
+
+PV = "1.1.0+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.dk/blktrace.git \
+           file://ldflags.patch"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "\
+    'CC=${CC}' \
+    'CFLAGS=${CFLAGS}' \
+    'LDFLAGS=${LDFLAGS}' \
+"
+
+# There are a few parallel issues:
+# 1) ../rbtree.o: error adding symbols: Invalid operation
+# collect2: error: ld returned 1 exit status
+# Makefile:42: recipe for target 'btt' failed
+# 2) git/blkiomon.c:216: undefined reference to `rb_insert_color'
+# collect2: error: ld returned 1 exit status
+# Makefile:27: recipe for target 'blkparse' failed
+# 3) ld: rbtree.o: invalid string offset 128 >= 125 for section `.strtab'
+# 4) btreplay.o: file not recognized: File truncated
+# collect2: error: ld returned 1 exit status
+# btreplay/btreplay.c:47:18: fatal error: list.h: No such file or directory
+PARALLEL_MAKE = ""
+
+do_install() {
+	oe_runmake ARCH="${ARCH}" prefix=${prefix} \
+		mandir=${mandir} DESTDIR=${D} install
+}
+
diff --git a/meta/recipes-kernel/cryptodev/cryptodev-linux_1.7.bb b/meta/recipes-kernel/cryptodev/cryptodev-linux_1.7.bb
new file mode 100644
index 0000000..a33841d
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/cryptodev-linux_1.7.bb
@@ -0,0 +1,13 @@
+require cryptodev_${PV}.inc
+
+SUMMARY = "A /dev/crypto device driver header file"
+
+do_compile[noexec] = "1"
+
+# Just install cryptodev.h which is the only header file needed to be exported
+do_install() {
+	install -D ${S}/crypto/cryptodev.h ${D}${includedir}/crypto/cryptodev.h
+}
+
+ALLOW_EMPTY_${PN} = "1"
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-kernel/cryptodev/cryptodev-module_1.7.bb b/meta/recipes-kernel/cryptodev/cryptodev-module_1.7.bb
new file mode 100644
index 0000000..5cd52eb
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/cryptodev-module_1.7.bb
@@ -0,0 +1,18 @@
+require cryptodev_${PV}.inc
+
+SUMMARY = "A /dev/crypto device driver kernel module"
+
+inherit module
+
+# Header file provided by a separate package
+DEPENDS += "cryptodev-linux"
+
+SRC_URI += " \
+file://0001-Disable-installing-header-file-provided-by-another-p.patch \
+file://0001-ioctl.c-Fix-build-on-3.19.patch \
+"
+
+EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"'
+
+RCONFLICTS_${PN} = "ocf-linux"
+RREPLACES_${PN} = "ocf-linux"
diff --git a/meta/recipes-kernel/cryptodev/cryptodev-tests_1.7.bb b/meta/recipes-kernel/cryptodev/cryptodev-tests_1.7.bb
new file mode 100644
index 0000000..efc41ae
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/cryptodev-tests_1.7.bb
@@ -0,0 +1,23 @@
+require cryptodev_${PV}.inc
+
+SUMMARY = "A test suite for /dev/crypto device driver"
+
+DEPENDS += "openssl"
+
+SRC_URI += " \
+file://0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch \
+file://0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch \
+"
+
+EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"'
+
+do_compile() {
+	oe_runmake testprogs
+}
+
+do_install() {
+	oe_runmake install_tests
+}
+
+FILES_${PN}-dbg += "${bindir}/tests_cryptodev/.debug"
+FILES_${PN} = "${bindir}/tests_cryptodev/*"
diff --git a/meta/recipes-kernel/cryptodev/cryptodev_1.7.inc b/meta/recipes-kernel/cryptodev/cryptodev_1.7.inc
new file mode 100644
index 0000000..cca6925
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/cryptodev_1.7.inc
@@ -0,0 +1,13 @@
+HOMEPAGE = "http://cryptodev-linux.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+SRC_URI = "http://download.gna.org/cryptodev-linux/cryptodev-linux-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "0b63b3481cf2c90386b35f057481d36b"
+SRC_URI[sha256sum] = "41880533b53de4d7b3f054e230f576988dafb8eed7bef5ebcf6422bb2e3a3b25"
+
+S = "${WORKDIR}/cryptodev-linux-${PV}"
+
+CLEANBROKEN = "1"
diff --git a/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch b/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
new file mode 100644
index 0000000..3f0298b
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/files/0001-Add-the-compile-and-install-rules-for-cryptodev-test.patch
@@ -0,0 +1,66 @@
+From 1980a8f4779a955e73285e7a0d86549b69bea5c8 Mon Sep 17 00:00:00 2001
+From: Yu Zongchun <b40527@freescale.com>
+Date: Sun, 28 Apr 2013 14:39:22 +0800
+Subject: [PATCH] Add the compile and install rules for cryptodev tests folder
+
+This is required to install the cryptodev tests folder to rootfs
+
+Signed-off-by: Yu Zongchun <b40527@freescale.com>
+
+Upstream-Status: Pending
+
+---
+ Makefile       |    6 ++++++
+ tests/Makefile |    8 ++++++++
+ 2 files changed, 14 insertions(+), 0 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 31c4b3f..2ecf2a9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -34,6 +34,9 @@ modules_install:
+ 	@echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..."
+ 	@install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h
+ 
++install_tests:
++	make -C tests install DESTDIR=$(PREFIX)
++
+ clean:
+ 	make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean
+ 	rm -f $(hostprogs) *~
+@@ -42,6 +45,9 @@ clean:
+ check:
+ 	CFLAGS=$(CRYPTODEV_CFLAGS) KERNEL_DIR=$(KERNEL_DIR) make -C tests check
+ 
++testprogs:
++	KERNEL_DIR=$(KERNEL_DIR) make -C tests testprogs
++
+ CPOPTS =
+ ifneq (${SHOW_TYPES},)
+ CPOPTS += --show-types
+diff --git a/tests/Makefile b/tests/Makefile
+index c9f04e8..cd202af 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -19,6 +19,12 @@ example-async-hmac-objs := async_hmac.o
+ example-async-speed-objs := async_speed.o
+ example-hashcrypt-speed-objs := hashcrypt_speed.c
+ 
++install:
++	install -d  $(DESTDIR)/usr/bin/tests_cryptodev
++	for bin in $(hostprogs); do \
++		install -m 755 $${bin} $(DESTDIR)/usr/bin/tests_cryptodev/; \
++	done
++
+ check: $(hostprogs)
+ 	./cipher
+ 	./hmac
+@@ -28,6 +34,8 @@ check: $(hostprogs)
+ 	./cipher-gcm
+ 	./cipher-aead
+ 
++testprogs: $(hostprogs)
++
+ clean:
+ 	rm -f *.o *~ $(hostprogs)
+ 
diff --git a/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch b/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch
new file mode 100644
index 0000000..a580fc6
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/files/0001-Disable-installing-header-file-provided-by-another-p.patch
@@ -0,0 +1,28 @@
+From 8a884f55bd1527baa82fab68c186ba546273860c Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@ti.com>
+Date: Sun, 6 Apr 2014 19:51:39 -0400
+Subject: [PATCH] Disable installing header file provided by another package
+
+Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+
+Upstream-Status: Inappropriate [ OE specific ]
+---
+ Makefile | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d66ef26..8e97c6a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,8 +23,6 @@ install: modules_install
+ 
+ modules_install:
+ 	make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules_install
+-	@echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..."
+-	@install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h
+ 
+ clean:
+ 	make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-on-3.19.patch b/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-on-3.19.patch
new file mode 100644
index 0000000..74c8972
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/files/0001-ioctl.c-Fix-build-on-3.19.patch
@@ -0,0 +1,29 @@
+From 7d71124991030f99965e6e6aaed421115f185adb Mon Sep 17 00:00:00 2001
+From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+Date: Mon, 9 Feb 2015 13:51:56 +0100
+Subject: [PATCH] ioctl.c: Fix build on 3.19
+
+get_unused_fd() MACRO has been removed on kernel 3.19. Replace by the
+actual output of the macro.
+
+Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
+---
+ ioctl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ioctl.c b/ioctl.c
+index f26cf93..cf8cc17 100644
+--- a/ioctl.c
++++ b/ioctl.c
+@@ -529,7 +529,7 @@ static int
+ clonefd(struct file *filp)
+ {
+ 	int ret;
+-	ret = get_unused_fd();
++	ret = get_unused_fd_flags(0);
+ 	if (ret >= 0) {
+ 			get_file(filp);
+ 			fd_install(ret, filp);
+-- 
+2.1.4
+
diff --git a/meta/recipes-kernel/cryptodev/files/0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch b/meta/recipes-kernel/cryptodev/files/0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch
new file mode 100644
index 0000000..f5ab8b4
--- /dev/null
+++ b/meta/recipes-kernel/cryptodev/files/0002-Fix-tests-Makefile-usage-of-LDLIBS-vs.-LDFLAGS.patch
@@ -0,0 +1,29 @@
+From 47ff1eb9bb4f872c1d731b93d334ee5865bf3439 Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@ti.com>
+Date: Sun, 6 Apr 2014 22:16:30 -0400
+Subject: [PATCH] Fix tests Makefile usage of LDLIBS vs. LDFLAGS
+
+Libraries must come after objects, as link order matters, especially
+when using linker flags like -Wl,--as-needed.
+
+Signed-off-by: Denys Dmytriyenko <denys@ti.com>
+
+Upstream-Status: Pending
+---
+ tests/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/Makefile b/tests/Makefile
+index cd202af..67c3c83 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -39,5 +39,5 @@ testprogs: $(hostprogs)
+ clean:
+ 	rm -f *.o *~ $(hostprogs)
+ 
+-${comp_progs}: LDFLAGS += -lssl -lcrypto
++${comp_progs}: LDLIBS += -lssl -lcrypto
+ ${comp_progs}: %: %.o openssl_wrapper.o
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/dtc/dtc.inc b/meta/recipes-kernel/dtc/dtc.inc
new file mode 100644
index 0000000..0c409b0
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc.inc
@@ -0,0 +1,22 @@
+SUMMARY = "Device Tree Compiler"
+DESCRIPTION = "The Device Tree Compiler is a tool used to manipulate the Open-Firmware-like device tree used by PowerPC kernels."
+SECTION = "bootloader"
+LICENSE = "GPLv2 | BSD"
+DEPENDS = "flex-native bison-native"
+
+SRC_URI = "git://git.kernel.org/pub/scm/utils/dtc/dtc.git \
+           file://make_install.patch \
+	  "
+
+EXTRA_OEMAKE='PREFIX="${prefix}" LIBDIR="${libdir}" DESTDIR="${D}"'
+
+S = "${WORKDIR}/git"
+
+do_install () {
+	oe_runmake install
+}
+
+PACKAGES =+ "${PN}-misc"
+FILES_${PN}-misc = "${bindir}/convert-dtsv0 ${bindir}/ftdump ${bindir}/dtdiff"
+
+RDEPENDS_${PN}-misc += "bash"
diff --git a/meta/recipes-kernel/dtc/dtc/make_install.patch b/meta/recipes-kernel/dtc/dtc/make_install.patch
new file mode 100644
index 0000000..1120617
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc/make_install.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: git/Makefile
+===================================================================
+--- git.orig/Makefile	2011-11-02 14:52:17.243104779 -0700
++++ git/Makefile	2011-11-02 15:06:01.555104982 -0700
+@@ -161,8 +161,8 @@
+ 	$(INSTALL) -d $(DESTDIR)$(BINDIR)
+ 	$(INSTALL) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR)
+ 	$(INSTALL) -d $(DESTDIR)$(LIBDIR)
+-	$(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)
+-	ln -sf $(notdir $(LIBFDT_lib)) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
++	$(INSTALL) $(LIBFDT_lib) $(DESTDIR)$(LIBDIR)/$(LIBFDT_soname)
++	ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/$(notdir $(LIBFDT_lib))
+ 	ln -sf $(LIBFDT_soname) $(DESTDIR)$(LIBDIR)/libfdt.$(SHAREDLIB_EXT)
+ 	$(INSTALL) -m 644 $(LIBFDT_archive) $(DESTDIR)$(LIBDIR)
+ 	$(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
diff --git a/meta/recipes-kernel/dtc/dtc_git.bb b/meta/recipes-kernel/dtc/dtc_git.bb
new file mode 100644
index 0000000..4446142
--- /dev/null
+++ b/meta/recipes-kernel/dtc/dtc_git.bb
@@ -0,0 +1,11 @@
+require dtc.inc
+
+LIC_FILES_CHKSUM = "file://GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
+		    file://libfdt/libfdt.h;beginline=3;endline=52;md5=fb360963151f8ec2d6c06b055bcbb68c"
+
+SRCREV = "302fca9f4c283e1994cf0a5a9ce1cf43ca15e6d2"
+PV = "1.4.1+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
new file mode 100644
index 0000000..4753094
--- /dev/null
+++ b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Tools for managing Yocto Project style branched kernels"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=d8d1d729a70cd5f52972f8884b80743d"
+
+DEPENDS = "git-native"
+
+SRCREV = "bd144d43ca5b1eaf9e727bced4ce3b61b642297c"
+PR = "r12"
+PV = "0.2+git${SRCPV}"
+
+inherit native
+
+SRC_URI = "git://git.yoctoproject.org/yocto-kernel-tools.git"
+S = "${WORKDIR}"
+
+do_compile() { 
+	:
+}
+
+do_install() {
+	cd ${S}/git
+	make DESTDIR=${D}${bindir} install
+}
diff --git a/meta/recipes-kernel/kexec/kexec-tools.inc b/meta/recipes-kernel/kexec/kexec-tools.inc
new file mode 100644
index 0000000..7797a25
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools.inc
@@ -0,0 +1,30 @@
+SUMMARY = "Kexec fast reboot tools"
+DESCRIPTION = "Kexec is a fast reboot feature that lets you reboot to a new Linux kernel"
+AUTHOR = "Eric Biederman"
+HOMEPAGE = "http://kernel.org/pub/linux/utils/kernel/kexec/"
+SECTION = "kernel/userland"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea5bed2f60d357618ca161ad539f7c0a \
+                    file://kexec/kexec.c;beginline=1;endline=20;md5=af10f6ae4a8715965e648aa687ad3e09"
+DEPENDS = "zlib xz"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/kexec/kexec-tools-${PV}.tar.gz"
+
+PR = "r1"
+
+inherit autotools
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|arm.*|aarch64.*|powerpc.*|mips.*)-(linux|freebsd.*)'
+
+INSANE_SKIP_${PN} = "arch"
+
+do_compile_prepend() {
+    # Remove the '*.d' file to make sure the recompile is OK
+    for dep in `find ${B} -type f -name '*.d'`; do
+        dep_no_d="`echo $dep | sed 's#.d$##'`"
+        # Remove file.d when there is a file.o
+        if [ -f "$dep_no_d.o" ]; then
+            rm -f $dep
+        fi
+    done
+}
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch b/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch
new file mode 100644
index 0000000..bfd077d
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/0001-purgatory-Pass-r-directly-to-linker.patch
@@ -0,0 +1,32 @@
+From a1135b3170963ba956f2364c1283864c35541295 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 07:59:45 +0000
+Subject: [PATCH] purgatory: Pass -r directly to linker
+
+This helps compiling with clang since -r is not a known option for clang
+where as gcc knows how to deal with it and passes it down to linker
+unfiltered
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ purgatory/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/purgatory/Makefile b/purgatory/Makefile
+index 2b5c061..b251353 100644
+--- a/purgatory/Makefile
++++ b/purgatory/Makefile
+@@ -61,7 +61,7 @@ $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
+ 			-I$(shell $(CC) -print-file-name=include)
+ $(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
+ 			-Wl,--no-undefined -nostartfiles -nostdlib \
+-			-nodefaultlibs -e purgatory_start -r \
++			-nodefaultlibs -e purgatory_start -Wl,-r \
+ 			-Wl,-Map=$(PURGATORY_MAP)
+ 
+ $(PURGATORY): $(PURGATORY_OBJS)
+-- 
+2.5.1
+
diff --git a/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch b/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch
new file mode 100644
index 0000000..dc97d93
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/0002-powerpc-change-the-memory-size-limit.patch
@@ -0,0 +1,35 @@
+From b19b68eab567aa534cf8dec79fe18e3dc0e14043 Mon Sep 17 00:00:00 2001
+From: Quanyang Wang <quanyang.wang@windriver.com>
+Date: Tue, 16 Jun 2015 12:59:57 +0800
+Subject: [PATCH] powerpc: change the memory size limit
+
+When run "kexec" in powerpc board, the kexec has a limit that
+the kernel text and bss size must be less than 24M. But now
+some kernel size exceed the limit. So we need to change the limit,
+else will get the error log as below:
+
+my_load:669: do
+Could not find a free area of memory of 0x12400 bytes...
+Could not find a free area of memory of 0x13000 bytes...
+locate_hole failed
+
+Upstream-Status: Pending
+
+Signed-off-by: Quanyang Wang <quanyang.wang@windriver.com>
+---
+ kexec/arch/ppc/kexec-ppc.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: kexec-tools-2.0.10/kexec/arch/ppc/kexec-ppc.h
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/arch/ppc/kexec-ppc.h
++++ kexec-tools-2.0.10/kexec/arch/ppc/kexec-ppc.h
+@@ -42,7 +42,7 @@ void dol_ppc_usage(void);
+  * During inital setup the kernel does not map the whole memory but a part of
+  * it. On Book-E that is 64MiB, 601 24MiB or 256MiB (if possible).
+  */
+-#define KERNEL_ACCESS_TOP (24 * 1024 * 1024)
++#define KERNEL_ACCESS_TOP (36 * 1024 * 1024)
+ 
+ /* boot block version 17 as defined by the linux kernel */
+ struct bootblock {
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch
new file mode 100644
index 0000000..b03f582
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-aarch64.patch
@@ -0,0 +1,801 @@
+From: Geoff Levand <geoff@infradead.org>
+Date: Mon, 15 Jul 2013 23:32:36 +0000 (-0700)
+Subject: Add arm64 support
+X-Git-Url: https://git.linaro.org/gitweb?p=people%2Fgeoff%2Fkexec-tools.git;a=commitdiff_plain;h=fbf5ac6c2c70ec0f6da2b9ff563e573999752c01
+
+Add arm64 support
+
+Signed-off-by: Geoff Levand <geoff@infradead.org>
+
+Get patch from:
+https://fedorapeople.org/~hrw/aarch64/for-fedora/kexec-aarch64.patch
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+
+---
+ configure.ac                            |    3 
+ kexec/Makefile                          |    1 
+ kexec/arch/arm64/Makefile               |   13 +
+ kexec/arch/arm64/crashdump-arm64.c      |  305 ++++++++++++++++++++++++++++++++
+ kexec/arch/arm64/include/arch/options.h |   26 ++
+ kexec/arch/arm64/kexec-arm64.c          |  177 ++++++++++++++++++
+ kexec/arch/arm64/kexec-arm64.h          |   20 ++
+ kexec/arch/arm64/kexec-elf-arm64.c      |  114 +++++++++++
+ kexec/kexec-syscall.h                   |    9 
+ kexec/kexec.c                           |    2 
+ purgatory/arch/arm64/Makefile           |    7 
+ 11 files changed, 675 insertions(+), 2 deletions(-)
+
+Index: kexec-tools-2.0.10/configure.ac
+===================================================================
+--- kexec-tools-2.0.10.orig/configure.ac
++++ kexec-tools-2.0.10/configure.ac
+@@ -36,6 +36,9 @@ case $target_cpu in
+ 		ARCH="ppc64"
+ 		SUBARCH="LE"
+ 		;;
++	aarch64* )
++		ARCH="arm64"
++		;;
+ 	arm* )
+ 		ARCH="arm"
+ 		;;
+Index: kexec-tools-2.0.10/kexec/Makefile
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/Makefile
++++ kexec-tools-2.0.10/kexec/Makefile
+@@ -71,6 +71,7 @@ KEXEC_SRCS			+= $($(ARCH)_FS2DT)
+ 
+ include $(srcdir)/kexec/arch/alpha/Makefile
+ include $(srcdir)/kexec/arch/arm/Makefile
++include $(srcdir)/kexec/arch/arm64/Makefile
+ include $(srcdir)/kexec/arch/i386/Makefile
+ include $(srcdir)/kexec/arch/ia64/Makefile
+ include $(srcdir)/kexec/arch/m68k/Makefile
+Index: kexec-tools-2.0.10/kexec/arch/arm64/Makefile
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/Makefile
+@@ -0,0 +1,13 @@
++
++arm64_KEXEC_SRCS += \
++	kexec/arch/arm64/kexec-arm64.c \
++	kexec/arch/arm64/kexec-elf-arm64.c \
++	kexec/arch/arm64/crashdump-arm64.c
++
++arm64_ARCH_REUSE_INITRD =
++arm64_ADD_SEGMENT =
++arm64_VIRT_TO_PHYS =
++
++dist += $(arm64_KEXEC_SRCS) \
++	kexec/arch/arm64/Makefile \
++	kexec/arch/arm64/kexec-arm64.h
+Index: kexec-tools-2.0.10/kexec/arch/arm64/crashdump-arm64.c
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/crashdump-arm64.c
+@@ -0,0 +1,305 @@
++/*
++ * 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 (version 2 of the License).
++ */
++
++#include "../../kexec.h"
++#include "../../kexec-elf.h"
++#include "../../crashdump.h"
++
++int is_crashkernel_mem_reserved(void)
++{
++	return 0;
++}
++
++#if 0
++/*
++ * Used to save various memory ranges/regions needed for the captured
++ * kernel to boot. (lime memmap= option in other archs)
++ */
++static struct memory_range crash_memory_ranges[CRASH_MAX_MEMORY_RANGES];
++struct memory_ranges usablemem_rgns = {
++    .size = 0,
++    .ranges = crash_memory_ranges,
++};
++
++/* memory range reserved for crashkernel */
++static struct memory_range crash_reserved_mem;
++
++static struct crash_elf_info elf_info = {
++	.class		= ELFCLASS32,
++	.data		= ELFDATA2LSB,
++	.machine	= EM_ARM,
++	.page_offset	= PAGE_OFFSET,
++};
++
++unsigned long phys_offset;
++
++/**
++ * crash_range_callback() - callback called for each iomem region
++ * @data: not used
++ * @nr: not used
++ * @str: name of the memory region
++ * @base: start address of the memory region
++ * @length: size of the memory region
++ *
++ * This function is called once for each memory region found in /proc/iomem. It
++ * locates system RAM and crashkernel reserved memory and places these to
++ * variables: @crash_memory_ranges and @crash_reserved_mem. Number of memory
++ * regions is placed in @crash_memory_nr_ranges.
++ */
++static int crash_range_callback(void *UNUSED(data), int UNUSED(nr),
++				char *str, unsigned long base,
++				unsigned long length)
++{
++	struct memory_range *range;
++
++	if (usablemem_rgns.size >= CRASH_MAX_MEMORY_RANGES)
++		return 1;
++
++	range = usablemem_rgns.ranges + usablemem_rgns.size;
++
++	if (strncmp(str, "System RAM\n", 11) == 0) {
++		range->start = base;
++		range->end = base + length - 1;
++		range->type = RANGE_RAM;
++		usablemem_rgns.size++;
++	} else if (strncmp(str, "Crash kernel\n", 13) == 0) {
++		crash_reserved_mem.start = base;
++		crash_reserved_mem.end = base + length - 1;
++		crash_reserved_mem.type = RANGE_RAM;
++	}
++
++	return 0;
++}
++
++/**
++ * crash_exclude_range() - excludes memory region reserved for crashkernel
++ *
++ * Function locates where crashkernel reserved memory is and removes that region
++ * from the available memory regions.
++ */
++static void crash_exclude_range(void)
++{
++	const struct memory_range *range = &crash_reserved_mem;
++	int i;
++
++	for (i = 0; i < usablemem_rgns.size; i++) {
++		struct memory_range *r = usablemem_rgns.ranges + i;
++
++		/*
++		 * We assume that crash area is fully contained in
++		 * some larger memory area.
++		 */
++		if (r->start <= range->start && r->end >= range->end) {
++			struct memory_range *new;
++			/*
++			 * Let's split this area into 2 smaller ones and
++			 * remove excluded range from between. First create
++			 * new entry for the remaining area.
++			 */
++			new = usablemem_rgns.ranges + usablemem_rgns.size;
++			new->start = range->end + 1;
++			new->end = r->end;
++			usablemem_rgns.size++;
++			/*
++			 * Next update this area to end before excluded range.
++			 */
++			r->end = range->start - 1;
++			break;
++		}
++	}
++}
++
++static int range_cmp(const void *a1, const void *a2)
++{
++	const struct memory_range *r1 = a1;
++	const struct memory_range *r2 = a2;
++
++	if (r1->start > r2->start)
++		return 1;
++	if (r1->start < r2->start)
++		return -1;
++
++	return 0;
++}
++
++/**
++ * crash_get_memory_ranges() - read system physical memory
++ *
++ * Function reads through system physical memory and stores found memory regions
++ * in @crash_memory_ranges. Number of memory regions found is placed in
++ * @crash_memory_nr_ranges. Regions are sorted in ascending order.
++ *
++ * Returns %0 in case of success and %-1 otherwise (errno is set).
++ */
++static int crash_get_memory_ranges(void)
++{
++	/*
++	 * First read all memory regions that can be considered as
++	 * system memory including the crash area.
++	 */
++	kexec_iomem_for_each_line(NULL, crash_range_callback, NULL);
++
++	if (usablemem_rgns.size < 1) {
++		errno = EINVAL;
++		return -1;
++	}
++
++	/*
++	 * Exclude memory reserved for crashkernel (this may result a split memory
++	 * region).
++	 */
++	crash_exclude_range();
++
++	/*
++	 * Make sure that the memory regions are sorted.
++	 */
++	qsort(usablemem_rgns.ranges, usablemem_rgns.size,
++	      sizeof(*usablemem_rgns.ranges), range_cmp);
++
++	return 0;
++}
++
++/**
++ * cmdline_add_elfcorehdr() - adds elfcorehdr= to @cmdline
++ * @cmdline: buffer where parameter is placed
++ * @elfcorehdr: physical address of elfcorehdr
++ *
++ * Function appends 'elfcorehdr=start' at the end of the command line given in
++ * @cmdline. Note that @cmdline must be at least %COMMAND_LINE_SIZE bytes long
++ * (inclunding %NUL).
++ */
++static void cmdline_add_elfcorehdr(char *cmdline, unsigned long elfcorehdr)
++{
++	char buf[COMMAND_LINE_SIZE];
++	int buflen;
++
++	buflen = snprintf(buf, sizeof(buf), "%s elfcorehdr=%#lx",
++			  cmdline, elfcorehdr);
++	if (buflen < 0)
++		die("Failed to construct elfcorehdr= command line parameter\n");
++	if (buflen >= sizeof(buf))
++		die("Command line overflow\n");
++
++	(void) strncpy(cmdline, buf, COMMAND_LINE_SIZE);
++	cmdline[COMMAND_LINE_SIZE - 1] = '\0';
++}
++
++/**
++ * cmdline_add_mem() - adds mem= parameter to kernel command line
++ * @cmdline: buffer where parameter is placed
++ * @size: size of the kernel reserved memory (in bytes)
++ *
++ * This function appends 'mem=size' at the end of the command line given in
++ * @cmdline. Note that @cmdline must be at least %COMMAND_LINE_SIZE bytes long
++ * (including %NUL).
++ */
++static void cmdline_add_mem(char *cmdline, unsigned long size)
++{
++	char buf[COMMAND_LINE_SIZE];
++	int buflen;
++
++	buflen = snprintf(buf, sizeof(buf), "%s mem=%ldK", cmdline, size >> 10);
++	if (buflen < 0)
++		die("Failed to construct mem= command line parameter\n");
++	if (buflen >= sizeof(buf))
++		die("Command line overflow\n");
++
++	(void) strncpy(cmdline, buf, COMMAND_LINE_SIZE);
++	cmdline[COMMAND_LINE_SIZE - 1] = '\0';
++}
++
++static unsigned long long range_size(const struct memory_range *r)
++{
++	return r->end - r->start + 1;
++}
++
++static void dump_memory_ranges(void)
++{
++	int i;
++
++	if (!kexec_debug)
++		return;
++
++	dbgprintf("crashkernel: [%#llx - %#llx] (%ldM)\n",
++		  crash_reserved_mem.start, crash_reserved_mem.end,
++		  (unsigned long)range_size(&crash_reserved_mem) >> 20);
++
++	for (i = 0; i < usablemem_rgns.size; i++) {
++		struct memory_range *r = usablemem_rgns.ranges + i;
++		dbgprintf("memory range: [%#llx - %#llx] (%ldM)\n",
++			  r->start, r->end, (unsigned long)range_size(r) >> 20);
++	}
++}
++
++/**
++ * load_crashdump_segments() - loads additional segments needed for kdump
++ * @info: kexec info structure
++ * @mod_cmdline: kernel command line
++ *
++ * This function loads additional segments which are needed for the dump capture
++ * kernel. It also updates kernel command line passed in @mod_cmdline to have
++ * right parameters for the dump capture kernel.
++ *
++ * Return %0 in case of success and %-1 in case of error.
++ */
++int load_crashdump_segments(struct kexec_info *info, char *mod_cmdline)
++{
++	unsigned long elfcorehdr;
++	unsigned long bufsz;
++	void *buf;
++	int err;
++
++	/*
++	 * First fetch all the memory (RAM) ranges that we are going to pass to
++	 * the crashdump kernel during panic.
++	 */
++	err = crash_get_memory_ranges();
++	if (err)
++		return err;
++
++	/*
++	 * Now that we have memory regions sorted, we can use first memory
++	 * region as PHYS_OFFSET.
++	 */
++	phys_offset = usablemem_rgns.ranges->start;
++	dbgprintf("phys_offset: %#lx\n", phys_offset);
++
++	err = crash_create_elf32_headers(info, &elf_info,
++					 usablemem_rgns.ranges,
++					 usablemem_rgns.size, &buf, &bufsz,
++					 ELF_CORE_HEADER_ALIGN);
++	if (err)
++		return err;
++
++	/*
++	 * We allocate ELF core header from the end of the memory area reserved
++	 * for the crashkernel. We align the header to SECTION_SIZE (which is
++	 * 1MB) so that available memory passed in kernel command line will be
++	 * aligned to 1MB. This is because kernel create_mapping() wants memory
++	 * regions to be aligned to SECTION_SIZE.
++	 */
++	elfcorehdr = add_buffer_phys_virt(info, buf, bufsz, bufsz, 1 << 20,
++					  crash_reserved_mem.start,
++					  crash_reserved_mem.end, -1, 0);
++
++	dbgprintf("elfcorehdr: %#lx\n", elfcorehdr);
++	cmdline_add_elfcorehdr(mod_cmdline, elfcorehdr);
++
++	/*
++	 * Add 'mem=size' parameter to dump capture kernel command line. This
++	 * prevents the dump capture kernel from using any other memory regions
++	 * which belong to the primary kernel.
++	 */
++	cmdline_add_mem(mod_cmdline, elfcorehdr - crash_reserved_mem.start);
++
++	dump_memory_ranges();
++	dbgprintf("kernel command line: \"%s\"\n", mod_cmdline);
++
++	return 0;
++}
++
++#endif
++
+Index: kexec-tools-2.0.10/kexec/arch/arm64/include/arch/options.h
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/include/arch/options.h
+@@ -0,0 +1,26 @@
++#ifndef KEXEC_ARCH_ARM64_OPTIONS_H
++#define KEXEC_ARCH_ARM64_OPTIONS_H
++
++//#define OPT_ARCH_MAX	((OPT_MAX)+0)
++
++#define OPT_APPEND	((OPT_MAX)+0)
++#define OPT_RAMDISK	((OPT_MAX)+1)
++#define OPT_DTB		((OPT_MAX)+2)
++
++#define OPT_ARCH_MAX	((OPT_MAX)+3)
++
++
++#define KEXEC_ARCH_OPTIONS \
++	KEXEC_OPTIONS \
++	{ "append",       1, NULL, OPT_APPEND }, \
++	{ "command-line", 1, NULL, OPT_APPEND }, \
++	{ "dtb",          1, NULL, OPT_DTB }, \
++	{ "initrd",       1, NULL, OPT_RAMDISK }, \
++	{ "ramdisk",      1, NULL, OPT_RAMDISK }, \
++
++#define KEXEC_ARCH_OPT_STR KEXEC_OPT_STR /* Only accept long arch options. */
++
++#define KEXEC_ALL_OPTIONS KEXEC_ARCH_OPTIONS
++#define KEXEC_ALL_OPT_STR KEXEC_ARCH_OPT_STR
++
++#endif /* KEXEC_ARCH_ARM64_OPTIONS_H */
+Index: kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.c
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.c
+@@ -0,0 +1,177 @@
++/*
++ * ARM64 kexec support.
++ */
++
++#define _GNU_SOURCE
++
++#include <errno.h>
++#include <stddef.h>
++
++//#include <linux/kexec.h>
++
++#include "../../kexec.h"
++#include "../../kexec-syscall.h"
++#include "kexec-arm64.h"
++
++
++void arch_usage(void)
++{
++	fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++
++	printf(
++"     --append=STRING       Set the kernel command line to STRING.\n"
++"     --command-line=STRING Set the kernel command line to STRING.\n"
++"     --dtb=FILE            Use FILE as the device tree blob.\n"
++"     --initrd=FILE         Use FILE as the kernel initial ramdisk.\n"
++"     --ramdisk=FILE        Use FILE as the kernel initial ramdisk.\n");
++
++	fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++}
++
++int arch_process_options(int UNUSED(argc), char **UNUSED(argv))
++{
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++	return 0;
++}
++
++const struct arch_map_entry arches[] = {
++	{ "aarch64", KEXEC_ARCH_ARM64 },
++	{ NULL, 0 },
++};
++
++void arch_update_purgatory(struct kexec_info *UNUSED(info))
++{
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++}
++
++unsigned long virt_to_phys(unsigned long addr)
++{
++	fprintf(stderr, "%s:%d: %016lx -> %016lx\n", __func__, __LINE__, addr,
++		addr + 0x080000000UL);
++	return addr + 0x080000000UL;
++}
++
++void add_segment(struct kexec_info *info, const void *buf, size_t bufsz,
++	unsigned long base, size_t memsz)
++{
++	fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++	add_segment_phys_virt(info, buf, bufsz, base, memsz, 1);
++	fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++}
++
++static int get_memory_ranges_1(struct memory_range **range, int *ranges,
++			unsigned long kexec_flags)
++{
++	static struct memory_range memory_range[KEXEC_SEGMENT_MAX];
++	const char *iomem;
++	int range_count = 0;
++	char line[MAX_LINE];
++	FILE *fp;
++
++	iomem = proc_iomem();
++	fp = fopen(iomem, "r");
++
++	if (!fp) {
++		fprintf(stderr, "Cannot open %s: %s\n",
++			iomem, strerror(errno));
++		return -1;
++	}
++
++	dbgprintf("memory ranges:\n");
++
++	while(fgets(line, sizeof(line), fp) != 0) {
++		struct memory_range r;
++		char *str;
++		int consumed;
++
++		if (range_count >= KEXEC_SEGMENT_MAX)
++			break;
++
++		if (sscanf(line, "%Lx-%Lx : %n", &r.start, &r.end, &consumed)
++			!= 2)
++			continue;
++
++		str = line + consumed;
++		r.end++;
++
++		if (memcmp(str, "System RAM\n", 11)) {
++			dbgprintf(" Skip: %016Lx - %016Lx : %s", r.start, r.end,
++				str);
++			continue;
++		}
++
++		r.type = RANGE_RAM;
++		memory_range[range_count] = r;
++		range_count++;
++
++		dbgprintf(" Add:  %016Lx - %016Lx : %s", r.start, r.end, str);
++	}
++
++	fclose(fp);
++	*range = memory_range;
++	*ranges = range_count;
++
++	return 0;
++}
++
++static int get_memory_ranges_2(struct memory_range **range, int *ranges,
++		      unsigned long UNUSED(kexec_flags))
++{
++	static struct memory_range memory_range[2];
++
++	memory_range[0].start = 0x080000000;
++	memory_range[0].end   = 0x100000000;
++	memory_range[0].type = RANGE_RAM;
++
++	memory_range[1].start = 0x900000000;
++	memory_range[1].end   = 0x880000000;
++	memory_range[1].type = RANGE_RAM;
++
++	*range = memory_range;
++	*ranges = sizeof(memory_range) / sizeof(memory_range[0]);
++
++	return 0;
++}
++
++int get_memory_ranges(struct memory_range **range, int *ranges,
++			unsigned long kexec_flags)
++{
++	/* FIXME: Should get this info from device tree. */
++	
++	return get_memory_ranges_1(range, ranges, kexec_flags);
++}
++
++struct file_type file_type[] = {
++	{ "elf-arm64", elf_arm64_probe, elf_arm64_load, elf_arm64_usage },
++};
++
++int file_types = sizeof(file_type) / sizeof(file_type[0]);
++
++int arch_compat_trampoline(struct kexec_info *info)
++{
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++	return 0;
++}
++
++void arch_reuse_initrd(void)
++{
++}
++
++int machine_verify_elf_rel(struct mem_ehdr *ehdr)
++{
++	(void)ehdr;
++
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++	return 0;
++}
++
++void machine_apply_elf_rel(struct mem_ehdr *ehdr, unsigned long r_type,
++	void *location, unsigned long address, unsigned long value)
++{
++	(void)ehdr;
++	(void)r_type;
++	(void)location;
++	(void)address;
++	(void)value;
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++}
+Index: kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.h
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/kexec-arm64.h
+@@ -0,0 +1,20 @@
++/*
++ * ARM64 kexec support.
++ */
++
++#if !defined(KEXEC_ARM64_H)
++#define KEXEC_ARM64_H
++
++/* #include <linux/kexec.h> FIXME: this is broken */
++#include <sys/types.h>
++
++#include "../../kexec.h"
++
++#define KEXEC_SEGMENT_MAX 16 /* FIXME: this should come from <linux/kexec.h> */
++
++int elf_arm64_probe(const char *buf, off_t len);
++int elf_arm64_load(int argc, char **argv, const char *buf, off_t len,
++	struct kexec_info *info);
++void elf_arm64_usage(void);
++
++#endif
+\ No newline at end of file
+Index: kexec-tools-2.0.10/kexec/arch/arm64/kexec-elf-arm64.c
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/kexec/arch/arm64/kexec-elf-arm64.c
+@@ -0,0 +1,114 @@
++/*
++ * ARM64 kexec support.
++ */
++
++#define _GNU_SOURCE
++
++#include <elf.h>
++#include <getopt.h>
++
++#include "../../kexec-syscall.h"
++
++#include "kexec-arm64.h"
++#include "arch/options.h"
++
++#if !defined(EM_AARCH64)
++# define EM_AARCH64 183
++#endif
++
++int elf_arm64_probe(const char *buf, off_t len)
++{
++	int result;
++	struct mem_ehdr ehdr;
++
++	fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++	
++	result = build_elf_exec_info(buf, len, &ehdr, 0);
++
++	if (result < 0) {
++		dbgprintf("Not an ELF executable\n");
++		goto out;
++	}
++
++	if (ehdr.e_machine != EM_AARCH64) {
++		dbgprintf("Not an AARCH64 executable\n");
++		result = -1;
++		goto out;
++	}
++
++	result = 0;
++
++out:
++	free_elf_info(&ehdr);
++	fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++	return result;
++}
++
++int elf_arm64_load(int argc, char **argv, const char *buf, off_t len,
++			struct kexec_info *info)
++{
++	static const struct option options[] = {
++		KEXEC_ARCH_OPTIONS
++		{ 0 }
++	};
++	static const char short_options[] = KEXEC_OPT_STR "";
++	const char *command_line = NULL;
++	unsigned int command_line_len = 0;
++	const char *ramdisk = NULL;
++	const char *dtb = NULL;
++	int opt;
++	struct mem_ehdr ehdr;
++	int result;
++
++	fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++
++	while ((opt = getopt_long(argc, argv, short_options, options, 0))
++		!= -1) {
++		switch (opt) {
++		default:
++			if (opt < OPT_MAX) /* Ignore core options */
++				break;
++		case OPT_APPEND:
++			command_line = optarg;
++			command_line_len = strlen(command_line) + 1;
++			break;
++		case OPT_RAMDISK:
++			ramdisk = optarg;
++			break;
++		case OPT_DTB:
++			dtb = optarg;
++			break;
++		}
++	}
++
++	fprintf(stderr, "%s:%d: command_line: %s\n", __func__, __LINE__, command_line);
++	fprintf(stderr, "%s:%d: ramdisk: %s\n", __func__, __LINE__, ramdisk);
++	fprintf(stderr, "%s:%d: dtb: %s\n", __func__, __LINE__, dtb);
++
++	if (info->kexec_flags & KEXEC_ON_CRASH) {
++		fprintf(stderr, "kexec: kdump not yet supported on arm64\n");
++		return -1;
++	}
++
++	result = build_elf_exec_info(buf, len, &ehdr, 0);
++
++	if (result < 0) {
++		free_elf_info(&ehdr);
++		fprintf(stderr, "%s:%d: free_elf_info failed\n", __func__,
++			__LINE__);
++		return result;
++	}
++
++	elf_exec_build_load(info, &ehdr, buf, len, 0);
++
++	info->entry = (void*)0x80080000UL;  // FIXME
++
++	fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++	return 0;
++}
++
++void elf_arm64_usage(void)
++{
++	fprintf(stderr, "%s:%d: ->\n", __func__, __LINE__);
++	fprintf(stderr, "%s:%d: <-\n", __func__, __LINE__);
++}
+Index: kexec-tools-2.0.10/kexec/kexec-syscall.h
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/kexec-syscall.h
++++ kexec-tools-2.0.10/kexec/kexec-syscall.h
+@@ -39,8 +39,8 @@
+ #ifdef __s390__
+ #define __NR_kexec_load		277
+ #endif
+-#ifdef __arm__
+-#define __NR_kexec_load		__NR_SYSCALL_BASE + 347  
++#if defined(__arm__) || defined(__arm64__)
++#define __NR_kexec_load		__NR_SYSCALL_BASE + 347
+ #endif
+ #if defined(__mips__)
+ #define __NR_kexec_load                4311
+@@ -108,6 +108,8 @@ static inline long kexec_file_load(int k
+ #define KEXEC_ARCH_PPC64   (21 << 16)
+ #define KEXEC_ARCH_IA_64   (50 << 16)
+ #define KEXEC_ARCH_ARM     (40 << 16)
++#define KEXEC_ARCH_ARM64   (183 << 16)
++/* #define KEXEC_ARCH_AARCH64 (183 << 16) */
+ #define KEXEC_ARCH_S390    (22 << 16)
+ #define KEXEC_ARCH_SH      (42 << 16)
+ #define KEXEC_ARCH_MIPS_LE (10 << 16)
+@@ -153,5 +155,8 @@ static inline long kexec_file_load(int k
+ #ifdef __m68k__
+ #define KEXEC_ARCH_NATIVE	KEXEC_ARCH_68K
+ #endif
++#if defined(__arm64__)
++#define KEXEC_ARCH_NATIVE	KEXEC_ARCH_ARM64
++#endif
+ 
+ #endif /* KEXEC_SYSCALL_H */
+Index: kexec-tools-2.0.10/kexec/kexec.c
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/kexec.c
++++ kexec-tools-2.0.10/kexec/kexec.c
+@@ -664,6 +664,8 @@ static int my_load(const char *type, int
+ 	memset(&info, 0, sizeof(info));
+ 	info.kexec_flags = kexec_flags;
+ 
++	fprintf(stderr, "%s:%d: do\n", __func__, __LINE__);
++
+ 	result = 0;
+ 	if (argc - fileind <= 0) {
+ 		fprintf(stderr, "No kernel specified\n");
+Index: kexec-tools-2.0.10/purgatory/arch/arm64/Makefile
+===================================================================
+--- /dev/null
++++ kexec-tools-2.0.10/purgatory/arch/arm64/Makefile
+@@ -0,0 +1,7 @@
++#
++# Purgatory arm64
++#
++
++arm64_PURGATORY_SRCS =
++
++dist += purgatory/arch/arm64/Makefile $(arm64_PURGATORY_SRCS)
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch
new file mode 100644
index 0000000..e198eb6
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch
@@ -0,0 +1,48 @@
+kexec-tools: Refine kdump device_tree sort
+
+The commit b02d735bf was to rearrange the device-tree entries, and
+assumed that these entries are sorted in the ascending order. but
+acctually when I was validating kexec and kdump, the order of
+serial node still is changed. So the patch is to sort these entries
+by the directory name in ascending order.
+
+Upstream-Status: Pending
+
+Signed-off-by: Yang Wei <Wei.Yang@windriver.com>
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ kexec/arch/ppc/fs2dt.c |   13 ++++++++++---
+ kexec/fs2dt.c          |   13 ++++++++++---
+ 2 files changed, 20 insertions(+), 6 deletions(-)
+
+Index: kexec-tools-2.0.10/kexec/arch/ppc/fs2dt.c
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/arch/ppc/fs2dt.c
++++ kexec-tools-2.0.10/kexec/arch/ppc/fs2dt.c
+@@ -296,6 +296,9 @@ static int comparefunc(const void *dentr
+ {
+ 	char *str1 = (*(struct dirent **)dentry1)->d_name;
+ 	char *str2 = (*(struct dirent **)dentry2)->d_name;
++	char* ptr1 = strchr(str1, '@');
++	char* ptr2 = strchr(str2, '@');
++	int len1, len2;
+ 
+ 	/*
+ 	 * strcmp scans from left to right and fails to idetify for some
+@@ -303,9 +306,13 @@ static int comparefunc(const void *dentr
+ 	 * Therefore, we get the wrong sorted order like memory@10000000 and
+ 	 * memory@f000000.
+ 	 */
+-	if (strchr(str1, '@') && strchr(str2, '@') &&
+-		(strlen(str1) > strlen(str2)))
+-		return 1;
++	if (ptr1 && ptr2) {
++		len1 = ptr1 - str1;
++		len2 = ptr2 - str2;
++		if (!strncmp(str1, str2, len1 >len2 ? len1: len2) &&
++					(strlen(str1) > strlen(str2)))
++				return 1;
++	}
+ 
+ 	return strcmp(str1, str2);
+ }
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch
new file mode 100644
index 0000000..26d18eb
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-x32.patch
@@ -0,0 +1,88 @@
+x86_64: Add support to build kexec-tools with x32 ABI
+
+Summary of changes,
+
+configure.ac: Add test for detect x32 ABI.
+purgatory/arch/x86_64/Makefile: Not use mcmodel large when
+	x32 ABI is set.
+kexec/arch/x86_64/kexec-elf-rel-x86_64.c: When x32 ABI is set
+	use ELFCLASS32 instead of ELFCLASS64.
+kexec/kexec-syscall.h: Add correct syscall number for x32 ABI.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
+
+---
+ configure.ac                             | 9 +++++++++
+ kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 4 ++++
+ kexec/kexec-syscall.h                    | 4 ++++
+ purgatory/arch/x86_64/Makefile           | 4 +++-
+ 4 files changed, 20 insertions(+), 1 deletion(-)
+
+Index: kexec-tools-2.0.10/configure.ac
+===================================================================
+--- kexec-tools-2.0.10.orig/configure.ac
++++ kexec-tools-2.0.10/configure.ac
+@@ -56,6 +56,15 @@ case $target_cpu in
+ 		;;
+ 	ia64|x86_64|alpha|m68k )
+ 		ARCH="$target_cpu"
++
++		dnl ---Test for x32 ABI in x86_64
++		if test "x$ARCH" = "xx86_64" ; then
++			AC_EGREP_CPP(x32_test,
++			[#if defined(__x86_64__) && defined (__ILP32__)
++				x32_test
++			#endif
++			], SUBARCH='x32', SUBARCH='64')
++		fi
+ 		;;
+ 	* )
+ 		AC_MSG_ERROR([unsupported architecture $target_cpu])
+Index: kexec-tools-2.0.10/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
++++ kexec-tools-2.0.10/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
+@@ -8,7 +8,11 @@ int machine_verify_elf_rel(struct mem_eh
+ 	if (ehdr->ei_data != ELFDATA2LSB) {
+ 		return 0;
+ 	}
++#ifdef __ILP32__
++	if (ehdr->ei_class != ELFCLASS32) {
++#else
+ 	if (ehdr->ei_class != ELFCLASS64) {
++#endif
+ 		return 0;
+ 	}
+ 	if (ehdr->e_machine != EM_X86_64) {
+Index: kexec-tools-2.0.10/kexec/kexec-syscall.h
+===================================================================
+--- kexec-tools-2.0.10.orig/kexec/kexec-syscall.h
++++ kexec-tools-2.0.10/kexec/kexec-syscall.h
+@@ -31,8 +31,12 @@
+ #define __NR_kexec_load		268
+ #endif
+ #ifdef __x86_64__
++#ifdef __ILP32__
++#define __NR_kexec_load		528
++#else
+ #define __NR_kexec_load		246
+ #endif
++#endif
+ #ifdef __s390x__
+ #define __NR_kexec_load		277
+ #endif
+Index: kexec-tools-2.0.10/purgatory/arch/x86_64/Makefile
+===================================================================
+--- kexec-tools-2.0.10.orig/purgatory/arch/x86_64/Makefile
++++ kexec-tools-2.0.10/purgatory/arch/x86_64/Makefile
+@@ -23,4 +23,6 @@ x86_64_PURGATORY_SRCS += purgatory/arch/
+ x86_64_PURGATORY_SRCS += purgatory/arch/i386/vga.c
+ x86_64_PURGATORY_SRCS += purgatory/arch/i386/pic.c
+ 
+-x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large
++ifeq ($(SUBARCH),64)
++        x86_64_PURGATORY_EXTRA_CFLAGS = -mcmodel=large
++endif
diff --git a/meta/recipes-kernel/kexec/kexec-tools_2.0.10.bb b/meta/recipes-kernel/kexec/kexec-tools_2.0.10.bb
new file mode 100644
index 0000000..ffdb983
--- /dev/null
+++ b/meta/recipes-kernel/kexec/kexec-tools_2.0.10.bb
@@ -0,0 +1,22 @@
+require kexec-tools.inc
+export LDFLAGS = "-L${STAGING_LIBDIR}"
+EXTRA_OECONF = " --with-zlib=yes"
+
+SRC_URI += "file://kexec-tools-Refine-kdump-device_tree-sort.patch \
+            file://kexec-aarch64.patch \
+            file://kexec-x32.patch \
+            file://0002-powerpc-change-the-memory-size-limit.patch \
+            file://0001-purgatory-Pass-r-directly-to-linker.patch \
+         "
+
+SRC_URI[md5sum] = "6cb4d22bcec71b6e070aa8e9d990a5e6"
+SRC_URI[sha256sum] = "c31bb83deef9547a28e8cfc1f0916e70f8e6b92a6bd2ef7077e12e3338239af3"
+
+PACKAGES =+ "kexec kdump vmcore-dmesg"
+
+ALLOW_EMPTY_${PN} = "1"
+RRECOMMENDS_${PN} = "kexec kdump vmcore-dmesg"
+
+FILES_kexec = "${sbindir}/kexec"
+FILES_kdump = "${sbindir}/kdump"
+FILES_vmcore-dmesg = "${sbindir}/vmcore-dmesg"
diff --git a/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
new file mode 100644
index 0000000..8acb3a8
--- /dev/null
+++ b/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb
@@ -0,0 +1,48 @@
+SUMMARY = "Wrapper script for the Linux kernel module dependency indexer"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+S = "${WORKDIR}"
+
+INHIBIT_DEFAULT_DEPS = "1"
+# The kernel and the staging dir for it is machine specific
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# We need the following for the sstate code to process the wrapper
+SSTATE_SCAN_FILES += "depmodwrapper"
+
+do_install() {
+	install -d ${D}${bindir_crossscripts}/
+
+	cat > ${D}${bindir_crossscripts}/depmodwrapper << EOF
+#!/bin/sh
+# Expected to be called as: depmodwrapper -a KERNEL_VERSION
+if [ "\$1" != "-a" -o "\$2" != "-b" ]; then
+    echo "Usage: depmodwrapper -a -b rootfs KERNEL_VERSION" >&2
+    exit 1
+fi
+if [ ! -r ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion ]; then
+    echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion" >&2
+else
+    kernelabi=\$(cat ${PKGDATA_DIR}/kernel-depmod/kernel-abiversion)
+    if [ "\$kernelabi" != "\$4" ]; then
+        echo "Error: Kernel version \$4 does not match kernel-abiversion (\$kernelabi)" >&2
+        exit 1
+    fi
+fi
+
+if [ ! -r ${PKGDATA_DIR}/kernel-depmod/System.map-\$4 ]; then
+    echo "Unable to read: ${PKGDATA_DIR}/kernel-depmod/System.map-\$4" >&2
+    exec env depmod "\$1" "\$2" "\$3" "\$4"
+else
+    exec env depmod "\$1" "\$2" "\$3" -F "${PKGDATA_DIR}/kernel-depmod/System.map-\$4" "\$4"
+fi
+EOF
+	chmod +x ${D}${bindir_crossscripts}/depmodwrapper
+}
+
+SYSROOT_PREPROCESS_FUNCS += "depmodwrapper_sysroot_preprocess"
+
+depmodwrapper_sysroot_preprocess () {
+	sysroot_stage_dir ${D}${bindir_crossscripts} ${SYSROOT_DESTDIR}${bindir_crossscripts}
+}
diff --git a/meta/recipes-kernel/kmod/kmod-native_git.bb b/meta/recipes-kernel/kmod/kmod-native_git.bb
new file mode 100644
index 0000000..f0e274e
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod-native_git.bb
@@ -0,0 +1,18 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require kmod.inc
+
+DEPENDS += "zlib-native"
+
+inherit native
+
+SRC_URI += "file://Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch \
+           "
+
+do_install_append (){
+	for tool in depmod insmod lsmod modinfo modprobe rmmod
+	do
+		ln -s kmod ${D}${bindir}/$tool
+	done
+}
diff --git a/meta/recipes-kernel/kmod/kmod.inc b/meta/recipes-kernel/kmod/kmod.inc
new file mode 100644
index 0000000..e9aa67d
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod.inc
@@ -0,0 +1,43 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Tools for managing Linux kernel modules"
+DESCRIPTION = "kmod is a set of tools to handle common tasks with Linux kernel modules like \
+               insert, remove, list, check properties, resolve dependencies and aliases."
+HOMEPAGE = "http://packages.profusion.mobi/kmod/"
+LICENSE = "GPL-2.0+ & LGPL-2.1+"
+LICENSE_libkmod = "LGPL-2.1+"
+SECTION = "base"
+
+DEPENDS += "pkgconfig-native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                    file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                   "
+inherit autotools gtk-doc
+
+SRCREV = "0d833715eaa65636dda2705b89359a1e0154dc58"
+# Lookout for PV bump too when SRCREV is changed
+PV = "21+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git \
+           file://depmod-search.conf \
+           file://avoid_parallel_tests.patch \
+           file://fix-O_CLOEXEC.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+EXTRA_AUTORECONF += "--install --symlink"
+EXTRA_OECONF +=" --enable-tools --disable-manpages --with-zlib"
+
+PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
+PACKAGECONFIG[logging] = " --enable-logging,--disable-logging"
+
+do_configure_prepend () {
+        gtkdocize --docdir ${S}/libkmod/docs || touch ${S}/libkmod/docs/gtk-doc.make
+}
+
+do_configure_append () {
+	sed -i 's#}libtool#}${TARGET_SYS}-libtool#' ${B}/doltlibtool
+}
diff --git a/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
new file mode 100644
index 0000000..b722183
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/Change-to-calling-bswap_-instead-of-htobe-and-be-toh.patch
@@ -0,0 +1,39 @@
+Subject: Change to calling bswap_* instead of htobe* and be*toh
+
+We can't use htobe* and be*toh functions because they are not
+available on older versions of glibc, For example, shipped on Centos 5.5.
+
+Change to directly calling bswap_* as defined in+byteswap.h.
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Ting Liu <b28495@freescale.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ libkmod/libkmod-signature.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c
+index 6fc06fc..912185a 100644
+--- a/libkmod/libkmod-signature.c
++++ b/libkmod/libkmod-signature.c
+@@ -18,6 +18,7 @@
+  */
+ 
+ #include <endian.h>
++#include <byteswap.h>
+ #include <inttypes.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -127,7 +128,7 @@ bool kmod_module_signature_info(const struct kmod_file *file, struct kmod_signat
+ 			modsig->hash >= PKEY_HASH__LAST ||
+ 			modsig->id_type >= PKEY_ID_TYPE__LAST)
+ 		return false;
+-	sig_len = be32toh(get_unaligned(&modsig->sig_len));
++	sig_len = bswap_32(get_unaligned(&modsig->sig_len));
+ 	if (sig_len == 0 ||
+ 	    size < (int64_t)(modsig->signer_len + modsig->key_id_len + sig_len))
+ 		return false;
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
new file mode 100644
index 0000000..feafcb9
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
@@ -0,0 +1,29 @@
+Avoid parallel-tests as it remove
+buildtest-TESTS and runtest-TESTS targets required by ptest.
+In automake 1.13.4 parallel-tests is assumed by defauls.
+In order to have buildtest-TESTS and runtest-TESTS targets
+serial-tests is now required
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Inappropriate (disable feature incompatible with ptest) 
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index eb0f9d1..a539968 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -14,7 +14,7 @@ AC_USE_SYSTEM_EXTENSIONS
+ AC_SYS_LARGEFILE
+ AC_PREFIX_DEFAULT([/usr])
+ AM_MAINTAINER_MODE([enable])
+-AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests])
++AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests serial-tests])
+ AM_SILENT_RULES([yes])
+ LT_INIT([disable-static pic-only])
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/kmod/kmod/depmod-search.conf b/meta/recipes-kernel/kmod/kmod/depmod-search.conf
new file mode 100644
index 0000000..527c0bb
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/depmod-search.conf
@@ -0,0 +1,6 @@
+#
+# /etc/depmod.d/depmod.conf
+#
+
+search updates extramodules built-in
+
diff --git a/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch
new file mode 100644
index 0000000..8161d61
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/fix-O_CLOEXEC.patch
@@ -0,0 +1,38 @@
+From bd43367eee868059770188fd9e9db38520dc6fff Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Wed, 22 Jan 2014 01:06:40 -0500
+Subject: [PATCH] libkmod/libkmod-internal.h: check whether O_CLOEXEC is
+ defined or not
+
+O_CLOEXEC is introduced from Linux 2.6.23, so old kernel doesn't have
+it, we need check before use.
+
+This patch is much more like a workaround, since it may need fcntl() use
+FD_CLOEXEC to replace.
+
+This problem was reported by "Ting Liu <b28495@freescale.com>"
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Pending
+---
+ libkmod/libkmod-internal.h |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h
+index 0180124..100b40f 100644
+--- a/libkmod/libkmod-internal.h
++++ b/libkmod/libkmod-internal.h
+@@ -9,6 +9,10 @@
+ #include "macro.h"
+ #include "libkmod.h"
+ 
++#ifndef O_CLOEXEC
++#define O_CLOEXEC 0
++#endif
++
+ static _always_inline_ _printf_format_(2, 3) void
+ 	kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {}
+ 
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-kernel/kmod/kmod/ptest.patch b/meta/recipes-kernel/kmod/kmod/ptest.patch
new file mode 100644
index 0000000..831dbcb
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/ptest.patch
@@ -0,0 +1,25 @@
+Add 'install-ptest' rule.
+
+Signed-off-by: Tudor Florea <tudor.florea@enea.com>
+Upstream-Status: Pending
+
+diff -ruN a/Makefile.am b/Makefile.am
+--- a/Makefile.am	2013-07-12 17:11:05.278331557 +0200
++++ b/Makefile.am	2013-07-12 17:14:27.033788016 +0200
+@@ -204,6 +204,16 @@
+ 
+ distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
+ 
++install-ptest:
++	@$(MKDIR_P) $(DESTDIR)/testsuite
++	@for file in $(TESTSUITE); do \
++		install $$file $(DESTDIR)/testsuite; \
++	done;
++	@sed -e 's/^Makefile/_Makefile/' < Makefile > $(DESTDIR)/Makefile
++	@$(MKDIR_P) $(DESTDIR)/tools
++	@cp $(noinst_SCRIPTS) $(noinst_PROGRAMS) $(DESTDIR)/tools
++	@cp -r testsuite/rootfs testsuite/.libs $(DESTDIR)/testsuite
++
+ # ------------------------------------------------------------------------------
+ # custom release helpers
+ # ------------------------------------------------------------------------------
diff --git a/meta/recipes-kernel/kmod/kmod/run-ptest b/meta/recipes-kernel/kmod/kmod/run-ptest
new file mode 100755
index 0000000..598dd2c
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+touch testsuite/stamp-rootfs
+tar xf testmodule.tar
+make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL
+find testsuite -name *.ko -exec rm -f {} \;
diff --git a/meta/recipes-kernel/kmod/kmod_git.bb b/meta/recipes-kernel/kmod/kmod_git.bb
new file mode 100644
index 0000000..ba4d85e
--- /dev/null
+++ b/meta/recipes-kernel/kmod/kmod_git.bb
@@ -0,0 +1,63 @@
+# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+require kmod.inc
+
+DEPENDS += "zlib"
+PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+RCONFLICTS_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+RREPLACES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+
+# to force user to remove old module-init-tools and replace them with kmod variants
+RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
+
+# autotools set prefix to /usr, however we want them in /bin and /sbin
+bindir = "${base_bindir}"
+sbindir = "${base_sbindir}"
+# libdir = "${base_libdir}"
+
+do_install_append () {
+        install -dm755 ${D}${base_bindir}
+        install -dm755 ${D}${base_sbindir}
+        # add symlinks to kmod
+        ln -s ..${base_bindir}/kmod ${D}${base_bindir}/lsmod
+        for tool in insmod rmmod depmod modinfo modprobe; do
+                ln -s ..${base_bindir}/kmod ${D}${base_sbindir}/${tool}
+        done
+        # configuration directories
+        install -dm755 ${D}${base_libdir}/depmod.d
+        install -dm755 ${D}${base_libdir}/modprobe.d
+        install -dm755 ${D}${sysconfdir}/depmod.d
+        install -dm755 ${D}${sysconfdir}/modprobe.d
+
+        # install depmod.d file for search/ dir
+        install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf"
+}
+
+do_compile_prepend() {
+            sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status
+}
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "60"
+
+ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"
+
+ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod"
+ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe"
+ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod"
+ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo"
+ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod"
+
+ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod"
+ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}"
+
+ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod"
+
+PACKAGES =+ "libkmod ${PN}-bash-completion"
+
+FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
+FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d"
+FILES_${PN}-bash-completion = "${datadir}/bash-completion"
diff --git a/meta/recipes-kernel/latencytop/latencytop-0.5/0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch b/meta/recipes-kernel/latencytop/latencytop-0.5/0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch
new file mode 100644
index 0000000..b248133
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop-0.5/0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch
@@ -0,0 +1,64 @@
+From db112739dc4f608a968b8104b382955dc3d96ca3 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 07:40:10 +0000
+Subject: [PATCH] Rectify the function signatures to fix prototype mismatches
+
+clang is less forgiving when it comes to coding standards, correct the
+function signatures to reflect the function logic
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ fsync.c      | 7 ++++---
+ latencytop.h | 2 +-
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/fsync.c b/fsync.c
+index 82dff0e..5cefba9 100644
+--- a/fsync.c
++++ b/fsync.c
+@@ -51,7 +51,7 @@ struct fsync_files {
+ static GList *fsync_data;
+ 
+ 
+-static chain_file(struct fsync_process *proc, char *filename)
++static void chain_file(struct fsync_process *proc, char *filename)
+ {
+ 	struct fsync_files *file;
+ 	GList *item;
+@@ -75,7 +75,7 @@ static chain_file(struct fsync_process *proc, char *filename)
+ 	proc->files = g_list_append(proc->files, file);
+ }
+ 
+-static report_file(char *process, char *file)
++static void report_file(char *process, char *file)
+ {
+ 	struct fsync_process *proc;
+ 	GList *item;
+@@ -157,9 +157,10 @@ int enable_fsync_tracer(void)
+ 	write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync");	
+ 	write_to_file("/sys/kernel/debug/tracing/iter_ctrl", "ftrace_printk");	
+ 	write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
++	return ret;
+ }
+ 
+-int disable_fsync_tracer(void)
++void disable_fsync_tracer(void)
+ {
+ 	write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
+ }
+diff --git a/latencytop.h b/latencytop.h
+index 5394d73..9d107a8 100644
+--- a/latencytop.h
++++ b/latencytop.h
+@@ -54,5 +54,5 @@ extern char *translate(char *line);
+ extern void init_translations(char *filename);
+ extern int fsync_display(int duration);
+ extern int enable_fsync_tracer(void);
+-extern int disable_fsync_tracer(void);
++extern void disable_fsync_tracer(void);
+ extern void update_list(void);
+-- 
+2.5.1
+
diff --git a/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch
new file mode 100644
index 0000000..7848ccf
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-fsync.patch
@@ -0,0 +1,49 @@
+linux: sysfs: use tracing_on as tracing_enabled is deprecated
+
+tracing_enabled use in the kernel is being deprecated as per commit
+6752ab4a9c30 [tracing: Deprecate tracing_enabled for tracing_on] in
+the linux mainline kernel. tracing_enabled use will generate a warning
+and may no longer function as expected, therefore move to use tracing_on.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dennis Hall <dennis.hall@windriver.com>
+
+Index: latencytop-0.5/fsync.c
+===================================================================
+--- latencytop-0.5.orig/fsync.c	2012-08-03 10:45:49.000000000 -0400
++++ latencytop-0.5/fsync.c	2012-08-03 10:48:39.000000000 -0400
+@@ -149,19 +149,19 @@
+  * cd /sys/kernel/debug/tracing
+  * echo fsync > current_tracer
+  * echo ftrace_printk > iter_ctrl 
+- * echo 1 > tracing_enabled
++ * echo 1 > tracing_on
+  */
+ 	ret = system("/bin/mount -t debugfs none /sys/kernel/debug/");
+ 	if (!ret) 
+ 		return -1;
+ 	write_to_file("/sys/kernel/debug/tracing/current_tracer", "fsync");	
+ 	write_to_file("/sys/kernel/debug/tracing/iter_ctrl", "ftrace_printk");	
+-	write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "1");
++	write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
+ }
+ 
+ int disable_fsync_tracer(void)
+ {
+-	write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "0");
++	write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
+ }
+ 
+ 
+@@ -339,8 +339,8 @@
+ 		if (curduration > 5)
+ 			curduration = 5;
+ 		/* clear the ftrace buffer */
+-		write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "0");
+-		write_to_file("/sys/kernel/debug/tracing/tracing_enabled", "1");
++		write_to_file("/sys/kernel/debug/tracing/tracing_on", "0");
++		write_to_file("/sys/kernel/debug/tracing/tracing_on", "1");
+ 		key = select(1, &rfds, NULL, NULL, &end);
+ 		parse_ftrace();
+ 		print_global_list();
diff --git a/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch
new file mode 100644
index 0000000..0cf217f
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop-0.5/latencytop-makefile.patch
@@ -0,0 +1,39 @@
+diff --git a/Makefile.orig b/Makefile
+index 16a2369..fa797a2 100644
+--- a/Makefile.orig
++++ b/Makefile
+@@ -1,10 +1,11 @@
+-# FIXME: Use autoconf ?
+-HAS_GTK_GUI = 1
++# Upstream-Status: Inappropriate [configuration]
++# Signed-off-by: Jack Mitchell <jack.mitchell@dbbroadcast.co.uk>
+ 
+ DESTDIR =
+ SBINDIR = /usr/sbin
+ XCFLAGS = -W  -g `pkg-config --cflags glib-2.0` -D_FORTIFY_SOURCE=2 -Wno-sign-compare
+-LDF = -Wl,--as-needed `pkg-config --libs glib-2.0`   -lncursesw 
++LDF = -Wl,--as-needed `pkg-config --libs glib-2.0`   -lncurses
++CC ?= gcc
+ 
+ OBJS= latencytop.o text_display.o translate.o fsync.o
+ 
+@@ -26,16 +27,17 @@ endif
+ 
+ # We write explicity this "implicit rule"
+ %.o : %.c
+-	gcc -c $(CFLAGS) $(XCFLAGS) $< -o $@
++	$(CC) -c $(CFLAGS) $(XCFLAGS) $< -o $@
+ 
+ latencytop:  $(OBJS) latencytop.h Makefile
+-	gcc $(CFLAGS) $(OBJS) $(LDF) -o latencytop 
++	$(CC) $(CFLAGS) $(OBJS) $(LDF) -o latencytop
+ 
+ clean:
+ 	rm -f *~ latencytop DEADJOE *.o
+ 
+ install: latencytop
+ 	mkdir -p $(DESTDIR)/usr/share/latencytop
++	mkdir -p $(DESTDIR)/$(SBINDIR)
+ 	install -m 0644 latencytop.trans $(DESTDIR)/usr/share/latencytop/latencytop.trans
+ 	install -m 0644 *.png $(DESTDIR)/usr/share/latencytop/
+ 	install -m 0755 latencytop $(DESTDIR)$(SBINDIR)/
diff --git a/meta/recipes-kernel/latencytop/latencytop_0.5.bb b/meta/recipes-kernel/latencytop/latencytop_0.5.bb
new file mode 100644
index 0000000..f31f1bb
--- /dev/null
+++ b/meta/recipes-kernel/latencytop/latencytop_0.5.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Linux tool for measuring and fixing latency"
+HOMEPAGE = "http://www.latencytop.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://latencytop.c;endline=23;md5=ee9ea9b1415356e5734adad4a87dc7fa"
+
+DEPENDS = "virtual/libintl ncurses glib-2.0"
+
+PR = "r3"
+
+SRC_URI = "http://pkgs.fedoraproject.org/repo/pkgs/${BPN}/${BP}.tar.gz/73bb3371c6ee0b0e68e25289027e865c/${BP}.tar.gz \
+            file://latencytop-makefile.patch \
+            file://latencytop-fsync.patch \
+            file://0001-Rectify-the-function-signatures-to-fix-prototype-mis.patch \
+"
+
+SRC_URI[md5sum] = "73bb3371c6ee0b0e68e25289027e865c"
+SRC_URI[sha256sum] = "9e7f72fbea7bd918e71212a1eabaad8488d2c602205d2e3c95d62cd57e9203ef"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+
+PACKAGECONFIG[x11] = ",,gtk+"
+
+EXTRA_OEMAKE_X = "${@bb.utils.contains('PACKAGECONFIG', 'x11', 'HAS_GTK_GUI=1', '', d)}"
+
+#CFLAGS += "${LDFLAGS}"
+
+do_install() {
+    oe_runmake install DESTDIR=${D} ${EXTRA_OEMAKE_X}
+}
diff --git a/meta/recipes-kernel/libpfm/files/0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch b/meta/recipes-kernel/libpfm/files/0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch
new file mode 100644
index 0000000..d59a7f7
--- /dev/null
+++ b/meta/recipes-kernel/libpfm/files/0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch
@@ -0,0 +1,31 @@
+From 272a8a069a8f5f06a1e5dfa0ef12f5f92984728b Mon Sep 17 00:00:00 2001
+From: Noor <noor_ahsan@mentor.com>
+Date: Wed, 12 Aug 2015 20:54:00 +0500
+Subject: [PATCH] Makefile: Add LDFLAGS variable to SLDFLAGS.
+
+* Add LDFLAGS variable to SLDFLAGS so that extra linker
+  flags can be sent via this variable.
+
+Upstream-Status: Submitted [perfmon2-libpfm4-commits@lists.sourceforge.net]
+
+Signed-off-by: Noor Ahsan <noor_ahsan@mentor.com>
+---
+ lib/Makefile |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/Makefile b/lib/Makefile
+index 1cc8765..4bd92ef 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -187,7 +187,7 @@ CFLAGS += -DCONFIG_PFMLIB_CELL
+ endif
+ 
+ ifeq ($(SYS),Linux)
+-SLDFLAGS=-shared -Wl,-soname -Wl,$(VLIBPFM)
++SLDFLAGS=$(LDFLAGS) -shared -Wl,-soname -Wl,$(VLIBPFM)
+ SLIBPFM=libpfm.so.$(VERSION).$(REVISION).$(AGE)
+ VLIBPFM=libpfm.so.$(VERSION)
+ SOLIBEXT=so
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb b/meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb
new file mode 100644
index 0000000..2dfda90
--- /dev/null
+++ b/meta/recipes-kernel/libpfm/libpfm4_4.6.0.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Monitoring tools exploiting the performance monitoring events"
+DESCRIPTION = "This package provides a library, called libpfm4 which is used to develop \
+monitoring tools exploiting the performance monitoring events such as those \
+provided by the Performance Monitoring Unit (PMU) of modern processors."
+HOMEPAGE = "http://perfmon2.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=144822&atid=759953&source=navbar"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0de488f3bd4424e308e2e399cb99c788"
+
+SECTION = "devel"
+
+COMPATIBLE_HOST = "powerpc64"
+
+SRC_URI = "http://downloads.sourceforge.net/project/perfmon2/${BPN}/libpfm-${PV}.tar.gz \
+           file://0001-Makefile-Add-LDFLAGS-variable-to-SLDFLAGS.patch \
+          "
+
+SRC_URI[md5sum] = "5077b9022440e4951d96f2d0e73bd487"
+SRC_URI[sha256sum] = "5ab1e5b0472550f9037a8800834f6bc3b927690070f69fac0b67284b4b05fd5f"
+
+EXTRA_OEMAKE = "DESTDIR=\"${D}\" PREFIX=\"${prefix}\" LIBDIR=\"${libdir}\" LDCONFIG=\"true\""
+EXTRA_OEMAKE_append_powerpc = " ARCH=\"powerpc\""
+EXTRA_OEMAKE_append_powerpc64 = " ARCH=\"powerpc\" BITMODE=\"64\""
+
+S = "${WORKDIR}/libpfm-${PV}"
+
+do_install () {
+	oe_runmake install
+}
diff --git a/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
new file mode 100644
index 0000000..ef8117c
--- /dev/null
+++ b/meta/recipes-kernel/linux-firmware/linux-firmware_git.bb
@@ -0,0 +1,433 @@
+SUMMARY = "Firmware files for use with Linux kernel"
+SECTION = "kernel"
+
+LICENSE = "\
+    Firmware-Abilis \
+    & Firmware-agere \
+    & Firmware-amd-ucode \
+    & Firmware-atheros_firmware \
+    & Firmware-broadcom_bcm43xx \
+    & Firmware-ca0132 \
+    & Firmware-chelsio_firmware \
+    & Firmware-cw1200 \
+    & Firmware-dib0700 \
+    & Firmware-ene_firmware \
+    & Firmware-fw_sst_0f28 \
+    & Firmware-go7007 \
+    & Firmware-i2400m \
+    & Firmware-ibt_firmware \
+    & Firmware-it913x \
+    & Firmware-iwlwifi_firmware \
+    & Firmware-IntcSST2 \
+    & Firmware-Marvell \
+    & Firmware-mwl8335 \
+    & Firmware-myri10ge_firmware \
+    & Firmware-OLPC \
+    & Firmware-phanfw \
+    & Firmware-qat_dh895xcc_firmware \
+    & Firmware-qla2xxx \
+    & Firmware-r8a779x_usb3 \
+    & Firmware-radeon \
+    & Firmware-ralink_a_mediatek_company_firmware \
+    & Firmware-ralink-firmware \
+    & Firmware-rtlwifi_firmware \
+    & Firmware-tda7706-firmware \
+    & Firmware-ti-connectivity \
+    & Firmware-ueagle-atm4-firmware \
+    & Firmware-via_vt6656 \
+    & Firmware-wl1251 \
+    & Firmware-xc4000 \
+    & Firmware-xc5000 \
+    & Firmware-xc5000c \
+    & Firmware-siano \
+"
+
+LIC_FILES_CHKSUM = "\
+    file://LICENCE.Abilis;md5=b5ee3f410780e56711ad48eadc22b8bc \
+    file://LICENCE.agere;md5=af0133de6b4a9b2522defd5f188afd31 \
+    file://LICENCE.atheros_firmware;md5=30a14c7823beedac9fa39c64fdd01a13 \
+    file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc \
+    file://LICENCE.ca0132;md5=209b33e66ee5be0461f13d31da392198 \
+    file://LICENCE.chelsio_firmware;md5=819aa8c3fa453f1b258ed8d168a9d903 \
+    file://LICENCE.cw1200;md5=f0f770864e7a8444a5c5aa9d12a3a7ed \
+    file://LICENCE.ene_firmware;md5=ed67f0f62f8f798130c296720b7d3921 \
+    file://LICENCE.fw_sst_0f28;md5=6353931c988ad52818ae733ac61cd293 \
+    file://LICENCE.go7007;md5=c0bb9f6aaaba55b0529ee9b30aa66beb \
+    file://LICENCE.i2400m;md5=14b901969e23c41881327c0d9e4b7d36 \
+    file://LICENCE.ibt_firmware;md5=fdbee1ddfe0fb7ab0b2fcd6b454a366b \
+    file://LICENCE.it913x;md5=1fbf727bfb6a949810c4dbfa7e6ce4f8 \
+    file://LICENCE.iwlwifi_firmware;md5=3fd842911ea93c29cd32679aa23e1c88 \
+    file://LICENCE.IntcSST2;md5=9e7d8bea77612d7cc7d9e9b54b623062 \
+    file://LICENCE.Marvell;md5=9ddea1734a4baf3c78d845151f42a37a \
+    file://LICENCE.mwl8335;md5=9a6271ee0e644404b2ff3c61fd070983 \
+    file://LICENCE.myri10ge_firmware;md5=42e32fb89f6b959ca222e25ac8df8fed \
+    file://LICENCE.OLPC;md5=5b917f9d8c061991be4f6f5f108719cd \
+    file://LICENCE.phanfw;md5=954dcec0e051f9409812b561ea743bfa \
+    file://LICENCE.qat_dh895xcc_firmware;md5=9e7d8bea77612d7cc7d9e9b54b623062 \
+    file://LICENCE.qla2xxx;md5=f5ce8529ec5c17cb7f911d2721d90e91 \
+    file://LICENCE.r8a779x_usb3;md5=4c1671656153025d7076105a5da7e498 \
+    file://LICENCE.ralink_a_mediatek_company_firmware;md5=728f1a85fd53fd67fa8d7afb080bc435 \
+    file://LICENCE.ralink-firmware.txt;md5=ab2c269277c45476fb449673911a2dfd \
+    file://LICENCE.rtlwifi_firmware.txt;md5=00d06cfd3eddd5a2698948ead2ad54a5 \
+    file://LICENCE.tda7706-firmware.txt;md5=835997cf5e3c131d0dddd695c7d9103e \
+    file://LICENCE.ti-connectivity;md5=186e7a43cf6c274283ad81272ca218ea \
+    file://LICENCE.ueagle-atm4-firmware;md5=4ed7ea6b507ccc583b9d594417714118 \
+    file://LICENCE.via_vt6656;md5=e4159694cba42d4377a912e78a6e850f \
+    file://LICENCE.wl1251;md5=ad3f81922bb9e197014bb187289d3b5b \
+    file://LICENCE.xc4000;md5=0ff51d2dc49fce04814c9155081092f0 \
+    file://LICENCE.xc5000;md5=1e170c13175323c32c7f4d0998d53f66 \
+    file://LICENCE.xc5000c;md5=12b02efa3049db65d524aeb418dd87ca \
+    file://LICENSE.amd-ucode;md5=3a0de451253cc1edbf30a3c621effee3 \
+    file://LICENSE.dib0700;md5=f7411825c8a555a1a3e5eab9ca773431 \
+    file://LICENSE.radeon;md5=6c7f97c6c62bdd9596d0238bb205118c \
+    file://LICENCE.siano;md5=602c79ae3f98f1e73d880fd9f940a418 \
+"
+
+# These are not common licenses, set NO_GENERIC_LICENSE for them
+# so that the license files will be copied from fetched source
+NO_GENERIC_LICENSE[Firmware-Abilis] = "LICENCE.Abilis"
+NO_GENERIC_LICENSE[Firmware-agere] = "LICENCE.agere"
+NO_GENERIC_LICENSE[Firmware-atheros_firmware] = "LICENCE.atheros_firmware"
+NO_GENERIC_LICENSE[Firmware-broadcom_bcm43xx] = "LICENCE.broadcom_bcm43xx"
+NO_GENERIC_LICENSE[Firmware-ca0132] = "LICENCE.ca0132"
+NO_GENERIC_LICENSE[Firmware-chelsio_firmware] = "LICENCE.chelsio_firmware"
+NO_GENERIC_LICENSE[Firmware-cw1200] = "LICENCE.cw1200"
+NO_GENERIC_LICENSE[Firmware-ene_firmware] = "LICENCE.ene_firmware"
+NO_GENERIC_LICENSE[Firmware-fw_sst_0f28] = "LICENCE.fw_sst_0f28"
+NO_GENERIC_LICENSE[Firmware-go7007] = "LICENCE.go7007"
+NO_GENERIC_LICENSE[Firmware-i2400m] = "LICENCE.i2400m"
+NO_GENERIC_LICENSE[Firmware-ibt_firmware] = "LICENCE.ibt_firmware"
+NO_GENERIC_LICENSE[Firmware-it913x] = "LICENCE.it913x"
+NO_GENERIC_LICENSE[Firmware-iwlwifi_firmware] = "LICENCE.iwlwifi_firmware"
+NO_GENERIC_LICENSE[Firmware-IntcSST2] = "LICENCE.IntcSST2"
+NO_GENERIC_LICENSE[Firmware-Marvell] = "LICENCE.Marvell"
+NO_GENERIC_LICENSE[Firmware-mwl8335] = "LICENCE.mwl8335"
+NO_GENERIC_LICENSE[Firmware-myri10ge_firmware] = "LICENCE.myri10ge_firmware"
+NO_GENERIC_LICENSE[Firmware-OLPC] = "LICENCE.OLPC"
+NO_GENERIC_LICENSE[Firmware-phanfw] = "LICENCE.phanfw"
+NO_GENERIC_LICENSE[Firmware-qat_dh895xcc_firmware] = "LICENCE.qat_dh895xcc_firmware"
+NO_GENERIC_LICENSE[Firmware-qla2xxx] = "LICENCE.qla2xxx"
+NO_GENERIC_LICENSE[Firmware-r8a779x_usb3] = "LICENCE.r8a779x_usb3"
+NO_GENERIC_LICENSE[Firmware-ralink_a_mediatek_company_firmware] = "LICENCE.ralink_a_mediatek_company_firmware"
+NO_GENERIC_LICENSE[Firmware-ralink-firmware] = "LICENCE.ralink-firmware.txt"
+NO_GENERIC_LICENSE[Firmware-rtlwifi_firmware] = "LICENCE.rtlwifi_firmware.txt"
+NO_GENERIC_LICENSE[Firmware-tda7706-firmware] = "LICENCE.tda7706-firmware.txt"
+NO_GENERIC_LICENSE[Firmware-ti-connectivity] = "LICENCE.ti-connectivity"
+NO_GENERIC_LICENSE[Firmware-ueagle-atm4-firmware] = "LICENCE.ueagle-atm4-firmware"
+NO_GENERIC_LICENSE[Firmware-via_vt6656] = "LICENCE.via_vt6656"
+NO_GENERIC_LICENSE[Firmware-wl1251] = "LICENCE.wl1251"
+NO_GENERIC_LICENSE[Firmware-xc4000] = "LICENCE.xc4000"
+NO_GENERIC_LICENSE[Firmware-xc5000] = "LICENCE.xc5000"
+NO_GENERIC_LICENSE[Firmware-xc5000c] = "LICENCE.xc5000c"
+NO_GENERIC_LICENSE[Firmware-amd-ucode] = "LICENSE.amd-ucode"
+NO_GENERIC_LICENSE[Firmware-dib0700] = "LICENSE.dib0700"
+NO_GENERIC_LICENSE[Firmware-radeon] = "LICENSE.radeon"
+NO_GENERIC_LICENSE[Firmware-siano] = "LICENCE.siano"
+
+SRCREV = "75cc3ef8ba6712fd72c073b17a790282136cc743"
+PE = "1"
+PV = "0.0+git${SRCPV}"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
+
+S = "${WORKDIR}/git"
+
+inherit allarch update-alternatives
+
+CLEANBROKEN = "1"
+
+do_compile() {
+	:
+}
+
+do_install() {
+	install -d  ${D}/lib/firmware/
+	cp -r * ${D}/lib/firmware/
+
+	# Avoid Makefile to be deployed
+	rm ${D}/lib/firmware/Makefile
+
+	# Remove unbuild firmware which needs cmake and bash
+	rm ${D}/lib/firmware/carl9170fw -rf
+
+	# Remove pointless bash script
+	rm ${D}/lib/firmware/configure
+
+	# Libertas sd8686
+	ln -sf libertas/sd8686_v9.bin ${D}/lib/firmware/sd8686.bin
+	ln -sf libertas/sd8686_v9_helper.bin ${D}/lib/firmware/sd8686_helper.bin
+
+	# fixup wl12xx location, after 2.6.37 the kernel searches a different location for it
+	( cd ${D}/lib/firmware ; ln -sf ti-connectivity/* . )
+}
+
+
+PACKAGES =+ "${PN}-ralink-license ${PN}-ralink \
+             ${PN}-radeon-license ${PN}-radeon \
+             ${PN}-marvell-license ${PN}-sd8686 ${PN}-sd8787 ${PN}-sd8797 \
+             ${PN}-ti-connectivity-license ${PN}-wl12xx ${PN}-wl18xx \
+             ${PN}-vt6656-license ${PN}-vt6656 \
+             ${PN}-rtl-license ${PN}-rtl8192cu ${PN}-rtl8192ce ${PN}-rtl8192su \
+             ${PN}-broadcom-license ${PN}-bcm4329 ${PN}-bcm4330 ${PN}-bcm4334 \
+             ${PN}-atheros-license ${PN}-ar9170 ${PN}-ar3k ${PN}-ath6k ${PN}-ath9k \
+             \
+             ${PN}-iwlwifi-license ${PN}-iwlwifi-135-6 \
+             ${PN}-iwlwifi-3160-7 ${PN}-iwlwifi-3160-8 ${PN}-iwlwifi-3160-9 \
+             ${PN}-iwlwifi-6000-4 ${PN}-iwlwifi-6000g2a-5 ${PN}-iwlwifi-6000g2a-6 \
+             ${PN}-iwlwifi-6000g2b-5 ${PN}-iwlwifi-6000g2b-6 \
+             ${PN}-iwlwifi-6050-4 ${PN}-iwlwifi-6050-5 \
+             ${PN}-iwlwifi-7260-7 ${PN}-iwlwifi-7260-8 ${PN}-iwlwifi-7260-9 \
+             ${PN}-iwlwifi-7265-8 ${PN}-iwlwifi-7265-9 \
+             \
+             ${PN}-license \
+             "
+
+# For atheros
+LICENSE_${PN}-ar9170 = "Firmware-atheros_firmware"
+LICENSE_${PN}-ar3k = "Firmware-atheros_firmware"
+LICENSE_${PN}-ath6k = "Firmware-atheros_firmware"
+LICENSE_${PN}-ath9k = "Firmware-atheros_firmware"
+
+FILES_${PN}-atheros-license = "/lib/firmware/LICENCE.atheros_firmware"
+FILES_${PN}-ar9170 = " \
+  /lib/firmware/ar9170*.fw \
+"
+FILES_${PN}-ar3k = " \
+  /lib/firmware/ar3k \
+"
+FILES_${PN}-ath6k = " \
+  /lib/firmware/ath6k \
+"
+FILES_${PN}-ath9k = " \
+  /lib/firmware/ar9271.fw \
+  /lib/firmware/ar7010*.fw \
+  /lib/firmware/htc_9271.fw \
+  /lib/firmware/htc_7010.fw \
+"
+
+RDEPENDS_${PN}-ar9170 += "${PN}-atheros-license"
+RDEPENDS_${PN}-ar3k += "${PN}-atheros-license"
+RDEPENDS_${PN}-ath6k += "${PN}-atheros-license"
+RDEPENDS_${PN}-ath9k += "${PN}-atheros-license"
+
+# For ralink
+LICENSE_${PN}-ralink = "Firmware-ralink-firmware"
+
+FILES_${PN}-ralink-license = "/lib/firmware/LICENCE.ralink-firmware.txt"
+FILES_${PN}-ralink = " \
+  /lib/firmware/rt*.bin \
+"
+
+RDEPENDS_${PN}-ralink += "${PN}-ralink-license"
+
+# For radeon
+LICENSE_${PN}-radeon = "Firmware-radeon"
+
+FILES_${PN}-radeon-license = "/lib/firmware/LICENSE.radeon"
+FILES_${PN}-radeon = " \
+  /lib/firmware/radeon \
+"
+
+RDEPENDS_${PN}-radeon += "${PN}-radeon-license"
+
+# For marvell
+LICENSE_${PN}-sd8686 = "Firmware-Marvell"
+LICENSE_${PN}-sd8787 = "Firmware-Marvell"
+LICENSE_${PN}-sd8797 = "Firmware-Marvell"
+
+FILES_${PN}-marvell-license = "/lib/firmware/LICENCE.Marvell"
+FILES_${PN}-sd8686 = " \
+  /lib/firmware/libertas/sd8686_v9* \
+  /lib/firmware/sd8686* \
+"
+FILES_${PN}-sd8787 = " \
+  /lib/firmware/mrvl/sd8787_uapsta.bin \
+"
+FILES_${PN}-sd8797 = " \
+  /lib/firmware/mrvl/sd8797_uapsta.bin \
+"
+
+RDEPENDS_${PN}-sd8686 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8787 += "${PN}-marvell-license"
+RDEPENDS_${PN}-sd8797 += "${PN}-marvell-license"
+
+# For rtl
+LICENSE_${PN}-rtl8192cu = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8192ce = "Firmware-rtlwifi_firmware"
+LICENSE_${PN}-rtl8192su = "Firmware-rtlwifi_firmware"
+
+FILES_${PN}-rtl-license = " \
+  /lib/firmware/LICENCE.rtlwifi_firmware.txt \
+"
+FILES_${PN}-rtl8192cu = " \
+  /lib/firmware/rtlwifi/rtl8192cufw.bin \
+"
+FILES_${PN}-rtl8192ce = " \
+  /lib/firmware/rtlwifi/rtl8192cfw.bin \
+"
+FILES_${PN}-rtl8192su = " \
+  /lib/firmware/rtlwifi/rtl8712u.bin \
+"
+
+RDEPENDS_${PN}-rtl8192ce += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8192cu += "${PN}-rtl-license"
+RDEPENDS_${PN}-rtl8192su = "${PN}-rtl-license"
+
+# For ti-connectivity
+LICENSE_${PN}-wl12xx = "Firmware-ti-connectivity"
+LICENSE_${PN}-wl18xx = "Firmware-ti-connectivity"
+
+FILES_${PN}-ti-connectivity-license = "/lib/firmware/LICENCE.ti-connectivity"
+FILES_${PN}-wl12xx = " \
+  /lib/firmware/wl12* \
+  /lib/firmware/TI* \
+  /lib/firmware/ti-connectivity \
+"
+FILES_${PN}-wl18xx = " \
+  /lib/firmware/wl18* \
+  /lib/firmware/TI* \
+  /lib/firmware/ti-connectivity \
+"
+
+RDEPENDS_${PN}-wl12xx = "${PN}-ti-connectivity-license"
+RDEPENDS_${PN}-wl18xx = "${PN}-ti-connectivity-license"
+
+# For vt6656
+LICENSE_${PN}-vt6656 = "Firmware-via_vt6656"
+
+FILES_${PN}-vt6656-license = "/lib/firmware/LICENCE.via_vt6656"
+FILES_${PN}-vt6656 = " \
+  /lib/firmware/vntwusb.fw \
+"
+
+RDEPENDS_${PN}-vt6656 = "${PN}-vt6656-license"
+
+# For broadcom
+#
+# WARNING: The ALTERNATIVE_* variables are not using ${PN} because of
+# a bug in bitbake; when this is fixed and bitbake learns how to proper
+# pass variable flags with expansion we can rework this patch.
+
+LICENSE_${PN}-bcm4329 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm4330 = "Firmware-broadcom_bcm43xx"
+LICENSE_${PN}-bcm4334 = "Firmware-broadcom_bcm43xx"
+
+FILES_${PN}-broadcom-license = " \
+  /lib/firmware/LICENCE.broadcom_bcm43xx \
+"
+FILES_${PN}-bcm4329 = " \
+  /lib/firmware/brcm/brcmfmac4329-sdio.bin \
+"
+FILES_${PN}-bcm4330 = " \
+  /lib/firmware/brcm/brcmfmac4330-sdio.bin \
+"
+FILES_${PN}-bcm4334 = " \
+  /lib/firmware/brcm/brcmfmac4334-sdio.bin \
+"
+
+ALTERNATIVE_LINK_NAME[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac-sdio.bin"
+
+ALTERNATIVE_linux-firmware-bcm4334 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4334[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4334-sdio.bin"
+ALTERNATIVE_linux-firmware-bcm4329 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4329[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4329-sdio.bin"
+ALTERNATIVE_linux-firmware-bcm4330 = "brcmfmac-sdio.bin"
+ALTERNATIVE_TARGET_linux-firmware-bcm4330[brcmfmac-sdio.bin] = "/lib/firmware/brcm/brcmfmac4330-sdio.bin"
+
+RDEPENDS_${PN}-bcm4329 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm4330 += "${PN}-broadcom-license"
+RDEPENDS_${PN}-bcm4334 += "${PN}-broadcom-license"
+
+# For iwlwifi
+LICENSE_${PN}-iwlwifi-135-6     = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-7    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-8    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-3160-9    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000-4    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-5 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-6 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2a-5 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6000g2b-6 = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6050-4    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-6050-5    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7260-7    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7260-8    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7260-9    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7265-8    = "Firmware-iwlwifi_firmware"
+LICENSE_${PN}-iwlwifi-7265-9    = "Firmware-iwlwifi_firmware"
+
+FILES_${PN}-iwlwifi-license = "/lib/firmware/LICENCE.iwlwifi_firmware"
+FILES_${PN}-iwlwifi-135-6 = "/lib/firmware/iwlwifi-135-6.ucode"
+FILES_${PN}-iwlwifi-3160-7 = "/lib/firmware/iwlwifi-3160-7.ucode"
+FILES_${PN}-iwlwifi-3160-8 = "/lib/firmware/iwlwifi-3160-8.ucode"
+FILES_${PN}-iwlwifi-3160-9 = "/lib/firmware/iwlwifi-3160-9.ucode"
+FILES_${PN}-iwlwifi-6000-4 = "/lib/firmware/iwlwifi-6000-4.ucode"
+FILES_${PN}-iwlwifi-6000g2a-5 = "/lib/firmware/iwlwifi-6000g2a-5.ucode"
+FILES_${PN}-iwlwifi-6000g2a-6 = "/lib/firmware/iwlwifi-6000g2a-6.ucode"
+FILES_${PN}-iwlwifi-6000g2b-5 = "/lib/firmware/iwlwifi-6000g2b-5.ucode"
+FILES_${PN}-iwlwifi-6000g2b-6 = "/lib/firmware/iwlwifi-6000g2b-6.ucode"
+FILES_${PN}-iwlwifi-6050-4 = "/lib/firmware/iwlwifi-6050-4.ucode"
+FILES_${PN}-iwlwifi-6050-5 = "/lib/firmware/iwlwifi-6050-5.ucode"
+FILES_${PN}-iwlwifi-7260-7 = "/lib/firmware/iwlwifi-7260-7.ucode"
+FILES_${PN}-iwlwifi-7260-8 = "/lib/firmware/iwlwifi-7260-8.ucode"
+FILES_${PN}-iwlwifi-7260-9 = "/lib/firmware/iwlwifi-7260-9.ucode"
+FILES_${PN}-iwlwifi-7265-8 = "/lib/firmware/iwlwifi-7265-8.ucode"
+FILES_${PN}-iwlwifi-7265-9 = "/lib/firmware/iwlwifi-7265-9.ucode"
+
+RDEPENDS_${PN}-iwlwifi-135-6     = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-7    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-8    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-3160-9    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000-4    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-5 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-6 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2a-5 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6000g2b-6 = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6050-4    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-6050-5    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7260-7    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7260-8    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7260-9    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7265-8    = "${PN}-iwlwifi-license"
+RDEPENDS_${PN}-iwlwifi-7265-9    = "${PN}-iwlwifi-license"
+
+# For other firmwares
+# Maybe split out to separate packages when needed.
+LICENSE_${PN} = "\
+    Firmware-Abilis \
+    & Firmware-agere \
+    & Firmware-amd-ucode \
+    & Firmware-ca0132 \
+    & Firmware-chelsio_firmware \
+    & Firmware-cw1200 \
+    & Firmware-dib0700 \
+    & Firmware-ene_firmware \
+    & Firmware-fw_sst_0f28 \
+    & Firmware-go7007 \
+    & Firmware-i2400m \
+    & Firmware-ibt_firmware \
+    & Firmware-it913x \
+    & Firmware-mwl8335 \
+    & Firmware-myri10ge_firmware \
+    & Firmware-OLPC \
+    & Firmware-phanfw \
+    & Firmware-qat_dh895xcc_firmware \
+    & Firmware-qla2xxx \
+    & Firmware-r8a779x_usb3 \
+    & Firmware-ralink_a_mediatek_company_firmware \
+    & Firmware-tda7706-firmware \
+    & Firmware-ueagle-atm4-firmware \
+    & Firmware-wl1251 \
+    & Firmware-xc4000 \
+    & Firmware-xc5000 \
+    & Firmware-xc5000c \
+"
+FILES_${PN}-license += "/lib/firmware/LICEN*"
+FILES_${PN} += "/lib/firmware/*"
+RDEPENDS_${PN} += "${PN}-license"
+
+# Make linux-firmware depend on all of the split-out packages.
+python populate_packages_prepend () {
+    firmware_pkgs = oe.utils.packages_filter_out_system(d)
+    d.appendVar('RDEPENDS_linux-firmware', ' ' + ' '.join(firmware_pkgs))
+}
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
new file mode 100644
index 0000000..566bc1e
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -0,0 +1,75 @@
+SUMMARY = "Sanitized set of kernel headers for the C library's use"
+SECTION = "devel"
+LICENSE = "GPLv2"
+
+#########################################################################
+####                        PLEASE READ 
+#########################################################################
+#
+# You're probably looking here thinking you need to create some new copy
+# of linux-libc-headers since you have your own custom kernel. To put 
+# this simply, you DO NOT.
+#
+# Why? These headers are used to build the libc. If you customise the 
+# headers you are customising the libc and the libc becomes machine
+# specific. Most people do not add custom libc extensions to the kernel
+# and have a machine specific libc.
+#
+# But you have some kernel headers you need for some driver? That is fine
+# but get them from STAGING_KERNEL_DIR where the kernel installs itself.
+# This will make the package using them machine specific but this is much
+# better than having a machine specific C library. This does mean your 
+# recipe needs a DEPENDS += "virtual/kernel" but again, that is fine and
+# makes total sense.
+#
+# There can also be a case where your kernel extremely old and you want
+# an older libc ABI for that old kernel. The headers installed by this
+# recipe should still be a standard mainline kernel, not your own custom 
+# one.
+#
+# -- RP
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+python __anonymous () {
+    major = d.getVar("PV",True).split('.')[0]
+    if major == "3":
+        d.setVar("HEADER_FETCH_VER", "3.0")
+    elif major == "4":
+        d.setVar("HEADER_FETCH_VER", "4.x")
+    else:
+        d.setVar("HEADER_FETCH_VER", "2.6")
+}
+
+inherit kernel-arch
+
+KORG_ARCHIVE_COMPRESSION ?= "bz2"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v${HEADER_FETCH_VER}/linux-${PV}.tar.${KORG_ARCHIVE_COMPRESSION}"
+
+S = "${WORKDIR}/linux-${PV}"
+
+do_configure() {
+	oe_runmake allnoconfig
+}
+
+do_compile () {
+}
+
+do_install() {
+	oe_runmake headers_install INSTALL_HDR_PATH=${D}${exec_prefix}
+	# Kernel should not be exporting this header
+	rm -f ${D}${exec_prefix}/include/scsi/scsi.h
+
+	# The ..install.cmd conflicts between various configure runs
+	find ${D}${includedir} -name ..install.cmd | xargs rm -f
+}
+
+BBCLASSEXTEND = "nativesdk"
+
+#DEPENDS = "cross-linkage"
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
+
+INHIBIT_DEFAULT_DEPS = "1"
+DEPENDS += "unifdef-native"
diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb
new file mode 100644
index 0000000..d816e5e
--- /dev/null
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers_4.1.bb
@@ -0,0 +1,7 @@
+KORG_ARCHIVE_COMPRESSION = "xz"
+
+require linux-libc-headers.inc
+
+SRC_URI[md5sum] = "fe9dc0f6729f36400ea81aa41d614c37"
+SRC_URI[sha256sum] = "caf51f085aac1e1cea4d00dbbf3093ead07b551fc07b31b2a989c05f8ea72d9f"
+
diff --git a/meta/recipes-kernel/linux/kernel-devsrc.bb b/meta/recipes-kernel/linux/kernel-devsrc.bb
new file mode 100644
index 0000000..196c8c7
--- /dev/null
+++ b/meta/recipes-kernel/linux/kernel-devsrc.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Linux kernel Development Source"
+DESCRIPTION = "Development source linux kernel. When built, this recipe packages the \
+source of the preferred virtual/kernel provider and makes it available for full kernel \
+development or external module builds"
+
+SECTION = "kernel"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+inherit linux-kernel-base
+
+# Whilst not a module, this ensures we don't get multilib extended (which would make no sense)
+inherit module-base
+
+# We need the kernel to be staged (unpacked, patched and configured) before
+# we can grab the source and make the source package. We also need the bits from
+# ${B} not to change while we install, so virtual/kernel must finish do_compile.
+do_install[depends] += "virtual/kernel:do_shared_workdir"
+# Need the source, not just the output of populate_sysroot
+do_install[depends] += "virtual/kernel:do_install"
+
+# There's nothing to do here, except install the source where we can package it
+do_fetch[noexec] = "1"
+do_unpack[noexec] = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_populate_sysroot[noexec] = "1"
+
+# Define where the kernel headers are installed on the target as well as where
+# they are staged.
+KERNEL_SRC_PATH = "/usr/src/kernel"
+S = "${STAGING_KERNEL_DIR}"
+B = "${STAGING_KERNEL_BUILDDIR}"
+
+KERNEL_VERSION = "${@get_kernelversion_headers('${S}')}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+do_install() {
+        kerneldir=${D}${KERNEL_SRC_PATH}
+        install -d $kerneldir
+
+        #
+        # Copy the staging dir source (and module build support) into the devsrc structure.
+        # We can keep this copy simple and take everything, since a we'll clean up any build
+        # artifacts afterwards, and the extra i/o is not significant
+        #
+        cd ${B}
+        find . -type d -name '.git*' -prune -o -path '.debug' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
+        cd ${S}
+        find . -type d -name '.git*' -prune -o -type f -print0 | cpio --null -pdlu $kerneldir
+
+        # Explicitly set KBUILD_OUTPUT to ensure that the image directory is cleaned and not
+        # The main build artifacts. We clean the directory to avoid QA errors on mismatched
+        # architecture (since scripts and helpers are native format).
+        KBUILD_OUTPUT="$kerneldir"
+        oe_runmake -C $kerneldir CC="${KERNEL_CC}" LD="${KERNEL_LD}" clean _mrproper_scripts
+
+        # As of Linux kernel version 3.0.1, the clean target removes
+        # arch/powerpc/lib/crtsavres.o which is present in
+        # KBUILD_LDFLAGS_MODULE, making it required to build external modules.
+        if [ ${ARCH} = "powerpc" ]; then
+                mkdir -p $kerneldir/arch/powerpc/lib/
+                cp ${B}/arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
+        fi
+
+        chown -R root:root ${D}
+}
+# Ensure we don't race against "make scripts" during cpio
+do_install[lockfiles] = "${TMPDIR}/kernel-scripts.lock"
+
+PACKAGES = "kernel-devsrc"
+FILES_${PN} = "${KERNEL_SRC_PATH}"
+RDEPENDS_${PN} = "bc"
diff --git a/meta/recipes-kernel/linux/linux-dtb.inc b/meta/recipes-kernel/linux/linux-dtb.inc
new file mode 100644
index 0000000..ee3a5e1
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-dtb.inc
@@ -0,0 +1,79 @@
+# Support for device tree generation
+FILES_kernel-devicetree = "/${KERNEL_IMAGEDEST}/devicetree*"
+
+python __anonymous () {
+    d.appendVar("PACKAGES", " kernel-devicetree")
+}
+
+do_compile_append() {
+	if test -n "${KERNEL_DEVICETREE}"; then
+		for DTB in ${KERNEL_DEVICETREE}; do
+			if echo ${DTB} | grep -q '/dts/'; then
+				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+			fi
+			oe_runmake ${DTB}
+		done
+	fi
+}
+
+do_install_append() {
+	if test -n "${KERNEL_DEVICETREE}"; then
+		for DTB in ${KERNEL_DEVICETREE}; do
+			if echo ${DTB} | grep -q '/dts/'; then
+				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+			fi
+			DTB_BASE_NAME=`basename ${DTB} .dtb`
+			DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+			DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+			if [ ! -e "${DTB_PATH}" ]; then
+				DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+			fi
+			install -m 0644 ${DTB_PATH} ${D}/${KERNEL_IMAGEDEST}/devicetree-${DTB_SYMLINK_NAME}.dtb
+		done
+	fi
+}
+
+do_deploy_append() {
+	if test -n "${KERNEL_DEVICETREE}"; then
+		for DTB in ${KERNEL_DEVICETREE}; do
+			if echo ${DTB} | grep -q '/dts/'; then
+				bbwarn "${DTB} contains the full path to the the dts file, but only the dtb name should be used."
+				DTB=`basename ${DTB} | sed 's,\.dts$,.dtb,g'`
+			fi
+			DTB_BASE_NAME=`basename ${DTB} .dtb`
+			DTB_NAME=`echo ${KERNEL_IMAGE_BASE_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+			DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+			DTB_PATH="${B}/arch/${ARCH}/boot/dts/${DTB}"
+			if [ ! -e "${DTB_PATH}" ]; then
+				DTB_PATH="${B}/arch/${ARCH}/boot/${DTB}"
+			fi
+			install -d ${DEPLOYDIR}
+			install -m 0644 ${DTB_PATH} ${DEPLOYDIR}/${DTB_NAME}.dtb
+			cd ${DEPLOYDIR}
+			ln -sf ${DTB_NAME}.dtb ${DTB_SYMLINK_NAME}.dtb
+			cd -
+		done
+	fi
+}
+
+pkg_postinst_kernel-devicetree () {
+	cd /${KERNEL_IMAGEDEST}
+	for DTB_FILE in ${KERNEL_DEVICETREE}
+	do
+		DTB_BASE_NAME=`basename ${DTB_FILE} | awk -F "." '{print $1}'`
+		DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+		update-alternatives --install /${KERNEL_IMAGEDEST}/${DTB_BASE_NAME}.dtb ${DTB_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
+	done
+}
+
+pkg_postrm_kernel-devicetree () {
+	cd /${KERNEL_IMAGEDEST}
+	for DTB_FILE in ${KERNEL_DEVICETREE}
+	do
+		DTB_BASE_NAME=`basename ${DTB_FILE} | awk -F "." '{print $1}'`
+		DTB_SYMLINK_NAME=`echo ${KERNEL_IMAGE_SYMLINK_NAME} | sed "s/${MACHINE}/${DTB_BASE_NAME}/g"`
+		update-alternatives --remove ${DTB_BASE_NAME}.dtb devicetree-${DTB_SYMLINK_NAME}.dtb ${KERNEL_PRIORITY} || true
+	done
+}
diff --git a/meta/recipes-kernel/linux/linux-dummy.bb b/meta/recipes-kernel/linux/linux-dummy.bb
new file mode 100644
index 0000000..cc0e4e6
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-dummy.bb
@@ -0,0 +1,54 @@
+SUMMARY = "Dummy Linux kernel"
+DESCRIPTION = "Dummy Linux kernel, to be selected as the preferred \
+provider for virtual/kernel to satisfy dependencies for situations \
+where you wish to build the kernel externally from the build system."
+SECTION = "kernel"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING.GPL;md5=751419260aa954499f7abaabaa882bbe"
+
+PROVIDES += "virtual/kernel"
+
+PACKAGES_DYNAMIC += "^kernel-module-.*"
+PACKAGES_DYNAMIC += "^kernel-image-.*"
+PACKAGES_DYNAMIC += "^kernel-firmware-.*"
+
+PACKAGES += "kernel-modules"
+FILES_kernel-modules = ""
+ALLOW_EMPTY_kernel-modules = "1"
+DESCRIPTION_kernel-modules = "Kernel modules meta package"
+
+#COMPATIBLE_MACHINE = "your_machine"
+
+PR = "r1"
+
+SRC_URI = "file://COPYING.GPL"
+S = "${WORKDIR}"
+
+do_configure() {
+	:
+}
+
+do_compile () {
+	:
+}
+
+do_shared_workdir () {
+	:
+}
+
+do_install() {
+	:
+}
+
+do_bundle_initramfs() {
+	:
+}
+
+do_deploy() {
+	:
+}
+
+addtask bundle_initramfs after do_install before do_deploy
+addtask deploy after do_install
+addtask shared_workdir after do_compile before do_install
diff --git a/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL b/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-dummy/COPYING.GPL
@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/meta/recipes-kernel/linux/linux-yocto-dev.bb b/meta/recipes-kernel/linux/linux-yocto-dev.bb
new file mode 100644
index 0000000..afe482a
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-dev.bb
@@ -0,0 +1,51 @@
+# This recipe tracks the linux-yocto-dev repository as its upstream source.
+# Since this tree is frequently updated, and periodically rebuilt, AUTOREV is
+# used to track its contents.
+#
+# This recipe is just like other linux-yocto variants, with the only difference
+# being that to avoid network access during initial parsing, static SRCREVs are
+# provided and overridden if the preferred kernel provider is linux-yocto-dev.
+#
+# To enable this recipe, set PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-dev"
+
+inherit kernel
+require recipes-kernel/linux/linux-yocto.inc
+
+# provide this .inc to set specific revisions
+include recipes-kernel/linux/linux-yocto-dev-revisions.inc
+
+# Skip processing of this recipe if it is not explicitly specified as the
+# PREFERRED_PROVIDER for virtual/kernel. This avoids network access required
+# by the use of AUTOREV SRCREVs, which are the default for this recipe.
+python () {
+    if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-yocto-dev":
+        raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-yocto-dev to enable it")
+}
+
+KBRANCH = "standard/base"
+KMETA = "kernel-meta"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-dev.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=master;destsuffix=${KMETA}"
+
+# Set default SRCREVs. Both the machine and meta SRCREVs are statically set
+# to the korg v3.7 tag, and hence prevent network access during parsing. If
+# linux-yocto-dev is the preferred provider, they will be overridden to
+# AUTOREV in following anonymous python routine and resolved when the
+# variables are finalized.
+SRCREV_machine ?= '${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "${AUTOREV}", "29594404d7fe73cd80eaa4ee8c43dcc53970c60e", d)}'
+SRCREV_meta ?= '${@oe.utils.conditional("PREFERRED_PROVIDER_virtual/kernel", "linux-yocto-dev", "${AUTOREV}", "29594404d7fe73cd80eaa4ee8c43dcc53970c60e", d)}'
+
+LINUX_VERSION ?= "4.2-rc+"
+LINUX_VERSION_EXTENSION ?= "-yoctodev-${LINUX_KERNEL_TYPE}"
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+COMPATIBLE_MACHINE = "(qemuarm|qemux86|qemuppc|qemumips|qemumips64|qemux86-64)"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
+
diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_3.14.bb b/meta/recipes-kernel/linux/linux-yocto-rt_3.14.bb
new file mode 100644
index 0000000..4d3d5c8
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_3.14.bb
@@ -0,0 +1,28 @@
+KBRANCH ?= "standard/preempt-rt/base"
+KBRANCH_qemuppc ?= "standard/preempt-rt/qemuppc"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+SRCREV_machine ?= "8281915527ba8d79e59906c02f28e7aa11424723"
+SRCREV_machine_qemuppc ?= "5e7d372ebc327f28656fc972fab55605eea8aec3"
+SRCREV_meta ?= "3a09b38a9f5015c56d99d17aa7c2f200c566249b"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.14.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-3.14;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "3.14.36"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+LINUX_KERNEL_TYPE = "preempt-rt"
+
+COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
diff --git a/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb b/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
new file mode 100644
index 0000000..06483c3
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-rt_4.1.bb
@@ -0,0 +1,26 @@
+KBRANCH ?= "standard/preempt-rt"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+SRCREV_machine ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_meta ?= "429f9e2ff0649b8c9341345622545d874d5e303a"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.1.6"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+LINUX_KERNEL_TYPE = "preempt-rt"
+
+COMPATIBLE_MACHINE = "(qemux86|qemux86-64|qemuarm|qemuppc|qemumips)"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc features/taskstats/taskstats.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc"
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_3.14.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_3.14.bb
new file mode 100644
index 0000000..412c817
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_3.14.bb
@@ -0,0 +1,23 @@
+KBRANCH ?= "standard/tiny/base"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "3.14.36"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
+SRCREV_meta ?= "3a09b38a9f5015c56d99d17aa7c2f200c566249b"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.14.git;branch=${KBRANCH};name=machine; \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-3.14;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "(qemux86)"
+
+# Functionality flags
+KERNEL_FEATURES = ""
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_3.19.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_3.19.bb
new file mode 100644
index 0000000..a6a58a2
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_3.19.bb
@@ -0,0 +1,23 @@
+KBRANCH ?= "standard/tiny/base"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "3.19.5"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
+SRCREV_meta ?= "1016714868249d64fc16692fd7679672b1efa17b"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.19.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-3.19;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "(qemux86)"
+
+# Functionality flags
+KERNEL_FEATURES = ""
diff --git a/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb b/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
new file mode 100644
index 0000000..061205e
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto-tiny_4.1.bb
@@ -0,0 +1,23 @@
+KBRANCH ?= "standard/tiny/base"
+LINUX_KERNEL_TYPE = "tiny"
+KCONFIG_MODE = "--allnoconfig"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+LINUX_VERSION ?= "4.1.6"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+SRCREV_machine ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_meta ?= "429f9e2ff0649b8c9341345622545d874d5e303a"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;branch=${KBRANCH};name=machine \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
+
+COMPATIBLE_MACHINE = "(qemux86)"
+
+# Functionality flags
+KERNEL_FEATURES = ""
diff --git a/meta/recipes-kernel/linux/linux-yocto.inc b/meta/recipes-kernel/linux/linux-yocto.inc
new file mode 100644
index 0000000..3b41a61
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto.inc
@@ -0,0 +1,51 @@
+DESCRIPTION = "Yocto Kernel"
+SECTION = "kernel"
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+INC_PR = "r4"
+
+DEPENDS += "xz-native bc-native"
+DEPENDS_append_aarch64 = " libgcc"
+KERNEL_CC_append_aarch64 = " ${TOOLCHAIN_OPTIONS}"
+KERNEL_LD_append_aarch64 = " ${TOOLCHAIN_OPTIONS}"
+
+# A KMACHINE is the mapping of a yocto $MACHINE to what is built
+# by the kernel. This is typically the branch that should be built,
+# and it can be specific to the machine or shared
+# KMACHINE = "UNDEFINED"
+
+LINUX_KERNEL_TYPE ?= "standard"
+
+# KMETA ?= ""
+KBRANCH ?= "master"
+KMACHINE ?= "${MACHINE}"
+SRCREV_FORMAT ?= "meta_machine" 
+
+# LEVELS:
+#   0: no reporting
+#   1: report options that are specified, but not in the final config
+#   2: report options that are not hardware related, but set by a BSP
+KCONF_AUDIT_LEVEL ?= "1"
+KCONF_BSP_AUDIT_LEVEL ?= "0"
+
+LINUX_VERSION_EXTENSION ?= "-yocto-${LINUX_KERNEL_TYPE}"
+
+# Pick up shared functions
+inherit kernel
+inherit kernel-yocto
+require linux-dtb.inc
+
+B = "${WORKDIR}/linux-${PACKAGE_ARCH}-${LINUX_KERNEL_TYPE}-build"
+
+do_install_append(){
+	if [ -n "${KMETA}" ]; then
+		rm -rf ${STAGING_KERNEL_DIR}/${KMETA}
+	fi
+}
+
+# extra tasks
+addtask kernel_link_vmlinux after do_compile before do_install
+addtask validate_branches before do_patch after do_kernel_checkout
+addtask kernel_configcheck after do_configure before do_compile
diff --git a/meta/recipes-kernel/linux/linux-yocto_3.14.bb b/meta/recipes-kernel/linux/linux-yocto_3.14.bb
new file mode 100644
index 0000000..b6b2e5a
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto_3.14.bb
@@ -0,0 +1,41 @@
+KBRANCH ?= "standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm  ?= "standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "standard/qemuarm64"
+KBRANCH_qemumips ?= "standard/mti-malta32"
+KBRANCH_qemuppc  ?= "standard/qemuppc"
+KBRANCH_qemux86  ?= "standard/common-pc/base"
+KBRANCH_qemux86-64 ?= "standard/common-pc-64/base"
+KBRANCH_qemumips64 ?= "standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "4817747912b5c50ce5c31ef25658340ca615e1b4"
+SRCREV_machine_qemuarm64 ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
+SRCREV_machine_qemumips ?= "6ed76ec26b120f65f8547c8612b7334bd2745ec9"
+SRCREV_machine_qemuppc ?= "a86ade84b2e142c0fd7536d96477107b6d07db5c"
+SRCREV_machine_qemux86 ?= "af1f7f586bd32d39c057f17606991b887eadb389"
+SRCREV_machine_qemux86-64 ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
+SRCREV_machine_qemumips64 ?= "a63d40b860a6d255005a541894d53729090b40ea"
+SRCREV_machine ?= "578602a722dbfb260801f3b37c6eafd2abb2340d"
+SRCREV_meta ?= "3a09b38a9f5015c56d99d17aa7c2f200c566249b"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.14.git;branch=${KBRANCH};name=machine; \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-3.14;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "3.14.36"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/linux/linux-yocto_3.19.bb b/meta/recipes-kernel/linux/linux-yocto_3.19.bb
new file mode 100644
index 0000000..e8c1640
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto_3.19.bb
@@ -0,0 +1,41 @@
+KBRANCH ?= "standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm  ?= "standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "standard/qemuarm64"
+KBRANCH_qemumips ?= "standard/mti-malta32"
+KBRANCH_qemuppc  ?= "standard/qemuppc"
+KBRANCH_qemux86  ?= "standard/common-pc"
+KBRANCH_qemux86-64 ?= "standard/common-pc-64/base"
+KBRANCH_qemumips64 ?= "standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "963b4df663dba2584ac864e0c016825de0046558"
+SRCREV_machine_qemuarm64 ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
+SRCREV_machine_qemumips ?= "cedbbc7b5e72df2e820bb9e7885f12132c5e2fff"
+SRCREV_machine_qemuppc ?= "23a83386e10986a63e6cef712a045445499d002b"
+SRCREV_machine_qemux86 ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
+SRCREV_machine_qemux86-64 ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
+SRCREV_machine_qemumips64 ?= "3eb70cea3532e22ab1b6da9864446621229e6616"
+SRCREV_machine ?= "e152349de59b43b2a75f2c332b44171df461d5a0"
+SRCREV_meta ?= "1016714868249d64fc16692fd7679672b1efa17b"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-3.19.git;name=machine;branch=${KBRANCH}; \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-3.19;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "3.19.5"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/linux/linux-yocto_4.1.bb b/meta/recipes-kernel/linux/linux-yocto_4.1.bb
new file mode 100644
index 0000000..46d4616
--- /dev/null
+++ b/meta/recipes-kernel/linux/linux-yocto_4.1.bb
@@ -0,0 +1,41 @@
+KBRANCH ?= "standard/base"
+
+require recipes-kernel/linux/linux-yocto.inc
+
+# board specific branches
+KBRANCH_qemuarm  ?= "standard/arm-versatile-926ejs"
+KBRANCH_qemuarm64 ?= "standard/qemuarm64"
+KBRANCH_qemumips ?= "standard/mti-malta32"
+KBRANCH_qemuppc  ?= "standard/qemuppc"
+KBRANCH_qemux86  ?= "standard/base"
+KBRANCH_qemux86-64 ?= "standard/base"
+KBRANCH_qemumips64 ?= "standard/mti-malta64"
+
+SRCREV_machine_qemuarm ?= "3c1245d162ccb55de1af42bcf3dbf690457bf9e4"
+SRCREV_machine_qemuarm64 ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_machine_qemumips ?= "4132a691d0908d10b8f07ce7ece02e6dc94e17bc"
+SRCREV_machine_qemuppc ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_machine_qemux86 ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_machine_qemux86-64 ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_machine_qemumips64 ?= "033e1aa633465449edf544eb81adda0caf16ec60"
+SRCREV_machine ?= "59b8c4f5e8ddb9c33c62fff22204fe2b0d8c703e"
+SRCREV_meta ?= "429f9e2ff0649b8c9341345622545d874d5e303a"
+
+SRC_URI = "git://git.yoctoproject.org/linux-yocto-4.1.git;name=machine;branch=${KBRANCH}; \
+           git://git.yoctoproject.org/yocto-kernel-cache;type=kmeta;name=meta;branch=yocto-4.1;destsuffix=${KMETA}"
+
+LINUX_VERSION ?= "4.1.6"
+
+PV = "${LINUX_VERSION}+git${SRCPV}"
+
+KMETA = "kernel-meta"
+KCONF_BSP_AUDIT_LEVEL = "2"
+
+COMPATIBLE_MACHINE = "qemuarm|qemuarm64|qemux86|qemuppc|qemumips|qemumips64|qemux86-64"
+
+# Functionality flags
+KERNEL_EXTRA_FEATURES ?= "features/netfilter/netfilter.scc"
+KERNEL_FEATURES_append = " ${KERNEL_EXTRA_FEATURES}"
+KERNEL_FEATURES_append_qemux86=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append_qemux86-64=" cfg/sound.scc cfg/paravirt_kvm.scc"
+KERNEL_FEATURES_append = " ${@bb.utils.contains("TUNE_FEATURES", "mx32", " cfg/x32.scc", "" ,d)}"
diff --git a/meta/recipes-kernel/lttng/babeltrace/0001-Fix-invalid-pointer-free-with-trace-collection.patch b/meta/recipes-kernel/lttng/babeltrace/0001-Fix-invalid-pointer-free-with-trace-collection.patch
new file mode 100644
index 0000000..3e2c4e1
--- /dev/null
+++ b/meta/recipes-kernel/lttng/babeltrace/0001-Fix-invalid-pointer-free-with-trace-collection.patch
@@ -0,0 +1,44 @@
+From e4cad900994cf286d971796a947fea782dfc6651 Mon Sep 17 00:00:00 2001
+From: Francis Giraldeau <francis.giraldeau@gmail.com>
+Date: Mon, 15 Jun 2015 11:43:02 -0400
+Subject: [PATCH] Fix invalid pointer free with trace collection
+
+Upstream-Status: Submitted
+
+Patch proposed by Li RongQing related to bug# 790
+
+Signed-off-by: Mikael Beckius <mikael.beckius@windriver.com>
+Signed-off-by: Francis Giraldeau <francis.giraldeau@gmail.com>
+---
+ lib/context.c | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/lib/context.c b/lib/context.c
+index 45aab34..8d3770f 100644
+--- a/lib/context.c
++++ b/lib/context.c
+@@ -79,7 +79,7 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path,
+ 	struct bt_trace_descriptor *td;
+ 	struct bt_format *fmt;
+ 	struct bt_trace_handle *handle;
+-	int ret, closeret;
++	int ret;
+ 
+ 	if (!ctx || !format_name || (!path && !stream_list))
+ 		return -EINVAL;
+@@ -159,10 +159,8 @@ int bt_context_add_trace(struct bt_context *ctx, const char *path,
+ 	return handle->id;
+ 
+ error:
+-	closeret = fmt->close_trace(td);
+-	if (closeret) {
+-		fprintf(stderr, "Error in close_trace callback\n");
+-	}
++	if (handle)
++		bt_context_remove_trace(ctx, handle->id);
+ end:
+ 	return ret;
+ }
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/lttng/babeltrace_1.2.4.bb b/meta/recipes-kernel/lttng/babeltrace_1.2.4.bb
new file mode 100644
index 0000000..536be41
--- /dev/null
+++ b/meta/recipes-kernel/lttng/babeltrace_1.2.4.bb
@@ -0,0 +1,24 @@
+SUMMARY = "Babeltrace - Trace Format Babel Tower"
+DESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log."
+HOMEPAGE = "http://www.efficios.com/babeltrace/"
+BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
+
+LICENSE = "MIT & GPLv2"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
+
+inherit autotools pkgconfig
+
+DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
+
+SRCREV = "90395824efc007de88787a6b8e400a07c980be1c"
+PV = "1.2.4+git${SRCPV}"
+
+SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-1.2 \
+           file://0001-Fix-invalid-pointer-free-with-trace-collection.patch \
+"
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend () {
+	( cd ${S}; ${S}/bootstrap )
+}
diff --git a/meta/recipes-kernel/lttng/lttng-modules_git.bb b/meta/recipes-kernel/lttng/lttng-modules_git.bb
new file mode 100644
index 0000000..54544fe
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-modules_git.bb
@@ -0,0 +1,33 @@
+SECTION = "devel"
+SUMMARY = "Linux Trace Toolkit KERNEL MODULE"
+DESCRIPTION = "The lttng-modules 2.0 package contains the kernel tracer modules"
+LICENSE = "LGPLv2.1 & GPLv2 & MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1412caf5a1aa90d6a48588a4794c0eac \
+                    file://gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \
+                    file://lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad"
+
+inherit module
+
+SRCREV = "7a88f8b50696dd71e80c08661159caf8e119bf51"
+PV = "2.6.2+git${SRCPV}"
+
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|aarch64|mips|arm).*-linux'
+
+SRC_URI = "git://git.lttng.org/lttng-modules.git;branch=stable-2.6"
+
+export INSTALL_MOD_DIR="kernel/lttng-modules"
+
+EXTRA_OEMAKE += "KERNELDIR='${STAGING_KERNEL_DIR}'"
+
+S = "${WORKDIR}/git"
+
+do_install_append() {
+	# Delete empty directories to avoid QA failures if no modules were built
+	find ${D}/lib -depth -type d -empty -exec rmdir {} \;
+}
+
+python do_package_prepend() {
+    if not os.path.exists(os.path.join(d.getVar('D', True), 'lib/modules')):
+        bb.warn("%s: no modules were created; this may be due to CONFIG_TRACEPOINTS not being enabled in your kernel." % d.getVar('PN', True))
+}
+
diff --git a/meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch b/meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch
new file mode 100644
index 0000000..199ef57
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/extern-decls.patch
@@ -0,0 +1,442 @@
+This make the declarations to be extern so they dont end up
+in duplicates in data.rel.ro sections
+
+avoid errors like
+
+| ../../../src/common/.libs/libcommon.a(mi-lttng.o):(.data.rel.ro.local+0x0): multiple definition of `mi_lttng_element_snapshots'
+| commands/enable_events.o:(.bss+0x48): first defined here
+| collect2: error: ld returned 1 exit status
+| Makefile:502: recipe for target 'lttng' failed
+| make[3]: *** [lttng] Error 1
+
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: git/src/common/config/config-session-abi.h
+===================================================================
+--- git.orig/src/common/config/config-session-abi.h
++++ git/src/common/config/config-session-abi.h
+@@ -18,95 +18,95 @@
+ #ifndef CONFIG_SESSION_INTERNAL_H
+ #define CONFIG_SESSION_INTERNAL_H
+ 
+-const char * const config_element_channel;
+-const char * const config_element_channels;
+-const char * const config_element_domain;
+-const char * const config_element_domains;
+-const char * const config_element_event;
+-const char * const config_element_events;
+-const char * const config_element_context;
+-const char * const config_element_contexts;
+-const char * const config_element_attributes;
+-const char * const config_element_exclusion;
+-const char * const config_element_exclusions;
+-const char * const config_element_function_attributes;
+-const char * const config_element_probe_attributes;
+-const char * const config_element_symbol_name;
+-const char * const config_element_address;
+-const char * const config_element_offset;
+-const char * const config_element_name;
+-const char * const config_element_enabled;
+-const char * const config_element_overwrite_mode;
+-const char * const config_element_subbuf_size;
+-const char * const config_element_num_subbuf;
+-const char * const config_element_switch_timer_interval;
+-const char * const config_element_read_timer_interval;
+-const char * const config_element_output;
+-const char * const config_element_output_type;
+-const char * const config_element_tracefile_size;
+-const char * const config_element_tracefile_count;
+-const char * const config_element_live_timer_interval;
+-const char * const config_element_type;
+-const char * const config_element_buffer_type;
+-const char * const config_element_session;
+-const char * const config_element_sessions;
+-const char * const config_element_perf;
+-const char * const config_element_config;
+-const char * const config_element_started;
+-const char * const config_element_snapshot_mode;
+-const char * const config_element_loglevel;
+-const char * const config_element_loglevel_type;
+-const char * const config_element_filter;
+-const char * const config_element_snapshot_outputs;
+-const char * const config_element_consumer_output;
+-const char * const config_element_destination;
+-const char * const config_element_path;
+-const char * const config_element_net_output;
+-const char * const config_element_control_uri;
+-const char * const config_element_data_uri;
+-const char * const config_element_max_size;
+-
+-const char * const config_domain_type_kernel;
+-const char * const config_domain_type_ust;
+-const char * const config_domain_type_jul;
+-const char * const config_domain_type_log4j;
+-
+-const char * const config_buffer_type_per_pid;
+-const char * const config_buffer_type_per_uid;
+-const char * const config_buffer_type_global;
+-
+-const char * const config_overwrite_mode_discard;
+-const char * const config_overwrite_mode_overwrite;
+-
+-const char * const config_output_type_splice;
+-const char * const config_output_type_mmap;
+-
+-const char * const config_loglevel_type_all;
+-const char * const config_loglevel_type_range;
+-const char * const config_loglevel_type_single;
+-
+-const char * const config_event_type_all;
+-const char * const config_event_type_tracepoint;
+-const char * const config_event_type_probe;
+-const char * const config_event_type_function;
+-const char * const config_event_type_function_entry;
+-const char * const config_event_type_noop;
+-const char * const config_event_type_syscall;
+-const char * const config_event_type_kprobe;
+-const char * const config_event_type_kretprobe;
+-
+-const char * const config_event_context_pid;
+-const char * const config_event_context_procname;
+-const char * const config_event_context_prio;
+-const char * const config_event_context_nice;
+-const char * const config_event_context_vpid;
+-const char * const config_event_context_tid;
+-const char * const config_event_context_vtid;
+-const char * const config_event_context_ppid;
+-const char * const config_event_context_vppid;
+-const char * const config_event_context_pthread_id;
+-const char * const config_event_context_hostname;
+-const char * const config_event_context_ip;
+-const char * const config_event_context_perf_thread_counter;
++extern const char * const config_element_channel;
++extern const char * const config_element_channels;
++extern const char * const config_element_domain;
++extern const char * const config_element_domains;
++extern const char * const config_element_event;
++extern const char * const config_element_events;
++extern const char * const config_element_context;
++extern const char * const config_element_contexts;
++extern const char * const config_element_attributes;
++extern const char * const config_element_exclusion;
++extern const char * const config_element_exclusions;
++extern const char * const config_element_function_attributes;
++extern const char * const config_element_probe_attributes;
++extern const char * const config_element_symbol_name;
++extern const char * const config_element_address;
++extern const char * const config_element_offset;
++extern const char * const config_element_name;
++extern const char * const config_element_enabled;
++extern const char * const config_element_overwrite_mode;
++extern const char * const config_element_subbuf_size;
++extern const char * const config_element_num_subbuf;
++extern const char * const config_element_switch_timer_interval;
++extern const char * const config_element_read_timer_interval;
++extern const char * const config_element_output;
++extern const char * const config_element_output_type;
++extern const char * const config_element_tracefile_size;
++extern const char * const config_element_tracefile_count;
++extern const char * const config_element_live_timer_interval;
++extern const char * const config_element_type;
++extern const char * const config_element_buffer_type;
++extern const char * const config_element_session;
++extern const char * const config_element_sessions;
++extern const char * const config_element_perf;
++extern const char * const config_element_config;
++extern const char * const config_element_started;
++extern const char * const config_element_snapshot_mode;
++extern const char * const config_element_loglevel;
++extern const char * const config_element_loglevel_type;
++extern const char * const config_element_filter;
++extern const char * const config_element_snapshot_outputs;
++extern const char * const config_element_consumer_output;
++extern const char * const config_element_destination;
++extern const char * const config_element_path;
++extern const char * const config_element_net_output;
++extern const char * const config_element_control_uri;
++extern const char * const config_element_data_uri;
++extern const char * const config_element_max_size;
++
++extern const char * const config_domain_type_kernel;
++extern const char * const config_domain_type_ust;
++extern const char * const config_domain_type_jul;
++extern const char * const config_domain_type_log4j;
++
++extern const char * const config_buffer_type_per_pid;
++extern const char * const config_buffer_type_per_uid;
++extern const char * const config_buffer_type_global;
++
++extern const char * const config_overwrite_mode_discard;
++extern const char * const config_overwrite_mode_overwrite;
++
++extern const char * const config_output_type_splice;
++extern const char * const config_output_type_mmap;
++
++extern const char * const config_loglevel_type_all;
++extern const char * const config_loglevel_type_range;
++extern const char * const config_loglevel_type_single;
++
++extern const char * const config_event_type_all;
++extern const char * const config_event_type_tracepoint;
++extern const char * const config_event_type_probe;
++extern const char * const config_event_type_function;
++extern const char * const config_event_type_function_entry;
++extern const char * const config_event_type_noop;
++extern const char * const config_event_type_syscall;
++extern const char * const config_event_type_kprobe;
++extern const char * const config_event_type_kretprobe;
++
++extern const char * const config_event_context_pid;
++extern const char * const config_event_context_procname;
++extern const char * const config_event_context_prio;
++extern const char * const config_event_context_nice;
++extern const char * const config_event_context_vpid;
++extern const char * const config_event_context_tid;
++extern const char * const config_event_context_vtid;
++extern const char * const config_event_context_ppid;
++extern const char * const config_event_context_vppid;
++extern const char * const config_event_context_pthread_id;
++extern const char * const config_event_context_hostname;
++extern const char * const config_event_context_ip;
++extern const char * const config_event_context_perf_thread_counter;
+ 
+ #endif /* CONFIG_SESSION_INTERNAL_H */
+Index: git/src/common/mi-lttng.h
+===================================================================
+--- git.orig/src/common/mi-lttng.h
++++ git/src/common/mi-lttng.h
+@@ -49,133 +49,133 @@ struct mi_lttng_version {
+ };
+ 
+ /* Strings related to command */
+-const char * const mi_lttng_element_command;
+-const char * const mi_lttng_element_command_action;
+-const char * const mi_lttng_element_command_add_context;
+-const char * const mi_lttng_element_command_calibrate;
+-const char * const mi_lttng_element_command_create;
+-const char * const mi_lttng_element_command_destroy;
+-const char * const mi_lttng_element_command_disable_channel;
+-const char * const mi_lttng_element_command_disable_event;
+-const char * const mi_lttng_element_command_enable_channels;
+-const char * const mi_lttng_element_command_enable_event;
+-const char * const mi_lttng_element_command_list;
+-const char * const mi_lttng_element_command_load;
+-const char * const mi_lttng_element_command_name;
+-const char * const mi_lttng_element_command_output;
+-const char * const mi_lttng_element_command_save;
+-const char * const mi_lttng_element_command_set_session;
+-const char * const mi_lttng_element_command_snapshot;
+-const char * const mi_lttng_element_command_snapshot_add;
+-const char * const mi_lttng_element_command_snapshot_del;
+-const char * const mi_lttng_element_command_snapshot_list;
+-const char * const mi_lttng_element_command_snapshot_record;
+-const char * const mi_lttng_element_command_start;
+-const char * const mi_lttng_element_command_stop;
+-const char * const mi_lttng_element_command_success;
+-const char * const mi_lttng_element_command_version;
++extern const char * const mi_lttng_element_command;
++extern const char * const mi_lttng_element_command_action;
++extern const char * const mi_lttng_element_command_add_context;
++extern const char * const mi_lttng_element_command_calibrate;
++extern const char * const mi_lttng_element_command_create;
++extern const char * const mi_lttng_element_command_destroy;
++extern const char * const mi_lttng_element_command_disable_channel;
++extern const char * const mi_lttng_element_command_disable_event;
++extern const char * const mi_lttng_element_command_enable_channels;
++extern const char * const mi_lttng_element_command_enable_event;
++extern const char * const mi_lttng_element_command_list;
++extern const char * const mi_lttng_element_command_load;
++extern const char * const mi_lttng_element_command_name;
++extern const char * const mi_lttng_element_command_output;
++extern const char * const mi_lttng_element_command_save;
++extern const char * const mi_lttng_element_command_set_session;
++extern const char * const mi_lttng_element_command_snapshot;
++extern const char * const mi_lttng_element_command_snapshot_add;
++extern const char * const mi_lttng_element_command_snapshot_del;
++extern const char * const mi_lttng_element_command_snapshot_list;
++extern const char * const mi_lttng_element_command_snapshot_record;
++extern const char * const mi_lttng_element_command_start;
++extern const char * const mi_lttng_element_command_stop;
++extern const char * const mi_lttng_element_command_success;
++extern const char * const mi_lttng_element_command_version;
+ 
+ /* Strings related to version command */
+-const char * const mi_lttng_element_version;
+-const char * const mi_lttng_element_version_commit;
+-const char * const mi_lttng_element_version_description;
+-const char * const mi_lttng_element_version_license;
+-const char * const mi_lttng_element_version_major;
+-const char * const mi_lttng_element_version_minor;
+-const char * const mi_lttng_element_version_patch_level;
+-const char * const mi_lttng_element_version_str;
+-const char * const mi_lttng_element_version_web;
++extern const char * const mi_lttng_element_version;
++extern const char * const mi_lttng_element_version_commit;
++extern const char * const mi_lttng_element_version_description;
++extern const char * const mi_lttng_element_version_license;
++extern const char * const mi_lttng_element_version_major;
++extern const char * const mi_lttng_element_version_minor;
++extern const char * const mi_lttng_element_version_patch_level;
++extern const char * const mi_lttng_element_version_str;
++extern const char * const mi_lttng_element_version_web;
+ 
+ /* String related to a lttng_event_field */
+-const char * const mi_lttng_element_event_field;
+-const char * const mi_lttng_element_event_fields;
++extern const char * const mi_lttng_element_event_field;
++extern const char * const mi_lttng_element_event_fields;
+ 
+ /* String related to lttng_event_context */
+-const char * const mi_lttng_context_type_perf_counter;
+-const char * const mi_lttng_context_type_perf_cpu_counter;
+-const char * const mi_lttng_context_type_perf_thread_counter;
++extern const char * const mi_lttng_context_type_perf_counter;
++extern const char * const mi_lttng_context_type_perf_cpu_counter;
++extern const char * const mi_lttng_context_type_perf_thread_counter;
+ 
+ /* String related to lttng_event_perf_counter_ctx */
+-const char * const mi_lttng_element_perf_counter_context;
++extern const char * const mi_lttng_element_perf_counter_context;
+ 
+ /* Strings related to pid */
+-const char * const mi_lttng_element_pids;
+-const char * const mi_lttng_element_pid;
+-const char * const mi_lttng_element_pid_id;
++extern const char * const mi_lttng_element_pids;
++extern const char * const mi_lttng_element_pid;
++extern const char * const mi_lttng_element_pid_id;
+ 
+ /* Strings related to save command */
+-const char * const mi_lttng_element_save;
++extern const char * const mi_lttng_element_save;
+ 
+ /* Strings related to load command */
+-const char * const mi_lttng_element_load;
++extern const char * const mi_lttng_element_load;
+ 
+ /* General element of mi_lttng */
+-const char * const mi_lttng_element_empty;
+-const char * const mi_lttng_element_id;
+-const char * const mi_lttng_element_nowrite;
+-const char * const mi_lttng_element_success;
+-const char * const mi_lttng_element_type_enum;
+-const char * const mi_lttng_element_type_float;
+-const char * const mi_lttng_element_type_integer;
+-const char * const mi_lttng_element_type_other;
+-const char * const mi_lttng_element_type_string;
++extern const char * const mi_lttng_element_empty;
++extern const char * const mi_lttng_element_id;
++extern const char * const mi_lttng_element_nowrite;
++extern const char * const mi_lttng_element_success;
++extern const char * const mi_lttng_element_type_enum;
++extern const char * const mi_lttng_element_type_float;
++extern const char * const mi_lttng_element_type_integer;
++extern const char * const mi_lttng_element_type_other;
++extern const char * const mi_lttng_element_type_string;
+ 
+ /* String related to loglevel */
+-const char * const mi_lttng_loglevel_str_alert;
+-const char * const mi_lttng_loglevel_str_crit;
+-const char * const mi_lttng_loglevel_str_debug;
+-const char * const mi_lttng_loglevel_str_debug_function;
+-const char * const mi_lttng_loglevel_str_debug_line;
+-const char * const mi_lttng_loglevel_str_debug_module;
+-const char * const mi_lttng_loglevel_str_debug_process;
+-const char * const mi_lttng_loglevel_str_debug_program;
+-const char * const mi_lttng_loglevel_str_debug_system;
+-const char * const mi_lttng_loglevel_str_debug_unit;
+-const char * const mi_lttng_loglevel_str_emerg;
+-const char * const mi_lttng_loglevel_str_err;
+-const char * const mi_lttng_loglevel_str_info;
+-const char * const mi_lttng_loglevel_str_notice;
+-const char * const mi_lttng_loglevel_str_unknown;
+-const char * const mi_lttng_loglevel_str_warning;
++extern const char * const mi_lttng_loglevel_str_alert;
++extern const char * const mi_lttng_loglevel_str_crit;
++extern const char * const mi_lttng_loglevel_str_debug;
++extern const char * const mi_lttng_loglevel_str_debug_function;
++extern const char * const mi_lttng_loglevel_str_debug_line;
++extern const char * const mi_lttng_loglevel_str_debug_module;
++extern const char * const mi_lttng_loglevel_str_debug_process;
++extern const char * const mi_lttng_loglevel_str_debug_program;
++extern const char * const mi_lttng_loglevel_str_debug_system;
++extern const char * const mi_lttng_loglevel_str_debug_unit;
++extern const char * const mi_lttng_loglevel_str_emerg;
++extern const char * const mi_lttng_loglevel_str_err;
++extern const char * const mi_lttng_loglevel_str_info;
++extern const char * const mi_lttng_loglevel_str_notice;
++extern const char * const mi_lttng_loglevel_str_unknown;
++extern const char * const mi_lttng_loglevel_str_warning;
+ 
+ /* String related to loglevel JUL */
+-const char * const mi_lttng_loglevel_str_jul_all;
+-const char * const mi_lttng_loglevel_str_jul_config;
+-const char * const mi_lttng_loglevel_str_jul_fine;
+-const char * const mi_lttng_loglevel_str_jul_finer;
+-const char * const mi_lttng_loglevel_str_jul_finest;
+-const char * const mi_lttng_loglevel_str_jul_info;
+-const char * const mi_lttng_loglevel_str_jul_off;
+-const char * const mi_lttng_loglevel_str_jul_severe;
+-const char * const mi_lttng_loglevel_str_jul_warning;
++extern const char * const mi_lttng_loglevel_str_jul_all;
++extern const char * const mi_lttng_loglevel_str_jul_config;
++extern const char * const mi_lttng_loglevel_str_jul_fine;
++extern const char * const mi_lttng_loglevel_str_jul_finer;
++extern const char * const mi_lttng_loglevel_str_jul_finest;
++extern const char * const mi_lttng_loglevel_str_jul_info;
++extern const char * const mi_lttng_loglevel_str_jul_off;
++extern const char * const mi_lttng_loglevel_str_jul_severe;
++extern const char * const mi_lttng_loglevel_str_jul_warning;
+ 
+ /* String related to loglevel Log4j */
+-const char * const mi_lttng_loglevel_str_log4j_off;
+-const char * const mi_lttng_loglevel_str_log4j_fatal;
+-const char * const mi_lttng_loglevel_str_log4j_error;
+-const char * const mi_lttng_loglevel_str_log4j_warn;
+-const char * const mi_lttng_loglevel_str_log4j_info;
+-const char * const mi_lttng_loglevel_str_log4j_debug;
+-const char * const mi_lttng_loglevel_str_log4j_trace;
+-const char * const mi_lttng_loglevel_str_log4j_all;
++extern const char * const mi_lttng_loglevel_str_log4j_off;
++extern const char * const mi_lttng_loglevel_str_log4j_fatal;
++extern const char * const mi_lttng_loglevel_str_log4j_error;
++extern const char * const mi_lttng_loglevel_str_log4j_warn;
++extern const char * const mi_lttng_loglevel_str_log4j_info;
++extern const char * const mi_lttng_loglevel_str_log4j_debug;
++extern const char * const mi_lttng_loglevel_str_log4j_trace;
++extern const char * const mi_lttng_loglevel_str_log4j_all;
+ 
+ /* String related to loglevel type */
+-const char * const mi_lttng_loglevel_type_all;
+-const char * const mi_lttng_loglevel_type_range;
+-const char * const mi_lttng_loglevel_type_single;
+-const char * const mi_lttng_loglevel_type_unknown;
++extern const char * const mi_lttng_loglevel_type_all;
++extern const char * const mi_lttng_loglevel_type_range;
++extern const char * const mi_lttng_loglevel_type_single;
++extern const char * const mi_lttng_loglevel_type_unknown;
+ 
+ /* Sting related to lttng_calibrate */
+-const char * const mi_lttng_element_calibrate;
+-const char * const mi_lttng_element_calibrate_function;
++extern const char * const mi_lttng_element_calibrate;
++extern const char * const mi_lttng_element_calibrate_function;
+ 
+ /* String related to a lttng_snapshot */
+-const char * const mi_lttng_element_snapshot_ctrl_url;
+-const char * const mi_lttng_element_snapshot_data_url;
+-const char * const mi_lttng_element_snapshot_max_size;
+-const char * const mi_lttng_element_snapshot_n_ptr;
+-const char * const mi_lttng_element_snapshot_session_name;
+-const char * const mi_lttng_element_snapshots;
++extern const char * const mi_lttng_element_snapshot_ctrl_url;
++extern const char * const mi_lttng_element_snapshot_data_url;
++extern const char * const mi_lttng_element_snapshot_max_size;
++extern const char * const mi_lttng_element_snapshot_n_ptr;
++extern const char * const mi_lttng_element_snapshot_session_name;
++extern const char * const mi_lttng_element_snapshots;
+ 
+ /* Utility string function  */
+ const char *mi_lttng_loglevel_string(int value, enum lttng_domain_type domain);
diff --git a/meta/recipes-kernel/lttng/lttng-tools/lttng-tools-Fix-live-timer-calculation-error.patch b/meta/recipes-kernel/lttng/lttng-tools/lttng-tools-Fix-live-timer-calculation-error.patch
new file mode 100644
index 0000000..4719d95
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/lttng-tools-Fix-live-timer-calculation-error.patch
@@ -0,0 +1,42 @@
+From 161496fbe1465817a77a50a1172734dae81a13ef Mon Sep 17 00:00:00 2001
+From: Mikael Beckius <mikael.beckius@windriver.com>
+Date: Tue, 12 May 2015 11:11:48 +0200
+Subject: [PATCH] lttng-tools: Fix live timer calculation error
+
+There is an calculation error for live timer. Variable switch_timer_interval is
+based on microsecond, and it is not right to assign switch_timer_interval mod
+1000000 to var tv_nsec which is based on nanosecond.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikael Beckius <mikael.beckius@windriver.com>
+Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
+---
+ src/common/consumer-timer.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c
+index 1408052..c6202ba 100644
+--- a/src/common/consumer-timer.c
++++ b/src/common/consumer-timer.c
+@@ -368,7 +368,7 @@ void consumer_timer_switch_start(struct lttng_consumer_channel *channel,
+ 	channel->switch_timer_enabled = 1;
+ 
+ 	its.it_value.tv_sec = switch_timer_interval / 1000000;
+-	its.it_value.tv_nsec = switch_timer_interval % 1000000;
++	its.it_value.tv_nsec = (switch_timer_interval % 1000000) * 1000;
+ 	its.it_interval.tv_sec = its.it_value.tv_sec;
+ 	its.it_interval.tv_nsec = its.it_value.tv_nsec;
+ 
+@@ -425,7 +425,7 @@ void consumer_timer_live_start(struct lttng_consumer_channel *channel,
+ 	channel->live_timer_enabled = 1;
+ 
+ 	its.it_value.tv_sec = live_timer_interval / 1000000;
+-	its.it_value.tv_nsec = live_timer_interval % 1000000;
++	its.it_value.tv_nsec = (live_timer_interval % 1000000) * 1000;
+ 	its.it_interval.tv_sec = its.it_value.tv_sec;
+ 	its.it_interval.tv_nsec = its.it_value.tv_nsec;
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/lttng/lttng-tools/run-ptest b/meta/recipes-kernel/lttng/lttng-tools/run-ptest
new file mode 100755
index 0000000..e758815
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/run-ptest
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+make -C tests installcheck
+
diff --git a/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch b/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch
new file mode 100644
index 0000000..958bce4
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/runtest-2.4.0.patch
@@ -0,0 +1,27 @@
+diff --git a/Makefile.am b/Makefile.am
+index 584f59b..c2bcabd 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -12,3 +12,9 @@ dist_doc_DATA = LICENSE \
+ dist_noinst_DATA = CodingStyle
+ 
+ EXTRA_DIST = extras/lttng-bash_completion gpl-2.0.txt lgpl-2.1.txt
++
++install-ptest:
++	cp -r $(srcdir)/tests $(DESTDIR)
++	for m in $$(find $(DESTDIR)/tests -name Makefile); do \
++          sed -i -e 's|^Makefile:|_Makefile:|' $$m; \
++        done
+diff --git a/tests/run.sh b/tests/run.sh
+index c6c50fd..6455359 100755
+--- a/tests/run.sh
++++ b/tests/run.sh
+@@ -19,4 +19,7 @@
+ 
+ [ -z "$1" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1
+ 
+-prove --merge --exec '' - < $1
++prove --merge -v --exec '' - < $1 | sed \
++  -e 's|^ok \(.*\)|PASS: \1|' \
++  -e 's|^not ok \(.*\)|FAIL: \1|' \
++  | egrep -h 'PASS|FAIL'
diff --git a/meta/recipes-kernel/lttng/lttng-tools/runtest.patch b/meta/recipes-kernel/lttng/lttng-tools/runtest.patch
new file mode 100644
index 0000000..545a5dc
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools/runtest.patch
@@ -0,0 +1,52 @@
+diff --git a/Makefile.am b/Makefile.am
+index 584f59b..c2bcabd 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -12,3 +12,9 @@ dist_doc_DATA = LICENSE \
+ dist_noinst_DATA = CodingStyle
+ 
+ EXTRA_DIST = extras/lttng-bash_completion gpl-2.0.txt lgpl-2.1.txt
++
++install-ptest:
++	cp -r $(srcdir)/tests $(DESTDIR)
++	for m in $$(find $(DESTDIR)/tests -name Makefile); do \
++          sed -i -e 's|^Makefile:|_Makefile:|' $$m; \
++        done
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 6d5b00d..3774f9d 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -1,14 +1,17 @@
+ SUBDIRS = utils regression unit stress
+ 
+-if USE_PYTHON
+-check-am:
++installcheck-am:
+ 	./run.sh unit_tests
+ 	./run.sh fast_regression
++if USE_PYTHON
+ 	./run.sh with_bindings_regression
+-else
++endif
++
+ check-am:
+ 	./run.sh unit_tests
+ 	./run.sh fast_regression
++if USE_PYTHON
++	./run.sh with_bindings_regression
+ endif
+ 
+ dist_noinst_SCRIPTS = run.sh unit_tests fast_regression long_regression root_regression with_bindings_regression
+diff --git a/tests/run.sh b/tests/run.sh
+index c6c50fd..6455359 100755
+--- a/tests/run.sh
++++ b/tests/run.sh
+@@ -19,4 +19,7 @@
+ 
+ [ -z "$1" ] && echo "Error: No testlist. Please specify a testlist to run." && exit 1
+ 
+-prove --merge --exec '' - < $1
++prove --merge -v --exec '' - < $1 | sed \
++  -e 's|^ok \(.*\)|PASS: \1|' \
++  -e 's|^not ok \(.*\)|FAIL: \1|' \
++  | egrep -h 'PASS|FAIL'
diff --git a/meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb b/meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb
new file mode 100644
index 0000000..6397a98
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-tools_2.6.0.bb
@@ -0,0 +1,82 @@
+SECTION = "devel"
+SUMMARY = "Linux Trace Toolkit Control"
+DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \
+to extract program execution details from the Linux operating system \
+and interpret them."
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \
+                    file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca"
+
+DEPENDS = "liburcu popt lttng-ust libxml2"
+RDEPENDS_${PN}-ptest += "make perl bash"
+
+SRCREV = "d522c1f14285e2e8b10b7c0cd011847696ffe779"
+
+PYTHON_OPTION = "am_cv_python_pyexecdir='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \
+                 am_cv_python_pythondir='${libdir}/python${PYTHON_BASEVERSION}/site-packages' \
+                 PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}' \
+"
+PACKAGECONFIG ??= "lttng-ust"
+PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python swig-native"
+PACKAGECONFIG[lttng-ust] = "--enable-lttng-ust, --disable-lttng-ust, lttng-ust"
+PACKAGECONFIG[kmod] = "--enable-kmod, --disable-kmod, kmod"
+
+SRC_URI = "git://git.lttng.org/lttng-tools.git;branch=stable-2.6 \
+           file://runtest-2.4.0.patch \
+           file://extern-decls.patch \
+           file://run-ptest \
+           file://lttng-tools-Fix-live-timer-calculation-error.patch \
+	  "
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep ptest pkgconfig useradd
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "tracing"
+
+export KERNELDIR="${STAGING_KERNEL_DIR}"
+
+FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
+                ${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
+FILES_${PN}-dbg += "${libdir}/lttng/libexec/.debug \
+                    ${libdir}/python2.7/site-packages/.debug"
+FILES_${PN}-staticdev += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.a"
+FILES_${PN}-dev += "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.la"
+
+# Since files are installed into ${libdir}/lttng/libexec we match 
+# the libexec insane test so skip it.
+# Python module needs to keep _lttng.so
+INSANE_SKIP_${PN} = "libexec dev-so"
+INSANE_SKIP_${PN}-dbg = "libexec"
+
+do_configure_prepend () {
+	# Delete a shipped m4 file that overrides our patched one
+	rm -f ${S}/config/libxml.m4
+}
+
+do_install_ptest () {
+	chmod +x ${D}${PTEST_PATH}/tests/utils/utils.sh
+	for i in `find ${D}${PTEST_PATH} -perm /u+x -type f`; do
+		sed -e "s:\$TESTDIR.*/src/bin/lttng/\$LTTNG_BIN:\$LTTNG_BIN:g" \
+		  -e "s:\$TESTDIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \
+		  -e "s:\$DIR/../src/bin/lttng-sessiond/\$SESSIOND_BIN:\$SESSIOND_BIN:g" \
+		  -e "s:\$TESTDIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \
+		  -e "s:\$DIR/../src/bin/lttng-consumerd/:${libdir}/lttng/libexec/:g" \
+		  -e "s:\$TESTDIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
+		  -e "s:\$DIR/../src/bin/lttng-sessiond/lttng-sessiond:\$SESSIOND_BIN:g" \
+		  -e "s:\$DIR/../src/bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
+		  -e "s:\$DIR/../bin/lttng-relayd/\$RELAYD_BIN:\$RELAYD_BIN:g" \
+		  -i $i
+	done
+
+	sed -e "s:src/bin/lttng-sessiond:$bindir:g" \
+	    -e "s:src/bin/lttng-consumerd:${libexecdir}/libexec/:g" \
+	-i ${D}${PTEST_PATH}/tests/regression/run-report.py
+	sed -e "s:src/bin:bin:g" -e "s:lt-::g" \
+	-i ${D}${PTEST_PATH}/tests/utils/utils.sh
+	sed -e "s:ini_config:\.libs\/ini_config:" \
+	-i ${D}${PTEST_PATH}/tests/unit/ini_config/test_ini_config
+}
diff --git a/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-Fix-live-timer-calculation-error.patch b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-Fix-live-timer-calculation-error.patch
new file mode 100644
index 0000000..03120fe
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-Fix-live-timer-calculation-error.patch
@@ -0,0 +1,42 @@
+From 6d02a6c1aeb1d050ffe7c6624bab9acfa76fc05f Mon Sep 17 00:00:00 2001
+From: Mikael Beckius <mikael.beckius@windriver.com>
+Date: Tue, 12 May 2015 11:04:34 +0200
+Subject: [PATCH] lttng-ust:Fix live timer calculation error
+
+There is an calculation error for live timer. Variable chan->switch_timer_interval is
+based on microsecond, and it is not right to assign chan->switch_timer_interval mod
+1000000 to var tv_nsec which is based on nanosecond.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikael Beckius <mikael.beckius@windriver.com>
+Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com>
+---
+ libringbuffer/ring_buffer_frontend.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libringbuffer/ring_buffer_frontend.c b/libringbuffer/ring_buffer_frontend.c
+index eb4e486..e0377a3 100644
+--- a/libringbuffer/ring_buffer_frontend.c
++++ b/libringbuffer/ring_buffer_frontend.c
+@@ -528,7 +528,7 @@ void lib_ring_buffer_channel_switch_timer_start(struct channel *chan)
+ 	}
+ 
+ 	its.it_value.tv_sec = chan->switch_timer_interval / 1000000;
+-	its.it_value.tv_nsec = chan->switch_timer_interval % 1000000;
++	its.it_value.tv_nsec = (chan->switch_timer_interval % 1000000) * 1000;
+ 	its.it_interval.tv_sec = its.it_value.tv_sec;
+ 	its.it_interval.tv_nsec = its.it_value.tv_nsec;
+ 
+@@ -582,7 +582,7 @@ void lib_ring_buffer_channel_read_timer_start(struct channel *chan)
+ 	}
+ 
+ 	its.it_value.tv_sec = chan->read_timer_interval / 1000000;
+-	its.it_value.tv_nsec = chan->read_timer_interval % 1000000;
++	its.it_value.tv_nsec = (chan->read_timer_interval % 1000000) * 1000;
+ 	its.it_interval.tv_sec = its.it_value.tv_sec;
+ 	its.it_interval.tv_nsec = its.it_value.tv_nsec;
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
new file mode 100644
index 0000000..b68a989
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust/lttng-ust-doc-examples-disable.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Inappropriate [embedded specific]
+
+Don't build the doc examples - we don't need them and in fact they
+never successfully built in previous iterations of the lttng-ust
+recipe anyway.
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: doc/Makefile.am
+===================================================================
+--- a/doc/Makefile.am
++++ b/doc/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = . examples
++SUBDIRS = .
+ 
+ dist_man_MANS = man/lttng-gen-tp.1 \
+ 	man/lttng-ust.3 \
diff --git a/meta/recipes-kernel/lttng/lttng-ust_git.bb b/meta/recipes-kernel/lttng/lttng-ust_git.bb
new file mode 100644
index 0000000..ae4afd3
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust_git.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Linux Trace Toolkit Userspace Tracer 2.x"
+DESCRIPTION = "The LTTng UST 2.x package contains the userspace tracer library to trace userspace codes."
+HOMEPAGE = "http://lttng.org/ust"
+BUGTRACKER = "https://bugs.lttng.org/projects/lttng-ust"
+
+LICENSE = "LGPLv2.1+ & MIT & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c963eb366b781252b0bf0fdf1624d9e9 \
+                    file://snprintf/snprintf.c;endline=32;md5=d3d544959d8a3782b2e07451be0a903c \
+                    file://snprintf/various.h;endline=31;md5=89f2509b6b4682c4fc95255eec4abe44"
+
+inherit autotools lib_package
+
+DEPENDS = "liburcu util-linux"
+RDEPENDS_${PN}-bin = "python-core"
+
+# For backwards compatibility after rename
+RPROVIDES_${PN} = "lttng2-ust"
+RREPLACES_${PN} = "lttng2-ust"
+RCONFLICTS_${PN} = "lttng2-ust"
+
+SRCREV = "c49ee9040ada6984c880756614e8a6f7fd645bd6"
+PE = "2"
+PV = "2.6.2+git${SRCPV}"
+
+SRC_URI = "git://git.lttng.org/lttng-ust.git;branch=stable-2.6 \
+           file://lttng-ust-doc-examples-disable.patch \
+           file://lttng-ust-Fix-live-timer-calculation-error.patch \
+        "
+
+S = "${WORKDIR}/git"
+
+do_configure_prepend () {
+	( cd ${S}; ${S}/bootstrap )
+}
diff --git a/meta/recipes-kernel/modutils-initscripts/files/PD.patch b/meta/recipes-kernel/modutils-initscripts/files/PD.patch
new file mode 100644
index 0000000..21ac49c
--- /dev/null
+++ b/meta/recipes-kernel/modutils-initscripts/files/PD.patch
@@ -0,0 +1,8 @@
+Upstream-Status: Inappropriate [licensing]
+
+Index: modutils-initscripts-1.0/LICENSE
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ modutils-initscripts-1.0/LICENSE	2010-12-06 14:26:03.570339002 -0800
+@@ -0,0 +1 @@
++Public Domain
diff --git a/meta/recipes-kernel/modutils-initscripts/files/modutils.sh b/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
new file mode 100755
index 0000000..a78adf5
--- /dev/null
+++ b/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          module-init-tools
+# Required-Start:    
+# Required-Stop:     
+# Should-Start:      checkroot
+# Should-stop:
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Process /etc/modules.
+# Description:       Load the modules listed in /etc/modules.
+### END INIT INFO
+
+LOAD_MODULE=modprobe
+[ -f /proc/modules ] || exit 0
+[ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0
+[ -e /sbin/modprobe ] || LOAD_MODULE=insmod
+
+if [ ! -f /lib/modules/`uname -r`/modules.dep ]; then
+	[ "$VERBOSE" != no ] && echo "Calculating module dependencies ..."
+	depmod -Ae
+fi
+
+loaded_modules=" "
+
+process_file() {
+	file=$1
+
+	(cat $file; echo; ) |
+	while read module args
+	do
+		case "$module" in
+			\#*|"") continue ;;
+		esac
+		[ -n "$(echo $loaded_modules | grep " $module ")" ] && continue
+		[ "$VERBOSE" != no ] && echo -n "$module "
+		eval "$LOAD_MODULE $module $args >/dev/null 2>&1"
+		loaded_modules="${loaded_modules}${module} "
+	done
+}
+
+[ "$VERBOSE" != no ] && echo -n "Loading modules: "
+[ -f /etc/modules ] && process_file /etc/modules
+
+[ -d /etc/modules-load.d ] || exit 0
+
+for f in /etc/modules-load.d/*.conf; do
+	process_file $f
+done
+[ "$VERBOSE" != no ] && echo
+
+exit 0
diff --git a/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb b/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
new file mode 100644
index 0000000..db670cf
--- /dev/null
+++ b/meta/recipes-kernel/modutils-initscripts/modutils-initscripts.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Initscript for auto-loading kernel modules on boot"
+SECTION = "base"
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=7bf87fc37976e93ec66ad84fac58c098"
+SRC_URI = "file://modutils.sh \
+	   file://PD.patch"
+
+PR = "r7"
+
+S = "${WORKDIR}"
+
+INITSCRIPT_NAME = "modutils.sh"
+INITSCRIPT_PARAMS = "start 05 S ."
+
+inherit update-rc.d
+
+do_compile () {
+}
+
+do_install () {
+	install -d ${D}${sysconfdir}/init.d/
+	install -m 0755 ${WORKDIR}/modutils.sh ${D}${sysconfdir}/init.d/
+}
+
+DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd-systemctl-native','',d)}"
+pkg_postinst_${PN} () {
+	if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+		if [ -n "$D" ]; then
+			OPTS="--root=$D"
+		fi
+		systemctl $OPTS mask modutils.service
+	fi
+}
diff --git a/meta/recipes-kernel/oprofile/oprofile.inc b/meta/recipes-kernel/oprofile/oprofile.inc
new file mode 100644
index 0000000..6ec56e7
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile.inc
@@ -0,0 +1,58 @@
+SUMMARY = "System-Wide Profiler"
+DESCRIPTION = "OProfile is a system-wide profiler for Linux systems, capable \
+of profiling all running code at low overhead."
+HOMEPAGE = "http://oprofile.sourceforge.net/news/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=16191&atid=116191"
+
+LICENSE = "LGPLv2.1+ & GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://libopagent/opagent.h;beginline=5;endline=26;md5=4f16f72c7a493d8a4704aa18d03d15c6 \
+                   "
+SECTION = "devel"
+
+DEPENDS = "popt binutils"
+RDEPENDS_${PN} = "binutils-symlinks"
+RRECOMMENDS_${PN} = "kernel-vmlinux"
+
+FILES_${PN} = "${bindir} ${libdir}/${BPN}/lib*${SOLIBS} ${datadir}/${BPN}"
+FILES_${PN}-dev += "${libdir}/${BPN}/lib*${SOLIBSDEV} ${libdir}/${BPN}/lib*.la"
+FILES_${PN}-staticdev += "${libdir}/${BPN}/lib*.a"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+           file://acinclude.m4 \
+           file://automake-foreign.patch \
+           file://oprofile-cross-compile-tests.patch \
+           file://run-ptest \
+           file://root-home-dir.patch"
+
+inherit autotools pkgconfig ptest
+
+EXTRA_OECONF = "--with-kernel=${STAGING_DIR_HOST}${prefix} --without-x ac_cv_prog_XSLTPROC="
+do_configure () {
+	cp ${WORKDIR}/acinclude.m4 ${S}/
+	autotools_do_configure
+}
+
+EXTRA_OEMAKE = "SRCDIR=${PTEST_PATH}/libutil++/tests"
+do_compile_ptest() {
+	oe_runmake check
+}
+
+do_install_ptest() {
+	subdirs="libdb/tests libutil++/tests libregex/tests libutil/tests libop/tests libdb/tests "
+	for tooltest in ${subdirs}
+	do
+		find ${tooltest} -perm /u=x -type f| cpio -pvdu ${D}${PTEST_PATH}
+	done
+
+	# needed by some libop tests
+	cp -r events ${D}${PTEST_PATH}
+
+	# needed by libregex regex_test
+	cp libregex/stl.pat ${D}${PTEST_PATH}/libregex
+	cp libregex/tests/mangled-name ${D}${PTEST_PATH}/libregex/tests
+
+	# needed by litutil++ file_manip_tests
+	cp ${S}/libutil++/tests/file_manip_tests.cpp \
+		libutil++/tests/file_manip_tests.o ${D}${PTEST_PATH}/libutil++/tests
+}
diff --git a/meta/recipes-kernel/oprofile/oprofile/acinclude.m4 b/meta/recipes-kernel/oprofile/oprofile/acinclude.m4
new file mode 100644
index 0000000..95ecd91
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/acinclude.m4
@@ -0,0 +1,581 @@
+dnl AX_KERNEL_OPTION(option, action-if-found, action-if-not-found)
+dnl see if autoconf.h defines the option
+AC_DEFUN([AX_KERNEL_OPTION], [
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+AC_TRY_COMPILE( [#include <linux/config.h>],
+[
+#ifndef $1
+break_me_hard(\\\);
+#endif
+],[$2],[$3],)
+CFLAGS=$SAVE_CFLAGS
+])
+
+dnl Handle the 2.4 module inside module/
+AC_DEFUN([AX_CONFIG_MODULE],
+[
+if test ! -f $KINC/linux/autoconf.h; then
+	AC_MSG_ERROR([no suitably configured kernel include tree found])
+fi
+
+dnl  --- Get Linux kernel version and compile parameters ---
+
+AC_SUBST(KVERS)
+AC_MSG_CHECKING([for kernel version])
+dnl it's like this to handle mandrake's fubar version.h - bug #471448
+eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $[]3}'`
+AC_MSG_RESULT([$KVERS])
+case "$KVERS" in
+2.2.*|2.4.*) ;;
+*) AC_MSG_ERROR([Unsupported kernel version])
+esac
+
+dnl Check for the minimal kernel version supported
+AC_MSG_CHECKING([kernel version])
+AX_KERNEL_VERSION(2, 2, 10, <=, AC_MSG_RESULT([ok]), AC_MSG_ERROR([check html documentation install section]))
+
+dnl linux/spinlock.h added at some point in past
+AC_MSG_CHECKING([for $KINC/linux/spinlock.h])
+if test -f $KINC/linux/spinlock.h; then
+	EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER"
+	AC_MSG_RESULT([yes])
+else
+	AC_MSG_RESULT([no])
+fi
+
+AC_MSG_CHECKING([for rtc_lock])
+gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null
+if test "$?" -eq 0; then
+	EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK"
+	AC_MSG_RESULT([yes])
+else
+	AC_MSG_RESULT([no])
+fi
+	 
+arch="unknown"
+AC_MSG_CHECKING(for x86-64 architecture)
+AX_KERNEL_OPTION(CONFIG_X86_64, x8664=1, x8664=0)
+AX_MSG_RESULT_YN($x8664)
+BUILD_HAMMER=no
+if test "$x8664" -eq 1; then
+	arch="x86"
+	BUILD_HAMMER=yes
+else
+	AC_MSG_CHECKING(for x86 architecture)
+	AX_KERNEL_OPTION(CONFIG_X86, x86=1, x86=0)
+	AX_KERNEL_OPTION(CONFIG_X86_WP_WORKS_OK, x86=1, x86=$x86)
+	AX_MSG_RESULT_YN($x86)
+	test "$x86" = 1 && arch="x86"
+	
+	if test "$arch" = "unknown"; then
+  		AC_MSG_CHECKING(for ia64 architecture)
+  		AX_KERNEL_OPTION(CONFIG_IA64, ia64=1, ia64=0)
+  		AX_MSG_RESULT_YN($ia64)
+  		test "$ia64" = 1 && arch="ia64"
+	fi
+
+fi
+AC_SUBST(BUILD_HAMMER)
+
+test "$arch" = "unknown" && AC_MSG_ERROR(Unsupported architecture)
+
+dnl check to see if kernel verion appropriate for arch
+AC_MSG_CHECKING(arch/kernel version combination)
+case "$arch" in
+ia64)
+	AX_KERNEL_VERSION(2, 4, 18, <, AC_MSG_RESULT([ok]),
+		AC_MSG_ERROR([unsupported arch/kernel])) ;;
+*) AC_MSG_RESULT([ok])
+esac
+
+dnl for now we do not support PREEMPT patch
+AC_MSG_CHECKING([for preempt patch])
+AX_KERNEL_OPTION(CONFIG_PREEMPT,preempt=1,preempt=0)
+AX_MSG_RESULT_YN([$preempt])
+test "$preempt" = 0 || AC_MSG_ERROR([unsupported kernel configuration : CONFIG_PREEMPT])
+
+AC_SUBST(KINC)
+
+MODINSTALLDIR=/lib/modules/$KVERS
+ 
+OPROFILE_MODULE_ARCH=$arch
+AC_SUBST(OPROFILE_MODULE_ARCH)
+]
+)
+
+dnl AX_MSG_RESULT_YN(a)
+dnl results "yes" iff a==1, "no" else
+AC_DEFUN([AX_MSG_RESULT_YN], [x=no
+test "x$1" = "x1" && x=yes
+AC_MSG_RESULT($x)])
+
+dnl AX_MALLOC_ATTRIBUTE - see if gcc will take __attribute__((malloc))
+AC_DEFUN([AX_MALLOC_ATTRIBUTE],
+[
+AC_MSG_CHECKING([whether malloc attribute is understood])
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+AC_TRY_COMPILE(,[
+void monkey() __attribute__((malloc));
+],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no]))
+CFLAGS=$SAVE_CFLAGS 
+]
+)
+
+dnl builtin_expect is used in module we can't add that in config.h
+AC_DEFUN([AX_BUILTIN_EXPECT],
+[
+AC_MSG_CHECKING([whether __builtin_expect is understood])
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+AC_TRY_LINK(,[
+int i;
+if (__builtin_expect(i, 0)) { }
+],
+AC_MSG_RESULT([yes]); EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK",
+AC_MSG_RESULT([no]);)
+CFLAGS=$SAVE_CFLAGS 
+]
+) 
+
+dnl AX_EXTRA_DIRS - Let user specify extra dirs for include/libs
+AC_DEFUN([AX_EXTRA_DIRS],
+[
+AC_ARG_WITH(extra-includes,
+[  --with-extra-includes=DIR    add extra include paths],
+  use_extra_includes="$withval",
+  use_extra_includes=NO
+)
+if test -n "$use_extra_includes" && \
+        test "$use_extra_includes" != "NO"; then
+  ac_save_ifs=$IFS
+  IFS=':'
+  for dir in $use_extra_includes; do
+    extra_includes="$extra_includes -I$dir"
+  done
+  IFS=$ac_save_ifs
+  CPPFLAGS="$CPPFLAGS $extra_includes"
+fi
+
+AC_ARG_WITH(extra-libs,
+[  --with-extra-libs=DIR        add extra library paths],
+  use_extra_libs=$withval,
+  use_extra_libs=NO
+)
+if test -n "$use_extra_libs" && \
+        test "$use_extra_libs" != "NO"; then
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $use_extra_libs; do
+     extra_libraries="$extra_libraries -L$dir"
+   done
+   IFS=$ac_save_ifs
+   LDFLAGS="$LDFLAGS $extra_libraries"
+fi
+]
+)
+
+dnl AX_POPT_CONST - check popt prototype
+AC_DEFUN([AX_POPT_CONST],
+[
+AC_MSG_CHECKING([popt prototype])
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-Werror $CXXFLAGS"
+AC_TRY_COMPILE([#include <popt.h>],
+[
+int c; char **v;
+poptGetContext(0, c, v, 0, 0);
+],
+AC_MSG_RESULT([takes char **]);,
+AC_MSG_RESULT([takes const char **]); AC_DEFINE(CONST_POPT, 1, [whether popt prototype takes a const char **]))
+CXXFLAGS="$SAVE_CXXFLAGS"
+]
+)
+
+dnl AX_CHECK_SSTREAM - check if local sstream is needed to compile OK
+AC_DEFUN([AX_CHECK_SSTREAM],
+[
+AC_MSG_CHECKING([whether to use included sstream])
+AC_TRY_COMPILE([#include <sstream>], [], 
+AC_MSG_RESULT([no]);,
+AC_MSG_RESULT([yes]); OP_CXXFLAGS="$OP_CXXFLAGS -I\${top_srcdir}/include")
+]
+)
+
+dnl AX_CHECK_TYPEDEF(typedef_name, type, action-if-true, action-if-false)
+dnl exec action-if-true if typedef_name is a typedef to type else exec 
+dnl action-if-false
+dnl currently work only with type typedef'ed in stddef.h
+AC_DEFUN([AX_CHECK_TYPEDEF], [
+dnl AC_LANG_PUSH(C) not in autoconf 2.13
+AC_LANG_SAVE
+AC_LANG_C
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+
+AC_TRY_COMPILE(
+  [
+  #include <stddef.h>
+  ],
+  [
+  typedef void (*fct1)($1);
+  typedef void (*fct2)($2);
+  fct1 f1 = 0;
+  fct2 f2 = 0;
+  if (f1 == f2) {}
+  ],
+[$3],[$4])
+
+CFLAGS=$SAVE_CFLAGS
+AC_LANG_RESTORE
+])
+
+
+dnl AX_TYPEDEFED_NAME(typedef_name, candidate_list, var_name)
+dnl set var_name to the typedef name of $1 which must be in canditate_list
+dnl else produce a fatal error
+AC_DEFUN([AX_TYPEDEFED_NAME], [
+	AC_MSG_CHECKING([type of $1])
+	for f in $2; do
+		AX_CHECK_TYPEDEF($1, $f, $3="$f", $3="")
+		if test -n "${$3}"; then
+			break
+		fi
+	done
+	if test -n "${$3}"; then
+		AC_MSG_RESULT([${$3}])
+	else
+		AC_MSG_ERROR([not found])
+	fi
+])
+
+dnl find a binary in the path
+AC_DEFUN([QT_FIND_PATH],
+[
+	AC_MSG_CHECKING([for $1])
+	AC_CACHE_VAL(qt_cv_path_$1,
+	[
+		qt_cv_path_$1="NONE"
+		if test -n "$$2"; then
+			qt_cv_path_$1="$$2";
+		else
+			dirs="$3"
+			qt_save_IFS=$IFS
+			IFS=':'
+			for dir in $PATH; do
+				dirs="$dirs $dir"
+			done
+			IFS=$qt_save_IFS
+ 
+			for dir in $dirs; do
+				if test -x "$dir/$1"; then
+					if test -n "$5"; then
+						evalstr="$dir/$1 $5 2>&1 "
+						if eval $evalstr; then
+							qt_cv_path_$1="$dir/$1"
+							break
+						fi
+					else
+						qt_cv_path_$1="$dir/$1"
+						break
+					fi
+				fi
+			done
+		fi
+	])
+ 
+	if test -z "$qt_cv_path_$1" || test "$qt_cv_path_$1" = "NONE"; then
+		AC_MSG_RESULT(not found)
+		$4
+	else
+		AC_MSG_RESULT($qt_cv_path_$1)
+		$2=$qt_cv_path_$1
+	fi
+])
+
+dnl Find the uic compiler on the path or in qt_cv_dir
+AC_DEFUN([QT_FIND_UIC],
+[
+	QT_FIND_PATH(uic, ac_uic, $qt_cv_dir/bin)
+	if test -z "$ac_uic" -a "$FATAL" = 1; then
+		AC_MSG_ERROR([uic binary not found in \$PATH or $qt_cv_dir/bin !])
+	fi
+])
+ 
+dnl Find the right moc in path/qt_cv_dir
+AC_DEFUN([QT_FIND_MOC],
+[
+	QT_FIND_PATH(moc2, ac_moc2, $qt_cv_dir/bin)
+	QT_FIND_PATH(moc, ac_moc1, $qt_cv_dir/bin)
+
+	if test -n "$ac_moc1" -a -n "$ac_moc2"; then
+		dnl found both. Prefer Qt3's if it exists else moc2
+		$ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null
+		if test "$?" = 0; then
+			ac_moc=$ac_moc1;
+		else
+			ac_moc=$ac_moc2;
+		fi
+	else
+		if test -n "$ac_moc1"; then
+			ac_moc=$ac_moc1;
+		else
+			ac_moc=$ac_moc2;
+		fi
+	fi
+
+	if test -z "$ac_moc"  -a "$FATAL" = 1; then
+		AC_MSG_ERROR([moc binary not found in \$PATH or $qt_cv_dir/bin !])
+	fi
+])
+
+dnl check a particular libname
+AC_DEFUN([QT_TRY_LINK],
+[
+	SAVE_LIBS="$LIBS"
+	LIBS="$LIBS $1"
+	AC_TRY_LINK([
+	#include <qglobal.h>
+	#include <qstring.h>
+		],
+	[
+	QString s("mangle_failure");
+	#if (QT_VERSION < 221)
+	break_me_(\\\);
+	#endif
+	],
+	qt_cv_libname=$1,
+	)
+	LIBS="$SAVE_LIBS"
+])
+ 
+dnl check we can do a compile
+AC_DEFUN([QT_CHECK_COMPILE],
+[
+	AC_MSG_CHECKING([for Qt library name])
+ 
+	AC_CACHE_VAL(qt_cv_libname,
+	[
+		AC_LANG_CPLUSPLUS
+		SAVE_CXXFLAGS=$CXXFLAGS
+		CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS" 
+
+		for libname in -lqt-mt -lqt3 -lqt2 -lqt;
+		do
+			QT_TRY_LINK($libname)
+			if test -n "$qt_cv_libname"; then
+				break;
+			fi
+		done
+
+		CXXFLAGS=$SAVE_CXXFLAGS
+	])
+
+	if test -z "$qt_cv_libname"; then
+		AC_MSG_RESULT([failed]) 
+		if test "$FATAL" = 1 ; then
+			AC_MSG_ERROR([Cannot compile a simple Qt executable. Check you have the right \$QTDIR !])
+		fi
+	else
+		AC_MSG_RESULT([$qt_cv_libname])
+	fi
+])
+
+dnl get Qt version we're using
+AC_DEFUN([QT_GET_VERSION],
+[
+	AC_CACHE_CHECK([Qt version],lyx_cv_qtversion,
+	[
+		AC_LANG_CPLUSPLUS
+		SAVE_CPPFLAGS=$CPPFLAGS
+		CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
+
+		cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+#include <qglobal.h>
+"%%%"QT_VERSION_STR"%%%"
+EOF
+		lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
+			grep '^"%%%"'  2>/dev/null | \
+			sed -e 's/"%%%"//g' -e 's/"//g'`
+		rm -f conftest.$ac_ext
+		CPPFLAGS=$SAVE_CPPFLAGS
+	])
+ 
+	QT_VERSION=$lyx_cv_qtversion
+	AC_SUBST(QT_VERSION)
+])
+ 
+dnl start here 
+AC_DEFUN([QT_DO_IT_ALL],
+[
+	dnl Please leave this alone. I use this file in
+	dnl oprofile.
+	FATAL=0
+
+	AC_ARG_WITH(qt-dir, [  --with-qt-dir           where the root of Qt is installed ],
+		[ qt_cv_dir=`eval echo "$withval"/` ])
+	 
+	AC_ARG_WITH(qt-includes, [  --with-qt-includes      where the Qt includes are. ],
+		[ qt_cv_includes=`eval echo "$withval"` ])
+ 
+	AC_ARG_WITH(qt-libraries, [  --with-qt-libraries     where the Qt library is installed.],
+		[  qt_cv_libraries=`eval echo "$withval"` ])
+
+	dnl pay attention to $QTDIR unless overridden
+	if test -z "$qt_cv_dir"; then
+		qt_cv_dir=$QTDIR
+	fi
+ 
+	dnl derive inc/lib if needed
+	if test -n "$qt_cv_dir"; then
+		if test -z "$qt_cv_includes"; then
+			qt_cv_includes=$qt_cv_dir/include
+		fi
+		if test -z "$qt_cv_libraries"; then
+			qt_cv_libraries=$qt_cv_dir/lib
+		fi
+	fi
+
+	dnl flags for compilation
+	QT_INCLUDES=
+	QT_LDFLAGS=
+	if test -n "$qt_cv_includes"; then
+		QT_INCLUDES="-I$qt_cv_includes"
+	fi
+	if test -n "$qt_cv_libraries"; then
+		QT_LDFLAGS="-L$qt_cv_libraries"
+	fi
+	AC_SUBST(QT_INCLUDES)
+	AC_SUBST(QT_LDFLAGS)
+ 
+	QT_FIND_MOC
+	MOC=$ac_moc
+	AC_SUBST(MOC)
+	QT_FIND_UIC
+	UIC=$ac_uic
+	AC_SUBST(UIC)
+
+	QT_CHECK_COMPILE
+ 
+	QT_LIB=$qt_cv_libname;
+	AC_SUBST(QT_LIB)
+
+	if test -n "$qt_cv_libname"; then
+		QT_GET_VERSION
+	fi
+])
+
+dnl AX_CXXFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CXX support it.
+AC_DEFUN([AX_CHECK_PRECOMPILED_HEADER], [
+AC_MSG_CHECKING([whether ${CXX} support precompiled header])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CXXFLAGS=$CXXFLAGS
+dnl we consider than if -Winvalid-pch is accepted pch will works ...
+CXXFLAGS=-Winvalid-pch
+dnl but we don't want -Winvalid-pch else compilation will fail due -Werror and
+dnl the fact than some pch will be invalid for the given compilation option
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} -include bits/stdc++.h", AC_MSG_RESULT([no]))
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+])
+
+dnl AX_CHECK_DOCBOOK
+AC_DEFUN([AX_CHECK_DOCBOOK], [
+# It's just rude to go over the net to build
+XSLTPROC_FLAGS=--nonet
+DOCBOOK_ROOT=
+if test ! -f /etc/xml/catalog; then
+	for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
+	do
+		if test -d "$i"; then
+			DOCBOOK_ROOT=$i
+		fi
+	done
+
+	# Last resort - try net
+	if test -z "$DOCBOOK_ROOT"; then
+		XSLTPROC_FLAGS=
+	fi
+else
+	XML_CATALOG=/etc/xml/catalog
+	CAT_ENTRY_START='<!--'
+	CAT_ENTRY_END='-->'
+fi
+
+AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
+XSLTPROC_WORKS=no
+if test -n "$XSLTPROC"; then
+	AC_MSG_CHECKING([whether xsltproc works])
+
+	if test -n "$XML_CATALOG"; then
+		DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
+	else
+		DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
+	fi
+
+	$XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="test">
+</book>
+END
+	if test "$?" = 0; then
+		XSLTPROC_WORKS=yes
+	fi
+	AC_MSG_RESULT($XSLTPROC_WORKS)
+fi
+AM_CONDITIONAL(have_xsltproc, test "$XSLTPROC_WORKS" = "yes")
+
+AC_SUBST(XML_CATALOG)
+AC_SUBST(XSLTPROC_FLAGS)
+AC_SUBST(DOCBOOK_ROOT)
+AC_SUBST(CAT_ENTRY_START)
+AC_SUBST(CAT_ENTRY_END)
+])
+
+dnl AX_CFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CC support it.
+AC_DEFUN([AX_CFLAGS_OPTION], [
+AC_MSG_CHECKING([whether ${CC} $2 is understood])
+AC_LANG_SAVE
+AC_LANG_C
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=$2
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
+CFLAGS=$SAVE_CFLAGS
+AC_LANG_RESTORE
+])
+
+
+dnl AX_CXXFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CXX support it.
+AC_DEFUN([AX_CXXFLAGS_OPTION], [
+AC_MSG_CHECKING([whether ${CXX} $2 is understood])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=$2
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+])
+
+dnl AX_COPY_IF_CHANGE(source, dest)
+dnl copy source to dest if they don't compare equally or if dest doesn't exist
+AC_DEFUN([AX_COPY_IF_CHANGE], [
+if test -r $2; then
+	if cmp $1 $2 > /dev/null; then
+		echo $2 is unchanged
+	else
+		cp -f $1 $2
+	fi
+else
+	cp -f $1 $2
+fi
+])
+
diff --git a/meta/recipes-kernel/oprofile/oprofile/automake-foreign.patch b/meta/recipes-kernel/oprofile/oprofile/automake-foreign.patch
new file mode 100644
index 0000000..b9bb6c5
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/automake-foreign.patch
@@ -0,0 +1,12 @@
+oprofile doesn't want GNU-levels of automake strictness so tell it to be "foreign".
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index 5740585..cf6c316 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -16 +16 @@ AC_CONFIG_SRCDIR([libop/op_config.h])
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
diff --git a/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch b/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
new file mode 100644
index 0000000..aefa954
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/oprofile-cross-compile-tests.patch
@@ -0,0 +1,98 @@
+Prevent running check tests on host if cross compiling
+
+This patch enables running the 'make check' tests on the target
+in a cross-compiled environment. If not cross-compiling, then 'make
+ check' builds and executes the tests; no change from this patch.
+In a cross-compiling environment, the make variable CROSS_COMPILE is
+set which bypasses assiging tests to the makekfile variable TESTS.
+Since TESTS is empty, the 'make check' process never tries to run the
+tests on the hosts.  On the target, the tests must be run manually.
+
+Also, in the libutil++ tests, a makefile variable SRCDIR is passed into
+the compilation phase, pointing to the runtime location of the test
+'file-manip-tests'.  The mechanism used for a host test, based on
+'topdir' doesn't work.  Instead, if CROSS_COMPILE is set, the
+makefile takes the path of SRCDIR from the build environment and not
+from an expression based on the host path 'topdir'.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+diff --git a/configure.ac b/configure.ac
+index 41ece64..ce5a16f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -392,6 +392,7 @@ AC_ARG_ENABLE(account-check,
+ 	enable_account_check=$enableval, enable_account_check=yes)
+ 
+ AM_CONDITIONAL(CHECK_ACCOUNT, test "x$enable_account_check" = "xyes")
++AM_CONDITIONAL(CROSS_COMPILE, test "x$cross_compiling" = "xyes")
+ 
+ AC_SUBST(OP_CFLAGS)
+ AC_SUBST(OP_CXXFLAGS)
+diff --git a/libdb/tests/Makefile.am b/libdb/tests/Makefile.am
+index 8a69003..d820090 100644
+--- a/libdb/tests/Makefile.am
++++ b/libdb/tests/Makefile.am
+@@ -13,4 +13,6 @@ check_PROGRAMS = db_test
+ db_test_SOURCES = db_test.c
+ db_test_LDADD = ../libodb.a ../../libutil/libutil.a
+ 
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am
+index 8a79eb5..6d417c4 100644
+--- a/libop/tests/Makefile.am
++++ b/libop/tests/Makefile.am
+@@ -33,4 +33,6 @@ load_events_files_tests_LDADD = ${COMMON_LIBS}
+ mangle_tests_SOURCES = mangle_tests.c
+ mangle_tests_LDADD = ${COMMON_LIBS}
+ 
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS} utf8_checker.sh
++endif
+diff --git a/libregex/tests/Makefile.am b/libregex/tests/Makefile.am
+index 6f19838..1d176f9 100644
+--- a/libregex/tests/Makefile.am
++++ b/libregex/tests/Makefile.am
+@@ -18,4 +18,6 @@ java_test_LDADD = \
+ 
+ EXTRA_DIST = mangled-name.in
+ 
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libutil++/tests/Makefile.am b/libutil++/tests/Makefile.am
+index 51af031..a01ea2d 100644
+--- a/libutil++/tests/Makefile.am
++++ b/libutil++/tests/Makefile.am
+@@ -1,7 +1,9 @@
+ 
+ REALPATH= readlink -f
+ 
++if ! CROSS_COMPILE
+ SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ )
++endif
+ 
+ AM_CPPFLAGS = \
+ 	-I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\"" @OP_CPPFLAGS@
+@@ -46,4 +48,6 @@ cached_value_tests_LDADD = ${COMMON_LIBS}
+ utility_tests_SOURCES = utility_tests.cpp
+ utility_tests_LDADD = ${COMMON_LIBS}
+ 
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
+diff --git a/libutil/tests/Makefile.am b/libutil/tests/Makefile.am
+index dfcd6ec..e8831b5 100644
+--- a/libutil/tests/Makefile.am
++++ b/libutil/tests/Makefile.am
+@@ -12,4 +12,6 @@ file_tests_LDADD = ../libutil.a
+ string_tests_SOURCES = string_tests.c
+ string_tests_LDADD = ../libutil.a
+ 
++if ! CROSS_COMPILE
+ TESTS = ${check_PROGRAMS}
++endif
diff --git a/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch b/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch
new file mode 100644
index 0000000..20fc5e5
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/root-home-dir.patch
@@ -0,0 +1,44 @@
+oprofile: Determine the root home directory dynamically
+
+This commit detects the root home directory dynamically with changes to
+the oprofile gui app source.
+
+The commit replaces an earlier fix that detected and adjusted a
+'non-standard' root home directory at build time.  The advantage of this
+patch is that the oprofile tools are adjusted to the current run-time
+path to ~root, not the build time path.
+
+Upstream-Status: inappropriate [OE specific]
+
+Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
+
+Index: oprofile-1.0.0/doc/oprofile.html
+===================================================================
+--- oprofile-1.0.0.orig/doc/oprofile.html	2014-11-03 17:55:31.511034857 +0000
++++ oprofile-1.0.0/doc/oprofile.html	2014-11-03 17:57:26.415037988 +0000
+@@ -1563,8 +1563,8 @@
+ 		<span class="emphasis"><em>must</em></span> stop it in a controlled manner in order to process
+ 		the profile data it has collected.  Use <code class="code">kill -SIGINT &lt;operf-PID&gt;</code>
+ 		for this purpose. It is recommended that when running <span class="command"><strong>operf</strong></span>
+-		with this option, your current working directory should be <code class="filename">/root</code> or a subdirectory
+-		of <code class="filename">/root</code> to avoid storing sample data files in locations accessible by regular users.
++		with this option, your current working directory should be <code class="filename">~root</code> or a subdirectory
++		of <code class="filename">~root</code> to avoid storing sample data files in locations accessible by regular users.
+ 		</p>
+               </dd>
+               <dt>
+Index: oprofile-1.0.0/doc/oprofile.xml
+===================================================================
+--- oprofile-1.0.0.orig/doc/oprofile.xml	2014-11-03 17:55:31.515034857 +0000
++++ oprofile-1.0.0/doc/oprofile.xml	2014-11-03 17:58:03.719039005 +0000
+@@ -654,8 +654,8 @@
+ 		<emphasis>must</emphasis> stop it in a controlled manner in order to process
+ 		the profile data it has collected.  Use <code>kill -SIGINT &lt;operf-PID&gt;</code>
+ 		for this purpose. It is recommended that when running <command>operf</command>
+-		with this option, your current working directory should be <filename>/root</filename> or a subdirectory
+-		of <filename>/root</filename> to avoid storing sample data files in locations accessible by regular users.
++		with this option, your current working directory should be <filename>~root</filename> or a subdirectory
++		of <filename>~root</filename> to avoid storing sample data files in locations accessible by regular users.
+ 		</para></listitem>
+ 	</varlistentry>
+ 	<varlistentry>
diff --git a/meta/recipes-kernel/oprofile/oprofile/run-ptest b/meta/recipes-kernel/oprofile/oprofile/run-ptest
new file mode 100644
index 0000000..4814be6
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/run-ptest
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+saved_dir=$PWD
+for dir in */tests ; do
+	cd $dir
+	for atest in * ; do
+		if [ \( -x $atest \) -a \( -f $atest \) ] ; then
+			./$atest > ${atest}.stdout 2> ${atest}.stderr
+			if [ $? = 0 ] ; then
+				echo "PASS: $dir $atest"
+				rm ${atest}.stdout ${atest}.stderr
+			else
+				echo "FAIL: ${dir}/${atest}"
+			fi
+		fi
+	done
+	cd $saved_dir
+done
+
diff --git a/meta/recipes-kernel/oprofile/oprofile_1.1.0.bb b/meta/recipes-kernel/oprofile/oprofile_1.1.0.bb
new file mode 100644
index 0000000..92a94ad
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile_1.1.0.bb
@@ -0,0 +1,10 @@
+require oprofile.inc
+
+DEPENDS += "virtual/kernel"
+DEPENDS_append_powerpc64 = " libpfm4"
+
+SRC_URI[md5sum] = "248c4c069f9476f427fa7195563f9867"
+SRC_URI[sha256sum] = "cf759a6de1a6033d5dfc93bda129a9f2e128aecc4238cc657feb0801d1b0366c"
+
+S = "${WORKDIR}/oprofile-${PV}"
+
diff --git a/meta/recipes-kernel/oprofile/oprofileui-server/init b/meta/recipes-kernel/oprofile/oprofileui-server/init
new file mode 100755
index 0000000..2544ea4
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-server/init
@@ -0,0 +1,37 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:          oprofile-server
+# Required-Start:    $network
+# Required-Stop:     $network
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: OProfileUI server
+# Description:       
+### END INIT INFO
+
+. /etc/init.d/functions
+
+case "$1" in
+  start)
+        echo "Starting OProfileUI server"
+	. /etc/profile
+	/usr/bin/oprofile-server &
+  ;;
+
+  stop)
+        echo "Stopping OProfileUI server"
+        killproc oprofile-server
+  ;;
+
+  restart)
+	$0 stop
+        sleep 1
+        $0 start
+  ;;
+
+  *)
+        echo "usage: $0 { start | stop | restart }"
+  ;;
+esac
+
+exit 0
diff --git a/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service b/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service
new file mode 100644
index 0000000..1a2cbe6
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-server/oprofileui-server.service
@@ -0,0 +1,6 @@
+[Unit]
+Description=OProfileUI Server
+After=network.target
+
+[Service]
+ExecStart=/bin/sh -c ". @SYSCONFDIR@/profile; @BINDIR@/oprofile-server"
diff --git a/meta/recipes-kernel/oprofile/oprofileui-server_git.bb b/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
new file mode 100644
index 0000000..eb3b78b
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui-server_git.bb
@@ -0,0 +1,34 @@
+require oprofileui.inc
+
+SRCREV = "389e1875af4721d52c7e65cf9cfffb69b0ed6a59"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/oprofileui \
+           file://init \
+           file://oprofileui-server.service "
+
+DEPENDS += "intltool-native"
+
+EXTRA_OECONF += "--disable-client --enable-server"
+
+RDEPENDS_${PN} = "oprofile avahi-daemon"
+
+do_install_append() {
+	install -d ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/oprofileui-server
+
+	install -d ${D}${systemd_unitdir}/system
+	install -m 0644 ${WORKDIR}/oprofileui-server.service ${D}${systemd_unitdir}/system/
+	sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+		-e 's,@BINDIR@,${bindir},g' ${D}${systemd_unitdir}/system/oprofileui-server.service
+}
+
+inherit update-rc.d systemd
+
+INITSCRIPT_NAME = "oprofileui-server"
+INITSCRIPT_PARAMS = "start 99 5 2 . stop 20 0 1 6 ."
+
+SYSTEMD_SERVICE_${PN} = "oprofileui-server.service"
+SYSTEMD_AUTO_ENABLE = "disable"
diff --git a/meta/recipes-kernel/oprofile/oprofileui.inc b/meta/recipes-kernel/oprofile/oprofileui.inc
new file mode 100644
index 0000000..8fcf014
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui.inc
@@ -0,0 +1,16 @@
+SUMMARY = "User Interface for the System-Wide Profiler"
+DESCRIPTION = "User interface for the OProfile tool"
+HOMEPAGE = "http://labs.o-hand.com/oprofileui/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+SECTION = "x11"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "glib-2.0 avahi intltool-native"
+
+inherit autotools pkgconfig gettext
+
+EXTRA_OECONF = "--with-avahi"
+
diff --git a/meta/recipes-kernel/oprofile/oprofileui_git.bb b/meta/recipes-kernel/oprofile/oprofileui_git.bb
new file mode 100644
index 0000000..bb69d54
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofileui_git.bb
@@ -0,0 +1,17 @@
+require oprofileui.inc
+
+DEPENDS += "gtk+ libglade libxml2 avahi-ui gconf"
+
+SRCREV = "389e1875af4721d52c7e65cf9cfffb69b0ed6a59"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/oprofileui"
+
+EXTRA_OECONF += "--enable-client --disable-server"
+
+PACKAGES =+ "oprofileui-viewer"
+
+FILES_oprofileui-viewer = "${bindir}/oparchconv ${bindir}/oprofile-viewer ${datadir}/applications/ ${datadir}/oprofileui/ ${datadir}/icons"
+RDEPENDS_oprofileui-viewer = "oprofile"
diff --git a/meta/recipes-kernel/perf/perf-features.inc b/meta/recipes-kernel/perf/perf-features.inc
new file mode 100644
index 0000000..b8859ab
--- /dev/null
+++ b/meta/recipes-kernel/perf/perf-features.inc
@@ -0,0 +1,22 @@
+PERF_FEATURES_ENABLE ?= "perf-scripting perf-tui"
+
+def perf_feature_enabled(feature, trueval, falseval, d):
+    """
+    Check which perf features are enabled.
+
+    The PERF_FEATURES_ENABLE variable lists the perf features to
+    enable.  Override it if you want something different from what's
+    listed above, which is the default.  If empty, the build won't
+    enable any features (which may be exactly what you want, just a
+    barebones perf without any extra baggage, what you get if you
+    specify an empty feature list).
+
+    Available perf features:
+      perf-scripting: enable support for Perl and Python bindings
+      perf-tui: enable support for the perf TUI (via libnewt)
+
+    """
+    enabled_features = d.getVar("PERF_FEATURES_ENABLE", True) or ""
+    if feature in enabled_features:
+        return trueval
+    return falseval
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
new file mode 100644
index 0000000..adb3a2c
--- /dev/null
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -0,0 +1,210 @@
+SUMMARY = "Performance analysis tools for Linux"
+DESCRIPTION = "Performance counters for Linux are a new kernel-based \
+subsystem that provide a framework for all things \
+performance analysis. It covers hardware level \
+(CPU/PMU, Performance Monitoring Unit) features \
+and software features (software counters, tracepoints) \
+as well."
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"
+
+PR = "r9"
+
+require perf-features.inc
+
+BUILDPERF_libc-uclibc = "no"
+
+# gui support was added with kernel 3.6.35
+# since 3.10 libnewt was replaced by slang
+# to cover a wide range of kernel we add both dependencies
+TUI_DEPENDS = "${@perf_feature_enabled('perf-tui', 'libnewt slang', '',d)}"
+SCRIPTING_DEPENDS = "${@perf_feature_enabled('perf-scripting', 'perl python', '',d)}"
+LIBUNWIND_DEPENDS = "${@perf_feature_enabled('perf-libunwind', 'libunwind', '',d)}"
+
+DEPENDS = " \
+    virtual/${MLPREFIX}libc \
+    ${MLPREFIX}elfutils \
+    ${MLPREFIX}binutils \
+    ${TUI_DEPENDS} \
+    ${SCRIPTING_DEPENDS} \
+    ${LIBUNWIND_DEPENDS} \
+    bison flex xz \
+"
+
+do_configure[depends] += "virtual/kernel:do_shared_workdir"
+
+PROVIDES = "virtual/perf"
+
+inherit linux-kernel-base kernel-arch pythonnative
+
+# needed for building the tools/perf Python bindings
+inherit python-dir
+export STAGING_INCDIR
+export STAGING_LIBDIR
+export BUILD_SYS
+export HOST_SYS
+export PYTHON_SITEPACKAGES_DIR
+
+#kernel 3.1+ supports WERROR to disable warnings as errors
+export WERROR = "0"
+
+do_populate_lic[depends] += "virtual/kernel:do_patch"
+
+# needed for building the tools/perf Perl binding
+inherit perlnative cpan-base
+# Env var which tells perl if it should use host (no) or target (yes) settings
+export PERLCONFIGTARGET = "${@is_target(d)}"
+export PERL_INC = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}/CORE"
+export PERL_LIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+export PERL_ARCHLIB = "${STAGING_LIBDIR}${PERL_OWN_DIR}/perl/${@get_perl_version(d)}"
+
+inherit kernelsrc
+
+B = "${WORKDIR}/${BPN}-${PV}"
+SPDX_S = "${S}/tools/perf"
+
+SCRIPTING_DEFINES = "${@perf_feature_enabled('perf-scripting', '', 'NO_LIBPERL=1 NO_LIBPYTHON=1',d)}"
+TUI_DEFINES = "${@perf_feature_enabled('perf-tui', '', 'NO_NEWT=1',d)}"
+LIBUNWIND_DEFINES = "${@perf_feature_enabled('perf-libunwind', '', 'NO_LIBUNWIND=1 NO_LIBDW_DWARF_UNWIND=1',d)}"
+LIBNUMA_DEFINES = "${@perf_feature_enabled('perf-libnuma', '', 'NO_LIBNUMA=1',d)}"
+
+# The LDFLAGS is required or some old kernels fails due missing
+# symbols and this is preferred than requiring patches to every old
+# supported kernel.
+LDFLAGS="-ldl -lutil"
+
+EXTRA_OEMAKE = '\
+    -C ${S}/tools/perf \
+    O=${B} \
+    CROSS_COMPILE=${TARGET_PREFIX} \
+    ARCH=${ARCH} \
+    CC="${CC}" \
+    AR="${AR}" \
+    EXTRA_CFLAGS="-ldw" \
+    perfexecdir=${libexecdir} \
+    NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${LIBUNWIND_DEFINES} \
+    ${SCRIPTING_DEFINES} ${LIBNUMA_DEFINES} \
+'
+
+EXTRA_OEMAKE += "\
+    'prefix=${prefix}' \
+    'bindir=${bindir}' \
+    'sharedir=${datadir}' \
+    'sysconfdir=${sysconfdir}' \
+    'perfexecdir=${libexecdir}/perf-core' \
+    \
+    'ETC_PERFCONFIG=${@os.path.relpath(sysconfdir, prefix)}' \
+    'sharedir=${@os.path.relpath(datadir, prefix)}' \
+    'mandir=${@os.path.relpath(mandir, prefix)}' \
+    'infodir=${@os.path.relpath(infodir, prefix)}' \
+"
+
+
+do_compile() {
+	# Linux kernel build system is expected to do the right thing
+	unset CFLAGS
+	oe_runmake all
+}
+
+do_install() {
+	# Linux kernel build system is expected to do the right thing
+	unset CFLAGS
+	oe_runmake DESTDIR=${D} install
+	# we are checking for this make target to be compatible with older perf versions
+	if [ "${@perf_feature_enabled('perf-scripting', 1, 0, d)}" = "1" ] && grep -q install-python_ext ${S}/tools/perf/Makefile*; then
+		oe_runmake DESTDIR=${D} install-python_ext
+	fi
+}
+
+do_configure_prepend () {
+    # Fix for rebuilding
+    rm -rf ${B}/
+    mkdir ${B}/
+
+    # If building a multlib based perf, the incorrect library path will be
+    # detected by perf, since it triggers via: ifeq ($(ARCH),x86_64). In a 32 bit
+    # build, with a 64 bit multilib, the arch won't match and the detection of a 
+    # 64 bit build (and library) are not exected. To ensure that libraries are
+    # installed to the correct location, we can use the weak assignment in the
+    # config/Makefile.
+    #
+    # Also need to relocate .config-detected to $(OUTPUT)/config-detected
+    # for kernel sources that do not already do this
+    # as two builds (e.g. perf and lib32-perf from mutlilib can conflict
+    # with each other if its in the shared source directory
+    #
+    if [ -e "${S}/tools/perf/config/Makefile" ]; then
+        # Match $(prefix)/$(lib) and $(prefix)/lib
+        sed -i -e 's,^libdir = \($(prefix)/.*lib\),libdir ?= \1,' \
+               -e 's,^perfexecdir = \(.*\),perfexecdir ?= \1,' \
+               -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \
+            ${S}/tools/perf/config/Makefile
+    fi
+    if [ -e "${S}/tools/perf/Makefile.perf" ]; then
+        sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \
+            ${S}/tools/perf/Makefile.perf
+        sed -i -e "s,prefix='\$(DESTDIR_SQ)/usr'$,prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
+            ${S}/tools/perf/Makefile.perf
+    fi
+    sed -i -e "s,--root='/\$(DESTDIR_SQ)',--prefix='\$(DESTDIR_SQ)/usr' --install-lib='\$(DESTDIR)\$(PYTHON_SITEPACKAGES_DIR)',g" \
+        ${S}/tools/perf/Makefile
+
+    if [ -e "${S}/tools/build/Makefile.build" ]; then
+        sed -i -e 's,\ .config-detected, $(OUTPUT)/config-detected,g' \
+            ${S}/tools/build/Makefile.build
+    fi
+
+    # We need to ensure the --sysroot option in CC is preserved
+    if [ -e "${S}/tools/perf/Makefile.perf" ]; then
+        sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/perf/Makefile.perf
+        sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/perf/Makefile.perf
+    fi
+    if [ -e "${S}/tools/lib/api/Makefile" ]; then
+        sed -i 's,CC = $(CROSS_COMPILE)gcc,#CC,' ${S}/tools/lib/api/Makefile
+        sed -i 's,AR = $(CROSS_COMPILE)ar,#AR,' ${S}/tools/lib/api/Makefile
+    fi
+    if [ -e "${S}/tools/perf/config/feature-checks/Makefile" ]; then
+        sed -i 's,CC := $(CROSS_COMPILE)gcc -MD,CC += -MD,' ${S}/tools/perf/config/feature-checks/Makefile
+    fi
+    if [ -e "${S}/tools/build/Makefile.feature" ]; then
+        sed -i 's,CFLAGS=,CC="\$(CC)" CFLAGS=,' ${S}/tools/build/Makefile.feature
+    fi
+
+    # 3.17-rc1+ has a include issue for arm/powerpc. Temporarily sed in the appropriate include
+    if [ -e "${S}/tools/perf/arch/$ARCH/util/skip-callchain-idx.c" ]; then
+        sed -i 's,#include "util/callchain.h",#include "util/callchain.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/$ARCH/util/skip-callchain-idx.c
+    fi
+    if [ -e "${S}/tools/perf/arch/arm/util/unwind-libunwind.c" ] && [ -e "${S}/tools/perf/arch/arm/tests/dwarf-unwind.c" ]; then
+        sed -i 's,#include "tests/tests.h",#include "tests/tests.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/arm/tests/dwarf-unwind.c
+        sed -i 's,#include "perf_regs.h",#include "perf_regs.h"\n#include "util/debug.h",' ${S}/tools/perf/arch/arm/util/unwind-libunwind.c
+    fi
+}
+
+python do_package_prepend() {
+    d.setVar('PKGV', d.getVar("KERNEL_VERSION", True).split("-")[0])
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+
+PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python"
+
+RDEPENDS_${PN} += "elfutils bash"
+RDEPENDS_${PN}-archive =+ "bash"
+RDEPENDS_${PN}-python =+ "bash python"
+RDEPENDS_${PN}-perl =+ "bash perl perl-modules"
+RDEPENDS_${PN}-tests =+ "python"
+
+RSUGGESTS_SCRIPTING = "${@perf_feature_enabled('perf-scripting', '${PN}-perl ${PN}-python', '',d)}"
+RSUGGESTS_${PN} += "${PN}-archive ${PN}-tests ${RSUGGESTS_SCRIPTING}"
+
+FILES_${PN} += "${libexecdir}/perf-core ${exec_prefix}/libexec/perf-core ${libdir}/traceevent"
+FILES_${PN}-dbg += "${libdir}/python*/site-packages/.debug"
+FILES_${PN}-archive = "${libdir}/perf/perf-core/perf-archive"
+FILES_${PN}-tests = "${libdir}/perf/perf-core/tests"
+FILES_${PN}-python = "${libdir}/python*/site-packages ${libdir}/perf/perf-core/scripts/python"
+FILES_${PN}-perl = "${libdir}/perf/perf-core/scripts/perl"
+
+
+INHIBIT_PACKAGE_DEBUG_SPLIT="1"
diff --git a/meta/recipes-kernel/powertop/powertop_2.7.bb b/meta/recipes-kernel/powertop/powertop_2.7.bb
new file mode 100644
index 0000000..5ba07e9
--- /dev/null
+++ b/meta/recipes-kernel/powertop/powertop_2.7.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Power usage tool"
+DESCRIPTION = "Linux tool to diagnose issues with power consumption and power management."
+HOMEPAGE = "http://01.org/powertop/"
+BUGTRACKER = "http://bugzilla.lesswatts.org/"
+DEPENDS = "ncurses libnl pciutils"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"
+
+SRC_URI = "http://01.org/sites/default/files/downloads/powertop/powertop-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "e0d686e47daaf7e9d89031f7763432ef"
+SRC_URI[sha256sum] = "8d4b1490e2baad4467c0ded3c423db4472dcbf7b2dd8f8f2a928f54047c678ca"
+
+inherit autotools gettext pkgconfig
+
+# we need to explicitly link with libintl in uClibc systems
+EXTRA_LDFLAGS ?= ""
+EXTRA_LDFLAGS_libc-uclibc = "-lintl"
+LDFLAGS += "${EXTRA_LDFLAGS}"
+
+# we do not want libncursesw if we can
+do_configure_prepend() {
+    # configure.ac checks for delwin() in "ncursesw ncurses" so let's drop first one
+    sed -i -e "s/ncursesw//g" ${S}/configure.ac
+    mkdir -p ${B}/src/tuning/
+}
+
+inherit update-alternatives
+ALTERNATIVE_${PN} = "powertop"
+ALTERNATIVE_TARGET[powertop] = "${sbindir}/powertop"
+ALTERNATIVE_LINK_NAME[powertop] = "${sbindir}/powertop"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch b/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch
new file mode 100644
index 0000000..dcc2cbe
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/files/define-NT_GNU_BUILD_ID.patch
@@ -0,0 +1,22 @@
+On uclibc elf.h does not have GNU extentions but we need this define
+so we define it locally if its not getting it from elf.h
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: git/elfparser.h
+===================================================================
+--- git.orig/elfparser.h	2011-07-16 18:57:41.000000000 -0700
++++ git/elfparser.h	2011-07-16 20:28:54.733829895 -0700
+@@ -17,6 +17,10 @@
+  */
+ #include <glib.h>
+ 
++#ifndef NT_GNU_BUILD_ID
++#define NT_GNU_BUILD_ID 3
++#endif
++
+ typedef struct ElfSym ElfSym;
+ typedef struct ElfParser ElfParser;
+ 
diff --git a/meta/recipes-kernel/sysprof/files/rmb-arm.patch b/meta/recipes-kernel/sysprof/files/rmb-arm.patch
new file mode 100644
index 0000000..c53ac64
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/files/rmb-arm.patch
@@ -0,0 +1,21 @@
+
+Upstream-Status: Pending
+
+Index: git/util.h
+===================================================================
+--- git.orig/util.h	2010-12-07 22:41:57.156243001 -0600
++++ git/util.h	2010-12-07 22:43:47.616243002 -0600
+@@ -37,4 +37,13 @@
+ #define cpu_relax()     asm volatile("" ::: "memory");
+ #endif
+ 
++#ifdef __arm__
++/*
++ * Use the __kuser_memory_barrier helper in the CPU helper page. See
++ * arch/arm/kernel/entry-armv.S in the kernel source for details.
++ */
++#define rmb()		((void(*)(void))0xffff0fa0)()
++#define cpu_relax()	asm volatile("":::"memory")
++#endif
++
+ #endif
diff --git a/meta/recipes-kernel/sysprof/files/rmb-mips.patch b/meta/recipes-kernel/sysprof/files/rmb-mips.patch
new file mode 100644
index 0000000..e055b8a
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/files/rmb-mips.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+Index: git/util.h
+===================================================================
+--- git.orig/util.h	2010-12-08 01:22:44.486243001 -0600
++++ git/util.h	2010-12-08 01:23:27.836243001 -0600
+@@ -37,4 +37,15 @@
+ #define cpu_relax()     asm volatile("" ::: "memory");
+ #endif
+ 
++#ifdef __mips__
++#define rmb()		asm volatile(					\
++				".set	mips2\n\t"			\
++				"sync\n\t"				\
++				".set	mips0"				\
++				: /* no output */			\
++				: /* no input */			\
++				: "memory")
++#define cpu_relax()	asm volatile("" ::: "memory")
++#endif
++
+ #endif
diff --git a/meta/recipes-kernel/sysprof/sysprof_git.bb b/meta/recipes-kernel/sysprof/sysprof_git.bb
new file mode 100644
index 0000000..19c3e10
--- /dev/null
+++ b/meta/recipes-kernel/sysprof/sysprof_git.bb
@@ -0,0 +1,27 @@
+SUMMARY = "System-wide Performance Profiler for Linux"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "gtk+ libglade"
+
+SRCREV = "cd44ee6644c3641507fb53b8a2a69137f2971219"
+PV = "1.2.0+git${SRCPV}"
+
+SRC_URI = "git://git.gnome.org/sysprof \
+           file://define-NT_GNU_BUILD_ID.patch \
+          "
+
+SRC_URI_append_arm  = " file://rmb-arm.patch"
+SRC_URI_append_armeb  = " file://rmb-arm.patch"
+SRC_URI_append_mips = " file://rmb-mips.patch"
+SRC_URI_append_mips64 = " file://rmb-mips.patch"
+SRC_URI_append_mips64n32 = " file://rmb-mips.patch"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+# We do not yet work for aarch64.
+#
+COMPATIBLE_HOST = "^(?!aarch64).*"
+
diff --git a/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb b/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb
new file mode 100644
index 0000000..758908b
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap-uprobes_git.bb
@@ -0,0 +1,44 @@
+SUMMARY = "UProbes kernel module for SystemTap"
+
+require systemtap_git.inc
+
+DEPENDS = "systemtap virtual/kernel"
+
+PR = "r1"
+
+# On systems without CONFIG_UTRACE, this package is empty.
+ALLOW_EMPTY_${PN} = "1"
+
+inherit module-base gettext
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemtap:"
+
+FILES_${PN} += "${datadir}/systemtap/runtime/uprobes"
+
+EXTRA_OEMAKE = ""
+
+# Compile and install the uprobes kernel module on machines with utrace
+# support.  Note that staprun expects it in the systemtap/runtime directory,
+# not in /lib/modules.
+do_compile() {
+	if grep -q "CONFIG_UTRACE=y" ${STAGING_KERNEL_BUILDDIR}/.config
+	then
+		unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS CC LD CPP
+		oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+			   AR="${KERNEL_AR}" \
+			   -C ${STAGING_KERNEL_DIR} scripts
+		oe_runmake KDIR=${STAGING_KERNEL_DIR}   \
+			   M="${S}/runtime/uprobes/" \
+			   CC="${KERNEL_CC}" LD="${KERNEL_LD}" \
+			   AR="${KERNEL_AR}" \
+			   -C "${S}/runtime/uprobes/"
+	fi
+}
+
+do_install() {
+	if [ -e "${S}/runtime/uprobes/uprobes.ko" ]
+	then
+		install -d ${D}${datadir}/systemtap/runtime/uprobes/
+		install -m 0644 ${S}/runtime/uprobes/uprobes.ko ${D}${datadir}/systemtap/runtime/uprobes/
+	fi
+}
diff --git a/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch b/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch
new file mode 100644
index 0000000..b4f2fbc
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/configure-allow-to-disable-libvirt.patch
@@ -0,0 +1,39 @@
+From 5eb10d90af9178edb65e6091ae939d1b5b19bb78 Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Tue, 23 Sep 2014 04:47:10 -0400
+Subject: [PATCH] systemtap: allow to disable libvirt
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ configure.ac |   13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a631ae7..cb4885b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -525,10 +525,15 @@ dnl Check for the libvirt and libxml2 devel packages
+ 
+ dnl We require libvirt >= 1.0.2 because stapvirt relies on the
+ dnl virDomainOpenChannel function, which was implemented in 1.0.2.
+-PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
+-   have_libvirt=yes
+-   AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
+-   ], [have_libvirt=no])
++AC_ARG_ENABLE([libvirt],
++  AS_HELP_STRING([--disable-libvirt], [Do not use libvirt even if present]))
++
++if test "$enable_libvirt" != no; then
++  PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
++     have_libvirt=yes
++     AC_DEFINE([HAVE_LIBVIRT],[1],[Define to 1 if libvirt development libraries are installed])
++     ], [have_libvirt=no])
++fi
+ AM_CONDITIONAL([HAVE_LIBVIRT], [test "${have_libvirt}" = "yes"])
+ PKG_CHECK_MODULES([libxml2], [libxml-2.0], [
+    have_libxml2=yes
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch b/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch
new file mode 100644
index 0000000..33a8994
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/docproc-build-fix.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
+
+Index: git/doc/SystemTap_Tapset_Reference/Makefile.am
+===================================================================
+--- git.orig/doc/SystemTap_Tapset_Reference/Makefile.am	2012-04-13 08:43:46.263339003 -0500
++++ git/doc/SystemTap_Tapset_Reference/Makefile.am	2012-04-13 09:31:22.470083915 -0500
+@@ -27,6 +27,10 @@
+ noinst_PROGRAMS = docproc
+ SRCTREE=$(abs_top_srcdir)/
+ DOCPROC=$(abs_builddir)/docproc
++docproc_LINK = $(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
++
++docproc.o: $(srcdir)/docproc.c
++	$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/docproc.c
+ 
+ all: $(PDFDOCS) stamp-htmldocs stamp-mandocs
+ tapsets.xml: docproc $(shell find $(SRCTREE)/tapset -name '*.stp')
diff --git a/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch b/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch
new file mode 100644
index 0000000..988cda4
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Index: git/configure.ac
+===================================================================
+--- git.orig/configure.ac
++++ git/configure.ac
+@@ -19,7 +19,6 @@ AC_PROG_LN_S
+ AC_PROG_CC
+ AC_PROG_CXX
+ AC_PROG_CPP
+-AM_PROG_CC_STDC
+ AM_PROG_CC_C_O
+ AC_PROG_RANLIB
+ AC_OBJEXT
diff --git a/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch b/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch
new file mode 100644
index 0000000..013af5c
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/system_map_location.patch
@@ -0,0 +1,23 @@
+systemtap: Cross compilation fix
+
+This is a cross compilation fix. It allows systemtap to find
+the kernel map file in the right place, i.e. in the kernel build tree.
+Without this fix it takes a map file from the build host, if available.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
+
+Index: git/session.cxx
+===================================================================
+--- git.orig/session.cxx
++++ git/session.cxx
+@@ -1634,7 +1634,7 @@ systemtap_session::parse_kernel_function
+ 	clog << _F("Kernel symbol table %s unavailable, (%s)",
+ 		   system_map_path.c_str(), strerror(errno)) << endl;
+ 
+-      system_map_path = "/boot/System.map-" + kernel_release;
++      system_map_path = kernel_build_tree + "/System.map-" + kernel_release;
+       system_map.clear();
+       system_map.open(system_map_path.c_str(), ifstream::in);
+       if (! system_map.is_open())
diff --git a/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch b/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch
new file mode 100644
index 0000000..28a7eae
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap/x32_abi_time.patch
@@ -0,0 +1,34 @@
+Fix time_t print because in x32 ABI is long long int instead of long int.
+
+Upstream-Status: Pending
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+diff --git a/cache.cxx b/cache.cxx
+index 3546b30..19c77ca 100644
+--- a/cache.cxx
++++ b/cache.cxx
+@@ -294,7 +294,11 @@ clean_cache(systemtap_session& s)
+         {
+           //interval not passed, don't continue
+           if (s.verbose > 1)
++#if defined(__x86_64__) && defined (__ILP32__)
++            clog << _F("Cache cleaning skipped, interval not reached %lld s / %lu s.",
++#else
+             clog << _F("Cache cleaning skipped, interval not reached %lu s / %lu s.",
++#endif
+                        (current_time.tv_sec-sb.st_mtime), cache_clean_interval)  << endl;
+           return;
+         }
+@@ -302,7 +306,11 @@ clean_cache(systemtap_session& s)
+         {
+           //interval reached, continue
+           if (s.verbose > 1)
++#if defined(__x86_64__) && defined (__ILP32__)
++            clog << _F("Cleaning cache, interval reached %lld s > %lu s.",
++#else
+             clog << _F("Cleaning cache, interval reached %lu s > %lu s.",
++#endif
+                        (current_time.tv_sec-sb.st_mtime), cache_clean_interval)  << endl;
+         }
+ 
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.bb b/meta/recipes-kernel/systemtap/systemtap_git.bb
new file mode 100644
index 0000000..d0dd42a
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap_git.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux"
+
+require systemtap_git.inc
+
+DEPENDS = "elfutils sqlite3 systemtap-native"
+DEPENDS_class-native = "elfutils-native sqlite3-native gettext-native"
+DEPENDS_class-nativesdk = "nativesdk-elfutils nativesdk-sqlite3 nativesdk-gettext"
+
+RDEPENDS_${PN} += "python bash"
+RDEPENDS_${PN}_class-native += "python-native"
+RDEPENDS_${PN}_class-nativesdk += "python-native"
+
+EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
+            --without-nss --without-avahi --without-dyninst \
+            --disable-server --disable-grapher --enable-prologues \
+            ac_cv_prog_have_javac=no \
+            ac_cv_prog_have_jar=no "
+
+STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs"
+
+EXTRA_OECONF += "${STAP_DOCS} "
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
+
+inherit autotools gettext pkgconfig
+
+BBCLASSEXTEND = "native nativesdk"
+
+FILES_${PN}-dbg += "${libexecdir}/systemtap/.debug"
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc
new file mode 100644
index 0000000..59a578d
--- /dev/null
+++ b/meta/recipes-kernel/systemtap/systemtap_git.inc
@@ -0,0 +1,28 @@
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+SRCREV = "bf16266782e1f2588b519a50d9684279d4e21036"
+PV = "2.7+git${SRCPV}"
+
+SRC_URI = "git://sourceware.org/git/systemtap.git \
+           file://docproc-build-fix.patch \
+           file://obsolete_automake_macros.patch \
+           file://system_map_location.patch \
+           file://configure-allow-to-disable-libvirt.patch \
+           file://x32_abi_time.patch \
+          "
+
+# systemtap doesn't support mips
+COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64).*-linux'
+
+S = "${WORKDIR}/git"
+
+# systemtap can't be built without optimization, if someone tries to compile an
+# entire image as -O0, we override it with -O2 here and give a note about it.
+def get_optimization(d):
+    selected_optimization = d.getVar("SELECTED_OPTIMIZATION", True)
+    if bb.utils.contains("SELECTED_OPTIMIZATION", "-O0", "x", "", d) == "x":
+        bb.note("systemtap can't be built with -O0, -O2 will be used instead.")
+        return selected_optimization.replace("-O0", "-O2")
+    return selected_optimization
+
+SELECTED_OPTIMIZATION := "${@get_optimization(d)}"
diff --git a/meta/recipes-kernel/trace-cmd/kernelshark_git.bb b/meta/recipes-kernel/trace-cmd/kernelshark_git.bb
new file mode 100644
index 0000000..9deccae
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/kernelshark_git.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Graphical trace viewer for Ftrace"
+LICENSE = "GPLv2"
+
+require trace-cmd.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+                    file://kernel-shark.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e"
+
+DEPENDS = "gtk+ libxml2"
+RDEPENDS_${PN} = "trace-cmd"
+
+EXTRA_OEMAKE = "\
+    'prefix=${prefix}' \
+    'bindir_relative=${@oe.path.relative(prefix, bindir)}' \
+    'libdir=${@oe.path.relative(prefix, libdir)}' \
+    NO_PYTHON=1 \
+    gui \
+"
+do_configure_prepend() {
+    # Make sure the recompile is OK
+    rm -f ${B}/.*.d
+}
+
+do_install() {
+    oe_runmake DESTDIR="${D}" install_gui
+    rm ${D}${bindir}/trace-cmd
+    rm -rf ${D}${libdir}/trace-cmd
+    rmdir ${D}${libdir}
+}
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd.inc b/meta/recipes-kernel/trace-cmd/trace-cmd.inc
new file mode 100644
index 0000000..87e4a9c
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd.inc
@@ -0,0 +1,12 @@
+SRCREV = "0813335d2e49291e7ab6a4365cec2baa05813eda"
+PV = "2.5.3+git${SRCPV}"
+
+inherit pkgconfig
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/trace-cmd:"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git;branch=trace-cmd-stable-v2.5 \
+           file://blktrace-api-compatibility.patch \
+"
+
+S = "${WORKDIR}/git"
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch b/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch
new file mode 100644
index 0000000..320db6a
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd/blktrace-api-compatibility.patch
@@ -0,0 +1,29 @@
+trace-cmd: Add blktrace_api compatibility for TC_BARRIER
+
+Newer kernels replace TC_BARRIER with TC_FLUSH. Ensure trace-cmd
+can build regardless of the linux-kernel-headers version.
+
+Upstream-Status: Inappropriate [Stop gap]
+
+Signed-off-by: Darren Hart <dvhart@linux.intel.com>
+
+diff --git a/plugin_blk.c b/plugin_blk.c
+index 9327b17..c8e5e1c 100644
+--- a/plugin_blk.c
++++ b/plugin_blk.c
+@@ -44,6 +44,15 @@ struct blk_data {
+ 	unsigned short		pdu_len;
+ };
+ 
++/*
++ * Newer kernels don't define BLK_TC_BARRIER and have replaced it with
++ * BLK_TC_FLUSH. In this case, define it here and report FLUSHES as BARRIERS as
++ * a workaround, as described in:
++ * http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=c09c47caedc9854d59378d6e34c989e51cfdd2b4
++ */
++#ifndef BLK_TC_BARRIER
++#define BLK_TC_BARRIER 1<<2
++#endif
+ static void fill_rwbs(char *rwbs, int action, unsigned int bytes)
+ {
+ 	int i = 0;
diff --git a/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb b/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb
new file mode 100644
index 0000000..b1ac789
--- /dev/null
+++ b/meta/recipes-kernel/trace-cmd/trace-cmd_git.bb
@@ -0,0 +1,35 @@
+SUMMARY = "User interface to Ftrace"
+LICENSE = "GPLv2 & LGPLv2.1"
+
+require trace-cmd.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+                    file://trace-cmd.c;beginline=6;endline=8;md5=2c22c965a649ddd7973d7913c5634a5e \
+                    file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff \
+                    file://trace-input.c;beginline=5;endline=8;md5=3ec82f43bbe0cfb5951ff414ef4d44d0 \
+"
+
+EXTRA_OEMAKE = "\
+    'prefix=${prefix}' \
+    'bindir=${bindir}' \
+    'man_dir=${mandir}' \
+    'html_install=${datadir}/kernelshark/html' \
+    'img_install=${datadir}/kernelshark/html/images' \
+    \
+    'bindir_relative=${@oe.path.relative(prefix, bindir)}' \
+    'libdir=${@oe.path.relative(prefix, libdir)}' \
+    \
+    NO_PYTHON=1 \
+"
+
+FILES_${PN}-dbg += "${libdir}/trace-cmd/plugins/.debug"
+
+do_compile_prepend() {
+    # Make sure the recompile is OK
+    rm -f ${B}/.*.d
+}
+
+do_install() {
+        oe_runmake DESTDIR="${D}" install
+}
+
diff --git a/meta/recipes-lsb4/libpng/libpng12_1.2.53.bb b/meta/recipes-lsb4/libpng/libpng12_1.2.53.bb
new file mode 100644
index 0000000..bf861a7
--- /dev/null
+++ b/meta/recipes-lsb4/libpng/libpng12_1.2.53.bb
@@ -0,0 +1,33 @@
+SUMMARY = "PNG image format decoding library"
+HOMEPAGE = "http://www.libpng.org/"
+SECTION = "libs"
+LICENSE = "Libpng"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=bd2a7a13355fcca92ad83bdf7e296011 \
+                    file://png.h;beginline=322;endline=436;md5=caf9ee541234c663aeecdcfef2f79ae1"
+DEPENDS = "zlib"
+
+PN = "libpng12"
+S = "${WORKDIR}/libpng-${PV}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/libpng/libpng12/${PV}/libpng-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "7d18a74e6fd2029aee76ccd00e00a9e6"
+SRC_URI[sha256sum] = "b45e49f689e7451bd576569e6a344f7e0d11c02ecbb797f4da0e431526765c0a"
+
+BINCONFIG_GLOB = "${PN}-config"
+
+inherit autotools binconfig pkgconfig
+
+do_install_append() {
+	# The follow link files link to corresponding png12*.h and libpng12* files
+	# They conflict with higher verison, so drop them
+	unlink ${D}/${includedir}/png.h
+	unlink ${D}/${includedir}/pngconf.h
+
+	unlink ${D}/${libdir}/libpng.la
+	unlink ${D}/${libdir}/libpng.so
+	unlink ${D}/${libdir}/libpng.a
+	unlink ${D}/${libdir}/pkgconfig/libpng.pc
+
+	unlink ${D}/${bindir}/libpng-config
+}
diff --git a/meta/recipes-lsb4/perl/libclass-isa-perl_0.36.bb b/meta/recipes-lsb4/perl/libclass-isa-perl_0.36.bb
new file mode 100644
index 0000000..f93841d
--- /dev/null
+++ b/meta/recipes-lsb4/perl/libclass-isa-perl_0.36.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Perl module for reporting the search path for a class's ISA tree"
+DESCRIPTION = "Suppose you have a class (like Food::Fish::Fishstick) that is derived, \
+via its @ISA, from one or more superclasses (as Food::Fish::Fishstick is from Food::Fish,\
+Life::Fungus, and Chemicals), and some of those superclasses may themselves each be\
+derived, via its @ISA, from one or more superclasses (as above).\
+\
+When, then, you call a method in that class ($fishstick->calories), Perl first searches\
+there for that method, but if it's not there, it goes searching in its superclasses, and\
+so on, in a depth-first (or maybe "height-first" is the word) search. In the above example,\
+it'd first look in Food::Fish, then Food, then Matter, then Life::Fungus, then Life, then\
+Chemicals.\
+\
+This library, Class::ISA, provides functions that return that list -- the list\
+(in order) of names of classes Perl would search to find a method, with no duplicates."
+
+HOMEPAGE = "http://search.cpan.org/dist/Class-ISA/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://README;beginline=107;endline=111;md5=6a5c6842a63cfe4dab1f66e2350e4d25"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/S/SM/SMUELLER/Class-ISA-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "3a2ad203c8dc87d6c9de16215d00af47"
+SRC_URI[sha256sum] = "8816f34e9a38e849a10df756030dccf9fe061a196c11ac3faafd7113c929b964"
+
+S = "${WORKDIR}/Class-ISA-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-lsb4/perl/libdumpvalue-perl_1.17.bb b/meta/recipes-lsb4/perl/libdumpvalue-perl_1.17.bb
new file mode 100644
index 0000000..9a74614
--- /dev/null
+++ b/meta/recipes-lsb4/perl/libdumpvalue-perl_1.17.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Perl module for provides screen dump of Perl data"
+
+HOMEPAGE = "http://search.cpan.org/~flora/Dumpvalue/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f736bec5ada1fc5e39b2a8e7e06bbcbb"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Dumpvalue-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "6ede9f693d4a9c4555541cb1a1cc2006"
+SRC_URI[sha256sum] = "9ea74606b545f769a787ec2ae229549a2ad0a8e3cd4b14eff2ce3841836b3bdb"
+
+S = "${WORKDIR}/Dumpvalue-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-lsb4/perl/libenv-perl_1.04.bb b/meta/recipes-lsb4/perl/libenv-perl_1.04.bb
new file mode 100644
index 0000000..dd8e115
--- /dev/null
+++ b/meta/recipes-lsb4/perl/libenv-perl_1.04.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Perl module that imports environment variables as scalars or arrays"
+DESCRIPTION = "Perl maintains environment variables in a special hash named %ENV. \
+For when this access method is inconvenient, the Perl module Env allows environment \
+variables to be treated as scalar or array variables."
+
+HOMEPAGE = "http://search.cpan.org/~flora/Env/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=76c1cbf18db56b3340d91cb947943bd3"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/Env-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "fdba5c0690e66972c96fee112cf5f25c"
+SRC_URI[sha256sum] = "d94a3d412df246afdc31a2199cbd8ae915167a3f4684f7b7014ce1200251ebb0"
+
+S = "${WORKDIR}/Env-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-lsb4/perl/libfile-checktree-perl_4.41.bb b/meta/recipes-lsb4/perl/libfile-checktree-perl_4.41.bb
new file mode 100644
index 0000000..ce37c72
--- /dev/null
+++ b/meta/recipes-lsb4/perl/libfile-checktree-perl_4.41.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Perl module that run many filetest checks on a tree"
+DESCRIPTION = "The validate() routine takes a single multiline string consisting \
+of directives, each containing a filename plus a file test to try on it. (The file \
+test may also be a "cd", causing subsequent relative filenames to be interpreted \
+relative to that directory.) After the file test you may put || die to make it a \
+fatal error if the file test fails. The default is || warn. The file test may \
+optionally have a "!' prepended to test for the opposite condition. If you do a \
+cd and then list some relative filenames, you may want to indent them slightly for \
+readability. If you supply your own die() or warn() message, you can use $file to \
+interpolate the filename. \
+\
+Filetests may be bunched: "-rwx" tests for all of -r, -w, and -x. Only the first failed \
+test of the bunch will produce a warning. \
+\
+The routine returns the number of warnings issued."
+
+HOMEPAGE = "http://search.cpan.org/~flora/File-CheckTree/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=c6fcacc5df80e037060300a7f4b93bf9"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/File-CheckTree-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "519c82aa7e5b7f752b4da14a6c8ad740"
+SRC_URI[sha256sum] = "fc99ab6bb5af4664832715974b5a19e328071dc9202ab72e5d5a594ebd46a729"
+
+S = "${WORKDIR}/File-CheckTree-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-lsb4/perl/libi18n-collate-perl_1.02.bb b/meta/recipes-lsb4/perl/libi18n-collate-perl_1.02.bb
new file mode 100644
index 0000000..f1839e0
--- /dev/null
+++ b/meta/recipes-lsb4/perl/libi18n-collate-perl_1.02.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Perl module that compare 8-bit scalar data according to the current locale"
+DESCRIPTION = "This module provides you with objects that will collate according to \
+your national character set, provided that the POSIX setlocale() function is supported \
+on your system."
+
+HOMEPAGE = "http://search.cpan.org/~flora/I18N-Collate/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://LICENSE;md5=ff6d629144a6ec1ea8c300f75760184f"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/F/FL/FLORA/I18N-Collate-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "72ddb6d1c59cfdf31aa3b04799b86af0"
+SRC_URI[sha256sum] = "9174506bc903eda89690394e3f45558ab7e013114227896d8569d6164648fe37"
+
+S = "${WORKDIR}/I18N-Collate-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-lsb4/perl/libpod-plainer-perl_1.04.bb b/meta/recipes-lsb4/perl/libpod-plainer-perl_1.04.bb
new file mode 100644
index 0000000..a3e58f0
--- /dev/null
+++ b/meta/recipes-lsb4/perl/libpod-plainer-perl_1.04.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Perl extension for converting Pod to old-style Pod"
+DESCRIPTION = "Pod::Plainer uses Pod::Parser which takes Pod with the (new) 'C<< .. >>' \
+constructs and returns the old(er) style with just 'C<>'; '<' and '>' are replaced by \
+'E<lt>' and 'E<gt>'. \
+\
+This can be used to pre-process Pod before using tools which do not recognise the new style Pods."
+
+HOMEPAGE = "http://search.cpan.org/dist/Pod-Plainer/"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+
+LIC_FILES_CHKSUM = "file://README;beginline=27;md5=227cf83970fc61264845825d9d2bf6f8"
+
+SRC_URI = "http://search.cpan.org/CPAN/authors/id/R/RM/RMBARKER/Pod-Plainer-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "f502eacd1a40894b9dfea55fc2cd5e7d"
+SRC_URI[sha256sum] = "1bbfbf7d1d4871e5a83bab2137e22d089078206815190eb1d5c1260a3499456f"
+
+S = "${WORKDIR}/Pod-Plainer-${PV}"
+
+inherit cpan
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-multimedia/alsa/alsa-fpu.inc b/meta/recipes-multimedia/alsa/alsa-fpu.inc
new file mode 100644
index 0000000..5040230
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-fpu.inc
@@ -0,0 +1,6 @@
+
+def get_alsa_fpu_setting(bb, d):
+	if d.getVar('TARGET_FPU', True) in [ 'soft' ]:
+		return "--with-softfloat"
+	return ""
+
diff --git a/meta/recipes-multimedia/alsa/alsa-lib/0001-build-Do-not-try-to-detect-cross-compiler.patch b/meta/recipes-multimedia/alsa/alsa-lib/0001-build-Do-not-try-to-detect-cross-compiler.patch
new file mode 100644
index 0000000..583bc3d
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-lib/0001-build-Do-not-try-to-detect-cross-compiler.patch
@@ -0,0 +1,45 @@
+From 17aeb3565f411e7796cabe403f92d15948a8ca95 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 21 Aug 2015 14:42:45 -0700
+Subject: [PATCH] build: Do not try to detect cross-compiler
+
+cross compilers are passed via path may not be a gcc based cross
+compiler in such cases this check fails and try's to force gcc based
+cross compiler detection, This code is a convenience that limits the
+build system
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ configure.ac | 14 --------------
+ 1 file changed, 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 3022cf8..9d77440 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -27,20 +27,6 @@ AC_PREFIX_DEFAULT(/usr)
+ 
+ dnl Checks for programs.
+ 
+-dnl try to gues cross-compiler if not set
+-if test "x$host" != "x$build" -a -z "`echo $CC | grep -e '-gcc'`";
+-then
+-  AC_MSG_CHECKING(for cross-compiler)
+-
+-  which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc
+-  which ${host_cpu}-${host_os}-gcc >/dev/null 2>&1 \
+-  && CC=${host_cpu}-${host_os}-gcc
+-  which ${host_cpu}-${host_vendor}-${host_os}-gcc >/dev/null 2>&1 \
+-  && CC=${host_cpu}-${host_vendor}-${host_os}-gcc
+-
+-  AC_MSG_RESULT($CC)
+-fi
+-	    
+ CFLAGS="$CFLAGS -D_GNU_SOURCE"
+ 
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch b/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch
new file mode 100644
index 0000000..75a6eb8
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-lib/Check-if-wordexp-function-is-supported.patch
@@ -0,0 +1,51 @@
+From e33357b59a10d44e9bec5d24100ce23ca300cc79 Mon Sep 17 00:00:00 2001
+From: "Hong H. Pham" <hong.pham@windriver.com>
+Date: Fri, 29 Aug 2014 17:13:55 +0300
+Subject: [PATCH] Check if wordexp function is supported
+
+eglibc could be configured to build without wordexp, so it is not enough
+to check if wordexp.h exists (the header file could be installed, but it's
+possible that the wordexp() function is not supported).  An additional
+check if wordexp() is supported by the system C library is needed.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Hong H. Pham <hong.pham@windriver.com>
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+---
+ configure.ac   | 5 ++++-
+ src/userfile.c | 2 +-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index b8353a0..773b72f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -311,7 +311,10 @@ fi
+ AC_SUBST(ALSA_DEPLIBS)
+ 
+ dnl Check for headers
+-AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h])
++AC_CHECK_HEADERS([wordexp.h endian.h sys/endian.h],
++  dnl Make sure wordexp is supported by the C library
++  AC_CHECK_FUNCS([wordexp])
++)
+ 
+ dnl Check for resmgr support...
+ AC_MSG_CHECKING(for resmgr support)
+diff --git a/src/userfile.c b/src/userfile.c
+index 3a73836..b8ce809 100644
+--- a/src/userfile.c
++++ b/src/userfile.c
+@@ -32,7 +32,7 @@
+  * stores the first matchine one.  The returned string is strdup'ed.
+  */
+ 
+-#ifdef HAVE_WORDEXP_H
++#if (defined(HAVE_WORDEXP_H) && defined(HAVE_WORDEXP))
+ #include <wordexp.h>
+ #include <assert.h>
+ int snd_user_file(const char *file, char **result)
+-- 
+1.9.1
+
diff --git a/meta/recipes-multimedia/alsa/alsa-lib_1.0.29.bb b/meta/recipes-multimedia/alsa/alsa-lib_1.0.29.bb
new file mode 100644
index 0000000..730f427
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-lib_1.0.29.bb
@@ -0,0 +1,51 @@
+SUMMARY = "ALSA sound library"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "https://bugtrack.alsa-project.org/alsa-bug/login_page.php"
+SECTION = "libs/multimedia"
+LICENSE = "LGPLv2.1 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
+                    file://src/socket.c;beginline=1;endline=26;md5=11ff89a8a7a4a690a5c78effe8159545"
+
+BBCLASSEXTEND = "native nativesdk"
+
+# configure.in sets -D__arm__ on the command line for any arm system
+# (not just those with the ARM instruction set), this should be removed,
+# (or replaced by a permitted #define).
+#FIXME: remove the following
+ARM_INSTRUCTION_SET = "arm"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/lib/${BP}.tar.bz2 \
+           file://Check-if-wordexp-function-is-supported.patch \
+           file://0001-build-Do-not-try-to-detect-cross-compiler.patch \
+"
+SRC_URI[md5sum] = "de67e0eca72474d6b1121037dafe1024"
+SRC_URI[sha256sum] = "73043c35eb9636be0f4af6a240235c213f12a25feb1f04aeeac8cb7e30fcbdd0"
+
+inherit autotools pkgconfig
+
+require alsa-fpu.inc
+EXTRA_OECONF += "${@get_alsa_fpu_setting(bb, d)} "
+
+EXTRA_OECONF = "--disable-python"
+
+EXTRA_OECONF_append_libc-uclibc = " --with-versioned=no "
+
+PACKAGES =+ "alsa-server libasound alsa-conf-base alsa-conf alsa-doc"
+FILES_${PN} += "${libdir}/${BPN}/smixer/*.so"
+FILES_${PN}-dbg += "${libdir}/${BPN}/smixer/.debug"
+FILES_${PN}-dev += "${libdir}/${BPN}/smixer/*.la"
+FILES_libasound = "${libdir}/libasound.so.*"
+FILES_alsa-server = "${bindir}/*"
+FILES_alsa-conf = "${datadir}/alsa/"
+FILES_alsa-conf-base = "\
+${datadir}/alsa/alsa.conf \
+${datadir}/alsa/cards/aliases.conf \
+${datadir}/alsa/pcm/default.conf \
+${datadir}/alsa/pcm/dmix.conf \
+${datadir}/alsa/pcm/dsnoop.conf"
+
+RDEPENDS_libasound = "alsa-conf-base alsa-conf"
+# upgrade path
+RPROVIDES_${PN}-dev = "alsa-dev"
+RREPLACES_${PN}-dev = "alsa-dev"
+RCONFLICTS_${PN}-dev = "alsa-dev"
diff --git a/meta/recipes-multimedia/alsa/alsa-plugins/0001-arcam-av-Include-sys-select.h-for-fd_set-definition.patch b/meta/recipes-multimedia/alsa/alsa-plugins/0001-arcam-av-Include-sys-select.h-for-fd_set-definition.patch
new file mode 100644
index 0000000..c70c72c
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-plugins/0001-arcam-av-Include-sys-select.h-for-fd_set-definition.patch
@@ -0,0 +1,31 @@
+From d28c655be3ac4fcb8024555983884f832ee18787 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 29 May 2015 15:17:30 -0700
+Subject: [PATCH] arcam-av: Include sys/select.h for fd_set definition
+
+fixes build errors on non-glibc based systems
+
+arcam-av/arcam_av.c:389:2: error: unknown type name 'fd_set'
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ arcam-av/arcam_av.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/arcam-av/arcam_av.c b/arcam-av/arcam_av.c
+index 0491fc6..fff96f9 100644
+--- a/arcam-av/arcam_av.c
++++ b/arcam-av/arcam_av.c
+@@ -31,6 +31,7 @@
+ #include <unistd.h>
+ 
+ #include <sys/ipc.h>
++#include <sys/select.h>
+ #include <sys/shm.h>
+ #include <sys/stat.h>
+ #include <sys/stat.h>
+-- 
+2.1.4
+
diff --git a/meta/recipes-multimedia/alsa/alsa-plugins/0001-include-speexdsp_types.h-not-speex_types.h.patch b/meta/recipes-multimedia/alsa/alsa-plugins/0001-include-speexdsp_types.h-not-speex_types.h.patch
new file mode 100644
index 0000000..e5199fb
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-plugins/0001-include-speexdsp_types.h-not-speex_types.h.patch
@@ -0,0 +1,71 @@
+From ca41e96a49a568128354f65f90a769debf5435f1 Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+Date: Thu, 9 Jul 2015 11:58:12 +0300
+Subject: [PATCH] include speexdsp_types.h, not speex_types.h
+
+Speexdsp was separated from speex in 1.2rc2. speex_types.h is not
+shipped by speexdsp, so alsa-plugins shouldn't use that file. speexdsp
+has speexdsp_types.h, which has the same contents as speex_types.h.
+
+speexdsp_types.h is a new file introduced in 1.2rc2, so this change
+bumps the minimum supported speexdsp version. The version check in
+configure.ac will actually break if speexdsp 1.2 ever gets released,
+because pkg-config thinks that "1.2" < "1.2rc2", but I think it's
+useful to fail if the installed speexdsp version is 1.2rc1 (which I
+believe is very common on current distributions). If a non-rc version
+of speexdsp will ever get released, I hope version number 1.2 will be
+skipped for this reason. (A non-rc version seems unlikely, since
+1.2rc1 was released years ago, so it's pretty likely that the project
+is stuck on so called "release candidates" forever...)
+
+Upstream-Status: Submitted (http://thread.gmane.org/gmane.linux.alsa.devel/141149)
+
+Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+---
+ configure.ac          | 2 +-
+ pph/arch.h            | 2 +-
+ pph/speex_resampler.h | 2 +-
+ 3 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 902a6d7..c554d22 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -108,7 +108,7 @@ AC_SUBST(AVCODEC_CFLAGS)
+ AC_SUBST(AVCODEC_LIBS)
+ AC_SUBST(AVCODEC_HEADER)
+ 
+-PKG_CHECK_MODULES(speexdsp, [speexdsp >= 1.2], [HAVE_SPEEXDSP="yes"], [HAVE_SPEEXDSP=""])
++PKG_CHECK_MODULES(speexdsp, [speexdsp >= 1.2rc2], [HAVE_SPEEXDSP="yes"], [HAVE_SPEEXDSP=""])
+ AM_CONDITIONAL(HAVE_SPEEXDSP, test "$HAVE_SPEEXDSP" = "yes")
+ 
+ AC_ARG_WITH([speex],
+diff --git a/pph/arch.h b/pph/arch.h
+index e2d731a..a07d0d9 100644
+--- a/pph/arch.h
++++ b/pph/arch.h
+@@ -36,7 +36,7 @@
+ #define ARCH_H
+ 
+ #ifndef OUTSIDE_SPEEX
+-#include "speex/speex_types.h"
++#include "speex/speexdsp_types.h"
+ #endif
+ 
+ #define ABS(x) ((x) < 0 ? (-(x)) : (x))      /**< Absolute integer value. */
+diff --git a/pph/speex_resampler.h b/pph/speex_resampler.h
+index c44fbcd..aa85abb 100644
+--- a/pph/speex_resampler.h
++++ b/pph/speex_resampler.h
+@@ -82,7 +82,7 @@
+       
+ #else /* OUTSIDE_SPEEX */
+ 
+-#include "speex/speex_types.h"
++#include "speex/speexdsp_types.h"
+ 
+ #endif /* OUTSIDE_SPEEX */
+ 
+-- 
+1.9.3
+
diff --git a/meta/recipes-multimedia/alsa/alsa-plugins_1.0.29.bb b/meta/recipes-multimedia/alsa/alsa-plugins_1.0.29.bb
new file mode 100644
index 0000000..c928618
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-plugins_1.0.29.bb
@@ -0,0 +1,105 @@
+DESCRIPTION = "ALSA Plugins"
+HOMEPAGE = "http://alsa-project.org"
+SECTION = "multimedia"
+
+# The primary license of alsa-plugins is LGPLv2.1.
+#
+# m4/attributes.m4 is licensed under GPLv2+. m4/attributes.m4 is part of the
+# build system, and doesn't affect the licensing of the build result.
+#
+# The samplerate plugin source code is licensed under GPLv2+ to be consistent
+# with the libsamplerate license.
+LICENSE = "LGPLv2.1 & GPLv2+"
+LIC_FILES_CHKSUM = "\
+        file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34 \
+        file://COPYING.GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
+        file://m4/attributes.m4;endline=33;md5=b25958da44c02231e3641f1bccef53eb \
+        file://rate/rate_samplerate.c;endline=19;md5=f3d3ce0b189846a486517d97a854b276 \
+"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/plugins/${BP}.tar.bz2 \
+           file://0001-arcam-av-Include-sys-select.h-for-fd_set-definition.patch \
+           file://0001-include-speexdsp_types.h-not-speex_types.h.patch \
+"
+SRC_URI[md5sum] = "a66797b4471e3cbe96575207bfbe252c"
+SRC_URI[sha256sum] = "325d85cac285f632b83e0191ae3f348bad03c1f007b937042f164abb81ea6532"
+
+DEPENDS += "alsa-lib"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG ??= "\
+        samplerate \
+        speexdsp \
+        ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
+"
+PACKAGECONFIG[avcodec] = "--enable-avcodec,--disable-avcodec,libav"
+PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
+PACKAGECONFIG[maemo-plugin] = "--enable-maemo-plugin,--disable-maemo-plugin"
+PACKAGECONFIG[maemo-resource-manager] = "--enable-maemo-resource-manager,--disable-maemo-resource-manager,dbus"
+PACKAGECONFIG[pulseaudio] = "--enable-pulseaudio,--disable-pulseaudio,pulseaudio"
+PACKAGECONFIG[samplerate] = "--enable-samplerate,--disable-samplerate,libsamplerate0"
+PACKAGECONFIG[speexdsp] = "--with-speex=lib,--with-speex=no,speexdsp"
+
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'alsa-plugins-pulseaudio-conf', '', d)}"
+
+PACKAGES_DYNAMIC = "^libasound-module-.*"
+
+# The alsa-plugins package doesn't itself contain anything, it just depends on
+# all built plugins.
+ALLOW_EMPTY_${PN} = "1"
+
+do_install_append() {
+	rm ${D}${libdir}/alsa-lib/*.la
+
+	# We use the example as is, so just drop the .example suffix.
+	if [ "${@bb.utils.contains('PACKAGECONFIG', 'pulseaudio', 'yes', 'no', d)}" = "yes" ]; then
+		mv ${D}${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf.example ${D}${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf
+	fi
+}
+
+python populate_packages_prepend() {
+    plugindir = bb.data.expand('${libdir}/alsa-lib/', d)
+    packages = " ".join(do_split_packages(d, plugindir, '^libasound_module_(.*)\.so$', 'libasound-module-%s', 'Alsa plugin for %s', extra_depends=''))
+    d.setVar("RDEPENDS_alsa-plugins", packages)
+}
+
+# The rate plugins create some symlinks. For example, the samplerate plugin
+# creates these links to the main plugin file:
+#
+#   libasound_module_rate_samplerate_best.so
+#   libasound_module_rate_samplerate_linear.so
+#   libasound_module_rate_samplerate_medium.so
+#   libasound_module_rate_samplerate_order.so
+#
+# The other rate plugins create similar links. We have to add the links to
+# FILES manually, because do_split_packages() skips the links (which is good,
+# because we wouldn't want do_split_packages() to create separate packages for
+# the symlinks).
+#
+# The symlinks cause QA errors, because usually it's a bug if a non
+# -dev/-dbg/-nativesdk package contains links to .so files, but in this case
+# the errors are false positives, so we disable the QA checks.
+FILES_${MLPREFIX}libasound-module-rate-lavcrate += "${libdir}/alsa-lib/*rate_lavcrate_*.so"
+FILES_${MLPREFIX}libasound-module-rate-samplerate += "${libdir}/alsa-lib/*rate_samplerate_*.so"
+FILES_${MLPREFIX}libasound-module-rate-speexrate += "${libdir}/alsa-lib/*rate_speexrate_*.so"
+INSANE_SKIP_${MLPREFIX}libasound-module-rate-lavcrate = "dev-so"
+INSANE_SKIP_${MLPREFIX}libasound-module-rate-samplerate = "dev-so"
+INSANE_SKIP_${MLPREFIX}libasound-module-rate-speexrate = "dev-so"
+
+FILES_${PN}-dbg += "${libdir}/alsa-lib/.debug"
+
+# 50-pulseaudio.conf defines a device named "pulse" that applications can use
+# if they explicitly want to use the PulseAudio plugin.
+# 99-pulseaudio-default.conf configures the "default" device to use the
+# PulseAudio plugin.
+FILES_${PN}-pulseaudio-conf += "\
+        ${datadir}/alsa/alsa.conf.d/50-pulseaudio.conf \
+        ${datadir}/alsa/alsa.conf.d/99-pulseaudio-default.conf \
+"
+
+RDEPENDS_${PN}-pulseaudio-conf += "\
+        libasound-module-conf-pulse \
+        libasound-module-ctl-pulse \
+        libasound-module-pcm-pulse \
+"
diff --git a/meta/recipes-multimedia/alsa/alsa-tools/0001-as10k1-Make-output_tram_line-static-inline.patch b/meta/recipes-multimedia/alsa/alsa-tools/0001-as10k1-Make-output_tram_line-static-inline.patch
new file mode 100644
index 0000000..d049a30
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-tools/0001-as10k1-Make-output_tram_line-static-inline.patch
@@ -0,0 +1,31 @@
+From 1e5926df74a35fe2cd90bc59f5264a8715c94048 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 08:16:59 +0000
+Subject: [PATCH] as10k1: Make output_tram_line() static inline
+
+The function is not used in any other file, its better to make it static
+inline so compiler has a better chance of optimizing here
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ as10k1/as10k1.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/as10k1/as10k1.c b/as10k1/as10k1.c
+index 96af0c3..d0766fd 100644
+--- a/as10k1/as10k1.c
++++ b/as10k1/as10k1.c
+@@ -366,7 +366,7 @@ void as_exit(const char *message)
+ 	exit(1);
+ }
+ 
+-inline void output_tram_line( struct list_head *line_head, int type){
++static inline void output_tram_line( struct list_head *line_head, int type){
+         
+         struct tram *tram_sym;
+         struct list_head *entry;
+-- 
+2.5.1
+
diff --git a/meta/recipes-multimedia/alsa/alsa-tools/autotools.patch b/meta/recipes-multimedia/alsa/alsa-tools/autotools.patch
new file mode 100644
index 0000000..59391d6
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-tools/autotools.patch
@@ -0,0 +1,32 @@
+Add parameters to autoreconf to support cross compile.
+Remove some sub-components which needs further recipe support.
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+diff -ruN alsa-tools-1.0.24.1-orig//ld10k1/gitcompile alsa-tools-1.0.24.1/ld10k1/gitcompile
+--- alsa-tools-1.0.24.1-orig//ld10k1/gitcompile	2011-07-06 11:27:40.227665002 +0800
++++ alsa-tools-1.0.24.1/ld10k1/gitcompile	2011-07-14 13:26:18.017665004 +0800
+@@ -1,6 +1,6 @@
+ #!/bin/bash
+ 
+-autoreconf -fi || exit 1
++autoreconf $ACLOCAL_FLAGS -fi || exit 1
+ export CFLAGS='-O2 -Wall -pipe -g'
+ echo "CFLAGS=$CFLAGS"
+ echo "./configure $@"
+diff -ruN alsa-tools-1.0.24.1-orig//Makefile alsa-tools-1.0.24.1/Makefile
+--- alsa-tools-1.0.24.1-orig//Makefile	2011-07-06 11:27:40.207665000 +0800
++++ alsa-tools-1.0.24.1/Makefile	2011-07-14 15:08:08.877665009 +0800
+@@ -1,8 +1,8 @@
+ VERSION = 1.0.29
+ TOP = .
+-SUBDIRS = as10k1 envy24control hdsploader hdspconf hdspmixer \
++SUBDIRS = as10k1 envy24control \
+ 	  mixartloader pcxhrloader rmedigicontrol sb16_csp seq sscape_ctl \
+-	  us428control usx2yloader vxloader echomixer ld10k1 qlo10k1 \
++	  us428control usx2yloader vxloader echomixer \
+ 	  hwmixvolume hdajackretask hda-verb hdajacksensetest
+ 
+ all:
diff --git a/meta/recipes-multimedia/alsa/alsa-tools/gitcompile_hdajacksensetest b/meta/recipes-multimedia/alsa/alsa-tools/gitcompile_hdajacksensetest
new file mode 100755
index 0000000..58328bd
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-tools/gitcompile_hdajacksensetest
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+aclocal $ACLOCAL_FLAGS || exit 1
+automake --foreign --add-missing || exit 1
+autoconf || exit 1
+export CFLAGS='-O2 -Wall -pipe -g'
+echo "CFLAGS=$CFLAGS"
+echo "./configure $@"
+./configure $@ || exit 1
+unset CFLAGS
+if [ -z "$GITCOMPILE_NO_MAKE" ]; then
+  make || exit 1
+fi
diff --git a/meta/recipes-multimedia/alsa/alsa-tools/makefile_no_gtk.patch b/meta/recipes-multimedia/alsa/alsa-tools/makefile_no_gtk.patch
new file mode 100644
index 0000000..c957609
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-tools/makefile_no_gtk.patch
@@ -0,0 +1,29 @@
+Remove some sub-components which need gtk+.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Rogerio Nunes <ronunes@gmail.com>
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+
+Update patch for alsa-tools 1.0.29
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+diff --git a/Makefile b/Makefile
+index 2457a1c..72346d9 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,9 +1,9 @@
+ VERSION = 1.0.29
+ TOP = .
+-SUBDIRS = as10k1 envy24control \
+-	  mixartloader pcxhrloader rmedigicontrol sb16_csp seq sscape_ctl \
+-	  us428control usx2yloader vxloader echomixer \
+-	  hwmixvolume hdajackretask hda-verb hdajacksensetest
++SUBDIRS = as10k1 \
++	  mixartloader pcxhrloader sb16_csp seq sscape_ctl \
++	  us428control usx2yloader vxloader \
++	  hwmixvolume hda-verb hdajacksensetest
+ 
+ all:
+ 	@for i in $(SUBDIRS); do \
diff --git a/meta/recipes-multimedia/alsa/alsa-tools_1.0.29.bb b/meta/recipes-multimedia/alsa/alsa-tools_1.0.29.bb
new file mode 100644
index 0000000..fdf396e
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-tools_1.0.29.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Advanced tools for certain ALSA sound card drivers"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "https://bugtrack.alsa-project.org/alsa-bug/login_page.php"
+SECTION = "console/utils"
+LICENSE = "GPLv2 & LGPLv2+"
+DEPENDS = "alsa-lib ncurses glib-2.0"
+
+LIC_FILES_CHKSUM = "file://hdsploader/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://ld10k1/COPYING.LIB;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/tools/${BP}.tar.bz2 \
+           file://autotools.patch \
+           ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', \
+                                'file://makefile_no_gtk.patch', d)} \
+           file://gitcompile_hdajacksensetest \
+           file://0001-as10k1-Make-output_tram_line-static-inline.patch \
+          "
+
+SRC_URI[md5sum] = "f339a3cd24f748c9d007bdff0e98775b"
+SRC_URI[sha256sum] = "94abf0ab5a73f0710c70d4fb3dc1003af5bae2d2ed721d59d245b41ad0f2fbd1"
+
+inherit autotools-brokensep pkgconfig
+
+CLEANBROKEN = "1"
+
+EXTRA_OEMAKE += "GITCOMPILE_ARGS='--host=${HOST_SYS} --build=${BUILD_SYS} --target=${TARGET_SYS} --with-libtool-sysroot=${STAGING_DIR_HOST} --prefix=${prefix}'"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk+', '', d)}"
+PACKAGECONFIG[gtk+] = ",,gtk+ gtk+3,"
+
+# configure.ac/.in doesn't exist so force copy
+AUTOTOOLS_COPYACLOCAL = "1"
+
+do_compile_prepend () {
+    #Automake dir is not correctly detected in cross compilation case
+    export AUTOMAKE_DIR="$(automake --print-libdir)"
+    export ACLOCAL_FLAGS="--system-acdir=${ACLOCALDIR}/"
+
+    cp ${WORKDIR}/gitcompile_hdajacksensetest ${S}/hdajacksensetest/gitcompile
+}
+
+FILES_${PN} += "${datadir}/ld10k1"
diff --git a/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.0.29.bb b/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.0.29.bb
new file mode 100644
index 0000000..a98f9b9
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-utils-scripts_1.0.29.bb
@@ -0,0 +1,21 @@
+require alsa-utils_${PV}.bb
+
+SUMMARY = "Shell scripts that show help info and create ALSA configuration files"
+PROVIDES = "alsa-utils-alsaconf"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/alsa-utils:"
+
+PACKAGES = "${PN}"
+RDEPENDS_${PN} += "bash"
+
+FILES_${PN} = "${sbindir}/alsaconf \
+               ${sbindir}/alsa-info.sh \
+              "
+
+S = "${WORKDIR}/alsa-utils-${PV}"
+
+do_install() {
+	install -d ${D}${sbindir}
+	install -m 0755 ${B}/alsaconf/alsaconf ${D}${sbindir}/
+	install -m 0755 ${S}/alsa-info/alsa-info.sh ${D}${sbindir}/
+}
diff --git a/meta/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch b/meta/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch
new file mode 100644
index 0000000..e99dd51
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-utils/0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch
@@ -0,0 +1,52 @@
+From 43a56fa36a12f09ccd78b3cf5e6ae197fcab501f Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Fri, 29 Aug 2014 18:58:56 +0300
+Subject: [PATCH] alsactl: don't let systemd unit restore the volume when
+ asound.state is missing
+
+This avoids an error on bootup
+
+Filed as https://bugtrack.alsa-project.org/alsa-bug/view.php?id=5459
+
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Cristian Iorga <cristian.iorga@intel.com>
+---
+ alsactl/Makefile.am             | 7 ++++---
+ alsactl/alsa-restore.service.in | 1 +
+ 2 files changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/alsactl/Makefile.am b/alsactl/Makefile.am
+index 47f06e9..b728c06 100644
+--- a/alsactl/Makefile.am
++++ b/alsactl/Makefile.am
+@@ -43,9 +43,10 @@ install-data-hook:
+ endif
+ 
+ edit = \
+-	$(SED) -r -e 's,@sbindir\@,$(sbindir),g' \
+-		  -e 's,@mydatadir\@,$(mydatadir),g' \
+-		  -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
++	$(SED) -e 's,@localstatedir\@,$(localstatedir),g' \
++	       -e 's,@sbindir\@,$(sbindir),g' \
++	       -e 's,@mydatadir\@,$(mydatadir),g' \
++	       -e 's,@daemonswitch\@,$(ALSACTL_DAEMONSWITCH),g' \
+ 							< $< > $@ || rm $@
+ 
+ alsa-state.service: alsa-state.service.in
+diff --git a/alsactl/alsa-restore.service.in b/alsactl/alsa-restore.service.in
+index 245a439..b017854 100644
+--- a/alsactl/alsa-restore.service.in
++++ b/alsactl/alsa-restore.service.in
+@@ -10,6 +10,7 @@ DefaultDependencies=no
+ After=alsa-state.service
+ Before=shutdown.target
+ Conflicts=shutdown.target
++ConditionPathExists=@localstatedir@/lib/alsa/asound.state
+ 
+ [Service]
+ Type=oneshot
+-- 
+1.9.1
+
diff --git a/meta/recipes-multimedia/alsa/alsa-utils/alsa-utils-aplay-interrupt-signal-handling.patch b/meta/recipes-multimedia/alsa/alsa-utils/alsa-utils-aplay-interrupt-signal-handling.patch
new file mode 100644
index 0000000..5df004a
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-utils/alsa-utils-aplay-interrupt-signal-handling.patch
@@ -0,0 +1,48 @@
+Upstream-Status: Pending
+
+aplay/arecord (alsa-utils v1.0.28) cannot interrupt streaming
+via CTRL-C. Fixed the issue by reverting buggy patches and
+properly handling 'in_aborting' flag in appropriate functions.
+
+Signed-off-by: Anant Agrawal <Anant_Agrawal@mentor.com>
+Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com>
+
+--- a/aplay/aplay.c	2014-05-19 16:25:14.000000000 +0530
++++ b/aplay/aplay.c	2014-05-20 15:17:14.364823007 +0530
+@@ -392,14 +392,22 @@
+ 		putchar('\n');
+ 	if (!quiet_mode)
+ 		fprintf(stderr, _("Aborted by signal %s...\n"), strsignal(sig));
+-	if (handle)
++	if (stream == SND_PCM_STREAM_CAPTURE) {
++		if (fmt_rec_table[file_type].end) {
++			fmt_rec_table[file_type].end(fd);
++			fd = -1;
++		}
++		stream = -1;
++	}
++	if (fd > 1) {
++		close(fd);
++		fd = -1;
++	}
++	if (handle && sig != SIGABRT) {
+ 		snd_pcm_abort(handle);
+-	if (sig == SIGABRT) {
+-		/* do not call snd_pcm_close() and abort immediately */
+ 		handle = NULL;
+-		prg_exit(EXIT_FAILURE);
+ 	}
+-	signal(sig, signal_handler);
++	prg_exit(EXIT_FAILURE);
+ }
+ 
+ /* call on SIGUSR1 signal. */
+@@ -2096,7 +2104,7 @@
+ 	ssize_t result = count, r;
+ 	size_t size;
+ 
+-	while (count > 0) {
++	while (count > 0 && !in_aborting) {
+ 		size = count;
+ 		if (size > chunk_bytes - buffer_pos)
+ 			size = chunk_bytes - buffer_pos;
diff --git a/meta/recipes-multimedia/alsa/alsa-utils/assume-storing-is-success-if-not-sound-card-device.patch b/meta/recipes-multimedia/alsa/alsa-utils/assume-storing-is-success-if-not-sound-card-device.patch
new file mode 100644
index 0000000..f67283d
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-utils/assume-storing-is-success-if-not-sound-card-device.patch
@@ -0,0 +1,34 @@
+[PATCH] assume storing is success if not sound card device
+
+Upstream-Statue: Pending
+
+Systemd will report failure when run alsa-*, if the machine has not the
+sound card. To void this annoyed message, alsa-restore/alsa-state ignore
+all the exit codes by prefixing "-" in ExecStart, like:
+
+   alsa-utils-1.0.29$ grep "=-" ./ -r|grep service.in
+   ./alsactl/alsa-restore.service.in:ExecStart=-@sbindir@/alsactl restore
+   ./alsactl/alsa-state.service.in:ExecStart=-@sbindir@/alsactl -s -n 19 -c rdaemon
+   ./alsactl/alsa-state.service.in:ExecStop=-@sbindir@/alsactl -s kill save_and_quit
+   lsa-utils-1.0.29$
+
+But alsa-store.service.in is missing, and better solution is to ignore
+the exit code 19 which means not sound card device, not all exit code
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ alsactl/alsa-store.service.in | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/alsactl/alsa-store.service.in b/alsactl/alsa-store.service.in
+index f1a56bb..68ca529 100644
+--- a/alsactl/alsa-store.service.in
++++ b/alsactl/alsa-store.service.in
+@@ -13,3 +13,4 @@ Before=shutdown.target
+ Type=oneshot
+ ExecStart=@sbindir@/alsactl store
+ StandardOutput=syslog
++SuccessExitStatus=0 19
+-- 
+1.9.1
+
diff --git a/meta/recipes-multimedia/alsa/alsa-utils_1.0.29.bb b/meta/recipes-multimedia/alsa/alsa-utils_1.0.29.bb
new file mode 100644
index 0000000..97fe4b2
--- /dev/null
+++ b/meta/recipes-multimedia/alsa/alsa-utils_1.0.29.bb
@@ -0,0 +1,97 @@
+SUMMARY = "ALSA sound utilities"
+HOMEPAGE = "http://www.alsa-project.org"
+BUGTRACKER = "https://bugtrack.alsa-project.org/alsa-bug/login_page.php"
+SECTION = "console/utils"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://alsactl/utils.c;beginline=1;endline=20;md5=fe9526b055e246b5558809a5ae25c0b9"
+DEPENDS = "alsa-lib ncurses libsamplerate0"
+
+PACKAGECONFIG ??= "udev"
+PACKAGECONFIG[udev] = "--with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d,,udev"
+PACKAGECONFIG[xmlto] = "--enable-xmlto, --disable-xmlto, xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
+
+SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \
+           file://0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch \
+           file://alsa-utils-aplay-interrupt-signal-handling.patch \
+           file://assume-storing-is-success-if-not-sound-card-device.patch \
+          "
+
+SRC_URI[md5sum] = "6b289bf874c4c9a63f4b3973093dd404"
+SRC_URI[sha256sum] = "5160058f3e14483ced5de919dd473f93932059454530a9b7ef97dcabd6833e9b"
+
+# lazy hack. needs proper fixing in gettext.m4, see
+# http://bugs.openembedded.org/show_bug.cgi?id=2348
+# please close bug and remove this comment when properly fixed
+#
+EXTRA_OECONF_append_libc-uclibc = " --disable-nls"
+
+inherit autotools gettext pkgconfig
+
+# This are all packages that we need to make. Also, the now empty alsa-utils
+# ipk depends on them.
+
+ALSA_UTILS_PKGS = "\
+             alsa-utils-alsamixer \
+             alsa-utils-midi \
+             alsa-utils-aplay \
+             alsa-utils-amixer \
+             alsa-utils-aconnect \
+             alsa-utils-iecset \
+             alsa-utils-speakertest \
+             alsa-utils-aseqnet \
+             alsa-utils-aseqdump \
+             alsa-utils-alsactl \
+             alsa-utils-alsaloop \
+             alsa-utils-alsaucm \
+            "
+
+PACKAGES += "${ALSA_UTILS_PKGS}"
+RDEPENDS_${PN} += "${ALSA_UTILS_PKGS}"
+
+FILES_${PN} = ""
+FILES_alsa-utils-aplay       = "${bindir}/aplay ${bindir}/arecord"
+FILES_alsa-utils-amixer      = "${bindir}/amixer"
+FILES_alsa-utils-alsamixer   = "${bindir}/alsamixer"
+FILES_alsa-utils-speakertest = "${bindir}/speaker-test ${datadir}/sounds/alsa/ ${datadir}/alsa/speaker-test/"
+FILES_alsa-utils-midi        = "${bindir}/aplaymidi ${bindir}/arecordmidi ${bindir}/amidi"
+FILES_alsa-utils-aconnect    = "${bindir}/aconnect"
+FILES_alsa-utils-aseqnet     = "${bindir}/aseqnet"
+FILES_alsa-utils-iecset      = "${bindir}/iecset"
+FILES_alsa-utils-alsactl     = "${sbindir}/alsactl */udev/rules.d */*/udev/rules.d ${systemd_unitdir} ${localstatedir}/lib/alsa ${datadir}/alsa/init/"
+FILES_alsa-utils-aseqdump    = "${bindir}/aseqdump"
+FILES_alsa-utils-alsaloop    = "${bindir}/alsaloop"
+FILES_alsa-utils-alsaucm     = "${bindir}/alsaucm"
+
+
+SUMMARY_alsa-utils-aplay        = "Play (and record) sound files using ALSA"
+SUMMARY_alsa-utils-amixer       = "Command-line control for ALSA mixer and settings"
+SUMMARY_alsa-utils-alsamixer    = "ncurses-based control for ALSA mixer and settings"
+SUMMARY_alsa-utils-speakertest  = "ALSA surround speaker test utility"
+SUMMARY_alsa-utils-midi         = "Miscellaneous MIDI utilities for ALSA"
+SUMMARY_alsa-utils-aconnect     = "ALSA sequencer connection manager"
+SUMMARY_alsa-utils-aseqnet      = "Network client/server for ALSA sequencer"
+SUMMARY_alsa-utils-iecset       = "ALSA utility for setting/showing IEC958 (S/PDIF) status bits"
+SUMMARY_alsa-utils-alsactl      = "Saves/restores ALSA-settings in /etc/asound.state"
+SUMMARY_alsa-utils-aseqdump     = "Shows the events received at an ALSA sequencer port"
+SUMMARY_alsa-utils-alsaloop     = "ALSA PCM loopback utility"
+SUMMARY_alsa-utils-alsaucm      = "ALSA Use Case Manager"
+
+RRECOMMENDS_alsa-utils-alsactl = "alsa-states"
+
+ALLOW_EMPTY_alsa-utils = "1"
+
+do_install() {
+	autotools_do_install
+
+	# We don't ship this here because it requires a dependency on bash.
+	# See alsa-utils-scripts_${PV}.bb
+	rm ${D}${sbindir}/alsaconf
+	rm ${D}${sbindir}/alsa-info.sh
+
+	if ${@bb.utils.contains('PACKAGECONFIG', 'udev', 'false', 'true', d)}; then
+	   # This is where alsa-utils will install its rules if we don't tell it anything else.
+	   rm -rf ${D}/lib/udev
+	   rmdir --ignore-fail-on-non-empty ${D}/lib
+	fi
+}
diff --git a/meta/recipes-multimedia/flac/flac_1.3.1.bb b/meta/recipes-multimedia/flac/flac_1.3.1.bb
new file mode 100644
index 0000000..f25271f
--- /dev/null
+++ b/meta/recipes-multimedia/flac/flac_1.3.1.bb
@@ -0,0 +1,42 @@
+SUMMARY = "Free Lossless Audio Codec"
+DESCRIPTION = "FLAC stands for Free Lossless Audio Codec, a lossless audio compression format."
+HOMEPAGE = "https://xiph.org/flac/"
+BUGTRACKER = "http://sourceforge.net/p/flac/bugs/"
+SECTION = "libs"
+LICENSE = "GFDL-1.2 & GPLv2+ & LGPLv2.1+ & BSD"
+LIC_FILES_CHKSUM = "file://COPYING.FDL;md5=ad1419ecc56e060eccf8184a87c4285f \
+                    file://src/Makefile.am;beginline=1;endline=17;md5=0a853b81d9d43d8aad3b53b05cfcc37e \
+                    file://COPYING.GPL;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://src/flac/main.c;beginline=1;endline=18;md5=d03a766558d233f9cc3ac5dfafd49deb \
+                    file://COPYING.LGPL;md5=fbc093901857fcd118f065f900982c24 \
+                    file://src/plugin_common/all.h;beginline=1;endline=18;md5=7c8a3b9e1e66ed0aba765bc6f35da85d \
+                    file://COPYING.Xiph;md5=a2c4b71c0198682376d483eb5bcc9197 \
+                    file://include/FLAC/all.h;beginline=65;endline=70;md5=64474f2b22e9e77b28d8b8b25c983a48"
+DEPENDS = "libogg"
+
+SRC_URI = "http://downloads.xiph.org/releases/flac/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "b9922c9a0378c88d3e901b234f852698"
+SRC_URI[sha256sum] = "4773c0099dba767d963fd92143263be338c48702172e8754b9bc5103efe1c56c"
+
+inherit autotools gettext
+
+EXTRA_OECONF = "--disable-oggtest \
+                --with-ogg-libraries=${STAGING_LIBDIR} \
+                --with-ogg-includes=${STAGING_INCDIR} \
+                --disable-xmms-plugin \
+                --without-libiconv-prefix \
+                ac_cv_prog_NASM="" \
+                "
+
+EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "altivec", " --enable-altivec", " --disable-altivec", d)}"
+EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "core2", " --enable-sse", "", d)}"
+EXTRA_OECONF += "${@bb.utils.contains("TUNE_FEATURES", "corei7", " --enable-sse", "", d)}"
+
+PACKAGES += "libflac libflac++ liboggflac liboggflac++"
+FILES_${PN} = "${bindir}/*"
+FILES_libflac = "${libdir}/libFLAC.so.*"
+FILES_libflac++ = "${libdir}/libFLAC++.so.*"
+FILES_liboggflac = "${libdir}/libOggFLAC.so.*"
+FILES_liboggflac++ = "${libdir}/libOggFLAC++.so.*"
+
diff --git a/meta/recipes-multimedia/gstreamer/gst-player/Add-error-signal-emission-for-missing-plugins.patch b/meta/recipes-multimedia/gstreamer/gst-player/Add-error-signal-emission-for-missing-plugins.patch
new file mode 100644
index 0000000..712d46d
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gst-player/Add-error-signal-emission-for-missing-plugins.patch
@@ -0,0 +1,252 @@
+From d64c7edb66f4a64ff49c4306cf77fd269b7079ab Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Mon, 16 Mar 2015 13:45:30 +0200
+Subject: [PATCH] Add error signal emission for missing plugins
+
+Add a missing plugins error signal to gst-player. Note that this error
+does not necessarily mean the playback has completely failed, but in
+practice the user experience will be bad (think, e.g. of a mp4 file
+where H.264 codec is missing: AAC playback still works...).
+
+Use the signal in gtk-play to show a infobar if plugins are missing.
+
+Submitted upstream at https://github.com/sdroege/gst-player/pull/11
+
+Upstream-Status: Submitted
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ configure.ac               |  2 +-
+ gtk/gtk-play.c             | 54 +++++++++++++++++++++++++++++++++++++++++++++-
+ lib/gst/player/gstplayer.c | 22 +++++++++++++++++++
+ lib/gst/player/gstplayer.h |  3 ++-
+ 4 files changed, 78 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 90ab74c..6cdb4eb 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -53,7 +53,7 @@ AC_SUBST(LT_AGE)
+ PKG_PROG_PKG_CONFIG
+ 
+ PKG_CHECK_MODULES(GLIB, [glib-2.0 gobject-2.0])
+-PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= 1.4 gstreamer-video-1.0 >= 1.4])
++PKG_CHECK_MODULES(GSTREAMER, [gstreamer-1.0 >= 1.4 gstreamer-video-1.0 >= 1.4 gstreamer-pbutils-1.0])
+ 
+ GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
+ AC_SUBST(GLIB_PREFIX)
+diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
+index b92773b..e2b605a 100644
+--- a/gtk/gtk-play.c
++++ b/gtk/gtk-play.c
+@@ -30,6 +30,8 @@ typedef struct
+   GtkWidget *prev_button, *next_button;
+   GtkWidget *seekbar;
+   GtkWidget *video_area;
++  GtkWidget *info_label;
++  GtkWidget *info_bar;
+   GtkWidget *volume_button;
+   gulong seekbar_value_changed_signal_id;
+   gboolean playing;
+@@ -141,6 +143,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
+ }
+ 
+ static void
++clear_missing_plugins (GtkPlay * play)
++{
++  gtk_label_set_text (GTK_LABEL (play->info_label), "");
++  gtk_widget_hide (play->info_bar);
++}
++
++static void
+ skip_prev_clicked_cb (GtkButton * button, GtkPlay * play)
+ {
+   GList *prev;
+@@ -155,6 +164,7 @@ skip_prev_clicked_cb (GtkButton * button, GtkPlay * play)
+ 
+   gtk_widget_set_sensitive (play->next_button, TRUE);
+   gst_player_set_uri (play->player, prev->data);
++  clear_missing_plugins (play);
+   gst_player_play (play->player);
+   set_title (play, prev->data);
+   gtk_widget_set_sensitive (play->prev_button, g_list_previous (prev) != NULL);
+@@ -175,6 +185,7 @@ skip_next_clicked_cb (GtkButton * button, GtkPlay * play)
+ 
+   gtk_widget_set_sensitive (play->prev_button, TRUE);
+   gst_player_set_uri (play->player, next->data);
++  clear_missing_plugins (play);
+   gst_player_play (play->player);
+   set_title (play, next->data);
+   gtk_widget_set_sensitive (play->next_button, g_list_next (next) != NULL);
+@@ -193,10 +204,16 @@ volume_changed_cb (GtkScaleButton * button, gdouble value, GtkPlay * play)
+   gst_player_set_volume (play->player, value);
+ }
+ 
++void
++info_bar_response_cb (GtkInfoBar * bar, gint response, GtkPlay * play)
++{
++  gtk_widget_hide (GTK_WIDGET (bar));
++}
++
+ static void
+ create_ui (GtkPlay * play)
+ {
+-  GtkWidget *controls, *main_hbox, *main_vbox;
++  GtkWidget *controls, *main_hbox, *main_vbox, *info_bar, *content_area;
+ 
+   play->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+   g_signal_connect (G_OBJECT (play->window), "delete-event",
+@@ -208,6 +225,20 @@ create_ui (GtkPlay * play)
+   g_signal_connect (play->video_area, "realize",
+       G_CALLBACK (video_area_realize_cb), play);
+ 
++  play->info_bar = gtk_info_bar_new ();
++  gtk_info_bar_set_message_type (GTK_INFO_BAR (play->info_bar),
++      GTK_MESSAGE_WARNING);
++  //gtk_info_bar_set_show_close_button (GTK_INFO_BAR (play->info_bar),
++  //    TRUE);
++  gtk_widget_set_no_show_all (play->info_bar, TRUE);
++  g_signal_connect (play->info_bar, "response",
++      G_CALLBACK (info_bar_response_cb), play);
++
++  content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (play->info_bar));
++  play->info_label = gtk_label_new ("");
++  gtk_container_add (GTK_CONTAINER (content_area), play->info_label);
++  gtk_widget_show (play->info_label);
++
+   /* Unified play/pause button */
+   play->play_pause_button =
+       gtk_button_new_from_icon_name ("media-playback-pause",
+@@ -258,6 +289,7 @@ create_ui (GtkPlay * play)
+ 
+   main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+   gtk_box_pack_start (GTK_BOX (main_vbox), main_hbox, TRUE, TRUE, 0);
++  gtk_box_pack_start (GTK_BOX (main_vbox), play->info_bar, FALSE, FALSE, 0);
+   gtk_box_pack_start (GTK_BOX (main_vbox), controls, FALSE, FALSE, 0);
+   gtk_container_add (GTK_CONTAINER (play->window), main_vbox);
+ 
+@@ -322,6 +354,7 @@ eos_cb (GstPlayer * unused, GtkPlay * play)
+       gtk_widget_set_sensitive (play->next_button, g_list_next (next) != NULL);
+ 
+       gst_player_set_uri (play->player, next->data);
++      clear_missing_plugins (play);
+       gst_player_play (play->player);
+       set_title (play, next->data);
+     } else {
+@@ -330,6 +363,24 @@ eos_cb (GstPlayer * unused, GtkPlay * play)
+   }
+ }
+ 
++static void
++error_cb (GstPlayer * player, GError * err, GtkPlay * play)
++{
++  char *message;
++
++  if (g_error_matches (err, gst_player_error_quark (),
++      GST_PLAYER_ERROR_MISSING_PLUGIN)) {
++    // add message to end of any existing message: there may be
++    // multiple missing plugins.
++    message = g_strdup_printf ("%s%s. ",
++        gtk_label_get_text (GTK_LABEL (play->info_label)), err->message);
++    gtk_label_set_text (GTK_LABEL (play->info_label), message);
++    g_free (message);
++
++    gtk_widget_show (play->info_bar);
++  }
++}
++
+ int
+ main (gint argc, gchar ** argv)
+ {
+@@ -422,6 +473,7 @@ main (gint argc, gchar ** argv)
+   g_signal_connect (play.player, "video-dimensions-changed",
+       G_CALLBACK (video_dimensions_changed_cb), &play);
+   g_signal_connect (play.player, "end-of-stream", G_CALLBACK (eos_cb), &play);
++  g_signal_connect (play.player, "error", G_CALLBACK (error_cb), &play);
+ 
+   /* We have file(s) that need playing. */
+   set_title (&play, g_list_first (play.uris)->data);
+diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c
+index bd682d9..78e7ba1 100644
+--- a/lib/gst/player/gstplayer.c
++++ b/lib/gst/player/gstplayer.c
+@@ -47,6 +47,7 @@
+ 
+ #include <gst/gst.h>
+ #include <gst/video/video.h>
++#include <gst/pbutils/missing-plugins.h>
+ 
+ GST_DEBUG_CATEGORY_STATIC (gst_player_debug);
+ #define GST_CAT_DEFAULT gst_player_debug
+@@ -238,6 +239,7 @@ gst_player_class_init (GstPlayerClass * klass)
+       g_signal_new ("video-dimensions-changed", G_TYPE_FROM_CLASS (klass),
+       G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE | G_SIGNAL_NO_HOOKS, 0, NULL,
+       NULL, NULL, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
++
+ }
+ 
+ static void
+@@ -619,6 +621,21 @@ error_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
+   g_mutex_unlock (&self->priv->lock);
+ }
+ 
++static void
++element_cb (GstBus * bus, GstMessage * msg, gpointer user_data)
++{
++  GstPlayer *self = GST_PLAYER (user_data);
++
++  if (gst_is_missing_plugin_message (msg)) {
++    gchar *desc;
++
++    desc = gst_missing_plugin_message_get_description (msg);
++    emit_error (self, g_error_new (GST_PLAYER_ERROR,
++        GST_PLAYER_ERROR_MISSING_PLUGIN, "Missing plugin '%s'", desc));
++    g_free (desc);
++  }
++}
++
+ static gboolean
+ eos_dispatch (gpointer user_data)
+ {
+@@ -1059,6 +1076,8 @@ gst_player_main (gpointer data)
+       NULL, NULL);
+   g_source_attach (bus_source, self->priv->context);
+ 
++  g_signal_connect (G_OBJECT (bus), "message::element",
++      G_CALLBACK (element_cb), self);
+   g_signal_connect (G_OBJECT (bus), "message::error", G_CALLBACK (error_cb),
+       self);
+   g_signal_connect (G_OBJECT (bus), "message::eos", G_CALLBACK (eos_cb), self);
+@@ -1560,6 +1579,7 @@ gst_player_error_get_type (void)
+   static gsize id = 0;
+   static const GEnumValue values[] = {
+     {C_ENUM (GST_PLAYER_ERROR_FAILED), "GST_PLAYER_ERROR_FAILED", "failed"},
++    {C_ENUM (GST_PLAYER_ERROR_MISSING_PLUGIN), "GST_PLAYER_ERROR_MISSING_PLUGIN", "missing-plugin"},
+     {0, NULL, NULL}
+   };
+ 
+@@ -1577,6 +1597,8 @@ gst_player_error_get_name (GstPlayerError error)
+   switch (error) {
+     case GST_PLAYER_ERROR_FAILED:
+       return "failed";
++    case GST_PLAYER_ERROR_MISSING_PLUGIN:
++      return "missing-plugin";
+   }
+ 
+   g_assert_not_reached ();
+diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h
+index c438513..35fb5bb 100644
+--- a/lib/gst/player/gstplayer.h
++++ b/lib/gst/player/gstplayer.h
+@@ -44,7 +44,8 @@ GType        gst_player_error_get_type                (void);
+ #define      GST_TYPE_PLAYER_ERROR                    (gst_player_error_get_type ())
+ 
+ typedef enum {
+-  GST_PLAYER_ERROR_FAILED = 0
++  GST_PLAYER_ERROR_FAILED = 0,
++  GST_PLAYER_ERROR_MISSING_PLUGIN
+ } GstPlayerError;
+ 
+ const gchar *gst_player_error_get_name                (GstPlayerError error);
+-- 
+2.1.4
+
diff --git a/meta/recipes-multimedia/gstreamer/gst-player/Fix-pause-play.patch b/meta/recipes-multimedia/gstreamer/gst-player/Fix-pause-play.patch
new file mode 100644
index 0000000..783c42a
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gst-player/Fix-pause-play.patch
@@ -0,0 +1,107 @@
+Fix pause/play
+
+The current player state is now notified via the state-changed signal,
+and in the GTK UI it was only used to keep track of the desired state.
+
+This is a backport of upstream commit 738479c7a0.
+
+Upstream-Status: Backport
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+---
+ gtk/gtk-play.c             |  8 ++++++--
+ lib/gst/player/gstplayer.c | 12 ------------
+ lib/gst/player/gstplayer.h |  2 --
+ 3 files changed, 6 insertions(+), 16 deletions(-)
+
+diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
+index 6e7a098..e2b605a 100644
+--- a/gtk/gtk-play.c
++++ b/gtk/gtk-play.c
+@@ -34,6 +34,7 @@ typedef struct
+   GtkWidget *info_bar;
+   GtkWidget *volume_button;
+   gulong seekbar_value_changed_signal_id;
++  gboolean playing;
+ } GtkPlay;
+ 
+ /* Compat stubs */
+@@ -118,12 +119,13 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
+ {
+   GtkWidget *image;
+ 
+-  if (gst_player_is_playing (play->player)) {
++  if (play->playing) {
+     gst_player_pause (play->player);
+     image =
+         gtk_image_new_from_icon_name ("media-playback-start",
+         GTK_ICON_SIZE_BUTTON);
+     gtk_button_set_image (GTK_BUTTON (play->play_pause_button), image);
++    play->playing = FALSE;
+   } else {
+     gchar *title;
+ 
+@@ -136,6 +138,7 @@ play_pause_clicked_cb (GtkButton * button, GtkPlay * play)
+     title = gst_player_get_uri (play->player);
+     set_title (play, title);
+     g_free (title);
++    play->playing = TRUE;
+   }
+ }
+ 
+@@ -335,7 +338,7 @@ video_dimensions_changed_cb (GstPlayer * unused, gint width, gint height,
+ static void
+ eos_cb (GstPlayer * unused, GtkPlay * play)
+ {
+-  if (gst_player_is_playing (play->player)) {
++  if (play->playing) {
+     GList *next = NULL;
+     gchar *uri;
+ 
+@@ -452,6 +455,7 @@ main (gint argc, gchar ** argv)
+   }
+ 
+   play.player = gst_player_new ();
++  play.playing = TRUE;
+ 
+   g_object_set (play.player, "dispatch-to-main-context", TRUE, NULL);
+ 
+diff --git a/lib/gst/player/gstplayer.c b/lib/gst/player/gstplayer.c
+index 069b284..78e7ba1 100644
+--- a/lib/gst/player/gstplayer.c
++++ b/lib/gst/player/gstplayer.c
+@@ -1422,18 +1422,6 @@ gst_player_set_uri (GstPlayer * self, const gchar * val)
+   g_object_set (self, "uri", val, NULL);
+ }
+ 
+-gboolean
+-gst_player_is_playing (GstPlayer * self)
+-{
+-  gboolean val;
+-
+-  g_return_val_if_fail (GST_IS_PLAYER (self), FALSE);
+-
+-  g_object_get (self, "is-playing", &val, NULL);
+-
+-  return val;
+-}
+-
+ GstClockTime
+ gst_player_get_position (GstPlayer * self)
+ {
+diff --git a/lib/gst/player/gstplayer.h b/lib/gst/player/gstplayer.h
+index 6933dd7..35fb5bb 100644
+--- a/lib/gst/player/gstplayer.h
++++ b/lib/gst/player/gstplayer.h
+@@ -93,8 +93,6 @@ gchar *      gst_player_get_uri                       (GstPlayer    * player);
+ void         gst_player_set_uri                       (GstPlayer    * player,
+                                                        const gchar  * uri);
+ 
+-gboolean     gst_player_is_playing                    (GstPlayer    * player);
+-
+ GstClockTime gst_player_get_position                  (GstPlayer    * player);
+ GstClockTime gst_player_get_duration                  (GstPlayer    * player);
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-multimedia/gstreamer/gst-player/filechooser.patch b/meta/recipes-multimedia/gstreamer/gst-player/filechooser.patch
new file mode 100644
index 0000000..7bf1b03
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gst-player/filechooser.patch
@@ -0,0 +1,54 @@
+Upstream-Status: Submitted
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+From 43d4b19ab611d844156e26c4840cc54ddb73ae03 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Thu, 26 Feb 2015 17:17:05 +0000
+Subject: [PATCH] gtk-play: show a file chooser if no URIs were passed
+
+---
+ gtk/gtk-play.c |   28 ++++++++++++++++++++++++++--
+ 1 file changed, 26 insertions(+), 2 deletions(-)
+
+diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
+index f015077..9766a72 100644
+--- a/gtk/gtk-play.c
++++ b/gtk/gtk-play.c
+@@ -319,8 +319,32 @@ main (gint argc, gchar ** argv)
+   // FIXME: Add support for playlists and stuff
+   /* Parse the list of the file names we have to play. */
+   if (!file_names) {
+-    g_print ("Usage: %s FILE(s)|URI(s)\n", APP_NAME);
+-    return 1;
++    GtkWidget *chooser;
++    int res;
++
++    chooser = gtk_file_chooser_dialog_new ("Select files to play", NULL,
++                                          GTK_FILE_CHOOSER_ACTION_OPEN,
++                                          "_Cancel", GTK_RESPONSE_CANCEL,
++                                          "_Open", GTK_RESPONSE_ACCEPT,
++                                          NULL);
++    g_object_set (chooser,
++                  "local-only", FALSE,
++                  "select-multiple", TRUE,
++                  NULL);
++
++    res = gtk_dialog_run (GTK_DIALOG (chooser));
++    if (res == GTK_RESPONSE_ACCEPT) {
++      GSList *l;
++
++      l = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (chooser));
++      while (l) {
++        play.uris = g_list_append (play.uris, l->data);
++        l = g_slist_delete_link (l, l);
++      }
++    } else {
++      return 0;
++    }
++    gtk_widget_destroy (chooser);
+   } else {
+     guint i;
+ 
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-multimedia/gstreamer/gst-player/gst-player.desktop b/meta/recipes-multimedia/gstreamer/gst-player/gst-player.desktop
new file mode 100644
index 0000000..9fd207b
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gst-player/gst-player.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Media Player
+Comment=Basic media player
+Icon=audio-player
+TryExec=gtk-play
+Exec=gtk-play
+StartupNotify=true
+Terminal=false
+Type=Application
+Categories=GTK;AudioVideo;
diff --git a/meta/recipes-multimedia/gstreamer/gst-player/gtk2.patch b/meta/recipes-multimedia/gstreamer/gst-player/gtk2.patch
new file mode 100644
index 0000000..2cd18bb
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gst-player/gtk2.patch
@@ -0,0 +1,71 @@
+As the rest of Sato is GTK+ 2, patch gtk-play to use GTK+ 2.  When the rest of
+Sato has been ported to GTK+ 3 this patch can be dropped.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+
+diff --git a/configure.ac b/configure.ac
+index b8af13b..90ab74c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -60,7 +60,7 @@ AC_SUBST(GLIB_PREFIX)
+ GST_PREFIX="`$PKG_CONFIG --variable=prefix gstreamer-1.0`"
+ AC_SUBST(GST_PREFIX)
+ 
+-PKG_CHECK_MODULES(GTK, [gtk+-3.0], [have_gtk="yes"], [have_gtk="no"])
++PKG_CHECK_MODULES(GTK, [gtk+-2.0], [have_gtk="yes"], [have_gtk="no"])
+ AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" != "xno")
+ 
+ GOBJECT_INTROSPECTION_CHECK([1.31.1])
+diff --git a/gtk/gtk-play.c b/gtk/gtk-play.c
+index f015077..954d6fb 100644
+--- a/gtk/gtk-play.c
++++ b/gtk/gtk-play.c
+@@ -34,6 +34,46 @@ typedef struct
+   gulong seekbar_value_changed_signal_id;
+ } GtkPlay;
+ 
++/* Compat stubs */
++GtkWidget *
++gtk_box_new (GtkOrientation orientation,
++             gint spacing)
++{
++  switch (orientation) {
++  case GTK_ORIENTATION_HORIZONTAL:
++    return gtk_hbox_new (FALSE, spacing);
++  case GTK_ORIENTATION_VERTICAL:
++    return gtk_vbox_new (FALSE, spacing);
++  }
++}
++
++GtkWidget*
++gtk_button_new_from_icon_name (const gchar *icon_name,
++                               GtkIconSize  size)
++{
++  GtkWidget *button;
++  GtkWidget *image;
++
++  image = gtk_image_new_from_icon_name (icon_name, size);
++  button =  g_object_new (GTK_TYPE_BUTTON,
++                         "image", image,
++                         NULL);
++  return button;
++}
++
++GtkWidget *
++gtk_scale_new_with_range (GtkOrientation orientation,
++                          gdouble min,
++                          gdouble max,
++                          gdouble step)
++{
++  switch (orientation) {
++  case GTK_ORIENTATION_HORIZONTAL:
++    return gtk_hscale_new_with_range (min, max, step);
++  case GTK_ORIENTATION_VERTICAL:
++    return gtk_vscale_new_with_range (min, max, step);
++  }
++}
+ 
+ static void
+ set_title (GtkPlay * play, const gchar * title)
diff --git a/meta/recipes-multimedia/gstreamer/gst-player_git.bb b/meta/recipes-multimedia/gstreamer/gst-player_git.bb
new file mode 100644
index 0000000..54cfbbc
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gst-player_git.bb
@@ -0,0 +1,38 @@
+SUMMARY="GStreamer playback helper library and examples"
+
+LICENSE = "LGPL-2.0+"
+LIC_FILES_CHKSUM = "file://lib/gst/player/gstplayer.c;beginline=1;endline=19;md5=03aeca9d8295f811817909075a15ff65"
+
+DEPENDS = "glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base gtk+"
+
+SRC_URI = "git://github.com/sdroege/gst-player.git \
+           file://filechooser.patch \
+           file://gtk2.patch \
+           file://Fix-pause-play.patch \
+           file://Add-error-signal-emission-for-missing-plugins.patch \
+           file://gst-player.desktop"
+
+SRCREV = "5386c5b984d40ef5434673ed62204e69aaf52645"
+
+S = "${WORKDIR}/git"
+
+inherit autotools gtk-doc lib_package pkgconfig
+
+do_configure_prepend() {
+	touch ${S}/ChangeLog
+}
+
+EXTRA_OECONF += "ac_cv_path_VALGRIND=no ac_cv_path_GDB=no"
+
+do_install_append() {
+	install -m 0644 -D ${WORKDIR}/gst-player.desktop ${D}${datadir}/applications/gst-player.desktop
+}
+
+FILES_${PN}-bin += "${datadir}/applications/*.desktop"
+
+RDEPENDS_${PN}-bin = "gstreamer1.0-plugins-base-playback"
+RRECOMMENDS_${PN}-bin = "gstreamer1.0-plugins-base-meta \
+                         gstreamer1.0-plugins-good-meta \
+                         gstreamer1.0-plugins-bad-meta \
+                         ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "gstreamer1.0-libav", "", d)} \
+                         ${@bb.utils.contains("LICENSE_FLAGS_WHITELIST", "commercial", "gstreamer1.0-plugins-ugly-meta", "", d)}"
diff --git a/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc b/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc
new file mode 100644
index 0000000..cb1be06
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gst-plugins-package.inc
@@ -0,0 +1,58 @@
+PACKAGESPLITFUNCS_prepend = " split_gstreamer10_packages "
+PACKAGESPLITFUNCS_append = " set_metapkg_rdepends "
+
+python split_gstreamer10_packages () {
+    gst_libdir = d.expand('${libdir}/gstreamer-${LIBV}')
+    postinst = d.getVar('plugin_postinst', True)
+    glibdir = d.getVar('libdir', True)
+
+    do_split_packages(d, glibdir, '^lib(.*)\.so\.*', 'lib%s', 'gstreamer %s library', extra_depends='', allow_links=True)
+    do_split_packages(d, gst_libdir, 'libgst(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer plugin for %s', postinst=postinst, extra_depends='')
+    do_split_packages(d, gst_libdir, 'libgst(.*)\.la$', d.expand('${PN}-%s-dev'), 'GStreamer plugin for %s (development files)', extra_depends=d.expand('${PN}-dev'))
+    do_split_packages(d, gst_libdir, 'libgst(.*)\.a$', d.expand('${PN}-%s-staticdev'), 'GStreamer plugin for %s (static development files)', extra_depends=d.expand('${PN}-staticdev'))
+}
+
+python set_metapkg_rdepends () {
+    import os
+
+    pn = d.getVar('PN', True)
+    metapkg =  pn + '-meta'
+    d.setVar('ALLOW_EMPTY_' + metapkg, "1")
+    d.setVar('FILES_' + metapkg, "")
+    blacklist = [ pn, pn + '-locale', pn + '-dev', pn + '-dbg', pn + '-doc', pn + '-meta' ]
+    metapkg_rdepends = []
+    packages = d.getVar('PACKAGES', True).split()
+    pkgdest = d.getVar('PKGDEST', True)
+    for pkg in packages[1:]:
+        if not pkg in blacklist and not pkg in metapkg_rdepends and not pkg.endswith('-dev') and not pkg.endswith('-dbg') and not pkg.count('locale') and not pkg.count('-staticdev'):
+            # See if the package is empty by looking at the contents of its PKGDEST subdirectory. 
+            # If this subdirectory is empty, then the package is.
+            # Empty packages do not get added to the meta package's RDEPENDS
+            pkgdir = os.path.join(pkgdest, pkg)
+            if os.path.exists(pkgdir):
+                dir_contents = os.listdir(pkgdir) or []
+            else:
+                dir_contents = []
+            is_empty = len(dir_contents) == 0
+            if not is_empty:
+                metapkg_rdepends.append(pkg)
+    d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
+    d.setVar('DESCRIPTION_' + metapkg, pn + ' meta package')
+}
+
+# each plugin-dev depends on PN-dev, plugin-staticdev on PN-staticdev
+# so we need them even when empty (like in gst-plugins-good case)
+ALLOW_EMPTY_${PN} = "1"
+ALLOW_EMPTY_${PN}-dev = "1"
+ALLOW_EMPTY_${PN}-staticdev = "1"
+
+PACKAGES += "${PN}-apps ${PN}-meta ${PN}-glib"
+FILES_${PN}-apps = "${bindir}"
+
+RDEPENDS_${PN}-apps += "perl"
+RRECOMMENDS_${PN} += "${PN}-meta"
+
+FILES_${PN} = ""
+FILES_${PN}-dbg += "${libdir}/gstreamer-${LIBV}/.debug"
+FILES_${PN}-glib = "${datadir}/glib-2.0"
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc
new file mode 100644
index 0000000..84e6e95
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav.inc
@@ -0,0 +1,32 @@
+SUMMARY = "Libav-based GStreamer 1.x plugin"
+SECTION = "multimedia"
+LICENSE = "GPLv2+ & LGPLv2+ & ( (GPLv2+ & LGPLv2.1+) | (GPLv3+ & LGPLv3+) )"
+LICENSE_FLAGS = "commercial"
+HOMEPAGE = "http://www.gstreamer.net/"
+DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base zlib bzip2"
+
+inherit autotools pkgconfig
+
+# CAUTION: Using the system libav is not recommended. Since the libav API is changing all the time,
+# compilation errors (and other, more subtle bugs) can happen. It is usually better to rely on the
+# libav copy included in the gst-libav package.
+PACKAGECONFIG ??= " orc yasm "
+PACKAGECONFIG[libav] = "--with-system-libav,,libav"
+PACKAGECONFIG[lgpl]  = "--enable-lgpl,,"
+PACKAGECONFIG[yasm]  = "--enable-yasm,--disable-yasm,yasm-native"
+PACKAGECONFIG[orc]  = "--enable-orc,--disable-orc,orc"
+
+
+GSTREAMER_1_0_DEBUG ?= "--disable-debug"
+
+LIBAV_EXTRA_CONFIGURE = "--with-libav-extra-configure"
+LIBAV_EXTRA_CONFIGURE_COMMON = \
+'${LIBAV_EXTRA_CONFIGURE}="${LIBAV_EXTRA_CONFIGURE_COMMON_ARG}"'
+
+EXTRA_OECONF = "${LIBAV_EXTRA_CONFIGURE_COMMON}"
+
+FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
+FILES_${PN}-dbg += "${libdir}/gstreamer-1.0/.debug"
+FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
+FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a"
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch
new file mode 100644
index 0000000..1d99ad1
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/0001-Disable-yasm-for-libav-when-disable-yasm.patch
@@ -0,0 +1,33 @@
+From 54bba228ea52d01fd84941d97be23c03f9862b64 Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+Date: Sat, 6 Apr 2013 01:22:22 +0200
+Subject: [PATCH] Disable yasm for libav when --disable-yasm
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
+---
+ configure.ac | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 22ede88..ef3c050 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -305,6 +305,12 @@ else
+     emblibav_configure_args="$emblibav_configure_args --enable-gpl"
+   fi
+
++  AC_ARG_ENABLE(yasm,
++              [AC_HELP_STRING([--disable-yasm], [disable use of yasm assembler])])
++  if test "x$enable_yasm" = "xno"; then
++    emblibav_configure_args="$emblibav_configure_args --disable-yasm"
++  fi
++
+   # if we are cross-compiling, tell libav so
+   case $host in
+       *android*)
+-- 
+1.8.2
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch
new file mode 100644
index 0000000..ccadea4
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav/workaround-to-build-gst-libav-for-i586-with-gcc.patch
@@ -0,0 +1,26 @@
+Description: Workaround to build libav for i586 with gcc 4.9.2 by avoiding memset
+Author: Bernhard Übelacker <bernhardu@vr-web.de>
+
+---
+Bug-Debian: https://bugs.debian.org/783082
+Last-Update: 2015-04-28
+
+Upstream-Status: Backport [debian]
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+--- gst-libav-1.4.5.orig/gst-libs/ext/libav/libavcodec/h264_cabac.c
++++ gst-libav-1.4.5/gst-libs/ext/libav/libavcodec/h264_cabac.c
+@@ -2020,7 +2020,11 @@ decode_intra_mb:
+         // In deblocking, the quantizer is 0
+         h->cur_pic.qscale_table[mb_xy] = 0;
+         // All coeffs are present
+-        memset(h->non_zero_count[mb_xy], 16, 48);
++        /*memset(h->non_zero_count[mb_xy], 16, 48);*/
++            /* avoiding this memset because it leads at least with gcc4.9.2 to error: 'asm' operand has impossible constraints */
++        for (size_t i = 0; i < 48; i++) {
++            ( (unsigned char*)(h->non_zero_count[mb_xy]) ) [i] = 16;
++        }
+         h->cur_pic.mb_type[mb_xy] = mb_type;
+         h->last_qscale_diff = 0;
+         return 0;
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.4.5.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.4.5.bb
new file mode 100644
index 0000000..97fc7ec
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_1.4.5.bb
@@ -0,0 +1,27 @@
+include gstreamer1.0-libav.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
+                    file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
+                    file://gst-libs/ext/libav/LICENSE;md5=ea66e97a7ac1db978cf3529068a8c948 \
+                    file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
+                    file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = " \
+    http://gstreamer.freedesktop.org/src/gst-libav/gst-libav-${PV}.tar.xz \
+    file://0001-Disable-yasm-for-libav-when-disable-yasm.patch \
+    file://workaround-to-build-gst-libav-for-i586-with-gcc.patch \
+"
+SRC_URI[md5sum] = "f4922a46adbcbe7bd01331ff5dc7979d"
+SRC_URI[sha256sum] = "605c62624604f3bb5c870844cc1f2711779cc533b004c2aa1d8c0d58557afbbc"
+
+LIBAV_EXTRA_CONFIGURE_COMMON_ARG = "--target-os=linux \
+  --cc='${CC}' --as='${CC}' --ld='${CC}' --nm='${NM}' --ar='${AR}' \
+  --ranlib='${RANLIB}' \
+  ${GSTREAMER_1_0_DEBUG} \
+  --cross-prefix='${HOST_PREFIX}'"
+
+S = "${WORKDIR}/gst-libav-${PV}"
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb
new file mode 100644
index 0000000..bf1b87e
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-libav_git.bb
@@ -0,0 +1,29 @@
+DEFAULT_PREFERENCE = "-1"
+
+include gstreamer1.0-libav.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
+                    file://ext/libav/gstav.h;beginline=1;endline=18;md5=a752c35267d8276fd9ca3db6994fca9c \
+                    file://gst-libs/ext/libav/LICENSE;md5=23a54f59b82572c203a559346e89ed57 \
+                    file://gst-libs/ext/libav/COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://gst-libs/ext/libav/COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://gst-libs/ext/libav/COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
+                    file://gst-libs/ext/libav/COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = "git://anongit.freedesktop.org/gstreamer/gst-libav;branch=master"
+S = "${WORKDIR}/git"
+
+SRCREV = "127202d6f65584891dabf92be031f0d170b0e7f1"
+
+LIBAV_EXTRA_CONFIGURE_COMMON_ARG = "--target-os=linux \
+  --cc='${CC}' --as='${CC}' --ld='${CC}' --nm='${NM}' --ar='${AR}' \
+  ${GSTREAMER_1_0_DEBUG} \
+  --cross-prefix='${HOST_PREFIX}'"
+
+do_configure_prepend() {
+	cd ${S}
+	./autogen.sh --noconfigure
+	cd ${B}
+}
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb
new file mode 100644
index 0000000..3ef10c3
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-meta-base.bb
@@ -0,0 +1,65 @@
+DESCRIPTION = "Gstreamer1.0 package groups"
+LICENSE = "MIT"
+
+inherit packagegroup
+
+COMMERCIAL_PLUGINS = "${COMMERCIAL_AUDIO_PLUGINS} ${COMMERCIAL_VIDEO_PLUGINS}"
+DEPENDS_UGLY="${@'gstreamer1.0-plugins-ugly' if 'ugly' in COMMERCIAL_PLUGINS.split('-') else ''}"
+DEPENDS_BAD="${@'gstreamer1.0-plugins-bad' if 'bad' in COMMERCIAL_PLUGINS.split('-') else ''}"
+DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good ${DEPENDS_UGLY} ${DEPENDS_BAD}"
+
+PACKAGES = "\
+    gstreamer1.0-meta-base \
+    gstreamer1.0-meta-x11-base \
+    gstreamer1.0-meta-audio \
+    gstreamer1.0-meta-debug \
+    gstreamer1.0-meta-video"
+
+ALLOW_EMPTY_gstreamer1.0-meta-base = "1"
+ALLOW_EMPTY_gstreamer1.0-meta-x11-base = "1"
+ALLOW_EMPTY_gstreamer1.0-meta-audio = "1"
+ALLOW_EMPTY_gstreamer1.0-meta-debug = "1"
+ALLOW_EMPTY_gstreamer1.0-meta-video = "1"
+
+RDEPENDS_gstreamer1.0-meta-base = "\
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gstreamer1.0-meta-x11-base', '', d)} \
+    gstreamer1.0 \
+    gstreamer1.0-plugins-base-playback \
+    gstreamer1.0-plugins-base-gio \
+    gstreamer1.0-plugins-base-alsa \
+    gstreamer1.0-plugins-base-volume \
+    gstreamer1.0-plugins-base-audioconvert \
+    gstreamer1.0-plugins-base-audioresample \
+    gstreamer1.0-plugins-base-typefindfunctions \
+    gstreamer1.0-plugins-base-videoscale \
+    gstreamer1.0-plugins-base-videoconvert \
+    gstreamer1.0-plugins-good-autodetect \
+    gstreamer1.0-plugins-good-souphttpsrc"
+
+RRECOMMENDS_gstreamer1.0-meta-x11-base = "\
+    gstreamer1.0-plugins-base-ximagesink \
+    gstreamer1.0-plugins-base-xvimagesink"
+
+RDEPENDS_gstreamer1.0-meta-audio = "\
+    gstreamer1.0-meta-base \
+    gstreamer1.0-plugins-base-vorbis \
+    gstreamer1.0-plugins-base-ogg \
+    gstreamer1.0-plugins-good-wavparse \
+    gstreamer1.0-plugins-good-flac \
+    ${COMMERCIAL_AUDIO_PLUGINS}"
+
+RDEPENDS_gstreamer1.0-meta-debug = "\
+    gstreamer1.0-meta-base \
+    gstreamer1.0-plugins-good-debug \
+    gstreamer1.0-plugins-base-audiotestsrc \
+    gstreamer1.0-plugins-base-videotestsrc"
+
+RDEPENDS_gstreamer1.0-meta-video = "\
+    gstreamer1.0-meta-base \
+    gstreamer1.0-plugins-good-avi \
+    gstreamer1.0-plugins-good-matroska \
+    gstreamer1.0-plugins-base-theora \
+    ${COMMERCIAL_VIDEO_PLUGINS}"
+
+RRECOMMENDS_gstreamer1.0-meta-video = "\
+    gstreamer1.0-meta-audio"
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
new file mode 100644
index 0000000..d698904
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx.inc
@@ -0,0 +1,42 @@
+SUMMARY = "OpenMAX IL plugins for GStreamer"
+SECTION = "multimedia"
+LICENSE = "LGPLv2.1"
+LICENSE_FLAGS = "commercial"
+HOMEPAGE = "http://www.gstreamer.net/"
+DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad"
+RDEPENDS_${PN} = "libomxil"
+
+inherit autotools pkgconfig gettext
+
+acpaths = "-I ${S}/common/m4 -I ${S}/m4"
+
+PR = "r1"
+
+GSTREAMER_1_0_OMX_TARGET ?= "bellagio"
+GSTREAMER_1_0_OMX_CORE_NAME ?= "${libdir}/libomxil-bellagio.so.0"
+
+EXTRA_OECONF += "--disable-valgrind --with-omx-target=${GSTREAMER_1_0_OMX_TARGET}"
+
+python __anonymous () {
+    omx_target = d.getVar("GSTREAMER_1_0_OMX_TARGET", True)
+    if omx_target in ['generic', 'bellagio']:
+        srcdir = d.getVar("S", True)
+        # Bellagio headers are incomplete (they are missing the OMX_VERSION_MAJOR,#
+        # OMX_VERSION_MINOR, OMX_VERSION_REVISION, and OMX_VERSION_STEP macros);
+        # appending a directory path to gst-omx' internal OpenMAX IL headers fixes this
+        d.appendVar("CFLAGS", " -I%s/omx/openmax" % srcdir)
+    elif omx_target == "rpi":
+        # Dedicated Raspberry Pi OpenMAX IL support makes this package machine specific
+        d.setVar("PACKAGE_ARCH", d.getVar("MACHINE_ARCH", True))
+}
+
+set_omx_core_name() {
+	sed -i -e "s;^core-name=.*;core-name=${GSTREAMER_1_0_OMX_CORE_NAME};" "${D}${sysconfdir}/xdg/gstomx.conf"
+}
+do_install[postfuncs] += " set_omx_core_name "
+
+FILES_${PN} += "${libdir}/gstreamer-1.0/*.so"
+FILES_${PN}-dbg += "${libdir}/gstreamer-1.0/.debug"
+FILES_${PN}-dev += "${libdir}/gstreamer-1.0/*.la"
+FILES_${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a"
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch
new file mode 100644
index 0000000..a428ac9
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-omx-fixed-type-error-in-printf-call.patch
@@ -0,0 +1,30 @@
+From f629e041e9f678fcd86ad764a15117dff63c271c Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+Date: Sat, 27 Apr 2013 02:50:25 +0200
+Subject: [PATCH] omx: fixed type error in printf call
+
+%zu expects size_t
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=699008]
+
+Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
+---
+ omx/gstomx.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/omx/gstomx.c b/omx/gstomx.c
+index a2945ed..1eca7cc 100644
+--- a/omx/gstomx.c
++++ b/omx/gstomx.c
+@@ -1630,7 +1630,7 @@ gst_omx_port_allocate_buffers_unlocked (GstOMXPort * port,
+ 
+   GST_INFO_OBJECT (comp->parent,
+       "Allocating %d buffers of size %zu for %s port %u", n,
+-      port->port_def.nBufferSize, comp->name, (guint) port->index);
++      (size_t) (port->port_def.nBufferSize), comp->name, (guint) port->index);
+ 
+   if (!port->buffers)
+     port->buffers = g_ptr_array_sized_new (n);
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb
new file mode 100644
index 0000000..fe7c91c
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.2.0.bb
@@ -0,0 +1,12 @@
+include gstreamer1.0-omx.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+                    file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/gst-omx/gst-omx-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "d24e8c0153c35dfefee3e26b1c2c35f8"
+SRC_URI[sha256sum] = "0b4874961e6488ad9e5808114bd486ea981c540907262caab1419355fd82d745"
+
+S = "${WORKDIR}/gst-omx-${PV}"
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb
new file mode 100644
index 0000000..99c8466
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-omx_git.bb
@@ -0,0 +1,26 @@
+DEFAULT_PREFERENCE = "-1"
+
+include gstreamer1.0-omx.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+                    file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f"
+
+SRC_URI = " \
+    git://anongit.freedesktop.org/gstreamer/gst-omx;branch=master;name=gst-omx \
+    git://anongit.freedesktop.org/gstreamer/common;destsuffix=git/common;branch=master;name=common \
+    file://0001-omx-fixed-type-error-in-printf-call.patch \
+    "
+
+S = "${WORKDIR}/git"
+
+SRCREV_gst-omx = "a2db76b048db278ef0aa798e106b7594264e06c0"
+SRCREV_common = "5edcd857b2107cd8b78c16232dd10877513ec157"
+
+SRCREV_FORMAT = "gst-omx"
+
+do_configure_prepend() {
+	cd ${S}
+	./autogen.sh --noconfigure
+	cd ${B}
+}
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
new file mode 100644
index 0000000..cdedb60
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad.inc
@@ -0,0 +1,135 @@
+require gstreamer1.0-plugins.inc
+
+LICENSE = "GPLv2+ & LGPLv2+ & LGPLv2.1+ "
+
+DEPENDS += "gstreamer1.0-plugins-base libpng jpeg"
+
+S = "${WORKDIR}/gst-plugins-bad-${PV}"
+
+SRC_URI += "file://configure-allow-to-disable-libssh2.patch \
+           "
+
+inherit gettext bluetooth
+
+# opengl packageconfig factored out to make it easy for distros
+# and BSP layers to pick either (desktop) opengl, gles2, or no GL
+PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gles2', '', d)}"
+
+PACKAGECONFIG ??= " \
+    ${PACKAGECONFIG_GL} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d)} \
+    orc curl uvch264 neon sndfile \
+    hls sbc dash bz2 smoothstreaming \
+    "
+
+# dash = Dynamic Adaptive Streaming over HTTP
+PACKAGECONFIG[assrender]       = "--enable-assrender,--disable-assrender,libass"
+PACKAGECONFIG[curl]            = "--enable-curl,--disable-curl,curl"
+PACKAGECONFIG[gles2]           = "--enable-gles2,--disable-gles2,virtual/libgles2"
+PACKAGECONFIG[opengl]          = "--enable-opengl,--disable-opengl,virtual/libgl libglu"
+PACKAGECONFIG[faac]            = "--enable-faac,--disable-faac,faac"
+PACKAGECONFIG[faad]            = "--enable-faad,--disable-faad,faad2"
+PACKAGECONFIG[libmms]          = "--enable-libmms,--disable-libmms,libmms"
+PACKAGECONFIG[modplug]         = "--enable-modplug,--disable-modplug,libmodplug"
+PACKAGECONFIG[mpg123]          = "--enable-mpg123,--disable-mpg123,mpg123"
+PACKAGECONFIG[opus]            = "--enable-opus,--disable-opus,libopus"
+PACKAGECONFIG[flite]           = "--enable-flite,--disable-flite,flite-alsa"
+PACKAGECONFIG[opencv]          = "--enable-opencv,--disable-opencv,opencv"
+PACKAGECONFIG[wayland]         = "--enable-wayland --enable-egl,--disable-wayland --disable-egl,wayland virtual/egl"
+PACKAGECONFIG[uvch264]         = "--enable-uvch264,--disable-uvch264,libusb1 udev"
+PACKAGECONFIG[directfb]        = "--enable-directfb,--disable-directfb,directfb"
+PACKAGECONFIG[neon]            = "--enable-neon,--disable-neon,neon"
+PACKAGECONFIG[openal]          = "--enable-openal,--disable-openal,openal-soft"
+PACKAGECONFIG[hls]             = "--enable-hls,--disable-hls,gnutls"
+PACKAGECONFIG[sbc]             = "--enable-sbc,--disable-sbc,sbc"
+PACKAGECONFIG[dash]            = "--enable-dash,--disable-dash,libxml2"
+PACKAGECONFIG[bz2]             = "--enable-bz2,--disable-bz2,bzip2"
+PACKAGECONFIG[fluidsynth]      = "--enable-fluidsynth,--disable-fluidsynth,fluidsynth"
+PACKAGECONFIG[schroedinger]    = "--enable-schro,--disable-schro,schroedinger"
+PACKAGECONFIG[smoothstreaming] = "--enable-smoothstreaming,--disable-smoothstreaming,libxml2"
+PACKAGECONFIG[bluez]           = "--enable-bluez,--disable-bluez,${BLUEZ}"
+PACKAGECONFIG[rsvg]            = "--enable-rsvg,--disable-rsvg,librsvg"
+PACKAGECONFIG[sndfile]         = "--enable-sndfile,--disable-sndfile,libsndfile1"
+PACKAGECONFIG[webp]            = "--enable-webp,--disable-webp,libwebp"
+PACKAGECONFIG[rtmp]            = "--enable-rtmp,--disable-rtmp,rtmpdump"
+PACKAGECONFIG[libssh2]         = "--enable-libssh2,--disable-libssh2,libssh2"
+
+# these plugins have not been ported to 1.0 (yet):
+#   directdraw vcd apexsink dc1394 lv2 linsys musepack mythtv
+#   nas timidity teletextdec sdl xvid wininet acm gsettings
+#   sndio qtwrapper cdxaparse dccp faceoverlay hdvparse tta
+#   mve nuvdemux osx_video patchdetect quicktime real sdi
+#   videomeasure gsettings
+
+# these plugins have no corresponding library in OE-core or meta-openembedded:
+#   openni2 winks direct3d directdraw directsound winscreencap osx_video
+#   apple_media android_media avc chromaprint daala dts gme gsm kate ladspa mimic
+#   mpeg2enc mplex ofa openjpeg opensles pvr resindvd rtmp soundtouch spandsp spc
+#   srtp vdpau voaacenc voamrwbenc wasapi zbar
+
+EXTRA_OECONF += " \
+    --enable-dvb \
+    --enable-shm \
+    --enable-fbdev \
+    --enable-decklink \
+    --disable-acm \
+    --disable-android_media \
+    --disable-apexsink \
+    --disable-apple_media \
+    --disable-avc \
+    --disable-chromaprint \
+    --disable-cocoa \
+    --disable-daala \
+    --disable-dc1394 \
+    --disable-direct3d \
+    --disable-directdraw \
+    --disable-directsound \
+    --disable-dts \
+    --disable-gme \
+    --disable-gsettings \
+    --disable-gsm \
+    --disable-kate \
+    --disable-ladspa \
+    --disable-linsys \
+    --disable-lv2 \
+    --disable-mimic \
+    --disable-mpeg2enc \
+    --disable-mplex \
+    --disable-musepack \
+    --disable-mythtv \
+    --disable-nas \
+    --disable-ofa \
+    --disable-openjpeg \
+    --disable-opensles \
+    --disable-osx_video \
+    --disable-pvr \
+    --disable-quicktime \
+    --disable-resindvd \
+    --disable-sdl \
+    --disable-sdltest \
+    --disable-sndio \
+    --disable-soundtouch \
+    --disable-spandsp \
+    --disable-spc \
+    --disable-srtp \
+    --disable-teletextdec \
+    --disable-timidity \
+    --disable-vcd \
+    --disable-vdpau \
+    --disable-voaacenc \
+    --disable-voamrwbenc \
+    --disable-wasapi \
+    --disable-wildmidi \
+    --disable-wininet \
+    --disable-winscreencap \
+    --disable-xvid \
+    --disable-zbar \
+    ${@bb.utils.contains("TUNE_FEATURES", "mx32", "--disable-yadif", "", d)} \
+    "
+
+ARM_INSTRUCTION_SET = "arm"
+
+FILES_gstreamer1.0-plugins-bad-opencv += "${datadir}/gst-plugins-bad/1.0/opencv*"
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gl-do-not-check-for-GL-GLU-EGL-GLES2-libs-if-disable.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gl-do-not-check-for-GL-GLU-EGL-GLES2-libs-if-disable.patch
new file mode 100644
index 0000000..042a32c
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-gl-do-not-check-for-GL-GLU-EGL-GLES2-libs-if-disable.patch
@@ -0,0 +1,41 @@
+From deba0da45ec821209a7ed148a4521d562e6512cd Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+Date: Wed, 27 Aug 2014 14:47:25 +0200
+Subject: [PATCH] gl: do not check for GL/GLU/EGL/GLES2 libs if disabled in
+ configuration
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=735522]
+
+Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
+---
+ configure.ac | 14 ++++++++++----
+ 1 file changed, 10 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1a46afb..e85d4ba 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -661,10 +661,16 @@ case $host in
+     fi
+   ;;
+   *)
+-    AG_GST_CHECK_LIBHEADER(GL, GL, glTexImage2D,, GL/gl.h)
+-    AG_GST_CHECK_LIBHEADER(GLU, GLU, gluSphere,, GL/glu.h)
+-    AG_GST_CHECK_LIBHEADER(GLES2, GLESv2, glTexImage2D,, GLES2/gl2.h)
+-    AG_GST_CHECK_LIBHEADER(EGL, EGL, eglGetError,, EGL/egl.h)
++    if test "x$NEED_GL" != "xno"; then
++      AG_GST_CHECK_LIBHEADER(GL, GL, glTexImage2D,, GL/gl.h)
++      AG_GST_CHECK_LIBHEADER(GLU, GLU, gluSphere,, GL/glu.h)
++    fi
++    if test "x$NEED_GLES2" != "xno"; then
++      AG_GST_CHECK_LIBHEADER(GLES2, GLESv2, glTexImage2D,, GLES2/gl2.h)
++    fi
++    if test "x$NEED_EGL" != "xno"; then
++      AG_GST_CHECK_LIBHEADER(EGL, EGL, eglGetError,, EGL/egl.h)
++    fi
+ 
+     old_LIBS=$LIBS
+     old_CFLAGS=$CFLAGS
+-- 
+1.8.3.2
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch
new file mode 100644
index 0000000..d52afd5
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/configure-allow-to-disable-libssh2.patch
@@ -0,0 +1,64 @@
+From f59c5269f92d59a5296cbfeeb682d42095cd88ad Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Thu, 18 Sep 2014 02:24:07 -0400
+Subject: [PATCH] gstreamer1.0-plugins-bad: allow to disable libssh2
+
+libssh2 is automatically linked to if present, this undetermined
+dependency may cause build errors like:
+
+  .../x86_64-poky-linux/4.9.0/ld: cannot find -lssh2
+
+libssh2 isn't an oe-core recipe, so allow to disable it from
+configure.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ configure.ac |   23 +++++++++++++++++------
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0e95c5c..12153b4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1901,6 +1901,15 @@ AG_GST_CHECK_FEATURE(CHROMAPRINT, [chromaprint], chromaprint, [
+ ])
+ 
+ dnl *** Curl ***
++AC_ARG_ENABLE([libssh2],
++     [  --enable-libssh2		enable LIBSSH2 support @<:@default=auto@:>@],
++     [case "${enableval}" in
++       yes)  NEED_SSH2=yes ;;
++       no)   NEED_SSH2=no ;;
++       auto) NEED_SSH2=auto ;;
++       *) AC_MSG_ERROR([bad value ${enableval} for --enable-libssh2]) ;;
++     esac],[NEED_SSH2=auto])
++
+ translit(dnm, m, l) AM_CONDITIONAL(USE_CURL, true)
+ AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [
+   PKG_CHECK_MODULES(CURL, libcurl >= 7.21.0, [
+@@ -1915,12 +1924,14 @@ AG_GST_CHECK_FEATURE(CURL, [Curl plugin], curl, [
+   ])
+   AC_SUBST(CURL_CFLAGS)
+   AC_SUBST(CURL_LIBS)
+-  PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
+-    HAVE_SSH2="yes"
+-    AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
+-  ], [
+-    HAVE_SSH2="no"
+-  ])
++  if test "x$NEED_SSH2" != "xno"; then
++    PKG_CHECK_MODULES(SSH2, libssh2 >= 1.4.3, [
++      HAVE_SSH2="yes"
++      AC_DEFINE(HAVE_SSH2, 1, [Define if libssh2 is available])
++    ], [
++      HAVE_SSH2="no"
++    ])
++  fi
+   AM_CONDITIONAL(USE_SSH2, test "x$HAVE_SSH2" = "xyes")
+   AC_SUBST(SSH2_CFLAGS)
+   AC_SUBST(SSH2_LIBS)
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.4.5.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.4.5.bb
new file mode 100644
index 0000000..59065de
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.4.5.bb
@@ -0,0 +1,14 @@
+include gstreamer1.0-plugins-bad.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
+                    file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a \
+                    file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
+                    file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50"
+
+SRC_URI += "file://0001-gl-do-not-check-for-GL-GLU-EGL-GLES2-libs-if-disable.patch"
+
+SRC_URI[md5sum] = "e0bb39412cf4a48fe0397bcf3a7cd451"
+SRC_URI[sha256sum] = "152fad7250683d72f9deb36c5685428338365fe4a4c87ffe15e38783b14f983c"
+
+S = "${WORKDIR}/gst-plugins-bad-${PV}"
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb
new file mode 100644
index 0000000..309505f
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_git.bb
@@ -0,0 +1,26 @@
+DEFAULT_PREFERENCE = "-1"
+
+include gstreamer1.0-plugins-bad.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=73a5855a8119deb017f5f13cf327095d \
+                    file://gst/tta/filters.h;beginline=12;endline=29;md5=8a08270656f2f8ad7bb3655b83138e5a \
+                    file://COPYING.LIB;md5=21682e4e8fea52413fd26c60acb907e5 \
+                    file://gst/tta/crc32.h;beginline=12;endline=29;md5=27db269c575d1e5317fffca2d33b3b50"
+
+S = "${WORKDIR}/git"
+
+SRCREV = "6e5db57d2446a753aaa76bee268e1f95600b14ce"
+
+PACKAGECONFIG[sbc] = "--enable-sbc,--disable-sbc,sbc"
+PACKAGECONFIG[hls] = "--enable-hls,--disable-hls,gnutls"
+
+EXTRA_OECONF += " \
+    -disable-openjpeg \
+    "
+
+do_configure_prepend() {
+	cd ${S}
+	./autogen.sh --noconfigure
+	cd ${B}
+}
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc
new file mode 100644
index 0000000..47f3f40
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base.inc
@@ -0,0 +1,39 @@
+require gstreamer1.0-plugins.inc
+
+LICENSE = "GPLv2+ & LGPLv2+"
+
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxv', '', d)}"
+DEPENDS += "freetype liboil util-linux"
+
+inherit gettext
+
+PACKAGES_DYNAMIC =+ "^libgst.*"
+
+PACKAGECONFIG ??= " \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
+    orc ivorbis ogg theora vorbis pango \
+    "
+
+X11DEPENDS = "virtual/libx11 libsm libxrender"
+X11ENABLEOPTS = "--enable-x --enable-xvideo --enable-xshm"
+X11DISABLEOPTS = "--disable-x --disable-xvideo --disable-xshm"
+PACKAGECONFIG[x11]     = "${X11ENABLEOPTS},${X11DISABLEOPTS},${X11DEPENDS}"
+PACKAGECONFIG[alsa]    = "--enable-alsa,--disable-alsa,alsa-lib"
+PACKAGECONFIG[ivorbis] = "--enable-ivorbis,--disable-ivorbis,tremor"
+PACKAGECONFIG[ogg]     = "--enable-ogg,--disable-ogg,libogg"
+PACKAGECONFIG[theora]  = "--enable-theora,--disable-theora,libtheora"
+PACKAGECONFIG[vorbis]  = "--enable-vorbis,--disable-vorbis,libvorbis"
+PACKAGECONFIG[pango]   = "--enable-pango,--disable-pango,pango"
+
+
+# cdparanoia and libvisual do not seem to exist anywhere in OE
+EXTRA_OECONF += " \
+    --disable-freetypetest \
+    --disable-cdparanoia \
+    --disable-libvisual \
+"
+
+FILES_${MLPREFIX}libgsttag-1.0 += "${datadir}/gst-plugins-base/1.0/license-translations.dict"
+
+CACHED_CONFIGUREVARS_append_x86 = " ac_cv_header_emmintrin_h=no ac_cv_header_xmmintrin_h=no"
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
new file mode 100644
index 0000000..03dca95
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
@@ -0,0 +1,129 @@
+From 3781d40940d46d7e6a502092d24aac7997f6da5b Mon Sep 17 00:00:00 2001
+From: Mingke Wang <mingke.wang@freescale.com>
+Date: Thu, 5 Mar 2015 12:06:23 +0800
+Subject: [PATCH 1/4] basetextoverlay: make memory copy when video buffer's
+ memory is ready only
+
+1. since gst_buffer_make_writable just lookup the refcount to determine if
+   a buffer is writable, and it will use _gst_buffer_copy() which don't
+   perform a deep memory copy even if the flag of a memory is set to
+   GST_MEMORY_FLAG_READONLY. So, we detect the memory flag and use
+   gst_buffer_copy_region with GST_BUFFER_COPY_DEEP parameter to perform
+   deep memory copy. if the allocator of a memory don't support mem_copy
+   interface, the it will return NULL, if this case, we can use
+   gst_buffer_make_writable() to get a shared memory buffer or the orignal
+   buffer if the buffer's refcount is 1.
+2.  new feature is no added if caps has no feature during caps negotiation
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747495]
+
+Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
+
+diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c
+index c919861..3c0a1d7 100755
+--- a/ext/pango/gstbasetextoverlay.c
++++ b/ext/pango/gstbasetextoverlay.c
+@@ -747,6 +747,7 @@ gst_base_text_overlay_negotiate (GstBaseTextOverlay * overlay, GstCaps * caps)
+     if (f == NULL) {
+       f = gst_caps_features_new
+           (GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION, NULL);
++      gst_caps_set_features(overlay_caps, 0, f);
+     } else {
+       gst_caps_features_add (f,
+           GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION);
+@@ -1890,16 +1891,71 @@ gst_base_text_overlay_push_frame (GstBaseTextOverlay * overlay,
+   if (gst_pad_check_reconfigure (overlay->srcpad))
+     gst_base_text_overlay_negotiate (overlay, NULL);
+ 
+-  video_frame = gst_buffer_make_writable (video_frame);
+-
+   if (overlay->attach_compo_to_buffer) {
+     GST_DEBUG_OBJECT (overlay, "Attaching text overlay image to video buffer");
++    video_frame = gst_buffer_make_writable (video_frame);
+     gst_buffer_add_video_overlay_composition_meta (video_frame,
+         overlay->composition);
+     /* FIXME: emulate shaded background box if want_shading=true */
+     goto done;
+   }
+ 
++  gint m = gst_buffer_n_memory(video_frame);
++  gboolean mem_rdonly = FALSE;
++  GstMemory *mem;
++  GstBuffer *orig = video_frame;
++
++  while (--m>=0) {
++    mem = gst_buffer_get_memory(video_frame, m);
++    if (GST_MEMORY_IS_READONLY(mem)) {
++      mem_rdonly = TRUE;
++      gst_memory_unref (mem);
++      break;
++    }
++    gst_memory_unref (mem);
++  }
++
++  if (mem_rdonly) {
++    // since gst_buffer_make_writable just lookup the refcount to determine if
++    // a buffer is writable, and it will use _gst_buffer_copy() which don't
++    // perform a deep memory copy even if the flag of a memory is set to
++    // GST_MEMORY_FLAG_READONLY. So, we detect the memory flag and use
++    // gst_buffer_copy_region with GST_BUFFER_COPY_DEEP parameter to perform
++    // deep memory copy. if the allocator of a memory don't support mem_copy
++    // interface, the it will return NULL, if this case, we can use
++    // gst_buffer_make_writable() to get a shared memory buffer or the orignal
++    // buffer if the buffer's refcount is 1.
++    GstBuffer *new_buf = gst_buffer_copy_region (video_frame,
++        GST_BUFFER_COPY_ALL | GST_BUFFER_COPY_DEEP, 0, -1);
++
++    GST_DEBUG_OBJECT (overlay, "copy %s video frame buffer %p -> %p",
++        g_type_name (GST_MINI_OBJECT_TYPE (video_frame)), video_frame, new_buf);
++
++    if (!new_buf) {
++      //maybe the allocator don't support mem_copy interface, the we just use
++      //gst_buffer_make_writable() to get a writable buffer.
++      video_frame = gst_buffer_make_writable (video_frame);
++    } else {
++      gst_mini_object_unref (video_frame);
++      GST_BUFFER_FLAG_UNSET (new_buf, GST_BUFFER_FLAG_TAG_MEMORY);
++      video_frame = new_buf;
++    }
++
++    if (!video_frame) {
++      GST_WARNING_OBJECT (overlay, "make writable buffer failed");
++      return GST_FLOW_OK;
++    }
++
++    m = gst_buffer_n_memory(video_frame);
++    while (--m>=0) {
++      mem = gst_buffer_get_memory(video_frame, m);
++      GST_MEMORY_FLAG_UNSET (mem, GST_MEMORY_FLAG_READONLY);
++      gst_memory_unref (mem);
++    }
++  } else {
++    video_frame = gst_buffer_make_writable (video_frame);
++  }
++
+   if (!gst_video_frame_map (&frame, &overlay->info, video_frame,
+           GST_MAP_READWRITE))
+     goto invalid_frame;
+@@ -1918,6 +1974,18 @@ gst_base_text_overlay_push_frame (GstBaseTextOverlay * overlay,
+ 
+   gst_video_frame_unmap (&frame);
+ 
++  if (mem_rdonly && orig == video_frame) {
++    //if we used the original buffer and it's mem is set to read only,
++    //recover the memory ready only flag since we unset it before
++    // gst_video_frame_map ()
++    m = gst_buffer_n_memory(video_frame);
++    while (--m>=0) {
++      mem = gst_buffer_get_memory(video_frame, m);
++      GST_MEMORY_FLAGS(mem) |= (GST_MEMORY_FLAG_READONLY);
++      gst_memory_unref (mem);
++    }
++  }
++
+ done:
+ 
+   return gst_pad_push (overlay->srcpad, video_frame);
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch
new file mode 100644
index 0000000..3db4724
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch
@@ -0,0 +1,26 @@
+From 269f642c45d85cfd630ed490478e6bd6b71a767f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
+Date: Tue, 16 Sep 2014 01:07:18 +0300
+Subject: [PATCH] video-frame: Don't ref buffers twice when mapping
+
+Upstream-Status: Backport [1.5.1]
+---
+ gst-libs/gst/video/video-frame.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c
+index 01f23c0..8a9ae96 100644
+--- a/gst-libs/gst/video/video-frame.c
++++ b/gst-libs/gst/video/video-frame.c
+@@ -105,7 +105,7 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
+       frame->data[i] = frame->map[0].data + info->offset[i];
+     }
+   }
+-  frame->buffer = gst_buffer_ref (buffer);
++  frame->buffer = buffer;
+   if ((flags & GST_VIDEO_FRAME_MAP_FLAG_NO_REF) == 0)
+     gst_buffer_ref (frame->buffer);
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch
new file mode 100644
index 0000000..39c146a
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch
@@ -0,0 +1,31 @@
+From 0a78555ea6c8c2f1ee27ee4707e8d7aa00ab7a66 Mon Sep 17 00:00:00 2001
+From: Mingke Wang <mingke.wang@freescale.com>
+Date: Thu, 19 Mar 2015 14:15:25 +0800
+Subject: [PATCH 2/4] gstplaysink: don't set async of custom text-sink to
+ false
+
+set async to false lead to A/V sync problem when seeking.
+the preroll need use GAP event instead of set async to false.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747499]
+
+Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
+
+diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
+old mode 100644
+new mode 100755
+index f5a2d42..fba0172
+--- a/gst/playback/gstplaysink.c
++++ b/gst/playback/gstplaysink.c
+@@ -2408,7 +2408,7 @@ gen_text_chain (GstPlaySink * playsink)
+           G_TYPE_BOOLEAN);
+       if (elem) {
+         /* make sure the sparse subtitles don't participate in the preroll */
+-        g_object_set (elem, "async", FALSE, NULL);
++        //g_object_set (elem, "async", FALSE, NULL);
+         GST_DEBUG_OBJECT (playsink, "adding custom text sink");
+         gst_bin_add (bin, chain->sink);
+         /* NOTE streamsynchronizer needs streams decoupled */
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch
new file mode 100644
index 0000000..c465b5c
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch
@@ -0,0 +1,87 @@
+From 40a293d44d1aeccf5eb8e86f23a0b13666111c5c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
+Date: Fri, 12 Sep 2014 14:39:16 +0300
+Subject: [PATCH 2/3] video-frame: Add GST_VIDEO_FRAME_MAP_FLAG_NO_REF
+
+This makes sure that the buffer is not reffed another time when
+storing it in the GstVideoFrame, keeping it writable if it was
+writable.
+
+Upstream-Status: Backport [1.5.1]
+https://bugzilla.gnome.org/show_bug.cgi?id=736118
+---
+ gst-libs/gst/video/video-frame.c |    9 ++++++++-
+ gst-libs/gst/video/video-frame.h |   18 ++++++++++++++++++
+ 2 files changed, 26 insertions(+), 1 deletion(-)
+
+diff --git a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c
+index 537cf70..01f23c0 100644
+--- a/gst-libs/gst/video/video-frame.c
++++ b/gst-libs/gst/video/video-frame.c
+@@ -106,6 +106,9 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
+     }
+   }
+   frame->buffer = gst_buffer_ref (buffer);
++  if ((flags & GST_VIDEO_FRAME_MAP_FLAG_NO_REF) == 0)
++    gst_buffer_ref (frame->buffer);
++
+   frame->meta = meta;
+ 
+   /* buffer flags enhance the frame flags */
+@@ -189,11 +192,13 @@ gst_video_frame_unmap (GstVideoFrame * frame)
+   GstBuffer *buffer;
+   GstVideoMeta *meta;
+   gint i;
++  GstMapFlags flags;
+ 
+   g_return_if_fail (frame != NULL);
+ 
+   buffer = frame->buffer;
+   meta = frame->meta;
++  flags = frame->map[0].flags;
+ 
+   if (meta) {
+     for (i = 0; i < frame->info.finfo->n_planes; i++) {
+@@ -202,7 +207,9 @@ gst_video_frame_unmap (GstVideoFrame * frame)
+   } else {
+     gst_buffer_unmap (buffer, &frame->map[0]);
+   }
+-  gst_buffer_unref (buffer);
++
++  if ((flags & GST_VIDEO_FRAME_MAP_FLAG_NO_REF) == 0)
++    gst_buffer_unref (frame->buffer);
+ }
+ 
+ /**
+diff --git a/gst-libs/gst/video/video-frame.h b/gst-libs/gst/video/video-frame.h
+index 627fab0..f8e6304 100644
+--- a/gst-libs/gst/video/video-frame.h
++++ b/gst-libs/gst/video/video-frame.h
+@@ -149,6 +149,24 @@ typedef enum {
+   GST_VIDEO_BUFFER_FLAG_LAST        = (GST_BUFFER_FLAG_LAST << 8)
+ } GstVideoBufferFlags;
+ 
++/**
++ * GstVideoBufferFlags:
++ * @GST_VIDEO_FRAME_MAP_FLAG_NO_REF:  Don't take another reference of the buffer and store it in
++ *                                    the GstVideoFrame. This makes sure that the buffer stays
++ *                                    writable while the frame is mapped, but requires that the
++ *                                    buffer reference stays valid until the frame is unmapped again.
++ * @GST_VIDEO_FRAME_MAP_FLAG_LAST:    Offset to define more flags
++ *
++ * Additional mapping flags for gst_video_frame_map().
++ *
++ * Since: 1.6
++ */
++typedef enum {
++  GST_VIDEO_FRAME_MAP_FLAG_NO_REF   = (GST_MAP_FLAG_LAST << 0),
++  GST_VIDEO_FRAME_MAP_FLAG_LAST     = (GST_MAP_FLAG_LAST << 8)
++  /* 8 more flags possible afterwards */
++} GstVideoFrameMapFlags;
++
+ G_END_DECLS
+ 
+ #endif /* __GST_VIDEO_FRAME_H__ */
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch
new file mode 100644
index 0000000..9fbebd5
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-ssaparse-enhance-SSA-text-lines-parsing.patch
@@ -0,0 +1,225 @@
+From be6163cfa3a255493f9d75bad9541cbfe1723fee Mon Sep 17 00:00:00 2001
+From: Mingke Wang <mingke.wang@freescale.com>
+Date: Thu, 19 Mar 2015 14:17:10 +0800
+Subject: [PATCH 3/4] ssaparse: enhance SSA text lines parsing.
+
+some parser will pass in the original ssa text line which starts with "Dialog:"
+and there's are maybe multiple Dialog lines in one input buffer.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747496]
+
+Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
+
+diff --git a/gst/subparse/gstssaparse.c b/gst/subparse/gstssaparse.c
+old mode 100644
+new mode 100755
+index 06ecef9..0ab5dce
+--- a/gst/subparse/gstssaparse.c
++++ b/gst/subparse/gstssaparse.c
+@@ -260,6 +260,7 @@ gst_ssa_parse_remove_override_codes (GstSsaParse * parse, gchar * txt)
+  * gst_ssa_parse_push_line:
+  * @parse: caller element
+  * @txt: text to push
++ * @size: text size need to be parse
+  * @start: timestamp for the buffer
+  * @duration: duration for the buffer
+  *
+@@ -269,27 +270,133 @@ gst_ssa_parse_remove_override_codes (GstSsaParse * parse, gchar * txt)
+  * Returns: result of the push of the created buffer
+  */
+ static GstFlowReturn
+-gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt,
++gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt, gint size,
+     GstClockTime start, GstClockTime duration)
+ {
+   GstFlowReturn ret;
+   GstBuffer *buf;
+-  gchar *t, *escaped;
++  gchar *t, *text, *p, *escaped, *p_start, *p_end;
+   gint num, i, len;
++  GstClockTime start_time = G_MAXUINT64, end_time = 0;
+ 
+-  num = atoi (txt);
+-  GST_LOG_OBJECT (parse, "Parsing line #%d at %" GST_TIME_FORMAT,
+-      num, GST_TIME_ARGS (start));
+-
+-  /* skip all non-text fields before the actual text */
++  p = text = g_malloc(size + 1);
++  *p = '\0';
+   t = txt;
+-  for (i = 0; i < 8; ++i) {
+-    t = strchr (t, ',');
++
++  /* there are may have multiple dialogue lines at a time */
++  while (*t) {
++    /* ignore leading white space characters */
++    while (isspace(*t))
++      t++;
++
++    /* ignore Format: and Style: lines */
++    if (strncmp(t, "Format:", 7) == 0 || strncmp(t, "Style:", 6) == 0) {
++      while (*t != '\0' && *t != '\n') {
++        t++;
++      }
++    }
++
++    if (*t == '\0')
++      break;
++
++    /* continue with next line */
++    if (*t == '\n') {
++      t++;
++      continue;
++    }
++
++    if(strncmp(t, "Dialogue:", 9) != 0) {
++      /* not started with "Dialogue:", it must be a line trimmed by demuxer */
++      num = atoi (t);
++      GST_LOG_OBJECT (parse, "Parsing line #%d at %" GST_TIME_FORMAT,
++          num, GST_TIME_ARGS (start));
++
++      /* skip all non-text fields before the actual text */
++      for (i = 0; i < 8; ++i) {
++        t = strchr (t, ',');
++        if (t == NULL)
++          break;
++        ++t;
++      }
++    } else {
++      /* started with "Dialogue:", update timestamp and duration */
++      /* time format are like Dialog:Mark,0:00:01.02,0:00:03.04,xx,xxx,... */
++      guint hour, min, sec, msec, len;
++      GstClockTime tmp;
++      gchar t_str[12] = {0};
++
++      /* find the first ',' */
++      p_start = strchr (t, ',');
++      if (p_start)
++        p_end = strchr (++p_start, ',');
++
++      if (p_start && p_end) {
++        /* copy text between first ',' and second ',' */
++        strncpy(t_str, p_start, p_end - p_start);
++        if (sscanf (t_str, "%u:%u:%u.%u", &hour, &min, &sec, &msec) == 4) {
++          tmp = ((hour*3600) + (min*60) + sec) * GST_SECOND + msec*GST_MSECOND;
++          GST_DEBUG_OBJECT (parse, "Get start time:%02d:%02d:%02d:%03d\n",
++              hour, min, sec, msec);
++          if (start_time > tmp)
++            start_time = tmp;
++        } else {
++          GST_WARNING_OBJECT (parse,
++              "failed to parse ssa start timestamp string :%s", t_str);
++        }
++
++        p_start = p_end;
++        p_end = strchr (++p_start, ',');
++        if (p_end) {
++          /* copy text between second ',' and third ',' */
++          strncpy(t_str, p_start, p_end - p_start);
++          if (sscanf (t_str, "%u:%u:%u.%u", &hour, &min, &sec, &msec) == 4) {
++            tmp = ((hour*3600) + (min*60) + sec)*GST_SECOND + msec*GST_MSECOND;
++            GST_DEBUG_OBJECT(parse, "Get end time:%02d:%02d:%02d:%03d\n",
++                hour, min, sec, msec);
++            if (end_time < tmp)
++              end_time = tmp;
++          } else {
++            GST_WARNING_OBJECT (parse,
++                "failed to parse ssa end timestamp string :%s", t_str);
++          }
++        }
++      }
++
++      /* now skip all non-text fields before the actual text */
++      for (i = 0; i <= 8; ++i) {
++        t = strchr (t, ',');
++        if (t == NULL)
++          break;
++        ++t;
++      }
++    }
++
++    /* line end before expected number of ',', not a Dialogue line */
+     if (t == NULL)
+-      return GST_FLOW_ERROR;
+-    ++t;
++      break;
++
++    /* if not the first line, and the last character of previous line is '\0',
++     * then replace it with '\N' */
++    if (p != text && *p == '\0') {
++      *p++ = '\\';
++      *p++ = 'N';
++    }
++
++    /* copy all actual text of this line */
++    while ((*t != '\0') && (*t != '\n'))
++      *p++ = *t++;
++
++    /* add a terminator at the end */
++    *p = '\0';
++  }
++
++  /* not valid text found in this buffer return OK to let caller unref buffer */
++  if (strlen(text) <= 0) {
++    GST_WARNING_OBJECT (parse, "Not valid text found in this buffer\n");
++    return GST_FLOW_ERROR;
+   }
+ 
++  t = text;
+   GST_LOG_OBJECT (parse, "Text : %s", t);
+ 
+   if (gst_ssa_parse_remove_override_codes (parse, t)) {
+@@ -307,13 +414,22 @@ gst_ssa_parse_push_line (GstSsaParse * parse, gchar * txt,
+   gst_buffer_fill (buf, 0, escaped, len + 1);
+   gst_buffer_set_size (buf, len);
+   g_free (escaped);
++  g_free(t);
++
++  if (start_time != G_MAXUINT64)
++    GST_BUFFER_TIMESTAMP (buf) = start_time;
++  else
++    GST_BUFFER_TIMESTAMP (buf) = start;
+ 
+-  GST_BUFFER_TIMESTAMP (buf) = start;
+-  GST_BUFFER_DURATION (buf) = duration;
++  if (end_time > start_time)
++    GST_BUFFER_DURATION (buf) = end_time - start_time;
++  else
++    GST_BUFFER_DURATION (buf) = duration;
+ 
+   GST_LOG_OBJECT (parse, "Pushing buffer with timestamp %" GST_TIME_FORMAT
+-      " and duration %" GST_TIME_FORMAT, GST_TIME_ARGS (start),
+-      GST_TIME_ARGS (duration));
++      " and duration %" GST_TIME_FORMAT,
++      GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
++      GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
+ 
+   ret = gst_pad_push (parse->srcpad, buf);
+ 
+@@ -333,6 +449,7 @@ gst_ssa_parse_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buf)
+   GstClockTime ts;
+   gchar *txt;
+   GstMapInfo map;
++  gint size;
+ 
+   if (G_UNLIKELY (!parse->framed))
+     goto not_framed;
+@@ -350,13 +467,14 @@ gst_ssa_parse_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * buf)
+   /* make double-sure it's 0-terminated and all */
+   gst_buffer_map (buf, &map, GST_MAP_READ);
+   txt = g_strndup ((gchar *) map.data, map.size);
++  size = map.size;
+   gst_buffer_unmap (buf, &map);
+ 
+   if (txt == NULL)
+     goto empty_text;
+ 
+   ts = GST_BUFFER_TIMESTAMP (buf);
+-  ret = gst_ssa_parse_push_line (parse, txt, ts, GST_BUFFER_DURATION (buf));
++  ret = gst_ssa_parse_push_line (parse, txt, size, ts, GST_BUFFER_DURATION (buf));
+ 
+   if (ret != GST_FLOW_OK && GST_CLOCK_TIME_IS_VALID (ts)) {
+     GstSegment segment;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch
new file mode 100644
index 0000000..132bf06
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch
@@ -0,0 +1,69 @@
+From 3a7cdcdfc9c5b0d20394fe51b3b8cda23931ca6d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
+Date: Fri, 12 Sep 2014 14:41:01 +0300
+Subject: [PATCH 3/3] videofilter: Use new GST_VIDEO_FRAME_MAP_FLAG_NO_REF
+
+Upstream-Status: Backport [1.5.1]
+https://bugzilla.gnome.org/show_bug.cgi?id=736118
+---
+ gst-libs/gst/video/gstvideofilter.c |   23 ++++-------------------
+ 1 file changed, 4 insertions(+), 19 deletions(-)
+
+diff --git a/gst-libs/gst/video/gstvideofilter.c b/gst-libs/gst/video/gstvideofilter.c
+index e1fa2c1..874b2e8 100644
+--- a/gst-libs/gst/video/gstvideofilter.c
++++ b/gst-libs/gst/video/gstvideofilter.c
+@@ -260,23 +260,15 @@ gst_video_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
+   if (fclass->transform_frame) {
+     GstVideoFrame in_frame, out_frame;
+ 
+-    if (!gst_video_frame_map (&in_frame, &filter->in_info, inbuf, GST_MAP_READ))
++    if (!gst_video_frame_map (&in_frame, &filter->in_info, inbuf,
++            GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
+       goto invalid_buffer;
+ 
+     if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf,
+-            GST_MAP_WRITE))
++            GST_MAP_WRITE | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
+       goto invalid_buffer;
+ 
+-    /* GstVideoFrame has another reference, so the buffer looks unwriteable,
+-     * meaning that we can't attach any metas or anything to it. Other
+-     * map() functions like gst_buffer_map() don't get another reference
+-     * of the buffer and expect the buffer reference to be kept until
+-     * the buffer is unmapped again. */
+-    gst_buffer_unref (inbuf);
+-    gst_buffer_unref (outbuf);
+     res = fclass->transform_frame (filter, &in_frame, &out_frame);
+-    gst_buffer_ref (inbuf);
+-    gst_buffer_ref (outbuf);
+ 
+     gst_video_frame_unmap (&out_frame);
+     gst_video_frame_unmap (&in_frame);
+@@ -317,7 +309,7 @@ gst_video_filter_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
+     GstVideoFrame frame;
+     GstMapFlags flags;
+ 
+-    flags = GST_MAP_READ;
++    flags = GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF;
+ 
+     if (!gst_base_transform_is_passthrough (trans))
+       flags |= GST_MAP_WRITE;
+@@ -325,14 +317,7 @@ gst_video_filter_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
+     if (!gst_video_frame_map (&frame, &filter->in_info, buf, flags))
+       goto invalid_buffer;
+ 
+-    /* GstVideoFrame has another reference, so the buffer looks unwriteable,
+-     * meaning that we can't attach any metas or anything to it. Other
+-     * map() functions like gst_buffer_map() don't get another reference
+-     * of the buffer and expect the buffer reference to be kept until
+-     * the buffer is unmapped again. */
+-    gst_buffer_unref (buf);
+     res = fclass->transform_frame_ip (filter, &frame);
+-    gst_buffer_ref (buf);
+ 
+     gst_video_frame_unmap (&frame);
+   } else {
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch
new file mode 100644
index 0000000..7813915
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0004-subparse-set-need_segment-after-sink-pad-received-GS.patch
@@ -0,0 +1,69 @@
+From ed09c8fd2c9c2b5384b72cc70af3728be6694e64 Mon Sep 17 00:00:00 2001
+From: Mingke Wang <mingke.wang@freescale.com>
+Date: Thu, 19 Mar 2015 14:20:26 +0800
+Subject: [PATCH 4/4] subparse: set need_segment after sink pad received
+ GST_EVENT_SEGMENT
+
+subparse works in push mode, chain funciton will be called once
+up stream element finished the seeking and flushing.
+if set need_segment flag in src pad event handler, the segment
+event will be pushed earlier, result in the subtitle text will
+be send out to down stream from the beginning.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=747498]
+
+Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
+
+diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c
+old mode 100644
+new mode 100755
+index b565e93..7741ccc
+--- a/gst/subparse/gstsubparse.c
++++ b/gst/subparse/gstsubparse.c
+@@ -266,22 +266,20 @@ gst_sub_parse_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
+         goto beach;
+       }
+ 
++      /* Apply the seek to our segment */
++      gst_segment_do_seek (&self->segment, rate, format, flags,
++          start_type, start, stop_type, stop, &update);
++
++      GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT,
++          &self->segment);
++
+       /* Convert that seek to a seeking in bytes at position 0,
+          FIXME: could use an index */
+       ret = gst_pad_push_event (self->sinkpad,
+           gst_event_new_seek (rate, GST_FORMAT_BYTES, flags,
+               GST_SEEK_TYPE_SET, 0, GST_SEEK_TYPE_NONE, 0));
+ 
+-      if (ret) {
+-        /* Apply the seek to our segment */
+-        gst_segment_do_seek (&self->segment, rate, format, flags,
+-            start_type, start, stop_type, stop, &update);
+-
+-        GST_DEBUG_OBJECT (self, "segment after seek: %" GST_SEGMENT_FORMAT,
+-            &self->segment);
+-
+-        self->need_segment = TRUE;
+-      } else {
++      if (!ret) {
+         GST_WARNING_OBJECT (self, "seek to 0 bytes failed");
+       }
+ 
+@@ -1632,8 +1630,10 @@ gst_sub_parse_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
+       gst_event_parse_segment (event, &s);
+       if (s->format == GST_FORMAT_TIME)
+         gst_event_copy_segment (event, &self->segment);
+-      GST_DEBUG_OBJECT (self, "newsegment (%s)",
+-          gst_format_get_name (self->segment.format));
++      GST_DEBUG_OBJECT (self, "newsegment (%s) %" GST_SEGMENT_FORMAT,
++          gst_format_get_name (self->segment.format), &self->segment);
++
++      self->need_segment = TRUE;
+ 
+       /* if not time format, we'll either start with a 0 timestamp anyway or
+        * it's following a seek in which case we'll have saved the requested
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/do-not-change-eos-event-to-gap-event-if.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/do-not-change-eos-event-to-gap-event-if.patch
new file mode 100644
index 0000000..aa55de1
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/do-not-change-eos-event-to-gap-event-if.patch
@@ -0,0 +1,37 @@
+From b608d027fff6efc2d1988ebf169cbe3b2b44a61b Mon Sep 17 00:00:00 2001
+From: zhouming <b42586@freescale.com>
+Date: Thu, 8 May 2014 12:01:17 +0800
+Subject: [PATCH] ENGR00312034: do not change eos event to gap event if no
+ data has passed to streamsynchronizer.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=727074
+
+Upstream-Status: Pending
+
+Signed-off-by: zhouming <b42586@freescale.com>
+---
+ gst/playback/gststreamsynchronizer.c |    5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c
+index 3997d1b..3e17c55 100644
+--- a/gst/playback/gststreamsynchronizer.c
++++ b/gst/playback/gststreamsynchronizer.c
+@@ -488,12 +488,11 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
+         }
+         g_slist_free (pads);
+       } else {
+-        /* if EOS, but no data has passed, then send something to replace EOS
+-         * for preroll purposes */
++        /* if EOS, but no data has passed, then send EOS event */
+         if (!seen_data) {
+           GstEvent *gap_event;
+ 
+-          gap_event = gst_event_new_gap (timestamp, GST_CLOCK_TIME_NONE);
++          gap_event = gst_event_new_eos ();
+           ret = gst_pad_push_event (srcpad, gap_event);
+         } else {
+           GstEvent *gap_event;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/do-not-change-eos-event-to-gap-event2.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/do-not-change-eos-event-to-gap-event2.patch
new file mode 100755
index 0000000..f24bc7c
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/do-not-change-eos-event-to-gap-event2.patch
@@ -0,0 +1,49 @@
+commit f9536544f5ad182b4f78d0143d1daa45dd64e624
+Author: Song Bing <b06498@freescale.com>
+Date:   Thu Oct 9 17:37:43 2014 +0800
+
+[gststreamsynchronizer] send EOS event insterd of GAP event as GAP
+event has issue when A/V have different duration.
+    
+send EOS event insterd of GAP event as GAP event has issue when A/V have different duration.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=736655]
+
+Signed-off-by: Song Bing <b06498@freescale.com>
+
+diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c
+index 3e17c55..ff42d72 100644
+--- a/gst/playback/gststreamsynchronizer.c
++++ b/gst/playback/gststreamsynchronizer.c
+@@ -488,19 +488,24 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
+         }
+         g_slist_free (pads);
+       } else {
+-        /* if EOS, but no data has passed, then send EOS event */
++        /* if EOS, but no data has passed, then send something to replace EOS
++         * for preroll purposes */
+         if (!seen_data) {
+-          GstEvent *gap_event;
++          GstEvent *eos_event;
+ 
+-          gap_event = gst_event_new_eos ();
+-          ret = gst_pad_push_event (srcpad, gap_event);
++          /* FIXME: change to EOS event as GAP event has issue when A/V have
++           * different duration */
++          eos_event = gst_event_new_eos ();
++          ret = gst_pad_push_event (srcpad, eos_event);
+         } else {
+-          GstEvent *gap_event;
++          GstEvent *eos_event;
+ 
+           /* FIXME: Also send a GAP event to let audio sinks start their
+            * clock in case they did not have enough data yet */
+-          gap_event = gst_event_new_gap (timestamp, GST_CLOCK_TIME_NONE);
+-          ret = gst_pad_push_event (srcpad, gap_event);
++          /* FIXME: change to EOS event as GAP event has issue when A/V have
++           * different duration */
++          eos_event = gst_event_new_eos ();
++          ret = gst_pad_push_event (srcpad, eos_event);
+         }
+       }
+       gst_object_unref (srcpad);
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/do-not-change-eos-event-to-gap-event3.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/do-not-change-eos-event-to-gap-event3.patch
new file mode 100755
index 0000000..731be68
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/do-not-change-eos-event-to-gap-event3.patch
@@ -0,0 +1,31 @@
+commit 3f7052aac5e0118a9a9e09fff2f65091be448972
+Author: Song Bing <b06498@freescale.com>
+Date:   Thu Oct 23 13:35:13 2014 +0800
+
+[streamsynchronizer] One stream can finish playback.
+  
+As changed GAP event EOS event, so EOS will send more times, which will
+cause send function return error.
+Streamsynchronizer will don’t send second track EOS event if send the
+first track EOS return fail. Fixed by ignore the return error.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=736655]
+
+Signed-off-by: Song Bing b06498@freescale.com
+
+diff --git a/gst/playback/gststreamsynchronizer.c b/gst/playback/gststreamsynchronizer.c
+index ff42d72..d1732c3 100644
+--- a/gst/playback/gststreamsynchronizer.c
++++ b/gst/playback/gststreamsynchronizer.c
+@@ -482,7 +482,10 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstObject * parent,
+         while (epad) {
+           pad = epad->data;
+           GST_DEBUG_OBJECT (pad, "Pushing EOS");
+-          ret = ret && gst_pad_push_event (pad, gst_event_new_eos ());
++          /* FIXME: remove error check as GAP changed to EOS will send EOS
++           * more times, which will cause return error and then don't send
++           * EOS event to following tracks. */
++          gst_pad_push_event (pad, gst_event_new_eos ());
+           gst_object_unref (pad);
+           epad = g_slist_next (epad);
+         }
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch
new file mode 100644
index 0000000..3256717
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/encodebin-Need-more-buffers-in-output-queue-for-bett.patch
@@ -0,0 +1,32 @@
+From 540e02c92c75e08b90326863dc787fa5cadf9da6 Mon Sep 17 00:00:00 2001
+From: Song Bing <b06498@freescale.com>
+Date: Fri, 13 Mar 2015 18:04:31 +0800
+Subject: [PATCH] encodebin: Need more buffers in output queue for better
+ performance
+
+Need more buffers in output queue for better performance
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=744191]
+
+Signed-off-by: Song Bing <b06498@freescale.com>
+---
+ gst/encoding/gstencodebin.c |    3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/gst/encoding/gstencodebin.c b/gst/encoding/gstencodebin.c
+index 6728e58..32daae4 100644
+--- a/gst/encoding/gstencodebin.c
++++ b/gst/encoding/gstencodebin.c
+@@ -1138,8 +1138,7 @@ _create_stream_group (GstEncodeBin * ebin, GstEncodingProfile * sprof,
+    * We only use a 1buffer long queue here, the actual queueing will be done
+    * in the input queue */
+   last = sgroup->outqueue = gst_element_factory_make ("queue", NULL);
+-  g_object_set (sgroup->outqueue, "max-size-buffers", (guint32) 1,
+-      "max-size-bytes", (guint32) 0, "max-size-time", (guint64) 0,
++  g_object_set (sgroup->outqueue, "max-size-time", (guint64) 0,
+       "silent", TRUE, NULL);
+ 
+   gst_bin_add (GST_BIN (ebin), sgroup->outqueue);
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/fix-id3demux-utf16-to-utf8-issue.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/fix-id3demux-utf16-to-utf8-issue.patch
new file mode 100755
index 0000000..ef3f75f
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/fix-id3demux-utf16-to-utf8-issue.patch
@@ -0,0 +1,54 @@
+Author: Lyon Wang <b12696@freescale.com>
+Date:   Thu Oct 9 17:37:43 2014 +0800
+
+[id3v2frames] Bug fix for id3demux issue
+
+Fix the issue that id3 tags utf16 charaters cannot be extreacted in id3demux
+when I tried to get the id3v2 tag such as TIT2, TALB etc. it will return extrac
+failed.
+
+Checked in id3v2frame.c,  When parse the UTF-16 streams, it used g_convert() to
+convert the buffer from UTF-16 to UTF-8, however it will return err that this
+conversion is not supported which cause the extraction failed with these UTF-16
+characters.
+
+In the patch, use g_utf16_to_utf8() instead of g_convert, which can convert the
+character format successfully.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=741144
+
+Upstream-Status: Backport [1.5.1]
+
+Signed-off-by: Lyon Wang <b12696@freescale.com>
+
+diff --git a/gst-libs/gst/tag/id3v2frames.c b/gst-libs/gst/tag/id3v2frames.c
+old mode 100644
+new mode 100755
+index 3785c2a..7b9d8ac
+--- a/gst-libs/gst/tag/id3v2frames.c
++++ b/gst-libs/gst/tag/id3v2frames.c
+@@ -1057,14 +1057,17 @@ parse_insert_string_field (guint8 encoding, gchar * data, gint data_size,
+         data_size -= 2;
+       }
+ 
+-      field = g_convert (data, data_size, "UTF-8", in_encode, NULL, NULL, NULL);
+-
+-      if (field == NULL || g_utf8_validate (field, -1, NULL) == FALSE) {
+-        /* As a fallback, try interpreting UTF-16 in the other endianness */
+-        if (in_encode == utf16beenc)
+-          field = g_convert (data, data_size, "UTF-8", utf16leenc,
+-              NULL, NULL, NULL);
++      if (in_encode == utf16beenc) {
++           gunichar2 *data_utf16;
++           guint i;
++           data_utf16 =  (gunichar2 *) data;
++          for (i=0; i<(data_size>>1); i++) {
++            data_utf16[i] = GUINT16_TO_LE (data_utf16[i]);
++          }
+       }
++      //field = g_convert (data, data_size, "UTF-8", in_encode, NULL, NULL, NULL);
++       field = g_utf16_to_utf8((gunichar2 *)data, (glong)(data_size>>1), NULL, NULL, NULL);
++
+     }
+ 
+       break;
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch
new file mode 100644
index 0000000..284abbe
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/get-caps-from-src-pad-when-query-caps.patch
@@ -0,0 +1,44 @@
+From af0dac26f62aaceb4bf266720911953793e0fc5d Mon Sep 17 00:00:00 2001
+From: zhouming <b42586@freescale.com>
+Date: Wed, 14 May 2014 10:16:20 +0800
+Subject: [PATCH] ENGR00312515: get caps from src pad when query caps
+
+https://bugzilla.gnome.org/show_bug.cgi?id=728312
+
+Upstream-Status: Pending
+
+Signed-off-by: zhouming <b42586@freescale.com>
+---
+ gst-libs/gst/tag/gsttagdemux.c |   13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+ mode change 100644 => 100755 gst-libs/gst/tag/gsttagdemux.c
+
+diff --git a/gst-libs/gst/tag/gsttagdemux.c b/gst-libs/gst/tag/gsttagdemux.c
+old mode 100644
+new mode 100755
+index 9b6c478..ae2294a
+--- a/gst-libs/gst/tag/gsttagdemux.c
++++ b/gst-libs/gst/tag/gsttagdemux.c
+@@ -1708,6 +1708,19 @@ gst_tag_demux_pad_query (GstPad * pad, GstObject * parent, GstQuery * query)
+       }
+       break;
+     }
++    case GST_QUERY_CAPS:
++    {
++
++      /* We can hijack caps query if we typefind already */
++      if (demux->priv->src_caps) {
++        gst_query_set_caps_result (query, demux->priv->src_caps);
++        res = TRUE;
++      } else {
++        res = gst_pad_query_default (pad, parent, query);
++      }
++      break;
++    }
++
+     default:
+       res = gst_pad_query_default (pad, parent, query);
+       break;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/handle-audio-video-decoder-error.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/handle-audio-video-decoder-error.patch
new file mode 100755
index 0000000..833ce72
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/handle-audio-video-decoder-error.patch
@@ -0,0 +1,64 @@
+From bcb2b8b6f49e7c66124a4f5e07dea829d5ebfe59 Mon Sep 17 00:00:00 2001
+From: Lyon Wang <lyon.wang@freescale.com>
+Date: Mon, 15 Dec 2014 16:52:07 +0800
+Subject: [PATCH] handle audio/video decoder error
+
+When there is input data and no output data to the end of the stream, it will
+send GST_ELEMENT_ERROR, So the clips playing will quit.
+However, if only one of the tracks is corrupt, there is no need to quit other
+tracks playing.
+
+The patch comments the GST_ELEMENT_ERROR() and just add GST_ERROR_OBJECT()
+information instead.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=741542]
+
+Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
+---
+ gst-libs/gst/audio/gstaudiodecoder.c |    5 +++--
+ gst-libs/gst/video/gstvideodecoder.c |    5 +++--
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+ mode change 100644 => 100755 gst-libs/gst/audio/gstaudiodecoder.c
+ mode change 100644 => 100755 gst-libs/gst/video/gstvideodecoder.c
+
+diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c
+old mode 100644
+new mode 100755
+index c2e7a28..891df0a
+--- a/gst-libs/gst/audio/gstaudiodecoder.c
++++ b/gst-libs/gst/audio/gstaudiodecoder.c
+@@ -2123,9 +2123,10 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event)
+       GST_AUDIO_DECODER_STREAM_UNLOCK (dec);
+ 
+       if (dec->priv->ctx.had_input_data && !dec->priv->ctx.had_output_data) {
+-        GST_ELEMENT_ERROR (dec, STREAM, DECODE,
++        /* GST_ELEMENT_ERROR (dec, STREAM, DECODE,
+             ("No valid frames decoded before end of stream"),
+-            ("no valid frames found"));
++            ("no valid frames found")); */
++        GST_ERROR_OBJECT(dec, "No valid frames decoded before end of stream");
+       }
+ 
+       /* send taglist if no valid frame is decoded util EOS */
+diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c
+old mode 100644
+new mode 100755
+index ac581e1..4278bcd
+--- a/gst-libs/gst/video/gstvideodecoder.c
++++ b/gst-libs/gst/video/gstvideodecoder.c
+@@ -1068,9 +1068,10 @@ gst_video_decoder_sink_event_default (GstVideoDecoder * decoder,
+ 
+       /* Error out even if EOS was ok when we had input, but no output */
+       if (ret && priv->had_input_data && !priv->had_output_data) {
+-        GST_ELEMENT_ERROR (decoder, STREAM, DECODE,
++        /* GST_ELEMENT_ERROR (decoder, STREAM, DECODE,
+             ("No valid frames decoded before end of stream"),
+-            ("no valid frames found"));
++            ("no valid frames found")); */
++        GST_ERROR_OBJECT(decoder, "No valid frames decoded before end of stream");
+       }
+ 
+       /* Forward EOS immediately. This is required because no
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/taglist-not-send-to-down-stream-if-all-the-frame-cor.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/taglist-not-send-to-down-stream-if-all-the-frame-cor.patch
new file mode 100644
index 0000000..62a52b0
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/taglist-not-send-to-down-stream-if-all-the-frame-cor.patch
@@ -0,0 +1,57 @@
+From 68fa1b1425ad2c5f7c5013d0943153a8a6d0934e Mon Sep 17 00:00:00 2001
+From: Jian Li <lj.qfy.sh@gmail.com>
+Date: Wed, 24 Sep 2014 17:21:02 +0800
+Subject: [PATCH] taglist not send to down stream if all the frame corrupted
+
+https://bugzilla.gnome.org/show_bug.cgi?id=737246
+
+Upstream-Status: Pending
+
+Signed-off-by: Jian Li <lj.qfy.sh@gmail.com>
+---
+ gst-libs/gst/audio/gstaudiodecoder.c |    9 +++++++++
+ gst-libs/gst/video/gstvideodecoder.c |    8 ++++++++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c
+index 3504678..3d69efe 100644
+--- a/gst-libs/gst/audio/gstaudiodecoder.c
++++ b/gst-libs/gst/audio/gstaudiodecoder.c
+@@ -2083,6 +2083,15 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event)
+       gst_audio_decoder_drain (dec);
+       GST_AUDIO_DECODER_STREAM_UNLOCK (dec);
+ 
++      /* send taglist if no valid frame is decoded util EOS */
++      if (dec->priv->taglist && dec->priv->taglist_changed) {
++        GST_DEBUG_OBJECT (dec, "codec tag %" GST_PTR_FORMAT, dec->priv->taglist);
++        if (!gst_tag_list_is_empty (dec->priv->taglist))
++          gst_audio_decoder_push_event (dec,
++              gst_event_new_tag (gst_tag_list_ref (dec->priv->taglist)));
++        dec->priv->taglist_changed = FALSE;
++      }
++
+       /* Forward EOS because no buffer or serialized event will come after
+        * EOS and nothing could trigger another _finish_frame() call. */
+       ret = gst_audio_decoder_push_event (dec, event);
+diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c
+index dd8abe3..d9bfe4d 100644
+--- a/gst-libs/gst/video/gstvideodecoder.c
++++ b/gst-libs/gst/video/gstvideodecoder.c
+@@ -1024,6 +1024,14 @@ gst_video_decoder_sink_event_default (GstVideoDecoder * decoder,
+        * parent class' ::sink_event() until a later time.
+        */
+       forward_immediate = TRUE;
++
++      /* send taglist if no valid frame is decoded util EOS */
++      if (decoder->priv->tags && decoder->priv->tags_changed) {
++        gst_video_decoder_push_event (decoder,
++            gst_event_new_tag (gst_tag_list_ref (decoder->priv->tags)));
++        decoder->priv->tags_changed = FALSE;
++      }
++
+       break;
+     }
+     case GST_EVENT_GAP:
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/videobuffer_updata_alignment_update.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/videobuffer_updata_alignment_update.patch
new file mode 100755
index 0000000..8cfda95
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/videobuffer_updata_alignment_update.patch
@@ -0,0 +1,53 @@
+commit 88d253ea23b06289df40401160b606323f16c910
+Author: Song Bing <b06498@freescale.com>
+Date:   Mon Dec 15 09:34:35 2014 +0800
+
+videopool: update video alignment after video alignment
+
+Video buffer pool will update video alignment to respect stride alignment
+requirement. But haven't update it to video alignment in configure.
+Which will cause user get wrong video alignment.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=741501
+
+Upstream-Status: Backport [1.5.1]
+
+Signed-off-by: Song Bing <b06498@freescale.com>
+diff --git a/gst-libs/gst/video/gstvideopool.c b/gst-libs/gst/video/gstvideopool.c
+index 4475f45..acef594 100644
+--- a/gst-libs/gst/video/gstvideopool.c
++++ b/gst-libs/gst/video/gstvideopool.c
+@@ -167,6 +167,7 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
+     /* get an apply the alignment to the info */
+     gst_buffer_pool_config_get_video_alignment (config, &priv->video_align);
+     gst_video_info_align (&info, &priv->video_align);
++    gst_buffer_pool_config_set_video_alignment (config, &priv->video_align);
+   }
+   priv->info = info;
+
+diff --git a/sys/ximage/ximagepool.c b/sys/ximage/ximagepool.c
+index 6cc2cfa..6a1cbc9 100644
+--- a/sys/ximage/ximagepool.c
++++ b/sys/ximage/ximagepool.c
+@@ -597,6 +597,8 @@ ximage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
+     /* do padding and alignment */
+     gst_video_info_align (&info, &priv->align);
+
++    gst_buffer_pool_config_set_video_alignment (config, &priv->align);
++
+     /* we need the video metadata too now */
+     priv->add_metavideo = TRUE;
+   } else {
+diff --git a/sys/xvimage/xvimagepool.c b/sys/xvimage/xvimagepool.c
+index 244a51a..34b1ab2 100644
+--- a/sys/xvimage/xvimagepool.c
++++ b/sys/xvimage/xvimagepool.c
+@@ -124,6 +124,8 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
+     /* do padding and alignment */
+     gst_video_info_align (&info, &priv->align);
+
++    gst_buffer_pool_config_set_video_alignment (config, &priv->align);
++
+     /* we need the video metadata too now */
+     priv->add_metavideo = TRUE;
+   } else {
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/videoencoder-Keep-sticky-events-around-when-doing-a-soft-.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/videoencoder-Keep-sticky-events-around-when-doing-a-soft-.patch
new file mode 100644
index 0000000..b476969
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/videoencoder-Keep-sticky-events-around-when-doing-a-soft-.patch
@@ -0,0 +1,46 @@
+From c3f7d36b992a3cbcee3386dea85720f3cb04e1ff Mon Sep 17 00:00:00 2001
+From: Song Bing <b06498@freescale.com>
+Date: Fri, 27 Mar 2015 13:39:43 +0800
+Subject: [PATCH] videoencoder: Keep sticky events around when doing a soft
+ reset
+
+The current code will first discard all frames, and then tries to copy
+all sticky events from the (now discarded) frames. Let's change the order.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=746865
+
+Upstream-Status: Accepted 
+
+---
+ gst-libs/gst/video/gstvideoencoder.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gst-libs/gst/video/gstvideoencoder.c b/gst-libs/gst/video/gstvideoencoder.c
+index 614ba2d..4c5b111 100644
+--- a/gst-libs/gst/video/gstvideoencoder.c
++++ b/gst-libs/gst/video/gstvideoencoder.c
+@@ -340,10 +340,6 @@ gst_video_encoder_reset (GstVideoEncoder * encoder, gboolean hard)
+ 
+   priv->drained = TRUE;
+ 
+-  g_list_foreach (priv->frames, (GFunc) gst_video_codec_frame_unref, NULL);
+-  g_list_free (priv->frames);
+-  priv->frames = NULL;
+-
+   priv->bytes = 0;
+   priv->time = 0;
+ 
+@@ -392,6 +388,10 @@ gst_video_encoder_reset (GstVideoEncoder * encoder, gboolean hard)
+         encoder->priv->current_frame_events);
+   }
+ 
++  g_list_foreach (priv->frames, (GFunc) gst_video_codec_frame_unref, NULL);
++  g_list_free (priv->frames);
++  priv->frames = NULL;
++
+   GST_VIDEO_ENCODER_STREAM_UNLOCK (encoder);
+ 
+   return ret;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.4.5.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.4.5.bb
new file mode 100644
index 0000000..b09c2cb
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.4.5.bb
@@ -0,0 +1,30 @@
+include gstreamer1.0-plugins-base.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
+                    file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
+                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
+                   "
+
+SRC_URI += "file://do-not-change-eos-event-to-gap-event-if.patch \
+            file://get-caps-from-src-pad-when-query-caps.patch \
+            file://taglist-not-send-to-down-stream-if-all-the-frame-cor.patch \
+            file://fix-id3demux-utf16-to-utf8-issue.patch \
+            file://handle-audio-video-decoder-error.patch \
+            file://videobuffer_updata_alignment_update.patch \
+            file://0002-video-frame-Add-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch \
+            file://0001-video-frame-Don-t-ref-buffers-twice-when-mapping.patch \
+            file://0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch \
+            file://videoencoder-Keep-sticky-events-around-when-doing-a-soft-.patch \
+            file://do-not-change-eos-event-to-gap-event2.patch \
+            file://do-not-change-eos-event-to-gap-event3.patch \
+            file://0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \
+            file://0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch \
+            file://0003-ssaparse-enhance-SSA-text-lines-parsing.patch \
+            file://0004-subparse-set-need_segment-after-sink-pad-received-GS.patch \
+            file://encodebin-Need-more-buffers-in-output-queue-for-bett.patch \
+"
+
+SRC_URI[md5sum] = "357165af625c0ca353ab47c5d843920e"
+SRC_URI[sha256sum] = "77bd8199e7a312d3d71de9b7ddf761a3b78560a2c2a80829d0815ca39cbd551d"
+
+S = "${WORKDIR}/gst-plugins-base-${PV}"
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb
new file mode 100644
index 0000000..fbe3a42
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_git.bb
@@ -0,0 +1,19 @@
+DEFAULT_PREFERENCE = "-1"
+
+include gstreamer1.0-plugins-base.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c54ce9345727175ff66d17b67ff51f58 \
+                    file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
+                    file://COPYING.LIB;md5=6762ed442b3822387a51c92d928ead0d \
+                   "
+
+S = "${WORKDIR}/git"
+
+SRCREV = "8d4cb64a4b9d84b10076bf350f80a0d6ea68ec2d"
+
+do_configure_prepend() {
+	cd ${S}
+	./autogen.sh --noconfigure
+	cd ${B}
+}
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc
new file mode 100644
index 0000000..6e316de
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good.inc
@@ -0,0 +1,57 @@
+require gstreamer1.0-plugins.inc
+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+
+# libid3tag
+DEPENDS += "gstreamer1.0-plugins-base zlib bzip2 libcap"
+
+inherit gettext
+
+
+PACKAGECONFIG ??= " \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)} \
+    orc cairo flac gdk-pixbuf gudev jpeg libpng soup speex taglib \
+    "
+
+X11DEPENDS = "virtual/libx11 libsm libxrender libxfixes libxdamage"
+X11ENABLEOPTS = "--enable-x --enable-xshm"
+X11DISABLEOPTS = "--disable-x --disable-xshm"
+PACKAGECONFIG[x11]        = "${X11ENABLEOPTS},${X11DISABLEOPTS},${X11DEPENDS}"
+PACKAGECONFIG[pulseaudio] = "--enable-pulse,--disable-pulse,pulseaudio"
+PACKAGECONFIG[cairo]      = "--enable-cairo,--disable-cairo,cairo"
+PACKAGECONFIG[flac]       = "--enable-flac,--disable-flac,flac"
+PACKAGECONFIG[gdk-pixbuf] = "--enable-gdk_pixbuf,--disable-gdk_pixbuf,gdk-pixbuf"
+PACKAGECONFIG[gudev]      = "--with-gudev,--without-gudev,udev"
+PACKAGECONFIG[jack]       = "--enable-jack,--disable-jack,jack"
+PACKAGECONFIG[jpeg]       = "--enable-jpeg,--disable-jpeg,jpeg"
+PACKAGECONFIG[libpng]     = "--enable-libpng,--disable-libpng,libpng"
+PACKAGECONFIG[soup]       = "--enable-soup,--disable-soup,libsoup-2.4"
+PACKAGECONFIG[speex]      = "--enable-speex,--disable-speex,speex"
+PACKAGECONFIG[taglib]     = "--enable-taglib,--disable-taglib,taglib"
+PACKAGECONFIG[vpx]        = "--enable-vpx,--disable-vpx,libvpx"
+PACKAGECONFIG[wavpack]    = "--enable-wavpack,--disable-wavpack,wavpack"
+
+# the 1394 plugins require both libraw1394 and libiec61883
+# the former is included in meta-oe, the latter isn't
+# -> disabled
+
+EXTRA_OECONF += " \
+    --enable-oss \
+    --enable-gst_v4l2 \
+    --without-libv4l2 \
+    --disable-directsound \
+    --disable-waveform \
+    --disable-oss4 \
+    --disable-sunaudio \
+    --disable-osx_audio \
+    --disable-osx_video \
+    --disable-aalib \
+    --disable-libcaca \
+    --disable-libdv \
+    --disable-shout2 \
+    --disable-examples \
+    --disable-dv1394 \
+"
+
+FILES_${PN}-equalizer += "${datadir}/gstreamer-1.0/presets/*.prs"
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch
new file mode 100755
index 0000000..d1973d4
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch
@@ -0,0 +1,62 @@
+From c782a30482908a4b4dd9cd4abff9f9bc4016698f Mon Sep 17 00:00:00 2001
+From: Song Bing <b06498@freescale.com>
+Date: Tue, 5 Aug 2014 14:40:46 +0800
+Subject: [PATCH] gstrtpmp4gpay: set dafault value for MPEG4 without codec
+ data in caps.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=734263
+
+Upstream-Status: Submitted
+
+Signed-off-by: Song Bing <b06498@freescale.com>
+---
+ gst/rtp/gstrtpmp4gpay.c |   19 ++++++++++++++++++-
+ 1 file changed, 18 insertions(+), 1 deletion(-)
+
+diff --git a/gst/rtp/gstrtpmp4gpay.c b/gst/rtp/gstrtpmp4gpay.c
+index 7913d9a..1749d39 100644
+--- a/gst/rtp/gstrtpmp4gpay.c
++++ b/gst/rtp/gstrtpmp4gpay.c
+@@ -390,6 +390,7 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
+   const GValue *codec_data;
+   const gchar *media_type = NULL;
+   gboolean res;
++  const gchar *name;
+ 
+   rtpmp4gpay = GST_RTP_MP4G_PAY (payload);
+ 
+@@ -400,7 +401,6 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
+     GST_LOG_OBJECT (rtpmp4gpay, "got codec_data");
+     if (G_VALUE_TYPE (codec_data) == GST_TYPE_BUFFER) {
+       GstBuffer *buffer;
+-      const gchar *name;
+ 
+       buffer = gst_value_get_buffer (codec_data);
+       GST_LOG_OBJECT (rtpmp4gpay, "configuring codec_data");
+@@ -426,6 +426,23 @@ gst_rtp_mp4g_pay_setcaps (GstRTPBasePayload * payload, GstCaps * caps)
+ 
+       rtpmp4gpay->config = gst_buffer_copy (buffer);
+     }
++  } else {
++    name = gst_structure_get_name (structure);
++
++    if (!strcmp (name, "video/mpeg")) {
++      rtpmp4gpay->profile = g_strdup ("1");
++
++      /* fixed rate */
++      rtpmp4gpay->rate = 90000;
++      /* video stream type */
++      rtpmp4gpay->streamtype = "4";
++      /* no params for video */
++      rtpmp4gpay->params = NULL;
++      /* mode */
++      rtpmp4gpay->mode = "generic";
++
++      media_type = "video";
++    }
+   }
+   if (media_type == NULL)
+     goto config_failed;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/decrease_asteriskh263_rank.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/decrease_asteriskh263_rank.patch
new file mode 100755
index 0000000..288631b
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/decrease_asteriskh263_rank.patch
@@ -0,0 +1,25 @@
+commit d71d74daac8ed54156ed103958ab455c63c72b0e
+Author: Song Bing <b06498@freescale.com>
+Date:   Mon Nov 10 11:25:47 2014 +0800
+
+[asteriskh263] decrease the rank as we havn't this kind of decoder.
+
+Decrease the rank as we havn't this kind of decoder.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=739935
+
+Upstream-Status: Pending
+
+Signed-off-by: Song Bing <b06498@freescale.com>
+
+diff --git a/gst/rtp/gstasteriskh263.c b/gst/rtp/gstasteriskh263.c
+index a01fbc8..8fa3194 100644
+--- a/gst/rtp/gstasteriskh263.c
++++ b/gst/rtp/gstasteriskh263.c
+@@ -226,5 +226,5 @@ gboolean
+ gst_asteriskh263_plugin_init (GstPlugin * plugin)
+ {
+   return gst_element_register (plugin, "asteriskh263",
+-      GST_RANK_SECONDARY, GST_TYPE_ASTERISK_H263);
++      GST_RANK_SECONDARY - 1, GST_TYPE_ASTERISK_H263);
+ }
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.4.5.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.4.5.bb
new file mode 100644
index 0000000..943ab60
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.4.5.bb
@@ -0,0 +1,13 @@
+include gstreamer1.0-plugins-good.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                    file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
+                    file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
+
+SRC_URI += "file://0001-gstrtpmp4gpay-set-dafault-value-for-MPEG4-without-co.patch \
+            file://decrease_asteriskh263_rank.patch \
+"
+SRC_URI[md5sum] = "eaf1a6daf73749bc423feac301d60038"
+SRC_URI[sha256sum] = "79b1b5f3f7bcaa8a615202eb5e176121eeb8336960f70687e536ad78dbc7e641"
+
+S = "${WORKDIR}/gst-plugins-good-${PV}"
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb
new file mode 100644
index 0000000..2c0e0ef
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_git.bb
@@ -0,0 +1,18 @@
+DEFAULT_PREFERENCE = "-1"
+
+include gstreamer1.0-plugins-good.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                    file://common/coverage/coverage-report.pl;beginline=2;endline=17;md5=a4e1830fce078028c8f0974161272607 \
+                    file://gst/replaygain/rganalysis.c;beginline=1;endline=23;md5=b60ebefd5b2f5a8e0cab6bfee391a5fe"
+
+S = "${WORKDIR}/git"
+
+SRCREV = "fd0123800c8c1cf1468c0fa5d592ad0d0d8b4140"
+
+do_configure_prepend() {
+	cd ${S}
+	./autogen.sh --noconfigure
+	cd ${B}
+}
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc
new file mode 100644
index 0000000..63ba316
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly.inc
@@ -0,0 +1,30 @@
+require gstreamer1.0-plugins.inc
+
+LICENSE = "GPLv2+ & LGPLv2.1+ & LGPLv2+"
+LICENSE_FLAGS = "commercial"
+
+DEPENDS += "gstreamer1.0-plugins-base libid3tag"
+
+inherit gettext
+
+
+PACKAGECONFIG ??= " \
+    orc a52dec lame mad mpeg2dec \
+    "
+
+PACKAGECONFIG[a52dec]   = "--enable-a52dec,--disable-a52dec,liba52"
+PACKAGECONFIG[cdio]     = "--enable-cdio,--disable-cdio,libcdio"
+PACKAGECONFIG[dvdread]  = "--enable-dvdread,--disable-dvdread,libdvdread"
+PACKAGECONFIG[lame]     = "--enable-lame,--disable-lame,lame"
+PACKAGECONFIG[mad]      = "--enable-mad,--disable-mad,libmad"
+PACKAGECONFIG[mpeg2dec] = "--enable-mpeg2dec,--disable-mpeg2dec,mpeg2dec"
+PACKAGECONFIG[x264]     = "--enable-x264,--disable-x264,x264"
+
+
+EXTRA_OECONF += " \
+    --disable-amrnb \
+    --disable-amrwb \
+    --disable-sidplay \
+    --disable-twolame \
+    "
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.4.5.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.4.5.bb
new file mode 100644
index 0000000..25cb28c
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_1.4.5.bb
@@ -0,0 +1,10 @@
+include gstreamer1.0-plugins-ugly.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                    file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068 "
+
+SRC_URI[md5sum] = "6954beed7bb9a93e426dee543ff46393"
+SRC_URI[sha256sum] = "5cd5e81cf618944f4dc935f1669b2125e8bb2fe9cc7dc8dc15b72237aca49067"
+
+S = "${WORKDIR}/gst-plugins-ugly-${PV}"
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb
new file mode 100644
index 0000000..dcf5ffc
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-ugly_git.bb
@@ -0,0 +1,17 @@
+DEFAULT_PREFERENCE = "-1"
+
+include gstreamer1.0-plugins-ugly.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
+                    file://tests/check/elements/xingmux.c;beginline=1;endline=21;md5=4c771b8af188724855cb99cadd390068 "
+
+S = "${WORKDIR}/git"
+
+SRCREV = "06b8ac10cee85c5c304ca320997aa8f44295a66f"
+
+do_configure_prepend() {
+	cd ${S}
+	./autogen.sh --noconfigure
+	cd ${B}
+}
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
new file mode 100644
index 0000000..f1783b7
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins.inc
@@ -0,0 +1,59 @@
+SUMMARY = "Plugins for the GStreamer multimedia framework 1.x"
+HOMEPAGE = "http://gstreamer.freedesktop.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
+SECTION = "multimedia"
+DEPENDS = "gstreamer1.0"
+
+inherit autotools pkgconfig
+
+GSTREAMER_1_0_DEBUG ?= "--disable-debug"
+GSTREAMER_1_0_GIT_BRANCH ?= "master"
+EXTRA_OECONF = "--disable-valgrind ${GSTREAMER_1_0_DEBUG} --disable-examples "
+
+acpaths = "-I ${S}/common/m4 -I ${S}/m4"
+
+LIBV = "1.0"
+require gst-plugins-package.inc
+
+PACKAGECONFIG[orc] = "--enable-orc,--disable-orc,orc orc-native"
+
+export ORCC = "${STAGING_DIR_NATIVE}${bindir}/orcc"
+
+PACKAGES_DYNAMIC = "^${PN}-.*"
+
+# apply gstreamer hack after Makefile.in.in in source is replaced by our version from
+# ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in, but before configure is executed 
+# http://lists.linuxtogo.org/pipermail/openembedded-core/2012-November/032233.html
+oe_runconf_prepend() {
+	if [ -e ${S}/po/Makefile.in.in ]; then
+		sed -i -e "1a\\" -e 'GETTEXT_PACKAGE = @GETTEXT_PACKAGE@' ${S}/po/Makefile.in.in
+	fi
+}
+
+SRC_URI = "${@get_gst_srcuri(d)}"
+
+def get_gst_srcuri(d):
+    # check if expected prefix is present
+    prefix = "gstreamer1.0-"
+    bpn = d.getVar("BPN", True)
+    if not bpn.startswith(prefix):
+        bb.fatal('Invalid GStreamer 1.0 plugin package name "%s" : must start with "%s"' % (bpn, prefix))
+
+    # replaced prefix with "gst-", which is what is used for the tarball and repository filenames
+    gstpkg_basename = "gst-" + bpn[len(prefix):]
+    pv = d.getVar("PV", True)
+    branch = d.getVar("GSTREAMER_1_0_GIT_BRANCH", True)
+
+    if pv == "git":
+        s = "git://anongit.freedesktop.org/gstreamer/%s;branch=%s" % (gstpkg_basename, branch)
+    else:
+        s = "http://gstreamer.freedesktop.org/src/%s/%s-%s.tar.xz" % (gstpkg_basename, gstpkg_basename, pv)
+    return s
+
+delete_liblink_m4_file() {
+	# This m4 file contains nastiness which conflicts with libtool 2.2.2
+	rm "${S}/m4/lib-link.m4" || true
+}
+
+do_configure[prefuncs] += " delete_liblink_m4_file "
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
new file mode 100644
index 0000000..28a9420
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server.inc
@@ -0,0 +1,14 @@
+SUMMARY = "A library on top of GStreamer for building an RTSP server"
+SECTION = "multimedia"
+LICENSE = "LGPLv2"
+HOMEPAGE = "http://cgit.freedesktop.org/gstreamer/gst-rtsp-server/"
+DEPENDS = "gstreamer1.0 libcgroup gstreamer1.0-plugins-base"
+
+PNREAL = "gst-rtsp-server"
+
+SRC_URI = "http://gstreamer.freedesktop.org/src/${PNREAL}/${PNREAL}-${PV}.tar.xz"
+
+S = "${WORKDIR}/${PNREAL}-${PV}"
+
+inherit autotools pkgconfig 
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.4.5.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.4.5.bb
new file mode 100644
index 0000000..bb9b42b
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.4.5.bb
@@ -0,0 +1,6 @@
+include gstreamer1.0-rtsp-server.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d"
+
+SRC_URI[md5sum] = "a9f9b8899ec7ab33663cda7627db40d3"
+SRC_URI[sha256sum] = "3089254bd31b7c1f1cf2c034a3b3551f92878f9e3cab65cef3a901a04c0f1d37"
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc b/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
new file mode 100644
index 0000000..be8aa8f
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0.inc
@@ -0,0 +1,29 @@
+SUMMARY = "GStreamer 1.0 multimedia framework"
+DESCRIPTION = "GStreamer is a multimedia framework for encoding and decoding video and sound. \
+It supports a wide range of formats including mp3, ogg, avi, mpeg and quicktime."
+HOMEPAGE = "http://gstreamer.freedesktop.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/enter_bug.cgi?product=Gstreamer"
+SECTION = "multimedia"
+LICENSE = "LGPLv2+"
+DEPENDS = "glib-2.0 libxml2 bison-native flex-native"
+
+inherit autotools pkgconfig gettext
+
+PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
+PACKAGECONFIG[check] = "--enable-check,--disable-check"
+
+EXTRA_OECONF = "--disable-docbook --disable-gtk-doc \
+                --disable-dependency-tracking \
+                --disable-examples --disable-tests \
+                --disable-valgrind \
+                "
+
+RRECOMMENDS_${PN}_qemux86    += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
+RRECOMMENDS_${PN}_qemux86-64 += "kernel-module-snd-ens1370 kernel-module-snd-rawmidi"
+
+CACHED_CONFIGUREVARS += "ac_cv_header_valgrind_valgrind_h=no"
+
+FILES_${PN} += " ${libdir}/gstreamer-1.0/*.so"
+FILES_${PN}-dev += " ${libdir}/gstreamer-1.0/*.la ${libdir}/gstreamer-1.0/*.a"
+FILES_${PN}-dbg += " ${libdir}/gstreamer-1.0/.debug/ ${libexecdir}/gstreamer-1.0/.debug/"
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch
new file mode 100644
index 0000000..94f5cc5
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-Fix-crash-with-gst-inspect.patch
@@ -0,0 +1,28 @@
+From 6b26f3dbf9bf577d71534ab7410de66d06e46ba2 Mon Sep 17 00:00:00 2001
+From: Carlos Rafael Giani <dv@pseudoterminal.org>
+Date: Sat, 6 Apr 2013 23:52:11 +0200
+Subject: [PATCH] Fix crash with gst-inspect Chris Lord <chris@openedhand.com>
+
+Upstream-Status: Pending
+
+Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
+---
+ tools/gst-inspect.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c
+index 23b7c44..b79b02e 100644
+--- a/tools/gst-inspect.c
++++ b/tools/gst-inspect.c
+@@ -1556,7 +1556,7 @@ main (int argc, char *argv[])
+   g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE);
+   g_option_context_add_group (ctx, gst_init_get_option_group ());
+   if (!g_option_context_parse (ctx, &argc, &argv, &err)) {
+-    g_printerr ("Error initializing: %s\n", err->message);
++    g_printerr ("Error initializing: %s\n", err ? err->message : "(null)");
+     return -1;
+   }
+   g_option_context_free (ctx);
+-- 
+1.8.2
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstinfo-Shorten-__FILE__-on-all-platforms.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstinfo-Shorten-__FILE__-on-all-platforms.patch
new file mode 100644
index 0000000..8213c4b
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gstinfo-Shorten-__FILE__-on-all-platforms.patch
@@ -0,0 +1,55 @@
+From 81fecd367b016e5ac4fb0c04b84da5c474f30da6 Mon Sep 17 00:00:00 2001
+From: Peter Urbanec <git.user@urbanec.net>
+Date: Fri, 27 Feb 2015 01:16:58 +1100
+Subject: [PATCH 1/1] gstinfo: Shorten __FILE__ on all platforms.
+
+This is useful not only for MSVC, but also with gcc/Linux when doing
+cross-compilation builds and out-of-tree builds.
+
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=745213]
+
+Signed-off-by: Peter Urbanec <git.user@urbanec.net>
+---
+ gst/gstinfo.c | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/gst/gstinfo.c b/gst/gstinfo.c
+index b2a3005..8b61d09 100644
+--- a/gst/gstinfo.c
++++ b/gst/gstinfo.c
+@@ -444,7 +444,6 @@ gst_debug_log (GstDebugCategory * category, GstDebugLevel level,
+   va_end (var_args);
+ }
+ 
+-#ifdef G_OS_WIN32
+ /* based on g_basename(), which we can't use because it was deprecated */
+ static inline const gchar *
+ gst_path_basename (const gchar * file_name)
+@@ -467,7 +466,6 @@ gst_path_basename (const gchar * file_name)
+ 
+   return file_name;
+ }
+-#endif
+ 
+ /**
+  * gst_debug_log_valist:
+@@ -497,12 +495,11 @@ gst_debug_log_valist (GstDebugCategory * category, GstDebugLevel level,
+   g_return_if_fail (function != NULL);
+   g_return_if_fail (format != NULL);
+ 
+-  /* The predefined macro __FILE__ is always the exact path given to the
+-   * compiler with MSVC, which may or may not be the basename.  We work
+-   * around it at runtime to improve the readability. */
+-#ifdef G_OS_WIN32
++  /* The predefined macro __FILE__ can be an absolute path in some build
++   * environments, such as MSVC or out-of-tree cross-compiles. This may
++   * be significantly longer than the filename.  We work around it at
++   * runtime to improve the readability. */
+   file = gst_path_basename (file);
+-#endif
+ 
+   message.message = NULL;
+   message.format = format;
+-- 
+2.3.0
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-basesink-Fix-QoS-lateness-checking-if-subclass-imple.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-basesink-Fix-QoS-lateness-checking-if-subclass-imple.patch
new file mode 100644
index 0000000..1505cbe
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-basesink-Fix-QoS-lateness-checking-if-subclass-imple.patch
@@ -0,0 +1,70 @@
+From 6914566ed6a89c96973a578aa5ecd01ee68cdcfd Mon Sep 17 00:00:00 2001
+From: Jian <Jian.Li@freescale.com>
+Date: Thu, 14 May 2015 15:49:43 +0800
+Subject: [PATCH] basesink: Fix QoS/lateness checking if subclass implements
+ prepare/prepare_list vfuncs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In basesink functions gst_base_sink_chain_unlocked(), below code is used to
+checking if buffer is late before doing prepare call to save some effort:
+    if (syncable && do_sync)
+      late =
+          gst_base_sink_is_too_late (basesink, obj, rstart, rstop,
+          GST_CLOCK_EARLY, 0, FALSE);
+
+    if (G_UNLIKELY (late))
+      goto dropped;
+
+But this code has problem, it should calculate jitter based on current media
+clock, rather than just passing 0. I found it will drop all the frames when
+rewind in slow speed, such as -2X.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=749258
+
+Upstream-Status: Backport [1.5.1]
+---
+ libs/gst/base/gstbasesink.c |   26 ++++++++++++++++++++++----
+ 1 file changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c
+index a505695..5fb2d6a 100644
+--- a/libs/gst/base/gstbasesink.c
++++ b/libs/gst/base/gstbasesink.c
+@@ -3369,10 +3369,28 @@ gst_base_sink_chain_unlocked (GstBaseSink * basesink, GstPad * pad,
+     if (G_UNLIKELY (stepped))
+       goto dropped;
+ 
+-    if (syncable && do_sync)
+-      late =
+-          gst_base_sink_is_too_late (basesink, obj, rstart, rstop,
+-          GST_CLOCK_EARLY, 0, FALSE);
++    if (syncable && do_sync) {
++      GstClock *clock;
++
++      GST_OBJECT_LOCK (basesink);
++      clock = GST_ELEMENT_CLOCK (basesink);
++      if (clock && GST_STATE (basesink) == GST_STATE_PLAYING) {
++        GstClockTime base_time;
++        GstClockTime stime;
++        GstClockTime now;
++
++        base_time = GST_ELEMENT_CAST (basesink)->base_time;
++        stime = base_time + gst_base_sink_adjust_time (basesink, rstart);
++        now = gst_clock_get_time (clock);
++        GST_OBJECT_UNLOCK (basesink);
++
++        late =
++            gst_base_sink_is_too_late (basesink, obj, rstart, rstop,
++            GST_CLOCK_EARLY, GST_CLOCK_DIFF (stime, now), FALSE);
++      } else {
++        GST_OBJECT_UNLOCK (basesink);
++      }
++    }
+ 
+     if (G_UNLIKELY (late))
+       goto dropped;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch
new file mode 100755
index 0000000..f50ce6f
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch
@@ -0,0 +1,167 @@
+From 83bed90c306ed3185d48febf6441177d638f7341 Mon Sep 17 00:00:00 2001
+From: Song Bing <b06498@freescale.com>
+Date: Wed, 24 Dec 2014 10:13:51 +0800
+Subject: [PATCH] inputselector: sticky events haven't send out when active
+ track reach EOS
+
+EOS event hasn't been send to down-element. The resolution is block EOS event
+of inactive pad, send the event after the pad actived.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=740949
+
+Upstream-Status: Backport [1.5.1]
+
+Signed-off-by: Song Bing <b06498@freescale.com>
+---
+ plugins/elements/gstinputselector.c |   58 ++++++++++++++++++++++++++---------
+ plugins/elements/gstinputselector.h |    1 +
+ 2 files changed, 45 insertions(+), 14 deletions(-)
+
+diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c
+index fb50802..4461f7c 100644
+--- a/plugins/elements/gstinputselector.c
++++ b/plugins/elements/gstinputselector.c
+@@ -440,6 +440,17 @@ gst_selector_pad_iterate_linked_pads (GstPad * pad, GstObject * parent)
+ }
+ 
+ static gboolean
++gst_input_selector_eos_wait (GstInputSelector * self, GstSelectorPad * pad)
++{
++  while (!self->eos && !self->flushing && !pad->flushing) {
++    /* we can be unlocked here when we are shutting down (flushing) or when we
++     * get unblocked */
++    GST_INPUT_SELECTOR_WAIT (self);
++  }
++  return self->flushing;
++}
++
++static gboolean
+ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
+ {
+   gboolean res = TRUE;
+@@ -486,6 +497,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
+     case GST_EVENT_FLUSH_START:
+       /* Unblock the pad if it's waiting */
+       selpad->flushing = TRUE;
++      sel->eos = FALSE;
+       GST_INPUT_SELECTOR_BROADCAST (sel);
+       break;
+     case GST_EVENT_FLUSH_STOP:
+@@ -523,21 +535,12 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event)
+     case GST_EVENT_EOS:
+       selpad->eos = TRUE;
+ 
+-      if (forward) {
+-        selpad->eos_sent = TRUE;
+-      } else {
+-        GstSelectorPad *active_selpad;
+-
+-        /* If the active sinkpad is in EOS state but EOS
+-         * was not sent downstream this means that the pad
+-         * got EOS before it was set as active pad and that
+-         * the previously active pad got EOS after it was
+-         * active
+-         */
+-        active_selpad = GST_SELECTOR_PAD (active_sinkpad);
+-        forward = (active_selpad->eos && !active_selpad->eos_sent);
+-        active_selpad->eos_sent = TRUE;
++      if (!forward) {
++        /* blocked until active the sind pad or flush */
++        gst_input_selector_eos_wait (sel, selpad);
++        forward = TRUE;
+       }
++      selpad->eos_sent = TRUE;
+       GST_DEBUG_OBJECT (pad, "received EOS");
+       break;
+     case GST_EVENT_GAP:{
+@@ -676,6 +679,12 @@ gst_input_selector_wait_running_time (GstInputSelector * sel,
+         gst_input_selector_activate_sinkpad (sel, GST_PAD_CAST (selpad));
+     active_selpad = GST_SELECTOR_PAD_CAST (active_sinkpad);
+ 
++    if (sel->eos) {
++      GST_DEBUG_OBJECT (sel, "Not waiting because inputselector reach EOS.");
++      GST_INPUT_SELECTOR_UNLOCK (sel);
++      return FALSE;
++    }
++
+     if (seg->format != GST_FORMAT_TIME) {
+       GST_DEBUG_OBJECT (selpad,
+           "Not waiting because we don't have a TIME segment");
+@@ -971,6 +980,12 @@ gst_selector_pad_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
+       GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)));
+ 
+   GST_INPUT_SELECTOR_LOCK (sel);
++  if (sel->eos) {
++    GST_DEBUG_OBJECT (pad, "inputselector eos.");
++    GST_INPUT_SELECTOR_UNLOCK (sel);
++    goto eos;
++  }
++
+   /* wait or check for flushing */
+   if (gst_input_selector_wait (sel, selpad)) {
+     GST_INPUT_SELECTOR_UNLOCK (sel);
+@@ -1151,6 +1166,13 @@ flushing:
+     res = GST_FLOW_FLUSHING;
+     goto done;
+   }
++eos:
++  {
++    GST_DEBUG_OBJECT (pad, "We are eos, discard buffer %p", buf);
++    gst_buffer_unref (buf);
++    res = GST_FLOW_EOS;
++    goto done;
++  }
+ }
+ 
+ static void gst_input_selector_dispose (GObject * object);
+@@ -1309,6 +1331,7 @@ gst_input_selector_init (GstInputSelector * sel)
+   g_mutex_init (&sel->lock);
+   g_cond_init (&sel->cond);
+   sel->blocked = FALSE;
++  sel->eos = FALSE;
+ 
+   /* lets give a change for downstream to do something on
+    * active-pad change before we start pushing new buffers */
+@@ -1377,6 +1400,11 @@ gst_input_selector_set_active_pad (GstInputSelector * self, GstPad * pad)
+   GST_DEBUG_OBJECT (self, "New active pad is %" GST_PTR_FORMAT,
+       self->active_sinkpad);
+ 
++  if (old != new && new->eos && !new->eos_sent) {
++    self->eos = TRUE;
++    GST_INPUT_SELECTOR_BROADCAST (self);
++  }
++
+   return TRUE;
+ }
+ 
+@@ -1771,6 +1799,7 @@ gst_input_selector_change_state (GstElement * element,
+   switch (transition) {
+     case GST_STATE_CHANGE_READY_TO_PAUSED:
+       GST_INPUT_SELECTOR_LOCK (self);
++      self->eos = FALSE;
+       self->blocked = FALSE;
+       self->flushing = FALSE;
+       GST_INPUT_SELECTOR_UNLOCK (self);
+@@ -1779,6 +1808,7 @@ gst_input_selector_change_state (GstElement * element,
+       /* first unlock before we call the parent state change function, which
+        * tries to acquire the stream lock when going to ready. */
+       GST_INPUT_SELECTOR_LOCK (self);
++      self->eos = TRUE;
+       self->blocked = FALSE;
+       self->flushing = TRUE;
+       GST_INPUT_SELECTOR_BROADCAST (self);
+diff --git a/plugins/elements/gstinputselector.h b/plugins/elements/gstinputselector.h
+index 96c680f..9bf924f 100644
+--- a/plugins/elements/gstinputselector.h
++++ b/plugins/elements/gstinputselector.h
+@@ -77,6 +77,7 @@ struct _GstInputSelector {
+   GMutex lock;
+   GCond cond;
+   gboolean blocked;
++  gboolean eos;
+   gboolean flushing;
+ };
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.4.5.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.4.5.bb
new file mode 100644
index 0000000..db58754
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.4.5.bb
@@ -0,0 +1,17 @@
+include gstreamer1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
+                    file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
+
+SRC_URI = " \
+    http://gstreamer.freedesktop.org/src/gstreamer/gstreamer-${PV}.tar.xz \
+    file://0001-Fix-crash-with-gst-inspect.patch \
+    file://0001-gstinfo-Shorten-__FILE__-on-all-platforms.patch \
+    file://inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch \
+    file://0002-basesink-Fix-QoS-lateness-checking-if-subclass-imple.patch \
+"
+SRC_URI[md5sum] = "88a9289c64a4950ebb4f544980234289"
+SRC_URI[sha256sum] = "40801aa7f979024526258a0e94707ba42b8ab6f7d2206e56adbc4433155cb0ae"
+
+S = "${WORKDIR}/gstreamer-${PV}"
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb
new file mode 100644
index 0000000..cb00d31
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_git.bb
@@ -0,0 +1,18 @@
+DEFAULT_PREFERENCE = "-1"
+
+include gstreamer1.0.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=6762ed442b3822387a51c92d928ead0d \
+                    file://gst/gst.h;beginline=1;endline=21;md5=e059138481205ee2c6fc1c079c016d0d"
+
+SRC_URI = "git://anongit.freedesktop.org/gstreamer/gstreamer;branch=master"
+S = "${WORKDIR}/git"
+
+SRCREV = "3b8181a8c550e74acaba4e8c55bdc649fa551dc9"
+
+do_configure_prepend() {
+	cd ${S}
+	./autogen.sh --noconfigure
+	cd ${B}
+}
+
diff --git a/meta/recipes-multimedia/lame/lame/lame-3.99.5_fix_for_automake-1.12.x.patch b/meta/recipes-multimedia/lame/lame/lame-3.99.5_fix_for_automake-1.12.x.patch
new file mode 100644
index 0000000..571a1d0
--- /dev/null
+++ b/meta/recipes-multimedia/lame/lame/lame-3.99.5_fix_for_automake-1.12.x.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Pending
+
+Fix this kind of errors with automake 1.12.x:
+| doc/man/Makefile.am:3: error: automatic de-ANSI-fication support has been removed
+| autoreconf: automake failed with exit status: 1
+
+Signed-Off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/07/13
+
+Index: lame-3.99.5/configure.in
+===================================================================
+--- lame-3.99.5.orig/configure.in
++++ lame-3.99.5/configure.in
+@@ -77,9 +77,6 @@ if test "${GCC}" = "yes"; then
+ 	AC_MSG_RESULT(${GCC_version})
+ fi
+ 
+-dnl more automake stuff
+-AM_C_PROTOTYPES
+-
+ AC_CHECK_HEADER(dmalloc.h)
+ if test "${ac_cv_header_dmalloc_h}" = "yes"; then
+ 	AM_WITH_DMALLOC
+Index: lame-3.99.5/doc/html/Makefile.am
+===================================================================
+--- lame-3.99.5.orig/doc/html/Makefile.am
++++ lame-3.99.5/doc/html/Makefile.am
+@@ -1,6 +1,6 @@
+ ## $Id: Makefile.am,v 1.7 2010/09/30 20:58:40 jaz001 Exp $
+ 
+-AUTOMAKE_OPTIONS = foreign ansi2knr
++AUTOMAKE_OPTIONS = foreign
+ 
+ docdir = $(datadir)/doc
+ pkgdocdir = $(docdir)/$(PACKAGE)
+Index: lame-3.99.5/libmp3lame/i386/Makefile.am
+===================================================================
+--- lame-3.99.5.orig/libmp3lame/i386/Makefile.am
++++ lame-3.99.5/libmp3lame/i386/Makefile.am
+@@ -1,6 +1,6 @@
+ ## $Id: Makefile.am,v 1.26 2011/04/04 09:42:34 aleidinger Exp $
+ 
+-AUTOMAKE_OPTIONS = foreign $(top_srcdir)/ansi2knr
++AUTOMAKE_OPTIONS = foreign
+ 
+ DEFS = @DEFS@ @CONFIG_DEFS@
+ 
+Index: lame-3.99.5/doc/man/Makefile.am
+===================================================================
+--- lame-3.99.5.orig/doc/man/Makefile.am
++++ lame-3.99.5/doc/man/Makefile.am
+@@ -1,6 +1,6 @@
+ ## $Id: Makefile.am,v 1.1 2000/10/22 11:39:44 aleidinger Exp $
+ 
+-AUTOMAKE_OPTIONS = foreign ansi2knr
++AUTOMAKE_OPTIONS = foreign
+ 
+ man_MANS = lame.1
+ EXTRA_DIST = ${man_MANS}
diff --git a/meta/recipes-multimedia/lame/lame/no-gtk1.patch b/meta/recipes-multimedia/lame/lame/no-gtk1.patch
new file mode 100644
index 0000000..e88d7f1
--- /dev/null
+++ b/meta/recipes-multimedia/lame/lame/no-gtk1.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Inappropriate [configuration]
+
+# Acquired from OpenEmbedded
+
+--- lame-3.96.1/configure.in~no-gtk1.patch	2004-07-25 15:52:12.000000000 +0100
++++ lame-3.96.1/configure.in	2004-09-10 15:54:39.000000000 +0100
+@@ -363,7 +363,12 @@
+ 
+ dnl configure use of features
+ 
+-AM_PATH_GTK(1.2.0, HAVE_GTK="yes", HAVE_GTK="no")
++#AM_PATH_GTK(1.2.0, HAVE_GTK="yes", HAVE_GTK="no")
++HAVE_GTK="no"
++GTK_CFLAGS=""
++GTK_LIBS=""
++AC_SUBST(GTK_CFLAGS)
++AC_SUBST(GTK_LIBS)
+
+ dnl ElectricFence malloc debugging
+ AC_MSG_CHECKING(use of ElectricFence malloc debugging)
diff --git a/meta/recipes-multimedia/lame/lame_3.99.5.bb b/meta/recipes-multimedia/lame/lame_3.99.5.bb
new file mode 100644
index 0000000..0477611
--- /dev/null
+++ b/meta/recipes-multimedia/lame/lame_3.99.5.bb
@@ -0,0 +1,30 @@
+SUMMARY = "High quality MP3 audio encoder"
+HOMEPAGE = "http://lame.sourceforge.net/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=290&atid=100290"
+SECTION = "console/utils"
+LICENSE = "LGPLv2+"
+LICENSE_FLAGS = "commercial"
+
+DEPENDS = "ncurses gettext-native"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=c46bda00ffbb0ba1dac22f8d087f54d9 \
+                    file://include/lame.h;beginline=1;endline=20;md5=a2258182c593c398d15a48262130a92b \
+"
+PR = "r1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/lame/lame-${PV}.tar.gz \
+           file://no-gtk1.patch \
+           file://lame-3.99.5_fix_for_automake-1.12.x.patch "
+
+SRC_URI[md5sum] = "84835b313d4a8b68f5349816d33e07ce"
+SRC_URI[sha256sum] = "24346b4158e4af3bd9f2e194bb23eb473c75fb7377011523353196b19b9a23ff"
+
+inherit autotools pkgconfig
+
+PACKAGES += "libmp3lame libmp3lame-dev"
+FILES_${PN} = "${bindir}/lame"
+FILES_libmp3lame = "${libdir}/libmp3lame.so.*"
+FILES_libmp3lame-dev = "${includedir} ${libdir}/*"
+FILES_${PN}-dev = ""
+
+CACHED_CONFIGUREVARS_append_x86 = " ac_cv_header_emmintrin_h=no ac_cv_header_xmmintrin_h=no"
diff --git a/meta/recipes-multimedia/liba52/liba52/buildcleanup.patch b/meta/recipes-multimedia/liba52/liba52/buildcleanup.patch
new file mode 100644
index 0000000..5168100
--- /dev/null
+++ b/meta/recipes-multimedia/liba52/liba52/buildcleanup.patch
@@ -0,0 +1,89 @@
+It makes much more sense to control our own CFLAGS and avoiding fPIC breaks
+some arches too. Assume we know what we're doing and remove all the messing 
+around.
+
+RP 23/2/10
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: a52dec-0.7.4/configure.in
+===================================================================
+--- a52dec-0.7.4.orig/configure.in	2010-02-23 14:51:50.000000000 +0000
++++ a52dec-0.7.4/configure.in	2010-02-23 14:52:36.000000000 +0000
+@@ -14,62 +14,6 @@
+ AC_PROG_CC
+ AC_PROG_GCC_TRADITIONAL
+ 
+-if test x"$GCC" = x"yes"; then
+-
+-    dnl GCC-specific flags - try to optimize them sometime
+-    dnl -Wall -Werror moved to the end to not disturb the configure script
+-
+-    dnl -O3
+-    changequote(<<,>>)
+-    OPT_CFLAGS=`echo "$CFLAGS"|sed "s/-O[0-9]*//g"`
+-    changequote([,])
+-    OPT_CFLAGS="$OPT_CFLAGS -O3"
+-    AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS])
+-
+-    dnl -fomit-frame-pointer
+-    OPT_CFLAGS="$CFLAGS -fomit-frame-pointer"
+-    AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS])
+-
+-    dnl arch-specific flags
+-    case "$host" in
+-    i?86-* | k?-*)
+-	case "$host" in
+-	i386-*) OPT_CFLAGS="$CFLAGS -mcpu=i386";;
+-	i486-*) OPT_CFLAGS="$CFLAGS -mcpu=i486";;
+-	i586-*) OPT_CFLAGS="$CFLAGS -mcpu=pentium";;
+-	i686-*) OPT_CFLAGS="$CFLAGS -mcpu=pentiumpro";;
+-	k6-*)   OPT_CFLAGS="$CFLAGS -mcpu=k6";;
+-	esac
+-	AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
+-    sparc-* | sparc64-*)
+-	OPT_CFLAGS="$CFLAGS -mtune=ultrasparc"
+-	AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
+-    mips-sgi-irix6.*)	dnl do we need to be that specific ?
+-	OPT_CFLAGS="$CFLAGS -mabi=64"
+-	AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
+-    esac
+-elif test x"$CC" = x"tcc" -a x"`$CC -version 2>&1 | grep TenDRA`" != x""; then
+-    dnl TenDRA portability checking compiler
+-    TENDRA=yes
+-    CFLAGS="-Xp -Yansi -f`pwd`/include/tendra.h -DELIDE_CODE"
+-    enable_mlib=no
+-    enable_oss=no
+-    enable_solaris_audio=no
+-elif test x"$CC" = x"icc" -a x"`$CC -V 2>&1 | grep Intel`" != x""; then
+-    dnl Intel C++ compiler
+-    CFLAGS="-g -O3 -unroll -ip"
+-else
+-    dnl non-gcc flags - we probably need exact configuration triplets here.
+-    case "$host" in
+-    mips-sgi-irix6.*)
+-	OPT_CFLAGS="$CFLAGS -64"
+-	AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
+-    sparc-sun-solaris*)
+-	OPT_CFLAGS="$CFLAGS -xCC -fast -xO5"
+-	AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
+-    esac
+-fi
+-
+ dnl Checks for libtool - this must be done after we set cflags
+ AC_DISABLE_SHARED
+ AC_LIBTOOL_WIN32_DLL
+Index: a52dec-0.7.4/liba52/configure.incl
+===================================================================
+--- a52dec-0.7.4.orig/liba52/configure.incl	2010-02-23 14:51:44.000000000 +0000
++++ a52dec-0.7.4/liba52/configure.incl	2010-02-23 14:51:59.000000000 +0000
+@@ -1,9 +1,6 @@
+ AC_SUBST([LIBA52_CFLAGS])
+ AC_SUBST([LIBA52_LIBS])
+ 
+-dnl avoid -fPIC when possible
+-LIBA52_CFLAGS="$LIBA52_CFLAGS -prefer-non-pic"
+-
+ AC_ARG_ENABLE([double],
+     [  --enable-double         use double-precision samples])
+ if test x"$enable_double" = x"yes"; then
diff --git a/meta/recipes-multimedia/liba52/liba52_0.7.4.bb b/meta/recipes-multimedia/liba52/liba52_0.7.4.bb
new file mode 100644
index 0000000..94b66b1
--- /dev/null
+++ b/meta/recipes-multimedia/liba52/liba52_0.7.4.bb
@@ -0,0 +1,23 @@
+SUMMARY = "ATSC A/52 surround sound stream decoder"
+HOMEPAGE = "http://liba52.sourceforge.net/"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
+			file://include/a52.h;beginline=1;endline=12;md5=81152ceb3562bf20a60d1b6018175dd1"
+SECTION = "libs"
+PR = "r4"
+
+inherit autotools
+
+SRC_URI = "http://liba52.sourceforge.net/files/a52dec-${PV}.tar.gz \
+           file://buildcleanup.patch"
+
+SRC_URI[md5sum] = "caa9f5bc44232dc8aeea773fea56be80"
+SRC_URI[sha256sum] = "a21d724ab3b3933330194353687df82c475b5dfb997513eef4c25de6c865ec33"
+S = "${WORKDIR}/a52dec-${PV}"
+
+EXTRA_OECONF = " --enable-shared "
+
+PACKAGES =+ "a52dec a52dec-doc"
+
+FILES_a52dec = " ${bindir}/* "
+FILES_a52dec-doc = " ${mandir}/man1/* "
diff --git a/meta/recipes-multimedia/libav/libav.inc b/meta/recipes-multimedia/libav/libav.inc
new file mode 100644
index 0000000..d3f4b1b
--- /dev/null
+++ b/meta/recipes-multimedia/libav/libav.inc
@@ -0,0 +1,146 @@
+SUMMARY = "Open source audio and video processing tools and librairies"
+DESCRIPTION = "Libav is a friendly and community-driven effort to provide its users \
+               with a set of portable, functional and high-performance libraries for \
+               dealing with multimedia formats of all sorts. It originates from the \
+               FFmpeg codebase, but goes its own way these days, providing its users \
+               with reliable releases and a clear vision how to go forward."
+HOMEPAGE = "http://libav.org/"
+SECTION = "libs"
+
+LICENSE = "GPLv2+"
+LICENSE_FLAGS = "commercial"
+
+LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.GPLv3;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://COPYING.LGPLv2.1;md5=bd7a443320af8c812e4c18d1b79df004 \
+                    file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02"
+
+SRC_URI = "http://libav.org/releases/${BP}.tar.xz"
+
+# Provides ffmpeg compat, see http://libav.org/about.html
+PROVIDES = "ffmpeg"
+
+ARM_INSTRUCTION_SET = "arm"
+
+DEPENDS = "alsa-lib zlib libogg yasm-native"
+
+inherit autotools pkgconfig
+
+B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
+
+FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations -fomit-frame-pointer -O4 -ffast-math"
+BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
+
+EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
+EXTRA_FFCONF ?= ""
+
+PACKAGECONFIG ??= "bzip2 x264 theora ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG[bzip2] = "--enable-bzlib,--disable-bzlib,bzip2"
+PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
+PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
+PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
+PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
+PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
+PACKAGECONFIG[vaapi] = "--enable-vaapi,--disable-vaapi,libva"
+PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
+PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
+PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
+
+# Check codecs that require --enable-nonfree
+USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"
+
+EXTRA_OECONF = " \
+    --enable-shared \
+    --enable-pthreads \
+    --enable-gpl \
+    ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
+    --enable-avfilter \
+    \
+    --cross-prefix=${TARGET_PREFIX} \
+    --prefix=${prefix} \
+    \
+    --enable-avserver \
+    --enable-avplay \
+    --ld="${CCLD}" \
+    --arch=${TARGET_ARCH} \
+    --target-os="linux" \
+    --enable-cross-compile \
+    --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
+    --extra-ldflags="${TARGET_LDFLAGS}" \
+    --sysroot="${STAGING_DIR_TARGET}" \
+    --enable-hardcoded-tables \
+    ${EXTRA_FFCONF} \
+    --libdir=${libdir} \
+    --shlibdir=${libdir} \
+"
+
+do_configure() {
+    # We don't have TARGET_PREFIX-pkgconfig
+    sed -i '/pkg_config_default="${cross_prefix}${pkg_config_default}"/d' ${S}/configure
+    mkdir -p ${B}
+    cd ${B}
+    ${S}/configure ${EXTRA_OECONF}
+    sed -i -e s:Os:O4:g ${B}/config.h
+}
+
+do_install_append() {
+    install -m 0644 ${S}/libavfilter/*.h ${D}${includedir}/libavfilter/
+}
+
+PACKAGES += "${PN}-vhook-dbg ${PN}-vhook ffmpeg-x264-presets"
+PACKAGES_DYNAMIC += "^lib(av(codec|device|filter|format|util)|swscale).*"
+
+RSUGGESTS_${PN} = "mplayer"
+FILES_${PN} = "${bindir}"
+FILES_${PN}-dev = "${includedir}/${PN}"
+
+FILES_${PN}-vhook = "${libdir}/vhook"
+FILES_${PN}-vhook-dbg += "${libdir}/vhook/.debug"
+
+FILES_ffmpeg-x264-presets = "${datadir}/*.avpreset"
+
+LEAD_SONAME = "libavcodec.so"
+
+FILES_${PN}-dev = "${includedir}"
+
+python populate_packages_prepend() {
+    av_libdir = d.expand('${libdir}')
+    av_pkgconfig = d.expand('${libdir}/pkgconfig')
+
+    # Runtime package
+    do_split_packages(d, av_libdir, '^lib(.*)\.so\..*',
+                      output_pattern='lib%s',
+                      description='libav %s library',
+                      extra_depends='',
+                      prepend=True,
+                      allow_links=True)
+
+    # Development packages (-dev, -staticdev)
+    do_split_packages(d, av_libdir, '^lib(.*)\.so$',
+                      output_pattern='lib%s-dev',
+                      description='libav %s development package',
+                      extra_depends='${PN}-dev',
+                      prepend=True,
+                      allow_links=True)
+    do_split_packages(d, av_pkgconfig, '^lib(.*)\.pc$',
+                      output_pattern='lib%s-dev',
+                      description='libav %s development package',
+                      extra_depends='${PN}-dev',
+                      prepend=True)
+    do_split_packages(d, av_libdir, '^lib(.*)\.a$',
+                      output_pattern='lib%s-staticdev',
+                      description='libav %s development package - static library',
+                      extra_depends='${PN}-dev',
+                      prepend=True,
+                      allow_links=True)
+
+    if d.getVar('TARGET_ARCH', True) in [ 'i586', 'i686' ]:
+        # libav can't be build with -fPIC for 32-bit x86
+        pkgs = d.getVar('PACKAGES', True).split()
+        for pkg in pkgs:
+            d.appendVar('INSANE_SKIP_%s' % pkg, ' textrel')
+}
diff --git a/meta/recipes-multimedia/libav/libav/libav-fix-CVE-2014-9676.patch b/meta/recipes-multimedia/libav/libav/libav-fix-CVE-2014-9676.patch
new file mode 100644
index 0000000..1e31caa
--- /dev/null
+++ b/meta/recipes-multimedia/libav/libav/libav-fix-CVE-2014-9676.patch
@@ -0,0 +1,98 @@
+Upstream-Status: Backport
+
+Backport patch to fix CVE-2014-9676.
+
+https://security-tracker.debian.org/tracker/CVE-2014-9676
+https://git.libav.org/?p=libav.git;a=commit;h=b3f04657368a32a9903406395f865e230b1de348
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+From b3f04657368a32a9903406395f865e230b1de348 Mon Sep 17 00:00:00 2001
+From: Luca Barbato <lu_zero@gentoo.org>
+Date: Mon, 5 Jan 2015 10:40:41 +0100
+Subject: [PATCH] segment: Fix the failure paths
+
+A failure in segment_end() or segment_start() would lead to freeing
+a dangling pointer and in general further calls to seg_write_packet()
+or to seg_write_trailer() would have the same faulty behaviour.
+
+CC: libav-stable@libav.org
+Reported-By: luodalongde@gmail.com
+---
+ libavformat/segment.c | 32 ++++++++++++++++++++------------
+ 1 file changed, 20 insertions(+), 12 deletions(-)
+
+diff --git a/libavformat/segment.c b/libavformat/segment.c
+index 52da6b9..bcfd1f9 100644
+--- a/libavformat/segment.c
++++ b/libavformat/segment.c
+@@ -184,6 +184,13 @@ static void close_null_ctx(AVIOContext *pb)
+     av_free(pb);
+ }
+ 
++static void seg_free_context(SegmentContext *seg)
++{
++    avio_closep(&seg->pb);
++    avformat_free_context(seg->avf);
++    seg->avf = NULL;
++}
++
+ static int seg_write_header(AVFormatContext *s)
+ {
+     SegmentContext *seg = s->priv_data;
+@@ -265,12 +272,9 @@ static int seg_write_header(AVFormatContext *s)
+     }
+ 
+ fail:
+-    if (ret) {
+-        if (seg->list)
+-            avio_close(seg->pb);
+-        if (seg->avf)
+-            avformat_free_context(seg->avf);
+-    }
++    if (ret < 0)
++        seg_free_context(seg);
++
+     return ret;
+ }
+ 
+@@ -282,6 +286,9 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
+     int64_t end_pts = seg->recording_time * seg->number;
+     int ret, can_split = 1;
+ 
++    if (!oc)
++        return AVERROR(EINVAL);
++
+     if (seg->has_video) {
+         can_split = st->codec->codec_type == AVMEDIA_TYPE_VIDEO &&
+                     pkt->flags & AV_PKT_FLAG_KEY;
+@@ -322,11 +329,8 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
+     ret = ff_write_chained(oc, pkt->stream_index, pkt, s);
+ 
+ fail:
+-    if (ret < 0) {
+-        if (seg->list)
+-            avio_close(seg->pb);
+-        avformat_free_context(oc);
+-    }
++    if (ret < 0)
++        seg_free_context(seg);
+ 
+     return ret;
+ }
+@@ -335,7 +339,11 @@ static int seg_write_trailer(struct AVFormatContext *s)
+ {
+     SegmentContext *seg = s->priv_data;
+     AVFormatContext *oc = seg->avf;
+-    int ret;
++    int ret = 0;
++
++    if (!oc)
++        goto fail;
++
+     if (!seg->write_header_trailer) {
+         if ((ret = segment_end(oc, 0)) < 0)
+             goto fail;
+-- 
+2.4.1.314.g9532ead
+
diff --git a/meta/recipes-multimedia/libav/libav_9.18.bb b/meta/recipes-multimedia/libav/libav_9.18.bb
new file mode 100644
index 0000000..210a649
--- /dev/null
+++ b/meta/recipes-multimedia/libav/libav_9.18.bb
@@ -0,0 +1,6 @@
+require libav.inc
+
+SRC_URI[md5sum] = "75e838068a75fb88e1b4ea0546bc16f0"
+SRC_URI[sha256sum] = "0875e835da683eef1a7bac75e1884634194149d7479d1538ba9fbe1614d066d7"
+
+SRC_URI += "file://libav-fix-CVE-2014-9676.patch"
diff --git a/meta/recipes-multimedia/libav/libpostproc_git.bb b/meta/recipes-multimedia/libav/libpostproc_git.bb
new file mode 100644
index 0000000..4aaa50f
--- /dev/null
+++ b/meta/recipes-multimedia/libav/libpostproc_git.bb
@@ -0,0 +1,47 @@
+SUMMARY = "FFmpeg derived postprocessing library"
+HOMEPAGE = "http://git.videolan.org/?p=libpostproc.git;a=summary"
+SECTION = "libs"
+DEPENDS = "libav"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+# because it depends on libav which has commercial flag
+LICENSE_FLAGS = "commercial"
+
+PV = "52.3.0+git${SRCPV}"
+
+SRCREV = "811db3b957dfde24aef2d0f82e297e5bf552d873"
+SRC_URI = "git://github.com/lu-zero/postproc;protocol=https"
+
+S = "${WORKDIR}/git"
+
+inherit autotools lib_package pkgconfig
+
+FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations -fomit-frame-pointer -O4 -ffast-math"
+BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
+
+EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
+EXTRA_FFCONF ?= ""
+
+EXTRA_OECONF = " \
+    --enable-shared \
+    --enable-pthreads \
+    --enable-gpl \
+    --enable-postproc \
+    \
+    --cross-prefix=${TARGET_PREFIX} \
+    --prefix=${prefix} \
+    \
+    --arch=${TARGET_ARCH} \
+    --target-os="linux" \
+    --enable-cross-compile \
+    --extra-cflags="${TARGET_CFLAGS} ${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS}" \
+    --extra-ldflags="${TARGET_LDFLAGS}" \
+    --sysroot="${STAGING_DIR_TARGET}" \
+    --shlibdir="${libdir}" \
+    ${EXTRA_FFCONF} \
+"
+
+do_configure() {
+    ${S}/configure ${EXTRA_OECONF}
+}
diff --git a/meta/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch b/meta/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch
new file mode 100644
index 0000000..38d40c3
--- /dev/null
+++ b/meta/recipes-multimedia/libid3tag/libid3tag/addpkgconfig.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: libid3tag-0.15.1b/Makefile.am
+===================================================================
+--- libid3tag-0.15.1b.orig/Makefile.am	2009-07-29 09:29:20.000000000 +0100
++++ libid3tag-0.15.1b/Makefile.am	2009-07-29 09:29:47.000000000 +0100
+@@ -27,6 +27,9 @@
+ lib_LTLIBRARIES =	libid3tag.la
+ include_HEADERS =	id3tag.h
+ 
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = id3tag.pc
++
+ ## From the libtool documentation on library versioning:
+ ##
+ ## CURRENT
+Index: libid3tag-0.15.1b/configure.ac
+===================================================================
+--- libid3tag-0.15.1b.orig/configure.ac	2009-07-29 09:27:15.000000000 +0100
++++ libid3tag-0.15.1b/configure.ac	2009-07-29 09:27:45.000000000 +0100
+@@ -201,5 +201,5 @@
+ dnl AC_SUBST(LTLIBOBJS)
+ 
+ AC_CONFIG_FILES([Makefile msvc++/Makefile  \
+-	libid3tag.list])
++	libid3tag.list id3tag.pc])
+ AC_OUTPUT
+Index: libid3tag-0.15.1b/id3tag.pc.in
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ libid3tag-0.15.1b/id3tag.pc.in	2009-07-29 09:29:10.000000000 +0100
+@@ -0,0 +1,11 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: id3tag
++Description: ID3 tag reading library
++Requires:
++Version: @VERSION@
++Libs: -L${libdir} -lid3tag -lz
++Cflags: -I${includedir}
diff --git a/meta/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch b/meta/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch
new file mode 100644
index 0000000..2845fb1
--- /dev/null
+++ b/meta/recipes-multimedia/libid3tag/libid3tag/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [https://sourceforge.net/tracker/?func=detail&aid=3599280&group_id=12349&atid=112349]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd libid3tag-0.15.1b/configure.ac libid3tag-0.15.1b/configure.ac
+--- libid3tag-0.15.1b/configure.ac	2004-01-24 01:22:46.000000000 +0200
++++ libid3tag-0.15.1b/configure.ac	2013-01-03 06:41:02.734835014 +0200
+@@ -28,7 +28,7 @@
+
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
+
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ dnl System type.
diff --git a/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb b/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb
new file mode 100644
index 0000000..05a8a47
--- /dev/null
+++ b/meta/recipes-multimedia/libid3tag/libid3tag_0.15.1b.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Library for interacting with ID3 tags in MP3 files"
+HOMEPAGE = "http://sourceforge.net/projects/mad/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=12349&atid=112349"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+			file://COPYRIGHT;md5=5e6279efb87c26c6e5e7a68317a6a87a \
+			file://version.h;beginline=1;endline=8;md5=86ac68b67f054b7afde9e149bbc3fe63"
+SECTION = "libs"
+DEPENDS = "zlib gperf-native"
+PR = "r7"
+
+SRC_URI = "ftp://ftp.mars.org/pub/mpeg/libid3tag-${PV}.tar.gz \
+           file://addpkgconfig.patch \
+           file://obsolete_automake_macros.patch \
+"
+
+SRC_URI[md5sum] = "e5808ad997ba32c498803822078748c3"
+SRC_URI[sha256sum] = "63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151"
+
+S = "${WORKDIR}/libid3tag-${PV}"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-multimedia/libmad/libmad/add-pkgconfig.patch b/meta/recipes-multimedia/libmad/libmad/add-pkgconfig.patch
new file mode 100644
index 0000000..b49dc8c
--- /dev/null
+++ b/meta/recipes-multimedia/libmad/libmad/add-pkgconfig.patch
@@ -0,0 +1,70 @@
+Here is a patch for adding pkg-config support to libmad.
+It would make life a bit easier for distro maintainers if this was applied.
+In case you didn't know, pkg-config is a tool for providing LDFLAGS and
+CFLAGS for packages using shared libraries. It's on freedesktop.org.
+Debian has already been distributing the pkg-config file mad.pc with
+libmad for some time, and people developing on debian (notably xmms2 
+developers) have started relying on this support being present, causing
+some confusion for people installing from source and on some BSDs which
+do not provide mad.pc (google: pkgconfig libmad).
+
+EMH
+
+Upstream-Status: Inappropriate [configuration]
+
+--h31gzZEtNLTqOjlF
+Content-Type: text/plain; charset=us-ascii
+Content-Disposition: attachment; filename=&quot;libmad-0.15.1b-pkgconfig.patch&quot;
+
+diff -Naur libmad-0.15.1b.old/configure.ac libmad-0.15.1b/configure.ac
+--- libmad-0.15.1b.old/configure.ac	2004-01-23 10:41:32.000000000 +0100
++++ libmad-0.15.1b/configure.ac	2004-08-07 02:25:24.633462168 +0200
+@@ -429,5 +429,5 @@
+ dnl AC_SUBST(LTLIBOBJS)
+ 
+ AC_CONFIG_FILES([Makefile msvc++/Makefile  \
+-	libmad.list])
++	libmad.list mad.pc])
+ AC_OUTPUT
+diff -Naur libmad-0.15.1b.old/mad.pc.in libmad-0.15.1b/mad.pc.in
+--- libmad-0.15.1b.old/mad.pc.in	1970-01-01 01:00:00.000000000 +0100
++++ libmad-0.15.1b/mad.pc.in	2004-08-07 02:04:59.617692872 +0200
+@@ -0,0 +1,14 @@
++# libmad pkg-config source file
++
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: mad
++Description: MPEG Audio Decoder
++Version: @VERSION@
++Requires:
++Conflicts:
++Libs: -L${libdir} -lmad -lm
++Cflags: -I${includedir}
+diff -Naur libmad-0.15.1b.old/Makefile.am libmad-0.15.1b/Makefile.am
+--- libmad-0.15.1b.old/Makefile.am	2004-02-17 03:02:03.000000000 +0100
++++ libmad-0.15.1b/Makefile.am	2004-08-07 02:03:19.859858368 +0200
+@@ -24,6 +24,9 @@
+ SUBDIRS =		
+ DIST_SUBDIRS =		msvc++
+ 
++pkgconfigdir =		$(libdir)/pkgconfig
++pkgconfig_DATA =	mad.pc
++
+ lib_LTLIBRARIES =	libmad.la
+ include_HEADERS =	mad.h
+ 
+@@ -34,7 +37,8 @@
+ minimad_LDADD =		libmad.la
+ 
+ EXTRA_DIST =		mad.h.sed  \
+-			CHANGES COPYRIGHT CREDITS README TODO VERSION
++			CHANGES COPYRIGHT CREDITS README TODO VERSION \
++			mad.pc.in
+ 
+ exported_headers =	version.h fixed.h bit.h timer.h stream.h frame.h  \
+ 			synth.h decoder.h
+
diff --git a/meta/recipes-multimedia/libmad/libmad/automake-foreign.patch b/meta/recipes-multimedia/libmad/libmad/automake-foreign.patch
new file mode 100644
index 0000000..3e54424
--- /dev/null
+++ b/meta/recipes-multimedia/libmad/libmad/automake-foreign.patch
@@ -0,0 +1,12 @@
+Pass foreign to AM_INIT_AUTOMAKE so it doesn't enforce GNU strictness.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/configure.ac b/configure.ac
+index e602fd3..e075b86 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -29 +29 @@ AC_CONFIG_SRCDIR([decoder.h])
+-AM_INIT_AUTOMAKE
++AM_INIT_AUTOMAKE([foreign])
diff --git a/meta/recipes-multimedia/libmad/libmad/fix_for_mips_with_gcc-4.5.0.patch b/meta/recipes-multimedia/libmad/libmad/fix_for_mips_with_gcc-4.5.0.patch
new file mode 100644
index 0000000..01c7aa3
--- /dev/null
+++ b/meta/recipes-multimedia/libmad/libmad/fix_for_mips_with_gcc-4.5.0.patch
@@ -0,0 +1,33 @@
+gcc 4.4 did this: The MIPS port no longer recognizes the h  asm constraint. It was necessary to remove this constraint in order to avoid generating unpredictable code sequences. 
+
+so the libmad build with gcc-4.5.0 was failing.
+
+Found a solution here:
+
+http://us.generation-nt.com/answer/bug-568418-libmad0-dev-mpg321-compilation-errors-mips-mipsel-architectures-help-169033451.html
+
+Upstream-Status: Pending
+
+2010/07/29
+Nitin A Kamble <nitin.a.kamble@intel.com>
+
+Index: libmad-0.15.1b/fixed.h
+===================================================================
+--- libmad-0.15.1b.orig/fixed.h
++++ libmad-0.15.1b/fixed.h
+@@ -297,6 +297,15 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t
+ 
+ /* --- MIPS ---------------------------------------------------------------- */
+ 
++# elif defined(FPM_MIPS) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
++    typedef unsigned int u64_di_t __attribute__ ((mode (DI)));
++#   define MAD_F_MLX(hi, lo, x, y) \
++    do { \
++        u64_di_t __ll = (u64_di_t) (x) * (y); \
++        hi = __ll >> 32; \
++        lo = __ll; \
++     } while (0)
++
+ # elif defined(FPM_MIPS)
+ 
+ /*
diff --git a/meta/recipes-multimedia/libmad/libmad/no-force-mem.patch b/meta/recipes-multimedia/libmad/libmad/no-force-mem.patch
new file mode 100644
index 0000000..d5e6d20
--- /dev/null
+++ b/meta/recipes-multimedia/libmad/libmad/no-force-mem.patch
@@ -0,0 +1,18 @@
+This option no longer exists in gcc 3.4.1
+
+RP - 18/07/2008
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: libmad-0.15.1b/configure.ac
+===================================================================
+--- libmad-0.15.1b.orig/configure.ac	2008-07-18 15:45:30.000000000 +0100
++++ libmad-0.15.1b/configure.ac	2008-07-18 15:45:37.000000000 +0100
+@@ -140,7 +140,6 @@
+     case "$optimize" in
+ 	-O|"-O "*)
+ 	    optimize="-O"
+-	    optimize="$optimize -fforce-mem"
+ 	    optimize="$optimize -fforce-addr"
+ 	    : #x optimize="$optimize -finline-functions"
+ 	    : #- optimize="$optimize -fstrength-reduce"
diff --git a/meta/recipes-multimedia/libmad/libmad/obsolete_automake_macros.patch b/meta/recipes-multimedia/libmad/libmad/obsolete_automake_macros.patch
new file mode 100644
index 0000000..cc87d29
--- /dev/null
+++ b/meta/recipes-multimedia/libmad/libmad/obsolete_automake_macros.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Submitted [https://sourceforge.net/tracker/?group_id=12349&atid=112349]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd libmad-0.15.1b/configure.ac libmad-0.15.1b/configure.ac
+--- libmad-0.15.1b/configure.ac	2004-01-23 11:41:32.000000000 +0200
++++ libmad-0.15.1b/configure.ac	2013-01-03 08:28:23.718693697 +0200
+@@ -28,7 +28,7 @@
+
+ AM_INIT_AUTOMAKE
+
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ dnl System type.
diff --git a/meta/recipes-multimedia/libmad/libmad_0.15.1b.bb b/meta/recipes-multimedia/libmad/libmad_0.15.1b.bb
new file mode 100644
index 0000000..9e08b16
--- /dev/null
+++ b/meta/recipes-multimedia/libmad/libmad_0.15.1b.bb
@@ -0,0 +1,38 @@
+SUMMARY = "MPEG Audio Decoder library"
+HOMEPAGE = "http://sourceforge.net/projects/mad/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=12349&atid=112349"
+LICENSE = "GPLv2+"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+			file://COPYRIGHT;md5=8e55eb14894e782b84488d5a239bc23d \
+			file://version.h;beginline=1;endline=8;md5=aa07311dd39288d4349f28e1de516454"
+SECTION = "libs"
+DEPENDS = "libid3tag"
+PR = "r3"
+
+SRC_URI = "ftp://ftp.mars.org/pub/mpeg/libmad-${PV}.tar.gz \
+           file://no-force-mem.patch \
+           file://add-pkgconfig.patch \
+           file://fix_for_mips_with_gcc-4.5.0.patch \
+           file://obsolete_automake_macros.patch \
+           file://automake-foreign.patch \
+"
+
+SRC_URI[md5sum] = "1be543bc30c56fb6bea1d7bf6a64e66c"
+SRC_URI[sha256sum] = "bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690" 
+
+S = "${WORKDIR}/libmad-${PV}"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "-enable-speed --enable-shared"
+# The ASO's don't take any account of thumb...
+EXTRA_OECONF_append_thumb = " --disable-aso --enable-fpm=default"
+EXTRA_OECONF_append_arm = " --enable-fpm=arm"
+
+do_configure_prepend () {
+#	damn picky automake...
+	touch NEWS AUTHORS ChangeLog
+}
+
+ARM_INSTRUCTION_SET = "arm"
diff --git a/meta/recipes-multimedia/libogg/libogg_1.3.2.bb b/meta/recipes-multimedia/libogg/libogg_1.3.2.bb
new file mode 100644
index 0000000..0142e0f
--- /dev/null
+++ b/meta/recipes-multimedia/libogg/libogg_1.3.2.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Ogg bitstream and framing libary"
+DESCRIPTION = "libogg is the bitstream and framing library \
+for the Ogg project. It provides functions which are \
+necessary to codec libraries like libvorbis."
+HOMEPAGE = "http://xiph.org/"
+BUGTRACKER = "https://trac.xiph.org/newticket"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=db1b7a668b2a6f47b2af88fb008ad555 \
+                    file://include/ogg/ogg.h;beginline=1;endline=11;md5=eda812856f13a3b1326eb8f020cc3b0b"
+
+SRC_URI = "http://downloads.xiph.org/releases/ogg/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "5c3a34309d8b98640827e5d0991a4015"
+SRC_URI[sha256sum] = "3f687ccdd5ac8b52d76328fbbfebc70c459a40ea891dbf3dccb74a210826e79b"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-multimedia/libomxil/libomxil-0.9.3/configure-fix.patch b/meta/recipes-multimedia/libomxil/libomxil-0.9.3/configure-fix.patch
new file mode 100644
index 0000000..876e80e
--- /dev/null
+++ b/meta/recipes-multimedia/libomxil/libomxil-0.9.3/configure-fix.patch
@@ -0,0 +1,58 @@
+To enable --disable-Werror for libomxil to avoid some compilers which check code strictly.
+
+For example, at least the following errors happened to some compilers:
+
+1) OMX_INDEXTYPE in include/OMX_Index.h IS NOT OMX_INDEXVENDORTYPE in src/base/omx_base_component.h
+| i586-poky-linux-libtool: compile:  i586-poky-linux-gcc -m32 -march=i586 --sysroot=/home/yocto-build5/poky/build/tmp/sysroots/qemux86 -DHAVE_Climinate-unused-debug-types -Wall -Werror -DCONFIG_DEBUG_LEVEL=0 -c OMXComponentRMExt.c  -fPIC -DPIC -o .libs/libomxbase_la-OMXComponentRMExt.o
+| omx_base_component.c: In function 'omx_base_component_GetParameter':
+| omx_base_component.c:991:3: error: case value '2130706435' not in enumerated type 'OMX_INDEXTYPE' [-Werror=switch]
+| omx_base_component.c:918:3: error: case value '2130706436' not in enumerated type 'OMX_INDEXTYPE' [-Werror=switch]
+
+2)
+| i586-poky-linux-gcc  -m32   -march=i586 --sysroot=/home/yocto-build5/poky/build/tmp/sysroots/qemux86 -DHAVE_CONFIG_H -I. -I..    -DOMXILCOMPOminate-unused-debug-types -Wall -Werror -DCONFIG_DEBUG_LEVEL=0 -c -o omxregister_bellagio-omxregister.o `test -f 'omxregister.c' || echo './'`o
+| omxregister.c: In function 'buildComponentsList':
+| omxregister.c:175:7: error: variable 'err' set but not used [-Werror=unused-but-set-variable]
+| cc1: all warnings being treated as errors
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+
+diff -r 82d742d3ea90 configure.ac
+--- a/configure.ac	Tue Dec 27 15:30:35 2011 +0800
++++ b/configure.ac	Tue Dec 27 16:26:03 2011 +0800
+@@ -5,7 +5,7 @@
+ AC_PREREQ([2.59])
+ 
+ AC_CONFIG_HEADERS([config.h])
+-CFLAGS="${CFLAGS} -Wall -Werror"
++CFLAGS="${CFLAGS} -Wall"
+ 
+ ################################################################################
+ # Set the shared versioning info, according to section 6.3 of the libtool info #
+@@ -122,6 +122,14 @@
+     [with_android=$enableval],
+     [with_android=no])
+ 
++AC_ARG_ENABLE(
++    [Werror],
++    [AC_HELP_STRING(
++        [--disable-Werror],
++        [whether to diable treating gcc warnings as errors])],
++    [with_Werror=$enableval],
++    [with_Werror=yes])
++
+ ################################################################################
+ # Check for programs                                                           #
+ ################################################################################
+@@ -193,6 +201,10 @@
+  CFG_DEBUG_LEVEL=255
+ fi
+ 
++if test "x$with_Werror" = "xyes"; then
++ CFLAGS="${CFLAGS} -Werror"
++fi
++
+ AC_SUBST(CFG_DEBUG_LEVEL)
+ CFLAGS="${CFLAGS} -DCONFIG_DEBUG_LEVEL=$CFG_DEBUG_LEVEL"
+ 
diff --git a/meta/recipes-multimedia/libomxil/libomxil-0.9.3/disable-so-versioning.patch b/meta/recipes-multimedia/libomxil/libomxil-0.9.3/disable-so-versioning.patch
new file mode 100644
index 0000000..f408e4a
--- /dev/null
+++ b/meta/recipes-multimedia/libomxil/libomxil-0.9.3/disable-so-versioning.patch
@@ -0,0 +1,36 @@
+Disable so versioning since they are really not a versioned shared lib.
+
+Upstream-Status: Submitted @ https://sourceforge.net/p/omxil/bugs/59/
+
+Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
+
+diff -rub libomxil-bellagio-0.9.3-orig/src/components/audio_effects/Makefile.am libomxil-bellagio-0.9.3/src/components/audio_effects/Makefile.am
+--- libomxil-bellagio-0.9.3-orig/src/components/audio_effects/Makefile.am	2014-07-20 15:22:00.858425234 -0400
++++ libomxil-bellagio-0.9.3/src/components/audio_effects/Makefile.am	2014-07-20 15:25:42.687525225 -0400
+@@ -10,4 +10,5 @@
+ libomxaudio_effects_la_CFLAGS = -I$(top_srcdir)/include \
+ 				-I$(top_srcdir)/src \
+ 				-I$(top_srcdir)/src/base
++libomxaudio_effects_la_LDFLAGS = -avoid-version
+ 
+diff -rub libomxil-bellagio-0.9.3-orig/src/components/clocksrc/Makefile.am libomxil-bellagio-0.9.3/src/components/clocksrc/Makefile.am
+--- libomxil-bellagio-0.9.3-orig/src/components/clocksrc/Makefile.am	2014-07-20 15:22:00.858425234 -0400
++++ libomxil-bellagio-0.9.3/src/components/clocksrc/Makefile.am	2014-07-20 15:24:49.151259753 -0400
+@@ -10,4 +10,4 @@
+                              -I$(top_srcdir)/include \
+                              -I$(top_srcdir)/src \
+                              -I$(top_srcdir)/src/base
+-
++libomxclocksrc_la_LDFLAGS = -avoid-version
+diff -rub libomxil-bellagio-0.9.3-orig/src/components/videoscheduler/Makefile.am libomxil-bellagio-0.9.3/src/components/videoscheduler/Makefile.am
+--- libomxil-bellagio-0.9.3-orig/src/components/videoscheduler/Makefile.am	2014-07-20 15:22:00.862425254 -0400
++++ libomxil-bellagio-0.9.3/src/components/videoscheduler/Makefile.am	2014-07-20 15:22:36.462601786 -0400
+@@ -6,7 +6,7 @@
+ 								library_entry_point.c
+ 
+ libomxvideosched_la_LIBADD = $(top_builddir)/src/libomxil-bellagio.la
+-libomxvideosched_la_LDFLAGS = 
++libomxvideosched_la_LDFLAGS = -avoid-version
+ libomxvideosched_la_CFLAGS = -I$(top_srcdir)/include \
+ 			-I$(top_srcdir)/src \
+ 			-I$(top_srcdir)/src/base
diff --git a/meta/recipes-multimedia/libomxil/libomxil-0.9.3/dynamicloader-linking.patch b/meta/recipes-multimedia/libomxil/libomxil-0.9.3/dynamicloader-linking.patch
new file mode 100644
index 0000000..787953a
--- /dev/null
+++ b/meta/recipes-multimedia/libomxil/libomxil-0.9.3/dynamicloader-linking.patch
@@ -0,0 +1,20 @@
+This patch fixes link issue when libomxdynamicloader.so is loaded :
+Missing symbol RM_Deinit.
+
+This patch comes from "http://pkgs.fedoraproject.org/cgit/libomxil-bellagio.git/commit/?h=f17&id=4996a95828943d345e51ded6876c3103653eecf8"
+
+Upstream-Status: Pending
+
+Signed-off-by: Sébastien Mennetrier <s.mennetrier@innotis.org>
+
+--- a/src/dynamic_loader/Makefile.am	2014-02-25 15:29:10.128549636 +0100
++++ b/src/dynamic_loader/Makefile.am	2014-02-25 15:30:15.756548808 +0100
+@@ -3,7 +3,7 @@
+ omxdynamicloader_LTLIBRARIES = libomxdynamicloader.la
+ libomxdynamicloader_la_SOURCES = ste_dynamic_component_loader.c ste_dynamic_component_loader.h
+ 
+-libomxdynamicloader_la_LDFLAGS =
++libomxdynamicloader_la_LDFLAGS = -lomxil-bellagio -L$(top_builddir)/src/.libs
+ libomxdynamicloader_la_CFLAGS = -I$(top_srcdir)/include \
+ 			-I$(top_srcdir)/src \
+ 			-I$(top_srcdir)/src/base \
diff --git a/meta/recipes-multimedia/libomxil/libomxil-0.9.3/makefile-docdir-fix.patch b/meta/recipes-multimedia/libomxil/libomxil-0.9.3/makefile-docdir-fix.patch
new file mode 100644
index 0000000..dbe8c41
--- /dev/null
+++ b/meta/recipes-multimedia/libomxil/libomxil-0.9.3/makefile-docdir-fix.patch
@@ -0,0 +1,19 @@
+This patch is to remove DESTDIR in docdir.
+Otherwise, when users install by running `make install DESTDIR=/alternate/directory' specified in the file INSTALL, the doc will go into /alternate/directory/alternate/directory, which is not expected.
+
+Upstream-Status: Pending
+
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+
+diff -r 30b597e4e70d Makefile.am
+--- a/Makefile.am	Wed Dec 28 15:38:35 2011 +0800
++++ b/Makefile.am	Wed Dec 28 15:39:25 2011 +0800
+@@ -7,7 +7,7 @@
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = libomxil-bellagio.pc
+ 
+-docdir = $(DESTDIR)$(prefix)/share/doc/@PACKAGE@
++docdir = $(prefix)/share/doc/@PACKAGE@
+ doc_DATA = README \
+ 	   ChangeLog \
+ 	   TODO
diff --git a/meta/recipes-multimedia/libomxil/libomxil-0.9.3/parallel-make.patch b/meta/recipes-multimedia/libomxil/libomxil-0.9.3/parallel-make.patch
new file mode 100644
index 0000000..483ca13
--- /dev/null
+++ b/meta/recipes-multimedia/libomxil/libomxil-0.9.3/parallel-make.patch
@@ -0,0 +1,18 @@
+This patch is to make libomxil Makefile support "make -jN".
+The omxregister_bellagio stuffs depend on libomxil_bellagio library.
+
+Upstream-Status: Pending
+
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+
+diff -r f59d077d3dd5 Makefile.am
+--- a/src/Makefile.am	Wed Dec 28 10:54:36 2011 +0800
++++ b/src/Makefile.am	Wed Dec 28 10:55:46 2011 +0800
+@@ -7,6 +7,7 @@
+ omxregister_bellagio_SOURCES = omxregister.c common.c common.h
+ omxregister_bellagio_CFLAGS = -DOMXILCOMPONENTSPATH=\"$(plugindir)/\" \
+ 			      -I$(top_srcdir)/include
++omxregister_bellagio_LDADD = $(lib_LTLIBRARIES)
+ omxregister_bellagio_LDFLAGS = -lomxil-bellagio -L$(builddir)
+ 
+ lib_LTLIBRARIES = libomxil-bellagio.la
diff --git a/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb b/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb
new file mode 100644
index 0000000..40d6df8
--- /dev/null
+++ b/meta/recipes-multimedia/libomxil/libomxil_0.9.3.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Bellagio OpenMAX Integration Layer (IL)"
+DESCRIPTION = "Bellagio is an opensource implementation of the Khronos OpenMAX \
+               Integration Layer API to access multimedia components."
+HOMEPAGE = "http://omxil.sourceforge.net/"
+
+LICENSE = "LGPLv2.1+"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ae6f0f4dbc7ac193b50f323a6ae191cb \
+                    file://src/omxcore.h;beginline=1;endline=27;md5=806b1e5566c06486fe8e42b461e03a90"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/omxil/libomxil-bellagio-${PV}.tar.gz \
+           file://configure-fix.patch \
+           file://parallel-make.patch \
+           file://makefile-docdir-fix.patch \
+           file://dynamicloader-linking.patch \
+           file://disable-so-versioning.patch"
+
+SRC_URI[md5sum] = "a1de827fdb75c02c84e55f740ca27cb8"
+SRC_URI[sha256sum] = "593c0729c8ef8c1467b3bfefcf355ec19a46dd92e31bfc280e17d96b0934d74c"
+
+S = "${WORKDIR}/${BPN}-bellagio-${PV}"
+
+inherit autotools
+
+EXTRA_OECONF += "--disable-doc --disable-Werror"
+
+#
+# The .so files under ${libdir}/bellagio are not intended to be versioned and symlinked.
+# Make sure they get packaged in the main package.
+#
+FILES_${PN} += "${libdir}/bellagio/*.so \
+                ${libdir}/omxloaders/*${SOLIBS}"
+FILES_${PN}-staticdev += "${libdir}/bellagio/*.a \
+                          ${libdir}/omxloaders/*.a"
+FILES_${PN}-dev += "${libdir}/bellagio/*.la \
+                    ${libdir}/omxloaders/*.la \
+                    ${libdir}/omxloaders/*${SOLIBSDEV}"
+FILES_${PN}-dbg += "${libdir}/bellagio/.debug/ \
+                    ${libdir}/omxloaders/.debug/"
diff --git a/meta/recipes-multimedia/libpng/libpng_1.6.17.bb b/meta/recipes-multimedia/libpng/libpng_1.6.17.bb
new file mode 100644
index 0000000..00e5808
--- /dev/null
+++ b/meta/recipes-multimedia/libpng/libpng_1.6.17.bb
@@ -0,0 +1,27 @@
+SUMMARY = "PNG image format decoding library"
+HOMEPAGE = "http://www.libpng.org/"
+SECTION = "libs"
+LICENSE = "Libpng"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=b9b75399b72e4a8656cf3a6ddfc86d9a \
+                    file://png.h;endline=16;md5=cc9c2d1eafda17e1277a6f99a9fc29c4 \
+                    file://png.h;beginline=242;endline=356;md5=599316819d525dde2bfdf28fe3f323af"
+DEPENDS = "zlib"
+LIBV = "16"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/libpng/libpng${LIBV}/${PV}/libpng-${PV}.tar.xz \
+          "
+SRC_URI[md5sum] = "430a9b76b78533235cd4b9b26ce75c7e"
+SRC_URI[sha256sum] = "98507b55fbe5cd43c51981f2924e4671fd81fe35d52dc53357e20f2c77fa5dfd"
+
+BINCONFIG = "${bindir}/libpng-config ${bindir}/libpng16-config"
+
+inherit autotools binconfig-disabled pkgconfig
+
+# Work around missing symbols
+EXTRA_OECONF_append_class-target = " ${@bb.utils.contains("TUNE_FEATURES", "neon", "--enable-arm-neon=on", "--enable-arm-neon=off" ,d)}"
+
+PACKAGES =+ "${PN}-tools"
+
+FILES_${PN}-tools = "${bindir}/png-fix-itxt ${bindir}/pngfix"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.8.bb b/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.8.bb
new file mode 100644
index 0000000..f06935c
--- /dev/null
+++ b/meta/recipes-multimedia/libsamplerate/libsamplerate0_0.1.8.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Audio Sample Rate Conversion library"
+HOMEPAGE = "http://www.mega-nerd.com/SRC/"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://src/samplerate.c;beginline=1;endline=17;md5=d0807c35fc906466d24a50463534815a"
+DEPENDS = "flac libsndfile1"
+PR = "r1"
+
+SRC_URI = "http://www.mega-nerd.com/SRC/libsamplerate-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "1c7fb25191b4e6e3628d198a66a84f47"
+SRC_URI[sha256sum] = "93b54bdf46d5e6d2354b7034395fe329c222a966790de34520702bb9642f1c06"
+S = "${WORKDIR}/libsamplerate-${PV}"
+
+inherit autotools pkgconfig
+
+PACKAGECONFIG[fftw] = ",--disable-fftw,fftw"
diff --git a/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-segfault-in-SD2-RSRC-parser.patch b/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-segfault-in-SD2-RSRC-parser.patch
new file mode 100644
index 0000000..cd48710
--- /dev/null
+++ b/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-segfault-in-SD2-RSRC-parser.patch
@@ -0,0 +1,211 @@
+From 9341e9c6e70cd3ad76c901c3cf052d4cb52fd827 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Thu, 27 Jun 2013 18:04:03 +1000
+Subject: [PATCH] src/sd2.c : Fix segfault in SD2 RSRC parser.
+
+(Upstream commit 9341e9c6e70cd3ad76c901c3cf052d4cb52fd827)
+
+A specially crafted resource fork for an SD2 file can cause
+the SD2 RSRC parser to read data from outside a dynamically
+defined buffer. The data that is read is converted into a
+short or int and used during further processing.
+
+Since no write occurs, this is unlikely to be exploitable.
+
+Bug reported by The Mayhem Team from Cylab, Carnegie Mellon
+Univeristy. Paper is:
+http://users.ece.cmu.edu/~arebert/papers/mayhem-oakland-12.pdf
+
+Upstream-Status: Backport
+
+Signed-off-by: Yue Tao <yue.tao@windriver.com>
+---
+ src/sd2.c |   93 ++++++++++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 55 insertions(+), 38 deletions(-)
+
+diff --git a/src/sd2.c b/src/sd2.c
+index 35ce36b..6be150c 100644
+--- a/src/sd2.c
++++ b/src/sd2.c
+@@ -1,5 +1,5 @@
+ /*
+-** Copyright (C) 2001-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
++** Copyright (C) 2001-2013 Erik de Castro Lopo <erikd@mega-nerd.com>
+ ** Copyright (C) 2004 Paavo Jumppanen
+ **
+ ** This program is free software; you can redistribute it and/or modify
+@@ -371,44 +371,61 @@ sd2_write_rsrc_fork (SF_PRIVATE *psf, int UNUSED (calc_length))
+ */
+ 
+ static inline int
+-read_char (const unsigned char * data, int offset)
+-{	return data [offset] ;
+-} /* read_char */
++read_rsrc_char (const SD2_RSRC *prsrc, int offset)
++{	const unsigned char * data = prsrc->rsrc_data ;
++	if (offset < 0 || offset >= prsrc->rsrc_len)
++		return 0 ;
++	return data [offset] ;
++} /* read_rsrc_char */
+ 
+ static inline int
+-read_short (const unsigned char * data, int offset)
+-{	return (data [offset] << 8) + data [offset + 1] ;
+-} /* read_short */
++read_rsrc_short (const SD2_RSRC *prsrc, int offset)
++{	const unsigned char * data = prsrc->rsrc_data ;
++	if (offset < 0 || offset + 1 >= prsrc->rsrc_len)
++		return 0 ;
++	return (data [offset] << 8) + data [offset + 1] ;
++} /* read_rsrc_short */
+ 
+ static inline int
+-read_int (const unsigned char * data, int offset)
+-{	return (data [offset] << 24) + (data [offset + 1] << 16) + (data [offset + 2] << 8) + data [offset + 3] ;
+-} /* read_int */
++read_rsrc_int (const SD2_RSRC *prsrc, int offset)
++{	const unsigned char * data = prsrc->rsrc_data ;
++	if (offset < 0 || offset + 3 >= prsrc->rsrc_len)
++		return 0 ;
++	return (data [offset] << 24) + (data [offset + 1] << 16) + (data [offset + 2] << 8) + data [offset + 3] ;
++} /* read_rsrc_int */
+ 
+ static inline int
+-read_marker (const unsigned char * data, int offset)
+-{
++read_rsrc_marker (const SD2_RSRC *prsrc, int offset)
++{	const unsigned char * data = prsrc->rsrc_data ;
++
++	if (offset < 0 || offset + 3 >= prsrc->rsrc_len)
++		return 0 ;
++
+ 	if (CPU_IS_BIG_ENDIAN)
+ 		return (data [offset] << 24) + (data [offset + 1] << 16) + (data [offset + 2] << 8) + data [offset + 3] ;
+-	else if (CPU_IS_LITTLE_ENDIAN)
++	if (CPU_IS_LITTLE_ENDIAN)
+ 		return data [offset] + (data [offset + 1] << 8) + (data [offset + 2] << 16) + (data [offset + 3] << 24) ;
+-	else
+-		return 0x666 ;
+-} /* read_marker */
++
++	return 0 ;
++} /* read_rsrc_marker */
+ 
+ static void
+-read_str (const unsigned char * data, int offset, char * buffer, int buffer_len)
+-{	int k ;
++read_rsrc_str (const SD2_RSRC *prsrc, int offset, char * buffer, int buffer_len)
++{	const unsigned char * data = prsrc->rsrc_data ;
++	int k ;
+ 
+ 	memset (buffer, 0, buffer_len) ;
+ 
++	if (offset < 0 || offset + buffer_len >= prsrc->rsrc_len)
++		return ;
++
+ 	for (k = 0 ; k < buffer_len - 1 ; k++)
+ 	{	if (psf_isprint (data [offset + k]) == 0)
+ 			return ;
+ 		buffer [k] = data [offset + k] ;
+ 		} ;
+ 	return ;
+-} /* read_str */
++} /* read_rsrc_str */
+ 
+ static int
+ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
+@@ -435,17 +452,17 @@ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
+ 	/* Reset the header storage because we have changed to the rsrcdes. */
+ 	psf->headindex = psf->headend = rsrc.rsrc_len ;
+ 
+-	rsrc.data_offset = read_int (rsrc.rsrc_data, 0) ;
+-	rsrc.map_offset = read_int (rsrc.rsrc_data, 4) ;
+-	rsrc.data_length = read_int (rsrc.rsrc_data, 8) ;
+-	rsrc.map_length = read_int (rsrc.rsrc_data, 12) ;
++	rsrc.data_offset = read_rsrc_int (&rsrc, 0) ;
++	rsrc.map_offset = read_rsrc_int (&rsrc, 4) ;
++	rsrc.data_length = read_rsrc_int (&rsrc, 8) ;
++	rsrc.map_length = read_rsrc_int (&rsrc, 12) ;
+ 
+ 	if (rsrc.data_offset == 0x51607 && rsrc.map_offset == 0x20000)
+ 	{	psf_log_printf (psf, "Trying offset of 0x52 bytes.\n") ;
+-		rsrc.data_offset = read_int (rsrc.rsrc_data, 0x52 + 0) + 0x52 ;
+-		rsrc.map_offset = read_int (rsrc.rsrc_data, 0x52 + 4) + 0x52 ;
+-		rsrc.data_length = read_int (rsrc.rsrc_data, 0x52 + 8) ;
+-		rsrc.map_length = read_int (rsrc.rsrc_data, 0x52 + 12) ;
++		rsrc.data_offset = read_rsrc_int (&rsrc, 0x52 + 0) + 0x52 ;
++		rsrc.map_offset = read_rsrc_int (&rsrc, 0x52 + 4) + 0x52 ;
++		rsrc.data_length = read_rsrc_int (&rsrc, 0x52 + 8) ;
++		rsrc.map_length = read_rsrc_int (&rsrc, 0x52 + 12) ;
+ 		} ;
+ 
+ 	psf_log_printf (psf, "  data offset : 0x%04X\n  map  offset : 0x%04X\n"
+@@ -488,7 +505,7 @@ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
+ 		goto parse_rsrc_fork_cleanup ;
+ 		} ;
+ 
+-	rsrc.string_offset = rsrc.map_offset + read_short (rsrc.rsrc_data, rsrc.map_offset + 26) ;
++	rsrc.string_offset = rsrc.map_offset + read_rsrc_short (&rsrc, rsrc.map_offset + 26) ;
+ 	if (rsrc.string_offset > rsrc.rsrc_len)
+ 	{	psf_log_printf (psf, "Bad string offset (%d).\n", rsrc.string_offset) ;
+ 		error = SFE_SD2_BAD_RSRC ;
+@@ -497,7 +514,7 @@ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
+ 
+ 	rsrc.type_offset = rsrc.map_offset + 30 ;
+ 
+-	rsrc.type_count = read_short (rsrc.rsrc_data, rsrc.map_offset + 28) + 1 ;
++	rsrc.type_count = read_rsrc_short (&rsrc, rsrc.map_offset + 28) + 1 ;
+ 	if (rsrc.type_count < 1)
+ 	{	psf_log_printf (psf, "Bad type count.\n") ;
+ 		error = SFE_SD2_BAD_RSRC ;
+@@ -513,11 +530,11 @@ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
+ 
+ 	rsrc.str_index = -1 ;
+ 	for (k = 0 ; k < rsrc.type_count ; k ++)
+-	{	marker = read_marker (rsrc.rsrc_data, rsrc.type_offset + k * 8) ;
++	{	marker = read_rsrc_marker (&rsrc, rsrc.type_offset + k * 8) ;
+ 
+ 		if (marker == STR_MARKER)
+ 		{	rsrc.str_index = k ;
+-			rsrc.str_count = read_short (rsrc.rsrc_data, rsrc.type_offset + k * 8 + 4) + 1 ;
++			rsrc.str_count = read_rsrc_short (&rsrc, rsrc.type_offset + k * 8 + 4) + 1 ;
+ 			error = parse_str_rsrc (psf, &rsrc) ;
+ 			goto parse_rsrc_fork_cleanup ;
+ 			} ;
+@@ -549,26 +566,26 @@ parse_str_rsrc (SF_PRIVATE *psf, SD2_RSRC * rsrc)
+ 	for (k = 0 ; data_offset + data_len < rsrc->rsrc_len ; k++)
+ 	{	int slen ;
+ 
+-		slen = read_char (rsrc->rsrc_data, str_offset) ;
+-		read_str (rsrc->rsrc_data, str_offset + 1, name, SF_MIN (SIGNED_SIZEOF (name), slen + 1)) ;
++		slen = read_rsrc_char (rsrc, str_offset) ;
++		read_rsrc_str (rsrc, str_offset + 1, name, SF_MIN (SIGNED_SIZEOF (name), slen + 1)) ;
+ 		str_offset += slen + 1 ;
+ 
+-		rsrc_id = read_short (rsrc->rsrc_data, rsrc->item_offset + k * 12) ;
++		rsrc_id = read_rsrc_short (rsrc, rsrc->item_offset + k * 12) ;
+ 
+-		data_offset = rsrc->data_offset + read_int (rsrc->rsrc_data, rsrc->item_offset + k * 12 + 4) ;
++		data_offset = rsrc->data_offset + read_rsrc_int (rsrc, rsrc->item_offset + k * 12 + 4) ;
+ 		if (data_offset < 0 || data_offset > rsrc->rsrc_len)
+ 		{	psf_log_printf (psf, "Exiting parser on data offset of %d.\n", data_offset) ;
+ 			break ;
+ 			} ;
+ 
+-		data_len = read_int (rsrc->rsrc_data, data_offset) ;
++		data_len = read_rsrc_int (rsrc, data_offset) ;
+ 		if (data_len < 0 || data_len > rsrc->rsrc_len)
+ 		{	psf_log_printf (psf, "Exiting parser on data length of %d.\n", data_len) ;
+ 			break ;
+ 			} ;
+ 
+-		slen = read_char (rsrc->rsrc_data, data_offset + 4) ;
+-		read_str (rsrc->rsrc_data, data_offset + 5, value, SF_MIN (SIGNED_SIZEOF (value), slen + 1)) ;
++		slen = read_rsrc_char (rsrc, data_offset + 4) ;
++		read_rsrc_str (rsrc, data_offset + 5, value, SF_MIN (SIGNED_SIZEOF (value), slen + 1)) ;
+ 
+ 		psf_log_printf (psf, "  0x%04x     %4d     %4d     %3d    '%s'\n", data_offset, rsrc_id, data_len, slen, value) ;
+ 
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch b/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch
new file mode 100644
index 0000000..fa6473d
--- /dev/null
+++ b/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch
@@ -0,0 +1,49 @@
+From dbe14f00030af5d3577f4cabbf9861db59e9c378 Mon Sep 17 00:00:00 2001
+From: Erik de Castro Lopo <erikd@mega-nerd.com>
+Date: Thu, 25 Dec 2014 19:23:12 +1100
+Subject: [PATCH] src/sd2.c : Fix two potential buffer read overflows.
+
+(Upstream commit dbe14f00030af5d3577f4cabbf9861db59e9c378)
+
+Closes: https://github.com/erikd/libsndfile/issues/93
+
+Upstream-Status: Backport
+
+Signed-off-by: Yue Tao <yue.tao@windriver.com>
+---
+ src/sd2.c |   12 +++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/src/sd2.c b/src/sd2.c
+index 0b4e5af..a70a1f1 100644
+--- a/src/sd2.c
++++ b/src/sd2.c
+@@ -517,6 +517,11 @@ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
+ 
+ 	rsrc.type_offset = rsrc.map_offset + 30 ;
+ 
++	if (rsrc.map_offset + 28 > rsrc.rsrc_len)
++	{	psf_log_printf (psf, "Bad map offset.\n") ;
++		goto parse_rsrc_fork_cleanup ;
++		} ;
++
+ 	rsrc.type_count = read_rsrc_short (&rsrc, rsrc.map_offset + 28) + 1 ;
+ 	if (rsrc.type_count < 1)
+ 	{	psf_log_printf (psf, "Bad type count.\n") ;
+@@ -533,7 +538,12 @@ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
+ 
+ 	rsrc.str_index = -1 ;
+ 	for (k = 0 ; k < rsrc.type_count ; k ++)
+-	{	marker = read_rsrc_marker (&rsrc, rsrc.type_offset + k * 8) ;
++	{	if (rsrc.type_offset + k * 8 > rsrc.rsrc_len)
++		{	psf_log_printf (psf, "Bad rsrc marker.\n") ;
++			goto parse_rsrc_fork_cleanup ;
++			} ;
++
++		marker = read_rsrc_marker (&rsrc, rsrc.type_offset + k * 8) ;
+ 
+ 		if (marker == STR_MARKER)
+ 		{	rsrc.str_index = k ;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.25.bb b/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.25.bb
new file mode 100644
index 0000000..3e02f4e
--- /dev/null
+++ b/meta/recipes-multimedia/libsndfile/libsndfile1_1.0.25.bb
@@ -0,0 +1,33 @@
+SUMMARY = "Audio format Conversion library"
+HOMEPAGE = "http://www.mega-nerd.com/libsndfile"
+AUTHOR = "Erik de Castro Lopo"
+DEPENDS = "sqlite3"
+SECTION = "libs/multimedia"
+LICENSE = "LGPLv2.1"
+PR = "r2"
+
+SRC_URI = "http://www.mega-nerd.com/libsndfile/files/libsndfile-${PV}.tar.gz \
+           file://0001-src-sd2.c-Fix-segfault-in-SD2-RSRC-parser.patch \
+           file://0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch \
+"
+
+SRC_URI[md5sum] = "e2b7bb637e01022c7d20f95f9c3990a2"
+SRC_URI[sha256sum] = "59016dbd326abe7e2366ded5c344c853829bebfd1702ef26a07ef662d6aa4882"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=e77fe93202736b47c07035910f47974a"
+
+S = "${WORKDIR}/libsndfile-${PV}"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)}"
+PACKAGECONFIG[alsa] = "--enable-alsa,--disable-alsa,alsa-lib"
+
+EXTRA_OECONF = "--disable-external-libs"
+
+inherit autotools lib_package pkgconfig
+
+do_configure_prepend_arm() {
+	export ac_cv_sys_largefile_source=1
+	export ac_cv_sys_file_offset_bits=64
+	ac_cv_sizeof_off_t=8
+}
+
diff --git a/meta/recipes-multimedia/libtheora/libtheora-1.1.1/no-docs.patch b/meta/recipes-multimedia/libtheora/libtheora-1.1.1/no-docs.patch
new file mode 100644
index 0000000..359f3d1
--- /dev/null
+++ b/meta/recipes-multimedia/libtheora/libtheora-1.1.1/no-docs.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: libtheora-1.1.1/Makefile.am
+===================================================================
+--- libtheora-1.1.1.orig/Makefile.am	2009-11-25 22:01:53.593775926 +0100
++++ libtheora-1.1.1/Makefile.am	2009-11-25 22:02:00.777524017 +0100
+@@ -8,7 +8,7 @@
+ EXAMPLES_DIR =
+ endif
+ 
+-SUBDIRS = lib include doc tests m4 $(EXAMPLES_DIR)
++SUBDIRS = lib include tests m4 $(EXAMPLES_DIR)
+ 
+ 
+ # we include the whole debian/ dir in EXTRA_DIST because there's a problem
diff --git a/meta/recipes-multimedia/libtheora/libtheora_1.1.1.bb b/meta/recipes-multimedia/libtheora/libtheora_1.1.1.bb
new file mode 100644
index 0000000..18cb168
--- /dev/null
+++ b/meta/recipes-multimedia/libtheora/libtheora_1.1.1.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Theora Video Codec"
+DESCRIPTION = "The libtheora reference implementation provides the standard encoder and decoder under a BSD license."
+HOMEPAGE = "http://xiph.org/"
+BUGTRACKER = "https://trac.xiph.org/newticket"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cf91718f59eb6a83d06dc7bcaf411132"
+DEPENDS = "libogg"
+
+PR = "r1"
+
+SRC_URI = "http://downloads.xiph.org/releases/theora/libtheora-${PV}.tar.bz2 \
+           file://no-docs.patch"
+
+SRC_URI[md5sum] = "292ab65cedd5021d6b7ddd117e07cd8e"
+SRC_URI[sha256sum] = "b6ae1ee2fa3d42ac489287d3ec34c5885730b1296f0801ae577a35193d3affbc"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-examples"
diff --git a/meta/recipes-multimedia/libtiff/files/libtool2.patch b/meta/recipes-multimedia/libtiff/files/libtool2.patch
new file mode 100644
index 0000000..457202e
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/files/libtool2.patch
@@ -0,0 +1,19 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ configure.ac |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: tiff-3.9.5/configure.ac
+===================================================================
+--- tiff-3.9.5.orig/configure.ac
++++ tiff-3.9.5/configure.ac
+@@ -27,7 +27,7 @@ dnl Process this file with autoconf to p
+ AC_PREREQ(2.64)
+ AC_INIT([LibTIFF Software],[3.9.5],[tiff@lists.maptools.org],[tiff])
+ AC_CONFIG_AUX_DIR(config)
+-AC_CONFIG_MACRO_DIR(m4)
++dnl AC_CONFIG_MACRO_DIR(m4)
+ AC_LANG(C)
+ 
+ dnl Compute the canonical host (run-time) system type variable
diff --git a/meta/recipes-multimedia/libtiff/tiff_4.0.4.bb b/meta/recipes-multimedia/libtiff/tiff_4.0.4.bb
new file mode 100644
index 0000000..cf3a5f0
--- /dev/null
+++ b/meta/recipes-multimedia/libtiff/tiff_4.0.4.bb
@@ -0,0 +1,44 @@
+SUMMARY = "Provides support for the Tag Image File Format (TIFF)"
+LICENSE = "BSD-2-Clause"
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=34da3db46fab7501992f9615d7e158cf"
+HOMEPAGE = "http://www.remotesensing.org/libtiff/"
+
+SRC_URI = "ftp://ftp.remotesensing.org/pub/libtiff/tiff-${PV}.tar.gz \
+           file://libtool2.patch \
+          "
+
+SRC_URI[md5sum] = "9aee7107408a128c0c7b24286c0db900"
+SRC_URI[sha256sum] = "8cb1d90c96f61cdfc0bcf036acc251c9dbe6320334da941c7a83cfe1576ef890"
+
+inherit autotools
+
+CACHED_CONFIGUREVARS = "ax_cv_check_gl_libgl=no"
+
+PACKAGECONFIG ?= "cxx jpeg zlib lzma \
+                  strip-chopping extrasample-as-alpha check-ycbcr-subsampling"
+
+PACKAGECONFIG[cxx] = "--enable-cxx,--disable-cxx,,"
+PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg,"
+PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib,"
+PACKAGECONFIG[lzma] = "--enable-lzma,--disable-lzma,xz,"
+
+# Convert single-strip uncompressed images to multiple strips of specified
+# size (default: 8192) to reduce memory usage
+PACKAGECONFIG[strip-chopping] = "--enable-strip-chopping,--disable-strip-chopping,,"
+
+# Treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA
+PACKAGECONFIG[extrasample-as-alpha] = "--enable-extrasample-as-alpha,--disable-extrasample-as-alpha,,"
+
+# Control picking up YCbCr subsample info. Disable to support files lacking
+# the tag
+PACKAGECONFIG[check-ycbcr-subsampling] = "--enable-check-ycbcr-subsampling,--disable-check-ycbcr-subsampling,,"
+
+# Support a mechanism allowing reading large strips (usually one strip files)
+# in chunks when using TIFFReadScanline. Experimental 4.0+ feature
+PACKAGECONFIG[chunky-strip-read] = "--enable-chunky-strip-read,--disable-chunky-strip-read,,"
+
+PACKAGES =+ "tiffxx tiff-utils"
+FILES_tiffxx = "${libdir}/libtiffxx.so.*"
+FILES_tiff-utils = "${bindir}/*"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb b/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb
new file mode 100644
index 0000000..636e0f3
--- /dev/null
+++ b/meta/recipes-multimedia/libvorbis/libvorbis_1.3.5.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Ogg Vorbis Audio Codec"
+DESCRIPTION = "Ogg Vorbis is a high-quality lossy audio codec \
+that is free of intellectual property restrictions. libvorbis \
+is the main vorbis codec library."
+HOMEPAGE = "http://www.vorbis.com/"
+BUGTRACKER = "https://trac.xiph.org"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7d2c487d2fc7dd3e3c7c465a5b7f6217 \
+                    file://include/vorbis/vorbisenc.h;beginline=1;endline=11;md5=d1c1d138863d6315131193d4046d81cb"
+DEPENDS = "libogg"
+
+SRC_URI = "http://downloads.xiph.org/releases/vorbis/${BP}.tar.xz"
+SRC_URI[md5sum] = "28cb28097c07a735d6af56e598e1c90f"
+SRC_URI[sha256sum] = "54f94a9527ff0a88477be0a71c0bab09a4c3febe0ed878b24824906cd4b0e1d1"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-multimedia/mpeg2dec/mpeg2dec-0.4.1/altivec_h_needed.patch b/meta/recipes-multimedia/mpeg2dec/mpeg2dec-0.4.1/altivec_h_needed.patch
new file mode 100644
index 0000000..7dc5643
--- /dev/null
+++ b/meta/recipes-multimedia/mpeg2dec/mpeg2dec-0.4.1/altivec_h_needed.patch
@@ -0,0 +1,43 @@
+Add new method to judge whether <altivec.h> is needed
+
+The original logic will use "typedef vector int t;" to judge
+whether <altivec.h> is needed. altivec.h contains the following
+statement:
+
+ #if !defined(__APPLE_ALTIVEC__)
+ #define vector __vector
+ #define pixel __pixel
+ #define bool 
+ #endif
+
+In gcc-4.3.3, __APPLE_ALTIVEC__ is not defined by compiler, neither
+as vector, pixel, and bool. In order to make "typedef vector int t;"
+pass the compilation, we need to include altivec.h.
+
+However in gcc-4.5.0, __APPLE_ALTIVEC__ is defined by compiler,
+so as vector, pixel, and bool. We could not judge whether
+altivec.h is needed by "typedef vector int t;".
+Here we include another statement "int tmp = __CR6_EQ;", in
+which __CR6_EQ is defined in altivec.h.
+
+Upstream-Status: Pending
+
+Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
+
+diff -ruN mpeg2dec-0.4.1-orig/configure.in mpeg2dec-0.4.1/configure.in
+--- mpeg2dec-0.4.1-orig/configure.in	2010-09-14 20:55:42.399687663 +0800
++++ mpeg2dec-0.4.1/configure.in	2010-09-14 20:56:43.403204648 +0800
+@@ -75,11 +75,11 @@
+ 		 CFLAGS="$OPT_CFLAGS $TRY_CFLAGS $CFLAGS"
+ 		 AC_MSG_CHECKING([if <altivec.h> is needed])
+ 		 AC_TRY_COMPILE([],
+-		    [typedef vector int t;
++		    [typedef vector int t; int tmp = __CR6_EQ;
+ 		     vec_ld(0, (unsigned char *)0);],
+ 		    [have_altivec=yes; AC_MSG_RESULT(no)],
+ 		    [AC_TRY_COMPILE([#include <altivec.h>],
+-			[typedef vector int t; vec_ld(0, (unsigned char *)0);],
++			[typedef vector int t; int tmp = __CR6_EQ; vec_ld(0, (unsigned char *)0);],
+ 			[AC_DEFINE([HAVE_ALTIVEC_H],,
+ 			    [Define to 1 if you have the <altivec.h> header.])
+ 			 have_altivec=yes; AC_MSG_RESULT(yes)],
diff --git a/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb b/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb
new file mode 100644
index 0000000..cede2bf
--- /dev/null
+++ b/meta/recipes-multimedia/mpeg2dec/mpeg2dec_0.4.1.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Library and test program for decoding MPEG-2 and MPEG-1 video streams"
+HOMEPAGE = "http://libmpeg2.sourceforge.net/"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://include/mpeg2.h;beginline=1;endline=22;md5=ead62602d4638329d3b5b86a55803154"
+
+PR = "r2"
+
+SRC_URI = "http://libmpeg2.sourceforge.net/files/mpeg2dec-${PV}.tar.gz \
+           file://altivec_h_needed.patch"
+
+SRC_URI[md5sum] = "7631b0a4bcfdd0d78c0bb0083080b0dc"
+SRC_URI[sha256sum] = "c74a76068f8ec36d4bb59a03bf1157be44118ca02252180e8b358b0b5e3edeee"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--enable-shared --disable-sdl"
+
+PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG[x11] = "--with-x,--without-x,virtual/libx11 libxext libxv"
+
+PACKAGES = "mpeg2dec-dbg mpeg2dec mpeg2dec-doc libmpeg2 libmpeg2-dev libmpeg2convert libmpeg2convert-dev libmpeg2-staticdev libmpeg2convert-staticdev"
+
+FILES_${PN} = "${bindir}/*"
+FILES_libmpeg2 = "${libdir}/libmpeg2.so.*"
+FILES_libmpeg2convert = "${libdir}/libmpeg2convert.so.*"
+FILES_libmpeg2-dev = "${libdir}/libmpeg2.so \
+                      ${libdir}/libmpeg2.la \
+                      ${libdir}/pkgconfig/libmpeg2.pc \
+                      ${includedir}/mpeg2dec/mpeg2.h"
+FILES_libmpeg2-staticdev = "${libdir}/libmpeg2.a"
+FILES_libmpeg2convert-dev = "${libdir}/libmpeg2convert.so \
+                             ${libdir}/libmpeg2convert.la \
+                             ${libdir}/pkgconfig/libmpeg2convert.pc \
+                             ${includedir}/mpeg2dec/mpeg2convert.h"
+FILES_libmpeg2convert-staticdev = "${libdir}/libmpeg2convert.a"
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio.inc b/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
new file mode 100644
index 0000000..5b806d7
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio.inc
@@ -0,0 +1,197 @@
+SUMMARY = "Sound server for Linux and Unix-like operating systems"
+HOMEPAGE = "http://www.pulseaudio.org"
+AUTHOR = "Lennart Poettering"
+SECTION = "libs/multimedia"
+LICENSE = "GPLv2+ & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://GPL;md5=4325afd396febcb659c36b49533135d4 \
+                    file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://src/pulsecore/resampler.h;beginline=4;endline=21;md5=09794012ae16912c0270f3280cc8ff84"
+
+DEPENDS = "libatomic-ops liboil libsndfile1 libtool"
+# optional
+DEPENDS += "udev alsa-lib glib-2.0 gconf"
+DEPENDS += "json-c gdbm speexdsp libxml-parser-perl-native libcap"
+
+inherit autotools pkgconfig useradd gettext perlnative bluetooth systemd
+
+# *.desktop rules wont be generated during configure and build will fail
+# if using --disable-nls
+USE_NLS = "yes"
+
+EXTRA_OECONF = "\
+		--disable-hal-compat \
+		--disable-orc \
+		--enable-tcpwrap=no \
+		--with-access-group=audio \
+		--disable-openssl \
+		--disable-xen \
+		--with-database=simple \
+		--without-fftw \
+		--without-zsh-completion-dir \
+		--with-udev-rules-dir=`pkg-config --variable=udevdir udev`/rules.d \
+                ac_cv_header_valgrind_memcheck_h=no \
+"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', '${BLUEZ}', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'zeroconf', 'avahi', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', '3g', 'ofono', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
+                   dbus \
+                   "
+
+PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus"
+PACKAGECONFIG[bluez4] = "--enable-bluez4,--disable-bluez4,bluez4 sbc"
+PACKAGECONFIG[bluez5] = "--enable-bluez5,--disable-bluez5,bluez5 sbc"
+PACKAGECONFIG[ofono] = "--enable-bluez5-ofono-headset,--disable-bluez5-ofono-headset,ofono"
+PACKAGECONFIG[gtk] = "--enable-gtk3,--disable-gtk3,gtk+3"
+PACKAGECONFIG[systemd] = "--enable-systemd-daemon --enable-systemd-login --enable-systemd-journal --with-systemduserunitdir=${systemd_user_unitdir},--disable-systemd-daemon --disable-systemd-login --disable-systemd-journal,systemd"
+PACKAGECONFIG[x11] = "--enable-x11,--disable-x11,virtual/libx11 libxtst libice libsm libxcb"
+PACKAGECONFIG[avahi] = "--enable-avahi,--disable-avahi,avahi"
+PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack"
+# Since many embedded systems don't have non-root users, it's useful to be
+# able to use pulseaudio autospawn for root as well.
+PACKAGECONFIG[autospawn-for-root] = ",,,"
+
+EXTRA_OECONF_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
+EXTRA_OECONF_append_armeb = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " --enable-neon-opt=no", d)}"
+
+
+export TARGET_PFPU = "${TARGET_FPU}"
+
+# TODO: Use more fine granular version
+#OE_LT_RPATH_ALLOW=":${libdir}/pulse-0.9:"
+OE_LT_RPATH_ALLOW = "any"
+OE_LT_RPATH_ALLOW[export]="1"
+
+set_cfg_value () {
+	sed -i -e "s/\(; *\)\?$2 =.*/$2 = $3/" "$1"
+	if ! grep -q "^$2 = $3\$" "$1"; then
+		die "Use of sed to set '$2' to '$3' in '$1' failed"
+	fi
+}
+
+do_compile_append () {
+	if ${@bb.utils.contains('PACKAGECONFIG', 'autospawn-for-root', 'true', 'false', d)}; then
+		set_cfg_value src/client.conf allow-autospawn-for-root yes
+	fi
+}
+
+do_install_append() {
+	install -d ${D}${sysconfdir}/default/volatiles
+	install -m 0644 ${WORKDIR}/volatiles.04_pulse  ${D}${sysconfdir}/default/volatiles/volatiles.04_pulse
+}
+
+USERADD_PACKAGES = "pulseaudio-server"
+GROUPADD_PARAM_pulseaudio-server = "pulse"
+USERADD_PARAM_pulseaudio-server = "--system --home /var/run/pulse \
+                              --no-create-home --shell /bin/false \
+                              --groups audio,pulse --gid pulse pulse"
+
+# The console-kit module is included here explicitly so bitbake can map to the
+# RDEPENDS we define for it in this recipe, and thereby ensure that when
+# adding the console-kit module to an image, we also get the necessary
+# consolekit package produced.
+PACKAGES =+ "libpulsecore libpulsecommon libpulse libpulse-simple libpulse-mainloop-glib \
+             pulseaudio-server pulseaudio-misc ${@bb.utils.contains('PACKAGECONFIG', 'dbus', 'pulseaudio-module-console-kit', '', d)}"
+
+#upgrade path:
+RREPLACES_pulseaudio-server = "libpulse-bin libpulse-conf"
+
+PACKAGES_DYNAMIC += "^pulseaudio-lib-.* ^pulseaudio-module-.*"
+
+FILES_libpulsecore = "${libdir}/libpulsecore*.so"
+FILES_libpulsecommon = "${libdir}/pulseaudio/libpulsecommon*.so"
+
+# client.conf configures the behaviour of libpulse, so it belongs in the same
+# package.
+FILES_libpulse = "${libdir}/libpulse.so.* ${sysconfdir}/pulse/client.conf"
+
+FILES_libpulse-simple = "${libdir}/libpulse-simple.so.*"
+FILES_libpulse-mainloop-glib = "${libdir}/libpulse-mainloop-glib.so.*"
+
+FILES_${PN}-dbg += "${libexecdir}/pulse/.debug \
+                    ${libdir}/pulse-${PV}/modules/.debug"
+FILES_${PN}-dev += "${libdir}/pulse-${PV}/modules/*.la ${datadir}/vala ${libdir}/cmake"   
+FILES_${PN}-conf = "${sysconfdir}"
+FILES_${PN}-bin += "${sysconfdir}/default/volatiles/volatiles.04_pulse"
+FILES_${PN}-server = "${bindir}/pulseaudio ${bindir}/start-* ${sysconfdir} ${bindir}/pactl */udev/rules.d/*.rules */*/udev/rules.d/*.rules ${systemd_user_unitdir}/*"
+
+#SYSTEMD_PACKAGES = "${PN}-server"
+SYSTEMD_SERVICE_${PN}-server = "pulseaudio.service"
+
+FILES_${PN}-misc = "${bindir}/* ${libdir}/pulseaudio/libpulsedsp.so"
+
+# Allow the pulseaudio package to be created empty as a placeholder (-dbg and -dev depend on it)
+ALLOW_EMPTY_${PN} = "1"
+
+CONFFILES_libpulse = "${sysconfdir}/pulse/client.conf"
+
+CONFFILES_pulseaudio-server = "\ 
+  ${sysconfdir}/pulse/default.pa \
+  ${sysconfdir}/pulse/daemon.conf \
+  ${sysconfdir}/pulse/system.pa \
+  "
+
+pkg_postinst_${PN}-server() {
+        if [ -z "$D" ] && [ -e ${sysconfdir}/init.d/populate-volatile.sh ] ; then
+            ${sysconfdir}/init.d/populate-volatile.sh update
+        fi
+}
+
+python populate_packages_prepend() {
+    #d.setVar('PKG_pulseaudio', 'pulseaudio')
+
+    plugindir = d.expand('${libdir}/pulse-${PV}/modules/')
+    do_split_packages(d, plugindir, '^module-(.*)\.so$', 'pulseaudio-module-%s', 'PulseAudio module for %s', extra_depends='', prepend=True)
+    do_split_packages(d, plugindir, '^lib(.*)\.so$', 'pulseaudio-lib-%s', 'PulseAudio library for %s', extra_depends='', prepend=True)
+}
+
+RDEPENDS_pulseaudio-server = " \
+    pulseaudio-module-filter-apply \
+    pulseaudio-module-filter-heuristics \
+    pulseaudio-module-udev-detect \
+    pulseaudio-module-null-sink \
+    pulseaudio-module-device-restore \
+    pulseaudio-module-stream-restore \
+    pulseaudio-module-card-restore \
+    pulseaudio-module-augment-properties \
+    pulseaudio-module-detect \
+    pulseaudio-module-alsa-sink \
+    pulseaudio-module-alsa-source \
+    pulseaudio-module-alsa-card \
+    pulseaudio-module-native-protocol-unix \
+    pulseaudio-module-default-device-restore \
+    pulseaudio-module-intended-roles \
+    pulseaudio-module-rescue-streams \
+    pulseaudio-module-always-sink \
+    pulseaudio-module-suspend-on-idle \
+    pulseaudio-module-position-event-sounds \
+    pulseaudio-module-role-cork \
+    pulseaudio-module-switch-on-port-available"
+
+# If the server is installed, it's usually desirable to make ALSA applications
+# use PulseAudio. alsa-plugins-pulseaudio-conf will install the configuration
+# that makes the PulseAudio plugin the default ALSA device.
+RDEPENDS_pulseaudio-server += "alsa-plugins-pulseaudio-conf"
+
+# pulseaudio-module-console-kit is built whenever dbus is enabled by PACKAGECONFIG
+# but consolekit depends on libx11 and is available only for DISTRO with x11 in DISTRO_FEATURES
+RDEPENDS_pulseaudio-module-console-kit =+ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}"
+RDEPENDS_pulseaudio-misc += "pulseaudio-module-cli-protocol-unix"
+
+FILES_pulseaudio-module-gconf += "${libexecdir}/pulse/gconf-helper"
+FILES_pulseaudio-module-alsa-card += "${datadir}/pulseaudio/alsa-mixer"
+
+# The console-kit module is good to have on X11 systems (it keeps PulseAudio
+# running for the duration of the user login session). The device-manager and
+# x11-* modules are referenced from the start-pulseaudio-x11 script, so those
+# modules must be installed when X11 is enabled.
+RDEPENDS_pulseaudio-server += "\
+        ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '\
+                pulseaudio-module-console-kit \
+                pulseaudio-module-device-manager \
+                pulseaudio-module-x11-cork-request \
+                pulseaudio-module-x11-publish \
+                pulseaudio-module-x11-xsmp \
+        ', '', d)}"
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
new file mode 100644
index 0000000..d19eb7c
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-client-conf-Add-allow-autospawn-for-root.patch
@@ -0,0 +1,92 @@
+From 1cb5647f76dc8cd7bacbce2a64fac9e6c2dc3b16 Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+Date: Tue, 28 Apr 2015 14:32:43 +0300
+Subject: [PATCH] client-conf: Add allow-autospawn-for-root
+
+Usually autospawning for root is a bad idea, since it can easily
+interfere with other users' PulseAudio instances, but in embedded
+environments where only root exists, autospawning is fine.
+
+Upstream-Status: Submitted [http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23549]
+
+Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+---
+ man/pulse-client.conf.5.xml.in | 9 +++++++++
+ src/pulse/client-conf.c        | 1 +
+ src/pulse/client-conf.h        | 1 +
+ src/pulse/client.conf.in       | 1 +
+ src/pulse/context.c            | 2 +-
+ 5 files changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/man/pulse-client.conf.5.xml.in b/man/pulse-client.conf.5.xml.in
+index 1002dbe..0058490 100644
+--- a/man/pulse-client.conf.5.xml.in
++++ b/man/pulse-client.conf.5.xml.in
+@@ -71,6 +71,15 @@ License along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
+     </option>
+ 
+     <option>
++      <p><opt>allow-autospawn-for-root=</opt> Allow autospawning also for root.
++      Takes a boolean value, defaults to <opt>no</opt>. If the <opt>autospawn
++      </opt> option is disabled, this option has no effect. Autospawning for
++      root is disabled by default, because running PulseAudio as root will
++      interfere with regular users' PulseAudio instances. This option should be
++      enabled only in environments where there are no regular users at all.</p>
++    </option>
++
++    <option>
+       <p><opt>daemon-binary=</opt> Path to the PulseAudio daemon to
+       run when autospawning. Defaults to a path configured at compile
+       time.</p>
+diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
+index 83331f8..0474583 100644
+--- a/src/pulse/client-conf.c
++++ b/src/pulse/client-conf.c
+@@ -138,6 +138,7 @@ void pa_client_conf_load(pa_client_conf *c, bool load_from_x11, bool load_from_e
+         { "default-server",         pa_config_parse_string,   &c->default_server, NULL },
+         { "default-dbus-server",    pa_config_parse_string,   &c->default_dbus_server, NULL },
+         { "autospawn",              pa_config_parse_bool,     &c->autospawn, NULL },
++        { "allow-autospawn-for-root", pa_config_parse_bool,   &c->allow_autospawn_for_root, NULL },
+         { "cookie-file",            pa_config_parse_string,   &c->cookie_file_from_client_conf, NULL },
+         { "disable-shm",            pa_config_parse_bool,     &c->disable_shm, NULL },
+         { "enable-shm",             pa_config_parse_not_bool, &c->disable_shm, NULL },
+diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h
+index eac705a..131393a 100644
+--- a/src/pulse/client-conf.h
++++ b/src/pulse/client-conf.h
+@@ -38,6 +38,7 @@ typedef struct pa_client_conf {
+     char *cookie_file_from_application;
+     char *cookie_file_from_client_conf;
+     bool autospawn, disable_shm, auto_connect_localhost, auto_connect_display;
++    bool allow_autospawn_for_root;
+     size_t shm_size;
+ } pa_client_conf;
+ 
+diff --git a/src/pulse/client.conf.in b/src/pulse/client.conf.in
+index 26b7790..69830ef 100644
+--- a/src/pulse/client.conf.in
++++ b/src/pulse/client.conf.in
+@@ -23,6 +23,7 @@
+ ; default-dbus-server =
+ 
+ ; autospawn = yes
++; allow-autospawn-for-root = no
+ ; daemon-binary = @PA_BINARY@
+ ; extra-arguments = --log-target=syslog
+ 
+diff --git a/src/pulse/context.c b/src/pulse/context.c
+index 4bc445f..d6c3f6d 100644
+--- a/src/pulse/context.c
++++ b/src/pulse/context.c
+@@ -976,7 +976,7 @@ int pa_context_connect(
+     if (!(flags & PA_CONTEXT_NOAUTOSPAWN) && c->conf->autospawn) {
+ 
+ #ifdef HAVE_GETUID
+-        if (getuid() == 0)
++        if (!c->conf->allow_autospawn_for_root && getuid() == 0)
+             pa_log_debug("Not doing autospawn since we are root.");
+         else {
+             c->do_autospawn = true;
+-- 
+1.9.3
+
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-conf-parser-add-support-for-.d-directories.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-conf-parser-add-support-for-.d-directories.patch
new file mode 100644
index 0000000..a9f1b2a
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-conf-parser-add-support-for-.d-directories.patch
@@ -0,0 +1,196 @@
+From 8cb643bbf0a287d67794e680d26f49c503f31053 Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+Date: Thu, 21 May 2015 21:00:59 +0300
+Subject: [PATCH] conf-parser: add support for .d directories
+
+This allows a configuration scheme where prior to loading
+configuration from "somefile", the parser first loads configuration
+from files in directory "somefile.d". This feature is currently
+enabled only for client.conf and daemon.conf.
+
+This makes it easier to create configuration packages in distributions
+when there's need to have different configuration in different setups.
+For example, the graphical Sato environment in OpenEmbedded-core needs
+to set allow-autospawn-for-root=true in client.conf, but the default
+configuration in OpenEmbedded-core should not set that option. With
+this patch, I can create a Sato-specific package that simply installs
+50-sato.conf in /etc/pulse/client.conf.d without conflicting with the
+main client.conf file coming from a different package.
+
+Upstream-Status: Submitted [http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23592]
+
+Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+---
+ src/daemon/daemon-conf.c                |  2 +-
+ src/modules/alsa/alsa-mixer.c           |  4 ++--
+ src/modules/module-augment-properties.c |  2 +-
+ src/pulse/client-conf.c                 |  2 +-
+ src/pulsecore/conf-parser.c             | 42 +++++++++++++++++++++++++++++++--
+ src/pulsecore/conf-parser.h             |  8 ++++++-
+ 6 files changed, 52 insertions(+), 8 deletions(-)
+
+diff --git a/src/daemon/daemon-conf.c b/src/daemon/daemon-conf.c
+index 21a8edb..1332fc6 100644
+--- a/src/daemon/daemon-conf.c
++++ b/src/daemon/daemon-conf.c
+@@ -617,7 +617,7 @@ int pa_daemon_conf_load(pa_daemon_conf *c, const char *filename) {
+     ci.default_channel_map_set = ci.default_sample_spec_set = false;
+     ci.conf = c;
+ 
+-    r = f ? pa_config_parse(c->config_file, f, table, NULL, NULL) : 0;
++    r = f ? pa_config_parse(c->config_file, f, table, NULL, true, NULL) : 0;
+ 
+     if (r >= 0) {
+ 
+diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
+index 2314612..988b4fe 100644
+--- a/src/modules/alsa/alsa-mixer.c
++++ b/src/modules/alsa/alsa-mixer.c
+@@ -2483,7 +2483,7 @@ pa_alsa_path* pa_alsa_path_new(const char *paths_dir, const char *fname, pa_alsa
+ 
+     fn = pa_maybe_prefix_path(fname, paths_dir);
+ 
+-    r = pa_config_parse(fn, NULL, items, p->proplist, p);
++    r = pa_config_parse(fn, NULL, items, p->proplist, false, p);
+     pa_xfree(fn);
+ 
+     if (r < 0)
+@@ -4288,7 +4288,7 @@ pa_alsa_profile_set* pa_alsa_profile_set_new(const char *fname, const pa_channel
+                               pa_run_from_build_tree() ? PA_SRCDIR "/modules/alsa/mixer/profile-sets/" :
+                               PA_ALSA_PROFILE_SETS_DIR);
+ 
+-    r = pa_config_parse(fn, NULL, items, NULL, ps);
++    r = pa_config_parse(fn, NULL, items, NULL, false, ps);
+     pa_xfree(fn);
+ 
+     if (r < 0)
+diff --git a/src/modules/module-augment-properties.c b/src/modules/module-augment-properties.c
+index 42b6fd9..541f0e7 100644
+--- a/src/modules/module-augment-properties.c
++++ b/src/modules/module-augment-properties.c
+@@ -204,7 +204,7 @@ static void update_rule(struct rule *r) {
+     table[0].data = &r->application_name;
+     table[1].data = &r->icon_name;
+ 
+-    if (pa_config_parse(fn, NULL, table, NULL, r) < 0)
++    if (pa_config_parse(fn, NULL, table, NULL, false, r) < 0)
+         pa_log_warn("Failed to parse .desktop file %s.", fn);
+ 
+     pa_xfree(fn);
+diff --git a/src/pulse/client-conf.c b/src/pulse/client-conf.c
+index 83331f8..3c3384d 100644
+--- a/src/pulse/client-conf.c
++++ b/src/pulse/client-conf.c
+@@ -149,7 +149,7 @@ void pa_client_conf_load(pa_client_conf *c, bool load_from_x11, bool load_from_e
+ 
+     f = pa_open_config_file(DEFAULT_CLIENT_CONFIG_FILE, DEFAULT_CLIENT_CONFIG_FILE_USER, ENV_CLIENT_CONFIG_FILE, &fn);
+     if (f) {
+-        pa_config_parse(fn, f, table, NULL, NULL);
++        pa_config_parse(fn, f, table, NULL, true, NULL);
+         pa_xfree(fn);
+         fclose(f);
+     }
+diff --git a/src/pulsecore/conf-parser.c b/src/pulsecore/conf-parser.c
+index 2dcd45a..d473232 100644
+--- a/src/pulsecore/conf-parser.c
++++ b/src/pulsecore/conf-parser.c
+@@ -21,6 +21,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <dirent.h>
+ #include <string.h>
+ #include <stdio.h>
+ #include <errno.h>
+@@ -103,7 +104,7 @@ static int parse_line(pa_config_parser_state *state) {
+             }
+         }
+ 
+-        r = pa_config_parse(fn, NULL, state->item_table, state->proplist, state->userdata);
++        r = pa_config_parse(fn, NULL, state->item_table, state->proplist, false, state->userdata);
+         pa_xfree(path);
+         return r;
+     }
+@@ -152,8 +153,13 @@ static int parse_line(pa_config_parser_state *state) {
+         return normal_assignment(state);
+ }
+ 
++static int conf_filter(const struct dirent *entry) {
++    return pa_endswith(entry->d_name, ".conf");
++}
++
+ /* Go through the file and parse each line */
+-int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_proplist *proplist, void *userdata) {
++int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_proplist *proplist, bool use_dot_d,
++                    void *userdata) {
+     int r = -1;
+     bool do_close = !f;
+     pa_config_parser_state state;
+@@ -163,6 +169,38 @@ int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_p
+ 
+     pa_zero(state);
+ 
++    if (use_dot_d) {
++        char *dir_name;
++        int n;
++        struct dirent **entries = NULL;
++
++        dir_name = pa_sprintf_malloc("%s.d", filename);
++
++        n = scandir(dir_name, &entries, conf_filter, alphasort);
++        if (n >= 0) {
++            int i;
++
++            for (i = 0; i < n; i++) {
++                char *filename2;
++
++                filename2 = pa_sprintf_malloc("%s" PA_PATH_SEP "%s", dir_name, entries[i]->d_name);
++                pa_config_parse(filename2, NULL, t, proplist, false, userdata);
++                pa_xfree(filename2);
++
++                free(entries[i]);
++            }
++
++            free(entries);
++        } else {
++            if (errno == ENOENT)
++                pa_log_debug("scandir(\"%s\") failed: %s", dir_name, pa_cstrerror(errno));
++            else
++                pa_log_warn("scandir(\"%s\") failed: %s", dir_name, pa_cstrerror(errno));
++        }
++
++        pa_xfree(dir_name);
++    }
++
+     if (!f && !(f = pa_fopen_cloexec(filename, "r"))) {
+         if (errno == ENOENT) {
+             pa_log_debug("Failed to open configuration file '%s': %s", filename, pa_cstrerror(errno));
+diff --git a/src/pulsecore/conf-parser.h b/src/pulsecore/conf-parser.h
+index dbb6f5c..cc20d7d 100644
+--- a/src/pulsecore/conf-parser.h
++++ b/src/pulsecore/conf-parser.h
+@@ -59,6 +59,11 @@ struct pa_config_parser_state {
+  * pa_config_items in *t that is terminated by an item where lvalue is
+  * NULL.
+  *
++ * If use_dot_d is true, then before parsing the file named by the filename
++ * argument, the function will parse all files ending with ".conf" in
++ * alphabetical order from a directory whose name is filename + ".d", if such
++ * directory exists.
++ *
+  * Some configuration files may contain a Properties section, which
+  * is a bit special. Normally all accepted lvalues must be predefined
+  * in the pa_config_item table, but in the Properties section the
+@@ -68,7 +73,8 @@ struct pa_config_parser_state {
+  * properties, and those properties will be merged into the given
+  * proplist. If proplist is NULL, then sections named "Properties"
+  * are not allowed at all in the configuration file. */
+-int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_proplist *proplist, void *userdata);
++int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_proplist *proplist, bool use_dot_d,
++                    void *userdata);
+ 
+ /* Generic parsers for integers, size_t, booleans and strings */
+ int pa_config_parse_int(pa_config_parser_state *state);
+-- 
+1.9.3
+
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch
new file mode 100644
index 0000000..8555995
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/0001-padsp-Make-it-compile-on-musl.patch
@@ -0,0 +1,70 @@
+From f6ab3c3aa7a1841c8add04828029356d2a8c88e7 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 21:56:31 -0700
+Subject: [PATCH] padsp: Make it compile on musl
+
+break assumptions on glibc and there is no stat64 on non
+glibc C libraries
+
+See pulseaudio bug
+
+https://bugs.freedesktop.org/show_bug.cgi?id=85319
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/utils/padsp.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/src/utils/padsp.c b/src/utils/padsp.c
+index e61373c..684721a 100644
+--- a/src/utils/padsp.c
++++ b/src/utils/padsp.c
+@@ -2368,7 +2368,7 @@ fail:
+     return ret;
+ }
+ 
+-#ifdef sun
++#ifndef __GLIBC__
+ int ioctl(int fd, int request, ...) {
+ #else
+ int ioctl(int fd, unsigned long request, ...) {
+@@ -2508,10 +2508,13 @@ int stat(const char *pathname, struct stat *buf) {
+ 
+     return 0;
+ }
+-
+ #ifdef HAVE_OPEN64
+-
++#undef stat64
++#ifdef __GLIBC__
+ int stat64(const char *pathname, struct stat64 *buf) {
++#else
++int stat64(const char *pathname, struct stat *buf) {
++#endif
+     struct stat oldbuf;
+     int ret;
+ 
+@@ -2544,7 +2547,7 @@ int stat64(const char *pathname, struct stat64 *buf) {
+ 
+     return 0;
+ }
+-
++#undef open64
+ int open64(const char *filename, int flags, ...) {
+     va_list args;
+     mode_t mode = 0;
+@@ -2670,8 +2673,8 @@ FILE* fopen(const char *filename, const char *mode) {
+ }
+ 
+ #ifdef HAVE_OPEN64
+-
+-FILE *fopen64(const char *filename, const char *mode) {
++#undef fopen64
++FILE *fopen64(const char *__restrict filename, const char *__restrict mode) {
+ 
+     debug(DEBUG_LEVEL_VERBOSE, __FILE__": fopen64(%s)\n", filename?filename:"NULL");
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/fix-git-version-gen.patch b/meta/recipes-multimedia/pulseaudio/pulseaudio/fix-git-version-gen.patch
new file mode 100644
index 0000000..ed94250
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/fix-git-version-gen.patch
@@ -0,0 +1,24 @@
+git-version-gen gets confused if a tarball is being built inside a git directory
+(ie your build directory is a subdirectory of a poky clone), and ends up calling
+the release 6.0-dirty.  Add a shortcut exit so if a tarball is detected it
+doesn't attempt to look at the git status.
+
+Upstream-Status: Submitted (https://bugs.freedesktop.org/show_bug.cgi?id=90936)
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/git-version-gen b/git-version-gen
+index 7546884..079b93e 100755
+--- a/git-version-gen
++++ b/git-version-gen
+@@ -84,7 +84,10 @@ then
+     v=`cat $tarball_version_file` || exit 1
+     case $v in
+ 	*$nl*) v= ;; # reject multi-line output
+-	[0-9]*) ;;
++	[0-9]*)
++		echo "$v" | tr -d '\012'
++		exit 0
++		;;
+ 	*) v= ;;
+     esac
+     test -z "$v" \
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse b/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse
new file mode 100644
index 0000000..5b19980
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio/volatiles.04_pulse
@@ -0,0 +1,2 @@
+# <type> <owner> <group> <mode> <path> <linksource>
+d pulse pulse 0755 /var/run/pulse none
diff --git a/meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb b/meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb
new file mode 100644
index 0000000..31e9096
--- /dev/null
+++ b/meta/recipes-multimedia/pulseaudio/pulseaudio_6.0.bb
@@ -0,0 +1,16 @@
+require pulseaudio.inc
+
+SRC_URI = "http://freedesktop.org/software/pulseaudio/releases/${BP}.tar.xz \
+           file://0001-padsp-Make-it-compile-on-musl.patch \
+           file://0001-client-conf-Add-allow-autospawn-for-root.patch \
+           file://0001-conf-parser-add-support-for-.d-directories.patch \
+           file://fix-git-version-gen.patch \
+           file://volatiles.04_pulse \
+"
+SRC_URI[md5sum] = "b691e83b7434c678dffacfa3a027750e"
+SRC_URI[sha256sum] = "b50640e0b80b1607600accfad2e45aabb79d379bf6354c9671efa2065477f6f6"
+
+do_compile_prepend() {
+    mkdir -p ${S}/libltdl
+    cp ${STAGING_LIBDIR}/libltdl* ${S}/libltdl
+}
diff --git a/meta/recipes-multimedia/sbc/sbc_1.3.bb b/meta/recipes-multimedia/sbc/sbc_1.3.bb
new file mode 100644
index 0000000..2d7f31b
--- /dev/null
+++ b/meta/recipes-multimedia/sbc/sbc_1.3.bb
@@ -0,0 +1,16 @@
+SUMMARY = "SBC Audio Codec"
+DESCRIPTION = "Bluetooth low-complexity, subband codec (SBC) library."
+HOMEPAGE = "https://www.bluez.org"
+SECTION = "libs"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+                    file://sbc/sbc.h;beginline=1;endline=26;md5=0f57d0df22b0d40746bdd29805a4361b"
+
+DEPENDS = "libsndfile1"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/bluetooth/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "2d8b7841f2c11ab287718d562f2b981c"
+SRC_URI[sha256sum] = "e61022cf576f14190241e7071753fdacdce5d1dea89ffd704110fc50be689309"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-multimedia/speex/speex_1.2rc2.bb b/meta/recipes-multimedia/speex/speex_1.2rc2.bb
new file mode 100644
index 0000000..f7d23db
--- /dev/null
+++ b/meta/recipes-multimedia/speex/speex_1.2rc2.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Speech Audio Codec"
+DESCRIPTION = "Speex is an Open Source/Free Software patent-free audio compression format designed for speech."
+HOMEPAGE = "http://www.speex.org"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=314649d8ba9dd7045dfb6683f298d0a8 \
+                    file://include/speex/speex.h;beginline=1;endline=34;md5=ef8c8ea4f7198d71cf3509c6ed05ea50"
+DEPENDS = "libogg speexdsp"
+
+SRC_URI = "http://downloads.us.xiph.org/releases/speex/speex-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "6ae7db3bab01e1d4b86bacfa8ca33e81"
+SRC_URI[sha256sum] = "caa27c7247ff15c8521c2ae0ea21987c9e9710a8f2d3448e8b79da9806bce891"
+
+inherit autotools pkgconfig lib_package
+
+EXTRA_OECONF = "\
+        ${@bb.utils.contains('TARGET_FPU', 'soft', '--enable-fixed-point --disable-float-api --disable-vbr', '', d)} \
+"
diff --git a/meta/recipes-multimedia/speex/speexdsp/0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch b/meta/recipes-multimedia/speex/speexdsp/0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch
new file mode 100644
index 0000000..c7067da
--- /dev/null
+++ b/meta/recipes-multimedia/speex/speexdsp/0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch
@@ -0,0 +1,63 @@
+From c73370ceafd138becee8ca3c688ba75756830bfe Mon Sep 17 00:00:00 2001
+From: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+Date: Sun, 5 Jul 2015 17:48:16 +0300
+Subject: [PATCH] Don't rely on HAVE_STDINT_H et al. being defined
+
+Not everyone who includes speexdsp_config_types.h will have a test
+which defines those, and if we've chosen to use the stdint types at
+configure time then we know exactly which header(s) are available, so
+just choose the best one then and generate the header to use it.
+
+This patch, including the above text, is copied from a commit in the
+speex repository[1]. The original commit for speex was made by Ron
+<ron@debian.org>.
+
+[1] https://git.xiph.org/?p=speex.git;a=commitdiff;h=774c87d6cb7dd8dabdd17677fc6da753ecf4aa87
+
+Upstream-Status: Backport
+
+Signed-off-by: Tanu Kaskinen <tanu.kaskinen@linux.intel.com>
+---
+ configure.ac                             | 6 ++++++
+ include/speex/speexdsp_config_types.h.in | 8 +-------
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 2cd2d1e..1de0c23 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -334,6 +334,12 @@ AC_SUBST([USIZE16])
+ AC_SUBST([SIZE32])
+ AC_SUBST([USIZE32])
+ 
++AS_IF([test "$ac_cv_header_stdint_h" = "yes"],    [INCLUDE_STDINT="#include <stdint.h>"],
++      [test "$ac_cv_header_inttypes_h" = "yes"],  [INCLUDE_STDINT="#include <inttypes.h>"],
++      [test "$ac_cv_header_sys_types_h" = "yes"], [INCLUDE_STDINT="#include <sys/types.h>"])
++
++AC_SUBST([INCLUDE_STDINT])
++
+ AC_CONFIG_FILES([
+            Makefile libspeexdsp/Makefile doc/Makefile SpeexDSP.spec
+            include/Makefile include/speex/Makefile speexdsp.pc
+diff --git a/include/speex/speexdsp_config_types.h.in b/include/speex/speexdsp_config_types.h.in
+index 02b82fd..5ea7b55 100644
+--- a/include/speex/speexdsp_config_types.h.in
++++ b/include/speex/speexdsp_config_types.h.in
+@@ -1,13 +1,7 @@
+ #ifndef __SPEEX_TYPES_H__
+ #define __SPEEX_TYPES_H__
+ 
+-#if defined HAVE_STDINT_H
+-#  include <stdint.h>
+-#elif defined HAVE_INTTYPES_H
+-#  include <inttypes.h>
+-#elif defined HAVE_SYS_TYPES_H
+-#  include <sys/types.h>
+-#endif
++@INCLUDE_STDINT@
+ 
+ typedef @SIZE16@ spx_int16_t;
+ typedef @USIZE16@ spx_uint16_t;
+-- 
+1.9.3
+
diff --git a/meta/recipes-multimedia/speex/speexdsp_1.2rc3.bb b/meta/recipes-multimedia/speex/speexdsp_1.2rc3.bb
new file mode 100644
index 0000000..6b1aced
--- /dev/null
+++ b/meta/recipes-multimedia/speex/speexdsp_1.2rc3.bb
@@ -0,0 +1,39 @@
+SUMMARY = "A patent-free DSP library"
+DESCRIPTION = "SpeexDSP is a patent-free, Open Source/Free Software DSP library."
+HOMEPAGE = "http://www.speex.org"
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=314649d8ba9dd7045dfb6683f298d0a8"
+
+SRC_URI = "http://downloads.xiph.org/releases/speex/speexdsp-${PV}.tar.gz \
+           file://0001-Don-t-rely-on-HAVE_STDINT_H-et-al.-being-defined.patch"
+
+SRC_URI[md5sum] = "70d9d31184f7eb761192fd1ef0b73333"
+SRC_URI[sha256sum] = "4ae688600039f5d224bdf2e222d2fbde65608447e4c2f681585e4dca6df692f1"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "\
+        --disable-examples \
+        ${@bb.utils.contains('TARGET_FPU', 'soft', '--enable-fixed-point --disable-float-api', '', d)} \
+"
+
+# Workaround for a build failure when building with MACHINE=qemuarm64. I think
+# aarch64 is supposed to support NEON just fine, but building for qemuarm64
+# fails in NEON code:
+#
+# .../speexdsp-1.2rc3/libspeexdsp/resample_neon.h:148:5: error: impossible constraint in 'asm'
+#      asm volatile ("  cmp %[len], #0\n"
+#      ^
+#
+# I sent an email about the issue to speex-dev. At the time of writing there
+# are no responses yet:
+# http://thread.gmane.org/gmane.comp.audio.compression.speex.devel/7360
+EXTRA_OECONF += "${@bb.utils.contains('TUNE_FEATURES', 'aarch64', '--disable-neon', '', d)}"
+
+# speexdsp was split off from speex in 1.2rc2. Older versions of speex can't
+# be installed together with speexdsp, since they contain overlapping files.
+RCONFLICTS_${PN} = "speex (< 1.2rc2)"
+RCONFLICTS_${PN}-dbg = "speex-dbg (< 1.2rc2)"
+RCONFLICTS_${PN}-dev = "speex-dev (< 1.2rc2)"
+RCONFLICTS_${PN}-staticdev = "speex-staticdev (< 1.2rc2)"
diff --git a/meta/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch b/meta/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch
new file mode 100644
index 0000000..7e51029
--- /dev/null
+++ b/meta/recipes-multimedia/tremor/tremor/obsolete_automake_macros.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Submitted [https://trac.xiph.org/ticket/1922]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+Index: configure.in
+===================================================================
+--- configure.in	(revision 18764)
++++ configure.in	(working copy)
+@@ -9,7 +9,7 @@
+ AC_CANONICAL_HOST
+ AC_CANONICAL_TARGET
+
+-AM_CONFIG_HEADER([config.h])
++AC_CONFIG_HEADERS([config.h])
+
+ AM_INIT_AUTOMAKE(libvorbisidec,1.2.1)
diff --git a/meta/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch b/meta/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch
new file mode 100644
index 0000000..2049542
--- /dev/null
+++ b/meta/recipes-multimedia/tremor/tremor/tremor-arm-thumb2.patch
@@ -0,0 +1,104 @@
+From: Xin Ouyang <Xin.Ouyang@windriver.com>
+Date: Mon, 16 Jul 2012 13:29:34 +0800
+Subject: [PATCH] tremor: add IT instructions for arm thumb2 tune flags.
+
+Upstream-Status: Pending
+
+In Thumb-2, most instructions do not have a built in condition code (except for 
+conditional branches). Instead, short sequences of instructions which are to be 
+executed conditionally can be preceded by a special "IT instruction" which 
+describes the condition and which of the following instructions should be 
+executed if the condition is false respectively. 
+
+For the ARM/Thumb IT(If-Then) instruction:
+http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0489c/Cjabicci.html
+
+Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
+---
+ asm_arm.h |   14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/asm_arm.h b/asm_arm.h
+index c3bda00..823c54f 100755
+--- a/asm_arm.h
++++ b/asm_arm.h
+@@ -108,9 +108,11 @@ static inline void XNPROD31(ogg_int32_t  a, ogg_int32_t  b,
+ static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) {
+   int tmp;
+   asm volatile("subs	%1, %0, #32768\n\t"
++	       "itt     pl\n\t"
+ 	       "movpl	%0, #0x7f00\n\t"
+ 	       "orrpl	%0, %0, #0xff\n"
+ 	       "adds	%1, %0, #32768\n\t"
++	       "it      mi\n\t"
+ 	       "movmi	%0, #0x8000"
+ 	       : "+r"(x),"=r"(tmp)
+ 	       :
+@@ -139,10 +141,12 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
+       
+       "ldmdb   r0!,{r1,r3};"
+       "subs    r1,r1,%4;"          //ilsp[j]-wi
++      "it      mi;"
+       "rsbmi   r1,r1,#0;"          //labs(ilsp[j]-wi)
+       "umull   %0,r2,r1,%0;"       //qi*=labs(ilsp[j]-wi)
+       
+       "subs    r1,r3,%4;"          //ilsp[j+1]-wi
++      "it      mi;"
+       "rsbmi   r1,r1,#0;"          //labs(ilsp[j+1]-wi)
+       "umull   %1,r3,r1,%1;"       //pi*=labs(ilsp[j+1]-wi)
+       
+@@ -167,6 +171,7 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
+       "mov     r0,#0x4000;\n"
+       
+       "subs    r1,r1,%4;\n"          //ilsp[j]-wi
++      "it      mi;\n"
+       "rsbmi   r1,r1,#0;\n"          //labs(ilsp[j]-wi)
+       "umull   %0,r2,r1,%0;\n"       //qi*=labs(ilsp[j]-wi)
+       "umull   %1,r3,r0,%1;\n"       //pi*=labs(ilsp[j+1]-wi)
+@@ -190,18 +195,23 @@ static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip,
+       "mov     r2,#0;"
+       "orr     r1,%0,%1;"
+       "tst     r1,#0xff000000;"
++      "itt     ne;"
+       "addne   r2,r2,#8;"
+       "movne   r1,r1,lsr #8;"
+       "tst     r1,#0x00f00000;"
++      "itt     ne;"
+       "addne   r2,r2,#4;"
+       "movne   r1,r1,lsr #4;"
+       "tst     r1,#0x000c0000;"
++      "itt     ne;"
+       "addne   r2,r2,#2;"
+       "movne   r1,r1,lsr #2;"
+       "tst     r1,#0x00020000;"
++      "itt     ne;"
+       "addne   r2,r2,#1;"
+       "movne   r1,r1,lsr #1;"
+       "tst     r1,#0x00010000;"
++      "it      ne;"
+       "addne   r2,r2,#1;"
+       "mov     %0,%0,lsr r2;"
+       "mov     %1,%1,lsr r2;"
+@@ -222,15 +232,19 @@ static inline void lsp_norm_asm(ogg_uint32_t *qip,ogg_int32_t *qexpp){
+   ogg_int32_t qexp=*qexpp;
+ 
+   asm("tst     %0,#0x0000ff00;"
++      "itt     eq;"
+       "moveq   %0,%0,lsl #8;"
+       "subeq   %1,%1,#8;"
+       "tst     %0,#0x0000f000;"
++      "itt     eq;"
+       "moveq   %0,%0,lsl #4;"
+       "subeq   %1,%1,#4;"
+       "tst     %0,#0x0000c000;"
++      "itt     eq;"
+       "moveq   %0,%0,lsl #2;"
+       "subeq   %1,%1,#2;"
+       "tst     %0,#0x00008000;"
++      "itt     eq;"
+       "moveq   %0,%0,lsl #1;"
+       "subeq   %1,%1,#1;"
+       : "+r"(qi),"+r"(qexp)
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/tremor/tremor_20150107.bb b/meta/recipes-multimedia/tremor/tremor_20150107.bb
new file mode 100644
index 0000000..937894a
--- /dev/null
+++ b/meta/recipes-multimedia/tremor/tremor_20150107.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Fixed-point decoder"
+DESCRIPTION = "tremor is a fixed point implementation of the vorbis codec."
+SECTION = "libs"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=db1b7a668b2a6f47b2af88fb008ad555 \
+                    file://os.h;beginline=3;endline=14;md5=5c0af5e1bedef3ce8178c89f48cd6f1f"
+DEPENDS = "libogg"
+SRCDATE = "${PV}"
+PR = "r1"
+
+# SVN support for upstream version check isn't implemented yet
+RECIPE_UPSTREAM_VERSION = "20150107"
+RECIPE_UPSTREAM_DATE = "Jan 07, 2015"
+CHECK_DATE = "Aug 12, 2015"
+
+SRC_URI = "svn://svn.xiph.org/trunk;module=Tremor;rev=19427;protocol=http \
+           file://obsolete_automake_macros.patch;striplevel=0 \
+           file://tremor-arm-thumb2.patch \
+"
+
+S = "${WORKDIR}/Tremor"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--enable-shared"
+
+ARM_INSTRUCTION_SET = "arm"
diff --git a/meta/recipes-multimedia/webp/libwebp_0.4.3.bb b/meta/recipes-multimedia/webp/libwebp_0.4.3.bb
new file mode 100644
index 0000000..c4b80f6
--- /dev/null
+++ b/meta/recipes-multimedia/webp/libwebp_0.4.3.bb
@@ -0,0 +1,47 @@
+SUMMARY = "WebP is an image format designed for the Web"
+DESCRIPTION = "WebP is a method of lossy and lossless compression that can be \
+               used on a large variety of photographic, translucent and \
+               graphical images found on the web. The degree of lossy \
+               compression is adjustable so a user can choose the trade-off \
+               between file size and image quality. WebP typically achieves \
+               an average of 30% more compression than JPEG and JPEG 2000, \
+               without loss of image quality."
+HOMEPAGE = "https://developers.google.com/speed/webp/"
+SECTION = "libs"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=6e8dee932c26f2dab503abf70c96d8bb \
+                    file://PATENTS;md5=ad2580aee35468675c44d7bebba65ca8"
+
+SRC_URI = "http://downloads.webmproject.org/releases/webp/${BP}.tar.gz"
+SRC_URI[md5sum] = "08813525eeeffe7e305b4cbfade8ae9b"
+SRC_URI[sha256sum] = "efbe0d58fda936f2ed99d0b837ed7087d064d6838931f282c4618d2a3f7390c4"
+
+EXTRA_OECONF = " \
+    --disable-experimental \
+    --disable-wic \
+    --enable-libwebpmux \
+    --enable-libwebpdemux \
+    --enable-threading \
+"
+
+inherit autotools lib_package
+
+PACKAGECONFIG ??= ""
+
+# libwebpdecoder is a subset of libwebp, don't build it unless requested
+PACKAGECONFIG[decoder] = "--enable-libwebpdecoder,--disable-libwebpdecoder"
+
+# Apply for examples programs: cwebp and dwebp
+PACKAGECONFIG[gif] = "--enable-gif,--disable-gif,giflib"
+PACKAGECONFIG[jpeg] = "--enable-jpeg,--disable-jpeg,jpeg"
+PACKAGECONFIG[png] = "--enable-png,--disable-png,,libpng"
+PACKAGECONFIG[tiff] = "--enable-tiff,--disable-tiff,tiff"
+
+# Apply only for example program vwebp
+PACKAGECONFIG[gl] = "--enable-gl,--disable-gl,mesa-glut"
+
+PACKAGES =+ "${PN}-gif2webp"
+
+DESCRIPTION_${PN}-gif2webp = "Simple tool to convert animated GIFs to WebP"
+FILES_${PN}-gif2webp = "${bindir}/gif2webp"
diff --git a/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch b/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch
new file mode 100644
index 0000000..bf72fca
--- /dev/null
+++ b/meta/recipes-multimedia/x264/x264/don-t-default-to-cortex-a9-with-neon.patch
@@ -0,0 +1,29 @@
+-march flag is not in CFLAGS so this will always default to -mcpu=cortex-a8
+-mfpu=neon.
+
+Upstream-Status: Pending
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+
+diff --git a/configure b/configure
+index 2916036..f4ece40 100755
+--- a/configure
++++ b/configure
+@@ -773,9 +773,6 @@ if [ $asm = auto -a \( $ARCH = X86 -o $ARCH = X86_64 \) ] ; then
+ fi
+ 
+ if [ $asm = auto -a $ARCH = ARM ] ; then
+-    # set flags so neon is built by default
+-    echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon"
+-
+     if  cc_check '' '' '__asm__("rev ip, ip");' ; then      define HAVE_ARMV6
+         cc_check '' '' '__asm__("movt r0, #0");'         && define HAVE_ARMV6T2
+         cc_check '' '' '__asm__("vadd.i16 q0, q0, q0");' && define HAVE_NEON
+@@ -788,8 +785,6 @@ if [ $asm = auto -a $ARCH = ARM ] ; then
+ fi
+ 
+ if [ $asm = auto -a $ARCH = AARCH64 ] ; then
+-    # set flags so neon is built by default
+-    echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu|-arch)' || CFLAGS="$CFLAGS -arch arm64 -mfpu=neon"
+ 
+     if  cc_check '' '' '__asm__("cmeq v0.8h, v0.8h, #0");' ; then define HAVE_NEON
+         ASFLAGS="$ASFLAGS -c"
diff --git a/meta/recipes-multimedia/x264/x264_git.bb b/meta/recipes-multimedia/x264/x264_git.bb
new file mode 100644
index 0000000..0a69909
--- /dev/null
+++ b/meta/recipes-multimedia/x264/x264_git.bb
@@ -0,0 +1,55 @@
+SUMMARY = "H.264/MPEG-4 AVC video encoder"
+DESCRIPTION = "A free software library and application for encoding video streams into the H.264/MPEG-4 AVC format."
+HOMEPAGE = "http://www.videolan.org/developers/x264.html"
+
+LICENSE = "GPLv2"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"
+
+DEPENDS = "yasm-native"
+
+SRC_URI = "git://git.videolan.org/x264.git \
+           file://don-t-default-to-cortex-a9-with-neon.patch \
+           "
+
+SRCREV = "c8a773ebfca148ef04f5a60d42cbd7336af0baf6"
+
+PV = "r2491+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit lib_package pkgconfig perlnative
+
+X264_DISABLE_ASM = ""
+X264_DISABLE_ASM_armv4 = "--disable-asm"
+X264_DISABLE_ASM_armv5 = "--disable-asm"
+X264_DISABLE_ASM_powerpc = "${@bb.utils.contains("TUNE_FEATURES", "spe", "--disable-asm", "", d)}"
+
+EXTRA_OECONF = '--prefix=${prefix} \
+                --host=${HOST_SYS} \
+                --libdir=${libdir} \
+                --cross-prefix=${TARGET_PREFIX} \
+                --sysroot=${STAGING_DIR_TARGET} \
+                --enable-shared \
+                --enable-static \
+                --disable-lavf \
+                --disable-swscale \
+                --enable-pic \
+                ${X264_DISABLE_ASM} \
+               '
+
+do_configure() {
+    ./configure ${EXTRA_OECONF}
+}
+
+# Get rid of -e
+EXTRA_OEMAKE = ""
+AS = "${TARGET_PREFIX}gcc"
+
+do_install() {
+    oe_runmake install DESTDIR=${D}
+}
+
+# PIC can't be enabled for 32-bit x86
+INSANE_SKIP_${PN}_append_x86 = " textrel"
+
diff --git a/meta/recipes-qt/images/qt4e-demo-image.bb b/meta/recipes-qt/images/qt4e-demo-image.bb
new file mode 100644
index 0000000..4451848
--- /dev/null
+++ b/meta/recipes-qt/images/qt4e-demo-image.bb
@@ -0,0 +1,14 @@
+DESCRIPTION = "An image that will launch into the demo application for the embedded (not based on X11) version of Qt."
+LICENSE = "MIT"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+IMAGE_INSTALL += "\
+	${CORE_IMAGE_BASE_INSTALL} \
+	packagegroup-core-qt4e \
+"
+
+inherit core-image
+
diff --git a/meta/recipes-qt/meta/meta-toolchain-qt.bb b/meta/recipes-qt/meta/meta-toolchain-qt.bb
new file mode 100644
index 0000000..a10103a
--- /dev/null
+++ b/meta/recipes-qt/meta/meta-toolchain-qt.bb
@@ -0,0 +1,5 @@
+# Qt toolchain
+QTNAME = "qt"
+QT_DIR_NAME = "qt4"
+
+require meta-toolchain-qt.inc
diff --git a/meta/recipes-qt/meta/meta-toolchain-qt.inc b/meta/recipes-qt/meta/meta-toolchain-qt.inc
new file mode 100644
index 0000000..7e75d93
--- /dev/null
+++ b/meta/recipes-qt/meta/meta-toolchain-qt.inc
@@ -0,0 +1,35 @@
+TOOLCHAIN_HOST_TASK = "nativesdk-packagegroup-${QTNAME}-toolchain-host packagegroup-cross-canadian-${MACHINE}"
+TOOLCHAIN_TARGET_TASK = "packagegroup-${QTNAME}-toolchain-target"
+TOOLCHAIN_OUTPUTNAME = "${SDK_NAME}-toolchain-${QTNAME}-${DISTRO_VERSION}"
+
+require recipes-core/meta/meta-toolchain.bb
+
+QT_TOOLS_PREFIX = "$OECORE_NATIVE_SYSROOT${bindir_nativesdk}"
+
+create_sdk_files_append() {
+    mkdir -p ${SDK_OUTPUT}${SDKPATHNATIVE}/environment-setup.d/
+    script=${SDK_OUTPUT}${SDKPATHNATIVE}/environment-setup.d/${QT_DIR_NAME}.sh
+
+    echo 'export OE_QMAKE_CFLAGS="$CFLAGS"' > $script
+    echo 'export OE_QMAKE_CXXFLAGS="$CXXFLAGS"' >> $script
+    echo 'export OE_QMAKE_LDFLAGS="$LDFLAGS"' >> $script
+    echo 'export OE_QMAKE_CC=$CC' >> $script
+    echo 'export OE_QMAKE_CXX=$CXX' >> $script
+    echo 'export OE_QMAKE_LINK=$CXX' >> $script
+    echo 'export OE_QMAKE_AR=$AR' >> $script
+    echo 'export OE_QMAKE_LIBDIR_QT=$OECORE_TARGET_SYSROOT${libdir}' >> $script
+    echo 'export OE_QMAKE_INCDIR_QT=$OECORE_TARGET_SYSROOT${includedir}/${QT_DIR_NAME}' >> $script
+    echo 'export OE_QMAKE_MOC=${QT_TOOLS_PREFIX}/moc4' >> $script
+    echo 'export OE_QMAKE_UIC=${QT_TOOLS_PREFIX}/uic4' >> $script
+    echo 'export OE_QMAKE_UIC3=${QT_TOOLS_PREFIX}/uic34' >> $script
+    echo 'export OE_QMAKE_RCC=${QT_TOOLS_PREFIX}/rcc4' >> $script
+    echo 'export OE_QMAKE_QDBUSCPP2XML=${QT_TOOLS_PREFIX}/qdbuscpp2xml4' >> $script
+    echo 'export OE_QMAKE_QDBUSXML2CPP=${QT_TOOLS_PREFIX}/qdbusxml2cpp4' >> $script
+    echo 'export OE_QMAKE_QT_CONFIG=$OECORE_TARGET_SYSROOT${datadir}/${QT_DIR_NAME}/mkspecs/qconfig.pri' >> $script
+    echo 'export QMAKESPEC=$OECORE_TARGET_SYSROOT${datadir}/${QT_DIR_NAME}/mkspecs/linux-g++' >> $script
+    echo 'export QT_CONF_PATH=$OECORE_NATIVE_SYSROOT${sysconfdir}/qt.conf' >> $script
+
+    # make a symbolic link to mkspecs for compatibility with Qt SDK
+    # and Qt Creator
+    (cd ${SDK_OUTPUT}/${SDKPATHNATIVE}${bindir_nativesdk}/..; ln -s ${SDKTARGETSYSROOT}/usr/share/${QT_DIR_NAME}/mkspecs mkspecs;)
+}
diff --git a/meta/recipes-qt/meta/meta-toolchain-qte.bb b/meta/recipes-qt/meta/meta-toolchain-qte.bb
new file mode 100644
index 0000000..9113f48
--- /dev/null
+++ b/meta/recipes-qt/meta/meta-toolchain-qte.bb
@@ -0,0 +1,6 @@
+# Qt Embedded toolchain
+PR = "r6"
+QTNAME = "qte"
+QT_DIR_NAME = "qtopia"
+
+require meta-toolchain-qt.inc
diff --git a/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.bb b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.bb
new file mode 100644
index 0000000..b95cc5e
--- /dev/null
+++ b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.bb
@@ -0,0 +1,3 @@
+require nativesdk-packagegroup-qt-toolchain-host.inc
+
+SUMMARY = "Host packages for Qt SDK"
diff --git a/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.inc b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.inc
new file mode 100644
index 0000000..a3c275f
--- /dev/null
+++ b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qt-toolchain-host.inc
@@ -0,0 +1,6 @@
+require recipes-core/packagegroups/nativesdk-packagegroup-sdk-host.bb
+
+DESCRIPTION = "Host packages for Qt Embedded SDK"
+LICENSE = "MIT"
+
+RDEPENDS_${PN} += "nativesdk-qt4-tools"
diff --git a/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qte-toolchain-host.bb b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qte-toolchain-host.bb
new file mode 100644
index 0000000..296e4b8
--- /dev/null
+++ b/meta/recipes-qt/packagegroups/nativesdk-packagegroup-qte-toolchain-host.bb
@@ -0,0 +1,3 @@
+require nativesdk-packagegroup-qt-toolchain-host.inc
+
+SUMMARY = "Host packages for Qt Embedded SDK"
diff --git a/meta/recipes-qt/packagegroups/packagegroup-core-qt.bb b/meta/recipes-qt/packagegroups/packagegroup-core-qt.bb
new file mode 100644
index 0000000..b81f8a3
--- /dev/null
+++ b/meta/recipes-qt/packagegroups/packagegroup-core-qt.bb
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2010  Intel Corporation. All rights reserved
+#
+
+SUMMARY = "Qt package groups"
+LICENSE = "MIT"
+PR = "r4"
+
+# Qt4 could NOT be built on MIPS64 with 64 bits userspace
+COMPATIBLE_HOST_mips64 = "null"
+
+inherit packagegroup distro_features_check
+
+# The quicky and fotowall requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGES = "${PN}-demoapps"
+
+QTDEMOS ?= "quicky ${COMMERCIAL_QT} fotowall"
+
+SUMMARY_${PN}-demoapps = "Qt demo applications"
+RDEPENDS_${PN}-demoapps = "${QTDEMOS}"
diff --git a/meta/recipes-qt/packagegroups/packagegroup-core-qt4e.bb b/meta/recipes-qt/packagegroups/packagegroup-core-qt4e.bb
new file mode 100644
index 0000000..eb5fa1f
--- /dev/null
+++ b/meta/recipes-qt/packagegroups/packagegroup-core-qt4e.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Qt for Embedded Linux (Qt without X11)"
+PR = "r2"
+LICENSE = "MIT"
+
+# Qt4 could NOT be built on MIPS64 with 64 bits userspace
+COMPATIBLE_HOST_mips64 = "null"
+
+inherit packagegroup
+
+TOUCH = ' ${@bb.utils.contains("MACHINE_FEATURES", "touchscreen", "tslib tslib-calibrate tslib-tests", "",d)}'
+
+RDEPENDS_${PN} = " \
+	qt4-embedded \
+	libqt-embedded3support4 \
+	libqt-embeddedclucene4 \
+	libqt-embeddedcore4 \
+	libqt-embeddeddbus4 \
+	libqt-embeddedgui4 \
+	libqt-embeddedhelp4 \
+	libqt-embeddedmultimedia4 \
+	libqt-embeddednetwork4 \
+	libqt-embeddedscript4 \
+	libqt-embeddedscripttools4 \
+	libqt-embeddedsql4 \
+	libqt-embeddedsvg4 \
+	libqt-embeddedtest4 \
+	libqt-embeddedwebkit4 \
+	libqt-embeddedxml4 \
+	qt4-embedded-fonts-ttf-dejavu \
+	qt4-embedded-fonts-ttf-vera \
+	qt4-embedded-plugin-iconengine-svgicon \
+	qt4-embedded-plugin-imageformat-gif \
+	qt4-embedded-plugin-imageformat-ico \
+	qt4-embedded-plugin-imageformat-jpeg \
+	qt4-embedded-plugin-imageformat-mng \
+	qt4-embedded-plugin-imageformat-svg \
+	qt4-embedded-plugin-imageformat-tiff \
+	qt4-embedded-plugin-mousedriver-tslib \
+	qt4-embedded-plugin-script-dbus \
+	qt4-embedded-plugin-sqldriver-sqlite \
+	${TOUCH} \
+        qt4-embedded-demos \
+        qt4-embedded-examples \
+        qt-demo-init \
+        qt4-embedded-assistant \
+"
+
+RRECOMMENDS_${PN} = " \
+	libqt-embeddedxmlpatterns4 \
+	qt4-embedded-plugin-phonon-backend-gstreamer \
+"
+
diff --git a/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.bb b/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.bb
new file mode 100644
index 0000000..772c151
--- /dev/null
+++ b/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.bb
@@ -0,0 +1,15 @@
+SUMMARY = "Target packages for Qt SDK"
+
+QTLIBPREFIX = ""
+
+require packagegroup-qt-toolchain-target.inc
+
+inherit distro_features_check
+# depends on qt4-x11-free
+REQUIRED_DISTRO_FEATURES = "x11"
+
+RDEPENDS_${PN} += " \
+        qt4-x11-free-dev \
+        ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'libqtopengl4-dev', '', d)} \
+        ${@bb.utils.contains('DISTRO_FEATURES', 'openvg', 'libqtopenvg4-dev', '', d)} \
+        "
diff --git a/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.inc b/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.inc
new file mode 100644
index 0000000..e09782d
--- /dev/null
+++ b/meta/recipes-qt/packagegroups/packagegroup-qt-toolchain-target.inc
@@ -0,0 +1,39 @@
+LICENSE = "MIT"
+
+# Qt4 could NOT be built on MIPS64 with 64 bits userspace
+COMPATIBLE_HOST_mips64 = "null"
+
+inherit packagegroup
+
+PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"
+
+RDEPENDS_${PN} += " \
+        packagegroup-core-standalone-sdk-target \
+        qt4${QTLIBPREFIX}-mkspecs \
+        libqt${QTLIBPREFIX}multimedia4-dev \
+        libqt${QTLIBPREFIX}3support4-dev \
+        libqt${QTLIBPREFIX}clucene4-dev \
+        libqt${QTLIBPREFIX}core4-dev \
+        libqt${QTLIBPREFIX}dbus4-dev \
+        libqt${QTLIBPREFIX}designercomponents4-dev \
+        libqt${QTLIBPREFIX}designer4-dev \
+        libqt${QTLIBPREFIX}uitools4-dev \
+        libqt${QTLIBPREFIX}gui4-dev \
+        libqt${QTLIBPREFIX}help4-dev \
+        libqt${QTLIBPREFIX}network4-dev \
+        libqt${QTLIBPREFIX}script4-dev \
+        libqt${QTLIBPREFIX}scripttools4-dev \
+        libqt${QTLIBPREFIX}sql4-dev \
+        libqt${QTLIBPREFIX}svg4-dev \
+        libqt${QTLIBPREFIX}test4-dev \
+        libqt${QTLIBPREFIX}webkit4-dev \
+        libqt${QTLIBPREFIX}xml4-dev \
+        libqt${QTLIBPREFIX}declarative4-dev \
+        libqt${QTLIBPREFIX}xmlpatterns4-dev \
+        libsqlite3-dev \
+        expat-dev \
+        "
+
+RRECOMMENDS_${PN} += " \
+        libqt${QTLIBPREFIX}phonon4-dev \
+        "
diff --git a/meta/recipes-qt/packagegroups/packagegroup-qte-toolchain-target.bb b/meta/recipes-qt/packagegroups/packagegroup-qte-toolchain-target.bb
new file mode 100644
index 0000000..92ed237
--- /dev/null
+++ b/meta/recipes-qt/packagegroups/packagegroup-qte-toolchain-target.bb
@@ -0,0 +1,7 @@
+SUMMARY = "Target packages for Qt Embedded SDK"
+
+PR = "r7"
+
+QTLIBPREFIX = "-embedded"
+
+require packagegroup-qt-toolchain-target.inc
diff --git a/meta/recipes-qt/qt-apps/fotowall/ExportWizard-depends-on-ui_wizard.patch b/meta/recipes-qt/qt-apps/fotowall/ExportWizard-depends-on-ui_wizard.patch
new file mode 100644
index 0000000..d8b2b23
--- /dev/null
+++ b/meta/recipes-qt/qt-apps/fotowall/ExportWizard-depends-on-ui_wizard.patch
@@ -0,0 +1,18 @@
+App/ExportWizard.cpp depends on wizard.h which depends on ui_wizard. The last one
+should be already generated before compiling ExportWizard.cpp.
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+Upstream-Status: Pending
+
+Index: Fotowall-0.9/App/ExportWizard.cpp
+===================================================================
+--- Fotowall-0.9.orig/App/ExportWizard.cpp	2009-11-30 13:21:31.000000000 +0200
++++ Fotowall-0.9/App/ExportWizard.cpp	2012-05-10 17:12:06.765230830 +0300
+@@ -23,6 +23,7 @@
+ #include "imageloaderqt.h"
+ #include "posterazorcore.h"
+ #include "wizard.h"
++#include "ui_wizard.h"
+ 
+ #include <QDesktopServices>
+ #include <QDesktopWidget>
diff --git a/meta/recipes-qt/qt-apps/fotowall_0.9.bb b/meta/recipes-qt/qt-apps/fotowall_0.9.bb
new file mode 100644
index 0000000..3af0265
--- /dev/null
+++ b/meta/recipes-qt/qt-apps/fotowall_0.9.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Creative photo display application"
+DESCRIPTION = "Fotowall is a creative tool that allows you to layout your photos or pictures \
+in a personal way. You can add pictures, then resize, move, change colors, text, shadows, etc.."
+
+HOMEPAGE = "http://www.enricoros.com/opensource/fotowall"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://GPL_V2;md5=79808397c3355f163c012616125c9e26 \
+                    file://main.cpp;beginline=6;endline=11;md5=b569acc2bf8974a3082b58fc53b9d8dc"
+SECTION = "x11/apps"
+
+PR = "r4"
+
+SRCREV = "06d5a4142c599604d9a9fd64727b6945eb8cd3da"
+SRC_URI = "git://github.com/enricoros/fotowall.git \
+           file://ExportWizard-depends-on-ui_wizard.patch \
+           "
+
+S = "${WORKDIR}/git"
+
+inherit qt4x11
+
+EXTRA_QMAKEVARS_PRE = "CONFIG+=no-webcam"
+
+do_install() {
+	oe_runmake INSTALL_ROOT=${D} install
+}
+
+# Ensure we have some plugins for some useful image formats
+RRECOMMENDS_${PN} += "qt4-plugin-imageformat-gif qt4-plugin-imageformat-jpeg qt4-plugin-imageformat-tiff"
diff --git a/meta/recipes-qt/qt-apps/qmmp/no-host-paths.patch b/meta/recipes-qt/qt-apps/qmmp/no-host-paths.patch
new file mode 100644
index 0000000..2bb5bb1
--- /dev/null
+++ b/meta/recipes-qt/qt-apps/qmmp/no-host-paths.patch
@@ -0,0 +1,26 @@
+Do not include /usr/include host paths
+
+These were added upstream apparently for freebsd support, but trigger
+compiler warnings during the build and could be dangerous, so remove
+them.
+
+Upstream-Status: Inappropriate [cross]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+Update patch for version 0.7.4.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+--- qmmp-0.7.4/CMakeLists.txt	2014-01-10 09:59:44.971837746 +0800
++++ qmmp-0.7.4/CMakeLists.txt.new	2014-01-10 10:24:51.855837566 +0800
+@@ -1,9 +1,5 @@
+ cmake_minimum_required(VERSION 2.6.0)
+ 
+-#freebsd support
+-include_directories(SYSTEM /usr/local/include)
+-SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} /usr/local/include)
+-
+ #extract version from qmmp.h
+ FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/src/qmmp/qmmp.h"
+      QMMP_VERSION_DATA REGEX "^#define[ \t]+QMMP_VERSION_[A-Z]+[ \t]+[0-9]+.*$")
diff --git a/meta/recipes-qt/qt-apps/qmmp_0.8.6.bb b/meta/recipes-qt/qt-apps/qmmp_0.8.6.bb
new file mode 100644
index 0000000..e68ad0f
--- /dev/null
+++ b/meta/recipes-qt/qt-apps/qmmp_0.8.6.bb
@@ -0,0 +1,76 @@
+SUMMARY = "Qt-based Multimedia Player"
+DESCRIPTION = "Qmmp is an audio player, written with the help of the Qt library. The user interface is similar to Winamp or XMMS."
+HOMEPAGE = "http://qmmp.ylsoftware.com"
+LICENSE = "GPLv2"
+LICENSE_FLAGS = "commercial"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+SECTION = "multimedia"
+
+DEPENDS = "taglib libmad libvorbis libogg alsa-lib libsndfile1 libsamplerate0 curl"
+
+SRC_URI = "http://qmmp.ylsoftware.com/files/${BP}.tar.bz2 \
+           file://no-host-paths.patch \
+          "
+
+SRC_URI[md5sum] = "67e96e89c61b7432e5a12f555db702b1"
+SRC_URI[sha256sum] = "0daea3f0a0df7b34089513c2c57413c82816ab8892bddabf49c18a7956255449"
+inherit cmake qt4x11
+
+QMMP_PLUGIN_OPTIONS ??= "\
+                        -DUSE_MMS:BOOL=FALSE \
+                        -DUSE_MPC:BOOL=FALSE \
+                        -DUSE_MODPLUG:BOOL=FALSE \
+                        -DUSE_WAVPACK:BOOL=FALSE \
+                        -DUSE_FFMPEG:BOOL=FALSE \
+                        -DUSE_AAC:BOOL=FALSE \
+                        -DUSE_CDA:BOOL=FALSE \
+                        -DUSE_MIDI:BOOL=FALSE \
+                        -DUSE_GME:BOOL=FALSE \
+                        -DUSE_OSS4:BOOL=FALSE \
+                        -DUSE_JACK:BOOL=FALSE \
+                        -DUSE_BS2B:BOOL=FALSE \
+                        -DUSE_PROJECTM:BOOL=FALSE \
+                        -DUSE_ENCA:BOOL=FALSE \
+                        "
+
+export EXTRA_OECMAKE = "-DQT_QMAKE_EXECUTABLE=${OE_QMAKE_QMAKE} \
+                        -DQT_LRELEASE_EXECUTABLE=${OE_QMAKE_LRELEASE} \
+                        -DQT_MOC_EXECUTABLE=${OE_QMAKE_MOC} \
+                        -DQT_UIC_EXECUTABLE=${OE_QMAKE_UIC} \
+                        -DQT_RCC_EXECUTABLE=${OE_QMAKE_RCC} \
+                        -DQT_LIBRARY_DIR=${OE_QMAKE_LIBDIR_QT} \
+                        -DQT_HEADERS_DIR=${OE_QMAKE_INCDIR_QT} \
+                        -DQT_QTCORE_INCLUDE_DIR=${OE_QMAKE_INCDIR_QT}/QtCore \
+                        ${QMMP_PLUGIN_OPTIONS} \
+                        "
+
+do_configure() {
+	# Ensure we get the cmake configure and not qmake
+	cmake_do_configure
+}
+
+PACKAGES_DYNAMIC += "^qmmp-plugin-.* "
+
+python populate_packages_prepend () {
+    qmmp_libdir = d.expand('${libdir}/qmmp')
+    gd = d.expand('${D}/${libdir}/qmmp')
+    plug_dirs = os.listdir(gd)
+
+    for plug_dir in plug_dirs:
+        g_plug_dir = os.path.join(qmmp_libdir,plug_dir)
+        do_split_packages(d, g_plug_dir, '^lib(.*)\.so$', 'qmmp-plugin-' + plug_dir.lower() + '-%s', 'Qmmp ' + plug_dir  + ' plugin for %s')
+}
+
+FILES_${PN} = "\
+                ${bindir}/qmmp \
+                ${libdir}/lib*${SOLIBS} \
+                ${datadir}/icons/* \
+                ${datadir}/qmmp/images/* \
+                ${datadir}/applications/* \
+                "
+
+FILES_${PN}-dbg += "\
+                ${libdir}/qmmp/*/.debug/* \
+               "
+
+RDEPENDS_${PN} += "taglib alsa-lib libmad curl libicui18n"
diff --git a/meta/recipes-qt/qt-apps/quicky_0.4.bb b/meta/recipes-qt/qt-apps/quicky_0.4.bb
new file mode 100644
index 0000000..bcaa562
--- /dev/null
+++ b/meta/recipes-qt/qt-apps/quicky_0.4.bb
@@ -0,0 +1,19 @@
+SUMMARY = "A simple note-taking application with Wiki-style syntax and behaviour"
+HOMEPAGE = "http://qt-apps.org/content/show.php/Quicky?content=80325"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://version.h;endline=19;md5=878bdaff438dab86298301fd1a210e14"
+SECTION = "x11/apps"
+
+PR = "r2"
+
+SRC_URI = "http://qt-apps.org/CONTENT/content-files/80325-quicky-0.4.tar.gz"
+
+SRC_URI[md5sum] = "824d9e477ee9c4994f73a3cb215161d9"
+SRC_URI[sha256sum] = "9c66376e0035d44547612bf629890769a6178c3e7eafbcf95f1c6207ac0f352a"
+
+inherit qt4x11
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 ${S}/${BPN} ${D}${bindir}
+}
diff --git a/meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init b/meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init
new file mode 100644
index 0000000..21f0273
--- /dev/null
+++ b/meta/recipes-qt/qt-demo/qt-demo-init/qtdemo-init
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+set -e
+
+if [ -x /usr/bin/qtdemo ]; then
+	QTDEMO="qtdemo"
+else
+	QTDEMO="qtdemoE -qws"
+fi
+
+case "$1" in
+  start)
+	echo "Starting qtdemo"
+	if [ -f /etc/profile.d/tslib.sh ]; then
+		. /etc/profile.d/tslib.sh
+	fi
+	if [ -e "$TSLIB_TSDEVICE" ]; then
+		if [ ! -f /etc/pointercal ]; then
+			/usr/bin/ts_calibrate
+		fi
+		if [ "$QTDEMO" = "qtdemo" ]; then
+			Xorg &
+			export DISPLAY=:0
+			$QTDEMO &
+		else
+			QWS_MOUSE_PROTO=tslib:$TSLIB_TSDEVICE $QTDEMO &
+		fi
+	else
+		if [ "$QTDEMO" = "qtdemo" ]; then
+			Xorg &
+			export DISPLAY=:0
+		fi
+		$QTDEMO &
+	fi
+	;;
+  stop)
+	echo "Stopping qtdemo"
+	if [ "$QTDEMO" = "qtdemo" ]; then
+		killall Xorg
+		killall qtdemo
+	else
+		killall qtdemoE
+	fi
+	;;
+  restart)
+	$0 stop
+	$0 start
+	;;
+  *)
+	echo "usage: $0 { start | stop | restart }" >&2
+	exit 1
+	;;
+esac
+
+exit 0
diff --git a/meta/recipes-qt/qt-demo/qt-demo-init_0.1.bb b/meta/recipes-qt/qt-demo/qt-demo-init_0.1.bb
new file mode 100644
index 0000000..aa1b0b6
--- /dev/null
+++ b/meta/recipes-qt/qt-demo/qt-demo-init_0.1.bb
@@ -0,0 +1,19 @@
+SUMMARY = "Init script for qtdemo"
+LICENSE = "MIT"
+SRC_URI = "file://qtdemo-init"
+PR = "r3"
+
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+S = "${WORKDIR}"
+
+do_install() {
+	install -d ${D}${sysconfdir}/init.d/
+	install -m 0755 ${WORKDIR}/qtdemo-init ${D}${sysconfdir}/init.d/qtdemo
+}
+
+inherit update-rc.d allarch
+
+INITSCRIPT_NAME = "qtdemo"
+INITSCRIPT_PARAMS = "start 99 5 2 . stop 19 0 1 6 ."
diff --git a/meta/recipes-qt/qt4-graphics-system/qt4-graphics-system_1.0.bb b/meta/recipes-qt/qt4-graphics-system/qt4-graphics-system_1.0.bb
new file mode 100644
index 0000000..ff3f3da
--- /dev/null
+++ b/meta/recipes-qt/qt4-graphics-system/qt4-graphics-system_1.0.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Sets default Qt4 Graphics System to ${QT_GRAPHICS_SYSTEM}"
+SECTION = "x11/base"
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PR = "r1"
+
+QT_GRAPHICS_SYSTEM ?= "raster"
+
+def _get_extra_rdepends(d):
+    gs = d.getVar('QT_GRAPHICS_SYSTEM', True)
+    if gs == "opengl":
+        return "qt4-plugin-graphicssystems-glgraphicssystem"
+
+    return ""
+
+do_install () {
+	install -d ${D}/${sysconfdir}/profile.d/
+	cfg_file=${D}/${sysconfdir}/profile.d/qt-graphicssystem
+	echo "export QT_GRAPHICSSYSTEM=${QT_GRAPHICS_SYSTEM}" > $cfg_file
+}
+
+RDEPENDS_${PN} = "${@_get_extra_rdepends(d)}"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
diff --git a/meta/recipes-qt/qt4/nativesdk-qt4-tools.inc b/meta/recipes-qt/qt4/nativesdk-qt4-tools.inc
new file mode 100644
index 0000000..077008b
--- /dev/null
+++ b/meta/recipes-qt/qt4/nativesdk-qt4-tools.inc
@@ -0,0 +1,125 @@
+SUMMARY = "SDK tools for Qt version 4.x"
+DEPENDS = "nativesdk-zlib nativesdk-dbus qt4-native ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11', '', d)}"
+SECTION = "libs"
+HOMEPAGE = "http://qt-project.org/"
+LICENSE = "LGPLv2.1 | GPLv3"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/qt4-${PV}:"
+
+inherit nativesdk qmake2
+
+SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-everywhere-opensource-src-${PV}.tar.gz \
+           file://0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \
+           file://0004-configure-qmake-is-already-built-in-qt4-tools-native.patch \
+           file://0005-configure-set-LFLAGS-to-pick-up-zlib-from-staging.patch \
+           file://0006-configure-Use-OE_QMAKE_-values-to-specify-Qt-utility.patch \
+           file://0007-dbus-Remove-const-usage-that-causes-compile-failure-.patch \
+           file://0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch \
+           file://g++.conf \
+           file://linux.conf"
+
+S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}"
+
+LIC_FILES_CHKSUM = "file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24 \
+                    file://LICENSE.GPL3;md5=6e1694ee338db410417517884918d4d2 \
+                    file://LGPL_EXCEPTION.txt;md5=0145c4d1b6f96a661c2c139dfb268fb6"
+
+require qt4_arch.inc
+
+# FIXME: make it work with "${STAGING_BINDIR_NATIVE}/pkg-config --cflags dbus-1"
+EXTRA_OECONF = "-prefix ${prefix} \
+                -qt-libjpeg -system-zlib \
+                -no-libjpeg -no-libpng -no-libmng -no-libtiff \
+                -no-accessibility \
+                -no-cups \
+                -no-exceptions  \
+                -no-nas-sound \
+                -no-nis -no-openssl \
+                -verbose -release -fast -static \
+                -platform ${TARGET_OS}-oe-g++ \
+                -xplatform ${TARGET_OS}-oe-g++ \
+                -arch ${QT_ARCH} \
+                -embedded -no-freetype -no-glib -no-iconv \
+                -qt3support \
+                -I${STAGING_DIR_HOST}${SDKPATHNATIVE}/usr/include/dbus-1.0 \
+                -I${STAGING_DIR_HOST}${SDKPATHNATIVE}/usr/lib/dbus-1.0/include"
+
+# yank default -e, otherwise we get the following error:
+# moc_qbuffer.cpp: No such file or directory
+EXTRA_OEMAKE = " "
+
+do_configure() {
+    # Avoid problems with Qt 4.8.0 configure setting QMAKE_LINK from LD (since we want the linker to be g++)
+    unset LD
+
+    if [ ! -e mkspecs/${TARGET_OS}-oe-g++ ]; then
+        ln -sf linux-g++ mkspecs/${TARGET_OS}-oe-g++
+    fi
+
+    cp ../g++.conf mkspecs/common
+    cp ../linux.conf mkspecs/common
+
+    if [ -f mkspecs/common/g++-base.conf ] ; then
+        # don't use host g++ even during configure (4.8.0+)
+        sed -i -e "s#= g++#= ${CXX}#" mkspecs/common/g++-base.conf
+        sed -i -e "s#= gcc#= ${CC}#" mkspecs/common/g++-base.conf
+    fi
+
+    # Use qmake from qt4-native for building
+    if [ ! -e bin/qmake ]; then
+        ln -sf ${STAGING_BINDIR_NATIVE}/qmake2 bin/qmake
+    fi
+    set_arch
+    (echo o; echo yes) | CC="${CC}" CXX="${CXX}" ./configure ${EXTRA_OECONF} || die "Configuring qt failed. EXTRA_OECONF was ${EXTRA_OECONF}"
+}
+
+TOBUILD = "\
+  src/tools/bootstrap \
+  src/tools/moc \
+  src/corelib \
+  src/sql \
+  src/dbus \
+  src/qt3support \
+  src/xml \
+  src/tools/uic \
+  src/tools/rcc \
+  src/network \
+  src/gui \
+  src/tools/uic3 \
+  tools/linguist/lrelease \
+  tools/linguist/lupdate \
+  tools/qdbus \
+"
+
+do_compile() {
+    for i in ${TOBUILD}; do
+        cd ${S}/$i && oe_runmake CC="${CC}" CXX="${CXX}"
+    done
+
+    # Build nativesdk qmake
+    export QMAKESPEC="${S}/mkspecs/${TARGET_OS}-oe-g++"
+    cd ${S}/qmake
+    ${OE_QMAKE_QMAKE}
+    oe_runmake CC="${CC}" CXX="${CXX}"
+    cd ${S}
+}
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 bin/qmake2 ${D}${bindir}/qmake2
+    for i in moc uic uic3 rcc lrelease lupdate qdbuscpp2xml qdbusxml2cpp; do
+        install -m 0755 bin/${i} ${D}${bindir}/${i}4
+    done
+
+    (cd ${D}${bindir}; \
+    ln -s qmake2 qmake; \
+    for i in moc uic uic3 rcc lrelease lupdate qdbuscpp2xml qdbusxml2cpp; do \
+        ln -s ${i}4 ${i}; \
+    done)
+
+    install -d ${D}${sysconfdir}
+    cat >${D}${sysconfdir}/qt.conf <<EOF
+[Paths]
+Prefix = ${prefix}
+EOF
+}
diff --git a/meta/recipes-qt/qt4/nativesdk-qt4-tools_4.8.7.bb b/meta/recipes-qt/qt4/nativesdk-qt4-tools_4.8.7.bb
new file mode 100644
index 0000000..90ba07c
--- /dev/null
+++ b/meta/recipes-qt/qt4/nativesdk-qt4-tools_4.8.7.bb
@@ -0,0 +1,6 @@
+require nativesdk-qt4-tools.inc
+
+SRC_URI += "file://0009-qmake-fix-source-file-references-in-qmake.pri.patch"
+
+SRC_URI[md5sum] = "d990ee66bf7ab0c785589776f35ba6ad"
+SRC_URI[sha256sum] = "e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0"
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7.inc b/meta/recipes-qt/qt4/qt4-4.8.7.inc
new file mode 100644
index 0000000..5257e76
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7.inc
@@ -0,0 +1,68 @@
+LICENSE = "LGPLv2.1 | GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24 \
+                    file://LICENSE.GPL3;md5=6e1694ee338db410417517884918d4d2 \
+                    file://LGPL_EXCEPTION.txt;md5=0145c4d1b6f96a661c2c139dfb268fb6"
+
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/qt4-${PV}:"
+
+SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-everywhere-opensource-src-${PV}.tar.gz \
+           file://0003-webkit2-set-OUTPUT_DIR-value-if-empty.patch \
+           file://0004-configure-qmake-is-already-built-in-qt4-tools-native.patch \
+           file://0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch \
+           file://0009-qmake-fix-source-file-references-in-qmake.pri.patch \
+           file://0010-configure-Hack-to-not-use-the-pg_config-of-the-host-.patch \
+           file://0011-freetype-host-includes.patch \
+           file://0012-Add-2bpp-support.patch \
+           file://0013-configure-add-crossarch-option.patch \
+           file://0014-translations-fix-phony-translation-linking-error.patch \
+           file://0015-configure-add-nostrip-for-debug-packages.patch \
+           file://0016-configure-eval-QMAKE_CXX.patch \
+           file://0017-configure-ensure-we-identify-the-compiler-as-g-in-co.patch \
+           file://0018-configure-make-pulseaudio-a-configurable-option.patch \
+           file://0019-Fixes-for-gcc-4.7.0-particularly-on-qemux86.patch \
+           file://0027-tools.pro-disable-qmeegographicssystemhelper.patch \
+           file://0028-Don-t-crash-on-broken-GIF-images.patch \
+           file://0030-aarch64_arm64_qatomic_support.patch \
+           file://0031-aarch64_arm64_mkspecs.patch \
+           file://0032-aarch64_add_header.patch \
+           file://Fix-QWSLock-invalid-argument-logs.patch \
+           file://add_check_for_aarch64_32.patch \
+           file://g++.conf \
+           file://linux.conf \
+           "
+
+SRC_URI[md5sum] = "d990ee66bf7ab0c785589776f35ba6ad"
+SRC_URI[sha256sum] = "e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0"
+
+S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}"
+
+# disable webkit for mips64 n32 temporarily that fails to compile,
+# qt upstream defect:
+# https://bugreports.qt-project.org/browse/QTBUG-39224
+QT_CONFIG_FLAGS_append_mips64n32 = " -no-webkit"
+
+# disable webkit for aarch64 temporarily that fails to compile
+QT_CONFIG_FLAGS_append_aarch64 = " -no-webkit"
+
+FILES_${QT_BASE_NAME}-tools_append     = " ${bindir}/qml ${bindir}/qmlplugindump"
+FILES_${QT_BASE_NAME}-tools-dbg_append = " ${bindir}/.debug/qml ${bindir}/.debug/qmlplugindump"
+
+PACKAGES_append = " ${QT_BASE_NAME}-tests-dbg ${QT_BASE_NAME}-tests"
+FILES_${QT_BASE_NAME}-tests-dbg        = "${prefix}/tests/qt4/*/.debug"
+FILES_${QT_BASE_NAME}-tests            = "${prefix}/tests/qt4/*"
+
+do_configure_prepend() {
+    sed -i 's:qtPrepareTool(LRELEASE, lrelease):LRELEASE = ${OE_QMAKE_LRELEASE}:g' \
+        ${S}/translations/translations.pro
+
+    sed -i \
+    -e /QMAKE_MOC\ /d \
+    -e /QMAKE_UIC\ /d \
+    -e /QMAKE_UIC3\ /d \
+    -e /QMAKE_RCC\ /d \
+    ${S}/configure
+
+    # Avoid problems with Qt 4.8.0 configure setting QMAKE_LINK from LD (since we want the linker to be g++)
+    unset LD
+}
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch
new file mode 100644
index 0000000..d8b0a09
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch
@@ -0,0 +1,43 @@
+From 55097d27e8b746b3d5ff437939caf1fa43c0d62b Mon Sep 17 00:00:00 2001
+From: Holger Freyther <zecke@selfish.org>
+Date: Wed, 26 Sep 2012 17:22:30 +0200
+Subject: [PATCH 01/21] qlibraryinfo: allow to set qt.conf from the outside
+ using the environment
+
+Allow to set a qt.conf from the outside using the environment. This allows
+to inject new prefixes and other paths into qmake. This is needed when using
+the same qmake binary to build qt/x11 and qt/embedded
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/corelib/global/qlibraryinfo.cpp | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
+index 180dc39..4adad35 100644
+--- a/src/corelib/global/qlibraryinfo.cpp
++++ b/src/corelib/global/qlibraryinfo.cpp
+@@ -54,6 +54,7 @@
+ QT_BEGIN_NAMESPACE
+ extern QString qmake_libraryInfoFile();
+ QT_END_NAMESPACE
++#include <stdlib.h>
+ #else
+ # include "qcoreapplication.h"
+ #endif
+@@ -112,6 +113,10 @@ QSettings *QLibraryInfoPrivate::findConfiguration()
+ #ifdef BOOTSTRAPPING
+     if(!QFile::exists(qtconfig))
+         qtconfig = qmake_libraryInfoFile();
++    if (!QFile::exists(qtconfig)) {
++        QByteArray config = getenv("QT_CONF_PATH");
++        qtconfig = QFile::decodeName(config);
++    }
+ #else
+     if (!QFile::exists(qtconfig) && QCoreApplication::instance()) {
+ #ifdef Q_OS_MAC
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0002-qkbdtty_qws-fix-build-with-old-kernel-headers.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0002-qkbdtty_qws-fix-build-with-old-kernel-headers.patch
new file mode 100644
index 0000000..98fc887
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0002-qkbdtty_qws-fix-build-with-old-kernel-headers.patch
@@ -0,0 +1,50 @@
+From 5e6b1051afa3099a02a758b0596236759d70670e Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Wed, 26 Sep 2012 20:18:08 +0200
+Subject: [PATCH 02/21] qkbdtty_qws: fix build with old kernel headers
+
+This issue is that with C++ compiler process an old version of kernel
+header file, coincidently that file has a variable named 'new':
+
+* 'embedded/qkbdtty_qws.cpp' include 'linux/vt.h';
+* '/usr/include/linux/vt.h' has below code on SLED-11.x:
+    + unsigned int new;
+
+On mostly hosts it has been changed to: new -> newev.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/gui/embedded/qkbdtty_qws.cpp | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp
+index a46811b..762138f 100644
+--- a/src/gui/embedded/qkbdtty_qws.cpp
++++ b/src/gui/embedded/qkbdtty_qws.cpp
+@@ -54,8 +54,20 @@
+ 
+ #if defined Q_OS_LINUX
+ #  include <linux/kd.h>
++
++/* Workaround kernel headers using "new" as variable name. The problem
++ is specific to SLED-11, other distros use "newev" rather than "new" */
++#ifdef __cplusplus
++#warning "workaround kernel headers using new as variable name on SLED 11"
++#define new newev
++#endif
++
+ #  include <linux/vt.h> //TODO: move vt handling somewhere else (QLinuxFbScreen?)
+ 
++#ifdef __cplusplus
++#undef new
++#endif
++
+ #  include "qscreen_qws.h"
+ #  include "qwindowsystem_qws.h"
+ #  include "qapplication.h"
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0003-webkit2-set-OUTPUT_DIR-value-if-empty.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0003-webkit2-set-OUTPUT_DIR-value-if-empty.patch
new file mode 100644
index 0000000..ecaea51
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0003-webkit2-set-OUTPUT_DIR-value-if-empty.patch
@@ -0,0 +1,34 @@
+From b6805e883c078f7647d9234aca4e3513ebd1c9bf Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Tue, 1 May 2012 07:48:15 +0200
+Subject: [PATCH 03/21] webkit2: set OUTPUT_DIR value if empty
+
+Without this do_configure was trying to create /include/WebCore/libdummy.prl in root of build host filesystem
+now it's in proper place ${WORKDIR}/qt-everywhere-opensource-src-4.8.1/src/3rdparty/webkit/include/WebCore/libdummy.prl
+
+First reported here:
+http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg24436.html
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro b/src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro
+index 006a88c..5e17193 100644
+--- a/src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro
++++ b/src/3rdparty/webkit/Source/WebKit2/DerivedSources.pro
+@@ -3,6 +3,8 @@ TARGET = dummy
+ 
+ CONFIG -= debug_and_release
+ 
++isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../..
++
+ CONFIG(standalone_package) {
+     isEmpty(WEBKIT2_GENERATED_SOURCES_DIR):WEBKIT2_GENERATED_SOURCES_DIR = $$PWD/generated
+     isEmpty(WC_GENERATED_SOURCES_DIR):WC_GENERATED_SOURCES_DIR = $$PWD/../WebCore/generated
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0004-configure-qmake-is-already-built-in-qt4-tools-native.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0004-configure-qmake-is-already-built-in-qt4-tools-native.patch
new file mode 100644
index 0000000..1eb8a58
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0004-configure-qmake-is-already-built-in-qt4-tools-native.patch
@@ -0,0 +1,29 @@
+From af699c6e8cf9fb28d6f8b789bf33d53b47edaec7 Mon Sep 17 00:00:00 2001
+From: Michael Krelin <hacker@klever.net>
+Date: Wed, 26 Sep 2012 20:24:20 +0200
+Subject: [PATCH 04/21] configure: qmake is already built in qt4-tools-native,
+ so disable it
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index e3d464b..cc04b27 100755
+--- a/configure
++++ b/configure
+@@ -4899,7 +4899,7 @@ setBootstrapVariable()
+ }
+ 
+ # build qmake
+-if true; then ###[ '!' -f "$outpath/bin/qmake" ];
++if false; then ###[ '!' -f "$outpath/bin/qmake" ];
+     echo "Creating qmake. Please wait..."
+ 
+     OLD_QCONFIG_H=
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0005-configure-set-LFLAGS-to-pick-up-zlib-from-staging.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0005-configure-set-LFLAGS-to-pick-up-zlib-from-staging.patch
new file mode 100644
index 0000000..1a8f2b7
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0005-configure-set-LFLAGS-to-pick-up-zlib-from-staging.patch
@@ -0,0 +1,28 @@
+From ac93237bc90ea7773c0ef5275962baba01d4a9c7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jeremy=20Lain=C3=A9?= <jeremy.laine@m4x.org>
+Date: Wed, 26 Sep 2012 20:27:44 +0200
+Subject: [PATCH 05/21] configure: set LFLAGS to pick up zlib from staging
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index cc04b27..5a7c4ee 100755
+--- a/configure
++++ b/configure
+@@ -690,7 +690,7 @@ fi
+ # initalize variables
+ #-------------------------------------------------------------------------------
+ 
+-SYSTEM_VARIABLES="RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS"
++SYSTEM_VARIABLES="RANLIB STRIP OBJDUMP LD CC CXX CFLAGS CXXFLAGS LDFLAGS LFLAGS"
+ for varname in $SYSTEM_VARIABLES; do
+     qmakevarname="${varname}"
+     # use LDFLAGS for autoconf compat, but qmake uses QMAKE_LFLAGS
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0006-configure-Use-OE_QMAKE_-values-to-specify-Qt-utility.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0006-configure-Use-OE_QMAKE_-values-to-specify-Qt-utility.patch
new file mode 100644
index 0000000..90ebf75
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0006-configure-Use-OE_QMAKE_-values-to-specify-Qt-utility.patch
@@ -0,0 +1,38 @@
+From 0bc0db83812b5900dc4e6ffa96bdeab46b6adcae Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Wed, 26 Sep 2012 20:29:09 +0200
+Subject: [PATCH 06/21] configure: Use OE_QMAKE_* values to specify Qt utility
+ paths
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/configure b/configure
+index 5a7c4ee..db4d044 100755
+--- a/configure
++++ b/configure
+@@ -8683,11 +8683,11 @@ QMAKE_ABSOLUTE_SOURCE_ROOT = \$\$QT_SOURCE_TREE
+ QMAKE_MOC_SRC    = \$\$QT_BUILD_TREE/src/moc
+ 
+ #local paths that cannot be queried from the QT_INSTALL_* properties while building QTDIR
+-QMAKE_MOC        = \$\$QT_BUILD_TREE/bin/moc
+-QMAKE_UIC        = \$\$QT_BUILD_TREE/bin/uic
+-QMAKE_UIC3       = \$\$QT_BUILD_TREE/bin/uic3
+-QMAKE_RCC        = \$\$QT_BUILD_TREE/bin/rcc
+-QMAKE_QDBUSXML2CPP = \$\$QT_BUILD_TREE/bin/qdbusxml2cpp
++QMAKE_MOC        = \${OE_QMAKE_MOC}
++QMAKE_UIC        = \${OE_QMAKE_UIC}
++QMAKE_UIC3       = \${OE_QMAKE_UIC3}
++QMAKE_RCC        = \${OE_QMAKE_RCC}
++QMAKE_QDBUSXML2CPP = \${OE_QMAKE_QDBUSXML2CPP}
+ QMAKE_INCDIR_QT  = \$\$QT_BUILD_TREE/include
+ QMAKE_LIBDIR_QT  = \$\$QT_BUILD_TREE/lib
+ 
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0007-dbus-Remove-const-usage-that-causes-compile-failure-.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0007-dbus-Remove-const-usage-that-causes-compile-failure-.patch
new file mode 100644
index 0000000..1d23c92
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0007-dbus-Remove-const-usage-that-causes-compile-failure-.patch
@@ -0,0 +1,34 @@
+From 2011bb8029480af1d1266f258e5a5f5cef7392d3 Mon Sep 17 00:00:00 2001
+From: Pavel Heimlich <tropikhajma@gmail.com>
+Date: Wed, 26 Sep 2012 20:31:10 +0200
+Subject: [PATCH 07/21] dbus: Remove "const" usage that causes compile failure
+ building nativesdk-qt4-tools
+
+Patch has apparently been rejected upstream, not because it is invalid
+but because the submitter did not submit a merge request for it, so the
+validity of the patch upstream is uncertain. For further details see:
+https://bugreports.qt-project.org/browse/QTBUG-17962
+
+Upstream-Status: Denied [possible retry]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/dbus/qdbusintegrator.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
+index 0f0b647..aa4cbab 100644
+--- a/src/dbus/qdbusintegrator.cpp
++++ b/src/dbus/qdbusintegrator.cpp
+@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
+ static bool isDebugging;
+ #define qDBusDebug              if (!::isDebugging); else qDebug
+ 
+-Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS)))
++Q_GLOBAL_STATIC_WITH_ARGS(QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS)))
+ 
+ static inline QString dbusServiceString()
+ { return *orgFreedesktopDBusString(); }
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch
new file mode 100644
index 0000000..ec07f41
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0008-qmake.pro-Allow-building-a-separate-qmake-for-the-ta.patch
@@ -0,0 +1,29 @@
+From 64ce5d0e7c19436b928a2a0d9d192f56be3c9bb2 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Wed, 26 Sep 2012 20:32:41 +0200
+Subject: [PATCH 08/21] qmake.pro: Allow building a separate qmake for the
+ target
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ qmake/qmake.pro | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/qmake/qmake.pro b/qmake/qmake.pro
+index 38e0fce..53b1ffb 100644
+--- a/qmake/qmake.pro
++++ b/qmake/qmake.pro
+@@ -7,6 +7,7 @@ CONFIG += console bootstrap
+ CONFIG -= qt shared app_bundle uic
+ DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED
+ DESTDIR = ../bin/
++TARGET = qmake2
+ 
+ OBJECTS_DIR = .
+ MOC_DIR = .
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0009-qmake-fix-source-file-references-in-qmake.pri.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0009-qmake-fix-source-file-references-in-qmake.pri.patch
new file mode 100644
index 0000000..45b8c10
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0009-qmake-fix-source-file-references-in-qmake.pri.patch
@@ -0,0 +1,52 @@
+From e129dc0d6cde69dd15d1836c4111e0526fc29161 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Wed, 26 Sep 2012 20:33:49 +0200
+Subject: [PATCH 09/21] qmake: fix source file references in qmake.pri
+
+Fix duplicate entries in SOURCES and HEADERS, and fix the source file
+list for the split of qlocale.cpp.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ qmake/qmake.pri | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/qmake/qmake.pri b/qmake/qmake.pri
+index 31f67f4..9081669 100644
+--- a/qmake/qmake.pri
++++ b/qmake/qmake.pri
+@@ -22,8 +22,7 @@ SOURCES += project.cpp property.cpp main.cpp generators/makefile.cpp \
+            generators/symbian/initprojectdeploy_symbian.cpp \
+            generators/integrity/gbuild.cpp \
+            windows/registry.cpp \
+-           symbian/epocroot.cpp \
+-           generators/integrity/gbuild.cpp
++           symbian/epocroot.cpp
+ 
+ HEADERS += project.h property.h generators/makefile.h \
+            generators/unix/unixmake.h meta.h option.h cachekeys.h \
+@@ -40,8 +39,7 @@ HEADERS += project.h property.h generators/makefile.h \
+            generators/symbian/initprojectdeploy_symbian.h \
+            generators/integrity/gbuild.h \
+            windows/registry_p.h \
+-           symbian/epocroot_p.h \
+-           generators/integrity/gbuild.h
++           symbian/epocroot_p.h
+ 
+ contains(QT_EDITION, OpenSource) {
+    DEFINES += QMAKE_OPENSOURCE_EDITION
+@@ -72,6 +70,8 @@ bootstrap { #Qt code
+         qlist.cpp \
+         qlinkedlist.cpp \
+         qlocale.cpp \
++        qlocale_tools.cpp \
++        qlocale_unix.cpp \
+         qmalloc.cpp \
+         qmap.cpp \
+         qmetatype.cpp \
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0010-configure-Hack-to-not-use-the-pg_config-of-the-host-.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0010-configure-Hack-to-not-use-the-pg_config-of-the-host-.patch
new file mode 100644
index 0000000..ca6a0b8
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0010-configure-Hack-to-not-use-the-pg_config-of-the-host-.patch
@@ -0,0 +1,46 @@
+From 4888791d1899f781af710dd8813887dea52fda59 Mon Sep 17 00:00:00 2001
+From: Holger Freyther <zecke@selfish.org>
+Date: Wed, 26 Sep 2012 20:36:38 +0200
+Subject: [PATCH 10/21] configure: Hack to not use the pg_config of the host
+ system which will add /usr/include
+
+pg_config is a native binary so using that when cross compiling
+will always fail.  The commented out fix would do, but for OE
+our -platform and -xplatform is the same so we are actually not
+really cross compiling. Just comment out the test, we are passing
+the location to the postgres headers and if they are okay we
+will pad.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Update for qt 4.8.7.
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ configure | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure b/configure
+index db4d044..35a8fe7 100755
+--- a/configure
++++ b/configure
+@@ -5574,10 +5574,10 @@
+             if [ "$CFG_SQL_psql" != "no" ]; then
+                 [ -z "$CFG_PSQL_CONFIG" ] && CFG_PSQL_CONFIG=`"$WHICH" pg_config`
+                 # Be careful not to use native pg_config when cross building.
+-                if [ "$XPLATFORM_MINGW" != "yes" ] && [ -x "$CFG_PSQL_CONFIG" ]; then
+-                    QT_CFLAGS_PSQL=`$CFG_PSQL_CONFIG --includedir 2>/dev/null`
+-                    QT_LFLAGS_PSQL=`$CFG_PSQL_CONFIG --libdir 2>/dev/null`
+-                fi
++#                if [ "$XPLATFORM_MINGW" != "yes" ] && [ -x "$CFG_PSQL_CONFIG" ]; then
++#                    QT_CFLAGS_PSQL=`$CFG_PSQL_CONFIG --includedir 2>/dev/null`
++#                    QT_LFLAGS_PSQL=`$CFG_PSQL_CONFIG --libdir 2>/dev/null`
++#                fi
+                 [ -z "$QT_CFLAGS_PSQL" ] || QT_CFLAGS_PSQL="-I$QT_CFLAGS_PSQL"
+                 [ -z "$QT_LFLAGS_PSQL" ] || QT_LFLAGS_PSQL="-L$QT_LFLAGS_PSQL"
+                 # But, respect PSQL_LIBS if set
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0011-freetype-host-includes.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0011-freetype-host-includes.patch
new file mode 100644
index 0000000..e0879c5
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0011-freetype-host-includes.patch
@@ -0,0 +1,29 @@
+From 3fcffa79e6a5f0448cbfe2bb33fe1218f5dae61d Mon Sep 17 00:00:00 2001
+From: Michael Krelin <hacker@klever.net>
+Date: Mon, 4 Jun 2007 14:48:50 +0200
+Subject: [PATCH 11/21] freetype host includes
+
+Host include path should not be used in cross compiling case.
+
+Ported from OE by: Yu Ke <ke.yu@intel.com>
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ config.tests/unix/freetype/freetype.pri | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config.tests/unix/freetype/freetype.pri b/config.tests/unix/freetype/freetype.pri
+index 7ef1cf9..b362fcd 100644
+--- a/config.tests/unix/freetype/freetype.pri
++++ b/config.tests/unix/freetype/freetype.pri
+@@ -1,5 +1,5 @@
+ !cross_compile {
+-    TRY_INCLUDEPATHS = /include /usr/include $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
++    TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
+     # LSB doesn't allow using headers from /include or /usr/include
+     linux-lsb-g++:TRY_INCLUDEPATHS = $$QMAKE_INCDIR $$QMAKE_INCDIR_X11 $$INCLUDEPATH
+     for(p, TRY_INCLUDEPATHS) {
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0012-Add-2bpp-support.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0012-Add-2bpp-support.patch
new file mode 100644
index 0000000..8e411f3
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0012-Add-2bpp-support.patch
@@ -0,0 +1,318 @@
+From 8744273fc452eb54bbeeb7d15823009ce926c6fa Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jeremy=20Lain=C3=A9?= <jeremy.laine@m4x.org>
+Date: Wed, 26 Sep 2012 20:39:21 +0200
+Subject: [PATCH 12/21] Add 2bpp support
+
+Submitted upstream but rejected as being "out of scope":
+https://bugreports.qt-project.org/browse/QTBUG-3468
+
+Upstream-Status: Denied
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure                               |   5 +-
+ src/gui/embedded/qscreen_qws.cpp        | 211 ++++++++++++++++++++++++++++++++
+ src/gui/embedded/qscreenlinuxfb_qws.cpp |   4 +-
+ 3 files changed, 216 insertions(+), 4 deletions(-)
+
+diff --git a/configure b/configure
+index 35a8fe7..79c1c7b 100755
+--- a/configure
++++ b/configure
+@@ -7063,6 +7063,7 @@ if [ "$CFG_QWS_DEPTHS" = "prompted" -a "$PROMPT_FOR_DEPTHS" = "yes" ]; then
+     echo "Choose pixel-depths to support:"
+     echo
+     echo "   1. 1bpp, black/white"
++    echo "   2. 2bpp, grayscale"
+     echo "   4. 4bpp, grayscale"
+     echo "   8. 8bpp, paletted"
+     echo "  12. 12bpp, rgb 4-4-4"
+@@ -7081,11 +7082,11 @@ if [ "$CFG_QWS_DEPTHS" = "prompted" -a "$PROMPT_FOR_DEPTHS" = "yes" ]; then
+ fi
+ if [ -n "$CFG_QWS_DEPTHS" -a "$PLATFORM_QWS" = "yes" ]; then
+     if [ "$CFG_QWS_DEPTHS" = "all" ]; then
+-        CFG_QWS_DEPTHS="1 4 8 12 15 16 18 24 32 generic"
++        CFG_QWS_DEPTHS="1 2 4 8 12 15 16 18 24 32 generic"
+     fi
+     for D in `echo "$CFG_QWS_DEPTHS" | sed -e 's/,/ /g'`; do
+ 	case $D in
+-	    1|4|8|12|15|16|18|24|32) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_$D";;
++	    1|2|4|8|12|15|16|18|24|32) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_$D";;
+ 	    generic) QCONFIG_FLAGS="$QCONFIG_FLAGS QT_QWS_DEPTH_GENERIC";;
+ 	esac
+     done
+diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp
+index b307bf2..88950b3 100644
+--- a/src/gui/embedded/qscreen_qws.cpp
++++ b/src/gui/embedded/qscreen_qws.cpp
+@@ -469,6 +469,58 @@ static void solidFill_gray4(QScreen *screen, const QColor &color,
+ }
+ #endif // QT_QWS_DEPTH_4
+ 
++#ifdef QT_QWS_DEPTH_2
++static inline void qt_rectfill_gray2(quint8 *dest, quint8 value,
++                                     int x, int y, int width, int height,
++                                     int stride)
++{
++    const int pixelsPerByte = 4;
++    const int alignWidth = qMin(width, (4 - (x & 3)) & 3);
++    const int doAlign = (alignWidth > 0 ? 1 : 0);
++    const int alignStart = pixelsPerByte - 1 - (x & 3);
++    const int alignStop = alignStart - (alignWidth - 1);
++    const quint8 alignMask = ((1 << (2 * alignWidth)) - 1) << (2 * alignStop);
++    const int tailWidth = (width - alignWidth) & 3;
++    const int doTail = (tailWidth > 0 ? 1 : 0);
++    const quint8 tailMask = (1 << (2 * (pixelsPerByte - tailWidth))) - 1;
++    const int width8 = (width - alignWidth) / pixelsPerByte;
++
++    dest += y * stride + x / pixelsPerByte;
++    stride -= (doAlign + width8);
++
++    for (int j = 0; j < height; ++j) {
++        if (doAlign) {
++            *dest = (*dest & ~alignMask) | (value & alignMask);
++            ++dest;
++        }
++        if (width8) {
++            qt_memfill<quint8>(dest, value, width8);
++            dest += width8;
++        }
++        if (doTail)
++            *dest = (*dest & tailMask) | (value & ~tailMask);
++        dest += stride;
++    }
++}
++
++static void solidFill_gray2(QScreen *screen, const QColor &color,
++                            const QRegion &region)
++{
++    quint8 *dest = reinterpret_cast<quint8*>(screen->base());
++    const quint8 c = qGray(color.rgba()) >> 6;
++    const quint8 c8 = (c << 6) | (c << 4) | (c << 2) | c;
++
++    const int stride = screen->linestep();
++    const QVector<QRect> rects = region.rects();
++
++    for (int i = 0; i < rects.size(); ++i) {
++        const QRect r = rects.at(i);
++        qt_rectfill_gray2(dest, c8, r.x(), r.y(), r.width(), r.height(),
++                          stride);
++    }
++}
++#endif // QT_QWS_DEPTH_2
++
+ #ifdef QT_QWS_DEPTH_1
+ static inline void qt_rectfill_mono(quint8 *dest, quint8 value,
+                                     int x, int y, int width, int height,
+@@ -576,6 +628,11 @@ void qt_solidFill_setup(QScreen *screen, const QColor &color,
+         screen->d_ptr->solidFill = solidFill_gray4;
+         break;
+ #endif
++#ifdef QT_QWS_DEPTH_2
++    case 2:
++        screen->d_ptr->solidFill = solidFill_gray2;
++        break;
++#endif
+ #ifdef QT_QWS_DEPTH_1
+     case 1:
+         screen->d_ptr->solidFill = solidFill_mono;
+@@ -1006,6 +1063,149 @@ static void blit_4(QScreen *screen, const QImage &image,
+ }
+ #endif // QT_QWS_DEPTH_4
+ 
++#ifdef QT_QWS_DEPTH_2
++
++struct qgray2 { quint8 dummy; } Q_PACKED;
++
++template <typename SRC>
++static inline quint8 qt_convertToGray2(SRC color);
++
++template <>
++inline quint8 qt_convertToGray2(quint32 color)
++{
++    return qGray(color) >> 6;
++}
++
++template <>
++inline quint8 qt_convertToGray2(quint16 color)
++{
++    const int r = (color & 0xf800) >> 11;
++    const int g = (color & 0x07e0) >> 6; // only keep 5 bit
++    const int b = (color & 0x001f);
++    return (r * 11 + g * 16 + b * 5) >> 8;
++}
++
++template <>
++inline quint8 qt_convertToGray2(qrgb444 color)
++{
++    return qt_convertToGray2(quint32(color));
++}
++
++template <>
++inline quint8 qt_convertToGray2(qargb4444 color)
++{
++    return qt_convertToGray2(quint32(color));
++}
++
++template <typename SRC>
++static inline void qt_rectconvert_gray2(qgray2 *dest2, const SRC *src,
++                                        int x, int y, int width, int height,
++                                        int dstStride, int srcStride)
++{
++    const int pixelsPerByte = 4;
++    quint8 *dest8 = reinterpret_cast<quint8*>(dest2)
++                    + y * dstStride + x / pixelsPerByte;
++    const int alignWidth = qMin(width, (4 - (x & 3)) & 3);
++    const int doAlign = (alignWidth > 0 ? 1 : 0);
++    const int alignStart = pixelsPerByte - 1 - (x & 3);
++    const int alignStop = alignStart - (alignWidth - 1);
++    const quint8 alignMask = ((1 << (2 * alignWidth)) - 1) << (2 * alignStop);
++    const int tailWidth = (width - alignWidth) & 3;
++    const int doTail = (tailWidth > 0 ? 1 : 0);
++    const quint8 tailMask = (1 << (2 * (pixelsPerByte - tailWidth))) - 1;
++    const int width8 = (width - alignWidth) / pixelsPerByte;
++
++    srcStride = srcStride / sizeof(SRC) - (width8 * pixelsPerByte + alignWidth);
++    dstStride -= (width8 + doAlign);
++
++    for (int j = 0;  j < height; ++j) {
++        if (doAlign) {
++            quint8 d = *dest8 & ~alignMask;
++            for (int i = alignStart; i >= alignStop; --i)
++                d |= qt_convertToGray2<SRC>(*src++) << (2 * i);
++            *dest8++ = d;
++        }
++        for (int i = 0; i < width8; ++i) {
++            *dest8 = (qt_convertToGray2<SRC>(src[0]) << 6)
++                     | (qt_convertToGray2<SRC>(src[1]) << 4)
++                     | (qt_convertToGray2<SRC>(src[2]) << 2)
++                     | (qt_convertToGray2<SRC>(src[3]));
++            src += 4;
++            ++dest8;
++        }
++        if (doTail) {
++            quint8 d = *dest8 & tailMask;
++            switch (tailWidth) {
++            case 3: d |= qt_convertToGray2<SRC>(src[2]) << 2;
++            case 2: d |= qt_convertToGray2<SRC>(src[1]) << 4;
++            case 1: d |= qt_convertToGray2<SRC>(src[0]) << 6;
++            }
++            *dest8 = d;
++        }
++
++        dest8 += dstStride;
++        src += srcStride;
++    }
++}
++
++template <>
++void qt_rectconvert(qgray2 *dest, const quint32 *src,
++                    int x, int y, int width, int height,
++                    int dstStride, int srcStride)
++{
++    qt_rectconvert_gray2<quint32>(dest, src, x, y, width, height,
++                                  dstStride, srcStride);
++}
++
++template <>
++void qt_rectconvert(qgray2 *dest, const quint16 *src,
++                    int x, int y, int width, int height,
++                    int dstStride, int srcStride)
++{
++    qt_rectconvert_gray2<quint16>(dest, src, x, y, width, height,
++                                  dstStride, srcStride);
++}
++
++template <>
++void qt_rectconvert(qgray2 *dest, const qrgb444 *src,
++                    int x, int y, int width, int height,
++                    int dstStride, int srcStride)
++{
++    qt_rectconvert_gray2<qrgb444>(dest, src, x, y, width, height,
++                                  dstStride, srcStride);
++}
++
++template <>
++void qt_rectconvert(qgray2 *dest, const qargb4444 *src,
++                    int x, int y, int width, int height,
++                    int dstStride, int srcStride)
++{
++    qt_rectconvert_gray2<qargb4444>(dest, src, x, y, width, height,
++                                    dstStride, srcStride);
++}
++
++static void blit_2(QScreen *screen, const QImage &image,
++                   const QPoint &topLeft, const QRegion &region)
++{
++    switch (image.format()) {
++    case QImage::Format_ARGB32_Premultiplied:
++        blit_template<qgray2, quint32>(screen, image, topLeft, region);
++        return;
++    case QImage::Format_RGB16:
++        blit_template<qgray2, quint16>(screen, image, topLeft, region);
++        return;
++    case QImage::Format_RGB444:
++        blit_template<qgray2, qrgb444>(screen, image, topLeft, region);
++        return;
++    case QImage::Format_ARGB4444_Premultiplied:
++        blit_template<qgray2, qargb4444>(screen, image, topLeft, region);
++        return;
++    default:
++        qCritical("blit_2(): Image format %d not supported!", image.format());
++    }
++}
++#endif // QT_QWS_DEPTH_2
++
+ #ifdef QT_QWS_DEPTH_1
+ 
+ struct qmono { quint8 dummy; } Q_PACKED;
+@@ -1259,6 +1459,11 @@ void qt_blit_setup(QScreen *screen, const QImage &image,
+         screen->d_ptr->blit = blit_4;
+         break;
+ #endif
++#ifdef QT_QWS_DEPTH_2
++    case 2:
++        screen->d_ptr->blit = blit_2;
++        break;
++#endif
+ #ifdef QT_QWS_DEPTH_1
+     case 1:
+         screen->d_ptr->blit = blit_1;
+@@ -2146,6 +2351,8 @@ int QScreen::alloc(unsigned int r,unsigned int g,unsigned int b)
+         }
+     } else if (d == 4) {
+         ret = qGray(r, g, b) >> 4;
++    } else if (d == 2) {
++        ret = qGray(r, g, b) >> 6;
+     } else if (d == 1) {
+         ret = qGray(r, g, b) >= 128;
+     } else {
+@@ -2216,6 +2423,10 @@ bool QScreen::supportsDepth(int d) const
+     } else if(d==1) {
+         return true;
+ #endif
++#ifdef QT_QWS_DEPTH_2
++    } else if(d==2) {
++        return true;
++#endif
+ #ifdef QT_QWS_DEPTH_4
+     } else if(d==4) {
+         return true;
+diff --git a/src/gui/embedded/qscreenlinuxfb_qws.cpp b/src/gui/embedded/qscreenlinuxfb_qws.cpp
+index 6f3caad..14159ee 100644
+--- a/src/gui/embedded/qscreenlinuxfb_qws.cpp
++++ b/src/gui/embedded/qscreenlinuxfb_qws.cpp
+@@ -466,8 +466,8 @@ bool QLinuxFbScreen::connect(const QString &displaySpec)
+         setupOffScreen();
+ 
+     // Now read in palette
+-    if((vinfo.bits_per_pixel==8) || (vinfo.bits_per_pixel==4)) {
+-        screencols= (vinfo.bits_per_pixel==8) ? 256 : 16;
++    if((vinfo.bits_per_pixel==8) || (vinfo.bits_per_pixel==4) || (vinfo.bits_per_pixel==2)) {
++        screencols= 1 << vinfo.bits_per_pixel;
+         int loopc;
+         ::fb_cmap startcmap;
+         startcmap.start=0;
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0013-configure-add-crossarch-option.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0013-configure-add-crossarch-option.patch
new file mode 100644
index 0000000..762cdaf
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0013-configure-add-crossarch-option.patch
@@ -0,0 +1,51 @@
+From 549342fa380ed2a9ad41be3d04ee2f0585f6a465 Mon Sep 17 00:00:00 2001
+From: Michael Lauer <mickey@vanille-media.de>
+Date: Wed, 26 Sep 2012 20:41:32 +0200
+Subject: [PATCH 13/21] configure: add "-crossarch" option
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Update for qt 4.8.7
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+ configure | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 4eb4a3d..a4dacec 100755
+--- a/configure
++++ b/configure
+@@ -1160,7 +1160,7 @@ while [ "$#" -gt 0 ]; do
+         shift
+         VAL=$1
+         ;;
+-    -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-device-option|-buildkey|-sdk|-arch|-host-arch|-mysql_config|-psql_config|-sysroot)
++    -prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-demosdir|-depths|-make|-nomake|-platform|-xplatform|-device-option|-buildkey|-sdk|-arch|-host-arch|-mysql_config|-psql_config|-sysroot|-crossarch)
+         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
+         shift
+         VAL="$1"
+@@ -1719,6 +1719,9 @@ while [ "$#" -gt 0 ]; do
+         DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"`
+         DeviceVar set $DEV_VAR $DEV_VAL
+         ;;
++    crossarch)
++        CROSSARCH="$VAL"
++        ;;
+     debug-and-release)
+         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+             CFG_DEBUG_RELEASE="$VAL"
+@@ -3333,6 +3336,8 @@ arm*)
+     ;;
+ esac
+ 
++CFG_ARCH="$CROSSARCH"
++
+ if [ -d "$relpath/src/corelib/arch/$CFG_ARCH" ]; then
+     if [ "$OPT_VERBOSE" = "yes" ]; then
+         echo "    '$CFG_ARCH' is supported"
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0014-translations-fix-phony-translation-linking-error.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0014-translations-fix-phony-translation-linking-error.patch
new file mode 100644
index 0000000..66724a8
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0014-translations-fix-phony-translation-linking-error.patch
@@ -0,0 +1,41 @@
+From 21af8f6d21b28a53041affb11b58d6316023fa92 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Wed, 26 Sep 2012 20:45:10 +0200
+Subject: [PATCH 14/21] translations: fix phony translation linking error
+
+  | .../usr/lib/crt1.o: In function `_start':
+  | .../../sysdeps/i386/elf/start.S:115: undefined reference to `main'
+  | collect2: ld returned 1 exit status
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ translations/translations.pro | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/translations/translations.pro b/translations/translations.pro
+index dc99beb..0d98829 100644
+--- a/translations/translations.pro
++++ b/translations/translations.pro
+@@ -101,7 +101,7 @@ updateqm.name = LRELEASE ${QMAKE_FILE_IN}
+ updateqm.CONFIG += no_link
+ QMAKE_EXTRA_COMPILERS += updateqm
+ 
+-isEmpty(vcproj) {
++!isEmpty(vcproj) {
+     QMAKE_LINK = @: IGNORE THIS LINE
+     OBJECTS_DIR =
+     win32:CONFIG -= embed_manifest_exe
+@@ -111,7 +111,7 @@ isEmpty(vcproj) {
+     phony_src.input = PHONY_DEPS
+     phony_src.output = phony.c
+     phony_src.variable_out = GENERATED_SOURCES
+-    phony_src.commands = echo int main() { return 0; } > phony.c
++    phony_src.commands = echo \"int main() { return 0; }\" > phony.c
+     phony_src.name = CREATE phony.c
+     phony_src.CONFIG += combine
+     QMAKE_EXTRA_COMPILERS += phony_src
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0015-configure-add-nostrip-for-debug-packages.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0015-configure-add-nostrip-for-debug-packages.patch
new file mode 100644
index 0000000..b5db491
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0015-configure-add-nostrip-for-debug-packages.patch
@@ -0,0 +1,32 @@
+From 9250fed086a4a8a645a972764a9bf34e4566ec2e Mon Sep 17 00:00:00 2001
+From: Fathi Boudra <fabo@debian.org>
+Date: Wed, 26 Sep 2012 20:46:14 +0200
+Subject: [PATCH 15/21] configure: add nostrip for debug packages
+
+Qt is built in release mode and strip files by default.
+Set CONFIG+=nostrip to avoid the stripping and
+let dh_strip do it to generate debug packages.
+
+Upstream-Status: Inappropriate [Configuration]
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure b/configure
+index 7983c3d..d02824b 100755
+--- a/configure
++++ b/configure
+@@ -710,6 +710,8 @@ mkdir -p "$outpath/config.tests"
+ rm -f "$outpath/config.tests/.qmake.cache"
+ cp "$QMAKE_VARS_FILE" "$outpath/config.tests/.qmake.cache"
+ 
++QMakeVar add CONFIG nostrip
++
+ QMakeVar add styles "cde mac motif plastique cleanlooks windows"
+ QMakeVar add decorations "default windows styled"
+ QMakeVar add mouse-drivers "pc"
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0016-configure-eval-QMAKE_CXX.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0016-configure-eval-QMAKE_CXX.patch
new file mode 100644
index 0000000..9c3de47
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0016-configure-eval-QMAKE_CXX.patch
@@ -0,0 +1,37 @@
+From 8403634a71f067eec514b6d2193cf41e281dff8e Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Wed, 26 Sep 2012 20:47:08 +0200
+Subject: [PATCH 16/21] configure: eval QMAKE_CXX
+
+Allow expansion of $(...) references in QMAKE_CXX (currently its value
+is $(OE_QMAKE_CXX)) in order to allow compiler version check to succeed
+which allows WebKit to be enabled.
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Conflicts:
+	configure
+---
+ configure | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index d02824b..891d6e7 100755
+--- a/configure
++++ b/configure
+@@ -3409,7 +3409,8 @@ else
+     CFG_FRAMEWORK=no
+ fi
+ 
+-QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`
++QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX | sed -n 's/$[(]\([0-9a-zA-Z_]*\)[)]/$\1/pg'`
++QMAKE_CONF_COMPILER=`eval "echo $QMAKE_CONF_COMPILER"`
+ TEST_COMPILER="$CXX"
+ 
+ [ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0017-configure-ensure-we-identify-the-compiler-as-g-in-co.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0017-configure-ensure-we-identify-the-compiler-as-g-in-co.patch
new file mode 100644
index 0000000..9471966
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0017-configure-ensure-we-identify-the-compiler-as-g-in-co.patch
@@ -0,0 +1,46 @@
+From d2bb701b551402f0befddd0e906423596bdc0df7 Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Wed, 26 Sep 2012 20:48:37 +0200
+Subject: [PATCH 17/21] configure: ensure we identify the compiler as g++ in
+ configure
+
+Our PLATFORM in OE is ${TARGET_OS}-oe-g++, and previously the configure
+script was interpreting from this that the compiler was "oe-g++" and
+thus
+g++ specific checks were not being run since this string did not match;
+among other things this resulted in a compiler version check in the
+QtWebKit build code not working, and hence the following error at build
+time:
+
+./wtf/NullPtr.h:48:1: error: identifier 'nullptr' will become a keyword
+in C++0x [-Werror=c++0x-compat]
+
+The easiest thing since our PLATFORM is entirely artificial is to just
+force COMPILER to "g++" in the configure script if it is detected as
+"oe-g++".
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/configure b/configure
+index 891d6e7..7031898 100755
+--- a/configure
++++ b/configure
+@@ -7592,6 +7592,9 @@ elif [ "$XPLATFORM" != "$PLATFORM" ]; then
+ else
+     COMPILER=`echo $PLATFORM | cut -f 2- -d-`
+ fi
++case $COMPILER in
++    *oe-g++) COMPILER="g++" ;;
++esac
+ if [ "$CFG_EXCEPTIONS" = "unspecified" -a "$PLATFORM_QWS" = "yes" ]; then
+     CFG_EXCEPTIONS=no
+ fi
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0018-configure-make-pulseaudio-a-configurable-option.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0018-configure-make-pulseaudio-a-configurable-option.patch
new file mode 100644
index 0000000..19cdd4c
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0018-configure-make-pulseaudio-a-configurable-option.patch
@@ -0,0 +1,46 @@
+From d6dc1a7d6594d7e395347732a3e553fc82ccab3d Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Tue, 28 Feb 2012 15:10:24 +0000
+Subject: [PATCH 18/21] configure: make pulseaudio a configurable option
+
+Allows disabling pulseaudio support within phonon at configure time.
+(This is the Qt 4.8.0 version.)
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 7031898..a4a42f1 100755
+--- a/configure
++++ b/configure
+@@ -1139,7 +1139,7 @@ while [ "$#" -gt 0 ]; do
+         VAL=no
+         ;;
+     #Qt style yes options
+-    -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu)
++    -incremental|-qvfb|-profile|-shared|-static|-sm|-xinerama|-xshape|-xsync|-xinput|-egl|-reduce-exports|-pch|-separate-debug-info|-stl|-freetype|-xcursor|-xfixes|-xrandr|-xrender|-mitshm|-fontconfig|-xkb|-nis|-qdbus|-dbus|-dbus-linked|-glib|-gstreamer|-pulseaudio|-gtkstyle|-cups|-iconv|-largefile|-h|-help|-v|-verbose|-debug|-release|-fast|-accessibility|-confirm-license|-gnumake|-framework|-qt3support|-debug-and-release|-exceptions|-cocoa|-carbon|-universal|-harfbuzz|-prefix-install|-silent|-armfpa|-optimized-qmake|-dwarf2|-reduce-relocations|-sse|-openssl|-openssl-linked|-ptmalloc|-xmlpatterns|-phonon|-phonon-backend|-multimedia|-audio-backend|-svg|-declarative|-declarative-debug|-javascript-jit|-script|-scripttools|-rpath|-force-pkg-config|-s60|-usedeffiles|-icu)
+         VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
+         VAL=yes
+         ;;
+@@ -2120,6 +2120,13 @@ while [ "$#" -gt 0 ]; do
+             UNKNOWN_OPT=yes
+         fi
+         ;;
++    pulseaudio)
++        if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
++            CFG_PULSEAUDIO="$VAL"
++        else
++            UNKNOWN_OPT=yes
++        fi
++        ;;
+     gtkstyle)
+         if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+             CFG_QGTKSTYLE="$VAL"
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0019-Fixes-for-gcc-4.7.0-particularly-on-qemux86.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0019-Fixes-for-gcc-4.7.0-particularly-on-qemux86.patch
new file mode 100644
index 0000000..a83d247
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0019-Fixes-for-gcc-4.7.0-particularly-on-qemux86.patch
@@ -0,0 +1,63 @@
+From 1f1da2f24d3028b250dbc2e98e2b7e37862b3771 Mon Sep 17 00:00:00 2001
+From: Richard Purdie <richard.purdie@linuxfoundation.org>
+Date: Wed, 26 Sep 2012 20:54:38 +0200
+Subject: [PATCH 19/21] Fixes for gcc 4.7.0, particularly on qemux86
+
+Origin: upstream, http://trac.webkit.org/changeset/93631
+Origin: upstream, http://trac.webkit.org/changeset/113848
+
+Bug: https://bugs.webkit.org/show_bug.cgi?id=62168
+Bug: https://bugs.webkit.org/show_bug.cgi?id=83584
+
+RP 2012/04/30
+
+Upstream-Status: Backport
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/3rdparty/webkit/Source/WebCore/dom/Element.cpp                      | 2 +-
+ src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp            | 2 +-
+ .../webkit/Source/WebCore/platform/graphics/TiledBackingStoreClient.h   | 1 +
+ 3 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/src/3rdparty/webkit/Source/WebCore/dom/Element.cpp b/src/3rdparty/webkit/Source/WebCore/dom/Element.cpp
+index 32e47ca..b8e7389 100644
+--- a/src/3rdparty/webkit/Source/WebCore/dom/Element.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/dom/Element.cpp
+@@ -1080,7 +1080,7 @@ void Element::recalcStyle(StyleChange change)
+ {
+     // Ref currentStyle in case it would otherwise be deleted when setRenderStyle() is called.
+     RefPtr<RenderStyle> currentStyle(renderStyle());
+-    bool hasParentStyle = parentNodeForRenderingAndStyle() ? parentNodeForRenderingAndStyle()->renderStyle() : false;
++    bool hasParentStyle = parentNodeForRenderingAndStyle() ? static_cast<bool>(parentNodeForRenderingAndStyle()->renderStyle()) : false;
+     bool hasDirectAdjacentRules = currentStyle && currentStyle->childrenAffectedByDirectAdjacentRules();
+     bool hasIndirectAdjacentRules = currentStyle && currentStyle->childrenAffectedByForwardPositionalRules();
+ 
+diff --git a/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp b/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp
+index d66075e..ab8f111 100644
+--- a/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp
+@@ -74,7 +74,7 @@ PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document*
+     RefPtr<HTMLImageElement> image = adoptRef(new HTMLImageElement(imgTag, document));
+     if (optionalWidth)
+         image->setWidth(*optionalWidth);
+-    if (optionalHeight > 0)
++    if (optionalHeight)
+         image->setHeight(*optionalHeight);
+     return image.release();
+ }
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/graphics/TiledBackingStoreClient.h b/src/3rdparty/webkit/Source/WebCore/platform/graphics/TiledBackingStoreClient.h
+index 6087ec3..6d748f6 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/graphics/TiledBackingStoreClient.h
++++ b/src/3rdparty/webkit/Source/WebCore/platform/graphics/TiledBackingStoreClient.h
+@@ -25,6 +25,7 @@ namespace WebCore {
+ #if ENABLE(TILED_BACKING_STORE)
+ class TiledBackingStoreClient {
+ public:
++    virtual ~TiledBackingStoreClient() { }
+     virtual void tiledBackingStorePaintBegin() = 0;
+     virtual void tiledBackingStorePaint(GraphicsContext*, const IntRect&) = 0;
+     virtual void tiledBackingStorePaintEnd(const Vector<IntRect>& paintedArea) = 0;
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0021-configure-make-qt4-native-work-with-long-building-pa.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0021-configure-make-qt4-native-work-with-long-building-pa.patch
new file mode 100644
index 0000000..dbc9022
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0021-configure-make-qt4-native-work-with-long-building-pa.patch
@@ -0,0 +1,95 @@
+From 6742ac7ea6fd1e9c82ecb5305f84e721242f857d Mon Sep 17 00:00:00 2001
+From: Chen Qi <Qi.Chen@windriver.com>
+Date: Wed, 5 Dec 2012 07:48:15 +0200
+Subject: [PATCH 21/21] configure: make qt4-native work with long building
+ path.
+
+Upstream-Status: Submitted
+
+Reference: https://bugreports.qt-project.org/browse/QTBUG-28292
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ configure | 52 ++++++++++++++++++++++++++--------------------------
+ 1 file changed, 26 insertions(+), 26 deletions(-)
+
+diff --git a/configure b/configure
+index a4a42f1..2358563 100755
+--- a/configure
++++ b/configure
+@@ -4779,8 +4779,8 @@ DEMOS_PATH_STR=`"$relpath/config.tests/unix/padstring" 268 "qt_demopath=$QT_INST
+ TODAY=`date +%Y-%m-%d`
+ cat > "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
+ /* License Info */
+-static const char qt_configure_licensee_str          [256 + 12] = "$LICENSE_USER_STR";
+-static const char qt_configure_licensed_products_str [256 + 12] = "$LICENSE_PRODUCTS_STR";
++static const char qt_configure_licensee_str          [512 + 12] = "$LICENSE_USER_STR";
++static const char qt_configure_licensed_products_str [512 + 12] = "$LICENSE_PRODUCTS_STR";
+ 
+ /* Installation date */
+ static const char qt_configure_installation          [12+11]    = "qt_instdate=$TODAY";
+@@ -4805,36 +4805,36 @@ if [ ! -z "$QT_HOST_PREFIX" ]; then
+ 
+ #if defined(QT_BOOTSTRAPPED) || defined(QT_BUILD_QMAKE)
+ /* Installation Info */
+-static const char qt_configure_prefix_path_str       [256 + 12] = "$HOSTPREFIX_PATH_STR";
+-static const char qt_configure_documentation_path_str[256 + 12] = "$HOSTDOCUMENTATION_PATH_STR";
+-static const char qt_configure_headers_path_str      [256 + 12] = "$HOSTHEADERS_PATH_STR";
+-static const char qt_configure_libraries_path_str    [256 + 12] = "$HOSTLIBRARIES_PATH_STR";
+-static const char qt_configure_binaries_path_str     [256 + 12] = "$HOSTBINARIES_PATH_STR";
+-static const char qt_configure_plugins_path_str      [256 + 12] = "$HOSTPLUGINS_PATH_STR";
+-static const char qt_configure_imports_path_str      [256 + 12] = "$HOSTIMPORTS_PATH_STR";
+-static const char qt_configure_data_path_str         [256 + 12] = "$HOSTDATA_PATH_STR";
+-static const char qt_configure_translations_path_str [256 + 12] = "$HOSTTRANSLATIONS_PATH_STR";
+-static const char qt_configure_settings_path_str     [256 + 12] = "$HOSTSETTINGS_PATH_STR";
+-static const char qt_configure_examples_path_str     [256 + 12] = "$HOSTEXAMPLES_PATH_STR";
+-static const char qt_configure_demos_path_str        [256 + 12] = "$HOSTDEMOS_PATH_STR";
++static const char qt_configure_prefix_path_str       [512 + 12] = "$HOSTPREFIX_PATH_STR";
++static const char qt_configure_documentation_path_str[512 + 12] = "$HOSTDOCUMENTATION_PATH_STR";
++static const char qt_configure_headers_path_str      [512 + 12] = "$HOSTHEADERS_PATH_STR";
++static const char qt_configure_libraries_path_str    [512 + 12] = "$HOSTLIBRARIES_PATH_STR";
++static const char qt_configure_binaries_path_str     [512 + 12] = "$HOSTBINARIES_PATH_STR";
++static const char qt_configure_plugins_path_str      [512 + 12] = "$HOSTPLUGINS_PATH_STR";
++static const char qt_configure_imports_path_str      [512 + 12] = "$HOSTIMPORTS_PATH_STR";
++static const char qt_configure_data_path_str         [512 + 12] = "$HOSTDATA_PATH_STR";
++static const char qt_configure_translations_path_str [512 + 12] = "$HOSTTRANSLATIONS_PATH_STR";
++static const char qt_configure_settings_path_str     [512 + 12] = "$HOSTSETTINGS_PATH_STR";
++static const char qt_configure_examples_path_str     [512 + 12] = "$HOSTEXAMPLES_PATH_STR";
++static const char qt_configure_demos_path_str        [512 + 12] = "$HOSTDEMOS_PATH_STR";
+ #else // QT_BOOTSTRAPPED
+ EOF
+ fi
+ 
+ cat >> "$outpath/src/corelib/global/qconfig.cpp.new" <<EOF
+ /* Installation Info */
+-static const char qt_configure_prefix_path_str       [256 + 12] = "$PREFIX_PATH_STR";
+-static const char qt_configure_documentation_path_str[256 + 12] = "$DOCUMENTATION_PATH_STR";
+-static const char qt_configure_headers_path_str      [256 + 12] = "$HEADERS_PATH_STR";
+-static const char qt_configure_libraries_path_str    [256 + 12] = "$LIBRARIES_PATH_STR";
+-static const char qt_configure_binaries_path_str     [256 + 12] = "$BINARIES_PATH_STR";
+-static const char qt_configure_plugins_path_str      [256 + 12] = "$PLUGINS_PATH_STR";
+-static const char qt_configure_imports_path_str      [256 + 12] = "$IMPORTS_PATH_STR";
+-static const char qt_configure_data_path_str         [256 + 12] = "$DATA_PATH_STR";
+-static const char qt_configure_translations_path_str [256 + 12] = "$TRANSLATIONS_PATH_STR";
+-static const char qt_configure_settings_path_str     [256 + 12] = "$SETTINGS_PATH_STR";
+-static const char qt_configure_examples_path_str     [256 + 12] = "$EXAMPLES_PATH_STR";
+-static const char qt_configure_demos_path_str        [256 + 12] = "$DEMOS_PATH_STR";
++static const char qt_configure_prefix_path_str       [512 + 12] = "$PREFIX_PATH_STR";
++static const char qt_configure_documentation_path_str[512 + 12] = "$DOCUMENTATION_PATH_STR";
++static const char qt_configure_headers_path_str      [512 + 12] = "$HEADERS_PATH_STR";
++static const char qt_configure_libraries_path_str    [512 + 12] = "$LIBRARIES_PATH_STR";
++static const char qt_configure_binaries_path_str     [512 + 12] = "$BINARIES_PATH_STR";
++static const char qt_configure_plugins_path_str      [512 + 12] = "$PLUGINS_PATH_STR";
++static const char qt_configure_imports_path_str      [512 + 12] = "$IMPORTS_PATH_STR";
++static const char qt_configure_data_path_str         [512 + 12] = "$DATA_PATH_STR";
++static const char qt_configure_translations_path_str [512 + 12] = "$TRANSLATIONS_PATH_STR";
++static const char qt_configure_settings_path_str     [512 + 12] = "$SETTINGS_PATH_STR";
++static const char qt_configure_examples_path_str     [512 + 12] = "$EXAMPLES_PATH_STR";
++static const char qt_configure_demos_path_str        [512 + 12] = "$DEMOS_PATH_STR";
+ EOF
+ 
+ if [ ! -z "$QT_HOST_PREFIX" ]; then
+-- 
+1.8.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0027-tools.pro-disable-qmeegographicssystemhelper.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0027-tools.pro-disable-qmeegographicssystemhelper.patch
new file mode 100644
index 0000000..6e30aee
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0027-tools.pro-disable-qmeegographicssystemhelper.patch
@@ -0,0 +1,28 @@
+From 0460e2a5f13aaf0081c3c9fec89280046842ddbb Mon Sep 17 00:00:00 2001
+From: Paul Eggleton <paul.eggleton@linux.intel.com>
+Date: Wed, 3 Jul 2013 17:48:30 +0100
+Subject: [PATCH] tools.pro: disable qmeegographicssystemhelper
+
+We don't want this enabled just because we have EGL and OpenGL ES 2.0
+enabled.
+
+Upstream-Status: Inappropriate [config]
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+---
+ tools/tools.pro | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/tools.pro b/tools/tools.pro
+index 0e27053..2d3f36d 100644
+--- a/tools/tools.pro
++++ b/tools/tools.pro
+@@ -49,4 +49,4 @@ QTDIR_build:REQUIRES = "contains(QT_CONFIG, full-config)"
+ 
+ !win32:!embedded:!mac:!symbian:CONFIG += x11
+ 
+-x11:contains(QT_CONFIG, opengles2):contains(QT_CONFIG, egl):SUBDIRS += qmeegographicssystemhelper
++#x11:contains(QT_CONFIG, opengles2):contains(QT_CONFIG, egl):SUBDIRS += qmeegographicssystemhelper
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0028-Don-t-crash-on-broken-GIF-images.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0028-Don-t-crash-on-broken-GIF-images.patch
new file mode 100644
index 0000000..906e2fd
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0028-Don-t-crash-on-broken-GIF-images.patch
@@ -0,0 +1,47 @@
+From f1b76c126c476c155af8c404b97c42cd1a709333 Mon Sep 17 00:00:00 2001
+From: Lars Knoll <lars.knoll@digia.com>
+Date: Thu, 24 Apr 2014 15:33:27 +0200
+Subject: [PATCH] Don't crash on broken GIF images
+
+Broken GIF images could set invalid width and height
+values inside the image, leading to Qt creating a null
+QImage for it. In that case we need to abort decoding
+the image and return an error.
+
+Initial patch by Rich Moore.
+
+Backport of Id82a4036f478bd6e49c402d6598f57e7e5bb5e1e from Qt 5
+
+Task-number: QTBUG-38367
+Change-Id: I0680740018aaa8356d267b7af3f01fac3697312a
+Security-advisory: CVE-2014-0190
+Reviewed-by: Richard J. Moore <rich@kde.org>
+
+Upstream-Status: Backport
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+---
+ src/gui/image/qgifhandler.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/gui/image/qgifhandler.cpp b/src/gui/image/qgifhandler.cpp
+index 3324f04..5199dd3 100644
+--- a/src/gui/image/qgifhandler.cpp
++++ b/src/gui/image/qgifhandler.cpp
+@@ -359,6 +359,13 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length,
+                     memset(bits, 0, image->byteCount());
+                 }
+ 
++                // Check if the previous attempt to create the image failed. If it
++                // did then the image is broken and we should give up.
++                if (image->isNull()) {
++                    state = Error;
++                    return -1;
++                }
++
+                 disposePrevious(image);
+                 disposed = false;
+ 
+-- 
+1.9.3
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0030-aarch64_arm64_qatomic_support.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0030-aarch64_arm64_qatomic_support.patch
new file mode 100644
index 0000000..ba4c2a6
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0030-aarch64_arm64_qatomic_support.patch
@@ -0,0 +1,491 @@
+From 294010b562c9846bb2bc4ee9c63ff78adc7c1f4f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lisandro=20Dami=C3=A1n=20Nicanor=20P=C3=A9rez=20Meyer?=
+ <perezmeyer@gmail.com>
+Date: Sat, 15 Mar 2014 15:40:49 -0300
+Subject: [PATCH] Add qatomic support for AArch64 (aka arm64).
+
+Patch by Mark Salter <msalter@redhat.com>
+licensed under BSD:
+
+<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735488#195>
+
+This patch is known to not be the most correct way
+to implement them, as it seems to be possible to do it in a faster way,
+but should work non the less until we can provide something better.
+
+Change-Id: Ib392b27dc54691fd4c2ea9896240ad71fb8128cc
+
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ src/corelib/arch/aarch64/arch.pri            |   4 +
+ src/corelib/arch/aarch64/qatomic_aarch64.cpp |  70 ++++++
+ src/corelib/arch/arch.pri                    |   4 +-
+ src/corelib/arch/qatomic_aarch64.h           | 335 +++++++++++++++++++++++++++
+ src/corelib/arch/qatomic_arch.h              |   2 +
+ 5 files changed, 414 insertions(+), 1 deletion(-)
+ create mode 100644 src/corelib/arch/aarch64/arch.pri
+ create mode 100644 src/corelib/arch/aarch64/qatomic_aarch64.cpp
+ create mode 100644 src/corelib/arch/qatomic_aarch64.h
+
+diff --git a/src/corelib/arch/aarch64/arch.pri b/src/corelib/arch/aarch64/arch.pri
+new file mode 100644
+index 0000000..63523d9
+--- /dev/null
++++ b/src/corelib/arch/aarch64/arch.pri
+@@ -0,0 +1,4 @@
++#
++# AArch64 architecture
++#
++SOURCES += $$QT_ARCH_CPP/qatomic_aarch64.cpp
+diff --git a/src/corelib/arch/aarch64/qatomic_aarch64.cpp b/src/corelib/arch/aarch64/qatomic_aarch64.cpp
+new file mode 100644
+index 0000000..fc851b9
+--- /dev/null
++++ b/src/corelib/arch/aarch64/qatomic_aarch64.cpp
+@@ -0,0 +1,70 @@
++/****************************************************************************
++**
++** Copyright (C) 2012, 2013 Digia Plc and/or its subsidiary(-ies).
++** Contact: http://www.qt-project.org/legal
++**
++** This file is part of the QtCore module of the Qt Toolkit.
++**
++** $QT_BEGIN_LICENSE:LGPL$
++** Commercial License Usage
++** Licensees holding valid commercial Qt licenses may use this file in
++** accordance with the commercial license agreement provided with the
++** Software or, alternatively, in accordance with the terms contained in
++** a written agreement between you and Digia.  For licensing terms and
++** conditions see http://qt.digia.com/licensing.  For further information
++** use the contact form at http://qt.digia.com/contact-us.
++**
++** GNU Lesser General Public License Usage
++** Alternatively, this file may be used under the terms of the GNU Lesser
++** General Public License version 2.1 as published by the Free Software
++** Foundation and appearing in the file LICENSE.LGPL included in the
++** packaging of this file.  Please review the following information to
++** ensure the GNU Lesser General Public License version 2.1 requirements
++** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
++**
++** In addition, as a special exception, Digia gives you certain additional
++** rights.  These rights are described in the Digia Qt LGPL Exception
++** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
++**
++** GNU General Public License Usage
++** Alternatively, this file may be used under the terms of the GNU
++** General Public License version 3.0 as published by the Free Software
++** Foundation and appearing in the file LICENSE.GPL included in the
++** packaging of this file.  Please review the following information to
++** ensure the GNU General Public License version 3.0 requirements will be
++** met: http://www.gnu.org/copyleft/gpl.html.
++**
++**
++** $QT_END_LICENSE$
++**
++****************************************************************************/
++
++#include <QtCore/qglobal.h>
++
++#include <unistd.h>
++#ifdef _POSIX_PRIORITY_SCHEDULING
++# include <sched.h>
++#endif
++#include <time.h>
++
++QT_BEGIN_NAMESPACE
++
++QT_USE_NAMESPACE
++
++Q_CORE_EXPORT void qt_atomic_yield(int *count)
++{
++#ifdef _POSIX_PRIORITY_SCHEDULING
++    if ((*count)++ < 50) {
++        sched_yield();
++    } else
++#endif
++    {
++        struct timespec tm;
++        tm.tv_sec = 0;
++        tm.tv_nsec = 2000001;
++        nanosleep(&tm, NULL);
++        *count = 0;
++    }
++}
++
++QT_END_NAMESPACE
+diff --git a/src/corelib/arch/arch.pri b/src/corelib/arch/arch.pri
+index cd23e5e..f50fca7 100644
+--- a/src/corelib/arch/arch.pri
++++ b/src/corelib/arch/arch.pri
+@@ -31,7 +31,9 @@ integrity:HEADERS += arch/qatomic_integrity.h
+                        arch/qatomic_s390.h \
+                        arch/qatomic_x86_64.h \
+                        arch/qatomic_sh.h \
+-                       arch/qatomic_sh4a.h
++                       arch/qatomic_sh4a.h \
++                       arch/qatomic_aarch64.h \
++
+ 
+ QT_ARCH_CPP = $$QT_SOURCE_TREE/src/corelib/arch/$$QT_ARCH
+ DEPENDPATH += $$QT_ARCH_CPP
+diff --git a/src/corelib/arch/qatomic_aarch64.h b/src/corelib/arch/qatomic_aarch64.h
+new file mode 100644
+index 0000000..de61ca8
+--- /dev/null
++++ b/src/corelib/arch/qatomic_aarch64.h
+@@ -0,0 +1,335 @@
++/****************************************************************************
++**
++** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
++** Contact: http://www.qt-project.org/legal
++**
++** This file is part of the QtCore module of the Qt Toolkit.
++**
++** $QT_BEGIN_LICENSE:LGPL$
++** Commercial License Usage
++** Licensees holding valid commercial Qt licenses may use this file in
++** accordance with the commercial license agreement provided with the
++** Software or, alternatively, in accordance with the terms contained in
++** a written agreement between you and Digia.  For licensing terms and
++** conditions see http://qt.digia.com/licensing.  For further information
++** use the contact form at http://qt.digia.com/contact-us.
++**
++** GNU Lesser General Public License Usage
++** Alternatively, this file may be used under the terms of the GNU Lesser
++** General Public License version 2.1 as published by the Free Software
++** Foundation and appearing in the file LICENSE.LGPL included in the
++** packaging of this file.  Please review the following information to
++** ensure the GNU Lesser General Public License version 2.1 requirements
++** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
++**
++** In addition, as a special exception, Digia gives you certain additional
++** rights.  These rights are described in the Digia Qt LGPL Exception
++** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
++**
++** GNU General Public License Usage
++** Alternatively, this file may be used under the terms of the GNU
++** General Public License version 3.0 as published by the Free Software
++** Foundation and appearing in the file LICENSE.GPL included in the
++** packaging of this file.  Please review the following information to
++** ensure the GNU General Public License version 3.0 requirements will be
++** met: http://www.gnu.org/copyleft/gpl.html.
++**
++**
++** $QT_END_LICENSE$
++**
++****************************************************************************/
++
++#ifndef QATOMIC_AARCH64_H
++#define QATOMIC_AARCH64_H
++
++QT_BEGIN_HEADER
++
++QT_BEGIN_NAMESPACE
++
++#define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE
++
++inline bool QBasicAtomicInt::isReferenceCountingNative()
++{ return true; }
++inline bool QBasicAtomicInt::isReferenceCountingWaitFree()
++{ return false; }
++
++#define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE
++
++inline bool QBasicAtomicInt::isTestAndSetNative()
++{ return true; }
++inline bool QBasicAtomicInt::isTestAndSetWaitFree()
++{ return false; }
++
++#define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE
++
++inline bool QBasicAtomicInt::isFetchAndStoreNative()
++{ return true; }
++inline bool QBasicAtomicInt::isFetchAndStoreWaitFree()
++{ return false; }
++
++#define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE
++
++inline bool QBasicAtomicInt::isFetchAndAddNative()
++{ return true; }
++inline bool QBasicAtomicInt::isFetchAndAddWaitFree()
++{ return false; }
++
++#define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE
++
++template <typename T>
++Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isTestAndSetNative()
++{ return true; }
++template <typename T>
++Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isTestAndSetWaitFree()
++{ return false; }
++
++#define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE
++
++template <typename T>
++Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndStoreNative()
++{ return true; }
++template <typename T>
++Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndStoreWaitFree()
++{ return false; }
++
++#define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE
++
++template <typename T>
++Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddNative()
++{ return true; }
++template <typename T>
++Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::isFetchAndAddWaitFree()
++{ return false; }
++
++#ifndef Q_DATA_MEMORY_BARRIER
++# define Q_DATA_MEMORY_BARRIER asm volatile("dmb sy\n":::"memory")
++#endif
++#ifndef Q_COMPILER_MEMORY_BARRIER
++# define Q_COMPILER_MEMORY_BARRIER asm volatile("":::"memory")
++#endif
++
++inline bool QBasicAtomicInt::ref()
++{
++    int newValue;
++
++    Q_COMPILER_MEMORY_BARRIER;
++    newValue = __atomic_add_fetch(&_q_value, 1, __ATOMIC_ACQ_REL);
++    Q_COMPILER_MEMORY_BARRIER;
++
++    return newValue != 0;
++}
++
++inline bool QBasicAtomicInt::deref()
++{
++    int newValue;
++
++    Q_COMPILER_MEMORY_BARRIER;
++    newValue = __atomic_sub_fetch(&_q_value, 1, __ATOMIC_ACQ_REL);
++    Q_COMPILER_MEMORY_BARRIER;
++
++    return newValue != 0;
++}
++
++inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
++{
++    bool val;
++
++    Q_COMPILER_MEMORY_BARRIER;
++    val =  __atomic_compare_exchange_n (&_q_value, &expectedValue, newValue,
++                                        false, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
++    Q_COMPILER_MEMORY_BARRIER;
++    return val;
++}
++
++inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
++{
++    int val;
++    Q_COMPILER_MEMORY_BARRIER;
++    val = __atomic_exchange_n(&_q_value, newValue, __ATOMIC_RELAXED);
++    Q_COMPILER_MEMORY_BARRIER;
++    return val;
++}
++
++inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
++{
++    int val;
++    Q_COMPILER_MEMORY_BARRIER;
++    val = __atomic_fetch_add(&_q_value, valueToAdd, __ATOMIC_RELAXED);
++    Q_COMPILER_MEMORY_BARRIER;
++    return val;
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
++{
++    bool val;
++    Q_COMPILER_MEMORY_BARRIER;
++    val =  __atomic_compare_exchange_n (&_q_value, &expectedValue, newValue,
++                                        false, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
++    Q_COMPILER_MEMORY_BARRIER;
++    return val;
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelaxed(T *newValue)
++{
++    T *val;
++    Q_COMPILER_MEMORY_BARRIER;
++    val = __atomic_exchange_n(&_q_value, newValue, __ATOMIC_RELAXED);
++    Q_COMPILER_MEMORY_BARRIER;
++    return val;
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelaxed(qptrdiff valueToAdd)
++{
++    T *val;
++    Q_COMPILER_MEMORY_BARRIER;
++    val = __atomic_fetch_add(&_q_value, valueToAdd, __ATOMIC_RELAXED);
++    Q_COMPILER_MEMORY_BARRIER;
++    return val;
++}
++
++inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
++{
++    bool returnValue = testAndSetRelaxed(expectedValue, newValue);
++    Q_DATA_MEMORY_BARRIER;
++    return returnValue;
++}
++
++inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
++{
++    Q_DATA_MEMORY_BARRIER;
++    return testAndSetRelaxed(expectedValue, newValue);
++}
++
++inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue)
++{
++    Q_DATA_MEMORY_BARRIER;
++    bool returnValue = testAndSetRelaxed(expectedValue, newValue);
++    Q_COMPILER_MEMORY_BARRIER;
++    return returnValue;
++}
++
++inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
++{
++    int returnValue = fetchAndStoreRelaxed(newValue);
++    Q_DATA_MEMORY_BARRIER;
++    return returnValue;
++}
++
++inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
++{
++    Q_DATA_MEMORY_BARRIER;
++    return fetchAndStoreRelaxed(newValue);
++}
++
++inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
++{
++    Q_DATA_MEMORY_BARRIER;
++    int returnValue = fetchAndStoreRelaxed(newValue);
++    Q_COMPILER_MEMORY_BARRIER;
++    return returnValue;
++}
++
++inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
++{
++    int returnValue = fetchAndAddRelaxed(valueToAdd);
++    Q_DATA_MEMORY_BARRIER;
++    return returnValue;
++}
++
++inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
++{
++    Q_DATA_MEMORY_BARRIER;
++    return fetchAndAddRelaxed(valueToAdd);
++}
++
++inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd)
++{
++    Q_DATA_MEMORY_BARRIER;
++    int returnValue = fetchAndAddRelaxed(valueToAdd);
++    Q_COMPILER_MEMORY_BARRIER;
++    return returnValue;
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
++{
++    bool returnValue = testAndSetRelaxed(expectedValue, newValue);
++    Q_DATA_MEMORY_BARRIER;
++    return returnValue;
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
++{
++    Q_DATA_MEMORY_BARRIER;
++    return testAndSetRelaxed(expectedValue, newValue);
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
++{
++    Q_DATA_MEMORY_BARRIER;
++    bool returnValue = testAndSetAcquire(expectedValue, newValue);
++    Q_COMPILER_MEMORY_BARRIER;
++    return returnValue;
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreAcquire(T *newValue)
++{
++    T *returnValue = fetchAndStoreRelaxed(newValue);
++    Q_DATA_MEMORY_BARRIER;
++    return returnValue;
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreRelease(T *newValue)
++{
++    Q_DATA_MEMORY_BARRIER;
++    return fetchAndStoreRelaxed(newValue);
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndStoreOrdered(T *newValue)
++{
++    Q_DATA_MEMORY_BARRIER;
++    T *returnValue = fetchAndStoreRelaxed(newValue);
++    Q_COMPILER_MEMORY_BARRIER;
++    return returnValue;
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddAcquire(qptrdiff valueToAdd)
++{
++    T *returnValue = fetchAndAddRelaxed(valueToAdd);
++    Q_DATA_MEMORY_BARRIER;
++    return returnValue;
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddRelease(qptrdiff valueToAdd)
++{
++    Q_DATA_MEMORY_BARRIER;
++    return fetchAndAddRelaxed(valueToAdd);
++}
++
++template <typename T>
++Q_INLINE_TEMPLATE T *QBasicAtomicPointer<T>::fetchAndAddOrdered(qptrdiff valueToAdd)
++{
++    Q_DATA_MEMORY_BARRIER;
++    T *returnValue = fetchAndAddRelaxed(valueToAdd);
++    Q_COMPILER_MEMORY_BARRIER;
++    return returnValue;
++}
++
++#undef Q_DATA_MEMORY_BARRIER
++#undef Q_COMPILER_MEMORY_BARRIER
++
++QT_END_NAMESPACE
++
++QT_END_HEADER
++
++#endif // QATOMIC_AARCH64_H
+diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h
+index 141726c..3e96926 100644
+--- a/src/corelib/arch/qatomic_arch.h
++++ b/src/corelib/arch/qatomic_arch.h
+@@ -94,6 +94,8 @@ QT_BEGIN_HEADER
+ #  include "QtCore/qatomic_sh4a.h"
+ #elif defined(QT_ARCH_NACL)
+ #  include "QtCore/qatomic_generic.h"
++#elif defined(QT_ARCH_AARCH64)
++#  include "QtCore/qatomic_aarch64.h"
+ #else
+ #  error "Qt has not been ported to this architecture"
+ #endif
+-- 
+2.1.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0031-aarch64_arm64_mkspecs.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0031-aarch64_arm64_mkspecs.patch
new file mode 100644
index 0000000..a01e7ad
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0031-aarch64_arm64_mkspecs.patch
@@ -0,0 +1,124 @@
+From 7090fc80ff630712a90de92403190f647dd38a39 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lisandro=20Dami=C3=A1n=20Nicanor=20P=C3=A9rez=20Meyer?=
+ <perezmeyer@gmail.com>
+Date: Sat, 15 Mar 2014 15:35:00 -0300
+Subject: [PATCH] mkspecs for AArch64 (aka arm64).
+
+Patch by Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
+licensed under either Public Domain or BSD:
+
+<https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=735488#179>
+
+Change-Id: I21f17953234cfb176bac023e52ecdc927fc5c1a9
+
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+
+---
+ configure                                 |  3 +++
+ mkspecs/linux-g++-aarch64/qmake.conf      | 27 ++++++++++++++++++++
+ mkspecs/linux-g++-aarch64/qplatformdefs.h | 42 +++++++++++++++++++++++++++++++
+ 3 files changed, 72 insertions(+)
+ create mode 100644 mkspecs/linux-g++-aarch64/qmake.conf
+ create mode 100644 mkspecs/linux-g++-aarch64/qplatformdefs.h
+
+diff --git a/configure b/configure
+index a9ba7c8..e57d053 100755
+--- a/configure
++++ b/configure
+@@ -2808,6 +2808,9 @@ if [ "$CFG_EMBEDDED" != "no" ]; then
+             *86_64)
+                 PLATFORM=qws/linux-x86_64-g++
+                 ;;
++            aarch64)
++                PLATFORM=linux-aarch64-g++
++                ;;
+             *)
+                 PLATFORM=qws/linux-generic-g++
+                 ;;
+diff --git a/mkspecs/linux-g++-aarch64/qmake.conf b/mkspecs/linux-g++-aarch64/qmake.conf
+new file mode 100644
+index 0000000..ebc0a92
+--- /dev/null
++++ b/mkspecs/linux-g++-aarch64/qmake.conf
+@@ -0,0 +1,27 @@
++#
++# qmake configuration for linux-g++
++#
++# Written for GNU/Linux platforms that have both lib and lib64 directories,
++# like the AMD Opteron.
++#
++
++MAKEFILE_GENERATOR    = UNIX
++TARGET_PLATFORM       = unix
++TEMPLATE              = app
++CONFIG               += qt warn_on release incremental link_prl gdb_dwarf_index
++QT                   += core gui
++QMAKE_INCREMENTAL_STYLE = sublib
++
++QMAKE_CFLAGS     =
++QMAKE_LFLAGS     =
++
++QMAKE_CFLAGS_RELEASE   += -O2
++
++include(../common/linux.conf)
++include(../common/gcc-base-unix.conf)
++include(../common/g++-unix.conf)
++
++QMAKE_LIBDIR_X11      = /usr/X11R6/lib64
++QMAKE_LIBDIR_OPENGL   = /usr/X11R6/lib64
++
++load(qt_config)
+diff --git a/mkspecs/linux-g++-aarch64/qplatformdefs.h b/mkspecs/linux-g++-aarch64/qplatformdefs.h
+new file mode 100644
+index 0000000..562128b
+--- /dev/null
++++ b/mkspecs/linux-g++-aarch64/qplatformdefs.h
+@@ -0,0 +1,42 @@
++/****************************************************************************
++**
++** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
++** Contact: http://www.qt-project.org/legal
++**
++** This file is part of the qmake spec of the Qt Toolkit.
++**
++** $QT_BEGIN_LICENSE:LGPL$
++** Commercial License Usage
++** Licensees holding valid commercial Qt licenses may use this file in
++** accordance with the commercial license agreement provided with the
++** Software or, alternatively, in accordance with the terms contained in
++** a written agreement between you and Digia.  For licensing terms and
++** conditions see http://qt.digia.com/licensing.  For further information
++** use the contact form at http://qt.digia.com/contact-us.
++**
++** GNU Lesser General Public License Usage
++** Alternatively, this file may be used under the terms of the GNU Lesser
++** General Public License version 2.1 as published by the Free Software
++** Foundation and appearing in the file LICENSE.LGPL included in the
++** packaging of this file.  Please review the following information to
++** ensure the GNU Lesser General Public License version 2.1 requirements
++** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
++**
++** In addition, as a special exception, Digia gives you certain additional
++** rights.  These rights are described in the Digia Qt LGPL Exception
++** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
++**
++** GNU General Public License Usage
++** Alternatively, this file may be used under the terms of the GNU
++** General Public License version 3.0 as published by the Free Software
++** Foundation and appearing in the file LICENSE.GPL included in the
++** packaging of this file.  Please review the following information to
++** ensure the GNU General Public License version 3.0 requirements will be
++** met: http://www.gnu.org/copyleft/gpl.html.
++**
++**
++** $QT_END_LICENSE$
++**
++****************************************************************************/
++
++#include "../linux-g++/qplatformdefs.h"
+-- 
+2.1.0
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0032-aarch64_add_header.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0032-aarch64_add_header.patch
new file mode 100644
index 0000000..178f784
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0032-aarch64_add_header.patch
@@ -0,0 +1,18 @@
+Add missing header for aarch64. And install ../corelib/arch/qatomic_aarch64.h.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+diff -Nru qt-everywhere-opensource-src-4.8.6.orig/include/QtCore/qatomic_aarch64.h qt-everywhere-opensource-src-4.8.6/include/QtCore/qatomic_aarch64.h
+--- qt-everywhere-opensource-src-4.8.6.orig/include/QtCore/qatomic_aarch64.h	1970-01-01 08:30:00.000000000 +0830
++++ qt-everywhere-opensource-src-4.8.6/include/QtCore/qatomic_aarch64.h	2014-09-09 17:18:03.768352551 +0800
+@@ -0,0 +1 @@
++#include "../../src/corelib/arch/qatomic_aarch64.h"
+--- qt-everywhere-opensource-src-4.8.6/include/QtCore/headers.pri.orig	2014-09-09 18:05:37.100430311 +0800
++++ qt-everywhere-opensource-src-4.8.6/include/QtCore/headers.pri	2014-09-09 18:05:59.112430911 +0800
+@@ -1,3 +1,3 @@
+-SYNCQT.HEADER_FILES = ../corelib/kernel/qabstracteventdispatcher.h ../corelib/kernel/qabstractitemmodel.h ../corelib/kernel/qbasictimer.h ../corelib/kernel/qcoreapplication.h ../corelib/kernel/qcoreevent.h ../corelib/kernel/qeventloop.h ../corelib/kernel/qfunctions_nacl.h ../corelib/kernel/qfunctions_vxworks.h ../corelib/kernel/qfunctions_wince.h ../corelib/kernel/qmath.h ../corelib/kernel/qmetaobject.h ../corelib/kernel/qmetatype.h ../corelib/kernel/qmimedata.h ../corelib/kernel/qobject.h ../corelib/kernel/qobjectcleanuphandler.h ../corelib/kernel/qobjectdefs.h ../corelib/kernel/qpointer.h ../corelib/kernel/qsharedmemory.h ../corelib/kernel/qsignalmapper.h ../corelib/kernel/qsocketnotifier.h ../corelib/kernel/qsystemsemaphore.h ../corelib/kernel/qtimer.h ../corelib/kernel/qtranslator.h ../corelib/kernel/qvariant.h ../corelib/animation/qabstractanimation.h ../corelib/animation/qanimationgroup.h ../corelib/animation/qparallelanimationgroup.h ../corelib/animation/qpauseanimation.h ../corelib/animation/qpropertyanimation.h ../corelib/animation/qsequentialanimationgroup.h ../corelib/animation/qvariantanimation.h ../corelib/arch/qatomic_alpha.h ../corelib/arch/qatomic_arch.h ../corelib/arch/qatomic_arm.h ../corelib/arch/qatomic_armv5.h ../corelib/arch/qatomic_armv6.h ../corelib/arch/qatomic_armv7.h ../corelib/arch/qatomic_avr32.h ../corelib/arch/qatomic_bfin.h ../corelib/arch/qatomic_bootstrap.h ../corelib/arch/qatomic_generic.h ../corelib/arch/qatomic_i386.h ../corelib/arch/qatomic_ia64.h ../corelib/arch/qatomic_integrity.h ../corelib/arch/qatomic_m68k.h ../corelib/arch/qatomic_macosx.h ../corelib/arch/qatomic_mips.h ../corelib/arch/qatomic_parisc.h ../corelib/arch/qatomic_powerpc.h ../corelib/arch/qatomic_s390.h ../corelib/arch/qatomic_sh.h ../corelib/arch/qatomic_sh4a.h ../corelib/arch/qatomic_sparc.h ../corelib/arch/qatomic_symbian.h ../corelib/arch/qatomic_vxworks.h ../corelib/arch/qatomic_windows.h ../corelib/arch/qatomic_windowsce.h ../corelib/arch/qatomic_x86_64.h ../corelib/tools/qalgorithms.h ../corelib/tools/qbitarray.h ../corelib/tools/qbytearray.h ../corelib/tools/qbytearraymatcher.h ../corelib/tools/qcache.h ../corelib/tools/qchar.h ../corelib/tools/qcontainerfwd.h ../corelib/tools/qcontiguouscache.h ../corelib/tools/qcryptographichash.h ../corelib/tools/qdatetime.h ../corelib/tools/qeasingcurve.h ../corelib/tools/qelapsedtimer.h ../corelib/tools/qhash.h ../corelib/tools/qiterator.h ../corelib/tools/qline.h ../corelib/tools/qlinkedlist.h ../corelib/tools/qlist.h ../corelib/tools/qlocale.h ../corelib/tools/qlocale_blackberry.h ../corelib/tools/qmap.h ../corelib/tools/qmargins.h ../corelib/tools/qpair.h ../corelib/tools/qpoint.h ../corelib/tools/qqueue.h ../corelib/tools/qrect.h ../corelib/tools/qregexp.h ../corelib/tools/qscopedpointer.h ../corelib/tools/qscopedvaluerollback.h ../corelib/tools/qset.h ../corelib/tools/qshareddata.h ../corelib/tools/qsharedpointer.h ../corelib/tools/qsharedpointer_impl.h ../corelib/tools/qsize.h ../corelib/tools/qstack.h ../corelib/tools/qstring.h ../corelib/tools/qstringbuilder.h ../corelib/tools/qstringlist.h ../corelib/tools/qstringmatcher.h ../corelib/tools/qtextboundaryfinder.h ../corelib/tools/qtimeline.h ../corelib/tools/qvarlengtharray.h ../corelib/tools/qvector.h ../corelib/plugin/qfactoryinterface.h ../corelib/plugin/qlibrary.h ../corelib/plugin/qplugin.h ../corelib/plugin/qpluginloader.h ../corelib/plugin/quuid.h ../corelib/xml/qxmlstream.h ../corelib/thread/qatomic.h ../corelib/thread/qbasicatomic.h ../corelib/thread/qmutex.h ../corelib/thread/qreadwritelock.h ../corelib/thread/qsemaphore.h ../corelib/thread/qthread.h ../corelib/thread/qthreadstorage.h ../corelib/thread/qwaitcondition.h ../corelib/statemachine/qabstractstate.h ../corelib/statemachine/qabstracttransition.h ../corelib/statemachine/qeventtransition.h ../corelib/statemachine/qfinalstate.h ../corelib/statemachine/qhistorystate.h ../corelib/statemachine/qsignaltransition.h ../corelib/statemachine/qstate.h ../corelib/statemachine/qstatemachine.h ../corelib/concurrent/qfuture.h ../corelib/concurrent/qfutureinterface.h ../corelib/concurrent/qfuturesynchronizer.h ../corelib/concurrent/qfuturewatcher.h ../corelib/concurrent/qrunnable.h ../corelib/concurrent/qtconcurrentcompilertest.h ../corelib/concurrent/qtconcurrentexception.h ../corelib/concurrent/qtconcurrentfilter.h ../corelib/concurrent/qtconcurrentfilterkernel.h ../corelib/concurrent/qtconcurrentfunctionwrappers.h ../corelib/concurrent/qtconcurrentiteratekernel.h ../corelib/concurrent/qtconcurrentmap.h ../corelib/concurrent/qtconcurrentmapkernel.h ../corelib/concurrent/qtconcurrentmedian.h ../corelib/concurrent/qtconcurrentreducekernel.h ../corelib/concurrent/qtconcurrentresultstore.h ../corelib/concurrent/qtconcurrentrun.h ../corelib/concurrent/qtconcurrentrunbase.h ../corelib/concurrent/qtconcurrentstoredfunctioncall.h ../corelib/concurrent/qtconcurrentthreadengine.h ../corelib/concurrent/qthreadpool.h ../corelib/io/qabstractfileengine.h ../corelib/io/qbuffer.h ../corelib/io/qdatastream.h ../corelib/io/qdebug.h ../corelib/io/qdir.h ../corelib/io/qdiriterator.h ../corelib/io/qfile.h ../corelib/io/qfileinfo.h ../corelib/io/qfilesystemwatcher.h ../corelib/io/qfsfileengine.h ../corelib/io/qiodevice.h ../corelib/io/qprocess.h ../corelib/io/qresource.h ../corelib/io/qsettings.h ../corelib/io/qtemporaryfile.h ../corelib/io/qtextstream.h ../corelib/io/qurl.h ../corelib/global/qconfig-dist.h ../corelib/global/qconfig-large.h ../corelib/global/qconfig-medium.h ../corelib/global/qconfig-minimal.h ../corelib/global/qconfig-nacl.h ../corelib/global/qconfig-small.h ../corelib/global/qendian.h ../corelib/global/qfeatures.h ../corelib/global/qglobal.h ../corelib/global/qlibraryinfo.h ../corelib/global/qnamespace.h ../corelib/global/qnumeric.h ../corelib/global/qt_windows.h ../corelib/global/qconfig.h ../corelib/codecs/qtextcodec.h ../corelib/codecs/qtextcodecplugin.h ../../include/QtCore/QtCore 
++SYNCQT.HEADER_FILES = ../corelib/kernel/qabstracteventdispatcher.h ../corelib/kernel/qabstractitemmodel.h ../corelib/kernel/qbasictimer.h ../corelib/kernel/qcoreapplication.h ../corelib/kernel/qcoreevent.h ../corelib/kernel/qeventloop.h ../corelib/kernel/qfunctions_nacl.h ../corelib/kernel/qfunctions_vxworks.h ../corelib/kernel/qfunctions_wince.h ../corelib/kernel/qmath.h ../corelib/kernel/qmetaobject.h ../corelib/kernel/qmetatype.h ../corelib/kernel/qmimedata.h ../corelib/kernel/qobject.h ../corelib/kernel/qobjectcleanuphandler.h ../corelib/kernel/qobjectdefs.h ../corelib/kernel/qpointer.h ../corelib/kernel/qsharedmemory.h ../corelib/kernel/qsignalmapper.h ../corelib/kernel/qsocketnotifier.h ../corelib/kernel/qsystemsemaphore.h ../corelib/kernel/qtimer.h ../corelib/kernel/qtranslator.h ../corelib/kernel/qvariant.h ../corelib/animation/qabstractanimation.h ../corelib/animation/qanimationgroup.h ../corelib/animation/qparallelanimationgroup.h ../corelib/animation/qpauseanimation.h ../corelib/animation/qpropertyanimation.h ../corelib/animation/qsequentialanimationgroup.h ../corelib/animation/qvariantanimation.h ../corelib/arch/qatomic_alpha.h ../corelib/arch/qatomic_arch.h ../corelib/arch/qatomic_arm.h ../corelib/arch/qatomic_armv5.h ../corelib/arch/qatomic_armv6.h ../corelib/arch/qatomic_armv7.h ../corelib/arch/qatomic_aarch64.h ../corelib/arch/qatomic_avr32.h ../corelib/arch/qatomic_bfin.h ../corelib/arch/qatomic_bootstrap.h ../corelib/arch/qatomic_generic.h ../corelib/arch/qatomic_i386.h ../corelib/arch/qatomic_ia64.h ../corelib/arch/qatomic_integrity.h ../corelib/arch/qatomic_m68k.h ../corelib/arch/qatomic_macosx.h ../corelib/arch/qatomic_mips.h ../corelib/arch/qatomic_parisc.h ../corelib/arch/qatomic_powerpc.h ../corelib/arch/qatomic_s390.h ../corelib/arch/qatomic_sh.h ../corelib/arch/qatomic_sh4a.h ../corelib/arch/qatomic_sparc.h ../corelib/arch/qatomic_symbian.h ../corelib/arch/qatomic_vxworks.h ../corelib/arch/qatomic_windows.h ../corelib/arch/qatomic_windowsce.h ../corelib/arch/qatomic_x86_64.h ../corelib/tools/qalgorithms.h ../corelib/tools/qbitarray.h ../corelib/tools/qbytearray.h ../corelib/tools/qbytearraymatcher.h ../corelib/tools/qcache.h ../corelib/tools/qchar.h ../corelib/tools/qcontainerfwd.h ../corelib/tools/qcontiguouscache.h ../corelib/tools/qcryptographichash.h ../corelib/tools/qdatetime.h ../corelib/tools/qeasingcurve.h ../corelib/tools/qelapsedtimer.h ../corelib/tools/qhash.h ../corelib/tools/qiterator.h ../corelib/tools/qline.h ../corelib/tools/qlinkedlist.h ../corelib/tools/qlist.h ../corelib/tools/qlocale.h ../corelib/tools/qlocale_blackberry.h ../corelib/tools/qmap.h ../corelib/tools/qmargins.h ../corelib/tools/qpair.h ../corelib/tools/qpoint.h ../corelib/tools/qqueue.h ../corelib/tools/qrect.h ../corelib/tools/qregexp.h ../corelib/tools/qscopedpointer.h ../corelib/tools/qscopedvaluerollback.h ../corelib/tools/qset.h ../corelib/tools/qshareddata.h ../corelib/tools/qsharedpointer.h ../corelib/tools/qsharedpointer_impl.h ../corelib/tools/qsize.h ../corelib/tools/qstack.h ../corelib/tools/qstring.h ../corelib/tools/qstringbuilder.h ../corelib/tools/qstringlist.h ../corelib/tools/qstringmatcher.h ../corelib/tools/qtextboundaryfinder.h ../corelib/tools/qtimeline.h ../corelib/tools/qvarlengtharray.h ../corelib/tools/qvector.h ../corelib/plugin/qfactoryinterface.h ../corelib/plugin/qlibrary.h ../corelib/plugin/qplugin.h ../corelib/plugin/qpluginloader.h ../corelib/plugin/quuid.h ../corelib/xml/qxmlstream.h ../corelib/thread/qatomic.h ../corelib/thread/qbasicatomic.h ../corelib/thread/qmutex.h ../corelib/thread/qreadwritelock.h ../corelib/thread/qsemaphore.h ../corelib/thread/qthread.h ../corelib/thread/qthreadstorage.h ../corelib/thread/qwaitcondition.h ../corelib/statemachine/qabstractstate.h ../corelib/statemachine/qabstracttransition.h ../corelib/statemachine/qeventtransition.h ../corelib/statemachine/qfinalstate.h ../corelib/statemachine/qhistorystate.h ../corelib/statemachine/qsignaltransition.h ../corelib/statemachine/qstate.h ../corelib/statemachine/qstatemachine.h ../corelib/concurrent/qfuture.h ../corelib/concurrent/qfutureinterface.h ../corelib/concurrent/qfuturesynchronizer.h ../corelib/concurrent/qfuturewatcher.h ../corelib/concurrent/qrunnable.h ../corelib/concurrent/qtconcurrentcompilertest.h ../corelib/concurrent/qtconcurrentexception.h ../corelib/concurrent/qtconcurrentfilter.h ../corelib/concurrent/qtconcurrentfilterkernel.h ../corelib/concurrent/qtconcurrentfunctionwrappers.h ../corelib/concurrent/qtconcurrentiteratekernel.h ../corelib/concurrent/qtconcurrentmap.h ../corelib/concurrent/qtconcurrentmapkernel.h ../corelib/concurrent/qtconcurrentmedian.h ../corelib/concurrent/qtconcurrentreducekernel.h ../corelib/concurrent/qtconcurrentresultstore.h ../corelib/concurrent/qtconcurrentrun.h ../corelib/concurrent/qtconcurrentrunbase.h ../corelib/concurrent/qtconcurrentstoredfunctioncall.h ../corelib/concurrent/qtconcurrentthreadengine.h ../corelib/concurrent/qthreadpool.h ../corelib/io/qabstractfileengine.h ../corelib/io/qbuffer.h ../corelib/io/qdatastream.h ../corelib/io/qdebug.h ../corelib/io/qdir.h ../corelib/io/qdiriterator.h ../corelib/io/qfile.h ../corelib/io/qfileinfo.h ../corelib/io/qfilesystemwatcher.h ../corelib/io/qfsfileengine.h ../corelib/io/qiodevice.h ../corelib/io/qprocess.h ../corelib/io/qresource.h ../corelib/io/qsettings.h ../corelib/io/qtemporaryfile.h ../corelib/io/qtextstream.h ../corelib/io/qurl.h ../corelib/global/qconfig-dist.h ../corelib/global/qconfig-large.h ../corelib/global/qconfig-medium.h ../corelib/global/qconfig-minimal.h ../corelib/global/qconfig-nacl.h ../corelib/global/qconfig-small.h ../corelib/global/qendian.h ../corelib/global/qfeatures.h ../corelib/global/qglobal.h ../corelib/global/qlibraryinfo.h ../corelib/global/qnamespace.h ../corelib/global/qnumeric.h ../corelib/global/qt_windows.h ../corelib/global/qconfig.h ../corelib/codecs/qtextcodec.h ../corelib/codecs/qtextcodecplugin.h ../../include/QtCore/QtCore 
+ SYNCQT.HEADER_CLASSES = ../../include/QtCore/QAbstractEventDispatcher ../../include/QtCore/QModelIndex ../../include/QtCore/QPersistentModelIndex ../../include/QtCore/QModelIndexList ../../include/QtCore/QAbstractItemModel ../../include/QtCore/QAbstractTableModel ../../include/QtCore/QAbstractListModel ../../include/QtCore/QBasicTimer ../../include/QtCore/QCoreApplication ../../include/QtCore/QtCleanUpFunction ../../include/QtCore/QEvent ../../include/QtCore/QTimerEvent ../../include/QtCore/QChildEvent ../../include/QtCore/QCustomEvent ../../include/QtCore/QDynamicPropertyChangeEvent ../../include/QtCore/QEventLoop ../../include/QtCore/QMetaMethod ../../include/QtCore/QMetaEnum ../../include/QtCore/QMetaProperty ../../include/QtCore/QMetaClassInfo ../../include/QtCore/QMetaType ../../include/QtCore/QMetaTypeId ../../include/QtCore/QMetaTypeId2 ../../include/QtCore/QMimeData ../../include/QtCore/QObjectList ../../include/QtCore/QObjectData ../../include/QtCore/QObject ../../include/QtCore/QObjectUserData ../../include/QtCore/QObjectCleanupHandler ../../include/QtCore/QGenericArgument ../../include/QtCore/QGenericReturnArgument ../../include/QtCore/QArgument ../../include/QtCore/QReturnArgument ../../include/QtCore/QMetaObject ../../include/QtCore/QMetaObjectAccessor ../../include/QtCore/QMetaObjectExtraData ../../include/QtCore/QPointer ../../include/QtCore/QSharedMemory ../../include/QtCore/QSignalMapper ../../include/QtCore/QSocketNotifier ../../include/QtCore/QSystemSemaphore ../../include/QtCore/QTimer ../../include/QtCore/QTranslator ../../include/QtCore/QVariant ../../include/QtCore/QVariantList ../../include/QtCore/QVariantMap ../../include/QtCore/QVariantHash ../../include/QtCore/QVariantComparisonHelper ../../include/QtCore/QAbstractAnimation ../../include/QtCore/QAnimationDriver ../../include/QtCore/QAnimationGroup ../../include/QtCore/QParallelAnimationGroup ../../include/QtCore/QPauseAnimation ../../include/QtCore/QPropertyAnimation ../../include/QtCore/QSequentialAnimationGroup ../../include/QtCore/QVariantAnimation ../../include/QtCore/QtAlgorithms ../../include/QtCore/QBitArray ../../include/QtCore/QBitRef ../../include/QtCore/QByteArray ../../include/QtCore/QByteRef ../../include/QtCore/QByteArrayMatcher ../../include/QtCore/QCache ../../include/QtCore/QLatin1Char ../../include/QtCore/QChar ../../include/QtCore/QtContainerFwd ../../include/QtCore/QContiguousCacheData ../../include/QtCore/QContiguousCacheTypedData ../../include/QtCore/QContiguousCache ../../include/QtCore/QCryptographicHash ../../include/QtCore/QDate ../../include/QtCore/QTime ../../include/QtCore/QDateTime ../../include/QtCore/QEasingCurve ../../include/QtCore/QElapsedTimer ../../include/QtCore/QHashData ../../include/QtCore/QHashDummyValue ../../include/QtCore/QHashDummyNode ../../include/QtCore/QHashNode ../../include/QtCore/QHash ../../include/QtCore/QMultiHash ../../include/QtCore/QHashIterator ../../include/QtCore/QMutableHashIterator ../../include/QtCore/QLine ../../include/QtCore/QLineF ../../include/QtCore/QLinkedListData ../../include/QtCore/QLinkedListNode ../../include/QtCore/QLinkedList ../../include/QtCore/QLinkedListIterator ../../include/QtCore/QMutableLinkedListIterator ../../include/QtCore/QListData ../../include/QtCore/QList ../../include/QtCore/QListIterator ../../include/QtCore/QMutableListIterator ../../include/QtCore/QSystemLocale ../../include/QtCore/QLocale ../../include/QtCore/QBBSystemLocaleData ../../include/QtCore/QMapData ../../include/QtCore/QMapNode ../../include/QtCore/QMapPayloadNode ../../include/QtCore/QMap ../../include/QtCore/QMultiMap ../../include/QtCore/QMapIterator ../../include/QtCore/QMutableMapIterator ../../include/QtCore/QMargins ../../include/QtCore/QPair ../../include/QtCore/QPoint ../../include/QtCore/QPointF ../../include/QtCore/QQueue ../../include/QtCore/QRect ../../include/QtCore/QRectF ../../include/QtCore/QRegExp ../../include/QtCore/QScopedPointerDeleter ../../include/QtCore/QScopedPointerArrayDeleter ../../include/QtCore/QScopedPointerPodDeleter ../../include/QtCore/QScopedPointer ../../include/QtCore/QScopedArrayPointer ../../include/QtCore/QScopedValueRollback ../../include/QtCore/QSet ../../include/QtCore/QSetIterator ../../include/QtCore/QMutableSetIterator ../../include/QtCore/QSharedData ../../include/QtCore/QSharedDataPointer ../../include/QtCore/QExplicitlySharedDataPointer ../../include/QtCore/QSharedPointer ../../include/QtCore/QWeakPointer ../../include/QtCore/QSize ../../include/QtCore/QSizeF ../../include/QtCore/QStack ../../include/QtCore/QStdWString ../../include/QtCore/QString ../../include/QtCore/QLatin1String ../../include/QtCore/QCharRef ../../include/QtCore/QConstString ../../include/QtCore/QStringRef ../../include/QtCore/QLatin1Literal ../../include/QtCore/QAbstractConcatenable ../../include/QtCore/QConcatenable ../../include/QtCore/QStringBuilder ../../include/QtCore/QStringListIterator ../../include/QtCore/QMutableStringListIterator ../../include/QtCore/QStringList ../../include/QtCore/QStringMatcher ../../include/QtCore/QTextBoundaryFinder ../../include/QtCore/QTimeLine ../../include/QtCore/QVarLengthArray ../../include/QtCore/QVectorData ../../include/QtCore/QVectorTypedData ../../include/QtCore/QVector ../../include/QtCore/QVectorIterator ../../include/QtCore/QMutableVectorIterator ../../include/QtCore/QFactoryInterface ../../include/QtCore/QLibrary ../../include/QtCore/QtPlugin ../../include/QtCore/QtPluginInstanceFunction ../../include/QtCore/QPluginLoader ../../include/QtCore/QUuid ../../include/QtCore/QXmlStreamStringRef ../../include/QtCore/QXmlStreamAttribute ../../include/QtCore/QXmlStreamAttributes ../../include/QtCore/QXmlStreamNamespaceDeclaration ../../include/QtCore/QXmlStreamNamespaceDeclarations ../../include/QtCore/QXmlStreamNotationDeclaration ../../include/QtCore/QXmlStreamNotationDeclarations ../../include/QtCore/QXmlStreamEntityDeclaration ../../include/QtCore/QXmlStreamEntityDeclarations ../../include/QtCore/QXmlStreamEntityResolver ../../include/QtCore/QXmlStreamReader ../../include/QtCore/QXmlStreamWriter ../../include/QtCore/QAtomicInt ../../include/QtCore/QAtomicPointer ../../include/QtCore/QBasicAtomicInt ../../include/QtCore/QBasicAtomicPointer ../../include/QtCore/QMutex ../../include/QtCore/QMutexLocker ../../include/QtCore/QMutexData ../../include/QtCore/QReadWriteLock ../../include/QtCore/QReadLocker ../../include/QtCore/QWriteLocker ../../include/QtCore/QSemaphore ../../include/QtCore/QThread ../../include/QtCore/QThreadStorageData ../../include/QtCore/QThreadStorage ../../include/QtCore/QWaitCondition ../../include/QtCore/QAbstractState ../../include/QtCore/QAbstractTransition ../../include/QtCore/QEventTransition ../../include/QtCore/QFinalState ../../include/QtCore/QHistoryState ../../include/QtCore/QSignalTransition ../../include/QtCore/QState ../../include/QtCore/QStateMachine ../../include/QtCore/QFuture ../../include/QtCore/QFutureIterator ../../include/QtCore/QMutableFutureIterator ../../include/QtCore/QFutureInterfaceBase ../../include/QtCore/QFutureInterface ../../include/QtCore/QFutureSynchronizer ../../include/QtCore/QFutureWatcherBase ../../include/QtCore/QFutureWatcher ../../include/QtCore/QRunnable ../../include/QtCore/QtConcurrentFilter ../../include/QtCore/QtConcurrentMap ../../include/QtCore/QtConcurrentRun ../../include/QtCore/QThreadPool ../../include/QtCore/QAbstractFileEngine ../../include/QtCore/QAbstractFileEngineHandler ../../include/QtCore/QAbstractFileEngineIterator ../../include/QtCore/QBuffer ../../include/QtCore/QDataStream ../../include/QtCore/QtDebug ../../include/QtCore/QDebug ../../include/QtCore/QNoDebug ../../include/QtCore/QDir ../../include/QtCore/QDirIterator ../../include/QtCore/QFile ../../include/QtCore/QFileInfo ../../include/QtCore/QFileInfoList ../../include/QtCore/QFileInfoListIterator ../../include/QtCore/QFileSystemWatcher ../../include/QtCore/QFSFileEngine ../../include/QtCore/QIODevice ../../include/QtCore/Q_PID ../../include/QtCore/QProcessEnvironment ../../include/QtCore/QProcess ../../include/QtCore/QResource ../../include/QtCore/QSettings ../../include/QtCore/QTemporaryFile ../../include/QtCore/QTextStream ../../include/QtCore/QTextStreamFunction ../../include/QtCore/QTextStreamManipulator ../../include/QtCore/QTS ../../include/QtCore/QTextIStream ../../include/QtCore/QTextOStream ../../include/QtCore/QUrl ../../include/QtCore/QtEndian ../../include/QtCore/QtGlobal ../../include/QtCore/QIntegerForSize ../../include/QtCore/QNoImplicitBoolCast ../../include/QtCore/Q_INT8 ../../include/QtCore/Q_UINT8 ../../include/QtCore/Q_INT16 ../../include/QtCore/Q_UINT16 ../../include/QtCore/Q_INT32 ../../include/QtCore/Q_UINT32 ../../include/QtCore/Q_INT64 ../../include/QtCore/Q_UINT64 ../../include/QtCore/Q_LLONG ../../include/QtCore/Q_ULLONG ../../include/QtCore/Q_LONG ../../include/QtCore/Q_ULONG ../../include/QtCore/QSysInfo ../../include/QtCore/QtMsgHandler ../../include/QtCore/QGlobalStatic ../../include/QtCore/QGlobalStaticDeleter ../../include/QtCore/QBool ../../include/QtCore/QTypeInfo ../../include/QtCore/QFlag ../../include/QtCore/QIncompatibleFlag ../../include/QtCore/QFlags ../../include/QtCore/QForeachContainer ../../include/QtCore/QForeachContainerBase ../../include/QtCore/QLibraryInfo ../../include/QtCore/Qt ../../include/QtCore/QInternal ../../include/QtCore/QCOORD ../../include/QtCore/QtConfig ../../include/QtCore/QTextCodec ../../include/QtCore/QTextEncoder ../../include/QtCore/QTextDecoder ../../include/QtCore/QTextCodecFactoryInterface ../../include/QtCore/QTextCodecPlugin 
+ SYNCQT.PRIVATE_HEADER_FILES = ../corelib/kernel/qabstracteventdispatcher_p.h ../corelib/kernel/qabstractitemmodel_p.h ../corelib/kernel/qcore_mac_p.h ../corelib/kernel/qcore_symbian_p.h ../corelib/kernel/qcore_unix_p.h ../corelib/kernel/qcoreapplication_p.h ../corelib/kernel/qcorecmdlineargs_p.h ../corelib/kernel/qcoreglobaldata_p.h ../corelib/kernel/qcrashhandler_p.h ../corelib/kernel/qeventdispatcher_blackberry_p.h ../corelib/kernel/qeventdispatcher_glib_p.h ../corelib/kernel/qeventdispatcher_symbian_p.h ../corelib/kernel/qeventdispatcher_unix_p.h ../corelib/kernel/qeventdispatcher_win_p.h ../corelib/kernel/qfunctions_p.h ../corelib/kernel/qmetaobject_p.h ../corelib/kernel/qobject_p.h ../corelib/kernel/qsharedmemory_p.h ../corelib/kernel/qsystemerror_p.h ../corelib/kernel/qsystemsemaphore_p.h ../corelib/kernel/qtranslator_p.h ../corelib/kernel/qvariant_p.h ../corelib/kernel/qwineventnotifier_p.h ../corelib/animation/qabstractanimation_p.h ../corelib/animation/qanimationgroup_p.h ../corelib/animation/qparallelanimationgroup_p.h ../corelib/animation/qpropertyanimation_p.h ../corelib/animation/qsequentialanimationgroup_p.h ../corelib/animation/qvariantanimation_p.h ../corelib/tools/qbytedata_p.h ../corelib/tools/qdatetime_p.h ../corelib/tools/qharfbuzz_p.h ../corelib/tools/qlocale_data_p.h ../corelib/tools/qlocale_p.h ../corelib/tools/qlocale_tools_p.h ../corelib/tools/qpodlist_p.h ../corelib/tools/qringbuffer_p.h ../corelib/tools/qscopedpointer_p.h ../corelib/tools/qsimd_p.h ../corelib/tools/qtools_p.h ../corelib/tools/qunicodetables_p.h ../corelib/plugin/qelfparser_p.h ../corelib/plugin/qfactoryloader_p.h ../corelib/plugin/qlibrary_p.h ../corelib/plugin/qsystemlibrary_p.h ../corelib/xml/qxmlstream_p.h ../corelib/xml/qxmlutils_p.h ../corelib/thread/qmutex_p.h ../corelib/thread/qmutexpool_p.h ../corelib/thread/qorderedmutexlocker_p.h ../corelib/thread/qreadwritelock_p.h ../corelib/thread/qthread_p.h ../corelib/statemachine/qabstractstate_p.h ../corelib/statemachine/qabstracttransition_p.h ../corelib/statemachine/qeventtransition_p.h ../corelib/statemachine/qhistorystate_p.h ../corelib/statemachine/qsignaleventgenerator_p.h ../corelib/statemachine/qsignaltransition_p.h ../corelib/statemachine/qstate_p.h ../corelib/statemachine/qstatemachine_p.h ../corelib/concurrent/qfutureinterface_p.h ../corelib/concurrent/qfuturewatcher_p.h ../corelib/concurrent/qthreadpool_p.h ../corelib/io/qabstractfileengine_p.h ../corelib/io/qdatastream_p.h ../corelib/io/qdataurl_p.h ../corelib/io/qdir_p.h ../corelib/io/qfile_p.h ../corelib/io/qfileinfo_p.h ../corelib/io/qfilesystemengine_p.h ../corelib/io/qfilesystementry_p.h ../corelib/io/qfilesystemiterator_p.h ../corelib/io/qfilesystemmetadata_p.h ../corelib/io/qfilesystemwatcher_dnotify_p.h ../corelib/io/qfilesystemwatcher_fsevents_p.h ../corelib/io/qfilesystemwatcher_inotify_p.h ../corelib/io/qfilesystemwatcher_kqueue_p.h ../corelib/io/qfilesystemwatcher_p.h ../corelib/io/qfilesystemwatcher_symbian_p.h ../corelib/io/qfilesystemwatcher_win_p.h ../corelib/io/qfsfileengine_iterator_p.h ../corelib/io/qfsfileengine_p.h ../corelib/io/qiodevice_p.h ../corelib/io/qnoncontiguousbytedevice_p.h ../corelib/io/qprocess_p.h ../corelib/io/qresource_iterator_p.h ../corelib/io/qresource_p.h ../corelib/io/qsettings_p.h ../corelib/io/qtldurl_p.h ../corelib/io/qurltlds_p.h ../corelib/io/qwindowspipewriter_p.h ../corelib/global/qnumeric_p.h ../corelib/global/qt_pch.h ../corelib/codecs/qfontlaocodec_p.h ../corelib/codecs/qiconvcodec_p.h ../corelib/codecs/qisciicodec_p.h ../corelib/codecs/qlatincodec_p.h ../corelib/codecs/qsimplecodec_p.h ../corelib/codecs/qtextcodec_p.h ../corelib/codecs/qtsciicodec_p.h ../corelib/codecs/qutfcodec_p.h 
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/0033-configure-support-c-0x-standard-for-directfd.patch b/meta/recipes-qt/qt4/qt4-4.8.7/0033-configure-support-c-0x-standard-for-directfd.patch
new file mode 100644
index 0000000..f3face5
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/0033-configure-support-c-0x-standard-for-directfd.patch
@@ -0,0 +1,40 @@
+configure: support c++0x standard for directfd
+
+While directfd upgrade to 1.7.6, it always includes directfb++ utils
+when C++ is used and set c++0x as c++ standard.
+(In git://git.directfb.org/git/directfb/core/DirectFB.git
+commit b444bcae3197be9faf883460dcc239ef757d5922, and commit
+522beeb76f2a8d2dee30d928d2a5955bd06cf25c)
+
+The directfd in qt4 is c++, and there was a build failure:
+...
+| qdirectfbwindowsurface.cpp:336:69: error: in C++98 'rect' must be
+initialized by constructor, not by '{...}'
+|      const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() };
+...
+
+The g++ used c++98 as default c++ standard, we should
+explicitly set c++0x for directfd in qt4.
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ configure | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure b/configure
+index 5724bd6..ecc2f8b 100755
+--- a/configure
++++ b/configure
+@@ -6656,6 +6656,7 @@ if [ "$PLATFORM_QWS" = "yes" ]; then
+        if [ "${screen}" = "directfb" ] && [ "${CFG_CONFIGURE_EXIT_ON_ERROR}" = "yes" ]; then
+            if test -n "$PKG_CONFIG" && "$PKG_CONFIG" --exists directfb 2>/dev/null; then
+                QT_CFLAGS_DIRECTFB=`$PKG_CONFIG --cflags directfb 2>/dev/null`
++               QT_CFLAGS_DIRECTFB="$QT_CFLAGS_DIRECTFB -std=c++0x"
+                QT_LIBS_DIRECTFB=`$PKG_CONFIG --libs directfb 2>/dev/null`
+            elif directfb-config --version >/dev/null 2>&1; then
+                QT_CFLAGS_DIRECTFB=`directfb-config --cflags 2>/dev/null`
+-- 
+1.9.1
+
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/Fix-QWSLock-invalid-argument-logs.patch b/meta/recipes-qt/qt4/qt4-4.8.7/Fix-QWSLock-invalid-argument-logs.patch
new file mode 100644
index 0000000..1f5f00f
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/Fix-QWSLock-invalid-argument-logs.patch
@@ -0,0 +1,98 @@
+From 52c34001bad85c3032618070b1d6b2a3c6880715 Mon Sep 17 00:00:00 2001
+From: Neil Jerram <n...@ossau.homelinux.net>
+Date: Thu, 8 Nov 2012 08:18:32 +0000
+Subject: [PATCH] Fix QWSLock "invalid argument" logs
+
+There was no known actual problem associated with these logs, but they
+were spamming the log, so I thought it worth trying to understand and
+fix them.
+
+The confusion is that there are two different ways of creating QWSLock
+objects.  "QWSLock()" creates an object that creates a new set of
+semaphores, whereas "QWSLock(id)" creates an object that aliases the
+existing set of semaphores with ID id.  What seems to happen is that
+each application creates a semaphore set scoped to that
+application (QWSDisplay::Data::clientLock in qapplication_qws.cpp),
+then this semaphore set is passed by complex means to
+places (QWSClientPrivate and QWSMemorySurface) that use the semaphores
+for a short period and then delete their QWSLock objects.
+
+The problem was that the QWSLock destructor always destroyed the
+semaphore set, even when that QWSLock hadn't create the semaphores
+itself, hence making the semaphores invalid for other QWSLock objects
+still referencing the same set.
+
+Clearly a QWSLock object shouldn't destroy the semaphore set if it
+didn't create it itself, and that is confirmed by the fact that one of
+the implementations inside QWSLock already implements this logic, with
+the 'owned' flag.  The fix is to implement this for the #ifndef
+QT_POSIX_IPC case - which is what is used in QtMoko - just as is
+already implemented for the #ifdef QT_POSIX_IPC case.
+
+Original patch can be found here:
+ http://www.mail-archive.com/community@lists.openmoko.org/msg65512.html
+
+Upstream-Status: Submitted
+
+Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
+ (Removed the commented-out debug statements from the original patch.)
+
+---
+
+diff --git a/src/gui/embedded/qwslock.cpp b/src/gui/embedded/qwslock.cpp
+index 9914a24..1055785 100644
+--- a/src/gui/embedded/qwslock.cpp
++++ b/src/gui/embedded/qwslock.cpp
+@@ -83,9 +83,12 @@ QWSLock::QWSLock(int id) : semId(id)
+     QWSSignalHandler::instance()->addWSLock(this);
+ #endif
+ 
++    owned = false;
++
+ #ifndef QT_POSIX_IPC
+     if (semId == -1) {
+         semId = semget(IPC_PRIVATE, 3, IPC_CREAT | 0666);
++        owned = true;
+         if (semId == -1) {
+             perror("QWSLock::QWSLock");
+             qFatal("Unable to create semaphore");
+@@ -100,7 +104,6 @@ QWSLock::QWSLock(int id) : semId(id)
+     }
+ #else
+     sems[0] = sems[1] = sems[2] = SEM_FAILED;
+-    owned = false;
+ 
+     if (semId == -1) {
+         // ### generate really unique IDs
+@@ -134,9 +137,11 @@ QWSLock::~QWSLock()
+ 
+     if (semId != -1) {
+ #ifndef QT_POSIX_IPC
+-        qt_semun semval;
+-        semval.val = 0;
+-        semctl(semId, 0, IPC_RMID, semval);
++	if (owned) {
++	    qt_semun semval;
++	    semval.val = 0;
++	    semctl(semId, 0, IPC_RMID, semval);
++	}
+         semId = -1;
+ #else
+         // emulate the SEM_UNDO behavior for the BackingStore lock
+diff --git a/src/gui/embedded/qwslock_p.h b/src/gui/embedded/qwslock_p.h
+index d324e4f..d867d20 100644
+--- a/src/gui/embedded/qwslock_p.h
++++ b/src/gui/embedded/qwslock_p.h
+@@ -86,8 +86,8 @@ private:
+     int lockCount[2];
+ #ifdef QT_POSIX_IPC
+     sem_t *sems[3];
+-    bool owned;
+ #endif
++    bool owned;
+ };
+ 
+ QT_END_NAMESPACE
+ 
+-- 
+1.7.10.4
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/add_check_for_aarch64_32.patch b/meta/recipes-qt/qt4/qt4-4.8.7/add_check_for_aarch64_32.patch
new file mode 100644
index 0000000..ad5103d
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/add_check_for_aarch64_32.patch
@@ -0,0 +1,55 @@
+Author: Krishnanjanappa, Jagadeesh <jagadeesh.krishnanjanappa@caviumnetworks.com>
+Date:   Sun Apr 12 19:27:10 2015 +0530
+
+[PATCH] add checking for AArch64 ilp32
+
+Cross-compiling qt4-embedded and qt4-x11-free applications for AArch64 ilp32
+(both big and little endian) fails with below error,
+
+(snip)
+In file included from ../3rdparty/javascriptcore/JavaScriptCore/runtime/Collector.h:31:0,
+                 from ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSGlobalData.h:32,
+                 from ../3rdparty/javascriptcore/JavaScriptCore/interpreter/CallFrame.h:26,
+                 from ../3rdparty/javascriptcore/JavaScriptCore/runtime/ClassInfo.h:26,
+                 from ../3rdparty/javascriptcore/JavaScriptCore/runtime/JSObject.h:27,
+                 from ../3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackConstructor.h:30,
+                 from ../3rdparty/javascriptcore/JavaScriptCore/API/JSCallbackConstructor.cpp:27:
+../3rdparty/javascriptcore/JavaScriptCore/wtf/StdLibExtras.h: In instantiation of 'TO QTWTF::bitwise_cast(FROM) [w
+../3rdparty/javascriptcore/JavaScriptCore/runtime/JSImmediate.h:52:49: required from here
+../3rdparty/javascriptcore/JavaScriptCore/wtf/StdLibExtras.h:63:1: error: size of array is negative
+../3rdparty/javascriptcore/JavaScriptCore/wtf/StdLibExtras.h: In instantiation of 'TO QTWTF::bitwise_cast(FROM) [w
+../3rdparty/javascriptcore/JavaScriptCore/runtime/JSImmediate.h:57:47: required from here
+../3rdparty/javascriptcore/JavaScriptCore/wtf/StdLibExtras.h:63:1: error: size of array is negative
+make[1]: *** [obj/release/JSCallbackConstructor.o] Error 1
+-- CUT --
+
+the error is because of JSVALUE64 is being defined while compiling programs
+for AArch64 ilp32. This makes equal condition checking of intptr_t and double
+datatypes as false, and results in -1 (negative) as array size in bitwise_cast
+function.
+
+Upstream-Status: Pending
+
+Signed-off-by: Krishnanjanappa, Jagadeesh <jagadeesh.krishnanjanappa@caviumnetworks.com>
+
+--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h	2014-04-11 00:07:12.000000000 +0530
++++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h	2015-04-10 22:19:51.066279426 +0530
+@@ -214,6 +214,9 @@
+ #define WTF_CPU_AARCH64 1
+ #if defined(__AARCH64EB__)
+ #define WTF_CPU_BIG_ENDIAN 1
++#if !defined(__LP64__)
++#define WTF_CPU_AARCH64_32 1
++#endif
+ #endif
+ #endif
+ 
+@@ -903,7 +906,7 @@
+ #endif
+ 
+ #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64)
+-#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || OS(HPUX))) || (CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || CPU(SPARC64) || CPU(MIPS64) || CPU(AARCH64)
++#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || OS(HPUX))) || (CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || CPU(SPARC64) || CPU(MIPS64) || (CPU(AARCH64) && !CPU(AARCH64_32))
+ #define WTF_USE_JSVALUE64 1
+ #elif CPU(ARM) || CPU(PPC64)
+ #define WTF_USE_JSVALUE32 1
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/g++.conf b/meta/recipes-qt/qt4/qt4-4.8.7/g++.conf
new file mode 100644
index 0000000..be78c24
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/g++.conf
@@ -0,0 +1,40 @@
+#
+# qmake configuration for common gcc
+#
+
+QMAKE_COMPILER = gcc
+
+QMAKE_CC       = $(OE_QMAKE_CC)
+QMAKE_CFLAGS       += $(OE_QMAKE_CFLAGS)
+QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $(OE_QMAKE_CFLAGS)
+QMAKE_CFLAGS_PRECOMPILE += -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
+QMAKE_CFLAGS_USE_PRECOMPILE += -include ${QMAKE_PCH_OUTPUT_BASE}
+
+QMAKE_CXX      = $(OE_QMAKE_CXX)
+QMAKE_CXXFLAGS     += $(OE_QMAKE_CXXFLAGS)
+QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
+QMAKE_CXXFLAGS_PRECOMPILE += -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
+QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
+
+QMAKE_LINK     = $(OE_QMAKE_LINK)
+QMAKE_LINK_SHLIB   = $(OE_QMAKE_LINK)
+QMAKE_LINK_C		= $(OE_QMAKE_LINK)
+QMAKE_LINK_C_SHLIB	= $(OE_QMAKE_LINK)
+QMAKE_LFLAGS       += $(OE_QMAKE_LDFLAGS)
+QMAKE_LFLAGS_NOUNDEF	+= -Wl,--no-undefined
+QMAKE_LFLAGS_RPATH        = -Wl,-rpath-link,
+
+QMAKE_PCH_OUTPUT_EXT    = .gch
+
+# -Bsymbolic-functions (ld) support
+QMAKE_LFLAGS_BSYMBOLIC_FUNC = -Wl,-Bsymbolic-functions
+QMAKE_LFLAGS_DYNAMIC_LIST = -Wl,--dynamic-list,
+
+# do not depend on gdb
+CONFIG -= gdb_dwarf_index
+
+# some linking helper...
+CONFIG += rpath_libdirs
+
+# for the SDK
+isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $(OE_QMAKE_QT_CONFIG)
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/linux.conf b/meta/recipes-qt/qt4/qt4-4.8.7/linux.conf
new file mode 100644
index 0000000..8670381
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/linux.conf
@@ -0,0 +1,66 @@
+#
+# qmake configuration for common linux
+#
+
+QMAKE_CFLAGS_THREAD	+= -D_REENTRANT
+QMAKE_CXXFLAGS_THREAD	+= $$QMAKE_CFLAGS_THREAD
+
+QMAKE_INCDIR          =
+QMAKE_LIBDIR          =
+QMAKE_INCDIR_X11      =
+QMAKE_LIBDIR_X11      =
+QMAKE_INCDIR_QT       = $(OE_QMAKE_INCDIR_QT)
+QMAKE_LIBDIR_QT       = $(OE_QMAKE_LIBDIR_QT)
+QMAKE_INCDIR_OPENGL   =
+QMAKE_LIBDIR_OPENGL   =
+QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL
+QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL
+QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL
+QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL
+QMAKE_INCDIR_EGL      =
+QMAKE_LIBDIR_EGL      =
+QMAKE_INCDIR_OPENVG   =
+QMAKE_LIBDIR_OPENVG   =
+
+
+QMAKE_LIBS            =
+QMAKE_LIBS_DYNLOAD    = -ldl
+QMAKE_LIBS_X11        = $(OE_QMAKE_LIBS_X11)
+QMAKE_LIBS_X11SM      = $(OE_QMAKE_LIBS_X11SM)
+QMAKE_LIBS_NIS        = -lnsl
+QMAKE_LIBS_EGL        = -lEGL
+QMAKE_LIBS_OPENGL     = -lGL
+QMAKE_LIBS_OPENGL_QT  = -lGL
+QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM
+QMAKE_LIBS_OPENGL_ES2 = -lGLESv2
+QMAKE_LIBS_OPENVG     = -lOpenVG
+QMAKE_LIBS_THREAD     = -lpthread
+
+QMAKE_MOC             = $(OE_QMAKE_MOC)
+QMAKE_UIC             = $(OE_QMAKE_UIC)
+QMAKE_UIC3            = $(OE_QMAKE_UIC3)
+QMAKE_RCC             = $(OE_QMAKE_RCC)
+QMAKE_QDBUSCPP2XML    = $(OE_QMAKE_QDBUSCPP2XML)
+QMAKE_QDBUSXML2CPP    = $(OE_QMAKE_QDBUSXML2CPP)
+
+QMAKE_AR              = $(OE_QMAKE_AR) cqs
+QMAKE_OBJCOPY         = objcopy
+QMAKE_RANLIB          =
+
+QMAKE_TAR             = tar -cf
+QMAKE_GZIP            = gzip -9f
+
+QMAKE_COPY            = cp -f
+QMAKE_COPY_FILE       = $(COPY)
+QMAKE_COPY_DIR        = $(COPY) -r
+QMAKE_MOVE            = mv -f
+QMAKE_DEL_FILE        = rm -f
+QMAKE_DEL_DIR         = rmdir
+QMAKE_STRIP           = $(OE_QMAKE_STRIP)
+QMAKE_STRIPFLAGS_LIB += --strip-unneeded
+QMAKE_CHK_DIR_EXISTS  = test -d
+QMAKE_MKDIR           = mkdir -p
+QMAKE_INSTALL_FILE    = install -m 644 -p
+QMAKE_INSTALL_PROGRAM = install -m 755 -p
+
+include(unix.conf)
diff --git a/meta/recipes-qt/qt4/qt4-4.8.7/qte.sh b/meta/recipes-qt/qt4/qt4-4.8.7/qte.sh
new file mode 100644
index 0000000..21d6ecb
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-4.8.7/qte.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+if [ -e /dev/input/touchscreen0 ]
+then
+    QWS_MOUSE_PROTO=Tslib:/dev/input/touchscreen0
+    export QWS_MOUSE_PROTO
+fi
diff --git a/meta/recipes-qt/qt4/qt4-embedded.inc b/meta/recipes-qt/qt4/qt4-embedded.inc
new file mode 100644
index 0000000..a769065
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-embedded.inc
@@ -0,0 +1,74 @@
+SUMMARY = "Cross-platform UI toolkit and application framework (framebuffer version)"
+DESCRIPTION = "Qt is a versatile cross-platform application framework -- this is the embedded (framebuffer) version."
+SECTION = "libs"
+HOMEPAGE = "http://qt-project.org/"
+DEPENDS += "directfb tslib"
+
+QT4EDEPENDS = ""
+QT_BASE_LIB  ?= "libqt-embedded"
+
+# Set necessary variables in the profile
+SRC_URI += "file://qte.sh \
+            file://0033-configure-support-c-0x-standard-for-directfd.patch \
+"
+
+QT_EMBEDDED_FLAGS ?= " \
+    -embedded $QT_ARCH \
+    -qtlibinfix ${QT_LIBINFIX} \
+"
+QT_EMBEDDED_EXTRA_FLAGS ?= " \
+    -plugin-gfx-transformed -plugin-gfx-qvfb -plugin-gfx-vnc -plugin-gfx-directfb \
+    -plugin-mouse-tslib -qt-mouse-pc -qt-mouse-qvfb -qt-mouse-linuxinput \
+    -qt-kbd-tty -qt-kbd-linuxinput \
+"
+QT_EMBEDDED_KEYPAD_FLAGS ?= " \
+    -DQT_KEYPAD_NAVIGATION \
+"
+
+QT_CONFIG_FLAGS += "${QT_EMBEDDED_FLAGS} ${QT_EMBEDDED_EXTRA_FLAGS} ${QT_EMBEDDED_KEYPAD_FLAGS}"
+
+require qt4.inc
+
+do_install_append() {
+    install -d ${D}/${libdir}/fonts
+    touch ${D}/${libdir}/fonts/fontdir
+
+    install -d ${D}${sysconfdir}/profile.d/
+    install -m 0755 ${WORKDIR}/qte.sh ${D}${sysconfdir}/profile.d/
+}
+
+# We put the qte profile into it's own package as we don't want to install all qt stuff
+# with depending on the global package qt4-embedded
+PACKAGES += " ${PN}-conf"
+FILES_${PN}-conf += " ${sysconfdir}/profile.d/qte.sh"
+RRECOMMENDS_${PN} += " ${PN}-conf"
+
+OTHER_PACKAGES += "\
+             ${QT_BASE_NAME}-fonts \
+             ${QT_BASE_NAME}-fonts-ttf-vera \
+             ${QT_BASE_NAME}-fonts-ttf-dejavu \
+             ${QT_BASE_NAME}-fonts-pfa \
+             ${QT_BASE_NAME}-fonts-pfb \
+             ${QT_BASE_NAME}-fonts-qpf"
+
+RRECOMMENDS_${QT_BASE_NAME}-fonts = " \
+             ${QT_BASE_NAME}-fonts-ttf-vera \
+             ${QT_BASE_NAME}-fonts-ttf-dejavu \
+             ${QT_BASE_NAME}-fonts-pfa \
+             ${QT_BASE_NAME}-fonts-pfb \
+             ${QT_BASE_NAME}-fonts-qpf"
+RRECOMMENDS_${QT_BASE_NAME}-demos += " \
+            ${QT_BASE_NAME}-fonts"
+
+ALLOW_EMPTY_${QT_BASE_NAME}-fonts = "1"
+PACKAGES_DYNAMIC += "^${QT_BASE_NAME}-fonts-.*"
+
+FILES_${QT_BASE_NAME}-fonts-ttf-vera       = "${libdir}/fonts/Vera*.ttf"
+FILES_${QT_BASE_NAME}-fonts-ttf-dejavu     = "${libdir}/fonts/DejaVu*.ttf"
+FILES_${QT_BASE_NAME}-fonts-pfa            = "${libdir}/fonts/*.pfa"
+FILES_${QT_BASE_NAME}-fonts-pfb            = "${libdir}/fonts/*.pfb"
+FILES_${QT_BASE_NAME}-fonts-qpf            = "${libdir}/fonts/*.qpf*"
+FILES_${QT_BASE_NAME}-fonts                = "${libdir}/fonts/README ${libdir}/fonts/fontdir"
+
+inherit qt4e
+
diff --git a/meta/recipes-qt/qt4/qt4-embedded_4.8.7.bb b/meta/recipes-qt/qt4/qt4-embedded_4.8.7.bb
new file mode 100644
index 0000000..1435d85
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-embedded_4.8.7.bb
@@ -0,0 +1,9 @@
+require qt4-${PV}.inc
+require qt4-embedded.inc
+
+QT_CONFIG_FLAGS_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " -no-neon" ,d)}"
+
+QT_CONFIG_FLAGS += " \
+ -exceptions \
+"
+
diff --git a/meta/recipes-qt/qt4/qt4-native.inc b/meta/recipes-qt/qt4/qt4-native.inc
new file mode 100644
index 0000000..2a41f8a
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-native.inc
@@ -0,0 +1,112 @@
+SUMMARY = "Qt version 4 tools and support files for the build host"
+DEPENDS = "zlib-native dbus-native"
+SECTION = "libs"
+HOMEPAGE = "http://qt-project.org/"
+PROVIDES = "qt4-tools-native"
+
+LICENSE = "LGPLv2.1 | GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE.LGPL;md5=fbc093901857fcd118f065f900982c24 \
+                    file://LICENSE.GPL3;md5=6e1694ee338db410417517884918d4d2 \
+                    file://LGPL_EXCEPTION.txt;md5=0145c4d1b6f96a661c2c139dfb268fb6"
+
+inherit native
+
+SRC_URI = "http://download.qt-project.org/official_releases/qt/4.8/${PV}/qt-everywhere-opensource-src-${PV}.tar.gz \
+           file://0001-qlibraryinfo-allow-to-set-qt.conf-from-the-outside-u.patch \
+           file://0002-qkbdtty_qws-fix-build-with-old-kernel-headers.patch \
+           file://0003-webkit2-set-OUTPUT_DIR-value-if-empty.patch \
+           file://0021-configure-make-qt4-native-work-with-long-building-pa.patch \
+           file://g++.conf \
+           file://linux.conf \
+	"
+S = "${WORKDIR}/qt-everywhere-opensource-src-${PV}"
+
+EXTRA_OECONF = "-prefix ${prefix} \
+                -bindir ${bindir} \
+                -libdir ${libdir} \
+                -datadir ${datadir}/qt4 \
+                -sysconfdir ${sysconfdir}/qt4 \
+                -docdir ${docdir}/qt4 \
+                -headerdir ${includedir}/qt4 \
+                -plugindir ${libdir}/qt4/plugins \
+                -importdir ${libdir}/qt4/imports \
+                -translationdir ${datadir}/qt4/translations \
+                -examplesdir ${bindir}/qt4/examples \
+                -demosdir ${bindir}/qt4/demos \
+                -L ${STAGING_LIBDIR_NATIVE} \
+                -I ${STAGING_INCDIR_NATIVE} \
+                -qt-libjpeg -system-zlib \
+                -no-libjpeg -no-libpng -no-libmng -no-libtiff \
+                -no-accessibility \
+                -no-cups \
+                -no-nas-sound \
+                -no-nis -no-openssl \
+                -verbose -release \
+                -embedded -no-freetype -no-glib -no-iconv \
+                -exceptions -xmlpatterns \
+                -qt3support \
+                -no-fast -silent -no-rpath"
+
+# yank default -e, otherwise we get the following error:
+# moc_qbuffer.cpp: No such file or directory
+EXTRA_OEMAKE = " "
+
+do_configure() {
+	# Avoid problems with Qt 4.8.0 configure setting QMAKE_LINK from LD (since we want the linker to be g++)
+	unset LD
+
+	(echo o; echo yes) | ./configure ${EXTRA_OECONF} || die "Configuring qt failed. EXTRA_OECONF was ${EXTRA_OECONF}"
+}
+
+TOBUILD = "\
+  src/tools/moc \
+  src/corelib \
+  src/sql \
+  src/xml \
+  src/network \
+  src/tools/uic \
+  src/tools/rcc \
+  src/xmlpatterns \
+  src/dbus \
+  src/gui \
+  src/testlib \
+  src/qt3support \
+  src/tools/uic3 \
+  tools/linguist/lconvert \
+  tools/linguist/lrelease \
+  tools/linguist/lupdate \
+  tools/qdbus/qdbuscpp2xml \
+  tools/qdbus/qdbusxml2cpp \
+  tools/xmlpatterns \
+"
+
+do_compile() {
+	for i in ${TOBUILD}; do
+		cd ${S}/$i && oe_runmake CC="${CC}" CXX="${CXX}"
+	done
+}
+
+do_install() {
+	install -d ${D}${bindir}/
+	install -m 0755 bin/qmake ${D}${bindir}/qmake2
+	for i in moc uic uic3 rcc lconvert lrelease lupdate qdbuscpp2xml qdbusxml2cpp xmlpatterns; do
+		install -m 0755 bin/${i} ${D}${bindir}/${i}4
+	done
+    
+	install -d ${D}${datadir}/qt4/
+	cp -PfR mkspecs ${D}${datadir}/qt4/
+	ln -sf linux-g++ ${D}${datadir}/qt4/mkspecs/${BUILD_OS}-oe-g++
+	if [ -f ${D}${datadir}/qt4/mkspecs/common/g++-unix.conf ] ; then
+		# mkspecs were refactored for 4.8.0
+		cp -f ${WORKDIR}/g++.conf ${D}${datadir}/qt4/mkspecs/common/g++-unix.conf
+	else
+		cp -f ${WORKDIR}/g++.conf ${D}${datadir}/qt4/mkspecs/common/g++.conf
+	fi
+	cp -f ${WORKDIR}/linux.conf ${D}${datadir}/qt4/mkspecs/common/
+
+	install -m 0644 tools/porting/src/q3porting.xml ${D}${datadir}/qt4/
+
+	for i in ${TOBUILD}; do
+		cd ${S}/$i && oe_runmake install INSTALL_ROOT=${D}
+	done
+}
diff --git a/meta/recipes-qt/qt4/qt4-native_4.8.7.bb b/meta/recipes-qt/qt4/qt4-native_4.8.7.bb
new file mode 100644
index 0000000..494d663
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-native_4.8.7.bb
@@ -0,0 +1,6 @@
+require qt4-native.inc
+
+TOBUILD := "src/tools/bootstrap ${TOBUILD}"
+
+SRC_URI[md5sum] = "d990ee66bf7ab0c785589776f35ba6ad"
+SRC_URI[sha256sum] = "e2882295097e47fe089f8ac741a95fef47e0a73a3f3cdf21b56990638f626ea0"
diff --git a/meta/recipes-qt/qt4/qt4-x11-free.inc b/meta/recipes-qt/qt4/qt4-x11-free.inc
new file mode 100644
index 0000000..f6a1737
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-x11-free.inc
@@ -0,0 +1,38 @@
+require qt4.inc
+
+SUMMARY = "Cross-platform UI toolkit and application framework (X11 version)"
+DESCRIPTION = "Qt is a versatile cross-platform application framework -- this is the X11 version."
+HOMEPAGE = "http://qt-project.org/"
+SECTION = "x11/libs"
+DEPENDS += "virtual/libx11 fontconfig libxft libxext libxrender libxrandr libxcursor"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)}"
+PROVIDES += "qt4-x11"
+QT4DEPENDS = ""
+
+QT_GLFLAGS ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '-opengl', '-no-opengl', d)} "
+QT_GLFLAGS_qemux86 = "-opengl"
+QT_GLFLAGS_qemuppc = "-opengl"
+QT_X11_FLAGS ?= "-no-xinerama -no-xkb -no-gtkstyle"
+QT_CONFIG_FLAGS += "${QT_X11_FLAGS}"
+QT_BASE_LIB  ?= "libqt"
+
+# required by kdelibs4
+QT_KDE_FLAGS ?= "-accessibility -sm"
+QT_DISTRO_FLAGS ?= "${QT_KDE_FLAGS}"
+
+inherit qt4x11
+
+do_install_append() {
+  # fix pkgconfig, libtool and prl files
+  sed -i -e 's#I/usr/include#Iincludedir}#g' \ 
+    -e 's#Iin#I${in#g' \
+    ${D}${libdir}/*.la ${D}${libdir}/*.prl ${D}${libdir}/pkgconfig/*.pc
+
+  # QT abuses $includedir to point to its headers, which breaks pkgconfig sysroot, so
+  # manually fix it up here:
+  for pc in ${D}${libdir}/pkgconfig/*.pc ; do
+    sed -i -e "s:prefix}include/${QT_BASE_NAME}/$(basename $pc .pc):prefix}/include:" \
+      -e "s,Cflags: ,Cflags: -IP{includedir}/${QT_BASE_NAME}/$(basename $pc .pc) ," \
+      -e 's:IP{:I${:g' $pc
+  done
+}
diff --git a/meta/recipes-qt/qt4/qt4-x11-free_4.8.7.bb b/meta/recipes-qt/qt4/qt4-x11-free_4.8.7.bb
new file mode 100644
index 0000000..5cb5e68
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4-x11-free_4.8.7.bb
@@ -0,0 +1,9 @@
+require qt4-x11-free.inc
+require qt4-${PV}.inc
+
+QT_CONFIG_FLAGS_append_arm = "${@bb.utils.contains("TUNE_FEATURES", "neon", "", " -no-neon" ,d)}"
+
+QT_CONFIG_FLAGS += " \
+ -no-embedded \
+ -xrandr \
+ -x11"
diff --git a/meta/recipes-qt/qt4/qt4.inc b/meta/recipes-qt/qt4/qt4.inc
new file mode 100644
index 0000000..2058e54
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4.inc
@@ -0,0 +1,391 @@
+inherit qmake_base
+
+DEPENDS += "qt4-tools-native freetype jpeg libpng zlib dbus openssl glib-2.0 sqlite3 tiff icu"
+DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio', '', d)}"
+
+require qt4_arch.inc
+
+QT_DISTRO_FLAGS ?= "-no-accessibility -no-sm"
+QT_DISTRO_FLAGS_linuxstdbase = "-sm"
+
+QT_SQL_DRIVER_FLAGS ?= "-no-sql-ibase -no-sql-mysql -no-sql-psql -no-sql-odbc -no-sql-sqlite2 -plugin-sql-sqlite -system-sqlite"
+
+QT_GLFLAGS ?= ""
+
+  
+QT_QT3SUPPORT ?= "-qt3support"
+QT_XML ?= "-xmlpatterns"
+QT_WEBKIT ?= "-webkit"
+QT_PHONON ?= "-no-phonon"
+QT_DBUS ?= "-qdbus"
+QT_MULTIMEDIA ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', '-pulseaudio', '-no-pulseaudio', d)}"
+ 
+QT_CONFIG_FLAGS += "-release -no-cups -reduce-relocations \
+                    -shared -no-nas-sound -no-nis \
+                    -system-libjpeg -system-libpng -system-libtiff -system-zlib \
+                    -no-pch -stl -glib -icu \
+                    -no-rpath -silent \
+		    -D USE_QTMULTIMEDIA=1 \
+                    ${QT_DBUS} \
+                    ${QT_QT3SUPPORT} \
+                    ${QT_WEBKIT} \
+                    ${QT_PHONON} \
+                    ${QT_XML} \
+                    ${QT_MULTIMEDIA} \
+                    ${QT_SQL_DRIVER_FLAGS} \
+                    ${QT_DISTRO_FLAGS} \
+                    ${QT_GLFLAGS}"
+
+EXTRA_OEMAKE = "-e"
+
+EXTRA_ENV = 'QMAKE="${STAGING_BINDIR_NATIVE}/qmake2 -after \
+             INCPATH+=${STAGING_INCDIR}/freetype2 LIBS+=-L${STAGING_LIBDIR}" \
+             QMAKESPEC="${QMAKESPEC}" LINK="${CXX} -Wl,-rpath-link,${STAGING_LIBDIR}" \
+             AR="${TARGET_PREFIX}ar cqs" \
+             MOC="${STAGING_BINDIR_NATIVE}/moc4" UIC="${STAGING_BINDIR_NATIVE}/uic4" MAKE="make -e"'
+
+export QT_CONF_PATH="${WORKDIR}/qt.conf"
+
+# Library packages
+QT_LIB_NAMES = "Qt3Support QtAssistantClient QtCLucene QtCore QtDBus QtDesigner QtDesignerComponents QtGui QtHelp QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg QtTest QtUiTools QtWebKit QtXml QtXmlPatterns phonon QtMultimedia QtOpenVG QtMediaServices QtDeclarative"
+
+QT_EXTRA_LIBS = "pvrQWSWSEGL"
+
+python __anonymous () {
+    lib_packages = []
+    dev_packages = []
+    dbg_packages = []
+    staticdev_packages = []
+    for name in d.getVar("QT_LIB_NAMES", True).split():
+        pkg = d.getVar("QT_BASE_LIB", True) + name.lower().replace("qt", "").replace("_", "-") + "4"
+        # NOTE: the headers for QtAssistantClient are different
+        incname = name.replace("QtAssistantClient", "QtAssistant")
+        d.setVar("FILES_%s" % pkg, "${libdir}/lib%(name)s${QT_LIBINFIX}.so.*" % locals())
+        d.setVar("FILES_%s-dev" % pkg, """${libdir}/lib%(name)s${QT_LIBINFIX}.prl
+                  ${libdir}/lib%(name)s${QT_LIBINFIX}.la
+                  ${libdir}/lib%(name)s${QT_LIBINFIX}.so
+                  ${includedir}/${QT_DIR_NAME}/%(incname)s
+                  ${libdir}/pkgconfig/%(name)s${QT_LIBINFIX}.pc""" % locals())
+        d.setVar("FILES_%s-staticdev" % pkg, "${libdir}/lib%(name)s${QT_LIBINFIX}.a" % locals())
+        d.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s${QT_LIBINFIX}.so*" % locals())
+        d.setVar("RRECOMMENDS_%s-dbg" % pkg, "${PN}-dbg")
+        lib_packages.append(pkg)
+        dev_packages.append("%s-dev" % pkg)
+        dbg_packages.append("%s-dbg" % pkg)
+        staticdev_packages.append("%s-staticdev" % pkg)
+    for name in d.getVar("OTHER_PACKAGES", True).split():
+        dbg_packages.append("%s-dbg" % name)
+        staticdev_packages.append("%s-staticdev" % name)
+
+    for name in d.getVar("QT_EXTRA_LIBS", True).split():
+        pkg = d.getVar("QT_BASE_LIB", True) + name.lower().replace("qt", "").replace("_", "-") + "4"
+        d.setVar("FILES_%s" % pkg, "${libdir}/lib%(name)s.so.*" % locals())
+        d.setVar("FILES_%s-staticdev" % pkg, "${libdir}/lib%(name)s.a" % locals())
+        d.setVar("FILES_%s-dev" % pkg, """${libdir}/lib%(name)s.prl
+                  ${libdir}/lib%(name)s.la
+                  ${libdir}/lib%(name)s.so
+                  ${includedir}/${QT_DIR_NAME}/%(incname)s
+                  ${libdir}/pkgconfig/%(name)s.pc""" % locals())
+        d.setVar("FILES_%s-dbg" % pkg, "${libdir}/.debug/lib%(name)s.so*" % locals())
+        d.setVar("RRECOMMENDS_%s-dbg" % pkg, "${PN}-dbg")
+        lib_packages.append(pkg)
+        dev_packages.append("%s-dev" % pkg)
+        dbg_packages.append("%s-dbg" % pkg)
+        staticdev_packages.append("%s-staticdev" % pkg)
+
+    d.setVar("LIB_PACKAGES", " ".join(lib_packages))
+    d.setVar("DEV_PACKAGES", " ".join(dev_packages))
+    d.setVar("DBG_PACKAGES", " ".join(dbg_packages))
+    d.setVar("STATICDEV_PACKAGES", " ".join(staticdev_packages))
+}
+
+OTHER_PACKAGES = "\
+             ${QT_BASE_NAME}-tools \
+             ${QT_BASE_NAME}-assistant \
+             ${QT_BASE_NAME}-common \
+             ${QT_BASE_NAME}-dbus \
+             ${QT_BASE_NAME}-demos \
+             ${QT_BASE_NAME}-designer \
+             ${QT_BASE_NAME}-examples \
+             ${QT_BASE_NAME}-linguist \
+             ${QT_BASE_NAME}-makeqpf \
+             ${QT_BASE_NAME}-mkspecs \
+             ${QT_BASE_NAME}-pixeltool \
+             ${QT_BASE_NAME}-qmlviewer \
+             ${QT_BASE_NAME}-xmlpatterns \
+             ${QT_BASE_NAME}-qt3to4 \
+             ${QT_BASE_NAME}-qml-plugins"
+
+#We prepend so ${QT_BASE_NAME}-demos-doc comes before ${PN}-doc,so the packaging of FILES_ get done before.
+PACKAGES =+ "${QT_BASE_NAME}-demos-doc"
+PACKAGES += " \
+             ${LIB_PACKAGES} \
+             ${DEV_PACKAGES} \
+             ${DBG_PACKAGES} \
+             ${STATICDEV_PACKAGES} \
+             ${OTHER_PACKAGES}"
+
+PACKAGES_DYNAMIC += "^${QT_BASE_NAME}-plugin-.* ^${QT_BASE_NAME}-translation-.* ^${QT_BASE_NAME}-phrasebook-.*"
+
+ALLOW_EMPTY_${PN} = "1"
+FILES_${PN}     = ""
+FILES_${PN}-dev = "${includedir}/${QT_DIR_NAME}/Qt/*"
+FILES_${PN}-dbg = "/usr/src/debug/"
+FILES_${QT_BASE_NAME}-demos-doc = "${docdir}/${QT_DIR_NAME}/qch/qt.qch"
+RRECOMMENDS_${PN} = "${LIB_PACKAGES} ${OTHER_PACKAGES}"
+RRECOMMENDS_${PN}-dev = "${DEV_PACKAGES}"
+RRECOMMENDS_${PN}-dbg = "${DBG_PACKAGES}"
+RRECOMMENDS_${QT_BASE_LIB}core4_append_libc-glibc = " glibc-gconv-utf-16"
+RRECOMMENDS_${QT_BASE_NAME}-demos += " \
+            ${QT_BASE_NAME}-examples \
+            ${QT_BASE_NAME}-plugin-sqldriver-sqlite \
+            ${QT_BASE_NAME}-plugin-imageformat-jpeg \
+            ${QT_BASE_NAME}-qml-plugins \
+            ${QT_BASE_NAME}-assistant \
+            ${QT_BASE_NAME}-demos-doc"
+RRECOMMENDS_${QT_BASE_NAME}-examples += " \
+            ${QT_BASE_NAME}-plugin-sqldriver-sqlite \
+            ${QT_BASE_NAME}-plugin-imageformat-jpeg \
+            ${QT_BASE_NAME}-qml-plugins"
+RRECOMMENDS_${QT_BASE_NAME}-qmlviewer += " \
+            ${QT_BASE_NAME}-qml-plugins"
+RRECOMMENDS_${QT_BASE_NAME}-doc += " \
+            ${QT_BASE_NAME}-demos-doc"
+
+RPROVIDES_${QT_BASE_NAME}-tools += "qmake2"
+RREPLACES_${QT_BASE_NAME}-tools += "qmake2"
+
+FILES_${QT_BASE_NAME}-tools                = "${bindir}/qttracereplay ${bindir}/qdoc* ${bindir}/qmake ${bindir}/moc ${bindir}/uic* ${bindir}/rcc"
+FILES_${QT_BASE_NAME}-tools-dbg            = "${bindir}/.debug/qttracereplay ${bindir}/.debug/qdoc* ${bindir}/.debug/qmake ${bindir}/.debug/uic* ${bindir}/.debug/moc ${bindir}/.debug/rcc"
+FILES_${QT_BASE_NAME}-assistant            = "${bindir}/*assistant* ${bindir}/qcollectiongenerator ${bindir}/qhelpconverter ${bindir}/qhelpgenerator"
+FILES_${QT_BASE_NAME}-assistant-dbg        = "${bindir}/.debug/*assistant* ${bindir}/.debug/qcollectiongenerator ${bindir}/.debug/qhelpconverter ${bindir}/.debug/qhelpgenerator"
+FILES_${QT_BASE_NAME}-common               = "${bindir}/qtconfig"
+FILES_${QT_BASE_NAME}-common-dbg           = "${bindir}/.debug/qtconfig"
+FILES_${QT_BASE_NAME}-dbus                 = "${bindir}/qdbus ${bindir}/qdbusxml2cpp ${bindir}/qdbuscpp2xml ${bindir}/qdbusviewer"
+FILES_${QT_BASE_NAME}-dbus-dbg             = "${bindir}/.debug/qdbus ${bindir}/.debug/qdbusxml2cpp ${bindir}/.debug/qdbuscpp2xml ${bindir}/.debug/qdbusviewer"
+FILES_${QT_BASE_NAME}-demos                = "${bindir}/qtdemo* ${bindir}/${QT_DIR_NAME}/demos/*"
+FILES_${QT_BASE_NAME}-demos-staticdev      = "${bindir}/${QT_DIR_NAME}/demos/shared/libdemo_shared.a"
+FILES_${QT_BASE_NAME}-demos-dbg            = "${bindir}/.debug/qtdemo* ${bindir}/${QT_DIR_NAME}/demos/.debug/*  ${bindir}/${QT_DIR_NAME}/demos/*/.debug  ${bindir}/${QT_DIR_NAME}/demos/*/*/.debug  ${bindir}/${QT_DIR_NAME}/demos/*/*/*/.debug"
+FILES_${QT_BASE_NAME}-designer             = "${bindir}/*designer*"
+FILES_${QT_BASE_NAME}-designer-dbg         = "${bindir}/.debug/*designer*"
+FILES_${QT_BASE_NAME}-examples             = "${bindir}/${QT_DIR_NAME}/examples/*"
+FILES_${QT_BASE_NAME}-examples-staticdev   = "${bindir}/${QT_DIR_NAME}/examples/tools/plugandpaint/plugins/libpnp_basictools.a"
+FILES_${QT_BASE_NAME}-examples-dbg         = "${bindir}/${QT_DIR_NAME}/examples/.debug ${bindir}/${QT_DIR_NAME}/examples/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/*/*/*/*/.debug ${bindir}/${QT_DIR_NAME}/examples/declarative/*/*/*/*/*/.debug/* ${bindir}/${QT_DIR_NAME}/examples/declarative/*/*/*/*/.debug/*"
+FILES_${QT_BASE_NAME}-linguist             = "${bindir}/*linguist* ${bindir}/lrelease ${bindir}/lupdate ${bindir}/lconvert ${bindir}/qm2ts"
+FILES_${QT_BASE_NAME}-linguist-dbg         = "${bindir}/.debug/*linguist* ${bindir}/.debug/lrelease ${bindir}/.debug/lupdate ${bindir}/.debug/lconvert ${bindir}/.debug/qm2ts"
+FILES_${QT_BASE_NAME}-pixeltool            = "${bindir}/pixeltool"
+FILES_${QT_BASE_NAME}-pixeltool-dbg        = "${bindir}/.debug/pixeltool"
+FILES_${QT_BASE_NAME}-qt3to4               = "${bindir}/qt3to4 ${datadir}/${QT_DIR_NAME}/q3porting.xml"
+FILES_${QT_BASE_NAME}-qt3to4-dbg           = "${bindir}/.debug/qt3to4"
+FILES_${QT_BASE_NAME}-qmlviewer            = "${bindir}/qmlviewer"
+FILES_${QT_BASE_NAME}-qmlviewer-dbg        = "${bindir}/.debug/qmlviewer"
+FILES_${QT_BASE_NAME}-makeqpf              = "${bindir}/makeqpf"
+FILES_${QT_BASE_NAME}-makeqpf-dbg          = "${bindir}/.debug/makeqpf"
+FILES_${QT_BASE_NAME}-mkspecs              = "${datadir}/${QT_DIR_NAME}/mkspecs/* ${datadir}/${QT_DIR_NAME}/environment-setup"
+FILES_${QT_BASE_NAME}-xmlpatterns          = "${bindir}/xmlpatterns*"
+FILES_${QT_BASE_NAME}-xmlpatterns-dbg      = "${bindir}/.debug/xmlpatterns*"
+FILES_${QT_BASE_NAME}-qml-plugins          = "${libdir}/${QT_DIR_NAME}/imports/* ${libdir}/${QT_DIR_NAME}/plugins/qmltooling/*"
+FILES_${QT_BASE_NAME}-qml-plugins-dbg      = "${libdir}/${QT_DIR_NAME}/imports/*/*/*/.debug/* ${libdir}/${QT_DIR_NAME}/imports/*/.debug ${libdir}/${QT_DIR_NAME}/plugins/qmltooling/.debug"
+INSANE_SKIP_${MLPREFIX}${QT_BASE_NAME}-examples      += "libdir"
+INSANE_SKIP_${MLPREFIX}${QT_BASE_NAME}-examples-dbg  += "libdir"
+
+# License options, to be set by the recipe if different values are needed
+QT_LICENSE_FILE ?= ""
+QT_LICENSE_FLAGS ?= "-opensource"
+
+do_configure() {
+	unset QMAKESPEC
+	unset QTDIR
+
+	set_arch
+	set_endian
+
+	if [ ! -e bin/qmake ]; then
+		ln -sf ${STAGING_BINDIR_NATIVE}/qmake2 bin/qmake
+	fi
+
+	if [ ! -e mkspecs/${TARGET_OS}-oe-g++ ]; then
+		ln -sf linux-g++ mkspecs/${TARGET_OS}-oe-g++
+	fi
+
+	if [ -f mkspecs/common/g++-unix.conf ] ; then
+		# mkspecs were refactored for 4.8.0
+		cp -f ${WORKDIR}/g++.conf mkspecs/common/g++-unix.conf
+	else
+		cp -f ${WORKDIR}/g++.conf mkspecs/common/g++.conf
+	fi
+	cp -f ${WORKDIR}/linux.conf mkspecs/common/
+
+	echo "[Paths]"                                 > $QT_CONF_PATH
+	echo "Prefix=${prefix}"                       >> $QT_CONF_PATH
+	echo "Documentation=${docdir}/${QT_DIR_NAME}" >> $QT_CONF_PATH
+	echo "Headers=${includedir}/${QT_DIR_NAME}"   >> $QT_CONF_PATH
+	echo "Libraries=${libdir}"                    >> $QT_CONF_PATH
+	echo "Binaries=${bindir}"                     >> $QT_CONF_PATH
+	echo "Plugins=${libdir}/${QT_DIR_NAME}/plugins" >> $QT_CONF_PATH
+	echo "Imports=${libdir}/${QT_DIR_NAME}/imports" >> $QT_CONF_PATH
+	echo "Data=${datadir}/${QT_DIR_NAME}"         >> $QT_CONF_PATH
+	echo "Translations=${datadir}/${QT_DIR_NAME}/translations" >> $QT_CONF_PATH
+	echo "Settings=${sysconfdir}/${QT_DIR_NAME}"  >> $QT_CONF_PATH
+	echo "Examples=${bindir}/${QT_DIR_NAME}/examples" >> $QT_CONF_PATH
+	echo "Demos=${bindir}/${QT_DIR_NAME}/demos"   >> $QT_CONF_PATH
+
+	${EXTRA_QMAKE_MUNGE}|| true
+
+	echo yes | QT_LICENSE_FILE="${QT_LICENSE_FILE}" ./configure -v \
+			-prefix ${prefix} \
+			-bindir ${bindir} \
+			-libdir ${libdir} \
+			-datadir ${datadir}/${QT_DIR_NAME} \
+			-sysconfdir ${sysconfdir}/${QT_DIR_NAME} \
+			-docdir ${docdir}/${QT_DIR_NAME} \
+			-headerdir ${includedir}/${QT_DIR_NAME} \
+			-plugindir ${libdir}/${QT_DIR_NAME}/plugins \
+			-importdir ${libdir}/${QT_DIR_NAME}/imports \
+			-translationdir ${datadir}/${QT_DIR_NAME}/translations \
+			-examplesdir ${bindir}/${QT_DIR_NAME}/examples \
+			-demosdir ${bindir}/${QT_DIR_NAME}/demos \
+			-platform ${TARGET_OS}-oe-g++ \
+			-xplatform ${TARGET_OS}-oe-g++ \
+			${QT_ENDIAN} \
+			-crossarch ${QT_ARCH} \
+			${QT_LICENSE_FLAGS} \
+			${QT_CONFIG_FLAGS} -no-fast \
+			-L${STAGING_LIBDIR} -I${STAGING_INCDIR} \
+			-I${STAGING_INCDIR}/freetype2
+}
+
+do_compile() {
+    # Fixup missing wsegl header in some SGX SDKs
+    if ! [ -e ${STAGING_INCDIR}/wsegl.h ] ; then
+        cp src/3rdparty/powervr/wsegl.h src/plugins/gfxdrivers/powervr/QWSWSEGL/
+    fi
+
+    unset CFLAGS CXXFLAGS
+
+    oe_runmake ${EXTRA_ENV}
+
+    # Build target qmake
+    export QMAKESPEC="${S}/mkspecs/${TARGET_OS}-oe-g++"
+    cd ${S}/qmake
+    ${OE_QMAKE_QMAKE}
+    oe_runmake CC="${CC}" CXX="${CXX}"
+    cd ${S}
+}
+
+python populate_packages_prepend() {
+    translation_dir = d.expand('${datadir}/${QT_DIR_NAME}/translations/')
+    translation_name = d.expand('${QT_BASE_NAME}-translation-%s')
+    do_split_packages(d, translation_dir, '^(assistant|designer|linguist|qt|qtconfig|qvfb|qtscript)_(.*)\.qm$', translation_name, '${PN} translation for %s', extra_depends='' )
+ 
+    phrasebook_dir = d.expand('${datadir}/${QT_DIR_NAME}/phrasebooks/')
+    phrasebook_name = d.expand('${QT_BASE_NAME}-phrasebook-%s')
+
+    if os.path.exists("%s%s" % (d.expand('${D}'), phrasebook_dir)):
+        do_split_packages(d, phrasebook_dir, '^(.*)\.qph$', phrasebook_name, '${PN} phrasebook for %s', extra_depends='' )
+    else:
+        bb.note("The path does not exist:", d.expand('${D}'), phrasebook_dir)
+ 
+    # Package all the plugins and their -dbg version and create a meta package
+    def qtopia_split(path, name, glob):
+        """
+        Split the package into a normal and -dbg package and then add the
+        new packages to the meta package.
+        """
+        plugin_dir = d.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/' % path)
+        if not os.path.exists("%s%s" % (d.expand('${D}'), plugin_dir)):
+            bb.note("The path does not exist:", d.expand('${D}'), plugin_dir)
+            return
+ 
+        plugin_name = d.expand('${QT_BASE_NAME}-plugin-%s-%%s' % name)
+        dev_packages = []
+        dev_hook = lambda file,pkg,b,c,d:dev_packages.append((file,pkg))
+        do_split_packages(d, plugin_dir, glob, plugin_name, '${PN} %s for %%s' % name, extra_depends='', hook=dev_hook)
+        # Create a -dbg package as well
+        plugin_dir_dbg = d.expand('${libdir}/${QT_DIR_NAME}/plugins/%s/.debug' % path)
+        packages = d.getVar('PACKAGES', False)
+        for (file,package) in dev_packages:
+            packages = "%s %s-dbg" % (packages, package)
+            file_name = os.path.join(plugin_dir_dbg, os.path.basename(file))
+            d.setVar("FILES_%s-dbg" % package, file_name)
+            d.setVar("DESCRIPTION_%s-dbg" % package, "${PN} %s for %s" % (name, package))
+
+        d.setVar('PACKAGES', packages)
+
+    qtopia_split('accessible',    'accessible',    '^libq(.*)\.so$')
+    qtopia_split('codecs',        'codec',         '^libq(.*)\.so$')
+    qtopia_split('decorations',   'decoration',    '^libqdecoration(.*)\.so$')
+    qtopia_split('designer',      'designer',      '^lib(.*)\.so$')
+    qtopia_split('gfxdrivers',    'gfxdriver',     '^libq(.*)\.so$')
+    qtopia_split('graphicssystems','graphicssystems', '^libq(.*)\.so$')
+    qtopia_split('kbddrivers',    'kbddriver',     '^libq(.*)kbddriver\.so$')
+    qtopia_split('mousedrivers',  'mousedriver',   '^libq(.*)mousedriver\.so$')
+    qtopia_split('iconengines',   'iconengine',    '^libq(.*)\.so$')
+    qtopia_split('imageformats',  'imageformat',   '^libq(.*)\.so$')
+    qtopia_split('inputmethods',  'inputmethod',   '^libq(.*)\.so$')
+    qtopia_split('sqldrivers',    'sqldriver',     '^libq(.*)\.so$')
+    qtopia_split('script',        'script',        '^libqtscript(.*)\.so$')
+    qtopia_split('styles',        'style',         '^libq(.*)\.so$')
+    qtopia_split('phonon_backend','phonon-backend','^libphonon_(.*)\.so$')
+    qtopia_split('bearer',        'bearer',        '^libq(.*)bearer\.so$')
+}
+
+do_install() {
+	oe_runmake install INSTALL_ROOT=${D}
+
+	# Install a proper target version of qmake
+	rm ${D}/${bindir}/qmake
+	install -m 0755 bin/qmake2 ${D}${bindir}/qmake
+
+	# fix pkgconfig, libtool and prl files
+	sed -i -e 's#-L${S}/lib/\?##g' \
+			-e 's#-L${STAGING_LIBDIR}/\?##g' \
+			-e 's#STAGING_LIBDIR}#libdir}'#g \
+			-e 's#-L${libdir}/\?##g' \
+			-e s#'$(OE_QMAKE_LIBS_X11)'#"${OE_QMAKE_LIBS_X11}"#g \
+			-e 's#" -Wl,-rpath-link,${S}/lib/\?"##g' \
+			-e 's#" -Wl,-rpath-link,${libdir}/\?"##g' \
+			-e 's#Iin#I${in#g' \
+			-e 's#-L\.\./\.\./WebCore/release\s\+-L\.\./\.\./JavaScriptCore/release\s\+-lwebcore##g' \
+			-e 's#-ljscore##g' \
+			${D}${libdir}/*.la ${D}${libdir}/*.prl ${D}${libdir}/pkgconfig/*.pc
+
+	# fix pkgconfig files
+	sed -i -e s#"moc_location=.*$"#"moc_location=${bindir}/moc4"# \
+			-e s#"uic_location=.*$"#"uic_location=${bindir}/uic4"# \
+			${D}${libdir}/pkgconfig/*.pc
+	for name in ${QT_LIB_NAMES}; do
+		sed -i -e /Requires/s#"${name}"#"${name}${QT_LIBINFIX}"#g ${D}${libdir}/pkgconfig/*.pc
+	done
+
+	# QT abuses $includedir to point to its headers, which breaks pkgconfig sysroot, so manually fix it up here:
+	for pc in ${D}${libdir}/pkgconfig/*.pc ; do
+		sed -i -e "s:prefix}/include/${QT_DIR_NAME}/$(basename $pc .pc):prefix}/include:" \
+				-e 's:IP{:I${:g' $pc
+	done
+
+	#Append an E to the qtdemo file
+	if [ -n "${QT_LIBINFIX}" ] ; then
+		[ -f ${D}${bindir}/qtdemo ] && mv ${D}${bindir}/qtdemo ${D}${bindir}/qtdemo${QT_LIBINFIX}
+	fi
+
+	script="${D}/${datadir}/${QT_DIR_NAME}/environment-setup"
+	touch $script
+	echo 'export QT_DIR_NAME=${QT_DIR_NAME}' >> $script
+	echo 'export QT_LIBINFIX=${QT_LIBINFIX}' >> $script
+	echo 'export OE_QMAKE_AR=ar' >> $script
+	echo 'export OE_QMAKE_CC=gcc' >> $script
+	echo 'export OE_QMAKE_CXX=g++' >> $script
+	echo 'export OE_QMAKE_LINK=g++' >> $script
+	echo 'export OE_QMAKE_LIBDIR_QT=${libdir}' >> $script
+	echo 'export OE_QMAKE_INCDIR_QT=${includedir}/${QT_DIR_NAME}' >> $script
+	echo 'export OE_QMAKE_MOC=${bindir}/moc' >> $script
+	echo 'export OE_QMAKE_UIC=${bindir}/uic' >> $script
+	echo 'export OE_QMAKE_UIC3=${bindir}/uic3' >> $script
+	echo 'export OE_QMAKE_RCC=${bindir}/rcc' >> $script
+	echo 'export OE_QMAKE_QDBUSCPP2XML=${bindir}/qdbuscpp2xml' >> $script
+	echo 'export OE_QMAKE_QDBUSXML2CPP=${bindir}/qdbusxml2cpp' >> $script
+	echo 'export OE_QMAKE_QT_CONFIG=${datadir}/${QT_DIR_NAME}/mkspecs/qconfig.pri' >> $script
+	echo 'export QMAKESPEC=${datadir}/${QT_DIR_NAME}/mkspecs/linux-g++' >> $script
+	chmod 0755 $script
+}
diff --git a/meta/recipes-qt/qt4/qt4_arch.inc b/meta/recipes-qt/qt4/qt4_arch.inc
new file mode 100644
index 0000000..e94c284
--- /dev/null
+++ b/meta/recipes-qt/qt4/qt4_arch.inc
@@ -0,0 +1,22 @@
+inherit siteinfo
+
+ARM_INSTRUCTION_SET = "arm"
+
+set_arch() {
+   case ${TARGET_ARCH} in
+       aarch64*) QT_ARCH=aarch64 ;;
+       arm*)     QT_ARCH=arm ;;
+       i*86*)    QT_ARCH=i386 ;;
+       mips*)    QT_ARCH=mips ;;
+       powerpc*) QT_ARCH=powerpc ;;
+       x86_64*)  QT_ARCH=x86_64 ;;
+   esac
+}
+
+set_endian() {
+    if [ ${SITEINFO_ENDIANNESS} = "le" ] ; then
+        QT_ENDIAN="-little-endian"
+    elif [ ${SITEINFO_ENDIANNESS} = "be" ] ; then
+        QT_ENDIAN="-big-endian"
+    fi
+}
diff --git a/meta/recipes-rt/README b/meta/recipes-rt/README
new file mode 100644
index 0000000..7d7558d
--- /dev/null
+++ b/meta/recipes-rt/README
@@ -0,0 +1,13 @@
+The recipes-rt recipes provide package and image recipes for using and testing
+the PREEMPT_RT kernel. The core-image-rt*.bb images are minimal images with
+a couple extra packages, including rt-tests. In order to build the image with
+the linux-yocto-rt kernel, be sure to include the following line in your
+local.conf, bblayers.conf, or your $MACHINE.conf.
+
+PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"
+
+If you are creating a new BSP which should use linux-yocto-rt by default,
+use the line above in the $MACHINE.conf in your BSP layer, and specify the
+following in a linux-yocto-rt bbappend recipe:
+
+COMPATIBLE_MACHINE_$MACHINE = $MACHINE
diff --git a/meta/recipes-rt/images/core-image-rt-sdk.bb b/meta/recipes-rt/images/core-image-rt-sdk.bb
new file mode 100644
index 0000000..db7d581
--- /dev/null
+++ b/meta/recipes-rt/images/core-image-rt-sdk.bb
@@ -0,0 +1,12 @@
+require recipes-core/images/core-image-minimal.bb
+
+DESCRIPTION = "Small image capable of booting a device with a test suite and \
+tools for real-time use. It includes the full meta-toolchain, development \
+headers and libraries to form a standalone SDK."
+DEPENDS = "linux-yocto-rt"
+
+IMAGE_FEATURES += "dev-pkgs tools-sdk tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks"
+
+IMAGE_INSTALL += "rt-tests hwlatdetect kernel-dev"
+
+LICENSE = "MIT"
diff --git a/meta/recipes-rt/images/core-image-rt.bb b/meta/recipes-rt/images/core-image-rt.bb
new file mode 100644
index 0000000..cab6f8b
--- /dev/null
+++ b/meta/recipes-rt/images/core-image-rt.bb
@@ -0,0 +1,9 @@
+require recipes-core/images/core-image-minimal.bb
+
+DESCRIPTION = "A small image just capable of allowing a device to boot plus a \
+real-time test suite and tools appropriate for real-time use."
+DEPENDS = "linux-yocto-rt"
+
+IMAGE_INSTALL += "rt-tests hwlatdetect"
+
+LICENSE = "MIT"
diff --git a/meta/recipes-rt/rt-tests/files/0001-rt-tests-Allow-for-user-specified-PYLIB.patch b/meta/recipes-rt/rt-tests/files/0001-rt-tests-Allow-for-user-specified-PYLIB.patch
new file mode 100644
index 0000000..8b493eb
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/files/0001-rt-tests-Allow-for-user-specified-PYLIB.patch
@@ -0,0 +1,35 @@
+From 66765522b634952346f1a3ab7d00c7222a1f9361 Mon Sep 17 00:00:00 2001
+Message-Id: <66765522b634952346f1a3ab7d00c7222a1f9361.1347419597.git.dvhart@linux.intel.com>
+From: Darren Hart <dvhart@linux.intel.com>
+Date: Tue, 11 Sep 2012 15:19:30 -0700
+Subject: [PATCH 1/2] rt-tests: Allow for user-specified PYLIB
+
+Upstream-Status: Submitted
+
+Allow users (build systems) to specify PYLIB. This allows for a
+cross-build-system to specify the target PYLIB rather than the host
+PYLIB.
+
+Signed-off-by: Darren Hart <dvhart@linux.intel.com>
+CC: Clark Williams <williams@redhat.com>
+CC: John Kacur <jkacur@redhat.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 3a82407..61e2f9f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,7 +23,7 @@ endif
+ CFLAGS ?= -D_GNU_SOURCE -Wall -Wno-nonnull -Isrc/include
+ LDFLAGS ?=
+ 
+-PYLIB  := $(shell python -c 'import distutils.sysconfig;  print distutils.sysconfig.get_python_lib()')
++PYLIB  ?= $(shell python -c 'import distutils.sysconfig;  print distutils.sysconfig.get_python_lib()')
+ 
+ ifndef DEBUG
+ 	CFLAGS	+= -O2
+-- 
+1.7.11.4
+
diff --git a/meta/recipes-rt/rt-tests/files/0002-rt-tests-Break-out-install_hwlatdetect.patch b/meta/recipes-rt/rt-tests/files/0002-rt-tests-Break-out-install_hwlatdetect.patch
new file mode 100644
index 0000000..bc6136f
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/files/0002-rt-tests-Break-out-install_hwlatdetect.patch
@@ -0,0 +1,68 @@
+From af93e580d005a2bba6ed36528003af4cf631adb8 Mon Sep 17 00:00:00 2001
+Message-Id: <af93e580d005a2bba6ed36528003af4cf631adb8.1347419597.git.dvhart@linux.intel.com>
+In-Reply-To: <66765522b634952346f1a3ab7d00c7222a1f9361.1347419597.git.dvhart@linux.intel.com>
+References: <66765522b634952346f1a3ab7d00c7222a1f9361.1347419597.git.dvhart@linux.intel.com>
+From: Darren Hart <dvhart@linux.intel.com>
+Date: Tue, 11 Sep 2012 14:51:10 -0700
+Subject: [PATCH 2/2] rt-tests: Break out install_hwlatdetect
+
+Upstream-Status: Submitted
+
+Allow hwlatdetect to be installed independently of the rest of the
+tests. This is convenient for build systems that package it separately
+due to the python dependency.
+
+Signed-off-by: Darren Hart <dvhart@linux.intel.com>
+CC: Clark Williams <williams@redhat.com>
+CC: John Kacur <jkacur@redhat.com>
+---
+ Makefile | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 61e2f9f..636e63b 100644
+--- a/Makefile
++++ b/Makefile
+@@ -119,21 +119,15 @@ changelog:
+ 	git log >ChangeLog
+ 
+ .PHONY: install
+-install: all
++install: all install_hwlatdetect
+ 	mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man4"
+ 	mkdir -p "$(DESTDIR)$(srcdir)" "$(DESTDIR)$(mandir)/man8"
+ 	cp $(TARGETS) "$(DESTDIR)$(bindir)"
+-	if test -n "$(PYLIB)" ; then \
+-		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
+-		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
+-		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
+-	fi
+ 	install -D -m 644 src/backfire/backfire.c "$(DESTDIR)$(srcdir)/backfire/backfire.c"
+ 	install -m 644 src/backfire/Makefile "$(DESTDIR)$(srcdir)/backfire/Makefile"
+ 	gzip src/backfire/backfire.4 -c >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
+ 	gzip src/cyclictest/cyclictest.8 -c >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
+ 	gzip src/pi_tests/pi_stress.8 -c >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
+-	gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz"
+ 	gzip src/ptsematest/ptsematest.8 -c >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
+ 	gzip src/sigwaittest/sigwaittest.8 -c >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
+ 	gzip src/svsematest/svsematest.8 -c >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
+@@ -141,6 +135,16 @@ install: all
+ 	gzip src/backfire/sendme.8 -c >"$(DESTDIR)$(mandir)/man8/sendme.8.gz"
+ 	gzip src/hackbench/hackbench.8 -c >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
+ 
++.PHONY: install_hwlatdetect
++install_hwlatdetect: hwlatdetect
++	if test -n "$(PYLIB)" ; then \
++		mkdir -p "$(DESTDIR)$(bindir)" "$(DESTDIR)$(mandir)/man8" ; \
++		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
++		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
++		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
++		gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
++	fi
++
+ .PHONY: release
+ release: clean changelog
+ 	mkdir -p releases
+-- 
+1.7.11.4
+
diff --git a/meta/recipes-rt/rt-tests/files/Makefile-fix-gzip-command.patch b/meta/recipes-rt/rt-tests/files/Makefile-fix-gzip-command.patch
new file mode 100644
index 0000000..0a35ddc
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/files/Makefile-fix-gzip-command.patch
@@ -0,0 +1,30 @@
+From 07b5ed42d7041ccc084889eaa96817aa097bf461 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 3 Feb 2015 03:10:25 +0000
+Subject: [PATCH] Makefile: fix gzip command
+
+The "-c" doesn't work in command "gzip file -c", need use "gzip -c file"
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 219a591..c7d147a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -144,7 +144,7 @@ install_hwlatdetect: hwlatdetect
+ 		install -D -m 755 src/hwlatdetect/hwlatdetect.py $(DESTDIR)$(PYLIB)/hwlatdetect.py ; \
+ 		rm -f "$(DESTDIR)$(bindir)/hwlatdetect" ; \
+ 		ln -s $(PYLIB)/hwlatdetect.py "$(DESTDIR)$(bindir)/hwlatdetect" ; \
+-		gzip src/hwlatdetect/hwlatdetect.8 -c >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
++		gzip -c src/hwlatdetect/hwlatdetect.8 >"$(DESTDIR)$(mandir)/man8/hwlatdetect.8.gz" ; \
+ 	fi
+ 
+ .PHONY: release
+-- 
+2.0.1
+
diff --git a/meta/recipes-rt/rt-tests/files/fix-re-install-failure.patch b/meta/recipes-rt/rt-tests/files/fix-re-install-failure.patch
new file mode 100644
index 0000000..e38ec92
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/files/fix-re-install-failure.patch
@@ -0,0 +1,48 @@
+Currently gzip on host is used. If host gzip is provided by pigz, it fails to
+redo install that pigz can't handle the option after file name. When run:
+
+gzip src/backfire/backfire.4 -c > OUTPUT_FILE
+
+File src/backfire/backfire.4 is zipped into backfire.4.gz but the OUTPUT_FILE
+is empty. When rerun do_install, it shows warning:
+
+| gzip: src/backfire/backfire.4 does not exist -- skipping
+
+and empty manual gzip files are created:
+
+$ file image/usr/share/man/man4/backfire.4.gz
+image/usr/share/man/man4/backfire.4.gz: empty
+
+Fix it by putting option '-c' before the file name.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+---
+--- git/Makefile.orig	2014-11-14 15:47:26.406638419 +0800
++++ git/Makefile	2014-11-14 15:46:53.890637533 +0800
+@@ -127,15 +127,15 @@
+ 	cp $(TARGETS) "$(DESTDIR)$(bindir)"
+ 	install -D -m 644 src/backfire/backfire.c "$(DESTDIR)$(srcdir)/backfire/backfire.c"
+ 	install -m 644 src/backfire/Makefile "$(DESTDIR)$(srcdir)/backfire/Makefile"
+-	gzip src/backfire/backfire.4 -c >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
+-	gzip src/cyclictest/cyclictest.8 -c >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
+-	gzip src/pi_tests/pi_stress.8 -c >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
+-	gzip src/ptsematest/ptsematest.8 -c >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
+-	gzip src/sigwaittest/sigwaittest.8 -c >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
+-	gzip src/svsematest/svsematest.8 -c >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
+-	gzip src/pmqtest/pmqtest.8 -c >"$(DESTDIR)$(mandir)/man8/pmqtest.8.gz"
+-	gzip src/backfire/sendme.8 -c >"$(DESTDIR)$(mandir)/man8/sendme.8.gz"
+-	gzip src/hackbench/hackbench.8 -c >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
++	gzip -c src/backfire/backfire.4 >"$(DESTDIR)$(mandir)/man4/backfire.4.gz"
++	gzip -c src/cyclictest/cyclictest.8 >"$(DESTDIR)$(mandir)/man8/cyclictest.8.gz"
++	gzip -c src/pi_tests/pi_stress.8 >"$(DESTDIR)$(mandir)/man8/pi_stress.8.gz"
++	gzip -c src/ptsematest/ptsematest.8 >"$(DESTDIR)$(mandir)/man8/ptsematest.8.gz"
++	gzip -c src/sigwaittest/sigwaittest.8 >"$(DESTDIR)$(mandir)/man8/sigwaittest.8.gz"
++	gzip -c src/svsematest/svsematest.8 >"$(DESTDIR)$(mandir)/man8/svsematest.8.gz"
++	gzip -c src/pmqtest/pmqtest.8 >"$(DESTDIR)$(mandir)/man8/pmqtest.8.gz"
++	gzip -c src/backfire/sendme.8 >"$(DESTDIR)$(mandir)/man8/sendme.8.gz"
++	gzip -c src/hackbench/hackbench.8 >"$(DESTDIR)$(mandir)/man8/hackbench.8.gz"
+ 
+ .PHONY: install_hwlatdetect
+ install_hwlatdetect: hwlatdetect
diff --git a/meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch b/meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch
new file mode 100644
index 0000000..d17fdff
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/files/hackbench-fix-error-check.patch
@@ -0,0 +1,41 @@
+childinfo_t is a union that contains both signed (error) and unsigned
+(threadid) members. Thus a large threadid could appear as a negative error
+value, which will cause unexpected failures.
+
+childinfo_t should be changed to a struct, but it could potentially affect the
+performance. So we keep it as a union but only check error against -1. There is
+still a chance of false alarm but it's small.
+
+Upstream-Status: Pending
+
+Signed-off-by: Song.Li <Song.Li@windriver.com>
+Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
+---
+ src/hackbench/hackbench.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c
+index 8baeb23..dc0de8f 100644
+--- a/src/hackbench/hackbench.c
++++ b/src/hackbench/hackbench.c
+@@ -317,7 +317,7 @@ static unsigned int group(childinfo_t *child,
+ 		ctx->wakefd = wakefd;
+ 
+ 		child[tab_offset+i] = create_worker(ctx, (void *)(void *)receiver);
+-		if( child[tab_offset+i].error < 0 ) {
++		if( child[tab_offset+i].error == -1 ) {
+ 			return (i > 0 ? i-1 : 0);
+ 		}
+ 		snd_ctx->out_fds[i] = fds[1];
+@@ -332,7 +332,7 @@ static unsigned int group(childinfo_t *child,
+ 		snd_ctx->num_fds = num_fds;
+ 
+ 		child[tab_offset+num_fds+i] = create_worker(snd_ctx, (void *)(void *)sender);
+-		if( child[tab_offset+num_fds+i].error < 0 ) {
++		if( child[tab_offset+num_fds+i].error == -1 ) {
+ 			return (num_fds+i)-1;
+ 		}
+ 	}
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-rt/rt-tests/files/rt_bmark.py b/meta/recipes-rt/rt-tests/files/rt_bmark.py
new file mode 100755
index 0000000..e2280e4
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/files/rt_bmark.py
@@ -0,0 +1,412 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+
+# SPDX-License-Identifier:     BSD-3-Clause
+# Copyright (C) 2015 Enea Software AB
+# Author: Thomas Lundström <thomas.lundstrom@enea.com>
+
+# The script measures interrupt latency together with different types of
+# system load. This is done using the programs cyclictest and stress.
+#
+# The main output is:
+#
+#   Best case (min) latency
+#     This has very limited value, but is presented since it can be done
+#     easily
+#
+#   Average latency
+#     This value is of interrest for throughput oriented systems. Limited
+#     value for a real-time system. Also presented because it is easy to do.
+#
+#   Worst case (max) latency
+#     This is the interesting number for a real-time system. The number
+#     presented is (of cource) the largest number observed. The challenge
+#     is to know how the observed worst case relates to the actual worst case.
+#
+#     To get an indication of the confidence, the following method is used:
+#     1) Instead of one long run, the measurement is made as a set of shorter
+#        runs. The number of runs must be a power of 2 for reasons that will
+#        shorlty be obvious
+#
+#     2) First, a list of the max values are created.
+#
+#     3) The smallest value in that list is recorded.
+#
+#     4) Then a new list is create by taking the max value of each pair of
+#        values in the original list. In this list the smallest value is
+#        recorded.
+#
+#     5) Step 3 is repeated until there is only one value in the list. See
+#        example below:
+#
+#        Samples:
+#          |  44 |     |     |     |     |
+#          |  77 |  77 |     |     |     |
+#          | 118 |     |     |     |     |
+#          | 119 | 119 | 119 |     |     |
+#          | 138 |     |     |     |     |
+#          |  57 | 138 |     |     |     |
+#          | 175 |     |     |     |     |
+#          | 130 | 175 | 175 | 175 |     |
+#          |  54 |     |     |     |     |
+#          | 150 | 150 |     |     |     |
+#          |  47 |     |     |     |     |
+#          |  59 |  59 | 150 |     |     |
+#          | 199 |     |     |     |     |
+#          | 115 | 199 |     |     |     |
+#          | 177 |     |     |     |     |
+#          | 129 | 177 | 199 | 199 | 199 |
+#
+#        Smallest value:
+#          |  44 |  59 | 119 | 175 | 199 |
+#
+#     6) The generated list of smallest values is analyzed. In this case, it
+#        can be observed that the values are increasing significantly through
+#        the entire list, which leads to the conclusion that the number of
+#        samples is too small.
+#        If instead the list had been (167, 191, 196, 199, 199), there had
+#        been a very small, or no, increase at the end of the list. We might
+#        then suspect that the number of samples is probably large enough.
+#        There is however no guarantee for that.
+#
+#     Steps 1-2 are done in run_cyclictest_suite
+#     Steps 3-5 are done in gen_minmax_list.
+#     Step 6 needs to be done manually since there is (yet) no well defined
+#     FAIL criterion and a theoretically solid PASS criterion may never be
+#     available.
+
+import multiprocessing
+import os
+import re
+import signal
+import subprocess
+import time
+import traceback
+
+# See comment on the function set_hung_tmo
+has_hung_task_detection = True
+
+#-------------------------------------------------------------------------------
+
+class TestFail(Exception):
+        def __init__(self, msg):
+                self.msg = msg
+
+        def __str__(self):
+                return "Test failure: (" + self.msg + ")"
+
+#-------------------------------------------------------------------------------
+
+def tc_name(sub_name):
+        return "rt_bmark.intlat." + sub_name
+
+#-------------------------------------------------------------------------------
+# log() does the same job as print except that a '#' is added at the beginning
+# of each line. This causes TEFEL to ignore it
+
+def log(*msg):
+        tmp = "".join(map(str, msg)) # 'map(str, ...' allows numbers
+        for line in tmp.split("\n"):
+                print "#", line
+
+#-------------------------------------------------------------------------------
+# Like log(), but with a timestamp added
+
+def log_ts(*msg):
+        ts = time.localtime()
+        stamp = "%2d:%02d:%02d: " % (ts.tm_hour, ts.tm_min, ts.tm_sec)
+        log(stamp, *msg)
+
+#-------------------------------------------------------------------------------
+
+def log_test_header(seq_no, nr_of_tests, name):
+        log("=" * 78)
+        log()
+        log("  Test case (%d/%d): %s" % (seq_no, nr_of_tests, tc_name(name)))
+        log()
+        log("." * 78)
+        log()
+
+#-------------------------------------------------------------------------------
+
+def start_stress(*args):
+        stress_cmd         = [ "stress" ]
+        added_stress_types = []
+        req_stress_types   = set(args)
+        cpu_cnt            = str(multiprocessing.cpu_count())
+
+        # The function cond_add_stress appends the options to the stress
+        # command if the stress type is in the set of requested stress types
+
+        def cond_add_stress(stress_type, options):
+                if stress_type in req_stress_types:
+                        req_stress_types.remove(stress_type)
+                        added_stress_types.append(stress_type)
+                        stress_cmd.extend(options)
+
+        #----------
+
+        cond_add_stress("io",  ["-i", cpu_cnt])
+        cond_add_stress("cpu", ["-c", cpu_cnt])
+        cond_add_stress("hdd", ["-d", cpu_cnt, "--hdd-bytes", "20M"])
+        cond_add_stress("vm",  ["-m", cpu_cnt, "--vm-bytes", "10M"])
+
+        unknown = ", ".join(req_stress_types)
+        if unknown != "":
+            raise TestFail("Unknown stress type(s): %s" % unknown)
+
+        if not added_stress_types:
+                log("No stress requested")
+                return None
+
+        added          = "+".join(added_stress_types)
+        stress_cmd_str = " ".join(stress_cmd)
+
+        log("Starting stress(", added, ")")
+        log("  Command: '", stress_cmd_str, "'")
+        log()
+
+        # preexec_fn=os.setsid causes stress to be executed in a separate
+        # session, => it gets a new process group (incl. children). It
+        # can then be terminated using os.killpg in end_stress without
+        # terminating this script.
+
+        p = subprocess.Popen(stress_cmd, preexec_fn=os.setsid)
+
+        return p
+
+#-------------------------------------------------------------------------------
+
+def end_stress(p):
+        if p is None:
+                # The value None indicates that no stress scenario was started
+                return
+
+        if p.poll() is not None:
+                raise TestFail("stress prematurely terminated.")
+
+        os.killpg(os.getpgid(p.pid), signal.SIGTERM)
+        log("Terminated stress")
+
+#-------------------------------------------------------------------------------
+
+def us2hms_str(us):
+        s = (us+500000) // 1000000 # Round microseconds to s
+        m = s//60
+        s -= 60*m;
+        h = m//60
+        m -= 60*h
+
+        return "%d:%02d:%02d" % (h, m, s)
+
+#-------------------------------------------------------------------------------
+# Sometime the hung task supervision is triggered during execution of
+# cyclictest (cyclictest starves stress). To avoid that, the supervision
+# is temporarily disabled
+
+def set_hung_tmo(new_tmo):
+        global has_hung_task_detection
+
+        tmo_file = "/proc/sys/kernel/hung_task_timeout_secs"
+
+        if not has_hung_task_detection:
+                return
+
+        if not os.access(tmo_file, os.W_OK):
+                log("Hung task detection not supported")
+                log("  (File ", tmo_file, " not found)")
+                has_hung_task_detection = False
+                return
+
+        orig_tmo = int(subprocess.check_output(["cat", tmo_file]).strip())
+        if new_tmo != orig_tmo:
+                cmd = ( "echo " + str(new_tmo) + " > " + tmo_file )
+                subprocess.check_output(cmd, shell=True)
+                log("Changed timeout for detection of hung tasks: ",
+                    orig_tmo, " -> ", new_tmo)
+
+        return orig_tmo
+
+#-------------------------------------------------------------------------------
+
+def gen_minmax_list(max_list):
+        res = [min(max_list)]
+
+        while True:
+                tmp = max_list
+                max_list = []
+                while tmp:
+                        max_list.append(max(tmp.pop(0), tmp.pop(0)))
+
+                res.append(min(max_list))
+
+                if len(max_list) < 2:
+                        return res
+
+#-------------------------------------------------------------------------------
+# Parameters for cyclictest:
+#
+# On the -S option (from cyclictest.c):
+#  -S implies options -a -t -n and same priority of all threads
+#    -a: One thread per core
+#    -n: use clock_nanosleep instead of posix interval timers
+#    -t: (without argument) Set number of threads to the number
+#         of cpus
+
+interval_core_0 = 100     # Timer interval on core 0 [us]
+interval_delta  = 20      # Interval increment for each core [us]
+loop_count      = 30000   # Number of loops (on core 0).
+
+cmd = ("cyclictest",
+       "-S",             # Standard SMP testing. See below
+       "-p", "99",       # RT priority 99
+       "-q",             # Quiet mode, i.e. print only a summary
+       "-i", str(interval_core_0),
+       "-d", str(interval_delta),
+       "-l", str(loop_count)
+       )
+rex = re.compile("C:\s*(\d+).*Min:\s*(\d+).*Avg:\s*(\d+).*Max:\s*(\d+)")
+
+def run_cyclictest_once():
+        res = subprocess.check_output(cmd)
+
+        # minlist and maxlist are lists with the extremes for each core
+        # avg_cnt is the sum of cycles for all cores
+        # avg_sum is the sum of (cycle count*average) for each core
+        #     Since cyclictest runs different number of cycles on
+        #     different cores, avg_sum/avg_cnt gives a more accurate
+        #     value of the overall average than just taking the average
+        #     of each core's averages
+
+        minlist = []
+        maxlist = []
+        avg_sum = 0
+        avg_cnt = 0
+
+        for line in res.split("\n"):
+                m = rex.search(line)
+                if m is not None:
+                        minlist.append(int(m.group(2)))
+                        maxlist.append(int(m.group(4)))
+                        n = int(m.group(1))
+                        avg_sum += n * int(m.group(3))
+                        avg_cnt += n
+
+        return min(minlist), [avg_sum, avg_cnt], max(maxlist)
+
+#-------------------------------------------------------------------------------
+# A precondition for the tracking of min-max values is that
+# the suite size os a power of 2.
+
+N          = 5
+suite_size = 2**N
+
+est_exec_time_once  = interval_core_0 * loop_count
+est_exec_time_suite = suite_size * est_exec_time_once
+
+def run_cyclictest_suite():
+        log("Starting cyclictest")
+        log("  Command          : ", " ".join(cmd))
+        log("  Number of cycles : ", loop_count*suite_size,
+            " (", suite_size, " sets of ", loop_count, " cycles)")
+        log("  Exec. time (est) : ", us2hms_str(est_exec_time_suite))
+        log()
+
+        orig_tmo = set_hung_tmo(0) # 0 => Disable
+
+        # float('inf') emulates infinity. At least in the sense that it is
+        # guaranteed to be larger than any actual number.
+        ack_min = float('inf')
+        ack_avg = [0, 0]
+
+        log()
+        log_ts("Start of execution")
+        t = time.time()
+        max_list = []
+
+        for i in xrange(0, suite_size):
+                tmp_min, tmp_avg, tmp_max = run_cyclictest_once()
+
+                msg = "%2d/%2d:" % (i+1, suite_size)
+                msg += " min: %4d" % tmp_min
+                msg += " avg: %5.1f" % (float(tmp_avg[0])/tmp_avg[1])
+                msg += " max: %4d" % tmp_max
+                log_ts(msg)
+
+                # Track minimum value
+                if tmp_min < ack_min:
+                        ack_min = tmp_min
+
+                # Track smallest max value
+                max_list.append(tmp_max)
+
+                ack_avg[0] += tmp_avg[0]
+                ack_avg[1] += tmp_avg[1]
+
+        t = time.time()-t
+        log_ts("Cyclictest completed. Actual execution time:",
+               us2hms_str(t*1000000))
+        log()
+        set_hung_tmo(orig_tmo)
+
+        return ack_min, float(ack_avg[0])/ack_avg[1], gen_minmax_list(max_list)
+
+#-------------------------------------------------------------------------------
+
+class cyclictest_runner:
+        def run_test(self, seq_no, nr_of_tests, name, stressparams):
+
+                try:
+                        log_test_header(seq_no, nr_of_tests, name)
+
+                        p = start_stress(*stressparams)
+
+                        bm_min, bm_avg, bm_max_list = run_cyclictest_suite()
+
+                        end_stress(p)
+
+                        bm_max = bm_max_list[-1]
+
+                        log()
+                        log("Min: %d us" % bm_min)
+                        log("Avg: %.1f us" % bm_avg)
+                        log("Max: %d us" % bm_max)
+                        log()
+                        log("Max list: ", bm_max_list)
+                        log()
+                        log("PASS")
+
+                        print
+                        print tc_name(name), "[Min/us,Avg/us,Max/us]:",
+                        print "%d,%.1f,%d" % (bm_min,bm_avg, bm_max)
+                        print "PASS:", tc_name(name)
+                        print
+
+                except Exception:
+                        log()
+                        log("Exception!")
+                        log()
+                        log("Traceback:", traceback.format_exc())
+                        log()
+                        log("WD: ", os.getcwd())
+                        log()
+                        log("FAIL")
+                        print
+                        print "FAIL:", tc_name(name)
+                        print
+
+#-------------------------------------------------------------------------------
+
+runner = cyclictest_runner()
+
+tests = (("no_stress", []),
+         ("cpu",  ["cpu"]),
+         ("hdd",  ["hdd"]),
+         ("io",   ["io"]),
+         ("vm",   ["vm"]),
+         ("full", ["io", "cpu", "hdd", "vm"]),
+         )
+
+nr_of_tests = len(tests)
+for seq_no, params in enumerate(tests, start=1):
+        runner.run_test(seq_no, nr_of_tests, *params)
diff --git a/meta/recipes-rt/rt-tests/files/run-ptest b/meta/recipes-rt/rt-tests/files/run-ptest
new file mode 100644
index 0000000..8e6d3e3
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/files/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+python ./rt_bmark.py
diff --git a/meta/recipes-rt/rt-tests/hwlatdetect_0.92.bb b/meta/recipes-rt/rt-tests/hwlatdetect_0.92.bb
new file mode 100644
index 0000000..8319eb9
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/hwlatdetect_0.92.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Hardware latency detector"
+DESCRIPTION = "Python utility for controlling the kernel hardware latency detection module (hwlat_detector.ko)."
+HOMEPAGE = "http://git.kernel.org/?p=linux/kernel/git/clrkwllms/rt-tests.git"
+SECTION = "tests"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+
+require rt-tests.inc
+
+EXTRA_OEMAKE += "PYLIB=${libdir}/python${PYTHON_BASEVERSION}/dist-packages"
+
+do_compile() {
+	oe_runmake hwlatdetect
+}
+
+do_install() {
+        oe_runmake install_hwlatdetect DESTDIR=${D} SBINDIR=${sbindir} \
+	           MANDIR=${mandir} INCLUDEDIR=${includedir}
+}
+
+FILES_${PN} += "${libdir}/python${PYTHON_BASEVERSION}/dist-packages/hwlatdetect.py"
+RDEPENDS_${PN} = "python python-subprocess python-textutils"
+RRECOMMENDS_${PN} = "kernel-module-hwlat-detector"
diff --git a/meta/recipes-rt/rt-tests/rt-tests.inc b/meta/recipes-rt/rt-tests/rt-tests.inc
new file mode 100644
index 0000000..871db13
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/rt-tests.inc
@@ -0,0 +1,19 @@
+# Version v0.92
+PV = "0.92"
+SRCREV = "5f9f1e3fe327440a9d405f4af8feb16ff7a909eb"
+
+SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/clrkwllms/rt-tests.git \
+           file://0001-rt-tests-Allow-for-user-specified-PYLIB.patch \
+           file://0002-rt-tests-Break-out-install_hwlatdetect.patch \
+           file://hackbench-fix-error-check.patch \
+           file://Makefile-fix-gzip-command.patch \
+           file://fix-re-install-failure.patch \
+"
+
+S = "${WORKDIR}/git"
+
+# need to append rt-tests' default CFLAGS to ours
+CFLAGS += "-I${S}/src/include -D_GNU_SOURCE -Wall -Wno-nonnull"
+
+# calling 'uname -m' is broken on crossbuilds
+EXTRA_OEMAKE = "NUMA=0"
diff --git a/meta/recipes-rt/rt-tests/rt-tests_0.92.bb b/meta/recipes-rt/rt-tests/rt-tests_0.92.bb
new file mode 100644
index 0000000..fbe2f66
--- /dev/null
+++ b/meta/recipes-rt/rt-tests/rt-tests_0.92.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Real-Time preemption testcases"
+HOMEPAGE = "https://rt.wiki.kernel.org/index.php/Cyclictest"
+SECTION = "tests"
+DEPENDS = "linux-libc-headers virtual/libc"
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+                    file://src/cyclictest/cyclictest.c;beginline=7;endline=9;md5=e768b8da44555fe63f65e5c497844cb5 \
+                    file://src/pi_tests/pi_stress.c;beginline=6;endline=19;md5=bd426a634a43ec612e9fbf125dfcc949"
+
+require rt-tests.inc
+inherit ptest
+
+SRC_URI += "file://run-ptest \
+            file://rt_bmark.py \
+           "
+# Do not install hwlatdetect
+EXTRA_OEMAKE += "PYLIB=''"
+
+do_install() {
+        oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} \
+                           INCLUDEDIR=${includedir}
+}
+
+do_install_ptest() {
+        cp ${WORKDIR}/rt_bmark.py ${D}${PTEST_PATH}
+}
+
+RDEPENDS_${PN}-ptest += " stress python python-subprocess python-multiprocessing python-datetime python-re python-lang"
+
+FILES_${PN} += "${prefix}/src/backfire"
diff --git a/meta/recipes-sato/gtk-engines/gtk-sato-engine.inc b/meta/recipes-sato/gtk-engines/gtk-sato-engine.inc
new file mode 100644
index 0000000..4e37ff2
--- /dev/null
+++ b/meta/recipes-sato/gtk-engines/gtk-sato-engine.inc
@@ -0,0 +1,23 @@
+SUMMARY = "Sato theme engine for GTK+"
+HOMEPAGE = "http://www.o-hand.com"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "LGPLv2.1 & LGPLv2+"
+
+SECTION = "x11/base"
+DEPENDS = "gtk+"
+RDEPENDS_gtk-theme-sato = "gtk-sato-engine"
+
+PACKAGES += "gtk-theme-sato"
+FILES_${PN} = "${libdir}/gtk-2.0/*/engines/*.so "
+FILES_${PN}-dev = "${libdir}/gtk-2.0/*/engines/*.la"
+FILES_${PN}-dbg += " ${libdir}/gtk-2.0/*/engines/.debug"
+FILES_gtk-theme-sato = "${datadir}/icons ${datadir}/themes"
+
+inherit autotools-brokensep pkgconfig
+
+do_configure_prepend() {
+	for i in `ls gtk-common`; do
+		ln -sf ../gtk-common/$i gtk2-engine/$i
+	done
+}
diff --git a/meta/recipes-sato/gtk-engines/gtk-sato-engine_git.bb b/meta/recipes-sato/gtk-engines/gtk-sato-engine_git.bb
new file mode 100644
index 0000000..da4d98a
--- /dev/null
+++ b/meta/recipes-sato/gtk-engines/gtk-sato-engine_git.bb
@@ -0,0 +1,14 @@
+require gtk-sato-engine.inc
+
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://src/sato-utils.h;endline=24;md5=708f28cfe7fe028d497aaf4389b80b62 \
+                    file://src/sato-main.c;endline=24;md5=b5e5dddebca570275becb51b526e4c5a"
+
+SRCREV = "4740ad8d53aba4368ce3e03b06cfdc69eb86dcdc"
+PV = "0.3.3+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF += "${@bb.utils.contains('MACHINE_FEATURES', 'qvga', '--with-mode=qvga', '',d)}"
diff --git a/meta/recipes-sato/images/core-image-sato-dev.bb b/meta/recipes-sato/images/core-image-sato-dev.bb
new file mode 100644
index 0000000..7fa69d0
--- /dev/null
+++ b/meta/recipes-sato/images/core-image-sato-dev.bb
@@ -0,0 +1,7 @@
+require core-image-sato.bb
+
+DESCRIPTION = "Image with Sato for development work. It includes everything \
+within core-image-sato plus a native toolchain, application development and \
+testing libraries, profiling and debug symbols."
+
+IMAGE_FEATURES += "dev-pkgs"
diff --git a/meta/recipes-sato/images/core-image-sato-sdk.bb b/meta/recipes-sato/images/core-image-sato-sdk.bb
new file mode 100644
index 0000000..62836f9
--- /dev/null
+++ b/meta/recipes-sato/images/core-image-sato-sdk.bb
@@ -0,0 +1,15 @@
+require core-image-sato.bb
+
+DESCRIPTION = "Image with Sato support that includes everything within \
+core-image-sato plus meta-toolchain, development headers and libraries to \
+form a standalone SDK."
+
+QT4PKG = "qt4-pkgs"
+QT4PKG_mips64 = ""
+QT4PKG_mips64n32 = ""
+
+IMAGE_FEATURES += "dev-pkgs tools-sdk ${QT4PKG} \
+	tools-debug eclipse-debug tools-profile tools-testapps debug-tweaks ssh-server-openssh"
+
+IMAGE_INSTALL += "kernel-devsrc"
+
diff --git a/meta/recipes-sato/images/core-image-sato.bb b/meta/recipes-sato/images/core-image-sato.bb
new file mode 100644
index 0000000..e3246d2
--- /dev/null
+++ b/meta/recipes-sato/images/core-image-sato.bb
@@ -0,0 +1,11 @@
+DESCRIPTION = "Image with Sato, a mobile environment and visual style for \
+mobile devices. The image supports X11 with a Sato theme, Pimlico \
+applications, and contains terminal, editor, and file manager."
+
+IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-dropbear hwcodecs"
+
+LICENSE = "MIT"
+
+inherit core-image
+
+IMAGE_INSTALL += "packagegroup-core-x11-sato-games"
diff --git a/meta/recipes-sato/leafpad/files/leafpad.desktop b/meta/recipes-sato/leafpad/files/leafpad.desktop
new file mode 100644
index 0000000..c7e2d5b
--- /dev/null
+++ b/meta/recipes-sato/leafpad/files/leafpad.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Notes
+Exec=/usr/bin/leafpad
+Comment=Text Editor
+Icon=accessories-text-editor
+Terminal=false
+Type=Application
+Categories=GTK;Utility;TextEditor;
+X-MB-SingleInstance=true
+StartupNotify=true
diff --git a/meta/recipes-sato/leafpad/files/owl-menu.patch b/meta/recipes-sato/leafpad/files/owl-menu.patch
new file mode 100644
index 0000000..2ebf74a
--- /dev/null
+++ b/meta/recipes-sato/leafpad/files/owl-menu.patch
@@ -0,0 +1,63 @@
+Upstream-Status: Inappropriate [enable feature]
+
+--- tmp/src/menu.c.orig	2007-04-23 12:08:41.000000000 +0100
++++ tmp/src/menu.c	2007-04-23 12:08:41.000000000 +0100
+@@ -152,7 +152,7 @@
+ 	}
+ 	
+ 	accel_group = gtk_accel_group_new();
+-	ifactory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<main>", accel_group);
++	ifactory = gtk_item_factory_new(GTK_TYPE_MENU, "<main>", accel_group);
+ 	gtk_item_factory_set_translate_func(ifactory, menu_translate, NULL, NULL);
+ 	gtk_item_factory_create_items(ifactory, nmenu_items, menu_items, NULL);
+ 	gtk_window_add_accel_group(GTK_WINDOW(window), accel_group);
+
+--- tmp/src/window.c.orig	2007-04-23 12:14:07.000000000 +0100
++++ tmp/src/window.c	2007-04-23 12:14:07.000000000 +0100
+@@ -18,6 +18,8 @@
+  */
+ 
+ #include "leafpad.h"
++#include <libowl/owlwindowmenu.h>
++
+ /*
+ static void cb_scroll_event(GtkAdjustment *adj, GtkWidget *view)
+ {
+@@ -52,7 +54,6 @@
+ 	gtk_container_add(GTK_CONTAINER(window), vbox);
+ 	
+ 	menubar = create_menu_bar(window);
+-	gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0);
+ 	
+ 	sw = gtk_scrolled_window_new(NULL, NULL);
+ 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
+
+--- tmp/src/main.c.orig	2007-04-23 12:15:03.000000000 +0100
++++ tmp/src/main.c	2007-04-23 12:15:03.000000000 +0100
+@@ -244,6 +244,7 @@
+ 	Conf *conf;
+ 	GtkItemFactory *ifactory;
+ 	gchar *stdin_data = NULL;
++	GtkWidget *menu;
+ 	
+ 	bindtextdomain(PACKAGE, LOCALEDIR);
+ 	bind_textdomain_codeset(PACKAGE, "UTF-8");
+@@ -293,7 +294,10 @@
+ 		conf->autoindent);
+ 	
+ 	gtk_widget_show_all(pub->mw->window);
++	owl_set_window_menu (GTK_WINDOW(pub->mw->window),
++			     GTK_MENU(pub->mw->menubar));
++	
+ 	g_free(conf->fontname);
+ 	g_free(conf);
+ 	
+
+--- tmp/src/Makefile.am.orig	2007-04-23 12:17:54.000000000 +0100
++++ tmp/src/Makefile.am	2007-04-23 12:17:54.000000000 +0100
+@@ -27,4 +27,4 @@
+ 	i18n.h
+ 
+ leafpad_CFLAGS  = $(GTK_CFLAGS) $(GNOMEPRINT_CFLAGS)
+-leafpad_LDADD   = $(GTK_LIBS) $(INTLLIBS) $(GNOMEPRINT_LIBS)
++leafpad_LDADD   = $(GTK_LIBS) $(INTLLIBS) $(GNOMEPRINT_LIBS) -lowl
diff --git a/meta/recipes-sato/leafpad/leafpad_0.8.18.1.bb b/meta/recipes-sato/leafpad/leafpad_0.8.18.1.bb
new file mode 100644
index 0000000..f715149
--- /dev/null
+++ b/meta/recipes-sato/leafpad/leafpad_0.8.18.1.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Simple GTK+ Text Editor"
+HOMEPAGE = "http://tarot.freeshell.org/leafpad/"
+
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://src/leafpad.h;endline=20;md5=d3d6a89f5e61e8b13bdea537511ba1fa \
+                    file://src/utils.c;endline=20;md5=0d2cc6584ba3202448bb274f62739571"
+
+DEPENDS = "gtk+ intltool-native libowl"
+# The libowl requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+	   file://leafpad.desktop"
+
+SRC_URI[md5sum] = "254a72fc67505e3aa52884c729cd7b97"
+SRC_URI[sha256sum] = "959d22ae07f22803bc66ff40d373a854532a6e4732680bf8a96a3fbcb9f80a2c"
+PR = "r2"
+
+SRC_URI_append_poky = " file://owl-menu.patch;apply=yes "
+
+inherit autotools pkgconfig distro_features_check
+
+EXTRA_OECONF = " --enable-chooser --disable-emacs --disable-print"
+
+do_install_append () {
+        install -d ${D}/${datadir}
+        install -d ${D}/${datadir}/applications
+        install -m 0644 ${WORKDIR}/leafpad.desktop ${D}/${datadir}/applications
+}
+
+FILES_${PN} += "${datadir}/applications/leafpad.desktop"
+
+PACKAGES += "leafpad-stock-icons"
+FILES_leafpad-stock-icons = "${datadir}/icons/hicolor/"
diff --git a/meta/recipes-sato/libowl/libowl_git.bb b/meta/recipes-sato/libowl/libowl_git.bb
new file mode 100644
index 0000000..9cc47db
--- /dev/null
+++ b/meta/recipes-sato/libowl/libowl_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "OpenedHand Widget Library"
+HOMEPAGE = "http://www.o-hand.com"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2 & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://libowl/owlpaned.h;endline=20;md5=7fef844c4cc01b10541a7ab6ab5971af \
+                    file://libowl/owltreemodelslice.h;endline=20;md5=a5421f2cdae8debe5e4c48c09a02beb9 \
+                    file://libowl/owlcolourswatch.h;endline=24;md5=063c415c58719d536990ca8f606b5730"
+
+SECTION = "libs"
+DEPENDS = "gtk+"
+SRCREV = "6ebc8ac8f8575278dd40a535cadefa26374e44b1"
+PV = "0.1+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+# Requires gdk/gdkx.h which is provided by gtk when x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch b/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch
new file mode 100644
index 0000000..8256949
--- /dev/null
+++ b/meta/recipes-sato/matchbox-config-gtk/files/no-handed.patch
@@ -0,0 +1,35 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: appearance/mb-appearance.c
+===================================================================
+--- appearance/mb-appearance.c	(revision 1614)
++++ appearance/mb-appearance.c	(working copy)
+@@ -300,11 +300,13 @@
+     gtk_font_button_set_font_name (GTK_FONT_BUTTON (font_button),
+                                    gconf_value_get_string (value));
+   } else if (strcmp (key, HANDED_KEY) == 0) {
++#if 0
+     GEnumValue *e;
+     e = g_enum_get_value_by_name (g_type_class_ref (GTK_TYPE_CORNER_TYPE),
+                                   gconf_value_get_string (value));
+     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (handed_check),
+                                   e->value == GTK_CORNER_TOP_RIGHT);
++#endif
+   }
+ }
+ 
+@@ -395,12 +397,13 @@
+   gtk_container_add (GTK_CONTAINER (align), font_button);
+ 
+   /* Left/Right Handed */
+-  
++#if 0
+   frame = new_frame (_("Orientation"), &align);
+   gtk_box_pack_start (GTK_BOX (box), frame, TRUE, TRUE, 0);
+   handed_check = gtk_check_button_new_with_mnemonic (_("_Left-handed"));
+   g_signal_connect (handed_check, "toggled", G_CALLBACK (on_handed_set), NULL);
+   gtk_container_add (GTK_CONTAINER (align), handed_check);
++#endif
+ 
+   gconf_client_add_dir (gconf, INTERFACE_DIR, GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
+   g_signal_connect (gconf, "value-changed", G_CALLBACK (on_gconf_value_changed), NULL);
diff --git a/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_git.bb b/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_git.bb
new file mode 100644
index 0000000..5f73a4c
--- /dev/null
+++ b/meta/recipes-sato/matchbox-config-gtk/matchbox-config-gtk_git.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Matchbox GTK+ theme configuration application"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://appearance/mb-appearance.c;endline=25;md5=ea92333cf8a6802639d62d874c114a28"
+
+DEPENDS = "gconf gtk+"
+RDEPENDS_${PN} = "settings-daemon"
+
+SRCREV = "3ed74dfb7c57be088a5ab36e446c0ccde9fa1028"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN} \
+        file://no-handed.patch;striplevel=0"
+
+inherit autotools pkgconfig distro_features_check
+
+# The settings-daemon requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-sato/matchbox-desktop-sato/matchbox-desktop-sato_git.bb b/meta/recipes-sato/matchbox-desktop-sato/matchbox-desktop-sato_git.bb
new file mode 100644
index 0000000..1979cbb
--- /dev/null
+++ b/meta/recipes-sato/matchbox-desktop-sato/matchbox-desktop-sato_git.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Matchbox desktop folders for the Sato environment"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
+
+SECTION = "x11"
+DEPENDS = ""
+RCONFLICTS_${PN} = "matchbox-common"
+
+SRCREV = "810b0b08eb79e4685202da2ec347b990bb467e07"
+PV = "0.1+git${SRCPV}"
+PR = "r1"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
+
+FILES_${PN} += "${datadir}"
diff --git a/meta/recipes-sato/matchbox-desktop/matchbox-desktop_git.bb b/meta/recipes-sato/matchbox-desktop/matchbox-desktop_git.bb
new file mode 100644
index 0000000..318d2e0
--- /dev/null
+++ b/meta/recipes-sato/matchbox-desktop/matchbox-desktop_git.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Matchbox Window Manager Desktop"
+HOMEPAGE = "http://matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://libtaku/eggsequence.h;endline=20;md5=b91f68f7642a1459fa1f4c9df94a8f15 \
+                    file://src/desktop.c;endline=20;md5=36c9bf295e6007f3423095f405af5a2d \
+                    file://src/main.c;endline=19;md5=2044244f97a195c25b7dc602ac7e9a00"
+
+DEPENDS = "gtk+ startup-notification dbus"
+SECTION = "x11/wm"
+SRCREV = "71e3e6e04271e9d5a14f1c231ef100c7f320134d"
+PV = "2.0+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}-2"
+
+EXTRA_OECONF = "--enable-startup-notification --with-dbus"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+# The startup-notification requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh b/meta/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh
new file mode 100644
index 0000000..6cf188b
--- /dev/null
+++ b/meta/recipes-sato/matchbox-keyboard/files/80matchboxkeyboard.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+. /etc/formfactor/config
+
+CMD=""
+
+if [ "$HAVE_KEYBOARD" = "0" ]; then
+    CMD="matchbox-keyboard -d"
+elif [ "$DISPLAY_CAN_ROTATE" = "1" ]; then
+    if [ "$HAVE_KEYBOARD_PORTRAIT" = "1" -a "$HAVE_KEYBOARD_LANDSCAPE" = "0" ]; then
+        CMD="matchbox-keyboard -d -o landscape"
+    elif [ "$HAVE_KEYBOARD_LANDSCAPE" = "1" -a "$HAVE_KEYBOARD_PORTRAIT" = "0" ]; then
+        CMD="matchbox-keyboard -d -o portrait"
+    fi
+fi
+
+if [ "$CMD" ]; then
+    # Delay to make sure the window manager is active
+    # by waiting for the desktop to say its finished loading
+    dbus-wait org.matchbox_project.desktop Loaded && $CMD &
+fi
diff --git a/meta/recipes-sato/matchbox-keyboard/files/single-instance.patch b/meta/recipes-sato/matchbox-keyboard/files/single-instance.patch
new file mode 100644
index 0000000..18b6c41
--- /dev/null
+++ b/meta/recipes-sato/matchbox-keyboard/files/single-instance.patch
@@ -0,0 +1,23 @@
+Multiple matchbox-keyboard instances would occupy whole screen and cause X
+window segfault(Bug 509). Making matchbox-keyboard singleton is one work
+around.
+
+This patch allow only one instance of matchbox-keyboard based on some mechanism
+in matchbox-desktop. In future, an applet and GTK-IM modules in
+matchbox-keyboard can be used to automatically map/unmap the virtual keyboard
+on demand.
+
+Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: matchbox-keyboard/matchbox-keyboard.desktop
+===================================================================
+--- matchbox-keyboard.orig/matchbox-keyboard.desktop	2010-12-22 20:41:40.000000000 +0800
++++ matchbox-keyboard/matchbox-keyboard.desktop	2010-12-22 20:42:12.000000000 +0800
+@@ -6,3 +6,5 @@
+ Icon=matchbox-keyboard.png
+ Categories=Panel;Utility;MB
+ X-MB-INPUT-MECHANSIM=True
++X-MB-SingleInstance=true
++StartupNotify=true
diff --git a/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb b/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb
new file mode 100644
index 0000000..0d321d3
--- /dev/null
+++ b/meta/recipes-sato/matchbox-keyboard/matchbox-keyboard_git.bb
@@ -0,0 +1,56 @@
+SUMMARY = "Matchbox virtual keyboard for X11"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+SECTION = "x11"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+                    file://src/matchbox-keyboard.h;endline=17;md5=9d6586c69e4a926f3cb0b4425f24ba3c \
+                    file://applet/applet.c;endline=18;md5=4a0f721724746b14d95b51ddd42b95e7"
+
+DEPENDS = "libfakekey expat libxft gtk+ matchbox-panel-2"
+
+SRCREV = "217f1bfe14c41cf7e291d04a63aa2d79cc13d063"
+PV = "0.0+git${SRCPV}"
+PR = "r4"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN};branch=matchbox-keyboard-0-1 \
+           file://single-instance.patch \
+           file://80matchboxkeyboard.sh"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig gettext gtk-immodules-cache distro_features_check
+
+# The libxft, libfakekey and matchbox-panel-2 requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OECONF = "--disable-cairo --enable-gtk-im --enable-applet"
+
+PACKAGES += "${PN}-im ${PN}-applet"
+
+FILES_${PN} = "${bindir}/ \
+	       ${sysconfdir} \
+	       ${datadir}/applications \
+	       ${datadir}/pixmaps \
+	       ${datadir}/matchbox-keyboard"
+
+FILES_${PN}-dbg += "${libdir}/gtk-2.0/*/immodules/.debug"
+
+FILES_${PN}-im = "${libdir}/gtk-2.0/*/immodules/*.so"
+
+FILES_${PN}-applet = "${libdir}/matchbox-panel/*.so"
+
+
+do_install_append () {
+	install -d ${D}/${sysconfdir}/X11/Xsession.d/
+	install -m 755 ${WORKDIR}/80matchboxkeyboard.sh ${D}/${sysconfdir}/X11/Xsession.d/
+
+	rm -f ${D}${libdir}/gtk-2.0/*/immodules/*.la
+	rm -f ${D}${libdir}/matchbox-panel/*.la
+}
+
+GTKIMMODULES_PACKAGES = "${PN}-im"
+
+RDEPENDS_${PN} = "formfactor dbus-wait"
+RRECOMMENDS_${PN} = "${PN}-applet"
diff --git a/meta/recipes-sato/matchbox-panel-2/files/silence-warnings.patch b/meta/recipes-sato/matchbox-panel-2/files/silence-warnings.patch
new file mode 100644
index 0000000..45ba9a0
--- /dev/null
+++ b/meta/recipes-sato/matchbox-panel-2/files/silence-warnings.patch
@@ -0,0 +1,64 @@
+Don't warn if the machine doesn't actually have a battery, or if the applets
+string contains consecutive separators.
+
+Upstream-Status: Backport
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/applets/battery/battery-acpi.c b/applets/battery/battery-acpi.c
+index 6515cb0..c44dd12 100644
+--- a/applets/battery/battery-acpi.c
++++ b/applets/battery/battery-acpi.c
+@@ -14,8 +14,6 @@ int batt_state, ac_state;
+ int pm_support(void)
+ {
+ 	if(check_acpi_support() == NOT_SUPPORTED){
+-		g_warning("No ACPI support\n");
+-
+ 		return 0;
+ 	}
+ 
+@@ -32,8 +30,9 @@ const char* pm_battery_icon(void)
+ 	const char *icon;
+ 	battery_t *binfo;
+ 
++        /* No battery available (not present, disabled, or something
++           else. Silently do nothing. */
+ 	if (batt_state != SUCCESS) {
+-		g_warning("Couldnt initialize ACPI battery\n");
+ 		return NULL;
+ 	}
+ 
+diff --git a/applets/battery/battery-apm.c b/applets/battery/battery-apm.c
+index 5467438..2f39cb6 100644
+--- a/applets/battery/battery-apm.c
++++ b/applets/battery/battery-apm.c
+@@ -10,8 +10,6 @@
+ int pm_support(void)
+ {
+ 	if (1 == apm_exists ()) {
+-                g_warning ("No APM support");
+-
+                 return 0;
+         }
+ 
+diff --git a/matchbox-panel/mb-panel.c b/matchbox-panel/mb-panel.c
+index 2d8cafd..828a36d 100644
+--- a/matchbox-panel/mb-panel.c
++++ b/matchbox-panel/mb-panel.c
+@@ -110,10 +110,15 @@ load_applets (const char    *applets_desc,
+         applets = g_strsplit (applets_desc, ",", -1);
+ 
+         for (i = 0; applets[i]; i++) {
++                char *s;
+                 char **bits;
+                 GtkWidget *applet;
+ 
+-                bits = g_strsplit (applets[i], ":", 2);
++                s = applets[i];
++                if (s == NULL || s[0] == '\0')
++                        continue;
++
++                bits = g_strsplit (s, ":", 2);
+ 
+                 applet = load_applet (bits[0],
+                                       bits[1],
diff --git a/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_git.bb b/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_git.bb
new file mode 100644
index 0000000..4ed7368
--- /dev/null
+++ b/meta/recipes-sato/matchbox-panel-2/matchbox-panel-2_git.bb
@@ -0,0 +1,39 @@
+SUMMARY = "Simple GTK+ based panel for handheld devices"
+HOMEPAGE = "http://matchbox-project.org"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://matchbox-panel/mb-panel.h;endline=10;md5=0b7db28f4b6863fb853d0467e590019a \
+                    file://applets/startup/startup.c;endline=22;md5=b0a64fbef3097d79f8264e6907a98f03"
+
+DEPENDS = "gnome-common gtk+ startup-notification dbus dbus-glib"
+DEPENDS += " ${@bb.utils.contains("MACHINE_FEATURES", "acpi", "libacpi", "",d)}"
+DEPENDS += " ${@bb.utils.contains("MACHINE_FEATURES", "apm", "apmd", "",d)}"
+
+# The startup-notification requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRCREV = "26a3a67b41c50e0ae163d8fe86ccf7a0f0a671ae"
+PV = "2.0+git${SRCPV}"
+
+RPROVIDES_${PN} = "matchbox-panel"
+RREPLACES_${PN} = "matchbox-panel"
+RCONFLICTS_${PN} = "matchbox-panel"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN} \
+           file://silence-warnings.patch"
+
+EXTRA_OECONF = "--enable-startup-notification --enable-dbus"
+EXTRA_OECONF += " ${@bb.utils.contains("MACHINE_FEATURES", "acpi", "--with-battery=acpi", "",d)}"
+EXTRA_OECONF += " ${@bb.utils.contains("MACHINE_FEATURES", "apm", "--with-battery=apm", "",d)}"
+
+S = "${WORKDIR}/git"
+
+FILES_${PN} += "${libdir}/matchbox-panel/*.so \
+                ${datadir}/matchbox-panel/brightness/*.png \
+                ${datadir}/matchbox-panel/startup/*.png "
+FILES_${PN}-dbg += "${libdir}/matchbox-panel/.debug"
+FILES_${PN}-dev += "${libdir}/matchbox-panel/*.la"
+
+inherit autotools pkgconfig distro_features_check
diff --git a/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session b/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session
new file mode 100644
index 0000000..42ce483
--- /dev/null
+++ b/meta/recipes-sato/matchbox-sato/matchbox-session-sato/session
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+. /etc/formfactor/config
+
+if [ "$HAVE_TOUCHSCREEN" = "1" ]; then
+    SHOWCURSOR="no"
+else
+    SHOWCURSOR="yes"
+fi
+
+if [ "$HAVE_KEYBOARD" = "1" ]; then
+    KEYBOARD_APPLET=""
+else
+    KEYBOARD_APPLET="keyboard"
+fi
+
+# Tell GTK+3 we really want server side decorations, even with
+# GtkHeaderBar using applications: Without that mb-panel will render
+# on top of the client side decorations.
+export GTK_CSD=0
+
+matchbox-desktop &
+
+# Lines containing feature-[foo] are removed at build time if the machine
+# doesn't have the feature "foo".
+
+START_APPLETS=showdesktop,windowselector
+END_APPLETS=clock,battery,$KEYBOARD_APPLET,systray,startup-notify,notify
+END_APPLETS=openmoko-panel-gsm,$END_APPLETS # feature-phone
+
+matchbox-panel --titlebar --start-applets $START_APPLETS --end-applets $END_APPLETS &
+
+exec matchbox-window-manager -theme Sato -use_desktop_mode decorated -use_cursor $SHOWCURSOR $@
diff --git a/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb b/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb
new file mode 100644
index 0000000..76de18a
--- /dev/null
+++ b/meta/recipes-sato/matchbox-sato/matchbox-session-sato_0.1.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Custom Matchbox session files for the Sato environment"
+HOMEPAGE = "http://www.matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2.0+"
+LIC_FILES_CHKSUM = "file://session;endline=3;md5=f8a5c5b9c279e52dc094d10e11c2be63"
+
+SECTION = "x11"
+DEPENDS = "gconf-native"
+RDEPENDS_${PN} = "formfactor gtk-sato-engine matchbox-theme-sato gtk-theme-sato matchbox-panel-2 matchbox-desktop-sato matchbox-session gconf"
+PR = "r30"
+
+# This package is architecture specific because the session script is modified
+# based on the machine architecture.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit distro_features_check
+
+# The matchbox-theme-sato requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "file://session"
+S = "${WORKDIR}"
+
+do_install() {
+	# This is the set of machine features that the script has markers for
+	FEATURES="phone"
+	SCRIPT="${S}/sedder"
+	rm -f $SCRIPT
+	touch $SCRIPT
+	for FEAT in $FEATURES; do
+		if echo ${MACHINE_FEATURES} | awk "/$FEAT/ {exit 1}"; then
+			echo "/feature-$FEAT/d" >> $SCRIPT
+		fi
+	done
+
+	install -d ${D}/${sysconfdir}/matchbox
+	sed -f "$SCRIPT" ${S}/session > ${D}/${sysconfdir}/matchbox/session
+        chmod +x ${D}/${sysconfdir}/matchbox/session
+}
+
+pkg_postinst_${PN} () {
+	set_value() {
+		#type, name, value
+		gconftool-2 --config-source=xml::$D${sysconfdir}/gconf/gconf.xml.defaults --direct --type $1 --set /desktop/poky/interface/$2 "$3"
+	}
+	set_value string theme Sato
+	set_value string icon_theme Sato
+	set_value bool touchscreen true
+	set_value string font_name "Sans 9"
+}
diff --git a/meta/recipes-sato/matchbox-terminal/matchbox-terminal_git.bb b/meta/recipes-sato/matchbox-terminal/matchbox-terminal_git.bb
new file mode 100644
index 0000000..91fd150
--- /dev/null
+++ b/meta/recipes-sato/matchbox-terminal/matchbox-terminal_git.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Lightweight GTK+ terminal application"
+HOMEPAGE = "http://www.matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://main.c;endline=20;md5=96e39176d9e355639a0b8b1c7a840820"
+
+DEPENDS = "gtk+ vte"
+SECTION = "x11/utils"
+SRCREV = "452bca253492a97a587f440289b9ab27d217353e"
+PV = "0.0+git${SRCPV}"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato.inc b/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato.inc
new file mode 100644
index 0000000..d947e1a
--- /dev/null
+++ b/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato.inc
@@ -0,0 +1,16 @@
+SUMMARY = "Matchbox window manager Sato themes"
+HOMEPAGE = "http://www.matchbox-project.org/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "CC-BY-SA-3.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=aae86bb34b0a83716ca09f4e783d6ba4"
+
+DEPENDS = "matchbox-wm"
+SECTION = "x11/wm"
+
+inherit autotools pkgconfig distro_features_check
+
+FILES_${PN} += "${datadir}/themes"
+
+# The matchbox-wm requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.1.bb b/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.1.bb
new file mode 100644
index 0000000..f6786dd
--- /dev/null
+++ b/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_0.1.bb
@@ -0,0 +1,8 @@
+require matchbox-theme-sato.inc
+
+PR = "r1"
+
+SRC_URI = "http://pokylinux.org/releases/sato/matchbox-theme-sato-0.1.tar.gz"
+
+SRC_URI[md5sum] = "72ae272ef7803141a3dcb69e670cff97"
+SRC_URI[sha256sum] = "5b59f9646edbfb907a309332db3bd6fa7080dc1fe24df549480cfae7d974a3fb"
diff --git a/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_git.bb b/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_git.bb
new file mode 100644
index 0000000..0d3569d
--- /dev/null
+++ b/meta/recipes-sato/matchbox-theme-sato/matchbox-theme-sato_git.bb
@@ -0,0 +1,12 @@
+require matchbox-theme-sato.inc
+
+SRCREV = "f72cf4ed7d71ad9e47b0f2d3dbc593bc2f3e76f8"
+PV = "0.2+git${SRCPV}"
+
+DEFAULT_PREFERENCE = "-1"
+
+SRC_URI = "git://git.yoctoproject.org/matchbox-sato"
+
+EXTRA_OECONF += "${@bb.utils.contains('MACHINE_FEATURES', 'qvga', '--with-mode=qvga', '',d)}"
+
+S = "${WORKDIR}/git"
diff --git a/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb b/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb
new file mode 100644
index 0000000..6679db8
--- /dev/null
+++ b/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb
@@ -0,0 +1,66 @@
+#
+# Copyright (C) 2007-2008 OpenedHand Ltd.
+#
+
+SUMMARY = "Sato desktop"
+LICENSE = "MIT"
+PR = "r33"
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+inherit packagegroup distro_features_check
+# rdepends on x11vnc
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGES = "${PN} ${PN}-base ${PN}-apps ${PN}-games"
+
+RDEPENDS_${PN} = "\
+    ${PN}-base \
+    ${PN}-apps \
+    ${PN}-games \
+    "
+
+NETWORK_MANAGER ?= "connman-gnome"
+NETWORK_MANAGER_libc-uclibc = ""
+
+SUMMARY_${PN}-base = "Sato desktop - base packages"
+RDEPENDS_${PN}-base = "\
+    matchbox-desktop \
+    matchbox-session-sato \
+    matchbox-keyboard \
+    matchbox-keyboard-applet \
+    matchbox-keyboard-im \
+    matchbox-config-gtk \
+    xcursor-transparent-theme \
+    sato-icon-theme \
+    settings-daemon \
+    gtk-sato-engine \
+    shutdown-desktop \
+    libsdl \
+    ${NETWORK_MANAGER} \
+    udev-extraconf \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'pulseaudio', 'pulseaudio-server pulseaudio-client-conf-sato', '', d)} \
+    "
+
+# pcmanfm doesn't work on mips
+FILEMANAGER ?= "pcmanfm"
+FILEMANAGER_mips ?= ""
+
+WEB ?= ""
+#WEB = "epiphany"
+
+SUMMARY_${PN}-apps = "Sato desktop - applications"
+RDEPENDS_${PN}-apps = "\
+    leafpad \
+    gst-player-bin \
+    x11vnc \
+    matchbox-terminal \
+    sato-screenshot \
+    ${FILEMANAGER} \
+    ${WEB} \
+    "
+
+SUMMARY_${PN}-games = "Sato desktop - games"
+RDEPENDS_${PN}-games = "\
+    oh-puzzles \
+    "
diff --git a/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.png b/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.png
new file mode 100644
index 0000000..b8e5594
--- /dev/null
+++ b/meta/recipes-sato/pcmanfm/files/emblem-symbolic-link.png
Binary files differ
diff --git a/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.png b/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.png
new file mode 100644
index 0000000..05921a6
--- /dev/null
+++ b/meta/recipes-sato/pcmanfm/files/gnome-fs-directory.png
Binary files differ
diff --git a/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.png b/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.png
new file mode 100644
index 0000000..ce77a8e
--- /dev/null
+++ b/meta/recipes-sato/pcmanfm/files/gnome-fs-regular.png
Binary files differ
diff --git a/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.png b/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.png
new file mode 100644
index 0000000..bfe4bad
--- /dev/null
+++ b/meta/recipes-sato/pcmanfm/files/gnome-mime-text-plain.png
Binary files differ
diff --git a/meta/recipes-sato/pcmanfm/files/no-desktop.patch b/meta/recipes-sato/pcmanfm/files/no-desktop.patch
new file mode 100644
index 0000000..103d6d1
--- /dev/null
+++ b/meta/recipes-sato/pcmanfm/files/no-desktop.patch
@@ -0,0 +1,15 @@
+Disable the desktop preferences launcher as we don't use the pcmanfm desktop in
+Sato.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+
+diff --git a/data/pcmanfm-desktop-pref.desktop b/data/pcmanfm-desktop-pref.desktop
+index ccf8abb..3f6fc1c 100644
+--- a/data/pcmanfm-desktop-pref.desktop.in
++++ b/data/pcmanfm-desktop-pref.desktop.in
+@@ -7,3 +7,4 @@ Exec=pcmanfm --desktop-pref
+ StartupNotify=true
+ Terminal=false
+ NotShowIn=GNOME;XFCE;KDE;
++NoDisplay=true
diff --git a/meta/recipes-sato/pcmanfm/pcmanfm_1.2.3.bb b/meta/recipes-sato/pcmanfm/pcmanfm_1.2.3.bb
new file mode 100644
index 0000000..4467303
--- /dev/null
+++ b/meta/recipes-sato/pcmanfm/pcmanfm_1.2.3.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Fast lightweight tabbed filemanager"
+HOMEPAGE = "http://pcmanfm.sourceforge.net/"
+
+LICENSE = "GPLv2 & GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://src/pcmanfm.h;endline=22;md5=417b3855771a3a87f8ad753d994491f0 \
+                    file://src/gseal-gtk-compat.h;endline=21;md5=46922c8691f58d124f9420fe16149ce2"
+
+SECTION = "x11"
+DEPENDS = "gtk+ startup-notification libfm intltool-native"
+DEPENDS_append_poky = " libowl"
+
+
+COMPATIBLE_HOST = '(x86_64.*|i.86.*|aarch64.*|arm.*|mips.*|powerpc.*|sh.*)-(linux|freebsd.*)'
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/pcmanfm-${PV}.tar.xz \
+	   file://gnome-fs-directory.png \
+	   file://gnome-fs-regular.png \
+	   file://gnome-mime-text-plain.png \
+	   file://emblem-symbolic-link.png \
+	   file://no-desktop.patch"
+
+SRC_URI[md5sum] = "c993402d407b0a3fc076f842ac1bc5c9"
+SRC_URI[sha256sum] = "cfa8d82fc63be147045174bef074807e1e32ce8c6bf4dbd8fad49e260bcf6380"
+
+inherit autotools pkgconfig distro_features_check
+
+# The startup-notification requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+do_install_append () {
+	install -d ${D}/${datadir}
+	install -d ${D}/${datadir}/pixmaps/
+
+	install -m 0644 ${WORKDIR}/*.png ${D}/${datadir}/pixmaps
+}
+
+FILES_${PN} += "${libdir}/pcmanfm"
+
+RRECOMMENDS_${PN} += "adwaita-icon-theme"
diff --git a/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato/50-sato.conf b/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato/50-sato.conf
new file mode 100644
index 0000000..97492e7
--- /dev/null
+++ b/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato/50-sato.conf
@@ -0,0 +1,7 @@
+# We rely on PulseAudio's autospawn feature to automatically start the daemon
+# in Sato. The graphical session in Sato runs under root, however, and
+# PulseAudio disables autospawning for root by default. In a normal setup it's
+# not desirable to autospawn for root, because it can easily interfere with
+# other users' PulseAudio instances, but in Sato there are no other users, so
+# it's OK to enable this in Sato.
+allow-autospawn-for-root = yes
diff --git a/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato_1.bb b/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato_1.bb
new file mode 100644
index 0000000..e27339f
--- /dev/null
+++ b/meta/recipes-sato/pulseaudio-sato/pulseaudio-client-conf-sato_1.bb
@@ -0,0 +1,17 @@
+SUMMARY = "/etc/pulse/client.conf tailored for Sato"
+SECTION = "multimedia"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://50-sato.conf"
+S = "${WORKDIR}"
+
+inherit allarch
+
+do_install() {
+	install -d ${D}${sysconfdir}/pulse/client.conf.d
+	install -m 0644 ${S}/50-sato.conf ${D}${sysconfdir}/pulse/client.conf.d/50-sato.conf
+}
+
+FILES_${PN} = "${sysconfdir}/pulse/client.conf.d/50-sato.conf"
+CONFFILES_${PN} = "${sysconfdir}/pulse/client.conf.d/50-sato.conf"
diff --git a/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch b/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch
new file mode 100644
index 0000000..f43d1df
--- /dev/null
+++ b/meta/recipes-sato/puzzles/files/0001-Use-labs-instead-of-abs.patch
@@ -0,0 +1,46 @@
+From 9808dc09e08937c9bffd858d3ded428225a4312a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 Sep 2015 09:02:38 +0000
+Subject: [PATCH] Use labs instead of abs
+
+cluevals is array of longs so we have to use labs() instead of abs()
+since abs() returns int
+
+Fixes
+
+keen.c:1458:17: error: absolute value function 'abs' given an argument
+of type 'long' but has parameter of type 'int' which may cause
+truncation of value
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ keen.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/keen.c b/keen.c
+index a6a7238..1631992 100644
+--- a/keen.c
++++ b/keen.c
+@@ -1043,7 +1043,7 @@ done
+ 		    cluevals[j] *= grid[i];
+ 		    break;
+ 		  case C_SUB:
+-		    cluevals[j] = abs(cluevals[j] - grid[i]);
++		    cluevals[j] = labs(cluevals[j] - grid[i]);
+ 		    break;
+ 		  case C_DIV:
+ 		    {
+@@ -1455,7 +1455,7 @@ static int check_errors(const game_state *state, long *errors)
+ 		cluevals[j] *= state->grid[i];
+ 		break;
+ 	      case C_SUB:
+-		cluevals[j] = abs(cluevals[j] - state->grid[i]);
++		cluevals[j] = labs(cluevals[j] - state->grid[i]);
+ 		break;
+ 	      case C_DIV:
+ 		{
+-- 
+2.5.1
+
diff --git a/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch b/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
new file mode 100644
index 0000000..d246fee
--- /dev/null
+++ b/meta/recipes-sato/puzzles/files/fix-compiling-failure-with-option-g-O.patch
@@ -0,0 +1,52 @@
+gtk.c: fix compiling failure with option -g -O
+
+There were compiling failure with option -g -O
+...
+././gtk.c: In function 'configure_area':
+././gtk.c:397:2: error: 'cr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+  cairo_set_source_rgb(cr,
+  ^
+././gtk.c:384:14: note: 'cr' was declared here
+     cairo_t *cr;
+              ^
+././gtk.c: In function 'main':
+././gtk.c:2911:6: error: 'error' may be used uninitialized in this function [-Werror=maybe-uninitialized]
+      fprintf(stderr, "%s: %s\n", pname, error);
+      ^
+cc1: all warnings being treated as errors
+...
+
+Initialized pointer 'cr' and 'error' with NULL
+
+Upstream-Status: Pending
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ gtk.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gtk.c b/gtk.c
+index a2eba2c..c54bf63 100644
+--- a/gtk.c
++++ b/gtk.c
+@@ -381,7 +381,7 @@ static void clear_backing_store(frontend *fe)
+ 
+ static void setup_backing_store(frontend *fe)
+ {
+-    cairo_t *cr;
++    cairo_t *cr = NULL;
+     int i;
+ 
+     fe->pixmap = gdk_pixmap_new(fe->area->window, fe->pw, fe->ph, -1);
+@@ -2481,7 +2481,7 @@ char *fgetline(FILE *fp)
+ int main(int argc, char **argv)
+ {
+     char *pname = argv[0];
+-    char *error;
++    char *error = NULL;
+     int ngenerate = 0, print = FALSE, px = 1, py = 1;
+     int time_generation = FALSE, test_solve = FALSE, list_presets = FALSE;
+     int soln = FALSE, colour = FALSE;
+-- 
+1.9.1
+
diff --git a/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch b/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch
new file mode 100644
index 0000000..7e2c3ab
--- /dev/null
+++ b/meta/recipes-sato/puzzles/files/oh-puzzles-owl-menu.patch
@@ -0,0 +1,203 @@
+This patch enable owl menu, which is hidden in the title bar to save space on
+small screen. It has not been used for a long time, rebase needed.
+
+Upstream-Status: Inappropriate [enable feature]
+
+Index: src/gtk.c
+===================================================================
+--- src/gtk.c	(revision 22)
++++ src/gtk.c	(working copy)
+@@ -28,6 +28,8 @@
+ #include <gdk/gdkx.h>
+ #include <gdk-pixbuf/gdk-pixbuf.h>
+ 
++#include <libowl/owlwindowmenu.h>
++
+ #include <librsvg/rsvg.h>
+ 
+ #include <X11/Xlib.h>
+@@ -1237,6 +1239,7 @@
+     }
+ }
+ 
++#if 0
+ static void
+ add_widget (GtkUIManager *merge,
+ 	    GtkWidget *widget,
+@@ -1247,10 +1250,11 @@
+     gtk_box_pack_start (box, widget, FALSE, FALSE, 0);
+ 
+     toplevel = gtk_widget_get_toplevel (GTK_WIDGET (box));
+-    gtk_widget_show_all (toplevel);
+ }
++#endif
+ 
+ static GtkActionEntry toplevel_actions[] = {
++    { "Top", NULL, "" },
+     { "Game", NULL, N_("Game") },
+     { "Settings", NULL, N_("Settings") },
+     { "Help", NULL, N_("Help") },
+@@ -1303,11 +1307,13 @@
+ 			frontend *fe)
+ {
+     GString *xml;
++    GError *error = NULL;
+     gboolean presets = FALSE;
+     GSList *radio_group = NULL;
+     int i;
+ 
+-    xml = g_string_new ("<ui><menubar><placeholder name=\"TypePlaceholder\">"
++    xml = g_string_new ("<ui><menubar><menu name=\"TopMenu\" action=\"Top\">"
++			"<placeholder name=\"TypePlaceholder\">"
+ 			"<menu name=\"SettingsMenu\" action=\"Settings\">");
+ 
+     for (i = 0; i < midend_num_presets(fe->me); i++) {
+@@ -1359,8 +1365,14 @@
+ 			 "<menuitem name=\"CustomMenu\" action=\"Custom\"/>");
+     }
+     
+-    g_string_append (xml, "</menu></placeholder></menubar></ui>");
+-    gtk_ui_manager_add_ui_from_string (merge, xml->str, -1, NULL);
++    g_string_append (xml, "</menu></placeholder></menu></menubar></ui>");
++
++    gtk_ui_manager_add_ui_from_string (merge, xml->str, -1, &error);
++    if (error != NULL) {
++	g_warning ("Error adding custom: %s", error->message);
++	g_error_free (error);
++    }
++
+     g_string_free (xml, TRUE);
+ }
+ 
+@@ -1434,6 +1446,7 @@
+ new_window(char *arg, char **error)
+ {
+     frontend *fe;
++    GError *err = NULL;
+     GtkBox *vbox;
+     GtkUIManager *merge;
+     GtkActionGroup *actions;
+@@ -1496,8 +1509,6 @@
+     gtk_window_add_accel_group(GTK_WINDOW(fe->window), fe->accelgroup);
+ 
+     merge = gtk_ui_manager_new ();
+-    g_signal_connect (G_OBJECT (merge), "add_widget",
+-		      G_CALLBACK (add_widget), vbox);
+ 
+     actions = gtk_action_group_new ("PuzzleActions");
+     gtk_action_group_add_actions (actions, toplevel_actions,
+@@ -1509,22 +1520,39 @@
+ 
+     gtk_ui_manager_insert_action_group (merge, actions, 0);
+     
+-    gtk_ui_manager_add_ui_from_file (merge, DATADIR "/oh-puzzles/ui/menu.xml", NULL);
++    gtk_ui_manager_add_ui_from_file (merge, DATADIR "/oh-puzzles/ui/menu.xml", 
++				     &err);
++    if (err != NULL) {
++	g_warning ("Error making UI: %s", err->message);
++	g_error_free (err);
++	err = NULL;
++    }
+ 
+     if (thegame.can_solve) {
+-	    char *str = "<ui><menubar><menu name=\"GameMenu\" action=\"Game\">"
++	char *str = "<ui><menubar><menu name=\"TopMenu\" action=\"Top\">"
++	    "<menu name=\"GameMenu\" action=\"Game\">"
+ 	    "<placeholder name=\"SolvePlaceholder\">"
+ 	    "<separator name=\"SolveSep\"/>"
+ 	    "<menuitem name=\"SolveMenu\" action=\"Solve\"/>"
+-	    "</placeholder></menu></menubar></ui>";
++	    "</placeholder></menu></menu></menubar></ui>";
+ 
+-	gtk_ui_manager_add_ui_from_string (merge, str, -1, NULL);
++	gtk_ui_manager_add_ui_from_string (merge, str, -1, &err);
++	if (err != NULL) {
++	    g_warning ("Error adding solve. %s", err->message);
++	    g_error_free (err);
++	}
+     }
+ 
+     if ((n = midend_num_presets(fe->me)) > 0 || thegame.can_configure) {
+ 	generate_settings_menu (merge, actions, fe);
+     }
+ 
++    /* Do this so that the menu is packed now instead of in the idle loop */
++    gtk_ui_manager_ensure_update (merge);
++
++    owl_set_window_menu_item (GTK_WINDOW (fe->window),
++			      GTK_MENU_ITEM (gtk_ui_manager_get_widget (merge, "/menubar/TopMenu")));
++    
+     setup_colours (fe);
+     setup_pixbufs (fe);
+ 
+@@ -1572,7 +1600,7 @@
+                           GDK_BUTTON_RELEASE_MASK |
+ 			  GDK_BUTTON_MOTION_MASK);
+ 
+-    /* The window is shown once the menubar has been added */
++    gtk_widget_show_all (fe->window);
+     return fe;
+ }
+ 
+Index: src/menu.xml
+===================================================================
+--- src/menu.xml	(revision 22)
++++ src/menu.xml	(working copy)
+@@ -1,26 +1,25 @@
+ <ui>
+ <menubar>
+-<menu name="GameMenu" action="Game">
+-	<menuitem name="NewMenu" action="New"/>
+-	<menuitem name="RestartMenu" action="Restart"/>
+-<!--	<menuitem name="SpecificMenu" action="Specific"/> -->
+-	<menuitem name="RandomMenu" action="Random"/>
+-	<separator name="GameSep1"/>
+-	<menuitem name="LoadMenu" action="Load"/>
+-	<menuitem name="SaveMenu" action="Save"/>
+-	<separator name="GameSep2"/>
+-	<menuitem name="UndoMenu" action="Undo"/>
+-	<menuitem name="RedoMenu" action="Redo"/>
+-	<placeholder name="CopyPlaceholder"/>
+-	<placeholder name="SolvePlaceholder"/>
+-	<separator name="GameSep3"/>
+-	<menuitem name="QuitMenu" action="Quit"/>
+-</menu>
++<menu name="TopMenu" action="Top">
++	<menu name="GameMenu" action="Game">
++		<menuitem name="NewMenu" action="New"/>
++		<menuitem name="RestartMenu" action="Restart"/>
++	<!--	<menuitem name="SpecificMenu" action="Specific"/> -->
++		<menuitem name="RandomMenu" action="Random"/>
++		<separator name="GameSep1"/>
++		<menuitem name="LoadMenu" action="Load"/>
++		<menuitem name="SaveMenu" action="Save"/>
++		<separator name="GameSep2"/>
++		<menuitem name="UndoMenu" action="Undo"/>
++		<menuitem name="RedoMenu" action="Redo"/>
++		<placeholder name="CopyPlaceholder"/>
++		<placeholder name="SolvePlaceholder"/>
++	</menu>
+ 
+-<placeholder name="TypePlaceholder"/>
+-
+-<menu name="HelpMenu" action="Help">
++	<placeholder name="TypePlaceholder"/>
+ 	<menuitem name="AboutMenu" action="About"/>
++	<menuitem name="QuitMenu" action="Quit"/>
++
+ </menu>
+ </menubar>
+ </ui>
+Index: src/Makefile.am
+===================================================================
+--- src/Makefile.am	(revision 22)
++++ src/Makefile.am	(working copy)
+@@ -10,7 +10,7 @@
+ 	lightup loopy map mines net netslide pattern pegs rect samegame \
+ 	sixteen slant solo tents twiddle untangle
+ 
+-libpuzzles_la_LIBADD = $(PUZZLES_LIBS)
++libpuzzles_la_LIBADD = $(PUZZLES_LIBS) -lowl
+ libpuzzles_la_SOURCES = combi.c \
+ 			configuration.c \
+ 			drawing.c \
diff --git a/meta/recipes-sato/puzzles/oh-puzzles_git.bb b/meta/recipes-sato/puzzles/oh-puzzles_git.bb
new file mode 100644
index 0000000..36cd2cc
--- /dev/null
+++ b/meta/recipes-sato/puzzles/oh-puzzles_git.bb
@@ -0,0 +1,74 @@
+SUMMARY = "Portable Puzzle Collection"
+HOMEPAGE = "http://o-hand.com/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=f56ec6772dd1c7c367067bbea8ea1675 \
+                    file://src/tree234.h;endline=28;md5=a188e6d250430ca094a54a82f48472a7 \
+                    file://src/tree234.c;endline=28;md5=b4feb1976feebf8f1379093ed52f2945"
+
+SECTION = "x11"
+DEPENDS = "gtk+ gconf intltool-native librsvg"
+
+# libowl requires x11 in DISTRO_FEATURES
+DEPENDS_append_poky = " ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'libowl', '', d)}"
+
+# Requires gdk/gdkx.h which is provided by gtk when x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRCREV = "92f1a20e4b72eed7a35b00984d9793b51dc2fb3b"
+PV = "0.2+git${SRCPV}"
+PR = "r10"
+
+SRC_URI = "git://git.yoctoproject.org/${BPN}"
+SRC_URI_append_poky = " file://oh-puzzles-owl-menu.patch;striplevel=0 "
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+bindir = "/usr/games"
+
+EXTRA_OEMAKE += "GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1"
+
+do_install_append () {
+    install -d ${D}/${datadir}/applications/
+
+    cd ${D}/${prefix}/games
+    for prog in *; do
+	if [ -x $prog ]; then
+            # Convert prog to Title Case
+            title=$(echo $prog | sed 's/\(^\| \)./\U&/g')
+	    echo "making ${D}/${datadir}/applications/$prog.desktop"
+	    cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
+[Desktop Entry]
+Name=$title
+Exec=${prefix}/games/$prog
+Icon=applications-games
+Terminal=false
+Type=Application
+Categories=Game;
+StartupNotify=true
+X-MB-SingleInstance=true
+Comment=Play $title.
+STOP
+        fi
+    done
+}
+
+PACKAGES += "${PN}-extra"
+RDEPENDS_${PN}-extra += "oh-puzzles"
+
+FILES_${PN} = "/usr/share/pixmaps /usr/share/oh-puzzles/"
+FILES_${PN}-dbg += "/usr/games/.debug/*"
+FILES_${PN}-extra = "/usr/games/ /usr/share/applications /etc/gconf/schemas"
+
+python __anonymous () {
+    var = bb.data.expand("FILES_${PN}", d, 1)
+    data = d.getVar(var, True)
+    for name in ("bridges", "fifteen", "inertia", "map", "samegame", "slant"):
+        data = data + " /usr/games/%s" % name
+        data = data + " /usr/share/applications/%s.desktop" % name
+        data = data + " /etc/gconf/schemas/%s.schemas" % name
+    d.setVar(var, data)
+}
diff --git a/meta/recipes-sato/puzzles/puzzles_git.bb b/meta/recipes-sato/puzzles/puzzles_git.bb
new file mode 100644
index 0000000..95826c1
--- /dev/null
+++ b/meta/recipes-sato/puzzles/puzzles_git.bb
@@ -0,0 +1,61 @@
+SUMMARY = "Simon Tatham's Portable Puzzle Collection"
+HOMEPAGE = "http://www.chiark.greenend.org.uk/~sgtatham/puzzles/"
+
+DEPENDS = "gtk+ libxt"
+
+# The libxt requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=33bcd4bce8f3c197f2aefbdbd2d299bc"
+
+SRC_URI = "git://git.tartarus.org/simon/puzzles.git \
+           file://fix-compiling-failure-with-option-g-O.patch \
+           file://0001-Use-labs-instead-of-abs.patch \
+"
+SRCREV = "c296301a06ce49b87c954c9d15452521dfeddf1a"
+PE = "1"
+PV = "0.0+git${SRCPV}"
+
+S = "${WORKDIR}/git"
+
+inherit autotools-brokensep distro_features_check
+
+do_configure_prepend () {
+    ./mkfiles.pl
+}
+
+FILES_${PN} = "${prefix}/bin/* ${datadir}/applications/*"
+FILES_${PN}-dbg += "${prefix}/bin/.debug"
+
+do_install () {
+    rm -rf ${D}/*
+    export prefix=${D}
+    export DESTDIR=${D}
+    install -d ${D}/${prefix}/bin/
+    oe_runmake install
+
+
+    install -d ${D}/${datadir}/applications/
+
+    # Create desktop shortcuts
+    cd ${D}/${prefix}/bin
+    for prog in *; do
+	if [ -x $prog ]; then
+            # Convert prog to Title Case
+            title=$(echo $prog | sed 's/\(^\| \)./\U&/g')
+	    echo "making ${D}/${datadir}/applications/$prog.desktop"
+	    cat <<STOP > ${D}/${datadir}/applications/$prog.desktop
+[Desktop Entry]
+Name=$title
+Exec=${prefix}/bin/$prog
+Icon=applications-games
+Terminal=false
+Type=Application
+Categories=Game;
+StartupNotify=true
+X-MB-SingleInstance=true
+STOP
+        fi
+    done
+}
diff --git a/meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc b/meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc
new file mode 100644
index 0000000..04a43c0
--- /dev/null
+++ b/meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc
@@ -0,0 +1,58 @@
+SECTION = "x11/utils"
+SUMMARY = "rxvt terminal clone supporting unicode"
+DESCRIPTION = "rxvt-unicode is a clone of the well known \
+terminal emulator rxvt, modified to store text in Unicode \
+(either UCS-2 or UCS-4) and to use locale-correct input and \
+output. It also supports mixing multiple fonts at the \
+same time, including Xft fonts."
+DEPENDS = "virtual/libx11 libxt libxft gdk-pixbuf"
+
+SRC_URI = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${PV}.tar.bz2 \
+	   file://xwc.patch \
+	   file://rxvt.desktop \
+	   file://rxvt.png"
+
+inherit autotools update-alternatives
+
+PROVIDES = "virtual/x-terminal-emulator"
+ALTERNATIVE_${PN} = "x-terminal-emulator"
+ALTERNATIVE_TARGET[x-terminal-emulator] = "${bindir}/rxvt"
+
+CFLAGS_append = " -fpermissive"
+
+EXTRA_OECONF = "--enable-xim \
+		--enable-utmp --enable-wtmp --enable-lastlog \
+		--with-term=rxvt --enable-keepscrolling \
+		--enable-xft --with-name=rxvt --enable-frills \
+		--enable-swapscreen --enable-transparency \
+		--with-codesets=eu --enable-pointer-blank \
+		--enable-text-blink --enable-rxvt-scroll \
+		--enable-combining --disable-perl \
+		--with-x=${STAGING_DIR_HOST}${prefix}"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[startup] = "--enable-startup-notification,--disable-startup-notification,startup-notification,"
+
+do_configure_prepend () {
+	if [ ! -e ${S}/acinclude.m4 ]; then
+		cp ${S}/aclocal.m4 ${S}/acinclude.m4
+	fi
+}
+
+do_compile_prepend () {
+	echo '#define UTMP_FILE "${localstatedir}/run/utmp"' >> config.h
+	echo '#define WTMP_FILE "${localstatedir}/log/wtmp"' >> config.h
+	echo '#define LASTLOG_FILE "${localstatedir}/log/lastlog"' >> config.h
+	echo '#define HAVE_XLOCALE 1' >> config.h
+}
+
+do_install_append () {
+	install -d ${D}/${datadir}
+	install -d ${D}/${datadir}/applications
+	install -d ${D}/${datadir}/pixmaps/
+
+	install -m 0644 ${WORKDIR}/rxvt.png ${D}/${datadir}/pixmaps
+	install -m 0644 ${WORKDIR}/rxvt.desktop ${D}/${datadir}/applications
+}
+
+FILES_${PN} += "${datadir}/applications/rxvt.desktop ${datadir}/pixmaps/rxvt.png"
diff --git a/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.desktop b/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.desktop
new file mode 100644
index 0000000..882ea41
--- /dev/null
+++ b/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Version=1.0
+Name=Terminal
+Comment=A unicode capable rxvt clone
+Exec=rxvt
+Icon=terminal
+Terminal=false
+Type=Application
+Categories=Utility;TerminalEmulator;
diff --git a/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.png b/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.png
new file mode 100644
index 0000000..e56fa2e
--- /dev/null
+++ b/meta/recipes-sato/rxvt-unicode/rxvt-unicode/rxvt.png
Binary files differ
diff --git a/meta/recipes-sato/rxvt-unicode/rxvt-unicode/xwc.patch b/meta/recipes-sato/rxvt-unicode/rxvt-unicode/xwc.patch
new file mode 100644
index 0000000..16efeef
--- /dev/null
+++ b/meta/recipes-sato/rxvt-unicode/rxvt-unicode/xwc.patch
@@ -0,0 +1,26 @@
+Upstream-Status: Pending
+
+diff -ruN rxvt-unicode-9.10-orig//src/screen.C rxvt-unicode-9.10/src/screen.C
+--- rxvt-unicode-9.10-orig//src/screen.C	2011-04-19 13:34:01.327664984 +0800
++++ rxvt-unicode-9.10/src/screen.C	2011-04-19 13:34:47.037665001 +0800
+@@ -3152,7 +3152,7 @@
+       return false;
+     }
+ 
+-#if 0
++#if HAVE_XWC
+   XTextProperty ct;
+ 
+   if (XwcTextListToTextProperty (dpy, &selection.text, 1, XStringStyle, &ct) >= 0)
+@@ -3734,9 +3734,11 @@
+         }
+       else
+ #endif
++#ifdef HAVE_XWC
+       if (XwcTextListToTextProperty (dpy, &cl, 1, (XICCEncodingStyle) style, &ct) >= 0)
+         freect = 1;
+       else
++#endif
+         {
+           /* if we failed to convert then send it raw */
+           ct.value = (unsigned char *)cl;
diff --git a/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb b/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb
new file mode 100644
index 0000000..3480ec7
--- /dev/null
+++ b/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.20.bb
@@ -0,0 +1,8 @@
+require rxvt-unicode.inc
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://src/main.C;beginline=1;endline=31;md5=775485398a09fa7aee6f90464af88432"
+
+SRC_URI[md5sum] = "4a5b823f08d21036f94a6c51e94d025b"
+SRC_URI[sha256sum] = "e73e13fe64b59fd3c8e6e20c00f149d388741f141b8155e4700d3ed40aa94b4e"
diff --git a/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.21.bb b/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.21.bb
new file mode 100644
index 0000000..7049495
--- /dev/null
+++ b/meta/recipes-sato/rxvt-unicode/rxvt-unicode_9.21.bb
@@ -0,0 +1,8 @@
+require rxvt-unicode.inc
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://src/main.C;beginline=1;endline=31;md5=7dac0395806570856e037f98aba8513b"
+
+SRC_URI[md5sum] = "a9a06c608258c5fd247c3725d8f44582"
+SRC_URI[sha256sum] = "75270ed72bc5895a64a1d7392bf45a622204192371c3965bd3dd978dc088956b"
diff --git a/meta/recipes-sato/sato-icon-theme/sato-icon-theme/0001-Inherit-the-GNOME-icon-theme.patch b/meta/recipes-sato/sato-icon-theme/sato-icon-theme/0001-Inherit-the-GNOME-icon-theme.patch
new file mode 100644
index 0000000..2c176ee
--- /dev/null
+++ b/meta/recipes-sato/sato-icon-theme/sato-icon-theme/0001-Inherit-the-GNOME-icon-theme.patch
@@ -0,0 +1,31 @@
+From b9f02989310a3c920589f1aa646bcbf16b2572a0 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@intel.com>
+Date: Wed, 13 Jun 2012 11:07:33 +0100
+Subject: [PATCH] Inherit the GNOME icon theme
+
+If the GNOME icon theme isn't installed this is a no-op, but if it is then
+you'll get fallback from Sato to GNOME for icons that are not in Sato.
+
+As applications that use the full GNOME icon theme depend on gnome-icon-theme,
+this just works.
+
+Upstream-Status: Backport
+---
+ index.theme |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/index.theme b/index.theme
+index c4b03a7..688fbbf 100644
+--- a/index.theme
++++ b/index.theme
+@@ -1,6 +1,7 @@
+ [Icon Theme]
+ Name=Sato
+ Comment=Sato icon theme
++Inherits=Adwaita
+ 
+ Directories=16x16/apps,16x16/status,16x16/stock,16x16/places,16x16/mimetypes,16x16/devices,16x16/actions,22x22/apps,22x22/status,22x22/stock,22x22/places,22x22/mimetypes,22x22/devices,22x22/actions,32x32/apps,32x32/status,32x32/stock,32x32/places,32x32/mimetypes,32x32/devices,32x32/actions,48x48/apps,48x48/status,48x48/stock,48x48/places,48x48/mimetypes,48x48/devices,48x48/actions,64x64/apps,64x64/status,64x64/stock,64x64/places,64x64/mimetypes,64x64/devices,64x64/actions,
+ 
+-- 
+1.7.10
+
diff --git a/meta/recipes-sato/sato-icon-theme/sato-icon-theme_0.4.1.bb b/meta/recipes-sato/sato-icon-theme/sato-icon-theme_0.4.1.bb
new file mode 100644
index 0000000..ced735f
--- /dev/null
+++ b/meta/recipes-sato/sato-icon-theme/sato-icon-theme_0.4.1.bb
@@ -0,0 +1,40 @@
+SUMMARY = "Sato icon theme"
+HOMEPAGE = "http://www.o-hand.com"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "CC-BY-SA-3.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=56a830bbe6e4697fe6cbbae01bb7c2b2"
+SECTION = "x11"
+
+PR = "r6"
+
+DEPENDS = "icon-naming-utils-native libxml-simple-perl-native"
+
+SRC_URI = "http://pokylinux.org/releases/sato/${BPN}-${PV}.tar.gz \
+           file://0001-Inherit-the-GNOME-icon-theme.patch"
+
+SRC_URI[md5sum] = "86a847f3128a43a9cf23b7029a656f50"
+SRC_URI[sha256sum] = "0b0a2807a6a96918ac799a86094ec3e8e2c892be0fd679a4232c2a77f2f61732"
+
+inherit autotools pkgconfig allarch gtk-icon-cache perlnative
+
+# The configure script uses pkg-config to find native binaries to execute, so
+# tell it to use our pkg-config-native wrapper.
+export PKG_CONFIG = "pkg-config-native"
+
+FILES_${PN} += "${datadir}/icons/Sato"
+
+do_install_append() {
+	find ${D}${datadir}/icons/Sato/ -maxdepth 1 -type d -exec ln -s preferences-system.png {}/apps/preferences-desktop.png \;
+	find ${D}${datadir}/icons/Sato/ -maxdepth 1 -type d -exec ln -s file-manager.png {}/apps/system-file-manager.png \;
+	find ${D}${datadir}/icons/Sato/ -maxdepth 1 -type d -exec ln -s ../apps/terminal.png {}/places/computer.png \;
+}
+
+# Explictly setting "Sato" as the default icon theme to avoid flickering from
+# the desktop and settings daemon racing.  This shouldn't be done here but in the sato image
+pkg_postinst_${PN} () {
+    mkdir -p $D/etc/gtk-2.0
+
+    grep -s -q -e ^gtk-icon-theme-name.*\"Sato\" $D/etc/gtk-2.0/gtkrc || \
+        echo 'gtk-icon-theme-name = "Sato"' >> $D/etc/gtk-2.0/gtkrc
+}
diff --git a/meta/recipes-sato/sato-screenshot/sato-screenshot_git.bb b/meta/recipes-sato/sato-screenshot/sato-screenshot_git.bb
new file mode 100644
index 0000000..8794032
--- /dev/null
+++ b/meta/recipes-sato/sato-screenshot/sato-screenshot_git.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Ultra-simple screen capture utility, aimed at handheld devices"
+HOMEPAGE = "http://www.o-hand.com"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+
+LICENSE = "GPLv2 & GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://main.c;endline=9;md5=023e14d6404d0a961eb97cbd011fc141 \
+                    file://screenshot-ui.h;endline=9;md5=638d9ffa83e9325a36df224166ed6ad0"
+
+DEPENDS = "matchbox-panel-2"
+SRCREV = "3a9688e8a01b63a78f402b4e7c0b8b005fcdfa29"
+PV = "0.1+git${SRCPV}"
+PR = "r2"
+
+SRC_URI = "git://git.yoctoproject.org/screenshot"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig distro_features_check
+
+FILES_${PN} += "${libdir}/matchbox-panel/*.so"
+FILES_${PN}-dbg += "${libdir}/matchbox-panel/.debug"
+
+do_install_append () {
+	rm ${D}${libdir}/matchbox-panel/*.la
+}
+
+# The matchbox-panel-2 requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
diff --git a/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh b/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh
new file mode 100644
index 0000000..9537413
--- /dev/null
+++ b/meta/recipes-sato/settings-daemon/files/70settings-daemon.sh
@@ -0,0 +1 @@
+/usr/bin/settings-daemon &
diff --git a/meta/recipes-sato/settings-daemon/files/addsoundkeys.patch b/meta/recipes-sato/settings-daemon/files/addsoundkeys.patch
new file mode 100644
index 0000000..baf06d6
--- /dev/null
+++ b/meta/recipes-sato/settings-daemon/files/addsoundkeys.patch
@@ -0,0 +1,49 @@
+Upstream-Status: Pending
+
+Index: settings-daemon/settings-daemon.c
+===================================================================
+--- settings-daemon.orig/settings-daemon.c	2009-05-22 14:57:05.000000000 +0100
++++ settings-daemon/settings-daemon.c	2009-05-22 14:58:22.000000000 +0100
+@@ -187,6 +187,10 @@
+     GCONF_VALUE_STRING, translate_string_string },
+   { "/desktop/poky/interface/gtk_color_scheme", "Gtk/ColorScheme",
+     GCONF_VALUE_STRING, translate_string_string },
++  { "/desktop/gnome/sound/theme_name", "Net/SoundThemeName",
++    GCONF_VALUE_STRING,   translate_string_string },
++  { "/desktop/gnome/sound/event_sounds", "Net/EnableEventSounds" ,
++    GCONF_VALUE_BOOL,     translate_bool_int },
+ };
+ 
+ static const TranslationEntry*
+Index: settings-daemon/settings-daemon.schemas
+===================================================================
+--- settings-daemon.orig/settings-daemon.schemas	2009-05-22 15:49:17.000000000 +0100
++++ settings-daemon/settings-daemon.schemas	2009-05-22 15:51:31.000000000 +0100
+@@ -196,6 +196,27 @@
+     </locale>
+   </schema>
+ 
++  <schema>
++    <key>/schemas/desktop/gnome/sound/theme_name</key>
++    <applyto>/desktop/gnome/sound/theme_name</applyto>
++    <owner>gnome</owner>
++    <type>string</type>
++    <default>freedesktop</default>
++    <locale name="C">
++      <short>Sound Theme Name</short>
++    </locale>
++  </schema>
++
++  <schema>
++    <key>/schemas/desktop/gnome/sound/event_sounds</key>
++    <applyto>/desktop/gnome/sound/event_sounds</applyto>
++    <owner>gnome</owner>
++    <type>bool</type>
++    <default>true</default>
++    <locale name="C">
++      <short>Enable Sound Events</short>
++    </locale>
++  </schema>
+ 
+ </schemalist>
+ </gconfschemafile>
diff --git a/meta/recipes-sato/settings-daemon/files/dso_linking_change_build_fix.patch b/meta/recipes-sato/settings-daemon/files/dso_linking_change_build_fix.patch
new file mode 100644
index 0000000..5943744
--- /dev/null
+++ b/meta/recipes-sato/settings-daemon/files/dso_linking_change_build_fix.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [configuration]
+
+after gcc linking has changed, all the libraries must be explicitely specified to for linking. 
+This patch avoids this linking error:
+
+| make  all-am^M
+| make[1]: Entering directory `/disk0/pokybuild/build1/tmp/work/i586-poky-linux/settings-daemon-0.0+svnr2059-r3/settings-daemon'^M
+| ccache i586-poky-linux-gcc -march=i586 --sysroot=/disk0/pokybuild/build1/tmp/sysroots/i586-poky-linux -Wall -fexpensive-optimizations -fomit-frame-pointer -frename-registers -O2 -ggdb -feliminate-unused-debug-types  -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o settings-daemon settings_daemon-xsettings-common.o settings_daemon-xsettings-manager.o settings_daemon-settings-daemon.o -pthread -lgconf-2 -ldbus-glib-1 -ldbus-1 -lpthread -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0^M
+| /disk0/pokybuild/build1/tmp/sysroots/x86_64-linux/usr/libexec/i586-poky-linux/gcc/i586-poky-linux/4.5.1/ld: *^A: invalid DSO for symbol `XCreateSimpleWindow' definition^M
+| /disk0/pokybuild/build1/tmp/sysroots/i586-poky-linux/usr/lib/libX11.so.6: could not read symbols: Bad value^M
+| collect2: ld returned 1 exit status^M
+| make[1]: *** [settings-daemon] Error 1^M
+| make[1]: Leaving directory `/disk0/pokybuild/build1/tmp/work/i586-poky-linux/settings-daemon-0.0+svnr2059-r3/settings-daemon'^M
+| make: *** [all] Error 2^M
+
+Nitin A Kamble <nitin.a.kamble@intel.com>
+Date: 2011/01/11
+
+Index: settings-daemon/configure.ac
+===================================================================
+--- settings-daemon.orig/configure.ac
++++ settings-daemon/configure.ac
+@@ -14,7 +14,7 @@ AC_PROG_CC
+ 
+ 
+ dnl TODO: make gconf optional
+-PKG_CHECK_MODULES(APP, [gconf-2.0 gdk-x11-2.0])
++PKG_CHECK_MODULES(APP, [gconf-2.0 gdk-x11-2.0 x11])
+ 
+ 
+ AC_SUBST(APP_CFLAGS)
diff --git a/meta/recipes-sato/settings-daemon/settings-daemon_git.bb b/meta/recipes-sato/settings-daemon/settings-daemon_git.bb
new file mode 100644
index 0000000..c061553
--- /dev/null
+++ b/meta/recipes-sato/settings-daemon/settings-daemon_git.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Provides a bridge between gconf and xsettings"
+HOMEPAGE = "http://svn.o-hand.com/view/matchbox/trunk/settings-daemon/"
+BUGTRACKER = "http://bugzilla.yoctoproject.org/"
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://xsettings-manager.h;endline=22;md5=7cfac9d2d4dc3694cc7eb605cf32a69b \
+                    file://xsettings-common.h;endline=22;md5=7cfac9d2d4dc3694cc7eb605cf32a69b"
+DEPENDS = "gconf glib-2.0 gtk+"
+SECTION = "x11"
+SRCREV = "9a99528b02255450db81176abd9bbcc1dab9a4c1"
+PV = "0.0+git${SRCPV}"
+
+
+SRC_URI = "git://git.yoctoproject.org/xsettings-daemon \
+           file://addsoundkeys.patch;apply=yes \
+           file://70settings-daemon.sh \
+           file://dso_linking_change_build_fix.patch"
+
+S = "${WORKDIR}/git"
+
+inherit autotools pkgconfig gconf distro_features_check
+
+FILES_${PN} = 	"${bindir}/* ${sysconfdir}"
+
+# Requires gdk-x11-2.0 which is provided by gtk when x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+do_install_append () {
+	install -d ${D}/${sysconfdir}/X11/Xsession.d
+	install -m 755 ${WORKDIR}/70settings-daemon.sh ${D}/${sysconfdir}/X11/Xsession.d/
+}
diff --git a/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb b/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb
new file mode 100644
index 0000000..ebdd6d1
--- /dev/null
+++ b/meta/recipes-sato/shutdown-desktop/shutdown-desktop.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Provides an icon to shut down the system cleanly"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://shutdown.desktop"
+
+PR = "r1"
+
+S = "${WORKDIR}"
+
+do_install() {
+	install -d ${D}${datadir}/applications
+	install -m 0644 shutdown.desktop ${D}${datadir}/applications/
+
+	sed -i ${D}${datadir}/applications/shutdown.desktop -e 's#^Exec=\(.*\)#Exec=${base_sbindir}/\1#'
+}
+
+pkg_postinst_${PN} () {
+    grep -q qemuarm $D${sysconfdir}/hostname && \
+        sed -i $D${datadir}/applications/shutdown.desktop -e 's#^Exec=\(.*\)/halt#Exec=\1/reboot#' \
+        || true
+}
+
+inherit allarch
diff --git a/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop b/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop
new file mode 100644
index 0000000..662659a
--- /dev/null
+++ b/meta/recipes-sato/shutdown-desktop/shutdown-desktop/shutdown.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=Application
+Name=Shutdown
+Comment=Close down the machine safely
+Exec=poweroff
+Icon=system-shutdown
+Terminal=false
+Categories=Utility;
+StartupNotify=true
diff --git a/meta/recipes-sato/webkit/files/0001-This-patch-fixes-a-command-line-that-is-too-long-ove.patch b/meta/recipes-sato/webkit/files/0001-This-patch-fixes-a-command-line-that-is-too-long-ove.patch
new file mode 100644
index 0000000..28b3420
--- /dev/null
+++ b/meta/recipes-sato/webkit/files/0001-This-patch-fixes-a-command-line-that-is-too-long-ove.patch
@@ -0,0 +1,91 @@
+From 22d5063c551d3c08c0a4ad8b80e08b793d53093d Mon Sep 17 00:00:00 2001
+From: Alexander Kanavin <alex.kanavin@gmail.com>
+Date: Thu, 10 Sep 2015 16:23:27 +0300
+Subject: [PATCH] This patch fixes a command line that is too long (over 100K!)
+ and is rejected by /bin/sh.
+
+Upstream-Status: Backport [should appear in 2.10, http://trac.webkit.org/changeset/184856]
+Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
+
+---
+ Source/WebKit2/PlatformGTK.cmake                   | 11 ++++++-----
+ Tools/gtk/generate-inspector-gresource-manifest.py | 16 ++++++++++++----
+ 2 files changed, 18 insertions(+), 9 deletions(-)
+
+diff --git a/Source/WebKit2/PlatformGTK.cmake b/Source/WebKit2/PlatformGTK.cmake
+index a13af7c..058c241 100644
+--- a/Source/WebKit2/PlatformGTK.cmake
++++ b/Source/WebKit2/PlatformGTK.cmake
+@@ -408,7 +408,7 @@ set(WebKit2WebExtension_INSTALLED_HEADERS
+     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h
+ )
+ 
+-file(GLOB InspectorFiles
++set(InspectorFiles
+     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/*.html
+     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Base/*.js
+     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Controllers/*.css
+@@ -423,13 +423,14 @@ file(GLOB InspectorFiles
+     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Views/*.js
+     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.png
+     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/UserInterface/Images/gtk/*.svg
+-)
+-
+-list(APPEND InspectorFiles
+     ${CMAKE_SOURCE_DIR}/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
+     ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js
+ )
+ 
++file(GLOB InspectorFilesDependencies
++    ${InspectorFiles}
++)
++
+ # This is necessary because of a conflict between the GTK+ API WebKitVersion.h and one generated by WebCore.
+ list(INSERT WebKit2_INCLUDE_DIRECTORIES 0
+     "${FORWARDING_HEADERS_WEBKIT2GTK_DIR}"
+@@ -564,7 +565,7 @@ add_custom_command(
+ 
+ add_custom_command(
+     OUTPUT ${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml
+-    DEPENDS ${InspectorFiles}
++    DEPENDS ${InspectorFilesDependencies}
+             ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py
+     COMMAND ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py --output=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml ${InspectorFiles}
+     VERBATIM
+diff --git a/Tools/gtk/generate-inspector-gresource-manifest.py b/Tools/gtk/generate-inspector-gresource-manifest.py
+index 0687c4c..03060cf 100755
+--- a/Tools/gtk/generate-inspector-gresource-manifest.py
++++ b/Tools/gtk/generate-inspector-gresource-manifest.py
+@@ -16,6 +16,7 @@
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ 
+ import argparse
++import glob
+ import os
+ import sys
+ 
+@@ -26,10 +27,17 @@ BASE_DIR = 'WebInspectorUI/'
+ def get_filenames(args):
+     filenames = []
+ 
+-    for filename in args:
+-        base_dir_index = filename.rfind(BASE_DIR)
+-        if base_dir_index != -1:
+-            filenames.append(filename[base_dir_index + len(BASE_DIR):])
++    for pattern in args:
++        paths = glob.glob(pattern)
++        for filename in paths:
++            base_dir_index = filename.rfind(BASE_DIR)
++            if base_dir_index != -1:
++                name = filename[base_dir_index + len(BASE_DIR):]
++                # The result should use forward slashes, thus make sure any os-specific
++                # separator, added by the glob.glob() call, is properly replaced
++                if os.sep != '/':
++                    name = name.replace(os.sep, '/')
++                filenames.append(name)
+     return filenames
+ 
+ 
+-- 
+2.1.4
+
diff --git a/meta/recipes-sato/webkit/webkitgtk/gcc5.patch b/meta/recipes-sato/webkit/webkitgtk/gcc5.patch
new file mode 100644
index 0000000..5951a81
--- /dev/null
+++ b/meta/recipes-sato/webkit/webkitgtk/gcc5.patch
@@ -0,0 +1,26 @@
+JSObject: Create explicit instantiation of putByIndexBeyondVectorLengthWithoutAttributes
+
+Reason for change: newer gcc might optimize away the templates
+and they wont be available for other .cpp files to use as these
+are used in a different .cpp we need to tell compiler to explicitly
+instantiate them.
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: webkitgtk-2.8.5/Source/JavaScriptCore/runtime/JSObject.cpp
+===================================================================
+--- webkitgtk-2.8.5.orig/Source/JavaScriptCore/runtime/JSObject.cpp
++++ webkitgtk-2.8.5/Source/JavaScriptCore/runtime/JSObject.cpp
+@@ -1965,6 +1965,10 @@ void JSObject::putByIndexBeyondVectorLen
+     }
+ }
+ 
++template void JSObject::putByIndexBeyondVectorLengthWithoutAttributes<Int32Shape>(ExecState* exec, unsigned i, JSValue value);
++template void JSObject::putByIndexBeyondVectorLengthWithoutAttributes<DoubleShape>(ExecState* exec, unsigned i, JSValue value);
++template void JSObject::putByIndexBeyondVectorLengthWithoutAttributes<ContiguousShape>(ExecState* exec, unsigned i, JSValue value);
++
+ void JSObject::putByIndexBeyondVectorLengthWithArrayStorage(ExecState* exec, unsigned i, JSValue value, bool shouldThrow, ArrayStorage* storage)
+ {
+     VM& vm = exec->vm();
diff --git a/meta/recipes-sato/webkit/webkitgtk_2.8.5.bb b/meta/recipes-sato/webkit/webkitgtk_2.8.5.bb
new file mode 100644
index 0000000..82d670d
--- /dev/null
+++ b/meta/recipes-sato/webkit/webkitgtk_2.8.5.bb
@@ -0,0 +1,58 @@
+SUMMARY = "WebKit web rendering engine for the GTK+ platform"
+HOMEPAGE = "http://www.webkitgtk.org/"
+BUGTRACKER = "http://bugs.webkit.org/"
+
+LICENSE = "BSD & LGPLv2+"
+LIC_FILES_CHKSUM = "file://Source/JavaScriptCore/COPYING.LIB;md5=d0c6d6397a5d84286dda758da57bd691 \
+                    file://Source/WebKit/LICENSE;md5=4646f90082c40bcf298c285f8bab0b12 \
+                    file://Source/WebCore/LICENSE-APPLE;md5=4646f90082c40bcf298c285f8bab0b12 \
+		    file://Source/WebCore/LICENSE-LGPL-2;md5=36357ffde2b64ae177b2494445b79d21 \
+		    file://Source/WebCore/LICENSE-LGPL-2.1;md5=a778a33ef338abbaf8b8a7c36b6eec80 \
+		   "
+
+SRC_URI = "\
+  http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \
+  file://0001-This-patch-fixes-a-command-line-that-is-too-long-ove.patch \
+  file://gcc5.patch \
+  "
+SRC_URI[md5sum] = "df79991848a5096d3a75289ebce547ae"
+SRC_URI[sha256sum] = "3d1f0c534935f43fd74df90f2648fcee672d60f1f57a30fa557a77891ae04d20"
+
+inherit cmake lib_package pkgconfig perlnative pythonnative
+
+DEPENDS = "zlib enchant libsoup-2.4 curl libxml2 cairo libxslt libxt libidn gnutls \
+           gtk+ gtk+3 gstreamer1.0 gstreamer1.0-plugins-base flex-native gperf-native sqlite3 \
+	   pango icu bison-native gnome-common gawk intltool-native libwebp \
+	   atk udev harfbuzz jpeg libpng pulseaudio librsvg libtheora libvorbis libxcomposite libxtst \
+	   ruby-native libsecret libnotify gstreamer1.0-plugins-bad \
+          "
+DEPENDS += " ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virtual/libgl', '', d)}"
+
+EXTRA_OECMAKE = " \
+		-DPORT=GTK \
+		-DCMAKE_BUILD_TYPE=Release \
+		-DENABLE_INTROSPECTION=False \
+		-DENABLE_MINIBROWSER=True \
+	        ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '-DENABLE_WEBGL=True', '-DENABLE_WEBGL=False', d)} \
+		"
+
+# Javascript JIT is not supported on powerpc
+EXTRA_OECMAKE_append_powerpc = " -DENABLE_JIT=False "
+EXTRA_OECMAKE_append_powerpc64 = " -DENABLE_JIT=False "
+
+# ARM JIT code does not build on ARMv5/6 anymore, apparently they test only on v7 onwards
+EXTRA_OECMAKE_append_armv5 = " -DENABLE_JIT=False "
+EXTRA_OECMAKE_append_armv6 = " -DENABLE_JIT=False "
+
+# binutils 2.25.1 has a bug on aarch64:
+# https://sourceware.org/bugzilla/show_bug.cgi?id=18430
+EXTRA_OECMAKE_append_aarch64 = " -DUSE_LD_GOLD=False "
+
+# JIT not supported on MIPS either
+EXTRA_OECMAKE_append_mips = " -DENABLE_JIT=False "
+EXTRA_OECMAKE_append_mips64 = " -DENABLE_JIT=False "
+
+FILES_${PN} += "${libdir}/webkit2gtk-4.0/injected-bundle/libwebkit2gtkinjectedbundle.so"
+FILES_${PN}-dbg += "${libdir}/webkit2gtk-4.0/injected-bundle/.debug/libwebkit2gtkinjectedbundle.so"
+FILES_${PN}-dbg += "${libdir}/webkitgtk/webkit2gtk-4.0/.debug/*"
+
diff --git a/meta/recipes-support/apr/apr-util/configfix.patch b/meta/recipes-support/apr/apr-util/configfix.patch
new file mode 100644
index 0000000..dbb1148
--- /dev/null
+++ b/meta/recipes-support/apr/apr-util/configfix.patch
@@ -0,0 +1,51 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: apr-util-1.3.4/apu-config.in
+===================================================================
+--- apr-util-1.3.4.orig/apu-config.in	2009-01-12 17:08:06.000000000 +0000
++++ apr-util-1.3.4/apu-config.in	2009-01-12 17:09:00.000000000 +0000
+@@ -134,14 +134,7 @@
+     exit 0
+     ;;
+     --includes)
+-    if test "$location" = "installed"; then
+         flags="$flags -I$includedir $INCLUDES"
+-    elif test "$location" = "source"; then
+-        flags="$flags -I$APU_SOURCE_DIR/include $INCLUDES"
+-    else
+-        # this is for VPATH builds
+-        flags="$flags -I$APU_BUILD_DIR/include -I$APU_SOURCE_DIR/include $INCLUDES"
+-    fi
+     ;;
+     --ldflags)
+     flags="$flags $LDFLAGS"
+@@ -155,28 +148,10 @@
+     exit 0
+     ;;
+     --link-ld)
+-    if test "$location" = "installed"; then
+-        ### avoid using -L if libdir is a "standard" location like /usr/lib
+         flags="$flags -L$libdir -l$APRUTIL_LIBNAME"
+-    else
+-        flags="$flags -L$APU_BUILD_DIR -l$APRUTIL_LIBNAME"
+-    fi
+     ;;
+     --link-libtool)
+-    # If the LA_FILE exists where we think it should be, use it.  If we're
+-    # installed and the LA_FILE does not exist, assume to use -L/-l
+-    # (the LA_FILE may not have been installed).  If we're building ourselves,
+-    # we'll assume that at some point the .la file be created.
+-    if test -f "$LA_FILE"; then
+-        flags="$flags $LA_FILE"
+-    elif test "$location" = "installed"; then
+-        ### avoid using -L if libdir is a "standard" location like /usr/lib
+-        # Since the user is specifying they are linking with libtool, we
+-        # *know* that -R will be recognized by libtool.
+-        flags="$flags -L$libdir -R$libdir -l$APRUTIL_LIBNAME"
+-    else
+-        flags="$flags $LA_FILE"
+-    fi
++        flags="$flags -l$APRUTIL_LIBNAME"
+     ;;
+     --apu-la-file)
+     if test -f "$LA_FILE"; then
diff --git a/meta/recipes-support/apr/apr-util/configure_fixes.patch b/meta/recipes-support/apr/apr-util/configure_fixes.patch
new file mode 100644
index 0000000..91e244c
--- /dev/null
+++ b/meta/recipes-support/apr/apr-util/configure_fixes.patch
@@ -0,0 +1,31 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: apr-util-1.4.1/configure.in
+===================================================================
+--- apr-util-1.4.1.orig/configure.in	2009-12-18 03:15:19.000000000 +0800
++++ apr-util-1.4.1/configure.in	2011-12-30 13:32:07.000000000 +0800
+@@ -8,15 +8,15 @@
+ AC_CONFIG_HEADER(include/private/apu_config.h)
+ AC_CONFIG_AUX_DIR(build)
+ 
+-sinclude(build/apu-conf.m4)
+-sinclude(build/apu-iconv.m4)
+-sinclude(build/apu-hints.m4)
+-sinclude(build/apr_common.m4)
+-sinclude(build/find_apr.m4)
+-sinclude(build/crypto.m4)
+-sinclude(build/dbm.m4)
+-sinclude(build/dbd.m4)
+-sinclude(build/dso.m4)
++#sinclude(build/apu-conf.m4)
++#sinclude(build/apu-iconv.m4)
++#sinclude(build/apu-hints.m4)
++#sinclude(build/apr_common.m4)
++#sinclude(build/find_apr.m4)
++#sinclude(build/crypto.m4)
++#sinclude(build/dbm.m4)
++#sinclude(build/dbd.m4)
++#sinclude(build/dso.m4)
+ 
+ dnl Generate ./config.nice for reproducing runs of configure
+ dnl 
diff --git a/meta/recipes-support/apr/apr-util/run-ptest b/meta/recipes-support/apr/apr-util/run-ptest
new file mode 100644
index 0000000..ae19a1d
--- /dev/null
+++ b/meta/recipes-support/apr/apr-util/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd test
+./testall |sed \
+  -e 's|\(.*\):  SUCCESS|PASS: \1|' \
+  -e 's|\(.*\):  FAILED|FAIL: \1|'
diff --git a/meta/recipes-support/apr/apr-util_1.5.4.bb b/meta/recipes-support/apr/apr-util_1.5.4.bb
new file mode 100644
index 0000000..6a14d14
--- /dev/null
+++ b/meta/recipes-support/apr/apr-util_1.5.4.bb
@@ -0,0 +1,81 @@
+SUMMARY = "Apache Portable Runtime (APR) companion library"
+HOMEPAGE = "http://apr.apache.org/"
+SECTION = "libs"
+DEPENDS = "apr expat gdbm"
+
+BBCLASSEXTEND = "native nativesdk"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=519e0a18e03f7c023070568c14b077bb \
+                    file://include/apu_version.h;endline=17;md5=806685a84e71f10c80144c48eb35df42"
+
+SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.gz \
+           file://configfix.patch \
+           file://configure_fixes.patch \
+           file://run-ptest \
+"
+
+SRC_URI[md5sum] = "866825c04da827c6e5f53daff5569f42"
+SRC_URI[sha256sum] = "976a12a59bc286d634a21d7be0841cc74289ea9077aa1af46be19d1a6e844c19"
+
+EXTRA_OECONF = "--with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \ 
+		--without-odbc \
+		--without-pgsql \
+		--with-dbm=gdbm \
+		--with-gdbm=${STAGING_DIR_HOST}${prefix} \
+		--without-sqlite2 \
+		--without-sqlite3 \
+		--with-expat=${STAGING_DIR_HOST}${prefix}"
+
+
+inherit autotools lib_package binconfig
+
+PR = "r1"
+
+OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
+
+do_configure_append() {
+	if [ "${CLASSOVERRIDE}" = "class-target" ]; then
+		cp ${STAGING_DATADIR}/apr/apr_rules.mk ${B}/build/rules.mk
+	fi
+}
+do_configure_prepend_class-native() {
+	mkdir ${B}/build
+	cp ${STAGING_DATADIR_NATIVE}/apr/apr_rules.mk ${B}/build/rules.mk
+}
+do_configure_append_class-native() {
+	sed -i "s#LIBTOOL=\$(SHELL) \$(apr_builddir)#LIBTOOL=\$(SHELL) ${STAGING_BINDIR_NATIVE}#" ${B}/build/rules.mk
+	# sometimes there isn't SHELL
+	sed -i "s#LIBTOOL=\$(apr_builddir)#LIBTOOL=${STAGING_BINDIR_NATIVE}#" ${B}/build/rules.mk
+}
+
+do_configure_prepend_class-nativesdk() {
+	cp ${STAGING_DATADIR}/apr/apr_rules.mk ${S}/build/rules.mk
+}
+
+do_configure_append_class-nativesdk() {
+	sed -i "s#\(apr_builddir\)=.*#\1=${STAGING_DATADIR}/build-1#" ${S}/build/rules.mk
+	sed -i "s#\(apr_builders\)=.*#\1=${STAGING_DATADIR}/build-1#" ${S}/build/rules.mk
+	sed -i "s#\(top_builddir\)=.*#\1=${STAGING_DATADIR}/build-1#" ${S}/build/rules.mk
+	sed -i "s#\(LIBTOOL=\$(apr_builddir)\).*#\1/libtool#" ${S}/build/rules.mk
+}
+
+FILES_${PN}     += "${libdir}/apr-util-1/apr_dbm_gdbm-1.so"
+FILES_${PN}-dev += "${libdir}/aprutil.exp ${libdir}/apr-util-1/apr_dbm_gdbm.so* ${libdir}/apr-util-1/apr_dbm_gdbm.la"
+FILES_${PN}-dbg += "${libdir}/apr-util-1/.debug/*"
+FILES_${PN}-staticdev += "${libdir}/apr-util-1/apr_dbm_gdbm.a"
+
+inherit ptest
+
+do_compile_ptest() {
+	cd ${B}/test
+	oe_runmake
+}
+
+do_install_ptest() {
+	t=${D}${PTEST_PATH}/test
+	mkdir $t
+	for i in testall data; do \
+	  cp -r ${B}/test/$i $t; \
+	done
+}
diff --git a/meta/recipes-support/apr/apr/Fix-packet-discards-HTTP-redirect.patch b/meta/recipes-support/apr/apr/Fix-packet-discards-HTTP-redirect.patch
new file mode 100644
index 0000000..6805b8b
--- /dev/null
+++ b/meta/recipes-support/apr/apr/Fix-packet-discards-HTTP-redirect.patch
@@ -0,0 +1,32 @@
+Fix packet discards HTTP redirect.
+
+Disconnect the connection by poll() timeout.
+If timeout=0 and apr_wait_for_io_or_timeout()=APR_TIMEUP then
+apr_socket_recv() returns EAGAIN.
+
+Upstream-Status: Pending
+
+Signed-off-by: Noriaki Yoshitane <yoshitane.nrs@cnt.ncos.nec.co.jp>
+Signed-off-by: Li Wang <li.wang@windriver.com>
+---
+ network_io/unix/sendrecv.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
+index c133a26..e8faf15 100644
+--- a/network_io/unix/sendrecv.c
++++ b/network_io/unix/sendrecv.c
+@@ -85,6 +85,10 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
+                       && (sock->timeout > 0)) {
+ do_select:
+         arv = apr_wait_for_io_or_timeout(NULL, sock, 1);
++        if ((arv == APR_TIMEUP) && (sock->timeout == 0)) {
++            *len = 0;
++            return EAGAIN;
++        }
+         if (arv != APR_SUCCESS) {
+             *len = 0;
+             return arv;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-support/apr/apr/cleanup.patch b/meta/recipes-support/apr/apr/cleanup.patch
new file mode 100644
index 0000000..b6784e0
--- /dev/null
+++ b/meta/recipes-support/apr/apr/cleanup.patch
@@ -0,0 +1,43 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: apr-1.4.2/build/buildcheck.sh
+===================================================================
+--- apr-1.4.2.orig/build/buildcheck.sh	2009-11-13 08:27:16.000000000 +0800
++++ apr-1.4.2/build/buildcheck.sh	2010-11-26 15:44:00.000000000 +0800
+@@ -32,35 +32,4 @@
+ echo "buildconf: autoconf version $ac_version (ok)"
+ fi
+ 
+-# Sample libtool --version outputs:
+-# ltmain.sh (GNU libtool) 1.3.3 (1.385.2.181 1999/07/02 15:49:11)
+-# ltmain.sh (GNU libtool 1.1361 2004/01/02 23:10:52) 1.5a
+-# output is multiline from 1.5 onwards
+-
+-# Require libtool 1.4 or newer
+-libtool=`build/PrintPath glibtool1 glibtool libtool libtool15 libtool14`
+-lt_pversion=`$libtool --version 2>/dev/null|sed -e 's/([^)]*)//g;s/^[^0-9]*//;s/[- ].*//g;q'`
+-if test -z "$lt_pversion"; then
+-echo "buildconf: libtool not found."
+-echo "           You need libtool version 1.4 or newer installed"
+-echo "           to build APR from SVN."
+-exit 1
+-fi
+-lt_version=`echo $lt_pversion|sed -e 's/\([a-z]*\)$/.\1/'`
+-IFS=.; set $lt_version; IFS=' '
+-lt_status="good"
+-if test "$1" = "1"; then
+-   if test "$2" -lt "4"; then
+-      lt_status="bad"
+-   fi
+-fi
+-if test $lt_status = "good"; then
+-   echo "buildconf: libtool version $lt_pversion (ok)"
+-   exit 0
+-fi
+-
+-echo "buildconf: libtool version $lt_pversion found."
+-echo "           You need libtool version 1.4 or newer installed"
+-echo "           to build APR from SVN."
+-
+-exit 1
++exit 0
diff --git a/meta/recipes-support/apr/apr/configfix.patch b/meta/recipes-support/apr/apr/configfix.patch
new file mode 100644
index 0000000..605c4f6
--- /dev/null
+++ b/meta/recipes-support/apr/apr/configfix.patch
@@ -0,0 +1,53 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: apr-1.3.3/apr-config.in
+===================================================================
+--- apr-1.3.3.orig/apr-config.in	2009-01-12 15:16:31.000000000 +0000
++++ apr-1.3.3/apr-config.in	2009-01-12 15:19:25.000000000 +0000
+@@ -152,14 +152,7 @@
+     flags="$flags $LDFLAGS"
+     ;;
+     --includes)
+-    if test "$location" = "installed"; then
+         flags="$flags -I$includedir $EXTRA_INCLUDES"
+-    elif test "$location" = "source"; then
+-        flags="$flags -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
+-    else
+-        # this is for VPATH builds
+-        flags="$flags -I$APR_BUILD_DIR/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
+-    fi
+     ;;
+     --srcdir)
+     echo $APR_SOURCE_DIR
+@@ -181,29 +167,14 @@
+     exit 0
+     ;;
+     --link-ld)
+-    if test "$location" = "installed"; then
+-        ### avoid using -L if libdir is a "standard" location like /usr/lib
+-        flags="$flags -L$libdir -l${APR_LIBNAME}"
+-    else
+-        ### this surely can't work since the library is in .libs?
+-        flags="$flags -L$APR_BUILD_DIR -l${APR_LIBNAME}"
+-    fi
++        flags="$flags -l${APR_LIBNAME}"
+     ;;
+     --link-libtool)
+     # If the LA_FILE exists where we think it should be, use it.  If we're
+     # installed and the LA_FILE does not exist, assume to use -L/-l
+     # (the LA_FILE may not have been installed).  If we're building ourselves,
+     # we'll assume that at some point the .la file be created.
+-    if test -f "$LA_FILE"; then
+-        flags="$flags $LA_FILE"
+-    elif test "$location" = "installed"; then
+-        ### avoid using -L if libdir is a "standard" location like /usr/lib
+-        # Since the user is specifying they are linking with libtool, we
+-        # *know* that -R will be recognized by libtool.
+-        flags="$flags -L$libdir -R$libdir -l${APR_LIBNAME}"
+-    else
+-        flags="$flags $LA_FILE"
+-    fi
++        flags="$flags -l${APR_LIBNAME}"
+     ;;
+     --shlib-path-var)
+     echo "$SHLIBPATH_VAR"
diff --git a/meta/recipes-support/apr/apr/configure_fixes.patch b/meta/recipes-support/apr/apr/configure_fixes.patch
new file mode 100644
index 0000000..0514000
--- /dev/null
+++ b/meta/recipes-support/apr/apr/configure_fixes.patch
@@ -0,0 +1,68 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: apr-1.3.3/configure.in
+===================================================================
+--- apr-1.3.3.orig/configure.in
++++ apr-1.3.3/configure.in
+@@ -794,39 +794,6 @@ AC_CHECK_FUNCS([mmap munmap shm_open shm
+                 create_area])
+ 
+ APR_CHECK_DEFINE(MAP_ANON, sys/mman.h)
+-AC_CHECK_FILE(/dev/zero)
+-
+-# Not all systems can mmap /dev/zero (such as HP-UX).  Check for that.
+-if test "$ac_cv_func_mmap" = "yes" &&
+-   test "$ac_cv_file__dev_zero" = "yes"; then
+-    AC_MSG_CHECKING(for mmap that can map /dev/zero)
+-    AC_TRY_RUN([
+-#include <sys/types.h>
+-#include <sys/stat.h>
+-#include <fcntl.h>
+-#ifdef HAVE_SYS_MMAN_H
+-#include <sys/mman.h>
+-#endif
+-    int main()
+-    {
+-        int fd;
+-        void *m;
+-        fd = open("/dev/zero", O_RDWR);
+-        if (fd < 0) {
+-            return 1;
+-        }
+-        m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
+-        if (m == (void *)-1) {  /* aka MAP_FAILED */
+-            return 2;
+-        }
+-        if (munmap(m, sizeof(void*)) < 0) {
+-            return 3;
+-        }
+-        return 0;
+-    }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])
+-
+-    AC_MSG_RESULT($ac_cv_file__dev_zero)
+-fi
+ 
+ # Now we determine which one is our anonymous shmem preference.
+ haveshmgetanon="0"
+@@ -1518,13 +1485,14 @@ else
+     bigendian=0
+ fi
+ 
+-APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>
+-#include <sys/uio.h>],struct iovec,0)
+-if test "$ac_cv_sizeof_struct_iovec" = "0"; then
+-    have_iovec=0
+-else
+-    have_iovec=1
+-fi
++#APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>
++##include <sys/uio.h>],struct iovec,0)
++#if test "$ac_cv_sizeof_struct_iovec" = "0"; then
++#    have_iovec=0
++#else
++#    have_iovec=1
++#fi
++have_iovec=1
+ 
+ AC_SUBST(voidp_size)
+ AC_SUBST(short_value)
diff --git a/meta/recipes-support/apr/apr/run-ptest b/meta/recipes-support/apr/apr/run-ptest
new file mode 100644
index 0000000..ae19a1d
--- /dev/null
+++ b/meta/recipes-support/apr/apr/run-ptest
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+cd test
+./testall |sed \
+  -e 's|\(.*\):  SUCCESS|PASS: \1|' \
+  -e 's|\(.*\):  FAILED|FAIL: \1|'
diff --git a/meta/recipes-support/apr/apr/upgrade-and-fix-1.5.1.patch b/meta/recipes-support/apr/apr/upgrade-and-fix-1.5.1.patch
new file mode 100644
index 0000000..9569645
--- /dev/null
+++ b/meta/recipes-support/apr/apr/upgrade-and-fix-1.5.1.patch
@@ -0,0 +1,45 @@
+Makefile.in: fix cross compiling failed
+
+The tools/gen_test_char was invoked at build time,
+and it didn't work for the cross compiling, so we
+compile it with $BUILD_CC.
+
+Remove the 'tools' dir creation, it always existed.
+And it caused gen_test_char unexpected rebuilt at
+do_install time.
+
+Upstream-Status: inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ Makefile.in | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index a2a5194..5fe028f 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -46,7 +46,6 @@ LT_VERSION = @LT_VERSION@
+ 
+ CLEAN_TARGETS = apr-config.out apr.exp exports.c export_vars.c .make.dirs \
+ 	build/apr_rules.out tools/gen_test_char@EXEEXT@ \
+-	tools/gen_test_char.o tools/gen_test_char.lo \
+ 	include/private/apr_escape_test_char.h
+ DISTCLEAN_TARGETS = config.cache config.log config.status \
+ 	include/apr.h include/arch/unix/apr_private.h \
+@@ -129,13 +128,8 @@ check: $(TARGET_LIB)
+ etags:
+ 	etags `find . -name '*.[ch]'`
+ 
+-OBJECTS_gen_test_char = tools/gen_test_char.lo $(LOCAL_LIBS)
+-tools/gen_test_char.lo: tools/gen_test_char.c
+-	$(APR_MKDIR) tools
+-	$(LT_COMPILE)
+-
+-tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
+-	$(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
++tools/gen_test_char@EXEEXT@: tools/gen_test_char.c
++	$(BUILD_CC) $(CFLAGS_FOR_BUILD) $< -o $@
+ 
+ include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
+ 	$(APR_MKDIR) include/private
diff --git a/meta/recipes-support/apr/apr_1.5.2.bb b/meta/recipes-support/apr/apr_1.5.2.bb
new file mode 100644
index 0000000..c1f7f38
--- /dev/null
+++ b/meta/recipes-support/apr/apr_1.5.2.bb
@@ -0,0 +1,96 @@
+SUMMARY = "Apache Portable Runtime (APR) library"
+HOMEPAGE = "http://apr.apache.org/"
+SECTION = "libs"
+DEPENDS = "util-linux"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=4dfd4cd216828c8cae5de5a12f3844c8 \
+                    file://include/apr_lib.h;endline=17;md5=ee42fa7575dc40580a9e01c1b75fae96"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
+           file://configure_fixes.patch \
+           file://cleanup.patch \
+           file://configfix.patch \
+           file://run-ptest \
+           file://upgrade-and-fix-1.5.1.patch \
+           file://Fix-packet-discards-HTTP-redirect.patch \
+"
+
+SRC_URI[md5sum] = "4e9769f3349fe11fc0a5e1b224c236aa"
+SRC_URI[sha256sum] = "7d03ed29c22a7152be45b8e50431063736df9e1daa1ddf93f6a547ba7a28f67a"
+
+inherit autotools-brokensep lib_package binconfig multilib_header ptest
+
+OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
+
+# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928
+CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes"
+
+# Also suppress trying to use sctp.
+#
+CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no"
+
+do_configure_prepend() {
+	# Avoid absolute paths for grep since it causes failures
+	# when using sstate between different hosts with different
+	# install paths for grep.
+	export GREP="grep"
+
+	cd ${S}
+	./buildconf
+}
+
+FILES_${PN}-dev += "${libdir}/apr.exp ${datadir}/build-1/*"
+RDEPENDS_${PN}-dev += "bash"
+
+#for some reason, build/libtool.m4 handled by buildconf still be overwritten
+#when autoconf, so handle it again.
+do_configure_append() {
+	sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/libtool.m4
+	sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/apr_rules.mk
+}
+
+do_install_append() {
+	oe_multilib_header apr.h
+	install -d ${D}${datadir}/apr
+	cp ${S}/${HOST_SYS}-libtool ${D}${datadir}/build-1/libtool
+}
+
+SSTATE_SCAN_FILES += "apr_rules.mk libtool"
+
+SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess"
+
+apr_sysroot_preprocess () {
+	d=${SYSROOT_DESTDIR}${datadir}/apr
+	install -d $d/
+	cp ${S}/build/apr_rules.mk $d/
+	sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk
+	sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk
+	sed -i s,LIBTOOL=.*,LIBTOOL=${HOST_SYS}-libtool,g $d/apr_rules.mk
+	sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk
+	cp ${S}/build/mkdir.sh $d/
+	cp ${S}/build/make_exports.awk $d/
+	cp ${S}/build/make_var_export.awk $d/
+}
+
+do_compile_ptest() {
+	cd ${S}/test
+	oe_runmake
+}
+
+do_install_ptest() {
+	t=${D}${PTEST_PATH}/test
+	mkdir -p $t/.libs
+	cp -r ${S}/test/data $t/
+	cp -r ${S}/test/.libs/*.so $t/.libs/
+	cp ${S}/test/proc_child $t/
+	cp ${S}/test/readchild $t/
+	cp ${S}/test/sockchild $t/
+	cp ${S}/test/sockperf $t/
+	cp ${S}/test/testall $t/
+	cp ${S}/test/tryread $t/
+}
+
+export CONFIG_SHELL="/bin/bash"
diff --git a/meta/recipes-support/aspell/aspell_0.60.6.1.bb b/meta/recipes-support/aspell/aspell_0.60.6.1.bb
new file mode 100644
index 0000000..7cf17d6
--- /dev/null
+++ b/meta/recipes-support/aspell/aspell_0.60.6.1.bb
@@ -0,0 +1,30 @@
+SUMMARY = "GNU Aspell spell-checker"
+SECTION = "console/utils"
+
+LICENSE = "LGPLv2 | LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+
+PR = "r1"
+
+SRC_URI = "${GNU_MIRROR}/aspell/aspell-${PV}.tar.gz"
+SRC_URI[md5sum] = "e66a9c9af6a60dc46134fdacf6ce97d7"
+SRC_URI[sha256sum] = "f52583a83a63633701c5f71db3dc40aab87b7f76b29723aeb27941eff42df6e1"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses"
+
+PACKAGES += "libaspell libpspell aspell-utils"
+
+RDEPENDS_${PN}-utils += "perl"
+
+FILES_${PN}-dbg += "${libdir}/aspell-0.60/.debu*"
+FILES_libaspell = "${libdir}/libaspell.so.* ${libdir}/aspell*"
+FILES_aspell-utils = "${bindir}/word-list-compress ${bindir}/aspell-import ${bindir}/run-with-aspell ${bindir}/pre*"
+FILES_${PN} = "${bindir}/aspell"
+FILES_libpspell = "${libdir}/libpspell.so.*"
+FILES_${PN}-dev += "${bindir}/pspell-config"
+
+ARM_INSTRUCTION_SET = "arm"
+inherit autotools-brokensep gettext texinfo binconfig-disabled
+
+BINCONFIG = "${bindir}/pspell-config"
diff --git a/meta/recipes-support/atk/at-spi2-atk_2.16.0.bb b/meta/recipes-support/atk/at-spi2-atk_2.16.0.bb
new file mode 100644
index 0000000..7d95fdb
--- /dev/null
+++ b/meta/recipes-support/atk/at-spi2-atk_2.16.0.bb
@@ -0,0 +1,22 @@
+SUMMARY = "AT-SPI 2 Toolkit Bridge"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e9f288ba982d60518f375b5898283886"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz"
+SRC_URI[md5sum] = "8936488c8cdce0e158f80b2e247527f9"
+SRC_URI[sha256sum] = "78efc45ec36383bf785f8636e64a8d866defeb020e00a08f92978f1fc3772ff9"
+
+DEPENDS = "dbus glib-2.0 atk at-spi2-core"
+
+inherit autotools pkgconfig distro_features_check
+
+# The at-spi2-core requires x11 in DISTRO_FEATURES
+REQUIRED_DISTRO_FEATURES = "x11"
+
+PACKAGES =+ "${PN}-gnome ${PN}-gtk2"
+
+FILES_${PN}-gnome = "${libdir}/gnome-settings-daemon-3.0/gtk-modules"
+FILES_${PN}-gtk2 = "${libdir}/gtk-2.0/modules/libatk-bridge.*"
+FILES_${PN}-dbg += "${libdir}/gtk-2.0/modules/.debug"
diff --git a/meta/recipes-support/atk/at-spi2-core/0001-nls.m4-Take-it-from-gettext-0.15.patch b/meta/recipes-support/atk/at-spi2-core/0001-nls.m4-Take-it-from-gettext-0.15.patch
new file mode 100644
index 0000000..69a51d5
--- /dev/null
+++ b/meta/recipes-support/atk/at-spi2-core/0001-nls.m4-Take-it-from-gettext-0.15.patch
@@ -0,0 +1,54 @@
+From c320799c941d42a9b7e351805359694ea3b36d2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 5 Apr 2015 09:08:38 -0700
+Subject: [PATCH] nls.m4: Take it from gettext-0.15
+
+It otherwise expects gettext to provide it. Lets go independent
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ m4/nls.m4 | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+ create mode 100644 m4/nls.m4
+
+diff --git a/m4/nls.m4 b/m4/nls.m4
+new file mode 100644
+index 0000000..2c8fe69
+--- /dev/null
++++ b/m4/nls.m4
+@@ -0,0 +1,30 @@
++dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are not in the public domain.
++
++dnl Authors:
++dnl Ulrich Drepper drepper@cygnus.com, 1995-2000.
++dnl Bruno Haible haible@clisp.cons.org, 2000-2003.
++
++AC_PREREQ(2.50)
++
++AC_DEFUN([AM_NLS],
++[
++AC_MSG_CHECKING([whether NLS is requested])
++dnl Default is enabled NLS
++AC_ARG_ENABLE(nls,
++[ --disable-nls do not use Native Language Support],
++USE_NLS=$enableval, USE_NLS=yes)
++AC_MSG_RESULT($USE_NLS)
++AC_SUBST(USE_NLS)
++])
+-- 
+2.1.4
+
diff --git a/meta/recipes-support/atk/at-spi2-core_2.16.0.bb b/meta/recipes-support/atk/at-spi2-core_2.16.0.bb
new file mode 100644
index 0000000..933cbe7
--- /dev/null
+++ b/meta/recipes-support/atk/at-spi2-core_2.16.0.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Assistive Technology Service Provider Interface (dbus core)"
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=e9f288ba982d60518f375b5898283886"
+
+MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
+           file://0001-nls.m4-Take-it-from-gettext-0.15.patch \
+          "
+
+SRC_URI[md5sum] = "be6eeea370f913b7639b609913b2cf02"
+SRC_URI[sha256sum] = "1c0b77fb8ce81abbf1d80c0afee9858b3f9229f673b7881995fe0fc16b1a74d0"
+
+DEPENDS = "dbus glib-2.0 virtual/libx11 libxi libxtst intltool-native"
+
+inherit autotools gtk-doc pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+EXTRA_OECONF = "--disable-introspection --disable-xevie --with-dbus-daemondir=${bindir}"
+
+FILES_${PN} += "${datadir}/dbus-1/services/*.service \
+                ${datadir}/dbus-1/accessibility-services/*.service"
diff --git a/meta/recipes-support/atk/atk_2.16.0.bb b/meta/recipes-support/atk/atk_2.16.0.bb
new file mode 100644
index 0000000..0f8f9b5
--- /dev/null
+++ b/meta/recipes-support/atk/atk_2.16.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Accessibility toolkit for GNOME"
+HOMEPAGE = "http://live.gnome.org/GAP/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+SECTION = "x11/libs"
+
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+                    file://atk/atkutil.c;endline=18;md5=6fd31cd2fdc9b30f619ca8d819bc12d3 \
+                    file://atk/atk.h;endline=18;md5=fcd7710187e0eae485e356c30d1b0c3b"
+
+DEPENDS = "glib-2.0"
+
+inherit gnomebase gtk-doc
+
+SRC_URI[archive.md5sum] = "c7c5002bd6e58b4723a165f1bf312116"
+SRC_URI[archive.sha256sum] = "095f986060a6a0b22eb15eef84ae9f14a1cf8082488faa6886d94c37438ae562"
+
+BBCLASSEXTEND = "native"
+
+EXTRA_OECONF = "--disable-glibtest \
+                --disable-introspection"
diff --git a/meta/recipes-support/attr/acl.inc b/meta/recipes-support/attr/acl.inc
new file mode 100644
index 0000000..b2bc8ba
--- /dev/null
+++ b/meta/recipes-support/attr/acl.inc
@@ -0,0 +1,39 @@
+SUMMARY = "Utilities for managing POSIX Access Control Lists"
+HOMEPAGE = "http://savannah.nongnu.org/projects/acl/"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_lib${BPN} = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://doc/COPYING;md5=c781d70ed2b4d48995b790403217a249 \
+                    file://doc/COPYING.LGPL;md5=9e9a206917f8af112da634ce3ab41764"
+
+DEPENDS = "attr"
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/acl/${BP}.src.tar.gz \
+           file://run-ptest \
+           file://acl-fix-the-order-of-expected-output-of-getfacl.patch \
+"
+
+require ea-acl.inc
+
+# avoid RPATH hardcode to staging dir
+do_configure_append() {
+	sed -i ${S}/config.status -e s,^\\\(hardcode_into_libs=\\\).*$,\\1\'no\',
+	${S}/config.status
+}
+
+# libdir should point to .la
+do_install_append() {
+	sed -i ${D}${libdir}/libacl.la -e \
+	    s,^libdir=\'${base_libdir}\'$,libdir=\'${libdir}\',
+}
+
+inherit ptest
+
+do_install_ptest() {
+	tar -cf - test/ --exclude nfs | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	mkdir ${D}${PTEST_PATH}/include
+	cp ${S}/include/builddefs ${S}/include/buildmacros ${S}/include/buildrules ${D}${PTEST_PATH}/include/
+}
+
+RDEPENDS_${PN}-ptest = "acl bash coreutils perl perl-module-filehandle perl-module-getopt-std perl-module-posix shadow"
diff --git a/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch b/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch
new file mode 100644
index 0000000..cf765fd
--- /dev/null
+++ b/meta/recipes-support/attr/acl/acl-fix-the-order-of-expected-output-of-getfacl.patch
@@ -0,0 +1,198 @@
+acl: fix the order of expected output of getfacl
+
+The result of getfacl is sorted by user id.
+In Centos or RHEL, bin user id is 1 and daemon user id is 2.
+But in our image, bin user id is 2 and daemon user id is 1.
+The patch fixes this issue to make ptest pass.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ test/misc.test |   38 +++++++++++++++++++-------------------
+ 1 file changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/test/misc.test b/test/misc.test
+index 6e98053..53ae5b0 100644
+--- a/test/misc.test
++++ b/test/misc.test
+@@ -79,8 +79,8 @@ Multiple users
+ 
+ 	$ getfacl --omit-header f
+ 	> user::rw-
+-	> user:bin:rw-
+ 	> user:daemon:r--
++	> user:bin:rw-
+ 	> group::r--
+ 	> mask::rw-
+ 	> other::r--
+@@ -94,8 +94,8 @@ Multiple groups
+ 
+ 	$ getfacl --omit-header f
+ 	> user::rw-
+-	> user:bin:rw-
+ 	> user:daemon:r--
++	> user:bin:rw-
+ 	> group::r--
+ 	> group:daemon:r--
+ 	> group:users:rw-
+@@ -111,8 +111,8 @@ Remove one group
+ 
+ 	$ getfacl --omit-header f
+ 	> user::rw-
+-	> user:bin:rw-
+ 	> user:daemon:r--
++	> user:bin:rw-
+ 	> group::r--
+ 	> group:daemon:r--
+ 	> mask::rw-
+@@ -146,8 +146,8 @@ Default ACL
+ 
+ 	$ getfacl --omit-header d
+ 	> user::rwx
+-	> user:bin:rwx
+ 	> user:daemon:rw-
++	> user:bin:rwx
+ 	> group::r-x
+ 	> mask::rwx
+ 	> other::---
+@@ -236,16 +236,16 @@ Add some users and groups
+ 
+ 	$ getfacl --omit-header d/d
+ 	> user::rwx
+-	> user:bin:rwx	#effective:r-x
+ 	> user:daemon:r-x
++	> user:bin:rwx	#effective:r-x
+ 	> group::r-x
+ 	> group:daemon:rwx	#effective:r-x
+ 	> group:users:r-x
+ 	> mask::r-x
+ 	> other::---
+ 	> default:user::rwx
+-	> default:user:bin:rwx	#effective:r-x
+ 	> default:user:daemon:r-x
++	> default:user:bin:rwx	#effective:r-x
+ 	> default:group::r-x
+ 	> default:mask::r-x
+ 	> default:other::---
+@@ -262,16 +262,16 @@ Symlink in directory with default ACL?
+ 
+ 	$ getfacl --omit-header d/l
+ 	> user::rwx
+-	> user:bin:rwx	#effective:r-x
+ 	> user:daemon:r-x
++	> user:bin:rwx	#effective:r-x
+ 	> group::r-x
+ 	> group:daemon:rwx	#effective:r-x
+ 	> group:users:r-x
+ 	> mask::r-x
+ 	> other::---
+ 	> default:user::rwx
+-	> default:user:bin:rwx	#effective:r-x
+ 	> default:user:daemon:r-x
++	> default:user:bin:rwx	#effective:r-x
+ 	> default:group::r-x
+ 	> default:mask::r-x
+ 	> default:other::---
+@@ -287,16 +287,16 @@ Does mask manipulation work?
+ 
+ 	$ getfacl --omit-header d/d
+ 	> user::rwx
+-	> user:bin:r-x
+ 	> user:daemon:r-x
++	> user:bin:r-x
+ 	> group::r-x
+ 	> group:daemon:r-x
+ 	> group:users:r-x
+ 	> mask::r-x
+ 	> other::---
+ 	> default:user::rwx
+-	> default:user:bin:rwx	#effective:r-x
+ 	> default:user:daemon:r-x
++	> default:user:bin:rwx	#effective:r-x
+ 	> default:group::r-x
+ 	> default:mask::r-x
+ 	> default:other::---
+@@ -308,16 +308,16 @@ Does mask manipulation work?
+ 
+ 	$ getfacl --omit-header d/d
+ 	> user::rwx
+-	> user:bin:r-x
+ 	> user:daemon:r-x
++	> user:bin:r-x
+ 	> group::r-x
+ 	> group:daemon:r-x
+ 	> group:users:r-x
+ 	> mask::r-x
+ 	> other::---
+ 	> default:user::rwx
+-	> default:user:bin:rwx
+ 	> default:user:daemon:r-x
++	> default:user:bin:rwx
+ 	> default:group::r-x
+ 	> default:mask::rwx
+ 	> default:other::---
+@@ -333,8 +333,8 @@ Remove the default ACL
+ 
+ 	$ getfacl --omit-header d
+ 	> user::rwx
+-	> user:bin:rwx
+ 	> user:daemon:rw-
++	> user:bin:rwx
+ 	> group::r-x
+ 	> mask::rwx
+ 	> other::---
+@@ -373,14 +373,14 @@ Now, chmod should change the group_obj entry
+ 
+ 	$ getfacl --omit-header d
+ 	> user::rwx
+-	> user:bin:r-x
+ 	> user:daemon:rwx
++	> user:bin:r-x
+ 	> group::rwx
+ 	> mask::rwx
+ 	> other::r-x
+ 	> default:user::rwx
+-	> default:user:bin:r-x
+ 	> default:user:daemon:rwx
++	> default:user:bin:r-x
+ 	> default:group::rwx
+ 	> default:mask::rwx
+ 	> default:other::r-x
+@@ -392,14 +392,14 @@ Now, chmod should change the group_obj entry
+ 
+ 	$ getfacl --omit-header d
+ 	> user::rwx
+-	> user:bin:r-x
+ 	> user:daemon:rwx	#effective:r-x
++	> user:bin:r-x
+ 	> group::rwx	#effective:r-x
+ 	> mask::r-x
+ 	> other::---
+ 	> default:user::rwx
+-	> default:user:bin:r-x
+ 	> default:user:daemon:rwx
++	> default:user:bin:r-x
+ 	> default:group::rwx
+ 	> default:mask::rwx
+ 	> default:other::r-x
+@@ -411,14 +411,14 @@ Now, chmod should change the group_obj entry
+ 
+ 	$ getfacl --omit-header d
+ 	> user::rwx
+-	> user:bin:r-x
+ 	> user:daemon:rwx	#effective:r-x
++	> user:bin:r-x
+ 	> group::rwx	#effective:r-x
+ 	> mask::r-x
+ 	> other::---
+ 	> default:user::rwx
+-	> default:user:bin:r-x
+ 	> default:user:daemon:rwx
++	> default:user:bin:r-x
+ 	> default:group::rwx
+ 	> default:mask::rwx
+ 	> default:other::r-x
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-support/attr/acl/add-missing-configure.ac.patch b/meta/recipes-support/attr/acl/add-missing-configure.ac.patch
new file mode 100644
index 0000000..eb6979f
--- /dev/null
+++ b/meta/recipes-support/attr/acl/add-missing-configure.ac.patch
@@ -0,0 +1,59 @@
+Upstream-Status: Backport [configure.ac is missing from tarball]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: acl-2.2.52/configure.ac
+===================================================================
+--- /dev/null
++++ acl-2.2.52/configure.ac
+@@ -0,0 +1,50 @@
++
++# Copyright (C) 2009  Andreas Gruenbacher <agruen@suse.de>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by
++# the Free Software Foundation, either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++#
++AC_INIT(include/acl.h)
++AC_CONFIG_AUX_DIR([.])
++AC_CONFIG_MACRO_DIR([m4])
++AC_CONFIG_HEADER(include/config.h)
++AC_PREFIX_DEFAULT(/usr)
++
++AC_PROG_LIBTOOL
++
++AC_ARG_ENABLE(shared,
++[ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
++	enable_shared=yes)
++AC_SUBST(enable_shared)
++
++AC_ARG_ENABLE(gettext,
++[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
++	enable_gettext=yes)
++AC_SUBST(enable_gettext)
++
++AC_ARG_ENABLE(lib64,
++[ --enable-lib64=[yes/no] Enable lib64 support [default=no]],,
++	enable_lib64=no)
++AC_SUBST(enable_lib64)
++
++AC_PACKAGE_GLOBALS(acl)
++AC_PACKAGE_UTILITIES(acl)
++AC_PACKAGE_NEED_ATTR_XATTR_H
++AC_PACKAGE_NEED_ATTR_ERROR_H
++AC_MULTILIB($enable_lib64)
++AC_PACKAGE_NEED_GETXATTR_LIBATTR
++AC_MANUAL_FORMAT
++
++AC_FUNC_GCC_VISIBILITY
++
++AC_OUTPUT(include/builddefs)
diff --git a/meta/recipes-support/attr/acl/run-ptest b/meta/recipes-support/attr/acl/run-ptest
new file mode 100644
index 0000000..3b31cc9
--- /dev/null
+++ b/meta/recipes-support/attr/acl/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+gpasswd -a daemon bin
+make -C test -k tests root-tests |sed \
+ -e 's|^\[.*\] \(.*\) -- ok$|PASS: \1|' \
+ -e 's|^\[.*\] \(.*\) -- failed|FAIL: \1|'
+gpasswd -d daemon bin
diff --git a/meta/recipes-support/attr/acl_2.2.52.bb b/meta/recipes-support/attr/acl_2.2.52.bb
new file mode 100644
index 0000000..ecdbdb6
--- /dev/null
+++ b/meta/recipes-support/attr/acl_2.2.52.bb
@@ -0,0 +1,9 @@
+require acl.inc
+
+SRC_URI += "file://add-missing-configure.ac.patch"
+
+SRC_URI[md5sum] = "a61415312426e9c2212bd7dc7929abda"
+SRC_URI[sha256sum] = "179074bb0580c06c4b4137be4c5a92a701583277967acdb5546043c7874e0d23"
+
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/attr/attr.inc b/meta/recipes-support/attr/attr.inc
new file mode 100644
index 0000000..28c750f
--- /dev/null
+++ b/meta/recipes-support/attr/attr.inc
@@ -0,0 +1,39 @@
+SUMMARY = "Utilities for manipulating filesystem extended attributes"
+HOMEPAGE = "http://savannah.nongnu.org/projects/attr/"
+SECTION = "libs"
+
+DEPENDS = "ncurses virtual/libintl"
+
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_lib${BPN} = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://doc/COPYING;md5=2d0aa14b3fce4694e4f615e30186335f \
+                    file://attr/attr.c;endline=17;md5=be0403261f0847e5f43ed5b08d19593c \
+                    file://libattr/libattr.c;endline=17;md5=7970f77049f8fa1199fff62a7ab724fb"
+
+SRC_URI = "${SAVANNAH_GNU_MIRROR}/attr/${BP}.src.tar.gz \
+           file://run-ptest \
+"
+
+require ea-acl.inc
+
+# libdir should point to .la
+do_install_append() {
+	sed -i ${D}${libdir}/libattr.la -e \
+	    s,^libdir=\'${base_libdir}\'$,libdir=\'${libdir}\',
+}
+
+inherit ptest
+
+do_install_ptest() {
+	tar -cf - test/ --exclude ext | ( cd ${D}${PTEST_PATH} && tar -xf - )
+	mkdir ${D}${PTEST_PATH}/include
+	for i in builddefs buildmacros buildrules; \
+	  do cp ${S}/include/$i ${D}${PTEST_PATH}/include/; \
+	done
+	sed -e 's|; @echo|; echo|' -i ${D}${PTEST_PATH}/test/Makefile
+}
+
+RDEPENDS_${PN}-ptest = "coreutils perl-module-filehandle perl-module-getopt-std perl-module-posix"
+
+BBCLASSEXTEND = "native nativesdk"
\ No newline at end of file
diff --git a/meta/recipes-support/attr/attr_2.4.47.bb b/meta/recipes-support/attr/attr_2.4.47.bb
new file mode 100644
index 0000000..ad40c9b
--- /dev/null
+++ b/meta/recipes-support/attr/attr_2.4.47.bb
@@ -0,0 +1,10 @@
+require attr.inc
+
+# configure.ac was missing from the release tarball. This should be fixed in
+# future releases of attr, remove this when updating the recipe.
+SRC_URI_append += "file://attr-Missing-configure.ac.patch"
+
+SRC_URI[md5sum] = "84f58dec00b60f2dc8fd1c9709291cc7"
+SRC_URI[sha256sum] = "25772f653ac5b2e3ceeb89df50e4688891e21f723c460636548971652af0a859"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/attr/ea-acl.inc b/meta/recipes-support/attr/ea-acl.inc
new file mode 100644
index 0000000..370e16f
--- /dev/null
+++ b/meta/recipes-support/attr/ea-acl.inc
@@ -0,0 +1,52 @@
+# this build system is mostly shared by attr and acl
+
+SRC_URI += "file://relative-libdir.patch;striplevel=0 \
+           "
+
+inherit autotools-brokensep gettext
+
+# the package comes with a custom config.h.in, it cannot be
+# overwritten by autoheader
+EXTRA_AUTORECONF += "--exclude=autoheader"
+EXTRA_OECONF = "INSTALL_USER=root INSTALL_GROUP=root"
+EXTRA_OECONF_append_class-native = " --enable-gettext=no"
+
+EXTRA_OEMAKE = "PKG_LIB_DIR=${base_libdir} PKG_DEVLIB_DIR=${libdir}"
+
+do_install () {
+	oe_runmake install install-lib install-dev DIST_ROOT="${D}"
+}
+
+PACKAGES =+ "lib${BPN}"
+
+FILES_lib${BPN} = "${base_libdir}/lib*${SOLIBS}"
+
+BBCLASSEXTEND = "native"
+# Only append ldflags for target recipe and if USE_NLS is enabled
+LDFLAGS_append_libc-uclibc_class-target = "${@['', ' -lintl '][(d.getVar('USE_NLS', True) == 'yes')]}"
+EXTRA_OECONF_append_libc-uclibc_class-target = "${@['', ' --disable-gettext '][(d.getVar('USE_NLS', True) == 'no')]}"
+
+fix_symlink () {
+	if [ "${BB_CURRENTTASK}" != "populate_sysroot" -a "${BB_CURRENTTASK}" != "populate_sysroot_setscene" ]
+	then
+		return
+	fi
+
+	if test "${libdir}" = "${base_libdir}" ; then
+		return
+	fi
+	# Remove bad symlinks & create the correct symlinks
+	if test -L ${libdir}/lib${BPN}.so ; then
+		rm -rf ${libdir}/lib${BPN}.so
+		ln -sf ${base_libdir}/lib${BPN}.so ${libdir}/lib${BPN}.so
+	fi
+	if test -L ${base_libdir}/lib${BPN}.a ; then
+		rm -rf ${base_libdir}/lib${BPN}.a
+		ln -sf ${libdir}/lib${BPN}.a ${base_libdir}/lib${BPN}.a
+	fi
+	if test -L  ${base_libdir}/lib${BPN}.la ; then
+		rm -rf ${base_libdir}/lib${BPN}.la
+		ln -sf ${libdir}/lib${BPN}.la ${base_libdir}/lib${BPN}.la
+	fi
+}
+SSTATEPOSTINSTFUNCS_class-native += "fix_symlink"
diff --git a/meta/recipes-support/attr/files/attr-Missing-configure.ac.patch b/meta/recipes-support/attr/files/attr-Missing-configure.ac.patch
new file mode 100644
index 0000000..20fcc3c
--- /dev/null
+++ b/meta/recipes-support/attr/files/attr-Missing-configure.ac.patch
@@ -0,0 +1,63 @@
+Subject: [PATCH] attr: Missing configure.ac
+
+Upstream-Status: Backport [Upstream released tarball missing this file]
+Signed-off-by: Nathan Rossi <nathan.rossi@xilinx.com>
+---
+ configure.ac |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 48 insertions(+)
+ create mode 100644 configure.ac
+
+diff --git a/configure.ac b/configure.ac
+new file mode 100644
+index 0000000..b966d0e
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,48 @@
++# Copyright (C) 2009  Andreas Gruenbacher <agruen@suse.de>
++#
++# This program is free software: you can redistribute it and/or modify it
++# under the terms of the GNU General Public License as published by
++# the Free Software Foundation, either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program.  If not, see <http://www.gnu.org/licenses/>.
++#
++AC_INIT(include/attributes.h)
++AC_CONFIG_AUX_DIR([.])
++AC_CONFIG_MACRO_DIR([m4])
++AC_CONFIG_HEADER(include/config.h)
++AC_PREFIX_DEFAULT(/usr)
++
++AC_PROG_LIBTOOL
++
++AC_ARG_ENABLE(shared,
++[ --enable-shared=[yes/no] Enable use of shared libraries [default=yes]],,
++	enable_shared=yes)
++AC_SUBST(enable_shared)
++
++AC_ARG_ENABLE(gettext,
++[ --enable-gettext=[yes/no] Enable alternate language support [default=yes]],,
++	enable_gettext=yes)
++AC_SUBST(enable_gettext)
++
++AC_ARG_ENABLE(lib64,
++[ --enable-lib64=[yes/no] Enable lib64 support [default=no]],,
++	enable_lib64=no)
++AC_SUBST(enable_lib64)
++
++AC_PACKAGE_GLOBALS(attr)
++AC_PACKAGE_UTILITIES(attr)
++AC_MANUAL_FORMAT
++AC_MULTILIB($enable_lib64)
++
++AC_C_CONST
++AC_TYPE_MODE_T
++AC_FUNC_ALLOCA
++
++AC_OUTPUT(include/builddefs)
diff --git a/meta/recipes-support/attr/files/relative-libdir.patch b/meta/recipes-support/attr/files/relative-libdir.patch
new file mode 100644
index 0000000..b72bf18
--- /dev/null
+++ b/meta/recipes-support/attr/files/relative-libdir.patch
@@ -0,0 +1,25 @@
+Upstream-Status: Pending
+
+use relative path in symbolic links, or it fails in staging
+sed expression from udev
+
+7/29/2010 - created by Qing He <qing.he@intel.com>
+
+diff -u include.orig/buildmacros include/buildmacros
+--- include.orig/buildmacros	2010-07-29 17:39:48.000000000 +0800
++++ include/buildmacros	2010-07-29 18:20:34.000000000 +0800
+@@ -88,9 +88,11 @@
+ 	../$(INSTALL) -m 755 -d $(PKG_LIB_DIR); \
+ 	../$(INSTALL) -T so_base $(LIBNAME).lai $(PKG_LIB_DIR); \
+ 	if test "x$(PKG_DEVLIB_DIR)" != "x$(PKG_LIB_DIR)" ; then \
+-	../$(INSTALL) -S $(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
+-	../$(INSTALL) -S $(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
+-	../$(INSTALL) -S $(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so; \
++	rel_lib_prefix=$$(echo $(PKG_LIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
++	../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).a $(PKG_LIB_DIR)/$(LIBNAME).a; \
++	../$(INSTALL) -S $$rel_lib_prefix$(PKG_DEVLIB_DIR)/$(LIBNAME).la $(PKG_LIB_DIR)/$(LIBNAME).la; \
++	rel_devlib_prefix=$$(echo $(PKG_DEVLIB_DIR) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
++	../$(INSTALL) -S $$rel_devlib_prefix$(PKG_LIB_DIR)/$(LIBNAME).so $(PKG_DEVLIB_DIR)/$(LIBNAME).so; \
+ 	fi
+ else
+ INSTALL_LTLIB_DEV = $(INSTALL_LTLIB_STATIC)
diff --git a/meta/recipes-support/attr/files/run-ptest b/meta/recipes-support/attr/files/run-ptest
new file mode 100644
index 0000000..a6c6867
--- /dev/null
+++ b/meta/recipes-support/attr/files/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+make -C test -k tests root-tests |sed \
+ -e 's|^\[.*\] \(.*\) -- ok$|PASS: \1|' \
+ -e 's|^\[.*\] \(.*\) -- failed|FAIL: \1|'
diff --git a/meta/recipes-support/bdwgc/bdwgc/0001-fix-build-with-musl.patch b/meta/recipes-support/bdwgc/bdwgc/0001-fix-build-with-musl.patch
new file mode 100644
index 0000000..ab907fc
--- /dev/null
+++ b/meta/recipes-support/bdwgc/bdwgc/0001-fix-build-with-musl.patch
@@ -0,0 +1,35 @@
+From 829a89e7f5785239a9384e3afd46c900f9d76ada Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 31 Aug 2015 19:55:32 +0000
+Subject: [PATCH] fix build with musl
+
+signal.h already includes bits/sigcontext.h
+Documentation seems to indicate that if you need the definitions in
+sigcontext.h, you are supposed to include signal.h and not sigcontext.h.
+
+a good fix should be to remove glibc
+specific understanding, in those ifdef's
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ os_dep.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/os_dep.c b/os_dep.c
+index 08c501d..5cb7873 100644
+--- a/os_dep.c
++++ b/os_dep.c
+@@ -41,7 +41,7 @@
+ #   else /* __GLIBC__ < 2 */
+       /* libc5 doesn't have <sigcontext.h>: go directly with the kernel   */
+       /* one.  Check LINUX_VERSION_CODE to see which we should reference. */
+-#     include <asm/sigcontext.h>
++#     include <signal.h>
+ #   endif /* __GLIBC__ < 2 */
+ # endif
+ #endif /* LINUX && !POWERPC */
+-- 
+2.5.1
+
diff --git a/meta/recipes-support/bdwgc/bdwgc_7.4.2.bb b/meta/recipes-support/bdwgc/bdwgc_7.4.2.bb
new file mode 100644
index 0000000..95e358f
--- /dev/null
+++ b/meta/recipes-support/bdwgc/bdwgc_7.4.2.bb
@@ -0,0 +1,43 @@
+SUMMARY = "A garbage collector for C and C++"
+
+DESCRIPTION = "The Boehm-Demers-Weiser conservative garbage collector can be\
+ used as a garbage collecting replacement for C malloc or C++ new. It allows\
+ you to allocate memory basically as you normally would, without explicitly\
+ deallocating memory that is no longer useful. The collector automatically\
+ recycles memory when it determines that it can no longer be otherwise\
+ accessed.\
+  The collector is also used by a number of programming language\
+ implementations that either use C as intermediate code, want to facilitate\
+ easier interoperation with C libraries, or just prefer the simple collector\
+ interface.\
+  Alternatively, the garbage collector may be used as a leak detector for C\
+ or C++ programs, though that is not its primary goal.\
+  Empirically, this collector works with most unmodified C programs, simply\
+ by replacing malloc with GC_malloc calls, replacing realloc with GC_realloc\
+ calls, and removing free calls."
+
+HOMEPAGE = "http://www.hboehm.info/gc/"
+SECTION = "devel"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://README.QUICK;md5=55f5088f90a982fed7af9a4897047ef7"
+
+SRC_URI = "http://www.hboehm.info/gc/gc_source/gc-${PV}.tar.gz \
+           file://0001-fix-build-with-musl.patch \
+          "
+
+SRC_URI[md5sum] = "12c05fd2811d989341d8c6d81f66af87"
+SRC_URI[sha256sum] = "63320ad7c45460e4a40e03f5aa4c6893783f21a16416c3282b994f933312afa2"
+FILES_${PN}-doc = "/usr/share"
+
+REAL_PV = "${@[d.getVar('PV',1)[:-1], d.getVar('PV',1)][(d.getVar('PV',1)[-1]).isdigit()]}"
+S = "${WORKDIR}/gc-${REAL_PV}"
+
+ARM_INSTRUCTION_SET = "arm"
+
+inherit autotools pkgconfig
+
+# by default use external libatomic-ops
+PACKAGECONFIG ??= "libatomic-ops"
+PACKAGECONFIG[libatomic-ops] = "--with-libatomic-ops=yes,--with-libatomic-ops=no,libatomic-ops"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/beecrypt/beecrypt/add-option-dev-dsp.patch b/meta/recipes-support/beecrypt/beecrypt/add-option-dev-dsp.patch
new file mode 100644
index 0000000..b3298ce
--- /dev/null
+++ b/meta/recipes-support/beecrypt/beecrypt/add-option-dev-dsp.patch
@@ -0,0 +1,34 @@
+Add config option --with-dev-dsp.
+
+Upstream-Status: Pending
+
+Signed-off-by: Zhang Xiao <xiao.zhang@windriver.com>
+---
+--- a/configure.ac
++++ b/configure.ac
+@@ -106,6 +106,16 @@ AC_ARG_WITH(python,[  --with-python[[=AR
+   fi
+   ])
+ 
++AC_ARG_WITH(dev-dsp,[  --with-dev-dsp          enables dev/dsp for entropy producing. auto for auto-detecting dev/dep on host. [[default=no]]],[
++  if test "$withval" = yes; then
++    AC_DEFINE([HAVE_DEV_DSP], 1)
++  else
++    if test "$withval" = auto;  then
++      ac_detect_dev_dsp=yes
++    fi
++  fi
++  ],[ac_detect_dev_dsp=no])
++
+ # Check for expert mode
+ if test "$ac_enable_expert_mode" = yes; then
+   BEE_EXPERT_MODE
+@@ -464,7 +474,7 @@ linux*)
+       ac_cv_have_dev_dsp=no
+     fi
+     ])
+-  if test "$ac_cv_have_dev_dsp" = yes; then
++  if test "$ac_cv_have_dev_dsp" = yes && test "$ac_detect_dev_dsp" = yes; then
+     AC_DEFINE([HAVE_DEV_DSP], 1)
+   fi
+   ;;
diff --git a/meta/recipes-support/beecrypt/beecrypt/beecrypt-enable-ptest-support.patch b/meta/recipes-support/beecrypt/beecrypt/beecrypt-enable-ptest-support.patch
new file mode 100644
index 0000000..3e5513f
--- /dev/null
+++ b/meta/recipes-support/beecrypt/beecrypt/beecrypt-enable-ptest-support.patch
@@ -0,0 +1,37 @@
+beecrypt: enable ptest support
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Add install-ptest rules.
+
+Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
+---
+ Makefile.am       | 3 +++
+ tests/Makefile.am | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/Makefile.am b/Makefile.am
+index b7e7869..5076f59 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -73,3 +73,6 @@ DISTCLEANFILES = mpopt.s blowfishopt.s sha1opt.s
+ 
+ bench:
+ 	(cd tests && $(MAKE) $(AM_MAKEFLAGS) bench)
++
++install-ptest:
++	(cd tests && $(MAKE) $(AM_MAKEFLAGS) check_PROGRAMS)
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 1604e5e..d8db8d8 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -101,3 +101,6 @@ bench: benchme benchrsa benchhf benchbc
+ 	./benchbc AES 128
+ 	./benchbc Blowfish 128
+ 	./benchbc Blowfish 128
++
++check_PROGRAMS:
++	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-support/beecrypt/beecrypt/disable-icu-check.patch b/meta/recipes-support/beecrypt/beecrypt/disable-icu-check.patch
new file mode 100644
index 0000000..91b1fa6
--- /dev/null
+++ b/meta/recipes-support/beecrypt/beecrypt/disable-icu-check.patch
@@ -0,0 +1,43 @@
+We are unable to run code at configure time in a cross environemnt, but as we
+control the build we can be fairly certain this dependency is met.
+
+Upstream-Status: Inappropriate [embedded specific]
+
+JL 05/07/10
+Index: beecrypt-4.2.1/configure.ac
+===================================================================
+--- beecrypt-4.2.1.orig/configure.ac	2010-11-26 17:12:25.000000000 +0800
++++ beecrypt-4.2.1/configure.ac	2010-11-26 17:12:30.000000000 +0800
+@@ -292,32 +292,6 @@
+ # Predefines and checks for C++ API support
+ AH_TEMPLATE([CPPGLUE],[Define to 1 if you want to include the C++ code])
+ 
+-if test "$ac_with_cplusplus" = yes; then
+-  AC_MSG_CHECKING([for IBM's ICU library version >= 2.8])
+-  AC_LANG_PUSH(C)
+-  AC_RUN_IFELSE([
+-    AC_LANG_PROGRAM([[#include <unicode/uversion.h>]],[[
+-      #if U_ICU_VERSION_MAJOR_NUM < 2
+-      exit(1);
+-      #elif U_ICU_VERSION_MAJOR_NUM == 2
+-      # if U_ICU_VERSION_MINOR_NUM < 8
+-      exit(1);
+-      # else
+-      exit(0);
+-      # endif
+-      #else
+-      exit(0);
+-      #endif
+-    ]])],[
+-    AC_MSG_RESULT([yes])
+-    ],[
+-    AC_MSG_RESULT([no])
+-    AC_MSG_WARN([disabling cplusplus])
+-    ac_with_cplusplus=no
+-    ])
+-  AC_LANG_POP(C)
+-fi
+-
+ AM_CONDITIONAL([WITH_CPLUSPLUS],[test "$ac_with_cplusplus" = yes])
+ 
+ if test "$ac_with_cplusplus" = yes ; then
diff --git a/meta/recipes-support/beecrypt/beecrypt/fix-for-gcc-4.7.patch b/meta/recipes-support/beecrypt/beecrypt/fix-for-gcc-4.7.patch
new file mode 100644
index 0000000..8144e39
--- /dev/null
+++ b/meta/recipes-support/beecrypt/beecrypt/fix-for-gcc-4.7.patch
@@ -0,0 +1,39 @@
+
+gcc-4.7 seems to be stricter about some things, so follow
+the suggestion from the error/note information.
+
+    ../../x86_64-linux-libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../.. 
+    x86_64-linux-libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../.. -I../../include -isyst
+    In file included from ../../include/beecrypt/c++/util/Hashtable.h:42:0,
+                     from ../../include/beecrypt/c++/util/Properties.h:36,
+                     from Properties.cxx:25:
+    ../../include/beecrypt/c++/util/AbstractSet.h: In instantiation of 'bool beecrypt::uti
+    Properties.cxx:228:1:   required from here
+    ../../include/beecrypt/c++/util/AbstractSet.h:59:27: error: 'containsAll' was not decl
+    ../../include/beecrypt/c++/util/AbstractSet.h:59:27: note: declarations in dependent b
+    ../../include/beecrypt/c++/util/AbstractSet.h:59:27: note: use 'this->containsAll' ins
+    ../../include/beecrypt/c++/util/AbstractSet.h: In instantiation of 'bool beecrypt::uti
+    Properties.cxx:228:1:   required from here
+    ../../include/beecrypt/c++/util/AbstractSet.h:59:27: error: 'containsAll' was not decl
+    ../../include/beecrypt/c++/util/AbstractSet.h:59:27: note: declarations in dependent b
+    ../../include/beecrypt/c++/util/AbstractSet.h:59:27: note: use 'this->containsAll' ins
+    
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: beecrypt-4.2.1/include/beecrypt/c++/util/AbstractSet.h
+===================================================================
+--- beecrypt-4.2.1.orig/include/beecrypt/c++/util/AbstractSet.h
++++ beecrypt-4.2.1/include/beecrypt/c++/util/AbstractSet.h
+@@ -56,7 +56,7 @@ namespace beecrypt {
+ 					if (c->size() != size())
+ 						return false;
+ 
+-					return containsAll(*c);
++					return this->containsAll(*c);
+ 				}
+ 				return false;
+ 			}
diff --git a/meta/recipes-support/beecrypt/beecrypt/fix-security.patch b/meta/recipes-support/beecrypt/beecrypt/fix-security.patch
new file mode 100644
index 0000000..6cb0c00
--- /dev/null
+++ b/meta/recipes-support/beecrypt/beecrypt/fix-security.patch
@@ -0,0 +1,47 @@
+Fix visibility of various C++ functions, inspired by a similar patch in the Fink
+project: 
+http://www.mail-archive.com/fink-commits@lists.sourceforge.net/msg75742.html
+
+JL 05/07/10 
+
+Upstream-Status: Pending
+
+Index: beecrypt-4.2.1/include/beecrypt/c++/beeyond/BeeCertificate.h
+===================================================================
+--- beecrypt-4.2.1.orig/include/beecrypt/c++/beeyond/BeeCertificate.h	2010-11-26 17:22:57.000000000 +0800
++++ beecrypt-4.2.1/include/beecrypt/c++/beeyond/BeeCertificate.h	2010-11-26 17:23:01.000000000 +0800
+@@ -147,13 +147,13 @@
+ 			mutable bytearray* enc;
+ 
+ 			BeeCertificate();
+-			BeeCertificate(InputStream& in) throw (IOException);
+ 
+ 			void encodeTBS(DataOutputStream& out) const throw (IOException);
+ 
+ 			bytearray* encodeTBS() const throw (CertificateEncodingException);
+ 
+ 		public:
++			BeeCertificate(InputStream& in) throw (IOException);
+ 			BeeCertificate(const BeeCertificate&) throw (CloneNotSupportedException);
+ 			virtual ~BeeCertificate();
+ 
+Index: beecrypt-4.2.1/include/beecrypt/c++/security/Security.h
+===================================================================
+--- beecrypt-4.2.1.orig/include/beecrypt/c++/security/Security.h	2010-11-26 17:20:55.000000000 +0800
++++ beecrypt-4.2.1/include/beecrypt/c++/security/Security.h	2010-11-26 17:21:36.000000000 +0800
+@@ -61,7 +61,6 @@
+ 			friend class SecureRandom;
+ 			friend class Signature;
+ 
+-		private:
+ 			struct spi
+ 			{
+ 				Object* cspi;
+@@ -76,6 +75,7 @@
+ 			static spi* getSpi(const String& algo, const String& type, const Provider&) throw (NoSuchAlgorithmException);
+ 			static spi* getFirstSpi(const String& type);
+ 
++		private:
+ 			static const String& getKeyStoreDefault();
+ 
+ 			static bool _init;
diff --git a/meta/recipes-support/beecrypt/beecrypt/run-ptest b/meta/recipes-support/beecrypt/beecrypt/run-ptest
new file mode 100644
index 0000000..2ee294d
--- /dev/null
+++ b/meta/recipes-support/beecrypt/beecrypt/run-ptest
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+cd tests
+for i in `ls`; do ./$i; if [ $? -eq 0 ]; then echo "PASS: $i"; \
+    else echo "FAIL: $i"; fi; done
diff --git a/meta/recipes-support/beecrypt/beecrypt_4.2.1.bb b/meta/recipes-support/beecrypt/beecrypt_4.2.1.bb
new file mode 100644
index 0000000..1e626f1
--- /dev/null
+++ b/meta/recipes-support/beecrypt/beecrypt_4.2.1.bb
@@ -0,0 +1,48 @@
+# Beecrypt OE build file
+# Copyright (C) 2004-2005, Advanced Micro Devices, Inc.  All Rights Reserved
+# Released under the MIT license (see packages/COPYING)
+
+SUMMARY = "A general-purpose cryptography library"
+HOMEPAGE = "http://sourceforge.net/projects/beecrypt"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/beecrypt/beecrypt-${PV}.tar.gz \
+           file://disable-icu-check.patch \
+           file://fix-security.patch \
+           file://fix-for-gcc-4.7.patch \
+           file://run-ptest \
+           file://beecrypt-enable-ptest-support.patch \
+           file://add-option-dev-dsp.patch \
+          "
+
+SRC_URI[md5sum] = "8441c014170823f2dff97e33df55af1e"
+SRC_URI[sha256sum] = "286f1f56080d1a6b1d024003a5fa2158f4ff82cae0c6829d3c476a4b5898c55d"
+
+LICENSE = "GPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=9894370afd5dfe7d02b8d14319e729a1 \
+                    file://COPYING.LIB;md5=dcf3c825659e82539645da41a7908589 \
+                    file://include/beecrypt/beecrypt.h;endline=20;md5=47a93eef539aac237eef86297a4d71c1"
+
+PR = "r3"
+
+inherit autotools multilib_header ptest
+acpaths=""
+
+do_install_append() {
+	oe_multilib_header beecrypt/gnu.h
+}
+
+EXTRA_OECONF = "--without-python --enable-shared --enable-static --disable-openmp --with-java=no"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[cplusplus] = "--with-cplusplus,--without-cplusplus,icu"
+
+FILES_${PN} = "${sysconfdir} ${libdir}/*.so.* ${libdir}/${BPN}/*.so.*"
+FILES_${PN}-dev += "${libdir}/${BPN}/*.so ${libdir}/${BPN}/*.la"
+FILES_${PN}-staticdev += "${libdir}/${BPN}/*.a"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_ptest () {
+	mkdir ${D}${PTEST_PATH}/tests
+	cp -r ${B}/tests/.libs/test* ${D}${PTEST_PATH}/tests
+}
diff --git a/meta/recipes-support/boost/bjam-native_1.58.0.bb b/meta/recipes-support/boost/bjam-native_1.58.0.bb
new file mode 100644
index 0000000..32646d7
--- /dev/null
+++ b/meta/recipes-support/boost/bjam-native_1.58.0.bb
@@ -0,0 +1,18 @@
+include boost-${PV}.inc
+
+SUMMARY = "Portable Boost.Jam build tool for boost"
+SECTION = "devel"
+
+inherit native
+
+SRC_URI += "file://bjam-native-build-bjam.debug.patch"
+
+do_compile() {
+    ./bootstrap.sh --with-toolset=gcc
+}
+
+do_install() {
+    install -d ${D}${bindir}/
+    # install unstripped version for bjam
+    install -c -m 755 bjam.debug ${D}${bindir}/bjam
+}
diff --git a/meta/recipes-support/boost/boost-1.58.0.inc b/meta/recipes-support/boost/boost-1.58.0.inc
new file mode 100644
index 0000000..b47d091
--- /dev/null
+++ b/meta/recipes-support/boost/boost-1.58.0.inc
@@ -0,0 +1,22 @@
+# The Boost web site provides free peer-reviewed portable
+# C++ source libraries. The emphasis is on libraries which
+# work well with the C++ Standard Library. The libraries are
+# intended to be widely useful, and are in regular use by
+# thousands of programmers across a broad spectrum of applications.
+HOMEPAGE = "http://www.boost.org/"
+LICENSE = "BSL-1.0 & MIT & Python-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
+
+BOOST_VER = "${@"_".join(d.getVar("PV",1).split("."))}"
+BOOST_MAJ = "${@"_".join(d.getVar("PV",1).split(".")[0:2])}"
+BOOST_P = "boost_${BOOST_VER}"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/boost/${BOOST_P}.tar.bz2 \
+           file://0001-mips1-fix-added-gcc.jam-was-passing-the-options-m32-.patch \
+           file://0002-Don-t-pass-m32-m64-where-it-s-not-supported.patch \
+"
+
+SRC_URI[md5sum] = "b8839650e61e9c1c0a89f371dd475546"
+SRC_URI[sha256sum] = "fdfc204fc33ec79c99b9a74944c3e54bd78be4f7f15e260c0e2700a36dc7d3e5"
+
+S = "${WORKDIR}/${BOOST_P}"
diff --git a/meta/recipes-support/boost/boost.inc b/meta/recipes-support/boost/boost.inc
new file mode 100644
index 0000000..3288e84
--- /dev/null
+++ b/meta/recipes-support/boost/boost.inc
@@ -0,0 +1,192 @@
+SUMMARY = "Free peer-reviewed portable C++ source libraries"
+SECTION = "libs"
+DEPENDS = "bjam-native zlib bzip2"
+
+ARM_INSTRUCTION_SET = "arm"
+
+BOOST_LIBS = "\
+	atomic \
+	chrono \
+	date_time \
+	filesystem \
+	graph \
+	iostreams \
+	log \
+	program_options \
+	random \
+	regex \
+	serialization \
+	signals \
+	system \
+	test \
+	thread \
+	"
+
+# optional boost-python library
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[python] = ",,python python3"
+BOOST_LIBS += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python python3', '', d)}"
+inherit python-dir
+PYTHON_ROOT = "${STAGING_DIR_HOST}/${prefix}"
+
+# Make a package for each library, plus -dev
+PACKAGES = "${PN}-dbg ${BOOST_PACKAGES}"
+python __anonymous () {
+    packages = []
+    extras = []
+    for lib in d.getVar('BOOST_LIBS', True).split( ):
+        # BJAM does not know '--with-python3' (only --with-python)
+        if lib != "python3":
+            extras.append("--with-%s" % lib)
+        pkg = "boost-%s" % lib.replace("_", "-")
+        packages.append(pkg)
+        if lib == "python":
+            # special: python*.so matches python3.so !!
+            if not d.getVar("FILES_%s" % pkg, True):
+                    d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s.so.*" % lib)
+        else:
+            if not d.getVar("FILES_%s" % pkg, True):
+                    d.setVar("FILES_%s" % pkg, "${libdir}/libboost_%s*.so.*" % lib)
+    d.setVar("BOOST_PACKAGES", " ".join(packages))
+    d.setVar("BJAM_EXTRA", " ".join(extras))
+}
+
+# Override the contents of specific packages
+FILES_boost-serialization = "${libdir}/libboost_serialization*.so.* \
+	${libdir}/libboost_wserialization*.so.*"
+FILES_boost-test = "${libdir}/libboost_prg_exec_monitor*.so.* \
+	${libdir}/libboost_unit_test_framework*.so.*"
+
+# -dev last to pick up the remaining stuff
+PACKAGES += "${PN}-dev ${PN}-staticdev"
+FILES_${PN}-dev = "${includedir} ${libdir}/libboost_*.so"
+FILES_${PN}-staticdev = "${libdir}/libboost_*.a"
+
+# "boost" is a metapackage which pulls in all boost librabries
+PACKAGES += "${PN}"
+RRECOMMENDS_${PN} += "${BOOST_PACKAGES}"
+RRECOMMENDS_${PN}_class-native = ""
+ALLOW_EMPTY_${PN} = "1"
+
+# to avoid GNU_HASH QA errors added LDFLAGS to ARCH; a little bit dirty but at least it works
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+# Oh yippee, a new build system, it's sooo cooool I could eat my own
+# foot.  inlining=on lets the compiler choose, I think.  At least this
+# stuff is documented...
+# NOTE: if you leave <debug-symbols>on then in a debug build the build sys
+# objcopy will be invoked, and that won't work.  Building debug apparently
+# requires hacking gcc-tools.jam
+#
+# Sometimes I wake up screaming.  Famous figures are gathered in the nightmare,
+# Steve Bourne, Larry Wall, the whole of the ANSI C committee.  They're just
+# standing there, waiting, but the truely terrifying thing is what they carry
+# in their hands.  At first sight each seems to bear the same thing, but it is
+# not so for the forms in their grasp are ever so slightly different one from
+# the other.  Each is twisted in some grotesque way from the other to make each
+# an unspeakable perversion impossible to perceive without the onset of madness.
+# True insanity awaits anyone who perceives all of these horrors together.
+#
+# Quotation marks, there might be an easier way to do this, but I can't find
+# it.  The problem is that the user.hpp configuration file must receive a
+# pre-processor macro defined as the appropriate string - complete with "'s
+# around it.  (<> is a possibility here but the danger to that is that the
+# failure case interprets the < and > as shell redirections, creating
+# random files in the source tree.)
+#
+#bjam: '-DBOOST_PLATFORM_CONFIG=\"config\"'
+#do_compile: '-sGCC=... '"'-DBOOST_PLATFORM_CONFIG=\"config\"'"
+SQD = '"'
+EQD = '\"'
+#boost.bb:   "...  '-sGCC=... '${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}config${EQD}'${SQD} ..."
+BJAM_CONF = "${SQD}'-DBOOST_PLATFORM_CONFIG=${EQD}boost/config/platform/${TARGET_OS}.hpp${EQD}'${SQD}"
+
+BJAM_TOOLS   = "--ignore-site-config \
+		'-sTOOLS=gcc' \
+		'-sGCC=${CC} '${BJAM_CONF} \
+		'-sGXX=${CXX} '${BJAM_CONF} \
+		'-sGCC_INCLUDE_DIRECTORY=${STAGING_INCDIR}' \
+		'-sGCC_STDLIB_DIRECTORY=${STAGING_LIBDIR}' \
+		'-sBUILD=release <optimization>space <threading>multi <inlining>on <debug-symbols>off' \
+		'-sPYTHON_ROOT=${PYTHON_ROOT}' \
+		'--layout=system' \
+		"
+
+# use PARALLEL_MAKE to speed up the build, but limit it by -j 64, greater paralelism causes bjam to segfault or to ignore -j
+# https://svn.boost.org/trac/boost/ticket/7634
+def get_boost_parallel_make(bb, d):
+    pm = d.getVar('PARALLEL_MAKE', True)
+    if pm:
+        # look for '-j' and throw other options (e.g. '-l') away
+        # because they might have different meaning in bjam
+        pm = pm.split()
+        while pm:
+            v = None
+            opt = pm.pop(0)
+            if opt == '-j':
+                v = pm.pop(0)
+            elif opt.startswith('-j'):
+                v = opt[2:].strip()
+            else:
+                v = None
+
+            if v:
+                v = min(64, int(v))
+                return '-j' + str(v)
+
+    return ""
+
+BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(bb, d)}"
+BJAM_OPTS    = '${BOOST_PARALLEL_MAKE} \
+		${BJAM_TOOLS} \
+		-sBOOST_BUILD_USER_CONFIG=${S}/tools/build/example/user-config.jam \
+		--builddir=${S}/${TARGET_SYS} \
+		--disable-icu \
+		${BJAM_EXTRA}'
+
+# Native compilation of bzip2 isn't working
+BJAM_OPTS_append_class-native = ' -sNO_BZIP2=1'
+
+do_boostconfig() {
+	cp -f boost/config/platform/linux.hpp boost/config/platform/linux-gnueabi.hpp
+
+	# D2194:Fixing the failure of "error: duplicate initialization of gcc with the following parameters" during compilation.
+	sed -i "/^using gcc : 4.3.1/d" ${S}/tools/build/example/user-config.jam
+	sed -i "/^using python : ${PYTHON_BASEVERSION}"/d ${S}/tools/build/example/user-config.jam
+	echo 'using gcc : 4.3.1 : ${CXX} : <cflags>"${CFLAGS}" <cxxflags>"${CXXFLAGS}" <linkflags>"${LDFLAGS}" ;' >> ${S}/tools/build/example/user-config.jam
+	echo "using python : ${PYTHON_BASEVERSION} : : ${STAGING_INCDIR}/python${PYTHON_BASEVERSION} ;" >> ${S}/tools/build/example/user-config.jam
+	echo "using python : 3.4 : : ${STAGING_INCDIR}/python3.4m ;" >> ${S}/tools/build/example/user-config.jam
+
+	CC="${BUILD_CC}" CFLAGS="${BUILD_CFLAGS}" ./bootstrap.sh --with-bjam=bjam --with-toolset=gcc --with-python-root=${PYTHON_ROOT}
+	sed -i '/^using python/d' project-config.jam
+}
+
+do_boostconfig[dirs] = "${S}"
+addtask do_boostconfig after do_patch before do_configure
+
+do_compile() {
+	set -ex
+	bjam ${BJAM_OPTS} --prefix=${prefix} \
+		--exec-prefix=${exec_prefix} \
+		--libdir=${libdir} \
+		--includedir=${includedir}
+}
+
+do_install() {
+	set -ex
+	bjam ${BJAM_OPTS} \
+		--libdir=${D}${libdir} \
+		--includedir=${D}${includedir} \
+		install
+	for lib in ${BOOST_LIBS}; do
+		if [ -e ${D}${libdir}/libboost_${lib}.a ]; then
+			ln -s libboost_${lib}.a ${D}${libdir}/libboost_${lib}-mt.a
+		fi
+		if [ -e ${D}${libdir}/libboost_${lib}.so ]; then
+			ln -s libboost_${lib}.so ${D}${libdir}/libboost_${lib}-mt.so
+		fi
+	done
+
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/boost/boost/arm-intrinsics.patch b/meta/recipes-support/boost/boost/arm-intrinsics.patch
new file mode 100644
index 0000000..fe85c69
--- /dev/null
+++ b/meta/recipes-support/boost/boost/arm-intrinsics.patch
@@ -0,0 +1,55 @@
+Upstream-Status: Backport
+
+8/17/2010 - rebased to 1.44 by Qing He <qing.he@intel.com>
+
+diff --git a/boost/smart_ptr/detail/atomic_count_sync.hpp b/boost/smart_ptr/detail/atomic_count_sync.hpp
+index b6359b5..78b1cc2 100644
+--- a/boost/smart_ptr/detail/atomic_count_sync.hpp
++++ b/boost/smart_ptr/detail/atomic_count_sync.hpp
+@@ -33,17 +33,46 @@ public:
+ 
+     long operator++()
+     {
++#ifdef __ARM_ARCH_7A__
++       int v1, tmp;
++       asm volatile ("1:                 \n\t"
++                     "ldrex   %0, %1     \n\t"
++                     "add     %0 ,%0, #1 \n\t"
++                     "strex   %2, %0, %1 \n\t"
++                     "cmp     %2, #0     \n\t"
++                     "bne     1b         \n\t"
++                     : "=&r" (v1), "+Q"(value_), "=&r"(tmp)
++                    );
++#else
+         return __sync_add_and_fetch( &value_, 1 );
++#endif
+     }
+ 
+     long operator--()
+     {
++#ifdef __ARM_ARCH_7A__
++       int v1, tmp;
++       asm volatile ("1:                 \n\t"
++                     "ldrex   %0, %1     \n\t"
++                     "sub     %0 ,%0, #1 \n\t"
++                     "strex   %2, %0, %1 \n\t"
++                     "cmp     %2, #0     \n\t"
++                     "bne     1b         \n\t"
++                     : "=&r" (v1), "+Q"(value_), "=&r"(tmp)
++                    );
++       return value_;
++#else
+         return __sync_add_and_fetch( &value_, -1 );
++#endif
+     }
+ 
+     operator long() const
+     {
++#if __ARM_ARCH_7A__
++        return value_;
++#else
+         return __sync_fetch_and_add( &value_, 0 );
++#endif
+     }
+ 
+ private:
diff --git a/meta/recipes-support/boost/boost_1.58.0.bb b/meta/recipes-support/boost/boost_1.58.0.bb
new file mode 100644
index 0000000..c09d5f4
--- /dev/null
+++ b/meta/recipes-support/boost/boost_1.58.0.bb
@@ -0,0 +1,6 @@
+include boost-${PV}.inc
+include boost.inc
+
+SRC_URI += "\
+    file://arm-intrinsics.patch \
+"
diff --git a/meta/recipes-support/boost/files/0001-mips1-fix-added-gcc.jam-was-passing-the-options-m32-.patch b/meta/recipes-support/boost/files/0001-mips1-fix-added-gcc.jam-was-passing-the-options-m32-.patch
new file mode 100644
index 0000000..329b4c3
--- /dev/null
+++ b/meta/recipes-support/boost/files/0001-mips1-fix-added-gcc.jam-was-passing-the-options-m32-.patch
@@ -0,0 +1,33 @@
+From 817aed0d755bf8c0ba4ef6a77d41538e50b571fd Mon Sep 17 00:00:00 2001
+From: claymore <carlosmf.pt@gmail.com>
+Date: Fri, 24 Apr 2015 02:28:47 +0100
+Subject: [PATCH 1/2] mips1 fix added gcc.jam was passing the options -m32 and
+ -m64 to mips cross-compilers, when those do not use
+ such options This modification solves it by adding mips
+ as an exception
+
+Signed-off-by: Carlos M. Ferreira carlosmf.pt@gmail.com
+
+Upstream-Status: Backport
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+---
+ tools/build/src/tools/gcc.jam |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/build/src/tools/gcc.jam b/tools/build/src/tools/gcc.jam
+index db04534..eff95ae 100644
+--- a/tools/build/src/tools/gcc.jam
++++ b/tools/build/src/tools/gcc.jam
+@@ -451,7 +451,7 @@ rule setup-address-model ( targets * : sources * : properties * )
+         else
+         {
+             local arch = [ feature.get-values architecture : $(properties) ] ;
+-            if $(arch) != arm
++            if $(arch) != arm && $(arch) != mips1
+             {
+                 if $(model) = 32
+                 {
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-support/boost/files/0002-Don-t-pass-m32-m64-where-it-s-not-supported.patch b/meta/recipes-support/boost/files/0002-Don-t-pass-m32-m64-where-it-s-not-supported.patch
new file mode 100644
index 0000000..ecf7e55
--- /dev/null
+++ b/meta/recipes-support/boost/files/0002-Don-t-pass-m32-m64-where-it-s-not-supported.patch
@@ -0,0 +1,40 @@
+From f825634a56b119dfa9d712119a66279cc7635978 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
+Date: Sat, 2 May 2015 14:24:02 +0200
+Subject: [PATCH 2/2] Don't pass -m32/-m64 where it's not supported.
+
+Only PowerPC, SPARC, and x86 do support the -m32 and -m64 compiler options [1].
+
+Rather then excluding all architectures not supporting these options as it is
+done in commit c0634341d9ee2c02d3a55c91dafb988afc066c49 [2], include all
+architectures that do support them.
+
+This will fix building Boost for the SuperH architecture with Buildroot [3].
+
+[1] https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html
+[2] https://github.com/boostorg/build/commit/c0634341d9ee2c02d3a55c91dafb988afc066c49
+[3] http://autobuild.buildroot.net/results/ccd/ccd5c83963032ba49b1627b1dff39e34a9486943/build-end.log
+
+Upstream-Status: Backport
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+---
+ tools/build/src/tools/gcc.jam |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/build/src/tools/gcc.jam b/tools/build/src/tools/gcc.jam
+index eff95ae..2f6af93 100644
+--- a/tools/build/src/tools/gcc.jam
++++ b/tools/build/src/tools/gcc.jam
+@@ -451,7 +451,7 @@ rule setup-address-model ( targets * : sources * : properties * )
+         else
+         {
+             local arch = [ feature.get-values architecture : $(properties) ] ;
+-            if $(arch) != arm && $(arch) != mips1
++            if $(arch) = power || $(arch) = sparc || $(arch) = x86
+             {
+                 if $(model) = 32
+                 {
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch b/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch
new file mode 100644
index 0000000..9f8b7ea
--- /dev/null
+++ b/meta/recipes-support/boost/files/bjam-native-build-bjam.debug.patch
@@ -0,0 +1,50 @@
+From 619ada314ab26c0c9cbfe5702cd9c0caa8f6415a Mon Sep 17 00:00:00 2001
+From: Wenzong Fan <wenzong.fan@windriver.com>
+Date: Mon, 3 Aug 2015 17:12:33 +0800
+Subject: [PATCH] bjam-native: build bjam.debug
+
+bjam is stripped by default, this causes QA warning while stripping it
+from do_populate_sysroot():
+
+  WARNING: File '.../tmp/sysroots/x86_64-linux/usr/bin/bjam' \
+    from bjam-native was already stripped, \
+    this will prevent future debugging!
+
+The JAM scripts allow to build unstripped version with '--debug'. Just
+build and install the bjam.debug to stop bjam from being stripped in
+compile step.
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+---
+ bootstrap.sh                    | 1 +
+ tools/build/src/engine/build.sh | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/bootstrap.sh b/bootstrap.sh
+index 98cf88b..54690aa 100755
+--- a/bootstrap.sh
++++ b/bootstrap.sh
+@@ -228,6 +228,7 @@ if test "x$BJAM" = x; then
+   echo "tools/build/src/engine/$arch/b2"
+   cp "$BJAM" .
+   cp "$my_dir/tools/build/src/engine/$arch/bjam" .
++  cp "$my_dir/tools/build/src/engine/${arch}.debug/bjam" bjam.debug
+ 
+ fi
+ 
+diff --git a/tools/build/src/engine/build.sh b/tools/build/src/engine/build.sh
+index 6dbc706..c69fdc7 100755
+--- a/tools/build/src/engine/build.sh
++++ b/tools/build/src/engine/build.sh
+@@ -312,5 +312,5 @@ if test -x "./bootstrap/jam0" ; then
+     if test "${BJAM_UPDATE}" != "update" ; then
+         echo_run ./bootstrap/jam0 -f build.jam --toolset=$BOOST_JAM_TOOLSET "--toolset-root=$BOOST_JAM_TOOLSET_ROOT" "$@" clean
+     fi
+-    echo_run ./bootstrap/jam0 -f build.jam --toolset=$BOOST_JAM_TOOLSET "--toolset-root=$BOOST_JAM_TOOLSET_ROOT" "$@"
++    echo_run ./bootstrap/jam0 -f build.jam --toolset=$BOOST_JAM_TOOLSET "--toolset-root=$BOOST_JAM_TOOLSET_ROOT" "$@" --debug
+ fi
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch b/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch
new file mode 100644
index 0000000..4b4b287
--- /dev/null
+++ b/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch
@@ -0,0 +1,30 @@
+ca-certificates is a package from Debian, but some host distros such as Fedora
+have a leaner run-parts provided by cron which doesn't support --verbose or the
+ -- separator between arguments and paths.
+
+This solves errors such as
+
+| Running hooks in [...]/rootfs/etc/ca-certificates/update.d...
+| [...]/usr/sbin/update-ca-certificates: line 194: Not: command not found
+
+Upstream-Status: Inappropriate
+Signed-off-by: Ross Burton <ross.burton@intel.com>
+---
+ sbin/update-ca-certificates | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+Index: git/sbin/update-ca-certificates
+===================================================================
+--- git.orig/sbin/update-ca-certificates
++++ git/sbin/update-ca-certificates
+@@ -191,9 +191,7 @@ if [ -d "$HOOKSDIR" ]
+ then
+ 
+   echo "Running hooks in $HOOKSDIR..."
+-  VERBOSE_ARG=
+-  [ "$verbose" = 0 ] || VERBOSE_ARG="--verbose"
+-  eval run-parts "$VERBOSE_ARG" --test -- "$HOOKSDIR" | while read hook
++  eval run-parts --test -- "$HOOKSDIR" | while read hook
+   do
+     ( cat "$ADDED"
+       cat "$REMOVED" ) | "$hook" || echo "E: $hook exited with code $?."
diff --git a/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-remove-c-rehash.patch b/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-remove-c-rehash.patch
new file mode 100644
index 0000000..bf02723
--- /dev/null
+++ b/meta/recipes-support/ca-certificates/ca-certificates/0001-update-ca-certificates-remove-c-rehash.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Pending
+
+From 111e905fe931da1a3800accfc675cc01c8ee080c Mon Sep 17 00:00:00 2001
+From: Ulf Samuelsson <ulf@emagii.com>
+Date: Tue, 28 Feb 2012 06:42:58 +0100
+Subject: [PATCH] update-ca-certificates: remove c rehash
+
+Updated earlier patch to apply clean on 2012-02-12
+Signed-off-by: Ulf Samuelsson <ulf@emagii.com>
+---
+ sbin/update-ca-certificates |   20 ++++++++++----------
+ 1 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/sbin/update-ca-certificates b/sbin/update-ca-certificates
+index 5375950..c567e3d 100755
+--- a/sbin/update-ca-certificates
++++ b/sbin/update-ca-certificates
+@@ -132,16 +132,16 @@ rm -f "$CERTBUNDLE"
+ ADDED_CNT=$(wc -l < "$ADDED")
+ REMOVED_CNT=$(wc -l < "$REMOVED")
+
+-if [ "$ADDED_CNT" -gt 0 ] || [ "$REMOVED_CNT" -gt 0 ]
+-then
+-  # only run if set of files has changed
+-  if [ "$verbose" = 0 ]
+-  then
+-    c_rehash . > /dev/null
+-  else
+-    c_rehash .
+-  fi
+-fi
++#if [ "$ADDED_CNT" -gt 0 ] || [ "$REMOVED_CNT" -gt 0 ]
++#then
++#  # only run if set of files has changed
++#  if [ "$verbose" = 0 ]
++#  then
++#    c_rehash . > /dev/null
++#  else
++#    c_rehash .
++#  fi
++#fi
+
+ chmod 0644 "$TEMPBUNDLE"
+ mv -f "$TEMPBUNDLE" "$CERTBUNDLE"
+--
+1.7.4.1
diff --git a/meta/recipes-support/ca-certificates/ca-certificates/0002-update-ca-certificates-use-SYSROOT.patch b/meta/recipes-support/ca-certificates/ca-certificates/0002-update-ca-certificates-use-SYSROOT.patch
new file mode 100644
index 0000000..792b403
--- /dev/null
+++ b/meta/recipes-support/ca-certificates/ca-certificates/0002-update-ca-certificates-use-SYSROOT.patch
@@ -0,0 +1,46 @@
+Upstream-Status: Pending
+
+From 724cb153ca0f607fb38b3a8db3ebb2742601cd81 Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <obi@opendreambox.org>
+Date: Tue, 19 Mar 2013 17:14:33 +0100
+Subject: [PATCH 2/2] update-ca-certificates: use $SYSROOT
+
+Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
+---
+ sbin/update-ca-certificates |   14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+Index: git/sbin/update-ca-certificates
+===================================================================
+--- git.orig/sbin/update-ca-certificates
++++ git/sbin/update-ca-certificates
+@@ -24,12 +24,12 @@
+ verbose=0
+ fresh=0
+ default=0
+-CERTSCONF=/etc/ca-certificates.conf
+-CERTSDIR=/usr/share/ca-certificates
+-LOCALCERTSDIR=/usr/local/share/ca-certificates
++CERTSCONF=$SYSROOT/etc/ca-certificates.conf
++CERTSDIR=$SYSROOT/usr/share/ca-certificates
++LOCALCERTSDIR=$SYSROOT/usr/local/share/ca-certificates
+ CERTBUNDLE=ca-certificates.crt
+-ETCCERTSDIR=/etc/ssl/certs
+-HOOKSDIR=/etc/ca-certificates/update.d
++ETCCERTSDIR=$SYSROOT/etc/ssl/certs
++HOOKSDIR=$SYSROOT/etc/ca-certificates/update.d
+ 
+ while [ $# -gt 0 ];
+ do
+@@ -92,9 +92,9 @@ add() {
+   PEM="$ETCCERTSDIR/$(basename "$CERT" .crt | sed -e 's/ /_/g' \
+                                                   -e 's/[()]/=/g' \
+                                                   -e 's/,/_/g').pem"
+-  if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "$CERT" ]
++  if ! test -e "$PEM" || [ "$(readlink "$PEM")" != "${CERT##$SYSROOT}" ]
+   then
+-    ln -sf "$CERT" "$PEM"
++    ln -sf "${CERT##$SYSROOT}" "$PEM"
+     echo "+$PEM" >> "$ADDED"
+   fi
+   # Add trailing newline to certificate, if it is missing (#635570)
diff --git a/meta/recipes-support/ca-certificates/ca-certificates/default-sysroot.patch b/meta/recipes-support/ca-certificates/ca-certificates/default-sysroot.patch
new file mode 100644
index 0000000..f8b0791
--- /dev/null
+++ b/meta/recipes-support/ca-certificates/ca-certificates/default-sysroot.patch
@@ -0,0 +1,50 @@
+Upstream-Status: Pending
+
+update-ca-certificates: find SYSROOT relative to its own location
+
+This makes the script relocatable.
+
+Index: git/sbin/update-ca-certificates
+===================================================================
+--- git.orig/sbin/update-ca-certificates
++++ git/sbin/update-ca-certificates
+@@ -66,6 +66,39 @@ do
+   shift
+ done
+ 
++if [ -z "$SYSROOT" ]; then
++  local_which () {
++    if [ $# -lt 1 ]; then
++      return 1
++    fi
++
++    (
++      IFS=:
++      for entry in $PATH; do
++        if [ -x "$entry/$1" ]; then
++          echo "$entry/$1"
++          exit 0
++        fi
++      done
++      exit 1
++    )
++  }
++
++  case "$0" in
++    */*)
++      sbindir=$(cd ${0%/*} && pwd)
++      ;;
++    *)
++      sbindir=$(cd $(dirname $(local_which $0)) && pwd)
++      ;;
++  esac
++  prefix=${sbindir%/*}
++  SYSROOT=${prefix%/*}
++  if [ ! -d "$SYSROOT/usr/share/ca-certificates" ]; then
++    SYSROOT=
++  fi
++fi
++
+ if [ ! -s "$CERTSCONF" ]
+ then
+   fresh=1
diff --git a/meta/recipes-support/ca-certificates/ca-certificates/sbindir.patch b/meta/recipes-support/ca-certificates/ca-certificates/sbindir.patch
new file mode 100644
index 0000000..a113fa8
--- /dev/null
+++ b/meta/recipes-support/ca-certificates/ca-certificates/sbindir.patch
@@ -0,0 +1,20 @@
+Upstream-Status: Pending
+
+Let us alter the install destination of the script via SBINDIR
+
+--- ca-certificates-20130119.orig/sbin/Makefile
++++ ca-certificates-20130119/sbin/Makefile
+@@ -3,9 +3,12 @@
+ #
+ #
+
++SBINDIR = /usr/sbin
++
+ all:
+
+ clean:
+
+ install:
+-	install -m755 update-ca-certificates $(DESTDIR)/usr/sbin/
++	install -d $(DESTDIR)$(SBINDIR)
++	install -m755 update-ca-certificates $(DESTDIR)$(SBINDIR)/
diff --git a/meta/recipes-support/ca-certificates/ca-certificates_20150426.bb b/meta/recipes-support/ca-certificates/ca-certificates_20150426.bb
new file mode 100644
index 0000000..716e3df
--- /dev/null
+++ b/meta/recipes-support/ca-certificates/ca-certificates_20150426.bb
@@ -0,0 +1,80 @@
+SUMMARY = "Common CA certificates"
+DESCRIPTION = "This package includes PEM files of CA certificates to allow \
+SSL-based applications to check for the authenticity of SSL connections. \
+This derived from Debian's CA Certificates."
+HOMEPAGE = "http://packages.debian.org/sid/ca-certificates"
+SECTION = "misc"
+LICENSE = "GPL-2.0+ & MPL-2.0"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=48d2baf97986999e776b43c8dd9e0c5a"
+
+# This is needed to ensure we can run the postinst at image creation time
+DEPENDS = "ca-certificates-native"
+DEPENDS_class-native = ""
+
+# tag: debian/20150426 + 2
+SRCREV = "d4790d2832aaac9152f450e06661511067592227"
+
+SRC_URI = "git://anonscm.debian.org/collab-maint/ca-certificates.git \
+           file://0001-update-ca-certificates-remove-c-rehash.patch \
+           file://0002-update-ca-certificates-use-SYSROOT.patch \
+           file://0001-update-ca-certificates-don-t-use-Debianisms-in-run-p.patch \
+           file://default-sysroot.patch \
+           file://sbindir.patch"
+
+S = "${WORKDIR}/git"
+
+inherit allarch
+
+EXTRA_OEMAKE = "\
+    'CERTSDIR=${datadir}/ca-certificates' \
+    'SBINDIR=${sbindir}' \
+"
+
+do_compile_prepend() {
+    oe_runmake clean
+}
+
+do_install () {
+    install -d ${D}${datadir}/ca-certificates \
+               ${D}${sysconfdir}/ssl/certs \
+               ${D}${sysconfdir}/ca-certificates/update.d
+    oe_runmake 'DESTDIR=${D}' install
+
+    install -d ${D}${mandir}/man8
+    install -m 0644 sbin/update-ca-certificates.8 ${D}${mandir}/man8/
+
+    install -d ${D}${sysconfdir}
+    {
+        echo "# Lines starting with # will be ignored"
+        echo "# Lines starting with ! will remove certificate on next update"
+        echo "#"
+        find ${D}${datadir}/ca-certificates -type f -name '*.crt' | \
+            sed 's,^${D}${datadir}/ca-certificates/,,'
+    } >${D}${sysconfdir}/ca-certificates.conf
+}
+
+do_install_append_class-target () {
+    sed -i -e 's,/etc/,${sysconfdir}/,' \
+           -e 's,/usr/share/,${datadir}/,' \
+           -e 's,/usr/local,${prefix}/local,' \
+        ${D}${sbindir}/update-ca-certificates \
+        ${D}${mandir}/man8/update-ca-certificates.8
+}
+
+pkg_postinst_${PN} () {
+    SYSROOT="$D" update-ca-certificates
+}
+
+CONFFILES_${PN} += "${sysconfdir}/ca-certificates.conf"
+
+# Postinsts don't seem to be run for nativesdk packages when populating SDKs.
+CONFFILES_${PN}_append_class-nativesdk = " ${sysconfdir}/ssl/certs/ca-certificates.crt"
+do_install_append_class-nativesdk () {
+    SYSROOT="${D}${SDKPATHNATIVE}" update-ca-certificates
+}
+
+do_install_append_class-native () {
+    SYSROOT="${D}${base_prefix}" ${D}${sbindir}/update-ca-certificates
+}
+
+BBCLASSEXTEND += "native nativesdk"
diff --git a/meta/recipes-support/consolekit/consolekit/add-polkit-configure-argument.patch b/meta/recipes-support/consolekit/consolekit/add-polkit-configure-argument.patch
new file mode 100644
index 0000000..ad879d4
--- /dev/null
+++ b/meta/recipes-support/consolekit/consolekit/add-polkit-configure-argument.patch
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+--- ConsoleKit-0.4.6.orig/configure.ac
++++ ConsoleKit-0.4.6/configure.ac
+@@ -56,10 +56,24 @@ PKG_CHECK_MODULES(CONSOLE_KIT,
+   gthread-2.0 >= $GLIB_REQUIRED_VERSION
+ )
+
+-PKG_CHECK_MODULES(POLKIT,
+-  polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
+-  have_polkit=yes,
+-  have_polkit=no)
++AC_ARG_WITH([polkit],
++  [AS_HELP_STRING([--with-polkit],
++    [support PolicyKit @<:@default=check@:>@])],
++  [],
++  [with_polkit=check])
++
++AS_IF([test "x$with_polkit" != xno],
++  [PKG_CHECK_MODULES(POLKIT,
++     polkit-gobject-1 >= $POLKIT_REQUIRED_VERSION,
++     have_polkit=yes,
++     [if test "x$with_polkit" != xcheck; then
++       AC_MSG_FAILURE(
++         [--with-polkit was given, but test for polkit failed])
++      else
++        have_polkit=no
++      fi
++     ])])
++
+ if test "x$have_polkit" = "xyes" ; then
+        AC_DEFINE(HAVE_POLKIT, [], [Define if we have polkit])
+ fi
diff --git a/meta/recipes-support/consolekit/consolekit/sepbuildfix.patch b/meta/recipes-support/consolekit/consolekit/sepbuildfix.patch
new file mode 100644
index 0000000..f2f9b9c
--- /dev/null
+++ b/meta/recipes-support/consolekit/consolekit/sepbuildfix.patch
@@ -0,0 +1,19 @@
+Fix builds in the case of seprate source from the build directory.
+
+RP 2013/4/17
+
+Upstream-Status: Pending
+
+Index: pam-ck-connector/Makefile.am
+===================================================================
+--- consolekit/pam-ck-connector.orig/Makefile.am	2010-09-03 13:54:31.000000000 +0000
++++ consolekit/pam-ck-connector/Makefile.am	2013-04-17 09:06:49.093524918 +0000
+@@ -4,7 +4,7 @@
+ 
+ INCLUDES = 					\
+ 	$(LIBDBUS_CFLAGS)			\
+-	-I$(top_builddir)/libck-connector	\
++	-I$(top_srcdir)/libck-connector	\
+ 	$(NULL)
+ 
+ pamlibdir = $(PAM_MODULE_DIR)
diff --git a/meta/recipes-support/consolekit/consolekit_0.4.6.bb b/meta/recipes-support/consolekit/consolekit_0.4.6.bb
new file mode 100644
index 0000000..66a892a
--- /dev/null
+++ b/meta/recipes-support/consolekit/consolekit_0.4.6.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Framework for defining and tracking users, login sessions, and seats"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/ConsoleKit"
+BUGTRACKER = "https://bugs.freedesktop.org/buglist.cgi?query_format=specific&product=ConsoleKit"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://src/main.c;endline=21;md5=0a994e09769780220163255d8f9071c3"
+
+DEPENDS = "glib-2.0 glib-2.0-native dbus dbus-glib virtual/libx11"
+RDEPENDS_${PN} += "base-files"
+
+inherit autotools pkgconfig distro_features_check
+# depends on virtual/libx11
+REQUIRED_DISTRO_FEATURES = "x11"
+
+SRC_URI = "http://www.freedesktop.org/software/ConsoleKit/dist/ConsoleKit-${PV}.tar.xz \
+           file://sepbuildfix.patch \
+           file://add-polkit-configure-argument.patch \
+"
+
+SRC_URI[md5sum] = "611792b4d616253a5bdec9175f8b7678"
+SRC_URI[sha256sum] = "b41d17e06f80059589fbeefe96ad07bcc564c49e65516da1caf975146475565c"
+
+S = "${WORKDIR}/ConsoleKit-${PV}"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}"
+
+PACKAGECONFIG[pam] = "--enable-pam-module --with-pam-module-dir=${base_libdir}/security,--disable-pam-module,libpam"
+PACKAGECONFIG[policykit] = "--with-polkit,--without-polkit,polkit"
+PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--with-systemdsystemunitdir="
+
+FILES_${PN} += "${localstatedir}/log/ConsoleKit ${exec_prefix}/lib/ConsoleKit \
+                ${libdir}/ConsoleKit  ${systemd_unitdir} ${base_libdir} \
+                ${datadir}/dbus-1 ${datadir}/PolicyKit ${datadir}/polkit*"
+FILES_${PN}-dbg += "${base_libdir}/security/.debug"
+
+PACKAGES =+ "pam-plugin-ck-connector"
+FILES_pam-plugin-ck-connector += "${base_libdir}/security/*.so"
+RDEPENDS_pam-plugin-ck-connector += "${PN}"
+
+do_install_append() {
+	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+		install -d ${D}${sysconfdir}/tmpfiles.d
+		echo "d ${localstatedir}/log/ConsoleKit - - - -" \
+			> ${D}${sysconfdir}/tmpfiles.d/consolekit.conf
+	fi
+
+	# Remove /var/run from package as console-kit-daemon will populate it on startup
+	rm -fr "${D}${localstatedir}/run"
+}
diff --git a/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch b/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch
new file mode 100644
index 0000000..7275598
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/createrepo-dbpath.patch
@@ -0,0 +1,61 @@
+createrepo: Implement --dbpath command line option
+
+--dbpath option allows to specify path to the directory
+with rpm database. By default createrepo uses or creates
+rpm database in /var/lib/rpm/
+
+Upstream-Status: Pending
+
+Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
+
+--- createrepo-0.4.11.orig/genpkgmetadata.py 2015-03-30 22:18:19.904000000 +0300
++++ createrepo-0.4.11/genpkgmetadata.py 2015-03-30 22:28:49.208000000 +0300
+@@ -65,6 +65,7 @@
+      -p, --pretty = output xml files in pretty format.
+      --update = update existing metadata (if present)
+      -d, --database = generate the sqlite databases.
++     --dbpath <dir> = specify path to rpm db directory.
+     """)
+ 
+     sys.exit(retval)
+@@ -72,10 +73,13 @@
+ class MetaDataGenerator:
+     def __init__(self, cmds):
+         self.cmds = cmds
+-        self.ts = rpm.TransactionSet()
+         self.pkgcount = 0
+         self.files = []
+ 
++        if self.cmds['dbpath']:
++            rpm.addMacro("_dbpath", self.cmds['dbpath'])
++        self.ts = rpm.TransactionSet()
++
+     def _os_path_walk(self, top, func, arg):
+         """Directory tree walk with callback function.
+          copy of os.path.walk, fixes the link/stating problem
+@@ -435,6 +439,7 @@
+     cmds['dir-pattern-match'] = ['.*bin\/.*', '^\/etc\/.*']
+     cmds['skip-symlinks'] = False
+     cmds['pkglist'] = []
++    cmds['dbpath'] = None
+ 
+     try:
+         gopts, argsleft = getopt.getopt(args, 'phqVvndg:s:x:u:c:o:CSi:', ['help', 'exclude=',
+@@ -442,7 +447,7 @@
+                                                                   'baseurl=', 'groupfile=', 'checksum=',
+                                                                   'version', 'pretty', 'split', 'outputdir=',
+                                                                   'noepoch', 'checkts', 'database', 'update',
+-                                                                  'skip-symlinks', 'pkglist='])
++                                                                  'skip-symlinks', 'pkglist=', 'dbpath='])
+     except getopt.error, e:
+         errorprint(_('Options Error: %s.') % e)
+         usage()
+@@ -516,6 +521,8 @@
+                 cmds['skip-symlinks'] = True
+             elif arg in ['-i', '--pkglist']:
+                 cmds['pkglist'] = a
++            elif arg == '--dbpath':
++                cmds['dbpath'] = os.path.realpath(a)
+                                 
+     except ValueError, e:
+         errorprint(_('Options Error: %s') % e)
diff --git a/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch b/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch
new file mode 100644
index 0000000..bc7200d
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/createrepo-rpm549.patch
@@ -0,0 +1,22 @@
+dumpMetadata.py: Fix for RPM5 - 5.4.9 integration
+
+RPM5 no longer has a switch to disable signature validation.  (Due to security
+validation concerns.)
+
+Upstream-Status: Inappropriate [other]
+  createrepo does not support RPM5 upstream
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -u createrepo-0.4.11.orig/dumpMetadata.py createrepo-0.4.11/dumpMetadata.py
+--- createrepo-0.4.11.orig/dumpMetadata.py	2012-06-05 10:12:55.687964222 -0500
++++ createrepo-0.4.11/dumpMetadata.py	2012-06-05 10:40:08.154060600 -0500
+@@ -92,7 +92,7 @@
+             fdno = package # let's assume this is an fdno and go with it :)
+     except OSError:
+         raise MDError, "Error opening file"
+-    ts.setVSFlags((rpm._RPMVSF_NOSIGNATURES|rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
++    ts.setVSFlags((rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
+     try:
+         hdr = ts.hdrFromFdno(fdno)
+     except rpm.error:
diff --git a/meta/recipes-support/createrepo/createrepo/dumpMetadata-disable-signature-validation.patch b/meta/recipes-support/createrepo/createrepo/dumpMetadata-disable-signature-validation.patch
new file mode 100644
index 0000000..905531f
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/dumpMetadata-disable-signature-validation.patch
@@ -0,0 +1,31 @@
+dumpMetadata: disable signature validation
+
+Makes it possible to work on RPM repositories that contain signed packages
+without the need of importing the public part of the signing key into the RPM
+database.
+
+Upstream-Status: Pending
+
+Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
+---
+ dumpMetadata.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/dumpMetadata.py b/dumpMetadata.py
+index e40e8ac..ca6a82d 100644
+--- a/dumpMetadata.py
++++ b/dumpMetadata.py
+@@ -92,7 +92,9 @@ def returnHdr(ts, package):
+             fdno = package # let's assume this is an fdno and go with it :)
+     except OSError:
+         raise MDError, "Error opening file"
+-    ts.setVSFlags((rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD))
++    ts.setVSFlags((rpm.RPMVSF_NOMD5|rpm.RPMVSF_NEEDPAYLOAD|
++                   rpm.RPMVSF_NODSA|rpm.RPMVSF_NORSA|
++                   rpm.RPMVSF_NODSAHEADER|rpm.RPMVSF_NORSAHEADER))
+     try:
+         hdr = ts.hdrFromFdno(fdno)
+     except rpm.error:
+-- 
+2.1.4
+
diff --git a/meta/recipes-support/createrepo/createrepo/fix-native-install.patch b/meta/recipes-support/createrepo/createrepo/fix-native-install.patch
new file mode 100644
index 0000000..d8202a4
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/fix-native-install.patch
@@ -0,0 +1,163 @@
+Upstream-Status: Inappropriate [configuration]
+
+Date: Jan 31, 2011
+
+There are two fixes:
+  1. -native needs to customize prefix
+  2. needs to change python reference in binaries
+
+Signed-off-by: Qing He <qing.he@intel.com>
+
+diff --git a/Makefile b/Makefile
+index b2d1a32..3c3639f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,22 +3,22 @@ VERSION = 0.4.11
+ SHELL = /bin/sh
+ top_srcdir = .
+ srcdir = .
+-prefix = /usr
+-exec_prefix = ${prefix}
+-
+-bindir = ${exec_prefix}/bin
+-sbindir = ${exec_prefix}/sbin
+-libexecdir = ${exec_prefix}/libexec
+-datadir = ${prefix}/share
+-sysconfdir = ${prefix}/etc
+-sharedstatedir = ${prefix}/com
+-localstatedir = ${prefix}/var
+-libdir = ${exec_prefix}/lib
+-infodir = ${prefix}/info
++prefix ?= /usr
++exec_prefix ?= ${prefix}
++
++bindir ?= ${exec_prefix}/bin
++sbindir ?= ${exec_prefix}/sbin
++libexecdir ?= ${exec_prefix}/libexec
++datadir ?= ${prefix}/share
++sysconfdir ?= ${prefix}/etc
++sharedstatedir ?= ${prefix}/com
++localstatedir ?= ${prefix}/var
++libdir ?= ${exec_prefix}/lib
++infodir ?= ${prefix}/info
+ docdir = 
+-includedir = ${prefix}/include
++includedir ?= ${prefix}/include
+ oldincludedir = /usr/include
+-mandir = ${prefix}/share/man
++mandir ?= ${prefix}/share/man
+ 
+ pkgdatadir = $(datadir)/$(PACKAGE)
+ pkglibdir = $(libdir)/$(PACKAGE)
+diff --git a/bin/Makefile b/bin/Makefile
+index 52c1f50..e30610e 100644
+--- a/bin/Makefile
++++ b/bin/Makefile
+@@ -1,22 +1,22 @@
+ SHELL = /bin/sh
+ top_srcdir = ..
+ srcdir = ../bin
+-prefix = /usr
+-exec_prefix = ${prefix}
+-
+-bindir = ${exec_prefix}/bin
+-sbindir = ${exec_prefix}/sbin
+-libexecdir = ${exec_prefix}/libexec
+-datadir = ${prefix}/share
+-sysconfdir = ${prefix}/etc
+-sharedstatedir = ${prefix}/com
+-localstatedir = ${prefix}/var
+-libdir = ${exec_prefix}/lib
+-infodir = ${prefix}/info
++prefix ?= /usr
++exec_prefix ?= ${prefix}
++
++bindir ?= ${exec_prefix}/bin
++sbindir ?= ${exec_prefix}/sbin
++libexecdir ?= ${exec_prefix}/libexec
++datadir ?= ${prefix}/share
++sysconfdir ?= ${prefix}/etc
++sharedstatedir ?= ${prefix}/com
++localstatedir ?= ${prefix}/var
++libdir ?= ${exec_prefix}/lib
++infodir ?= ${prefix}/info
+ docdir = 
+-includedir = ${prefix}/include
++includedir ?= ${prefix}/include
+ oldincludedir = /usr/include
+-mandir = ${prefix}/man
++mandir ?= ${prefix}/man
+ 
+ pkgdatadir = $(datadir)/$(PACKAGE)
+ pkglibdir = $(libdir)/$(PACKAGE)
+@@ -40,8 +40,11 @@ all: $(srcdir)/$(PACKAGE)
+ 
+ 
+ install: all installdirs
+-	$(INSTALL_BIN) $(srcdir)/$(PACKAGE) $(DESTDIR)$(bindir)/$(PACKAGE)
+-	$(INSTALL_BIN) $(srcdir)/modifyrepo $(DESTDIR)$(bindir)/modifyrepo
++	sed -e "s|@DATADIR@|$(datadir)|" $(srcdir)/$(PACKAGE) > $(srcdir)/$(PACKAGE).tmp
++	sed -e "s|@DATADIR@|$(datadir)|" $(srcdir)/modifyrepo > $(srcdir)/modifyrepo.tmp
++	$(INSTALL_BIN) $(srcdir)/$(PACKAGE).tmp $(DESTDIR)$(bindir)/$(PACKAGE)
++	$(INSTALL_BIN) $(srcdir)/modifyrepo.tmp $(DESTDIR)$(bindir)/modifyrepo
++	rm -f $(srcdir)/$(PACKAGE).tmp $(srcdir)/modifyrepo.tmp
+ 
+ 
+ uninstall:
+diff --git a/bin/createrepo b/bin/createrepo
+index b0de515..eaacb39 100755
+--- a/bin/createrepo
++++ b/bin/createrepo
+@@ -1,2 +1,2 @@
+ #!/bin/sh
+-exec /usr/share/createrepo/genpkgmetadata.py "$@"
++exec @DATADIR@/createrepo/genpkgmetadata.py "$@"
+diff --git a/bin/modifyrepo b/bin/modifyrepo
+index c9732d8..6f7c1d4 100755
+--- a/bin/modifyrepo
++++ b/bin/modifyrepo
+@@ -1,2 +1,2 @@
+ #!/bin/sh
+-exec /usr/share/createrepo/modifyrepo.py "$@"
++exec @DATADIR@/createrepo/modifyrepo.py "$@"
+diff --git a/docs/Makefile b/docs/Makefile
+index 0a41179..e128c85 100644
+--- a/docs/Makefile
++++ b/docs/Makefile
+@@ -1,22 +1,22 @@
+ SHELL = /bin/sh
+ top_srcdir = ..
+ srcdir = ../docs
+-prefix = /usr
+-exec_prefix = ${prefix}
+-
+-bindir = ${exec_prefix}/bin
+-sbindir = ${exec_prefix}/sbin
+-libexecdir = ${exec_prefix}/libexec
+-datadir = ${prefix}/share
+-sysconfdir = ${prefix}/etc
+-sharedstatedir = ${prefix}/com
+-localstatedir = ${prefix}/var
+-libdir = ${exec_prefix}/lib
+-infodir = ${prefix}/info
++prefix ?= /usr
++exec_prefix ?= ${prefix}
++
++bindir ?= ${exec_prefix}/bin
++sbindir ?= ${exec_prefix}/sbin
++libexecdir ?= ${exec_prefix}/libexec
++datadir ?= ${prefix}/share
++sysconfdir ?= ${prefix}/etc
++sharedstatedir ?= ${prefix}/com
++localstatedir ?= ${prefix}/var
++libdir ?= ${exec_prefix}/lib
++infodir ?= ${prefix}/info
+ docdir = 
+-includedir = ${prefix}/include
++includedir ?= ${prefix}/include
+ oldincludedir = /usr/include
+-mandir = ${datadir}/man
++mandir ?= ${datadir}/man
+ 
+ pkgdatadir = $(datadir)/$(PACKAGE)
+ pkglibdir = $(libdir)/$(PACKAGE)
diff --git a/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch b/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch
new file mode 100644
index 0000000..80205a1
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/python-scripts-should-use-interpreter-from-env.patch
@@ -0,0 +1,47 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+
+Python interpreter should be use from PATH - native python - and not the one from
+host.
+
+Upstream-Status: Inappropriate [configuration]
+
+Index: createrepo-0.4.11/genpkgmetadata.py
+===================================================================
+--- createrepo-0.4.11.orig/genpkgmetadata.py	2012-04-10 17:14:05.278649384 +0300
++++ createrepo-0.4.11/genpkgmetadata.py	2012-04-10 17:14:22.290648886 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -t
++#! /usr/bin/env python
+ # primary functions and glue for generating the repository metadata
+ #
+ 
+Index: createrepo-0.4.11/modifyrepo.py
+===================================================================
+--- createrepo-0.4.11.orig/modifyrepo.py	2012-04-10 17:14:09.106649272 +0300
++++ createrepo-0.4.11/modifyrepo.py	2012-04-10 17:14:27.818648725 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#! /usr/bin/env python
+ # $Id$
+ #
+ # This tools is used to insert arbitrary metadata into an RPM repository.
+Index: createrepo-0.4.11/dumpMetadata.py
+===================================================================
+--- createrepo-0.4.11.orig/dumpMetadata.py	2012-04-10 17:19:23.874640068 +0300
++++ createrepo-0.4.11/dumpMetadata.py	2012-04-10 17:19:34.502639756 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -t
++#! /usr/bin/env python
+ # base classes and functions for dumping out package Metadata
+ #
+ # This program is free software; you can redistribute it and/or modify
+Index: createrepo-0.4.11/readMetadata.py
+===================================================================
+--- createrepo-0.4.11.orig/readMetadata.py	2012-04-10 17:19:19.626640193 +0300
++++ createrepo-0.4.11/readMetadata.py	2012-04-10 17:19:40.198639590 +0300
+@@ -1,4 +1,4 @@
+-#!/usr/bin/python -t
++#! /usr/bin/env python
+ 
+ # 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
diff --git a/meta/recipes-support/createrepo/createrepo/recommends.patch b/meta/recipes-support/createrepo/createrepo/recommends.patch
new file mode 100644
index 0000000..dc5de2b
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/recommends.patch
@@ -0,0 +1,71 @@
+createrepo: implement recommends support
+
+Record against the corresponding requires entry in the output metadata
+if a dependency relationship is marked with the RPMSENSE_MISSINGOK flag
+(indicating it is a recommendation, rather than a hard dependency).
+
+Upstream-Status: Pending
+
+Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
+
+diff --git a/dumpMetadata.py b/dumpMetadata.py
+index 70bb2d8..e40e8ac 100644
+--- a/dumpMetadata.py
++++ b/dumpMetadata.py
+@@ -319,6 +319,23 @@ class RpmMetaData:
+                     reqs.append(0)
+         return reqs
+ 
++    def _checkMissingOk(self, flags):
++        reqs=[]
++        if flags is None:
++            return reqs
++
++        if type(flags) is not types.ListType:
++            flags = [flags]
++        for flag in flags:
++            newflag = flag
++            if flag is not None:
++                newflag = flag & rpm.RPMSENSE_MISSINGOK
++                if newflag:
++                    reqs.append(1)
++                else:
++                    reqs.append(0)
++        return reqs
++
+ 
+     def _correctVersion(self, vers):
+         returnvers = []
+@@ -537,9 +554,10 @@ class RpmMetaData:
+         tmpflags = self.hdr[rpm.RPMTAG_REQUIREFLAGS]
+         flags = self._correctFlags(tmpflags)
+         prereq = self._checkPreReq(tmpflags)
++        missingok = self._checkMissingOk(tmpflags)
+         ver = self._correctVersion(self.hdr[rpm.RPMTAG_REQUIREVERSION])
+         if names is not None:
+-            lst = zip(names, flags, ver, prereq)
++            lst = zip(names, flags, ver, prereq, missingok)
+         return self._uniq(lst)
+         
+     def obsoletesList(self):
+@@ -692,7 +710,7 @@ def generateXML(doc, node, formatns, rpmObj, sumtype):
+     depsList = rpmObj.depsList()
+     if len(depsList) > 0:
+         rpconode = format.newChild(formatns, 'requires', None)    
+-        for (name, flags, (e,v,r), prereq) in depsList:
++        for (name, flags, (e,v,r), prereq, missingok) in depsList:
+             entry = rpconode.newChild(formatns, 'entry', None)
+             entry.newProp('name', name)
+             if flags != 0:
+@@ -711,6 +729,8 @@ def generateXML(doc, node, formatns, rpmObj, sumtype):
+                     entry.newProp('rel', str(r))
+             if prereq == 1:
+                 entry.newProp('pre', str(prereq))
++            if missingok:
++                entry.newProp('missingok', '1')
+         
+     for file in rpmObj.usefulFiles():
+         files = format.newChild(None, 'file', None)
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py b/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py
new file mode 100755
index 0000000..a5b61ba
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo/rpm-createsolvedb.py
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+#
+# This script generates a solution database for a directory containing rpm packages
+# but tries to be efficient about this, only doing so when the packages have changed
+# in some way.
+#
+# It is assumed something already went through and removed all the solvedb.done stamp files
+# in advance.
+#
+# First argument - the rpm binary to use
+# Subsequent arguments - paths to process solution databases for
+#
+
+import sys, os
+import hashlib
+import stat
+import subprocess
+
+if len(sys.argv) < 1:
+    print("Error, rpm command not specified")
+    sys.exit(1)
+
+if len(sys.argv) < 2:
+    print("Error, no paths specified")
+    sys.exit(1)
+
+paths = sys.argv[2:]
+
+for path in paths:
+    if os.path.exists(path + "/solvedb.done"):
+        continue
+    data = ""
+    manifest = []
+    for root, dirs, files in os.walk(path):
+        for file in files:
+            f = os.path.join(root, file)
+            if f.startswith(path + "/" + "solvedb"):
+                continue
+            data = data + str(os.stat(f)[stat.ST_MTIME])
+            manifest.append(f)
+    checksum = hashlib.md5(data).hexdigest()
+
+    if os.path.exists(path + "/solvedb.checksum") and open(path + "/solvedb.checksum", "r").read() == checksum:
+        open(path + "/solvedb.done", "w")
+        continue
+
+    if os.path.exists(path + "/solvedb"):
+        subprocess.call("rm -rf %s" % (path + "/solvedb"), shell=True)
+    os.mkdir(path + "/solvedb")
+    m = open(path + "/solvedb/manifest", "w")
+    m.write("# Dynamically generated solve manifest\n")
+    for f in manifest:
+        m.write(f + "\n")
+    m.close()
+
+    cmd = sys.argv[1] + ' -i --replacepkgs --replacefiles --oldpackage -D "_dbpath ' + path + '/solvedb" --justdb \
+			--noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \
+			--ignoresize --nosignature --nodigest -D "__dbi_txn create nofsync" \
+			' + path + '/solvedb/manifest'
+    subprocess.call(cmd, shell=True)
+
+    open(path + "/solvedb.checksum", "w").write(checksum)
+    open(path + "/solvedb.done", "w")
+
diff --git a/meta/recipes-support/createrepo/createrepo_0.4.11.bb b/meta/recipes-support/createrepo/createrepo_0.4.11.bb
new file mode 100644
index 0000000..5f9ecf6
--- /dev/null
+++ b/meta/recipes-support/createrepo/createrepo_0.4.11.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Creates metadata indexes for RPM package repositories"
+HOMEPAGE = "http://createrepo.baseurl.org/"
+
+RECIPE_NO_UPDATE_REASON = "Versions after 0.9.* use YUM, so we hold at 0.4.11"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=18810669f13b87348459e611d31ab760"
+
+DEPENDS_class-native += "libxml2-native rpm-native"
+RDEPENDS_${PN}_class-target = "libxml2-python"
+
+PR = "r9"
+
+SRC_URI = "http://createrepo.baseurl.org/download/${BP}.tar.gz \
+           file://fix-native-install.patch \
+           file://python-scripts-should-use-interpreter-from-env.patch \
+           file://createrepo-rpm549.patch \
+           file://recommends.patch \
+           file://createrepo-dbpath.patch \
+           file://dumpMetadata-disable-signature-validation.patch \
+           file://rpm-createsolvedb.py \
+           "
+
+SRC_URI[md5sum] = "3e9ccf4abcffe3f49af078c83611eda2"
+SRC_URI[sha256sum] = "a73ae11a0dcde8bde36d900bc3f7f8f1083ba752c70a5c61b72d1e1e7608f21b"
+
+BBCLASSEXTEND = "native"
+
+do_install () {
+	oe_runmake -e 'DESTDIR=${D}' install
+	install -m 0755 ${WORKDIR}/rpm-createsolvedb.py ${D}${bindir}/
+}
+
+# Wrap the python script since the native python is
+# ${bindir}/python-native/python, and the "#! /usr/bin/env python" can't
+# find it since it is not in PATH.
+do_install_append_class-native () {
+	# Not all the python scripts should be wrapped since some of
+	# them are modules (be imported).
+	for i in ${D}${datadir}/createrepo/genpkgmetadata.py \
+		 ${D}${datadir}/createrepo/modifyrepo.py \
+		 ${D}${bindir}/rpm-createsolvedb.py ; do
+		sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' $i
+	done
+
+	create_wrapper ${D}/${bindir}/createrepo \
+			RPM_USRLIBRPM=${STAGING_LIBDIR_NATIVE}/rpm \
+			RPM_ETCRPM=${STAGING_ETCDIR_NATIVE}/rpm \
+			RPM_LOCALEDIRRPM=${STAGING_DATADIR_NATIVE}/locale
+}
diff --git a/meta/recipes-support/curl/curl/configure_ac.patch b/meta/recipes-support/curl/curl/configure_ac.patch
new file mode 100644
index 0000000..b8bd304
--- /dev/null
+++ b/meta/recipes-support/curl/curl/configure_ac.patch
@@ -0,0 +1,13 @@
+Upstream-Status:  Pending
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -281,7 +281,7 @@ dnl ************************************
+ 
+ CURL_CHECK_COMPILER
+ CURL_SET_COMPILER_BASIC_OPTS
+-CURL_SET_COMPILER_DEBUG_OPTS
++dnl CURL_SET_COMPILER_DEBUG_OPTS
+ CURL_SET_COMPILER_OPTIMIZE_OPTS
+ CURL_SET_COMPILER_WARNING_OPTS
+ 
diff --git a/meta/recipes-support/curl/curl/pkgconfig_fix.patch b/meta/recipes-support/curl/curl/pkgconfig_fix.patch
new file mode 100644
index 0000000..5d8769d
--- /dev/null
+++ b/meta/recipes-support/curl/curl/pkgconfig_fix.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Inappropriate [packaging]
+
+diff -Nurd curl-7.29.0/configure.ac curl-7.29.0/configure.ac
+--- curl-7.29.0/configure.ac	2013-02-06 11:47:19.000000000 +0200
++++ curl-7.29.0/configure.ac	2013-02-16 12:32:22.132327764 +0200
+@@ -1883,6 +1883,7 @@
+        AC_SUBST(USE_GNUTLS, [1])
+        GNUTLS_ENABLED=1
+        USE_GNUTLS="yes"
++       GNUTLS_REQUIRED="gnutls"
+        curl_ssl_msg="enabled (GnuTLS)"
+        ],
+        [
+@@ -1953,6 +1954,8 @@
+    ])
+ fi
+ 
++AC_SUBST(GNUTLS_REQUIRED)
++
+ dnl ----------------------------------------------------
+ dnl check for PolarSSL
+ dnl ----------------------------------------------------
+diff -Nurd curl-7.29.0/libcurl.pc.in curl-7.29.0/libcurl.pc.in
+--- curl-7.29.0/libcurl.pc.in	2012-12-12 00:32:22.000000000 +0200
++++ curl-7.29.0/libcurl.pc.in	2013-02-16 12:33:27.063844337 +0200
+@@ -35,5 +35,5 @@
+ Description: Library to transfer files with ftp, http, etc.
+ Version: @CURLVERSION@
+ Libs: -L${libdir} -lcurl
+-Libs.private: @LIBCURL_LIBS@
++Libs.private: -ldl -lz
+ Cflags: -I${includedir} @CPPFLAG_CURL_STATICLIB@
diff --git a/meta/recipes-support/curl/curl_7.44.0.bb b/meta/recipes-support/curl/curl_7.44.0.bb
new file mode 100644
index 0000000..b293303
--- /dev/null
+++ b/meta/recipes-support/curl/curl_7.44.0.bb
@@ -0,0 +1,53 @@
+SUMMARY = "Command line tool and library for client-side URL transfers"
+HOMEPAGE = "http://curl.haxx.se/"
+BUGTRACKER = "http://curl.haxx.se/mail/list.cgi?list=curl-tracker"
+SECTION = "console/network"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;beginline=7;md5=3a34942f4ae3fbf1a303160714e664ac"
+
+SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \
+           file://pkgconfig_fix.patch \
+          "
+
+# curl likes to set -g0 in CFLAGS, so we stop it
+# from mucking around with debug options
+#
+SRC_URI += " file://configure_ac.patch"
+
+SRC_URI[md5sum] = "6b952ca00e5473b16a11f05f06aa8dae"
+SRC_URI[sha256sum] = "1e2541bae6582bb697c0fbae49e1d3e6fad5d05d5aa80dbd6f072e0a44341814"
+
+inherit autotools pkgconfig binconfig multilib_header
+
+PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6", "", d)} gnutls zlib"
+PACKAGECONFIG_class-native = "ipv6 ssl zlib"
+PACKAGECONFIG_class-nativesdk = "ipv6 ssl zlib"
+
+PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
+PACKAGECONFIG[ssl] = "--with-ssl --with-random=/dev/urandom,--without-ssl,openssl"
+PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
+PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib"
+PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump"
+PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
+PACKAGECONFIG[smb] = "--enable-smb,--disable-smb,"
+
+EXTRA_OECONF = "--without-libidn \
+                --enable-crypto-auth \
+                --disable-ldap \
+                --disable-ldaps \
+                --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
+"
+# see https://lists.yoctoproject.org/pipermail/poky/2013-December/009435.html
+# We should ideally drop ac_cv_sizeof_off_t from site files but until then
+EXTRA_OECONF += "${@bb.utils.contains('DISTRO_FEATURES', 'largefile', 'ac_cv_sizeof_off_t=8', '', d)}"
+
+do_install_append() {
+	oe_multilib_header curl/curlbuild.h
+}
+
+PACKAGES =+ "lib${BPN}"
+
+FILES_lib${BPN} = "${libdir}/lib*.so.*"
+RRECOMMENDS_lib${BPN} += "ca-certificates"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/db/db/Makefile-let-libso_target-depend-on-bt_rec.patch b/meta/recipes-support/db/db/Makefile-let-libso_target-depend-on-bt_rec.patch
new file mode 100644
index 0000000..329bff5
--- /dev/null
+++ b/meta/recipes-support/db/db/Makefile-let-libso_target-depend-on-bt_rec.patch
@@ -0,0 +1,30 @@
+From c640ff9340f358a00835816d0fea03d27a7be978 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Tue, 31 Mar 2015 00:56:44 -0700
+Subject: [PATCH] Makefile: let libso_target depend on bt_rec
+
+Fixed parallel issue:
+libtool: link: `bt_rec.lo' is not a valid libtool object
+Makefile:867: recipe for target 'libdb-6.0.la' failed
+make: *** [libdb-6.0.la] Error 1
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index e451f70..0a42375 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -863,7 +863,7 @@ $(libdb_version): $(C_OBJS)
+ 	$(LN) -s $(libdb_version) $(libdb)
+ 
+ # Shared C library.
+-$(libso_target): $(C_OBJS)
++$(libso_target): $(C_OBJS) bt_rec@o@
+ 	$(SOLINK) $(SOFLAGS) $(LDFLAGS) -o $@ $(C_OBJS) \
+ 		$(LIBCSO_LIBS)
+ 	$(RM) $(libdb)
diff --git a/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch b/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch
new file mode 100644
index 0000000..34e8db8
--- /dev/null
+++ b/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch
@@ -0,0 +1,48 @@
+Original patch submitted by jbowler@nslu2-linux.org on 2005-11-17:
+
+db: fix thumb uclibc operation in 4.3.29
+  - uclibc thumb builds were using libpthread to implement mutexes, the
+  - uclibc version seems to be a stub (at least on thumb).  This commit
+  - fixes the ARM/gcc-assembly mutex implementation so that it has thumb
+  - support and the resultant db4 works (tested on LE Thumb uclibc)
+
+Upstream-Status: Inappropriate [embedded specific]
+
+Author: jbowler@nslu2-linux.org
+
+--- db-5.1.19/src/dbinc/mutex_int.h.orig	2011-01-05 19:21:42.181805366 -0600
++++ db-5.1.19/src/dbinc/mutex_int.h	2011-01-05 19:24:53.141853117 -0600
+@@ -474,6 +474,25 @@
+ 
+ #ifdef LOAD_ACTUAL_MUTEX_CODE
+ /* gcc/arm: 0 is clear, 1 is set. */
++#if defined __thumb__
++#define	MUTEX_SET(tsl) ({						\
++	int __r, __p;							\
++	__asm__ volatile(						\
++		".align 2\n\t"                                          \
++		"bx     pc\n\t"                                         \
++		"nop\n\t"                                               \
++		".arm\n\t"                                              \
++		"swpb   %0, %2, [%3]\n\t"                               \
++		"eor    %0, %0, #1\n\t"                                 \
++		"orr    %1, pc, #1\n\t"                                 \
++		"bx     %1\n\t"                                         \
++		".force_thumb"                                          \
++	    : "=&r" (__r), "=r" (__p)                                   \
++	    : "r" (1), "r" (tsl)                                        \
++	    );                                                          \
++	__r & 1;							\
++})
++#else
+ #define	MUTEX_SET(tsl) ({						\
+ 	int __r;							\
+ 	__asm__ volatile(						\
+@@ -484,6 +503,7 @@
+ 	    );								\
+ 	__r & 1;							\
+ })
++#endif
+ 
+ #define	MUTEX_UNSET(tsl)	(*(volatile tsl_t *)(tsl) = 0)
+ #define	MUTEX_INIT(tsl)         (MUTEX_UNSET(tsl), 0)
diff --git a/meta/recipes-support/db/db/fix-parallel-build.patch b/meta/recipes-support/db/db/fix-parallel-build.patch
new file mode 100644
index 0000000..2c7f1e1
--- /dev/null
+++ b/meta/recipes-support/db/db/fix-parallel-build.patch
@@ -0,0 +1,19 @@
+With higher paralelism it sometimes fails with:
+libtool: link: `util_log.lo' is not a valid libtool object
+make: *** [db_replicate] Error 1
+
+Upstream-Status: Pending
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+--- dist.orig/Makefile.in	2012-05-11 19:57:48.000000000 +0200
++++ dist/Makefile.in	2013-10-31 18:17:11.875532522 +0100
+@@ -1034,7 +1034,7 @@
+ 	    db_recover@o@ util_sig@o@ $(DEF_LIB) $(LIBS)
+ 	$(POSTLINK) $@
+ 
+-db_replicate: db_replicate@o@ util_sig@o@ $(DEF_LIB)
++db_replicate: db_replicate@o@ util_log@o@ util_sig@o@ $(DEF_LIB)
+ 	$(CCLINK) -o $@ $(LDFLAGS) \
+ 	    db_replicate@o@ util_log@o@ util_sig@o@ $(DEF_LIB) $(LIBS)
+ 	$(POSTLINK) $@
diff --git a/meta/recipes-support/db/db_5.3.28.bb b/meta/recipes-support/db/db_5.3.28.bb
new file mode 100644
index 0000000..e8b814e
--- /dev/null
+++ b/meta/recipes-support/db/db_5.3.28.bb
@@ -0,0 +1,116 @@
+# Version 5 of the Berkeley DB from Sleepycat
+#
+# At present this package only installs the DB code
+# itself (shared libraries, .a in the dev package),
+# documentation and headers.
+#
+# The headers have the same names as those as v3
+# of the DB, only one version can be used *for dev*
+# at once - DB3 and DB5 can both be installed on the
+# same system at the same time if really necessary.
+SECTION = "libs"
+SUMMARY = "Berkeley Database v5"
+HOMEPAGE = "http://www.oracle.com/technology/products/berkeley-db/db/index.html"
+LICENSE = "Sleepycat"
+VIRTUAL_NAME ?= "virtual/db"
+RCONFLICTS_${PN} = "db3"
+
+SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
+SRC_URI += "file://arm-thumb-mutex_db5.patch;patchdir=.. \
+            file://fix-parallel-build.patch \
+           "
+
+SRC_URI[md5sum] = "b99454564d5b4479750567031d66fe24"
+SRC_URI[sha256sum] = "e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628"
+
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=ed1158e31437f4f87cdd4ab2b8613955"
+
+inherit autotools
+
+# Put virtual/db in any appropriate provider of a
+# relational database, use it as a dependency in
+# place of a specific db and use:
+#
+# PREFERRED_PROVIDER_virtual/db
+#
+# to select the correct db in the build (distro) .conf
+PROVIDES += "${VIRTUAL_NAME}"
+
+# bitbake isn't quite clever enough to deal with sleepycat,
+# the distribution sits in the expected directory, but all
+# the builds must occur from a sub-directory.  The following
+# persuades bitbake to go to the right place
+S = "${WORKDIR}/db-${PV}/dist"
+B = "${WORKDIR}/db-${PV}/build_unix"
+SPDX_S = "${WORKDIR}/db-${PV}"
+
+# The executables go in a separate package - typically there
+# is no need to install these unless doing real database
+# management on the system.
+inherit lib_package
+
+PACKAGES =+ "${PN}-cxx"
+FILES_${PN}-cxx = "${libdir}/*cxx*so"
+
+
+# The dev package has the .so link (as in db3) and the .a's -
+# it is therefore incompatible (cannot be installed at the
+# same time) as the db3 package
+# sort out the .so since they do version prior to the .so
+SOLIBS = "-5*.so"
+FILES_SOLIBSDEV = "${libdir}/libdb.so ${libdir}/libdb_cxx.so"
+
+#configuration - set in local.conf to override
+# All the --disable-* options replace --enable-smallbuild, which breaks a bunch of stuff (eg. postfix)
+DB5_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql"
+
+EXTRA_OECONF = "${DB5_CONFIG} --enable-shared --enable-cxx --with-sysroot"
+
+# Override the MUTEX setting here, the POSIX library is
+# the default - "POSIX/pthreads/library".
+# Don't ignore the nice SWP instruction on the ARM:
+# These enable the ARM assembler mutex code, this won't
+# work with thumb compilation...
+ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
+MUTEX = ""
+MUTEX_arm = "${ARM_MUTEX}"
+MUTEX_armeb = "${ARM_MUTEX}"
+EXTRA_OECONF += "${MUTEX}"
+
+# Cancel the site stuff - it's set for db3 and destroys the
+# configure.
+CONFIG_SITE = ""
+do_configure() {
+	gnu-configize --force ${S}
+	export STRIP="true"
+	oe_runconf
+}
+
+do_compile_prepend() {
+	sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' \
+		${B}/libtool
+}
+
+do_install_append() {
+	mkdir -p ${D}/${includedir}/db51
+	mv ${D}/${includedir}/db.h ${D}/${includedir}/db51/.
+	mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db51/.
+	ln -s db51/db.h ${D}/${includedir}/db.h
+	ln -s db51/db_cxx.h ${D}/${includedir}/db_cxx.h
+
+	# The docs end up in /usr/docs - not right.
+	if test -d "${D}/${prefix}/docs"
+	then
+		mkdir -p "${D}/${datadir}"
+		test ! -d "${D}/${docdir}" || rm -rf "${D}/${docdir}"
+		mv "${D}/${prefix}/docs" "${D}/${docdir}"
+	fi
+
+	chown -R root:root ${D}
+}
+
+INSANE_SKIP_${PN} = "dev-so"
+INSANE_SKIP_${PN}-cxx = "dev-so"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/meta/recipes-support/db/db_6.0.30.bb b/meta/recipes-support/db/db_6.0.30.bb
new file mode 100644
index 0000000..d49df62
--- /dev/null
+++ b/meta/recipes-support/db/db_6.0.30.bb
@@ -0,0 +1,118 @@
+# Version 6 of the Berkeley DB from Oracle (formerly Sleepycat)
+#
+# At present this package only installs the DB code
+# itself (shared libraries, .a in the dev package),
+# documentation and headers.
+#
+# The headers have the same names as those as v3
+# of the DB, only one version can be used *for dev*
+# at once - DB3 and DB6 can both be installed on the
+# same system at the same time if really necessary.
+SECTION = "libs"
+SUMMARY = "Berkeley Database v6"
+HOMEPAGE = "http://www.oracle.com/technology/products/berkeley-db/db/index.html"
+LICENSE = "AGPL-3.0"
+VIRTUAL_NAME ?= "virtual/db"
+RCONFLICTS_${PN} = "db3"
+
+RECIPE_NO_UPDATE_REASON = "Updating to 6.1.x requires also updating rpm to 5.4.15"
+
+SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz"
+SRC_URI += "file://arm-thumb-mutex_db5.patch;patchdir=.. \
+            file://fix-parallel-build.patch \
+            file://Makefile-let-libso_target-depend-on-bt_rec.patch \
+           "
+
+SRC_URI[md5sum] = "ad28eb86ad3203b5422844db179c585b"
+SRC_URI[sha256sum] = "608e4b1cf390e9bf54c0ef00c5bd9ca76d36e2261b9f4d33d54516f3f6a20fd2"
+
+LIC_FILES_CHKSUM = "file://../LICENSE;md5=1ec8b0b17cc31513fe35ab10716f8490"
+
+inherit autotools
+
+# Put virtual/db in any appropriate provider of a
+# relational database, use it as a dependency in
+# place of a specific db and use:
+#
+# PREFERRED_PROVIDER_virtual/db
+#
+# to select the correct db in the build (distro) .conf
+PROVIDES += "${VIRTUAL_NAME}"
+
+# bitbake isn't quite clever enough to deal with sleepycat,
+# the distribution sits in the expected directory, but all
+# the builds must occur from a sub-directory.  The following
+# persuades bitbake to go to the right place
+S = "${WORKDIR}/db-${PV}/dist"
+B = "${WORKDIR}/db-${PV}/build_unix"
+SPDX_S = "${WORKDIR}/db-${PV}"
+
+# The executables go in a separate package - typically there
+# is no need to install these unless doing real database
+# management on the system.
+inherit lib_package
+
+PACKAGES =+ "${PN}-cxx"
+FILES_${PN}-cxx = "${libdir}/*cxx*so"
+
+
+# The dev package has the .so link (as in db3) and the .a's -
+# it is therefore incompatible (cannot be installed at the
+# same time) as the db3 package
+# sort out the .so since they do version prior to the .so
+SOLIBS = "-6*.so"
+FILES_SOLIBSDEV = "${libdir}/libdb.so ${libdir}/libdb_cxx.so"
+
+#configuration - set in local.conf to override
+# All the --disable-* options replace --enable-smallbuild, which breaks a bunch of stuff (eg. postfix)
+DB6_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql"
+
+EXTRA_OECONF = "${DB6_CONFIG} --enable-shared --enable-cxx --with-sysroot"
+
+# Override the MUTEX setting here, the POSIX library is
+# the default - "POSIX/pthreads/library".
+# Don't ignore the nice SWP instruction on the ARM:
+# These enable the ARM assembler mutex code
+ARM_MUTEX = "--with-mutex=ARM/gcc-assembly"
+MUTEX = ""
+MUTEX_arm = "${ARM_MUTEX}"
+MUTEX_armeb = "${ARM_MUTEX}"
+EXTRA_OECONF += "${MUTEX}"
+
+# Cancel the site stuff - it's set for db3 and destroys the
+# configure.
+CONFIG_SITE = ""
+do_configure() {
+	gnu-configize --force ${S}
+	export STRIP="true"
+	oe_runconf
+}
+
+do_compile_prepend() {
+	sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' \
+		${B}/libtool
+}
+
+do_install_append() {
+	mkdir -p ${D}/${includedir}/db60
+	mv ${D}/${includedir}/db.h ${D}/${includedir}/db60/.
+	mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db60/.
+	ln -s db60/db.h ${D}/${includedir}/db.h
+	ln -s db60/db_cxx.h ${D}/${includedir}/db_cxx.h
+
+	# The docs end up in /usr/docs - not right.
+	if test -d "${D}/${prefix}/docs"
+	then
+		mkdir -p "${D}/${datadir}"
+		test ! -d "${D}/${docdir}" || rm -rf "${D}/${docdir}"
+		mv "${D}/${prefix}/docs" "${D}/${docdir}"
+	fi
+
+	chown -R root:root ${D}
+}
+
+INSANE_SKIP_${PN} = "dev-so"
+INSANE_SKIP_${PN}-cxx = "dev-so"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/meta/recipes-support/debianutils/debianutils_4.5.1.bb b/meta/recipes-support/debianutils/debianutils_4.5.1.bb
new file mode 100644
index 0000000..6b665fb
--- /dev/null
+++ b/meta/recipes-support/debianutils/debianutils_4.5.1.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Miscellaneous utilities specific to Debian"
+SECTION = "base"
+LICENSE = "GPLv2 & SMAIL_GPL"
+LIC_FILES_CHKSUM = "file://debian/copyright;md5=f01a5203d50512fc4830b4332b696a9f"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/d/${BPN}/${BPN}_${PV}.tar.xz"
+
+SRC_URI[md5sum] = "487524518cd5833a6a4f7007b5d1bd5b"
+SRC_URI[sha256sum] = "a531c23e0105fe01cfa928457a8343a1e947e2621b3cd4d05f4e9656020c63b7"
+
+S = "${WORKDIR}/${BPN}"
+
+inherit autotools update-alternatives
+
+do_configure_prepend() {
+    sed -i -e 's:tempfile.1 which.1:which.1:g' ${S}/Makefile.am
+}
+
+do_install_append() {
+    if [ "${base_bindir}" != "${bindir}" ]; then
+        # Debian places some utils into ${base_bindir} as does busybox
+        install -d ${D}${base_bindir}
+        for app in run-parts tempfile; do
+            mv ${D}${bindir}/$app ${D}${base_bindir}/$app
+        done
+    fi
+}
+
+# Note that we package the update-alternatives name.
+#
+PACKAGES =+ "${PN}-run-parts"
+FILES_${PN}-run-parts = "${base_bindir}/run-parts.debianutils"
+
+RDEPENDS_${PN} += "${PN}-run-parts"
+
+
+ALTERNATIVE_PRIORITY="100"
+ALTERNATIVE_${PN} = "add-shell installkernel remove-shell savelog tempfile which"
+ALTERNATIVE_${PN}-run-parts = "run-parts"
+
+ALTERNATIVE_LINK_NAME[add-shell]="${sbindir}/add-shell"
+ALTERNATIVE_LINK_NAME[installkernel]="${sbindir}/installkernel"
+ALTERNATIVE_LINK_NAME[remove-shell]="${sbindir}/remove-shell"
+ALTERNATIVE_LINK_NAME[run-parts]="${base_bindir}/run-parts"
+ALTERNATIVE_LINK_NAME[savelog]="${bindir}/savelog"
+ALTERNATIVE_LINK_NAME[tempfile]="${base_bindir}/tempfile"
+ALTERNATIVE_LINK_NAME[which]="${bindir}/which"
diff --git a/meta/recipes-support/enchant/enchant_1.6.0.bb b/meta/recipes-support/enchant/enchant_1.6.0.bb
new file mode 100644
index 0000000..97a4761
--- /dev/null
+++ b/meta/recipes-support/enchant/enchant_1.6.0.bb
@@ -0,0 +1,32 @@
+SUMMARY = "Enchant Spell checker API Library"
+SECTION = "libs"
+HOMEPAGE = "http://www.abisource.com/projects/enchant/"
+BUGTRACKER = "http://bugzilla.abisource.com/enter_bug.cgi?product=Enchant"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=dfcbabf9131dc9a95febef6753a2958b \
+                    file://src/enchant.h;beginline=1;endline=29;md5=8d881caa1d37523567e1d8f726675a18"
+
+DEPENDS = "aspell glib-2.0"
+
+inherit autotools pkgconfig
+
+PR = "r3"
+
+SRC_URI = "http://www.abisource.com/downloads/enchant/${PV}/enchant-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "de11011aff801dc61042828041fb59c7"
+SRC_URI[sha256sum] = "2fac9e7be7e9424b2c5570d8affe568db39f7572c10ed48d4e13cddf03f7097f"
+
+EXTRA_OECONF = "--with-aspell-prefix=${STAGING_DIR_HOST}${prefix} \
+		--enable-aspell br_cv_binreloc=no \
+		"
+
+export CXXFLAGS += " -L${STAGING_LIBDIR} -lstdc++ "
+
+FILES_${PN} = "${bindir} ${libdir}/*${SOLIBS} ${datadir}/${BPN} ${libdir}/${BPN}/*.so"
+FILES_${PN}-dev += "${libdir}/${BPN}/*{SOLIBSDEV} ${libdir}/${BPN}/*.la"
+FILES_${PN}-staticdev += "${libdir}/${BPN}/*.a"
+
+RDEPENDS_${PN} += "aspell"
+
diff --git a/meta/recipes-support/gdbm/files/ptest.patch b/meta/recipes-support/gdbm/files/ptest.patch
new file mode 100644
index 0000000..65236fb
--- /dev/null
+++ b/meta/recipes-support/gdbm/files/ptest.patch
@@ -0,0 +1,36 @@
+Add install-ptest rules.
+
+Signed-off-by: Josep Puigdemont <josep.puigdemont@enea.com>
+Signed-off-by: Maxin B. John <maxin.john@enea.com>
+Upstream-Status: Pending
+
+diff -ur a/Makefile.am b/Makefile.am
+--- a/Makefile.am	2011-08-16 10:13:10.000000000 +0200
++++ b/Makefile.am	2013-04-12 18:02:16.473715873 +0200
+@@ -31,3 +31,8 @@
+ 	d=`date '+%d/%m/%Y'`; \
+ 	sed 's|/\*@DIST_DATE@\*/|"'"$$d"'"|' $(srcdir)/src/version.c > \
+ 		$(distdir)/src/version.c
++
++install-ptest:
++	@for subdir in $(SUBDIRS); do \
++		$(MAKE) -C $$subdir DESTDIR=$(DESTDIR)/$$subdir $@; \
++	done
+diff -ur a/tests/Makefile.am b/tests/Makefile.am
+--- a/tests/Makefile.am	2011-11-11 19:39:42.000000000 +0100
++++ b/tests/Makefile.am	2013-04-12 18:30:57.066301037 +0200
+@@ -132,4 +132,14 @@
+ dtdel_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la
+ d_creat_ce_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la
+ 
++buildtests: $(check_PROGRAMS) $(TESTSUITE)
+ 
++install-ptest: $(check_PROGRAMS) $(TESTSUITE)
++	@$(INSTALL) -d $(DESTDIR)
++	@for file in $^; do \
++		if [ -x .libs/$$file ]; then \
++			$(INSTALL_PROGRAM) .libs/$$file $(DESTDIR)/$$file; \
++		else \
++			$(INSTALL_PROGRAM) $$file $(DESTDIR) ; \
++		fi \
++	done
diff --git a/meta/recipes-support/gdbm/files/run-ptest b/meta/recipes-support/gdbm/files/run-ptest
new file mode 100755
index 0000000..615da844
--- /dev/null
+++ b/meta/recipes-support/gdbm/files/run-ptest
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# This script is used to run the gmdb test suite
+
+cd tests
+
+./testsuite AUTOTEST_PATH=$PWD abs_builddir=$PWD COMPAT=1 | sed 's/^[^0-9]*\([0-9]\+\): \(.*\)\(ok\|pass\|skipped\|fail\|FAILED\)\(.*\)$/\3: \2 \4/;s/ \+/ /g;s/^ok/PASS/;s/^skipped/SKIP/;s/^fail/FAIL/;s/^FAILED/FAIL/'
diff --git a/meta/recipes-support/gdbm/gdbm-1.8.3/ldflags.patch b/meta/recipes-support/gdbm/gdbm-1.8.3/ldflags.patch
new file mode 100644
index 0000000..d3cb43b
--- /dev/null
+++ b/meta/recipes-support/gdbm/gdbm-1.8.3/ldflags.patch
@@ -0,0 +1,22 @@
+Obey LDFLAGS
+
+Signed-off-by: Christopher Larson <chris_larson@mentor.com>
+Upstream-Status: Inappropriate [old version]
+
+--- gdbm-1.8.3.orig/Makefile.in
++++ gdbm-1.8.3/Makefile.in
+@@ -156,12 +156,12 @@ install-compat:
+
+ libgdbm.la: $(LOBJS) gdbm.h
+	rm -f libgdbm.la
+-	$(LIBTOOL) --mode=link $(CC) -o libgdbm.la -rpath $(libdir) \
++	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libgdbm.la -rpath $(libdir) \
+		-version-info $(SHLIB_VER) $(LOBJS)
+
+ libgdbm_compat.la: $(C_LOBJS) gdbm.h
+	rm -f libgdbm_compat.la
+-	$(LIBTOOL) --mode=link $(CC) -o libgdbm_compat.la -rpath $(libdir) \
++	$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o libgdbm_compat.la -rpath $(libdir) \
+		-version-info $(SHLIB_VER) $(C_LOBJS)
+
+ gdbm.h:	gdbm.proto gdbmerrno.h gdbm.proto2
diff --git a/meta/recipes-support/gdbm/gdbm-1.8.3/libtool-mode.patch b/meta/recipes-support/gdbm/gdbm-1.8.3/libtool-mode.patch
new file mode 100644
index 0000000..0f9d04f
--- /dev/null
+++ b/meta/recipes-support/gdbm/gdbm-1.8.3/libtool-mode.patch
@@ -0,0 +1,22 @@
+Upstream-Status: Pending
+
+--- gdbm-1.8.3/Makefile.in.orig	2006-02-16 15:17:25.000000000 +0000
++++ gdbm-1.8.3/Makefile.in	2006-02-16 15:18:08.000000000 +0000
+@@ -131,7 +131,7 @@
+ 	$(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
+ 		$(DESTDIR)$(includedir) $(DESTDIR)$(man3dir) \
+ 		$(DESTDIR)$(infodir)
+-	$(LIBTOOL) $(INSTALL) -c libgdbm.la $(DESTDIR)$(libdir)/libgdbm.la
++	$(LIBTOOL) --mode=install $(INSTALL) -c libgdbm.la $(DESTDIR)$(libdir)/libgdbm.la
+ 	$(INSTALL_DATA) gdbm.h \
+ 		$(DESTDIR)$(includedir)/gdbm.h
+ 	$(INSTALL_DATA) $(srcdir)/gdbm.3 \
+@@ -142,7 +142,7 @@
+ install-compat:
+ 	$(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
+ 		$(DESTDIR)$(includedir)
+-	$(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \
++	$(LIBTOOL) --mode=install $(INSTALL) -c libgdbm_compat.la \
+ 		$(DESTDIR)$(libdir)/libgdbm_compat.la
+ 	$(INSTALL_DATA) $(srcdir)/dbm.h \
+ 		$(DESTDIR)$(includedir)/dbm.h
diff --git a/meta/recipes-support/gdbm/gdbm-1.8.3/makefile.patch b/meta/recipes-support/gdbm/gdbm-1.8.3/makefile.patch
new file mode 100644
index 0000000..369145c
--- /dev/null
+++ b/meta/recipes-support/gdbm/gdbm-1.8.3/makefile.patch
@@ -0,0 +1,60 @@
+Upstream-Status: Pending
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+--- gdbm-1.8.3/Makefile.in~makefile
++++ gdbm-1.8.3/Makefile.in
+@@ -22,6 +22,7 @@
+ TEXI2DVI = texi2dvi
+ 
+ DEFS =
++DESTDIR =
+ 
+ # Where the system [n]dbm routines are...
+ LIBS = @LIBS@ -lc
+@@ -127,26 +128,26 @@
+ progs: $(PROGS)
+ 
+ install: libgdbm.la gdbm.h gdbm.info
+-	$(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
+-		$(INSTALL_ROOT)$(includedir) $(INSTALL_ROOT)$(man3dir) \
+-		$(INSTALL_ROOT)$(infodir)
+-	$(LIBTOOL) $(INSTALL) -c libgdbm.la $(INSTALL_ROOT)$(libdir)/libgdbm.la
+-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h \
+-		$(INSTALL_ROOT)$(includedir)/gdbm.h
+-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
+-		$(INSTALL_ROOT)$(man3dir)/gdbm.3
+-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \
+-		$(INSTALL_ROOT)$(infodir)/gdbm.info
++	$(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
++		$(DESTDIR)$(includedir) $(DESTDIR)$(man3dir) \
++		$(DESTDIR)$(infodir)
++	$(LIBTOOL) $(INSTALL) -c libgdbm.la $(DESTDIR)$(libdir)/libgdbm.la
++	$(INSTALL_DATA) gdbm.h \
++		$(DESTDIR)$(includedir)/gdbm.h
++	$(INSTALL_DATA) $(srcdir)/gdbm.3 \
++		$(DESTDIR)$(man3dir)/gdbm.3
++	$(INSTALL_DATA) $(srcdir)/gdbm.info \
++		$(DESTDIR)$(infodir)/gdbm.info
+ 
+ install-compat:
+-	$(srcdir)/mkinstalldirs $(INSTALL_ROOT)$(libdir) \
+-		$(INSTALL_ROOT)$(includedir)
++	$(srcdir)/mkinstalldirs $(DESTDIR)$(libdir) \
++		$(DESTDIR)$(includedir)
+ 	$(LIBTOOL) $(INSTALL) -c libgdbm_compat.la \
+-		$(INSTALL_ROOT)$(libdir)/libgdbm_compat.la
+-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/dbm.h \
+-		$(INSTALL_ROOT)$(includedir)/dbm.h
+-	$(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/ndbm.h \
+-		$(INSTALL_ROOT)$(includedir)/ndbm.h
++		$(DESTDIR)$(libdir)/libgdbm_compat.la
++	$(INSTALL_DATA) $(srcdir)/dbm.h \
++		$(DESTDIR)$(includedir)/dbm.h
++	$(INSTALL_DATA) $(srcdir)/ndbm.h \
++		$(DESTDIR)$(includedir)/ndbm.h
+ 
+ #libgdbm.a: $(OBJS) gdbm.h
+ #	rm -f libgdbm.a
diff --git a/meta/recipes-support/gdbm/gdbm_1.11.bb b/meta/recipes-support/gdbm/gdbm_1.11.bb
new file mode 100644
index 0000000..adf8c5b
--- /dev/null
+++ b/meta/recipes-support/gdbm/gdbm_1.11.bb
@@ -0,0 +1,43 @@
+SUMMARY = "Key/value database library with extensible hashing"
+HOMEPAGE = "http://www.gnu.org/software/gdbm/"
+SECTION = "libs"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=241da1b9fe42e642cbb2c24d5e0c4d24"
+
+
+SRC_URI = "${GNU_MIRROR}/gdbm/gdbm-${PV}.tar.gz \
+           file://run-ptest \
+           file://ptest.patch \
+          "
+
+SRC_URI[md5sum] = "72c832680cf0999caedbe5b265c8c1bd"
+SRC_URI[sha256sum] = "8d912f44f05d0b15a4a5d96a76f852e905d051bb88022fcdfd98b43be093e3c3"
+
+inherit autotools gettext texinfo lib_package ptest
+
+# Needed for dbm python module
+EXTRA_OECONF = "-enable-libgdbm-compat"
+
+# Stop presence of dbm/nbdm on the host contaminating builds
+CACHED_CONFIGUREVARS += "ac_cv_lib_ndbm_main=no ac_cv_lib_dbm_main=no"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_append () {
+    # Create a symlink to ndbm.h and gdbm.h in include/gdbm to let other packages to find
+    # these headers
+    install -d ${D}${includedir}/gdbm
+    ln -sf ../ndbm.h ${D}/${includedir}/gdbm/ndbm.h
+    ln -sf ../gdbm.h ${D}/${includedir}/gdbm/gdbm.h
+}
+
+RDEPENDS_${PN}-ptest += "diffutils"
+
+do_compile_ptest() {
+    oe_runmake -C tests buildtests
+}
+
+PACKAGES =+ "${PN}-compat \
+            "
+FILES_${PN}-compat = "${libdir}/libgdbm_compat${SOLIBS} \
+                     "
diff --git a/meta/recipes-support/gdbm/gdbm_1.8.3.bb b/meta/recipes-support/gdbm/gdbm_1.8.3.bb
new file mode 100644
index 0000000..af01b6c
--- /dev/null
+++ b/meta/recipes-support/gdbm/gdbm_1.8.3.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Key/value database library with extensible hashing"
+HOMEPAGE = "http://www.gnu.org/software/gdbm/"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8e20eece214df8ef953ed5857862150"
+
+PR = "r4"
+
+SRC_URI = "${GNU_MIRROR}/gdbm/gdbm-${PV}.tar.gz \
+	   file://makefile.patch \
+           file://libtool-mode.patch \
+           file://ldflags.patch"
+
+SRC_URI[md5sum] = "1d1b1d5c0245b1c00aff92da751e9aa1"
+SRC_URI[sha256sum] = "cc340338a2e28b40058ab9eb5354a21d53f88a1582ea21ba0bb185c37a281dc9"
+
+inherit autotools texinfo
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_append () {
+    install -d ${D}${includedir}/gdbm
+    install -m 0644 ${S}/dbm.h ${D}${includedir}/
+    install -m 0644 ${S}/ndbm.h ${D}${includedir}/
+    # Create a symlink to ndbm.h and gdbm.h in include/gdbm to let other packages to find
+    # these headers
+    ln -sf ../ndbm.h ${D}/${includedir}/gdbm/ndbm.h
+    ln -sf ../gdbm.h ${D}/${includedir}/gdbm/gdbm.h
+}
diff --git a/meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch b/meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch
new file mode 100644
index 0000000..5decb1c
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-4.2.1/disable-stdc.patch
@@ -0,0 +1,39 @@
+This patch was removed in f181c6ce8b3 when gmp 4.2.1 was mistakenly
+dropped.
+
+Upstream is not interested in patches for ancient versions.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+# "extern inline" in traditional gcc means that the function should be 
+# inlined wherever it's seen, while in C99, "extern inline" means that i
+# the function should only be inlined where the inline definition is 
+# seen while in other places it's not inlined:
+# http://gcc.gnu.org/ml/gcc/2006-11/msg00006.html
+#
+# gmp checks "--std=gnu99" to use C99 convention however it internally 
+# defines some "extern inline" functions in gmp.h, which is included
+# by mainly .c files and finally lead a flood of redefinition function
+# errors when linking objects together.
+#
+# So disable C99/ANSI detection to stick to tranditional gcc behavior
+#
+# by Kevin Tian <kevin.tian@intel.com>, 2010-08-13
+#
+# (this patch is licensed under GPLv2+)
+
+diff --git a/configure.in b/configure.in
+index 450cc92..aab0b59 100644
+--- a/configure.in
++++ b/configure.in
+@@ -1869,9 +1869,7 @@ AC_SUBST(DEFN_LONG_LONG_LIMB)
+ 
+ # The C compiler and preprocessor, put into ANSI mode if possible.
+ AC_PROG_CC
+-AC_PROG_CC_STDC
+ AC_PROG_CPP
+-GMP_H_ANSI
+ 
+ 
+ # The C compiler on the build system, and associated tests.
diff --git a/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch b/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..63aed05
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-4.2.1/gmp_fix_for_automake-1.12.patch
@@ -0,0 +1,56 @@
+automake 1.12 has depricated automatic de-ANSI-fication support
+
+this patch avoids these kinds of errors:
+
+| configure.in:2240: error: automatic de-ANSI-fication support has been removed
+| Makefile.am:28: error: automatic de-ANSI-fication support has been removed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/02
+
+
+This patch was removed in f181c6ce8b3 when gmp 4.2.1 was mistakenly
+dropped.
+
+Upstream is not interested in patches for ancient versions.
+
+Upstream-Status: Inappropriate
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+
+
+Index: gmp-4.2.1/configure.in
+===================================================================
+--- gmp-4.2.1.orig/configure.in
++++ gmp-4.2.1/configure.in
+@@ -67,7 +67,7 @@ dnl
+ dnl  Note that there's a copy of these options in the top-level Makefile.am,
+ dnl  so update there too if changing anything.
+ dnl
+-AM_INIT_AUTOMAKE([1.8 gnu no-dependencies $(top_builddir)/ansi2knr])
++AM_INIT_AUTOMAKE([1.8 gnu no-dependencies])
+ AM_CONFIG_HEADER(config.h:config.in)
+ AM_MAINTAINER_MODE
+ 
+@@ -2022,9 +2022,6 @@ fi
+ echo "      MPN_PATH=\"$path\""
+ 
+ 
+-# Automake ansi2knr support.
+-AM_C_PROTOTYPES
+-
+ GMP_PROG_AR
+ GMP_PROG_NM
+ 
+Index: gmp-4.2.1/Makefile.am
+===================================================================
+--- gmp-4.2.1.orig/Makefile.am
++++ gmp-4.2.1/Makefile.am
+@@ -27,7 +27,7 @@
+ # Makefiles in subdirectories, but here we must omit it so automake gives
+ # the actual ansi2knr build rule, not "cd $(top_builddir) && make ansi2knr".
+ #
+-AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies ansi2knr
++AUTOMAKE_OPTIONS = 1.8 gnu no-dependencies
+ 
+ 
+ # Libtool -version-info for libgmp.la and libmp.la.  See "Versioning" in the
diff --git a/meta/recipes-support/gmp/gmp-6.0.0/amd64.patch b/meta/recipes-support/gmp/gmp-6.0.0/amd64.patch
new file mode 100644
index 0000000..564d12d
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-6.0.0/amd64.patch
@@ -0,0 +1,18 @@
+Upstream-Status: Pending
+
+Index: gmp-5.0.3/longlong.h
+===================================================================
+--- gmp-5.0.3.orig/longlong.h
++++ gmp-5.0.3/longlong.h
+@@ -994,8 +994,10 @@ extern UWtype __MPN(udiv_qrnnd) _PROTO (
+    count is only an int. */
+ #define count_trailing_zeros(count, x)					\
+   do {									\
++    UDItype __cbtmp;							\
+     ASSERT ((x) != 0);							\
+-    __asm__ ("bsfq %1,%q0" : "=r" (count) : "rm" ((UDItype)(x)));	\
++    __asm__ ("bsfq %1,%0" : "=r" (__cbtmp) : "rm" ((UDItype)(x)));	\
++    (count) = __cbtmp;							\
+   } while (0)
+ #endif /* x86_64 */
+ 
diff --git a/meta/recipes-support/gmp/gmp-6.0.0/append_user_provided_flags.patch b/meta/recipes-support/gmp/gmp-6.0.0/append_user_provided_flags.patch
new file mode 100644
index 0000000..ae1386c
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-6.0.0/append_user_provided_flags.patch
@@ -0,0 +1,52 @@
+Upstream-Status: Inappropriate
+
+Append the user provided flags to the auto-detected ones.
+
+Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
+
+Index: gmp-5.1.1/configure.ac
+===================================================================
+--- gmp-5.1.1.orig/configure.ac	2014-02-11 15:05:44.925202403 +0200
++++ gmp-5.1.1/configure.ac	2014-02-11 15:19:03.918511398 +0200
+@@ -1745,8 +1745,12 @@
+ EOF
+ 
+ 
+-test_CFLAGS=${CFLAGS+set}
+-test_CPPFLAGS=${CPPFLAGS+set}
++test_CFLAGS=
++test_CPPFLAGS=
++
++user_CFLAGS=$CFLAGS
++user_CPPFLAGS=$CPPFLAGS
++user_CXXFLAGS=$CXXFLAGS
+ 
+ for abi in $abilist; do
+   abi_last="$abi"
+@@ -2175,7 +2179,7 @@
+ want_cxx=no
+ AC_PROG_CXX
+ if test $enable_cxx != no; then
+-  test_CXXFLAGS=${CXXFLAGS+set}
++  test_CXXFLAGS=
+ 
+   echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AS_MESSAGE_LOG_FD()
+   cxxflags_ac_prog_cxx=$CXXFLAGS
+@@ -2202,7 +2206,7 @@
+   # Automake includes $CPPFLAGS in a C++ compile, so we do the same here.
+   #
+   for cxxflags_choice in $cxxflags_list; do
+-    eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice\"
++    eval CXXFLAGS=\"\$cxxflags_$cxxflags_choice $user_CXXFLAGS\"
+     GMP_PROG_CXX_WORKS($CXX $CPPFLAGS $CXXFLAGS,
+       [want_cxx=yes
+       break])
+@@ -2292,6 +2296,8 @@
+ #  done
+ fi
+ 
++CFLAGS="$CFLAGS $user_CFLAGS"
++CPPFLAGS="$CPPFLAGS $user_CPPFLAGS"
+ 
+ cat >&AS_MESSAGE_LOG_FD() <<EOF
+ Decided:
diff --git a/meta/recipes-support/gmp/gmp-6.0.0/configure.patch b/meta/recipes-support/gmp/gmp-6.0.0/configure.patch
new file mode 100644
index 0000000..349da3c
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-6.0.0/configure.patch
@@ -0,0 +1,222 @@
+Upstream-Status: Pending
+
+Updated to apply to gmp-5.1.0
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+
+---
+ acinclude.m4 | 32 +++++++++++++++++---------------
+ configure.ac | 26 +++++++++-----------------
+ 2 files changed, 26 insertions(+), 32 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 227712a..199aa6f 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -40,29 +40,29 @@ dnl    a_out.exe - OpenVMS DEC C called via GNV wrapper (gnv.sourceforge.net)
+ dnl    conftest.exe - various DOS compilers
+ 
+ 
+-define(IA64_PATTERN,
++define([IA64_PATTERN],
+ [[ia64*-*-* | itanium-*-* | itanium2-*-*]])
+ 
+ dnl  Need to be careful not to match m6811, m6812, m68hc11 and m68hc12, all
+ dnl  of which config.sub accepts.  (Though none of which are likely to work
+ dnl  with GMP.)
+ dnl
+-define(M68K_PATTERN,
++define([M68K_PATTERN],
+ [[m68k-*-* | m68[0-9][0-9][0-9]-*-*]])
+ 
+-define(POWERPC64_PATTERN,
++define([POWERPC64_PATTERN],
+ [[powerpc64-*-* | powerpc64le-*-* | powerpc620-*-* | powerpc630-*-* | powerpc970-*-* | power[3-9]-*-*]])
+ 
+-define(S390_PATTERN,
++define([S390_PATTERN],
+ [[s390-*-* | z900esa-*-* | z990esa-*-* | z9esa-*-* | z10esa-*-* | z196esa-*-*]])
+ 
+-define(S390X_PATTERN,
++define([S390X_PATTERN],
+ [[s390x-*-* | z900-*-* | z990-*-* | z9-*-* | z10-*-* | z196-*-*]])
+ 
+-define(X86_PATTERN,
++define([X86_PATTERN],
+ [[i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-* | viac3*-*-* | geode*-*-* | atom-*-*]])
+ 
+-define(X86_64_PATTERN,
++define([X86_64_PATTERN],
+ [[athlon64-*-* | k8-*-* | k10-*-* | bobcat-*-* | jaguar-*-* | bulldozer-*-* | piledriver-*-* | steamroller-*-* | excavator-*-* | pentium4-*-* | atom-*-* | core2-*-* | corei*-*-* | x86_64-*-* | nano-*-*]])
+ 
+ dnl  GMP_FAT_SUFFIX(DSTVAR, DIRECTORY)
+@@ -80,7 +80,7 @@ dnl      x86         ->  x86
+ dnl      x86/k6      ->  k6
+ dnl      x86/k6/mmx  ->  k6_mmx
+ 
+-define(GMP_FAT_SUFFIX,
++define([GMP_FAT_SUFFIX],
+ [[$1=`echo $2 | sed -e '/\//s:^[^/]*/::' -e 's:[\\/]:_:g'`]])
+ 
+ 
+@@ -89,7 +89,7 @@ dnl  ----------------------------------
+ dnl  Emit code to remove any occurrence of ITEM from $LISTVAR.  ITEM can be a
+ dnl  shell expression like $foo if desired.
+ 
+-define(GMP_REMOVE_FROM_LIST,
++define([GMP_REMOVE_FROM_LIST],
+ [remove_from_list_tmp=
+ for remove_from_list_i in $[][$1]; do
+   if test $remove_from_list_i = [$2]; then :;
+@@ -105,12 +105,12 @@ dnl  GMP_STRIP_PATH(subdir)
+ dnl  ----------------------
+ dnl  Strip entries */subdir from $path and $fat_path.
+ 
+-define(GMP_STRIP_PATH,
++define([GMP_STRIP_PATH],
+ [GMP_STRIP_PATH_VAR(path, [$1])
+ GMP_STRIP_PATH_VAR(fat_path, [$1])
+ ])
+ 
+-define(GMP_STRIP_PATH_VAR,
++define([GMP_STRIP_PATH_VAR],
+ [tmp_path=
+ for i in $[][$1]; do
+   case $i in
+@@ -131,7 +131,7 @@ dnl
+ dnl  Dummy value for GMP_LIMB_BITS is enough
+ dnl  for all current configure-time uses of gmp.h.
+ 
+-define(GMP_INCLUDE_GMP_H,
++define([GMP_INCLUDE_GMP_H],
+ [[#define __GMP_WITHIN_CONFIGURE 1   /* ignore template stuff */
+ #define GMP_NAIL_BITS $GMP_NAIL_BITS
+ #define GMP_LIMB_BITS 123
+@@ -146,7 +146,7 @@ dnl  Expand at autoconf time to the value of a "#define NAME" from the given
+ dnl  FILE.  The regexps here aren't very rugged, but are enough for gmp.
+ dnl  /dev/null as a parameter prevents a hang if $2 is accidentally omitted.
+ 
+-define(GMP_HEADER_GETVAL,
++define([GMP_HEADER_GETVAL],
+ [patsubst(patsubst(
+ esyscmd([grep "^#define $1 " $2 /dev/null 2>/dev/null]),
+ [^.*$1[ 	]+],[]),
+@@ -160,7 +160,7 @@ dnl  The gmp version number, extracted from the #defines in gmp-h.in at
+ dnl  autoconf time.  Two digits like 3.0 if patchlevel <= 0, or three digits
+ dnl  like 3.0.1 if patchlevel > 0.
+ 
+-define(GMP_VERSION,
++define([GMP_VERSION],
+ [GMP_HEADER_GETVAL(__GNU_MP_VERSION,gmp-h.in)[]dnl
+ .GMP_HEADER_GETVAL(__GNU_MP_VERSION_MINOR,gmp-h.in)[]dnl
+ .GMP_HEADER_GETVAL(__GNU_MP_VERSION_PATCHLEVEL,gmp-h.in)])
+@@ -1524,7 +1524,9 @@ esac
+ echo ["define(<CONFIG_TOP_SRCDIR>,<\`$tmp'>)"] >>$gmp_tmpconfigm4
+ 
+ # All CPUs use asm-defs.m4
+-echo ["include][(CONFIG_TOP_SRCDIR\`/mpn/asm-defs.m4')"] >>$gmp_tmpconfigm4i
++echo -n ["include("] >>$gmp_tmpconfigm4i
++echo -n ["CONFIG_TOP_SRCDIR\`/mpn/asm-defs.m4'"] >>$gmp_tmpconfigm4i
++echo [")"] >>$gmp_tmpconfigm4i
+ ])
+ 
+ 
+diff --git a/configure.ac b/configure.ac
+index 64b2c50..f07b821 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -39,14 +39,6 @@ AC_REVISION($Revision$)
+ AC_PREREQ(2.59)
+ AC_INIT(GNU MP, GMP_VERSION, [gmp-bugs@gmplib.org, see https://gmplib.org/manual/Reporting-Bugs.html], gmp)
+ AC_CONFIG_SRCDIR(gmp-impl.h)
+-m4_pattern_forbid([^[ \t]*GMP_])
+-m4_pattern_allow(GMP_LDFLAGS)
+-m4_pattern_allow(GMP_LIMB_BITS)
+-m4_pattern_allow(GMP_MPARAM_H_SUGGEST)
+-m4_pattern_allow(GMP_NAIL_BITS)
+-m4_pattern_allow(GMP_NUMB_BITS)
+-m4_pattern_allow(GMP_NONSTD_ABI)
+-m4_pattern_allow(GMP_CPU_TYPE)
+ 
+ # If --target is not used then $target_alias is empty, but if say
+ # "./configure athlon-pc-freebsd3.5" is used, then all three of
+@@ -348,7 +340,7 @@ AH_VERBATIM([HAVE_HOST_CPU_1],
+ # After GMP specific searches and tests, the standard autoconf AC_PROG_CC is
+ # called.  User selections of CC etc are respected.
+ #
+-# Care is taken not to use macros like AC_TRY_COMPILE during the GMP
++# Care is taken not to use macros like AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[]) during the GMP
+ # pre-testing, since they of course depend on AC_PROG_CC, and also some of
+ # them cache their results, which is not wanted.
+ #
+@@ -440,7 +432,7 @@ abilist="standard"
+ # FIXME: We'd like to prefer an ANSI compiler, perhaps by preferring
+ # c89 over cc here.  But note that on HP-UX c89 provides a castrated
+ # environment, and would want to be excluded somehow.  Maybe
+-# AC_PROG_CC_STDC already does enough to stick cc into ANSI mode and
++#  already does enough to stick cc into ANSI mode and
+ # we don't need to worry.
+ #
+ cclist="gcc cc"
+@@ -1843,7 +1835,7 @@ esac
+ CFLAGS_or_unset=${CFLAGS-'(unset)'}
+ CPPFLAGS_or_unset=${CPPFLAGS-'(unset)'}
+ 
+-cat >&AC_FD_CC <<EOF
++cat >&AS_MESSAGE_LOG_FD() <<EOF
+ User:
+ ABI=$ABI
+ CC=$CC
+@@ -2264,7 +2256,6 @@ AC_SUBST(DEFN_LONG_LONG_LIMB)
+ 
+ # The C compiler and preprocessor, put into ANSI mode if possible.
+ AC_PROG_CC
+-AC_PROG_CC_STDC
+ AC_PROG_CPP
+ 
+ 
+@@ -2286,11 +2277,11 @@ AC_SUBST(CCAS)
+ 
+ # The C++ compiler, if desired.
+ want_cxx=no
++AC_PROG_CXX
+ if test $enable_cxx != no; then
+   test_CXXFLAGS=${CXXFLAGS+set}
+-  AC_PROG_CXX
+ 
+-  echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AC_FD_CC
++  echo "CXXFLAGS chosen by autoconf: $CXXFLAGS" >&AS_MESSAGE_LOG_FD()
+   cxxflags_ac_prog_cxx=$CXXFLAGS
+   cxxflags_list=ac_prog_cxx
+ 
+@@ -2412,7 +2403,7 @@ if test "$enable_assembly" = "no"; then
+ fi
+ 
+ 
+-cat >&AC_FD_CC <<EOF
++cat >&AS_MESSAGE_LOG_FD() <<EOF
+ Decided:
+ ABI=$ABI
+ CC=$CC
+@@ -3781,7 +3772,7 @@ GMP_FINISH
+ # FIXME: Upcoming version of autoconf/automake may not like broken lines.
+ #        Right now automake isn't accepting the new AC_CONFIG_FILES scheme.
+ 
+-AC_OUTPUT(Makefile							\
++AC_CONFIG_FILES([Makefile							\
+   mpf/Makefile mpn/Makefile mpq/Makefile				\
+   mpz/Makefile printf/Makefile scanf/Makefile rand/Makefile cxx/Makefile \
+   tests/Makefile tests/devel/Makefile					\
+@@ -3790,7 +3781,8 @@ AC_OUTPUT(Makefile							\
+   tests/cxx/Makefile							\
+   doc/Makefile tune/Makefile						\
+   demos/Makefile demos/calc/Makefile demos/expr/Makefile		\
+-  gmp.h:gmp-h.in)
++  gmp.h:gmp-h.in])
++AC_OUTPUT
+ 
+ AC_MSG_NOTICE([summary of build options:
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/gmp/gmp-6.0.0/gmp-6.0.0-ppc64.patch b/meta/recipes-support/gmp/gmp-6.0.0/gmp-6.0.0-ppc64.patch
new file mode 100644
index 0000000..1113b41
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-6.0.0/gmp-6.0.0-ppc64.patch
@@ -0,0 +1,26 @@
+
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+This patch with pulled from gmp.
+https://gmplib.org/repo/gmp/rev/4a6d258b467f
+Upstream-Status: Backport
+
+# HG changeset patch
+# User Torbjorn Granlund <tege@gmplib.org>
+# Date 1395835068 -3600
+# Node ID 4a6d258b467f661da0894cc60ecd060f2e3c67c7
+# Parent  301ce2788826a2d4d2725bd5cf01e998638db37a
+Provide default for BMOD_1_TO_MOD_1_THRESHOLD.
+
+diff -r 301ce2788826 -r 4a6d258b467f mpn/powerpc64/mode64/gcd_1.asm
+--- a/mpn/powerpc64/mode64/gcd_1.asm    Tue Mar 25 15:34:52 2014 +0100
++++ b/mpn/powerpc64/mode64/gcd_1.asm    Wed Mar 26 12:57:48 2014 +0100
+@@ -43,6 +43,9 @@
+ define(`n',     `r4')
+ define(`v0',    `r5')
+
++ifdef(`BMOD_1_TO_MOD_1_THRESHOLD',,
++  `define(`BMOD_1_TO_MOD_1_THRESHOLD',30)')
++
+ EXTERN_FUNC(mpn_mod_1)
+ EXTERN_FUNC(mpn_modexact_1c_odd)
diff --git a/meta/recipes-support/gmp/gmp-6.0.0/use-includedir.patch b/meta/recipes-support/gmp/gmp-6.0.0/use-includedir.patch
new file mode 100644
index 0000000..74904a2
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp-6.0.0/use-includedir.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Index: gmp-4.2.4/Makefile.am
+===================================================================
+--- gmp-4.2.4.orig/Makefile.am	2008-09-10 19:31:27.000000000 +0000
++++ gmp-4.2.4/Makefile.am	2009-07-06 20:19:19.000000000 +0000
+@@ -106,7 +106,7 @@
+ # but anyone knowledgable enough to be playing with exec_prefix will be able
+ # to address that.
+ #
+-includeexecdir = $(exec_prefix)/include
++includeexecdir = $(includedir)
+ include_HEADERS = $(GMPXX_HEADERS_OPTION)
+ nodist_includeexec_HEADERS = gmp.h $(MPBSD_HEADERS_OPTION)
+ lib_LTLIBRARIES = libgmp.la $(GMPXX_LTLIBRARIES_OPTION) $(MPBSD_LTLIBRARIES_OPTION)
diff --git a/meta/recipes-support/gmp/gmp.inc b/meta/recipes-support/gmp/gmp.inc
new file mode 100644
index 0000000..6752a39
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp.inc
@@ -0,0 +1,16 @@
+SECTION = "devel"
+SUMMARY = "GNU multiprecision arithmetic library"
+DESCRIPTION = "GMP is a free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers"
+HOMEPAGE = "http://gmplib.org/"
+
+REVISION ?= ""
+SRC_URI = "https://gmplib.org/download/${BPN}/${BP}${REVISION}.tar.bz2"
+
+inherit autotools texinfo
+
+ARM_INSTRUCTION_SET = "arm"
+
+BBCLASSEXTEND = "native nativesdk"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[readline] = "--with-readline=yes,--with-readline=no,readline"
diff --git a/meta/recipes-support/gmp/gmp_4.2.1.bb b/meta/recipes-support/gmp/gmp_4.2.1.bb
new file mode 100644
index 0000000..928c01a
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp_4.2.1.bb
@@ -0,0 +1,15 @@
+require gmp.inc
+
+LICENSE = "LGPLv2.1+ & GPLv2+"
+LICENSE_${PN} = "LGPLv2.1+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=892f569a555ba9c07a568a7c0c4fa63a \
+                    file://COPYING.LIB;md5=fbc093901857fcd118f065f900982c24 \
+                    file://gmp-h.in;beginline=6;endline=21;md5=e056f74a12c3277d730dbcfb85d2ca34"
+
+SRC_URI += "file://disable-stdc.patch \
+            file://gmp_fix_for_automake-1.12.patch \
+            "
+
+SRC_URI[md5sum] = "091c56e0e1cca6b09b17b69d47ef18e3"
+SRC_URI[sha256sum] = "d07ffcb37eecec35c5ec72516d10b35fdf6e6fef1fcf1dcd37e30b8cbf8bf941"
diff --git a/meta/recipes-support/gmp/gmp_6.0.0.bb b/meta/recipes-support/gmp/gmp_6.0.0.bb
new file mode 100644
index 0000000..19b63e5
--- /dev/null
+++ b/meta/recipes-support/gmp/gmp_6.0.0.bb
@@ -0,0 +1,33 @@
+require gmp.inc
+
+LICENSE="GPLv2+ | LGPLv3+"
+
+REVISION="a"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                   file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \
+                   file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+"
+
+SRC_URI += "file://configure.patch \
+            file://amd64.patch \
+            file://use-includedir.patch \
+            file://append_user_provided_flags.patch \
+            file://gmp-6.0.0-ppc64.patch \
+            "
+SRC_URI[md5sum] = "b7ff2d88cae7f8085bd5006096eed470"
+SRC_URI[sha256sum] = "7f8e9a804b9c6d07164cf754207be838ece1219425d64e28cfa3e70d5c759aaf"
+
+acpaths = ""
+
+EXTRA_OECONF += " --enable-cxx=detect"
+
+PACKAGES =+ "libgmpxx"
+FILES_libgmpxx = "${libdir}/libgmpxx${SOLIBS}"
+
+do_install_append_class-target() {
+        sed -i "s|--sysroot=${STAGING_DIR_HOST}||g" ${D}${includedir}/gmp.h
+}
+
+SSTATE_SCAN_FILES += "gmp.h"
+
diff --git a/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch b/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch
new file mode 100644
index 0000000..840666f
--- /dev/null
+++ b/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing/0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch
@@ -0,0 +1,35 @@
+From b1de2c6290bc0651fe87a8c4fb52e7a0a5fe6322 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 5 Oct 2014 16:01:49 -0700
+Subject: [PATCH] gsystem-subprocess.c: Enable GNU extensions in system  C
+ library
+
+This should export O_CLOEXEC where it is only
+available when _GNU_SOURCE is defined .e.g. uclibc based systems
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+---
+ src/libgsystem/gsystem-subprocess.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/libgsystem/gsystem-subprocess.c b/src/libgsystem/gsystem-subprocess.c
+index a967896..a52a362 100644
+--- a/src/libgsystem/gsystem-subprocess.c
++++ b/src/libgsystem/gsystem-subprocess.c
+@@ -18,6 +18,10 @@
+ 
+ #include "config.h"
+ 
++#ifndef _GNU_SOURCE
++#define _GNU_SOURCE
++#endif
++
+ #define _GSYSTEM_NO_LOCAL_ALLOC
+ #include "libgsystem.h"
+ 
+-- 
+2.1.1
+
diff --git a/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing_2014.1.bb b/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing_2014.1.bb
new file mode 100644
index 0000000..482de99
--- /dev/null
+++ b/meta/recipes-support/gnome-desktop-testing/gnome-desktop-testing_2014.1.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Test runner for GNOME-style installed tests"
+HOMEPAGE = "https://wiki.gnome.org/GnomeGoals/InstalledTests"
+LICENSE = "LGPLv2+"
+
+SRC_URI = "${GNOME_MIRROR}/${BPN}/${PV}/${BPN}-${PV}.tar.xz \
+           file://0001-gsystem-subprocess.c-Enable-GNU-extensions-in-system.patch \
+          "
+SRC_URI[md5sum] = "a608ad72a77e23a1aecdfd8d07a94baf"
+SRC_URI[sha256sum] = "1a3eed73678dd22d09d6a7ec4f899557df3e8b4a802affa76d0f163b31286539"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
+                    file://src/gnome-desktop-testing-runner.c;endline=19;md5=67311a600b83fd0068dfc7e5b84ffb3f"
+
+DEPENDS = "glib-2.0"
+
+inherit autotools pkgconfig
+
+PR = "r1"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[journald] = "--with-systemd-journal,--without-systemd-journal,systemd,systemd"
diff --git a/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4242.patch b/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4242.patch
new file mode 100644
index 0000000..c9addca
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4242.patch
@@ -0,0 +1,62 @@
+From e2202ff2b704623efc6277fb5256e4e15bac5676 Mon Sep 17 00:00:00 2001
+From: Werner Koch <wk@gnupg.org>
+Date: Thu, 25 Jul 2013 11:17:52 +0200
+Subject: [PATCH] Mitigate a flush+reload cache attack on RSA secret
+ exponents.
+
+commit e2202ff2b704623efc6277fb5256e4e15bac5676 from
+git://git.gnupg.org/libgcrypt.git
+
+* mpi/mpi-pow.c (gcry_mpi_powm): Always perfrom the mpi_mul for
+exponents in secure memory.
+
+Upstream-Status: Backport
+
+Signed-off-by: Kai Kang <kai.kang@windriver.com>
+--
+
+The attack is published as http://eprint.iacr.org/2013/448 :
+
+Flush+Reload: a High Resolution, Low Noise, L3 Cache Side-Channel
+Attack by Yuval Yarom and Katrina Falkner. 18 July 2013.
+
+  Flush+Reload is a cache side-channel attack that monitors access to
+  data in shared pages. In this paper we demonstrate how to use the
+  attack to extract private encryption keys from GnuPG.  The high
+  resolution and low noise of the Flush+Reload attack enables a spy
+  program to recover over 98% of the bits of the private key in a
+  single decryption or signing round. Unlike previous attacks, the
+  attack targets the last level L3 cache. Consequently, the spy
+  program and the victim do not need to share the execution core of
+  the CPU. The attack is not limited to a traditional OS and can be
+  used in a virtualised environment, where it can attack programs
+  executing in a different VM.
+
+Index: gnupg-1.4.7/mpi/mpi-pow.c
+===================================================================
+--- gnupg-1.4.7.orig/mpi/mpi-pow.c
++++ gnupg-1.4.7/mpi/mpi-pow.c
+@@ -212,7 +212,13 @@ mpi_powm( MPI res, MPI base, MPI exponen
+ 		tp = rp; rp = xp; xp = tp;
+ 		rsize = xsize;
+ 
+-		if( (mpi_limb_signed_t)e < 0 ) {
++            /* To mitigate the Yarom/Falkner flush+reload cache
++             * side-channel attack on the RSA secret exponent, we do
++             * the multiplication regardless of the value of the
++             * high-bit of E.  But to avoid this performance penalty
++             * we do it only if the exponent has been stored in secure
++             * memory and we can thus assume it is a secret exponent.  */
++		if (esec || (mpi_limb_signed_t)e < 0) {
+ 		    /*mpihelp_mul( xp, rp, rsize, bp, bsize );*/
+ 		    if( bsize < KARATSUBA_THRESHOLD ) {
+ 			mpihelp_mul( xp, rp, rsize, bp, bsize );
+@@ -227,6 +233,8 @@ mpi_powm( MPI res, MPI base, MPI exponen
+ 			mpihelp_divrem(xp + msize, 0, xp, xsize, mp, msize);
+ 			xsize = msize;
+ 		    }
++		}
++		if ( (mpi_limb_signed_t)e < 0 ) {
+ 
+ 		    tp = rp; rp = xp; xp = tp;
+ 		    rsize = xsize;
diff --git a/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch b/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch
new file mode 100644
index 0000000..b29ede4
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch
@@ -0,0 +1,44 @@
+Upstream-Status: Backport
+
+Index: gnupg-1.4.7/g10/getkey.c
+===================================================================
+--- gnupg-1.4.7.orig/g10/getkey.c	2007-03-05 16:54:41.000000000 +0800
++++ gnupg-1.4.7/g10/getkey.c	2013-11-28 14:41:59.640212240 +0800
+@@ -1454,7 +1454,11 @@
+ 
+       if(flags)
+ 	key_usage |= PUBKEY_USAGE_UNKNOWN;
++      if (!key_usage)
++	key_usage |= PUBKEY_USAGE_NONE;
+     }
++  else if (p)
++    key_usage |= PUBKEY_USAGE_NONE;
+ 
+   /* We set PUBKEY_USAGE_UNKNOWN to indicate that this key has a
+      capability that we do not handle.  This serves to distinguish
+Index: gnupg-1.4.7/g10/keygen.c
+===================================================================
+--- gnupg-1.4.7.orig/g10/keygen.c	2007-02-05 00:27:40.000000000 +0800
++++ gnupg-1.4.7/g10/keygen.c	2013-11-28 14:43:05.016670092 +0800
+@@ -209,9 +209,6 @@
+     if (use & PUBKEY_USAGE_AUTH)
+         buf[0] |= 0x20;
+ 
+-    if (!buf[0]) 
+-        return;
+-
+     build_sig_subpkt (sig, SIGSUBPKT_KEY_FLAGS, buf, 1);
+ }
+ 
+Index: gnupg-1.4.7/include/cipher.h
+===================================================================
+--- gnupg-1.4.7.orig/include/cipher.h	2006-04-21 20:39:49.000000000 +0800
++++ gnupg-1.4.7/include/cipher.h	2013-11-28 14:49:24.159322744 +0800
+@@ -52,6 +52,7 @@
+ #define PUBKEY_USAGE_CERT    4      /* key is also good to certify other keys*/
+ #define PUBKEY_USAGE_AUTH    8      /* key is good for authentication */
+ #define PUBKEY_USAGE_UNKNOWN 128    /* key has an unknown usage bit */
++#define PUBKEY_USAGE_NONE    256    /* No usage given. */
+ 
+ #define DIGEST_ALGO_MD5       1
+ #define DIGEST_ALGO_SHA1      2
diff --git a/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4576.patch b/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4576.patch
new file mode 100644
index 0000000..b1a22f5
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4576.patch
@@ -0,0 +1,153 @@
+Upstream-Status: Backport
+
+Index: gnupg-1.4.7/cipher/dsa.c
+===================================================================
+--- gnupg-1.4.7.orig/cipher/dsa.c	2006-12-12 02:27:21.000000000 +0800
++++ gnupg-1.4.7/cipher/dsa.c	2014-01-23 11:30:17.300915919 +0800
+@@ -287,6 +287,8 @@
+     MPI kinv;
+     MPI tmp;
+ 
++    mpi_normalize (hash);
++
+     /* select a random k with 0 < k < q */
+     k = gen_k( skey->q );
+ 
+Index: gnupg-1.4.7/cipher/elgamal.c
+===================================================================
+--- gnupg-1.4.7.orig/cipher/elgamal.c	2006-12-12 03:08:05.000000000 +0800
++++ gnupg-1.4.7/cipher/elgamal.c	2014-01-23 11:30:17.300915919 +0800
+@@ -376,6 +376,9 @@
+ {
+     MPI t1 = mpi_alloc_secure( mpi_get_nlimbs( skey->p ) );
+ 
++    mpi_normalize (a);
++    mpi_normalize (b);
++
+     /* output = b/(a^x) mod p */
+     mpi_powm( t1, a, skey->x, skey->p );
+     mpi_invm( t1, t1, skey->p );
+Index: gnupg-1.4.7/cipher/random.c
+===================================================================
+--- gnupg-1.4.7.orig/cipher/random.c	2006-11-03 18:09:39.000000000 +0800
++++ gnupg-1.4.7/cipher/random.c	2014-01-23 11:31:53.993495462 +0800
+@@ -273,6 +273,18 @@
+ }
+ 
+ 
++/* Randomize the MPI */ 
++void
++randomize_mpi (MPI mpi, size_t nbits, int level)
++{
++  unsigned char *buffer;
++
++  buffer = get_random_bits (nbits, level, mpi_is_secure (mpi));
++  mpi_set_buffer (mpi, buffer, (nbits+7)/8, 0);
++  xfree (buffer);
++}
++
++
+ int
+ random_is_faked()
+ {
+Index: gnupg-1.4.7/cipher/random.h
+===================================================================
+--- gnupg-1.4.7.orig/cipher/random.h	2006-02-09 19:29:29.000000000 +0800
++++ gnupg-1.4.7/cipher/random.h	2014-01-23 11:30:17.300915919 +0800
+@@ -32,6 +32,7 @@
+ int  random_is_faked(void);
+ void random_disable_locking (void);
+ void randomize_buffer( byte *buffer, size_t length, int level );
++void randomize_mpi (MPI mpi, size_t nbits, int level);
+ byte *get_random_bits( size_t nbits, int level, int secure );
+ void fast_random_poll( void );
+ 
+Index: gnupg-1.4.7/cipher/rsa.c
+===================================================================
+--- gnupg-1.4.7.orig/cipher/rsa.c	2006-12-12 03:09:00.000000000 +0800
++++ gnupg-1.4.7/cipher/rsa.c	2014-01-23 11:35:04.330639125 +0800
+@@ -301,9 +301,26 @@
+ #if 0
+     mpi_powm( output, input, skey->d, skey->n );
+ #else
+-    MPI m1   = mpi_alloc_secure( mpi_get_nlimbs(skey->n)+1 );
+-    MPI m2   = mpi_alloc_secure( mpi_get_nlimbs(skey->n)+1 );
+-    MPI h    = mpi_alloc_secure( mpi_get_nlimbs(skey->n)+1 );
++    int nlimbs = mpi_get_nlimbs (skey->n)+1;
++    MPI m1   = mpi_alloc_secure (nlimbs);
++    MPI m2   = mpi_alloc_secure (nlimbs);
++    MPI h    = mpi_alloc_secure (nlimbs);
++# if 1
++    MPI bdata= mpi_alloc_secure (nlimbs);
++    MPI r    = mpi_alloc_secure (nlimbs);
++# endif
++
++    /* Remove superfluous leading zeroes from INPUT.  */
++    mpi_normalize (input);
++
++# if 1 
++    /* Blind:  bdata = (data * r^e) mod n   */
++    randomize_mpi (r, mpi_get_nbits (skey->n), 0);
++    mpi_fdiv_r (r, r, skey->n);
++    mpi_powm (bdata, r, skey->e, skey->n);
++    mpi_mulm (bdata, bdata, input, skey->n);
++    input = bdata;
++# endif
+ 
+     /* m1 = c ^ (d mod (p-1)) mod p */
+     mpi_sub_ui( h, skey->p, 1  );
+@@ -321,8 +338,15 @@
+     /* m = m2 + h * p */
+     mpi_mul ( h, h, skey->p );
+     mpi_add ( output, m1, h );
+-    /* ready */
+-    
++
++# if 1
++    mpi_free (bdata);
++    /* Unblind: output = (output * r^(-1)) mod n  */
++    mpi_invm (r, r, skey->n);
++    mpi_mulm (output, output, r, skey->n);
++    mpi_free (r);
++# endif
++
+     mpi_free ( h );
+     mpi_free ( m1 );
+     mpi_free ( m2 );
+@@ -397,6 +421,7 @@
+ rsa_decrypt( int algo, MPI *result, MPI *data, MPI *skey )
+ {
+     RSA_secret_key sk;
++    MPI input;
+ 
+     if( algo != 1 && algo != 2 )
+ 	return G10ERR_PUBKEY_ALGO;
+@@ -407,8 +432,14 @@
+     sk.p = skey[3];
+     sk.q = skey[4];
+     sk.u = skey[5];
+-    *result = mpi_alloc_secure( mpi_get_nlimbs( sk.n ) );
+-    secret( *result, data[0], &sk );
++
++    /* Mitigates side-channel attacks (CVE-2013-4576).  */
++    input = mpi_alloc (0);
++    mpi_normalize (data[0]);
++    mpi_fdiv_r (input, data[0], sk.n);
++    *result = mpi_alloc_secure (mpi_get_nlimbs (sk.n));
++    secret (*result, input, &sk);
++    mpi_free (input);
+     return 0;
+ }
+ 
+Index: gnupg-1.4.7/g10/gpgv.c
+===================================================================
+--- gnupg-1.4.7.orig/g10/gpgv.c	2006-12-13 19:25:04.000000000 +0800
++++ gnupg-1.4.7/g10/gpgv.c	2014-01-23 11:30:17.300915919 +0800
+@@ -390,6 +390,7 @@
+ void random_dump_stats(void) {}
+ int quick_random_gen( int onoff ) { return -1;}
+ void randomize_buffer( byte *buffer, size_t length, int level ) {}
++void randomize_mpi (MPI mpi, size_t nbits, int level) {}
+ int random_is_faked() { return -1;}
+ byte *get_random_bits( size_t nbits, int level, int secure ) { return NULL;}
+ void set_random_seed_file( const char *name ) {}
diff --git a/meta/recipes-support/gnupg/gnupg-1.4.7/GnuPG1-CVE-2012-6085.patch b/meta/recipes-support/gnupg/gnupg-1.4.7/GnuPG1-CVE-2012-6085.patch
new file mode 100644
index 0000000..8b5d9a1
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg-1.4.7/GnuPG1-CVE-2012-6085.patch
@@ -0,0 +1,63 @@
+commit f0b33b6fb8e0586e9584a7a409dcc31263776a67
+Author: Werner Koch <wk@gnupg.org>
+Date:   Thu Dec 20 09:43:41 2012 +0100
+
+    gpg: Import only packets which are allowed in a keyblock.
+    
+    * g10/import.c (valid_keyblock_packet): New.
+    (read_block): Store only valid packets.
+    --
+    
+    A corrupted key, which for example included a mangled public key
+    encrypted packet, used to corrupt the keyring.  This change skips all
+    packets which are not allowed in a keyblock.
+    
+    GnuPG-bug-id: 1455
+    
+    (cherry-picked from commit f795a0d59e197455f8723c300eebf59e09853efa)
+
+Upstream-Status: Backport
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+diff --git a/g10/import.c b/g10/import.c
+index bfe02eb..a57b32e 100644
+--- a/g10/import.c
++++ b/g10/import.c
+@@ -384,6 +384,27 @@ import_print_stats (void *hd)
+ }
+ 
+ 
++/* Return true if PKTTYPE is valid in a keyblock.  */
++static int
++valid_keyblock_packet (int pkttype)
++{
++  switch (pkttype)
++    {
++    case PKT_PUBLIC_KEY:
++    case PKT_PUBLIC_SUBKEY:
++    case PKT_SECRET_KEY:
++    case PKT_SECRET_SUBKEY:
++    case PKT_SIGNATURE:
++    case PKT_USER_ID:
++    case PKT_ATTRIBUTE:
++    case PKT_RING_TRUST:
++      return 1;
++    default:
++      return 0;
++    }
++}
++
++
+ /****************
+  * Read the next keyblock from stream A.
+  * PENDING_PKT should be initialzed to NULL
+@@ -461,7 +482,7 @@ read_block( IOBUF a, PACKET **pending_pkt, KBNODE *ret_root )
+ 	    }
+ 	    in_cert = 1;
+ 	  default:
+-	    if( in_cert ) {
++	    if (in_cert && valid_keyblock_packet (pkt->pkttype)) {
+ 		if( !root )
+ 		    root = new_kbnode( pkt );
+ 		else
diff --git a/meta/recipes-support/gnupg/gnupg-1.4.7/configure.patch b/meta/recipes-support/gnupg/gnupg-1.4.7/configure.patch
new file mode 100644
index 0000000..e005ac6
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg-1.4.7/configure.patch
@@ -0,0 +1,17 @@
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: gnupg-1.4.7/configure.ac
+===================================================================
+--- gnupg-1.4.7.orig/configure.ac
++++ gnupg-1.4.7/configure.ac
+@@ -827,7 +827,6 @@ else
+   AC_SUBST(USE_NLS)
+   AC_SUBST(USE_INCLUDED_LIBINTL)
+   AC_SUBST(BUILD_INCLUDED_LIBINTL)
+-  AM_PO_SUBDIRS
+ fi
+ 
+ if test "$try_extensions" = yes || test x"$card_support" = xyes ; then
diff --git a/meta/recipes-support/gnupg/gnupg-1.4.7/curl_typeof_fix_backport.patch b/meta/recipes-support/gnupg/gnupg-1.4.7/curl_typeof_fix_backport.patch
new file mode 100644
index 0000000..e5fb24a
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg-1.4.7/curl_typeof_fix_backport.patch
@@ -0,0 +1,27 @@
+
+This has been discussed in a couple of different bug reported
+upstream:
+
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=486250
+http://bugs.sourcemage.org/show_bug.cgi?id=14446
+
+Fix:
+http://lists.gnupg.org/pipermail/gnupg-devel/2008-April/024344.html
+
+Upstream-Status: Backport [Debian]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: gnupg-1.4.7/keyserver/gpgkeys_curl.c
+===================================================================
+--- gnupg-1.4.7.orig/keyserver/gpgkeys_curl.c
++++ gnupg-1.4.7/keyserver/gpgkeys_curl.c
+@@ -286,7 +286,7 @@ main(int argc,char *argv[])
+       curl_easy_setopt(curl,CURLOPT_VERBOSE,1);
+     }
+ 
+-  curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,opt->flags.check_cert);
++  curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,(long)opt->flags.check_cert);
+   curl_easy_setopt(curl,CURLOPT_CAINFO,opt->ca_cert_file);
+ 
+   if(proxy)
diff --git a/meta/recipes-support/gnupg/gnupg-1.4.7/long-long-thumb.patch b/meta/recipes-support/gnupg/gnupg-1.4.7/long-long-thumb.patch
new file mode 100644
index 0000000..2855cab
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg-1.4.7/long-long-thumb.patch
@@ -0,0 +1,19 @@
+Orignal Patch came from OpenWrt via OE-Classic
+https://dev.openwrt.org/browser/packages/utils/gnupg/patches/001-mips_gcc4.4
+which is no longer a valid revision!
+
+Upstream-Status: Inappropriate [configuration]
+
+
+--- gnupg/mpi/longlong.h~      2006-02-14 10:09:55.000000000 +0000
++++ gnupg/mpi/longlong.h       2008-10-27 13:11:09.000000000 +0000
+@@ -181,7 +181,7 @@
+ /***************************************
+  **************  ARM  ******************
+  ***************************************/
+-#if defined (__arm__) && W_TYPE_SIZE == 32
++#if defined (__arm__) && W_TYPE_SIZE == 32 && !defined(__thumb__)
+ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+   __asm__ ("adds %1, %4, %5\n"                                          \
+          "adc  %0, %2, %3"                                            \
+
diff --git a/meta/recipes-support/gnupg/gnupg-1.4.7/mips_gcc4.4.patch b/meta/recipes-support/gnupg/gnupg-1.4.7/mips_gcc4.4.patch
new file mode 100644
index 0000000..9a03b2b
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg-1.4.7/mips_gcc4.4.patch
@@ -0,0 +1,50 @@
+
+From Openembedded-Classic
+
+    gnupg-1.4.10: Readd the ARM Thumb patch as debian has no thumb support
+
+
+Upstream-Status: Inappropriate [embedded-specific]
+
+Index: gnupg-1.4.10/mpi/longlong.h
+===================================================================
+--- gnupg-1.4.10.orig/mpi/longlong.h	2008-12-11 17:39:43.000000000 +0100
++++ gnupg-1.4.10/mpi/longlong.h	2010-03-27 14:27:53.000000000 +0100
+@@ -706,18 +706,35 @@
+ #endif /* __m88110__ */
+ #endif /* __m88000__ */
+ 
++/* Test for gcc >= maj.min, as per __GNUC_PREREQ in glibc */
++#if defined (__GNUC__) && defined (__GNUC_MINOR__)
++#define __GNUC_PREREQ(maj, min) \
++	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
++#else
++#define __GNUC_PREREQ(maj, min)  0
++#endif
++
+ /***************************************
+  **************  MIPS  *****************
+  ***************************************/
+ #if defined (__mips__) && W_TYPE_SIZE == 32
+-#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
++#if __GNUC_PREREQ (4,4)
++#define umul_ppmm(w1, w0, u, v) \
++  do {                                                                 \
++	UDItype __ll = (UDItype)(u) * (v);                                 \
++	w1 = __ll >> 32;                                                   \
++	w0 = __ll;                                                         \
++  } while (0)
++#endif
++#if !defined (umul_ppmm) && __GNUC_PREREQ (2,7)
+ #define umul_ppmm(w1, w0, u, v) \
+   __asm__ ("multu %2,%3"                                                \
+ 	   : "=l" ((USItype)(w0)),                                      \
+ 	     "=h" ((USItype)(w1))                                       \
+ 	   : "d" ((USItype)(u)),                                        \
+ 	     "d" ((USItype)(v)))
+-#else
++#endif
++#if !defined (umul_ppmm)
+ #define umul_ppmm(w1, w0, u, v) \
+   __asm__ ("multu %2,%3 \n" \
+ 	   "mflo %0 \n"     \
diff --git a/meta/recipes-support/gnupg/gnupg/dirmngr-uses-libgpg-error.patch b/meta/recipes-support/gnupg/gnupg/dirmngr-uses-libgpg-error.patch
new file mode 100644
index 0000000..7af1955
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg/dirmngr-uses-libgpg-error.patch
@@ -0,0 +1,16 @@
+Upstream-Status: Pending
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+Index: gnupg-2.1.0/dirmngr/Makefile.am
+===================================================================
+--- gnupg-2.1.0.orig/dirmngr/Makefile.am
++++ gnupg-2.1.0/dirmngr/Makefile.am
+@@ -78,7 +78,8 @@ endif
+ dirmngr_LDADD = $(libcommontlsnpth) $(libcommonpth) \
+         $(DNSLIBS) $(LIBASSUAN_LIBS) \
+ 	$(LIBGCRYPT_LIBS) $(KSBA_LIBS) $(NPTH_LIBS) \
+-	$(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(LIBINTL) $(LIBICONV)
++	$(NTBTLS_LIBS) $(LIBGNUTLS_LIBS) $(LIBINTL) $(LIBICONV) \
++	$(GPG_ERROR_LIBS)
+ if USE_LDAP
+ dirmngr_LDADD += $(ldaplibs)
+ endif
diff --git a/meta/recipes-support/gnupg/gnupg/pkgconfig.patch b/meta/recipes-support/gnupg/gnupg/pkgconfig.patch
new file mode 100644
index 0000000..f958603
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg/pkgconfig.patch
@@ -0,0 +1,90 @@
+Use pkg-config to find pth instead of pth-config.
+
+Upstream-Status: Denied
+[not submitted but they've been clear they don't want a pkg-config dependency]
+
+RP 2014/5/22
+
+Index: gnupg-2.1.0/m4/gnupg-pth.m4
+===================================================================
+--- gnupg-2.1.0.orig/m4/gnupg-pth.m4
++++ gnupg-2.1.0/m4/gnupg-pth.m4
+@@ -17,33 +17,9 @@ dnl implied warranty of MERCHANTABILITY
+ # Taken and modified from the m4 macros which come with Pth.
+ AC_DEFUN([GNUPG_PTH_VERSION_CHECK],
+   [
+-    _pth_version=`$PTH_CONFIG --version | awk 'NR==1 {print [$]3}'`
+     _req_version="ifelse([$1],,1.2.0,$1)"
++    PKG_CHECK_MODULES(PTH, [pth >= $_req_version], [have_pth=yes], [have_pth=no])
+ 
+-    AC_MSG_CHECKING(for PTH - version >= $_req_version)
+-    for _var in _pth_version _req_version; do
+-        eval "_val=\"\$${_var}\""
+-        _major=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\1/'`
+-        _minor=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\2/'`
+-        _rtype=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\3/'`
+-        _micro=`echo $_val | sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\([[ab.]]\)\([[0-9]]*\)/\4/'`
+-        case $_rtype in
+-            "a" ) _rtype=0 ;;
+-            "b" ) _rtype=1 ;;
+-            "." ) _rtype=2 ;;
+-        esac
+-        _hex=`echo dummy | awk '{ printf("%d%02d%1d%02d", major, minor, rtype, micro); }' \
+-              "major=$_major" "minor=$_minor" "rtype=$_rtype" "micro=$_micro"`
+-        eval "${_var}_hex=\"\$_hex\""
+-    done
+-    have_pth=no
+-    if test ".$_pth_version_hex" != .; then
+-        if test ".$_req_version_hex" != .; then
+-            if test $_pth_version_hex -ge $_req_version_hex; then
+-                have_pth=yes
+-            fi
+-        fi
+-    fi
+     if test $have_pth = yes; then
+        AC_MSG_RESULT(yes)
+        AC_MSG_CHECKING([whether PTH installation is sane])
+@@ -51,9 +27,9 @@ AC_DEFUN([GNUPG_PTH_VERSION_CHECK],
+          _gnupg_pth_save_cflags=$CFLAGS
+          _gnupg_pth_save_ldflags=$LDFLAGS
+          _gnupg_pth_save_libs=$LIBS
+-         CFLAGS="$CFLAGS `$PTH_CONFIG --cflags`"
+-         LDFLAGS="$LDFLAGS `$PTH_CONFIG --ldflags`"
+-         LIBS="$LIBS `$PTH_CONFIG --libs --all`"
++         CFLAGS="$CFLAGS $PTH_CFLAGS"
++         LDFLAGS="$LDFLAGS $PTH_LDFLAGS"
++         LIBS="$LIBS $PTH_LIBS"
+          AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pth.h>
+                                          ],
+                                          [[ pth_init ();]])],
+@@ -80,26 +56,13 @@ AC_DEFUN([GNUPG_PTH_VERSION_CHECK],
+ # PTH_CLFAGS and PTH_LIBS are AS_SUBST.
+ #
+ AC_DEFUN([GNUPG_PATH_PTH],
+-[ AC_ARG_WITH(pth-prefix,
+-             AC_HELP_STRING([--with-pth-prefix=PFX],
+-                           [prefix where GNU Pth is installed (optional)]),
+-     pth_config_prefix="$withval", pth_config_prefix="")
+-  if test x$pth_config_prefix != x ; then
+-     PTH_CONFIG="$pth_config_prefix/bin/pth-config"
+-  fi
+-  AC_PATH_PROG(PTH_CONFIG, pth-config, no)
++[
+   tmp=ifelse([$1], ,1.3.7,$1)
+-  if test "$PTH_CONFIG" != "no"; then
+-    GNUPG_PTH_VERSION_CHECK($tmp)
+-    if test $have_pth = yes; then      
+-       PTH_CFLAGS=`$PTH_CONFIG --cflags`
+-       PTH_LIBS=`$PTH_CONFIG --ldflags`
+-       PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs --all`"
+-       AC_DEFINE(HAVE_PTH, 1,
++  GNUPG_PTH_VERSION_CHECK($tmp)
++  if test $have_pth = yes; then
++      AC_DEFINE(HAVE_PTH, 1,
+                 [Defined if the GNU Pth is available])
+-    fi
+   fi
+   AC_SUBST(PTH_CFLAGS)
+   AC_SUBST(PTH_LIBS)
+ ])
+-
diff --git a/meta/recipes-support/gnupg/gnupg/use-pkgconfig-instead-of-npth-config.patch b/meta/recipes-support/gnupg/gnupg/use-pkgconfig-instead-of-npth-config.patch
new file mode 100644
index 0000000..c6dbf1b
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg/use-pkgconfig-instead-of-npth-config.patch
@@ -0,0 +1,72 @@
+Upstream-Status: Inappropriate [openembedded specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+
+Index: gnupg-2.1.0/m4/npth.m4
+===================================================================
+--- gnupg-2.1.0.orig/m4/npth.m4
++++ gnupg-2.1.0/m4/npth.m4
+@@ -17,10 +17,10 @@ AC_DEFUN([_AM_PATH_NPTH_CONFIG],
+   if test "x$npth_config_prefix" != x ; then
+       NPTH_CONFIG="$npth_config_prefix/bin/npth-config"
+   fi
+-  AC_PATH_PROG(NPTH_CONFIG, npth-config, no)
++  AC_PATH_PROG(PKGCONFIG, pkg-config, no)
+ 
+-  if test "$NPTH_CONFIG" != "no" ; then
+-    npth_version=`$NPTH_CONFIG --version`
++  if test "$PKGCONFIG" != "no" ; then
++    npth_version=`$PKGCONFIG --modversion npth`
+   fi
+   npth_version_major=`echo $npth_version | \
+                sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+@@ -45,7 +45,7 @@ AC_DEFUN([AM_PATH_NPTH],
+ 
+   AC_MSG_CHECKING(for NPTH - version >= $min_npth_version)
+   ok=no
+-  if test "$NPTH_CONFIG" != "no" ; then
++  if test "$PKGCONFIG" != "no" ; then
+     req_major=`echo $min_npth_version | \
+                sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+     req_minor=`echo $min_npth_version | \
+@@ -66,28 +66,9 @@ AC_DEFUN([AM_PATH_NPTH],
+   fi
+   if test $ok = yes; then
+     AC_MSG_RESULT([yes ($npth_version)])
+-  else
+-    AC_MSG_RESULT(no)
+-  fi
+-  if test $ok = yes; then
+-     # If we have a recent NPTH, we should also check that the
+-     # API is compatible.
+-     if test "$req_npth_api" -gt 0 ; then
+-        tmp=`$NPTH_CONFIG --api-version 2>/dev/null || echo 0`
+-        if test "$tmp" -gt 0 ; then
+-           AC_MSG_CHECKING([NPTH API version])
+-           if test "$req_npth_api" -eq "$tmp" ; then
+-             AC_MSG_RESULT([okay])
+-           else
+-             ok=no
+-             AC_MSG_RESULT([does not match. want=$req_npth_api got=$tmp])
+-           fi
+-        fi
+-     fi
+-  fi
+-  if test $ok = yes; then
+-    NPTH_CFLAGS=`$NPTH_CONFIG --cflags`
+-    NPTH_LIBS=`$NPTH_CONFIG --libs`
++    NPTH_CFLAGS=`$PKGCONFIG --cflags npth`
++    NPTH_LIBS=`$PKGCONFIG --libs npth`
++    AC_MSG_WARN([[GOT HERE - $NPTH_LIBS ]])
+     ifelse([$2], , :, [$2])
+     npth_config_host=`$NPTH_CONFIG --host 2>/dev/null || echo none`
+     if test x"$npth_config_host" != xnone ; then
+@@ -103,6 +84,7 @@ AC_DEFUN([AM_PATH_NPTH],
+       fi
+     fi
+   else
++    AC_MSG_RESULT(no)
+     NPTH_CFLAGS=""
+     NPTH_LIBS=""
+     ifelse([$3], , :, [$3])
diff --git a/meta/recipes-support/gnupg/gnupg_1.4.7.bb b/meta/recipes-support/gnupg/gnupg_1.4.7.bb
new file mode 100644
index 0000000..6999f81
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg_1.4.7.bb
@@ -0,0 +1,105 @@
+SUMMARY = "GNU Privacy Guard - encryption and signing tools"
+HOMEPAGE = "http://www.gnupg.org/"
+DEPENDS = "zlib bzip2 readline"
+SECTION = "console/utils"
+
+LICENSE = "GPLv2"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
+
+PR = "r9"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-${PV}.tar.bz2 \
+           file://long-long-thumb.patch \
+           file://configure.patch \
+           file://mips_gcc4.4.patch \
+           file://GnuPG1-CVE-2012-6085.patch \
+           file://curl_typeof_fix_backport.patch \
+           file://CVE-2013-4351.patch \
+           file://CVE-2013-4576.patch \
+           file://CVE-2013-4242.patch \
+	  "
+
+SRC_URI[md5sum] = "b06a141cca5cd1a55bbdd25ab833303c"
+SRC_URI[sha256sum] = "69d18b7d193f62ca27ed4febcb4c9044aa0c95305d3258fe902e2fae5fc6468d"
+
+inherit autotools gettext texinfo
+
+#   --with-egd-socket=NAME  use NAME for the EGD socket
+#   --with-photo-viewer=FIXED_VIEWER  set a fixed photo ID viewer
+#   --with-included-zlib    use the zlib code included here
+#   --with-capabilities     use linux capabilities default=no
+#   --with-mailprog=NAME    use "NAME -t" for mail transport
+#   --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
+#   --without-libiconv-prefix     don't search for libiconv in includedir and libdir
+#   --with-included-gettext use the GNU gettext library included here
+#   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
+#   --without-libintl-prefix     don't search for libintl in includedir and libdir
+#   --without-readline      do not support fancy command line editing
+#   --with-included-regex   use the included GNU regex library
+#   --with-zlib=DIR         use libz in DIR
+#   --with-bzip2=DIR        look for bzip2 in DIR
+#   --enable-static-rnd=egd|unix|linux|auto
+#   --disable-dev-random    disable the use of dev random
+#   --disable-asm           do not use assembler modules
+#   --enable-m-guard        enable memory guard facility
+#   --enable-selinux-support
+#                           enable SELinux support
+#   --disable-card-support  disable OpenPGP card support
+#   --disable-gnupg-iconv   disable the new iconv code
+#   --enable-backsigs       enable the experimental backsigs code
+#   --enable-minimal        build the smallest gpg binary possible
+#   --disable-rsa           disable the RSA public key algorithm
+#   --disable-idea          disable the IDEA cipher
+#   --disable-cast5         disable the CAST5 cipher
+#   --disable-blowfish      disable the BLOWFISH cipher
+#   --disable-aes           disable the AES, AES192, and AES256 ciphers
+#   --disable-twofish       disable the TWOFISH cipher
+#   --disable-sha256        disable the SHA-256 digest
+#   --disable-sha512        disable the SHA-384 and SHA-512 digests
+#   --disable-bzip2         disable the BZIP2 compression algorithm
+#   --disable-exec          disable all external program execution
+#   --disable-photo-viewers disable photo ID viewers
+#   --disable-keyserver-helpers  disable all external keyserver support
+#   --disable-ldap          disable LDAP keyserver interface
+#   --disable-hkp           disable HKP keyserver interface
+#   --disable-http          disable HTTP key fetching interface
+#   --disable-finger        disable Finger key fetching interface
+#   --disable-mailto        disable email keyserver interface
+#   --disable-keyserver-path disable the exec-path option for keyserver helpers
+#   --enable-key-cache=SIZE Set key cache to SIZE (default 4096)
+#   --disable-largefile     omit support for large files
+#   --disable-dns-srv       disable the use of DNS SRV in HKP and HTTP
+#   --disable-nls           do not use Native Language Support
+#   --disable-regex         do not handle regular expressions in trust sigs
+
+EXTRA_OECONF = "--disable-ldap \
+		--with-zlib=${STAGING_LIBDIR}/.. \
+		--with-bzip2=${STAGING_LIBDIR}/.. \
+		--disable-selinux-support \
+                --with-readline=${STAGING_LIBDIR}/.. \
+                ac_cv_sys_symbol_underscore=no \
+		"
+
+# Force gcc's traditional handling of inline to avoid issues with gcc 5
+CFLAGS += "-fgnu89-inline"
+
+do_install () {
+	autotools_do_install
+	install -d ${D}${docdir}/${BPN}
+	mv ${D}${datadir}/${BPN}/* ${D}/${docdir}/${BPN}/ || :
+	mv ${D}${prefix}/doc/* ${D}/${docdir}/${BPN}/ || :
+}
+
+# split out gpgv from main package
+RDEPENDS_${PN} = "gpgv"
+PACKAGES =+ "gpgv"
+FILES_gpgv = "${bindir}/gpgv"
+
+# Exclude debug files from the main packages
+FILES_${PN} = "${bindir}/* ${datadir}/${BPN} ${libexecdir}/${BPN}/*"
+FILES_${PN}-dbg += "${libexecdir}/${BPN}/.debug"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[curl] = "--with-libcurl=${STAGING_LIBDIR},--without-libcurl,curl"
+PACKAGECONFIG[libusb] = "--with-libusb=${STAGING_LIBDIR},--without-libusb,libusb-compat"
diff --git a/meta/recipes-support/gnupg/gnupg_2.1.7.bb b/meta/recipes-support/gnupg/gnupg_2.1.7.bb
new file mode 100644
index 0000000..48c7c96
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg_2.1.7.bb
@@ -0,0 +1,41 @@
+SUMMARY = "GNU Privacy Guard - encryption and signing tools (2.x)"
+HOMEPAGE = "http://www.gnupg.org/"
+LICENSE = "GPLv3 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
+                    file://COPYING.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
+
+DEPENDS = "npth libassuan libksba zlib bzip2 readline libgcrypt"
+
+inherit autotools gettext texinfo pkgconfig
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/${BPN}/${BPN}-${PV}.tar.bz2 \
+           file://pkgconfig.patch \
+           file://use-pkgconfig-instead-of-npth-config.patch \
+           file://dirmngr-uses-libgpg-error.patch \
+          "
+
+SRC_URI[md5sum] = "ebdf92b15b8bcd8579b643c7f41a3238"
+SRC_URI[sha256sum] = "c18a3776d47fec98892d51d28b6574ef16bf0a25eabb0956231058aaf2e7846e"
+
+EXTRA_OECONF = "--disable-ldap \
+		--disable-ccid-driver \
+		--with-zlib=${STAGING_LIBDIR}/.. \
+		--with-bzip2=${STAGING_LIBDIR}/.. \
+                --with-readline=${STAGING_LIBDIR}/.. \
+               "
+RRECOMMENDS_${PN} = "pinentry"
+
+do_configure_prepend () {
+	# Else these could be used in prefernce to those in aclocal-copy
+	rm -f ${S}/m4/gpg-error.m4
+	rm -f ${S}/m4/libassuan.m4
+	rm -f ${S}/m4/ksba.m4
+	rm -f ${S}/m4/libgcrypt.m4
+}
+
+do_install_append() {
+	ln -sf gpg2 ${D}${bindir}/gpg
+	ln -sf gpgv2 ${D}${bindir}/gpgv
+}
+
+RDEPENDS_${PN} = "gnutls"
diff --git a/meta/recipes-support/gnutls/gnutls.inc b/meta/recipes-support/gnutls/gnutls.inc
new file mode 100644
index 0000000..e9b138a
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls.inc
@@ -0,0 +1,49 @@
+SUMMARY = "GNU Transport Layer Security Library"
+HOMEPAGE = "http://www.gnu.org/software/gnutls/"
+BUGTRACKER = "https://savannah.gnu.org/support/?group=gnutls"
+DEPENDS = "nettle"
+
+LICENSE = "GPLv3+ & LGPLv2.1+"
+LICENSE_${PN} = "LGPLv2.1+"
+LICENSE_${PN}-xx = "LGPLv2.1+"
+LICENSE_${PN}-bin = "GPLv3+"
+LICENSE_${PN}-openssl = "GPLv3+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://COPYING.LESSER;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+
+SHRT_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"
+
+SRC_URI = "ftp://ftp.gnutls.org/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz"
+
+inherit autotools texinfo binconfig pkgconfig gettext lib_package
+
+EXTRA_OECONF="--disable-rpath \
+              --with-included-libtasn1 \
+              --enable-local-libopts \
+              --with-libpthread-prefix=${STAGING_DIR_HOST}${prefix} \
+              --disable-guile \
+              --disable-crywrap \
+              --without-p11-kit \
+              "
+
+do_configure_prepend() {
+	for dir in . lib; do
+		rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4
+	done
+}
+
+PACKAGECONFIG ??= "zlib"
+PACKAGECONFIG[tpm] = "--with-tpm, --without-tpm, trousers"
+PACKAGECONFIG[zlib] = "--with-zlib, --without-zlib, zlib"
+
+PACKAGES =+ "${PN}-openssl ${PN}-xx"
+
+FILES_${PN}-dev += "${bindir}/gnutls-cli-debug"
+FILES_${PN}-openssl = "${libdir}/libgnutls-openssl.so.*"
+FILES_${PN}-xx = "${libdir}/libgnutlsxx.so.*"
+
+LDFLAGS_append_libc-uclibc += " -pthread"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/gnutls/gnutls/configure.ac-fix-sed-command.patch b/meta/recipes-support/gnutls/gnutls/configure.ac-fix-sed-command.patch
new file mode 100644
index 0000000..44a9934
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls/configure.ac-fix-sed-command.patch
@@ -0,0 +1,31 @@
+From eb93aa7b986c84da60a3db40afb29d1a70c50223 Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Sat, 17 Jan 2015 17:02:15 +0000
+Subject: [PATCH] configure.ac: fix sed command
+
+The "sed 's/.bak//g'" matchs "bitbake", which would cause strange errors
+when the S contains "bitbake", fix to "sed 's/\.bak$//'`"
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index c6818a0..1c4582d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -466,7 +466,7 @@ if test "$NEED_LIBOPTS_DIR" = "true";then
+ 	dnl replace libopts-generated files with distributed backups, if present
+ 	missing_baks=
+ 	for i in ${srcdir}/src/*-args.c.bak ${srcdir}/src/*-args.h.bak; do
+-		nam=`echo $i|sed 's/.bak//g'`
++		nam=`echo $i|sed 's/\.bak$//'`
+ 		if test -f $i;then
+ 			cp -f $i $nam
+ 		else
+-- 
+2.0.1
+
diff --git a/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch b/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch
new file mode 100644
index 0000000..5e452c5
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls/correct_rpl_gettimeofday_signature.patch
@@ -0,0 +1,67 @@
+From ae3370788ed3447bba16969d9eb1bf1b9631e1b7 Mon Sep 17 00:00:00 2001
+From: Valentin Popa <valentin.popa@intel.com>
+Date: Fri, 25 Apr 2014 13:58:55 +0300
+Subject: [PATCH] Correct rpl_gettimeofday signature
+
+Currently we fail on uclibc like below
+
+| In file included from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/procfs.h:32:0,
+|                  from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/ucontext.h:26,
+|                  from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/signal.h:392,
+|                  from ../../gl/signal.h:52,
+|                  from ../../gl/sys/select.h:58,
+|                  from /home/kraj/work/angstrom/sources/openembedded-core/build/tmp-uclibc/sysroots/qemuarm/usr/include/sys/types.h:220,
+|                  from ../../gl/sys/types.h:28,
+|                  from ../../lib/includes/gnutls/gnutls.h:46,
+|                  from ex-cxx.cpp:3:
+| ../../gl/sys/time.h:396:66: error: conflicting declaration 'void* restrict'
+| ../../gl/sys/time.h:396:50: error: 'restrict' has a previous declaration as 'timeval* restrict'
+| make[4]: *** [ex-cxx.o] Error 1
+| make[4]: *** Waiting for unfinished jobs....
+
+GCC detects that we call 'restrict' as param name in function
+signatures and complains since both params are called 'restrict'
+therefore we use __restrict to denote the C99 keywork
+
+This only happens of uclibc since this code is not excercised with
+eglibc otherwise we will have same issue there too
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ gl/sys_time.in.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gl/sys_time.in.h b/gl/sys_time.in.h
+index 84a17c9..6ceadc3 100644
+--- a/gl/sys_time.in.h
++++ b/gl/sys_time.in.h
+@@ -93,20 +93,20 @@ struct timeval
+ #   define gettimeofday rpl_gettimeofday
+ #  endif
+ _GL_FUNCDECL_RPL (gettimeofday, int,
+-                  (struct timeval *restrict, void *restrict)
++                  (struct timeval *__restrict, void *__restrict)
+                   _GL_ARG_NONNULL ((1)));
+ _GL_CXXALIAS_RPL (gettimeofday, int,
+-                  (struct timeval *restrict, void *restrict));
++                  (struct timeval *__restrict, void *__restrict));
+ # else
+ #  if !@HAVE_GETTIMEOFDAY@
+ _GL_FUNCDECL_SYS (gettimeofday, int,
+-                  (struct timeval *restrict, void *restrict)
++                  (struct timeval *__restrict, void *__restrict)
+                   _GL_ARG_NONNULL ((1)));
+ #  endif
+ /* Need to cast, because on glibc systems, by default, the second argument is
+                                                   struct timezone *.  */
+ _GL_CXXALIAS_SYS_CAST (gettimeofday, int,
+-                       (struct timeval *restrict, void *restrict));
++                       (struct timeval *__restrict, void *__restrict));
+ # endif
+ _GL_CXXALIASWARN (gettimeofday);
+ #elif defined GNULIB_POSIXCHECK
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch b/meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch
new file mode 100644
index 0000000..0e1b7c8
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls/use-pkg-config-to-locate-zlib.patch
@@ -0,0 +1,67 @@
+From cee80af1fe93f5b76765afeebfcc3b902768f5d6 Mon Sep 17 00:00:00 2001
+From: Andre McCurdy <armccurdy@gmail.com>
+Date: Tue, 26 May 2015 21:41:24 -0700
+Subject: [PATCH] use pkg-config to locate zlib
+
+AC_LIB_HAVE_LINKFLAGS can sometimes find host libs and is therefore not
+robust when cross-compiling. Remove it for zlib and use PKG_CHECK_MODULES
+instead.
+
+Removing AC_LIB_HAVE_LINKFLAGS for zlib also removes the --with-libz-prefix
+configure option. If zlib support is enabled, then failure to find zlib via
+pkg-config is now treated as a fatal error.
+
+Change based on ChromeOS gnutls 2.12.23 cross-compile fixes patch:
+
+  https://chromium-review.googlesource.com/#/c/271661/
+
+Upstream-Status: Inappropriate [configuration]
+
+Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
+---
+ configure.ac | 24 ++++++++++--------------
+ 1 file changed, 10 insertions(+), 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1b561d5..0c787dc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -508,25 +508,21 @@ AC_ARG_WITH(zlib, AS_HELP_STRING([--without-zlib],
+ AC_MSG_CHECKING([whether to include zlib compression support])
+ if test x$ac_zlib != xno; then
+  AC_MSG_RESULT(yes)
+- AC_LIB_HAVE_LINKFLAGS(z,, [#include <zlib.h>], [compress (0, 0, 0, 0);])
+- if test x$ac_cv_libz != xyes; then
+-   AC_MSG_WARN(
+-*** 
+-*** ZLIB was not found. You will not be able to use ZLIB compression.)
+- fi
+ else
+  AC_MSG_RESULT(no)
+ fi
+ 
+-PKG_CHECK_EXISTS(zlib, ZLIB_HAS_PKGCONFIG=y, ZLIB_HAS_PKGCONFIG=n)
+-
+ if test x$ac_zlib != xno; then
+-  if test "$ZLIB_HAS_PKGCONFIG" = "y" ; then
+-    if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
+-      GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
+-    else
+-      GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, zlib"
+-    fi
++  PKG_CHECK_MODULES(ZLIB, zlib)
++  HAVE_LIBZ=yes
++  AC_DEFINE([HAVE_LIBZ], [1], [zlib is enabled])
++  AC_SUBST(HAVE_LIBZ)
++  LTLIBZ=$ZLIB_LIBS
++  AC_SUBST(LTLIBZ)
++  if test "x$GNUTLS_REQUIRES_PRIVATE" = x; then
++    GNUTLS_REQUIRES_PRIVATE="Requires.private: zlib"
++  else
++    GNUTLS_REQUIRES_PRIVATE="$GNUTLS_REQUIRES_PRIVATE, zlib"
+   fi
+ fi
+ AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/gnutls/gnutls_3.3.17.1.bb b/meta/recipes-support/gnutls/gnutls_3.3.17.1.bb
new file mode 100644
index 0000000..0185797
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls_3.3.17.1.bb
@@ -0,0 +1,8 @@
+require gnutls.inc
+
+SRC_URI += "file://correct_rpl_gettimeofday_signature.patch \
+            file://configure.ac-fix-sed-command.patch \
+            file://use-pkg-config-to-locate-zlib.patch \
+           "
+SRC_URI[md5sum] = "8d01c7e7f2cbc5871fdca832d2260b6b"
+SRC_URI[sha256sum] = "b40f158030a92f450a07b20300a3996710ca19800848d9f6fd62493170c5bbb4"
diff --git a/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch b/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch
new file mode 100644
index 0000000..2ac89f3
--- /dev/null
+++ b/meta/recipes-support/gnutls/libtasn1/dont-depend-on-help2man.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd libtasn1-2.14/doc/Makefile.am libtasn1-2.14/doc/Makefile.am
+--- libtasn1-2.14/doc/Makefile.am	2012-09-24 15:08:42.000000000 +0300
++++ libtasn1-2.14/doc/Makefile.am	2013-01-03 07:35:26.702763403 +0200
+@@ -31,7 +31,7 @@
+ AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) \
+	--no-split --number-sections --css-include=texinfo.css
+
+-dist_man_MANS = $(gdoc_MANS) asn1Parser.1 asn1Coding.1 asn1Decoding.1
++dist_man_MANS = $(gdoc_MANS)
+
+ HELP2MAN_OPTS = --info-page libtasn1
diff --git a/meta/recipes-support/gnutls/libtasn1_4.5.bb b/meta/recipes-support/gnutls/libtasn1_4.5.bb
new file mode 100644
index 0000000..f874574
--- /dev/null
+++ b/meta/recipes-support/gnutls/libtasn1_4.5.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Library for ASN.1 and DER manipulation"
+HOMEPAGE = "http://www.gnu.org/software/libtasn1/"
+
+LICENSE = "GPLv3+ & LGPLv2.1+"
+LICENSE_${PN}-bin = "GPLv3+"
+LICENSE_${PN} = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
+                    file://README;endline=8;md5=c3803a3e8ca5ab5eb1e5912faa405351"
+
+SRC_URI = "${GNU_MIRROR}/libtasn1/libtasn1-${PV}.tar.gz \
+           file://dont-depend-on-help2man.patch \
+           "
+
+SRC_URI[md5sum] = "81d272697545e82d39f6bd14854b68f0"
+SRC_URI[sha256sum] = "89b3b5dce119273431544ecb305081f3530911001bb12e5d76588907edb71bda"
+
+inherit autotools texinfo binconfig lib_package
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/gpgme/gpgme/gpgme.pc b/meta/recipes-support/gpgme/gpgme/gpgme.pc
new file mode 100644
index 0000000..30a4d56
--- /dev/null
+++ b/meta/recipes-support/gpgme/gpgme/gpgme.pc
@@ -0,0 +1,10 @@
+prefix=/usr
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+Name: gpgme
+Description: GNU Privacy Guard Made Easy
+Version: 1.4.3
+Requires:
+Libs: -L${libdir} -lgpgme -lassuan -lgpg-error
+Cflags: -I${includedir}
diff --git a/meta/recipes-support/gpgme/gpgme/pkgconfig.patch b/meta/recipes-support/gpgme/gpgme/pkgconfig.patch
new file mode 100644
index 0000000..e2f1f4f
--- /dev/null
+++ b/meta/recipes-support/gpgme/gpgme/pkgconfig.patch
@@ -0,0 +1,279 @@
+Update gpgme to use pkgconfig instead of -config files since its
+simpler and less error prone when cross compiling.
+
+Upstream-Status: Denied [Upstream not interested in pkg-config support]
+RP 2015/4/17
+
+diff --git a/configure.ac b/configure.ac
+index 298a22b..c778b61 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -622,6 +622,7 @@ AC_CONFIG_FILES(Makefile src/Makefile
+                 src/versioninfo.rc
+                 src/gpgme.h)
+ AC_CONFIG_FILES(src/gpgme-config, chmod +x src/gpgme-config)
++AC_CONFIG_FILES(src/gpgme.pc src/gpgme-pthread.pc)
+ AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd])
+ AC_OUTPUT
+ 
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 58922f9..40d0dca 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -20,11 +20,13 @@
+ 
+ # Note: moc_kdpipeiodevice should actually be a dependecy below.
+ EXTRA_DIST = gpgme-config.in gpgme.m4 libgpgme.vers ChangeLog-2011 \
+-	     gpgme.h.in versioninfo.rc.in gpgme.def moc_kdpipeiodevice.cpp
++	     gpgme.h.in versioninfo.rc.in gpgme.def moc_kdpipeiodevice.cpp gpgme.pc.in gpgme-pthread.pc.in
+ 
+ bin_SCRIPTS = gpgme-config
+ m4datadir = $(datadir)/aclocal
+ m4data_DATA = gpgme.m4
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = gpgme.pc gpgme-pthread.pc
+ nodist_include_HEADERS = gpgme.h
+ 
+ bin_PROGRAMS = gpgme-tool
+diff --git a/src/gpgme-pthread.pc.in b/src/gpgme-pthread.pc.in
+new file mode 100644
+index 0000000..980a48e
+--- /dev/null
++++ b/src/gpgme-pthread.pc.in
+@@ -0,0 +1,15 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++# API info
++api_version=@GPGME_CONFIG_API_VERSION@
++host=@GPGME_CONFIG_HOST@
++
++Name: gpgme
++Description: GnuPG Made Easy (GPGME) is a C language library that allows to addsupport for cryptography to a program (threaded version)
++Version: @VERSION@
++Libs: -L${libdir} -lgpgme-pthread -lpthread
++Cflags: -I${includedir}
++Requires: libassuan gpg-error
+diff --git a/src/gpgme.m4 b/src/gpgme.m4
+index 6c2be44..d8a75cb 100644
+--- a/src/gpgme.m4
++++ b/src/gpgme.m4
+@@ -79,7 +79,7 @@ dnl config script does not match the host specification the script
+ dnl is added to the gpg_config_script_warn variable.
+ dnl
+ AC_DEFUN([AM_PATH_GPGME],
+-[ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl
++[
+   tmp=ifelse([$1], ,1:0.4.2,$1)
+   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+      req_gpgme_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
+@@ -89,36 +89,12 @@ AC_DEFUN([AM_PATH_GPGME],
+      min_gpgme_version="$tmp"
+   fi
+ 
+-  AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version)
+-  ok=no
+-  if test "$GPGME_CONFIG" != "no" ; then
+-    req_major=`echo $min_gpgme_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+-    req_minor=`echo $min_gpgme_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+-    req_micro=`echo $min_gpgme_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+-    if test "$gpgme_version_major" -gt "$req_major"; then
+-        ok=yes
+-    else
+-        if test "$gpgme_version_major" -eq "$req_major"; then
+-            if test "$gpgme_version_minor" -gt "$req_minor"; then
+-               ok=yes
+-            else
+-               if test "$gpgme_version_minor" -eq "$req_minor"; then
+-                   if test "$gpgme_version_micro" -ge "$req_micro"; then
+-                     ok=yes
+-                   fi
+-               fi
+-            fi
+-        fi
+-    fi
+-  fi
++  PKG_CHECK_MODULES(GPGME, [gpgme >= $min_gpgme_version], [ok=yes], [ok=no])
+   if test $ok = yes; then
+      # If we have a recent GPGME, we should also check that the
+      # API is compatible.
+      if test "$req_gpgme_api" -gt 0 ; then
+-        tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0`
++        tmp=`$PKG_CONFIG --variable=api_version gpgme 2>/dev/null || echo 0`
+         if test "$tmp" -gt 0 ; then
+            if test "$req_gpgme_api" -ne "$tmp" ; then
+              ok=no
+@@ -127,19 +103,11 @@ AC_DEFUN([AM_PATH_GPGME],
+      fi
+   fi
+   if test $ok = yes; then
+-    GPGME_CFLAGS=`$GPGME_CONFIG --cflags`
+-    GPGME_LIBS=`$GPGME_CONFIG --libs`
+-    AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])
+     _AM_PATH_GPGME_CONFIG_HOST_CHECK
+   else
+-    GPGME_CFLAGS=""
+-    GPGME_LIBS=""
+-    AC_MSG_RESULT(no)
+     ifelse([$3], , :, [$3])
+   fi
+-  AC_SUBST(GPGME_CFLAGS)
+-  AC_SUBST(GPGME_LIBS)
+ ])
+ 
+ dnl AM_PATH_GPGME_PTHREAD([MINIMUM-VERSION,
+@@ -148,7 +116,7 @@ dnl Test for libgpgme and define GPGME_PTHREAD_CFLAGS
+ dnl  and GPGME_PTHREAD_LIBS.
+ dnl
+ AC_DEFUN([AM_PATH_GPGME_PTHREAD],
+-[ AC_REQUIRE([_AM_PATH_GPGME_CONFIG])dnl
++[
+   tmp=ifelse([$1], ,1:0.4.2,$1)
+   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+      req_gpgme_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
+@@ -158,38 +126,12 @@ AC_DEFUN([AM_PATH_GPGME_PTHREAD],
+      min_gpgme_version="$tmp"
+   fi
+ 
+-  AC_MSG_CHECKING(for GPGME pthread - version >= $min_gpgme_version)
+-  ok=no
+-  if test "$GPGME_CONFIG" != "no" ; then
+-    if `$GPGME_CONFIG --thread=pthread 2> /dev/null` ; then
+-      req_major=`echo $min_gpgme_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+-      req_minor=`echo $min_gpgme_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+-      req_micro=`echo $min_gpgme_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+-      if test "$gpgme_version_major" -gt "$req_major"; then
+-        ok=yes
+-      else
+-        if test "$gpgme_version_major" -eq "$req_major"; then
+-          if test "$gpgme_version_minor" -gt "$req_minor"; then
+-            ok=yes
+-          else
+-            if test "$gpgme_version_minor" -eq "$req_minor"; then
+-              if test "$gpgme_version_micro" -ge "$req_micro"; then
+-                ok=yes
+-              fi
+-            fi
+-          fi
+-        fi
+-      fi
+-    fi
+-  fi
++  PKG_CHECK_MODULES(GPGME_PTHREAD, [gpgme-pthread >= $min_gpgme_version], [ok=yes], [ok=no])
+   if test $ok = yes; then
+      # If we have a recent GPGME, we should also check that the
+      # API is compatible.
+      if test "$req_gpgme_api" -gt 0 ; then
+-        tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0`
++        tmp=`$PKG_CONFIG --variable=api_version gpgme-pthread 2>/dev/null || echo 0`
+         if test "$tmp" -gt 0 ; then
+            if test "$req_gpgme_api" -ne "$tmp" ; then
+              ok=no
+@@ -198,19 +140,11 @@ AC_DEFUN([AM_PATH_GPGME_PTHREAD],
+      fi
+   fi
+   if test $ok = yes; then
+-    GPGME_PTHREAD_CFLAGS=`$GPGME_CONFIG --thread=pthread --cflags`
+-    GPGME_PTHREAD_LIBS=`$GPGME_CONFIG --thread=pthread --libs`
+-    AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])
+     _AM_PATH_GPGME_CONFIG_HOST_CHECK
+   else
+-    GPGME_PTHREAD_CFLAGS=""
+-    GPGME_PTHREAD_LIBS=""
+-    AC_MSG_RESULT(no)
+     ifelse([$3], , :, [$3])
+   fi
+-  AC_SUBST(GPGME_PTHREAD_CFLAGS)
+-  AC_SUBST(GPGME_PTHREAD_LIBS)
+ ])
+ 
+ 
+@@ -229,36 +163,12 @@ AC_DEFUN([AM_PATH_GPGME_GLIB],
+      min_gpgme_version="$tmp"
+   fi
+ 
+-  AC_MSG_CHECKING(for GPGME - version >= $min_gpgme_version)
+-  ok=no
+-  if test "$GPGME_CONFIG" != "no" ; then
+-    req_major=`echo $min_gpgme_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+-    req_minor=`echo $min_gpgme_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+-    req_micro=`echo $min_gpgme_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+-    if test "$gpgme_version_major" -gt "$req_major"; then
+-        ok=yes
+-    else
+-        if test "$gpgme_version_major" -eq "$req_major"; then
+-            if test "$gpgme_version_minor" -gt "$req_minor"; then
+-               ok=yes
+-            else
+-               if test "$gpgme_version_minor" -eq "$req_minor"; then
+-                   if test "$gpgme_version_micro" -ge "$req_micro"; then
+-                     ok=yes
+-                   fi
+-               fi
+-            fi
+-        fi
+-    fi
+-  fi
++  PKG_CHECK_MODULES(GPGME_GLIB, [gpgme >= $min_gpgme_version glib-2.0], [ok=yes], [ok=no])  
+   if test $ok = yes; then
+      # If we have a recent GPGME, we should also check that the
+      # API is compatible.
+      if test "$req_gpgme_api" -gt 0 ; then
+-        tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0`
++        tmp=`$PKG_CONFIG --variable=api_version gpgme 2>/dev/null || echo 0`
+         if test "$tmp" -gt 0 ; then
+            if test "$req_gpgme_api" -ne "$tmp" ; then
+              ok=no
+@@ -267,17 +177,9 @@ AC_DEFUN([AM_PATH_GPGME_GLIB],
+      fi
+   fi
+   if test $ok = yes; then
+-    GPGME_GLIB_CFLAGS=`$GPGME_CONFIG --glib --cflags`
+-    GPGME_GLIB_LIBS=`$GPGME_CONFIG --glib --libs`
+-    AC_MSG_RESULT(yes)
+     ifelse([$2], , :, [$2])
+     _AM_PATH_GPGME_CONFIG_HOST_CHECK
+   else
+-    GPGME_GLIB_CFLAGS=""
+-    GPGME_GLIB_LIBS=""
+-    AC_MSG_RESULT(no)
+     ifelse([$3], , :, [$3])
+   fi
+-  AC_SUBST(GPGME_GLIB_CFLAGS)
+-  AC_SUBST(GPGME_GLIB_LIBS)
+ ])
+diff --git a/src/gpgme.pc.in b/src/gpgme.pc.in
+new file mode 100644
+index 0000000..b69539f
+--- /dev/null
++++ b/src/gpgme.pc.in
+@@ -0,0 +1,15 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++# API info
++api_version=@GPGME_CONFIG_API_VERSION@
++host=@GPGME_CONFIG_HOST@
++
++Name: gpgme
++Description: GnuPG Made Easy (GPGME) is a C language library that allows to addsupport for cryptography to a program.
++Version: @VERSION@
++Libs: -L${libdir} -lgpgme
++Cflags: -I${includedir}
++Requires: libassuan gpg-error
+\ No newline at end of file
diff --git a/meta/recipes-support/gpgme/gpgme_1.5.4.bb b/meta/recipes-support/gpgme/gpgme_1.5.4.bb
new file mode 100644
index 0000000..1598377
--- /dev/null
+++ b/meta/recipes-support/gpgme/gpgme_1.5.4.bb
@@ -0,0 +1,39 @@
+SUMMARY = "High-level GnuPG encryption/signing API"
+DESCRIPTION = "GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG easier for applications. It provides a High-Level Crypto API for encryption, decryption, signing, signature verification and key management"
+HOMEPAGE = "http://www.gnupg.org/gpgme.html"
+BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://COPYING.LESSER;md5=bbb461211a33b134d42ed5ee802b37ff \
+                    file://src/gpgme.h.in;endline=23;md5=71ba2ae8d6ca034ed10bd099a8cf473c \
+                    file://src/engine.h;endline=22;md5=4b6d8ba313d9b564cc4d4cfb1640af9d"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/gpgme/${BP}.tar.bz2 \
+           file://gpgme.pc \
+           file://pkgconfig.patch \
+          "
+
+SRC_URI[md5sum] = "feafa03ea064e1d1dc11bc2b88404623"
+SRC_URI[sha256sum] = "bb38c0ec8815c9e94e6047b484984808a8dad9d6bec8df33dc5339fd55ffea6c"
+
+DEPENDS = "libgpg-error libassuan"
+
+BINCONFIG = "${bindir}/gpgme-config"
+
+inherit autotools texinfo binconfig-disabled pkgconfig
+
+PACKAGES =+ "${PN}-pthread"
+FILES_${PN}-pthread = "${libdir}/libgpgme-pthread.so.*"
+FILES_${PN}-dev += "${datadir}/common-lisp/source/gpgme/*"
+
+do_configure_prepend () {
+	# Else these could be used in preference to those in aclocal-copy
+	rm -f ${S}/m4/gpg-error.m4
+	rm -f ${S}/m4/libassuan.m4
+}
+
+do_install_append () {
+        install -d ${D}${libdir}/pkgconfig
+        install -m 0644 ${WORKDIR}/gpgme.pc ${D}${libdir}/pkgconfig/
+}
diff --git a/meta/recipes-support/icu/icu.inc b/meta/recipes-support/icu/icu.inc
new file mode 100644
index 0000000..cc6f222
--- /dev/null
+++ b/meta/recipes-support/icu/icu.inc
@@ -0,0 +1,51 @@
+SUMMARY = "International Component for Unicode libraries"
+DESCRIPTION = "The International Component for Unicode (ICU) is a mature, \
+portable set of C/C++ and Java libraries for Unicode support, software \
+internationalization (I18N) and globalization (G11N), giving applications the \
+same results on all platforms."
+HOMEPAGE = "http://site.icu-project.org/"
+
+LICENSE = "ICU"
+DEPENDS = "icu-native"
+DEPENDS_class-native = ""
+
+S = "${WORKDIR}/icu/source"
+SPDX_S = "${WORKDIR}/icu"
+STAGING_ICU_DIR_NATIVE = "${STAGING_DATADIR_NATIVE}/${BPN}/${PV}"
+
+CPPFLAGS_append_libc-uclibc = " -DU_TIMEZONE=0"
+
+BINCONFIG = "${bindir}/icu-config"
+
+inherit autotools pkgconfig binconfig
+
+# ICU needs the native build directory as an argument to its --with-cross-build option when
+# cross-compiling. Taken the situation that different builds may share a common sstate-cache
+# into consideration, the native build directory needs to be staged.
+EXTRA_OECONF = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
+EXTRA_OECONF_class-native = ""
+EXTRA_OECONF_class-nativesdk = "--with-cross-build=${STAGING_ICU_DIR_NATIVE}"
+
+PREPROCESS_RELOCATE_DIRS = "${datadir}/${BPN}/${PV}"
+do_install_append_class-native() {
+	mkdir -p ${D}/${STAGING_ICU_DIR_NATIVE}/config
+	cp -r ${B}/config/icucross.mk ${D}/${STAGING_ICU_DIR_NATIVE}/config
+	cp -r ${B}/config/icucross.inc ${D}/${STAGING_ICU_DIR_NATIVE}/config
+	cp -r ${B}/lib ${D}/${STAGING_ICU_DIR_NATIVE}
+	cp -r ${B}/bin ${D}/${STAGING_ICU_DIR_NATIVE}
+	cp -r ${B}/tools ${D}/${STAGING_ICU_DIR_NATIVE}
+}
+
+PACKAGES =+ "libicudata libicuuc libicui18n libicule libiculx libicutu libicuio"
+
+FILES_${PN}-dev += "${libdir}/${BPN}/"
+
+FILES_libicudata = "${libdir}/libicudata.so.*"
+FILES_libicuuc = "${libdir}/libicuuc.so.*"
+FILES_libicui18n = "${libdir}/libicui18n.so.*"
+FILES_libicule = "${libdir}/libicule.so.*"
+FILES_libiculx = "${libdir}/libiculx.so.*"
+FILES_libicutu = "${libdir}/libicutu.so.*"
+FILES_libicuio = "${libdir}/libicuio.so.*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch b/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch
new file mode 100644
index 0000000..2968d57
--- /dev/null
+++ b/meta/recipes-support/icu/icu/0001-Disable-LDFLAGSICUDT-for-Linux.patch
@@ -0,0 +1,28 @@
+From 0c82d6aa02c08e41b13c83b14782bd7024e25d59 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 15 Feb 2014 21:06:42 +0000
+Subject: [PATCH] Disable LDFLAGSICUDT for Linux
+
+Upstream-Status: Inappropriate [ OE Configuration ]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ source/config/mh-linux |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/config/mh-linux b/config/mh-linux
+index 366f0cc..2689aab 100644
+--- a/config/mh-linux
++++ b/config/mh-linux
+@@ -21,7 +21,7 @@ LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN
+ LD_RPATH_PRE = -Wl,-rpath,
+ 
+ ## These are the library specific LDFLAGS
+-LDFLAGSICUDT=-nodefaultlibs -nostdlib
++# LDFLAGSICUDT=-nodefaultlibs -nostdlib
+ 
+ ## Compiler switch to embed a library name
+ # The initial tab in the next line is to prevent icu-config from reading it.
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch b/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch
new file mode 100644
index 0000000..6e40659
--- /dev/null
+++ b/meta/recipes-support/icu/icu/icu-pkgdata-large-cmd.patch
@@ -0,0 +1,29 @@
+pkgdata.cpp: use LARGE_BUFFER_MAX_SIZE for cmd
+
+Use LARGE_BUFFER_MAX_SIZE for cmd rather than SMALL_BUFFER_MAX_SIZE,
+otherwise there was a Segmentation fault error when the command line is
+long, this should be a misplay since other cmd uses
+LARGE_BUFFER_MAX_SIZE.
+
+Upstream-Status: Pending
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ tools/pkgdata/pkgdata.cpp |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tools/pkgdata/pkgdata.cpp b/tools/pkgdata/pkgdata.cpp
+--- a/tools/pkgdata/pkgdata.cpp
++++ b/tools/pkgdata/pkgdata.cpp
+@@ -1019,7 +1019,7 @@ normal_symlink_mode:
+ 
+ static int32_t pkg_installLibrary(const char *installDir, const char *targetDir, UBool noVersion) {
+     int32_t result = 0;
+-    char cmd[SMALL_BUFFER_MAX_SIZE];
++    char cmd[LARGE_BUFFER_MAX_SIZE];
+ 
+     sprintf(cmd, "cd %s && %s %s %s%s%s",
+             targetDir,
+-- 
+1.7.10.4
+
diff --git a/meta/recipes-support/icu/icu_55.1.bb b/meta/recipes-support/icu/icu_55.1.bb
new file mode 100644
index 0000000..f63a9bd
--- /dev/null
+++ b/meta/recipes-support/icu/icu_55.1.bb
@@ -0,0 +1,21 @@
+require icu.inc
+
+LIC_FILES_CHKSUM = "file://../license.html;md5=64eff4aadff4d104d6d437c4fde0e6d7"
+
+def icu_download_version(d):
+    pvsplit = d.getVar('PV', True).split('.')
+    return pvsplit[0] + "_" + pvsplit[1]
+
+ICU_PV = "${@icu_download_version(d)}"
+
+BASE_SRC_URI = "http://download.icu-project.org/files/icu4c/${PV}/icu4c-${ICU_PV}-src.tgz"
+SRC_URI = "${BASE_SRC_URI} \
+           file://icu-pkgdata-large-cmd.patch \
+          "
+
+SRC_URI_append_class-target = "\
+           file://0001-Disable-LDFLAGSICUDT-for-Linux.patch \
+          "
+SRC_URI[md5sum] = "e2d523df79d6cb7855c2fbe284f4db29"
+SRC_URI[sha256sum] = "e16b22cbefdd354bec114541f7849a12f8fc2015320ca5282ee4fd787571457b"
+
diff --git a/meta/recipes-support/iso-codes/iso-codes_3.58.bb b/meta/recipes-support/iso-codes/iso-codes_3.58.bb
new file mode 100644
index 0000000..7112e46
--- /dev/null
+++ b/meta/recipes-support/iso-codes/iso-codes_3.58.bb
@@ -0,0 +1,15 @@
+SUMMARY = "ISO language, territory, currency, script codes and their translations"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=fbc093901857fcd118f065f900982c24"
+
+SRC_URI = "https://pkg-isocodes.alioth.debian.org/downloads/iso-codes-${PV}.tar.xz"
+SRC_URI[md5sum] = "34097a0085f0979e28f9db66ec274c5e"
+SRC_URI[sha256sum] = "86af5735dce6e4eff2b983e5d8aa9a3dea1b8db702333ff20be89e45f7f35a72"
+
+# inherit gettext cannot be used, because it adds gettext-native to BASEDEPENDS which
+# are inhibited by allarch
+DEPENDS = "gettext-native"
+
+inherit allarch autotools
+
+FILES_${PN} += "${datadir}/xml/"
diff --git a/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch b/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch
new file mode 100644
index 0000000..b6ccdda
--- /dev/null
+++ b/meta/recipes-support/libassuan/libassuan/libassuan-add-pkgconfig-support.patch
@@ -0,0 +1,158 @@
+Add pkgconfig support to libassuan.
+This patch is rejected by upstream for the reason below:
+They think pkgconfig adds no portability and maintaining them is not worthwhile.
+
+Upstream-Status: Denied
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: libassuan-2.1.2/Makefile.am
+===================================================================
+--- libassuan-2.1.2.orig/Makefile.am
++++ libassuan-2.1.2/Makefile.am
+@@ -24,10 +24,13 @@ AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gz
+ # (A suitable gitlog-to-changelog script can be found in GnuPG master.)
+ GITLOG_TO_CHANGELOG=gitlog-to-changelog
+ 
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = libassuan.pc
++
+ EXTRA_DIST = autogen.sh autogen.rc README.GIT         	                \
+              ChangeLog-2011 doc/ChangeLog-2011 src/ChangeLog-2011 	\
+              tests/ChangeLog-2011 contrib/ChangeLog-2011     		\
+-             build-aux/git-log-footer build-aux/git-log-fix
++             build-aux/git-log-footer build-aux/git-log-fix libassuan.pc.in
+ 
+ SUBDIRS = m4 src doc tests
+ 
+Index: libassuan-2.1.2/libassuan.pc.in
+===================================================================
+--- /dev/null
++++ libassuan-2.1.2/libassuan.pc.in
+@@ -0,0 +1,14 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++api_version=@LIBASSUAN_CONFIG_API_VERSION@
++host=@LIBASSUAN_CONFIG_HOST@
++
++Name: libassuan
++Description: IPC library used by GnuPG and GPGME
++Requires:
++Version: @VERSION@
++Libs: -L${libdir} -lassuan
++Libs.private: -lgpg-error
++Cflags: -I${includedir}
+Index: libassuan-2.1.2/configure.ac
+===================================================================
+--- libassuan-2.1.2.orig/configure.ac
++++ libassuan-2.1.2/configure.ac
+@@ -439,7 +439,7 @@ AC_CONFIG_FILES([doc/Makefile])
+ AC_CONFIG_FILES([tests/Makefile])
+ AC_CONFIG_FILES([src/libassuan-config], [chmod +x src/libassuan-config])
+ AC_CONFIG_FILES([src/versioninfo.rc])
+-
++AC_CONFIG_FILES([libassuan.pc])
+ AC_OUTPUT
+ 
+ echo "
+Index: libassuan-2.1.2/src/libassuan.m4
+===================================================================
+--- libassuan-2.1.2.orig/src/libassuan.m4
++++ libassuan-2.1.2/src/libassuan.m4
+@@ -15,18 +15,6 @@ dnl Returns ok set to yes or no.
+ dnl
+ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
+ [ AC_REQUIRE([AC_CANONICAL_HOST])
+-  AC_ARG_WITH(libassuan-prefix,
+-              AC_HELP_STRING([--with-libassuan-prefix=PFX],
+-                             [prefix where LIBASSUAN is installed (optional)]),
+-     libassuan_config_prefix="$withval", libassuan_config_prefix="")
+-  if test x$libassuan_config_prefix != x ; then
+-    libassuan_config_args="$libassuan_config_args --prefix=$libassuan_config_prefix"
+-    if test x${LIBASSUAN_CONFIG+set} != xset ; then
+-      LIBASSUAN_CONFIG=$libassuan_config_prefix/bin/libassuan-config
+-    fi
+-  fi
+-
+-  AC_PATH_TOOL(LIBASSUAN_CONFIG, libassuan-config, no)
+ 
+   tmp=ifelse([$1], ,1:0.9.2,$1)
+   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+@@ -37,51 +25,12 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
+     min_libassuan_version="$tmp"
+   fi
+ 
+-  AC_MSG_CHECKING(for LIBASSUAN - version >= $min_libassuan_version)
+-  ok=no
+-  if test "$LIBASSUAN_CONFIG" != "no" \
+-     && test -f "$LIBASSUAN_CONFIG" ; then
+-    req_major=`echo $min_libassuan_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+-    req_minor=`echo $min_libassuan_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+-    req_micro=`echo $min_libassuan_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+-
+-    libassuan_config_version=`$LIBASSUAN_CONFIG --version`
+-    major=`echo $libassuan_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+-    minor=`echo $libassuan_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+-    micro=`echo $libassuan_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
+-
+-    if test "$major" -gt "$req_major"; then
+-        ok=yes
+-    else 
+-        if test "$major" -eq "$req_major"; then
+-            if test "$minor" -gt "$req_minor"; then
+-               ok=yes
+-            else
+-               if test "$minor" -eq "$req_minor"; then
+-                   if test "$micro" -ge "$req_micro"; then
+-                     ok=yes
+-                   fi
+-               fi
+-            fi
+-        fi
+-    fi
+-  fi
+-
+-  if test $ok = yes; then
+-    AC_MSG_RESULT([yes ($libassuan_config_version)])
+-  else
+-    AC_MSG_RESULT(no)
+-  fi
++  PKG_CHECK_MODULES(LIBASSUAN, [libassuan >= $min_libassuan_version], [ok=yes], [ok=no])
+ 
+   if test $ok = yes; then
+     if test "$req_libassuan_api" -gt 0 ; then
+       tmp=`$LIBASSUAN_CONFIG --api-version 2>/dev/null || echo 0`
++      tmp=`$PKG_CONFIG --variable=api_version libassuan`
+       if test "$tmp" -gt 0 ; then
+         AC_MSG_CHECKING([LIBASSUAN API version])
+         if test "$req_libassuan_api" -eq "$tmp" ; then
+@@ -96,7 +45,7 @@ AC_DEFUN([_AM_PATH_LIBASSUAN_COMMON],
+ 
+   if test $ok = yes; then
+     if test x"$host" != x ; then
+-      libassuan_config_host=`$LIBASSUAN_CONFIG --host 2>/dev/null || echo none`
++      libassuan_config_host=`$PKG_CONFIG --variable=host libassuan`
+       if test x"$libassuan_config_host" != xnone ; then
+         if test x"$libassuan_config_host" != x"$host" ; then
+   AC_MSG_WARN([[
+@@ -137,12 +86,8 @@ dnl
+ AC_DEFUN([AM_PATH_LIBASSUAN],
+ [ _AM_PATH_LIBASSUAN_COMMON($1)
+   if test $ok = yes; then
+-    LIBASSUAN_CFLAGS=`$LIBASSUAN_CONFIG $libassuan_config_args --cflags`
+-    LIBASSUAN_LIBS=`$LIBASSUAN_CONFIG $libassuan_config_args --libs`
+     ifelse([$2], , :, [$2])
+   else
+-    LIBASSUAN_CFLAGS=""
+-    LIBASSUAN_LIBS=""
+     ifelse([$3], , :, [$3])
+   fi
+   AC_SUBST(LIBASSUAN_CFLAGS)
diff --git a/meta/recipes-support/libassuan/libassuan_2.2.1.bb b/meta/recipes-support/libassuan/libassuan_2.2.1.bb
new file mode 100644
index 0000000..75ae43f
--- /dev/null
+++ b/meta/recipes-support/libassuan/libassuan_2.2.1.bb
@@ -0,0 +1,28 @@
+SUMMARY = "IPC library used by GnuPG and GPGME"
+HOMEPAGE = "http://www.gnupg.org/related_software/libassuan/"
+BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
+
+LICENSE = "GPLv3 & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949 \
+                    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://src/assuan.c;endline=20;md5=0f465544183405055ec179869fc5b5ba \
+                    file://src/assuan-defs.h;endline=20;md5=20cd55535260ca1779edae5c7b80b21e"
+
+DEPENDS = "libgpg-error"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-${PV}.tar.bz2 \
+	   file://libassuan-add-pkgconfig-support.patch"
+
+SRC_URI[md5sum] = "6290e750ee87be3bfd9579fc44c6a186"
+SRC_URI[sha256sum] = "949285bb79345362cb72a40c798defefc007031c60f2f10251720bf60a9de2de"
+
+BINCONFIG = "${bindir}/libassuan-config"
+
+inherit autotools texinfo binconfig-disabled pkgconfig
+
+do_configure_prepend () {
+	# Else these could be used in prefernce to those in aclocal-copy
+	rm -f ${S}/m4/*.m4
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/libatomic-ops/libatomic-ops_7.4.2.bb b/meta/recipes-support/libatomic-ops/libatomic-ops_7.4.2.bb
new file mode 100644
index 0000000..4d0e299
--- /dev/null
+++ b/meta/recipes-support/libatomic-ops/libatomic-ops_7.4.2.bb
@@ -0,0 +1,29 @@
+SUMMARY = "A library for atomic integer operations"
+HOMEPAGE = "https://github.com/ivmai/libatomic_ops/"
+SECTION = "optional"
+PROVIDES += "libatomics-ops"
+LICENSE = "GPLv2 & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://doc/LICENSING.txt;md5=e00dd5c8ac03a14c5ae5225a4525fa2d \
+		   "
+
+SRC_URI = "http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "1d6538604b314d2fccdf86915e5c0857"
+SRC_URI[sha256sum] = "04fa615f62992547bcbda562260e28b504bc4c06e2f985f267f3ade30304b5dd"
+
+S = "${WORKDIR}/libatomic_ops-${PV}"
+
+ALLOW_EMPTY_${PN} = "1"
+
+ARM_INSTRUCTION_SET = "arm"
+
+inherit autotools pkgconfig
+
+do_install_append() {
+	# those contain only docs, not necessary for now.
+	install -m 0755 -d ${D}${docdir}
+	mv ${D}${datadir}/libatomic_ops ${D}${docdir}/${BPN}
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/libbsd/libbsd_0.7.0.bb b/meta/recipes-support/libbsd/libbsd_0.7.0.bb
new file mode 100644
index 0000000..902666d
--- /dev/null
+++ b/meta/recipes-support/libbsd/libbsd_0.7.0.bb
@@ -0,0 +1,21 @@
+# Copyright (C) 2013 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Library of utility functions from BSD systems"
+DESCRIPTION = "This library provides useful functions commonly found on BSD systems, \
+               and lacking on others like GNU systems, thus making it easier to port \
+               projects with strong BSD origins, without needing to embed the same \
+               code over and over again on each project."
+
+HOMEPAGE = "http://libbsd.freedesktop.org/wiki/"
+LICENSE = "BSD-4-Clause & MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=f1530ea92aeaa1c5e2547cfd43905d8c"
+SECTION = "libs"
+DEPENDS = ""
+
+SRC_URI = "http://libbsd.freedesktop.org/releases/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "fcceb4e66fd448ca4ed42ba22a8babb0"
+SRC_URI[sha256sum] = "0f3b0e17e5c34c038126e0a04351b11e23c6101a7d0ce3beeab29bb6415c10bb"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-support/libcap-ng/libcap-ng/python.patch b/meta/recipes-support/libcap-ng/libcap-ng/python.patch
new file mode 100644
index 0000000..59591eb
--- /dev/null
+++ b/meta/recipes-support/libcap-ng/libcap-ng/python.patch
@@ -0,0 +1,58 @@
+From b01bb2694f66cd981e6d61523433dc3eb5ed32f2 Mon Sep 17 00:00:00 2001
+From: Li xin <lixin.fnst@cn.fujitsu.com>
+Date: Sat, 18 Jul 2015 23:03:30 +0900
+Subject: [PATCH] configure.ac - Avoid an incorrect check for python.
+ Makefile.am - avoid hard coded host include paths.
+
+Upstream-Status: pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
+---
+ bindings/python/Makefile.am |  3 ++-
+ configure.ac                | 15 ++-------------
+ 2 files changed, 4 insertions(+), 14 deletions(-)
+
+diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
+index 82b9bb8..f9fe7a8 100644
+--- a/bindings/python/Makefile.am
++++ b/bindings/python/Makefile.am
+@@ -23,7 +23,8 @@ SUBDIRS = test
+ CONFIG_CLEAN_FILES = *.loT *.rej *.orig
+ AM_CFLAGS = -fPIC -DPIC
+ PYLIBVER ?= python$(PYTHON_VERSION)
+-AM_CPPFLAGS = -I. -I$(top_builddir) -I@PYINCLUDEDIR@
++PYINC ?= /usr/include/$(PYLIBVER)
++AM_CPPFLAGS = -I. -I$(top_builddir) -I$(PYINC)
+ LIBS = $(top_builddir)/src/libcap-ng.la
+ SWIG_FLAGS = -python
+ SWIG_INCLUDES = ${AM_CPPFLAGS}
+diff --git a/configure.ac b/configure.ac
+index 1d777d5..9d90f64 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -123,19 +123,8 @@ if test x$use_python = xno ; then
+ else
+ AC_MSG_RESULT(testing)
+ AM_PATH_PYTHON
+-PYINCLUDEDIR=`python${am_cv_python_version} -c "from distutils import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))"`
+-if test -f ${PYINCLUDEDIR}/Python.h ; then
+-	python_found="yes"
+-	AC_SUBST(PYINCLUDEDIR)
+-	AC_MSG_NOTICE(Python bindings will be built)
+-else
+-	python_found="no"
+-	if test x$use_python = xyes ; then
+-		AC_MSG_ERROR([Python explicitly required and python headers found])
+-	else
+-		AC_MSG_WARN("Python headers not found - python bindings will not be made")
+-	fi
+-fi
++python_found="yes"
++AC_MSG_NOTICE(Python bindings will be built)
+ fi
+ AM_CONDITIONAL(HAVE_PYTHON, test ${python_found} = "yes")
+ 
+-- 
+1.8.4.2
+
diff --git a/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb b/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb
new file mode 100644
index 0000000..a31d5dc
--- /dev/null
+++ b/meta/recipes-support/libcap-ng/libcap-ng_0.7.7.bb
@@ -0,0 +1,39 @@
+SUMMARY = "An alternate posix capabilities library"
+DESCRIPTION = "The libcap-ng library is intended to make programming \
+with POSIX capabilities much easier than the traditional libcap library."
+HOMEPAGE = "http://freecode.com/projects/libcap-ng"
+SECTION = "base"
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+		    file://COPYING.LIB;md5=e3eda01d9815f8d24aae2dbd89b68b06"
+
+SRC_URI = "http://people.redhat.com/sgrubb/libcap-ng/libcap-ng-${PV}.tar.gz \
+           file://python.patch"
+
+inherit lib_package autotools pythonnative
+
+SRC_URI[md5sum] = "3d7d126b29e2869a0257c17c8b0d9b2e"
+SRC_URI[sha256sum] = "615549ce39b333f6b78baee0c0b4ef18bc726c6bf1cca123dfd89dd963f6d06b"
+
+DEPENDS += "swig-native python"
+
+EXTRA_OECONF += "--without-python3"
+
+EXTRA_OEMAKE += "PYLIBVER='python${PYTHON_BASEVERSION}' PYINC='${STAGING_INCDIR}/${PYLIBVER}'"
+
+PACKAGES += "${PN}-python"
+
+FILES_${PN}-dbg += "${libdir}/python${PYTHON_BASEVERSION}/*/.debug"
+FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}"
+
+BBCLASSEXTEND = "native"
+
+do_install_append() {
+	# Moving libcap-ng to base_libdir
+	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+		mkdir -p ${D}/${base_libdir}/
+		mv -f ${D}${libdir}/libcap-ng.so.* ${D}${base_libdir}/
+		relpath=${@os.path.relpath("${base_libdir}", "${libdir}")}
+		ln -sf ${relpath}/libcap-ng.so.0.0.0 ${D}${libdir}/libcap-ng.so
+	fi
+}
diff --git a/meta/recipes-support/libcap/libcap_2.24.bb b/meta/recipes-support/libcap/libcap_2.24.bb
new file mode 100644
index 0000000..36b94ee
--- /dev/null
+++ b/meta/recipes-support/libcap/libcap_2.24.bb
@@ -0,0 +1,77 @@
+SUMMARY = "Library for getting/setting POSIX.1e capabilities"
+HOMEPAGE = "http://sites.google.com/site/fullycapable/"
+
+# no specific GPL version required
+LICENSE = "BSD | GPLv2"
+LIC_FILES_CHKSUM = "file://License;md5=3f84fd6f29d453a56514cb7e4ead25f1"
+
+DEPENDS = "perl-native-runtime"
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/libs/security/linux-privs/${BPN}2/${BPN}-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "d43ab9f680435a7fff35b4ace8d45b80"
+SRC_URI[sha256sum] = "cee4568f78dc851d726fc93f25f4ed91cc223b1fe8259daa4a77158d174e6c65"
+
+inherit lib_package
+
+# do NOT pass target cflags to host compilations
+#
+do_configure() {
+	# libcap uses := for compilers, fortunately, it gives us a hint
+	# on what should be replaced with ?=
+	sed -e 's,:=,?=,g' -i Make.Rules
+	sed -e 's,^BUILD_CFLAGS ?= $(.*CFLAGS),BUILD_CFLAGS := $(BUILD_CFLAGS),' -i Make.Rules
+
+	# disable gperf detection
+	sed -e '/shell gperf/cifeq (,yes)' -i libcap/Makefile
+}
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
+                   ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'attr', '', d)}"
+PACKAGECONFIG_class-native ??= ""
+
+PACKAGECONFIG[attr] = "LIBATTR=yes,LIBATTR=no,attr"
+PACKAGECONFIG[pam] = "PAM_CAP=yes,PAM_CAP=no,libpam"
+
+EXTRA_OEMAKE = " \
+  INDENT=  \
+  lib=${@os.path.basename('${libdir}')} \
+  RAISE_SETFCAP=no \
+  DYNAMIC=yes \
+"
+
+EXTRA_OEMAKE_append_class-target = " SYSTEM_HEADERS=${STAGING_INCDIR}"
+
+# these are present in the libcap defaults, so include in our CFLAGS too
+CFLAGS += "-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
+
+do_compile() {
+	oe_runmake ${EXTRA_OECONF}
+}
+
+do_install() {
+	oe_runmake install \
+		${EXTRA_OECONF} \
+		DESTDIR="${D}" \
+		prefix="${prefix}" \
+		SBINDIR="${D}${sbindir}"
+}
+
+do_install_append() {
+	# Move the library to base_libdir
+	install -d ${D}${base_libdir}
+	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+		mv ${D}${libdir}/libcap* ${D}${base_libdir}
+                if [ -d ${D}${libdir}/security ]; then
+			mv ${D}${libdir}/security ${D}${base_libdir}
+		fi
+	fi
+}
+
+FILES_${PN}-dev += "${base_libdir}/*.so"
+
+# pam files
+FILES_${PN} += "${base_libdir}/security/*.so"
+FILES_${PN}-dbg += "${base_libdir}/security/.debug/*.so"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/libcheck/libcheck_0.10.0.bb b/meta/recipes-support/libcheck/libcheck_0.10.0.bb
new file mode 100644
index 0000000..c0b459f
--- /dev/null
+++ b/meta/recipes-support/libcheck/libcheck_0.10.0.bb
@@ -0,0 +1,24 @@
+SUMMARY  = "Check - unit testing framework for C code"
+HOMEPAGE = "http://check.sourceforge.net/"
+SECTION = "devel"
+
+LICENSE  = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/check/check-${PV}.tar.gz \
+          "
+
+SRC_URI[md5sum] = "53c5e5c77d090e103a17f3ed7fd7d8b8"
+SRC_URI[sha256sum] = "f5f50766aa6f8fe5a2df752666ca01a950add45079aa06416b83765b1cf71052"
+
+S = "${WORKDIR}/check-${PV}"
+
+inherit autotools pkgconfig texinfo
+
+CACHED_CONFIGUREVARS += "ac_cv_path_AWK_PATH=${bindir}/gawk"
+
+RREPLACES_${PN} = "check (<= 0.9.5)"
+RDEPENDS_${PN} += "gawk"
+RDEPENDS_${PN}_class-native = ""
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/libcroco/libcroco_0.6.8.bb b/meta/recipes-support/libcroco/libcroco_0.6.8.bb
new file mode 100644
index 0000000..2b1b910
--- /dev/null
+++ b/meta/recipes-support/libcroco/libcroco_0.6.8.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Cascading Style Sheet (CSS) parsing and manipulation toolkit"
+HOMEPAGE = "http://www.gnome.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2 & LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605 \
+                    file://src/cr-rgb.c;endline=22;md5=31d5f0944d556c8589d04ea6055fcc66 \
+                    file://tests/cr-test-utils.c;endline=21;md5=2382c27934cae1d3792fcb17a6142c4e"
+
+SECTION = "x11/utils"
+DEPENDS = "glib-2.0 libxml2 zlib"
+BBCLASSEXTEND = "native"
+EXTRA_OECONF += "--enable-Bsymbolic=auto"
+PR = "r2"
+
+BINCONFIG = "${bindir}/croco-0.6-config"
+
+inherit autotools pkgconfig gnomebase gtk-doc binconfig-disabled
+
+SRC_URI[archive.md5sum] = "767e73c4174f75b99695d4530fd9bb80"
+SRC_URI[archive.sha256sum] = "ea6e1b858c55219cefd7109756bff5bc1a774ba7a55f7d3ccd734d6b871b8570"
diff --git a/meta/recipes-support/libdaemon/libdaemon/fix-includes.patch b/meta/recipes-support/libdaemon/libdaemon/fix-includes.patch
new file mode 100644
index 0000000..1027ae8
--- /dev/null
+++ b/meta/recipes-support/libdaemon/libdaemon/fix-includes.patch
@@ -0,0 +1,20 @@
+musl complains
+fatal error: sys/unistd.h: No such file or directory
+and rightly so
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Pending
+
+--- libdaemon-0.14.orig/examples/testd.c
++++ libdaemon-0.14/examples/testd.c
+@@ -21,9 +21,9 @@
+ #include <signal.h>
+ #include <errno.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <sys/unistd.h>
+ #include <sys/select.h>
+ 
+ #include <libdaemon/dfork.h>
diff --git a/meta/recipes-support/libdaemon/libdaemon_0.14.bb b/meta/recipes-support/libdaemon/libdaemon_0.14.bb
new file mode 100644
index 0000000..070ee18
--- /dev/null
+++ b/meta/recipes-support/libdaemon/libdaemon_0.14.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Lightweight C library which eases the writing of UNIX daemons"
+SECTION = "libs"
+AUTHOR = "Lennart Poettering <lennart@poettering.net>"
+HOMEPAGE = "http://0pointer.de/lennart/projects/libdaemon/"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://libdaemon/daemon.h;beginline=9;endline=21;md5=bd9fbe57cd96d1a5848a8ba12d9a6bf4"
+
+SRC_URI = "http://0pointer.de/lennart/projects/libdaemon/libdaemon-${PV}.tar.gz \
+           file://fix-includes.patch \
+          "
+
+SRC_URI[md5sum] = "509dc27107c21bcd9fbf2f95f5669563"
+SRC_URI[sha256sum] = "fd23eb5f6f986dcc7e708307355ba3289abe03cc381fc47a80bca4a50aa6b834"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--disable-lynx"
diff --git a/meta/recipes-support/libevdev/libevdev_1.4.2.bb b/meta/recipes-support/libevdev/libevdev_1.4.2.bb
new file mode 100644
index 0000000..f851305
--- /dev/null
+++ b/meta/recipes-support/libevdev/libevdev_1.4.2.bb
@@ -0,0 +1,14 @@
+SUMMARY = "Wrapper library for evdev devices"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libevdev/"
+SECTION = "libs"
+
+LICENSE = "MIT-X"
+LIC_FILES_CHKSUM = "file://COPYING;md5=75aae0d38feea6fda97ca381cb9132eb \
+                    file://libevdev/libevdev.h;endline=21;md5=7ff4f0b5113252c2f1a828e0bbad98d1"
+
+SRC_URI = "http://www.freedesktop.org/software/libevdev/${BP}.tar.xz"
+
+SRC_URI[md5sum] = "debfcd5153558eba25a8e71eb2534ae8"
+SRC_URI[sha256sum] = "7c77b213f075706d428a2af54b66bf86b03a68e9fb390e7ec48cf55065970643"
+
+inherit autotools pkgconfig
diff --git a/meta/recipes-support/libevent/libevent/run-ptest b/meta/recipes-support/libevent/libevent/run-ptest
new file mode 100644
index 0000000..d521688
--- /dev/null
+++ b/meta/recipes-support/libevent/libevent/run-ptest
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+fail=0
+for test in ./test/*
+do
+	$test
+	if [ $? -eq 0 ]
+	then
+		fail=1
+	fi
+done
+
+if [ $fail -eq 0 ]
+then
+	echo "PASS: libevent"
+else
+	echo "FAIL: libevent"
+fi
diff --git a/meta/recipes-support/libevent/libevent_2.0.22.bb b/meta/recipes-support/libevent/libevent_2.0.22.bb
new file mode 100644
index 0000000..58c263c
--- /dev/null
+++ b/meta/recipes-support/libevent/libevent_2.0.22.bb
@@ -0,0 +1,39 @@
+SUMMARY = "An asynchronous event notification library"
+HOMEPAGE = "http://libevent.org/"
+BUGTRACKER = "http://sourceforge.net/tracker/?group_id=50884&atid=461322"
+SECTION = "libs"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=45c5316ff684bcfe2f9f86d8b1279559"
+
+SRC_URI = " \
+    ${SOURCEFORGE_MIRROR}/levent/${BP}-stable.tar.gz \
+    file://run-ptest \
+"
+
+SRC_URI[md5sum] = "c4c56f986aa985677ca1db89630a2e11"
+SRC_URI[sha256sum] = "71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3"
+
+S = "${WORKDIR}/${BPN}-${PV}-stable"
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+
+inherit autotools
+
+# Needed for Debian packaging
+LEAD_SONAME = "libevent-2.0.so"
+
+inherit ptest
+
+DEPENDS = "zlib"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_ptest() {
+	install -d ${D}${PTEST_PATH}/test
+	for file in ${B}/test/.libs/regress ${B}/test/.libs/test*
+	do
+		install -m 0755 $file ${D}${PTEST_PATH}/test
+	done
+}
diff --git a/meta/recipes-support/libexif/libexif_0.6.21.bb b/meta/recipes-support/libexif/libexif_0.6.21.bb
new file mode 100644
index 0000000..cff4cae
--- /dev/null
+++ b/meta/recipes-support/libexif/libexif_0.6.21.bb
@@ -0,0 +1,17 @@
+SUMMARY = "Library for reading extended image information (EXIF) from JPEG files"
+HOMEPAGE = "http://sourceforge.net/projects/libexif"
+SECTION = "libs"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=243b725d71bb5df4a1e5920b344b86ad"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libexif/libexif-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "27339b89850f28c8f1c237f233e05b27"
+SRC_URI[sha256sum] = "16cdaeb62eb3e6dfab2435f7d7bccd2f37438d21c5218ec4e58efa9157d4d41a"
+
+inherit autotools gettext
+
+do_configure_append() {
+	sed -i s:doc\ binary:binary:g Makefile
+}
+
diff --git a/meta/recipes-support/libfm/libfm-extra/0001-nls.m4-Take-it-from-gettext-0.15.patch b/meta/recipes-support/libfm/libfm-extra/0001-nls.m4-Take-it-from-gettext-0.15.patch
new file mode 100644
index 0000000..69a51d5
--- /dev/null
+++ b/meta/recipes-support/libfm/libfm-extra/0001-nls.m4-Take-it-from-gettext-0.15.patch
@@ -0,0 +1,54 @@
+From c320799c941d42a9b7e351805359694ea3b36d2d Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 5 Apr 2015 09:08:38 -0700
+Subject: [PATCH] nls.m4: Take it from gettext-0.15
+
+It otherwise expects gettext to provide it. Lets go independent
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+---
+ m4/nls.m4 | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+ create mode 100644 m4/nls.m4
+
+diff --git a/m4/nls.m4 b/m4/nls.m4
+new file mode 100644
+index 0000000..2c8fe69
+--- /dev/null
++++ b/m4/nls.m4
+@@ -0,0 +1,30 @@
++dnl Copyright (C) 1995-2003, 2005-2006 Free Software Foundation, Inc.
++dnl This file is free software; the Free Software Foundation
++dnl gives unlimited permission to copy and/or distribute it,
++dnl with or without modifications, as long as this notice is preserved.
++dnl
++dnl This file can can be used in projects which are not available under
++dnl the GNU General Public License or the GNU Library General Public
++dnl License but which still want to provide support for the GNU gettext
++dnl functionality.
++dnl Please note that the actual code of the GNU gettext library is covered
++dnl by the GNU Library General Public License, and the rest of the GNU
++dnl gettext package package is covered by the GNU General Public License.
++dnl They are not in the public domain.
++
++dnl Authors:
++dnl Ulrich Drepper drepper@cygnus.com, 1995-2000.
++dnl Bruno Haible haible@clisp.cons.org, 2000-2003.
++
++AC_PREREQ(2.50)
++
++AC_DEFUN([AM_NLS],
++[
++AC_MSG_CHECKING([whether NLS is requested])
++dnl Default is enabled NLS
++AC_ARG_ENABLE(nls,
++[ --disable-nls do not use Native Language Support],
++USE_NLS=$enableval, USE_NLS=yes)
++AC_MSG_RESULT($USE_NLS)
++AC_SUBST(USE_NLS)
++])
+-- 
+2.1.4
+
diff --git a/meta/recipes-support/libfm/libfm-extra_1.2.3.bb b/meta/recipes-support/libfm/libfm-extra_1.2.3.bb
new file mode 100644
index 0000000..46d2d62
--- /dev/null
+++ b/meta/recipes-support/libfm/libfm-extra_1.2.3.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Library for file management"
+HOMEPAGE = "http://pcmanfm.sourceforge.net/"
+
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://src/fm-extra.h;beginline=8;endline=21;md5=ef1f84da64b3c01cca447212f7ef6007"
+
+SECTION = "x11/libs"
+DEPENDS = "glib-2.0 intltool-native"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/libfm-${PV}.tar.xz \
+           file://0001-nls.m4-Take-it-from-gettext-0.15.patch \
+          "
+
+SRC_URI[md5sum] = "3ff38200701658f7e80e25ed395d92dd"
+SRC_URI[sha256sum] = "c692f1624a4cbc8d1dd55f3b3f3369fbf5d26f63a916e2c295230b2344e1fbf9"
+
+S = "${WORKDIR}/libfm-${PV}"
+
+EXTRA_OECONF = "--with-extra-only --with-gtk=no"
+
+PR = "r1"
+
+inherit autotools pkgconfig gtk-doc
+
+do_configure[dirs] =+ "${S}/m4"
diff --git a/meta/recipes-support/libfm/libfm_1.2.3.bb b/meta/recipes-support/libfm/libfm_1.2.3.bb
new file mode 100644
index 0000000..629502f
--- /dev/null
+++ b/meta/recipes-support/libfm/libfm_1.2.3.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Library for file management"
+HOMEPAGE = "http://pcmanfm.sourceforge.net/"
+
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://src/fm.h;beginline=8;endline=21;md5=ef1f84da64b3c01cca447212f7ef6007 \
+                    file://src/base/fm-config.h;beginline=10;endline=23;md5=ef1f84da64b3c01cca447212f7ef6007 \
+                    file://src/fm-gtk.h;beginline=6;endline=19;md5=646baa4955c04fe768f2ca27b92ac8dd"
+
+
+SECTION = "x11/libs"
+DEPENDS = "glib-2.0 pango gtk+ menu-cache intltool-native libexif libfm-extra"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pcmanfm/libfm-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "3ff38200701658f7e80e25ed395d92dd"
+SRC_URI[sha256sum] = "c692f1624a4cbc8d1dd55f3b3f3369fbf5d26f63a916e2c295230b2344e1fbf9"
+
+PR = "r1"
+
+inherit autotools pkgconfig gtk-doc
+
+do_configure[dirs] =+ "${S}/m4"
+
+PACKAGES += "${PN}-mime"
+FILES_${PN}-mime = "${datadir}/mime/"
+FILES_${PN}-dbg += "${libdir}/libfm/modules/.debug"
+
+do_install_append () {
+    # remove files which are part of libfm-extra
+    rm -f ${D}${includedir}/libfm-1.0/fm-xml-file.h
+    rm -f ${D}${includedir}/libfm-1.0/fm-version.h
+    rm -f ${D}${includedir}/libfm-1.0/fm-extra.h
+    rm -f ${D}${libdir}/pkgconfig/libfm-extra.pc
+    rm -f ${D}${libdir}/libfm-extra.so*
+    rm -f ${D}${libdir}/libfm-extra.a
+    rm -f ${D}${libdir}/libfm-extra.la
+}
diff --git a/meta/recipes-support/libgcrypt/files/add-pkgconfig-support.patch b/meta/recipes-support/libgcrypt/files/add-pkgconfig-support.patch
new file mode 100644
index 0000000..67ddfc6
--- /dev/null
+++ b/meta/recipes-support/libgcrypt/files/add-pkgconfig-support.patch
@@ -0,0 +1,151 @@
+Add and use pkg-config for libgcrypt instead of -config scripts.
+
+Upstream-Status: Denied [upstream have indicated they don't want a pkg-config dependency]
+
+RP 2014/5/22
+
+Index: libgcrypt-1.2.4/configure.ac
+===================================================================
+--- libgcrypt-1.2.4.orig/configure.ac	2008-03-19 22:14:50.000000000 +0000
++++ libgcrypt-1.2.4/configure.ac	2008-03-19 22:14:58.000000000 +0000
+@@ -807,6 +807,7 @@
+ doc/Makefile
+ src/Makefile
+ src/gcrypt.h
++src/libgcrypt.pc
+ src/libgcrypt-config
+ tests/Makefile
+ w32-dll/Makefile
+Index: libgcrypt-1.2.4/src/libgcrypt.pc.in
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ libgcrypt-1.2.4/src/libgcrypt.pc.in	2008-03-19 22:14:58.000000000 +0000
+@@ -0,0 +1,33 @@
++# Process this file with autoconf to produce a pkg-config metadata file.
++# Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation
++# Author: Simon Josefsson
++#
++# This file is free software; as a special exception the author gives
++# unlimited permission to copy and/or distribute it, with or without
++# modifications, as long as this notice is preserved.
++#
++# This file is distributed in the hope that it will be useful, but
++# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
++# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
++
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++# API info
++api_version=@LIBGCRYPT_CONFIG_API_VERSION@
++host=@LIBGCRYPT_CONFIG_HOST@
++
++# Misc information.
++symmetric_ciphers=@LIBGCRYPT_CIPHERS@
++asymmetric_ciphers=@LIBGCRYPT_PUBKEY_CIPHERS@
++digests=@LIBGCRYPT_DIGESTS@
++
++Name: libgcrypt
++Description: GNU crypto library
++URL: http://www.gnupg.org
++Version: @VERSION@
++Libs: -L${libdir} -lgcrypt
++Libs.private: -L${libdir} -lgpg-error
++Cflags: -I${includedir} 
+Index: libgcrypt-1.6.1/src/libgcrypt.m4
+===================================================================
+--- libgcrypt-1.6.1.orig/src/libgcrypt.m4	2013-12-16 17:44:32.000000000 +0000
++++ libgcrypt-1.6.1/src/libgcrypt.m4	2014-05-13 21:25:37.478389833 +0000
+@@ -22,17 +22,7 @@
+ dnl
+ AC_DEFUN([AM_PATH_LIBGCRYPT],
+ [ AC_REQUIRE([AC_CANONICAL_HOST])
+-  AC_ARG_WITH(libgcrypt-prefix,
+-            AC_HELP_STRING([--with-libgcrypt-prefix=PFX],
+-                           [prefix where LIBGCRYPT is installed (optional)]),
+-     libgcrypt_config_prefix="$withval", libgcrypt_config_prefix="")
+-  if test x$libgcrypt_config_prefix != x ; then
+-     if test x${LIBGCRYPT_CONFIG+set} != xset ; then
+-        LIBGCRYPT_CONFIG=$libgcrypt_config_prefix/bin/libgcrypt-config
+-     fi
+-  fi
+ 
+-  AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no)
+   tmp=ifelse([$1], ,1:1.2.0,$1)
+   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+      req_libgcrypt_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
+@@ -42,48 +32,13 @@
+      min_libgcrypt_version="$tmp"
+   fi
+ 
+-  AC_MSG_CHECKING(for LIBGCRYPT - version >= $min_libgcrypt_version)
+-  ok=no
+-  if test "$LIBGCRYPT_CONFIG" != "no" ; then
+-    req_major=`echo $min_libgcrypt_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+-    req_minor=`echo $min_libgcrypt_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+-    req_micro=`echo $min_libgcrypt_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+-    libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version`
+-    major=`echo $libgcrypt_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+-    minor=`echo $libgcrypt_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+-    micro=`echo $libgcrypt_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
+-    if test "$major" -gt "$req_major"; then
+-        ok=yes
+-    else
+-        if test "$major" -eq "$req_major"; then
+-            if test "$minor" -gt "$req_minor"; then
+-               ok=yes
+-            else
+-               if test "$minor" -eq "$req_minor"; then
+-                   if test "$micro" -ge "$req_micro"; then
+-                     ok=yes
+-                   fi
+-               fi
+-            fi
+-        fi
+-    fi
+-  fi
+-  if test $ok = yes; then
+-    AC_MSG_RESULT([yes ($libgcrypt_config_version)])
+-  else
+-    AC_MSG_RESULT(no)
+-  fi
++  PKG_CHECK_MODULES(LIBGCRYPT, [libgcrypt >= $min_libgcrypt_version], [ok=yes], [ok=no])
++
+   if test $ok = yes; then
+      # If we have a recent libgcrypt, we should also check that the
+      # API is compatible
+      if test "$req_libgcrypt_api" -gt 0 ; then
+-        tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0`
++        tmp=`$PKG_CONFIG --variable=api_version libgcrypt`
+         if test "$tmp" -gt 0 ; then
+            AC_MSG_CHECKING([LIBGCRYPT API version])
+            if test "$req_libgcrypt_api" -eq "$tmp" ; then
+@@ -96,10 +51,8 @@
+      fi
+   fi
+   if test $ok = yes; then
+-    LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags`
+-    LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs`
+     ifelse([$2], , :, [$2])
+-    libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none`
++    libgcrypt_config_host=`$PKG_CONFIG --variable=host libgcrypt`
+     if test x"$libgcrypt_config_host" != xnone ; then
+       if test x"$libgcrypt_config_host" != x"$host" ; then
+   AC_MSG_WARN([[
+@@ -113,8 +66,6 @@
+       fi
+     fi
+   else
+-    LIBGCRYPT_CFLAGS=""
+-    LIBGCRYPT_LIBS=""
+     ifelse([$3], , :, [$3])
+   fi
+   AC_SUBST(LIBGCRYPT_CFLAGS)
diff --git a/meta/recipes-support/libgcrypt/files/fix-ICE-failure-on-mips-with-option-O-and-g.patch b/meta/recipes-support/libgcrypt/files/fix-ICE-failure-on-mips-with-option-O-and-g.patch
new file mode 100644
index 0000000..582e62f
--- /dev/null
+++ b/meta/recipes-support/libgcrypt/files/fix-ICE-failure-on-mips-with-option-O-and-g.patch
@@ -0,0 +1,71 @@
+tests/bench-slope.c: workaround ICE failure on mips with '-O -g'
+
+Hit a ICE and could reduce it to the following minimal example:
+
+1. Only the size of array assigned with 2 caused the issue:
+$ cat > mipgcc-test.c << END
+
+int main (int argc, char **argv)
+{
+        char *pStrArry[ARRAY_SIZE_MAX] = {"hello"};
+        int i = 0;
+
+        while(pStrArry[i] && i<ARRAY_SIZE_MAX)
+        {
+                printf("%s\n", pStrArry[i]);
+                i++;
+        }
+
+        return 0;
+}
+
+END
+
+2. Only -O1 and -g on mips caused the issue:
+$ mips-poky-linux-gcc -O1 -g -o mipgcc-test mipgcc-test.c
+mipgcc-test.c: In function 'main':
+mipgcc-test.c:18:1: internal compiler error: in dwarf2out_var_location, at dwarf2out.c:20810
+ }
+ ^
+Please submit a full bug report,
+with preprocessed source if appropriate.
+See <http://gcc.gnu.org/bugs.html> for instructions
+
+3. The quick workround is trying to enlarge the size of array with larger
+than 2.
+
+4. File a bug to GNU, but it could not be reproduced on there environment.
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60643
+
+Upstream-Status: Inappropriate [oe specific]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ tests/bench-slope.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/bench-slope.c b/tests/bench-slope.c
+index bd05064..28c2438 100644
+--- a/tests/bench-slope.c
++++ b/tests/bench-slope.c
+@@ -1197,7 +1197,7 @@ static struct bench_ops hash_ops = {
+ };
+ 
+ 
+-static struct bench_hash_mode hash_modes[] = {
++static struct bench_hash_mode hash_modes[3] = {
+   {"", &hash_ops},
+   {0},
+ };
+@@ -1349,7 +1349,7 @@ static struct bench_ops mac_ops = {
+ };
+ 
+ 
+-static struct bench_mac_mode mac_modes[] = {
++static struct bench_mac_mode mac_modes[3] = {
+   {"", &mac_ops},
+   {0},
+ };
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-support/libgcrypt/files/libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch b/meta/recipes-support/libgcrypt/files/libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch
new file mode 100644
index 0000000..a3e5403
--- /dev/null
+++ b/meta/recipes-support/libgcrypt/files/libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch
@@ -0,0 +1,32 @@
+Upstream-Status: Pending
+
+libgcrypt: fix building error with '-O2' in sysroot path
+
+Characters like '-O2' or '-Ofast' will be replaced by '-O1' when compiling cipher.
+If we are cross compiling libgcrypt and sysroot contains such characters, we would
+get compile errors because the sysroot path has been modified.
+
+Fix this by adding blank spaces before and after the original matching pattern in the
+sed command.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ cipher/Makefile.am |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cipher/Makefile.am b/cipher/Makefile.am
+index 76cdc96..9a89792 100644
+--- a/cipher/Makefile.am
++++ b/cipher/Makefile.am
+@@ -69,7 +69,7 @@ rfc2268.c \
+ camellia.c camellia.h camellia-glue.c
+ 
+ if ENABLE_O_FLAG_MUNGING
+-o_flag_munging = sed -e 's/-O\([2-9s][2-9s]*\)/-O1/' -e 's/-Ofast/-O1/g'
++o_flag_munging = sed -e 's/ -O\([2-9s][2-9s]*\) / -O1 /' -e 's/ -Ofast / -O1 /g'
+ else
+ o_flag_munging = cat
+ endif
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-support/libgcrypt/libgcrypt.inc b/meta/recipes-support/libgcrypt/libgcrypt.inc
new file mode 100644
index 0000000..683be78
--- /dev/null
+++ b/meta/recipes-support/libgcrypt/libgcrypt.inc
@@ -0,0 +1,49 @@
+SUMMARY = "General purpose cryptographic library based on the code from GnuPG"
+HOMEPAGE = "http://directory.fsf.org/project/libgcrypt/"
+BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
+SECTION = "libs"
+
+# helper program gcryptrnd and getrandom are under GPL, rest LGPL
+LICENSE = "GPLv2+ & LGPLv2.1+ & GPLv3+"
+LICENSE_${PN} = "LGPLv2.1+"
+LICENSE_${PN}-dev = "GPLv2+ & LGPLv2.1+"
+LICENSE_dumpsexp-dev = "GPLv3+"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff"
+
+DEPENDS = "libgpg-error libcap"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-${PV}.tar.gz \
+           file://add-pkgconfig-support.patch \
+           file://libgcrypt-fix-building-error-with-O2-in-sysroot-path.patch \
+           file://fix-ICE-failure-on-mips-with-option-O-and-g.patch \
+"
+
+BINCONFIG = "${bindir}/libgcrypt-config"
+
+PR = "r1"
+
+inherit autotools texinfo binconfig-disabled pkgconfig
+
+EXTRA_OECONF = "--disable-asm --with-capabilities"
+
+do_configure_prepend () {
+	# Else this could be used in preference to the one in aclocal-copy
+	rm -f ${S}/m4/gpg-error.m4
+}
+
+# libgcrypt.pc is added locally and thus installed here
+do_install_append() {
+	install -d ${D}/${libdir}/pkgconfig
+	install -m 0644 ${B}/src/libgcrypt.pc ${D}/${libdir}/pkgconfig/
+}
+
+PACKAGES =+ "dumpsexp-dev"
+
+FILES_${PN}-dev += "${bindir}/hmac256"
+FILES_dumpsexp-dev += "${bindir}/dumpsexp"
+
+ARM_INSTRUCTION_SET = "arm"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/libgcrypt/libgcrypt_1.6.3.bb b/meta/recipes-support/libgcrypt/libgcrypt_1.6.3.bb
new file mode 100644
index 0000000..cd06ce7
--- /dev/null
+++ b/meta/recipes-support/libgcrypt/libgcrypt_1.6.3.bb
@@ -0,0 +1,4 @@
+require libgcrypt.inc
+
+SRC_URI[md5sum] = "de03b867d02fdf115a1bac8bb8b5c3a3"
+SRC_URI[sha256sum] = "69e94e1a7084d94e1a6ca26d436068cb74862d10a7353cfae579a2d88674ff09"
diff --git a/meta/recipes-support/libgpg-error/libgpg-error/pkgconfig.patch b/meta/recipes-support/libgpg-error/libgpg-error/pkgconfig.patch
new file mode 100644
index 0000000..9ffeedb
--- /dev/null
+++ b/meta/recipes-support/libgpg-error/libgpg-error/pkgconfig.patch
@@ -0,0 +1,150 @@
+
+#
+# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher
+#
+
+Upstream-Status: Pending
+
+Index: libgpg-error-1.17/configure.ac
+===================================================================
+--- libgpg-error-1.17.orig/configure.ac
++++ libgpg-error-1.17/configure.ac
+@@ -529,6 +529,7 @@ AC_CONFIG_FILES([src/Makefile tests/Make
+ AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpg-error.asd])
+ AC_CONFIG_FILES([src/versioninfo.rc src/gpg-error.w32-manifest])
+ AC_CONFIG_FILES([src/gpg-error-config], [chmod +x src/gpg-error-config])
++AC_CONFIG_FILES([src/gpg-error.pc])
+ 
+ AC_OUTPUT
+ 
+Index: libgpg-error-1.17/src/Makefile.am
+===================================================================
+--- libgpg-error-1.17.orig/src/Makefile.am
++++ libgpg-error-1.17/src/Makefile.am
+@@ -75,6 +75,8 @@ nodist_include_HEADERS = gpg-error.h
+ bin_SCRIPTS = gpg-error-config
+ m4datadir = $(datadir)/aclocal
+ m4data_DATA = gpg-error.m4
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = gpg-error.pc
+ 
+ EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \
+ 	mkerrnos.awk errnos.in README \
+@@ -82,7 +84,7 @@ EXTRA_DIST = mkstrtable.awk err-sources.
+ 	mkheader.c gpg-error.h.in mkw32errmap.c w32-add.h w32ce-add.h \
+ 	err-sources.h err-codes.h gpg-error-config.in gpg-error.m4 \
+ 	gpg-error.vers gpg-error.def.in \
+-        versioninfo.rc.in gpg-error.w32-manifest.in \
++        versioninfo.rc.in gpg-error.w32-manifest.in gpg-error.pc \
+ 	$(lock_obj_pub)
+ 
+ BUILT_SOURCES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \
+Index: libgpg-error-1.17/src/gpg-error.m4
+===================================================================
+--- libgpg-error-1.17.orig/src/gpg-error.m4
++++ libgpg-error-1.17/src/gpg-error.m4
+@@ -26,73 +26,13 @@ dnl is added to the gpg_config_script_wa
+ dnl
+ AC_DEFUN([AM_PATH_GPG_ERROR],
+ [ AC_REQUIRE([AC_CANONICAL_HOST])
+-  gpg_error_config_prefix=""
+-  dnl --with-libgpg-error-prefix=PFX is the preferred name for this option,
+-  dnl since that is consistent with how our three siblings use the directory/
+-  dnl package name in --with-$dir_name-prefix=PFX.
+-  AC_ARG_WITH(libgpg-error-prefix,
+-              AC_HELP_STRING([--with-libgpg-error-prefix=PFX],
+-                             [prefix where GPG Error is installed (optional)]),
+-              [gpg_error_config_prefix="$withval"])
+-
+-  dnl Accept --with-gpg-error-prefix and make it work the same as
+-  dnl --with-libgpg-error-prefix above, for backwards compatibility,
+-  dnl but do not document this old, inconsistently-named option.
+-  AC_ARG_WITH(gpg-error-prefix,,
+-              [gpg_error_config_prefix="$withval"])
++  min_gpg_error_version=ifelse([$1], ,0.0,$1)
+ 
+-  if test x"${GPG_ERROR_CONFIG}" = x ; then
+-     if test x"${gpg_error_config_prefix}" != x ; then
+-        GPG_ERROR_CONFIG="${gpg_error_config_prefix}/bin/gpg-error-config"
+-     else
+-       case "${SYSROOT}" in
+-         /*)
+-           if test -x "${SYSROOT}/bin/gpg-error-config" ; then
+-             GPG_ERROR_CONFIG="${SYSROOT}/bin/gpg-error-config"
+-           fi
+-           ;;
+-         '')
+-           ;;
+-          *)
+-           AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.])
+-           ;;
+-       esac
+-     fi
+-  fi
++  PKG_CHECK_MODULES(GPG_ERROR, [gpg-error >= $min_gpg_error_version], [ok=yes], [ok=no])
+ 
+-  AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no)
+-  min_gpg_error_version=ifelse([$1], ,0.0,$1)
+-  AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version)
+-  ok=no
+-  if test "$GPG_ERROR_CONFIG" != "no" \
+-     && test -f "$GPG_ERROR_CONFIG" ; then
+-    req_major=`echo $min_gpg_error_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+-    req_minor=`echo $min_gpg_error_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+-    gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version`
+-    major=`echo $gpg_error_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+-    minor=`echo $gpg_error_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+-    if test "$major" -gt "$req_major"; then
+-        ok=yes
+-    else
+-        if test "$major" -eq "$req_major"; then
+-            if test "$minor" -ge "$req_minor"; then
+-               ok=yes
+-            fi
+-        fi
+-    fi
+-  fi
+   if test $ok = yes; then
+-    GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags`
+-    GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs`
+-    GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null`
+-    GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null`
+-    AC_MSG_RESULT([yes ($gpg_error_config_version)])
+     ifelse([$2], , :, [$2])
+-    gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none`
++    gpg_error_config_host=`$PKG_CONFIG --variable=host gpg-error`
+     if test x"$gpg_error_config_host" != xnone ; then
+       if test x"$gpg_error_config_host" != x"$host" ; then
+   AC_MSG_WARN([[
+@@ -107,11 +47,6 @@ AC_DEFUN([AM_PATH_GPG_ERROR],
+       fi
+     fi
+   else
+-    GPG_ERROR_CFLAGS=""
+-    GPG_ERROR_LIBS=""
+-    GPG_ERROR_MT_CFLAGS=""
+-    GPG_ERROR_MT_LIBS=""
+-    AC_MSG_RESULT(no)
+     ifelse([$3], , :, [$3])
+   fi
+   AC_SUBST(GPG_ERROR_CFLAGS)
+Index: libgpg-error-1.17/src/gpg-error.pc.in
+===================================================================
+--- /dev/null
++++ libgpg-error-1.17/src/gpg-error.pc.in
+@@ -0,0 +1,11 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++host=@GPG_ERROR_CONFIG_HOST@
++
++Name: gpg-error
++Description: a library that defines common error values for all GnuPG components
++Version: @VERSION@
++Libs: -L${libdir} -lgpg-error
++Cflags: -I${includedir}
diff --git a/meta/recipes-support/libgpg-error/libgpg-error_1.19.bb b/meta/recipes-support/libgpg-error/libgpg-error_1.19.bb
new file mode 100644
index 0000000..39dbbcf
--- /dev/null
+++ b/meta/recipes-support/libgpg-error/libgpg-error_1.19.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Small library that defines common error values for all GnuPG components"
+HOMEPAGE = "http://www.gnupg.org/related_software/libgpg-error/"
+BUGTRACKER = "https://bugs.g10code.com/gnupg/index"
+
+LICENSE = "GPLv2+ & LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
+                    file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://src/gpg-error.h.in;endline=23;md5=8b204918f0ca707136394d8bb20c7ebc \
+                    file://src/init.c;endline=20;md5=8f5a9b59634f4aebcd0ec9d3ebd53bfe"
+
+
+SECTION = "libs"
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-${PV}.tar.bz2 \
+           file://pkgconfig.patch"
+SRC_URI[md5sum] = "c04c16245b92829281f43b5bef7d16da"
+SRC_URI[sha256sum] = "53120e1333d5c5d28d87ff2854e9e98719c8e214152f17ad5291704d25c4978b"
+
+BINCONFIG = "${bindir}/gpg-error-config"
+
+inherit autotools binconfig-disabled pkgconfig gettext
+CPPFLAGS += "-P"
+do_compile_prepend() {
+	TARGET_FILE=linux-gnu
+	if [ ${TARGET_OS} != "linux" ]; then
+		TARGET_FILE=${TARGET_OS}
+	fi
+
+	case ${TARGET_ARCH} in
+	  aarch64_be) TUPLE=aarch64-unknown-linux-gnu ;;
+	  arm)	      TUPLE=arm-unknown-linux-gnueabi ;;
+	  armeb)      TUPLE=arm-unknown-linux-gnueabi ;;
+	  i586|i686)  TUPLE=i686-pc-linux-gnu ;;
+	  mips64el)   TUPLE=mipsel-unknown-linux-gnu ;;
+	  mips64)     TUPLE=mips-unknown-linux-gnu ;;
+	  x86_64)     TUPLE=x86_64-pc-linux-gnu ;;
+	  *)          TUPLE=${TARGET_ARCH}-unknown-linux-gnu ;; 
+	esac
+
+	cp ${S}/src/syscfg/lock-obj-pub.$TUPLE.h \
+	  ${S}/src/syscfg/lock-obj-pub.$TARGET_FILE.h
+}
+
+do_install_append() {
+	# we don't have common lisp in OE
+	rm -rf "${D}${datadir}/common-lisp/"
+}
+
+FILES_${PN}-dev += "${bindir}/gpg-error"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/libical/libical_1.0.0.bb b/meta/recipes-support/libical/libical_1.0.0.bb
new file mode 100644
index 0000000..be6b635
--- /dev/null
+++ b/meta/recipes-support/libical/libical_1.0.0.bb
@@ -0,0 +1,13 @@
+SUMMARY = "iCal and scheduling (RFC 2445, 2446, 2447) library"
+HOMEPAGE = "https://github.com/libical/libical"
+BUGTRACKER = "https://github.com/libical/libical/issues"
+LICENSE = "LGPLv2.1 | MPL-1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d4fc58309d8ed46587ac63bb449d82f8 \
+                    file://LICENSE;md5=d1a0891cd3e582b3e2ec8fe63badbbb6"
+SECTION = "libs"
+
+SRC_URI = "https://github.com/${BPN}/${BPN}/archive/v${PV}.tar.gz"
+SRC_URI[md5sum] = "f4b8e33ae5efb2f025eb43ce69682a36"
+SRC_URI[sha256sum] = "0072e83834092315772e6719b85fc8b11530b1ff53f4d108315fb38cddbce8c2"
+
+inherit autotools
diff --git a/meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch b/meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch
new file mode 100644
index 0000000..3cbf549
--- /dev/null
+++ b/meta/recipes-support/libiconv/libiconv-1.11.1/autoconf.patch
@@ -0,0 +1,50 @@
+It adds the variables that are needed
+for autoconf 2.65 to reconfigure libiconv and defines the m4 macros 
+directory. Its imported from OE.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libiconv-1.11.1/configure.ac
+===================================================================
+--- libiconv-1.11.1.orig/configure.ac
++++ libiconv-1.11.1/configure.ac
+@@ -23,7 +23,7 @@ AC_CONFIG_AUX_DIR(build-aux)
+ AM_INIT_AUTOMAKE(libiconv, 1.11)
+ AC_CONFIG_HEADERS(config.h lib/config.h)
+ AC_PROG_MAKE_SET
+-
++AC_CONFIG_MACRO_DIR([m4])
+ dnl           checks for basic programs
+ 
+ AC_PROG_CC
+Index: libiconv-1.11.1/libcharset/configure.ac
+===================================================================
+--- libiconv-1.11.1.orig/libcharset/configure.ac
++++ libiconv-1.11.1/libcharset/configure.ac
+@@ -16,17 +16,17 @@ dnl along with the GNU CHARSET Library;
+ dnl write to the Free Software Foundation, Inc., 51 Franklin Street,
+ dnl Fifth Floor, Boston, MA 02110-1301, USA.
+ 
+-AC_PREREQ(2.13)
++AC_PREREQ(2.61)
++AC_INIT([libcharset],[1.4] )
++AC_CONFIG_SRCDIR([lib/localcharset.c])
+ 
+-PACKAGE=libcharset
+-VERSION=1.4
+-
+-AC_INIT(lib/localcharset.c)
+ AC_CONFIG_AUX_DIR(build-aux)
+ AC_CONFIG_HEADER(config.h)
+ AC_PROG_MAKE_SET
+-AC_SUBST(PACKAGE)
+-AC_SUBST(VERSION)
++dnl AC_SUBST(PACKAGE)
++dnl AC_SUBST(VERSION)
++
++AC_CONFIG_MACRO_DIR([m4])
+ 
+ dnl           checks for basic programs
+ 
diff --git a/meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch b/meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch
new file mode 100644
index 0000000..fb07f73
--- /dev/null
+++ b/meta/recipes-support/libiconv/libiconv-1.11.1/shared_preloadable_libiconv_linux.patch
@@ -0,0 +1,26 @@
+With libtool generating shared and static version of libraries needs -fPIC flags
+without this it will not generate the commands to create shared linked library
+Its more enforced by libtool 2.4. I have not checked it with older libtool
+libiconv 1.11.x is relatively old release and libtool 2.4 did not exist when it
+was released these kind of problem are more likely
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libiconv-1.11.1/lib/Makefile.in
+===================================================================
+--- libiconv-1.11.1.orig/lib/Makefile.in
++++ libiconv-1.11.1/lib/Makefile.in
+@@ -70,9 +70,9 @@ preloadable_libiconv.so : preloadable_li
+ 
+ preloadable_libiconv_linux.so : $(SOURCES)
+ 	if test -n "@GCC@"; then \
+-	  $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -fPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -shared -o preloadable_libiconv_linux.so; \
++	  $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -fPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -rpath $(libdir) -o libpreload_iconv.la && cp .libs/libpreload_iconv.so preloadable_libiconv_linux.so; \
+ 	else \
+-	  $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -KPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -shared -o preloadable_libiconv_linux.so; \
++	  $(LIBTOOL_LINK) $(CC) $(LDFLAGS) $(INCLUDES) $(CFLAGS) $(CPPFLAGS) $(DEFS) -KPIC -DPIC -DLIBICONV_PLUG $(SOURCES) -rpath $(libdir) -o libpreload_iconv.la && cp .libs/libpreload_iconv.so preloadable_libiconv_linux.so; \
+ 	fi
+ 
+ preloadable_libiconv_solaris.so : $(SOURCES)
diff --git a/meta/recipes-support/libiconv/libiconv-1.14/add-relocatable-module.patch b/meta/recipes-support/libiconv/libiconv-1.14/add-relocatable-module.patch
new file mode 100644
index 0000000..6af377b
--- /dev/null
+++ b/meta/recipes-support/libiconv/libiconv-1.14/add-relocatable-module.patch
@@ -0,0 +1,5008 @@
+This patch is needed to solve issues like
+| iconv.o: In function `main':
+| /home/james/stuff/beagle/tmp-eglibc/work/armv7a-vfp-neon-oe-linux-gnueabi/libiconv-1.14-r0/libiconv-1.14/src/./iconv.c:861: undefined reference to `relocate'
+| ../srclib/libicrt.a(progreloc.o): In function `prepare_relocate':
+| /home/james/stuff/beagle/tmp-eglibc/work/armv7a-vfp-neon-oe-linux-gnueabi/libiconv-1.14-r0/libiconv-1.14/srclib/progreloc.c:297: undefined reference to `compute_curr_prefix'
+| /home/james/stuff/beagle/tmp-eglibc/work/armv7a-vfp-neon-oe-linux-gnueabi/libiconv-1.14-r0/libiconv-1.14/srclib/progreloc.c:302: undefined reference to `set_relocation_prefix'
+| collect2: ld returned 1 exit status
+| make[1]: *** [install] Error 1
+
+Upstream-Status: Inappropriate [OE config specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+diff -Naurp libiconv-1.14.org//build-aux/arg-nonnull.h libiconv-1.14/build-aux/arg-nonnull.h
+--- libiconv-1.14.org//build-aux/arg-nonnull.h	1969-12-31 16:00:00.000000000 -0800
++++ libiconv-1.14/build-aux/arg-nonnull.h	2012-01-08 02:07:39.930484438 -0800
+@@ -0,0 +1,26 @@
++/* A C macro for declaring that specific arguments must not be NULL.
++   Copyright (C) 2009-2011 Free Software Foundation, Inc.
++
++   This program is free software: you can redistribute it and/or modify it
++   under the terms of the GNU General Public License as published
++   by the Free Software Foundation; either version 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/>.  */
++
++/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
++   that the values passed as arguments n, ..., m must be non-NULL pointers.
++   n = 1 stands for the first argument, n = 2 for the second argument etc.  */
++#ifndef _GL_ARG_NONNULL
++# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
++#  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
++# else
++#  define _GL_ARG_NONNULL(params)
++# endif
++#endif
+diff -Naurp libiconv-1.14.org//build-aux/c++defs.h libiconv-1.14/build-aux/c++defs.h
+--- libiconv-1.14.org//build-aux/c++defs.h	1969-12-31 16:00:00.000000000 -0800
++++ libiconv-1.14/build-aux/c++defs.h	2012-01-08 02:07:39.942484438 -0800
+@@ -0,0 +1,271 @@
++/* C++ compatible function declaration macros.
++   Copyright (C) 2010-2011 Free Software Foundation, Inc.
++
++   This program is free software: you can redistribute it and/or modify it
++   under the terms of the GNU General Public License as published
++   by the Free Software Foundation; either version 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/>.  */
++
++#ifndef _GL_CXXDEFS_H
++#define _GL_CXXDEFS_H
++
++/* The three most frequent use cases of these macros are:
++
++   * For providing a substitute for a function that is missing on some
++     platforms, but is declared and works fine on the platforms on which
++     it exists:
++
++       #if @GNULIB_FOO@
++       # if !@HAVE_FOO@
++       _GL_FUNCDECL_SYS (foo, ...);
++       # endif
++       _GL_CXXALIAS_SYS (foo, ...);
++       _GL_CXXALIASWARN (foo);
++       #elif defined GNULIB_POSIXCHECK
++       ...
++       #endif
++
++   * For providing a replacement for a function that exists on all platforms,
++     but is broken/insufficient and needs to be replaced on some platforms:
++
++       #if @GNULIB_FOO@
++       # if @REPLACE_FOO@
++       #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
++       #   undef foo
++       #   define foo rpl_foo
++       #  endif
++       _GL_FUNCDECL_RPL (foo, ...);
++       _GL_CXXALIAS_RPL (foo, ...);
++       # else
++       _GL_CXXALIAS_SYS (foo, ...);
++       # endif
++       _GL_CXXALIASWARN (foo);
++       #elif defined GNULIB_POSIXCHECK
++       ...
++       #endif
++
++   * For providing a replacement for a function that exists on some platforms
++     but is broken/insufficient and needs to be replaced on some of them and
++     is additionally either missing or undeclared on some other platforms:
++
++       #if @GNULIB_FOO@
++       # if @REPLACE_FOO@
++       #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
++       #   undef foo
++       #   define foo rpl_foo
++       #  endif
++       _GL_FUNCDECL_RPL (foo, ...);
++       _GL_CXXALIAS_RPL (foo, ...);
++       # else
++       #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
++       _GL_FUNCDECL_SYS (foo, ...);
++       #  endif
++       _GL_CXXALIAS_SYS (foo, ...);
++       # endif
++       _GL_CXXALIASWARN (foo);
++       #elif defined GNULIB_POSIXCHECK
++       ...
++       #endif
++*/
++
++/* _GL_EXTERN_C declaration;
++   performs the declaration with C linkage.  */
++#if defined __cplusplus
++# define _GL_EXTERN_C extern "C"
++#else
++# define _GL_EXTERN_C extern
++#endif
++
++/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
++   declares a replacement function, named rpl_func, with the given prototype,
++   consisting of return type, parameters, and attributes.
++   Example:
++     _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
++                                  _GL_ARG_NONNULL ((1)));
++ */
++#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
++  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
++#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
++  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
++
++/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
++   declares the system function, named func, with the given prototype,
++   consisting of return type, parameters, and attributes.
++   Example:
++     _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
++                                  _GL_ARG_NONNULL ((1)));
++ */
++#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
++  _GL_EXTERN_C rettype func parameters_and_attributes
++
++/* _GL_CXXALIAS_RPL (func, rettype, parameters);
++   declares a C++ alias called GNULIB_NAMESPACE::func
++   that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
++   Example:
++     _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
++ */
++#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
++  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
++    namespace GNULIB_NAMESPACE                                \
++    {                                                         \
++      rettype (*const func) parameters = ::rpl_func;          \
++    }                                                         \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#else
++# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
++   is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
++   except that the C function rpl_func may have a slightly different
++   declaration.  A cast is used to silence the "invalid conversion" error
++   that would otherwise occur.  */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
++    namespace GNULIB_NAMESPACE                                     \
++    {                                                              \
++      rettype (*const func) parameters =                           \
++        reinterpret_cast<rettype(*)parameters>(::rpl_func);        \
++    }                                                              \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#else
++# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIAS_SYS (func, rettype, parameters);
++   declares a C++ alias called GNULIB_NAMESPACE::func
++   that redirects to the system provided function func, if GNULIB_NAMESPACE
++   is defined.
++   Example:
++     _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
++ */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++  /* If we were to write
++       rettype (*const func) parameters = ::func;
++     like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
++     better (remove an indirection through a 'static' pointer variable),
++     but then the _GL_CXXALIASWARN macro below would cause a warning not only
++     for uses of ::func but also for uses of GNULIB_NAMESPACE::func.  */
++# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
++    namespace GNULIB_NAMESPACE                     \
++    {                                              \
++      static rettype (*func) parameters = ::func;  \
++    }                                              \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#else
++# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
++   is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
++   except that the C function func may have a slightly different declaration.
++   A cast is used to silence the "invalid conversion" error that would
++   otherwise occur.  */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
++    namespace GNULIB_NAMESPACE                          \
++    {                                                   \
++      static rettype (*func) parameters =               \
++        reinterpret_cast<rettype(*)parameters>(::func); \
++    }                                                   \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#else
++# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
++   is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
++   except that the C function is picked among a set of overloaded functions,
++   namely the one with rettype2 and parameters2.  Two consecutive casts
++   are used to silence the "cannot find a match" and "invalid conversion"
++   errors that would otherwise occur.  */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++  /* The outer cast must be a reinterpret_cast.
++     The inner cast: When the function is defined as a set of overloaded
++     functions, it works as a static_cast<>, choosing the designated variant.
++     When the function is defined as a single variant, it works as a
++     reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
++# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
++    namespace GNULIB_NAMESPACE                                                \
++    {                                                                         \
++      static rettype (*func) parameters =                                     \
++        reinterpret_cast<rettype(*)parameters>(                               \
++          (rettype2(*)parameters2)(::func));                                  \
++    }                                                                         \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#else
++# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIASWARN (func);
++   causes a warning to be emitted when ::func is used but not when
++   GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
++   variants.  */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++# define _GL_CXXALIASWARN(func) \
++   _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
++# define _GL_CXXALIASWARN_1(func,namespace) \
++   _GL_CXXALIASWARN_2 (func, namespace)
++/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
++   we enable the warning only when not optimizing.  */
++# if !__OPTIMIZE__
++#  define _GL_CXXALIASWARN_2(func,namespace) \
++    _GL_WARN_ON_USE (func, \
++                     "The symbol ::" #func " refers to the system function. " \
++                     "Use " #namespace "::" #func " instead.")
++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
++#  define _GL_CXXALIASWARN_2(func,namespace) \
++     extern __typeof__ (func) func
++# else
++#  define _GL_CXXALIASWARN_2(func,namespace) \
++     _GL_EXTERN_C int _gl_cxxalias_dummy
++# endif
++#else
++# define _GL_CXXALIASWARN(func) \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
++   causes a warning to be emitted when the given overloaded variant of ::func
++   is used but not when GNULIB_NAMESPACE::func is used.  */
++#if defined __cplusplus && defined GNULIB_NAMESPACE
++# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
++   _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
++                        GNULIB_NAMESPACE)
++# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
++   _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
++/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
++   we enable the warning only when not optimizing.  */
++# if !__OPTIMIZE__
++#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
++    _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
++                         "The symbol ::" #func " refers to the system function. " \
++                         "Use " #namespace "::" #func " instead.")
++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
++#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
++     extern __typeof__ (func) func
++# else
++#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
++     _GL_EXTERN_C int _gl_cxxalias_dummy
++# endif
++#else
++# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
++    _GL_EXTERN_C int _gl_cxxalias_dummy
++#endif
++
++#endif /* _GL_CXXDEFS_H */
+diff -Naurp libiconv-1.14.org//build-aux/snippet/arg-nonnull.h libiconv-1.14/build-aux/snippet/arg-nonnull.h
+--- libiconv-1.14.org//build-aux/snippet/arg-nonnull.h	2011-08-07 06:22:07.000000000 -0700
++++ libiconv-1.14/build-aux/snippet/arg-nonnull.h	1969-12-31 16:00:00.000000000 -0800
+@@ -1,26 +0,0 @@
+-/* A C macro for declaring that specific arguments must not be NULL.
+-   Copyright (C) 2009-2011 Free Software Foundation, Inc.
+-
+-   This program is free software: you can redistribute it and/or modify it
+-   under the terms of the GNU General Public License as published
+-   by the Free Software Foundation; either version 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/>.  */
+-
+-/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
+-   that the values passed as arguments n, ..., m must be non-NULL pointers.
+-   n = 1 stands for the first argument, n = 2 for the second argument etc.  */
+-#ifndef _GL_ARG_NONNULL
+-# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
+-#  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
+-# else
+-#  define _GL_ARG_NONNULL(params)
+-# endif
+-#endif
+diff -Naurp libiconv-1.14.org//build-aux/snippet/c++defs.h libiconv-1.14/build-aux/snippet/c++defs.h
+--- libiconv-1.14.org//build-aux/snippet/c++defs.h	2011-08-07 06:22:07.000000000 -0700
++++ libiconv-1.14/build-aux/snippet/c++defs.h	1969-12-31 16:00:00.000000000 -0800
+@@ -1,271 +0,0 @@
+-/* C++ compatible function declaration macros.
+-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+-
+-   This program is free software: you can redistribute it and/or modify it
+-   under the terms of the GNU General Public License as published
+-   by the Free Software Foundation; either version 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/>.  */
+-
+-#ifndef _GL_CXXDEFS_H
+-#define _GL_CXXDEFS_H
+-
+-/* The three most frequent use cases of these macros are:
+-
+-   * For providing a substitute for a function that is missing on some
+-     platforms, but is declared and works fine on the platforms on which
+-     it exists:
+-
+-       #if @GNULIB_FOO@
+-       # if !@HAVE_FOO@
+-       _GL_FUNCDECL_SYS (foo, ...);
+-       # endif
+-       _GL_CXXALIAS_SYS (foo, ...);
+-       _GL_CXXALIASWARN (foo);
+-       #elif defined GNULIB_POSIXCHECK
+-       ...
+-       #endif
+-
+-   * For providing a replacement for a function that exists on all platforms,
+-     but is broken/insufficient and needs to be replaced on some platforms:
+-
+-       #if @GNULIB_FOO@
+-       # if @REPLACE_FOO@
+-       #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-       #   undef foo
+-       #   define foo rpl_foo
+-       #  endif
+-       _GL_FUNCDECL_RPL (foo, ...);
+-       _GL_CXXALIAS_RPL (foo, ...);
+-       # else
+-       _GL_CXXALIAS_SYS (foo, ...);
+-       # endif
+-       _GL_CXXALIASWARN (foo);
+-       #elif defined GNULIB_POSIXCHECK
+-       ...
+-       #endif
+-
+-   * For providing a replacement for a function that exists on some platforms
+-     but is broken/insufficient and needs to be replaced on some of them and
+-     is additionally either missing or undeclared on some other platforms:
+-
+-       #if @GNULIB_FOO@
+-       # if @REPLACE_FOO@
+-       #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-       #   undef foo
+-       #   define foo rpl_foo
+-       #  endif
+-       _GL_FUNCDECL_RPL (foo, ...);
+-       _GL_CXXALIAS_RPL (foo, ...);
+-       # else
+-       #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
+-       _GL_FUNCDECL_SYS (foo, ...);
+-       #  endif
+-       _GL_CXXALIAS_SYS (foo, ...);
+-       # endif
+-       _GL_CXXALIASWARN (foo);
+-       #elif defined GNULIB_POSIXCHECK
+-       ...
+-       #endif
+-*/
+-
+-/* _GL_EXTERN_C declaration;
+-   performs the declaration with C linkage.  */
+-#if defined __cplusplus
+-# define _GL_EXTERN_C extern "C"
+-#else
+-# define _GL_EXTERN_C extern
+-#endif
+-
+-/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
+-   declares a replacement function, named rpl_func, with the given prototype,
+-   consisting of return type, parameters, and attributes.
+-   Example:
+-     _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+-                                  _GL_ARG_NONNULL ((1)));
+- */
+-#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
+-  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
+-#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
+-  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
+-
+-/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
+-   declares the system function, named func, with the given prototype,
+-   consisting of return type, parameters, and attributes.
+-   Example:
+-     _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
+-                                  _GL_ARG_NONNULL ((1)));
+- */
+-#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
+-  _GL_EXTERN_C rettype func parameters_and_attributes
+-
+-/* _GL_CXXALIAS_RPL (func, rettype, parameters);
+-   declares a C++ alias called GNULIB_NAMESPACE::func
+-   that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
+-   Example:
+-     _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+- */
+-#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
+-  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+-    namespace GNULIB_NAMESPACE                                \
+-    {                                                         \
+-      rettype (*const func) parameters = ::rpl_func;          \
+-    }                                                         \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#else
+-# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
+-   is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
+-   except that the C function rpl_func may have a slightly different
+-   declaration.  A cast is used to silence the "invalid conversion" error
+-   that would otherwise occur.  */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+-    namespace GNULIB_NAMESPACE                                     \
+-    {                                                              \
+-      rettype (*const func) parameters =                           \
+-        reinterpret_cast<rettype(*)parameters>(::rpl_func);        \
+-    }                                                              \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#else
+-# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIAS_SYS (func, rettype, parameters);
+-   declares a C++ alias called GNULIB_NAMESPACE::func
+-   that redirects to the system provided function func, if GNULIB_NAMESPACE
+-   is defined.
+-   Example:
+-     _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+- */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-  /* If we were to write
+-       rettype (*const func) parameters = ::func;
+-     like above in _GL_CXXALIAS_RPL_1, the compiler could optimize calls
+-     better (remove an indirection through a 'static' pointer variable),
+-     but then the _GL_CXXALIASWARN macro below would cause a warning not only
+-     for uses of ::func but also for uses of GNULIB_NAMESPACE::func.  */
+-# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+-    namespace GNULIB_NAMESPACE                     \
+-    {                                              \
+-      static rettype (*func) parameters = ::func;  \
+-    }                                              \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#else
+-# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
+-   is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
+-   except that the C function func may have a slightly different declaration.
+-   A cast is used to silence the "invalid conversion" error that would
+-   otherwise occur.  */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+-    namespace GNULIB_NAMESPACE                          \
+-    {                                                   \
+-      static rettype (*func) parameters =               \
+-        reinterpret_cast<rettype(*)parameters>(::func); \
+-    }                                                   \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#else
+-# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
+-   is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
+-   except that the C function is picked among a set of overloaded functions,
+-   namely the one with rettype2 and parameters2.  Two consecutive casts
+-   are used to silence the "cannot find a match" and "invalid conversion"
+-   errors that would otherwise occur.  */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-  /* The outer cast must be a reinterpret_cast.
+-     The inner cast: When the function is defined as a set of overloaded
+-     functions, it works as a static_cast<>, choosing the designated variant.
+-     When the function is defined as a single variant, it works as a
+-     reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
+-# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+-    namespace GNULIB_NAMESPACE                                                \
+-    {                                                                         \
+-      static rettype (*func) parameters =                                     \
+-        reinterpret_cast<rettype(*)parameters>(                               \
+-          (rettype2(*)parameters2)(::func));                                  \
+-    }                                                                         \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#else
+-# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIASWARN (func);
+-   causes a warning to be emitted when ::func is used but not when
+-   GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
+-   variants.  */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-# define _GL_CXXALIASWARN(func) \
+-   _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
+-# define _GL_CXXALIASWARN_1(func,namespace) \
+-   _GL_CXXALIASWARN_2 (func, namespace)
+-/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+-   we enable the warning only when not optimizing.  */
+-# if !__OPTIMIZE__
+-#  define _GL_CXXALIASWARN_2(func,namespace) \
+-    _GL_WARN_ON_USE (func, \
+-                     "The symbol ::" #func " refers to the system function. " \
+-                     "Use " #namespace "::" #func " instead.")
+-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+-#  define _GL_CXXALIASWARN_2(func,namespace) \
+-     extern __typeof__ (func) func
+-# else
+-#  define _GL_CXXALIASWARN_2(func,namespace) \
+-     _GL_EXTERN_C int _gl_cxxalias_dummy
+-# endif
+-#else
+-# define _GL_CXXALIASWARN(func) \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
+-   causes a warning to be emitted when the given overloaded variant of ::func
+-   is used but not when GNULIB_NAMESPACE::func is used.  */
+-#if defined __cplusplus && defined GNULIB_NAMESPACE
+-# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+-   _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
+-                        GNULIB_NAMESPACE)
+-# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
+-   _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
+-/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+-   we enable the warning only when not optimizing.  */
+-# if !__OPTIMIZE__
+-#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+-    _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
+-                         "The symbol ::" #func " refers to the system function. " \
+-                         "Use " #namespace "::" #func " instead.")
+-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+-#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+-     extern __typeof__ (func) func
+-# else
+-#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+-     _GL_EXTERN_C int _gl_cxxalias_dummy
+-# endif
+-#else
+-# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+-    _GL_EXTERN_C int _gl_cxxalias_dummy
+-#endif
+-
+-#endif /* _GL_CXXDEFS_H */
+diff -Naurp libiconv-1.14.org//build-aux/snippet/_Noreturn.h libiconv-1.14/build-aux/snippet/_Noreturn.h
+--- libiconv-1.14.org//build-aux/snippet/_Noreturn.h	2011-08-07 06:22:07.000000000 -0700
++++ libiconv-1.14/build-aux/snippet/_Noreturn.h	1969-12-31 16:00:00.000000000 -0800
+@@ -1,10 +0,0 @@
+-#ifndef _Noreturn
+-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+-      || 0x5110 <= __SUNPRO_C)
+-#  define _Noreturn __attribute__ ((__noreturn__))
+-# elif 1200 <= _MSC_VER
+-#  define _Noreturn __declspec (noreturn)
+-# else
+-#  define _Noreturn
+-# endif
+-#endif
+diff -Naurp libiconv-1.14.org//build-aux/snippet/warn-on-use.h libiconv-1.14/build-aux/snippet/warn-on-use.h
+--- libiconv-1.14.org//build-aux/snippet/warn-on-use.h	2011-08-07 06:22:07.000000000 -0700
++++ libiconv-1.14/build-aux/snippet/warn-on-use.h	1969-12-31 16:00:00.000000000 -0800
+@@ -1,109 +0,0 @@
+-/* A C macro for emitting warnings if a function is used.
+-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+-
+-   This program is free software: you can redistribute it and/or modify it
+-   under the terms of the GNU General Public License as published
+-   by the Free Software Foundation; either version 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/>.  */
+-
+-/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
+-   for FUNCTION which will then trigger a compiler warning containing
+-   the text of "literal string" anywhere that function is called, if
+-   supported by the compiler.  If the compiler does not support this
+-   feature, the macro expands to an unused extern declaration.
+-
+-   This macro is useful for marking a function as a potential
+-   portability trap, with the intent that "literal string" include
+-   instructions on the replacement function that should be used
+-   instead.  However, one of the reasons that a function is a
+-   portability trap is if it has the wrong signature.  Declaring
+-   FUNCTION with a different signature in C is a compilation error, so
+-   this macro must use the same type as any existing declaration so
+-   that programs that avoid the problematic FUNCTION do not fail to
+-   compile merely because they included a header that poisoned the
+-   function.  But this implies that _GL_WARN_ON_USE is only safe to
+-   use if FUNCTION is known to already have a declaration.  Use of
+-   this macro implies that there must not be any other macro hiding
+-   the declaration of FUNCTION; but undefining FUNCTION first is part
+-   of the poisoning process anyway (although for symbols that are
+-   provided only via a macro, the result is a compilation error rather
+-   than a warning containing "literal string").  Also note that in
+-   C++, it is only safe to use if FUNCTION has no overloads.
+-
+-   For an example, it is possible to poison 'getline' by:
+-   - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
+-     [getline]) in configure.ac, which potentially defines
+-     HAVE_RAW_DECL_GETLINE
+-   - adding this code to a header that wraps the system <stdio.h>:
+-     #undef getline
+-     #if HAVE_RAW_DECL_GETLINE
+-     _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
+-       "not universally present; use the gnulib module getline");
+-     #endif
+-
+-   It is not possible to directly poison global variables.  But it is
+-   possible to write a wrapper accessor function, and poison that
+-   (less common usage, like &environ, will cause a compilation error
+-   rather than issue the nice warning, but the end result of informing
+-   the developer about their portability problem is still achieved):
+-   #if HAVE_RAW_DECL_ENVIRON
+-   static inline char ***rpl_environ (void) { return &environ; }
+-   _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
+-   # undef environ
+-   # define environ (*rpl_environ ())
+-   #endif
+-   */
+-#ifndef _GL_WARN_ON_USE
+-
+-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+-/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
+-#  define _GL_WARN_ON_USE(function, message) \
+-extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
+-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+-/* Verify the existence of the function.  */
+-#  define _GL_WARN_ON_USE(function, message) \
+-extern __typeof__ (function) function
+-# else /* Unsupported.  */
+-#  define _GL_WARN_ON_USE(function, message) \
+-_GL_WARN_EXTERN_C int _gl_warn_on_use
+-# endif
+-#endif
+-
+-/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
+-   is like _GL_WARN_ON_USE (function, "string"), except that the function is
+-   declared with the given prototype, consisting of return type, parameters,
+-   and attributes.
+-   This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
+-   not work in this case.  */
+-#ifndef _GL_WARN_ON_USE_CXX
+-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+-#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+-extern rettype function parameters_and_attributes \
+-     __attribute__ ((__warning__ (msg)))
+-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+-/* Verify the existence of the function.  */
+-#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+-extern rettype function parameters_and_attributes
+-# else /* Unsupported.  */
+-#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+-_GL_WARN_EXTERN_C int _gl_warn_on_use
+-# endif
+-#endif
+-
+-/* _GL_WARN_EXTERN_C declaration;
+-   performs the declaration with C linkage.  */
+-#ifndef _GL_WARN_EXTERN_C
+-# if defined __cplusplus
+-#  define _GL_WARN_EXTERN_C extern "C"
+-# else
+-#  define _GL_WARN_EXTERN_C extern
+-# endif
+-#endif
+diff -Naurp libiconv-1.14.org//build-aux/warn-on-use.h libiconv-1.14/build-aux/warn-on-use.h
+--- libiconv-1.14.org//build-aux/warn-on-use.h	1969-12-31 16:00:00.000000000 -0800
++++ libiconv-1.14/build-aux/warn-on-use.h	2012-01-08 02:07:39.950484439 -0800
+@@ -0,0 +1,109 @@
++/* A C macro for emitting warnings if a function is used.
++   Copyright (C) 2010-2011 Free Software Foundation, Inc.
++
++   This program is free software: you can redistribute it and/or modify it
++   under the terms of the GNU General Public License as published
++   by the Free Software Foundation; either version 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/>.  */
++
++/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
++   for FUNCTION which will then trigger a compiler warning containing
++   the text of "literal string" anywhere that function is called, if
++   supported by the compiler.  If the compiler does not support this
++   feature, the macro expands to an unused extern declaration.
++
++   This macro is useful for marking a function as a potential
++   portability trap, with the intent that "literal string" include
++   instructions on the replacement function that should be used
++   instead.  However, one of the reasons that a function is a
++   portability trap is if it has the wrong signature.  Declaring
++   FUNCTION with a different signature in C is a compilation error, so
++   this macro must use the same type as any existing declaration so
++   that programs that avoid the problematic FUNCTION do not fail to
++   compile merely because they included a header that poisoned the
++   function.  But this implies that _GL_WARN_ON_USE is only safe to
++   use if FUNCTION is known to already have a declaration.  Use of
++   this macro implies that there must not be any other macro hiding
++   the declaration of FUNCTION; but undefining FUNCTION first is part
++   of the poisoning process anyway (although for symbols that are
++   provided only via a macro, the result is a compilation error rather
++   than a warning containing "literal string").  Also note that in
++   C++, it is only safe to use if FUNCTION has no overloads.
++
++   For an example, it is possible to poison 'getline' by:
++   - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
++     [getline]) in configure.ac, which potentially defines
++     HAVE_RAW_DECL_GETLINE
++   - adding this code to a header that wraps the system <stdio.h>:
++     #undef getline
++     #if HAVE_RAW_DECL_GETLINE
++     _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
++       "not universally present; use the gnulib module getline");
++     #endif
++
++   It is not possible to directly poison global variables.  But it is
++   possible to write a wrapper accessor function, and poison that
++   (less common usage, like &environ, will cause a compilation error
++   rather than issue the nice warning, but the end result of informing
++   the developer about their portability problem is still achieved):
++   #if HAVE_RAW_DECL_ENVIRON
++   static inline char ***rpl_environ (void) { return &environ; }
++   _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
++   # undef environ
++   # define environ (*rpl_environ ())
++   #endif
++   */
++#ifndef _GL_WARN_ON_USE
++
++# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
++/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
++#  define _GL_WARN_ON_USE(function, message) \
++extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
++/* Verify the existence of the function.  */
++#  define _GL_WARN_ON_USE(function, message) \
++extern __typeof__ (function) function
++# else /* Unsupported.  */
++#  define _GL_WARN_ON_USE(function, message) \
++_GL_WARN_EXTERN_C int _gl_warn_on_use
++# endif
++#endif
++
++/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
++   is like _GL_WARN_ON_USE (function, "string"), except that the function is
++   declared with the given prototype, consisting of return type, parameters,
++   and attributes.
++   This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
++   not work in this case.  */
++#ifndef _GL_WARN_ON_USE_CXX
++# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
++#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
++extern rettype function parameters_and_attributes \
++     __attribute__ ((__warning__ (msg)))
++# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
++/* Verify the existence of the function.  */
++#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
++extern rettype function parameters_and_attributes
++# else /* Unsupported.  */
++#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
++_GL_WARN_EXTERN_C int _gl_warn_on_use
++# endif
++#endif
++
++/* _GL_WARN_EXTERN_C declaration;
++   performs the declaration with C linkage.  */
++#ifndef _GL_WARN_EXTERN_C
++# if defined __cplusplus
++#  define _GL_WARN_EXTERN_C extern "C"
++# else
++#  define _GL_WARN_EXTERN_C extern
++# endif
++#endif
+diff -Naurp libiconv-1.14.org//srclib/allocator.h libiconv-1.14/srclib/allocator.h
+--- libiconv-1.14.org//srclib/allocator.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/allocator.h	2012-01-08 02:07:40.050484444 -0800
+@@ -45,11 +45,10 @@ struct allocator
+   /* Call FREE to free memory, like 'free'.  */
+   void (*free) (void *);
+ 
+-  /* If nonnull, call DIE (SIZE) if MALLOC (SIZE) or REALLOC (...,
+-     SIZE) fails.  DIE should not return.  SIZE should equal SIZE_MAX
+-     if size_t overflow was detected while calculating sizes to be
+-     passed to MALLOC or REALLOC.  */
+-  void (*die) (size_t);
++  /* If nonnull, call DIE if MALLOC or REALLOC fails.  DIE should not
++     return.  DIE can be used by code that detects memory overflow
++     while calculating sizes to be passed to MALLOC or REALLOC.  */
++  void (*die) (void);
+ };
+ 
+ /* An allocator using the stdlib functions and a null DIE function.  */
+diff -Naurp libiconv-1.14.org//srclib/canonicalize-lgpl.c libiconv-1.14/srclib/canonicalize-lgpl.c
+--- libiconv-1.14.org//srclib/canonicalize-lgpl.c	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/canonicalize-lgpl.c	2012-01-08 02:07:40.094484446 -0800
+@@ -125,7 +125,7 @@ __realpath (const char *name, char *reso
+ #else
+   path_max = pathconf (name, _PC_PATH_MAX);
+   if (path_max <= 0)
+-    path_max = 8192;
++    path_max = 1024;
+ #endif
+ 
+   if (resolved == NULL)
+diff -Naurp libiconv-1.14.org//srclib/careadlinkat.c libiconv-1.14/srclib/careadlinkat.c
+--- libiconv-1.14.org//srclib/careadlinkat.c	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/careadlinkat.c	2012-01-08 02:07:40.102484445 -0800
+@@ -133,7 +133,6 @@ careadlinkat (int fd, char const *filena
+           if (buf == stack_buf)
+             {
+               char *b = (char *) alloc->allocate (link_size);
+-              buf_size = link_size;
+               if (! b)
+                 break;
+               memcpy (b, buf, link_size);
+@@ -157,11 +156,6 @@ careadlinkat (int fd, char const *filena
+         buf_size *= 2;
+       else if (buf_size < buf_size_max)
+         buf_size = buf_size_max;
+-      else if (buf_size_max < SIZE_MAX)
+-        {
+-          errno = ENAMETOOLONG;
+-          return NULL;
+-        }
+       else
+         break;
+       buf = (char *) alloc->allocate (buf_size);
+@@ -169,7 +163,7 @@ careadlinkat (int fd, char const *filena
+   while (buf);
+ 
+   if (alloc->die)
+-    alloc->die (buf_size);
++    alloc->die ();
+   errno = ENOMEM;
+   return NULL;
+ }
+diff -Naurp libiconv-1.14.org//srclib/errno.in.h libiconv-1.14/srclib/errno.in.h
+--- libiconv-1.14.org//srclib/errno.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/errno.in.h	2012-01-08 02:07:40.122484446 -0800
+@@ -16,7 +16,7 @@
+    along with this program; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+ 
+-#ifndef _@GUARD_PREFIX@_ERRNO_H
++#ifndef _GL_ERRNO_H
+ 
+ #if __GNUC__ >= 3
+ @PRAGMA_SYSTEM_HEADER@
+@@ -26,8 +26,8 @@
+ /* The include_next requires a split double-inclusion guard.  */
+ #@INCLUDE_NEXT@ @NEXT_ERRNO_H@
+ 
+-#ifndef _@GUARD_PREFIX@_ERRNO_H
+-#define _@GUARD_PREFIX@_ERRNO_H
++#ifndef _GL_ERRNO_H
++#define _GL_ERRNO_H
+ 
+ 
+ /* On native Windows platforms, many macros are not defined.  */
+@@ -147,16 +147,6 @@
+ #  define GNULIB_defined_ENOTSUP 1
+ # endif
+ 
+-# ifndef ENETRESET
+-#  define ENETRESET 2011
+-#  define GNULIB_defined_ENETRESET 1
+-# endif
+-
+-# ifndef ECONNABORTED
+-#  define ECONNABORTED 2012
+-#  define GNULIB_defined_ECONNABORTED 1
+-# endif
+-
+ # ifndef ESTALE
+ #  define ESTALE    2009
+ #  define GNULIB_defined_ESTALE 1
+@@ -173,5 +163,5 @@
+ # endif
+ 
+ 
+-#endif /* _@GUARD_PREFIX@_ERRNO_H */
+-#endif /* _@GUARD_PREFIX@_ERRNO_H */
++#endif /* _GL_ERRNO_H */
++#endif /* _GL_ERRNO_H */
+diff -Naurp libiconv-1.14.org//srclib/error.c libiconv-1.14/srclib/error.c
+--- libiconv-1.14.org//srclib/error.c	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/error.c	2012-01-08 02:07:40.134484448 -0800
+@@ -97,15 +97,11 @@ extern void __error_at_line (int status,
+ /* The gnulib override of fcntl is not needed in this file.  */
+ # undef fcntl
+ 
+-# if !HAVE_DECL_STRERROR_R
++# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
+ #  ifndef HAVE_DECL_STRERROR_R
+ "this configure-time declaration test was not run"
+ #  endif
+-#  if STRERROR_R_CHAR_P
+ char *strerror_r ();
+-#  else
+-int strerror_r ();
+-#  endif
+ # endif
+ 
+ /* The calling program should define program_name and set it to the
+diff -Naurp libiconv-1.14.org//srclib/fcntl.in.h libiconv-1.14/srclib/fcntl.in.h
+--- libiconv-1.14.org//srclib/fcntl.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/fcntl.in.h	2012-01-08 02:07:40.154484449 -0800
+@@ -40,7 +40,7 @@
+ #else
+ /* Normal invocation convention.  */
+ 
+-#ifndef _@GUARD_PREFIX@_FCNTL_H
++#ifndef _GL_FCNTL_H
+ 
+ #include <sys/types.h>
+ /* On some systems other than glibc, <sys/stat.h> is a prerequisite of
+@@ -55,8 +55,8 @@
+ /* The include_next requires a split double-inclusion guard.  */
+ #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
+ 
+-#ifndef _@GUARD_PREFIX@_FCNTL_H
+-#define _@GUARD_PREFIX@_FCNTL_H
++#ifndef _GL_FCNTL_H
++#define _GL_FCNTL_H
+ 
+ #ifndef __GLIBC__ /* Avoid namespace pollution on glibc systems.  */
+ # include <unistd.h>
+@@ -320,6 +320,6 @@ _GL_WARN_ON_USE (openat, "openat is not
+ #endif
+ 
+ 
+-#endif /* _@GUARD_PREFIX@_FCNTL_H */
+-#endif /* _@GUARD_PREFIX@_FCNTL_H */
++#endif /* _GL_FCNTL_H */
++#endif /* _GL_FCNTL_H */
+ #endif
+diff -Naurp libiconv-1.14.org//srclib/intprops.h libiconv-1.14/srclib/intprops.h
+--- libiconv-1.14.org//srclib/intprops.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/intprops.h	2012-01-08 02:07:40.174484450 -0800
+@@ -22,13 +22,14 @@
+ 
+ #include <limits.h>
+ 
+-/* Return an integer value, converted to the same type as the integer
+-   expression E after integer type promotion.  V is the unconverted value.  */
+-#define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
++/* Return a integer value, converted to the same type as the integer
++   expression E after integer type promotion.  V is the unconverted value.
++   E should not have side effects.  */
++#define _GL_INT_CONVERT(e, v) ((e) - (e) + (v))
+ 
+ /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
+    <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>.  */
+-#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
++#define _GL_INT_NEGATE_CONVERT(e, v) ((e) - (e) - (v))
+ 
+ /* The extra casts in the following macros work around compiler bugs,
+    e.g., in Cray C 5.0.3.0.  */
+@@ -52,7 +53,7 @@
+ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+ 
+ /* Return 1 if the integer expression E, after integer promotion, has
+-   a signed type.  */
++   a signed type.  E should not have side effects.  */
+ #define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
+ 
+ 
+@@ -310,10 +311,13 @@
+ /* Return 1 if the expression A <op> B would overflow,
+    where OP_RESULT_OVERFLOW (A, B, MIN, MAX) does the actual test,
+    assuming MIN and MAX are the minimum and maximum for the result type.
+-   Arguments should be free of side effects.  */
++
++   This macro assumes that A | B is a valid integer if both A and B are,
++   which is true of all known practical hosts.  If this is a problem
++   for you, please let us know how to fix it for your host.  */
+ #define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow)        \
+   op_result_overflow (a, b,                                     \
+-                      _GL_INT_MINIMUM (0 * (b) + (a)),          \
+-                      _GL_INT_MAXIMUM (0 * (b) + (a)))
++                      _GL_INT_MINIMUM ((a) | (b)),              \
++                      _GL_INT_MAXIMUM ((a) | (b)))
+ 
+ #endif /* _GL_INTPROPS_H */
+diff -Naurp libiconv-1.14.org//srclib/Makefile.gnulib libiconv-1.14/srclib/Makefile.gnulib
+--- libiconv-1.14.org//srclib/Makefile.gnulib	2012-01-08 02:05:18.754477606 -0800
++++ libiconv-1.14/srclib/Makefile.gnulib	2012-01-08 02:07:43.138484592 -0800
+@@ -9,7 +9,7 @@
+ # the same distribution terms as the rest of that program.
+ #
+ # Generated by gnulib-tool.
+-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libicrt --source-base=srclib --m4-base=srcm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=Makefile.gnulib --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files binary-io error gettext gettext-h libiconv-misc mbstate memmove progname relocatable-prog safe-read sigpipe stdio stdlib strerror unistd uniwidth/width unlocked-io xalloc
++# Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libicrt --source-base=srclib --m4-base=srcm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=Makefile.gnulib --no-libtool --macro-prefix=gl --no-vc-files binary-io error gettext gettext-h libiconv-misc mbstate memmove progname relocatable relocatable-prog safe-read sigpipe stdio stdlib strerror unistd uniwidth/width unlocked-io xalloc
+ 
+ 
+ MOSTLYCLEANFILES += core *.stackdump
+@@ -60,12 +60,60 @@ EXTRA_DIST += areadlink.h
+ 
+ ## end   gnulib module areadlink
+ 
++## begin gnulib module arg-nonnull
++
++# The BUILT_SOURCES created by this Makefile snippet are not used via #include
++# statements but through direct file reference. Therefore this snippet must be
++# present in all Makefile.am that need it. This is ensured by the applicability
++# 'all' defined above.
++
++BUILT_SOURCES += arg-nonnull.h
++# The arg-nonnull.h that gets inserted into generated .h files is the same as
++# build-aux/arg-nonnull.h, except that it has the copyright header cut off.
++arg-nonnull.h: $(top_srcdir)/build-aux/arg-nonnull.h
++	$(AM_V_GEN)rm -f $@-t $@ && \
++	sed -n -e '/GL_ARG_NONNULL/,$$p' \
++	  < $(top_srcdir)/build-aux/arg-nonnull.h \
++	  > $@-t && \
++	mv $@-t $@
++MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
++
++ARG_NONNULL_H=arg-nonnull.h
++
++EXTRA_DIST += $(top_srcdir)/build-aux/arg-nonnull.h
++
++## end   gnulib module arg-nonnull
++
+ ## begin gnulib module binary-io
+ 
+ libicrt_a_SOURCES += binary-io.h
+ 
+ ## end   gnulib module binary-io
+ 
++## begin gnulib module c++defs
++
++# The BUILT_SOURCES created by this Makefile snippet are not used via #include
++# statements but through direct file reference. Therefore this snippet must be
++# present in all Makefile.am that need it. This is ensured by the applicability
++# 'all' defined above.
++
++BUILT_SOURCES += c++defs.h
++# The c++defs.h that gets inserted into generated .h files is the same as
++# build-aux/c++defs.h, except that it has the copyright header cut off.
++c++defs.h: $(top_srcdir)/build-aux/c++defs.h
++	$(AM_V_GEN)rm -f $@-t $@ && \
++	sed -n -e '/_GL_CXXDEFS/,$$p' \
++	  < $(top_srcdir)/build-aux/c++defs.h \
++	  > $@-t && \
++	mv $@-t $@
++MOSTLYCLEANFILES += c++defs.h c++defs.h-t
++
++CXXDEFS_H=c++defs.h
++
++EXTRA_DIST += $(top_srcdir)/build-aux/c++defs.h
++
++## end   gnulib module c++defs
++
+ ## begin gnulib module canonicalize-lgpl
+ 
+ 
+@@ -100,8 +148,7 @@ if GL_GENERATE_ERRNO_H
+ errno.h: errno.in.h $(top_builddir)/config.status
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ 	      -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
+@@ -142,15 +189,14 @@ BUILT_SOURCES += fcntl.h
+ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ 	      -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
+-	      -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
+-	      -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
+-	      -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
+-	      -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
++	      -e 's|@''GNULIB_FCNTL''@|$(GNULIB_FCNTL)|g' \
++	      -e 's|@''GNULIB_NONBLOCKING''@|$(GNULIB_NONBLOCKING)|g' \
++	      -e 's|@''GNULIB_OPEN''@|$(GNULIB_OPEN)|g' \
++	      -e 's|@''GNULIB_OPENAT''@|$(GNULIB_OPENAT)|g' \
+ 	      -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
+ 	      -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+ 	      -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
+@@ -297,7 +343,7 @@ EXTRA_DIST += $(top_srcdir)/build-aux/co
+ ## begin gnulib module relocatable-prog-wrapper
+ 
+ 
+-EXTRA_DIST += allocator.c allocator.h areadlink.c areadlink.h c-ctype.c c-ctype.h canonicalize-lgpl.c careadlinkat.c careadlinkat.h malloca.c malloca.h progname.c progname.h progreloc.c readlink.c relocatable.c relocatable.h relocwrapper.c setenv.c
++EXTRA_DIST += allocator.c allocator.h areadlink.c areadlink.h c-ctype.c c-ctype.h canonicalize-lgpl.c careadlinkat.c careadlinkat.h malloca.c malloca.h progname.c progname.h progreloc.c readlink.c relocatable.c relocatable.h relocwrapper.c setenv.c strerror.c
+ 
+ EXTRA_DIST += $(top_srcdir)/build-aux/install-reloc
+ 
+@@ -305,9 +351,10 @@ EXTRA_DIST += $(top_srcdir)/build-aux/in
+ 
+ ## begin gnulib module safe-read
+ 
+-libicrt_a_SOURCES += safe-read.c
+ 
+-EXTRA_DIST += safe-read.h
++EXTRA_DIST += safe-read.c safe-read.h
++
++EXTRA_libicrt_a_SOURCES += safe-read.c
+ 
+ ## end   gnulib module safe-read
+ 
+@@ -320,24 +367,20 @@ BUILT_SOURCES += signal.h
+ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ 	      -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
+-	      -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \
+-	      -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
+-	      -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
+-	      -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \
++	      -e 's|@''GNULIB_SIGNAL_H_SIGPIPE''@|$(GNULIB_SIGNAL_H_SIGPIPE)|g' \
++	      -e 's|@''GNULIB_SIGPROCMASK''@|$(GNULIB_SIGPROCMASK)|g' \
++	      -e 's|@''GNULIB_SIGACTION''@|$(GNULIB_SIGACTION)|g' \
+ 	      -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \
+-	      -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \
+ 	      -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \
+ 	      -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \
+ 	      -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \
+ 	      -e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g' \
+ 	      -e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|$(HAVE_TYPE_VOLATILE_SIG_ATOMIC_T)|g' \
+ 	      -e 's|@''HAVE_SIGHANDLER_T''@|$(HAVE_SIGHANDLER_T)|g' \
+-	      -e 's|@''REPLACE_PTHREAD_SIGMASK''@|$(REPLACE_PTHREAD_SIGMASK)|g' \
+ 	      -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+ 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ 	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+@@ -368,87 +411,6 @@ EXTRA_libicrt_a_SOURCES += sigprocmask.c
+ 
+ ## end   gnulib module sigprocmask
+ 
+-## begin gnulib module snippet/_Noreturn
+-
+-# Because this Makefile snippet defines a variable used by other
+-# gnulib Makefile snippets, it must be present in all Makefile.am that
+-# need it. This is ensured by the applicability 'all' defined above.
+-
+-_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
+-
+-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
+-
+-## end   gnulib module snippet/_Noreturn
+-
+-## begin gnulib module snippet/arg-nonnull
+-
+-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+-# statements but through direct file reference. Therefore this snippet must be
+-# present in all Makefile.am that need it. This is ensured by the applicability
+-# 'all' defined above.
+-
+-BUILT_SOURCES += arg-nonnull.h
+-# The arg-nonnull.h that gets inserted into generated .h files is the same as
+-# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
+-# off.
+-arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+-	$(AM_V_GEN)rm -f $@-t $@ && \
+-	sed -n -e '/GL_ARG_NONNULL/,$$p' \
+-	  < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
+-	  > $@-t && \
+-	mv $@-t $@
+-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+-
+-ARG_NONNULL_H=arg-nonnull.h
+-
+-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+-
+-## end   gnulib module snippet/arg-nonnull
+-
+-## begin gnulib module snippet/c++defs
+-
+-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
+-# statements but through direct file reference. Therefore this snippet must be
+-# present in all Makefile.am that need it. This is ensured by the applicability
+-# 'all' defined above.
+-
+-BUILT_SOURCES += c++defs.h
+-# The c++defs.h that gets inserted into generated .h files is the same as
+-# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
+-c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+-	$(AM_V_GEN)rm -f $@-t $@ && \
+-	sed -n -e '/_GL_CXXDEFS/,$$p' \
+-	  < $(top_srcdir)/build-aux/snippet/c++defs.h \
+-	  > $@-t && \
+-	mv $@-t $@
+-MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+-
+-CXXDEFS_H=c++defs.h
+-
+-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
+-
+-## end   gnulib module snippet/c++defs
+-
+-## begin gnulib module snippet/warn-on-use
+-
+-BUILT_SOURCES += warn-on-use.h
+-# The warn-on-use.h that gets inserted into generated .h files is the same as
+-# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
+-# off.
+-warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+-	$(AM_V_GEN)rm -f $@-t $@ && \
+-	sed -n -e '/^.ifndef/,$$p' \
+-	  < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
+-	  > $@-t && \
+-	mv $@-t $@
+-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+-
+-WARN_ON_USE_H=warn-on-use.h
+-
+-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
+-
+-## end   gnulib module snippet/warn-on-use
+-
+ ## begin gnulib module stat
+ 
+ 
+@@ -491,8 +453,7 @@ if GL_GENERATE_STDDEF_H
+ stddef.h: stddef.in.h $(top_builddir)/config.status
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ 	      -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \
+@@ -521,8 +482,7 @@ if GL_GENERATE_STDINT_H
+ stdint.h: stdint.in.h $(top_builddir)/config.status
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
++	  sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
+ 	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@@ -570,63 +530,62 @@ BUILT_SOURCES += stdio.h
+ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ 	      -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
+-	      -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
+-	      -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
+-	      -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
+-	      -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
+-	      -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
+-	      -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
+-	      -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
+-	      -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
+-	      -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
+-	      -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
+-	      -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
+-	      -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
+-	      -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
+-	      -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
+-	      -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
+-	      -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
+-	      -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
+-	      -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
+-	      -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
+-	      -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
+-	      -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
+-	      -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
+-	      -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
+-	      -e 's/@''GNULIB_GETS''@/$(GNULIB_GETS)/g' \
+-	      -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
+-	      -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+-	      -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
+-	      -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
+-	      -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
+-	      -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
+-	      -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
+-	      -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
+-	      -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
+-	      -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
+-	      -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
+-	      -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
+-	      -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
+-	      -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
+-	      -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
+-	      -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
+-	      -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
+-	      -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
+-	      -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
+-	      -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
+-	      -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
+-	      -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
+-	      -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
+-	      -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
+-	      -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
+-	      -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
+-	      -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
+-	      -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
++	      -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \
++	      -e 's|@''GNULIB_FCLOSE''@|$(GNULIB_FCLOSE)|g' \
++	      -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
++	      -e 's|@''GNULIB_FGETC''@|$(GNULIB_FGETC)|g' \
++	      -e 's|@''GNULIB_FGETS''@|$(GNULIB_FGETS)|g' \
++	      -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
++	      -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
++	      -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
++	      -e 's|@''GNULIB_FPURGE''@|$(GNULIB_FPURGE)|g' \
++	      -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
++	      -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
++	      -e 's|@''GNULIB_FREAD''@|$(GNULIB_FREAD)|g' \
++	      -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
++	      -e 's|@''GNULIB_FSCANF''@|$(GNULIB_FSCANF)|g' \
++	      -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
++	      -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
++	      -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
++	      -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
++	      -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
++	      -e 's|@''GNULIB_GETC''@|$(GNULIB_GETC)|g' \
++	      -e 's|@''GNULIB_GETCHAR''@|$(GNULIB_GETCHAR)|g' \
++	      -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
++	      -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
++	      -e 's|@''GNULIB_GETS''@|$(GNULIB_GETS)|g' \
++	      -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
++	      -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
++	      -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
++	      -e 's|@''GNULIB_POPEN''@|$(GNULIB_POPEN)|g' \
++	      -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
++	      -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
++	      -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
++	      -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
++	      -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
++	      -e 's|@''GNULIB_REMOVE''@|$(GNULIB_REMOVE)|g' \
++	      -e 's|@''GNULIB_RENAME''@|$(GNULIB_RENAME)|g' \
++	      -e 's|@''GNULIB_RENAMEAT''@|$(GNULIB_RENAMEAT)|g' \
++	      -e 's|@''GNULIB_SCANF''@|$(GNULIB_SCANF)|g' \
++	      -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
++	      -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
++	      -e 's|@''GNULIB_STDIO_H_NONBLOCKING''@|$(GNULIB_STDIO_H_NONBLOCKING)|g' \
++	      -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
++	      -e 's|@''GNULIB_TMPFILE''@|$(GNULIB_TMPFILE)|g' \
++	      -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
++	      -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \
++	      -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
++	      -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
++	      -e 's|@''GNULIB_VFSCANF''@|$(GNULIB_VFSCANF)|g' \
++	      -e 's|@''GNULIB_VSCANF''@|$(GNULIB_VSCANF)|g' \
++	      -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
++	      -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
++	      -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
++	      -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
+ 	      < $(srcdir)/stdio.in.h | \
+ 	  sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+ 	      -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
+@@ -691,43 +650,41 @@ BUILT_SOURCES += stdlib.h
+ 
+ # We need the following in order to create <stdlib.h> when the system
+ # doesn't have one that works with the given compiler.
+-stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
+-  $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
++stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ 	      -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
+-	      -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
+-	      -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
+-	      -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
+-	      -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
+-	      -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
+-	      -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
+-	      -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
+-	      -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \
+-	      -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \
+-	      -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \
+-	      -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \
+-	      -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
+-	      -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
+-	      -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
+-	      -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
+-	      -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
+-	      -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
+-	      -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
+-	      -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
+-	      -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
+-	      -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
+-	      -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
+-	      -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
+-	      -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
+-	      -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
+-	      -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
+-	      -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
+-	      -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
++	      -e 's|@''GNULIB__EXIT''@|$(GNULIB__EXIT)|g' \
++	      -e 's|@''GNULIB_ATOLL''@|$(GNULIB_ATOLL)|g' \
++	      -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
++	      -e 's|@''GNULIB_CANONICALIZE_FILE_NAME''@|$(GNULIB_CANONICALIZE_FILE_NAME)|g' \
++	      -e 's|@''GNULIB_GETLOADAVG''@|$(GNULIB_GETLOADAVG)|g' \
++	      -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
++	      -e 's|@''GNULIB_GRANTPT''@|$(GNULIB_GRANTPT)|g' \
++	      -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
++	      -e 's|@''GNULIB_MBTOWC''@|$(GNULIB_MBTOWC)|g' \
++	      -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
++	      -e 's|@''GNULIB_MKOSTEMP''@|$(GNULIB_MKOSTEMP)|g' \
++	      -e 's|@''GNULIB_MKOSTEMPS''@|$(GNULIB_MKOSTEMPS)|g' \
++	      -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
++	      -e 's|@''GNULIB_MKSTEMPS''@|$(GNULIB_MKSTEMPS)|g' \
++	      -e 's|@''GNULIB_PTSNAME''@|$(GNULIB_PTSNAME)|g' \
++	      -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
++	      -e 's|@''GNULIB_RANDOM_R''@|$(GNULIB_RANDOM_R)|g' \
++	      -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
++	      -e 's|@''GNULIB_REALPATH''@|$(GNULIB_REALPATH)|g' \
++	      -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
++	      -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
++	      -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
++	      -e 's|@''GNULIB_STRTOLL''@|$(GNULIB_STRTOLL)|g' \
++	      -e 's|@''GNULIB_STRTOULL''@|$(GNULIB_STRTOULL)|g' \
++	      -e 's|@''GNULIB_SYSTEM_POSIX''@|$(GNULIB_SYSTEM_POSIX)|g' \
++	      -e 's|@''GNULIB_UNLOCKPT''@|$(GNULIB_UNLOCKPT)|g' \
++	      -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
++	      -e 's|@''GNULIB_WCTOMB''@|$(GNULIB_WCTOMB)|g' \
+ 	      < $(srcdir)/stdlib.in.h | \
+ 	  sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+ 	      -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
+@@ -766,7 +723,6 @@ stdlib.h: stdlib.in.h $(top_builddir)/co
+ 	      -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
+ 	      -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
+ 	      -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+-	      -e '/definition of _Noreturn/r $(_NORETURN_H)' \
+ 	      -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+ 	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+ 	} > $@-t && \
+@@ -793,15 +749,6 @@ EXTRA_libicrt_a_SOURCES += strerror.c
+ 
+ ## end   gnulib module strerror
+ 
+-## begin gnulib module strerror-override
+-
+-
+-EXTRA_DIST += strerror-override.c strerror-override.h
+-
+-EXTRA_libicrt_a_SOURCES += strerror-override.c
+-
+-## end   gnulib module strerror-override
+-
+ ## begin gnulib module string
+ 
+ BUILT_SOURCES += string.h
+@@ -811,52 +758,47 @@ BUILT_SOURCES += string.h
+ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ 	      -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
+-	      -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
+-	      -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
+-	      -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
+-	      -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
+-	      -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
+-	      -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
+-	      -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
+-	      -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
+-	      -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
+-	      -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
+-	      -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
+-	      -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
+-	      -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
+-	      -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
+-	      -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
+-	      -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
+-	      -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
+-	      -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
+-	      -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
+-	      -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
+-	      -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
+-	      -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
+-	      -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
+-	      -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
+-	      -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
+-	      -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
+-	      -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
+-	      -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
+-	      -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
+-	      -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
+-	      -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
+-	      -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
+-	      -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
+-	      -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
+-	      -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
+-	      -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
+-	      -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
++	      -e 's|@''GNULIB_MBSLEN''@|$(GNULIB_MBSLEN)|g' \
++	      -e 's|@''GNULIB_MBSNLEN''@|$(GNULIB_MBSNLEN)|g' \
++	      -e 's|@''GNULIB_MBSCHR''@|$(GNULIB_MBSCHR)|g' \
++	      -e 's|@''GNULIB_MBSRCHR''@|$(GNULIB_MBSRCHR)|g' \
++	      -e 's|@''GNULIB_MBSSTR''@|$(GNULIB_MBSSTR)|g' \
++	      -e 's|@''GNULIB_MBSCASECMP''@|$(GNULIB_MBSCASECMP)|g' \
++	      -e 's|@''GNULIB_MBSNCASECMP''@|$(GNULIB_MBSNCASECMP)|g' \
++	      -e 's|@''GNULIB_MBSPCASECMP''@|$(GNULIB_MBSPCASECMP)|g' \
++	      -e 's|@''GNULIB_MBSCASESTR''@|$(GNULIB_MBSCASESTR)|g' \
++	      -e 's|@''GNULIB_MBSCSPN''@|$(GNULIB_MBSCSPN)|g' \
++	      -e 's|@''GNULIB_MBSPBRK''@|$(GNULIB_MBSPBRK)|g' \
++	      -e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
++	      -e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
++	      -e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
++	      -e 's|@''GNULIB_MEMCHR''@|$(GNULIB_MEMCHR)|g' \
++	      -e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
++	      -e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
++	      -e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
++	      -e 's|@''GNULIB_RAWMEMCHR''@|$(GNULIB_RAWMEMCHR)|g' \
++	      -e 's|@''GNULIB_STPCPY''@|$(GNULIB_STPCPY)|g' \
++	      -e 's|@''GNULIB_STPNCPY''@|$(GNULIB_STPNCPY)|g' \
++	      -e 's|@''GNULIB_STRCHRNUL''@|$(GNULIB_STRCHRNUL)|g' \
++	      -e 's|@''GNULIB_STRDUP''@|$(GNULIB_STRDUP)|g' \
++	      -e 's|@''GNULIB_STRNCAT''@|$(GNULIB_STRNCAT)|g' \
++	      -e 's|@''GNULIB_STRNDUP''@|$(GNULIB_STRNDUP)|g' \
++	      -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
++	      -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
++	      -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
++	      -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
++	      -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
++	      -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
++	      -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
++	      -e 's|@''GNULIB_STRERROR_R''@|$(GNULIB_STRERROR_R)|g' \
++	      -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
++	      -e 's|@''GNULIB_STRVERSCMP''@|$(GNULIB_STRVERSCMP)|g' \
+ 	      < $(srcdir)/string.in.h | \
+-	  sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+-	      -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
+-	      -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
++	  sed -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
+ 	      -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
+ 	      -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+ 	      -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+@@ -912,23 +854,22 @@ sys/stat.h: sys_stat.in.h $(top_builddir
+ 	$(AM_V_at)$(MKDIR_P) sys
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ 	      -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
+-	      -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
+-	      -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
+-	      -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \
+-	      -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
+-	      -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
+-	      -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
+-	      -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
+-	      -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
+-	      -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \
+-	      -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
+-	      -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
+-	      -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \
++	      -e 's|@''GNULIB_FCHMODAT''@|$(GNULIB_FCHMODAT)|g' \
++	      -e 's|@''GNULIB_FSTATAT''@|$(GNULIB_FSTATAT)|g' \
++	      -e 's|@''GNULIB_FUTIMENS''@|$(GNULIB_FUTIMENS)|g' \
++	      -e 's|@''GNULIB_LCHMOD''@|$(GNULIB_LCHMOD)|g' \
++	      -e 's|@''GNULIB_LSTAT''@|$(GNULIB_LSTAT)|g' \
++	      -e 's|@''GNULIB_MKDIRAT''@|$(GNULIB_MKDIRAT)|g' \
++	      -e 's|@''GNULIB_MKFIFO''@|$(GNULIB_MKFIFO)|g' \
++	      -e 's|@''GNULIB_MKFIFOAT''@|$(GNULIB_MKFIFOAT)|g' \
++	      -e 's|@''GNULIB_MKNOD''@|$(GNULIB_MKNOD)|g' \
++	      -e 's|@''GNULIB_MKNODAT''@|$(GNULIB_MKNODAT)|g' \
++	      -e 's|@''GNULIB_STAT''@|$(GNULIB_STAT)|g' \
++	      -e 's|@''GNULIB_UTIMENSAT''@|$(GNULIB_UTIMENSAT)|g' \
+ 	      -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
+ 	      -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
+ 	      -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
+@@ -971,16 +912,15 @@ BUILT_SOURCES += time.h
+ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
++	  sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ 	      -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
+-	      -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
+-	      -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
+-	      -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
+-	      -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
+-	      -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
++	      -e 's|@''GNULIB_MKTIME''@|$(GNULIB_MKTIME)|g' \
++	      -e 's|@''GNULIB_NANOSLEEP''@|$(GNULIB_NANOSLEEP)|g' \
++	      -e 's|@''GNULIB_STRPTIME''@|$(GNULIB_STRPTIME)|g' \
++	      -e 's|@''GNULIB_TIMEGM''@|$(GNULIB_TIMEGM)|g' \
++	      -e 's|@''GNULIB_TIME_R''@|$(GNULIB_TIME_R)|g' \
+ 	      -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
+ 	      -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
+ 	      -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
+@@ -1013,56 +953,55 @@ BUILT_SOURCES += unistd.h
+ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+ 	$(AM_V_GEN)rm -f $@-t $@ && \
+ 	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+-	  sed -e 's|@''GUARD_PREFIX''@|GL|g' \
+-	      -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
++	  sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
+ 	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+ 	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+ 	      -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+ 	      -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
+-	      -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
+-	      -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
+-	      -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
+-	      -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
+-	      -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
+-	      -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
+-	      -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
+-	      -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
+-	      -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
+-	      -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \
+-	      -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \
+-	      -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
+-	      -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
+-	      -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
+-	      -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
+-	      -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
+-	      -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
+-	      -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
+-	      -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
+-	      -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
+-	      -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
+-	      -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
+-	      -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
+-	      -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
+-	      -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \
+-	      -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \
+-	      -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \
+-	      -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \
+-	      -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \
+-	      -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \
+-	      -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
+-	      -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
+-	      -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
+-	      -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
+-	      -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
+-	      -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
+-	      -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
+-	      -e 's/@''GNULIB_UNISTD_H_GETOPT''@/$(GNULIB_UNISTD_H_GETOPT)/g' \
+-	      -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
+-	      -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
+-	      -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
+-	      -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
+-	      -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
+-	      -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
++	      -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
++	      -e 's|@''GNULIB_CLOSE''@|$(GNULIB_CLOSE)|g' \
++	      -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
++	      -e 's|@''GNULIB_DUP3''@|$(GNULIB_DUP3)|g' \
++	      -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
++	      -e 's|@''GNULIB_EUIDACCESS''@|$(GNULIB_EUIDACCESS)|g' \
++	      -e 's|@''GNULIB_FACCESSAT''@|$(GNULIB_FACCESSAT)|g' \
++	      -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
++	      -e 's|@''GNULIB_FCHOWNAT''@|$(GNULIB_FCHOWNAT)|g' \
++	      -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
++	      -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
++	      -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
++	      -e 's|@''GNULIB_GETDOMAINNAME''@|$(GNULIB_GETDOMAINNAME)|g' \
++	      -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \
++	      -e 's|@''GNULIB_GETGROUPS''@|$(GNULIB_GETGROUPS)|g' \
++	      -e 's|@''GNULIB_GETHOSTNAME''@|$(GNULIB_GETHOSTNAME)|g' \
++	      -e 's|@''GNULIB_GETLOGIN''@|$(GNULIB_GETLOGIN)|g' \
++	      -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
++	      -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
++	      -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \
++	      -e 's|@''GNULIB_GROUP_MEMBER''@|$(GNULIB_GROUP_MEMBER)|g' \
++	      -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
++	      -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
++	      -e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \
++	      -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
++	      -e 's|@''GNULIB_PIPE''@|$(GNULIB_PIPE)|g' \
++	      -e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
++	      -e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
++	      -e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \
++	      -e 's|@''GNULIB_READ''@|$(GNULIB_READ)|g' \
++	      -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
++	      -e 's|@''GNULIB_READLINKAT''@|$(GNULIB_READLINKAT)|g' \
++	      -e 's|@''GNULIB_RMDIR''@|$(GNULIB_RMDIR)|g' \
++	      -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
++	      -e 's|@''GNULIB_SYMLINK''@|$(GNULIB_SYMLINK)|g' \
++	      -e 's|@''GNULIB_SYMLINKAT''@|$(GNULIB_SYMLINKAT)|g' \
++	      -e 's|@''GNULIB_TTYNAME_R''@|$(GNULIB_TTYNAME_R)|g' \
++	      -e 's|@''GNULIB_UNISTD_H_GETOPT''@|$(GNULIB_UNISTD_H_GETOPT)|g' \
++	      -e 's|@''GNULIB_UNISTD_H_NONBLOCKING''@|$(GNULIB_UNISTD_H_NONBLOCKING)|g' \
++	      -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
++	      -e 's|@''GNULIB_UNLINK''@|$(GNULIB_UNLINK)|g' \
++	      -e 's|@''GNULIB_UNLINKAT''@|$(GNULIB_UNLINKAT)|g' \
++	      -e 's|@''GNULIB_USLEEP''@|$(GNULIB_USLEEP)|g' \
++	      -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
+ 	      < $(srcdir)/unistd.in.h | \
+ 	  sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
+ 	      -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+@@ -1198,6 +1137,25 @@ EXTRA_DIST += verify.h
+ 
+ ## end   gnulib module verify
+ 
++## begin gnulib module warn-on-use
++
++BUILT_SOURCES += warn-on-use.h
++# The warn-on-use.h that gets inserted into generated .h files is the same as
++# build-aux/warn-on-use.h, except that it has the copyright header cut off.
++warn-on-use.h: $(top_srcdir)/build-aux/warn-on-use.h
++	$(AM_V_GEN)rm -f $@-t $@ && \
++	sed -n -e '/^.ifndef/,$$p' \
++	  < $(top_srcdir)/build-aux/warn-on-use.h \
++	  > $@-t && \
++	mv $@-t $@
++MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
++
++WARN_ON_USE_H=warn-on-use.h
++
++EXTRA_DIST += $(top_srcdir)/build-aux/warn-on-use.h
++
++## end   gnulib module warn-on-use
++
+ ## begin gnulib module xalloc
+ 
+ libicrt_a_SOURCES += xalloc.h xmalloc.c xstrdup.c
+diff -Naurp libiconv-1.14.org//srclib/pathmax.h libiconv-1.14/srclib/pathmax.h
+--- libiconv-1.14.org//srclib/pathmax.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/pathmax.h	2012-01-08 02:07:40.218484451 -0800
+@@ -19,27 +19,6 @@
+ #ifndef _PATHMAX_H
+ # define _PATHMAX_H
+ 
+-/* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename,
+-   including the terminating NUL byte.
+-   <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html>
+-   PATH_MAX is not defined on systems which have no limit on filename length,
+-   such as GNU/Hurd.
+-
+-   This file does *not* define PATH_MAX always.  Programs that use this file
+-   can handle the GNU/Hurd case in several ways:
+-     - Either with a package-wide handling, or with a per-file handling,
+-     - Either through a
+-         #ifdef PATH_MAX
+-       or through a fallback like
+-         #ifndef PATH_MAX
+-         # define PATH_MAX 8192
+-         #endif
+-       or through a fallback like
+-         #ifndef PATH_MAX
+-         # define PATH_MAX pathconf ("/", _PC_PATH_MAX)
+-         #endif
+- */
+-
+ # include <unistd.h>
+ 
+ # include <limits.h>
+@@ -48,6 +27,11 @@
+ #  define _POSIX_PATH_MAX 256
+ # endif
+ 
++# if !defined PATH_MAX && defined _PC_PATH_MAX && defined HAVE_PATHCONF
++#  define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 \
++                    : pathconf ("/", _PC_PATH_MAX))
++# endif
++
+ /* Don't include sys/param.h if it already has been.  */
+ # if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+ #  include <sys/param.h>
+@@ -57,13 +41,8 @@
+ #  define PATH_MAX MAXPATHLEN
+ # endif
+ 
+-# ifdef __hpux
+-/* On HP-UX, PATH_MAX designates the maximum number of bytes in a filename,
+-   *not* including the terminating NUL byte, and is set to 1023.
+-   Additionally, when _XOPEN_SOURCE is defined to 500 or more, PATH_MAX is
+-   not defined at all any more.  */
+-#  undef PATH_MAX
+-#  define PATH_MAX 1024
++# ifndef PATH_MAX
++#  define PATH_MAX _POSIX_PATH_MAX
+ # endif
+ 
+ #endif /* _PATHMAX_H */
+diff -Naurp libiconv-1.14.org//srclib/relocwrapper.c libiconv-1.14/srclib/relocwrapper.c
+--- libiconv-1.14.org//srclib/relocwrapper.c	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/relocwrapper.c	2012-01-08 02:07:40.282484455 -0800
+@@ -29,6 +29,7 @@
+     -> relocatable
+     -> setenv
+        -> malloca
++    -> strerror
+     -> c-ctype
+ 
+    Macros that need to be set while compiling this file:
+diff -Naurp libiconv-1.14.org//srclib/safe-read.h libiconv-1.14/srclib/safe-read.h
+--- libiconv-1.14.org//srclib/safe-read.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/safe-read.h	2012-01-08 02:07:40.298484455 -0800
+@@ -14,19 +14,6 @@
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ 
+-/* Some system calls may be interrupted and fail with errno = EINTR in the
+-   following situations:
+-     - The process is stopped and restarted (signal SIGSTOP and SIGCONT, user
+-       types Ctrl-Z) on some platforms: MacOS X.
+-     - The process receives a signal for which a signal handler was installed
+-       with sigaction() with an sa_flags field that does not contain
+-       SA_RESTART.
+-     - The process receives a signal for which a signal handler was installed
+-       with signal() and for which no call to siginterrupt(sig,0) was done,
+-       on some platforms: AIX, HP-UX, IRIX, OSF/1, Solaris.
+-
+-   This module provides a wrapper around read() that handles EINTR.  */
+-
+ #include <stddef.h>
+ 
+ #ifdef __cplusplus
+diff -Naurp libiconv-1.14.org//srclib/signal.in.h libiconv-1.14/srclib/signal.in.h
+--- libiconv-1.14.org//srclib/signal.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/signal.in.h	2012-01-08 02:07:40.314484456 -0800
+@@ -20,49 +20,21 @@
+ #endif
+ @PRAGMA_COLUMNS@
+ 
+-#if defined __need_sig_atomic_t || defined __need_sigset_t || defined _GL_ALREADY_INCLUDING_SIGNAL_H || (defined _SIGNAL_H && !defined __SIZEOF_PTHREAD_MUTEX_T)
+-/* Special invocation convention:
+-   - Inside glibc header files.
+-   - On glibc systems we have a sequence of nested includes
+-     <signal.h> -> <ucontext.h> -> <signal.h>.
+-     In this situation, the functions are not yet declared, therefore we cannot
+-     provide the C++ aliases.
+-   - On glibc systems with GCC 4.3 we have a sequence of nested includes
+-     <csignal> -> </usr/include/signal.h> -> <sys/ucontext.h> -> <signal.h>.
+-     In this situation, some of the functions are not yet declared, therefore
+-     we cannot provide the C++ aliases.  */
++#if defined __need_sig_atomic_t || defined __need_sigset_t
++/* Special invocation convention inside glibc header files.  */
+ 
+ # @INCLUDE_NEXT@ @NEXT_SIGNAL_H@
+ 
+ #else
+ /* Normal invocation convention.  */
+ 
+-#ifndef _@GUARD_PREFIX@_SIGNAL_H
+-
+-#define _GL_ALREADY_INCLUDING_SIGNAL_H
+-
+-/* Define pid_t, uid_t.
+-   Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.
+-   On Solaris 10, <signal.h> includes <sys/types.h>, which eventually includes
+-   us; so include <sys/types.h> now, before the second inclusion guard.  */
+-#include <sys/types.h>
++#ifndef _GL_SIGNAL_H
+ 
+ /* The include_next requires a split double-inclusion guard.  */
+ #@INCLUDE_NEXT@ @NEXT_SIGNAL_H@
+ 
+-#undef _GL_ALREADY_INCLUDING_SIGNAL_H
+-
+-#ifndef _@GUARD_PREFIX@_SIGNAL_H
+-#define _@GUARD_PREFIX@_SIGNAL_H
+-
+-/* MacOS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6 declare
+-   pthread_sigmask in <pthread.h>, not in <signal.h>.
+-   But avoid namespace pollution on glibc systems.*/
+-#if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
+-    && ((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ || defined __sun) \
+-    && ! defined __GLIBC__
+-# include <pthread.h>
+-#endif
++#ifndef _GL_SIGNAL_H
++#define _GL_SIGNAL_H
+ 
+ /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+ 
+@@ -70,6 +42,10 @@
+ 
+ /* The definition of _GL_WARN_ON_USE is copied here.  */
+ 
++/* Define pid_t, uid_t.
++   Also, mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.  */
++#include <sys/types.h>
++
+ /* On AIX, sig_atomic_t already includes volatile.  C99 requires that
+    'volatile sig_atomic_t' ignore the extra modifier, but C89 did not.
+    Hence, redefine this to a non-volatile type as needed.  */
+@@ -124,34 +100,6 @@ typedef void (*sighandler_t) (int);
+ #endif
+ 
+ 
+-#if @GNULIB_PTHREAD_SIGMASK@
+-# if @REPLACE_PTHREAD_SIGMASK@
+-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef pthread_sigmask
+-#   define pthread_sigmask rpl_pthread_sigmask
+-#  endif
+-_GL_FUNCDECL_RPL (pthread_sigmask, int,
+-                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+-_GL_CXXALIAS_RPL (pthread_sigmask, int,
+-                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+-# else
+-#  if !@HAVE_PTHREAD_SIGMASK@
+-_GL_FUNCDECL_SYS (pthread_sigmask, int,
+-                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+-#  endif
+-_GL_CXXALIAS_SYS (pthread_sigmask, int,
+-                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+-# endif
+-_GL_CXXALIASWARN (pthread_sigmask);
+-#elif defined GNULIB_POSIXCHECK
+-# undef pthread_sigmask
+-# if HAVE_RAW_DECL_PTHREAD_SIGMASK
+-_GL_WARN_ON_USE (pthread_sigmask, "pthread_sigmask is not portable - "
+-                 "use gnulib module pthread_sigmask for portability");
+-# endif
+-#endif
+-
+-
+ #if @GNULIB_SIGPROCMASK@
+ # if !@HAVE_POSIX_SIGNALBLOCKING@
+ 
+@@ -423,6 +371,6 @@ _GL_WARN_ON_USE (sigaction, "sigaction i
+ #endif
+ 
+ 
+-#endif /* _@GUARD_PREFIX@_SIGNAL_H */
+-#endif /* _@GUARD_PREFIX@_SIGNAL_H */
++#endif /* _GL_SIGNAL_H */
++#endif /* _GL_SIGNAL_H */
+ #endif
+diff -Naurp libiconv-1.14.org//srclib/stat.c libiconv-1.14/srclib/stat.c
+--- libiconv-1.14.org//srclib/stat.c	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/stat.c	2012-01-08 02:07:40.330484457 -0800
+@@ -38,7 +38,6 @@ orig_stat (const char *filename, struct
+ #include <stdbool.h>
+ #include <string.h>
+ #include "dosname.h"
+-#include "verify.h"
+ 
+ /* Store information about NAME into ST.  Work around bugs with
+    trailing slashes.  Mingw has other bugs (such as st_ino always
+@@ -64,12 +63,6 @@ rpl_stat (char const *name, struct stat
+     }
+ #endif /* REPLACE_FUNC_STAT_FILE */
+ #if REPLACE_FUNC_STAT_DIR
+-  /* The only known systems where REPLACE_FUNC_STAT_DIR is needed also
+-     have a constant PATH_MAX.  */
+-# ifndef PATH_MAX
+-#  error "Please port this replacement to your platform"
+-# endif
+-
+   if (result == -1 && errno == ENOENT)
+     {
+       /* Due to mingw's oddities, there are some directories (like
+@@ -84,7 +77,6 @@ rpl_stat (char const *name, struct stat
+       char fixed_name[PATH_MAX + 1] = {0};
+       size_t len = strlen (name);
+       bool check_dir = false;
+-      verify (PATH_MAX <= 4096);
+       if (PATH_MAX <= len)
+         errno = ENAMETOOLONG;
+       else if (len)
+diff -Naurp libiconv-1.14.org//srclib/stddef.in.h libiconv-1.14/srclib/stddef.in.h
+--- libiconv-1.14.org//srclib/stddef.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/stddef.in.h	2012-01-08 02:07:40.346484458 -0800
+@@ -38,9 +38,9 @@
+    remember if special invocation has ever been used to obtain wint_t,
+    in which case we need to clean up NULL yet again.  */
+ 
+-# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T)
++# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T)
+ #  ifdef __need_wint_t
+-#   undef _@GUARD_PREFIX@_STDDEF_H
++#   undef _GL_STDDEF_H
+ #   define _GL_STDDEF_WINT_T
+ #  endif
+ #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+@@ -49,14 +49,14 @@
+ #else
+ /* Normal invocation convention.  */
+ 
+-# ifndef _@GUARD_PREFIX@_STDDEF_H
++# ifndef _GL_STDDEF_H
+ 
+ /* The include_next requires a split double-inclusion guard.  */
+ 
+ #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+ 
+-#  ifndef _@GUARD_PREFIX@_STDDEF_H
+-#   define _@GUARD_PREFIX@_STDDEF_H
++#  ifndef _GL_STDDEF_H
++#   define _GL_STDDEF_H
+ 
+ /* On NetBSD 5.0, the definition of NULL lacks proper parentheses.  */
+ #if @REPLACE_NULL@
+@@ -82,6 +82,6 @@
+ # define wchar_t int
+ #endif
+ 
+-#  endif /* _@GUARD_PREFIX@_STDDEF_H */
+-# endif /* _@GUARD_PREFIX@_STDDEF_H */
++#  endif /* _GL_STDDEF_H */
++# endif /* _GL_STDDEF_H */
+ #endif /* __need_XXX */
+diff -Naurp libiconv-1.14.org//srclib/stdint.in.h libiconv-1.14/srclib/stdint.in.h
+--- libiconv-1.14.org//srclib/stdint.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/stdint.in.h	2012-01-08 02:07:40.358484458 -0800
+@@ -21,7 +21,7 @@
+  * <http://www.opengroup.org/susv3xbd/stdint.h.html>
+  */
+ 
+-#ifndef _@GUARD_PREFIX@_STDINT_H
++#ifndef _GL_STDINT_H
+ 
+ #if __GNUC__ >= 3
+ @PRAGMA_SYSTEM_HEADER@
+@@ -52,13 +52,13 @@
+   /* Other systems may have an incomplete or buggy <stdint.h>.
+      Include it before <inttypes.h>, since any "#include <stdint.h>"
+      in <inttypes.h> would reinclude us, skipping our contents because
+-     _@GUARD_PREFIX@_STDINT_H is defined.
++     _GL_STDINT_H is defined.
+      The include_next requires a split double-inclusion guard.  */
+ # @INCLUDE_NEXT@ @NEXT_STDINT_H@
+ #endif
+ 
+-#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+-#define _@GUARD_PREFIX@_STDINT_H
++#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
++#define _GL_STDINT_H
+ 
+ /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
+    IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
+@@ -270,36 +270,26 @@ typedef unsigned long int gl_uintptr_t;
+ /* Note: These types are compiler dependent. It may be unwise to use them in
+    public header files. */
+ 
+-/* If the system defines INTMAX_MAX, assume that intmax_t works, and
+-   similarly for UINTMAX_MAX and uintmax_t.  This avoids problems with
+-   assuming one type where another is used by the system.  */
+-
+-#ifndef INTMAX_MAX
+-# undef INTMAX_C
+-# undef intmax_t
+-# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
++#undef intmax_t
++#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+ typedef long long int gl_intmax_t;
+-#  define intmax_t gl_intmax_t
+-# elif defined GL_INT64_T
+-#  define intmax_t int64_t
+-# else
++# define intmax_t gl_intmax_t
++#elif defined GL_INT64_T
++# define intmax_t int64_t
++#else
+ typedef long int gl_intmax_t;
+-#  define intmax_t gl_intmax_t
+-# endif
++# define intmax_t gl_intmax_t
+ #endif
+ 
+-#ifndef UINTMAX_MAX
+-# undef UINTMAX_C
+-# undef uintmax_t
+-# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
++#undef uintmax_t
++#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+ typedef unsigned long long int gl_uintmax_t;
+-#  define uintmax_t gl_uintmax_t
+-# elif defined GL_UINT64_T
+-#  define uintmax_t uint64_t
+-# else
++# define uintmax_t gl_uintmax_t
++#elif defined GL_UINT64_T
++# define uintmax_t uint64_t
++#else
+ typedef unsigned long int gl_uintmax_t;
+-#  define uintmax_t gl_uintmax_t
+-# endif
++# define uintmax_t gl_uintmax_t
+ #endif
+ 
+ /* Verify that intmax_t and uintmax_t have the same size.  Too much code
+@@ -441,23 +431,21 @@ typedef int _verify_intmax_size[sizeof (
+ 
+ /* 7.18.2.5. Limits of greatest-width integer types */
+ 
+-#ifndef INTMAX_MAX
+-# undef INTMAX_MIN
+-# ifdef INT64_MAX
+-#  define INTMAX_MIN  INT64_MIN
+-#  define INTMAX_MAX  INT64_MAX
+-# else
+-#  define INTMAX_MIN  INT32_MIN
+-#  define INTMAX_MAX  INT32_MAX
+-# endif
++#undef INTMAX_MIN
++#undef INTMAX_MAX
++#ifdef INT64_MAX
++# define INTMAX_MIN  INT64_MIN
++# define INTMAX_MAX  INT64_MAX
++#else
++# define INTMAX_MIN  INT32_MIN
++# define INTMAX_MAX  INT32_MAX
+ #endif
+ 
+-#ifndef UINTMAX_MAX
+-# ifdef UINT64_MAX
+-#  define UINTMAX_MAX  UINT64_MAX
+-# else
+-#  define UINTMAX_MAX  UINT32_MAX
+-# endif
++#undef UINTMAX_MAX
++#ifdef UINT64_MAX
++# define UINTMAX_MAX  UINT64_MAX
++#else
++# define UINTMAX_MAX  UINT32_MAX
+ #endif
+ 
+ /* 7.18.3. Limits of other integer types */
+@@ -580,27 +568,25 @@ typedef int _verify_intmax_size[sizeof (
+ 
+ /* 7.18.4.2. Macros for greatest-width integer constants */
+ 
+-#ifndef INTMAX_C
+-# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+-#  define INTMAX_C(x)   x##LL
+-# elif defined GL_INT64_T
+-#  define INTMAX_C(x)   INT64_C(x)
+-# else
+-#  define INTMAX_C(x)   x##L
+-# endif
++#undef INTMAX_C
++#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
++# define INTMAX_C(x)   x##LL
++#elif defined GL_INT64_T
++# define INTMAX_C(x)   INT64_C(x)
++#else
++# define INTMAX_C(x)   x##L
+ #endif
+ 
+-#ifndef UINTMAX_C
+-# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+-#  define UINTMAX_C(x)  x##ULL
+-# elif defined GL_UINT64_T
+-#  define UINTMAX_C(x)  UINT64_C(x)
+-# else
+-#  define UINTMAX_C(x)  x##UL
+-# endif
++#undef UINTMAX_C
++#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
++# define UINTMAX_C(x)  x##ULL
++#elif defined GL_UINT64_T
++# define UINTMAX_C(x)  UINT64_C(x)
++#else
++# define UINTMAX_C(x)  x##UL
+ #endif
+ 
+ #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
+ 
+-#endif /* _@GUARD_PREFIX@_STDINT_H */
+-#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
++#endif /* _GL_STDINT_H */
++#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
+diff -Naurp libiconv-1.14.org//srclib/stdio.in.h libiconv-1.14/srclib/stdio.in.h
+--- libiconv-1.14.org//srclib/stdio.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/stdio.in.h	2012-01-08 02:07:40.378484459 -0800
+@@ -35,7 +35,7 @@
+ #else
+ /* Normal invocation convention.  */
+ 
+-#ifndef _@GUARD_PREFIX@_STDIO_H
++#ifndef _GL_STDIO_H
+ 
+ #define _GL_ALREADY_INCLUDING_STDIO_H
+ 
+@@ -44,8 +44,8 @@
+ 
+ #undef _GL_ALREADY_INCLUDING_STDIO_H
+ 
+-#ifndef _@GUARD_PREFIX@_STDIO_H
+-#define _@GUARD_PREFIX@_STDIO_H
++#ifndef _GL_STDIO_H
++#define _GL_STDIO_H
+ 
+ /* Get va_list.  Needed on many systems, including glibc 2.8.  */
+ #include <stdarg.h>
+@@ -461,6 +461,25 @@ _GL_FUNCDECL_SYS (fseeko, int, (FILE *fp
+ _GL_CXXALIAS_SYS (fseeko, int, (FILE *fp, off_t offset, int whence));
+ # endif
+ _GL_CXXALIASWARN (fseeko);
++# if (@REPLACE_FSEEKO@ || !@HAVE_FSEEKO@) && !@GNULIB_FSEEK@
++   /* Provide an fseek function that is consistent with fseeko.  */
++   /* In order to avoid that fseek gets defined as a macro here, the
++      developer can request the 'fseek' module.  */
++#  if !GNULIB_defined_fseek_function
++#   undef fseek
++#   define fseek rpl_fseek
++static inline int _GL_ARG_NONNULL ((1))
++rpl_fseek (FILE *fp, long offset, int whence)
++{
++#   if @REPLACE_FSEEKO@
++  return rpl_fseeko (fp, offset, whence);
++#   else
++  return fseeko (fp, offset, whence);
++#   endif
++}
++#   define GNULIB_defined_fseek_function 1
++#  endif
++# endif
+ #elif defined GNULIB_POSIXCHECK
+ # define _GL_FSEEK_WARN /* Category 1, above.  */
+ # undef fseek
+@@ -520,6 +539,25 @@ _GL_FUNCDECL_SYS (ftello, off_t, (FILE *
+ _GL_CXXALIAS_SYS (ftello, off_t, (FILE *fp));
+ # endif
+ _GL_CXXALIASWARN (ftello);
++# if (@REPLACE_FTELLO@ || !@HAVE_FTELLO@) && !@GNULIB_FTELL@
++   /* Provide an ftell function that is consistent with ftello.  */
++   /* In order to avoid that ftell gets defined as a macro here, the
++      developer can request the 'ftell' module.  */
++#  if !GNULIB_defined_ftell_function
++#   undef ftell
++#   define ftell rpl_ftell
++static inline long _GL_ARG_NONNULL ((1))
++rpl_ftell (FILE *f)
++{
++#   if @REPLACE_FTELLO@
++  return rpl_ftello (f);
++#   else
++  return ftello (f);
++#   endif
++}
++#   define GNULIB_defined_ftell_function 1
++#  endif
++# endif
+ #elif defined GNULIB_POSIXCHECK
+ # define _GL_FTELL_WARN /* Category 1, above.  */
+ # undef ftell
+@@ -1307,6 +1345,6 @@ _GL_WARN_ON_USE (vsprintf, "vsprintf is
+ #endif
+ 
+ 
+-#endif /* _@GUARD_PREFIX@_STDIO_H */
+-#endif /* _@GUARD_PREFIX@_STDIO_H */
++#endif /* _GL_STDIO_H */
++#endif /* _GL_STDIO_H */
+ #endif
+diff -Naurp libiconv-1.14.org//srclib/stdlib.in.h libiconv-1.14/srclib/stdlib.in.h
+--- libiconv-1.14.org//srclib/stdlib.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/stdlib.in.h	2012-01-08 02:07:40.390484459 -0800
+@@ -28,13 +28,13 @@
+ #else
+ /* Normal invocation convention.  */
+ 
+-#ifndef _@GUARD_PREFIX@_STDLIB_H
++#ifndef _GL_STDLIB_H
+ 
+ /* The include_next requires a split double-inclusion guard.  */
+ #@INCLUDE_NEXT@ @NEXT_STDLIB_H@
+ 
+-#ifndef _@GUARD_PREFIX@_STDLIB_H
+-#define _@GUARD_PREFIX@_STDLIB_H
++#ifndef _GL_STDLIB_H
++#define _GL_STDLIB_H
+ 
+ /* NetBSD 5.0 mis-defines NULL.  */
+ #include <stddef.h>
+@@ -89,7 +89,11 @@ struct random_data
+ # include <unistd.h>
+ #endif
+ 
+-/* The definition of _Noreturn is copied here.  */
++#if 3 <= __GNUC__ || __GNUC__ == 2 && 8 <= __GNUC_MINOR__
++# define _GL_ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
++#else
++# define _GL_ATTRIBUTE_NORETURN
++#endif
+ 
+ /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+ 
+@@ -116,7 +120,7 @@ struct random_data
+ /* Terminate the current process with the given return code, without running
+    the 'atexit' handlers.  */
+ # if !@HAVE__EXIT@
+-_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
++_GL_FUNCDECL_SYS (_Exit, void, (int status) _GL_ATTRIBUTE_NORETURN);
+ # endif
+ _GL_CXXALIAS_SYS (_Exit, void, (int status));
+ _GL_CXXALIASWARN (_Exit);
+@@ -757,6 +761,6 @@ _GL_CXXALIASWARN (wctomb);
+ #endif
+ 
+ 
+-#endif /* _@GUARD_PREFIX@_STDLIB_H */
+-#endif /* _@GUARD_PREFIX@_STDLIB_H */
++#endif /* _GL_STDLIB_H */
++#endif /* _GL_STDLIB_H */
+ #endif
+diff -Naurp libiconv-1.14.org//srclib/strerror.c libiconv-1.14/srclib/strerror.c
+--- libiconv-1.14.org//srclib/strerror.c	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/strerror.c	2012-01-08 02:07:40.406484461 -0800
+@@ -17,54 +17,340 @@
+ 
+ #include <config.h>
+ 
+-/* Specification.  */
+ #include <string.h>
+ 
+-#include <errno.h>
+-#include <stdio.h>
+-#include <stdlib.h>
+-#include <string.h>
++#if REPLACE_STRERROR
++
++# include <errno.h>
++# include <stdio.h>
++
++# if GNULIB_defined_ESOCK /* native Windows platforms */
++#  if HAVE_WINSOCK2_H
++#   include <winsock2.h>
++#  endif
++# endif
+ 
+-#include "intprops.h"
+-#include "strerror-override.h"
+-#include "verify.h"
++# include "intprops.h"
+ 
+ /* Use the system functions, not the gnulib overrides in this file.  */
+-#undef sprintf
++# undef sprintf
++
++# undef strerror
++# if ! HAVE_DECL_STRERROR
++#  define strerror(n) NULL
++# endif
+ 
+ char *
+-strerror (int n)
+-#undef strerror
++rpl_strerror (int n)
+ {
+-  static char buf[STACKBUF_LEN];
+-  size_t len;
++  char const *msg = NULL;
++  /* These error messages are taken from glibc/sysdeps/gnu/errlist.c.  */
++  switch (n)
++    {
++# if GNULIB_defined_ETXTBSY
++    case ETXTBSY:
++      msg = "Text file busy";
++      break;
++# endif
++
++# if GNULIB_defined_ESOCK /* native Windows platforms */
++    /* EWOULDBLOCK is the same as EAGAIN.  */
++    case EINPROGRESS:
++      msg = "Operation now in progress";
++      break;
++    case EALREADY:
++      msg = "Operation already in progress";
++      break;
++    case ENOTSOCK:
++      msg = "Socket operation on non-socket";
++      break;
++    case EDESTADDRREQ:
++      msg = "Destination address required";
++      break;
++    case EMSGSIZE:
++      msg = "Message too long";
++      break;
++    case EPROTOTYPE:
++      msg = "Protocol wrong type for socket";
++      break;
++    case ENOPROTOOPT:
++      msg = "Protocol not available";
++      break;
++    case EPROTONOSUPPORT:
++      msg = "Protocol not supported";
++      break;
++    case ESOCKTNOSUPPORT:
++      msg = "Socket type not supported";
++      break;
++    case EOPNOTSUPP:
++      msg = "Operation not supported";
++      break;
++    case EPFNOSUPPORT:
++      msg = "Protocol family not supported";
++      break;
++    case EAFNOSUPPORT:
++      msg = "Address family not supported by protocol";
++      break;
++    case EADDRINUSE:
++      msg = "Address already in use";
++      break;
++    case EADDRNOTAVAIL:
++      msg = "Cannot assign requested address";
++      break;
++    case ENETDOWN:
++      msg = "Network is down";
++      break;
++    case ENETUNREACH:
++      msg = "Network is unreachable";
++      break;
++    case ENETRESET:
++      msg = "Network dropped connection on reset";
++      break;
++    case ECONNABORTED:
++      msg = "Software caused connection abort";
++      break;
++    case ECONNRESET:
++      msg = "Connection reset by peer";
++      break;
++    case ENOBUFS:
++      msg = "No buffer space available";
++      break;
++    case EISCONN:
++      msg = "Transport endpoint is already connected";
++      break;
++    case ENOTCONN:
++      msg = "Transport endpoint is not connected";
++      break;
++    case ESHUTDOWN:
++      msg = "Cannot send after transport endpoint shutdown";
++      break;
++    case ETOOMANYREFS:
++      msg = "Too many references: cannot splice";
++      break;
++    case ETIMEDOUT:
++      msg = "Connection timed out";
++      break;
++    case ECONNREFUSED:
++      msg = "Connection refused";
++      break;
++    case ELOOP:
++      msg = "Too many levels of symbolic links";
++      break;
++    case EHOSTDOWN:
++      msg = "Host is down";
++      break;
++    case EHOSTUNREACH:
++      msg = "No route to host";
++      break;
++    case EPROCLIM:
++      msg = "Too many processes";
++      break;
++    case EUSERS:
++      msg = "Too many users";
++      break;
++    case EDQUOT:
++      msg = "Disk quota exceeded";
++      break;
++    case ESTALE:
++      msg = "Stale NFS file handle";
++      break;
++    case EREMOTE:
++      msg = "Object is remote";
++      break;
++#  if HAVE_WINSOCK2_H
++    /* WSA_INVALID_HANDLE maps to EBADF */
++    /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
++    /* WSA_INVALID_PARAMETER maps to EINVAL */
++    case WSA_OPERATION_ABORTED:
++      msg = "Overlapped operation aborted";
++      break;
++    case WSA_IO_INCOMPLETE:
++      msg = "Overlapped I/O event object not in signaled state";
++      break;
++    case WSA_IO_PENDING:
++      msg = "Overlapped operations will complete later";
++      break;
++    /* WSAEINTR maps to EINTR */
++    /* WSAEBADF maps to EBADF */
++    /* WSAEACCES maps to EACCES */
++    /* WSAEFAULT maps to EFAULT */
++    /* WSAEINVAL maps to EINVAL */
++    /* WSAEMFILE maps to EMFILE */
++    /* WSAEWOULDBLOCK maps to EWOULDBLOCK */
++    /* WSAEINPROGRESS is EINPROGRESS */
++    /* WSAEALREADY is EALREADY */
++    /* WSAENOTSOCK is ENOTSOCK */
++    /* WSAEDESTADDRREQ is EDESTADDRREQ */
++    /* WSAEMSGSIZE is EMSGSIZE */
++    /* WSAEPROTOTYPE is EPROTOTYPE */
++    /* WSAENOPROTOOPT is ENOPROTOOPT */
++    /* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */
++    /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */
++    /* WSAEOPNOTSUPP is EOPNOTSUPP */
++    /* WSAEPFNOSUPPORT is EPFNOSUPPORT */
++    /* WSAEAFNOSUPPORT is EAFNOSUPPORT */
++    /* WSAEADDRINUSE is EADDRINUSE */
++    /* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */
++    /* WSAENETDOWN is ENETDOWN */
++    /* WSAENETUNREACH is ENETUNREACH */
++    /* WSAENETRESET is ENETRESET */
++    /* WSAECONNABORTED is ECONNABORTED */
++    /* WSAECONNRESET is ECONNRESET */
++    /* WSAENOBUFS is ENOBUFS */
++    /* WSAEISCONN is EISCONN */
++    /* WSAENOTCONN is ENOTCONN */
++    /* WSAESHUTDOWN is ESHUTDOWN */
++    /* WSAETOOMANYREFS is ETOOMANYREFS */
++    /* WSAETIMEDOUT is ETIMEDOUT */
++    /* WSAECONNREFUSED is ECONNREFUSED */
++    /* WSAELOOP is ELOOP */
++    /* WSAENAMETOOLONG maps to ENAMETOOLONG */
++    /* WSAEHOSTDOWN is EHOSTDOWN */
++    /* WSAEHOSTUNREACH is EHOSTUNREACH */
++    /* WSAENOTEMPTY maps to ENOTEMPTY */
++    /* WSAEPROCLIM is EPROCLIM */
++    /* WSAEUSERS is EUSERS */
++    /* WSAEDQUOT is EDQUOT */
++    /* WSAESTALE is ESTALE */
++    /* WSAEREMOTE is EREMOTE */
++    case WSASYSNOTREADY:
++      msg = "Network subsystem is unavailable";
++      break;
++    case WSAVERNOTSUPPORTED:
++      msg = "Winsock.dll version out of range";
++      break;
++    case WSANOTINITIALISED:
++      msg = "Successful WSAStartup not yet performed";
++      break;
++    case WSAEDISCON:
++      msg = "Graceful shutdown in progress";
++      break;
++    case WSAENOMORE: case WSA_E_NO_MORE:
++      msg = "No more results";
++      break;
++    case WSAECANCELLED: case WSA_E_CANCELLED:
++      msg = "Call was canceled";
++      break;
++    case WSAEINVALIDPROCTABLE:
++      msg = "Procedure call table is invalid";
++      break;
++    case WSAEINVALIDPROVIDER:
++      msg = "Service provider is invalid";
++      break;
++    case WSAEPROVIDERFAILEDINIT:
++      msg = "Service provider failed to initialize";
++      break;
++    case WSASYSCALLFAILURE:
++      msg = "System call failure";
++      break;
++    case WSASERVICE_NOT_FOUND:
++      msg = "Service not found";
++      break;
++    case WSATYPE_NOT_FOUND:
++      msg = "Class type not found";
++      break;
++    case WSAEREFUSED:
++      msg = "Database query was refused";
++      break;
++    case WSAHOST_NOT_FOUND:
++      msg = "Host not found";
++      break;
++    case WSATRY_AGAIN:
++      msg = "Nonauthoritative host not found";
++      break;
++    case WSANO_RECOVERY:
++      msg = "Nonrecoverable error";
++      break;
++    case WSANO_DATA:
++      msg = "Valid name, no data record of requested type";
++      break;
++    /* WSA_QOS_* omitted */
++#  endif
++# endif
++
++# if GNULIB_defined_ENOMSG
++    case ENOMSG:
++      msg = "No message of desired type";
++      break;
++# endif
++
++# if GNULIB_defined_EIDRM
++    case EIDRM:
++      msg = "Identifier removed";
++      break;
++# endif
++
++# if GNULIB_defined_ENOLINK
++    case ENOLINK:
++      msg = "Link has been severed";
++      break;
++# endif
++
++# if GNULIB_defined_EPROTO
++    case EPROTO:
++      msg = "Protocol error";
++      break;
++# endif
++
++# if GNULIB_defined_EMULTIHOP
++    case EMULTIHOP:
++      msg = "Multihop attempted";
++      break;
++# endif
++
++# if GNULIB_defined_EBADMSG
++    case EBADMSG:
++      msg = "Bad message";
++      break;
++# endif
++
++# if GNULIB_defined_EOVERFLOW
++    case EOVERFLOW:
++      msg = "Value too large for defined data type";
++      break;
++# endif
++
++# if GNULIB_defined_ENOTSUP
++    case ENOTSUP:
++      msg = "Not supported";
++      break;
++# endif
++
++# if GNULIB_defined_ESTALE
++    case ESTALE:
++      msg = "Stale NFS file handle";
++      break;
++# endif
++
++# if GNULIB_defined_EDQUOT
++    case EDQUOT:
++      msg = "Disk quota exceeded";
++      break;
++# endif
++
++# if GNULIB_defined_ECANCELED
++    case ECANCELED:
++      msg = "Operation canceled";
++      break;
++# endif
++    }
+ 
+-  /* Cast away const, due to the historical signature of strerror;
+-     callers should not be modifying the string.  */
+-  const char *msg = strerror_override (n);
+   if (msg)
+     return (char *) msg;
+ 
+-  msg = strerror (n);
++  {
++    char *result = strerror (n);
+ 
+-  /* Our strerror_r implementation might use the system's strerror
+-     buffer, so all other clients of strerror have to see the error
+-     copied into a buffer that we manage.  This is not thread-safe,
+-     even if the system strerror is, but portable programs shouldn't
+-     be using strerror if they care about thread-safety.  */
+-  if (!msg || !*msg)
+-    {
+-      static char const fmt[] = "Unknown error %d";
+-      verify (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
+-      sprintf (buf, fmt, n);
+-      errno = EINVAL;
+-      return buf;
+-    }
++    if (result == NULL || result[0] == '\0')
++      {
++        static char const fmt[] = "Unknown error (%d)";
++        static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)];
++        sprintf (msg_buf, fmt, n);
++        return msg_buf;
++      }
+ 
+-  /* Fix STACKBUF_LEN if this ever aborts.  */
+-  len = strlen (msg);
+-  if (sizeof buf <= len)
+-    abort ();
+-
+-  return memcpy (buf, msg, len + 1);
++    return result;
++  }
+ }
++
++#endif
+diff -Naurp libiconv-1.14.org//srclib/strerror-override.c libiconv-1.14/srclib/strerror-override.c
+--- libiconv-1.14.org//srclib/strerror-override.c	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/strerror-override.c	1969-12-31 16:00:00.000000000 -0800
+@@ -1,279 +0,0 @@
+-/* strerror-override.c --- POSIX compatible system error routine
+-
+-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+-
+-   This program is free software: you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 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/>.  */
+-
+-/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+-
+-#include <config.h>
+-
+-#include "strerror-override.h"
+-
+-#include <errno.h>
+-
+-#if GNULIB_defined_ESOCK /* native Windows platforms */
+-# if HAVE_WINSOCK2_H
+-#  include <winsock2.h>
+-# endif
+-#endif
+-
+-/* If ERRNUM maps to an errno value defined by gnulib, return a string
+-   describing the error.  Otherwise return NULL.  */
+-const char *
+-strerror_override (int errnum)
+-{
+-  /* These error messages are taken from glibc/sysdeps/gnu/errlist.c.  */
+-  switch (errnum)
+-    {
+-#if REPLACE_STRERROR_0
+-    case 0:
+-      return "Success";
+-#endif
+-
+-#if GNULIB_defined_ETXTBSY
+-    case ETXTBSY:
+-      return "Text file busy";
+-#endif
+-
+-#if GNULIB_defined_ESOCK /* native Windows platforms */
+-      /* EWOULDBLOCK is the same as EAGAIN.  */
+-    case EINPROGRESS:
+-      return "Operation now in progress";
+-    case EALREADY:
+-      return "Operation already in progress";
+-    case ENOTSOCK:
+-      return "Socket operation on non-socket";
+-    case EDESTADDRREQ:
+-      return "Destination address required";
+-    case EMSGSIZE:
+-      return "Message too long";
+-    case EPROTOTYPE:
+-      return "Protocol wrong type for socket";
+-    case ENOPROTOOPT:
+-      return "Protocol not available";
+-    case EPROTONOSUPPORT:
+-      return "Protocol not supported";
+-    case ESOCKTNOSUPPORT:
+-      return "Socket type not supported";
+-    case EOPNOTSUPP:
+-      return "Operation not supported";
+-    case EPFNOSUPPORT:
+-      return "Protocol family not supported";
+-    case EAFNOSUPPORT:
+-      return "Address family not supported by protocol";
+-    case EADDRINUSE:
+-      return "Address already in use";
+-    case EADDRNOTAVAIL:
+-      return "Cannot assign requested address";
+-    case ENETDOWN:
+-      return "Network is down";
+-    case ENETUNREACH:
+-      return "Network is unreachable";
+-    case ENETRESET:
+-      return "Network dropped connection on reset";
+-    case ECONNABORTED:
+-      return "Software caused connection abort";
+-    case ECONNRESET:
+-      return "Connection reset by peer";
+-    case ENOBUFS:
+-      return "No buffer space available";
+-    case EISCONN:
+-      return "Transport endpoint is already connected";
+-    case ENOTCONN:
+-      return "Transport endpoint is not connected";
+-    case ESHUTDOWN:
+-      return "Cannot send after transport endpoint shutdown";
+-    case ETOOMANYREFS:
+-      return "Too many references: cannot splice";
+-    case ETIMEDOUT:
+-      return "Connection timed out";
+-    case ECONNREFUSED:
+-      return "Connection refused";
+-    case ELOOP:
+-      return "Too many levels of symbolic links";
+-    case EHOSTDOWN:
+-      return "Host is down";
+-    case EHOSTUNREACH:
+-      return "No route to host";
+-    case EPROCLIM:
+-      return "Too many processes";
+-    case EUSERS:
+-      return "Too many users";
+-    case EDQUOT:
+-      return "Disk quota exceeded";
+-    case ESTALE:
+-      return "Stale NFS file handle";
+-    case EREMOTE:
+-      return "Object is remote";
+-# if HAVE_WINSOCK2_H
+-      /* WSA_INVALID_HANDLE maps to EBADF */
+-      /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */
+-      /* WSA_INVALID_PARAMETER maps to EINVAL */
+-    case WSA_OPERATION_ABORTED:
+-      return "Overlapped operation aborted";
+-    case WSA_IO_INCOMPLETE:
+-      return "Overlapped I/O event object not in signaled state";
+-    case WSA_IO_PENDING:
+-      return "Overlapped operations will complete later";
+-      /* WSAEINTR maps to EINTR */
+-      /* WSAEBADF maps to EBADF */
+-      /* WSAEACCES maps to EACCES */
+-      /* WSAEFAULT maps to EFAULT */
+-      /* WSAEINVAL maps to EINVAL */
+-      /* WSAEMFILE maps to EMFILE */
+-      /* WSAEWOULDBLOCK maps to EWOULDBLOCK */
+-      /* WSAEINPROGRESS is EINPROGRESS */
+-      /* WSAEALREADY is EALREADY */
+-      /* WSAENOTSOCK is ENOTSOCK */
+-      /* WSAEDESTADDRREQ is EDESTADDRREQ */
+-      /* WSAEMSGSIZE is EMSGSIZE */
+-      /* WSAEPROTOTYPE is EPROTOTYPE */
+-      /* WSAENOPROTOOPT is ENOPROTOOPT */
+-      /* WSAEPROTONOSUPPORT is EPROTONOSUPPORT */
+-      /* WSAESOCKTNOSUPPORT is ESOCKTNOSUPPORT */
+-      /* WSAEOPNOTSUPP is EOPNOTSUPP */
+-      /* WSAEPFNOSUPPORT is EPFNOSUPPORT */
+-      /* WSAEAFNOSUPPORT is EAFNOSUPPORT */
+-      /* WSAEADDRINUSE is EADDRINUSE */
+-      /* WSAEADDRNOTAVAIL is EADDRNOTAVAIL */
+-      /* WSAENETDOWN is ENETDOWN */
+-      /* WSAENETUNREACH is ENETUNREACH */
+-      /* WSAENETRESET is ENETRESET */
+-      /* WSAECONNABORTED is ECONNABORTED */
+-      /* WSAECONNRESET is ECONNRESET */
+-      /* WSAENOBUFS is ENOBUFS */
+-      /* WSAEISCONN is EISCONN */
+-      /* WSAENOTCONN is ENOTCONN */
+-      /* WSAESHUTDOWN is ESHUTDOWN */
+-      /* WSAETOOMANYREFS is ETOOMANYREFS */
+-      /* WSAETIMEDOUT is ETIMEDOUT */
+-      /* WSAECONNREFUSED is ECONNREFUSED */
+-      /* WSAELOOP is ELOOP */
+-      /* WSAENAMETOOLONG maps to ENAMETOOLONG */
+-      /* WSAEHOSTDOWN is EHOSTDOWN */
+-      /* WSAEHOSTUNREACH is EHOSTUNREACH */
+-      /* WSAENOTEMPTY maps to ENOTEMPTY */
+-      /* WSAEPROCLIM is EPROCLIM */
+-      /* WSAEUSERS is EUSERS */
+-      /* WSAEDQUOT is EDQUOT */
+-      /* WSAESTALE is ESTALE */
+-      /* WSAEREMOTE is EREMOTE */
+-    case WSASYSNOTREADY:
+-      return "Network subsystem is unavailable";
+-    case WSAVERNOTSUPPORTED:
+-      return "Winsock.dll version out of range";
+-    case WSANOTINITIALISED:
+-      return "Successful WSAStartup not yet performed";
+-    case WSAEDISCON:
+-      return "Graceful shutdown in progress";
+-    case WSAENOMORE: case WSA_E_NO_MORE:
+-      return "No more results";
+-    case WSAECANCELLED: case WSA_E_CANCELLED:
+-      return "Call was canceled";
+-    case WSAEINVALIDPROCTABLE:
+-      return "Procedure call table is invalid";
+-    case WSAEINVALIDPROVIDER:
+-      return "Service provider is invalid";
+-    case WSAEPROVIDERFAILEDINIT:
+-      return "Service provider failed to initialize";
+-    case WSASYSCALLFAILURE:
+-      return "System call failure";
+-    case WSASERVICE_NOT_FOUND:
+-      return "Service not found";
+-    case WSATYPE_NOT_FOUND:
+-      return "Class type not found";
+-    case WSAEREFUSED:
+-      return "Database query was refused";
+-    case WSAHOST_NOT_FOUND:
+-      return "Host not found";
+-    case WSATRY_AGAIN:
+-      return "Nonauthoritative host not found";
+-    case WSANO_RECOVERY:
+-      return "Nonrecoverable error";
+-    case WSANO_DATA:
+-      return "Valid name, no data record of requested type";
+-      /* WSA_QOS_* omitted */
+-# endif
+-#endif
+-
+-#if GNULIB_defined_ENOMSG
+-    case ENOMSG:
+-      return "No message of desired type";
+-#endif
+-
+-#if GNULIB_defined_EIDRM
+-    case EIDRM:
+-      return "Identifier removed";
+-#endif
+-
+-#if GNULIB_defined_ENOLINK
+-    case ENOLINK:
+-      return "Link has been severed";
+-#endif
+-
+-#if GNULIB_defined_EPROTO
+-    case EPROTO:
+-      return "Protocol error";
+-#endif
+-
+-#if GNULIB_defined_EMULTIHOP
+-    case EMULTIHOP:
+-      return "Multihop attempted";
+-#endif
+-
+-#if GNULIB_defined_EBADMSG
+-    case EBADMSG:
+-      return "Bad message";
+-#endif
+-
+-#if GNULIB_defined_EOVERFLOW
+-    case EOVERFLOW:
+-      return "Value too large for defined data type";
+-#endif
+-
+-#if GNULIB_defined_ENOTSUP
+-    case ENOTSUP:
+-      return "Not supported";
+-#endif
+-
+-#if GNULIB_defined_ENETRESET
+-    case ENETRESET:
+-      return "Network dropped connection on reset";
+-#endif
+-
+-#if GNULIB_defined_ECONNABORTED
+-    case ECONNABORTED:
+-      return "Software caused connection abort";
+-#endif
+-
+-#if GNULIB_defined_ESTALE
+-    case ESTALE:
+-      return "Stale NFS file handle";
+-#endif
+-
+-#if GNULIB_defined_EDQUOT
+-    case EDQUOT:
+-      return "Disk quota exceeded";
+-#endif
+-
+-#if GNULIB_defined_ECANCELED
+-    case ECANCELED:
+-      return "Operation canceled";
+-#endif
+-
+-    default:
+-      return NULL;
+-    }
+-}
+diff -Naurp libiconv-1.14.org//srclib/strerror-override.h libiconv-1.14/srclib/strerror-override.h
+--- libiconv-1.14.org//srclib/strerror-override.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/strerror-override.h	1969-12-31 16:00:00.000000000 -0800
+@@ -1,52 +0,0 @@
+-/* strerror-override.h --- POSIX compatible system error routine
+-
+-   Copyright (C) 2010-2011 Free Software Foundation, Inc.
+-
+-   This program is free software: you can redistribute it and/or modify
+-   it under the terms of the GNU General Public License as published by
+-   the Free Software Foundation; either version 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/>.  */
+-
+-#ifndef _GL_STRERROR_OVERRIDE_H
+-# define _GL_STRERROR_OVERRIDE_H
+-
+-# include <errno.h>
+-# include <stddef.h>
+-
+-/* Reasonable buffer size that should never trigger ERANGE; if this
+-   proves too small, we intentionally abort(), to remind us to fix
+-   this value.  */
+-# define STACKBUF_LEN 256
+-
+-/* If ERRNUM maps to an errno value defined by gnulib, return a string
+-   describing the error.  Otherwise return NULL.  */
+-# if REPLACE_STRERROR_0 \
+-     || GNULIB_defined_ETXTBSY \
+-     || GNULIB_defined_ESOCK \
+-     || GNULIB_defined_ENOMSG \
+-     || GNULIB_defined_EIDRM \
+-     || GNULIB_defined_ENOLINK \
+-     || GNULIB_defined_EPROTO \
+-     || GNULIB_defined_EMULTIHOP \
+-     || GNULIB_defined_EBADMSG \
+-     || GNULIB_defined_EOVERFLOW \
+-     || GNULIB_defined_ENOTSUP \
+-     || GNULIB_defined_ENETRESET \
+-     || GNULIB_defined_ECONNABORTED \
+-     || GNULIB_defined_ESTALE \
+-     || GNULIB_defined_EDQUOT \
+-     || GNULIB_defined_ECANCELED
+-extern const char *strerror_override (int errnum);
+-# else
+-#  define strerror_override(ignored) NULL
+-# endif
+-
+-#endif /* _GL_STRERROR_OVERRIDE_H */
+diff -Naurp libiconv-1.14.org//srclib/string.in.h libiconv-1.14/srclib/string.in.h
+--- libiconv-1.14.org//srclib/string.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/string.in.h	2012-01-08 02:07:40.418484461 -0800
+@@ -16,7 +16,7 @@
+    along with this program; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+ 
+-#ifndef _@GUARD_PREFIX@_STRING_H
++#ifndef _GL_STRING_H
+ 
+ #if __GNUC__ >= 3
+ @PRAGMA_SYSTEM_HEADER@
+@@ -26,8 +26,8 @@
+ /* The include_next requires a split double-inclusion guard.  */
+ #@INCLUDE_NEXT@ @NEXT_STRING_H@
+ 
+-#ifndef _@GUARD_PREFIX@_STRING_H
+-#define _@GUARD_PREFIX@_STRING_H
++#ifndef _GL_STRING_H
++#define _GL_STRING_H
+ 
+ /* NetBSD 5.0 mis-defines NULL.  */
+ #include <stddef.h>
+@@ -59,36 +59,6 @@
+ /* The definition of _GL_WARN_ON_USE is copied here.  */
+ 
+ 
+-/* Find the index of the least-significant set bit.  */
+-#if @GNULIB_FFSL@
+-# if !@HAVE_FFSL@
+-_GL_FUNCDECL_SYS (ffsl, int, (long int i));
+-# endif
+-_GL_CXXALIAS_SYS (ffsl, int, (long int i));
+-_GL_CXXALIASWARN (ffsl);
+-#elif defined GNULIB_POSIXCHECK
+-# undef ffsl
+-# if HAVE_RAW_DECL_FFSL
+-_GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
+-# endif
+-#endif
+-
+-
+-/* Find the index of the least-significant set bit.  */
+-#if @GNULIB_FFSLL@
+-# if !@HAVE_FFSLL@
+-_GL_FUNCDECL_SYS (ffsll, int, (long long int i));
+-# endif
+-_GL_CXXALIAS_SYS (ffsll, int, (long long int i));
+-_GL_CXXALIASWARN (ffsll);
+-#elif defined GNULIB_POSIXCHECK
+-# undef ffsll
+-# if HAVE_RAW_DECL_FFSLL
+-_GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
+-# endif
+-#endif
+-
+-
+ /* Return the first instance of C within N bytes of S, or NULL.  */
+ #if @GNULIB_MEMCHR@
+ # if @REPLACE_MEMCHR@
+@@ -1007,5 +977,5 @@ _GL_WARN_ON_USE (strverscmp, "strverscmp
+ #endif
+ 
+ 
+-#endif /* _@GUARD_PREFIX@_STRING_H */
+-#endif /* _@GUARD_PREFIX@_STRING_H */
++#endif /* _GL_STRING_H */
++#endif /* _GL_STRING_H */
+diff -Naurp libiconv-1.14.org//srclib/sys_stat.in.h libiconv-1.14/srclib/sys_stat.in.h
+--- libiconv-1.14.org//srclib/sys_stat.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/sys_stat.in.h	2012-01-08 02:07:40.430484461 -0800
+@@ -34,7 +34,7 @@
+ #else
+ /* Normal invocation convention.  */
+ 
+-#ifndef _@GUARD_PREFIX@_SYS_STAT_H
++#ifndef _GL_SYS_STAT_H
+ 
+ /* Get nlink_t.  */
+ #include <sys/types.h>
+@@ -45,8 +45,8 @@
+ /* The include_next requires a split double-inclusion guard.  */
+ #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@
+ 
+-#ifndef _@GUARD_PREFIX@_SYS_STAT_H
+-#define _@GUARD_PREFIX@_SYS_STAT_H
++#ifndef _GL_SYS_STAT_H
++#define _GL_SYS_STAT_H
+ 
+ /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+ 
+@@ -653,6 +653,6 @@ _GL_WARN_ON_USE (utimensat, "utimensat i
+ #endif
+ 
+ 
+-#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
+-#endif /* _@GUARD_PREFIX@_SYS_STAT_H */
++#endif /* _GL_SYS_STAT_H */
++#endif /* _GL_SYS_STAT_H */
+ #endif
+diff -Naurp libiconv-1.14.org//srclib/time.in.h libiconv-1.14/srclib/time.in.h
+--- libiconv-1.14.org//srclib/time.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/time.in.h	2012-01-08 02:07:40.438484462 -0800
+@@ -28,13 +28,13 @@
+    without adding our own declarations.  */
+ #if (defined __need_time_t || defined __need_clock_t \
+      || defined __need_timespec \
+-     || defined _@GUARD_PREFIX@_TIME_H)
++     || defined _GL_TIME_H)
+ 
+ # @INCLUDE_NEXT@ @NEXT_TIME_H@
+ 
+ #else
+ 
+-# define _@GUARD_PREFIX@_TIME_H
++# define _GL_TIME_H
+ 
+ # @INCLUDE_NEXT@ @NEXT_TIME_H@
+ 
+diff -Naurp libiconv-1.14.org//srclib/unistd.in.h libiconv-1.14/srclib/unistd.in.h
+--- libiconv-1.14.org//srclib/unistd.in.h	2011-08-07 06:42:06.000000000 -0700
++++ libiconv-1.14/srclib/unistd.in.h	2012-01-08 02:07:40.450484462 -0800
+@@ -36,7 +36,7 @@
+ # define _GL_WINSOCK2_H_WITNESS
+ 
+ /* Normal invocation.  */
+-#elif !defined _@GUARD_PREFIX@_UNISTD_H
++#elif !defined _GL_UNISTD_H
+ 
+ /* The include_next requires a split double-inclusion guard.  */
+ #if @HAVE_UNISTD_H@
+@@ -51,8 +51,8 @@
+ # undef _GL_INCLUDING_WINSOCK2_H
+ #endif
+ 
+-#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
+-#define _@GUARD_PREFIX@_UNISTD_H
++#if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H
++#define _GL_UNISTD_H
+ 
+ /* NetBSD 5.0 mis-defines NULL.  Also get size_t.  */
+ #include <stddef.h>
+@@ -117,77 +117,78 @@
+ /* The definition of _GL_WARN_ON_USE is copied here.  */
+ 
+ 
+-/* Hide some function declarations from <winsock2.h>.  */
+-
+-#if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
+-# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
+-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef socket
+-#   define socket              socket_used_without_including_sys_socket_h
+-#   undef connect
+-#   define connect             connect_used_without_including_sys_socket_h
+-#   undef accept
+-#   define accept              accept_used_without_including_sys_socket_h
+-#   undef bind
+-#   define bind                bind_used_without_including_sys_socket_h
+-#   undef getpeername
+-#   define getpeername         getpeername_used_without_including_sys_socket_h
+-#   undef getsockname
+-#   define getsockname         getsockname_used_without_including_sys_socket_h
+-#   undef getsockopt
+-#   define getsockopt          getsockopt_used_without_including_sys_socket_h
+-#   undef listen
+-#   define listen              listen_used_without_including_sys_socket_h
+-#   undef recv
+-#   define recv                recv_used_without_including_sys_socket_h
+-#   undef send
+-#   define send                send_used_without_including_sys_socket_h
+-#   undef recvfrom
+-#   define recvfrom            recvfrom_used_without_including_sys_socket_h
+-#   undef sendto
+-#   define sendto              sendto_used_without_including_sys_socket_h
+-#   undef setsockopt
+-#   define setsockopt          setsockopt_used_without_including_sys_socket_h
+-#   undef shutdown
+-#   define shutdown            shutdown_used_without_including_sys_socket_h
+-#  else
+-    _GL_WARN_ON_USE (socket,
+-                     "socket() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (connect,
+-                     "connect() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (accept,
+-                     "accept() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (bind,
+-                     "bind() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (getpeername,
+-                     "getpeername() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (getsockname,
+-                     "getsockname() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (getsockopt,
+-                     "getsockopt() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (listen,
+-                     "listen() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (recv,
+-                     "recv() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (send,
+-                     "send() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (recvfrom,
+-                     "recvfrom() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (sendto,
+-                     "sendto() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (setsockopt,
+-                     "setsockopt() used without including <sys/socket.h>");
+-    _GL_WARN_ON_USE (shutdown,
+-                     "shutdown() used without including <sys/socket.h>");
++#if @GNULIB_GETHOSTNAME@
++/* Get all possible declarations of gethostname().  */
++# if @UNISTD_H_HAVE_WINSOCK2_H@
++#  if !defined _GL_SYS_SOCKET_H
++#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
++#    undef socket
++#    define socket              socket_used_without_including_sys_socket_h
++#    undef connect
++#    define connect             connect_used_without_including_sys_socket_h
++#    undef accept
++#    define accept              accept_used_without_including_sys_socket_h
++#    undef bind
++#    define bind                bind_used_without_including_sys_socket_h
++#    undef getpeername
++#    define getpeername         getpeername_used_without_including_sys_socket_h
++#    undef getsockname
++#    define getsockname         getsockname_used_without_including_sys_socket_h
++#    undef getsockopt
++#    define getsockopt          getsockopt_used_without_including_sys_socket_h
++#    undef listen
++#    define listen              listen_used_without_including_sys_socket_h
++#    undef recv
++#    define recv                recv_used_without_including_sys_socket_h
++#    undef send
++#    define send                send_used_without_including_sys_socket_h
++#    undef recvfrom
++#    define recvfrom            recvfrom_used_without_including_sys_socket_h
++#    undef sendto
++#    define sendto              sendto_used_without_including_sys_socket_h
++#    undef setsockopt
++#    define setsockopt          setsockopt_used_without_including_sys_socket_h
++#    undef shutdown
++#    define shutdown            shutdown_used_without_including_sys_socket_h
++#   else
++     _GL_WARN_ON_USE (socket,
++                      "socket() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (connect,
++                      "connect() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (accept,
++                      "accept() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (bind,
++                      "bind() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (getpeername,
++                      "getpeername() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (getsockname,
++                      "getsockname() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (getsockopt,
++                      "getsockopt() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (listen,
++                      "listen() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (recv,
++                      "recv() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (send,
++                      "send() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (recvfrom,
++                      "recvfrom() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (sendto,
++                      "sendto() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (setsockopt,
++                      "setsockopt() used without including <sys/socket.h>");
++     _GL_WARN_ON_USE (shutdown,
++                      "shutdown() used without including <sys/socket.h>");
++#   endif
+ #  endif
+-# endif
+-# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef select
+-#   define select              select_used_without_including_sys_select_h
+-#  else
+-    _GL_WARN_ON_USE (select,
+-                     "select() used without including <sys/select.h>");
++#  if !defined _GL_SYS_SELECT_H
++#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
++#    undef select
++#    define select              select_used_without_including_sys_select_h
++#   else
++     _GL_WARN_ON_USE (select,
++                      "select() used without including <sys/select.h>");
++#   endif
+ #  endif
+ # endif
+ #endif
+@@ -1061,7 +1062,6 @@ _GL_WARN_ON_USE (pipe2, "pipe2 is unport
+    specification <http://www.opengroup.org/susv3xsh/pread.html>.  */
+ # if @REPLACE_PREAD@
+ #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef pread
+ #   define pread rpl_pread
+ #  endif
+ _GL_FUNCDECL_RPL (pread, ssize_t,
+@@ -1096,7 +1096,6 @@ _GL_WARN_ON_USE (pread, "pread is unport
+    <http://www.opengroup.org/susv3xsh/pwrite.html>.  */
+ # if @REPLACE_PWRITE@
+ #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef pwrite
+ #   define pwrite rpl_pwrite
+ #  endif
+ _GL_FUNCDECL_RPL (pwrite, ssize_t,
+@@ -1417,5 +1416,5 @@ _GL_CXXALIASWARN (write);
+ #endif
+ 
+ 
+-#endif /* _@GUARD_PREFIX@_UNISTD_H */
+-#endif /* _@GUARD_PREFIX@_UNISTD_H */
++#endif /* _GL_UNISTD_H */
++#endif /* _GL_UNISTD_H */
+diff -Naurp libiconv-1.14.org//srclib/verify.h libiconv-1.14/srclib/verify.h
+--- libiconv-1.14.org//srclib/verify.h	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srclib/verify.h	2012-01-08 02:07:40.494484464 -0800
+@@ -164,13 +164,10 @@
+     (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC)))
+ 
+ # ifdef __cplusplus
+-#  if !GNULIB_defined_struct__gl_verify_type
+ template <int w>
+   struct _gl_verify_type {
+     unsigned int _gl_verify_error_if_negative: w;
+   };
+-#   define GNULIB_defined_struct__gl_verify_type 1
+-#  endif
+ #  define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \
+     _gl_verify_type<(R) ? 1 : -1>
+ # elif defined _GL_HAVE__STATIC_ASSERT
+@@ -209,7 +206,7 @@ template <int w>
+ #  endif
+ # endif
+ 
+-/* @assert.h omit start@  */
++# ifdef _GL_VERIFY_H
+ 
+ /* Each of these macros verifies that its argument R is nonzero.  To
+    be portable, R should be an integer constant expression.  Unlike
+@@ -221,23 +218,15 @@ template <int w>
+    contexts, e.g., the top level.  */
+ 
+ /* Verify requirement R at compile-time, as an integer constant expression.
+-   Return 1.  This is equivalent to verify_expr (R, 1).
+-
+-   verify_true is obsolescent; please use verify_expr instead.  */
+-
+-# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
++   Return 1.  */
+ 
+-/* Verify requirement R at compile-time.  Return the value of the
+-   expression E.  */
+-
+-# define verify_expr(R, E) \
+-    (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
++#  define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
+ 
+ /* Verify requirement R at compile-time, as a declaration without a
+    trailing ';'.  */
+ 
+-# define verify(R) _GL_VERIFY (R, "verify (" #R ")")
++#  define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+ 
+-/* @assert.h omit end@  */
++# endif
+ 
+ #endif
+diff -Naurp libiconv-1.14.org//srcm4/canonicalize.m4 libiconv-1.14/srcm4/canonicalize.m4
+--- libiconv-1.14.org//srcm4/canonicalize.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/canonicalize.m4	2012-01-08 02:07:40.566484469 -0800
+@@ -1,4 +1,4 @@
+-# canonicalize.m4 serial 23
++# canonicalize.m4 serial 21
+ 
+ dnl Copyright (C) 2003-2007, 2009-2011 Free Software Foundation, Inc.
+ 
+@@ -10,6 +10,8 @@ dnl with or without modifications, as lo
+ # not provide or fix realpath.
+ AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
+ [
++  AC_LIBOBJ([canonicalize])
++
+   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+   AC_CHECK_FUNCS_ONCE([canonicalize_file_name])
+   AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
+@@ -28,14 +30,16 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
+   AC_REQUIRE([gl_CANONICALIZE_LGPL_SEPARATE])
+   if test $ac_cv_func_canonicalize_file_name = no; then
+     HAVE_CANONICALIZE_FILE_NAME=0
++    AC_LIBOBJ([canonicalize-lgpl])
+     if test $ac_cv_func_realpath = no; then
+       HAVE_REALPATH=0
+     elif test "$gl_cv_func_realpath_works" != yes; then
+       REPLACE_REALPATH=1
+     fi
+   elif test "$gl_cv_func_realpath_works" != yes; then
+-    REPLACE_CANONICALIZE_FILE_NAME=1
++    AC_LIBOBJ([canonicalize-lgpl])
+     REPLACE_REALPATH=1
++    REPLACE_CANONICALIZE_FILE_NAME=1
+   fi
+ ])
+ 
+diff -Naurp libiconv-1.14.org//srcm4/errno_h.m4 libiconv-1.14/srcm4/errno_h.m4
+--- libiconv-1.14.org//srcm4/errno_h.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/errno_h.m4	2012-01-08 02:07:40.590484469 -0800
+@@ -1,4 +1,4 @@
+-# errno_h.m4 serial 10
++# errno_h.m4 serial 9
+ dnl Copyright (C) 2004, 2006, 2008-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -34,12 +34,6 @@ booboo
+ #if !defined ENOTSUP
+ booboo
+ #endif
+-#if !defined ENETRESET
+-booboo
+-#endif
+-#if !defined ECONNABORTED
+-booboo
+-#endif
+ #if !defined ESTALE
+ booboo
+ #endif
+diff -Naurp libiconv-1.14.org//srcm4/error.m4 libiconv-1.14/srcm4/error.m4
+--- libiconv-1.14.org//srcm4/error.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/error.m4	2012-01-08 02:07:40.598484470 -0800
+@@ -1,4 +1,4 @@
+-#serial 14
++#serial 13
+ 
+ # Copyright (C) 1996-1998, 2001-2004, 2009-2011 Free Software Foundation, Inc.
+ #
+@@ -8,8 +8,16 @@
+ 
+ AC_DEFUN([gl_ERROR],
+ [
+-  dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
+-  dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
++  AC_FUNC_ERROR_AT_LINE
++  dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
++  gl_PREREQ_ERROR
++])
++
++# Redefine AC_FUNC_ERROR_AT_LINE, because it is no longer maintained in
++# Autoconf.
++AC_DEFUN([AC_FUNC_ERROR_AT_LINE],
++[
++  AC_LIBSOURCES([error.h, error.c])dnl
+   AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
+     [AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+@@ -17,6 +25,9 @@ AC_DEFUN([gl_ERROR],
+           [[error_at_line (0, 0, "", 0, "an error occurred");]])],
+        [ac_cv_lib_error_at_line=yes],
+        [ac_cv_lib_error_at_line=no])])
++  if test $ac_cv_lib_error_at_line = no; then
++    AC_LIBOBJ([error])
++  fi
+ ])
+ 
+ # Prerequisites of lib/error.c.
+diff -Naurp libiconv-1.14.org//srcm4/extensions.m4 libiconv-1.14/srcm4/extensions.m4
+--- libiconv-1.14.org//srcm4/extensions.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/extensions.m4	2012-01-08 02:07:40.606484471 -0800
+@@ -1,4 +1,4 @@
+-# serial 10  -*- Autoconf -*-
++# serial 9  -*- Autoconf -*-
+ # Enable extensions on systems that normally disable them.
+ 
+ # Copyright (C) 2003, 2006-2011 Free Software Foundation, Inc.
+@@ -67,10 +67,6 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+ #ifndef _ALL_SOURCE
+ # undef _ALL_SOURCE
+ #endif
+-/* Enable general extensions on MacOS X.  */
+-#ifndef _DARWIN_C_SOURCE
+-# undef _DARWIN_C_SOURCE
+-#endif
+ /* Enable GNU extensions on systems that have them.  */
+ #ifndef _GNU_SOURCE
+ # undef _GNU_SOURCE
+@@ -99,7 +95,6 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
+   test $ac_cv_safe_to_define___extensions__ = yes &&
+     AC_DEFINE([__EXTENSIONS__])
+   AC_DEFINE([_ALL_SOURCE])
+-  AC_DEFINE([_DARWIN_C_SOURCE])
+   AC_DEFINE([_GNU_SOURCE])
+   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+   AC_DEFINE([_TANDEM_SOURCE])
+diff -Naurp libiconv-1.14.org//srcm4/gnulib-cache.m4 libiconv-1.14/srcm4/gnulib-cache.m4
+--- libiconv-1.14.org//srcm4/gnulib-cache.m4	2011-08-07 06:42:11.000000000 -0700
++++ libiconv-1.14/srcm4/gnulib-cache.m4	2012-01-08 02:07:43.154484593 -0800
+@@ -15,7 +15,7 @@
+ 
+ 
+ # Specification in the form of a command-line invocation:
+-#   gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libicrt --source-base=srclib --m4-base=srcm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=Makefile.gnulib --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files binary-io error gettext gettext-h libiconv-misc mbstate memmove progname relocatable-prog safe-read sigpipe stdio stdlib strerror unistd uniwidth/width unlocked-io xalloc
++#   gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libicrt --source-base=srclib --m4-base=srcm4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --makefile-name=Makefile.gnulib --no-libtool --macro-prefix=gl --no-vc-files binary-io error gettext gettext-h libiconv-misc mbstate memmove progname relocatable relocatable-prog safe-read sigpipe stdio stdlib strerror unistd uniwidth/width unlocked-io xalloc
+ 
+ # Specification in the form of a few gnulib-tool.m4 macro invocations:
+ gl_LOCAL_DIR([gnulib-local])
+@@ -28,6 +28,7 @@ gl_MODULES([
+   mbstate
+   memmove
+   progname
++  relocatable
+   relocatable-prog
+   safe-read
+   sigpipe
+@@ -49,5 +50,4 @@ gl_LIB([libicrt])
+ gl_MAKEFILE_NAME([Makefile.gnulib])
+ gl_MACRO_PREFIX([gl])
+ gl_PO_DOMAIN([])
+-gl_WITNESS_C_DOMAIN([])
+ gl_VC_FILES([false])
+diff -Naurp libiconv-1.14.org//srcm4/gnulib-common.m4 libiconv-1.14/srcm4/gnulib-common.m4
+--- libiconv-1.14.org//srcm4/gnulib-common.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/gnulib-common.m4	2012-01-08 02:07:40.634484471 -0800
+@@ -1,4 +1,4 @@
+-# gnulib-common.m4 serial 29
++# gnulib-common.m4 serial 24
+ dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -12,19 +12,6 @@ AC_DEFUN([gl_COMMON], [
+   AC_REQUIRE([gl_COMMON_BODY])
+ ])
+ AC_DEFUN([gl_COMMON_BODY], [
+-  AH_VERBATIM([_Noreturn],
+-[/* The _Noreturn keyword of draft C1X.  */
+-#ifndef _Noreturn
+-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+-      || 0x5110 <= __SUNPRO_C)
+-#  define _Noreturn __attribute__ ((__noreturn__))
+-# elif 1200 <= _MSC_VER
+-#  define _Noreturn __declspec (noreturn)
+-# else
+-#  define _Noreturn
+-# endif
+-#endif
+-])
+   AH_VERBATIM([isoc99_inline],
+ [/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
+    the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
+@@ -47,20 +34,6 @@ AC_DEFUN([gl_COMMON_BODY], [
+ /* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
+    is a misnomer outside of parameter lists.  */
+ #define _UNUSED_PARAMETER_ _GL_UNUSED
+-
+-/* The __pure__ attribute was added in gcc 2.96.  */
+-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+-#else
+-# define _GL_ATTRIBUTE_PURE /* empty */
+-#endif
+-
+-/* The __const__ attribute was added in gcc 2.95.  */
+-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+-# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+-#else
+-# define _GL_ATTRIBUTE_CONST /* empty */
+-#endif
+ ])
+   dnl Preparation for running test programs:
+   dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
+@@ -74,49 +47,16 @@ AC_DEFUN([gl_COMMON_BODY], [
+ # expands to a C preprocessor expression that evaluates to 1 or 0, depending
+ # whether a gnulib module that has been requested shall be considered present
+ # or not.
+-m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
++AC_DEFUN([gl_MODULE_INDICATOR_CONDITION], [1])
+ 
+ # gl_MODULE_INDICATOR_SET_VARIABLE([modulename])
+ # sets the shell variable that indicates the presence of the given module to
+ # a C preprocessor expression that will evaluate to 1.
+ AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
+ [
+-  gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
+-    [GNULIB_[]m4_translit([[$1]],
+-                          [abcdefghijklmnopqrstuvwxyz./-],
+-                          [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
+-    [gl_MODULE_INDICATOR_CONDITION])
+-])
+-
+-# gl_MODULE_INDICATOR_SET_VARIABLE_AUX([variable])
+-# modifies the shell variable to include the gl_MODULE_INDICATOR_CONDITION.
+-# The shell variable's value is a C preprocessor expression that evaluates
+-# to 0 or 1.
+-AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX],
+-[
+-  m4_if(m4_defn([gl_MODULE_INDICATOR_CONDITION]), [1],
+-    [
+-     dnl Simplify the expression VALUE || 1 to 1.
+-     $1=1
+-    ],
+-    [gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([$1],
+-                                             [gl_MODULE_INDICATOR_CONDITION])])
+-])
+-
+-# gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR([variable], [condition])
+-# modifies the shell variable to include the given condition.  The shell
+-# variable's value is a C preprocessor expression that evaluates to 0 or 1.
+-AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE_AUX_OR],
+-[
+-  dnl Simplify the expression 1 || CONDITION to 1.
+-  if test "$[]$1" != 1; then
+-    dnl Simplify the expression 0 || CONDITION to CONDITION.
+-    if test "$[]$1" = 0; then
+-      $1=$2
+-    else
+-      $1="($[]$1 || $2)"
+-    fi
+-  fi
++  GNULIB_[]m4_translit([[$1]],
++    [abcdefghijklmnopqrstuvwxyz./-],
++    [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=gl_MODULE_INDICATOR_CONDITION
+ ])
+ 
+ # gl_MODULE_INDICATOR([modulename])
+@@ -211,35 +151,6 @@ m4_ifndef([AS_VAR_IF],
+ [m4_define([AS_VAR_IF],
+ [AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
+ 
+-# gl_PROG_AR_RANLIB
+-# Determines the values for AR, ARFLAGS, RANLIB that fit with the compiler.
+-AC_DEFUN([gl_PROG_AR_RANLIB],
+-[
+-  dnl Minix 3 comes with two toolchains: The Amsterdam Compiler Kit compiler
+-  dnl as "cc", and GCC as "gcc". They have different object file formats and
+-  dnl library formats. In particular, the GNU binutils programs ar, ranlib
+-  dnl produce libraries that work only with gcc, not with cc.
+-  AC_REQUIRE([AC_PROG_CC])
+-  AC_EGREP_CPP([Amsterdam],
+-    [
+-#ifdef __ACK__
+-Amsterdam
+-#endif
+-    ],
+-    [AR='cc -c.a'
+-     ARFLAGS='-o'
+-     RANLIB=':'
+-    ],
+-    [dnl Use the Automake-documented default values for AR and ARFLAGS.
+-     AR='ar'
+-     ARFLAGS='cru'
+-     dnl Use the ranlib program if it is available.
+-     AC_PROG_RANLIB
+-    ])
+-  AC_SUBST([AR])
+-  AC_SUBST([ARFLAGS])
+-])
+-
+ # AC_PROG_MKDIR_P
+ # is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
+ # for interoperability with automake-1.9.6 from autoconf-2.62.
+diff -Naurp libiconv-1.14.org//srcm4/gnulib-comp.m4 libiconv-1.14/srcm4/gnulib-comp.m4
+--- libiconv-1.14.org//srcm4/gnulib-comp.m4	2011-08-07 06:42:12.000000000 -0700
++++ libiconv-1.14/srcm4/gnulib-comp.m4	2012-01-08 02:07:43.922484630 -0800
+@@ -25,12 +25,14 @@ AC_DEFUN([gl_EARLY],
+   m4_pattern_allow([^gl_ES$])dnl a valid locale name
+   m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+   m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+-  AC_REQUIRE([gl_PROG_AR_RANLIB])
++  AC_REQUIRE([AC_PROG_RANLIB])
+   AC_REQUIRE([AM_PROG_CC_C_O])
+   # Code from module alloca-opt:
+   # Code from module allocator:
+   # Code from module areadlink:
++  # Code from module arg-nonnull:
+   # Code from module binary-io:
++  # Code from module c++defs:
+   # Code from module canonicalize-lgpl:
+   # Code from module careadlinkat:
+   # Code from module dosname:
+@@ -46,7 +48,6 @@ AC_DEFUN([gl_EARLY],
+   # Code from module havelib:
+   # Code from module include_next:
+   # Code from module intprops:
+-  # Code from module largefile:
+   # Code from module libiconv-misc:
+   # Code from module lstat:
+   # Code from module malloca:
+@@ -64,10 +65,6 @@ AC_DEFUN([gl_EARLY],
+   # Code from module signal:
+   # Code from module sigpipe:
+   # Code from module sigprocmask:
+-  # Code from module snippet/_Noreturn:
+-  # Code from module snippet/arg-nonnull:
+-  # Code from module snippet/c++defs:
+-  # Code from module snippet/warn-on-use:
+   # Code from module ssize_t:
+   # Code from module stat:
+   # Code from module stdbool:
+@@ -77,7 +74,6 @@ AC_DEFUN([gl_EARLY],
+   # Code from module stdlib:
+   # Code from module streq:
+   # Code from module strerror:
+-  # Code from module strerror-override:
+   # Code from module string:
+   # Code from module sys_stat:
+   # Code from module time:
+@@ -87,6 +83,7 @@ AC_DEFUN([gl_EARLY],
+   # Code from module uniwidth/width:
+   # Code from module unlocked-io:
+   # Code from module verify:
++  # Code from module warn-on-use:
+   # Code from module xalloc:
+   # Code from module xreadlink:
+ ])
+@@ -109,9 +106,6 @@ AC_DEFUN([gl_INIT],
+   gl_source_base='srclib'
+ gl_FUNC_ALLOCA
+ gl_CANONICALIZE_LGPL
+-if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
+-  AC_LIBOBJ([canonicalize-lgpl])
+-fi
+ gl_MODULE_INDICATOR([canonicalize-lgpl])
+ gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
+ gl_STDLIB_MODULE_INDICATOR([realpath])
+@@ -121,10 +115,6 @@ gl_ENVIRON
+ gl_UNISTD_MODULE_INDICATOR([environ])
+ gl_HEADER_ERRNO_H
+ gl_ERROR
+-if test $ac_cv_lib_error_at_line = no; then
+-  AC_LIBOBJ([error])
+-  gl_PREREQ_ERROR
+-fi
+ m4_ifdef([AM_XGETTEXT_OPTION],
+   [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
+    AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
+@@ -134,43 +124,26 @@ AM_GNU_GETTEXT_VERSION([0.18.1])
+ AC_SUBST([LIBINTL])
+ AC_SUBST([LTLIBINTL])
+ gl_FUNC_LSTAT
+-if test $REPLACE_LSTAT = 1; then
+-  AC_LIBOBJ([lstat])
+-  gl_PREREQ_LSTAT
+-fi
+ gl_SYS_STAT_MODULE_INDICATOR([lstat])
+ gl_MALLOCA
+ AC_TYPE_MBSTATE_T
+ gl_FUNC_MEMMOVE
+-if test $ac_cv_func_memmove = no; then
+-  AC_LIBOBJ([memmove])
+-  gl_PREREQ_MEMMOVE
+-fi
+ gl_MULTIARCH
+ gl_PATHMAX
+ AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
+ AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
+ gl_FUNC_READ
+-if test $REPLACE_READ = 1; then
+-  AC_LIBOBJ([read])
+-fi
+ gl_UNISTD_MODULE_INDICATOR([read])
+ gl_FUNC_READLINK
+-if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
+-  AC_LIBOBJ([readlink])
+-  gl_PREREQ_READLINK
+-fi
+ gl_UNISTD_MODULE_INDICATOR([readlink])
+ gl_RELOCATABLE([$gl_source_base])
+-if test $RELOCATABLE = yes; then
+-  AC_LIBOBJ([progreloc])
+-fi
+ gl_FUNC_READLINK_SEPARATE
+ gl_CANONICALIZE_LGPL_SEPARATE
+ gl_MALLOCA
+-gl_RELOCATABLE_LIBRARY
++gl_RELOCATABLE_LIBRARY_SEPARATE
+ gl_FUNC_SETENV_SEPARATE
+-gl_PREREQ_SAFE_READ
++gl_FUNC_STRERROR_SEPARATE
++gl_SAFE_READ
+ gl_SIGNAL_H
+ gl_SIGNAL_SIGPIPE
+ dnl Define the C macro GNULIB_SIGPIPE to 1.
+@@ -186,17 +159,9 @@ dnl Define the substituted variable GNUL
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ GNULIB_UNISTD_H_SIGPIPE=1
+ gl_SIGNALBLOCKING
+-if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+-  AC_LIBOBJ([sigprocmask])
+-  gl_PREREQ_SIGPROCMASK
+-fi
+ gl_SIGNAL_MODULE_INDICATOR([sigprocmask])
+ gt_TYPE_SSIZE_T
+ gl_FUNC_STAT
+-if test $REPLACE_STAT = 1; then
+-  AC_LIBOBJ([stat])
+-  gl_PREREQ_STAT
+-fi
+ gl_SYS_STAT_MODULE_INDICATOR([stat])
+ AM_STDBOOL_H
+ gl_STDDEF_H
+@@ -204,17 +169,7 @@ gl_STDINT_H
+ gl_STDIO_H
+ gl_STDLIB_H
+ gl_FUNC_STRERROR
+-if test $REPLACE_STRERROR = 1; then
+-  AC_LIBOBJ([strerror])
+-fi
+-gl_MODULE_INDICATOR([strerror])
+ gl_STRING_MODULE_INDICATOR([strerror])
+-AC_REQUIRE([gl_HEADER_ERRNO_H])
+-AC_REQUIRE([gl_FUNC_STRERROR_0])
+-if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+-  AC_LIBOBJ([strerror-override])
+-  gl_PREREQ_SYS_H_WINSOCK2
+-fi
+ gl_HEADER_STRING_H
+ gl_HEADER_SYS_STAT_H
+ AC_PROG_MKDIR_P
+@@ -364,14 +319,13 @@ AC_DEFUN([gltests_LIBSOURCES], [
+ # This macro records the list of files which have been installed by
+ # gnulib-tool and may be removed by future gnulib-tool invocations.
+ AC_DEFUN([gl_FILE_LIST], [
++  build-aux/arg-nonnull.h
++  build-aux/c++defs.h
+   build-aux/config.libpath
+   build-aux/config.rpath
+   build-aux/install-reloc
+   build-aux/reloc-ldflags
+-  build-aux/snippet/_Noreturn.h
+-  build-aux/snippet/arg-nonnull.h
+-  build-aux/snippet/c++defs.h
+-  build-aux/snippet/warn-on-use.h
++  build-aux/warn-on-use.h
+   doc/relocatable.texi
+   lib/alloca.in.h
+   lib/allocator.c
+@@ -419,8 +373,6 @@ AC_DEFUN([gl_FILE_LIST], [
+   lib/stdio.in.h
+   lib/stdlib.in.h
+   lib/streq.h
+-  lib/strerror-override.c
+-  lib/strerror-override.h
+   lib/strerror.c
+   lib/string.in.h
+   lib/sys_stat.in.h
+@@ -463,7 +415,6 @@ AC_DEFUN([gl_FILE_LIST], [
+   m4/intmax.m4
+   m4/inttypes-pri.m4
+   m4/inttypes_h.m4
+-  m4/largefile.m4
+   m4/lcmessage.m4
+   m4/lib-ld.m4
+   m4/lib-link.m4
+@@ -502,7 +453,6 @@ AC_DEFUN([gl_FILE_LIST], [
+   m4/stdlib_h.m4
+   m4/strerror.m4
+   m4/string_h.m4
+-  m4/sys_socket_h.m4
+   m4/sys_stat_h.m4
+   m4/threadlib.m4
+   m4/time_h.m4
+diff -Naurp libiconv-1.14.org//srcm4/include_next.m4 libiconv-1.14/srcm4/include_next.m4
+--- libiconv-1.14.org//srcm4/include_next.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/include_next.m4	2012-01-08 02:07:40.650484472 -0800
+@@ -1,4 +1,4 @@
+-# include_next.m4 serial 20
++# include_next.m4 serial 18
+ dnl Copyright (C) 2006-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -175,13 +175,11 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
+     [AC_CHECK_HEADERS_ONCE([$1])
+     ])
+ 
+-dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
+-dnl until we can assume autoconf 2.64 or newer.
+   m4_foreach_w([gl_HEADER_NAME], [$1],
+     [AS_VAR_PUSHDEF([gl_next_header],
+                     [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
+      if test $gl_cv_have_include_next = yes; then
+-       AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
++       AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+      else
+        AC_CACHE_CHECK(
+          [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+@@ -210,7 +208,7 @@ dnl until we can assume autoconf 2.64 or
+                dnl eval is necessary to expand gl_absname_cpp.
+                dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+                dnl so use subshell.
+-               AS_VAR_SET(gl_next_header,
++               AS_VAR_SET([gl_next_header],
+                  ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+                   sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
+                     s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
+@@ -220,20 +218,20 @@ dnl until we can assume autoconf 2.64 or
+                   }'`'"'])
+           m4_if([$2], [check],
+             [else
+-               AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
++               AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+              fi
+             ])
+          ])
+      fi
+      AC_SUBST(
+        AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
+-       [AS_VAR_GET(gl_next_header)])
++       [AS_VAR_GET([gl_next_header])])
+      if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then
+        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+        gl_next_as_first_directive='<'gl_HEADER_NAME'>'
+      else
+        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+-       gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
++       gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
+      fi
+      AC_SUBST(
+        AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
+diff -Naurp libiconv-1.14.org//srcm4/largefile.m4 libiconv-1.14/srcm4/largefile.m4
+--- libiconv-1.14.org//srcm4/largefile.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/largefile.m4	1969-12-31 16:00:00.000000000 -0800
+@@ -1,104 +0,0 @@
+-# Enable large files on systems where this is not the default.
+-
+-# Copyright 1992-1996, 1998-2011 Free Software Foundation, Inc.
+-# This file is free software; the Free Software Foundation
+-# gives unlimited permission to copy and/or distribute it,
+-# with or without modifications, as long as this notice is preserved.
+-
+-# The following implementation works around a problem in autoconf <= 2.68;
+-# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5.
+-m4_version_prereq([2.69], [] ,[
+-
+-# _AC_SYS_LARGEFILE_TEST_INCLUDES
+-# -------------------------------
+-m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
+-[@%:@include <sys/types.h>
+- /* Check that off_t can represent 2**63 - 1 correctly.
+-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+-    since some C++ compilers masquerading as C compilers
+-    incorrectly reject 9223372036854775807.  */
+-@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+-  int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
+-		       && LARGE_OFF_T % 2147483647 == 1)
+-		      ? 1 : -1]];[]dnl
+-])
+-
+-
+-# _AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE,
+-#				CACHE-VAR,
+-#				DESCRIPTION,
+-#				PROLOGUE, [FUNCTION-BODY])
+-# --------------------------------------------------------
+-m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
+-[AC_CACHE_CHECK([for $1 value needed for large files], [$3],
+-[while :; do
+-  m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+-    [AC_LANG_PROGRAM([$5], [$6])],
+-    [$3=no; break])
+-  m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
+-    [AC_LANG_PROGRAM([@%:@define $1 $2
+-$5], [$6])],
+-    [$3=$2; break])
+-  $3=unknown
+-  break
+-done])
+-case $$3 in #(
+-  no | unknown) ;;
+-  *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]);;
+-esac
+-rm -rf conftest*[]dnl
+-])# _AC_SYS_LARGEFILE_MACRO_VALUE
+-
+-
+-# AC_SYS_LARGEFILE
+-# ----------------
+-# By default, many hosts won't let programs access large files;
+-# one must use special compiler options to get large-file access to work.
+-# For more details about this brain damage please see:
+-# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
+-AC_DEFUN([AC_SYS_LARGEFILE],
+-[AC_ARG_ENABLE(largefile,
+-	       [  --disable-largefile     omit support for large files])
+-if test "$enable_largefile" != no; then
+-
+-  AC_CACHE_CHECK([for special C compiler options needed for large files],
+-    ac_cv_sys_largefile_CC,
+-    [ac_cv_sys_largefile_CC=no
+-     if test "$GCC" != yes; then
+-       ac_save_CC=$CC
+-       while :; do
+-	 # IRIX 6.2 and later do not support large files by default,
+-	 # so use the C compiler's -n32 option if that helps.
+-	 AC_LANG_CONFTEST([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_INCLUDES])])
+-	 AC_COMPILE_IFELSE([], [break])
+-	 CC="$CC -n32"
+-	 AC_COMPILE_IFELSE([], [ac_cv_sys_largefile_CC=' -n32'; break])
+-	 break
+-       done
+-       CC=$ac_save_CC
+-       rm -f conftest.$ac_ext
+-    fi])
+-  if test "$ac_cv_sys_largefile_CC" != no; then
+-    CC=$CC$ac_cv_sys_largefile_CC
+-  fi
+-
+-  _AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64,
+-    ac_cv_sys_file_offset_bits,
+-    [Number of bits in a file offset, on hosts where this is settable.],
+-    [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+-  if test $ac_cv_sys_file_offset_bits = unknown; then
+-    _AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1,
+-      ac_cv_sys_large_files,
+-      [Define for large files, on AIX-style hosts.],
+-      [_AC_SYS_LARGEFILE_TEST_INCLUDES])
+-  fi
+-
+-  AH_VERBATIM([_DARWIN_USE_64_BIT_INODE],
+-[/* Enable large inode numbers on Mac OS X.  */
+-#ifndef _DARWIN_USE_64_BIT_INODE
+-# define _DARWIN_USE_64_BIT_INODE 1
+-#endif])
+-fi
+-])# AC_SYS_LARGEFILE
+-
+-])# m4_version_prereq 2.69
+diff -Naurp libiconv-1.14.org//srcm4/lstat.m4 libiconv-1.14/srcm4/lstat.m4
+--- libiconv-1.14.org//srcm4/lstat.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/lstat.m4	2012-01-08 02:07:40.722484476 -0800
+@@ -1,4 +1,4 @@
+-# serial 23
++# serial 21
+ 
+ # Copyright (C) 1997-2001, 2003-2011 Free Software Foundation, Inc.
+ #
+@@ -15,28 +15,24 @@ AC_DEFUN([gl_FUNC_LSTAT],
+   dnl "#define lstat stat", and lstat.c is a no-op.
+   AC_CHECK_FUNCS_ONCE([lstat])
+   if test $ac_cv_func_lstat = yes; then
+-    AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+-    if test $gl_cv_func_lstat_dereferences_slashed_symlink = no; then
++    AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
++    if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
++      dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]).
+       REPLACE_LSTAT=1
+     fi
++    # Prerequisites of lib/lstat.c.
++    AC_REQUIRE([AC_C_INLINE])
+   else
+     HAVE_LSTAT=0
+   fi
+ ])
+ 
+-# Prerequisites of lib/lstat.c.
+-AC_DEFUN([gl_PREREQ_LSTAT],
++# Redefine AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, because it is no longer
++# maintained in Autoconf.
++AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
+ [
+-  AC_REQUIRE([AC_C_INLINE])
+-  :
+-])
+-
+-AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
+-[
+-  dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
+-  dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
+   AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
+-    [gl_cv_func_lstat_dereferences_slashed_symlink],
++    [ac_cv_func_lstat_dereferences_slashed_symlink],
+     [rm -f conftest.sym conftest.file
+      echo >conftest.file
+      if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then
+@@ -49,22 +45,25 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_
+                  have to compile and use the lstat wrapper.  */
+               return lstat ("conftest.sym/", &sbuf) == 0;
+             ]])],
+-         [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
+-         [gl_cv_func_lstat_dereferences_slashed_symlink=no],
++         [ac_cv_func_lstat_dereferences_slashed_symlink=yes],
++         [ac_cv_func_lstat_dereferences_slashed_symlink=no],
+          [# When cross-compiling, be pessimistic so we will end up using the
+           # replacement version of lstat that checks for trailing slashes and
+           # calls lstat a second time when necessary.
+-          gl_cv_func_lstat_dereferences_slashed_symlink=no
++          ac_cv_func_lstat_dereferences_slashed_symlink=no
+          ])
+      else
+        # If the 'ln -s' command failed, then we probably don't even
+        # have an lstat function.
+-       gl_cv_func_lstat_dereferences_slashed_symlink=no
++       ac_cv_func_lstat_dereferences_slashed_symlink=no
+      fi
+      rm -f conftest.sym conftest.file
+     ])
+-  test $gl_cv_func_lstat_dereferences_slashed_symlink = yes &&
++  test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+     AC_DEFINE_UNQUOTED([LSTAT_FOLLOWS_SLASHED_SYMLINK], [1],
+       [Define to 1 if `lstat' dereferences a symlink specified
+        with a trailing slash.])
++  if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then
++    AC_LIBOBJ([lstat])
++  fi
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/memmove.m4 libiconv-1.14/srcm4/memmove.m4
+--- libiconv-1.14.org//srcm4/memmove.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/memmove.m4	2012-01-08 02:07:40.738484477 -0800
+@@ -1,4 +1,4 @@
+-# memmove.m4 serial 4
++# memmove.m4 serial 3
+ dnl Copyright (C) 2002, 2009-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -6,7 +6,10 @@ dnl with or without modifications, as lo
+ 
+ AC_DEFUN([gl_FUNC_MEMMOVE],
+ [
+-  AC_CHECK_FUNCS([memmove])
++  AC_REPLACE_FUNCS([memmove])
++  if test $ac_cv_func_memmove = no; then
++    gl_PREREQ_MEMMOVE
++  fi
+ ])
+ 
+ # Prerequisites of lib/memmove.c.
+diff -Naurp libiconv-1.14.org//srcm4/pathmax.m4 libiconv-1.14/srcm4/pathmax.m4
+--- libiconv-1.14.org//srcm4/pathmax.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/pathmax.m4	2012-01-08 02:07:40.758484478 -0800
+@@ -1,4 +1,4 @@
+-# pathmax.m4 serial 9
++# pathmax.m4 serial 8
+ dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
+ dnl Inc.
+ dnl This file is free software; the Free Software Foundation
+@@ -8,5 +8,6 @@ dnl with or without modifications, as lo
+ AC_DEFUN([gl_PATHMAX],
+ [
+   dnl Prerequisites of lib/pathmax.h.
++  AC_CHECK_FUNCS_ONCE([pathconf])
+   AC_CHECK_HEADERS_ONCE([sys/param.h])
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/po.m4 libiconv-1.14/srcm4/po.m4
+--- libiconv-1.14.org//srcm4/po.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/po.m4	2012-01-08 02:07:40.766484477 -0800
+@@ -1,4 +1,4 @@
+-# po.m4 serial 17a
++# po.m4 serial 17 (gettext-0.18)
+ dnl Copyright (C) 1995-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -118,8 +118,7 @@ changequote([,])dnl
+         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+           rm -f "$ac_dir/POTFILES"
+           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+-          gt_tab=`printf '\t'`
+-          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
++          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ 	]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+           POMAKEFILEDEPS="POTFILES.in"
+           # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+           # on $ac_dir but don't depend on user-specified configuration
+@@ -255,7 +254,6 @@ EOT
+   fi
+ 
+   # A sed script that extracts the value of VARIABLE from a Makefile.
+-  tab=`printf '\t'`
+   sed_x_variable='
+ # Test if the hold space is empty.
+ x
+@@ -263,9 +261,9 @@ s/P/P/
+ x
+ ta
+ # Yes it was empty. Look if we have the expected variable definition.
+-/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
++/^[	 ]*VARIABLE[	 ]*=/{
+   # Seen the first line of the variable definition.
+-  s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
++  s/^[	 ]*VARIABLE[	 ]*=//
+   ba
+ }
+ bd
+@@ -407,15 +405,14 @@ changequote([,])dnl
+   fi
+ 
+   sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+-  tab=`printf '\t'`
+   if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
+     # Add dependencies that cannot be formulated as a simple suffix rule.
+     for lang in $ALL_LINGUAS; do
+       frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+       cat >> "$ac_file.tmp" <<EOF
+ $frobbedlang.msg: $lang.po
+-${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+-${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
++	@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
++	\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+ EOF
+     done
+   fi
+@@ -425,8 +422,8 @@ EOF
+       frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+       cat >> "$ac_file.tmp" <<EOF
+ $frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+-${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+-${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
++	@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
++	\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+ EOF
+     done
+   fi
+diff -Naurp libiconv-1.14.org//srcm4/readlink.m4 libiconv-1.14/srcm4/readlink.m4
+--- libiconv-1.14.org//srcm4/readlink.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/readlink.m4	2012-01-08 02:07:40.790484479 -0800
+@@ -1,4 +1,4 @@
+-# readlink.m4 serial 11
++# readlink.m4 serial 10
+ dnl Copyright (C) 2003, 2007, 2009-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -10,6 +10,8 @@ AC_DEFUN([gl_FUNC_READLINK],
+   AC_CHECK_FUNCS_ONCE([readlink])
+   if test $ac_cv_func_readlink = no; then
+     HAVE_READLINK=0
++    AC_LIBOBJ([readlink])
++    gl_PREREQ_READLINK
+   else
+     AC_CACHE_CHECK([whether readlink signature is correct],
+       [gl_cv_decl_readlink_works],
+@@ -38,8 +40,10 @@ AC_DEFUN([gl_FUNC_READLINK],
+       AC_DEFINE([READLINK_TRAILING_SLASH_BUG], [1], [Define to 1 if readlink
+         fails to recognize a trailing slash.])
+       REPLACE_READLINK=1
++      AC_LIBOBJ([readlink])
+     elif test "$gl_cv_decl_readlink_works" != yes; then
+       REPLACE_READLINK=1
++      AC_LIBOBJ([readlink])
+     fi
+   fi
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/read.m4 libiconv-1.14/srcm4/read.m4
+--- libiconv-1.14.org//srcm4/read.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/read.m4	2012-01-08 02:07:40.782484478 -0800
+@@ -1,4 +1,4 @@
+-# read.m4 serial 2
++# read.m4 serial 1
+ dnl Copyright (C) 2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -14,6 +14,7 @@ AC_DEFUN([gl_FUNC_READ],
+     gl_NONBLOCKING_IO
+     if test $gl_cv_have_nonblocking != yes; then
+       REPLACE_READ=1
++      AC_LIBOBJ([read])
+     fi
+   ])
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/relocatable-lib.m4 libiconv-1.14/srcm4/relocatable-lib.m4
+--- libiconv-1.14.org//srcm4/relocatable-lib.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/relocatable-lib.m4	2012-01-08 02:07:40.798484480 -0800
+@@ -1,4 +1,4 @@
+-# relocatable-lib.m4 serial 6
++# relocatable-lib.m4 serial 5
+ dnl Copyright (C) 2003, 2005-2007, 2009-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -10,6 +10,9 @@ dnl Support for relocatable libraries.
+ AC_DEFUN([gl_RELOCATABLE_LIBRARY],
+ [
+   AC_REQUIRE([gl_RELOCATABLE_LIBRARY_BODY])
++  if test $RELOCATABLE = yes; then
++    AC_LIBOBJ([relocatable])
++  fi
+ ])
+ AC_DEFUN([gl_RELOCATABLE_LIBRARY_BODY],
+ [
+@@ -29,6 +32,13 @@ AC_DEFUN([gl_RELOCATABLE_LIBRARY_BODY],
+   fi
+ ])
+ 
++dnl Like gl_RELOCATABLE_LIBRARY, except prepare for separate compilation
++dnl (no AC_LIBOBJ).
++AC_DEFUN([gl_RELOCATABLE_LIBRARY_SEPARATE],
++[
++  AC_REQUIRE([gl_RELOCATABLE_LIBRARY_BODY])
++])
++
+ dnl Support for relocatable packages for which it is a nop.
+ AC_DEFUN([gl_RELOCATABLE_NOP],
+ [
+diff -Naurp libiconv-1.14.org//srcm4/relocatable.m4 libiconv-1.14/srcm4/relocatable.m4
+--- libiconv-1.14.org//srcm4/relocatable.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/relocatable.m4	2012-01-08 02:07:40.802484479 -0800
+@@ -1,4 +1,4 @@
+-# relocatable.m4 serial 17
++# relocatable.m4 serial 16
+ dnl Copyright (C) 2003, 2005-2007, 2009-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -14,6 +14,9 @@ AC_DEFUN([gl_RELOCATABLE],
+ [
+   AC_REQUIRE([gl_RELOCATABLE_BODY])
+   gl_RELOCATABLE_LIBRARY
++  if test $RELOCATABLE = yes; then
++    AC_LIBOBJ([progreloc])
++  fi
+   : ${RELOCATABLE_CONFIG_H_DIR='$(top_builddir)'}
+   RELOCATABLE_SRC_DIR="\$(top_srcdir)/$gl_source_base"
+   RELOCATABLE_BUILD_DIR="\$(top_builddir)/$gl_source_base"
+diff -Naurp libiconv-1.14.org//srcm4/safe-read.m4 libiconv-1.14/srcm4/safe-read.m4
+--- libiconv-1.14.org//srcm4/safe-read.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/safe-read.m4	2012-01-08 02:07:40.810484480 -0800
+@@ -1,10 +1,17 @@
+-# safe-read.m4 serial 6
++# safe-read.m4 serial 5
+ dnl Copyright (C) 2002-2003, 2005-2006, 2009-2011 Free Software Foundation,
+ dnl Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+ dnl with or without modifications, as long as this notice is preserved.
+ 
++AC_DEFUN([gl_SAFE_READ],
++[
++  AC_LIBOBJ([safe-read])
++
++  gl_PREREQ_SAFE_READ
++])
++
+ # Prerequisites of lib/safe-read.c.
+ AC_DEFUN([gl_PREREQ_SAFE_READ],
+ [
+diff -Naurp libiconv-1.14.org//srcm4/setenv.m4 libiconv-1.14/srcm4/setenv.m4
+--- libiconv-1.14.org//srcm4/setenv.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/setenv.m4	2012-01-08 02:07:40.818484481 -0800
+@@ -1,4 +1,4 @@
+-# setenv.m4 serial 24
++# setenv.m4 serial 22
+ dnl Copyright (C) 2001-2004, 2006-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -38,6 +38,9 @@ AC_DEFUN([gl_FUNC_SETENV],
+       REPLACE_SETENV=1
+     fi
+   fi
++  if test $HAVE_SETENV$REPLACE_SETENV != 10; then
++    AC_LIBOBJ([setenv])
++  fi
+ ])
+ 
+ # Like gl_FUNC_SETENV, except prepare for separate compilation
+@@ -62,9 +65,9 @@ AC_DEFUN([gl_FUNC_UNSETENV],
+   fi
+   AC_CHECK_FUNCS([unsetenv])
+   if test $ac_cv_func_unsetenv = no; then
+-    HAVE_UNSETENV=0
++    AC_LIBOBJ([unsetenv])
++    gl_PREREQ_UNSETENV
+   else
+-    HAVE_UNSETENV=1
+     dnl Some BSDs return void, failing to do error checking.
+     AC_CACHE_CHECK([for unsetenv() return type], [gt_cv_func_unsetenv_ret],
+       [AC_COMPILE_IFELSE(
+@@ -90,6 +93,7 @@ int unsetenv();
+       AC_DEFINE([VOID_UNSETENV], [1], [Define to 1 if unsetenv returns void
+        instead of int.])
+       REPLACE_UNSETENV=1
++      AC_LIBOBJ([unsetenv])
+     fi
+ 
+     dnl Solaris 10 unsetenv does not remove all copies of a name.
+@@ -122,6 +126,7 @@ int unsetenv();
+       [gl_cv_func_unsetenv_works="guessing no"])])
+     if test "$gl_cv_func_unsetenv_works" != yes; then
+       REPLACE_UNSETENV=1
++      AC_LIBOBJ([unsetenv])
+     fi
+   fi
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/signalblocking.m4 libiconv-1.14/srcm4/signalblocking.m4
+--- libiconv-1.14.org//srcm4/signalblocking.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/signalblocking.m4	2012-01-08 02:07:40.834484482 -0800
+@@ -1,4 +1,4 @@
+-# signalblocking.m4 serial 12
++# signalblocking.m4 serial 10
+ dnl Copyright (C) 2001-2002, 2006-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -12,14 +12,31 @@ dnl with or without modifications, as lo
+ AC_DEFUN([gl_SIGNALBLOCKING],
+ [
+   AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+-  AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
+-  if test $gl_cv_type_sigset_t = yes; then
++  signals_not_posix=
++  AC_EGREP_HEADER([sigset_t], [signal.h], , [signals_not_posix=1])
++  if test -z "$signals_not_posix"; then
+     AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1])
+   fi
+   if test -z "$gl_cv_func_sigprocmask"; then
+     HAVE_POSIX_SIGNALBLOCKING=0
++    AC_LIBOBJ([sigprocmask])
++    gl_PREREQ_SIGPROCMASK
+   fi
+ ])
+ 
+-# Prerequisites of lib/sigprocmask.c.
+-AC_DEFUN([gl_PREREQ_SIGPROCMASK], [:])
++# Prerequisites of the part of lib/signal.in.h and of lib/sigprocmask.c.
++AC_DEFUN([gl_PREREQ_SIGPROCMASK],
++[
++  AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
++  AC_CHECK_TYPES([sigset_t],
++    [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no],
++    [#include <signal.h>
++/* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.  */
++#include <sys/types.h>])
++  if test $gl_cv_type_sigset_t != yes; then
++    HAVE_SIGSET_T=0
++  fi
++  dnl HAVE_SIGSET_T is 1 if the system lacks the sigprocmask function but has
++  dnl the sigset_t type.
++  AC_SUBST([HAVE_SIGSET_T])
++])
+diff -Naurp libiconv-1.14.org//srcm4/signal_h.m4 libiconv-1.14/srcm4/signal_h.m4
+--- libiconv-1.14.org//srcm4/signal_h.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/signal_h.m4	2012-01-08 02:07:40.826484480 -0800
+@@ -1,4 +1,4 @@
+-# signal_h.m4 serial 16
++# signal_h.m4 serial 12
+ dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -7,7 +7,6 @@ dnl with or without modifications, as lo
+ AC_DEFUN([gl_SIGNAL_H],
+ [
+   AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+-  AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
+   gl_NEXT_HEADERS([signal.h])
+ 
+ # AIX declares sig_atomic_t to already include volatile, and C89 compilers
+@@ -28,25 +27,10 @@ AC_DEFUN([gl_SIGNAL_H],
+   dnl Check for declarations of anything we want to poison if the
+   dnl corresponding gnulib module is not in use.
+   gl_WARN_ON_USE_PREPARE([[#include <signal.h>
+-    ]], [pthread_sigmask sigaction
+-    sigaddset sigdelset sigemptyset sigfillset sigismember
++    ]], [sigaction sigaddset sigdelset sigemptyset sigfillset sigismember
+     sigpending sigprocmask])
+ ])
+ 
+-AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
+-[
+-  AC_CHECK_TYPES([sigset_t],
+-    [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no],
+-    [[
+-      #include <signal.h>
+-      /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.  */
+-      #include <sys/types.h>
+-    ]])
+-  if test $gl_cv_type_sigset_t != yes; then
+-    HAVE_SIGSET_T=0
+-  fi
+-])
+-
+ AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
+ [
+   dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+@@ -58,13 +42,11 @@ AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
+ 
+ AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
+ [
+-  GNULIB_PTHREAD_SIGMASK=0;    AC_SUBST([GNULIB_PTHREAD_SIGMASK])
+   GNULIB_SIGNAL_H_SIGPIPE=0;   AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE])
+   GNULIB_SIGPROCMASK=0;        AC_SUBST([GNULIB_SIGPROCMASK])
+   GNULIB_SIGACTION=0;          AC_SUBST([GNULIB_SIGACTION])
+   dnl Assume proper GNU behavior unless another module says otherwise.
+   HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING])
+-  HAVE_PTHREAD_SIGMASK=1;      AC_SUBST([HAVE_PTHREAD_SIGMASK])
+   HAVE_SIGSET_T=1;             AC_SUBST([HAVE_SIGSET_T])
+   HAVE_SIGINFO_T=1;            AC_SUBST([HAVE_SIGINFO_T])
+   HAVE_SIGACTION=1;            AC_SUBST([HAVE_SIGACTION])
+@@ -73,5 +55,4 @@ AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
+   HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
+                                AC_SUBST([HAVE_TYPE_VOLATILE_SIG_ATOMIC_T])
+   HAVE_SIGHANDLER_T=1;         AC_SUBST([HAVE_SIGHANDLER_T])
+-  REPLACE_PTHREAD_SIGMASK=0;   AC_SUBST([REPLACE_PTHREAD_SIGMASK])
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/stat.m4 libiconv-1.14/srcm4/stat.m4
+--- libiconv-1.14.org//srcm4/stat.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/stat.m4	2012-01-08 02:07:40.854484483 -0800
+@@ -1,4 +1,4 @@
+-# serial 8
++# serial 7
+ 
+ # Copyright (C) 2009-2011 Free Software Foundation, Inc.
+ #
+@@ -58,11 +58,9 @@ AC_DEFUN([gl_FUNC_STAT],
+       AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
+         help when passed a file name with a trailing slash]);;
+   esac
+-])
+-
+-# Prerequisites of lib/stat.c.
+-AC_DEFUN([gl_PREREQ_STAT],
+-[
+-  AC_REQUIRE([AC_C_INLINE])
+-  :
++  if test $REPLACE_STAT = 1; then
++    AC_LIBOBJ([stat])
++    dnl Prerequisites of lib/stat.c.
++    AC_REQUIRE([AC_C_INLINE])
++  fi
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/strerror.m4 libiconv-1.14/srcm4/strerror.m4
+--- libiconv-1.14.org//srcm4/strerror.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/strerror.m4	2012-01-08 02:07:40.890484484 -0800
+@@ -1,4 +1,4 @@
+-# strerror.m4 serial 16
++# strerror.m4 serial 9
+ dnl Copyright (C) 2002, 2007-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -6,73 +6,63 @@ dnl with or without modifications, as lo
+ 
+ AC_DEFUN([gl_FUNC_STRERROR],
+ [
++  AC_REQUIRE([gl_FUNC_STRERROR_SEPARATE])
++  if test $REPLACE_STRERROR = 1; then
++    AC_LIBOBJ([strerror])
++    AC_DEFINE_UNQUOTED([REPLACE_STRERROR], [$REPLACE_STRERROR],
++      [Define this to 1 if strerror is broken.])
++  fi
++])
++
++# Like gl_FUNC_STRERROR, except prepare for separate compilation (no AC_LIBOBJ).
++AC_DEFUN([gl_FUNC_STRERROR_SEPARATE],
++[
+   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+   AC_REQUIRE([gl_HEADER_ERRNO_H])
+-  AC_REQUIRE([gl_FUNC_STRERROR_0])
+-  m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+-    AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
+-  ])
+-  if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
++  if test -z "$ERRNO_H"; then
+     AC_CACHE_CHECK([for working strerror function],
+      [gl_cv_func_working_strerror],
+      [AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#include <string.h>
+            ]],
+-           [[if (!*strerror (-2)) return 1;]])],
++           [[return !*strerror (-2);]])],
+         [gl_cv_func_working_strerror=yes],
+         [gl_cv_func_working_strerror=no],
+-        [dnl Be pessimistic on cross-compiles for now.
+-         gl_cv_func_working_strerror="guessing no"])
++        [dnl Assume crossbuild works if it compiles.
++         AC_COMPILE_IFELSE(
++           [AC_LANG_PROGRAM(
++              [[#include <string.h>
++              ]],
++              [[return !*strerror (-2);]])],
++           [gl_cv_func_working_strerror=yes],
++           [gl_cv_func_working_strerror=no])
++      ])
+     ])
+-    if test "$gl_cv_func_working_strerror" != yes; then
++    if test $gl_cv_func_working_strerror = no; then
+       dnl The system's strerror() fails to return a string for out-of-range
+       dnl integers. Replace it.
+       REPLACE_STRERROR=1
+     fi
+-    m4_ifdef([gl_FUNC_STRERROR_R_WORKS], [
+-      dnl If the system's strerror_r or __xpg_strerror_r clobbers strerror's
+-      dnl buffer, we must replace strerror.
+-      case "$gl_cv_func_strerror_r_works" in
+-        *no) REPLACE_STRERROR=1 ;;
+-      esac
+-    ])
+   else
+     dnl The system's strerror() cannot know about the new errno values we add
+-    dnl to <errno.h>, or any fix for strerror(0). Replace it.
++    dnl to <errno.h>. Replace it.
+     REPLACE_STRERROR=1
+   fi
++  if test $REPLACE_STRERROR = 1; then
++    gl_PREREQ_STRERROR
++  fi
+ ])
+ 
+-dnl Detect if strerror(0) passes (that is, does not set errno, and does not
+-dnl return a string that matches strerror(-1)).
+-AC_DEFUN([gl_FUNC_STRERROR_0],
+-[
+-  REPLACE_STRERROR_0=0
+-  AC_CACHE_CHECK([whether strerror(0) succeeds],
+-   [gl_cv_func_strerror_0_works],
+-   [AC_RUN_IFELSE(
+-      [AC_LANG_PROGRAM(
+-         [[#include <string.h>
+-           #include <errno.h>
+-         ]],
+-         [[int result = 0;
+-           char *str;
+-           errno = 0;
+-           str = strerror (0);
+-           if (!*str) result |= 1;
+-           if (errno) result |= 2;
+-           if (strstr (str, "nknown") || strstr (str, "ndefined"))
+-             result |= 4;
+-           return result;]])],
+-      [gl_cv_func_strerror_0_works=yes],
+-      [gl_cv_func_strerror_0_works=no],
+-      [dnl Be pessimistic on cross-compiles for now.
+-       gl_cv_func_strerror_0_works="guessing no"])
+-  ])
+-  if test "$gl_cv_func_strerror_0_works" != yes; then
+-    REPLACE_STRERROR_0=1
+-    AC_DEFINE([REPLACE_STRERROR_0], [1], [Define to 1 if strerror(0)
+-      does not return a message implying success.])
++# Prerequisites of lib/strerror.c.
++AC_DEFUN([gl_PREREQ_STRERROR], [
++  AC_CHECK_DECLS([strerror])
++  AC_CHECK_HEADERS_ONCE([sys/socket.h])
++  if test $ac_cv_header_sys_socket_h != yes; then
++    dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
++    dnl the check for those headers unconditional; yet cygwin reports
++    dnl that the headers are present but cannot be compiled (since on
++    dnl cygwin, all socket information should come from sys/socket.h).
++    AC_CHECK_HEADERS([winsock2.h])
+   fi
+ ])
+diff -Naurp libiconv-1.14.org//srcm4/string_h.m4 libiconv-1.14/srcm4/string_h.m4
+--- libiconv-1.14.org//srcm4/string_h.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/string_h.m4	2012-01-08 02:07:40.894484485 -0800
+@@ -5,7 +5,7 @@
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+ 
+-# serial 21
++# serial 20
+ 
+ # Written by Paul Eggert.
+ 
+@@ -27,9 +27,9 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
+   dnl guaranteed by C89.
+   gl_WARN_ON_USE_PREPARE([[#include <string.h>
+     ]],
+-    [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
+-     strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
+-     strerror_r strsignal strverscmp])
++    [memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul strdup
++     strncat strndup strnlen strpbrk strsep strcasestr strtok_r strerror_r
++     strsignal strverscmp])
+ ])
+ 
+ AC_DEFUN([gl_STRING_MODULE_INDICATOR],
+@@ -43,8 +43,6 @@ AC_DEFUN([gl_STRING_MODULE_INDICATOR],
+ 
+ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
+ [
+-  GNULIB_FFSL=0;        AC_SUBST([GNULIB_FFSL])
+-  GNULIB_FFSLL=0;       AC_SUBST([GNULIB_FFSLL])
+   GNULIB_MEMCHR=0;      AC_SUBST([GNULIB_MEMCHR])
+   GNULIB_MEMMEM=0;      AC_SUBST([GNULIB_MEMMEM])
+   GNULIB_MEMPCPY=0;     AC_SUBST([GNULIB_MEMPCPY])
+@@ -82,8 +80,6 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
+   GNULIB_STRVERSCMP=0;  AC_SUBST([GNULIB_STRVERSCMP])
+   HAVE_MBSLEN=0;        AC_SUBST([HAVE_MBSLEN])
+   dnl Assume proper GNU behavior unless another module says otherwise.
+-  HAVE_FFSL=1;                  AC_SUBST([HAVE_FFSL])
+-  HAVE_FFSLL=1;                 AC_SUBST([HAVE_FFSLL])
+   HAVE_MEMCHR=1;                AC_SUBST([HAVE_MEMCHR])
+   HAVE_DECL_MEMMEM=1;           AC_SUBST([HAVE_DECL_MEMMEM])
+   HAVE_MEMPCPY=1;               AC_SUBST([HAVE_MEMPCPY])
+diff -Naurp libiconv-1.14.org//srcm4/sys_socket_h.m4 libiconv-1.14/srcm4/sys_socket_h.m4
+--- libiconv-1.14.org//srcm4/sys_socket_h.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/sys_socket_h.m4	1969-12-31 16:00:00.000000000 -0800
+@@ -1,177 +0,0 @@
+-# sys_socket_h.m4 serial 22
+-dnl Copyright (C) 2005-2011 Free Software Foundation, Inc.
+-dnl This file is free software; the Free Software Foundation
+-dnl gives unlimited permission to copy and/or distribute it,
+-dnl with or without modifications, as long as this notice is preserved.
+-
+-dnl From Simon Josefsson.
+-
+-AC_DEFUN([gl_HEADER_SYS_SOCKET],
+-[
+-  AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+-  AC_REQUIRE([AC_CANONICAL_HOST])
+-  AC_REQUIRE([AC_C_INLINE])
+-
+-  dnl On OSF/1, the functions recv(), send(), recvfrom(), sendto() have
+-  dnl old-style declarations (with return type 'int' instead of 'ssize_t')
+-  dnl unless _POSIX_PII_SOCKET is defined.
+-  case "$host_os" in
+-    osf*)
+-      AC_DEFINE([_POSIX_PII_SOCKET], [1],
+-        [Define to 1 in order to get the POSIX compatible declarations
+-         of socket functions.])
+-      ;;
+-  esac
+-
+-  AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
+-    [gl_cv_header_sys_socket_h_selfcontained],
+-    [
+-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
+-        [gl_cv_header_sys_socket_h_selfcontained=yes],
+-        [gl_cv_header_sys_socket_h_selfcontained=no])
+-    ])
+-  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+-    dnl If the shutdown function exists, <sys/socket.h> should define
+-    dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
+-    AC_CHECK_FUNCS([shutdown])
+-    if test $ac_cv_func_shutdown = yes; then
+-      AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
+-        [gl_cv_header_sys_socket_h_shut],
+-        [
+-          AC_COMPILE_IFELSE(
+-            [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
+-               [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
+-            [gl_cv_header_sys_socket_h_shut=yes],
+-            [gl_cv_header_sys_socket_h_shut=no])
+-        ])
+-      if test $gl_cv_header_sys_socket_h_shut = no; then
+-        SYS_SOCKET_H='sys/socket.h'
+-      fi
+-    fi
+-  fi
+-  # We need to check for ws2tcpip.h now.
+-  gl_PREREQ_SYS_H_SOCKET
+-  AC_CHECK_TYPES([struct sockaddr_storage, sa_family_t],,,[
+-  /* sys/types.h is not needed according to POSIX, but the
+-     sys/socket.h in i386-unknown-freebsd4.10 and
+-     powerpc-apple-darwin5.5 required it. */
+-#include <sys/types.h>
+-#ifdef HAVE_SYS_SOCKET_H
+-#include <sys/socket.h>
+-#endif
+-#ifdef HAVE_WS2TCPIP_H
+-#include <ws2tcpip.h>
+-#endif
+-])
+-  if test $ac_cv_type_struct_sockaddr_storage = no; then
+-    HAVE_STRUCT_SOCKADDR_STORAGE=0
+-  fi
+-  if test $ac_cv_type_sa_family_t = no; then
+-    HAVE_SA_FAMILY_T=0
+-  fi
+-  if test $ac_cv_type_struct_sockaddr_storage != no; then
+-    AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family],
+-      [],
+-      [HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0],
+-      [#include <sys/types.h>
+-       #ifdef HAVE_SYS_SOCKET_H
+-       #include <sys/socket.h>
+-       #endif
+-       #ifdef HAVE_WS2TCPIP_H
+-       #include <ws2tcpip.h>
+-       #endif
+-      ])
+-  fi
+-  if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
+-     || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
+-    SYS_SOCKET_H='sys/socket.h'
+-  fi
+-  gl_PREREQ_SYS_H_WINSOCK2
+-
+-  dnl Check for declarations of anything we want to poison if the
+-  dnl corresponding gnulib module is not in use.
+-  gl_WARN_ON_USE_PREPARE([[
+-/* Some systems require prerequisite headers.  */
+-#include <sys/types.h>
+-#include <sys/socket.h>
+-    ]], [socket connect accept bind getpeername getsockname getsockopt
+-    listen recv send recvfrom sendto setsockopt shutdown accept4])
+-])
+-
+-AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
+-[
+-  dnl Check prerequisites of the <sys/socket.h> replacement.
+-  AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+-  gl_CHECK_NEXT_HEADERS([sys/socket.h])
+-  if test $ac_cv_header_sys_socket_h = yes; then
+-    HAVE_SYS_SOCKET_H=1
+-    HAVE_WS2TCPIP_H=0
+-  else
+-    HAVE_SYS_SOCKET_H=0
+-    if test $ac_cv_header_ws2tcpip_h = yes; then
+-      HAVE_WS2TCPIP_H=1
+-    else
+-      HAVE_WS2TCPIP_H=0
+-    fi
+-  fi
+-  AC_SUBST([HAVE_SYS_SOCKET_H])
+-  AC_SUBST([HAVE_WS2TCPIP_H])
+-])
+-
+-# Common prerequisites of the <sys/socket.h> replacement and of the
+-# <sys/select.h> replacement.
+-# Sets and substitutes HAVE_WINSOCK2_H.
+-AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
+-[
+-  m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+-  m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])])
+-  AC_CHECK_HEADERS_ONCE([sys/socket.h])
+-  if test $ac_cv_header_sys_socket_h != yes; then
+-    dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+-    dnl the check for those headers unconditional; yet cygwin reports
+-    dnl that the headers are present but cannot be compiled (since on
+-    dnl cygwin, all socket information should come from sys/socket.h).
+-    AC_CHECK_HEADERS([winsock2.h])
+-  fi
+-  if test "$ac_cv_header_winsock2_h" = yes; then
+-    HAVE_WINSOCK2_H=1
+-    UNISTD_H_HAVE_WINSOCK2_H=1
+-    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+-  else
+-    HAVE_WINSOCK2_H=0
+-  fi
+-  AC_SUBST([HAVE_WINSOCK2_H])
+-])
+-
+-AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
+-[
+-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+-  AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+-  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+-  dnl Define it also as a C macro, for the benefit of the unit tests.
+-  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+-])
+-
+-AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
+-[
+-  GNULIB_SOCKET=0;      AC_SUBST([GNULIB_SOCKET])
+-  GNULIB_CONNECT=0;     AC_SUBST([GNULIB_CONNECT])
+-  GNULIB_ACCEPT=0;      AC_SUBST([GNULIB_ACCEPT])
+-  GNULIB_BIND=0;        AC_SUBST([GNULIB_BIND])
+-  GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME])
+-  GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME])
+-  GNULIB_GETSOCKOPT=0;  AC_SUBST([GNULIB_GETSOCKOPT])
+-  GNULIB_LISTEN=0;      AC_SUBST([GNULIB_LISTEN])
+-  GNULIB_RECV=0;        AC_SUBST([GNULIB_RECV])
+-  GNULIB_SEND=0;        AC_SUBST([GNULIB_SEND])
+-  GNULIB_RECVFROM=0;    AC_SUBST([GNULIB_RECVFROM])
+-  GNULIB_SENDTO=0;      AC_SUBST([GNULIB_SENDTO])
+-  GNULIB_SETSOCKOPT=0;  AC_SUBST([GNULIB_SETSOCKOPT])
+-  GNULIB_SHUTDOWN=0;    AC_SUBST([GNULIB_SHUTDOWN])
+-  GNULIB_ACCEPT4=0;     AC_SUBST([GNULIB_ACCEPT4])
+-  HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
+-  HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
+-                        AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY])
+-  HAVE_SA_FAMILY_T=1;   AC_SUBST([HAVE_SA_FAMILY_T])
+-  HAVE_ACCEPT4=1;       AC_SUBST([HAVE_ACCEPT4])
+-])
+diff -Naurp libiconv-1.14.org//srcm4/warn-on-use.m4 libiconv-1.14/srcm4/warn-on-use.m4
+--- libiconv-1.14.org//srcm4/warn-on-use.m4	2011-08-07 06:42:07.000000000 -0700
++++ libiconv-1.14/srcm4/warn-on-use.m4	2012-01-08 02:07:40.934484487 -0800
+@@ -1,4 +1,4 @@
+-# warn-on-use.m4 serial 4
++# warn-on-use.m4 serial 2
+ dnl Copyright (C) 2010-2011 Free Software Foundation, Inc.
+ dnl This file is free software; the Free Software Foundation
+ dnl gives unlimited permission to copy and/or distribute it,
+@@ -27,8 +27,6 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
+     [AH_TEMPLATE([HAVE_RAW_DECL_]AS_TR_CPP(m4_defn([gl_decl])),
+       [Define to 1 if ]m4_defn([gl_decl])[ is declared even after
+        undefining macros.])])dnl
+-dnl FIXME: gl_Symbol must be used unquoted until we can assume
+-dnl autoconf 2.64 or newer.
+   for gl_func in m4_flatten([$2]); do
+     AS_VAR_PUSHDEF([gl_Symbol], [gl_cv_have_raw_decl_$gl_func])dnl
+     AC_CACHE_CHECK([whether $gl_func is declared without a macro],
+@@ -37,8 +35,8 @@ dnl autoconf 2.64 or newer.
+ [@%:@undef $gl_func
+   (void) $gl_func;])],
+         [AS_VAR_SET(gl_Symbol, [yes])], [AS_VAR_SET(gl_Symbol, [no])])])
+-    AS_VAR_IF(gl_Symbol, [yes],
+-      [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
++     AS_VAR_IF(gl_Symbol, [yes],
++       [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
+        dnl shortcut - if the raw declaration exists, then set a cache
+        dnl variable to allow skipping any later AC_CHECK_DECL efforts
+        eval ac_cv_have_decl_$gl_func=yes])
diff --git a/meta/recipes-support/libiconv/libiconv-1.14/autoconf.patch b/meta/recipes-support/libiconv/libiconv-1.14/autoconf.patch
new file mode 100644
index 0000000..5d34ce7
--- /dev/null
+++ b/meta/recipes-support/libiconv/libiconv-1.14/autoconf.patch
@@ -0,0 +1,50 @@
+It adds the variables that are needed
+for autoconf 2.65 to reconfigure libiconv and delete the m4 macros
+directory. Its imported from OE.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Index: libiconv-1.13.1/configure.ac
+===================================================================
+--- libiconv-1.13.1.orig/configure.ac
++++ libiconv-1.13.1/configure.ac
+@@ -23,7 +23,7 @@ AC_CONFIG_AUX_DIR([build-aux])
+ AM_INIT_AUTOMAKE([libiconv], [1.13.1])
+ AC_CONFIG_HEADERS([config.h lib/config.h])
+ AC_PROG_MAKE_SET
+-
++AC_CONFIG_MACRO_DIR([m4])
+ dnl           checks for basic programs
+ 
+ AC_PROG_CC
+Index: libiconv-1.13.1/libcharset/configure.ac
+===================================================================
+--- libiconv-1.13.1.orig/libcharset/configure.ac
++++ libiconv-1.13.1/libcharset/configure.ac
+@@ -16,17 +16,17 @@ dnl along with the GNU CHARSET Library;
+ dnl write to the Free Software Foundation, Inc., 51 Franklin Street,
+ dnl Fifth Floor, Boston, MA 02110-1301, USA.
+ 
+-AC_PREREQ([2.13])
++AC_PREREQ(2.61)
++AC_INIT([libcharset],[1.4] )
++AC_CONFIG_SRCDIR([lib/localcharset.c])
+ 
+-PACKAGE=libcharset
+-VERSION=1.4
+-
+-AC_INIT([lib/localcharset.c])
+ AC_CONFIG_AUX_DIR([build-aux])
+ AC_CONFIG_HEADER([config.h])
+ AC_PROG_MAKE_SET
+-AC_SUBST([PACKAGE])
+-AC_SUBST([VERSION])
++dnl AC_SUBST(PACKAGE)
++dnl AC_SUBST(VERSION)
++
++AC_CONFIG_MACRO_DIR([m4])
+ 
+ dnl           checks for basic programs
+ 
diff --git a/meta/recipes-support/libiconv/libiconv_1.11.1.bb b/meta/recipes-support/libiconv/libiconv_1.11.1.bb
new file mode 100644
index 0000000..6ce4b96
--- /dev/null
+++ b/meta/recipes-support/libiconv/libiconv_1.11.1.bb
@@ -0,0 +1,47 @@
+SUMMARY = "Character encoding support library"
+DESCRIPTION = "GNU libiconv - libiconv is for you if your application needs to support \
+multiple character encodings, but that support lacks from your system."
+HOMEPAGE = "http://www.gnu.org/software/libiconv"
+SECTION = "libs"
+NOTES = "Needs to be stripped down to: ascii iso8859-1 eucjp iso-2022jp gb utf8"
+PROVIDES = "virtual/libiconv"
+
+LICENSE = "LGPLv2.0"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \
+                    file://libcharset/COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+           file://autoconf.patch \
+	   file://shared_preloadable_libiconv_linux.patch \
+          "
+
+SRC_URI[md5sum] = "d42b97f6ef5dd0ba4469d520ed732fed"
+SRC_URI[sha256sum] = "e78c347a1a0cb15f2648519e9799151f4b4a934b61ad9ee7424478efe2b8257f"
+
+S = "${WORKDIR}/libiconv-${PV}"
+
+inherit autotools pkgconfig gettext
+
+python __anonymous() {
+    if d.getVar("TCLIBC", True) == "glibc":
+        raise bb.parse.SkipPackage("libiconv is provided for use with uClibc only - glibc already provides iconv")
+}
+
+EXTRA_OECONF += "--enable-shared --enable-static --enable-relocatable"
+
+LEAD_SONAME = "libiconv.so"
+
+do_configure_prepend () {
+	rm -f ${S}/m4/libtool.m4 ${S}/m4/ltoptions.m4 ${S}/m4/ltsugar.m4 ${S}/m4/ltversion.m4 ${S}/m4/lt~obsolete.m4 ${S}/libcharset/m4/libtool.m4 ${S}/libcharset/m4/ltoptions.m4 ${S}/libcharset/m4/ltsugar.m4 ${S}/libcharset/m4/ltversion.m4 ${S}/libcharset/m4/lt~obsolete.m4
+}
+
+do_configure_append () {
+        # forcibly remove RPATH from libtool
+        sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' *libtool
+        sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=_NO_RPATH_|g' *libtool
+}
+
+do_install_append () {
+	rm -rf ${D}${libdir}/preloadable_libiconv.so
+	rm -rf ${D}${libdir}/charset.alias
+}
diff --git a/meta/recipes-support/libiconv/libiconv_1.14.bb b/meta/recipes-support/libiconv/libiconv_1.14.bb
new file mode 100644
index 0000000..1b6fe09
--- /dev/null
+++ b/meta/recipes-support/libiconv/libiconv_1.14.bb
@@ -0,0 +1,51 @@
+SUMMARY = "Character encoding support library"
+DESCRIPTION = "GNU libiconv - libiconv is for you if your application needs to support \
+multiple character encodings, but that support lacks from your system."
+HOMEPAGE = "http://www.gnu.org/software/libiconv"
+SECTION = "libs"
+NOTES = "Needs to be stripped down to: ascii iso8859-1 eucjp iso-2022jp gb utf8"
+PROVIDES = "virtual/libiconv"
+PR = "r1"
+LICENSE = "LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674 \
+                    file://libcharset/COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
+
+SRC_URI = "${GNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \
+           file://autoconf.patch \
+           file://add-relocatable-module.patch \
+          "
+
+SRC_URI[md5sum] = "e34509b1623cec449dfeb73d7ce9c6c6"
+SRC_URI[sha256sum] = "72b24ded17d687193c3366d0ebe7cde1e6b18f0df8c55438ac95be39e8a30613"
+
+S = "${WORKDIR}/libiconv-${PV}"
+
+inherit autotools pkgconfig gettext
+
+python __anonymous() {
+    if d.getVar("TARGET_OS", True) != "linux":
+        return
+    if d.getVar("TCLIBC", True) == "glibc":
+        raise bb.parse.SkipPackage("libiconv is provided for use with uClibc only - glibc already provides iconv")
+}
+
+EXTRA_OECONF += "--enable-shared --enable-static --enable-relocatable"
+
+LEAD_SONAME = "libiconv.so"
+
+do_configure_prepend () {
+	rm -f ${S}/m4/libtool.m4 ${S}/m4/ltoptions.m4 ${S}/m4/ltsugar.m4 ${S}/m4/ltversion.m4 ${S}/m4/lt~obsolete.m4 ${S}/libcharset/m4/libtool.m4 ${S}/libcharset/m4/ltoptions.m4 ${S}/libcharset/m4/ltsugar.m4 ${S}/libcharset/m4/ltversion.m4 ${S}/libcharset/m4/lt~obsolete.m4
+}
+
+do_configure_append () {
+        # forcibly remove RPATH from libtool
+        sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' *libtool
+        sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=_NO_RPATH_|g' *libtool
+}
+
+do_install_append () {
+	rm -rf ${D}${libdir}/preloadable_libiconv.so
+	rm -rf ${D}${libdir}/charset.alias
+}
+
+BBCLASSEXTEND = "nativesdk"
diff --git a/meta/recipes-support/libksba/libksba/ksba-add-pkgconfig-support.patch b/meta/recipes-support/libksba/libksba/ksba-add-pkgconfig-support.patch
new file mode 100644
index 0000000..b5886c5
--- /dev/null
+++ b/meta/recipes-support/libksba/libksba/ksba-add-pkgconfig-support.patch
@@ -0,0 +1,152 @@
+Upstream-Status: Denied
+
+Add pkgconfig support to libksba.
+This patch is rejected by upstream for the reason below:
+They think pkgconfig adds no portability and maintaining them is not worthwhile.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+Index: libksba-1.3.0/Makefile.am
+===================================================================
+--- libksba-1.3.0.orig/Makefile.am	2014-05-13 21:39:22.390385646 +0000
++++ libksba-1.3.0/Makefile.am	2014-05-13 21:39:22.462385646 +0000
+@@ -21,6 +21,9 @@
+ ACLOCAL_AMFLAGS = -I m4 -I gl/m4
+ AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip
+ 
++pkgconfigdir = ${libdir}/pkgconfig
++pkgconfig_DATA = ksba.pc
++
+ # (A suitable gitlog-to-changelog script can be found in GnuPG master.)
+ GITLOG_TO_CHANGELOG=gitlog-to-changelog
+ 
+Index: libksba-1.3.0/configure.ac
+===================================================================
+--- libksba-1.3.0.orig/configure.ac	2014-05-13 21:39:22.390385646 +0000
++++ libksba-1.3.0/configure.ac	2014-05-13 21:39:22.462385646 +0000
+@@ -400,6 +400,7 @@
+ src/Makefile
+ src/ksba-config
+ src/versioninfo.rc
++ksba.pc
+ tests/Makefile
+ doc/Makefile
+ ])
+Index: libksba-1.3.0/ksba.pc.in
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ libksba-1.3.0/ksba.pc.in	2014-05-13 21:39:22.462385646 +0000
+@@ -0,0 +1,17 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++# API info
++api_version=@KSBA_CONFIG_API_VERSION@
++host=@KSBA_CONFIG_HOST@
++
++Name: ksba
++Description: Libksba provides an easy API to create and parse X.509 and CMS related objects
++Requires:
++Version: @VERSION@
++Libs: -L${libdir} -lksba
++Libs.private: -L{libdir} -lgpg-error
++Cflags: -I${includedir}
++
+Index: libksba-1.3.0/src/ksba.m4
+===================================================================
+--- libksba-1.3.0.orig/src/ksba.m4	2014-05-13 21:39:22.390385646 +0000
++++ libksba-1.3.0/src/ksba.m4	2014-05-13 21:49:03.650382696 +0000
+@@ -22,18 +22,7 @@
+ dnl
+ AC_DEFUN([AM_PATH_KSBA],
+ [AC_REQUIRE([AC_CANONICAL_HOST])
+- AC_ARG_WITH(ksba-prefix,
+-            AC_HELP_STRING([--with-ksba-prefix=PFX],
+-                           [prefix where KSBA is installed (optional)]),
+-     ksba_config_prefix="$withval", ksba_config_prefix="")
+-  if test x$ksba_config_prefix != x ; then
+-     ksba_config_args="$ksba_config_args --prefix=$ksba_config_prefix"
+-     if test x${KSBA_CONFIG+set} != xset ; then
+-        KSBA_CONFIG=$ksba_config_prefix/bin/ksba-config
+-     fi
+-  fi
+ 
+-  AC_PATH_PROG(KSBA_CONFIG, ksba-config, no)
+   tmp=ifelse([$1], ,1:1.0.0,$1)
+   if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then
+      req_ksba_api=`echo "$tmp"     | sed 's/\(.*\):\(.*\)/\1/'`
+@@ -43,48 +32,13 @@
+      min_ksba_version="$tmp"
+   fi
+ 
+-  AC_MSG_CHECKING(for KSBA - version >= $min_ksba_version)
+-  ok=no
+-  if test "$KSBA_CONFIG" != "no" ; then
+-    req_major=`echo $min_ksba_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'`
+-    req_minor=`echo $min_ksba_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'`
+-    req_micro=`echo $min_ksba_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'`
+-    ksba_config_version=`$KSBA_CONFIG $ksba_config_args --version`
+-    major=`echo $ksba_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
+-    minor=`echo $ksba_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
+-    micro=`echo $ksba_config_version | \
+-               sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'`
+-    if test "$major" -gt "$req_major"; then
+-        ok=yes
+-    else
+-        if test "$major" -eq "$req_major"; then
+-            if test "$minor" -gt "$req_minor"; then
+-               ok=yes
+-            else
+-               if test "$minor" -eq "$req_minor"; then
+-                   if test "$micro" -ge "$req_micro"; then
+-                     ok=yes
+-                   fi
+-               fi
+-            fi
+-        fi
+-    fi
+-  fi
+-  if test $ok = yes; then
+-    AC_MSG_RESULT([yes ($ksba_config_version)])
+-  else
+-    AC_MSG_RESULT(no)
+-  fi
++  PKG_CHECK_MODULES(KSBA, [ksba >= $min_ksba_version], [ok=yes], [ok=no])
++
+   if test $ok = yes; then
+      # Even if we have a recent libksba, we should check that the
+      # API is compatible.
+      if test "$req_ksba_api" -gt 0 ; then
+-        tmp=`$KSBA_CONFIG --api-version 2>/dev/null || echo 0`
++        tmp=`$PKG_CONFIG --variable=api_version ksba`
+         if test "$tmp" -gt 0 ; then
+            AC_MSG_CHECKING([KSBA API version])
+            if test "$req_ksba_api" -eq "$tmp" ; then
+@@ -97,10 +51,8 @@
+      fi
+   fi
+   if test $ok = yes; then
+-    KSBA_CFLAGS=`$KSBA_CONFIG $ksba_config_args --cflags`
+-    KSBA_LIBS=`$KSBA_CONFIG $ksba_config_args --libs`
+     ifelse([$2], , :, [$2])
+-    libksba_config_host=`$LIBKSBA_CONFIG $ksba_config_args --host 2>/dev/null || echo none`
++    libksba_config_host=`$PKG_CONFIG --variable=host ksba`
+     if test x"$libksba_config_host" != xnone ; then
+       if test x"$libksba_config_host" != x"$host" ; then
+   AC_MSG_WARN([[
+@@ -114,8 +66,6 @@
+       fi
+     fi
+   else
+-    KSBA_CFLAGS=""
+-    KSBA_LIBS=""
+     ifelse([$3], , :, [$3])
+   fi
+   AC_SUBST(KSBA_CFLAGS)
diff --git a/meta/recipes-support/libksba/libksba_1.3.3.bb b/meta/recipes-support/libksba/libksba_1.3.3.bb
new file mode 100644
index 0000000..bc21164
--- /dev/null
+++ b/meta/recipes-support/libksba/libksba_1.3.3.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Easy API to create and parse X.509 and CMS related objects"
+HOMEPAGE = "http://www.gnupg.org/related_software/libksba/"
+LICENSE = "GPLv2+ | LGPLv3+ | GPLv3+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fd541d83f75d038c4e0617b672ed8bda \
+                    file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://COPYING.GPLv3;md5=2f31b266d3440dd7ee50f92cf67d8e6c \
+                    file://COPYING.LGPLv3;md5=e6a600fd5e1d9cbde2d983680233ad02 \
+                   "
+
+DEPENDS = "libgpg-error"
+
+BINCONFIG = "${bindir}/ksba-config"
+
+inherit autotools binconfig-disabled pkgconfig texinfo
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/${BPN}/${BPN}-${PV}.tar.bz2 \
+           file://ksba-add-pkgconfig-support.patch"
+
+SRC_URI[md5sum] = "a5dd3c57fca254935f5cf8db26e39065"
+SRC_URI[sha256sum] = "0c7f5ffe34d0414f6951d9880a46fcc2985c487f7c36369b9f11ad41131c7786"
+
+do_configure_prepend () {
+	# Else these could be used in preference to those in aclocal-copy
+	rm -f ${S}/m4/gpg-error.m4
+}
diff --git a/meta/recipes-support/libmpc/libmpc.inc b/meta/recipes-support/libmpc/libmpc.inc
new file mode 100644
index 0000000..b374254
--- /dev/null
+++ b/meta/recipes-support/libmpc/libmpc.inc
@@ -0,0 +1,7 @@
+SUMMARY = "C library for complex number arithmetic with arbitrary precision and correct rounding"
+DESCRIPTION = "Mpc is a C library for the arithmetic of complex numbers with arbitrarily high precision and correct rounding of the result. It is built upon and follows the same principles as Mpfr"
+HOMEPAGE = "http://www.multiprecision.org/"
+LICENSE = "LGPLv3"
+SECTION = "libs"
+
+inherit autotools texinfo
diff --git a/meta/recipes-support/libmpc/libmpc_1.0.3.bb b/meta/recipes-support/libmpc/libmpc_1.0.3.bb
new file mode 100644
index 0000000..f3e5a18
--- /dev/null
+++ b/meta/recipes-support/libmpc/libmpc_1.0.3.bb
@@ -0,0 +1,13 @@
+require libmpc.inc
+
+DEPENDS = "gmp mpfr"
+
+LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=e6a600fd5e1d9cbde2d983680233ad02"
+SRC_URI = "http://www.multiprecision.org/mpc/download/mpc-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "d6a1d5f8ddea3abd2cc3e98f58352d26"
+SRC_URI[sha256sum] = "617decc6ea09889fb08ede330917a00b16809b8db88c29c31bfbb49cbf88ecc3"
+
+S = "${WORKDIR}/mpc-${PV}"
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/meta/recipes-support/libnl/libnl/fix-pc-file.patch b/meta/recipes-support/libnl/libnl/fix-pc-file.patch
new file mode 100644
index 0000000..fe8b833
--- /dev/null
+++ b/meta/recipes-support/libnl/libnl/fix-pc-file.patch
@@ -0,0 +1,17 @@
+Upstream-Status: Pending
+
+Some packages are asking only for libnl-2.0, but expects to get also
+libnl-genl, libnl-nf libnl-route, easiest way to fix them is here.
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+Index: libnl-3.2.14/libnl-3.0.pc.in
+===================================================================
+--- libnl-3.2.14.orig/libnl-3.0.pc.in
++++ libnl-3.2.14/libnl-3.0.pc.in
+@@ -6,5 +6,5 @@ includedir=@includedir@
+ Name: libnl
+ Description: Convenience library for netlink sockets
+ Version: @PACKAGE_VERSION@
+-Libs: -L${libdir} -lnl-@MAJ_VERSION@
++Libs: -L${libdir} -lnl-@MAJ_VERSION@ -lnl-genl-@MAJ_VERSION@ -lnl-nf-@MAJ_VERSION@ -lnl-route-@MAJ_VERSION@
+ Cflags: -I${includedir}/libnl@MAJ_VERSION@
diff --git a/meta/recipes-support/libnl/libnl/fix-pktloc_syntax_h-race.patch b/meta/recipes-support/libnl/libnl/fix-pktloc_syntax_h-race.patch
new file mode 100644
index 0000000..79aa0bd
--- /dev/null
+++ b/meta/recipes-support/libnl/libnl/fix-pktloc_syntax_h-race.patch
@@ -0,0 +1,36 @@
+Upstream-Status: Inappropriate [configuration]
+
+libnl has progressed to 0.3.2 and there does not appear to be any
+"make -j" issues with this build after my limited testing on that
+newer version so we can assume this issue is fixed upstream
+
+Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
+
+Index: libnl-3.2.25/lib/Makefile.am
+===================================================================
+--- libnl-3.2.25.orig/lib/Makefile.am
++++ libnl-3.2.25/lib/Makefile.am
+@@ -46,9 +46,12 @@ CLEANFILES = \
+ 
+ # Hack to avoid using ylwrap. It does not function correctly in combination
+ # with --header-file=
++route/pktloc.lo: route/pktloc_syntax.h route/pktloc_grammar.h
++route/pktloc_grammar.h: route/pktloc_grammar.c
+ route/pktloc_grammar.c: route/pktloc_grammar.l
+ 	$(AM_V_GEN) $(MKDIR_P) route; $(FLEX) --header-file=route/pktloc_grammar.h $(LFLAGS) -o $@ $^
+ 
++route/pktloc_syntax.h: route/pktloc_syntax.c
+ route/pktloc_syntax.c: route/pktloc_syntax.y
+ 	$(AM_V_GEN) $(MKDIR_P) route; $(YACC) -d $(YFLAGS) -o $@ $^
+ 
+@@ -102,7 +105,9 @@ BUILT_SOURCES = \
+ 	route/cls/ematch_grammar.c \
+ 	route/cls/ematch_syntax.c \
+ 	route/pktloc_grammar.c \
+-	route/pktloc_syntax.c
++   route/pktloc_syntax.c \
++   route/pktloc_syntax.h \
++   route/pktloc_grammar.h
+ 
+ EXTRA_DIST = \
+ 	route/pktloc_grammar.l \
diff --git a/meta/recipes-support/libnl/libnl_3.2.25.bb b/meta/recipes-support/libnl/libnl_3.2.25.bb
new file mode 100644
index 0000000..97814fb
--- /dev/null
+++ b/meta/recipes-support/libnl/libnl_3.2.25.bb
@@ -0,0 +1,44 @@
+SUMMARY = "A library for applications dealing with netlink sockets"
+HOMEPAGE = "http://www.infradead.org/~tgr/libnl/"
+SECTION = "libs/network"
+
+PE = "1"
+PR = "r1"
+
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
+
+DEPENDS = "flex-native bison-native"
+
+SRC_URI = "http://www.infradead.org/~tgr/${BPN}/files/${BP}.tar.gz \
+           file://fix-pktloc_syntax_h-race.patch \
+           file://fix-pc-file.patch \
+          "
+
+SRC_URI[md5sum] = "03f74d0cd5037cadc8cdfa313bbd195c"
+SRC_URI[sha256sum] = "8beb7590674957b931de6b7f81c530b85dc7c1ad8fbda015398bc1e8d1ce8ec5"
+
+inherit autotools pkgconfig
+
+FILES_${PN} = "${libdir}/libnl-3.so.* \
+               ${libdir}/libnl.so.* \
+               ${sysconfdir}"
+RREPLACES_${PN} = "libnl2"
+RCONFLICTS_${PN} = "libnl2"
+FILES_${PN}-dbg += "${libdir}/libnl/cli/*/.debug"
+FILES_${PN}-dev += "${libdir}/libnl/cli/*/*.so \
+                    ${libdir}/libnl/cli/*/*.la"
+FILES_${PN}-staticdev += "${libdir}/libnl/cli/*/*.a"
+
+PACKAGES += "${PN}-cli ${PN}-route ${PN}-nf ${PN}-genl ${PN}-idiag"
+FILES_${PN}-cli   = "${libdir}/libnl-cli-3.so.* \
+                     ${libdir}/libnl/cli/*/*.so.* \
+                     ${sbindir}/nl-*"
+FILES_${PN}-route = "${libdir}/libnl-route-3.so.*"
+FILES_${PN}-idiag = "${libdir}/libnl-idiag-3.so.*"
+FILES_${PN}-nf    = "${libdir}/libnl-nf-3.so.*"
+FILES_${PN}-genl  = "${libdir}/libnl-genl-3.so.* \
+                     ${libdir}/libnl-genl.so.* \
+                     ${sbindir}/genl-ctrl-list"
+RREPLACES_${PN}-genl = "libnl-genl2 libnl-genl-3-200"
+RCONFLICTS_${PN}-genl = "libnl-genl2 libnl-genl-3-200"
diff --git a/meta/recipes-support/liboil/liboil-0.3.17/0001-Fix-enable-vfp-flag.patch b/meta/recipes-support/liboil/liboil-0.3.17/0001-Fix-enable-vfp-flag.patch
new file mode 100644
index 0000000..aff1cb1
--- /dev/null
+++ b/meta/recipes-support/liboil/liboil-0.3.17/0001-Fix-enable-vfp-flag.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Inappropriate [configuration]
+
+From 1921498bcc06408e8b051a3a9e9ce4182998f748 Mon Sep 17 00:00:00 2001
+From: David Schleef <ds@schleef.org>
+Date: Fri, 8 Apr 2011 10:05:49 -0700
+Subject: [PATCH 10/10] Fix --enable-vfp flag
+
+Patch from Christophe Lyon, fixes #36084.
+---
+ configure.ac           |    4 ++--
+ liboil/arm/Makefile.am |    1 +
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 98c81fb..407d88c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -188,8 +188,8 @@ fi
+ AC_ARG_ENABLE(vfp,
+   AC_HELP_STRING([--enable-vfp],[compile with Vector Floating-point unit support]),
+   enable_vfp=$enableval,enable_vfp=yes)
+-if test "x$enable-vfp" = xyes -a x$HAVE_GCC_ASM = xyes -a x$HAVE_ARM = xyes; then
+-  AS_COMPILER_FLAG(["-Wa,-mfpu=vfp"],
++if test "x$enable_vfp" = xyes -a x$HAVE_GCC_ASM = xyes -a x$HAVE_ARM = xyes; then
++  AS_COMPILER_FLAG(["-mfpu=vfp"],
+     [VFP_CFLAGS="$VFP_CFLAGS -mfpu=vfp"],
+     true)
+   #AS_COMPILER_FLAG(["-Wa,-mfloat-abi=softfp"],
+diff --git a/liboil/arm/Makefile.am b/liboil/arm/Makefile.am
+index ead08ed..cd8d9fa 100644
+--- a/liboil/arm/Makefile.am
++++ b/liboil/arm/Makefile.am
+@@ -6,4 +6,5 @@ libarm_la_SOURCES = \
+ 	math_vfp_asm.S
+ 
+ libarm_la_CFLAGS = $(LIBOIL_CFLAGS) $(VFP_CFLAGS)
++libarm_la_CCASFLAGS = $(LIBOIL_CFLAGS) $(VFP_CFLAGS)
+ 
+-- 
+1.7.6
+
diff --git a/meta/recipes-support/liboil/liboil-0.3.17/fix-unaligned-whitelist.patch b/meta/recipes-support/liboil/liboil-0.3.17/fix-unaligned-whitelist.patch
new file mode 100644
index 0000000..c8e3c1f
--- /dev/null
+++ b/meta/recipes-support/liboil/liboil-0.3.17/fix-unaligned-whitelist.patch
@@ -0,0 +1,19 @@
+Upstream: https://bugs.freedesktop.org/show_bug.cgi?id=31358
+
+configure: fix whitelisting of x86_64 unaligned memory access
+
+Fix typo in whitelist so cross-compile works for x86_64.
+
+Upstream-Status: Inappropriate [configuration]
+
+--- liboil-0.3.17/m4/as-unaligned-access.m4.orig	2009-02-26 14:40:08.000000000 -0500
++++ liboil-0.3.17/m4/as-unaligned-access.m4	2010-11-03 12:19:55.000000000 -0400
+@@ -9,7 +9,7 @@
+         _AS_ECHO_N([(blacklisted) ])
+         as_cv_unaligned_access=no
+ 	;;
+-      i?86*|x86_64|amd64|powerpc*|m68k*|cris*)
++      i?86*|x86_64*|amd64*|powerpc*|m68k*|cris*)
+         _AS_ECHO_N([(whitelisted) ])
+         as_cv_unaligned_access=yes
+ 	;;
diff --git a/meta/recipes-support/liboil/liboil-0.3.17/liboil_fix_for_x32.patch b/meta/recipes-support/liboil/liboil-0.3.17/liboil_fix_for_x32.patch
new file mode 100644
index 0000000..473380e
--- /dev/null
+++ b/meta/recipes-support/liboil/liboil-0.3.17/liboil_fix_for_x32.patch
@@ -0,0 +1,222 @@
+Upstream-Status: Pending
+
+Make the assembly syntax compatible with x32 gcc. Othewise x32 gcc throws errors.
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2011/12/01
+
+
+Index: liboil-0.3.17/liboil/amd64/wavelet.c
+===================================================================
+--- liboil-0.3.17.orig/liboil/amd64/wavelet.c
++++ liboil-0.3.17/liboil/amd64/wavelet.c
+@@ -21,14 +21,14 @@ deinterleave2_asm (int16_t *d1, int16_t 
+   asm volatile ("\n"
+       "  sub $2, %%rcx\n"
+       "1:\n"
+-      "  movw (%1,%%rcx,4), %%ax\n"
+-      "  movw %%ax, (%0,%%rcx,2)\n"
+-      "  movw 2(%1,%%rcx,4), %%ax\n"
+-      "  movw %%ax, (%2,%%rcx,2)\n"
+-      "  movw 4(%1,%%rcx,4), %%ax\n"
+-      "  movw %%ax, 2(%0,%%rcx,2)\n"
+-      "  movw 6(%1,%%rcx,4), %%ax\n"
+-      "  movw %%ax, 2(%2,%%rcx,2)\n"
++      "  movw (%q1,%%rcx,4), %%ax\n"
++      "  movw %%ax, (%q0,%%rcx,2)\n"
++      "  movw 2(%q1,%%rcx,4), %%ax\n"
++      "  movw %%ax, (%q2,%%rcx,2)\n"
++      "  movw 4(%q1,%%rcx,4), %%ax\n"
++      "  movw %%ax, 2(%q0,%%rcx,2)\n"
++      "  movw 6(%q1,%%rcx,4), %%ax\n"
++      "  movw %%ax, 2(%q2,%%rcx,2)\n"
+       "  sub $2, %%rcx\n"
+       "  jge 1b\n"
+       : "+r" (d1), "+r" (s_2xn), "+r" (d2), "+c" (n)
+@@ -53,20 +53,20 @@ deinterleave2_mmx (int16_t *d1, int16_t 
+   asm volatile ("\n"
+       "  xor %%rcx, %%rcx\n"
+       "1:\n"
+-      "  movq (%1,%%rcx,4), %%mm0\n"
+-      "  movq 8(%1,%%rcx,4), %%mm1\n"
++      "  movq (%q1,%%rcx,4), %%mm0\n"
++      "  movq 8(%q1,%%rcx,4), %%mm1\n"
+       "  pslld $16, %%mm0\n"
+       "  pslld $16, %%mm1\n"
+       "  psrad $16, %%mm0\n"
+       "  psrad $16, %%mm1\n"
+       "  packssdw %%mm1, %%mm0\n"
+-      "  movq %%mm0, (%0,%%rcx,2)\n"
+-      "  movq (%1,%%rcx,4), %%mm0\n"
+-      "  movq 8(%1,%%rcx,4), %%mm1\n"
++      "  movq %%mm0, (%q0,%%rcx,2)\n"
++      "  movq (%q1,%%rcx,4), %%mm0\n"
++      "  movq 8(%q1,%%rcx,4), %%mm1\n"
+       "  psrad $16, %%mm0\n"
+       "  psrad $16, %%mm1\n"
+       "  packssdw %%mm1, %%mm0\n"
+-      "  movq %%mm0, (%2,%%rcx,2)\n"
++      "  movq %%mm0, (%q2,%%rcx,2)\n"
+       "  add $4, %%rcx\n"
+       "  cmp %3, %%ecx\n"
+       "  jl 1b\n"
+@@ -93,10 +93,10 @@ deinterleave2_mmx_2 (int16_t *d1, int16_
+   asm volatile ("\n"
+       "  xor %%rcx, %%rcx\n"
+       "1:\n"
+-      "  pshufw $0xd8, (%1,%%rcx,4), %%mm0\n"
+-      "  movd %%mm0, (%0,%%rcx,2)\n"
+-      "  pshufw $0x8d, (%1,%%rcx,4), %%mm0\n"
+-      "  movd %%mm0, (%2,%%rcx,2)\n"
++      "  pshufw $0xd8, (%q1,%%rcx,4), %%mm0\n"
++      "  movd %%mm0, (%q0,%%rcx,2)\n"
++      "  pshufw $0x8d, (%q1,%%rcx,4), %%mm0\n"
++      "  movd %%mm0, (%q2,%%rcx,2)\n"
+       "  add $2, %%rcx\n"
+       "  cmp %3, %%ecx\n"
+       "  jl 1b\n"
+@@ -123,16 +123,16 @@ deinterleave2_mmx_3 (int16_t *d1, int16_
+   asm volatile ("\n"
+       "  xor %%rcx, %%rcx\n"
+       "1:\n"
+-      "  movq (%1,%%rcx,4), %%mm1\n"
+-      "  movq (%1,%%rcx,4), %%mm2\n"
+-      "  movq 8(%1,%%rcx,4), %%mm0\n"
++      "  movq (%q1,%%rcx,4), %%mm1\n"
++      "  movq (%q1,%%rcx,4), %%mm2\n"
++      "  movq 8(%q1,%%rcx,4), %%mm0\n"
+       "  punpcklwd %%mm0, %%mm1\n"
+       "  punpckhwd %%mm0, %%mm2\n"
+       "  movq %%mm1, %%mm0\n"
+       "  punpcklwd %%mm2, %%mm0\n"
+       "  punpckhwd %%mm2, %%mm1\n"
+-      "  movq %%mm0, (%0,%%rcx,2)\n"
+-      "  movq %%mm1, (%2,%%rcx,2)\n"
++      "  movq %%mm0, (%q0,%%rcx,2)\n"
++      "  movq %%mm1, (%q2,%%rcx,2)\n"
+       "  add $4, %%rcx\n"
+       "  cmp %3, %%ecx\n"
+       "  jl 1b\n"
+@@ -159,26 +159,26 @@ deinterleave2_mmx_4 (int16_t *d1, int16_
+   asm volatile ("\n"
+       "  xor %%rcx, %%rcx\n"
+       "1:\n"
+-      "  movq (%1,%%rcx,4), %%mm1\n"
++      "  movq (%q1,%%rcx,4), %%mm1\n"
+       "  movq %%mm1, %%mm2\n"
+-      "  movq 8(%1,%%rcx,4), %%mm0\n"
+-      "   movq 16(%1,%%rcx,4), %%mm5\n"
++      "  movq 8(%q1,%%rcx,4), %%mm0\n"
++      "   movq 16(%q1,%%rcx,4), %%mm5\n"
+       "  punpcklwd %%mm0, %%mm1\n"
+       "   movq %%mm5, %%mm6\n"
+       "  punpckhwd %%mm0, %%mm2\n"
+-      "   movq 24(%1,%%rcx,4), %%mm4\n"
++      "   movq 24(%q1,%%rcx,4), %%mm4\n"
+       "  movq %%mm1, %%mm0\n"
+       "   punpcklwd %%mm4, %%mm5\n"
+       "  punpcklwd %%mm2, %%mm0\n"
+       "   punpckhwd %%mm4, %%mm6\n"
+       "  punpckhwd %%mm2, %%mm1\n"
+       "   movq %%mm5, %%mm4\n"
+-      "  movq %%mm0, (%0,%%rcx,2)\n"
++      "  movq %%mm0, (%q0,%%rcx,2)\n"
+       "   punpcklwd %%mm6, %%mm4\n"
+-      "  movq %%mm1, (%2,%%rcx,2)\n"
++      "  movq %%mm1, (%q2,%%rcx,2)\n"
+       "   punpckhwd %%mm6, %%mm5\n"
+-      "   movq %%mm4, 8(%0,%%rcx,2)\n"
+-      "   movq %%mm5, 8(%2,%%rcx,2)\n"
++      "   movq %%mm4, 8(%q0,%%rcx,2)\n"
++      "   movq %%mm5, 8(%q2,%%rcx,2)\n"
+       "  add $8, %%rcx\n"
+       "  cmp %3, %%ecx\n"
+       "  jl 1b\n"
+@@ -252,13 +252,13 @@ interleave2_mmx (int16_t *d_2xn, int16_t
+   asm volatile ("\n"
+       "  xor %%rcx, %%rcx\n"
+       "1:\n"
+-      "  movq (%1,%%rcx,2), %%mm0\n"
+-      "  movq (%2,%%rcx,2), %%mm1\n"
++      "  movq (%q1,%%rcx,2), %%mm0\n"
++      "  movq (%q2,%%rcx,2), %%mm1\n"
+       "  movq %%mm0, %%mm2\n"
+       "  punpckhwd %%mm1, %%mm0\n"
+       "  punpcklwd %%mm1, %%mm2\n"
+-      "  movq %%mm2, (%0,%%rcx,4)\n"
+-      "  movq %%mm0, 8(%0,%%rcx,4)\n"
++      "  movq %%mm2, (%q0,%%rcx,4)\n"
++      "  movq %%mm0, 8(%q0,%%rcx,4)\n"
+       "  add $4, %%rcx\n"
+       "  cmp %3, %%ecx\n"
+       "  jl 1b\n"
+@@ -285,12 +285,12 @@ lift_add_shift1_mmx (int16_t *d, int16_t
+   asm volatile ("\n"
+       "  xor %%rcx, %%rcx\n"
+       "1:\n"
+-      "  movq (%2,%%rcx,2), %%mm1\n"
+-      "  movq (%3,%%rcx,2), %%mm2\n"
++      "  movq (%q2,%%rcx,2), %%mm1\n"
++      "  movq (%q3,%%rcx,2), %%mm2\n"
+       "  paddw %%mm2, %%mm1\n"
+       "  psraw $1, %%mm1\n"
+-      "  paddw (%1,%%rcx,2), %%mm1\n"
+-      "  movq %%mm1, (%0,%%rcx,2)\n"
++      "  paddw (%q1,%%rcx,2), %%mm1\n"
++      "  movq %%mm1, (%q0,%%rcx,2)\n"
+       "  add $4, %%rcx\n"
+       "  cmp %4, %%ecx\n"
+       "  jl 1b\n"
+@@ -317,13 +317,13 @@ lift_sub_shift1_mmx (int16_t *d, int16_t
+   asm volatile ("\n"
+       "  xor %%rcx, %%rcx\n"
+       "1:\n"
+-      "  movq (%2,%%rcx,2), %%mm1\n"
+-      "  movq (%3,%%rcx,2), %%mm2\n"
+-      "  movq (%1,%%rcx,2), %%mm0\n"
++      "  movq (%q2,%%rcx,2), %%mm1\n"
++      "  movq (%q3,%%rcx,2), %%mm2\n"
++      "  movq (%q1,%%rcx,2), %%mm0\n"
+       "  paddw %%mm2, %%mm1\n"
+       "  psraw $1, %%mm1\n"
+       "  psubw %%mm1, %%mm0\n"
+-      "  movq %%mm0, (%0,%%rcx,2)\n"
++      "  movq %%mm0, (%q0,%%rcx,2)\n"
+       "  add $4, %%rcx\n"
+       "  cmp %4, %%ecx\n"
+       "  jl 1b\n"
+@@ -350,12 +350,12 @@ lift_add_shift2_mmx (int16_t *d, int16_t
+   asm volatile ("\n"
+       "  xor %%rcx, %%rcx\n"
+       "1:\n"
+-      "  movq (%2,%%rcx,2), %%mm1\n"
+-      "  movq (%3,%%rcx,2), %%mm2\n"
++      "  movq (%q2,%%rcx,2), %%mm1\n"
++      "  movq (%q3,%%rcx,2), %%mm2\n"
+       "  paddw %%mm2, %%mm1\n"
+       "  psraw $2, %%mm1\n"
+-      "  paddw (%1,%%rcx,2), %%mm1\n"
+-      "  movq %%mm1, (%0,%%rcx,2)\n"
++      "  paddw (%q1,%%rcx,2), %%mm1\n"
++      "  movq %%mm1, (%q0,%%rcx,2)\n"
+       "  add $4, %%rcx\n"
+       "  cmp %4, %%ecx\n"
+       "  jl 1b\n"
+@@ -382,13 +382,13 @@ lift_sub_shift2_mmx (int16_t *d, int16_t
+   asm volatile ("\n"
+       "  xor %%rcx, %%rcx\n"
+       "1:\n"
+-      "  movq (%2,%%rcx,2), %%mm1\n"
+-      "  movq (%3,%%rcx,2), %%mm2\n"
+-      "  movq (%1,%%rcx,2), %%mm0\n"
++      "  movq (%q2,%%rcx,2), %%mm1\n"
++      "  movq (%q3,%%rcx,2), %%mm2\n"
++      "  movq (%q1,%%rcx,2), %%mm0\n"
+       "  paddw %%mm2, %%mm1\n"
+       "  psraw $2, %%mm1\n"
+       "  psubw %%mm1, %%mm0\n"
+-      "  movq %%mm0, (%0,%%rcx,2)\n"
++      "  movq %%mm0, (%q0,%%rcx,2)\n"
+       "  add $4, %%rcx\n"
+       "  cmp %4, %%ecx\n"
+       "  jl 1b\n"
diff --git a/meta/recipes-support/liboil/liboil-0.3.17/no-tests.patch b/meta/recipes-support/liboil/liboil-0.3.17/no-tests.patch
new file mode 100644
index 0000000..892d441
--- /dev/null
+++ b/meta/recipes-support/liboil/liboil-0.3.17/no-tests.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Inappropriate [disable feature]
+
+--- liboil-0.3.9/liboil/liboilfunction.c.old	2006-09-18 13:03:20.000000000 +0100
++++ liboil-0.3.9/liboil/liboilfunction.c	2006-09-18 13:04:10.000000000 +0100
+@@ -345,7 +345,9 @@
+     return;
+   }
+ 
+-  test = oil_test_new (klass);
++  klass->chosen_impl = klass->reference_impl;
++  klass->func = klass->reference_impl->func;
++/*  test = oil_test_new (klass);
+   if (test == NULL) {
+     OIL_ERROR ("failed to test function class %s", klass->name);
+     return;
+@@ -385,7 +387,7 @@
+   klass->chosen_impl = min_impl;
+   klass->func = min_impl->func;
+ 
+-  oil_test_free (test);
++  oil_test_free (test);*/
+ }
+ 
+ static void
diff --git a/meta/recipes-support/liboil/liboil_0.3.17.bb b/meta/recipes-support/liboil/liboil_0.3.17.bb
new file mode 100644
index 0000000..03b7785
--- /dev/null
+++ b/meta/recipes-support/liboil/liboil_0.3.17.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Library of simple functions optimized for various CPUs"
+HOMEPAGE = "http://liboil.freedesktop.org/"
+BUGTRACKER = "https://bugs.freedesktop.org/"
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ad80780d9c5205d63481a0184e199a15 \
+                    file://liboil/liboil.h;endline=28;md5=95c794a66b88800d949fed17e437d9fb \
+                    file://liboil/liboilcpu.c;endline=28;md5=89da69a61d88eedcba066f42353fb75a \
+                    file://examples/example1.c;endline=29;md5=9d4dad9fcbbdf0441ee063f8af5170c9 \
+                    file://testsuite/trans.c;endline=29;md5=380ecd43121fe3dcc0d8d7e5984f283d"
+
+DEPENDS = "glib-2.0"
+PR = "r5"
+
+SRC_URI = "http://liboil.freedesktop.org/download/${BPN}-${PV}.tar.gz \
+           file://no-tests.patch \
+           file://fix-unaligned-whitelist.patch \
+           file://0001-Fix-enable-vfp-flag.patch \
+           file://liboil_fix_for_x32.patch \
+          "
+
+SRC_URI[md5sum] = "47dc734f82faeb2964d97771cfd2e701"
+SRC_URI[sha256sum] = "105f02079b0b50034c759db34b473ecb5704ffa20a5486b60a8b7698128bfc69"
+
+inherit autotools pkgconfig
+
+ARM_INSTRUCTION_SET = "arm"
diff --git a/meta/recipes-support/libpcre/libpcre/Makefile b/meta/recipes-support/libpcre/libpcre/Makefile
new file mode 100644
index 0000000..708d807
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/Makefile
@@ -0,0 +1,183 @@
+TESTS = pcre_stringpiece_unittest RunTest RunGrepTest
+subdir = .
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__tty_colors_dummy = \
+  mgn= red= grn= lgn= blu= brg= std=; \
+  am__color_tests=no
+am__tty_colors = { \
+  $(am__tty_colors_dummy); \
+  if test "X$(AM_COLOR_TESTS)" = Xno; then \
+    am__color_tests=no; \
+  elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
+    am__color_tests=yes; \
+  elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
+    am__color_tests=yes; \
+  fi; \
+  if test $$am__color_tests = yes; then \
+    red=''; \
+    grn=''; \
+    lgn=''; \
+    blu=''; \
+    mgn=''; \
+    brg=''; \
+    std=''; \
+  fi; \
+}
+am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
+am__sh_e_setup = case $$- in *e*) set +e;; esac
+am__common_driver_flags = \
+  --color-tests "$$am__color_tests" \
+  --enable-hard-errors "$$am__enable_hard_errors" \
+  --expect-failure "$$am__expect_failure"
+am__check_pre = \
+$(am__sh_e_setup); \
+$(am__vpath_adj_setup) $(am__vpath_adj) \
+$(am__tty_colors); \
+srcdir=$(srcdir); export srcdir; \
+case "$@" in \
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
+    *) am__odir=.;; \
+esac; \
+test "x$$am__odir" = x"." || test -d "$$am__odir" \
+  || $(MKDIR_P) "$$am__odir" || exit $$?; \
+if test -f "./$$f"; then dir=./; \
+elif test -f "$$f"; then dir=; \
+else dir="$(srcdir)/"; fi; \
+tst=$$dir$$f; log='$@'; \
+if test -n '$(DISABLE_HARD_ERRORS)'; then \
+  am__enable_hard_errors=no; \
+else \
+  am__enable_hard_errors=yes; \
+fi;
+am__set_TESTS_bases = \
+  bases='$(TEST_LOGS)'; \
+  bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
+  bases=`echo $$bases`
+RECHECK_LOGS = $(TEST_LOGS)
+TEST_SUITE_LOG = test-suite.log
+TEST_EXTENSIONS =  .test
+LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver
+am__test_logs1 = $(TESTS:=.log)
+am__test_logs2 = $(am__test_logs1:.log=.log)
+TEST_LOGS = $(am__test_logs2:.test.log=.log)
+MKDIR_P = /bin/mkdir -p
+PACKAGE_STRING = PCRE 8.36
+SHELL = /bin/sh
+srcdir = .
+top_srcdir = .
+$(TEST_SUITE_LOG): $(TEST_LOGS)
+	@$(am__set_TESTS_bases); \
+	am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
+	redo_bases=`for i in $$bases; do \
+	              am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
+	            done`; \
+	st=0;  \
+	errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
+	for i in $$redo_bases; do \
+	  test -f $$i.trs && test -r $$i.trs \
+	    || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
+	  test -f $$i.log && test -r $$i.log \
+	    || { echo "$$errmsg $$i.log" >&2; st=1; }; \
+	done; \
+	test $$st -eq 0 || exit 1;
+	@$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
+	ws='[ 	]'; \
+	results=`for b in $$bases; do echo $$b.trs; done`; \
+	test -n "$$results" || results=/dev/null; \
+	all=`  grep "^$$ws*:test-result:"           $$results | wc -l`; \
+	pass=` grep "^$$ws*:test-result:$$ws*PASS"  $$results | wc -l`; \
+	fail=` grep "^$$ws*:test-result:$$ws*FAIL"  $$results | wc -l`; \
+	skip=` grep "^$$ws*:test-result:$$ws*SKIP"  $$results | wc -l`; \
+	xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
+	xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
+	error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
+	if test `expr $$fail + $$xpass + $$error` -eq 0; then \
+	  success=true; \
+	else \
+	  success=false; \
+	fi; \
+	br='==================='; br=$$br$$br$$br$$br; \
+	result_count () \
+	{ \
+	    if test x"$$1" = x"--maybe-color"; then \
+	      maybe_colorize=yes; \
+	    elif test x"$$1" = x"--no-color"; then \
+	      maybe_colorize=no; \
+	    else \
+	      echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+	    fi; \
+	    shift; \
+	    desc=$$1 count=$$2; \
+	    if test $$maybe_colorize = yes && test $$count -gt 0; then \
+	      color_start=$$3 color_end=$$std; \
+	    else \
+	      color_start= color_end=; \
+	    fi; \
+	    echo "$${color_start}# $$desc $$count$${color_end}"; \
+	}; \
+	create_testsuite_report () \
+	{ \
+	  result_count $$1 "TOTAL:" $$all   "$$brg"; \
+	  result_count $$1 "PASS: " $$pass  "$$grn"; \
+	  result_count $$1 "SKIP: " $$skip  "$$blu"; \
+	  result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
+	  result_count $$1 "FAIL: " $$fail  "$$red"; \
+	  result_count $$1 "XPASS:" $$xpass "$$red"; \
+	  result_count $$1 "ERROR:" $$error "$$mgn"; \
+	}; \
+	{								\
+	  echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |	\
+	    $(am__rst_title);						\
+	  create_testsuite_report --no-color;				\
+	  echo;								\
+	  echo ".. contents:: :depth: 2";				\
+	  echo;								\
+	  for b in $$bases; do echo $$b; done;				\
+	} >$(TEST_SUITE_LOG).tmp || exit 1;				\
+	mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);			\
+	if $$success; then						\
+	  col="$$grn";							\
+	 else								\
+	  col="$$red";							\
+	  test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);		\
+	fi;								\
+	echo "$${col}$$br$${std}"; 					\
+	echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";	\
+	echo "$${col}$$br$${std}"; 					\
+	create_testsuite_report --maybe-color;				\
+	echo "$$col$$br$$std";						\
+	if $$success; then :; else					\
+	  echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";		\
+	  echo "$$col$$br$$std";					\
+	fi;								\
+	$$success || exit 1
+check-TESTS:
+	@list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
+	@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
+	@set +e; $(am__set_TESTS_bases); \
+	log_list=`for i in $$bases; do echo $$i.log; done`; \
+	log_list=`echo $$log_list`; \
+	$(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
+	exit $$?;
+pcre_stringpiece_unittest.log: pcre_stringpiece_unittest$(EXEEXT)
+	@p='pcre_stringpiece_unittest$(EXEEXT)'; \
+	b='pcre_stringpiece_unittest'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) -- "$$tst"
+RunTest.log: RunTest
+	@p='RunTest'; \
+	b='RunTest'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) -- "$$tst"
+RunGrepTest.log: RunGrepTest
+	@p='RunGrepTest'; \
+	b='RunGrepTest'; \
+	$(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+	--log-file $$b.log --trs-file $$b.trs \
+	$(am__common_driver_flags) -- "$$tst"
diff --git a/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch b/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch
new file mode 100644
index 0000000..89b44f6
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/fix-pcre-name-collision.patch
@@ -0,0 +1,41 @@
+Upstream-Status: Inappropriate [debian patch]
+
+This patch address a namespace collision with libc.
+
+Although there is no "#include <regex.h>" in the source file, at
+runtime, it's unintentionally linked to the libc version, the regcomp of
+libc is called instead the pcre one using pcre's data structure...
+that looks like a disaster.
+
+Can patch is from Debian (and Ubuntu 11.04alpha has it also).
+
+[sgw: added patch comment]
+Signed-off-by: Qing He <qing.he@intel.com>
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+--- a/pcreposix.h	2010-05-17 00:17:23.000000000 +0800
++++ b/pcreposix.h	2009-01-15 04:32:17.000000000 +0800
+@@ -133,14 +130,19 @@
+ 
+ /* The functions */
+ 
+-PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
+-PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
++PCREPOSIX_EXP_DECL int pcreposix_regcomp(regex_t *, const char *, int);
++PCREPOSIX_EXP_DECL int pcreposix_regexec(const regex_t *, const char *, size_t,
+                      regmatch_t *, int);
+-PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
+-PCREPOSIX_EXP_DECL void regfree(regex_t *);
++PCREPOSIX_EXP_DECL size_t pcreposix_regerror(int, const regex_t *, char *, size_t);
++PCREPOSIX_EXP_DECL void pcreposix_regfree(regex_t *);
+ 
+ #ifdef __cplusplus
+ }   /* extern "C" */
+ #endif
+ 
++#define regcomp pcreposix_regcomp
++#define regexec pcreposix_regexec
++#define regerror pcreposix_regerror
++#define regfree pcreposix_regfree
++
+ #endif /* End of pcreposix.h */
diff --git a/meta/recipes-support/libpcre/libpcre/pcre-cross.patch b/meta/recipes-support/libpcre/libpcre/pcre-cross.patch
new file mode 100644
index 0000000..83880f7
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/pcre-cross.patch
@@ -0,0 +1,48 @@
+Upstream-Status: Pending
+
+--- pcre-8.32.orig/Makefile.am
++++ pcre-8.32/Makefile.am
+@@ -197,8 +197,18 @@ bin_SCRIPTS = pcre-config
+ 
++CC_FOR_BUILD = @CC_FOR_BUILD@
++CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
++CCLD_FOR_BUILD = @CCLD_FOR_BUILD@
++LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
++
+ if WITH_REBUILD_CHARTABLES
+ 
+ noinst_PROGRAMS += dftables
+ dftables_SOURCES = dftables.c
++dftables_LINK = $(CCLD_FOR_BUILD) -o $@
++dftables_LDFLAGS = $(LDFLAGS_FOR_BUILD)
++
++dftables.o: $(srcdir)/dftables.c
++	$(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) -o $@ $(srcdir)/dftables.c
+ 
+ pcre_chartables.c: dftables$(EXEEXT)
+ 	./dftables$(EXEEXT) $@
+--- pcre-8.32.orig/configure.ac
++++ pcre-8.32/configure.ac
+@@ -72,6 +72,22 @@ then
+   fi
+ fi
+ 
++if test x"$cross_compiling" = xyes; then
++    CC_FOR_BUILD="${CC_FOR_BUILD-gcc}"
++    CCLD_FOR_BUILD="${CCLD_FOR_BUILD-gcc}"
++    CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD}"
++    LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD}"
++else
++    CC_FOR_BUILD="${CC_FOR_BUILD-\$(CC)}"
++    CCLD_FOR_BUILD="${CCLD_FOR_BUILD-\$(CCLD)}"
++    CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD-\$(CFLAGS)}"
++    LDFLAGS_FOR_BUILD="${LDFLAGS_FOR_BUILD-\$(LDFLAGS)}"
++fi
++AC_ARG_VAR(CC_FOR_BUILD, [build system C compiler])
++AC_ARG_VAR(CCLD_FOR_BUILD, [build system C linker frontend])
++AC_ARG_VAR(CFLAGS_FOR_BUILD, [build system C compiler arguments])
++AC_ARG_VAR(LDFLAGS_FOR_BUILD, [build system C linker frontend arguments])
++
+ # AC_PROG_CXX will return "g++" even if no c++ compiler is installed.
+ # Check for that case, and just disable c++ code if g++ doesn't run.
+ AC_LANG_PUSH(C++)
diff --git a/meta/recipes-support/libpcre/libpcre/run-ptest b/meta/recipes-support/libpcre/libpcre/run-ptest
new file mode 100644
index 0000000..990d4a1
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre/run-ptest
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make check-TESTS
diff --git a/meta/recipes-support/libpcre/libpcre_8.37.bb b/meta/recipes-support/libpcre/libpcre_8.37.bb
new file mode 100644
index 0000000..bcfc9e9
--- /dev/null
+++ b/meta/recipes-support/libpcre/libpcre_8.37.bb
@@ -0,0 +1,73 @@
+DESCRIPTION = "The PCRE library is a set of functions that implement regular \
+expression pattern matching using the same syntax and semantics as Perl 5. PCRE \
+has its own native API, as well as a set of wrapper functions that correspond \
+to the POSIX regular expression API."
+SUMMARY = "Perl Compatible Regular Expressions"
+HOMEPAGE = "http://www.pcre.org"
+SECTION = "devel"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENCE;md5=7e4937814aee14758c1c95b59c80c44d"
+SRC_URI = "${SOURCEFORGE_MIRROR}/project/pcre/pcre/${PV}/pcre-${PV}.tar.bz2 \
+           file://pcre-cross.patch \
+           file://fix-pcre-name-collision.patch \
+           file://run-ptest \
+           file://Makefile \
+"
+
+SRC_URI[md5sum] = "ed91be292cb01d21bc7e526816c26981"
+SRC_URI[sha256sum] = "51679ea8006ce31379fb0860e46dd86665d864b5020fc9cd19e71260eef4789d"
+
+S = "${WORKDIR}/pcre-${PV}"
+
+PROVIDES += "pcre"
+DEPENDS += "bzip2 zlib"
+
+PACKAGECONFIG[pcretest-readline] = "--enable-pcretest-libreadline,--disable-pcretest-libreadline,readline,"
+
+BINCONFIG = "${bindir}/pcre-config"
+
+inherit autotools binconfig-disabled ptest
+
+EXTRA_OECONF = "\
+    --enable-newline-is-lf \
+    --enable-rebuild-chartables \
+    --enable-utf8 \
+    --with-link-size=2 \
+    --with-match-limit=10000000 \
+"
+
+# Set LINK_SIZE in BUILD_CFLAGS given that the autotools bbclass use it to
+# set CFLAGS_FOR_BUILD, required for the libpcre build.
+BUILD_CFLAGS =+ "-DLINK_SIZE=2 -I${B}"
+CFLAGS += "-D_REENTRANT"
+CXXFLAGS_append_powerpc = " -lstdc++"
+
+PACKAGES =+ "libpcrecpp libpcreposix pcregrep pcregrep-doc pcretest pcretest-doc"
+
+SUMMARY_libpcrecpp = "${SUMMARY} - C++ wrapper functions"
+SUMMARY_libpcreposix = "${SUMMARY} - C wrapper functions based on the POSIX regex API"
+SUMMARY_pcregrep = "grep utility that uses perl 5 compatible regexes"
+SUMMARY_pcregrep-doc = "grep utility that uses perl 5 compatible regexes - docs"
+SUMMARY_pcretest = "program for testing Perl-comatible regular expressions"
+SUMMARY_pcretest-doc = "program for testing Perl-comatible regular expressions - docs"
+
+FILES_libpcrecpp = "${libdir}/libpcrecpp.so.*"
+FILES_libpcreposix = "${libdir}/libpcreposix.so.*"
+FILES_pcregrep = "${bindir}/pcregrep"
+FILES_pcregrep-doc = "${mandir}/man1/pcregrep.1"
+FILES_pcretest = "${bindir}/pcretest"
+FILES_pcretest-doc = "${mandir}/man1/pcretest.1"
+
+BBCLASSEXTEND = "native nativesdk"
+
+do_install_ptest() {
+	t=${D}${PTEST_PATH}
+	cp ${WORKDIR}/Makefile $t
+	cp -r ${S}/testdata $t
+	for i in pcre_stringpiece_unittest pcregrep pcretest; \
+	  do cp ${B}/.libs/$i $t; \
+	done
+	for i in RunTest RunGrepTest test-driver; \
+	  do cp ${S}/$i $t; \
+	done
+}
diff --git a/meta/recipes-support/libproxy/libproxy/0001-test-Include-sys-select.h-for-select.patch b/meta/recipes-support/libproxy/libproxy/0001-test-Include-sys-select.h-for-select.patch
new file mode 100644
index 0000000..5ae52f2
--- /dev/null
+++ b/meta/recipes-support/libproxy/libproxy/0001-test-Include-sys-select.h-for-select.patch
@@ -0,0 +1,37 @@
+From f5f2c2289eb35eb804c1c35e46ca41b58e4cae01 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 6 Apr 2015 14:13:49 -0700
+Subject: [PATCH] test: Include <sys/select.h> for select()
+
+As per posix we need to include this file otherwise we end up with errors like
+
+/home/kraj/work/bleeding/openembedded-core/build/tmp-musl/work/mips32r2-oe-linux-musl/libproxy/0.4.11-r0/libproxy-0.4.11/libproxy/test/get-pac-test.cpp: In member function 'bool TestServer::loop()':
+/home/kraj/work/bleeding/openembedded-core/build/tmp-musl/work/mips32r2-oe-linux-musl/libproxy/0.4.11-r0/libproxy-0.4.11/libproxy/test/get-pac-test.cpp:80:4: error: 'fd_set' was not declared in this scope
+    fd_set fds;
+    ^
+/home/kraj/work/bleeding/openembedded-core/build/tmp-musl/work/mips32r2-oe-linux-musl/libproxy/0.4.11-r0/libproxy-0.4.11/libproxy/test/get-pac-test.cpp:89:14: error: 'fds' was not declared in this scope
+    FD_ZERO (&fds);
+<JIRA TICKET #1>, <JIRA TICKET #2>, <JIRA TICKET #n> : <one line summary of change>
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libproxy/test/get-pac-test.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libproxy/test/get-pac-test.cpp b/libproxy/test/get-pac-test.cpp
+index a61fc4b..bda4646 100644
+--- a/libproxy/test/get-pac-test.cpp
++++ b/libproxy/test/get-pac-test.cpp
+@@ -3,6 +3,7 @@
+ #include <sstream>
+ #include <string>
+ 
++#include <sys/select.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+-- 
+2.1.4
+
diff --git a/meta/recipes-support/libproxy/libproxy_0.4.11.bb b/meta/recipes-support/libproxy/libproxy_0.4.11.bb
new file mode 100644
index 0000000..06d0b9b
--- /dev/null
+++ b/meta/recipes-support/libproxy/libproxy_0.4.11.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Library providing automatic proxy configuration management"
+HOMEPAGE = "http://code.google.com/p/libproxy/"
+BUGTRACKER = "http://code.google.com/p/libproxy/issues/list"
+SECTION = "libs"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
+                    file://utils/proxy.c;beginline=1;endline=18;md5=55152a1006d7dafbef32baf9c30a99c0"
+
+DEPENDS = "gconf glib-2.0"
+
+SRC_URI = "${DEBIAN_MIRROR}/main/libp/${BPN}/${BPN}_${PV}.orig.tar.gz \
+           file://0001-test-Include-sys-select.h-for-select.patch \
+          "
+SRC_URI[md5sum] = "3cd1ae2a4abecf44b3f24d6639d2cd84"
+SRC_URI[sha256sum] = "dc3f33de54163718f82b3e7c496a7de97f8862578414b8ecaad3cbfe4821864b"
+
+inherit cmake pkgconfig
+
+EXTRA_OECMAKE = "-DWITH_WEBKIT=no -DWITH_GNOME=yes -DWITH_KDE4=no \
+	      -DWITH_PYTHON=no -DWITH_PERL=no -DWITH_MOZJS=no -DWITH_NM=no -DLIB_INSTALL_DIR=${libdir} -DLIBEXEC_INSTALL_DIR=${libexecdir}"
+
+FILES_${PN} += "${libdir}/${BPN}/${PV}/modules"
+FILES_${PN}-dev += "${datadir}/cmake"
+FILES_${PN}-dbg += "${libdir}/${BPN}/${PV}/plugins/.debug/ ${libdir}/${BPN}/${PV}/modules/.debug/"
+
+do_configure_prepend() {
+	export HOST_SYS=${HOST_SYS}
+	export BUILD_SYS=${BUILD_SYS}
+}
+
+python() {
+    if incompatible_license_contains("GPLv3", "x", "", d) == "x" or bb.utils.contains("DISTRO_FEATURES", "x11", "x", "", d) == "":
+        d.setVar("EXTRA_OECMAKE", d.getVar("EXTRA_OECMAKE", False).replace("-DWITH_GNOME=yes", "-DWITH_GNOME=no"))
+        d.setVar("DEPENDS", " ".join(i for i in d.getVar("DEPENDS", False).split() if i != "gconf"))
+}
diff --git a/meta/recipes-support/libsoup/libsoup-2.4_2.50.0.bb b/meta/recipes-support/libsoup/libsoup-2.4_2.50.0.bb
new file mode 100644
index 0000000..044db31
--- /dev/null
+++ b/meta/recipes-support/libsoup/libsoup-2.4_2.50.0.bb
@@ -0,0 +1,28 @@
+SUMMARY = "An HTTP library implementation in C"
+HOMEPAGE = "http://www.gnome.org/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "LGPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"
+
+SECTION = "x11/gnome/libs"
+
+DEPENDS = "glib-2.0 gnutls libxml2 sqlite3 intltool-native"
+
+# libsoup-gnome is entirely deprecated and just stubs in 2.42 onwards.  Enable
+# by default but let it be easily disabled.
+PACKAGECONFIG ??= "gnome"
+PACKAGECONFIG[gnome] = "--with-gnome,--without-gnome"
+
+SHRT_VER = "${@bb.data.getVar('PV',d,1).split('.')[0]}.${@bb.data.getVar('PV',d,1).split('.')[1]}"
+SRC_URI = "${GNOME_MIRROR}/libsoup/${SHRT_VER}/libsoup-${PV}.tar.xz"
+
+SRC_URI[md5sum] = "9a84d66e1b7ccd3bd340574b11eccc15"
+SRC_URI[sha256sum] = "1e01365ac4af3817187ea847f9d3588c27eee01fc519a5a7cb212bb78b0f667b"
+
+S = "${WORKDIR}/libsoup-${PV}"
+
+inherit autotools gettext pkgconfig
+
+# glib-networking is needed for SSL, proxies, etc.
+RRECOMMENDS_${PN} = "glib-networking"
diff --git a/meta/recipes-support/libunistring/libunistring/0001-Unset-need_charset_alias-when-building-for-musl.patch b/meta/recipes-support/libunistring/libunistring/0001-Unset-need_charset_alias-when-building-for-musl.patch
new file mode 100644
index 0000000..2aeacb8
--- /dev/null
+++ b/meta/recipes-support/libunistring/libunistring/0001-Unset-need_charset_alias-when-building-for-musl.patch
@@ -0,0 +1,30 @@
+From b9565dc2fe0c4f7daaec91b7e83bc7313dee2f4a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 13 Apr 2015 17:02:13 -0700
+Subject: [PATCH] Unset need_charset_alias when building for musl
+
+localcharset uses ac_cv_gnu_library_2_1 from glibc21.m4
+which actually shoudl be fixed in gnulib and then all downstream
+projects will get it eventually. For now we apply the fix to
+coreutils
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ lib/gnulib.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: libunistring-0.9.4/lib/Makefile.gnulib
+===================================================================
+--- libunistring-0.9.4.orig/lib/Makefile.gnulib
++++ libunistring-0.9.4/lib/Makefile.gnulib
+@@ -380,7 +380,7 @@ install-exec-localcharset: all-local
+ 	  case '$(host_os)' in \
+ 	    darwin[56]*) \
+ 	      need_charset_alias=true ;; \
+-	    darwin* | cygwin* | mingw* | pw32* | cegcc*) \
++	    darwin* | cygwin* | mingw* | pw32* | cegcc* | linux-musl*) \
+ 	      need_charset_alias=false ;; \
+ 	    *) \
+ 	      need_charset_alias=true ;; \
diff --git a/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch b/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch
new file mode 100644
index 0000000..d448916
--- /dev/null
+++ b/meta/recipes-support/libunistring/libunistring/iconv-m4-remove-the-test-to-convert-euc-jp.patch
@@ -0,0 +1,40 @@
+From 8d99a368615656a835f5502326afd31cec2cebfe Mon Sep 17 00:00:00 2001
+From: Jackie Huang <jackie.huang@windriver.com>
+Date: Mon, 16 Sep 2013 18:16:12 +0800
+Subject: [PATCH] remove the test to convert euc-jp
+
+Remove the test "Test against HP-UX 11.11 bug:
+No converter from EUC-JP to UTF-8 is provided"
+since we don't support HP-UX and if the euc-jp is not
+installed on the host, libunistring will be built without
+iconv support and will cause guild-native configure fail.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
+---
+ gnulib-m4/iconv.m4 |   11 -----------
+ 1 files changed, 0 insertions(+), 11 deletions(-)
+
+Index: libunistring-0.9.4/gnulib-m4/iconv.m4
+===================================================================
+--- libunistring-0.9.4.orig/gnulib-m4/iconv.m4	2014-11-03 17:41:29.755011917 +0000
++++ libunistring-0.9.4/gnulib-m4/iconv.m4	2014-11-03 17:43:03.795014480 +0000
+@@ -159,17 +159,6 @@
+       }
+   }
+ #endif
+-  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+-     provided.  */
+-  if (/* Try standardized names.  */
+-      iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1)
+-      /* Try IRIX, OSF/1 names.  */
+-      && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1)
+-      /* Try AIX names.  */
+-      && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1)
+-      /* Try HP-UX names.  */
+-      && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
+-    result |= 16;
+   return result;
+ }]])],
+         [am_cv_func_iconv_works=yes],
diff --git a/meta/recipes-support/libunistring/libunistring_0.9.5.bb b/meta/recipes-support/libunistring/libunistring_0.9.5.bb
new file mode 100644
index 0000000..45cf633
--- /dev/null
+++ b/meta/recipes-support/libunistring/libunistring_0.9.5.bb
@@ -0,0 +1,28 @@
+SUMMARY = "Library for manipulating C and Unicode strings"
+
+DESCRIPTION = "Text files are nowadays usually encoded in Unicode, and may\
+ consist of very different scripts from Latin letters to Chinese Hanzi\
+ with many kinds of special characters accents, right-to-left writing\
+ marks, hyphens, Roman numbers, and much more. But the POSIX platform\
+ APIs for text do not contain adequate functions for dealing with\
+ particular properties of many Unicode characters. In fact, the POSIX\
+ APIs for text have several assumptions at their base which don't hold\
+ for Unicode text.  This library provides functions for manipulating\
+ Unicode strings and for manipulating C strings according to the Unicode\
+ standard.  This package contains documentation."
+
+HOMEPAGE = "http://www.gnu.org/software/libunistring/"
+SECTION = "devel"
+LICENSE = "GPLv3 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://COPYING.LIB;md5=6a6a8e020838b23406c81b19c1d46df6"
+
+SRC_URI = "${GNU_MIRROR}/libunistring/libunistring-${PV}.tar.gz \
+           file://iconv-m4-remove-the-test-to-convert-euc-jp.patch \
+           file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+"
+SRC_URI[md5sum] = "1a705bcdcb83799d544137617b377cfd"
+SRC_URI[sha256sum] = "1a8c0772467850bef7197318a95f44abbb678ea83cbf119a3500cc7848276a17"
+
+inherit autotools texinfo
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/libunwind/libunwind-1.1/0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch b/meta/recipes-support/libunwind/libunwind-1.1/0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch
new file mode 100644
index 0000000..af972f8
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind-1.1/0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch
@@ -0,0 +1,29 @@
+From 396b6c7ab737e2bff244d640601c436a26260ca1 Mon Sep 17 00:00:00 2001
+From: Arun Sharma <arun@sharma-home.net>
+Date: Fri, 19 Jun 2015 19:47:22 -0700
+Subject: [PATCH] Invalid dwarf opcodes can cause references beyond the end of
+ the array.
+
+Upstream-Status: backport
+
+Signed-off-by: Li Zhou <li.zhou@windriver.com>
+---
+ include/dwarf_i.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/dwarf_i.h b/include/dwarf_i.h
+index 1e6231e..4a02a7d 100644
+--- a/include/dwarf_i.h
++++ b/include/dwarf_i.h
+@@ -20,7 +20,7 @@
+ extern const uint8_t dwarf_to_unw_regnum_map[DWARF_REGNUM_MAP_LENGTH];
+ /* REG is evaluated multiple times; it better be side-effects free!  */
+ # define dwarf_to_unw_regnum(reg)					  \
+-  (((reg) <= DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
++  (((reg) < DWARF_REGNUM_MAP_LENGTH) ? dwarf_to_unw_regnum_map[reg] : 0)
+ #endif
+ 
+ #ifdef UNW_LOCAL_ONLY
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-support/libunwind/libunwind-1.1/AArch64-port.patch b/meta/recipes-support/libunwind/libunwind-1.1/AArch64-port.patch
new file mode 100644
index 0000000..228ec32
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind-1.1/AArch64-port.patch
@@ -0,0 +1,2529 @@
+From ac6c0a6535975f1dc2da6e4e2766614baac2a14a Mon Sep 17 00:00:00 2001
+From: Yvan Roux <yvan.roux@linaro.org>
+Date: Sat, 11 May 2013 09:18:23 -0600
+Subject: [PATCH] AArch64 port.
+
+Upstream-Status: Backport
+
+---
+ Makefile.am                          |    6 
+ README                               |    1 
+ configure.ac                         |    6 
+ include/libunwind-aarch64.h          |  187 ++++++++++++++++++++++
+ include/libunwind.h.in               |    4 
+ include/tdep-aarch64/dwarf-config.h  |   52 ++++++
+ include/tdep-aarch64/jmpbuf.h        |   33 +++
+ include/tdep-aarch64/libunwind_i.h   |  294 +++++++++++++++++++++++++++++++++++
+ include/tdep/dwarf-config.h          |    4 
+ include/tdep/jmpbuf.h                |    2 
+ include/tdep/libunwind_i.h.in        |    4 
+ src/Makefile.am                      |   39 ++++
+ src/aarch64/Gcreate_addr_space.c     |   60 +++++++
+ src/aarch64/Gget_proc_info.c         |   39 ++++
+ src/aarch64/Gget_save_loc.c          |  100 +++++++++++
+ src/aarch64/Gglobal.c                |   57 ++++++
+ src/aarch64/Ginit.c                  |  187 ++++++++++++++++++++++
+ src/aarch64/Ginit_local.c            |   55 ++++++
+ src/aarch64/Ginit_remote.c           |   45 +++++
+ src/aarch64/Gis_signal_frame.c       |   64 +++++++
+ src/aarch64/Gregs.c                  |  113 +++++++++++++
+ src/aarch64/Gresume.c                |  177 +++++++++++++++++++++
+ src/aarch64/Gstep.c                  |  129 +++++++++++++++
+ src/aarch64/Lcreate_addr_space.c     |    5 
+ src/aarch64/Lget_proc_info.c         |    5 
+ src/aarch64/Lget_save_loc.c          |    5 
+ src/aarch64/Lglobal.c                |    5 
+ src/aarch64/Linit.c                  |    5 
+ src/aarch64/Linit_local.c            |    5 
+ src/aarch64/Linit_remote.c           |    5 
+ src/aarch64/Lis_signal_frame.c       |    5 
+ src/aarch64/Lregs.c                  |    5 
+ src/aarch64/Lresume.c                |    5 
+ src/aarch64/Lstep.c                  |    5 
+ src/aarch64/gen-offsets.c            |   68 ++++++++
+ src/aarch64/init.h                   |  127 +++++++++++++++
+ src/aarch64/is_fpreg.c               |   32 +++
+ src/aarch64/offsets.h                |   49 +++++
+ src/aarch64/regname.c                |  106 ++++++++++++
+ src/aarch64/siglongjmp.S             |   12 +
+ src/aarch64/unwind_i.h               |   43 +++++
+ src/coredump/_UCD_access_reg_linux.c |    5 
+ src/ptrace/_UPT_reg_offset.c         |   36 ++++
+ 43 files changed, 2184 insertions(+), 7 deletions(-)
+ create mode 100644 include/libunwind-aarch64.h
+ create mode 100644 include/tdep-aarch64/dwarf-config.h
+ create mode 100644 include/tdep-aarch64/jmpbuf.h
+ create mode 100644 include/tdep-aarch64/libunwind_i.h
+ create mode 100644 src/aarch64/Gcreate_addr_space.c
+ create mode 100644 src/aarch64/Gget_proc_info.c
+ create mode 100644 src/aarch64/Gget_save_loc.c
+ create mode 100644 src/aarch64/Gglobal.c
+ create mode 100644 src/aarch64/Ginit.c
+ create mode 100644 src/aarch64/Ginit_local.c
+ create mode 100644 src/aarch64/Ginit_remote.c
+ create mode 100644 src/aarch64/Gis_signal_frame.c
+ create mode 100644 src/aarch64/Gregs.c
+ create mode 100644 src/aarch64/Gresume.c
+ create mode 100644 src/aarch64/Gstep.c
+ create mode 100644 src/aarch64/Lcreate_addr_space.c
+ create mode 100644 src/aarch64/Lget_proc_info.c
+ create mode 100644 src/aarch64/Lget_save_loc.c
+ create mode 100644 src/aarch64/Lglobal.c
+ create mode 100644 src/aarch64/Linit.c
+ create mode 100644 src/aarch64/Linit_local.c
+ create mode 100644 src/aarch64/Linit_remote.c
+ create mode 100644 src/aarch64/Lis_signal_frame.c
+ create mode 100644 src/aarch64/Lregs.c
+ create mode 100644 src/aarch64/Lresume.c
+ create mode 100644 src/aarch64/Lstep.c
+ create mode 100644 src/aarch64/gen-offsets.c
+ create mode 100644 src/aarch64/init.h
+ create mode 100644 src/aarch64/is_fpreg.c
+ create mode 100644 src/aarch64/offsets.h
+ create mode 100644 src/aarch64/regname.c
+ create mode 100644 src/aarch64/siglongjmp.S
+ create mode 100644 src/aarch64/unwind_i.h
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,6 +2,9 @@ include_HEADERS = include/libunwind-dyna
+     include/libunwind-ptrace.h \
+     include/libunwind-coredump.h
+ 
++if ARCH_AARCH64
++include_HEADERS += include/libunwind-aarch64.h
++endif
+ if ARCH_ARM
+ include_HEADERS += include/libunwind-arm.h
+ endif
+@@ -41,6 +44,9 @@ SUBDIRS = src tests doc
+ noinst_HEADERS = include/dwarf.h include/dwarf_i.h include/dwarf-eh.h	\
+ 	include/compiler.h include/libunwind_i.h include/mempool.h	\
+ 	include/remote.h						\
++	include/tdep-aarch64/dwarf-config.h				\
++	include/tdep-aarch64/jmpbuf.h					\
++	include/tdep-aarch64/libunwind_i.h				\
+ 	include/tdep-arm/dwarf-config.h	include/tdep-arm/ex_tables.h	\
+ 	include/tdep-arm/jmpbuf.h include/tdep-arm/libunwind_i.h	\
+ 	include/tdep-ia64/jmpbuf.h include/tdep-ia64/rse.h 		\
+--- a/README
++++ b/README
+@@ -9,6 +9,7 @@ several architecture/operating-system co
+  Linux/IA-64:	Fully tested and supported.
+  Linux/PARISC:	Works well, but C library missing unwind-info.
+  HP-UX/IA-64:	Mostly works but known to have some serious limitations.
++ Linux/AArch64:	Newly added.
+  Linux/PPC64:	Newly added.
+  Linux/SuperH:	Newly added.
+  FreeBSD/i386:	Newly added.
+--- a/configure.ac
++++ b/configure.ac
+@@ -104,7 +104,7 @@ SET_ARCH([$target_cpu],[target_arch])
+ 
+ AC_ARG_ENABLE(coredump,
+ 	AS_HELP_STRING([--enable-coredump],[building libunwind-coredump library]),,
+-        [AS_CASE([$host_arch], [arm*|mips*|sh*|x86*], [enable_coredump=yes], [enable_coredump=no])]
++        [AS_CASE([$host_arch], [aarch64*|arm*|mips*|sh*|x86*], [enable_coredump=yes], [enable_coredump=no])]
+ )
+ 
+ AC_MSG_CHECKING([if we should build libunwind-coredump])
+@@ -121,6 +121,7 @@ AC_MSG_RESULT([$target_os])
+ 
+ AM_CONDITIONAL(BUILD_COREDUMP, test x$enable_coredump = xyes)
+ AM_CONDITIONAL(REMOTE_ONLY, test x$target_arch != x$host_arch)
++AM_CONDITIONAL(ARCH_AARCH64, test x$target_arch = xaarch64)
+ AM_CONDITIONAL(ARCH_ARM, test x$target_arch = xarm)
+ AM_CONDITIONAL(ARCH_IA64, test x$target_arch = xia64)
+ AM_CONDITIONAL(ARCH_HPPA, test x$target_arch = xhppa)
+@@ -137,7 +138,7 @@ AM_CONDITIONAL(OS_FREEBSD, expr x$target
+ AC_MSG_CHECKING([for ELF helper width])
+ case "${target_arch}" in
+ (arm|hppa|ppc32|x86|sh) use_elf32=yes; AC_MSG_RESULT([32]);;
+-(ia64|ppc64|x86_64)    use_elf64=yes; AC_MSG_RESULT([64]);;
++(aarch64|ia64|ppc64|x86_64)    use_elf64=yes; AC_MSG_RESULT([64]);;
+ (mips)                 use_elfxx=yes; AC_MSG_RESULT([xx]);;
+ *)                     AC_MSG_ERROR([Unknown ELF target: ${target_arch}])
+ esac
+@@ -186,6 +187,7 @@ AS_HELP_STRING([--enable-cxx-exceptions]
+ # C++ exception handling doesn't work too well on x86
+ case $target_arch in
+   x86*) enable_cxx_exceptions=no;;
++  aarch64*) enable_cxx_exceptions=no;;
+   arm*) enable_cxx_exceptions=no;;
+   mips*) enable_cxx_exceptions=no;;
+   *) enable_cxx_exceptions=yes;;
+--- /dev/null
++++ b/include/libunwind-aarch64.h
+@@ -0,0 +1,187 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2001-2004 Hewlett-Packard Co
++	Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#ifndef LIBUNWIND_H
++#define LIBUNWIND_H
++
++#if defined(__cplusplus) || defined(c_plusplus)
++extern "C" {
++#endif
++
++#include <inttypes.h>
++#include <stddef.h>
++#include <ucontext.h>
++
++#define UNW_TARGET	aarch64
++#define UNW_TARGET_AARCH64	1
++
++#define _U_TDEP_QP_TRUE	0	/* see libunwind-dynamic.h  */
++
++/* This needs to be big enough to accommodate "struct cursor", while
++   leaving some slack for future expansion.  Changing this value will
++   require recompiling all users of this library.  Stack allocation is
++   relatively cheap and unwind-state copying is relatively rare, so we
++   want to err on making it rather too big than too small.  */
++
++#define UNW_TDEP_CURSOR_LEN	4096
++
++typedef uint64_t unw_word_t;
++typedef int64_t unw_sword_t;
++
++typedef long double unw_tdep_fpreg_t;
++
++typedef struct
++  {
++    /* no aarch64-specific auxiliary proc-info */
++  }
++unw_tdep_proc_info_t;
++
++typedef enum
++  {
++    /* 64-bit general registers.  */
++    UNW_AARCH64_X0,
++    UNW_AARCH64_X1,
++    UNW_AARCH64_X2,
++    UNW_AARCH64_X3,
++    UNW_AARCH64_X4,
++    UNW_AARCH64_X5,
++    UNW_AARCH64_X6,
++    UNW_AARCH64_X7,
++    UNW_AARCH64_X8,
++
++    /* Temporary registers.  */
++    UNW_AARCH64_X9,
++    UNW_AARCH64_X10,
++    UNW_AARCH64_X11,
++    UNW_AARCH64_X12,
++    UNW_AARCH64_X13,
++    UNW_AARCH64_X14,
++    UNW_AARCH64_X15,
++
++    /* Intra-procedure-call temporary registers.  */
++    UNW_AARCH64_X16,
++    UNW_AARCH64_X17,
++
++    /* Callee-saved registers.  */
++    UNW_AARCH64_X18,
++    UNW_AARCH64_X19,
++    UNW_AARCH64_X20,
++    UNW_AARCH64_X21,
++    UNW_AARCH64_X22,
++    UNW_AARCH64_X23,
++    UNW_AARCH64_X24,
++    UNW_AARCH64_X25,
++    UNW_AARCH64_X26,
++    UNW_AARCH64_X27,
++    UNW_AARCH64_X28,
++
++    /* 64-bit frame pointer.  */
++    UNW_AARCH64_X29,
++
++    /* 64-bit link register.  */
++    UNW_AARCH64_X30,
++
++    /* 64-bit stack pointer.  */
++    UNW_AARCH64_SP =  31,
++    UNW_AARCH64_PC,
++    UNW_AARCH64_PSTATE,
++
++    /* 128-bit FP/Advanced SIMD registers.  */
++    UNW_AARCH64_V0 = 64,
++    UNW_AARCH64_V1,
++    UNW_AARCH64_V2,
++    UNW_AARCH64_V3,
++    UNW_AARCH64_V4,
++    UNW_AARCH64_V5,
++    UNW_AARCH64_V6,
++    UNW_AARCH64_V7,
++    UNW_AARCH64_V8,
++    UNW_AARCH64_V9,
++    UNW_AARCH64_V10,
++    UNW_AARCH64_V11,
++    UNW_AARCH64_V12,
++    UNW_AARCH64_V13,
++    UNW_AARCH64_V14,
++    UNW_AARCH64_V15,
++    UNW_AARCH64_V16,
++    UNW_AARCH64_V17,
++    UNW_AARCH64_V18,
++    UNW_AARCH64_V19,
++    UNW_AARCH64_V20,
++    UNW_AARCH64_V21,
++    UNW_AARCH64_V22,
++    UNW_AARCH64_V23,
++    UNW_AARCH64_V24,
++    UNW_AARCH64_V25,
++    UNW_AARCH64_V26,
++    UNW_AARCH64_V27,
++    UNW_AARCH64_V28,
++    UNW_AARCH64_V29,
++    UNW_AARCH64_V30,
++    UNW_AARCH64_V31,
++
++    UNW_AARCH64_FPSR,
++    UNW_AARCH64_FPCR,
++
++    /* For AArch64, the CFA is the value of SP (x31) at the call site of the
++       previous frame.  */
++    UNW_AARCH64_CFA = UNW_AARCH64_SP,
++
++    UNW_TDEP_LAST_REG = UNW_AARCH64_FPCR,
++
++    UNW_TDEP_IP = UNW_AARCH64_X30,
++    UNW_TDEP_SP = UNW_AARCH64_SP,
++    UNW_TDEP_EH = UNW_AARCH64_X0,
++
++  }
++aarch64_regnum_t;
++
++/* Use R0 through R3 to pass exception handling information.  */
++#define UNW_TDEP_NUM_EH_REGS	4
++
++typedef struct unw_tdep_save_loc
++  {
++    /* Additional target-dependent info on a save location.  */
++  }
++unw_tdep_save_loc_t;
++
++
++/* On AArch64, we can directly use ucontext_t as the unwind context.  */
++typedef ucontext_t unw_tdep_context_t;
++
++#include "libunwind-common.h"
++#include "libunwind-dynamic.h"
++
++#define unw_tdep_getcontext(uc)         (getcontext (uc), 0)
++#define unw_tdep_is_fpreg		UNW_ARCH_OBJ(is_fpreg)
++
++extern int unw_tdep_is_fpreg (int);
++
++#if defined(__cplusplus) || defined(c_plusplus)
++}
++#endif
++
++#endif /* LIBUNWIND_H */
+--- a/include/libunwind.h.in
++++ b/include/libunwind.h.in
+@@ -3,7 +3,9 @@
+ 
+ #ifndef UNW_REMOTE_ONLY
+ 
+-#if defined __arm__
++#if defined __aarch64__
++#include "libunwind-aarch64.h"
++#elif defined __arm__
+ # include "libunwind-arm.h"
+ #elif defined __hppa__
+ # include "libunwind-hppa.h"
+--- /dev/null
++++ b/include/tdep-aarch64/dwarf-config.h
+@@ -0,0 +1,52 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#ifndef dwarf_config_h
++#define dwarf_config_h
++
++/* This matches the value udes by GCC (see
++   gcc/config/aarch64/aarch64.h:DWARF_FRAME_REGISTERS.  */
++#define DWARF_NUM_PRESERVED_REGS	97
++
++/* Return TRUE if the ADDR_SPACE uses big-endian byte-order.  */
++#define dwarf_is_big_endian(addr_space)	0
++
++#define dwarf_to_unw_regnum(reg) (((reg) <= UNW_AARCH64_V31) ? (reg) : 0)
++
++/* Convert a pointer to a dwarf_cursor structure to a pointer to
++   unw_cursor_t.  */
++#define dwarf_to_cursor(c)	((unw_cursor_t *) (c))
++
++typedef struct dwarf_loc
++  {
++    unw_word_t val;
++#ifndef UNW_LOCAL_ONLY
++    unw_word_t type;		/* see DWARF_LOC_TYPE_* macros.  */
++#endif
++  }
++dwarf_loc_t;
++
++#endif /* dwarf_config_h */
+--- /dev/null
++++ b/include/tdep-aarch64/jmpbuf.h
+@@ -0,0 +1,33 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++/* Use glibc's jump-buffer indices; NPTL peeks at SP: */
++
++/* FIXME for AArch64  */
++
++#define JB_SP		13
++#define JB_RP		14
++#define JB_MASK_SAVED	15
++#define JB_MASK		16
+--- /dev/null
++++ b/include/tdep-aarch64/libunwind_i.h
+@@ -0,0 +1,294 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2001-2005 Hewlett-Packard Co
++	Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#ifndef AARCH64_LIBUNWIND_I_H
++#define AARCH64_LIBUNWIND_I_H
++
++/* Target-dependent definitions that are internal to libunwind but need
++   to be shared with target-independent code.  */
++
++#include <stdlib.h>
++#include <libunwind.h>
++
++#include "elf64.h"
++#include "mempool.h"
++#include "dwarf.h"
++
++typedef struct
++  {
++    /* no aarch64-specific fast trace */
++  }
++unw_tdep_frame_t;
++
++#ifdef UNW_LOCAL_ONLY
++
++typedef unw_word_t aarch64_loc_t;
++
++#else /* !UNW_LOCAL_ONLY */
++
++typedef struct aarch64_loc
++  {
++    unw_word_t w0, w1;
++  }
++aarch64_loc_t;
++
++#endif /* !UNW_LOCAL_ONLY */
++
++struct unw_addr_space
++  {
++    struct unw_accessors acc;
++    int big_endian;
++    unw_caching_policy_t caching_policy;
++#ifdef HAVE_ATOMIC_OPS_H
++    AO_t cache_generation;
++#else
++    uint32_t cache_generation;
++#endif
++    unw_word_t dyn_generation;          /* see dyn-common.h */
++    unw_word_t dyn_info_list_addr;	/* (cached) dyn_info_list_addr */
++    struct dwarf_rs_cache global_cache;
++    struct unw_debug_frame_list *debug_frames;
++   };
++
++struct cursor
++  {
++    struct dwarf_cursor dwarf;          /* must be first */
++    enum
++      {
++        AARCH64_SCF_NONE,
++        AARCH64_SCF_LINUX_RT_SIGFRAME,
++      }
++    sigcontext_format;
++    unw_word_t sigcontext_addr;
++    unw_word_t sigcontext_sp;
++    unw_word_t sigcontext_pc;
++  };
++
++#define DWARF_GET_LOC(l)        ((l).val)
++
++#ifdef UNW_LOCAL_ONLY
++# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
++# define DWARF_IS_NULL_LOC(l)   (DWARF_GET_LOC (l) == 0)
++# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r) })
++# define DWARF_IS_REG_LOC(l)    0
++# define DWARF_REG_LOC(c,r)     (DWARF_LOC((unw_word_t)                      \
++                                 tdep_uc_addr((c)->as_arg, (r)), 0))
++# define DWARF_MEM_LOC(c,m)     DWARF_LOC ((m), 0)
++# define DWARF_FPREG_LOC(c,r)   (DWARF_LOC((unw_word_t)                      \
++                                 tdep_uc_addr((c)->as_arg, (r)), 0))
++
++static inline int
++dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val)
++{
++  if (!DWARF_GET_LOC (loc))
++    return -1;
++  *val = *(unw_fpreg_t *) DWARF_GET_LOC (loc);
++  return 0;
++}
++
++static inline int
++dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val)
++{
++  if (!DWARF_GET_LOC (loc))
++    return -1;
++  *(unw_fpreg_t *) DWARF_GET_LOC (loc) = val;
++  return 0;
++}
++
++static inline int
++dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val)
++{
++  if (!DWARF_GET_LOC (loc))
++    return -1;
++  *val = *(unw_word_t *) DWARF_GET_LOC (loc);
++  return 0;
++}
++
++static inline int
++dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val)
++{
++  if (!DWARF_GET_LOC (loc))
++    return -1;
++  *(unw_word_t *) DWARF_GET_LOC (loc) = val;
++  return 0;
++}
++
++#else /* !UNW_LOCAL_ONLY */
++# define DWARF_LOC_TYPE_FP      (1 << 0)
++# define DWARF_LOC_TYPE_REG     (1 << 1)
++# define DWARF_NULL_LOC         DWARF_LOC (0, 0)
++# define DWARF_IS_NULL_LOC(l)                                           \
++                ({ dwarf_loc_t _l = (l); _l.val == 0 && _l.type == 0; })
++# define DWARF_LOC(r, t)        ((dwarf_loc_t) { .val = (r), .type = (t) })
++# define DWARF_IS_REG_LOC(l)    (((l).type & DWARF_LOC_TYPE_REG) != 0)
++# define DWARF_IS_FP_LOC(l)     (((l).type & DWARF_LOC_TYPE_FP) != 0)
++# define DWARF_REG_LOC(c,r)     DWARF_LOC((r), DWARF_LOC_TYPE_REG)
++# define DWARF_MEM_LOC(c,m)     DWARF_LOC ((m), 0)
++# define DWARF_FPREG_LOC(c,r)   DWARF_LOC((r), (DWARF_LOC_TYPE_REG      \
++                                                | DWARF_LOC_TYPE_FP))
++
++static inline int
++dwarf_getfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t *val)
++{
++  char *valp = (char *) &val;
++  unw_word_t addr;
++  int ret;
++
++  if (DWARF_IS_NULL_LOC (loc))
++    return -UNW_EBADREG;
++
++  if (DWARF_IS_REG_LOC (loc))
++    return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc),
++                                       val, 0, c->as_arg);
++
++  addr = DWARF_GET_LOC (loc);
++  if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp,
++                                       0, c->as_arg)) < 0)
++    return ret;
++
++  return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1, 0,
++                                   c->as_arg);
++}
++
++static inline int
++dwarf_putfp (struct dwarf_cursor *c, dwarf_loc_t loc, unw_fpreg_t val)
++{
++  char *valp = (char *) &val;
++  unw_word_t addr;
++  int ret;
++
++  if (DWARF_IS_NULL_LOC (loc))
++    return -UNW_EBADREG;
++
++  if (DWARF_IS_REG_LOC (loc))
++    return (*c->as->acc.access_fpreg) (c->as, DWARF_GET_LOC (loc),
++                                       &val, 1, c->as_arg);
++
++  addr = DWARF_GET_LOC (loc);
++  if ((ret = (*c->as->acc.access_mem) (c->as, addr + 0, (unw_word_t *) valp,
++                                       1, c->as_arg)) < 0)
++    return ret;
++
++  return (*c->as->acc.access_mem) (c->as, addr + 4, (unw_word_t *) valp + 1,
++                                   1, c->as_arg);
++}
++
++static inline int
++dwarf_get (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t *val)
++{
++  if (DWARF_IS_NULL_LOC (loc))
++    return -UNW_EBADREG;
++
++  /* If a code-generator were to save a value of type unw_word_t in a
++     floating-point register, we would have to support this case.  I
++     suppose it could happen with MMX registers, but does it really
++     happen?  */
++  assert (!DWARF_IS_FP_LOC (loc));
++
++  if (DWARF_IS_REG_LOC (loc))
++    return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), val,
++                                     0, c->as_arg);
++  else
++    return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), val,
++                                     0, c->as_arg);
++}
++
++static inline int
++dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc, unw_word_t val)
++{
++  if (DWARF_IS_NULL_LOC (loc))
++    return -UNW_EBADREG;
++
++  /* If a code-generator were to save a value of type unw_word_t in a
++     floating-point register, we would have to support this case.  I
++     suppose it could happen with MMX registers, but does it really
++     happen?  */
++  assert (!DWARF_IS_FP_LOC (loc));
++
++  if (DWARF_IS_REG_LOC (loc))
++    return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), &val,
++                                     1, c->as_arg);
++  else
++    return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val,
++                                     1, c->as_arg);
++}
++
++#endif /* !UNW_LOCAL_ONLY */
++
++
++
++#define tdep_getcontext_trace           unw_getcontext
++#define tdep_init_done			UNW_OBJ(init_done)
++#define tdep_init			UNW_OBJ(init)
++/* Platforms that support UNW_INFO_FORMAT_TABLE need to define
++   tdep_search_unwind_table.  */
++#define tdep_search_unwind_table	dwarf_search_unwind_table
++#define tdep_find_unwind_table	        dwarf_find_unwind_table
++#define tdep_uc_addr			UNW_OBJ(uc_addr)
++#define tdep_get_elf_image		UNW_ARCH_OBJ(get_elf_image)
++#define tdep_access_reg			UNW_OBJ(access_reg)
++#define tdep_access_fpreg		UNW_OBJ(access_fpreg)
++#define tdep_fetch_frame(c,ip,n)	do {} while(0)
++#define tdep_cache_frame(c,rs)		do {} while(0)
++#define tdep_reuse_frame(c,rs)		do {} while(0)
++#define tdep_stash_frame(c,rs)		do {} while(0)
++#define tdep_trace(cur,addr,n)		(-UNW_ENOINFO)
++
++#ifdef UNW_LOCAL_ONLY
++# define tdep_find_proc_info(c,ip,n)                            \
++        dwarf_find_proc_info((c)->as, (ip), &(c)->pi, (n),      \
++                                       (c)->as_arg)
++# define tdep_put_unwind_info(as,pi,arg)                \
++        dwarf_put_unwind_info((as), (pi), (arg))
++#else
++# define tdep_find_proc_info(c,ip,n)                                    \
++        (*(c)->as->acc.find_proc_info)((c)->as, (ip), &(c)->pi, (n),    \
++                                       (c)->as_arg)
++# define tdep_put_unwind_info(as,pi,arg)                \
++        (*(as)->acc.put_unwind_info)((as), (pi), (arg))
++#endif
++
++#define tdep_get_as(c)                  ((c)->dwarf.as)
++#define tdep_get_as_arg(c)              ((c)->dwarf.as_arg)
++#define tdep_get_ip(c)                  ((c)->dwarf.ip)
++#define tdep_big_endian(as)             ((as)->big_endian)
++
++extern int tdep_init_done;
++
++extern void tdep_init (void);
++extern int tdep_search_unwind_table (unw_addr_space_t as, unw_word_t ip,
++				     unw_dyn_info_t *di, unw_proc_info_t *pi,
++				     int need_unwind_info, void *arg);
++extern void *tdep_uc_addr (unw_tdep_context_t *uc, int reg);
++extern int tdep_get_elf_image (struct elf_image *ei, pid_t pid, unw_word_t ip,
++			       unsigned long *segbase, unsigned long *mapoff,
++			       char *path, size_t pathlen);
++extern int tdep_access_reg (struct cursor *c, unw_regnum_t reg,
++			    unw_word_t *valp, int write);
++extern int tdep_access_fpreg (struct cursor *c, unw_regnum_t reg,
++			      unw_fpreg_t *valp, int write);
++
++#endif /* AARCH64_LIBUNWIND_I_H */
+--- a/include/tdep/dwarf-config.h
++++ b/include/tdep/dwarf-config.h
+@@ -1,7 +1,9 @@
+ /* Provide a real file - not a symlink - as it would cause multiarch conflicts
+    when multiple different arch releases are installed simultaneously.  */
+ 
+-#if defined __arm__
++#if defined __aarch64__
++# include "tdep-aarch64/dwarf-config.h"
++#elif defined __arm__
+ # include "tdep-arm/dwarf-config.h"
+ #elif defined __hppa__
+ # include "tdep-hppa/dwarf-config.h"
+--- a/include/tdep/jmpbuf.h
++++ b/include/tdep/jmpbuf.h
+@@ -3,6 +3,8 @@
+ 
+ #ifndef UNW_REMOTE_ONLY
+ 
++#if defined __aarch64__
++# include "tdep-aarch64/jmpbuf.h"
+ #if defined __arm__
+ # include "tdep-arm/jmpbuf.h"
+ #elif defined __hppa__
+--- a/include/tdep/libunwind_i.h.in
++++ b/include/tdep/libunwind_i.h.in
+@@ -3,7 +3,9 @@
+ 
+ #ifndef UNW_REMOTE_ONLY
+ 
+-#if defined __arm__
++#if defined __aarch64__
++# include "tdep-aarch64/libunwind_i.h"
++#elif defined __arm__
+ # include "tdep-arm/libunwind_i.h"
+ #elif defined __hppa__
+ # include "tdep-hppa/libunwind_i.h"
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -170,6 +170,28 @@ libunwind_elfxx_la_SOURCES = elfxx.c
+ noinst_LTLIBRARIES += $(LIBUNWIND_ELF)
+ libunwind_la_LIBADD += $(LIBUNWIND_ELF)
+ 
++# The list of files that go into libunwind and libunwind-aarch64:
++noinst_HEADERS += aarch64/init.h aarch64/offsets.h aarch64/unwind_i.h
++libunwind_la_SOURCES_aarch64_common = $(libunwind_la_SOURCES_common)	    \
++	aarch64/is_fpreg.c aarch64/regname.c
++
++# The list of files that go into libunwind:
++libunwind_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common)	    \
++	$(libunwind_la_SOURCES_local)					    \
++	aarch64/Lcreate_addr_space.c aarch64/Lget_proc_info.c 		    \
++	aarch64/Lget_save_loc.c aarch64/Lglobal.c aarch64/Linit.c	    \
++	aarch64/Linit_local.c aarch64/Linit_remote.c 			    \
++	aarch64/Lis_signal_frame.c aarch64/Lregs.c aarch64/Lresume.c 	    \
++	aarch64/Lstep.c
++
++libunwind_aarch64_la_SOURCES_aarch64 = $(libunwind_la_SOURCES_aarch64_common) \
++	$(libunwind_la_SOURCES_generic)					      \
++	aarch64/Gcreate_addr_space.c aarch64/Gget_proc_info.c 		      \
++	aarch64/Gget_save_loc.c aarch64/Gglobal.c aarch64/Ginit.c 	      \
++	aarch64/Ginit_local.c aarch64/Ginit_remote.c			      \
++	aarch64/Gis_signal_frame.c aarch64/Gregs.c aarch64/Gresume.c	      \
++	aarch64/Gstep.c
++
+ # The list of files that go into libunwind and libunwind-arm:
+ noinst_HEADERS += arm/init.h arm/offsets.h arm/unwind_i.h
+ libunwind_la_SOURCES_arm_common = $(libunwind_la_SOURCES_common)	    \
+@@ -418,6 +440,18 @@ if OS_FREEBSD
+  libunwind_coredump_la_SOURCES += coredump/_UCD_access_reg_freebsd.c
+ endif
+ 
++if ARCH_AARCH64
++ lib_LTLIBRARIES += libunwind-aarch64.la
++ libunwind_la_SOURCES = $(libunwind_la_SOURCES_aarch64)
++ libunwind_aarch64_la_SOURCES = $(libunwind_aarch64_la_SOURCES_aarch64)
++ libunwind_aarch64_la_LDFLAGS = $(COMMON_SO_LDFLAGS) -version-info $(SOVERSION)
++ libunwind_aarch64_la_LIBADD = libunwind-dwarf-generic.la
++ libunwind_aarch64_la_LIBADD += libunwind-elf64.la
++if !REMOTE_ONLY
++ libunwind_aarch64_la_LIBADD += libunwind.la -lc
++endif
++ libunwind_setjmp_la_SOURCES += aarch64/siglongjmp.S
++else
+ if ARCH_ARM
+  lib_LTLIBRARIES += libunwind-arm.la
+  libunwind_la_SOURCES = $(libunwind_la_SOURCES_arm)
+@@ -545,6 +579,7 @@ endif # ARCH_MIPS
+ endif # ARCH_HPPA
+ endif # ARCH_IA64
+ endif # ARCH_ARM
++endif # ARCH_AARCH64
+ 
+ # libunwind-setjmp depends on libunwind-$(arch). Therefore must be added
+ # at the end.
+@@ -567,7 +602,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I
+ AM_CCASFLAGS = $(AM_CPPFLAGS)
+ noinst_HEADERS += unwind/unwind-internal.h
+ 
+-EXTRA_DIST =	$(libunwind_la_SOURCES_arm)			\
++EXTRA_DIST =	$(libunwind_la_SOURCES_aarch64)			\
++		$(libunwind_la_SOURCES_arm)			\
+ 		$(libunwind_la_SOURCES_hppa)			\
+ 		$(libunwind_la_SOURCES_ia64)			\
+ 		$(libunwind_la_SOURCES_mips)			\
+@@ -579,6 +615,7 @@ EXTRA_DIST =	$(libunwind_la_SOURCES_arm)
+ 		$(libunwind_la_SOURCES_common)			\
+ 		$(libunwind_la_SOURCES_local)			\
+ 		$(libunwind_la_SOURCES_generic)			\
++		$(libunwind_aarch64_la_SOURCES_aarch64)		\
+ 		$(libunwind_arm_la_SOURCES_arm)			\
+ 		$(libunwind_hppa_la_SOURCES_hppa)		\
+ 		$(libunwind_ia64_la_SOURCES_ia64)		\
+--- /dev/null
++++ b/src/aarch64/Gcreate_addr_space.c
+@@ -0,0 +1,60 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include <string.h>
++#include <stdlib.h>
++
++#include "unwind_i.h"
++
++PROTECTED unw_addr_space_t
++unw_create_addr_space (unw_accessors_t *a, int byte_order)
++{
++#ifdef UNW_LOCAL_ONLY
++  return NULL;
++#else
++  unw_addr_space_t as;
++
++  /* AArch64 supports little-endian and big-endian. */
++  if (byte_order != 0 && byte_order != __LITTLE_ENDIAN
++      && byte_order != __BIG_ENDIAN)
++    return NULL;
++
++  as = malloc (sizeof (*as));
++  if (!as)
++    return NULL;
++
++  memset (as, 0, sizeof (*as));
++
++  as->acc = *a;
++
++  /* Default to little-endian for AArch64. */
++  if (byte_order == 0 || byte_order == __LITTLE_ENDIAN)
++    as->big_endian = 0;
++  else
++    as->big_endian = 1;
++
++  return as;
++#endif
++}
+--- /dev/null
++++ b/src/aarch64/Gget_proc_info.c
+@@ -0,0 +1,39 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "unwind_i.h"
++
++PROTECTED int
++unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi)
++{
++  struct cursor *c = (struct cursor *) cursor;
++  int ret;
++
++  ret = dwarf_make_proc_info (&c->dwarf);
++  if (ret < 0)
++    return ret;
++
++  *pi = c->dwarf.pi;
++  return 0;
++}
+--- /dev/null
++++ b/src/aarch64/Gget_save_loc.c
+@@ -0,0 +1,100 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "unwind_i.h"
++
++PROTECTED int
++unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc)
++{
++  struct cursor *c = (struct cursor *) cursor;
++  dwarf_loc_t loc;
++
++  switch (reg)
++    {
++    case UNW_AARCH64_X0:
++    case UNW_AARCH64_X1:
++    case UNW_AARCH64_X2:
++    case UNW_AARCH64_X3:
++    case UNW_AARCH64_X4:
++    case UNW_AARCH64_X5:
++    case UNW_AARCH64_X6:
++    case UNW_AARCH64_X7:
++    case UNW_AARCH64_X8:
++    case UNW_AARCH64_X9:
++    case UNW_AARCH64_X10:
++    case UNW_AARCH64_X11:
++    case UNW_AARCH64_X12:
++    case UNW_AARCH64_X13:
++    case UNW_AARCH64_X14:
++    case UNW_AARCH64_X15:
++    case UNW_AARCH64_X16:
++    case UNW_AARCH64_X17:
++    case UNW_AARCH64_X18:
++    case UNW_AARCH64_X19:
++    case UNW_AARCH64_X20:
++    case UNW_AARCH64_X21:
++    case UNW_AARCH64_X22:
++    case UNW_AARCH64_X23:
++    case UNW_AARCH64_X24:
++    case UNW_AARCH64_X25:
++    case UNW_AARCH64_X26:
++    case UNW_AARCH64_X27:
++    case UNW_AARCH64_X28:
++    case UNW_AARCH64_X29:
++    case UNW_AARCH64_X30:
++    case UNW_AARCH64_SP:
++    case UNW_AARCH64_PC:
++    case UNW_AARCH64_PSTATE:
++      loc = c->dwarf.loc[reg];
++      break;
++
++    default:
++      loc = DWARF_NULL_LOC;	/* default to "not saved" */
++      break;
++    }
++
++  memset (sloc, 0, sizeof (*sloc));
++
++  if (DWARF_IS_NULL_LOC (loc))
++    {
++      sloc->type = UNW_SLT_NONE;
++      return 0;
++    }
++
++#if !defined(UNW_LOCAL_ONLY)
++  if (DWARF_IS_REG_LOC (loc))
++    {
++      sloc->type = UNW_SLT_REG;
++      sloc->u.regnum = DWARF_GET_LOC (loc);
++    }
++  else
++#endif
++    {
++      sloc->type = UNW_SLT_MEMORY;
++      sloc->u.addr = DWARF_GET_LOC (loc);
++    }
++  return 0;
++}
+--- /dev/null
++++ b/src/aarch64/Gglobal.c
+@@ -0,0 +1,57 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "unwind_i.h"
++#include "dwarf_i.h"
++
++HIDDEN define_lock (aarch64_lock);
++HIDDEN int tdep_init_done;
++
++HIDDEN void
++tdep_init (void)
++{
++  intrmask_t saved_mask;
++
++  sigfillset (&unwi_full_mask);
++
++  lock_acquire (&aarch64_lock, saved_mask);
++  {
++    if (tdep_init_done)
++      /* another thread else beat us to it... */
++      goto out;
++
++    mi_init ();
++
++    dwarf_init ();
++
++#ifndef UNW_REMOTE_ONLY
++    aarch64_local_addr_space_init ();
++#endif
++    tdep_init_done = 1;	/* signal that we're initialized... */
++  }
++ out:
++  lock_release (&aarch64_lock, saved_mask);
++}
+--- /dev/null
++++ b/src/aarch64/Ginit.c
+@@ -0,0 +1,187 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include <stdlib.h>
++#include <string.h>
++
++#include "unwind_i.h"
++
++#ifdef UNW_REMOTE_ONLY
++
++/* unw_local_addr_space is a NULL pointer in this case.  */
++PROTECTED unw_addr_space_t unw_local_addr_space;
++
++#else /* !UNW_REMOTE_ONLY */
++
++static struct unw_addr_space local_addr_space;
++
++PROTECTED unw_addr_space_t unw_local_addr_space = &local_addr_space;
++
++static inline void *
++uc_addr (ucontext_t *uc, int reg)
++{
++  if (reg >= UNW_AARCH64_X0 && reg <= UNW_AARCH64_V31)
++    return &uc->uc_mcontext.regs[reg];
++  else
++    return NULL;
++}
++
++# ifdef UNW_LOCAL_ONLY
++
++HIDDEN void *
++tdep_uc_addr (ucontext_t *uc, int reg)
++{
++  return uc_addr (uc, reg);
++}
++
++# endif /* UNW_LOCAL_ONLY */
++
++HIDDEN unw_dyn_info_list_t _U_dyn_info_list;
++
++/* XXX fix me: there is currently no way to locate the dyn-info list
++       by a remote unwinder.  On ia64, this is done via a special
++       unwind-table entry.  Perhaps something similar can be done with
++       DWARF2 unwind info.  */
++
++static void
++put_unwind_info (unw_addr_space_t as, unw_proc_info_t *proc_info, void *arg)
++{
++  /* it's a no-op */
++}
++
++static int
++get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dyn_info_list_addr,
++			void *arg)
++{
++  *dyn_info_list_addr = (unw_word_t) &_U_dyn_info_list;
++  return 0;
++}
++
++static int
++access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *val, int write,
++	    void *arg)
++{
++  if (write)
++    {
++      Debug (16, "mem[%lx] <- %lx\n", addr, *val);
++      *(unw_word_t *) addr = *val;
++    }
++  else
++    {
++      *val = *(unw_word_t *) addr;
++      Debug (16, "mem[%lx] -> %lx\n", addr, *val);
++    }
++  return 0;
++}
++
++static int
++access_reg (unw_addr_space_t as, unw_regnum_t reg, unw_word_t *val, int write,
++	    void *arg)
++{
++  unw_word_t *addr;
++  ucontext_t *uc = arg;
++
++  if (unw_is_fpreg (reg))
++    goto badreg;
++
++  if (!(addr = uc_addr (uc, reg)))
++    goto badreg;
++
++  if (write)
++    {
++      *(unw_word_t *) addr = *val;
++      Debug (12, "%s <- %lx\n", unw_regname (reg), *val);
++    }
++  else
++    {
++      *val = *(unw_word_t *) addr;
++      Debug (12, "%s -> %lx\n", unw_regname (reg), *val);
++    }
++  return 0;
++
++ badreg:
++  Debug (1, "bad register number %u\n", reg);
++  return -UNW_EBADREG;
++}
++
++static int
++access_fpreg (unw_addr_space_t as, unw_regnum_t reg, unw_fpreg_t *val,
++	      int write, void *arg)
++{
++  ucontext_t *uc = arg;
++  unw_fpreg_t *addr;
++
++  if (!unw_is_fpreg (reg))
++    goto badreg;
++
++  if (!(addr = uc_addr (uc, reg)))
++    goto badreg;
++
++  if (write)
++    {
++      Debug (12, "%s <- %08lx.%08lx.%08lx\n", unw_regname (reg),
++	     ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]);
++      *(unw_fpreg_t *) addr = *val;
++    }
++  else
++    {
++      *val = *(unw_fpreg_t *) addr;
++      Debug (12, "%s -> %08lx.%08lx.%08lx\n", unw_regname (reg),
++	     ((long *)val)[0], ((long *)val)[1], ((long *)val)[2]);
++    }
++  return 0;
++
++ badreg:
++  Debug (1, "bad register number %u\n", reg);
++  /* attempt to access a non-preserved register */
++  return -UNW_EBADREG;
++}
++
++static int
++get_static_proc_name (unw_addr_space_t as, unw_word_t ip,
++		      char *buf, size_t buf_len, unw_word_t *offp,
++		      void *arg)
++{
++  return _Uelf64_get_proc_name (as, getpid (), ip, buf, buf_len, offp);
++}
++
++HIDDEN void
++aarch64_local_addr_space_init (void)
++{
++  memset (&local_addr_space, 0, sizeof (local_addr_space));
++  local_addr_space.caching_policy = UNW_CACHE_GLOBAL;
++  local_addr_space.acc.find_proc_info = dwarf_find_proc_info;
++  local_addr_space.acc.put_unwind_info = put_unwind_info;
++  local_addr_space.acc.get_dyn_info_list_addr = get_dyn_info_list_addr;
++  local_addr_space.acc.access_mem = access_mem;
++  local_addr_space.acc.access_reg = access_reg;
++  local_addr_space.acc.access_fpreg = access_fpreg;
++  local_addr_space.acc.resume = aarch64_local_resume;
++  local_addr_space.acc.get_proc_name = get_static_proc_name;
++  unw_flush_cache (&local_addr_space, 0, 0);
++}
++
++#endif /* !UNW_REMOTE_ONLY */
+--- /dev/null
++++ b/src/aarch64/Ginit_local.c
+@@ -0,0 +1,55 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2011-2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "unwind_i.h"
++#include "init.h"
++
++#ifdef UNW_REMOTE_ONLY
++
++PROTECTED int
++unw_init_local (unw_cursor_t *cursor, unw_context_t *uc)
++{
++  return -UNW_EINVAL;
++}
++
++#else /* !UNW_REMOTE_ONLY */
++
++PROTECTED int
++unw_init_local (unw_cursor_t *cursor, unw_context_t *uc)
++{
++  struct cursor *c = (struct cursor *) cursor;
++
++  if (!tdep_init_done)
++    tdep_init ();
++
++  Debug (1, "(cursor=%p)\n", c);
++
++  c->dwarf.as = unw_local_addr_space;
++  c->dwarf.as_arg = uc;
++
++  return common_init (c, 1);
++}
++
++#endif /* !UNW_REMOTE_ONLY */
+--- /dev/null
++++ b/src/aarch64/Ginit_remote.c
+@@ -0,0 +1,45 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "init.h"
++#include "unwind_i.h"
++
++PROTECTED int
++unw_init_remote (unw_cursor_t *cursor, unw_addr_space_t as, void *as_arg)
++{
++#ifdef UNW_LOCAL_ONLY
++  return -UNW_EINVAL;
++#else /* !UNW_LOCAL_ONLY */
++  struct cursor *c = (struct cursor *) cursor;
++
++  if (!tdep_init_done)
++    tdep_init ();
++
++  Debug (1, "(cursor=%p)\n", c);
++
++  c->dwarf.as = as;
++  c->dwarf.as_arg = as_arg;
++  return common_init (c, 0);
++#endif /* !UNW_LOCAL_ONLY */
++}
+--- /dev/null
++++ b/src/aarch64/Gis_signal_frame.c
+@@ -0,0 +1,64 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "unwind_i.h"
++
++/* The restorer stub will always have the form:
++
++   d2801168        movz    x8, #0x8b
++   d4000001        svc     #0x0
++*/
++
++PROTECTED int
++unw_is_signal_frame (unw_cursor_t *cursor)
++{
++#ifdef __linux__
++  struct cursor *c = (struct cursor *) cursor;
++  unw_word_t w0, ip;
++  unw_addr_space_t as;
++  unw_accessors_t *a;
++  void *arg;
++  int ret;
++
++  as = c->dwarf.as;
++  a = unw_get_accessors (as);
++  arg = c->dwarf.as_arg;
++
++  ip = c->dwarf.ip;
++
++  ret = (*a->access_mem) (as, ip, &w0, 0, arg);
++  if (ret < 0)
++    return ret;
++
++  /* FIXME: distinguish 32bit insn vs 64bit registers.  */
++  if (w0 != 0xd4000001d2801168)
++    return 0;
++
++  return 1;
++
++#else
++  return -UNW_ENOINFO;
++#endif
++}
+--- /dev/null
++++ b/src/aarch64/Gregs.c
+@@ -0,0 +1,113 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "unwind_i.h"
++
++HIDDEN int
++tdep_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp,
++		 int write)
++{
++  dwarf_loc_t loc = DWARF_NULL_LOC;
++  unsigned int mask;
++
++  switch (reg)
++    {
++    case UNW_AARCH64_X0:
++    case UNW_AARCH64_X1:
++    case UNW_AARCH64_X2:
++    case UNW_AARCH64_X3:
++      mask = 1 << reg;
++      if (write)
++        {
++          c->dwarf.eh_args[reg] = *valp;
++          c->dwarf.eh_valid_mask |= mask;
++          return 0;
++        }
++      else if ((c->dwarf.eh_valid_mask & mask) != 0)
++        {
++          *valp = c->dwarf.eh_args[reg];
++          return 0;
++        }
++      else
++        loc = c->dwarf.loc[reg];
++      break;
++
++    case UNW_AARCH64_X4:
++    case UNW_AARCH64_X5:
++    case UNW_AARCH64_X6:
++    case UNW_AARCH64_X7:
++    case UNW_AARCH64_X8:
++    case UNW_AARCH64_X9:
++    case UNW_AARCH64_X10:
++    case UNW_AARCH64_X11:
++    case UNW_AARCH64_X12:
++    case UNW_AARCH64_X13:
++    case UNW_AARCH64_X14:
++    case UNW_AARCH64_X15:
++    case UNW_AARCH64_X16:
++    case UNW_AARCH64_X17:
++    case UNW_AARCH64_X18:
++    case UNW_AARCH64_X19:
++    case UNW_AARCH64_X20:
++    case UNW_AARCH64_X21:
++    case UNW_AARCH64_X22:
++    case UNW_AARCH64_X23:
++    case UNW_AARCH64_X24:
++    case UNW_AARCH64_X25:
++    case UNW_AARCH64_X26:
++    case UNW_AARCH64_X27:
++    case UNW_AARCH64_X28:
++    case UNW_AARCH64_X29:
++    case UNW_AARCH64_X30:
++    case UNW_AARCH64_PC:
++    case UNW_AARCH64_PSTATE:
++      loc = c->dwarf.loc[reg];
++      break;
++
++    case UNW_AARCH64_SP:
++      if (write)
++        return -UNW_EREADONLYREG;
++      *valp = c->dwarf.cfa;
++      return 0;
++
++    default:
++      Debug (1, "bad register number %u\n", reg);
++      return -UNW_EBADREG;
++    }
++
++  if (write)
++    return dwarf_put (&c->dwarf, loc, *valp);
++  else
++    return dwarf_get (&c->dwarf, loc, valp);
++}
++
++HIDDEN int
++tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, unw_fpreg_t *valp,
++		   int write)
++{
++  Debug (1, "bad register number %u\n", reg);
++  return -UNW_EBADREG;
++}
+--- /dev/null
++++ b/src/aarch64/Gresume.c
+@@ -0,0 +1,177 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2011-2013 Linaro Limited
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "unwind_i.h"
++#include "offsets.h"
++
++#ifndef UNW_REMOTE_ONLY
++
++HIDDEN inline int
++aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor, void *arg)
++{
++#ifdef __linux__
++  struct cursor *c = (struct cursor *) cursor;
++  unw_tdep_context_t *uc = c->dwarf.as_arg;
++
++  if (c->sigcontext_format == AARCH64_SCF_NONE)
++    {
++      /* Since there are no signals involved here we restore the non scratch
++	 registers only.  */
++      unsigned long regs[11];
++      regs[0] = uc->uc_mcontext.regs[19];
++      regs[1] = uc->uc_mcontext.regs[20];
++      regs[2] = uc->uc_mcontext.regs[21];
++      regs[3] = uc->uc_mcontext.regs[22];
++      regs[4] = uc->uc_mcontext.regs[23];
++      regs[5] = uc->uc_mcontext.regs[24];
++      regs[6] = uc->uc_mcontext.regs[25];
++      regs[7] = uc->uc_mcontext.regs[26];
++      regs[8] = uc->uc_mcontext.regs[27];
++      regs[9] = uc->uc_mcontext.regs[28];
++      regs[10] = uc->uc_mcontext.regs[30]; /* LR */
++      unsigned long sp = uc->uc_mcontext.sp;
++
++      struct regs_overlay {
++        char x[sizeof(regs)];
++      };
++
++      asm volatile (
++        "ldp x19, x20, [%0]\n"
++        "ldp x21, x22, [%0,16]\n"
++        "ldp x23, x24, [%0,32]\n"
++        "ldp x25, x26, [%0,48]\n"
++        "ldp x27, x28, [%0,64]\n"
++        "ldr x30, [%0,80]\n"
++        "mov sp, %1\n"
++        "ret \n"
++        :
++        : "r" (regs),
++          "r" (sp),
++          "m" (*(struct regs_overlay *)regs)
++      );
++    }
++  else
++    {
++      struct sigcontext *sc = (struct sigcontext *) c->sigcontext_addr;
++
++      if (c->dwarf.eh_valid_mask & 0x1) sc->regs[0] = c->dwarf.eh_args[0];
++      if (c->dwarf.eh_valid_mask & 0x2) sc->regs[1] = c->dwarf.eh_args[1];
++      if (c->dwarf.eh_valid_mask & 0x4) sc->regs[2] = c->dwarf.eh_args[2];
++      if (c->dwarf.eh_valid_mask & 0x8) sc->regs[3] = c->dwarf.eh_args[3];
++
++      sc->regs[4] = uc->uc_mcontext.regs[4];
++      sc->regs[5] = uc->uc_mcontext.regs[5];
++      sc->regs[6] = uc->uc_mcontext.regs[6];
++      sc->regs[7] = uc->uc_mcontext.regs[7];
++      sc->regs[8] = uc->uc_mcontext.regs[8];
++      sc->regs[9] = uc->uc_mcontext.regs[9];
++      sc->regs[10] = uc->uc_mcontext.regs[10];
++      sc->regs[11] = uc->uc_mcontext.regs[11];
++      sc->regs[12] = uc->uc_mcontext.regs[12];
++      sc->regs[13] = uc->uc_mcontext.regs[13];
++      sc->regs[14] = uc->uc_mcontext.regs[14];
++      sc->regs[15] = uc->uc_mcontext.regs[15];
++      sc->regs[16] = uc->uc_mcontext.regs[16];
++      sc->regs[17] = uc->uc_mcontext.regs[17];
++      sc->regs[18] = uc->uc_mcontext.regs[18];
++      sc->regs[19] = uc->uc_mcontext.regs[19];
++      sc->regs[20] = uc->uc_mcontext.regs[20];
++      sc->regs[21] = uc->uc_mcontext.regs[21];
++      sc->regs[22] = uc->uc_mcontext.regs[22];
++      sc->regs[23] = uc->uc_mcontext.regs[23];
++      sc->regs[24] = uc->uc_mcontext.regs[24];
++      sc->regs[25] = uc->uc_mcontext.regs[25];
++      sc->regs[26] = uc->uc_mcontext.regs[26];
++      sc->regs[27] = uc->uc_mcontext.regs[27];
++      sc->regs[28] = uc->uc_mcontext.regs[28];
++      sc->regs[29] = uc->uc_mcontext.regs[29];
++      sc->regs[30] = uc->uc_mcontext.regs[30];
++      sc->sp = uc->uc_mcontext.sp;
++      sc->pc = uc->uc_mcontext.pc;
++      sc->pstate = uc->uc_mcontext.pstate;
++
++      asm volatile (
++        "mov sp, %0\n"
++        "ret %1\n"
++        : : "r" (c->sigcontext_sp), "r" (c->sigcontext_pc)
++      );
++   }
++  unreachable();
++#else
++  printf ("%s: implement me\n", __FUNCTION__);
++#endif
++  return -UNW_EINVAL;
++}
++
++#endif /* !UNW_REMOTE_ONLY */
++
++static inline void
++establish_machine_state (struct cursor *c)
++{
++  unw_addr_space_t as = c->dwarf.as;
++  void *arg = c->dwarf.as_arg;
++  unw_fpreg_t fpval;
++  unw_word_t val;
++  int reg;
++
++  Debug (8, "copying out cursor state\n");
++
++  for (reg = 0; reg <= UNW_AARCH64_PSTATE; ++reg)
++    {
++      Debug (16, "copying %s %d\n", unw_regname (reg), reg);
++      if (unw_is_fpreg (reg))
++	{
++	  if (tdep_access_fpreg (c, reg, &fpval, 0) >= 0)
++	    as->acc.access_fpreg (as, reg, &fpval, 1, arg);
++	}
++      else
++	{
++	  if (tdep_access_reg (c, reg, &val, 0) >= 0)
++	    as->acc.access_reg (as, reg, &val, 1, arg);
++	}
++    }
++}
++
++PROTECTED int
++unw_resume (unw_cursor_t *cursor)
++{
++  struct cursor *c = (struct cursor *) cursor;
++
++  Debug (1, "(cursor=%p)\n", c);
++
++  if (!c->dwarf.ip)
++    {
++      /* This can happen easily when the frame-chain gets truncated
++	 due to bad or missing unwind-info.  */
++      Debug (1, "refusing to resume execution at address 0\n");
++      return -UNW_EINVAL;
++    }
++
++  establish_machine_state (c);
++
++  return (*c->dwarf.as->acc.resume) (c->dwarf.as, (unw_cursor_t *) c,
++				     c->dwarf.as_arg);
++}
+--- /dev/null
++++ b/src/aarch64/Gstep.c
+@@ -0,0 +1,129 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2011-2013 Linaro Limited
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "unwind_i.h"
++#include "offsets.h"
++
++PROTECTED int
++unw_handle_signal_frame (unw_cursor_t *cursor)
++{
++  struct cursor *c = (struct cursor *) cursor;
++  int ret;
++  unw_word_t sc_addr, sp, sp_addr = c->dwarf.cfa;
++  struct dwarf_loc sp_loc = DWARF_LOC (sp_addr, 0);
++
++  if ((ret = dwarf_get (&c->dwarf, sp_loc, &sp)) < 0)
++    return -UNW_EUNSPEC;
++
++  ret = unw_is_signal_frame (cursor);
++  Debug(1, "unw_is_signal_frame()=%d\n", ret);
++
++  /* Save the SP and PC to be able to return execution at this point
++     later in time (unw_resume).  */
++  c->sigcontext_sp = c->dwarf.cfa;
++  c->sigcontext_pc = c->dwarf.ip;
++
++  if (ret)
++    {
++      c->sigcontext_format = AARCH64_SCF_LINUX_RT_SIGFRAME;
++      sc_addr = sp_addr + sizeof (siginfo_t) + LINUX_UC_MCONTEXT_OFF;
++    }
++  else
++    return -UNW_EUNSPEC;
++
++  c->sigcontext_addr = sc_addr;
++
++  /* Update the dwarf cursor.
++     Set the location of the registers to the corresponding addresses of the
++     uc_mcontext / sigcontext structure contents.  */
++  c->dwarf.loc[UNW_AARCH64_X0]  = DWARF_LOC (sc_addr + LINUX_SC_X0_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X1]  = DWARF_LOC (sc_addr + LINUX_SC_X1_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X2]  = DWARF_LOC (sc_addr + LINUX_SC_X2_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X3]  = DWARF_LOC (sc_addr + LINUX_SC_X3_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X4]  = DWARF_LOC (sc_addr + LINUX_SC_X4_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X5]  = DWARF_LOC (sc_addr + LINUX_SC_X5_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X6]  = DWARF_LOC (sc_addr + LINUX_SC_X6_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X7]  = DWARF_LOC (sc_addr + LINUX_SC_X7_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X8]  = DWARF_LOC (sc_addr + LINUX_SC_X8_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X9]  = DWARF_LOC (sc_addr + LINUX_SC_X9_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X10] = DWARF_LOC (sc_addr + LINUX_SC_X10_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X11] = DWARF_LOC (sc_addr + LINUX_SC_X11_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X12] = DWARF_LOC (sc_addr + LINUX_SC_X12_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X13] = DWARF_LOC (sc_addr + LINUX_SC_X13_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X14] = DWARF_LOC (sc_addr + LINUX_SC_X14_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X15] = DWARF_LOC (sc_addr + LINUX_SC_X15_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X16] = DWARF_LOC (sc_addr + LINUX_SC_X16_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X17] = DWARF_LOC (sc_addr + LINUX_SC_X17_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X18] = DWARF_LOC (sc_addr + LINUX_SC_X18_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X19] = DWARF_LOC (sc_addr + LINUX_SC_X19_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X20] = DWARF_LOC (sc_addr + LINUX_SC_X20_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X21] = DWARF_LOC (sc_addr + LINUX_SC_X21_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X22] = DWARF_LOC (sc_addr + LINUX_SC_X22_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X23] = DWARF_LOC (sc_addr + LINUX_SC_X23_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X24] = DWARF_LOC (sc_addr + LINUX_SC_X24_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X25] = DWARF_LOC (sc_addr + LINUX_SC_X25_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X26] = DWARF_LOC (sc_addr + LINUX_SC_X26_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X27] = DWARF_LOC (sc_addr + LINUX_SC_X27_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X28] = DWARF_LOC (sc_addr + LINUX_SC_X28_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X29] = DWARF_LOC (sc_addr + LINUX_SC_X29_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_X30] = DWARF_LOC (sc_addr + LINUX_SC_X30_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_SP]  = DWARF_LOC (sc_addr + LINUX_SC_SP_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_PC]  = DWARF_LOC (sc_addr + LINUX_SC_PC_OFF, 0);
++  c->dwarf.loc[UNW_AARCH64_PSTATE]  = DWARF_LOC (sc_addr + LINUX_SC_PSTATE_OFF, 0);
++
++  /* Set SP/CFA and PC/IP.  */
++  dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_SP], &c->dwarf.cfa);
++  dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip);
++
++  c->dwarf.pi_valid = 0;
++
++  return 1;
++}
++
++PROTECTED int
++unw_step (unw_cursor_t *cursor)
++{
++  struct cursor *c = (struct cursor *) cursor;
++  int ret;
++
++  Debug (1, "(cursor=%p, ip=0x%016lx, cfa=0x%016lx))\n",
++	 c, c->dwarf.ip, c->dwarf.cfa);
++
++  /* Check if this is a signal frame. */
++  if (unw_is_signal_frame (cursor))
++    return unw_handle_signal_frame (cursor);
++
++  ret = dwarf_step (&c->dwarf);
++  Debug(1, "dwarf_step()=%d\n", ret);
++
++  if (unlikely (ret == -UNW_ESTOPUNWIND))
++    return ret;
++
++  if (unlikely (ret < 0))
++    return 0;
++
++  return (c->dwarf.ip == 0) ? 0 : 1;
++}
+--- /dev/null
++++ b/src/aarch64/Lcreate_addr_space.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gcreate_addr_space.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lget_proc_info.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gget_proc_info.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lget_save_loc.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gget_save_loc.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lglobal.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gglobal.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Linit.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Ginit.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Linit_local.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Ginit_local.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Linit_remote.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Ginit_remote.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lis_signal_frame.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gis_signal_frame.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lregs.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gregs.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lresume.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gresume.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/Lstep.c
+@@ -0,0 +1,5 @@
++#define UNW_LOCAL_ONLY
++#include <libunwind.h>
++#if defined(UNW_LOCAL_ONLY) && !defined(UNW_REMOTE_ONLY)
++#include "Gstep.c"
++#endif
+--- /dev/null
++++ b/src/aarch64/gen-offsets.c
+@@ -0,0 +1,68 @@
++#include <stdio.h>
++#include <stddef.h>
++#include <ucontext.h>
++#include <asm/sigcontext.h>
++
++#define UC(N,X) \
++  printf ("#define LINUX_UC_" N "_OFF\t0x%X\n", offsetof (ucontext_t, X))
++
++#define SC(N,X) \
++  printf ("#define LINUX_SC_" N "_OFF\t0x%X\n", offsetof (struct sigcontext, X))
++
++int
++main (void)
++{
++  printf (
++"/* Linux-specific definitions: */\n\n"
++
++"/* Define various structure offsets to simplify cross-compilation.  */\n\n"
++
++"/* Offsets for AArch64 Linux \"ucontext_t\":  */\n\n");
++
++  UC ("FLAGS", uc_flags);
++  UC ("LINK", uc_link);
++  UC ("STACK", uc_stack);
++  UC ("MCONTEXT", uc_mcontext);
++  UC ("SIGMASK", uc_sigmask);
++
++  printf ("\n/* Offsets for AArch64 Linux \"struct sigcontext\":  */\n\n");
++
++  SC ("R0",  regs[0]);
++  SC ("R1",  regs[1]);
++  SC ("R2",  regs[2]);
++  SC ("R3",  regs[3]);
++  SC ("R4",  regs[4]);
++  SC ("R5",  regs[5]);
++  SC ("R6",  regs[6]);
++  SC ("R7",  regs[7]);
++  SC ("R8",  regs[8]);
++  SC ("R9",  regs[9]);
++  SC ("R10", regs[10]);
++  SC ("R11", regs[11]);
++  SC ("R12", regs[12]);
++  SC ("R13", regs[13]);
++  SC ("R14", regs[14]);
++  SC ("R15", regs[15]);
++  SC ("R16", regs[16]);
++  SC ("R17", regs[17]);
++  SC ("R18", regs[18]);
++  SC ("R19", regs[19]);
++  SC ("R20", regs[20]);
++  SC ("R21", regs[21]);
++  SC ("R22", regs[22]);
++  SC ("R23", regs[23]);
++  SC ("R24", regs[24]);
++  SC ("R25", regs[25]);
++  SC ("R26", regs[26]);
++  SC ("R27", regs[27]);
++  SC ("R28", regs[28]);
++  SC ("R29", regs[29]);
++  SC ("R30", regs[30]);
++  SC ("R31", regs[31]);
++
++  SC ("PC", pc);
++  SC ("SP", sp);
++  SC ("Fault", fault_address);
++  SC ("state", pstate);
++  return 0;
++}
+--- /dev/null
++++ b/src/aarch64/init.h
+@@ -0,0 +1,127 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "unwind_i.h"
++
++static inline int
++common_init (struct cursor *c, unsigned use_prev_instr)
++{
++  int ret, i;
++
++  c->dwarf.loc[UNW_AARCH64_X0]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X0);
++  c->dwarf.loc[UNW_AARCH64_X1]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X1);
++  c->dwarf.loc[UNW_AARCH64_X2]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X2);
++  c->dwarf.loc[UNW_AARCH64_X3]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X3);
++  c->dwarf.loc[UNW_AARCH64_X4]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X4);
++  c->dwarf.loc[UNW_AARCH64_X5]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X5);
++  c->dwarf.loc[UNW_AARCH64_X6]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X6);
++  c->dwarf.loc[UNW_AARCH64_X7]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X7);
++  c->dwarf.loc[UNW_AARCH64_X8]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X8);
++  c->dwarf.loc[UNW_AARCH64_X9]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X9);
++  c->dwarf.loc[UNW_AARCH64_X10] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X10);
++  c->dwarf.loc[UNW_AARCH64_X11] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X11);
++  c->dwarf.loc[UNW_AARCH64_X12] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X12);
++  c->dwarf.loc[UNW_AARCH64_X13] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X13);
++  c->dwarf.loc[UNW_AARCH64_X14] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X14);
++  c->dwarf.loc[UNW_AARCH64_X15] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X15);
++  c->dwarf.loc[UNW_AARCH64_X16] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X16);
++  c->dwarf.loc[UNW_AARCH64_X17] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X17);
++  c->dwarf.loc[UNW_AARCH64_X18] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X18);
++  c->dwarf.loc[UNW_AARCH64_X19] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X19);
++  c->dwarf.loc[UNW_AARCH64_X20] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X20);
++  c->dwarf.loc[UNW_AARCH64_X21] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X21);
++  c->dwarf.loc[UNW_AARCH64_X22] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X22);
++  c->dwarf.loc[UNW_AARCH64_X23] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X23);
++  c->dwarf.loc[UNW_AARCH64_X24] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X24);
++  c->dwarf.loc[UNW_AARCH64_X25] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X25);
++  c->dwarf.loc[UNW_AARCH64_X26] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X26);
++  c->dwarf.loc[UNW_AARCH64_X27] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X27);
++  c->dwarf.loc[UNW_AARCH64_X28] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X28);
++  c->dwarf.loc[UNW_AARCH64_X29] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X29);
++  c->dwarf.loc[UNW_AARCH64_X30] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_X30);
++  c->dwarf.loc[UNW_AARCH64_SP]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_SP);
++  c->dwarf.loc[UNW_AARCH64_PC]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_PC);
++  c->dwarf.loc[UNW_AARCH64_PSTATE] = DWARF_REG_LOC (&c->dwarf,
++                                                    UNW_AARCH64_PSTATE);
++  c->dwarf.loc[UNW_AARCH64_V0]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V0);
++  c->dwarf.loc[UNW_AARCH64_V1]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V1);
++  c->dwarf.loc[UNW_AARCH64_V2]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V2);
++  c->dwarf.loc[UNW_AARCH64_V3]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V3);
++  c->dwarf.loc[UNW_AARCH64_V4]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V4);
++  c->dwarf.loc[UNW_AARCH64_V5]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V5);
++  c->dwarf.loc[UNW_AARCH64_V6]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V6);
++  c->dwarf.loc[UNW_AARCH64_V7]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V7);
++  c->dwarf.loc[UNW_AARCH64_V8]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V8);
++  c->dwarf.loc[UNW_AARCH64_V9]  = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V9);
++  c->dwarf.loc[UNW_AARCH64_V10] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V10);
++  c->dwarf.loc[UNW_AARCH64_V11] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V11);
++  c->dwarf.loc[UNW_AARCH64_V12] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V12);
++  c->dwarf.loc[UNW_AARCH64_V13] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V13);
++  c->dwarf.loc[UNW_AARCH64_V14] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V14);
++  c->dwarf.loc[UNW_AARCH64_V15] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V15);
++  c->dwarf.loc[UNW_AARCH64_V16] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V16);
++  c->dwarf.loc[UNW_AARCH64_V17] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V17);
++  c->dwarf.loc[UNW_AARCH64_V18] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V18);
++  c->dwarf.loc[UNW_AARCH64_V19] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V19);
++  c->dwarf.loc[UNW_AARCH64_V20] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V20);
++  c->dwarf.loc[UNW_AARCH64_V21] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V21);
++  c->dwarf.loc[UNW_AARCH64_V22] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V22);
++  c->dwarf.loc[UNW_AARCH64_V23] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V23);
++  c->dwarf.loc[UNW_AARCH64_V24] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V24);
++  c->dwarf.loc[UNW_AARCH64_V25] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V25);
++  c->dwarf.loc[UNW_AARCH64_V26] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V26);
++  c->dwarf.loc[UNW_AARCH64_V27] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V27);
++  c->dwarf.loc[UNW_AARCH64_V28] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V28);
++  c->dwarf.loc[UNW_AARCH64_V29] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V29);
++  c->dwarf.loc[UNW_AARCH64_V30] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V30);
++  c->dwarf.loc[UNW_AARCH64_V31] = DWARF_REG_LOC (&c->dwarf, UNW_AARCH64_V31);
++
++  for (i = UNW_AARCH64_PSTATE + 1; i < UNW_AARCH64_V0; ++i)
++    c->dwarf.loc[i] = DWARF_NULL_LOC;
++
++  ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_PC], &c->dwarf.ip);
++  if (ret < 0)
++    return ret;
++
++  ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_AARCH64_SP], &c->dwarf.cfa);
++  if (ret < 0)
++    return ret;
++
++  c->sigcontext_format = AARCH64_SCF_NONE;
++  c->sigcontext_addr = 0;
++  c->sigcontext_sp = 0;
++  c->sigcontext_pc = 0;
++
++  c->dwarf.args_size = 0;
++  c->dwarf.ret_addr_column = 0;
++  c->dwarf.stash_frames = 0;
++  c->dwarf.use_prev_instr = use_prev_instr;
++  c->dwarf.pi_valid = 0;
++  c->dwarf.pi_is_dynamic = 0;
++  c->dwarf.hint = 0;
++  c->dwarf.prev_rs = 0;
++
++  return 0;
++}
+--- /dev/null
++++ b/src/aarch64/is_fpreg.c
+@@ -0,0 +1,32 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "libunwind_i.h"
++
++PROTECTED int
++unw_is_fpreg (int regnum)
++{
++  return (regnum >= UNW_AARCH64_V0 && regnum <= UNW_AARCH64_V31);
++}
+--- /dev/null
++++ b/src/aarch64/offsets.h
+@@ -0,0 +1,49 @@
++/* Linux-specific definitions: */
++
++/* Define various structure offsets to simplify cross-compilation.  */
++
++/* Offsets for AArch64 Linux "ucontext_t":  */
++
++#define LINUX_UC_FLAGS_OFF	0x0
++#define LINUX_UC_LINK_OFF	0x8
++#define LINUX_UC_STACK_OFF	0x10
++#define LINUX_UC_SIGMASK_OFF	0x28
++#define LINUX_UC_MCONTEXT_OFF	0xb0
++
++/* Offsets for AArch64 Linux "struct sigcontext":  */
++
++#define LINUX_SC_FAULTADDRESS_OFF	0x00
++#define LINUX_SC_X0_OFF		0x008
++#define LINUX_SC_X1_OFF		0x010
++#define LINUX_SC_X2_OFF		0x018
++#define LINUX_SC_X3_OFF		0x020
++#define LINUX_SC_X4_OFF		0x028
++#define LINUX_SC_X5_OFF		0x030
++#define LINUX_SC_X6_OFF		0x038
++#define LINUX_SC_X7_OFF		0x040
++#define LINUX_SC_X8_OFF		0x048
++#define LINUX_SC_X9_OFF		0x050
++#define LINUX_SC_X10_OFF	0x058
++#define LINUX_SC_X11_OFF	0x060
++#define LINUX_SC_X12_OFF	0x068
++#define LINUX_SC_X13_OFF	0x070
++#define LINUX_SC_X14_OFF	0x078
++#define LINUX_SC_X15_OFF	0x080
++#define LINUX_SC_X16_OFF	0x088
++#define LINUX_SC_X17_OFF	0x090
++#define LINUX_SC_X18_OFF	0x098
++#define LINUX_SC_X19_OFF	0x0a0
++#define LINUX_SC_X20_OFF	0x0a8
++#define LINUX_SC_X21_OFF	0x0b0
++#define LINUX_SC_X22_OFF	0x0b8
++#define LINUX_SC_X23_OFF	0x0c0
++#define LINUX_SC_X24_OFF	0x0c8
++#define LINUX_SC_X25_OFF	0x0d0
++#define LINUX_SC_X26_OFF	0x0d8
++#define LINUX_SC_X27_OFF	0x0e0
++#define LINUX_SC_X28_OFF	0x0e8
++#define LINUX_SC_X29_OFF	0x0f0
++#define LINUX_SC_X30_OFF	0x0f8
++#define LINUX_SC_SP_OFF		0x100
++#define LINUX_SC_PC_OFF		0x108
++#define LINUX_SC_PSTATE_OFF	0x110
+--- /dev/null
++++ b/src/aarch64/regname.c
+@@ -0,0 +1,106 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2012 Tommi Rantala <tt.rantala@gmail.com>
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#include "unwind_i.h"
++
++static const char *const regname[] =
++  {
++    [UNW_AARCH64_X0] = "x0",
++    [UNW_AARCH64_X1] = "x1",
++    [UNW_AARCH64_X2] = "x2",
++    [UNW_AARCH64_X3] = "x3",
++    [UNW_AARCH64_X4] = "x4",
++    [UNW_AARCH64_X5] = "x5",
++    [UNW_AARCH64_X6] = "x6",
++    [UNW_AARCH64_X7] = "x7",
++    [UNW_AARCH64_X8] = "x8",
++    [UNW_AARCH64_X9] = "x9",
++    [UNW_AARCH64_X10] = "x10",
++    [UNW_AARCH64_X11] = "x11",
++    [UNW_AARCH64_X12] = "x12",
++    [UNW_AARCH64_X13] = "x13",
++    [UNW_AARCH64_X14] = "x14",
++    [UNW_AARCH64_X15] = "x15",
++    [UNW_AARCH64_X16] = "ip0",
++    [UNW_AARCH64_X17] = "ip1",
++    [UNW_AARCH64_X18] = "x18",
++    [UNW_AARCH64_X19] = "x19",
++    [UNW_AARCH64_X20] = "x20",
++    [UNW_AARCH64_X21] = "x21",
++    [UNW_AARCH64_X22] = "x22",
++    [UNW_AARCH64_X23] = "x23",
++    [UNW_AARCH64_X24] = "x24",
++    [UNW_AARCH64_X25] = "x25",
++    [UNW_AARCH64_X26] = "x26",
++    [UNW_AARCH64_X27] = "x27",
++    [UNW_AARCH64_X28] = "x28",
++    [UNW_AARCH64_X29] = "fp",
++    [UNW_AARCH64_X30] = "lr",
++    [UNW_AARCH64_SP] = "sp",
++    [UNW_AARCH64_PC] = "pc",
++    [UNW_AARCH64_V0] = "v0",
++    [UNW_AARCH64_V1] = "v1",
++    [UNW_AARCH64_V2] = "v2",
++    [UNW_AARCH64_V3] = "v3",
++    [UNW_AARCH64_V4] = "v4",
++    [UNW_AARCH64_V5] = "v5",
++    [UNW_AARCH64_V6] = "v6",
++    [UNW_AARCH64_V7] = "v7",
++    [UNW_AARCH64_V8] = "v8",
++    [UNW_AARCH64_V9] = "v9",
++    [UNW_AARCH64_V10] = "v10",
++    [UNW_AARCH64_V11] = "v11",
++    [UNW_AARCH64_V12] = "v12",
++    [UNW_AARCH64_V13] = "v13",
++    [UNW_AARCH64_V14] = "v14",
++    [UNW_AARCH64_V15] = "v15",
++    [UNW_AARCH64_V16] = "v16",
++    [UNW_AARCH64_V17] = "v17",
++    [UNW_AARCH64_V18] = "v18",
++    [UNW_AARCH64_V19] = "v19",
++    [UNW_AARCH64_V20] = "v20",
++    [UNW_AARCH64_V21] = "v21",
++    [UNW_AARCH64_V22] = "v22",
++    [UNW_AARCH64_V23] = "v23",
++    [UNW_AARCH64_V24] = "v24",
++    [UNW_AARCH64_V25] = "v25",
++    [UNW_AARCH64_V26] = "v26",
++    [UNW_AARCH64_V27] = "v27",
++    [UNW_AARCH64_V28] = "v28",
++    [UNW_AARCH64_V29] = "v29",
++    [UNW_AARCH64_V30] = "v30",
++    [UNW_AARCH64_V31] = "v31",
++    [UNW_AARCH64_FPSR] = "fpsr",
++    [UNW_AARCH64_FPCR] = "fpcr",
++  };
++
++PROTECTED const char *
++unw_regname (unw_regnum_t reg)
++{
++  if (reg < (unw_regnum_t) ARRAY_SIZE (regname) && regname[reg] != NULL)
++    return regname[reg];
++  else
++    return "???";
++}
+--- /dev/null
++++ b/src/aarch64/siglongjmp.S
+@@ -0,0 +1,12 @@
++	/* Dummy implementation for now.  */
++
++	.global _UI_siglongjmp_cont
++	.global _UI_longjmp_cont
++
++_UI_siglongjmp_cont:
++_UI_longjmp_cont:
++	ret
++#ifdef __linux__
++ /* We do not need executable stack.  */
++ .section  .note.GNU-stack,"",%progbits
++#endif
+--- /dev/null
++++ b/src/aarch64/unwind_i.h
+@@ -0,0 +1,43 @@
++/* libunwind - a platform-independent unwind library
++   Copyright (C) 2008 CodeSourcery
++   Copyright (C) 2013 Linaro Limited
++
++This file is part of libunwind.
++
++Permission is hereby granted, free of charge, to any person obtaining
++a copy of this software and associated documentation files (the
++"Software"), to deal in the Software without restriction, including
++without limitation the rights to use, copy, modify, merge, publish,
++distribute, sublicense, and/or sell copies of the Software, and to
++permit persons to whom the Software is furnished to do so, subject to
++the following conditions:
++
++The above copyright notice and this permission notice shall be
++included in all copies or substantial portions of the Software.
++
++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
++EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
++MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
++NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
++LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
++WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */
++
++#ifndef unwind_i_h
++#define unwind_i_h
++
++#include <stdint.h>
++
++#include <libunwind-aarch64.h>
++
++#include "libunwind_i.h"
++
++#define aarch64_lock			UNW_OBJ(lock)
++#define aarch64_local_resume		UNW_OBJ(local_resume)
++#define aarch64_local_addr_space_init	UNW_OBJ(local_addr_space_init)
++
++extern void aarch64_local_addr_space_init (void);
++extern int aarch64_local_resume (unw_addr_space_t as, unw_cursor_t *cursor,
++			     void *arg);
++
++#endif /* unwind_i_h */
+--- a/src/coredump/_UCD_access_reg_linux.c
++++ b/src/coredump/_UCD_access_reg_linux.c
+@@ -39,7 +39,10 @@ _UCD_access_reg (unw_addr_space_t as,
+       return -UNW_EINVAL;
+     }
+ 
+-#if defined(UNW_TARGET_ARM)
++#if defined(UNW_TARGET_AARCH64)
++  if (regnum < 0 || regnum >= UNW_AARCH64_FPCR)
++    goto badreg;
++#elif defined(UNW_TARGET_ARM)
+   if (regnum < 0 || regnum >= 16)
+     goto badreg;
+ #elif defined(UNW_TARGET_SH)
+--- a/src/ptrace/_UPT_reg_offset.c
++++ b/src/ptrace/_UPT_reg_offset.c
+@@ -1,6 +1,7 @@
+ /* libunwind - a platform-independent unwind library
+    Copyright (C) 2003-2004 Hewlett-Packard Co
+ 	Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
++   Copyright (C) 2013 Linaro Limited
+ 
+ This file is part of libunwind.
+ 
+@@ -501,6 +502,41 @@ const int _UPT_reg_offset[UNW_REG_LAST +
+     [UNW_ARM_R15]      = 0x3c,
+ #elif defined(UNW_TARGET_MIPS)
+ #elif defined(UNW_TARGET_SH)
++#elif defined(UNW_TARGET_AARCH64)
++    [UNW_AARCH64_X0]       = 0x00,
++    [UNW_AARCH64_X1]       = 0x08,
++    [UNW_AARCH64_X2]       = 0x10,
++    [UNW_AARCH64_X3]       = 0x18,
++    [UNW_AARCH64_X4]       = 0x20,
++    [UNW_AARCH64_X5]       = 0x28,
++    [UNW_AARCH64_X6]       = 0x30,
++    [UNW_AARCH64_X7]       = 0x38,
++    [UNW_AARCH64_X8]       = 0x40,
++    [UNW_AARCH64_X9]       = 0x48,
++    [UNW_AARCH64_X10]      = 0x50,
++    [UNW_AARCH64_X11]      = 0x58,
++    [UNW_AARCH64_X12]      = 0x60,
++    [UNW_AARCH64_X13]      = 0x68,
++    [UNW_AARCH64_X14]      = 0x70,
++    [UNW_AARCH64_X15]      = 0x78,
++    [UNW_AARCH64_X16]      = 0x80,
++    [UNW_AARCH64_X17]      = 0x88,
++    [UNW_AARCH64_X18]      = 0x90,
++    [UNW_AARCH64_X19]      = 0x98,
++    [UNW_AARCH64_X20]      = 0xa0,
++    [UNW_AARCH64_X21]      = 0xa8,
++    [UNW_AARCH64_X22]      = 0xb0,
++    [UNW_AARCH64_X23]      = 0xb8,
++    [UNW_AARCH64_X24]      = 0xc0,
++    [UNW_AARCH64_X25]      = 0xc8,
++    [UNW_AARCH64_X26]      = 0xd0,
++    [UNW_AARCH64_X27]      = 0xd8,
++    [UNW_AARCH64_X28]      = 0xe0,
++    [UNW_AARCH64_X29]      = 0xe8,
++    [UNW_AARCH64_X30]      = 0xf0,
++    [UNW_AARCH64_SP]       = 0xf8,
++    [UNW_AARCH64_PC]       = 0x100,
++    [UNW_AARCH64_PSTATE]   = 0x108
+ #else
+ # error Fix me.
+ #endif
diff --git a/meta/recipes-support/libunwind/libunwind-1.1/Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch b/meta/recipes-support/libunwind/libunwind-1.1/Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch
new file mode 100644
index 0000000..dc0f5c1
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind-1.1/Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch
@@ -0,0 +1,28 @@
+Fix test case link failure on PowerPC systems with Altivec
+
+Upstream-Status:backport
+
+On systems where the system compiler supports Altivec by default,
+the libunwind Makefile will attempt to build an extra test case
+ppc64-test-altivec.  Unfortunately, the link step will fail since
+the Makefile does not actually link against the libunwind library.
+
+Fixed by adding the appropriate LDADD macro.
+
+Signed-off-by: Ulrich Weigand <address@hidden>
+---
+ tests/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 0e30536..9c76628 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -201,3 +201,4 @@ Lia64_test_rbs_LDADD = $(LIBUNWIND_local)
+ Lia64_test_readonly_LDADD = $(LIBUNWIND_local)
+ ia64_test_dyn1_LDADD = $(LIBUNWIND)
+ ia64_test_sig_LDADD = $(LIBUNWIND)
++ppc64_test_altivec_LDADD = $(LIBUNWIND)
+-- 
+1.8.5
+
diff --git a/meta/recipes-support/libunwind/libunwind-1.1/Link-libunwind-to-libgcc_s-rather-than-libgcc.patch b/meta/recipes-support/libunwind/libunwind-1.1/Link-libunwind-to-libgcc_s-rather-than-libgcc.patch
new file mode 100644
index 0000000..0e55c91
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind-1.1/Link-libunwind-to-libgcc_s-rather-than-libgcc.patch
@@ -0,0 +1,42 @@
+From 508ca17a7be01d1cc960d9a07d0af4513948fb8d Mon Sep 17 00:00:00 2001
+From: Thierry Reding <treding@nvidia.com>
+Date: Fri, 27 Jun 2014 08:40:33 +0200
+Subject: [PATCH] Link libunwind to libgcc_s rather than libgcc
+
+For some architectures, -lgcc and -lgcc_s are not equivalent. On ARM for
+example, libgcc_s.so.1 contains some symbols needed by libunwind which
+are not present in libgcc.
+
+This causes the following link error when building the X.Org X server
+with libunwind support:
+
+	  CCLD     Xorg
+	/usr/lib/libunwind.so: undefined reference to `__aeabi_unwind_cpp_pr0'
+	/usr/lib/libunwind.so: undefined reference to `__aeabi_unwind_cpp_pr1'
+
+Linking against libgcc_s explicitly solves this problem.
+
+Upstream-Status: Backport
+
+Signed-off-by: Thierry Reding <treding@nvidia.com>
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index cffe19b..3beb5f2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -258,7 +258,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef __INTEL_COMPILER
+ 
+ if test x$GCC = xyes -a x$intel_compiler != xyes; then
+   CFLAGS="${CFLAGS} -fexceptions -Wall -Wsign-compare"
+-  LIBCRTS="-lgcc"
++  LIBCRTS="-lgcc_s"
+ fi
+ AC_MSG_RESULT([$intel_compiler])
+ 
+-- 
+2.3.2
+
diff --git a/meta/recipes-support/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch b/meta/recipes-support/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch
new file mode 100644
index 0000000..268b702
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind-1.1/Support-building-with-older-compilers.patch
@@ -0,0 +1,72 @@
+From 10b064ffe902d5af31bb49bd8e4f03c545f8d462 Mon Sep 17 00:00:00 2001
+From: Ladislav Michl <ladis@linux-mips.org>
+Date: Tue, 13 Nov 2012 11:19:47 +0100
+Subject: [PATCH] Support building with older compilers.
+
+Add a check for __builtin_unreachable.
+
+Upstream-Status: Pending
+---
+ configure.ac          |   11 +++++++++++
+ include/libunwind_i.h |    6 ++++++
+ src/arm/Gresume.c     |    2 +-
+ src/sh/Gresume.c      |    2 +-
+ 4 files changed, 19 insertions(+), 2 deletions(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -285,6 +285,17 @@ if test x$have__builtin___clear_cache =
+ fi
+ AC_MSG_RESULT([$have__builtin___clear_cache])
+ 
++AC_MSG_CHECKING([for __builtin_unreachable])
++AC_LINK_IFELSE(
++  [AC_LANG_PROGRAM([[]], [[__builtin_unreachable()]])],
++  [have__builtin_unreachable=yes],
++  [have__builtin_unreachable=no])
++if test x$have__builtin_unreachable = xyes; then
++  AC_DEFINE([HAVE__BUILTIN_UNREACHABLE], [1],
++            [Defined if __builtin_unreachable() is available])
++fi
++AC_MSG_RESULT([$have__builtin_unreachable])
++
+ AC_MSG_CHECKING([for __sync atomics])
+ AC_LINK_IFELSE(
+   [AC_LANG_PROGRAM([[]], [[
+--- a/include/libunwind_i.h
++++ b/include/libunwind_i.h
+@@ -72,6 +72,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DE
+ # endif
+ #endif
+ 
++#if defined(HAVE__BUILTIN_UNREACHABLE)
++# define unreachable() __builtin_unreachable()
++#else
++# define unreachable() do { } while (1)
++#endif
++
+ #ifdef DEBUG
+ # define UNW_DEBUG	1
+ #else
+--- a/src/arm/Gresume.c
++++ b/src/arm/Gresume.c
+@@ -96,7 +96,7 @@ arm_local_resume (unw_addr_space_t as, u
+ 	: : "r" (c->sigcontext_sp), "r" (c->sigcontext_pc)
+       );
+    }
+-  __builtin_unreachable();
++  unreachable();
+ #else
+   printf ("%s: implement me\n", __FUNCTION__);
+ #endif
+--- a/src/sh/Gresume.c
++++ b/src/sh/Gresume.c
+@@ -109,7 +109,7 @@ sh_local_resume (unw_addr_space_t as, un
+ 	  "r" (c->sigcontext_pc)
+       );
+    }
+-  __builtin_unreachable();
++  unreachable();
+ #endif
+   return -UNW_EINVAL;
+ }
diff --git a/meta/recipes-support/libunwind/libunwind.inc b/meta/recipes-support/libunwind/libunwind.inc
new file mode 100644
index 0000000..6660af2
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind.inc
@@ -0,0 +1,31 @@
+DESCRIPTION = "a portable and efficient C programming interface (API) to determine the call-chain of a program"
+HOMEPAGE = "http://www.nongnu.org/libunwind"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3fced11d6df719b47505837a51c16ae5"
+DEPENDS += "libatomic-ops"
+
+SRC_URI = "${SAVANNAH_NONGNU_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
+
+inherit autotools
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[lzma] = "--enable-minidebuginfo,--disable-minidebuginfo,xz"
+
+EXTRA_OECONF_arm = "--enable-debug-frame"
+EXTRA_OECONF_aarch64 = "--enable-debug-frame"
+
+CFLAGS += "${ATOMICOPS}"
+ATOMICOPS_armv5 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS_armv4 = "-DAO_USE_PTHREAD_DEFS=1"
+ATOMICOPS ?= ""
+
+LDFLAGS_append_x86 = " -fuse-ld=gold"
+LDFLAGS_append_x86-64 = " -fuse-ld=gold"
+
+LDFLAGS_append_arm = " -fuse-ld=gold"
+LDFLAGS_append_aarch64 = " -fuse-ld=gold"
+
+LDFLAGS_append_powerpc = " -fuse-ld=gold"
+LDFLAGS_append_powerpc64 = " -fuse-ld=gold"
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/libunwind/libunwind_1.1.bb b/meta/recipes-support/libunwind/libunwind_1.1.bb
new file mode 100644
index 0000000..8282c1b
--- /dev/null
+++ b/meta/recipes-support/libunwind/libunwind_1.1.bb
@@ -0,0 +1,12 @@
+require libunwind.inc
+
+SRC_URI += "\
+    file://Support-building-with-older-compilers.patch \
+    file://AArch64-port.patch \
+    file://Fix-test-case-link-failure-on-PowerPC-systems-with-Altivec.patch \
+    file://Link-libunwind-to-libgcc_s-rather-than-libgcc.patch \
+    file://0001-Invalid-dwarf-opcodes-can-cause-references-beyond-th.patch \
+"
+
+SRC_URI[md5sum] = "fb4ea2f6fbbe45bf032cd36e586883ce"
+SRC_URI[sha256sum] = "9dfe0fcae2a866de9d3942c66995e4b460230446887dbdab302d41a8aee8d09a"
diff --git a/meta/recipes-support/liburcu/liburcu/0001-uatomic-Specify-complete-types-for-atomic-function-c.patch b/meta/recipes-support/liburcu/liburcu/0001-uatomic-Specify-complete-types-for-atomic-function-c.patch
new file mode 100644
index 0000000..5ad0bbd
--- /dev/null
+++ b/meta/recipes-support/liburcu/liburcu/0001-uatomic-Specify-complete-types-for-atomic-function-c.patch
@@ -0,0 +1,158 @@
+From 6af790818d074c103c4797f1ce764896f183e028 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 22 Aug 2015 21:35:03 -0700
+Subject: [PATCH] uatomic: Specify complete types for atomic function calls
+
+This was unearthed by clang compiler where it complained about parameter
+mismatch, gcc doesnt notice this
+
+urcu/uatomic/generic.h:190:10: error: address argument to atomic builtin
+must be a pointer to integer or pointer ('void *' invalid)
+                return __sync_add_and_fetch_4(addr, val);
+
+Fixed all instances thusly
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted
+
+ urcu/uatomic/generic.h | 40 ++++++++++++++++++++--------------------
+ 1 file changed, 20 insertions(+), 20 deletions(-)
+
+diff --git a/urcu/uatomic/generic.h b/urcu/uatomic/generic.h
+index 37f59cc..0046ffd 100644
+--- a/urcu/uatomic/generic.h
++++ b/urcu/uatomic/generic.h
+@@ -65,17 +65,17 @@ unsigned long _uatomic_cmpxchg(void *addr, unsigned long old,
+ 	switch (len) {
+ #ifdef UATOMIC_HAS_ATOMIC_BYTE
+ 	case 1:
+-		return __sync_val_compare_and_swap_1(addr, old, _new);
++		return __sync_val_compare_and_swap_1((unsigned char *)addr, old, _new);
+ #endif
+ #ifdef UATOMIC_HAS_ATOMIC_SHORT
+ 	case 2:
+-		return __sync_val_compare_and_swap_2(addr, old, _new);
++		return __sync_val_compare_and_swap_2((unsigned short int *)addr, old, _new);
+ #endif
+ 	case 4:
+-		return __sync_val_compare_and_swap_4(addr, old, _new);
++		return __sync_val_compare_and_swap_4((unsigned int *)addr, old, _new);
+ #if (CAA_BITS_PER_LONG == 64)
+ 	case 8:
+-		return __sync_val_compare_and_swap_8(addr, old, _new);
++		return __sync_val_compare_and_swap_8((unsigned long *)addr, old, _new);
+ #endif
+ 	}
+ 	_uatomic_link_error();
+@@ -100,20 +100,20 @@ void _uatomic_and(void *addr, unsigned long val,
+ 	switch (len) {
+ #ifdef UATOMIC_HAS_ATOMIC_BYTE
+ 	case 1:
+-		__sync_and_and_fetch_1(addr, val);
++		__sync_and_and_fetch_1((unsigned char *)addr, val);
+ 		return;
+ #endif
+ #ifdef UATOMIC_HAS_ATOMIC_SHORT
+ 	case 2:
+-		__sync_and_and_fetch_2(addr, val);
++		__sync_and_and_fetch_2((unsigned short int *)addr, val);
+ 		return;
+ #endif
+ 	case 4:
+-		__sync_and_and_fetch_4(addr, val);
++		__sync_and_and_fetch_4((unsigned int *)addr, val);
+ 		return;
+ #if (CAA_BITS_PER_LONG == 64)
+ 	case 8:
+-		__sync_and_and_fetch_8(addr, val);
++		__sync_and_and_fetch_8((unsigned long *)addr, val);
+ 		return;
+ #endif
+ 	}
+@@ -139,20 +139,20 @@ void _uatomic_or(void *addr, unsigned long val,
+ 	switch (len) {
+ #ifdef UATOMIC_HAS_ATOMIC_BYTE
+ 	case 1:
+-		__sync_or_and_fetch_1(addr, val);
++		__sync_or_and_fetch_1((unsigned char *)addr, val);
+ 		return;
+ #endif
+ #ifdef UATOMIC_HAS_ATOMIC_SHORT
+ 	case 2:
+-		__sync_or_and_fetch_2(addr, val);
++		__sync_or_and_fetch_2((unsigned short int *)addr, val);
+ 		return;
+ #endif
+ 	case 4:
+-		__sync_or_and_fetch_4(addr, val);
++		__sync_or_and_fetch_4((unsigned int *)addr, val);
+ 		return;
+ #if (CAA_BITS_PER_LONG == 64)
+ 	case 8:
+-		__sync_or_and_fetch_8(addr, val);
++		__sync_or_and_fetch_8((unsigned long *)addr, val);
+ 		return;
+ #endif
+ 	}
+@@ -180,17 +180,17 @@ unsigned long _uatomic_add_return(void *addr, unsigned long val,
+ 	switch (len) {
+ #ifdef UATOMIC_HAS_ATOMIC_BYTE
+ 	case 1:
+-		return __sync_add_and_fetch_1(addr, val);
++		return __sync_add_and_fetch_1((unsigned char *)addr, val);
+ #endif
+ #ifdef UATOMIC_HAS_ATOMIC_SHORT
+ 	case 2:
+-		return __sync_add_and_fetch_2(addr, val);
++		return __sync_add_and_fetch_2((unsigned short int *)addr, val);
+ #endif
+ 	case 4:
+-		return __sync_add_and_fetch_4(addr, val);
++		return __sync_add_and_fetch_4((unsigned int *)addr, val);
+ #if (CAA_BITS_PER_LONG == 64)
+ 	case 8:
+-		return __sync_add_and_fetch_8(addr, val);
++		return __sync_add_and_fetch_8((unsigned long *)addr, val);
+ #endif
+ 	}
+ 	_uatomic_link_error();
+@@ -218,7 +218,7 @@ unsigned long _uatomic_exchange(void *addr, unsigned long val, int len)
+ 
+ 		do {
+ 			old = uatomic_read((unsigned char *)addr);
+-		} while (!__sync_bool_compare_and_swap_1(addr, old, val));
++		} while (!__sync_bool_compare_and_swap_1((unsigned char *)addr, old, val));
+ 
+ 		return old;
+ 	}
+@@ -230,7 +230,7 @@ unsigned long _uatomic_exchange(void *addr, unsigned long val, int len)
+ 
+ 		do {
+ 			old = uatomic_read((unsigned short *)addr);
+-		} while (!__sync_bool_compare_and_swap_2(addr, old, val));
++		} while (!__sync_bool_compare_and_swap_2((unsigned short int *)addr, old, val));
+ 
+ 		return old;
+ 	}
+@@ -241,7 +241,7 @@ unsigned long _uatomic_exchange(void *addr, unsigned long val, int len)
+ 
+ 		do {
+ 			old = uatomic_read((unsigned int *)addr);
+-		} while (!__sync_bool_compare_and_swap_4(addr, old, val));
++		} while (!__sync_bool_compare_and_swap_4((unsigned int *)addr, old, val));
+ 
+ 		return old;
+ 	}
+@@ -252,7 +252,7 @@ unsigned long _uatomic_exchange(void *addr, unsigned long val, int len)
+ 
+ 		do {
+ 			old = uatomic_read((unsigned long *)addr);
+-		} while (!__sync_bool_compare_and_swap_8(addr, old, val));
++		} while (!__sync_bool_compare_and_swap_8((unsigned long *)addr, old, val));
+ 
+ 		return old;
+ 	}
+-- 
+2.1.4
+
diff --git a/meta/recipes-support/liburcu/liburcu/Revert-Blacklist-ARM-gcc-4.8.0-4.8.1-4.8.2.patch b/meta/recipes-support/liburcu/liburcu/Revert-Blacklist-ARM-gcc-4.8.0-4.8.1-4.8.2.patch
new file mode 100644
index 0000000..535a738
--- /dev/null
+++ b/meta/recipes-support/liburcu/liburcu/Revert-Blacklist-ARM-gcc-4.8.0-4.8.1-4.8.2.patch
@@ -0,0 +1,47 @@
+From 7b3df100346128d780f218b881d563d1fd12e310 Mon Sep 17 00:00:00 2001
+From: Jonathan Liu <net147@gmail.com>
+Date: Mon, 20 Oct 2014 13:46:10 +1100
+Subject: [PATCH] Revert "Blacklist ARM gcc 4.8.0, 4.8.1, 4.8.2"
+
+This reverts commit 4b79310aa3d408ba30fee02cc497a68072d38a99.
+OE-Core is using a patched GCC 4.8.2 which is able to compile liburcu
+properly.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Jonathan Liu <net147@gmail.com>
+---
+ urcu/compiler.h | 19 -------------------
+ 1 file changed, 19 deletions(-)
+
+diff --git a/urcu/compiler.h b/urcu/compiler.h
+index 1e30903..19534f0 100644
+--- a/urcu/compiler.h
++++ b/urcu/compiler.h
+@@ -108,23 +108,4 @@
+ 
+ #define CAA_ARRAY_SIZE(x)	(sizeof(x) / sizeof((x)[0]))
+ 
+-/*
+- * Don't allow compiling with buggy compiler.
+- */
+-
+-#ifdef __GNUC__
+-# define URCU_GCC_VERSION	(__GNUC__ * 10000 \
+-				+ __GNUC_MINOR__ * 100 \
+-				+ __GNUC_PATCHLEVEL__)
+-
+-/*
+- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58854
+- */
+-# ifdef __ARMEL__
+-#  if URCU_GCC_VERSION >= 40800 && URCU_GCC_VERSION <= 40802
+-#   error Your gcc version produces clobbered frame accesses
+-#  endif
+-# endif
+-#endif
+-
+ #endif /* _URCU_COMPILER_H */
+-- 
+2.1.2
+
diff --git a/meta/recipes-support/liburcu/liburcu/aarch64.patch b/meta/recipes-support/liburcu/liburcu/aarch64.patch
new file mode 100644
index 0000000..c6cc8c2
--- /dev/null
+++ b/meta/recipes-support/liburcu/liburcu/aarch64.patch
@@ -0,0 +1,19 @@
+libucru: recognize aarch64
+
+Make the same as "arm" internally.
+
+Upstream-Status: Pending
+
+Signed-off-by: joe.slater@windriver.com
+
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -77,6 +77,7 @@ AS_CASE([$host_cpu],
+ 	[alpha*], [ARCHTYPE="alpha"],
+ 	[ia64], [ARCHTYPE="gcc"],
+ 	[arm*], [ARCHTYPE="arm"],
++	[aarch64], [ARCHTYPE="arm"],
+ 	[mips*], [ARCHTYPE="mips"],
+ 	[tile*], [ARCHTYPE="gcc"],
+ 	[ARCHTYPE="unknown"]
diff --git a/meta/recipes-support/liburcu/liburcu_0.8.7.bb b/meta/recipes-support/liburcu/liburcu_0.8.7.bb
new file mode 100644
index 0000000..a7f4f51
--- /dev/null
+++ b/meta/recipes-support/liburcu/liburcu_0.8.7.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Userspace RCU (read-copy-update) library"
+HOMEPAGE = "http://lttng.org/urcu"
+BUGTRACKER = "http://lttng.org/project/issues"
+
+LICENSE = "LGPLv2.1+ & MIT-style"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=0f060c30a27922ce9c0d557a639b4fa3 \
+                    file://urcu.h;beginline=4;endline=32;md5=4de0d68d3a997643715036d2209ae1d9 \
+                    file://urcu/uatomic/x86.h;beginline=4;endline=21;md5=220552f72c55b102f2ee35929734ef42"
+
+SRC_URI = "http://lttng.org/files/urcu/userspace-rcu-${PV}.tar.bz2 \
+           file://Revert-Blacklist-ARM-gcc-4.8.0-4.8.1-4.8.2.patch \
+           file://aarch64.patch \
+           file://0001-uatomic-Specify-complete-types-for-atomic-function-c.patch \
+          "
+
+SRC_URI[md5sum] = "7a6ee17871d31226db3f618e28351d22"
+SRC_URI[sha256sum] = "b523f22c4726ca6bb77a77d258e76d8c33c89724433bd65313024b98e55c4295"
+
+S = "${WORKDIR}/userspace-rcu-${PV}"
+CFLAGS_append_libc-uclibc = " -D_GNU_SOURCE"
+inherit autotools
diff --git a/meta/recipes-support/libusb/libusb-compat/0001-usb.h-Include-sys-types.h.patch b/meta/recipes-support/libusb/libusb-compat/0001-usb.h-Include-sys-types.h.patch
new file mode 100644
index 0000000..b88440d
--- /dev/null
+++ b/meta/recipes-support/libusb/libusb-compat/0001-usb.h-Include-sys-types.h.patch
@@ -0,0 +1,30 @@
+From 340f911f9e3f4ff6b01682c5341c959060782af2 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 2 Apr 2015 19:18:45 -0700
+Subject: [PATCH] usb.h: Include sys/types.h
+
+We need the definitions for things like u_intX_t
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ libusb/usb.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/libusb/usb.h b/libusb/usb.h
+index 84e730f..caffae2 100644
+--- a/libusb/usb.h
++++ b/libusb/usb.h
+@@ -31,6 +31,8 @@
+ 
+ #include <dirent.h>
+ 
++#include <sys/types.h>
++
+ /*
+  * USB spec information
+  *
+-- 
+2.1.4
+
diff --git a/meta/recipes-support/libusb/libusb-compat_0.1.5.bb b/meta/recipes-support/libusb/libusb-compat_0.1.5.bb
new file mode 100644
index 0000000..646872c
--- /dev/null
+++ b/meta/recipes-support/libusb/libusb-compat_0.1.5.bb
@@ -0,0 +1,39 @@
+SUMMARY = "libusb-0.1 compatibility layer for libusb1"
+DESCRIPTION = "libusb-0.1 compatible layer for libusb1, a drop-in replacement \
+that aims to look, feel and behave exactly like libusb-0.1"
+HOMEPAGE = "http://www.libusb.org/"
+BUGTRACKER = "http://www.libusb.org/report"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=f2ac5f3ac4835e8f91324a26a590a423"
+DEPENDS = "libusb1"
+
+# Few packages are known not to work with libusb-compat (e.g. libmtp-1.0.0),
+# so here libusb-0.1 is removed completely instead of adding virtual/libusb0.
+# Besides, libusb-0.1 uses a per 1ms polling that hurts a lot to power
+# consumption.
+PROVIDES = "libusb virtual/libusb0"
+BBCLASSEXTEND = "native nativesdk"
+
+PE = "1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-compat-${PV}.tar.bz2 \
+           file://0001-usb.h-Include-sys-types.h.patch \
+          "
+
+SRC_URI[md5sum] = "2780b6a758a1e2c2943bdbf7faf740e4"
+SRC_URI[sha256sum] = "404ef4b6b324be79ac1bfb3d839eac860fbc929e6acb1ef88793a6ea328bc55a"
+
+BINCONFIG = "${bindir}/libusb-config"
+
+inherit autotools pkgconfig binconfig-disabled lib_package
+
+EXTRA_OECONF = "--libdir=${base_libdir}"
+
+do_install_append() {
+	install -d ${D}${libdir}
+	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+		mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
+	fi
+}
diff --git a/meta/recipes-support/libusb/libusb1_1.0.19.bb b/meta/recipes-support/libusb/libusb1_1.0.19.bb
new file mode 100644
index 0000000..a20e1fc
--- /dev/null
+++ b/meta/recipes-support/libusb/libusb1_1.0.19.bb
@@ -0,0 +1,34 @@
+SUMMARY = "Userspace library to access USB (version 1.0)"
+HOMEPAGE = "http://libusb.sf.net"
+BUGTRACKER = "http://www.libusb.org/report"
+SECTION = "libs"
+
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+
+BBCLASSEXTEND = "native nativesdk"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/libusb/libusb-${PV}.tar.bz2 \
+          "
+
+SRC_URI[md5sum] = "f9e2bb5879968467e5ca756cb4e1fa7e"
+SRC_URI[sha256sum] = "6c502c816002f90d4f76050a6429c3a7e0d84204222cbff2dce95dd773ba6840"
+
+S = "${WORKDIR}/libusb-${PV}"
+
+inherit autotools pkgconfig
+
+# Don't configure udev by default since it will cause a circular
+# dependecy with udev package, which depends on libusb
+EXTRA_OECONF = "--libdir=${base_libdir} --disable-udev"
+
+do_install_append() {
+	install -d ${D}${libdir}
+	if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
+		mv ${D}${base_libdir}/pkgconfig ${D}${libdir}
+	fi
+}
+
+FILES_${PN} += "${base_libdir}/*.so.*"
+
+FILES_${PN}-dev += "${base_libdir}/*.so ${base_libdir}/*.la"
diff --git a/meta/recipes-support/libxslt/libxslt/pkgconfig.patch b/meta/recipes-support/libxslt/libxslt/pkgconfig.patch
new file mode 100644
index 0000000..89d14c9
--- /dev/null
+++ b/meta/recipes-support/libxslt/libxslt/pkgconfig.patch
@@ -0,0 +1,118 @@
+Use pkg-config to find gcrypt and libxml2.
+
+Upstream-Status: Pending [libxml2 is upstreamable]
+
+RP 2014/5/22
+
+Index: libxslt-1.1.28/configure.in
+===================================================================
+--- libxslt-1.1.28.orig/configure.in	2014-05-13 16:46:02.278474967 +0000
++++ libxslt-1.1.28/configure.in	2014-05-13 16:53:56.510472561 +0000
+@@ -376,6 +376,8 @@
+ AC_SUBST(PYTHON_SUBDIR)
+ AC_SUBST(PYTHON_LIBS)
+ 
++PKG_PROG_PKG_CONFIG
++
+ AC_ARG_WITH(crypto, [  --with-crypto           Add crypto support to exslt (on)])
+ WITH_CRYPTO=0
+ if test "$with_crypto" = "no" ; then
+@@ -391,26 +393,13 @@
+     WITH_CRYPTO=1
+     ;;
+   *)
+-    AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no)
+-    if test "$LIBGCRYPT_CONFIG" != "no" ; then
+-      LIBGCRYPT_VERSION=`$LIBGCRYPT_CONFIG --version`
+-      if test VERSION_TO_NUMBER(echo $LIBGCRYPT_VERSION) -lt VERSION_TO_NUMBER(echo "1.1.42")
+-      then
+-        LIBGCRYPT_CFLAGS=""
+-        LIBGCRYPT_LIBS=""
+-        echo 'gcrypt library version < 1.1.42 - Crypto extensions will not be available.'
+-      else
+-        LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --cflags`
+-        LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG $libgcrypt_config_args --libs`
+-        AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
+-        echo 'Crypto extensions will be available.'
++    PKG_CHECK_MODULES(LIBGCRYPT, [libgcrypt >= 1.1.42], [
++          AC_DEFINE(HAVE_GCRYPT, 1, [Define if gcrypt library is available.])
++          echo 'Crypto extensions will be available.'
+ 		WITH_CRYPTO=1
+-      fi
+-    else
+-      LIBGCRYPT_CFLAGS=""
+-      LIBGCRYPT_LIBS=""
+-      echo 'Crypto extensions will not be available. Install libgcrypt and reconfigure to make available.'
+-    fi
++	], [
++          echo 'Crypto extensions will not be available. Install libgcrypt >= 1.1.42 and reconfigure to make available.'
++        ])
+ esac
+ fi
+ AC_SUBST(WITH_CRYPTO)
+@@ -471,24 +460,8 @@
+ dnl some tweaking - David Härdeman 30/10/2001
+ dnl
+ 
+-LIBXML_CONFIG_PREFIX=""
+ LIBXML_SRC=""
+ 
+-AC_ARG_WITH(libxml-prefix,
+-        [  --with-libxml-prefix=[PFX]		Specify location of libxml config],
+-	LIBXML_CONFIG_PREFIX=$withval
+-)
+-        
+-AC_ARG_WITH(libxml-include-prefix,
+-        [  --with-libxml-include-prefix=[PFX]	Specify location of libxml headers],
+-        LIBXML_CFLAGS="-I$withval"
+-)
+-
+-AC_ARG_WITH(libxml-libs-prefix,
+-        [  --with-libxml-libs-prefix=[PFX]	Specify location of libxml libs],
+-        LIBXML_LIBS="-L$withval"
+-)
+-
+ AC_ARG_WITH(libxml-src,
+ 	[  --with-libxml-src=[DIR]              For libxml thats not installed yet (sets all three above)],
+ 	LIBXML_SRC="$withval"
+@@ -551,28 +524,9 @@
+ 	fi
+ fi
+ 
+-dnl
+-dnl make sure xml2-config is executable,
+-dnl test version and init our variables
+-dnl
+-
+-if ${XML_CONFIG} --libs print > /dev/null 2>&1
+-then
+-	XMLVERS=`$XML_CONFIG --version`
+-	if test VERSION_TO_NUMBER(echo $XMLVERS) -ge VERSION_TO_NUMBER(echo $LIBXML_REQUIRED_VERSION)
+-	then
+-		AC_MSG_RESULT($XMLVERS found)
+-	else
+-		AC_MSG_ERROR(Version $XMLVERS found. You need at least libxml2 $LIBXML_REQUIRED_VERSION for this version of libxslt)
+-	fi
+-	LIBXML_LIBS="$LIBXML_LIBS `$XML_CONFIG --libs`"
+-	if test "x$LIBXML_SRC" = "x"; then
+-		LIBXML_CFLAGS="$LIBXML_CFLAGS `$XML_CONFIG --cflags`"
+-	fi
+-else
+-	AC_MSG_ERROR([Could not find libxml2 anywhere, check ftp://xmlsoft.org/.])
+-fi
+-
++PKG_CHECK_MODULES(LIBXML, [libxml-2.0 >= $LIBXML_REQUIRED_VERSION],,
++    [AC_MSG_ERROR([Could not find libxml-2.0 >= $LIBXML_REQUIRED_VERSION anywhere, check ftp://xmlsoft.org/.])]
++)
+ 
+ AC_SUBST(CFLAGS)
+ AC_SUBST(CPPFLAGS)
+@@ -597,7 +551,7 @@
+ 
+ if test "$with_plugins" = "yes" ; then
+   AC_MSG_CHECKING([libxml2 module support])
+-  WITH_MODULES="`$XML_CONFIG --modules`"
++  WITH_MODULES="`$PKG_CONFIG --variable=modules libxml-2.0`"
+   if test "${WITH_MODULES}" = "1"; then
+     AC_MSG_RESULT(yes)
+   else
diff --git a/meta/recipes-support/libxslt/libxslt/pkgconfig_fix.patch b/meta/recipes-support/libxslt/libxslt/pkgconfig_fix.patch
new file mode 100644
index 0000000..16a8010
--- /dev/null
+++ b/meta/recipes-support/libxslt/libxslt/pkgconfig_fix.patch
@@ -0,0 +1,24 @@
+Upstream-Status: Inappropriate [configuration]
+
+Index: libxslt-1.1.27/libexslt.pc.in
+===================================================================
+--- libxslt-1.1.27.orig/libexslt.pc.in
++++ libxslt-1.1.27/libexslt.pc.in
+@@ -8,5 +8,5 @@ Name: libexslt
+ Version: @LIBEXSLT_VERSION@
+ Description: EXSLT Extension library
+ Requires: libxml-2.0
+-Libs: @EXSLT_LIBDIR@ @EXSLT_LIBS@
++Libs: -lexslt @EXSLT_LIBDIR@ @EXSLT_LIBS@
+ Cflags: @EXSLT_INCLUDEDIR@
+Index: libxslt-1.1.27/libxslt.pc.in
+===================================================================
+--- libxslt-1.1.27.orig/libxslt.pc.in
++++ libxslt-1.1.27/libxslt.pc.in
+@@ -8,5 +8,5 @@ Name: libxslt
+ Version: @VERSION@
+ Description: XSLT library version 2.
+ Requires: libxml-2.0
+-Libs: @XSLT_LIBDIR@ @XSLT_LIBS@ @EXTRA_LIBS@
++Libs: -lxslt @XSLT_LIBDIR@ @XSLT_LIBS@ @EXTRA_LIBS@
+ Cflags: @XSLT_INCLUDEDIR@
diff --git a/meta/recipes-support/libxslt/libxslt_1.1.28.bb b/meta/recipes-support/libxslt/libxslt_1.1.28.bb
new file mode 100644
index 0000000..166bcd8
--- /dev/null
+++ b/meta/recipes-support/libxslt/libxslt_1.1.28.bb
@@ -0,0 +1,46 @@
+SUMMARY = "GNOME XSLT library"
+HOMEPAGE = "http://xmlsoft.org/XSLT/"
+BUGTRACKER = "https://bugzilla.gnome.org/"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://Copyright;md5=0cd9a07afbeb24026c9b03aecfeba458"
+
+SECTION = "libs"
+DEPENDS = "libxml2"
+
+SRC_URI = "ftp://xmlsoft.org/libxslt//libxslt-${PV}.tar.gz \
+           file://pkgconfig_fix.patch \
+           file://pkgconfig.patch"
+
+SRC_URI[md5sum] = "9667bf6f9310b957254fdcf6596600b7"
+SRC_URI[sha256sum] = "5fc7151a57b89c03d7b825df5a0fae0a8d5f05674c0e7cf2937ecec4d54a028c"
+S = "${WORKDIR}/libxslt-${PV}"
+
+BINCONFIG = "${bindir}/xslt-config"
+
+inherit autotools pkgconfig binconfig-disabled lib_package
+
+# We don't DEPEND on binutils for ansidecl.h so ensure we don't use the header
+do_configure_prepend () {
+	sed -i -e 's/ansidecl.h//' ${S}/configure.in
+
+	# The timestamps in the 1.1.28 tarball are messed up causing this file to
+	# appear out of date.  Touch it so that we don't try to regenerate it.
+	touch ${S}/doc/xsltproc.1
+}
+
+EXTRA_OECONF = "--without-python --without-debug --without-mem-debug --without-crypto"
+# older versions of this recipe had ${PN}-utils
+RPROVIDES_${PN}-bin += "${PN}-utils"
+RCONFLICTS_${PN}-bin += "${PN}-utils"
+RREPLACES_${PN}-bin += "${PN}-utils"
+
+
+do_install_append_class-native () {
+    create_wrapper ${D}/${bindir}/xsltproc XML_CATALOG_FILES=${sysconfdir}/xml/catalog.xml
+}
+
+FILES_${PN} += "${libdir}/libxslt-plugins"
+FILES_${PN}-dev += "${libdir}/xsltConf.sh"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/libyaml/files/libyaml-CVE-2014-9130.patch b/meta/recipes-support/libyaml/files/libyaml-CVE-2014-9130.patch
new file mode 100644
index 0000000..3c4a00e
--- /dev/null
+++ b/meta/recipes-support/libyaml/files/libyaml-CVE-2014-9130.patch
@@ -0,0 +1,32 @@
+# HG changeset patch
+# User Kirill Simonov <xi@resolvent.net>
+# Date 1417197312 21600
+# Node ID 2b9156756423e967cfd09a61d125d883fca6f4f2
+# Parent  053f53a381ff6adbbc93a31ab7fdee06a16c8a33
+Removed invalid simple key assertion (thank to Jonathan Gray).
+
+The patch comes from 
+
+https://bitbucket.org/xi/libyaml/commits/2b9156756423e967cfd09a61d125d883fca6f4f2
+
+Upstream-Status: Backport
+
+Signed-off-by: Yue Tao <yue.tao@windriver.com>
+
+diff -r 053f53a381ff -r 2b9156756423 src/scanner.c
+--- a/src/scanner.c	Wed Mar 26 13:55:54 2014 -0500
++++ b/src/scanner.c	Fri Nov 28 11:55:12 2014 -0600
+@@ -1106,13 +1106,6 @@
+             && parser->indent == (ptrdiff_t)parser->mark.column);
+ 
+     /*
+-     * A simple key is required only when it is the first token in the current
+-     * line.  Therefore it is always allowed.  But we add a check anyway.
+-     */
+-
+-    assert(parser->simple_key_allowed || !required);    /* Impossible. */
+-
+-    /*
+      * If the current position may start a simple key, save it.
+      */
+ 
diff --git a/meta/recipes-support/libyaml/libyaml_0.1.6.bb b/meta/recipes-support/libyaml/libyaml_0.1.6.bb
new file mode 100644
index 0000000..b015577
--- /dev/null
+++ b/meta/recipes-support/libyaml/libyaml_0.1.6.bb
@@ -0,0 +1,21 @@
+SUMMARY = "LibYAML is a YAML 1.1 parser and emitter written in C."
+DESCRIPTION = "LibYAML is a C library for parsing and emitting data in YAML 1.1, \
+a human-readable data serialization format. "
+HOMEPAGE = "http://pyyaml.org/wiki/LibYAML"
+SECTION = "libs/devel"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=6015f088759b10e0bc2bf64898d4ae17"
+
+SRC_URI = "http://pyyaml.org/download/libyaml/yaml-${PV}.tar.gz \
+           file://libyaml-CVE-2014-9130.patch \
+          "
+
+SRC_URI[md5sum] = "5fe00cda18ca5daeb43762b80c38e06e"
+SRC_URI[sha256sum] = "7da6971b4bd08a986dd2a61353bc422362bd0edcc67d7ebaac68c95f74182749"
+
+S = "${WORKDIR}/yaml-${PV}"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/lz4/lz4.bb b/meta/recipes-support/lz4/lz4.bb
new file mode 100644
index 0000000..18e56d0
--- /dev/null
+++ b/meta/recipes-support/lz4/lz4.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Extremely Fast Compression algorithm"
+DESCRIPTION = "LZ4 is a very fast lossless compression algorithm, providing compression speed at 400 MB/s per core, scalable with multi-cores CPU. It also features an extremely fast decoder, with speed in multiple GB/s per core, typically reaching RAM speed limits on multi-core systems."
+
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://lib/LICENSE;md5=0b0d063f37a4477b54af2459477dcafd"
+
+SRCREV = "d86dc916771c126afb797637dda9f6421c0cb998"
+
+PV = "131+git${SRCPV}"
+
+SRC_URI = "git://github.com/Cyan4973/lz4.git"
+
+S = "${WORKDIR}/git"
+
+EXTRA_OEMAKE = "PREFIX=${prefix} CC='${CC}' DESTDIR=${D} LIBDIR=${libdir} INCLUDEDIR=${includedir}"
+
+do_install() {
+	oe_runmake install
+}
+
+BBCLASSEXTEND += "native nativesdk"
diff --git a/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch b/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
new file mode 100644
index 0000000..db3a70e
--- /dev/null
+++ b/meta/recipes-support/lzo/lzo/0001-Use-memcpy-instead-of-reinventing-it.patch
@@ -0,0 +1,70 @@
+From: Simon McVittie <smcv@debian.org>
+Date: Sun, 23 Nov 2014 22:50:33 +0000
+Subject: Use memcpy() instead of reinventing it
+
+gcc inlines memcpy() with results as fast as handwritten code (at
+least in my brief testing with lzop), and knows the alignment
+constraints for our architectures.
+
+Change suggested by Julian Taylor.
+
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757037
+
+Upstream-Status: Pending
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+---
+ minilzo/minilzo.c | 14 ++++++++++++++
+ src/lzo_func.h    | 14 ++++++++++++++
+ 2 files changed, 28 insertions(+)
+
+
+diff --git a/minilzo/minilzo.c b/minilzo/minilzo.c
+index ab2be5f..6913c2f 100644
+--- a/minilzo/minilzo.c
++++ b/minilzo/minilzo.c
+@@ -3523,6 +3523,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
+     if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
+     LZO_BLOCK_END
+ 
++/* Debian-specific change: we know that our compiler inlines memcpy() with
++ * constant n to be as fast as handwritten code, and knows which architectures
++ * need things correctly aligned. */
++#undef LZO_MEMOPS_COPY1
++#undef LZO_MEMOPS_COPY2
++#undef LZO_MEMOPS_COPY4
++#undef LZO_MEMOPS_COPY8
++#undef LZO_MEMOPS_COPYN
++#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1)
++#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2)
++#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4)
++#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8)
++#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn)
++
+ __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
+ {
+     lzo_uint16_t v;
+diff --git a/src/lzo_func.h b/src/lzo_func.h
+index dfaa676..1cc1b53 100644
+--- a/src/lzo_func.h
++++ b/src/lzo_func.h
+@@ -333,6 +333,20 @@ LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(*(lzo_memops_TU8p)0)==8)
+     if ((void)0, n__n > 0) do { *d__n++ = *s__n++; } while (--n__n > 0); \
+     LZO_BLOCK_END
+ 
++/* Debian-specific change: we know that our compiler inlines memcpy() with
++ * constant n to be as fast as handwritten code, and knows which architectures
++ * need things correctly aligned. */
++#undef LZO_MEMOPS_COPY1
++#undef LZO_MEMOPS_COPY2
++#undef LZO_MEMOPS_COPY4
++#undef LZO_MEMOPS_COPY8
++#undef LZO_MEMOPS_COPYN
++#define LZO_MEMOPS_COPY1(dd,ss) memcpy(dd, ss, 1)
++#define LZO_MEMOPS_COPY2(dd,ss) memcpy(dd, ss, 2)
++#define LZO_MEMOPS_COPY4(dd,ss) memcpy(dd, ss, 4)
++#define LZO_MEMOPS_COPY8(dd,ss) memcpy(dd, ss, 8)
++#define LZO_MEMOPS_COPYN(dd,ss,nn) memcpy(dd, ss, nn)
++
+ __lzo_static_forceinline lzo_uint16_t lzo_memops_get_le16(const lzo_voidp ss)
+ {
+     lzo_uint16_t v;
diff --git a/meta/recipes-support/lzo/lzo/acinclude.m4 b/meta/recipes-support/lzo/lzo/acinclude.m4
new file mode 100644
index 0000000..c4d2ccd
--- /dev/null
+++ b/meta/recipes-support/lzo/lzo/acinclude.m4
@@ -0,0 +1,358 @@
+
+AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [
+AC_C_BIGENDIAN([AC_DEFINE(ACC_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(ACC_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
+])#
+
+AC_DEFUN([mfx_ACC_CHECK_HEADERS], [
+AC_HEADER_TIME
+AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/stat.h sys/time.h sys/types.h sys/wait.h])
+])#
+
+AC_DEFUN([mfx_ACC_CHECK_FUNCS], [
+AC_CHECK_FUNCS(access alloca atexit atoi atol chmod chown ctime difftime fstat gettimeofday gmtime localtime longjmp lstat memcmp memcpy memmove memset mktime qsort raise setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf)
+])#
+
+
+AC_DEFUN([mfx_ACC_CHECK_SIZEOF], [
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(__int16)
+AC_CHECK_SIZEOF(__int32)
+AC_CHECK_SIZEOF(__int64)
+
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(ptrdiff_t)
+])#
+
+
+# /***********************************************************************
+# // Check for ACC_conformance
+# ************************************************************************/
+
+AC_DEFUN([mfx_ACC_ACCCHK], [
+mfx_tmp=$1
+mfx_save_CPPFLAGS=$CPPFLAGS
+dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#define ACC_CONFIG_NO_HEADER 1
+#include "acc/acc.h"
+#include "acc/acc_incd.h"
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT_HEADER(expr)
+#include "acc/acc_chk.ch"
+#undef ACCCHK_ASSERT
+static void test_acc_compile_time_assert(void) {
+#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT(expr)
+#include "acc/acc_chk.ch"
+#undef ACCCHK_ASSERT
+}
+#undef NDEBUG
+#include <assert.h>
+static int test_acc_run_time_assert(int r) {
+#define ACCCHK_ASSERT(expr)     assert(expr);
+#include "acc/acc_chk.ch"
+#undef ACCCHK_ASSERT
+return r;
+}
+]], [[
+test_acc_compile_time_assert();
+if (test_acc_run_time_assert(1) != 1) return 1;
+]]
+)])
+
+mfx_tmp=FAILED
+_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+AC_MSG_RESULT([$mfx_tmp])
+case x$mfx_tmp in
+  xpassed | xyes) ;;
+  *)
+    AC_MSG_NOTICE([])
+    AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
+    AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
+    AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
+    AC_MSG_NOTICE([Thanks for your support.])
+    AC_MSG_NOTICE([])
+    AC_MSG_ERROR([ACC conformance test failed. Stop.])
+dnl    AS_EXIT
+    ;;
+esac
+])# mfx_ACC_ACCCHK
+
+
+# /***********************************************************************
+# // Check for ACC_conformance
+# ************************************************************************/
+
+AC_DEFUN([mfx_MINIACC_ACCCHK], [
+mfx_tmp=$1
+mfx_save_CPPFLAGS=$CPPFLAGS
+dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#define ACC_CONFIG_NO_HEADER 1
+#define ACC_WANT_ACC_INCD_H 1
+#include $2
+
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT_HEADER(expr)
+#include $2
+
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT(expr)
+static void test_acc_compile_time_assert(void) {
+#include $2
+}
+
+#undef NDEBUG
+#include <assert.h>
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr)  assert(expr);
+static int test_acc_run_time_assert(int r) {
+#include $2
+return r;
+}
+]], [[
+test_acc_compile_time_assert();
+if (test_acc_run_time_assert(1) != 1) return 1;
+]]
+)])
+
+mfx_tmp=FAILED
+_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+AC_MSG_RESULT([$mfx_tmp])
+case x$mfx_tmp in
+  xpassed | xyes) ;;
+  *)
+    AC_MSG_NOTICE([])
+    AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
+    AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
+    AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
+    AC_MSG_NOTICE([Thanks for your support.])
+    AC_MSG_NOTICE([])
+    AC_MSG_ERROR([ACC conformance test failed. Stop.])
+dnl    AS_EXIT
+    ;;
+esac
+])# mfx_MINIACC_ACCCHK
+
+
+
+# serial 1
+
+AC_DEFUN([mfx_PROG_CPPFLAGS], [
+AC_MSG_CHECKING([whether the C preprocessor needs special flags])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#include <limits.h>
+#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
+#  include "your C preprocessor is broken 1"
+#elif (0xffffu == 0xfffffffful)
+#  include "your C preprocessor is broken 2"
+#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX)
+#  include "your C preprocessor is broken 3"
+#endif
+]], [[ ]]
+)])
+
+mfx_save_CPPFLAGS=$CPPFLAGS
+mfx_tmp=ERROR
+for mfx_arg in "" -no-cpp-precomp
+do
+  CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS"
+  _AC_COMPILE_IFELSE([],
+[mfx_tmp=$mfx_arg
+break])
+done
+CPPFLAGS=$mfx_save_CPPFLAGS
+rm -f conftest.$ac_ext conftest.$ac_objext
+case x$mfx_tmp in
+  x)
+    AC_MSG_RESULT([none needed]) ;;
+  xERROR)
+    AC_MSG_RESULT([ERROR])
+    AC_MSG_ERROR([your C preprocessor is broken - for details see config.log])
+    ;;
+  *)
+    AC_MSG_RESULT([$mfx_tmp])
+    CPPFLAGS="$mfx_tmp $CPPFLAGS"
+    ;;
+esac
+])# mfx_PROG_CPPFLAGS
+
+
+
+# serial 3
+
+AC_DEFUN([mfx_CHECK_HEADER_SANE_LIMITS_H], [
+AC_CACHE_CHECK([whether limits.h is sane],
+mfx_cv_header_sane_limits_h,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <limits.h>
+#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
+#  if defined(__APPLE__) && defined(__GNUC__)
+#    error "your preprocessor is broken - use compiler option -no-cpp-precomp"
+#  else
+#    include "your preprocessor is broken"
+#  endif
+#endif
+#define MFX_0xffff          0xffff
+#define MFX_0xffffffffL     4294967295ul
+#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
+#  include "error CHAR_BIT"
+#endif
+#if !defined(UCHAR_MAX)
+#  include "error UCHAR_MAX 1"
+#endif
+#if !defined(USHRT_MAX)
+#  include "error USHRT_MAX 1"
+#endif
+#if !defined(UINT_MAX)
+#  include "error UINT_MAX 1"
+#endif
+#if !defined(ULONG_MAX)
+#  include "error ULONG_MAX 1"
+#endif
+#if !defined(SHRT_MAX)
+#  include "error SHRT_MAX 1"
+#endif
+#if !defined(INT_MAX)
+#  include "error INT_MAX 1"
+#endif
+#if !defined(LONG_MAX)
+#  include "error LONG_MAX 1"
+#endif
+#if (UCHAR_MAX < 1)
+#  include "error UCHAR_MAX 2"
+#endif
+#if (USHRT_MAX < 1)
+#  include "error USHRT_MAX 2"
+#endif
+#if (UINT_MAX < 1)
+#  include "error UINT_MAX 2"
+#endif
+#if (ULONG_MAX < 1)
+#  include "error ULONG_MAX 2"
+#endif
+#if (UCHAR_MAX < 0xff)
+#  include "error UCHAR_MAX 3"
+#endif
+#if (USHRT_MAX < MFX_0xffff)
+#  include "error USHRT_MAX 3"
+#endif
+#if (UINT_MAX < MFX_0xffff)
+#  include "error UINT_MAX 3"
+#endif
+#if (ULONG_MAX < MFX_0xffffffffL)
+#  include "error ULONG_MAX 3"
+#endif
+#if (USHRT_MAX > UINT_MAX)
+#  include "error USHRT_MAX vs UINT_MAX"
+#endif
+#if (UINT_MAX > ULONG_MAX)
+#  include "error UINT_MAX vs ULONG_MAX"
+#endif
+]], [[
+#if (USHRT_MAX == MFX_0xffff)
+{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; }
+#elif (USHRT_MAX >= MFX_0xffff)
+{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; }
+#endif
+#if (UINT_MAX == MFX_0xffff)
+{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; }
+#elif (UINT_MAX >= MFX_0xffff)
+{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; }
+#endif
+#if (ULONG_MAX == MFX_0xffff)
+{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; }
+#elif (ULONG_MAX >= MFX_0xffff)
+{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; }
+#endif
+#if (USHRT_MAX == MFX_0xffffffffL)
+{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; }
+#elif (USHRT_MAX >= MFX_0xffffffffL)
+{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; }
+#endif
+#if (UINT_MAX == MFX_0xffffffffL)
+{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; }
+#elif (UINT_MAX >= MFX_0xffffffffL)
+{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; }
+#endif
+#if (ULONG_MAX == MFX_0xffffffffL)
+{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; }
+#elif (ULONG_MAX >= MFX_0xffffffffL)
+{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; }
+#endif
+]])],
+[mfx_cv_header_sane_limits_h=yes],
+[mfx_cv_header_sane_limits_h=no])])
+])
+
+# /***********************************************************************
+# // standard
+# ************************************************************************/
+
+AC_DEFUN([mfx_LZO_CHECK_ENDIAN], [
+AC_C_BIGENDIAN([AC_DEFINE(LZO_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(LZO_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
+])#
+
+
+# /***********************************************************************
+# //
+# ************************************************************************/
+
+dnl more types which are not yet covered by ACC
+
+AC_DEFUN([mfx_CHECK_SIZEOF], [
+AC_CHECK_SIZEOF(__int32)
+AC_CHECK_SIZEOF(intmax_t)
+AC_CHECK_SIZEOF(uintmax_t)
+AC_CHECK_SIZEOF(intptr_t)
+AC_CHECK_SIZEOF(uintptr_t)
+
+AC_CHECK_SIZEOF(float)
+AC_CHECK_SIZEOF(double)
+AC_CHECK_SIZEOF(long double)
+
+AC_CHECK_SIZEOF(dev_t)
+AC_CHECK_SIZEOF(fpos_t)
+AC_CHECK_SIZEOF(mode_t)
+AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(ssize_t)
+AC_CHECK_SIZEOF(time_t)
+])#
+
+
+
+AC_DEFUN([mfx_CHECK_LIB_WINMM], [
+if test "X$GCC" = Xyes; then
+case $host_os in
+cygwin* | mingw* | pw32*)
+     test "X$LIBS" != "X" && LIBS="$LIBS "
+     LIBS="${LIBS}-lwinmm" ;;
+*)
+     ;;
+esac
+fi
+])#
+
diff --git a/meta/recipes-support/lzo/lzo/run-ptest b/meta/recipes-support/lzo/lzo/run-ptest
new file mode 100644
index 0000000..2ea7745
--- /dev/null
+++ b/meta/recipes-support/lzo/lzo/run-ptest
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+./lzotest -mavail -n10 -q /etc/services
+LZOTEST=./lzotest /bin/sh -e "./check.sh" "/etc"
+./align
+./chksum
+./simple
+./testmini
diff --git a/meta/recipes-support/lzo/lzo_2.09.bb b/meta/recipes-support/lzo/lzo_2.09.bb
new file mode 100644
index 0000000..2978617
--- /dev/null
+++ b/meta/recipes-support/lzo/lzo_2.09.bb
@@ -0,0 +1,35 @@
+SUMMARY = "Lossless data compression library"
+HOMEPAGE = "http://www.oberhumer.com/opensource/lzo/"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://src/lzo_init.c;beginline=5;endline=25;md5=355023835a9b9eeb70ab895395e951ff"
+
+SRC_URI = "http://www.oberhumer.com/opensource/lzo/download/lzo-${PV}.tar.gz \
+           file://0001-Use-memcpy-instead-of-reinventing-it.patch \
+           file://acinclude.m4 \
+           file://run-ptest \
+           "
+
+SRC_URI[md5sum] = "c7ffc9a103afe2d1bba0b015e7aa887f"
+SRC_URI[sha256sum] = "f294a7ced313063c057c504257f437c8335c41bfeed23531ee4e6a2b87bcb34c"
+
+inherit autotools ptest
+
+EXTRA_OECONF = "--enable-shared"
+
+do_configure_prepend () {
+	cp ${WORKDIR}/acinclude.m4 ${S}/
+}
+
+do_install_ptest() {
+	t=${D}${PTEST_PATH}
+	cp ${S}/util/check.sh $t
+	cp ${B}/minilzo/testmini $t
+	for i in tests/align tests/chksum lzotest/lzotest examples/simple
+		do cp ${B}/`dirname $i`/.libs/`basename $i` $t; \
+	done
+}
+
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/lzop/lzop/0001-use-static-inlines-as-the-external-inline-definition.patch b/meta/recipes-support/lzop/lzop/0001-use-static-inlines-as-the-external-inline-definition.patch
new file mode 100644
index 0000000..867b88b
--- /dev/null
+++ b/meta/recipes-support/lzop/lzop/0001-use-static-inlines-as-the-external-inline-definition.patch
@@ -0,0 +1,100 @@
+From ecccbcf66da53779d88e38e2af7f82eff8dde7f8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 16 Aug 2015 10:35:47 -0700
+Subject: [PATCH] use static inlines as the external inline definition has
+ changed with gcc5
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Pending
+
+ src/miniacc.h | 24 ++++++++----------------
+ 1 file changed, 8 insertions(+), 16 deletions(-)
+
+diff --git a/src/miniacc.h b/src/miniacc.h
+index 09e6f0c..cae98d1 100644
+--- a/src/miniacc.h
++++ b/src/miniacc.h
+@@ -2880,8 +2880,7 @@ typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
+ #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+ #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+ #if !defined(ACC_UA_GET_LE16)
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp);
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
++static __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
+     __acc_ua_volatile const acc_uint16e_t* p = (__acc_ua_volatile const acc_uint16e_t*) pp;
+     unsigned long v;
+     __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+@@ -2890,8 +2889,7 @@ extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const
+ #define ACC_UA_GET_LE16(p)      __ACC_UA_GET_LE16(p)
+ #endif
+ #if !defined(ACC_UA_SET_LE16)
+-extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v);
+-extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
++static __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
+     __acc_ua_volatile acc_uint16e_t* p = (__acc_ua_volatile acc_uint16e_t*) pp;
+     __asm__ __volatile__("sthbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+ }
+@@ -2916,8 +2914,7 @@ extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsi
+ #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+ #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+ #if !defined(ACC_UA_GET_LE32)
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp);
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
++static __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
+     __acc_ua_volatile const acc_uint32e_t* p = (__acc_ua_volatile const acc_uint32e_t*) pp;
+     unsigned long v;
+     __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+@@ -2926,8 +2923,7 @@ extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const
+ #define ACC_UA_GET_LE32(p)      __ACC_UA_GET_LE32(p)
+ #endif
+ #if !defined(ACC_UA_SET_LE32)
+-extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v);
+-extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
++static __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
+     __acc_ua_volatile acc_uint32e_t* p = (__acc_ua_volatile acc_uint32e_t*) pp;
+     __asm__ __volatile__("stwbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+ }
+@@ -3307,8 +3303,7 @@ typedef void (__acc_cdecl_sighandler *acc_sighandler_t)(acc_signo_t);
+ #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+ #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+ #if !defined(ACC_UA_GET_LE16)
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp);
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
++static __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const void* pp) {
+     __acc_ua_volatile const acc_uint16e_t* p = (__acc_ua_volatile const acc_uint16e_t*) pp;
+     unsigned long v;
+     __asm__ __volatile__("lhbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+@@ -3317,8 +3312,7 @@ extern __acc_forceinline unsigned long __ACC_UA_GET_LE16(__acc_ua_volatile const
+ #define ACC_UA_GET_LE16(p)      __ACC_UA_GET_LE16(p)
+ #endif
+ #if !defined(ACC_UA_SET_LE16)
+-extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v);
+-extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
++static __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsigned long v) {
+     __acc_ua_volatile acc_uint16e_t* p = (__acc_ua_volatile acc_uint16e_t*) pp;
+     __asm__ __volatile__("sthbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+ }
+@@ -3343,8 +3337,7 @@ extern __acc_forceinline void __ACC_UA_SET_LE16(__acc_ua_volatile void* pp, unsi
+ #if !(ACC_CFG_NO_INLINE_ASM) && (__acc_HAVE_forceinline)
+ #if (ACC_ARCH_POWERPC && ACC_ABI_BIG_ENDIAN) && (ACC_CC_GNUC)
+ #if !defined(ACC_UA_GET_LE32)
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp);
+-extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
++static __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const void* pp) {
+     __acc_ua_volatile const acc_uint32e_t* p = (__acc_ua_volatile const acc_uint32e_t*) pp;
+     unsigned long v;
+     __asm__ __volatile__("lwbrx %0,0,%1" : "=r" (v) : "r" (p), "m" (*p));
+@@ -3353,8 +3346,7 @@ extern __acc_forceinline unsigned long __ACC_UA_GET_LE32(__acc_ua_volatile const
+ #define ACC_UA_GET_LE32(p)      __ACC_UA_GET_LE32(p)
+ #endif
+ #if !defined(ACC_UA_SET_LE32)
+-extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v);
+-extern __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
++static __acc_forceinline void __ACC_UA_SET_LE32(__acc_ua_volatile void* pp, unsigned long v) {
+     __acc_ua_volatile acc_uint32e_t* p = (__acc_ua_volatile acc_uint32e_t*) pp;
+     __asm__ __volatile__("stwbrx %2,0,%1" : "=m" (*p) : "r" (p), "r" (v));
+ }
+-- 
+2.5.0
+
diff --git a/meta/recipes-support/lzop/lzop/acinclude.m4 b/meta/recipes-support/lzop/lzop/acinclude.m4
new file mode 100644
index 0000000..0029c19
--- /dev/null
+++ b/meta/recipes-support/lzop/lzop/acinclude.m4
@@ -0,0 +1,390 @@
+
+AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [
+AC_C_BIGENDIAN([AC_DEFINE(ACC_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(ACC_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
+])#
+
+AC_DEFUN([mfx_ACC_CHECK_HEADERS], [
+AC_HEADER_TIME
+AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h float.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/stat.h sys/time.h sys/types.h sys/wait.h])
+])#
+
+AC_DEFUN([mfx_ACC_CHECK_FUNCS], [
+AC_CHECK_FUNCS(access alloca atexit atoi atol chmod chown ctime difftime fstat gettimeofday gmtime localtime longjmp lstat memcmp memcpy memmove memset mktime qsort raise setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf)
+])#
+
+
+AC_DEFUN([mfx_ACC_CHECK_SIZEOF], [
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+
+AC_CHECK_SIZEOF(long long)
+AC_CHECK_SIZEOF(__int16)
+AC_CHECK_SIZEOF(__int32)
+AC_CHECK_SIZEOF(__int64)
+
+AC_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(size_t)
+AC_CHECK_SIZEOF(ptrdiff_t)
+])#
+
+
+# /***********************************************************************
+# // Check for ACC_conformance
+# ************************************************************************/
+
+AC_DEFUN([mfx_ACC_ACCCHK], [
+mfx_tmp=$1
+mfx_save_CPPFLAGS=$CPPFLAGS
+dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#define ACC_CONFIG_NO_HEADER 1
+#include "acc/acc.h"
+#include "acc/acc_incd.h"
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT_HEADER(expr)
+#include "acc/acc_chk.ch"
+#undef ACCCHK_ASSERT
+static void test_acc_compile_time_assert(void) {
+#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT(expr)
+#include "acc/acc_chk.ch"
+#undef ACCCHK_ASSERT
+}
+#undef NDEBUG
+#include <assert.h>
+static int test_acc_run_time_assert(int r) {
+#define ACCCHK_ASSERT(expr)     assert(expr);
+#include "acc/acc_chk.ch"
+#undef ACCCHK_ASSERT
+return r;
+}
+]], [[
+test_acc_compile_time_assert();
+if (test_acc_run_time_assert(1) != 1) return 1;
+]]
+)])
+
+mfx_tmp=FAILED
+_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+AC_MSG_RESULT([$mfx_tmp])
+case x$mfx_tmp in
+  xpassed | xyes) ;;
+  *)
+    AC_MSG_NOTICE([])
+    AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
+    AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
+    AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
+    AC_MSG_NOTICE([Thanks for your support.])
+    AC_MSG_NOTICE([])
+    AC_MSG_ERROR([ACC conformance test failed. Stop.])
+dnl    AS_EXIT
+    ;;
+esac
+])# mfx_ACC_ACCCHK
+
+
+# /***********************************************************************
+# // Check for ACC_conformance
+# ************************************************************************/
+
+AC_DEFUN([mfx_MINIACC_ACCCHK], [
+mfx_tmp=$1
+mfx_save_CPPFLAGS=$CPPFLAGS
+dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
+test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
+
+AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#define ACC_CONFIG_NO_HEADER 1
+#define ACC_WANT_ACC_INCD_H 1
+#include $2
+
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT_HEADER(expr)
+#include $2
+
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr)     ACC_COMPILE_TIME_ASSERT(expr)
+static void test_acc_compile_time_assert(void) {
+#include $2
+}
+
+#undef NDEBUG
+#include <assert.h>
+#define ACC_WANT_ACC_CHK_CH 1
+#undef ACCCHK_ASSERT
+#define ACCCHK_ASSERT(expr)  assert(expr);
+static int test_acc_run_time_assert(int r) {
+#include $2
+return r;
+}
+]], [[
+test_acc_compile_time_assert();
+if (test_acc_run_time_assert(1) != 1) return 1;
+]]
+)])
+
+mfx_tmp=FAILED
+_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
+rm -f conftest.$ac_ext conftest.$ac_objext
+
+CPPFLAGS=$mfx_save_CPPFLAGS
+
+AC_MSG_RESULT([$mfx_tmp])
+case x$mfx_tmp in
+  xpassed | xyes) ;;
+  *)
+    AC_MSG_NOTICE([])
+    AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
+    AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
+    AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
+    AC_MSG_NOTICE([Thanks for your support.])
+    AC_MSG_NOTICE([])
+    AC_MSG_ERROR([ACC conformance test failed. Stop.])
+dnl    AS_EXIT
+    ;;
+esac
+])# mfx_MINIACC_ACCCHK
+
+
+
+# serial 1
+
+AC_DEFUN([mfx_PROG_CPPFLAGS], [
+AC_MSG_CHECKING([whether the C preprocessor needs special flags])
+
+AC_LANG_CONFTEST([AC_LANG_PROGRAM(
+[[#include <limits.h>
+#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
+#  include "your C preprocessor is broken 1"
+#elif (0xffffu == 0xfffffffful)
+#  include "your C preprocessor is broken 2"
+#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX)
+#  include "your C preprocessor is broken 3"
+#endif
+]], [[ ]]
+)])
+
+mfx_save_CPPFLAGS=$CPPFLAGS
+mfx_tmp=ERROR
+for mfx_arg in "" -no-cpp-precomp
+do
+  CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS"
+  _AC_COMPILE_IFELSE([],
+[mfx_tmp=$mfx_arg
+break])
+done
+CPPFLAGS=$mfx_save_CPPFLAGS
+rm -f conftest.$ac_ext conftest.$ac_objext
+case x$mfx_tmp in
+  x)
+    AC_MSG_RESULT([none needed]) ;;
+  xERROR)
+    AC_MSG_RESULT([ERROR])
+    AC_MSG_ERROR([your C preprocessor is broken - for details see config.log])
+    ;;
+  *)
+    AC_MSG_RESULT([$mfx_tmp])
+    CPPFLAGS="$mfx_tmp $CPPFLAGS"
+    ;;
+esac
+])# mfx_PROG_CPPFLAGS
+
+
+
+# serial 3
+
+AC_DEFUN([mfx_CHECK_HEADER_SANE_LIMITS_H], [
+AC_CACHE_CHECK([whether limits.h is sane],
+mfx_cv_header_sane_limits_h,
+[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <limits.h>
+#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
+#  if defined(__APPLE__) && defined(__GNUC__)
+#    error "your preprocessor is broken - use compiler option -no-cpp-precomp"
+#  else
+#    include "your preprocessor is broken"
+#  endif
+#endif
+#define MFX_0xffff          0xffff
+#define MFX_0xffffffffL     4294967295ul
+#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
+#  include "error CHAR_BIT"
+#endif
+#if !defined(UCHAR_MAX)
+#  include "error UCHAR_MAX 1"
+#endif
+#if !defined(USHRT_MAX)
+#  include "error USHRT_MAX 1"
+#endif
+#if !defined(UINT_MAX)
+#  include "error UINT_MAX 1"
+#endif
+#if !defined(ULONG_MAX)
+#  include "error ULONG_MAX 1"
+#endif
+#if !defined(SHRT_MAX)
+#  include "error SHRT_MAX 1"
+#endif
+#if !defined(INT_MAX)
+#  include "error INT_MAX 1"
+#endif
+#if !defined(LONG_MAX)
+#  include "error LONG_MAX 1"
+#endif
+#if (UCHAR_MAX < 1)
+#  include "error UCHAR_MAX 2"
+#endif
+#if (USHRT_MAX < 1)
+#  include "error USHRT_MAX 2"
+#endif
+#if (UINT_MAX < 1)
+#  include "error UINT_MAX 2"
+#endif
+#if (ULONG_MAX < 1)
+#  include "error ULONG_MAX 2"
+#endif
+#if (UCHAR_MAX < 0xff)
+#  include "error UCHAR_MAX 3"
+#endif
+#if (USHRT_MAX < MFX_0xffff)
+#  include "error USHRT_MAX 3"
+#endif
+#if (UINT_MAX < MFX_0xffff)
+#  include "error UINT_MAX 3"
+#endif
+#if (ULONG_MAX < MFX_0xffffffffL)
+#  include "error ULONG_MAX 3"
+#endif
+#if (USHRT_MAX > UINT_MAX)
+#  include "error USHRT_MAX vs UINT_MAX"
+#endif
+#if (UINT_MAX > ULONG_MAX)
+#  include "error UINT_MAX vs ULONG_MAX"
+#endif
+]], [[
+#if (USHRT_MAX == MFX_0xffff)
+{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; }
+#elif (USHRT_MAX >= MFX_0xffff)
+{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; }
+#endif
+#if (UINT_MAX == MFX_0xffff)
+{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; }
+#elif (UINT_MAX >= MFX_0xffff)
+{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; }
+#endif
+#if (ULONG_MAX == MFX_0xffff)
+{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; }
+#elif (ULONG_MAX >= MFX_0xffff)
+{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; }
+#endif
+#if (USHRT_MAX == MFX_0xffffffffL)
+{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; }
+#elif (USHRT_MAX >= MFX_0xffffffffL)
+{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; }
+#endif
+#if (UINT_MAX == MFX_0xffffffffL)
+{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; }
+#elif (UINT_MAX >= MFX_0xffffffffL)
+{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; }
+#endif
+#if (ULONG_MAX == MFX_0xffffffffL)
+{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; }
+#elif (ULONG_MAX >= MFX_0xffffffffL)
+{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; }
+#endif
+]])],
+[mfx_cv_header_sane_limits_h=yes],
+[mfx_cv_header_sane_limits_h=no])])
+])
+
+# /***********************************************************************
+# // standard
+# ************************************************************************/
+
+AC_DEFUN([mfx_LZO_CHECK_ENDIAN], [
+AC_C_BIGENDIAN([AC_DEFINE(LZO_ABI_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(LZO_ABI_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
+])#
+
+
+# /***********************************************************************
+# //
+# ************************************************************************/
+
+dnl more types which are not yet covered by ACC
+
+AC_DEFUN([mfx_CHECK_SIZEOF], [
+AC_CHECK_SIZEOF(__int32)
+AC_CHECK_SIZEOF(intmax_t)
+AC_CHECK_SIZEOF(uintmax_t)
+AC_CHECK_SIZEOF(intptr_t)
+AC_CHECK_SIZEOF(uintptr_t)
+
+AC_CHECK_SIZEOF(float)
+AC_CHECK_SIZEOF(double)
+AC_CHECK_SIZEOF(long double)
+
+AC_CHECK_SIZEOF(dev_t)
+AC_CHECK_SIZEOF(fpos_t)
+AC_CHECK_SIZEOF(mode_t)
+AC_CHECK_SIZEOF(off_t)
+AC_CHECK_SIZEOF(ssize_t)
+AC_CHECK_SIZEOF(time_t)
+])#
+
+
+
+AC_DEFUN([mfx_CHECK_LIB_WINMM], [
+if test "X$GCC" = Xyes; then
+case $host_os in
+cygwin* | mingw* | pw32*)
+     test "X$LIBS" != "X" && LIBS="$LIBS "
+     LIBS="${LIBS}-lwinmm" ;;
+*)
+     ;;
+esac
+fi
+])#
+
+#serial 6
+
+dnl From Paul Eggert.
+
+# Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
+# if it exists.
+
+AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
+ [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
+   ac_cv_struct_st_mtim_nsec,
+   [ac_save_CPPFLAGS="$CPPFLAGS"
+    ac_cv_struct_st_mtim_nsec=no
+    # tv_nsec -- the usual case
+    # _tv_nsec -- Solaris 2.6, if
+    #	(defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
+    #	 && !defined __EXTENSIONS__)
+    # st__tim.tv_nsec -- UnixWare 2.1.2
+    for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
+      CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
+      AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
+        [ac_cv_struct_st_mtim_nsec=$ac_val; break])
+    done
+    CPPFLAGS="$ac_save_CPPFLAGS"])
+
+  if test $ac_cv_struct_st_mtim_nsec != no; then
+    AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
+      [Define to be the nanoseconds member of struct stat's st_mtim,
+       if it exists.])
+  fi
+ ]
+)
diff --git a/meta/recipes-support/lzop/lzop/x32_abi_miniacc_h.patch b/meta/recipes-support/lzop/lzop/x32_abi_miniacc_h.patch
new file mode 100644
index 0000000..739be82
--- /dev/null
+++ b/meta/recipes-support/lzop/lzop/x32_abi_miniacc_h.patch
@@ -0,0 +1,36 @@
+Fix get of FLAGS register in x32 ABI,
+
+x32 ABI requires to have 64-bit variable to store FLAGS register
+instead of size_t that is 32-bit variable, this fix operand
+type mismatch when try to pop previous pushf value.
+
+Upstream-Status: Submitted
+
+Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
+
+Index: lzop-1.03/src/miniacc.h
+===================================================================
+--- lzop-1.03.orig/src/miniacc.h
++++ lzop-1.03/src/miniacc.h
+@@ -754,6 +754,9 @@
+ #elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64)
+ #  define ACC_ARCH_AMD64            1
+ #  define ACC_INFO_ARCH             "amd64"
++#  if defined(__ILP32__)
++#    define ACC_ARCH_AMD64_X32      1
++#  endif
+ #elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB))
+ #  define ACC_ARCH_ARM              1
+ #  define ACC_ARCH_ARM_THUMB        1
+@@ -6787,7 +6790,11 @@ ACCLIB_PUBLIC_NOINLINE(void, acc_debug_n
+ ACCLIB_PUBLIC_NOINLINE(int, acc_debug_align_check_query) (void)
+ {
+ #if (ACC_ARCH_AMD64 || ACC_ARCH_I386) && (ACC_ASM_SYNTAX_GNUC)
++#  if defined(ACC_ARCH_AMD64_X32)
++    unsigned long long r;
++#  else
+     size_t r;
++#  endif
+     __asm__ __volatile__("pushf\n pop %0\n" : "=a" (r) : : __ACC_ASM_CLOBBER);
+     return (int)(r >> 18) & 1;
+ #elif (ACC_ARCH_I386) && (ACC_ASM_SYNTAX_MSC)
diff --git a/meta/recipes-support/lzop/lzop_1.03.bb b/meta/recipes-support/lzop/lzop_1.03.bb
new file mode 100644
index 0000000..07d6289
--- /dev/null
+++ b/meta/recipes-support/lzop/lzop_1.03.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Real-time file compressor"
+DESCRIPTION = "lzop is a compression utility which is designed to be a companion to gzip. \n\
+It is based on the LZO data compression library and its main advantages over \n\
+gzip are much higher compression and decompression speed at the cost of some \n\
+compression ratio. The lzop compression utility was designed with the goals \n\
+of reliability, speed, portability and with reasonable drop-in compatibility \n\
+to gzip."
+DEPENDS += "lzo"
+
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=dfeaf3dc4beef4f5a7bdbc35b197f39e \
+                    file://src/lzop.c;beginline=5;endline=21;md5=6797bd3ed0a1a49327b7ebf9366ebd86"
+
+SRC_URI = "http://www.lzop.org/download/${BP}.tar.gz \
+           file://acinclude.m4 \
+           file://x32_abi_miniacc_h.patch \
+           file://0001-use-static-inlines-as-the-external-inline-definition.patch \
+          "
+SRC_URI[md5sum] = "006c5e27fb78cdd14a628fdfa5aa1905"
+SRC_URI[sha256sum] = "c1425b8c77d49f5a679d5a126c90ea6ad99585a55e335a613cae59e909dbb2c9"
+
+inherit autotools
+
+do_configure () {
+    ln -sf  ../acinclude.m4 ${S}/acinclude.m4
+    autotools_do_configure
+}
+
+BBCLASSEXTEND += "native nativesdk"
diff --git a/meta/recipes-support/mpfr/mpfr-3.1.3/long-long-thumb.patch b/meta/recipes-support/mpfr/mpfr-3.1.3/long-long-thumb.patch
new file mode 100644
index 0000000..ca7100e
--- /dev/null
+++ b/meta/recipes-support/mpfr/mpfr-3.1.3/long-long-thumb.patch
@@ -0,0 +1,39 @@
+From 84021b1e236508169be65e802a9c0a25fc9a8827 Mon Sep 17 00:00:00 2001
+From: Phil Blundell <philb@gnu.org>
+Date: Mon, 27 Oct 2008 22:26:35 +0000
+Subject: [PATCH] mpfr: crusade against inline assembler
+
+Without this, build fails for thumb:
+| {standard input}: Assembler messages:
+| {standard input}:199: Error: selected processor does not support Thumb mode `umull sl,r0,r2,r1'
+| {standard input}:214: Error: selected processor does not support Thumb mode `umull sl,r2,r1,fp'
+| {standard input}:219: Error: instruction not supported in Thumb16 mode -- `adds fp,r0,sl'
+| {standard input}:220: Error: unshifted register required -- `adc r2,r2,#0'
+| {standard input}:235: Error: selected processor does not support Thumb mode `umull r0,sl,r1,r3'
+| {standard input}:244: Error: selected processor does not support Thumb mode `umull fp,ip,r1,r3'
+| {standard input}:253: Error: instruction not supported in Thumb16 mode -- `adds r3,sl,fp'
+| {standard input}:254: Error: unshifted register required -- `adc ip,ip,#0'
+| {standard input}:259: Error: instruction not supported in Thumb16 mode -- `adds sl,r1,r0'
+| {standard input}:642: Error: selected processor does not support Thumb mode `umull r0,r2,r3,r1'
+| ../arm-oe-linux-gnueabi-libtool --tag=CC   --mode=compile arm-oe-linux-gnueabi-gcc  -march=armv5te  -mthumb -mthumb-interwork  -mtune=xscale --sysroot=/OE/shr-core/tmp-eglibc/sysroots/spitz -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_LOCALE_H=1 -DHAVE_WCHAR_H=1 -DHAVE_STDARG=1 -DHAVE_SYS_TIME_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_STDINT_H=1 -DHAVE_VA_COPY=1 -DHAVE_SETLOCALE=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_LONG_LONG=1 -DHAVE_INTMAX_T=1 -DMPFR_HAVE_INTMAX_MAX=1 -DMPFR_HAVE_FESETROUND=1 -DHAVE_ROUND=1 -DHAVE_TRUNC=1 -DHAVE_FLOOR=1 -DHAVE_CEIL=1 -DHAVE_NEARBYINT=1 -DLT_OBJDIR=\".libs/\" -DHAVE_ATTRIBUTE_MODE=1 -DHAVE___GMPN_ROOTREM=1 -DHAVE___GMPN_SBPI1_DIVAPPR_Q=1 -I.     -O2 -pipe -g -feliminate-unused-debug-types -ffloat-store -c -o pow.lo pow.c
+| {standard input}:1154: Error: selected processor does not support Thumb mode `umull r0,r1,sl,ip'
+| {standard input}:1166: Error: selected processor does not support Thumb mode `umull r3,r2,ip,r0'
+| {standard input}:1171: Error: instruction not supported in Thumb16 mode -- `adds r0,r1,r3'
+| {standard input}:1172: Error: unshifted register required -- `adc r2,r2,#0'
+| make[2]: *** [mul.lo] Error 1
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+
+Upstream-Status: Pending
+
+--- mpfr.old/src/mpfr-longlong.h	2008-01-01 03:29:09.000000000 +0000
++++ mpfr/src/mpfr-longlong.h	2008-10-27 21:46:44.000000000 +0000
+@@ -406,7 +406,7 @@
+ 	     "rIJ" ((USItype) (bl)))
+ #endif
+ 
+-#if defined (__arm__) && W_TYPE_SIZE == 32
++#if defined (__arm__) && W_TYPE_SIZE == 32 && !defined(__thumb__)
+ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+   __asm__ ("adds\t%1, %4, %5\n\tadc\t%0, %2, %3"			\
+ 	   : "=r" (sh), "=&r" (sl)					\
diff --git a/meta/recipes-support/mpfr/mpfr.inc b/meta/recipes-support/mpfr/mpfr.inc
new file mode 100644
index 0000000..7f3f917
--- /dev/null
+++ b/meta/recipes-support/mpfr/mpfr.inc
@@ -0,0 +1,6 @@
+SUMMARY = "C library for multiple-precision floating-point computations with exact rounding"
+HOMEPAGE = "http://www.mpfr.org/"
+LICENSE = "LGPLv3+"
+SECTION = "devel"
+
+inherit autotools texinfo
diff --git a/meta/recipes-support/mpfr/mpfr_3.1.3.bb b/meta/recipes-support/mpfr/mpfr_3.1.3.bb
new file mode 100644
index 0000000..af19b54
--- /dev/null
+++ b/meta/recipes-support/mpfr/mpfr_3.1.3.bb
@@ -0,0 +1,17 @@
+require mpfr.inc
+
+LICENSE = "GPLv3 & LGPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
+		    file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6"
+DEPENDS = "gmp"
+
+SRC_URI = "http://www.mpfr.org/mpfr-${PV}/mpfr-${PV}.tar.xz \
+           file://long-long-thumb.patch \
+           "
+
+SRC_URI[md5sum] = "6969398cd2fbc56a6af570b5273c56a9"
+SRC_URI[sha256sum] = "6835a08bd992c8257641791e9a6a2b35b02336c8de26d0a8577953747e514a16"
+
+S = "${WORKDIR}/mpfr-${PV}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/neon/neon/gnutls_4.3_fixup.patch b/meta/recipes-support/neon/neon/gnutls_4.3_fixup.patch
new file mode 100644
index 0000000..459f5e3
--- /dev/null
+++ b/meta/recipes-support/neon/neon/gnutls_4.3_fixup.patch
@@ -0,0 +1,68 @@
+replace deprecated GnuTLS functions with newer ones if available 
+
+Upstream-Status: Pending
+
+Signed-off-by: Armin Kuster <akuster808@gmail.com>
+
+Index: neon-0.30.1/macros/neon.m4
+===================================================================
+--- neon-0.30.1.orig/macros/neon.m4
++++ neon-0.30.1/macros/neon.m4
+@@ -987,6 +987,10 @@ gnutls)
+                   gnutls_certificate_get_x509_cas \
+                   gnutls_x509_crt_sign2])
+ 
++   # gnutls 4.3 check
++   AC_CHECK_LIB(gnutls, gnutls_global_init)
++   AC_CHECK_FUNCS(gnutls_certificate_set_retrieve_function,,)
++
+    # fail if gnutls_x509_crt_sign2 is not found (it was introduced in 1.2.0, which is required)
+    if test x${ac_cv_func_gnutls_x509_crt_sign2} != xyes; then
+        AC_MSG_ERROR([GnuTLS version predates gnutls_x509_crt_sign2, newer version required (at least 1.2.0)])
+Index: neon-0.30.1/src/ne_gnutls.c
+===================================================================
+--- neon-0.30.1.orig/src/ne_gnutls.c
++++ neon-0.30.1/src/ne_gnutls.c
+@@ -553,7 +553,13 @@ dup_error:
+ static int provide_client_cert(gnutls_session_t session,
+                                const gnutls_datum_t *req_ca_rdn, int nreqs,
+                                const gnutls_pk_algorithm_t *sign_algos,
+-                               int sign_algos_length, gnutls_retr_st *st)
++                               int sign_algos_length,
++#if HAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION
++    gnutls_retr2_st* st
++#else
++    gnutls_retr_st *st
++#endif
++    )
+ {
+     ne_session *sess = gnutls_session_get_ptr(session);
+     
+@@ -617,8 +623,11 @@ static int provide_client_cert(gnutls_se
+ #endif
+             ) {
+             NE_DEBUG(NE_DBG_SSL, "Supplying client certificate.\n");
+-
++#if HAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION
++            st->cert_type = type;
++#else
+             st->type = type;
++#endif
+             st->ncerts = 1;
+             st->cert.x509 = &sess->client_cert->cert.subject;
+             st->key.x509 = sess->client_cert->pkey;
+@@ -649,8 +658,14 @@ ne_ssl_context *ne_ssl_context_create(in
+     ne_ssl_context *ctx = ne_calloc(sizeof *ctx);
+     gnutls_certificate_allocate_credentials(&ctx->cred);
+     if (flags == NE_SSL_CTX_CLIENT) {
++
++#if HAVE_GNUTLS_CERTIFICATE_SET_RETRIEVE_FUNCTION
++        gnutls_certificate_set_retrieve_function(ctx->cred,
++                                                       provide_client_cert);
++#else
+         gnutls_certificate_client_set_retrieve_function(ctx->cred,
+                                                         provide_client_cert);
++#endif
+     }
+     gnutls_certificate_set_verify_flags(ctx->cred, 
+                                         GNUTLS_VERIFY_ALLOW_X509_V1_CA_CRT);
diff --git a/meta/recipes-support/neon/neon/pkgconfig.patch b/meta/recipes-support/neon/neon/pkgconfig.patch
new file mode 100644
index 0000000..239dba8
--- /dev/null
+++ b/meta/recipes-support/neon/neon/pkgconfig.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Inappropriate [configuration]
+
+---
+ neon.pc.in |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- neon-0.30.1.orig/neon.pc.in
++++ neon-0.30.1/neon.pc.in
+@@ -7,5 +7,5 @@ Name: neon
+ Description: HTTP/WebDAV client library
+ Version: @NEON_VERSION@
+ Libs: -L${libdir} -lneon @NEON_PC_LIBS@
+-Libs.private: @NEON_LIBS@
++Libs.private: -L${libdir} -lz -lgcrypt -lgpg-error -lexpat -lgnutls
+ Cflags: -I${includedir}/neon @NEON_CFLAGS@
diff --git a/meta/recipes-support/neon/neon_0.30.1.bb b/meta/recipes-support/neon/neon_0.30.1.bb
new file mode 100644
index 0000000..0244314
--- /dev/null
+++ b/meta/recipes-support/neon/neon_0.30.1.bb
@@ -0,0 +1,27 @@
+SUMMARY = "An HTTP and WebDAV client library with a C interface"
+HOMEPAGE = "http://www.webdav.org/neon/"
+SECTION = "libs"
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://src/COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a \
+                    file://src/ne_utils.h;beginline=1;endline=20;md5=2caca609538eddaa6f6adf120a218037"
+DEPENDS = "zlib libxml2 expat time gnutls libproxy"
+DEPENDS_class-native = "zlib-native libxml2-native expat-native gnutls-native"
+
+BBCLASSEXTEND = "native"
+
+SRC_URI = "http://www.webdav.org/${BPN}/${BPN}-${PV}.tar.gz \
+           file://pkgconfig.patch \
+           file://gnutls_4.3_fixup.patch"
+SRC_URI[md5sum] = "231adebe5c2f78fded3e3df6e958878e"
+SRC_URI[sha256sum] = "00c626c0dc18d094ab374dbd9a354915bfe4776433289386ed489c2ec0845cdd"
+
+BINCONFIG = "${bindir}/neon-config"
+
+inherit autotools binconfig-disabled lib_package pkgconfig
+
+EXTRA_OECONF = "--with-ssl=gnutls --with-libxml2 --with-expat --enable-shared"
+EXTRA_OECONF += "--without-gssapi"
+
+do_compile_append() {
+	oe_runmake -C test
+}
diff --git a/meta/recipes-support/nettle/files/Add-target-to-only-build-tests-not-run-them.patch b/meta/recipes-support/nettle/files/Add-target-to-only-build-tests-not-run-them.patch
new file mode 100644
index 0000000..23da777
--- /dev/null
+++ b/meta/recipes-support/nettle/files/Add-target-to-only-build-tests-not-run-them.patch
@@ -0,0 +1,46 @@
+From 46edf01cc98db9f9feec984897836dfdd26bdc8d Mon Sep 17 00:00:00 2001
+From: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Date: Wed, 12 Aug 2015 23:27:27 +0300
+Subject: [PATCH] Add target to only build tests (not run them)
+
+Not sending upstream as this is only a start of a solution to
+installable tests: It's useful for us already as is.
+
+Upstream-Status: Inappropriate [not a complete solution]
+
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+---
+ Makefile.in           | 3 +++
+ testsuite/Makefile.in | 2 ++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/Makefile.in b/Makefile.in
+index 08efb7d..7909342 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -55,6 +55,9 @@ clean distclean mostlyclean maintainer-clean tags:
+ 	  echo "Making $@ in $$d" ; (cd $$d && $(MAKE) $@); done
+ 	$(MAKE) $@-here
+ 
++buildtest:
++	echo "Making $@ in testsuite" ; (cd testsuite && $(MAKE) $@)
++
+ check-here:
+ 	true
+ 
+diff --git a/testsuite/Makefile.in b/testsuite/Makefile.in
+index 6bc1907..bb65bf0 100644
+--- a/testsuite/Makefile.in
++++ b/testsuite/Makefile.in
+@@ -116,6 +116,8 @@ $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) ../nettle-internal.$(OBJEXT) \
+ # data.
+ VALGRIND = valgrind --error-exitcode=1 --leak-check=full --show-reachable=yes @IF_ASM@ --partial-loads-ok=yes
+ 
++buildtest: $(TS_ALL)
++
+ # The PATH update is for locating dlls on w*ndows.
+ check: $(TS_ALL)
+ 	LD_LIBRARY_PATH=../.lib PATH="../.lib:$$PATH" srcdir="$(srcdir)" \
+-- 
+2.1.4
+
diff --git a/meta/recipes-support/nettle/files/run-ptest b/meta/recipes-support/nettle/files/run-ptest
new file mode 100644
index 0000000..b90bed6
--- /dev/null
+++ b/meta/recipes-support/nettle/files/run-ptest
@@ -0,0 +1,36 @@
+#! /bin/sh
+
+cd testsuite
+
+failed=0
+all=0
+
+for f in *-test; do
+    if [ "$f" = "sha1-huge-test" ] ; then
+        echo "SKIP: $f (skipped for ludicrous run time)"
+        continue
+    fi
+
+    "./$f"
+    case "$?" in
+        0)
+            echo "PASS: $f"
+            all=$((all + 1))
+            ;;
+        77)
+            echo "SKIP: $f"
+            ;;
+        *)
+            echo "FAIL: $f"
+            failed=$((failed + 1))
+            all=$((all + 1))
+            ;;
+    esac
+done
+
+if [ "$failed" -eq 0 ] ; then
+  echo "All $all tests passed"
+else
+  echo "$failed of $all tests failed"
+fi
+
diff --git a/meta/recipes-support/nettle/nettle.inc b/meta/recipes-support/nettle/nettle.inc
new file mode 100644
index 0000000..fafff6d
--- /dev/null
+++ b/meta/recipes-support/nettle/nettle.inc
@@ -0,0 +1,43 @@
+SUMMARY = "A low level cryptographic library"
+HOMEPAGE = "http://www.lysator.liu.se/~nisse/nettle/"
+SECTION = "libs"
+
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://serpent-decrypt.c;beginline=53;endline=67;md5=bcfd4745d53ca57f82907089898e390d \
+                    file://serpent-set-key.c;beginline=56;endline=70;md5=bcfd4745d53ca57f82907089898e390d"
+
+DEPENDS += "gmp"
+
+SRC_URI = "http://www.lysator.liu.se/~nisse/archive/${BP}.tar.gz \
+           file://Add-target-to-only-build-tests-not-run-them.patch \
+           file://run-ptest \
+           "
+
+SRC_URI[md5sum] = "003d5147911317931dd453520eb234a5"
+SRC_URI[sha256sum] = "bc71ebd43435537d767799e414fce88e521b7278d48c860651216e1fc6555b40"
+
+EXTRA_OECONF = "--disable-openssl"
+
+inherit autotools ptest
+
+do_configure_prepend() {
+       if [ ! -e ${S}/acinclude.m4 -a -e ${S}/aclocal.m4 ]; then
+               cp ${S}/aclocal.m4 ${S}/acinclude.m4
+       fi
+}
+
+do_compile_ptest() {
+        oe_runmake buildtest
+}
+
+do_install_ptest() {
+        install -d ${D}${PTEST_PATH}/testsuite/
+        install ${S}/testsuite/gold-bug.txt ${D}${PTEST_PATH}/testsuite/
+        install ${S}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/
+        # tools can be found in PATH, not in ../tools/
+        sed -i -e 's|../tools/||' ${D}${PTEST_PATH}/testsuite/*-test
+        install ${B}/testsuite/*-test ${D}${PTEST_PATH}/testsuite/
+}
+
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/nettle/nettle_2.7.1.bb b/meta/recipes-support/nettle/nettle_2.7.1.bb
new file mode 100644
index 0000000..ae2574a
--- /dev/null
+++ b/meta/recipes-support/nettle/nettle_2.7.1.bb
@@ -0,0 +1,12 @@
+require nettle.inc
+
+LICENSE = "LGPLv2.1 & GPLv2"
+LICENSE_${PN} = "LGPLv2.1+"
+
+LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=2d5025d4aa3495befef8f17206a5b0a1 \
+                    file://serpent-decrypt.c;beginline=53;endline=67;md5=bcfd4745d53ca57f82907089898e390d \
+                    file://serpent-set-key.c;beginline=56;endline=70;md5=bcfd4745d53ca57f82907089898e390d"
+
+SRC_URI[md5sum] = "003d5147911317931dd453520eb234a5"
+SRC_URI[sha256sum] = "bc71ebd43435537d767799e414fce88e521b7278d48c860651216e1fc6555b40"
+
diff --git a/meta/recipes-support/nettle/nettle_3.1.1.bb b/meta/recipes-support/nettle/nettle_3.1.1.bb
new file mode 100644
index 0000000..7d7134f
--- /dev/null
+++ b/meta/recipes-support/nettle/nettle_3.1.1.bb
@@ -0,0 +1,11 @@
+require nettle.inc
+
+LICENSE = "LGPLv3+ | GPLv2+"
+
+LIC_FILES_CHKSUM = "file://COPYING.LESSERv3;md5=6a6a8e020838b23406c81b19c1d46df6 \
+                    file://COPYINGv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
+                    file://serpent-decrypt.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e \
+                    file://serpent-set-key.c;beginline=14;endline=36;md5=ca0d220bc413e1842ecc507690ce416e"
+
+SRC_URI[md5sum] = "b40fa88dc32f37a182b6b42092ebb144"
+SRC_URI[sha256sum] = "5fd4d25d64d8ddcb85d0d897572af73b05b4d163c6cc49438a5bfbb8ff293d4c"
diff --git a/meta/recipes-support/npth/npth/pkgconfig.patch b/meta/recipes-support/npth/npth/pkgconfig.patch
new file mode 100644
index 0000000..b6a12e7
--- /dev/null
+++ b/meta/recipes-support/npth/npth/pkgconfig.patch
@@ -0,0 +1,49 @@
+Added npth pkgconfig file
+
+Upstream-Status: Pending
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: npth-1.1/src/npth.pc.in
+===================================================================
+--- /dev/null
++++ npth-1.1/src/npth.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: npth
++Description: a new portable posix threading library
++Version: @VERSION@
++Libs: -L${libdir} -lnpth -lpthread
++Cflags: -I${includedir}
+Index: npth-1.1/src/Makefile.am
+===================================================================
+--- npth-1.1.orig/src/Makefile.am
++++ npth-1.1/src/Makefile.am
+@@ -27,8 +27,10 @@
+ # License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ 
+ ## Process this file with automake to produce Makefile.in
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = npth.pc
+ 
+-EXTRA_DIST = libnpth.vers
++EXTRA_DIST = libnpth.vers npth.pc
+ #	     versioninfo.rc.in
+ nodist_include_HEADERS = npth.h
+ 
+Index: npth-1.1/configure.ac
+===================================================================
+--- npth-1.1.orig/configure.ac
++++ npth-1.1/configure.ac
+@@ -337,6 +337,7 @@ src/Makefile
+ w32/Makefile
+ tests/Makefile])
+ AC_CONFIG_FILES(npth-config, chmod +x npth-config)
++AC_CONFIG_FILES([src/npth.pc])
+ AC_OUTPUT
+ 
+ echo "
diff --git a/meta/recipes-support/npth/npth_1.2.bb b/meta/recipes-support/npth/npth_1.2.bb
new file mode 100644
index 0000000..1b3962e
--- /dev/null
+++ b/meta/recipes-support/npth/npth_1.2.bb
@@ -0,0 +1,21 @@
+SUMMARY = "New GNU Portable Threads library"
+HOMEPAGE = "http://www.gnupg.org/software/pth/"
+SECTION = "libs"
+LICENSE = "LGPLv3+ & GPLv2+"
+LIC_FILES_CHKSUM = "\
+    file://COPYING;md5=751419260aa954499f7abaabaa882bbe\
+    file://COPYING.LESSER;md5=6a6a8e020838b23406c81b19c1d46df6\
+    "
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/npth/npth-${PV}.tar.bz2 \
+           file://pkgconfig.patch \
+          "
+
+SRC_URI[md5sum] = "226bac7374b9466c6ec26b1c34dab844"
+SRC_URI[sha256sum] = "6ddbdddb2cf49a4723f9d1ad6563c480d6760dcb63cb7726b8fc3bc2e1b6c08a"
+
+BINCONFIG = "${bindir}/npth-config"
+
+inherit autotools binconfig-disabled
+
+FILES_${PN} = "${libdir}/libnpth.so.*"
+FILES_${PN}-dev += "${bindir}/npth-config"
diff --git a/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch b/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch
new file mode 100644
index 0000000..c2b7258
--- /dev/null
+++ b/meta/recipes-support/nspr/nspr/fix-build-on-x86_64.patch
@@ -0,0 +1,52 @@
+Fix build failure on x86_64
+
+When the target_cpu is x86_64, we should assume that the pkg uses 64bit,
+only if USE_N32 is set, we can assume that the pkg uses 32bit. It used a
+opposite logic before.
+
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+
+Upstream-Status: Pending
+---
+ configure.in |   12 ++++++------
+ 1 files changed, 6 insertions(+), 6 deletions(-)
+
+Index: nspr/configure.in
+===================================================================
+--- nspr.orig/configure.in
++++ nspr/configure.in
+@@ -1875,28 +1875,24 @@ tools are selected during the Xcode/Deve
+         PR_MD_ASFILES=os_Linux_ia64.s
+         ;;
+     x86_64)
+-        if test -n "$USE_64"; then
+-            PR_MD_ASFILES=os_Linux_x86_64.s
+-        elif test -n "$USE_X32"; then
++        if test -n "$USE_X32"; then
++            AC_DEFINE(i386)
+             PR_MD_ASFILES=os_Linux_x86_64.s
+             CC="$CC -mx32"
+             CXX="$CXX -mx32"
+         else
+-            AC_DEFINE(i386)
+-            PR_MD_ASFILES=os_Linux_x86.s
+-            CC="$CC -m32"
+-            CXX="$CXX -m32"
++            PR_MD_ASFILES=os_Linux_x86_64.s
+         fi
+         ;;
+     ppc|powerpc)
+         PR_MD_ASFILES=os_Linux_ppc.s
+         ;;
+     powerpc64)
+-        if test -n "$USE_64"; then
++        if test -n "$USE_N32"; then
++            PR_MD_ASFILES=os_Linux_ppc.s
++        else
+             CC="$CC -m64"
+             CXX="$CXX -m64"
+-        else
+-            PR_MD_ASFILES=os_Linux_ppc.s
+         fi
+         ;;
+     m68k)
diff --git a/meta/recipes-support/nspr/nspr/nspr.pc.in b/meta/recipes-support/nspr/nspr/nspr.pc.in
new file mode 100644
index 0000000..c37d0bc
--- /dev/null
+++ b/meta/recipes-support/nspr/nspr/nspr.pc.in
@@ -0,0 +1,11 @@
+os_libs=-lpthread -ldl
+prefix=OEPREFIX
+exec_prefix=OEEXECPREFIX
+libdir=OELIBDIR
+includedir=OEINCDIR
+
+Name: NSPR
+Description: The Netscape Portable Runtime
+Version: 4.9.5
+Libs: -L${libdir} -lplds4 -lplc4 -lnspr4 -lpthread -ldl
+Cflags:
diff --git a/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch b/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch
new file mode 100644
index 0000000..a7e7853
--- /dev/null
+++ b/meta/recipes-support/nspr/nspr/remove-rpath-from-tests.patch
@@ -0,0 +1,26 @@
+Author: Andrei Gherzan <andrei@gherzan.ro>
+Date:   Thu Feb 9 00:03:38 2012 +0200
+
+Avoid QA warnings by removing hardcoded rpath from binaries.
+
+[...]
+WARNING: QA Issue: package nspr contains bad RPATH {builddir}/tmp/work/armv5te-poky-linux-gnueabi/nspr-4.8.9-r1/nspr-4.8.9/mozilla/nsprpub/pr/tests/../../dist/lib
+in file {builddir}/tmp/work/armv5te-poky-linux-gnueabi/nspr-4.8.9-r1/packages-split/nspr/usr/lib/nspr/tests/multiwait
+[...]
+
+Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
+Upstream-Status: Pending
+
+Index: nspr-4.8.9/mozilla/nsprpub/pr/tests/Makefile.in
+===================================================================
+--- nsprpub.orig/pr/tests/Makefile.in	2012-02-11 00:01:10.476220505 +0200
++++ nsprpub/pr/tests/Makefile.in	2012-02-10 23:57:40.000000000 +0200
+@@ -379,7 +379,7 @@
+ endif
+ 
+ ifeq (,$(filter-out Linux GNU GNU_%,$(OS_ARCH)))
+-    LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
++    LDOPTS += -Xlinker
+     ifeq ($(USE_PTHREADS),1)
+         EXTRA_LIBS = -lpthread
+     endif
diff --git a/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch b/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch
new file mode 100644
index 0000000..bde715c
--- /dev/null
+++ b/meta/recipes-support/nspr/nspr/remove-srcdir-from-configure-in.patch
@@ -0,0 +1,19 @@
+the $srcdir is not defined at the time of gnu-configurize.
+
+Upstream-Status: Inappropriate [OE-Core specific]
+
+Signed-off-by: Saul Wold <sgw@linux.intel.com>
+
+Index: nspr/configure.in
+===================================================================
+--- nspr.orig/configure.in
++++ nspr/configure.in
+@@ -8,7 +8,7 @@ AC_PREREQ(2.61)
+ AC_INIT
+ AC_CONFIG_SRCDIR([pr/include/nspr.h])
+ 
+-AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
++AC_CONFIG_AUX_DIR(build/autoconf)
+ AC_CANONICAL_TARGET
+ 
+ dnl ========================================================
diff --git a/meta/recipes-support/nspr/nspr_4.10.8.bb b/meta/recipes-support/nspr/nspr_4.10.8.bb
new file mode 100644
index 0000000..944994e
--- /dev/null
+++ b/meta/recipes-support/nspr/nspr_4.10.8.bb
@@ -0,0 +1,176 @@
+SUMMARY = "Netscape Portable Runtime Library"
+HOMEPAGE =  "http://www.mozilla.org/projects/nspr/"
+LICENSE = "GPL-2.0 | MPL-2.0 | LGPL-2.1"
+LIC_FILES_CHKSUM = "file://configure.in;beginline=3;endline=6;md5=90c2fdee38e45d6302abcfe475c8b5c5 \
+                    file://Makefile.in;beginline=4;endline=38;md5=beda1dbb98a515f557d3e58ef06bca99"
+SECTION = "libs/network"
+
+SRC_URI = "ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz \
+           file://remove-rpath-from-tests.patch \
+           file://fix-build-on-x86_64.patch \
+           file://remove-srcdir-from-configure-in.patch \
+          "
+
+SRC_URI += "file://nspr.pc.in"
+
+SRC_URI[md5sum] = "8d7c5bd0a5b0a7d0e705be66479030a0"
+SRC_URI[sha256sum] = "507ea57c525c0c524dae4857a642b4ef5c9d795518754c7f83422d22fe544a15"
+
+S = "${WORKDIR}/nspr-${PV}/nspr"
+
+RDEPENDS_${PN}-dev += "perl"
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+TESTS = " \
+    accept \
+    acceptread \
+    acceptreademu \
+    affinity \
+    alarm \
+    anonfm \
+    atomic \
+    attach \
+    bigfile \
+    cleanup \
+    cltsrv  \
+    concur \
+    cvar \
+    cvar2 \
+    dlltest \
+    dtoa \
+    errcodes \
+    exit \
+    fdcach \
+    fileio \
+    foreign \
+    formattm \
+    fsync \
+    gethost \
+    getproto \
+    i2l \
+    initclk \
+    inrval \
+    instrumt \
+    intrio \
+    intrupt \
+    io_timeout \
+    ioconthr \
+    join \
+    joinkk \
+    joinku \
+    joinuk \
+    joinuu \
+    layer \
+    lazyinit \
+    libfilename \
+    lltest \
+    lock \
+    lockfile \
+    logfile \
+    logger \
+    many_cv \
+    multiwait \
+    nameshm1 \
+    nblayer \
+    nonblock \
+    ntioto \
+    ntoh \
+    op_2long \
+    op_excl \
+    op_filnf \
+    op_filok \
+    op_nofil \
+    parent \
+    parsetm \
+    peek \
+    perf \
+    pipeping \
+    pipeping2 \
+    pipeself \
+    poll_nm \
+    poll_to \
+    pollable \
+    prftest \
+    primblok \
+    provider \
+    prpollml \
+    ranfile \
+    randseed \
+    reinit \
+    rwlocktest \
+    sel_spd \
+    selct_er \
+    selct_nm \
+    selct_to \
+    selintr \
+    sema \
+    semaerr \
+    semaping \
+    sendzlf \
+    server_test \
+    servr_kk \
+    servr_uk \
+    servr_ku \
+    servr_uu \
+    short_thread \
+    sigpipe \
+    socket \
+    sockopt \
+    sockping \
+    sprintf \
+    stack \
+    stdio \
+    str2addr \
+    strod \
+    switch \
+    system \
+    testbit \
+    testfile \
+    threads \
+    timemac \
+    timetest \
+    tpd \
+    udpsrv \
+    vercheck \
+    version \
+    writev \
+    xnotify \
+    zerolen"
+
+PR = "r1"
+
+inherit autotools
+
+do_compile_prepend() {
+	oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX" LDFLAGS="" CC=gcc -C config export
+}
+
+do_compile_append() {
+	oe_runmake -C pr/tests
+}
+
+do_install_append() {
+    install -D ${WORKDIR}/nspr.pc.in ${D}${libdir}/pkgconfig/nspr.pc
+    sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nspr.pc
+    sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nspr.pc
+    sed -i s:OEINCDIR:${includedir}:g ${D}${libdir}/pkgconfig/nspr.pc
+    sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nspr.pc
+
+    mkdir -p ${D}${libdir}/nspr/tests
+    install -m 0755 ${S}/pr/tests/runtests.pl ${D}${libdir}/nspr/tests
+    install -m 0755 ${S}/pr/tests/runtests.sh ${D}${libdir}/nspr/tests
+    cd ${B}/pr/tests
+    install -m 0755 ${TESTS} ${D}${libdir}/nspr/tests
+
+    # delete compile-et.pl and perr.properties from ${bindir} because these are
+    # only used to generate prerr.c and prerr.h files from prerr.et at compile
+    # time
+    rm ${D}${bindir}/compile-et.pl ${D}${bindir}/prerr.properties
+}
+
+FILES_${PN} = "${libdir}/lib*.so"
+FILES_${PN}-dev = "${bindir}/* ${libdir}/nspr/tests/* ${libdir}/pkgconfig \
+                ${includedir}/* ${datadir}/aclocal/* "
+FILES_${PN}-dbg += "${libdir}/nspr/tests/.debug/*"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb b/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb
new file mode 100644
index 0000000..bbce9e9
--- /dev/null
+++ b/meta/recipes-support/nss-myhostname/nss-myhostname_0.3.bb
@@ -0,0 +1,29 @@
+SUMMARY = "Name Service Switch module for resolving the local hostname"
+DESCRIPTION = "plugin for the GNU Name Service Switch (NSS) functionality of \
+the GNU C Library (glibc) providing host name resolution for the locally \
+configured system hostname as returned by gethostname(2)."
+HOMEPAGE = "http://0pointer.de/lennart/projects/nss-myhostname/"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=2d5025d4aa3495befef8f17206a5b0a1"
+
+SRC_URI = "http://0pointer.de/lennart/projects/nss-myhostname/nss-myhostname-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "d4ab9ac36c053ab8fb836db1cbd4a48f"
+SRC_URI[sha256sum] = "2ba744ea8d578d1c57c85884e94a3042ee17843a5294434d3a7f6c4d67e7caf2"
+
+inherit autotools distro_features_check
+
+# The systemd has its own copy of nss-myhostname
+CONFLICT_DISTRO_FEATURES = "systemd"
+
+pkg_postinst_${PN} () {
+	sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+		-e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \
+		-i $D${sysconfdir}/nsswitch.conf
+}
+
+pkg_prerm_${PN} () {
+	sed -e '/^hosts:/s/\s*\<myhostname\>//' \
+		-e '/^hosts:/s/\s*myhostname//' \
+		-i $D${sysconfdir}/nsswitch.conf
+}
diff --git a/meta/recipes-support/nss/nss/nss-fix-incorrect-shebang-of-perl.patch b/meta/recipes-support/nss/nss/nss-fix-incorrect-shebang-of-perl.patch
new file mode 100644
index 0000000..547594d
--- /dev/null
+++ b/meta/recipes-support/nss/nss/nss-fix-incorrect-shebang-of-perl.patch
@@ -0,0 +1,110 @@
+nss: fix incorrect shebang of perl
+
+Replace incorrect shebang of perl with `#!/usr/bin/env perl'.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Pending
+---
+ nss/cmd/smimetools/smime  | 2 +-
+ nss/coreconf/cpdist.pl    | 2 +-
+ nss/coreconf/import.pl    | 2 +-
+ nss/coreconf/jniregen.pl  | 2 +-
+ nss/coreconf/outofdate.pl | 2 +-
+ nss/coreconf/release.pl   | 2 +-
+ nss/coreconf/version.pl   | 2 +-
+ nss/tests/clean_tbx       | 2 +-
+ nss/tests/path_uniq       | 2 +-
+ 9 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/nss/cmd/smimetools/smime b/nss/cmd/smimetools/smime
+--- a/nss/cmd/smimetools/smime
++++ b/nss/cmd/smimetools/smime
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl
++#!/usr/bin/env perl
+ 
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/cpdist.pl b/nss/coreconf/cpdist.pl
+index 800edfb..652187f 100755
+--- a/nss/coreconf/cpdist.pl
++++ b/nss/coreconf/cpdist.pl
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/import.pl b/nss/coreconf/import.pl
+index dd2d177..428eaa5 100755
+--- a/nss/coreconf/import.pl
++++ b/nss/coreconf/import.pl
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/jniregen.pl b/nss/coreconf/jniregen.pl
+index 2039180..5f4f69c 100755
+--- a/nss/coreconf/jniregen.pl
++++ b/nss/coreconf/jniregen.pl
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/outofdate.pl b/nss/coreconf/outofdate.pl
+index 33d80bb..01fc097 100755
+--- a/nss/coreconf/outofdate.pl
++++ b/nss/coreconf/outofdate.pl
+@@ -1,4 +1,4 @@
+-#!/usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/release.pl b/nss/coreconf/release.pl
+index 7cde19d..b5df2f6 100755
+--- a/nss/coreconf/release.pl
++++ b/nss/coreconf/release.pl
+@@ -1,4 +1,4 @@
+-#! /usr/local/bin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/coreconf/version.pl b/nss/coreconf/version.pl
+index d2a4942..79359fe 100644
+--- a/nss/coreconf/version.pl
++++ b/nss/coreconf/version.pl
+@@ -1,4 +1,4 @@
+-#!/usr/sbin/perl
++#!/usr/bin/env perl
+ #
+ # This Source Code Form is subject to the terms of the Mozilla Public
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
+diff --git a/nss/tests/clean_tbx b/nss/tests/clean_tbx
+index 4de9555..a7def9f 100755
+--- a/nss/tests/clean_tbx
++++ b/nss/tests/clean_tbx
+@@ -1,4 +1,4 @@
+-#! /bin/perl
++#!/usr/bin/env perl
+ 
+ #######################################################################
+ #
+diff --git a/nss/tests/path_uniq b/nss/tests/path_uniq
+index f29f60a..08fbffa 100755
+--- a/nss/tests/path_uniq
++++ b/nss/tests/path_uniq
+@@ -1,4 +1,4 @@
+-#! /bin/perl
++#!/usr/bin/env perl
+ 
+ ########################################################################
+ #
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch b/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch
new file mode 100644
index 0000000..866de07
--- /dev/null
+++ b/meta/recipes-support/nss/nss/nss-fix-nsinstall-build.patch
@@ -0,0 +1,35 @@
+Fix nss multilib build on openSUSE 11.x 32bit
+
+While building lib64-nss on openSUSE 11.x 32bit, the nsinstall will
+fail with error:
+
+* nsinstall.c:1:0: sorry, unimplemented: 64-bit mode not compiled
+
+It caused by the '-m64' option which passed to host gcc.
+
+The nsinstall was built first while nss starting to build, it only runs
+on host to install built files, it doesn't need any cross-compling or
+multilib build options. Just clean the ARCHFLAG and LDFLAGS to fix this
+error.
+
+Upstream-Status: Pending
+
+Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
+===================================================
+diff --git a/nss/coreconf/nsinstall/Makefile b/nss/coreconf/nsinstall/Makefile
+index 1850bcb..5aee84f 100644
+--- a/nss/coreconf/nsinstall/Makefile
++++ b/nss/coreconf/nsinstall/Makefile
+@@ -18,6 +18,12 @@ INTERNAL_TOOLS  = 1
+ 
+ include $(DEPTH)/coreconf/config.mk
+ 
++# nsinstall is unfit for cross-compiling/multilib-build since it was
++# always run on local host to install built files. This change intends
++# to clean the '-m64' from ARCHFLAG and LDFLAGS.
++ARCHFLAG =
++LDFLAGS =
++
+ ifeq (,$(filter-out OS2 WIN%,$(OS_TARGET)))
+ PROGRAM		=
+ else
diff --git a/meta/recipes-support/nss/nss/nss-fix-support-cross-compiling.patch b/meta/recipes-support/nss/nss/nss-fix-support-cross-compiling.patch
new file mode 100644
index 0000000..f0b3550
--- /dev/null
+++ b/meta/recipes-support/nss/nss/nss-fix-support-cross-compiling.patch
@@ -0,0 +1,71 @@
+nss: fix support cross compiling
+
+Let some make variables be assigned from outside makefile.
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Inappropriate [configuration]
+---
+ nss/coreconf/Linux.mk   | 12 +++++++++++-
+ nss/coreconf/arch.mk    |  2 +-
+ nss/lib/freebl/Makefile |  6 ++++++
+ 3 files changed, 18 insertions(+), 2 deletions(-)
+
+diff --git a/nss/coreconf/Linux.mk b/nss/coreconf/Linux.mk
+--- a/nss/coreconf/Linux.mk
++++ b/nss/coreconf/Linux.mk
+@@ -16,11 +16,21 @@ ifeq ($(USE_PTHREADS),1)
+ 	IMPL_STRATEGY = _PTH
+ endif
+ 
++ifndef CC
+ CC			= gcc
++endif
++
++ifdef CXX
++CCC			= $(CXX)
++else
+ CCC			= g++
++endif
++
++ifndef RANLIB
+ RANLIB			= ranlib
++endif
+ 
+-DEFAULT_COMPILER = gcc
++DEFAULT_COMPILER = $(CC)
+ 
+ ifeq ($(OS_TARGET),Android)
+ ifndef ANDROID_NDK
+diff --git a/nss/coreconf/arch.mk b/nss/coreconf/arch.mk
+index 6557348..b722412 100644
+--- a/nss/coreconf/arch.mk
++++ b/nss/coreconf/arch.mk
+@@ -37,7 +37,7 @@ OS_TEST := $(shell uname -m)
+ ifeq ($(OS_TEST),i86pc)
+     OS_RELEASE := $(shell uname -r)_$(OS_TEST)
+ else
+-    OS_RELEASE := $(shell uname -r)
++    OS_RELEASE ?= $(shell uname -r)
+ endif
+ 
+ #
+diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
+index 0d293f1..678f506 100644
+--- a/nss/lib/freebl/Makefile
++++ b/nss/lib/freebl/Makefile
+@@ -36,6 +36,12 @@ ifdef USE_64
+ 	DEFINES += -DNSS_USE_64
+ endif
+ 
++ifeq ($(OS_TEST),mips)
++ifndef USE_64
++	DEFINES += -DNS_PTR_LE_32
++endif
++endif
++
+ ifdef USE_ABI32_FPU
+ 	DEFINES += -DNSS_USE_ABI32_FPU
+ endif
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-support/nss/nss/nss-no-rpath-for-cross-compiling.patch b/meta/recipes-support/nss/nss/nss-no-rpath-for-cross-compiling.patch
new file mode 100644
index 0000000..7661dc9
--- /dev/null
+++ b/meta/recipes-support/nss/nss/nss-no-rpath-for-cross-compiling.patch
@@ -0,0 +1,26 @@
+nss:no rpath for cross compiling
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+Upstream-Status: Inappropriate [configuration]
+---
+ nss/cmd/platlibs.mk | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/nss/cmd/platlibs.mk b/nss/cmd/platlibs.mk
+--- a/nss/cmd/platlibs.mk
++++ b/nss/cmd/platlibs.mk
+@@ -18,9 +18,9 @@ endif
+ 
+ ifeq ($(OS_ARCH), Linux)
+ ifeq ($(USE_64), 1)
+-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
++#EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
+ else
+-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
++#EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
+ endif
+ endif
+ 
+-- 
+1.8.1.2
+
diff --git a/meta/recipes-support/nss/nss/nss.pc.in b/meta/recipes-support/nss/nss/nss.pc.in
new file mode 100644
index 0000000..200f635
--- /dev/null
+++ b/meta/recipes-support/nss/nss/nss.pc.in
@@ -0,0 +1,11 @@
+prefix=OEPREFIX
+exec_prefix=OEEXECPREFIX
+libdir=OELIBDIR
+includedir=OEINCDIR
+
+Name: NSS
+Description: Network Security Services
+Version: %NSS_VERSION%
+Requires: nspr >= %NSPR_VERSION%
+Libs: -lssl3 -lsmime3 -lnss3 -lsoftokn3 -lnssutil3
+Cflags: -IOEINCDIR
diff --git a/meta/recipes-support/nss/nss/signlibs.sh b/meta/recipes-support/nss/nss/signlibs.sh
new file mode 100644
index 0000000..a74e499
--- /dev/null
+++ b/meta/recipes-support/nss/nss/signlibs.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# signlibs.sh
+#
+# (c)2010 Wind River Systems, Inc.
+#
+# regenerates the .chk files for the NSS libraries that require it
+# since the ones that are built have incorrect checksums that were
+# calculated on the host where they really need to be done on the
+# target
+
+CHK_FILES=`ls /lib*/*.chk /usr/lib*/*.chk 2>/dev/null`
+SIGN_BINARY=`which shlibsign`
+for I in $CHK_FILES
+do
+       DN=`dirname $I`
+       BN=`basename $I .chk`
+       FN=$DN/$BN.so
+       $SIGN_BINARY -i $FN
+done
diff --git a/meta/recipes-support/nss/nss_3.19.2.bb b/meta/recipes-support/nss/nss_3.19.2.bb
new file mode 100644
index 0000000..23a4a1f
--- /dev/null
+++ b/meta/recipes-support/nss/nss_3.19.2.bb
@@ -0,0 +1,223 @@
+SUMMARY = "Mozilla's SSL and TLS implementation"
+DESCRIPTION = "Network Security Services (NSS) is a set of libraries \
+designed to support cross-platform development of \
+security-enabled client and server applications. \
+Applications built with NSS can support SSL v2 and v3, \
+TLS, PKCS 5, PKCS 7, PKCS 11, PKCS 12, S/MIME, X.509 \
+v3 certificates, and other security standards."
+HOMEPAGE = "http://www.mozilla.org/projects/security/pki/nss/"
+SECTION = "libs"
+
+LICENSE = "MPL-2.0 | (MPL-2.0 & GPL-2.0+) | (MPL-2.0 & LGPL-2.1+)"
+
+LIC_FILES_CHKSUM = "file://nss/COPYING;md5=3b1e88e1b9c0b5a4b2881d46cce06a18 \
+                    file://nss/lib/freebl/mpi/doc/LICENSE;md5=491f158d09d948466afce85d6f1fe18f \
+                    file://nss/lib/freebl/mpi/doc/LICENSE-MPL;md5=5d425c8f3157dbf212db2ec53d9e5132"
+
+SRC_URI = "\
+    http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_19_2_RTM/src/${BP}.tar.gz \
+    file://nss-fix-support-cross-compiling.patch \
+    file://nss-no-rpath-for-cross-compiling.patch \
+    file://nss-fix-incorrect-shebang-of-perl.patch \
+    file://nss-fix-nsinstall-build.patch \
+    file://nss.pc.in \
+    file://signlibs.sh \
+"
+
+SRC_URI[md5sum] = "b02ffd1e8e8ef5f8512fa02d8ca9db3d"
+SRC_URI[sha256sum] = "1306663e8f61d8449ad8cbcffab743a604dcd9f6f34232c210847c51dce2c9ae"
+
+inherit siteinfo
+
+DEPENDS = "sqlite3 nspr zlib nss-native"
+DEPENDS_class-native = "sqlite3-native nspr-native zlib-native"
+RDEPENDS_${PN}-smime = "perl"
+
+TD = "${S}/tentative-dist"
+TDS = "${S}/tentative-dist-staging"
+
+TARGET_CC_ARCH += "${LDFLAGS}"
+
+do_compile_prepend_class-native() {
+    export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
+    export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
+}
+
+do_compile_prepend_class-nativesdk() {
+    export LDFLAGS=""
+}
+
+do_compile() {
+    export CROSS_COMPILE=1
+    export NATIVE_CC="gcc"
+    export BUILD_OPT=1
+
+    export FREEBL_NO_DEPEND=1
+    export FREEBL_LOWHASH=1
+
+    export LIBDIR=${libdir}
+    export MOZILLA_CLIENT=1
+    export NS_USE_GCC=1
+    export NSS_USE_SYSTEM_SQLITE=1
+    export NSS_ENABLE_ECC=1
+
+    export OS_RELEASE=3.4
+    export OS_TARGET=Linux
+    export OS_ARCH=Linux
+
+    if [ "${TARGET_ARCH}" = "powerpc" ]; then
+        OS_TEST=ppc
+    elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
+        OS_TEST=ppc64
+    elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
+        OS_TEST=mips
+    else
+        OS_TEST="${TARGET_ARCH}"
+    fi
+
+    if [ "${SITEINFO_BITS}" = "64" ]; then
+        export USE_64=1
+    elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
+        export USE_X32=1
+    fi
+
+    # We can modify CC in the environment, but if we set it via an
+    # argument to make, nsinstall, a host program, will also build with it!
+    #
+    export CC="${CC} -g"
+    make -C ./nss CCC="${CXX} -g" \
+        OS_TEST=${OS_TEST}
+}
+
+
+do_install_prepend_class-nativesdk() {
+    export LDFLAGS=""
+}
+
+do_install() {
+    export CROSS_COMPILE=1
+    export NATIVE_CC="gcc"
+    export BUILD_OPT=1
+
+    export FREEBL_NO_DEPEND=1
+
+    export LIBDIR=${libdir}
+    export MOZILLA_CLIENT=1
+    export NS_USE_GCC=1
+    export NSS_USE_SYSTEM_SQLITE=1
+    export NSS_ENABLE_ECC=1
+
+    export OS_RELEASE=3.4
+    export OS_TARGET=Linux
+    export OS_ARCH=Linux
+
+    if [ "${TARGET_ARCH}" = "powerpc" ]; then
+        OS_TEST=ppc
+    elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
+        OS_TEST=ppc64
+    elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
+        OS_TEST=mips
+    else
+        OS_TEST="${TARGET_ARCH}"
+    fi
+    if [ "${SITEINFO_BITS}" = "64" ]; then
+        export USE_64=1
+    elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
+        export USE_X32=1
+    fi
+
+    make -C ./nss \
+        CCC="${CXX}" \
+        OS_TEST=${OS_TEST} \
+        SOURCE_LIB_DIR="${TD}/${libdir}" \
+        SOURCE_BIN_DIR="${TD}/${bindir}" \
+        install
+
+    install -d ${D}/${libdir}/
+    for file in ${S}/dist/*.OBJ/lib/*.so; do
+        echo "Installing `basename $file`..."
+        cp $file  ${D}/${libdir}/
+    done
+
+    for shared_lib in ${TD}/${libdir}/*.so.*; do
+        if [ -f $shared_lib ]; then
+            cp $shared_lib ${D}/${libdir}
+            ln -sf $(basename $shared_lib) ${D}/${libdir}/$(basename $shared_lib .1oe)
+        fi
+    done
+    for shared_lib in ${TD}/${libdir}/*.so; do
+        if [ -f $shared_lib -a ! -e ${D}/${libdir}/$shared_lib ]; then
+            cp $shared_lib ${D}/${libdir}
+        fi
+    done
+
+    install -d ${D}/${includedir}/nss3
+    install -m 644 -t ${D}/${includedir}/nss3 dist/public/nss/*
+
+    install -d ${D}/${bindir}
+    for binary in ${TD}/${bindir}/*; do
+        install -m 755 -t ${D}/${bindir} $binary
+    done
+}
+
+do_install_append() {
+    # Create empty .chk files for the NSS libraries at build time. They could
+    # be regenerated at target's boot time.
+    for file in libsoftokn3.chk libfreebl3.chk libnssdbm3.chk; do
+        touch ${D}/${libdir}/$file
+        chmod 755 ${D}/${libdir}/$file
+    done
+    install -D -m 755 ${WORKDIR}/signlibs.sh ${D}/${bindir}/signlibs.sh
+
+    install -d ${D}${libdir}/pkgconfig/
+    sed 's/%NSS_VERSION%/${PV}/' ${WORKDIR}/nss.pc.in | sed 's/%NSPR_VERSION%/4.9.2/' > ${D}${libdir}/pkgconfig/nss.pc
+    sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nss.pc
+    sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nss.pc
+    sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nss.pc
+    sed -i s:OEINCDIR:${includedir}/nss3:g ${D}${libdir}/pkgconfig/nss.pc
+}
+
+do_install_append_class-target() {
+    # Create a blank certificate
+    mkdir -p ${D}${sysconfdir}/pki/nssdb/
+    touch ./empty_password
+    certutil -N -d ${D}${sysconfdir}/pki/nssdb/ -f ./empty_password
+    chmod 644 ${D}${sysconfdir}/pki/nssdb/*.db
+    rm ./empty_password
+}
+
+pkg_postinst_${PN} () {
+    if [ -n "$D" ]; then
+        for I in $D/${libdir}/lib*.chk; do
+            DN=`dirname $I`
+            BN=`basename $I .chk`
+            FN=$DN/$BN.so
+            shlibsign -i $FN
+	    if [ $? -ne 0 ]; then
+	       exit 1
+	    fi
+        done
+        exit 0
+    fi
+    signlibs.sh
+}
+
+PACKAGES =+ "${PN}-smime"
+FILES_${PN}-smime = "\
+    ${bindir}/smime \
+"
+FILES_${PN} = "\
+    ${sysconfdir} \
+    ${bindir} \
+    ${libdir}/lib*.chk \
+    ${libdir}/lib*.so \
+    "
+FILES_${PN}-dev = "\
+    ${libdir}/nss \
+    ${libdir}/pkgconfig/* \
+    ${includedir}/* \
+    "
+# FILES_${PN}-dbg is populated automatically
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb b/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb
new file mode 100644
index 0000000..7ad9626
--- /dev/null
+++ b/meta/recipes-support/p11-kit/p11-kit_0.22.1.bb
@@ -0,0 +1,18 @@
+SUMMARY = "Provides a way to load and enumerate PKCS#11 modules"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=02933887f609807fbb57aa4237d14a50"
+
+inherit autotools gettext pkgconfig
+
+DEPENDS = "libtasn1 libffi"
+
+SRC_URI = "http://p11-glue.freedesktop.org/releases/${BP}.tar.gz"
+SRC_URI[md5sum] = "4e9bea1106628ffb820bdad24a819fac"
+SRC_URI[sha256sum] = "ef3a339fcf6aa0e32c8c23f79ba7191e57312be2bda8b24e6d121c2670539a5c"
+
+FILES_${PN}-dev += " \
+    ${libdir}/p11-kit-proxy.so \
+    ${libdir}/pkcs11/p11-kit-trust.so \
+"
+FILES_${PN}-dev += "${libdir}/pkcs11/*.la"
+FILES_${PN}-dbg += "${libdir}/pkcs11/.debug"
diff --git a/meta/recipes-support/pinentry/pinentry_0.9.2.bb b/meta/recipes-support/pinentry/pinentry_0.9.2.bb
new file mode 100644
index 0000000..c836ca4
--- /dev/null
+++ b/meta/recipes-support/pinentry/pinentry_0.9.2.bb
@@ -0,0 +1,31 @@
+SUMMARY = "Collection of simple PIN or passphrase entry dialogs"
+DESCRIPTION = "\
+	Pinentry is a collection of simple PIN or passphrase entry dialogs which \
+	utilize the Assuan protocol as described by the aegypten project; see \
+	http://www.gnupg.org/aegypten/ for details."
+
+HOMEPAGE = "http://www.gnupg.org/related_software/pinentry/index.en.html"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cbbd794e2a0a289b9dfcc9f513d1996e"
+
+inherit autotools
+
+SRC_URI = "ftp://ftp.gnupg.org/gcrypt/${BPN}/${BPN}-${PV}.tar.bz2"
+
+SRC_URI[md5sum] = "f51d454f921111b5156a2291cbf70278"
+SRC_URI[sha256sum] = "fd8bc1592ceb22bb492b07cb29b1b140bb882c859e6503b974254c0a4b4134d1"
+
+EXTRA_OECONF = "--disable-rpath \
+		        --disable-dependency-tracking \
+               "
+
+PACKAGECONFIG ??= "ncurses libcap"
+
+PACKAGECONFIG[ncurses] = "--enable-ncurses  --with-ncurses-include-dir=${STAGING_INCDIR}, --disable-ncurses, ncurses"
+PACKAGECONFIG[libcap] = "--with-libcap, --without-libcap, libcap"
+PACKAGECONFIG[qt4] = "--enable-pinentry-qt4, --disable-pinentry-qt4, qt4-x11"
+PACKAGECONFIG[qt4_clipboard] = "--enable-pinentry-qt4-clipboard --enable-pinentry-qt4, --disable-pinentry-qt4-clipboard, qt4-x11"
+PACKAGECONFIG[gtk2] = "--enable-pinentry-gtk2, --disable-pinentry-gtk2, gtk+ glib-2.0"
+
+#To use libsecret, add meta-gnome
+PACKAGECONFIG[secret] = "--enable-libsecret, --disable-libsecret, libsecret"
diff --git a/meta/recipes-support/popt/popt/disable_tests.patch b/meta/recipes-support/popt/popt/disable_tests.patch
new file mode 100644
index 0000000..016cf66
--- /dev/null
+++ b/meta/recipes-support/popt/popt/disable_tests.patch
@@ -0,0 +1,21 @@
+Use of $(top_srcdir) in TESTS is an error which causes
+automake-1.13 to abort. Just remove tests.
+
+Upstream-Status: Inappropriate [disable feature]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd popt-1.16/Makefile.am popt-1.16/Makefile.am
+--- popt-1.16/Makefile.am	2010-05-04 23:55:54.000000000 +0300
++++ popt-1.16/Makefile.am	2013-01-02 13:34:29.540361391 +0200
+@@ -34,11 +34,6 @@
+
+ noinst_SCRIPTS = testit.sh
+
+-TESTS_ENVIRONMENT = \
+-test1="$(top_builddir)/test1"
+-
+-TESTS = $(top_srcdir)/testit.sh
+-
+ include_HEADERS = popt.h
+
+ usrlibdir = $(libdir)
diff --git a/meta/recipes-support/popt/popt/pkgconfig_fix.patch b/meta/recipes-support/popt/popt/pkgconfig_fix.patch
new file mode 100644
index 0000000..0bddbf8
--- /dev/null
+++ b/meta/recipes-support/popt/popt/pkgconfig_fix.patch
@@ -0,0 +1,15 @@
+Upstream-Status: Pending
+
+Install the pkgconfig file into libdir.
+
+--- popt-1.16.orig/Makefile.am	2012-04-26 13:42:54.021139813 +0800
++++ popt-1.16/Makefile.am	2012-04-26 13:36:03.552096912 +0800
+@@ -47,7 +47,7 @@
+ libpopt_la_SOURCES = popt.c poptparse.c poptconfig.c popthelp.c poptint.c
+ libpopt_la_LDFLAGS = -no-undefined @LTLIBINTL@ @LTLIBICONV@
+ 
+-pkgconfigdir = $(prefix)/lib/pkgconfig
++pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = popt.pc
+ 
+ if HAVE_LD_VERSION_SCRIPT
diff --git a/meta/recipes-support/popt/popt/popt_fix_for_automake-1.12.patch b/meta/recipes-support/popt/popt/popt_fix_for_automake-1.12.patch
new file mode 100644
index 0000000..91bca96
--- /dev/null
+++ b/meta/recipes-support/popt/popt/popt_fix_for_automake-1.12.patch
@@ -0,0 +1,21 @@
+Upstream-Status: pending
+
+This patch avoids this error with automake 1.12:
+
+| configure.ac:49: error: automatic de-ANSI-fication support has been removed
+
+Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
+2012/05/02
+
+Index: popt-1.16/configure.ac
+===================================================================
+--- popt-1.16.orig/configure.ac
++++ popt-1.16/configure.ac
+@@ -46,7 +46,6 @@ AC_GCC_TRADITIONAL
+ AC_SYS_LARGEFILE
+ 
+ AC_ISC_POSIX
+-AM_C_PROTOTYPES
+ 
+ AC_CHECK_HEADERS(float.h fnmatch.h glob.h langinfo.h libintl.h mcheck.h unistd.h)
+ 
diff --git a/meta/recipes-support/popt/popt_1.16.bb b/meta/recipes-support/popt/popt_1.16.bb
new file mode 100644
index 0000000..cb13a81
--- /dev/null
+++ b/meta/recipes-support/popt/popt_1.16.bb
@@ -0,0 +1,20 @@
+SUMMARY = "Library for parsing command line options"
+HOMEPAGE = "http://rpm5.org/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=cb0613c30af2a8249b8dcc67d3edb06d"
+PR = "r3"
+
+SRC_URI = "http://rpm5.org/files/popt/popt-${PV}.tar.gz \
+           file://pkgconfig_fix.patch \
+           file://popt_fix_for_automake-1.12.patch \
+           file://disable_tests.patch \
+          "
+
+SRC_URI[md5sum] = "3743beefa3dd6247a73f8f7a32c14c33"
+SRC_URI[sha256sum] = "e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8"
+
+inherit autotools gettext
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/ptest-runner/files/ptest-runner b/meta/recipes-support/ptest-runner/files/ptest-runner
new file mode 100644
index 0000000..c618f11
--- /dev/null
+++ b/meta/recipes-support/ptest-runner/files/ptest-runner
@@ -0,0 +1,27 @@
+#!/bin/sh
+ANYFAILED=no
+echo "START: $0"
+
+for libdir in /usr/lib*
+do
+
+    [ ! -d "$libdir" ] && continue
+
+    for x in `ls -d $libdir/*/ptest 2>/dev/null`
+    do
+        [ ! -f $x/run-ptest ] && continue
+        [ -h `dirname $x` ] && continue
+
+        date "+%Y-%m-%dT%H:%M"
+        echo "BEGIN: $x"
+        cd "$x"
+        ./run-ptest || ANYFAILED=yes
+        echo "END: $x"
+        date "+%Y-%m-%dT%H:%M"
+    done
+done
+echo "STOP: $0"
+if [ "$ANYFAILED" = "yes"  ]; then
+    exit 1
+fi
+exit 0
diff --git a/meta/recipes-support/ptest-runner/ptest-runner_1.0.bb b/meta/recipes-support/ptest-runner/ptest-runner_1.0.bb
new file mode 100644
index 0000000..bc1b0a4
--- /dev/null
+++ b/meta/recipes-support/ptest-runner/ptest-runner_1.0.bb
@@ -0,0 +1,24 @@
+SUMMARY = "A simple shell script to run all installed ptests"
+DESCRIPTION = "The ptest-runner package installs a ptest-runner \
+shell script which loops through all installed ptest test suites and \
+runs them in sequence."
+HOMEPAGE = "https://wiki.yoctoproject.org/wiki/Ptest"
+SRC_URI += "file://ptest-runner"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \
+                    file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+S = "${WORKDIR}"
+
+do_install () {
+    mkdir -p ${D}${bindir}
+    install -m 0755 ${WORKDIR}/ptest-runner ${D}${bindir}
+}
+
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+do_build[noexec] = "1"
diff --git a/meta/recipes-support/pth/files/pth-add-pkgconfig-support.patch b/meta/recipes-support/pth/files/pth-add-pkgconfig-support.patch
new file mode 100644
index 0000000..67a28ab
--- /dev/null
+++ b/meta/recipes-support/pth/files/pth-add-pkgconfig-support.patch
@@ -0,0 +1,105 @@
+Upstream-Status: Pending
+
+Add pkgconfig support to pth.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+Index: Makefile.in
+===========================================================
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -47,6 +47,9 @@ datadir     = @datadir@
+ 
+ DESTDIR     =
+ 
++pkgconfigdir = ${libdir}/pkgconfig
++pkgconfig_DATA = pth.pc
++
+ ##
+ ##  ____ TOOL DEFINITIONS ___________________________________________
+ ##
+@@ -216,7 +219,7 @@ test_pthread: test_pthread.o test_common.o libpthread.la
+ 
+ #   install the package
+ install: all-for-install
+-	@$(MAKE) $(MKFLAGS) install-dirs install-pth @INSTALL_PTHREAD@
++	@$(MAKE) $(MKFLAGS) install-dirs install-pth @INSTALL_PTHREAD@ install-pkgconfigDATA
+ 	@touch .done-install >/dev/null 2>&1 || $(TRUE)
+ 	@$(MAKE) $(MKFLAGS) what-next
+ install-dirs:
+@@ -227,6 +230,7 @@ install-dirs:
+ 	$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1
+ 	$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man3
+ 	$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(datadir)/aclocal
++	$(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(pkgconfigdir)
+ install-pth:
+ 	$(SHTOOL) install -c -m 755 pth-config $(DESTDIR)$(bindir)/pth-config
+ 	$(SHTOOL) install -c -m 644 $(S)pth-config.1 $(DESTDIR)$(mandir)/man1/pth-config.1
+@@ -242,12 +246,16 @@ install-pthread:
+ 	$(SHTOOL) install -c -m 644 $(S)pthread.3 $(DESTDIR)$(mandir)/man3/pthread.3
+ 	@umask 022; $(LIBTOOL) --mode=install \
+ 	$(SHTOOL) install -c libpthread.la $(DESTDIR)$(libdir)/libpthread.la
++install-pkgconfigDATA: $(pkgconfig_DATA)
++	$(SHTOOL) install -c -m 644 $(pkgconfig_DATA) $(DESTDIR)$(pkgconfigdir)/$(pkgconfig_DATA)
+ 
+ #   uninstall the package
+ uninstall:
+-	@$(MAKE) $(MKFLAGS) @UNINSTALL_PTHREAD@ uninstall-pth uninstall-dirs
++	@$(MAKE) $(MKFLAGS) uninstall-pkgconfigDATA @UNINSTALL_PTHREAD@ uninstall-pth uninstall-dirs
+ 	@touch .done-uninstall >/dev/null 2>&1 || $(TRUE)
+ 	@$(MAKE) $(MKFLAGS) what-next
++uninstall-pkgconfigDATA:
++	$(RM) $(DESTDIR)$(pkgconfigdir)/$(pkgconfig_DATA)
+ uninstall-pthread:
+ 	$(RM) $(DESTDIR)$(bindir)/pthread-config
+ 	$(RM) $(DESTDIR)$(mandir)/man1/pthread-config.1
+@@ -271,6 +279,7 @@ uninstall-dirs:
+ 	-$(RMDIR) $(DESTDIR)$(includedir) >/dev/null 2>&1 || $(TRUE)
+ 	-$(RMDIR) $(DESTDIR)$(bindir) >/dev/null 2>&1 || $(TRUE)
+ 	-$(RMDIR) $(DESTDIR)$(prefix) >/dev/null 2>&1 || $(TRUE)
++	-$(RMDIR) $(DESTDIR)$(pkgconfigdir) > /dev/null 2>&1 ||$(TRUE)
+ 
+ #   strip down the source tree to its minimum
+ striptease:
+Index: configure.ac
+===========================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -656,6 +656,13 @@ pth_acmac.h dnl
+ chmod +rx pthread-config
+ chmod +rx pth-config
+ )dnl
++
++PTH_VERSION=`echo $PTH_VERSION_STR | cut -d' ' -f1`
++AC_SUBST(PTH_VERSION)
++
++AC_CONFIG_FILES([pth.pc])
++AC_OUTPUT
++
+ if test ".$enable_pthread" = .no; then
+     rm -f pthread-config
+     rm -f pthread.h
+Index: pth.pc.in
+===========================================================
+--- /dev/null
++++ b/pth.pc.in
+@@ -0,0 +1,16 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++bindir=@bindir@
++mandir=@mandir@
++datadir=@datadir@
++acdir=@datadir@/aclocal
++
++Name: pth
++Description: GNU Portable Threads
++Requires:
++Version: @PTH_VERSION@
++Libs: -L${libdir} -lpth
++Libs.private: 
++Cflags: -I${includedir}
+-- 
+1.7.5.4
+
diff --git a/meta/recipes-support/pth/files/pth-fix-parallel.patch b/meta/recipes-support/pth/files/pth-fix-parallel.patch
new file mode 100644
index 0000000..08edaff
--- /dev/null
+++ b/meta/recipes-support/pth/files/pth-fix-parallel.patch
@@ -0,0 +1,48 @@
+From df06b8170745eac347acb95f9f374f257621254f Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang@windriver.com>
+Date: Thu, 29 Jan 2015 18:11:00 -0800
+Subject: [PATCH] Makefile.in: fix for parallel build
+
+Fixed:
+* do_compile
+ pth_uctx.c:31:19: fatal error: pth_p.h: No such file or directory
+ #include "pth_p.h"
+                   ^
+compilation terminated.
+make: *** [pth_uctx.lo] Error 1
+
+* do_install:
+  cp: cannot create regular file `image/usr/lib/pkgconfig/#INST@15507#': No such file or directory
+
+Upstream-Status: Pending
+Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
+---
+ Makefile.in |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index de0390d..381a0ee 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -219,7 +219,8 @@ test_pthread: test_pthread.o test_common.o libpthread.la
+ 
+ #   install the package
+ install: all-for-install
+-	@$(MAKE) $(MKFLAGS) install-dirs install-pth @INSTALL_PTHREAD@ install-pkgconfigDATA
++	@$(MAKE) $(MKFLAGS) install-dirs
++	@$(MAKE) $(MKFLAGS) install-pth @INSTALL_PTHREAD@ install-pkgconfigDATA
+ 	@touch .done-install >/dev/null 2>&1 || $(TRUE)
+ 	@$(MAKE) $(MKFLAGS) what-next
+ install-dirs:
+@@ -432,7 +433,7 @@ TAGS:
+ ##  (AUTOMATICALLY UPDATED - DO NOT EDIT)
+ ##
+ 
+-$(LOBJS): Makefile
++$(LOBJS): Makefile pth_p.h
+ 
+ # DO NOT REMOVE
+ pth_attr.lo: pth_attr.c pth_p.h pth_vers.c pth.h pth_acdef.h pth_acmac.h
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-support/pth/pth_2.0.7.bb b/meta/recipes-support/pth/pth_2.0.7.bb
new file mode 100644
index 0000000..9037769
--- /dev/null
+++ b/meta/recipes-support/pth/pth_2.0.7.bb
@@ -0,0 +1,31 @@
+SUMMARY = "GNU Portable Threads library"
+HOMEPAGE = "http://www.gnu.org/software/pth/"
+SECTION = "libs"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;beginline=12;endline=15;md5=a48af114a80c222cafd37f24370a77b1"
+PR = "r3"
+
+python __anonymous () {
+    import re
+    uc_os = (re.match('.*uclibc*', d.getVar('TARGET_OS', True)) != None)
+    if uc_os:
+        raise bb.parse.SkipPackage("incompatible with uClibc")
+}
+
+SRC_URI = "${GNU_MIRROR}/pth/pth-${PV}.tar.gz \
+          file://pth-add-pkgconfig-support.patch \
+          file://pth-fix-parallel.patch \
+          "
+
+SRC_URI[md5sum] = "9cb4a25331a4c4db866a31cbe507c793"
+SRC_URI[sha256sum] = "72353660c5a2caafd601b20e12e75d865fd88f6cf1a088b306a3963f0bc77232"
+
+BINCONFIG = "${bindir}/pth-config"
+
+inherit autotools binconfig-disabled pkgconfig
+
+do_configure() {
+	( cd ${S}; gnu-configize )
+	( cd ${S}; autoconf )
+	oe_runconf
+}
diff --git a/meta/recipes-support/serf/serf/env.patch b/meta/recipes-support/serf/serf/env.patch
new file mode 100644
index 0000000..9d073e9
--- /dev/null
+++ b/meta/recipes-support/serf/serf/env.patch
@@ -0,0 +1,28 @@
+'scons' cleans the environment which breaks ccache builds because
+CCACHEDIR can point to an unexpected location:
+
+| ccache arm-linux-gnueabi-gcc ... context.c
+| ccache: failed to create .../serf/1.3.6-r0/.home/.ccache (No such file or directory)
+
+Issue is described in
+
+  http://www.scons.org/wiki/ImportingEnvironmentSettings
+
+and because 'bitbake' cleans environment we can pass it completely
+instead of trying to enumerate needed env.
+
+Upstream-Status: Inappropriate
+
+
+Index: serf-1.3.6/SConstruct
+===================================================================
+--- serf-1.3.6.orig/SConstruct
++++ serf-1.3.6/SConstruct
+@@ -149,6 +149,7 @@ if sys.platform == 'win32':
+ env = Environment(variables=opts,
+                   tools=('default', 'textfile',),
+                   CPPPATH=['.', ],
++                  ENV = os.environ,
+                   )
+
+ env.Append(BUILDERS = {
diff --git a/meta/recipes-support/serf/serf/norpath.patch b/meta/recipes-support/serf/serf/norpath.patch
new file mode 100644
index 0000000..380f5d0
--- /dev/null
+++ b/meta/recipes-support/serf/serf/norpath.patch
@@ -0,0 +1,42 @@
+The RPATH handling in serf is all wrong for us and we don't need it 
+anyway so hack around it by removing this for now.
+
+Upstream-Status: Inappropriate
+
+RP 2014/7/17
+
+Index: serf-1.3.6/SConstruct
+===================================================================
+--- serf-1.3.6.orig/SConstruct	2014-07-17 19:57:57.724389150 +0000
++++ serf-1.3.6/SConstruct	2014-07-17 20:04:21.784399616 +0000
+@@ -218,8 +218,7 @@
+ else:
+   LIBNAMESTATIC = 'serf-${MAJOR}'
+ 
+-env.Append(RPATH=libdir,
+-           PDB='${TARGET.filebase}.pdb')
++env.Append(PDB='${TARGET.filebase}.pdb')
+ 
+ #for i in env:
+ #    print(str(env[i]))
+@@ -371,12 +370,6 @@
+ if sys.platform == 'win32':
+   env.Append(CPPDEFINES=['SERF_HAVE_SSPI'])
+ 
+-# On some systems, the -R values that APR describes never make it into actual
+-# RPATH flags. We'll manually map all directories in LIBPATH into new
+-# flags to set RPATH values.
+-for d in env['LIBPATH']:
+-  env.Append(RPATH=':'+d)
+-
+ # Set up the construction of serf-*.pc
+ pkgconfig = env.Textfile('serf-%d.pc' % (MAJOR,),
+                          env.File('build/serf.pc.in'),
+@@ -446,7 +439,6 @@
+                           ENV={'PATH' : os.environ['PATH']}))
+ 
+ # Find the (dynamic) library in this directory
+-tenv.Replace(RPATH=thisdir)
+ tenv.Prepend(LIBS=[LIBNAMESTATIC, ],
+              LIBPATH=[thisdir, ])
+ 
diff --git a/meta/recipes-support/serf/serf_1.3.8.bb b/meta/recipes-support/serf/serf_1.3.8.bb
new file mode 100644
index 0000000..b5059d5
--- /dev/null
+++ b/meta/recipes-support/serf/serf_1.3.8.bb
@@ -0,0 +1,26 @@
+SUMMARY = "High-Performance Asynchronous HTTP Client Library"
+SRC_URI = "${DEBIAN_MIRROR}/main/s/${BPN}/${BPN}_${PV}.orig.tar.gz \
+           file://norpath.patch \
+           file://env.patch"
+
+SRC_URI[md5sum] = "713beaf05d7f3329de121e218e2fcb93"
+SRC_URI[sha256sum] = "77134cd5010664ca023585bce50978bd4005906ed280ff889f591f86df7c59e4"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
+
+DEPENDS = "python-scons-native openssl apr apr-util util-linux expat"
+
+do_compile() {
+	${STAGING_BINDIR_NATIVE}/scons ${PARALLEL_MAKE} PREFIX=${prefix} \
+		CC="${CC}" \
+		APR=`which apr-1-config` APU=`which apu-1-config` \
+		CFLAGS="${CFLAGS}" LINKFLAGS="${LDFLAGS}" \
+		OPENSSL="${STAGING_EXECPREFIXDIR}"
+}
+
+do_install() {
+	${STAGING_BINDIR_NATIVE}/scons PREFIX=${D}${prefix} LIBDIR=${D}${libdir} install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info.inc b/meta/recipes-support/shared-mime-info/shared-mime-info.inc
new file mode 100644
index 0000000..6eedb6d
--- /dev/null
+++ b/meta/recipes-support/shared-mime-info/shared-mime-info.inc
@@ -0,0 +1,36 @@
+SUMMARY = "Shared MIME type database and specification"
+HOMEPAGE = "http://freedesktop.org/wiki/Software/shared-mime-info"
+SECTION = "base"
+
+LICENSE = "LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+
+DEPENDS = "libxml2 intltool-native glib-2.0 shared-mime-info-native"
+DEPENDS_class-native = "libxml2-native intltool-native glib-2.0-native"
+
+SRC_URI = "http://freedesktop.org/~hadess/shared-mime-info-${PV}.tar.xz"
+
+inherit autotools pkgconfig gettext
+
+EXTRA_OECONF = "--disable-update-mimedb"
+
+FILES_${PN} += "${datadir}/mime"
+FILES_${PN}-dev += "${datadir}/pkgconfig/shared-mime-info.pc"
+
+# freedesktop.org.xml is only required when updating the mime database,
+# package it separately
+PACKAGES =+ "shared-mime-info-data"
+FILES_shared-mime-info-data = "${datadir}/mime/packages/freedesktop.org.xml"
+RDEPENDS_shared-mime-info-data = "shared-mime-info"
+
+do_install () {
+	autotools_do_install
+
+	update-mime-database ${D}${datadir}/mime
+}
+
+do_install_class-native () {
+	autotools_do_install
+}
+
+BBCLASSEXTEND = "native"
diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch b/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch
new file mode 100644
index 0000000..3c9f1ea
--- /dev/null
+++ b/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch
@@ -0,0 +1,23 @@
+fix shared-mime-info build race condition
+
+The definition of install-data-hook in Makefile.am leads
+to multiple, overlapping, executions of install-binPROGRAMS
+target.  We modify the definition to avoid that.
+
+Upstream-Status: Pending
+
+Signed-off-by: Joe Slater <jslater@windriver.com>
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -44,7 +44,9 @@ $(pkgconfig_DATA): config.status
+ @INTLTOOL_XML_RULE@
+ @INTLTOOL_DESKTOP_RULE@
+ 
+-install-data-hook: install-binPROGRAMS
++# do NOT make this dependent on anything!
++#
++install-data-hook:
+ if ENABLE_UPDATE_MIMEDB
+ 	$(DESTDIR)"$(bindir)/update-mime-database" -V "$(DESTDIR)$(datadir)/mime"
+ endif
diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch b/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch
new file mode 100644
index 0000000..84c4d03
--- /dev/null
+++ b/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch
@@ -0,0 +1,33 @@
+The Makefile used by shared-mime-info is one big race with the SUBDIRS 
+option and the dependency specifically calling make all combining to
+create multiple make instances all of which may try and build targets
+like update-mime-database.
+
+This patch removes those options meaning make can correctly identify
+dependencies and stop itself racing itself.
+
+RP 10/10/2011
+
+Upstream-Status: Pending
+Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
+
+Index: shared-mime-info-1.0/Makefile.am
+===================================================================
+--- shared-mime-info-1.0.orig/Makefile.am
++++ shared-mime-info-1.0/Makefile.am
+@@ -1,5 +1,3 @@
+-SUBDIRS=. po
+-
+ AM_CPPFLAGS = $(ALL_CFLAGS)
+ 
+ packagesdir = $(datadir)/mime/packages
+@@ -72,8 +70,7 @@ uninstall-hook:
+ 
+ all: $(defaultmakedeps)
+ 
+-create-pot:
+-	$(AM_V_GEN) $(MAKE) -C po shared-mime-info.pot
++create-pot: po
+ 
+ check: create-pot freedesktop.org.xml update-mime-database check-translations
+ 	if test -e $(top_builddir)/freedesktop.org.xml; then \
diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info_1.4.bb b/meta/recipes-support/shared-mime-info/shared-mime-info_1.4.bb
new file mode 100644
index 0000000..8c4fde8
--- /dev/null
+++ b/meta/recipes-support/shared-mime-info/shared-mime-info_1.4.bb
@@ -0,0 +1,7 @@
+require shared-mime-info.inc
+
+SRC_URI += "file://parallelmake.patch \
+	    file://install-data-hook.patch"
+
+SRC_URI[md5sum] = "16c02f7b658fff2a9c207406d388ea31"
+SRC_URI[sha256sum] = "bbc0bd023f497dfd75e1ca73441cbbb5a63617d9e14f2790b868361cc055b5b1"
diff --git a/meta/recipes-support/sqlite/files/0001-using-the-dynamic-library.patch b/meta/recipes-support/sqlite/files/0001-using-the-dynamic-library.patch
new file mode 100644
index 0000000..e3bfd5f
--- /dev/null
+++ b/meta/recipes-support/sqlite/files/0001-using-the-dynamic-library.patch
@@ -0,0 +1,30 @@
+[PATCH] using the dynamic library
+
+Upstream-Status:  Inappropriate [configuration]
+
+building statically-linked sqlite3 failed since sqlite3.o is generated in 
+different dir, even if link successes, the size of sqlite3 is become larger,
+so use the dynamic link, ref: http://patchwork.openembedded.org/patch/93293/
+
+Signed-off-by: Roy Li <rongqing.li@windriver.com>
+---
+ Makefile.am | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 88bc23d..fe50f20 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -7,7 +7,8 @@ libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8
+ 
+ bin_PROGRAMS = sqlite3
+ sqlite3_SOURCES = shell.c sqlite3.h
+-sqlite3_LDADD = sqlite3.$(OBJEXT) @READLINE_LIBS@
++sqlite3_LDADD = @READLINE_LIBS@ libsqlite3.la
++
+ 
+ include_HEADERS = sqlite3.h sqlite3ext.h
+ 
+-- 
+1.9.1
+
diff --git a/meta/recipes-support/sqlite/sqlite3.inc b/meta/recipes-support/sqlite/sqlite3.inc
new file mode 100644
index 0000000..2e3791b
--- /dev/null
+++ b/meta/recipes-support/sqlite/sqlite3.inc
@@ -0,0 +1,34 @@
+SUMMARY = "Embeddable SQL database engine"
+HOMEPAGE = "http://www.sqlite.org"
+SECTION = "libs"
+DEPENDS = "readline ncurses"
+DEPENDS_class-native = ""
+LICENSE = "PD"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--enable-shared --enable-threadsafe"
+EXTRA_OECONF_class-native = "--enable-shared --enable-threadsafe --disable-readline"
+export config_BUILD_CC = "${BUILD_CC}"
+export config_BUILD_CFLAGS = "${BUILD_CFLAGS}"
+export config_BUILD_LIBS = "${BUILD_LDFLAGS}"
+export config_TARGET_CC = "${CC}"
+export config_TARGET_LINK = "${CCLD}"
+export config_TARGET_CFLAGS = "${CFLAGS}"
+export config_TARGET_LFLAGS = "${LDFLAGS}"
+
+# pread() is in POSIX.1-2001 so any reasonable system must surely support it
+BUILD_CFLAGS += "-DUSE_PREAD"
+TARGET_CFLAGS += "-DUSE_PREAD"
+
+PACKAGES = "lib${BPN} lib${BPN}-dev lib${BPN}-doc ${PN}-dbg lib${BPN}-staticdev ${PN}"
+
+FILES_${PN} = "${bindir}/*"
+FILES_lib${BPN} = "${libdir}/*.so.*"
+FILES_lib${BPN}-dev = "${libdir}/*.la ${libdir}/*.so \
+	                	   ${libdir}/pkgconfig ${includedir}"
+FILES_lib${BPN}-doc = "${docdir} ${mandir} ${infodir}"
+FILES_lib${BPN}-staticdev = "${libdir}/lib*.a"
+AUTO_LIBNAME_PKGS = "${MLPREFIX}lib${BPN}"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta/recipes-support/sqlite/sqlite3_3.8.10.2.bb b/meta/recipes-support/sqlite/sqlite3_3.8.10.2.bb
new file mode 100644
index 0000000..c72ad50
--- /dev/null
+++ b/meta/recipes-support/sqlite/sqlite3_3.8.10.2.bb
@@ -0,0 +1,23 @@
+require sqlite3.inc
+
+LIC_FILES_CHKSUM = "file://sqlite3.h;endline=11;md5=65f0a57ca6928710b418c094b3570bb0"
+
+def sqlite_download_version(d):
+    pvsplit = d.getVar('PV', True).split('.')
+    return pvsplit[0] + ''.join([part.rjust(2,'0') for part in pvsplit[1:]])
+
+PE = "3"
+SQLITE_PV = "${@sqlite_download_version(d)}"
+SRC_URI = "http://www.sqlite.org/2015/sqlite-autoconf-${SQLITE_PV}.tar.gz \
+           file://0001-using-the-dynamic-library.patch \
+"
+
+SRC_URI[md5sum] = "a18bfc015cd49a1e7a961b7b77bc3b37"
+SRC_URI[sha256sum] = "8382e55a4e7d853c93038562ca3dd00307937fccf1c6b65ddd813e503a56d626"
+
+S = "${WORKDIR}/sqlite-autoconf-${SQLITE_PV}"
+
+# Provide column meta-data API
+BUILD_CFLAGS += "-DSQLITE_ENABLE_COLUMN_METADATA"
+TARGET_CFLAGS += "-DSQLITE_ENABLE_COLUMN_METADATA"
+
diff --git a/meta/recipes-support/taglib/taglib_1.9.1.bb b/meta/recipes-support/taglib/taglib_1.9.1.bb
new file mode 100644
index 0000000..1f27814
--- /dev/null
+++ b/meta/recipes-support/taglib/taglib_1.9.1.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Library for reading and editing the meta-data of popular audio formats"
+SECTION = "libs/multimedia"
+HOMEPAGE = "http://taglib.github.io/"
+LICENSE = "LGPLv2.1 | MPL-1"
+LIC_FILES_CHKSUM = "file://COPYING.LGPL;md5=4fbd65380cdd255951079008b364516c \
+                    file://COPYING.MPL;md5=bfe1f75d606912a4111c90743d6c7325 \
+                    file://taglib/audioproperties.h;beginline=1;endline=24;md5=9df2c7399519b7310568a7c55042ecee"
+
+DEPENDS = "zlib"
+
+SRC_URI = "http://taglib.github.io/releases/${BP}.tar.gz"
+SRC_URI[md5sum] = "0d35df96822bbd564c5504cb3c2e4d86"
+SRC_URI[sha256sum] = "72d371cd1419a87ae200447a53bff2be219283071e80fd12337928cc967dc71a"
+
+BINCONFIG = "${bindir}/taglib-config"
+
+inherit cmake pkgconfig binconfig-disabled
+
+PACKAGES =+ "${PN}-c"
+FILES_${PN}-c = "${libdir}/libtag_c.so.*"
+
+EXTRA_OECMAKE = "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
+
+do_configure_prepend () {
+	rm -f ${S}/admin/ltmain.sh
+	rm -f ${S}/admin/libtool.m4.in
+	# Don't have a floating dependeny on boost
+	sed -i -e "s/atomic.hpp/atomic-not-exist.hpp/" ${S}/ConfigureChecks.cmake ${S}/taglib/toolkit/trefcounter.cpp
+}
+
diff --git a/meta/recipes-support/user-creation/xuser-account_0.1.bb b/meta/recipes-support/user-creation/xuser-account_0.1.bb
new file mode 100644
index 0000000..77ba97d
--- /dev/null
+++ b/meta/recipes-support/user-creation/xuser-account_0.1.bb
@@ -0,0 +1,27 @@
+SUMMARY = "Creates an 'xuser' account used for running X11"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = ""
+
+inherit allarch useradd
+
+do_configure() {
+    :
+}
+
+do_compile() {
+    :
+}
+
+do_install() {
+    :
+}
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM_${PN} = "--system shutdown"
+USERADD_PARAM_${PN} = "--create-home \
+                       --groups video,tty,audio,input,shutdown,disk \
+                       --user-group xuser"
+
+ALLOW_EMPTY_${PN} = "1"
diff --git a/meta/recipes-support/vte/vte-0.28.2/obsolete_automake_macros.patch b/meta/recipes-support/vte/vte-0.28.2/obsolete_automake_macros.patch
new file mode 100644
index 0000000..6763d37
--- /dev/null
+++ b/meta/recipes-support/vte/vte-0.28.2/obsolete_automake_macros.patch
@@ -0,0 +1,14 @@
+Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=691545]
+
+Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
+diff -Nurd vte-0.28.2/gnome-pty-helper/configure.in vte-0.28.2/gnome-pty-helper/configure.in
+--- vte-0.28.2/gnome-pty-helper/configure.in	2010-07-15 20:08:44.000000000 +0300
++++ vte-0.28.2/gnome-pty-helper/configure.in	2013-01-11 14:50:34.971027440 +0200
+@@ -8,7 +8,6 @@
+ AC_ISC_POSIX
+ AC_PROG_CC
+ AC_STDC_HEADERS
+-AM_PROG_CC_STDC
+
+ if test -z "$enable_maintainer_mode"; then
+   enable_maintainer_mode=yes
diff --git a/meta/recipes-support/vte/vte.inc b/meta/recipes-support/vte/vte.inc
new file mode 100644
index 0000000..874062a
--- /dev/null
+++ b/meta/recipes-support/vte/vte.inc
@@ -0,0 +1,16 @@
+SUMMARY = "Virtual terminal emulator GTK+ widget library"
+BUGTRACKER = "https://bugzilla.gnome.org/buglist.cgi?product=vte"
+LICENSE = "LGPLv2.0"
+DEPENDS = " glib-2.0 gtk+ intltool-native ncurses gobject-introspection-stub"
+RDEPENDS_libvte = "vte-termcap"
+
+inherit gnome gtk-doc
+
+EXTRA_OECONF = "--disable-python --disable-introspection"
+
+PACKAGES =+ "libvte vte-termcap"
+FILES_libvte = "${libdir}/*.so.* ${libexecdir}/gnome-pty-helper"
+FILES_${PN}-dbg =+ "${libexecdir}/.debug ${prefix}/src ${bindir}/.debug \
+               ${libdir}/.debug"
+FILES_vte-termcap = "${datadir}/vte/termcap-0.0"
+
diff --git a/meta/recipes-support/vte/vte_0.28.2.bb b/meta/recipes-support/vte/vte_0.28.2.bb
new file mode 100644
index 0000000..b1025cb
--- /dev/null
+++ b/meta/recipes-support/vte/vte_0.28.2.bb
@@ -0,0 +1,14 @@
+require vte.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
+
+PR = "r6"
+
+SRC_URI += "file://obsolete_automake_macros.patch"
+
+CFLAGS += "-D_GNU_SOURCE"
+
+SRC_URI[archive.md5sum] = "497f26e457308649e6ece32b3bb142ff"
+SRC_URI[archive.sha256sum] = "86cf0b81aa023fa93ed415653d51c96767f20b2d7334c893caba71e42654b0ae"
+
+RECIPE_NO_UPDATE_REASON = "matchbox-terminal needs to be ported over to new vte first"
diff --git a/meta/recipes.txt b/meta/recipes.txt
new file mode 100644
index 0000000..705386d
--- /dev/null
+++ b/meta/recipes.txt
@@ -0,0 +1,15 @@
+recipes-bsp          - Anything with links to specific hardware or hardware configuration information
+recipes-connectivity - Libraries and applications related to communication with other devices 
+recipes-core         - What's needed to build a basic working Linux image including commonly used dependencies
+recipes-devtools     - Tools primarily used by the build system (but can also be used on targets)
+recipes-extended     - Applications which whilst not essential add features compared to the alternatives in
+                       core. May be needed for full tool functionality or LSB compliance.
+recipes-gnome        - All things related to the GTK+ application framework
+recipes-graphics     - X and other graphically related system libraries  
+recipes-kernel       - The kernel and generic applications/libraries with strong kernel dependencies
+recipes-lsb4         - Recipes added for the sole purpose of supporting the Linux Standard Base (LSB) 4.x
+recipes-multimedia   - Codecs and support utilties for audio, images and video
+recipes-rt           - Provides package and image recipes for using and testing the PREEMPT_RT kernel
+recipes-qt           - All things related to the Qt application framework
+recipes-sato         - The Sato demo/reference UI/UX, its associated apps and configuration 
+recipes-support      - Recipes used by other recipes but that are not directly included in images
diff --git a/meta/site/arm-32 b/meta/site/arm-32
new file mode 100644
index 0000000..81fd8d3
--- /dev/null
+++ b/meta/site/arm-32
@@ -0,0 +1,47 @@
+# definitions assuming 32-bit arm architecture
+
+# apache
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+
+# glib
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+
+# glib-2.0
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=4}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=4
+
+# jikes
+ac_cv_sizeof_wchar_t=4
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=8
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=8
+ac_cv_alignof_CORBA_long_long=8
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=1
+ac_cv_alignof_CORBA_wchar=2
+
+# at-spi2-core
+ac_cv_alignof_char=1
+ac_cv_alignof_dbind_pointer=4
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=8
+ac_cv_alignof_double=8
diff --git a/meta/site/arm-64 b/meta/site/arm-64
new file mode 100644
index 0000000..90c09b2
--- /dev/null
+++ b/meta/site/arm-64
@@ -0,0 +1,46 @@
+# definitions assuming 64-bit arm architecture
+
+# general
+ac_cv_sizeof_wchar_t=4
+ac_cv_sizeof_size_t=8
+ac_cv_sizeof_ssize_t=8
+ac_cv_alignof_char=1
+ac_cv_alignof_double=8
+
+# glib
+#glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+#glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+#glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+
+# glib-2.0
+#glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+#glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+#glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+#glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=4}
+#glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+
+# ORBit2 (should be in meta-gnome/site/arm-64)
+#ac_cv_alignof_CORBA_boolean=1
+#ac_cv_alignof_CORBA_char=1
+#ac_cv_alignof_CORBA_double=8
+#ac_cv_alignof_CORBA_float=4
+#ac_cv_alignof_CORBA_long=4
+#ac_cv_alignof_CORBA_long_double=8
+#ac_cv_alignof_CORBA_long_long=8
+#ac_cv_alignof_CORBA_octet=1
+#ac_cv_alignof_CORBA_pointer=4
+#ac_cv_alignof_CORBA_short=2
+#ac_cv_alignof_CORBA_struct=1
+#ac_cv_alignof_CORBA_wchar=2
+
+# at-spi2-core
+ac_cv_alignof_dbind_pointer=8
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=8
+
diff --git a/meta/site/arm-common b/meta/site/arm-common
new file mode 100644
index 0000000..12e5d45
--- /dev/null
+++ b/meta/site/arm-common
@@ -0,0 +1,159 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no}
+ac_cv_header_netinet_sctp_uio_h=${ac_cv_header_netinet_sctp_uio_h=no}
+ac_cv_sctp=${ac_cv_sctp=no}
+
+# apache
+ac_cv_func_pthread_key_delete=${ac_cv_func_pthread_key_delete=yes}
+apr_cv_process_shared_works=${apr_cv_process_shared_works=no}
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=missing}
+
+# coreutils
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1019}
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# db (sleepycat)
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# edb
+db_cv_spinlocks=${db_cv_spinlocks=no}
+
+# ettercap
+ettercap_cv_type_socklen_t=${ettercap_cv_type_socklen_t=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+compat_cv_func_basename_works=${compat_cv_func_basename_works=no}
+compat_cv_func_dirname_works=${compat_cv_func_dirname_works=no}
+
+# fnmatch
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# glib
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+
+# glib-2.0
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_sys_use_pid_niceness_surrogate=${glib_cv_sys_use_pid_niceness_surrogate=yes}
+
+#gstreamer
+as_cv_unaligned_access=${as_cv_unaligned_access=no}
+
+# httppc
+ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
+
+# lftp
+ac_cv_need_trio=${ac_cv_need_trio=no}
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+
+# libesmtp
+acx_working_snprintf=${acx_working_snprintf=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# libnet 
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# libxfce4util
+with_broken_putenv=${with_broken_putenv=no}
+
+# links
+ac_cv_lib_png_png_create_info_struct=${ac_cv_lib_png_png_create_info_struct=yes}
+
+# mysql
+mysql_cv_func_atomic_sub=${mysql_cv_func_atomic_sub=no}
+mysql_cv_func_atomic_add=${mysql_cv_func_atomic_add=no}
+
+# nano
+ac_cv_regexec_segfault_emptystr=${ac_cv_regexec_segfault_emptystr=no}
+nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
+
+# php
+ac_cv_pread=${ac_cv_pread=no}
+ac_cv_pwrite=${ac_cv_pwrite=no}
+php_cv_lib_cookie_io_functions_use_off64_t=${php_cv_lib_cookie_io_functions_use_off64_t=yes}
+
+# rsync
+rsync_cv_HAVE_BROKEN_LARGEFILE=${rsync_cv_HAVE_BROKEN_LARGEFILE=no}
+rsync_cv_HAVE_SOCKETPAIR=${rsync_cv_HAVE_SOCKETPAIR=yes}
+rsync_cv_HAVE_LONGLONG=${rsync_cv_HAVE_LONGLONG=yes}
+rsync_cv_HAVE_OFF64_T=${rsync_cv_HAVE_OFF64_T=no}
+rsync_cv_HAVE_SHORT_INO_T=${rsync_cv_HAVE_SHORT_INO_T=no}
+rsync_cv_HAVE_UNSIGNED_CHAR=${rsync_cv_HAVE_UNSIGNED_CHAR=no}
+rsync_cv_HAVE_BROKEN_READDIR=${rsync_cv_HAVE_BROKEN_READDIR=no}
+rsync_cv_HAVE_GETTIMEOFDAY_TZ=${rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+rsync_cv_HAVE_C99_VSNPRINTF=${rsync_cv_HAVE_C99_VSNPRINTF=yes}
+rsync_cv_HAVE_SECURE_MKSTEMP=${rsync_cv_HAVE_SECURE_MKSTEMP=yes}
+rsync_cv_REPLACE_INET_NTOA=${rsync_cv_REPLACE_INET_NTOA=no}
+rsync_cv_REPLACE_INET_ATON=${rsync_cv_REPLACE_INET_ATON=no}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+
+# socat
+ac_cv_ispeed_offset=${ac_cv_ispeed_offset=13}
+sc_cv_termios_ispeed=${sc_cv_termios_ispeed=yes}
+
+# ssh
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_dirent_have_space_d_name=yes}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=yes}
+
+# startup-notification
+lf_cv_sane_realloc=yes
+
+# xffm
+jm_cv_func_working_readdir=yes
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
diff --git a/meta/site/arm-darwin b/meta/site/arm-darwin
new file mode 100644
index 0000000..09ff097
--- /dev/null
+++ b/meta/site/arm-darwin
@@ -0,0 +1,11 @@
+ac_cv_lib_m_sin=${ac_cv_lib_m_sin=yes}
+ac_cv_func_posix_spawn=${ac_cv_func_posix_spawn=no}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=no}
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=no}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=no}
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=no}
+bash_cv_have_mbstate_t=${bash_cv_have_mbstate_t=yes}
+ac_cv_func_strerror_r=${ac_cv_func_strerror_r=no}
+ac_cv_va_copy=${ac_cv_va_copy=yes}
diff --git a/meta/site/arm-darwin8 b/meta/site/arm-darwin8
new file mode 100644
index 0000000..09ff097
--- /dev/null
+++ b/meta/site/arm-darwin8
@@ -0,0 +1,11 @@
+ac_cv_lib_m_sin=${ac_cv_lib_m_sin=yes}
+ac_cv_func_posix_spawn=${ac_cv_func_posix_spawn=no}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=no}
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=no}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=no}
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=no}
+bash_cv_have_mbstate_t=${bash_cv_have_mbstate_t=yes}
+ac_cv_func_strerror_r=${ac_cv_func_strerror_r=no}
+ac_cv_va_copy=${ac_cv_va_copy=yes}
diff --git a/meta/site/arm-linux b/meta/site/arm-linux
new file mode 100644
index 0000000..14b1889
--- /dev/null
+++ b/meta/site/arm-linux
@@ -0,0 +1,160 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_wchar_t=${ac_cv_sizeof_wchar_t=1}
+ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
+ac_cv_sizeof_bool=${ac_cv_sizeof_bool=1}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_int_p=4}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_int_p=${ac_cv_sizeof_int_p=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=4}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_p=${ac_cv_sizeof_long_p=4}
+ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
+ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned=${ac_cv_sizeof_unsigned=4}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_unsigned_long_long=${ac_cv_sizeof_unsigned_long_long=8}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+
+# samba
+samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=${samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes}
+samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=${samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no}
+samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=${samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no}
+samba_cv_HAVE_BROKEN_GETGROUPS=${samba_cv_HAVE_BROKEN_GETGROUPS=no}
+samba_cv_HAVE_BROKEN_LINUX_SENDFILE=${samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes}
+samba_cv_HAVE_BROKEN_READDIR=${samba_cv_HAVE_BROKEN_READDIR=yes}
+samba_cv_HAVE_BROKEN_READDIR_NAME=${samba_cv_HAVE_BROKEN_READDIR_NAME=no}
+samba_cv_HAVE_C99_VSNPRINTF=${samba_cv_HAVE_C99_VSNPRINTF=yes}
+samba_cv_HAVE_DEV64_T=${samba_cv_HAVE_DEV64_T=no}
+samba_cv_HAVE_DEVICE_MAJOR_FN=${samba_cv_HAVE_DEVICE_MAJOR_FN=yes}
+samba_cv_HAVE_DEVICE_MINOR_FN=${samba_cv_HAVE_DEVICE_MINOR_FN=yes}
+samba_cv_HAVE_DQB_FSOFTLIMIT=${samba_cv_HAVE_DQB_FSOFTLIMIT=no}
+samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=${samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes}
+samba_cv_HAVE_FAM_H=${samba_cv_HAVE_FAM_H=no}
+samba_cv_HAVE_FCNTL_LOCK=${samba_cv_HAVE_FCNTL_LOCK=yes}
+samba_cv_HAVE_FTRUNCATE_EXTEND=${samba_cv_HAVE_FTRUNCATE_EXTEND=yes}
+samba_cv_HAVE_FUNCTION_MACRO=${samba_cv_HAVE_FUNCTION_MACRO=yes}
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_HAVE_INO64_T=${samba_cv_HAVE_INO64_T=no}
+samba_cv_HAVE_INT16_FROM_RPC_RPC_H=${samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_INT32_FROM_RPC_RPC_H=${samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_HAVE_MAKEDEV=${samba_cv_HAVE_MAKEDEV=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_NATIVE_ICONV=${samba_cv_HAVE_NATIVE_ICONV=yes}
+samba_cv_HAVE_OFF64_T=${samba_cv_HAVE_OFF64_T=no}
+samba_cv_HAVE_ROOT=${samba_cv_HAVE_ROOT=yes}
+samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=${samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_SOCK_SIN_LEN=${samba_cv_HAVE_SOCK_SIN_LEN=no}
+samba_cv_HAVE_STAT_ST_BLKSIZE=${samba_cv_HAVE_STAT_ST_BLKSIZE=yes}
+samba_cv_HAVE_STAT_ST_BLOCKS=${samba_cv_HAVE_STAT_ST_BLOCKS=yes}
+samba_cv_HAVE_STRUCT_DIR64=${samba_cv_HAVE_STRUCT_DIR64=no}
+samba_cv_HAVE_STRUCT_DIRENT64=${samba_cv_HAVE_STRUCT_DIRENT64=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+samba_cv_HAVE_TRUNCATED_SALT=${samba_cv_HAVE_TRUNCATED_SALT=no}
+samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=${samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=${samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_UNSIGNED_CHAR=${samba_cv_HAVE_UNSIGNED_CHAR=yes}
+samba_cv_HAVE_UTIMBUF=${samba_cv_HAVE_UTIMBUF=yes}
+samba_cv_HAVE_UT_UT_ADDR=${samba_cv_HAVE_UT_UT_ADDR=yes}
+samba_cv_HAVE_UT_UT_EXIT=${samba_cv_HAVE_UT_UT_EXIT=yes}
+samba_cv_HAVE_UT_UT_HOST=${samba_cv_HAVE_UT_UT_HOST=yes}
+samba_cv_HAVE_UT_UT_ID=${samba_cv_HAVE_UT_UT_ID=yes}
+samba_cv_HAVE_UT_UT_NAME=${samba_cv_HAVE_UT_UT_NAME=yes}
+samba_cv_HAVE_UT_UT_PID=${samba_cv_HAVE_UT_UT_PID=yes}
+samba_cv_HAVE_UT_UT_TIME=${samba_cv_HAVE_UT_UT_TIME=yes}
+samba_cv_HAVE_UT_UT_TV=${samba_cv_HAVE_UT_UT_TV=yes}
+samba_cv_HAVE_UT_UT_TYPE=${samba_cv_HAVE_UT_UT_TYPE=yes}
+samba_cv_HAVE_UT_UT_USER=${samba_cv_HAVE_UT_UT_USER=yes}
+samba_cv_HAVE_UX_UT_SYSLEN=${samba_cv_HAVE_UX_UT_SYSLEN=no}
+samba_cv_HAVE_VA_COPY=${samba_cv_HAVE_VA_COPY=yes}
+samba_cv_HAVE_WORKING_AF_LOCAL=${samba_cv_HAVE_WORKING_AF_LOCAL=yes}
+samba_cv_HAVE_Werror=${samba_cv_HAVE_Werror=yes}
+samba_cv_PUTUTLINE_RETURNS_UTMP=${samba_cv_PUTUTLINE_RETURNS_UTMP=yes}
+samba_cv_QUOTA_WORKS=${samba_cv_QUOTA_WORKS=yes}
+samba_cv_REALPATH_TAKES_NULL=${samba_cv_REALPATH_TAKES_NULL=yes}
+samba_cv_REPLACE_GETPASS=${samba_cv_REPLACE_GETPASS=yes}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+samba_cv_REPLACE_READDIR=${samba_cv_REPLACE_READDIR=no}
+samba_cv_RUN_QUOTA_TESTS=${samba_cv_RUN_QUOTA_TESTS=yes}
+samba_cv_SEEKDIR_RETURNS_VOID=${samba_cv_SEEKDIR_RETURNS_VOID=yes}
+samba_cv_SIZEOF_DEV_T=${samba_cv_SIZEOF_DEV_T=yes}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_SYSCONF_SC_NGROUPS_MAX=${samba_cv_SYSCONF_SC_NGROUPS_MAX=yes}
+samba_cv_SYSCONF_SC_NPROCESSORS_ONLN=${samba_cv_SYSCONF_SC_NPROCESSORS_ONLN=yes}
+samba_cv_SYSCONF_SC_NPROC_ONLN=${samba_cv_SYSCONF_SC_NPROC_ONLN=no}
+samba_cv_SYSCONF_SC_PAGESIZE=${samba_cv_SYSCONF_SC_PAGESIZE=yes}
+samba_cv_SYSQUOTA_FOUND=${samba_cv_SYSQUOTA_FOUND=yes}
+samba_cv_SYSQUOTA_WORKS=${samba_cv_SYSQUOTA_WORKS=yes}
+samba_cv_SYSQUOTA_WORKS_XFS=${samba_cv_SYSQUOTA_WORKS_XFS=yes}
+samba_cv_TRY_QUOTAS=${samba_cv_TRY_QUOTAS=no}
+samba_cv_TRY_SYS_QUOTAS=${samba_cv_TRY_SYS_QUOTAS=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_WE_USE_SYS_QUOTAS=${samba_cv_WE_USE_SYS_QUOTAS=yes}
+samba_cv_WITH_AFS=${samba_cv_WITH_AFS=no}
+samba_cv_WITH_FAKE_KASERVER=${samba_cv_WITH_FAKE_KASERVER=no}
+samba_cv_WITH_QUOTAS=${samba_cv_WITH_QUOTAS=auto}
+samba_cv_WITH_SYS_QUOTAS=${samba_cv_WITH_SYS_QUOTAS=auto}
+samba_cv_WITH_VFS_AFSACL=${samba_cv_WITH_VFS_AFSACL=no}
+samba_cv_compiler_supports_ll=${samba_cv_compiler_supports_ll=yes}
+samba_cv_found_xfs_header=${samba_cv_found_xfs_header=yes}
+samba_cv_have_longlong=${samba_cv_have_longlong=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_immediate_structures=${samba_cv_immediate_structures=yes}
+samba_cv_optimize_out_funcation_calls=${samba_cv_optimize_out_funcation_calls=yes}
+samba_cv_sig_atomic_t=${samba_cv_sig_atomic_t=yes}
+samba_cv_socklen_t=${samba_cv_socklen_t=yes}
+samba_cv_struct_timespec=${samba_cv_struct_timespec=yes}
+samba_cv_sysquotas_file=${samba_cv_sysquotas_file=lib/sysquotas_linux.c}
+samba_cv_unixsocket=${samba_cv_unixsocket=yes}
+samba_cv_volatile=${samba_cv_volatile=yes}
+
+#older sambe defines
+samba_cv_USE_SETEUID=${samba_cv_USE_SETEUID=yes}
+samba_cv_USE_SETREUID=${samba_cv_USE_SETREUID=yes}
+samba_cv_USE_SETUIDX=${samba_cv_USE_SETUIDX=yes}
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
+
+# clamav
+clamav_av_func_working_snprintf_long=${clamav_av_func_working_snprintf_long=yes}
+clamav_av_have_in_port_t=${clamav_av_have_in_port_t=yes}
+clamav_av_have_in_addr_t=${clamav_av_have_in_addr_t=yes}
+ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=yes}
+
+#dbus
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
+
+# lftp
+ac_cv_file___dev_ptc_=yes
+
+# guile
+ac_cv_func_pthread_attr_getstack=${ac_cv_func_pthread_attr_getstack=yes}
+
+# gnet
+ac_cv_member_struct_sockaddr_sa_len=${ac_cv_member_struct_sockaddr_sa_len=no}
+ac_cv_gnet_have_abstract_sockets=${ac_cv_gnet_have_abstract_sockets=no}
+gnet_sockaddr_family_field_name=${gnet_sockaddr_family_field_name=ss_family}
diff --git a/meta/site/arm-linux-uclibc b/meta/site/arm-linux-uclibc
new file mode 100644
index 0000000..6ae7c6e
--- /dev/null
+++ b/meta/site/arm-linux-uclibc
@@ -0,0 +1,105 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+
+# samba
+samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=${samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes}
+samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=${samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no}
+samba_cv_FTRUNCATE_NEEDS_ROOT=${samba_cv_FTRUNCATE_NEEDS_ROOT=no}
+samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=${samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no}
+samba_cv_HAVE_BROKEN_GETGROUPS=${samba_cv_HAVE_BROKEN_GETGROUPS=no}
+samba_cv_HAVE_BROKEN_LINUX_SENDFILE=${samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes}
+samba_cv_HAVE_BROKEN_READDIR=${samba_cv_HAVE_BROKEN_READDIR=no}
+samba_cv_HAVE_C99_VSNPRINTF=${samba_cv_HAVE_C99_VSNPRINTF=yes}
+samba_cv_HAVE_DEV64_T=${samba_cv_HAVE_DEV64_T=no}
+samba_cv_HAVE_DEVICE_MAJOR_FN=${samba_cv_HAVE_DEVICE_MAJOR_FN=yes}
+samba_cv_HAVE_DEVICE_MINOR_FN=${samba_cv_HAVE_DEVICE_MINOR_FN=yes}
+samba_cv_HAVE_DQB_FSOFTLIMIT=${samba_cv_HAVE_DQB_FSOFTLIMIT=no}
+samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=${samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes}
+samba_cv_HAVE_FCNTL_LOCK=${samba_cv_HAVE_FCNTL_LOCK=yes}
+samba_cv_HAVE_FTRUNCATE_EXTEND=${samba_cv_HAVE_FTRUNCATE_EXTEND=yes}
+samba_cv_HAVE_FUNCTION_MACRO=${samba_cv_HAVE_FUNCTION_MACRO=yes}
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_HAVE_INO64_T=${samba_cv_HAVE_INO64_T=no}
+samba_cv_HAVE_INT16_FROM_RPC_RPC_H=${samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_INT32_FROM_RPC_RPC_H=${samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_NATIVE_ICONV=${samba_cv_HAVE_NATIVE_ICONV=yes}
+samba_cv_HAVE_OFF64_T=${samba_cv_HAVE_OFF64_T=no}
+samba_cv_HAVE_QUOTACTL_4A=${samba_cv_HAVE_QUOTACTL_4A=yes}
+samba_cv_HAVE_ROOT=${samba_cv_HAVE_ROOT=no}
+samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=${samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=no}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=no}
+samba_cv_HAVE_SOCK_SIN_LEN=${samba_cv_HAVE_SOCK_SIN_LEN=no}
+samba_cv_HAVE_STAT_ST_BLKSIZE=${samba_cv_HAVE_STAT_ST_BLKSIZE=yes}
+samba_cv_HAVE_STAT_ST_BLOCKS=${samba_cv_HAVE_STAT_ST_BLOCKS=yes}
+samba_cv_HAVE_STRUCT_DIRENT64=${samba_cv_HAVE_STRUCT_DIRENT64=no}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+samba_cv_HAVE_STRUCT_IF_DQBLK=${samba_cv_HAVE_STRUCT_IF_DQBLK=no}
+samba_cv_HAVE_STRUCT_MEM_DQBLK=${samba_cv_HAVE_STRUCT_MEM_DQBLK=no}
+samba_cv_HAVE_TRUNCATED_SALT=${samba_cv_HAVE_TRUNCATED_SALT=no}
+samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=${samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=${samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no}
+samba_cv_HAVE_UNSIGNED_CHAR=${samba_cv_HAVE_UNSIGNED_CHAR=yes}
+samba_cv_HAVE_UTIMBUF=${samba_cv_HAVE_UTIMBUF=yes}
+samba_cv_HAVE_UT_UT_ADDR=${samba_cv_HAVE_UT_UT_ADDR=yes}
+samba_cv_HAVE_UT_UT_EXIT=${samba_cv_HAVE_UT_UT_EXIT=yes}
+samba_cv_HAVE_UT_UT_HOST=${samba_cv_HAVE_UT_UT_HOST=yes}
+samba_cv_HAVE_UT_UT_ID=${samba_cv_HAVE_UT_UT_ID=yes}
+samba_cv_HAVE_UT_UT_NAME=${samba_cv_HAVE_UT_UT_NAME=yes}
+samba_cv_HAVE_UT_UT_PID=${samba_cv_HAVE_UT_UT_PID=yes}
+samba_cv_HAVE_UT_UT_TIME=${samba_cv_HAVE_UT_UT_TIME=yes}
+samba_cv_HAVE_UT_UT_TV=${samba_cv_HAVE_UT_UT_TV=yes}
+samba_cv_HAVE_UT_UT_TYPE=${samba_cv_HAVE_UT_UT_TYPE=yes}
+samba_cv_HAVE_UT_UT_USER=${samba_cv_HAVE_UT_UT_USER=yes}
+samba_cv_HAVE_UX_UT_SYSLEN=${samba_cv_HAVE_UX_UT_SYSLEN=no}
+samba_cv_HAVE_VA_COPY=${samba_cv_HAVE_VA_COPY=yes}
+samba_cv_HAVE_WORKING_AF_LOCAL=${samba_cv_HAVE_WORKING_AF_LOCAL=no}
+samba_cv_HAVE_Werror=${samba_cv_HAVE_Werror=yes}
+samba_cv_PUTUTLINE_RETURNS_UTMP=${samba_cv_PUTUTLINE_RETURNS_UTMP=yes}
+samba_cv_QUOTA_WORKS=${samba_cv_QUOTA_WORKS=yes}
+samba_cv_REPLACE_GETPASS=${samba_cv_REPLACE_GETPASS=yes}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+samba_cv_RUN_QUOTA_TESTS=${samba_cv_RUN_QUOTA_TESTS=auto}
+samba_cv_SEEKDIR_RETURNS_VOID=${samba_cv_SEEKDIR_RETURNS_VOID=yes}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_SYSCONF_SC_NGROUPS_MAX=${samba_cv_SYSCONF_SC_NGROUPS_MAX=yes}
+samba_cv_SYSQUOTA_FOUND=${samba_cv_SYSQUOTA_FOUND=yes}
+samba_cv_SYSQUOTA_WORKS=${samba_cv_SYSQUOTA_WORKS=yes}
+samba_cv_TRY_QUOTAS=${samba_cv_TRY_QUOTAS=no}
+samba_cv_TRY_SYS_QUOTAS=${samba_cv_TRY_SYS_QUOTAS=no}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_WITH_QUOTAS=${samba_cv_WITH_QUOTAS=auto}
+samba_cv_WITH_SYS_QUOTAS=${samba_cv_WITH_SYS_QUOTAS=auto}
+samba_cv_compiler_supports_ll=${samba_cv_compiler_supports_ll=yes}
+samba_cv_have_longlong=${samba_cv_have_longlong=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_immediate_structures=${samba_cv_immediate_structures=yes}
+samba_cv_optimize_out_funcation_calls=${samba_cv_optimize_out_funcation_calls=yes}
+samba_cv_sig_atomic_t=${samba_cv_sig_atomic_t=yes}
+samba_cv_socklen_t=${samba_cv_socklen_t=yes}
+samba_cv_unixsocket=${samba_cv_unixsocket=yes}
+samba_cv_volatile=${samba_cv_volatile=yes}
diff --git a/meta/site/armeb-linux b/meta/site/armeb-linux
new file mode 100644
index 0000000..6521ff5
--- /dev/null
+++ b/meta/site/armeb-linux
@@ -0,0 +1,43 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
+ac_cv_sizeof_unsigned=${ac_cv_sizeof_unsigned=4}
+ac_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_USE_SETEUID=${samba_cv_USE_SETEUID=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_USE_SETREUID=${samba_cv_USE_SETREUID=yes}
+samba_cv_USE_SETUIDX=${samba_cv_USE_SETUIDX=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
+samba_cv_STAT_STATVFS64=${samba_cv_STAT_STATVFS64=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
diff --git a/meta/site/armeb-linux-uclibc b/meta/site/armeb-linux-uclibc
new file mode 100644
index 0000000..731e857
--- /dev/null
+++ b/meta/site/armeb-linux-uclibc
@@ -0,0 +1,38 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
+ac_cv_sizeof_unsigned=${ac_cv_sizeof_unsigned=4}
+ac_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_USE_SETEUID=${samba_cv_USE_SETEUID=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_USE_SETREUID=${samba_cv_USE_SETREUID=yes}
+samba_cv_USE_SETUIDX=${samba_cv_USE_SETUIDX=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
diff --git a/meta/site/common b/meta/site/common
new file mode 100644
index 0000000..5ccc14f
--- /dev/null
+++ b/meta/site/common
@@ -0,0 +1,21 @@
+# libelf
+mr_cv_target_elf=${mr_cv_target_elf=yes}
+
+# Normally kernels have /dev/random enabled
+ac_cv_file__dev_random=${ac_cv_file__dev_random=yes}
+
+# Avoid sudo to assume void for unsetenv in cross environment, or else it conflicts with
+# target stdlib.h prototype which follows POSIX compiliance. Mark for upstream.
+sudo_cv_func_unsetenv_void=no
+
+# shadow dir info, to avoid searching build system
+shadow_cv_maildir=${localstatedir}/spool/mail
+shadow_cv_mailfile=Mailbox
+shadow_cv_utmpdir=${localstatedir}/run
+shadow_cv_logdir=${localstatedir}/log
+shadow_cv_passwd_dir=${bindir}
+
+# python: deactivate a runtime check for ipv6-support in python >=2.7.1 that fails when cross-compiling
+ac_cv_buggy_getaddrinfo=no
+
+ac_cv_path_SED=sed
diff --git a/meta/site/common-darwin b/meta/site/common-darwin
new file mode 100644
index 0000000..7d2d898
--- /dev/null
+++ b/meta/site/common-darwin
@@ -0,0 +1,2 @@
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
diff --git a/meta/site/common-glibc b/meta/site/common-glibc
new file mode 100644
index 0000000..1443f8e
--- /dev/null
+++ b/meta/site/common-glibc
@@ -0,0 +1,86 @@
+# general
+ac_cv_have_decl_sys_siglist=${ac_cv_have_decl_sys_siglist=yes}
+ac_cv_func_realloc_works=${ac_cv_func_realloc_works=yes}
+ac_cv_func_realloc_0_nonnull=${ac_cv_func_realloc_0_nonnull=yes}
+ac_cv_func_malloc_works=${ac_cv_func_malloc_works=yes}
+ac_cv_func_malloc_0_nonnull=${ac_cv_func_malloc_0_nonnull=yes}
+ac_cv_func_memcmp_working=${ac_cv_func_memcmp_working=yes}
+ac_cv_func_getpgrp_void=yes
+ac_cv_func_setpgrp_void=yes
+ac_cv_func_setgrent_void=yes
+ac_cv_func_getgrgid_r=${ac_cv_func_getgrgid_r=yes}
+ac_cv_func_getpwuid_r=${ac_cv_func_getpwuid_r=yes}
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
+ac_cv_type_uid_t={ac_cv_type_uid_t=yes}
+ac_cv_func_getaddrinfo=${ac_cv_func_getaddrinfo=yes}
+
+# bash
+bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist=yes}
+bash_cv_sys_siglist=${bash_cv_sys_siglist=yes}
+bash_cv_getcwd_malloc=${bash_cv_getcwd_malloc=yes}
+
+# clamav
+clamav_av_func_working_snprintf_long=${clamav_av_func_working_snprintf_long=yes}
+clamav_av_have_in_port_t=${clamav_av_have_in_port_t=yes}
+clamav_av_have_in_addr_t=${clamav_av_have_in_addr_t=yes}
+ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=yes}
+
+# coreutils
+fu_cv_sys_stat_statfs2_bsize=${fu_cv_sys_stat_statfs2_bsize=yes}
+
+# glib
+glib_cv_strlcpy=${glib_cv_strlcpy=no}
+ac_cv_func_printf_unix98=${ac_cv_func_printf_unix98=yes}
+ac_cv_func_snprintf_c99=${ac_cv_func_snprintf_c99=yes}
+ac_cv_func_vsnprintf_c99=${ac_cv_func_vsnprintf_c99=yes}
+glib_cv_compliant_posix_memalign=${glib_cv_compliant_posix_memalign=1}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+# glib-1.x requires this and pkgconfig-native / pkgconfig-nativesdk use
+# that to avoid a dependency loop.
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_va_copy=${glib_cv_va_copy=yes}
+glib_cv_have_qsort_r=${glib_cv_have_qsort_r=yes}
+
+#dbus-glib
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
+
+# gnucash
+am_cv_scanf_lld=${am_cv_scanf_lld=yes}
+
+# guile
+ac_cv_func_pthread_attr_getstack=${ac_cv_func_pthread_attr_getstack=yes}
+
+#gcc-zlib
+ac_cv_func_getpagesize=${ac_cv_func_getpagesize=yes}
+ac_cv_func_memcpy=${ac_cv_func_memcpy=yes}
+ac_cv_func_strerror=${ac_cv_func_strerror=yes}
+
+# squid
+ac_cv_af_unix_large_dgram=${ac_cv_af_unix_large_dgram=yes}
+ac_cv_func_setresuid=${ac_cv_func_setresuid=yes}
+ac_cv_func_va_copy=${ac_cv_func_va_copy=yes}
+ac_cv_func___va_copy=${ac_cv_func___va_copy=yes}
+ac_cv_epoll_works=${ac_cv_epoll_works=yes}
+
+ac_cv_check_sjlj=ssjlj
+
+# m4
+gt_cv_locale_fr=${gt_cv_locale_fr=fr_FR}
+gl_cv_func_btowc_eof=${gl_cv_func_btowc_eof=yes}
+gl_cv_func_wcrtomb_retval=${gl_cv_func_wcrtomb_retval=yes}
+gl_cv_func_wctob_works=${gl_cv_func_wctob_works=yes}
+gl_cv_func_mbrtowc_incomplete_state=${gl_cv_func_mbrtowc_incomplete_state=yes}
+gl_cv_func_mbrtowc_sanitycheck=${gl_cv_func_mbrtowc_sanitycheck=yes}
+gl_cv_func_mbrtowc_null_arg=${gl_cv_func_mbrtowc_null_arg=yes}
+gl_cv_func_mbrtowc_retval=${gl_cv_func_mbrtowc_retval=yes}
+gl_cv_func_mbrtowc_nul_retval=${gl_cv_func_mbrtowc_nul_retval=yes}
+
+# va_copy and _va_copy
+ac_cv_va_copy=${ac_cv_va_copy=yes}
+ac_cv___va_copy=${ac_cv___va_copy=yes}
+ac_cv_func_va_copy=${ac_cv_func_va_copy=yes}
+ac_cv_func___va_copy=${ac_cv_func___va_copy=yes}
+
+# Xorg
+xorg_cv_malloc0_returns_null=${xorg_cv_malloc0_returns_null=yes}
diff --git a/meta/site/common-linux b/meta/site/common-linux
new file mode 100644
index 0000000..8b5be68
--- /dev/null
+++ b/meta/site/common-linux
@@ -0,0 +1,52 @@
+# apr
+ac_cv_file__dev_zero=${ac_cv_file__dev_zero=yes}
+ac_cv_sizeof_pid_t=${ac_cv_sizeof_pid_t=4}
+
+# samba
+samba_cv_HAVE_IFACE_AIX=${samba_cv_HAVE_IFACE_AIX=no}
+samba_cv_HAVE_IFACE_IFCONF=${samba_cv_HAVE_IFACE_IFCONF=yes}
+samba_cv_HAVE_IFACE_IFREQ=${samba_cv_HAVE_IFACE_IFREQ=yes}
+samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=${samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no}
+
+# db
+db_cv_path_ar=${db_cv_path_ar=/usr/bin/ar}
+db_cv_path_chmod=${db_cv_path_chmod=/bin/chmod}
+db_cv_path_cp=${db_cv_path_cp=/bin/cp}
+db_cv_path_ln=${db_cv_path_ln=/bin/ln}
+db_cv_path_mkdir=${db_cv_path_mkdir=/bin/mkdir}
+db_cv_path_ranlib=${db_cv_path_ranlib=/usr/bin/ranlib}
+db_cv_path_rm=${db_cv_path_rm=/bin/rm}
+db_cv_path_sh=${db_cv_path_sh=/bin/sh}
+db_cv_path_strip=${db_cv_path_strip=/usr/bin/strip}
+
+# bash
+bash_cv_have_mbstate_t=${bash_cv_have_mbstate_t=yes}
+bash_cv_must_reinstall_sighandlers=${bash_cv_must_reinstall_sighandlers=no}
+bash_cv_func_strcoll_broken=${bash_cv_func_strcoll_broken=no}
+bash_cv_dup2_broken=${bash_cv_dup2_broken=no}
+bash_cv_opendir_not_robust=${bash_cv_opendir_not_robust=no}
+bash_cv_type_rlimit=${bash_cv_type_rlimit=rlim_t}
+bash_cv_getenv_redef=${bash_cv_getenv_redef=yes}
+bash_cv_ulimit_maxfds=${bash_cv_ulimit_maxfds=yes}
+bash_cv_getcwd_calls_popen=${bash_cv_getcwd_calls_popen=no}
+bash_cv_printf_a_format=${bash_cv_printf_a_format=yes}
+bash_cv_pgrp_pipe=${bash_cv_pgrp_pipe=no}
+bash_cv_job_control_missing=${bash_cv_job_control_missing=present}
+bash_cv_sys_named_pipes=${bash_cv_sys_named_pipes=present}
+bash_cv_unusable_rtsigs=${bash_cv_unusable_rtsigs=no}
+
+# coreutils
+gl_cv_func_fstatat_zero_flag=${gl_cv_func_fstatat_zero_flag=yes}
+
+# mysql
+ac_cv_sys_restartable_syscalls=${ac_cv_sys_restartable_syscalls=yes}
+ac_cv_conv_longlong_to_float=${ac_cv_conv_longlong_to_float=yes}
+
+# TCL
+tcl_cv_api_serial=${tcl_cv_api_serial=termios}
+
+# python
+ac_cv_have_long_long_format=yes
+
+# apache
+ac_cv_o_nonblock_inherited=${ac_cv_o_nonblock_inherited=no}
diff --git a/meta/site/common-mingw b/meta/site/common-mingw
new file mode 100644
index 0000000..f337c36
--- /dev/null
+++ b/meta/site/common-mingw
@@ -0,0 +1,2 @@
+# expat
+ac_cv_func_mmap_fixed_mapped=no
diff --git a/meta/site/common-musl b/meta/site/common-musl
new file mode 100644
index 0000000..26fc103
--- /dev/null
+++ b/meta/site/common-musl
@@ -0,0 +1,52 @@
+# general
+ac_cv_have_decl_sys_siglist=${ac_cv_have_decl_sys_siglist=no}
+ac_cv_func_realloc_works=${ac_cv_func_realloc_works=yes}
+ac_cv_func_realloc_0_nonnull=${ac_cv_func_realloc_0_nonnull=yes}
+ac_cv_func_malloc_works=${ac_cv_func_malloc_works=yes}
+ac_cv_func_malloc_0_nonnull=${ac_cv_func_malloc_0_nonnull=yes}
+ac_cv_func_getpgrp_void=yes
+ac_cv_func_setpgrp_void=yes
+ac_cv_func_setgrent_void=yes
+ac_cv_func_getgrgid_r=${ac_cv_func_getgrgid_r=yes}
+ac_cv_func_getpwuid_r=${ac_cv_func_getpwuid_r=yes}
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
+ac_cv_func_getaddrinfo=${ac_cv_func_getaddrinfo=yes}
+
+# glib
+glib_cv_strlcpy=${glib_cv_strlcpy=no}
+ac_cv_func_printf_unix98=${ac_cv_func_printf_unix98=yes}
+ac_cv_func_snprintf_c99=${ac_cv_func_snprintf_c99=yes}
+ac_cv_func_vsnprintf_c99=${ac_cv_func_vsnprintf_c99=yes}
+glib_cv_compliant_posix_memalign=${glib_cv_compliant_posix_memalign=1}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_have_qsort_r=${glib_cv_have_qsort_r=no}
+
+#dbus-glib
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
+
+# bash
+bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist=no}
+bash_cv_sys_siglist=${bash_cv_sys_siglist=no}
+
+# coreutils
+fu_cv_sys_stat_statfs2_bsize=${fu_cv_sys_stat_statfs2_bsize=yes}
+gl_cv_func_gettimeofday_clobber=${gl_cv_func_gettimeofday_clobber=no}
+gl_cv_func_tzset_clobber=${gl_cv_func_tzset_clobber=no}
+gl_cv_func_gettimeofday_posix_signature=${gl_cv_func_gettimeofday_posix_signature=yes}
+ac_cv_func_posix_spawn=${ac_cv_func_posix_spawn=yes}
+ac_cv_func_posix_spawn_works=${ac_cv_func_posix_spawn_works=yes}
+
+# va_copy and _va_copy
+ac_cv_va_copy=${ac_cv_va_copy=yes}
+ac_cv___va_copy=${ac_cv___va_copy=yes}
+ac_cv_func_va_copy=${ac_cv_func_va_copy=yes}
+ac_cv_func___va_copy=${ac_cv_func___va_copy=yes}
+
+# posix_getpwuid_r posix_getgrgid_r posix_getpwnam_r
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# Xorg
+xorg_cv_malloc0_returns_null=${xorg_cv_malloc0_returns_null=yes}
diff --git a/meta/site/common-uclibc b/meta/site/common-uclibc
new file mode 100644
index 0000000..26fc103
--- /dev/null
+++ b/meta/site/common-uclibc
@@ -0,0 +1,52 @@
+# general
+ac_cv_have_decl_sys_siglist=${ac_cv_have_decl_sys_siglist=no}
+ac_cv_func_realloc_works=${ac_cv_func_realloc_works=yes}
+ac_cv_func_realloc_0_nonnull=${ac_cv_func_realloc_0_nonnull=yes}
+ac_cv_func_malloc_works=${ac_cv_func_malloc_works=yes}
+ac_cv_func_malloc_0_nonnull=${ac_cv_func_malloc_0_nonnull=yes}
+ac_cv_func_getpgrp_void=yes
+ac_cv_func_setpgrp_void=yes
+ac_cv_func_setgrent_void=yes
+ac_cv_func_getgrgid_r=${ac_cv_func_getgrgid_r=yes}
+ac_cv_func_getpwuid_r=${ac_cv_func_getpwuid_r=yes}
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
+ac_cv_func_getaddrinfo=${ac_cv_func_getaddrinfo=yes}
+
+# glib
+glib_cv_strlcpy=${glib_cv_strlcpy=no}
+ac_cv_func_printf_unix98=${ac_cv_func_printf_unix98=yes}
+ac_cv_func_snprintf_c99=${ac_cv_func_snprintf_c99=yes}
+ac_cv_func_vsnprintf_c99=${ac_cv_func_vsnprintf_c99=yes}
+glib_cv_compliant_posix_memalign=${glib_cv_compliant_posix_memalign=1}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_have_qsort_r=${glib_cv_have_qsort_r=no}
+
+#dbus-glib
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
+
+# bash
+bash_cv_under_sys_siglist=${bash_cv_under_sys_siglist=no}
+bash_cv_sys_siglist=${bash_cv_sys_siglist=no}
+
+# coreutils
+fu_cv_sys_stat_statfs2_bsize=${fu_cv_sys_stat_statfs2_bsize=yes}
+gl_cv_func_gettimeofday_clobber=${gl_cv_func_gettimeofday_clobber=no}
+gl_cv_func_tzset_clobber=${gl_cv_func_tzset_clobber=no}
+gl_cv_func_gettimeofday_posix_signature=${gl_cv_func_gettimeofday_posix_signature=yes}
+ac_cv_func_posix_spawn=${ac_cv_func_posix_spawn=yes}
+ac_cv_func_posix_spawn_works=${ac_cv_func_posix_spawn_works=yes}
+
+# va_copy and _va_copy
+ac_cv_va_copy=${ac_cv_va_copy=yes}
+ac_cv___va_copy=${ac_cv___va_copy=yes}
+ac_cv_func_va_copy=${ac_cv_func_va_copy=yes}
+ac_cv_func___va_copy=${ac_cv_func___va_copy=yes}
+
+# posix_getpwuid_r posix_getgrgid_r posix_getpwnam_r
+ac_cv_func_posix_getpwuid_r=${ac_cv_func_posix_getpwuid_r=yes}
+ac_cv_func_posix_getgrgid_r=${ac_cv_func_posix_getgrgid_r=yes}
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# Xorg
+xorg_cv_malloc0_returns_null=${xorg_cv_malloc0_returns_null=yes}
diff --git a/meta/site/endian-big b/meta/site/endian-big
new file mode 100644
index 0000000..b99e96c
--- /dev/null
+++ b/meta/site/endian-big
@@ -0,0 +1,8 @@
+ac_cv_c_littleendian=${ac_cv_c_littleendian=no}
+ac_cv_c_bigendian=${ac_cv_c_bigendian=yes}
+
+# libnet
+ac_cv_libnet_endianess=${ac_cv_libnet_endianess=big}
+
+# libmemcached
+ac_cv_c_endian=big
diff --git a/meta/site/endian-little b/meta/site/endian-little
new file mode 100644
index 0000000..858db76
--- /dev/null
+++ b/meta/site/endian-little
@@ -0,0 +1,8 @@
+ac_cv_c_littleendian=${ac_cv_c_littleendian=yes}
+ac_cv_c_bigendian=${ac_cv_c_bigendian=no}
+
+# libnet
+ac_cv_libnet_endianess=${ac_cv_libnet_endianess=lil}
+
+# libmemcached
+ac_cv_c_endian=little
diff --git a/meta/site/ix86-common b/meta/site/ix86-common
new file mode 100644
index 0000000..5cd2ce2
--- /dev/null
+++ b/meta/site/ix86-common
@@ -0,0 +1,232 @@
+# general
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
+ac_cv_sizeof_unsigned_char_p=${ac_cv_sizeof_unsigned_char_p=4}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_int_p=${ac_cv_sizeof_int_p=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_unsigned_long_long=${ac_cv_sizeof_unsigned_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_p=${ac_cv_sizeof_long_p=4}
+ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
+ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=4}
+ac_cv_sizeof_uid_t=${ac_cv_sizeof_uid_t=4}
+ac_cv_sizeof_gid_t=${ac_cv_sizeof_gid_t=4}
+ac_cv_sizeof_ino_t=${ac_cv_sizeof_ino_t=4}
+ac_cv_sizeof_dev_t=${ac_cv_sizeof_dev_t=8}
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_pthread_key_delete=${ac_cv_func_pthread_key_delete=yes}
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+
+ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no}
+ac_cv_header_netinet_sctp_uio_h=${ac_cv_header_netinet_sctp_uio_h=no}
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+ac_cv_sctp=${ac_cv_sctp=no}
+
+apr_cv_process_shared_works=${apr_cv_process_shared_works=no}
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+
+ac_cv_path_ESD_CONFIG=no
+lf_cv_sane_realloc=yes
+jm_cv_func_gettimeofday_clobber=no
+samba_cv_HAVE_GETTIMEOFDAY_TZ=yes
+bf_lsbf=1
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+# audacity
+ac_cv_file_lib_src_libmad_frame_h=${ac_cv_file_lib_src_libmad_frame_h=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=missing}
+
+# clamav
+clamav_av_func_working_snprintf_long=${clamav_av_func_working_snprintf_long=yes}
+clamav_av_have_in_port_t=${clamav_av_have_in_port_t=yes}
+clamav_av_have_in_addr_t=${clamav_av_have_in_addr_t=yes}
+ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=yes}
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# db
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# ettercap
+ettercap_cv_type_socklen_t=${ettercap_cv_type_socklen_t=yes}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# glib
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=yes}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=4
+ac_cv_alignof_unsigned_long=4
+
+# guile
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# jikes-native
+ac_cv_sizeof_wchar_t=4
+
+# lftp
+ac_cv_need_trio=${ac_cv_need_trio=no}
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# libnet 
+ac_cv_lbl_unaligned_fail=${ac_cv_lbl_unaligned_fail=no}
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
+
+# libxfce4util
+with_broken_putenv=${with_broken_putenv=no}
+
+# mysql
+mysql_cv_func_atomic_sub=${mysql_cv_func_atomic_sub=yes}
+mysql_cv_func_atomic_add=${mysql_cv_func_atomic_add=yes}
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=4
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=4
+ac_cv_alignof_CORBA_long_long=4
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=4
+ac_cv_alignof_CORBA_wchar=2
+
+# php
+ac_cv_pread=${ac_cv_pread=no}
+ac_cv_pwrite=${ac_cv_pwrite=no}
+php_cv_lib_cookie_io_functions_use_off64_t=${php_cv_lib_cookie_io_functions_use_off64_t=yes}
+
+# rsync
+rsync_cv_HAVE_BROKEN_LARGEFILE=${rsync_cv_HAVE_BROKEN_LARGEFILE=no}
+rsync_cv_HAVE_SOCKETPAIR=${rsync_cv_HAVE_SOCKETPAIR=yes}
+rsync_cv_HAVE_LONGLONG=${rsync_cv_HAVE_LONGLONG=yes}
+rsync_cv_HAVE_OFF64_T=${rsync_cv_HAVE_OFF64_T=no}
+rsync_cv_HAVE_SHORT_INO_T=${rsync_cv_HAVE_SHORT_INO_T=no}
+rsync_cv_HAVE_UNSIGNED_CHAR=${rsync_cv_HAVE_UNSIGNED_CHAR=no}
+rsync_cv_HAVE_BROKEN_READDIR=${rsync_cv_HAVE_BROKEN_READDIR=no}
+rsync_cv_HAVE_GETTIMEOFDAY_TZ=${rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+rsync_cv_HAVE_C99_VSNPRINTF=${rsync_cv_HAVE_C99_VSNPRINTF=yes}
+rsync_cv_HAVE_SECURE_MKSTEMP=${rsync_cv_HAVE_SECURE_MKSTEMP=yes}
+rsync_cv_REPLACE_INET_NTOA=${rsync_cv_REPLACE_INET_NTOA=no}
+rsync_cv_REPLACE_INET_ATON=${rsync_cv_REPLACE_INET_ATON=no}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+
+# ssh
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_dirent_have_space_d_name=yes}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_type_struct_timespec=${ac_cv_type_struct_timespec=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=yes}
+
+# startup-notification
+lf_cv_sane_realloc=yes
+
+# xffm
+jm_cv_func_working_readdir=yes
+
+# xorg X11R7
+ac_cv_sys_linker_h=${ac_cv_sys_linker_h=no}
+ac_cv_file__usr_share_X11_sgml_defs_ent=${ac_cv_file__usr_share_X11_sgml_defs_ent=no}
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
+#dbus
+ac_cv_have_abstract_sockets=${ac_cv_have_abstract_sockets=yes}
+
+#libpciaccess
+have_mtrr_h=yes
+
+#mozilla
+moz_cv_size_of_JS_BYTES_PER_WORD=4
+moz_cv_align_of_JS_ALIGN_OF_POINTER=4
+moz_cv_size_of_JS_BYTES_PER_DOUBLE=8
+
+#ofono
+ac_cv_lib_c_signalfd=${ac_cv_lib_c_signalfd=yes}
+
+#unfs3
+nfsd_cv_broken_setfsuid=${nfsd_cv_broken_setfsuid=0}
+nfsd_cv_func_statfs=${nfsd_cv_func_statfs=statfs2_bsize}
+nfsd_cv_bsd_signals=${nfsd_cv_bsd_signals=yes}
+
+# at-spi2-core
+ac_cv_alignof_char=1
+ac_cv_alignof_dbind_pointer=4
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=4
+ac_cv_alignof_double=4
diff --git a/meta/site/mips-common b/meta/site/mips-common
new file mode 100644
index 0000000..89d72cb
--- /dev/null
+++ b/meta/site/mips-common
@@ -0,0 +1,56 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+# ORBit2
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_wchar=2
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_long=8
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_double=8
+ac_cv_alignof_CORBA_long_double=8
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_struct=1
+
+# apache
+ac_cv_func_pthread_key_delete=${ac_cv_func_pthread_key_delete=yes}
+apr_cv_process_shared_works=${apr_cv_process_shared_works=no}
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+
+# glib
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=4
+
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+
+# at-spi2-core
+ac_cv_alignof_char=1
+ac_cv_alignof_dbind_pointer=4
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=8
+ac_cv_alignof_double=8
diff --git a/meta/site/mips-linux b/meta/site/mips-linux
new file mode 100644
index 0000000..72a54f9
--- /dev/null
+++ b/meta/site/mips-linux
@@ -0,0 +1,79 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
diff --git a/meta/site/mips-linux-uclibc b/meta/site/mips-linux-uclibc
new file mode 100644
index 0000000..b23363e
--- /dev/null
+++ b/meta/site/mips-linux-uclibc
@@ -0,0 +1,80 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+wi_cv_unix_domain_sockets=${wi_cv_unix_domain_sockets=yes}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
diff --git a/meta/site/mips64-linux b/meta/site/mips64-linux
new file mode 100644
index 0000000..ed0fbbe
--- /dev/null
+++ b/meta/site/mips64-linux
@@ -0,0 +1,83 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+ac_cv_sizeof_ssize_t=8
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# eds-dbus
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
diff --git a/meta/site/mips64-linux-uclibc b/meta/site/mips64-linux-uclibc
new file mode 100644
index 0000000..cbba552
--- /dev/null
+++ b/meta/site/mips64-linux-uclibc
@@ -0,0 +1,83 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+wi_cv_unix_domain_sockets=${wi_cv_unix_domain_sockets=yes}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# eds-dbus
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
+
diff --git a/meta/site/mips64el-linux b/meta/site/mips64el-linux
new file mode 100644
index 0000000..8b61eb0
--- /dev/null
+++ b/meta/site/mips64el-linux
@@ -0,0 +1,82 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+wi_cv_unix_domain_sockets=${wi_cv_unix_domain_sockets=yes}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+#lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# eds-dbus
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
diff --git a/meta/site/mips64el-linux-uclibc b/meta/site/mips64el-linux-uclibc
new file mode 100644
index 0000000..6a0499d
--- /dev/null
+++ b/meta/site/mips64el-linux-uclibc
@@ -0,0 +1,108 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+wi_cv_unix_domain_sockets=${wi_cv_unix_domain_sockets=yes}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+# from samba 3.0.14a on 5/29/2005
+ac_cv_func_memcmp_working=${ac_cv_func_memcmp_working=yes}
+ac_cv_have_asprintf_decl=${ac_cv_have_asprintf_decl=yes}
+ac_cv_have_setresgid_decl=${ac_cv_have_setresgid_decl=yes}
+ac_cv_have_setresuid_decl=${ac_cv_have_setresuid_decl=yes}
+ac_cv_have_vasprintf_decl=${ac_cv_have_vasprintf_decl=yes}
+fu_cv_sys_stat_statvfs64=${fu_cv_sys_stat_statvfs64=yes}
+samba_cv_FTRUNCATE_NEEDS_ROOT=${samba_cv_FTRUNCATE_NEEDS_ROOT=no}
+samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=${samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no}
+samba_cv_HAVE_BROKEN_GETGROUPS=${samba_cv_HAVE_BROKEN_GETGROUPS=no}
+samba_cv_HAVE_BROKEN_READDIR=${samba_cv_HAVE_BROKEN_READDIR=no}
+samba_cv_HAVE_C99_VSNPRINTF=${samba_cv_HAVE_C99_VSNPRINTF=yes}
+samba_cv_HAVE_DEV64_T=${samba_cv_HAVE_DEV64_T=no}
+samba_cv_HAVE_DEVICE_MAJOR_FN=${samba_cv_HAVE_DEVICE_MAJOR_FN=yes}
+samba_cv_HAVE_DEVICE_MINOR_FN=${samba_cv_HAVE_DEVICE_MINOR_FN=yes}
+samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=${samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes}
+samba_cv_HAVE_FCNTL_LOCK=${samba_cv_HAVE_FCNTL_LOCK=yes}
+samba_cv_HAVE_FTRUNCATE_EXTEND=${samba_cv_HAVE_FTRUNCATE_EXTEND=yes}
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_HAVE_INO64_T=${samba_cv_HAVE_INO64_T=no}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_HAVE_MAKEDEV=${samba_cv_HAVE_MAKEDEV=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_OFF64_T=${samba_cv_HAVE_OFF64_T=no}
+samba_cv_HAVE_QUOTACTL_4A=${samba_cv_HAVE_QUOTACTL_4A=yes}
+samba_cv_HAVE_ROOT=${samba_cv_HAVE_ROOT=no}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_STRUCT_DIRENT64=${samba_cv_HAVE_STRUCT_DIRENT64=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+samba_cv_HAVE_TRUNCATED_SALT=${samba_cv_HAVE_TRUNCATED_SALT=no}
+samba_cv_HAVE_UNSIGNED_CHAR=${samba_cv_HAVE_UNSIGNED_CHAR=no}
+samba_cv_HAVE_WORKING_AF_LOCAL=${samba_cv_HAVE_WORKING_AF_LOCAL=no}
+samba_cv_HAVE_Werror=${samba_cv_HAVE_Werror=yes}
+samba_cv_REALPATH_TAKES_NULL=${samba_cv_REALPATH_TAKES_NULL=no}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_SYSCONF_SC_NGROUPS_MAX=${samba_cv_SYSCONF_SC_NGROUPS_MAX=yes}
+samba_cv_SYSCONF_SC_NPROC_ONLN=${samba_cv_SYSCONF_SC_NPROC_ONLN=no}
+samba_cv_SYSQUOTA_FOUND=${samba_cv_SYSQUOTA_FOUND=yes}
+samba_cv_SYSQUOTA_WORKS=${samba_cv_SYSQUOTA_WORKS=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_have_longlong=${samba_cv_have_longlong=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_sysquotas_file=${samba_cv_sysquotas_file=lib/sysquotas_4A.c}
+# This cached value needs a local patch to pick it up, upstream 3.0.14a
+# doesn't cache it.
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
diff --git a/meta/site/mipsel-linux b/meta/site/mipsel-linux
new file mode 100644
index 0000000..696b1be
--- /dev/null
+++ b/meta/site/mipsel-linux
@@ -0,0 +1,79 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# glib-2.0
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+wi_cv_unix_domain_sockets=${wi_cv_unix_domain_sockets=yes}
+
+# db
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# rrdtool
+rd_cv_ieee_works=${rd_cv_ieee_works=yes}
+# ac_cv_path_PERL=${ac_cv_path_PERL=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+
+# intercom
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+#lmbench
+ac_cv_uint=${ac_cv_unit=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# evolution-data-server
+ac_cv_libiconv_utf8=${ac_cv_libiconv_utf8=yes}
diff --git a/meta/site/mipsel-linux-uclibc b/meta/site/mipsel-linux-uclibc
new file mode 100644
index 0000000..f921cda
--- /dev/null
+++ b/meta/site/mipsel-linux-uclibc
@@ -0,0 +1,100 @@
+# general
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=no}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# openssh
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=no}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent=yes}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+
+# glib
+glib_cv___va_copy=${glib_cv___va_copy=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ncftp
+wi_cv_struct_timeval_tv_sec=${wi_cv_struct_timeval_tv_sec=long}
+wi_cv_struct_timeval_tv_usec=${wi_cv_struct_timeval_tv_usec=long}
+wi_cv_unix_domain_sockets=${wi_cv_unix_domain_sockets=yes}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# samba
+# from samba 3.0.14a on 5/29/2005
+ac_cv_func_memcmp_working=${ac_cv_func_memcmp_working=yes}
+ac_cv_have_asprintf_decl=${ac_cv_have_asprintf_decl=yes}
+ac_cv_have_setresgid_decl=${ac_cv_have_setresgid_decl=yes}
+ac_cv_have_setresuid_decl=${ac_cv_have_setresuid_decl=yes}
+ac_cv_have_vasprintf_decl=${ac_cv_have_vasprintf_decl=yes}
+fu_cv_sys_stat_statvfs64=${fu_cv_sys_stat_statvfs64=yes}
+samba_cv_FTRUNCATE_NEEDS_ROOT=${samba_cv_FTRUNCATE_NEEDS_ROOT=no}
+samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=${samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no}
+samba_cv_HAVE_BROKEN_GETGROUPS=${samba_cv_HAVE_BROKEN_GETGROUPS=no}
+samba_cv_HAVE_BROKEN_READDIR=${samba_cv_HAVE_BROKEN_READDIR=no}
+samba_cv_HAVE_C99_VSNPRINTF=${samba_cv_HAVE_C99_VSNPRINTF=yes}
+samba_cv_HAVE_DEV64_T=${samba_cv_HAVE_DEV64_T=no}
+samba_cv_HAVE_DEVICE_MAJOR_FN=${samba_cv_HAVE_DEVICE_MAJOR_FN=yes}
+samba_cv_HAVE_DEVICE_MINOR_FN=${samba_cv_HAVE_DEVICE_MINOR_FN=yes}
+samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=${samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes}
+samba_cv_HAVE_FCNTL_LOCK=${samba_cv_HAVE_FCNTL_LOCK=yes}
+samba_cv_HAVE_FTRUNCATE_EXTEND=${samba_cv_HAVE_FTRUNCATE_EXTEND=yes}
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_HAVE_INO64_T=${samba_cv_HAVE_INO64_T=no}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_HAVE_MAKEDEV=${samba_cv_HAVE_MAKEDEV=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_OFF64_T=${samba_cv_HAVE_OFF64_T=no}
+samba_cv_HAVE_QUOTACTL_4A=${samba_cv_HAVE_QUOTACTL_4A=yes}
+samba_cv_HAVE_ROOT=${samba_cv_HAVE_ROOT=no}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_STRUCT_DIRENT64=${samba_cv_HAVE_STRUCT_DIRENT64=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+samba_cv_HAVE_TRUNCATED_SALT=${samba_cv_HAVE_TRUNCATED_SALT=no}
+samba_cv_HAVE_UNSIGNED_CHAR=${samba_cv_HAVE_UNSIGNED_CHAR=no}
+samba_cv_HAVE_WORKING_AF_LOCAL=${samba_cv_HAVE_WORKING_AF_LOCAL=no}
+samba_cv_HAVE_Werror=${samba_cv_HAVE_Werror=yes}
+samba_cv_REALPATH_TAKES_NULL=${samba_cv_REALPATH_TAKES_NULL=no}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_SYSCONF_SC_NGROUPS_MAX=${samba_cv_SYSCONF_SC_NGROUPS_MAX=yes}
+samba_cv_SYSCONF_SC_NPROC_ONLN=${samba_cv_SYSCONF_SC_NPROC_ONLN=no}
+samba_cv_SYSQUOTA_FOUND=${samba_cv_SYSQUOTA_FOUND=yes}
+samba_cv_SYSQUOTA_WORKS=${samba_cv_SYSQUOTA_WORKS=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_have_longlong=${samba_cv_have_longlong=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_sysquotas_file=${samba_cv_sysquotas_file=lib/sysquotas_4A.c}
+# This cached value needs a local patch to pick it up, upstream 3.0.14a
+# doesn't cache it.
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
diff --git a/meta/site/native b/meta/site/native
new file mode 100644
index 0000000..7dfb1cb
--- /dev/null
+++ b/meta/site/native
@@ -0,0 +1 @@
+ac_cv_path_SED=sed
diff --git a/meta/site/powerpc-common b/meta/site/powerpc-common
new file mode 100644
index 0000000..efa299c
--- /dev/null
+++ b/meta/site/powerpc-common
@@ -0,0 +1,14 @@
+# glib
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=4
+
+# at-spi2-core
+ac_cv_alignof_char=1
+ac_cv_alignof_dbind_pointer=4
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=8
+ac_cv_alignof_double=8
diff --git a/meta/site/powerpc-darwin b/meta/site/powerpc-darwin
new file mode 100644
index 0000000..085f50b
--- /dev/null
+++ b/meta/site/powerpc-darwin
@@ -0,0 +1,7 @@
+# pkgconfig-native for OS X buid
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
diff --git a/meta/site/powerpc-linux b/meta/site/powerpc-linux
new file mode 100644
index 0000000..a9f89cb
--- /dev/null
+++ b/meta/site/powerpc-linux
@@ -0,0 +1,16 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+
+# startup-notification
+lf_cv_sane_realloc=yes
+
+# glib
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+
+# lftp
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
diff --git a/meta/site/powerpc32-linux b/meta/site/powerpc32-linux
new file mode 100644
index 0000000..e3929ac
--- /dev/null
+++ b/meta/site/powerpc32-linux
@@ -0,0 +1,275 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_bool=${ac_cv_sizeof_bool=1}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
+ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
+ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_int_p=${ac_cv_sizeof_int_p=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_p=${ac_cv_sizeof_long_p=4}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_long_long_int=${ac_cv_sizeof_long_long_int=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_unsigned_long_int=${ac_cv_sizeof_unsigned_long_int=4}
+ac_cv_sizeof_unsigned_long_long_int=${ac_cv_sizeof_unsigned_long_long_int=8}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned_short_int=${ac_cv_sizeof_unsigned_short_int=2}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_wchar_t=${ac_cv_sizeof_wchar_t=4}
+ac_cv_type___int64=${ac_cv_type___int64=no}
+ac_cv_type_size_t=${ac_cv_type_size_t=yes}
+ac_cv_type_void_p=${ac_cv_type_void_p=yes}
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+cookie_io_functions_use_off64_t=${cookie_io_functions_use_off64_t=yes}
+
+
+# apache
+ac_cv_func_pthread_key_delete=${ac_cv_func_pthread_key_delete=yes}
+apr_cv_process_shared_works=${apr_cv_process_shared_works=no}
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+
+ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no}
+ac_cv_header_netinet_sctp_uio_h=${ac_cv_header_netinet_sctp_uio_h=no}
+ac_cv_sctp=${ac_cv_sctp=no}
+
+# ssh
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_dirent_have_space_d_name=yes}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_type_struct_timespec=${ac_cv_type_struct_timespec=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=yes}
+
+# coreutils
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1019}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# nano
+ac_cv_regexec_segfault_emptystr=${ac_cv_regexec_segfault_emptystr=no}
+nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
+
+
+# libnet
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+
+# socat
+ac_cv_ispeed_offset=${ac_cv_ispeed_offset=13}
+sc_cv_termios_ispeed=${sc_cv_termios_ispeed=yes}
+
+# links
+ac_cv_lib_png_png_create_info_struct=${ac_cv_lib_png_png_create_info_struct=yes}
+
+# db
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+
+# php
+ac_cv_pread=${ac_cv_pread=no}
+ac_cv_pwrite=${ac_cv_pwrite=no}
+php_cv_lib_cookie_io_functions_use_off64_t=${php_cv_lib_cookie_io_functions_use_off64_t=yes}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# glib
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+
+# ettercap
+ettercap_cv_type_socklen_t=${ettercap_cv_type_socklen_t=yes}
+
+# libesmtp
+acx_working_snprintf=${acx_working_snprintf=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# glib 2.0
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=4}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_sys_use_pid_niceness_surrogate=${glib_cv_sys_use_pid_niceness_surrogate=yes}
+
+glib_cv_strlcpy=${glib_cv_strlcpy=no}
+
+# httppc
+ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
+
+# lftp
+ac_cv_need_trio=${ac_cv_need_trio=no}
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+
+# edb
+db_cv_spinlocks=${db_cv_spinlocks=no}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+compat_cv_func_basename_works=${compat_cv_func_basename_works=no}
+compat_cv_func_dirname_works=${compat_cv_func_dirname_works=no}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=4
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=4
+ac_cv_alignof_CORBA_long_long=4
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=4
+ac_cv_alignof_CORBA_wchar=2
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=missing}
+
+# openssh
+ac_cv_have_broken_dirname=${ac_cv_have_broken_dirname='yes'}
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_have_space_d_name_in_struct_dirent='no'}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf='no'}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug='yes'}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr='no'}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr='yes'}
+
+# vim
+ac_cv_sizeof_int=${ac_cv_sizeof_int='4'}
+
+#modphp 
+ac_cv_c_bigendian_php=${ac_cv_c_bigendian_php=yes}
+ac_cv_sizeof_ptrdiff_t=${ac_cv_sizeof_ptrdiff_t=4}
+
+# apache2 (note other apache stanza in this file)
+ap_void_ptr_lt_long=${ap_void_ptr_lt_long=no}
+apr_cv_use_lfs64=${apr_cv_use_lfs64=yes}
+apr_cv_epoll=${apr_cv_epoll=yes}
+apr_cv_pthreads_cflags=${apr_cv_pthreads_cflags=-pthread}
+apr_cv_pthreads_lib=${apr_cv_pthreads_lib=-lpthread}
+ac_cv_func_mmap=${ac_cv_func_mmap=yes}
+ac_cv_file__dev_zero=${ac_cv_file__dev_zero=yes}
+ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=4}
+ac_cv_sizeof_pid_t=${ac_cv_sizeof_pid_t=4}
+ac_cv_socklen_t=${ac_cv_socklen_t=yes}
+ac_cv_struct_rlimit=${ac_cv_struct_rlimit=yes}
+ac_cv_negative_eai=${ac_cv_negative_eai=yes}
+apr_cv_gai_addrconfig=${apr_cv_gai_addrconfig=no}
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+
+# binutils (libiberty)
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_type_int=${ac_cv_type_int=yes}
+ac_cv_type_uintptr_t=${ac_cv_type_uintptr_t=yes}
+liberty_cv_uint64=${liberty_cv_uint64=uint64_t}
+
+#samba
+ac_cv_func_memcmp_working=${ac_cv_func_memcmp_working=yes}
+fu_cv_sys_stat_statvfs64=${fu_cv_sys_stat_statvfs64=yes}
+samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=${samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no}
+samba_cv_HAVE_BROKEN_GETGROUPS=${samba_cv_HAVE_BROKEN_GETGROUPS=no}
+samba_cv_HAVE_BROKEN_READDIR=${samba_cv_HAVE_BROKEN_READDIR=yes}
+samba_cv_HAVE_BROKEN_READDIR_NAME=${samba_cv_HAVE_BROKEN_READDIR_NAME=no}
+samba_cv_HAVE_C99_VSNPRINTF=${samba_cv_HAVE_C99_VSNPRINTF=yes}
+samba_cv_HAVE_DEV64_T=${samba_cv_HAVE_DEV64_T=no}
+samba_cv_HAVE_DEVICE_MAJOR_FN=${samba_cv_HAVE_DEVICE_MAJOR_FN=yes}
+samba_cv_HAVE_DEVICE_MINOR_FN=${samba_cv_HAVE_DEVICE_MINOR_FN=yes}
+samba_cv_HAVE_FCNTL_LOCK=${samba_cv_HAVE_FCNTL_LOCK=yes}
+samba_cv_HAVE_FTRUNCATE_EXTEND=${samba_cv_HAVE_FTRUNCATE_EXTEND=yes}
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_HAVE_INO64_T=${samba_cv_HAVE_INO64_T=no}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_HAVE_MAKEDEV=${samba_cv_HAVE_MAKEDEV=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_OFF64_T=${samba_cv_HAVE_OFF64_T=no}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+samba_cv_HAVE_TRUNCATED_SALT=${samba_cv_HAVE_TRUNCATED_SALT=no}
+samba_cv_HAVE_UNSIGNED_CHAR=${samba_cv_HAVE_UNSIGNED_CHAR=yes}
+samba_cv_HAVE_WORKING_AF_LOCAL=${samba_cv_HAVE_WORKING_AF_LOCAL=yes}
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
+samba_cv_REALPATH_TAKES_NULL=${samba_cv_REALPATH_TAKES_NULL=yes}
+samba_cv_REPLACE_INET_NTOA=${samba_cv_REPLACE_INET_NTOA=no}
+samba_cv_REPLACE_READDIR=${samba_cv_REPLACE_READDIR=no}
+samba_cv_SIZEOF_DEV_T=${samba_cv_SIZEOF_DEV_T=yes}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_STAT_STATVFS64=${samba_cv_STAT_STATVFS64=yes}
+samba_cv_USE_SETEUID=${samba_cv_USE_SETEUID=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_USE_SETREUID=${samba_cv_USE_SETREUID=yes}
+samba_cv_USE_SETUIDX=${samba_cv_USE_SETUIDX=yes}
+samba_cv_have_longlong=${samba_cv_have_longlong=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+
+# mysql
+mysql_cv_func_atomic_sub=${mysql_cv_func_atomic_sub=no}
+mysql_cv_func_atomic_add=${mysql_cv_func_atomic_add=no}
+
+
+# libc
+libc_cv_ppc_machine=${libc_cv_ppc_machine=yes}
+libc_cv_mlong_double_128ibm=${libc_cv_mlong_double_128ibm=yes}
+libc_cv_mabi_ibmlongdouble=${libc_cv_mabi_ibmlongdouble=yes}
+libc_cv_mlong_double_128=${libc_cv_mlong_double_128=yes}
diff --git a/meta/site/powerpc64-linux b/meta/site/powerpc64-linux
new file mode 100644
index 0000000..d64e230
--- /dev/null
+++ b/meta/site/powerpc64-linux
@@ -0,0 +1,39 @@
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=8}
+ac_cv_sizeof_double=${ac_cv_sizeof_double=8}
+ac_cv_sizeof_float=${ac_cv_sizeof_float=4}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=8}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=8}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_long_long_int=${ac_cv_sizeof_long_long_int=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+ac_cv_sizeof_unsigned_char=${ac_cv_sizeof_unsigned_char=1}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=8}
+ac_cv_sizeof_unsigned_long_int=${ac_cv_sizeof_unsigned_long_int=8}
+ac_cv_sizeof_unsigned_long_long_int=${ac_cv_sizeof_unsigned_long_long_int=8}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned_short_int=${ac_cv_sizeof_unsigned_short_int=2}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=8}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# apr
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+
diff --git a/meta/site/sh-common b/meta/site/sh-common
new file mode 100644
index 0000000..bde416a
--- /dev/null
+++ b/meta/site/sh-common
@@ -0,0 +1,238 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=yes}
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_unsigned_long_long=${ac_cv_sizeof_unsigned_long_long=8}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+
+# lzo
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+
+# apache
+ac_cv_func_pthread_key_delete=${ac_cv_func_pthread_key_delete=yes}
+apr_cv_process_shared_works=${apr_cv_process_shared_works=no}
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+ac_cv_sizeof_ssize_t=${ac_cv_sizeof_ssize_t=4}
+
+ac_cv_header_netinet_sctp_h=${ac_cv_header_netinet_sctp_h=no}
+ac_cv_header_netinet_sctp_uio_h=${ac_cv_header_netinet_sctp_uio_h=no}
+ac_cv_sctp=${ac_cv_sctp=no}
+
+# ssh
+ac_cv_have_space_d_name_in_struct_dirent=${ac_cv_dirent_have_space_d_name=yes}
+ac_cv_have_broken_snprintf=${ac_cv_have_broken_snprintf=no}
+ac_cv_have_accrights_in_msghdr=${ac_cv_have_accrights_in_msghdr=no}
+ac_cv_have_control_in_msghdr=${ac_cv_have_control_in_msghdr=yes}
+ac_cv_have_openpty_ctty_bug=${ac_cv_have_openpty_ctty_bug=yes}
+
+# coreutils
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1019}
+
+# libpcap
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+
+# nano
+ac_cv_regexec_segfault_emptystr=${ac_cv_regexec_segfault_emptystr=no}
+nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
+
+# screen
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+
+# socat
+ac_cv_ispeed_offset=${ac_cv_ispeed_offset=13}
+sc_cv_termios_ispeed=${sc_cv_termios_ispeed=yes}
+
+# links
+ac_cv_lib_png_png_create_info_struct=${ac_cv_lib_png_png_create_info_struct=yes}
+
+# samba
+samba_cv_HAVE_GETTIMEOFDAY_TZ=${samba_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+samba_cv_USE_SETEUID=${samba_cv_USE_SETEUID=yes}
+samba_cv_USE_SETRESUID=${samba_cv_USE_SETRESUID=yes}
+samba_cv_USE_SETREUID=${samba_cv_USE_SETREUID=yes}
+samba_cv_USE_SETUIDX=${samba_cv_USE_SETUIDX=yes}
+samba_cv_have_setresgid=${samba_cv_have_setresgid=yes}
+samba_cv_have_setresuid=${samba_cv_have_setresuid=yes}
+samba_cv_HAVE_SENDFILE=${samba_cv_HAVE_SENDFILE=yes}
+samba_cv_HAVE_SENDFILE64=${samba_cv_HAVE_SENDFILE64=yes}
+samba_cv_HAVE_SECURE_MKSTEMP=${samba_cv_HAVE_SECURE_MKSTEMP=yes}
+samba_cv_HAVE_MMAP=${samba_cv_HAVE_MMAP=yes}
+samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=${samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes}
+samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=${samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes}
+samba_cv_HAVE_KERNEL_SHARE_MODES=${samba_cv_HAVE_KERNEL_SHARE_MODES=yes}
+samba_cv_LINUX_LFS_SUPPORT=${samba_cv_LINUX_LFS_SUPPORT=yes}
+samba_cv_STAT_STATVFS64=${samba_cv_STAT_STATVFS64=yes}
+samba_cv_SIZEOF_OFF_T=${samba_cv_SIZEOF_OFF_T=yes}
+samba_cv_SIZEOF_INO_T=${samba_cv_SIZEOF_INO_T=yes}
+samba_cv_HAVE_STRUCT_FLOCK64=${samba_cv_HAVE_STRUCT_FLOCK64=yes}
+
+# db
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long'}
+
+# php
+ac_cv_pread=${ac_cv_pread=no}
+ac_cv_pwrite=${ac_cv_pwrite=no}
+php_cv_lib_cookie_io_functions_use_off64_t=${php_cv_lib_cookie_io_functions_use_off64_t=yes}
+
+# glib
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=no}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+
+# ettercap
+ettercap_cv_type_socklen_t=${ettercap_cv_type_socklen_t=yes}
+
+# libesmtp
+acx_working_snprintf=${acx_working_snprintf=yes}
+
+# D-BUS
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+
+# glib 2.0
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=4}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=4}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_sys_use_pid_niceness_surrogate=${glib_cv_sys_use_pid_niceness_surrogate=yes}
+
+glib_cv_strlcpy=${glib_cv_strlcpy=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=4
+
+# httppc
+ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
+
+# jikes
+ac_cv_sizeof_wchar_t=4
+
+# lftp
+ac_cv_need_trio=${ac_cv_need_trio=no}
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=yes}
+
+# edb
+db_cv_spinlocks=${db_cv_spinlocks=no}
+
+# fget
+compat_cv_func_snprintf_works=${compat_cv_func_snprintf_works=yes}
+compat_cv_func_basename_works=${compat_cv_func_basename_works=no}
+compat_cv_func_dirname_works=${compat_cv_func_dirname_works=no}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=yes}
+
+# startup-notification
+lf_cv_sane_realloc=yes
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=4
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=4
+ac_cv_alignof_CORBA_long_long=4
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=4
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=4
+ac_cv_alignof_CORBA_wchar=2
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# bash
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=missing}
+
+# mysql
+mysql_cv_func_atomic_sub=${mysql_cv_func_atomic_sub=no}
+mysql_cv_func_atomic_add=${mysql_cv_func_atomic_add=no}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# fnmatch
+ac_cv_func_fnmatch_works=${ac_cv_func_fnmatch_works=yes}
+
+# rsync
+rsync_cv_HAVE_BROKEN_LARGEFILE=${rsync_cv_HAVE_BROKEN_LARGEFILE=no}
+rsync_cv_HAVE_SOCKETPAIR=${rsync_cv_HAVE_SOCKETPAIR=yes}
+rsync_cv_HAVE_LONGLONG=${rsync_cv_HAVE_LONGLONG=yes}
+rsync_cv_HAVE_OFF64_T=${rsync_cv_HAVE_OFF64_T=no}
+rsync_cv_HAVE_SHORT_INO_T=${rsync_cv_HAVE_SHORT_INO_T=no}
+rsync_cv_HAVE_UNSIGNED_CHAR=${rsync_cv_HAVE_UNSIGNED_CHAR=no}
+rsync_cv_HAVE_BROKEN_READDIR=${rsync_cv_HAVE_BROKEN_READDIR=no}
+rsync_cv_HAVE_GETTIMEOFDAY_TZ=${rsync_cv_HAVE_GETTIMEOFDAY_TZ=yes}
+rsync_cv_HAVE_C99_VSNPRINTF=${rsync_cv_HAVE_C99_VSNPRINTF=yes}
+rsync_cv_HAVE_SECURE_MKSTEMP=${rsync_cv_HAVE_SECURE_MKSTEMP=yes}
+rsync_cv_REPLACE_INET_NTOA=${rsync_cv_REPLACE_INET_NTOA=no}
+rsync_cv_REPLACE_INET_ATON=${rsync_cv_REPLACE_INET_ATON=no}
+
+# libxfce4util
+with_broken_putenv=${with_broken_putenv=no}
+
+# clamav
+clamav_av_func_working_snprintf_long=${clamav_av_func_working_snprintf_long=yes}
+clamav_av_have_in_port_t=${clamav_av_have_in_port_t=yes}
+clamav_av_have_in_addr_t=${clamav_av_have_in_addr_t=yes}
+ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped=yes}
+
+# libnet 
+ac_cv_lbl_unaligned_fail=${ac_cv_lbl_unaligned_fail=no}
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
diff --git a/meta/site/sparc-linux b/meta/site/sparc-linux
new file mode 100644
index 0000000..49d0d9a
--- /dev/null
+++ b/meta/site/sparc-linux
@@ -0,0 +1,48 @@
+ac_cv_func_setvbuf_reversed=no
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=4}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=4}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=4}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=4}
+ac_cv_sizeof_unsigned_long_long=${ac_cv_sizeof_unsigned_long_long=8}
+ac_cv_sizeof_signed_char=${ac_cv_sizeof_signed_char=1}
+
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=8}
+libc_cv_mlong_double_128ibm=${libc_cv_mlong_double_128ibm=yes}
+libc_cv_mlong_double_128=${libc_cv_mlong_double_128=yes}
+ac_cv_alignof_CORBA_long_double=4
+ac_cv_c_long_double=${ac_cv_c_long_double=yes}
+
+
+ac_cv_uchar=${ac_cv_uchar=no}
+ac_cv_uint=${ac_cv_uint=yes}
+ac_cv_ulong=${ac_cv_ulong=yes}
+ac_cv_ushort=${ac_cv_ushort=yes}
+
+ac_cv_time_r_type=${ac_cv_time_r_type=POSIX}
+cookie_io_functions_use_off64_t=${cookie_io_functions_use_off64_t=yes}
+
+# minicom
+am_cv_sys_posix_termios=${am_cv_sys_posix_termios=yes}
+
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+#glib
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=4}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=24} 
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+
+#linux
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
diff --git a/meta/site/x32-linux b/meta/site/x32-linux
new file mode 100644
index 0000000..36ee68b
--- /dev/null
+++ b/meta/site/x32-linux
@@ -0,0 +1,10 @@
+# general
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
+ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=8}
+ac_cv_sizeof_ino_t=${ac_cv_sizeof_ino_t=8}
+ac_cv_sizeof_dev_t=${ac_cv_sizeof_dev_t=8}
+ac_cv_sys_file_offset_bits=${ac_cv_sys_file_offset_bits=64}
+ac_cv_alignof_double=8
+
+# glib
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=32}
diff --git a/meta/site/x86_64-linux b/meta/site/x86_64-linux
new file mode 100644
index 0000000..573a907
--- /dev/null
+++ b/meta/site/x86_64-linux
@@ -0,0 +1,136 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=no}
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+ac_cv_need_trio=${ac_cv_need_trio=no}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_unsigned_int=${ac_cv_sizeof_unsigned_int=4}
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=8}
+ac_cv_sizeof_unsigned_long=${ac_cv_sizeof_unsigned_long=8}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=8}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_off_t=${ac_cv_sizeof_off_t=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_unsigned_short=${ac_cv_sizeof_unsigned_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=8}
+ac_cv_sizeof_uid_t=${ac_cv_sizeof_uid_t=4}
+ac_cv_sizeof_gid_t=${ac_cv_sizeof_gid_t=4}
+ac_cv_sizeof_ino_t=${ac_cv_sizeof_ino_t=8}
+ac_cv_sizeof_dev_t=${ac_cv_sizeof_dev_t=8}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=8}
+ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long long'}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+
+# glib
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=40}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=8}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=8}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=8}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=no}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+
+nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
+samba_cv_HAVE_VA_COPY=${samba_cv_HAVE_VA_COPY=yes}
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+#gcc
+ac_cv_lib_m_sin=${ac_cv_lib_m_sin=yes}
+
+#orbit
+libIDL_cv_long_long_format=ll
+
+# bash
+bash_cv_func_sigsetjmp=${bash_cv_func_sigsetjmp=present}
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=8
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=8
+ac_cv_alignof_CORBA_long_long=8
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=8
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=1
+ac_cv_alignof_CORBA_wchar=2
+
+lf_cv_sane_realloc=yes
+as_cv_unaligned_access=${as_cv_unaligned_access=yes}
+
+#unfs3
+nfsd_cv_broken_setfsuid=${nfsd_cv_broken_setfsuid=0}
+nfsd_cv_func_statfs=${nfsd_cv_func_statfs=statfs2_bsize}
+nfsd_cv_bsd_signals=${nfsd_cv_bsd_signals=yes}
+
+#apr
+apr_cv_tcp_nodelay_with_cork=${apr_cv_tcp_nodelay_with_cork=yes}
+
+# lftp
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=no}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=no}
+
+# grub
+ac_cv_func___ashldi3=no
+ac_cv_func___ashrdi3=no
+ac_cv_func___bswapdi2=no
+ac_cv_func___bswapsi2=no
+ac_cv_func___lshrdi3=no
+ac_cv_func___trampoline_setup=no
+ac_cv_func___ucmpdi2=no
+ac_cv_func__restgpr_14_x=no
+
+# cvs
+cvs_cv_func_printf_ptr=${cvs_cv_func_printf_ptr=yes}
+
+# at-spi2-core
+ac_cv_alignof_char=1
+ac_cv_alignof_dbind_pointer=8
+ac_cv_alignof_dbind_struct=1
+ac_cv_alignof_dbus_bool_t=4
+ac_cv_alignof_dbus_int16_t=2
+ac_cv_alignof_dbus_int32_t=4
+ac_cv_alignof_dbus_int64_t=8
+ac_cv_alignof_double=8
diff --git a/meta/site/x86_64-linux-uclibc b/meta/site/x86_64-linux-uclibc
new file mode 100644
index 0000000..2d269f7
--- /dev/null
+++ b/meta/site/x86_64-linux-uclibc
@@ -0,0 +1,91 @@
+# general
+ac_cv_va_val_copy=${ac_cv_va_val_copy=no}
+ac_cv_func_lstat_dereferences_slashed_symlink=${ac_cv_func_lstat_dereferences_slashed_symlink=yes}
+ac_cv_func_lstat_empty_string_bug=${ac_cv_func_lstat_empty_string_bug=no}
+ac_cv_func_posix_getpwnam_r=${ac_cv_func_posix_getpwnam_r=yes}
+ac_cv_func_setvbuf_reversed=${ac_cv_func_setvbuf_reversed=no}
+ac_cv_func_stat_empty_string_bug=${ac_cv_func_stat_empty_string_bug=no}
+ac_cv_func_stat_ignores_trailing_slash=${ac_cv_func_stat_ignores_trailing_slash=no}
+ac_libnet_have_packet_socket=${ac_libnet_have_packet_socket=yes}
+ac_cv_linux_vers=${ac_cv_linux_vers=2}
+ac_cv_need_trio=${ac_cv_need_trio=no}
+ac_cv_sizeof_char=${ac_cv_sizeof_char=1}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof___int64=${ac_cv_sizeof___int64=0}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=8}
+ac_cv_sizeof_long_double=${ac_cv_sizeof_long_double=16}
+ac_cv_sizeof_long_int=${ac_cv_sizeof_long_int=8}
+ac_cv_sizeof_long_long=${ac_cv_sizeof_long_long=8}
+ac_cv_sizeof_short=${ac_cv_sizeof_short=2}
+ac_cv_sizeof_short_int=${ac_cv_sizeof_short_int=2}
+ac_cv_sizeof_size_t=${ac_cv_sizeof_size_t=8}
+ac_cv_sizeof_void_p=${ac_cv_sizeof_void_p=8}
+ac_cv_strerror_r_SUSv3=${ac_cv_strerror_r_SUSv3=no}
+db_cv_alignp_t=${db_cv_alignp_t='unsigned long long'}
+db_cv_align_t=${db_cv_align_t='unsigned long long'}
+db_cv_fcntl_f_setfd=${db_cv_fcntl_f_setfd=yes}
+db_cv_sprintf_count=${db_cv_sprintf_count=yes}
+glib_cv_hasinline=${glib_cv_hasinline=yes}
+glib_cv_has__inline=${glib_cv_has__inline=yes}
+glib_cv_has__inline__=${glib_cv_has__inline__=yes}
+glib_cv_long_long_format=${glib_cv_long_long_format=ll}
+glib_cv_rtldglobal_broken=${glib_cv_rtldglobal_broken=yes}
+glib_cv_sane_realloc=${glib_cv_sane_realloc=yes}
+glib_cv_sizeof_gmutex=${glib_cv_sizeof_gmutex=40}
+glib_cv_sizeof_intmax_t=${glib_cv_sizeof_intmax_t=8}
+glib_cv_sizeof_ptrdiff_t=${glib_cv_sizeof_ptrdiff_t=8}
+glib_cv_sizeof_size_t=${glib_cv_sizeof_size_t=8}
+glib_cv_sizeof_system_thread=${glib_cv_sizeof_system_thread=8}
+glib_cv_stack_grows=${glib_cv_stack_grows=no}
+glib_cv_sys_pthread_cond_timedwait_posix=${glib_cv_sys_pthread_cond_timedwait_posix=yes}
+glib_cv_sys_pthread_getspecific_posix=${glib_cv_sys_pthread_getspecific_posix=yes}
+glib_cv_sys_pthread_mutex_trylock_posix=${glib_cv_sys_pthread_mutex_trylock_posix=yes}
+glib_cv_uscore=${glib_cv_uscore=no}
+glib_cv_va_val_copy=${glib_cv_va_val_copy=no}
+nano_cv_func_regexec_segv_emptystr=${nano_cv_func_regexec_segv_emptystr=no}
+samba_cv_HAVE_VA_COPY=${samba_cv_HAVE_VA_COPY=yes}
+screen_cv_sys_bcopy_overlap=${screen_cv_sys_bcopy_overlap=no}
+screen_cv_sys_fifo_broken_impl=${screen_cv_sys_fifo_broken_impl=yes}
+screen_cv_sys_fifo_usable=${screen_cv_sys_fifo_usable=yes}
+screen_cv_sys_memcpy_overlap=${screen_cv_sys_memcpy_overlap=no}
+screen_cv_sys_memmove_overlap=${screen_cv_sys_memmove_overlap=no}
+screen_cv_sys_select_broken_retval=${screen_cv_sys_select_broken_retval=no}
+screen_cv_sys_sockets_nofs=${screen_cv_sys_sockets_nofs=no}
+screen_cv_sys_sockets_usable=${screen_cv_sys_sockets_usable=yes}
+screen_cv_sys_terminfo_used=${screen_cv_sys_terminfo_used=yes}
+utils_cv_sys_open_max=${utils_cv_sys_open_max=1015}
+
+# gettext
+am_cv_func_working_getline=${am_cv_func_working_getline=yes}
+
+# glib-2.0
+glib_cv_use_pid_surrogate=${glib_cv_use_pid_surrogate=yes}
+ac_cv_alignof_guint32=4
+ac_cv_alignof_guint64=8
+ac_cv_alignof_unsigned_long=8
+
+# libidl
+libIDL_cv_long_long_format=${libIDL_cv_long_long_format=ll}
+
+# ORBit2
+ac_cv_alignof_CORBA_boolean=1
+ac_cv_alignof_CORBA_char=1
+ac_cv_alignof_CORBA_double=4
+ac_cv_alignof_CORBA_float=4
+ac_cv_alignof_CORBA_long=4
+ac_cv_alignof_CORBA_long_double=8
+ac_cv_alignof_CORBA_long_long=8
+ac_cv_alignof_CORBA_octet=1
+ac_cv_alignof_CORBA_pointer=8
+ac_cv_alignof_CORBA_short=2
+ac_cv_alignof_CORBA_struct=1
+ac_cv_alignof_CORBA_wchar=2
+
+# startup-notification
+lf_cv_sane_realloc=${lf_cv_sane_realloc=yes}
+
+# lftp
+lftp_cv_va_val_copy=${lftp_cv_va_val_copy=no}
+
+# slrn
+slrn_cv_va_val_copy=${slrn_cv_va_val_copy=no}